From: support
Date: Tue, 28 Jun 2022 17:50:20 +0000 (+0000)
Subject: Built motion from commit 905d04ca.|2.6.11
X-Git-Url: http://repos.xcallymotion.com/base/%22angular-material.themes.css//%22?a=commitdiff_plain;h=b5575e209fa9d0837e26581be287cf95e8bb37f2;p=motion2.git
Built motion from commit 905d04ca.|2.6.11
---
diff --git a/apidoc/api_project.js b/apidoc/api_project.js
index 752ffc7..c183f5a 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-06-27T10:53:29.357Z",
+ "time": "2022-06-28T17:41:41.712Z",
"url": "http://apidocjs.com",
"version": "0.24.0"
}
diff --git a/apidoc/api_project.json b/apidoc/api_project.json
index 93e4371..1850a6a 100644
--- a/apidoc/api_project.json
+++ b/apidoc/api_project.json
@@ -17,7 +17,7 @@
"apidoc": "0.3.0",
"generator": {
"name": "apidoc",
- "time": "2022-06-27T10:53:29.357Z",
+ "time": "2022-06-28T17:41:41.712Z",
"url": "http://apidocjs.com",
"version": "0.24.0"
}
diff --git a/legacy-libs/gaxios/build/src/gaxios.js b/legacy-libs/gaxios/build/src/gaxios.js
index f8ac274..d5d40ea 100644
--- a/legacy-libs/gaxios/build/src/gaxios.js
+++ b/legacy-libs/gaxios/build/src/gaxios.js
@@ -1,4 +1,5 @@
"use strict";
+require('core-js/web')
// Copyright 2018, Google, LLC.
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
diff --git a/npm-shrinkwrap.json b/npm-shrinkwrap.json
index 224f778..e853f1b 100644
--- a/npm-shrinkwrap.json
+++ b/npm-shrinkwrap.json
@@ -88,9 +88,9 @@
"resolved": "https://registry.npmjs.org/accepts/-/accepts-1.3.8.tgz"
},
"acorn": {
- "version": "5.7.1",
- "from": "acorn@5.7.1",
- "resolved": "https://registry.npmjs.org/acorn/-/acorn-5.7.1.tgz"
+ "version": "6.4.2",
+ "from": "acorn@6.4.2",
+ "resolved": "https://registry.npmjs.org/acorn/-/acorn-6.4.2.tgz"
},
"acorn-globals": {
"version": "4.3.4",
@@ -354,7 +354,14 @@
"babel-runtime": {
"version": "6.26.0",
"from": "babel-runtime@>=6.26.0 <7.0.0",
- "resolved": "https://registry.npmjs.org/babel-runtime/-/babel-runtime-6.26.0.tgz"
+ "resolved": "https://registry.npmjs.org/babel-runtime/-/babel-runtime-6.26.0.tgz",
+ "dependencies": {
+ "core-js": {
+ "version": "2.6.12",
+ "from": "core-js@>=2.4.0 <3.0.0",
+ "resolved": "https://registry.npmjs.org/core-js/-/core-js-2.6.12.tgz"
+ }
+ }
},
"babel-types": {
"version": "6.26.0",
@@ -915,9 +922,9 @@
"resolved": "https://registry.npmjs.org/copy-descriptor/-/copy-descriptor-0.1.1.tgz"
},
"core-js": {
- "version": "2.6.12",
- "from": "core-js@>=2.4.0 <3.0.0",
- "resolved": "https://registry.npmjs.org/core-js/-/core-js-2.6.12.tgz"
+ "version": "3.23.3",
+ "from": "core-js@>=3.0.0 <4.0.0",
+ "resolved": "https://registry.npmjs.org/core-js/-/core-js-3.23.3.tgz"
},
"core-util-is": {
"version": "1.0.2",
@@ -2452,6 +2459,11 @@
"from": "jsdom@12.0.0",
"resolved": "https://registry.npmjs.org/jsdom/-/jsdom-12.0.0.tgz",
"dependencies": {
+ "acorn": {
+ "version": "5.7.4",
+ "from": "acorn@>=5.7.1 <6.0.0",
+ "resolved": "https://registry.npmjs.org/acorn/-/acorn-5.7.4.tgz"
+ },
"ajv": {
"version": "6.12.6",
"from": "ajv@>=6.12.3 <7.0.0",
diff --git a/package.json b/package.json
index 2465c10..40ed927 100644
--- a/package.json
+++ b/package.json
@@ -49,7 +49,7 @@
"dependencies": {
"@types/express-serve-static-core": "4.17.28",
"@types/node": "6.14.13",
- "acorn": "5.7.1",
+ "acorn": "^6.4.2",
"activedirectory2": "2.1.0",
"apiai-promise": "git+https://github.com/gcareri/apiai-promise.git",
"archiver": "2.1.1",
@@ -63,6 +63,7 @@
"composable-middleware": "0.3.0",
"connect-timeout": "1.9.0",
"cookie-parser": "1.4.5",
+ "core-js": "^3.23.3",
"cors": "2.8.5",
"cron-job-manager": "1.0.7",
"crypto-js": "3.1.9-1",
@@ -155,7 +156,6 @@
"zip-dir": "1.0.2"
},
"devDependencies": {
- "acorn": "6.4.2",
"apidoc": "0.24.0",
"chai": "3.5.0",
"chai-http": "3.0.0",
diff --git a/server/api/action/action.attributes.js b/server/api/action/action.attributes.js
index e05e143..67c1168 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 _0x4951=['action','STRING','contactManager','integration','motionbar','jscripty','urlForward','browser','bot','script','Allowed\x20values:\x20contactManager,\x20integration,\x20motionbar,\x20jscripty,\x20urlForward,\x20browser,\x20bot,\x20script','contactManager[autoCreate(0=No,1=Yes)],\x20urlForward[URL],\x20script[type],\x20integration[AccountId],\x20motionbar[TemplateId,URL,WinAppPath],\x20browser[TemplateId,URL]','browser[location(0=NewTab,1=NewWindow,2=MotionTab)],\x20contactManager[autoCreateField]','urlForward[headers],\x20browser[wsindowHeight]','TEXT','getDataValue'];(function(_0xad2680,_0x46aeda){var _0x16a60b=function(_0x204606){while(--_0x204606){_0xad2680['push'](_0xad2680['shift']());}};_0x16a60b(++_0x46aeda);}(_0x4951,0x11f));var _0x1495=function(_0x3a9236,_0x50ab9d){_0x3a9236=_0x3a9236-0x0;var _0x5b0ba6=_0x4951[_0x3a9236];return _0x5b0ba6;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize['VIRTUAL'],'get':function(_0x34d3c7){return this[_0x1495('0x0')](_0x1495('0x1'));}},'action':{'type':Sequelize[_0x1495('0x2')],'allowNull':![],'validate':{'isIn':{'args':[[_0x1495('0x3'),_0x1495('0x4'),_0x1495('0x5'),_0x1495('0x6'),_0x1495('0x7'),_0x1495('0x8'),_0x1495('0x9'),_0x1495('0xa')]],'msg':'Allowed\x20values:\x20contactManager,\x20integration,\x20motionbar,\x20jscripty,\x20urlForward,\x20browser,\x20bot,\x20script'}},'comment':_0x1495('0xb')},'data1':{'type':Sequelize[_0x1495('0x2')](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[_0x1495('0x2')](0x1000),'comment':_0x1495('0xc')},'data3':{'type':Sequelize[_0x1495('0x2')](0x1000),'comment':'contactManager[searchFields],\x20script[script],\x20integration[ConfigurationId],\x20motionbar[NULL,eventVariables(0=No,1=Yes),WinAppArguments],\x20browser[NULL,eventVariables(0=No,1=Yes)]'},'data4':{'type':Sequelize[_0x1495('0x2')](0x1000),'comments':_0x1495('0xd')},'data5':{'type':Sequelize[_0x1495('0x2')](0x1000),'comments':'urlForward[timeout],\x20browser[windowWidth],\x20contactManager[ignoreDialerContactId]'},'data6':{'type':Sequelize['STRING'],'comments':_0x1495('0xe')},'data7':{'type':Sequelize[_0x1495('0xf')],'comments':'urlForward[body]'}};
\ No newline at end of file
+var _0x6da6=['exports','action','STRING','contactManager','integration','motionbar','jscripty','urlForward','browser','bot','script','Allowed\x20values:\x20contactManager,\x20integration,\x20motionbar,\x20jscripty,\x20urlForward,\x20browser,\x20bot,\x20script','contactManager[autoCreate(0=No,1=Yes)],\x20urlForward[URL],\x20script[type],\x20integration[AccountId],\x20motionbar[TemplateId,URL,WinAppPath],\x20browser[TemplateId,URL]','contactManager[searchFields],\x20script[script],\x20integration[ConfigurationId],\x20motionbar[NULL,eventVariables(0=No,1=Yes),WinAppArguments],\x20browser[NULL,eventVariables(0=No,1=Yes)]','TEXT'];(function(_0xd98789,_0xfb0fd3){var _0x571bd9=function(_0xfad74){while(--_0xfad74){_0xd98789['push'](_0xd98789['shift']());}};_0x571bd9(++_0xfb0fd3);}(_0x6da6,0xa5));var _0x66da=function(_0xaca3f,_0x52732c){_0xaca3f=_0xaca3f-0x0;var _0x386c4d=_0x6da6[_0xaca3f];return _0x386c4d;};'use strict';var Sequelize=require('sequelize');module[_0x66da('0x0')]={'name':{'type':Sequelize['VIRTUAL'],'get':function(_0x3844db){return this['getDataValue'](_0x66da('0x1'));}},'action':{'type':Sequelize[_0x66da('0x2')],'allowNull':![],'validate':{'isIn':{'args':[[_0x66da('0x3'),_0x66da('0x4'),_0x66da('0x5'),_0x66da('0x6'),_0x66da('0x7'),_0x66da('0x8'),_0x66da('0x9'),_0x66da('0xa')]],'msg':_0x66da('0xb')}},'comment':_0x66da('0xb')},'data1':{'type':Sequelize['STRING'](0x1000),'comment':'jscripty[ProjectId],\x20browser[type(0=Popup,1=CTI\x20URL)],\x20contactManager[ListId],\x20urlForward[type(GET,POST,PUT,DELETE)],\x20script[info],\x20integration[intName(desk,dynamics365,freshdesk,freshsales,salesforce,sugarcrm,vtiger,zendesk,zoho)],\x20motionbar[type(0=Popup,1=CTI\x20URL,2=WinApp)]'},'data2':{'type':Sequelize[_0x66da('0x2')](0x1000),'comment':_0x66da('0xc')},'data3':{'type':Sequelize[_0x66da('0x2')](0x1000),'comment':_0x66da('0xd')},'data4':{'type':Sequelize[_0x66da('0x2')](0x1000),'comments':'browser[location(0=NewTab,1=NewWindow,2=MotionTab)],\x20contactManager[autoCreateField]'},'data5':{'type':Sequelize[_0x66da('0x2')](0x1000),'comments':'urlForward[timeout],\x20browser[windowWidth],\x20contactManager[ignoreDialerContactId]'},'data6':{'type':Sequelize['STRING'],'comments':'urlForward[headers],\x20browser[wsindowHeight]'},'data7':{'type':Sequelize[_0x66da('0xe')],'comments':'urlForward[body]'}};
\ No newline at end of file
diff --git a/server/api/action/action.controller.js b/server/api/action/action.controller.js
index e027206..fc943bc 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 _0xa8f0=['../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','status','end','json','undefined','limit','count','offset','Content-Range','apply','save','destroy','then','sendStatus','error','stack','name','send','body','Action','params','catch','find','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','path','sox','to-csv','fs-extra','squel','crypto','jsforce','querystring','../../components/auth/service'];(function(_0x357024,_0x4b9d34){var _0x2d1058=function(_0x39a38a){while(--_0x39a38a){_0x357024['push'](_0x357024['shift']());}};_0x2d1058(++_0x4b9d34);}(_0xa8f0,0x160));var _0x0a8f=function(_0x473e3f,_0x2f0947){_0x473e3f=_0x473e3f-0x0;var _0x59399b=_0xa8f0[_0x473e3f];return _0x59399b;};'use strict';var emlformat=require(_0x0a8f('0x0'));var rimraf=require(_0x0a8f('0x1'));var zipdir=require(_0x0a8f('0x2'));var jsonpatch=require(_0x0a8f('0x3'));var rp=require(_0x0a8f('0x4'));var moment=require('moment');var BPromise=require(_0x0a8f('0x5'));var Mustache=require(_0x0a8f('0x6'));var util=require('util');var path=require(_0x0a8f('0x7'));var sox=require(_0x0a8f('0x8'));var csv=require(_0x0a8f('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x0a8f('0xa'));var _=require('lodash');var squel=require(_0x0a8f('0xb'));var crypto=require(_0x0a8f('0xc'));var jsforce=require(_0x0a8f('0xd'));var deskjs=require('desk.js');var toCsv=require(_0x0a8f('0x9'));var querystring=require(_0x0a8f('0xe'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x0a8f('0xf'));var qs=require(_0x0a8f('0x10'));var as=require(_0x0a8f('0x11'));var hardwareService=require(_0x0a8f('0x12'));var logger=require(_0x0a8f('0x13'))(_0x0a8f('0x14'));var utils=require('../../config/utils');var config=require(_0x0a8f('0x15'));var licenseUtil=require(_0x0a8f('0x16'));var db=require(_0x0a8f('0x17'))['db'];function respondWithStatusCode(_0x126924,_0x362c7d){_0x362c7d=_0x362c7d||0xcc;return function(_0xd9c02f){if(_0xd9c02f){return _0x126924['sendStatus'](_0x362c7d);}return _0x126924[_0x0a8f('0x18')](_0x362c7d)[_0x0a8f('0x19')]();};}function respondWithResult(_0x5f0e49,_0x29eabe){_0x29eabe=_0x29eabe||0xc8;return function(_0x5c4bed){if(_0x5c4bed){return _0x5f0e49['status'](_0x29eabe)[_0x0a8f('0x1a')](_0x5c4bed);}};}function respondWithFilteredResult(_0x2219d6,_0x5691b0){return function(_0x5bf83d){if(_0x5bf83d){var _0x2b8870=typeof _0x5691b0['offset']===_0x0a8f('0x1b')&&typeof _0x5691b0[_0x0a8f('0x1c')]===_0x0a8f('0x1b');var _0x43cda5=_0x5bf83d[_0x0a8f('0x1d')];var _0x3162ef=_0x2b8870?0x0:_0x5691b0[_0x0a8f('0x1e')];var _0xecb7df=_0x2b8870?_0x5bf83d['count']:_0x5691b0[_0x0a8f('0x1e')]+_0x5691b0[_0x0a8f('0x1c')];var _0x397a19;if(_0xecb7df>=_0x43cda5){_0xecb7df=_0x43cda5;_0x397a19=0xc8;}else{_0x397a19=0xce;}_0x2219d6[_0x0a8f('0x18')](_0x397a19);return _0x2219d6['set'](_0x0a8f('0x1f'),_0x3162ef+'-'+_0xecb7df+'/'+_0x43cda5)[_0x0a8f('0x1a')](_0x5bf83d);}return null;};}function patchUpdates(_0x276063){return function(_0x494cb2){try{jsonpatch[_0x0a8f('0x20')](_0x494cb2,_0x276063,!![]);}catch(_0x48356f){return BPromise['reject'](_0x48356f);}return _0x494cb2[_0x0a8f('0x21')]();};}function saveUpdates(_0x57cbfc,_0x4634c1){return function(_0xf3593a){if(_0xf3593a){return _0xf3593a['update'](_0x57cbfc)['then'](function(_0x104ce1){return _0x104ce1;});}return null;};}function removeEntity(_0x4ab13a,_0x187e8a){return function(_0x19dcfe){if(_0x19dcfe){return _0x19dcfe[_0x0a8f('0x22')]()[_0x0a8f('0x23')](function(){_0x4ab13a['status'](0xcc)[_0x0a8f('0x19')]();});}};}function handleEntityNotFound(_0x50abb1,_0x3e2a68){return function(_0x391036){if(!_0x391036){_0x50abb1[_0x0a8f('0x24')](0x194);}return _0x391036;};}function handleError(_0x4c0845,_0xeab2a6){_0xeab2a6=_0xeab2a6||0x1f4;return function(_0x41ba8c){logger[_0x0a8f('0x25')](_0x41ba8c[_0x0a8f('0x26')]);if(_0x41ba8c[_0x0a8f('0x27')]){delete _0x41ba8c[_0x0a8f('0x27')];}_0x4c0845[_0x0a8f('0x18')](_0xeab2a6)[_0x0a8f('0x28')](_0x41ba8c);};}exports['update']=function(_0x16d24a,_0x2d886a){if(_0x16d24a[_0x0a8f('0x29')]['id']){delete _0x16d24a[_0x0a8f('0x29')]['id'];}return db[_0x0a8f('0x2a')]['find']({'where':{'id':_0x16d24a[_0x0a8f('0x2b')]['id']}})[_0x0a8f('0x23')](handleEntityNotFound(_0x2d886a,null))[_0x0a8f('0x23')](saveUpdates(_0x16d24a[_0x0a8f('0x29')],null))[_0x0a8f('0x23')](respondWithResult(_0x2d886a,null))[_0x0a8f('0x2c')](handleError(_0x2d886a,null));};exports[_0x0a8f('0x22')]=function(_0x2eddc4,_0x2b2ab5){return db[_0x0a8f('0x2a')][_0x0a8f('0x2d')]({'where':{'id':_0x2eddc4[_0x0a8f('0x2b')]['id']}})['then'](handleEntityNotFound(_0x2b2ab5,null))[_0x0a8f('0x23')](removeEntity(_0x2b2ab5,null))[_0x0a8f('0x2c')](handleError(_0x2b2ab5,null));};
\ No newline at end of file
+var _0x36d6=['params','catch','rimraf','fast-json-patch','bluebird','mustache','util','sox','ejs','fs-extra','squel','crypto','to-csv','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','reject','save','then','destroy','stack','name','body','Action','find'];(function(_0x566315,_0x51f4f3){var _0x4adc55=function(_0x5618f3){while(--_0x5618f3){_0x566315['push'](_0x566315['shift']());}};_0x4adc55(++_0x51f4f3);}(_0x36d6,0x104));var _0x636d=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x36d6[_0x3dd15e];return _0x231fd0;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x636d('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0x636d('0x1'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x636d('0x2'));var Mustache=require(_0x636d('0x3'));var util=require(_0x636d('0x4'));var path=require('path');var sox=require(_0x636d('0x5'));var csv=require('to-csv');var ejs=require(_0x636d('0x6'));var fs=require('fs');var fs_extra=require(_0x636d('0x7'));var _=require('lodash');var squel=require(_0x636d('0x8'));var crypto=require(_0x636d('0x9'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x636d('0xa'));var querystring=require('querystring');var Papa=require(_0x636d('0xb'));var Redis=require(_0x636d('0xc'));var authService=require(_0x636d('0xd'));var qs=require('../../components/parsers/qs');var as=require(_0x636d('0xe'));var hardwareService=require(_0x636d('0xf'));var logger=require(_0x636d('0x10'))(_0x636d('0x11'));var utils=require(_0x636d('0x12'));var config=require(_0x636d('0x13'));var licenseUtil=require(_0x636d('0x14'));var db=require(_0x636d('0x15'))['db'];function respondWithStatusCode(_0x141f1b,_0x343635){_0x343635=_0x343635||0xcc;return function(_0x5825f8){if(_0x5825f8){return _0x141f1b[_0x636d('0x16')](_0x343635);}return _0x141f1b[_0x636d('0x17')](_0x343635)[_0x636d('0x18')]();};}function respondWithResult(_0x864cd0,_0x35fb5e){_0x35fb5e=_0x35fb5e||0xc8;return function(_0x2cc0b9){if(_0x2cc0b9){return _0x864cd0[_0x636d('0x17')](_0x35fb5e)[_0x636d('0x19')](_0x2cc0b9);}};}function respondWithFilteredResult(_0x6d08d0,_0x26af85){return function(_0x1d99ad){if(_0x1d99ad){var _0x423573=typeof _0x26af85[_0x636d('0x1a')]===_0x636d('0x1b')&&typeof _0x26af85[_0x636d('0x1c')]===_0x636d('0x1b');var _0x30d751=_0x1d99ad[_0x636d('0x1d')];var _0x66faa9=_0x423573?0x0:_0x26af85[_0x636d('0x1a')];var _0xd712f6=_0x423573?_0x1d99ad[_0x636d('0x1d')]:_0x26af85['offset']+_0x26af85[_0x636d('0x1c')];var _0x27478e;if(_0xd712f6>=_0x30d751){_0xd712f6=_0x30d751;_0x27478e=0xc8;}else{_0x27478e=0xce;}_0x6d08d0[_0x636d('0x17')](_0x27478e);return _0x6d08d0[_0x636d('0x1e')](_0x636d('0x1f'),_0x66faa9+'-'+_0xd712f6+'/'+_0x30d751)[_0x636d('0x19')](_0x1d99ad);}return null;};}function patchUpdates(_0x28341b){return function(_0x513f35){try{jsonpatch['apply'](_0x513f35,_0x28341b,!![]);}catch(_0x85be2){return BPromise[_0x636d('0x20')](_0x85be2);}return _0x513f35[_0x636d('0x21')]();};}function saveUpdates(_0x253058,_0x2d58bd){return function(_0x1aeb32){if(_0x1aeb32){return _0x1aeb32['update'](_0x253058)[_0x636d('0x22')](function(_0x57d3b0){return _0x57d3b0;});}return null;};}function removeEntity(_0x1ce9f4,_0x5726cb){return function(_0x472d02){if(_0x472d02){return _0x472d02[_0x636d('0x23')]()[_0x636d('0x22')](function(){_0x1ce9f4[_0x636d('0x17')](0xcc)['end']();});}};}function handleEntityNotFound(_0x309c05,_0x34899c){return function(_0x3daada){if(!_0x3daada){_0x309c05[_0x636d('0x16')](0x194);}return _0x3daada;};}function handleError(_0x3b55f9,_0x3903ac){_0x3903ac=_0x3903ac||0x1f4;return function(_0x161667){logger['error'](_0x161667[_0x636d('0x24')]);if(_0x161667[_0x636d('0x25')]){delete _0x161667[_0x636d('0x25')];}_0x3b55f9['status'](_0x3903ac)['send'](_0x161667);};}exports['update']=function(_0x517eb4,_0x2913ad){if(_0x517eb4[_0x636d('0x26')]['id']){delete _0x517eb4[_0x636d('0x26')]['id'];}return db[_0x636d('0x27')][_0x636d('0x28')]({'where':{'id':_0x517eb4[_0x636d('0x29')]['id']}})['then'](handleEntityNotFound(_0x2913ad,null))[_0x636d('0x22')](saveUpdates(_0x517eb4[_0x636d('0x26')],null))[_0x636d('0x22')](respondWithResult(_0x2913ad,null))['catch'](handleError(_0x2913ad,null));};exports[_0x636d('0x23')]=function(_0x26ea6a,_0x130d34){return db[_0x636d('0x27')][_0x636d('0x28')]({'where':{'id':_0x26ea6a['params']['id']}})['then'](handleEntityNotFound(_0x130d34,null))['then'](removeEntity(_0x130d34,null))[_0x636d('0x2a')](handleError(_0x130d34,null));};
\ No newline at end of file
diff --git a/server/api/action/action.model.js b/server/api/action/action.model.js
index c50c5ff..1a3fc70 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 _0x75e9=['rimraf','../../config/environment','exports','define','Action','util','../../config/logger','api','moment','bluebird','request-promise','path'];(function(_0x1c6b09,_0x1019ef){var _0x50e6a3=function(_0x246b99){while(--_0x246b99){_0x1c6b09['push'](_0x1c6b09['shift']());}};_0x50e6a3(++_0x1019ef);}(_0x75e9,0x1c1));var _0x975e=function(_0x486d8d,_0x352989){_0x486d8d=_0x486d8d-0x0;var _0x4c00ff=_0x75e9[_0x486d8d];return _0x4c00ff;};'use strict';var _=require('lodash');var util=require(_0x975e('0x0'));var logger=require(_0x975e('0x1'))(_0x975e('0x2'));var moment=require(_0x975e('0x3'));var BPromise=require(_0x975e('0x4'));var rp=require(_0x975e('0x5'));var fs=require('fs');var path=require(_0x975e('0x6'));var rimraf=require(_0x975e('0x7'));var config=require(_0x975e('0x8'));var attributes=require('./action.attributes');module[_0x975e('0x9')]=function(_0x1681b9,_0x1f7eac){return _0x1681b9[_0x975e('0xa')](_0x975e('0xb'),attributes,{'tableName':'tools_actions','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x76ef=['lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./action.attributes','Action','tools_actions'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x76ef,0xb6));var _0xf76e=function(_0x53d86e,_0x16039e){_0x53d86e=_0x53d86e-0x0;var _0x4d07a7=_0x76ef[_0x53d86e];return _0x4d07a7;};'use strict';var _=require(_0xf76e('0x0'));var util=require(_0xf76e('0x1'));var logger=require(_0xf76e('0x2'))(_0xf76e('0x3'));var moment=require(_0xf76e('0x4'));var BPromise=require(_0xf76e('0x5'));var rp=require(_0xf76e('0x6'));var fs=require('fs');var path=require(_0xf76e('0x7'));var rimraf=require(_0xf76e('0x8'));var config=require(_0xf76e('0x9'));var attributes=require(_0xf76e('0xa'));module['exports']=function(_0x2a8095,_0x502094){return _0x2a8095['define'](_0xf76e('0xb'),attributes,{'tableName':_0xf76e('0xc'),'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 1e4b63b..0ee0cd1 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 _0x5fc3=['../../config/environment','jayson/promise','request','then','info','request\x20sent','debug','stringify','error','code','message','Action,\x20%s,\x20%s','result','catch','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc'];(function(_0x52c972,_0x88322b){var _0x5c5195=function(_0x35aecb){while(--_0x35aecb){_0x52c972['push'](_0x52c972['shift']());}};_0x5c5195(++_0x88322b);}(_0x5fc3,0xa8));var _0x35fc=function(_0xd816e2,_0x5edac2){_0xd816e2=_0xd816e2-0x0;var _0x1f5924=_0x5fc3[_0xd816e2];return _0x1f5924;};'use strict';var _=require(_0x35fc('0x0'));var util=require(_0x35fc('0x1'));var moment=require('moment');var BPromise=require(_0x35fc('0x2'));var rs=require(_0x35fc('0x3'));var fs=require('fs');var Redis=require(_0x35fc('0x4'));var db=require(_0x35fc('0x5'))['db'];var utils=require(_0x35fc('0x6'));var logger=require('../../config/logger')(_0x35fc('0x7'));var config=require(_0x35fc('0x8'));var jayson=require(_0x35fc('0x9'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x19a0d1,_0x508b32,_0x16e153){return new BPromise(function(_0x27524f,_0xc72d93){return client[_0x35fc('0xa')](_0x19a0d1,_0x16e153)[_0x35fc('0xb')](function(_0xf9d3a6){logger[_0x35fc('0xc')]('Action,\x20%s,\x20%s',_0x508b32,_0x35fc('0xd'));logger[_0x35fc('0xe')]('Action,\x20%s,\x20%s,\x20%s',_0x508b32,_0x35fc('0xd'),JSON[_0x35fc('0xf')](_0xf9d3a6));if(_0xf9d3a6['error']){if(_0xf9d3a6[_0x35fc('0x10')][_0x35fc('0x11')]===0x1f4){logger['error']('Action,\x20%s,\x20%s',_0x508b32,_0xf9d3a6[_0x35fc('0x10')]['message']);return _0xc72d93(_0xf9d3a6[_0x35fc('0x10')][_0x35fc('0x12')]);}logger[_0x35fc('0x10')](_0x35fc('0x13'),_0x508b32,_0xf9d3a6[_0x35fc('0x10')]['message']);return _0x27524f(_0xf9d3a6['error']['message']);}else{logger['info'](_0x35fc('0x13'),_0x508b32,_0x35fc('0xd'));_0x27524f(_0xf9d3a6[_0x35fc('0x14')][_0x35fc('0x12')]);}})[_0x35fc('0x15')](function(_0x1121fa){logger['error'](_0x35fc('0x13'),_0x508b32,_0x1121fa);_0xc72d93(_0x1121fa);});});}
\ No newline at end of file
+var _0x4975=['ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','info','Action,\x20%s,\x20%s','request\x20sent','debug','Action,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','lodash','moment','bluebird','randomstring'];(function(_0x257642,_0x270a80){var _0x3d813b=function(_0x2a1c8a){while(--_0x2a1c8a){_0x257642['push'](_0x257642['shift']());}};_0x3d813b(++_0x270a80);}(_0x4975,0x86));var _0x5497=function(_0x31323a,_0x4e397e){_0x31323a=_0x31323a-0x0;var _0x5d0193=_0x4975[_0x31323a];return _0x5d0193;};'use strict';var _=require(_0x5497('0x0'));var util=require('util');var moment=require(_0x5497('0x1'));var BPromise=require(_0x5497('0x2'));var rs=require(_0x5497('0x3'));var fs=require('fs');var Redis=require(_0x5497('0x4'));var db=require(_0x5497('0x5'))['db'];var utils=require(_0x5497('0x6'));var logger=require(_0x5497('0x7'))(_0x5497('0x8'));var config=require(_0x5497('0x9'));var jayson=require(_0x5497('0xa'));var client=jayson['client'][_0x5497('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x4f563d,_0x1d0019,_0x674a2a){return new BPromise(function(_0x368e8b,_0x57f930){return client[_0x5497('0xc')](_0x4f563d,_0x674a2a)['then'](function(_0x1f63d8){logger[_0x5497('0xd')](_0x5497('0xe'),_0x1d0019,_0x5497('0xf'));logger[_0x5497('0x10')](_0x5497('0x11'),_0x1d0019,_0x5497('0xf'),JSON[_0x5497('0x12')](_0x1f63d8));if(_0x1f63d8['error']){if(_0x1f63d8['error']['code']===0x1f4){logger[_0x5497('0x13')](_0x5497('0xe'),_0x1d0019,_0x1f63d8[_0x5497('0x13')][_0x5497('0x14')]);return _0x57f930(_0x1f63d8[_0x5497('0x13')][_0x5497('0x14')]);}logger[_0x5497('0x13')](_0x5497('0xe'),_0x1d0019,_0x1f63d8[_0x5497('0x13')][_0x5497('0x14')]);return _0x368e8b(_0x1f63d8['error'][_0x5497('0x14')]);}else{logger['info'](_0x5497('0xe'),_0x1d0019,_0x5497('0xf'));_0x368e8b(_0x1f63d8[_0x5497('0x15')][_0x5497('0x14')]);}})[_0x5497('0x16')](function(_0x4073e6){logger[_0x5497('0x13')]('Action,\x20%s,\x20%s',_0x1d0019,_0x4073e6);_0x57f930(_0x4073e6);});});}
\ No newline at end of file
diff --git a/server/api/action/index.js b/server/api/action/index.js
index 431ce70..ba91f81 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 _0xe71f=['delete','/:id','exports','multer','util','connect-timeout','Router','fs-extra','../../components/auth/service','../../config/environment','put','isAuthenticated'];(function(_0x48f038,_0x2bde84){var _0x2edc62=function(_0x1e6cc8){while(--_0x1e6cc8){_0x48f038['push'](_0x48f038['shift']());}};_0x2edc62(++_0x2bde84);}(_0xe71f,0x1d7));var _0xfe71=function(_0x3363b0,_0x13b11d){_0x3363b0=_0x3363b0-0x0;var _0x5a116a=_0xe71f[_0x3363b0];return _0x5a116a;};'use strict';var multer=require(_0xfe71('0x0'));var util=require(_0xfe71('0x1'));var path=require('path');var timeout=require(_0xfe71('0x2'));var express=require('express');var router=express[_0xfe71('0x3')]();var fs_extra=require(_0xfe71('0x4'));var auth=require(_0xfe71('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0xfe71('0x6'));var controller=require('./action.controller');router[_0xfe71('0x7')]('/:id',auth[_0xfe71('0x8')](),controller['update']);router[_0xfe71('0x9')](_0xfe71('0xa'),auth['isAuthenticated'](),controller['destroy']);module[_0xfe71('0xb')]=router;
\ No newline at end of file
+var _0x2dcb=['multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./action.controller','put','/:id','update','delete','exports'];(function(_0x5f1186,_0x299c7f){var _0x32007f=function(_0x4eaf32){while(--_0x4eaf32){_0x5f1186['push'](_0x5f1186['shift']());}};_0x32007f(++_0x299c7f);}(_0x2dcb,0x1d0));var _0xb2dc=function(_0x33bd5a,_0x37ccd6){_0x33bd5a=_0x33bd5a-0x0;var _0x49ac5d=_0x2dcb[_0x33bd5a];return _0x49ac5d;};'use strict';var multer=require(_0xb2dc('0x0'));var util=require(_0xb2dc('0x1'));var path=require(_0xb2dc('0x2'));var timeout=require(_0xb2dc('0x3'));var express=require(_0xb2dc('0x4'));var router=express[_0xb2dc('0x5')]();var fs_extra=require(_0xb2dc('0x6'));var auth=require(_0xb2dc('0x7'));var interaction=require(_0xb2dc('0x8'));var config=require(_0xb2dc('0x9'));var controller=require(_0xb2dc('0xa'));router[_0xb2dc('0xb')](_0xb2dc('0xc'),auth['isAuthenticated'](),controller[_0xb2dc('0xd')]);router[_0xb2dc('0xe')](_0xb2dc('0xc'),auth['isAuthenticated'](),controller['destroy']);module[_0xb2dc('0xf')]=router;
\ No newline at end of file
diff --git a/server/api/analyticCustomReport/analyticCustomReport.attributes.js b/server/api/analyticCustomReport/analyticCustomReport.attributes.js
index e956283..1485949 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 _0xee14=['STRING','TEXT'];(function(_0x48d02a,_0x4ef182){var _0x8b391e=function(_0x154600){while(--_0x154600){_0x48d02a['push'](_0x48d02a['shift']());}};_0x8b391e(++_0x4ef182);}(_0xee14,0x13a));var _0x4ee1=function(_0x6fc991,_0x469a66){_0x6fc991=_0x6fc991-0x0;var _0x544a68=_0xee14[_0x6fc991];return _0x544a68;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize[_0x4ee1('0x0')],'allowNull':![]},'description':{'type':Sequelize[_0x4ee1('0x0')]},'parent':{'type':Sequelize[_0x4ee1('0x0')]},'table':{'type':Sequelize[_0x4ee1('0x0')]},'conditions':{'type':Sequelize[_0x4ee1('0x1')]},'joins':{'type':Sequelize[_0x4ee1('0x1')]}};
\ No newline at end of file
+var _0x326f=['STRING','TEXT','sequelize'];(function(_0x4dcc97,_0x3e8b47){var _0x56cfb6=function(_0x518a3e){while(--_0x518a3e){_0x4dcc97['push'](_0x4dcc97['shift']());}};_0x56cfb6(++_0x3e8b47);}(_0x326f,0xd1));var _0xf326=function(_0x32bfef,_0x57ee50){_0x32bfef=_0x32bfef-0x0;var _0x5c51b8=_0x326f[_0x32bfef];return _0x5c51b8;};'use strict';var Sequelize=require(_0xf326('0x0'));module['exports']={'name':{'type':Sequelize['STRING'],'allowNull':![]},'description':{'type':Sequelize[_0xf326('0x1')]},'parent':{'type':Sequelize[_0xf326('0x1')]},'table':{'type':Sequelize[_0xf326('0x1')]},'conditions':{'type':Sequelize[_0xf326('0x2')]},'joins':{'type':Sequelize[_0xf326('0x2')]}};
\ No newline at end of file
diff --git a/server/api/analyticCustomReport/analyticCustomReport.controller.js b/server/api/analyticCustomReport/analyticCustomReport.controller.js
index f40b0ad..cde35bf 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 _0xd92a=['../../config/logger','../../config/utils','../../config/license/util','../../mysqldb','dbH','status','end','json','offset','undefined','limit','count','set','apply','save','then','destroy','get','CustomReports','name','send','map','AnalyticCustomReport','rawAttributes','fieldName','key','model','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','filter','merge','where','type','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','params','find','create','body','user','Reports','UserProfileSection','userProfileId','autoAssociation','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','preview','left_join','right_join','SUM(%s)','COUNT(%s)','COUNT(DISTINCT\x20%s)','MAX(%s)','MIN(%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)','ROUND(%s)','UNIX_TIMESTAMP(%s)','includes','IS\x20NULL','IS\x20EMPTY','IS\x20NOT\x20EMPTY','rules','operator','group','field','condition','value','getFields','keyBy','select','from','MetricId','metric','replace','function','format','groupBy','orderBy','alias','joins','parentKey','foreignTable','foreignKey','%s.%s\x20=\x20%s.%s','conditions','parse','debug','Limited\x20Query:','sequelize','toString','QueryTypes','SELECT','join','GROUP_CONCAT(%s)','HOUR(%s)','IS\x20NOT\x20NULL','Sequelize','ValidationErrorItem','table','DESC','output','web','%s-%s.%s','custom','AnalyticExtractedReport','.calldate\x20BETWEEN\x20?\x20AND\x20?','startDate','endDate','.createdAt\x20BETWEEN\x20?\x20AND\x20?','info','child_process','../../files/reports','savename','countTable','COUNT(*)','cross_join','Please\x20insert\x20at\x20least\x20one\x20field','rimraf','zip-dir','fast-json-patch','moment','bluebird','sox','to-csv','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware'];(function(_0x397e5f,_0x454c8f){var _0x5302b8=function(_0x1a29ef){while(--_0x1a29ef){_0x397e5f['push'](_0x397e5f['shift']());}};_0x5302b8(++_0x454c8f);}(_0xd92a,0x1bc));var _0xad92=function(_0x21a9d9,_0x4d5ac8){_0x21a9d9=_0x21a9d9-0x0;var _0x46adce=_0xd92a[_0x21a9d9];return _0x46adce;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xad92('0x0'));var zipdir=require(_0xad92('0x1'));var jsonpatch=require(_0xad92('0x2'));var rp=require('request-promise');var moment=require(_0xad92('0x3'));var BPromise=require(_0xad92('0x4'));var Mustache=require('mustache');var util=require('util');var path=require('path');var sox=require(_0xad92('0x5'));var csv=require(_0xad92('0x6'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xad92('0x7'));var _=require(_0xad92('0x8'));var squel=require(_0xad92('0x9'));var crypto=require(_0xad92('0xa'));var jsforce=require(_0xad92('0xb'));var deskjs=require(_0xad92('0xc'));var toCsv=require(_0xad92('0x6'));var querystring=require(_0xad92('0xd'));var Papa=require('papaparse');var Redis=require(_0xad92('0xe'));var authService=require(_0xad92('0xf'));var qs=require('../../components/parsers/qs');var as=require(_0xad92('0x10'));var hardwareService=require(_0xad92('0x11'));var logger=require(_0xad92('0x12'))('api');var utils=require(_0xad92('0x13'));var config=require('../../config/environment');var licenseUtil=require(_0xad92('0x14'));var db=require(_0xad92('0x15'))['db'];var dbH=require(_0xad92('0x15'))[_0xad92('0x16')];function respondWithStatusCode(_0x13184f,_0x336550){_0x336550=_0x336550||0xcc;return function(_0x46073a){if(_0x46073a){return _0x13184f['sendStatus'](_0x336550);}return _0x13184f[_0xad92('0x17')](_0x336550)[_0xad92('0x18')]();};}function respondWithResult(_0x2e8c01,_0x200a3d){_0x200a3d=_0x200a3d||0xc8;return function(_0xe5dbe4){if(_0xe5dbe4){return _0x2e8c01[_0xad92('0x17')](_0x200a3d)[_0xad92('0x19')](_0xe5dbe4);}};}function respondWithFilteredResult(_0x1f9ec4,_0x566ded){return function(_0x5936e3){if(_0x5936e3){var _0x4d8009=typeof _0x566ded[_0xad92('0x1a')]===_0xad92('0x1b')&&typeof _0x566ded[_0xad92('0x1c')]===_0xad92('0x1b');var _0x12a544=_0x5936e3[_0xad92('0x1d')];var _0x5e87ca=_0x4d8009?0x0:_0x566ded[_0xad92('0x1a')];var _0x5965dc=_0x4d8009?_0x5936e3['count']:_0x566ded['offset']+_0x566ded[_0xad92('0x1c')];var _0x264de9;if(_0x5965dc>=_0x12a544){_0x5965dc=_0x12a544;_0x264de9=0xc8;}else{_0x264de9=0xce;}_0x1f9ec4[_0xad92('0x17')](_0x264de9);return _0x1f9ec4[_0xad92('0x1e')]('Content-Range',_0x5e87ca+'-'+_0x5965dc+'/'+_0x12a544)[_0xad92('0x19')](_0x5936e3);}return null;};}function patchUpdates(_0x4ea1d0){return function(_0x301b7a){try{jsonpatch[_0xad92('0x1f')](_0x301b7a,_0x4ea1d0,!![]);}catch(_0x223fbf){return BPromise['reject'](_0x223fbf);}return _0x301b7a[_0xad92('0x20')]();};}function saveUpdates(_0x5bcaa3,_0x5342e8){return function(_0x579444){if(_0x579444){return _0x579444['update'](_0x5bcaa3)[_0xad92('0x21')](function(_0x157796){return _0x157796;});}return null;};}function removeEntity(_0x5e92cf,_0x56307a){return function(_0x591a05){if(_0x591a05){return _0x591a05[_0xad92('0x22')]()['then'](function(){var _0x10945a=_0x591a05[_0xad92('0x23')]({'plain':!![]});var _0xd1e056=_0xad92('0x24');return db['UserProfileResource'][_0xad92('0x22')]({'where':{'type':_0xd1e056,'resourceId':_0x10945a['id']}})[_0xad92('0x21')](function(){return _0x591a05;});})['then'](function(){_0x5e92cf['status'](0xcc)[_0xad92('0x18')]();});}};}function handleEntityNotFound(_0x418e54,_0x5e53d4){return function(_0x4780db){if(!_0x4780db){_0x418e54['sendStatus'](0x194);}return _0x4780db;};}function handleError(_0x49d7b2,_0x4031d2){_0x4031d2=_0x4031d2||0x1f4;return function(_0x3a4f0d){logger['error'](_0x3a4f0d['stack']);if(_0x3a4f0d[_0xad92('0x25')]){delete _0x3a4f0d['name'];}_0x49d7b2[_0xad92('0x17')](_0x4031d2)[_0xad92('0x26')](_0x3a4f0d);};}exports['index']=function(_0x2a322f,_0x3e6a4b){var _0x10f5b0={},_0x34831b={},_0x32d1c2={'count':0x0,'rows':[]};var _0x37b358=_[_0xad92('0x27')](db[_0xad92('0x28')][_0xad92('0x29')],function(_0x279683){return{'name':_0x279683[_0xad92('0x2a')],'type':_0x279683['type'][_0xad92('0x2b')]};});_0x34831b[_0xad92('0x2c')]=_[_0xad92('0x27')](_0x37b358,_0xad92('0x25'));_0x34831b[_0xad92('0x2d')]=_[_0xad92('0x2e')](_0x2a322f[_0xad92('0x2d')]);_0x34831b[_0xad92('0x2f')]=_[_0xad92('0x30')](_0x34831b[_0xad92('0x2c')],_0x34831b[_0xad92('0x2d')]);_0x10f5b0['attributes']=_[_0xad92('0x30')](_0x34831b[_0xad92('0x2c')],qs[_0xad92('0x31')](_0x2a322f[_0xad92('0x2d')][_0xad92('0x31')]));_0x10f5b0[_0xad92('0x32')]=_0x10f5b0[_0xad92('0x32')][_0xad92('0x33')]?_0x10f5b0[_0xad92('0x32')]:_0x34831b[_0xad92('0x2c')];if(!_0x2a322f[_0xad92('0x2d')][_0xad92('0x34')](_0xad92('0x35'))){_0x10f5b0[_0xad92('0x1c')]=qs['limit'](_0x2a322f[_0xad92('0x2d')][_0xad92('0x1c')]);_0x10f5b0[_0xad92('0x1a')]=qs[_0xad92('0x1a')](_0x2a322f[_0xad92('0x2d')][_0xad92('0x1a')]);}_0x10f5b0[_0xad92('0x36')]=qs[_0xad92('0x37')](_0x2a322f[_0xad92('0x2d')][_0xad92('0x37')]);_0x10f5b0['where']=qs[_0xad92('0x2f')](_['pick'](_0x2a322f[_0xad92('0x2d')],_0x34831b['filters']),_0x37b358);if(_0x2a322f[_0xad92('0x2d')][_0xad92('0x38')]){_0x10f5b0['where']=_[_0xad92('0x39')](_0x10f5b0[_0xad92('0x3a')],{'$or':_[_0xad92('0x27')](_0x37b358,function(_0x1444f8){if(_0x1444f8[_0xad92('0x3b')]!==_0xad92('0x3c')){var _0x4cb5cd={};_0x4cb5cd[_0x1444f8['name']]={'$like':'%'+_0x2a322f['query'][_0xad92('0x38')]+'%'};return _0x4cb5cd;}})});}_0x10f5b0=_[_0xad92('0x39')]({},_0x10f5b0,_0x2a322f[_0xad92('0x3d')]);var _0x2232a8={'where':_0x10f5b0[_0xad92('0x3a')]};return db[_0xad92('0x28')][_0xad92('0x1d')](_0x2232a8)['then'](function(_0x66c006){_0x32d1c2[_0xad92('0x1d')]=_0x66c006;if(_0x2a322f[_0xad92('0x2d')][_0xad92('0x3e')]){_0x10f5b0[_0xad92('0x3f')]=[{'all':!![]}];}return db[_0xad92('0x28')][_0xad92('0x40')](_0x10f5b0);})[_0xad92('0x21')](function(_0xdfca06){_0x32d1c2[_0xad92('0x41')]=_0xdfca06;return _0x32d1c2;})['then'](respondWithFilteredResult(_0x3e6a4b,_0x10f5b0))[_0xad92('0x42')](handleError(_0x3e6a4b,null));};exports[_0xad92('0x43')]=function(_0x475b7f,_0x136ec9){var _0x304ccc={'raw':![],'where':{'id':_0x475b7f[_0xad92('0x44')]['id']}},_0x1f324c={};_0x1f324c[_0xad92('0x2c')]=_[_0xad92('0x2e')](db['AnalyticCustomReport'][_0xad92('0x29')]);_0x1f324c[_0xad92('0x2d')]=_[_0xad92('0x2e')](_0x475b7f[_0xad92('0x2d')]);_0x1f324c['filters']=_[_0xad92('0x30')](_0x1f324c['model'],_0x1f324c['query']);_0x304ccc['attributes']=_[_0xad92('0x30')](_0x1f324c[_0xad92('0x2c')],qs[_0xad92('0x31')](_0x475b7f[_0xad92('0x2d')][_0xad92('0x31')]));_0x304ccc[_0xad92('0x32')]=_0x304ccc[_0xad92('0x32')][_0xad92('0x33')]?_0x304ccc[_0xad92('0x32')]:_0x1f324c[_0xad92('0x2c')];if(_0x475b7f[_0xad92('0x2d')]['includeAll']){_0x304ccc[_0xad92('0x3f')]=[{'all':!![]}];}_0x304ccc=_['merge']({},_0x304ccc,_0x475b7f['options']);return db[_0xad92('0x28')][_0xad92('0x45')](_0x304ccc)[_0xad92('0x21')](handleEntityNotFound(_0x136ec9,null))[_0xad92('0x21')](respondWithResult(_0x136ec9,null))[_0xad92('0x42')](handleError(_0x136ec9,null));};exports['create']=function(_0xb09a79,_0x58cb06){return db['AnalyticCustomReport'][_0xad92('0x46')](_0xb09a79[_0xad92('0x47')],{})[_0xad92('0x21')](function(_0x231cb7){var _0x711246=_0xb09a79[_0xad92('0x48')][_0xad92('0x23')]({'plain':!![]});if(!_0x711246)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x711246['role']==='user'){var _0xad41af=_0x231cb7[_0xad92('0x23')]({'plain':!![]});var _0x128196=_0xad92('0x49');return db[_0xad92('0x4a')][_0xad92('0x45')]({'where':{'name':_0x128196,'userProfileId':_0x711246[_0xad92('0x4b')]},'raw':!![]})['then'](function(_0x476b8e){if(_0x476b8e&&_0x476b8e[_0xad92('0x4c')]===0x0){return db['UserProfileResource'][_0xad92('0x46')]({'name':_0xad41af[_0xad92('0x25')],'resourceId':_0xad41af['id'],'type':_0xad92('0x24'),'sectionId':_0x476b8e['id']},{})[_0xad92('0x21')](function(){return _0x231cb7;});}else{return _0x231cb7;}})[_0xad92('0x42')](function(_0x4d34d8){logger[_0xad92('0x4d')](_0xad92('0x4e'),_0x4d34d8);throw _0x4d34d8;});}return _0x231cb7;})[_0xad92('0x21')](respondWithResult(_0x58cb06,0xc9))[_0xad92('0x42')](handleError(_0x58cb06,null));};exports['update']=function(_0x383209,_0x842790){if(_0x383209[_0xad92('0x47')]['id']){delete _0x383209[_0xad92('0x47')]['id'];}return db[_0xad92('0x28')][_0xad92('0x45')]({'where':{'id':_0x383209[_0xad92('0x44')]['id']}})['then'](handleEntityNotFound(_0x842790,null))[_0xad92('0x21')](saveUpdates(_0x383209[_0xad92('0x47')],null))['then'](respondWithResult(_0x842790,null))['catch'](handleError(_0x842790,null));};exports[_0xad92('0x22')]=function(_0x9276e8,_0x407121){return db['AnalyticCustomReport'][_0xad92('0x45')]({'where':{'id':_0x9276e8['params']['id']}})[_0xad92('0x21')](handleEntityNotFound(_0x407121,null))[_0xad92('0x21')](removeEntity(_0x407121,null))[_0xad92('0x42')](handleError(_0x407121,null));};exports[_0xad92('0x4f')]=function(_0x38f373,_0x194fc0){var _0x5b3577=0xa;var _0x423ecf=['join',_0xad92('0x50'),_0xad92('0x51'),'cross_join'];var _0x4fe1a2={'SUM':_0xad92('0x52'),'COUNT':_0xad92('0x53'),'COUNT DISTINCT':_0xad92('0x54'),'MAX':_0xad92('0x55'),'MIN':_0xad92('0x56'),'AVG':_0xad92('0x57'),'GROUP_CONCAT':'GROUP_CONCAT(%s)','GROUP_CONCAT ASC':_0xad92('0x58'),'GROUP_CONCAT DESC':_0xad92('0x59')};var _0x4641a0={'SEC_TO_TIME':_0xad92('0x5a'),'DATE':_0xad92('0x5b'),'HOUR':'HOUR(%s)','ROUND':_0xad92('0x5c'),'UNIX_TIMESTAMP':_0xad92('0x5d')};var _0x39fe2c=function(_0x364747){return!_[_0xad92('0x5e')]([_0xad92('0x5f'),'IS\x20NOT\x20NULL',_0xad92('0x60'),_0xad92('0x61')],_0x364747);};var _0x49169d=function(_0x11daad){if(!_0x11daad||!_0x11daad['rules']['length']){return'';}for(var _0x12648b='(',_0xe4f719=0x0;_0xe4f719<_0x11daad[_0xad92('0x62')][_0xad92('0x33')];_0xe4f719+=0x1){_0xe4f719>0x0&&(_0x12648b+='\x20'+_0x11daad[_0xad92('0x63')]+'\x20');_0x12648b+=_0x11daad['rules'][_0xe4f719][_0xad92('0x64')]?_0x49169d(_0x11daad[_0xad92('0x62')][_0xe4f719]['group']):_0x11daad[_0xad92('0x62')][_0xe4f719][_0xad92('0x65')]+'\x20'+_0x11daad[_0xad92('0x62')][_0xe4f719]['condition']+(_0x39fe2c(_0x11daad[_0xad92('0x62')][_0xe4f719][_0xad92('0x66')])?'\x20'+_0x11daad[_0xad92('0x62')][_0xe4f719][_0xad92('0x67')]:'');}return _0x12648b+')';};var _0x393490={'where':{'id':_0x38f373[_0xad92('0x44')]['id']}},_0x2e6915,_0x18ec47,_0x5204ac,_0x355064,_0x23c56d;_0x393490=_[_0xad92('0x39')]({},_0x393490,_0x38f373[_0xad92('0x3d')]);return db['AnalyticCustomReport'][_0xad92('0x45')](_0x393490)[_0xad92('0x21')](function(_0x102a54){if(_0x102a54){_0x2e6915=_0x102a54;return _0x102a54[_0xad92('0x68')]();}return null;})[_0xad92('0x21')](function(_0x2d289d){if(_0x2d289d){if(!_0x2d289d[_0xad92('0x33')]){throw new db['Sequelize']['ValidationErrorItem']('Please\x20insert\x20at\x20least\x20one\x20field',0x193);}_0x18ec47=_0x2d289d;return db['AnalyticMetric']['findAll']({'raw':!![]});}return null;})[_0xad92('0x21')](function(_0x25e57e){if(_0x25e57e){_0x5204ac=_[_0xad92('0x69')](_0x25e57e,'id');var _0x5af894;var _0x424daa=squel[_0xad92('0x6a')]();_0x424daa[_0xad92('0x6b')](_0x2e6915['table']);for(var _0x40494f=0x0;_0x40494f<_0x18ec47[_0xad92('0x33')];_0x40494f+=0x1){_0x5af894=_0x18ec47[_0x40494f]['MetricId']?_0x5204ac[_0x18ec47[_0x40494f][_0xad92('0x6c')]][_0xad92('0x6d')]:_0x18ec47[_0x40494f][_0xad92('0x65')];_0x5af894=_0x18ec47[_0x40494f]['function']?_[_0xad92('0x6e')](_0x4fe1a2[_0x18ec47[_0x40494f][_0xad92('0x6f')]],'%s',_0x5af894):_0x5af894;_0x5af894=_0x18ec47[_0x40494f][_0xad92('0x70')]?_['replace'](_0x4641a0[_0x18ec47[_0x40494f][_0xad92('0x70')]],'%s',_0x5af894):_0x5af894;if(_0x18ec47[_0x40494f][_0xad92('0x71')]){_0x424daa['group'](_0x5af894);}_0x18ec47[_0x40494f][_0xad92('0x72')]&&_0x424daa[_0xad92('0x36')](_0x5af894,_0x18ec47[_0x40494f][_0xad92('0x72')]==='DESC'?![]:!![]);_0x424daa[_0xad92('0x65')](_0x5af894,_0x18ec47[_0x40494f][_0xad92('0x73')]||_0x5af894);}if(_0x2e6915[_0xad92('0x74')]){_0x2e6915[_0xad92('0x74')]=JSON['parse'](_0x2e6915[_0xad92('0x74')]);for(var _0x51c066=0x0;_0x51c066<_0x2e6915[_0xad92('0x74')][_0xad92('0x33')];_0x51c066+=0x1){if(_0x2e6915['joins'][_0x51c066][_0xad92('0x3b')]&&_[_0xad92('0x5e')](_0x423ecf,_0x2e6915[_0xad92('0x74')][_0x51c066]['type'])&&_0x2e6915[_0xad92('0x74')][_0x51c066][_0xad92('0x75')]&&_0x2e6915['joins'][_0x51c066][_0xad92('0x76')]&&_0x2e6915[_0xad92('0x74')][_0x51c066][_0xad92('0x77')]){_0x424daa[_0x2e6915[_0xad92('0x74')][_0x51c066][_0xad92('0x3b')]](_0x2e6915[_0xad92('0x74')][_0x51c066][_0xad92('0x76')],null,util[_0xad92('0x70')](_0xad92('0x78'),_0x2e6915['table'],_0x2e6915[_0xad92('0x74')][_0x51c066][_0xad92('0x75')],_0x2e6915[_0xad92('0x74')][_0x51c066][_0xad92('0x76')],_0x2e6915['joins'][_0x51c066][_0xad92('0x77')]));}}}if(_0x2e6915[_0xad92('0x79')]){_0x2e6915['conditions']=JSON[_0xad92('0x7a')](_0x2e6915[_0xad92('0x79')]);_0x424daa[_0xad92('0x3a')](_0x49169d(_0x2e6915[_0xad92('0x79')][_0xad92('0x64')]));}_0x23c56d=_0x424daa['clone']();_0x424daa[_0xad92('0x1c')](_0x5b3577);_0x424daa['offset'](0x0);logger[_0xad92('0x7b')](_0xad92('0x7c'),_0x424daa['toString']());return dbH[_0xad92('0x7d')][_0xad92('0x2d')](_0x424daa[_0xad92('0x7e')](),{'type':dbH['sequelize'][_0xad92('0x7f')][_0xad92('0x80')]});}})['then'](respondWithResult(_0x194fc0,null))[_0xad92('0x42')](handleError(_0x194fc0,null));};function runReport(_0x3fb951,_0x432753,_0x4d103e){var _0xda3146=_0x432753[_0xad92('0x25')];var _0x176efd=0xa;var _0x6221cb=[_0xad92('0x81'),_0xad92('0x50'),_0xad92('0x51'),'cross_join'];var _0x2eb007={'SUM':'SUM(%s)','COUNT':_0xad92('0x53'),'COUNT DISTINCT':'COUNT(DISTINCT\x20%s)','MAX':'MAX(%s)','MIN':_0xad92('0x56'),'AVG':'AVG(%s)','GROUP_CONCAT':_0xad92('0x82'),'GROUP_CONCAT ASC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT DESC':_0xad92('0x59')};var _0x1e5e15={'SEC_TO_TIME':'SEC_TO_TIME(%s)','DATE':'DATE(%s)','HOUR':_0xad92('0x83'),'ROUND':_0xad92('0x5c'),'UNIX_TIMESTAMP':_0xad92('0x5d')};var _0x5ca5dd=function(_0x2b8e44){return!_[_0xad92('0x5e')]([_0xad92('0x5f'),_0xad92('0x84'),_0xad92('0x60'),'IS\x20NOT\x20EMPTY'],_0x2b8e44);};var _0x1a4290=function(_0x1538e9){if(!_0x1538e9||!_0x1538e9[_0xad92('0x62')][_0xad92('0x33')]){return'';}for(var _0x4c82df='(',_0x1e30bc=0x0;_0x1e30bc<_0x1538e9[_0xad92('0x62')][_0xad92('0x33')];_0x1e30bc+=0x1){_0x1e30bc>0x0&&(_0x4c82df+='\x20'+_0x1538e9[_0xad92('0x63')]+'\x20');_0x4c82df+=_0x1538e9['rules'][_0x1e30bc][_0xad92('0x64')]?_0x1a4290(_0x1538e9[_0xad92('0x62')][_0x1e30bc][_0xad92('0x64')]):_0x1538e9[_0xad92('0x62')][_0x1e30bc]['field']+'\x20'+_0x1538e9[_0xad92('0x62')][_0x1e30bc][_0xad92('0x66')]+(_0x5ca5dd(_0x1538e9[_0xad92('0x62')][_0x1e30bc]['condition'])?'\x20'+_0x1538e9[_0xad92('0x62')][_0x1e30bc][_0xad92('0x67')]:'');}return _0x4c82df+')';};var _0xc431f0={'where':{'id':_0x3fb951['id']}},_0x1f4a96,_0x150aac,_0x23ad34,_0x2bd71a,_0x20fcbb;_0xc431f0=_[_0xad92('0x39')]({},_0xc431f0,_0x4d103e);return db[_0xad92('0x28')]['find'](_0xc431f0)['then'](function(_0x10870f){if(_0x10870f){_0x1f4a96=_0x10870f;return _0x10870f[_0xad92('0x68')]();}return null;})[_0xad92('0x21')](function(_0x4fab5f){if(_0x4fab5f){if(!_0x4fab5f[_0xad92('0x33')]){throw new db[(_0xad92('0x85'))][(_0xad92('0x86'))]('Please\x20insert\x20at\x20least\x20one\x20field',0x193);}_0x150aac=_0x4fab5f;return db['AnalyticMetric'][_0xad92('0x40')]({'raw':!![]});}return null;})[_0xad92('0x21')](function(_0x51d37e){if(_0x51d37e){_0x23ad34=_[_0xad92('0x69')](_0x51d37e,'id');var _0x4e63e6;var _0xcd406f=squel[_0xad92('0x6a')]();_0xcd406f[_0xad92('0x6b')](_0x1f4a96[_0xad92('0x87')]);for(var _0x38ab35=0x0;_0x38ab35<_0x150aac[_0xad92('0x33')];_0x38ab35+=0x1){_0x4e63e6=_0x150aac[_0x38ab35][_0xad92('0x6c')]?_0x23ad34[_0x150aac[_0x38ab35]['MetricId']]['metric']:_0x150aac[_0x38ab35][_0xad92('0x65')];_0x4e63e6=_0x150aac[_0x38ab35][_0xad92('0x6f')]?_[_0xad92('0x6e')](_0x2eb007[_0x150aac[_0x38ab35][_0xad92('0x6f')]],'%s',_0x4e63e6):_0x4e63e6;_0x4e63e6=_0x150aac[_0x38ab35]['format']?_[_0xad92('0x6e')](_0x1e5e15[_0x150aac[_0x38ab35][_0xad92('0x70')]],'%s',_0x4e63e6):_0x4e63e6;if(_0x150aac[_0x38ab35][_0xad92('0x71')]){_0xcd406f['group'](_0x4e63e6);}_0x150aac[_0x38ab35]['orderBy']&&_0xcd406f['order'](_0x4e63e6,_0x150aac[_0x38ab35][_0xad92('0x72')]===_0xad92('0x88')?![]:!![]);_0xcd406f[_0xad92('0x65')](_0x4e63e6,_0x150aac[_0x38ab35]['alias']||_0x4e63e6);}if(_0x1f4a96[_0xad92('0x74')]){_0x1f4a96[_0xad92('0x74')]=JSON[_0xad92('0x7a')](_0x1f4a96[_0xad92('0x74')]);for(var _0x191862=0x0;_0x191862<_0x1f4a96[_0xad92('0x74')][_0xad92('0x33')];_0x191862+=0x1){if(_0x1f4a96[_0xad92('0x74')][_0x191862][_0xad92('0x3b')]&&_[_0xad92('0x5e')](_0x6221cb,_0x1f4a96['joins'][_0x191862][_0xad92('0x3b')])&&_0x1f4a96[_0xad92('0x74')][_0x191862]['parentKey']&&_0x1f4a96[_0xad92('0x74')][_0x191862][_0xad92('0x76')]&&_0x1f4a96[_0xad92('0x74')][_0x191862]['foreignKey']){_0xcd406f[_0x1f4a96[_0xad92('0x74')][_0x191862][_0xad92('0x3b')]](_0x1f4a96[_0xad92('0x74')][_0x191862][_0xad92('0x76')],null,util[_0xad92('0x70')](_0xad92('0x78'),_0x1f4a96['table'],_0x1f4a96[_0xad92('0x74')][_0x191862][_0xad92('0x75')],_0x1f4a96[_0xad92('0x74')][_0x191862][_0xad92('0x76')],_0x1f4a96[_0xad92('0x74')][_0x191862]['foreignKey']));}}}if(_0x1f4a96[_0xad92('0x79')]){_0x1f4a96[_0xad92('0x79')]=JSON[_0xad92('0x7a')](_0x1f4a96[_0xad92('0x79')]);_0xcd406f[_0xad92('0x3a')](_0x1a4290(_0x1f4a96[_0xad92('0x79')][_0xad92('0x64')]));}_0x20fcbb=_0xcd406f['clone']();_0xcd406f[_0xad92('0x1c')](_0x176efd);_0xcd406f[_0xad92('0x1a')](0x0);return;}})[_0xad92('0x21')](function(){if(_0x432753[_0xad92('0x89')]===_0xad92('0x8a')){return null;}var _0x1067a3=_[_0xad92('0x39')](_0x432753,{'name':_0x432753['fullPath']||_0x432753[_0xad92('0x25')]||_0x1f4a96['name'],'basename':_0xda3146,'savename':util[_0xad92('0x70')](_0xad92('0x8b'),_0x432753[_0xad92('0x25')]||_0x1f4a96[_0xad92('0x25')],require('randomstring')['generate'](0x4),_0x432753['output']||'csv'),'reportId':_0x1f4a96['id'],'reportType':_0xad92('0x8c')});return db[_0xad92('0x8d')][_0xad92('0x46')](_0x1067a3,{'raw':!![]});})['then'](function(_0x499449){if(_0x1f4a96['table']==='cdr'){_0x20fcbb[_0xad92('0x3a')](_0x1f4a96[_0xad92('0x87')]+_0xad92('0x8e'),_0x432753[_0xad92('0x8f')],_0x432753[_0xad92('0x90')]);}else{_0x20fcbb['where'](_0x1f4a96[_0xad92('0x87')]+_0xad92('0x91'),_0x432753[_0xad92('0x8f')],_0x432753[_0xad92('0x90')]);}if(_0x499449){logger[_0xad92('0x92')]('Run\x20Query:',_0x20fcbb[_0xad92('0x7e')]());require(_0xad92('0x93'))['fork'](path['join'](__dirname,'../../components/export/',_0x499449[_0xad92('0x89')]),[_0x499449['id'],_0x20fcbb['toString'](),path['join'](__dirname,_0xad92('0x94'),_0x499449[_0xad92('0x95')]),_0xda3146]);return _0x499449;}else{var _0x3dabf5=squel[_0xad92('0x6a')]();_0x3dabf5['from']('('+_0x20fcbb[_0xad92('0x7e')]()+')',_0xad92('0x96'));_0x3dabf5['field'](_0xad92('0x97'),'count');_0x20fcbb[_0xad92('0x1c')](_0x432753[_0xad92('0x1c')]||_0x176efd);_0x20fcbb[_0xad92('0x1a')](_0x432753[_0xad92('0x1a')]||0x0);return dbH[_0xad92('0x7d')][_0xad92('0x2d')](_0x3dabf5['toString'](),{'type':dbH['sequelize'][_0xad92('0x7f')][_0xad92('0x80')]})[_0xad92('0x21')](function(_0x3d7798){if(!_0x3d7798[_0xad92('0x33')]){_0x2bd71a=0x0;}else{_0x2bd71a=_0x3d7798[0x0][_0xad92('0x1d')]||0x0;}return dbH['sequelize'][_0xad92('0x2d')](_0x20fcbb[_0xad92('0x7e')](),{'type':dbH[_0xad92('0x7d')][_0xad92('0x7f')][_0xad92('0x80')]});})['then'](function(_0x3d56aa){return{'rows':_0x3d56aa||[],'count':_0x2bd71a};});}});}exports['run']=function(_0x5a2190,_0x448e8f){return runReport(_0x5a2190[_0xad92('0x44')],_0x5a2190[_0xad92('0x2d')],_0x5a2190[_0xad92('0x3d')])[_0xad92('0x21')](respondWithResult(_0x448e8f,null))[_0xad92('0x42')](handleError(_0x448e8f,null));};exports['runReport']=runReport;exports['query']=function(_0xe64601,_0x54eb4d){var _0x8cb7f7=0xa;var _0x12d2ed=[_0xad92('0x81'),'left_join','right_join',_0xad92('0x98')];var _0x5d2d72={'SUM':'SUM(%s)','COUNT':'COUNT(%s)','COUNT DISTINCT':_0xad92('0x54'),'MAX':'MAX(%s)','MIN':_0xad92('0x56'),'AVG':_0xad92('0x57'),'GROUP_CONCAT':_0xad92('0x82'),'GROUP_CONCAT ASC':_0xad92('0x58'),'GROUP_CONCAT DESC':_0xad92('0x59')};var _0x462417={'SEC_TO_TIME':_0xad92('0x5a'),'DATE':_0xad92('0x5b'),'HOUR':_0xad92('0x83'),'ROUND':_0xad92('0x5c'),'UNIX_TIMESTAMP':_0xad92('0x5d')};var _0x3c3223=function(_0x1da28a){return!_[_0xad92('0x5e')](['IS\x20NULL',_0xad92('0x84'),_0xad92('0x60'),_0xad92('0x61')],_0x1da28a);};var _0x5472b0=function(_0xb0b5f3){if(!_0xb0b5f3||!_0xb0b5f3['rules']['length']){return'';}for(var _0x592ec2='(',_0x1167d1=0x0;_0x1167d1<_0xb0b5f3[_0xad92('0x62')][_0xad92('0x33')];_0x1167d1+=0x1){_0x1167d1>0x0&&(_0x592ec2+='\x20'+_0xb0b5f3[_0xad92('0x63')]+'\x20');_0x592ec2+=_0xb0b5f3[_0xad92('0x62')][_0x1167d1]['group']?_0x5472b0(_0xb0b5f3[_0xad92('0x62')][_0x1167d1][_0xad92('0x64')]):_0xb0b5f3[_0xad92('0x62')][_0x1167d1][_0xad92('0x65')]+'\x20'+_0xb0b5f3[_0xad92('0x62')][_0x1167d1][_0xad92('0x66')]+(_0x3c3223(_0xb0b5f3[_0xad92('0x62')][_0x1167d1][_0xad92('0x66')])?'\x20'+_0xb0b5f3[_0xad92('0x62')][_0x1167d1]['value']:'');}return _0x592ec2+')';};var _0x1fc9a6={'where':{'id':_0xe64601[_0xad92('0x44')]['id']}},_0x5aec4e,_0x4c1e67,_0x32e228,_0x5494dd,_0xfa4c4;_0x1fc9a6=_[_0xad92('0x39')]({},_0x1fc9a6,_0xe64601['options']);return db[_0xad92('0x28')]['find'](_0x1fc9a6)[_0xad92('0x21')](function(_0x54f978){if(_0x54f978){_0x5aec4e=_0x54f978;return _0x54f978[_0xad92('0x68')]();}return null;})['then'](function(_0x530e4b){if(_0x530e4b){if(!_0x530e4b[_0xad92('0x33')]){throw new db['Sequelize'][(_0xad92('0x86'))](_0xad92('0x99'),0x193);}_0x4c1e67=_0x530e4b;return db['AnalyticMetric'][_0xad92('0x40')]({'raw':!![]});}return null;})['then'](function(_0x52e130){if(_0x52e130){_0x32e228=_[_0xad92('0x69')](_0x52e130,'id');var _0x11ae45;var _0x48450c=squel[_0xad92('0x6a')]();_0x48450c['from'](_0x5aec4e[_0xad92('0x87')]);for(var _0x2c5a48=0x0;_0x2c5a48<_0x4c1e67[_0xad92('0x33')];_0x2c5a48+=0x1){_0x11ae45=_0x4c1e67[_0x2c5a48]['MetricId']?_0x32e228[_0x4c1e67[_0x2c5a48][_0xad92('0x6c')]][_0xad92('0x6d')]:_0x4c1e67[_0x2c5a48][_0xad92('0x65')];_0x11ae45=_0x4c1e67[_0x2c5a48]['function']?_[_0xad92('0x6e')](_0x5d2d72[_0x4c1e67[_0x2c5a48]['function']],'%s',_0x11ae45):_0x11ae45;_0x11ae45=_0x4c1e67[_0x2c5a48]['format']?_[_0xad92('0x6e')](_0x462417[_0x4c1e67[_0x2c5a48][_0xad92('0x70')]],'%s',_0x11ae45):_0x11ae45;if(_0x4c1e67[_0x2c5a48][_0xad92('0x71')]){_0x48450c[_0xad92('0x64')](_0x11ae45);}_0x4c1e67[_0x2c5a48][_0xad92('0x72')]&&_0x48450c[_0xad92('0x36')](_0x11ae45,_0x4c1e67[_0x2c5a48][_0xad92('0x72')]==='DESC'?![]:!![]);_0x48450c[_0xad92('0x65')](_0x11ae45,_0x4c1e67[_0x2c5a48][_0xad92('0x73')]||_0x11ae45);}if(_0x5aec4e[_0xad92('0x74')]){_0x5aec4e['joins']=JSON[_0xad92('0x7a')](_0x5aec4e[_0xad92('0x74')]);for(var _0x336dc0=0x0;_0x336dc0<_0x5aec4e[_0xad92('0x74')]['length'];_0x336dc0+=0x1){if(_0x5aec4e[_0xad92('0x74')][_0x336dc0][_0xad92('0x3b')]&&_[_0xad92('0x5e')](_0x12d2ed,_0x5aec4e[_0xad92('0x74')][_0x336dc0][_0xad92('0x3b')])&&_0x5aec4e[_0xad92('0x74')][_0x336dc0][_0xad92('0x75')]&&_0x5aec4e[_0xad92('0x74')][_0x336dc0][_0xad92('0x76')]&&_0x5aec4e['joins'][_0x336dc0][_0xad92('0x77')]){_0x48450c[_0x5aec4e[_0xad92('0x74')][_0x336dc0][_0xad92('0x3b')]](_0x5aec4e['joins'][_0x336dc0]['foreignTable'],null,util[_0xad92('0x70')]('%s.%s\x20=\x20%s.%s',_0x5aec4e['table'],_0x5aec4e[_0xad92('0x74')][_0x336dc0][_0xad92('0x75')],_0x5aec4e['joins'][_0x336dc0][_0xad92('0x76')],_0x5aec4e['joins'][_0x336dc0]['foreignKey']));}}}if(_0x5aec4e['conditions']){_0x5aec4e[_0xad92('0x79')]=JSON[_0xad92('0x7a')](_0x5aec4e[_0xad92('0x79')]);_0x48450c[_0xad92('0x3a')](_0x5472b0(_0x5aec4e[_0xad92('0x79')][_0xad92('0x64')]));}_0xfa4c4=_0x48450c['clone']();_0x48450c[_0xad92('0x1c')](_0x8cb7f7);_0x48450c[_0xad92('0x1a')](0x0);logger[_0xad92('0x7b')](_0xad92('0x7c'),_0x48450c[_0xad92('0x7e')]());return dbH['sequelize']['query'](_0x48450c[_0xad92('0x7e')](),{'type':dbH['sequelize'][_0xad92('0x7f')][_0xad92('0x80')]});}})['then'](function(){return{'sql':_0xfa4c4[_0xad92('0x7e')]()};})[_0xad92('0x21')](respondWithResult(_0x54eb4d,null))[_0xad92('0x42')](handleError(_0x54eb4d,null));};
\ No newline at end of file
+var _0x9f7b=['autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','preview','join','left_join','SUM(%s)','COUNT(%s)','COUNT(DISTINCT\x20%s)','MAX(%s)','GROUP_CONCAT(%s)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)','DATE(%s)','HOUR(%s)','UNIX_TIMESTAMP(%s)','includes','IS\x20NOT\x20NULL','IS\x20NOT\x20EMPTY','rules','operator','group','field','condition','value','getFields','Sequelize','ValidationErrorItem','AnalyticMetric','findAll','select','from','table','MetricId','metric','function','replace','format','orderBy','order','DESC','alias','parse','joins','parentKey','foreignTable','foreignKey','%s.%s\x20=\x20%s.%s','conditions','debug','toString','sequelize','QueryTypes','SELECT','right_join','cross_join','MIN(%s)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','SEC_TO_TIME(%s)','IS\x20NULL','IS\x20EMPTY','keyBy','groupBy','clone','output','web','fullPath','%s-%s.%s','randomstring','generate','csv','custom','AnalyticExtractedReport','cdr','.calldate\x20BETWEEN\x20?\x20AND\x20?','startDate','endDate','.createdAt\x20BETWEEN\x20?\x20AND\x20?','info','Run\x20Query:','child_process','fork','../../files/reports','countTable','COUNT(*)','run','runReport','AVG(%s)','ROUND(%s)','Please\x20insert\x20at\x20least\x20one\x20field','Limited\x20Query:','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','ejs','fs-extra','lodash','squel','crypto','jsforce','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','dbH','sendStatus','end','status','json','offset','limit','undefined','count','set','apply','save','update','get','CustomReports','UserProfileResource','destroy','then','error','stack','name','send','map','AnalyticCustomReport','rawAttributes','fieldName','type','key','model','keys','filters','intersection','query','fields','attributes','length','hasOwnProperty','nolimit','sort','where','pick','filter','VIRTUAL','options','includeAll','include','rows','catch','show','params','merge','find','body','user','Reports'];(function(_0x49de40,_0x3eb11e){var _0x43860d=function(_0x2dcdda){while(--_0x2dcdda){_0x49de40['push'](_0x49de40['shift']());}};_0x43860d(++_0x3eb11e);}(_0x9f7b,0x104));var _0xb9f7=function(_0x594017,_0x3b63e4){_0x594017=_0x594017-0x0;var _0x5678a6=_0x9f7b[_0x594017];return _0x5678a6;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0xb9f7('0x0'));var jsonpatch=require(_0xb9f7('0x1'));var rp=require(_0xb9f7('0x2'));var moment=require(_0xb9f7('0x3'));var BPromise=require(_0xb9f7('0x4'));var Mustache=require(_0xb9f7('0x5'));var util=require('util');var path=require(_0xb9f7('0x6'));var sox=require(_0xb9f7('0x7'));var csv=require('to-csv');var ejs=require(_0xb9f7('0x8'));var fs=require('fs');var fs_extra=require(_0xb9f7('0x9'));var _=require(_0xb9f7('0xa'));var squel=require(_0xb9f7('0xb'));var crypto=require(_0xb9f7('0xc'));var jsforce=require(_0xb9f7('0xd'));var deskjs=require('desk.js');var toCsv=require(_0xb9f7('0xe'));var querystring=require(_0xb9f7('0xf'));var Papa=require(_0xb9f7('0x10'));var Redis=require(_0xb9f7('0x11'));var authService=require(_0xb9f7('0x12'));var qs=require(_0xb9f7('0x13'));var as=require(_0xb9f7('0x14'));var hardwareService=require(_0xb9f7('0x15'));var logger=require(_0xb9f7('0x16'))(_0xb9f7('0x17'));var utils=require(_0xb9f7('0x18'));var config=require('../../config/environment');var licenseUtil=require(_0xb9f7('0x19'));var db=require('../../mysqldb')['db'];var dbH=require(_0xb9f7('0x1a'))[_0xb9f7('0x1b')];function respondWithStatusCode(_0x2908aa,_0x172043){_0x172043=_0x172043||0xcc;return function(_0x4c8e1f){if(_0x4c8e1f){return _0x2908aa[_0xb9f7('0x1c')](_0x172043);}return _0x2908aa['status'](_0x172043)[_0xb9f7('0x1d')]();};}function respondWithResult(_0x254b14,_0x22b886){_0x22b886=_0x22b886||0xc8;return function(_0x341ce1){if(_0x341ce1){return _0x254b14[_0xb9f7('0x1e')](_0x22b886)[_0xb9f7('0x1f')](_0x341ce1);}};}function respondWithFilteredResult(_0x351ab5,_0xe52c7d){return function(_0x58a1d5){if(_0x58a1d5){var _0x515bf5=typeof _0xe52c7d[_0xb9f7('0x20')]==='undefined'&&typeof _0xe52c7d[_0xb9f7('0x21')]===_0xb9f7('0x22');var _0x2aa903=_0x58a1d5[_0xb9f7('0x23')];var _0x4196b5=_0x515bf5?0x0:_0xe52c7d[_0xb9f7('0x20')];var _0x41166e=_0x515bf5?_0x58a1d5[_0xb9f7('0x23')]:_0xe52c7d[_0xb9f7('0x20')]+_0xe52c7d[_0xb9f7('0x21')];var _0x223209;if(_0x41166e>=_0x2aa903){_0x41166e=_0x2aa903;_0x223209=0xc8;}else{_0x223209=0xce;}_0x351ab5['status'](_0x223209);return _0x351ab5[_0xb9f7('0x24')]('Content-Range',_0x4196b5+'-'+_0x41166e+'/'+_0x2aa903)['json'](_0x58a1d5);}return null;};}function patchUpdates(_0x7887e0){return function(_0x6b8c0c){try{jsonpatch[_0xb9f7('0x25')](_0x6b8c0c,_0x7887e0,!![]);}catch(_0x415296){return BPromise['reject'](_0x415296);}return _0x6b8c0c[_0xb9f7('0x26')]();};}function saveUpdates(_0x53094a,_0x49fa5b){return function(_0x1d2d49){if(_0x1d2d49){return _0x1d2d49[_0xb9f7('0x27')](_0x53094a)['then'](function(_0x48f0a7){return _0x48f0a7;});}return null;};}function removeEntity(_0xc6d60f,_0x1c11f8){return function(_0x2ee735){if(_0x2ee735){return _0x2ee735['destroy']()['then'](function(){var _0x6975d6=_0x2ee735[_0xb9f7('0x28')]({'plain':!![]});var _0x2c73f7=_0xb9f7('0x29');return db[_0xb9f7('0x2a')][_0xb9f7('0x2b')]({'where':{'type':_0x2c73f7,'resourceId':_0x6975d6['id']}})[_0xb9f7('0x2c')](function(){return _0x2ee735;});})[_0xb9f7('0x2c')](function(){_0xc6d60f[_0xb9f7('0x1e')](0xcc)[_0xb9f7('0x1d')]();});}};}function handleEntityNotFound(_0x3dfec8,_0x3de6c1){return function(_0x2caec0){if(!_0x2caec0){_0x3dfec8[_0xb9f7('0x1c')](0x194);}return _0x2caec0;};}function handleError(_0x365a8e,_0x168a17){_0x168a17=_0x168a17||0x1f4;return function(_0x486e21){logger[_0xb9f7('0x2d')](_0x486e21[_0xb9f7('0x2e')]);if(_0x486e21[_0xb9f7('0x2f')]){delete _0x486e21[_0xb9f7('0x2f')];}_0x365a8e['status'](_0x168a17)[_0xb9f7('0x30')](_0x486e21);};}exports['index']=function(_0x3fea15,_0x4e0bf0){var _0x49187a={},_0x1f44b6={},_0xef593a={'count':0x0,'rows':[]};var _0x5edb37=_[_0xb9f7('0x31')](db[_0xb9f7('0x32')][_0xb9f7('0x33')],function(_0x501fd3){return{'name':_0x501fd3[_0xb9f7('0x34')],'type':_0x501fd3[_0xb9f7('0x35')][_0xb9f7('0x36')]};});_0x1f44b6[_0xb9f7('0x37')]=_[_0xb9f7('0x31')](_0x5edb37,_0xb9f7('0x2f'));_0x1f44b6['query']=_[_0xb9f7('0x38')](_0x3fea15['query']);_0x1f44b6[_0xb9f7('0x39')]=_[_0xb9f7('0x3a')](_0x1f44b6[_0xb9f7('0x37')],_0x1f44b6[_0xb9f7('0x3b')]);_0x49187a['attributes']=_[_0xb9f7('0x3a')](_0x1f44b6[_0xb9f7('0x37')],qs[_0xb9f7('0x3c')](_0x3fea15[_0xb9f7('0x3b')][_0xb9f7('0x3c')]));_0x49187a[_0xb9f7('0x3d')]=_0x49187a['attributes'][_0xb9f7('0x3e')]?_0x49187a['attributes']:_0x1f44b6[_0xb9f7('0x37')];if(!_0x3fea15[_0xb9f7('0x3b')][_0xb9f7('0x3f')](_0xb9f7('0x40'))){_0x49187a[_0xb9f7('0x21')]=qs[_0xb9f7('0x21')](_0x3fea15[_0xb9f7('0x3b')]['limit']);_0x49187a[_0xb9f7('0x20')]=qs[_0xb9f7('0x20')](_0x3fea15['query'][_0xb9f7('0x20')]);}_0x49187a['order']=qs[_0xb9f7('0x41')](_0x3fea15[_0xb9f7('0x3b')][_0xb9f7('0x41')]);_0x49187a[_0xb9f7('0x42')]=qs['filters'](_[_0xb9f7('0x43')](_0x3fea15[_0xb9f7('0x3b')],_0x1f44b6[_0xb9f7('0x39')]),_0x5edb37);if(_0x3fea15[_0xb9f7('0x3b')][_0xb9f7('0x44')]){_0x49187a[_0xb9f7('0x42')]=_['merge'](_0x49187a[_0xb9f7('0x42')],{'$or':_[_0xb9f7('0x31')](_0x5edb37,function(_0x1136db){if(_0x1136db[_0xb9f7('0x35')]!==_0xb9f7('0x45')){var _0x45202f={};_0x45202f[_0x1136db[_0xb9f7('0x2f')]]={'$like':'%'+_0x3fea15[_0xb9f7('0x3b')][_0xb9f7('0x44')]+'%'};return _0x45202f;}})});}_0x49187a=_['merge']({},_0x49187a,_0x3fea15[_0xb9f7('0x46')]);var _0x399a7a={'where':_0x49187a[_0xb9f7('0x42')]};return db[_0xb9f7('0x32')][_0xb9f7('0x23')](_0x399a7a)[_0xb9f7('0x2c')](function(_0x35eb81){_0xef593a[_0xb9f7('0x23')]=_0x35eb81;if(_0x3fea15[_0xb9f7('0x3b')][_0xb9f7('0x47')]){_0x49187a[_0xb9f7('0x48')]=[{'all':!![]}];}return db[_0xb9f7('0x32')]['findAll'](_0x49187a);})[_0xb9f7('0x2c')](function(_0x4cf8d6){_0xef593a[_0xb9f7('0x49')]=_0x4cf8d6;return _0xef593a;})[_0xb9f7('0x2c')](respondWithFilteredResult(_0x4e0bf0,_0x49187a))[_0xb9f7('0x4a')](handleError(_0x4e0bf0,null));};exports[_0xb9f7('0x4b')]=function(_0x1ea26f,_0x132310){var _0x55ae9a={'raw':![],'where':{'id':_0x1ea26f[_0xb9f7('0x4c')]['id']}},_0x57000d={};_0x57000d['model']=_[_0xb9f7('0x38')](db[_0xb9f7('0x32')][_0xb9f7('0x33')]);_0x57000d['query']=_['keys'](_0x1ea26f[_0xb9f7('0x3b')]);_0x57000d[_0xb9f7('0x39')]=_[_0xb9f7('0x3a')](_0x57000d[_0xb9f7('0x37')],_0x57000d[_0xb9f7('0x3b')]);_0x55ae9a[_0xb9f7('0x3d')]=_[_0xb9f7('0x3a')](_0x57000d[_0xb9f7('0x37')],qs[_0xb9f7('0x3c')](_0x1ea26f[_0xb9f7('0x3b')][_0xb9f7('0x3c')]));_0x55ae9a[_0xb9f7('0x3d')]=_0x55ae9a[_0xb9f7('0x3d')][_0xb9f7('0x3e')]?_0x55ae9a[_0xb9f7('0x3d')]:_0x57000d['model'];if(_0x1ea26f[_0xb9f7('0x3b')][_0xb9f7('0x47')]){_0x55ae9a['include']=[{'all':!![]}];}_0x55ae9a=_[_0xb9f7('0x4d')]({},_0x55ae9a,_0x1ea26f[_0xb9f7('0x46')]);return db[_0xb9f7('0x32')][_0xb9f7('0x4e')](_0x55ae9a)['then'](handleEntityNotFound(_0x132310,null))[_0xb9f7('0x2c')](respondWithResult(_0x132310,null))['catch'](handleError(_0x132310,null));};exports['create']=function(_0x2a354b,_0x132c09){return db[_0xb9f7('0x32')]['create'](_0x2a354b[_0xb9f7('0x4f')],{})[_0xb9f7('0x2c')](function(_0x41f1f6){var _0xdf9e8a=_0x2a354b[_0xb9f7('0x50')][_0xb9f7('0x28')]({'plain':!![]});if(!_0xdf9e8a)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0xdf9e8a['role']===_0xb9f7('0x50')){var _0x40ff95=_0x41f1f6[_0xb9f7('0x28')]({'plain':!![]});var _0x3ae782=_0xb9f7('0x51');return db['UserProfileSection'][_0xb9f7('0x4e')]({'where':{'name':_0x3ae782,'userProfileId':_0xdf9e8a['userProfileId']},'raw':!![]})['then'](function(_0x7fbbaf){if(_0x7fbbaf&&_0x7fbbaf[_0xb9f7('0x52')]===0x0){return db[_0xb9f7('0x2a')]['create']({'name':_0x40ff95[_0xb9f7('0x2f')],'resourceId':_0x40ff95['id'],'type':'CustomReports','sectionId':_0x7fbbaf['id']},{})[_0xb9f7('0x2c')](function(){return _0x41f1f6;});}else{return _0x41f1f6;}})[_0xb9f7('0x4a')](function(_0x4b5e70){logger[_0xb9f7('0x2d')](_0xb9f7('0x53'),_0x4b5e70);throw _0x4b5e70;});}return _0x41f1f6;})['then'](respondWithResult(_0x132c09,0xc9))[_0xb9f7('0x4a')](handleError(_0x132c09,null));};exports[_0xb9f7('0x27')]=function(_0x2059d2,_0x1860d7){if(_0x2059d2[_0xb9f7('0x4f')]['id']){delete _0x2059d2[_0xb9f7('0x4f')]['id'];}return db['AnalyticCustomReport'][_0xb9f7('0x4e')]({'where':{'id':_0x2059d2[_0xb9f7('0x4c')]['id']}})['then'](handleEntityNotFound(_0x1860d7,null))[_0xb9f7('0x2c')](saveUpdates(_0x2059d2[_0xb9f7('0x4f')],null))[_0xb9f7('0x2c')](respondWithResult(_0x1860d7,null))[_0xb9f7('0x4a')](handleError(_0x1860d7,null));};exports[_0xb9f7('0x2b')]=function(_0xe8229f,_0x4d5691){return db[_0xb9f7('0x32')][_0xb9f7('0x4e')]({'where':{'id':_0xe8229f['params']['id']}})[_0xb9f7('0x2c')](handleEntityNotFound(_0x4d5691,null))['then'](removeEntity(_0x4d5691,null))[_0xb9f7('0x4a')](handleError(_0x4d5691,null));};exports[_0xb9f7('0x54')]=function(_0x33215f,_0x3b6f3c){var _0x3461f7=0xa;var _0x10f798=[_0xb9f7('0x55'),_0xb9f7('0x56'),'right_join','cross_join'];var _0x306d6c={'SUM':_0xb9f7('0x57'),'COUNT':_0xb9f7('0x58'),'COUNT DISTINCT':_0xb9f7('0x59'),'MAX':_0xb9f7('0x5a'),'MIN':'MIN(%s)','AVG':'AVG(%s)','GROUP_CONCAT':_0xb9f7('0x5b'),'GROUP_CONCAT ASC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT DESC':_0xb9f7('0x5c')};var _0x383d57={'SEC_TO_TIME':'SEC_TO_TIME(%s)','DATE':_0xb9f7('0x5d'),'HOUR':_0xb9f7('0x5e'),'ROUND':'ROUND(%s)','UNIX_TIMESTAMP':_0xb9f7('0x5f')};var _0x42caee=function(_0x353c0f){return!_[_0xb9f7('0x60')](['IS\x20NULL',_0xb9f7('0x61'),'IS\x20EMPTY',_0xb9f7('0x62')],_0x353c0f);};var _0x52c727=function(_0x38275a){if(!_0x38275a||!_0x38275a[_0xb9f7('0x63')][_0xb9f7('0x3e')]){return'';}for(var _0x28ae68='(',_0x51d1a7=0x0;_0x51d1a7<_0x38275a[_0xb9f7('0x63')]['length'];_0x51d1a7+=0x1){_0x51d1a7>0x0&&(_0x28ae68+='\x20'+_0x38275a[_0xb9f7('0x64')]+'\x20');_0x28ae68+=_0x38275a[_0xb9f7('0x63')][_0x51d1a7][_0xb9f7('0x65')]?_0x52c727(_0x38275a[_0xb9f7('0x63')][_0x51d1a7][_0xb9f7('0x65')]):_0x38275a[_0xb9f7('0x63')][_0x51d1a7][_0xb9f7('0x66')]+'\x20'+_0x38275a[_0xb9f7('0x63')][_0x51d1a7][_0xb9f7('0x67')]+(_0x42caee(_0x38275a['rules'][_0x51d1a7]['condition'])?'\x20'+_0x38275a[_0xb9f7('0x63')][_0x51d1a7][_0xb9f7('0x68')]:'');}return _0x28ae68+')';};var _0x20ab60={'where':{'id':_0x33215f[_0xb9f7('0x4c')]['id']}},_0xb1acd4,_0x3d85fa,_0x16c301,_0x196a80,_0x4283f8;_0x20ab60=_['merge']({},_0x20ab60,_0x33215f[_0xb9f7('0x46')]);return db['AnalyticCustomReport'][_0xb9f7('0x4e')](_0x20ab60)['then'](function(_0x3d9442){if(_0x3d9442){_0xb1acd4=_0x3d9442;return _0x3d9442[_0xb9f7('0x69')]();}return null;})[_0xb9f7('0x2c')](function(_0x2a3ca1){if(_0x2a3ca1){if(!_0x2a3ca1[_0xb9f7('0x3e')]){throw new db[(_0xb9f7('0x6a'))][(_0xb9f7('0x6b'))]('Please\x20insert\x20at\x20least\x20one\x20field',0x193);}_0x3d85fa=_0x2a3ca1;return db[_0xb9f7('0x6c')][_0xb9f7('0x6d')]({'raw':!![]});}return null;})[_0xb9f7('0x2c')](function(_0x474bf8){if(_0x474bf8){_0x16c301=_['keyBy'](_0x474bf8,'id');var _0x5c806f;var _0x36996a=squel[_0xb9f7('0x6e')]();_0x36996a[_0xb9f7('0x6f')](_0xb1acd4[_0xb9f7('0x70')]);for(var _0x4c8e9f=0x0;_0x4c8e9f<_0x3d85fa[_0xb9f7('0x3e')];_0x4c8e9f+=0x1){_0x5c806f=_0x3d85fa[_0x4c8e9f][_0xb9f7('0x71')]?_0x16c301[_0x3d85fa[_0x4c8e9f][_0xb9f7('0x71')]][_0xb9f7('0x72')]:_0x3d85fa[_0x4c8e9f][_0xb9f7('0x66')];_0x5c806f=_0x3d85fa[_0x4c8e9f][_0xb9f7('0x73')]?_[_0xb9f7('0x74')](_0x306d6c[_0x3d85fa[_0x4c8e9f][_0xb9f7('0x73')]],'%s',_0x5c806f):_0x5c806f;_0x5c806f=_0x3d85fa[_0x4c8e9f][_0xb9f7('0x75')]?_[_0xb9f7('0x74')](_0x383d57[_0x3d85fa[_0x4c8e9f]['format']],'%s',_0x5c806f):_0x5c806f;if(_0x3d85fa[_0x4c8e9f]['groupBy']){_0x36996a[_0xb9f7('0x65')](_0x5c806f);}_0x3d85fa[_0x4c8e9f][_0xb9f7('0x76')]&&_0x36996a[_0xb9f7('0x77')](_0x5c806f,_0x3d85fa[_0x4c8e9f]['orderBy']===_0xb9f7('0x78')?![]:!![]);_0x36996a[_0xb9f7('0x66')](_0x5c806f,_0x3d85fa[_0x4c8e9f][_0xb9f7('0x79')]||_0x5c806f);}if(_0xb1acd4['joins']){_0xb1acd4['joins']=JSON[_0xb9f7('0x7a')](_0xb1acd4['joins']);for(var _0x18a223=0x0;_0x18a223<_0xb1acd4[_0xb9f7('0x7b')]['length'];_0x18a223+=0x1){if(_0xb1acd4['joins'][_0x18a223][_0xb9f7('0x35')]&&_[_0xb9f7('0x60')](_0x10f798,_0xb1acd4['joins'][_0x18a223][_0xb9f7('0x35')])&&_0xb1acd4[_0xb9f7('0x7b')][_0x18a223][_0xb9f7('0x7c')]&&_0xb1acd4[_0xb9f7('0x7b')][_0x18a223][_0xb9f7('0x7d')]&&_0xb1acd4[_0xb9f7('0x7b')][_0x18a223][_0xb9f7('0x7e')]){_0x36996a[_0xb1acd4[_0xb9f7('0x7b')][_0x18a223]['type']](_0xb1acd4[_0xb9f7('0x7b')][_0x18a223][_0xb9f7('0x7d')],null,util[_0xb9f7('0x75')](_0xb9f7('0x7f'),_0xb1acd4['table'],_0xb1acd4[_0xb9f7('0x7b')][_0x18a223][_0xb9f7('0x7c')],_0xb1acd4[_0xb9f7('0x7b')][_0x18a223]['foreignTable'],_0xb1acd4['joins'][_0x18a223][_0xb9f7('0x7e')]));}}}if(_0xb1acd4[_0xb9f7('0x80')]){_0xb1acd4[_0xb9f7('0x80')]=JSON['parse'](_0xb1acd4[_0xb9f7('0x80')]);_0x36996a[_0xb9f7('0x42')](_0x52c727(_0xb1acd4[_0xb9f7('0x80')][_0xb9f7('0x65')]));}_0x4283f8=_0x36996a['clone']();_0x36996a['limit'](_0x3461f7);_0x36996a[_0xb9f7('0x20')](0x0);logger[_0xb9f7('0x81')]('Limited\x20Query:',_0x36996a[_0xb9f7('0x82')]());return dbH[_0xb9f7('0x83')]['query'](_0x36996a['toString'](),{'type':dbH[_0xb9f7('0x83')][_0xb9f7('0x84')][_0xb9f7('0x85')]});}})['then'](respondWithResult(_0x3b6f3c,null))[_0xb9f7('0x4a')](handleError(_0x3b6f3c,null));};function runReport(_0x168438,_0x3ae3ab,_0x533257){var _0x55055b=_0x3ae3ab[_0xb9f7('0x2f')];var _0x50b1e5=0xa;var _0x14af37=[_0xb9f7('0x55'),_0xb9f7('0x56'),_0xb9f7('0x86'),_0xb9f7('0x87')];var _0x2ae086={'SUM':_0xb9f7('0x57'),'COUNT':'COUNT(%s)','COUNT DISTINCT':'COUNT(DISTINCT\x20%s)','MAX':_0xb9f7('0x5a'),'MIN':_0xb9f7('0x88'),'AVG':'AVG(%s)','GROUP_CONCAT':_0xb9f7('0x5b'),'GROUP_CONCAT ASC':_0xb9f7('0x89'),'GROUP_CONCAT DESC':_0xb9f7('0x5c')};var _0x1ce609={'SEC_TO_TIME':_0xb9f7('0x8a'),'DATE':_0xb9f7('0x5d'),'HOUR':_0xb9f7('0x5e'),'ROUND':'ROUND(%s)','UNIX_TIMESTAMP':'UNIX_TIMESTAMP(%s)'};var _0x8fbd4f=function(_0x419255){return!_[_0xb9f7('0x60')]([_0xb9f7('0x8b'),_0xb9f7('0x61'),_0xb9f7('0x8c'),_0xb9f7('0x62')],_0x419255);};var _0x28532c=function(_0x1f2193){if(!_0x1f2193||!_0x1f2193[_0xb9f7('0x63')][_0xb9f7('0x3e')]){return'';}for(var _0x535b50='(',_0x21f5c7=0x0;_0x21f5c7<_0x1f2193[_0xb9f7('0x63')][_0xb9f7('0x3e')];_0x21f5c7+=0x1){_0x21f5c7>0x0&&(_0x535b50+='\x20'+_0x1f2193[_0xb9f7('0x64')]+'\x20');_0x535b50+=_0x1f2193[_0xb9f7('0x63')][_0x21f5c7][_0xb9f7('0x65')]?_0x28532c(_0x1f2193[_0xb9f7('0x63')][_0x21f5c7]['group']):_0x1f2193['rules'][_0x21f5c7][_0xb9f7('0x66')]+'\x20'+_0x1f2193['rules'][_0x21f5c7][_0xb9f7('0x67')]+(_0x8fbd4f(_0x1f2193[_0xb9f7('0x63')][_0x21f5c7][_0xb9f7('0x67')])?'\x20'+_0x1f2193[_0xb9f7('0x63')][_0x21f5c7][_0xb9f7('0x68')]:'');}return _0x535b50+')';};var _0x249f73={'where':{'id':_0x168438['id']}},_0x15a5ab,_0x3d66fa,_0xb300b5,_0x27b662,_0xd89e3f;_0x249f73=_['merge']({},_0x249f73,_0x533257);return db[_0xb9f7('0x32')][_0xb9f7('0x4e')](_0x249f73)[_0xb9f7('0x2c')](function(_0x2207fd){if(_0x2207fd){_0x15a5ab=_0x2207fd;return _0x2207fd['getFields']();}return null;})[_0xb9f7('0x2c')](function(_0x39b265){if(_0x39b265){if(!_0x39b265[_0xb9f7('0x3e')]){throw new db['Sequelize'][(_0xb9f7('0x6b'))]('Please\x20insert\x20at\x20least\x20one\x20field',0x193);}_0x3d66fa=_0x39b265;return db[_0xb9f7('0x6c')][_0xb9f7('0x6d')]({'raw':!![]});}return null;})['then'](function(_0x3232e4){if(_0x3232e4){_0xb300b5=_[_0xb9f7('0x8d')](_0x3232e4,'id');var _0x290391;var _0x54f80b=squel['select']();_0x54f80b[_0xb9f7('0x6f')](_0x15a5ab[_0xb9f7('0x70')]);for(var _0x598ef7=0x0;_0x598ef7<_0x3d66fa[_0xb9f7('0x3e')];_0x598ef7+=0x1){_0x290391=_0x3d66fa[_0x598ef7]['MetricId']?_0xb300b5[_0x3d66fa[_0x598ef7]['MetricId']]['metric']:_0x3d66fa[_0x598ef7][_0xb9f7('0x66')];_0x290391=_0x3d66fa[_0x598ef7][_0xb9f7('0x73')]?_['replace'](_0x2ae086[_0x3d66fa[_0x598ef7][_0xb9f7('0x73')]],'%s',_0x290391):_0x290391;_0x290391=_0x3d66fa[_0x598ef7]['format']?_[_0xb9f7('0x74')](_0x1ce609[_0x3d66fa[_0x598ef7]['format']],'%s',_0x290391):_0x290391;if(_0x3d66fa[_0x598ef7][_0xb9f7('0x8e')]){_0x54f80b[_0xb9f7('0x65')](_0x290391);}_0x3d66fa[_0x598ef7][_0xb9f7('0x76')]&&_0x54f80b[_0xb9f7('0x77')](_0x290391,_0x3d66fa[_0x598ef7][_0xb9f7('0x76')]===_0xb9f7('0x78')?![]:!![]);_0x54f80b[_0xb9f7('0x66')](_0x290391,_0x3d66fa[_0x598ef7][_0xb9f7('0x79')]||_0x290391);}if(_0x15a5ab[_0xb9f7('0x7b')]){_0x15a5ab[_0xb9f7('0x7b')]=JSON[_0xb9f7('0x7a')](_0x15a5ab[_0xb9f7('0x7b')]);for(var _0x5e6d45=0x0;_0x5e6d45<_0x15a5ab[_0xb9f7('0x7b')][_0xb9f7('0x3e')];_0x5e6d45+=0x1){if(_0x15a5ab['joins'][_0x5e6d45][_0xb9f7('0x35')]&&_['includes'](_0x14af37,_0x15a5ab[_0xb9f7('0x7b')][_0x5e6d45]['type'])&&_0x15a5ab[_0xb9f7('0x7b')][_0x5e6d45][_0xb9f7('0x7c')]&&_0x15a5ab[_0xb9f7('0x7b')][_0x5e6d45][_0xb9f7('0x7d')]&&_0x15a5ab[_0xb9f7('0x7b')][_0x5e6d45][_0xb9f7('0x7e')]){_0x54f80b[_0x15a5ab[_0xb9f7('0x7b')][_0x5e6d45][_0xb9f7('0x35')]](_0x15a5ab['joins'][_0x5e6d45]['foreignTable'],null,util[_0xb9f7('0x75')](_0xb9f7('0x7f'),_0x15a5ab[_0xb9f7('0x70')],_0x15a5ab['joins'][_0x5e6d45][_0xb9f7('0x7c')],_0x15a5ab[_0xb9f7('0x7b')][_0x5e6d45]['foreignTable'],_0x15a5ab[_0xb9f7('0x7b')][_0x5e6d45][_0xb9f7('0x7e')]));}}}if(_0x15a5ab[_0xb9f7('0x80')]){_0x15a5ab[_0xb9f7('0x80')]=JSON[_0xb9f7('0x7a')](_0x15a5ab[_0xb9f7('0x80')]);_0x54f80b[_0xb9f7('0x42')](_0x28532c(_0x15a5ab[_0xb9f7('0x80')][_0xb9f7('0x65')]));}_0xd89e3f=_0x54f80b[_0xb9f7('0x8f')]();_0x54f80b[_0xb9f7('0x21')](_0x50b1e5);_0x54f80b[_0xb9f7('0x20')](0x0);return;}})[_0xb9f7('0x2c')](function(){if(_0x3ae3ab[_0xb9f7('0x90')]===_0xb9f7('0x91')){return null;}var _0x45ff3b=_[_0xb9f7('0x4d')](_0x3ae3ab,{'name':_0x3ae3ab[_0xb9f7('0x92')]||_0x3ae3ab[_0xb9f7('0x2f')]||_0x15a5ab[_0xb9f7('0x2f')],'basename':_0x55055b,'savename':util['format'](_0xb9f7('0x93'),_0x3ae3ab[_0xb9f7('0x2f')]||_0x15a5ab['name'],require(_0xb9f7('0x94'))[_0xb9f7('0x95')](0x4),_0x3ae3ab[_0xb9f7('0x90')]||_0xb9f7('0x96')),'reportId':_0x15a5ab['id'],'reportType':_0xb9f7('0x97')});return db[_0xb9f7('0x98')]['create'](_0x45ff3b,{'raw':!![]});})[_0xb9f7('0x2c')](function(_0x36a06a){if(_0x15a5ab[_0xb9f7('0x70')]===_0xb9f7('0x99')){_0xd89e3f[_0xb9f7('0x42')](_0x15a5ab[_0xb9f7('0x70')]+_0xb9f7('0x9a'),_0x3ae3ab[_0xb9f7('0x9b')],_0x3ae3ab[_0xb9f7('0x9c')]);}else{_0xd89e3f[_0xb9f7('0x42')](_0x15a5ab['table']+_0xb9f7('0x9d'),_0x3ae3ab['startDate'],_0x3ae3ab['endDate']);}if(_0x36a06a){logger[_0xb9f7('0x9e')](_0xb9f7('0x9f'),_0xd89e3f[_0xb9f7('0x82')]());require(_0xb9f7('0xa0'))[_0xb9f7('0xa1')](path[_0xb9f7('0x55')](__dirname,'../../components/export/',_0x36a06a[_0xb9f7('0x90')]),[_0x36a06a['id'],_0xd89e3f['toString'](),path[_0xb9f7('0x55')](__dirname,_0xb9f7('0xa2'),_0x36a06a['savename']),_0x55055b]);return _0x36a06a;}else{var _0x1796a5=squel[_0xb9f7('0x6e')]();_0x1796a5[_0xb9f7('0x6f')]('('+_0xd89e3f['toString']()+')',_0xb9f7('0xa3'));_0x1796a5[_0xb9f7('0x66')](_0xb9f7('0xa4'),'count');_0xd89e3f[_0xb9f7('0x21')](_0x3ae3ab[_0xb9f7('0x21')]||_0x50b1e5);_0xd89e3f['offset'](_0x3ae3ab[_0xb9f7('0x20')]||0x0);return dbH[_0xb9f7('0x83')][_0xb9f7('0x3b')](_0x1796a5['toString'](),{'type':dbH[_0xb9f7('0x83')][_0xb9f7('0x84')][_0xb9f7('0x85')]})[_0xb9f7('0x2c')](function(_0x55f746){if(!_0x55f746[_0xb9f7('0x3e')]){_0x27b662=0x0;}else{_0x27b662=_0x55f746[0x0][_0xb9f7('0x23')]||0x0;}return dbH['sequelize'][_0xb9f7('0x3b')](_0xd89e3f[_0xb9f7('0x82')](),{'type':dbH[_0xb9f7('0x83')]['QueryTypes'][_0xb9f7('0x85')]});})[_0xb9f7('0x2c')](function(_0x5a31ea){return{'rows':_0x5a31ea||[],'count':_0x27b662};});}});}exports[_0xb9f7('0xa5')]=function(_0x15260b,_0x495abc){return runReport(_0x15260b[_0xb9f7('0x4c')],_0x15260b[_0xb9f7('0x3b')],_0x15260b['options'])[_0xb9f7('0x2c')](respondWithResult(_0x495abc,null))[_0xb9f7('0x4a')](handleError(_0x495abc,null));};exports[_0xb9f7('0xa6')]=runReport;exports[_0xb9f7('0x3b')]=function(_0x5745b5,_0x353403){var _0x188031=0xa;var _0x58db0b=[_0xb9f7('0x55'),'left_join',_0xb9f7('0x86'),_0xb9f7('0x87')];var _0x3246d8={'SUM':'SUM(%s)','COUNT':'COUNT(%s)','COUNT DISTINCT':_0xb9f7('0x59'),'MAX':_0xb9f7('0x5a'),'MIN':_0xb9f7('0x88'),'AVG':_0xb9f7('0xa7'),'GROUP_CONCAT':'GROUP_CONCAT(%s)','GROUP_CONCAT ASC':_0xb9f7('0x89'),'GROUP_CONCAT DESC':_0xb9f7('0x5c')};var _0x490b6c={'SEC_TO_TIME':'SEC_TO_TIME(%s)','DATE':_0xb9f7('0x5d'),'HOUR':_0xb9f7('0x5e'),'ROUND':_0xb9f7('0xa8'),'UNIX_TIMESTAMP':_0xb9f7('0x5f')};var _0x125037=function(_0x5ad617){return!_[_0xb9f7('0x60')]([_0xb9f7('0x8b'),'IS\x20NOT\x20NULL',_0xb9f7('0x8c'),_0xb9f7('0x62')],_0x5ad617);};var _0x4659d2=function(_0x47a27c){if(!_0x47a27c||!_0x47a27c[_0xb9f7('0x63')][_0xb9f7('0x3e')]){return'';}for(var _0xc40abf='(',_0x19649b=0x0;_0x19649b<_0x47a27c[_0xb9f7('0x63')][_0xb9f7('0x3e')];_0x19649b+=0x1){_0x19649b>0x0&&(_0xc40abf+='\x20'+_0x47a27c[_0xb9f7('0x64')]+'\x20');_0xc40abf+=_0x47a27c[_0xb9f7('0x63')][_0x19649b][_0xb9f7('0x65')]?_0x4659d2(_0x47a27c[_0xb9f7('0x63')][_0x19649b][_0xb9f7('0x65')]):_0x47a27c[_0xb9f7('0x63')][_0x19649b]['field']+'\x20'+_0x47a27c['rules'][_0x19649b][_0xb9f7('0x67')]+(_0x125037(_0x47a27c['rules'][_0x19649b][_0xb9f7('0x67')])?'\x20'+_0x47a27c[_0xb9f7('0x63')][_0x19649b][_0xb9f7('0x68')]:'');}return _0xc40abf+')';};var _0x46fbaf={'where':{'id':_0x5745b5[_0xb9f7('0x4c')]['id']}},_0x377e2d,_0x1f2366,_0x194b50,_0x7b7134,_0x5b5aa8;_0x46fbaf=_[_0xb9f7('0x4d')]({},_0x46fbaf,_0x5745b5[_0xb9f7('0x46')]);return db['AnalyticCustomReport'][_0xb9f7('0x4e')](_0x46fbaf)[_0xb9f7('0x2c')](function(_0x92e11e){if(_0x92e11e){_0x377e2d=_0x92e11e;return _0x92e11e[_0xb9f7('0x69')]();}return null;})[_0xb9f7('0x2c')](function(_0x2dcaef){if(_0x2dcaef){if(!_0x2dcaef['length']){throw new db[(_0xb9f7('0x6a'))][(_0xb9f7('0x6b'))](_0xb9f7('0xa9'),0x193);}_0x1f2366=_0x2dcaef;return db[_0xb9f7('0x6c')][_0xb9f7('0x6d')]({'raw':!![]});}return null;})[_0xb9f7('0x2c')](function(_0x4faaa9){if(_0x4faaa9){_0x194b50=_['keyBy'](_0x4faaa9,'id');var _0x3e9389;var _0x1ca1d6=squel[_0xb9f7('0x6e')]();_0x1ca1d6[_0xb9f7('0x6f')](_0x377e2d[_0xb9f7('0x70')]);for(var _0x8eeaf8=0x0;_0x8eeaf8<_0x1f2366[_0xb9f7('0x3e')];_0x8eeaf8+=0x1){_0x3e9389=_0x1f2366[_0x8eeaf8][_0xb9f7('0x71')]?_0x194b50[_0x1f2366[_0x8eeaf8][_0xb9f7('0x71')]]['metric']:_0x1f2366[_0x8eeaf8][_0xb9f7('0x66')];_0x3e9389=_0x1f2366[_0x8eeaf8][_0xb9f7('0x73')]?_[_0xb9f7('0x74')](_0x3246d8[_0x1f2366[_0x8eeaf8][_0xb9f7('0x73')]],'%s',_0x3e9389):_0x3e9389;_0x3e9389=_0x1f2366[_0x8eeaf8][_0xb9f7('0x75')]?_[_0xb9f7('0x74')](_0x490b6c[_0x1f2366[_0x8eeaf8][_0xb9f7('0x75')]],'%s',_0x3e9389):_0x3e9389;if(_0x1f2366[_0x8eeaf8][_0xb9f7('0x8e')]){_0x1ca1d6[_0xb9f7('0x65')](_0x3e9389);}_0x1f2366[_0x8eeaf8][_0xb9f7('0x76')]&&_0x1ca1d6['order'](_0x3e9389,_0x1f2366[_0x8eeaf8][_0xb9f7('0x76')]==='DESC'?![]:!![]);_0x1ca1d6[_0xb9f7('0x66')](_0x3e9389,_0x1f2366[_0x8eeaf8]['alias']||_0x3e9389);}if(_0x377e2d['joins']){_0x377e2d[_0xb9f7('0x7b')]=JSON['parse'](_0x377e2d['joins']);for(var _0x23911d=0x0;_0x23911d<_0x377e2d['joins'][_0xb9f7('0x3e')];_0x23911d+=0x1){if(_0x377e2d[_0xb9f7('0x7b')][_0x23911d][_0xb9f7('0x35')]&&_['includes'](_0x58db0b,_0x377e2d[_0xb9f7('0x7b')][_0x23911d][_0xb9f7('0x35')])&&_0x377e2d[_0xb9f7('0x7b')][_0x23911d]['parentKey']&&_0x377e2d['joins'][_0x23911d][_0xb9f7('0x7d')]&&_0x377e2d[_0xb9f7('0x7b')][_0x23911d][_0xb9f7('0x7e')]){_0x1ca1d6[_0x377e2d[_0xb9f7('0x7b')][_0x23911d][_0xb9f7('0x35')]](_0x377e2d[_0xb9f7('0x7b')][_0x23911d]['foreignTable'],null,util['format']('%s.%s\x20=\x20%s.%s',_0x377e2d['table'],_0x377e2d[_0xb9f7('0x7b')][_0x23911d][_0xb9f7('0x7c')],_0x377e2d[_0xb9f7('0x7b')][_0x23911d][_0xb9f7('0x7d')],_0x377e2d[_0xb9f7('0x7b')][_0x23911d]['foreignKey']));}}}if(_0x377e2d[_0xb9f7('0x80')]){_0x377e2d['conditions']=JSON[_0xb9f7('0x7a')](_0x377e2d[_0xb9f7('0x80')]);_0x1ca1d6[_0xb9f7('0x42')](_0x4659d2(_0x377e2d[_0xb9f7('0x80')][_0xb9f7('0x65')]));}_0x5b5aa8=_0x1ca1d6[_0xb9f7('0x8f')]();_0x1ca1d6[_0xb9f7('0x21')](_0x188031);_0x1ca1d6['offset'](0x0);logger['debug'](_0xb9f7('0xaa'),_0x1ca1d6[_0xb9f7('0x82')]());return dbH[_0xb9f7('0x83')]['query'](_0x1ca1d6[_0xb9f7('0x82')](),{'type':dbH['sequelize']['QueryTypes'][_0xb9f7('0x85')]});}})['then'](function(){return{'sql':_0x5b5aa8[_0xb9f7('0x82')]()};})[_0xb9f7('0x2c')](respondWithResult(_0x353403,null))[_0xb9f7('0x4a')](handleError(_0x353403,null));};
\ No newline at end of file
diff --git a/server/api/analyticCustomReport/analyticCustomReport.model.js b/server/api/analyticCustomReport/analyticCustomReport.model.js
index c521735..6ab4cdd 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 _0x2c50=['request-promise','path','../../config/environment','./analyticCustomReport.attributes','exports','define','AnalyticCustomReport','analytics_custom_reports','lodash','util','../../config/logger','api','moment','bluebird'];(function(_0x1e393b,_0x355f6b){var _0x3d0bfe=function(_0x320830){while(--_0x320830){_0x1e393b['push'](_0x1e393b['shift']());}};_0x3d0bfe(++_0x355f6b);}(_0x2c50,0x158));var _0x02c5=function(_0x2a56ad,_0x2b94bf){_0x2a56ad=_0x2a56ad-0x0;var _0x425175=_0x2c50[_0x2a56ad];return _0x425175;};'use strict';var _=require(_0x02c5('0x0'));var util=require(_0x02c5('0x1'));var logger=require(_0x02c5('0x2'))(_0x02c5('0x3'));var moment=require(_0x02c5('0x4'));var BPromise=require(_0x02c5('0x5'));var rp=require(_0x02c5('0x6'));var fs=require('fs');var path=require(_0x02c5('0x7'));var rimraf=require('rimraf');var config=require(_0x02c5('0x8'));var attributes=require(_0x02c5('0x9'));module[_0x02c5('0xa')]=function(_0x72f6f9,_0x46fa5a){return _0x72f6f9[_0x02c5('0xb')](_0x02c5('0xc'),attributes,{'tableName':_0x02c5('0xd'),'paranoid':!![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xd730=['path','rimraf','../../config/environment','./analyticCustomReport.attributes','exports','AnalyticCustomReport','analytics_custom_reports','lodash','util','../../config/logger','api','moment','bluebird','request-promise'];(function(_0x226fac,_0x23f076){var _0x954333=function(_0x3e7da5){while(--_0x3e7da5){_0x226fac['push'](_0x226fac['shift']());}};_0x954333(++_0x23f076);}(_0xd730,0xd9));var _0x0d73=function(_0x23fcdb,_0x304a23){_0x23fcdb=_0x23fcdb-0x0;var _0x49991c=_0xd730[_0x23fcdb];return _0x49991c;};'use strict';var _=require(_0x0d73('0x0'));var util=require(_0x0d73('0x1'));var logger=require(_0x0d73('0x2'))(_0x0d73('0x3'));var moment=require(_0x0d73('0x4'));var BPromise=require(_0x0d73('0x5'));var rp=require(_0x0d73('0x6'));var fs=require('fs');var path=require(_0x0d73('0x7'));var rimraf=require(_0x0d73('0x8'));var config=require(_0x0d73('0x9'));var attributes=require(_0x0d73('0xa'));module[_0x0d73('0xb')]=function(_0x251b57,_0x5a13ab){return _0x251b57['define'](_0x0d73('0xc'),attributes,{'tableName':_0x0d73('0xd'),'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 267c02d..e283d24 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 _0x08d3=['debug','AnalyticCustomReport,\x20%s,\x20%s,\x20%s','error','code','info','result','catch','lodash','moment','bluebird','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','AnalyticCustomReport,\x20%s,\x20%s','request\x20sent'];(function(_0x803ae0,_0x5c5f30){var _0x3c38b1=function(_0x59b091){while(--_0x59b091){_0x803ae0['push'](_0x803ae0['shift']());}};_0x3c38b1(++_0x5c5f30);}(_0x08d3,0x6b));var _0x308d=function(_0x5776cb,_0x579eb7){_0x5776cb=_0x5776cb-0x0;var _0x46349f=_0x08d3[_0x5776cb];return _0x46349f;};'use strict';var _=require(_0x308d('0x0'));var util=require('util');var moment=require(_0x308d('0x1'));var BPromise=require(_0x308d('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x308d('0x3'));var db=require(_0x308d('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x308d('0x5'))(_0x308d('0x6'));var config=require(_0x308d('0x7'));var jayson=require(_0x308d('0x8'));var client=jayson[_0x308d('0x9')][_0x308d('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x431dcb,_0x8f13b8,_0x4b8901){return new BPromise(function(_0x3e5a61,_0x5ed568){return client['request'](_0x431dcb,_0x4b8901)['then'](function(_0x2dbccc){logger['info'](_0x308d('0xb'),_0x8f13b8,_0x308d('0xc'));logger[_0x308d('0xd')](_0x308d('0xe'),_0x8f13b8,_0x308d('0xc'),JSON['stringify'](_0x2dbccc));if(_0x2dbccc[_0x308d('0xf')]){if(_0x2dbccc[_0x308d('0xf')][_0x308d('0x10')]===0x1f4){logger[_0x308d('0xf')]('AnalyticCustomReport,\x20%s,\x20%s',_0x8f13b8,_0x2dbccc[_0x308d('0xf')]['message']);return _0x5ed568(_0x2dbccc[_0x308d('0xf')]['message']);}logger[_0x308d('0xf')](_0x308d('0xb'),_0x8f13b8,_0x2dbccc[_0x308d('0xf')]['message']);return _0x3e5a61(_0x2dbccc[_0x308d('0xf')]['message']);}else{logger[_0x308d('0x11')]('AnalyticCustomReport,\x20%s,\x20%s',_0x8f13b8,_0x308d('0xc'));_0x3e5a61(_0x2dbccc[_0x308d('0x12')]['message']);}})[_0x308d('0x13')](function(_0x356abd){logger[_0x308d('0xf')]('AnalyticCustomReport,\x20%s,\x20%s',_0x8f13b8,_0x356abd);_0x5ed568(_0x356abd);});});}
\ No newline at end of file
+var _0x2a17=['lodash','moment','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','http','then','AnalyticCustomReport,\x20%s,\x20%s','request\x20sent','debug','AnalyticCustomReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','catch'];(function(_0x46b4f8,_0x48aa46){var _0x1a767f=function(_0xaebbe8){while(--_0xaebbe8){_0x46b4f8['push'](_0x46b4f8['shift']());}};_0x1a767f(++_0x48aa46);}(_0x2a17,0xb0));var _0x72a1=function(_0x26d22a,_0x321b6b){_0x26d22a=_0x26d22a-0x0;var _0x25a53b=_0x2a17[_0x26d22a];return _0x25a53b;};'use strict';var _=require(_0x72a1('0x0'));var util=require('util');var moment=require(_0x72a1('0x1'));var BPromise=require('bluebird');var rs=require(_0x72a1('0x2'));var fs=require('fs');var Redis=require(_0x72a1('0x3'));var db=require(_0x72a1('0x4'))['db'];var utils=require(_0x72a1('0x5'));var logger=require('../../config/logger')(_0x72a1('0x6'));var config=require(_0x72a1('0x7'));var jayson=require(_0x72a1('0x8'));var client=jayson['client'][_0x72a1('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x427967,_0x527362,_0x12932c){return new BPromise(function(_0x4c932f,_0x103db6){return client['request'](_0x427967,_0x12932c)[_0x72a1('0xa')](function(_0x4a41c7){logger['info'](_0x72a1('0xb'),_0x527362,_0x72a1('0xc'));logger[_0x72a1('0xd')](_0x72a1('0xe'),_0x527362,_0x72a1('0xc'),JSON[_0x72a1('0xf')](_0x4a41c7));if(_0x4a41c7[_0x72a1('0x10')]){if(_0x4a41c7[_0x72a1('0x10')][_0x72a1('0x11')]===0x1f4){logger['error']('AnalyticCustomReport,\x20%s,\x20%s',_0x527362,_0x4a41c7['error']['message']);return _0x103db6(_0x4a41c7[_0x72a1('0x10')][_0x72a1('0x12')]);}logger[_0x72a1('0x10')]('AnalyticCustomReport,\x20%s,\x20%s',_0x527362,_0x4a41c7[_0x72a1('0x10')][_0x72a1('0x12')]);return _0x4c932f(_0x4a41c7['error']['message']);}else{logger[_0x72a1('0x13')](_0x72a1('0xb'),_0x527362,_0x72a1('0xc'));_0x4c932f(_0x4a41c7[_0x72a1('0x14')]['message']);}})[_0x72a1('0x15')](function(_0x164b67){logger[_0x72a1('0x10')](_0x72a1('0xb'),_0x527362,_0x164b67);_0x103db6(_0x164b67);});});}
\ No newline at end of file
diff --git a/server/api/analyticCustomReport/index.js b/server/api/analyticCustomReport/index.js
index 1b8b136..ac4abf8 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 _0x0981=['Router','fs-extra','../../components/interaction/service','../../config/environment','./analyticCustomReport.controller','get','isAuthenticated','index','/:id','show','preview','/:id/run','run','/:id/query','post','put','update','delete','multer','util','path','connect-timeout','express'];(function(_0x15cc03,_0x10fd48){var _0x3cc81f=function(_0x42be7b){while(--_0x42be7b){_0x15cc03['push'](_0x15cc03['shift']());}};_0x3cc81f(++_0x10fd48);}(_0x0981,0x9c));var _0x1098=function(_0x1aa41f,_0x1e1ea4){_0x1aa41f=_0x1aa41f-0x0;var _0x1f8890=_0x0981[_0x1aa41f];return _0x1f8890;};'use strict';var multer=require(_0x1098('0x0'));var util=require(_0x1098('0x1'));var path=require(_0x1098('0x2'));var timeout=require(_0x1098('0x3'));var express=require(_0x1098('0x4'));var router=express[_0x1098('0x5')]();var fs_extra=require(_0x1098('0x6'));var auth=require('../../components/auth/service');var interaction=require(_0x1098('0x7'));var config=require(_0x1098('0x8'));var controller=require(_0x1098('0x9'));router[_0x1098('0xa')]('/',auth[_0x1098('0xb')](),controller[_0x1098('0xc')]);router[_0x1098('0xa')](_0x1098('0xd'),auth[_0x1098('0xb')](),controller[_0x1098('0xe')]);router[_0x1098('0xa')]('/:id/preview',auth[_0x1098('0xb')](),controller[_0x1098('0xf')]);router[_0x1098('0xa')](_0x1098('0x10'),auth[_0x1098('0xb')](),controller[_0x1098('0x11')]);router[_0x1098('0xa')](_0x1098('0x12'),auth[_0x1098('0xb')](),controller['query']);router[_0x1098('0x13')]('/',auth[_0x1098('0xb')](),controller['create']);router[_0x1098('0x14')](_0x1098('0xd'),auth['isAuthenticated'](),controller[_0x1098('0x15')]);router[_0x1098('0x16')]('/:id',auth[_0x1098('0xb')](),controller['destroy']);module['exports']=router;
\ No newline at end of file
+var _0x5dfc=['preview','/:id/run','run','query','create','put','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment','./analyticCustomReport.controller','get','isAuthenticated','index','/:id','show','/:id/preview'];(function(_0x2669f1,_0x53580c){var _0x2af515=function(_0x25c556){while(--_0x25c556){_0x2669f1['push'](_0x2669f1['shift']());}};_0x2af515(++_0x53580c);}(_0x5dfc,0x1e4));var _0xc5df=function(_0x8e8ca7,_0x5a5e07){_0x8e8ca7=_0x8e8ca7-0x0;var _0x561381=_0x5dfc[_0x8e8ca7];return _0x561381;};'use strict';var multer=require(_0xc5df('0x0'));var util=require(_0xc5df('0x1'));var path=require(_0xc5df('0x2'));var timeout=require(_0xc5df('0x3'));var express=require(_0xc5df('0x4'));var router=express[_0xc5df('0x5')]();var fs_extra=require(_0xc5df('0x6'));var auth=require('../../components/auth/service');var interaction=require(_0xc5df('0x7'));var config=require(_0xc5df('0x8'));var controller=require(_0xc5df('0x9'));router[_0xc5df('0xa')]('/',auth[_0xc5df('0xb')](),controller[_0xc5df('0xc')]);router[_0xc5df('0xa')](_0xc5df('0xd'),auth[_0xc5df('0xb')](),controller[_0xc5df('0xe')]);router[_0xc5df('0xa')](_0xc5df('0xf'),auth['isAuthenticated'](),controller[_0xc5df('0x10')]);router['get'](_0xc5df('0x11'),auth[_0xc5df('0xb')](),controller[_0xc5df('0x12')]);router[_0xc5df('0xa')]('/:id/query',auth[_0xc5df('0xb')](),controller[_0xc5df('0x13')]);router['post']('/',auth[_0xc5df('0xb')](),controller[_0xc5df('0x14')]);router[_0xc5df('0x15')](_0xc5df('0xd'),auth[_0xc5df('0xb')](),controller['update']);router[_0xc5df('0x16')](_0xc5df('0xd'),auth[_0xc5df('0xb')](),controller[_0xc5df('0x17')]);module[_0xc5df('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 0d37c9d..473a59c 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 _0x46ed=['sequelize','exports','STRING','TEXT'];(function(_0x433a86,_0x175b5c){var _0x23000c=function(_0x4b1fa0){while(--_0x4b1fa0){_0x433a86['push'](_0x433a86['shift']());}};_0x23000c(++_0x175b5c);}(_0x46ed,0x168));var _0xd46e=function(_0x8c43de,_0x90ff31){_0x8c43de=_0x8c43de-0x0;var _0xa6591b=_0x46ed[_0x8c43de];return _0xa6591b;};'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
+var _0x4819=['TEXT','exports','STRING'];(function(_0x500785,_0x15e5ff){var _0x1f8bcc=function(_0x406983){while(--_0x406983){_0x500785['push'](_0x500785['shift']());}};_0x1f8bcc(++_0x15e5ff);}(_0x4819,0xcd));var _0x9481=function(_0xe6f4ef,_0x4e34cc){_0xe6f4ef=_0xe6f4ef-0x0;var _0x4f3447=_0x4819[_0xe6f4ef];return _0x4f3447;};'use strict';var Sequelize=require('sequelize');module[_0x9481('0x0')]={'name':{'type':Sequelize[_0x9481('0x1')],'allowNull':![]},'description':{'type':Sequelize[_0x9481('0x1')]},'parent':{'type':Sequelize[_0x9481('0x1')]},'table':{'type':Sequelize[_0x9481('0x1')]},'conditions':{'type':Sequelize[_0x9481('0x2')]},'joins':{'type':Sequelize[_0x9481('0x2')]}};
\ No newline at end of file
diff --git a/server/api/analyticDefaultReport/analyticDefaultReport.controller.js b/server/api/analyticDefaultReport/analyticDefaultReport.controller.js
index 7762ef7..95711cf 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 _0xdbf5=['includes','IS\x20NULL','IS\x20NOT\x20NULL','IS\x20NOT\x20EMPTY','rules','operator','group','field','condition','value','getFields','Please\x20insert\x20at\x20least\x20one\x20field','AnalyticMetric','keyBy','select','from','MetricId','function','replace','format','groupBy','orderBy','alias','joins','parse','foreignTable','foreignKey','%s.%s\x20=\x20%s.%s','table','parentKey','conditions','debug','Limited\x20Query:','toString','SELECT','cross_join','SUM(%s)','COUNT(%s)','COUNT(DISTINCT\x20%s)','MIN(%s)','IS\x20EMPTY','ValidationErrorItem','metric','DESC','clone','output','fullPath','%s-%s.%s','randomstring','generate','default','AnalyticExtractedReport','cdr','startDate','endDate','info','fork','../../components/export/','../../files/reports','savename','countTable','COUNT(*)','sequelize','QueryTypes','run','Sequelize','rimraf','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','api','../../config/license/util','../../mysqldb','dbH','end','status','json','limit','undefined','count','set','Content-Range','reject','save','then','destroy','get','DefaultReports','UserProfileResource','sendStatus','error','stack','name','send','index','map','AnalyticDefaultReport','rawAttributes','fieldName','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','offset','order','sort','where','pick','filter','merge','type','VIRTUAL','includeAll','include','findAll','rows','show','params','options','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','Reports','UserProfileSection','find','userProfileId','catch','update','join','left_join','right_join','MAX(%s)','AVG(%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)','UNIX_TIMESTAMP(%s)'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0xdbf5,0x18c));var _0x5dbf=function(_0x2fea77,_0x579420){_0x2fea77=_0x2fea77-0x0;var _0x2171df=_0xdbf5[_0x2fea77];return _0x2171df;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x5dbf('0x0'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x5dbf('0x1'));var moment=require(_0x5dbf('0x2'));var BPromise=require(_0x5dbf('0x3'));var Mustache=require(_0x5dbf('0x4'));var util=require(_0x5dbf('0x5'));var path=require(_0x5dbf('0x6'));var sox=require(_0x5dbf('0x7'));var csv=require(_0x5dbf('0x8'));var ejs=require(_0x5dbf('0x9'));var fs=require('fs');var fs_extra=require(_0x5dbf('0xa'));var _=require(_0x5dbf('0xb'));var squel=require(_0x5dbf('0xc'));var crypto=require(_0x5dbf('0xd'));var jsforce=require('jsforce');var deskjs=require(_0x5dbf('0xe'));var toCsv=require('to-csv');var querystring=require(_0x5dbf('0xf'));var Papa=require(_0x5dbf('0x10'));var Redis=require(_0x5dbf('0x11'));var authService=require(_0x5dbf('0x12'));var qs=require('../../components/parsers/qs');var as=require(_0x5dbf('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x5dbf('0x14'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0x5dbf('0x15'));var db=require('../../mysqldb')['db'];var dbH=require(_0x5dbf('0x16'))[_0x5dbf('0x17')];function respondWithStatusCode(_0x1453a9,_0x7cb848){_0x7cb848=_0x7cb848||0xcc;return function(_0x14493a){if(_0x14493a){return _0x1453a9['sendStatus'](_0x7cb848);}return _0x1453a9['status'](_0x7cb848)[_0x5dbf('0x18')]();};}function respondWithResult(_0x3480c8,_0x48e7fd){_0x48e7fd=_0x48e7fd||0xc8;return function(_0x19624e){if(_0x19624e){return _0x3480c8[_0x5dbf('0x19')](_0x48e7fd)[_0x5dbf('0x1a')](_0x19624e);}};}function respondWithFilteredResult(_0x2dfa44,_0x181816){return function(_0x472eb9){if(_0x472eb9){var _0x2d32cc=typeof _0x181816['offset']==='undefined'&&typeof _0x181816[_0x5dbf('0x1b')]===_0x5dbf('0x1c');var _0x39c7aa=_0x472eb9[_0x5dbf('0x1d')];var _0x20c2b0=_0x2d32cc?0x0:_0x181816['offset'];var _0x11cd00=_0x2d32cc?_0x472eb9['count']:_0x181816['offset']+_0x181816['limit'];var _0x23d1e7;if(_0x11cd00>=_0x39c7aa){_0x11cd00=_0x39c7aa;_0x23d1e7=0xc8;}else{_0x23d1e7=0xce;}_0x2dfa44[_0x5dbf('0x19')](_0x23d1e7);return _0x2dfa44[_0x5dbf('0x1e')](_0x5dbf('0x1f'),_0x20c2b0+'-'+_0x11cd00+'/'+_0x39c7aa)[_0x5dbf('0x1a')](_0x472eb9);}return null;};}function patchUpdates(_0x5b2518){return function(_0x2764ea){try{jsonpatch['apply'](_0x2764ea,_0x5b2518,!![]);}catch(_0xb68f92){return BPromise[_0x5dbf('0x20')](_0xb68f92);}return _0x2764ea[_0x5dbf('0x21')]();};}function saveUpdates(_0x43a612,_0x3b763c){return function(_0x2f154e){if(_0x2f154e){return _0x2f154e['update'](_0x43a612)[_0x5dbf('0x22')](function(_0x3e3a2d){return _0x3e3a2d;});}return null;};}function removeEntity(_0x2d3e1b,_0x2079fc){return function(_0x2763ec){if(_0x2763ec){return _0x2763ec[_0x5dbf('0x23')]()[_0x5dbf('0x22')](function(){var _0x20ab1b=_0x2763ec[_0x5dbf('0x24')]({'plain':!![]});var _0x15a790=_0x5dbf('0x25');return db[_0x5dbf('0x26')][_0x5dbf('0x23')]({'where':{'type':_0x15a790,'resourceId':_0x20ab1b['id']}})[_0x5dbf('0x22')](function(){return _0x2763ec;});})[_0x5dbf('0x22')](function(){_0x2d3e1b[_0x5dbf('0x19')](0xcc)[_0x5dbf('0x18')]();});}};}function handleEntityNotFound(_0x3f8341,_0x159e61){return function(_0x22ec42){if(!_0x22ec42){_0x3f8341[_0x5dbf('0x27')](0x194);}return _0x22ec42;};}function handleError(_0x471027,_0x21cd00){_0x21cd00=_0x21cd00||0x1f4;return function(_0x5768b7){logger[_0x5dbf('0x28')](_0x5768b7[_0x5dbf('0x29')]);if(_0x5768b7[_0x5dbf('0x2a')]){delete _0x5768b7[_0x5dbf('0x2a')];}_0x471027[_0x5dbf('0x19')](_0x21cd00)[_0x5dbf('0x2b')](_0x5768b7);};}exports[_0x5dbf('0x2c')]=function(_0x31d57a,_0x406ce6){var _0x273b63={},_0x294dd7={},_0x50a307={'count':0x0,'rows':[]};var _0x4c1587=_[_0x5dbf('0x2d')](db[_0x5dbf('0x2e')][_0x5dbf('0x2f')],function(_0x3b73ad){return{'name':_0x3b73ad[_0x5dbf('0x30')],'type':_0x3b73ad['type']['key']};});_0x294dd7[_0x5dbf('0x31')]=_[_0x5dbf('0x2d')](_0x4c1587,'name');_0x294dd7[_0x5dbf('0x32')]=_[_0x5dbf('0x33')](_0x31d57a[_0x5dbf('0x32')]);_0x294dd7[_0x5dbf('0x34')]=_[_0x5dbf('0x35')](_0x294dd7['model'],_0x294dd7[_0x5dbf('0x32')]);_0x273b63[_0x5dbf('0x36')]=_[_0x5dbf('0x35')](_0x294dd7[_0x5dbf('0x31')],qs[_0x5dbf('0x37')](_0x31d57a['query'][_0x5dbf('0x37')]));_0x273b63[_0x5dbf('0x36')]=_0x273b63[_0x5dbf('0x36')][_0x5dbf('0x38')]?_0x273b63['attributes']:_0x294dd7[_0x5dbf('0x31')];if(!_0x31d57a[_0x5dbf('0x32')][_0x5dbf('0x39')](_0x5dbf('0x3a'))){_0x273b63[_0x5dbf('0x1b')]=qs[_0x5dbf('0x1b')](_0x31d57a[_0x5dbf('0x32')][_0x5dbf('0x1b')]);_0x273b63[_0x5dbf('0x3b')]=qs[_0x5dbf('0x3b')](_0x31d57a[_0x5dbf('0x32')]['offset']);}_0x273b63[_0x5dbf('0x3c')]=qs[_0x5dbf('0x3d')](_0x31d57a[_0x5dbf('0x32')]['sort']);_0x273b63[_0x5dbf('0x3e')]=qs[_0x5dbf('0x34')](_[_0x5dbf('0x3f')](_0x31d57a['query'],_0x294dd7[_0x5dbf('0x34')]),_0x4c1587);if(_0x31d57a[_0x5dbf('0x32')][_0x5dbf('0x40')]){_0x273b63['where']=_[_0x5dbf('0x41')](_0x273b63[_0x5dbf('0x3e')],{'$or':_[_0x5dbf('0x2d')](_0x4c1587,function(_0x260c9f){if(_0x260c9f[_0x5dbf('0x42')]!==_0x5dbf('0x43')){var _0x321ae3={};_0x321ae3[_0x260c9f[_0x5dbf('0x2a')]]={'$like':'%'+_0x31d57a['query']['filter']+'%'};return _0x321ae3;}})});}_0x273b63=_['merge']({},_0x273b63,_0x31d57a['options']);var _0x28b28f={'where':_0x273b63[_0x5dbf('0x3e')]};return db['AnalyticDefaultReport'][_0x5dbf('0x1d')](_0x28b28f)[_0x5dbf('0x22')](function(_0x5a60e8){_0x50a307[_0x5dbf('0x1d')]=_0x5a60e8;if(_0x31d57a[_0x5dbf('0x32')][_0x5dbf('0x44')]){_0x273b63[_0x5dbf('0x45')]=[{'all':!![]}];}return db[_0x5dbf('0x2e')][_0x5dbf('0x46')](_0x273b63);})[_0x5dbf('0x22')](function(_0x1c020a){_0x50a307[_0x5dbf('0x47')]=_0x1c020a;return _0x50a307;})[_0x5dbf('0x22')](respondWithFilteredResult(_0x406ce6,_0x273b63))['catch'](handleError(_0x406ce6,null));};exports[_0x5dbf('0x48')]=function(_0x22f958,_0xec1d28){var _0x50880d={'raw':!![],'where':{'id':_0x22f958[_0x5dbf('0x49')]['id']}},_0x16b0ff={};_0x16b0ff[_0x5dbf('0x31')]=_[_0x5dbf('0x33')](db['AnalyticDefaultReport'][_0x5dbf('0x2f')]);_0x16b0ff['query']=_[_0x5dbf('0x33')](_0x22f958[_0x5dbf('0x32')]);_0x16b0ff[_0x5dbf('0x34')]=_[_0x5dbf('0x35')](_0x16b0ff['model'],_0x16b0ff['query']);_0x50880d[_0x5dbf('0x36')]=_[_0x5dbf('0x35')](_0x16b0ff[_0x5dbf('0x31')],qs['fields'](_0x22f958[_0x5dbf('0x32')]['fields']));_0x50880d['attributes']=_0x50880d['attributes']['length']?_0x50880d[_0x5dbf('0x36')]:_0x16b0ff[_0x5dbf('0x31')];if(_0x22f958['query'][_0x5dbf('0x44')]){_0x50880d[_0x5dbf('0x45')]=[{'all':!![]}];}_0x50880d=_['merge']({},_0x50880d,_0x22f958[_0x5dbf('0x4a')]);return db[_0x5dbf('0x2e')]['find'](_0x50880d)[_0x5dbf('0x22')](handleEntityNotFound(_0xec1d28,null))['then'](respondWithResult(_0xec1d28,null))['catch'](handleError(_0xec1d28,null));};exports[_0x5dbf('0x4b')]=function(_0x2a3d30,_0x17a1c0){return db['AnalyticDefaultReport']['create'](_0x2a3d30[_0x5dbf('0x4c')],{})[_0x5dbf('0x22')](function(_0x21f477){var _0x307a00=_0x2a3d30[_0x5dbf('0x4d')][_0x5dbf('0x24')]({'plain':!![]});if(!_0x307a00)throw new Error(_0x5dbf('0x4e'));if(_0x307a00[_0x5dbf('0x4f')]==='user'){var _0x3f38a0=_0x21f477[_0x5dbf('0x24')]({'plain':!![]});var _0x2927a3=_0x5dbf('0x50');return db[_0x5dbf('0x51')][_0x5dbf('0x52')]({'where':{'name':_0x2927a3,'userProfileId':_0x307a00[_0x5dbf('0x53')]},'raw':!![]})['then'](function(_0x1b0b13){if(_0x1b0b13&&_0x1b0b13['autoAssociation']===0x0){return db[_0x5dbf('0x26')][_0x5dbf('0x4b')]({'name':_0x3f38a0[_0x5dbf('0x2a')],'resourceId':_0x3f38a0['id'],'type':_0x5dbf('0x25'),'sectionId':_0x1b0b13['id']},{})[_0x5dbf('0x22')](function(){return _0x21f477;});}else{return _0x21f477;}})[_0x5dbf('0x54')](function(_0x353d0f){logger['error']('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x353d0f);throw _0x353d0f;});}return _0x21f477;})['then'](respondWithResult(_0x17a1c0,0xc9))[_0x5dbf('0x54')](handleError(_0x17a1c0,null));};exports[_0x5dbf('0x55')]=function(_0x36a787,_0x56c8b2){if(_0x36a787['body']['id']){delete _0x36a787[_0x5dbf('0x4c')]['id'];}return db[_0x5dbf('0x2e')][_0x5dbf('0x52')]({'where':{'id':_0x36a787['params']['id']}})[_0x5dbf('0x22')](handleEntityNotFound(_0x56c8b2,null))['then'](saveUpdates(_0x36a787[_0x5dbf('0x4c')],null))[_0x5dbf('0x22')](respondWithResult(_0x56c8b2,null))[_0x5dbf('0x54')](handleError(_0x56c8b2,null));};exports['destroy']=function(_0x55fd51,_0x1b316d){return db[_0x5dbf('0x2e')][_0x5dbf('0x52')]({'where':{'id':_0x55fd51[_0x5dbf('0x49')]['id']}})['then'](handleEntityNotFound(_0x1b316d,null))[_0x5dbf('0x22')](removeEntity(_0x1b316d,null))[_0x5dbf('0x54')](handleError(_0x1b316d,null));};exports['preview']=function(_0x5485f3,_0x19ec03){var _0x14bdb1=0xa;var _0x197e8c=[_0x5dbf('0x56'),_0x5dbf('0x57'),_0x5dbf('0x58'),'cross_join'];var _0x4107f1={'SUM':'SUM(%s)','COUNT':'COUNT(%s)','COUNT DISTINCT':'COUNT(DISTINCT\x20%s)','MAX':_0x5dbf('0x59'),'MIN':'MIN(%s)','AVG':_0x5dbf('0x5a'),'GROUP_CONCAT':_0x5dbf('0x5b'),'GROUP_CONCAT ASC':_0x5dbf('0x5c'),'GROUP_CONCAT DESC':_0x5dbf('0x5d')};var _0x461ffb={'SEC_TO_TIME':_0x5dbf('0x5e'),'DATE':_0x5dbf('0x5f'),'HOUR':_0x5dbf('0x60'),'ROUND':_0x5dbf('0x61'),'UNIX_TIMESTAMP':_0x5dbf('0x62')};var _0x3a84c2=function(_0x2ca889){return!_[_0x5dbf('0x63')]([_0x5dbf('0x64'),_0x5dbf('0x65'),'IS\x20EMPTY',_0x5dbf('0x66')],_0x2ca889);};var _0x553be4=function(_0xb0a9bf){if(!_0xb0a9bf||!_0xb0a9bf[_0x5dbf('0x67')][_0x5dbf('0x38')]){return'';}for(var _0x110224='(',_0x5a975a=0x0;_0x5a975a<_0xb0a9bf[_0x5dbf('0x67')][_0x5dbf('0x38')];_0x5a975a+=0x1){_0x5a975a>0x0&&(_0x110224+='\x20'+_0xb0a9bf[_0x5dbf('0x68')]+'\x20');_0x110224+=_0xb0a9bf[_0x5dbf('0x67')][_0x5a975a][_0x5dbf('0x69')]?_0x553be4(_0xb0a9bf[_0x5dbf('0x67')][_0x5a975a]['group']):_0xb0a9bf[_0x5dbf('0x67')][_0x5a975a][_0x5dbf('0x6a')]+'\x20'+_0xb0a9bf[_0x5dbf('0x67')][_0x5a975a][_0x5dbf('0x6b')]+(_0x3a84c2(_0xb0a9bf[_0x5dbf('0x67')][_0x5a975a][_0x5dbf('0x6b')])?'\x20'+_0xb0a9bf[_0x5dbf('0x67')][_0x5a975a][_0x5dbf('0x6c')]:'');}return _0x110224+')';};var _0x12d69b={'where':{'id':_0x5485f3[_0x5dbf('0x49')]['id']}},_0x3b53da,_0x13c8ab,_0x2997a8,_0x5d7a37,_0x52109d;_0x12d69b=_[_0x5dbf('0x41')]({},_0x12d69b,_0x5485f3[_0x5dbf('0x4a')]);return db[_0x5dbf('0x2e')][_0x5dbf('0x52')](_0x12d69b)[_0x5dbf('0x22')](function(_0x1b42cf){if(_0x1b42cf){_0x3b53da=_0x1b42cf;return _0x1b42cf[_0x5dbf('0x6d')]();}return null;})[_0x5dbf('0x22')](function(_0x57c568){if(_0x57c568){if(!_0x57c568['length']){throw new db['Sequelize']['ValidationErrorItem'](_0x5dbf('0x6e'),0x193);}_0x13c8ab=_0x57c568;return db[_0x5dbf('0x6f')][_0x5dbf('0x46')]({'raw':!![]});}return null;})[_0x5dbf('0x22')](function(_0x29c4d9){if(_0x29c4d9){_0x2997a8=_[_0x5dbf('0x70')](_0x29c4d9,'id');var _0x5331ff;var _0x5bb990=squel[_0x5dbf('0x71')]();_0x5bb990[_0x5dbf('0x72')](_0x3b53da['table']);for(var _0x1728b9=0x0;_0x1728b9<_0x13c8ab[_0x5dbf('0x38')];_0x1728b9+=0x1){_0x5331ff=_0x13c8ab[_0x1728b9][_0x5dbf('0x73')]?_0x2997a8[_0x13c8ab[_0x1728b9][_0x5dbf('0x73')]]['metric']:_0x13c8ab[_0x1728b9][_0x5dbf('0x6a')];_0x5331ff=_0x13c8ab[_0x1728b9][_0x5dbf('0x74')]?_[_0x5dbf('0x75')](_0x4107f1[_0x13c8ab[_0x1728b9][_0x5dbf('0x74')]],'%s',_0x5331ff):_0x5331ff;_0x5331ff=_0x13c8ab[_0x1728b9][_0x5dbf('0x76')]?_['replace'](_0x461ffb[_0x13c8ab[_0x1728b9][_0x5dbf('0x76')]],'%s',_0x5331ff):_0x5331ff;if(_0x13c8ab[_0x1728b9][_0x5dbf('0x77')]){_0x5bb990[_0x5dbf('0x69')](_0x5331ff);}_0x13c8ab[_0x1728b9][_0x5dbf('0x78')]&&_0x5bb990['order'](_0x5331ff,_0x13c8ab[_0x1728b9][_0x5dbf('0x78')]==='DESC'?![]:!![]);_0x5bb990[_0x5dbf('0x6a')](_0x5331ff,_0x13c8ab[_0x1728b9][_0x5dbf('0x79')]||_0x5331ff);}if(_0x3b53da[_0x5dbf('0x7a')]){_0x3b53da['joins']=JSON[_0x5dbf('0x7b')](_0x3b53da[_0x5dbf('0x7a')]);for(var _0x4166ce=0x0;_0x4166ce<_0x3b53da[_0x5dbf('0x7a')]['length'];_0x4166ce+=0x1){if(_0x3b53da[_0x5dbf('0x7a')][_0x4166ce][_0x5dbf('0x42')]&&_[_0x5dbf('0x63')](_0x197e8c,_0x3b53da[_0x5dbf('0x7a')][_0x4166ce][_0x5dbf('0x42')])&&_0x3b53da[_0x5dbf('0x7a')][_0x4166ce]['parentKey']&&_0x3b53da[_0x5dbf('0x7a')][_0x4166ce][_0x5dbf('0x7c')]&&_0x3b53da['joins'][_0x4166ce][_0x5dbf('0x7d')]){_0x5bb990[_0x3b53da[_0x5dbf('0x7a')][_0x4166ce][_0x5dbf('0x42')]](_0x3b53da[_0x5dbf('0x7a')][_0x4166ce][_0x5dbf('0x7c')],null,util[_0x5dbf('0x76')](_0x5dbf('0x7e'),_0x3b53da[_0x5dbf('0x7f')],_0x3b53da[_0x5dbf('0x7a')][_0x4166ce][_0x5dbf('0x80')],_0x3b53da[_0x5dbf('0x7a')][_0x4166ce][_0x5dbf('0x7c')],_0x3b53da[_0x5dbf('0x7a')][_0x4166ce][_0x5dbf('0x7d')]));}}}if(_0x3b53da[_0x5dbf('0x81')]){_0x3b53da[_0x5dbf('0x81')]=JSON['parse'](_0x3b53da[_0x5dbf('0x81')]);_0x5bb990[_0x5dbf('0x3e')](_0x553be4(_0x3b53da[_0x5dbf('0x81')][_0x5dbf('0x69')]));}_0x52109d=_0x5bb990['clone']();_0x5bb990[_0x5dbf('0x1b')](_0x14bdb1);_0x5bb990[_0x5dbf('0x3b')](0x0);logger[_0x5dbf('0x82')](_0x5dbf('0x83'),_0x5bb990[_0x5dbf('0x84')]());return dbH['sequelize'][_0x5dbf('0x32')](_0x5bb990[_0x5dbf('0x84')](),{'type':dbH['sequelize']['QueryTypes'][_0x5dbf('0x85')]});}})[_0x5dbf('0x22')](respondWithResult(_0x19ec03,null))[_0x5dbf('0x54')](handleError(_0x19ec03,null));};function runReport(_0x8ca7de,_0x14b21b,_0x23ec75){var _0x22339b=_0x14b21b['name'];var _0x310078=0xa;var _0x3b01c0=[_0x5dbf('0x56'),_0x5dbf('0x57'),_0x5dbf('0x58'),_0x5dbf('0x86')];var _0x4cceb1={'SUM':_0x5dbf('0x87'),'COUNT':_0x5dbf('0x88'),'COUNT DISTINCT':_0x5dbf('0x89'),'MAX':_0x5dbf('0x59'),'MIN':_0x5dbf('0x8a'),'AVG':'AVG(%s)','GROUP_CONCAT':_0x5dbf('0x5b'),'GROUP_CONCAT ASC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT DESC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)'};var _0x5924d2={'SEC_TO_TIME':'SEC_TO_TIME(%s)','DATE':_0x5dbf('0x5f'),'HOUR':_0x5dbf('0x60'),'ROUND':_0x5dbf('0x61'),'UNIX_TIMESTAMP':_0x5dbf('0x62')};var _0x4333db=function(_0x4cb92d){return!_['includes']([_0x5dbf('0x64'),'IS\x20NOT\x20NULL',_0x5dbf('0x8b'),_0x5dbf('0x66')],_0x4cb92d);};var _0x541241=function(_0x3c7eaa){if(!_0x3c7eaa||!_0x3c7eaa['rules'][_0x5dbf('0x38')]){return'';}for(var _0x24d90a='(',_0xa3e94f=0x0;_0xa3e94f<_0x3c7eaa[_0x5dbf('0x67')][_0x5dbf('0x38')];_0xa3e94f+=0x1){_0xa3e94f>0x0&&(_0x24d90a+='\x20'+_0x3c7eaa['operator']+'\x20');_0x24d90a+=_0x3c7eaa[_0x5dbf('0x67')][_0xa3e94f][_0x5dbf('0x69')]?_0x541241(_0x3c7eaa[_0x5dbf('0x67')][_0xa3e94f][_0x5dbf('0x69')]):_0x3c7eaa['rules'][_0xa3e94f][_0x5dbf('0x6a')]+'\x20'+_0x3c7eaa[_0x5dbf('0x67')][_0xa3e94f][_0x5dbf('0x6b')]+(_0x4333db(_0x3c7eaa[_0x5dbf('0x67')][_0xa3e94f][_0x5dbf('0x6b')])?'\x20'+_0x3c7eaa[_0x5dbf('0x67')][_0xa3e94f][_0x5dbf('0x6c')]:'');}return _0x24d90a+')';};var _0x334f63={'where':{'id':_0x8ca7de['id']}},_0x5ac29f,_0x533fdd,_0x5bf068,_0x1bd06b,_0x274497;_0x334f63=_['merge']({},_0x334f63,_0x23ec75);return db['AnalyticDefaultReport']['find'](_0x334f63)[_0x5dbf('0x22')](function(_0x20bda9){if(_0x20bda9){_0x5ac29f=_0x20bda9;return _0x20bda9[_0x5dbf('0x6d')]();}return null;})[_0x5dbf('0x22')](function(_0x12757d){if(_0x12757d){if(!_0x12757d[_0x5dbf('0x38')]){throw new db['Sequelize'][(_0x5dbf('0x8c'))](_0x5dbf('0x6e'),0x193);}_0x533fdd=_0x12757d;return db['AnalyticMetric']['findAll']({'raw':!![]});}return null;})[_0x5dbf('0x22')](function(_0x5722b3){if(_0x5722b3){_0x5bf068=_['keyBy'](_0x5722b3,'id');var _0x3a27c4;var _0x3620d2=squel[_0x5dbf('0x71')]();_0x3620d2['from'](_0x5ac29f[_0x5dbf('0x7f')]);for(var _0x447259=0x0;_0x447259<_0x533fdd['length'];_0x447259+=0x1){_0x3a27c4=_0x533fdd[_0x447259][_0x5dbf('0x73')]?_0x5bf068[_0x533fdd[_0x447259][_0x5dbf('0x73')]][_0x5dbf('0x8d')]:_0x533fdd[_0x447259][_0x5dbf('0x6a')];_0x3a27c4=_0x533fdd[_0x447259][_0x5dbf('0x74')]?_[_0x5dbf('0x75')](_0x4cceb1[_0x533fdd[_0x447259][_0x5dbf('0x74')]],'%s',_0x3a27c4):_0x3a27c4;_0x3a27c4=_0x533fdd[_0x447259][_0x5dbf('0x76')]?_['replace'](_0x5924d2[_0x533fdd[_0x447259]['format']],'%s',_0x3a27c4):_0x3a27c4;if(_0x533fdd[_0x447259]['groupBy']){_0x3620d2[_0x5dbf('0x69')](_0x3a27c4);}_0x533fdd[_0x447259][_0x5dbf('0x78')]&&_0x3620d2[_0x5dbf('0x3c')](_0x3a27c4,_0x533fdd[_0x447259][_0x5dbf('0x78')]===_0x5dbf('0x8e')?![]:!![]);_0x3620d2[_0x5dbf('0x6a')](_0x3a27c4,_0x533fdd[_0x447259][_0x5dbf('0x79')]||_0x3a27c4);}if(_0x5ac29f[_0x5dbf('0x7a')]){_0x5ac29f[_0x5dbf('0x7a')]=JSON[_0x5dbf('0x7b')](_0x5ac29f['joins']);for(var _0x2ded2b=0x0;_0x2ded2b<_0x5ac29f[_0x5dbf('0x7a')][_0x5dbf('0x38')];_0x2ded2b+=0x1){if(_0x5ac29f[_0x5dbf('0x7a')][_0x2ded2b][_0x5dbf('0x42')]&&_[_0x5dbf('0x63')](_0x3b01c0,_0x5ac29f[_0x5dbf('0x7a')][_0x2ded2b][_0x5dbf('0x42')])&&_0x5ac29f['joins'][_0x2ded2b]['parentKey']&&_0x5ac29f[_0x5dbf('0x7a')][_0x2ded2b]['foreignTable']&&_0x5ac29f['joins'][_0x2ded2b][_0x5dbf('0x7d')]){_0x3620d2[_0x5ac29f['joins'][_0x2ded2b]['type']](_0x5ac29f['joins'][_0x2ded2b]['foreignTable'],null,util[_0x5dbf('0x76')]('%s.%s\x20=\x20%s.%s',_0x5ac29f[_0x5dbf('0x7f')],_0x5ac29f[_0x5dbf('0x7a')][_0x2ded2b][_0x5dbf('0x80')],_0x5ac29f['joins'][_0x2ded2b][_0x5dbf('0x7c')],_0x5ac29f[_0x5dbf('0x7a')][_0x2ded2b][_0x5dbf('0x7d')]));}}}if(_0x5ac29f['conditions']){_0x5ac29f[_0x5dbf('0x81')]=JSON[_0x5dbf('0x7b')](_0x5ac29f[_0x5dbf('0x81')]);_0x3620d2['where'](_0x541241(_0x5ac29f[_0x5dbf('0x81')][_0x5dbf('0x69')]));}_0x274497=_0x3620d2[_0x5dbf('0x8f')]();_0x3620d2['limit'](_0x310078);_0x3620d2[_0x5dbf('0x3b')](0x0);return;}})[_0x5dbf('0x22')](function(){if(_0x14b21b[_0x5dbf('0x90')]==='web'){return null;}var _0x48a8c5=_['merge'](_0x14b21b,{'name':_0x14b21b[_0x5dbf('0x91')]||_0x14b21b[_0x5dbf('0x2a')]||_0x5ac29f[_0x5dbf('0x2a')],'basename':_0x22339b,'savename':util[_0x5dbf('0x76')](_0x5dbf('0x92'),_0x14b21b[_0x5dbf('0x2a')]||_0x5ac29f['name'],require(_0x5dbf('0x93'))[_0x5dbf('0x94')](0x4),_0x14b21b[_0x5dbf('0x90')]||'csv'),'reportId':_0x5ac29f['id'],'reportType':_0x5dbf('0x95')});return db[_0x5dbf('0x96')][_0x5dbf('0x4b')](_0x48a8c5,{'raw':!![]});})[_0x5dbf('0x22')](function(_0x2afbd4){if(_0x5ac29f[_0x5dbf('0x7f')]===_0x5dbf('0x97')){_0x274497['where'](_0x5ac29f[_0x5dbf('0x7f')]+'.calldate\x20BETWEEN\x20?\x20AND\x20?',_0x14b21b[_0x5dbf('0x98')],_0x14b21b[_0x5dbf('0x99')]);}else{_0x274497[_0x5dbf('0x3e')](_0x5ac29f['table']+'.createdAt\x20BETWEEN\x20?\x20AND\x20?',_0x14b21b['startDate'],_0x14b21b[_0x5dbf('0x99')]);}if(_0x2afbd4){logger[_0x5dbf('0x9a')]('Run\x20Query:',_0x274497[_0x5dbf('0x84')]());require('child_process')[_0x5dbf('0x9b')](path[_0x5dbf('0x56')](__dirname,_0x5dbf('0x9c'),_0x2afbd4['output']),[_0x2afbd4['id'],_0x274497[_0x5dbf('0x84')](),path[_0x5dbf('0x56')](__dirname,_0x5dbf('0x9d'),_0x2afbd4[_0x5dbf('0x9e')]),_0x22339b]);return _0x2afbd4;}else{var _0x4bc5af=squel[_0x5dbf('0x71')]();_0x4bc5af[_0x5dbf('0x72')]('('+_0x274497['toString']()+')',_0x5dbf('0x9f'));_0x4bc5af['field'](_0x5dbf('0xa0'),_0x5dbf('0x1d'));_0x274497[_0x5dbf('0x1b')](_0x14b21b['limit']||_0x310078);_0x274497[_0x5dbf('0x3b')](_0x14b21b[_0x5dbf('0x3b')]||0x0);return dbH[_0x5dbf('0xa1')][_0x5dbf('0x32')](_0x4bc5af[_0x5dbf('0x84')](),{'type':dbH[_0x5dbf('0xa1')]['QueryTypes'][_0x5dbf('0x85')]})['then'](function(_0x6cfb82){if(!_0x6cfb82[_0x5dbf('0x38')]){_0x1bd06b=0x0;}else{_0x1bd06b=_0x6cfb82[0x0][_0x5dbf('0x1d')]||0x0;}return dbH[_0x5dbf('0xa1')][_0x5dbf('0x32')](_0x274497[_0x5dbf('0x84')](),{'type':dbH['sequelize'][_0x5dbf('0xa2')][_0x5dbf('0x85')]});})[_0x5dbf('0x22')](function(_0x4d68f6){return{'rows':_0x4d68f6||[],'count':_0x1bd06b};});}});}exports[_0x5dbf('0xa3')]=function(_0x47ac95,_0x51b241){return runReport(_0x47ac95[_0x5dbf('0x49')],_0x47ac95[_0x5dbf('0x32')],_0x47ac95[_0x5dbf('0x4a')])[_0x5dbf('0x22')](respondWithResult(_0x51b241,null))[_0x5dbf('0x54')](handleError(_0x51b241,null));};exports['runReport']=runReport;exports['query']=function(_0x4f38a0,_0x144300){var _0x1da1e3=0xa;var _0x25e681=[_0x5dbf('0x56'),_0x5dbf('0x57'),_0x5dbf('0x58'),_0x5dbf('0x86')];var _0x236754={'SUM':'SUM(%s)','COUNT':_0x5dbf('0x88'),'COUNT DISTINCT':_0x5dbf('0x89'),'MAX':_0x5dbf('0x59'),'MIN':_0x5dbf('0x8a'),'AVG':_0x5dbf('0x5a'),'GROUP_CONCAT':_0x5dbf('0x5b'),'GROUP_CONCAT ASC':_0x5dbf('0x5c'),'GROUP_CONCAT DESC':_0x5dbf('0x5d')};var _0x191a16={'SEC_TO_TIME':_0x5dbf('0x5e'),'DATE':'DATE(%s)','HOUR':'HOUR(%s)','ROUND':'ROUND(%s)','UNIX_TIMESTAMP':_0x5dbf('0x62')};var _0x51b0df=function(_0x48ea8a){return!_['includes']([_0x5dbf('0x64'),_0x5dbf('0x65'),_0x5dbf('0x8b'),_0x5dbf('0x66')],_0x48ea8a);};var _0x3de263=function(_0x4f8dde){if(!_0x4f8dde||!_0x4f8dde[_0x5dbf('0x67')][_0x5dbf('0x38')]){return'';}for(var _0x19effa='(',_0x29177e=0x0;_0x29177e<_0x4f8dde[_0x5dbf('0x67')]['length'];_0x29177e+=0x1){_0x29177e>0x0&&(_0x19effa+='\x20'+_0x4f8dde[_0x5dbf('0x68')]+'\x20');_0x19effa+=_0x4f8dde[_0x5dbf('0x67')][_0x29177e][_0x5dbf('0x69')]?_0x3de263(_0x4f8dde[_0x5dbf('0x67')][_0x29177e]['group']):_0x4f8dde[_0x5dbf('0x67')][_0x29177e][_0x5dbf('0x6a')]+'\x20'+_0x4f8dde[_0x5dbf('0x67')][_0x29177e][_0x5dbf('0x6b')]+(_0x51b0df(_0x4f8dde[_0x5dbf('0x67')][_0x29177e][_0x5dbf('0x6b')])?'\x20'+_0x4f8dde[_0x5dbf('0x67')][_0x29177e]['value']:'');}return _0x19effa+')';};var _0x4899ac={'where':{'id':_0x4f38a0['params']['id']}},_0x51864c,_0x4562a4,_0x240304,_0x5df275,_0xc588a2;_0x4899ac=_[_0x5dbf('0x41')]({},_0x4899ac,_0x4f38a0['options']);return db[_0x5dbf('0x2e')][_0x5dbf('0x52')](_0x4899ac)[_0x5dbf('0x22')](function(_0x2eafe0){if(_0x2eafe0){_0x51864c=_0x2eafe0;return _0x2eafe0[_0x5dbf('0x6d')]();}return null;})[_0x5dbf('0x22')](function(_0x414859){if(_0x414859){if(!_0x414859['length']){throw new db[(_0x5dbf('0xa4'))][(_0x5dbf('0x8c'))](_0x5dbf('0x6e'),0x193);}_0x4562a4=_0x414859;return db[_0x5dbf('0x6f')][_0x5dbf('0x46')]({'raw':!![]});}return null;})[_0x5dbf('0x22')](function(_0x153401){if(_0x153401){_0x240304=_[_0x5dbf('0x70')](_0x153401,'id');var _0xbe0ca0;var _0x521c72=squel[_0x5dbf('0x71')]();_0x521c72[_0x5dbf('0x72')](_0x51864c[_0x5dbf('0x7f')]);for(var _0x6b4262=0x0;_0x6b4262<_0x4562a4[_0x5dbf('0x38')];_0x6b4262+=0x1){_0xbe0ca0=_0x4562a4[_0x6b4262][_0x5dbf('0x73')]?_0x240304[_0x4562a4[_0x6b4262][_0x5dbf('0x73')]][_0x5dbf('0x8d')]:_0x4562a4[_0x6b4262][_0x5dbf('0x6a')];_0xbe0ca0=_0x4562a4[_0x6b4262][_0x5dbf('0x74')]?_[_0x5dbf('0x75')](_0x236754[_0x4562a4[_0x6b4262][_0x5dbf('0x74')]],'%s',_0xbe0ca0):_0xbe0ca0;_0xbe0ca0=_0x4562a4[_0x6b4262][_0x5dbf('0x76')]?_[_0x5dbf('0x75')](_0x191a16[_0x4562a4[_0x6b4262][_0x5dbf('0x76')]],'%s',_0xbe0ca0):_0xbe0ca0;if(_0x4562a4[_0x6b4262][_0x5dbf('0x77')]){_0x521c72[_0x5dbf('0x69')](_0xbe0ca0);}_0x4562a4[_0x6b4262][_0x5dbf('0x78')]&&_0x521c72[_0x5dbf('0x3c')](_0xbe0ca0,_0x4562a4[_0x6b4262]['orderBy']===_0x5dbf('0x8e')?![]:!![]);_0x521c72['field'](_0xbe0ca0,_0x4562a4[_0x6b4262][_0x5dbf('0x79')]||_0xbe0ca0);}if(_0x51864c['joins']){_0x51864c[_0x5dbf('0x7a')]=JSON['parse'](_0x51864c[_0x5dbf('0x7a')]);for(var _0x417869=0x0;_0x417869<_0x51864c[_0x5dbf('0x7a')]['length'];_0x417869+=0x1){if(_0x51864c[_0x5dbf('0x7a')][_0x417869][_0x5dbf('0x42')]&&_[_0x5dbf('0x63')](_0x25e681,_0x51864c[_0x5dbf('0x7a')][_0x417869][_0x5dbf('0x42')])&&_0x51864c[_0x5dbf('0x7a')][_0x417869][_0x5dbf('0x80')]&&_0x51864c['joins'][_0x417869][_0x5dbf('0x7c')]&&_0x51864c[_0x5dbf('0x7a')][_0x417869]['foreignKey']){_0x521c72[_0x51864c[_0x5dbf('0x7a')][_0x417869]['type']](_0x51864c['joins'][_0x417869][_0x5dbf('0x7c')],null,util[_0x5dbf('0x76')]('%s.%s\x20=\x20%s.%s',_0x51864c[_0x5dbf('0x7f')],_0x51864c['joins'][_0x417869]['parentKey'],_0x51864c[_0x5dbf('0x7a')][_0x417869]['foreignTable'],_0x51864c[_0x5dbf('0x7a')][_0x417869][_0x5dbf('0x7d')]));}}}if(_0x51864c[_0x5dbf('0x81')]){_0x51864c[_0x5dbf('0x81')]=JSON[_0x5dbf('0x7b')](_0x51864c[_0x5dbf('0x81')]);_0x521c72[_0x5dbf('0x3e')](_0x3de263(_0x51864c[_0x5dbf('0x81')][_0x5dbf('0x69')]));}_0xc588a2=_0x521c72[_0x5dbf('0x8f')]();_0x521c72[_0x5dbf('0x1b')](_0x1da1e3);_0x521c72[_0x5dbf('0x3b')](0x0);logger[_0x5dbf('0x82')]('Limited\x20Query:',_0x521c72[_0x5dbf('0x84')]());return dbH[_0x5dbf('0xa1')][_0x5dbf('0x32')](_0x521c72[_0x5dbf('0x84')](),{'type':dbH[_0x5dbf('0xa1')][_0x5dbf('0xa2')]['SELECT']});}})[_0x5dbf('0x22')](function(){return{'sql':_0xc588a2[_0x5dbf('0x84')]()};})[_0x5dbf('0x22')](respondWithResult(_0x144300,null))[_0x5dbf('0x54')](handleError(_0x144300,null));};
\ No newline at end of file
+var _0x187d=['fs-extra','lodash','squel','crypto','jsforce','desk.js','to-csv','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../mysqldb','dbH','sendStatus','status','limit','undefined','count','offset','set','json','save','update','then','get','destroy','error','name','send','map','AnalyticDefaultReport','rawAttributes','fieldName','type','model','keys','filters','intersection','query','fields','attributes','order','sort','filter','where','merge','options','includeAll','rows','catch','include','create','role','user','Reports','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','find','params','preview','left_join','right_join','cross_join','SUM(%s)','COUNT(%s)','COUNT(DISTINCT\x20%s)','MAX(%s)','MIN(%s)','AVG(%s)','GROUP_CONCAT(%s)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)','SEC_TO_TIME(%s)','DATE(%s)','HOUR(%s)','ROUND(%s)','UNIX_TIMESTAMP(%s)','includes','IS\x20NULL','IS\x20NOT\x20NULL','IS\x20NOT\x20EMPTY','rules','length','group','condition','value','getFields','Sequelize','ValidationErrorItem','Please\x20insert\x20at\x20least\x20one\x20field','findAll','keyBy','from','table','MetricId','metric','replace','format','groupBy','orderBy','field','alias','joins','parse','parentKey','foreignKey','foreignTable','conditions','clone','Limited\x20Query:','toString','sequelize','SELECT','join','IS\x20EMPTY','operator','AnalyticMetric','function','DESC','%s.%s\x20=\x20%s.%s','output','web','fullPath','%s-%s.%s','randomstring','generate','default','AnalyticExtractedReport','startDate','endDate','.createdAt\x20BETWEEN\x20?\x20AND\x20?','info','fork','../../components/export/','savename','select','countTable','QueryTypes','runReport','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','ejs'];(function(_0x26b7aa,_0x35e529){var _0x4fa7e1=function(_0x468768){while(--_0x468768){_0x26b7aa['push'](_0x26b7aa['shift']());}};_0x4fa7e1(++_0x35e529);}(_0x187d,0x93));var _0xd187=function(_0x1c546c,_0x5c57cb){_0x1c546c=_0x1c546c-0x0;var _0x2cc384=_0x187d[_0x1c546c];return _0x2cc384;};'use strict';var emlformat=require(_0xd187('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xd187('0x1'));var jsonpatch=require(_0xd187('0x2'));var rp=require(_0xd187('0x3'));var moment=require(_0xd187('0x4'));var BPromise=require(_0xd187('0x5'));var Mustache=require(_0xd187('0x6'));var util=require('util');var path=require(_0xd187('0x7'));var sox=require(_0xd187('0x8'));var csv=require('to-csv');var ejs=require(_0xd187('0x9'));var fs=require('fs');var fs_extra=require(_0xd187('0xa'));var _=require(_0xd187('0xb'));var squel=require(_0xd187('0xc'));var crypto=require(_0xd187('0xd'));var jsforce=require(_0xd187('0xe'));var deskjs=require(_0xd187('0xf'));var toCsv=require(_0xd187('0x10'));var querystring=require('querystring');var Papa=require(_0xd187('0x11'));var Redis=require(_0xd187('0x12'));var authService=require(_0xd187('0x13'));var qs=require(_0xd187('0x14'));var as=require(_0xd187('0x15'));var hardwareService=require(_0xd187('0x16'));var logger=require('../../config/logger')(_0xd187('0x17'));var utils=require(_0xd187('0x18'));var config=require(_0xd187('0x19'));var licenseUtil=require('../../config/license/util');var db=require(_0xd187('0x1a'))['db'];var dbH=require(_0xd187('0x1a'))[_0xd187('0x1b')];function respondWithStatusCode(_0x59ee4a,_0x33e3d5){_0x33e3d5=_0x33e3d5||0xcc;return function(_0x18ce42){if(_0x18ce42){return _0x59ee4a[_0xd187('0x1c')](_0x33e3d5);}return _0x59ee4a[_0xd187('0x1d')](_0x33e3d5)['end']();};}function respondWithResult(_0x39a927,_0x2050d5){_0x2050d5=_0x2050d5||0xc8;return function(_0x45ab10){if(_0x45ab10){return _0x39a927[_0xd187('0x1d')](_0x2050d5)['json'](_0x45ab10);}};}function respondWithFilteredResult(_0x245d3e,_0x52a208){return function(_0x5cf218){if(_0x5cf218){var _0x40ed84=typeof _0x52a208['offset']==='undefined'&&typeof _0x52a208[_0xd187('0x1e')]===_0xd187('0x1f');var _0x374fe0=_0x5cf218[_0xd187('0x20')];var _0x21df74=_0x40ed84?0x0:_0x52a208[_0xd187('0x21')];var _0x12b388=_0x40ed84?_0x5cf218[_0xd187('0x20')]:_0x52a208[_0xd187('0x21')]+_0x52a208[_0xd187('0x1e')];var _0x170d5c;if(_0x12b388>=_0x374fe0){_0x12b388=_0x374fe0;_0x170d5c=0xc8;}else{_0x170d5c=0xce;}_0x245d3e[_0xd187('0x1d')](_0x170d5c);return _0x245d3e[_0xd187('0x22')]('Content-Range',_0x21df74+'-'+_0x12b388+'/'+_0x374fe0)[_0xd187('0x23')](_0x5cf218);}return null;};}function patchUpdates(_0x81b988){return function(_0xc5bba5){try{jsonpatch['apply'](_0xc5bba5,_0x81b988,!![]);}catch(_0x5a0360){return BPromise['reject'](_0x5a0360);}return _0xc5bba5[_0xd187('0x24')]();};}function saveUpdates(_0x33741d,_0x249a82){return function(_0x4f62c8){if(_0x4f62c8){return _0x4f62c8[_0xd187('0x25')](_0x33741d)['then'](function(_0x145771){return _0x145771;});}return null;};}function removeEntity(_0x5a7a23,_0x1047f4){return function(_0x54f340){if(_0x54f340){return _0x54f340['destroy']()[_0xd187('0x26')](function(){var _0x4d992b=_0x54f340[_0xd187('0x27')]({'plain':!![]});var _0x598aa4='DefaultReports';return db['UserProfileResource'][_0xd187('0x28')]({'where':{'type':_0x598aa4,'resourceId':_0x4d992b['id']}})[_0xd187('0x26')](function(){return _0x54f340;});})[_0xd187('0x26')](function(){_0x5a7a23[_0xd187('0x1d')](0xcc)['end']();});}};}function handleEntityNotFound(_0x2a20ed,_0x2875c8){return function(_0x5c8e52){if(!_0x5c8e52){_0x2a20ed[_0xd187('0x1c')](0x194);}return _0x5c8e52;};}function handleError(_0x1c87ee,_0x34febe){_0x34febe=_0x34febe||0x1f4;return function(_0x4c50a5){logger[_0xd187('0x29')](_0x4c50a5['stack']);if(_0x4c50a5[_0xd187('0x2a')]){delete _0x4c50a5[_0xd187('0x2a')];}_0x1c87ee[_0xd187('0x1d')](_0x34febe)[_0xd187('0x2b')](_0x4c50a5);};}exports['index']=function(_0x140e54,_0xb38778){var _0x5bba10={},_0x4cc587={},_0x1a1922={'count':0x0,'rows':[]};var _0x1836cf=_[_0xd187('0x2c')](db[_0xd187('0x2d')][_0xd187('0x2e')],function(_0x2d8843){return{'name':_0x2d8843[_0xd187('0x2f')],'type':_0x2d8843[_0xd187('0x30')]['key']};});_0x4cc587[_0xd187('0x31')]=_[_0xd187('0x2c')](_0x1836cf,_0xd187('0x2a'));_0x4cc587['query']=_[_0xd187('0x32')](_0x140e54['query']);_0x4cc587[_0xd187('0x33')]=_[_0xd187('0x34')](_0x4cc587[_0xd187('0x31')],_0x4cc587['query']);_0x5bba10['attributes']=_[_0xd187('0x34')](_0x4cc587[_0xd187('0x31')],qs['fields'](_0x140e54[_0xd187('0x35')][_0xd187('0x36')]));_0x5bba10[_0xd187('0x37')]=_0x5bba10['attributes']['length']?_0x5bba10[_0xd187('0x37')]:_0x4cc587[_0xd187('0x31')];if(!_0x140e54['query']['hasOwnProperty']('nolimit')){_0x5bba10[_0xd187('0x1e')]=qs['limit'](_0x140e54[_0xd187('0x35')][_0xd187('0x1e')]);_0x5bba10['offset']=qs[_0xd187('0x21')](_0x140e54['query'][_0xd187('0x21')]);}_0x5bba10[_0xd187('0x38')]=qs['sort'](_0x140e54[_0xd187('0x35')][_0xd187('0x39')]);_0x5bba10['where']=qs[_0xd187('0x33')](_['pick'](_0x140e54['query'],_0x4cc587[_0xd187('0x33')]),_0x1836cf);if(_0x140e54[_0xd187('0x35')][_0xd187('0x3a')]){_0x5bba10[_0xd187('0x3b')]=_[_0xd187('0x3c')](_0x5bba10['where'],{'$or':_[_0xd187('0x2c')](_0x1836cf,function(_0xe090ad){if(_0xe090ad[_0xd187('0x30')]!=='VIRTUAL'){var _0x4b121c={};_0x4b121c[_0xe090ad['name']]={'$like':'%'+_0x140e54['query'][_0xd187('0x3a')]+'%'};return _0x4b121c;}})});}_0x5bba10=_[_0xd187('0x3c')]({},_0x5bba10,_0x140e54[_0xd187('0x3d')]);var _0x367303={'where':_0x5bba10[_0xd187('0x3b')]};return db[_0xd187('0x2d')][_0xd187('0x20')](_0x367303)[_0xd187('0x26')](function(_0x526060){_0x1a1922[_0xd187('0x20')]=_0x526060;if(_0x140e54[_0xd187('0x35')][_0xd187('0x3e')]){_0x5bba10['include']=[{'all':!![]}];}return db[_0xd187('0x2d')]['findAll'](_0x5bba10);})[_0xd187('0x26')](function(_0x406d29){_0x1a1922[_0xd187('0x3f')]=_0x406d29;return _0x1a1922;})[_0xd187('0x26')](respondWithFilteredResult(_0xb38778,_0x5bba10))[_0xd187('0x40')](handleError(_0xb38778,null));};exports['show']=function(_0x3f0484,_0x3d9e60){var _0x3215b1={'raw':!![],'where':{'id':_0x3f0484['params']['id']}},_0x3fa19c={};_0x3fa19c[_0xd187('0x31')]=_[_0xd187('0x32')](db['AnalyticDefaultReport'][_0xd187('0x2e')]);_0x3fa19c[_0xd187('0x35')]=_['keys'](_0x3f0484['query']);_0x3fa19c[_0xd187('0x33')]=_[_0xd187('0x34')](_0x3fa19c['model'],_0x3fa19c['query']);_0x3215b1['attributes']=_[_0xd187('0x34')](_0x3fa19c[_0xd187('0x31')],qs[_0xd187('0x36')](_0x3f0484[_0xd187('0x35')][_0xd187('0x36')]));_0x3215b1[_0xd187('0x37')]=_0x3215b1[_0xd187('0x37')]['length']?_0x3215b1[_0xd187('0x37')]:_0x3fa19c[_0xd187('0x31')];if(_0x3f0484[_0xd187('0x35')][_0xd187('0x3e')]){_0x3215b1[_0xd187('0x41')]=[{'all':!![]}];}_0x3215b1=_[_0xd187('0x3c')]({},_0x3215b1,_0x3f0484[_0xd187('0x3d')]);return db[_0xd187('0x2d')]['find'](_0x3215b1)[_0xd187('0x26')](handleEntityNotFound(_0x3d9e60,null))[_0xd187('0x26')](respondWithResult(_0x3d9e60,null))[_0xd187('0x40')](handleError(_0x3d9e60,null));};exports[_0xd187('0x42')]=function(_0x36b99d,_0x5ad646){return db[_0xd187('0x2d')][_0xd187('0x42')](_0x36b99d['body'],{})[_0xd187('0x26')](function(_0xd9635d){var _0x55fac6=_0x36b99d['user']['get']({'plain':!![]});if(!_0x55fac6)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x55fac6[_0xd187('0x43')]===_0xd187('0x44')){var _0x12d448=_0xd9635d[_0xd187('0x27')]({'plain':!![]});var _0x460202=_0xd187('0x45');return db[_0xd187('0x46')]['find']({'where':{'name':_0x460202,'userProfileId':_0x55fac6[_0xd187('0x47')]},'raw':!![]})[_0xd187('0x26')](function(_0x1b12c4){if(_0x1b12c4&&_0x1b12c4[_0xd187('0x48')]===0x0){return db['UserProfileResource'][_0xd187('0x42')]({'name':_0x12d448['name'],'resourceId':_0x12d448['id'],'type':'DefaultReports','sectionId':_0x1b12c4['id']},{})[_0xd187('0x26')](function(){return _0xd9635d;});}else{return _0xd9635d;}})['catch'](function(_0x1a1252){logger[_0xd187('0x29')](_0xd187('0x49'),_0x1a1252);throw _0x1a1252;});}return _0xd9635d;})[_0xd187('0x26')](respondWithResult(_0x5ad646,0xc9))[_0xd187('0x40')](handleError(_0x5ad646,null));};exports[_0xd187('0x25')]=function(_0x3c7ba6,_0x2b4f9d){if(_0x3c7ba6[_0xd187('0x4a')]['id']){delete _0x3c7ba6['body']['id'];}return db[_0xd187('0x2d')][_0xd187('0x4b')]({'where':{'id':_0x3c7ba6['params']['id']}})[_0xd187('0x26')](handleEntityNotFound(_0x2b4f9d,null))[_0xd187('0x26')](saveUpdates(_0x3c7ba6[_0xd187('0x4a')],null))['then'](respondWithResult(_0x2b4f9d,null))[_0xd187('0x40')](handleError(_0x2b4f9d,null));};exports[_0xd187('0x28')]=function(_0x50073d,_0x457da1){return db[_0xd187('0x2d')]['find']({'where':{'id':_0x50073d[_0xd187('0x4c')]['id']}})['then'](handleEntityNotFound(_0x457da1,null))[_0xd187('0x26')](removeEntity(_0x457da1,null))[_0xd187('0x40')](handleError(_0x457da1,null));};exports[_0xd187('0x4d')]=function(_0x508866,_0x100d64){var _0x2265fb=0xa;var _0x1675d9=['join',_0xd187('0x4e'),_0xd187('0x4f'),_0xd187('0x50')];var _0x56b36b={'SUM':_0xd187('0x51'),'COUNT':_0xd187('0x52'),'COUNT DISTINCT':_0xd187('0x53'),'MAX':_0xd187('0x54'),'MIN':_0xd187('0x55'),'AVG':_0xd187('0x56'),'GROUP_CONCAT':_0xd187('0x57'),'GROUP_CONCAT ASC':_0xd187('0x58'),'GROUP_CONCAT DESC':_0xd187('0x59')};var _0x2c7dd9={'SEC_TO_TIME':_0xd187('0x5a'),'DATE':_0xd187('0x5b'),'HOUR':_0xd187('0x5c'),'ROUND':_0xd187('0x5d'),'UNIX_TIMESTAMP':_0xd187('0x5e')};var _0xaff1e6=function(_0x42fb32){return!_[_0xd187('0x5f')]([_0xd187('0x60'),_0xd187('0x61'),'IS\x20EMPTY',_0xd187('0x62')],_0x42fb32);};var _0x48c82d=function(_0x13d118){if(!_0x13d118||!_0x13d118[_0xd187('0x63')][_0xd187('0x64')]){return'';}for(var _0x4225e6='(',_0x51fbdb=0x0;_0x51fbdb<_0x13d118[_0xd187('0x63')][_0xd187('0x64')];_0x51fbdb+=0x1){_0x51fbdb>0x0&&(_0x4225e6+='\x20'+_0x13d118['operator']+'\x20');_0x4225e6+=_0x13d118['rules'][_0x51fbdb][_0xd187('0x65')]?_0x48c82d(_0x13d118[_0xd187('0x63')][_0x51fbdb][_0xd187('0x65')]):_0x13d118[_0xd187('0x63')][_0x51fbdb]['field']+'\x20'+_0x13d118[_0xd187('0x63')][_0x51fbdb]['condition']+(_0xaff1e6(_0x13d118[_0xd187('0x63')][_0x51fbdb][_0xd187('0x66')])?'\x20'+_0x13d118[_0xd187('0x63')][_0x51fbdb][_0xd187('0x67')]:'');}return _0x4225e6+')';};var _0x57cad7={'where':{'id':_0x508866['params']['id']}},_0x2409a8,_0xaea7e0,_0xd12560,_0x9e82c,_0x151f3c;_0x57cad7=_['merge']({},_0x57cad7,_0x508866[_0xd187('0x3d')]);return db[_0xd187('0x2d')][_0xd187('0x4b')](_0x57cad7)[_0xd187('0x26')](function(_0x13e05a){if(_0x13e05a){_0x2409a8=_0x13e05a;return _0x13e05a[_0xd187('0x68')]();}return null;})[_0xd187('0x26')](function(_0x1291cc){if(_0x1291cc){if(!_0x1291cc[_0xd187('0x64')]){throw new db[(_0xd187('0x69'))][(_0xd187('0x6a'))](_0xd187('0x6b'),0x193);}_0xaea7e0=_0x1291cc;return db['AnalyticMetric'][_0xd187('0x6c')]({'raw':!![]});}return null;})[_0xd187('0x26')](function(_0x54e908){if(_0x54e908){_0xd12560=_[_0xd187('0x6d')](_0x54e908,'id');var _0x1a9979;var _0x4bec3e=squel['select']();_0x4bec3e[_0xd187('0x6e')](_0x2409a8[_0xd187('0x6f')]);for(var _0x2ac56f=0x0;_0x2ac56f<_0xaea7e0[_0xd187('0x64')];_0x2ac56f+=0x1){_0x1a9979=_0xaea7e0[_0x2ac56f]['MetricId']?_0xd12560[_0xaea7e0[_0x2ac56f][_0xd187('0x70')]][_0xd187('0x71')]:_0xaea7e0[_0x2ac56f]['field'];_0x1a9979=_0xaea7e0[_0x2ac56f]['function']?_[_0xd187('0x72')](_0x56b36b[_0xaea7e0[_0x2ac56f]['function']],'%s',_0x1a9979):_0x1a9979;_0x1a9979=_0xaea7e0[_0x2ac56f][_0xd187('0x73')]?_[_0xd187('0x72')](_0x2c7dd9[_0xaea7e0[_0x2ac56f]['format']],'%s',_0x1a9979):_0x1a9979;if(_0xaea7e0[_0x2ac56f][_0xd187('0x74')]){_0x4bec3e['group'](_0x1a9979);}_0xaea7e0[_0x2ac56f][_0xd187('0x75')]&&_0x4bec3e['order'](_0x1a9979,_0xaea7e0[_0x2ac56f]['orderBy']==='DESC'?![]:!![]);_0x4bec3e[_0xd187('0x76')](_0x1a9979,_0xaea7e0[_0x2ac56f][_0xd187('0x77')]||_0x1a9979);}if(_0x2409a8[_0xd187('0x78')]){_0x2409a8[_0xd187('0x78')]=JSON[_0xd187('0x79')](_0x2409a8[_0xd187('0x78')]);for(var _0x11858e=0x0;_0x11858e<_0x2409a8[_0xd187('0x78')]['length'];_0x11858e+=0x1){if(_0x2409a8[_0xd187('0x78')][_0x11858e][_0xd187('0x30')]&&_[_0xd187('0x5f')](_0x1675d9,_0x2409a8['joins'][_0x11858e][_0xd187('0x30')])&&_0x2409a8[_0xd187('0x78')][_0x11858e][_0xd187('0x7a')]&&_0x2409a8[_0xd187('0x78')][_0x11858e]['foreignTable']&&_0x2409a8[_0xd187('0x78')][_0x11858e][_0xd187('0x7b')]){_0x4bec3e[_0x2409a8['joins'][_0x11858e][_0xd187('0x30')]](_0x2409a8[_0xd187('0x78')][_0x11858e][_0xd187('0x7c')],null,util[_0xd187('0x73')]('%s.%s\x20=\x20%s.%s',_0x2409a8[_0xd187('0x6f')],_0x2409a8[_0xd187('0x78')][_0x11858e]['parentKey'],_0x2409a8[_0xd187('0x78')][_0x11858e]['foreignTable'],_0x2409a8['joins'][_0x11858e]['foreignKey']));}}}if(_0x2409a8[_0xd187('0x7d')]){_0x2409a8[_0xd187('0x7d')]=JSON[_0xd187('0x79')](_0x2409a8[_0xd187('0x7d')]);_0x4bec3e[_0xd187('0x3b')](_0x48c82d(_0x2409a8[_0xd187('0x7d')]['group']));}_0x151f3c=_0x4bec3e[_0xd187('0x7e')]();_0x4bec3e[_0xd187('0x1e')](_0x2265fb);_0x4bec3e['offset'](0x0);logger['debug'](_0xd187('0x7f'),_0x4bec3e[_0xd187('0x80')]());return dbH[_0xd187('0x81')][_0xd187('0x35')](_0x4bec3e[_0xd187('0x80')](),{'type':dbH[_0xd187('0x81')]['QueryTypes'][_0xd187('0x82')]});}})[_0xd187('0x26')](respondWithResult(_0x100d64,null))[_0xd187('0x40')](handleError(_0x100d64,null));};function runReport(_0xbc650f,_0x1da684,_0x2879ff){var _0x1982cd=_0x1da684[_0xd187('0x2a')];var _0x3d9b2f=0xa;var _0xf31fac=[_0xd187('0x83'),_0xd187('0x4e'),'right_join','cross_join'];var _0x3d7e97={'SUM':_0xd187('0x51'),'COUNT':_0xd187('0x52'),'COUNT DISTINCT':_0xd187('0x53'),'MAX':_0xd187('0x54'),'MIN':_0xd187('0x55'),'AVG':'AVG(%s)','GROUP_CONCAT':_0xd187('0x57'),'GROUP_CONCAT ASC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT DESC':_0xd187('0x59')};var _0x520f86={'SEC_TO_TIME':'SEC_TO_TIME(%s)','DATE':_0xd187('0x5b'),'HOUR':'HOUR(%s)','ROUND':_0xd187('0x5d'),'UNIX_TIMESTAMP':_0xd187('0x5e')};var _0x1ccb17=function(_0x432995){return!_[_0xd187('0x5f')]([_0xd187('0x60'),_0xd187('0x61'),_0xd187('0x84'),_0xd187('0x62')],_0x432995);};var _0x395e45=function(_0x1e8839){if(!_0x1e8839||!_0x1e8839[_0xd187('0x63')][_0xd187('0x64')]){return'';}for(var _0x2101a3='(',_0x25fc08=0x0;_0x25fc08<_0x1e8839['rules'][_0xd187('0x64')];_0x25fc08+=0x1){_0x25fc08>0x0&&(_0x2101a3+='\x20'+_0x1e8839[_0xd187('0x85')]+'\x20');_0x2101a3+=_0x1e8839[_0xd187('0x63')][_0x25fc08][_0xd187('0x65')]?_0x395e45(_0x1e8839['rules'][_0x25fc08][_0xd187('0x65')]):_0x1e8839[_0xd187('0x63')][_0x25fc08]['field']+'\x20'+_0x1e8839['rules'][_0x25fc08][_0xd187('0x66')]+(_0x1ccb17(_0x1e8839[_0xd187('0x63')][_0x25fc08][_0xd187('0x66')])?'\x20'+_0x1e8839[_0xd187('0x63')][_0x25fc08][_0xd187('0x67')]:'');}return _0x2101a3+')';};var _0x475ea9={'where':{'id':_0xbc650f['id']}},_0x4dd0c7,_0x22900,_0x22424d,_0x5b7870,_0x3244dd;_0x475ea9=_[_0xd187('0x3c')]({},_0x475ea9,_0x2879ff);return db[_0xd187('0x2d')][_0xd187('0x4b')](_0x475ea9)['then'](function(_0x5be1c9){if(_0x5be1c9){_0x4dd0c7=_0x5be1c9;return _0x5be1c9[_0xd187('0x68')]();}return null;})[_0xd187('0x26')](function(_0x1cd0d2){if(_0x1cd0d2){if(!_0x1cd0d2['length']){throw new db[(_0xd187('0x69'))][(_0xd187('0x6a'))](_0xd187('0x6b'),0x193);}_0x22900=_0x1cd0d2;return db[_0xd187('0x86')]['findAll']({'raw':!![]});}return null;})[_0xd187('0x26')](function(_0x4efb9f){if(_0x4efb9f){_0x22424d=_['keyBy'](_0x4efb9f,'id');var _0x4a9310;var _0x54bf98=squel['select']();_0x54bf98['from'](_0x4dd0c7['table']);for(var _0x323311=0x0;_0x323311<_0x22900[_0xd187('0x64')];_0x323311+=0x1){_0x4a9310=_0x22900[_0x323311]['MetricId']?_0x22424d[_0x22900[_0x323311][_0xd187('0x70')]][_0xd187('0x71')]:_0x22900[_0x323311][_0xd187('0x76')];_0x4a9310=_0x22900[_0x323311][_0xd187('0x87')]?_[_0xd187('0x72')](_0x3d7e97[_0x22900[_0x323311]['function']],'%s',_0x4a9310):_0x4a9310;_0x4a9310=_0x22900[_0x323311][_0xd187('0x73')]?_['replace'](_0x520f86[_0x22900[_0x323311][_0xd187('0x73')]],'%s',_0x4a9310):_0x4a9310;if(_0x22900[_0x323311][_0xd187('0x74')]){_0x54bf98[_0xd187('0x65')](_0x4a9310);}_0x22900[_0x323311][_0xd187('0x75')]&&_0x54bf98[_0xd187('0x38')](_0x4a9310,_0x22900[_0x323311][_0xd187('0x75')]===_0xd187('0x88')?![]:!![]);_0x54bf98['field'](_0x4a9310,_0x22900[_0x323311][_0xd187('0x77')]||_0x4a9310);}if(_0x4dd0c7[_0xd187('0x78')]){_0x4dd0c7['joins']=JSON[_0xd187('0x79')](_0x4dd0c7[_0xd187('0x78')]);for(var _0x5df926=0x0;_0x5df926<_0x4dd0c7[_0xd187('0x78')][_0xd187('0x64')];_0x5df926+=0x1){if(_0x4dd0c7[_0xd187('0x78')][_0x5df926][_0xd187('0x30')]&&_[_0xd187('0x5f')](_0xf31fac,_0x4dd0c7[_0xd187('0x78')][_0x5df926][_0xd187('0x30')])&&_0x4dd0c7[_0xd187('0x78')][_0x5df926]['parentKey']&&_0x4dd0c7[_0xd187('0x78')][_0x5df926][_0xd187('0x7c')]&&_0x4dd0c7[_0xd187('0x78')][_0x5df926][_0xd187('0x7b')]){_0x54bf98[_0x4dd0c7[_0xd187('0x78')][_0x5df926][_0xd187('0x30')]](_0x4dd0c7['joins'][_0x5df926]['foreignTable'],null,util[_0xd187('0x73')](_0xd187('0x89'),_0x4dd0c7['table'],_0x4dd0c7[_0xd187('0x78')][_0x5df926][_0xd187('0x7a')],_0x4dd0c7[_0xd187('0x78')][_0x5df926][_0xd187('0x7c')],_0x4dd0c7[_0xd187('0x78')][_0x5df926][_0xd187('0x7b')]));}}}if(_0x4dd0c7['conditions']){_0x4dd0c7[_0xd187('0x7d')]=JSON[_0xd187('0x79')](_0x4dd0c7[_0xd187('0x7d')]);_0x54bf98[_0xd187('0x3b')](_0x395e45(_0x4dd0c7[_0xd187('0x7d')][_0xd187('0x65')]));}_0x3244dd=_0x54bf98[_0xd187('0x7e')]();_0x54bf98[_0xd187('0x1e')](_0x3d9b2f);_0x54bf98[_0xd187('0x21')](0x0);return;}})['then'](function(){if(_0x1da684[_0xd187('0x8a')]===_0xd187('0x8b')){return null;}var _0x25a053=_['merge'](_0x1da684,{'name':_0x1da684[_0xd187('0x8c')]||_0x1da684[_0xd187('0x2a')]||_0x4dd0c7[_0xd187('0x2a')],'basename':_0x1982cd,'savename':util[_0xd187('0x73')](_0xd187('0x8d'),_0x1da684[_0xd187('0x2a')]||_0x4dd0c7['name'],require(_0xd187('0x8e'))[_0xd187('0x8f')](0x4),_0x1da684[_0xd187('0x8a')]||'csv'),'reportId':_0x4dd0c7['id'],'reportType':_0xd187('0x90')});return db[_0xd187('0x91')][_0xd187('0x42')](_0x25a053,{'raw':!![]});})[_0xd187('0x26')](function(_0x12599e){if(_0x4dd0c7[_0xd187('0x6f')]==='cdr'){_0x3244dd[_0xd187('0x3b')](_0x4dd0c7[_0xd187('0x6f')]+'.calldate\x20BETWEEN\x20?\x20AND\x20?',_0x1da684[_0xd187('0x92')],_0x1da684[_0xd187('0x93')]);}else{_0x3244dd['where'](_0x4dd0c7[_0xd187('0x6f')]+_0xd187('0x94'),_0x1da684['startDate'],_0x1da684[_0xd187('0x93')]);}if(_0x12599e){logger[_0xd187('0x95')]('Run\x20Query:',_0x3244dd[_0xd187('0x80')]());require('child_process')[_0xd187('0x96')](path[_0xd187('0x83')](__dirname,_0xd187('0x97'),_0x12599e[_0xd187('0x8a')]),[_0x12599e['id'],_0x3244dd[_0xd187('0x80')](),path['join'](__dirname,'../../files/reports',_0x12599e[_0xd187('0x98')]),_0x1982cd]);return _0x12599e;}else{var _0x2a2c7f=squel[_0xd187('0x99')]();_0x2a2c7f[_0xd187('0x6e')]('('+_0x3244dd[_0xd187('0x80')]()+')',_0xd187('0x9a'));_0x2a2c7f[_0xd187('0x76')]('COUNT(*)',_0xd187('0x20'));_0x3244dd[_0xd187('0x1e')](_0x1da684[_0xd187('0x1e')]||_0x3d9b2f);_0x3244dd[_0xd187('0x21')](_0x1da684[_0xd187('0x21')]||0x0);return dbH[_0xd187('0x81')]['query'](_0x2a2c7f[_0xd187('0x80')](),{'type':dbH[_0xd187('0x81')][_0xd187('0x9b')][_0xd187('0x82')]})[_0xd187('0x26')](function(_0x38a7cd){if(!_0x38a7cd[_0xd187('0x64')]){_0x5b7870=0x0;}else{_0x5b7870=_0x38a7cd[0x0][_0xd187('0x20')]||0x0;}return dbH['sequelize'][_0xd187('0x35')](_0x3244dd['toString'](),{'type':dbH[_0xd187('0x81')][_0xd187('0x9b')]['SELECT']});})[_0xd187('0x26')](function(_0x254e0a){return{'rows':_0x254e0a||[],'count':_0x5b7870};});}});}exports['run']=function(_0x1776c1,_0x497a94){return runReport(_0x1776c1[_0xd187('0x4c')],_0x1776c1['query'],_0x1776c1['options'])[_0xd187('0x26')](respondWithResult(_0x497a94,null))[_0xd187('0x40')](handleError(_0x497a94,null));};exports[_0xd187('0x9c')]=runReport;exports[_0xd187('0x35')]=function(_0x568f72,_0x357526){var _0x13ee40=0xa;var _0x20c269=[_0xd187('0x83'),_0xd187('0x4e'),_0xd187('0x4f'),_0xd187('0x50')];var _0x25ff89={'SUM':_0xd187('0x51'),'COUNT':_0xd187('0x52'),'COUNT DISTINCT':'COUNT(DISTINCT\x20%s)','MAX':_0xd187('0x54'),'MIN':_0xd187('0x55'),'AVG':_0xd187('0x56'),'GROUP_CONCAT':'GROUP_CONCAT(%s)','GROUP_CONCAT ASC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT DESC':_0xd187('0x59')};var _0x28798f={'SEC_TO_TIME':_0xd187('0x5a'),'DATE':'DATE(%s)','HOUR':'HOUR(%s)','ROUND':_0xd187('0x5d'),'UNIX_TIMESTAMP':_0xd187('0x5e')};var _0x56fcde=function(_0x37b1b0){return!_[_0xd187('0x5f')]([_0xd187('0x60'),_0xd187('0x61'),'IS\x20EMPTY',_0xd187('0x62')],_0x37b1b0);};var _0x428e6c=function(_0x4524c3){if(!_0x4524c3||!_0x4524c3[_0xd187('0x63')][_0xd187('0x64')]){return'';}for(var _0x3a2937='(',_0xf03f9a=0x0;_0xf03f9a<_0x4524c3['rules'][_0xd187('0x64')];_0xf03f9a+=0x1){_0xf03f9a>0x0&&(_0x3a2937+='\x20'+_0x4524c3['operator']+'\x20');_0x3a2937+=_0x4524c3[_0xd187('0x63')][_0xf03f9a]['group']?_0x428e6c(_0x4524c3[_0xd187('0x63')][_0xf03f9a]['group']):_0x4524c3[_0xd187('0x63')][_0xf03f9a][_0xd187('0x76')]+'\x20'+_0x4524c3[_0xd187('0x63')][_0xf03f9a]['condition']+(_0x56fcde(_0x4524c3[_0xd187('0x63')][_0xf03f9a][_0xd187('0x66')])?'\x20'+_0x4524c3[_0xd187('0x63')][_0xf03f9a][_0xd187('0x67')]:'');}return _0x3a2937+')';};var _0x37405d={'where':{'id':_0x568f72[_0xd187('0x4c')]['id']}},_0xe84f78,_0x12b4a4,_0x3d09a6,_0x5acea7,_0x2a756f;_0x37405d=_[_0xd187('0x3c')]({},_0x37405d,_0x568f72['options']);return db[_0xd187('0x2d')][_0xd187('0x4b')](_0x37405d)[_0xd187('0x26')](function(_0x110af6){if(_0x110af6){_0xe84f78=_0x110af6;return _0x110af6[_0xd187('0x68')]();}return null;})[_0xd187('0x26')](function(_0x2e4db4){if(_0x2e4db4){if(!_0x2e4db4[_0xd187('0x64')]){throw new db[(_0xd187('0x69'))][(_0xd187('0x6a'))](_0xd187('0x6b'),0x193);}_0x12b4a4=_0x2e4db4;return db['AnalyticMetric'][_0xd187('0x6c')]({'raw':!![]});}return null;})[_0xd187('0x26')](function(_0x50d5b8){if(_0x50d5b8){_0x3d09a6=_[_0xd187('0x6d')](_0x50d5b8,'id');var _0x48ef98;var _0x2008e9=squel['select']();_0x2008e9[_0xd187('0x6e')](_0xe84f78[_0xd187('0x6f')]);for(var _0x9b8840=0x0;_0x9b8840<_0x12b4a4[_0xd187('0x64')];_0x9b8840+=0x1){_0x48ef98=_0x12b4a4[_0x9b8840][_0xd187('0x70')]?_0x3d09a6[_0x12b4a4[_0x9b8840]['MetricId']][_0xd187('0x71')]:_0x12b4a4[_0x9b8840][_0xd187('0x76')];_0x48ef98=_0x12b4a4[_0x9b8840][_0xd187('0x87')]?_[_0xd187('0x72')](_0x25ff89[_0x12b4a4[_0x9b8840][_0xd187('0x87')]],'%s',_0x48ef98):_0x48ef98;_0x48ef98=_0x12b4a4[_0x9b8840]['format']?_[_0xd187('0x72')](_0x28798f[_0x12b4a4[_0x9b8840][_0xd187('0x73')]],'%s',_0x48ef98):_0x48ef98;if(_0x12b4a4[_0x9b8840][_0xd187('0x74')]){_0x2008e9['group'](_0x48ef98);}_0x12b4a4[_0x9b8840]['orderBy']&&_0x2008e9[_0xd187('0x38')](_0x48ef98,_0x12b4a4[_0x9b8840][_0xd187('0x75')]===_0xd187('0x88')?![]:!![]);_0x2008e9[_0xd187('0x76')](_0x48ef98,_0x12b4a4[_0x9b8840]['alias']||_0x48ef98);}if(_0xe84f78[_0xd187('0x78')]){_0xe84f78[_0xd187('0x78')]=JSON[_0xd187('0x79')](_0xe84f78[_0xd187('0x78')]);for(var _0x4bff96=0x0;_0x4bff96<_0xe84f78[_0xd187('0x78')]['length'];_0x4bff96+=0x1){if(_0xe84f78[_0xd187('0x78')][_0x4bff96][_0xd187('0x30')]&&_[_0xd187('0x5f')](_0x20c269,_0xe84f78[_0xd187('0x78')][_0x4bff96][_0xd187('0x30')])&&_0xe84f78['joins'][_0x4bff96][_0xd187('0x7a')]&&_0xe84f78[_0xd187('0x78')][_0x4bff96][_0xd187('0x7c')]&&_0xe84f78[_0xd187('0x78')][_0x4bff96]['foreignKey']){_0x2008e9[_0xe84f78[_0xd187('0x78')][_0x4bff96][_0xd187('0x30')]](_0xe84f78[_0xd187('0x78')][_0x4bff96][_0xd187('0x7c')],null,util[_0xd187('0x73')](_0xd187('0x89'),_0xe84f78[_0xd187('0x6f')],_0xe84f78[_0xd187('0x78')][_0x4bff96][_0xd187('0x7a')],_0xe84f78[_0xd187('0x78')][_0x4bff96][_0xd187('0x7c')],_0xe84f78[_0xd187('0x78')][_0x4bff96][_0xd187('0x7b')]));}}}if(_0xe84f78['conditions']){_0xe84f78[_0xd187('0x7d')]=JSON['parse'](_0xe84f78[_0xd187('0x7d')]);_0x2008e9['where'](_0x428e6c(_0xe84f78[_0xd187('0x7d')][_0xd187('0x65')]));}_0x2a756f=_0x2008e9[_0xd187('0x7e')]();_0x2008e9[_0xd187('0x1e')](_0x13ee40);_0x2008e9['offset'](0x0);logger['debug'](_0xd187('0x7f'),_0x2008e9[_0xd187('0x80')]());return dbH[_0xd187('0x81')][_0xd187('0x35')](_0x2008e9[_0xd187('0x80')](),{'type':dbH[_0xd187('0x81')]['QueryTypes']['SELECT']});}})[_0xd187('0x26')](function(){return{'sql':_0x2a756f[_0xd187('0x80')]()};})[_0xd187('0x26')](respondWithResult(_0x357526,null))['catch'](handleError(_0x357526,null));};
\ No newline at end of file
diff --git a/server/api/analyticDefaultReport/analyticDefaultReport.model.js b/server/api/analyticDefaultReport/analyticDefaultReport.model.js
index f5a6b78..ecc39b3 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 _0x0c78=['AnalyticDefaultReport','analytics_default_reports','lodash','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./analyticDefaultReport.attributes','define'];(function(_0x481773,_0x1bf206){var _0x3920d5=function(_0x1071d2){while(--_0x1071d2){_0x481773['push'](_0x481773['shift']());}};_0x3920d5(++_0x1bf206);}(_0x0c78,0x176));var _0x80c7=function(_0x34bf97,_0xc60f9d){_0x34bf97=_0x34bf97-0x0;var _0x292719=_0x0c78[_0x34bf97];return _0x292719;};'use strict';var _=require(_0x80c7('0x0'));var util=require('util');var logger=require('../../config/logger')(_0x80c7('0x1'));var moment=require(_0x80c7('0x2'));var BPromise=require(_0x80c7('0x3'));var rp=require(_0x80c7('0x4'));var fs=require('fs');var path=require(_0x80c7('0x5'));var rimraf=require(_0x80c7('0x6'));var config=require(_0x80c7('0x7'));var attributes=require(_0x80c7('0x8'));module['exports']=function(_0x16e593,_0x595e39){return _0x16e593[_0x80c7('0x9')](_0x80c7('0xa'),attributes,{'tableName':_0x80c7('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x5caf=['AnalyticDefaultReport','analytics_default_reports','util','../../config/logger','api','moment','request-promise','path','./analyticDefaultReport.attributes'];(function(_0xd41f77,_0x177789){var _0x546ef7=function(_0x162835){while(--_0x162835){_0xd41f77['push'](_0xd41f77['shift']());}};_0x546ef7(++_0x177789);}(_0x5caf,0xec));var _0xf5ca=function(_0x544b37,_0x48dc8e){_0x544b37=_0x544b37-0x0;var _0x4d58ea=_0x5caf[_0x544b37];return _0x4d58ea;};'use strict';var _=require('lodash');var util=require(_0xf5ca('0x0'));var logger=require(_0xf5ca('0x1'))(_0xf5ca('0x2'));var moment=require(_0xf5ca('0x3'));var BPromise=require('bluebird');var rp=require(_0xf5ca('0x4'));var fs=require('fs');var path=require(_0xf5ca('0x5'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0xf5ca('0x6'));module['exports']=function(_0x19d05f,_0x5b93ef){return _0x19d05f['define'](_0xf5ca('0x7'),attributes,{'tableName':_0xf5ca('0x8'),'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 2d00f7a..77cc565 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 _0xc10e=['debug','AnalyticDefaultReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','catch','lodash','util','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','request','then','AnalyticDefaultReport,\x20%s,\x20%s','request\x20sent'];(function(_0x26ccd0,_0x433234){var _0x115921=function(_0x19183e){while(--_0x19183e){_0x26ccd0['push'](_0x26ccd0['shift']());}};_0x115921(++_0x433234);}(_0xc10e,0xe5));var _0xec10=function(_0x262ff6,_0x158799){_0x262ff6=_0x262ff6-0x0;var _0x4c9b82=_0xc10e[_0x262ff6];return _0x4c9b82;};'use strict';var _=require(_0xec10('0x0'));var util=require(_0xec10('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0xec10('0x2'))['db'];var utils=require(_0xec10('0x3'));var logger=require(_0xec10('0x4'))(_0xec10('0x5'));var config=require('../../config/environment');var jayson=require(_0xec10('0x6'));var client=jayson[_0xec10('0x7')][_0xec10('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x2bcf3b,_0xf33939,_0x45d102){return new BPromise(function(_0x25a2c4,_0x3f623b){return client[_0xec10('0x9')](_0x2bcf3b,_0x45d102)[_0xec10('0xa')](function(_0x1f8706){logger['info'](_0xec10('0xb'),_0xf33939,_0xec10('0xc'));logger[_0xec10('0xd')](_0xec10('0xe'),_0xf33939,_0xec10('0xc'),JSON[_0xec10('0xf')](_0x1f8706));if(_0x1f8706[_0xec10('0x10')]){if(_0x1f8706['error'][_0xec10('0x11')]===0x1f4){logger[_0xec10('0x10')](_0xec10('0xb'),_0xf33939,_0x1f8706['error'][_0xec10('0x12')]);return _0x3f623b(_0x1f8706[_0xec10('0x10')][_0xec10('0x12')]);}logger[_0xec10('0x10')](_0xec10('0xb'),_0xf33939,_0x1f8706[_0xec10('0x10')][_0xec10('0x12')]);return _0x25a2c4(_0x1f8706[_0xec10('0x10')][_0xec10('0x12')]);}else{logger[_0xec10('0x13')](_0xec10('0xb'),_0xf33939,_0xec10('0xc'));_0x25a2c4(_0x1f8706[_0xec10('0x14')][_0xec10('0x12')]);}})[_0xec10('0x15')](function(_0xe5b808){logger[_0xec10('0x10')](_0xec10('0xb'),_0xf33939,_0xe5b808);_0x3f623b(_0xe5b808);});});}
\ No newline at end of file
+var _0x0c7e=['../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','request\x20sent','debug','AnalyticDefaultReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','AnalyticDefaultReport,\x20%s,\x20%s','result','catch','lodash','util','moment','bluebird','randomstring','../../mysqldb'];(function(_0x3cb002,_0x12a83b){var _0x1c1210=function(_0x350eeb){while(--_0x350eeb){_0x3cb002['push'](_0x3cb002['shift']());}};_0x1c1210(++_0x12a83b);}(_0x0c7e,0x1ce));var _0xe0c7=function(_0x4f5d45,_0x3d5d87){_0x4f5d45=_0x4f5d45-0x0;var _0x642c3e=_0x0c7e[_0x4f5d45];return _0x642c3e;};'use strict';var _=require(_0xe0c7('0x0'));var util=require(_0xe0c7('0x1'));var moment=require(_0xe0c7('0x2'));var BPromise=require(_0xe0c7('0x3'));var rs=require(_0xe0c7('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xe0c7('0x5'))['db'];var utils=require(_0xe0c7('0x6'));var logger=require(_0xe0c7('0x7'))(_0xe0c7('0x8'));var config=require(_0xe0c7('0x9'));var jayson=require(_0xe0c7('0xa'));var client=jayson[_0xe0c7('0xb')][_0xe0c7('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x3841c6,_0x4e8db0,_0x5ee0f7){return new BPromise(function(_0x571e21,_0x45330e){return client[_0xe0c7('0xd')](_0x3841c6,_0x5ee0f7)[_0xe0c7('0xe')](function(_0x7247ec){logger[_0xe0c7('0xf')]('AnalyticDefaultReport,\x20%s,\x20%s',_0x4e8db0,_0xe0c7('0x10'));logger[_0xe0c7('0x11')](_0xe0c7('0x12'),_0x4e8db0,_0xe0c7('0x10'),JSON[_0xe0c7('0x13')](_0x7247ec));if(_0x7247ec['error']){if(_0x7247ec[_0xe0c7('0x14')][_0xe0c7('0x15')]===0x1f4){logger[_0xe0c7('0x14')]('AnalyticDefaultReport,\x20%s,\x20%s',_0x4e8db0,_0x7247ec[_0xe0c7('0x14')][_0xe0c7('0x16')]);return _0x45330e(_0x7247ec[_0xe0c7('0x14')]['message']);}logger[_0xe0c7('0x14')]('AnalyticDefaultReport,\x20%s,\x20%s',_0x4e8db0,_0x7247ec[_0xe0c7('0x14')][_0xe0c7('0x16')]);return _0x571e21(_0x7247ec[_0xe0c7('0x14')][_0xe0c7('0x16')]);}else{logger['info'](_0xe0c7('0x17'),_0x4e8db0,_0xe0c7('0x10'));_0x571e21(_0x7247ec[_0xe0c7('0x18')][_0xe0c7('0x16')]);}})[_0xe0c7('0x19')](function(_0x3159bd){logger['error'](_0xe0c7('0x17'),_0x4e8db0,_0x3159bd);_0x45330e(_0x3159bd);});});}
\ No newline at end of file
diff --git a/server/api/analyticDefaultReport/index.js b/server/api/analyticDefaultReport/index.js
index 68d79dd..48d3b6c 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 _0xab1a=['preview','/:id/run','run','query','post','create','put','update','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./analyticDefaultReport.controller','get','index','/:id','isAuthenticated','/:id/preview'];(function(_0x575247,_0x31e54c){var _0x452fcc=function(_0x42a6b7){while(--_0x42a6b7){_0x575247['push'](_0x575247['shift']());}};_0x452fcc(++_0x31e54c);}(_0xab1a,0xf4));var _0xaab1=function(_0x2053ea,_0x1ab2d4){_0x2053ea=_0x2053ea-0x0;var _0x2232c4=_0xab1a[_0x2053ea];return _0x2232c4;};'use strict';var multer=require(_0xaab1('0x0'));var util=require(_0xaab1('0x1'));var path=require(_0xaab1('0x2'));var timeout=require(_0xaab1('0x3'));var express=require(_0xaab1('0x4'));var router=express[_0xaab1('0x5')]();var fs_extra=require(_0xaab1('0x6'));var auth=require(_0xaab1('0x7'));var interaction=require(_0xaab1('0x8'));var config=require(_0xaab1('0x9'));var controller=require(_0xaab1('0xa'));router[_0xaab1('0xb')]('/',auth['isAuthenticated'](),controller[_0xaab1('0xc')]);router[_0xaab1('0xb')](_0xaab1('0xd'),auth[_0xaab1('0xe')](),controller['show']);router['get'](_0xaab1('0xf'),auth['isAuthenticated'](),controller[_0xaab1('0x10')]);router[_0xaab1('0xb')](_0xaab1('0x11'),auth[_0xaab1('0xe')](),controller[_0xaab1('0x12')]);router[_0xaab1('0xb')]('/:id/query',auth[_0xaab1('0xe')](),controller[_0xaab1('0x13')]);router[_0xaab1('0x14')]('/',auth[_0xaab1('0xe')](),controller[_0xaab1('0x15')]);router[_0xaab1('0x16')](_0xaab1('0xd'),auth[_0xaab1('0xe')](),controller[_0xaab1('0x17')]);router['delete'](_0xaab1('0xd'),auth[_0xaab1('0xe')](),controller[_0xaab1('0x18')]);module[_0xaab1('0x19')]=router;
\ No newline at end of file
+var _0xd0ce=['isAuthenticated','show','/:id/preview','preview','/:id/run','run','/:id/query','query','create','put','destroy','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./analyticDefaultReport.controller','get','index','/:id'];(function(_0xbc80f1,_0x5c674c){var _0x5465c7=function(_0x310d33){while(--_0x310d33){_0xbc80f1['push'](_0xbc80f1['shift']());}};_0x5465c7(++_0x5c674c);}(_0xd0ce,0x105));var _0xed0c=function(_0x710815,_0x520da8){_0x710815=_0x710815-0x0;var _0x5b3b89=_0xd0ce[_0x710815];return _0x5b3b89;};'use strict';var multer=require(_0xed0c('0x0'));var util=require(_0xed0c('0x1'));var path=require(_0xed0c('0x2'));var timeout=require(_0xed0c('0x3'));var express=require(_0xed0c('0x4'));var router=express[_0xed0c('0x5')]();var fs_extra=require(_0xed0c('0x6'));var auth=require(_0xed0c('0x7'));var interaction=require(_0xed0c('0x8'));var config=require(_0xed0c('0x9'));var controller=require(_0xed0c('0xa'));router[_0xed0c('0xb')]('/',auth['isAuthenticated'](),controller[_0xed0c('0xc')]);router[_0xed0c('0xb')](_0xed0c('0xd'),auth[_0xed0c('0xe')](),controller[_0xed0c('0xf')]);router[_0xed0c('0xb')](_0xed0c('0x10'),auth[_0xed0c('0xe')](),controller[_0xed0c('0x11')]);router[_0xed0c('0xb')](_0xed0c('0x12'),auth['isAuthenticated'](),controller[_0xed0c('0x13')]);router[_0xed0c('0xb')](_0xed0c('0x14'),auth[_0xed0c('0xe')](),controller[_0xed0c('0x15')]);router['post']('/',auth[_0xed0c('0xe')](),controller[_0xed0c('0x16')]);router[_0xed0c('0x17')](_0xed0c('0xd'),auth[_0xed0c('0xe')](),controller['update']);router['delete'](_0xed0c('0xd'),auth[_0xed0c('0xe')](),controller[_0xed0c('0x18')]);module['exports']=router;
\ No newline at end of file
diff --git a/server/api/analyticExtractedReport/analyticExtractedReport.attributes.js b/server/api/analyticExtractedReport/analyticExtractedReport.attributes.js
index 504b3f9..0cad278 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 _0xaf02=['DATE','Loading','scheduled','UNSIGNED','sequelize','moment','exports','STRING','ENUM','csv','pdf'];(function(_0x40ac5e,_0x2de228){var _0x2839d6=function(_0x123d47){while(--_0x123d47){_0x40ac5e['push'](_0x40ac5e['shift']());}};_0x2839d6(++_0x2de228);}(_0xaf02,0x17a));var _0x2af0=function(_0x51c426,_0x50ffe6){_0x51c426=_0x51c426-0x0;var _0x38e613=_0xaf02[_0x51c426];return _0x38e613;};'use strict';var Sequelize=require(_0x2af0('0x0'));var moment=require(_0x2af0('0x1'));module[_0x2af0('0x2')]={'name':{'type':Sequelize[_0x2af0('0x3')],'allowNull':![]},'basename':{'type':Sequelize['STRING'],'allowNull':![]},'output':{'type':Sequelize[_0x2af0('0x4')](_0x2af0('0x5'),_0x2af0('0x6'),'xlsx'),'allowNull':![],'defaultValue':_0x2af0('0x5')},'savename':{'type':Sequelize[_0x2af0('0x3')],'allowNull':![]},'startDate':{'type':Sequelize['DATE']},'endDate':{'type':Sequelize[_0x2af0('0x7')]},'status':{'type':Sequelize[_0x2af0('0x3')],'defaultValue':_0x2af0('0x8')},'type':{'type':Sequelize[_0x2af0('0x4')]('manual',_0x2af0('0x9')),'allowNull':![],'defaultValue':'manual'},'reportId':{'type':Sequelize['INTEGER'](0xb)[_0x2af0('0xa')]},'reportType':{'type':Sequelize[_0x2af0('0x3')]}};
\ No newline at end of file
+var _0xd65b=['UNSIGNED','exports','STRING','pdf','xlsx','csv','DATE','Loading','manual','scheduled','INTEGER'];(function(_0x482612,_0x1d1af7){var _0x27f0be=function(_0x144949){while(--_0x144949){_0x482612['push'](_0x482612['shift']());}};_0x27f0be(++_0x1d1af7);}(_0xd65b,0xf3));var _0xbd65=function(_0x5539b7,_0x273b67){_0x5539b7=_0x5539b7-0x0;var _0x537284=_0xd65b[_0x5539b7];return _0x537284;};'use strict';var Sequelize=require('sequelize');var moment=require('moment');module[_0xbd65('0x0')]={'name':{'type':Sequelize[_0xbd65('0x1')],'allowNull':![]},'basename':{'type':Sequelize[_0xbd65('0x1')],'allowNull':![]},'output':{'type':Sequelize['ENUM']('csv',_0xbd65('0x2'),_0xbd65('0x3')),'allowNull':![],'defaultValue':_0xbd65('0x4')},'savename':{'type':Sequelize[_0xbd65('0x1')],'allowNull':![]},'startDate':{'type':Sequelize[_0xbd65('0x5')]},'endDate':{'type':Sequelize['DATE']},'status':{'type':Sequelize[_0xbd65('0x1')],'defaultValue':_0xbd65('0x6')},'type':{'type':Sequelize['ENUM'](_0xbd65('0x7'),_0xbd65('0x8')),'allowNull':![],'defaultValue':'manual'},'reportId':{'type':Sequelize[_0xbd65('0x9')](0xb)[_0xbd65('0xa')]},'reportType':{'type':Sequelize[_0xbd65('0x1')]}};
\ No newline at end of file
diff --git a/server/api/analyticExtractedReport/analyticExtractedReport.controller.js b/server/api/analyticExtractedReport/analyticExtractedReport.controller.js
index 6a526b2..0d1931b 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 _0x890e=['util','path','ejs','fs-extra','squel','crypto','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','destroy','then','get','ExtractedReports','error','stack','name','send','index','rawAttributes','type','key','model','map','query','filters','attributes','intersection','fields','nolimit','order','sort','where','pick','filter','VIRTUAL','AnalyticExtractedReport','includeAll','include','findAll','catch','params','keys','merge','options','find','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','userProfileId','autoAssociation','body','download','basename','savename','existsSync','join','root','server/files/reports','Sequelize','ValidationError','Report\x20not\x20found\x20or\x20empty','exists','format','output','toLowerCase','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache'];(function(_0x36eaaa,_0x326732){var _0x461349=function(_0x4e4180){while(--_0x4e4180){_0x36eaaa['push'](_0x36eaaa['shift']());}};_0x461349(++_0x326732);}(_0x890e,0x1e3));var _0xe890=function(_0xfaef23,_0x5c62cb){_0xfaef23=_0xfaef23-0x0;var _0x27c2ed=_0x890e[_0xfaef23];return _0x27c2ed;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xe890('0x0'));var zipdir=require(_0xe890('0x1'));var jsonpatch=require(_0xe890('0x2'));var rp=require(_0xe890('0x3'));var moment=require(_0xe890('0x4'));var BPromise=require(_0xe890('0x5'));var Mustache=require(_0xe890('0x6'));var util=require(_0xe890('0x7'));var path=require(_0xe890('0x8'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0xe890('0x9'));var fs=require('fs');var fs_extra=require(_0xe890('0xa'));var _=require('lodash');var squel=require(_0xe890('0xb'));var crypto=require(_0xe890('0xc'));var jsforce=require(_0xe890('0xd'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0xe890('0xe'));var Papa=require(_0xe890('0xf'));var Redis=require(_0xe890('0x10'));var authService=require(_0xe890('0x11'));var qs=require(_0xe890('0x12'));var as=require(_0xe890('0x13'));var hardwareService=require(_0xe890('0x14'));var logger=require(_0xe890('0x15'))(_0xe890('0x16'));var utils=require(_0xe890('0x17'));var config=require(_0xe890('0x18'));var licenseUtil=require(_0xe890('0x19'));var db=require(_0xe890('0x1a'))['db'];function respondWithStatusCode(_0x16df94,_0x18eccb){_0x18eccb=_0x18eccb||0xcc;return function(_0x4a7249){if(_0x4a7249){return _0x16df94[_0xe890('0x1b')](_0x18eccb);}return _0x16df94[_0xe890('0x1c')](_0x18eccb)[_0xe890('0x1d')]();};}function respondWithResult(_0x4dcdeb,_0xe8572b){_0xe8572b=_0xe8572b||0xc8;return function(_0x2c5ea8){if(_0x2c5ea8){return _0x4dcdeb[_0xe890('0x1c')](_0xe8572b)[_0xe890('0x1e')](_0x2c5ea8);}};}function respondWithFilteredResult(_0x2f01f0,_0x1d7e9d){return function(_0x1998e6){if(_0x1998e6){var _0x1c6563=typeof _0x1d7e9d[_0xe890('0x1f')]===_0xe890('0x20')&&typeof _0x1d7e9d[_0xe890('0x21')]==='undefined';var _0x17633d=_0x1998e6[_0xe890('0x22')];var _0x542470=_0x1c6563?0x0:_0x1d7e9d['offset'];var _0xf9f335=_0x1c6563?_0x1998e6[_0xe890('0x22')]:_0x1d7e9d[_0xe890('0x1f')]+_0x1d7e9d[_0xe890('0x21')];var _0x5cb490;if(_0xf9f335>=_0x17633d){_0xf9f335=_0x17633d;_0x5cb490=0xc8;}else{_0x5cb490=0xce;}_0x2f01f0[_0xe890('0x1c')](_0x5cb490);return _0x2f01f0[_0xe890('0x23')](_0xe890('0x24'),_0x542470+'-'+_0xf9f335+'/'+_0x17633d)[_0xe890('0x1e')](_0x1998e6);}return null;};}function patchUpdates(_0x188f29){return function(_0x94ac31){try{jsonpatch[_0xe890('0x25')](_0x94ac31,_0x188f29,!![]);}catch(_0x3e934c){return BPromise[_0xe890('0x26')](_0x3e934c);}return _0x94ac31[_0xe890('0x27')]();};}function saveUpdates(_0xcc8933,_0x47f108){return function(_0x321968){if(_0x321968){return _0x321968[_0xe890('0x28')](_0xcc8933)['then'](function(_0x2af7c0){return _0x2af7c0;});}return null;};}function removeEntity(_0x18f7c0,_0x2c0818){return function(_0x2fb825){if(_0x2fb825){return _0x2fb825[_0xe890('0x29')]()[_0xe890('0x2a')](function(){var _0x40af43=_0x2fb825[_0xe890('0x2b')]({'plain':!![]});var _0x16a093=_0xe890('0x2c');return db['UserProfileResource'][_0xe890('0x29')]({'where':{'type':_0x16a093,'resourceId':_0x40af43['id']}})[_0xe890('0x2a')](function(){return _0x2fb825;});})['then'](function(){_0x18f7c0[_0xe890('0x1c')](0xcc)[_0xe890('0x1d')]();});}};}function handleEntityNotFound(_0x44541b,_0x402396){return function(_0x593121){if(!_0x593121){_0x44541b[_0xe890('0x1b')](0x194);}return _0x593121;};}function handleError(_0x2c0b6f,_0x2277b8){_0x2277b8=_0x2277b8||0x1f4;return function(_0x1dcfd3){logger[_0xe890('0x2d')](_0x1dcfd3[_0xe890('0x2e')]);if(_0x1dcfd3[_0xe890('0x2f')]){delete _0x1dcfd3[_0xe890('0x2f')];}_0x2c0b6f[_0xe890('0x1c')](_0x2277b8)[_0xe890('0x30')](_0x1dcfd3);};}exports[_0xe890('0x31')]=function(_0x1a3400,_0x279dbf){var _0x540512={},_0x315994={},_0x1afe58={'count':0x0,'rows':[]};var _0x37c660=_['map'](db['AnalyticExtractedReport'][_0xe890('0x32')],function(_0x32369f){return{'name':_0x32369f['fieldName'],'type':_0x32369f[_0xe890('0x33')][_0xe890('0x34')]};});_0x315994[_0xe890('0x35')]=_[_0xe890('0x36')](_0x37c660,_0xe890('0x2f'));_0x315994[_0xe890('0x37')]=_['keys'](_0x1a3400['query']);_0x315994[_0xe890('0x38')]=_['intersection'](_0x315994['model'],_0x315994[_0xe890('0x37')]);_0x540512[_0xe890('0x39')]=_[_0xe890('0x3a')](_0x315994[_0xe890('0x35')],qs[_0xe890('0x3b')](_0x1a3400['query']['fields']));_0x540512[_0xe890('0x39')]=_0x540512['attributes']['length']?_0x540512[_0xe890('0x39')]:_0x315994[_0xe890('0x35')];if(!_0x1a3400[_0xe890('0x37')]['hasOwnProperty'](_0xe890('0x3c'))){_0x540512[_0xe890('0x21')]=qs[_0xe890('0x21')](_0x1a3400[_0xe890('0x37')][_0xe890('0x21')]);_0x540512[_0xe890('0x1f')]=qs[_0xe890('0x1f')](_0x1a3400[_0xe890('0x37')][_0xe890('0x1f')]);}_0x540512[_0xe890('0x3d')]=qs[_0xe890('0x3e')](_0x1a3400['query'][_0xe890('0x3e')]);_0x540512[_0xe890('0x3f')]=qs['filters'](_[_0xe890('0x40')](_0x1a3400[_0xe890('0x37')],_0x315994['filters']),_0x37c660);if(_0x1a3400[_0xe890('0x37')][_0xe890('0x41')]){_0x540512[_0xe890('0x3f')]=_['merge'](_0x540512['where'],{'$or':_[_0xe890('0x36')](_0x37c660,function(_0x435dd3){if(_0x435dd3['type']!==_0xe890('0x42')){var _0x487010={};_0x487010[_0x435dd3[_0xe890('0x2f')]]={'$like':'%'+_0x1a3400[_0xe890('0x37')][_0xe890('0x41')]+'%'};return _0x487010;}})});}_0x540512=_['merge']({},_0x540512,_0x1a3400['options']);var _0x2acbc2={'where':_0x540512[_0xe890('0x3f')]};return db[_0xe890('0x43')]['count'](_0x2acbc2)[_0xe890('0x2a')](function(_0x12a2f1){_0x1afe58[_0xe890('0x22')]=_0x12a2f1;if(_0x1a3400[_0xe890('0x37')][_0xe890('0x44')]){_0x540512[_0xe890('0x45')]=[{'all':!![]}];}return db[_0xe890('0x43')][_0xe890('0x46')](_0x540512);})['then'](function(_0x3e33ae){_0x1afe58['rows']=_0x3e33ae;return _0x1afe58;})[_0xe890('0x2a')](respondWithFilteredResult(_0x279dbf,_0x540512))[_0xe890('0x47')](handleError(_0x279dbf,null));};exports['show']=function(_0x3939ff,_0x472e78){var _0x4743fb={'raw':!![],'where':{'id':_0x3939ff[_0xe890('0x48')]['id']}},_0x3e04c9={};_0x3e04c9[_0xe890('0x35')]=_[_0xe890('0x49')](db[_0xe890('0x43')]['rawAttributes']);_0x3e04c9[_0xe890('0x37')]=_[_0xe890('0x49')](_0x3939ff['query']);_0x3e04c9[_0xe890('0x38')]=_[_0xe890('0x3a')](_0x3e04c9[_0xe890('0x35')],_0x3e04c9[_0xe890('0x37')]);_0x4743fb[_0xe890('0x39')]=_[_0xe890('0x3a')](_0x3e04c9[_0xe890('0x35')],qs[_0xe890('0x3b')](_0x3939ff[_0xe890('0x37')][_0xe890('0x3b')]));_0x4743fb[_0xe890('0x39')]=_0x4743fb[_0xe890('0x39')]['length']?_0x4743fb['attributes']:_0x3e04c9[_0xe890('0x35')];if(_0x3939ff['query'][_0xe890('0x44')]){_0x4743fb['include']=[{'all':!![]}];}_0x4743fb=_[_0xe890('0x4a')]({},_0x4743fb,_0x3939ff[_0xe890('0x4b')]);return db[_0xe890('0x43')][_0xe890('0x4c')](_0x4743fb)[_0xe890('0x2a')](handleEntityNotFound(_0x472e78,null))['then'](respondWithResult(_0x472e78,null))['catch'](handleError(_0x472e78,null));};exports[_0xe890('0x4d')]=function(_0x4ac1c4,_0x179df4){return db['AnalyticExtractedReport'][_0xe890('0x4d')](_0x4ac1c4['body'],{})['then'](function(_0x58a7be){var _0x2d9b79=_0x4ac1c4[_0xe890('0x4e')][_0xe890('0x2b')]({'plain':!![]});if(!_0x2d9b79)throw new Error(_0xe890('0x4f'));if(_0x2d9b79['role']===_0xe890('0x4e')){var _0x5f1a4f=_0x58a7be[_0xe890('0x2b')]({'plain':!![]});var _0x2bd4d3=_0xe890('0x2c');return db[_0xe890('0x50')][_0xe890('0x4c')]({'where':{'name':_0x2bd4d3,'userProfileId':_0x2d9b79[_0xe890('0x51')]},'raw':!![]})[_0xe890('0x2a')](function(_0x485fd0){if(_0x485fd0&&_0x485fd0[_0xe890('0x52')]===0x0){return db['UserProfileResource'][_0xe890('0x4d')]({'name':_0x5f1a4f[_0xe890('0x2f')],'resourceId':_0x5f1a4f['id'],'type':_0x485fd0[_0xe890('0x2f')],'sectionId':_0x485fd0['id']},{})[_0xe890('0x2a')](function(){return _0x58a7be;});}else{return _0x58a7be;}})[_0xe890('0x47')](function(_0x14cac9){logger[_0xe890('0x2d')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x14cac9);throw _0x14cac9;});}return _0x58a7be;})['then'](respondWithResult(_0x179df4,0xc9))['catch'](handleError(_0x179df4,null));};exports[_0xe890('0x28')]=function(_0x2bda1f,_0xea61cd){if(_0x2bda1f[_0xe890('0x53')]['id']){delete _0x2bda1f[_0xe890('0x53')]['id'];}return db['AnalyticExtractedReport'][_0xe890('0x4c')]({'where':{'id':_0x2bda1f[_0xe890('0x48')]['id']}})[_0xe890('0x2a')](handleEntityNotFound(_0xea61cd,null))[_0xe890('0x2a')](saveUpdates(_0x2bda1f['body'],null))[_0xe890('0x2a')](respondWithResult(_0xea61cd,null))[_0xe890('0x47')](handleError(_0xea61cd,null));};exports[_0xe890('0x29')]=function(_0x2c5aad,_0x1d53d6){return db[_0xe890('0x43')]['find']({'where':{'id':_0x2c5aad[_0xe890('0x48')]['id']}})[_0xe890('0x2a')](handleEntityNotFound(_0x1d53d6,null))['then'](removeEntity(_0x1d53d6,null))[_0xe890('0x47')](handleError(_0x1d53d6,null));};exports[_0xe890('0x54')]=function(_0x4bdeef,_0x1fa98c,_0x29ac62){return db[_0xe890('0x43')][_0xe890('0x4c')]({'where':{'id':_0x4bdeef[_0xe890('0x48')]['id']},'attributes':[_0xe890('0x2f'),_0xe890('0x55'),_0xe890('0x56'),'output'],'raw':!![]})['then'](handleEntityNotFound(_0x1fa98c,null))[_0xe890('0x2a')](function(_0x3be125){if(_0x3be125){if(!fs[_0xe890('0x57')](path[_0xe890('0x58')](config[_0xe890('0x59')],_0xe890('0x5a'),_0x3be125[_0xe890('0x56')]))){throw new db[(_0xe890('0x5b'))][(_0xe890('0x5c'))](_0xe890('0x5d'));}if(_0x4bdeef[_0xe890('0x37')][_0xe890('0x5e')]){return _0x1fa98c[_0xe890('0x1b')](0xc8);}return _0x1fa98c[_0xe890('0x54')](path['join'](config['root'],_0xe890('0x5a'),_0x3be125[_0xe890('0x56')]),util[_0xe890('0x5f')]('%s.%s',_0x3be125[_0xe890('0x55')]||_0x3be125[_0xe890('0x2f')],_0x3be125[_0xe890('0x60')][_0xe890('0x61')]()));}})['catch'](handleError(_0x1fa98c,null));};
\ No newline at end of file
+var _0xc1bf=['update','then','destroy','get','ExtractedReports','UserProfileResource','sendStatus','error','stack','name','send','index','AnalyticExtractedReport','type','key','model','map','query','keys','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filters','filter','merge','VIRTUAL','includeAll','include','findAll','catch','show','params','intersection','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','find','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','existsSync','join','root','Sequelize','ValidationError','Report\x20not\x20found\x20or\x20empty','download','server/files/reports','basename','output','toLowerCase','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','ejs','lodash','squel','crypto','jsforce','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','status','end','json','offset','undefined','count','limit','set','Content-Range','apply','reject'];(function(_0x45482a,_0xb66ca0){var _0x41b80c=function(_0x50476c){while(--_0x50476c){_0x45482a['push'](_0x45482a['shift']());}};_0x41b80c(++_0xb66ca0);}(_0xc1bf,0x95));var _0xfc1b=function(_0x382e89,_0x4768c0){_0x382e89=_0x382e89-0x0;var _0x3a1318=_0xc1bf[_0x382e89];return _0x3a1318;};'use strict';var emlformat=require(_0xfc1b('0x0'));var rimraf=require(_0xfc1b('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xfc1b('0x2'));var rp=require(_0xfc1b('0x3'));var moment=require(_0xfc1b('0x4'));var BPromise=require(_0xfc1b('0x5'));var Mustache=require(_0xfc1b('0x6'));var util=require(_0xfc1b('0x7'));var path=require('path');var sox=require(_0xfc1b('0x8'));var csv=require('to-csv');var ejs=require(_0xfc1b('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xfc1b('0xa'));var squel=require(_0xfc1b('0xb'));var crypto=require(_0xfc1b('0xc'));var jsforce=require(_0xfc1b('0xd'));var deskjs=require('desk.js');var toCsv=require(_0xfc1b('0xe'));var querystring=require(_0xfc1b('0xf'));var Papa=require(_0xfc1b('0x10'));var Redis=require(_0xfc1b('0x11'));var authService=require(_0xfc1b('0x12'));var qs=require(_0xfc1b('0x13'));var as=require(_0xfc1b('0x14'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xfc1b('0x15'))(_0xfc1b('0x16'));var utils=require(_0xfc1b('0x17'));var config=require(_0xfc1b('0x18'));var licenseUtil=require(_0xfc1b('0x19'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0xc6661e,_0x33eea6){_0x33eea6=_0x33eea6||0xcc;return function(_0xb7eed0){if(_0xb7eed0){return _0xc6661e['sendStatus'](_0x33eea6);}return _0xc6661e[_0xfc1b('0x1a')](_0x33eea6)[_0xfc1b('0x1b')]();};}function respondWithResult(_0x34fe84,_0x419157){_0x419157=_0x419157||0xc8;return function(_0x4a0548){if(_0x4a0548){return _0x34fe84[_0xfc1b('0x1a')](_0x419157)[_0xfc1b('0x1c')](_0x4a0548);}};}function respondWithFilteredResult(_0x4da9f5,_0x2d3079){return function(_0x188b35){if(_0x188b35){var _0x239d05=typeof _0x2d3079[_0xfc1b('0x1d')]==='undefined'&&typeof _0x2d3079['limit']===_0xfc1b('0x1e');var _0x2ec43a=_0x188b35[_0xfc1b('0x1f')];var _0x20ca52=_0x239d05?0x0:_0x2d3079[_0xfc1b('0x1d')];var _0x2de7e9=_0x239d05?_0x188b35[_0xfc1b('0x1f')]:_0x2d3079['offset']+_0x2d3079[_0xfc1b('0x20')];var _0x4d16fe;if(_0x2de7e9>=_0x2ec43a){_0x2de7e9=_0x2ec43a;_0x4d16fe=0xc8;}else{_0x4d16fe=0xce;}_0x4da9f5[_0xfc1b('0x1a')](_0x4d16fe);return _0x4da9f5[_0xfc1b('0x21')](_0xfc1b('0x22'),_0x20ca52+'-'+_0x2de7e9+'/'+_0x2ec43a)[_0xfc1b('0x1c')](_0x188b35);}return null;};}function patchUpdates(_0xaa2ea1){return function(_0x44ace8){try{jsonpatch[_0xfc1b('0x23')](_0x44ace8,_0xaa2ea1,!![]);}catch(_0x40ec94){return BPromise[_0xfc1b('0x24')](_0x40ec94);}return _0x44ace8['save']();};}function saveUpdates(_0x2efc49,_0x16ae69){return function(_0x573642){if(_0x573642){return _0x573642[_0xfc1b('0x25')](_0x2efc49)[_0xfc1b('0x26')](function(_0x1fbf49){return _0x1fbf49;});}return null;};}function removeEntity(_0x45814a,_0x353245){return function(_0xe0e64c){if(_0xe0e64c){return _0xe0e64c[_0xfc1b('0x27')]()[_0xfc1b('0x26')](function(){var _0x36921a=_0xe0e64c[_0xfc1b('0x28')]({'plain':!![]});var _0x19eedf=_0xfc1b('0x29');return db[_0xfc1b('0x2a')]['destroy']({'where':{'type':_0x19eedf,'resourceId':_0x36921a['id']}})[_0xfc1b('0x26')](function(){return _0xe0e64c;});})[_0xfc1b('0x26')](function(){_0x45814a[_0xfc1b('0x1a')](0xcc)[_0xfc1b('0x1b')]();});}};}function handleEntityNotFound(_0x2bc683,_0x127c61){return function(_0x28b043){if(!_0x28b043){_0x2bc683[_0xfc1b('0x2b')](0x194);}return _0x28b043;};}function handleError(_0x55a8ea,_0x3cc4c1){_0x3cc4c1=_0x3cc4c1||0x1f4;return function(_0x59b8eb){logger[_0xfc1b('0x2c')](_0x59b8eb[_0xfc1b('0x2d')]);if(_0x59b8eb[_0xfc1b('0x2e')]){delete _0x59b8eb[_0xfc1b('0x2e')];}_0x55a8ea['status'](_0x3cc4c1)[_0xfc1b('0x2f')](_0x59b8eb);};}exports[_0xfc1b('0x30')]=function(_0x1c45c4,_0x4beaea){var _0x25b9a0={},_0x22cb3e={},_0x3231af={'count':0x0,'rows':[]};var _0x31a1c7=_['map'](db[_0xfc1b('0x31')]['rawAttributes'],function(_0x434380){return{'name':_0x434380['fieldName'],'type':_0x434380[_0xfc1b('0x32')][_0xfc1b('0x33')]};});_0x22cb3e[_0xfc1b('0x34')]=_[_0xfc1b('0x35')](_0x31a1c7,_0xfc1b('0x2e'));_0x22cb3e[_0xfc1b('0x36')]=_[_0xfc1b('0x37')](_0x1c45c4[_0xfc1b('0x36')]);_0x22cb3e['filters']=_['intersection'](_0x22cb3e[_0xfc1b('0x34')],_0x22cb3e[_0xfc1b('0x36')]);_0x25b9a0[_0xfc1b('0x38')]=_['intersection'](_0x22cb3e[_0xfc1b('0x34')],qs[_0xfc1b('0x39')](_0x1c45c4[_0xfc1b('0x36')]['fields']));_0x25b9a0[_0xfc1b('0x38')]=_0x25b9a0[_0xfc1b('0x38')][_0xfc1b('0x3a')]?_0x25b9a0[_0xfc1b('0x38')]:_0x22cb3e[_0xfc1b('0x34')];if(!_0x1c45c4[_0xfc1b('0x36')][_0xfc1b('0x3b')](_0xfc1b('0x3c'))){_0x25b9a0[_0xfc1b('0x20')]=qs[_0xfc1b('0x20')](_0x1c45c4[_0xfc1b('0x36')]['limit']);_0x25b9a0[_0xfc1b('0x1d')]=qs[_0xfc1b('0x1d')](_0x1c45c4[_0xfc1b('0x36')]['offset']);}_0x25b9a0[_0xfc1b('0x3d')]=qs[_0xfc1b('0x3e')](_0x1c45c4[_0xfc1b('0x36')]['sort']);_0x25b9a0[_0xfc1b('0x3f')]=qs[_0xfc1b('0x40')](_['pick'](_0x1c45c4[_0xfc1b('0x36')],_0x22cb3e[_0xfc1b('0x40')]),_0x31a1c7);if(_0x1c45c4[_0xfc1b('0x36')][_0xfc1b('0x41')]){_0x25b9a0['where']=_[_0xfc1b('0x42')](_0x25b9a0[_0xfc1b('0x3f')],{'$or':_[_0xfc1b('0x35')](_0x31a1c7,function(_0xf26dbb){if(_0xf26dbb[_0xfc1b('0x32')]!==_0xfc1b('0x43')){var _0x483b58={};_0x483b58[_0xf26dbb[_0xfc1b('0x2e')]]={'$like':'%'+_0x1c45c4[_0xfc1b('0x36')][_0xfc1b('0x41')]+'%'};return _0x483b58;}})});}_0x25b9a0=_[_0xfc1b('0x42')]({},_0x25b9a0,_0x1c45c4['options']);var _0x437f4f={'where':_0x25b9a0[_0xfc1b('0x3f')]};return db[_0xfc1b('0x31')]['count'](_0x437f4f)[_0xfc1b('0x26')](function(_0x486fa7){_0x3231af['count']=_0x486fa7;if(_0x1c45c4[_0xfc1b('0x36')][_0xfc1b('0x44')]){_0x25b9a0[_0xfc1b('0x45')]=[{'all':!![]}];}return db['AnalyticExtractedReport'][_0xfc1b('0x46')](_0x25b9a0);})[_0xfc1b('0x26')](function(_0x1ec78a){_0x3231af['rows']=_0x1ec78a;return _0x3231af;})['then'](respondWithFilteredResult(_0x4beaea,_0x25b9a0))[_0xfc1b('0x47')](handleError(_0x4beaea,null));};exports[_0xfc1b('0x48')]=function(_0xbf2464,_0xa848ac){var _0x81b8c0={'raw':!![],'where':{'id':_0xbf2464[_0xfc1b('0x49')]['id']}},_0xf4fb23={};_0xf4fb23[_0xfc1b('0x34')]=_['keys'](db[_0xfc1b('0x31')]['rawAttributes']);_0xf4fb23[_0xfc1b('0x36')]=_['keys'](_0xbf2464['query']);_0xf4fb23[_0xfc1b('0x40')]=_[_0xfc1b('0x4a')](_0xf4fb23[_0xfc1b('0x34')],_0xf4fb23[_0xfc1b('0x36')]);_0x81b8c0[_0xfc1b('0x38')]=_['intersection'](_0xf4fb23[_0xfc1b('0x34')],qs['fields'](_0xbf2464['query'][_0xfc1b('0x39')]));_0x81b8c0[_0xfc1b('0x38')]=_0x81b8c0[_0xfc1b('0x38')][_0xfc1b('0x3a')]?_0x81b8c0[_0xfc1b('0x38')]:_0xf4fb23[_0xfc1b('0x34')];if(_0xbf2464[_0xfc1b('0x36')][_0xfc1b('0x44')]){_0x81b8c0['include']=[{'all':!![]}];}_0x81b8c0=_['merge']({},_0x81b8c0,_0xbf2464['options']);return db[_0xfc1b('0x31')]['find'](_0x81b8c0)[_0xfc1b('0x26')](handleEntityNotFound(_0xa848ac,null))[_0xfc1b('0x26')](respondWithResult(_0xa848ac,null))[_0xfc1b('0x47')](handleError(_0xa848ac,null));};exports['create']=function(_0x1d7f66,_0x5fcc00){return db[_0xfc1b('0x31')]['create'](_0x1d7f66[_0xfc1b('0x4b')],{})['then'](function(_0x507267){var _0x352c55=_0x1d7f66[_0xfc1b('0x4c')]['get']({'plain':!![]});if(!_0x352c55)throw new Error(_0xfc1b('0x4d'));if(_0x352c55['role']===_0xfc1b('0x4c')){var _0xc232ab=_0x507267[_0xfc1b('0x28')]({'plain':!![]});var _0x8e51cb=_0xfc1b('0x29');return db[_0xfc1b('0x4e')][_0xfc1b('0x4f')]({'where':{'name':_0x8e51cb,'userProfileId':_0x352c55['userProfileId']},'raw':!![]})[_0xfc1b('0x26')](function(_0x49272c){if(_0x49272c&&_0x49272c[_0xfc1b('0x50')]===0x0){return db[_0xfc1b('0x2a')]['create']({'name':_0xc232ab[_0xfc1b('0x2e')],'resourceId':_0xc232ab['id'],'type':_0x49272c[_0xfc1b('0x2e')],'sectionId':_0x49272c['id']},{})[_0xfc1b('0x26')](function(){return _0x507267;});}else{return _0x507267;}})[_0xfc1b('0x47')](function(_0x124acd){logger[_0xfc1b('0x2c')](_0xfc1b('0x51'),_0x124acd);throw _0x124acd;});}return _0x507267;})[_0xfc1b('0x26')](respondWithResult(_0x5fcc00,0xc9))[_0xfc1b('0x47')](handleError(_0x5fcc00,null));};exports[_0xfc1b('0x25')]=function(_0x534c0b,_0x145b2a){if(_0x534c0b[_0xfc1b('0x4b')]['id']){delete _0x534c0b['body']['id'];}return db[_0xfc1b('0x31')][_0xfc1b('0x4f')]({'where':{'id':_0x534c0b['params']['id']}})[_0xfc1b('0x26')](handleEntityNotFound(_0x145b2a,null))[_0xfc1b('0x26')](saveUpdates(_0x534c0b['body'],null))[_0xfc1b('0x26')](respondWithResult(_0x145b2a,null))[_0xfc1b('0x47')](handleError(_0x145b2a,null));};exports['destroy']=function(_0x530eb0,_0x142ac4){return db[_0xfc1b('0x31')][_0xfc1b('0x4f')]({'where':{'id':_0x530eb0[_0xfc1b('0x49')]['id']}})[_0xfc1b('0x26')](handleEntityNotFound(_0x142ac4,null))['then'](removeEntity(_0x142ac4,null))[_0xfc1b('0x47')](handleError(_0x142ac4,null));};exports['download']=function(_0x588390,_0x342e80,_0x23eb5a){return db['AnalyticExtractedReport'][_0xfc1b('0x4f')]({'where':{'id':_0x588390['params']['id']},'attributes':[_0xfc1b('0x2e'),'basename','savename','output'],'raw':!![]})[_0xfc1b('0x26')](handleEntityNotFound(_0x342e80,null))[_0xfc1b('0x26')](function(_0x668e06){if(_0x668e06){if(!fs[_0xfc1b('0x52')](path[_0xfc1b('0x53')](config[_0xfc1b('0x54')],'server/files/reports',_0x668e06['savename']))){throw new db[(_0xfc1b('0x55'))][(_0xfc1b('0x56'))](_0xfc1b('0x57'));}if(_0x588390[_0xfc1b('0x36')]['exists']){return _0x342e80[_0xfc1b('0x2b')](0xc8);}return _0x342e80[_0xfc1b('0x58')](path['join'](config[_0xfc1b('0x54')],_0xfc1b('0x59'),_0x668e06['savename']),util['format']('%s.%s',_0x668e06[_0xfc1b('0x5a')]||_0x668e06['name'],_0x668e06[_0xfc1b('0x5b')][_0xfc1b('0x5c')]()));}})[_0xfc1b('0x47')](handleError(_0x342e80,null));};
\ No newline at end of file
diff --git a/server/api/analyticExtractedReport/analyticExtractedReport.model.js b/server/api/analyticExtractedReport/analyticExtractedReport.model.js
index 6a665a3..54a5f64 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 _0x65dc=['lodash','util','api','moment','path','rimraf','exports','define','AnalyticExtractedReport','analytics_extracted_reports'];(function(_0x277721,_0x46971e){var _0x286051=function(_0x130c98){while(--_0x130c98){_0x277721['push'](_0x277721['shift']());}};_0x286051(++_0x46971e);}(_0x65dc,0xfa));var _0xc65d=function(_0x4f57e4,_0x18914d){_0x4f57e4=_0x4f57e4-0x0;var _0x4a584c=_0x65dc[_0x4f57e4];return _0x4a584c;};'use strict';var _=require(_0xc65d('0x0'));var util=require(_0xc65d('0x1'));var logger=require('../../config/logger')(_0xc65d('0x2'));var moment=require(_0xc65d('0x3'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0xc65d('0x4'));var rimraf=require(_0xc65d('0x5'));var config=require('../../config/environment');var attributes=require('./analyticExtractedReport.attributes');module[_0xc65d('0x6')]=function(_0x1beb06,_0x1c6d6b){return _0x1beb06[_0xc65d('0x7')](_0xc65d('0x8'),attributes,{'tableName':_0xc65d('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xa77a=['AnalyticExtractedReport','analytics_extracted_reports','util','../../config/logger','api','path','rimraf','./analyticExtractedReport.attributes','define'];(function(_0x259b01,_0x3e61d0){var _0x1216fb=function(_0x111049){while(--_0x111049){_0x259b01['push'](_0x259b01['shift']());}};_0x1216fb(++_0x3e61d0);}(_0xa77a,0x1bb));var _0xaa77=function(_0xffa198,_0x5a8940){_0xffa198=_0xffa198-0x0;var _0x1e4b50=_0xa77a[_0xffa198];return _0x1e4b50;};'use strict';var _=require('lodash');var util=require(_0xaa77('0x0'));var logger=require(_0xaa77('0x1'))(_0xaa77('0x2'));var moment=require('moment');var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0xaa77('0x3'));var rimraf=require(_0xaa77('0x4'));var config=require('../../config/environment');var attributes=require(_0xaa77('0x5'));module['exports']=function(_0x32f422,_0x556c47){return _0x32f422[_0xaa77('0x6')](_0xaa77('0x7'),attributes,{'tableName':_0xaa77('0x8'),'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 a3d1e26..434cd56 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 _0x8bd2=['stringify','error','message','result','catch','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then','info','AnalyticExtractedReport,\x20%s,\x20%s','request\x20sent','AnalyticExtractedReport,\x20%s,\x20%s,\x20%s'];(function(_0x26bd8e,_0x2a9fdf){var _0x3a659d=function(_0x1b82cd){while(--_0x1b82cd){_0x26bd8e['push'](_0x26bd8e['shift']());}};_0x3a659d(++_0x2a9fdf);}(_0x8bd2,0x1d3));var _0x28bd=function(_0x5fa520,_0xaf0e7d){_0x5fa520=_0x5fa520-0x0;var _0x1bf6c4=_0x8bd2[_0x5fa520];return _0x1bf6c4;};'use strict';var _=require('lodash');var util=require(_0x28bd('0x0'));var moment=require(_0x28bd('0x1'));var BPromise=require(_0x28bd('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x28bd('0x3'));var db=require(_0x28bd('0x4'))['db'];var utils=require(_0x28bd('0x5'));var logger=require(_0x28bd('0x6'))(_0x28bd('0x7'));var config=require(_0x28bd('0x8'));var jayson=require(_0x28bd('0x9'));var client=jayson['client'][_0x28bd('0xa')]({'port':0x232a});function respondWithRpcPromise(_0xeb39f1,_0x47399c,_0x4eae0f){return new BPromise(function(_0x3f244f,_0x4ebb56){return client[_0x28bd('0xb')](_0xeb39f1,_0x4eae0f)[_0x28bd('0xc')](function(_0x520b94){logger[_0x28bd('0xd')](_0x28bd('0xe'),_0x47399c,_0x28bd('0xf'));logger['debug'](_0x28bd('0x10'),_0x47399c,_0x28bd('0xf'),JSON[_0x28bd('0x11')](_0x520b94));if(_0x520b94[_0x28bd('0x12')]){if(_0x520b94['error']['code']===0x1f4){logger['error'](_0x28bd('0xe'),_0x47399c,_0x520b94[_0x28bd('0x12')][_0x28bd('0x13')]);return _0x4ebb56(_0x520b94[_0x28bd('0x12')][_0x28bd('0x13')]);}logger[_0x28bd('0x12')](_0x28bd('0xe'),_0x47399c,_0x520b94[_0x28bd('0x12')]['message']);return _0x3f244f(_0x520b94[_0x28bd('0x12')][_0x28bd('0x13')]);}else{logger[_0x28bd('0xd')]('AnalyticExtractedReport,\x20%s,\x20%s',_0x47399c,'request\x20sent');_0x3f244f(_0x520b94[_0x28bd('0x14')][_0x28bd('0x13')]);}})[_0x28bd('0x15')](function(_0xfb1d07){logger[_0x28bd('0x12')](_0x28bd('0xe'),_0x47399c,_0xfb1d07);_0x4ebb56(_0xfb1d07);});});}
\ No newline at end of file
+var _0xaf4a=['error','code','message','catch','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','then','info','AnalyticExtractedReport,\x20%s,\x20%s','request\x20sent','debug','AnalyticExtractedReport,\x20%s,\x20%s,\x20%s','stringify'];(function(_0x5f362f,_0x297579){var _0x2cf375=function(_0x1535b8){while(--_0x1535b8){_0x5f362f['push'](_0x5f362f['shift']());}};_0x2cf375(++_0x297579);}(_0xaf4a,0x101));var _0xaaf4=function(_0xe4262a,_0x3e6e2f){_0xe4262a=_0xe4262a-0x0;var _0x260173=_0xaf4a[_0xe4262a];return _0x260173;};'use strict';var _=require('lodash');var util=require(_0xaaf4('0x0'));var moment=require(_0xaaf4('0x1'));var BPromise=require(_0xaaf4('0x2'));var rs=require(_0xaaf4('0x3'));var fs=require('fs');var Redis=require(_0xaaf4('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0xaaf4('0x5'));var logger=require(_0xaaf4('0x6'))(_0xaaf4('0x7'));var config=require(_0xaaf4('0x8'));var jayson=require(_0xaaf4('0x9'));var client=jayson[_0xaaf4('0xa')][_0xaaf4('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x4df037,_0x2e0a8f,_0x4c1e05){return new BPromise(function(_0x291c21,_0x30023a){return client['request'](_0x4df037,_0x4c1e05)[_0xaaf4('0xc')](function(_0x3f08e3){logger[_0xaaf4('0xd')](_0xaaf4('0xe'),_0x2e0a8f,_0xaaf4('0xf'));logger[_0xaaf4('0x10')](_0xaaf4('0x11'),_0x2e0a8f,_0xaaf4('0xf'),JSON[_0xaaf4('0x12')](_0x3f08e3));if(_0x3f08e3[_0xaaf4('0x13')]){if(_0x3f08e3[_0xaaf4('0x13')][_0xaaf4('0x14')]===0x1f4){logger[_0xaaf4('0x13')](_0xaaf4('0xe'),_0x2e0a8f,_0x3f08e3[_0xaaf4('0x13')][_0xaaf4('0x15')]);return _0x30023a(_0x3f08e3[_0xaaf4('0x13')][_0xaaf4('0x15')]);}logger[_0xaaf4('0x13')](_0xaaf4('0xe'),_0x2e0a8f,_0x3f08e3[_0xaaf4('0x13')]['message']);return _0x291c21(_0x3f08e3[_0xaaf4('0x13')]['message']);}else{logger[_0xaaf4('0xd')](_0xaaf4('0xe'),_0x2e0a8f,_0xaaf4('0xf'));_0x291c21(_0x3f08e3['result'][_0xaaf4('0x15')]);}})[_0xaaf4('0x16')](function(_0x1021fd){logger['error'](_0xaaf4('0xe'),_0x2e0a8f,_0x1021fd);_0x30023a(_0x1021fd);});});}
\ No newline at end of file
diff --git a/server/api/analyticExtractedReport/index.js b/server/api/analyticExtractedReport/index.js
index 765fbff..85329b2 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 _0x00b2=['create','put','update','delete','exports','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./analyticExtractedReport.controller','get','isAuthenticated','/:id','/:id/download','post'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x00b2,0x64));var _0x200b=function(_0x66afb6,_0x56a8c7){_0x66afb6=_0x66afb6-0x0;var _0x122bc3=_0x00b2[_0x66afb6];return _0x122bc3;};'use strict';var multer=require('multer');var util=require(_0x200b('0x0'));var path=require(_0x200b('0x1'));var timeout=require(_0x200b('0x2'));var express=require(_0x200b('0x3'));var router=express[_0x200b('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x200b('0x5'));var interaction=require(_0x200b('0x6'));var config=require(_0x200b('0x7'));var controller=require(_0x200b('0x8'));router[_0x200b('0x9')]('/',auth[_0x200b('0xa')](),controller['index']);router['get'](_0x200b('0xb'),auth[_0x200b('0xa')](),controller['show']);router['get'](_0x200b('0xc'),auth[_0x200b('0xa')](),controller['download']);router[_0x200b('0xd')]('/',auth[_0x200b('0xa')](),controller[_0x200b('0xe')]);router[_0x200b('0xf')](_0x200b('0xb'),auth[_0x200b('0xa')](),controller[_0x200b('0x10')]);router[_0x200b('0x11')](_0x200b('0xb'),auth['isAuthenticated'](),controller['destroy']);module[_0x200b('0x12')]=router;
\ No newline at end of file
+var _0x2bb2=['isAuthenticated','show','/:id/download','download','post','create','put','destroy','exports','util','path','connect-timeout','Router','fs-extra','../../components/interaction/service','../../config/environment','get','index','/:id'];(function(_0x3bf83f,_0x181cac){var _0x22c4a9=function(_0xb3ff0d){while(--_0xb3ff0d){_0x3bf83f['push'](_0x3bf83f['shift']());}};_0x22c4a9(++_0x181cac);}(_0x2bb2,0x100));var _0x22bb=function(_0x4bf678,_0x2ad24b){_0x4bf678=_0x4bf678-0x0;var _0x2ff235=_0x2bb2[_0x4bf678];return _0x2ff235;};'use strict';var multer=require('multer');var util=require(_0x22bb('0x0'));var path=require(_0x22bb('0x1'));var timeout=require(_0x22bb('0x2'));var express=require('express');var router=express[_0x22bb('0x3')]();var fs_extra=require(_0x22bb('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0x22bb('0x5'));var config=require(_0x22bb('0x6'));var controller=require('./analyticExtractedReport.controller');router[_0x22bb('0x7')]('/',auth['isAuthenticated'](),controller[_0x22bb('0x8')]);router[_0x22bb('0x7')](_0x22bb('0x9'),auth[_0x22bb('0xa')](),controller[_0x22bb('0xb')]);router[_0x22bb('0x7')](_0x22bb('0xc'),auth['isAuthenticated'](),controller[_0x22bb('0xd')]);router[_0x22bb('0xe')]('/',auth[_0x22bb('0xa')](),controller[_0x22bb('0xf')]);router[_0x22bb('0x10')](_0x22bb('0x9'),auth[_0x22bb('0xa')](),controller['update']);router['delete'](_0x22bb('0x9'),auth[_0x22bb('0xa')](),controller[_0x22bb('0x11')]);module[_0x22bb('0x12')]=router;
\ No newline at end of file
diff --git a/server/api/analyticFieldReport/analyticFieldReport.attributes.js b/server/api/analyticFieldReport/analyticFieldReport.attributes.js
index 9be27b6..64a132c 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 _0x3c38=['STRING','BOOLEAN','sequelize','TEXT'];(function(_0x122805,_0x226082){var _0xce7e6b=function(_0x2be392){while(--_0x2be392){_0x122805['push'](_0x122805['shift']());}};_0xce7e6b(++_0x226082);}(_0x3c38,0x1ca));var _0x83c3=function(_0x4cae4a,_0x25396a){_0x4cae4a=_0x4cae4a-0x0;var _0x5c7e62=_0x3c38[_0x4cae4a];return _0x5c7e62;};'use strict';var Sequelize=require(_0x83c3('0x0'));module['exports']={'field':{'type':Sequelize[_0x83c3('0x1')]},'alias':{'type':Sequelize[_0x83c3('0x2')]},'function':{'type':Sequelize[_0x83c3('0x2')]},'format':{'type':Sequelize[_0x83c3('0x2')]},'groupBy':{'type':Sequelize[_0x83c3('0x3')],'defaultValue':![]},'orderBy':{'type':Sequelize[_0x83c3('0x2')]},'custom':{'type':Sequelize[_0x83c3('0x3')],'defaultValue':![]}};
\ No newline at end of file
+var _0x656f=['exports','TEXT','STRING','BOOLEAN'];(function(_0x3efe87,_0x35ad48){var _0x56a4cc=function(_0x47869e){while(--_0x47869e){_0x3efe87['push'](_0x3efe87['shift']());}};_0x56a4cc(++_0x35ad48);}(_0x656f,0x190));var _0xf656=function(_0x39919e,_0x5b86e3){_0x39919e=_0x39919e-0x0;var _0x51b963=_0x656f[_0x39919e];return _0x51b963;};'use strict';var Sequelize=require('sequelize');module[_0xf656('0x0')]={'field':{'type':Sequelize[_0xf656('0x1')]},'alias':{'type':Sequelize[_0xf656('0x2')]},'function':{'type':Sequelize[_0xf656('0x2')]},'format':{'type':Sequelize[_0xf656('0x2')]},'groupBy':{'type':Sequelize[_0xf656('0x3')],'defaultValue':![]},'orderBy':{'type':Sequelize[_0xf656('0x2')]},'custom':{'type':Sequelize[_0xf656('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 473038a..937e86c 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 _0x5c7c=['util','sox','to-csv','ejs','fs-extra','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','end','json','undefined','limit','count','offset','set','Content-Range','apply','reject','save','update','then','error','stack','name','index','map','AnalyticFieldReport','fieldName','type','key','model','keys','query','filters','intersection','fields','attributes','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','rows','show','params','rawAttributes','length','includeAll','include','create','body','catch','bulkCreate','find','destroy','bulkDestroy','ids','addFields','findOne','transaction','CustomReportId','findAll','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird'];(function(_0x146214,_0x13482f){var _0x2c2acb=function(_0xb0ad23){while(--_0xb0ad23){_0x146214['push'](_0x146214['shift']());}};_0x2c2acb(++_0x13482f);}(_0x5c7c,0xfe));var _0xc5c7=function(_0x22c13b,_0x26a0a0){_0x22c13b=_0x22c13b-0x0;var _0x3894c1=_0x5c7c[_0x22c13b];return _0x3894c1;};'use strict';var emlformat=require(_0xc5c7('0x0'));var rimraf=require(_0xc5c7('0x1'));var zipdir=require(_0xc5c7('0x2'));var jsonpatch=require(_0xc5c7('0x3'));var rp=require(_0xc5c7('0x4'));var moment=require(_0xc5c7('0x5'));var BPromise=require(_0xc5c7('0x6'));var Mustache=require('mustache');var util=require(_0xc5c7('0x7'));var path=require('path');var sox=require(_0xc5c7('0x8'));var csv=require(_0xc5c7('0x9'));var ejs=require(_0xc5c7('0xa'));var fs=require('fs');var fs_extra=require(_0xc5c7('0xb'));var _=require('lodash');var squel=require('squel');var crypto=require(_0xc5c7('0xc'));var jsforce=require(_0xc5c7('0xd'));var deskjs=require(_0xc5c7('0xe'));var toCsv=require('to-csv');var querystring=require(_0xc5c7('0xf'));var Papa=require('papaparse');var Redis=require(_0xc5c7('0x10'));var authService=require(_0xc5c7('0x11'));var qs=require(_0xc5c7('0x12'));var as=require(_0xc5c7('0x13'));var hardwareService=require(_0xc5c7('0x14'));var logger=require(_0xc5c7('0x15'))(_0xc5c7('0x16'));var utils=require(_0xc5c7('0x17'));var config=require('../../config/environment');var licenseUtil=require(_0xc5c7('0x18'));var db=require(_0xc5c7('0x19'))['db'];function respondWithStatusCode(_0x43ebd0,_0x3d96f2){_0x3d96f2=_0x3d96f2||0xcc;return function(_0x479bb9){if(_0x479bb9){return _0x43ebd0[_0xc5c7('0x1a')](_0x3d96f2);}return _0x43ebd0[_0xc5c7('0x1b')](_0x3d96f2)[_0xc5c7('0x1c')]();};}function respondWithResult(_0x240543,_0x50ddf1){_0x50ddf1=_0x50ddf1||0xc8;return function(_0x342e93){if(_0x342e93){return _0x240543['status'](_0x50ddf1)[_0xc5c7('0x1d')](_0x342e93);}};}function respondWithFilteredResult(_0x130c49,_0x4bbc89){return function(_0x4ae0f2){if(_0x4ae0f2){var _0x486360=typeof _0x4bbc89['offset']===_0xc5c7('0x1e')&&typeof _0x4bbc89[_0xc5c7('0x1f')]===_0xc5c7('0x1e');var _0x517870=_0x4ae0f2[_0xc5c7('0x20')];var _0x4d0053=_0x486360?0x0:_0x4bbc89[_0xc5c7('0x21')];var _0xf440f5=_0x486360?_0x4ae0f2[_0xc5c7('0x20')]:_0x4bbc89['offset']+_0x4bbc89[_0xc5c7('0x1f')];var _0x449f0e;if(_0xf440f5>=_0x517870){_0xf440f5=_0x517870;_0x449f0e=0xc8;}else{_0x449f0e=0xce;}_0x130c49[_0xc5c7('0x1b')](_0x449f0e);return _0x130c49[_0xc5c7('0x22')](_0xc5c7('0x23'),_0x4d0053+'-'+_0xf440f5+'/'+_0x517870)['json'](_0x4ae0f2);}return null;};}function patchUpdates(_0x23f128){return function(_0x5cac87){try{jsonpatch[_0xc5c7('0x24')](_0x5cac87,_0x23f128,!![]);}catch(_0x59a374){return BPromise[_0xc5c7('0x25')](_0x59a374);}return _0x5cac87[_0xc5c7('0x26')]();};}function saveUpdates(_0x1387ea,_0x4defdd){return function(_0x375504){if(_0x375504){return _0x375504[_0xc5c7('0x27')](_0x1387ea)['then'](function(_0x3d780b){return _0x3d780b;});}return null;};}function removeEntity(_0x119818,_0x17cbf3){return function(_0x26d210){if(_0x26d210){return _0x26d210['destroy']()[_0xc5c7('0x28')](function(){_0x119818['status'](0xcc)[_0xc5c7('0x1c')]();});}};}function handleEntityNotFound(_0x3eca4e,_0x402ed3){return function(_0x4f8699){if(!_0x4f8699){_0x3eca4e[_0xc5c7('0x1a')](0x194);}return _0x4f8699;};}function handleError(_0x36abda,_0x151fa2){_0x151fa2=_0x151fa2||0x1f4;return function(_0x4521cc){logger[_0xc5c7('0x29')](_0x4521cc[_0xc5c7('0x2a')]);if(_0x4521cc[_0xc5c7('0x2b')]){delete _0x4521cc['name'];}_0x36abda[_0xc5c7('0x1b')](_0x151fa2)['send'](_0x4521cc);};}exports[_0xc5c7('0x2c')]=function(_0x446bbb,_0x14ab5a){var _0x3fa6ab={},_0x3300f8={},_0x5e046a={'count':0x0,'rows':[]};var _0x233451=_[_0xc5c7('0x2d')](db[_0xc5c7('0x2e')]['rawAttributes'],function(_0x2d1c07){return{'name':_0x2d1c07[_0xc5c7('0x2f')],'type':_0x2d1c07[_0xc5c7('0x30')][_0xc5c7('0x31')]};});_0x3300f8[_0xc5c7('0x32')]=_['map'](_0x233451,_0xc5c7('0x2b'));_0x3300f8['query']=_[_0xc5c7('0x33')](_0x446bbb[_0xc5c7('0x34')]);_0x3300f8[_0xc5c7('0x35')]=_[_0xc5c7('0x36')](_0x3300f8[_0xc5c7('0x32')],_0x3300f8[_0xc5c7('0x34')]);_0x3fa6ab['attributes']=_[_0xc5c7('0x36')](_0x3300f8[_0xc5c7('0x32')],qs[_0xc5c7('0x37')](_0x446bbb[_0xc5c7('0x34')][_0xc5c7('0x37')]));_0x3fa6ab['attributes']=_0x3fa6ab['attributes']['length']?_0x3fa6ab[_0xc5c7('0x38')]:_0x3300f8[_0xc5c7('0x32')];if(!_0x446bbb[_0xc5c7('0x34')][_0xc5c7('0x39')](_0xc5c7('0x3a'))){_0x3fa6ab['limit']=qs[_0xc5c7('0x1f')](_0x446bbb[_0xc5c7('0x34')][_0xc5c7('0x1f')]);_0x3fa6ab[_0xc5c7('0x21')]=qs[_0xc5c7('0x21')](_0x446bbb[_0xc5c7('0x34')][_0xc5c7('0x21')]);}_0x3fa6ab[_0xc5c7('0x3b')]=qs['sort'](_0x446bbb[_0xc5c7('0x34')][_0xc5c7('0x3c')]);_0x3fa6ab[_0xc5c7('0x3d')]=qs[_0xc5c7('0x35')](_[_0xc5c7('0x3e')](_0x446bbb[_0xc5c7('0x34')],_0x3300f8[_0xc5c7('0x35')]),_0x233451);if(_0x446bbb[_0xc5c7('0x34')][_0xc5c7('0x3f')]){_0x3fa6ab[_0xc5c7('0x3d')]=_[_0xc5c7('0x40')](_0x3fa6ab[_0xc5c7('0x3d')],{'$or':_[_0xc5c7('0x2d')](_0x233451,function(_0x1e48da){if(_0x1e48da[_0xc5c7('0x30')]!==_0xc5c7('0x41')){var _0x4f2cc8={};_0x4f2cc8[_0x1e48da[_0xc5c7('0x2b')]]={'$like':'%'+_0x446bbb['query'][_0xc5c7('0x3f')]+'%'};return _0x4f2cc8;}})});}_0x3fa6ab=_[_0xc5c7('0x40')]({},_0x3fa6ab,_0x446bbb[_0xc5c7('0x42')]);var _0x1b7157={'where':_0x3fa6ab['where']};return db[_0xc5c7('0x2e')][_0xc5c7('0x20')](_0x1b7157)[_0xc5c7('0x28')](function(_0x2b907){_0x5e046a[_0xc5c7('0x20')]=_0x2b907;if(_0x446bbb[_0xc5c7('0x34')]['includeAll']){_0x3fa6ab['include']=[{'all':!![]}];}return db[_0xc5c7('0x2e')]['findAll'](_0x3fa6ab);})[_0xc5c7('0x28')](function(_0xe4226f){_0x5e046a[_0xc5c7('0x43')]=_0xe4226f;return _0x5e046a;})[_0xc5c7('0x28')](respondWithFilteredResult(_0x14ab5a,_0x3fa6ab))['catch'](handleError(_0x14ab5a,null));};exports[_0xc5c7('0x44')]=function(_0x2d6898,_0x198701){var _0x5a8e5c={'raw':![],'where':{'id':_0x2d6898[_0xc5c7('0x45')]['id']}},_0x3e5f64={};_0x3e5f64[_0xc5c7('0x32')]=_[_0xc5c7('0x33')](db['AnalyticFieldReport'][_0xc5c7('0x46')]);_0x3e5f64[_0xc5c7('0x34')]=_[_0xc5c7('0x33')](_0x2d6898[_0xc5c7('0x34')]);_0x3e5f64[_0xc5c7('0x35')]=_[_0xc5c7('0x36')](_0x3e5f64[_0xc5c7('0x32')],_0x3e5f64[_0xc5c7('0x34')]);_0x5a8e5c[_0xc5c7('0x38')]=_[_0xc5c7('0x36')](_0x3e5f64[_0xc5c7('0x32')],qs[_0xc5c7('0x37')](_0x2d6898['query'][_0xc5c7('0x37')]));_0x5a8e5c[_0xc5c7('0x38')]=_0x5a8e5c['attributes'][_0xc5c7('0x47')]?_0x5a8e5c['attributes']:_0x3e5f64[_0xc5c7('0x32')];if(_0x2d6898[_0xc5c7('0x34')][_0xc5c7('0x48')]){_0x5a8e5c[_0xc5c7('0x49')]=[{'all':!![]}];}_0x5a8e5c=_[_0xc5c7('0x40')]({},_0x5a8e5c,_0x2d6898[_0xc5c7('0x42')]);return db[_0xc5c7('0x2e')]['find'](_0x5a8e5c)['then'](handleEntityNotFound(_0x198701,null))[_0xc5c7('0x28')](respondWithResult(_0x198701,null))['catch'](handleError(_0x198701,null));};exports['create']=function(_0x3a1071,_0x59329f){return db[_0xc5c7('0x2e')][_0xc5c7('0x4a')](_0x3a1071[_0xc5c7('0x4b')],{})[_0xc5c7('0x28')](respondWithResult(_0x59329f,0xc9))[_0xc5c7('0x4c')](handleError(_0x59329f,null));};exports[_0xc5c7('0x4d')]=function(_0x26159a,_0x52a2a4){return db[_0xc5c7('0x2e')][_0xc5c7('0x4d')](_0x26159a[_0xc5c7('0x4b')],{'raw':![],'individualHooks':!![]})['then'](respondWithResult(_0x52a2a4,0xc9))[_0xc5c7('0x4c')](handleError(_0x52a2a4,null));};exports['update']=function(_0x567b4a,_0x5385fb){if(_0x567b4a['body']['id']){delete _0x567b4a[_0xc5c7('0x4b')]['id'];}return db['AnalyticFieldReport'][_0xc5c7('0x4e')]({'where':{'id':_0x567b4a[_0xc5c7('0x45')]['id']}})[_0xc5c7('0x28')](handleEntityNotFound(_0x5385fb,null))[_0xc5c7('0x28')](saveUpdates(_0x567b4a[_0xc5c7('0x4b')],null))[_0xc5c7('0x28')](respondWithResult(_0x5385fb,null))[_0xc5c7('0x4c')](handleError(_0x5385fb,null));};exports[_0xc5c7('0x4f')]=function(_0x3740f2,_0x31f7b3){return db[_0xc5c7('0x2e')][_0xc5c7('0x4e')]({'where':{'id':_0x3740f2[_0xc5c7('0x45')]['id']}})[_0xc5c7('0x28')](handleEntityNotFound(_0x31f7b3,null))[_0xc5c7('0x28')](removeEntity(_0x31f7b3,null))[_0xc5c7('0x4c')](handleError(_0x31f7b3,null));};exports[_0xc5c7('0x50')]=function(_0x5d3f98,_0x38cea4){return db[_0xc5c7('0x2e')]['destroy']({'where':{'id':_0x5d3f98[_0xc5c7('0x34')][_0xc5c7('0x51')]||[]},'raw':![],'individualHooks':!![]})[_0xc5c7('0x28')](respondWithResult(_0x38cea4,0xcc))[_0xc5c7('0x4c')](handleError(_0x38cea4,null));};exports[_0xc5c7('0x52')]=function(_0x4d111a,_0x2f0bea,_0x25b383){return db['AnalyticCustomReport'][_0xc5c7('0x53')]({'where':{'id':_0x4d111a[_0xc5c7('0x45')]['id']}})[_0xc5c7('0x28')](handleEntityNotFound(_0x2f0bea,null))[_0xc5c7('0x28')](function(_0x473770){if(_0x473770){return db['sequelize'][_0xc5c7('0x54')](function(_0x468501){return db['AnalyticFieldReport'][_0xc5c7('0x4f')]({'where':{'CustomReportId':_0x4d111a['params']['id']},'transaction':_0x468501})[_0xc5c7('0x28')](function(_0x454c90){var _0x1c6206=_[_0xc5c7('0x2d')](_0x4d111a['body'],function(_0x540715){delete _0x540715['id'];_0x540715[_0xc5c7('0x55')]=_0x4d111a[_0xc5c7('0x45')]['id'];return _0x540715;});return db[_0xc5c7('0x2e')][_0xc5c7('0x4d')](_0x1c6206,{'transaction':_0x468501});});})['then'](function(){return db[_0xc5c7('0x2e')][_0xc5c7('0x56')]({'where':{'CustomReportId':_0x4d111a[_0xc5c7('0x45')]['id']}});});}})[_0xc5c7('0x28')](respondWithResult(_0x2f0bea,null))['catch'](handleError(_0x2f0bea,null));};
\ No newline at end of file
+var _0x06be=['mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','undefined','limit','count','offset','set','apply','reject','update','then','destroy','error','stack','name','index','map','AnalyticFieldReport','fieldName','type','model','keys','query','filters','intersection','attributes','fields','length','nolimit','order','sort','where','filter','merge','VIRTUAL','options','includeAll','include','findAll','catch','show','find','create','body','bulkCreate','params','addFields','findOne','transaction','CustomReportId','eml-format','rimraf','zip-dir','moment'];(function(_0x17eaa5,_0x29cccb){var _0x1722f5=function(_0x21600d){while(--_0x21600d){_0x17eaa5['push'](_0x17eaa5['shift']());}};_0x1722f5(++_0x29cccb);}(_0x06be,0x96));var _0xe06b=function(_0x18f556,_0x58281a){_0x18f556=_0x18f556-0x0;var _0x41af03=_0x06be[_0x18f556];return _0x41af03;};'use strict';var emlformat=require(_0xe06b('0x0'));var rimraf=require(_0xe06b('0x1'));var zipdir=require(_0xe06b('0x2'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0xe06b('0x3'));var BPromise=require('bluebird');var Mustache=require(_0xe06b('0x4'));var util=require(_0xe06b('0x5'));var path=require(_0xe06b('0x6'));var sox=require(_0xe06b('0x7'));var csv=require(_0xe06b('0x8'));var ejs=require(_0xe06b('0x9'));var fs=require('fs');var fs_extra=require(_0xe06b('0xa'));var _=require(_0xe06b('0xb'));var squel=require(_0xe06b('0xc'));var crypto=require(_0xe06b('0xd'));var jsforce=require(_0xe06b('0xe'));var deskjs=require(_0xe06b('0xf'));var toCsv=require(_0xe06b('0x8'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0xe06b('0x10'));var authService=require(_0xe06b('0x11'));var qs=require('../../components/parsers/qs');var as=require(_0xe06b('0x12'));var hardwareService=require(_0xe06b('0x13'));var logger=require(_0xe06b('0x14'))(_0xe06b('0x15'));var utils=require('../../config/utils');var config=require(_0xe06b('0x16'));var licenseUtil=require(_0xe06b('0x17'));var db=require(_0xe06b('0x18'))['db'];function respondWithStatusCode(_0x57a751,_0x2c3f10){_0x2c3f10=_0x2c3f10||0xcc;return function(_0x1bb678){if(_0x1bb678){return _0x57a751[_0xe06b('0x19')](_0x2c3f10);}return _0x57a751[_0xe06b('0x1a')](_0x2c3f10)[_0xe06b('0x1b')]();};}function respondWithResult(_0x344403,_0x2d76a4){_0x2d76a4=_0x2d76a4||0xc8;return function(_0x3814ef){if(_0x3814ef){return _0x344403[_0xe06b('0x1a')](_0x2d76a4)[_0xe06b('0x1c')](_0x3814ef);}};}function respondWithFilteredResult(_0x45d80d,_0x250a5e){return function(_0x4fdd2c){if(_0x4fdd2c){var _0x1304af=typeof _0x250a5e['offset']===_0xe06b('0x1d')&&typeof _0x250a5e[_0xe06b('0x1e')]===_0xe06b('0x1d');var _0x107672=_0x4fdd2c[_0xe06b('0x1f')];var _0x20e4f6=_0x1304af?0x0:_0x250a5e['offset'];var _0x3b9f13=_0x1304af?_0x4fdd2c['count']:_0x250a5e[_0xe06b('0x20')]+_0x250a5e[_0xe06b('0x1e')];var _0x288014;if(_0x3b9f13>=_0x107672){_0x3b9f13=_0x107672;_0x288014=0xc8;}else{_0x288014=0xce;}_0x45d80d['status'](_0x288014);return _0x45d80d[_0xe06b('0x21')]('Content-Range',_0x20e4f6+'-'+_0x3b9f13+'/'+_0x107672)[_0xe06b('0x1c')](_0x4fdd2c);}return null;};}function patchUpdates(_0x471996){return function(_0x25500c){try{jsonpatch[_0xe06b('0x22')](_0x25500c,_0x471996,!![]);}catch(_0x4b0994){return BPromise[_0xe06b('0x23')](_0x4b0994);}return _0x25500c['save']();};}function saveUpdates(_0x55cf8e,_0x4f7d4f){return function(_0x358412){if(_0x358412){return _0x358412[_0xe06b('0x24')](_0x55cf8e)[_0xe06b('0x25')](function(_0x1203ed){return _0x1203ed;});}return null;};}function removeEntity(_0x526226,_0x349153){return function(_0x146edb){if(_0x146edb){return _0x146edb[_0xe06b('0x26')]()[_0xe06b('0x25')](function(){_0x526226[_0xe06b('0x1a')](0xcc)[_0xe06b('0x1b')]();});}};}function handleEntityNotFound(_0x1a4a86,_0x49b236){return function(_0x35d289){if(!_0x35d289){_0x1a4a86[_0xe06b('0x19')](0x194);}return _0x35d289;};}function handleError(_0x441537,_0x59aad8){_0x59aad8=_0x59aad8||0x1f4;return function(_0x348e49){logger[_0xe06b('0x27')](_0x348e49[_0xe06b('0x28')]);if(_0x348e49[_0xe06b('0x29')]){delete _0x348e49[_0xe06b('0x29')];}_0x441537[_0xe06b('0x1a')](_0x59aad8)['send'](_0x348e49);};}exports[_0xe06b('0x2a')]=function(_0x266793,_0x49b76e){var _0x5ae2c1={},_0x3697af={},_0x3697cd={'count':0x0,'rows':[]};var _0x48d86c=_[_0xe06b('0x2b')](db[_0xe06b('0x2c')]['rawAttributes'],function(_0x37bb6e){return{'name':_0x37bb6e[_0xe06b('0x2d')],'type':_0x37bb6e[_0xe06b('0x2e')]['key']};});_0x3697af[_0xe06b('0x2f')]=_[_0xe06b('0x2b')](_0x48d86c,_0xe06b('0x29'));_0x3697af['query']=_[_0xe06b('0x30')](_0x266793[_0xe06b('0x31')]);_0x3697af[_0xe06b('0x32')]=_[_0xe06b('0x33')](_0x3697af['model'],_0x3697af[_0xe06b('0x31')]);_0x5ae2c1[_0xe06b('0x34')]=_[_0xe06b('0x33')](_0x3697af[_0xe06b('0x2f')],qs['fields'](_0x266793[_0xe06b('0x31')][_0xe06b('0x35')]));_0x5ae2c1['attributes']=_0x5ae2c1[_0xe06b('0x34')][_0xe06b('0x36')]?_0x5ae2c1['attributes']:_0x3697af[_0xe06b('0x2f')];if(!_0x266793[_0xe06b('0x31')]['hasOwnProperty'](_0xe06b('0x37'))){_0x5ae2c1[_0xe06b('0x1e')]=qs[_0xe06b('0x1e')](_0x266793[_0xe06b('0x31')][_0xe06b('0x1e')]);_0x5ae2c1['offset']=qs[_0xe06b('0x20')](_0x266793[_0xe06b('0x31')][_0xe06b('0x20')]);}_0x5ae2c1[_0xe06b('0x38')]=qs[_0xe06b('0x39')](_0x266793['query'][_0xe06b('0x39')]);_0x5ae2c1[_0xe06b('0x3a')]=qs[_0xe06b('0x32')](_['pick'](_0x266793['query'],_0x3697af['filters']),_0x48d86c);if(_0x266793[_0xe06b('0x31')][_0xe06b('0x3b')]){_0x5ae2c1[_0xe06b('0x3a')]=_[_0xe06b('0x3c')](_0x5ae2c1[_0xe06b('0x3a')],{'$or':_['map'](_0x48d86c,function(_0x427fd9){if(_0x427fd9[_0xe06b('0x2e')]!==_0xe06b('0x3d')){var _0x2e3c65={};_0x2e3c65[_0x427fd9[_0xe06b('0x29')]]={'$like':'%'+_0x266793['query'][_0xe06b('0x3b')]+'%'};return _0x2e3c65;}})});}_0x5ae2c1=_[_0xe06b('0x3c')]({},_0x5ae2c1,_0x266793[_0xe06b('0x3e')]);var _0x12948d={'where':_0x5ae2c1[_0xe06b('0x3a')]};return db['AnalyticFieldReport'][_0xe06b('0x1f')](_0x12948d)[_0xe06b('0x25')](function(_0x3fdc6e){_0x3697cd['count']=_0x3fdc6e;if(_0x266793['query'][_0xe06b('0x3f')]){_0x5ae2c1[_0xe06b('0x40')]=[{'all':!![]}];}return db[_0xe06b('0x2c')][_0xe06b('0x41')](_0x5ae2c1);})[_0xe06b('0x25')](function(_0x266738){_0x3697cd['rows']=_0x266738;return _0x3697cd;})[_0xe06b('0x25')](respondWithFilteredResult(_0x49b76e,_0x5ae2c1))[_0xe06b('0x42')](handleError(_0x49b76e,null));};exports[_0xe06b('0x43')]=function(_0x15d409,_0x4980e2){var _0x363524={'raw':![],'where':{'id':_0x15d409['params']['id']}},_0xfc38ab={};_0xfc38ab['model']=_[_0xe06b('0x30')](db[_0xe06b('0x2c')]['rawAttributes']);_0xfc38ab[_0xe06b('0x31')]=_[_0xe06b('0x30')](_0x15d409[_0xe06b('0x31')]);_0xfc38ab[_0xe06b('0x32')]=_[_0xe06b('0x33')](_0xfc38ab[_0xe06b('0x2f')],_0xfc38ab[_0xe06b('0x31')]);_0x363524[_0xe06b('0x34')]=_[_0xe06b('0x33')](_0xfc38ab[_0xe06b('0x2f')],qs[_0xe06b('0x35')](_0x15d409['query'][_0xe06b('0x35')]));_0x363524[_0xe06b('0x34')]=_0x363524[_0xe06b('0x34')][_0xe06b('0x36')]?_0x363524['attributes']:_0xfc38ab['model'];if(_0x15d409[_0xe06b('0x31')]['includeAll']){_0x363524[_0xe06b('0x40')]=[{'all':!![]}];}_0x363524=_[_0xe06b('0x3c')]({},_0x363524,_0x15d409[_0xe06b('0x3e')]);return db[_0xe06b('0x2c')][_0xe06b('0x44')](_0x363524)[_0xe06b('0x25')](handleEntityNotFound(_0x4980e2,null))[_0xe06b('0x25')](respondWithResult(_0x4980e2,null))[_0xe06b('0x42')](handleError(_0x4980e2,null));};exports[_0xe06b('0x45')]=function(_0x4cc0e6,_0x52ae61){return db[_0xe06b('0x2c')][_0xe06b('0x45')](_0x4cc0e6[_0xe06b('0x46')],{})['then'](respondWithResult(_0x52ae61,0xc9))[_0xe06b('0x42')](handleError(_0x52ae61,null));};exports[_0xe06b('0x47')]=function(_0x3f2f97,_0x3df505){return db[_0xe06b('0x2c')][_0xe06b('0x47')](_0x3f2f97[_0xe06b('0x46')],{'raw':![],'individualHooks':!![]})[_0xe06b('0x25')](respondWithResult(_0x3df505,0xc9))[_0xe06b('0x42')](handleError(_0x3df505,null));};exports[_0xe06b('0x24')]=function(_0x2c10fc,_0x326eb1){if(_0x2c10fc['body']['id']){delete _0x2c10fc['body']['id'];}return db['AnalyticFieldReport']['find']({'where':{'id':_0x2c10fc[_0xe06b('0x48')]['id']}})[_0xe06b('0x25')](handleEntityNotFound(_0x326eb1,null))[_0xe06b('0x25')](saveUpdates(_0x2c10fc['body'],null))[_0xe06b('0x25')](respondWithResult(_0x326eb1,null))[_0xe06b('0x42')](handleError(_0x326eb1,null));};exports['destroy']=function(_0x555cc1,_0x828f01){return db[_0xe06b('0x2c')][_0xe06b('0x44')]({'where':{'id':_0x555cc1[_0xe06b('0x48')]['id']}})['then'](handleEntityNotFound(_0x828f01,null))[_0xe06b('0x25')](removeEntity(_0x828f01,null))[_0xe06b('0x42')](handleError(_0x828f01,null));};exports['bulkDestroy']=function(_0xeb3541,_0x4d3e58){return db[_0xe06b('0x2c')][_0xe06b('0x26')]({'where':{'id':_0xeb3541[_0xe06b('0x31')]['ids']||[]},'raw':![],'individualHooks':!![]})['then'](respondWithResult(_0x4d3e58,0xcc))['catch'](handleError(_0x4d3e58,null));};exports[_0xe06b('0x49')]=function(_0x144b78,_0x30abc0,_0x42a8e9){return db['AnalyticCustomReport'][_0xe06b('0x4a')]({'where':{'id':_0x144b78[_0xe06b('0x48')]['id']}})[_0xe06b('0x25')](handleEntityNotFound(_0x30abc0,null))[_0xe06b('0x25')](function(_0xc66d0c){if(_0xc66d0c){return db['sequelize'][_0xe06b('0x4b')](function(_0x2ed831){return db[_0xe06b('0x2c')][_0xe06b('0x26')]({'where':{'CustomReportId':_0x144b78[_0xe06b('0x48')]['id']},'transaction':_0x2ed831})[_0xe06b('0x25')](function(_0x76bae6){var _0x59852c=_['map'](_0x144b78[_0xe06b('0x46')],function(_0x124c04){delete _0x124c04['id'];_0x124c04[_0xe06b('0x4c')]=_0x144b78[_0xe06b('0x48')]['id'];return _0x124c04;});return db[_0xe06b('0x2c')][_0xe06b('0x47')](_0x59852c,{'transaction':_0x2ed831});});})[_0xe06b('0x25')](function(){return db[_0xe06b('0x2c')][_0xe06b('0x41')]({'where':{'CustomReportId':_0x144b78['params']['id']}});});}})[_0xe06b('0x25')](respondWithResult(_0x30abc0,null))[_0xe06b('0x42')](handleError(_0x30abc0,null));};
\ No newline at end of file
diff --git a/server/api/analyticFieldReport/analyticFieldReport.model.js b/server/api/analyticFieldReport/analyticFieldReport.model.js
index a98ad31..ac597d1 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 _0x3054=['exports','define','AnalyticFieldReport','analytics_report_fields','util','../../config/logger','api','moment','bluebird','path','../../config/environment','./analyticFieldReport.attributes'];(function(_0x45ce90,_0x114609){var _0x313c45=function(_0x55102a){while(--_0x55102a){_0x45ce90['push'](_0x45ce90['shift']());}};_0x313c45(++_0x114609);}(_0x3054,0x10c));var _0x4305=function(_0x5d1e6e,_0x16aca4){_0x5d1e6e=_0x5d1e6e-0x0;var _0x1f0dfe=_0x3054[_0x5d1e6e];return _0x1f0dfe;};'use strict';var _=require('lodash');var util=require(_0x4305('0x0'));var logger=require(_0x4305('0x1'))(_0x4305('0x2'));var moment=require(_0x4305('0x3'));var BPromise=require(_0x4305('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x4305('0x5'));var rimraf=require('rimraf');var config=require(_0x4305('0x6'));var attributes=require(_0x4305('0x7'));module[_0x4305('0x8')]=function(_0x4cff36,_0x16255f){return _0x4cff36[_0x4305('0x9')](_0x4305('0xa'),attributes,{'tableName':_0x4305('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x5cdb=['define','analytics_report_fields','util','../../config/logger','api','path','rimraf','./analyticFieldReport.attributes','exports'];(function(_0x272350,_0x3db80e){var _0x1685fe=function(_0x494102){while(--_0x494102){_0x272350['push'](_0x272350['shift']());}};_0x1685fe(++_0x3db80e);}(_0x5cdb,0x122));var _0xb5cd=function(_0x4a29d9,_0x3d6d77){_0x4a29d9=_0x4a29d9-0x0;var _0x4ea260=_0x5cdb[_0x4a29d9];return _0x4ea260;};'use strict';var _=require('lodash');var util=require(_0xb5cd('0x0'));var logger=require(_0xb5cd('0x1'))(_0xb5cd('0x2'));var moment=require('moment');var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0xb5cd('0x3'));var rimraf=require(_0xb5cd('0x4'));var config=require('../../config/environment');var attributes=require(_0xb5cd('0x5'));module[_0xb5cd('0x6')]=function(_0x5e9ff7,_0x155165){return _0x5e9ff7[_0xb5cd('0x7')]('AnalyticFieldReport',attributes,{'tableName':_0xb5cd('0x8'),'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 d2743f4..68669f0 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 _0x77b1=['../../config/utils','../../config/logger','rpc','jayson/promise','client','http','request','info','AnalyticFieldReport,\x20%s,\x20%s','request\x20sent','AnalyticFieldReport,\x20%s,\x20%s,\x20%s','stringify','error','message','result','lodash','moment','randomstring','ioredis','../../mysqldb'];(function(_0xe34133,_0x5a7691){var _0x27ebab=function(_0x3a42ba){while(--_0x3a42ba){_0xe34133['push'](_0xe34133['shift']());}};_0x27ebab(++_0x5a7691);}(_0x77b1,0x19f));var _0x177b=function(_0x23af58,_0x3d45df){_0x23af58=_0x23af58-0x0;var _0xdf23b2=_0x77b1[_0x23af58];return _0xdf23b2;};'use strict';var _=require(_0x177b('0x0'));var util=require('util');var moment=require(_0x177b('0x1'));var BPromise=require('bluebird');var rs=require(_0x177b('0x2'));var fs=require('fs');var Redis=require(_0x177b('0x3'));var db=require(_0x177b('0x4'))['db'];var utils=require(_0x177b('0x5'));var logger=require(_0x177b('0x6'))(_0x177b('0x7'));var config=require('../../config/environment');var jayson=require(_0x177b('0x8'));var client=jayson[_0x177b('0x9')][_0x177b('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x117e81,_0x426d35,_0x34b79d){return new BPromise(function(_0x1df58c,_0x297186){return client[_0x177b('0xb')](_0x117e81,_0x34b79d)['then'](function(_0x124ec8){logger[_0x177b('0xc')](_0x177b('0xd'),_0x426d35,_0x177b('0xe'));logger['debug'](_0x177b('0xf'),_0x426d35,_0x177b('0xe'),JSON[_0x177b('0x10')](_0x124ec8));if(_0x124ec8['error']){if(_0x124ec8[_0x177b('0x11')]['code']===0x1f4){logger[_0x177b('0x11')](_0x177b('0xd'),_0x426d35,_0x124ec8['error']['message']);return _0x297186(_0x124ec8[_0x177b('0x11')][_0x177b('0x12')]);}logger[_0x177b('0x11')](_0x177b('0xd'),_0x426d35,_0x124ec8[_0x177b('0x11')][_0x177b('0x12')]);return _0x1df58c(_0x124ec8[_0x177b('0x11')]['message']);}else{logger['info']('AnalyticFieldReport,\x20%s,\x20%s',_0x426d35,_0x177b('0xe'));_0x1df58c(_0x124ec8[_0x177b('0x13')]['message']);}})['catch'](function(_0x3fa952){logger['error'](_0x177b('0xd'),_0x426d35,_0x3fa952);_0x297186(_0x3fa952);});});}
\ No newline at end of file
+var _0x0b8b=['stringify','error','code','AnalyticFieldReport,\x20%s,\x20%s','message','result','catch','lodash','moment','bluebird','../../mysqldb','../../config/logger','rpc','../../config/environment','client','request','then','info','request\x20sent'];(function(_0x3fadd6,_0x397ea7){var _0x46ceb3=function(_0x2a6d66){while(--_0x2a6d66){_0x3fadd6['push'](_0x3fadd6['shift']());}};_0x46ceb3(++_0x397ea7);}(_0x0b8b,0xeb));var _0xb0b8=function(_0x3c38c7,_0x14dd97){_0x3c38c7=_0x3c38c7-0x0;var _0x4aa4b1=_0x0b8b[_0x3c38c7];return _0x4aa4b1;};'use strict';var _=require(_0xb0b8('0x0'));var util=require('util');var moment=require(_0xb0b8('0x1'));var BPromise=require(_0xb0b8('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0xb0b8('0x3'))['db'];var utils=require('../../config/utils');var logger=require(_0xb0b8('0x4'))(_0xb0b8('0x5'));var config=require(_0xb0b8('0x6'));var jayson=require('jayson/promise');var client=jayson[_0xb0b8('0x7')]['http']({'port':0x232a});function respondWithRpcPromise(_0x24bef2,_0x1a1844,_0xd3bba7){return new BPromise(function(_0x3cf2b4,_0x434369){return client[_0xb0b8('0x8')](_0x24bef2,_0xd3bba7)[_0xb0b8('0x9')](function(_0x55e607){logger[_0xb0b8('0xa')]('AnalyticFieldReport,\x20%s,\x20%s',_0x1a1844,_0xb0b8('0xb'));logger['debug']('AnalyticFieldReport,\x20%s,\x20%s,\x20%s',_0x1a1844,_0xb0b8('0xb'),JSON[_0xb0b8('0xc')](_0x55e607));if(_0x55e607[_0xb0b8('0xd')]){if(_0x55e607[_0xb0b8('0xd')][_0xb0b8('0xe')]===0x1f4){logger[_0xb0b8('0xd')](_0xb0b8('0xf'),_0x1a1844,_0x55e607[_0xb0b8('0xd')][_0xb0b8('0x10')]);return _0x434369(_0x55e607[_0xb0b8('0xd')][_0xb0b8('0x10')]);}logger[_0xb0b8('0xd')](_0xb0b8('0xf'),_0x1a1844,_0x55e607[_0xb0b8('0xd')][_0xb0b8('0x10')]);return _0x3cf2b4(_0x55e607['error'][_0xb0b8('0x10')]);}else{logger['info'](_0xb0b8('0xf'),_0x1a1844,_0xb0b8('0xb'));_0x3cf2b4(_0x55e607[_0xb0b8('0x11')]['message']);}})[_0xb0b8('0x12')](function(_0x48d09f){logger[_0xb0b8('0xd')]('AnalyticFieldReport,\x20%s,\x20%s',_0x1a1844,_0x48d09f);_0x434369(_0x48d09f);});});}
\ No newline at end of file
diff --git a/server/api/analyticFieldReport/index.js b/server/api/analyticFieldReport/index.js
index 4d0ae90..35380d6 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(_0x5dc120,_0x3e4683){var _0x37aa08=function(_0x176f47){while(--_0x176f47){_0x5dc120['push'](_0x5dc120['shift']());}};_0x37aa08(++_0x3e4683);}(_0xa9e0,0x123));var _0x0a9e=function(_0x18a79d,_0x57bd2c){_0x18a79d=_0x18a79d-0x0;var _0x4f8848=_0xa9e0[_0x18a79d];return _0x4f8848;};'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(_0x15c870,_0x89ecb0){var _0x4d9a13=function(_0x5474f4){while(--_0x5474f4){_0x15c870['push'](_0x15c870['shift']());}};_0x4d9a13(++_0x89ecb0);}(_0xa9e0,0x123));var _0x0a9e=function(_0x187ee1,_0x3fd1e6){_0x187ee1=_0x187ee1-0x0;var _0x388160=_0xa9e0[_0x187ee1];return _0x388160;};'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 2aaf585..91ca69b 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 _0xd732=['STRING','TEXT','sequelize'];(function(_0x4e9f7a,_0xcd51d8){var _0x433a29=function(_0x1c4de3){while(--_0x1c4de3){_0x4e9f7a['push'](_0x4e9f7a['shift']());}};_0x433a29(++_0xcd51d8);}(_0xd732,0x18e));var _0x2d73=function(_0x4f00ab,_0x574771){_0x4f00ab=_0x4f00ab-0x0;var _0x25d7d4=_0xd732[_0x4f00ab];return _0x25d7d4;};'use strict';var Sequelize=require(_0x2d73('0x0'));module['exports']={'name':{'type':Sequelize[_0x2d73('0x1')],'allowNull':![],'unique':'name'},'table':{'type':Sequelize['STRING']},'metric':{'type':Sequelize[_0x2d73('0x2')]},'description':{'type':Sequelize[_0x2d73('0x1')]}};
\ No newline at end of file
+var _0xa68c=['TEXT','sequelize','exports','STRING','name'];(function(_0x53eba7,_0x38744c){var _0x32491b=function(_0x61ea1d){while(--_0x61ea1d){_0x53eba7['push'](_0x53eba7['shift']());}};_0x32491b(++_0x38744c);}(_0xa68c,0x187));var _0xca68=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xa68c[_0x3dd15e];return _0x231fd0;};'use strict';var Sequelize=require(_0xca68('0x0'));module[_0xca68('0x1')]={'name':{'type':Sequelize[_0xca68('0x2')],'allowNull':![],'unique':_0xca68('0x3')},'table':{'type':Sequelize[_0xca68('0x2')]},'metric':{'type':Sequelize[_0xca68('0x4')]},'description':{'type':Sequelize[_0xca68('0x2')]}};
\ No newline at end of file
diff --git a/server/api/analyticMetric/analyticMetric.controller.js b/server/api/analyticMetric/analyticMetric.controller.js
index 11a9c34..1326752 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 _0x5fc3=['user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','find','userProfileId','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','to-csv','lodash','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/environment','../../config/license/util','sendStatus','status','end','offset','undefined','limit','count','Content-Range','json','apply','reject','save','update','then','destroy','get','Metrics','error','stack','name','send','index','map','AnalyticMetric','rawAttributes','fieldName','type','key','model','keys','filters','intersection','query','attributes','fields','length','hasOwnProperty','sort','pick','filter','where','VIRTUAL','options','includeAll','include','findAll','catch','show','params','merge','create','body'];(function(_0x456c80,_0x41a353){var _0x4dc31a=function(_0x379085){while(--_0x379085){_0x456c80['push'](_0x456c80['shift']());}};_0x4dc31a(++_0x41a353);}(_0x5fc3,0xa8));var _0x35fc=function(_0x23be51,_0xc02a1b){_0x23be51=_0x23be51-0x0;var _0x47a26d=_0x5fc3[_0x23be51];return _0x47a26d;};'use strict';var emlformat=require(_0x35fc('0x0'));var rimraf=require(_0x35fc('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x35fc('0x2'));var rp=require(_0x35fc('0x3'));var moment=require(_0x35fc('0x4'));var BPromise=require(_0x35fc('0x5'));var Mustache=require(_0x35fc('0x6'));var util=require('util');var path=require(_0x35fc('0x7'));var sox=require(_0x35fc('0x8'));var csv=require(_0x35fc('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x35fc('0xa'));var squel=require('squel');var crypto=require(_0x35fc('0xb'));var jsforce=require(_0x35fc('0xc'));var deskjs=require(_0x35fc('0xd'));var toCsv=require(_0x35fc('0x9'));var querystring=require(_0x35fc('0xe'));var Papa=require(_0x35fc('0xf'));var Redis=require(_0x35fc('0x10'));var authService=require('../../components/auth/service');var qs=require(_0x35fc('0x11'));var as=require(_0x35fc('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x35fc('0x13'))(_0x35fc('0x14'));var utils=require('../../config/utils');var config=require(_0x35fc('0x15'));var licenseUtil=require(_0x35fc('0x16'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x4cbe74,_0x409357){_0x409357=_0x409357||0xcc;return function(_0x5d462a){if(_0x5d462a){return _0x4cbe74[_0x35fc('0x17')](_0x409357);}return _0x4cbe74[_0x35fc('0x18')](_0x409357)[_0x35fc('0x19')]();};}function respondWithResult(_0x29730f,_0x38d9f2){_0x38d9f2=_0x38d9f2||0xc8;return function(_0x5cfe94){if(_0x5cfe94){return _0x29730f['status'](_0x38d9f2)['json'](_0x5cfe94);}};}function respondWithFilteredResult(_0x558364,_0x398b67){return function(_0x229d56){if(_0x229d56){var _0x53b898=typeof _0x398b67[_0x35fc('0x1a')]===_0x35fc('0x1b')&&typeof _0x398b67[_0x35fc('0x1c')]==='undefined';var _0x26ba54=_0x229d56[_0x35fc('0x1d')];var _0x553677=_0x53b898?0x0:_0x398b67[_0x35fc('0x1a')];var _0x363e47=_0x53b898?_0x229d56[_0x35fc('0x1d')]:_0x398b67['offset']+_0x398b67[_0x35fc('0x1c')];var _0x3c58ea;if(_0x363e47>=_0x26ba54){_0x363e47=_0x26ba54;_0x3c58ea=0xc8;}else{_0x3c58ea=0xce;}_0x558364[_0x35fc('0x18')](_0x3c58ea);return _0x558364['set'](_0x35fc('0x1e'),_0x553677+'-'+_0x363e47+'/'+_0x26ba54)[_0x35fc('0x1f')](_0x229d56);}return null;};}function patchUpdates(_0x3229d1){return function(_0x251a1f){try{jsonpatch[_0x35fc('0x20')](_0x251a1f,_0x3229d1,!![]);}catch(_0x21f1a9){return BPromise[_0x35fc('0x21')](_0x21f1a9);}return _0x251a1f[_0x35fc('0x22')]();};}function saveUpdates(_0x2405e8,_0x427eae){return function(_0x5bd2b8){if(_0x5bd2b8){return _0x5bd2b8[_0x35fc('0x23')](_0x2405e8)[_0x35fc('0x24')](function(_0x257719){return _0x257719;});}return null;};}function removeEntity(_0x2d8183,_0x3b4743){return function(_0x55e9e7){if(_0x55e9e7){return _0x55e9e7[_0x35fc('0x25')]()[_0x35fc('0x24')](function(){var _0x561bf8=_0x55e9e7[_0x35fc('0x26')]({'plain':!![]});var _0x5a93df=_0x35fc('0x27');return db['UserProfileResource'][_0x35fc('0x25')]({'where':{'type':_0x5a93df,'resourceId':_0x561bf8['id']}})['then'](function(){return _0x55e9e7;});})[_0x35fc('0x24')](function(){_0x2d8183[_0x35fc('0x18')](0xcc)['end']();});}};}function handleEntityNotFound(_0x519264,_0x47774c){return function(_0x58edb6){if(!_0x58edb6){_0x519264[_0x35fc('0x17')](0x194);}return _0x58edb6;};}function handleError(_0x1a5d92,_0x57001c){_0x57001c=_0x57001c||0x1f4;return function(_0x26b7cb){logger[_0x35fc('0x28')](_0x26b7cb[_0x35fc('0x29')]);if(_0x26b7cb[_0x35fc('0x2a')]){delete _0x26b7cb[_0x35fc('0x2a')];}_0x1a5d92[_0x35fc('0x18')](_0x57001c)[_0x35fc('0x2b')](_0x26b7cb);};}exports[_0x35fc('0x2c')]=function(_0x54aedc,_0x1cd1ae){var _0x220931={},_0x22af18={},_0x52acc5={'count':0x0,'rows':[]};var _0xe79f52=_[_0x35fc('0x2d')](db[_0x35fc('0x2e')][_0x35fc('0x2f')],function(_0xd8a4ca){return{'name':_0xd8a4ca[_0x35fc('0x30')],'type':_0xd8a4ca[_0x35fc('0x31')][_0x35fc('0x32')]};});_0x22af18[_0x35fc('0x33')]=_[_0x35fc('0x2d')](_0xe79f52,'name');_0x22af18['query']=_[_0x35fc('0x34')](_0x54aedc['query']);_0x22af18[_0x35fc('0x35')]=_[_0x35fc('0x36')](_0x22af18[_0x35fc('0x33')],_0x22af18[_0x35fc('0x37')]);_0x220931[_0x35fc('0x38')]=_[_0x35fc('0x36')](_0x22af18['model'],qs[_0x35fc('0x39')](_0x54aedc[_0x35fc('0x37')][_0x35fc('0x39')]));_0x220931[_0x35fc('0x38')]=_0x220931[_0x35fc('0x38')][_0x35fc('0x3a')]?_0x220931['attributes']:_0x22af18[_0x35fc('0x33')];if(!_0x54aedc[_0x35fc('0x37')][_0x35fc('0x3b')]('nolimit')){_0x220931[_0x35fc('0x1c')]=qs['limit'](_0x54aedc[_0x35fc('0x37')][_0x35fc('0x1c')]);_0x220931[_0x35fc('0x1a')]=qs[_0x35fc('0x1a')](_0x54aedc['query']['offset']);}_0x220931['order']=qs[_0x35fc('0x3c')](_0x54aedc['query'][_0x35fc('0x3c')]);_0x220931['where']=qs[_0x35fc('0x35')](_[_0x35fc('0x3d')](_0x54aedc[_0x35fc('0x37')],_0x22af18[_0x35fc('0x35')]),_0xe79f52);if(_0x54aedc[_0x35fc('0x37')][_0x35fc('0x3e')]){_0x220931[_0x35fc('0x3f')]=_['merge'](_0x220931[_0x35fc('0x3f')],{'$or':_[_0x35fc('0x2d')](_0xe79f52,function(_0x4e0ce3){if(_0x4e0ce3[_0x35fc('0x31')]!==_0x35fc('0x40')){var _0x1aac67={};_0x1aac67[_0x4e0ce3[_0x35fc('0x2a')]]={'$like':'%'+_0x54aedc[_0x35fc('0x37')][_0x35fc('0x3e')]+'%'};return _0x1aac67;}})});}_0x220931=_['merge']({},_0x220931,_0x54aedc[_0x35fc('0x41')]);var _0x267858={'where':_0x220931[_0x35fc('0x3f')]};return db['AnalyticMetric'][_0x35fc('0x1d')](_0x267858)[_0x35fc('0x24')](function(_0x596919){_0x52acc5[_0x35fc('0x1d')]=_0x596919;if(_0x54aedc[_0x35fc('0x37')][_0x35fc('0x42')]){_0x220931[_0x35fc('0x43')]=[{'all':!![]}];}return db[_0x35fc('0x2e')][_0x35fc('0x44')](_0x220931);})[_0x35fc('0x24')](function(_0x3ec51f){_0x52acc5['rows']=_0x3ec51f;return _0x52acc5;})['then'](respondWithFilteredResult(_0x1cd1ae,_0x220931))[_0x35fc('0x45')](handleError(_0x1cd1ae,null));};exports[_0x35fc('0x46')]=function(_0x4fdc6d,_0x5c2e5c){var _0x4ff202={'raw':!![],'where':{'id':_0x4fdc6d[_0x35fc('0x47')]['id']}},_0x79677d={};_0x79677d['model']=_[_0x35fc('0x34')](db[_0x35fc('0x2e')][_0x35fc('0x2f')]);_0x79677d[_0x35fc('0x37')]=_['keys'](_0x4fdc6d['query']);_0x79677d['filters']=_['intersection'](_0x79677d['model'],_0x79677d[_0x35fc('0x37')]);_0x4ff202[_0x35fc('0x38')]=_['intersection'](_0x79677d[_0x35fc('0x33')],qs['fields'](_0x4fdc6d[_0x35fc('0x37')][_0x35fc('0x39')]));_0x4ff202[_0x35fc('0x38')]=_0x4ff202[_0x35fc('0x38')][_0x35fc('0x3a')]?_0x4ff202['attributes']:_0x79677d[_0x35fc('0x33')];if(_0x4fdc6d[_0x35fc('0x37')]['includeAll']){_0x4ff202[_0x35fc('0x43')]=[{'all':!![]}];}_0x4ff202=_[_0x35fc('0x48')]({},_0x4ff202,_0x4fdc6d[_0x35fc('0x41')]);return db[_0x35fc('0x2e')]['find'](_0x4ff202)[_0x35fc('0x24')](handleEntityNotFound(_0x5c2e5c,null))['then'](respondWithResult(_0x5c2e5c,null))['catch'](handleError(_0x5c2e5c,null));};exports[_0x35fc('0x49')]=function(_0x9db7e8,_0x18dc78){return db[_0x35fc('0x2e')][_0x35fc('0x49')](_0x9db7e8[_0x35fc('0x4a')],{})[_0x35fc('0x24')](function(_0x16afa6){var _0x4f555f=_0x9db7e8[_0x35fc('0x4b')][_0x35fc('0x26')]({'plain':!![]});if(!_0x4f555f)throw new Error(_0x35fc('0x4c'));if(_0x4f555f[_0x35fc('0x4d')]===_0x35fc('0x4b')){var _0x1e3221=_0x16afa6[_0x35fc('0x26')]({'plain':!![]});var _0x347a4a=_0x35fc('0x27');return db[_0x35fc('0x4e')][_0x35fc('0x4f')]({'where':{'name':_0x347a4a,'userProfileId':_0x4f555f[_0x35fc('0x50')]},'raw':!![]})[_0x35fc('0x24')](function(_0x3146e2){if(_0x3146e2&&_0x3146e2['autoAssociation']===0x0){return db['UserProfileResource'][_0x35fc('0x49')]({'name':_0x1e3221[_0x35fc('0x2a')],'resourceId':_0x1e3221['id'],'type':_0x3146e2[_0x35fc('0x2a')],'sectionId':_0x3146e2['id']},{})[_0x35fc('0x24')](function(){return _0x16afa6;});}else{return _0x16afa6;}})[_0x35fc('0x45')](function(_0x3e6494){logger['error']('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x3e6494);throw _0x3e6494;});}return _0x16afa6;})[_0x35fc('0x24')](respondWithResult(_0x18dc78,0xc9))[_0x35fc('0x45')](handleError(_0x18dc78,null));};exports[_0x35fc('0x23')]=function(_0x38bc78,_0x5b2595){if(_0x38bc78[_0x35fc('0x4a')]['id']){delete _0x38bc78[_0x35fc('0x4a')]['id'];}return db['AnalyticMetric'][_0x35fc('0x4f')]({'where':{'id':_0x38bc78[_0x35fc('0x47')]['id']}})['then'](handleEntityNotFound(_0x5b2595,null))[_0x35fc('0x24')](saveUpdates(_0x38bc78[_0x35fc('0x4a')],null))[_0x35fc('0x24')](respondWithResult(_0x5b2595,null))[_0x35fc('0x45')](handleError(_0x5b2595,null));};exports['destroy']=function(_0x4de34b,_0x502a15){return db[_0x35fc('0x2e')][_0x35fc('0x4f')]({'where':{'id':_0x4de34b['params']['id']}})[_0x35fc('0x24')](handleEntityNotFound(_0x502a15,null))[_0x35fc('0x24')](removeEntity(_0x502a15,null))[_0x35fc('0x45')](handleError(_0x502a15,null));};
\ No newline at end of file
+var _0x008c=['path','sox','to-csv','ejs','fs-extra','lodash','crypto','desk.js','papaparse','ioredis','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','end','status','json','offset','undefined','limit','count','save','update','then','destroy','get','stack','name','index','map','AnalyticMetric','rawAttributes','fieldName','type','key','model','keys','query','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','filters','filter','where','merge','VIRTUAL','options','include','findAll','catch','show','params','includeAll','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','UserProfileResource','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util'];(function(_0x295ee0,_0x5ef633){var _0x36cb3c=function(_0x3d45b4){while(--_0x3d45b4){_0x295ee0['push'](_0x295ee0['shift']());}};_0x36cb3c(++_0x5ef633);}(_0x008c,0x188));var _0xc008=function(_0x321327,_0x4965b){_0x321327=_0x321327-0x0;var _0x33be38=_0x008c[_0x321327];return _0x33be38;};'use strict';var emlformat=require(_0xc008('0x0'));var rimraf=require(_0xc008('0x1'));var zipdir=require(_0xc008('0x2'));var jsonpatch=require(_0xc008('0x3'));var rp=require(_0xc008('0x4'));var moment=require('moment');var BPromise=require(_0xc008('0x5'));var Mustache=require(_0xc008('0x6'));var util=require(_0xc008('0x7'));var path=require(_0xc008('0x8'));var sox=require(_0xc008('0x9'));var csv=require(_0xc008('0xa'));var ejs=require(_0xc008('0xb'));var fs=require('fs');var fs_extra=require(_0xc008('0xc'));var _=require(_0xc008('0xd'));var squel=require('squel');var crypto=require(_0xc008('0xe'));var jsforce=require('jsforce');var deskjs=require(_0xc008('0xf'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0xc008('0x10'));var Redis=require(_0xc008('0x11'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xc008('0x12'));var logger=require(_0xc008('0x13'))('api');var utils=require(_0xc008('0x14'));var config=require(_0xc008('0x15'));var licenseUtil=require(_0xc008('0x16'));var db=require(_0xc008('0x17'))['db'];function respondWithStatusCode(_0x9ffa93,_0x1819c6){_0x1819c6=_0x1819c6||0xcc;return function(_0x69726e){if(_0x69726e){return _0x9ffa93['sendStatus'](_0x1819c6);}return _0x9ffa93['status'](_0x1819c6)[_0xc008('0x18')]();};}function respondWithResult(_0x50c1ab,_0x25e13f){_0x25e13f=_0x25e13f||0xc8;return function(_0x4584e1){if(_0x4584e1){return _0x50c1ab[_0xc008('0x19')](_0x25e13f)[_0xc008('0x1a')](_0x4584e1);}};}function respondWithFilteredResult(_0x3f0ecf,_0x5ee00b){return function(_0x5e894e){if(_0x5e894e){var _0x4bd0f4=typeof _0x5ee00b[_0xc008('0x1b')]===_0xc008('0x1c')&&typeof _0x5ee00b[_0xc008('0x1d')]===_0xc008('0x1c');var _0x4fe771=_0x5e894e['count'];var _0x540e45=_0x4bd0f4?0x0:_0x5ee00b['offset'];var _0x46042b=_0x4bd0f4?_0x5e894e[_0xc008('0x1e')]:_0x5ee00b['offset']+_0x5ee00b[_0xc008('0x1d')];var _0x5906e6;if(_0x46042b>=_0x4fe771){_0x46042b=_0x4fe771;_0x5906e6=0xc8;}else{_0x5906e6=0xce;}_0x3f0ecf['status'](_0x5906e6);return _0x3f0ecf['set']('Content-Range',_0x540e45+'-'+_0x46042b+'/'+_0x4fe771)[_0xc008('0x1a')](_0x5e894e);}return null;};}function patchUpdates(_0x4b9726){return function(_0x5560b1){try{jsonpatch['apply'](_0x5560b1,_0x4b9726,!![]);}catch(_0x4a582d){return BPromise['reject'](_0x4a582d);}return _0x5560b1[_0xc008('0x1f')]();};}function saveUpdates(_0x4777a6,_0x251db2){return function(_0x415af3){if(_0x415af3){return _0x415af3[_0xc008('0x20')](_0x4777a6)[_0xc008('0x21')](function(_0x4f43e2){return _0x4f43e2;});}return null;};}function removeEntity(_0x459fd9,_0x5c85f2){return function(_0x58a6ea){if(_0x58a6ea){return _0x58a6ea[_0xc008('0x22')]()[_0xc008('0x21')](function(){var _0x2e3cfb=_0x58a6ea[_0xc008('0x23')]({'plain':!![]});var _0x5410f5='Metrics';return db['UserProfileResource'][_0xc008('0x22')]({'where':{'type':_0x5410f5,'resourceId':_0x2e3cfb['id']}})[_0xc008('0x21')](function(){return _0x58a6ea;});})[_0xc008('0x21')](function(){_0x459fd9[_0xc008('0x19')](0xcc)['end']();});}};}function handleEntityNotFound(_0x5e2aca,_0x4fce9c){return function(_0x4adbab){if(!_0x4adbab){_0x5e2aca['sendStatus'](0x194);}return _0x4adbab;};}function handleError(_0x3865c0,_0x29ba43){_0x29ba43=_0x29ba43||0x1f4;return function(_0x25eae4){logger['error'](_0x25eae4[_0xc008('0x24')]);if(_0x25eae4[_0xc008('0x25')]){delete _0x25eae4[_0xc008('0x25')];}_0x3865c0[_0xc008('0x19')](_0x29ba43)['send'](_0x25eae4);};}exports[_0xc008('0x26')]=function(_0x2e0b4e,_0x53ed35){var _0x58db82={},_0x539766={},_0x1032b2={'count':0x0,'rows':[]};var _0x267abd=_[_0xc008('0x27')](db[_0xc008('0x28')][_0xc008('0x29')],function(_0xceebc3){return{'name':_0xceebc3[_0xc008('0x2a')],'type':_0xceebc3[_0xc008('0x2b')][_0xc008('0x2c')]};});_0x539766[_0xc008('0x2d')]=_[_0xc008('0x27')](_0x267abd,_0xc008('0x25'));_0x539766['query']=_[_0xc008('0x2e')](_0x2e0b4e[_0xc008('0x2f')]);_0x539766['filters']=_[_0xc008('0x30')](_0x539766[_0xc008('0x2d')],_0x539766[_0xc008('0x2f')]);_0x58db82[_0xc008('0x31')]=_[_0xc008('0x30')](_0x539766[_0xc008('0x2d')],qs[_0xc008('0x32')](_0x2e0b4e[_0xc008('0x2f')][_0xc008('0x32')]));_0x58db82['attributes']=_0x58db82[_0xc008('0x31')][_0xc008('0x33')]?_0x58db82[_0xc008('0x31')]:_0x539766[_0xc008('0x2d')];if(!_0x2e0b4e[_0xc008('0x2f')][_0xc008('0x34')](_0xc008('0x35'))){_0x58db82['limit']=qs[_0xc008('0x1d')](_0x2e0b4e[_0xc008('0x2f')]['limit']);_0x58db82[_0xc008('0x1b')]=qs[_0xc008('0x1b')](_0x2e0b4e['query'][_0xc008('0x1b')]);}_0x58db82[_0xc008('0x36')]=qs[_0xc008('0x37')](_0x2e0b4e['query']['sort']);_0x58db82['where']=qs[_0xc008('0x38')](_['pick'](_0x2e0b4e[_0xc008('0x2f')],_0x539766[_0xc008('0x38')]),_0x267abd);if(_0x2e0b4e[_0xc008('0x2f')][_0xc008('0x39')]){_0x58db82[_0xc008('0x3a')]=_[_0xc008('0x3b')](_0x58db82[_0xc008('0x3a')],{'$or':_[_0xc008('0x27')](_0x267abd,function(_0xffd2b3){if(_0xffd2b3[_0xc008('0x2b')]!==_0xc008('0x3c')){var _0xdfca2e={};_0xdfca2e[_0xffd2b3[_0xc008('0x25')]]={'$like':'%'+_0x2e0b4e[_0xc008('0x2f')]['filter']+'%'};return _0xdfca2e;}})});}_0x58db82=_[_0xc008('0x3b')]({},_0x58db82,_0x2e0b4e[_0xc008('0x3d')]);var _0x30b7df={'where':_0x58db82[_0xc008('0x3a')]};return db['AnalyticMetric'][_0xc008('0x1e')](_0x30b7df)[_0xc008('0x21')](function(_0xc8cb91){_0x1032b2[_0xc008('0x1e')]=_0xc8cb91;if(_0x2e0b4e[_0xc008('0x2f')]['includeAll']){_0x58db82[_0xc008('0x3e')]=[{'all':!![]}];}return db[_0xc008('0x28')][_0xc008('0x3f')](_0x58db82);})[_0xc008('0x21')](function(_0x7279e8){_0x1032b2['rows']=_0x7279e8;return _0x1032b2;})[_0xc008('0x21')](respondWithFilteredResult(_0x53ed35,_0x58db82))[_0xc008('0x40')](handleError(_0x53ed35,null));};exports[_0xc008('0x41')]=function(_0x408192,_0x4b80f3){var _0x26cd05={'raw':!![],'where':{'id':_0x408192[_0xc008('0x42')]['id']}},_0xe37446={};_0xe37446['model']=_[_0xc008('0x2e')](db['AnalyticMetric'][_0xc008('0x29')]);_0xe37446['query']=_[_0xc008('0x2e')](_0x408192[_0xc008('0x2f')]);_0xe37446['filters']=_[_0xc008('0x30')](_0xe37446[_0xc008('0x2d')],_0xe37446[_0xc008('0x2f')]);_0x26cd05['attributes']=_[_0xc008('0x30')](_0xe37446[_0xc008('0x2d')],qs[_0xc008('0x32')](_0x408192[_0xc008('0x2f')][_0xc008('0x32')]));_0x26cd05[_0xc008('0x31')]=_0x26cd05['attributes']['length']?_0x26cd05['attributes']:_0xe37446[_0xc008('0x2d')];if(_0x408192[_0xc008('0x2f')][_0xc008('0x43')]){_0x26cd05[_0xc008('0x3e')]=[{'all':!![]}];}_0x26cd05=_[_0xc008('0x3b')]({},_0x26cd05,_0x408192[_0xc008('0x3d')]);return db[_0xc008('0x28')][_0xc008('0x44')](_0x26cd05)['then'](handleEntityNotFound(_0x4b80f3,null))['then'](respondWithResult(_0x4b80f3,null))['catch'](handleError(_0x4b80f3,null));};exports[_0xc008('0x45')]=function(_0x2651cf,_0x158eae){return db['AnalyticMetric'][_0xc008('0x45')](_0x2651cf[_0xc008('0x46')],{})[_0xc008('0x21')](function(_0x1c2c50){var _0x4981b4=_0x2651cf[_0xc008('0x47')][_0xc008('0x23')]({'plain':!![]});if(!_0x4981b4)throw new Error(_0xc008('0x48'));if(_0x4981b4[_0xc008('0x49')]===_0xc008('0x47')){var _0x52c444=_0x1c2c50['get']({'plain':!![]});var _0x223056='Metrics';return db[_0xc008('0x4a')][_0xc008('0x44')]({'where':{'name':_0x223056,'userProfileId':_0x4981b4[_0xc008('0x4b')]},'raw':!![]})['then'](function(_0x144ab2){if(_0x144ab2&&_0x144ab2[_0xc008('0x4c')]===0x0){return db[_0xc008('0x4d')][_0xc008('0x45')]({'name':_0x52c444[_0xc008('0x25')],'resourceId':_0x52c444['id'],'type':_0x144ab2['name'],'sectionId':_0x144ab2['id']},{})[_0xc008('0x21')](function(){return _0x1c2c50;});}else{return _0x1c2c50;}})[_0xc008('0x40')](function(_0x4b4c6d){logger[_0xc008('0x4e')](_0xc008('0x4f'),_0x4b4c6d);throw _0x4b4c6d;});}return _0x1c2c50;})['then'](respondWithResult(_0x158eae,0xc9))['catch'](handleError(_0x158eae,null));};exports[_0xc008('0x20')]=function(_0xd47b74,_0x20947b){if(_0xd47b74[_0xc008('0x46')]['id']){delete _0xd47b74[_0xc008('0x46')]['id'];}return db['AnalyticMetric']['find']({'where':{'id':_0xd47b74[_0xc008('0x42')]['id']}})['then'](handleEntityNotFound(_0x20947b,null))[_0xc008('0x21')](saveUpdates(_0xd47b74[_0xc008('0x46')],null))[_0xc008('0x21')](respondWithResult(_0x20947b,null))[_0xc008('0x40')](handleError(_0x20947b,null));};exports[_0xc008('0x22')]=function(_0x27a167,_0x49d8b0){return db[_0xc008('0x28')][_0xc008('0x44')]({'where':{'id':_0x27a167[_0xc008('0x42')]['id']}})[_0xc008('0x21')](handleEntityNotFound(_0x49d8b0,null))[_0xc008('0x21')](removeEntity(_0x49d8b0,null))['catch'](handleError(_0x49d8b0,null));};
\ No newline at end of file
diff --git a/server/api/analyticMetric/analyticMetric.model.js b/server/api/analyticMetric/analyticMetric.model.js
index 8bd46c1..3f13d3e 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 _0x13fe=['lodash','util','../../config/logger','api','moment','bluebird','path','rimraf','../../config/environment','./analyticMetric.attributes','exports','analytics_metrics'];(function(_0x1a7e14,_0x100435){var _0x53abf8=function(_0x4767ab){while(--_0x4767ab){_0x1a7e14['push'](_0x1a7e14['shift']());}};_0x53abf8(++_0x100435);}(_0x13fe,0x138));var _0xe13f=function(_0x6131cd,_0x4c26a1){_0x6131cd=_0x6131cd-0x0;var _0x47e916=_0x13fe[_0x6131cd];return _0x47e916;};'use strict';var _=require(_0xe13f('0x0'));var util=require(_0xe13f('0x1'));var logger=require(_0xe13f('0x2'))(_0xe13f('0x3'));var moment=require(_0xe13f('0x4'));var BPromise=require(_0xe13f('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xe13f('0x6'));var rimraf=require(_0xe13f('0x7'));var config=require(_0xe13f('0x8'));var attributes=require(_0xe13f('0x9'));module[_0xe13f('0xa')]=function(_0x1ddbff,_0x2832ce){return _0x1ddbff['define']('AnalyticMetric',attributes,{'tableName':_0xe13f('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xd206=['util','api','moment','bluebird','path','rimraf','../../config/environment','./analyticMetric.attributes','AnalyticMetric','analytics_metrics','lodash'];(function(_0x36feb2,_0x53abef){var _0x292b43=function(_0x52a460){while(--_0x52a460){_0x36feb2['push'](_0x36feb2['shift']());}};_0x292b43(++_0x53abef);}(_0xd206,0x107));var _0x6d20=function(_0x1a72f3,_0x217011){_0x1a72f3=_0x1a72f3-0x0;var _0x57ef47=_0xd206[_0x1a72f3];return _0x57ef47;};'use strict';var _=require(_0x6d20('0x0'));var util=require(_0x6d20('0x1'));var logger=require('../../config/logger')(_0x6d20('0x2'));var moment=require(_0x6d20('0x3'));var BPromise=require(_0x6d20('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x6d20('0x5'));var rimraf=require(_0x6d20('0x6'));var config=require(_0x6d20('0x7'));var attributes=require(_0x6d20('0x8'));module['exports']=function(_0x467e6e,_0x5c5950){return _0x467e6e['define'](_0x6d20('0x9'),attributes,{'tableName':_0x6d20('0xa'),'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 360e01b..725a10d 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 _0xf450=['stringify','error','code','message','result','lodash','util','randomstring','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','AnalyticMetric,\x20%s,\x20%s','debug','request\x20sent'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0xf450,0xc2));var _0x0f45=function(_0xbca1b1,_0x33f0ce){_0xbca1b1=_0xbca1b1-0x0;var _0x4e1686=_0xf450[_0xbca1b1];return _0x4e1686;};'use strict';var _=require(_0x0f45('0x0'));var util=require(_0x0f45('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x0f45('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x0f45('0x3'));var logger=require(_0x0f45('0x4'))(_0x0f45('0x5'));var config=require(_0x0f45('0x6'));var jayson=require(_0x0f45('0x7'));var client=jayson[_0x0f45('0x8')][_0x0f45('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x4f642f,_0x257cb8,_0x5a059d){return new BPromise(function(_0x32d1de,_0x493a2b){return client[_0x0f45('0xa')](_0x4f642f,_0x5a059d)[_0x0f45('0xb')](function(_0x49d884){logger[_0x0f45('0xc')](_0x0f45('0xd'),_0x257cb8,'request\x20sent');logger[_0x0f45('0xe')]('AnalyticMetric,\x20%s,\x20%s,\x20%s',_0x257cb8,_0x0f45('0xf'),JSON[_0x0f45('0x10')](_0x49d884));if(_0x49d884[_0x0f45('0x11')]){if(_0x49d884[_0x0f45('0x11')][_0x0f45('0x12')]===0x1f4){logger['error'](_0x0f45('0xd'),_0x257cb8,_0x49d884[_0x0f45('0x11')][_0x0f45('0x13')]);return _0x493a2b(_0x49d884[_0x0f45('0x11')][_0x0f45('0x13')]);}logger[_0x0f45('0x11')]('AnalyticMetric,\x20%s,\x20%s',_0x257cb8,_0x49d884[_0x0f45('0x11')][_0x0f45('0x13')]);return _0x32d1de(_0x49d884[_0x0f45('0x11')][_0x0f45('0x13')]);}else{logger['info'](_0x0f45('0xd'),_0x257cb8,_0x0f45('0xf'));_0x32d1de(_0x49d884[_0x0f45('0x14')][_0x0f45('0x13')]);}})['catch'](function(_0x3fe328){logger[_0x0f45('0x11')](_0x0f45('0xd'),_0x257cb8,_0x3fe328);_0x493a2b(_0x3fe328);});});}
\ No newline at end of file
+var _0x82ba=['rpc','../../config/environment','jayson/promise','client','info','AnalyticMetric,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils'];(function(_0x3195f8,_0x3aeeba){var _0x54cd9f=function(_0x2e21d1){while(--_0x2e21d1){_0x3195f8['push'](_0x3195f8['shift']());}};_0x54cd9f(++_0x3aeeba);}(_0x82ba,0x1d9));var _0xa82b=function(_0x2976fe,_0x580e98){_0x2976fe=_0x2976fe-0x0;var _0x4e5f3a=_0x82ba[_0x2976fe];return _0x4e5f3a;};'use strict';var _=require(_0xa82b('0x0'));var util=require('util');var moment=require(_0xa82b('0x1'));var BPromise=require(_0xa82b('0x2'));var rs=require(_0xa82b('0x3'));var fs=require('fs');var Redis=require(_0xa82b('0x4'));var db=require(_0xa82b('0x5'))['db'];var utils=require(_0xa82b('0x6'));var logger=require('../../config/logger')(_0xa82b('0x7'));var config=require(_0xa82b('0x8'));var jayson=require(_0xa82b('0x9'));var client=jayson[_0xa82b('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x4f7420,_0x217a69,_0xb6e9a){return new BPromise(function(_0x51498f,_0x2a2350){return client['request'](_0x4f7420,_0xb6e9a)['then'](function(_0x562e88){logger[_0xa82b('0xb')](_0xa82b('0xc'),_0x217a69,_0xa82b('0xd'));logger[_0xa82b('0xe')]('AnalyticMetric,\x20%s,\x20%s,\x20%s',_0x217a69,_0xa82b('0xd'),JSON[_0xa82b('0xf')](_0x562e88));if(_0x562e88[_0xa82b('0x10')]){if(_0x562e88[_0xa82b('0x10')][_0xa82b('0x11')]===0x1f4){logger[_0xa82b('0x10')](_0xa82b('0xc'),_0x217a69,_0x562e88[_0xa82b('0x10')][_0xa82b('0x12')]);return _0x2a2350(_0x562e88[_0xa82b('0x10')][_0xa82b('0x12')]);}logger[_0xa82b('0x10')](_0xa82b('0xc'),_0x217a69,_0x562e88[_0xa82b('0x10')][_0xa82b('0x12')]);return _0x51498f(_0x562e88[_0xa82b('0x10')][_0xa82b('0x12')]);}else{logger[_0xa82b('0xb')](_0xa82b('0xc'),_0x217a69,_0xa82b('0xd'));_0x51498f(_0x562e88[_0xa82b('0x13')][_0xa82b('0x12')]);}})['catch'](function(_0x17d3d3){logger['error'](_0xa82b('0xc'),_0x217a69,_0x17d3d3);_0x2a2350(_0x17d3d3);});});}
\ No newline at end of file
diff --git a/server/api/analyticMetric/index.js b/server/api/analyticMetric/index.js
index 5eabb43..08c5366 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 _0x7edb=['put','update','delete','exports','util','path','connect-timeout','express','Router','../../components/auth/service','./analyticMetric.controller','get','isAuthenticated','index','/:id','show','post'];(function(_0x259d17,_0x220710){var _0x407535=function(_0x49bc38){while(--_0x49bc38){_0x259d17['push'](_0x259d17['shift']());}};_0x407535(++_0x220710);}(_0x7edb,0x158));var _0xb7ed=function(_0x40d287,_0x42f496){_0x40d287=_0x40d287-0x0;var _0x379218=_0x7edb[_0x40d287];return _0x379218;};'use strict';var multer=require('multer');var util=require(_0xb7ed('0x0'));var path=require(_0xb7ed('0x1'));var timeout=require(_0xb7ed('0x2'));var express=require(_0xb7ed('0x3'));var router=express[_0xb7ed('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0xb7ed('0x5'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0xb7ed('0x6'));router[_0xb7ed('0x7')]('/',auth[_0xb7ed('0x8')](),controller[_0xb7ed('0x9')]);router[_0xb7ed('0x7')](_0xb7ed('0xa'),auth[_0xb7ed('0x8')](),controller[_0xb7ed('0xb')]);router[_0xb7ed('0xc')]('/',auth[_0xb7ed('0x8')](),controller['create']);router[_0xb7ed('0xd')](_0xb7ed('0xa'),auth[_0xb7ed('0x8')](),controller[_0xb7ed('0xe')]);router[_0xb7ed('0xf')](_0xb7ed('0xa'),auth[_0xb7ed('0x8')](),controller['destroy']);module[_0xb7ed('0x10')]=router;
\ No newline at end of file
+var _0x4074=['multer','util','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./analyticMetric.controller','get','isAuthenticated','index','/:id','show','post','update','delete','destroy','exports'];(function(_0x3911fc,_0x5a349f){var _0x51ec85=function(_0x3cfb64){while(--_0x3cfb64){_0x3911fc['push'](_0x3911fc['shift']());}};_0x51ec85(++_0x5a349f);}(_0x4074,0xf0));var _0x4407=function(_0x4183e1,_0x356f98){_0x4183e1=_0x4183e1-0x0;var _0x584196=_0x4074[_0x4183e1];return _0x584196;};'use strict';var multer=require(_0x4407('0x0'));var util=require(_0x4407('0x1'));var path=require(_0x4407('0x2'));var timeout=require('connect-timeout');var express=require(_0x4407('0x3'));var router=express[_0x4407('0x4')]();var fs_extra=require(_0x4407('0x5'));var auth=require(_0x4407('0x6'));var interaction=require(_0x4407('0x7'));var config=require(_0x4407('0x8'));var controller=require(_0x4407('0x9'));router[_0x4407('0xa')]('/',auth[_0x4407('0xb')](),controller[_0x4407('0xc')]);router['get'](_0x4407('0xd'),auth['isAuthenticated'](),controller[_0x4407('0xe')]);router[_0x4407('0xf')]('/',auth[_0x4407('0xb')](),controller['create']);router['put']('/:id',auth[_0x4407('0xb')](),controller[_0x4407('0x10')]);router[_0x4407('0x11')](_0x4407('0xd'),auth[_0x4407('0xb')](),controller[_0x4407('0x12')]);module[_0x4407('0x13')]=router;
\ No newline at end of file
diff --git a/server/api/analyticTreeReport/analyticTreeReport.attributes.js b/server/api/analyticTreeReport/analyticTreeReport.attributes.js
index 6ad17b1..2499027 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 _0x6d66=['sequelize','exports','TEXT'];(function(_0xdf13c9,_0x5da43f){var _0x302aaa=function(_0x42cc73){while(--_0x42cc73){_0xdf13c9['push'](_0xdf13c9['shift']());}};_0x302aaa(++_0x5da43f);}(_0x6d66,0x9c));var _0x66d6=function(_0x56fe43,_0x53383b){_0x56fe43=_0x56fe43-0x0;var _0x50ef2e=_0x6d66[_0x56fe43];return _0x50ef2e;};'use strict';var Sequelize=require(_0x66d6('0x0'));module[_0x66d6('0x1')]={'tree':{'type':Sequelize[_0x66d6('0x2')],'allowNull':![]}};
\ No newline at end of file
+var _0x052c=['exports','TEXT'];(function(_0x57badc,_0x339f5e){var _0xcb0771=function(_0xe7acf9){while(--_0xe7acf9){_0x57badc['push'](_0x57badc['shift']());}};_0xcb0771(++_0x339f5e);}(_0x052c,0x164));var _0xc052=function(_0xe72bea,_0x4b339){_0xe72bea=_0xe72bea-0x0;var _0x888cbc=_0x052c[_0xe72bea];return _0x888cbc;};'use strict';var Sequelize=require('sequelize');module[_0xc052('0x0')]={'tree':{'type':Sequelize[_0xc052('0x1')],'allowNull':![]}};
\ No newline at end of file
diff --git a/server/api/analyticTreeReport/analyticTreeReport.controller.js b/server/api/analyticTreeReport/analyticTreeReport.controller.js
index a885040..c0573e8 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 _0x210e=['then','destroy','sendStatus','stack','name','send','index','map','AnalyticTreeReport','rawAttributes','fieldName','type','key','query','filters','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','catch','params','keys','find','body','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/environment','../../config/license/util','../../mysqldb','status','end','json','offset','undefined','limit','count','set','apply','reject','save'];(function(_0x18afca,_0x4219d9){var _0x11603f=function(_0x21d5d1){while(--_0x21d5d1){_0x18afca['push'](_0x18afca['shift']());}};_0x11603f(++_0x4219d9);}(_0x210e,0x1e9));var _0xe210=function(_0x44d88c,_0x4e0cb4){_0x44d88c=_0x44d88c-0x0;var _0x508da7=_0x210e[_0x44d88c];return _0x508da7;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xe210('0x0'));var zipdir=require(_0xe210('0x1'));var jsonpatch=require(_0xe210('0x2'));var rp=require(_0xe210('0x3'));var moment=require(_0xe210('0x4'));var BPromise=require('bluebird');var Mustache=require(_0xe210('0x5'));var util=require('util');var path=require(_0xe210('0x6'));var sox=require(_0xe210('0x7'));var csv=require(_0xe210('0x8'));var ejs=require(_0xe210('0x9'));var fs=require('fs');var fs_extra=require(_0xe210('0xa'));var _=require(_0xe210('0xb'));var squel=require(_0xe210('0xc'));var crypto=require(_0xe210('0xd'));var jsforce=require(_0xe210('0xe'));var deskjs=require(_0xe210('0xf'));var toCsv=require(_0xe210('0x8'));var querystring=require('querystring');var Papa=require(_0xe210('0x10'));var Redis=require(_0xe210('0x11'));var authService=require('../../components/auth/service');var qs=require(_0xe210('0x12'));var as=require(_0xe210('0x13'));var hardwareService=require(_0xe210('0x14'));var logger=require(_0xe210('0x15'))('api');var utils=require('../../config/utils');var config=require(_0xe210('0x16'));var licenseUtil=require(_0xe210('0x17'));var db=require(_0xe210('0x18'))['db'];function respondWithStatusCode(_0x243c44,_0x3bba66){_0x3bba66=_0x3bba66||0xcc;return function(_0x577e9d){if(_0x577e9d){return _0x243c44['sendStatus'](_0x3bba66);}return _0x243c44[_0xe210('0x19')](_0x3bba66)[_0xe210('0x1a')]();};}function respondWithResult(_0x13c3f5,_0x43f30f){_0x43f30f=_0x43f30f||0xc8;return function(_0x1c5d11){if(_0x1c5d11){return _0x13c3f5[_0xe210('0x19')](_0x43f30f)[_0xe210('0x1b')](_0x1c5d11);}};}function respondWithFilteredResult(_0x1cc418,_0x17bcd6){return function(_0x2cb917){if(_0x2cb917){var _0x2df8db=typeof _0x17bcd6[_0xe210('0x1c')]===_0xe210('0x1d')&&typeof _0x17bcd6[_0xe210('0x1e')]===_0xe210('0x1d');var _0xd5eab1=_0x2cb917[_0xe210('0x1f')];var _0x50de63=_0x2df8db?0x0:_0x17bcd6[_0xe210('0x1c')];var _0x5447d8=_0x2df8db?_0x2cb917[_0xe210('0x1f')]:_0x17bcd6[_0xe210('0x1c')]+_0x17bcd6['limit'];var _0x4d3e86;if(_0x5447d8>=_0xd5eab1){_0x5447d8=_0xd5eab1;_0x4d3e86=0xc8;}else{_0x4d3e86=0xce;}_0x1cc418['status'](_0x4d3e86);return _0x1cc418[_0xe210('0x20')]('Content-Range',_0x50de63+'-'+_0x5447d8+'/'+_0xd5eab1)[_0xe210('0x1b')](_0x2cb917);}return null;};}function patchUpdates(_0x4aad1c){return function(_0x24a890){try{jsonpatch[_0xe210('0x21')](_0x24a890,_0x4aad1c,!![]);}catch(_0x277324){return BPromise[_0xe210('0x22')](_0x277324);}return _0x24a890[_0xe210('0x23')]();};}function saveUpdates(_0x3caea8,_0x27cca6){return function(_0x46c121){if(_0x46c121){return _0x46c121['update'](_0x3caea8)[_0xe210('0x24')](function(_0x24ee94){return _0x24ee94;});}return null;};}function removeEntity(_0x32d468,_0xe71a81){return function(_0x4b109e){if(_0x4b109e){return _0x4b109e[_0xe210('0x25')]()[_0xe210('0x24')](function(){_0x32d468[_0xe210('0x19')](0xcc)[_0xe210('0x1a')]();});}};}function handleEntityNotFound(_0x59c384,_0x5166ee){return function(_0xa7d1d5){if(!_0xa7d1d5){_0x59c384[_0xe210('0x26')](0x194);}return _0xa7d1d5;};}function handleError(_0x4e725a,_0xe0d0a4){_0xe0d0a4=_0xe0d0a4||0x1f4;return function(_0x34e971){logger['error'](_0x34e971[_0xe210('0x27')]);if(_0x34e971['name']){delete _0x34e971[_0xe210('0x28')];}_0x4e725a[_0xe210('0x19')](_0xe0d0a4)[_0xe210('0x29')](_0x34e971);};}exports[_0xe210('0x2a')]=function(_0x3213d1,_0x410aab){var _0xcf7a34={},_0x3b13dd={},_0x38d623={'count':0x0,'rows':[]};var _0xcb21c4=_[_0xe210('0x2b')](db[_0xe210('0x2c')][_0xe210('0x2d')],function(_0x88c865){return{'name':_0x88c865[_0xe210('0x2e')],'type':_0x88c865[_0xe210('0x2f')][_0xe210('0x30')]};});_0x3b13dd['model']=_['map'](_0xcb21c4,'name');_0x3b13dd['query']=_['keys'](_0x3213d1[_0xe210('0x31')]);_0x3b13dd[_0xe210('0x32')]=_[_0xe210('0x33')](_0x3b13dd[_0xe210('0x34')],_0x3b13dd[_0xe210('0x31')]);_0xcf7a34[_0xe210('0x35')]=_[_0xe210('0x33')](_0x3b13dd[_0xe210('0x34')],qs[_0xe210('0x36')](_0x3213d1['query'][_0xe210('0x36')]));_0xcf7a34[_0xe210('0x35')]=_0xcf7a34[_0xe210('0x35')][_0xe210('0x37')]?_0xcf7a34[_0xe210('0x35')]:_0x3b13dd['model'];if(!_0x3213d1[_0xe210('0x31')][_0xe210('0x38')](_0xe210('0x39'))){_0xcf7a34['limit']=qs['limit'](_0x3213d1[_0xe210('0x31')][_0xe210('0x1e')]);_0xcf7a34[_0xe210('0x1c')]=qs[_0xe210('0x1c')](_0x3213d1[_0xe210('0x31')][_0xe210('0x1c')]);}_0xcf7a34[_0xe210('0x3a')]=qs[_0xe210('0x3b')](_0x3213d1[_0xe210('0x31')][_0xe210('0x3b')]);_0xcf7a34[_0xe210('0x3c')]=qs[_0xe210('0x32')](_[_0xe210('0x3d')](_0x3213d1['query'],_0x3b13dd['filters']),_0xcb21c4);if(_0x3213d1[_0xe210('0x31')][_0xe210('0x3e')]){_0xcf7a34['where']=_[_0xe210('0x3f')](_0xcf7a34['where'],{'$or':_['map'](_0xcb21c4,function(_0x41380a){if(_0x41380a[_0xe210('0x2f')]!==_0xe210('0x40')){var _0x36bc9b={};_0x36bc9b[_0x41380a[_0xe210('0x28')]]={'$like':'%'+_0x3213d1[_0xe210('0x31')][_0xe210('0x3e')]+'%'};return _0x36bc9b;}})});}_0xcf7a34=_['merge']({},_0xcf7a34,_0x3213d1[_0xe210('0x41')]);var _0x339db8={'where':_0xcf7a34[_0xe210('0x3c')]};return db[_0xe210('0x2c')][_0xe210('0x1f')](_0x339db8)[_0xe210('0x24')](function(_0x259a09){_0x38d623['count']=_0x259a09;if(_0x3213d1[_0xe210('0x31')][_0xe210('0x42')]){_0xcf7a34[_0xe210('0x43')]=[{'all':!![]}];}return db[_0xe210('0x2c')][_0xe210('0x44')](_0xcf7a34);})['then'](function(_0x1346c4){_0x38d623[_0xe210('0x45')]=_0x1346c4;return _0x38d623;})[_0xe210('0x24')](respondWithFilteredResult(_0x410aab,_0xcf7a34))[_0xe210('0x46')](handleError(_0x410aab,null));};exports['show']=function(_0x2ec39f,_0x178a4a){var _0x4926b8={'raw':!![],'where':{'id':_0x2ec39f[_0xe210('0x47')]['id']}},_0x435a7e={};_0x435a7e['model']=_[_0xe210('0x48')](db['AnalyticTreeReport'][_0xe210('0x2d')]);_0x435a7e[_0xe210('0x31')]=_['keys'](_0x2ec39f[_0xe210('0x31')]);_0x435a7e[_0xe210('0x32')]=_[_0xe210('0x33')](_0x435a7e['model'],_0x435a7e[_0xe210('0x31')]);_0x4926b8[_0xe210('0x35')]=_['intersection'](_0x435a7e[_0xe210('0x34')],qs[_0xe210('0x36')](_0x2ec39f[_0xe210('0x31')][_0xe210('0x36')]));_0x4926b8[_0xe210('0x35')]=_0x4926b8[_0xe210('0x35')][_0xe210('0x37')]?_0x4926b8[_0xe210('0x35')]:_0x435a7e['model'];if(_0x2ec39f[_0xe210('0x31')][_0xe210('0x42')]){_0x4926b8[_0xe210('0x43')]=[{'all':!![]}];}_0x4926b8=_['merge']({},_0x4926b8,_0x2ec39f[_0xe210('0x41')]);return db['AnalyticTreeReport'][_0xe210('0x49')](_0x4926b8)['then'](handleEntityNotFound(_0x178a4a,null))[_0xe210('0x24')](respondWithResult(_0x178a4a,null))[_0xe210('0x46')](handleError(_0x178a4a,null));};exports['create']=function(_0x12c0a0,_0x383795){return db[_0xe210('0x2c')]['create'](_0x12c0a0[_0xe210('0x4a')],{})[_0xe210('0x24')](respondWithResult(_0x383795,0xc9))[_0xe210('0x46')](handleError(_0x383795,null));};exports['update']=function(_0x404b11,_0x514d48){if(_0x404b11['body']['id']){delete _0x404b11[_0xe210('0x4a')]['id'];}return db[_0xe210('0x2c')][_0xe210('0x49')]({'where':{'id':_0x404b11[_0xe210('0x47')]['id']}})['then'](handleEntityNotFound(_0x514d48,null))['then'](saveUpdates(_0x404b11[_0xe210('0x4a')],null))[_0xe210('0x24')](respondWithResult(_0x514d48,null))[_0xe210('0x46')](handleError(_0x514d48,null));};exports[_0xe210('0x25')]=function(_0x634f3f,_0x44e7d5){return db[_0xe210('0x2c')]['find']({'where':{'id':_0x634f3f['params']['id']}})[_0xe210('0x24')](handleEntityNotFound(_0x44e7d5,null))[_0xe210('0x24')](removeEntity(_0x44e7d5,null))[_0xe210('0x46')](handleError(_0x44e7d5,null));};
\ No newline at end of file
+var _0x5c3e=['end','json','undefined','limit','offset','count','status','set','Content-Range','reject','update','then','destroy','error','stack','name','send','index','fieldName','type','key','model','query','filters','fields','attributes','length','hasOwnProperty','nolimit','sort','where','merge','map','VIRTUAL','filter','AnalyticTreeReport','includeAll','include','findAll','rows','catch','show','params','rawAttributes','keys','intersection','options','find','create','body','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/utils','../../config/environment','../../mysqldb','sendStatus'];(function(_0x2a8a31,_0x5e551b){var _0x2c199e=function(_0x404738){while(--_0x404738){_0x2a8a31['push'](_0x2a8a31['shift']());}};_0x2c199e(++_0x5e551b);}(_0x5c3e,0xcc));var _0xe5c3=function(_0x46fe5a,_0xfcf004){_0x46fe5a=_0x46fe5a-0x0;var _0x3a7771=_0x5c3e[_0x46fe5a];return _0x3a7771;};'use strict';var emlformat=require(_0xe5c3('0x0'));var rimraf=require(_0xe5c3('0x1'));var zipdir=require(_0xe5c3('0x2'));var jsonpatch=require(_0xe5c3('0x3'));var rp=require(_0xe5c3('0x4'));var moment=require(_0xe5c3('0x5'));var BPromise=require(_0xe5c3('0x6'));var Mustache=require(_0xe5c3('0x7'));var util=require(_0xe5c3('0x8'));var path=require('path');var sox=require(_0xe5c3('0x9'));var csv=require(_0xe5c3('0xa'));var ejs=require(_0xe5c3('0xb'));var fs=require('fs');var fs_extra=require(_0xe5c3('0xc'));var _=require(_0xe5c3('0xd'));var squel=require(_0xe5c3('0xe'));var crypto=require('crypto');var jsforce=require(_0xe5c3('0xf'));var deskjs=require(_0xe5c3('0x10'));var toCsv=require(_0xe5c3('0xa'));var querystring=require('querystring');var Papa=require(_0xe5c3('0x11'));var Redis=require(_0xe5c3('0x12'));var authService=require(_0xe5c3('0x13'));var qs=require(_0xe5c3('0x14'));var as=require(_0xe5c3('0x15'));var hardwareService=require(_0xe5c3('0x16'));var logger=require('../../config/logger')('api');var utils=require(_0xe5c3('0x17'));var config=require(_0xe5c3('0x18'));var licenseUtil=require('../../config/license/util');var db=require(_0xe5c3('0x19'))['db'];function respondWithStatusCode(_0x39d36b,_0x322964){_0x322964=_0x322964||0xcc;return function(_0x4d4113){if(_0x4d4113){return _0x39d36b[_0xe5c3('0x1a')](_0x322964);}return _0x39d36b['status'](_0x322964)[_0xe5c3('0x1b')]();};}function respondWithResult(_0xd4489e,_0x48740b){_0x48740b=_0x48740b||0xc8;return function(_0xf2e140){if(_0xf2e140){return _0xd4489e['status'](_0x48740b)[_0xe5c3('0x1c')](_0xf2e140);}};}function respondWithFilteredResult(_0x408fbe,_0x3eb0d8){return function(_0x106614){if(_0x106614){var _0x3b10f4=typeof _0x3eb0d8['offset']===_0xe5c3('0x1d')&&typeof _0x3eb0d8[_0xe5c3('0x1e')]===_0xe5c3('0x1d');var _0x20f332=_0x106614['count'];var _0xb27688=_0x3b10f4?0x0:_0x3eb0d8[_0xe5c3('0x1f')];var _0x426d52=_0x3b10f4?_0x106614[_0xe5c3('0x20')]:_0x3eb0d8['offset']+_0x3eb0d8['limit'];var _0x295e82;if(_0x426d52>=_0x20f332){_0x426d52=_0x20f332;_0x295e82=0xc8;}else{_0x295e82=0xce;}_0x408fbe[_0xe5c3('0x21')](_0x295e82);return _0x408fbe[_0xe5c3('0x22')](_0xe5c3('0x23'),_0xb27688+'-'+_0x426d52+'/'+_0x20f332)[_0xe5c3('0x1c')](_0x106614);}return null;};}function patchUpdates(_0x260578){return function(_0x49fe57){try{jsonpatch['apply'](_0x49fe57,_0x260578,!![]);}catch(_0x11d046){return BPromise[_0xe5c3('0x24')](_0x11d046);}return _0x49fe57['save']();};}function saveUpdates(_0x2dd487,_0x1f4c8e){return function(_0x58b07e){if(_0x58b07e){return _0x58b07e[_0xe5c3('0x25')](_0x2dd487)[_0xe5c3('0x26')](function(_0x3b4660){return _0x3b4660;});}return null;};}function removeEntity(_0x154498,_0x37c34f){return function(_0x42b082){if(_0x42b082){return _0x42b082[_0xe5c3('0x27')]()['then'](function(){_0x154498['status'](0xcc)[_0xe5c3('0x1b')]();});}};}function handleEntityNotFound(_0x28e5bf,_0x375841){return function(_0x44c9b2){if(!_0x44c9b2){_0x28e5bf[_0xe5c3('0x1a')](0x194);}return _0x44c9b2;};}function handleError(_0x2e1b35,_0x3e136b){_0x3e136b=_0x3e136b||0x1f4;return function(_0x238366){logger[_0xe5c3('0x28')](_0x238366[_0xe5c3('0x29')]);if(_0x238366[_0xe5c3('0x2a')]){delete _0x238366['name'];}_0x2e1b35[_0xe5c3('0x21')](_0x3e136b)[_0xe5c3('0x2b')](_0x238366);};}exports[_0xe5c3('0x2c')]=function(_0x2e0966,_0x518af9){var _0x1c8323={},_0x5d6b36={},_0x563a60={'count':0x0,'rows':[]};var _0x59399f=_['map'](db['AnalyticTreeReport']['rawAttributes'],function(_0x1b275){return{'name':_0x1b275[_0xe5c3('0x2d')],'type':_0x1b275[_0xe5c3('0x2e')][_0xe5c3('0x2f')]};});_0x5d6b36[_0xe5c3('0x30')]=_['map'](_0x59399f,_0xe5c3('0x2a'));_0x5d6b36[_0xe5c3('0x31')]=_['keys'](_0x2e0966[_0xe5c3('0x31')]);_0x5d6b36[_0xe5c3('0x32')]=_['intersection'](_0x5d6b36[_0xe5c3('0x30')],_0x5d6b36[_0xe5c3('0x31')]);_0x1c8323['attributes']=_['intersection'](_0x5d6b36[_0xe5c3('0x30')],qs[_0xe5c3('0x33')](_0x2e0966[_0xe5c3('0x31')]['fields']));_0x1c8323[_0xe5c3('0x34')]=_0x1c8323['attributes'][_0xe5c3('0x35')]?_0x1c8323[_0xe5c3('0x34')]:_0x5d6b36[_0xe5c3('0x30')];if(!_0x2e0966[_0xe5c3('0x31')][_0xe5c3('0x36')](_0xe5c3('0x37'))){_0x1c8323[_0xe5c3('0x1e')]=qs[_0xe5c3('0x1e')](_0x2e0966['query'][_0xe5c3('0x1e')]);_0x1c8323['offset']=qs[_0xe5c3('0x1f')](_0x2e0966[_0xe5c3('0x31')][_0xe5c3('0x1f')]);}_0x1c8323['order']=qs['sort'](_0x2e0966[_0xe5c3('0x31')][_0xe5c3('0x38')]);_0x1c8323['where']=qs[_0xe5c3('0x32')](_['pick'](_0x2e0966[_0xe5c3('0x31')],_0x5d6b36[_0xe5c3('0x32')]),_0x59399f);if(_0x2e0966[_0xe5c3('0x31')]['filter']){_0x1c8323[_0xe5c3('0x39')]=_[_0xe5c3('0x3a')](_0x1c8323[_0xe5c3('0x39')],{'$or':_[_0xe5c3('0x3b')](_0x59399f,function(_0x8138de){if(_0x8138de[_0xe5c3('0x2e')]!==_0xe5c3('0x3c')){var _0x3bb138={};_0x3bb138[_0x8138de[_0xe5c3('0x2a')]]={'$like':'%'+_0x2e0966['query'][_0xe5c3('0x3d')]+'%'};return _0x3bb138;}})});}_0x1c8323=_[_0xe5c3('0x3a')]({},_0x1c8323,_0x2e0966['options']);var _0x5c8cde={'where':_0x1c8323[_0xe5c3('0x39')]};return db[_0xe5c3('0x3e')][_0xe5c3('0x20')](_0x5c8cde)[_0xe5c3('0x26')](function(_0x50b388){_0x563a60[_0xe5c3('0x20')]=_0x50b388;if(_0x2e0966['query'][_0xe5c3('0x3f')]){_0x1c8323[_0xe5c3('0x40')]=[{'all':!![]}];}return db[_0xe5c3('0x3e')][_0xe5c3('0x41')](_0x1c8323);})[_0xe5c3('0x26')](function(_0x36eaa1){_0x563a60[_0xe5c3('0x42')]=_0x36eaa1;return _0x563a60;})[_0xe5c3('0x26')](respondWithFilteredResult(_0x518af9,_0x1c8323))[_0xe5c3('0x43')](handleError(_0x518af9,null));};exports[_0xe5c3('0x44')]=function(_0x3a436f,_0x20e3e6){var _0x4e7d5f={'raw':!![],'where':{'id':_0x3a436f[_0xe5c3('0x45')]['id']}},_0x12938a={};_0x12938a[_0xe5c3('0x30')]=_['keys'](db[_0xe5c3('0x3e')][_0xe5c3('0x46')]);_0x12938a['query']=_[_0xe5c3('0x47')](_0x3a436f['query']);_0x12938a[_0xe5c3('0x32')]=_[_0xe5c3('0x48')](_0x12938a['model'],_0x12938a['query']);_0x4e7d5f['attributes']=_[_0xe5c3('0x48')](_0x12938a[_0xe5c3('0x30')],qs[_0xe5c3('0x33')](_0x3a436f[_0xe5c3('0x31')][_0xe5c3('0x33')]));_0x4e7d5f[_0xe5c3('0x34')]=_0x4e7d5f[_0xe5c3('0x34')][_0xe5c3('0x35')]?_0x4e7d5f['attributes']:_0x12938a[_0xe5c3('0x30')];if(_0x3a436f[_0xe5c3('0x31')][_0xe5c3('0x3f')]){_0x4e7d5f[_0xe5c3('0x40')]=[{'all':!![]}];}_0x4e7d5f=_[_0xe5c3('0x3a')]({},_0x4e7d5f,_0x3a436f[_0xe5c3('0x49')]);return db[_0xe5c3('0x3e')][_0xe5c3('0x4a')](_0x4e7d5f)['then'](handleEntityNotFound(_0x20e3e6,null))[_0xe5c3('0x26')](respondWithResult(_0x20e3e6,null))[_0xe5c3('0x43')](handleError(_0x20e3e6,null));};exports[_0xe5c3('0x4b')]=function(_0x31f8df,_0x328fc1){return db[_0xe5c3('0x3e')][_0xe5c3('0x4b')](_0x31f8df['body'],{})[_0xe5c3('0x26')](respondWithResult(_0x328fc1,0xc9))[_0xe5c3('0x43')](handleError(_0x328fc1,null));};exports['update']=function(_0x48d6e8,_0x3ac483){if(_0x48d6e8[_0xe5c3('0x4c')]['id']){delete _0x48d6e8['body']['id'];}return db[_0xe5c3('0x3e')][_0xe5c3('0x4a')]({'where':{'id':_0x48d6e8[_0xe5c3('0x45')]['id']}})[_0xe5c3('0x26')](handleEntityNotFound(_0x3ac483,null))[_0xe5c3('0x26')](saveUpdates(_0x48d6e8[_0xe5c3('0x4c')],null))[_0xe5c3('0x26')](respondWithResult(_0x3ac483,null))[_0xe5c3('0x43')](handleError(_0x3ac483,null));};exports[_0xe5c3('0x27')]=function(_0xff23fc,_0x53b8e6){return db[_0xe5c3('0x3e')][_0xe5c3('0x4a')]({'where':{'id':_0xff23fc[_0xe5c3('0x45')]['id']}})['then'](handleEntityNotFound(_0x53b8e6,null))[_0xe5c3('0x26')](removeEntity(_0x53b8e6,null))[_0xe5c3('0x43')](handleError(_0x53b8e6,null));};
\ No newline at end of file
diff --git a/server/api/analyticTreeReport/analyticTreeReport.model.js b/server/api/analyticTreeReport/analyticTreeReport.model.js
index 7d6fb38..1f29a3c 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 _0x1dd1=['bluebird','request-promise','path','rimraf','../../config/environment','define','analytics_report_trees','lodash','util','../../config/logger','moment'];(function(_0x13ced3,_0x529a2a){var _0x43897f=function(_0x135f1c){while(--_0x135f1c){_0x13ced3['push'](_0x13ced3['shift']());}};_0x43897f(++_0x529a2a);}(_0x1dd1,0x1eb));var _0x11dd=function(_0x3c834d,_0x4f9feb){_0x3c834d=_0x3c834d-0x0;var _0x508ff4=_0x1dd1[_0x3c834d];return _0x508ff4;};'use strict';var _=require(_0x11dd('0x0'));var util=require(_0x11dd('0x1'));var logger=require(_0x11dd('0x2'))('api');var moment=require(_0x11dd('0x3'));var BPromise=require(_0x11dd('0x4'));var rp=require(_0x11dd('0x5'));var fs=require('fs');var path=require(_0x11dd('0x6'));var rimraf=require(_0x11dd('0x7'));var config=require(_0x11dd('0x8'));var attributes=require('./analyticTreeReport.attributes');module['exports']=function(_0xd3434b,_0x55e37f){return _0xd3434b[_0x11dd('0x9')]('AnalyticTreeReport',attributes,{'tableName':_0x11dd('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x1f0f=['../../config/logger','api','moment','request-promise','rimraf','../../config/environment','exports','AnalyticTreeReport'];(function(_0x22428b,_0x452081){var _0x32e841=function(_0x19f153){while(--_0x19f153){_0x22428b['push'](_0x22428b['shift']());}};_0x32e841(++_0x452081);}(_0x1f0f,0xd8));var _0xf1f0=function(_0x20f2d4,_0x3c653d){_0x20f2d4=_0x20f2d4-0x0;var _0x35a95c=_0x1f0f[_0x20f2d4];return _0x35a95c;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0xf1f0('0x0'))(_0xf1f0('0x1'));var moment=require(_0xf1f0('0x2'));var BPromise=require('bluebird');var rp=require(_0xf1f0('0x3'));var fs=require('fs');var path=require('path');var rimraf=require(_0xf1f0('0x4'));var config=require(_0xf1f0('0x5'));var attributes=require('./analyticTreeReport.attributes');module[_0xf1f0('0x6')]=function(_0x5883af,_0x1a4668){return _0x5883af['define'](_0xf1f0('0x7'),attributes,{'tableName':'analytics_report_trees','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 9d2af9d..b54d678 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(_0x156734,_0x14351b){var _0x3565a3=function(_0xc7e906){while(--_0xc7e906){_0x156734['push'](_0x156734['shift']());}};_0x3565a3(++_0x14351b);}(_0xdb28,0x106));var _0x8db2=function(_0x46bfe0,_0x55b1ca){_0x46bfe0=_0x46bfe0-0x0;var _0x9a062f=_0xdb28[_0x46bfe0];return _0x9a062f;};'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 _0x7a54=['info','AnalyticTreeReport,\x20%s,\x20%s','debug','stringify','error','code','message','request\x20sent','result','catch','lodash','util','moment','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http'];(function(_0x4b369d,_0x265eb8){var _0x571a98=function(_0x56341a){while(--_0x56341a){_0x4b369d['push'](_0x4b369d['shift']());}};_0x571a98(++_0x265eb8);}(_0x7a54,0x106));var _0x47a5=function(_0x4f2422,_0x4912b1){_0x4f2422=_0x4f2422-0x0;var _0x542977=_0x7a54[_0x4f2422];return _0x542977;};'use strict';var _=require(_0x47a5('0x0'));var util=require(_0x47a5('0x1'));var moment=require(_0x47a5('0x2'));var BPromise=require('bluebird');var rs=require(_0x47a5('0x3'));var fs=require('fs');var Redis=require(_0x47a5('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x47a5('0x5'));var logger=require(_0x47a5('0x6'))(_0x47a5('0x7'));var config=require(_0x47a5('0x8'));var jayson=require(_0x47a5('0x9'));var client=jayson['client'][_0x47a5('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x59199c,_0x343372,_0x30e405){return new BPromise(function(_0x506eda,_0x194fb0){return client['request'](_0x59199c,_0x30e405)['then'](function(_0x582352){logger[_0x47a5('0xb')](_0x47a5('0xc'),_0x343372,'request\x20sent');logger[_0x47a5('0xd')]('AnalyticTreeReport,\x20%s,\x20%s,\x20%s',_0x343372,'request\x20sent',JSON[_0x47a5('0xe')](_0x582352));if(_0x582352[_0x47a5('0xf')]){if(_0x582352[_0x47a5('0xf')][_0x47a5('0x10')]===0x1f4){logger[_0x47a5('0xf')](_0x47a5('0xc'),_0x343372,_0x582352[_0x47a5('0xf')]['message']);return _0x194fb0(_0x582352[_0x47a5('0xf')][_0x47a5('0x11')]);}logger[_0x47a5('0xf')](_0x47a5('0xc'),_0x343372,_0x582352[_0x47a5('0xf')][_0x47a5('0x11')]);return _0x506eda(_0x582352[_0x47a5('0xf')][_0x47a5('0x11')]);}else{logger['info'](_0x47a5('0xc'),_0x343372,_0x47a5('0x12'));_0x506eda(_0x582352[_0x47a5('0x13')][_0x47a5('0x11')]);}})[_0x47a5('0x14')](function(_0x574af6){logger['error'](_0x47a5('0xc'),_0x343372,_0x574af6);_0x194fb0(_0x574af6);});});}
\ No newline at end of file
diff --git a/server/api/analyticTreeReport/index.js b/server/api/analyticTreeReport/index.js
index 4382dc3..afdad96 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 _0xcf97=['/:id','show','post','create','put','update','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','./analyticTreeReport.controller','get','isAuthenticated','index'];(function(_0x5ada9e,_0x2ef5a7){var _0x48f5a8=function(_0x45d089){while(--_0x45d089){_0x5ada9e['push'](_0x5ada9e['shift']());}};_0x48f5a8(++_0x2ef5a7);}(_0xcf97,0x1d7));var _0x7cf9=function(_0x5a3cf0,_0x160a68){_0x5a3cf0=_0x5a3cf0-0x0;var _0x5a64ee=_0xcf97[_0x5a3cf0];return _0x5a64ee;};'use strict';var multer=require(_0x7cf9('0x0'));var util=require(_0x7cf9('0x1'));var path=require(_0x7cf9('0x2'));var timeout=require(_0x7cf9('0x3'));var express=require(_0x7cf9('0x4'));var router=express[_0x7cf9('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0x7cf9('0x6'));var interaction=require(_0x7cf9('0x7'));var config=require('../../config/environment');var controller=require(_0x7cf9('0x8'));router[_0x7cf9('0x9')]('/',auth[_0x7cf9('0xa')](),controller[_0x7cf9('0xb')]);router[_0x7cf9('0x9')](_0x7cf9('0xc'),auth[_0x7cf9('0xa')](),controller[_0x7cf9('0xd')]);router[_0x7cf9('0xe')]('/',auth[_0x7cf9('0xa')](),controller[_0x7cf9('0xf')]);router[_0x7cf9('0x10')](_0x7cf9('0xc'),auth[_0x7cf9('0xa')](),controller[_0x7cf9('0x11')]);router[_0x7cf9('0x12')](_0x7cf9('0xc'),auth['isAuthenticated'](),controller[_0x7cf9('0x13')]);module[_0x7cf9('0x14')]=router;
\ No newline at end of file
+var _0x693b=['../../config/environment','./analyticTreeReport.controller','get','/:id','isAuthenticated','post','create','put','update','delete','destroy','multer','util','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service'];(function(_0xa8369a,_0x3d2319){var _0x4b74b7=function(_0x11d138){while(--_0x11d138){_0xa8369a['push'](_0xa8369a['shift']());}};_0x4b74b7(++_0x3d2319);}(_0x693b,0x9b));var _0xb693=function(_0x46aa51,_0x2aba08){_0x46aa51=_0x46aa51-0x0;var _0x5b07a5=_0x693b[_0x46aa51];return _0x5b07a5;};'use strict';var multer=require(_0xb693('0x0'));var util=require(_0xb693('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0xb693('0x2'));var router=express[_0xb693('0x3')]();var fs_extra=require(_0xb693('0x4'));var auth=require(_0xb693('0x5'));var interaction=require(_0xb693('0x6'));var config=require(_0xb693('0x7'));var controller=require(_0xb693('0x8'));router['get']('/',auth['isAuthenticated'](),controller['index']);router[_0xb693('0x9')](_0xb693('0xa'),auth[_0xb693('0xb')](),controller['show']);router[_0xb693('0xc')]('/',auth[_0xb693('0xb')](),controller[_0xb693('0xd')]);router[_0xb693('0xe')](_0xb693('0xa'),auth[_0xb693('0xb')](),controller[_0xb693('0xf')]);router[_0xb693('0x10')](_0xb693('0xa'),auth['isAuthenticated'](),controller[_0xb693('0x11')]);module['exports']=router;
\ No newline at end of file
diff --git a/server/api/attachment/attachment.attributes.js b/server/api/attachment/attachment.attributes.js
index c047319..fe81616 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 _0x05b0=['STRING'];(function(_0x2471c0,_0x87358){var _0x3843c1=function(_0xcdf8ed){while(--_0xcdf8ed){_0x2471c0['push'](_0x2471c0['shift']());}};_0x3843c1(++_0x87358);}(_0x05b0,0x188));var _0x005b=function(_0x5c64d3,_0x47d863){_0x5c64d3=_0x5c64d3-0x0;var _0x4ead44=_0x05b0[_0x5c64d3];return _0x4ead44;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize[_0x005b('0x0')]},'basename':{'type':Sequelize[_0x005b('0x0')]},'type':{'type':Sequelize['STRING']}};
\ No newline at end of file
+var _0xfd7b=['STRING','exports'];(function(_0x4876dc,_0x3a8c80){var _0x2e22a5=function(_0x3a79a2){while(--_0x3a79a2){_0x4876dc['push'](_0x4876dc['shift']());}};_0x2e22a5(++_0x3a8c80);}(_0xfd7b,0x1df));var _0xbfd7=function(_0x37c22c,_0x28a70d){_0x37c22c=_0x37c22c-0x0;var _0x119d79=_0xfd7b[_0x37c22c];return _0x119d79;};'use strict';var Sequelize=require('sequelize');module[_0xbfd7('0x0')]={'name':{'type':Sequelize[_0xbfd7('0x1')]},'basename':{'type':Sequelize[_0xbfd7('0x1')]},'type':{'type':Sequelize[_0xbfd7('0x1')]}};
\ No newline at end of file
diff --git a/server/api/attachment/attachment.controller.js b/server/api/attachment/attachment.controller.js
index 6af4ecb..0c86f8d 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 _0xd9fc=['mustache','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','apply','update','then','destroy','error','stack','name','index','map','rawAttributes','type','model','query','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filters','pick','filter','merge','VIRTUAL','options','Attachment','include','findAll','catch','show','keys','includeAll','find','params','createdAt','updatedAt','body','create','originalname','basename','file','filename','mimetype','download','findOne','ChatOfflineMessageId','offline-chat/','join','eml-format','rimraf','zip-dir','request-promise','moment'];(function(_0x1376d9,_0x55674d){var _0x52ef9c=function(_0x43265a){while(--_0x43265a){_0x1376d9['push'](_0x1376d9['shift']());}};_0x52ef9c(++_0x55674d);}(_0xd9fc,0x1a4));var _0xcd9f=function(_0x5ac654,_0x117532){_0x5ac654=_0x5ac654-0x0;var _0x3a47e7=_0xd9fc[_0x5ac654];return _0x3a47e7;};'use strict';var emlformat=require(_0xcd9f('0x0'));var rimraf=require(_0xcd9f('0x1'));var zipdir=require(_0xcd9f('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xcd9f('0x3'));var moment=require(_0xcd9f('0x4'));var BPromise=require('bluebird');var Mustache=require(_0xcd9f('0x5'));var util=require('util');var path=require(_0xcd9f('0x6'));var sox=require(_0xcd9f('0x7'));var csv=require(_0xcd9f('0x8'));var ejs=require(_0xcd9f('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xcd9f('0xa'));var squel=require(_0xcd9f('0xb'));var crypto=require(_0xcd9f('0xc'));var jsforce=require(_0xcd9f('0xd'));var deskjs=require(_0xcd9f('0xe'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0xcd9f('0xf'));var authService=require(_0xcd9f('0x10'));var qs=require(_0xcd9f('0x11'));var as=require(_0xcd9f('0x12'));var hardwareService=require(_0xcd9f('0x13'));var logger=require(_0xcd9f('0x14'))(_0xcd9f('0x15'));var utils=require(_0xcd9f('0x16'));var config=require('../../config/environment');var licenseUtil=require(_0xcd9f('0x17'));var db=require(_0xcd9f('0x18'))['db'];function respondWithStatusCode(_0x458c1c,_0x4fbce6){_0x4fbce6=_0x4fbce6||0xcc;return function(_0x405a32){if(_0x405a32){return _0x458c1c[_0xcd9f('0x19')](_0x4fbce6);}return _0x458c1c[_0xcd9f('0x1a')](_0x4fbce6)[_0xcd9f('0x1b')]();};}function respondWithResult(_0x401c4a,_0x47a119){_0x47a119=_0x47a119||0xc8;return function(_0x4e7571){if(_0x4e7571){return _0x401c4a['status'](_0x47a119)[_0xcd9f('0x1c')](_0x4e7571);}};}function respondWithFilteredResult(_0x7130fe,_0x50d27c){return function(_0x53c78b){if(_0x53c78b){var _0x29ee11=typeof _0x50d27c[_0xcd9f('0x1d')]===_0xcd9f('0x1e')&&typeof _0x50d27c[_0xcd9f('0x1f')]==='undefined';var _0x2d1fd7=_0x53c78b[_0xcd9f('0x20')];var _0xb8a7c1=_0x29ee11?0x0:_0x50d27c[_0xcd9f('0x1d')];var _0xed956b=_0x29ee11?_0x53c78b[_0xcd9f('0x20')]:_0x50d27c[_0xcd9f('0x1d')]+_0x50d27c[_0xcd9f('0x1f')];var _0x3b05dc;if(_0xed956b>=_0x2d1fd7){_0xed956b=_0x2d1fd7;_0x3b05dc=0xc8;}else{_0x3b05dc=0xce;}_0x7130fe[_0xcd9f('0x1a')](_0x3b05dc);return _0x7130fe[_0xcd9f('0x21')]('Content-Range',_0xb8a7c1+'-'+_0xed956b+'/'+_0x2d1fd7)['json'](_0x53c78b);}return null;};}function patchUpdates(_0x2f36c1){return function(_0x188407){try{jsonpatch[_0xcd9f('0x22')](_0x188407,_0x2f36c1,!![]);}catch(_0x3d5e5f){return BPromise['reject'](_0x3d5e5f);}return _0x188407['save']();};}function saveUpdates(_0x3d4d24,_0x2b826d){return function(_0xc9df26){if(_0xc9df26){return _0xc9df26[_0xcd9f('0x23')](_0x3d4d24)[_0xcd9f('0x24')](function(_0x4ddc1b){return _0x4ddc1b;});}return null;};}function removeEntity(_0x561057,_0x3d5552){return function(_0x5c1736){if(_0x5c1736){return _0x5c1736[_0xcd9f('0x25')]()[_0xcd9f('0x24')](function(){_0x561057[_0xcd9f('0x1a')](0xcc)['end']();});}};}function handleEntityNotFound(_0x5398a2,_0x56c2da){return function(_0x1fe495){if(!_0x1fe495){_0x5398a2[_0xcd9f('0x19')](0x194);}return _0x1fe495;};}function handleError(_0x357592,_0x3cf628){_0x3cf628=_0x3cf628||0x1f4;return function(_0xd7b2a8){logger[_0xcd9f('0x26')](_0xd7b2a8[_0xcd9f('0x27')]);if(_0xd7b2a8[_0xcd9f('0x28')]){delete _0xd7b2a8['name'];}_0x357592[_0xcd9f('0x1a')](_0x3cf628)['send'](_0xd7b2a8);};}exports[_0xcd9f('0x29')]=function(_0xbdcf09,_0x30193d){var _0x40c1a6={},_0x347b52={},_0x5ca88a={'count':0x0,'rows':[]};var _0xc1785=_[_0xcd9f('0x2a')](db['Attachment'][_0xcd9f('0x2b')],function(_0xb3ace4){return{'name':_0xb3ace4['fieldName'],'type':_0xb3ace4[_0xcd9f('0x2c')]['key']};});_0x347b52[_0xcd9f('0x2d')]=_[_0xcd9f('0x2a')](_0xc1785,_0xcd9f('0x28'));_0x347b52['query']=_['keys'](_0xbdcf09[_0xcd9f('0x2e')]);_0x347b52['filters']=_[_0xcd9f('0x2f')](_0x347b52[_0xcd9f('0x2d')],_0x347b52[_0xcd9f('0x2e')]);_0x40c1a6[_0xcd9f('0x30')]=_[_0xcd9f('0x2f')](_0x347b52['model'],qs[_0xcd9f('0x31')](_0xbdcf09[_0xcd9f('0x2e')][_0xcd9f('0x31')]));_0x40c1a6[_0xcd9f('0x30')]=_0x40c1a6[_0xcd9f('0x30')][_0xcd9f('0x32')]?_0x40c1a6[_0xcd9f('0x30')]:_0x347b52['model'];if(!_0xbdcf09[_0xcd9f('0x2e')][_0xcd9f('0x33')](_0xcd9f('0x34'))){_0x40c1a6[_0xcd9f('0x1f')]=qs[_0xcd9f('0x1f')](_0xbdcf09[_0xcd9f('0x2e')]['limit']);_0x40c1a6[_0xcd9f('0x1d')]=qs['offset'](_0xbdcf09['query'][_0xcd9f('0x1d')]);}_0x40c1a6[_0xcd9f('0x35')]=qs[_0xcd9f('0x36')](_0xbdcf09['query'][_0xcd9f('0x36')]);_0x40c1a6[_0xcd9f('0x37')]=qs[_0xcd9f('0x38')](_[_0xcd9f('0x39')](_0xbdcf09['query'],_0x347b52['filters']),_0xc1785);if(_0xbdcf09['query'][_0xcd9f('0x3a')]){_0x40c1a6['where']=_[_0xcd9f('0x3b')](_0x40c1a6['where'],{'$or':_[_0xcd9f('0x2a')](_0xc1785,function(_0x30a01c){if(_0x30a01c[_0xcd9f('0x2c')]!==_0xcd9f('0x3c')){var _0x4eb31d={};_0x4eb31d[_0x30a01c[_0xcd9f('0x28')]]={'$like':'%'+_0xbdcf09[_0xcd9f('0x2e')][_0xcd9f('0x3a')]+'%'};return _0x4eb31d;}})});}_0x40c1a6=_['merge']({},_0x40c1a6,_0xbdcf09[_0xcd9f('0x3d')]);var _0x1e3dc1={'where':_0x40c1a6[_0xcd9f('0x37')]};return db[_0xcd9f('0x3e')][_0xcd9f('0x20')](_0x1e3dc1)[_0xcd9f('0x24')](function(_0x48ad4d){_0x5ca88a[_0xcd9f('0x20')]=_0x48ad4d;if(_0xbdcf09['query']['includeAll']){_0x40c1a6[_0xcd9f('0x3f')]=[{'all':!![]}];}return db[_0xcd9f('0x3e')][_0xcd9f('0x40')](_0x40c1a6);})[_0xcd9f('0x24')](function(_0x2049be){_0x5ca88a['rows']=_0x2049be;return _0x5ca88a;})[_0xcd9f('0x24')](respondWithFilteredResult(_0x30193d,_0x40c1a6))[_0xcd9f('0x41')](handleError(_0x30193d,null));};exports[_0xcd9f('0x42')]=function(_0x47b740,_0x331c7e){var _0x4d0d61={'raw':!![],'where':{'id':_0x47b740['params']['id']}},_0x4f1d50={};_0x4f1d50[_0xcd9f('0x2d')]=_[_0xcd9f('0x43')](db[_0xcd9f('0x3e')][_0xcd9f('0x2b')]);_0x4f1d50[_0xcd9f('0x2e')]=_['keys'](_0x47b740[_0xcd9f('0x2e')]);_0x4f1d50[_0xcd9f('0x38')]=_[_0xcd9f('0x2f')](_0x4f1d50[_0xcd9f('0x2d')],_0x4f1d50['query']);_0x4d0d61[_0xcd9f('0x30')]=_[_0xcd9f('0x2f')](_0x4f1d50[_0xcd9f('0x2d')],qs[_0xcd9f('0x31')](_0x47b740['query']['fields']));_0x4d0d61[_0xcd9f('0x30')]=_0x4d0d61[_0xcd9f('0x30')]['length']?_0x4d0d61[_0xcd9f('0x30')]:_0x4f1d50['model'];if(_0x47b740[_0xcd9f('0x2e')][_0xcd9f('0x44')]){_0x4d0d61[_0xcd9f('0x3f')]=[{'all':!![]}];}_0x4d0d61=_['merge']({},_0x4d0d61,_0x47b740[_0xcd9f('0x3d')]);return db[_0xcd9f('0x3e')][_0xcd9f('0x45')](_0x4d0d61)[_0xcd9f('0x24')](handleEntityNotFound(_0x331c7e,null))['then'](respondWithResult(_0x331c7e,null))[_0xcd9f('0x41')](handleError(_0x331c7e,null));};exports['clone']=function(_0x503c31,_0x3ed8ec){var _0x3d6e53={'where':{'id':_0x503c31[_0xcd9f('0x46')]['id']}},_0xe17dbd={};_0xe17dbd['model']=_[_0xcd9f('0x43')](db[_0xcd9f('0x3e')][_0xcd9f('0x2b')]);_0x3d6e53[_0xcd9f('0x30')]=_[_0xcd9f('0x2f')](_0xe17dbd[_0xcd9f('0x2d')],qs[_0xcd9f('0x31')](_0x503c31[_0xcd9f('0x2e')][_0xcd9f('0x31')]));_0x3d6e53['attributes']=_0x3d6e53[_0xcd9f('0x30')][_0xcd9f('0x32')]?_0x3d6e53[_0xcd9f('0x30')]:_0xe17dbd[_0xcd9f('0x2d')];if(_0x503c31[_0xcd9f('0x2e')][_0xcd9f('0x44')]){_0x3d6e53['include']=[{'all':!![]}];}_0x3d6e53=_[_0xcd9f('0x3b')]({},_0x3d6e53,_0x503c31[_0xcd9f('0x3d')]);return db[_0xcd9f('0x3e')]['find'](_0x3d6e53)['then'](handleEntityNotFound(_0x3ed8ec,null))[_0xcd9f('0x24')](function(_0x3c98aa){if(_0x3c98aa){var _0x1b993c=_0x3c98aa['get']({'plain':!![]});_0x1b993c=qs['omit'](_0x1b993c,['id',_0xcd9f('0x47'),_0xcd9f('0x48')]);_0x503c31[_0xcd9f('0x49')]=_['omit'](_0x503c31[_0xcd9f('0x49')],['id','createdAt',_0xcd9f('0x48')]);return db[_0xcd9f('0x3e')][_0xcd9f('0x4a')](_['merge'](_0x1b993c,_0x503c31[_0xcd9f('0x49')]),{'include':_0x503c31['query'][_0xcd9f('0x44')]?[{'all':!![]}]:undefined});}})[_0xcd9f('0x24')](respondWithResult(_0x3ed8ec,0xc9))[_0xcd9f('0x41')](handleError(_0x3ed8ec,null));};exports['update']=function(_0x54e6d0,_0x4ca296){if(_0x54e6d0[_0xcd9f('0x49')]['id']){delete _0x54e6d0['body']['id'];}return db[_0xcd9f('0x3e')][_0xcd9f('0x45')]({'where':{'id':_0x54e6d0[_0xcd9f('0x46')]['id']}})['then'](handleEntityNotFound(_0x4ca296,null))[_0xcd9f('0x24')](saveUpdates(_0x54e6d0[_0xcd9f('0x49')],null))['then'](respondWithResult(_0x4ca296,null))[_0xcd9f('0x41')](handleError(_0x4ca296,null));};exports[_0xcd9f('0x25')]=function(_0x56ac17,_0x5b2367){return db['Attachment'][_0xcd9f('0x45')]({'where':{'id':_0x56ac17[_0xcd9f('0x46')]['id']}})[_0xcd9f('0x24')](handleEntityNotFound(_0x5b2367,null))[_0xcd9f('0x24')](removeEntity(_0x5b2367,null))[_0xcd9f('0x41')](handleError(_0x5b2367,null));};exports[_0xcd9f('0x4a')]=function(_0x7e0795,_0x6bda16,_0x2c866e){_0x7e0795[_0xcd9f('0x49')][_0xcd9f('0x28')]=_0x7e0795['file'][_0xcd9f('0x4b')];_0x7e0795[_0xcd9f('0x49')][_0xcd9f('0x4c')]=_0x7e0795[_0xcd9f('0x4d')][_0xcd9f('0x4e')];_0x7e0795[_0xcd9f('0x49')][_0xcd9f('0x2c')]=_0x7e0795[_0xcd9f('0x4d')][_0xcd9f('0x4f')];return db['Attachment'][_0xcd9f('0x4a')](_0x7e0795['body'])[_0xcd9f('0x24')](respondWithResult(_0x6bda16,0xc9))['catch'](handleError(_0x6bda16,null));};exports[_0xcd9f('0x50')]=function(_0x51aeca,_0x88162,_0xcdda62){return db[_0xcd9f('0x3e')][_0xcd9f('0x51')]({'where':{'id':_0x51aeca[_0xcd9f('0x46')]['id']},'raw':!![]})['then'](handleEntityNotFound(_0x88162,null))[_0xcd9f('0x24')](function(_0x1d997c){if(_0x1d997c){var _0xe3c944=_0x1d997c[_0xcd9f('0x52')]!==null;var _0x3b7681=path['join'](config['root'],'server/files/attachments/');if(_0xe3c944){_0x3b7681=path['join'](_0x3b7681,_0xcd9f('0x53'));}var _0x1b5b5f=path[_0xcd9f('0x54')](_0x3b7681,_0x1d997c[_0xcd9f('0x4c')]);return _0x88162[_0xcd9f('0x50')](_0x1b5b5f);}})[_0xcd9f('0x41')](handleError(_0x88162,null));};
\ No newline at end of file
+var _0xac80=['include','omit','updatedAt','createdAt','create','body','file','originalname','basename','filename','mimetype','download','findOne','ChatOfflineMessageId','root','server/files/attachments/','offline-chat/','eml-format','rimraf','zip-dir','fast-json-patch','bluebird','mustache','to-csv','ejs','fs-extra','lodash','squel','crypto','querystring','papaparse','ioredis','../../components/auth/service','../../config/license/hardware','../../config/logger','api','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','count','limit','set','save','update','destroy','then','name','send','index','map','Attachment','fieldName','type','key','query','filters','attributes','intersection','model','fields','length','order','sort','where','pick','filter','merge','VIRTUAL','options','findAll','rows','catch','show','params','keys','rawAttributes','includeAll','find','clone'];(function(_0x5c3151,_0x18bfe0){var _0x2c4a35=function(_0x4866e6){while(--_0x4866e6){_0x5c3151['push'](_0x5c3151['shift']());}};_0x2c4a35(++_0x18bfe0);}(_0xac80,0xb9));var _0x0ac8=function(_0x537d9e,_0x44d509){_0x537d9e=_0x537d9e-0x0;var _0x165c72=_0xac80[_0x537d9e];return _0x165c72;};'use strict';var emlformat=require(_0x0ac8('0x0'));var rimraf=require(_0x0ac8('0x1'));var zipdir=require(_0x0ac8('0x2'));var jsonpatch=require(_0x0ac8('0x3'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x0ac8('0x4'));var Mustache=require(_0x0ac8('0x5'));var util=require('util');var path=require('path');var sox=require('sox');var csv=require(_0x0ac8('0x6'));var ejs=require(_0x0ac8('0x7'));var fs=require('fs');var fs_extra=require(_0x0ac8('0x8'));var _=require(_0x0ac8('0x9'));var squel=require(_0x0ac8('0xa'));var crypto=require(_0x0ac8('0xb'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x0ac8('0x6'));var querystring=require(_0x0ac8('0xc'));var Papa=require(_0x0ac8('0xd'));var Redis=require(_0x0ac8('0xe'));var authService=require(_0x0ac8('0xf'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x0ac8('0x10'));var logger=require(_0x0ac8('0x11'))(_0x0ac8('0x12'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0x0ac8('0x13'));var db=require(_0x0ac8('0x14'))['db'];function respondWithStatusCode(_0x4f15f7,_0x28370e){_0x28370e=_0x28370e||0xcc;return function(_0x473e1a){if(_0x473e1a){return _0x4f15f7[_0x0ac8('0x15')](_0x28370e);}return _0x4f15f7[_0x0ac8('0x16')](_0x28370e)[_0x0ac8('0x17')]();};}function respondWithResult(_0x16d383,_0x3d55df){_0x3d55df=_0x3d55df||0xc8;return function(_0x60400){if(_0x60400){return _0x16d383['status'](_0x3d55df)[_0x0ac8('0x18')](_0x60400);}};}function respondWithFilteredResult(_0x15d72f,_0x1b3bc3){return function(_0x3859c2){if(_0x3859c2){var _0x46282b=typeof _0x1b3bc3[_0x0ac8('0x19')]===_0x0ac8('0x1a')&&typeof _0x1b3bc3['limit']===_0x0ac8('0x1a');var _0x5f0b35=_0x3859c2['count'];var _0x19b9a1=_0x46282b?0x0:_0x1b3bc3[_0x0ac8('0x19')];var _0x395d23=_0x46282b?_0x3859c2[_0x0ac8('0x1b')]:_0x1b3bc3[_0x0ac8('0x19')]+_0x1b3bc3[_0x0ac8('0x1c')];var _0x5d19e8;if(_0x395d23>=_0x5f0b35){_0x395d23=_0x5f0b35;_0x5d19e8=0xc8;}else{_0x5d19e8=0xce;}_0x15d72f[_0x0ac8('0x16')](_0x5d19e8);return _0x15d72f[_0x0ac8('0x1d')]('Content-Range',_0x19b9a1+'-'+_0x395d23+'/'+_0x5f0b35)[_0x0ac8('0x18')](_0x3859c2);}return null;};}function patchUpdates(_0x426833){return function(_0x18d94d){try{jsonpatch['apply'](_0x18d94d,_0x426833,!![]);}catch(_0x5d8052){return BPromise['reject'](_0x5d8052);}return _0x18d94d[_0x0ac8('0x1e')]();};}function saveUpdates(_0x46ecb3,_0x23d602){return function(_0xd8d28c){if(_0xd8d28c){return _0xd8d28c[_0x0ac8('0x1f')](_0x46ecb3)['then'](function(_0x26db6d){return _0x26db6d;});}return null;};}function removeEntity(_0x2ef4ba,_0x52fbf1){return function(_0x3cd88d){if(_0x3cd88d){return _0x3cd88d[_0x0ac8('0x20')]()[_0x0ac8('0x21')](function(){_0x2ef4ba[_0x0ac8('0x16')](0xcc)[_0x0ac8('0x17')]();});}};}function handleEntityNotFound(_0x286c6b,_0x5dac04){return function(_0x288062){if(!_0x288062){_0x286c6b['sendStatus'](0x194);}return _0x288062;};}function handleError(_0x3c0072,_0x59430b){_0x59430b=_0x59430b||0x1f4;return function(_0x3ac7ca){logger['error'](_0x3ac7ca['stack']);if(_0x3ac7ca[_0x0ac8('0x22')]){delete _0x3ac7ca[_0x0ac8('0x22')];}_0x3c0072[_0x0ac8('0x16')](_0x59430b)[_0x0ac8('0x23')](_0x3ac7ca);};}exports[_0x0ac8('0x24')]=function(_0x317fa9,_0x3659eb){var _0xd7805={},_0x14f260={},_0x2b9dc5={'count':0x0,'rows':[]};var _0x1d3fc9=_[_0x0ac8('0x25')](db[_0x0ac8('0x26')]['rawAttributes'],function(_0x564c56){return{'name':_0x564c56[_0x0ac8('0x27')],'type':_0x564c56[_0x0ac8('0x28')][_0x0ac8('0x29')]};});_0x14f260['model']=_[_0x0ac8('0x25')](_0x1d3fc9,_0x0ac8('0x22'));_0x14f260[_0x0ac8('0x2a')]=_['keys'](_0x317fa9[_0x0ac8('0x2a')]);_0x14f260[_0x0ac8('0x2b')]=_['intersection'](_0x14f260['model'],_0x14f260[_0x0ac8('0x2a')]);_0xd7805[_0x0ac8('0x2c')]=_[_0x0ac8('0x2d')](_0x14f260[_0x0ac8('0x2e')],qs[_0x0ac8('0x2f')](_0x317fa9[_0x0ac8('0x2a')][_0x0ac8('0x2f')]));_0xd7805[_0x0ac8('0x2c')]=_0xd7805[_0x0ac8('0x2c')][_0x0ac8('0x30')]?_0xd7805[_0x0ac8('0x2c')]:_0x14f260[_0x0ac8('0x2e')];if(!_0x317fa9['query']['hasOwnProperty']('nolimit')){_0xd7805[_0x0ac8('0x1c')]=qs[_0x0ac8('0x1c')](_0x317fa9[_0x0ac8('0x2a')]['limit']);_0xd7805[_0x0ac8('0x19')]=qs['offset'](_0x317fa9[_0x0ac8('0x2a')][_0x0ac8('0x19')]);}_0xd7805[_0x0ac8('0x31')]=qs[_0x0ac8('0x32')](_0x317fa9[_0x0ac8('0x2a')][_0x0ac8('0x32')]);_0xd7805[_0x0ac8('0x33')]=qs[_0x0ac8('0x2b')](_[_0x0ac8('0x34')](_0x317fa9['query'],_0x14f260[_0x0ac8('0x2b')]),_0x1d3fc9);if(_0x317fa9['query'][_0x0ac8('0x35')]){_0xd7805[_0x0ac8('0x33')]=_[_0x0ac8('0x36')](_0xd7805['where'],{'$or':_['map'](_0x1d3fc9,function(_0x2aa330){if(_0x2aa330[_0x0ac8('0x28')]!==_0x0ac8('0x37')){var _0x142f81={};_0x142f81[_0x2aa330[_0x0ac8('0x22')]]={'$like':'%'+_0x317fa9['query'][_0x0ac8('0x35')]+'%'};return _0x142f81;}})});}_0xd7805=_['merge']({},_0xd7805,_0x317fa9[_0x0ac8('0x38')]);var _0x54f1a2={'where':_0xd7805[_0x0ac8('0x33')]};return db[_0x0ac8('0x26')][_0x0ac8('0x1b')](_0x54f1a2)[_0x0ac8('0x21')](function(_0x307afd){_0x2b9dc5['count']=_0x307afd;if(_0x317fa9[_0x0ac8('0x2a')]['includeAll']){_0xd7805['include']=[{'all':!![]}];}return db[_0x0ac8('0x26')][_0x0ac8('0x39')](_0xd7805);})[_0x0ac8('0x21')](function(_0x14d510){_0x2b9dc5[_0x0ac8('0x3a')]=_0x14d510;return _0x2b9dc5;})['then'](respondWithFilteredResult(_0x3659eb,_0xd7805))[_0x0ac8('0x3b')](handleError(_0x3659eb,null));};exports[_0x0ac8('0x3c')]=function(_0x592ad1,_0x55582e){var _0x5ec96e={'raw':!![],'where':{'id':_0x592ad1[_0x0ac8('0x3d')]['id']}},_0xdc73ca={};_0xdc73ca[_0x0ac8('0x2e')]=_[_0x0ac8('0x3e')](db[_0x0ac8('0x26')][_0x0ac8('0x3f')]);_0xdc73ca[_0x0ac8('0x2a')]=_['keys'](_0x592ad1[_0x0ac8('0x2a')]);_0xdc73ca[_0x0ac8('0x2b')]=_[_0x0ac8('0x2d')](_0xdc73ca[_0x0ac8('0x2e')],_0xdc73ca['query']);_0x5ec96e[_0x0ac8('0x2c')]=_[_0x0ac8('0x2d')](_0xdc73ca['model'],qs['fields'](_0x592ad1['query'][_0x0ac8('0x2f')]));_0x5ec96e['attributes']=_0x5ec96e['attributes'][_0x0ac8('0x30')]?_0x5ec96e[_0x0ac8('0x2c')]:_0xdc73ca[_0x0ac8('0x2e')];if(_0x592ad1['query'][_0x0ac8('0x40')]){_0x5ec96e['include']=[{'all':!![]}];}_0x5ec96e=_[_0x0ac8('0x36')]({},_0x5ec96e,_0x592ad1[_0x0ac8('0x38')]);return db[_0x0ac8('0x26')][_0x0ac8('0x41')](_0x5ec96e)[_0x0ac8('0x21')](handleEntityNotFound(_0x55582e,null))[_0x0ac8('0x21')](respondWithResult(_0x55582e,null))[_0x0ac8('0x3b')](handleError(_0x55582e,null));};exports[_0x0ac8('0x42')]=function(_0x221f87,_0x3399e1){var _0x90d546={'where':{'id':_0x221f87[_0x0ac8('0x3d')]['id']}},_0x54ae41={};_0x54ae41[_0x0ac8('0x2e')]=_[_0x0ac8('0x3e')](db[_0x0ac8('0x26')]['rawAttributes']);_0x90d546['attributes']=_[_0x0ac8('0x2d')](_0x54ae41[_0x0ac8('0x2e')],qs[_0x0ac8('0x2f')](_0x221f87[_0x0ac8('0x2a')][_0x0ac8('0x2f')]));_0x90d546['attributes']=_0x90d546[_0x0ac8('0x2c')][_0x0ac8('0x30')]?_0x90d546['attributes']:_0x54ae41[_0x0ac8('0x2e')];if(_0x221f87[_0x0ac8('0x2a')][_0x0ac8('0x40')]){_0x90d546[_0x0ac8('0x43')]=[{'all':!![]}];}_0x90d546=_[_0x0ac8('0x36')]({},_0x90d546,_0x221f87[_0x0ac8('0x38')]);return db['Attachment'][_0x0ac8('0x41')](_0x90d546)[_0x0ac8('0x21')](handleEntityNotFound(_0x3399e1,null))['then'](function(_0x270807){if(_0x270807){var _0x50d5bb=_0x270807['get']({'plain':!![]});_0x50d5bb=qs[_0x0ac8('0x44')](_0x50d5bb,['id','createdAt',_0x0ac8('0x45')]);_0x221f87['body']=_[_0x0ac8('0x44')](_0x221f87['body'],['id',_0x0ac8('0x46'),'updatedAt']);return db[_0x0ac8('0x26')][_0x0ac8('0x47')](_['merge'](_0x50d5bb,_0x221f87[_0x0ac8('0x48')]),{'include':_0x221f87['query'][_0x0ac8('0x40')]?[{'all':!![]}]:undefined});}})['then'](respondWithResult(_0x3399e1,0xc9))[_0x0ac8('0x3b')](handleError(_0x3399e1,null));};exports['update']=function(_0x57e21e,_0x25ec7e){if(_0x57e21e[_0x0ac8('0x48')]['id']){delete _0x57e21e[_0x0ac8('0x48')]['id'];}return db['Attachment'][_0x0ac8('0x41')]({'where':{'id':_0x57e21e[_0x0ac8('0x3d')]['id']}})[_0x0ac8('0x21')](handleEntityNotFound(_0x25ec7e,null))['then'](saveUpdates(_0x57e21e[_0x0ac8('0x48')],null))[_0x0ac8('0x21')](respondWithResult(_0x25ec7e,null))[_0x0ac8('0x3b')](handleError(_0x25ec7e,null));};exports[_0x0ac8('0x20')]=function(_0x8068aa,_0x47487f){return db[_0x0ac8('0x26')][_0x0ac8('0x41')]({'where':{'id':_0x8068aa['params']['id']}})[_0x0ac8('0x21')](handleEntityNotFound(_0x47487f,null))[_0x0ac8('0x21')](removeEntity(_0x47487f,null))[_0x0ac8('0x3b')](handleError(_0x47487f,null));};exports['create']=function(_0x3efec5,_0x19e9e8,_0x468675){_0x3efec5['body'][_0x0ac8('0x22')]=_0x3efec5[_0x0ac8('0x49')][_0x0ac8('0x4a')];_0x3efec5[_0x0ac8('0x48')][_0x0ac8('0x4b')]=_0x3efec5['file'][_0x0ac8('0x4c')];_0x3efec5[_0x0ac8('0x48')][_0x0ac8('0x28')]=_0x3efec5[_0x0ac8('0x49')][_0x0ac8('0x4d')];return db['Attachment']['create'](_0x3efec5[_0x0ac8('0x48')])[_0x0ac8('0x21')](respondWithResult(_0x19e9e8,0xc9))[_0x0ac8('0x3b')](handleError(_0x19e9e8,null));};exports[_0x0ac8('0x4e')]=function(_0x1b71c1,_0x48facd,_0xbb2fab){return db[_0x0ac8('0x26')][_0x0ac8('0x4f')]({'where':{'id':_0x1b71c1[_0x0ac8('0x3d')]['id']},'raw':!![]})[_0x0ac8('0x21')](handleEntityNotFound(_0x48facd,null))[_0x0ac8('0x21')](function(_0x44293d){if(_0x44293d){var _0x4a3ae7=_0x44293d[_0x0ac8('0x50')]!==null;var _0x1311bd=path['join'](config[_0x0ac8('0x51')],_0x0ac8('0x52'));if(_0x4a3ae7){_0x1311bd=path['join'](_0x1311bd,_0x0ac8('0x53'));}var _0x3b3d25=path['join'](_0x1311bd,_0x44293d['basename']);return _0x48facd['download'](_0x3b3d25);}})['catch'](handleError(_0x48facd,null));};
\ No newline at end of file
diff --git a/server/api/attachment/attachment.model.js b/server/api/attachment/attachment.model.js
index eb98b8c..7de6972 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 _0xbafb=['./attachment.attributes','exports','define','Attachment','attachments','lodash','../../config/logger','api','moment','bluebird','request-promise','path','../../config/environment'];(function(_0x1a50e5,_0x14accb){var _0x53b463=function(_0x12df94){while(--_0x12df94){_0x1a50e5['push'](_0x1a50e5['shift']());}};_0x53b463(++_0x14accb);}(_0xbafb,0xbb));var _0xbbaf=function(_0x4a487f,_0x1b575c){_0x4a487f=_0x4a487f-0x0;var _0x446541=_0xbafb[_0x4a487f];return _0x446541;};'use strict';var _=require(_0xbbaf('0x0'));var util=require('util');var logger=require(_0xbbaf('0x1'))(_0xbbaf('0x2'));var moment=require(_0xbbaf('0x3'));var BPromise=require(_0xbbaf('0x4'));var rp=require(_0xbbaf('0x5'));var fs=require('fs');var path=require(_0xbbaf('0x6'));var rimraf=require('rimraf');var config=require(_0xbbaf('0x7'));var attributes=require(_0xbbaf('0x8'));module[_0xbbaf('0x9')]=function(_0x64d333,_0x577ccb){return _0x64d333[_0xbbaf('0xa')](_0xbbaf('0xb'),attributes,{'tableName':_0xbbaf('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x3804=['./attachment.attributes','exports','define','Attachment','attachments','lodash','util','api','request-promise','../../config/environment'];(function(_0x19b9d1,_0x4f603f){var _0x1ca4f7=function(_0x2d1ea7){while(--_0x2d1ea7){_0x19b9d1['push'](_0x19b9d1['shift']());}};_0x1ca4f7(++_0x4f603f);}(_0x3804,0x145));var _0x4380=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x3804[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0x4380('0x0'));var util=require(_0x4380('0x1'));var logger=require('../../config/logger')(_0x4380('0x2'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x4380('0x3'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x4380('0x4'));var attributes=require(_0x4380('0x5'));module[_0x4380('0x6')]=function(_0x823c5,_0x57e8e2){return _0x823c5[_0x4380('0x7')](_0x4380('0x8'),attributes,{'tableName':_0x4380('0x9'),'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 cd0181f..d60eddd 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 _0x1ddc=['bluebird','ioredis','../../mysqldb','../../config/logger','rpc','jayson/promise','client','request','then','Attachment,\x20%s,\x20%s','request\x20sent','debug','Attachment,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','catch','Attachment','create','body','options','raw','CreateAttachment','util','moment'];(function(_0x6b8671,_0x23fdb0){var _0x33c700=function(_0x52c831){while(--_0x52c831){_0x6b8671['push'](_0x6b8671['shift']());}};_0x33c700(++_0x23fdb0);}(_0x1ddc,0x6e));var _0xc1dd=function(_0x5934be,_0x2007e0){_0x5934be=_0x5934be-0x0;var _0x2a9489=_0x1ddc[_0x5934be];return _0x2a9489;};'use strict';var _=require('lodash');var util=require(_0xc1dd('0x0'));var moment=require(_0xc1dd('0x1'));var BPromise=require(_0xc1dd('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xc1dd('0x3'));var db=require(_0xc1dd('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0xc1dd('0x5'))(_0xc1dd('0x6'));var config=require('../../config/environment');var jayson=require(_0xc1dd('0x7'));var client=jayson[_0xc1dd('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x3938ff,_0x25c543,_0x593de5){return new BPromise(function(_0x54819b,_0x411452){return client[_0xc1dd('0x9')](_0x3938ff,_0x593de5)[_0xc1dd('0xa')](function(_0x217d07){logger['info'](_0xc1dd('0xb'),_0x25c543,_0xc1dd('0xc'));logger[_0xc1dd('0xd')](_0xc1dd('0xe'),_0x25c543,'request\x20sent',JSON[_0xc1dd('0xf')](_0x217d07));if(_0x217d07[_0xc1dd('0x10')]){if(_0x217d07[_0xc1dd('0x10')][_0xc1dd('0x11')]===0x1f4){logger[_0xc1dd('0x10')](_0xc1dd('0xb'),_0x25c543,_0x217d07[_0xc1dd('0x10')][_0xc1dd('0x12')]);return _0x411452(_0x217d07[_0xc1dd('0x10')][_0xc1dd('0x12')]);}logger[_0xc1dd('0x10')]('Attachment,\x20%s,\x20%s',_0x25c543,_0x217d07[_0xc1dd('0x10')][_0xc1dd('0x12')]);return _0x54819b(_0x217d07[_0xc1dd('0x10')][_0xc1dd('0x12')]);}else{logger[_0xc1dd('0x13')]('Attachment,\x20%s,\x20%s',_0x25c543,_0xc1dd('0xc'));_0x54819b(_0x217d07[_0xc1dd('0x14')][_0xc1dd('0x12')]);}})[_0xc1dd('0x15')](function(_0x5815d3){logger['error'](_0xc1dd('0xb'),_0x25c543,_0x5815d3);_0x411452(_0x5815d3);});});}exports['CreateAttachment']=function(_0x35139a){var _0x4c3114=this;return new Promise(function(_0x6198a7,_0x24446f){return db[_0xc1dd('0x16')][_0xc1dd('0x17')](_0x35139a[_0xc1dd('0x18')],{'raw':_0x35139a[_0xc1dd('0x19')]?_0x35139a['options'][_0xc1dd('0x1a')]===undefined?!![]:![]:!![]})[_0xc1dd('0xa')](function(_0x5e99a6){logger[_0xc1dd('0x13')](_0xc1dd('0x1b'),_0x35139a);logger[_0xc1dd('0xd')](_0xc1dd('0x1b'),_0x35139a,JSON[_0xc1dd('0xf')](_0x5e99a6));_0x6198a7(_0x5e99a6);})[_0xc1dd('0x15')](function(_0x228626){logger[_0xc1dd('0x10')]('CreateAttachment',_0x228626[_0xc1dd('0x12')],_0x35139a);_0x24446f(_0x4c3114[_0xc1dd('0x10')](0x1f4,_0x228626[_0xc1dd('0x12')]));});});};
\ No newline at end of file
+var _0x1bca=['util','randomstring','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','request','then','Attachment,\x20%s,\x20%s','request\x20sent','debug','Attachment,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','CreateAttachment','Attachment','create','body','raw','info'];(function(_0x2b1b0b,_0x19c4b6){var _0x8586f3=function(_0x551a67){while(--_0x551a67){_0x2b1b0b['push'](_0x2b1b0b['shift']());}};_0x8586f3(++_0x19c4b6);}(_0x1bca,0xb6));var _0xa1bc=function(_0x474035,_0x41e639){_0x474035=_0x474035-0x0;var _0x1b58e0=_0x1bca[_0x474035];return _0x1b58e0;};'use strict';var _=require('lodash');var util=require(_0xa1bc('0x0'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0xa1bc('0x1'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xa1bc('0x2'))['db'];var utils=require(_0xa1bc('0x3'));var logger=require(_0xa1bc('0x4'))('rpc');var config=require(_0xa1bc('0x5'));var jayson=require(_0xa1bc('0x6'));var client=jayson[_0xa1bc('0x7')][_0xa1bc('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x54bffb,_0x43a67,_0x432b65){return new BPromise(function(_0xea5ec8,_0x378061){return client[_0xa1bc('0x9')](_0x54bffb,_0x432b65)[_0xa1bc('0xa')](function(_0x2db364){logger['info'](_0xa1bc('0xb'),_0x43a67,_0xa1bc('0xc'));logger[_0xa1bc('0xd')](_0xa1bc('0xe'),_0x43a67,_0xa1bc('0xc'),JSON[_0xa1bc('0xf')](_0x2db364));if(_0x2db364[_0xa1bc('0x10')]){if(_0x2db364[_0xa1bc('0x10')]['code']===0x1f4){logger['error'](_0xa1bc('0xb'),_0x43a67,_0x2db364[_0xa1bc('0x10')][_0xa1bc('0x11')]);return _0x378061(_0x2db364[_0xa1bc('0x10')][_0xa1bc('0x11')]);}logger[_0xa1bc('0x10')](_0xa1bc('0xb'),_0x43a67,_0x2db364[_0xa1bc('0x10')][_0xa1bc('0x11')]);return _0xea5ec8(_0x2db364[_0xa1bc('0x10')][_0xa1bc('0x11')]);}else{logger['info']('Attachment,\x20%s,\x20%s',_0x43a67,_0xa1bc('0xc'));_0xea5ec8(_0x2db364[_0xa1bc('0x12')][_0xa1bc('0x11')]);}})[_0xa1bc('0x13')](function(_0x2a0438){logger[_0xa1bc('0x10')](_0xa1bc('0xb'),_0x43a67,_0x2a0438);_0x378061(_0x2a0438);});});}exports[_0xa1bc('0x14')]=function(_0x4765be){var _0x5b9d7c=this;return new Promise(function(_0x510046,_0x238f1f){return db[_0xa1bc('0x15')][_0xa1bc('0x16')](_0x4765be[_0xa1bc('0x17')],{'raw':_0x4765be['options']?_0x4765be['options'][_0xa1bc('0x18')]===undefined?!![]:![]:!![]})[_0xa1bc('0xa')](function(_0x322703){logger[_0xa1bc('0x19')](_0xa1bc('0x14'),_0x4765be);logger[_0xa1bc('0xd')]('CreateAttachment',_0x4765be,JSON[_0xa1bc('0xf')](_0x322703));_0x510046(_0x322703);})[_0xa1bc('0x13')](function(_0x1e4f4e){logger['error'](_0xa1bc('0x14'),_0x1e4f4e['message'],_0x4765be);_0x238f1f(_0x5b9d7c[_0xa1bc('0x10')](0x1f4,_0x1e4f4e[_0xa1bc('0x11')]));});});};
\ No newline at end of file
diff --git a/server/api/attachment/index.js b/server/api/attachment/index.js
index 2da8622..86be9e3 100644
--- a/server/api/attachment/index.js
+++ b/server/api/attachment/index.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x2032=['./attachment.controller','get','isAuthenticated','index','/:id','show','download','/:id/clone','clone','root','server/files/attachments/','now','post','single','file','create','put','update','delete','destroy','exports','util','path','connect-timeout','Router','fs-extra','../../components/interaction/service','../../config/environment'];(function(_0x4742c0,_0x2ddc6c){var _0x168d97=function(_0x48b24e){while(--_0x48b24e){_0x4742c0['push'](_0x4742c0['shift']());}};_0x168d97(++_0x2ddc6c);}(_0x2032,0xd9));var _0x2203=function(_0x53ad28,_0x3bfd56){_0x53ad28=_0x53ad28-0x0;var _0x4d7c13=_0x2032[_0x53ad28];return _0x4d7c13;};'use strict';var multer=require('multer');var util=require(_0x2203('0x0'));var path=require(_0x2203('0x1'));var timeout=require(_0x2203('0x2'));var express=require('express');var router=express[_0x2203('0x3')]();var fs_extra=require(_0x2203('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0x2203('0x5'));var config=require(_0x2203('0x6'));var controller=require(_0x2203('0x7'));router[_0x2203('0x8')]('/',auth[_0x2203('0x9')](),controller[_0x2203('0xa')]);router[_0x2203('0x8')](_0x2203('0xb'),auth[_0x2203('0x9')](),controller[_0x2203('0xc')]);router[_0x2203('0x8')]('/:id/download',auth['isAuthenticated'](),controller[_0x2203('0xd')]);router['post'](_0x2203('0xe'),auth[_0x2203('0x9')](),controller[_0x2203('0xf')]);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x849049,_0x4a6832,_0x3f690a){_0x3f690a(null,path['join'](config[_0x2203('0x10')],_0x2203('0x11')));},'filename':function(_0x4b9376,_0x583bc7,_0x585c76){_0x585c76(null,util['format']('%s-%s',Date[_0x2203('0x12')](),_0x583bc7['originalname']['replace'](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-')));}})});router[_0x2203('0x13')]('/',upload[_0x2203('0x14')](_0x2203('0x15')),controller[_0x2203('0x16')]);router[_0x2203('0x17')](_0x2203('0xb'),auth[_0x2203('0x9')](),controller[_0x2203('0x18')]);router[_0x2203('0x19')](_0x2203('0xb'),auth['isAuthenticated'](),controller[_0x2203('0x1a')]);module[_0x2203('0x1b')]=router;
\ No newline at end of file
+var _0x0b0e=['/:id/clone','clone','diskStorage','join','server/files/attachments/','format','now','originalname','replace','single','create','/:id','delete','destroy','multer','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./attachment.controller','get','isAuthenticated','index','show','/:id/download','post'];(function(_0x465028,_0x4570ac){var _0xb783d4=function(_0x5458c5){while(--_0x5458c5){_0x465028['push'](_0x465028['shift']());}};_0xb783d4(++_0x4570ac);}(_0x0b0e,0x187));var _0xe0b0=function(_0x231b2e,_0x2a33f9){_0x231b2e=_0x231b2e-0x0;var _0x3feb2a=_0x0b0e[_0x231b2e];return _0x3feb2a;};'use strict';var multer=require(_0xe0b0('0x0'));var util=require('util');var path=require(_0xe0b0('0x1'));var timeout=require('connect-timeout');var express=require(_0xe0b0('0x2'));var router=express[_0xe0b0('0x3')]();var fs_extra=require(_0xe0b0('0x4'));var auth=require(_0xe0b0('0x5'));var interaction=require(_0xe0b0('0x6'));var config=require(_0xe0b0('0x7'));var controller=require(_0xe0b0('0x8'));router[_0xe0b0('0x9')]('/',auth[_0xe0b0('0xa')](),controller[_0xe0b0('0xb')]);router[_0xe0b0('0x9')]('/:id',auth['isAuthenticated'](),controller[_0xe0b0('0xc')]);router[_0xe0b0('0x9')](_0xe0b0('0xd'),auth[_0xe0b0('0xa')](),controller['download']);router[_0xe0b0('0xe')](_0xe0b0('0xf'),auth['isAuthenticated'](),controller[_0xe0b0('0x10')]);var upload=multer({'storage':multer[_0xe0b0('0x11')]({'destination':function(_0x574d96,_0x399320,_0x2cdad2){_0x2cdad2(null,path[_0xe0b0('0x12')](config['root'],_0xe0b0('0x13')));},'filename':function(_0x1c358a,_0x3cc19a,_0x45f914){_0x45f914(null,util[_0xe0b0('0x14')]('%s-%s',Date[_0xe0b0('0x15')](),_0x3cc19a[_0xe0b0('0x16')][_0xe0b0('0x17')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-')));}})});router[_0xe0b0('0xe')]('/',upload[_0xe0b0('0x18')]('file'),controller[_0xe0b0('0x19')]);router['put'](_0xe0b0('0x1a'),auth[_0xe0b0('0xa')](),controller['update']);router[_0xe0b0('0x1b')]('/:id',auth[_0xe0b0('0xa')](),controller[_0xe0b0('0x1c')]);module['exports']=router;
\ No newline at end of file
diff --git a/server/api/authActiveDirectory/authActiveDirectory.controller.js b/server/api/authActiveDirectory/authActiveDirectory.controller.js
index cf1b682..b16c16e 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 _0x8d01=['moment','activedirectory2','bluebird','util','../../mysqldb','../../components/auth/service','api','activedirectory','undefined','baseDN','domain','authenticate','error','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','Setting','findOne','blockDuration','then','Error\x20authenticate\x20%s:\x20Active\x20Directory\x20not\x20enabled','name','password','salt','role','blocked','user','agent','blockedAt','add','minutes','clearBlockUser','getLicense','catch','status','message','login','ad-login','Something\x20went\x20wrong,\x20please\x20try\x20again.','signToken','json','use','User','passport','passport-local'];(function(_0x53f1ee,_0x29cff6){var _0x3638da=function(_0x3986a5){while(--_0x3986a5){_0x53f1ee['push'](_0x53f1ee['shift']());}};_0x3638da(++_0x29cff6);}(_0x8d01,0x193));var _0x18d0=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x8d01[_0x3dd15e];return _0x231fd0;};'use strict';var passport=require(_0x18d0('0x0'));var LocalStrategy=require(_0x18d0('0x1'))['Strategy'];var moment=require(_0x18d0('0x2'));var ActiveDirectory=require(_0x18d0('0x3'));var BPromise=require(_0x18d0('0x4'));var util=require(_0x18d0('0x5'));var db=require(_0x18d0('0x6'))['db'];var authService=require(_0x18d0('0x7'));var utils=require('../../config/utils');var config=require('../../config/environment');var logger=require('../../config/logger')(_0x18d0('0x8'));function isActiveDirectoryConfigured(_0x5211ca){var _0x3de2d8=![];if(typeof _0x5211ca[_0x18d0('0x9')]!==_0x18d0('0xa')){_0x3de2d8=_0x5211ca[_0x18d0('0x9')][_0x18d0('0xb')]&&_0x5211ca[_0x18d0('0x9')]['url']&&_0x5211ca[_0x18d0('0x9')][_0x18d0('0xc')];}return _0x3de2d8;}function adAuthenticate(_0x1ed66a,_0x14557f,_0x3319c6){return new BPromise(function(_0x1fc404,_0x4874b1){try{var _0x3f59f7=new ActiveDirectory(_0x1ed66a);_0x3f59f7[_0x18d0('0xd')](_0x14557f,_0x3319c6,function(_0x1375fb,_0x5a2817){if(_0x1375fb){logger[_0x18d0('0xe')]('Error\x20authenticate\x20%s:\x20%s',_0x14557f,util['inspect'](_0x1375fb,{'showHidden':![],'depth':null}));_0x4874b1(_0x18d0('0xf'));}else if(!_0x5a2817){logger[_0x18d0('0xe')](_0x18d0('0x10'),_0x14557f);_0x4874b1(_0x18d0('0xf'));}else{_0x1fc404(_0x5a2817);}});}catch(_0x309cef){_0x4874b1(_0x309cef);}});}function ActiveDirectoryAuthenticate(_0x49c6e7,_0x200df5,_0x418374,_0x4bdca5){var _0x278153,_0x5aac21;if(!isActiveDirectoryConfigured(config)){logger[_0x18d0('0xe')](_0x18d0('0x11'),_0x200df5);return _0x4bdca5(null,![],{'message':_0x18d0('0xf')});}return db[_0x18d0('0x12')][_0x18d0('0x13')]({'where':{'id':0x1},'attributes':['adSsoEnabled',_0x18d0('0x14')],'raw':!![]})[_0x18d0('0x15')](function(_0x2d36bd){_0x278153=_0x2d36bd;if(!_0x278153['adSsoEnabled']){logger[_0x18d0('0xe')](_0x18d0('0x16'),_0x200df5);throw new Error(_0x18d0('0xf'));}return _0x49c6e7[_0x18d0('0x13')]({'attributes':['id',_0x18d0('0x17'),_0x18d0('0x18'),_0x18d0('0x19'),_0x18d0('0x1a'),'disabled',_0x18d0('0x1b'),'blockedAt','online'],'where':{'name':_0x200df5,'role':{'$or':['admin',_0x18d0('0x1c'),_0x18d0('0x1d')]},'adSsoEnabled':!![]}});})[_0x18d0('0x15')](function(_0x4bec6a){if(!_0x4bec6a||_0x4bec6a&&_0x4bec6a[_0x18d0('0x17')]!==_0x200df5){throw new Error(_0x18d0('0xf'));}_0x5aac21=_0x4bec6a;var _0x1c164e=_0x5aac21[_0x18d0('0x17')]+'@'+config[_0x18d0('0x9')][_0x18d0('0xc')];return adAuthenticate(config[_0x18d0('0x9')],_0x1c164e,_0x418374);})[_0x18d0('0x15')](function(_0x2c1a76){if(_0x5aac21['disabled']){throw new Error(_0x18d0('0xf'));}if(_0x278153['blockDuration']>0x0){if(_0x5aac21[_0x18d0('0x1b')]){if(moment(_0x5aac21[_0x18d0('0x1e')])[_0x18d0('0x1f')](_0x278153[_0x18d0('0x14')],_0x18d0('0x20'))>moment()){throw new Error('Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.');}return utils[_0x18d0('0x21')](_0x5aac21,0x0,![],null)[_0x18d0('0x15')](function(){return utils[_0x18d0('0x22')](_0x5aac21);})[_0x18d0('0x15')](function(){return _0x4bdca5(null,_0x5aac21);});}else{return utils['getLicense'](_0x5aac21)[_0x18d0('0x15')](function(){return _0x4bdca5(null,_0x5aac21);});}}else{return utils[_0x18d0('0x22')](_0x5aac21)[_0x18d0('0x15')](function(){return _0x4bdca5(null,_0x5aac21);});}})[_0x18d0('0x23')](function(_0xfdc08f){return _0x4bdca5(null,![],_0xfdc08f);});}function handleError(_0x5c5b78,_0x3dfa94,_0x4cf86e){return _0x5c5b78[_0x18d0('0x24')](_0x3dfa94||0x1f4)['send']({'message':_0x4cf86e?_0x4cf86e[_0x18d0('0x25')]||_0x4cf86e:''});}exports[_0x18d0('0x26')]=function(_0x4fc99e,_0x3f540b,_0x2c94ec){passport[_0x18d0('0xd')](_0x18d0('0x27'),function(_0x224d6a,_0xc0bf90,_0x448507){var _0x132e87=_0x224d6a||_0x448507;if(_0x132e87){return handleError(_0x3f540b,0x191,_0x132e87);}if(!_0xc0bf90){return handleError(_0x3f540b,0x194,{'message':_0x18d0('0x28')});}else{var _0xfa8aa={'payload':{'id':_0xc0bf90['id'],'role':_0xc0bf90[_0x18d0('0x1a')]},'options':{'expiresIn':0x15180}};return authService[_0x18d0('0x29')](_0xfa8aa)[_0x18d0('0x15')](function(_0x47ec8f){_0x3f540b[_0x18d0('0x2a')]({'id':_0xc0bf90['id'],'token':_0x47ec8f,'statusCall':'','isAlreadyLogged':_0xc0bf90['online']});});}})(_0x4fc99e,_0x3f540b,_0x2c94ec);};passport[_0x18d0('0x2b')](_0x18d0('0x27'),new LocalStrategy({'usernameField':_0x18d0('0x17'),'passwordField':_0x18d0('0x18')},function(_0x2579a1,_0x261d75,_0x30d4c8){return ActiveDirectoryAuthenticate(db[_0x18d0('0x2c')],_0x2579a1,_0x261d75,_0x30d4c8);}));
\ No newline at end of file
+var _0x6a83=['activedirectory2','bluebird','../../mysqldb','../../components/auth/service','../../config/utils','../../config/environment','../../config/logger','api','activedirectory','undefined','domain','authenticate','error','Error\x20authenticate\x20%s:\x20%s','inspect','Error\x20authenticate\x20%s:\x20Wrong\x20credentials','Error\x20authenticate\x20%s:\x20Active\x20Directory\x20not\x20configured','Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.','Setting','findOne','adSsoEnabled','blockDuration','then','password','salt','role','disabled','blockedAt','online','user','blocked','add','minutes','getLicense','catch','status','send','message','ad-login','Something\x20went\x20wrong,\x20please\x20try\x20again.','signToken','json','use','User','passport','passport-local','moment'];(function(_0xffd1b5,_0x1ede18){var _0x3176d6=function(_0xe9ba48){while(--_0xe9ba48){_0xffd1b5['push'](_0xffd1b5['shift']());}};_0x3176d6(++_0x1ede18);}(_0x6a83,0x1a4));var _0x36a8=function(_0x3fb599,_0x43c9ce){_0x3fb599=_0x3fb599-0x0;var _0x3cbb3a=_0x6a83[_0x3fb599];return _0x3cbb3a;};'use strict';var passport=require(_0x36a8('0x0'));var LocalStrategy=require(_0x36a8('0x1'))['Strategy'];var moment=require(_0x36a8('0x2'));var ActiveDirectory=require(_0x36a8('0x3'));var BPromise=require(_0x36a8('0x4'));var util=require('util');var db=require(_0x36a8('0x5'))['db'];var authService=require(_0x36a8('0x6'));var utils=require(_0x36a8('0x7'));var config=require(_0x36a8('0x8'));var logger=require(_0x36a8('0x9'))(_0x36a8('0xa'));function isActiveDirectoryConfigured(_0x54a763){var _0x3cbd65=![];if(typeof _0x54a763[_0x36a8('0xb')]!==_0x36a8('0xc')){_0x3cbd65=_0x54a763[_0x36a8('0xb')]['baseDN']&&_0x54a763['activedirectory']['url']&&_0x54a763['activedirectory'][_0x36a8('0xd')];}return _0x3cbd65;}function adAuthenticate(_0x5f2629,_0xdecfc3,_0x37fd9e){return new BPromise(function(_0x29dd50,_0x4a410f){try{var _0x1efe0f=new ActiveDirectory(_0x5f2629);_0x1efe0f[_0x36a8('0xe')](_0xdecfc3,_0x37fd9e,function(_0x5be619,_0x53439f){if(_0x5be619){logger[_0x36a8('0xf')](_0x36a8('0x10'),_0xdecfc3,util[_0x36a8('0x11')](_0x5be619,{'showHidden':![],'depth':null}));_0x4a410f('Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.');}else if(!_0x53439f){logger[_0x36a8('0xf')](_0x36a8('0x12'),_0xdecfc3);_0x4a410f('Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.');}else{_0x29dd50(_0x53439f);}});}catch(_0x45253f){_0x4a410f(_0x45253f);}});}function ActiveDirectoryAuthenticate(_0x5a003d,_0x51a95e,_0x360429,_0x4540c4){var _0x7e5b8b,_0x5d9a08;if(!isActiveDirectoryConfigured(config)){logger[_0x36a8('0xf')](_0x36a8('0x13'),_0x51a95e);return _0x4540c4(null,![],{'message':_0x36a8('0x14')});}return db[_0x36a8('0x15')][_0x36a8('0x16')]({'where':{'id':0x1},'attributes':[_0x36a8('0x17'),_0x36a8('0x18')],'raw':!![]})[_0x36a8('0x19')](function(_0x43a8f3){_0x7e5b8b=_0x43a8f3;if(!_0x7e5b8b[_0x36a8('0x17')]){logger[_0x36a8('0xf')]('Error\x20authenticate\x20%s:\x20Active\x20Directory\x20not\x20enabled',_0x51a95e);throw new Error(_0x36a8('0x14'));}return _0x5a003d['findOne']({'attributes':['id','name',_0x36a8('0x1a'),_0x36a8('0x1b'),_0x36a8('0x1c'),_0x36a8('0x1d'),'blocked',_0x36a8('0x1e'),_0x36a8('0x1f')],'where':{'name':_0x51a95e,'role':{'$or':['admin',_0x36a8('0x20'),'agent']},'adSsoEnabled':!![]}});})[_0x36a8('0x19')](function(_0x1ae46b){if(!_0x1ae46b||_0x1ae46b&&_0x1ae46b['name']!==_0x51a95e){throw new Error('Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.');}_0x5d9a08=_0x1ae46b;var _0x4fb222=_0x5d9a08['name']+'@'+config[_0x36a8('0xb')][_0x36a8('0xd')];return adAuthenticate(config['activedirectory'],_0x4fb222,_0x360429);})['then'](function(_0x208427){if(_0x5d9a08[_0x36a8('0x1d')]){throw new Error(_0x36a8('0x14'));}if(_0x7e5b8b['blockDuration']>0x0){if(_0x5d9a08[_0x36a8('0x21')]){if(moment(_0x5d9a08[_0x36a8('0x1e')])[_0x36a8('0x22')](_0x7e5b8b[_0x36a8('0x18')],_0x36a8('0x23'))>moment()){throw new Error(_0x36a8('0x14'));}return utils['clearBlockUser'](_0x5d9a08,0x0,![],null)[_0x36a8('0x19')](function(){return utils[_0x36a8('0x24')](_0x5d9a08);})[_0x36a8('0x19')](function(){return _0x4540c4(null,_0x5d9a08);});}else{return utils[_0x36a8('0x24')](_0x5d9a08)['then'](function(){return _0x4540c4(null,_0x5d9a08);});}}else{return utils[_0x36a8('0x24')](_0x5d9a08)['then'](function(){return _0x4540c4(null,_0x5d9a08);});}})[_0x36a8('0x25')](function(_0x44d1b3){return _0x4540c4(null,![],_0x44d1b3);});}function handleError(_0x15c6ec,_0x1abe64,_0x2c392e){return _0x15c6ec[_0x36a8('0x26')](_0x1abe64||0x1f4)[_0x36a8('0x27')]({'message':_0x2c392e?_0x2c392e[_0x36a8('0x28')]||_0x2c392e:''});}exports['login']=function(_0x3fad4e,_0xe9e1fe,_0x1af121){passport[_0x36a8('0xe')](_0x36a8('0x29'),function(_0x3daa9a,_0x27b88f,_0x721970){var _0x10e7a7=_0x3daa9a||_0x721970;if(_0x10e7a7){return handleError(_0xe9e1fe,0x191,_0x10e7a7);}if(!_0x27b88f){return handleError(_0xe9e1fe,0x194,{'message':_0x36a8('0x2a')});}else{var _0x1376f1={'payload':{'id':_0x27b88f['id'],'role':_0x27b88f[_0x36a8('0x1c')]},'options':{'expiresIn':0x15180}};return authService[_0x36a8('0x2b')](_0x1376f1)['then'](function(_0x1bedbd){_0xe9e1fe[_0x36a8('0x2c')]({'id':_0x27b88f['id'],'token':_0x1bedbd,'statusCall':'','isAlreadyLogged':_0x27b88f[_0x36a8('0x1f')]});});}})(_0x3fad4e,_0xe9e1fe,_0x1af121);};passport[_0x36a8('0x2d')](_0x36a8('0x29'),new LocalStrategy({'usernameField':'name','passwordField':_0x36a8('0x1a')},function(_0x2741cc,_0x42c6c0,_0x58b2f5){return ActiveDirectoryAuthenticate(db[_0x36a8('0x2e')],_0x2741cc,_0x42c6c0,_0x58b2f5);}));
\ No newline at end of file
diff --git a/server/api/authActiveDirectory/index.js b/server/api/authActiveDirectory/index.js
index 5e88e24..cb1f823 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 _0x2e52=['post','login','exports','express','Router','./authActiveDirectory.controller'];(function(_0x15f9f8,_0x5d4f86){var _0x49fb6d=function(_0x5e8eb8){while(--_0x5e8eb8){_0x15f9f8['push'](_0x15f9f8['shift']());}};_0x49fb6d(++_0x5d4f86);}(_0x2e52,0x12f));var _0x22e5=function(_0x45d3f0,_0x4be53f){_0x45d3f0=_0x45d3f0-0x0;var _0x314b79=_0x2e52[_0x45d3f0];return _0x314b79;};'use strict';var express=require(_0x22e5('0x0'));var router=express[_0x22e5('0x1')]();var controller=require(_0x22e5('0x2'));router[_0x22e5('0x3')]('/',controller[_0x22e5('0x4')]);module[_0x22e5('0x5')]=router;
\ No newline at end of file
+var _0xd039=['Router','./authActiveDirectory.controller','post','login','exports'];(function(_0x519b26,_0x1fa5fc){var _0x3b0a64=function(_0x17d0cc){while(--_0x17d0cc){_0x519b26['push'](_0x519b26['shift']());}};_0x3b0a64(++_0x1fa5fc);}(_0xd039,0xa0));var _0x9d03=function(_0x216eb4,_0x10a33d){_0x216eb4=_0x216eb4-0x0;var _0x2b640f=_0xd039[_0x216eb4];return _0x2b640f;};'use strict';var express=require('express');var router=express[_0x9d03('0x0')]();var controller=require(_0x9d03('0x1'));router[_0x9d03('0x2')]('/',controller[_0x9d03('0x3')]);module[_0x9d03('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 f38ab3d..6100b48 100644
--- a/server/api/authGoogle/authGoogle.controller.js
+++ b/server/api/authGoogle/authGoogle.controller.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x7a54=['blockedAt','add','minutes','clearBlockUser','getLicense','catch','lodash','passport','passport-google-oauth20','moment','../../mysqldb','../../config/utils','login','authenticate','google','/login','email','use','secret','callbackURL','findOne','allowedLoginAttempts','blockDuration','then','User','find','map','value','admin','user','agent','Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'];(function(_0x3ab9ee,_0x4a74b8){var _0x82ee88=function(_0x6ccc7e){while(--_0x6ccc7e){_0x3ab9ee['push'](_0x3ab9ee['shift']());}};_0x82ee88(++_0x4a74b8);}(_0x7a54,0x106));var _0x47a5=function(_0x5a8f73,_0x1a821a){_0x5a8f73=_0x5a8f73-0x0;var _0x1d4f23=_0x7a54[_0x5a8f73];return _0x1d4f23;};'use strict';var _=require(_0x47a5('0x0'));var passport=require(_0x47a5('0x1'));var GoogleStrategy=require(_0x47a5('0x2'))['Strategy'];var moment=require(_0x47a5('0x3'));var db=require(_0x47a5('0x4'))['db'];var config=require('../../config/environment');var utils=require(_0x47a5('0x5'));exports[_0x47a5('0x6')]=passport[_0x47a5('0x7')](_0x47a5('0x8'),{'failureRedirect':_0x47a5('0x9'),'scope':['profile',_0x47a5('0xa')],'session':![]});exports['callback']=passport[_0x47a5('0x7')](_0x47a5('0x8'),{'failureRedirect':'/login','session':![]});passport[_0x47a5('0xb')](new GoogleStrategy({'clientID':config['google']?config['google']['clientID']:'id','clientSecret':config[_0x47a5('0x8')]?config[_0x47a5('0x8')]['clientSecret']:_0x47a5('0xc'),'callbackURL':config['google']?config['google'][_0x47a5('0xd')]:''},function(_0x69e4d4,_0x2f399b,_0x250fad,_0xd612dd){var _0xd308b8,_0x1eae59;return db['Setting'][_0x47a5('0xe')]({'where':{'id':0x1},'attributes':[_0x47a5('0xf'),_0x47a5('0x10')],'raw':!![]})[_0x47a5('0x11')](function(_0x139f25){_0xd308b8=_0x139f25;return db[_0x47a5('0x12')][_0x47a5('0x13')]({'where':{'email':_[_0x47a5('0x14')](_0x250fad['emails'],_0x47a5('0x15')),'role':{'$or':[_0x47a5('0x16'),_0x47a5('0x17'),_0x47a5('0x18')]}}});})[_0x47a5('0x11')](function(_0x574af6){_0x1eae59=_0x574af6;if(_0x1eae59){if(_0x1eae59['disabled']){return _0xd612dd(_0x47a5('0x19'));}else if(_0xd308b8['blockDuration']>0x0){if(_0x1eae59['blocked']){if(moment(_0x1eae59[_0x47a5('0x1a')])[_0x47a5('0x1b')](_0xd308b8[_0x47a5('0x10')],_0x47a5('0x1c'))>moment()){return _0xd612dd(_0x47a5('0x19'));}else{return utils[_0x47a5('0x1d')](_0x1eae59,0x0,![],null)[_0x47a5('0x11')](function(){return utils[_0x47a5('0x1e')](_0x1eae59);})[_0x47a5('0x11')](function(){return _0xd612dd(null,_0x1eae59);});}}else{return utils['getLicense'](_0x1eae59)[_0x47a5('0x11')](function(){return _0xd612dd(null,_0x1eae59);});}}else{return utils[_0x47a5('0x1e')](_0x1eae59)['then'](function(){return _0xd612dd(null,_0x1eae59);});}}return _0xd612dd(_0x47a5('0x19'));})[_0x47a5('0x1f')](function(_0x36874d){_0xd612dd(_0x36874d);});}));
\ No newline at end of file
+var _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(_0x201244,_0x164b93){var _0x3a5598=function(_0x418039){while(--_0x418039){_0x201244['push'](_0x201244['shift']());}};_0x3a5598(++_0x164b93);}(_0x9957,0x93));var _0x7995=function(_0x4cf98e,_0xba4b79){_0x4cf98e=_0x4cf98e-0x0;var _0x1623ac=_0x9957[_0x4cf98e];return _0x1623ac;};'use strict';var _=require(_0x7995('0x0'));var passport=require(_0x7995('0x1'));var GoogleStrategy=require(_0x7995('0x2'))[_0x7995('0x3')];var moment=require('moment');var db=require(_0x7995('0x4'))['db'];var config=require(_0x7995('0x5'));var utils=require(_0x7995('0x6'));exports[_0x7995('0x7')]=passport['authenticate'](_0x7995('0x8'),{'failureRedirect':_0x7995('0x9'),'scope':[_0x7995('0xa'),_0x7995('0xb')],'session':![]});exports[_0x7995('0xc')]=passport[_0x7995('0xd')]('google',{'failureRedirect':_0x7995('0x9'),'session':![]});passport[_0x7995('0xe')](new GoogleStrategy({'clientID':config['google']?config[_0x7995('0x8')][_0x7995('0xf')]:'id','clientSecret':config[_0x7995('0x8')]?config[_0x7995('0x8')][_0x7995('0x10')]:_0x7995('0x11'),'callbackURL':config[_0x7995('0x8')]?config['google'][_0x7995('0x12')]:''},function(_0x41c652,_0x581f22,_0xb0c872,_0x2cb37a){var _0x19a27e,_0x385f00;return db[_0x7995('0x13')][_0x7995('0x14')]({'where':{'id':0x1},'attributes':[_0x7995('0x15'),'blockDuration'],'raw':!![]})['then'](function(_0x2b4e94){_0x19a27e=_0x2b4e94;return db[_0x7995('0x16')][_0x7995('0x17')]({'where':{'email':_[_0x7995('0x18')](_0xb0c872[_0x7995('0x19')],_0x7995('0x1a')),'role':{'$or':[_0x7995('0x1b'),_0x7995('0x1c'),'agent']}}});})[_0x7995('0x1d')](function(_0x565d97){_0x385f00=_0x565d97;if(_0x385f00){if(_0x385f00[_0x7995('0x1e')]){return _0x2cb37a(_0x7995('0x1f'));}else if(_0x19a27e[_0x7995('0x20')]>0x0){if(_0x385f00[_0x7995('0x21')]){if(moment(_0x385f00[_0x7995('0x22')])[_0x7995('0x23')](_0x19a27e['blockDuration'],'minutes')>moment()){return _0x2cb37a(_0x7995('0x1f'));}else{return utils['clearBlockUser'](_0x385f00,0x0,![],null)['then'](function(){return utils[_0x7995('0x24')](_0x385f00);})[_0x7995('0x1d')](function(){return _0x2cb37a(null,_0x385f00);});}}else{return utils['getLicense'](_0x385f00)[_0x7995('0x1d')](function(){return _0x2cb37a(null,_0x385f00);});}}else{return utils['getLicense'](_0x385f00)['then'](function(){return _0x2cb37a(null,_0x385f00);});}}return _0x2cb37a(_0x7995('0x1f'));})[_0x7995('0x25')](function(_0x350fd9){_0x2cb37a(_0x350fd9);});}));
\ No newline at end of file
diff --git a/server/api/authGoogle/index.js b/server/api/authGoogle/index.js
index b99c69e..214288c 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 _0x196e=['../user/user.controller.js','../../components/auth/service','login','get','/callback','callback','isMiddleware','setTokenCookie','exports','express','passport','Router','./authGoogle.controller'];(function(_0x8c19a7,_0x5fb122){var _0x1e70cc=function(_0x4d099b){while(--_0x4d099b){_0x8c19a7['push'](_0x8c19a7['shift']());}};_0x1e70cc(++_0x5fb122);}(_0x196e,0xcc));var _0xe196=function(_0x4c2dfc,_0x4814c0){_0x4c2dfc=_0x4c2dfc-0x0;var _0xfd728d=_0x196e[_0x4c2dfc];return _0xfd728d;};'use strict';var express=require(_0xe196('0x0'));var passport=require(_0xe196('0x1'));var router=express[_0xe196('0x2')]();var controller=require(_0xe196('0x3'));var userController=require(_0xe196('0x4'));var authService=require(_0xe196('0x5'));router['get']('/',controller[_0xe196('0x6')]);router[_0xe196('0x7')](_0xe196('0x8'),controller[_0xe196('0x9')],authService[_0xe196('0xa')],userController[_0xe196('0x6')],authService[_0xe196('0xb')]);module[_0xe196('0xc')]=router;
\ No newline at end of file
+var _0x2dd6=['passport','Router','../user/user.controller.js','../../components/auth/service','get','/callback','login','exports','express'];(function(_0x5aba6b,_0x52d766){var _0x31b028=function(_0x18e54f){while(--_0x18e54f){_0x5aba6b['push'](_0x5aba6b['shift']());}};_0x31b028(++_0x52d766);}(_0x2dd6,0x8f));var _0x62dd=function(_0x41f1ac,_0x48eb21){_0x41f1ac=_0x41f1ac-0x0;var _0x1b2cdf=_0x2dd6[_0x41f1ac];return _0x1b2cdf;};'use strict';var express=require(_0x62dd('0x0'));var passport=require(_0x62dd('0x1'));var router=express[_0x62dd('0x2')]();var controller=require('./authGoogle.controller');var userController=require(_0x62dd('0x3'));var authService=require(_0x62dd('0x4'));router[_0x62dd('0x5')]('/',controller['login']);router[_0x62dd('0x5')](_0x62dd('0x6'),controller['callback'],authService['isMiddleware'],userController[_0x62dd('0x7')],authService['setTokenCookie']);module[_0x62dd('0x8')]=router;
\ No newline at end of file
diff --git a/server/api/authLocal/authLocal.controller.js b/server/api/authLocal/authLocal.controller.js
index cb43756..27a4f70 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 _0xa1b6=['blockedAt','loginAttempts','user','agent','Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.','authenticate','blockDuration','add','minutes','clearBlockUser','getLicense','catch','MailAccount','find','email','MailServerOut','Smtp','CloudProvider','Unable\x20to\x20find\x20a\x20configured\x20SMTP\x20service!','getSmtpOptions','merge','\x22%s\x22\x20<%s>','request','SendMail','format','error','stringify','send','login','Something\x20went\x20wrong,\x20please\x20try\x20again.','signToken','json','body','Email\x20parameter\x20is\x20missing','generate','trim','User','This\x20email\x20is\x20not\x20registered.','The\x20user\x20is\x20blocked.\x20Please\x20contact\x20the\x20administrator.','resetPasswordToken','now','save','xCally\x20Motion\x20Password\x20Reset','Please\x20click\x20on\x20the\x20following\x20link,\x20or\x20paste\x20this\x20into\x20your\x20browser\x20to\x20complete\x20the\x20process:\x0a\x0a','https://','headers','host','/reset/','If\x20you\x20did\x20not\x20request\x20this,\x20please\x20ignore\x20this\x20email\x20and\x20your\x20password\x20will\x20remain\x20unchanged.\x0a','status','Reset\x20Email\x20sent!','reset','params','Password\x20reset\x20token\x20is\x20invalid\x20or\x20has\x20expired.','enforcePasswordHistory','passwordHistoryLimit','previousPasswords','validatePasswordHistory','resetPasswordExpires','Password\x20reset!','use','local-login','util','passport','passport-local','Strategy','jayson/promise','randomstring','../../mysqldb','../../components/auth/service','../../config/utils','client','http','Setting','findOne','allowedLoginAttempts','then','name','password','salt','role','disabled','blocked'];(function(_0x4f091d,_0x5ab76d){var _0x254ce6=function(_0x408597){while(--_0x408597){_0x4f091d['push'](_0x4f091d['shift']());}};_0x254ce6(++_0x5ab76d);}(_0xa1b6,0x137));var _0x6a1b=function(_0xbd65ad,_0x13272c){_0xbd65ad=_0xbd65ad-0x0;var _0x2d6957=_0xa1b6[_0xbd65ad];return _0x2d6957;};'use strict';var util=require(_0x6a1b('0x0'));var passport=require(_0x6a1b('0x1'));var LocalStrategy=require(_0x6a1b('0x2'))[_0x6a1b('0x3')];var jayson=require(_0x6a1b('0x4'));var _=require('lodash');var rs=require(_0x6a1b('0x5'));var moment=require('moment');var db=require(_0x6a1b('0x6'))['db'];var authService=require(_0x6a1b('0x7'));var utils=require(_0x6a1b('0x8'));var client=jayson[_0x6a1b('0x9')][_0x6a1b('0xa')]({'port':0x232b});function localAuthenticate(_0x5bcb0e,_0x35ef30,_0x423070,_0x5dc1d2){var _0x509922,_0x523e18;return db[_0x6a1b('0xb')][_0x6a1b('0xc')]({'where':{'id':0x1},'attributes':[_0x6a1b('0xd'),'blockDuration'],'raw':!![]})[_0x6a1b('0xe')](function(_0xcf2bbc){_0x509922=_0xcf2bbc;return _0x5bcb0e[_0x6a1b('0xc')]({'attributes':['id',_0x6a1b('0xf'),_0x6a1b('0x10'),_0x6a1b('0x11'),_0x6a1b('0x12'),_0x6a1b('0x13'),_0x6a1b('0x14'),_0x6a1b('0x15'),_0x6a1b('0x16')],'where':{'name':_0x35ef30,'role':{'$or':['admin',_0x6a1b('0x17'),_0x6a1b('0x18')]}}});})[_0x6a1b('0xe')](function(_0x5353d4){if(!_0x5353d4||_0x5353d4&&_0x5353d4[_0x6a1b('0xf')]!==_0x35ef30){throw new Error(_0x6a1b('0x19'));}else{_0x523e18=_0x5353d4;return _0x523e18;}})[_0x6a1b('0xe')](function(){_0x523e18[_0x6a1b('0x1a')](_0x423070,function(_0x2569c5,_0x411272){var _0xcf7a3b=_0x523e18['loginAttempts']+0x1;if(_0x2569c5){return _0x5dc1d2(_0x2569c5);}else if(!_0x411272){if(_0x523e18[_0x6a1b('0x13')]){return _0x5dc1d2(null,![],{'message':_0x6a1b('0x19')});}else if(_0x509922[_0x6a1b('0xd')]>0x0){if(_0x523e18[_0x6a1b('0x14')]){if(_0x509922[_0x6a1b('0x1b')]>0x0){if(moment(_0x523e18[_0x6a1b('0x15')])[_0x6a1b('0x1c')](_0x509922[_0x6a1b('0x1b')],_0x6a1b('0x1d'))>moment()){return _0x5dc1d2(null,![],{'message':_0x6a1b('0x19')});}else{return utils[_0x6a1b('0x1e')](_0x523e18,_0xcf7a3b,![],null)[_0x6a1b('0xe')](function(){return _0x5dc1d2(null,![],{'message':_0x6a1b('0x19')});});}}else{return _0x5dc1d2(null,![],{'message':_0x6a1b('0x19')});}}else{if(_0xcf7a3b>=_0x509922[_0x6a1b('0xd')]){return utils[_0x6a1b('0x1e')](_0x523e18,0x0,!![],moment())[_0x6a1b('0xe')](function(){return _0x5dc1d2(null,![],{'message':_0x6a1b('0x19')});});}else{return utils[_0x6a1b('0x1e')](_0x523e18,_0xcf7a3b,![],null)[_0x6a1b('0xe')](function(){return _0x5dc1d2(null,![],{'message':_0x6a1b('0x19')});});}}}else{return _0x5dc1d2(null,![],{'message':_0x6a1b('0x19')});}}else{if(_0x523e18['disabled']){return _0x5dc1d2(null,![],{'message':_0x6a1b('0x19')});}else if(_0x509922[_0x6a1b('0xd')]>0x0){if(_0x523e18['blocked']){if(_0x509922[_0x6a1b('0x1b')]>0x0){if(moment(_0x523e18[_0x6a1b('0x15')])[_0x6a1b('0x1c')](_0x509922['blockDuration'],_0x6a1b('0x1d'))>moment()){return _0x5dc1d2(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});}else{return utils['clearBlockUser'](_0x523e18,0x0,![],null)[_0x6a1b('0xe')](function(){return utils[_0x6a1b('0x1f')](_0x523e18);})[_0x6a1b('0xe')](function(){return _0x5dc1d2(null,_0x523e18);});}}else{return _0x5dc1d2(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});}}else{return utils['clearBlockUser'](_0x523e18,0x0,![],null)['then'](function(){return utils[_0x6a1b('0x1f')](_0x523e18);})[_0x6a1b('0xe')](function(){return _0x5dc1d2(null,_0x523e18);})[_0x6a1b('0x20')](function(_0x40e151){return _0x5dc1d2(null,![],_0x40e151);});}}else{if(_0x523e18[_0x6a1b('0x14')]){return _0x5dc1d2(null,![],{'message':_0x6a1b('0x19')});}else{return utils[_0x6a1b('0x1f')](_0x523e18)[_0x6a1b('0xe')](function(){return _0x5dc1d2(null,_0x523e18);});}}}});})['catch'](function(_0xc66b12){return _0x5dc1d2(null,![],_0xc66b12);});}function sendServiceMail(_0x4dbc84){return db[_0x6a1b('0x21')][_0x6a1b('0x22')]({'where':{'service':!![]},'attributes':['id',_0x6a1b('0xf'),_0x6a1b('0x23')],'include':[{'model':db[_0x6a1b('0x24')],'as':_0x6a1b('0x25'),'include':[{'model':db[_0x6a1b('0x26')],'as':_0x6a1b('0x26')}]}]})[_0x6a1b('0xe')](function(_0x3b11e0){if(!_0x3b11e0){throw new Error(_0x6a1b('0x27'));}var _0x25fa63=_0x3b11e0[_0x6a1b('0x28')]();var _0x5490ce={'account':_0x25fa63,'message':_[_0x6a1b('0x29')]({'from':util['format'](_0x6a1b('0x2a'),_0x3b11e0[_0x6a1b('0xf')],_0x3b11e0[_0x6a1b('0x23')]||_0x3b11e0[_0x6a1b('0x25')][_0x6a1b('0x17')])},_0x4dbc84)};return client[_0x6a1b('0x2b')](_0x6a1b('0x2c'),_0x5490ce);})[_0x6a1b('0xe')](function(_0x750f86){if(_0x750f86['error']){throw new Error(util[_0x6a1b('0x2d')]('SendMail\x20error:\x20%s.\x20Please\x20contact\x20your\x20Administrator!',_0x750f86[_0x6a1b('0x2e')]['message']||JSON[_0x6a1b('0x2f')](_0x750f86[_0x6a1b('0x2e')])));}return!![];});}function handleError(_0x3e27a4,_0x24865d,_0x20b4ea){return _0x3e27a4['status'](_0x24865d||0x1f4)[_0x6a1b('0x30')]({'message':_0x20b4ea?_0x20b4ea['message']||_0x20b4ea:''});}exports[_0x6a1b('0x31')]=function(_0x150d08,_0xbb992b,_0x53b90b){passport[_0x6a1b('0x1a')]('local-login',function(_0xc85a4c,_0x44bf08,_0x2f857e){var _0x4ecf6b=_0xc85a4c||_0x2f857e;if(_0x4ecf6b){return handleError(_0xbb992b,0x191,_0x4ecf6b);}if(!_0x44bf08){return handleError(_0xbb992b,0x194,{'message':_0x6a1b('0x32')});}else{var _0x196b45={'payload':{'id':_0x44bf08['id'],'role':_0x44bf08[_0x6a1b('0x12')]},'options':{'expiresIn':0x15180}};return authService[_0x6a1b('0x33')](_0x196b45)['then'](function(_0x38e970){_0xbb992b[_0x6a1b('0x34')]({'id':_0x44bf08['id'],'token':_0x38e970,'statusCall':'','isAlreadyLogged':_0x44bf08['online']});});}})(_0x150d08,_0xbb992b,_0x53b90b);};exports['forgot']=function(_0x338342,_0x3ca645){if(!_0x338342[_0x6a1b('0x35')]['email']){return handleError(_0x3ca645,0x1f4,{'message':_0x6a1b('0x36')});}var _0x4f25b0=rs[_0x6a1b('0x37')]();_0x338342[_0x6a1b('0x35')]['email']=_0x338342[_0x6a1b('0x35')][_0x6a1b('0x23')][_0x6a1b('0x38')]()['toLowerCase']();var _0x245dc6;return db[_0x6a1b('0xb')][_0x6a1b('0xc')]({'where':{'id':0x1},'attributes':[_0x6a1b('0xd'),'blockDuration'],'raw':!![]})[_0x6a1b('0xe')](function(_0x58d982){_0x245dc6=_0x58d982;return db[_0x6a1b('0x39')][_0x6a1b('0x22')]({'where':{'email':_0x338342[_0x6a1b('0x35')][_0x6a1b('0x23')]}});})[_0x6a1b('0xe')](function(_0x2238c6){if(!_0x2238c6){throw new Error(_0x6a1b('0x3a'));}if(_0x2238c6[_0x6a1b('0x13')]){throw new Error('The\x20user\x20is\x20disabled.\x20Please\x20contact\x20the\x20administrator.');}if(_0x2238c6[_0x6a1b('0x14')]){if(moment(_0x2238c6[_0x6a1b('0x15')])[_0x6a1b('0x1c')](_0x245dc6[_0x6a1b('0x1b')],'minutes')>moment()){throw new Error(_0x6a1b('0x3b'));}else{_0x2238c6[_0x6a1b('0x14')]=![];_0x2238c6[_0x6a1b('0x15')]=null;}}_0x2238c6[_0x6a1b('0x3c')]=_0x4f25b0;_0x2238c6['resetPasswordExpires']=Date[_0x6a1b('0x3d')]()+0x36ee80;return _0x2238c6[_0x6a1b('0x3e')]();})[_0x6a1b('0xe')](function(){return sendServiceMail({'to':_0x338342['body'][_0x6a1b('0x23')],'subject':_0x6a1b('0x3f'),'text':'You\x20are\x20receiving\x20this\x20because\x20you\x20(or\x20someone\x20else)\x20have\x20requested\x20the\x20reset\x20of\x20the\x20password\x20for\x20your\x20account.\x0a\x0a'+_0x6a1b('0x40')+_0x6a1b('0x41')+_0x338342[_0x6a1b('0x42')][_0x6a1b('0x43')]+_0x6a1b('0x44')+_0x4f25b0+'\x0a\x0a'+_0x6a1b('0x45')});})[_0x6a1b('0xe')](function(){_0x3ca645[_0x6a1b('0x46')](0xc8)[_0x6a1b('0x30')]({'message':_0x6a1b('0x47')});})[_0x6a1b('0x20')](function(_0x2dddff){return handleError(_0x3ca645,0x1f4,_0x2dddff);});};exports[_0x6a1b('0x48')]=function(_0x371f31,_0x290a4f){return db[_0x6a1b('0x39')][_0x6a1b('0x22')]({'where':{'resetPasswordToken':_0x371f31[_0x6a1b('0x49')]['token'],'resetPasswordExpires':{'$gt':Date[_0x6a1b('0x3d')]()}}})[_0x6a1b('0xe')](function(_0x7cfad3){if(!_0x7cfad3){throw new Error(_0x6a1b('0x4a'));}return db[_0x6a1b('0xb')][_0x6a1b('0xc')]({'attributes':['id','securePassword',_0x6a1b('0x4b'),_0x6a1b('0x4c')]})[_0x6a1b('0xe')](function(_0x285c9c){if(_0x285c9c['securePassword'])authService['validatePasswordPattern'](_0x371f31[_0x6a1b('0x35')][_0x6a1b('0x10')]);if(!_0x285c9c[_0x6a1b('0x4b')]||!_0x7cfad3[_0x6a1b('0x4d')])return _0x7cfad3;authService[_0x6a1b('0x4e')](_0x371f31['body'][_0x6a1b('0x10')],_0x7cfad3[_0x6a1b('0x4d')],_0x285c9c[_0x6a1b('0x4c')]);return _0x7cfad3;})['then'](function(){_0x7cfad3[_0x6a1b('0x10')]=_0x371f31[_0x6a1b('0x35')][_0x6a1b('0x10')];_0x7cfad3['resetPasswordToken']=null;_0x7cfad3[_0x6a1b('0x4f')]=null;return _0x7cfad3[_0x6a1b('0x3e')]();});})['then'](function(){_0x290a4f[_0x6a1b('0x46')](0xc8)[_0x6a1b('0x30')]({'message':_0x6a1b('0x50')});})['catch'](function(_0x311005){return handleError(_0x290a4f,0x1f4,_0x311005);});};passport[_0x6a1b('0x51')](_0x6a1b('0x52'),new LocalStrategy({'usernameField':_0x6a1b('0xf'),'passwordField':_0x6a1b('0x10')},function(_0x40fbf9,_0x14a211,_0x24772b){return localAuthenticate(db[_0x6a1b('0x39')],_0x40fbf9,_0x14a211,_0x24772b);}));
\ No newline at end of file
+var _0xd469=['request','SendMail','error','format','SendMail\x20error:\x20%s.\x20Please\x20contact\x20your\x20Administrator!','message','stringify','status','send','local-login','signToken','json','online','forgot','Email\x20parameter\x20is\x20missing','trim','User','body','The\x20user\x20is\x20disabled.\x20Please\x20contact\x20the\x20administrator.','The\x20user\x20is\x20blocked.\x20Please\x20contact\x20the\x20administrator.','resetPasswordToken','resetPasswordExpires','now','xCally\x20Motion\x20Password\x20Reset','You\x20are\x20receiving\x20this\x20because\x20you\x20(or\x20someone\x20else)\x20have\x20requested\x20the\x20reset\x20of\x20the\x20password\x20for\x20your\x20account.\x0a\x0a','https://','host','/reset/','If\x20you\x20did\x20not\x20request\x20this,\x20please\x20ignore\x20this\x20email\x20and\x20your\x20password\x20will\x20remain\x20unchanged.\x0a','Reset\x20Email\x20sent!','reset','params','Password\x20reset\x20token\x20is\x20invalid\x20or\x20has\x20expired.','enforcePasswordHistory','passwordHistoryLimit','securePassword','validatePasswordPattern','validatePasswordHistory','previousPasswords','Password\x20reset!','use','util','passport-local','Strategy','jayson/promise','../../mysqldb','../../components/auth/service','../../config/utils','client','http','Setting','findOne','allowedLoginAttempts','then','name','password','salt','role','disabled','blocked','blockedAt','admin','agent','authenticate','loginAttempts','Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.','add','minutes','clearBlockUser','blockDuration','getLicense','catch','MailAccount','find','email','MailServerOut','Smtp','CloudProvider','getSmtpOptions','\x22%s\x22\x20<%s>'];(function(_0x2d81ec,_0x255b3e){var _0x147094=function(_0x5c8316){while(--_0x5c8316){_0x2d81ec['push'](_0x2d81ec['shift']());}};_0x147094(++_0x255b3e);}(_0xd469,0x169));var _0x9d46=function(_0x5b5429,_0x4167b1){_0x5b5429=_0x5b5429-0x0;var _0x158dee=_0xd469[_0x5b5429];return _0x158dee;};'use strict';var util=require(_0x9d46('0x0'));var passport=require('passport');var LocalStrategy=require(_0x9d46('0x1'))[_0x9d46('0x2')];var jayson=require(_0x9d46('0x3'));var _=require('lodash');var rs=require('randomstring');var moment=require('moment');var db=require(_0x9d46('0x4'))['db'];var authService=require(_0x9d46('0x5'));var utils=require(_0x9d46('0x6'));var client=jayson[_0x9d46('0x7')][_0x9d46('0x8')]({'port':0x232b});function localAuthenticate(_0x2ba4d4,_0x16ad0b,_0x1bf270,_0xfb9372){var _0x833e67,_0x1a09f8;return db[_0x9d46('0x9')][_0x9d46('0xa')]({'where':{'id':0x1},'attributes':[_0x9d46('0xb'),'blockDuration'],'raw':!![]})[_0x9d46('0xc')](function(_0xcf01ad){_0x833e67=_0xcf01ad;return _0x2ba4d4['findOne']({'attributes':['id',_0x9d46('0xd'),_0x9d46('0xe'),_0x9d46('0xf'),_0x9d46('0x10'),_0x9d46('0x11'),_0x9d46('0x12'),_0x9d46('0x13'),'loginAttempts'],'where':{'name':_0x16ad0b,'role':{'$or':[_0x9d46('0x14'),'user',_0x9d46('0x15')]}}});})[_0x9d46('0xc')](function(_0x9069a7){if(!_0x9069a7||_0x9069a7&&_0x9069a7[_0x9d46('0xd')]!==_0x16ad0b){throw new Error('Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.');}else{_0x1a09f8=_0x9069a7;return _0x1a09f8;}})[_0x9d46('0xc')](function(){_0x1a09f8[_0x9d46('0x16')](_0x1bf270,function(_0x1dd011,_0x5145a2){var _0x3d5673=_0x1a09f8[_0x9d46('0x17')]+0x1;if(_0x1dd011){return _0xfb9372(_0x1dd011);}else if(!_0x5145a2){if(_0x1a09f8[_0x9d46('0x11')]){return _0xfb9372(null,![],{'message':_0x9d46('0x18')});}else if(_0x833e67[_0x9d46('0xb')]>0x0){if(_0x1a09f8[_0x9d46('0x12')]){if(_0x833e67['blockDuration']>0x0){if(moment(_0x1a09f8[_0x9d46('0x13')])[_0x9d46('0x19')](_0x833e67['blockDuration'],_0x9d46('0x1a'))>moment()){return _0xfb9372(null,![],{'message':_0x9d46('0x18')});}else{return utils['clearBlockUser'](_0x1a09f8,_0x3d5673,![],null)[_0x9d46('0xc')](function(){return _0xfb9372(null,![],{'message':_0x9d46('0x18')});});}}else{return _0xfb9372(null,![],{'message':_0x9d46('0x18')});}}else{if(_0x3d5673>=_0x833e67[_0x9d46('0xb')]){return utils[_0x9d46('0x1b')](_0x1a09f8,0x0,!![],moment())[_0x9d46('0xc')](function(){return _0xfb9372(null,![],{'message':_0x9d46('0x18')});});}else{return utils[_0x9d46('0x1b')](_0x1a09f8,_0x3d5673,![],null)[_0x9d46('0xc')](function(){return _0xfb9372(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});});}}}else{return _0xfb9372(null,![],{'message':_0x9d46('0x18')});}}else{if(_0x1a09f8['disabled']){return _0xfb9372(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});}else if(_0x833e67[_0x9d46('0xb')]>0x0){if(_0x1a09f8['blocked']){if(_0x833e67[_0x9d46('0x1c')]>0x0){if(moment(_0x1a09f8[_0x9d46('0x13')])['add'](_0x833e67['blockDuration'],_0x9d46('0x1a'))>moment()){return _0xfb9372(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});}else{return utils[_0x9d46('0x1b')](_0x1a09f8,0x0,![],null)['then'](function(){return utils[_0x9d46('0x1d')](_0x1a09f8);})[_0x9d46('0xc')](function(){return _0xfb9372(null,_0x1a09f8);});}}else{return _0xfb9372(null,![],{'message':_0x9d46('0x18')});}}else{return utils[_0x9d46('0x1b')](_0x1a09f8,0x0,![],null)[_0x9d46('0xc')](function(){return utils['getLicense'](_0x1a09f8);})[_0x9d46('0xc')](function(){return _0xfb9372(null,_0x1a09f8);})[_0x9d46('0x1e')](function(_0x257938){return _0xfb9372(null,![],_0x257938);});}}else{if(_0x1a09f8[_0x9d46('0x12')]){return _0xfb9372(null,![],{'message':_0x9d46('0x18')});}else{return utils['getLicense'](_0x1a09f8)[_0x9d46('0xc')](function(){return _0xfb9372(null,_0x1a09f8);});}}}});})[_0x9d46('0x1e')](function(_0x156d58){return _0xfb9372(null,![],_0x156d58);});}function sendServiceMail(_0x29f6df){return db[_0x9d46('0x1f')][_0x9d46('0x20')]({'where':{'service':!![]},'attributes':['id',_0x9d46('0xd'),_0x9d46('0x21')],'include':[{'model':db[_0x9d46('0x22')],'as':_0x9d46('0x23'),'include':[{'model':db[_0x9d46('0x24')],'as':_0x9d46('0x24')}]}]})['then'](function(_0x4a8e96){if(!_0x4a8e96){throw new Error('Unable\x20to\x20find\x20a\x20configured\x20SMTP\x20service!');}var _0x4c368e=_0x4a8e96[_0x9d46('0x25')]();var _0x3859a2={'account':_0x4c368e,'message':_['merge']({'from':util['format'](_0x9d46('0x26'),_0x4a8e96[_0x9d46('0xd')],_0x4a8e96[_0x9d46('0x21')]||_0x4a8e96[_0x9d46('0x23')]['user'])},_0x29f6df)};return client[_0x9d46('0x27')](_0x9d46('0x28'),_0x3859a2);})[_0x9d46('0xc')](function(_0x231ead){if(_0x231ead[_0x9d46('0x29')]){throw new Error(util[_0x9d46('0x2a')](_0x9d46('0x2b'),_0x231ead['error'][_0x9d46('0x2c')]||JSON[_0x9d46('0x2d')](_0x231ead['error'])));}return!![];});}function handleError(_0x2cd341,_0x225e64,_0x59614e){return _0x2cd341[_0x9d46('0x2e')](_0x225e64||0x1f4)[_0x9d46('0x2f')]({'message':_0x59614e?_0x59614e[_0x9d46('0x2c')]||_0x59614e:''});}exports['login']=function(_0x1462ed,_0x5b3202,_0x21474b){passport[_0x9d46('0x16')](_0x9d46('0x30'),function(_0x47e90b,_0x5e3bbb,_0x59975e){var _0x1cf6d9=_0x47e90b||_0x59975e;if(_0x1cf6d9){return handleError(_0x5b3202,0x191,_0x1cf6d9);}if(!_0x5e3bbb){return handleError(_0x5b3202,0x194,{'message':'Something\x20went\x20wrong,\x20please\x20try\x20again.'});}else{var _0x3ccb62={'payload':{'id':_0x5e3bbb['id'],'role':_0x5e3bbb[_0x9d46('0x10')]},'options':{'expiresIn':0x15180}};return authService[_0x9d46('0x31')](_0x3ccb62)[_0x9d46('0xc')](function(_0x3ce15a){_0x5b3202[_0x9d46('0x32')]({'id':_0x5e3bbb['id'],'token':_0x3ce15a,'statusCall':'','isAlreadyLogged':_0x5e3bbb[_0x9d46('0x33')]});});}})(_0x1462ed,_0x5b3202,_0x21474b);};exports[_0x9d46('0x34')]=function(_0x4251a1,_0x311a48){if(!_0x4251a1['body'][_0x9d46('0x21')]){return handleError(_0x311a48,0x1f4,{'message':_0x9d46('0x35')});}var _0x2e9c7a=rs['generate']();_0x4251a1['body'][_0x9d46('0x21')]=_0x4251a1['body']['email'][_0x9d46('0x36')]()['toLowerCase']();var _0x3c6039;return db[_0x9d46('0x9')][_0x9d46('0xa')]({'where':{'id':0x1},'attributes':[_0x9d46('0xb'),'blockDuration'],'raw':!![]})[_0x9d46('0xc')](function(_0x16d652){_0x3c6039=_0x16d652;return db[_0x9d46('0x37')][_0x9d46('0x20')]({'where':{'email':_0x4251a1[_0x9d46('0x38')][_0x9d46('0x21')]}});})['then'](function(_0x3e25c8){if(!_0x3e25c8){throw new Error('This\x20email\x20is\x20not\x20registered.');}if(_0x3e25c8[_0x9d46('0x11')]){throw new Error(_0x9d46('0x39'));}if(_0x3e25c8[_0x9d46('0x12')]){if(moment(_0x3e25c8[_0x9d46('0x13')])['add'](_0x3c6039['blockDuration'],'minutes')>moment()){throw new Error(_0x9d46('0x3a'));}else{_0x3e25c8[_0x9d46('0x12')]=![];_0x3e25c8[_0x9d46('0x13')]=null;}}_0x3e25c8[_0x9d46('0x3b')]=_0x2e9c7a;_0x3e25c8[_0x9d46('0x3c')]=Date[_0x9d46('0x3d')]()+0x36ee80;return _0x3e25c8['save']();})['then'](function(){return sendServiceMail({'to':_0x4251a1[_0x9d46('0x38')][_0x9d46('0x21')],'subject':_0x9d46('0x3e'),'text':_0x9d46('0x3f')+'Please\x20click\x20on\x20the\x20following\x20link,\x20or\x20paste\x20this\x20into\x20your\x20browser\x20to\x20complete\x20the\x20process:\x0a\x0a'+_0x9d46('0x40')+_0x4251a1['headers'][_0x9d46('0x41')]+_0x9d46('0x42')+_0x2e9c7a+'\x0a\x0a'+_0x9d46('0x43')});})['then'](function(){_0x311a48[_0x9d46('0x2e')](0xc8)[_0x9d46('0x2f')]({'message':_0x9d46('0x44')});})[_0x9d46('0x1e')](function(_0x11a178){return handleError(_0x311a48,0x1f4,_0x11a178);});};exports[_0x9d46('0x45')]=function(_0xa35d10,_0xae88cb){return db[_0x9d46('0x37')][_0x9d46('0x20')]({'where':{'resetPasswordToken':_0xa35d10[_0x9d46('0x46')]['token'],'resetPasswordExpires':{'$gt':Date[_0x9d46('0x3d')]()}}})[_0x9d46('0xc')](function(_0x1a364f){if(!_0x1a364f){throw new Error(_0x9d46('0x47'));}return db[_0x9d46('0x9')][_0x9d46('0xa')]({'attributes':['id','securePassword',_0x9d46('0x48'),_0x9d46('0x49')]})['then'](function(_0x41f630){if(_0x41f630[_0x9d46('0x4a')])authService[_0x9d46('0x4b')](_0xa35d10['body']['password']);if(!_0x41f630['enforcePasswordHistory']||!_0x1a364f['previousPasswords'])return _0x1a364f;authService[_0x9d46('0x4c')](_0xa35d10[_0x9d46('0x38')]['password'],_0x1a364f[_0x9d46('0x4d')],_0x41f630[_0x9d46('0x49')]);return _0x1a364f;})[_0x9d46('0xc')](function(){_0x1a364f[_0x9d46('0xe')]=_0xa35d10[_0x9d46('0x38')][_0x9d46('0xe')];_0x1a364f[_0x9d46('0x3b')]=null;_0x1a364f[_0x9d46('0x3c')]=null;return _0x1a364f['save']();});})[_0x9d46('0xc')](function(){_0xae88cb[_0x9d46('0x2e')](0xc8)['send']({'message':_0x9d46('0x4e')});})[_0x9d46('0x1e')](function(_0x13df30){return handleError(_0xae88cb,0x1f4,_0x13df30);});};passport[_0x9d46('0x4f')]('local-login',new LocalStrategy({'usernameField':'name','passwordField':'password'},function(_0x2210b8,_0x27eea3,_0x2ce12a){return localAuthenticate(db['User'],_0x2210b8,_0x27eea3,_0x2ce12a);}));
\ No newline at end of file
diff --git a/server/api/authLocal/index.js b/server/api/authLocal/index.js
index a3b8c02..08bf813 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 _0xd0a3=['reset','exports','express','./authLocal.controller','login','post','/forgot','forgot','/reset/:token'];(function(_0x40640c,_0x3b92e9){var _0x27c8cc=function(_0x5e9c32){while(--_0x5e9c32){_0x40640c['push'](_0x40640c['shift']());}};_0x27c8cc(++_0x3b92e9);}(_0xd0a3,0x80));var _0x3d0a=function(_0xb01ded,_0x57ef66){_0xb01ded=_0xb01ded-0x0;var _0x541634=_0xd0a3[_0xb01ded];return _0x541634;};'use strict';var express=require(_0x3d0a('0x0'));var router=express['Router']();var controller=require(_0x3d0a('0x1'));router['post']('/',controller[_0x3d0a('0x2')]);router[_0x3d0a('0x3')](_0x3d0a('0x4'),controller[_0x3d0a('0x5')]);router[_0x3d0a('0x3')](_0x3d0a('0x6'),controller[_0x3d0a('0x7')]);module[_0x3d0a('0x8')]=router;
\ No newline at end of file
+var _0x728e=['post','forgot','/reset/:token','reset','exports','Router'];(function(_0x19b84f,_0x48765e){var _0x18067b=function(_0x1c69aa){while(--_0x1c69aa){_0x19b84f['push'](_0x19b84f['shift']());}};_0x18067b(++_0x48765e);}(_0x728e,0xef));var _0xe728=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x728e[_0x20a584];return _0x4b41a8;};'use strict';var express=require('express');var router=express[_0xe728('0x0')]();var controller=require('./authLocal.controller');router[_0xe728('0x1')]('/',controller['login']);router[_0xe728('0x1')]('/forgot',controller[_0xe728('0x2')]);router[_0xe728('0x1')](_0xe728('0x3'),controller[_0xe728('0x4')]);module[_0xe728('0x5')]=router;
\ No newline at end of file
diff --git a/server/api/automation/automation.attributes.js b/server/api/automation/automation.attributes.js
index 77d6580..1c609cd 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 _0xff82=['INTEGER','sequelize','exports','STRING','BOOLEAN'];(function(_0x403f5f,_0x283f67){var _0x15b1cd=function(_0x238cab){while(--_0x238cab){_0x403f5f['push'](_0x403f5f['shift']());}};_0x15b1cd(++_0x283f67);}(_0xff82,0x13c));var _0x2ff8=function(_0x8d57ff,_0x262930){_0x8d57ff=_0x8d57ff-0x0;var _0x3d42c7=_0xff82[_0x8d57ff];return _0x3d42c7;};'use strict';var Sequelize=require(_0x2ff8('0x0'));module[_0x2ff8('0x1')]={'name':{'type':Sequelize[_0x2ff8('0x2')],'allowNull':![]},'channel':{'type':Sequelize[_0x2ff8('0x2')]},'description':{'type':Sequelize[_0x2ff8('0x2')]},'status':{'type':Sequelize[_0x2ff8('0x3')],'defaultValue':![]},'timeout':{'type':Sequelize[_0x2ff8('0x4')],'defaultValue':0xa}};
\ No newline at end of file
+var _0x3013=['sequelize','STRING','BOOLEAN'];(function(_0x372515,_0xdd11f){var _0xa3bf4e=function(_0x212cc8){while(--_0x212cc8){_0x372515['push'](_0x372515['shift']());}};_0xa3bf4e(++_0xdd11f);}(_0x3013,0xc0));var _0x3301=function(_0x427165,_0x56a160){_0x427165=_0x427165-0x0;var _0xe1fb08=_0x3013[_0x427165];return _0xe1fb08;};'use strict';var Sequelize=require(_0x3301('0x0'));module['exports']={'name':{'type':Sequelize[_0x3301('0x1')],'allowNull':![]},'channel':{'type':Sequelize[_0x3301('0x1')]},'description':{'type':Sequelize[_0x3301('0x1')]},'status':{'type':Sequelize[_0x3301('0x2')],'defaultValue':![]},'timeout':{'type':Sequelize['INTEGER'],'defaultValue':0xa}};
\ No newline at end of file
diff --git a/server/api/automation/automation.controller.js b/server/api/automation/automation.controller.js
index 85d2ba6..9e29174 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 _0x7284=['map','Automation','rawAttributes','type','key','query','keys','filters','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filter','merge','VIRTUAL','include','findAll','rows','catch','show','options','find','create','body','params','addConditions','ids','omit','getConditions','findOne','Condition','Action','getActions','pick','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','to-csv','ejs','squel','jsforce','desk.js','querystring','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','end','json','offset','limit','undefined','set','Content-Range','apply','reject','save','update','then','destroy','sendStatus','error','stack','name','send','index'];(function(_0x44f0fd,_0x363ca8){var _0x5e28de=function(_0x218086){while(--_0x218086){_0x44f0fd['push'](_0x44f0fd['shift']());}};_0x5e28de(++_0x363ca8);}(_0x7284,0x1c7));var _0x4728=function(_0x375a24,_0x1c1fb6){_0x375a24=_0x375a24-0x0;var _0x38d80e=_0x7284[_0x375a24];return _0x38d80e;};'use strict';var emlformat=require(_0x4728('0x0'));var rimraf=require(_0x4728('0x1'));var zipdir=require(_0x4728('0x2'));var jsonpatch=require(_0x4728('0x3'));var rp=require(_0x4728('0x4'));var moment=require(_0x4728('0x5'));var BPromise=require(_0x4728('0x6'));var Mustache=require('mustache');var util=require(_0x4728('0x7'));var path=require(_0x4728('0x8'));var sox=require('sox');var csv=require(_0x4728('0x9'));var ejs=require(_0x4728('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0x4728('0xb'));var crypto=require('crypto');var jsforce=require(_0x4728('0xc'));var deskjs=require(_0x4728('0xd'));var toCsv=require(_0x4728('0x9'));var querystring=require(_0x4728('0xe'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x4728('0xf'));var qs=require('../../components/parsers/qs');var as=require(_0x4728('0x10'));var hardwareService=require(_0x4728('0x11'));var logger=require('../../config/logger')(_0x4728('0x12'));var utils=require(_0x4728('0x13'));var config=require(_0x4728('0x14'));var licenseUtil=require(_0x4728('0x15'));var db=require(_0x4728('0x16'))['db'];function respondWithStatusCode(_0x6d6442,_0x49ce5b){_0x49ce5b=_0x49ce5b||0xcc;return function(_0x307afe){if(_0x307afe){return _0x6d6442['sendStatus'](_0x49ce5b);}return _0x6d6442[_0x4728('0x17')](_0x49ce5b)[_0x4728('0x18')]();};}function respondWithResult(_0x2a5269,_0x3f1ba7){_0x3f1ba7=_0x3f1ba7||0xc8;return function(_0x276b4f){if(_0x276b4f){return _0x2a5269[_0x4728('0x17')](_0x3f1ba7)[_0x4728('0x19')](_0x276b4f);}};}function respondWithFilteredResult(_0x15b9f2,_0x37ddfb){return function(_0xdbb6fd){if(_0xdbb6fd){var _0x3ff388=typeof _0x37ddfb[_0x4728('0x1a')]==='undefined'&&typeof _0x37ddfb[_0x4728('0x1b')]===_0x4728('0x1c');var _0x5b50b6=_0xdbb6fd['count'];var _0x54c200=_0x3ff388?0x0:_0x37ddfb['offset'];var _0x2f63a2=_0x3ff388?_0xdbb6fd['count']:_0x37ddfb[_0x4728('0x1a')]+_0x37ddfb[_0x4728('0x1b')];var _0x53546d;if(_0x2f63a2>=_0x5b50b6){_0x2f63a2=_0x5b50b6;_0x53546d=0xc8;}else{_0x53546d=0xce;}_0x15b9f2[_0x4728('0x17')](_0x53546d);return _0x15b9f2[_0x4728('0x1d')](_0x4728('0x1e'),_0x54c200+'-'+_0x2f63a2+'/'+_0x5b50b6)[_0x4728('0x19')](_0xdbb6fd);}return null;};}function patchUpdates(_0x287280){return function(_0x31c1f6){try{jsonpatch[_0x4728('0x1f')](_0x31c1f6,_0x287280,!![]);}catch(_0x586a11){return BPromise[_0x4728('0x20')](_0x586a11);}return _0x31c1f6[_0x4728('0x21')]();};}function saveUpdates(_0xd65cc9,_0x4cfa15){return function(_0x973e14){if(_0x973e14){return _0x973e14[_0x4728('0x22')](_0xd65cc9)[_0x4728('0x23')](function(_0x434a9e){return _0x434a9e;});}return null;};}function removeEntity(_0x1e865b,_0x1d8bd6){return function(_0x24d995){if(_0x24d995){return _0x24d995[_0x4728('0x24')]()[_0x4728('0x23')](function(){_0x1e865b[_0x4728('0x17')](0xcc)[_0x4728('0x18')]();});}};}function handleEntityNotFound(_0x57b6df,_0x85ebd8){return function(_0x55a248){if(!_0x55a248){_0x57b6df[_0x4728('0x25')](0x194);}return _0x55a248;};}function handleError(_0x42936a,_0x3a3c76){_0x3a3c76=_0x3a3c76||0x1f4;return function(_0x3e679c){logger[_0x4728('0x26')](_0x3e679c[_0x4728('0x27')]);if(_0x3e679c[_0x4728('0x28')]){delete _0x3e679c[_0x4728('0x28')];}_0x42936a[_0x4728('0x17')](_0x3a3c76)[_0x4728('0x29')](_0x3e679c);};}exports[_0x4728('0x2a')]=function(_0x4d90eb,_0x29eafc){var _0x57d7b8={},_0x11c4da={},_0x49bde5={'count':0x0,'rows':[]};var _0x433d4e=_[_0x4728('0x2b')](db[_0x4728('0x2c')][_0x4728('0x2d')],function(_0x4684f6){return{'name':_0x4684f6['fieldName'],'type':_0x4684f6[_0x4728('0x2e')][_0x4728('0x2f')]};});_0x11c4da['model']=_[_0x4728('0x2b')](_0x433d4e,_0x4728('0x28'));_0x11c4da[_0x4728('0x30')]=_[_0x4728('0x31')](_0x4d90eb['query']);_0x11c4da[_0x4728('0x32')]=_[_0x4728('0x33')](_0x11c4da[_0x4728('0x34')],_0x11c4da['query']);_0x57d7b8[_0x4728('0x35')]=_[_0x4728('0x33')](_0x11c4da[_0x4728('0x34')],qs['fields'](_0x4d90eb['query'][_0x4728('0x36')]));_0x57d7b8[_0x4728('0x35')]=_0x57d7b8['attributes'][_0x4728('0x37')]?_0x57d7b8[_0x4728('0x35')]:_0x11c4da['model'];if(!_0x4d90eb['query'][_0x4728('0x38')](_0x4728('0x39'))){_0x57d7b8[_0x4728('0x1b')]=qs['limit'](_0x4d90eb[_0x4728('0x30')][_0x4728('0x1b')]);_0x57d7b8[_0x4728('0x1a')]=qs[_0x4728('0x1a')](_0x4d90eb[_0x4728('0x30')][_0x4728('0x1a')]);}_0x57d7b8[_0x4728('0x3a')]=qs[_0x4728('0x3b')](_0x4d90eb[_0x4728('0x30')][_0x4728('0x3b')]);_0x57d7b8[_0x4728('0x3c')]=qs['filters'](_['pick'](_0x4d90eb['query'],_0x11c4da[_0x4728('0x32')]),_0x433d4e);if(_0x4d90eb[_0x4728('0x30')][_0x4728('0x3d')]){_0x57d7b8['where']=_[_0x4728('0x3e')](_0x57d7b8['where'],{'$or':_[_0x4728('0x2b')](_0x433d4e,function(_0x44ecc9){if(_0x44ecc9[_0x4728('0x2e')]!==_0x4728('0x3f')){var _0x284857={};_0x284857[_0x44ecc9['name']]={'$like':'%'+_0x4d90eb['query'][_0x4728('0x3d')]+'%'};return _0x284857;}})});}_0x57d7b8=_[_0x4728('0x3e')]({},_0x57d7b8,_0x4d90eb['options']);var _0xa549c9={'where':_0x57d7b8[_0x4728('0x3c')]};return db['Automation']['count'](_0xa549c9)[_0x4728('0x23')](function(_0x218a07){_0x49bde5['count']=_0x218a07;if(_0x4d90eb[_0x4728('0x30')]['includeAll']){_0x57d7b8[_0x4728('0x40')]=[{'all':!![]}];}return db[_0x4728('0x2c')][_0x4728('0x41')](_0x57d7b8);})[_0x4728('0x23')](function(_0x1dbe45){_0x49bde5[_0x4728('0x42')]=_0x1dbe45;return _0x49bde5;})[_0x4728('0x23')](respondWithFilteredResult(_0x29eafc,_0x57d7b8))[_0x4728('0x43')](handleError(_0x29eafc,null));};exports[_0x4728('0x44')]=function(_0x26874c,_0x5c030d){var _0x2ee9ca={'raw':![],'where':{'id':_0x26874c['params']['id']}},_0x16820e={};_0x16820e[_0x4728('0x34')]=_[_0x4728('0x31')](db[_0x4728('0x2c')][_0x4728('0x2d')]);_0x16820e['query']=_['keys'](_0x26874c[_0x4728('0x30')]);_0x16820e[_0x4728('0x32')]=_[_0x4728('0x33')](_0x16820e[_0x4728('0x34')],_0x16820e[_0x4728('0x30')]);_0x2ee9ca['attributes']=_[_0x4728('0x33')](_0x16820e['model'],qs[_0x4728('0x36')](_0x26874c[_0x4728('0x30')][_0x4728('0x36')]));_0x2ee9ca['attributes']=_0x2ee9ca[_0x4728('0x35')][_0x4728('0x37')]?_0x2ee9ca[_0x4728('0x35')]:_0x16820e['model'];if(_0x26874c[_0x4728('0x30')]['includeAll']){_0x2ee9ca['include']=[{'all':!![]}];}_0x2ee9ca=_[_0x4728('0x3e')]({},_0x2ee9ca,_0x26874c[_0x4728('0x45')]);return db[_0x4728('0x2c')][_0x4728('0x46')](_0x2ee9ca)[_0x4728('0x23')](handleEntityNotFound(_0x5c030d,null))['then'](respondWithResult(_0x5c030d,null))[_0x4728('0x43')](handleError(_0x5c030d,null));};exports[_0x4728('0x47')]=function(_0x47b6eb,_0x587881){return db[_0x4728('0x2c')][_0x4728('0x47')](_0x47b6eb[_0x4728('0x48')],{})['then'](respondWithResult(_0x587881,0xc9))[_0x4728('0x43')](handleError(_0x587881,null));};exports[_0x4728('0x22')]=function(_0x3d993a,_0x9858b7){if(_0x3d993a[_0x4728('0x48')]['id']){delete _0x3d993a['body']['id'];}return db[_0x4728('0x2c')][_0x4728('0x46')]({'where':{'id':_0x3d993a[_0x4728('0x49')]['id']}})[_0x4728('0x23')](handleEntityNotFound(_0x9858b7,null))[_0x4728('0x23')](saveUpdates(_0x3d993a[_0x4728('0x48')],null))[_0x4728('0x23')](respondWithResult(_0x9858b7,null))['catch'](handleError(_0x9858b7,null));};exports[_0x4728('0x24')]=function(_0x535aff,_0x57dd2b){return db[_0x4728('0x2c')]['find']({'where':{'id':_0x535aff[_0x4728('0x49')]['id']}})[_0x4728('0x23')](handleEntityNotFound(_0x57dd2b,null))[_0x4728('0x23')](removeEntity(_0x57dd2b,null))['catch'](handleError(_0x57dd2b,null));};exports[_0x4728('0x4a')]=function(_0xe87fc9,_0x29ed73,_0x4ecb11){return db['Condition'][_0x4728('0x46')]({'where':{'id':_0xe87fc9[_0x4728('0x49')]['id']}})['then'](handleEntityNotFound(_0x29ed73,null))[_0x4728('0x23')](function(_0xc02e0){if(_0xc02e0){return _0xc02e0[_0x4728('0x4a')](_0xe87fc9[_0x4728('0x48')][_0x4728('0x4b')],_[_0x4728('0x4c')](_0xe87fc9[_0x4728('0x48')],[_0x4728('0x4b'),'id'])||{});}})['then'](respondWithResult(_0x29ed73,null))[_0x4728('0x43')](handleError(_0x29ed73,null));};exports[_0x4728('0x4d')]=function(_0x1e2c0a,_0x2e9209,_0x2c7beb){var _0x300961={};var _0x240f14={};var _0x4b43f5;var _0x1e9724;return db[_0x4728('0x2c')][_0x4728('0x4e')]({'where':{'id':_0x1e2c0a[_0x4728('0x49')]['id']}})[_0x4728('0x23')](handleEntityNotFound(_0x2e9209,null))['then'](function(_0x873498){if(_0x873498){_0x4b43f5=_0x873498;_0x240f14['model']=_[_0x4728('0x31')](db[_0x4728('0x4f')][_0x4728('0x2d')]);_0x240f14[_0x4728('0x30')]=_[_0x4728('0x31')](_0x1e2c0a[_0x4728('0x30')]);_0x240f14[_0x4728('0x32')]=_['intersection'](_0x240f14[_0x4728('0x34')],_0x240f14[_0x4728('0x30')]);_0x300961[_0x4728('0x35')]=_[_0x4728('0x33')](_0x240f14['model'],qs[_0x4728('0x36')](_0x1e2c0a[_0x4728('0x30')][_0x4728('0x36')]));_0x300961[_0x4728('0x35')]=_0x300961[_0x4728('0x35')][_0x4728('0x37')]?_0x300961[_0x4728('0x35')]:_0x240f14['model'];_0x300961[_0x4728('0x3a')]=qs[_0x4728('0x3b')](_0x1e2c0a[_0x4728('0x30')]['sort']);_0x300961['where']=qs[_0x4728('0x32')](_['pick'](_0x1e2c0a[_0x4728('0x30')],_0x240f14[_0x4728('0x32')]));if(_0x1e2c0a[_0x4728('0x30')][_0x4728('0x3d')]){_0x300961[_0x4728('0x3c')]=_['merge'](_0x300961['where'],{'$or':_[_0x4728('0x2b')](_0x300961['attributes'],function(_0x36ebe2){var _0x16f014={};_0x16f014[_0x36ebe2]={'$like':'%'+_0x1e2c0a[_0x4728('0x30')][_0x4728('0x3d')]+'%'};return _0x16f014;})});}_0x300961=_[_0x4728('0x3e')]({},_0x300961,_0x1e2c0a[_0x4728('0x45')]);return _0x4b43f5['getConditions'](_0x300961);}})[_0x4728('0x23')](function(_0x2a5681){if(_0x2a5681){_0x1e9724=_0x2a5681['length'];if(!_0x1e2c0a[_0x4728('0x30')][_0x4728('0x38')](_0x4728('0x39'))){_0x300961[_0x4728('0x1b')]=qs[_0x4728('0x1b')](_0x1e2c0a['query'][_0x4728('0x1b')]);_0x300961['offset']=qs[_0x4728('0x1a')](_0x1e2c0a['query'][_0x4728('0x1a')]);}return _0x4b43f5['getConditions'](_0x300961);}})[_0x4728('0x23')](function(_0x28f2fc){if(_0x28f2fc){return _0x28f2fc?{'count':_0x1e9724,'rows':_0x28f2fc}:null;}})[_0x4728('0x23')](respondWithResult(_0x2e9209,null))[_0x4728('0x43')](handleError(_0x2e9209,null));};exports['addActions']=function(_0x4c7d6e,_0x452de6,_0x337b4c){return db[_0x4728('0x50')][_0x4728('0x46')]({'where':{'id':_0x4c7d6e['params']['id']}})[_0x4728('0x23')](handleEntityNotFound(_0x452de6,null))[_0x4728('0x23')](function(_0x22a95f){if(_0x22a95f){return _0x22a95f['addActions'](_0x4c7d6e[_0x4728('0x48')][_0x4728('0x4b')],_['omit'](_0x4c7d6e[_0x4728('0x48')],[_0x4728('0x4b'),'id'])||{});}})[_0x4728('0x23')](respondWithResult(_0x452de6,null))[_0x4728('0x43')](handleError(_0x452de6,null));};exports[_0x4728('0x51')]=function(_0xaa29f6,_0x1b5758,_0x376614){var _0x5146d9={};var _0x284cf6={};var _0x47626a;var _0x46c2fb;return db[_0x4728('0x2c')][_0x4728('0x4e')]({'where':{'id':_0xaa29f6['params']['id']}})[_0x4728('0x23')](handleEntityNotFound(_0x1b5758,null))[_0x4728('0x23')](function(_0x5c79c5){if(_0x5c79c5){_0x47626a=_0x5c79c5;_0x284cf6[_0x4728('0x34')]=_['keys'](db['Action'][_0x4728('0x2d')]);_0x284cf6[_0x4728('0x30')]=_[_0x4728('0x31')](_0xaa29f6[_0x4728('0x30')]);_0x284cf6[_0x4728('0x32')]=_[_0x4728('0x33')](_0x284cf6['model'],_0x284cf6['query']);_0x5146d9[_0x4728('0x35')]=_[_0x4728('0x33')](_0x284cf6[_0x4728('0x34')],qs[_0x4728('0x36')](_0xaa29f6[_0x4728('0x30')][_0x4728('0x36')]));_0x5146d9[_0x4728('0x35')]=_0x5146d9[_0x4728('0x35')][_0x4728('0x37')]?_0x5146d9[_0x4728('0x35')]:_0x284cf6[_0x4728('0x34')];_0x5146d9[_0x4728('0x3a')]=qs[_0x4728('0x3b')](_0xaa29f6['query'][_0x4728('0x3b')]);_0x5146d9['where']=qs[_0x4728('0x32')](_[_0x4728('0x52')](_0xaa29f6[_0x4728('0x30')],_0x284cf6['filters']));if(_0xaa29f6[_0x4728('0x30')][_0x4728('0x3d')]){_0x5146d9[_0x4728('0x3c')]=_['merge'](_0x5146d9[_0x4728('0x3c')],{'$or':_[_0x4728('0x2b')](_0x5146d9[_0x4728('0x35')],function(_0x45d7ef){var _0x35cd28={};_0x35cd28[_0x45d7ef]={'$like':'%'+_0xaa29f6[_0x4728('0x30')][_0x4728('0x3d')]+'%'};return _0x35cd28;})});}_0x5146d9=_[_0x4728('0x3e')]({},_0x5146d9,_0xaa29f6['options']);return _0x47626a[_0x4728('0x51')](_0x5146d9);}})[_0x4728('0x23')](function(_0x283280){if(_0x283280){_0x46c2fb=_0x283280[_0x4728('0x37')];if(!_0xaa29f6[_0x4728('0x30')][_0x4728('0x38')](_0x4728('0x39'))){_0x5146d9[_0x4728('0x1b')]=qs[_0x4728('0x1b')](_0xaa29f6[_0x4728('0x30')][_0x4728('0x1b')]);_0x5146d9['offset']=qs['offset'](_0xaa29f6[_0x4728('0x30')][_0x4728('0x1a')]);}return _0x47626a['getActions'](_0x5146d9);}})['then'](function(_0x21bd1a){if(_0x21bd1a){return _0x21bd1a?{'count':_0x46c2fb,'rows':_0x21bd1a}:null;}})[_0x4728('0x23')](respondWithResult(_0x1b5758,null))[_0x4728('0x43')](handleError(_0x1b5758,null));};
\ No newline at end of file
+var _0xccff=['then','error','stack','name','send','index','map','Automation','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','nolimit','order','sort','where','merge','VIRTUAL','filter','options','includeAll','findAll','rows','catch','include','body','find','params','addConditions','Condition','ids','omit','getConditions','findOne','rawAttributes','hasOwnProperty','addActions','Action','getActions','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','reject','save'];(function(_0x1cc8fe,_0x105328){var _0x230054=function(_0x1a1b56){while(--_0x1a1b56){_0x1cc8fe['push'](_0x1cc8fe['shift']());}};_0x230054(++_0x105328);}(_0xccff,0x12d));var _0xfccf=function(_0x2d9da3,_0x63174d){_0x2d9da3=_0x2d9da3-0x0;var _0x2a8d6a=_0xccff[_0x2d9da3];return _0x2a8d6a;};'use strict';var emlformat=require(_0xfccf('0x0'));var rimraf=require(_0xfccf('0x1'));var zipdir=require(_0xfccf('0x2'));var jsonpatch=require(_0xfccf('0x3'));var rp=require('request-promise');var moment=require(_0xfccf('0x4'));var BPromise=require(_0xfccf('0x5'));var Mustache=require(_0xfccf('0x6'));var util=require(_0xfccf('0x7'));var path=require(_0xfccf('0x8'));var sox=require(_0xfccf('0x9'));var csv=require(_0xfccf('0xa'));var ejs=require(_0xfccf('0xb'));var fs=require('fs');var fs_extra=require(_0xfccf('0xc'));var _=require(_0xfccf('0xd'));var squel=require(_0xfccf('0xe'));var crypto=require('crypto');var jsforce=require(_0xfccf('0xf'));var deskjs=require(_0xfccf('0x10'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0xfccf('0x11'));var Redis=require('ioredis');var authService=require(_0xfccf('0x12'));var qs=require(_0xfccf('0x13'));var as=require(_0xfccf('0x14'));var hardwareService=require(_0xfccf('0x15'));var logger=require(_0xfccf('0x16'))(_0xfccf('0x17'));var utils=require(_0xfccf('0x18'));var config=require('../../config/environment');var licenseUtil=require(_0xfccf('0x19'));var db=require(_0xfccf('0x1a'))['db'];function respondWithStatusCode(_0x4e2e7d,_0x1dfe40){_0x1dfe40=_0x1dfe40||0xcc;return function(_0x4f23aa){if(_0x4f23aa){return _0x4e2e7d[_0xfccf('0x1b')](_0x1dfe40);}return _0x4e2e7d[_0xfccf('0x1c')](_0x1dfe40)[_0xfccf('0x1d')]();};}function respondWithResult(_0x42cb47,_0x2489fd){_0x2489fd=_0x2489fd||0xc8;return function(_0x4a5cfd){if(_0x4a5cfd){return _0x42cb47[_0xfccf('0x1c')](_0x2489fd)[_0xfccf('0x1e')](_0x4a5cfd);}};}function respondWithFilteredResult(_0x58a48a,_0x6b5712){return function(_0x396ed2){if(_0x396ed2){var _0x52a8c4=typeof _0x6b5712[_0xfccf('0x1f')]===_0xfccf('0x20')&&typeof _0x6b5712[_0xfccf('0x21')]===_0xfccf('0x20');var _0x46d117=_0x396ed2[_0xfccf('0x22')];var _0x3c48f7=_0x52a8c4?0x0:_0x6b5712[_0xfccf('0x1f')];var _0x49a045=_0x52a8c4?_0x396ed2[_0xfccf('0x22')]:_0x6b5712[_0xfccf('0x1f')]+_0x6b5712['limit'];var _0x517572;if(_0x49a045>=_0x46d117){_0x49a045=_0x46d117;_0x517572=0xc8;}else{_0x517572=0xce;}_0x58a48a[_0xfccf('0x1c')](_0x517572);return _0x58a48a[_0xfccf('0x23')](_0xfccf('0x24'),_0x3c48f7+'-'+_0x49a045+'/'+_0x46d117)[_0xfccf('0x1e')](_0x396ed2);}return null;};}function patchUpdates(_0x2933dd){return function(_0x5c966d){try{jsonpatch['apply'](_0x5c966d,_0x2933dd,!![]);}catch(_0x50cda3){return BPromise[_0xfccf('0x25')](_0x50cda3);}return _0x5c966d[_0xfccf('0x26')]();};}function saveUpdates(_0x25e923,_0x476b9a){return function(_0x7797c2){if(_0x7797c2){return _0x7797c2['update'](_0x25e923)[_0xfccf('0x27')](function(_0x329508){return _0x329508;});}return null;};}function removeEntity(_0x524949,_0x22c63f){return function(_0x1337f7){if(_0x1337f7){return _0x1337f7['destroy']()[_0xfccf('0x27')](function(){_0x524949[_0xfccf('0x1c')](0xcc)[_0xfccf('0x1d')]();});}};}function handleEntityNotFound(_0x46e1e0,_0x18242d){return function(_0x2ce0be){if(!_0x2ce0be){_0x46e1e0[_0xfccf('0x1b')](0x194);}return _0x2ce0be;};}function handleError(_0x430958,_0x694358){_0x694358=_0x694358||0x1f4;return function(_0x428cf4){logger[_0xfccf('0x28')](_0x428cf4[_0xfccf('0x29')]);if(_0x428cf4[_0xfccf('0x2a')]){delete _0x428cf4[_0xfccf('0x2a')];}_0x430958[_0xfccf('0x1c')](_0x694358)[_0xfccf('0x2b')](_0x428cf4);};}exports[_0xfccf('0x2c')]=function(_0x24c517,_0x26a67c){var _0x1ff73e={},_0x48e741={},_0x35955b={'count':0x0,'rows':[]};var _0x528f91=_[_0xfccf('0x2d')](db[_0xfccf('0x2e')]['rawAttributes'],function(_0x170cf7){return{'name':_0x170cf7[_0xfccf('0x2f')],'type':_0x170cf7[_0xfccf('0x30')][_0xfccf('0x31')]};});_0x48e741[_0xfccf('0x32')]=_[_0xfccf('0x2d')](_0x528f91,'name');_0x48e741[_0xfccf('0x33')]=_[_0xfccf('0x34')](_0x24c517[_0xfccf('0x33')]);_0x48e741[_0xfccf('0x35')]=_[_0xfccf('0x36')](_0x48e741['model'],_0x48e741[_0xfccf('0x33')]);_0x1ff73e[_0xfccf('0x37')]=_[_0xfccf('0x36')](_0x48e741[_0xfccf('0x32')],qs[_0xfccf('0x38')](_0x24c517['query']['fields']));_0x1ff73e[_0xfccf('0x37')]=_0x1ff73e[_0xfccf('0x37')][_0xfccf('0x39')]?_0x1ff73e[_0xfccf('0x37')]:_0x48e741[_0xfccf('0x32')];if(!_0x24c517[_0xfccf('0x33')]['hasOwnProperty'](_0xfccf('0x3a'))){_0x1ff73e['limit']=qs[_0xfccf('0x21')](_0x24c517['query'][_0xfccf('0x21')]);_0x1ff73e['offset']=qs[_0xfccf('0x1f')](_0x24c517[_0xfccf('0x33')][_0xfccf('0x1f')]);}_0x1ff73e[_0xfccf('0x3b')]=qs[_0xfccf('0x3c')](_0x24c517[_0xfccf('0x33')][_0xfccf('0x3c')]);_0x1ff73e[_0xfccf('0x3d')]=qs['filters'](_['pick'](_0x24c517[_0xfccf('0x33')],_0x48e741[_0xfccf('0x35')]),_0x528f91);if(_0x24c517['query']['filter']){_0x1ff73e['where']=_[_0xfccf('0x3e')](_0x1ff73e[_0xfccf('0x3d')],{'$or':_[_0xfccf('0x2d')](_0x528f91,function(_0x1437b9){if(_0x1437b9[_0xfccf('0x30')]!==_0xfccf('0x3f')){var _0x3e396d={};_0x3e396d[_0x1437b9[_0xfccf('0x2a')]]={'$like':'%'+_0x24c517['query'][_0xfccf('0x40')]+'%'};return _0x3e396d;}})});}_0x1ff73e=_['merge']({},_0x1ff73e,_0x24c517[_0xfccf('0x41')]);var _0x2ee9da={'where':_0x1ff73e[_0xfccf('0x3d')]};return db[_0xfccf('0x2e')]['count'](_0x2ee9da)[_0xfccf('0x27')](function(_0x25d164){_0x35955b['count']=_0x25d164;if(_0x24c517[_0xfccf('0x33')][_0xfccf('0x42')]){_0x1ff73e['include']=[{'all':!![]}];}return db['Automation'][_0xfccf('0x43')](_0x1ff73e);})[_0xfccf('0x27')](function(_0x6cf8da){_0x35955b[_0xfccf('0x44')]=_0x6cf8da;return _0x35955b;})[_0xfccf('0x27')](respondWithFilteredResult(_0x26a67c,_0x1ff73e))[_0xfccf('0x45')](handleError(_0x26a67c,null));};exports['show']=function(_0x3d1dff,_0x3f025b){var _0x1fbe79={'raw':![],'where':{'id':_0x3d1dff['params']['id']}},_0x411d2d={};_0x411d2d['model']=_[_0xfccf('0x34')](db[_0xfccf('0x2e')]['rawAttributes']);_0x411d2d[_0xfccf('0x33')]=_[_0xfccf('0x34')](_0x3d1dff[_0xfccf('0x33')]);_0x411d2d['filters']=_[_0xfccf('0x36')](_0x411d2d[_0xfccf('0x32')],_0x411d2d['query']);_0x1fbe79[_0xfccf('0x37')]=_['intersection'](_0x411d2d[_0xfccf('0x32')],qs['fields'](_0x3d1dff['query'][_0xfccf('0x38')]));_0x1fbe79['attributes']=_0x1fbe79[_0xfccf('0x37')][_0xfccf('0x39')]?_0x1fbe79[_0xfccf('0x37')]:_0x411d2d['model'];if(_0x3d1dff['query']['includeAll']){_0x1fbe79[_0xfccf('0x46')]=[{'all':!![]}];}_0x1fbe79=_[_0xfccf('0x3e')]({},_0x1fbe79,_0x3d1dff['options']);return db['Automation']['find'](_0x1fbe79)['then'](handleEntityNotFound(_0x3f025b,null))['then'](respondWithResult(_0x3f025b,null))[_0xfccf('0x45')](handleError(_0x3f025b,null));};exports['create']=function(_0x383996,_0x22cbde){return db[_0xfccf('0x2e')]['create'](_0x383996[_0xfccf('0x47')],{})[_0xfccf('0x27')](respondWithResult(_0x22cbde,0xc9))['catch'](handleError(_0x22cbde,null));};exports['update']=function(_0x59d0f9,_0x274590){if(_0x59d0f9[_0xfccf('0x47')]['id']){delete _0x59d0f9[_0xfccf('0x47')]['id'];}return db[_0xfccf('0x2e')][_0xfccf('0x48')]({'where':{'id':_0x59d0f9['params']['id']}})[_0xfccf('0x27')](handleEntityNotFound(_0x274590,null))[_0xfccf('0x27')](saveUpdates(_0x59d0f9[_0xfccf('0x47')],null))[_0xfccf('0x27')](respondWithResult(_0x274590,null))[_0xfccf('0x45')](handleError(_0x274590,null));};exports['destroy']=function(_0x2fb1e1,_0x3d5857){return db[_0xfccf('0x2e')][_0xfccf('0x48')]({'where':{'id':_0x2fb1e1[_0xfccf('0x49')]['id']}})[_0xfccf('0x27')](handleEntityNotFound(_0x3d5857,null))[_0xfccf('0x27')](removeEntity(_0x3d5857,null))[_0xfccf('0x45')](handleError(_0x3d5857,null));};exports[_0xfccf('0x4a')]=function(_0x3d8c40,_0xf51ba0,_0x595df0){return db[_0xfccf('0x4b')][_0xfccf('0x48')]({'where':{'id':_0x3d8c40[_0xfccf('0x49')]['id']}})[_0xfccf('0x27')](handleEntityNotFound(_0xf51ba0,null))[_0xfccf('0x27')](function(_0x502989){if(_0x502989){return _0x502989[_0xfccf('0x4a')](_0x3d8c40['body'][_0xfccf('0x4c')],_[_0xfccf('0x4d')](_0x3d8c40[_0xfccf('0x47')],[_0xfccf('0x4c'),'id'])||{});}})[_0xfccf('0x27')](respondWithResult(_0xf51ba0,null))[_0xfccf('0x45')](handleError(_0xf51ba0,null));};exports[_0xfccf('0x4e')]=function(_0x11a370,_0x3d5910,_0x38b21d){var _0x1f9479={};var _0xa8f759={};var _0x4be441;var _0x52419e;return db[_0xfccf('0x2e')][_0xfccf('0x4f')]({'where':{'id':_0x11a370[_0xfccf('0x49')]['id']}})[_0xfccf('0x27')](handleEntityNotFound(_0x3d5910,null))[_0xfccf('0x27')](function(_0x152cf8){if(_0x152cf8){_0x4be441=_0x152cf8;_0xa8f759[_0xfccf('0x32')]=_[_0xfccf('0x34')](db[_0xfccf('0x4b')][_0xfccf('0x50')]);_0xa8f759[_0xfccf('0x33')]=_['keys'](_0x11a370[_0xfccf('0x33')]);_0xa8f759[_0xfccf('0x35')]=_[_0xfccf('0x36')](_0xa8f759[_0xfccf('0x32')],_0xa8f759[_0xfccf('0x33')]);_0x1f9479['attributes']=_['intersection'](_0xa8f759['model'],qs[_0xfccf('0x38')](_0x11a370['query'][_0xfccf('0x38')]));_0x1f9479['attributes']=_0x1f9479[_0xfccf('0x37')][_0xfccf('0x39')]?_0x1f9479[_0xfccf('0x37')]:_0xa8f759['model'];_0x1f9479[_0xfccf('0x3b')]=qs[_0xfccf('0x3c')](_0x11a370[_0xfccf('0x33')][_0xfccf('0x3c')]);_0x1f9479[_0xfccf('0x3d')]=qs[_0xfccf('0x35')](_['pick'](_0x11a370[_0xfccf('0x33')],_0xa8f759[_0xfccf('0x35')]));if(_0x11a370[_0xfccf('0x33')][_0xfccf('0x40')]){_0x1f9479[_0xfccf('0x3d')]=_['merge'](_0x1f9479[_0xfccf('0x3d')],{'$or':_[_0xfccf('0x2d')](_0x1f9479[_0xfccf('0x37')],function(_0x638f8e){var _0x47d7eb={};_0x47d7eb[_0x638f8e]={'$like':'%'+_0x11a370[_0xfccf('0x33')]['filter']+'%'};return _0x47d7eb;})});}_0x1f9479=_[_0xfccf('0x3e')]({},_0x1f9479,_0x11a370[_0xfccf('0x41')]);return _0x4be441[_0xfccf('0x4e')](_0x1f9479);}})[_0xfccf('0x27')](function(_0x3ff54e){if(_0x3ff54e){_0x52419e=_0x3ff54e['length'];if(!_0x11a370[_0xfccf('0x33')][_0xfccf('0x51')](_0xfccf('0x3a'))){_0x1f9479['limit']=qs[_0xfccf('0x21')](_0x11a370[_0xfccf('0x33')]['limit']);_0x1f9479[_0xfccf('0x1f')]=qs['offset'](_0x11a370[_0xfccf('0x33')][_0xfccf('0x1f')]);}return _0x4be441[_0xfccf('0x4e')](_0x1f9479);}})[_0xfccf('0x27')](function(_0x203fc4){if(_0x203fc4){return _0x203fc4?{'count':_0x52419e,'rows':_0x203fc4}:null;}})[_0xfccf('0x27')](respondWithResult(_0x3d5910,null))[_0xfccf('0x45')](handleError(_0x3d5910,null));};exports[_0xfccf('0x52')]=function(_0x1dded2,_0x204022,_0x3c2c52){return db[_0xfccf('0x53')]['find']({'where':{'id':_0x1dded2[_0xfccf('0x49')]['id']}})['then'](handleEntityNotFound(_0x204022,null))[_0xfccf('0x27')](function(_0x2471c9){if(_0x2471c9){return _0x2471c9[_0xfccf('0x52')](_0x1dded2[_0xfccf('0x47')]['ids'],_['omit'](_0x1dded2['body'],[_0xfccf('0x4c'),'id'])||{});}})[_0xfccf('0x27')](respondWithResult(_0x204022,null))['catch'](handleError(_0x204022,null));};exports[_0xfccf('0x54')]=function(_0x384465,_0x5417b8,_0x5b2e3e){var _0x3d0cb8={};var _0xd12783={};var _0x35a457;var _0x1913ab;return db[_0xfccf('0x2e')][_0xfccf('0x4f')]({'where':{'id':_0x384465[_0xfccf('0x49')]['id']}})[_0xfccf('0x27')](handleEntityNotFound(_0x5417b8,null))['then'](function(_0x1d23f6){if(_0x1d23f6){_0x35a457=_0x1d23f6;_0xd12783[_0xfccf('0x32')]=_[_0xfccf('0x34')](db[_0xfccf('0x53')]['rawAttributes']);_0xd12783[_0xfccf('0x33')]=_[_0xfccf('0x34')](_0x384465[_0xfccf('0x33')]);_0xd12783[_0xfccf('0x35')]=_[_0xfccf('0x36')](_0xd12783[_0xfccf('0x32')],_0xd12783[_0xfccf('0x33')]);_0x3d0cb8[_0xfccf('0x37')]=_[_0xfccf('0x36')](_0xd12783['model'],qs[_0xfccf('0x38')](_0x384465['query'][_0xfccf('0x38')]));_0x3d0cb8['attributes']=_0x3d0cb8['attributes']['length']?_0x3d0cb8['attributes']:_0xd12783[_0xfccf('0x32')];_0x3d0cb8[_0xfccf('0x3b')]=qs[_0xfccf('0x3c')](_0x384465[_0xfccf('0x33')][_0xfccf('0x3c')]);_0x3d0cb8[_0xfccf('0x3d')]=qs[_0xfccf('0x35')](_['pick'](_0x384465['query'],_0xd12783['filters']));if(_0x384465[_0xfccf('0x33')][_0xfccf('0x40')]){_0x3d0cb8[_0xfccf('0x3d')]=_[_0xfccf('0x3e')](_0x3d0cb8['where'],{'$or':_[_0xfccf('0x2d')](_0x3d0cb8[_0xfccf('0x37')],function(_0xd5c101){var _0x45294b={};_0x45294b[_0xd5c101]={'$like':'%'+_0x384465[_0xfccf('0x33')]['filter']+'%'};return _0x45294b;})});}_0x3d0cb8=_[_0xfccf('0x3e')]({},_0x3d0cb8,_0x384465[_0xfccf('0x41')]);return _0x35a457[_0xfccf('0x54')](_0x3d0cb8);}})[_0xfccf('0x27')](function(_0x5632f6){if(_0x5632f6){_0x1913ab=_0x5632f6[_0xfccf('0x39')];if(!_0x384465['query']['hasOwnProperty'](_0xfccf('0x3a'))){_0x3d0cb8[_0xfccf('0x21')]=qs[_0xfccf('0x21')](_0x384465['query'][_0xfccf('0x21')]);_0x3d0cb8['offset']=qs[_0xfccf('0x1f')](_0x384465[_0xfccf('0x33')][_0xfccf('0x1f')]);}return _0x35a457['getActions'](_0x3d0cb8);}})[_0xfccf('0x27')](function(_0x1df4a8){if(_0x1df4a8){return _0x1df4a8?{'count':_0x1913ab,'rows':_0x1df4a8}:null;}})[_0xfccf('0x27')](respondWithResult(_0x5417b8,null))[_0xfccf('0x45')](handleError(_0x5417b8,null));};
\ No newline at end of file
diff --git a/server/api/automation/automation.model.js b/server/api/automation/automation.model.js
index 00d4ed2..92af92d 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 _0xc1bd=['define','Automation','tools_automations','lodash','util','../../config/logger','api','rimraf','../../config/environment','./automation.attributes'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xc1bd,0x7b));var _0xdc1b=function(_0x1c4854,_0x3b968d){_0x1c4854=_0x1c4854-0x0;var _0x5029db=_0xc1bd[_0x1c4854];return _0x5029db;};'use strict';var _=require(_0xdc1b('0x0'));var util=require(_0xdc1b('0x1'));var logger=require(_0xdc1b('0x2'))(_0xdc1b('0x3'));var moment=require('moment');var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0xdc1b('0x4'));var config=require(_0xdc1b('0x5'));var attributes=require(_0xdc1b('0x6'));module['exports']=function(_0x7ba2b9,_0x279276){return _0x7ba2b9[_0xdc1b('0x7')](_0xdc1b('0x8'),attributes,{'tableName':_0xdc1b('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xc414=['../../config/environment','./automation.attributes','exports','define','Automation','tools_automations','util','../../config/logger','api','moment','path'];(function(_0xb197,_0x29fd68){var _0x34bebb=function(_0xf7e8f3){while(--_0xf7e8f3){_0xb197['push'](_0xb197['shift']());}};_0x34bebb(++_0x29fd68);}(_0xc414,0x13a));var _0x4c41=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xc414[_0x3dd15e];return _0x231fd0;};'use strict';var _=require('lodash');var util=require(_0x4c41('0x0'));var logger=require(_0x4c41('0x1'))(_0x4c41('0x2'));var moment=require(_0x4c41('0x3'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x4c41('0x4'));var rimraf=require('rimraf');var config=require(_0x4c41('0x5'));var attributes=require(_0x4c41('0x6'));module[_0x4c41('0x7')]=function(_0x5e85f6,_0x5ebfce){return _0x5e85f6[_0x4c41('0x8')](_0x4c41('0x9'),attributes,{'tableName':_0x4c41('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 b65cb0a..a598aff 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 _0xf61e=['info','Automation,\x20%s,\x20%s','request\x20sent','debug','Automation,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http'];(function(_0x103aa7,_0x148425){var _0x1aa8a8=function(_0x360436){while(--_0x360436){_0x103aa7['push'](_0x103aa7['shift']());}};_0x1aa8a8(++_0x148425);}(_0xf61e,0x191));var _0xef61=function(_0xd3fef4,_0x5b25e2){_0xd3fef4=_0xd3fef4-0x0;var _0x160e69=_0xf61e[_0xd3fef4];return _0x160e69;};'use strict';var _=require(_0xef61('0x0'));var util=require(_0xef61('0x1'));var moment=require(_0xef61('0x2'));var BPromise=require(_0xef61('0x3'));var rs=require(_0xef61('0x4'));var fs=require('fs');var Redis=require(_0xef61('0x5'));var db=require(_0xef61('0x6'))['db'];var utils=require(_0xef61('0x7'));var logger=require(_0xef61('0x8'))(_0xef61('0x9'));var config=require(_0xef61('0xa'));var jayson=require(_0xef61('0xb'));var client=jayson['client'][_0xef61('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x3e2f79,_0x4f0cc5,_0x2242a7){return new BPromise(function(_0x277fa1,_0x106e7f){return client['request'](_0x3e2f79,_0x2242a7)['then'](function(_0x188894){logger[_0xef61('0xd')](_0xef61('0xe'),_0x4f0cc5,_0xef61('0xf'));logger[_0xef61('0x10')](_0xef61('0x11'),_0x4f0cc5,_0xef61('0xf'),JSON[_0xef61('0x12')](_0x188894));if(_0x188894[_0xef61('0x13')]){if(_0x188894[_0xef61('0x13')][_0xef61('0x14')]===0x1f4){logger[_0xef61('0x13')](_0xef61('0xe'),_0x4f0cc5,_0x188894[_0xef61('0x13')]['message']);return _0x106e7f(_0x188894[_0xef61('0x13')]['message']);}logger[_0xef61('0x13')](_0xef61('0xe'),_0x4f0cc5,_0x188894[_0xef61('0x13')][_0xef61('0x15')]);return _0x277fa1(_0x188894['error'][_0xef61('0x15')]);}else{logger[_0xef61('0xd')](_0xef61('0xe'),_0x4f0cc5,_0xef61('0xf'));_0x277fa1(_0x188894['result'][_0xef61('0x15')]);}})[_0xef61('0x16')](function(_0x4f7a62){logger[_0xef61('0x13')](_0xef61('0xe'),_0x4f0cc5,_0x4f7a62);_0x106e7f(_0x4f7a62);});});}
\ No newline at end of file
+var _0x2272=['lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','jayson/promise','client','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'];(function(_0x327935,_0x3b4150){var _0x26d1a0=function(_0x1d34fc){while(--_0x1d34fc){_0x327935['push'](_0x327935['shift']());}};_0x26d1a0(++_0x3b4150);}(_0x2272,0xd8));var _0x2227=function(_0x19e35c,_0x29cd1e){_0x19e35c=_0x19e35c-0x0;var _0x3e1fe8=_0x2272[_0x19e35c];return _0x3e1fe8;};'use strict';var _=require(_0x2227('0x0'));var util=require(_0x2227('0x1'));var moment=require(_0x2227('0x2'));var BPromise=require(_0x2227('0x3'));var rs=require(_0x2227('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x2227('0x5'))['db'];var utils=require(_0x2227('0x6'));var logger=require(_0x2227('0x7'))('rpc');var config=require('../../config/environment');var jayson=require(_0x2227('0x8'));var client=jayson[_0x2227('0x9')][_0x2227('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x2591db,_0xaec623,_0x1413d2){return new BPromise(function(_0x41fc3f,_0x34bdd0){return client[_0x2227('0xb')](_0x2591db,_0x1413d2)[_0x2227('0xc')](function(_0x496bbd){logger[_0x2227('0xd')]('Automation,\x20%s,\x20%s',_0xaec623,_0x2227('0xe'));logger[_0x2227('0xf')](_0x2227('0x10'),_0xaec623,_0x2227('0xe'),JSON[_0x2227('0x11')](_0x496bbd));if(_0x496bbd['error']){if(_0x496bbd[_0x2227('0x12')][_0x2227('0x13')]===0x1f4){logger[_0x2227('0x12')](_0x2227('0x14'),_0xaec623,_0x496bbd[_0x2227('0x12')][_0x2227('0x15')]);return _0x34bdd0(_0x496bbd['error']['message']);}logger['error'](_0x2227('0x14'),_0xaec623,_0x496bbd['error'][_0x2227('0x15')]);return _0x41fc3f(_0x496bbd[_0x2227('0x12')]['message']);}else{logger[_0x2227('0xd')](_0x2227('0x14'),_0xaec623,_0x2227('0xe'));_0x41fc3f(_0x496bbd[_0x2227('0x16')][_0x2227('0x15')]);}})[_0x2227('0x17')](function(_0x508e92){logger[_0x2227('0x12')](_0x2227('0x14'),_0xaec623,_0x508e92);_0x34bdd0(_0x508e92);});});}
\ No newline at end of file
diff --git a/server/api/automation/index.js b/server/api/automation/index.js
index c3db990..cd333a2 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 _0xef89=['/:id/actions','/:id','update','delete','destroy','exports','multer','util','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./automation.controller','isAuthenticated','show','get','/:id/conditions','getConditions','create','addConditions','post'];(function(_0x26e7e4,_0x4d671a){var _0x4a79d7=function(_0x49f05e){while(--_0x49f05e){_0x26e7e4['push'](_0x26e7e4['shift']());}};_0x4a79d7(++_0x4d671a);}(_0xef89,0xf6));var _0x9ef8=function(_0x5b6434,_0x51ba52){_0x5b6434=_0x5b6434-0x0;var _0x20a90c=_0xef89[_0x5b6434];return _0x20a90c;};'use strict';var multer=require(_0x9ef8('0x0'));var util=require(_0x9ef8('0x1'));var path=require(_0x9ef8('0x2'));var timeout=require(_0x9ef8('0x3'));var express=require(_0x9ef8('0x4'));var router=express['Router']();var fs_extra=require(_0x9ef8('0x5'));var auth=require(_0x9ef8('0x6'));var interaction=require(_0x9ef8('0x7'));var config=require(_0x9ef8('0x8'));var controller=require(_0x9ef8('0x9'));router['get']('/',auth[_0x9ef8('0xa')](),controller['index']);router['get']('/:id',auth[_0x9ef8('0xa')](),controller[_0x9ef8('0xb')]);router[_0x9ef8('0xc')](_0x9ef8('0xd'),auth[_0x9ef8('0xa')](),controller[_0x9ef8('0xe')]);router[_0x9ef8('0xc')]('/:id/actions',auth[_0x9ef8('0xa')](),controller['getActions']);router['post']('/',auth[_0x9ef8('0xa')](),controller[_0x9ef8('0xf')]);router['post'](_0x9ef8('0xd'),auth[_0x9ef8('0xa')](),controller[_0x9ef8('0x10')]);router[_0x9ef8('0x11')](_0x9ef8('0x12'),auth[_0x9ef8('0xa')](),controller['addActions']);router['put'](_0x9ef8('0x13'),auth[_0x9ef8('0xa')](),controller[_0x9ef8('0x14')]);router[_0x9ef8('0x15')](_0x9ef8('0x13'),auth[_0x9ef8('0xa')](),controller[_0x9ef8('0x16')]);module[_0x9ef8('0x17')]=router;
\ No newline at end of file
+var _0x07c3=['index','/:id','show','/:id/conditions','getConditions','/:id/actions','getActions','post','create','addActions','put','update','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment','./automation.controller','get','isAuthenticated'];(function(_0xe52b48,_0x1d2ce9){var _0x476b07=function(_0x1f946c){while(--_0x1f946c){_0xe52b48['push'](_0xe52b48['shift']());}};_0x476b07(++_0x1d2ce9);}(_0x07c3,0x1bf));var _0x307c=function(_0x2a53ad,_0x234135){_0x2a53ad=_0x2a53ad-0x0;var _0x31b3b6=_0x07c3[_0x2a53ad];return _0x31b3b6;};'use strict';var multer=require(_0x307c('0x0'));var util=require(_0x307c('0x1'));var path=require(_0x307c('0x2'));var timeout=require(_0x307c('0x3'));var express=require(_0x307c('0x4'));var router=express[_0x307c('0x5')]();var fs_extra=require(_0x307c('0x6'));var auth=require(_0x307c('0x7'));var interaction=require('../../components/interaction/service');var config=require(_0x307c('0x8'));var controller=require(_0x307c('0x9'));router[_0x307c('0xa')]('/',auth[_0x307c('0xb')](),controller[_0x307c('0xc')]);router[_0x307c('0xa')](_0x307c('0xd'),auth[_0x307c('0xb')](),controller[_0x307c('0xe')]);router[_0x307c('0xa')](_0x307c('0xf'),auth[_0x307c('0xb')](),controller[_0x307c('0x10')]);router[_0x307c('0xa')](_0x307c('0x11'),auth['isAuthenticated'](),controller[_0x307c('0x12')]);router[_0x307c('0x13')]('/',auth[_0x307c('0xb')](),controller[_0x307c('0x14')]);router['post']('/:id/conditions',auth[_0x307c('0xb')](),controller['addConditions']);router[_0x307c('0x13')](_0x307c('0x11'),auth['isAuthenticated'](),controller[_0x307c('0x15')]);router[_0x307c('0x16')](_0x307c('0xd'),auth[_0x307c('0xb')](),controller[_0x307c('0x17')]);router[_0x307c('0x18')](_0x307c('0xd'),auth[_0x307c('0xb')](),controller[_0x307c('0x19')]);module[_0x307c('0x1a')]=router;
\ No newline at end of file
diff --git a/server/api/campaign/campaign.attributes.js b/server/api/campaign/campaign.attributes.js
index f121221..8c3fb05 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 _0x63bf=['Busy\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#NoAnswer\x20Retry\x20(min:1,\x20max:999)','NoAnswer\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','07:00-22:00,*,*,*','always','onlyIfOpen','#AMD\x20Initial\x20Silence','#AMD\x20Greeting','#AMD\x20After\x20Greeting\x20Silence','#AMD\x20Total\x20Analysis\x20Time','#AMD\x20Between\x20Words\x20Silence','#AMD\x20Silence\x20Threshold\x20(min:0,\x20max:32767)','#AMD\x20Maximum\x20Word\x20Length','DESC','ASC','Random\x20Last\x20Digit\x20(min:1,\x20max:15)','Cut\x20Digit\x20(min:1,\x20max:15)','#NoSuchNumber\x20Retry\x20(min:1,\x20max:999)','#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','ENUM','ivr','BOOLEAN','Active/Disactive\x20Campaign','INTEGER','UNSIGNED','Max\x20200\x20calls.','Originate\x20Timeout\x20Seconds\x20(min:1,\x20max:999)','#Congestion\x20Retry\x20(min:1,\x20max:999)','Congestion\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Busy\x20Retry\x20(min:1,\x20max:999)'];(function(_0x58c30e,_0x55a97b){var _0x570768=function(_0x40c1f9){while(--_0x40c1f9){_0x58c30e['push'](_0x58c30e['shift']());}};_0x570768(++_0x55a97b);}(_0x63bf,0xd7));var _0xf63b=function(_0x25ff74,_0x37864c){_0x25ff74=_0x25ff74-0x0;var _0x3e9649=_0x63bf[_0x25ff74];return _0x3e9649;};'use strict';var Sequelize=require('sequelize');module[_0xf63b('0x0')]={'name':{'type':Sequelize[_0xf63b('0x1')],'unique':'name','allowNull':![],'validate':{'is':/[A-Za-z0-9._\\+*!-]+/,'notEmpty':!![]}},'type':{'type':Sequelize[_0xf63b('0x2')](_0xf63b('0x3')),'allowNull':![],'defaultValue':_0xf63b('0x3')},'description':{'type':Sequelize['STRING']},'active':{'type':Sequelize[_0xf63b('0x4')],'defaultValue':0x0,'comment':_0xf63b('0x5')},'limitCalls':{'type':Sequelize[_0xf63b('0x6')](0x4)[_0xf63b('0x7')],'defaultValue':0x1e,'validate':{'min':0x1,'max':0xc8},'comment':_0xf63b('0x8')},'dialOriginateCallerIdName':{'type':Sequelize['STRING']},'dialOriginateCallerIdNumber':{'type':Sequelize[_0xf63b('0x1')]},'dialOriginateTimeout':{'type':Sequelize['INTEGER'](0x3)['UNSIGNED'],'defaultValue':0x1e,'validate':{'min':0x1,'max':0x3e7},'comment':_0xf63b('0x9')},'dialCongestionMaxRetry':{'type':Sequelize[_0xf63b('0x6')](0x3)[_0xf63b('0x7')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xf63b('0xa')},'dialCongestionRetryFrequency':{'type':Sequelize['INTEGER'](0x5)[_0xf63b('0x7')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xf63b('0xb')},'dialBusyMaxRetry':{'type':Sequelize[_0xf63b('0x6')](0x3)[_0xf63b('0x7')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xf63b('0xc')},'dialBusyRetryFrequency':{'type':Sequelize[_0xf63b('0x6')](0x5)[_0xf63b('0x7')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xf63b('0xd')},'dialNoAnswerMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0xf63b('0x7')],'defaultValue':0x3,'comment':_0xf63b('0xe')},'dialNoAnswerRetryFrequency':{'type':Sequelize['INTEGER'](0x5)[_0xf63b('0x7')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xf63b('0xf')},'dialGlobalMaxRetry':{'type':Sequelize[_0xf63b('0x6')](0x3)[_0xf63b('0x7')],'validate':{'min':0x1,'max':0x3e7},'defaultValue':0x4,'comment':'#Global\x20Max\x20Retry\x20(min:1,\x20max:999)'},'dialTimezone':{'type':Sequelize[_0xf63b('0x1')],'defaultValue':null},'dialGlobalInterval':{'type':Sequelize['STRING'],'defaultValue':_0xf63b('0x10')},'dialCheckDuplicateType':{'type':Sequelize[_0xf63b('0x2')](_0xf63b('0x11'),'never',_0xf63b('0x12')),'defaultValue':_0xf63b('0x11')},'dialAMDActive':{'type':Sequelize[_0xf63b('0x4')],'defaultValue':0x0,'comment':'Active/Disactive\x20AMD'},'dialAMDInitialSilence':{'type':Sequelize['INTEGER'](0x9)[_0xf63b('0x7')],'defaultValue':0x9c4,'validate':{'min':0x0},'comment':_0xf63b('0x13')},'dialAMDGreeting':{'type':Sequelize['INTEGER'](0x9)['UNSIGNED'],'defaultValue':0x5dc,'validate':{'min':0x0},'comment':_0xf63b('0x14')},'dialAMDAfterGreetingSilence':{'type':Sequelize[_0xf63b('0x6')](0x9)['UNSIGNED'],'defaultValue':0x320,'validate':{'min':0x0},'comment':_0xf63b('0x15')},'dialAMDTotalAnalysisTime':{'type':Sequelize[_0xf63b('0x6')](0x9)['UNSIGNED'],'defaultValue':0x1388,'validate':{'min':0x0},'comment':_0xf63b('0x16')},'dialAMDMinWordLength':{'type':Sequelize[_0xf63b('0x6')](0x9)[_0xf63b('0x7')],'defaultValue':0x64,'validate':{'min':0x0},'comment':'#AMD\x20Min\x20Word\x20Length'},'dialAMDBetweenWordsSilence':{'type':Sequelize[_0xf63b('0x6')](0x9)[_0xf63b('0x7')],'defaultValue':0x32,'validate':{'min':0x0},'comment':_0xf63b('0x17')},'dialAMDMaximumNumberOfWords':{'type':Sequelize[_0xf63b('0x6')](0x9)[_0xf63b('0x7')],'defaultValue':0x3,'validate':{'min':0x0},'comment':'#AMD\x20Maximum\x20Number\x20Of\x20Words'},'dialAMDSilenceThreshold':{'type':Sequelize[_0xf63b('0x6')](0x5)['UNSIGNED'],'validate':{'min':0x0,'max':0x7fff},'defaultValue':0x100,'comment':_0xf63b('0x18')},'dialAMDMaximumWordLength':{'type':Sequelize[_0xf63b('0x6')](0x9)[_0xf63b('0x7')],'defaultValue':0x1388,'validate':{'min':0x0},'comment':_0xf63b('0x19')},'dialOrderByScheduledAt':{'type':Sequelize[_0xf63b('0x2')](_0xf63b('0x1a'),_0xf63b('0x1b')),'defaultValue':_0xf63b('0x1a')},'dialPrefix':{'type':Sequelize[_0xf63b('0x1')],'defaultValue':null},'dialRandomLastDigitCallerIdNumber':{'type':Sequelize[_0xf63b('0x6')](0x3)[_0xf63b('0x7')],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':_0xf63b('0x1c')},'dialCutDigit':{'type':Sequelize[_0xf63b('0x6')](0x3)[_0xf63b('0x7')],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':_0xf63b('0x1d')},'dialNoSuchNumberMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0xf63b('0x7')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xf63b('0x1e')},'dialNoSuchNumberRetryFrequency':{'type':Sequelize[_0xf63b('0x6')](0x5)[_0xf63b('0x7')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'NoSuchNumber\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialDropMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0xf63b('0x7')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xf63b('0x1f')},'dialDropRetryFrequency':{'type':Sequelize[_0xf63b('0x6')](0x5)[_0xf63b('0x7')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'Drop\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialAbandonedMaxRetry':{'type':Sequelize[_0xf63b('0x6')](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xf63b('0x20')},'dialAbandonedRetryFrequency':{'type':Sequelize[_0xf63b('0x6')](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xf63b('0x21')},'dialMachineMaxRetry':{'type':Sequelize[_0xf63b('0x6')](0x3)[_0xf63b('0x7')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xf63b('0x22')},'dialMachineRetryFrequency':{'type':Sequelize[_0xf63b('0x6')](0x5)[_0xf63b('0x7')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xf63b('0x23')},'dialAgentRejectMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0xf63b('0x7')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xf63b('0x24')},'dialAgentRejectRetryFrequency':{'type':Sequelize['INTEGER'](0x5)[_0xf63b('0x7')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xf63b('0x25')}};
\ No newline at end of file
+var _0x0a09=['ASC','Cut\x20Digit\x20(min:1,\x20max:15)','NoSuchNumber\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Drop\x20Retry\x20(min:1,\x20max:999)','Drop\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Abandoned\x20Retry\x20(min:1,\x20max:999)','Abandoned\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#AgentReject\x20Retry\x20(min:1,\x20max:999)','AgentReject\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','sequelize','exports','STRING','name','ivr','BOOLEAN','Active/Disactive\x20Campaign','INTEGER','UNSIGNED','Max\x20200\x20calls.','Originate\x20Timeout\x20Seconds\x20(min:1,\x20max:999)','#Congestion\x20Retry\x20(min:1,\x20max:999)','Congestion\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','NoAnswer\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Global\x20Max\x20Retry\x20(min:1,\x20max:999)','07:00-22:00,*,*,*','ENUM','never','onlyIfOpen','#AMD\x20Initial\x20Silence','#AMD\x20Greeting','#AMD\x20After\x20Greeting\x20Silence','#AMD\x20Total\x20Analysis\x20Time','#AMD\x20Between\x20Words\x20Silence','#AMD\x20Maximum\x20Number\x20Of\x20Words','#AMD\x20Maximum\x20Word\x20Length','DESC'];(function(_0x42ab46,_0x43639a){var _0x147a11=function(_0x49b450){while(--_0x49b450){_0x42ab46['push'](_0x42ab46['shift']());}};_0x147a11(++_0x43639a);}(_0x0a09,0xe1));var _0x90a0=function(_0x5b1c50,_0x56e694){_0x5b1c50=_0x5b1c50-0x0;var _0x2d379b=_0x0a09[_0x5b1c50];return _0x2d379b;};'use strict';var Sequelize=require(_0x90a0('0x0'));module[_0x90a0('0x1')]={'name':{'type':Sequelize[_0x90a0('0x2')],'unique':_0x90a0('0x3'),'allowNull':![],'validate':{'is':/[A-Za-z0-9._\\+*!-]+/,'notEmpty':!![]}},'type':{'type':Sequelize['ENUM'](_0x90a0('0x4')),'allowNull':![],'defaultValue':_0x90a0('0x4')},'description':{'type':Sequelize['STRING']},'active':{'type':Sequelize[_0x90a0('0x5')],'defaultValue':0x0,'comment':_0x90a0('0x6')},'limitCalls':{'type':Sequelize[_0x90a0('0x7')](0x4)[_0x90a0('0x8')],'defaultValue':0x1e,'validate':{'min':0x1,'max':0xc8},'comment':_0x90a0('0x9')},'dialOriginateCallerIdName':{'type':Sequelize[_0x90a0('0x2')]},'dialOriginateCallerIdNumber':{'type':Sequelize[_0x90a0('0x2')]},'dialOriginateTimeout':{'type':Sequelize[_0x90a0('0x7')](0x3)[_0x90a0('0x8')],'defaultValue':0x1e,'validate':{'min':0x1,'max':0x3e7},'comment':_0x90a0('0xa')},'dialCongestionMaxRetry':{'type':Sequelize[_0x90a0('0x7')](0x3)[_0x90a0('0x8')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x90a0('0xb')},'dialCongestionRetryFrequency':{'type':Sequelize[_0x90a0('0x7')](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x90a0('0xc')},'dialBusyMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0x90a0('0x8')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#Busy\x20Retry\x20(min:1,\x20max:999)'},'dialBusyRetryFrequency':{'type':Sequelize[_0x90a0('0x7')](0x5)[_0x90a0('0x8')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'Busy\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialNoAnswerMaxRetry':{'type':Sequelize[_0x90a0('0x7')](0x3)['UNSIGNED'],'defaultValue':0x3,'comment':'#NoAnswer\x20Retry\x20(min:1,\x20max:999)'},'dialNoAnswerRetryFrequency':{'type':Sequelize[_0x90a0('0x7')](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x90a0('0xd')},'dialGlobalMaxRetry':{'type':Sequelize[_0x90a0('0x7')](0x3)['UNSIGNED'],'validate':{'min':0x1,'max':0x3e7},'defaultValue':0x4,'comment':_0x90a0('0xe')},'dialTimezone':{'type':Sequelize[_0x90a0('0x2')],'defaultValue':null},'dialGlobalInterval':{'type':Sequelize[_0x90a0('0x2')],'defaultValue':_0x90a0('0xf')},'dialCheckDuplicateType':{'type':Sequelize[_0x90a0('0x10')]('always',_0x90a0('0x11'),_0x90a0('0x12')),'defaultValue':'always'},'dialAMDActive':{'type':Sequelize[_0x90a0('0x5')],'defaultValue':0x0,'comment':'Active/Disactive\x20AMD'},'dialAMDInitialSilence':{'type':Sequelize[_0x90a0('0x7')](0x9)[_0x90a0('0x8')],'defaultValue':0x9c4,'validate':{'min':0x0},'comment':_0x90a0('0x13')},'dialAMDGreeting':{'type':Sequelize[_0x90a0('0x7')](0x9)[_0x90a0('0x8')],'defaultValue':0x5dc,'validate':{'min':0x0},'comment':_0x90a0('0x14')},'dialAMDAfterGreetingSilence':{'type':Sequelize['INTEGER'](0x9)[_0x90a0('0x8')],'defaultValue':0x320,'validate':{'min':0x0},'comment':_0x90a0('0x15')},'dialAMDTotalAnalysisTime':{'type':Sequelize[_0x90a0('0x7')](0x9)[_0x90a0('0x8')],'defaultValue':0x1388,'validate':{'min':0x0},'comment':_0x90a0('0x16')},'dialAMDMinWordLength':{'type':Sequelize[_0x90a0('0x7')](0x9)[_0x90a0('0x8')],'defaultValue':0x64,'validate':{'min':0x0},'comment':'#AMD\x20Min\x20Word\x20Length'},'dialAMDBetweenWordsSilence':{'type':Sequelize['INTEGER'](0x9)[_0x90a0('0x8')],'defaultValue':0x32,'validate':{'min':0x0},'comment':_0x90a0('0x17')},'dialAMDMaximumNumberOfWords':{'type':Sequelize[_0x90a0('0x7')](0x9)[_0x90a0('0x8')],'defaultValue':0x3,'validate':{'min':0x0},'comment':_0x90a0('0x18')},'dialAMDSilenceThreshold':{'type':Sequelize[_0x90a0('0x7')](0x5)[_0x90a0('0x8')],'validate':{'min':0x0,'max':0x7fff},'defaultValue':0x100,'comment':'#AMD\x20Silence\x20Threshold\x20(min:0,\x20max:32767)'},'dialAMDMaximumWordLength':{'type':Sequelize[_0x90a0('0x7')](0x9)[_0x90a0('0x8')],'defaultValue':0x1388,'validate':{'min':0x0},'comment':_0x90a0('0x19')},'dialOrderByScheduledAt':{'type':Sequelize[_0x90a0('0x10')](_0x90a0('0x1a'),_0x90a0('0x1b')),'defaultValue':_0x90a0('0x1a')},'dialPrefix':{'type':Sequelize['STRING'],'defaultValue':null},'dialRandomLastDigitCallerIdNumber':{'type':Sequelize[_0x90a0('0x7')](0x3)['UNSIGNED'],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':'Random\x20Last\x20Digit\x20(min:1,\x20max:15)'},'dialCutDigit':{'type':Sequelize[_0x90a0('0x7')](0x3)[_0x90a0('0x8')],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':_0x90a0('0x1c')},'dialNoSuchNumberMaxRetry':{'type':Sequelize[_0x90a0('0x7')](0x3)[_0x90a0('0x8')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#NoSuchNumber\x20Retry\x20(min:1,\x20max:999)'},'dialNoSuchNumberRetryFrequency':{'type':Sequelize['INTEGER'](0x5)[_0x90a0('0x8')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x90a0('0x1d')},'dialDropMaxRetry':{'type':Sequelize[_0x90a0('0x7')](0x3)[_0x90a0('0x8')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x90a0('0x1e')},'dialDropRetryFrequency':{'type':Sequelize[_0x90a0('0x7')](0x5)[_0x90a0('0x8')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x90a0('0x1f')},'dialAbandonedMaxRetry':{'type':Sequelize[_0x90a0('0x7')](0x3)[_0x90a0('0x8')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x90a0('0x20')},'dialAbandonedRetryFrequency':{'type':Sequelize['INTEGER'](0x5)[_0x90a0('0x8')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x90a0('0x21')},'dialMachineMaxRetry':{'type':Sequelize[_0x90a0('0x7')](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#Machine\x20Retry\x20(min:1,\x20max:999)'},'dialMachineRetryFrequency':{'type':Sequelize[_0x90a0('0x7')](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'Machine\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialAgentRejectMaxRetry':{'type':Sequelize[_0x90a0('0x7')](0x3)[_0x90a0('0x8')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x90a0('0x22')},'dialAgentRejectRetryFrequency':{'type':Sequelize[_0x90a0('0x7')](0x5)[_0x90a0('0x8')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x90a0('0x23')}};
\ No newline at end of file
diff --git a/server/api/campaign/campaign.controller.js b/server/api/campaign/campaign.controller.js
index 922946e..1d9af14 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 _0x3077=['toString','from','cm_contacts','deletedAt\x20IS\x20NULL','ListId\x20=\x20?','phone\x20IS\x20NOT\x20NULL','phone\x20NOT\x20IN\x20(?)','COALESCE(calleridnum,\x27\x27)','cm_hopper_final','COALESCE(phone,\x27\x27)','onlyIfOpen','cm_hopper_additional_phones','cmHopperId','OrderBy','h.id','ci.item','cm_contact_has_items','join','h.ContactId\x20=\x20ci.CmContactId','h.ListId\x20=\x20?','h.CampaignId=?','h.createdAt\x20=\x20?','sequelize','all','removeLists','getBlackLists','CmList','addBlackLists','spread','cm_hopper_black','push','removeBlackLists','eml-format','zip-dir','request-promise','bluebird','mustache','util','lodash','squel','crypto','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','json','offset','undefined','limit','count','set','Content-Range','reject','save','update','then','get','destroy','end','error','name','send','index','map','fieldName','type','key','model','query','intersection','attributes','fields','sort','where','pick','filter','merge','options','Campaign','include','findAll','rows','show','params','keys','filters','length','includeAll','find','catch','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','IvrCampaigns','UserProfileSection','userProfileId','createdAt','updatedAt','omit','autoAssociation','UserProfileResource','getHoppers','findOne','CmHopper','rawAttributes','hasOwnProperty','order','CampaignId','CmHopperHistory','nolimit','CmHopperFinal','getHopperBlacks','CmHopperBlack','getLists','addLists','format','YYYY-MM-DD\x20HH:mm:ss','ids','dialCheckDuplicateType','always','insert','into','cm_hopper','fromQuery','ListId','select','field','phone','NOW()','scheduledAt','ContactId','CmListId'];(function(_0x422905,_0x3bce3a){var _0x33dc6c=function(_0x4852c9){while(--_0x4852c9){_0x422905['push'](_0x422905['shift']());}};_0x33dc6c(++_0x3bce3a);}(_0x3077,0x144));var _0x7307=function(_0x18a79d,_0x57bd2c){_0x18a79d=_0x18a79d-0x0;var _0x4f8848=_0x3077[_0x18a79d];return _0x4f8848;};'use strict';var emlformat=require(_0x7307('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x7307('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0x7307('0x2'));var moment=require('moment');var BPromise=require(_0x7307('0x3'));var Mustache=require(_0x7307('0x4'));var util=require(_0x7307('0x5'));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('fs-extra');var _=require(_0x7307('0x6'));var squel=require(_0x7307('0x7'));var crypto=require(_0x7307('0x8'));var jsforce=require(_0x7307('0x9'));var deskjs=require(_0x7307('0xa'));var toCsv=require(_0x7307('0xb'));var querystring=require(_0x7307('0xc'));var Papa=require(_0x7307('0xd'));var Redis=require(_0x7307('0xe'));var authService=require(_0x7307('0xf'));var qs=require(_0x7307('0x10'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0x7307('0x11'))(_0x7307('0x12'));var utils=require(_0x7307('0x13'));var config=require(_0x7307('0x14'));var licenseUtil=require(_0x7307('0x15'));var db=require(_0x7307('0x16'))['db'];function respondWithStatusCode(_0x2ef5b5,_0x337903){_0x337903=_0x337903||0xcc;return function(_0x18268c){if(_0x18268c){return _0x2ef5b5[_0x7307('0x17')](_0x337903);}return _0x2ef5b5[_0x7307('0x18')](_0x337903)['end']();};}function respondWithResult(_0x588727,_0x235dd7){_0x235dd7=_0x235dd7||0xc8;return function(_0x486b19){if(_0x486b19){return _0x588727[_0x7307('0x18')](_0x235dd7)[_0x7307('0x19')](_0x486b19);}};}function respondWithFilteredResult(_0x573a6f,_0x2e9794){return function(_0x5badd9){if(_0x5badd9){var _0x754da0=typeof _0x2e9794[_0x7307('0x1a')]===_0x7307('0x1b')&&typeof _0x2e9794[_0x7307('0x1c')]===_0x7307('0x1b');var _0x528472=_0x5badd9[_0x7307('0x1d')];var _0x554997=_0x754da0?0x0:_0x2e9794['offset'];var _0x5e04c9=_0x754da0?_0x5badd9[_0x7307('0x1d')]:_0x2e9794[_0x7307('0x1a')]+_0x2e9794[_0x7307('0x1c')];var _0x55750a;if(_0x5e04c9>=_0x528472){_0x5e04c9=_0x528472;_0x55750a=0xc8;}else{_0x55750a=0xce;}_0x573a6f[_0x7307('0x18')](_0x55750a);return _0x573a6f[_0x7307('0x1e')](_0x7307('0x1f'),_0x554997+'-'+_0x5e04c9+'/'+_0x528472)[_0x7307('0x19')](_0x5badd9);}return null;};}function patchUpdates(_0x589e4f){return function(_0x42740e){try{jsonpatch['apply'](_0x42740e,_0x589e4f,!![]);}catch(_0x643fef){return BPromise[_0x7307('0x20')](_0x643fef);}return _0x42740e[_0x7307('0x21')]();};}function saveUpdates(_0x23624e,_0x353c4a){return function(_0x9dc4d){if(_0x9dc4d){return _0x9dc4d[_0x7307('0x22')](_0x23624e)[_0x7307('0x23')](function(_0x550e5f){return _0x550e5f;});}return null;};}function removeEntity(_0xb31856,_0xb61a0){return function(_0x206532){if(_0x206532){return _0x206532['destroy']()['then'](function(){var _0x16ffb0=_0x206532[_0x7307('0x24')]({'plain':!![]});var _0x1f1c86='IvrCampaigns';return db['UserProfileResource'][_0x7307('0x25')]({'where':{'type':_0x1f1c86,'resourceId':_0x16ffb0['id']}})[_0x7307('0x23')](function(){return _0x206532;});})['then'](function(){_0xb31856[_0x7307('0x18')](0xcc)[_0x7307('0x26')]();});}};}function handleEntityNotFound(_0xca10ee,_0x10d6c9){return function(_0x3e2a78){if(!_0x3e2a78){_0xca10ee[_0x7307('0x17')](0x194);}return _0x3e2a78;};}function handleError(_0x1ecb0d,_0x5eefea){_0x5eefea=_0x5eefea||0x1f4;return function(_0x102078){logger[_0x7307('0x27')](_0x102078['stack']);if(_0x102078[_0x7307('0x28')]){delete _0x102078['name'];}_0x1ecb0d['status'](_0x5eefea)[_0x7307('0x29')](_0x102078);};}exports[_0x7307('0x2a')]=function(_0x232b96,_0x2f768d){var _0x276943={},_0x1ce495={},_0x55954b={'count':0x0,'rows':[]};var _0x243cc6=_[_0x7307('0x2b')](db['Campaign']['rawAttributes'],function(_0x475c06){return{'name':_0x475c06[_0x7307('0x2c')],'type':_0x475c06[_0x7307('0x2d')][_0x7307('0x2e')]};});_0x1ce495[_0x7307('0x2f')]=_[_0x7307('0x2b')](_0x243cc6,_0x7307('0x28'));_0x1ce495[_0x7307('0x30')]=_['keys'](_0x232b96[_0x7307('0x30')]);_0x1ce495['filters']=_[_0x7307('0x31')](_0x1ce495['model'],_0x1ce495['query']);_0x276943[_0x7307('0x32')]=_[_0x7307('0x31')](_0x1ce495['model'],qs[_0x7307('0x33')](_0x232b96[_0x7307('0x30')][_0x7307('0x33')]));_0x276943[_0x7307('0x32')]=_0x276943[_0x7307('0x32')]['length']?_0x276943[_0x7307('0x32')]:_0x1ce495[_0x7307('0x2f')];if(!_0x232b96[_0x7307('0x30')]['hasOwnProperty']('nolimit')){_0x276943[_0x7307('0x1c')]=qs['limit'](_0x232b96[_0x7307('0x30')][_0x7307('0x1c')]);_0x276943['offset']=qs[_0x7307('0x1a')](_0x232b96[_0x7307('0x30')][_0x7307('0x1a')]);}_0x276943['order']=qs[_0x7307('0x34')](_0x232b96[_0x7307('0x30')][_0x7307('0x34')]);_0x276943[_0x7307('0x35')]=qs['filters'](_[_0x7307('0x36')](_0x232b96[_0x7307('0x30')],_0x1ce495['filters']),_0x243cc6);if(_0x232b96[_0x7307('0x30')][_0x7307('0x37')]){_0x276943['where']=_[_0x7307('0x38')](_0x276943['where'],{'$or':_[_0x7307('0x2b')](_0x243cc6,function(_0x232ced){if(_0x232ced['type']!=='VIRTUAL'){var _0x389bc9={};_0x389bc9[_0x232ced[_0x7307('0x28')]]={'$like':'%'+_0x232b96['query'][_0x7307('0x37')]+'%'};return _0x389bc9;}})});}_0x276943=_[_0x7307('0x38')]({},_0x276943,_0x232b96[_0x7307('0x39')]);var _0x2fe32f={'where':_0x276943[_0x7307('0x35')]};return db[_0x7307('0x3a')][_0x7307('0x1d')](_0x2fe32f)[_0x7307('0x23')](function(_0x494e25){_0x55954b['count']=_0x494e25;if(_0x232b96[_0x7307('0x30')]['includeAll']){_0x276943[_0x7307('0x3b')]=[{'all':!![]}];}return db[_0x7307('0x3a')][_0x7307('0x3c')](_0x276943);})[_0x7307('0x23')](function(_0x2edacf){_0x55954b[_0x7307('0x3d')]=_0x2edacf;return _0x55954b;})[_0x7307('0x23')](respondWithFilteredResult(_0x2f768d,_0x276943))['catch'](handleError(_0x2f768d,null));};exports[_0x7307('0x3e')]=function(_0x45517a,_0x52ed35){var _0x1cdc28={'raw':![],'where':{'id':_0x45517a[_0x7307('0x3f')]['id']}},_0x53581d={};_0x53581d[_0x7307('0x2f')]=_['keys'](db[_0x7307('0x3a')]['rawAttributes']);_0x53581d['query']=_[_0x7307('0x40')](_0x45517a['query']);_0x53581d[_0x7307('0x41')]=_[_0x7307('0x31')](_0x53581d[_0x7307('0x2f')],_0x53581d[_0x7307('0x30')]);_0x1cdc28[_0x7307('0x32')]=_[_0x7307('0x31')](_0x53581d[_0x7307('0x2f')],qs[_0x7307('0x33')](_0x45517a['query'][_0x7307('0x33')]));_0x1cdc28['attributes']=_0x1cdc28[_0x7307('0x32')][_0x7307('0x42')]?_0x1cdc28['attributes']:_0x53581d[_0x7307('0x2f')];if(_0x45517a[_0x7307('0x30')][_0x7307('0x43')]){_0x1cdc28[_0x7307('0x3b')]=[{'all':!![]}];}_0x1cdc28=_[_0x7307('0x38')]({},_0x1cdc28,_0x45517a[_0x7307('0x39')]);return db[_0x7307('0x3a')][_0x7307('0x44')](_0x1cdc28)[_0x7307('0x23')](handleEntityNotFound(_0x52ed35,null))[_0x7307('0x23')](respondWithResult(_0x52ed35,null))[_0x7307('0x45')](handleError(_0x52ed35,null));};exports[_0x7307('0x46')]=function(_0x9e861e,_0x581e1b){return db[_0x7307('0x3a')]['create'](_0x9e861e[_0x7307('0x47')],{})[_0x7307('0x23')](function(_0x104198){var _0x38b4d9=_0x9e861e[_0x7307('0x48')][_0x7307('0x24')]({'plain':!![]});if(!_0x38b4d9)throw new Error(_0x7307('0x49'));if(_0x38b4d9[_0x7307('0x4a')]==='user'){var _0x8a65b3=_0x104198['get']({'plain':!![]});var _0x5562ed=_0x7307('0x4b');return db[_0x7307('0x4c')][_0x7307('0x44')]({'where':{'name':_0x5562ed,'userProfileId':_0x38b4d9[_0x7307('0x4d')]},'raw':!![]})[_0x7307('0x23')](function(_0x5009fc){if(_0x5009fc&&_0x5009fc['autoAssociation']===0x0){return db['UserProfileResource'][_0x7307('0x46')]({'name':_0x8a65b3[_0x7307('0x28')],'resourceId':_0x8a65b3['id'],'type':_0x5009fc[_0x7307('0x28')],'sectionId':_0x5009fc['id']},{})[_0x7307('0x23')](function(){return _0x104198;});}else{return _0x104198;}})[_0x7307('0x45')](function(_0x548f49){logger[_0x7307('0x27')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x548f49);throw _0x548f49;});}return _0x104198;})[_0x7307('0x23')](respondWithResult(_0x581e1b,0xc9))[_0x7307('0x45')](handleError(_0x581e1b,null));};exports['clone']=function(_0x1acd2d,_0x407c40){var _0x17030a={'where':{'id':_0x1acd2d[_0x7307('0x3f')]['id']}},_0x4b2bf3={};_0x4b2bf3[_0x7307('0x2f')]=_[_0x7307('0x40')](db[_0x7307('0x3a')]['rawAttributes']);_0x17030a['attributes']=_[_0x7307('0x31')](_0x4b2bf3['model'],qs['fields'](_0x1acd2d[_0x7307('0x30')]['fields']));_0x17030a[_0x7307('0x32')]=_0x17030a[_0x7307('0x32')][_0x7307('0x42')]?_0x17030a[_0x7307('0x32')]:_0x4b2bf3[_0x7307('0x2f')];if(_0x1acd2d[_0x7307('0x30')][_0x7307('0x43')]){_0x17030a[_0x7307('0x3b')]=[{'all':!![]}];}_0x17030a=_[_0x7307('0x38')]({},_0x17030a,_0x1acd2d[_0x7307('0x39')]);return db[_0x7307('0x3a')][_0x7307('0x44')](_0x17030a)[_0x7307('0x23')](handleEntityNotFound(_0x407c40,null))[_0x7307('0x23')](function(_0x6cce90){if(_0x6cce90){var _0x5f0965=_0x6cce90['get']({'plain':!![]});_0x5f0965=qs['omit'](_0x5f0965,['id',_0x7307('0x4e'),_0x7307('0x4f')]);_0x1acd2d['body']=_[_0x7307('0x50')](_0x1acd2d[_0x7307('0x47')],['id',_0x7307('0x4e'),_0x7307('0x4f')]);return db[_0x7307('0x3a')][_0x7307('0x46')](_[_0x7307('0x38')](_0x5f0965,_0x1acd2d[_0x7307('0x47')]),{'include':_0x1acd2d[_0x7307('0x30')]['includeAll']?[{'all':!![]}]:undefined})[_0x7307('0x23')](function(_0x28c301){var _0x333c9c=_0x1acd2d[_0x7307('0x48')][_0x7307('0x24')]({'plain':!![]});if(!_0x333c9c)throw new Error(_0x7307('0x49'));if(_0x333c9c[_0x7307('0x4a')]===_0x7307('0x48')){var _0x2412c2=_0x28c301['get']({'plain':!![]});var _0x4cfadc=_0x7307('0x4b');return db[_0x7307('0x4c')]['find']({'where':{'name':_0x4cfadc,'userProfileId':_0x333c9c[_0x7307('0x4d')]},'raw':!![]})['then'](function(_0x184842){if(_0x184842&&_0x184842[_0x7307('0x51')]===0x0){return db[_0x7307('0x52')][_0x7307('0x46')]({'name':_0x2412c2[_0x7307('0x28')],'resourceId':_0x2412c2['id'],'type':_0x184842['name'],'sectionId':_0x184842['id']},{})[_0x7307('0x23')](function(){return _0x28c301;});}else{return _0x28c301;}})[_0x7307('0x45')](function(_0x339df5){logger[_0x7307('0x27')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x339df5);throw _0x339df5;});}return _0x28c301;});}})[_0x7307('0x23')](respondWithResult(_0x407c40,0xc9))[_0x7307('0x45')](handleError(_0x407c40,null));};exports['update']=function(_0x2caed7,_0x5d22fc){if(_0x2caed7['body']['id']){delete _0x2caed7['body']['id'];}return db['Campaign'][_0x7307('0x44')]({'where':{'id':_0x2caed7['params']['id']}})['then'](handleEntityNotFound(_0x5d22fc,null))[_0x7307('0x23')](saveUpdates(_0x2caed7[_0x7307('0x47')],null))[_0x7307('0x23')](respondWithResult(_0x5d22fc,null))[_0x7307('0x45')](handleError(_0x5d22fc,null));};exports[_0x7307('0x25')]=function(_0x4fd8e6,_0x1c5934){return db[_0x7307('0x3a')][_0x7307('0x44')]({'where':{'id':_0x4fd8e6['params']['id']}})[_0x7307('0x23')](handleEntityNotFound(_0x1c5934,null))[_0x7307('0x23')](removeEntity(_0x1c5934,null))['catch'](handleError(_0x1c5934,null));};exports[_0x7307('0x53')]=function(_0x54c255,_0x47e04c,_0x1a4cee){var _0x3be4c0={'raw':!![],'where':{}};var _0x79d26c={};var _0x30bdf4={'count':0x0,'rows':[]};return db[_0x7307('0x3a')][_0x7307('0x54')]({'where':{'id':_0x54c255[_0x7307('0x3f')]['id']}})[_0x7307('0x23')](handleEntityNotFound(_0x47e04c,null))[_0x7307('0x23')](function(_0x3cb697){if(_0x3cb697){_0x79d26c[_0x7307('0x2f')]=_[_0x7307('0x40')](db[_0x7307('0x55')][_0x7307('0x56')]);_0x79d26c['query']=_[_0x7307('0x40')](_0x54c255[_0x7307('0x30')]);_0x79d26c[_0x7307('0x41')]=_[_0x7307('0x31')](_0x79d26c[_0x7307('0x2f')],_0x79d26c[_0x7307('0x30')]);_0x3be4c0['attributes']=_[_0x7307('0x31')](_0x79d26c[_0x7307('0x2f')],qs[_0x7307('0x33')](_0x54c255[_0x7307('0x30')][_0x7307('0x33')]));_0x3be4c0['attributes']=_0x3be4c0[_0x7307('0x32')]['length']?_0x3be4c0['attributes']:_0x79d26c['model'];if(!_0x54c255['query'][_0x7307('0x57')]('nolimit')){_0x3be4c0[_0x7307('0x1c')]=qs['limit'](_0x54c255[_0x7307('0x30')]['limit']);_0x3be4c0['offset']=qs[_0x7307('0x1a')](_0x54c255['query'][_0x7307('0x1a')]);}_0x3be4c0[_0x7307('0x58')]=qs[_0x7307('0x34')](_0x54c255['query']['sort']);_0x3be4c0[_0x7307('0x35')]=qs[_0x7307('0x41')](_[_0x7307('0x36')](_0x54c255[_0x7307('0x30')],_0x79d26c[_0x7307('0x41')]));_0x3be4c0['where'][_0x7307('0x59')]=_0x3cb697['id'];if(_0x54c255['query'][_0x7307('0x37')]){_0x3be4c0['where']=_[_0x7307('0x38')](_0x3be4c0[_0x7307('0x35')],{'$or':_[_0x7307('0x2b')](_0x3be4c0[_0x7307('0x32')],function(_0x4f7dc3){var _0x4218fb={};_0x4218fb[_0x4f7dc3]={'$like':'%'+_0x54c255[_0x7307('0x30')]['filter']+'%'};return _0x4218fb;})});}_0x3be4c0=_['merge']({},_0x3be4c0,_0x54c255[_0x7307('0x39')]);return db[_0x7307('0x55')][_0x7307('0x1d')]({'where':_0x3be4c0['where']})[_0x7307('0x23')](function(_0x14c3c8){_0x30bdf4[_0x7307('0x1d')]=_0x14c3c8;if(_0x54c255[_0x7307('0x30')][_0x7307('0x43')]){_0x3be4c0[_0x7307('0x3b')]=[{'all':!![]}];}return db[_0x7307('0x55')][_0x7307('0x3c')](_0x3be4c0);})[_0x7307('0x23')](function(_0x1d2ef1){_0x30bdf4['rows']=_0x1d2ef1;return _0x30bdf4;});}})[_0x7307('0x23')](respondWithFilteredResult(_0x47e04c,_0x3be4c0))['catch'](handleError(_0x47e04c,null));};exports['getHopperHistories']=function(_0x5070f5,_0x293f68,_0x358452){var _0xa04be4={'raw':!![],'where':{}};var _0x1239b9={};var _0x7f1837={'count':0x0,'rows':[]};return db[_0x7307('0x3a')]['findOne']({'where':{'id':_0x5070f5[_0x7307('0x3f')]['id']}})[_0x7307('0x23')](handleEntityNotFound(_0x293f68,null))[_0x7307('0x23')](function(_0xadbf77){if(_0xadbf77){_0x1239b9[_0x7307('0x2f')]=_[_0x7307('0x40')](db[_0x7307('0x5a')][_0x7307('0x56')]);_0x1239b9['query']=_[_0x7307('0x40')](_0x5070f5[_0x7307('0x30')]);_0x1239b9[_0x7307('0x41')]=_[_0x7307('0x31')](_0x1239b9[_0x7307('0x2f')],_0x1239b9[_0x7307('0x30')]);_0xa04be4[_0x7307('0x32')]=_[_0x7307('0x31')](_0x1239b9[_0x7307('0x2f')],qs[_0x7307('0x33')](_0x5070f5[_0x7307('0x30')][_0x7307('0x33')]));_0xa04be4[_0x7307('0x32')]=_0xa04be4[_0x7307('0x32')][_0x7307('0x42')]?_0xa04be4[_0x7307('0x32')]:_0x1239b9[_0x7307('0x2f')];if(!_0x5070f5[_0x7307('0x30')][_0x7307('0x57')](_0x7307('0x5b'))){_0xa04be4['limit']=qs[_0x7307('0x1c')](_0x5070f5[_0x7307('0x30')]['limit']);_0xa04be4[_0x7307('0x1a')]=qs['offset'](_0x5070f5[_0x7307('0x30')]['offset']);}_0xa04be4['order']=qs[_0x7307('0x34')](_0x5070f5['query'][_0x7307('0x34')]);_0xa04be4['where']=qs[_0x7307('0x41')](_['pick'](_0x5070f5['query'],_0x1239b9['filters']));_0xa04be4['where']['CampaignId']=_0xadbf77['id'];if(_0x5070f5['query'][_0x7307('0x37')]){_0xa04be4[_0x7307('0x35')]=_[_0x7307('0x38')](_0xa04be4[_0x7307('0x35')],{'$or':_['map'](_0xa04be4[_0x7307('0x32')],function(_0x448716){var _0x5c7875={};_0x5c7875[_0x448716]={'$like':'%'+_0x5070f5[_0x7307('0x30')][_0x7307('0x37')]+'%'};return _0x5c7875;})});}_0xa04be4=_['merge']({},_0xa04be4,_0x5070f5[_0x7307('0x39')]);return db[_0x7307('0x5a')]['count']({'where':_0xa04be4[_0x7307('0x35')]})['then'](function(_0x49ad6e){_0x7f1837[_0x7307('0x1d')]=_0x49ad6e;if(_0x5070f5['query'][_0x7307('0x43')]){_0xa04be4['include']=[{'all':!![]}];}return db[_0x7307('0x5a')]['findAll'](_0xa04be4);})[_0x7307('0x23')](function(_0x1d262f){_0x7f1837[_0x7307('0x3d')]=_0x1d262f;return _0x7f1837;});}})[_0x7307('0x23')](respondWithFilteredResult(_0x293f68,_0xa04be4))['catch'](handleError(_0x293f68,null));};exports['getHopperFinals']=function(_0x28ca75,_0x482e8d,_0x2e30bf){var _0x6c627e={'raw':!![],'where':{}};var _0x48f713={};var _0x5ed711={'count':0x0,'rows':[]};return db['Campaign']['findOne']({'where':{'id':_0x28ca75[_0x7307('0x3f')]['id']}})[_0x7307('0x23')](handleEntityNotFound(_0x482e8d,null))[_0x7307('0x23')](function(_0x3a8e91){if(_0x3a8e91){_0x48f713[_0x7307('0x2f')]=_[_0x7307('0x40')](db['CmHopperFinal'][_0x7307('0x56')]);_0x48f713[_0x7307('0x30')]=_[_0x7307('0x40')](_0x28ca75[_0x7307('0x30')]);_0x48f713['filters']=_[_0x7307('0x31')](_0x48f713[_0x7307('0x2f')],_0x48f713[_0x7307('0x30')]);_0x6c627e[_0x7307('0x32')]=_['intersection'](_0x48f713['model'],qs[_0x7307('0x33')](_0x28ca75[_0x7307('0x30')][_0x7307('0x33')]));_0x6c627e[_0x7307('0x32')]=_0x6c627e[_0x7307('0x32')][_0x7307('0x42')]?_0x6c627e[_0x7307('0x32')]:_0x48f713[_0x7307('0x2f')];if(!_0x28ca75['query'][_0x7307('0x57')](_0x7307('0x5b'))){_0x6c627e[_0x7307('0x1c')]=qs[_0x7307('0x1c')](_0x28ca75[_0x7307('0x30')][_0x7307('0x1c')]);_0x6c627e['offset']=qs[_0x7307('0x1a')](_0x28ca75[_0x7307('0x30')][_0x7307('0x1a')]);}_0x6c627e[_0x7307('0x58')]=qs[_0x7307('0x34')](_0x28ca75[_0x7307('0x30')][_0x7307('0x34')]);_0x6c627e[_0x7307('0x35')]=qs[_0x7307('0x41')](_[_0x7307('0x36')](_0x28ca75[_0x7307('0x30')],_0x48f713[_0x7307('0x41')]));_0x6c627e['where'][_0x7307('0x59')]=_0x3a8e91['id'];if(_0x28ca75[_0x7307('0x30')][_0x7307('0x37')]){_0x6c627e['where']=_[_0x7307('0x38')](_0x6c627e[_0x7307('0x35')],{'$or':_[_0x7307('0x2b')](_0x6c627e['attributes'],function(_0x36ae04){var _0x5f048d={};_0x5f048d[_0x36ae04]={'$like':'%'+_0x28ca75['query']['filter']+'%'};return _0x5f048d;})});}_0x6c627e=_[_0x7307('0x38')]({},_0x6c627e,_0x28ca75[_0x7307('0x39')]);return db[_0x7307('0x5c')][_0x7307('0x1d')]({'where':_0x6c627e[_0x7307('0x35')]})[_0x7307('0x23')](function(_0x4b8ed2){_0x5ed711['count']=_0x4b8ed2;if(_0x28ca75['query']['includeAll']){_0x6c627e[_0x7307('0x3b')]=[{'all':!![]}];}return db['CmHopperFinal']['findAll'](_0x6c627e);})['then'](function(_0xab7277){_0x5ed711[_0x7307('0x3d')]=_0xab7277;return _0x5ed711;});}})[_0x7307('0x23')](respondWithFilteredResult(_0x482e8d,_0x6c627e))[_0x7307('0x45')](handleError(_0x482e8d,null));};exports[_0x7307('0x5d')]=function(_0x52a39b,_0x4ddf97,_0x32361f){var _0x476b2e={'raw':!![],'where':{}};var _0x5d2449={};var _0x33b624={'count':0x0,'rows':[]};return db[_0x7307('0x3a')][_0x7307('0x54')]({'where':{'id':_0x52a39b[_0x7307('0x3f')]['id']}})[_0x7307('0x23')](handleEntityNotFound(_0x4ddf97,null))['then'](function(_0x577ad9){if(_0x577ad9){_0x5d2449[_0x7307('0x2f')]=_[_0x7307('0x40')](db[_0x7307('0x5e')][_0x7307('0x56')]);_0x5d2449['query']=_[_0x7307('0x40')](_0x52a39b['query']);_0x5d2449[_0x7307('0x41')]=_[_0x7307('0x31')](_0x5d2449['model'],_0x5d2449[_0x7307('0x30')]);_0x476b2e[_0x7307('0x32')]=_['intersection'](_0x5d2449[_0x7307('0x2f')],qs[_0x7307('0x33')](_0x52a39b[_0x7307('0x30')][_0x7307('0x33')]));_0x476b2e[_0x7307('0x32')]=_0x476b2e['attributes'][_0x7307('0x42')]?_0x476b2e[_0x7307('0x32')]:_0x5d2449[_0x7307('0x2f')];if(!_0x52a39b[_0x7307('0x30')]['hasOwnProperty'](_0x7307('0x5b'))){_0x476b2e[_0x7307('0x1c')]=qs[_0x7307('0x1c')](_0x52a39b[_0x7307('0x30')][_0x7307('0x1c')]);_0x476b2e[_0x7307('0x1a')]=qs['offset'](_0x52a39b['query'][_0x7307('0x1a')]);}_0x476b2e[_0x7307('0x58')]=qs['sort'](_0x52a39b[_0x7307('0x30')]['sort']);_0x476b2e[_0x7307('0x35')]=qs[_0x7307('0x41')](_[_0x7307('0x36')](_0x52a39b['query'],_0x5d2449[_0x7307('0x41')]));_0x476b2e[_0x7307('0x35')][_0x7307('0x59')]=_0x577ad9['id'];if(_0x52a39b[_0x7307('0x30')][_0x7307('0x37')]){_0x476b2e[_0x7307('0x35')]=_['merge'](_0x476b2e[_0x7307('0x35')],{'$or':_[_0x7307('0x2b')](_0x476b2e[_0x7307('0x32')],function(_0x4ada99){var _0x43641b={};_0x43641b[_0x4ada99]={'$like':'%'+_0x52a39b[_0x7307('0x30')][_0x7307('0x37')]+'%'};return _0x43641b;})});}_0x476b2e=_[_0x7307('0x38')]({},_0x476b2e,_0x52a39b[_0x7307('0x39')]);return db[_0x7307('0x5e')][_0x7307('0x1d')]({'where':_0x476b2e[_0x7307('0x35')]})[_0x7307('0x23')](function(_0x1a7182){_0x33b624[_0x7307('0x1d')]=_0x1a7182;if(_0x52a39b['query'][_0x7307('0x43')]){_0x476b2e['include']=[{'all':!![]}];}return db[_0x7307('0x5e')][_0x7307('0x3c')](_0x476b2e);})[_0x7307('0x23')](function(_0x58d1c6){_0x33b624[_0x7307('0x3d')]=_0x58d1c6;return _0x33b624;});}})[_0x7307('0x23')](respondWithFilteredResult(_0x4ddf97,_0x476b2e))[_0x7307('0x45')](handleError(_0x4ddf97,null));};exports['getLists']=function(_0x4b5f16,_0x755b21,_0x2dd041){var _0xdc58ce={};var _0x348e88={};var _0x5a0878;var _0x156c6b;return db[_0x7307('0x3a')][_0x7307('0x54')]({'where':{'id':_0x4b5f16[_0x7307('0x3f')]['id']}})[_0x7307('0x23')](handleEntityNotFound(_0x755b21,null))['then'](function(_0x1607a0){if(_0x1607a0){_0x5a0878=_0x1607a0;_0x348e88[_0x7307('0x2f')]=_['keys'](db['CmList'][_0x7307('0x56')]);_0x348e88[_0x7307('0x30')]=_[_0x7307('0x40')](_0x4b5f16[_0x7307('0x30')]);_0x348e88[_0x7307('0x41')]=_[_0x7307('0x31')](_0x348e88[_0x7307('0x2f')],_0x348e88[_0x7307('0x30')]);_0xdc58ce['attributes']=_['intersection'](_0x348e88[_0x7307('0x2f')],qs[_0x7307('0x33')](_0x4b5f16[_0x7307('0x30')][_0x7307('0x33')]));_0xdc58ce['attributes']=_0xdc58ce[_0x7307('0x32')][_0x7307('0x42')]?_0xdc58ce[_0x7307('0x32')]:_0x348e88[_0x7307('0x2f')];_0xdc58ce[_0x7307('0x58')]=qs[_0x7307('0x34')](_0x4b5f16[_0x7307('0x30')][_0x7307('0x34')]);_0xdc58ce[_0x7307('0x35')]=qs[_0x7307('0x41')](_[_0x7307('0x36')](_0x4b5f16[_0x7307('0x30')],_0x348e88[_0x7307('0x41')]));if(_0x4b5f16[_0x7307('0x30')][_0x7307('0x37')]){_0xdc58ce['where']=_[_0x7307('0x38')](_0xdc58ce[_0x7307('0x35')],{'$or':_[_0x7307('0x2b')](_0xdc58ce['attributes'],function(_0x43a62f){var _0x355814={};_0x355814[_0x43a62f]={'$like':'%'+_0x4b5f16[_0x7307('0x30')][_0x7307('0x37')]+'%'};return _0x355814;})});}_0xdc58ce=_[_0x7307('0x38')]({},_0xdc58ce,_0x4b5f16[_0x7307('0x39')]);return _0x5a0878[_0x7307('0x5f')](_0xdc58ce);}})[_0x7307('0x23')](function(_0x378434){if(_0x378434){_0x156c6b=_0x378434['length'];if(!_0x4b5f16[_0x7307('0x30')][_0x7307('0x57')]('nolimit')){_0xdc58ce[_0x7307('0x1c')]=qs[_0x7307('0x1c')](_0x4b5f16[_0x7307('0x30')][_0x7307('0x1c')]);_0xdc58ce[_0x7307('0x1a')]=qs[_0x7307('0x1a')](_0x4b5f16[_0x7307('0x30')][_0x7307('0x1a')]);}return _0x5a0878[_0x7307('0x5f')](_0xdc58ce);}})[_0x7307('0x23')](function(_0x46ff82){if(_0x46ff82){return _0x46ff82?{'count':_0x156c6b,'rows':_0x46ff82}:null;}})[_0x7307('0x23')](respondWithResult(_0x755b21,null))[_0x7307('0x45')](handleError(_0x755b21,null));};exports[_0x7307('0x60')]=function(_0x185a23,_0x4fcf81,_0x1dfadf){var _0x44cc86,_0x49bebd;var _0x4557f5=[];var _0x2be6f1=moment()[_0x7307('0x61')](_0x7307('0x62'));return db['Campaign'][_0x7307('0x44')]({'where':{'id':_0x185a23['params']['id']}})[_0x7307('0x23')](handleEntityNotFound(_0x4fcf81,null))['then'](function(_0x5610ba){if(_0x5610ba){_0x49bebd=_0x5610ba;return _0x5610ba[_0x7307('0x60')](_0x185a23[_0x7307('0x47')][_0x7307('0x63')],_[_0x7307('0x50')](_0x185a23[_0x7307('0x47')],[_0x7307('0x63'),'id'])||{});}return null;})['spread'](function(_0x5f3e2b){var _0x326c93;var _0x1f0eb3;_0x44cc86=_0x5f3e2b||[];var _0x2f9dac=[];if(_0x5f3e2b){for(var _0x3832cf=0x0;_0x3832cf<_0x5f3e2b[_0x7307('0x42')];_0x3832cf+=0x1){var _0x3df95e=_0x5f3e2b[_0x3832cf][_0x7307('0x24')]({'plain':!![]});_0x49bebd[_0x7307('0x64')]=_0x185a23[_0x7307('0x47')][_0x7307('0x64')]?_0x185a23[_0x7307('0x47')][_0x7307('0x64')]:_0x49bebd[_0x7307('0x64')];switch(_0x49bebd[_0x7307('0x64')]){case _0x7307('0x65'):_0x326c93=squel[_0x7307('0x66')]()[_0x7307('0x67')](_0x7307('0x68'))[_0x7307('0x69')](['phone','scheduledAt','ContactId',_0x7307('0x6a'),_0x7307('0x59'),_0x7307('0x4e'),_0x7307('0x4f')],squel[_0x7307('0x6b')]()[_0x7307('0x6c')](_0x7307('0x6d'),_0x7307('0x6d'))['field'](_0x7307('0x6e'),_0x7307('0x6f'))['field']('id',_0x7307('0x70'))[_0x7307('0x6c')](_0x3df95e[_0x7307('0x71')]['toString'](),_0x7307('0x6a'))[_0x7307('0x6c')](_0x185a23[_0x7307('0x3f')]['id'][_0x7307('0x72')](),'CampaignId')['field']('\x27'+_0x2be6f1+'\x27',_0x7307('0x4e'))['field']('\x27'+_0x2be6f1+'\x27',_0x7307('0x4f'))[_0x7307('0x73')](_0x7307('0x74'))['where'](_0x7307('0x75'))[_0x7307('0x35')](_0x7307('0x76'),_0x3df95e[_0x7307('0x71')]['toString']())[_0x7307('0x35')](_0x7307('0x77'))['where'](_0x7307('0x78'),squel[_0x7307('0x6b')]()[_0x7307('0x6c')](_0x7307('0x79'))[_0x7307('0x73')](_0x7307('0x7a'))[_0x7307('0x35')]('CampaignId\x20=\x20?',_0x185a23['params']['id'][_0x7307('0x72')]()))[_0x7307('0x35')]('phone\x20NOT\x20IN\x20(?)',squel['select']()[_0x7307('0x6c')](_0x7307('0x7b'))[_0x7307('0x73')](_0x7307('0x68'))['where']('CampaignId\x20=\x20?',_0x185a23[_0x7307('0x3f')]['id']['toString']())))['toString']();break;case _0x7307('0x7c'):_0x326c93=squel[_0x7307('0x66')]()[_0x7307('0x67')]('cm_hopper')[_0x7307('0x69')]([_0x7307('0x6d'),'scheduledAt',_0x7307('0x70'),_0x7307('0x6a'),'CampaignId',_0x7307('0x4e'),'updatedAt'],squel['select']()[_0x7307('0x6c')](_0x7307('0x6d'),_0x7307('0x6d'))[_0x7307('0x6c')](_0x7307('0x6e'),_0x7307('0x6f'))['field']('id','ContactId')[_0x7307('0x6c')](_0x3df95e[_0x7307('0x71')][_0x7307('0x72')](),'ListId')['field'](_0x185a23[_0x7307('0x3f')]['id'][_0x7307('0x72')](),'CampaignId')[_0x7307('0x6c')]('\x27'+_0x2be6f1+'\x27',_0x7307('0x4e'))[_0x7307('0x6c')]('\x27'+_0x2be6f1+'\x27','updatedAt')[_0x7307('0x73')](_0x7307('0x74'))[_0x7307('0x35')](_0x7307('0x75'))[_0x7307('0x35')](_0x7307('0x76'),_0x3df95e[_0x7307('0x71')]['toString']())[_0x7307('0x35')](_0x7307('0x77'))[_0x7307('0x35')](_0x7307('0x78'),squel[_0x7307('0x6b')]()['field']('COALESCE(phone,\x27\x27)')['from'](_0x7307('0x68'))[_0x7307('0x35')]('CampaignId\x20=\x20?',_0x185a23['params']['id'][_0x7307('0x72')]())))[_0x7307('0x72')]();break;default:_0x326c93=squel[_0x7307('0x66')]()[_0x7307('0x67')]('cm_hopper')[_0x7307('0x69')]([_0x7307('0x6d'),_0x7307('0x6f'),_0x7307('0x70'),_0x7307('0x6a'),_0x7307('0x59'),_0x7307('0x4e'),'updatedAt'],squel[_0x7307('0x6b')]()[_0x7307('0x6c')](_0x7307('0x6d'),_0x7307('0x6d'))['field'](_0x7307('0x6e'),_0x7307('0x6f'))[_0x7307('0x6c')]('id','ContactId')['field'](_0x3df95e['CmListId'][_0x7307('0x72')](),'ListId')[_0x7307('0x6c')](_0x185a23['params']['id']['toString'](),_0x7307('0x59'))[_0x7307('0x6c')]('\x27'+_0x2be6f1+'\x27',_0x7307('0x4e'))[_0x7307('0x6c')]('\x27'+_0x2be6f1+'\x27','updatedAt')['from']('cm_contacts')[_0x7307('0x35')](_0x7307('0x75'))[_0x7307('0x35')](_0x7307('0x76'),_0x3df95e[_0x7307('0x71')]['toString']())[_0x7307('0x35')](_0x7307('0x77')))['toString']();}_0x1f0eb3=squel[_0x7307('0x66')]()[_0x7307('0x67')](_0x7307('0x7d'))[_0x7307('0x69')]([_0x7307('0x7e'),_0x7307('0x6f'),'phone',_0x7307('0x7f'),_0x7307('0x4e'),'updatedAt'],squel[_0x7307('0x6b')]()[_0x7307('0x6c')](_0x7307('0x80'),'id')[_0x7307('0x6c')](_0x7307('0x6e'),'scheduledAt')['field'](_0x7307('0x81'),_0x7307('0x6d'))[_0x7307('0x6c')]('ci.OrderBY',_0x7307('0x7f'))['field']('\x27'+_0x2be6f1+'\x27',_0x7307('0x4e'))['field']('\x27'+_0x2be6f1+'\x27',_0x7307('0x4f'))['from'](_0x7307('0x82'),'ci')[_0x7307('0x83')](_0x7307('0x68'),'h',_0x7307('0x84'))[_0x7307('0x35')](_0x7307('0x85'),_0x3df95e[_0x7307('0x71')][_0x7307('0x72')]())[_0x7307('0x35')](_0x7307('0x86'),_0x185a23[_0x7307('0x3f')]['id'][_0x7307('0x72')]())[_0x7307('0x35')](_0x7307('0x87'),_0x2be6f1))[_0x7307('0x72')]();_0x2f9dac['push'](db[_0x7307('0x88')]['query'](_0x326c93));_0x4557f5['push'](db[_0x7307('0x88')]['query'](_0x1f0eb3));}return BPromise[_0x7307('0x89')](_0x2f9dac);}})[_0x7307('0x23')](function(){return BPromise[_0x7307('0x89')](_0x4557f5);})[_0x7307('0x23')](function(){return _0x44cc86;})[_0x7307('0x23')](respondWithResult(_0x4fcf81,null))[_0x7307('0x45')](handleError(_0x4fcf81,null));};exports[_0x7307('0x8a')]=function(_0x3e85d2,_0x74a590,_0x2598da){return db[_0x7307('0x3a')]['find']({'where':{'id':_0x3e85d2[_0x7307('0x3f')]['id']}})[_0x7307('0x23')](handleEntityNotFound(_0x74a590,null))[_0x7307('0x23')](function(_0x2e1e9f){if(_0x2e1e9f){return _0x2e1e9f[_0x7307('0x8a')](_0x3e85d2[_0x7307('0x30')]['ids']);}})[_0x7307('0x23')](function(_0x5d9e6d){if(_0x5d9e6d){return db[_0x7307('0x55')][_0x7307('0x25')]({'where':{'ListId':_0x3e85d2[_0x7307('0x30')]['ids'],'CampaignId':_0x3e85d2[_0x7307('0x3f')]['id']}})[_0x7307('0x23')](function(){return _0x5d9e6d;});}})[_0x7307('0x23')](respondWithStatusCode(_0x74a590,null))['catch'](handleError(_0x74a590,null));};exports[_0x7307('0x8b')]=function(_0xc21630,_0x56fabe,_0xabedb3){var _0x3cbf8b={};var _0x1d60db={};var _0x16a2d0;var _0x589db2;return db[_0x7307('0x3a')][_0x7307('0x54')]({'where':{'id':_0xc21630[_0x7307('0x3f')]['id']}})['then'](handleEntityNotFound(_0x56fabe,null))[_0x7307('0x23')](function(_0xc63622){if(_0xc63622){_0x16a2d0=_0xc63622;_0x1d60db['model']=_['keys'](db[_0x7307('0x8c')][_0x7307('0x56')]);_0x1d60db[_0x7307('0x30')]=_[_0x7307('0x40')](_0xc21630[_0x7307('0x30')]);_0x1d60db['filters']=_[_0x7307('0x31')](_0x1d60db[_0x7307('0x2f')],_0x1d60db[_0x7307('0x30')]);_0x3cbf8b[_0x7307('0x32')]=_[_0x7307('0x31')](_0x1d60db[_0x7307('0x2f')],qs[_0x7307('0x33')](_0xc21630[_0x7307('0x30')][_0x7307('0x33')]));_0x3cbf8b[_0x7307('0x32')]=_0x3cbf8b[_0x7307('0x32')][_0x7307('0x42')]?_0x3cbf8b[_0x7307('0x32')]:_0x1d60db[_0x7307('0x2f')];_0x3cbf8b[_0x7307('0x58')]=qs[_0x7307('0x34')](_0xc21630[_0x7307('0x30')][_0x7307('0x34')]);_0x3cbf8b[_0x7307('0x35')]=qs['filters'](_[_0x7307('0x36')](_0xc21630[_0x7307('0x30')],_0x1d60db[_0x7307('0x41')]));if(_0xc21630[_0x7307('0x30')][_0x7307('0x37')]){_0x3cbf8b[_0x7307('0x35')]=_[_0x7307('0x38')](_0x3cbf8b['where'],{'$or':_['map'](_0x3cbf8b[_0x7307('0x32')],function(_0x32831){var _0x10789b={};_0x10789b[_0x32831]={'$like':'%'+_0xc21630['query'][_0x7307('0x37')]+'%'};return _0x10789b;})});}_0x3cbf8b=_[_0x7307('0x38')]({},_0x3cbf8b,_0xc21630[_0x7307('0x39')]);return _0x16a2d0[_0x7307('0x8b')](_0x3cbf8b);}})[_0x7307('0x23')](function(_0x1a39f4){if(_0x1a39f4){_0x589db2=_0x1a39f4['length'];if(!_0xc21630[_0x7307('0x30')][_0x7307('0x57')]('nolimit')){_0x3cbf8b['limit']=qs[_0x7307('0x1c')](_0xc21630[_0x7307('0x30')][_0x7307('0x1c')]);_0x3cbf8b['offset']=qs[_0x7307('0x1a')](_0xc21630[_0x7307('0x30')][_0x7307('0x1a')]);}return _0x16a2d0[_0x7307('0x8b')](_0x3cbf8b);}})[_0x7307('0x23')](function(_0x1e26c3){if(_0x1e26c3){return _0x1e26c3?{'count':_0x589db2,'rows':_0x1e26c3}:null;}})[_0x7307('0x23')](respondWithResult(_0x56fabe,null))[_0x7307('0x45')](handleError(_0x56fabe,null));};exports[_0x7307('0x8d')]=function(_0x1ee45d,_0x573bf5,_0x4ac577){var _0xfa57f8,_0x891f06;var _0x8c9a3b=[];var _0x513650=moment()[_0x7307('0x61')](_0x7307('0x62'));return db[_0x7307('0x3a')][_0x7307('0x44')]({'where':{'id':_0x1ee45d[_0x7307('0x3f')]['id']}})[_0x7307('0x23')](handleEntityNotFound(_0x573bf5,null))[_0x7307('0x23')](function(_0x2b5d48){if(_0x2b5d48){_0x891f06=_0x2b5d48;return _0x2b5d48[_0x7307('0x8d')](_0x1ee45d[_0x7307('0x47')][_0x7307('0x63')],_['omit'](_0x1ee45d[_0x7307('0x47')],[_0x7307('0x63'),'id'])||{});}return null;})[_0x7307('0x8e')](function(_0x528b29){var _0x5574a2;var _0x2fd52b;_0xfa57f8=_0x528b29||[];var _0x452bd4=[];if(_0x528b29){for(var _0x33d957=0x0;_0x33d957<_0x528b29[_0x7307('0x42')];_0x33d957+=0x1){var _0x46d6dd=_0x528b29[_0x33d957][_0x7307('0x24')]({'plain':!![]});_0x5574a2=squel['insert']()[_0x7307('0x67')](_0x7307('0x8f'))[_0x7307('0x69')]([_0x7307('0x6d'),'ContactId',_0x7307('0x6a'),'CampaignId',_0x7307('0x4e'),_0x7307('0x4f')],squel['select']()[_0x7307('0x6c')](_0x7307('0x6d'),_0x7307('0x6d'))['field']('id','ContactId')['field'](_0x46d6dd['CmListId'][_0x7307('0x72')](),_0x7307('0x6a'))[_0x7307('0x6c')](_0x1ee45d[_0x7307('0x3f')]['id'][_0x7307('0x72')](),_0x7307('0x59'))[_0x7307('0x6c')]('NOW()','createdAt')['field'](_0x7307('0x6e'),_0x7307('0x4f'))['from'](_0x7307('0x74'))[_0x7307('0x35')](_0x7307('0x75'))['where']('ListId\x20=\x20?',_0x46d6dd[_0x7307('0x71')][_0x7307('0x72')]())[_0x7307('0x35')](_0x7307('0x77')))[_0x7307('0x72')]();_0x452bd4[_0x7307('0x90')](db[_0x7307('0x88')][_0x7307('0x30')](_0x5574a2));}return BPromise[_0x7307('0x89')](_0x452bd4);}})[_0x7307('0x23')](function(){return _0xfa57f8;})[_0x7307('0x23')](respondWithResult(_0x573bf5,null))[_0x7307('0x45')](handleError(_0x573bf5,null));};exports[_0x7307('0x91')]=function(_0x524e2c,_0x3f0337,_0x433a12){return db[_0x7307('0x3a')][_0x7307('0x44')]({'where':{'id':_0x524e2c[_0x7307('0x3f')]['id']}})['then'](handleEntityNotFound(_0x3f0337,null))['then'](function(_0x305342){if(_0x305342){return _0x305342[_0x7307('0x91')](_0x524e2c[_0x7307('0x30')][_0x7307('0x63')]);}})[_0x7307('0x23')](function(_0x43dd22){if(_0x43dd22){return db['CmHopperBlack']['destroy']({'where':{'ListId':_0x524e2c[_0x7307('0x30')]['ids'],'CampaignId':_0x524e2c[_0x7307('0x3f')]['id']}})[_0x7307('0x23')](function(){return _0x43dd22;});}})['then'](respondWithStatusCode(_0x3f0337,null))['catch'](handleError(_0x3f0337,null));};
\ No newline at end of file
+var _0x1db3=['getLists','CmList','format','addLists','ids','dialCheckDuplicateType','insert','into','cm_hopper','phone','scheduledAt','ContactId','ListId','select','field','CmListId','toString','deletedAt\x20IS\x20NULL','phone\x20IS\x20NOT\x20NULL','phone\x20NOT\x20IN\x20(?)','from','cm_hopper_final','CampaignId\x20=\x20?','COALESCE(phone,\x27\x27)','NOW()','cm_contacts','fromQuery','ListId\x20=\x20?','cm_hopper_additional_phones','h.id','ci.item','OrderBy','cm_contact_has_items','join','h.ContactId\x20=\x20ci.CmContactId','h.ListId\x20=\x20?','h.CampaignId=?','h.createdAt\x20=\x20?','push','sequelize','all','removeLists','getBlackLists','addBlackLists','spread','cm_hopper_black','removeBlackLists','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','json','undefined','limit','count','offset','apply','reject','save','update','then','IvrCampaigns','end','error','name','index','map','fieldName','type','query','keys','model','attributes','fields','length','hasOwnProperty','order','where','filters','pick','filter','merge','VIRTUAL','options','Campaign','includeAll','include','findAll','catch','params','intersection','find','create','body','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','UserProfileSection','userProfileId','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','rawAttributes','omit','updatedAt','createdAt','destroy','getHoppers','findOne','CmHopper','nolimit','sort','rows','getHopperHistories','CmHopperHistory','CmHopperFinal','CampaignId','getHopperBlacks','CmHopperBlack'];(function(_0x34f81a,_0x459c1d){var _0x12ed6f=function(_0x615392){while(--_0x615392){_0x34f81a['push'](_0x34f81a['shift']());}};_0x12ed6f(++_0x459c1d);}(_0x1db3,0x1e5));var _0x31db=function(_0xf23974,_0x22bbd9){_0xf23974=_0xf23974-0x0;var _0x1fb72b=_0x1db3[_0xf23974];return _0x1fb72b;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x31db('0x0'));var zipdir=require(_0x31db('0x1'));var jsonpatch=require(_0x31db('0x2'));var rp=require(_0x31db('0x3'));var moment=require(_0x31db('0x4'));var BPromise=require(_0x31db('0x5'));var Mustache=require(_0x31db('0x6'));var util=require(_0x31db('0x7'));var path=require(_0x31db('0x8'));var sox=require(_0x31db('0x9'));var csv=require(_0x31db('0xa'));var ejs=require(_0x31db('0xb'));var fs=require('fs');var fs_extra=require(_0x31db('0xc'));var _=require(_0x31db('0xd'));var squel=require(_0x31db('0xe'));var crypto=require(_0x31db('0xf'));var jsforce=require(_0x31db('0x10'));var deskjs=require(_0x31db('0x11'));var toCsv=require(_0x31db('0xa'));var querystring=require('querystring');var Papa=require(_0x31db('0x12'));var Redis=require(_0x31db('0x13'));var authService=require(_0x31db('0x14'));var qs=require(_0x31db('0x15'));var as=require(_0x31db('0x16'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x31db('0x17'))(_0x31db('0x18'));var utils=require(_0x31db('0x19'));var config=require('../../config/environment');var licenseUtil=require(_0x31db('0x1a'));var db=require(_0x31db('0x1b'))['db'];function respondWithStatusCode(_0x1fad0a,_0x1ca88f){_0x1ca88f=_0x1ca88f||0xcc;return function(_0x298707){if(_0x298707){return _0x1fad0a[_0x31db('0x1c')](_0x1ca88f);}return _0x1fad0a['status'](_0x1ca88f)['end']();};}function respondWithResult(_0xc899ba,_0x5706dc){_0x5706dc=_0x5706dc||0xc8;return function(_0x1ccc17){if(_0x1ccc17){return _0xc899ba[_0x31db('0x1d')](_0x5706dc)[_0x31db('0x1e')](_0x1ccc17);}};}function respondWithFilteredResult(_0x2009c7,_0x29f691){return function(_0x4ccb3d){if(_0x4ccb3d){var _0x557907=typeof _0x29f691['offset']===_0x31db('0x1f')&&typeof _0x29f691[_0x31db('0x20')]===_0x31db('0x1f');var _0x4dbc05=_0x4ccb3d[_0x31db('0x21')];var _0x1d3218=_0x557907?0x0:_0x29f691[_0x31db('0x22')];var _0x3df86e=_0x557907?_0x4ccb3d[_0x31db('0x21')]:_0x29f691[_0x31db('0x22')]+_0x29f691[_0x31db('0x20')];var _0x53ca16;if(_0x3df86e>=_0x4dbc05){_0x3df86e=_0x4dbc05;_0x53ca16=0xc8;}else{_0x53ca16=0xce;}_0x2009c7[_0x31db('0x1d')](_0x53ca16);return _0x2009c7['set']('Content-Range',_0x1d3218+'-'+_0x3df86e+'/'+_0x4dbc05)[_0x31db('0x1e')](_0x4ccb3d);}return null;};}function patchUpdates(_0x1915ec){return function(_0x168002){try{jsonpatch[_0x31db('0x23')](_0x168002,_0x1915ec,!![]);}catch(_0x211e59){return BPromise[_0x31db('0x24')](_0x211e59);}return _0x168002[_0x31db('0x25')]();};}function saveUpdates(_0x98ce70,_0x204781){return function(_0x1f00f7){if(_0x1f00f7){return _0x1f00f7[_0x31db('0x26')](_0x98ce70)[_0x31db('0x27')](function(_0x5574e5){return _0x5574e5;});}return null;};}function removeEntity(_0x358d1d,_0x335cc9){return function(_0x303cf4){if(_0x303cf4){return _0x303cf4['destroy']()[_0x31db('0x27')](function(){var _0x54d623=_0x303cf4['get']({'plain':!![]});var _0x2ea3a6=_0x31db('0x28');return db['UserProfileResource']['destroy']({'where':{'type':_0x2ea3a6,'resourceId':_0x54d623['id']}})['then'](function(){return _0x303cf4;});})[_0x31db('0x27')](function(){_0x358d1d['status'](0xcc)[_0x31db('0x29')]();});}};}function handleEntityNotFound(_0xe10c6a,_0x1f3355){return function(_0x3effc4){if(!_0x3effc4){_0xe10c6a[_0x31db('0x1c')](0x194);}return _0x3effc4;};}function handleError(_0xb969fe,_0x2e1c2d){_0x2e1c2d=_0x2e1c2d||0x1f4;return function(_0x19d079){logger[_0x31db('0x2a')](_0x19d079['stack']);if(_0x19d079[_0x31db('0x2b')]){delete _0x19d079[_0x31db('0x2b')];}_0xb969fe['status'](_0x2e1c2d)['send'](_0x19d079);};}exports[_0x31db('0x2c')]=function(_0x5f256c,_0x5e29e4){var _0x5a6368={},_0x260d00={},_0x2d5e49={'count':0x0,'rows':[]};var _0x5e3867=_[_0x31db('0x2d')](db['Campaign']['rawAttributes'],function(_0x2a41c9){return{'name':_0x2a41c9[_0x31db('0x2e')],'type':_0x2a41c9[_0x31db('0x2f')]['key']};});_0x260d00['model']=_[_0x31db('0x2d')](_0x5e3867,_0x31db('0x2b'));_0x260d00[_0x31db('0x30')]=_[_0x31db('0x31')](_0x5f256c[_0x31db('0x30')]);_0x260d00['filters']=_['intersection'](_0x260d00[_0x31db('0x32')],_0x260d00['query']);_0x5a6368[_0x31db('0x33')]=_['intersection'](_0x260d00[_0x31db('0x32')],qs[_0x31db('0x34')](_0x5f256c[_0x31db('0x30')][_0x31db('0x34')]));_0x5a6368['attributes']=_0x5a6368[_0x31db('0x33')][_0x31db('0x35')]?_0x5a6368['attributes']:_0x260d00['model'];if(!_0x5f256c[_0x31db('0x30')][_0x31db('0x36')]('nolimit')){_0x5a6368['limit']=qs[_0x31db('0x20')](_0x5f256c[_0x31db('0x30')][_0x31db('0x20')]);_0x5a6368[_0x31db('0x22')]=qs['offset'](_0x5f256c[_0x31db('0x30')][_0x31db('0x22')]);}_0x5a6368[_0x31db('0x37')]=qs['sort'](_0x5f256c[_0x31db('0x30')]['sort']);_0x5a6368[_0x31db('0x38')]=qs[_0x31db('0x39')](_[_0x31db('0x3a')](_0x5f256c[_0x31db('0x30')],_0x260d00['filters']),_0x5e3867);if(_0x5f256c[_0x31db('0x30')][_0x31db('0x3b')]){_0x5a6368[_0x31db('0x38')]=_[_0x31db('0x3c')](_0x5a6368['where'],{'$or':_[_0x31db('0x2d')](_0x5e3867,function(_0x26f071){if(_0x26f071[_0x31db('0x2f')]!==_0x31db('0x3d')){var _0x55714d={};_0x55714d[_0x26f071[_0x31db('0x2b')]]={'$like':'%'+_0x5f256c[_0x31db('0x30')][_0x31db('0x3b')]+'%'};return _0x55714d;}})});}_0x5a6368=_[_0x31db('0x3c')]({},_0x5a6368,_0x5f256c[_0x31db('0x3e')]);var _0x97e7f7={'where':_0x5a6368[_0x31db('0x38')]};return db[_0x31db('0x3f')][_0x31db('0x21')](_0x97e7f7)[_0x31db('0x27')](function(_0x21e693){_0x2d5e49['count']=_0x21e693;if(_0x5f256c[_0x31db('0x30')][_0x31db('0x40')]){_0x5a6368[_0x31db('0x41')]=[{'all':!![]}];}return db[_0x31db('0x3f')][_0x31db('0x42')](_0x5a6368);})[_0x31db('0x27')](function(_0x17d9b8){_0x2d5e49['rows']=_0x17d9b8;return _0x2d5e49;})[_0x31db('0x27')](respondWithFilteredResult(_0x5e29e4,_0x5a6368))[_0x31db('0x43')](handleError(_0x5e29e4,null));};exports['show']=function(_0xe9d1fa,_0x5aa2b2){var _0x15a21c={'raw':![],'where':{'id':_0xe9d1fa[_0x31db('0x44')]['id']}},_0x242304={};_0x242304['model']=_[_0x31db('0x31')](db[_0x31db('0x3f')]['rawAttributes']);_0x242304[_0x31db('0x30')]=_[_0x31db('0x31')](_0xe9d1fa[_0x31db('0x30')]);_0x242304[_0x31db('0x39')]=_[_0x31db('0x45')](_0x242304[_0x31db('0x32')],_0x242304[_0x31db('0x30')]);_0x15a21c[_0x31db('0x33')]=_['intersection'](_0x242304[_0x31db('0x32')],qs[_0x31db('0x34')](_0xe9d1fa[_0x31db('0x30')][_0x31db('0x34')]));_0x15a21c[_0x31db('0x33')]=_0x15a21c['attributes']['length']?_0x15a21c[_0x31db('0x33')]:_0x242304[_0x31db('0x32')];if(_0xe9d1fa[_0x31db('0x30')][_0x31db('0x40')]){_0x15a21c[_0x31db('0x41')]=[{'all':!![]}];}_0x15a21c=_[_0x31db('0x3c')]({},_0x15a21c,_0xe9d1fa[_0x31db('0x3e')]);return db[_0x31db('0x3f')][_0x31db('0x46')](_0x15a21c)[_0x31db('0x27')](handleEntityNotFound(_0x5aa2b2,null))['then'](respondWithResult(_0x5aa2b2,null))[_0x31db('0x43')](handleError(_0x5aa2b2,null));};exports[_0x31db('0x47')]=function(_0xd9b947,_0x180021){return db[_0x31db('0x3f')][_0x31db('0x47')](_0xd9b947[_0x31db('0x48')],{})[_0x31db('0x27')](function(_0x496d40){var _0x21998d=_0xd9b947['user'][_0x31db('0x49')]({'plain':!![]});if(!_0x21998d)throw new Error(_0x31db('0x4a'));if(_0x21998d[_0x31db('0x4b')]===_0x31db('0x4c')){var _0x4f861b=_0x496d40['get']({'plain':!![]});var _0x55db42=_0x31db('0x28');return db[_0x31db('0x4d')][_0x31db('0x46')]({'where':{'name':_0x55db42,'userProfileId':_0x21998d[_0x31db('0x4e')]},'raw':!![]})['then'](function(_0x31b324){if(_0x31b324&&_0x31b324[_0x31db('0x4f')]===0x0){return db[_0x31db('0x50')]['create']({'name':_0x4f861b[_0x31db('0x2b')],'resourceId':_0x4f861b['id'],'type':_0x31b324['name'],'sectionId':_0x31b324['id']},{})[_0x31db('0x27')](function(){return _0x496d40;});}else{return _0x496d40;}})[_0x31db('0x43')](function(_0x51fe21){logger[_0x31db('0x2a')](_0x31db('0x51'),_0x51fe21);throw _0x51fe21;});}return _0x496d40;})['then'](respondWithResult(_0x180021,0xc9))[_0x31db('0x43')](handleError(_0x180021,null));};exports['clone']=function(_0x919425,_0x31a1a8){var _0x5d0ff1={'where':{'id':_0x919425['params']['id']}},_0x3e6733={};_0x3e6733[_0x31db('0x32')]=_[_0x31db('0x31')](db[_0x31db('0x3f')][_0x31db('0x52')]);_0x5d0ff1[_0x31db('0x33')]=_[_0x31db('0x45')](_0x3e6733[_0x31db('0x32')],qs[_0x31db('0x34')](_0x919425['query'][_0x31db('0x34')]));_0x5d0ff1[_0x31db('0x33')]=_0x5d0ff1[_0x31db('0x33')][_0x31db('0x35')]?_0x5d0ff1[_0x31db('0x33')]:_0x3e6733[_0x31db('0x32')];if(_0x919425[_0x31db('0x30')][_0x31db('0x40')]){_0x5d0ff1['include']=[{'all':!![]}];}_0x5d0ff1=_[_0x31db('0x3c')]({},_0x5d0ff1,_0x919425['options']);return db[_0x31db('0x3f')][_0x31db('0x46')](_0x5d0ff1)[_0x31db('0x27')](handleEntityNotFound(_0x31a1a8,null))[_0x31db('0x27')](function(_0x23e416){if(_0x23e416){var _0x3479b6=_0x23e416[_0x31db('0x49')]({'plain':!![]});_0x3479b6=qs[_0x31db('0x53')](_0x3479b6,['id','createdAt',_0x31db('0x54')]);_0x919425['body']=_[_0x31db('0x53')](_0x919425[_0x31db('0x48')],['id',_0x31db('0x55'),_0x31db('0x54')]);return db[_0x31db('0x3f')][_0x31db('0x47')](_[_0x31db('0x3c')](_0x3479b6,_0x919425[_0x31db('0x48')]),{'include':_0x919425[_0x31db('0x30')][_0x31db('0x40')]?[{'all':!![]}]:undefined})[_0x31db('0x27')](function(_0x4ced2f){var _0x1e8777=_0x919425['user'][_0x31db('0x49')]({'plain':!![]});if(!_0x1e8777)throw new Error(_0x31db('0x4a'));if(_0x1e8777[_0x31db('0x4b')]===_0x31db('0x4c')){var _0x10045a=_0x4ced2f[_0x31db('0x49')]({'plain':!![]});var _0x25f94c=_0x31db('0x28');return db['UserProfileSection'][_0x31db('0x46')]({'where':{'name':_0x25f94c,'userProfileId':_0x1e8777['userProfileId']},'raw':!![]})[_0x31db('0x27')](function(_0x5d448b){if(_0x5d448b&&_0x5d448b[_0x31db('0x4f')]===0x0){return db[_0x31db('0x50')]['create']({'name':_0x10045a[_0x31db('0x2b')],'resourceId':_0x10045a['id'],'type':_0x5d448b[_0x31db('0x2b')],'sectionId':_0x5d448b['id']},{})[_0x31db('0x27')](function(){return _0x4ced2f;});}else{return _0x4ced2f;}})[_0x31db('0x43')](function(_0x166d49){logger[_0x31db('0x2a')](_0x31db('0x51'),_0x166d49);throw _0x166d49;});}return _0x4ced2f;});}})[_0x31db('0x27')](respondWithResult(_0x31a1a8,0xc9))[_0x31db('0x43')](handleError(_0x31a1a8,null));};exports[_0x31db('0x26')]=function(_0x1526af,_0x54d3a0){if(_0x1526af[_0x31db('0x48')]['id']){delete _0x1526af[_0x31db('0x48')]['id'];}return db['Campaign'][_0x31db('0x46')]({'where':{'id':_0x1526af[_0x31db('0x44')]['id']}})['then'](handleEntityNotFound(_0x54d3a0,null))[_0x31db('0x27')](saveUpdates(_0x1526af['body'],null))[_0x31db('0x27')](respondWithResult(_0x54d3a0,null))[_0x31db('0x43')](handleError(_0x54d3a0,null));};exports[_0x31db('0x56')]=function(_0x41179a,_0x2aafcd){return db[_0x31db('0x3f')][_0x31db('0x46')]({'where':{'id':_0x41179a['params']['id']}})['then'](handleEntityNotFound(_0x2aafcd,null))['then'](removeEntity(_0x2aafcd,null))['catch'](handleError(_0x2aafcd,null));};exports[_0x31db('0x57')]=function(_0x225144,_0x1ab4c0,_0x374bd4){var _0x46c678={'raw':!![],'where':{}};var _0x21e3cf={};var _0x38cc83={'count':0x0,'rows':[]};return db['Campaign'][_0x31db('0x58')]({'where':{'id':_0x225144[_0x31db('0x44')]['id']}})[_0x31db('0x27')](handleEntityNotFound(_0x1ab4c0,null))[_0x31db('0x27')](function(_0x3ccf4c){if(_0x3ccf4c){_0x21e3cf['model']=_['keys'](db[_0x31db('0x59')][_0x31db('0x52')]);_0x21e3cf[_0x31db('0x30')]=_[_0x31db('0x31')](_0x225144[_0x31db('0x30')]);_0x21e3cf[_0x31db('0x39')]=_['intersection'](_0x21e3cf['model'],_0x21e3cf[_0x31db('0x30')]);_0x46c678[_0x31db('0x33')]=_[_0x31db('0x45')](_0x21e3cf['model'],qs[_0x31db('0x34')](_0x225144[_0x31db('0x30')][_0x31db('0x34')]));_0x46c678[_0x31db('0x33')]=_0x46c678[_0x31db('0x33')][_0x31db('0x35')]?_0x46c678['attributes']:_0x21e3cf['model'];if(!_0x225144[_0x31db('0x30')][_0x31db('0x36')](_0x31db('0x5a'))){_0x46c678['limit']=qs[_0x31db('0x20')](_0x225144[_0x31db('0x30')][_0x31db('0x20')]);_0x46c678[_0x31db('0x22')]=qs[_0x31db('0x22')](_0x225144[_0x31db('0x30')]['offset']);}_0x46c678[_0x31db('0x37')]=qs[_0x31db('0x5b')](_0x225144[_0x31db('0x30')][_0x31db('0x5b')]);_0x46c678[_0x31db('0x38')]=qs[_0x31db('0x39')](_[_0x31db('0x3a')](_0x225144[_0x31db('0x30')],_0x21e3cf[_0x31db('0x39')]));_0x46c678[_0x31db('0x38')]['CampaignId']=_0x3ccf4c['id'];if(_0x225144[_0x31db('0x30')][_0x31db('0x3b')]){_0x46c678['where']=_[_0x31db('0x3c')](_0x46c678[_0x31db('0x38')],{'$or':_[_0x31db('0x2d')](_0x46c678[_0x31db('0x33')],function(_0x4aaa1f){var _0x189595={};_0x189595[_0x4aaa1f]={'$like':'%'+_0x225144['query'][_0x31db('0x3b')]+'%'};return _0x189595;})});}_0x46c678=_['merge']({},_0x46c678,_0x225144['options']);return db[_0x31db('0x59')][_0x31db('0x21')]({'where':_0x46c678['where']})[_0x31db('0x27')](function(_0x409b2d){_0x38cc83[_0x31db('0x21')]=_0x409b2d;if(_0x225144[_0x31db('0x30')][_0x31db('0x40')]){_0x46c678[_0x31db('0x41')]=[{'all':!![]}];}return db[_0x31db('0x59')][_0x31db('0x42')](_0x46c678);})[_0x31db('0x27')](function(_0x1e756d){_0x38cc83[_0x31db('0x5c')]=_0x1e756d;return _0x38cc83;});}})['then'](respondWithFilteredResult(_0x1ab4c0,_0x46c678))[_0x31db('0x43')](handleError(_0x1ab4c0,null));};exports[_0x31db('0x5d')]=function(_0x14a76c,_0x19b391,_0x6a0b03){var _0x1a443a={'raw':!![],'where':{}};var _0x58e645={};var _0x392886={'count':0x0,'rows':[]};return db[_0x31db('0x3f')][_0x31db('0x58')]({'where':{'id':_0x14a76c[_0x31db('0x44')]['id']}})[_0x31db('0x27')](handleEntityNotFound(_0x19b391,null))[_0x31db('0x27')](function(_0xa86607){if(_0xa86607){_0x58e645[_0x31db('0x32')]=_[_0x31db('0x31')](db[_0x31db('0x5e')][_0x31db('0x52')]);_0x58e645[_0x31db('0x30')]=_[_0x31db('0x31')](_0x14a76c[_0x31db('0x30')]);_0x58e645[_0x31db('0x39')]=_[_0x31db('0x45')](_0x58e645[_0x31db('0x32')],_0x58e645[_0x31db('0x30')]);_0x1a443a[_0x31db('0x33')]=_[_0x31db('0x45')](_0x58e645[_0x31db('0x32')],qs[_0x31db('0x34')](_0x14a76c[_0x31db('0x30')][_0x31db('0x34')]));_0x1a443a[_0x31db('0x33')]=_0x1a443a[_0x31db('0x33')]['length']?_0x1a443a[_0x31db('0x33')]:_0x58e645['model'];if(!_0x14a76c['query'][_0x31db('0x36')](_0x31db('0x5a'))){_0x1a443a[_0x31db('0x20')]=qs['limit'](_0x14a76c[_0x31db('0x30')][_0x31db('0x20')]);_0x1a443a['offset']=qs['offset'](_0x14a76c['query'][_0x31db('0x22')]);}_0x1a443a[_0x31db('0x37')]=qs[_0x31db('0x5b')](_0x14a76c[_0x31db('0x30')][_0x31db('0x5b')]);_0x1a443a[_0x31db('0x38')]=qs[_0x31db('0x39')](_[_0x31db('0x3a')](_0x14a76c['query'],_0x58e645['filters']));_0x1a443a['where']['CampaignId']=_0xa86607['id'];if(_0x14a76c[_0x31db('0x30')]['filter']){_0x1a443a[_0x31db('0x38')]=_['merge'](_0x1a443a['where'],{'$or':_[_0x31db('0x2d')](_0x1a443a['attributes'],function(_0x2b69eb){var _0xe520e8={};_0xe520e8[_0x2b69eb]={'$like':'%'+_0x14a76c[_0x31db('0x30')]['filter']+'%'};return _0xe520e8;})});}_0x1a443a=_['merge']({},_0x1a443a,_0x14a76c['options']);return db[_0x31db('0x5e')][_0x31db('0x21')]({'where':_0x1a443a[_0x31db('0x38')]})[_0x31db('0x27')](function(_0xe9f99d){_0x392886['count']=_0xe9f99d;if(_0x14a76c[_0x31db('0x30')][_0x31db('0x40')]){_0x1a443a[_0x31db('0x41')]=[{'all':!![]}];}return db['CmHopperHistory'][_0x31db('0x42')](_0x1a443a);})[_0x31db('0x27')](function(_0xb1be21){_0x392886[_0x31db('0x5c')]=_0xb1be21;return _0x392886;});}})[_0x31db('0x27')](respondWithFilteredResult(_0x19b391,_0x1a443a))[_0x31db('0x43')](handleError(_0x19b391,null));};exports['getHopperFinals']=function(_0x148410,_0x3a6dd2,_0x4d8f7e){var _0x5e12a7={'raw':!![],'where':{}};var _0x5364c3={};var _0x4f05b0={'count':0x0,'rows':[]};return db[_0x31db('0x3f')][_0x31db('0x58')]({'where':{'id':_0x148410[_0x31db('0x44')]['id']}})[_0x31db('0x27')](handleEntityNotFound(_0x3a6dd2,null))[_0x31db('0x27')](function(_0x2fc070){if(_0x2fc070){_0x5364c3[_0x31db('0x32')]=_[_0x31db('0x31')](db[_0x31db('0x5f')][_0x31db('0x52')]);_0x5364c3[_0x31db('0x30')]=_[_0x31db('0x31')](_0x148410[_0x31db('0x30')]);_0x5364c3[_0x31db('0x39')]=_[_0x31db('0x45')](_0x5364c3['model'],_0x5364c3[_0x31db('0x30')]);_0x5e12a7[_0x31db('0x33')]=_['intersection'](_0x5364c3[_0x31db('0x32')],qs[_0x31db('0x34')](_0x148410[_0x31db('0x30')][_0x31db('0x34')]));_0x5e12a7[_0x31db('0x33')]=_0x5e12a7[_0x31db('0x33')]['length']?_0x5e12a7[_0x31db('0x33')]:_0x5364c3[_0x31db('0x32')];if(!_0x148410['query'][_0x31db('0x36')](_0x31db('0x5a'))){_0x5e12a7[_0x31db('0x20')]=qs[_0x31db('0x20')](_0x148410['query'][_0x31db('0x20')]);_0x5e12a7['offset']=qs['offset'](_0x148410[_0x31db('0x30')]['offset']);}_0x5e12a7[_0x31db('0x37')]=qs['sort'](_0x148410[_0x31db('0x30')][_0x31db('0x5b')]);_0x5e12a7[_0x31db('0x38')]=qs['filters'](_[_0x31db('0x3a')](_0x148410[_0x31db('0x30')],_0x5364c3[_0x31db('0x39')]));_0x5e12a7[_0x31db('0x38')][_0x31db('0x60')]=_0x2fc070['id'];if(_0x148410[_0x31db('0x30')][_0x31db('0x3b')]){_0x5e12a7[_0x31db('0x38')]=_[_0x31db('0x3c')](_0x5e12a7[_0x31db('0x38')],{'$or':_['map'](_0x5e12a7[_0x31db('0x33')],function(_0x22c5ec){var _0x4262e2={};_0x4262e2[_0x22c5ec]={'$like':'%'+_0x148410[_0x31db('0x30')][_0x31db('0x3b')]+'%'};return _0x4262e2;})});}_0x5e12a7=_[_0x31db('0x3c')]({},_0x5e12a7,_0x148410['options']);return db[_0x31db('0x5f')][_0x31db('0x21')]({'where':_0x5e12a7['where']})[_0x31db('0x27')](function(_0x25fce6){_0x4f05b0[_0x31db('0x21')]=_0x25fce6;if(_0x148410[_0x31db('0x30')]['includeAll']){_0x5e12a7[_0x31db('0x41')]=[{'all':!![]}];}return db[_0x31db('0x5f')]['findAll'](_0x5e12a7);})['then'](function(_0x355654){_0x4f05b0[_0x31db('0x5c')]=_0x355654;return _0x4f05b0;});}})['then'](respondWithFilteredResult(_0x3a6dd2,_0x5e12a7))[_0x31db('0x43')](handleError(_0x3a6dd2,null));};exports[_0x31db('0x61')]=function(_0x45adac,_0x423767,_0xeb01e3){var _0x269328={'raw':!![],'where':{}};var _0x347532={};var _0x180c15={'count':0x0,'rows':[]};return db[_0x31db('0x3f')][_0x31db('0x58')]({'where':{'id':_0x45adac[_0x31db('0x44')]['id']}})['then'](handleEntityNotFound(_0x423767,null))[_0x31db('0x27')](function(_0x481a5c){if(_0x481a5c){_0x347532['model']=_[_0x31db('0x31')](db[_0x31db('0x62')][_0x31db('0x52')]);_0x347532[_0x31db('0x30')]=_[_0x31db('0x31')](_0x45adac['query']);_0x347532[_0x31db('0x39')]=_[_0x31db('0x45')](_0x347532[_0x31db('0x32')],_0x347532[_0x31db('0x30')]);_0x269328['attributes']=_[_0x31db('0x45')](_0x347532[_0x31db('0x32')],qs[_0x31db('0x34')](_0x45adac['query'][_0x31db('0x34')]));_0x269328[_0x31db('0x33')]=_0x269328[_0x31db('0x33')][_0x31db('0x35')]?_0x269328[_0x31db('0x33')]:_0x347532['model'];if(!_0x45adac[_0x31db('0x30')][_0x31db('0x36')](_0x31db('0x5a'))){_0x269328[_0x31db('0x20')]=qs[_0x31db('0x20')](_0x45adac[_0x31db('0x30')][_0x31db('0x20')]);_0x269328[_0x31db('0x22')]=qs[_0x31db('0x22')](_0x45adac[_0x31db('0x30')][_0x31db('0x22')]);}_0x269328['order']=qs[_0x31db('0x5b')](_0x45adac['query'][_0x31db('0x5b')]);_0x269328[_0x31db('0x38')]=qs['filters'](_['pick'](_0x45adac[_0x31db('0x30')],_0x347532[_0x31db('0x39')]));_0x269328[_0x31db('0x38')]['CampaignId']=_0x481a5c['id'];if(_0x45adac[_0x31db('0x30')][_0x31db('0x3b')]){_0x269328[_0x31db('0x38')]=_[_0x31db('0x3c')](_0x269328['where'],{'$or':_[_0x31db('0x2d')](_0x269328[_0x31db('0x33')],function(_0xaf54dc){var _0x114943={};_0x114943[_0xaf54dc]={'$like':'%'+_0x45adac[_0x31db('0x30')]['filter']+'%'};return _0x114943;})});}_0x269328=_[_0x31db('0x3c')]({},_0x269328,_0x45adac[_0x31db('0x3e')]);return db[_0x31db('0x62')][_0x31db('0x21')]({'where':_0x269328['where']})[_0x31db('0x27')](function(_0x1f7b90){_0x180c15[_0x31db('0x21')]=_0x1f7b90;if(_0x45adac[_0x31db('0x30')][_0x31db('0x40')]){_0x269328[_0x31db('0x41')]=[{'all':!![]}];}return db[_0x31db('0x62')][_0x31db('0x42')](_0x269328);})[_0x31db('0x27')](function(_0x3cfe19){_0x180c15[_0x31db('0x5c')]=_0x3cfe19;return _0x180c15;});}})['then'](respondWithFilteredResult(_0x423767,_0x269328))[_0x31db('0x43')](handleError(_0x423767,null));};exports[_0x31db('0x63')]=function(_0xcee621,_0x4430e9,_0x3f15e6){var _0x2bb353={};var _0x4ebd4f={};var _0x1324ee;var _0x5ef744;return db[_0x31db('0x3f')]['findOne']({'where':{'id':_0xcee621[_0x31db('0x44')]['id']}})[_0x31db('0x27')](handleEntityNotFound(_0x4430e9,null))[_0x31db('0x27')](function(_0x1de2d0){if(_0x1de2d0){_0x1324ee=_0x1de2d0;_0x4ebd4f['model']=_[_0x31db('0x31')](db[_0x31db('0x64')][_0x31db('0x52')]);_0x4ebd4f[_0x31db('0x30')]=_[_0x31db('0x31')](_0xcee621[_0x31db('0x30')]);_0x4ebd4f[_0x31db('0x39')]=_[_0x31db('0x45')](_0x4ebd4f[_0x31db('0x32')],_0x4ebd4f[_0x31db('0x30')]);_0x2bb353['attributes']=_[_0x31db('0x45')](_0x4ebd4f[_0x31db('0x32')],qs[_0x31db('0x34')](_0xcee621[_0x31db('0x30')][_0x31db('0x34')]));_0x2bb353[_0x31db('0x33')]=_0x2bb353[_0x31db('0x33')][_0x31db('0x35')]?_0x2bb353[_0x31db('0x33')]:_0x4ebd4f['model'];_0x2bb353[_0x31db('0x37')]=qs[_0x31db('0x5b')](_0xcee621[_0x31db('0x30')][_0x31db('0x5b')]);_0x2bb353[_0x31db('0x38')]=qs[_0x31db('0x39')](_[_0x31db('0x3a')](_0xcee621[_0x31db('0x30')],_0x4ebd4f[_0x31db('0x39')]));if(_0xcee621[_0x31db('0x30')]['filter']){_0x2bb353[_0x31db('0x38')]=_[_0x31db('0x3c')](_0x2bb353['where'],{'$or':_['map'](_0x2bb353[_0x31db('0x33')],function(_0x1043d5){var _0x15cde6={};_0x15cde6[_0x1043d5]={'$like':'%'+_0xcee621[_0x31db('0x30')]['filter']+'%'};return _0x15cde6;})});}_0x2bb353=_['merge']({},_0x2bb353,_0xcee621['options']);return _0x1324ee[_0x31db('0x63')](_0x2bb353);}})[_0x31db('0x27')](function(_0x377ac1){if(_0x377ac1){_0x5ef744=_0x377ac1[_0x31db('0x35')];if(!_0xcee621[_0x31db('0x30')]['hasOwnProperty'](_0x31db('0x5a'))){_0x2bb353[_0x31db('0x20')]=qs[_0x31db('0x20')](_0xcee621[_0x31db('0x30')][_0x31db('0x20')]);_0x2bb353[_0x31db('0x22')]=qs['offset'](_0xcee621[_0x31db('0x30')][_0x31db('0x22')]);}return _0x1324ee[_0x31db('0x63')](_0x2bb353);}})[_0x31db('0x27')](function(_0x160775){if(_0x160775){return _0x160775?{'count':_0x5ef744,'rows':_0x160775}:null;}})[_0x31db('0x27')](respondWithResult(_0x4430e9,null))[_0x31db('0x43')](handleError(_0x4430e9,null));};exports['addLists']=function(_0x21dfa2,_0x55354e,_0x2f7746){var _0x27ab95,_0xd418fe;var _0x1376dd=[];var _0x1fdb48=moment()[_0x31db('0x65')]('YYYY-MM-DD\x20HH:mm:ss');return db[_0x31db('0x3f')]['find']({'where':{'id':_0x21dfa2['params']['id']}})[_0x31db('0x27')](handleEntityNotFound(_0x55354e,null))[_0x31db('0x27')](function(_0x17def){if(_0x17def){_0xd418fe=_0x17def;return _0x17def[_0x31db('0x66')](_0x21dfa2['body'][_0x31db('0x67')],_[_0x31db('0x53')](_0x21dfa2['body'],[_0x31db('0x67'),'id'])||{});}return null;})['spread'](function(_0x186f56){var _0x24dc7f;var _0x30ad4c;_0x27ab95=_0x186f56||[];var _0x3ebfe3=[];if(_0x186f56){for(var _0x41849c=0x0;_0x41849c<_0x186f56[_0x31db('0x35')];_0x41849c+=0x1){var _0x3d90db=_0x186f56[_0x41849c]['get']({'plain':!![]});_0xd418fe[_0x31db('0x68')]=_0x21dfa2[_0x31db('0x48')][_0x31db('0x68')]?_0x21dfa2[_0x31db('0x48')][_0x31db('0x68')]:_0xd418fe[_0x31db('0x68')];switch(_0xd418fe['dialCheckDuplicateType']){case'always':_0x24dc7f=squel[_0x31db('0x69')]()[_0x31db('0x6a')](_0x31db('0x6b'))['fromQuery']([_0x31db('0x6c'),_0x31db('0x6d'),_0x31db('0x6e'),_0x31db('0x6f'),_0x31db('0x60'),'createdAt','updatedAt'],squel[_0x31db('0x70')]()[_0x31db('0x71')](_0x31db('0x6c'),_0x31db('0x6c'))[_0x31db('0x71')]('NOW()',_0x31db('0x6d'))[_0x31db('0x71')]('id',_0x31db('0x6e'))[_0x31db('0x71')](_0x3d90db[_0x31db('0x72')][_0x31db('0x73')](),_0x31db('0x6f'))[_0x31db('0x71')](_0x21dfa2[_0x31db('0x44')]['id'][_0x31db('0x73')](),_0x31db('0x60'))[_0x31db('0x71')]('\x27'+_0x1fdb48+'\x27',_0x31db('0x55'))['field']('\x27'+_0x1fdb48+'\x27',_0x31db('0x54'))['from']('cm_contacts')[_0x31db('0x38')](_0x31db('0x74'))[_0x31db('0x38')]('ListId\x20=\x20?',_0x3d90db[_0x31db('0x72')][_0x31db('0x73')]())[_0x31db('0x38')](_0x31db('0x75'))[_0x31db('0x38')](_0x31db('0x76'),squel[_0x31db('0x70')]()['field']('COALESCE(calleridnum,\x27\x27)')[_0x31db('0x77')](_0x31db('0x78'))[_0x31db('0x38')](_0x31db('0x79'),_0x21dfa2[_0x31db('0x44')]['id'][_0x31db('0x73')]()))[_0x31db('0x38')](_0x31db('0x76'),squel[_0x31db('0x70')]()[_0x31db('0x71')](_0x31db('0x7a'))[_0x31db('0x77')]('cm_hopper')[_0x31db('0x38')](_0x31db('0x79'),_0x21dfa2[_0x31db('0x44')]['id'][_0x31db('0x73')]())))['toString']();break;case'onlyIfOpen':_0x24dc7f=squel[_0x31db('0x69')]()[_0x31db('0x6a')](_0x31db('0x6b'))['fromQuery'](['phone',_0x31db('0x6d'),_0x31db('0x6e'),_0x31db('0x6f'),_0x31db('0x60'),'createdAt',_0x31db('0x54')],squel[_0x31db('0x70')]()[_0x31db('0x71')](_0x31db('0x6c'),_0x31db('0x6c'))[_0x31db('0x71')](_0x31db('0x7b'),'scheduledAt')[_0x31db('0x71')]('id',_0x31db('0x6e'))[_0x31db('0x71')](_0x3d90db[_0x31db('0x72')][_0x31db('0x73')](),_0x31db('0x6f'))['field'](_0x21dfa2[_0x31db('0x44')]['id']['toString'](),_0x31db('0x60'))[_0x31db('0x71')]('\x27'+_0x1fdb48+'\x27','createdAt')[_0x31db('0x71')]('\x27'+_0x1fdb48+'\x27','updatedAt')['from'](_0x31db('0x7c'))[_0x31db('0x38')](_0x31db('0x74'))[_0x31db('0x38')]('ListId\x20=\x20?',_0x3d90db[_0x31db('0x72')]['toString']())[_0x31db('0x38')](_0x31db('0x75'))[_0x31db('0x38')](_0x31db('0x76'),squel[_0x31db('0x70')]()[_0x31db('0x71')](_0x31db('0x7a'))[_0x31db('0x77')]('cm_hopper')['where'](_0x31db('0x79'),_0x21dfa2[_0x31db('0x44')]['id'][_0x31db('0x73')]())))['toString']();break;default:_0x24dc7f=squel['insert']()[_0x31db('0x6a')]('cm_hopper')[_0x31db('0x7d')](['phone',_0x31db('0x6d'),_0x31db('0x6e'),_0x31db('0x6f'),_0x31db('0x60'),_0x31db('0x55'),_0x31db('0x54')],squel[_0x31db('0x70')]()[_0x31db('0x71')]('phone',_0x31db('0x6c'))[_0x31db('0x71')]('NOW()',_0x31db('0x6d'))[_0x31db('0x71')]('id',_0x31db('0x6e'))[_0x31db('0x71')](_0x3d90db['CmListId'][_0x31db('0x73')](),'ListId')['field'](_0x21dfa2[_0x31db('0x44')]['id'][_0x31db('0x73')](),_0x31db('0x60'))[_0x31db('0x71')]('\x27'+_0x1fdb48+'\x27','createdAt')['field']('\x27'+_0x1fdb48+'\x27',_0x31db('0x54'))[_0x31db('0x77')](_0x31db('0x7c'))[_0x31db('0x38')](_0x31db('0x74'))['where'](_0x31db('0x7e'),_0x3d90db[_0x31db('0x72')][_0x31db('0x73')]())[_0x31db('0x38')](_0x31db('0x75')))[_0x31db('0x73')]();}_0x30ad4c=squel['insert']()[_0x31db('0x6a')](_0x31db('0x7f'))[_0x31db('0x7d')](['cmHopperId',_0x31db('0x6d'),_0x31db('0x6c'),'OrderBy','createdAt',_0x31db('0x54')],squel[_0x31db('0x70')]()[_0x31db('0x71')](_0x31db('0x80'),'id')[_0x31db('0x71')]('NOW()','scheduledAt')[_0x31db('0x71')](_0x31db('0x81'),_0x31db('0x6c'))[_0x31db('0x71')]('ci.OrderBY',_0x31db('0x82'))['field']('\x27'+_0x1fdb48+'\x27',_0x31db('0x55'))[_0x31db('0x71')]('\x27'+_0x1fdb48+'\x27',_0x31db('0x54'))[_0x31db('0x77')](_0x31db('0x83'),'ci')[_0x31db('0x84')](_0x31db('0x6b'),'h',_0x31db('0x85'))[_0x31db('0x38')](_0x31db('0x86'),_0x3d90db[_0x31db('0x72')][_0x31db('0x73')]())[_0x31db('0x38')](_0x31db('0x87'),_0x21dfa2[_0x31db('0x44')]['id'][_0x31db('0x73')]())[_0x31db('0x38')](_0x31db('0x88'),_0x1fdb48))[_0x31db('0x73')]();_0x3ebfe3[_0x31db('0x89')](db[_0x31db('0x8a')][_0x31db('0x30')](_0x24dc7f));_0x1376dd[_0x31db('0x89')](db[_0x31db('0x8a')][_0x31db('0x30')](_0x30ad4c));}return BPromise[_0x31db('0x8b')](_0x3ebfe3);}})[_0x31db('0x27')](function(){return BPromise[_0x31db('0x8b')](_0x1376dd);})[_0x31db('0x27')](function(){return _0x27ab95;})[_0x31db('0x27')](respondWithResult(_0x55354e,null))['catch'](handleError(_0x55354e,null));};exports[_0x31db('0x8c')]=function(_0x5965e1,_0x5ba364,_0x1222b8){return db[_0x31db('0x3f')]['find']({'where':{'id':_0x5965e1['params']['id']}})[_0x31db('0x27')](handleEntityNotFound(_0x5ba364,null))[_0x31db('0x27')](function(_0x4e534e){if(_0x4e534e){return _0x4e534e[_0x31db('0x8c')](_0x5965e1['query'][_0x31db('0x67')]);}})[_0x31db('0x27')](function(_0x901a92){if(_0x901a92){return db['CmHopper'][_0x31db('0x56')]({'where':{'ListId':_0x5965e1[_0x31db('0x30')][_0x31db('0x67')],'CampaignId':_0x5965e1[_0x31db('0x44')]['id']}})[_0x31db('0x27')](function(){return _0x901a92;});}})[_0x31db('0x27')](respondWithStatusCode(_0x5ba364,null))['catch'](handleError(_0x5ba364,null));};exports['getBlackLists']=function(_0x289317,_0x1311cb,_0x45f527){var _0x13c2c0={};var _0x3481b1={};var _0x8df891;var _0x1e7170;return db[_0x31db('0x3f')][_0x31db('0x58')]({'where':{'id':_0x289317[_0x31db('0x44')]['id']}})[_0x31db('0x27')](handleEntityNotFound(_0x1311cb,null))[_0x31db('0x27')](function(_0x58a966){if(_0x58a966){_0x8df891=_0x58a966;_0x3481b1[_0x31db('0x32')]=_[_0x31db('0x31')](db['CmList'][_0x31db('0x52')]);_0x3481b1[_0x31db('0x30')]=_[_0x31db('0x31')](_0x289317['query']);_0x3481b1[_0x31db('0x39')]=_[_0x31db('0x45')](_0x3481b1['model'],_0x3481b1[_0x31db('0x30')]);_0x13c2c0[_0x31db('0x33')]=_[_0x31db('0x45')](_0x3481b1['model'],qs[_0x31db('0x34')](_0x289317[_0x31db('0x30')][_0x31db('0x34')]));_0x13c2c0['attributes']=_0x13c2c0[_0x31db('0x33')]['length']?_0x13c2c0[_0x31db('0x33')]:_0x3481b1['model'];_0x13c2c0[_0x31db('0x37')]=qs[_0x31db('0x5b')](_0x289317[_0x31db('0x30')]['sort']);_0x13c2c0['where']=qs[_0x31db('0x39')](_['pick'](_0x289317[_0x31db('0x30')],_0x3481b1[_0x31db('0x39')]));if(_0x289317[_0x31db('0x30')]['filter']){_0x13c2c0[_0x31db('0x38')]=_[_0x31db('0x3c')](_0x13c2c0[_0x31db('0x38')],{'$or':_[_0x31db('0x2d')](_0x13c2c0[_0x31db('0x33')],function(_0x1db46f){var _0x54786f={};_0x54786f[_0x1db46f]={'$like':'%'+_0x289317['query']['filter']+'%'};return _0x54786f;})});}_0x13c2c0=_['merge']({},_0x13c2c0,_0x289317[_0x31db('0x3e')]);return _0x8df891[_0x31db('0x8d')](_0x13c2c0);}})[_0x31db('0x27')](function(_0x1fab25){if(_0x1fab25){_0x1e7170=_0x1fab25[_0x31db('0x35')];if(!_0x289317['query'][_0x31db('0x36')](_0x31db('0x5a'))){_0x13c2c0[_0x31db('0x20')]=qs['limit'](_0x289317['query'][_0x31db('0x20')]);_0x13c2c0[_0x31db('0x22')]=qs[_0x31db('0x22')](_0x289317[_0x31db('0x30')][_0x31db('0x22')]);}return _0x8df891['getBlackLists'](_0x13c2c0);}})[_0x31db('0x27')](function(_0x35e245){if(_0x35e245){return _0x35e245?{'count':_0x1e7170,'rows':_0x35e245}:null;}})[_0x31db('0x27')](respondWithResult(_0x1311cb,null))[_0x31db('0x43')](handleError(_0x1311cb,null));};exports[_0x31db('0x8e')]=function(_0x4962ea,_0x372e0c,_0x4ddd13){var _0x3e3cf2,_0xcf6abf;var _0x3299c3=[];var _0xcd46dd=moment()['format']('YYYY-MM-DD\x20HH:mm:ss');return db[_0x31db('0x3f')][_0x31db('0x46')]({'where':{'id':_0x4962ea[_0x31db('0x44')]['id']}})[_0x31db('0x27')](handleEntityNotFound(_0x372e0c,null))[_0x31db('0x27')](function(_0x771fd7){if(_0x771fd7){_0xcf6abf=_0x771fd7;return _0x771fd7[_0x31db('0x8e')](_0x4962ea[_0x31db('0x48')][_0x31db('0x67')],_[_0x31db('0x53')](_0x4962ea[_0x31db('0x48')],[_0x31db('0x67'),'id'])||{});}return null;})[_0x31db('0x8f')](function(_0x2f19bd){var _0x44f158;var _0x400a14;_0x3e3cf2=_0x2f19bd||[];var _0x317990=[];if(_0x2f19bd){for(var _0x33c0b6=0x0;_0x33c0b6<_0x2f19bd[_0x31db('0x35')];_0x33c0b6+=0x1){var _0x131942=_0x2f19bd[_0x33c0b6][_0x31db('0x49')]({'plain':!![]});_0x44f158=squel[_0x31db('0x69')]()[_0x31db('0x6a')](_0x31db('0x90'))[_0x31db('0x7d')]([_0x31db('0x6c'),_0x31db('0x6e'),_0x31db('0x6f'),_0x31db('0x60'),_0x31db('0x55'),'updatedAt'],squel[_0x31db('0x70')]()[_0x31db('0x71')]('phone',_0x31db('0x6c'))[_0x31db('0x71')]('id',_0x31db('0x6e'))[_0x31db('0x71')](_0x131942['CmListId'][_0x31db('0x73')](),_0x31db('0x6f'))[_0x31db('0x71')](_0x4962ea['params']['id'][_0x31db('0x73')](),_0x31db('0x60'))[_0x31db('0x71')](_0x31db('0x7b'),'createdAt')[_0x31db('0x71')](_0x31db('0x7b'),'updatedAt')['from'](_0x31db('0x7c'))[_0x31db('0x38')](_0x31db('0x74'))[_0x31db('0x38')](_0x31db('0x7e'),_0x131942[_0x31db('0x72')][_0x31db('0x73')]())[_0x31db('0x38')](_0x31db('0x75')))[_0x31db('0x73')]();_0x317990[_0x31db('0x89')](db['sequelize'][_0x31db('0x30')](_0x44f158));}return BPromise[_0x31db('0x8b')](_0x317990);}})[_0x31db('0x27')](function(){return _0x3e3cf2;})[_0x31db('0x27')](respondWithResult(_0x372e0c,null))[_0x31db('0x43')](handleError(_0x372e0c,null));};exports[_0x31db('0x91')]=function(_0x3839be,_0xb2967d,_0x378b96){return db[_0x31db('0x3f')][_0x31db('0x46')]({'where':{'id':_0x3839be[_0x31db('0x44')]['id']}})['then'](handleEntityNotFound(_0xb2967d,null))[_0x31db('0x27')](function(_0x459193){if(_0x459193){return _0x459193['removeBlackLists'](_0x3839be['query'][_0x31db('0x67')]);}})[_0x31db('0x27')](function(_0x26c21d){if(_0x26c21d){return db[_0x31db('0x62')][_0x31db('0x56')]({'where':{'ListId':_0x3839be[_0x31db('0x30')][_0x31db('0x67')],'CampaignId':_0x3839be[_0x31db('0x44')]['id']}})[_0x31db('0x27')](function(){return _0x26c21d;});}})[_0x31db('0x27')](respondWithStatusCode(_0xb2967d,null))['catch'](handleError(_0xb2967d,null));};
\ No newline at end of file
diff --git a/server/api/campaign/campaign.model.js b/server/api/campaign/campaign.model.js
index 82842d3..822fd9a 100644
--- a/server/api/campaign/campaign.model.js
+++ b/server/api/campaign/campaign.model.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x7a54=['../../config/logger','moment','bluebird','path','rimraf','../../config/environment','./campaign.attributes','exports','Campaign','campaigns','lodash','util'];(function(_0x178b4e,_0x3810c2){var _0x176a81=function(_0x490fc4){while(--_0x490fc4){_0x178b4e['push'](_0x178b4e['shift']());}};_0x176a81(++_0x3810c2);}(_0x7a54,0x106));var _0x47a5=function(_0x40bc2d,_0x54a2c8){_0x40bc2d=_0x40bc2d-0x0;var _0x114b87=_0x7a54[_0x40bc2d];return _0x114b87;};'use strict';var _=require(_0x47a5('0x0'));var util=require(_0x47a5('0x1'));var logger=require(_0x47a5('0x2'))('api');var moment=require(_0x47a5('0x3'));var BPromise=require(_0x47a5('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x47a5('0x5'));var rimraf=require(_0x47a5('0x6'));var config=require(_0x47a5('0x7'));var attributes=require(_0x47a5('0x8'));module[_0x47a5('0x9')]=function(_0x545a97,_0x3d5629){return _0x545a97['define'](_0x47a5('0xa'),attributes,{'tableName':_0x47a5('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x9957=['exports','define','Campaign','lodash','util','../../config/logger','api','bluebird','request-promise','path','rimraf','./campaign.attributes'];(function(_0x172747,_0x1732bd){var _0x509692=function(_0x448c56){while(--_0x448c56){_0x172747['push'](_0x172747['shift']());}};_0x509692(++_0x1732bd);}(_0x9957,0x93));var _0x7995=function(_0x1ac595,_0x5d2081){_0x1ac595=_0x1ac595-0x0;var _0x455fff=_0x9957[_0x1ac595];return _0x455fff;};'use strict';var _=require(_0x7995('0x0'));var util=require(_0x7995('0x1'));var logger=require(_0x7995('0x2'))(_0x7995('0x3'));var moment=require('moment');var BPromise=require(_0x7995('0x4'));var rp=require(_0x7995('0x5'));var fs=require('fs');var path=require(_0x7995('0x6'));var rimraf=require(_0x7995('0x7'));var config=require('../../config/environment');var attributes=require(_0x7995('0x8'));module[_0x7995('0x9')]=function(_0x137b6b,_0x219534){return _0x137b6b[_0x7995('0xa')](_0x7995('0xb'),attributes,{'tableName':'campaigns','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 5f635b1..dc1ce27 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 _0x6c96=['GetCampaign','lodash','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then','Campaign,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','Campaign,\x20%s,\x20%s','message','result','catch','Campaign','findAll','options','raw','attributes','map','include','model','info'];(function(_0x5e5c2c,_0x4c6068){var _0x318346=function(_0x3ff218){while(--_0x3ff218){_0x5e5c2c['push'](_0x5e5c2c['shift']());}};_0x318346(++_0x4c6068);}(_0x6c96,0x1c1));var _0x66c9=function(_0x1d2e06,_0x2927f8){_0x1d2e06=_0x1d2e06-0x0;var _0x2ef575=_0x6c96[_0x1d2e06];return _0x2ef575;};'use strict';var _=require(_0x66c9('0x0'));var util=require('util');var moment=require(_0x66c9('0x1'));var BPromise=require(_0x66c9('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x66c9('0x3'));var db=require(_0x66c9('0x4'))['db'];var utils=require(_0x66c9('0x5'));var logger=require(_0x66c9('0x6'))(_0x66c9('0x7'));var config=require(_0x66c9('0x8'));var jayson=require(_0x66c9('0x9'));var client=jayson['client'][_0x66c9('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x4c6baa,_0xb03819,_0x4d7692){return new BPromise(function(_0x55b488,_0xfc41a4){return client[_0x66c9('0xb')](_0x4c6baa,_0x4d7692)[_0x66c9('0xc')](function(_0x2e8ad5){logger['info']('Campaign,\x20%s,\x20%s',_0xb03819,'request\x20sent');logger['debug'](_0x66c9('0xd'),_0xb03819,_0x66c9('0xe'),JSON[_0x66c9('0xf')](_0x2e8ad5));if(_0x2e8ad5['error']){if(_0x2e8ad5[_0x66c9('0x10')][_0x66c9('0x11')]===0x1f4){logger[_0x66c9('0x10')](_0x66c9('0x12'),_0xb03819,_0x2e8ad5['error'][_0x66c9('0x13')]);return _0xfc41a4(_0x2e8ad5['error'][_0x66c9('0x13')]);}logger[_0x66c9('0x10')](_0x66c9('0x12'),_0xb03819,_0x2e8ad5[_0x66c9('0x10')]['message']);return _0x55b488(_0x2e8ad5[_0x66c9('0x10')][_0x66c9('0x13')]);}else{logger['info'](_0x66c9('0x12'),_0xb03819,_0x66c9('0xe'));_0x55b488(_0x2e8ad5[_0x66c9('0x14')][_0x66c9('0x13')]);}})[_0x66c9('0x15')](function(_0x14d989){logger[_0x66c9('0x10')](_0x66c9('0x12'),_0xb03819,_0x14d989);_0xfc41a4(_0x14d989);});});}exports['GetCampaign']=function(_0x11242a){var _0x578245=this;return new Promise(function(_0x4b4a50,_0x30c5fa){return db[_0x66c9('0x16')][_0x66c9('0x17')]({'raw':_0x11242a[_0x66c9('0x18')]?_0x11242a[_0x66c9('0x18')][_0x66c9('0x19')]===undefined?!![]:![]:!![],'where':_0x11242a[_0x66c9('0x18')]?_0x11242a['options']['where']||null:null,'attributes':_0x11242a[_0x66c9('0x18')]?_0x11242a[_0x66c9('0x18')][_0x66c9('0x1a')]||null:null,'limit':_0x11242a[_0x66c9('0x18')]?_0x11242a[_0x66c9('0x18')]['limit']||null:null,'include':_0x11242a[_0x66c9('0x18')]?_0x11242a[_0x66c9('0x18')]['include']?_[_0x66c9('0x1b')](_0x11242a[_0x66c9('0x18')][_0x66c9('0x1c')],function(_0x3f3be1){return{'model':db[_0x3f3be1[_0x66c9('0x1d')]],'as':_0x3f3be1['as'],'attributes':_0x3f3be1[_0x66c9('0x1a')],'include':_0x3f3be1[_0x66c9('0x1c')]?_['map'](_0x3f3be1[_0x66c9('0x1c')],function(_0x5bb599){return{'model':db[_0x5bb599['model']],'as':_0x5bb599['as'],'attributes':_0x5bb599[_0x66c9('0x1a')],'include':_0x5bb599['include']?_[_0x66c9('0x1b')](_0x5bb599['include'],function(_0x95ce9f){return{'model':db[_0x95ce9f['model']],'as':_0x95ce9f['as'],'attributes':_0x95ce9f[_0x66c9('0x1a')]};}):[]};}):[]};}):[]:[]})[_0x66c9('0xc')](function(_0x1f9d01){logger[_0x66c9('0x1e')](_0x66c9('0x1f'),_0x11242a);logger['debug'](_0x66c9('0x1f'),_0x11242a,JSON[_0x66c9('0xf')](_0x1f9d01));_0x4b4a50(_0x1f9d01);})[_0x66c9('0x15')](function(_0x1279e5){logger['error'](_0x66c9('0x1f'),_0x1279e5['message'],_0x11242a);_0x30c5fa(_0x578245[_0x66c9('0x10')](0x1f4,_0x1279e5[_0x66c9('0x13')]));});});};
\ No newline at end of file
+var _0xe920=['../../config/logger','rpc','jayson/promise','http','request','then','info','Campaign,\x20%s,\x20%s,\x20%s','request\x20sent','code','error','message','Campaign,\x20%s,\x20%s','result','GetCampaign','Campaign','options','raw','attributes','limit','include','model','map','debug','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils'];(function(_0x585d09,_0x1274bc){var _0x7d9a14=function(_0x343d4e){while(--_0x343d4e){_0x585d09['push'](_0x585d09['shift']());}};_0x7d9a14(++_0x1274bc);}(_0xe920,0xbe));var _0x0e92=function(_0x2db12b,_0x30ab1d){_0x2db12b=_0x2db12b-0x0;var _0x20990b=_0xe920[_0x2db12b];return _0x20990b;};'use strict';var _=require(_0x0e92('0x0'));var util=require(_0x0e92('0x1'));var moment=require(_0x0e92('0x2'));var BPromise=require(_0x0e92('0x3'));var rs=require(_0x0e92('0x4'));var fs=require('fs');var Redis=require(_0x0e92('0x5'));var db=require(_0x0e92('0x6'))['db'];var utils=require(_0x0e92('0x7'));var logger=require(_0x0e92('0x8'))(_0x0e92('0x9'));var config=require('../../config/environment');var jayson=require(_0x0e92('0xa'));var client=jayson['client'][_0x0e92('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x33a315,_0x2d921f,_0x176c3b){return new BPromise(function(_0x5662dc,_0x3dbc96){return client[_0x0e92('0xc')](_0x33a315,_0x176c3b)[_0x0e92('0xd')](function(_0x129376){logger[_0x0e92('0xe')]('Campaign,\x20%s,\x20%s',_0x2d921f,'request\x20sent');logger['debug'](_0x0e92('0xf'),_0x2d921f,_0x0e92('0x10'),JSON['stringify'](_0x129376));if(_0x129376['error']){if(_0x129376['error'][_0x0e92('0x11')]===0x1f4){logger[_0x0e92('0x12')]('Campaign,\x20%s,\x20%s',_0x2d921f,_0x129376[_0x0e92('0x12')][_0x0e92('0x13')]);return _0x3dbc96(_0x129376['error'][_0x0e92('0x13')]);}logger[_0x0e92('0x12')](_0x0e92('0x14'),_0x2d921f,_0x129376[_0x0e92('0x12')][_0x0e92('0x13')]);return _0x5662dc(_0x129376[_0x0e92('0x12')][_0x0e92('0x13')]);}else{logger['info']('Campaign,\x20%s,\x20%s',_0x2d921f,_0x0e92('0x10'));_0x5662dc(_0x129376[_0x0e92('0x15')]['message']);}})['catch'](function(_0x424c3a){logger['error'](_0x0e92('0x14'),_0x2d921f,_0x424c3a);_0x3dbc96(_0x424c3a);});});}exports[_0x0e92('0x16')]=function(_0x3316a5){var _0x46aa84=this;return new Promise(function(_0x153002,_0x8f7626){return db[_0x0e92('0x17')]['findAll']({'raw':_0x3316a5[_0x0e92('0x18')]?_0x3316a5['options'][_0x0e92('0x19')]===undefined?!![]:![]:!![],'where':_0x3316a5['options']?_0x3316a5['options']['where']||null:null,'attributes':_0x3316a5[_0x0e92('0x18')]?_0x3316a5['options'][_0x0e92('0x1a')]||null:null,'limit':_0x3316a5['options']?_0x3316a5[_0x0e92('0x18')][_0x0e92('0x1b')]||null:null,'include':_0x3316a5['options']?_0x3316a5[_0x0e92('0x18')][_0x0e92('0x1c')]?_['map'](_0x3316a5[_0x0e92('0x18')]['include'],function(_0x43c54c){return{'model':db[_0x43c54c[_0x0e92('0x1d')]],'as':_0x43c54c['as'],'attributes':_0x43c54c[_0x0e92('0x1a')],'include':_0x43c54c[_0x0e92('0x1c')]?_[_0x0e92('0x1e')](_0x43c54c[_0x0e92('0x1c')],function(_0xc34ae4){return{'model':db[_0xc34ae4[_0x0e92('0x1d')]],'as':_0xc34ae4['as'],'attributes':_0xc34ae4[_0x0e92('0x1a')],'include':_0xc34ae4[_0x0e92('0x1c')]?_['map'](_0xc34ae4[_0x0e92('0x1c')],function(_0x47f156){return{'model':db[_0x47f156['model']],'as':_0x47f156['as'],'attributes':_0x47f156[_0x0e92('0x1a')]};}):[]};}):[]};}):[]:[]})[_0x0e92('0xd')](function(_0x5c5cef){logger['info'](_0x0e92('0x16'),_0x3316a5);logger[_0x0e92('0x1f')]('GetCampaign',_0x3316a5,JSON['stringify'](_0x5c5cef));_0x153002(_0x5c5cef);})[_0x0e92('0x20')](function(_0x329c5f){logger[_0x0e92('0x12')](_0x0e92('0x16'),_0x329c5f[_0x0e92('0x13')],_0x3316a5);_0x8f7626(_0x46aa84[_0x0e92('0x12')](0x1f4,_0x329c5f[_0x0e92('0x13')]));});});};
\ No newline at end of file
diff --git a/server/api/campaign/index.js b/server/api/campaign/index.js
index e30b4e5..e947da8 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 _0x1294=['put','update','destroy','delete','multer','path','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./campaign.controller','get','isAuthenticated','index','/:id','show','getHoppers','getHopperHistories','getHopperBlacks','/:id/lists','getLists','/:id/blacklists','getBlackLists','post','create','/:id/clone','clone','addLists','addBlackLists'];(function(_0x12833b,_0x26c1d2){var _0x3acad3=function(_0x2f9ec9){while(--_0x2f9ec9){_0x12833b['push'](_0x12833b['shift']());}};_0x3acad3(++_0x26c1d2);}(_0x1294,0xb8));var _0x4129=function(_0x21f8a8,_0x1d7071){_0x21f8a8=_0x21f8a8-0x0;var _0x21d3d5=_0x1294[_0x21f8a8];return _0x21d3d5;};'use strict';var multer=require(_0x4129('0x0'));var util=require('util');var path=require(_0x4129('0x1'));var timeout=require('connect-timeout');var express=require(_0x4129('0x2'));var router=express[_0x4129('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x4129('0x4'));var interaction=require(_0x4129('0x5'));var config=require(_0x4129('0x6'));var controller=require(_0x4129('0x7'));router[_0x4129('0x8')]('/',auth[_0x4129('0x9')](),controller[_0x4129('0xa')]);router[_0x4129('0x8')](_0x4129('0xb'),auth[_0x4129('0x9')](),controller[_0x4129('0xc')]);router[_0x4129('0x8')]('/:id/hoppers',auth[_0x4129('0x9')](),controller[_0x4129('0xd')]);router[_0x4129('0x8')]('/:id/hopper_histories',auth['isAuthenticated'](),controller[_0x4129('0xe')]);router[_0x4129('0x8')]('/:id/hopper_finals',auth['isAuthenticated'](),controller['getHopperFinals']);router['get']('/:id/hopper_black',auth['isAuthenticated'](),controller[_0x4129('0xf')]);router['get'](_0x4129('0x10'),auth[_0x4129('0x9')](),controller[_0x4129('0x11')]);router[_0x4129('0x8')](_0x4129('0x12'),auth[_0x4129('0x9')](),controller[_0x4129('0x13')]);router[_0x4129('0x14')]('/',auth[_0x4129('0x9')](),controller[_0x4129('0x15')]);router['post'](_0x4129('0x16'),auth['isAuthenticated'](),controller[_0x4129('0x17')]);router[_0x4129('0x14')](_0x4129('0x10'),auth[_0x4129('0x9')](),controller[_0x4129('0x18')]);router[_0x4129('0x14')](_0x4129('0x12'),auth['isAuthenticated'](),controller[_0x4129('0x19')]);router[_0x4129('0x1a')](_0x4129('0xb'),auth[_0x4129('0x9')](),controller[_0x4129('0x1b')]);router['delete'](_0x4129('0xb'),auth[_0x4129('0x9')](),controller[_0x4129('0x1c')]);router[_0x4129('0x1d')](_0x4129('0x10'),auth[_0x4129('0x9')](),controller['removeLists']);router[_0x4129('0x1d')](_0x4129('0x12'),auth[_0x4129('0x9')](),controller['removeBlackLists']);module['exports']=router;
\ No newline at end of file
+var _0x5fc7=['/:id','isAuthenticated','show','/:id/hoppers','getHoppers','getHopperHistories','/:id/hopper_finals','getHopperFinals','/:id/hopper_black','getHopperBlacks','/:id/lists','/:id/blacklists','getBlackLists','post','create','/:id/clone','clone','addLists','addBlackLists','put','update','destroy','delete','removeBlackLists','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./campaign.controller','get','index'];(function(_0x3c7e74,_0x431a67){var _0x5e7924=function(_0x39e11f){while(--_0x39e11f){_0x3c7e74['push'](_0x3c7e74['shift']());}};_0x5e7924(++_0x431a67);}(_0x5fc7,0x1e1));var _0x75fc=function(_0x22b8a3,_0x2a79a7){_0x22b8a3=_0x22b8a3-0x0;var _0x199a0c=_0x5fc7[_0x22b8a3];return _0x199a0c;};'use strict';var multer=require(_0x75fc('0x0'));var util=require(_0x75fc('0x1'));var path=require(_0x75fc('0x2'));var timeout=require(_0x75fc('0x3'));var express=require(_0x75fc('0x4'));var router=express[_0x75fc('0x5')]();var fs_extra=require(_0x75fc('0x6'));var auth=require(_0x75fc('0x7'));var interaction=require(_0x75fc('0x8'));var config=require(_0x75fc('0x9'));var controller=require(_0x75fc('0xa'));router[_0x75fc('0xb')]('/',auth['isAuthenticated'](),controller[_0x75fc('0xc')]);router[_0x75fc('0xb')](_0x75fc('0xd'),auth[_0x75fc('0xe')](),controller[_0x75fc('0xf')]);router[_0x75fc('0xb')](_0x75fc('0x10'),auth[_0x75fc('0xe')](),controller[_0x75fc('0x11')]);router[_0x75fc('0xb')]('/:id/hopper_histories',auth[_0x75fc('0xe')](),controller[_0x75fc('0x12')]);router[_0x75fc('0xb')](_0x75fc('0x13'),auth['isAuthenticated'](),controller[_0x75fc('0x14')]);router[_0x75fc('0xb')](_0x75fc('0x15'),auth[_0x75fc('0xe')](),controller[_0x75fc('0x16')]);router[_0x75fc('0xb')](_0x75fc('0x17'),auth['isAuthenticated'](),controller['getLists']);router['get'](_0x75fc('0x18'),auth[_0x75fc('0xe')](),controller[_0x75fc('0x19')]);router[_0x75fc('0x1a')]('/',auth[_0x75fc('0xe')](),controller[_0x75fc('0x1b')]);router[_0x75fc('0x1a')](_0x75fc('0x1c'),auth['isAuthenticated'](),controller[_0x75fc('0x1d')]);router[_0x75fc('0x1a')]('/:id/lists',auth[_0x75fc('0xe')](),controller[_0x75fc('0x1e')]);router['post']('/:id/blacklists',auth[_0x75fc('0xe')](),controller[_0x75fc('0x1f')]);router[_0x75fc('0x20')](_0x75fc('0xd'),auth[_0x75fc('0xe')](),controller[_0x75fc('0x21')]);router['delete'](_0x75fc('0xd'),auth['isAuthenticated'](),controller[_0x75fc('0x22')]);router[_0x75fc('0x23')](_0x75fc('0x17'),auth[_0x75fc('0xe')](),controller['removeLists']);router[_0x75fc('0x23')](_0x75fc('0x18'),auth['isAuthenticated'](),controller[_0x75fc('0x24')]);module[_0x75fc('0x25')]=router;
\ No newline at end of file
diff --git a/server/api/cannedAnswer/cannedAnswer.attributes.js b/server/api/cannedAnswer/cannedAnswer.attributes.js
index 734eff4..470b260 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 _0x9a14=['key','sequelize','exports','STRING','TEXT','getDataValue'];(function(_0x2c3737,_0x20b109){var _0x103a77=function(_0x519d7f){while(--_0x519d7f){_0x2c3737['push'](_0x2c3737['shift']());}};_0x103a77(++_0x20b109);}(_0x9a14,0x1b7));var _0x49a1=function(_0x2a6710,_0x4949c0){_0x2a6710=_0x2a6710-0x0;var _0x88f714=_0x9a14[_0x2a6710];return _0x88f714;};'use strict';var Sequelize=require(_0x49a1('0x0'));module[_0x49a1('0x1')]={'key':{'type':Sequelize[_0x49a1('0x2')],'allowNull':![]},'value':{'type':Sequelize[_0x49a1('0x3')],'allowNull':![]},'description':{'type':Sequelize[_0x49a1('0x2')]},'name':{'type':Sequelize['VIRTUAL'],'get':function(){return this[_0x49a1('0x4')](_0x49a1('0x5'));}}};
\ No newline at end of file
+var _0xd43a=['STRING','VIRTUAL','getDataValue','sequelize','exports','TEXT'];(function(_0x501510,_0x61caa9){var _0x1e6ee5=function(_0x32845b){while(--_0x32845b){_0x501510['push'](_0x501510['shift']());}};_0x1e6ee5(++_0x61caa9);}(_0xd43a,0x17d));var _0xad43=function(_0x3291c3,_0x21a8b4){_0x3291c3=_0x3291c3-0x0;var _0xe2af8b=_0xd43a[_0x3291c3];return _0xe2af8b;};'use strict';var Sequelize=require(_0xad43('0x0'));module[_0xad43('0x1')]={'key':{'type':Sequelize['STRING'],'allowNull':![]},'value':{'type':Sequelize[_0xad43('0x2')],'allowNull':![]},'description':{'type':Sequelize[_0xad43('0x3')]},'name':{'type':Sequelize[_0xad43('0x4')],'get':function(){return this[_0xad43('0x5')]('key');}}};
\ No newline at end of file
diff --git a/server/api/cannedAnswer/cannedAnswer.controller.js b/server/api/cannedAnswer/cannedAnswer.controller.js
index f228829..3f2f561 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 _0x8cb7=['querystring','papaparse','ioredis','../../components/parsers/qs','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','status','json','offset','undefined','limit','count','Content-Range','apply','reject','save','update','then','destroy','get','CannedAnswers','UserProfileResource','error','stack','name','send','index','CannedAnswer','rawAttributes','fieldName','type','key','model','map','query','keys','intersection','attributes','fields','length','nolimit','order','sort','filters','filter','where','merge','options','includeAll','include','findAll','rows','catch','params','find','body','create','MailAccountId','SmsAccountId','OpenchannelAccountId','ChatWebsiteId','Sequelize','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','eml-format','zip-dir','fast-json-patch','moment','bluebird','util','path','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js'];(function(_0x43a929,_0x4b70a6){var _0x394281=function(_0x1830b7){while(--_0x1830b7){_0x43a929['push'](_0x43a929['shift']());}};_0x394281(++_0x4b70a6);}(_0x8cb7,0x1a9));var _0x78cb=function(_0x4709c0,_0x3396c7){_0x4709c0=_0x4709c0-0x0;var _0x13348b=_0x8cb7[_0x4709c0];return _0x13348b;};'use strict';var emlformat=require(_0x78cb('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x78cb('0x1'));var jsonpatch=require(_0x78cb('0x2'));var rp=require('request-promise');var moment=require(_0x78cb('0x3'));var BPromise=require(_0x78cb('0x4'));var Mustache=require('mustache');var util=require(_0x78cb('0x5'));var path=require(_0x78cb('0x6'));var sox=require('sox');var csv=require(_0x78cb('0x7'));var ejs=require(_0x78cb('0x8'));var fs=require('fs');var fs_extra=require(_0x78cb('0x9'));var _=require(_0x78cb('0xa'));var squel=require(_0x78cb('0xb'));var crypto=require(_0x78cb('0xc'));var jsforce=require(_0x78cb('0xd'));var deskjs=require(_0x78cb('0xe'));var toCsv=require(_0x78cb('0x7'));var querystring=require(_0x78cb('0xf'));var Papa=require(_0x78cb('0x10'));var Redis=require(_0x78cb('0x11'));var authService=require('../../components/auth/service');var qs=require(_0x78cb('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x78cb('0x13'));var logger=require(_0x78cb('0x14'))('api');var utils=require(_0x78cb('0x15'));var config=require(_0x78cb('0x16'));var licenseUtil=require(_0x78cb('0x17'));var db=require(_0x78cb('0x18'))['db'];function respondWithStatusCode(_0x140606,_0x1e9430){_0x1e9430=_0x1e9430||0xcc;return function(_0xcc074){if(_0xcc074){return _0x140606[_0x78cb('0x19')](_0x1e9430);}return _0x140606['status'](_0x1e9430)[_0x78cb('0x1a')]();};}function respondWithResult(_0x19a368,_0x16c1e9){_0x16c1e9=_0x16c1e9||0xc8;return function(_0x33b4a3){if(_0x33b4a3){return _0x19a368[_0x78cb('0x1b')](_0x16c1e9)[_0x78cb('0x1c')](_0x33b4a3);}};}function respondWithFilteredResult(_0x10cfc9,_0x70b58b){return function(_0x194c16){if(_0x194c16){var _0x263b96=typeof _0x70b58b[_0x78cb('0x1d')]===_0x78cb('0x1e')&&typeof _0x70b58b[_0x78cb('0x1f')]===_0x78cb('0x1e');var _0x17ceb4=_0x194c16['count'];var _0xc3804b=_0x263b96?0x0:_0x70b58b[_0x78cb('0x1d')];var _0x334951=_0x263b96?_0x194c16[_0x78cb('0x20')]:_0x70b58b['offset']+_0x70b58b['limit'];var _0x19166e;if(_0x334951>=_0x17ceb4){_0x334951=_0x17ceb4;_0x19166e=0xc8;}else{_0x19166e=0xce;}_0x10cfc9[_0x78cb('0x1b')](_0x19166e);return _0x10cfc9['set'](_0x78cb('0x21'),_0xc3804b+'-'+_0x334951+'/'+_0x17ceb4)[_0x78cb('0x1c')](_0x194c16);}return null;};}function patchUpdates(_0x447df4){return function(_0x3b4ea9){try{jsonpatch[_0x78cb('0x22')](_0x3b4ea9,_0x447df4,!![]);}catch(_0x50e8c0){return BPromise[_0x78cb('0x23')](_0x50e8c0);}return _0x3b4ea9[_0x78cb('0x24')]();};}function saveUpdates(_0x492fb0,_0xd81628){return function(_0x13e3f0){if(_0x13e3f0){return _0x13e3f0[_0x78cb('0x25')](_0x492fb0)[_0x78cb('0x26')](function(_0x18bb72){return _0x18bb72;});}return null;};}function removeEntity(_0x10205c,_0x515b41){return function(_0x32d78b){if(_0x32d78b){return _0x32d78b[_0x78cb('0x27')]()[_0x78cb('0x26')](function(){var _0x34dbbb=_0x32d78b[_0x78cb('0x28')]({'plain':!![]});var _0x385b4a=_0x78cb('0x29');return db[_0x78cb('0x2a')][_0x78cb('0x27')]({'where':{'type':_0x385b4a,'resourceId':_0x34dbbb['id']}})[_0x78cb('0x26')](function(){return _0x32d78b;});})['then'](function(){_0x10205c['status'](0xcc)[_0x78cb('0x1a')]();});}};}function handleEntityNotFound(_0x506231,_0x3b9f5c){return function(_0x4d8324){if(!_0x4d8324){_0x506231['sendStatus'](0x194);}return _0x4d8324;};}function handleError(_0x5d84ca,_0x57c060){_0x57c060=_0x57c060||0x1f4;return function(_0x4d71de){logger[_0x78cb('0x2b')](_0x4d71de[_0x78cb('0x2c')]);if(_0x4d71de[_0x78cb('0x2d')]){delete _0x4d71de[_0x78cb('0x2d')];}_0x5d84ca[_0x78cb('0x1b')](_0x57c060)[_0x78cb('0x2e')](_0x4d71de);};}exports[_0x78cb('0x2f')]=function(_0x2b3c58,_0xd9864b){var _0xd4d970={},_0xc1186b={},_0x1287e7={'count':0x0,'rows':[]};var _0x146db7=_['map'](db[_0x78cb('0x30')][_0x78cb('0x31')],function(_0x3ead4b){return{'name':_0x3ead4b[_0x78cb('0x32')],'type':_0x3ead4b[_0x78cb('0x33')][_0x78cb('0x34')]};});_0xc1186b[_0x78cb('0x35')]=_[_0x78cb('0x36')](_0x146db7,_0x78cb('0x2d'));_0xc1186b[_0x78cb('0x37')]=_[_0x78cb('0x38')](_0x2b3c58[_0x78cb('0x37')]);_0xc1186b['filters']=_[_0x78cb('0x39')](_0xc1186b[_0x78cb('0x35')],_0xc1186b['query']);_0xd4d970[_0x78cb('0x3a')]=_[_0x78cb('0x39')](_0xc1186b['model'],qs[_0x78cb('0x3b')](_0x2b3c58[_0x78cb('0x37')][_0x78cb('0x3b')]));_0xd4d970[_0x78cb('0x3a')]=_0xd4d970['attributes'][_0x78cb('0x3c')]?_0xd4d970[_0x78cb('0x3a')]:_0xc1186b[_0x78cb('0x35')];if(!_0x2b3c58[_0x78cb('0x37')]['hasOwnProperty'](_0x78cb('0x3d'))){_0xd4d970[_0x78cb('0x1f')]=qs[_0x78cb('0x1f')](_0x2b3c58[_0x78cb('0x37')]['limit']);_0xd4d970[_0x78cb('0x1d')]=qs[_0x78cb('0x1d')](_0x2b3c58[_0x78cb('0x37')]['offset']);}_0xd4d970[_0x78cb('0x3e')]=qs['sort'](_0x2b3c58[_0x78cb('0x37')][_0x78cb('0x3f')]);_0xd4d970['where']=qs[_0x78cb('0x40')](_['pick'](_0x2b3c58['query'],_0xc1186b[_0x78cb('0x40')]),_0x146db7);if(_0x2b3c58[_0x78cb('0x37')][_0x78cb('0x41')]){_0xd4d970[_0x78cb('0x42')]=_['merge'](_0xd4d970[_0x78cb('0x42')],{'$or':[{'key':{'$like':'%'+_0x2b3c58[_0x78cb('0x37')][_0x78cb('0x41')]+'%'}},{'value':{'$like':'%'+_0x2b3c58[_0x78cb('0x37')][_0x78cb('0x41')]+'%'}}]});}_0xd4d970=_[_0x78cb('0x43')]({},_0xd4d970,_0x2b3c58[_0x78cb('0x44')]);var _0x46fc6c={'where':_0xd4d970[_0x78cb('0x42')]};return db[_0x78cb('0x30')]['count'](_0x46fc6c)[_0x78cb('0x26')](function(_0x51dac0){_0x1287e7['count']=_0x51dac0;if(_0x2b3c58['query'][_0x78cb('0x45')]){_0xd4d970[_0x78cb('0x46')]=[{'all':!![]}];}return db[_0x78cb('0x30')][_0x78cb('0x47')](_0xd4d970);})['then'](function(_0x55a81b){_0x1287e7[_0x78cb('0x48')]=_0x55a81b;return _0x1287e7;})[_0x78cb('0x26')](respondWithFilteredResult(_0xd9864b,_0xd4d970))[_0x78cb('0x49')](handleError(_0xd9864b,null));};exports['show']=function(_0x21ed79,_0x972706){var _0x331d61={'raw':!![],'where':{'id':_0x21ed79[_0x78cb('0x4a')]['id']}},_0x599bdb={};_0x599bdb[_0x78cb('0x35')]=_['keys'](db[_0x78cb('0x30')]['rawAttributes']);_0x599bdb[_0x78cb('0x37')]=_[_0x78cb('0x38')](_0x21ed79[_0x78cb('0x37')]);_0x599bdb['filters']=_[_0x78cb('0x39')](_0x599bdb['model'],_0x599bdb[_0x78cb('0x37')]);_0x331d61[_0x78cb('0x3a')]=_[_0x78cb('0x39')](_0x599bdb[_0x78cb('0x35')],qs[_0x78cb('0x3b')](_0x21ed79[_0x78cb('0x37')][_0x78cb('0x3b')]));_0x331d61['attributes']=_0x331d61['attributes'][_0x78cb('0x3c')]?_0x331d61[_0x78cb('0x3a')]:_0x599bdb['model'];if(_0x21ed79['query'][_0x78cb('0x45')]){_0x331d61['include']=[{'all':!![]}];}_0x331d61=_[_0x78cb('0x43')]({},_0x331d61,_0x21ed79['options']);return db[_0x78cb('0x30')][_0x78cb('0x4b')](_0x331d61)['then'](handleEntityNotFound(_0x972706,null))[_0x78cb('0x26')](respondWithResult(_0x972706,null))[_0x78cb('0x49')](handleError(_0x972706,null));};exports[_0x78cb('0x25')]=function(_0x3ca5a5,_0x8c3700){if(_0x3ca5a5[_0x78cb('0x4c')]['id']){delete _0x3ca5a5[_0x78cb('0x4c')]['id'];}return db[_0x78cb('0x30')][_0x78cb('0x4b')]({'where':{'id':_0x3ca5a5['params']['id']}})['then'](handleEntityNotFound(_0x8c3700,null))[_0x78cb('0x26')](saveUpdates(_0x3ca5a5[_0x78cb('0x4c')],null))[_0x78cb('0x26')](respondWithResult(_0x8c3700,null))[_0x78cb('0x49')](handleError(_0x8c3700,null));};exports[_0x78cb('0x27')]=function(_0xfeceee,_0x252b0e){return db['CannedAnswer'][_0x78cb('0x4b')]({'where':{'id':_0xfeceee[_0x78cb('0x4a')]['id']}})['then'](handleEntityNotFound(_0x252b0e,null))[_0x78cb('0x26')](removeEntity(_0x252b0e,null))['catch'](handleError(_0x252b0e,null));};exports[_0x78cb('0x4d')]=function(_0x14f478,_0x118082){var _0x188041={'key':_0x14f478[_0x78cb('0x4c')]['key']};if(_0x14f478['body'][_0x78cb('0x4e')]){_0x188041['MailAccountId']=_0x14f478['body']['MailAccountId'];}else if(_0x14f478[_0x78cb('0x4c')][_0x78cb('0x4f')]){_0x188041[_0x78cb('0x4f')]=_0x14f478['body'][_0x78cb('0x4f')];}else if(_0x14f478[_0x78cb('0x4c')][_0x78cb('0x50')]){_0x188041[_0x78cb('0x50')]=_0x14f478[_0x78cb('0x4c')][_0x78cb('0x50')];}else if(_0x14f478[_0x78cb('0x4c')][_0x78cb('0x51')]){_0x188041[_0x78cb('0x51')]=_0x14f478['body'][_0x78cb('0x51')];}return db['CannedAnswer']['find']({'where':_0x188041})[_0x78cb('0x26')](function(_0x1539d4){if(_0x1539d4){throw new db[(_0x78cb('0x52'))]['ValidationError']('The\x20inserted\x20key\x20already\x20exists.');}return db['CannedAnswer'][_0x78cb('0x4d')](_0x14f478[_0x78cb('0x4c')]);})[_0x78cb('0x26')](function(_0x4a048a){var _0x546fe0=_0x14f478[_0x78cb('0x53')][_0x78cb('0x28')]({'plain':!![]});if(!_0x546fe0)throw new Error(_0x78cb('0x54'));if(_0x546fe0['role']===_0x78cb('0x53')){var _0x121b92=_0x4a048a[_0x78cb('0x28')]({'plain':!![]});return db['UserProfileSection'][_0x78cb('0x4b')]({'where':{'name':_0x78cb('0x29'),'userProfileId':_0x546fe0[_0x78cb('0x55')]},'raw':!![]})['then'](function(_0x4f83a2){if(_0x4f83a2&&_0x4f83a2[_0x78cb('0x56')]===0x0){return db[_0x78cb('0x2a')][_0x78cb('0x4d')]({'name':_0x121b92[_0x78cb('0x2d')],'resourceId':_0x121b92['id'],'type':_0x4f83a2[_0x78cb('0x2d')],'sectionId':_0x4f83a2['id']},{})[_0x78cb('0x26')](function(){return _0x4a048a;});}else{return _0x4a048a;}})[_0x78cb('0x49')](function(_0x2ec44a){logger[_0x78cb('0x2b')](_0x78cb('0x57'),_0x2ec44a);throw _0x2ec44a;});}return _0x4a048a;})['then'](respondWithResult(_0x118082,0xc9))[_0x78cb('0x49')](handleError(_0x118082,null));};
\ No newline at end of file
+var _0xd1f2=['model','query','keys','attributes','intersection','fields','hasOwnProperty','nolimit','order','sort','where','pick','filters','merge','filter','options','includeAll','rows','show','params','length','include','find','catch','body','key','MailAccountId','SmsAccountId','ChatWebsiteId','ValidationError','user','UserProfileSection','userProfileId','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','util','path','sox','to-csv','ejs','lodash','squel','crypto','desk.js','querystring','papaparse','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','end','status','json','undefined','limit','offset','count','set','Content-Range','apply','update','then','destroy','get','sendStatus','error','stack','name','send','index','map','CannedAnswer','rawAttributes','type'];(function(_0x5003ea,_0x3c5db2){var _0x2014f9=function(_0xd05f5f){while(--_0xd05f5f){_0x5003ea['push'](_0x5003ea['shift']());}};_0x2014f9(++_0x3c5db2);}(_0xd1f2,0x170));var _0x2d1f=function(_0x260fc4,_0x3b092d){_0x260fc4=_0x260fc4-0x0;var _0x530cf7=_0xd1f2[_0x260fc4];return _0x530cf7;};'use strict';var emlformat=require(_0x2d1f('0x0'));var rimraf=require(_0x2d1f('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x2d1f('0x2'));var rp=require(_0x2d1f('0x3'));var moment=require(_0x2d1f('0x4'));var BPromise=require(_0x2d1f('0x5'));var Mustache=require('mustache');var util=require(_0x2d1f('0x6'));var path=require(_0x2d1f('0x7'));var sox=require(_0x2d1f('0x8'));var csv=require(_0x2d1f('0x9'));var ejs=require(_0x2d1f('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x2d1f('0xb'));var squel=require(_0x2d1f('0xc'));var crypto=require(_0x2d1f('0xd'));var jsforce=require('jsforce');var deskjs=require(_0x2d1f('0xe'));var toCsv=require(_0x2d1f('0x9'));var querystring=require(_0x2d1f('0xf'));var Papa=require(_0x2d1f('0x10'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x2d1f('0x11'));var as=require(_0x2d1f('0x12'));var hardwareService=require(_0x2d1f('0x13'));var logger=require(_0x2d1f('0x14'))(_0x2d1f('0x15'));var utils=require(_0x2d1f('0x16'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x18d6e5,_0x2a67b1){_0x2a67b1=_0x2a67b1||0xcc;return function(_0x5eeea8){if(_0x5eeea8){return _0x18d6e5['sendStatus'](_0x2a67b1);}return _0x18d6e5['status'](_0x2a67b1)[_0x2d1f('0x17')]();};}function respondWithResult(_0xf25d5f,_0x100510){_0x100510=_0x100510||0xc8;return function(_0x2a4411){if(_0x2a4411){return _0xf25d5f[_0x2d1f('0x18')](_0x100510)[_0x2d1f('0x19')](_0x2a4411);}};}function respondWithFilteredResult(_0x3280f0,_0x3ee821){return function(_0x47b0ee){if(_0x47b0ee){var _0x33af3c=typeof _0x3ee821['offset']===_0x2d1f('0x1a')&&typeof _0x3ee821[_0x2d1f('0x1b')]===_0x2d1f('0x1a');var _0x5d9ff1=_0x47b0ee['count'];var _0x1eba73=_0x33af3c?0x0:_0x3ee821[_0x2d1f('0x1c')];var _0x35e0ad=_0x33af3c?_0x47b0ee[_0x2d1f('0x1d')]:_0x3ee821[_0x2d1f('0x1c')]+_0x3ee821[_0x2d1f('0x1b')];var _0x21bbec;if(_0x35e0ad>=_0x5d9ff1){_0x35e0ad=_0x5d9ff1;_0x21bbec=0xc8;}else{_0x21bbec=0xce;}_0x3280f0[_0x2d1f('0x18')](_0x21bbec);return _0x3280f0[_0x2d1f('0x1e')](_0x2d1f('0x1f'),_0x1eba73+'-'+_0x35e0ad+'/'+_0x5d9ff1)[_0x2d1f('0x19')](_0x47b0ee);}return null;};}function patchUpdates(_0x43d5b0){return function(_0x311a61){try{jsonpatch[_0x2d1f('0x20')](_0x311a61,_0x43d5b0,!![]);}catch(_0x1e54f6){return BPromise['reject'](_0x1e54f6);}return _0x311a61['save']();};}function saveUpdates(_0x18dc3e,_0x1a77ce){return function(_0x4aec2d){if(_0x4aec2d){return _0x4aec2d[_0x2d1f('0x21')](_0x18dc3e)[_0x2d1f('0x22')](function(_0x3e3d08){return _0x3e3d08;});}return null;};}function removeEntity(_0x24bded,_0x5f32bf){return function(_0x3658fa){if(_0x3658fa){return _0x3658fa[_0x2d1f('0x23')]()[_0x2d1f('0x22')](function(){var _0x1c7be6=_0x3658fa[_0x2d1f('0x24')]({'plain':!![]});var _0x5c1434='CannedAnswers';return db['UserProfileResource'][_0x2d1f('0x23')]({'where':{'type':_0x5c1434,'resourceId':_0x1c7be6['id']}})['then'](function(){return _0x3658fa;});})[_0x2d1f('0x22')](function(){_0x24bded[_0x2d1f('0x18')](0xcc)[_0x2d1f('0x17')]();});}};}function handleEntityNotFound(_0x1f2dde,_0xd4040f){return function(_0x50f028){if(!_0x50f028){_0x1f2dde[_0x2d1f('0x25')](0x194);}return _0x50f028;};}function handleError(_0x45c692,_0x50166f){_0x50166f=_0x50166f||0x1f4;return function(_0x4bca13){logger[_0x2d1f('0x26')](_0x4bca13[_0x2d1f('0x27')]);if(_0x4bca13[_0x2d1f('0x28')]){delete _0x4bca13[_0x2d1f('0x28')];}_0x45c692['status'](_0x50166f)[_0x2d1f('0x29')](_0x4bca13);};}exports[_0x2d1f('0x2a')]=function(_0x2d54d6,_0x59fdad){var _0x1d56a6={},_0x5c97fd={},_0x488f73={'count':0x0,'rows':[]};var _0x33d15b=_[_0x2d1f('0x2b')](db[_0x2d1f('0x2c')][_0x2d1f('0x2d')],function(_0x2aaaac){return{'name':_0x2aaaac['fieldName'],'type':_0x2aaaac[_0x2d1f('0x2e')]['key']};});_0x5c97fd[_0x2d1f('0x2f')]=_['map'](_0x33d15b,_0x2d1f('0x28'));_0x5c97fd[_0x2d1f('0x30')]=_[_0x2d1f('0x31')](_0x2d54d6[_0x2d1f('0x30')]);_0x5c97fd['filters']=_['intersection'](_0x5c97fd['model'],_0x5c97fd[_0x2d1f('0x30')]);_0x1d56a6[_0x2d1f('0x32')]=_[_0x2d1f('0x33')](_0x5c97fd['model'],qs[_0x2d1f('0x34')](_0x2d54d6['query'][_0x2d1f('0x34')]));_0x1d56a6[_0x2d1f('0x32')]=_0x1d56a6['attributes']['length']?_0x1d56a6[_0x2d1f('0x32')]:_0x5c97fd[_0x2d1f('0x2f')];if(!_0x2d54d6[_0x2d1f('0x30')][_0x2d1f('0x35')](_0x2d1f('0x36'))){_0x1d56a6[_0x2d1f('0x1b')]=qs[_0x2d1f('0x1b')](_0x2d54d6[_0x2d1f('0x30')][_0x2d1f('0x1b')]);_0x1d56a6[_0x2d1f('0x1c')]=qs['offset'](_0x2d54d6[_0x2d1f('0x30')][_0x2d1f('0x1c')]);}_0x1d56a6[_0x2d1f('0x37')]=qs[_0x2d1f('0x38')](_0x2d54d6['query'][_0x2d1f('0x38')]);_0x1d56a6[_0x2d1f('0x39')]=qs['filters'](_[_0x2d1f('0x3a')](_0x2d54d6['query'],_0x5c97fd[_0x2d1f('0x3b')]),_0x33d15b);if(_0x2d54d6[_0x2d1f('0x30')]['filter']){_0x1d56a6['where']=_[_0x2d1f('0x3c')](_0x1d56a6[_0x2d1f('0x39')],{'$or':[{'key':{'$like':'%'+_0x2d54d6[_0x2d1f('0x30')]['filter']+'%'}},{'value':{'$like':'%'+_0x2d54d6[_0x2d1f('0x30')][_0x2d1f('0x3d')]+'%'}}]});}_0x1d56a6=_[_0x2d1f('0x3c')]({},_0x1d56a6,_0x2d54d6[_0x2d1f('0x3e')]);var _0x3d6bc7={'where':_0x1d56a6[_0x2d1f('0x39')]};return db['CannedAnswer'][_0x2d1f('0x1d')](_0x3d6bc7)['then'](function(_0xeb3081){_0x488f73[_0x2d1f('0x1d')]=_0xeb3081;if(_0x2d54d6['query'][_0x2d1f('0x3f')]){_0x1d56a6['include']=[{'all':!![]}];}return db[_0x2d1f('0x2c')]['findAll'](_0x1d56a6);})[_0x2d1f('0x22')](function(_0x9b7482){_0x488f73[_0x2d1f('0x40')]=_0x9b7482;return _0x488f73;})['then'](respondWithFilteredResult(_0x59fdad,_0x1d56a6))['catch'](handleError(_0x59fdad,null));};exports[_0x2d1f('0x41')]=function(_0x3167c0,_0x25c9a2){var _0x51f25e={'raw':!![],'where':{'id':_0x3167c0[_0x2d1f('0x42')]['id']}},_0x567454={};_0x567454[_0x2d1f('0x2f')]=_[_0x2d1f('0x31')](db[_0x2d1f('0x2c')]['rawAttributes']);_0x567454[_0x2d1f('0x30')]=_['keys'](_0x3167c0[_0x2d1f('0x30')]);_0x567454['filters']=_[_0x2d1f('0x33')](_0x567454['model'],_0x567454[_0x2d1f('0x30')]);_0x51f25e[_0x2d1f('0x32')]=_[_0x2d1f('0x33')](_0x567454[_0x2d1f('0x2f')],qs[_0x2d1f('0x34')](_0x3167c0[_0x2d1f('0x30')][_0x2d1f('0x34')]));_0x51f25e[_0x2d1f('0x32')]=_0x51f25e['attributes'][_0x2d1f('0x43')]?_0x51f25e[_0x2d1f('0x32')]:_0x567454['model'];if(_0x3167c0[_0x2d1f('0x30')]['includeAll']){_0x51f25e[_0x2d1f('0x44')]=[{'all':!![]}];}_0x51f25e=_['merge']({},_0x51f25e,_0x3167c0[_0x2d1f('0x3e')]);return db[_0x2d1f('0x2c')][_0x2d1f('0x45')](_0x51f25e)['then'](handleEntityNotFound(_0x25c9a2,null))['then'](respondWithResult(_0x25c9a2,null))[_0x2d1f('0x46')](handleError(_0x25c9a2,null));};exports[_0x2d1f('0x21')]=function(_0x9084dd,_0x261096){if(_0x9084dd[_0x2d1f('0x47')]['id']){delete _0x9084dd[_0x2d1f('0x47')]['id'];}return db[_0x2d1f('0x2c')][_0x2d1f('0x45')]({'where':{'id':_0x9084dd['params']['id']}})[_0x2d1f('0x22')](handleEntityNotFound(_0x261096,null))[_0x2d1f('0x22')](saveUpdates(_0x9084dd[_0x2d1f('0x47')],null))[_0x2d1f('0x22')](respondWithResult(_0x261096,null))[_0x2d1f('0x46')](handleError(_0x261096,null));};exports[_0x2d1f('0x23')]=function(_0xb1ab05,_0x23ae79){return db[_0x2d1f('0x2c')]['find']({'where':{'id':_0xb1ab05['params']['id']}})[_0x2d1f('0x22')](handleEntityNotFound(_0x23ae79,null))[_0x2d1f('0x22')](removeEntity(_0x23ae79,null))[_0x2d1f('0x46')](handleError(_0x23ae79,null));};exports['create']=function(_0x3d8cd6,_0x177bce){var _0x2bec54={'key':_0x3d8cd6['body'][_0x2d1f('0x48')]};if(_0x3d8cd6['body'][_0x2d1f('0x49')]){_0x2bec54[_0x2d1f('0x49')]=_0x3d8cd6['body']['MailAccountId'];}else if(_0x3d8cd6['body'][_0x2d1f('0x4a')]){_0x2bec54[_0x2d1f('0x4a')]=_0x3d8cd6['body'][_0x2d1f('0x4a')];}else if(_0x3d8cd6[_0x2d1f('0x47')]['OpenchannelAccountId']){_0x2bec54['OpenchannelAccountId']=_0x3d8cd6['body']['OpenchannelAccountId'];}else if(_0x3d8cd6[_0x2d1f('0x47')][_0x2d1f('0x4b')]){_0x2bec54[_0x2d1f('0x4b')]=_0x3d8cd6[_0x2d1f('0x47')][_0x2d1f('0x4b')];}return db['CannedAnswer'][_0x2d1f('0x45')]({'where':_0x2bec54})[_0x2d1f('0x22')](function(_0x5d8c4b){if(_0x5d8c4b){throw new db['Sequelize'][(_0x2d1f('0x4c'))]('The\x20inserted\x20key\x20already\x20exists.');}return db[_0x2d1f('0x2c')]['create'](_0x3d8cd6[_0x2d1f('0x47')]);})['then'](function(_0x36e317){var _0x3b46ac=_0x3d8cd6[_0x2d1f('0x4d')][_0x2d1f('0x24')]({'plain':!![]});if(!_0x3b46ac)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x3b46ac['role']===_0x2d1f('0x4d')){var _0x5c4927=_0x36e317[_0x2d1f('0x24')]({'plain':!![]});return db[_0x2d1f('0x4e')][_0x2d1f('0x45')]({'where':{'name':'CannedAnswers','userProfileId':_0x3b46ac[_0x2d1f('0x4f')]},'raw':!![]})[_0x2d1f('0x22')](function(_0x24fee4){if(_0x24fee4&&_0x24fee4[_0x2d1f('0x50')]===0x0){return db[_0x2d1f('0x51')]['create']({'name':_0x5c4927['name'],'resourceId':_0x5c4927['id'],'type':_0x24fee4[_0x2d1f('0x28')],'sectionId':_0x24fee4['id']},{})['then'](function(){return _0x36e317;});}else{return _0x36e317;}})[_0x2d1f('0x46')](function(_0x5c3dcc){logger[_0x2d1f('0x26')](_0x2d1f('0x52'),_0x5c3dcc);throw _0x5c3dcc;});}return _0x36e317;})[_0x2d1f('0x22')](respondWithResult(_0x177bce,0xc9))[_0x2d1f('0x46')](handleError(_0x177bce,null));};
\ No newline at end of file
diff --git a/server/api/cannedAnswer/cannedAnswer.model.js b/server/api/cannedAnswer/cannedAnswer.model.js
index d560cea..ee86197 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 _0x1614=['lodash','util','api','moment','request-promise','path','rimraf','./cannedAnswer.attributes','exports','define','CannedAnswer','tools_canned_answers','utf8mb4_unicode_ci'];(function(_0x266d22,_0x4665f4){var _0x520d3c=function(_0x545232){while(--_0x545232){_0x266d22['push'](_0x266d22['shift']());}};_0x520d3c(++_0x4665f4);}(_0x1614,0x1ee));var _0x4161=function(_0x3f0b30,_0x159bc8){_0x3f0b30=_0x3f0b30-0x0;var _0x2748a5=_0x1614[_0x3f0b30];return _0x2748a5;};'use strict';var _=require(_0x4161('0x0'));var util=require(_0x4161('0x1'));var logger=require('../../config/logger')(_0x4161('0x2'));var moment=require(_0x4161('0x3'));var BPromise=require('bluebird');var rp=require(_0x4161('0x4'));var fs=require('fs');var path=require(_0x4161('0x5'));var rimraf=require(_0x4161('0x6'));var config=require('../../config/environment');var attributes=require(_0x4161('0x7'));module[_0x4161('0x8')]=function(_0x5d3d2,_0x433af9){return _0x5d3d2[_0x4161('0x9')](_0x4161('0xa'),attributes,{'tableName':_0x4161('0xb'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':'utf8mb4','collate':_0x4161('0xc')});};
\ No newline at end of file
+var _0xaf31=['lodash','util','../../config/logger','moment','bluebird','request-promise','rimraf','../../config/environment','./cannedAnswer.attributes','exports','define','tools_canned_answers'];(function(_0x341ba1,_0x29fcc8){var _0x39f82c=function(_0x28b33e){while(--_0x28b33e){_0x341ba1['push'](_0x341ba1['shift']());}};_0x39f82c(++_0x29fcc8);}(_0xaf31,0xb4));var _0x1af3=function(_0x2cca95,_0x1964bb){_0x2cca95=_0x2cca95-0x0;var _0x5657be=_0xaf31[_0x2cca95];return _0x5657be;};'use strict';var _=require(_0x1af3('0x0'));var util=require(_0x1af3('0x1'));var logger=require(_0x1af3('0x2'))('api');var moment=require(_0x1af3('0x3'));var BPromise=require(_0x1af3('0x4'));var rp=require(_0x1af3('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x1af3('0x6'));var config=require(_0x1af3('0x7'));var attributes=require(_0x1af3('0x8'));module[_0x1af3('0x9')]=function(_0x36a06c,_0x5297a1){return _0x36a06c[_0x1af3('0xa')]('CannedAnswer',attributes,{'tableName':_0x1af3('0xb'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':'utf8mb4','collate':'utf8mb4_unicode_ci'});};
\ No newline at end of file
diff --git a/server/api/cannedAnswer/cannedAnswer.rpc.js b/server/api/cannedAnswer/cannedAnswer.rpc.js
index 14ba0b5..da1ddcd 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(_0x3a9a71,_0x3c58a1){var _0x5f1b1e=function(_0x337598){while(--_0x337598){_0x3a9a71['push'](_0x3a9a71['shift']());}};_0x5f1b1e(++_0x3c58a1);}(_0xa9e0,0x123));var _0x0a9e=function(_0x110c3d,_0x12ee06){_0x110c3d=_0x110c3d-0x0;var _0x226d67=_0xa9e0[_0x110c3d];return _0x226d67;};'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(_0x14f67a,_0x34b8fd){var _0xd89166=function(_0x4021a8){while(--_0x4021a8){_0x14f67a['push'](_0x14f67a['shift']());}};_0xd89166(++_0x34b8fd);}(_0xa9e0,0x123));var _0x0a9e=function(_0x36dfbd,_0x5bfe2d){_0x36dfbd=_0x36dfbd-0x0;var _0x4ecad9=_0xa9e0[_0x36dfbd];return _0x4ecad9;};'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 4933be2..f7a25f1 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 _0xd0b7=['../../config/environment','./cannedAnswer.controller','get','isAuthenticated','/:id','show','update','delete','destroy','exports','multer','util','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service'];(function(_0x465028,_0x4570ac){var _0xb783d4=function(_0x5458c5){while(--_0x5458c5){_0x465028['push'](_0x465028['shift']());}};_0xb783d4(++_0x4570ac);}(_0xd0b7,0x9a));var _0x7d0b=function(_0x52f712,_0x36667){_0x52f712=_0x52f712-0x0;var _0x121636=_0xd0b7[_0x52f712];return _0x121636;};'use strict';var multer=require(_0x7d0b('0x0'));var util=require(_0x7d0b('0x1'));var path=require(_0x7d0b('0x2'));var timeout=require('connect-timeout');var express=require(_0x7d0b('0x3'));var router=express[_0x7d0b('0x4')]();var fs_extra=require(_0x7d0b('0x5'));var auth=require(_0x7d0b('0x6'));var interaction=require(_0x7d0b('0x7'));var config=require(_0x7d0b('0x8'));var controller=require(_0x7d0b('0x9'));router[_0x7d0b('0xa')]('/',auth[_0x7d0b('0xb')](),controller['index']);router[_0x7d0b('0xa')](_0x7d0b('0xc'),auth[_0x7d0b('0xb')](),controller[_0x7d0b('0xd')]);router['post']('/',auth['isAuthenticated'](),controller['create']);router['put'](_0x7d0b('0xc'),auth[_0x7d0b('0xb')](),controller[_0x7d0b('0xe')]);router[_0x7d0b('0xf')]('/:id',auth[_0x7d0b('0xb')](),controller[_0x7d0b('0x10')]);module[_0x7d0b('0x11')]=router;
\ No newline at end of file
+var _0x6610=['show','post','create','put','update','delete','destroy','multer','util','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./cannedAnswer.controller','get','/:id','isAuthenticated'];(function(_0x4b7895,_0x3c4f5d){var _0x264180=function(_0xe0e861){while(--_0xe0e861){_0x4b7895['push'](_0x4b7895['shift']());}};_0x264180(++_0x3c4f5d);}(_0x6610,0x1cf));var _0x0661=function(_0x4a53f9,_0x1080ab){_0x4a53f9=_0x4a53f9-0x0;var _0x4b8ed2=_0x6610[_0x4a53f9];return _0x4b8ed2;};'use strict';var multer=require(_0x0661('0x0'));var util=require(_0x0661('0x1'));var path=require('path');var timeout=require(_0x0661('0x2'));var express=require(_0x0661('0x3'));var router=express[_0x0661('0x4')]();var fs_extra=require(_0x0661('0x5'));var auth=require(_0x0661('0x6'));var interaction=require(_0x0661('0x7'));var config=require('../../config/environment');var controller=require(_0x0661('0x8'));router[_0x0661('0x9')]('/',auth['isAuthenticated'](),controller['index']);router['get'](_0x0661('0xa'),auth[_0x0661('0xb')](),controller[_0x0661('0xc')]);router[_0x0661('0xd')]('/',auth[_0x0661('0xb')](),controller[_0x0661('0xe')]);router[_0x0661('0xf')](_0x0661('0xa'),auth[_0x0661('0xb')](),controller[_0x0661('0x10')]);router[_0x0661('0x11')]('/:id',auth['isAuthenticated'](),controller[_0x0661('0x12')]);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 846957d..391441c 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 _0x9780=['DATE','1970-01-01\x2000:00:01','STRING','INTEGER'];(function(_0x5ec548,_0xf21387){var _0x4093fb=function(_0xa22522){while(--_0xa22522){_0x5ec548['push'](_0x5ec548['shift']());}};_0x4093fb(++_0xf21387);}(_0x9780,0x1d4));var _0x0978=function(_0xd79494,_0x1fcda7){_0xd79494=_0xd79494-0x0;var _0x1c1698=_0x9780[_0xd79494];return _0x1c1698;};'use strict';var Sequelize=require('sequelize');module['exports']={'calldate':{'type':Sequelize[_0x0978('0x0')],'allowNull':![],'defaultValue':_0x0978('0x1')},'clid':{'type':Sequelize[_0x0978('0x2')]},'src':{'type':Sequelize[_0x0978('0x2')]},'dst':{'type':Sequelize[_0x0978('0x2')]},'dcontext':{'type':Sequelize[_0x0978('0x2')]},'channel':{'type':Sequelize[_0x0978('0x2')]},'dstchannel':{'type':Sequelize[_0x0978('0x2')]},'lastapp':{'type':Sequelize[_0x0978('0x2')]},'lastdata':{'type':Sequelize[_0x0978('0x2')]},'duration':{'type':Sequelize[_0x0978('0x3')],'allowNull':![],'defaultValue':0x0},'billsec':{'type':Sequelize['INTEGER'],'allowNull':![],'defaultValue':0x0},'disposition':{'type':Sequelize[_0x0978('0x2')]},'amaflags':{'type':Sequelize[_0x0978('0x3')],'allowNull':![],'defaultValue':0x0},'accountcode':{'type':Sequelize[_0x0978('0x2')]},'userfield':{'type':Sequelize[_0x0978('0x2')]},'uniqueid':{'type':Sequelize[_0x0978('0x2')]},'linkedid':{'type':Sequelize[_0x0978('0x2')]},'sequence':{'type':Sequelize[_0x0978('0x2')]},'peeraccount':{'type':Sequelize[_0x0978('0x2')]},'type':{'type':Sequelize[_0x0978('0x2')]},'tag':{'type':Sequelize[_0x0978('0x2')]}};
\ No newline at end of file
+var _0x5c4a=['DATE','STRING','INTEGER','exports'];(function(_0x38ff73,_0x2ff998){var _0x3d3901=function(_0x5ea12d){while(--_0x5ea12d){_0x38ff73['push'](_0x38ff73['shift']());}};_0x3d3901(++_0x2ff998);}(_0x5c4a,0xfb));var _0xa5c4=function(_0x5f1a47,_0x49dc01){_0x5f1a47=_0x5f1a47-0x0;var _0x1c4854=_0x5c4a[_0x5f1a47];return _0x1c4854;};'use strict';var Sequelize=require('sequelize');module[_0xa5c4('0x0')]={'calldate':{'type':Sequelize[_0xa5c4('0x1')],'allowNull':![],'defaultValue':'1970-01-01\x2000:00:01'},'clid':{'type':Sequelize[_0xa5c4('0x2')]},'src':{'type':Sequelize[_0xa5c4('0x2')]},'dst':{'type':Sequelize['STRING']},'dcontext':{'type':Sequelize[_0xa5c4('0x2')]},'channel':{'type':Sequelize[_0xa5c4('0x2')]},'dstchannel':{'type':Sequelize[_0xa5c4('0x2')]},'lastapp':{'type':Sequelize[_0xa5c4('0x2')]},'lastdata':{'type':Sequelize[_0xa5c4('0x2')]},'duration':{'type':Sequelize['INTEGER'],'allowNull':![],'defaultValue':0x0},'billsec':{'type':Sequelize[_0xa5c4('0x3')],'allowNull':![],'defaultValue':0x0},'disposition':{'type':Sequelize[_0xa5c4('0x2')]},'amaflags':{'type':Sequelize[_0xa5c4('0x3')],'allowNull':![],'defaultValue':0x0},'accountcode':{'type':Sequelize[_0xa5c4('0x2')]},'userfield':{'type':Sequelize[_0xa5c4('0x2')]},'uniqueid':{'type':Sequelize[_0xa5c4('0x2')]},'linkedid':{'type':Sequelize['STRING']},'sequence':{'type':Sequelize[_0xa5c4('0x2')]},'peeraccount':{'type':Sequelize[_0xa5c4('0x2')]},'type':{'type':Sequelize[_0xa5c4('0x2')]},'tag':{'type':Sequelize['STRING']}};
\ No newline at end of file
diff --git a/server/api/cdr/cdr.controller.js b/server/api/cdr/cdr.controller.js
index d0b933b..9d0b84b 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 _0x5292=['rawAttributes','fieldName','type','key','model','map','query','keys','filters','intersection','length','attributes','hasOwnProperty','order','sort','where','pick','filter','merge','VIRTUAL','includeAll','findAll','rows','catch','params','fields','options','find','create','body','describe','eml-format','rimraf','fast-json-patch','moment','bluebird','mustache','util','sox','lodash','squel','desk.js','to-csv','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','sendStatus','status','end','json','offset','limit','count','Content-Range','reject','save','update','then','destroy','error','stack','name','send','index','Cdr'];(function(_0x59d89e,_0x55edf5){var _0x554e93=function(_0x3d40bc){while(--_0x3d40bc){_0x59d89e['push'](_0x59d89e['shift']());}};_0x554e93(++_0x55edf5);}(_0x5292,0xf7));var _0x2529=function(_0x4b23b0,_0xf3d9b4){_0x4b23b0=_0x4b23b0-0x0;var _0x1440d7=_0x5292[_0x4b23b0];return _0x1440d7;};'use strict';var emlformat=require(_0x2529('0x0'));var rimraf=require(_0x2529('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x2529('0x2'));var rp=require('request-promise');var moment=require(_0x2529('0x3'));var BPromise=require(_0x2529('0x4'));var Mustache=require(_0x2529('0x5'));var util=require(_0x2529('0x6'));var path=require('path');var sox=require(_0x2529('0x7'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x2529('0x8'));var squel=require(_0x2529('0x9'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x2529('0xa'));var toCsv=require(_0x2529('0xb'));var querystring=require('querystring');var Papa=require(_0x2529('0xc'));var Redis=require(_0x2529('0xd'));var authService=require(_0x2529('0xe'));var qs=require(_0x2529('0xf'));var as=require(_0x2529('0x10'));var hardwareService=require(_0x2529('0x11'));var logger=require(_0x2529('0x12'))(_0x2529('0x13'));var utils=require('../../config/utils');var config=require(_0x2529('0x14'));var licenseUtil=require(_0x2529('0x15'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0xe333c9,_0x23bfaf){_0x23bfaf=_0x23bfaf||0xcc;return function(_0x149692){if(_0x149692){return _0xe333c9[_0x2529('0x16')](_0x23bfaf);}return _0xe333c9[_0x2529('0x17')](_0x23bfaf)[_0x2529('0x18')]();};}function respondWithResult(_0x3f3b40,_0x5245cf){_0x5245cf=_0x5245cf||0xc8;return function(_0x101668){if(_0x101668){return _0x3f3b40[_0x2529('0x17')](_0x5245cf)[_0x2529('0x19')](_0x101668);}};}function respondWithFilteredResult(_0x19e4bf,_0x1cc716){return function(_0x2598a1){if(_0x2598a1){var _0x1a1ccc=typeof _0x1cc716[_0x2529('0x1a')]==='undefined'&&typeof _0x1cc716[_0x2529('0x1b')]==='undefined';var _0x337720=_0x2598a1[_0x2529('0x1c')];var _0x89be58=_0x1a1ccc?0x0:_0x1cc716['offset'];var _0x5b4d0d=_0x1a1ccc?_0x2598a1[_0x2529('0x1c')]:_0x1cc716[_0x2529('0x1a')]+_0x1cc716[_0x2529('0x1b')];var _0x37204a;if(_0x5b4d0d>=_0x337720){_0x5b4d0d=_0x337720;_0x37204a=0xc8;}else{_0x37204a=0xce;}_0x19e4bf[_0x2529('0x17')](_0x37204a);return _0x19e4bf['set'](_0x2529('0x1d'),_0x89be58+'-'+_0x5b4d0d+'/'+_0x337720)[_0x2529('0x19')](_0x2598a1);}return null;};}function patchUpdates(_0x1ca15f){return function(_0xeff5a6){try{jsonpatch['apply'](_0xeff5a6,_0x1ca15f,!![]);}catch(_0x1fa873){return BPromise[_0x2529('0x1e')](_0x1fa873);}return _0xeff5a6[_0x2529('0x1f')]();};}function saveUpdates(_0x5b4760,_0x3d5d17){return function(_0x3f57da){if(_0x3f57da){return _0x3f57da[_0x2529('0x20')](_0x5b4760)[_0x2529('0x21')](function(_0x5540e4){return _0x5540e4;});}return null;};}function removeEntity(_0x2736f6,_0x2d0c6d){return function(_0x400a01){if(_0x400a01){return _0x400a01[_0x2529('0x22')]()[_0x2529('0x21')](function(){_0x2736f6[_0x2529('0x17')](0xcc)['end']();});}};}function handleEntityNotFound(_0x5539ef,_0x856e50){return function(_0x40f42b){if(!_0x40f42b){_0x5539ef[_0x2529('0x16')](0x194);}return _0x40f42b;};}function handleError(_0x431c40,_0x24418a){_0x24418a=_0x24418a||0x1f4;return function(_0x2a8371){logger[_0x2529('0x23')](_0x2a8371[_0x2529('0x24')]);if(_0x2a8371[_0x2529('0x25')]){delete _0x2a8371[_0x2529('0x25')];}_0x431c40['status'](_0x24418a)[_0x2529('0x26')](_0x2a8371);};}exports[_0x2529('0x27')]=function(_0x4dd0fb,_0x1822ce){var _0x3c46c6={},_0x5bea2d={},_0x17bcbd={'count':0x0,'rows':[]};var _0x1d7e98=_['map'](db[_0x2529('0x28')][_0x2529('0x29')],function(_0x4a18f6){return{'name':_0x4a18f6[_0x2529('0x2a')],'type':_0x4a18f6[_0x2529('0x2b')][_0x2529('0x2c')]};});_0x5bea2d[_0x2529('0x2d')]=_[_0x2529('0x2e')](_0x1d7e98,'name');_0x5bea2d[_0x2529('0x2f')]=_[_0x2529('0x30')](_0x4dd0fb[_0x2529('0x2f')]);_0x5bea2d[_0x2529('0x31')]=_[_0x2529('0x32')](_0x5bea2d[_0x2529('0x2d')],_0x5bea2d[_0x2529('0x2f')]);_0x3c46c6['attributes']=_['intersection'](_0x5bea2d[_0x2529('0x2d')],qs['fields'](_0x4dd0fb[_0x2529('0x2f')]['fields']));_0x3c46c6['attributes']=_0x3c46c6['attributes'][_0x2529('0x33')]?_0x3c46c6[_0x2529('0x34')]:_0x5bea2d[_0x2529('0x2d')];if(!_0x4dd0fb['query'][_0x2529('0x35')]('nolimit')){_0x3c46c6['limit']=qs['limit'](_0x4dd0fb[_0x2529('0x2f')][_0x2529('0x1b')]);_0x3c46c6[_0x2529('0x1a')]=qs[_0x2529('0x1a')](_0x4dd0fb[_0x2529('0x2f')][_0x2529('0x1a')]);}_0x3c46c6[_0x2529('0x36')]=qs[_0x2529('0x37')](_0x4dd0fb[_0x2529('0x2f')][_0x2529('0x37')]);_0x3c46c6[_0x2529('0x38')]=qs[_0x2529('0x31')](_[_0x2529('0x39')](_0x4dd0fb['query'],_0x5bea2d['filters']),_0x1d7e98);if(_0x4dd0fb[_0x2529('0x2f')][_0x2529('0x3a')]){_0x3c46c6['where']=_[_0x2529('0x3b')](_0x3c46c6[_0x2529('0x38')],{'$or':_[_0x2529('0x2e')](_0x1d7e98,function(_0x1b1f81){if(_0x1b1f81[_0x2529('0x2b')]!==_0x2529('0x3c')){var _0x1b8226={};_0x1b8226[_0x1b1f81['name']]={'$like':'%'+_0x4dd0fb[_0x2529('0x2f')][_0x2529('0x3a')]+'%'};return _0x1b8226;}})});}_0x3c46c6=_[_0x2529('0x3b')]({},_0x3c46c6,_0x4dd0fb['options']);var _0x1393b7={'where':_0x3c46c6[_0x2529('0x38')]};return db[_0x2529('0x28')][_0x2529('0x1c')](_0x1393b7)[_0x2529('0x21')](function(_0x33acbf){_0x17bcbd[_0x2529('0x1c')]=_0x33acbf;if(_0x4dd0fb[_0x2529('0x2f')][_0x2529('0x3d')]){_0x3c46c6['include']=[{'all':!![]}];}return db[_0x2529('0x28')][_0x2529('0x3e')](_0x3c46c6);})[_0x2529('0x21')](function(_0x3b4e47){_0x17bcbd[_0x2529('0x3f')]=_0x3b4e47;return _0x17bcbd;})[_0x2529('0x21')](respondWithFilteredResult(_0x1822ce,_0x3c46c6))[_0x2529('0x40')](handleError(_0x1822ce,null));};exports['show']=function(_0x8ced2e,_0x33a13e){var _0x3f76e8={'raw':!![],'where':{'id':_0x8ced2e[_0x2529('0x41')]['id']}},_0x2aaecb={};_0x2aaecb['model']=_[_0x2529('0x30')](db[_0x2529('0x28')][_0x2529('0x29')]);_0x2aaecb[_0x2529('0x2f')]=_[_0x2529('0x30')](_0x8ced2e[_0x2529('0x2f')]);_0x2aaecb['filters']=_['intersection'](_0x2aaecb['model'],_0x2aaecb['query']);_0x3f76e8[_0x2529('0x34')]=_['intersection'](_0x2aaecb[_0x2529('0x2d')],qs[_0x2529('0x42')](_0x8ced2e[_0x2529('0x2f')][_0x2529('0x42')]));_0x3f76e8[_0x2529('0x34')]=_0x3f76e8['attributes'][_0x2529('0x33')]?_0x3f76e8['attributes']:_0x2aaecb[_0x2529('0x2d')];if(_0x8ced2e['query'][_0x2529('0x3d')]){_0x3f76e8['include']=[{'all':!![]}];}_0x3f76e8=_[_0x2529('0x3b')]({},_0x3f76e8,_0x8ced2e[_0x2529('0x43')]);return db['Cdr'][_0x2529('0x44')](_0x3f76e8)['then'](handleEntityNotFound(_0x33a13e,null))[_0x2529('0x21')](respondWithResult(_0x33a13e,null))[_0x2529('0x40')](handleError(_0x33a13e,null));};exports[_0x2529('0x45')]=function(_0x3c6d79,_0xdc4bef){return db[_0x2529('0x28')][_0x2529('0x45')](_0x3c6d79[_0x2529('0x46')],{})[_0x2529('0x21')](respondWithResult(_0xdc4bef,0xc9))['catch'](handleError(_0xdc4bef,null));};exports['update']=function(_0x5e72d1,_0x37a23a){if(_0x5e72d1[_0x2529('0x46')]['id']){delete _0x5e72d1[_0x2529('0x46')]['id'];}return db['Cdr']['find']({'where':{'id':_0x5e72d1[_0x2529('0x41')]['id']}})['then'](handleEntityNotFound(_0x37a23a,null))[_0x2529('0x21')](saveUpdates(_0x5e72d1[_0x2529('0x46')],null))[_0x2529('0x21')](respondWithResult(_0x37a23a,null))[_0x2529('0x40')](handleError(_0x37a23a,null));};exports[_0x2529('0x22')]=function(_0x196ee8,_0x4583ba){return db[_0x2529('0x28')]['find']({'where':{'id':_0x196ee8['params']['id']}})[_0x2529('0x21')](handleEntityNotFound(_0x4583ba,null))[_0x2529('0x21')](removeEntity(_0x4583ba,null))[_0x2529('0x40')](handleError(_0x4583ba,null));};exports[_0x2529('0x47')]=function(_0x1f76d3,_0x3ac799){return db[_0x2529('0x28')][_0x2529('0x47')]()[_0x2529('0x21')](respondWithResult(_0x3ac799,null))[_0x2529('0x40')](handleError(_0x3ac799,null));};
\ No newline at end of file
+var _0xbd51=['stack','name','send','index','Cdr','rawAttributes','fieldName','type','key','query','filters','intersection','model','attributes','fields','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','map','VIRTUAL','options','then','includeAll','include','rows','show','params','keys','length','catch','create','body','find','describe','eml-format','zip-dir','fast-json-patch','request-promise','moment','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','destroy','error'];(function(_0x263a74,_0xc31414){var _0x2aa86c=function(_0x382896){while(--_0x382896){_0x263a74['push'](_0x263a74['shift']());}};_0x2aa86c(++_0xc31414);}(_0xbd51,0x1a8));var _0x1bd5=function(_0x933e65,_0x31405e){_0x933e65=_0x933e65-0x0;var _0x15acb5=_0xbd51[_0x933e65];return _0x15acb5;};'use strict';var emlformat=require(_0x1bd5('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x1bd5('0x1'));var jsonpatch=require(_0x1bd5('0x2'));var rp=require(_0x1bd5('0x3'));var moment=require(_0x1bd5('0x4'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require('util');var path=require('path');var sox=require(_0x1bd5('0x5'));var csv=require(_0x1bd5('0x6'));var ejs=require(_0x1bd5('0x7'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x1bd5('0x8'));var squel=require(_0x1bd5('0x9'));var crypto=require(_0x1bd5('0xa'));var jsforce=require(_0x1bd5('0xb'));var deskjs=require(_0x1bd5('0xc'));var toCsv=require('to-csv');var querystring=require(_0x1bd5('0xd'));var Papa=require('papaparse');var Redis=require(_0x1bd5('0xe'));var authService=require(_0x1bd5('0xf'));var qs=require(_0x1bd5('0x10'));var as=require(_0x1bd5('0x11'));var hardwareService=require(_0x1bd5('0x12'));var logger=require(_0x1bd5('0x13'))('api');var utils=require(_0x1bd5('0x14'));var config=require('../../config/environment');var licenseUtil=require(_0x1bd5('0x15'));var db=require(_0x1bd5('0x16'))['db'];function respondWithStatusCode(_0x37e8e1,_0x14606b){_0x14606b=_0x14606b||0xcc;return function(_0x177be0){if(_0x177be0){return _0x37e8e1[_0x1bd5('0x17')](_0x14606b);}return _0x37e8e1[_0x1bd5('0x18')](_0x14606b)['end']();};}function respondWithResult(_0x5650b5,_0x8b2390){_0x8b2390=_0x8b2390||0xc8;return function(_0x6d2c40){if(_0x6d2c40){return _0x5650b5[_0x1bd5('0x18')](_0x8b2390)[_0x1bd5('0x19')](_0x6d2c40);}};}function respondWithFilteredResult(_0x48d048,_0x5072c2){return function(_0xa63190){if(_0xa63190){var _0xc7277e=typeof _0x5072c2[_0x1bd5('0x1a')]===_0x1bd5('0x1b')&&typeof _0x5072c2[_0x1bd5('0x1c')]===_0x1bd5('0x1b');var _0x13cf34=_0xa63190[_0x1bd5('0x1d')];var _0x4670b5=_0xc7277e?0x0:_0x5072c2['offset'];var _0x53ad5e=_0xc7277e?_0xa63190[_0x1bd5('0x1d')]:_0x5072c2[_0x1bd5('0x1a')]+_0x5072c2[_0x1bd5('0x1c')];var _0xb95d4e;if(_0x53ad5e>=_0x13cf34){_0x53ad5e=_0x13cf34;_0xb95d4e=0xc8;}else{_0xb95d4e=0xce;}_0x48d048[_0x1bd5('0x18')](_0xb95d4e);return _0x48d048[_0x1bd5('0x1e')](_0x1bd5('0x1f'),_0x4670b5+'-'+_0x53ad5e+'/'+_0x13cf34)[_0x1bd5('0x19')](_0xa63190);}return null;};}function patchUpdates(_0x456051){return function(_0xb1ac1e){try{jsonpatch[_0x1bd5('0x20')](_0xb1ac1e,_0x456051,!![]);}catch(_0x2447c4){return BPromise[_0x1bd5('0x21')](_0x2447c4);}return _0xb1ac1e[_0x1bd5('0x22')]();};}function saveUpdates(_0x253d79,_0x46c580){return function(_0x1f13e7){if(_0x1f13e7){return _0x1f13e7[_0x1bd5('0x23')](_0x253d79)['then'](function(_0x42c43d){return _0x42c43d;});}return null;};}function removeEntity(_0x50c663,_0x18fd18){return function(_0x1e534e){if(_0x1e534e){return _0x1e534e[_0x1bd5('0x24')]()['then'](function(){_0x50c663[_0x1bd5('0x18')](0xcc)['end']();});}};}function handleEntityNotFound(_0x2ed551,_0x30676d){return function(_0x3dba4f){if(!_0x3dba4f){_0x2ed551[_0x1bd5('0x17')](0x194);}return _0x3dba4f;};}function handleError(_0x47c84b,_0x202ed3){_0x202ed3=_0x202ed3||0x1f4;return function(_0x69bb17){logger[_0x1bd5('0x25')](_0x69bb17[_0x1bd5('0x26')]);if(_0x69bb17['name']){delete _0x69bb17[_0x1bd5('0x27')];}_0x47c84b[_0x1bd5('0x18')](_0x202ed3)[_0x1bd5('0x28')](_0x69bb17);};}exports[_0x1bd5('0x29')]=function(_0xe54b9f,_0xc73670){var _0x4e72b2={},_0x289097={},_0x472b22={'count':0x0,'rows':[]};var _0x8d53ba=_['map'](db[_0x1bd5('0x2a')][_0x1bd5('0x2b')],function(_0x345181){return{'name':_0x345181[_0x1bd5('0x2c')],'type':_0x345181[_0x1bd5('0x2d')][_0x1bd5('0x2e')]};});_0x289097['model']=_['map'](_0x8d53ba,_0x1bd5('0x27'));_0x289097[_0x1bd5('0x2f')]=_['keys'](_0xe54b9f[_0x1bd5('0x2f')]);_0x289097[_0x1bd5('0x30')]=_[_0x1bd5('0x31')](_0x289097[_0x1bd5('0x32')],_0x289097['query']);_0x4e72b2[_0x1bd5('0x33')]=_[_0x1bd5('0x31')](_0x289097[_0x1bd5('0x32')],qs[_0x1bd5('0x34')](_0xe54b9f[_0x1bd5('0x2f')][_0x1bd5('0x34')]));_0x4e72b2[_0x1bd5('0x33')]=_0x4e72b2[_0x1bd5('0x33')]['length']?_0x4e72b2[_0x1bd5('0x33')]:_0x289097[_0x1bd5('0x32')];if(!_0xe54b9f[_0x1bd5('0x2f')][_0x1bd5('0x35')](_0x1bd5('0x36'))){_0x4e72b2[_0x1bd5('0x1c')]=qs[_0x1bd5('0x1c')](_0xe54b9f['query'][_0x1bd5('0x1c')]);_0x4e72b2[_0x1bd5('0x1a')]=qs[_0x1bd5('0x1a')](_0xe54b9f[_0x1bd5('0x2f')][_0x1bd5('0x1a')]);}_0x4e72b2[_0x1bd5('0x37')]=qs[_0x1bd5('0x38')](_0xe54b9f['query']['sort']);_0x4e72b2[_0x1bd5('0x39')]=qs[_0x1bd5('0x30')](_[_0x1bd5('0x3a')](_0xe54b9f['query'],_0x289097[_0x1bd5('0x30')]),_0x8d53ba);if(_0xe54b9f['query'][_0x1bd5('0x3b')]){_0x4e72b2[_0x1bd5('0x39')]=_[_0x1bd5('0x3c')](_0x4e72b2[_0x1bd5('0x39')],{'$or':_[_0x1bd5('0x3d')](_0x8d53ba,function(_0x2470ec){if(_0x2470ec[_0x1bd5('0x2d')]!==_0x1bd5('0x3e')){var _0x4bbefc={};_0x4bbefc[_0x2470ec[_0x1bd5('0x27')]]={'$like':'%'+_0xe54b9f[_0x1bd5('0x2f')]['filter']+'%'};return _0x4bbefc;}})});}_0x4e72b2=_[_0x1bd5('0x3c')]({},_0x4e72b2,_0xe54b9f[_0x1bd5('0x3f')]);var _0x20b25c={'where':_0x4e72b2['where']};return db[_0x1bd5('0x2a')][_0x1bd5('0x1d')](_0x20b25c)[_0x1bd5('0x40')](function(_0x4074f1){_0x472b22['count']=_0x4074f1;if(_0xe54b9f[_0x1bd5('0x2f')][_0x1bd5('0x41')]){_0x4e72b2[_0x1bd5('0x42')]=[{'all':!![]}];}return db[_0x1bd5('0x2a')]['findAll'](_0x4e72b2);})['then'](function(_0x40eeff){_0x472b22[_0x1bd5('0x43')]=_0x40eeff;return _0x472b22;})[_0x1bd5('0x40')](respondWithFilteredResult(_0xc73670,_0x4e72b2))['catch'](handleError(_0xc73670,null));};exports[_0x1bd5('0x44')]=function(_0x3b1092,_0x574d95){var _0x1eacac={'raw':!![],'where':{'id':_0x3b1092[_0x1bd5('0x45')]['id']}},_0x5761b8={};_0x5761b8[_0x1bd5('0x32')]=_['keys'](db[_0x1bd5('0x2a')][_0x1bd5('0x2b')]);_0x5761b8[_0x1bd5('0x2f')]=_[_0x1bd5('0x46')](_0x3b1092[_0x1bd5('0x2f')]);_0x5761b8[_0x1bd5('0x30')]=_[_0x1bd5('0x31')](_0x5761b8[_0x1bd5('0x32')],_0x5761b8[_0x1bd5('0x2f')]);_0x1eacac[_0x1bd5('0x33')]=_[_0x1bd5('0x31')](_0x5761b8[_0x1bd5('0x32')],qs['fields'](_0x3b1092[_0x1bd5('0x2f')][_0x1bd5('0x34')]));_0x1eacac[_0x1bd5('0x33')]=_0x1eacac['attributes'][_0x1bd5('0x47')]?_0x1eacac[_0x1bd5('0x33')]:_0x5761b8['model'];if(_0x3b1092[_0x1bd5('0x2f')]['includeAll']){_0x1eacac[_0x1bd5('0x42')]=[{'all':!![]}];}_0x1eacac=_['merge']({},_0x1eacac,_0x3b1092[_0x1bd5('0x3f')]);return db[_0x1bd5('0x2a')]['find'](_0x1eacac)[_0x1bd5('0x40')](handleEntityNotFound(_0x574d95,null))['then'](respondWithResult(_0x574d95,null))[_0x1bd5('0x48')](handleError(_0x574d95,null));};exports[_0x1bd5('0x49')]=function(_0x1a29f3,_0xe71454){return db[_0x1bd5('0x2a')][_0x1bd5('0x49')](_0x1a29f3[_0x1bd5('0x4a')],{})[_0x1bd5('0x40')](respondWithResult(_0xe71454,0xc9))['catch'](handleError(_0xe71454,null));};exports[_0x1bd5('0x23')]=function(_0x227a68,_0x2a1ece){if(_0x227a68[_0x1bd5('0x4a')]['id']){delete _0x227a68[_0x1bd5('0x4a')]['id'];}return db[_0x1bd5('0x2a')]['find']({'where':{'id':_0x227a68[_0x1bd5('0x45')]['id']}})[_0x1bd5('0x40')](handleEntityNotFound(_0x2a1ece,null))[_0x1bd5('0x40')](saveUpdates(_0x227a68[_0x1bd5('0x4a')],null))[_0x1bd5('0x40')](respondWithResult(_0x2a1ece,null))[_0x1bd5('0x48')](handleError(_0x2a1ece,null));};exports[_0x1bd5('0x24')]=function(_0x539d0e,_0x587c46){return db[_0x1bd5('0x2a')][_0x1bd5('0x4b')]({'where':{'id':_0x539d0e[_0x1bd5('0x45')]['id']}})['then'](handleEntityNotFound(_0x587c46,null))[_0x1bd5('0x40')](removeEntity(_0x587c46,null))[_0x1bd5('0x48')](handleError(_0x587c46,null));};exports[_0x1bd5('0x4c')]=function(_0x1f2d7e,_0x11813d){return db[_0x1bd5('0x2a')][_0x1bd5('0x4c')]()['then'](respondWithResult(_0x11813d,null))[_0x1bd5('0x48')](handleError(_0x11813d,null));};
\ No newline at end of file
diff --git a/server/api/cdr/cdr.model.js b/server/api/cdr/cdr.model.js
index caa8d5b..e78a63e 100644
--- a/server/api/cdr/cdr.model.js
+++ b/server/api/cdr/cdr.model.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x9957=['dst','src','uniqueid','lodash','util','../../config/logger','api','bluebird','request-promise','path','rimraf','./cdr.attributes','exports','define','Cdr','accountcode','calldate','disposition'];(function(_0x2cd08a,_0x541694){var _0x5bfd5c=function(_0x1becdf){while(--_0x1becdf){_0x2cd08a['push'](_0x2cd08a['shift']());}};_0x5bfd5c(++_0x541694);}(_0x9957,0x93));var _0x7995=function(_0x2dafbe,_0x5d04de){_0x2dafbe=_0x2dafbe-0x0;var _0x58a45a=_0x9957[_0x2dafbe];return _0x58a45a;};'use strict';var _=require(_0x7995('0x0'));var util=require(_0x7995('0x1'));var logger=require(_0x7995('0x2'))(_0x7995('0x3'));var moment=require('moment');var BPromise=require(_0x7995('0x4'));var rp=require(_0x7995('0x5'));var fs=require('fs');var path=require(_0x7995('0x6'));var rimraf=require(_0x7995('0x7'));var config=require('../../config/environment');var attributes=require(_0x7995('0x8'));module[_0x7995('0x9')]=function(_0x137b6b,_0x219534){return _0x137b6b[_0x7995('0xa')](_0x7995('0xb'),attributes,{'tableName':'cdr','paranoid':![],'indexes':[{'name':_0x7995('0xc'),'fields':[_0x7995('0xc')]},{'name':'calldate','fields':[_0x7995('0xd')]},{'name':_0x7995('0xe'),'fields':[_0x7995('0xe')]},{'name':_0x7995('0xf'),'fields':[_0x7995('0xf')]},{'name':_0x7995('0x10'),'fields':[_0x7995('0x10')]},{'name':'uniqueid','fields':[_0x7995('0x11')]}],'timestamps':![]});};
\ No newline at end of file
+var _0x7a54=['Cdr','cdr','accountcode','disposition','dst','src','uniqueid','lodash','util','../../config/logger','moment','bluebird','path','rimraf','../../config/environment','./cdr.attributes','exports'];(function(_0x4f04a6,_0x2d4a50){var _0x5aea1e=function(_0x39b440){while(--_0x39b440){_0x4f04a6['push'](_0x4f04a6['shift']());}};_0x5aea1e(++_0x2d4a50);}(_0x7a54,0x106));var _0x47a5=function(_0x596e2d,_0x1762e8){_0x596e2d=_0x596e2d-0x0;var _0x53e3bb=_0x7a54[_0x596e2d];return _0x53e3bb;};'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 46bb02e..afa6212 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 _0x5a7b=['client','request','then','info','Cdr,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','util','randomstring','ioredis','../../mysqldb','../../config/logger','../../config/environment','jayson/promise'];(function(_0x53ed0b,_0x25e205){var _0x453628=function(_0x2b0c51){while(--_0x2b0c51){_0x53ed0b['push'](_0x53ed0b['shift']());}};_0x453628(++_0x25e205);}(_0x5a7b,0x19b));var _0xb5a7=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x5a7b[_0x14add3];return _0x4a174f;};'use strict';var _=require('lodash');var util=require(_0xb5a7('0x0'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0xb5a7('0x1'));var fs=require('fs');var Redis=require(_0xb5a7('0x2'));var db=require(_0xb5a7('0x3'))['db'];var utils=require('../../config/utils');var logger=require(_0xb5a7('0x4'))('rpc');var config=require(_0xb5a7('0x5'));var jayson=require(_0xb5a7('0x6'));var client=jayson[_0xb5a7('0x7')]['http']({'port':0x232a});function respondWithRpcPromise(_0xe483a1,_0x17824f,_0x580473){return new BPromise(function(_0x25b14c,_0x16510b){return client[_0xb5a7('0x8')](_0xe483a1,_0x580473)[_0xb5a7('0x9')](function(_0x3fdd44){logger[_0xb5a7('0xa')](_0xb5a7('0xb'),_0x17824f,'request\x20sent');logger['debug']('Cdr,\x20%s,\x20%s,\x20%s',_0x17824f,_0xb5a7('0xc'),JSON[_0xb5a7('0xd')](_0x3fdd44));if(_0x3fdd44[_0xb5a7('0xe')]){if(_0x3fdd44[_0xb5a7('0xe')][_0xb5a7('0xf')]===0x1f4){logger[_0xb5a7('0xe')](_0xb5a7('0xb'),_0x17824f,_0x3fdd44[_0xb5a7('0xe')][_0xb5a7('0x10')]);return _0x16510b(_0x3fdd44[_0xb5a7('0xe')]['message']);}logger[_0xb5a7('0xe')](_0xb5a7('0xb'),_0x17824f,_0x3fdd44[_0xb5a7('0xe')][_0xb5a7('0x10')]);return _0x25b14c(_0x3fdd44[_0xb5a7('0xe')][_0xb5a7('0x10')]);}else{logger[_0xb5a7('0xa')]('Cdr,\x20%s,\x20%s',_0x17824f,_0xb5a7('0xc'));_0x25b14c(_0x3fdd44[_0xb5a7('0x11')]['message']);}})[_0xb5a7('0x12')](function(_0x117949){logger[_0xb5a7('0xe')](_0xb5a7('0xb'),_0x17824f,_0x117949);_0x16510b(_0x117949);});});}
\ No newline at end of file
+var _0xaf15=['Cdr,\x20%s,\x20%s','Cdr,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','info','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','then'];(function(_0x58d548,_0x3a4f31){var _0x298dc5=function(_0x4efe2f){while(--_0x4efe2f){_0x58d548['push'](_0x58d548['shift']());}};_0x298dc5(++_0x3a4f31);}(_0xaf15,0xa0));var _0x5af1=function(_0x1f830f,_0x29659a){_0x1f830f=_0x1f830f-0x0;var _0x32e38b=_0xaf15[_0x1f830f];return _0x32e38b;};'use strict';var _=require(_0x5af1('0x0'));var util=require(_0x5af1('0x1'));var moment=require(_0x5af1('0x2'));var BPromise=require(_0x5af1('0x3'));var rs=require(_0x5af1('0x4'));var fs=require('fs');var Redis=require(_0x5af1('0x5'));var db=require(_0x5af1('0x6'))['db'];var utils=require(_0x5af1('0x7'));var logger=require(_0x5af1('0x8'))(_0x5af1('0x9'));var config=require(_0x5af1('0xa'));var jayson=require(_0x5af1('0xb'));var client=jayson[_0x5af1('0xc')][_0x5af1('0xd')]({'port':0x232a});function respondWithRpcPromise(_0xfc5584,_0x712136,_0x334acd){return new BPromise(function(_0xa3ef0f,_0x12a3ce){return client['request'](_0xfc5584,_0x334acd)[_0x5af1('0xe')](function(_0x3852df){logger['info'](_0x5af1('0xf'),_0x712136,'request\x20sent');logger['debug'](_0x5af1('0x10'),_0x712136,_0x5af1('0x11'),JSON[_0x5af1('0x12')](_0x3852df));if(_0x3852df[_0x5af1('0x13')]){if(_0x3852df[_0x5af1('0x13')][_0x5af1('0x14')]===0x1f4){logger[_0x5af1('0x13')](_0x5af1('0xf'),_0x712136,_0x3852df[_0x5af1('0x13')][_0x5af1('0x15')]);return _0x12a3ce(_0x3852df[_0x5af1('0x13')][_0x5af1('0x15')]);}logger[_0x5af1('0x13')](_0x5af1('0xf'),_0x712136,_0x3852df[_0x5af1('0x13')][_0x5af1('0x15')]);return _0xa3ef0f(_0x3852df[_0x5af1('0x13')]['message']);}else{logger[_0x5af1('0x16')](_0x5af1('0xf'),_0x712136,_0x5af1('0x11'));_0xa3ef0f(_0x3852df[_0x5af1('0x17')]['message']);}})[_0x5af1('0x18')](function(_0x5890f9){logger[_0x5af1('0x13')](_0x5af1('0xf'),_0x712136,_0x5890f9);_0x12a3ce(_0x5890f9);});});}
\ No newline at end of file
diff --git a/server/api/cdr/index.js b/server/api/cdr/index.js
index 7d523c7..860eccf 100644
--- a/server/api/cdr/index.js
+++ b/server/api/cdr/index.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xd8b0=['destroy','exports','multer','util','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','isAuthenticated','index','get','describe','/:id','show','post','create','put','update'];(function(_0x13342f,_0x3d6303){var _0x2fc1fc=function(_0x2d991f){while(--_0x2d991f){_0x13342f['push'](_0x13342f['shift']());}};_0x2fc1fc(++_0x3d6303);}(_0xd8b0,0xad));var _0x0d8b=function(_0x122ef9,_0x451d2a){_0x122ef9=_0x122ef9-0x0;var _0x42fba0=_0xd8b0[_0x122ef9];return _0x42fba0;};'use strict';var multer=require(_0x0d8b('0x0'));var util=require(_0x0d8b('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0d8b('0x2')]();var fs_extra=require(_0x0d8b('0x3'));var auth=require(_0x0d8b('0x4'));var interaction=require(_0x0d8b('0x5'));var config=require(_0x0d8b('0x6'));var controller=require('./cdr.controller');router['get']('/',auth[_0x0d8b('0x7')](),controller[_0x0d8b('0x8')]);router[_0x0d8b('0x9')]('/describe',auth[_0x0d8b('0x7')](),controller[_0x0d8b('0xa')]);router['get'](_0x0d8b('0xb'),auth[_0x0d8b('0x7')](),controller[_0x0d8b('0xc')]);router[_0x0d8b('0xd')]('/',auth[_0x0d8b('0x7')](),controller[_0x0d8b('0xe')]);router[_0x0d8b('0xf')](_0x0d8b('0xb'),auth['isAuthenticated'](),controller[_0x0d8b('0x10')]);router['delete'](_0x0d8b('0xb'),auth[_0x0d8b('0x7')](),controller[_0x0d8b('0x11')]);module[_0x0d8b('0x12')]=router;
\ No newline at end of file
+var _0xd8b0=['destroy','exports','multer','util','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','isAuthenticated','index','get','describe','/:id','show','post','create','put','update'];(function(_0x415b51,_0x1a29ee){var _0x1dd82c=function(_0x25afee){while(--_0x25afee){_0x415b51['push'](_0x415b51['shift']());}};_0x1dd82c(++_0x1a29ee);}(_0xd8b0,0xad));var _0x0d8b=function(_0xa464c9,_0x7c86d8){_0xa464c9=_0xa464c9-0x0;var _0x3d73c4=_0xd8b0[_0xa464c9];return _0x3d73c4;};'use strict';var multer=require(_0x0d8b('0x0'));var util=require(_0x0d8b('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0d8b('0x2')]();var fs_extra=require(_0x0d8b('0x3'));var auth=require(_0x0d8b('0x4'));var interaction=require(_0x0d8b('0x5'));var config=require(_0x0d8b('0x6'));var controller=require('./cdr.controller');router['get']('/',auth[_0x0d8b('0x7')](),controller[_0x0d8b('0x8')]);router[_0x0d8b('0x9')]('/describe',auth[_0x0d8b('0x7')](),controller[_0x0d8b('0xa')]);router['get'](_0x0d8b('0xb'),auth[_0x0d8b('0x7')](),controller[_0x0d8b('0xc')]);router[_0x0d8b('0xd')]('/',auth[_0x0d8b('0x7')](),controller[_0x0d8b('0xe')]);router[_0x0d8b('0xf')](_0x0d8b('0xb'),auth['isAuthenticated'](),controller[_0x0d8b('0x10')]);router['delete'](_0x0d8b('0xb'),auth[_0x0d8b('0x7')](),controller[_0x0d8b('0x11')]);module[_0x0d8b('0x12')]=router;
\ No newline at end of file
diff --git a/server/api/chatApplication/chatApplication.attributes.js b/server/api/chatApplication/chatApplication.attributes.js
index affdb73..bd752af 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 _0x2363=['STRING','noop','TEXT','*,*,*,*','sequelize'];(function(_0xa464c9,_0x7c86d8){var _0x3d73c4=function(_0x5c2056){while(--_0x5c2056){_0xa464c9['push'](_0xa464c9['shift']());}};_0x3d73c4(++_0x7c86d8);}(_0x2363,0xdb));var _0x3236=function(_0x5d7e1b,_0x338596){_0x5d7e1b=_0x5d7e1b-0x0;var _0x35b11e=_0x2363[_0x5d7e1b];return _0x35b11e;};'use strict';var Sequelize=require(_0x3236('0x0'));module['exports']={'priority':{'type':Sequelize['INTEGER'],'allowNull':![]},'app':{'type':Sequelize[_0x3236('0x1')],'allowNull':![],'defaultValue':_0x3236('0x2')},'appdata':{'type':Sequelize[_0x3236('0x3')]()},'description':{'type':Sequelize[_0x3236('0x1')]},'interval':{'type':Sequelize[_0x3236('0x1')],'defaultValue':_0x3236('0x4')}};
\ No newline at end of file
+var _0x3d0d=['STRING','*,*,*,*','exports','INTEGER','noop'];(function(_0x118d7b,_0x20e8c5){var _0xff68a=function(_0x1badaf){while(--_0x1badaf){_0x118d7b['push'](_0x118d7b['shift']());}};_0xff68a(++_0x20e8c5);}(_0x3d0d,0x1ab));var _0xd3d0=function(_0x4273c9,_0x952a61){_0x4273c9=_0x4273c9-0x0;var _0x17c795=_0x3d0d[_0x4273c9];return _0x17c795;};'use strict';var Sequelize=require('sequelize');module[_0xd3d0('0x0')]={'priority':{'type':Sequelize[_0xd3d0('0x1')],'allowNull':![]},'app':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0xd3d0('0x2')},'appdata':{'type':Sequelize['TEXT']()},'description':{'type':Sequelize[_0xd3d0('0x3')]},'interval':{'type':Sequelize[_0xd3d0('0x3')],'defaultValue':_0xd3d0('0x4')}};
\ No newline at end of file
diff --git a/server/api/chatApplication/chatApplication.controller.js b/server/api/chatApplication/chatApplication.controller.js
index 4cb700e..2b67e15 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 _0x3451=['../../components/parsers/qs','../../components/parsers/advancedSearch','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','save','update','then','destroy','error','stack','name','send','show','params','model','keys','ChatApplication','rawAttributes','query','filters','intersection','fields','attributes','length','includeAll','include','merge','options','catch','body','find','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','crypto','jsforce','ioredis'];(function(_0x236691,_0x14a3e6){var _0x591821=function(_0x47f032){while(--_0x47f032){_0x236691['push'](_0x236691['shift']());}};_0x591821(++_0x14a3e6);}(_0x3451,0x19a));var _0x1345=function(_0x45bd8a,_0x4fd0e5){_0x45bd8a=_0x45bd8a-0x0;var _0x10f1a9=_0x3451[_0x45bd8a];return _0x10f1a9;};'use strict';var emlformat=require(_0x1345('0x0'));var rimraf=require(_0x1345('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x1345('0x2'));var rp=require(_0x1345('0x3'));var moment=require(_0x1345('0x4'));var BPromise=require(_0x1345('0x5'));var Mustache=require(_0x1345('0x6'));var util=require(_0x1345('0x7'));var path=require(_0x1345('0x8'));var sox=require(_0x1345('0x9'));var csv=require(_0x1345('0xa'));var ejs=require(_0x1345('0xb'));var fs=require('fs');var fs_extra=require(_0x1345('0xc'));var _=require(_0x1345('0xd'));var squel=require('squel');var crypto=require(_0x1345('0xe'));var jsforce=require(_0x1345('0xf'));var deskjs=require('desk.js');var toCsv=require(_0x1345('0xa'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x1345('0x10'));var authService=require('../../components/auth/service');var qs=require(_0x1345('0x11'));var as=require(_0x1345('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x1345('0x13'));var utils=require('../../config/utils');var config=require(_0x1345('0x14'));var licenseUtil=require(_0x1345('0x15'));var db=require(_0x1345('0x16'))['db'];function respondWithStatusCode(_0x3e1362,_0x528692){_0x528692=_0x528692||0xcc;return function(_0x3fdff0){if(_0x3fdff0){return _0x3e1362[_0x1345('0x17')](_0x528692);}return _0x3e1362[_0x1345('0x18')](_0x528692)[_0x1345('0x19')]();};}function respondWithResult(_0x4ea08a,_0x181a2b){_0x181a2b=_0x181a2b||0xc8;return function(_0x426e00){if(_0x426e00){return _0x4ea08a[_0x1345('0x18')](_0x181a2b)[_0x1345('0x1a')](_0x426e00);}};}function respondWithFilteredResult(_0x347591,_0x959544){return function(_0x3cd49e){if(_0x3cd49e){var _0x520e6c=typeof _0x959544[_0x1345('0x1b')]===_0x1345('0x1c')&&typeof _0x959544[_0x1345('0x1d')]==='undefined';var _0x5b4d04=_0x3cd49e[_0x1345('0x1e')];var _0x1afc89=_0x520e6c?0x0:_0x959544[_0x1345('0x1b')];var _0x1db636=_0x520e6c?_0x3cd49e['count']:_0x959544[_0x1345('0x1b')]+_0x959544[_0x1345('0x1d')];var _0x1f3746;if(_0x1db636>=_0x5b4d04){_0x1db636=_0x5b4d04;_0x1f3746=0xc8;}else{_0x1f3746=0xce;}_0x347591[_0x1345('0x18')](_0x1f3746);return _0x347591[_0x1345('0x1f')](_0x1345('0x20'),_0x1afc89+'-'+_0x1db636+'/'+_0x5b4d04)[_0x1345('0x1a')](_0x3cd49e);}return null;};}function patchUpdates(_0x43d209){return function(_0x3bc681){try{jsonpatch[_0x1345('0x21')](_0x3bc681,_0x43d209,!![]);}catch(_0x265ea8){return BPromise['reject'](_0x265ea8);}return _0x3bc681[_0x1345('0x22')]();};}function saveUpdates(_0x4855d7,_0xaf6ecc){return function(_0x217712){if(_0x217712){return _0x217712[_0x1345('0x23')](_0x4855d7)[_0x1345('0x24')](function(_0x422dd9){return _0x422dd9;});}return null;};}function removeEntity(_0x2fd7ca,_0x26c2a6){return function(_0x339ea9){if(_0x339ea9){return _0x339ea9[_0x1345('0x25')]()[_0x1345('0x24')](function(){_0x2fd7ca[_0x1345('0x18')](0xcc)['end']();});}};}function handleEntityNotFound(_0x346054,_0x4a390c){return function(_0xd08b03){if(!_0xd08b03){_0x346054[_0x1345('0x17')](0x194);}return _0xd08b03;};}function handleError(_0x11827a,_0x32f9a3){_0x32f9a3=_0x32f9a3||0x1f4;return function(_0x44aa74){logger[_0x1345('0x26')](_0x44aa74[_0x1345('0x27')]);if(_0x44aa74[_0x1345('0x28')]){delete _0x44aa74[_0x1345('0x28')];}_0x11827a[_0x1345('0x18')](_0x32f9a3)[_0x1345('0x29')](_0x44aa74);};}exports[_0x1345('0x2a')]=function(_0x483e75,_0x3ffbdc){var _0x50533b={'raw':!![],'where':{'id':_0x483e75[_0x1345('0x2b')]['id']}},_0x5ac56d={};_0x5ac56d[_0x1345('0x2c')]=_[_0x1345('0x2d')](db[_0x1345('0x2e')][_0x1345('0x2f')]);_0x5ac56d['query']=_[_0x1345('0x2d')](_0x483e75[_0x1345('0x30')]);_0x5ac56d[_0x1345('0x31')]=_['intersection'](_0x5ac56d[_0x1345('0x2c')],_0x5ac56d['query']);_0x50533b['attributes']=_[_0x1345('0x32')](_0x5ac56d[_0x1345('0x2c')],qs[_0x1345('0x33')](_0x483e75[_0x1345('0x30')]['fields']));_0x50533b[_0x1345('0x34')]=_0x50533b[_0x1345('0x34')][_0x1345('0x35')]?_0x50533b[_0x1345('0x34')]:_0x5ac56d[_0x1345('0x2c')];if(_0x483e75[_0x1345('0x30')][_0x1345('0x36')]){_0x50533b[_0x1345('0x37')]=[{'all':!![]}];}_0x50533b=_[_0x1345('0x38')]({},_0x50533b,_0x483e75[_0x1345('0x39')]);return db[_0x1345('0x2e')]['find'](_0x50533b)[_0x1345('0x24')](handleEntityNotFound(_0x3ffbdc,null))[_0x1345('0x24')](respondWithResult(_0x3ffbdc,null))[_0x1345('0x3a')](handleError(_0x3ffbdc,null));};exports[_0x1345('0x23')]=function(_0xdff44a,_0x4c0890){if(_0xdff44a[_0x1345('0x3b')]['id']){delete _0xdff44a['body']['id'];}return db['ChatApplication'][_0x1345('0x3c')]({'where':{'id':_0xdff44a[_0x1345('0x2b')]['id']}})[_0x1345('0x24')](handleEntityNotFound(_0x4c0890,null))['then'](saveUpdates(_0xdff44a[_0x1345('0x3b')],null))[_0x1345('0x24')](respondWithResult(_0x4c0890,null))[_0x1345('0x3a')](handleError(_0x4c0890,null));};exports[_0x1345('0x25')]=function(_0x3cf188,_0x358e97){return db[_0x1345('0x2e')]['find']({'where':{'id':_0x3cf188['params']['id']}})['then'](handleEntityNotFound(_0x358e97,null))['then'](removeEntity(_0x358e97,null))['catch'](handleError(_0x358e97,null));};
\ No newline at end of file
+var _0xb676=['ChatApplication','rawAttributes','query','filters','intersection','attributes','fields','length','includeAll','merge','options','catch','body','find','eml-format','zip-dir','fast-json-patch','request-promise','moment','util','path','to-csv','fs-extra','lodash','squel','jsforce','desk.js','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','count','set','Content-Range','apply','reject','save','update','then','destroy','stack','name','send','show','params','model','keys'];(function(_0x1dee62,_0x2bb420){var _0x30d9da=function(_0x2d11f0){while(--_0x2d11f0){_0x1dee62['push'](_0x1dee62['shift']());}};_0x30d9da(++_0x2bb420);}(_0xb676,0xbc));var _0x6b67=function(_0x381589,_0x27a707){_0x381589=_0x381589-0x0;var _0x2a075d=_0xb676[_0x381589];return _0x2a075d;};'use strict';var emlformat=require(_0x6b67('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x6b67('0x1'));var jsonpatch=require(_0x6b67('0x2'));var rp=require(_0x6b67('0x3'));var moment=require(_0x6b67('0x4'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x6b67('0x5'));var path=require(_0x6b67('0x6'));var sox=require('sox');var csv=require(_0x6b67('0x7'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x6b67('0x8'));var _=require(_0x6b67('0x9'));var squel=require(_0x6b67('0xa'));var crypto=require('crypto');var jsforce=require(_0x6b67('0xb'));var deskjs=require(_0x6b67('0xc'));var toCsv=require(_0x6b67('0x7'));var querystring=require('querystring');var Papa=require(_0x6b67('0xd'));var Redis=require(_0x6b67('0xe'));var authService=require('../../components/auth/service');var qs=require(_0x6b67('0xf'));var as=require(_0x6b67('0x10'));var hardwareService=require(_0x6b67('0x11'));var logger=require(_0x6b67('0x12'))('api');var utils=require(_0x6b67('0x13'));var config=require('../../config/environment');var licenseUtil=require(_0x6b67('0x14'));var db=require(_0x6b67('0x15'))['db'];function respondWithStatusCode(_0x1ebceb,_0x2ab6c5){_0x2ab6c5=_0x2ab6c5||0xcc;return function(_0x3e1bc6){if(_0x3e1bc6){return _0x1ebceb[_0x6b67('0x16')](_0x2ab6c5);}return _0x1ebceb[_0x6b67('0x17')](_0x2ab6c5)[_0x6b67('0x18')]();};}function respondWithResult(_0x2de534,_0x5fb6b3){_0x5fb6b3=_0x5fb6b3||0xc8;return function(_0x8a29a2){if(_0x8a29a2){return _0x2de534['status'](_0x5fb6b3)[_0x6b67('0x19')](_0x8a29a2);}};}function respondWithFilteredResult(_0x2213f4,_0x51e798){return function(_0x187fd4){if(_0x187fd4){var _0x1b6c60=typeof _0x51e798[_0x6b67('0x1a')]===_0x6b67('0x1b')&&typeof _0x51e798['limit']===_0x6b67('0x1b');var _0x46c44e=_0x187fd4[_0x6b67('0x1c')];var _0x46d828=_0x1b6c60?0x0:_0x51e798[_0x6b67('0x1a')];var _0x37d964=_0x1b6c60?_0x187fd4['count']:_0x51e798[_0x6b67('0x1a')]+_0x51e798['limit'];var _0x37cf6d;if(_0x37d964>=_0x46c44e){_0x37d964=_0x46c44e;_0x37cf6d=0xc8;}else{_0x37cf6d=0xce;}_0x2213f4[_0x6b67('0x17')](_0x37cf6d);return _0x2213f4[_0x6b67('0x1d')](_0x6b67('0x1e'),_0x46d828+'-'+_0x37d964+'/'+_0x46c44e)['json'](_0x187fd4);}return null;};}function patchUpdates(_0xd36be3){return function(_0x360208){try{jsonpatch[_0x6b67('0x1f')](_0x360208,_0xd36be3,!![]);}catch(_0x50fdfc){return BPromise[_0x6b67('0x20')](_0x50fdfc);}return _0x360208[_0x6b67('0x21')]();};}function saveUpdates(_0x1fedd5,_0x4d48e1){return function(_0xd4fda5){if(_0xd4fda5){return _0xd4fda5[_0x6b67('0x22')](_0x1fedd5)[_0x6b67('0x23')](function(_0x3a0a3f){return _0x3a0a3f;});}return null;};}function removeEntity(_0x393b3d,_0x17d27b){return function(_0x3c89d2){if(_0x3c89d2){return _0x3c89d2[_0x6b67('0x24')]()[_0x6b67('0x23')](function(){_0x393b3d[_0x6b67('0x17')](0xcc)[_0x6b67('0x18')]();});}};}function handleEntityNotFound(_0x47c927,_0x265245){return function(_0x3cffdf){if(!_0x3cffdf){_0x47c927[_0x6b67('0x16')](0x194);}return _0x3cffdf;};}function handleError(_0x5dca55,_0x2b67f6){_0x2b67f6=_0x2b67f6||0x1f4;return function(_0x1c73b0){logger['error'](_0x1c73b0[_0x6b67('0x25')]);if(_0x1c73b0[_0x6b67('0x26')]){delete _0x1c73b0[_0x6b67('0x26')];}_0x5dca55[_0x6b67('0x17')](_0x2b67f6)[_0x6b67('0x27')](_0x1c73b0);};}exports[_0x6b67('0x28')]=function(_0x3b65af,_0x5d9f6d){var _0x320a70={'raw':!![],'where':{'id':_0x3b65af[_0x6b67('0x29')]['id']}},_0x433881={};_0x433881[_0x6b67('0x2a')]=_[_0x6b67('0x2b')](db[_0x6b67('0x2c')][_0x6b67('0x2d')]);_0x433881[_0x6b67('0x2e')]=_['keys'](_0x3b65af[_0x6b67('0x2e')]);_0x433881[_0x6b67('0x2f')]=_[_0x6b67('0x30')](_0x433881[_0x6b67('0x2a')],_0x433881[_0x6b67('0x2e')]);_0x320a70[_0x6b67('0x31')]=_['intersection'](_0x433881['model'],qs[_0x6b67('0x32')](_0x3b65af[_0x6b67('0x2e')][_0x6b67('0x32')]));_0x320a70[_0x6b67('0x31')]=_0x320a70['attributes'][_0x6b67('0x33')]?_0x320a70['attributes']:_0x433881[_0x6b67('0x2a')];if(_0x3b65af[_0x6b67('0x2e')][_0x6b67('0x34')]){_0x320a70['include']=[{'all':!![]}];}_0x320a70=_[_0x6b67('0x35')]({},_0x320a70,_0x3b65af[_0x6b67('0x36')]);return db[_0x6b67('0x2c')]['find'](_0x320a70)[_0x6b67('0x23')](handleEntityNotFound(_0x5d9f6d,null))[_0x6b67('0x23')](respondWithResult(_0x5d9f6d,null))[_0x6b67('0x37')](handleError(_0x5d9f6d,null));};exports[_0x6b67('0x22')]=function(_0x4c3a86,_0x2092f6){if(_0x4c3a86[_0x6b67('0x38')]['id']){delete _0x4c3a86[_0x6b67('0x38')]['id'];}return db[_0x6b67('0x2c')][_0x6b67('0x39')]({'where':{'id':_0x4c3a86[_0x6b67('0x29')]['id']}})[_0x6b67('0x23')](handleEntityNotFound(_0x2092f6,null))[_0x6b67('0x23')](saveUpdates(_0x4c3a86['body'],null))[_0x6b67('0x23')](respondWithResult(_0x2092f6,null))[_0x6b67('0x37')](handleError(_0x2092f6,null));};exports[_0x6b67('0x24')]=function(_0x4d259f,_0x3889ef){return db[_0x6b67('0x2c')][_0x6b67('0x39')]({'where':{'id':_0x4d259f[_0x6b67('0x29')]['id']}})['then'](handleEntityNotFound(_0x3889ef,null))['then'](removeEntity(_0x3889ef,null))[_0x6b67('0x37')](handleError(_0x3889ef,null));};
\ No newline at end of file
diff --git a/server/api/chatApplication/chatApplication.model.js b/server/api/chatApplication/chatApplication.model.js
index 7d28ce9..d2f16f1 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 _0x193f=['ChatApplication','chat_applications','utf8mb4','lodash','util','../../config/logger','api','bluebird','request-promise','path','./chatApplication.attributes','exports','define'];(function(_0x2b6fb8,_0x32dde8){var _0x1e0bfa=function(_0x24db53){while(--_0x24db53){_0x2b6fb8['push'](_0x2b6fb8['shift']());}};_0x1e0bfa(++_0x32dde8);}(_0x193f,0x9f));var _0xf193=function(_0x1a7846,_0x59723e){_0x1a7846=_0x1a7846-0x0;var _0x48049=_0x193f[_0x1a7846];return _0x48049;};'use strict';var _=require(_0xf193('0x0'));var util=require(_0xf193('0x1'));var logger=require(_0xf193('0x2'))(_0xf193('0x3'));var moment=require('moment');var BPromise=require(_0xf193('0x4'));var rp=require(_0xf193('0x5'));var fs=require('fs');var path=require(_0xf193('0x6'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0xf193('0x7'));module[_0xf193('0x8')]=function(_0x453dd9,_0x11133d){return _0x453dd9[_0xf193('0x9')](_0xf193('0xa'),attributes,{'tableName':_0xf193('0xb'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0xf193('0xc'),'collate':'utf8mb4_unicode_ci'});};
\ No newline at end of file
+var _0x2d81=['bluebird','request-promise','path','rimraf','../../config/environment','./chatApplication.attributes','exports','define','ChatApplication','utf8mb4','utf8mb4_unicode_ci','lodash','util','moment'];(function(_0x32db9b,_0x5b7316){var _0x381e82=function(_0xb2c7a9){while(--_0xb2c7a9){_0x32db9b['push'](_0x32db9b['shift']());}};_0x381e82(++_0x5b7316);}(_0x2d81,0xeb));var _0x12d8=function(_0x4a7dac,_0x4ccf3c){_0x4a7dac=_0x4a7dac-0x0;var _0x2278b3=_0x2d81[_0x4a7dac];return _0x2278b3;};'use strict';var _=require(_0x12d8('0x0'));var util=require(_0x12d8('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0x12d8('0x2'));var BPromise=require(_0x12d8('0x3'));var rp=require(_0x12d8('0x4'));var fs=require('fs');var path=require(_0x12d8('0x5'));var rimraf=require(_0x12d8('0x6'));var config=require(_0x12d8('0x7'));var attributes=require(_0x12d8('0x8'));module[_0x12d8('0x9')]=function(_0x422f85,_0xd801a0){return _0x422f85[_0x12d8('0xa')](_0x12d8('0xb'),attributes,{'tableName':'chat_applications','paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x12d8('0xc'),'collate':_0x12d8('0xd')});};
\ No newline at end of file
diff --git a/server/api/chatApplication/chatApplication.rpc.js b/server/api/chatApplication/chatApplication.rpc.js
index db93bf8..2f7f30e 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 _0x5e3f=['info','ChatApplication,\x20%s,\x20%s','request\x20sent','ChatApplication,\x20%s,\x20%s,\x20%s','stringify','code','error','message','catch','lodash','util','moment','bluebird','ioredis','../../mysqldb','rpc','http','request','then'];(function(_0x4817f9,_0x4070d1){var _0x2dcfa6=function(_0x408973){while(--_0x408973){_0x4817f9['push'](_0x4817f9['shift']());}};_0x2dcfa6(++_0x4070d1);}(_0x5e3f,0x8e));var _0xf5e3=function(_0x1b027d,_0x3f3822){_0x1b027d=_0x1b027d-0x0;var _0x41f54a=_0x5e3f[_0x1b027d];return _0x41f54a;};'use strict';var _=require(_0xf5e3('0x0'));var util=require(_0xf5e3('0x1'));var moment=require(_0xf5e3('0x2'));var BPromise=require(_0xf5e3('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xf5e3('0x4'));var db=require(_0xf5e3('0x5'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0xf5e3('0x6'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson['client'][_0xf5e3('0x7')]({'port':0x232a});function respondWithRpcPromise(_0xb1f50a,_0x36c42a,_0xc9ce0){return new BPromise(function(_0x864b7f,_0x3ef200){return client[_0xf5e3('0x8')](_0xb1f50a,_0xc9ce0)[_0xf5e3('0x9')](function(_0x54ebfe){logger[_0xf5e3('0xa')](_0xf5e3('0xb'),_0x36c42a,_0xf5e3('0xc'));logger['debug'](_0xf5e3('0xd'),_0x36c42a,_0xf5e3('0xc'),JSON[_0xf5e3('0xe')](_0x54ebfe));if(_0x54ebfe['error']){if(_0x54ebfe['error'][_0xf5e3('0xf')]===0x1f4){logger['error'](_0xf5e3('0xb'),_0x36c42a,_0x54ebfe[_0xf5e3('0x10')][_0xf5e3('0x11')]);return _0x3ef200(_0x54ebfe['error']['message']);}logger['error'](_0xf5e3('0xb'),_0x36c42a,_0x54ebfe[_0xf5e3('0x10')][_0xf5e3('0x11')]);return _0x864b7f(_0x54ebfe[_0xf5e3('0x10')][_0xf5e3('0x11')]);}else{logger['info'](_0xf5e3('0xb'),_0x36c42a,_0xf5e3('0xc'));_0x864b7f(_0x54ebfe['result'][_0xf5e3('0x11')]);}})[_0xf5e3('0x12')](function(_0x3a3dcc){logger[_0xf5e3('0x10')](_0xf5e3('0xb'),_0x36c42a,_0x3a3dcc);_0x3ef200(_0x3a3dcc);});});}
\ No newline at end of file
+var _0x4939=['http','then','ChatApplication,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','info','catch','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','rpc','../../config/environment'];(function(_0x47568e,_0x5ccdaf){var _0x33815b=function(_0x56b026){while(--_0x56b026){_0x47568e['push'](_0x47568e['shift']());}};_0x33815b(++_0x5ccdaf);}(_0x4939,0x106));var _0x9493=function(_0x38b45a,_0x531f13){_0x38b45a=_0x38b45a-0x0;var _0x2060cd=_0x4939[_0x38b45a];return _0x2060cd;};'use strict';var _=require(_0x9493('0x0'));var util=require(_0x9493('0x1'));var moment=require('moment');var BPromise=require(_0x9493('0x2'));var rs=require(_0x9493('0x3'));var fs=require('fs');var Redis=require(_0x9493('0x4'));var db=require(_0x9493('0x5'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x9493('0x6'));var config=require(_0x9493('0x7'));var jayson=require('jayson/promise');var client=jayson['client'][_0x9493('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x3a4a54,_0x707bd4,_0xc46b9){return new BPromise(function(_0x37cd6f,_0xb4be9c){return client['request'](_0x3a4a54,_0xc46b9)[_0x9493('0x9')](function(_0x345ff6){logger['info'](_0x9493('0xa'),_0x707bd4,_0x9493('0xb'));logger['debug']('ChatApplication,\x20%s,\x20%s,\x20%s',_0x707bd4,_0x9493('0xb'),JSON[_0x9493('0xc')](_0x345ff6));if(_0x345ff6[_0x9493('0xd')]){if(_0x345ff6[_0x9493('0xd')][_0x9493('0xe')]===0x1f4){logger[_0x9493('0xd')](_0x9493('0xa'),_0x707bd4,_0x345ff6['error'][_0x9493('0xf')]);return _0xb4be9c(_0x345ff6[_0x9493('0xd')][_0x9493('0xf')]);}logger[_0x9493('0xd')](_0x9493('0xa'),_0x707bd4,_0x345ff6[_0x9493('0xd')][_0x9493('0xf')]);return _0x37cd6f(_0x345ff6[_0x9493('0xd')][_0x9493('0xf')]);}else{logger[_0x9493('0x10')](_0x9493('0xa'),_0x707bd4,_0x9493('0xb'));_0x37cd6f(_0x345ff6['result'][_0x9493('0xf')]);}})[_0x9493('0x11')](function(_0x358bda){logger[_0x9493('0xd')](_0x9493('0xa'),_0x707bd4,_0x358bda);_0xb4be9c(_0x358bda);});});}
\ No newline at end of file
diff --git a/server/api/chatApplication/index.js b/server/api/chatApplication/index.js
index abd5c81..3d1f3b2 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 _0xea67=['exports','multer','util','path','connect-timeout','express','fs-extra','../../components/auth/service','../../config/environment','./chatApplication.controller','get','isAuthenticated','show','put','/:id','update','delete','destroy'];(function(_0x20ed10,_0x2d62b3){var _0x5dfa78=function(_0x28d2e8){while(--_0x28d2e8){_0x20ed10['push'](_0x20ed10['shift']());}};_0x5dfa78(++_0x2d62b3);}(_0xea67,0x133));var _0x7ea6=function(_0x56e813,_0x2f7fe0){_0x56e813=_0x56e813-0x0;var _0x2ae2a4=_0xea67[_0x56e813];return _0x2ae2a4;};'use strict';var multer=require(_0x7ea6('0x0'));var util=require(_0x7ea6('0x1'));var path=require(_0x7ea6('0x2'));var timeout=require(_0x7ea6('0x3'));var express=require(_0x7ea6('0x4'));var router=express['Router']();var fs_extra=require(_0x7ea6('0x5'));var auth=require(_0x7ea6('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0x7ea6('0x7'));var controller=require(_0x7ea6('0x8'));router[_0x7ea6('0x9')]('/:id',auth[_0x7ea6('0xa')](),controller[_0x7ea6('0xb')]);router[_0x7ea6('0xc')](_0x7ea6('0xd'),auth[_0x7ea6('0xa')](),controller[_0x7ea6('0xe')]);router[_0x7ea6('0xf')](_0x7ea6('0xd'),auth[_0x7ea6('0xa')](),controller[_0x7ea6('0x10')]);module[_0x7ea6('0x11')]=router;
\ No newline at end of file
+var _0x5dd7=['../../config/environment','/:id','isAuthenticated','update','delete','destroy','exports','multer','express','fs-extra','../../components/auth/service','../../components/interaction/service'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x5dd7,0x1b7));var _0x75dd=function(_0x4d4330,_0x838446){_0x4d4330=_0x4d4330-0x0;var _0x11b116=_0x5dd7[_0x4d4330];return _0x11b116;};'use strict';var multer=require(_0x75dd('0x0'));var util=require('util');var path=require('path');var timeout=require('connect-timeout');var express=require(_0x75dd('0x1'));var router=express['Router']();var fs_extra=require(_0x75dd('0x2'));var auth=require(_0x75dd('0x3'));var interaction=require(_0x75dd('0x4'));var config=require(_0x75dd('0x5'));var controller=require('./chatApplication.controller');router['get'](_0x75dd('0x6'),auth['isAuthenticated'](),controller['show']);router['put'](_0x75dd('0x6'),auth[_0x75dd('0x7')](),controller[_0x75dd('0x8')]);router[_0x75dd('0x9')](_0x75dd('0x6'),auth['isAuthenticated'](),controller[_0x75dd('0xa')]);module[_0x75dd('0xb')]=router;
\ No newline at end of file
diff --git a/server/api/chatGroup/chatGroup.attributes.js b/server/api/chatGroup/chatGroup.attributes.js
index 1ffb2d7..7a12140 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 _0x14c5=['STRING','BOOLEAN','sequelize','exports'];(function(_0x46a6f4,_0x86f0a5){var _0x3ad8f7=function(_0x2fabd2){while(--_0x2fabd2){_0x46a6f4['push'](_0x46a6f4['shift']());}};_0x3ad8f7(++_0x86f0a5);}(_0x14c5,0x1de));var _0x514c=function(_0x33556a,_0x1a5894){_0x33556a=_0x33556a-0x0;var _0x5f3384=_0x14c5[_0x33556a];return _0x5f3384;};'use strict';var Sequelize=require(_0x514c('0x0'));module[_0x514c('0x1')]={'name':{'type':Sequelize[_0x514c('0x2')],'allowNull':![]},'description':{'type':Sequelize['STRING']},'write':{'type':Sequelize[_0x514c('0x3')],'defaultValue':!![]}};
\ No newline at end of file
+var _0x3024=['sequelize','exports','STRING','BOOLEAN'];(function(_0x4c55c,_0x4d2e23){var _0x58c641=function(_0x1d1112){while(--_0x1d1112){_0x4c55c['push'](_0x4c55c['shift']());}};_0x58c641(++_0x4d2e23);}(_0x3024,0x64));var _0x4302=function(_0x23c803,_0x124b92){_0x23c803=_0x23c803-0x0;var _0x17c4a1=_0x3024[_0x23c803];return _0x17c4a1;};'use strict';var Sequelize=require(_0x4302('0x0'));module[_0x4302('0x1')]={'name':{'type':Sequelize['STRING'],'allowNull':![]},'description':{'type':Sequelize[_0x4302('0x2')]},'write':{'type':Sequelize[_0x4302('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 4bf2f2e..b189e76 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 _0x95eb=['filters','pick','filter','merge','VIRTUAL','options','findAll','rows','catch','show','params','includeAll','include','find','create','body','describe','getUnread','user','toInteger','addMembers','ids','omit','getMembers','findOne','User','order','removeMembers','addMessage','ChatInternalMessage','getMessages','$gte','split','format','YYYY-MM-DD\x20HH:mm:ss','eml-format','fast-json-patch','request-promise','bluebird','mustache','util','sox','to-csv','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','redis','defaults','socket.io-emitter','register','status','end','json','offset','undefined','count','limit','set','Content-Range','apply','save','update','then','destroy','error','stack','name','map','ChatGroup','rawAttributes','fieldName','type','key','model','keys','query','attributes','intersection','fields','length','nolimit','sort','where'];(function(_0x3ddb52,_0x7790cf){var _0x378940=function(_0x49dbbb){while(--_0x49dbbb){_0x3ddb52['push'](_0x3ddb52['shift']());}};_0x378940(++_0x7790cf);}(_0x95eb,0xe7));var _0xb95e=function(_0x30764f,_0x548374){_0x30764f=_0x30764f-0x0;var _0x11d9f7=_0x95eb[_0x30764f];return _0x11d9f7;};'use strict';var emlformat=require(_0xb95e('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0xb95e('0x1'));var rp=require(_0xb95e('0x2'));var moment=require('moment');var BPromise=require(_0xb95e('0x3'));var Mustache=require(_0xb95e('0x4'));var util=require(_0xb95e('0x5'));var path=require('path');var sox=require(_0xb95e('0x6'));var csv=require(_0xb95e('0x7'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xb95e('0x8'));var _=require(_0xb95e('0x9'));var squel=require(_0xb95e('0xa'));var crypto=require(_0xb95e('0xb'));var jsforce=require(_0xb95e('0xc'));var deskjs=require(_0xb95e('0xd'));var toCsv=require('to-csv');var querystring=require(_0xb95e('0xe'));var Papa=require(_0xb95e('0xf'));var Redis=require(_0xb95e('0x10'));var authService=require(_0xb95e('0x11'));var qs=require(_0xb95e('0x12'));var as=require(_0xb95e('0x13'));var hardwareService=require(_0xb95e('0x14'));var logger=require(_0xb95e('0x15'))('api');var utils=require(_0xb95e('0x16'));var config=require(_0xb95e('0x17'));var licenseUtil=require(_0xb95e('0x18'));var db=require(_0xb95e('0x19'))['db'];config[_0xb95e('0x1a')]=_[_0xb95e('0x1b')](config[_0xb95e('0x1a')],{'host':'localhost','port':0x18eb});var socket=require(_0xb95e('0x1c'))(new Redis(config[_0xb95e('0x1a')]));require('./chatGroup.socket')[_0xb95e('0x1d')](socket);function respondWithStatusCode(_0x4431d4,_0x4fbf5d){_0x4fbf5d=_0x4fbf5d||0xcc;return function(_0x42d963){if(_0x42d963){return _0x4431d4['sendStatus'](_0x4fbf5d);}return _0x4431d4[_0xb95e('0x1e')](_0x4fbf5d)[_0xb95e('0x1f')]();};}function respondWithResult(_0x3988e0,_0x2ec8b0){_0x2ec8b0=_0x2ec8b0||0xc8;return function(_0x5275c5){if(_0x5275c5){return _0x3988e0[_0xb95e('0x1e')](_0x2ec8b0)[_0xb95e('0x20')](_0x5275c5);}};}function respondWithFilteredResult(_0x5ea699,_0x5c9cec){return function(_0x16675d){if(_0x16675d){var _0x4d7b95=typeof _0x5c9cec[_0xb95e('0x21')]===_0xb95e('0x22')&&typeof _0x5c9cec['limit']===_0xb95e('0x22');var _0x15354f=_0x16675d['count'];var _0x3cd013=_0x4d7b95?0x0:_0x5c9cec['offset'];var _0x2505a4=_0x4d7b95?_0x16675d[_0xb95e('0x23')]:_0x5c9cec[_0xb95e('0x21')]+_0x5c9cec[_0xb95e('0x24')];var _0x19907d;if(_0x2505a4>=_0x15354f){_0x2505a4=_0x15354f;_0x19907d=0xc8;}else{_0x19907d=0xce;}_0x5ea699[_0xb95e('0x1e')](_0x19907d);return _0x5ea699[_0xb95e('0x25')](_0xb95e('0x26'),_0x3cd013+'-'+_0x2505a4+'/'+_0x15354f)[_0xb95e('0x20')](_0x16675d);}return null;};}function patchUpdates(_0x5af847){return function(_0x2560e4){try{jsonpatch[_0xb95e('0x27')](_0x2560e4,_0x5af847,!![]);}catch(_0x3e17ef){return BPromise['reject'](_0x3e17ef);}return _0x2560e4[_0xb95e('0x28')]();};}function saveUpdates(_0x5d1b82,_0x5ce931){return function(_0x28b953){if(_0x28b953){return _0x28b953[_0xb95e('0x29')](_0x5d1b82)[_0xb95e('0x2a')](function(_0x548dcb){return _0x548dcb;});}return null;};}function removeEntity(_0x4fadf6,_0x2c444a){return function(_0x3f9955){if(_0x3f9955){return _0x3f9955[_0xb95e('0x2b')]()[_0xb95e('0x2a')](function(){_0x4fadf6[_0xb95e('0x1e')](0xcc)['end']();});}};}function handleEntityNotFound(_0x3e118a,_0x36bcbf){return function(_0x576856){if(!_0x576856){_0x3e118a['sendStatus'](0x194);}return _0x576856;};}function handleError(_0x1c59d2,_0x11364a){_0x11364a=_0x11364a||0x1f4;return function(_0x1afd60){logger[_0xb95e('0x2c')](_0x1afd60[_0xb95e('0x2d')]);if(_0x1afd60['name']){delete _0x1afd60[_0xb95e('0x2e')];}_0x1c59d2[_0xb95e('0x1e')](_0x11364a)['send'](_0x1afd60);};}exports['index']=function(_0x9bf7d5,_0x598423){var _0x35f9d2={},_0x495b6d={},_0x9a9047={'count':0x0,'rows':[]};var _0x2a72b2=_[_0xb95e('0x2f')](db[_0xb95e('0x30')][_0xb95e('0x31')],function(_0x5022c9){return{'name':_0x5022c9[_0xb95e('0x32')],'type':_0x5022c9[_0xb95e('0x33')][_0xb95e('0x34')]};});_0x495b6d[_0xb95e('0x35')]=_[_0xb95e('0x2f')](_0x2a72b2,_0xb95e('0x2e'));_0x495b6d['query']=_[_0xb95e('0x36')](_0x9bf7d5[_0xb95e('0x37')]);_0x495b6d['filters']=_['intersection'](_0x495b6d['model'],_0x495b6d['query']);_0x35f9d2[_0xb95e('0x38')]=_[_0xb95e('0x39')](_0x495b6d[_0xb95e('0x35')],qs[_0xb95e('0x3a')](_0x9bf7d5[_0xb95e('0x37')]['fields']));_0x35f9d2['attributes']=_0x35f9d2[_0xb95e('0x38')][_0xb95e('0x3b')]?_0x35f9d2[_0xb95e('0x38')]:_0x495b6d[_0xb95e('0x35')];if(!_0x9bf7d5[_0xb95e('0x37')]['hasOwnProperty'](_0xb95e('0x3c'))){_0x35f9d2[_0xb95e('0x24')]=qs[_0xb95e('0x24')](_0x9bf7d5[_0xb95e('0x37')][_0xb95e('0x24')]);_0x35f9d2[_0xb95e('0x21')]=qs[_0xb95e('0x21')](_0x9bf7d5[_0xb95e('0x37')][_0xb95e('0x21')]);}_0x35f9d2['order']=qs[_0xb95e('0x3d')](_0x9bf7d5[_0xb95e('0x37')][_0xb95e('0x3d')]);_0x35f9d2[_0xb95e('0x3e')]=qs[_0xb95e('0x3f')](_[_0xb95e('0x40')](_0x9bf7d5['query'],_0x495b6d[_0xb95e('0x3f')]),_0x2a72b2);if(_0x9bf7d5['query'][_0xb95e('0x41')]){_0x35f9d2['where']=_[_0xb95e('0x42')](_0x35f9d2[_0xb95e('0x3e')],{'$or':_[_0xb95e('0x2f')](_0x2a72b2,function(_0x29fe79){if(_0x29fe79[_0xb95e('0x33')]!==_0xb95e('0x43')){var _0x2e35af={};_0x2e35af[_0x29fe79[_0xb95e('0x2e')]]={'$like':'%'+_0x9bf7d5['query'][_0xb95e('0x41')]+'%'};return _0x2e35af;}})});}_0x35f9d2=_[_0xb95e('0x42')]({},_0x35f9d2,_0x9bf7d5[_0xb95e('0x44')]);var _0x266108={'where':_0x35f9d2[_0xb95e('0x3e')]};return db['ChatGroup'][_0xb95e('0x23')](_0x266108)[_0xb95e('0x2a')](function(_0x5d7b4a){_0x9a9047[_0xb95e('0x23')]=_0x5d7b4a;if(_0x9bf7d5[_0xb95e('0x37')]['includeAll']){_0x35f9d2['include']=[{'all':!![]}];}return db[_0xb95e('0x30')][_0xb95e('0x45')](_0x35f9d2);})[_0xb95e('0x2a')](function(_0x2a48f2){_0x9a9047[_0xb95e('0x46')]=_0x2a48f2;return _0x9a9047;})['then'](respondWithFilteredResult(_0x598423,_0x35f9d2))[_0xb95e('0x47')](handleError(_0x598423,null));};exports[_0xb95e('0x48')]=function(_0x408174,_0x18481a){var _0x425649={'raw':!![],'where':{'id':_0x408174[_0xb95e('0x49')]['id']}},_0x566571={};_0x566571[_0xb95e('0x35')]=_['keys'](db['ChatGroup'][_0xb95e('0x31')]);_0x566571[_0xb95e('0x37')]=_[_0xb95e('0x36')](_0x408174[_0xb95e('0x37')]);_0x566571['filters']=_['intersection'](_0x566571[_0xb95e('0x35')],_0x566571[_0xb95e('0x37')]);_0x425649[_0xb95e('0x38')]=_[_0xb95e('0x39')](_0x566571[_0xb95e('0x35')],qs['fields'](_0x408174['query']['fields']));_0x425649['attributes']=_0x425649['attributes'][_0xb95e('0x3b')]?_0x425649[_0xb95e('0x38')]:_0x566571['model'];if(_0x408174['query'][_0xb95e('0x4a')]){_0x425649[_0xb95e('0x4b')]=[{'all':!![]}];}_0x425649=_[_0xb95e('0x42')]({},_0x425649,_0x408174[_0xb95e('0x44')]);return db[_0xb95e('0x30')][_0xb95e('0x4c')](_0x425649)[_0xb95e('0x2a')](handleEntityNotFound(_0x18481a,null))['then'](respondWithResult(_0x18481a,null))[_0xb95e('0x47')](handleError(_0x18481a,null));};exports[_0xb95e('0x4d')]=function(_0x5827e3,_0x2cea8f){return db[_0xb95e('0x30')][_0xb95e('0x4d')](_0x5827e3['body'],{})[_0xb95e('0x2a')](respondWithResult(_0x2cea8f,0xc9))[_0xb95e('0x47')](handleError(_0x2cea8f,null));};exports[_0xb95e('0x29')]=function(_0x434acb,_0x2a28d9){if(_0x434acb[_0xb95e('0x4e')]['id']){delete _0x434acb[_0xb95e('0x4e')]['id'];}return db[_0xb95e('0x30')]['find']({'where':{'id':_0x434acb['params']['id']}})[_0xb95e('0x2a')](handleEntityNotFound(_0x2a28d9,null))[_0xb95e('0x2a')](saveUpdates(_0x434acb[_0xb95e('0x4e')],null))[_0xb95e('0x2a')](respondWithResult(_0x2a28d9,null))[_0xb95e('0x47')](handleError(_0x2a28d9,null));};exports[_0xb95e('0x2b')]=function(_0x25e9aa,_0x17d3d9){return db['ChatGroup']['find']({'where':{'id':_0x25e9aa[_0xb95e('0x49')]['id']}})[_0xb95e('0x2a')](handleEntityNotFound(_0x17d3d9,null))['then'](removeEntity(_0x17d3d9,null))[_0xb95e('0x47')](handleError(_0x17d3d9,null));};exports[_0xb95e('0x4f')]=function(_0x2771ec,_0x398026){return db['ChatGroup'][_0xb95e('0x4f')]()['then'](respondWithResult(_0x398026,null))[_0xb95e('0x47')](handleError(_0x398026,null));};exports[_0xb95e('0x50')]=function(_0x469f12,_0x2144df,_0x14c520){return db['ChatInternalMessage'][_0xb95e('0x23')]({'where':{'ChatGroupId':_0x469f12[_0xb95e('0x49')]['id'],'ToId':_0x469f12[_0xb95e('0x51')]['id'],'read':![]}})[_0xb95e('0x2a')](function(_0x154145){return{'id':_[_0xb95e('0x52')](_0x469f12['params']['id']),'count':_0x154145};})[_0xb95e('0x2a')](respondWithResult(_0x2144df,null))[_0xb95e('0x47')](handleError(_0x2144df,null));};exports[_0xb95e('0x53')]=function(_0xb1533d,_0x1ae9ee,_0x18f8c9){return db[_0xb95e('0x30')]['find']({'where':{'id':_0xb1533d['params']['id']}})[_0xb95e('0x2a')](handleEntityNotFound(_0x1ae9ee,null))['then'](function(_0x455f43){if(_0x455f43){return _0x455f43[_0xb95e('0x53')](_0xb1533d['body'][_0xb95e('0x54')],_[_0xb95e('0x55')](_0xb1533d[_0xb95e('0x4e')],['ids','id'])||{});}})['then'](respondWithResult(_0x1ae9ee,null))['catch'](handleError(_0x1ae9ee,null));};exports[_0xb95e('0x56')]=function(_0x26fffd,_0x368a4c,_0xeb4539){var _0x5daf09={};var _0x33a570={};var _0x482768;var _0x5c41cd;return db[_0xb95e('0x30')][_0xb95e('0x57')]({'where':{'id':_0x26fffd[_0xb95e('0x49')]['id']}})['then'](handleEntityNotFound(_0x368a4c,null))[_0xb95e('0x2a')](function(_0x30f5da){if(_0x30f5da){_0x482768=_0x30f5da;_0x33a570[_0xb95e('0x35')]=_[_0xb95e('0x36')](db[_0xb95e('0x58')][_0xb95e('0x31')]);_0x33a570[_0xb95e('0x37')]=_[_0xb95e('0x36')](_0x26fffd['query']);_0x33a570[_0xb95e('0x3f')]=_[_0xb95e('0x39')](_0x33a570[_0xb95e('0x35')],_0x33a570['query']);_0x5daf09[_0xb95e('0x38')]=_[_0xb95e('0x39')](_0x33a570[_0xb95e('0x35')],qs[_0xb95e('0x3a')](_0x26fffd[_0xb95e('0x37')][_0xb95e('0x3a')]));_0x5daf09['attributes']=_0x5daf09[_0xb95e('0x38')][_0xb95e('0x3b')]?_0x5daf09[_0xb95e('0x38')]:_0x33a570[_0xb95e('0x35')];_0x5daf09[_0xb95e('0x59')]=qs[_0xb95e('0x3d')](_0x26fffd[_0xb95e('0x37')][_0xb95e('0x3d')]);_0x5daf09[_0xb95e('0x3e')]=qs[_0xb95e('0x3f')](_[_0xb95e('0x40')](_0x26fffd[_0xb95e('0x37')],_0x33a570[_0xb95e('0x3f')]));if(_0x26fffd[_0xb95e('0x37')][_0xb95e('0x41')]){_0x5daf09[_0xb95e('0x3e')]=_[_0xb95e('0x42')](_0x5daf09[_0xb95e('0x3e')],{'$or':_[_0xb95e('0x2f')](_0x5daf09[_0xb95e('0x38')],function(_0x354e1c){var _0xb89dbe={};_0xb89dbe[_0x354e1c]={'$like':'%'+_0x26fffd['query'][_0xb95e('0x41')]+'%'};return _0xb89dbe;})});}_0x5daf09=_[_0xb95e('0x42')]({},_0x5daf09,_0x26fffd[_0xb95e('0x44')]);return _0x482768[_0xb95e('0x56')](_0x5daf09);}})[_0xb95e('0x2a')](function(_0x37d2d5){if(_0x37d2d5){_0x5c41cd=_0x37d2d5['length'];if(!_0x26fffd[_0xb95e('0x37')]['hasOwnProperty']('nolimit')){_0x5daf09[_0xb95e('0x24')]=qs[_0xb95e('0x24')](_0x26fffd[_0xb95e('0x37')]['limit']);_0x5daf09[_0xb95e('0x21')]=qs[_0xb95e('0x21')](_0x26fffd[_0xb95e('0x37')][_0xb95e('0x21')]);}return _0x482768[_0xb95e('0x56')](_0x5daf09);}})['then'](function(_0x4cc383){if(_0x4cc383){return _0x4cc383?{'count':_0x5c41cd,'rows':_0x4cc383}:null;}})[_0xb95e('0x2a')](respondWithResult(_0x368a4c,null))[_0xb95e('0x47')](handleError(_0x368a4c,null));};exports[_0xb95e('0x5a')]=function(_0x24d8ae,_0x490d23,_0x58d3be){return db[_0xb95e('0x30')][_0xb95e('0x4c')]({'where':{'id':_0x24d8ae[_0xb95e('0x49')]['id']}})['then'](handleEntityNotFound(_0x490d23,null))[_0xb95e('0x2a')](function(_0x30c277){if(_0x30c277){return _0x30c277['removeMembers'](_0x24d8ae[_0xb95e('0x37')][_0xb95e('0x54')]);}})[_0xb95e('0x2a')](respondWithStatusCode(_0x490d23,null))[_0xb95e('0x47')](handleError(_0x490d23,null));};exports[_0xb95e('0x5b')]=function(_0x4d4b87,_0x302556,_0xbf81ab){if(_0x4d4b87[_0xb95e('0x4e')]['id']){delete _0x4d4b87[_0xb95e('0x4e')]['id'];}return db[_0xb95e('0x30')][_0xb95e('0x4c')]({'where':{'id':_0x4d4b87[_0xb95e('0x49')]['id']}})[_0xb95e('0x2a')](handleEntityNotFound(_0x302556,null))['then'](function(_0x133d75){if(_0x133d75){_0x4d4b87[_0xb95e('0x4e')]['ChatGroupId']=_0x133d75['id'];return db[_0xb95e('0x5c')][_0xb95e('0x4d')](_0x4d4b87[_0xb95e('0x4e')]);}})[_0xb95e('0x2a')](respondWithResult(_0x302556,null))[_0xb95e('0x47')](handleError(_0x302556,null));};exports[_0xb95e('0x5d')]=function(_0x4c4204,_0x2a9849,_0x578957){var _0x2ce07d={};var _0x5707e9={};var _0x3e56ce;var _0x3d2a81;return db[_0xb95e('0x30')]['findOne']({'where':{'id':_0x4c4204['params']['id']}})['then'](handleEntityNotFound(_0x2a9849,null))[_0xb95e('0x2a')](function(_0x3746f6){if(_0x3746f6){_0x3e56ce=_0x3746f6;_0x5707e9['model']=_['keys'](db['ChatInternalMessage'][_0xb95e('0x31')]);_0x5707e9[_0xb95e('0x37')]=_[_0xb95e('0x36')](_0x4c4204[_0xb95e('0x37')]);_0x5707e9['filters']=_[_0xb95e('0x39')](_0x5707e9[_0xb95e('0x35')],_0x5707e9[_0xb95e('0x37')]);_0x2ce07d[_0xb95e('0x38')]=_[_0xb95e('0x39')](_0x5707e9[_0xb95e('0x35')],qs[_0xb95e('0x3a')](_0x4c4204[_0xb95e('0x37')][_0xb95e('0x3a')]));_0x2ce07d[_0xb95e('0x38')]=_0x2ce07d['attributes'][_0xb95e('0x3b')]?_0x2ce07d[_0xb95e('0x38')]:_0x5707e9[_0xb95e('0x35')];_0x2ce07d[_0xb95e('0x59')]=qs[_0xb95e('0x3d')](_0x4c4204[_0xb95e('0x37')][_0xb95e('0x3d')]);_0x2ce07d[_0xb95e('0x3e')]=qs[_0xb95e('0x3f')](_['pick'](_0x4c4204[_0xb95e('0x37')],_0x5707e9[_0xb95e('0x3f')]));if(_0x4c4204['query'][_0xb95e('0x41')]){_0x2ce07d[_0xb95e('0x3e')]=_[_0xb95e('0x42')](_0x2ce07d['where'],{'$or':_[_0xb95e('0x2f')](_0x2ce07d[_0xb95e('0x38')],function(_0x3cf901){var _0x379738={};_0x379738[_0x3cf901]={'$like':'%'+_0x4c4204[_0xb95e('0x37')][_0xb95e('0x41')]+'%'};return _0x379738;})});}if(_0x4c4204['query'][_0xb95e('0x5e')]){var _0xaa5f19=_0x4c4204[_0xb95e('0x37')][_0xb95e('0x5e')][_0xb95e('0x5f')](',');var _0x46eff8={};_0x46eff8[_0xaa5f19[0x0]]={'$gte':moment(_0xaa5f19[0x1])[_0xb95e('0x60')](_0xb95e('0x61'))};_0x2ce07d[_0xb95e('0x3e')]=_[_0xb95e('0x42')](_0x2ce07d[_0xb95e('0x3e')],_0x46eff8);}_0x2ce07d=_[_0xb95e('0x42')]({},_0x2ce07d,_0x4c4204['options']);return _0x3e56ce[_0xb95e('0x5d')](_0x2ce07d);}})[_0xb95e('0x2a')](function(_0x5d0f2e){if(_0x5d0f2e){_0x3d2a81=_0x5d0f2e[_0xb95e('0x3b')];if(!_0x4c4204[_0xb95e('0x37')]['hasOwnProperty'](_0xb95e('0x3c'))){_0x2ce07d['limit']=qs['limit'](_0x4c4204['query'][_0xb95e('0x24')]);_0x2ce07d[_0xb95e('0x21')]=qs[_0xb95e('0x21')](_0x4c4204['query']['offset']);}return _0x3e56ce['getMessages'](_0x2ce07d);}})[_0xb95e('0x2a')](function(_0x2b8870){if(_0x2b8870){return _0x2b8870?{'count':_0x3d2a81,'rows':_0x2b8870}:null;}})[_0xb95e('0x2a')](respondWithResult(_0x2a9849,null))['catch'](handleError(_0x2a9849,null));};
\ No newline at end of file
+var _0x22e1=['register','sendStatus','status','end','json','offset','count','limit','Content-Range','apply','reject','save','update','then','error','stack','name','index','map','ChatGroup','fieldName','type','key','query','filters','intersection','attributes','model','length','hasOwnProperty','nolimit','order','sort','where','pick','merge','VIRTUAL','filter','options','includeAll','include','findAll','rows','show','rawAttributes','keys','fields','find','catch','create','body','params','describe','getUnread','ChatInternalMessage','user','toInteger','addMembers','ids','omit','getMembers','findOne','User','removeMembers','addMessage','ChatGroupId','getMessages','$gte','split','format','YYYY-MM-DD\x20HH:mm:ss','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','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','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','./chatGroup.socket'];(function(_0x2dafbe,_0x5d04de){var _0x58a45a=function(_0x50ac96){while(--_0x50ac96){_0x2dafbe['push'](_0x2dafbe['shift']());}};_0x58a45a(++_0x5d04de);}(_0x22e1,0x17f));var _0x122e=function(_0x1a7415,_0x8b215e){_0x1a7415=_0x1a7415-0x0;var _0x22f558=_0x22e1[_0x1a7415];return _0x22f558;};'use strict';var emlformat=require(_0x122e('0x0'));var rimraf=require(_0x122e('0x1'));var zipdir=require(_0x122e('0x2'));var jsonpatch=require(_0x122e('0x3'));var rp=require(_0x122e('0x4'));var moment=require(_0x122e('0x5'));var BPromise=require(_0x122e('0x6'));var Mustache=require(_0x122e('0x7'));var util=require(_0x122e('0x8'));var path=require(_0x122e('0x9'));var sox=require(_0x122e('0xa'));var csv=require(_0x122e('0xb'));var ejs=require(_0x122e('0xc'));var fs=require('fs');var fs_extra=require(_0x122e('0xd'));var _=require(_0x122e('0xe'));var squel=require(_0x122e('0xf'));var crypto=require('crypto');var jsforce=require(_0x122e('0x10'));var deskjs=require(_0x122e('0x11'));var toCsv=require(_0x122e('0xb'));var querystring=require(_0x122e('0x12'));var Papa=require(_0x122e('0x13'));var Redis=require(_0x122e('0x14'));var authService=require(_0x122e('0x15'));var qs=require(_0x122e('0x16'));var as=require(_0x122e('0x17'));var hardwareService=require(_0x122e('0x18'));var logger=require(_0x122e('0x19'))('api');var utils=require(_0x122e('0x1a'));var config=require(_0x122e('0x1b'));var licenseUtil=require(_0x122e('0x1c'));var db=require(_0x122e('0x1d'))['db'];config[_0x122e('0x1e')]=_[_0x122e('0x1f')](config['redis'],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x122e('0x1e')]));require(_0x122e('0x20'))[_0x122e('0x21')](socket);function respondWithStatusCode(_0x3dfed2,_0x33e8fe){_0x33e8fe=_0x33e8fe||0xcc;return function(_0x2431e7){if(_0x2431e7){return _0x3dfed2[_0x122e('0x22')](_0x33e8fe);}return _0x3dfed2[_0x122e('0x23')](_0x33e8fe)[_0x122e('0x24')]();};}function respondWithResult(_0xb8ac0,_0x3583fd){_0x3583fd=_0x3583fd||0xc8;return function(_0x554eab){if(_0x554eab){return _0xb8ac0[_0x122e('0x23')](_0x3583fd)[_0x122e('0x25')](_0x554eab);}};}function respondWithFilteredResult(_0x5ef404,_0x7cb24){return function(_0x174a48){if(_0x174a48){var _0x2d7b33=typeof _0x7cb24[_0x122e('0x26')]==='undefined'&&typeof _0x7cb24['limit']==='undefined';var _0x16abdd=_0x174a48['count'];var _0xb2df14=_0x2d7b33?0x0:_0x7cb24[_0x122e('0x26')];var _0x3c5665=_0x2d7b33?_0x174a48[_0x122e('0x27')]:_0x7cb24['offset']+_0x7cb24[_0x122e('0x28')];var _0x1281f7;if(_0x3c5665>=_0x16abdd){_0x3c5665=_0x16abdd;_0x1281f7=0xc8;}else{_0x1281f7=0xce;}_0x5ef404[_0x122e('0x23')](_0x1281f7);return _0x5ef404['set'](_0x122e('0x29'),_0xb2df14+'-'+_0x3c5665+'/'+_0x16abdd)[_0x122e('0x25')](_0x174a48);}return null;};}function patchUpdates(_0x5f3cb2){return function(_0x25ad83){try{jsonpatch[_0x122e('0x2a')](_0x25ad83,_0x5f3cb2,!![]);}catch(_0x2bb14c){return BPromise[_0x122e('0x2b')](_0x2bb14c);}return _0x25ad83[_0x122e('0x2c')]();};}function saveUpdates(_0x52d5f4,_0x49d888){return function(_0x56841b){if(_0x56841b){return _0x56841b[_0x122e('0x2d')](_0x52d5f4)[_0x122e('0x2e')](function(_0x1771f6){return _0x1771f6;});}return null;};}function removeEntity(_0x4273d5,_0x2e98fc){return function(_0x338575){if(_0x338575){return _0x338575['destroy']()['then'](function(){_0x4273d5['status'](0xcc)[_0x122e('0x24')]();});}};}function handleEntityNotFound(_0x3eb9b0,_0x454ca2){return function(_0x403bcb){if(!_0x403bcb){_0x3eb9b0[_0x122e('0x22')](0x194);}return _0x403bcb;};}function handleError(_0x352474,_0x537fef){_0x537fef=_0x537fef||0x1f4;return function(_0x5a44bf){logger[_0x122e('0x2f')](_0x5a44bf[_0x122e('0x30')]);if(_0x5a44bf[_0x122e('0x31')]){delete _0x5a44bf[_0x122e('0x31')];}_0x352474[_0x122e('0x23')](_0x537fef)['send'](_0x5a44bf);};}exports[_0x122e('0x32')]=function(_0x299af2,_0x28e33b){var _0x20777a={},_0x55ebf0={},_0xcef4ef={'count':0x0,'rows':[]};var _0x1e188f=_[_0x122e('0x33')](db[_0x122e('0x34')]['rawAttributes'],function(_0x4d65ba){return{'name':_0x4d65ba[_0x122e('0x35')],'type':_0x4d65ba[_0x122e('0x36')][_0x122e('0x37')]};});_0x55ebf0['model']=_[_0x122e('0x33')](_0x1e188f,'name');_0x55ebf0[_0x122e('0x38')]=_['keys'](_0x299af2['query']);_0x55ebf0[_0x122e('0x39')]=_[_0x122e('0x3a')](_0x55ebf0['model'],_0x55ebf0[_0x122e('0x38')]);_0x20777a[_0x122e('0x3b')]=_[_0x122e('0x3a')](_0x55ebf0[_0x122e('0x3c')],qs['fields'](_0x299af2[_0x122e('0x38')]['fields']));_0x20777a[_0x122e('0x3b')]=_0x20777a[_0x122e('0x3b')][_0x122e('0x3d')]?_0x20777a[_0x122e('0x3b')]:_0x55ebf0[_0x122e('0x3c')];if(!_0x299af2['query'][_0x122e('0x3e')](_0x122e('0x3f'))){_0x20777a[_0x122e('0x28')]=qs[_0x122e('0x28')](_0x299af2[_0x122e('0x38')][_0x122e('0x28')]);_0x20777a[_0x122e('0x26')]=qs[_0x122e('0x26')](_0x299af2[_0x122e('0x38')][_0x122e('0x26')]);}_0x20777a[_0x122e('0x40')]=qs[_0x122e('0x41')](_0x299af2[_0x122e('0x38')][_0x122e('0x41')]);_0x20777a[_0x122e('0x42')]=qs[_0x122e('0x39')](_[_0x122e('0x43')](_0x299af2['query'],_0x55ebf0[_0x122e('0x39')]),_0x1e188f);if(_0x299af2[_0x122e('0x38')]['filter']){_0x20777a[_0x122e('0x42')]=_[_0x122e('0x44')](_0x20777a[_0x122e('0x42')],{'$or':_[_0x122e('0x33')](_0x1e188f,function(_0x27509c){if(_0x27509c[_0x122e('0x36')]!==_0x122e('0x45')){var _0x5ec557={};_0x5ec557[_0x27509c[_0x122e('0x31')]]={'$like':'%'+_0x299af2['query'][_0x122e('0x46')]+'%'};return _0x5ec557;}})});}_0x20777a=_[_0x122e('0x44')]({},_0x20777a,_0x299af2[_0x122e('0x47')]);var _0x192146={'where':_0x20777a['where']};return db[_0x122e('0x34')][_0x122e('0x27')](_0x192146)[_0x122e('0x2e')](function(_0x52228d){_0xcef4ef[_0x122e('0x27')]=_0x52228d;if(_0x299af2[_0x122e('0x38')][_0x122e('0x48')]){_0x20777a[_0x122e('0x49')]=[{'all':!![]}];}return db[_0x122e('0x34')][_0x122e('0x4a')](_0x20777a);})[_0x122e('0x2e')](function(_0x7e095a){_0xcef4ef[_0x122e('0x4b')]=_0x7e095a;return _0xcef4ef;})[_0x122e('0x2e')](respondWithFilteredResult(_0x28e33b,_0x20777a))['catch'](handleError(_0x28e33b,null));};exports[_0x122e('0x4c')]=function(_0x55b6d4,_0x106e27){var _0xe9151c={'raw':!![],'where':{'id':_0x55b6d4['params']['id']}},_0xc3a3c8={};_0xc3a3c8[_0x122e('0x3c')]=_['keys'](db[_0x122e('0x34')][_0x122e('0x4d')]);_0xc3a3c8[_0x122e('0x38')]=_[_0x122e('0x4e')](_0x55b6d4[_0x122e('0x38')]);_0xc3a3c8[_0x122e('0x39')]=_[_0x122e('0x3a')](_0xc3a3c8[_0x122e('0x3c')],_0xc3a3c8['query']);_0xe9151c['attributes']=_[_0x122e('0x3a')](_0xc3a3c8[_0x122e('0x3c')],qs[_0x122e('0x4f')](_0x55b6d4[_0x122e('0x38')][_0x122e('0x4f')]));_0xe9151c[_0x122e('0x3b')]=_0xe9151c[_0x122e('0x3b')]['length']?_0xe9151c[_0x122e('0x3b')]:_0xc3a3c8[_0x122e('0x3c')];if(_0x55b6d4[_0x122e('0x38')][_0x122e('0x48')]){_0xe9151c['include']=[{'all':!![]}];}_0xe9151c=_[_0x122e('0x44')]({},_0xe9151c,_0x55b6d4['options']);return db['ChatGroup'][_0x122e('0x50')](_0xe9151c)[_0x122e('0x2e')](handleEntityNotFound(_0x106e27,null))[_0x122e('0x2e')](respondWithResult(_0x106e27,null))[_0x122e('0x51')](handleError(_0x106e27,null));};exports[_0x122e('0x52')]=function(_0x218cf5,_0x461e28){return db[_0x122e('0x34')][_0x122e('0x52')](_0x218cf5[_0x122e('0x53')],{})[_0x122e('0x2e')](respondWithResult(_0x461e28,0xc9))[_0x122e('0x51')](handleError(_0x461e28,null));};exports[_0x122e('0x2d')]=function(_0x3a50d0,_0x171add){if(_0x3a50d0['body']['id']){delete _0x3a50d0[_0x122e('0x53')]['id'];}return db['ChatGroup'][_0x122e('0x50')]({'where':{'id':_0x3a50d0['params']['id']}})['then'](handleEntityNotFound(_0x171add,null))[_0x122e('0x2e')](saveUpdates(_0x3a50d0[_0x122e('0x53')],null))[_0x122e('0x2e')](respondWithResult(_0x171add,null))['catch'](handleError(_0x171add,null));};exports['destroy']=function(_0xef4668,_0x420e59){return db[_0x122e('0x34')][_0x122e('0x50')]({'where':{'id':_0xef4668[_0x122e('0x54')]['id']}})[_0x122e('0x2e')](handleEntityNotFound(_0x420e59,null))[_0x122e('0x2e')](removeEntity(_0x420e59,null))['catch'](handleError(_0x420e59,null));};exports['describe']=function(_0x2825df,_0x3118a1){return db['ChatGroup'][_0x122e('0x55')]()[_0x122e('0x2e')](respondWithResult(_0x3118a1,null))['catch'](handleError(_0x3118a1,null));};exports[_0x122e('0x56')]=function(_0x5a4608,_0x56a954,_0x55b3f2){return db[_0x122e('0x57')][_0x122e('0x27')]({'where':{'ChatGroupId':_0x5a4608[_0x122e('0x54')]['id'],'ToId':_0x5a4608[_0x122e('0x58')]['id'],'read':![]}})[_0x122e('0x2e')](function(_0x4bce32){return{'id':_[_0x122e('0x59')](_0x5a4608[_0x122e('0x54')]['id']),'count':_0x4bce32};})['then'](respondWithResult(_0x56a954,null))[_0x122e('0x51')](handleError(_0x56a954,null));};exports[_0x122e('0x5a')]=function(_0x4c47f6,_0x4b4627,_0x505db5){return db[_0x122e('0x34')][_0x122e('0x50')]({'where':{'id':_0x4c47f6[_0x122e('0x54')]['id']}})[_0x122e('0x2e')](handleEntityNotFound(_0x4b4627,null))[_0x122e('0x2e')](function(_0x36f38c){if(_0x36f38c){return _0x36f38c['addMembers'](_0x4c47f6[_0x122e('0x53')][_0x122e('0x5b')],_[_0x122e('0x5c')](_0x4c47f6[_0x122e('0x53')],[_0x122e('0x5b'),'id'])||{});}})[_0x122e('0x2e')](respondWithResult(_0x4b4627,null))['catch'](handleError(_0x4b4627,null));};exports[_0x122e('0x5d')]=function(_0x56b350,_0x4c7195,_0x19768d){var _0x4988b1={};var _0x18ae89={};var _0x55b3ba;var _0x48dac8;return db[_0x122e('0x34')][_0x122e('0x5e')]({'where':{'id':_0x56b350['params']['id']}})[_0x122e('0x2e')](handleEntityNotFound(_0x4c7195,null))[_0x122e('0x2e')](function(_0x403c2d){if(_0x403c2d){_0x55b3ba=_0x403c2d;_0x18ae89['model']=_['keys'](db[_0x122e('0x5f')][_0x122e('0x4d')]);_0x18ae89['query']=_[_0x122e('0x4e')](_0x56b350[_0x122e('0x38')]);_0x18ae89[_0x122e('0x39')]=_['intersection'](_0x18ae89['model'],_0x18ae89[_0x122e('0x38')]);_0x4988b1[_0x122e('0x3b')]=_[_0x122e('0x3a')](_0x18ae89['model'],qs[_0x122e('0x4f')](_0x56b350['query'][_0x122e('0x4f')]));_0x4988b1[_0x122e('0x3b')]=_0x4988b1['attributes'][_0x122e('0x3d')]?_0x4988b1['attributes']:_0x18ae89[_0x122e('0x3c')];_0x4988b1[_0x122e('0x40')]=qs[_0x122e('0x41')](_0x56b350[_0x122e('0x38')][_0x122e('0x41')]);_0x4988b1[_0x122e('0x42')]=qs[_0x122e('0x39')](_[_0x122e('0x43')](_0x56b350[_0x122e('0x38')],_0x18ae89[_0x122e('0x39')]));if(_0x56b350[_0x122e('0x38')][_0x122e('0x46')]){_0x4988b1[_0x122e('0x42')]=_[_0x122e('0x44')](_0x4988b1[_0x122e('0x42')],{'$or':_[_0x122e('0x33')](_0x4988b1[_0x122e('0x3b')],function(_0x204cae){var _0x556735={};_0x556735[_0x204cae]={'$like':'%'+_0x56b350[_0x122e('0x38')][_0x122e('0x46')]+'%'};return _0x556735;})});}_0x4988b1=_[_0x122e('0x44')]({},_0x4988b1,_0x56b350['options']);return _0x55b3ba[_0x122e('0x5d')](_0x4988b1);}})['then'](function(_0x34ee73){if(_0x34ee73){_0x48dac8=_0x34ee73[_0x122e('0x3d')];if(!_0x56b350[_0x122e('0x38')]['hasOwnProperty'](_0x122e('0x3f'))){_0x4988b1[_0x122e('0x28')]=qs[_0x122e('0x28')](_0x56b350[_0x122e('0x38')]['limit']);_0x4988b1[_0x122e('0x26')]=qs[_0x122e('0x26')](_0x56b350['query'][_0x122e('0x26')]);}return _0x55b3ba['getMembers'](_0x4988b1);}})[_0x122e('0x2e')](function(_0x1a9408){if(_0x1a9408){return _0x1a9408?{'count':_0x48dac8,'rows':_0x1a9408}:null;}})[_0x122e('0x2e')](respondWithResult(_0x4c7195,null))[_0x122e('0x51')](handleError(_0x4c7195,null));};exports[_0x122e('0x60')]=function(_0xf508b4,_0x346f87,_0xa302fe){return db[_0x122e('0x34')][_0x122e('0x50')]({'where':{'id':_0xf508b4[_0x122e('0x54')]['id']}})['then'](handleEntityNotFound(_0x346f87,null))[_0x122e('0x2e')](function(_0x394932){if(_0x394932){return _0x394932[_0x122e('0x60')](_0xf508b4[_0x122e('0x38')]['ids']);}})[_0x122e('0x2e')](respondWithStatusCode(_0x346f87,null))[_0x122e('0x51')](handleError(_0x346f87,null));};exports[_0x122e('0x61')]=function(_0x2e2f08,_0xda49b5,_0x329a1f){if(_0x2e2f08[_0x122e('0x53')]['id']){delete _0x2e2f08[_0x122e('0x53')]['id'];}return db[_0x122e('0x34')][_0x122e('0x50')]({'where':{'id':_0x2e2f08['params']['id']}})[_0x122e('0x2e')](handleEntityNotFound(_0xda49b5,null))[_0x122e('0x2e')](function(_0x113ead){if(_0x113ead){_0x2e2f08['body'][_0x122e('0x62')]=_0x113ead['id'];return db[_0x122e('0x57')][_0x122e('0x52')](_0x2e2f08[_0x122e('0x53')]);}})['then'](respondWithResult(_0xda49b5,null))[_0x122e('0x51')](handleError(_0xda49b5,null));};exports[_0x122e('0x63')]=function(_0x11363f,_0x3590b6,_0x4a0e5f){var _0xb4bb6d={};var _0xcad6a={};var _0x4ea96f;var _0x4b4f7f;return db[_0x122e('0x34')][_0x122e('0x5e')]({'where':{'id':_0x11363f[_0x122e('0x54')]['id']}})[_0x122e('0x2e')](handleEntityNotFound(_0x3590b6,null))[_0x122e('0x2e')](function(_0x4b5b5){if(_0x4b5b5){_0x4ea96f=_0x4b5b5;_0xcad6a[_0x122e('0x3c')]=_[_0x122e('0x4e')](db[_0x122e('0x57')][_0x122e('0x4d')]);_0xcad6a[_0x122e('0x38')]=_[_0x122e('0x4e')](_0x11363f[_0x122e('0x38')]);_0xcad6a[_0x122e('0x39')]=_[_0x122e('0x3a')](_0xcad6a[_0x122e('0x3c')],_0xcad6a[_0x122e('0x38')]);_0xb4bb6d['attributes']=_[_0x122e('0x3a')](_0xcad6a[_0x122e('0x3c')],qs[_0x122e('0x4f')](_0x11363f['query']['fields']));_0xb4bb6d[_0x122e('0x3b')]=_0xb4bb6d[_0x122e('0x3b')][_0x122e('0x3d')]?_0xb4bb6d['attributes']:_0xcad6a[_0x122e('0x3c')];_0xb4bb6d[_0x122e('0x40')]=qs[_0x122e('0x41')](_0x11363f[_0x122e('0x38')][_0x122e('0x41')]);_0xb4bb6d['where']=qs['filters'](_[_0x122e('0x43')](_0x11363f[_0x122e('0x38')],_0xcad6a['filters']));if(_0x11363f[_0x122e('0x38')][_0x122e('0x46')]){_0xb4bb6d[_0x122e('0x42')]=_[_0x122e('0x44')](_0xb4bb6d[_0x122e('0x42')],{'$or':_[_0x122e('0x33')](_0xb4bb6d[_0x122e('0x3b')],function(_0x2341d5){var _0x33a84d={};_0x33a84d[_0x2341d5]={'$like':'%'+_0x11363f[_0x122e('0x38')][_0x122e('0x46')]+'%'};return _0x33a84d;})});}if(_0x11363f['query'][_0x122e('0x64')]){var _0x47f592=_0x11363f[_0x122e('0x38')]['$gte'][_0x122e('0x65')](',');var _0x2326e4={};_0x2326e4[_0x47f592[0x0]]={'$gte':moment(_0x47f592[0x1])[_0x122e('0x66')](_0x122e('0x67'))};_0xb4bb6d['where']=_[_0x122e('0x44')](_0xb4bb6d[_0x122e('0x42')],_0x2326e4);}_0xb4bb6d=_[_0x122e('0x44')]({},_0xb4bb6d,_0x11363f[_0x122e('0x47')]);return _0x4ea96f[_0x122e('0x63')](_0xb4bb6d);}})['then'](function(_0x532827){if(_0x532827){_0x4b4f7f=_0x532827[_0x122e('0x3d')];if(!_0x11363f[_0x122e('0x38')]['hasOwnProperty'](_0x122e('0x3f'))){_0xb4bb6d[_0x122e('0x28')]=qs[_0x122e('0x28')](_0x11363f[_0x122e('0x38')][_0x122e('0x28')]);_0xb4bb6d['offset']=qs[_0x122e('0x26')](_0x11363f[_0x122e('0x38')][_0x122e('0x26')]);}return _0x4ea96f[_0x122e('0x63')](_0xb4bb6d);}})['then'](function(_0x112b50){if(_0x112b50){return _0x112b50?{'count':_0x4b4f7f,'rows':_0x112b50}:null;}})['then'](respondWithResult(_0x3590b6,null))[_0x122e('0x51')](handleError(_0x3590b6,null));};
\ No newline at end of file
diff --git a/server/api/chatGroup/chatGroup.events.js b/server/api/chatGroup/chatGroup.events.js
index e4a3432..1477c58 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 _0xc274=['exports','../../mysqldb','save','update','remove','emit','hasOwnProperty','hook'];(function(_0x4a23a9,_0x17a2c0){var _0x18c27f=function(_0x3414e3){while(--_0x3414e3){_0x4a23a9['push'](_0x4a23a9['shift']());}};_0x18c27f(++_0x17a2c0);}(_0xc274,0x151));var _0x4c27=function(_0x164273,_0x44790d){_0x164273=_0x164273-0x0;var _0x2597f9=_0xc274[_0x164273];return _0x2597f9;};'use strict';var EventEmitter=require('events');var ChatGroup=require(_0x4c27('0x0'))['db']['ChatGroup'];var ChatGroupEvents=new EventEmitter();ChatGroupEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x4c27('0x1'),'afterUpdate':_0x4c27('0x2'),'afterDestroy':_0x4c27('0x3')};function emitEvent(_0x15133d){return function(_0x2771df,_0x17970c,_0x534d34){ChatGroupEvents[_0x4c27('0x4')](_0x15133d+':'+_0x2771df['id'],_0x2771df);ChatGroupEvents['emit'](_0x15133d,_0x2771df);_0x534d34(null);};}for(var e in events){if(events[_0x4c27('0x5')](e)){var event=events[e];ChatGroup[_0x4c27('0x6')](e,emitEvent(event));}}module[_0x4c27('0x7')]=ChatGroupEvents;
\ No newline at end of file
+var _0xfd50=['../../mysqldb','ChatGroup','setMaxListeners','save','update','emit','hasOwnProperty','hook'];(function(_0x4163b8,_0x51ce44){var _0x4e8b65=function(_0x321a81){while(--_0x321a81){_0x4163b8['push'](_0x4163b8['shift']());}};_0x4e8b65(++_0x51ce44);}(_0xfd50,0x178));var _0x0fd5=function(_0x4c0622,_0x5dacaf){_0x4c0622=_0x4c0622-0x0;var _0x1799d8=_0xfd50[_0x4c0622];return _0x1799d8;};'use strict';var EventEmitter=require('events');var ChatGroup=require(_0x0fd5('0x0'))['db'][_0x0fd5('0x1')];var ChatGroupEvents=new EventEmitter();ChatGroupEvents[_0x0fd5('0x2')](0x0);var events={'afterCreate':_0x0fd5('0x3'),'afterUpdate':_0x0fd5('0x4'),'afterDestroy':'remove'};function emitEvent(_0xbdfda5){return function(_0x1029f4,_0x4dc01d,_0x50e4ea){ChatGroupEvents[_0x0fd5('0x5')](_0xbdfda5+':'+_0x1029f4['id'],_0x1029f4);ChatGroupEvents[_0x0fd5('0x5')](_0xbdfda5,_0x1029f4);_0x50e4ea(null);};}for(var e in events){if(events[_0x0fd5('0x6')](e)){var event=events[e];ChatGroup[_0x0fd5('0x7')](e,emitEvent(event));}}module['exports']=ChatGroupEvents;
\ No newline at end of file
diff --git a/server/api/chatGroup/chatGroup.model.js b/server/api/chatGroup/chatGroup.model.js
index 53d1476..e3eb464 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 _0xa867=['chat_groups','lodash','../../config/logger','api','moment','request-promise','path','rimraf','../../config/environment','./chatGroup.attributes','exports','define'];(function(_0x42cae2,_0x284ef8){var _0x5f256f=function(_0x41abc8){while(--_0x41abc8){_0x42cae2['push'](_0x42cae2['shift']());}};_0x5f256f(++_0x284ef8);}(_0xa867,0x1a5));var _0x7a86=function(_0x9649dd,_0x210d04){_0x9649dd=_0x9649dd-0x0;var _0x2b9b59=_0xa867[_0x9649dd];return _0x2b9b59;};'use strict';var _=require(_0x7a86('0x0'));var util=require('util');var logger=require(_0x7a86('0x1'))(_0x7a86('0x2'));var moment=require(_0x7a86('0x3'));var BPromise=require('bluebird');var rp=require(_0x7a86('0x4'));var fs=require('fs');var path=require(_0x7a86('0x5'));var rimraf=require(_0x7a86('0x6'));var config=require(_0x7a86('0x7'));var attributes=require(_0x7a86('0x8'));module[_0x7a86('0x9')]=function(_0x57c614,_0x53eb13){return _0x57c614[_0x7a86('0xa')]('ChatGroup',attributes,{'tableName':_0x7a86('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x0348=['lodash','moment','bluebird','request-promise','rimraf','../../config/environment','./chatGroup.attributes','define','ChatGroup'];(function(_0x837df5,_0x50f668){var _0x25ca2c=function(_0x5c17e0){while(--_0x5c17e0){_0x837df5['push'](_0x837df5['shift']());}};_0x25ca2c(++_0x50f668);}(_0x0348,0x14d));var _0x8034=function(_0x497d8c,_0x2904c9){_0x497d8c=_0x497d8c-0x0;var _0xeafed7=_0x0348[_0x497d8c];return _0xeafed7;};'use strict';var _=require(_0x8034('0x0'));var util=require('util');var logger=require('../../config/logger')('api');var moment=require(_0x8034('0x1'));var BPromise=require(_0x8034('0x2'));var rp=require(_0x8034('0x3'));var fs=require('fs');var path=require('path');var rimraf=require(_0x8034('0x4'));var config=require(_0x8034('0x5'));var attributes=require(_0x8034('0x6'));module['exports']=function(_0x2735d9,_0x4a86e0){return _0x2735d9[_0x8034('0x7')](_0x8034('0x8'),attributes,{'tableName':'chat_groups','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
diff --git a/server/api/chatGroup/chatGroup.rpc.js b/server/api/chatGroup/chatGroup.rpc.js
index 7d53d4c..d77701d 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 _0xf29c=['request','then','info','request\x20sent','debug','error','code','ChatGroup,\x20%s,\x20%s','message','result','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','./chatGroup.socket','register'];(function(_0x2341c6,_0x3af092){var _0x54c34d=function(_0x3091f9){while(--_0x3091f9){_0x2341c6['push'](_0x2341c6['shift']());}};_0x54c34d(++_0x3af092);}(_0xf29c,0xc7));var _0xcf29=function(_0x115e86,_0x1a216b){_0x115e86=_0x115e86-0x0;var _0x4d9dd0=_0xf29c[_0x115e86];return _0x4d9dd0;};'use strict';var _=require('lodash');var util=require(_0xcf29('0x0'));var moment=require(_0xcf29('0x1'));var BPromise=require(_0xcf29('0x2'));var rs=require(_0xcf29('0x3'));var fs=require('fs');var Redis=require(_0xcf29('0x4'));var db=require(_0xcf29('0x5'))['db'];var utils=require(_0xcf29('0x6'));var logger=require(_0xcf29('0x7'))(_0xcf29('0x8'));var config=require(_0xcf29('0x9'));var jayson=require(_0xcf29('0xa'));var client=jayson[_0xcf29('0xb')][_0xcf29('0xc')]({'port':0x232a});config[_0xcf29('0xd')]=_[_0xcf29('0xe')](config[_0xcf29('0xd')],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xcf29('0xd')]));require(_0xcf29('0xf'))[_0xcf29('0x10')](socket);function respondWithRpcPromise(_0x18bfa3,_0x4268c6,_0x2f3bd5){return new BPromise(function(_0x2ed7fa,_0x38b122){return client[_0xcf29('0x11')](_0x18bfa3,_0x2f3bd5)[_0xcf29('0x12')](function(_0xb13a72){logger[_0xcf29('0x13')]('ChatGroup,\x20%s,\x20%s',_0x4268c6,_0xcf29('0x14'));logger[_0xcf29('0x15')]('ChatGroup,\x20%s,\x20%s,\x20%s',_0x4268c6,_0xcf29('0x14'),JSON['stringify'](_0xb13a72));if(_0xb13a72[_0xcf29('0x16')]){if(_0xb13a72[_0xcf29('0x16')][_0xcf29('0x17')]===0x1f4){logger[_0xcf29('0x16')](_0xcf29('0x18'),_0x4268c6,_0xb13a72[_0xcf29('0x16')][_0xcf29('0x19')]);return _0x38b122(_0xb13a72[_0xcf29('0x16')][_0xcf29('0x19')]);}logger['error'](_0xcf29('0x18'),_0x4268c6,_0xb13a72['error'][_0xcf29('0x19')]);return _0x2ed7fa(_0xb13a72['error'][_0xcf29('0x19')]);}else{logger['info'](_0xcf29('0x18'),_0x4268c6,'request\x20sent');_0x2ed7fa(_0xb13a72[_0xcf29('0x1a')][_0xcf29('0x19')]);}})['catch'](function(_0xe2b5b1){logger[_0xcf29('0x16')]('ChatGroup,\x20%s,\x20%s',_0x4268c6,_0xe2b5b1);_0x38b122(_0xe2b5b1);});});}
\ No newline at end of file
+var _0x2392=['request','then','info','ChatGroup,\x20%s,\x20%s','debug','ChatGroup,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','util','bluebird','randomstring','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','register'];(function(_0x18a02d,_0x26d0d0){var _0x518e7f=function(_0x1e2586){while(--_0x1e2586){_0x18a02d['push'](_0x18a02d['shift']());}};_0x518e7f(++_0x26d0d0);}(_0x2392,0xd0));var _0x2239=function(_0x29c10d,_0x19f4e9){_0x29c10d=_0x29c10d-0x0;var _0x3bfce7=_0x2392[_0x29c10d];return _0x3bfce7;};'use strict';var _=require(_0x2239('0x0'));var util=require(_0x2239('0x1'));var moment=require('moment');var BPromise=require(_0x2239('0x2'));var rs=require(_0x2239('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x2239('0x4'));var logger=require(_0x2239('0x5'))(_0x2239('0x6'));var config=require(_0x2239('0x7'));var jayson=require(_0x2239('0x8'));var client=jayson[_0x2239('0x9')][_0x2239('0xa')]({'port':0x232a});config[_0x2239('0xb')]=_[_0x2239('0xc')](config[_0x2239('0xb')],{'host':_0x2239('0xd'),'port':0x18eb});var socket=require(_0x2239('0xe'))(new Redis(config[_0x2239('0xb')]));require('./chatGroup.socket')[_0x2239('0xf')](socket);function respondWithRpcPromise(_0x176ca4,_0x4d0d43,_0x4a8d18){return new BPromise(function(_0x29bc86,_0x27f71d){return client[_0x2239('0x10')](_0x176ca4,_0x4a8d18)[_0x2239('0x11')](function(_0x123b77){logger[_0x2239('0x12')](_0x2239('0x13'),_0x4d0d43,'request\x20sent');logger[_0x2239('0x14')](_0x2239('0x15'),_0x4d0d43,'request\x20sent',JSON[_0x2239('0x16')](_0x123b77));if(_0x123b77[_0x2239('0x17')]){if(_0x123b77[_0x2239('0x17')][_0x2239('0x18')]===0x1f4){logger['error'](_0x2239('0x13'),_0x4d0d43,_0x123b77['error'][_0x2239('0x19')]);return _0x27f71d(_0x123b77[_0x2239('0x17')][_0x2239('0x19')]);}logger[_0x2239('0x17')]('ChatGroup,\x20%s,\x20%s',_0x4d0d43,_0x123b77[_0x2239('0x17')][_0x2239('0x19')]);return _0x29bc86(_0x123b77['error'][_0x2239('0x19')]);}else{logger['info'](_0x2239('0x13'),_0x4d0d43,'request\x20sent');_0x29bc86(_0x123b77[_0x2239('0x1a')]['message']);}})[_0x2239('0x1b')](function(_0x10257f){logger[_0x2239('0x17')](_0x2239('0x13'),_0x4d0d43,_0x10257f);_0x27f71d(_0x10257f);});});}
\ No newline at end of file
diff --git a/server/api/chatGroup/chatGroup.socket.js b/server/api/chatGroup/chatGroup.socket.js
index 466deeb..d4543c7 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 _0xb28a=['emit','register','length','chatGroup:','remove','update'];(function(_0x3054a6,_0x3b172e){var _0x5141a0=function(_0x420436){while(--_0x420436){_0x3054a6['push'](_0x3054a6['shift']());}};_0x5141a0(++_0x3b172e);}(_0xb28a,0x1ae));var _0xab28=function(_0x3d8027,_0x2c6d46){_0x3d8027=_0x3d8027-0x0;var _0x468866=_0xb28a[_0x3d8027];return _0x468866;};'use strict';var ChatGroupEvents=require('./chatGroup.events');var events=['save',_0xab28('0x0'),_0xab28('0x1')];function createListener(_0x1dc488,_0x3fafae){return function(_0x4a4d1e){_0x3fafae[_0xab28('0x2')](_0x1dc488,_0x4a4d1e);};}function removeListener(_0x4b1e73,_0x4c3485){return function(){ChatGroupEvents['removeListener'](_0x4b1e73,_0x4c3485);};}exports[_0xab28('0x3')]=function(_0x5a8729){for(var _0xc435d4=0x0,_0x237085=events[_0xab28('0x4')];_0xc435d4<_0x237085;_0xc435d4++){var _0x2978e1=events[_0xc435d4];var _0x5b6835=createListener(_0xab28('0x5')+_0x2978e1,_0x5a8729);ChatGroupEvents['on'](_0x2978e1,_0x5b6835);}};
\ No newline at end of file
+var _0x3798=['chatGroup:','./chatGroup.events','update','register','length'];(function(_0x48514d,_0x5cf7f6){var _0x4d26ff=function(_0x10c337){while(--_0x10c337){_0x48514d['push'](_0x48514d['shift']());}};_0x4d26ff(++_0x5cf7f6);}(_0x3798,0x1aa));var _0x8379=function(_0x35da13,_0x446643){_0x35da13=_0x35da13-0x0;var _0x5c3781=_0x3798[_0x35da13];return _0x5c3781;};'use strict';var ChatGroupEvents=require(_0x8379('0x0'));var events=['save','remove',_0x8379('0x1')];function createListener(_0x30c68a,_0x38cc5c){return function(_0x1b8a8d){_0x38cc5c['emit'](_0x30c68a,_0x1b8a8d);};}function removeListener(_0x4f6d28,_0x3702dc){return function(){ChatGroupEvents['removeListener'](_0x4f6d28,_0x3702dc);};}exports[_0x8379('0x2')]=function(_0x2fc8f7){for(var _0x3326e9=0x0,_0x44fcef=events[_0x8379('0x3')];_0x3326e9<_0x44fcef;_0x3326e9++){var _0x5e2e92=events[_0x3326e9];var _0x4bc575=createListener(_0x8379('0x4')+_0x5e2e92,_0x2fc8f7);ChatGroupEvents['on'](_0x5e2e92,_0x4bc575);}};
\ No newline at end of file
diff --git a/server/api/chatGroup/index.js b/server/api/chatGroup/index.js
index 05c5995..efc1edc 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 _0x8fa7=['put','update','delete','destroy','/:id/members','removeMembers','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatGroup.controller','get','index','isAuthenticated','/:id','getUnread','getMembers','/:id/messages','create','post','addMembers'];(function(_0x2f995b,_0x1af525){var _0x5e84e4=function(_0x234bff){while(--_0x234bff){_0x2f995b['push'](_0x2f995b['shift']());}};_0x5e84e4(++_0x1af525);}(_0x8fa7,0x157));var _0x78fa=function(_0x3e6d5d,_0x264c7a){_0x3e6d5d=_0x3e6d5d-0x0;var _0x238923=_0x8fa7[_0x3e6d5d];return _0x238923;};'use strict';var multer=require(_0x78fa('0x0'));var util=require(_0x78fa('0x1'));var path=require(_0x78fa('0x2'));var timeout=require(_0x78fa('0x3'));var express=require(_0x78fa('0x4'));var router=express[_0x78fa('0x5')]();var fs_extra=require(_0x78fa('0x6'));var auth=require(_0x78fa('0x7'));var interaction=require(_0x78fa('0x8'));var config=require(_0x78fa('0x9'));var controller=require(_0x78fa('0xa'));router[_0x78fa('0xb')]('/',auth['isAuthenticated'](),controller[_0x78fa('0xc')]);router[_0x78fa('0xb')]('/describe',auth[_0x78fa('0xd')](),controller['describe']);router['get'](_0x78fa('0xe'),auth[_0x78fa('0xd')](),controller['show']);router[_0x78fa('0xb')]('/:id/unread',auth[_0x78fa('0xd')](),controller[_0x78fa('0xf')]);router[_0x78fa('0xb')]('/:id/members',auth[_0x78fa('0xd')](),controller[_0x78fa('0x10')]);router[_0x78fa('0xb')](_0x78fa('0x11'),auth['isAuthenticated'](),controller['getMessages']);router['post']('/',auth[_0x78fa('0xd')](),controller[_0x78fa('0x12')]);router[_0x78fa('0x13')]('/:id/members',auth['isAuthenticated'](),controller[_0x78fa('0x14')]);router[_0x78fa('0x13')]('/:id/messages',auth['isAuthenticated'](),controller['addMessage']);router[_0x78fa('0x15')]('/:id',auth[_0x78fa('0xd')](),controller[_0x78fa('0x16')]);router[_0x78fa('0x17')]('/:id',auth['isAuthenticated'](),controller[_0x78fa('0x18')]);router['delete'](_0x78fa('0x19'),auth[_0x78fa('0xd')](),controller[_0x78fa('0x1a')]);module[_0x78fa('0x1b')]=router;
\ No newline at end of file
+var _0x6ec5=['util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatGroup.controller','isAuthenticated','index','get','/describe','describe','/:id','show','getUnread','/:id/members','getMembers','/:id/messages','getMessages','create','post','addMembers','addMessage','update','delete','destroy','removeMembers','exports','multer'];(function(_0x2a2fd9,_0x33d050){var _0x4b9a3e=function(_0xad8f96){while(--_0xad8f96){_0x2a2fd9['push'](_0x2a2fd9['shift']());}};_0x4b9a3e(++_0x33d050);}(_0x6ec5,0x7f));var _0x56ec=function(_0x2dafbe,_0x5d04de){_0x2dafbe=_0x2dafbe-0x0;var _0x58a45a=_0x6ec5[_0x2dafbe];return _0x58a45a;};'use strict';var multer=require(_0x56ec('0x0'));var util=require(_0x56ec('0x1'));var path=require(_0x56ec('0x2'));var timeout=require(_0x56ec('0x3'));var express=require(_0x56ec('0x4'));var router=express[_0x56ec('0x5')]();var fs_extra=require(_0x56ec('0x6'));var auth=require(_0x56ec('0x7'));var interaction=require(_0x56ec('0x8'));var config=require(_0x56ec('0x9'));var controller=require(_0x56ec('0xa'));router['get']('/',auth[_0x56ec('0xb')](),controller[_0x56ec('0xc')]);router[_0x56ec('0xd')](_0x56ec('0xe'),auth[_0x56ec('0xb')](),controller[_0x56ec('0xf')]);router[_0x56ec('0xd')](_0x56ec('0x10'),auth[_0x56ec('0xb')](),controller[_0x56ec('0x11')]);router[_0x56ec('0xd')]('/:id/unread',auth[_0x56ec('0xb')](),controller[_0x56ec('0x12')]);router['get'](_0x56ec('0x13'),auth[_0x56ec('0xb')](),controller[_0x56ec('0x14')]);router['get'](_0x56ec('0x15'),auth['isAuthenticated'](),controller[_0x56ec('0x16')]);router['post']('/',auth[_0x56ec('0xb')](),controller[_0x56ec('0x17')]);router[_0x56ec('0x18')](_0x56ec('0x13'),auth[_0x56ec('0xb')](),controller[_0x56ec('0x19')]);router['post'](_0x56ec('0x15'),auth['isAuthenticated'](),controller[_0x56ec('0x1a')]);router['put'](_0x56ec('0x10'),auth[_0x56ec('0xb')](),controller[_0x56ec('0x1b')]);router[_0x56ec('0x1c')]('/:id',auth[_0x56ec('0xb')](),controller[_0x56ec('0x1d')]);router[_0x56ec('0x1c')](_0x56ec('0x13'),auth[_0x56ec('0xb')](),controller[_0x56ec('0x1e')]);module[_0x56ec('0x1f')]=router;
\ No newline at end of file
diff --git a/server/api/chatInteraction/chatInteraction.attributes.js b/server/api/chatInteraction/chatInteraction.attributes.js
index c0cd909..9bb8c91 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 _0xbee3=['TEXT','DATE','STRING','long','BOOLEAN','exports','ENUM','star'];(function(_0x844a95,_0x5a3ae6){var _0x57f74d=function(_0x149f31){while(--_0x149f31){_0x844a95['push'](_0x844a95['shift']());}};_0x57f74d(++_0x5a3ae6);}(_0xbee3,0xd5));var _0x3bee=function(_0x7c5d6a,_0x3c9f62){_0x7c5d6a=_0x7c5d6a-0x0;var _0x3e6de7=_0xbee3[_0x7c5d6a];return _0x3e6de7;};'use strict';var Sequelize=require('sequelize');module[_0x3bee('0x0')]={'closed':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'ratingValue':{'type':Sequelize['INTEGER']},'ratingType':{'type':Sequelize[_0x3bee('0x1')](_0x3bee('0x2'),'thumb'),'defaultValue':_0x3bee('0x2')},'ratingMessage':{'type':Sequelize[_0x3bee('0x3')]},'pathTranscript':{'type':Sequelize[_0x3bee('0x3')]},'mailTranscript':{'type':Sequelize['STRING'],'validate':{'isEmail':!![]}},'closedAt':{'type':Sequelize[_0x3bee('0x4')]},'disposition':{'type':Sequelize[_0x3bee('0x5')]},'secondDisposition':{'type':Sequelize['STRING']},'thirdDisposition':{'type':Sequelize[_0x3bee('0x5')]},'note':{'type':Sequelize[_0x3bee('0x5')]},'browserName':{'type':Sequelize[_0x3bee('0x5')]},'browserVersion':{'type':Sequelize[_0x3bee('0x5')]},'osName':{'type':Sequelize[_0x3bee('0x5')]},'osVersion':{'type':Sequelize[_0x3bee('0x5')]},'deviceModel':{'type':Sequelize[_0x3bee('0x5')]},'deviceVendor':{'type':Sequelize['STRING']},'deviceType':{'type':Sequelize[_0x3bee('0x5')]},'referer':{'type':Sequelize[_0x3bee('0x3')]},'customerIp':{'type':Sequelize[_0x3bee('0x5')]},'formData':{'type':Sequelize[_0x3bee('0x3')](_0x3bee('0x6'))},'read1stAt':{'type':Sequelize[_0x3bee('0x4')]},'lastMsgAt':{'type':Sequelize['DATE']},'lastMsgDirection':{'type':Sequelize[_0x3bee('0x1')]('in','out'),'defaultValue':'in','allowNull':![]},'closeReason':{'type':Sequelize[_0x3bee('0x5')]},'customerPort':{'type':Sequelize[_0x3bee('0x5')]},'vidaooSessionId':{'type':Sequelize[_0x3bee('0x3')]},'autoreplyExecuted':{'type':Sequelize[_0x3bee('0x7')],'defaultValue':![]}};
\ No newline at end of file
+var _0x8286=['thumb','TEXT','STRING','long','DATE','out','sequelize','exports','BOOLEAN','INTEGER','ENUM','star'];(function(_0x112244,_0x225883){var _0x5d4982=function(_0x95c2d5){while(--_0x95c2d5){_0x112244['push'](_0x112244['shift']());}};_0x5d4982(++_0x225883);}(_0x8286,0x66));var _0x6828=function(_0x529245,_0x3fadff){_0x529245=_0x529245-0x0;var _0x5685ac=_0x8286[_0x529245];return _0x5685ac;};'use strict';var Sequelize=require(_0x6828('0x0'));module[_0x6828('0x1')]={'closed':{'type':Sequelize[_0x6828('0x2')],'defaultValue':![]},'ratingValue':{'type':Sequelize[_0x6828('0x3')]},'ratingType':{'type':Sequelize[_0x6828('0x4')](_0x6828('0x5'),_0x6828('0x6')),'defaultValue':_0x6828('0x5')},'ratingMessage':{'type':Sequelize[_0x6828('0x7')]},'pathTranscript':{'type':Sequelize[_0x6828('0x7')]},'mailTranscript':{'type':Sequelize[_0x6828('0x8')],'validate':{'isEmail':!![]}},'closedAt':{'type':Sequelize['DATE']},'disposition':{'type':Sequelize[_0x6828('0x8')]},'secondDisposition':{'type':Sequelize[_0x6828('0x8')]},'thirdDisposition':{'type':Sequelize['STRING']},'note':{'type':Sequelize[_0x6828('0x8')]},'browserName':{'type':Sequelize[_0x6828('0x8')]},'browserVersion':{'type':Sequelize[_0x6828('0x8')]},'osName':{'type':Sequelize['STRING']},'osVersion':{'type':Sequelize[_0x6828('0x8')]},'deviceModel':{'type':Sequelize[_0x6828('0x8')]},'deviceVendor':{'type':Sequelize[_0x6828('0x8')]},'deviceType':{'type':Sequelize[_0x6828('0x8')]},'referer':{'type':Sequelize[_0x6828('0x7')]},'customerIp':{'type':Sequelize[_0x6828('0x8')]},'formData':{'type':Sequelize[_0x6828('0x7')](_0x6828('0x9'))},'read1stAt':{'type':Sequelize[_0x6828('0xa')]},'lastMsgAt':{'type':Sequelize['DATE']},'lastMsgDirection':{'type':Sequelize['ENUM']('in',_0x6828('0xb')),'defaultValue':'in','allowNull':![]},'closeReason':{'type':Sequelize['STRING']},'customerPort':{'type':Sequelize[_0x6828('0x8')]},'vidaooSessionId':{'type':Sequelize['TEXT']},'autoreplyExecuted':{'type':Sequelize[_0x6828('0x2')],'defaultValue':![]}};
\ No newline at end of file
diff --git a/server/api/chatInteraction/chatInteraction.controller.js b/server/api/chatInteraction/chatInteraction.controller.js
index 2b11372..f5f3809 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 _0x5ff6=['ids','omit','hasOwnProperty','nolimit','order','sort','where','map','$gte','split','YYYY-MM-DD\x20HH:mm:ss','findAll','rows','getMyMessages','pick','filter','includeAgent','push','addTags','setTags','spread','Tag','emit','removeTags','unix','server','tmp','files','attachments','transcript-%d-%s.zip','firstName','lastName','read','Account','Owner','mkdirSync','Chat','toString','browserName','osName','referer','customerIp','customerPort','N.A.','tail','existsSync','pipe','value','renderFile','views','downloadInteraction.ejs','transcript-','createPdfFromHTML','err','rimraf','request-promise','moment','mustache','util','path','ejs','lodash','ioredis','../../components/interaction/service','../../components/export/pdf','../../config/logger','api','../../config/environment','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./chatInteraction.socket','register','jayson/promise','http','request','info','request\x20sent','debug','ChatInteraction,\x20%s,\x20%s,\x20%s','stringify','error','code','message','ChatInteraction,\x20%s,\x20%s','result','catch','sendStatus','status','end','json','offset','undefined','limit','count','set','update','then','destroy','stack','name','render','merge','contact','account','index','ChatInteraction','rawAttributes','fieldName','type','getOptions','chat','query','show','params','model','keys','filters','intersection','fields','attributes','length','includeAll','include','options','find','create','body','describe','createVidaooSession','findOne','ChatWebsiteId','vidaooApiKey','vidaooEscalation','user','fullname','email','isNull','vidaooNote','follow','vidaooMetadata','metadata','Sequelize','ValidationError','Error\x20in\x20conversion\x20vidaooMetadata','Error\x20in\x20Vidaoo\x20configuration','join_url','out','ChatMessage','Unable\x20to\x20create\x20Vidaoo\x20session','customUpdate','CmContact','Contact','abandonInteraction,\x20%s,\x20%s,\x20%s','abandon','UserId','Interaction\x20already\x20assigned','disposition','file','originalname','basename','filename','mimetype','Attachment','attachmentDownload','closed','Unauthorized','attachId','root','server/files/attachments/','join','offline-chat/','download','close','mailTranscript','server/files/chat/upload/','format','transcript-%s.txt','now','pathTranscript','Messages','User','ChatWebsite','ContactId','%s%d','System','agentIdentifier','agentAlias','agent_alias','alias','agent_fullname','[%s]\x20%s:\x20%s\x0a','createdAt','MM/DD/YYYY\x20HH:mm:ss','direction','secret','appendFileSync','MailAccount','MailServerOut','Smtp','CloudProvider','getSmtpOptions','sendMail','\x22%s\x22\x20<%s>','Mail\x20Transcript','addMessage'];(function(_0x56e2ed,_0x1c4781){var _0x5237b2=function(_0x587150){while(--_0x587150){_0x56e2ed['push'](_0x56e2ed['shift']());}};_0x5237b2(++_0x1c4781);}(_0x5ff6,0x106));var _0x65ff=function(_0x4dcf1c,_0x3bbf55){_0x4dcf1c=_0x4dcf1c-0x0;var _0x20fa53=_0x5ff6[_0x4dcf1c];return _0x20fa53;};'use strict';var rimraf=require(_0x65ff('0x0'));var zipdir=require('zip-dir');var rp=require(_0x65ff('0x1'));var moment=require(_0x65ff('0x2'));var BPromise=require('bluebird');var Mustache=require(_0x65ff('0x3'));var util=require(_0x65ff('0x4'));var path=require(_0x65ff('0x5'));var ejs=require(_0x65ff('0x6'));var fs=require('fs');var _=require(_0x65ff('0x7'));var Redis=require(_0x65ff('0x8'));var interaction=require(_0x65ff('0x9'));var qs=require('../../components/parsers/qs');var pdf=require(_0x65ff('0xa'));var logger=require(_0x65ff('0xb'))(_0x65ff('0xc'));var config=require(_0x65ff('0xd'));var db=require(_0x65ff('0xe'))['db'];config[_0x65ff('0xf')]=_[_0x65ff('0x10')](config[_0x65ff('0xf')],{'host':_0x65ff('0x11'),'port':0x18eb});var socket=require(_0x65ff('0x12'))(new Redis(config[_0x65ff('0xf')]));require(_0x65ff('0x13'))[_0x65ff('0x14')](socket);var jayson=require(_0x65ff('0x15'));var client=jayson['client'][_0x65ff('0x16')]({'port':0x232b});var client9004=jayson['client'][_0x65ff('0x16')]({'port':0x232c});function respondWithRpcPromise(_0x5a080d,_0x1f66f3,_0x29e2c5,_0x2b65af){return new BPromise(function(_0x53bad3,_0x57d024){var _0x4aed26=_0x2b65af||client;return _0x4aed26[_0x65ff('0x17')](_0x5a080d,_0x29e2c5)['then'](function(_0x14eab5){logger[_0x65ff('0x18')]('ChatInteraction,\x20%s,\x20%s',_0x1f66f3,_0x65ff('0x19'));logger[_0x65ff('0x1a')](_0x65ff('0x1b'),_0x1f66f3,_0x65ff('0x19'),JSON[_0x65ff('0x1c')](_0x14eab5));if(_0x14eab5[_0x65ff('0x1d')]){if(_0x14eab5[_0x65ff('0x1d')][_0x65ff('0x1e')]===0x1f4){logger[_0x65ff('0x1d')]('ChatInteraction,\x20%s,\x20%s',_0x1f66f3,_0x14eab5[_0x65ff('0x1d')][_0x65ff('0x1f')]);return _0x57d024(_0x14eab5[_0x65ff('0x1d')]['message']);}logger[_0x65ff('0x1d')](_0x65ff('0x20'),_0x1f66f3,_0x14eab5[_0x65ff('0x1d')][_0x65ff('0x1f')]);return _0x53bad3(_0x14eab5[_0x65ff('0x1d')][_0x65ff('0x1f')]);}else{logger[_0x65ff('0x18')](_0x65ff('0x20'),_0x1f66f3,'request\x20sent');_0x53bad3(_0x14eab5[_0x65ff('0x21')]['message']);}})[_0x65ff('0x22')](function(_0xb54ea){logger[_0x65ff('0x1d')]('ChatInteraction,\x20%s,\x20%s',_0x1f66f3,_0xb54ea);_0x57d024(_0xb54ea);});});}function respondWithStatusCode(_0x315db4,_0x3981e6){_0x3981e6=_0x3981e6||0xcc;return function(_0x44d125){if(_0x44d125){return _0x315db4[_0x65ff('0x23')](_0x3981e6);}return _0x315db4[_0x65ff('0x24')](_0x3981e6)[_0x65ff('0x25')]();};}function respondWithResult(_0x53cba9,_0x1fa38e){_0x1fa38e=_0x1fa38e||0xc8;return function(_0x3d9a22){if(_0x3d9a22){return _0x53cba9['status'](_0x1fa38e)[_0x65ff('0x26')](_0x3d9a22);}};}function respondWithFilteredResult(_0x328f9c,_0x1a85c4){return function(_0x4cdadb){if(_0x4cdadb){var _0x238d58=typeof _0x1a85c4[_0x65ff('0x27')]===_0x65ff('0x28')&&typeof _0x1a85c4[_0x65ff('0x29')]===_0x65ff('0x28');var _0x496e95=_0x4cdadb[_0x65ff('0x2a')];var _0x398386=_0x238d58?0x0:_0x1a85c4['offset'];var _0xbfb1d2=_0x238d58?_0x4cdadb[_0x65ff('0x2a')]:_0x1a85c4[_0x65ff('0x27')]+_0x1a85c4[_0x65ff('0x29')];var _0x33dadd;if(_0xbfb1d2>=_0x496e95){_0xbfb1d2=_0x496e95;_0x33dadd=0xc8;}else{_0x33dadd=0xce;}_0x328f9c['status'](_0x33dadd);return _0x328f9c[_0x65ff('0x2b')]('Content-Range',_0x398386+'-'+_0xbfb1d2+'/'+_0x496e95)['json'](_0x4cdadb);}return null;};}function saveUpdates(_0x141a72){return function(_0x41e6b3){if(_0x41e6b3){return _0x41e6b3[_0x65ff('0x2c')](_0x141a72)[_0x65ff('0x2d')](function(_0x2bca0c){return _0x2bca0c;});}return null;};}function removeEntity(_0x2f7660){return function(_0x4c3eb7){if(_0x4c3eb7){return _0x4c3eb7[_0x65ff('0x2e')]()[_0x65ff('0x2d')](function(){_0x2f7660['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x4b5aee){return function(_0x16a8e8){if(!_0x16a8e8){_0x4b5aee[_0x65ff('0x23')](0x194);}return _0x16a8e8;};}function handleError(_0xb51a6d,_0x37624c){_0x37624c=_0x37624c||0x1f4;return function(_0x5cd695){logger[_0x65ff('0x1d')](_0x5cd695[_0x65ff('0x2f')]);if(_0x5cd695[_0x65ff('0x30')]){delete _0x5cd695[_0x65ff('0x30')];}_0xb51a6d[_0x65ff('0x24')](_0x37624c)['send'](_0x5cd695);};}function getMustacheRender(_0x3abec3,_0x2acdc4){return Mustache[_0x65ff('0x31')](_0x3abec3,_[_0x65ff('0x32')](_0x2acdc4['body'],{'contact':_0x2acdc4[_0x65ff('0x33')],'message':_0x2acdc4[_0x65ff('0x1f')],'agent':_0x2acdc4['agent'],'interaction':_0x2acdc4['interaction'],'account':_0x2acdc4[_0x65ff('0x34')]}))||'';}exports[_0x65ff('0x35')]=function(_0x59fe7e,_0x8255ab){var _0x273a96={};var _0x389352=_['map'](db[_0x65ff('0x36')][_0x65ff('0x37')],function(_0x445d28){return{'name':_0x445d28[_0x65ff('0x38')],'type':_0x445d28[_0x65ff('0x39')]['key']};});_0x273a96=qs[_0x65ff('0x3a')](_0x389352,_0x59fe7e);return interaction['findAll'](_0x65ff('0x3b'),_0x59fe7e[_0x65ff('0x3c')],_0x59fe7e['user'],_0x273a96,_0x389352)[_0x65ff('0x2d')](respondWithFilteredResult(_0x8255ab,_0x273a96))['catch'](handleError(_0x8255ab,null));};exports[_0x65ff('0x3d')]=function(_0x56c069,_0xb54c14){var _0x1a4058={'raw':![],'where':{'id':_0x56c069[_0x65ff('0x3e')]['id']}},_0x45017e={};_0x45017e[_0x65ff('0x3f')]=_[_0x65ff('0x40')](db['ChatInteraction'][_0x65ff('0x37')]);_0x45017e[_0x65ff('0x3c')]=_[_0x65ff('0x40')](_0x56c069[_0x65ff('0x3c')]);_0x45017e[_0x65ff('0x41')]=_[_0x65ff('0x42')](_0x45017e[_0x65ff('0x3f')],_0x45017e[_0x65ff('0x3c')]);_0x1a4058['attributes']=_[_0x65ff('0x42')](_0x45017e[_0x65ff('0x3f')],qs[_0x65ff('0x43')](_0x56c069[_0x65ff('0x3c')][_0x65ff('0x43')]));_0x1a4058[_0x65ff('0x44')]=_0x1a4058[_0x65ff('0x44')][_0x65ff('0x45')]?_0x1a4058[_0x65ff('0x44')]:_0x45017e[_0x65ff('0x3f')];if(_0x56c069['query'][_0x65ff('0x46')]){_0x1a4058[_0x65ff('0x47')]=[{'all':!![]}];}_0x1a4058=_['merge']({},_0x1a4058,_0x56c069[_0x65ff('0x48')]);return db[_0x65ff('0x36')][_0x65ff('0x49')](_0x1a4058)['then'](handleEntityNotFound(_0xb54c14,null))[_0x65ff('0x2d')](respondWithResult(_0xb54c14,null))[_0x65ff('0x22')](handleError(_0xb54c14,null));};exports[_0x65ff('0x4a')]=function(_0x464bc3,_0x438753){return db[_0x65ff('0x36')][_0x65ff('0x4a')](_0x464bc3[_0x65ff('0x4b')],{})[_0x65ff('0x2d')](respondWithResult(_0x438753,0xc9))[_0x65ff('0x22')](handleError(_0x438753,null));};exports[_0x65ff('0x2c')]=function(_0x115335,_0x4697fe){if(_0x115335[_0x65ff('0x4b')]['id']){delete _0x115335['body']['id'];}return db[_0x65ff('0x36')][_0x65ff('0x49')]({'where':{'id':_0x115335[_0x65ff('0x3e')]['id']}})[_0x65ff('0x2d')](handleEntityNotFound(_0x4697fe,null))[_0x65ff('0x2d')](saveUpdates(_0x115335[_0x65ff('0x4b')],null))[_0x65ff('0x2d')](respondWithResult(_0x4697fe,null))[_0x65ff('0x22')](handleError(_0x4697fe,null));};exports[_0x65ff('0x2e')]=function(_0x302906,_0x54c566){return db[_0x65ff('0x36')][_0x65ff('0x49')]({'where':{'id':_0x302906[_0x65ff('0x3e')]['id']}})[_0x65ff('0x2d')](handleEntityNotFound(_0x54c566,null))[_0x65ff('0x2d')](removeEntity(_0x54c566,null))[_0x65ff('0x22')](handleError(_0x54c566,null));};exports[_0x65ff('0x4c')]=function(_0x3be640,_0x321f15){return db[_0x65ff('0x36')]['describe']()[_0x65ff('0x2d')](respondWithResult(_0x321f15,null))['catch'](handleError(_0x321f15,null));};exports[_0x65ff('0x4d')]=function(_0x1c44ad,_0x4c71d8){var _0x550b01=_0x1c44ad[_0x65ff('0x3e')]['id'];var _0x1e8da8;var _0x35647b;var _0x562c6e;return db['ChatInteraction'][_0x65ff('0x4e')]({'where':{'id':_0x550b01}})[_0x65ff('0x2d')](function(_0x30b85b){_0x1e8da8=_0x30b85b;return db['ChatWebsite'][_0x65ff('0x4e')]({'where':{'id':_0x30b85b[_0x65ff('0x4f')]},'attributes':['id',_0x65ff('0x50'),_0x65ff('0x51'),'vidaooTopic','vidaooNote','vidaooMetadata'],'raw':!![]});})[_0x65ff('0x2d')](function(_0x423743){if(_0x423743&&_0x423743[_0x65ff('0x50')]&&_0x423743[_0x65ff('0x51')]){_0x35647b=_0x423743;var _0x59002f={'interaction':{'id':_0x550b01},'agent':{'id':_0x1c44ad[_0x65ff('0x52')]['id'],'name':_0x1c44ad[_0x65ff('0x52')]['name'],'fullname':_0x1c44ad[_0x65ff('0x52')][_0x65ff('0x53')],'email':_0x1c44ad[_0x65ff('0x52')][_0x65ff('0x54')]},'contact':_0x1c44ad['body'][_0x65ff('0x33')],'account':_0x1c44ad[_0x65ff('0x4b')][_0x65ff('0x34')]};var _0x236b79={'rejectUnauthorized':![],'method':'POST','url':'https://api-vidaoo.xcally.com/api/v1/meetings','headers':{'X-APIKEY':_0x423743['vidaooApiKey']},'body':{'duration':null,'scheduledAt':null,'participants':[_0x1c44ad['user'][_0x65ff('0x54')]],'buttons':null,'topic':_0x35647b['vidaooTopic'],'note':_[_0x65ff('0x55')](_0x35647b['vidaooNote'])?null:getMustacheRender(_0x35647b[_0x65ff('0x56')],_0x59002f),'metadata':null},'redirect':_0x65ff('0x57'),'json':!![]};try{if(!_['isNull'](_0x35647b['vidaooMetadata'])){var _0x5a7b7a=getMustacheRender(_0x35647b[_0x65ff('0x58')],_0x59002f);var _0x73b22=JSON['parse'](_0x5a7b7a);_0x236b79[_0x65ff('0x4b')][_0x65ff('0x59')]=_0x73b22;}}catch(_0x47a63c){throw new db[(_0x65ff('0x5a'))][(_0x65ff('0x5b'))](_0x65ff('0x5c'));}return rp(_0x236b79);}else{throw new db['Sequelize']['ValidationError'](_0x65ff('0x5d'));}})['then'](function(_0x26923a){_0x562c6e=_0x26923a;if(_0x562c6e['id']){var _0x30be4c={'body':_0x562c6e[_0x65ff('0x5e')],'ChatWebsiteId':_0x35647b['id'],'ChatInteractionId':_0x1e8da8['id'],'direction':_0x65ff('0x5f'),'UserId':_0x1c44ad[_0x65ff('0x52')]['id']};return db[_0x65ff('0x60')][_0x65ff('0x4a')](_0x30be4c,{});}else{throw new db['Sequelize'][(_0x65ff('0x5b'))](_0x65ff('0x61'));}})[_0x65ff('0x2d')](function(){return _0x1e8da8['updateAttributes']({'vidaooSessionId':_0x562c6e['id']});})[_0x65ff('0x2d')](respondWithResult(_0x4c71d8,null))[_0x65ff('0x22')](handleError(_0x4c71d8,null));};exports[_0x65ff('0x62')]=function(_0x395fd5,_0x38fa78){if(_0x395fd5[_0x65ff('0x4b')]['id']){delete _0x395fd5[_0x65ff('0x4b')]['id'];}return db[_0x65ff('0x36')][_0x65ff('0x49')]({'where':{'id':_0x395fd5[_0x65ff('0x3e')]['id']},'include':[{'model':db[_0x65ff('0x63')],'as':_0x65ff('0x64')}]})['then'](handleEntityNotFound(_0x38fa78,null))[_0x65ff('0x2d')](saveUpdates(_0x395fd5[_0x65ff('0x4b')],null))[_0x65ff('0x2d')](respondWithResult(_0x38fa78,null))['catch'](handleError(_0x38fa78,null));};exports['abandon']=function(_0x2f2185,_0x546a71){if(_0x2f2185[_0x65ff('0x4b')]['id']){delete _0x2f2185[_0x65ff('0x4b')]['id'];}return db[_0x65ff('0x36')][_0x65ff('0x49')]({'where':{'id':_0x2f2185[_0x65ff('0x3e')]['id']}})[_0x65ff('0x2d')](function(_0x3000f9){if(!_0x3000f9){logger[_0x65ff('0x1d')](_0x65ff('0x65'),_0x65ff('0x66'),0x194,'entity\x20not\x20found');_0x546a71[_0x65ff('0x23')](0x194);}else{if(_0x3000f9[_0x65ff('0x67')]){throw new db[(_0x65ff('0x5a'))][(_0x65ff('0x5b'))](_0x65ff('0x68'));}}return _0x3000f9;})[_0x65ff('0x2d')](function(_0x4c021a){if(_0x4c021a){return _0x4c021a[_0x65ff('0x2c')]({'closed':_0x2f2185[_0x65ff('0x4b')]['closed'],'disposition':_0x2f2185['body'][_0x65ff('0x69')]})[_0x65ff('0x2d')](function(_0x2348b3){return _0x2348b3;});}})[_0x65ff('0x2d')](function(){return respondWithRpcPromise('AbandonInteraction',_0x65ff('0x66'),_0x2f2185['body'],client9004);})[_0x65ff('0x2d')](respondWithResult(_0x546a71,null))['catch'](handleError(_0x546a71,null));};exports['attachmentUpload']=function(_0x4f3ad0,_0x514ddd){_0x4f3ad0[_0x65ff('0x4b')][_0x65ff('0x30')]=_0x4f3ad0[_0x65ff('0x6a')][_0x65ff('0x6b')];_0x4f3ad0[_0x65ff('0x4b')][_0x65ff('0x6c')]=_0x4f3ad0['file'][_0x65ff('0x6d')];_0x4f3ad0['body'][_0x65ff('0x39')]=_0x4f3ad0['file'][_0x65ff('0x6e')];return db[_0x65ff('0x6f')][_0x65ff('0x4a')](_0x4f3ad0[_0x65ff('0x4b')])[_0x65ff('0x2d')](respondWithResult(_0x514ddd,0xc9))[_0x65ff('0x22')](handleError(_0x514ddd,null));};exports[_0x65ff('0x70')]=function(_0x41641a,_0x23e99a){return db[_0x65ff('0x36')][_0x65ff('0x4e')]({'where':{'id':_0x41641a[_0x65ff('0x3e')]['id']},'raw':!![]})[_0x65ff('0x2d')](handleEntityNotFound(_0x23e99a,null))['then'](function(_0xafcdcd){if(_0xafcdcd){if(_0xafcdcd[_0x65ff('0x71')]){return _0x23e99a[_0x65ff('0x24')](0x193)[_0x65ff('0x26')]({'status':0x193,'message':_0x65ff('0x72')});}return db['Attachment']['findOne']({'where':{'id':_0x41641a[_0x65ff('0x3c')][_0x65ff('0x73')]},'raw':!![]})[_0x65ff('0x2d')](handleEntityNotFound(_0x23e99a,null));}})[_0x65ff('0x2d')](function(_0x529b49){if(_0x529b49){var _0x2a0e86=_0x529b49['ChatOfflineMessageId']!==null;var _0x34d33c=path['join'](config[_0x65ff('0x74')],_0x65ff('0x75'));if(_0x2a0e86){_0x34d33c=path[_0x65ff('0x76')](_0x34d33c,_0x65ff('0x77'));}var _0x46f32a=path[_0x65ff('0x76')](_0x34d33c,_0x529b49[_0x65ff('0x6c')]);return _0x23e99a[_0x65ff('0x78')](_0x46f32a);}})[_0x65ff('0x22')](handleError(_0x23e99a,null));};exports[_0x65ff('0x79')]=function(_0x335210,_0x45f629){var _0x5a3f85=null;var _0x5da9c2=null;var _0x34a7c1=null;if(_0x335210['body']['id']){delete _0x335210[_0x65ff('0x4b')]['id'];}if(_0x335210[_0x65ff('0x4b')][_0x65ff('0x7a')]){_0x34a7c1=path[_0x65ff('0x76')](config[_0x65ff('0x74')],_0x65ff('0x7b'),util[_0x65ff('0x7c')](_0x65ff('0x7d'),Date[_0x65ff('0x7e')]()));_0x335210[_0x65ff('0x4b')][_0x65ff('0x7f')]=_0x34a7c1;}return db[_0x65ff('0x36')][_0x65ff('0x49')]({'where':{'id':_0x335210[_0x65ff('0x3e')]['id']},'include':[{'model':db[_0x65ff('0x60')],'as':_0x65ff('0x80'),'include':[{'model':db[_0x65ff('0x81')],'as':_0x65ff('0x81')}]}]})[_0x65ff('0x2d')](handleEntityNotFound(_0x45f629,null))['then'](saveUpdates(_0x335210[_0x65ff('0x4b')],null))[_0x65ff('0x2d')](function(_0x241c4a){if(_0x241c4a){_0x5a3f85=_0x241c4a;return db[_0x65ff('0x82')][_0x65ff('0x49')]({'where':{'id':_0x5a3f85['ChatWebsiteId']}});}})['then'](function(_0x47b687){if(_0x47b687){_0x5da9c2=_0x47b687;return db['CmContact']['find']({'where':{'id':_0x5a3f85[_0x65ff('0x83')]}});}})[_0x65ff('0x2d')](function(_0x5215ba){if(_0x5215ba){if(_0x34a7c1){var _0x34e4de=null;for(var _0x5370b2=0x1;_0x5370b2<_0x5a3f85[_0x65ff('0x80')][_0x65ff('0x45')];++_0x5370b2){_0x34e4de=_0x5a3f85[_0x65ff('0x80')][_0x5370b2];var _0xf44d8c=_0x34e4de['UserId']?util['format'](_0x65ff('0x84'),_0x5da9c2['agentAlias'],_0x34e4de['UserId']):_0x65ff('0x85');var _0x4d3276=_0x335210[_0x65ff('0x4b')]['customer']||util[_0x65ff('0x7c')](_0x65ff('0x84'),'Visitor',_0x34e4de[_0x65ff('0x83')]);switch(_0x5da9c2[_0x65ff('0x86')]){case'website_alias':_0xf44d8c=_0x34e4de['UserId']?util[_0x65ff('0x7c')](_0x65ff('0x84'),_0x5da9c2[_0x65ff('0x87')],_0x34e4de['UserId']):'System';break;case _0x65ff('0x88'):_0xf44d8c=_0x34e4de[_0x65ff('0x67')]?_0x34e4de['User'][_0x65ff('0x89')]||_0x34e4de[_0x65ff('0x81')][_0x65ff('0x53')]:'System';break;case _0x65ff('0x8a'):_0xf44d8c=_0x34e4de[_0x65ff('0x67')]?_0x34e4de[_0x65ff('0x81')][_0x65ff('0x53')]:_0x65ff('0x85');break;default:_0xf44d8c=_0x34e4de[_0x65ff('0x67')]?util[_0x65ff('0x7c')](_0x65ff('0x84'),_0x5da9c2[_0x65ff('0x87')],_0x34e4de[_0x65ff('0x67')]):'System';}var _0x3ccf34=util[_0x65ff('0x7c')](_0x65ff('0x8b'),moment(_0x34e4de[_0x65ff('0x8c')])['format'](_0x65ff('0x8d')),_0x34e4de[_0x65ff('0x8e')]==='in'?_0x4d3276:_0xf44d8c,_0x34e4de[_0x65ff('0x4b')]);if(!_0x34e4de[_0x65ff('0x8f')]){fs[_0x65ff('0x90')](_0x34a7c1,_0x3ccf34);}}return db[_0x65ff('0x91')][_0x65ff('0x4e')]({'where':{'service':!![]},'include':[{'model':db[_0x65ff('0x92')],'as':_0x65ff('0x93'),'raw':!![],'include':[{'model':db[_0x65ff('0x94')],'as':'CloudProvider','raw':!![]}]}]});}}})[_0x65ff('0x2d')](function(_0x57a2f3){if(!_0x57a2f3||!_0x57a2f3['Smtp']||!_0x335210[_0x65ff('0x4b')])return _0x5a3f85;var _0x31773f=_0x57a2f3[_0x65ff('0x95')]();return respondWithRpcPromise('SendMail',_0x65ff('0x96'),{'account':_0x31773f,'message':{'from':util['format'](_0x65ff('0x97'),_0x57a2f3[_0x65ff('0x30')],_0x57a2f3[_0x65ff('0x54')]||_0x57a2f3[_0x65ff('0x93')][_0x65ff('0x52')]),'to':_0x335210[_0x65ff('0x4b')][_0x65ff('0x7a')],'subject':_0x65ff('0x98'),'text':util[_0x65ff('0x7c')]('Hi\x20%s,\x20attached\x20you\x20can\x20find\x20your\x20transcript\x20file.\x20\x0a\x0aRegards.\x20\x0a\x0a',_0x335210['body'][_0x65ff('0x7a')]),'attachments':[{'path':_0x34a7c1}]}})['then'](function(){return _0x5a3f85;})[_0x65ff('0x22')](function(_0x592bdc){logger[_0x65ff('0x1d')](_0x592bdc);});})[_0x65ff('0x2d')](respondWithStatusCode(_0x45f629,0xc8))['catch'](handleError(_0x45f629,null));};exports['addMessage']=function(_0x39e4a2,_0x59b75a){return db['ChatMessage'][_0x65ff('0x49')]({'where':{'id':_0x39e4a2[_0x65ff('0x3e')]['id']}})['then'](handleEntityNotFound(_0x59b75a,null))[_0x65ff('0x2d')](function(_0x1441c){if(_0x1441c){return _0x1441c[_0x65ff('0x99')](_0x39e4a2[_0x65ff('0x4b')][_0x65ff('0x9a')],_[_0x65ff('0x9b')](_0x39e4a2[_0x65ff('0x4b')],['ids','id'])||{});}})[_0x65ff('0x2d')](respondWithResult(_0x59b75a,null))[_0x65ff('0x22')](handleError(_0x59b75a,null));};exports['getMessages']=function(_0x1ebc73,_0x26099d){var _0x179f06={'raw':![],'where':{}};var _0x4e5641={};var _0x587450={'count':0x0,'rows':[]};return db[_0x65ff('0x36')]['findOne']({'where':{'id':_0x1ebc73[_0x65ff('0x3e')]['id']}})[_0x65ff('0x2d')](handleEntityNotFound(_0x26099d,null))['then'](function(_0x3ac77e){if(_0x3ac77e){_0x4e5641[_0x65ff('0x3f')]=_[_0x65ff('0x40')](db[_0x65ff('0x60')][_0x65ff('0x37')]);_0x4e5641['query']=_[_0x65ff('0x40')](_0x1ebc73['query']);_0x4e5641['filters']=_[_0x65ff('0x42')](_0x4e5641[_0x65ff('0x3f')],_0x4e5641[_0x65ff('0x3c')]);_0x179f06['attributes']=_[_0x65ff('0x42')](_0x4e5641[_0x65ff('0x3f')],qs['fields'](_0x1ebc73['query'][_0x65ff('0x43')]));_0x179f06[_0x65ff('0x44')]=_0x179f06[_0x65ff('0x44')][_0x65ff('0x45')]?_0x179f06[_0x65ff('0x44')]:_0x4e5641[_0x65ff('0x3f')];if(!_0x1ebc73[_0x65ff('0x3c')][_0x65ff('0x9c')](_0x65ff('0x9d'))){_0x179f06['limit']=qs[_0x65ff('0x29')](_0x1ebc73['query'][_0x65ff('0x29')]);_0x179f06['offset']=qs['offset'](_0x1ebc73[_0x65ff('0x3c')]['offset']);}_0x179f06[_0x65ff('0x9e')]=qs[_0x65ff('0x9f')](_0x1ebc73[_0x65ff('0x3c')][_0x65ff('0x9f')]);_0x179f06[_0x65ff('0xa0')]=qs['filters'](_['pick'](_0x1ebc73[_0x65ff('0x3c')],_0x4e5641[_0x65ff('0x41')]));_0x179f06[_0x65ff('0xa0')]['ChatInteractionId']=_0x3ac77e['id'];if(_0x1ebc73[_0x65ff('0x3c')]['filter']){_0x179f06['where']=_[_0x65ff('0x32')](_0x179f06['where'],{'$or':_[_0x65ff('0xa1')](_0x179f06[_0x65ff('0x44')],function(_0x4f6353){var _0x5903fd={};_0x5903fd[_0x4f6353]={'$like':'%'+_0x1ebc73[_0x65ff('0x3c')]['filter']+'%'};return _0x5903fd;})});}if(_0x1ebc73[_0x65ff('0x3c')][_0x65ff('0xa2')]){var _0x2be3db=_0x1ebc73[_0x65ff('0x3c')][_0x65ff('0xa2')][_0x65ff('0xa3')](',');var _0x593585={};_0x593585[_0x2be3db[0x0]]={'$gte':moment(_0x2be3db[0x1])['format'](_0x65ff('0xa4'))};_0x179f06[_0x65ff('0xa0')]=_[_0x65ff('0x32')](_0x179f06[_0x65ff('0xa0')],_0x593585);}_0x179f06=_[_0x65ff('0x32')]({},_0x179f06,_0x1ebc73[_0x65ff('0x48')]);return db[_0x65ff('0x60')]['count']({'where':_0x179f06['where']})[_0x65ff('0x2d')](function(_0x2349a2){_0x587450['count']=_0x2349a2;if(_0x1ebc73[_0x65ff('0x3c')][_0x65ff('0x46')]){_0x179f06['include']=[{'all':!![]}];}return db[_0x65ff('0x60')][_0x65ff('0xa5')](_0x179f06);})[_0x65ff('0x2d')](function(_0x15a540){_0x587450[_0x65ff('0xa6')]=_0x15a540;return _0x587450;});}})[_0x65ff('0x2d')](respondWithFilteredResult(_0x26099d,_0x179f06))[_0x65ff('0x22')](handleError(_0x26099d,null));};exports[_0x65ff('0xa7')]=function(_0x33d98c,_0x1670fd){var _0x9ae205={'where':{}},_0x10bf52={},_0x522e6a={'count':0x0,'rows':[]};return db[_0x65ff('0x36')][_0x65ff('0x4e')]({'where':{'id':_0x33d98c[_0x65ff('0x3e')]['id']}})[_0x65ff('0x2d')](handleEntityNotFound(_0x1670fd,null))['then'](function(_0x46cbe3){if(_0x46cbe3){_0x10bf52[_0x65ff('0x3f')]=_[_0x65ff('0x40')](db[_0x65ff('0x60')][_0x65ff('0x37')]);_0x10bf52[_0x65ff('0x3c')]=_[_0x65ff('0x40')](_0x33d98c[_0x65ff('0x3c')]);_0x10bf52[_0x65ff('0x41')]=_[_0x65ff('0x42')](_0x10bf52[_0x65ff('0x3f')],_0x10bf52[_0x65ff('0x3c')]);_0x9ae205[_0x65ff('0x44')]=_['intersection'](_0x10bf52[_0x65ff('0x3f')],qs[_0x65ff('0x43')](_0x33d98c['query'][_0x65ff('0x43')]));_0x9ae205[_0x65ff('0x44')]=_0x9ae205['attributes'][_0x65ff('0x45')]?_0x9ae205[_0x65ff('0x44')]:_0x10bf52['model'];if(!_0x33d98c[_0x65ff('0x3c')][_0x65ff('0x9c')](_0x65ff('0x9d'))){_0x9ae205[_0x65ff('0x29')]=qs[_0x65ff('0x29')](_0x33d98c['query'][_0x65ff('0x29')]);_0x9ae205['offset']=qs['offset'](_0x33d98c[_0x65ff('0x3c')][_0x65ff('0x27')]);}_0x9ae205[_0x65ff('0x9e')]=qs[_0x65ff('0x9f')](_0x33d98c[_0x65ff('0x3c')][_0x65ff('0x9f')]);_0x9ae205[_0x65ff('0xa0')]=qs[_0x65ff('0x41')](_[_0x65ff('0xa8')](_0x33d98c['query'],_0x10bf52[_0x65ff('0x41')]));_0x9ae205[_0x65ff('0xa0')]['ChatInteractionId']=_0x46cbe3['id'];if(_0x33d98c[_0x65ff('0x3c')][_0x65ff('0xa9')]){_0x9ae205[_0x65ff('0xa0')]=_[_0x65ff('0x32')](_0x9ae205[_0x65ff('0xa0')],{'$or':_['map'](_0x9ae205[_0x65ff('0x44')],function(_0xe56200){var _0x16cdff={};_0x16cdff[_0xe56200]={'$like':'%'+_0x33d98c[_0x65ff('0x3c')][_0x65ff('0xa9')]+'%'};return _0x16cdff;})});}_0x9ae205[_0x65ff('0xa0')][_0x65ff('0x8f')]=![];if(_0x33d98c[_0x65ff('0x3c')]['id']){_0x9ae205[_0x65ff('0xa0')]['id']={'$gt':_0x33d98c[_0x65ff('0x3c')]['id']};}_0x9ae205=_[_0x65ff('0x32')]({},_0x9ae205,_0x33d98c['options']);return db['ChatMessage'][_0x65ff('0x2a')]({'where':_0x9ae205[_0x65ff('0xa0')]})[_0x65ff('0x2d')](function(_0x212766){_0x522e6a[_0x65ff('0x2a')]=_0x212766;_0x9ae205['include']=[];if(_0x33d98c[_0x65ff('0x3c')][_0x65ff('0xaa')]){_0x9ae205[_0x65ff('0x47')][_0x65ff('0xab')]({'model':db[_0x65ff('0x81')],'as':_0x65ff('0x81'),'attributes':['id',_0x65ff('0x53'),_0x65ff('0x89')]});}if(_0x33d98c[_0x65ff('0x3c')][_0x65ff('0x46')]){_0x9ae205[_0x65ff('0x47')]=[{'all':!![]}];}return db['ChatMessage'][_0x65ff('0xa5')](_0x9ae205);})['then'](function(_0x438804){_0x522e6a[_0x65ff('0xa6')]=_0x438804;return _0x522e6a;});}})[_0x65ff('0x2d')](respondWithFilteredResult(_0x1670fd,_0x9ae205))[_0x65ff('0x22')](handleError(_0x1670fd,null));};exports[_0x65ff('0xac')]=function(_0x1ea5b5,_0x3fdfc5){return db[_0x65ff('0x36')]['find']({'where':{'id':_0x1ea5b5[_0x65ff('0x3e')]['id']}})['then'](handleEntityNotFound(_0x3fdfc5,null))[_0x65ff('0x2d')](function(_0xa26331){if(_0xa26331){return _0xa26331[_0x65ff('0xad')](_0x1ea5b5[_0x65ff('0x4b')][_0x65ff('0x9a')],_[_0x65ff('0x9b')](_0x1ea5b5[_0x65ff('0x4b')],[_0x65ff('0x9a'),'id'])||{})[_0x65ff('0xae')](function(){return db[_0x65ff('0xaf')][_0x65ff('0xa5')]({'attributes':['id','name','color'],'where':{'id':_0x1ea5b5[_0x65ff('0x4b')][_0x65ff('0x9a')]}});})[_0x65ff('0x2d')](function(_0x1f1b64){socket[_0x65ff('0xb0')]('chatInteractionTags:save',{'id':Number(_0x1ea5b5['params']['id']),'tags':_0x1f1b64||[]});return{'id':Number(_0x1ea5b5['params']['id']),'tags':_0x1f1b64||[]};});}})[_0x65ff('0x2d')](respondWithResult(_0x3fdfc5,null))[_0x65ff('0x22')](handleError(_0x3fdfc5,null));};exports[_0x65ff('0xb1')]=function(_0x3534c1,_0x33f14f){return db['ChatInteraction'][_0x65ff('0x49')]({'where':{'id':_0x3534c1[_0x65ff('0x3e')]['id']}})[_0x65ff('0x2d')](handleEntityNotFound(_0x33f14f,null))[_0x65ff('0x2d')](function(_0x1ed4b9){if(_0x1ed4b9){return _0x1ed4b9[_0x65ff('0xb1')](_0x3534c1['query'][_0x65ff('0x9a')]);}})[_0x65ff('0x2d')](respondWithStatusCode(_0x33f14f,null))[_0x65ff('0x22')](handleError(_0x33f14f,null));};exports[_0x65ff('0x78')]=function(_0x448cb7,_0x40427e){var _0x3e7fc9=moment()[_0x65ff('0xb2')]()['toString']();var _0x197f54=path[_0x65ff('0x76')](config[_0x65ff('0x74')],_0x65ff('0xb3'),'files',_0x65ff('0xb4'));var _0x3fa5b7=path[_0x65ff('0x76')](config[_0x65ff('0x74')],_0x65ff('0xb3'),_0x65ff('0xb5'),_0x65ff('0xb6'));var _0x488ce7=path[_0x65ff('0x76')](_0x197f54,_0x3e7fc9);var _0x24ae9f=util[_0x65ff('0x7c')](_0x65ff('0xb7'),_0x448cb7['params']['id'],_0x3e7fc9);var _0x55cbf9=path['join'](_0x197f54,_0x24ae9f);var _0x383fe9=[];_0x383fe9['push']({'model':db[_0x65ff('0x81')],'as':_0x65ff('0x81'),'attributes':['id','fullname'],'raw':!![]});_0x383fe9[_0x65ff('0xab')]({'model':db[_0x65ff('0x63')],'as':_0x65ff('0x64'),'attributes':['id',_0x65ff('0xb8'),_0x65ff('0xb9')],'raw':!![]});if(_0x448cb7['query']['attachments']){_0x383fe9[_0x65ff('0xab')]({'model':db['Attachment'],'as':'Attachment','raw':!![]});}var _0x592cde=[{'model':db[_0x65ff('0x60')],'as':_0x65ff('0x80'),'attributes':['id',_0x65ff('0x4b'),_0x65ff('0x8c'),_0x65ff('0x8e'),_0x65ff('0x8f'),_0x65ff('0xba')],'include':_0x383fe9}];_0x592cde[_0x65ff('0xab')]({'model':db[_0x65ff('0x82')],'as':_0x65ff('0xbb'),'attributes':['id','name']});_0x592cde[_0x65ff('0xab')]({'model':db[_0x65ff('0x81')],'as':_0x65ff('0xbc'),'attributes':['id',_0x65ff('0x53')]});return db[_0x65ff('0x36')][_0x65ff('0x49')]({'where':{'id':_0x448cb7[_0x65ff('0x3e')]['id']},'include':_0x592cde})[_0x65ff('0x2d')](handleEntityNotFound(_0x40427e,null))['then'](function(_0x37a3f2){if(_0x37a3f2){var _0x44f66a=_0x37a3f2['get']({'plain':!![]});fs[_0x65ff('0xbd')](_0x488ce7);var _0x3e74f2={'channel':_0x65ff('0xbe'),'account':_0x44f66a[_0x65ff('0xbb')][_0x65ff('0x30')],'agent':_0x44f66a[_0x65ff('0xbc')]?_0x44f66a[_0x65ff('0xbc')]['fullname']:'N.A.','createdAt':moment(_0x44f66a[_0x65ff('0x8c')])[_0x65ff('0x7c')](_0x65ff('0xa4'))[_0x65ff('0xbf')](),'closedAt':_0x44f66a[_0x65ff('0x71')]?moment(_0x44f66a['closedAt'])['format'](_0x65ff('0xa4'))[_0x65ff('0xbf')]():'','disposition':_0x44f66a[_0x65ff('0x69')],'chatInfo':{'browser':_0x44f66a[_0x65ff('0xc0')],'os':_0x44f66a[_0x65ff('0xc1')],'referer':_0x44f66a[_0x65ff('0xc2')],'customerIp':_0x44f66a[_0x65ff('0xc3')],'customerPort':_0x44f66a['customerPort']?_0x44f66a[_0x65ff('0xc4')]:_0x65ff('0xc5')},'messages':_(_0x44f66a['Messages'])[_0x65ff('0xc6')]()['filter']({'secret':![]})['map'](function(_0x433eea){if(_0x433eea[_0x65ff('0x6f')]){var _0x16e893=path[_0x65ff('0x76')](_0x3fa5b7,_0x433eea['Attachment']['basename']);if(fs[_0x65ff('0xc7')](_0x16e893)){fs['createReadStream'](_0x16e893)[_0x65ff('0xc8')](fs['createWriteStream'](path['join'](_0x488ce7,_0x433eea[_0x65ff('0x6f')][_0x65ff('0x6c')])));}}return{'date':moment(_0x433eea[_0x65ff('0x8c')])[_0x65ff('0x7c')]('YYYY-MM-DD\x20HH:mm:ss')[_0x65ff('0xbf')](),'sender':_0x433eea[_0x65ff('0x8e')]===_0x65ff('0x5f')?_0x433eea['User']?_0x433eea[_0x65ff('0x81')][_0x65ff('0x53')]:_0x65ff('0x85'):_0x433eea['Contact'][_0x65ff('0xb8')]+(_0x433eea[_0x65ff('0x64')][_0x65ff('0xb9')]?'\x20'+_0x433eea[_0x65ff('0x64')][_0x65ff('0xb9')]:''),'body':_0x433eea['Attachment']?_0x433eea[_0x65ff('0x6f')][_0x65ff('0x6c')]:_0x433eea[_0x65ff('0x4b')],'direction':_0x433eea[_0x65ff('0x8e')]===_0x65ff('0x5f')?'A':'C','secret':_0x433eea[_0x65ff('0x8f')],'read':_0x433eea[_0x65ff('0xba')],'attachment':_0x433eea[_0x65ff('0x6f')]};})[_0x65ff('0xc9')]()};return ejs[_0x65ff('0xca')](path[_0x65ff('0x76')](config['root'],'server',_0x65ff('0xcb'),_0x65ff('0xcc')),{'interaction':_0x3e74f2})[_0x65ff('0x2d')](function(_0x465dad){var _0x411545=path[_0x65ff('0x76')](_0x488ce7,_0x65ff('0xcd')+_0x44f66a['id']+'-'+_0x3e7fc9+'.pdf');var _0x1f7569={'path':_0x411545,'channel':'Chat','interactionId':_0x44f66a['id']};return pdf[_0x65ff('0xce')](_0x465dad,_0x1f7569);})[_0x65ff('0x2d')](function(){return new Promise(function(_0x34d1d3,_0x5e6d2b){zipdir(_0x488ce7,{'saveTo':_0x55cbf9},function(_0x666c8a,_0x8e4709){if(_0x666c8a)return _0x5e6d2b(_0x666c8a);return _0x34d1d3(_0x8e4709);});})['then'](function(){return new BPromise(function(_0x51c634,_0x2f7be8){rimraf(_0x488ce7,function(_0xce3ee8){if(_0xce3ee8)_0x2f7be8(_0xce3ee8);return _0x51c634();});});})[_0x65ff('0x2d')](function(){return _0x40427e[_0x65ff('0x78')](_0x55cbf9,_0x24ae9f,function(_0x2cf379){if(_0x2cf379){logger[_0x65ff('0x1d')](_0x65ff('0xcf'),_0x2cf379);}else{fs['unlinkSync'](_0x55cbf9);}});});});}else{return _0x40427e[_0x65ff('0x23')](0xc8);}})[_0x65ff('0x22')](handleError(_0x40427e,null));};
\ No newline at end of file
+var _0x9f9f=['mailTranscript','addMessage','omit','hasOwnProperty','order','sort','where','pick','map','filter','$gte','split','YYYY-MM-DD\x20HH:mm:ss','filters','ChatInteractionId','include','includeAgent','includeAll','rows','addTags','setTags','ids','spread','emit','removeTags','unix','toString','server','attachments','transcript-%d-%s.zip','push','firstName','lastName','read','Account','Owner','get','mkdirSync','closedAt','browserName','osName','customerIp','customerPort','N.A.','existsSync','createWriteStream','out','renderFile','downloadInteraction.ejs','.pdf','Chat','createPdfFromHTML','err','unlinkSync','rimraf','zip-dir','moment','path','ejs','lodash','ioredis','../../components/interaction/service','../../components/parsers/qs','../../components/export/pdf','api','../../config/environment','../../mysqldb','redis','defaults','socket.io-emitter','./chatInteraction.socket','register','client','http','request','info','request\x20sent','debug','ChatInteraction,\x20%s,\x20%s,\x20%s','error','code','ChatInteraction,\x20%s,\x20%s','message','result','catch','sendStatus','end','status','json','limit','undefined','count','offset','set','Content-Range','update','then','stack','name','send','render','merge','contact','agent','rawAttributes','getOptions','findAll','chat','query','user','show','params','model','keys','ChatInteraction','intersection','attributes','fields','length','options','find','create','body','destroy','describe','createVidaooSession','findOne','ChatWebsite','ChatWebsiteId','vidaooApiKey','vidaooEscalation','vidaooNote','fullname','email','POST','https://api-vidaoo.xcally.com/api/v1/meetings','vidaooTopic','isNull','vidaooMetadata','parse','metadata','Sequelize','ValidationError','Error\x20in\x20conversion\x20vidaooMetadata','Error\x20in\x20Vidaoo\x20configuration','join_url','ChatMessage','updateAttributes','customUpdate','CmContact','Contact','abandon','entity\x20not\x20found','UserId','Interaction\x20already\x20assigned','closed','disposition','AbandonInteraction','attachmentUpload','file','originalname','basename','filename','type','mimetype','Attachment','attachmentDownload','Unauthorized','attachId','ChatOfflineMessageId','root','join','download','close','server/files/chat/upload/','format','now','pathTranscript','Messages','User','%s%d','System','Visitor','ContactId','agentIdentifier','website_alias','agentAlias','agent_alias','[%s]\x20%s:\x20%s\x0a','createdAt','MM/DD/YYYY\x20HH:mm:ss','direction','secret','appendFileSync','MailAccount','MailServerOut','Smtp','CloudProvider','getSmtpOptions','SendMail','sendMail','Mail\x20Transcript','Hi\x20%s,\x20attached\x20you\x20can\x20find\x20your\x20transcript\x20file.\x20\x0a\x0aRegards.\x20\x0a\x0a'];(function(_0x13248d,_0x35184a){var _0x564f27=function(_0x32ce2c){while(--_0x32ce2c){_0x13248d['push'](_0x13248d['shift']());}};_0x564f27(++_0x35184a);}(_0x9f9f,0x101));var _0xf9f9=function(_0x4b1dfb,_0x234bb9){_0x4b1dfb=_0x4b1dfb-0x0;var _0xec6b30=_0x9f9f[_0x4b1dfb];return _0xec6b30;};'use strict';var rimraf=require(_0xf9f9('0x0'));var zipdir=require(_0xf9f9('0x1'));var rp=require('request-promise');var moment=require(_0xf9f9('0x2'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require('util');var path=require(_0xf9f9('0x3'));var ejs=require(_0xf9f9('0x4'));var fs=require('fs');var _=require(_0xf9f9('0x5'));var Redis=require(_0xf9f9('0x6'));var interaction=require(_0xf9f9('0x7'));var qs=require(_0xf9f9('0x8'));var pdf=require(_0xf9f9('0x9'));var logger=require('../../config/logger')(_0xf9f9('0xa'));var config=require(_0xf9f9('0xb'));var db=require(_0xf9f9('0xc'))['db'];config[_0xf9f9('0xd')]=_[_0xf9f9('0xe')](config[_0xf9f9('0xd')],{'host':'localhost','port':0x18eb});var socket=require(_0xf9f9('0xf'))(new Redis(config[_0xf9f9('0xd')]));require(_0xf9f9('0x10'))[_0xf9f9('0x11')](socket);var jayson=require('jayson/promise');var client=jayson[_0xf9f9('0x12')][_0xf9f9('0x13')]({'port':0x232b});var client9004=jayson[_0xf9f9('0x12')][_0xf9f9('0x13')]({'port':0x232c});function respondWithRpcPromise(_0xe6680d,_0x590420,_0x1e2556,_0x2cd5e3){return new BPromise(function(_0x185559,_0x89f30){var _0xd55728=_0x2cd5e3||client;return _0xd55728[_0xf9f9('0x14')](_0xe6680d,_0x1e2556)['then'](function(_0x9087df){logger[_0xf9f9('0x15')]('ChatInteraction,\x20%s,\x20%s',_0x590420,_0xf9f9('0x16'));logger[_0xf9f9('0x17')](_0xf9f9('0x18'),_0x590420,_0xf9f9('0x16'),JSON['stringify'](_0x9087df));if(_0x9087df[_0xf9f9('0x19')]){if(_0x9087df[_0xf9f9('0x19')][_0xf9f9('0x1a')]===0x1f4){logger[_0xf9f9('0x19')](_0xf9f9('0x1b'),_0x590420,_0x9087df['error']['message']);return _0x89f30(_0x9087df[_0xf9f9('0x19')][_0xf9f9('0x1c')]);}logger[_0xf9f9('0x19')](_0xf9f9('0x1b'),_0x590420,_0x9087df[_0xf9f9('0x19')][_0xf9f9('0x1c')]);return _0x185559(_0x9087df[_0xf9f9('0x19')][_0xf9f9('0x1c')]);}else{logger['info']('ChatInteraction,\x20%s,\x20%s',_0x590420,'request\x20sent');_0x185559(_0x9087df[_0xf9f9('0x1d')]['message']);}})[_0xf9f9('0x1e')](function(_0x2964df){logger[_0xf9f9('0x19')](_0xf9f9('0x1b'),_0x590420,_0x2964df);_0x89f30(_0x2964df);});});}function respondWithStatusCode(_0x468c50,_0x11ac14){_0x11ac14=_0x11ac14||0xcc;return function(_0x155228){if(_0x155228){return _0x468c50[_0xf9f9('0x1f')](_0x11ac14);}return _0x468c50['status'](_0x11ac14)[_0xf9f9('0x20')]();};}function respondWithResult(_0x17bc9c,_0x2ee140){_0x2ee140=_0x2ee140||0xc8;return function(_0x44227a){if(_0x44227a){return _0x17bc9c[_0xf9f9('0x21')](_0x2ee140)[_0xf9f9('0x22')](_0x44227a);}};}function respondWithFilteredResult(_0x49c85e,_0x525eb8){return function(_0x11b09f){if(_0x11b09f){var _0x1a5704=typeof _0x525eb8['offset']==='undefined'&&typeof _0x525eb8[_0xf9f9('0x23')]===_0xf9f9('0x24');var _0x28836f=_0x11b09f[_0xf9f9('0x25')];var _0x1523f2=_0x1a5704?0x0:_0x525eb8[_0xf9f9('0x26')];var _0x2f54fa=_0x1a5704?_0x11b09f[_0xf9f9('0x25')]:_0x525eb8['offset']+_0x525eb8[_0xf9f9('0x23')];var _0x45909d;if(_0x2f54fa>=_0x28836f){_0x2f54fa=_0x28836f;_0x45909d=0xc8;}else{_0x45909d=0xce;}_0x49c85e[_0xf9f9('0x21')](_0x45909d);return _0x49c85e[_0xf9f9('0x27')](_0xf9f9('0x28'),_0x1523f2+'-'+_0x2f54fa+'/'+_0x28836f)[_0xf9f9('0x22')](_0x11b09f);}return null;};}function saveUpdates(_0x1c85e9){return function(_0x5d1400){if(_0x5d1400){return _0x5d1400[_0xf9f9('0x29')](_0x1c85e9)[_0xf9f9('0x2a')](function(_0x4bb96b){return _0x4bb96b;});}return null;};}function removeEntity(_0x518ec4){return function(_0x639621){if(_0x639621){return _0x639621['destroy']()[_0xf9f9('0x2a')](function(){_0x518ec4[_0xf9f9('0x21')](0xcc)['end']();});}};}function handleEntityNotFound(_0x55ac36){return function(_0x41f7dc){if(!_0x41f7dc){_0x55ac36['sendStatus'](0x194);}return _0x41f7dc;};}function handleError(_0xda921d,_0x2a4f63){_0x2a4f63=_0x2a4f63||0x1f4;return function(_0x1f380c){logger[_0xf9f9('0x19')](_0x1f380c[_0xf9f9('0x2b')]);if(_0x1f380c[_0xf9f9('0x2c')]){delete _0x1f380c[_0xf9f9('0x2c')];}_0xda921d[_0xf9f9('0x21')](_0x2a4f63)[_0xf9f9('0x2d')](_0x1f380c);};}function getMustacheRender(_0x394865,_0x4c3125){return Mustache[_0xf9f9('0x2e')](_0x394865,_[_0xf9f9('0x2f')](_0x4c3125['body'],{'contact':_0x4c3125[_0xf9f9('0x30')],'message':_0x4c3125[_0xf9f9('0x1c')],'agent':_0x4c3125[_0xf9f9('0x31')],'interaction':_0x4c3125['interaction'],'account':_0x4c3125['account']}))||'';}exports['index']=function(_0x351e24,_0x474ca5){var _0x3e68db={};var _0x185d00=_['map'](db['ChatInteraction'][_0xf9f9('0x32')],function(_0x23bf00){return{'name':_0x23bf00['fieldName'],'type':_0x23bf00['type']['key']};});_0x3e68db=qs[_0xf9f9('0x33')](_0x185d00,_0x351e24);return interaction[_0xf9f9('0x34')](_0xf9f9('0x35'),_0x351e24[_0xf9f9('0x36')],_0x351e24[_0xf9f9('0x37')],_0x3e68db,_0x185d00)['then'](respondWithFilteredResult(_0x474ca5,_0x3e68db))['catch'](handleError(_0x474ca5,null));};exports[_0xf9f9('0x38')]=function(_0xe535f,_0x157bc3){var _0x15bf56={'raw':![],'where':{'id':_0xe535f[_0xf9f9('0x39')]['id']}},_0x257db5={};_0x257db5[_0xf9f9('0x3a')]=_[_0xf9f9('0x3b')](db[_0xf9f9('0x3c')][_0xf9f9('0x32')]);_0x257db5[_0xf9f9('0x36')]=_[_0xf9f9('0x3b')](_0xe535f['query']);_0x257db5['filters']=_[_0xf9f9('0x3d')](_0x257db5[_0xf9f9('0x3a')],_0x257db5[_0xf9f9('0x36')]);_0x15bf56[_0xf9f9('0x3e')]=_[_0xf9f9('0x3d')](_0x257db5[_0xf9f9('0x3a')],qs[_0xf9f9('0x3f')](_0xe535f[_0xf9f9('0x36')][_0xf9f9('0x3f')]));_0x15bf56[_0xf9f9('0x3e')]=_0x15bf56[_0xf9f9('0x3e')][_0xf9f9('0x40')]?_0x15bf56[_0xf9f9('0x3e')]:_0x257db5[_0xf9f9('0x3a')];if(_0xe535f['query']['includeAll']){_0x15bf56['include']=[{'all':!![]}];}_0x15bf56=_[_0xf9f9('0x2f')]({},_0x15bf56,_0xe535f[_0xf9f9('0x41')]);return db[_0xf9f9('0x3c')][_0xf9f9('0x42')](_0x15bf56)[_0xf9f9('0x2a')](handleEntityNotFound(_0x157bc3,null))[_0xf9f9('0x2a')](respondWithResult(_0x157bc3,null))[_0xf9f9('0x1e')](handleError(_0x157bc3,null));};exports['create']=function(_0x271972,_0x565193){return db['ChatInteraction'][_0xf9f9('0x43')](_0x271972['body'],{})[_0xf9f9('0x2a')](respondWithResult(_0x565193,0xc9))[_0xf9f9('0x1e')](handleError(_0x565193,null));};exports[_0xf9f9('0x29')]=function(_0x351cff,_0x4e2d8d){if(_0x351cff[_0xf9f9('0x44')]['id']){delete _0x351cff[_0xf9f9('0x44')]['id'];}return db[_0xf9f9('0x3c')][_0xf9f9('0x42')]({'where':{'id':_0x351cff['params']['id']}})['then'](handleEntityNotFound(_0x4e2d8d,null))[_0xf9f9('0x2a')](saveUpdates(_0x351cff[_0xf9f9('0x44')],null))['then'](respondWithResult(_0x4e2d8d,null))[_0xf9f9('0x1e')](handleError(_0x4e2d8d,null));};exports[_0xf9f9('0x45')]=function(_0x1b2966,_0x5bba9b){return db[_0xf9f9('0x3c')]['find']({'where':{'id':_0x1b2966[_0xf9f9('0x39')]['id']}})[_0xf9f9('0x2a')](handleEntityNotFound(_0x5bba9b,null))[_0xf9f9('0x2a')](removeEntity(_0x5bba9b,null))[_0xf9f9('0x1e')](handleError(_0x5bba9b,null));};exports[_0xf9f9('0x46')]=function(_0x1e1f51,_0x4094dd){return db[_0xf9f9('0x3c')][_0xf9f9('0x46')]()['then'](respondWithResult(_0x4094dd,null))['catch'](handleError(_0x4094dd,null));};exports[_0xf9f9('0x47')]=function(_0x3eb2f1,_0x52bdec){var _0x610bb=_0x3eb2f1['params']['id'];var _0x3cc4da;var _0x42d8be;var _0x60dff6;return db['ChatInteraction'][_0xf9f9('0x48')]({'where':{'id':_0x610bb}})[_0xf9f9('0x2a')](function(_0x589423){_0x3cc4da=_0x589423;return db[_0xf9f9('0x49')][_0xf9f9('0x48')]({'where':{'id':_0x589423[_0xf9f9('0x4a')]},'attributes':['id',_0xf9f9('0x4b'),_0xf9f9('0x4c'),'vidaooTopic',_0xf9f9('0x4d'),'vidaooMetadata'],'raw':!![]});})['then'](function(_0x4d80fb){if(_0x4d80fb&&_0x4d80fb['vidaooApiKey']&&_0x4d80fb[_0xf9f9('0x4c')]){_0x42d8be=_0x4d80fb;var _0x50894c={'interaction':{'id':_0x610bb},'agent':{'id':_0x3eb2f1[_0xf9f9('0x37')]['id'],'name':_0x3eb2f1['user'][_0xf9f9('0x2c')],'fullname':_0x3eb2f1[_0xf9f9('0x37')][_0xf9f9('0x4e')],'email':_0x3eb2f1['user'][_0xf9f9('0x4f')]},'contact':_0x3eb2f1[_0xf9f9('0x44')]['contact'],'account':_0x3eb2f1[_0xf9f9('0x44')]['account']};var _0x2cf55d={'rejectUnauthorized':![],'method':_0xf9f9('0x50'),'url':_0xf9f9('0x51'),'headers':{'X-APIKEY':_0x4d80fb[_0xf9f9('0x4b')]},'body':{'duration':null,'scheduledAt':null,'participants':[_0x3eb2f1[_0xf9f9('0x37')][_0xf9f9('0x4f')]],'buttons':null,'topic':_0x42d8be[_0xf9f9('0x52')],'note':_[_0xf9f9('0x53')](_0x42d8be[_0xf9f9('0x4d')])?null:getMustacheRender(_0x42d8be[_0xf9f9('0x4d')],_0x50894c),'metadata':null},'redirect':'follow','json':!![]};try{if(!_['isNull'](_0x42d8be[_0xf9f9('0x54')])){var _0x5c8958=getMustacheRender(_0x42d8be[_0xf9f9('0x54')],_0x50894c);var _0x2489c7=JSON[_0xf9f9('0x55')](_0x5c8958);_0x2cf55d[_0xf9f9('0x44')][_0xf9f9('0x56')]=_0x2489c7;}}catch(_0x10119b){throw new db[(_0xf9f9('0x57'))][(_0xf9f9('0x58'))](_0xf9f9('0x59'));}return rp(_0x2cf55d);}else{throw new db[(_0xf9f9('0x57'))]['ValidationError'](_0xf9f9('0x5a'));}})[_0xf9f9('0x2a')](function(_0x154344){_0x60dff6=_0x154344;if(_0x60dff6['id']){var _0x340d5e={'body':_0x60dff6[_0xf9f9('0x5b')],'ChatWebsiteId':_0x42d8be['id'],'ChatInteractionId':_0x3cc4da['id'],'direction':'out','UserId':_0x3eb2f1['user']['id']};return db[_0xf9f9('0x5c')][_0xf9f9('0x43')](_0x340d5e,{});}else{throw new db['Sequelize'][(_0xf9f9('0x58'))]('Unable\x20to\x20create\x20Vidaoo\x20session');}})[_0xf9f9('0x2a')](function(){return _0x3cc4da[_0xf9f9('0x5d')]({'vidaooSessionId':_0x60dff6['id']});})[_0xf9f9('0x2a')](respondWithResult(_0x52bdec,null))[_0xf9f9('0x1e')](handleError(_0x52bdec,null));};exports[_0xf9f9('0x5e')]=function(_0x5843bc,_0x1e4a7e){if(_0x5843bc[_0xf9f9('0x44')]['id']){delete _0x5843bc[_0xf9f9('0x44')]['id'];}return db['ChatInteraction'][_0xf9f9('0x42')]({'where':{'id':_0x5843bc[_0xf9f9('0x39')]['id']},'include':[{'model':db[_0xf9f9('0x5f')],'as':_0xf9f9('0x60')}]})[_0xf9f9('0x2a')](handleEntityNotFound(_0x1e4a7e,null))['then'](saveUpdates(_0x5843bc[_0xf9f9('0x44')],null))[_0xf9f9('0x2a')](respondWithResult(_0x1e4a7e,null))['catch'](handleError(_0x1e4a7e,null));};exports[_0xf9f9('0x61')]=function(_0xfedca4,_0x8f931a){if(_0xfedca4[_0xf9f9('0x44')]['id']){delete _0xfedca4[_0xf9f9('0x44')]['id'];}return db['ChatInteraction'][_0xf9f9('0x42')]({'where':{'id':_0xfedca4[_0xf9f9('0x39')]['id']}})[_0xf9f9('0x2a')](function(_0x3ac64e){if(!_0x3ac64e){logger[_0xf9f9('0x19')]('abandonInteraction,\x20%s,\x20%s,\x20%s',_0xf9f9('0x61'),0x194,_0xf9f9('0x62'));_0x8f931a[_0xf9f9('0x1f')](0x194);}else{if(_0x3ac64e[_0xf9f9('0x63')]){throw new db[(_0xf9f9('0x57'))]['ValidationError'](_0xf9f9('0x64'));}}return _0x3ac64e;})['then'](function(_0x3e3fc){if(_0x3e3fc){return _0x3e3fc[_0xf9f9('0x29')]({'closed':_0xfedca4['body'][_0xf9f9('0x65')],'disposition':_0xfedca4[_0xf9f9('0x44')][_0xf9f9('0x66')]})['then'](function(_0x36d741){return _0x36d741;});}})['then'](function(){return respondWithRpcPromise(_0xf9f9('0x67'),_0xf9f9('0x61'),_0xfedca4[_0xf9f9('0x44')],client9004);})['then'](respondWithResult(_0x8f931a,null))[_0xf9f9('0x1e')](handleError(_0x8f931a,null));};exports[_0xf9f9('0x68')]=function(_0x5602c5,_0x4133f7){_0x5602c5[_0xf9f9('0x44')][_0xf9f9('0x2c')]=_0x5602c5[_0xf9f9('0x69')][_0xf9f9('0x6a')];_0x5602c5[_0xf9f9('0x44')][_0xf9f9('0x6b')]=_0x5602c5[_0xf9f9('0x69')][_0xf9f9('0x6c')];_0x5602c5[_0xf9f9('0x44')][_0xf9f9('0x6d')]=_0x5602c5[_0xf9f9('0x69')][_0xf9f9('0x6e')];return db[_0xf9f9('0x6f')][_0xf9f9('0x43')](_0x5602c5[_0xf9f9('0x44')])[_0xf9f9('0x2a')](respondWithResult(_0x4133f7,0xc9))[_0xf9f9('0x1e')](handleError(_0x4133f7,null));};exports[_0xf9f9('0x70')]=function(_0xc76538,_0x10e493){return db['ChatInteraction'][_0xf9f9('0x48')]({'where':{'id':_0xc76538[_0xf9f9('0x39')]['id']},'raw':!![]})['then'](handleEntityNotFound(_0x10e493,null))[_0xf9f9('0x2a')](function(_0x200e49){if(_0x200e49){if(_0x200e49['closed']){return _0x10e493[_0xf9f9('0x21')](0x193)['json']({'status':0x193,'message':_0xf9f9('0x71')});}return db[_0xf9f9('0x6f')][_0xf9f9('0x48')]({'where':{'id':_0xc76538[_0xf9f9('0x36')][_0xf9f9('0x72')]},'raw':!![]})[_0xf9f9('0x2a')](handleEntityNotFound(_0x10e493,null));}})[_0xf9f9('0x2a')](function(_0x6a9955){if(_0x6a9955){var _0x5854b2=_0x6a9955[_0xf9f9('0x73')]!==null;var _0xe54172=path['join'](config[_0xf9f9('0x74')],'server/files/attachments/');if(_0x5854b2){_0xe54172=path[_0xf9f9('0x75')](_0xe54172,'offline-chat/');}var _0x21f8f1=path['join'](_0xe54172,_0x6a9955[_0xf9f9('0x6b')]);return _0x10e493[_0xf9f9('0x76')](_0x21f8f1);}})['catch'](handleError(_0x10e493,null));};exports[_0xf9f9('0x77')]=function(_0x281757,_0x58808e){var _0x1addcf=null;var _0x10ee5d=null;var _0x2c3ae6=null;if(_0x281757['body']['id']){delete _0x281757[_0xf9f9('0x44')]['id'];}if(_0x281757[_0xf9f9('0x44')]['mailTranscript']){_0x2c3ae6=path[_0xf9f9('0x75')](config[_0xf9f9('0x74')],_0xf9f9('0x78'),util[_0xf9f9('0x79')]('transcript-%s.txt',Date[_0xf9f9('0x7a')]()));_0x281757[_0xf9f9('0x44')][_0xf9f9('0x7b')]=_0x2c3ae6;}return db[_0xf9f9('0x3c')][_0xf9f9('0x42')]({'where':{'id':_0x281757[_0xf9f9('0x39')]['id']},'include':[{'model':db[_0xf9f9('0x5c')],'as':_0xf9f9('0x7c'),'include':[{'model':db['User'],'as':_0xf9f9('0x7d')}]}]})[_0xf9f9('0x2a')](handleEntityNotFound(_0x58808e,null))[_0xf9f9('0x2a')](saveUpdates(_0x281757[_0xf9f9('0x44')],null))['then'](function(_0x3014b1){if(_0x3014b1){_0x1addcf=_0x3014b1;return db[_0xf9f9('0x49')][_0xf9f9('0x42')]({'where':{'id':_0x1addcf[_0xf9f9('0x4a')]}});}})[_0xf9f9('0x2a')](function(_0x2637d2){if(_0x2637d2){_0x10ee5d=_0x2637d2;return db['CmContact'][_0xf9f9('0x42')]({'where':{'id':_0x1addcf['ContactId']}});}})[_0xf9f9('0x2a')](function(_0x4558c1){if(_0x4558c1){if(_0x2c3ae6){var _0x1dc953=null;for(var _0x439785=0x1;_0x439785<_0x1addcf[_0xf9f9('0x7c')]['length'];++_0x439785){_0x1dc953=_0x1addcf['Messages'][_0x439785];var _0x1b031a=_0x1dc953[_0xf9f9('0x63')]?util[_0xf9f9('0x79')](_0xf9f9('0x7e'),_0x10ee5d['agentAlias'],_0x1dc953[_0xf9f9('0x63')]):_0xf9f9('0x7f');var _0x1c86c7=_0x281757['body']['customer']||util[_0xf9f9('0x79')](_0xf9f9('0x7e'),_0xf9f9('0x80'),_0x1dc953[_0xf9f9('0x81')]);switch(_0x10ee5d[_0xf9f9('0x82')]){case _0xf9f9('0x83'):_0x1b031a=_0x1dc953['UserId']?util[_0xf9f9('0x79')](_0xf9f9('0x7e'),_0x10ee5d[_0xf9f9('0x84')],_0x1dc953[_0xf9f9('0x63')]):'System';break;case _0xf9f9('0x85'):_0x1b031a=_0x1dc953[_0xf9f9('0x63')]?_0x1dc953['User']['alias']||_0x1dc953[_0xf9f9('0x7d')][_0xf9f9('0x4e')]:_0xf9f9('0x7f');break;case'agent_fullname':_0x1b031a=_0x1dc953[_0xf9f9('0x63')]?_0x1dc953[_0xf9f9('0x7d')][_0xf9f9('0x4e')]:_0xf9f9('0x7f');break;default:_0x1b031a=_0x1dc953['UserId']?util[_0xf9f9('0x79')]('%s%d',_0x10ee5d[_0xf9f9('0x84')],_0x1dc953[_0xf9f9('0x63')]):_0xf9f9('0x7f');}var _0x5c1159=util[_0xf9f9('0x79')](_0xf9f9('0x86'),moment(_0x1dc953[_0xf9f9('0x87')])[_0xf9f9('0x79')](_0xf9f9('0x88')),_0x1dc953[_0xf9f9('0x89')]==='in'?_0x1c86c7:_0x1b031a,_0x1dc953[_0xf9f9('0x44')]);if(!_0x1dc953[_0xf9f9('0x8a')]){fs[_0xf9f9('0x8b')](_0x2c3ae6,_0x5c1159);}}return db[_0xf9f9('0x8c')]['findOne']({'where':{'service':!![]},'include':[{'model':db[_0xf9f9('0x8d')],'as':_0xf9f9('0x8e'),'raw':!![],'include':[{'model':db[_0xf9f9('0x8f')],'as':_0xf9f9('0x8f'),'raw':!![]}]}]});}}})['then'](function(_0x127339){if(!_0x127339||!_0x127339['Smtp']||!_0x281757[_0xf9f9('0x44')])return _0x1addcf;var _0x584ac2=_0x127339[_0xf9f9('0x90')]();return respondWithRpcPromise(_0xf9f9('0x91'),_0xf9f9('0x92'),{'account':_0x584ac2,'message':{'from':util[_0xf9f9('0x79')]('\x22%s\x22\x20<%s>',_0x127339[_0xf9f9('0x2c')],_0x127339['email']||_0x127339[_0xf9f9('0x8e')][_0xf9f9('0x37')]),'to':_0x281757[_0xf9f9('0x44')]['mailTranscript'],'subject':_0xf9f9('0x93'),'text':util[_0xf9f9('0x79')](_0xf9f9('0x94'),_0x281757[_0xf9f9('0x44')][_0xf9f9('0x95')]),'attachments':[{'path':_0x2c3ae6}]}})[_0xf9f9('0x2a')](function(){return _0x1addcf;})[_0xf9f9('0x1e')](function(_0x189dbf){logger[_0xf9f9('0x19')](_0x189dbf);});})[_0xf9f9('0x2a')](respondWithStatusCode(_0x58808e,0xc8))[_0xf9f9('0x1e')](handleError(_0x58808e,null));};exports[_0xf9f9('0x96')]=function(_0x418de6,_0x146bd9){return db[_0xf9f9('0x5c')][_0xf9f9('0x42')]({'where':{'id':_0x418de6[_0xf9f9('0x39')]['id']}})[_0xf9f9('0x2a')](handleEntityNotFound(_0x146bd9,null))[_0xf9f9('0x2a')](function(_0x50dde5){if(_0x50dde5){return _0x50dde5[_0xf9f9('0x96')](_0x418de6[_0xf9f9('0x44')]['ids'],_[_0xf9f9('0x97')](_0x418de6['body'],['ids','id'])||{});}})[_0xf9f9('0x2a')](respondWithResult(_0x146bd9,null))[_0xf9f9('0x1e')](handleError(_0x146bd9,null));};exports['getMessages']=function(_0x9b823a,_0xf1ed43){var _0x5a9188={'raw':![],'where':{}};var _0x2f76a8={};var _0x4ac70c={'count':0x0,'rows':[]};return db[_0xf9f9('0x3c')][_0xf9f9('0x48')]({'where':{'id':_0x9b823a[_0xf9f9('0x39')]['id']}})[_0xf9f9('0x2a')](handleEntityNotFound(_0xf1ed43,null))['then'](function(_0x5a90c8){if(_0x5a90c8){_0x2f76a8[_0xf9f9('0x3a')]=_['keys'](db[_0xf9f9('0x5c')]['rawAttributes']);_0x2f76a8[_0xf9f9('0x36')]=_[_0xf9f9('0x3b')](_0x9b823a[_0xf9f9('0x36')]);_0x2f76a8['filters']=_[_0xf9f9('0x3d')](_0x2f76a8['model'],_0x2f76a8[_0xf9f9('0x36')]);_0x5a9188[_0xf9f9('0x3e')]=_[_0xf9f9('0x3d')](_0x2f76a8[_0xf9f9('0x3a')],qs['fields'](_0x9b823a['query'][_0xf9f9('0x3f')]));_0x5a9188['attributes']=_0x5a9188[_0xf9f9('0x3e')][_0xf9f9('0x40')]?_0x5a9188[_0xf9f9('0x3e')]:_0x2f76a8[_0xf9f9('0x3a')];if(!_0x9b823a['query'][_0xf9f9('0x98')]('nolimit')){_0x5a9188[_0xf9f9('0x23')]=qs[_0xf9f9('0x23')](_0x9b823a['query'][_0xf9f9('0x23')]);_0x5a9188['offset']=qs[_0xf9f9('0x26')](_0x9b823a[_0xf9f9('0x36')][_0xf9f9('0x26')]);}_0x5a9188[_0xf9f9('0x99')]=qs[_0xf9f9('0x9a')](_0x9b823a['query'][_0xf9f9('0x9a')]);_0x5a9188[_0xf9f9('0x9b')]=qs['filters'](_[_0xf9f9('0x9c')](_0x9b823a[_0xf9f9('0x36')],_0x2f76a8['filters']));_0x5a9188[_0xf9f9('0x9b')]['ChatInteractionId']=_0x5a90c8['id'];if(_0x9b823a[_0xf9f9('0x36')]['filter']){_0x5a9188[_0xf9f9('0x9b')]=_[_0xf9f9('0x2f')](_0x5a9188[_0xf9f9('0x9b')],{'$or':_[_0xf9f9('0x9d')](_0x5a9188['attributes'],function(_0x51e894){var _0x4ad87d={};_0x4ad87d[_0x51e894]={'$like':'%'+_0x9b823a[_0xf9f9('0x36')][_0xf9f9('0x9e')]+'%'};return _0x4ad87d;})});}if(_0x9b823a[_0xf9f9('0x36')][_0xf9f9('0x9f')]){var _0x2383b8=_0x9b823a[_0xf9f9('0x36')]['$gte'][_0xf9f9('0xa0')](',');var _0x3c6220={};_0x3c6220[_0x2383b8[0x0]]={'$gte':moment(_0x2383b8[0x1])[_0xf9f9('0x79')](_0xf9f9('0xa1'))};_0x5a9188[_0xf9f9('0x9b')]=_[_0xf9f9('0x2f')](_0x5a9188[_0xf9f9('0x9b')],_0x3c6220);}_0x5a9188=_[_0xf9f9('0x2f')]({},_0x5a9188,_0x9b823a[_0xf9f9('0x41')]);return db['ChatMessage'][_0xf9f9('0x25')]({'where':_0x5a9188[_0xf9f9('0x9b')]})[_0xf9f9('0x2a')](function(_0x580941){_0x4ac70c[_0xf9f9('0x25')]=_0x580941;if(_0x9b823a[_0xf9f9('0x36')]['includeAll']){_0x5a9188['include']=[{'all':!![]}];}return db['ChatMessage'][_0xf9f9('0x34')](_0x5a9188);})[_0xf9f9('0x2a')](function(_0x432c61){_0x4ac70c['rows']=_0x432c61;return _0x4ac70c;});}})[_0xf9f9('0x2a')](respondWithFilteredResult(_0xf1ed43,_0x5a9188))['catch'](handleError(_0xf1ed43,null));};exports['getMyMessages']=function(_0x207fce,_0x2940c8){var _0x113618={'where':{}},_0x7074b2={},_0x32ad6e={'count':0x0,'rows':[]};return db[_0xf9f9('0x3c')][_0xf9f9('0x48')]({'where':{'id':_0x207fce[_0xf9f9('0x39')]['id']}})[_0xf9f9('0x2a')](handleEntityNotFound(_0x2940c8,null))[_0xf9f9('0x2a')](function(_0x58c69d){if(_0x58c69d){_0x7074b2[_0xf9f9('0x3a')]=_[_0xf9f9('0x3b')](db[_0xf9f9('0x5c')]['rawAttributes']);_0x7074b2[_0xf9f9('0x36')]=_[_0xf9f9('0x3b')](_0x207fce['query']);_0x7074b2[_0xf9f9('0xa2')]=_[_0xf9f9('0x3d')](_0x7074b2['model'],_0x7074b2[_0xf9f9('0x36')]);_0x113618[_0xf9f9('0x3e')]=_[_0xf9f9('0x3d')](_0x7074b2[_0xf9f9('0x3a')],qs[_0xf9f9('0x3f')](_0x207fce[_0xf9f9('0x36')][_0xf9f9('0x3f')]));_0x113618['attributes']=_0x113618[_0xf9f9('0x3e')]['length']?_0x113618['attributes']:_0x7074b2[_0xf9f9('0x3a')];if(!_0x207fce['query'][_0xf9f9('0x98')]('nolimit')){_0x113618[_0xf9f9('0x23')]=qs[_0xf9f9('0x23')](_0x207fce[_0xf9f9('0x36')][_0xf9f9('0x23')]);_0x113618['offset']=qs[_0xf9f9('0x26')](_0x207fce['query']['offset']);}_0x113618[_0xf9f9('0x99')]=qs['sort'](_0x207fce[_0xf9f9('0x36')][_0xf9f9('0x9a')]);_0x113618['where']=qs[_0xf9f9('0xa2')](_['pick'](_0x207fce[_0xf9f9('0x36')],_0x7074b2['filters']));_0x113618[_0xf9f9('0x9b')][_0xf9f9('0xa3')]=_0x58c69d['id'];if(_0x207fce[_0xf9f9('0x36')][_0xf9f9('0x9e')]){_0x113618[_0xf9f9('0x9b')]=_[_0xf9f9('0x2f')](_0x113618[_0xf9f9('0x9b')],{'$or':_[_0xf9f9('0x9d')](_0x113618[_0xf9f9('0x3e')],function(_0x33cc39){var _0x1d6232={};_0x1d6232[_0x33cc39]={'$like':'%'+_0x207fce[_0xf9f9('0x36')][_0xf9f9('0x9e')]+'%'};return _0x1d6232;})});}_0x113618[_0xf9f9('0x9b')]['secret']=![];if(_0x207fce['query']['id']){_0x113618[_0xf9f9('0x9b')]['id']={'$gt':_0x207fce[_0xf9f9('0x36')]['id']};}_0x113618=_[_0xf9f9('0x2f')]({},_0x113618,_0x207fce[_0xf9f9('0x41')]);return db[_0xf9f9('0x5c')]['count']({'where':_0x113618['where']})['then'](function(_0x4590c7){_0x32ad6e['count']=_0x4590c7;_0x113618[_0xf9f9('0xa4')]=[];if(_0x207fce[_0xf9f9('0x36')][_0xf9f9('0xa5')]){_0x113618['include']['push']({'model':db[_0xf9f9('0x7d')],'as':_0xf9f9('0x7d'),'attributes':['id','fullname','alias']});}if(_0x207fce[_0xf9f9('0x36')][_0xf9f9('0xa6')]){_0x113618[_0xf9f9('0xa4')]=[{'all':!![]}];}return db[_0xf9f9('0x5c')][_0xf9f9('0x34')](_0x113618);})['then'](function(_0x3ee65d){_0x32ad6e[_0xf9f9('0xa7')]=_0x3ee65d;return _0x32ad6e;});}})[_0xf9f9('0x2a')](respondWithFilteredResult(_0x2940c8,_0x113618))[_0xf9f9('0x1e')](handleError(_0x2940c8,null));};exports[_0xf9f9('0xa8')]=function(_0x1d9976,_0x2a184c){return db[_0xf9f9('0x3c')]['find']({'where':{'id':_0x1d9976[_0xf9f9('0x39')]['id']}})[_0xf9f9('0x2a')](handleEntityNotFound(_0x2a184c,null))[_0xf9f9('0x2a')](function(_0x57d769){if(_0x57d769){return _0x57d769[_0xf9f9('0xa9')](_0x1d9976['body'][_0xf9f9('0xaa')],_[_0xf9f9('0x97')](_0x1d9976[_0xf9f9('0x44')],[_0xf9f9('0xaa'),'id'])||{})[_0xf9f9('0xab')](function(){return db['Tag'][_0xf9f9('0x34')]({'attributes':['id',_0xf9f9('0x2c'),'color'],'where':{'id':_0x1d9976[_0xf9f9('0x44')]['ids']}});})[_0xf9f9('0x2a')](function(_0x470dcf){socket[_0xf9f9('0xac')]('chatInteractionTags:save',{'id':Number(_0x1d9976[_0xf9f9('0x39')]['id']),'tags':_0x470dcf||[]});return{'id':Number(_0x1d9976[_0xf9f9('0x39')]['id']),'tags':_0x470dcf||[]};});}})[_0xf9f9('0x2a')](respondWithResult(_0x2a184c,null))['catch'](handleError(_0x2a184c,null));};exports[_0xf9f9('0xad')]=function(_0x2d6828,_0x35f646){return db[_0xf9f9('0x3c')][_0xf9f9('0x42')]({'where':{'id':_0x2d6828[_0xf9f9('0x39')]['id']}})[_0xf9f9('0x2a')](handleEntityNotFound(_0x35f646,null))['then'](function(_0x2e6f30){if(_0x2e6f30){return _0x2e6f30[_0xf9f9('0xad')](_0x2d6828['query']['ids']);}})[_0xf9f9('0x2a')](respondWithStatusCode(_0x35f646,null))[_0xf9f9('0x1e')](handleError(_0x35f646,null));};exports['download']=function(_0x56fe39,_0x309aa7){var _0x722c10=moment()[_0xf9f9('0xae')]()[_0xf9f9('0xaf')]();var _0x923a51=path[_0xf9f9('0x75')](config[_0xf9f9('0x74')],_0xf9f9('0xb0'),'files','tmp');var _0x5b976e=path['join'](config['root'],_0xf9f9('0xb0'),'files',_0xf9f9('0xb1'));var _0x2ba93e=path[_0xf9f9('0x75')](_0x923a51,_0x722c10);var _0x59c41c=util['format'](_0xf9f9('0xb2'),_0x56fe39['params']['id'],_0x722c10);var _0x52f854=path[_0xf9f9('0x75')](_0x923a51,_0x59c41c);var _0x324c42=[];_0x324c42[_0xf9f9('0xb3')]({'model':db[_0xf9f9('0x7d')],'as':'User','attributes':['id','fullname'],'raw':!![]});_0x324c42[_0xf9f9('0xb3')]({'model':db[_0xf9f9('0x5f')],'as':_0xf9f9('0x60'),'attributes':['id',_0xf9f9('0xb4'),_0xf9f9('0xb5')],'raw':!![]});if(_0x56fe39[_0xf9f9('0x36')][_0xf9f9('0xb1')]){_0x324c42[_0xf9f9('0xb3')]({'model':db[_0xf9f9('0x6f')],'as':_0xf9f9('0x6f'),'raw':!![]});}var _0xe0701c=[{'model':db['ChatMessage'],'as':_0xf9f9('0x7c'),'attributes':['id',_0xf9f9('0x44'),'createdAt','direction','secret',_0xf9f9('0xb6')],'include':_0x324c42}];_0xe0701c[_0xf9f9('0xb3')]({'model':db[_0xf9f9('0x49')],'as':_0xf9f9('0xb7'),'attributes':['id',_0xf9f9('0x2c')]});_0xe0701c['push']({'model':db[_0xf9f9('0x7d')],'as':_0xf9f9('0xb8'),'attributes':['id',_0xf9f9('0x4e')]});return db['ChatInteraction'][_0xf9f9('0x42')]({'where':{'id':_0x56fe39['params']['id']},'include':_0xe0701c})[_0xf9f9('0x2a')](handleEntityNotFound(_0x309aa7,null))[_0xf9f9('0x2a')](function(_0x119faa){if(_0x119faa){var _0x4a373f=_0x119faa[_0xf9f9('0xb9')]({'plain':!![]});fs[_0xf9f9('0xba')](_0x2ba93e);var _0x4fbee5={'channel':'Chat','account':_0x4a373f[_0xf9f9('0xb7')]['name'],'agent':_0x4a373f['Owner']?_0x4a373f[_0xf9f9('0xb8')][_0xf9f9('0x4e')]:'N.A.','createdAt':moment(_0x4a373f[_0xf9f9('0x87')])[_0xf9f9('0x79')](_0xf9f9('0xa1'))[_0xf9f9('0xaf')](),'closedAt':_0x4a373f[_0xf9f9('0x65')]?moment(_0x4a373f[_0xf9f9('0xbb')])[_0xf9f9('0x79')](_0xf9f9('0xa1'))[_0xf9f9('0xaf')]():'','disposition':_0x4a373f['disposition'],'chatInfo':{'browser':_0x4a373f[_0xf9f9('0xbc')],'os':_0x4a373f[_0xf9f9('0xbd')],'referer':_0x4a373f['referer'],'customerIp':_0x4a373f[_0xf9f9('0xbe')],'customerPort':_0x4a373f[_0xf9f9('0xbf')]?_0x4a373f[_0xf9f9('0xbf')]:_0xf9f9('0xc0')},'messages':_(_0x4a373f[_0xf9f9('0x7c')])['tail']()[_0xf9f9('0x9e')]({'secret':![]})[_0xf9f9('0x9d')](function(_0x266cc1){if(_0x266cc1[_0xf9f9('0x6f')]){var _0x572fe2=path[_0xf9f9('0x75')](_0x5b976e,_0x266cc1[_0xf9f9('0x6f')]['basename']);if(fs[_0xf9f9('0xc1')](_0x572fe2)){fs['createReadStream'](_0x572fe2)['pipe'](fs[_0xf9f9('0xc2')](path[_0xf9f9('0x75')](_0x2ba93e,_0x266cc1[_0xf9f9('0x6f')]['basename'])));}}return{'date':moment(_0x266cc1[_0xf9f9('0x87')])[_0xf9f9('0x79')]('YYYY-MM-DD\x20HH:mm:ss')[_0xf9f9('0xaf')](),'sender':_0x266cc1['direction']===_0xf9f9('0xc3')?_0x266cc1[_0xf9f9('0x7d')]?_0x266cc1['User'][_0xf9f9('0x4e')]:_0xf9f9('0x7f'):_0x266cc1['Contact'][_0xf9f9('0xb4')]+(_0x266cc1[_0xf9f9('0x60')][_0xf9f9('0xb5')]?'\x20'+_0x266cc1[_0xf9f9('0x60')][_0xf9f9('0xb5')]:''),'body':_0x266cc1[_0xf9f9('0x6f')]?_0x266cc1[_0xf9f9('0x6f')][_0xf9f9('0x6b')]:_0x266cc1[_0xf9f9('0x44')],'direction':_0x266cc1[_0xf9f9('0x89')]===_0xf9f9('0xc3')?'A':'C','secret':_0x266cc1[_0xf9f9('0x8a')],'read':_0x266cc1[_0xf9f9('0xb6')],'attachment':_0x266cc1['Attachment']};})['value']()};return ejs[_0xf9f9('0xc4')](path[_0xf9f9('0x75')](config[_0xf9f9('0x74')],_0xf9f9('0xb0'),'views',_0xf9f9('0xc5')),{'interaction':_0x4fbee5})['then'](function(_0x59e379){var _0x5f5c18=path[_0xf9f9('0x75')](_0x2ba93e,'transcript-'+_0x4a373f['id']+'-'+_0x722c10+_0xf9f9('0xc6'));var _0x2ae892={'path':_0x5f5c18,'channel':_0xf9f9('0xc7'),'interactionId':_0x4a373f['id']};return pdf[_0xf9f9('0xc8')](_0x59e379,_0x2ae892);})[_0xf9f9('0x2a')](function(){return new Promise(function(_0x22702a,_0x3f1ca2){zipdir(_0x2ba93e,{'saveTo':_0x52f854},function(_0x4fa86e,_0x36076a){if(_0x4fa86e)return _0x3f1ca2(_0x4fa86e);return _0x22702a(_0x36076a);});})['then'](function(){return new BPromise(function(_0x1d7975,_0x412a6f){rimraf(_0x2ba93e,function(_0x4d7926){if(_0x4d7926)_0x412a6f(_0x4d7926);return _0x1d7975();});});})[_0xf9f9('0x2a')](function(){return _0x309aa7['download'](_0x52f854,_0x59c41c,function(_0x2c71b5){if(_0x2c71b5){logger[_0xf9f9('0x19')](_0xf9f9('0xc9'),_0x2c71b5);}else{fs[_0xf9f9('0xca')](_0x52f854);}});});});}else{return _0x309aa7[_0xf9f9('0x1f')](0xc8);}})['catch'](handleError(_0x309aa7,null));};
\ No newline at end of file
diff --git a/server/api/chatInteraction/chatInteraction.events.js b/server/api/chatInteraction/chatInteraction.events.js
index a204d16..f7c60bf 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 _0xf9bc=['then','setDataValue','Users','map','length','emit','catch','hook','exports','events','../../mysqldb','ChatMessage','setMaxListeners','save','remove','getUsers'];(function(_0x4fbb86,_0x374ed0){var _0xb141fe=function(_0x382195){while(--_0x382195){_0x4fbb86['push'](_0x4fbb86['shift']());}};_0xb141fe(++_0x374ed0);}(_0xf9bc,0x159));var _0xcf9b=function(_0x156c95,_0x1760cf){_0x156c95=_0x156c95-0x0;var _0x1a8cf5=_0xf9bc[_0x156c95];return _0x1a8cf5;};'use strict';var EventEmitter=require(_0xcf9b('0x0'));var ChatInteraction=require(_0xcf9b('0x1'))['db']['ChatInteraction'];var ChatMessage=require(_0xcf9b('0x1'))['db'][_0xcf9b('0x2')];var ChatInteractionEvents=new EventEmitter();ChatInteractionEvents[_0xcf9b('0x3')](0x0);var events={'afterCreate':_0xcf9b('0x4'),'afterUpdate':'update','afterDestroy':_0xcf9b('0x5')};function emitEvent(_0x4ce308){return function(_0x4f6890,_0xb60177,_0x957c0d){_0x4f6890[_0xcf9b('0x6')]({'attributes':['id'],'raw':!![]})[_0xcf9b('0x7')](function(_0x1fd958){_0x4f6890[_0xcf9b('0x8')](_0xcf9b('0x9'),_0x1fd958[_0xcf9b('0xa')](function(_0x42461a){return{'id':_0x42461a['id']};}));return ChatMessage['findAll']({'where':{'ChatInteractionId':_0x4f6890['id'],'direction':'in','read':![]},'raw':!![]});})[_0xcf9b('0x7')](function(_0x44b003){_0x4f6890['setDataValue']('unreadMessages',_0x44b003[_0xcf9b('0xb')]);ChatInteractionEvents[_0xcf9b('0xc')](_0x4ce308+':'+_0x4f6890['id'],_0x4f6890);ChatInteractionEvents[_0xcf9b('0xc')](_0x4ce308,_0x4f6890);_0x957c0d(null);})[_0xcf9b('0xd')](_0x957c0d(null));};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];ChatInteraction[_0xcf9b('0xe')](e,emitEvent(event));}}module[_0xcf9b('0xf')]=ChatInteractionEvents;
\ No newline at end of file
+var _0x2e4f=['setDataValue','length','emit','catch','exports','events','../../mysqldb','ChatMessage','setMaxListeners','update','remove','getUsers','then','Users','findAll'];(function(_0x10b2b5,_0x4d9c56){var _0x6400f4=function(_0x3e95d9){while(--_0x3e95d9){_0x10b2b5['push'](_0x10b2b5['shift']());}};_0x6400f4(++_0x4d9c56);}(_0x2e4f,0x131));var _0xf2e4=function(_0x18d631,_0x4376d2){_0x18d631=_0x18d631-0x0;var _0x50d708=_0x2e4f[_0x18d631];return _0x50d708;};'use strict';var EventEmitter=require(_0xf2e4('0x0'));var ChatInteraction=require(_0xf2e4('0x1'))['db']['ChatInteraction'];var ChatMessage=require(_0xf2e4('0x1'))['db'][_0xf2e4('0x2')];var ChatInteractionEvents=new EventEmitter();ChatInteractionEvents[_0xf2e4('0x3')](0x0);var events={'afterCreate':'save','afterUpdate':_0xf2e4('0x4'),'afterDestroy':_0xf2e4('0x5')};function emitEvent(_0x14269f){return function(_0x10b7b0,_0x2aca2a,_0x2898e5){_0x10b7b0[_0xf2e4('0x6')]({'attributes':['id'],'raw':!![]})[_0xf2e4('0x7')](function(_0x433bcb){_0x10b7b0['setDataValue'](_0xf2e4('0x8'),_0x433bcb['map'](function(_0x3f6655){return{'id':_0x3f6655['id']};}));return ChatMessage[_0xf2e4('0x9')]({'where':{'ChatInteractionId':_0x10b7b0['id'],'direction':'in','read':![]},'raw':!![]});})[_0xf2e4('0x7')](function(_0x2bf3a3){_0x10b7b0[_0xf2e4('0xa')]('unreadMessages',_0x2bf3a3[_0xf2e4('0xb')]);ChatInteractionEvents[_0xf2e4('0xc')](_0x14269f+':'+_0x10b7b0['id'],_0x10b7b0);ChatInteractionEvents[_0xf2e4('0xc')](_0x14269f,_0x10b7b0);_0x2898e5(null);})[_0xf2e4('0xd')](_0x2898e5(null));};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];ChatInteraction['hook'](e,emitEvent(event));}}module[_0xf2e4('0xe')]=ChatInteractionEvents;
\ No newline at end of file
diff --git a/server/api/chatInteraction/chatInteraction.model.js b/server/api/chatInteraction/chatInteraction.model.js
index 274391f..a732deb 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 _0x1646=['rimraf','../../config/environment','exports','define','ChatInteraction','changed','closedAt','YYYY-MM-DD\x20HH:mm:ss','utf8mb4','lodash','util','moment','bluebird','path'];(function(_0x447f05,_0x1b4295){var _0x4861ff=function(_0x2495f9){while(--_0x2495f9){_0x447f05['push'](_0x447f05['shift']());}};_0x4861ff(++_0x1b4295);}(_0x1646,0x13d));var _0x6164=function(_0x2053ea,_0x1ab2d4){_0x2053ea=_0x2053ea-0x0;var _0x2232c4=_0x1646[_0x2053ea];return _0x2232c4;};'use strict';var _=require(_0x6164('0x0'));var util=require(_0x6164('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0x6164('0x2'));var BPromise=require(_0x6164('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x6164('0x4'));var rimraf=require(_0x6164('0x5'));var config=require(_0x6164('0x6'));var attributes=require('./chatInteraction.attributes');module[_0x6164('0x7')]=function(_0x13b233,_0x41df49){return _0x13b233[_0x6164('0x8')](_0x6164('0x9'),attributes,{'tableName':'chat_interactions','paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x435bcd,_0x3df6ec,_0x2a9365){if(_0x435bcd[_0x6164('0xa')]('closed')){_0x435bcd[_0x6164('0xb')]=moment()['format'](_0x6164('0xc'));}_0x2a9365(null,_0x435bcd);}},'charset':_0x6164('0xd'),'collate':'utf8mb4_unicode_ci'});};
\ No newline at end of file
+var _0x27a0=['closed','format','YYYY-MM-DD\x20HH:mm:ss','utf8mb4','lodash','util','../../config/logger','moment','bluebird','request-promise','rimraf','../../config/environment','./chatInteraction.attributes','exports','define','ChatInteraction'];(function(_0x4d8b8e,_0x12fb10){var _0x3103ba=function(_0x361cae){while(--_0x361cae){_0x4d8b8e['push'](_0x4d8b8e['shift']());}};_0x3103ba(++_0x12fb10);}(_0x27a0,0xa4));var _0x027a=function(_0x2c500d,_0x2fc5a3){_0x2c500d=_0x2c500d-0x0;var _0xee4d0f=_0x27a0[_0x2c500d];return _0xee4d0f;};'use strict';var _=require(_0x027a('0x0'));var util=require(_0x027a('0x1'));var logger=require(_0x027a('0x2'))('api');var moment=require(_0x027a('0x3'));var BPromise=require(_0x027a('0x4'));var rp=require(_0x027a('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x027a('0x6'));var config=require(_0x027a('0x7'));var attributes=require(_0x027a('0x8'));module[_0x027a('0x9')]=function(_0x1d128d,_0x1f0c38){return _0x1d128d[_0x027a('0xa')](_0x027a('0xb'),attributes,{'tableName':'chat_interactions','paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x1bfe4d,_0x55d7b4,_0x23bf55){if(_0x1bfe4d['changed'](_0x027a('0xc'))){_0x1bfe4d['closedAt']=moment()[_0x027a('0xd')](_0x027a('0xe'));}_0x23bf55(null,_0x1bfe4d);}},'charset':_0x027a('0xf'),'collate':'utf8mb4_unicode_ci'});};
\ No newline at end of file
diff --git a/server/api/chatInteraction/chatInteraction.rpc.js b/server/api/chatInteraction/chatInteraction.rpc.js
index a8f568e..edf801f 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 _0x1e24=['ChatInteraction,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','UpdateChatInteraction','ChatInteraction','body','options','where','attributes','stringify','AddTagsToChatInteraction','find','addTags','ids','omit','spread','AddTags','lodash','util','moment','randomstring','ioredis','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','redis','./chatInteraction.socket','register','request','then','info','ChatInteraction,\x20%s,\x20%s','request\x20sent','debug'];(function(_0x34a61d,_0x1b9ab0){var _0x101e4d=function(_0x11495c){while(--_0x11495c){_0x34a61d['push'](_0x34a61d['shift']());}};_0x101e4d(++_0x1b9ab0);}(_0x1e24,0x8c));var _0x41e2=function(_0x3eb4ae,_0x493c5b){_0x3eb4ae=_0x3eb4ae-0x0;var _0x1aa0d4=_0x1e24[_0x3eb4ae];return _0x1aa0d4;};'use strict';var _=require(_0x41e2('0x0'));var util=require(_0x41e2('0x1'));var moment=require(_0x41e2('0x2'));var BPromise=require('bluebird');var rs=require(_0x41e2('0x3'));var fs=require('fs');var Redis=require(_0x41e2('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x41e2('0x5'));var logger=require(_0x41e2('0x6'))('rpc');var config=require(_0x41e2('0x7'));var jayson=require(_0x41e2('0x8'));var client=jayson[_0x41e2('0x9')][_0x41e2('0xa')]({'port':0x232a});config[_0x41e2('0xb')]=_['defaults'](config[_0x41e2('0xb')],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x41e2('0xb')]));require(_0x41e2('0xc'))[_0x41e2('0xd')](socket);function respondWithRpcPromise(_0x4fd220,_0x308c49,_0xd06c3c){return new BPromise(function(_0x1e1785,_0x10113c){return client[_0x41e2('0xe')](_0x4fd220,_0xd06c3c)[_0x41e2('0xf')](function(_0x3153ed){logger[_0x41e2('0x10')](_0x41e2('0x11'),_0x308c49,_0x41e2('0x12'));logger[_0x41e2('0x13')](_0x41e2('0x14'),_0x308c49,_0x41e2('0x12'),JSON['stringify'](_0x3153ed));if(_0x3153ed[_0x41e2('0x15')]){if(_0x3153ed[_0x41e2('0x15')][_0x41e2('0x16')]===0x1f4){logger['error'](_0x41e2('0x11'),_0x308c49,_0x3153ed[_0x41e2('0x15')][_0x41e2('0x17')]);return _0x10113c(_0x3153ed[_0x41e2('0x15')]['message']);}logger[_0x41e2('0x15')](_0x41e2('0x11'),_0x308c49,_0x3153ed[_0x41e2('0x15')]['message']);return _0x1e1785(_0x3153ed['error'][_0x41e2('0x17')]);}else{logger['info'](_0x41e2('0x11'),_0x308c49,'request\x20sent');_0x1e1785(_0x3153ed[_0x41e2('0x18')]['message']);}})[_0x41e2('0x19')](function(_0x1eed85){logger['error'](_0x41e2('0x11'),_0x308c49,_0x1eed85);_0x10113c(_0x1eed85);});});}exports[_0x41e2('0x1a')]=function(_0xda20ba){var _0x471394=this;return new Promise(function(_0x309153,_0xeddbed){return db[_0x41e2('0x1b')]['update'](_0xda20ba[_0x41e2('0x1c')],{'raw':_0xda20ba['options']?_0xda20ba[_0x41e2('0x1d')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0xda20ba[_0x41e2('0x1d')]?_0xda20ba['options'][_0x41e2('0x1e')]||null:null,'attributes':_0xda20ba[_0x41e2('0x1d')]?_0xda20ba['options'][_0x41e2('0x1f')]||null:null,'limit':_0xda20ba[_0x41e2('0x1d')]?_0xda20ba[_0x41e2('0x1d')]['limit']||null:null})[_0x41e2('0xf')](function(_0x18d9ba){logger[_0x41e2('0x10')](_0x41e2('0x1a'),_0xda20ba);logger[_0x41e2('0x13')](_0x41e2('0x1a'),_0xda20ba,JSON[_0x41e2('0x20')](_0x18d9ba));_0x309153(_0x18d9ba);})[_0x41e2('0x19')](function(_0x5fec0f){logger[_0x41e2('0x15')](_0x41e2('0x1a'),_0x5fec0f[_0x41e2('0x17')],_0xda20ba);_0xeddbed(_0x471394[_0x41e2('0x15')](0x1f4,_0x5fec0f[_0x41e2('0x17')]));});});};exports[_0x41e2('0x21')]=function(_0x2ebf27){return new Promise(function(_0x4b3a27,_0x123fc0){return db[_0x41e2('0x1b')][_0x41e2('0x22')]({'where':_0x2ebf27[_0x41e2('0x1d')]?_0x2ebf27[_0x41e2('0x1d')][_0x41e2('0x1e')]||null:null})[_0x41e2('0xf')](function(_0x12dd4f){if(_0x12dd4f){return _0x12dd4f[_0x41e2('0x23')](_0x2ebf27[_0x41e2('0x1c')][_0x41e2('0x24')],_[_0x41e2('0x25')](_0x2ebf27[_0x41e2('0x1c')],['ids','id'])||{});}})[_0x41e2('0x26')](function(_0x331bcd){logger[_0x41e2('0x10')](_0x41e2('0x27'),_0x2ebf27);logger['debug'](_0x41e2('0x27'),_0x2ebf27,JSON[_0x41e2('0x20')](_0x331bcd));_0x4b3a27(_0x331bcd);})[_0x41e2('0x19')](function(_0xadcfdf){logger[_0x41e2('0x15')](_0x41e2('0x27'),_0xadcfdf[_0x41e2('0x17')],_0x2ebf27);_0x123fc0(_this[_0x41e2('0x15')](0x1f4,_0xadcfdf['message']));});});};
\ No newline at end of file
+var _0x0ae7=['ChatInteraction','addTags','ids','omit','spread','AddTags','lodash','util','bluebird','ioredis','../../config/utils','../../config/logger','rpc','jayson/promise','defaults','redis','localhost','socket.io-emitter','./chatInteraction.socket','register','request','then','info','ChatInteraction,\x20%s,\x20%s','request\x20sent','debug','ChatInteraction,\x20%s,\x20%s,\x20%s','error','code','message','catch','UpdateChatInteraction','update','body','raw','options','where','attributes','limit','stringify','AddTagsToChatInteraction'];(function(_0x2e04ef,_0x31a596){var _0x5722b0=function(_0x386fbd){while(--_0x386fbd){_0x2e04ef['push'](_0x2e04ef['shift']());}};_0x5722b0(++_0x31a596);}(_0x0ae7,0xaa));var _0x70ae=function(_0x40bffc,_0x3a45d7){_0x40bffc=_0x40bffc-0x0;var _0x3007e9=_0x0ae7[_0x40bffc];return _0x3007e9;};'use strict';var _=require(_0x70ae('0x0'));var util=require(_0x70ae('0x1'));var moment=require('moment');var BPromise=require(_0x70ae('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x70ae('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x70ae('0x4'));var logger=require(_0x70ae('0x5'))(_0x70ae('0x6'));var config=require('../../config/environment');var jayson=require(_0x70ae('0x7'));var client=jayson['client']['http']({'port':0x232a});config['redis']=_[_0x70ae('0x8')](config[_0x70ae('0x9')],{'host':_0x70ae('0xa'),'port':0x18eb});var socket=require(_0x70ae('0xb'))(new Redis(config[_0x70ae('0x9')]));require(_0x70ae('0xc'))[_0x70ae('0xd')](socket);function respondWithRpcPromise(_0xecd9f2,_0x80fb4a,_0x4958fa){return new BPromise(function(_0x14fb34,_0x4afa01){return client[_0x70ae('0xe')](_0xecd9f2,_0x4958fa)[_0x70ae('0xf')](function(_0x1f2b6b){logger[_0x70ae('0x10')](_0x70ae('0x11'),_0x80fb4a,_0x70ae('0x12'));logger[_0x70ae('0x13')](_0x70ae('0x14'),_0x80fb4a,_0x70ae('0x12'),JSON['stringify'](_0x1f2b6b));if(_0x1f2b6b[_0x70ae('0x15')]){if(_0x1f2b6b[_0x70ae('0x15')][_0x70ae('0x16')]===0x1f4){logger[_0x70ae('0x15')](_0x70ae('0x11'),_0x80fb4a,_0x1f2b6b[_0x70ae('0x15')][_0x70ae('0x17')]);return _0x4afa01(_0x1f2b6b[_0x70ae('0x15')][_0x70ae('0x17')]);}logger[_0x70ae('0x15')]('ChatInteraction,\x20%s,\x20%s',_0x80fb4a,_0x1f2b6b['error'][_0x70ae('0x17')]);return _0x14fb34(_0x1f2b6b['error'][_0x70ae('0x17')]);}else{logger[_0x70ae('0x10')](_0x70ae('0x11'),_0x80fb4a,_0x70ae('0x12'));_0x14fb34(_0x1f2b6b['result'][_0x70ae('0x17')]);}})[_0x70ae('0x18')](function(_0x142f44){logger[_0x70ae('0x15')]('ChatInteraction,\x20%s,\x20%s',_0x80fb4a,_0x142f44);_0x4afa01(_0x142f44);});});}exports[_0x70ae('0x19')]=function(_0x3e5e67){var _0x2afb31=this;return new Promise(function(_0x3afd75,_0x8346a0){return db['ChatInteraction'][_0x70ae('0x1a')](_0x3e5e67[_0x70ae('0x1b')],{'raw':_0x3e5e67['options']?_0x3e5e67['options'][_0x70ae('0x1c')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x3e5e67[_0x70ae('0x1d')]?_0x3e5e67['options'][_0x70ae('0x1e')]||null:null,'attributes':_0x3e5e67['options']?_0x3e5e67[_0x70ae('0x1d')][_0x70ae('0x1f')]||null:null,'limit':_0x3e5e67['options']?_0x3e5e67[_0x70ae('0x1d')][_0x70ae('0x20')]||null:null})[_0x70ae('0xf')](function(_0x1cb530){logger[_0x70ae('0x10')](_0x70ae('0x19'),_0x3e5e67);logger[_0x70ae('0x13')]('UpdateChatInteraction',_0x3e5e67,JSON[_0x70ae('0x21')](_0x1cb530));_0x3afd75(_0x1cb530);})[_0x70ae('0x18')](function(_0x2c163a){logger[_0x70ae('0x15')]('UpdateChatInteraction',_0x2c163a[_0x70ae('0x17')],_0x3e5e67);_0x8346a0(_0x2afb31[_0x70ae('0x15')](0x1f4,_0x2c163a['message']));});});};exports[_0x70ae('0x22')]=function(_0x1b987e){return new Promise(function(_0x45117d,_0x132088){return db[_0x70ae('0x23')]['find']({'where':_0x1b987e[_0x70ae('0x1d')]?_0x1b987e[_0x70ae('0x1d')][_0x70ae('0x1e')]||null:null})[_0x70ae('0xf')](function(_0x22efe8){if(_0x22efe8){return _0x22efe8[_0x70ae('0x24')](_0x1b987e[_0x70ae('0x1b')][_0x70ae('0x25')],_[_0x70ae('0x26')](_0x1b987e['body'],[_0x70ae('0x25'),'id'])||{});}})[_0x70ae('0x27')](function(_0x1d95dd){logger[_0x70ae('0x10')]('AddTags',_0x1b987e);logger[_0x70ae('0x13')]('AddTags',_0x1b987e,JSON[_0x70ae('0x21')](_0x1d95dd));_0x45117d(_0x1d95dd);})['catch'](function(_0x5b1baf){logger['error'](_0x70ae('0x28'),_0x5b1baf['message'],_0x1b987e);_0x132088(_this['error'](0x1f4,_0x5b1baf[_0x70ae('0x17')]));});});};
\ No newline at end of file
diff --git a/server/api/chatInteraction/chatInteraction.socket.js b/server/api/chatInteraction/chatInteraction.socket.js
index 3daa133..f7cdc6a 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 _0x4992=['chatInteraction:','remove','emit','removeListener','register'];(function(_0xf94618,_0x114c5e){var _0x3b550f=function(_0xb2f0a1){while(--_0xb2f0a1){_0xf94618['push'](_0xf94618['shift']());}};_0x3b550f(++_0x114c5e);}(_0x4992,0xf1));var _0x2499=function(_0x413feb,_0x10477f){_0x413feb=_0x413feb-0x0;var _0x40ee88=_0x4992[_0x413feb];return _0x40ee88;};'use strict';var ChatInteractionEvents=require('./chatInteraction.events');var events=['save',_0x2499('0x0'),'update'];function createListener(_0xa4d8d8,_0x495d2b){return function(_0x491517){_0x495d2b[_0x2499('0x1')](_0xa4d8d8,_0x491517);};}function removeListener(_0x144673,_0x515056){return function(){ChatInteractionEvents[_0x2499('0x2')](_0x144673,_0x515056);};}exports[_0x2499('0x3')]=function(_0x111536){for(var _0x3a8ada=0x0,_0x41d7b2=events['length'];_0x3a8ada<_0x41d7b2;_0x3a8ada++){var _0x4f693f=events[_0x3a8ada];var _0x385f87=createListener(_0x2499('0x4')+_0x4f693f,_0x111536);ChatInteractionEvents['on'](_0x4f693f,_0x385f87);}};
\ No newline at end of file
+var _0x3b55=['update','emit','removeListener','length','chatInteraction:','./chatInteraction.events','remove'];(function(_0x5f156e,_0x1a4b94){var _0x508ef5=function(_0x22ac8a){while(--_0x22ac8a){_0x5f156e['push'](_0x5f156e['shift']());}};_0x508ef5(++_0x1a4b94);}(_0x3b55,0xc2));var _0x53b5=function(_0x43a5c7,_0x2286bf){_0x43a5c7=_0x43a5c7-0x0;var _0x3b12a2=_0x3b55[_0x43a5c7];return _0x3b12a2;};'use strict';var ChatInteractionEvents=require(_0x53b5('0x0'));var events=['save',_0x53b5('0x1'),_0x53b5('0x2')];function createListener(_0x519a0b,_0x51e6c6){return function(_0xa461fe){_0x51e6c6[_0x53b5('0x3')](_0x519a0b,_0xa461fe);};}function removeListener(_0x432ebe,_0x561ed6){return function(){ChatInteractionEvents[_0x53b5('0x4')](_0x432ebe,_0x561ed6);};}exports['register']=function(_0x133f78){for(var _0x5cd4dd=0x0,_0x2c9272=events[_0x53b5('0x5')];_0x5cd4dd<_0x2c9272;_0x5cd4dd++){var _0x857d00=events[_0x5cd4dd];var _0x567750=createListener(_0x53b5('0x6')+_0x857d00,_0x133f78);ChatInteractionEvents['on'](_0x857d00,_0x567750);}};
\ No newline at end of file
diff --git a/server/api/chatInteraction/index.js b/server/api/chatInteraction/index.js
index 88b6668..a82c26b 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 _0x8f68=['exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','index','get','/describe','isAuthenticated','describe','/:id','show','/:id/attachment_download','attachmentDownload','/:id/messages','getMessages','/:id/my_messages','isChatInteractionAuthorized','/:id/download','download','post','create','/:id/vidaoo','createVidaooSession','diskStorage','join','root','format','now','replace','/:id/attachment_upload','single','file','attachmentUpload','/:id/tags','chat','chatinteraction:addtags','addTags','put','update','/:id/custom_update','customUpdate','/:id/abandon','abandon','/:id/close','close','tracked','delete'];(function(_0x35a19c,_0xf88bc8){var _0x25c4b5=function(_0x1a88ec){while(--_0x1a88ec){_0x35a19c['push'](_0x35a19c['shift']());}};_0x25c4b5(++_0xf88bc8);}(_0x8f68,0x145));var _0x88f6=function(_0x20bcaf,_0x26c94a){_0x20bcaf=_0x20bcaf-0x0;var _0x79f764=_0x8f68[_0x20bcaf];return _0x79f764;};'use strict';var multer=require(_0x88f6('0x0'));var util=require(_0x88f6('0x1'));var path=require(_0x88f6('0x2'));var timeout=require(_0x88f6('0x3'));var express=require(_0x88f6('0x4'));var router=express[_0x88f6('0x5')]();var fs_extra=require(_0x88f6('0x6'));var auth=require(_0x88f6('0x7'));var interaction=require(_0x88f6('0x8'));var config=require(_0x88f6('0x9'));var controller=require('./chatInteraction.controller');router['get']('/',auth['isAuthenticated'](),controller[_0x88f6('0xa')]);router[_0x88f6('0xb')](_0x88f6('0xc'),auth[_0x88f6('0xd')](),controller[_0x88f6('0xe')]);router[_0x88f6('0xb')](_0x88f6('0xf'),auth['isChatInteractionAuthorized'](),controller[_0x88f6('0x10')]);router[_0x88f6('0xb')](_0x88f6('0x11'),auth['isChatInteractionAuthorized'](),controller[_0x88f6('0x12')]);router[_0x88f6('0xb')](_0x88f6('0x13'),auth[_0x88f6('0xd')](),controller[_0x88f6('0x14')]);router[_0x88f6('0xb')](_0x88f6('0x15'),auth[_0x88f6('0x16')](),controller['getMyMessages']);router[_0x88f6('0xb')](_0x88f6('0x17'),auth[_0x88f6('0xd')](),controller[_0x88f6('0x18')]);router[_0x88f6('0x19')]('/',auth[_0x88f6('0xd')](),controller[_0x88f6('0x1a')]);router[_0x88f6('0x19')](_0x88f6('0x1b'),auth[_0x88f6('0xd')](),controller[_0x88f6('0x1c')]);var upload=multer({'storage':multer[_0x88f6('0x1d')]({'destination':function(_0x847c9a,_0x4d8c78,_0x3aa919){_0x3aa919(null,path[_0x88f6('0x1e')](config[_0x88f6('0x1f')],'server/files/attachments/'));},'filename':function(_0x3fc66c,_0xbd1fb7,_0xcdc50b){_0xcdc50b(null,util[_0x88f6('0x20')]('%s-%s',Date[_0x88f6('0x21')](),_0xbd1fb7['originalname'][_0x88f6('0x22')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-')));}})});router['post'](_0x88f6('0x23'),upload[_0x88f6('0x24')](_0x88f6('0x25')),controller[_0x88f6('0x26')]);router[_0x88f6('0x19')](_0x88f6('0x13'),auth['isChatInteractionAuthorized'](),controller['addMessage']);router[_0x88f6('0x19')](_0x88f6('0x27'),auth[_0x88f6('0xd')](),interaction['tracked'](_0x88f6('0x28'),_0x88f6('0x29')),controller[_0x88f6('0x2a')]);router[_0x88f6('0x2b')](_0x88f6('0xf'),auth[_0x88f6('0xd')](),interaction['tracked']('chat','chatinteraction:update'),controller[_0x88f6('0x2c')]);router[_0x88f6('0x2b')](_0x88f6('0x2d'),controller[_0x88f6('0x2e')]);router['put'](_0x88f6('0x2f'),auth['isChatInteractionAuthorized'](),controller[_0x88f6('0x30')]);router[_0x88f6('0x2b')](_0x88f6('0x31'),controller[_0x88f6('0x32')]);router['delete'](_0x88f6('0xf'),auth[_0x88f6('0xd')](),interaction[_0x88f6('0x33')](_0x88f6('0x28'),'chatinteraction:destroy'),controller['destroy']);router[_0x88f6('0x34')](_0x88f6('0x27'),auth[_0x88f6('0xd')](),controller['removeTags']);module[_0x88f6('0x35')]=router;
\ No newline at end of file
+var _0xe82e=['join','root','server/files/attachments/','format','originalname','single','file','attachmentUpload','addMessage','tracked','chat','chatinteraction:addtags','put','chatinteraction:update','/:id/custom_update','customUpdate','/:id/abandon','abandon','/:id/close','close','delete','chatinteraction:destroy','destroy','/:id/tags','removeTags','exports','util','path','connect-timeout','express','Router','../../components/auth/service','../../config/environment','get','index','isAuthenticated','describe','/:id','isChatInteractionAuthorized','show','/:id/attachment_download','attachmentDownload','/:id/messages','getMessages','/:id/my_messages','getMyMessages','/:id/download','download','post','create','/:id/vidaoo','createVidaooSession'];(function(_0x465028,_0x4570ac){var _0xb783d4=function(_0x5458c5){while(--_0x5458c5){_0x465028['push'](_0x465028['shift']());}};_0xb783d4(++_0x4570ac);}(_0xe82e,0x1ee));var _0xee82=function(_0xaa0309,_0x1c8008){_0xaa0309=_0xaa0309-0x0;var _0x5de7ce=_0xe82e[_0xaa0309];return _0x5de7ce;};'use strict';var multer=require('multer');var util=require(_0xee82('0x0'));var path=require(_0xee82('0x1'));var timeout=require(_0xee82('0x2'));var express=require(_0xee82('0x3'));var router=express[_0xee82('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0xee82('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0xee82('0x6'));var controller=require('./chatInteraction.controller');router[_0xee82('0x7')]('/',auth['isAuthenticated'](),controller[_0xee82('0x8')]);router[_0xee82('0x7')]('/describe',auth[_0xee82('0x9')](),controller[_0xee82('0xa')]);router[_0xee82('0x7')](_0xee82('0xb'),auth[_0xee82('0xc')](),controller[_0xee82('0xd')]);router[_0xee82('0x7')](_0xee82('0xe'),auth[_0xee82('0xc')](),controller[_0xee82('0xf')]);router[_0xee82('0x7')](_0xee82('0x10'),auth[_0xee82('0x9')](),controller[_0xee82('0x11')]);router['get'](_0xee82('0x12'),auth[_0xee82('0xc')](),controller[_0xee82('0x13')]);router[_0xee82('0x7')](_0xee82('0x14'),auth[_0xee82('0x9')](),controller[_0xee82('0x15')]);router[_0xee82('0x16')]('/',auth[_0xee82('0x9')](),controller[_0xee82('0x17')]);router['post'](_0xee82('0x18'),auth['isAuthenticated'](),controller[_0xee82('0x19')]);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x4fed2c,_0x34854e,_0x38808d){_0x38808d(null,path[_0xee82('0x1a')](config[_0xee82('0x1b')],_0xee82('0x1c')));},'filename':function(_0x17f1f7,_0x4c9d52,_0x289ea2){_0x289ea2(null,util[_0xee82('0x1d')]('%s-%s',Date['now'](),_0x4c9d52[_0xee82('0x1e')]['replace'](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-')));}})});router[_0xee82('0x16')]('/:id/attachment_upload',upload[_0xee82('0x1f')](_0xee82('0x20')),controller[_0xee82('0x21')]);router[_0xee82('0x16')](_0xee82('0x10'),auth[_0xee82('0xc')](),controller[_0xee82('0x22')]);router[_0xee82('0x16')]('/:id/tags',auth[_0xee82('0x9')](),interaction[_0xee82('0x23')](_0xee82('0x24'),_0xee82('0x25')),controller['addTags']);router[_0xee82('0x26')](_0xee82('0xb'),auth[_0xee82('0x9')](),interaction['tracked']('chat',_0xee82('0x27')),controller['update']);router[_0xee82('0x26')](_0xee82('0x28'),controller[_0xee82('0x29')]);router[_0xee82('0x26')](_0xee82('0x2a'),auth[_0xee82('0xc')](),controller[_0xee82('0x2b')]);router[_0xee82('0x26')](_0xee82('0x2c'),controller[_0xee82('0x2d')]);router[_0xee82('0x2e')](_0xee82('0xb'),auth['isAuthenticated'](),interaction[_0xee82('0x23')]('chat',_0xee82('0x2f')),controller[_0xee82('0x30')]);router[_0xee82('0x2e')](_0xee82('0x31'),auth[_0xee82('0x9')](),controller[_0xee82('0x32')]);module[_0xee82('0x33')]=router;
\ No newline at end of file
diff --git a/server/api/chatInternalMessage/chatInternalMessage.attributes.js b/server/api/chatInternalMessage/chatInternalMessage.attributes.js
index ca8dd08..789a692 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 _0xf78d=['TEXT','INTEGER','exports'];(function(_0x1f8d29,_0x295837){var _0x5e5adf=function(_0x533cf5){while(--_0x533cf5){_0x1f8d29['push'](_0x1f8d29['shift']());}};_0x5e5adf(++_0x295837);}(_0xf78d,0x1d0));var _0xdf78=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xf78d[_0x3dd15e];return _0x231fd0;};'use strict';var Sequelize=require('sequelize');module[_0xdf78('0x0')]={'body':{'type':Sequelize[_0xdf78('0x1')]('medium'),'allowNull':![]},'read':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'ChatInternalMessageId':{'type':Sequelize[_0xdf78('0x2')]}};
\ No newline at end of file
+var _0x3ae5=['TEXT','medium','BOOLEAN','INTEGER','sequelize'];(function(_0x1ccbc9,_0x4764fb){var _0x3b97e1=function(_0x50d5fd){while(--_0x50d5fd){_0x1ccbc9['push'](_0x1ccbc9['shift']());}};_0x3b97e1(++_0x4764fb);}(_0x3ae5,0x1ad));var _0x53ae=function(_0x2ed1d0,_0x51fd0a){_0x2ed1d0=_0x2ed1d0-0x0;var _0x504043=_0x3ae5[_0x2ed1d0];return _0x504043;};'use strict';var Sequelize=require(_0x53ae('0x0'));module['exports']={'body':{'type':Sequelize[_0x53ae('0x1')](_0x53ae('0x2')),'allowNull':![]},'read':{'type':Sequelize[_0x53ae('0x3')],'defaultValue':![]},'ChatInternalMessageId':{'type':Sequelize[_0x53ae('0x4')]}};
\ No newline at end of file
diff --git a/server/api/chatInternalMessage/chatInternalMessage.controller.js b/server/api/chatInternalMessage/chatInternalMessage.controller.js
index 6c7dfce..7914cb9 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 _0xe0c5=['model','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','where','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','find','create','body','params','describe','messages','createdAt','lastMessageAt','format','YYYY-MM-DD\x20HH:mm:ss','lastMessage','getUsers','User','agent','admin','user','internal','online','lastLoginAt','allowmessenger','showWebBar','VoiceQueue','get','role','UserProfileSection','Agents','isEmpty','resourceId','push','FromId','ToId','read','sort','-createdAt','all','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','ejs','fs-extra','lodash','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/license/util','redis','defaults','localhost','socket.io-emitter','./chatInternalMessage.socket','register','sendStatus','status','end','json','offset','limit','undefined','count','set','apply','reject','update','destroy','then','error','name','map','ChatInternalMessage','fieldName','type','key'];(function(_0x2036d2,_0x57e925){var _0x1d8e18=function(_0x28d3e6){while(--_0x28d3e6){_0x2036d2['push'](_0x2036d2['shift']());}};_0x1d8e18(++_0x57e925);}(_0xe0c5,0x1dc));var _0x5e0c=function(_0x26fcfd,_0x2af46f){_0x26fcfd=_0x26fcfd-0x0;var _0x234f68=_0xe0c5[_0x26fcfd];return _0x234f68;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0x5e0c('0x0'));var rp=require(_0x5e0c('0x1'));var moment=require(_0x5e0c('0x2'));var BPromise=require(_0x5e0c('0x3'));var Mustache=require(_0x5e0c('0x4'));var util=require('util');var path=require(_0x5e0c('0x5'));var sox=require(_0x5e0c('0x6'));var csv=require('to-csv');var ejs=require(_0x5e0c('0x7'));var fs=require('fs');var fs_extra=require(_0x5e0c('0x8'));var _=require(_0x5e0c('0x9'));var squel=require(_0x5e0c('0xa'));var crypto=require('crypto');var jsforce=require(_0x5e0c('0xb'));var deskjs=require(_0x5e0c('0xc'));var toCsv=require('to-csv');var querystring=require(_0x5e0c('0xd'));var Papa=require(_0x5e0c('0xe'));var Redis=require(_0x5e0c('0xf'));var authService=require(_0x5e0c('0x10'));var qs=require('../../components/parsers/qs');var as=require(_0x5e0c('0x11'));var hardwareService=require(_0x5e0c('0x12'));var logger=require(_0x5e0c('0x13'))('api');var utils=require(_0x5e0c('0x14'));var config=require('../../config/environment');var licenseUtil=require(_0x5e0c('0x15'));var db=require('../../mysqldb')['db'];config[_0x5e0c('0x16')]=_[_0x5e0c('0x17')](config[_0x5e0c('0x16')],{'host':_0x5e0c('0x18'),'port':0x18eb});var socket=require(_0x5e0c('0x19'))(new Redis(config[_0x5e0c('0x16')]));require(_0x5e0c('0x1a'))[_0x5e0c('0x1b')](socket);function respondWithStatusCode(_0x3c16a1,_0x15d46e){_0x15d46e=_0x15d46e||0xcc;return function(_0x1c043b){if(_0x1c043b){return _0x3c16a1[_0x5e0c('0x1c')](_0x15d46e);}return _0x3c16a1[_0x5e0c('0x1d')](_0x15d46e)[_0x5e0c('0x1e')]();};}function respondWithResult(_0x586adc,_0x1ff2ec){_0x1ff2ec=_0x1ff2ec||0xc8;return function(_0x54885d){if(_0x54885d){return _0x586adc['status'](_0x1ff2ec)[_0x5e0c('0x1f')](_0x54885d);}};}function respondWithFilteredResult(_0x239004,_0x559c59){return function(_0x214f87){if(_0x214f87){var _0x182d16=typeof _0x559c59[_0x5e0c('0x20')]==='undefined'&&typeof _0x559c59[_0x5e0c('0x21')]===_0x5e0c('0x22');var _0xdb6533=_0x214f87[_0x5e0c('0x23')];var _0x24293f=_0x182d16?0x0:_0x559c59['offset'];var _0xe80815=_0x182d16?_0x214f87['count']:_0x559c59[_0x5e0c('0x20')]+_0x559c59['limit'];var _0x223d80;if(_0xe80815>=_0xdb6533){_0xe80815=_0xdb6533;_0x223d80=0xc8;}else{_0x223d80=0xce;}_0x239004[_0x5e0c('0x1d')](_0x223d80);return _0x239004[_0x5e0c('0x24')]('Content-Range',_0x24293f+'-'+_0xe80815+'/'+_0xdb6533)[_0x5e0c('0x1f')](_0x214f87);}return null;};}function patchUpdates(_0x35d159){return function(_0x3afc5e){try{jsonpatch[_0x5e0c('0x25')](_0x3afc5e,_0x35d159,!![]);}catch(_0x263f4c){return BPromise[_0x5e0c('0x26')](_0x263f4c);}return _0x3afc5e['save']();};}function saveUpdates(_0x3df838,_0x5b475a){return function(_0x22dbcf){if(_0x22dbcf){return _0x22dbcf[_0x5e0c('0x27')](_0x3df838)['then'](function(_0x47bb1f){return _0x47bb1f;});}return null;};}function removeEntity(_0xb3b4f4,_0x3c55f0){return function(_0x548149){if(_0x548149){return _0x548149[_0x5e0c('0x28')]()[_0x5e0c('0x29')](function(){_0xb3b4f4[_0x5e0c('0x1d')](0xcc)[_0x5e0c('0x1e')]();});}};}function handleEntityNotFound(_0x3ed0fd,_0x4b802e){return function(_0x4ef4d3){if(!_0x4ef4d3){_0x3ed0fd[_0x5e0c('0x1c')](0x194);}return _0x4ef4d3;};}function handleError(_0x26a4f5,_0x32674d){_0x32674d=_0x32674d||0x1f4;return function(_0x167a39){logger[_0x5e0c('0x2a')](_0x167a39['stack']);if(_0x167a39[_0x5e0c('0x2b')]){delete _0x167a39[_0x5e0c('0x2b')];}_0x26a4f5[_0x5e0c('0x1d')](_0x32674d)['send'](_0x167a39);};}exports['index']=function(_0x2d41e4,_0x5e3ae3){var _0xb2161f={},_0x2d1d9b={},_0x3724f5={'count':0x0,'rows':[]};var _0x4a94fd=_[_0x5e0c('0x2c')](db[_0x5e0c('0x2d')]['rawAttributes'],function(_0x2b1041){return{'name':_0x2b1041[_0x5e0c('0x2e')],'type':_0x2b1041[_0x5e0c('0x2f')][_0x5e0c('0x30')]};});_0x2d1d9b[_0x5e0c('0x31')]=_[_0x5e0c('0x2c')](_0x4a94fd,_0x5e0c('0x2b'));_0x2d1d9b['query']=_[_0x5e0c('0x32')](_0x2d41e4[_0x5e0c('0x33')]);_0x2d1d9b[_0x5e0c('0x34')]=_[_0x5e0c('0x35')](_0x2d1d9b[_0x5e0c('0x31')],_0x2d1d9b[_0x5e0c('0x33')]);_0xb2161f[_0x5e0c('0x36')]=_[_0x5e0c('0x35')](_0x2d1d9b[_0x5e0c('0x31')],qs['fields'](_0x2d41e4[_0x5e0c('0x33')][_0x5e0c('0x37')]));_0xb2161f[_0x5e0c('0x36')]=_0xb2161f[_0x5e0c('0x36')][_0x5e0c('0x38')]?_0xb2161f[_0x5e0c('0x36')]:_0x2d1d9b[_0x5e0c('0x31')];if(!_0x2d41e4[_0x5e0c('0x33')][_0x5e0c('0x39')]('nolimit')){_0xb2161f[_0x5e0c('0x21')]=qs[_0x5e0c('0x21')](_0x2d41e4[_0x5e0c('0x33')][_0x5e0c('0x21')]);_0xb2161f[_0x5e0c('0x20')]=qs['offset'](_0x2d41e4[_0x5e0c('0x33')]['offset']);}_0xb2161f['order']=qs['sort'](_0x2d41e4[_0x5e0c('0x33')]['sort']);_0xb2161f[_0x5e0c('0x3a')]=qs['filters'](_[_0x5e0c('0x3b')](_0x2d41e4[_0x5e0c('0x33')],_0x2d1d9b[_0x5e0c('0x34')]),_0x4a94fd);if(_0x2d41e4[_0x5e0c('0x33')][_0x5e0c('0x3c')]){_0xb2161f[_0x5e0c('0x3a')]=_[_0x5e0c('0x3d')](_0xb2161f[_0x5e0c('0x3a')],{'$or':_[_0x5e0c('0x2c')](_0x4a94fd,function(_0x2a25cf){if(_0x2a25cf[_0x5e0c('0x2f')]!==_0x5e0c('0x3e')){var _0x12ff65={};_0x12ff65[_0x2a25cf[_0x5e0c('0x2b')]]={'$like':'%'+_0x2d41e4[_0x5e0c('0x33')][_0x5e0c('0x3c')]+'%'};return _0x12ff65;}})});}_0xb2161f=_['merge']({},_0xb2161f,_0x2d41e4[_0x5e0c('0x3f')]);var _0x4d1de1={'where':_0xb2161f['where']};return db['ChatInternalMessage'][_0x5e0c('0x23')](_0x4d1de1)[_0x5e0c('0x29')](function(_0x2ebf17){_0x3724f5[_0x5e0c('0x23')]=_0x2ebf17;if(_0x2d41e4[_0x5e0c('0x33')][_0x5e0c('0x40')]){_0xb2161f[_0x5e0c('0x41')]=[{'all':!![]}];}return db[_0x5e0c('0x2d')][_0x5e0c('0x42')](_0xb2161f);})['then'](function(_0x1e28a4){_0x3724f5[_0x5e0c('0x43')]=_0x1e28a4;return _0x3724f5;})[_0x5e0c('0x29')](respondWithFilteredResult(_0x5e3ae3,_0xb2161f))[_0x5e0c('0x44')](handleError(_0x5e3ae3,null));};exports[_0x5e0c('0x45')]=function(_0x2c80a3,_0x3fc5d8){var _0x27103f={'raw':!![],'where':{'id':_0x2c80a3['params']['id']}},_0x51fb51={};_0x51fb51[_0x5e0c('0x31')]=_[_0x5e0c('0x32')](db[_0x5e0c('0x2d')]['rawAttributes']);_0x51fb51[_0x5e0c('0x33')]=_[_0x5e0c('0x32')](_0x2c80a3[_0x5e0c('0x33')]);_0x51fb51[_0x5e0c('0x34')]=_['intersection'](_0x51fb51['model'],_0x51fb51[_0x5e0c('0x33')]);_0x27103f[_0x5e0c('0x36')]=_['intersection'](_0x51fb51[_0x5e0c('0x31')],qs[_0x5e0c('0x37')](_0x2c80a3[_0x5e0c('0x33')][_0x5e0c('0x37')]));_0x27103f[_0x5e0c('0x36')]=_0x27103f[_0x5e0c('0x36')]['length']?_0x27103f['attributes']:_0x51fb51[_0x5e0c('0x31')];if(_0x2c80a3[_0x5e0c('0x33')]['includeAll']){_0x27103f[_0x5e0c('0x41')]=[{'all':!![]}];}_0x27103f=_['merge']({},_0x27103f,_0x2c80a3[_0x5e0c('0x3f')]);return db[_0x5e0c('0x2d')][_0x5e0c('0x46')](_0x27103f)[_0x5e0c('0x29')](handleEntityNotFound(_0x3fc5d8,null))[_0x5e0c('0x29')](respondWithResult(_0x3fc5d8,null))['catch'](handleError(_0x3fc5d8,null));};exports[_0x5e0c('0x47')]=function(_0x568df2,_0x3c5f10){return db['ChatInternalMessage'][_0x5e0c('0x47')](_0x568df2[_0x5e0c('0x48')],{})[_0x5e0c('0x29')](respondWithResult(_0x3c5f10,0xc9))['catch'](handleError(_0x3c5f10,null));};exports[_0x5e0c('0x27')]=function(_0x2c3a0a,_0x506e3b){if(_0x2c3a0a[_0x5e0c('0x48')]['id']){delete _0x2c3a0a['body']['id'];}return db[_0x5e0c('0x2d')][_0x5e0c('0x46')]({'where':{'id':_0x2c3a0a[_0x5e0c('0x49')]['id']}})[_0x5e0c('0x29')](handleEntityNotFound(_0x506e3b,null))['then'](saveUpdates(_0x2c3a0a[_0x5e0c('0x48')],null))[_0x5e0c('0x29')](respondWithResult(_0x506e3b,null))['catch'](handleError(_0x506e3b,null));};exports[_0x5e0c('0x28')]=function(_0x25986a,_0x7553d9){return db[_0x5e0c('0x2d')]['find']({'where':{'id':_0x25986a[_0x5e0c('0x49')]['id']}})[_0x5e0c('0x29')](handleEntityNotFound(_0x7553d9,null))[_0x5e0c('0x29')](removeEntity(_0x7553d9,null))['catch'](handleError(_0x7553d9,null));};exports[_0x5e0c('0x4a')]=function(_0x22699c,_0xf09940){return db[_0x5e0c('0x2d')][_0x5e0c('0x4a')]()[_0x5e0c('0x29')](respondWithResult(_0xf09940,null))[_0x5e0c('0x44')](handleError(_0xf09940,null));};function wrapUser(_0x11852c){return function(_0x381cef){var _0x244cfb=_0x11852c['get']({'plain':!![]});_0x244cfb[_0x5e0c('0x4b')]=[];if(_0x381cef){_0x244cfb['lastMessageAt']=_0x381cef[_0x5e0c('0x4c')];_0x244cfb['lastMessage']=_0x381cef;}else{_0x244cfb[_0x5e0c('0x4d')]=moment(0x0)[_0x5e0c('0x4e')](_0x5e0c('0x4f'));_0x244cfb[_0x5e0c('0x50')]={};}return _0x244cfb;};}exports[_0x5e0c('0x51')]=function(_0x4cd955,_0x14bb70,_0x50f440){var _0x1b5f23=[];return db[_0x5e0c('0x52')][_0x5e0c('0x42')]({'where':{'role':[_0x5e0c('0x53'),_0x5e0c('0x54'),_0x5e0c('0x55')]},'attributes':['id','fullname',_0x5e0c('0x2b'),'role','userpic',_0x5e0c('0x56'),_0x5e0c('0x57'),_0x5e0c('0x58'),_0x5e0c('0x59'),_0x5e0c('0x5a')],'order':qs['sort']('-online'),'include':[{'model':db[_0x5e0c('0x5b')],'as':'VoiceQueues','attributes':['id',_0x5e0c('0x2b'),'type'],'through':{'attributes':[]}}]})[_0x5e0c('0x29')](function(_0x26c95d){if(_0x26c95d){var _0x39f97a=_0x4cd955['user'][_0x5e0c('0x5c')]({'plain':!![]});if(!_0x39f97a)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x39f97a[_0x5e0c('0x5d')]===_0x5e0c('0x55')){return db[_0x5e0c('0x5e')][_0x5e0c('0x46')]({'where':{'name':_0x5e0c('0x5f'),'userProfileId':_0x39f97a['userProfileId']},'raw':!![]})[_0x5e0c('0x29')](function(_0x46e4a5){if(_0x46e4a5){if(_0x46e4a5['autoAssociation']===0x0){return db['UserProfileResource'][_0x5e0c('0x42')]({'where':{'sectionId':_0x46e4a5['id']},'raw':!![]})['then'](function(_0x31c19){var _0x436670=[];if(_[_0x5e0c('0x60')](_0x31c19)){_0x436670=_['filter'](_0x26c95d,function(_0x2ff586){if(_0x2ff586[_0x5e0c('0x5d')]!==_0x5e0c('0x53')){return _0x2ff586;}});return _0x436670;}else{for(var _0x19a5fd=0x0;_0x19a5fd<_0x26c95d['length'];_0x19a5fd++){var _0x2b79ba=_0x26c95d[_0x19a5fd];if(_0x2b79ba[_0x5e0c('0x5d')]===_0x5e0c('0x53')){var _0x9b7452=_['find'](_0x31c19,function(_0x315dd7){return _0x315dd7[_0x5e0c('0x61')]===_0x2b79ba['id'];});if(_0x9b7452)_0x436670['push'](_0x2b79ba);}else{_0x436670['push'](_0x2b79ba);}}return _0x436670;}});}else{return _0x26c95d;}}else{var _0x1403c7=_[_0x5e0c('0x3c')](_0x26c95d,function(_0x22665d){if(_0x22665d[_0x5e0c('0x5d')]!==_0x5e0c('0x53')){return _0x22665d;}});return _0x1403c7;}});}else{return _0x26c95d;}}})['then'](function(_0x2de3c9){var _0x2b291a=[];if(_0x2de3c9){_0x1b5f23=_0x2de3c9;for(var _0x5df3b1=0x0;_0x5df3b1<_0x2de3c9['length'];_0x5df3b1+=0x1){_0x1b5f23[_0x5df3b1]['messages']=[];_0x2b291a[_0x5e0c('0x62')](db[_0x5e0c('0x2d')][_0x5e0c('0x46')]({'where':{'FromId':[_0x4cd955[_0x5e0c('0x55')]['id'],_0x2de3c9[_0x5df3b1]['id']],'ToId':[_0x4cd955[_0x5e0c('0x55')]['id'],_0x2de3c9[_0x5df3b1]['id']],'ChatGroupId':null},'attributes':['id',_0x5e0c('0x4c'),_0x5e0c('0x63'),_0x5e0c('0x64'),_0x5e0c('0x65'),_0x5e0c('0x48')],'order':qs[_0x5e0c('0x66')](_0x5e0c('0x67')),'limit':0x1,'offset':0x0,'raw':!![]})[_0x5e0c('0x29')](wrapUser(_0x2de3c9[_0x5df3b1])));}return BPromise[_0x5e0c('0x68')](_0x2b291a);}return[];})[_0x5e0c('0x29')](function(_0xb4ceea){return{'rows':_0xb4ceea,'count':_0xb4ceea[_0x5e0c('0x38')]};})['then'](respondWithResult(_0x14bb70,null))[_0x5e0c('0x44')](handleError(_0x14bb70,null));};
\ No newline at end of file
+var _0x8962=['api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','localhost','./chatInternalMessage.socket','register','sendStatus','status','json','offset','undefined','count','limit','set','Content-Range','reject','save','update','then','destroy','stack','name','send','map','rawAttributes','fieldName','type','key','model','keys','query','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','sort','where','filter','merge','VIRTUAL','ChatInternalMessage','includeAll','findAll','rows','catch','params','options','find','create','body','describe','get','lastMessageAt','createdAt','format','lastMessage','User','fullname','role','userpic','lastLoginAt','allowmessenger','showWebBar','VoiceQueues','Unable\x20to\x20retrieve\x20the\x20current\x20user','user','UserProfileSection','Agents','autoAssociation','UserProfileResource','isEmpty','agent','resourceId','push','FromId','ToId','read','-createdAt','zip-dir','moment','bluebird','mustache','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','ioredis','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger'];(function(_0x5dd661,_0xbfefab){var _0x47672e=function(_0x50d5e5){while(--_0x50d5e5){_0x5dd661['push'](_0x5dd661['shift']());}};_0x47672e(++_0xbfefab);}(_0x8962,0x11f));var _0x2896=function(_0x4285c0,_0x264cbf){_0x4285c0=_0x4285c0-0x0;var _0x443be5=_0x8962[_0x4285c0];return _0x443be5;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x2896('0x0'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x2896('0x1'));var BPromise=require(_0x2896('0x2'));var Mustache=require(_0x2896('0x3'));var util=require('util');var path=require('path');var sox=require(_0x2896('0x4'));var csv=require(_0x2896('0x5'));var ejs=require(_0x2896('0x6'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x2896('0x7'));var squel=require(_0x2896('0x8'));var crypto=require(_0x2896('0x9'));var jsforce=require(_0x2896('0xa'));var deskjs=require(_0x2896('0xb'));var toCsv=require(_0x2896('0x5'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x2896('0xc'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0x2896('0xd'));var hardwareService=require(_0x2896('0xe'));var logger=require(_0x2896('0xf'))(_0x2896('0x10'));var utils=require(_0x2896('0x11'));var config=require(_0x2896('0x12'));var licenseUtil=require(_0x2896('0x13'));var db=require(_0x2896('0x14'))['db'];config[_0x2896('0x15')]=_[_0x2896('0x16')](config[_0x2896('0x15')],{'host':_0x2896('0x17'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0x2896('0x18'))[_0x2896('0x19')](socket);function respondWithStatusCode(_0x55251a,_0x2a54f4){_0x2a54f4=_0x2a54f4||0xcc;return function(_0x47fab3){if(_0x47fab3){return _0x55251a[_0x2896('0x1a')](_0x2a54f4);}return _0x55251a[_0x2896('0x1b')](_0x2a54f4)['end']();};}function respondWithResult(_0x77e767,_0xbfe192){_0xbfe192=_0xbfe192||0xc8;return function(_0x333fb0){if(_0x333fb0){return _0x77e767[_0x2896('0x1b')](_0xbfe192)[_0x2896('0x1c')](_0x333fb0);}};}function respondWithFilteredResult(_0x4195ac,_0x1ced7){return function(_0x271601){if(_0x271601){var _0x302540=typeof _0x1ced7[_0x2896('0x1d')]===_0x2896('0x1e')&&typeof _0x1ced7['limit']===_0x2896('0x1e');var _0x3f6e87=_0x271601[_0x2896('0x1f')];var _0x2ea422=_0x302540?0x0:_0x1ced7[_0x2896('0x1d')];var _0x4bdb8b=_0x302540?_0x271601['count']:_0x1ced7['offset']+_0x1ced7[_0x2896('0x20')];var _0x23f08c;if(_0x4bdb8b>=_0x3f6e87){_0x4bdb8b=_0x3f6e87;_0x23f08c=0xc8;}else{_0x23f08c=0xce;}_0x4195ac['status'](_0x23f08c);return _0x4195ac[_0x2896('0x21')](_0x2896('0x22'),_0x2ea422+'-'+_0x4bdb8b+'/'+_0x3f6e87)['json'](_0x271601);}return null;};}function patchUpdates(_0x4ab194){return function(_0x9dd7fa){try{jsonpatch['apply'](_0x9dd7fa,_0x4ab194,!![]);}catch(_0xa98d56){return BPromise[_0x2896('0x23')](_0xa98d56);}return _0x9dd7fa[_0x2896('0x24')]();};}function saveUpdates(_0x1e6747,_0x4b6171){return function(_0x767f3f){if(_0x767f3f){return _0x767f3f[_0x2896('0x25')](_0x1e6747)[_0x2896('0x26')](function(_0xf91245){return _0xf91245;});}return null;};}function removeEntity(_0x32797c,_0x5e87d3){return function(_0x51f860){if(_0x51f860){return _0x51f860[_0x2896('0x27')]()[_0x2896('0x26')](function(){_0x32797c[_0x2896('0x1b')](0xcc)['end']();});}};}function handleEntityNotFound(_0x3521c0,_0x510703){return function(_0x155338){if(!_0x155338){_0x3521c0[_0x2896('0x1a')](0x194);}return _0x155338;};}function handleError(_0x30d8cc,_0x12484a){_0x12484a=_0x12484a||0x1f4;return function(_0x549f77){logger['error'](_0x549f77[_0x2896('0x28')]);if(_0x549f77[_0x2896('0x29')]){delete _0x549f77[_0x2896('0x29')];}_0x30d8cc['status'](_0x12484a)[_0x2896('0x2a')](_0x549f77);};}exports['index']=function(_0x4b4192,_0x1658ba){var _0x3e3b0e={},_0x32fb56={},_0x6f1dd9={'count':0x0,'rows':[]};var _0x57eaf8=_[_0x2896('0x2b')](db['ChatInternalMessage'][_0x2896('0x2c')],function(_0x3f3912){return{'name':_0x3f3912[_0x2896('0x2d')],'type':_0x3f3912[_0x2896('0x2e')][_0x2896('0x2f')]};});_0x32fb56[_0x2896('0x30')]=_['map'](_0x57eaf8,_0x2896('0x29'));_0x32fb56['query']=_[_0x2896('0x31')](_0x4b4192[_0x2896('0x32')]);_0x32fb56[_0x2896('0x33')]=_[_0x2896('0x34')](_0x32fb56[_0x2896('0x30')],_0x32fb56[_0x2896('0x32')]);_0x3e3b0e['attributes']=_[_0x2896('0x34')](_0x32fb56[_0x2896('0x30')],qs[_0x2896('0x35')](_0x4b4192[_0x2896('0x32')][_0x2896('0x35')]));_0x3e3b0e[_0x2896('0x36')]=_0x3e3b0e['attributes'][_0x2896('0x37')]?_0x3e3b0e[_0x2896('0x36')]:_0x32fb56[_0x2896('0x30')];if(!_0x4b4192[_0x2896('0x32')][_0x2896('0x38')](_0x2896('0x39'))){_0x3e3b0e[_0x2896('0x20')]=qs[_0x2896('0x20')](_0x4b4192[_0x2896('0x32')][_0x2896('0x20')]);_0x3e3b0e['offset']=qs[_0x2896('0x1d')](_0x4b4192[_0x2896('0x32')][_0x2896('0x1d')]);}_0x3e3b0e['order']=qs[_0x2896('0x3a')](_0x4b4192[_0x2896('0x32')][_0x2896('0x3a')]);_0x3e3b0e[_0x2896('0x3b')]=qs[_0x2896('0x33')](_['pick'](_0x4b4192[_0x2896('0x32')],_0x32fb56[_0x2896('0x33')]),_0x57eaf8);if(_0x4b4192[_0x2896('0x32')][_0x2896('0x3c')]){_0x3e3b0e[_0x2896('0x3b')]=_[_0x2896('0x3d')](_0x3e3b0e[_0x2896('0x3b')],{'$or':_[_0x2896('0x2b')](_0x57eaf8,function(_0x1657e6){if(_0x1657e6['type']!==_0x2896('0x3e')){var _0x5dcda7={};_0x5dcda7[_0x1657e6['name']]={'$like':'%'+_0x4b4192[_0x2896('0x32')][_0x2896('0x3c')]+'%'};return _0x5dcda7;}})});}_0x3e3b0e=_['merge']({},_0x3e3b0e,_0x4b4192['options']);var _0xf4769={'where':_0x3e3b0e[_0x2896('0x3b')]};return db[_0x2896('0x3f')][_0x2896('0x1f')](_0xf4769)[_0x2896('0x26')](function(_0x4bd0ef){_0x6f1dd9[_0x2896('0x1f')]=_0x4bd0ef;if(_0x4b4192[_0x2896('0x32')][_0x2896('0x40')]){_0x3e3b0e['include']=[{'all':!![]}];}return db[_0x2896('0x3f')][_0x2896('0x41')](_0x3e3b0e);})[_0x2896('0x26')](function(_0x3896e7){_0x6f1dd9[_0x2896('0x42')]=_0x3896e7;return _0x6f1dd9;})[_0x2896('0x26')](respondWithFilteredResult(_0x1658ba,_0x3e3b0e))[_0x2896('0x43')](handleError(_0x1658ba,null));};exports['show']=function(_0x3d5e6d,_0x958156){var _0x2c1f6f={'raw':!![],'where':{'id':_0x3d5e6d[_0x2896('0x44')]['id']}},_0x497975={};_0x497975[_0x2896('0x30')]=_['keys'](db[_0x2896('0x3f')][_0x2896('0x2c')]);_0x497975[_0x2896('0x32')]=_[_0x2896('0x31')](_0x3d5e6d[_0x2896('0x32')]);_0x497975[_0x2896('0x33')]=_[_0x2896('0x34')](_0x497975[_0x2896('0x30')],_0x497975['query']);_0x2c1f6f[_0x2896('0x36')]=_[_0x2896('0x34')](_0x497975['model'],qs[_0x2896('0x35')](_0x3d5e6d['query'][_0x2896('0x35')]));_0x2c1f6f[_0x2896('0x36')]=_0x2c1f6f['attributes'][_0x2896('0x37')]?_0x2c1f6f[_0x2896('0x36')]:_0x497975[_0x2896('0x30')];if(_0x3d5e6d[_0x2896('0x32')][_0x2896('0x40')]){_0x2c1f6f['include']=[{'all':!![]}];}_0x2c1f6f=_[_0x2896('0x3d')]({},_0x2c1f6f,_0x3d5e6d[_0x2896('0x45')]);return db[_0x2896('0x3f')][_0x2896('0x46')](_0x2c1f6f)['then'](handleEntityNotFound(_0x958156,null))[_0x2896('0x26')](respondWithResult(_0x958156,null))[_0x2896('0x43')](handleError(_0x958156,null));};exports[_0x2896('0x47')]=function(_0x2814c8,_0x5b2dff){return db['ChatInternalMessage']['create'](_0x2814c8[_0x2896('0x48')],{})['then'](respondWithResult(_0x5b2dff,0xc9))[_0x2896('0x43')](handleError(_0x5b2dff,null));};exports[_0x2896('0x25')]=function(_0x2ae123,_0x2b9080){if(_0x2ae123[_0x2896('0x48')]['id']){delete _0x2ae123[_0x2896('0x48')]['id'];}return db['ChatInternalMessage']['find']({'where':{'id':_0x2ae123['params']['id']}})[_0x2896('0x26')](handleEntityNotFound(_0x2b9080,null))[_0x2896('0x26')](saveUpdates(_0x2ae123[_0x2896('0x48')],null))['then'](respondWithResult(_0x2b9080,null))[_0x2896('0x43')](handleError(_0x2b9080,null));};exports[_0x2896('0x27')]=function(_0x56b073,_0x9f1008){return db[_0x2896('0x3f')]['find']({'where':{'id':_0x56b073[_0x2896('0x44')]['id']}})[_0x2896('0x26')](handleEntityNotFound(_0x9f1008,null))[_0x2896('0x26')](removeEntity(_0x9f1008,null))[_0x2896('0x43')](handleError(_0x9f1008,null));};exports[_0x2896('0x49')]=function(_0xfcd2b6,_0x257985){return db[_0x2896('0x3f')][_0x2896('0x49')]()[_0x2896('0x26')](respondWithResult(_0x257985,null))[_0x2896('0x43')](handleError(_0x257985,null));};function wrapUser(_0x23174d){return function(_0xff3753){var _0x396c3b=_0x23174d[_0x2896('0x4a')]({'plain':!![]});_0x396c3b['messages']=[];if(_0xff3753){_0x396c3b[_0x2896('0x4b')]=_0xff3753[_0x2896('0x4c')];_0x396c3b['lastMessage']=_0xff3753;}else{_0x396c3b['lastMessageAt']=moment(0x0)[_0x2896('0x4d')]('YYYY-MM-DD\x20HH:mm:ss');_0x396c3b[_0x2896('0x4e')]={};}return _0x396c3b;};}exports['getUsers']=function(_0x3da91c,_0x27b796,_0x58c940){var _0x5316be=[];return db[_0x2896('0x4f')][_0x2896('0x41')]({'where':{'role':['agent','admin','user']},'attributes':['id',_0x2896('0x50'),'name',_0x2896('0x51'),_0x2896('0x52'),'internal','online',_0x2896('0x53'),_0x2896('0x54'),_0x2896('0x55')],'order':qs[_0x2896('0x3a')]('-online'),'include':[{'model':db['VoiceQueue'],'as':_0x2896('0x56'),'attributes':['id',_0x2896('0x29'),_0x2896('0x2e')],'through':{'attributes':[]}}]})[_0x2896('0x26')](function(_0x1ed21a){if(_0x1ed21a){var _0xe73673=_0x3da91c['user']['get']({'plain':!![]});if(!_0xe73673)throw new Error(_0x2896('0x57'));if(_0xe73673[_0x2896('0x51')]===_0x2896('0x58')){return db[_0x2896('0x59')][_0x2896('0x46')]({'where':{'name':_0x2896('0x5a'),'userProfileId':_0xe73673['userProfileId']},'raw':!![]})['then'](function(_0x57e88e){if(_0x57e88e){if(_0x57e88e[_0x2896('0x5b')]===0x0){return db[_0x2896('0x5c')][_0x2896('0x41')]({'where':{'sectionId':_0x57e88e['id']},'raw':!![]})[_0x2896('0x26')](function(_0xa92599){var _0x39d913=[];if(_[_0x2896('0x5d')](_0xa92599)){_0x39d913=_['filter'](_0x1ed21a,function(_0x49d4fb){if(_0x49d4fb[_0x2896('0x51')]!==_0x2896('0x5e')){return _0x49d4fb;}});return _0x39d913;}else{for(var _0x3ade06=0x0;_0x3ade06<_0x1ed21a['length'];_0x3ade06++){var _0x4135c0=_0x1ed21a[_0x3ade06];if(_0x4135c0['role']===_0x2896('0x5e')){var _0x47adb6=_['find'](_0xa92599,function(_0x1e5ca3){return _0x1e5ca3[_0x2896('0x5f')]===_0x4135c0['id'];});if(_0x47adb6)_0x39d913[_0x2896('0x60')](_0x4135c0);}else{_0x39d913[_0x2896('0x60')](_0x4135c0);}}return _0x39d913;}});}else{return _0x1ed21a;}}else{var _0x261c77=_[_0x2896('0x3c')](_0x1ed21a,function(_0x3e2c03){if(_0x3e2c03[_0x2896('0x51')]!==_0x2896('0x5e')){return _0x3e2c03;}});return _0x261c77;}});}else{return _0x1ed21a;}}})[_0x2896('0x26')](function(_0x30d215){var _0x5384eb=[];if(_0x30d215){_0x5316be=_0x30d215;for(var _0x486a41=0x0;_0x486a41<_0x30d215[_0x2896('0x37')];_0x486a41+=0x1){_0x5316be[_0x486a41]['messages']=[];_0x5384eb[_0x2896('0x60')](db['ChatInternalMessage']['find']({'where':{'FromId':[_0x3da91c['user']['id'],_0x30d215[_0x486a41]['id']],'ToId':[_0x3da91c[_0x2896('0x58')]['id'],_0x30d215[_0x486a41]['id']],'ChatGroupId':null},'attributes':['id','createdAt',_0x2896('0x61'),_0x2896('0x62'),_0x2896('0x63'),'body'],'order':qs[_0x2896('0x3a')](_0x2896('0x64')),'limit':0x1,'offset':0x0,'raw':!![]})['then'](wrapUser(_0x30d215[_0x486a41])));}return BPromise['all'](_0x5384eb);}return[];})[_0x2896('0x26')](function(_0x329882){return{'rows':_0x329882,'count':_0x329882['length']};})[_0x2896('0x26')](respondWithResult(_0x27b796,null))[_0x2896('0x43')](handleError(_0x27b796,null));};
\ No newline at end of file
diff --git a/server/api/chatInternalMessage/chatInternalMessage.events.js b/server/api/chatInternalMessage/chatInternalMessage.events.js
index 873b0a3..ba3d9f1 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 _0x3a00=['../../mysqldb','setMaxListeners','save','remove','emit','hasOwnProperty','hook','exports','events'];(function(_0x2f3195,_0xd55489){var _0x5a16fb=function(_0x3d1aad){while(--_0x3d1aad){_0x2f3195['push'](_0x2f3195['shift']());}};_0x5a16fb(++_0xd55489);}(_0x3a00,0xe0));var _0x03a0=function(_0x587dd0,_0x273922){_0x587dd0=_0x587dd0-0x0;var _0x56f153=_0x3a00[_0x587dd0];return _0x56f153;};'use strict';var EventEmitter=require(_0x03a0('0x0'));var ChatInternalMessage=require(_0x03a0('0x1'))['db']['ChatInternalMessage'];var ChatInternalMessageEvents=new EventEmitter();ChatInternalMessageEvents[_0x03a0('0x2')](0x0);var events={'afterCreate':_0x03a0('0x3'),'afterUpdate':'update','afterDestroy':_0x03a0('0x4')};function emitEvent(_0x479cc7){return function(_0x2b6f3a,_0x36a480,_0x3769ca){ChatInternalMessageEvents[_0x03a0('0x5')](_0x479cc7+':'+_0x2b6f3a['id'],_0x2b6f3a);ChatInternalMessageEvents['emit'](_0x479cc7,_0x2b6f3a);_0x3769ca(null);};}for(var e in events){if(events[_0x03a0('0x6')](e)){var event=events[e];ChatInternalMessage[_0x03a0('0x7')](e,emitEvent(event));}}module[_0x03a0('0x8')]=ChatInternalMessageEvents;
\ No newline at end of file
+var _0x8946=['update','remove','emit','events','../../mysqldb','ChatInternalMessage','save'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x8946,0x130));var _0x6894=function(_0x432fca,_0xb0b1b5){_0x432fca=_0x432fca-0x0;var _0x3adba4=_0x8946[_0x432fca];return _0x3adba4;};'use strict';var EventEmitter=require(_0x6894('0x0'));var ChatInternalMessage=require(_0x6894('0x1'))['db'][_0x6894('0x2')];var ChatInternalMessageEvents=new EventEmitter();ChatInternalMessageEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x6894('0x3'),'afterUpdate':_0x6894('0x4'),'afterDestroy':_0x6894('0x5')};function emitEvent(_0x76c9d6){return function(_0x2d9ea8,_0x19fb45,_0x27412f){ChatInternalMessageEvents[_0x6894('0x6')](_0x76c9d6+':'+_0x2d9ea8['id'],_0x2d9ea8);ChatInternalMessageEvents['emit'](_0x76c9d6,_0x2d9ea8);_0x27412f(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];ChatInternalMessage['hook'](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 74d4c32..78ad587 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 _0xa580=['util','api','bluebird','path','rimraf','../../config/environment','exports','define','ChatInternalMessage','chat_internal_messages','utf8mb4','lodash'];(function(_0x531ad4,_0x4fdd92){var _0x37fa11=function(_0x2d9e9d){while(--_0x2d9e9d){_0x531ad4['push'](_0x531ad4['shift']());}};_0x37fa11(++_0x4fdd92);}(_0xa580,0x107));var _0x0a58=function(_0x13d6ac,_0x3cc744){_0x13d6ac=_0x13d6ac-0x0;var _0x5f2e28=_0xa580[_0x13d6ac];return _0x5f2e28;};'use strict';var _=require(_0x0a58('0x0'));var util=require(_0x0a58('0x1'));var logger=require('../../config/logger')(_0x0a58('0x2'));var moment=require('moment');var BPromise=require(_0x0a58('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x0a58('0x4'));var rimraf=require(_0x0a58('0x5'));var config=require(_0x0a58('0x6'));var attributes=require('./chatInternalMessage.attributes');module[_0x0a58('0x7')]=function(_0x235cb3,_0x3f4883){return _0x235cb3[_0x0a58('0x8')](_0x0a58('0x9'),attributes,{'tableName':_0x0a58('0xa'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x0a58('0xb'),'collate':'utf8mb4_unicode_ci'});};
\ No newline at end of file
+var _0x30a6=['../../config/logger','api','moment','request-promise','path','./chatInternalMessage.attributes','exports','define','chat_internal_messages','utf8mb4','utf8mb4_unicode_ci','lodash','util'];(function(_0x1e5465,_0x94e77e){var _0x3341b6=function(_0x38fe8d){while(--_0x38fe8d){_0x1e5465['push'](_0x1e5465['shift']());}};_0x3341b6(++_0x94e77e);}(_0x30a6,0x11c));var _0x630a=function(_0xe3b59c,_0x456c5e){_0xe3b59c=_0xe3b59c-0x0;var _0x586a7a=_0x30a6[_0xe3b59c];return _0x586a7a;};'use strict';var _=require(_0x630a('0x0'));var util=require(_0x630a('0x1'));var logger=require(_0x630a('0x2'))(_0x630a('0x3'));var moment=require(_0x630a('0x4'));var BPromise=require('bluebird');var rp=require(_0x630a('0x5'));var fs=require('fs');var path=require(_0x630a('0x6'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x630a('0x7'));module[_0x630a('0x8')]=function(_0x4f7836,_0x2e34ae){return _0x4f7836[_0x630a('0x9')]('ChatInternalMessage',attributes,{'tableName':_0x630a('0xa'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x630a('0xb'),'collate':_0x630a('0xc')});};
\ No newline at end of file
diff --git a/server/api/chatInternalMessage/chatInternalMessage.rpc.js b/server/api/chatInternalMessage/chatInternalMessage.rpc.js
index 3ba2dea..edbb425 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 _0xf3aa=['bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','client','http','redis','defaults','localhost','./chatInternalMessage.socket','register','request','then','ChatInternalMessage,\x20%s,\x20%s','ChatInternalMessage,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','message','info','result','catch','lodash','moment'];(function(_0x58674c,_0x3c35a6){var _0x4102a3=function(_0x2d7031){while(--_0x2d7031){_0x58674c['push'](_0x58674c['shift']());}};_0x4102a3(++_0x3c35a6);}(_0xf3aa,0x16a));var _0xaf3a=function(_0x413727,_0x17adb1){_0x413727=_0x413727-0x0;var _0x5f46d7=_0xf3aa[_0x413727];return _0x5f46d7;};'use strict';var _=require(_0xaf3a('0x0'));var util=require('util');var moment=require(_0xaf3a('0x1'));var BPromise=require(_0xaf3a('0x2'));var rs=require(_0xaf3a('0x3'));var fs=require('fs');var Redis=require(_0xaf3a('0x4'));var db=require(_0xaf3a('0x5'))['db'];var utils=require(_0xaf3a('0x6'));var logger=require(_0xaf3a('0x7'))('rpc');var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0xaf3a('0x8')][_0xaf3a('0x9')]({'port':0x232a});config[_0xaf3a('0xa')]=_[_0xaf3a('0xb')](config['redis'],{'host':_0xaf3a('0xc'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xaf3a('0xa')]));require(_0xaf3a('0xd'))[_0xaf3a('0xe')](socket);function respondWithRpcPromise(_0x11d0dc,_0x403a69,_0x449086){return new BPromise(function(_0x35be54,_0x452123){return client[_0xaf3a('0xf')](_0x11d0dc,_0x449086)[_0xaf3a('0x10')](function(_0x2083f9){logger['info'](_0xaf3a('0x11'),_0x403a69,'request\x20sent');logger['debug'](_0xaf3a('0x12'),_0x403a69,_0xaf3a('0x13'),JSON['stringify'](_0x2083f9));if(_0x2083f9[_0xaf3a('0x14')]){if(_0x2083f9[_0xaf3a('0x14')][_0xaf3a('0x15')]===0x1f4){logger['error'](_0xaf3a('0x11'),_0x403a69,_0x2083f9[_0xaf3a('0x14')][_0xaf3a('0x16')]);return _0x452123(_0x2083f9['error'][_0xaf3a('0x16')]);}logger['error']('ChatInternalMessage,\x20%s,\x20%s',_0x403a69,_0x2083f9[_0xaf3a('0x14')][_0xaf3a('0x16')]);return _0x35be54(_0x2083f9[_0xaf3a('0x14')]['message']);}else{logger[_0xaf3a('0x17')]('ChatInternalMessage,\x20%s,\x20%s',_0x403a69,_0xaf3a('0x13'));_0x35be54(_0x2083f9[_0xaf3a('0x18')]['message']);}})[_0xaf3a('0x19')](function(_0x178183){logger['error'](_0xaf3a('0x11'),_0x403a69,_0x178183);_0x452123(_0x178183);});});}
\ No newline at end of file
+var _0xcb79=['defaults','localhost','socket.io-emitter','./chatInternalMessage.socket','info','ChatInternalMessage,\x20%s,\x20%s','debug','ChatInternalMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','message','request\x20sent','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http'];(function(_0x4b369d,_0x265eb8){var _0x571a98=function(_0x56341a){while(--_0x56341a){_0x4b369d['push'](_0x4b369d['shift']());}};_0x571a98(++_0x265eb8);}(_0xcb79,0x15f));var _0x9cb7=function(_0x1abe13,_0x140231){_0x1abe13=_0x1abe13-0x0;var _0x4884b2=_0xcb79[_0x1abe13];return _0x4884b2;};'use strict';var _=require(_0x9cb7('0x0'));var util=require(_0x9cb7('0x1'));var moment=require(_0x9cb7('0x2'));var BPromise=require(_0x9cb7('0x3'));var rs=require(_0x9cb7('0x4'));var fs=require('fs');var Redis=require(_0x9cb7('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0x9cb7('0x6'));var logger=require(_0x9cb7('0x7'))(_0x9cb7('0x8'));var config=require(_0x9cb7('0x9'));var jayson=require(_0x9cb7('0xa'));var client=jayson[_0x9cb7('0xb')][_0x9cb7('0xc')]({'port':0x232a});config['redis']=_[_0x9cb7('0xd')](config['redis'],{'host':_0x9cb7('0xe'),'port':0x18eb});var socket=require(_0x9cb7('0xf'))(new Redis(config['redis']));require(_0x9cb7('0x10'))['register'](socket);function respondWithRpcPromise(_0x1d61e1,_0x39e8a9,_0x38de4f){return new BPromise(function(_0x51481d,_0x1e18b0){return client['request'](_0x1d61e1,_0x38de4f)['then'](function(_0x5e626e){logger[_0x9cb7('0x11')](_0x9cb7('0x12'),_0x39e8a9,'request\x20sent');logger[_0x9cb7('0x13')](_0x9cb7('0x14'),_0x39e8a9,'request\x20sent',JSON[_0x9cb7('0x15')](_0x5e626e));if(_0x5e626e[_0x9cb7('0x16')]){if(_0x5e626e['error'][_0x9cb7('0x17')]===0x1f4){logger['error'](_0x9cb7('0x12'),_0x39e8a9,_0x5e626e[_0x9cb7('0x16')][_0x9cb7('0x18')]);return _0x1e18b0(_0x5e626e[_0x9cb7('0x16')][_0x9cb7('0x18')]);}logger[_0x9cb7('0x16')](_0x9cb7('0x12'),_0x39e8a9,_0x5e626e['error'][_0x9cb7('0x18')]);return _0x51481d(_0x5e626e['error']['message']);}else{logger[_0x9cb7('0x11')](_0x9cb7('0x12'),_0x39e8a9,_0x9cb7('0x19'));_0x51481d(_0x5e626e[_0x9cb7('0x1a')][_0x9cb7('0x18')]);}})[_0x9cb7('0x1b')](function(_0x38940f){logger[_0x9cb7('0x16')](_0x9cb7('0x12'),_0x39e8a9,_0x38940f);_0x1e18b0(_0x38940f);});});}
\ No newline at end of file
diff --git a/server/api/chatInternalMessage/chatInternalMessage.socket.js b/server/api/chatInternalMessage/chatInternalMessage.socket.js
index f34e170..7a3d5fd 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 _0x84a7=['removeListener','length','chatInternalMessage:','./chatInternalMessage.events','remove','update','emit'];(function(_0x531cb8,_0x8ef36f){var _0x5cf297=function(_0x45acb4){while(--_0x45acb4){_0x531cb8['push'](_0x531cb8['shift']());}};_0x5cf297(++_0x8ef36f);}(_0x84a7,0x137));var _0x784a=function(_0x122ef9,_0x451d2a){_0x122ef9=_0x122ef9-0x0;var _0x42fba0=_0x84a7[_0x122ef9];return _0x42fba0;};'use strict';var ChatInternalMessageEvents=require(_0x784a('0x0'));var events=['save',_0x784a('0x1'),_0x784a('0x2')];function createListener(_0x54ff97,_0x58ba95){return function(_0xf6d0e6){_0x58ba95[_0x784a('0x3')](_0x54ff97,_0xf6d0e6);};}function removeListener(_0x3ae353,_0x4a31cd){return function(){ChatInternalMessageEvents[_0x784a('0x4')](_0x3ae353,_0x4a31cd);};}exports['register']=function(_0x287db9){for(var _0x1d3ac7=0x0,_0x5562e=events[_0x784a('0x5')];_0x1d3ac7<_0x5562e;_0x1d3ac7++){var _0x4d6e30=events[_0x1d3ac7];var _0x3c8ea1=createListener(_0x784a('0x6')+_0x4d6e30,_0x287db9);ChatInternalMessageEvents['on'](_0x4d6e30,_0x3c8ea1);}};
\ No newline at end of file
+var _0xc04b=['./chatInternalMessage.events','save','update','emit','register','chatInternalMessage:'];(function(_0x120b71,_0x5bb618){var _0x50d58f=function(_0x81c860){while(--_0x81c860){_0x120b71['push'](_0x120b71['shift']());}};_0x50d58f(++_0x5bb618);}(_0xc04b,0x1ec));var _0xbc04=function(_0x200a1d,_0x2b4a70){_0x200a1d=_0x200a1d-0x0;var _0x5db63b=_0xc04b[_0x200a1d];return _0x5db63b;};'use strict';var ChatInternalMessageEvents=require(_0xbc04('0x0'));var events=[_0xbc04('0x1'),'remove',_0xbc04('0x2')];function createListener(_0x6d4ef6,_0x3e1854){return function(_0x518716){_0x3e1854[_0xbc04('0x3')](_0x6d4ef6,_0x518716);};}function removeListener(_0x18d14a,_0xac3069){return function(){ChatInternalMessageEvents['removeListener'](_0x18d14a,_0xac3069);};}exports[_0xbc04('0x4')]=function(_0xdffbe6){for(var _0x58f60e=0x0,_0x37708c=events['length'];_0x58f60e<_0x37708c;_0x58f60e++){var _0x323b6b=events[_0x58f60e];var _0x2e6612=createListener(_0xbc04('0x5')+_0x323b6b,_0xdffbe6);ChatInternalMessageEvents['on'](_0x323b6b,_0x2e6612);}};
\ No newline at end of file
diff --git a/server/api/chatInternalMessage/index.js b/server/api/chatInternalMessage/index.js
index 5b94e03..bdb90bb 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 _0x7bd7=['isAuthenticated','index','/describe','describe','/users','show','post','create','put','/:id','destroy','exports','multer','util','path','express','../../components/auth/service','../../components/interaction/service','../../config/environment','get'];(function(_0x544099,_0x372b30){var _0x20ab09=function(_0x149613){while(--_0x149613){_0x544099['push'](_0x544099['shift']());}};_0x20ab09(++_0x372b30);}(_0x7bd7,0x1c4));var _0x77bd=function(_0x528ef8,_0x1b1681){_0x528ef8=_0x528ef8-0x0;var _0x68c11b=_0x7bd7[_0x528ef8];return _0x68c11b;};'use strict';var multer=require(_0x77bd('0x0'));var util=require(_0x77bd('0x1'));var path=require(_0x77bd('0x2'));var timeout=require('connect-timeout');var express=require(_0x77bd('0x3'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0x77bd('0x4'));var interaction=require(_0x77bd('0x5'));var config=require(_0x77bd('0x6'));var controller=require('./chatInternalMessage.controller');router[_0x77bd('0x7')]('/',auth[_0x77bd('0x8')](),controller[_0x77bd('0x9')]);router[_0x77bd('0x7')](_0x77bd('0xa'),auth[_0x77bd('0x8')](),controller[_0x77bd('0xb')]);router[_0x77bd('0x7')](_0x77bd('0xc'),auth[_0x77bd('0x8')](),controller['getUsers']);router['get']('/:id',auth[_0x77bd('0x8')](),controller[_0x77bd('0xd')]);router[_0x77bd('0xe')]('/',auth['isAuthenticated'](),controller[_0x77bd('0xf')]);router[_0x77bd('0x10')]('/:id',controller['update']);router['delete'](_0x77bd('0x11'),auth[_0x77bd('0x8')](),controller[_0x77bd('0x12')]);module[_0x77bd('0x13')]=router;
\ No newline at end of file
+var _0x2153=['get','isAuthenticated','/describe','/users','show','post','put','/:id','update','delete','exports','multer','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatInternalMessage.controller'];(function(_0x592d0e,_0x433837){var _0x29a876=function(_0x2234d5){while(--_0x2234d5){_0x592d0e['push'](_0x592d0e['shift']());}};_0x29a876(++_0x433837);}(_0x2153,0x6f));var _0x3215=function(_0x321df7,_0x5579dd){_0x321df7=_0x321df7-0x0;var _0x1ddef4=_0x2153[_0x321df7];return _0x1ddef4;};'use strict';var multer=require(_0x3215('0x0'));var util=require('util');var path=require(_0x3215('0x1'));var timeout=require(_0x3215('0x2'));var express=require(_0x3215('0x3'));var router=express[_0x3215('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x3215('0x5'));var interaction=require(_0x3215('0x6'));var config=require(_0x3215('0x7'));var controller=require(_0x3215('0x8'));router[_0x3215('0x9')]('/',auth[_0x3215('0xa')](),controller['index']);router['get'](_0x3215('0xb'),auth[_0x3215('0xa')](),controller['describe']);router[_0x3215('0x9')](_0x3215('0xc'),auth['isAuthenticated'](),controller['getUsers']);router[_0x3215('0x9')]('/:id',auth['isAuthenticated'](),controller[_0x3215('0xd')]);router[_0x3215('0xe')]('/',auth[_0x3215('0xa')](),controller['create']);router[_0x3215('0xf')](_0x3215('0x10'),controller[_0x3215('0x11')]);router[_0x3215('0x12')]('/:id',auth['isAuthenticated'](),controller['destroy']);module[_0x3215('0x13')]=router;
\ No newline at end of file
diff --git a/server/api/chatMessage/chatMessage.attributes.js b/server/api/chatMessage/chatMessage.attributes.js
index 2062bbb..bf7bca9 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 _0x33d2=['STRING','sequelize','exports','TEXT','BOOLEAN','out','DATE'];(function(_0x5ce8b9,_0x5cded8){var _0xe34be0=function(_0xe3d4e5){while(--_0xe3d4e5){_0x5ce8b9['push'](_0x5ce8b9['shift']());}};_0xe34be0(++_0x5cded8);}(_0x33d2,0x7f));var _0x233d=function(_0x333160,_0x4c1df7){_0x333160=_0x333160-0x0;var _0x256d5a=_0x33d2[_0x333160];return _0x256d5a;};'use strict';var Sequelize=require(_0x233d('0x0'));module[_0x233d('0x1')]={'body':{'type':Sequelize[_0x233d('0x2')]('medium'),'allowNull':![]},'read':{'type':Sequelize[_0x233d('0x3')],'defaultValue':![]},'secret':{'type':Sequelize[_0x233d('0x3')],'defaultValue':![]},'direction':{'type':Sequelize['ENUM']('in',_0x233d('0x4')),'defaultValue':_0x233d('0x4'),'allowNull':![]},'readAt':{'type':Sequelize[_0x233d('0x5')]},'providerName':{'type':Sequelize[_0x233d('0x6')]},'providerResponse':{'type':Sequelize[_0x233d('0x2')]}};
\ No newline at end of file
+var _0x4e81=['out','DATE','STRING','sequelize','exports','TEXT','ENUM'];(function(_0xabfec4,_0x35076e){var _0x7bafa2=function(_0x52d551){while(--_0x52d551){_0xabfec4['push'](_0xabfec4['shift']());}};_0x7bafa2(++_0x35076e);}(_0x4e81,0x1bc));var _0x14e8=function(_0x3de873,_0x174b5f){_0x3de873=_0x3de873-0x0;var _0x380b8c=_0x4e81[_0x3de873];return _0x380b8c;};'use strict';var Sequelize=require(_0x14e8('0x0'));module[_0x14e8('0x1')]={'body':{'type':Sequelize[_0x14e8('0x2')]('medium'),'allowNull':![]},'read':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'secret':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'direction':{'type':Sequelize[_0x14e8('0x3')]('in',_0x14e8('0x4')),'defaultValue':_0x14e8('0x4'),'allowNull':![]},'readAt':{'type':Sequelize[_0x14e8('0x5')]},'providerName':{'type':Sequelize[_0x14e8('0x6')]},'providerResponse':{'type':Sequelize[_0x14e8('0x2')]}};
\ No newline at end of file
diff --git a/server/api/chatMessage/chatMessage.controller.js b/server/api/chatMessage/chatMessage.controller.js
index eae0b93..545bb43 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 _0x4dab=['jayson/promise','client','http','request','info','request\x20sent','debug','stringify','code','error','ChatMessage,\x20%s,\x20%s','message','result','catch','status','json','offset','undefined','limit','count','set','reject','save','then','end','stack','name','send','index','ChatMessage','type','key','model','map','query','keys','filters','intersection','attributes','fields','length','nolimit','order','sort','where','filter','VIRTUAL','merge','options','includeAll','include','rows','show','rawAttributes','find','create','body','update','params','destroy','describe','chat','read','readAt','format','YYYY-MM-DD\x20HH:mm:ss','UserId','user','agent','get','ChatInteractionId','read1stAt','AcceptMessage','ContactId','SELECT','contact','User','email','internal','manual','SIP/%s','channel','motionChannel','event','accept','EventManager','acceptmessage','interaction','chat-interactions','ChatInteraction','[CHATMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','role','null','RejectMessage','rejectMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','sequelize','Sequelize','QueryTypes','interface','rejectmessage','formData','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','path','sox','to-csv','ejs','fs-extra','lodash','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','defaults','socket.io-emitter','redis','register'];(function(_0x391fda,_0x39a798){var _0x2540fc=function(_0x2aa516){while(--_0x2aa516){_0x391fda['push'](_0x391fda['shift']());}};_0x2540fc(++_0x39a798);}(_0x4dab,0x66));var _0xb4da=function(_0x31bb4e,_0x2d4db0){_0x31bb4e=_0x31bb4e-0x0;var _0x37defa=_0x4dab[_0x31bb4e];return _0x37defa;};'use strict';var emlformat=require(_0xb4da('0x0'));var rimraf=require(_0xb4da('0x1'));var zipdir=require(_0xb4da('0x2'));var jsonpatch=require(_0xb4da('0x3'));var rp=require(_0xb4da('0x4'));var moment=require('moment');var BPromise=require(_0xb4da('0x5'));var Mustache=require(_0xb4da('0x6'));var util=require('util');var path=require(_0xb4da('0x7'));var sox=require(_0xb4da('0x8'));var csv=require(_0xb4da('0x9'));var ejs=require(_0xb4da('0xa'));var fs=require('fs');var fs_extra=require(_0xb4da('0xb'));var _=require(_0xb4da('0xc'));var squel=require('squel');var crypto=require(_0xb4da('0xd'));var jsforce=require(_0xb4da('0xe'));var deskjs=require(_0xb4da('0xf'));var toCsv=require('to-csv');var querystring=require(_0xb4da('0x10'));var Papa=require(_0xb4da('0x11'));var Redis=require(_0xb4da('0x12'));var authService=require(_0xb4da('0x13'));var qs=require(_0xb4da('0x14'));var as=require(_0xb4da('0x15'));var hardwareService=require(_0xb4da('0x16'));var logger=require(_0xb4da('0x17'))('api');var utils=require(_0xb4da('0x18'));var config=require(_0xb4da('0x19'));var licenseUtil=require(_0xb4da('0x1a'));var db=require(_0xb4da('0x1b'))['db'];config['redis']=_[_0xb4da('0x1c')](config['redis'],{'host':'localhost','port':0x18eb});var socket=require(_0xb4da('0x1d'))(new Redis(config[_0xb4da('0x1e')]));require('./chatMessage.socket')[_0xb4da('0x1f')](socket);var jayson=require(_0xb4da('0x20'));var client=jayson[_0xb4da('0x21')][_0xb4da('0x22')]({'port':0x232c});var client9002=jayson[_0xb4da('0x21')]['http']({'port':0x232a});function respondWithRpcPromise(_0x5f3d5a,_0x459e82,_0x13f491,_0x4a42a9){return new BPromise(function(_0x4ed159,_0x6f7150){var _0x4cfc86=_0x4a42a9||client;return _0x4cfc86[_0xb4da('0x23')](_0x5f3d5a,_0x13f491)['then'](function(_0x191ab7){logger[_0xb4da('0x24')]('ChatMessage,\x20%s,\x20%s',_0x459e82,_0xb4da('0x25'));logger[_0xb4da('0x26')]('ChatMessage,\x20%s,\x20%s,\x20%s',_0x459e82,_0xb4da('0x25'),JSON[_0xb4da('0x27')](_0x191ab7));if(_0x191ab7['error']){if(_0x191ab7['error'][_0xb4da('0x28')]===0x1f4){logger[_0xb4da('0x29')](_0xb4da('0x2a'),_0x459e82,_0x191ab7[_0xb4da('0x29')][_0xb4da('0x2b')]);return _0x6f7150(_0x191ab7[_0xb4da('0x29')][_0xb4da('0x2b')]);}logger[_0xb4da('0x29')](_0xb4da('0x2a'),_0x459e82,_0x191ab7[_0xb4da('0x29')][_0xb4da('0x2b')]);return _0x4ed159(_0x191ab7[_0xb4da('0x29')][_0xb4da('0x2b')]);}else{logger[_0xb4da('0x24')](_0xb4da('0x2a'),_0x459e82,_0xb4da('0x25'));_0x4ed159(_0x191ab7[_0xb4da('0x2c')][_0xb4da('0x2b')]);}})[_0xb4da('0x2d')](function(_0x446053){logger[_0xb4da('0x29')](_0xb4da('0x2a'),_0x459e82,_0x446053);_0x6f7150(_0x446053);});});}function respondWithStatusCode(_0x5a0f18,_0x4825a0){_0x4825a0=_0x4825a0||0xcc;return function(_0x377d4f){if(_0x377d4f){return _0x5a0f18['sendStatus'](_0x4825a0);}return _0x5a0f18[_0xb4da('0x2e')](_0x4825a0)['end']();};}function respondWithResult(_0x5a6d5f,_0x2c146c){_0x2c146c=_0x2c146c||0xc8;return function(_0x91d489){if(_0x91d489){return _0x5a6d5f[_0xb4da('0x2e')](_0x2c146c)[_0xb4da('0x2f')](_0x91d489);}};}function respondWithFilteredResult(_0x145ab5,_0x53e51d){return function(_0x4db505){if(_0x4db505){var _0x4c1fff=typeof _0x53e51d[_0xb4da('0x30')]===_0xb4da('0x31')&&typeof _0x53e51d[_0xb4da('0x32')]===_0xb4da('0x31');var _0x157757=_0x4db505[_0xb4da('0x33')];var _0x454fad=_0x4c1fff?0x0:_0x53e51d[_0xb4da('0x30')];var _0x325def=_0x4c1fff?_0x4db505[_0xb4da('0x33')]:_0x53e51d[_0xb4da('0x30')]+_0x53e51d[_0xb4da('0x32')];var _0x1a4333;if(_0x325def>=_0x157757){_0x325def=_0x157757;_0x1a4333=0xc8;}else{_0x1a4333=0xce;}_0x145ab5['status'](_0x1a4333);return _0x145ab5[_0xb4da('0x34')]('Content-Range',_0x454fad+'-'+_0x325def+'/'+_0x157757)[_0xb4da('0x2f')](_0x4db505);}return null;};}function patchUpdates(_0x57163e){return function(_0x10aed8){try{jsonpatch['apply'](_0x10aed8,_0x57163e,!![]);}catch(_0x5dbac7){return BPromise[_0xb4da('0x35')](_0x5dbac7);}return _0x10aed8[_0xb4da('0x36')]();};}function saveUpdates(_0x3978b7,_0x31ba57){return function(_0x20b726){if(_0x20b726){return _0x20b726['update'](_0x3978b7)[_0xb4da('0x37')](function(_0x6d2414){return _0x6d2414;});}return null;};}function removeEntity(_0x4a2d76,_0x386971){return function(_0xa0efb2){if(_0xa0efb2){return _0xa0efb2['destroy']()['then'](function(){_0x4a2d76[_0xb4da('0x2e')](0xcc)[_0xb4da('0x38')]();});}};}function handleEntityNotFound(_0x4252c8,_0x4b872c){return function(_0x20380c){if(!_0x20380c){_0x4252c8['sendStatus'](0x194);}return _0x20380c;};}function handleError(_0x2ec9f1,_0x4863b){_0x4863b=_0x4863b||0x1f4;return function(_0x150e53){logger[_0xb4da('0x29')](_0x150e53[_0xb4da('0x39')]);if(_0x150e53[_0xb4da('0x3a')]){delete _0x150e53['name'];}_0x2ec9f1[_0xb4da('0x2e')](_0x4863b)[_0xb4da('0x3b')](_0x150e53);};}exports[_0xb4da('0x3c')]=function(_0x5b9b62,_0x5b3b0d){var _0x2d618d={},_0x3c9920={},_0x15f376={'count':0x0,'rows':[]};var _0x2ad279=_['map'](db[_0xb4da('0x3d')]['rawAttributes'],function(_0x22aaf7){return{'name':_0x22aaf7['fieldName'],'type':_0x22aaf7[_0xb4da('0x3e')][_0xb4da('0x3f')]};});_0x3c9920[_0xb4da('0x40')]=_[_0xb4da('0x41')](_0x2ad279,_0xb4da('0x3a'));_0x3c9920[_0xb4da('0x42')]=_[_0xb4da('0x43')](_0x5b9b62[_0xb4da('0x42')]);_0x3c9920[_0xb4da('0x44')]=_[_0xb4da('0x45')](_0x3c9920['model'],_0x3c9920[_0xb4da('0x42')]);_0x2d618d[_0xb4da('0x46')]=_[_0xb4da('0x45')](_0x3c9920[_0xb4da('0x40')],qs[_0xb4da('0x47')](_0x5b9b62[_0xb4da('0x42')][_0xb4da('0x47')]));_0x2d618d['attributes']=_0x2d618d[_0xb4da('0x46')][_0xb4da('0x48')]?_0x2d618d[_0xb4da('0x46')]:_0x3c9920[_0xb4da('0x40')];if(!_0x5b9b62[_0xb4da('0x42')]['hasOwnProperty'](_0xb4da('0x49'))){_0x2d618d[_0xb4da('0x32')]=qs['limit'](_0x5b9b62[_0xb4da('0x42')][_0xb4da('0x32')]);_0x2d618d[_0xb4da('0x30')]=qs[_0xb4da('0x30')](_0x5b9b62[_0xb4da('0x42')][_0xb4da('0x30')]);}_0x2d618d[_0xb4da('0x4a')]=qs['sort'](_0x5b9b62[_0xb4da('0x42')][_0xb4da('0x4b')]);_0x2d618d[_0xb4da('0x4c')]=qs[_0xb4da('0x44')](_['pick'](_0x5b9b62[_0xb4da('0x42')],_0x3c9920[_0xb4da('0x44')]),_0x2ad279);if(_0x5b9b62[_0xb4da('0x42')][_0xb4da('0x4d')]){_0x2d618d[_0xb4da('0x4c')]=_['merge'](_0x2d618d[_0xb4da('0x4c')],{'$or':_['map'](_0x2ad279,function(_0x4c1ca9){if(_0x4c1ca9[_0xb4da('0x3e')]!==_0xb4da('0x4e')){var _0x51158b={};_0x51158b[_0x4c1ca9[_0xb4da('0x3a')]]={'$like':'%'+_0x5b9b62[_0xb4da('0x42')][_0xb4da('0x4d')]+'%'};return _0x51158b;}})});}_0x2d618d=_[_0xb4da('0x4f')]({},_0x2d618d,_0x5b9b62[_0xb4da('0x50')]);var _0x20e785={'where':_0x2d618d['where']};return db['ChatMessage'][_0xb4da('0x33')](_0x20e785)[_0xb4da('0x37')](function(_0x56752d){_0x15f376['count']=_0x56752d;if(_0x5b9b62[_0xb4da('0x42')][_0xb4da('0x51')]){_0x2d618d[_0xb4da('0x52')]=[{'all':!![]}];}return db['ChatMessage']['findAll'](_0x2d618d);})[_0xb4da('0x37')](function(_0x40cda3){_0x15f376[_0xb4da('0x53')]=_0x40cda3;return _0x15f376;})[_0xb4da('0x37')](respondWithFilteredResult(_0x5b3b0d,_0x2d618d))['catch'](handleError(_0x5b3b0d,null));};exports[_0xb4da('0x54')]=function(_0x1bd859,_0x576b26){var _0x388eab={'raw':!![],'where':{'id':_0x1bd859['params']['id']}},_0x3745fd={};_0x3745fd[_0xb4da('0x40')]=_[_0xb4da('0x43')](db[_0xb4da('0x3d')][_0xb4da('0x55')]);_0x3745fd[_0xb4da('0x42')]=_[_0xb4da('0x43')](_0x1bd859[_0xb4da('0x42')]);_0x3745fd[_0xb4da('0x44')]=_[_0xb4da('0x45')](_0x3745fd[_0xb4da('0x40')],_0x3745fd[_0xb4da('0x42')]);_0x388eab[_0xb4da('0x46')]=_['intersection'](_0x3745fd[_0xb4da('0x40')],qs[_0xb4da('0x47')](_0x1bd859[_0xb4da('0x42')]['fields']));_0x388eab[_0xb4da('0x46')]=_0x388eab[_0xb4da('0x46')][_0xb4da('0x48')]?_0x388eab['attributes']:_0x3745fd[_0xb4da('0x40')];if(_0x1bd859[_0xb4da('0x42')][_0xb4da('0x51')]){_0x388eab[_0xb4da('0x52')]=[{'all':!![]}];}_0x388eab=_[_0xb4da('0x4f')]({},_0x388eab,_0x1bd859[_0xb4da('0x50')]);return db[_0xb4da('0x3d')][_0xb4da('0x56')](_0x388eab)['then'](handleEntityNotFound(_0x576b26,null))[_0xb4da('0x37')](respondWithResult(_0x576b26,null))[_0xb4da('0x2d')](handleError(_0x576b26,null));};exports[_0xb4da('0x57')]=function(_0x437da9,_0x5f2ce9){return db[_0xb4da('0x3d')][_0xb4da('0x57')](_0x437da9[_0xb4da('0x58')],{})[_0xb4da('0x37')](respondWithResult(_0x5f2ce9,0xc9))[_0xb4da('0x2d')](handleError(_0x5f2ce9,null));};exports[_0xb4da('0x59')]=function(_0x3ac8de,_0x595e6){if(_0x3ac8de[_0xb4da('0x58')]['id']){delete _0x3ac8de[_0xb4da('0x58')]['id'];}return db['ChatMessage'][_0xb4da('0x56')]({'where':{'id':_0x3ac8de[_0xb4da('0x5a')]['id']}})['then'](handleEntityNotFound(_0x595e6,null))[_0xb4da('0x37')](saveUpdates(_0x3ac8de['body'],null))[_0xb4da('0x37')](respondWithResult(_0x595e6,null))[_0xb4da('0x2d')](handleError(_0x595e6,null));};exports[_0xb4da('0x5b')]=function(_0x273f6d,_0x3e06d9){return db['ChatMessage'][_0xb4da('0x56')]({'where':{'id':_0x273f6d[_0xb4da('0x5a')]['id']}})[_0xb4da('0x37')](handleEntityNotFound(_0x3e06d9,null))[_0xb4da('0x37')](removeEntity(_0x3e06d9,null))['catch'](handleError(_0x3e06d9,null));};exports[_0xb4da('0x5c')]=function(_0x2a3ad2,_0x258ecc){return db[_0xb4da('0x3d')]['describe']()[_0xb4da('0x37')](respondWithResult(_0x258ecc,null))[_0xb4da('0x2d')](handleError(_0x258ecc,null));};var interaction_log=require(_0xb4da('0x17'))('chat-interactions');exports['accept']=function(_0x19ef33,_0xcf7d46,_0x419082){var _0x4777d8={'agent':{},'channel':_0xb4da('0x5d')};if(_0x19ef33[_0xb4da('0x58')]['id']){delete _0x19ef33[_0xb4da('0x58')]['id'];}_0x19ef33[_0xb4da('0x58')][_0xb4da('0x5e')]=!![];_0x19ef33['body'][_0xb4da('0x5f')]=moment()[_0xb4da('0x60')](_0xb4da('0x61'));_0x19ef33['body'][_0xb4da('0x62')]=_0x19ef33['body'][_0xb4da('0x62')]||_0x19ef33[_0xb4da('0x63')]['id'];_0x4777d8[_0xb4da('0x64')]['id']=_0x19ef33[_0xb4da('0x58')][_0xb4da('0x62')];return db[_0xb4da('0x3d')][_0xb4da('0x56')]({'where':{'id':_0x19ef33[_0xb4da('0x5a')]['id'],'UserId':null}})['then'](handleEntityNotFound(_0xcf7d46,null))['then'](saveUpdates(_0x19ef33[_0xb4da('0x58')],null))[_0xb4da('0x37')](function(_0x5d6cd9){if(_0x5d6cd9){_0x4777d8[_0xb4da('0x2b')]=_0x5d6cd9[_0xb4da('0x65')]({'plain':!![]});return db['ChatInteraction'][_0xb4da('0x56')]({'where':{'id':_0x5d6cd9[_0xb4da('0x66')]}});}return null;})['then'](handleEntityNotFound(_0xcf7d46,null))[_0xb4da('0x37')](function(_0x55b188){if(_0x55b188){return _0x55b188[_0xb4da('0x59')]({'UserId':_0x19ef33[_0xb4da('0x58')][_0xb4da('0x62')],'read1stAt':_['isNil'](_0x55b188[_0xb4da('0x67')])?moment()[_0xb4da('0x60')](_0xb4da('0x61')):undefined});}return null;})['then'](function(_0x555a36){if(_0x555a36){_0x4777d8['interaction']=_0x555a36[_0xb4da('0x65')]({'plain':!![]});interaction_log[_0xb4da('0x24')]('[CHATMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s',_0x19ef33[_0xb4da('0x63')]['id'],_0x19ef33['user'][_0xb4da('0x3a')],_0x19ef33['user']['role'],_0x4777d8['interaction']['id'],_0x19ef33['body']?JSON[_0xb4da('0x27')](_0x19ef33['body']):'null');return respondWithRpcPromise(_0xb4da('0x68'),'acceptMessage',_0x4777d8);}return null;})['then'](function(_0x37829f){var _0x59a8ce='SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20'+_0x37829f[_0xb4da('0x2b')][_0xb4da('0x69')];return db['sequelize'][_0xb4da('0x42')](_0x59a8ce,{'type':db['Sequelize']['QueryTypes'][_0xb4da('0x6a')],'raw':!![]})[_0xb4da('0x37')](function(_0x125480){return _0x125480;});})['then'](function(_0x41473a){if(_0x41473a){_0x4777d8['message'][_0xb4da('0x6b')]=_0x41473a[0x0];if(!_0x19ef33['body'][_0xb4da('0x62')])return;return db[_0xb4da('0x6c')][_0xb4da('0x56')]({'where':{'id':_0x19ef33['body'][_0xb4da('0x62')],'role':_0xb4da('0x64')},'attributes':['id',_0xb4da('0x3a'),'fullname',_0xb4da('0x6d'),_0xb4da('0x6e')],'raw':!![]});}return null;})['then'](function(_0x1d02d9){if(!_0x1d02d9)return null;_0x4777d8[_0xb4da('0x2b')][_0xb4da('0x64')]=_0x1d02d9;return _0x4777d8;})[_0xb4da('0x37')](function(_0x5b35cc){if(_0x5b35cc){if(_0x19ef33[_0xb4da('0x58')][_0xb4da('0x6f')]){_0x4777d8[_0xb4da('0x2b')]['interface']=util[_0xb4da('0x60')](_0xb4da('0x70'),_0x19ef33['user'][_0xb4da('0x3a')]);_0x4777d8[_0xb4da('0x2b')]['channel']=_0x4777d8[_0xb4da('0x71')];_0x4777d8['message'][_0xb4da('0x72')]=_0x4777d8['channel'];_0x4777d8[_0xb4da('0x2b')][_0xb4da('0x73')]=_0xb4da('0x74');return respondWithRpcPromise(_0xb4da('0x75'),_0xb4da('0x75'),{'event':_0xb4da('0x76'),'message':_[_0xb4da('0x4f')](_0x4777d8[_0xb4da('0x2b')],JSON['parse'](_0x4777d8[_0xb4da('0x77')]['formData']))},client9002)[_0xb4da('0x37')](function(){return _0x4777d8;});}return _0x4777d8;}return null;})['then'](respondWithResult(_0xcf7d46,null))['catch'](handleError(_0xcf7d46,null));};var interaction_log=require('../../config/logger')(_0xb4da('0x78'));exports[_0xb4da('0x35')]=function(_0x3a0b1f,_0x5c0542,_0x20781a){var _0x4d2054={'agent':{},'channel':_0xb4da('0x5d')};if(_0x3a0b1f[_0xb4da('0x58')]['id']){delete _0x3a0b1f[_0xb4da('0x58')]['id'];}_0x3a0b1f[_0xb4da('0x58')][_0xb4da('0x62')]=_0x3a0b1f[_0xb4da('0x58')][_0xb4da('0x62')]||_0x3a0b1f[_0xb4da('0x63')]['id'];_0x4d2054[_0xb4da('0x64')]['id']=_0x3a0b1f['body'][_0xb4da('0x62')];return db['ChatMessage'][_0xb4da('0x56')]({'where':{'id':_0x3a0b1f[_0xb4da('0x5a')]['id'],'UserId':null}})[_0xb4da('0x37')](handleEntityNotFound(_0x5c0542,null))['then'](function(_0x169bd5){if(_0x169bd5){_0x4d2054[_0xb4da('0x2b')]=_0x169bd5['get']({'plain':!![]});return db[_0xb4da('0x79')]['find']({'where':{'id':_0x169bd5['ChatInteractionId']}});}return null;})[_0xb4da('0x37')](handleEntityNotFound(_0x5c0542,null))[_0xb4da('0x37')](function(_0x26634c){if(_0x26634c){_0x4d2054[_0xb4da('0x77')]=_0x26634c[_0xb4da('0x65')]({'plain':!![]});interaction_log[_0xb4da('0x24')](_0xb4da('0x7a'),_0x3a0b1f[_0xb4da('0x63')]['id'],_0x3a0b1f[_0xb4da('0x63')]['name'],_0x3a0b1f['user'][_0xb4da('0x7b')],_0x4d2054[_0xb4da('0x77')]['id'],_0x3a0b1f[_0xb4da('0x58')]?JSON['stringify'](_0x3a0b1f[_0xb4da('0x58')]):_0xb4da('0x7c'));return respondWithRpcPromise(_0xb4da('0x7d'),_0xb4da('0x7e'),_0x4d2054);}return null;})[_0xb4da('0x37')](function(_0xcf607b){var _0x4454dd=_0xb4da('0x7f')+_0xcf607b['message'][_0xb4da('0x69')];return db[_0xb4da('0x80')][_0xb4da('0x42')](_0x4454dd,{'type':db[_0xb4da('0x81')][_0xb4da('0x82')][_0xb4da('0x6a')],'raw':!![]})[_0xb4da('0x37')](function(_0x5c93cb){return _0x5c93cb;});})[_0xb4da('0x37')](function(_0x412725){if(_0x412725){_0x4d2054[_0xb4da('0x2b')][_0xb4da('0x6b')]=_0x412725[0x0];if(!_0x3a0b1f[_0xb4da('0x58')][_0xb4da('0x62')])return;return db['User'][_0xb4da('0x56')]({'where':{'id':_0x3a0b1f['body'][_0xb4da('0x62')],'role':_0xb4da('0x64')},'attributes':['id','name','fullname',_0xb4da('0x6d'),_0xb4da('0x6e')],'raw':!![]});}return null;})['then'](function(_0x5a283a){if(!_0x5a283a)return null;_0x4d2054['message'][_0xb4da('0x64')]=_0x5a283a;return _0x4d2054;})[_0xb4da('0x37')](function(_0x813b54){if(_0x813b54){_0x813b54['message'][_0xb4da('0x83')]=util['format'](_0xb4da('0x70'),_0x3a0b1f[_0xb4da('0x63')][_0xb4da('0x3a')]);_0x813b54['message'][_0xb4da('0x71')]=_0x4d2054[_0xb4da('0x71')];_0x813b54['message']['motionChannel']=_0x4d2054[_0xb4da('0x71')];_0x813b54[_0xb4da('0x2b')][_0xb4da('0x73')]='reject';respondWithRpcPromise('EventManager',_0xb4da('0x75'),{'event':_0xb4da('0x84'),'message':_[_0xb4da('0x4f')](_0x4d2054[_0xb4da('0x2b')],JSON['parse'](_0x4d2054['interaction'][_0xb4da('0x85')]))},client9002);return _0x4d2054;}return null;})[_0xb4da('0x37')](respondWithResult(_0x5c0542,null))[_0xb4da('0x2d')](handleError(_0x5c0542,null));};
\ No newline at end of file
+var _0xf16c=['../../mysqldb','redis','defaults','localhost','socket.io-emitter','./chatMessage.socket','jayson/promise','client','http','request','then','info','ChatMessage,\x20%s,\x20%s','request\x20sent','debug','ChatMessage,\x20%s,\x20%s,\x20%s','error','code','message','result','sendStatus','status','end','undefined','offset','set','json','apply','reject','save','update','destroy','stack','name','send','index','map','ChatMessage','type','model','query','keys','filters','attributes','intersection','fields','length','hasOwnProperty','limit','order','sort','where','merge','VIRTUAL','filter','options','count','includeAll','include','rows','catch','show','rawAttributes','find','create','body','params','describe','../../config/logger','chat','read','readAt','YYYY-MM-DD\x20HH:mm:ss','UserId','get','ChatInteraction','ChatInteractionId','isNil','format','interaction','[CHATMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','user','role','stringify','null','AcceptMessage','acceptMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','ContactId','Sequelize','QueryTypes','SELECT','User','fullname','email','internal','agent','interface','SIP/%s','channel','motionChannel','accept','EventManager','acceptmessage','parse','formData','[CHATMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','rejectMessage','sequelize','contact','event','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','crypto','jsforce','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/utils','../../config/environment','../../config/license/util'];(function(_0x3b7db6,_0x4690c9){var _0x50b87a=function(_0x3e7294){while(--_0x3e7294){_0x3b7db6['push'](_0x3b7db6['shift']());}};_0x50b87a(++_0x4690c9);}(_0xf16c,0xf3));var _0xcf16=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xf16c[_0x20a584];return _0x4b41a8;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0xcf16('0x0'));var rp=require(_0xcf16('0x1'));var moment=require(_0xcf16('0x2'));var BPromise=require(_0xcf16('0x3'));var Mustache=require(_0xcf16('0x4'));var util=require(_0xcf16('0x5'));var path=require(_0xcf16('0x6'));var sox=require(_0xcf16('0x7'));var csv=require(_0xcf16('0x8'));var ejs=require(_0xcf16('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require('squel');var crypto=require(_0xcf16('0xa'));var jsforce=require(_0xcf16('0xb'));var deskjs=require('desk.js');var toCsv=require(_0xcf16('0x8'));var querystring=require('querystring');var Papa=require(_0xcf16('0xc'));var Redis=require(_0xcf16('0xd'));var authService=require(_0xcf16('0xe'));var qs=require(_0xcf16('0xf'));var as=require(_0xcf16('0x10'));var hardwareService=require(_0xcf16('0x11'));var logger=require('../../config/logger')('api');var utils=require(_0xcf16('0x12'));var config=require(_0xcf16('0x13'));var licenseUtil=require(_0xcf16('0x14'));var db=require(_0xcf16('0x15'))['db'];config[_0xcf16('0x16')]=_[_0xcf16('0x17')](config[_0xcf16('0x16')],{'host':_0xcf16('0x18'),'port':0x18eb});var socket=require(_0xcf16('0x19'))(new Redis(config[_0xcf16('0x16')]));require(_0xcf16('0x1a'))['register'](socket);var jayson=require(_0xcf16('0x1b'));var client=jayson[_0xcf16('0x1c')]['http']({'port':0x232c});var client9002=jayson['client'][_0xcf16('0x1d')]({'port':0x232a});function respondWithRpcPromise(_0x2c1416,_0x4b8655,_0x508182,_0x3ed4c5){return new BPromise(function(_0x24084c,_0x3cd3e4){var _0x398b70=_0x3ed4c5||client;return _0x398b70[_0xcf16('0x1e')](_0x2c1416,_0x508182)[_0xcf16('0x1f')](function(_0x494d62){logger[_0xcf16('0x20')](_0xcf16('0x21'),_0x4b8655,_0xcf16('0x22'));logger[_0xcf16('0x23')](_0xcf16('0x24'),_0x4b8655,_0xcf16('0x22'),JSON['stringify'](_0x494d62));if(_0x494d62[_0xcf16('0x25')]){if(_0x494d62[_0xcf16('0x25')][_0xcf16('0x26')]===0x1f4){logger[_0xcf16('0x25')](_0xcf16('0x21'),_0x4b8655,_0x494d62['error'][_0xcf16('0x27')]);return _0x3cd3e4(_0x494d62[_0xcf16('0x25')][_0xcf16('0x27')]);}logger[_0xcf16('0x25')](_0xcf16('0x21'),_0x4b8655,_0x494d62[_0xcf16('0x25')][_0xcf16('0x27')]);return _0x24084c(_0x494d62[_0xcf16('0x25')][_0xcf16('0x27')]);}else{logger[_0xcf16('0x20')](_0xcf16('0x21'),_0x4b8655,_0xcf16('0x22'));_0x24084c(_0x494d62[_0xcf16('0x28')][_0xcf16('0x27')]);}})['catch'](function(_0x160fba){logger['error']('ChatMessage,\x20%s,\x20%s',_0x4b8655,_0x160fba);_0x3cd3e4(_0x160fba);});});}function respondWithStatusCode(_0x3d32fc,_0x33db32){_0x33db32=_0x33db32||0xcc;return function(_0x5c498f){if(_0x5c498f){return _0x3d32fc[_0xcf16('0x29')](_0x33db32);}return _0x3d32fc[_0xcf16('0x2a')](_0x33db32)[_0xcf16('0x2b')]();};}function respondWithResult(_0x2dad69,_0x4d44c3){_0x4d44c3=_0x4d44c3||0xc8;return function(_0x8978a8){if(_0x8978a8){return _0x2dad69[_0xcf16('0x2a')](_0x4d44c3)['json'](_0x8978a8);}};}function respondWithFilteredResult(_0x396841,_0x55dff0){return function(_0x38e9f0){if(_0x38e9f0){var _0x20cf4c=typeof _0x55dff0['offset']==='undefined'&&typeof _0x55dff0['limit']===_0xcf16('0x2c');var _0x5475d0=_0x38e9f0['count'];var _0x398b07=_0x20cf4c?0x0:_0x55dff0[_0xcf16('0x2d')];var _0x5a4874=_0x20cf4c?_0x38e9f0['count']:_0x55dff0[_0xcf16('0x2d')]+_0x55dff0['limit'];var _0x4d5565;if(_0x5a4874>=_0x5475d0){_0x5a4874=_0x5475d0;_0x4d5565=0xc8;}else{_0x4d5565=0xce;}_0x396841[_0xcf16('0x2a')](_0x4d5565);return _0x396841[_0xcf16('0x2e')]('Content-Range',_0x398b07+'-'+_0x5a4874+'/'+_0x5475d0)[_0xcf16('0x2f')](_0x38e9f0);}return null;};}function patchUpdates(_0x23a042){return function(_0x1daf44){try{jsonpatch[_0xcf16('0x30')](_0x1daf44,_0x23a042,!![]);}catch(_0x4e670f){return BPromise[_0xcf16('0x31')](_0x4e670f);}return _0x1daf44[_0xcf16('0x32')]();};}function saveUpdates(_0x3bbb74,_0x556a01){return function(_0x747766){if(_0x747766){return _0x747766[_0xcf16('0x33')](_0x3bbb74)[_0xcf16('0x1f')](function(_0x17f912){return _0x17f912;});}return null;};}function removeEntity(_0x4cf555,_0x28a87f){return function(_0x409933){if(_0x409933){return _0x409933[_0xcf16('0x34')]()[_0xcf16('0x1f')](function(){_0x4cf555[_0xcf16('0x2a')](0xcc)[_0xcf16('0x2b')]();});}};}function handleEntityNotFound(_0x21e391,_0x396bbd){return function(_0x231ffc){if(!_0x231ffc){_0x21e391[_0xcf16('0x29')](0x194);}return _0x231ffc;};}function handleError(_0x12422f,_0x191da2){_0x191da2=_0x191da2||0x1f4;return function(_0x48c549){logger[_0xcf16('0x25')](_0x48c549[_0xcf16('0x35')]);if(_0x48c549['name']){delete _0x48c549[_0xcf16('0x36')];}_0x12422f[_0xcf16('0x2a')](_0x191da2)[_0xcf16('0x37')](_0x48c549);};}exports[_0xcf16('0x38')]=function(_0x2ee512,_0x1b1efd){var _0x258799={},_0x4cdbc7={},_0x1bad40={'count':0x0,'rows':[]};var _0x2253fd=_[_0xcf16('0x39')](db[_0xcf16('0x3a')]['rawAttributes'],function(_0x2ab950){return{'name':_0x2ab950['fieldName'],'type':_0x2ab950[_0xcf16('0x3b')]['key']};});_0x4cdbc7[_0xcf16('0x3c')]=_[_0xcf16('0x39')](_0x2253fd,'name');_0x4cdbc7[_0xcf16('0x3d')]=_[_0xcf16('0x3e')](_0x2ee512[_0xcf16('0x3d')]);_0x4cdbc7[_0xcf16('0x3f')]=_['intersection'](_0x4cdbc7[_0xcf16('0x3c')],_0x4cdbc7['query']);_0x258799[_0xcf16('0x40')]=_[_0xcf16('0x41')](_0x4cdbc7[_0xcf16('0x3c')],qs[_0xcf16('0x42')](_0x2ee512[_0xcf16('0x3d')][_0xcf16('0x42')]));_0x258799['attributes']=_0x258799[_0xcf16('0x40')][_0xcf16('0x43')]?_0x258799[_0xcf16('0x40')]:_0x4cdbc7[_0xcf16('0x3c')];if(!_0x2ee512[_0xcf16('0x3d')][_0xcf16('0x44')]('nolimit')){_0x258799[_0xcf16('0x45')]=qs[_0xcf16('0x45')](_0x2ee512[_0xcf16('0x3d')]['limit']);_0x258799[_0xcf16('0x2d')]=qs[_0xcf16('0x2d')](_0x2ee512['query'][_0xcf16('0x2d')]);}_0x258799[_0xcf16('0x46')]=qs[_0xcf16('0x47')](_0x2ee512[_0xcf16('0x3d')][_0xcf16('0x47')]);_0x258799[_0xcf16('0x48')]=qs[_0xcf16('0x3f')](_['pick'](_0x2ee512[_0xcf16('0x3d')],_0x4cdbc7[_0xcf16('0x3f')]),_0x2253fd);if(_0x2ee512[_0xcf16('0x3d')]['filter']){_0x258799[_0xcf16('0x48')]=_[_0xcf16('0x49')](_0x258799['where'],{'$or':_[_0xcf16('0x39')](_0x2253fd,function(_0x72b091){if(_0x72b091[_0xcf16('0x3b')]!==_0xcf16('0x4a')){var _0x5439c4={};_0x5439c4[_0x72b091[_0xcf16('0x36')]]={'$like':'%'+_0x2ee512[_0xcf16('0x3d')][_0xcf16('0x4b')]+'%'};return _0x5439c4;}})});}_0x258799=_[_0xcf16('0x49')]({},_0x258799,_0x2ee512[_0xcf16('0x4c')]);var _0x388099={'where':_0x258799[_0xcf16('0x48')]};return db[_0xcf16('0x3a')][_0xcf16('0x4d')](_0x388099)[_0xcf16('0x1f')](function(_0x5bec8d){_0x1bad40[_0xcf16('0x4d')]=_0x5bec8d;if(_0x2ee512[_0xcf16('0x3d')][_0xcf16('0x4e')]){_0x258799[_0xcf16('0x4f')]=[{'all':!![]}];}return db['ChatMessage']['findAll'](_0x258799);})[_0xcf16('0x1f')](function(_0x1994a3){_0x1bad40[_0xcf16('0x50')]=_0x1994a3;return _0x1bad40;})['then'](respondWithFilteredResult(_0x1b1efd,_0x258799))[_0xcf16('0x51')](handleError(_0x1b1efd,null));};exports[_0xcf16('0x52')]=function(_0x2f389c,_0x40aaee){var _0x1d7369={'raw':!![],'where':{'id':_0x2f389c['params']['id']}},_0x544fb1={};_0x544fb1['model']=_[_0xcf16('0x3e')](db[_0xcf16('0x3a')][_0xcf16('0x53')]);_0x544fb1['query']=_[_0xcf16('0x3e')](_0x2f389c[_0xcf16('0x3d')]);_0x544fb1['filters']=_['intersection'](_0x544fb1[_0xcf16('0x3c')],_0x544fb1[_0xcf16('0x3d')]);_0x1d7369[_0xcf16('0x40')]=_[_0xcf16('0x41')](_0x544fb1['model'],qs[_0xcf16('0x42')](_0x2f389c[_0xcf16('0x3d')][_0xcf16('0x42')]));_0x1d7369[_0xcf16('0x40')]=_0x1d7369[_0xcf16('0x40')][_0xcf16('0x43')]?_0x1d7369['attributes']:_0x544fb1[_0xcf16('0x3c')];if(_0x2f389c['query']['includeAll']){_0x1d7369['include']=[{'all':!![]}];}_0x1d7369=_[_0xcf16('0x49')]({},_0x1d7369,_0x2f389c[_0xcf16('0x4c')]);return db[_0xcf16('0x3a')][_0xcf16('0x54')](_0x1d7369)[_0xcf16('0x1f')](handleEntityNotFound(_0x40aaee,null))['then'](respondWithResult(_0x40aaee,null))['catch'](handleError(_0x40aaee,null));};exports[_0xcf16('0x55')]=function(_0xb5410e,_0x58212b){return db[_0xcf16('0x3a')]['create'](_0xb5410e[_0xcf16('0x56')],{})[_0xcf16('0x1f')](respondWithResult(_0x58212b,0xc9))['catch'](handleError(_0x58212b,null));};exports['update']=function(_0x139bbb,_0x73b19e){if(_0x139bbb[_0xcf16('0x56')]['id']){delete _0x139bbb[_0xcf16('0x56')]['id'];}return db[_0xcf16('0x3a')][_0xcf16('0x54')]({'where':{'id':_0x139bbb['params']['id']}})[_0xcf16('0x1f')](handleEntityNotFound(_0x73b19e,null))[_0xcf16('0x1f')](saveUpdates(_0x139bbb[_0xcf16('0x56')],null))[_0xcf16('0x1f')](respondWithResult(_0x73b19e,null))[_0xcf16('0x51')](handleError(_0x73b19e,null));};exports[_0xcf16('0x34')]=function(_0x2a6e07,_0x11fbd4){return db[_0xcf16('0x3a')][_0xcf16('0x54')]({'where':{'id':_0x2a6e07[_0xcf16('0x57')]['id']}})['then'](handleEntityNotFound(_0x11fbd4,null))[_0xcf16('0x1f')](removeEntity(_0x11fbd4,null))['catch'](handleError(_0x11fbd4,null));};exports[_0xcf16('0x58')]=function(_0x1cda21,_0x1b2c05){return db['ChatMessage'][_0xcf16('0x58')]()[_0xcf16('0x1f')](respondWithResult(_0x1b2c05,null))[_0xcf16('0x51')](handleError(_0x1b2c05,null));};var interaction_log=require(_0xcf16('0x59'))('chat-interactions');exports['accept']=function(_0x5b49c8,_0x48b17d,_0x24f662){var _0x1bdd79={'agent':{},'channel':_0xcf16('0x5a')};if(_0x5b49c8[_0xcf16('0x56')]['id']){delete _0x5b49c8[_0xcf16('0x56')]['id'];}_0x5b49c8['body'][_0xcf16('0x5b')]=!![];_0x5b49c8[_0xcf16('0x56')][_0xcf16('0x5c')]=moment()['format'](_0xcf16('0x5d'));_0x5b49c8['body']['UserId']=_0x5b49c8[_0xcf16('0x56')]['UserId']||_0x5b49c8['user']['id'];_0x1bdd79['agent']['id']=_0x5b49c8[_0xcf16('0x56')][_0xcf16('0x5e')];return db[_0xcf16('0x3a')][_0xcf16('0x54')]({'where':{'id':_0x5b49c8[_0xcf16('0x57')]['id'],'UserId':null}})[_0xcf16('0x1f')](handleEntityNotFound(_0x48b17d,null))['then'](saveUpdates(_0x5b49c8[_0xcf16('0x56')],null))[_0xcf16('0x1f')](function(_0x17b3f0){if(_0x17b3f0){_0x1bdd79[_0xcf16('0x27')]=_0x17b3f0[_0xcf16('0x5f')]({'plain':!![]});return db[_0xcf16('0x60')][_0xcf16('0x54')]({'where':{'id':_0x17b3f0[_0xcf16('0x61')]}});}return null;})[_0xcf16('0x1f')](handleEntityNotFound(_0x48b17d,null))['then'](function(_0x2e121c){if(_0x2e121c){return _0x2e121c[_0xcf16('0x33')]({'UserId':_0x5b49c8[_0xcf16('0x56')][_0xcf16('0x5e')],'read1stAt':_[_0xcf16('0x62')](_0x2e121c['read1stAt'])?moment()[_0xcf16('0x63')](_0xcf16('0x5d')):undefined});}return null;})['then'](function(_0x471189){if(_0x471189){_0x1bdd79[_0xcf16('0x64')]=_0x471189[_0xcf16('0x5f')]({'plain':!![]});interaction_log[_0xcf16('0x20')](_0xcf16('0x65'),_0x5b49c8[_0xcf16('0x66')]['id'],_0x5b49c8['user']['name'],_0x5b49c8['user'][_0xcf16('0x67')],_0x1bdd79[_0xcf16('0x64')]['id'],_0x5b49c8[_0xcf16('0x56')]?JSON[_0xcf16('0x68')](_0x5b49c8[_0xcf16('0x56')]):_0xcf16('0x69'));return respondWithRpcPromise(_0xcf16('0x6a'),_0xcf16('0x6b'),_0x1bdd79);}return null;})['then'](function(_0x348059){var _0x13c944=_0xcf16('0x6c')+_0x348059[_0xcf16('0x27')][_0xcf16('0x6d')];return db['sequelize'][_0xcf16('0x3d')](_0x13c944,{'type':db[_0xcf16('0x6e')][_0xcf16('0x6f')][_0xcf16('0x70')],'raw':!![]})['then'](function(_0x38da8a){return _0x38da8a;});})[_0xcf16('0x1f')](function(_0x445245){if(_0x445245){_0x1bdd79[_0xcf16('0x27')]['contact']=_0x445245[0x0];if(!_0x5b49c8[_0xcf16('0x56')][_0xcf16('0x5e')])return;return db[_0xcf16('0x71')][_0xcf16('0x54')]({'where':{'id':_0x5b49c8[_0xcf16('0x56')][_0xcf16('0x5e')],'role':'agent'},'attributes':['id',_0xcf16('0x36'),_0xcf16('0x72'),_0xcf16('0x73'),_0xcf16('0x74')],'raw':!![]});}return null;})['then'](function(_0x3ba9e9){if(!_0x3ba9e9)return null;_0x1bdd79['message'][_0xcf16('0x75')]=_0x3ba9e9;return _0x1bdd79;})[_0xcf16('0x1f')](function(_0x342189){if(_0x342189){if(_0x5b49c8[_0xcf16('0x56')]['manual']){_0x1bdd79[_0xcf16('0x27')][_0xcf16('0x76')]=util['format'](_0xcf16('0x77'),_0x5b49c8['user']['name']);_0x1bdd79[_0xcf16('0x27')][_0xcf16('0x78')]=_0x1bdd79[_0xcf16('0x78')];_0x1bdd79['message'][_0xcf16('0x79')]=_0x1bdd79[_0xcf16('0x78')];_0x1bdd79[_0xcf16('0x27')]['event']=_0xcf16('0x7a');return respondWithRpcPromise('EventManager',_0xcf16('0x7b'),{'event':_0xcf16('0x7c'),'message':_[_0xcf16('0x49')](_0x1bdd79[_0xcf16('0x27')],JSON[_0xcf16('0x7d')](_0x1bdd79['interaction'][_0xcf16('0x7e')]))},client9002)[_0xcf16('0x1f')](function(){return _0x1bdd79;});}return _0x1bdd79;}return null;})['then'](respondWithResult(_0x48b17d,null))[_0xcf16('0x51')](handleError(_0x48b17d,null));};var interaction_log=require(_0xcf16('0x59'))('chat-interactions');exports[_0xcf16('0x31')]=function(_0x5c9df3,_0x19db1c,_0x2f8011){var _0xebdf55={'agent':{},'channel':'chat'};if(_0x5c9df3[_0xcf16('0x56')]['id']){delete _0x5c9df3[_0xcf16('0x56')]['id'];}_0x5c9df3['body'][_0xcf16('0x5e')]=_0x5c9df3['body'][_0xcf16('0x5e')]||_0x5c9df3[_0xcf16('0x66')]['id'];_0xebdf55[_0xcf16('0x75')]['id']=_0x5c9df3[_0xcf16('0x56')][_0xcf16('0x5e')];return db[_0xcf16('0x3a')][_0xcf16('0x54')]({'where':{'id':_0x5c9df3['params']['id'],'UserId':null}})['then'](handleEntityNotFound(_0x19db1c,null))[_0xcf16('0x1f')](function(_0x51c1e8){if(_0x51c1e8){_0xebdf55[_0xcf16('0x27')]=_0x51c1e8[_0xcf16('0x5f')]({'plain':!![]});return db[_0xcf16('0x60')][_0xcf16('0x54')]({'where':{'id':_0x51c1e8['ChatInteractionId']}});}return null;})[_0xcf16('0x1f')](handleEntityNotFound(_0x19db1c,null))['then'](function(_0x17619d){if(_0x17619d){_0xebdf55['interaction']=_0x17619d[_0xcf16('0x5f')]({'plain':!![]});interaction_log[_0xcf16('0x20')](_0xcf16('0x7f'),_0x5c9df3[_0xcf16('0x66')]['id'],_0x5c9df3[_0xcf16('0x66')][_0xcf16('0x36')],_0x5c9df3['user'][_0xcf16('0x67')],_0xebdf55[_0xcf16('0x64')]['id'],_0x5c9df3[_0xcf16('0x56')]?JSON[_0xcf16('0x68')](_0x5c9df3[_0xcf16('0x56')]):'null');return respondWithRpcPromise('RejectMessage',_0xcf16('0x80'),_0xebdf55);}return null;})[_0xcf16('0x1f')](function(_0x5a6074){var _0x80141d=_0xcf16('0x6c')+_0x5a6074[_0xcf16('0x27')][_0xcf16('0x6d')];return db[_0xcf16('0x81')]['query'](_0x80141d,{'type':db['Sequelize'][_0xcf16('0x6f')][_0xcf16('0x70')],'raw':!![]})[_0xcf16('0x1f')](function(_0x27a4e3){return _0x27a4e3;});})[_0xcf16('0x1f')](function(_0x41e10e){if(_0x41e10e){_0xebdf55['message'][_0xcf16('0x82')]=_0x41e10e[0x0];if(!_0x5c9df3[_0xcf16('0x56')]['UserId'])return;return db[_0xcf16('0x71')][_0xcf16('0x54')]({'where':{'id':_0x5c9df3['body'][_0xcf16('0x5e')],'role':'agent'},'attributes':['id',_0xcf16('0x36'),'fullname',_0xcf16('0x73'),_0xcf16('0x74')],'raw':!![]});}return null;})[_0xcf16('0x1f')](function(_0x2ef6ed){if(!_0x2ef6ed)return null;_0xebdf55[_0xcf16('0x27')][_0xcf16('0x75')]=_0x2ef6ed;return _0xebdf55;})[_0xcf16('0x1f')](function(_0x1810eb){if(_0x1810eb){_0x1810eb['message']['interface']=util[_0xcf16('0x63')](_0xcf16('0x77'),_0x5c9df3[_0xcf16('0x66')][_0xcf16('0x36')]);_0x1810eb['message'][_0xcf16('0x78')]=_0xebdf55[_0xcf16('0x78')];_0x1810eb[_0xcf16('0x27')][_0xcf16('0x79')]=_0xebdf55[_0xcf16('0x78')];_0x1810eb[_0xcf16('0x27')][_0xcf16('0x83')]=_0xcf16('0x31');respondWithRpcPromise(_0xcf16('0x7b'),_0xcf16('0x7b'),{'event':'rejectmessage','message':_[_0xcf16('0x49')](_0xebdf55[_0xcf16('0x27')],JSON[_0xcf16('0x7d')](_0xebdf55[_0xcf16('0x64')]['formData']))},client9002);return _0xebdf55;}return null;})[_0xcf16('0x1f')](respondWithResult(_0x19db1c,null))[_0xcf16('0x51')](handleError(_0x19db1c,null));};
\ No newline at end of file
diff --git a/server/api/chatMessage/chatMessage.events.js b/server/api/chatMessage/chatMessage.events.js
index c0c81eb..ff0a1f8 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 _0x0e9a=['hasOwnProperty','hook','exports','events','../../mysqldb','ChatMessage','update','remove','emit'];(function(_0x2b8764,_0x3f6442){var _0x5010ee=function(_0x2cf0fe){while(--_0x2cf0fe){_0x2b8764['push'](_0x2b8764['shift']());}};_0x5010ee(++_0x3f6442);}(_0x0e9a,0x1c5));var _0xa0e9=function(_0x5d63aa,_0x3278fe){_0x5d63aa=_0x5d63aa-0x0;var _0x5b463f=_0x0e9a[_0x5d63aa];return _0x5b463f;};'use strict';var EventEmitter=require(_0xa0e9('0x0'));var ChatMessage=require(_0xa0e9('0x1'))['db'][_0xa0e9('0x2')];var ChatMessageEvents=new EventEmitter();ChatMessageEvents['setMaxListeners'](0x0);var events={'afterCreate':'save','afterUpdate':_0xa0e9('0x3'),'afterDestroy':_0xa0e9('0x4')};function emitEvent(_0x4e837b){return function(_0x2b8a11,_0x4b1c3d,_0x392f6c){ChatMessageEvents[_0xa0e9('0x5')](_0x4e837b+':'+_0x2b8a11['id'],_0x2b8a11);ChatMessageEvents['emit'](_0x4e837b,_0x2b8a11);_0x392f6c(null);};}for(var e in events){if(events[_0xa0e9('0x6')](e)){var event=events[e];ChatMessage[_0xa0e9('0x7')](e,emitEvent(event));}}module[_0xa0e9('0x8')]=ChatMessageEvents;
\ No newline at end of file
+var _0x2248=['update','remove','emit','hasOwnProperty','hook','../../mysqldb','ChatMessage','setMaxListeners','save'];(function(_0x15c530,_0x489b22){var _0x3bd24f=function(_0x164499){while(--_0x164499){_0x15c530['push'](_0x15c530['shift']());}};_0x3bd24f(++_0x489b22);}(_0x2248,0x1ac));var _0x8224=function(_0x1c5048,_0xd65dbb){_0x1c5048=_0x1c5048-0x0;var _0x5a77f2=_0x2248[_0x1c5048];return _0x5a77f2;};'use strict';var EventEmitter=require('events');var ChatMessage=require(_0x8224('0x0'))['db'][_0x8224('0x1')];var ChatMessageEvents=new EventEmitter();ChatMessageEvents[_0x8224('0x2')](0x0);var events={'afterCreate':_0x8224('0x3'),'afterUpdate':_0x8224('0x4'),'afterDestroy':_0x8224('0x5')};function emitEvent(_0x2c0fb9){return function(_0x4fa6d4,_0x36d79f,_0x59488a){ChatMessageEvents[_0x8224('0x6')](_0x2c0fb9+':'+_0x4fa6d4['id'],_0x4fa6d4);ChatMessageEvents['emit'](_0x2c0fb9,_0x4fa6d4);_0x59488a(null);};}for(var e in events){if(events[_0x8224('0x7')](e)){var event=events[e];ChatMessage[_0x8224('0x8')](e,emitEvent(event));}}module['exports']=ChatMessageEvents;
\ No newline at end of file
diff --git a/server/api/chatMessage/chatMessage.model.js b/server/api/chatMessage/chatMessage.model.js
index 008726f..8b7145c 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 _0xf5c0=['chat_messages','fti_chat_messages','FULLTEXT','models','get','direction','toLowerCase','out','secret','isNil','UserId','findOne','ChatInteractionId','then','update','createdAt','catch','error','utf8mb4','utf8mb4_unicode_ci','util','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./chatMessage.attributes','exports','ChatMessage'];(function(_0x31799d,_0x440446){var _0x4ea463=function(_0x39ab3e){while(--_0x39ab3e){_0x31799d['push'](_0x31799d['shift']());}};_0x4ea463(++_0x440446);}(_0xf5c0,0x71));var _0x0f5c=function(_0x17a057,_0x51ef19){_0x17a057=_0x17a057-0x0;var _0x5b34d2=_0xf5c0[_0x17a057];return _0x5b34d2;};'use strict';var _=require('lodash');var util=require(_0x0f5c('0x0'));var logger=require('../../config/logger')(_0x0f5c('0x1'));var moment=require(_0x0f5c('0x2'));var BPromise=require(_0x0f5c('0x3'));var rp=require(_0x0f5c('0x4'));var fs=require('fs');var path=require(_0x0f5c('0x5'));var rimraf=require(_0x0f5c('0x6'));var config=require(_0x0f5c('0x7'));var attributes=require(_0x0f5c('0x8'));module[_0x0f5c('0x9')]=function(_0x1c69da,_0x2752d2){return _0x1c69da['define'](_0x0f5c('0xa'),attributes,{'tableName':_0x0f5c('0xb'),'paranoid':![],'indexes':[{'name':_0x0f5c('0xc'),'fields':['body'],'type':_0x0f5c('0xd')}],'timestamps':!![],'hooks':{'afterCreate':function(_0x3e3edc,_0x569568,_0x385542){var _0x2beb54=_0x1c69da[_0x0f5c('0xe')];var _0x36480d=_0x3e3edc[_0x0f5c('0xf')]({'plain':!![]});if(_0x36480d[_0x0f5c('0x10')][_0x0f5c('0x11')]()==='in'||_0x36480d[_0x0f5c('0x10')][_0x0f5c('0x11')]()===_0x0f5c('0x12')&&!_0x36480d[_0x0f5c('0x13')]&&!_[_0x0f5c('0x14')](_0x36480d[_0x0f5c('0x15')])){_0x2beb54['ChatInteraction'][_0x0f5c('0x16')]({'where':{'id':_0x36480d[_0x0f5c('0x17')]}})[_0x0f5c('0x18')](function(_0x2602c1){if(_0x2602c1){_0x2602c1[_0x0f5c('0x19')]({'lastMsgAt':_0x36480d[_0x0f5c('0x1a')],'lastMsgDirection':_0x36480d[_0x0f5c('0x10')]['toLowerCase']()});}})[_0x0f5c('0x1b')](function(_0x7a90cd){console[_0x0f5c('0x1c')](_0x7a90cd);});}_0x385542();}},'charset':_0x0f5c('0x1d'),'collate':_0x0f5c('0x1e')});};
\ No newline at end of file
+var _0xd8f6=['FULLTEXT','models','get','direction','toLowerCase','out','secret','UserId','ChatInteraction','findOne','ChatInteractionId','then','update','createdAt','catch','error','util','../../config/logger','api','moment','request-promise','path','rimraf','./chatMessage.attributes','exports','ChatMessage','fti_chat_messages','body'];(function(_0x57d71f,_0x598a0e){var _0x2d1d26=function(_0x18f209){while(--_0x18f209){_0x57d71f['push'](_0x57d71f['shift']());}};_0x2d1d26(++_0x598a0e);}(_0xd8f6,0xf0));var _0x6d8f=function(_0x3d06cb,_0x1491e8){_0x3d06cb=_0x3d06cb-0x0;var _0x26fcbb=_0xd8f6[_0x3d06cb];return _0x26fcbb;};'use strict';var _=require('lodash');var util=require(_0x6d8f('0x0'));var logger=require(_0x6d8f('0x1'))(_0x6d8f('0x2'));var moment=require(_0x6d8f('0x3'));var BPromise=require('bluebird');var rp=require(_0x6d8f('0x4'));var fs=require('fs');var path=require(_0x6d8f('0x5'));var rimraf=require(_0x6d8f('0x6'));var config=require('../../config/environment');var attributes=require(_0x6d8f('0x7'));module[_0x6d8f('0x8')]=function(_0x226398,_0xb94769){return _0x226398['define'](_0x6d8f('0x9'),attributes,{'tableName':'chat_messages','paranoid':![],'indexes':[{'name':_0x6d8f('0xa'),'fields':[_0x6d8f('0xb')],'type':_0x6d8f('0xc')}],'timestamps':!![],'hooks':{'afterCreate':function(_0x46de14,_0x331e84,_0x1253cc){var _0x5823d8=_0x226398[_0x6d8f('0xd')];var _0x4a4a87=_0x46de14[_0x6d8f('0xe')]({'plain':!![]});if(_0x4a4a87[_0x6d8f('0xf')][_0x6d8f('0x10')]()==='in'||_0x4a4a87['direction']['toLowerCase']()===_0x6d8f('0x11')&&!_0x4a4a87[_0x6d8f('0x12')]&&!_['isNil'](_0x4a4a87[_0x6d8f('0x13')])){_0x5823d8[_0x6d8f('0x14')][_0x6d8f('0x15')]({'where':{'id':_0x4a4a87[_0x6d8f('0x16')]}})[_0x6d8f('0x17')](function(_0xa5a49b){if(_0xa5a49b){_0xa5a49b[_0x6d8f('0x18')]({'lastMsgAt':_0x4a4a87[_0x6d8f('0x19')],'lastMsgDirection':_0x4a4a87['direction'][_0x6d8f('0x10')]()});}})[_0x6d8f('0x1a')](function(_0x2bb325){console[_0x6d8f('0x1b')](_0x2bb325);});}_0x1253cc();}},'charset':'utf8mb4','collate':'utf8mb4_unicode_ci'});};
\ No newline at end of file
diff --git a/server/api/chatMessage/chatMessage.rpc.js b/server/api/chatMessage/chatMessage.rpc.js
index 5f12509..3cdac32 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 _0xf82c=['message','info','result','catch','CreateChatMessage','create','body','options','raw','util','moment','randomstring','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','http','redis','defaults','localhost','socket.io-emitter','./chatMessage.socket','register','request','then','ChatMessage,\x20%s,\x20%s','request\x20sent','ChatMessage,\x20%s,\x20%s,\x20%s','error','code'];(function(_0x43bf86,_0x1f4f3e){var _0x223364=function(_0x210204){while(--_0x210204){_0x43bf86['push'](_0x43bf86['shift']());}};_0x223364(++_0x1f4f3e);}(_0xf82c,0x19c));var _0xcf82=function(_0x4e6bfd,_0x38102c){_0x4e6bfd=_0x4e6bfd-0x0;var _0x356bea=_0xf82c[_0x4e6bfd];return _0x356bea;};'use strict';var _=require('lodash');var util=require(_0xcf82('0x0'));var moment=require(_0xcf82('0x1'));var BPromise=require('bluebird');var rs=require(_0xcf82('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xcf82('0x3'))['db'];var utils=require('../../config/utils');var logger=require(_0xcf82('0x4'))(_0xcf82('0x5'));var config=require(_0xcf82('0x6'));var jayson=require(_0xcf82('0x7'));var client=jayson['client'][_0xcf82('0x8')]({'port':0x232a});config[_0xcf82('0x9')]=_[_0xcf82('0xa')](config[_0xcf82('0x9')],{'host':_0xcf82('0xb'),'port':0x18eb});var socket=require(_0xcf82('0xc'))(new Redis(config[_0xcf82('0x9')]));require(_0xcf82('0xd'))[_0xcf82('0xe')](socket);function respondWithRpcPromise(_0x5e29b4,_0x4fb437,_0x42b68f){return new BPromise(function(_0x85b5e,_0x3c129e){return client[_0xcf82('0xf')](_0x5e29b4,_0x42b68f)[_0xcf82('0x10')](function(_0x547ea7){logger['info'](_0xcf82('0x11'),_0x4fb437,_0xcf82('0x12'));logger['debug'](_0xcf82('0x13'),_0x4fb437,_0xcf82('0x12'),JSON['stringify'](_0x547ea7));if(_0x547ea7['error']){if(_0x547ea7[_0xcf82('0x14')][_0xcf82('0x15')]===0x1f4){logger[_0xcf82('0x14')]('ChatMessage,\x20%s,\x20%s',_0x4fb437,_0x547ea7['error'][_0xcf82('0x16')]);return _0x3c129e(_0x547ea7[_0xcf82('0x14')][_0xcf82('0x16')]);}logger['error'](_0xcf82('0x11'),_0x4fb437,_0x547ea7[_0xcf82('0x14')][_0xcf82('0x16')]);return _0x85b5e(_0x547ea7[_0xcf82('0x14')][_0xcf82('0x16')]);}else{logger[_0xcf82('0x17')]('ChatMessage,\x20%s,\x20%s',_0x4fb437,_0xcf82('0x12'));_0x85b5e(_0x547ea7[_0xcf82('0x18')][_0xcf82('0x16')]);}})[_0xcf82('0x19')](function(_0x37e4a6){logger[_0xcf82('0x14')](_0xcf82('0x11'),_0x4fb437,_0x37e4a6);_0x3c129e(_0x37e4a6);});});}exports[_0xcf82('0x1a')]=function(_0x5a4288){var _0x1fd496=this;return new Promise(function(_0x3d9c37,_0x5c54c9){return db['ChatMessage'][_0xcf82('0x1b')](_0x5a4288[_0xcf82('0x1c')],{'raw':_0x5a4288[_0xcf82('0x1d')]?_0x5a4288[_0xcf82('0x1d')][_0xcf82('0x1e')]===undefined?!![]:![]:!![]})[_0xcf82('0x10')](function(_0x2adb88){logger[_0xcf82('0x17')]('CreateChatMessage',_0x5a4288);logger['debug'](_0xcf82('0x1a'),_0x5a4288,JSON['stringify'](_0x2adb88));_0x3d9c37(_0x2adb88);})[_0xcf82('0x19')](function(_0x57f201){logger[_0xcf82('0x14')](_0xcf82('0x1a'),_0x57f201[_0xcf82('0x16')],_0x5a4288);_0x5c54c9(_0x1fd496[_0xcf82('0x14')](0x1f4,_0x57f201[_0xcf82('0x16')]));});});};
\ No newline at end of file
+var _0x89ca=['../../mysqldb','../../config/utils','../../config/logger','jayson/promise','client','http','defaults','redis','localhost','socket.io-emitter','./chatMessage.socket','register','request','then','info','ChatMessage,\x20%s,\x20%s','request\x20sent','debug','ChatMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','ChatMessage','body','options','CreateChatMessage','lodash','bluebird','randomstring','ioredis'];(function(_0x51b8f1,_0x3c598a){var _0x52ef12=function(_0x518531){while(--_0x518531){_0x51b8f1['push'](_0x51b8f1['shift']());}};_0x52ef12(++_0x3c598a);}(_0x89ca,0xe3));var _0xa89c=function(_0x269fca,_0x4bac77){_0x269fca=_0x269fca-0x0;var _0x1893c6=_0x89ca[_0x269fca];return _0x1893c6;};'use strict';var _=require(_0xa89c('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0xa89c('0x1'));var rs=require(_0xa89c('0x2'));var fs=require('fs');var Redis=require(_0xa89c('0x3'));var db=require(_0xa89c('0x4'))['db'];var utils=require(_0xa89c('0x5'));var logger=require(_0xa89c('0x6'))('rpc');var config=require('../../config/environment');var jayson=require(_0xa89c('0x7'));var client=jayson[_0xa89c('0x8')][_0xa89c('0x9')]({'port':0x232a});config['redis']=_[_0xa89c('0xa')](config[_0xa89c('0xb')],{'host':_0xa89c('0xc'),'port':0x18eb});var socket=require(_0xa89c('0xd'))(new Redis(config[_0xa89c('0xb')]));require(_0xa89c('0xe'))[_0xa89c('0xf')](socket);function respondWithRpcPromise(_0x5b8db4,_0x591fdb,_0x20f28a){return new BPromise(function(_0x2ce060,_0x3e6f0b){return client[_0xa89c('0x10')](_0x5b8db4,_0x20f28a)[_0xa89c('0x11')](function(_0x3e1c5b){logger[_0xa89c('0x12')](_0xa89c('0x13'),_0x591fdb,_0xa89c('0x14'));logger[_0xa89c('0x15')](_0xa89c('0x16'),_0x591fdb,_0xa89c('0x14'),JSON[_0xa89c('0x17')](_0x3e1c5b));if(_0x3e1c5b[_0xa89c('0x18')]){if(_0x3e1c5b[_0xa89c('0x18')][_0xa89c('0x19')]===0x1f4){logger[_0xa89c('0x18')]('ChatMessage,\x20%s,\x20%s',_0x591fdb,_0x3e1c5b[_0xa89c('0x18')][_0xa89c('0x1a')]);return _0x3e6f0b(_0x3e1c5b[_0xa89c('0x18')][_0xa89c('0x1a')]);}logger[_0xa89c('0x18')](_0xa89c('0x13'),_0x591fdb,_0x3e1c5b[_0xa89c('0x18')][_0xa89c('0x1a')]);return _0x2ce060(_0x3e1c5b[_0xa89c('0x18')]['message']);}else{logger[_0xa89c('0x12')](_0xa89c('0x13'),_0x591fdb,'request\x20sent');_0x2ce060(_0x3e1c5b[_0xa89c('0x1b')][_0xa89c('0x1a')]);}})[_0xa89c('0x1c')](function(_0xab5ca1){logger['error'](_0xa89c('0x13'),_0x591fdb,_0xab5ca1);_0x3e6f0b(_0xab5ca1);});});}exports['CreateChatMessage']=function(_0x8075fe){var _0x386585=this;return new Promise(function(_0x2cd3e5,_0x1c18a1){return db[_0xa89c('0x1d')]['create'](_0x8075fe[_0xa89c('0x1e')],{'raw':_0x8075fe[_0xa89c('0x1f')]?_0x8075fe[_0xa89c('0x1f')]['raw']===undefined?!![]:![]:!![]})[_0xa89c('0x11')](function(_0x35f041){logger[_0xa89c('0x12')]('CreateChatMessage',_0x8075fe);logger['debug'](_0xa89c('0x20'),_0x8075fe,JSON[_0xa89c('0x17')](_0x35f041));_0x2cd3e5(_0x35f041);})[_0xa89c('0x1c')](function(_0x411267){logger[_0xa89c('0x18')](_0xa89c('0x20'),_0x411267[_0xa89c('0x1a')],_0x8075fe);_0x1c18a1(_0x386585[_0xa89c('0x18')](0x1f4,_0x411267[_0xa89c('0x1a')]));});});};
\ No newline at end of file
diff --git a/server/api/chatMessage/chatMessage.socket.js b/server/api/chatMessage/chatMessage.socket.js
index cf55f1e..c6519d3 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 _0x7c1f=['save','remove','update','emit','removeListener','register','length','chatMessage:','./chatMessage.events'];(function(_0x3c253e,_0x98d7d2){var _0x2438d9=function(_0x3a6ad7){while(--_0x3a6ad7){_0x3c253e['push'](_0x3c253e['shift']());}};_0x2438d9(++_0x98d7d2);}(_0x7c1f,0x194));var _0xf7c1=function(_0x233d1f,_0x421885){_0x233d1f=_0x233d1f-0x0;var _0x43d3c9=_0x7c1f[_0x233d1f];return _0x43d3c9;};'use strict';var ChatMessageEvents=require(_0xf7c1('0x0'));var events=[_0xf7c1('0x1'),_0xf7c1('0x2'),_0xf7c1('0x3')];function createListener(_0x3ca7b6,_0x568116){return function(_0x1e3254){_0x568116[_0xf7c1('0x4')](_0x3ca7b6,_0x1e3254);};}function removeListener(_0x18f5a9,_0x485d8d){return function(){ChatMessageEvents[_0xf7c1('0x5')](_0x18f5a9,_0x485d8d);};}exports[_0xf7c1('0x6')]=function(_0x3c21cf){for(var _0x136e1e=0x0,_0x5423bf=events[_0xf7c1('0x7')];_0x136e1e<_0x5423bf;_0x136e1e++){var _0x1a342b=events[_0x136e1e];var _0x329050=createListener(_0xf7c1('0x8')+_0x1a342b,_0x3c21cf);ChatMessageEvents['on'](_0x1a342b,_0x329050);}};
\ No newline at end of file
+var _0x975f=['chatMessage:','./chatMessage.events','save','emit','removeListener','length'];(function(_0x44e960,_0x19be2a){var _0xc05f0=function(_0x547fe4){while(--_0x547fe4){_0x44e960['push'](_0x44e960['shift']());}};_0xc05f0(++_0x19be2a);}(_0x975f,0x109));var _0xf975=function(_0x1fc84d,_0x3f469d){_0x1fc84d=_0x1fc84d-0x0;var _0x2658fa=_0x975f[_0x1fc84d];return _0x2658fa;};'use strict';var ChatMessageEvents=require(_0xf975('0x0'));var events=[_0xf975('0x1'),'remove','update'];function createListener(_0x3d087b,_0x274f21){return function(_0x556f63){_0x274f21[_0xf975('0x2')](_0x3d087b,_0x556f63);};}function removeListener(_0x2d047c,_0x26c58b){return function(){ChatMessageEvents[_0xf975('0x3')](_0x2d047c,_0x26c58b);};}exports['register']=function(_0x356f71){for(var _0x5a9aca=0x0,_0x36f6cf=events[_0xf975('0x4')];_0x5a9aca<_0x36f6cf;_0x5a9aca++){var _0x51a37c=events[_0x5a9aca];var _0x194d30=createListener(_0xf975('0x5')+_0x51a37c,_0x356f71);ChatMessageEvents['on'](_0x51a37c,_0x194d30);}};
\ No newline at end of file
diff --git a/server/api/chatMessage/index.js b/server/api/chatMessage/index.js
index dc51526..110c9a1 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 _0xef40=['chat','chatmessage:create','create','put','update','/:id/accept','reject','delete','destroy','exports','multer','path','connect-timeout','express','Router','fs-extra','../../config/environment','./chatMessage.controller','get','isAuthenticated','index','describe','/:id','show','post','tracked'];(function(_0x1b6186,_0x1ec7f2){var _0x186121=function(_0x1748a8){while(--_0x1748a8){_0x1b6186['push'](_0x1b6186['shift']());}};_0x186121(++_0x1ec7f2);}(_0xef40,0xc0));var _0x0ef4=function(_0x3b380d,_0x4bf247){_0x3b380d=_0x3b380d-0x0;var _0x54502b=_0xef40[_0x3b380d];return _0x54502b;};'use strict';var multer=require(_0x0ef4('0x0'));var util=require('util');var path=require(_0x0ef4('0x1'));var timeout=require(_0x0ef4('0x2'));var express=require(_0x0ef4('0x3'));var router=express[_0x0ef4('0x4')]();var fs_extra=require(_0x0ef4('0x5'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x0ef4('0x6'));var controller=require(_0x0ef4('0x7'));router[_0x0ef4('0x8')]('/',auth[_0x0ef4('0x9')](),controller[_0x0ef4('0xa')]);router[_0x0ef4('0x8')]('/describe',auth[_0x0ef4('0x9')](),controller[_0x0ef4('0xb')]);router[_0x0ef4('0x8')](_0x0ef4('0xc'),auth[_0x0ef4('0x9')](),controller[_0x0ef4('0xd')]);router[_0x0ef4('0xe')]('/',auth[_0x0ef4('0x9')](),interaction[_0x0ef4('0xf')](_0x0ef4('0x10'),_0x0ef4('0x11')),controller[_0x0ef4('0x12')]);router[_0x0ef4('0x13')]('/:id',controller[_0x0ef4('0x14')]);router['put'](_0x0ef4('0x15'),auth[_0x0ef4('0x9')](),controller['accept']);router[_0x0ef4('0x13')]('/:id/reject',auth[_0x0ef4('0x9')](),controller[_0x0ef4('0x16')]);router[_0x0ef4('0x17')]('/:id',auth['isAuthenticated'](),controller[_0x0ef4('0x18')]);module[_0x0ef4('0x19')]=router;
\ No newline at end of file
+var _0x7589=['chat','create','put','update','/:id/reject','reject','delete','destroy','exports','multer','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./chatMessage.controller','get','isAuthenticated','index','/describe','describe','/:id','show','post','tracked'];(function(_0x4baf6d,_0x52f43e){var _0x233caf=function(_0x4cf125){while(--_0x4cf125){_0x4baf6d['push'](_0x4baf6d['shift']());}};_0x233caf(++_0x52f43e);}(_0x7589,0x10d));var _0x9758=function(_0x56a631,_0x171ebd){_0x56a631=_0x56a631-0x0;var _0x9462fb=_0x7589[_0x56a631];return _0x9462fb;};'use strict';var multer=require(_0x9758('0x0'));var util=require('util');var path=require(_0x9758('0x1'));var timeout=require('connect-timeout');var express=require(_0x9758('0x2'));var router=express[_0x9758('0x3')]();var fs_extra=require(_0x9758('0x4'));var auth=require(_0x9758('0x5'));var interaction=require(_0x9758('0x6'));var config=require('../../config/environment');var controller=require(_0x9758('0x7'));router[_0x9758('0x8')]('/',auth[_0x9758('0x9')](),controller[_0x9758('0xa')]);router['get'](_0x9758('0xb'),auth[_0x9758('0x9')](),controller[_0x9758('0xc')]);router[_0x9758('0x8')](_0x9758('0xd'),auth[_0x9758('0x9')](),controller[_0x9758('0xe')]);router[_0x9758('0xf')]('/',auth[_0x9758('0x9')](),interaction[_0x9758('0x10')](_0x9758('0x11'),'chatmessage:create'),controller[_0x9758('0x12')]);router[_0x9758('0x13')]('/:id',controller[_0x9758('0x14')]);router[_0x9758('0x13')]('/:id/accept',auth[_0x9758('0x9')](),controller['accept']);router[_0x9758('0x13')](_0x9758('0x15'),auth[_0x9758('0x9')](),controller[_0x9758('0x16')]);router[_0x9758('0x17')](_0x9758('0xd'),auth[_0x9758('0x9')](),controller[_0x9758('0x18')]);module[_0x9758('0x19')]=router;
\ No newline at end of file
diff --git a/server/api/chatOfflineMessage/chatOfflineMessage.attributes.js b/server/api/chatOfflineMessage/chatOfflineMessage.attributes.js
index b2fe331..b7c3b6c 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 _0x2032=['medium','exports','TEXT'];(function(_0x2d3285,_0x62b9b6){var _0x1b0c7e=function(_0x2adbe4){while(--_0x2adbe4){_0x2d3285['push'](_0x2d3285['shift']());}};_0x1b0c7e(++_0x62b9b6);}(_0x2032,0xd9));var _0x2203=function(_0x376438,_0x2d62c9){_0x376438=_0x376438-0x0;var _0x2b3bfa=_0x2032[_0x376438];return _0x2b3bfa;};'use strict';var Sequelize=require('sequelize');module[_0x2203('0x0')]={'body':{'type':Sequelize[_0x2203('0x1')](_0x2203('0x2')),'allowNull':![]},'plainBody':{'type':Sequelize['TEXT'](_0x2203('0x2')),'allowNull':![]}};
\ No newline at end of file
+var _0xdb28=['TEXT','medium','sequelize','exports'];(function(_0x366d6b,_0x28d23c){var _0x22d530=function(_0x5681b2){while(--_0x5681b2){_0x366d6b['push'](_0x366d6b['shift']());}};_0x22d530(++_0x28d23c);}(_0xdb28,0x106));var _0x8db2=function(_0x9bd6a4,_0x4f9ab6){_0x9bd6a4=_0x9bd6a4-0x0;var _0x319e5e=_0xdb28[_0x9bd6a4];return _0x319e5e;};'use strict';var Sequelize=require(_0x8db2('0x0'));module[_0x8db2('0x1')]={'body':{'type':Sequelize[_0x8db2('0x2')](_0x8db2('0x3')),'allowNull':![]},'plainBody':{'type':Sequelize['TEXT'](_0x8db2('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 84c04a4..a7235ab 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(_0x134c2e,_0x3573c4){var _0x2825db=function(_0x2a574d){while(--_0x2a574d){_0x134c2e['push'](_0x134c2e['shift']());}};_0x2825db(++_0x3573c4);}(_0x7a54,0x106));var _0x47a5=function(_0x5d39ea,_0x107836){_0x5d39ea=_0x5d39ea-0x0;var _0x4a6f35=_0x7a54[_0x5d39ea];return _0x4a6f35;};'use strict';var emlformat=require(_0x47a5('0x0'));var rimraf=require(_0x47a5('0x1'));var zipdir=require(_0x47a5('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x47a5('0x3'));var moment=require(_0x47a5('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x47a5('0x5'));var util=require(_0x47a5('0x6'));var path=require(_0x47a5('0x7'));var sox=require(_0x47a5('0x8'));var csv=require(_0x47a5('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x47a5('0xa'));var _=require('lodash');var squel=require(_0x47a5('0xb'));var crypto=require(_0x47a5('0xc'));var jsforce=require('jsforce');var deskjs=require(_0x47a5('0xd'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x47a5('0xe'));var authService=require(_0x47a5('0xf'));var qs=require('../../components/parsers/qs');var as=require(_0x47a5('0x10'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x47a5('0x11'));var utils=require(_0x47a5('0x12'));var config=require(_0x47a5('0x13'));var licenseUtil=require(_0x47a5('0x14'));var db=require(_0x47a5('0x15'))['db'];function respondWithStatusCode(_0xd308b8,_0x1eae59){_0x1eae59=_0x1eae59||0xcc;return function(_0x5beb89){if(_0x5beb89){return _0xd308b8[_0x47a5('0x16')](_0x1eae59);}return _0xd308b8[_0x47a5('0x17')](_0x1eae59)[_0x47a5('0x18')]();};}function respondWithResult(_0x711793,_0x139f25){_0x139f25=_0x139f25||0xc8;return function(_0x620ee9){if(_0x620ee9){return _0x711793[_0x47a5('0x17')](_0x139f25)[_0x47a5('0x19')](_0x620ee9);}};}function respondWithFilteredResult(_0x4e99a8,_0x362359){return function(_0x11faf5){if(_0x11faf5){var _0x3b001e=typeof _0x362359[_0x47a5('0x1a')]===_0x47a5('0x1b')&&typeof _0x362359['limit']==='undefined';var _0x138bc0=_0x11faf5['count'];var _0x5247fd=_0x3b001e?0x0:_0x362359[_0x47a5('0x1a')];var _0xaf70a6=_0x3b001e?_0x11faf5[_0x47a5('0x1c')]:_0x362359[_0x47a5('0x1a')]+_0x362359[_0x47a5('0x1d')];var _0x12b98e;if(_0xaf70a6>=_0x138bc0){_0xaf70a6=_0x138bc0;_0x12b98e=0xc8;}else{_0x12b98e=0xce;}_0x4e99a8[_0x47a5('0x17')](_0x12b98e);return _0x4e99a8[_0x47a5('0x1e')](_0x47a5('0x1f'),_0x5247fd+'-'+_0xaf70a6+'/'+_0x138bc0)['json'](_0x11faf5);}return null;};}function patchUpdates(_0x1570bc){return function(_0xf160ba){try{jsonpatch['apply'](_0xf160ba,_0x1570bc,!![]);}catch(_0x2b0360){return BPromise[_0x47a5('0x20')](_0x2b0360);}return _0xf160ba[_0x47a5('0x21')]();};}function saveUpdates(_0x4c5910,_0xb8ae6c){return function(_0x2f142b){if(_0x2f142b){return _0x2f142b[_0x47a5('0x22')](_0x4c5910)[_0x47a5('0x23')](function(_0x5ef1b1){return _0x5ef1b1;});}return null;};}function removeEntity(_0xe2dea9,_0x385687){return function(_0x513981){if(_0x513981){return _0x513981[_0x47a5('0x24')]()[_0x47a5('0x23')](function(){_0xe2dea9[_0x47a5('0x17')](0xcc)[_0x47a5('0x18')]();});}};}function handleEntityNotFound(_0x3abd6a,_0x50bf17){return function(_0x53078a){if(!_0x53078a){_0x3abd6a[_0x47a5('0x16')](0x194);}return _0x53078a;};}function handleError(_0x5686db,_0x1ea9c8){_0x1ea9c8=_0x1ea9c8||0x1f4;return function(_0x5b6c4e){logger[_0x47a5('0x25')](_0x5b6c4e[_0x47a5('0x26')]);if(_0x5b6c4e[_0x47a5('0x27')]){delete _0x5b6c4e[_0x47a5('0x27')];}_0x5686db[_0x47a5('0x17')](_0x1ea9c8)[_0x47a5('0x28')](_0x5b6c4e);};}exports[_0x47a5('0x29')]=function(_0x136b14,_0x16631f){var _0x361bfa={},_0x1127f8={},_0x11a4fa={'count':0x0,'rows':[]};var _0x3ad507=_['map'](db[_0x47a5('0x2a')]['rawAttributes'],function(_0x2ef875){return{'name':_0x2ef875[_0x47a5('0x2b')],'type':_0x2ef875[_0x47a5('0x2c')]['key']};});_0x1127f8[_0x47a5('0x2d')]=_[_0x47a5('0x2e')](_0x3ad507,_0x47a5('0x27'));_0x1127f8[_0x47a5('0x2f')]=_['keys'](_0x136b14['query']);_0x1127f8[_0x47a5('0x30')]=_[_0x47a5('0x31')](_0x1127f8['model'],_0x1127f8['query']);_0x361bfa[_0x47a5('0x32')]=_[_0x47a5('0x31')](_0x1127f8['model'],qs[_0x47a5('0x33')](_0x136b14['query'][_0x47a5('0x33')]));_0x361bfa[_0x47a5('0x32')]=_0x361bfa['attributes']['length']?_0x361bfa[_0x47a5('0x32')]:_0x1127f8['model'];if(!_0x136b14[_0x47a5('0x2f')][_0x47a5('0x34')](_0x47a5('0x35'))){_0x361bfa['limit']=qs[_0x47a5('0x1d')](_0x136b14['query']['limit']);_0x361bfa[_0x47a5('0x1a')]=qs['offset'](_0x136b14[_0x47a5('0x2f')]['offset']);}_0x361bfa[_0x47a5('0x36')]=qs[_0x47a5('0x37')](_0x136b14[_0x47a5('0x2f')][_0x47a5('0x37')]);_0x361bfa[_0x47a5('0x38')]=qs[_0x47a5('0x30')](_[_0x47a5('0x39')](_0x136b14[_0x47a5('0x2f')],_0x1127f8[_0x47a5('0x30')]),_0x3ad507);if(_0x136b14['query'][_0x47a5('0x3a')]){_0x361bfa[_0x47a5('0x38')]=_['merge'](_0x361bfa[_0x47a5('0x38')],{'$or':_[_0x47a5('0x2e')](_0x3ad507,function(_0x1d4348){if(_0x1d4348['type']!==_0x47a5('0x3b')){var _0x10f660={};_0x10f660[_0x1d4348['name']]={'$like':'%'+_0x136b14[_0x47a5('0x2f')][_0x47a5('0x3a')]+'%'};return _0x10f660;}})});}_0x361bfa=_['merge']({},_0x361bfa,_0x136b14['options']);var _0x5ebd8c={'where':_0x361bfa[_0x47a5('0x38')]};return db['ChatOfflineMessage'][_0x47a5('0x1c')](_0x5ebd8c)[_0x47a5('0x23')](function(_0x301a85){_0x11a4fa[_0x47a5('0x1c')]=_0x301a85;if(_0x136b14[_0x47a5('0x2f')][_0x47a5('0x3c')]){_0x361bfa[_0x47a5('0x3d')]=[{'all':!![]}];}return db[_0x47a5('0x2a')][_0x47a5('0x3e')](_0x361bfa);})[_0x47a5('0x23')](function(_0x280500){_0x11a4fa[_0x47a5('0x3f')]=_0x280500;return _0x11a4fa;})[_0x47a5('0x23')](respondWithFilteredResult(_0x16631f,_0x361bfa))['catch'](handleError(_0x16631f,null));};exports[_0x47a5('0x40')]=function(_0x1c36fa,_0x331474){var _0x23bd8d={'raw':!![],'where':{'id':_0x1c36fa[_0x47a5('0x41')]['id']}},_0x586f4f={};_0x586f4f['model']=_['keys'](db['ChatOfflineMessage']['rawAttributes']);_0x586f4f[_0x47a5('0x2f')]=_['keys'](_0x1c36fa[_0x47a5('0x2f')]);_0x586f4f[_0x47a5('0x30')]=_[_0x47a5('0x31')](_0x586f4f['model'],_0x586f4f[_0x47a5('0x2f')]);_0x23bd8d[_0x47a5('0x32')]=_['intersection'](_0x586f4f['model'],qs[_0x47a5('0x33')](_0x1c36fa['query'][_0x47a5('0x33')]));_0x23bd8d[_0x47a5('0x32')]=_0x23bd8d[_0x47a5('0x32')][_0x47a5('0x42')]?_0x23bd8d[_0x47a5('0x32')]:_0x586f4f[_0x47a5('0x2d')];if(_0x1c36fa[_0x47a5('0x2f')][_0x47a5('0x3c')]){_0x23bd8d[_0x47a5('0x3d')]=[{'all':!![]}];}_0x23bd8d=_[_0x47a5('0x43')]({},_0x23bd8d,_0x1c36fa[_0x47a5('0x44')]);return db[_0x47a5('0x2a')][_0x47a5('0x45')](_0x23bd8d)[_0x47a5('0x23')](handleEntityNotFound(_0x331474,null))[_0x47a5('0x23')](respondWithResult(_0x331474,null))[_0x47a5('0x46')](handleError(_0x331474,null));};exports['create']=function(_0x2d38de,_0x23bb04){return db['ChatOfflineMessage']['create'](_0x2d38de[_0x47a5('0x47')],{})['then'](respondWithResult(_0x23bb04,0xc9))[_0x47a5('0x46')](handleError(_0x23bb04,null));};exports[_0x47a5('0x22')]=function(_0x54c35f,_0x4f62d3){if(_0x54c35f[_0x47a5('0x47')]['id']){delete _0x54c35f['body']['id'];}return db[_0x47a5('0x2a')][_0x47a5('0x45')]({'where':{'id':_0x54c35f[_0x47a5('0x41')]['id']}})[_0x47a5('0x23')](handleEntityNotFound(_0x4f62d3,null))[_0x47a5('0x23')](saveUpdates(_0x54c35f[_0x47a5('0x47')],null))[_0x47a5('0x23')](respondWithResult(_0x4f62d3,null))['catch'](handleError(_0x4f62d3,null));};exports['destroy']=function(_0x2dd1db,_0x411230){return db[_0x47a5('0x48')][_0x47a5('0x3e')]({'where':{'ChatOfflineMessageId':_0x2dd1db[_0x47a5('0x41')]['id']},'raw':!![]})[_0x47a5('0x23')](function(_0x249de5){_0x249de5['forEach'](function(_0x45cca5){var _0x1c9a62=path[_0x47a5('0x49')](config['root'],_0x47a5('0x4a'),'files',_0x47a5('0x4b'),_0x47a5('0x4c'),_0x45cca5[_0x47a5('0x4d')]);var _0xf03bd5=fs['existsSync'](_0x1c9a62);if(_0xf03bd5)fs_extra[_0x47a5('0x4e')](_0x1c9a62);});})[_0x47a5('0x23')](function(){return db[_0x47a5('0x2a')][_0x47a5('0x45')]({'where':{'id':_0x2dd1db[_0x47a5('0x41')]['id']},'individualHooks':!![]});})[_0x47a5('0x23')](handleEntityNotFound(_0x411230,null))[_0x47a5('0x23')](removeEntity(_0x411230,null))['catch'](handleError(_0x411230,null));};exports[_0x47a5('0x4f')]=function(_0x43721b,_0x187d7e){return db[_0x47a5('0x2a')][_0x47a5('0x4f')]()[_0x47a5('0x23')](respondWithResult(_0x187d7e,null))['catch'](handleError(_0x187d7e,null));};
\ No newline at end of file
+var _0x7a54=['filter','VIRTUAL','includeAll','include','findAll','rows','show','params','length','merge','options','find','catch','body','Attachment','join','server','attachments','offline-chat','basename','remove','describe','eml-format','rimraf','zip-dir','request-promise','moment','mustache','util','path','sox','to-csv','fs-extra','squel','crypto','desk.js','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','count','limit','set','Content-Range','reject','save','update','then','destroy','error','stack','name','send','index','ChatOfflineMessage','fieldName','type','model','map','query','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','where','pick'];(function(_0x311c35,_0x534915){var _0x5cc50c=function(_0x3ad680){while(--_0x3ad680){_0x311c35['push'](_0x311c35['shift']());}};_0x5cc50c(++_0x534915);}(_0x7a54,0x106));var _0x47a5=function(_0x4e795d,_0x44a90b){_0x4e795d=_0x4e795d-0x0;var _0x22e79b=_0x7a54[_0x4e795d];return _0x22e79b;};'use strict';var emlformat=require(_0x47a5('0x0'));var rimraf=require(_0x47a5('0x1'));var zipdir=require(_0x47a5('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x47a5('0x3'));var moment=require(_0x47a5('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x47a5('0x5'));var util=require(_0x47a5('0x6'));var path=require(_0x47a5('0x7'));var sox=require(_0x47a5('0x8'));var csv=require(_0x47a5('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x47a5('0xa'));var _=require('lodash');var squel=require(_0x47a5('0xb'));var crypto=require(_0x47a5('0xc'));var jsforce=require('jsforce');var deskjs=require(_0x47a5('0xd'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x47a5('0xe'));var authService=require(_0x47a5('0xf'));var qs=require('../../components/parsers/qs');var as=require(_0x47a5('0x10'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x47a5('0x11'));var utils=require(_0x47a5('0x12'));var config=require(_0x47a5('0x13'));var licenseUtil=require(_0x47a5('0x14'));var db=require(_0x47a5('0x15'))['db'];function respondWithStatusCode(_0xd308b8,_0x1eae59){_0x1eae59=_0x1eae59||0xcc;return function(_0x5beb89){if(_0x5beb89){return _0xd308b8[_0x47a5('0x16')](_0x1eae59);}return _0xd308b8[_0x47a5('0x17')](_0x1eae59)[_0x47a5('0x18')]();};}function respondWithResult(_0x711793,_0x139f25){_0x139f25=_0x139f25||0xc8;return function(_0x620ee9){if(_0x620ee9){return _0x711793[_0x47a5('0x17')](_0x139f25)[_0x47a5('0x19')](_0x620ee9);}};}function respondWithFilteredResult(_0x4e99a8,_0x362359){return function(_0x11faf5){if(_0x11faf5){var _0x3b001e=typeof _0x362359[_0x47a5('0x1a')]===_0x47a5('0x1b')&&typeof _0x362359['limit']==='undefined';var _0x138bc0=_0x11faf5['count'];var _0x5247fd=_0x3b001e?0x0:_0x362359[_0x47a5('0x1a')];var _0xaf70a6=_0x3b001e?_0x11faf5[_0x47a5('0x1c')]:_0x362359[_0x47a5('0x1a')]+_0x362359[_0x47a5('0x1d')];var _0x12b98e;if(_0xaf70a6>=_0x138bc0){_0xaf70a6=_0x138bc0;_0x12b98e=0xc8;}else{_0x12b98e=0xce;}_0x4e99a8[_0x47a5('0x17')](_0x12b98e);return _0x4e99a8[_0x47a5('0x1e')](_0x47a5('0x1f'),_0x5247fd+'-'+_0xaf70a6+'/'+_0x138bc0)['json'](_0x11faf5);}return null;};}function patchUpdates(_0x1570bc){return function(_0xf160ba){try{jsonpatch['apply'](_0xf160ba,_0x1570bc,!![]);}catch(_0x2b0360){return BPromise[_0x47a5('0x20')](_0x2b0360);}return _0xf160ba[_0x47a5('0x21')]();};}function saveUpdates(_0x4c5910,_0xb8ae6c){return function(_0x2f142b){if(_0x2f142b){return _0x2f142b[_0x47a5('0x22')](_0x4c5910)[_0x47a5('0x23')](function(_0x5ef1b1){return _0x5ef1b1;});}return null;};}function removeEntity(_0xe2dea9,_0x385687){return function(_0x513981){if(_0x513981){return _0x513981[_0x47a5('0x24')]()[_0x47a5('0x23')](function(){_0xe2dea9[_0x47a5('0x17')](0xcc)[_0x47a5('0x18')]();});}};}function handleEntityNotFound(_0x3abd6a,_0x50bf17){return function(_0x53078a){if(!_0x53078a){_0x3abd6a[_0x47a5('0x16')](0x194);}return _0x53078a;};}function handleError(_0x5686db,_0x1ea9c8){_0x1ea9c8=_0x1ea9c8||0x1f4;return function(_0x5b6c4e){logger[_0x47a5('0x25')](_0x5b6c4e[_0x47a5('0x26')]);if(_0x5b6c4e[_0x47a5('0x27')]){delete _0x5b6c4e[_0x47a5('0x27')];}_0x5686db[_0x47a5('0x17')](_0x1ea9c8)[_0x47a5('0x28')](_0x5b6c4e);};}exports[_0x47a5('0x29')]=function(_0x136b14,_0x16631f){var _0x361bfa={},_0x1127f8={},_0x11a4fa={'count':0x0,'rows':[]};var _0x3ad507=_['map'](db[_0x47a5('0x2a')]['rawAttributes'],function(_0x2ef875){return{'name':_0x2ef875[_0x47a5('0x2b')],'type':_0x2ef875[_0x47a5('0x2c')]['key']};});_0x1127f8[_0x47a5('0x2d')]=_[_0x47a5('0x2e')](_0x3ad507,_0x47a5('0x27'));_0x1127f8[_0x47a5('0x2f')]=_['keys'](_0x136b14['query']);_0x1127f8[_0x47a5('0x30')]=_[_0x47a5('0x31')](_0x1127f8['model'],_0x1127f8['query']);_0x361bfa[_0x47a5('0x32')]=_[_0x47a5('0x31')](_0x1127f8['model'],qs[_0x47a5('0x33')](_0x136b14['query'][_0x47a5('0x33')]));_0x361bfa[_0x47a5('0x32')]=_0x361bfa['attributes']['length']?_0x361bfa[_0x47a5('0x32')]:_0x1127f8['model'];if(!_0x136b14[_0x47a5('0x2f')][_0x47a5('0x34')](_0x47a5('0x35'))){_0x361bfa['limit']=qs[_0x47a5('0x1d')](_0x136b14['query']['limit']);_0x361bfa[_0x47a5('0x1a')]=qs['offset'](_0x136b14[_0x47a5('0x2f')]['offset']);}_0x361bfa[_0x47a5('0x36')]=qs[_0x47a5('0x37')](_0x136b14[_0x47a5('0x2f')][_0x47a5('0x37')]);_0x361bfa[_0x47a5('0x38')]=qs[_0x47a5('0x30')](_[_0x47a5('0x39')](_0x136b14[_0x47a5('0x2f')],_0x1127f8[_0x47a5('0x30')]),_0x3ad507);if(_0x136b14['query'][_0x47a5('0x3a')]){_0x361bfa[_0x47a5('0x38')]=_['merge'](_0x361bfa[_0x47a5('0x38')],{'$or':_[_0x47a5('0x2e')](_0x3ad507,function(_0x1d4348){if(_0x1d4348['type']!==_0x47a5('0x3b')){var _0x10f660={};_0x10f660[_0x1d4348['name']]={'$like':'%'+_0x136b14[_0x47a5('0x2f')][_0x47a5('0x3a')]+'%'};return _0x10f660;}})});}_0x361bfa=_['merge']({},_0x361bfa,_0x136b14['options']);var _0x5ebd8c={'where':_0x361bfa[_0x47a5('0x38')]};return db['ChatOfflineMessage'][_0x47a5('0x1c')](_0x5ebd8c)[_0x47a5('0x23')](function(_0x301a85){_0x11a4fa[_0x47a5('0x1c')]=_0x301a85;if(_0x136b14[_0x47a5('0x2f')][_0x47a5('0x3c')]){_0x361bfa[_0x47a5('0x3d')]=[{'all':!![]}];}return db[_0x47a5('0x2a')][_0x47a5('0x3e')](_0x361bfa);})[_0x47a5('0x23')](function(_0x280500){_0x11a4fa[_0x47a5('0x3f')]=_0x280500;return _0x11a4fa;})[_0x47a5('0x23')](respondWithFilteredResult(_0x16631f,_0x361bfa))['catch'](handleError(_0x16631f,null));};exports[_0x47a5('0x40')]=function(_0x1c36fa,_0x331474){var _0x23bd8d={'raw':!![],'where':{'id':_0x1c36fa[_0x47a5('0x41')]['id']}},_0x586f4f={};_0x586f4f['model']=_['keys'](db['ChatOfflineMessage']['rawAttributes']);_0x586f4f[_0x47a5('0x2f')]=_['keys'](_0x1c36fa[_0x47a5('0x2f')]);_0x586f4f[_0x47a5('0x30')]=_[_0x47a5('0x31')](_0x586f4f['model'],_0x586f4f[_0x47a5('0x2f')]);_0x23bd8d[_0x47a5('0x32')]=_['intersection'](_0x586f4f['model'],qs[_0x47a5('0x33')](_0x1c36fa['query'][_0x47a5('0x33')]));_0x23bd8d[_0x47a5('0x32')]=_0x23bd8d[_0x47a5('0x32')][_0x47a5('0x42')]?_0x23bd8d[_0x47a5('0x32')]:_0x586f4f[_0x47a5('0x2d')];if(_0x1c36fa[_0x47a5('0x2f')][_0x47a5('0x3c')]){_0x23bd8d[_0x47a5('0x3d')]=[{'all':!![]}];}_0x23bd8d=_[_0x47a5('0x43')]({},_0x23bd8d,_0x1c36fa[_0x47a5('0x44')]);return db[_0x47a5('0x2a')][_0x47a5('0x45')](_0x23bd8d)[_0x47a5('0x23')](handleEntityNotFound(_0x331474,null))[_0x47a5('0x23')](respondWithResult(_0x331474,null))[_0x47a5('0x46')](handleError(_0x331474,null));};exports['create']=function(_0x2d38de,_0x23bb04){return db['ChatOfflineMessage']['create'](_0x2d38de[_0x47a5('0x47')],{})['then'](respondWithResult(_0x23bb04,0xc9))[_0x47a5('0x46')](handleError(_0x23bb04,null));};exports[_0x47a5('0x22')]=function(_0x54c35f,_0x4f62d3){if(_0x54c35f[_0x47a5('0x47')]['id']){delete _0x54c35f['body']['id'];}return db[_0x47a5('0x2a')][_0x47a5('0x45')]({'where':{'id':_0x54c35f[_0x47a5('0x41')]['id']}})[_0x47a5('0x23')](handleEntityNotFound(_0x4f62d3,null))[_0x47a5('0x23')](saveUpdates(_0x54c35f[_0x47a5('0x47')],null))[_0x47a5('0x23')](respondWithResult(_0x4f62d3,null))['catch'](handleError(_0x4f62d3,null));};exports['destroy']=function(_0x2dd1db,_0x411230){return db[_0x47a5('0x48')][_0x47a5('0x3e')]({'where':{'ChatOfflineMessageId':_0x2dd1db[_0x47a5('0x41')]['id']},'raw':!![]})[_0x47a5('0x23')](function(_0x249de5){_0x249de5['forEach'](function(_0x45cca5){var _0x1c9a62=path[_0x47a5('0x49')](config['root'],_0x47a5('0x4a'),'files',_0x47a5('0x4b'),_0x47a5('0x4c'),_0x45cca5[_0x47a5('0x4d')]);var _0xf03bd5=fs['existsSync'](_0x1c9a62);if(_0xf03bd5)fs_extra[_0x47a5('0x4e')](_0x1c9a62);});})[_0x47a5('0x23')](function(){return db[_0x47a5('0x2a')][_0x47a5('0x45')]({'where':{'id':_0x2dd1db[_0x47a5('0x41')]['id']},'individualHooks':!![]});})[_0x47a5('0x23')](handleEntityNotFound(_0x411230,null))[_0x47a5('0x23')](removeEntity(_0x411230,null))['catch'](handleError(_0x411230,null));};exports[_0x47a5('0x4f')]=function(_0x43721b,_0x187d7e){return db[_0x47a5('0x2a')][_0x47a5('0x4f')]()[_0x47a5('0x23')](respondWithResult(_0x187d7e,null))['catch'](handleError(_0x187d7e,null));};
\ No newline at end of file
diff --git a/server/api/chatOfflineMessage/chatOfflineMessage.events.js b/server/api/chatOfflineMessage/chatOfflineMessage.events.js
index 5994aa6..e84504b 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 _0x39f8=['hook','exports','../../mysqldb','ChatOfflineMessage','setMaxListeners','save','remove','emit','hasOwnProperty'];(function(_0x2751d8,_0x26bbcb){var _0x2fce41=function(_0x2cb549){while(--_0x2cb549){_0x2751d8['push'](_0x2751d8['shift']());}};_0x2fce41(++_0x26bbcb);}(_0x39f8,0x161));var _0x839f=function(_0x44b433,_0x5498bd){_0x44b433=_0x44b433-0x0;var _0x2e7362=_0x39f8[_0x44b433];return _0x2e7362;};'use strict';var EventEmitter=require('events');var ChatOfflineMessage=require(_0x839f('0x0'))['db'][_0x839f('0x1')];var ChatOfflineMessageEvents=new EventEmitter();ChatOfflineMessageEvents[_0x839f('0x2')](0x0);var events={'afterCreate':_0x839f('0x3'),'afterUpdate':'update','afterDestroy':_0x839f('0x4')};function emitEvent(_0x2e43ac){return function(_0x50817c,_0x3cb754,_0x4d5611){ChatOfflineMessageEvents[_0x839f('0x5')](_0x2e43ac+':'+_0x50817c['id'],_0x50817c);ChatOfflineMessageEvents[_0x839f('0x5')](_0x2e43ac,_0x50817c);_0x4d5611(null);};}for(var e in events){if(events[_0x839f('0x6')](e)){var event=events[e];ChatOfflineMessage[_0x839f('0x7')](e,emitEvent(event));}}module[_0x839f('0x8')]=ChatOfflineMessageEvents;
\ No newline at end of file
+var _0xbd15=['ChatOfflineMessage','setMaxListeners','save','update','emit','hasOwnProperty','hook','exports','events','../../mysqldb'];(function(_0xe5d54f,_0x143d93){var _0x2a74bf=function(_0x3e56cb){while(--_0x3e56cb){_0xe5d54f['push'](_0xe5d54f['shift']());}};_0x2a74bf(++_0x143d93);}(_0xbd15,0x102));var _0x5bd1=function(_0x1d0b80,_0x41fc24){_0x1d0b80=_0x1d0b80-0x0;var _0x35d642=_0xbd15[_0x1d0b80];return _0x35d642;};'use strict';var EventEmitter=require(_0x5bd1('0x0'));var ChatOfflineMessage=require(_0x5bd1('0x1'))['db'][_0x5bd1('0x2')];var ChatOfflineMessageEvents=new EventEmitter();ChatOfflineMessageEvents[_0x5bd1('0x3')](0x0);var events={'afterCreate':_0x5bd1('0x4'),'afterUpdate':_0x5bd1('0x5'),'afterDestroy':'remove'};function emitEvent(_0x5b6b0d){return function(_0xa3f6d5,_0x148d1c,_0x304c2c){ChatOfflineMessageEvents[_0x5bd1('0x6')](_0x5b6b0d+':'+_0xa3f6d5['id'],_0xa3f6d5);ChatOfflineMessageEvents[_0x5bd1('0x6')](_0x5b6b0d,_0xa3f6d5);_0x304c2c(null);};}for(var e in events){if(events[_0x5bd1('0x7')](e)){var event=events[e];ChatOfflineMessage[_0x5bd1('0x8')](e,emitEvent(event));}}module[_0x5bd1('0x9')]=ChatOfflineMessageEvents;
\ No newline at end of file
diff --git a/server/api/chatOfflineMessage/chatOfflineMessage.model.js b/server/api/chatOfflineMessage/chatOfflineMessage.model.js
index 3fd15ea..2e3d2d6 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 _0x17b8=['exports','define','ChatOfflineMessage','chat_offline_messages','utf8mb4','./chatOfflineMessage.attributes'];(function(_0x1b7368,_0x3286ed){var _0x25d54c=function(_0x2366da){while(--_0x2366da){_0x1b7368['push'](_0x1b7368['shift']());}};_0x25d54c(++_0x3286ed);}(_0x17b8,0x179));var _0x817b=function(_0x2be240,_0x1e119d){_0x2be240=_0x2be240-0x0;var _0x123543=_0x17b8[_0x2be240];return _0x123543;};'use strict';var attributes=require(_0x817b('0x0'));module[_0x817b('0x1')]=function(_0x7d8c53){return _0x7d8c53[_0x817b('0x2')](_0x817b('0x3'),attributes,{'tableName':_0x817b('0x4'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x817b('0x5'),'collate':'utf8mb4_unicode_ci'});};
\ No newline at end of file
+var _0x626f=['define','ChatOfflineMessage','chat_offline_messages','utf8mb4','./chatOfflineMessage.attributes','exports'];(function(_0x2a83bd,_0x4e3265){var _0x52d109=function(_0x236b81){while(--_0x236b81){_0x2a83bd['push'](_0x2a83bd['shift']());}};_0x52d109(++_0x4e3265);}(_0x626f,0x11e));var _0xf626=function(_0x41cb6d,_0x151790){_0x41cb6d=_0x41cb6d-0x0;var _0x37b11f=_0x626f[_0x41cb6d];return _0x37b11f;};'use strict';var attributes=require(_0xf626('0x0'));module[_0xf626('0x1')]=function(_0x41fa33){return _0x41fa33[_0xf626('0x2')](_0xf626('0x3'),attributes,{'tableName':_0xf626('0x4'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0xf626('0x5'),'collate':'utf8mb4_unicode_ci'});};
\ No newline at end of file
diff --git a/server/api/chatOfflineMessage/chatOfflineMessage.rpc.js b/server/api/chatOfflineMessage/chatOfflineMessage.rpc.js
index d3a3f39..b38e0ba 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 _0x73f9=['../../config/environment','http','request','request\x20sent','debug','ChatOfflineMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','message','ChatOfflineMessage,\x20%s,\x20%s','info','result','catch','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc'];(function(_0xf4dfa4,_0x2f9143){var _0x3a5ac1=function(_0x4a1671){while(--_0x4a1671){_0xf4dfa4['push'](_0xf4dfa4['shift']());}};_0x3a5ac1(++_0x2f9143);}(_0x73f9,0x1c6));var _0x973f=function(_0x45c5c5,_0x31fb9b){_0x45c5c5=_0x45c5c5-0x0;var _0x25a41e=_0x73f9[_0x45c5c5];return _0x25a41e;};'use strict';var _=require('lodash');var util=require(_0x973f('0x0'));var moment=require(_0x973f('0x1'));var BPromise=require(_0x973f('0x2'));var rs=require(_0x973f('0x3'));var fs=require('fs');var Redis=require(_0x973f('0x4'));var db=require(_0x973f('0x5'))['db'];var utils=require(_0x973f('0x6'));var logger=require('../../config/logger')(_0x973f('0x7'));var config=require(_0x973f('0x8'));var jayson=require('jayson/promise');var client=jayson['client'][_0x973f('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x4f09c1,_0x12b109,_0x48feb6){return new BPromise(function(_0x5cd408,_0x470a73){return client[_0x973f('0xa')](_0x4f09c1,_0x48feb6)['then'](function(_0x3c1d59){logger['info']('ChatOfflineMessage,\x20%s,\x20%s',_0x12b109,_0x973f('0xb'));logger[_0x973f('0xc')](_0x973f('0xd'),_0x12b109,_0x973f('0xb'),JSON[_0x973f('0xe')](_0x3c1d59));if(_0x3c1d59[_0x973f('0xf')]){if(_0x3c1d59[_0x973f('0xf')][_0x973f('0x10')]===0x1f4){logger[_0x973f('0xf')]('ChatOfflineMessage,\x20%s,\x20%s',_0x12b109,_0x3c1d59[_0x973f('0xf')][_0x973f('0x11')]);return _0x470a73(_0x3c1d59[_0x973f('0xf')][_0x973f('0x11')]);}logger[_0x973f('0xf')](_0x973f('0x12'),_0x12b109,_0x3c1d59[_0x973f('0xf')][_0x973f('0x11')]);return _0x5cd408(_0x3c1d59[_0x973f('0xf')]['message']);}else{logger[_0x973f('0x13')]('ChatOfflineMessage,\x20%s,\x20%s',_0x12b109,_0x973f('0xb'));_0x5cd408(_0x3c1d59[_0x973f('0x14')]['message']);}})[_0x973f('0x15')](function(_0x2a4bb6){logger[_0x973f('0xf')](_0x973f('0x12'),_0x12b109,_0x2a4bb6);_0x470a73(_0x2a4bb6);});});}
\ No newline at end of file
+var _0x5139=['message','result','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','request','then','info','ChatOfflineMessage,\x20%s,\x20%s','debug','ChatOfflineMessage,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error'];(function(_0x87e0dc,_0x577dce){var _0x2cd2d1=function(_0x2d8173){while(--_0x2d8173){_0x87e0dc['push'](_0x87e0dc['shift']());}};_0x2cd2d1(++_0x577dce);}(_0x5139,0x8c));var _0x9513=function(_0x4d9ddb,_0x5041fe){_0x4d9ddb=_0x4d9ddb-0x0;var _0x566f23=_0x5139[_0x4d9ddb];return _0x566f23;};'use strict';var _=require(_0x9513('0x0'));var util=require(_0x9513('0x1'));var moment=require('moment');var BPromise=require(_0x9513('0x2'));var rs=require(_0x9513('0x3'));var fs=require('fs');var Redis=require(_0x9513('0x4'));var db=require(_0x9513('0x5'))['db'];var utils=require(_0x9513('0x6'));var logger=require(_0x9513('0x7'))(_0x9513('0x8'));var config=require('../../config/environment');var jayson=require(_0x9513('0x9'));var client=jayson[_0x9513('0xa')][_0x9513('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x2385d8,_0x57c610,_0x45d209){return new BPromise(function(_0x1ce372,_0x120038){return client[_0x9513('0xc')](_0x2385d8,_0x45d209)[_0x9513('0xd')](function(_0x26f76c){logger[_0x9513('0xe')](_0x9513('0xf'),_0x57c610,'request\x20sent');logger[_0x9513('0x10')](_0x9513('0x11'),_0x57c610,_0x9513('0x12'),JSON[_0x9513('0x13')](_0x26f76c));if(_0x26f76c[_0x9513('0x14')]){if(_0x26f76c[_0x9513('0x14')]['code']===0x1f4){logger[_0x9513('0x14')](_0x9513('0xf'),_0x57c610,_0x26f76c[_0x9513('0x14')]['message']);return _0x120038(_0x26f76c['error']['message']);}logger[_0x9513('0x14')](_0x9513('0xf'),_0x57c610,_0x26f76c[_0x9513('0x14')][_0x9513('0x15')]);return _0x1ce372(_0x26f76c[_0x9513('0x14')][_0x9513('0x15')]);}else{logger['info'](_0x9513('0xf'),_0x57c610,_0x9513('0x12'));_0x1ce372(_0x26f76c[_0x9513('0x16')][_0x9513('0x15')]);}})['catch'](function(_0x4fbd9e){logger[_0x9513('0x14')]('ChatOfflineMessage,\x20%s,\x20%s',_0x57c610,_0x4fbd9e);_0x120038(_0x4fbd9e);});});}
\ No newline at end of file
diff --git a/server/api/chatOfflineMessage/index.js b/server/api/chatOfflineMessage/index.js
index f7f4e56..8fc4af4 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 _0xc3a3=['destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment','./chatOfflineMessage.controller','get','index','/describe','isAuthenticated','describe','/:id','post','create','put','update','delete'];(function(_0x56c1c6,_0x3fb809){var _0x5674a7=function(_0x40232f){while(--_0x40232f){_0x56c1c6['push'](_0x56c1c6['shift']());}};_0x5674a7(++_0x3fb809);}(_0xc3a3,0x75));var _0x3c3a=function(_0x1e2fd2,_0x44bde1){_0x1e2fd2=_0x1e2fd2-0x0;var _0x3872c6=_0xc3a3[_0x1e2fd2];return _0x3872c6;};'use strict';var multer=require(_0x3c3a('0x0'));var util=require(_0x3c3a('0x1'));var path=require(_0x3c3a('0x2'));var timeout=require(_0x3c3a('0x3'));var express=require(_0x3c3a('0x4'));var router=express[_0x3c3a('0x5')]();var fs_extra=require(_0x3c3a('0x6'));var auth=require('../../components/auth/service');var interaction=require(_0x3c3a('0x7'));var config=require(_0x3c3a('0x8'));var controller=require(_0x3c3a('0x9'));router[_0x3c3a('0xa')]('/',auth['isAuthenticated'](),controller[_0x3c3a('0xb')]);router['get'](_0x3c3a('0xc'),auth[_0x3c3a('0xd')](),controller[_0x3c3a('0xe')]);router[_0x3c3a('0xa')](_0x3c3a('0xf'),auth[_0x3c3a('0xd')](),controller['show']);router[_0x3c3a('0x10')]('/',auth['isAuthenticated'](),controller[_0x3c3a('0x11')]);router[_0x3c3a('0x12')](_0x3c3a('0xf'),auth[_0x3c3a('0xd')](),controller[_0x3c3a('0x13')]);router[_0x3c3a('0x14')]('/:id',auth[_0x3c3a('0xd')](),controller[_0x3c3a('0x15')]);module[_0x3c3a('0x16')]=router;
\ No newline at end of file
+var _0xee1d=['path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./chatOfflineMessage.controller','get','isAuthenticated','/describe','describe','/:id','post','create','put','update','delete','destroy','exports','multer','util'];(function(_0x1a813f,_0x134f96){var _0x2415d7=function(_0x1aeba2){while(--_0x1aeba2){_0x1a813f['push'](_0x1a813f['shift']());}};_0x2415d7(++_0x134f96);}(_0xee1d,0x14e));var _0xdee1=function(_0x41d4e2,_0x542e81){_0x41d4e2=_0x41d4e2-0x0;var _0x53ac2b=_0xee1d[_0x41d4e2];return _0x53ac2b;};'use strict';var multer=require(_0xdee1('0x0'));var util=require(_0xdee1('0x1'));var path=require(_0xdee1('0x2'));var timeout=require(_0xdee1('0x3'));var express=require('express');var router=express[_0xdee1('0x4')]();var fs_extra=require(_0xdee1('0x5'));var auth=require(_0xdee1('0x6'));var interaction=require(_0xdee1('0x7'));var config=require('../../config/environment');var controller=require(_0xdee1('0x8'));router[_0xdee1('0x9')]('/',auth[_0xdee1('0xa')](),controller['index']);router[_0xdee1('0x9')](_0xdee1('0xb'),auth[_0xdee1('0xa')](),controller[_0xdee1('0xc')]);router['get'](_0xdee1('0xd'),auth[_0xdee1('0xa')](),controller['show']);router[_0xdee1('0xe')]('/',auth['isAuthenticated'](),controller[_0xdee1('0xf')]);router[_0xdee1('0x10')](_0xdee1('0xd'),auth[_0xdee1('0xa')](),controller[_0xdee1('0x11')]);router[_0xdee1('0x12')]('/:id',auth[_0xdee1('0xa')](),controller[_0xdee1('0x13')]);module[_0xdee1('0x14')]=router;
\ No newline at end of file
diff --git a/server/api/chatProactiveAction/chatProactiveAction.attributes.js b/server/api/chatProactiveAction/chatProactiveAction.attributes.js
index 1282354..512298b 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 _0x5d84=['STRING','sequelize','exports','ENUM','mouseOver'];(function(_0x166742,_0x55520c){var _0xb7814a=function(_0x18feaf){while(--_0x18feaf){_0x166742['push'](_0x166742['shift']());}};_0xb7814a(++_0x55520c);}(_0x5d84,0x18c));var _0x45d8=function(_0x39b07f,_0x4ef1dd){_0x39b07f=_0x39b07f-0x0;var _0xe5ae78=_0x5d84[_0x39b07f];return _0xe5ae78;};'use strict';var Sequelize=require(_0x45d8('0x0'));module[_0x45d8('0x1')]={'name':{'type':Sequelize['STRING'],'allowNull':![]},'type':{'type':Sequelize[_0x45d8('0x2')](_0x45d8('0x3'),'timeout'),'defaultValue':_0x45d8('0x3')},'selector':{'type':Sequelize[_0x45d8('0x4')]},'timeout':{'type':Sequelize['INTEGER']}};
\ No newline at end of file
+var _0xa367=['STRING','mouseOver','sequelize','exports'];(function(_0x4404ff,_0x13d7a9){var _0x5e7b19=function(_0x13847a){while(--_0x13847a){_0x4404ff['push'](_0x4404ff['shift']());}};_0x5e7b19(++_0x13d7a9);}(_0xa367,0x17e));var _0x7a36=function(_0x513aa5,_0x1fba79){_0x513aa5=_0x513aa5-0x0;var _0x1a1a7c=_0xa367[_0x513aa5];return _0x1a1a7c;};'use strict';var Sequelize=require(_0x7a36('0x0'));module[_0x7a36('0x1')]={'name':{'type':Sequelize[_0x7a36('0x2')],'allowNull':![]},'type':{'type':Sequelize['ENUM'](_0x7a36('0x3'),'timeout'),'defaultValue':_0x7a36('0x3')},'selector':{'type':Sequelize[_0x7a36('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 011587b..ad3e1f6 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 _0x98a7=['undefined','count','limit','status','Content-Range','apply','reject','save','then','destroy','error','stack','name','send','show','params','model','keys','ChatProactiveAction','query','intersection','fields','attributes','length','includeAll','include','merge','find','create','body','catch','update','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','to-csv','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','sendStatus','end','json','offset'];(function(_0x1b656b,_0x35013f){var _0xabcce7=function(_0x43ddc7){while(--_0x43ddc7){_0x1b656b['push'](_0x1b656b['shift']());}};_0xabcce7(++_0x35013f);}(_0x98a7,0x9e));var _0x798a=function(_0x149d1b,_0xff8b26){_0x149d1b=_0x149d1b-0x0;var _0x5717af=_0x98a7[_0x149d1b];return _0x5717af;};'use strict';var emlformat=require(_0x798a('0x0'));var rimraf=require(_0x798a('0x1'));var zipdir=require(_0x798a('0x2'));var jsonpatch=require(_0x798a('0x3'));var rp=require(_0x798a('0x4'));var moment=require(_0x798a('0x5'));var BPromise=require(_0x798a('0x6'));var Mustache=require('mustache');var util=require(_0x798a('0x7'));var path=require(_0x798a('0x8'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x798a('0x9'));var fs=require('fs');var fs_extra=require(_0x798a('0xa'));var _=require(_0x798a('0xb'));var squel=require(_0x798a('0xc'));var crypto=require(_0x798a('0xd'));var jsforce=require(_0x798a('0xe'));var deskjs=require(_0x798a('0xf'));var toCsv=require(_0x798a('0x10'));var querystring=require('querystring');var Papa=require(_0x798a('0x11'));var Redis=require(_0x798a('0x12'));var authService=require(_0x798a('0x13'));var qs=require(_0x798a('0x14'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x798a('0x15'));var logger=require(_0x798a('0x16'))(_0x798a('0x17'));var utils=require(_0x798a('0x18'));var config=require(_0x798a('0x19'));var licenseUtil=require(_0x798a('0x1a'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x261b1f,_0x526bd0){_0x526bd0=_0x526bd0||0xcc;return function(_0x223f87){if(_0x223f87){return _0x261b1f[_0x798a('0x1b')](_0x526bd0);}return _0x261b1f['status'](_0x526bd0)[_0x798a('0x1c')]();};}function respondWithResult(_0x3f96f6,_0x5b60ba){_0x5b60ba=_0x5b60ba||0xc8;return function(_0x343764){if(_0x343764){return _0x3f96f6['status'](_0x5b60ba)[_0x798a('0x1d')](_0x343764);}};}function respondWithFilteredResult(_0x1746d2,_0x34bfdb){return function(_0x1f5156){if(_0x1f5156){var _0x560366=typeof _0x34bfdb[_0x798a('0x1e')]===_0x798a('0x1f')&&typeof _0x34bfdb['limit']===_0x798a('0x1f');var _0x2529c9=_0x1f5156[_0x798a('0x20')];var _0x14ddc6=_0x560366?0x0:_0x34bfdb[_0x798a('0x1e')];var _0x11881d=_0x560366?_0x1f5156[_0x798a('0x20')]:_0x34bfdb[_0x798a('0x1e')]+_0x34bfdb[_0x798a('0x21')];var _0x4610f0;if(_0x11881d>=_0x2529c9){_0x11881d=_0x2529c9;_0x4610f0=0xc8;}else{_0x4610f0=0xce;}_0x1746d2[_0x798a('0x22')](_0x4610f0);return _0x1746d2['set'](_0x798a('0x23'),_0x14ddc6+'-'+_0x11881d+'/'+_0x2529c9)[_0x798a('0x1d')](_0x1f5156);}return null;};}function patchUpdates(_0x145295){return function(_0x4715e7){try{jsonpatch[_0x798a('0x24')](_0x4715e7,_0x145295,!![]);}catch(_0xfe15ae){return BPromise[_0x798a('0x25')](_0xfe15ae);}return _0x4715e7[_0x798a('0x26')]();};}function saveUpdates(_0x23e327,_0x2b103c){return function(_0x4c6e5e){if(_0x4c6e5e){return _0x4c6e5e['update'](_0x23e327)[_0x798a('0x27')](function(_0xcaf0df){return _0xcaf0df;});}return null;};}function removeEntity(_0x2bdfd7,_0x54d725){return function(_0x1c08ac){if(_0x1c08ac){return _0x1c08ac[_0x798a('0x28')]()[_0x798a('0x27')](function(){_0x2bdfd7['status'](0xcc)[_0x798a('0x1c')]();});}};}function handleEntityNotFound(_0x55460c,_0x56715e){return function(_0x294475){if(!_0x294475){_0x55460c[_0x798a('0x1b')](0x194);}return _0x294475;};}function handleError(_0x574571,_0x6b3a1d){_0x6b3a1d=_0x6b3a1d||0x1f4;return function(_0x145916){logger[_0x798a('0x29')](_0x145916[_0x798a('0x2a')]);if(_0x145916['name']){delete _0x145916[_0x798a('0x2b')];}_0x574571[_0x798a('0x22')](_0x6b3a1d)[_0x798a('0x2c')](_0x145916);};}exports[_0x798a('0x2d')]=function(_0x5ca780,_0x1f5a18){var _0x4674f6={'raw':!![],'where':{'id':_0x5ca780[_0x798a('0x2e')]['id']}},_0x2203ed={};_0x2203ed[_0x798a('0x2f')]=_[_0x798a('0x30')](db[_0x798a('0x31')]['rawAttributes']);_0x2203ed[_0x798a('0x32')]=_[_0x798a('0x30')](_0x5ca780[_0x798a('0x32')]);_0x2203ed['filters']=_[_0x798a('0x33')](_0x2203ed[_0x798a('0x2f')],_0x2203ed['query']);_0x4674f6['attributes']=_[_0x798a('0x33')](_0x2203ed['model'],qs['fields'](_0x5ca780[_0x798a('0x32')][_0x798a('0x34')]));_0x4674f6['attributes']=_0x4674f6[_0x798a('0x35')][_0x798a('0x36')]?_0x4674f6[_0x798a('0x35')]:_0x2203ed['model'];if(_0x5ca780[_0x798a('0x32')][_0x798a('0x37')]){_0x4674f6[_0x798a('0x38')]=[{'all':!![]}];}_0x4674f6=_[_0x798a('0x39')]({},_0x4674f6,_0x5ca780['options']);return db[_0x798a('0x31')][_0x798a('0x3a')](_0x4674f6)[_0x798a('0x27')](handleEntityNotFound(_0x1f5a18,null))['then'](respondWithResult(_0x1f5a18,null))['catch'](handleError(_0x1f5a18,null));};exports[_0x798a('0x3b')]=function(_0x5e5ccf,_0x11880c){return db[_0x798a('0x31')]['create'](_0x5e5ccf[_0x798a('0x3c')],{})[_0x798a('0x27')](respondWithResult(_0x11880c,0xc9))[_0x798a('0x3d')](handleError(_0x11880c,null));};exports[_0x798a('0x3e')]=function(_0x543dc3,_0x1bac0a){if(_0x543dc3[_0x798a('0x3c')]['id']){delete _0x543dc3[_0x798a('0x3c')]['id'];}return db['ChatProactiveAction'][_0x798a('0x3a')]({'where':{'id':_0x543dc3[_0x798a('0x2e')]['id']}})[_0x798a('0x27')](handleEntityNotFound(_0x1bac0a,null))[_0x798a('0x27')](saveUpdates(_0x543dc3[_0x798a('0x3c')],null))[_0x798a('0x27')](respondWithResult(_0x1bac0a,null))['catch'](handleError(_0x1bac0a,null));};exports['destroy']=function(_0x4850f1,_0x45babd){return db[_0x798a('0x31')]['find']({'where':{'id':_0x4850f1[_0x798a('0x2e')]['id']}})[_0x798a('0x27')](handleEntityNotFound(_0x45babd,null))['then'](removeEntity(_0x45babd,null))[_0x798a('0x3d')](handleError(_0x45babd,null));};
\ No newline at end of file
+var _0x8e0f=['reject','update','then','end','sendStatus','stack','name','show','params','model','keys','ChatProactiveAction','rawAttributes','query','intersection','fields','attributes','includeAll','merge','find','catch','create','body','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','sox','to-csv','fs-extra','lodash','squel','crypto','desk.js','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','status','json','offset','undefined','limit','count','set','Content-Range'];(function(_0x4af9b0,_0x14636d){var _0x149170=function(_0x150c2c){while(--_0x150c2c){_0x4af9b0['push'](_0x4af9b0['shift']());}};_0x149170(++_0x14636d);}(_0x8e0f,0x12f));var _0xf8e0=function(_0x477fc5,_0x4e984c){_0x477fc5=_0x477fc5-0x0;var _0x7f323d=_0x8e0f[_0x477fc5];return _0x7f323d;};'use strict';var emlformat=require(_0xf8e0('0x0'));var rimraf=require(_0xf8e0('0x1'));var zipdir=require(_0xf8e0('0x2'));var jsonpatch=require(_0xf8e0('0x3'));var rp=require(_0xf8e0('0x4'));var moment=require(_0xf8e0('0x5'));var BPromise=require(_0xf8e0('0x6'));var Mustache=require('mustache');var util=require(_0xf8e0('0x7'));var path=require('path');var sox=require(_0xf8e0('0x8'));var csv=require(_0xf8e0('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xf8e0('0xa'));var _=require(_0xf8e0('0xb'));var squel=require(_0xf8e0('0xc'));var crypto=require(_0xf8e0('0xd'));var jsforce=require('jsforce');var deskjs=require(_0xf8e0('0xe'));var toCsv=require(_0xf8e0('0x9'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0xf8e0('0xf'));var authService=require(_0xf8e0('0x10'));var qs=require(_0xf8e0('0x11'));var as=require(_0xf8e0('0x12'));var hardwareService=require(_0xf8e0('0x13'));var logger=require(_0xf8e0('0x14'))(_0xf8e0('0x15'));var utils=require(_0xf8e0('0x16'));var config=require(_0xf8e0('0x17'));var licenseUtil=require('../../config/license/util');var db=require(_0xf8e0('0x18'))['db'];function respondWithStatusCode(_0x113b45,_0x3edb60){_0x3edb60=_0x3edb60||0xcc;return function(_0x415601){if(_0x415601){return _0x113b45['sendStatus'](_0x3edb60);}return _0x113b45[_0xf8e0('0x19')](_0x3edb60)['end']();};}function respondWithResult(_0xea93ae,_0x443445){_0x443445=_0x443445||0xc8;return function(_0x321785){if(_0x321785){return _0xea93ae['status'](_0x443445)[_0xf8e0('0x1a')](_0x321785);}};}function respondWithFilteredResult(_0x534844,_0x151990){return function(_0x4de3de){if(_0x4de3de){var _0x430b06=typeof _0x151990[_0xf8e0('0x1b')]===_0xf8e0('0x1c')&&typeof _0x151990[_0xf8e0('0x1d')]===_0xf8e0('0x1c');var _0x49e649=_0x4de3de[_0xf8e0('0x1e')];var _0x54ee7c=_0x430b06?0x0:_0x151990[_0xf8e0('0x1b')];var _0x13a29b=_0x430b06?_0x4de3de[_0xf8e0('0x1e')]:_0x151990[_0xf8e0('0x1b')]+_0x151990['limit'];var _0x592936;if(_0x13a29b>=_0x49e649){_0x13a29b=_0x49e649;_0x592936=0xc8;}else{_0x592936=0xce;}_0x534844[_0xf8e0('0x19')](_0x592936);return _0x534844[_0xf8e0('0x1f')](_0xf8e0('0x20'),_0x54ee7c+'-'+_0x13a29b+'/'+_0x49e649)[_0xf8e0('0x1a')](_0x4de3de);}return null;};}function patchUpdates(_0x5e5ad6){return function(_0x21831e){try{jsonpatch['apply'](_0x21831e,_0x5e5ad6,!![]);}catch(_0xd533d){return BPromise[_0xf8e0('0x21')](_0xd533d);}return _0x21831e['save']();};}function saveUpdates(_0x2e3826,_0x1b7c3c){return function(_0x2f844a){if(_0x2f844a){return _0x2f844a[_0xf8e0('0x22')](_0x2e3826)['then'](function(_0x47d885){return _0x47d885;});}return null;};}function removeEntity(_0x8d9993,_0x4cb871){return function(_0x4d5255){if(_0x4d5255){return _0x4d5255['destroy']()[_0xf8e0('0x23')](function(){_0x8d9993[_0xf8e0('0x19')](0xcc)[_0xf8e0('0x24')]();});}};}function handleEntityNotFound(_0x420309,_0x212df8){return function(_0x29b52d){if(!_0x29b52d){_0x420309[_0xf8e0('0x25')](0x194);}return _0x29b52d;};}function handleError(_0x512bb7,_0x26494f){_0x26494f=_0x26494f||0x1f4;return function(_0x1bcaf6){logger['error'](_0x1bcaf6[_0xf8e0('0x26')]);if(_0x1bcaf6[_0xf8e0('0x27')]){delete _0x1bcaf6[_0xf8e0('0x27')];}_0x512bb7[_0xf8e0('0x19')](_0x26494f)['send'](_0x1bcaf6);};}exports[_0xf8e0('0x28')]=function(_0x517f2f,_0x4ec8df){var _0xb1baa7={'raw':!![],'where':{'id':_0x517f2f[_0xf8e0('0x29')]['id']}},_0x327e5f={};_0x327e5f[_0xf8e0('0x2a')]=_[_0xf8e0('0x2b')](db[_0xf8e0('0x2c')][_0xf8e0('0x2d')]);_0x327e5f[_0xf8e0('0x2e')]=_[_0xf8e0('0x2b')](_0x517f2f[_0xf8e0('0x2e')]);_0x327e5f['filters']=_[_0xf8e0('0x2f')](_0x327e5f[_0xf8e0('0x2a')],_0x327e5f[_0xf8e0('0x2e')]);_0xb1baa7['attributes']=_[_0xf8e0('0x2f')](_0x327e5f['model'],qs[_0xf8e0('0x30')](_0x517f2f[_0xf8e0('0x2e')]['fields']));_0xb1baa7[_0xf8e0('0x31')]=_0xb1baa7[_0xf8e0('0x31')]['length']?_0xb1baa7[_0xf8e0('0x31')]:_0x327e5f[_0xf8e0('0x2a')];if(_0x517f2f['query'][_0xf8e0('0x32')]){_0xb1baa7['include']=[{'all':!![]}];}_0xb1baa7=_[_0xf8e0('0x33')]({},_0xb1baa7,_0x517f2f['options']);return db['ChatProactiveAction'][_0xf8e0('0x34')](_0xb1baa7)[_0xf8e0('0x23')](handleEntityNotFound(_0x4ec8df,null))[_0xf8e0('0x23')](respondWithResult(_0x4ec8df,null))[_0xf8e0('0x35')](handleError(_0x4ec8df,null));};exports[_0xf8e0('0x36')]=function(_0x40d9f6,_0x306096){return db[_0xf8e0('0x2c')][_0xf8e0('0x36')](_0x40d9f6[_0xf8e0('0x37')],{})[_0xf8e0('0x23')](respondWithResult(_0x306096,0xc9))[_0xf8e0('0x35')](handleError(_0x306096,null));};exports[_0xf8e0('0x22')]=function(_0x5431dc,_0x2266b0){if(_0x5431dc[_0xf8e0('0x37')]['id']){delete _0x5431dc['body']['id'];}return db['ChatProactiveAction'][_0xf8e0('0x34')]({'where':{'id':_0x5431dc['params']['id']}})['then'](handleEntityNotFound(_0x2266b0,null))[_0xf8e0('0x23')](saveUpdates(_0x5431dc[_0xf8e0('0x37')],null))[_0xf8e0('0x23')](respondWithResult(_0x2266b0,null))[_0xf8e0('0x35')](handleError(_0x2266b0,null));};exports['destroy']=function(_0x1423ab,_0x46e476){return db[_0xf8e0('0x2c')][_0xf8e0('0x34')]({'where':{'id':_0x1423ab[_0xf8e0('0x29')]['id']}})['then'](handleEntityNotFound(_0x46e476,null))[_0xf8e0('0x23')](removeEntity(_0x46e476,null))[_0xf8e0('0x35')](handleError(_0x46e476,null));};
\ No newline at end of file
diff --git a/server/api/chatProactiveAction/chatProactiveAction.model.js b/server/api/chatProactiveAction/chatProactiveAction.model.js
index 5ad7ef2..fa0534b 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 _0x0982=['request-promise','path','../../config/environment','./chatProactiveAction.attributes','exports','define','ChatProactiveAction','../../config/logger','moment','bluebird'];(function(_0x265184,_0x577b2f){var _0x86b9f6=function(_0x700462){while(--_0x700462){_0x265184['push'](_0x265184['shift']());}};_0x86b9f6(++_0x577b2f);}(_0x0982,0xa7));var _0x2098=function(_0x5a2c7e,_0x2a82b5){_0x5a2c7e=_0x5a2c7e-0x0;var _0x539a11=_0x0982[_0x5a2c7e];return _0x539a11;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x2098('0x0'))('api');var moment=require(_0x2098('0x1'));var BPromise=require(_0x2098('0x2'));var rp=require(_0x2098('0x3'));var fs=require('fs');var path=require(_0x2098('0x4'));var rimraf=require('rimraf');var config=require(_0x2098('0x5'));var attributes=require(_0x2098('0x6'));module[_0x2098('0x7')]=function(_0x2501fe,_0x2edf62){return _0x2501fe[_0x2098('0x8')](_0x2098('0x9'),attributes,{'tableName':'chat_proactive_actions','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xa50f=['lodash','util','../../config/logger','api','moment','bluebird','path','rimraf','../../config/environment','./chatProactiveAction.attributes','exports','define','ChatProactiveAction','chat_proactive_actions'];(function(_0x7d58ca,_0x3d7e04){var _0x3a5c58=function(_0x3a7c68){while(--_0x3a7c68){_0x7d58ca['push'](_0x7d58ca['shift']());}};_0x3a5c58(++_0x3d7e04);}(_0xa50f,0x16c));var _0xfa50=function(_0x138adb,_0x193fee){_0x138adb=_0x138adb-0x0;var _0x1b27f2=_0xa50f[_0x138adb];return _0x1b27f2;};'use strict';var _=require(_0xfa50('0x0'));var util=require(_0xfa50('0x1'));var logger=require(_0xfa50('0x2'))(_0xfa50('0x3'));var moment=require(_0xfa50('0x4'));var BPromise=require(_0xfa50('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xfa50('0x6'));var rimraf=require(_0xfa50('0x7'));var config=require(_0xfa50('0x8'));var attributes=require(_0xfa50('0x9'));module[_0xfa50('0xa')]=function(_0x4ac65b,_0x5b9027){return _0x4ac65b[_0xfa50('0xb')](_0xfa50('0xc'),attributes,{'tableName':_0xfa50('0xd'),'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 f5e1dbf..06e4b89 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 _0xde23=['error','code','message','request\x20sent','catch','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','request','then','info','ChatProactiveAction,\x20%s,\x20%s'];(function(_0x502c7d,_0x2f1285){var _0x30b7ed=function(_0x2d92f3){while(--_0x2d92f3){_0x502c7d['push'](_0x502c7d['shift']());}};_0x30b7ed(++_0x2f1285);}(_0xde23,0x16d));var _0x3de2=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0xde23[_0x14add3];return _0x4a174f;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x3de2('0x0'));var BPromise=require('bluebird');var rs=require(_0x3de2('0x1'));var fs=require('fs');var Redis=require(_0x3de2('0x2'));var db=require(_0x3de2('0x3'))['db'];var utils=require(_0x3de2('0x4'));var logger=require(_0x3de2('0x5'))('rpc');var config=require(_0x3de2('0x6'));var jayson=require(_0x3de2('0x7'));var client=jayson[_0x3de2('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x3437eb,_0x1aaddd,_0x4c747b){return new BPromise(function(_0x1b2f1c,_0x58d302){return client[_0x3de2('0x9')](_0x3437eb,_0x4c747b)[_0x3de2('0xa')](function(_0x427c17){logger[_0x3de2('0xb')](_0x3de2('0xc'),_0x1aaddd,'request\x20sent');logger['debug']('ChatProactiveAction,\x20%s,\x20%s,\x20%s',_0x1aaddd,'request\x20sent',JSON['stringify'](_0x427c17));if(_0x427c17['error']){if(_0x427c17[_0x3de2('0xd')][_0x3de2('0xe')]===0x1f4){logger[_0x3de2('0xd')](_0x3de2('0xc'),_0x1aaddd,_0x427c17[_0x3de2('0xd')][_0x3de2('0xf')]);return _0x58d302(_0x427c17['error']['message']);}logger[_0x3de2('0xd')](_0x3de2('0xc'),_0x1aaddd,_0x427c17['error']['message']);return _0x1b2f1c(_0x427c17['error'][_0x3de2('0xf')]);}else{logger['info'](_0x3de2('0xc'),_0x1aaddd,_0x3de2('0x10'));_0x1b2f1c(_0x427c17['result'][_0x3de2('0xf')]);}})[_0x3de2('0x11')](function(_0x2b4f03){logger[_0x3de2('0xd')](_0x3de2('0xc'),_0x1aaddd,_0x2b4f03);_0x58d302(_0x2b4f03);});});}
\ No newline at end of file
+var _0x7b9a=['info','ChatProactiveAction,\x20%s,\x20%s','request\x20sent','debug','ChatProactiveAction,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','lodash','util','randomstring','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','http','request','then'];(function(_0x2abb3f,_0x7cfad8){var _0x174b28=function(_0x3bc2b9){while(--_0x3bc2b9){_0x2abb3f['push'](_0x2abb3f['shift']());}};_0x174b28(++_0x7cfad8);}(_0x7b9a,0x9d));var _0xa7b9=function(_0x581b13,_0x10c820){_0x581b13=_0x581b13-0x0;var _0x516bdb=_0x7b9a[_0x581b13];return _0x516bdb;};'use strict';var _=require(_0xa7b9('0x0'));var util=require(_0xa7b9('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0xa7b9('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xa7b9('0x3'))['db'];var utils=require(_0xa7b9('0x4'));var logger=require('../../config/logger')(_0xa7b9('0x5'));var config=require(_0xa7b9('0x6'));var jayson=require(_0xa7b9('0x7'));var client=jayson['client'][_0xa7b9('0x8')]({'port':0x232a});function respondWithRpcPromise(_0xa2e60e,_0x943364,_0x16dd7a){return new BPromise(function(_0x554730,_0x4a5394){return client[_0xa7b9('0x9')](_0xa2e60e,_0x16dd7a)[_0xa7b9('0xa')](function(_0x314db6){logger[_0xa7b9('0xb')](_0xa7b9('0xc'),_0x943364,_0xa7b9('0xd'));logger[_0xa7b9('0xe')](_0xa7b9('0xf'),_0x943364,_0xa7b9('0xd'),JSON[_0xa7b9('0x10')](_0x314db6));if(_0x314db6[_0xa7b9('0x11')]){if(_0x314db6['error'][_0xa7b9('0x12')]===0x1f4){logger['error'](_0xa7b9('0xc'),_0x943364,_0x314db6[_0xa7b9('0x11')][_0xa7b9('0x13')]);return _0x4a5394(_0x314db6[_0xa7b9('0x11')][_0xa7b9('0x13')]);}logger[_0xa7b9('0x11')](_0xa7b9('0xc'),_0x943364,_0x314db6[_0xa7b9('0x11')][_0xa7b9('0x13')]);return _0x554730(_0x314db6[_0xa7b9('0x11')]['message']);}else{logger[_0xa7b9('0xb')](_0xa7b9('0xc'),_0x943364,_0xa7b9('0xd'));_0x554730(_0x314db6['result'][_0xa7b9('0x13')]);}})[_0xa7b9('0x14')](function(_0x885f58){logger['error'](_0xa7b9('0xc'),_0x943364,_0x885f58);_0x4a5394(_0x885f58);});});}
\ No newline at end of file
diff --git a/server/api/chatProactiveAction/index.js b/server/api/chatProactiveAction/index.js
index b6bfc32..658da2d 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(_0x348c7c,_0x466bea){var _0x4e4f67=function(_0x4a02e7){while(--_0x4a02e7){_0x348c7c['push'](_0x348c7c['shift']());}};_0x4e4f67(++_0x466bea);}(_0x53ec,0x192));var _0xc53e=function(_0x39d024,_0x5c5797){_0x39d024=_0x39d024-0x0;var _0x311bdd=_0x53ec[_0x39d024];return _0x311bdd;};'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 _0x5fd1=['../../components/auth/service','../../components/interaction/service','../../config/environment','get','/:id','isAuthenticated','show','post','create','put','update','multer','path','connect-timeout','express'];(function(_0xea43a9,_0x458694){var _0xa7f5f7=function(_0x5000e5){while(--_0x5000e5){_0xea43a9['push'](_0xea43a9['shift']());}};_0xa7f5f7(++_0x458694);}(_0x5fd1,0x155));var _0x15fd=function(_0x44e7e1,_0x4d8afb){_0x44e7e1=_0x44e7e1-0x0;var _0x4b8344=_0x5fd1[_0x44e7e1];return _0x4b8344;};'use strict';var multer=require(_0x15fd('0x0'));var util=require('util');var path=require(_0x15fd('0x1'));var timeout=require(_0x15fd('0x2'));var express=require(_0x15fd('0x3'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0x15fd('0x4'));var interaction=require(_0x15fd('0x5'));var config=require(_0x15fd('0x6'));var controller=require('./chatProactiveAction.controller');router[_0x15fd('0x7')](_0x15fd('0x8'),auth[_0x15fd('0x9')](),controller[_0x15fd('0xa')]);router[_0x15fd('0xb')]('/',auth['isAuthenticated'](),controller[_0x15fd('0xc')]);router[_0x15fd('0xd')](_0x15fd('0x8'),auth['isAuthenticated'](),controller[_0x15fd('0xe')]);router['delete'](_0x15fd('0x8'),auth[_0x15fd('0x9')](),controller['destroy']);module['exports']=router;
\ No newline at end of file
diff --git a/server/api/chatQueue/chatQueue.attributes.js b/server/api/chatQueue/chatQueue.attributes.js
index 805a1c6..c4734af 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 _0x0ac4=['roundrobin','name','INTEGER','beepall'];(function(_0x5a70c6,_0x2e6807){var _0xbfc6fb=function(_0x23cedd){while(--_0x23cedd){_0x5a70c6['push'](_0x5a70c6['shift']());}};_0xbfc6fb(++_0x2e6807);}(_0x0ac4,0x1b9));var _0x40ac=function(_0x264b9b,_0xa1181e){_0x264b9b=_0x264b9b-0x0;var _0x4c7a0e=_0x0ac4[_0x264b9b];return _0x4c7a0e;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize['STRING'],'unique':_0x40ac('0x0'),'allowNull':![],'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize['STRING']},'timeout':{'type':Sequelize[_0x40ac('0x1')],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize['ENUM']('rrmemory',_0x40ac('0x2'),_0x40ac('0x3'))}};
\ No newline at end of file
+var _0x675d=['rrmemory','beepall','sequelize','exports','STRING','name','INTEGER','ENUM'];(function(_0x4206f5,_0x21f338){var _0xa29cf3=function(_0x2d35d7){while(--_0x2d35d7){_0x4206f5['push'](_0x4206f5['shift']());}};_0xa29cf3(++_0x21f338);}(_0x675d,0x7a));var _0xd675=function(_0x50d96f,_0x569d24){_0x50d96f=_0x50d96f-0x0;var _0xc45799=_0x675d[_0x50d96f];return _0xc45799;};'use strict';var Sequelize=require(_0xd675('0x0'));module[_0xd675('0x1')]={'name':{'type':Sequelize[_0xd675('0x2')],'unique':_0xd675('0x3'),'allowNull':![],'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize[_0xd675('0x2')]},'timeout':{'type':Sequelize[_0xd675('0x4')],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0xd675('0x5')](_0xd675('0x6'),_0xd675('0x7'),'roundrobin')}};
\ No newline at end of file
diff --git a/server/api/chatQueue/chatQueue.controller.js b/server/api/chatQueue/chatQueue.controller.js
index 175a814..903e85b 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 _0x4112=['userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','params','describe','getMembers','UserChatQueue','nolimit','findAll','User','findAndCountAll','UserId','agent','chatPause','updatedAt','createdAt','rows','format','%s/%s','getTeams','Team','order','addTeams','ids','Agents','online','voicePause','interface','sequelize','transaction','each','findOrCreate','forEach','emit','userChatQueue:save','removeTeams','select','field','tq.TeamId','team_has_chat_queues','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','ChatQueueId\x20=\x20?','clone','ut.UserId\x20=\x20?','push','toString','QueryTypes','every','TeamId','all','union','compact','value','userChatQueue:remove','omit','spread','removeAgents','isArray','findOne','getAgents','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','ejs','fs-extra','lodash','squel','crypto','desk.js','to-csv','querystring','ioredis','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./chatQueue.socket','register','client','then','info','ChatQueue,\x20%s,\x20%s','request\x20sent','debug','error','code','message','result','catch','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','save','update','destroy','get','UserProfileResource','stack','name','send','index','map','ChatQueue','rawAttributes','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','show','find','create','Unable\x20to\x20retrieve\x20the\x20current\x20user','user','ChatQueues','UserProfileSection'];(function(_0xea8947,_0x1b573d){var _0x2455e9=function(_0x18771e){while(--_0x18771e){_0xea8947['push'](_0xea8947['shift']());}};_0x2455e9(++_0x1b573d);}(_0x4112,0xd6));var _0x2411=function(_0x2e2ec3,_0x19ee9b){_0x2e2ec3=_0x2e2ec3-0x0;var _0x5f4db4=_0x4112[_0x2e2ec3];return _0x5f4db4;};'use strict';var emlformat=require(_0x2411('0x0'));var rimraf=require(_0x2411('0x1'));var zipdir=require(_0x2411('0x2'));var jsonpatch=require(_0x2411('0x3'));var rp=require(_0x2411('0x4'));var moment=require(_0x2411('0x5'));var BPromise=require('bluebird');var Mustache=require(_0x2411('0x6'));var util=require(_0x2411('0x7'));var path=require(_0x2411('0x8'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x2411('0x9'));var fs=require('fs');var fs_extra=require(_0x2411('0xa'));var _=require(_0x2411('0xb'));var squel=require(_0x2411('0xc'));var crypto=require(_0x2411('0xd'));var jsforce=require('jsforce');var deskjs=require(_0x2411('0xe'));var toCsv=require(_0x2411('0xf'));var querystring=require(_0x2411('0x10'));var Papa=require('papaparse');var Redis=require(_0x2411('0x11'));var authService=require('../../components/auth/service');var qs=require(_0x2411('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x2411('0x13'));var logger=require(_0x2411('0x14'))(_0x2411('0x15'));var utils=require(_0x2411('0x16'));var config=require(_0x2411('0x17'));var licenseUtil=require('../../config/license/util');var db=require(_0x2411('0x18'))['db'];config[_0x2411('0x19')]=_[_0x2411('0x1a')](config[_0x2411('0x19')],{'host':_0x2411('0x1b'),'port':0x18eb});var socket=require(_0x2411('0x1c'))(new Redis(config[_0x2411('0x19')]));require(_0x2411('0x1d'))[_0x2411('0x1e')](socket);var jayson=require('jayson/promise');var client=jayson[_0x2411('0x1f')]['http']({'port':0x232a});function respondWithRpcPromise(_0x45b41c,_0x25f000,_0x4f96e3,_0x21b82e){return new BPromise(function(_0x2765f6,_0x195efe){var _0x5c8b67=_0x21b82e||client;return _0x5c8b67['request'](_0x45b41c,_0x4f96e3)[_0x2411('0x20')](function(_0x5e3795){logger[_0x2411('0x21')](_0x2411('0x22'),_0x25f000,_0x2411('0x23'));logger[_0x2411('0x24')]('ChatQueue,\x20%s,\x20%s,\x20%s',_0x25f000,_0x2411('0x23'),JSON['stringify'](_0x5e3795));if(_0x5e3795['error']){if(_0x5e3795[_0x2411('0x25')][_0x2411('0x26')]===0x1f4){logger[_0x2411('0x25')](_0x2411('0x22'),_0x25f000,_0x5e3795[_0x2411('0x25')][_0x2411('0x27')]);return _0x195efe(_0x5e3795['error'][_0x2411('0x27')]);}logger[_0x2411('0x25')](_0x2411('0x22'),_0x25f000,_0x5e3795[_0x2411('0x25')][_0x2411('0x27')]);return _0x2765f6(_0x5e3795['error'][_0x2411('0x27')]);}else{logger['info']('ChatQueue,\x20%s,\x20%s',_0x25f000,'request\x20sent');_0x2765f6(_0x5e3795[_0x2411('0x28')][_0x2411('0x27')]);}})[_0x2411('0x29')](function(_0x92d66a){logger['error']('ChatQueue,\x20%s,\x20%s',_0x25f000,_0x92d66a);_0x195efe(_0x92d66a);});});}function respondWithStatusCode(_0x5ef5e3,_0x346eb4){_0x346eb4=_0x346eb4||0xcc;return function(_0x4075ca){if(_0x4075ca){return _0x5ef5e3[_0x2411('0x2a')](_0x346eb4);}return _0x5ef5e3[_0x2411('0x2b')](_0x346eb4)[_0x2411('0x2c')]();};}function respondWithResult(_0x5a60d4,_0x17ccbf){_0x17ccbf=_0x17ccbf||0xc8;return function(_0x51a377){if(_0x51a377){return _0x5a60d4['status'](_0x17ccbf)[_0x2411('0x2d')](_0x51a377);}};}function respondWithFilteredResult(_0x3be135,_0x598c63){return function(_0x1cc07b){if(_0x1cc07b){var _0x53663e=typeof _0x598c63[_0x2411('0x2e')]===_0x2411('0x2f')&&typeof _0x598c63[_0x2411('0x30')]===_0x2411('0x2f');var _0x265f8f=_0x1cc07b[_0x2411('0x31')];var _0x5e5a7c=_0x53663e?0x0:_0x598c63[_0x2411('0x2e')];var _0x43f578=_0x53663e?_0x1cc07b[_0x2411('0x31')]:_0x598c63[_0x2411('0x2e')]+_0x598c63[_0x2411('0x30')];var _0x45664f;if(_0x43f578>=_0x265f8f){_0x43f578=_0x265f8f;_0x45664f=0xc8;}else{_0x45664f=0xce;}_0x3be135['status'](_0x45664f);return _0x3be135[_0x2411('0x32')](_0x2411('0x33'),_0x5e5a7c+'-'+_0x43f578+'/'+_0x265f8f)[_0x2411('0x2d')](_0x1cc07b);}return null;};}function patchUpdates(_0x4b4cab){return function(_0xac8eb6){try{jsonpatch[_0x2411('0x34')](_0xac8eb6,_0x4b4cab,!![]);}catch(_0x545147){return BPromise['reject'](_0x545147);}return _0xac8eb6[_0x2411('0x35')]();};}function saveUpdates(_0x2ffa76,_0xfe257c){return function(_0x373b85){if(_0x373b85){return _0x373b85[_0x2411('0x36')](_0x2ffa76)['then'](function(_0x3b983d){return _0x3b983d;});}return null;};}function removeEntity(_0x304a02,_0x3f53da){return function(_0x2ed81f){if(_0x2ed81f){return _0x2ed81f[_0x2411('0x37')]()[_0x2411('0x20')](function(){var _0x4fca70=_0x2ed81f[_0x2411('0x38')]({'plain':!![]});var _0x3ea38a='ChatQueues';return db[_0x2411('0x39')]['destroy']({'where':{'type':_0x3ea38a,'resourceId':_0x4fca70['id']}})[_0x2411('0x20')](function(){return _0x2ed81f;});})[_0x2411('0x20')](function(){_0x304a02['status'](0xcc)[_0x2411('0x2c')]();});}};}function handleEntityNotFound(_0x41b66c,_0x20c64d){return function(_0x53d089){if(!_0x53d089){_0x41b66c[_0x2411('0x2a')](0x194);}return _0x53d089;};}function handleError(_0x343142,_0x9fee2a){_0x9fee2a=_0x9fee2a||0x1f4;return function(_0x2bb229){logger[_0x2411('0x25')](_0x2bb229[_0x2411('0x3a')]);if(_0x2bb229[_0x2411('0x3b')]){delete _0x2bb229[_0x2411('0x3b')];}_0x343142[_0x2411('0x2b')](_0x9fee2a)[_0x2411('0x3c')](_0x2bb229);};}exports[_0x2411('0x3d')]=function(_0x2dfb7c,_0x56ad97){var _0x545b19={},_0x110f1f={},_0x1af7ae={'count':0x0,'rows':[]};var _0x1c13c0=_[_0x2411('0x3e')](db[_0x2411('0x3f')][_0x2411('0x40')],function(_0xe21d9){return{'name':_0xe21d9['fieldName'],'type':_0xe21d9[_0x2411('0x41')][_0x2411('0x42')]};});_0x110f1f[_0x2411('0x43')]=_[_0x2411('0x3e')](_0x1c13c0,'name');_0x110f1f[_0x2411('0x44')]=_[_0x2411('0x45')](_0x2dfb7c[_0x2411('0x44')]);_0x110f1f[_0x2411('0x46')]=_[_0x2411('0x47')](_0x110f1f['model'],_0x110f1f[_0x2411('0x44')]);_0x545b19[_0x2411('0x48')]=_[_0x2411('0x47')](_0x110f1f[_0x2411('0x43')],qs[_0x2411('0x49')](_0x2dfb7c[_0x2411('0x44')]['fields']));_0x545b19['attributes']=_0x545b19[_0x2411('0x48')][_0x2411('0x4a')]?_0x545b19[_0x2411('0x48')]:_0x110f1f['model'];if(!_0x2dfb7c[_0x2411('0x44')][_0x2411('0x4b')]('nolimit')){_0x545b19[_0x2411('0x30')]=qs[_0x2411('0x30')](_0x2dfb7c[_0x2411('0x44')][_0x2411('0x30')]);_0x545b19[_0x2411('0x2e')]=qs[_0x2411('0x2e')](_0x2dfb7c[_0x2411('0x44')][_0x2411('0x2e')]);}_0x545b19['order']=qs['sort'](_0x2dfb7c[_0x2411('0x44')][_0x2411('0x4c')]);_0x545b19[_0x2411('0x4d')]=qs[_0x2411('0x46')](_[_0x2411('0x4e')](_0x2dfb7c['query'],_0x110f1f[_0x2411('0x46')]),_0x1c13c0);if(_0x2dfb7c[_0x2411('0x44')][_0x2411('0x4f')]){_0x545b19[_0x2411('0x4d')]=_[_0x2411('0x50')](_0x545b19['where'],{'$or':_['map'](_0x1c13c0,function(_0x4e7d6f){if(_0x4e7d6f[_0x2411('0x41')]!==_0x2411('0x51')){var _0x3cedb2={};_0x3cedb2[_0x4e7d6f[_0x2411('0x3b')]]={'$like':'%'+_0x2dfb7c[_0x2411('0x44')][_0x2411('0x4f')]+'%'};return _0x3cedb2;}})});}_0x545b19=_[_0x2411('0x50')]({},_0x545b19,_0x2dfb7c[_0x2411('0x52')]);var _0x442960={'where':_0x545b19['where']};return db[_0x2411('0x3f')][_0x2411('0x31')](_0x442960)[_0x2411('0x20')](function(_0x2fee29){_0x1af7ae[_0x2411('0x31')]=_0x2fee29;if(_0x2dfb7c[_0x2411('0x44')][_0x2411('0x53')]){_0x545b19[_0x2411('0x54')]=[{'all':!![]}];}return db['ChatQueue']['findAll'](_0x545b19);})[_0x2411('0x20')](function(_0x3b7324){_0x1af7ae['rows']=_0x3b7324;return _0x1af7ae;})[_0x2411('0x20')](respondWithFilteredResult(_0x56ad97,_0x545b19))[_0x2411('0x29')](handleError(_0x56ad97,null));};exports[_0x2411('0x55')]=function(_0x124816,_0x118d3e){var _0x557e0a={'raw':!![],'where':{'id':_0x124816['params']['id']}},_0x8d5b21={};_0x8d5b21['model']=_[_0x2411('0x45')](db[_0x2411('0x3f')]['rawAttributes']);_0x8d5b21[_0x2411('0x44')]=_[_0x2411('0x45')](_0x124816[_0x2411('0x44')]);_0x8d5b21[_0x2411('0x46')]=_[_0x2411('0x47')](_0x8d5b21['model'],_0x8d5b21[_0x2411('0x44')]);_0x557e0a['attributes']=_[_0x2411('0x47')](_0x8d5b21['model'],qs['fields'](_0x124816['query']['fields']));_0x557e0a[_0x2411('0x48')]=_0x557e0a[_0x2411('0x48')][_0x2411('0x4a')]?_0x557e0a[_0x2411('0x48')]:_0x8d5b21['model'];if(_0x124816['query']['includeAll']){_0x557e0a['include']=[{'all':!![]}];}_0x557e0a=_[_0x2411('0x50')]({},_0x557e0a,_0x124816[_0x2411('0x52')]);return db[_0x2411('0x3f')][_0x2411('0x56')](_0x557e0a)[_0x2411('0x20')](handleEntityNotFound(_0x118d3e,null))[_0x2411('0x20')](respondWithResult(_0x118d3e,null))[_0x2411('0x29')](handleError(_0x118d3e,null));};exports[_0x2411('0x57')]=function(_0x232eb2,_0x38c2d2){return db[_0x2411('0x3f')]['create'](_0x232eb2['body'],{})[_0x2411('0x20')](function(_0x435cb8){var _0x411296=_0x232eb2['user']['get']({'plain':!![]});if(!_0x411296)throw new Error(_0x2411('0x58'));if(_0x411296['role']===_0x2411('0x59')){var _0x12f591=_0x435cb8[_0x2411('0x38')]({'plain':!![]});var _0x288ed7=_0x2411('0x5a');return db[_0x2411('0x5b')]['find']({'where':{'name':_0x288ed7,'userProfileId':_0x411296[_0x2411('0x5c')]},'raw':!![]})[_0x2411('0x20')](function(_0x397dfe){if(_0x397dfe&&_0x397dfe['autoAssociation']===0x0){return db[_0x2411('0x39')]['create']({'name':_0x12f591[_0x2411('0x3b')],'resourceId':_0x12f591['id'],'type':_0x397dfe[_0x2411('0x3b')],'sectionId':_0x397dfe['id']},{})[_0x2411('0x20')](function(){return _0x435cb8;});}else{return _0x435cb8;}})[_0x2411('0x29')](function(_0x1429bc){logger[_0x2411('0x25')](_0x2411('0x5d'),_0x1429bc);throw _0x1429bc;});}return _0x435cb8;})[_0x2411('0x20')](respondWithResult(_0x38c2d2,0xc9))[_0x2411('0x29')](handleError(_0x38c2d2,null));};exports['update']=function(_0x3fc42d,_0x278e90){if(_0x3fc42d[_0x2411('0x5e')]['id']){delete _0x3fc42d['body']['id'];}return db[_0x2411('0x3f')][_0x2411('0x56')]({'where':{'id':_0x3fc42d[_0x2411('0x5f')]['id']}})[_0x2411('0x20')](handleEntityNotFound(_0x278e90,null))[_0x2411('0x20')](saveUpdates(_0x3fc42d['body'],null))[_0x2411('0x20')](respondWithResult(_0x278e90,null))[_0x2411('0x29')](handleError(_0x278e90,null));};exports[_0x2411('0x37')]=function(_0x1cb32d,_0x4856fc){return db[_0x2411('0x3f')][_0x2411('0x56')]({'where':{'id':_0x1cb32d['params']['id']}})['then'](handleEntityNotFound(_0x4856fc,null))['then'](removeEntity(_0x4856fc,null))[_0x2411('0x29')](handleError(_0x4856fc,null));};exports[_0x2411('0x60')]=function(_0x4ca85a,_0x245eb9){return db[_0x2411('0x3f')]['describe']()[_0x2411('0x20')](respondWithResult(_0x245eb9,null))[_0x2411('0x29')](handleError(_0x245eb9,null));};exports[_0x2411('0x61')]=function(_0x348778,_0x497496,_0x4a4677){var _0x27d2df={'raw':!![],'where':{}},_0x52cb3b={},_0x145f08;return db['ChatQueue']['findOne']({'where':{'id':_0x348778[_0x2411('0x5f')]['id']}})[_0x2411('0x20')](handleEntityNotFound(_0x497496,null))[_0x2411('0x20')](function(_0x3a826e){if(_0x3a826e){_0x145f08=_0x3a826e['get']({'plain':!![]});_0x52cb3b[_0x2411('0x43')]=_[_0x2411('0x45')](db[_0x2411('0x62')]['rawAttributes']);_0x52cb3b[_0x2411('0x44')]=_[_0x2411('0x45')](_0x348778[_0x2411('0x44')]);_0x52cb3b[_0x2411('0x46')]=_['intersection'](_0x52cb3b[_0x2411('0x43')],_0x52cb3b[_0x2411('0x44')]);_0x27d2df[_0x2411('0x48')]=_['intersection'](_0x52cb3b[_0x2411('0x43')],qs[_0x2411('0x49')](_0x348778['query'][_0x2411('0x49')]));_0x27d2df[_0x2411('0x48')]=_0x27d2df[_0x2411('0x48')]['length']?_0x27d2df['attributes']:_0x52cb3b['model'];if(!_0x348778[_0x2411('0x44')][_0x2411('0x4b')](_0x2411('0x63'))){_0x27d2df[_0x2411('0x30')]=qs[_0x2411('0x30')](_0x348778[_0x2411('0x44')][_0x2411('0x30')]);_0x27d2df[_0x2411('0x2e')]=qs[_0x2411('0x2e')](_0x348778[_0x2411('0x44')][_0x2411('0x2e')]);}_0x27d2df['order']=qs['sort'](_0x348778[_0x2411('0x44')]['sort']);_0x27d2df['where']=qs['filters'](_[_0x2411('0x4e')](_0x348778['query'],_0x52cb3b[_0x2411('0x46')]));_0x27d2df[_0x2411('0x4d')]['ChatQueueId']=_0x3a826e['id'];if(_0x348778[_0x2411('0x44')]['filter']){_0x27d2df[_0x2411('0x4d')]=_[_0x2411('0x50')](_0x27d2df[_0x2411('0x4d')],{'$or':_[_0x2411('0x3e')](_0x27d2df[_0x2411('0x48')],function(_0x147f59){var _0x2819f0={};_0x2819f0[_0x147f59]={'$like':'%'+_0x348778[_0x2411('0x44')][_0x2411('0x4f')]+'%'};return _0x2819f0;})});}_0x27d2df=_['merge']({},_0x27d2df,_0x348778[_0x2411('0x52')]);return db[_0x2411('0x62')][_0x2411('0x64')](_0x27d2df);}})[_0x2411('0x20')](function(_0x5084d5){if(_0x5084d5){return db[_0x2411('0x65')][_0x2411('0x66')]({'where':{'id':_[_0x2411('0x3e')](_0x5084d5,_0x2411('0x67')),'role':_0x2411('0x68')},'attributes':['id',_0x2411('0x3b'),_0x2411('0x69'),_0x2411('0x6a'),_0x2411('0x6b')]});}})['then'](function(_0x15f9e4){if(_0x15f9e4){return{'count':_0x15f9e4[_0x2411('0x31')],'rows':_[_0x2411('0x3e')](_0x15f9e4[_0x2411('0x6c')],function(_0x2fc18b){return{'membername':_0x2fc18b['name'],'UserId':_0x2fc18b['id'],'queue_name':_0x145f08[_0x2411('0x3b')],'ChatQueueId':_0x145f08['id'],'interface':util[_0x2411('0x6d')](_0x2411('0x6e'),'SIP',_0x2fc18b[_0x2411('0x3b')]),'penalty':0x0,'paused':_0x2fc18b['chatPause'],'createdAt':_0x2fc18b[_0x2411('0x6b')],'updatedAt':_0x2fc18b[_0x2411('0x6a')]};})};}else{return{'count':0x0,'rows':[]};}})[_0x2411('0x20')](respondWithFilteredResult(_0x497496,_0x27d2df))[_0x2411('0x29')](handleError(_0x497496,null));};exports[_0x2411('0x6f')]=function(_0x35958a,_0x3e8be5,_0xffa8a7){var _0x38bee3={};var _0x59cf21={};var _0x751de7;var _0x23281b;return db['ChatQueue']['findOne']({'where':{'id':_0x35958a[_0x2411('0x5f')]['id']}})['then'](handleEntityNotFound(_0x3e8be5,null))[_0x2411('0x20')](function(_0x13d31e){if(_0x13d31e){_0x751de7=_0x13d31e;_0x59cf21[_0x2411('0x43')]=_[_0x2411('0x45')](db[_0x2411('0x70')]['rawAttributes']);_0x59cf21[_0x2411('0x44')]=_[_0x2411('0x45')](_0x35958a[_0x2411('0x44')]);_0x59cf21[_0x2411('0x46')]=_[_0x2411('0x47')](_0x59cf21[_0x2411('0x43')],_0x59cf21[_0x2411('0x44')]);_0x38bee3['attributes']=_[_0x2411('0x47')](_0x59cf21[_0x2411('0x43')],qs[_0x2411('0x49')](_0x35958a[_0x2411('0x44')][_0x2411('0x49')]));_0x38bee3[_0x2411('0x48')]=_0x38bee3[_0x2411('0x48')][_0x2411('0x4a')]?_0x38bee3['attributes']:_0x59cf21['model'];_0x38bee3[_0x2411('0x71')]=qs[_0x2411('0x4c')](_0x35958a['query'][_0x2411('0x4c')]);_0x38bee3['where']=qs[_0x2411('0x46')](_[_0x2411('0x4e')](_0x35958a[_0x2411('0x44')],_0x59cf21['filters']));if(_0x35958a[_0x2411('0x44')][_0x2411('0x4f')]){_0x38bee3[_0x2411('0x4d')]=_['merge'](_0x38bee3[_0x2411('0x4d')],{'$or':_[_0x2411('0x3e')](_0x38bee3[_0x2411('0x48')],function(_0x39fcd2){var _0x389197={};_0x389197[_0x39fcd2]={'$like':'%'+_0x35958a['query']['filter']+'%'};return _0x389197;})});}_0x38bee3=_[_0x2411('0x50')]({},_0x38bee3,_0x35958a[_0x2411('0x52')]);return _0x751de7[_0x2411('0x6f')](_0x38bee3);}})[_0x2411('0x20')](function(_0x3c4320){if(_0x3c4320){_0x23281b=_0x3c4320[_0x2411('0x4a')];if(!_0x35958a[_0x2411('0x44')][_0x2411('0x4b')](_0x2411('0x63'))){_0x38bee3['limit']=qs[_0x2411('0x30')](_0x35958a[_0x2411('0x44')][_0x2411('0x30')]);_0x38bee3[_0x2411('0x2e')]=qs[_0x2411('0x2e')](_0x35958a[_0x2411('0x44')][_0x2411('0x2e')]);}return _0x751de7[_0x2411('0x6f')](_0x38bee3);}})[_0x2411('0x20')](function(_0x5850ff){if(_0x5850ff){return _0x5850ff?{'count':_0x23281b,'rows':_0x5850ff}:null;}})['then'](respondWithResult(_0x3e8be5,null))[_0x2411('0x29')](handleError(_0x3e8be5,null));};exports[_0x2411('0x72')]=function(_0x6ea3e6,_0x2c8f0a,_0x1a4782){var _0x1b5447=_0x6ea3e6[_0x2411('0x5e')][_0x2411('0x73')];return db[_0x2411('0x70')][_0x2411('0x64')]({'where':{'id':_0x1b5447},'attributes':['id'],'include':[{'model':db[_0x2411('0x65')],'as':_0x2411('0x74'),'attributes':['id',_0x2411('0x3b'),_0x2411('0x75'),_0x2411('0x76'),_0x2411('0x77')],'raw':!![]}]})['then'](function(_0x2a3c96){if(_0x2a3c96){var _0x22d980=_['flatMap'](_0x2a3c96,function(_0x1cc1b7){var _0x64e80a=_0x1cc1b7[_0x2411('0x38')]({'plain':!![]});return _0x64e80a['Agents'];});return db[_0x2411('0x3f')]['find']({'where':{'id':_0x6ea3e6['params']['id']}})[_0x2411('0x20')](function(_0x428082){return db[_0x2411('0x78')][_0x2411('0x79')](function(_0x127403){return _0x428082[_0x2411('0x72')](_0x1b5447,{'transaction':_0x127403})[_0x2411('0x20')](function(){return BPromise[_0x2411('0x7a')](_0x22d980,function(_0x29b03a){return db[_0x2411('0x62')][_0x2411('0x7b')]({'where':{'UserId':_0x29b03a['id'],'ChatQueueId':_0x6ea3e6[_0x2411('0x5f')]['id']},'transaction':_0x127403});});})[_0x2411('0x20')](function(){_0x22d980[_0x2411('0x7c')](function(_0x1e9121){socket[_0x2411('0x7d')](_0x2411('0x7e'),{'UserId':_0x1e9121['id'],'ChatQueueId':_0x428082['id']});});});});});}})[_0x2411('0x20')](respondWithStatusCode(_0x2c8f0a,null))[_0x2411('0x29')](handleError(_0x2c8f0a,null));};exports[_0x2411('0x7f')]=function(_0x5c8ec1,_0x479c65,_0xda5f05){return db[_0x2411('0x70')]['findAll']({'where':{'id':_0x5c8ec1[_0x2411('0x44')][_0x2411('0x73')]},'attributes':['id'],'include':[{'model':db[_0x2411('0x65')],'as':_0x2411('0x74'),'attributes':['id'],'raw':!![]}]})[_0x2411('0x20')](handleEntityNotFound(_0x479c65,null))[_0x2411('0x20')](function(_0x52773b){var _0x1050ae=_[_0x2411('0x3e')](_0x52773b,'id');var _0x1f8b3f=[];var _0xbebaea=[];var _0x136d7b=squel[_0x2411('0x80')]();_0x136d7b[_0x2411('0x81')](_0x2411('0x82'))['from'](_0x2411('0x83'),'tq')['join'](_0x2411('0x84'),'ut',_0x2411('0x85'))[_0x2411('0x4d')](_0x2411('0x86'),_0x5c8ec1[_0x2411('0x5f')]['id']);for(var _0x4da8df=0x0;_0x4da8df<_0x52773b['length'];_0x4da8df+=0x1){let _0x45b26e=_0x52773b[_0x4da8df];for(var _0x3eee04=0x0;_0x3eee04<_0x45b26e[_0x2411('0x74')][_0x2411('0x4a')];_0x3eee04+=0x1){let _0x46dc75=_0x45b26e[_0x2411('0x74')][_0x3eee04];var _0x4e9990=_0x136d7b[_0x2411('0x87')]();_0x4e9990[_0x2411('0x4d')](_0x2411('0x88'),_0x46dc75['id']);_0xbebaea[_0x2411('0x89')](db['sequelize'][_0x2411('0x44')](_0x4e9990[_0x2411('0x8a')](),{'type':db['sequelize'][_0x2411('0x8b')]['SELECT']})[_0x2411('0x20')](function(_0x466ed1){if(_0x466ed1['length']===0x1){return _0x46dc75['id'];}else{var _0x4cec58=_[_0x2411('0x8c')](_['map'](_0x466ed1,_0x2411('0x8d')),function(_0x3f053e){return _['includes'](_0x1050ae,_0x3f053e);});if(_0x4cec58){return _0x46dc75['id'];}}}));}}return BPromise[_0x2411('0x8e')](_0xbebaea)[_0x2411('0x20')](function(_0x3e171d){_0x1f8b3f=_(_0x1f8b3f)[_0x2411('0x8f')](_0x3e171d)[_0x2411('0x90')]()[_0x2411('0x91')]();return db['ChatQueue'][_0x2411('0x56')]({'where':{'id':_0x5c8ec1[_0x2411('0x5f')]['id']}})[_0x2411('0x20')](function(_0x1fcc1f){return db[_0x2411('0x78')][_0x2411('0x79')](function(_0x383fac){return _0x1fcc1f[_0x2411('0x7f')](_0x5c8ec1[_0x2411('0x44')][_0x2411('0x73')],{'transaction':_0x383fac})['then'](function(){if(!_['isEmpty'](_0x1f8b3f)){return _0x1fcc1f['removeAgents'](_0x1f8b3f,{'transaction':_0x383fac});}})[_0x2411('0x20')](function(){_0x1f8b3f['forEach'](function(_0x2c4ba1){socket[_0x2411('0x7d')](_0x2411('0x92'),{'UserId':_0x2c4ba1,'ChatQueueId':_0x1fcc1f['id']});});});});});});})[_0x2411('0x20')](respondWithStatusCode(_0x479c65,null))[_0x2411('0x29')](handleError(_0x479c65,null));};exports['addAgents']=function(_0x173fe6,_0x261441,_0x3e021f){return db[_0x2411('0x3f')]['find']({'where':{'id':_0x173fe6['params']['id']}})[_0x2411('0x20')](handleEntityNotFound(_0x261441,null))[_0x2411('0x20')](function(_0x162131){if(_0x162131){return _0x162131['addAgents'](_0x173fe6['body']['ids'],_[_0x2411('0x93')](_0x173fe6[_0x2411('0x5e')],[_0x2411('0x73'),'id'])||{})[_0x2411('0x94')](function(_0x403662){for(var _0x3c3a20=0x0;_0x3c3a20<_0x173fe6['body']['ids']['length'];_0x3c3a20+=0x1){socket[_0x2411('0x7d')](_0x2411('0x7e'),{'UserId':Number(_0x173fe6['body']['ids'][_0x3c3a20]),'ChatQueueId':Number(_0x173fe6[_0x2411('0x5f')]['id'])});}return _0x403662;});}})['then'](respondWithResult(_0x261441,null))[_0x2411('0x29')](handleError(_0x261441,null));};exports[_0x2411('0x95')]=function(_0x156c56,_0x8081c0,_0x4baa76){return db['ChatQueue'][_0x2411('0x56')]({'where':{'id':_0x156c56[_0x2411('0x5f')]['id']}})[_0x2411('0x20')](handleEntityNotFound(_0x8081c0,null))[_0x2411('0x20')](function(_0x11fbbe){if(_0x11fbbe){return _0x11fbbe[_0x2411('0x95')](_0x156c56[_0x2411('0x44')]['ids'])[_0x2411('0x20')](function(){if(_[_0x2411('0x96')](_0x156c56['query'][_0x2411('0x73')])){for(var _0x458045=0x0;_0x458045<_0x156c56[_0x2411('0x44')][_0x2411('0x73')][_0x2411('0x4a')];_0x458045+=0x1){socket['emit'](_0x2411('0x92'),{'UserId':Number(_0x156c56[_0x2411('0x44')][_0x2411('0x73')][_0x458045]),'ChatQueueId':Number(_0x156c56[_0x2411('0x5f')]['id'])});}}else{socket[_0x2411('0x7d')](_0x2411('0x92'),{'UserId':Number(_0x156c56[_0x2411('0x44')][_0x2411('0x73')]),'ChatQueueId':Number(_0x156c56['params']['id'])});}});}})[_0x2411('0x20')](respondWithStatusCode(_0x8081c0,null))[_0x2411('0x29')](handleError(_0x8081c0,null));};exports['getAgents']=function(_0x2e753f,_0x11e330,_0x39e4e2){var _0x5d4cf1={};var _0xdca24c={};var _0x1c637a;var _0x56de17;return db[_0x2411('0x3f')][_0x2411('0x97')]({'where':{'id':_0x2e753f[_0x2411('0x5f')]['id']}})[_0x2411('0x20')](handleEntityNotFound(_0x11e330,null))['then'](function(_0x9f85c0){if(_0x9f85c0){_0x1c637a=_0x9f85c0;_0xdca24c[_0x2411('0x43')]=_[_0x2411('0x45')](db[_0x2411('0x65')][_0x2411('0x40')]);_0xdca24c[_0x2411('0x44')]=_['keys'](_0x2e753f[_0x2411('0x44')]);_0xdca24c['filters']=_[_0x2411('0x47')](_0xdca24c[_0x2411('0x43')],_0xdca24c['query']);_0x5d4cf1['attributes']=_[_0x2411('0x47')](_0xdca24c[_0x2411('0x43')],qs['fields'](_0x2e753f[_0x2411('0x44')][_0x2411('0x49')]));_0x5d4cf1[_0x2411('0x48')]=_0x5d4cf1[_0x2411('0x48')][_0x2411('0x4a')]?_0x5d4cf1['attributes']:_0xdca24c[_0x2411('0x43')];_0x5d4cf1['order']=qs[_0x2411('0x4c')](_0x2e753f[_0x2411('0x44')]['sort']);_0x5d4cf1[_0x2411('0x4d')]=qs[_0x2411('0x46')](_[_0x2411('0x4e')](_0x2e753f[_0x2411('0x44')],_0xdca24c[_0x2411('0x46')]));if(_0x2e753f['query'][_0x2411('0x4f')]){_0x5d4cf1[_0x2411('0x4d')]=_[_0x2411('0x50')](_0x5d4cf1['where'],{'$or':_[_0x2411('0x3e')](_0x5d4cf1[_0x2411('0x48')],function(_0x115a1d){var _0x25d525={};_0x25d525[_0x115a1d]={'$like':'%'+_0x2e753f[_0x2411('0x44')][_0x2411('0x4f')]+'%'};return _0x25d525;})});}_0x5d4cf1=_[_0x2411('0x50')]({},_0x5d4cf1,_0x2e753f['options']);return _0x1c637a[_0x2411('0x98')](_0x5d4cf1);}})['then'](function(_0x3f82bb){if(_0x3f82bb){_0x56de17=_0x3f82bb[_0x2411('0x4a')];if(!_0x2e753f['query'][_0x2411('0x4b')](_0x2411('0x63'))){_0x5d4cf1['limit']=qs['limit'](_0x2e753f[_0x2411('0x44')][_0x2411('0x30')]);_0x5d4cf1[_0x2411('0x2e')]=qs[_0x2411('0x2e')](_0x2e753f[_0x2411('0x44')][_0x2411('0x2e')]);}return _0x1c637a[_0x2411('0x98')](_0x5d4cf1);}})[_0x2411('0x20')](function(_0x4b3793){if(_0x4b3793){return _0x4b3793?{'count':_0x56de17,'rows':_0x4b3793}:null;}})[_0x2411('0x20')](respondWithResult(_0x11e330,null))[_0x2411('0x29')](handleError(_0x11e330,null));};
\ No newline at end of file
+var _0x4986=['merge','VIRTUAL','includeAll','ChatQueue','findAll','rows','show','params','keys','attributes','include','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','find','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','describe','getMembers','UserChatQueue','nolimit','ChatQueueId','User','findAndCountAll','UserId','updatedAt','createdAt','%s/%s','chatPause','findOne','getTeams','addTeams','ids','Team','Agents','online','voicePause','interface','flatMap','sequelize','transaction','each','findOrCreate','forEach','emit','userChatQueue:save','removeTeams','select','field','tq.TeamId','team_has_chat_queues','join','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','ChatQueueId\x20=\x20?','clone','ut.UserId\x20=\x20?','push','toString','SELECT','every','TeamId','includes','all','union','compact','value','isEmpty','userChatQueue:remove','addAgents','removeAgents','isArray','getAgents','options','eml-format','rimraf','zip-dir','moment','mustache','util','path','sox','to-csv','fs-extra','lodash','crypto','jsforce','desk.js','querystring','ioredis','../../components/parsers/qs','../../config/logger','../../config/environment','../../config/license/util','../../mysqldb','redis','localhost','socket.io-emitter','./chatQueue.socket','register','jayson/promise','client','http','request','then','ChatQueue,\x20%s,\x20%s','request\x20sent','debug','ChatQueue,\x20%s,\x20%s,\x20%s','error','message','info','result','catch','status','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','destroy','get','ChatQueues','name','send','index','map','rawAttributes','fieldName','type','key','query','filters','model','intersection','fields','length','hasOwnProperty','order','sort','where','pick','filter'];(function(_0x255c20,_0x29e68d){var _0x4aa54f=function(_0x59144f){while(--_0x59144f){_0x255c20['push'](_0x255c20['shift']());}};_0x4aa54f(++_0x29e68d);}(_0x4986,0xe7));var _0x6498=function(_0x29d369,_0x4ebce8){_0x29d369=_0x29d369-0x0;var _0x460deb=_0x4986[_0x29d369];return _0x460deb;};'use strict';var emlformat=require(_0x6498('0x0'));var rimraf=require(_0x6498('0x1'));var zipdir=require(_0x6498('0x2'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x6498('0x3'));var BPromise=require('bluebird');var Mustache=require(_0x6498('0x4'));var util=require(_0x6498('0x5'));var path=require(_0x6498('0x6'));var sox=require(_0x6498('0x7'));var csv=require(_0x6498('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x6498('0x9'));var _=require(_0x6498('0xa'));var squel=require('squel');var crypto=require(_0x6498('0xb'));var jsforce=require(_0x6498('0xc'));var deskjs=require(_0x6498('0xd'));var toCsv=require(_0x6498('0x8'));var querystring=require(_0x6498('0xe'));var Papa=require('papaparse');var Redis=require(_0x6498('0xf'));var authService=require('../../components/auth/service');var qs=require(_0x6498('0x10'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0x6498('0x11'))('api');var utils=require('../../config/utils');var config=require(_0x6498('0x12'));var licenseUtil=require(_0x6498('0x13'));var db=require(_0x6498('0x14'))['db'];config['redis']=_['defaults'](config[_0x6498('0x15')],{'host':_0x6498('0x16'),'port':0x18eb});var socket=require(_0x6498('0x17'))(new Redis(config[_0x6498('0x15')]));require(_0x6498('0x18'))[_0x6498('0x19')](socket);var jayson=require(_0x6498('0x1a'));var client=jayson[_0x6498('0x1b')][_0x6498('0x1c')]({'port':0x232a});function respondWithRpcPromise(_0x37a1f7,_0x49ccc9,_0x19afbe,_0x208c01){return new BPromise(function(_0x5c6907,_0x4639ce){var _0x4b89c6=_0x208c01||client;return _0x4b89c6[_0x6498('0x1d')](_0x37a1f7,_0x19afbe)[_0x6498('0x1e')](function(_0x5dc0a2){logger['info'](_0x6498('0x1f'),_0x49ccc9,_0x6498('0x20'));logger[_0x6498('0x21')](_0x6498('0x22'),_0x49ccc9,_0x6498('0x20'),JSON['stringify'](_0x5dc0a2));if(_0x5dc0a2['error']){if(_0x5dc0a2[_0x6498('0x23')]['code']===0x1f4){logger[_0x6498('0x23')](_0x6498('0x1f'),_0x49ccc9,_0x5dc0a2[_0x6498('0x23')][_0x6498('0x24')]);return _0x4639ce(_0x5dc0a2[_0x6498('0x23')][_0x6498('0x24')]);}logger[_0x6498('0x23')](_0x6498('0x1f'),_0x49ccc9,_0x5dc0a2['error'][_0x6498('0x24')]);return _0x5c6907(_0x5dc0a2[_0x6498('0x23')][_0x6498('0x24')]);}else{logger[_0x6498('0x25')](_0x6498('0x1f'),_0x49ccc9,_0x6498('0x20'));_0x5c6907(_0x5dc0a2[_0x6498('0x26')][_0x6498('0x24')]);}})[_0x6498('0x27')](function(_0x412e2f){logger['error'](_0x6498('0x1f'),_0x49ccc9,_0x412e2f);_0x4639ce(_0x412e2f);});});}function respondWithStatusCode(_0x13ce31,_0x411033){_0x411033=_0x411033||0xcc;return function(_0x192589){if(_0x192589){return _0x13ce31['sendStatus'](_0x411033);}return _0x13ce31[_0x6498('0x28')](_0x411033)['end']();};}function respondWithResult(_0x20a2ee,_0x1bc630){_0x1bc630=_0x1bc630||0xc8;return function(_0x79efb){if(_0x79efb){return _0x20a2ee[_0x6498('0x28')](_0x1bc630)[_0x6498('0x29')](_0x79efb);}};}function respondWithFilteredResult(_0x1b714a,_0x1e36d0){return function(_0x3915bb){if(_0x3915bb){var _0x238f32=typeof _0x1e36d0[_0x6498('0x2a')]===_0x6498('0x2b')&&typeof _0x1e36d0[_0x6498('0x2c')]===_0x6498('0x2b');var _0x20307d=_0x3915bb['count'];var _0x38a73c=_0x238f32?0x0:_0x1e36d0[_0x6498('0x2a')];var _0x10b362=_0x238f32?_0x3915bb[_0x6498('0x2d')]:_0x1e36d0['offset']+_0x1e36d0[_0x6498('0x2c')];var _0x393534;if(_0x10b362>=_0x20307d){_0x10b362=_0x20307d;_0x393534=0xc8;}else{_0x393534=0xce;}_0x1b714a[_0x6498('0x28')](_0x393534);return _0x1b714a[_0x6498('0x2e')](_0x6498('0x2f'),_0x38a73c+'-'+_0x10b362+'/'+_0x20307d)[_0x6498('0x29')](_0x3915bb);}return null;};}function patchUpdates(_0x2e982c){return function(_0xd80233){try{jsonpatch[_0x6498('0x30')](_0xd80233,_0x2e982c,!![]);}catch(_0x1c42c6){return BPromise[_0x6498('0x31')](_0x1c42c6);}return _0xd80233[_0x6498('0x32')]();};}function saveUpdates(_0x42eb85,_0x157b95){return function(_0x34068a){if(_0x34068a){return _0x34068a[_0x6498('0x33')](_0x42eb85)[_0x6498('0x1e')](function(_0x4d0d96){return _0x4d0d96;});}return null;};}function removeEntity(_0x18b86b,_0x3c58ea){return function(_0x2f73cb){if(_0x2f73cb){return _0x2f73cb[_0x6498('0x34')]()[_0x6498('0x1e')](function(){var _0x545b85=_0x2f73cb[_0x6498('0x35')]({'plain':!![]});var _0x24d119=_0x6498('0x36');return db['UserProfileResource'][_0x6498('0x34')]({'where':{'type':_0x24d119,'resourceId':_0x545b85['id']}})['then'](function(){return _0x2f73cb;});})[_0x6498('0x1e')](function(){_0x18b86b[_0x6498('0x28')](0xcc)['end']();});}};}function handleEntityNotFound(_0x262b6c,_0xfd3c15){return function(_0x493683){if(!_0x493683){_0x262b6c['sendStatus'](0x194);}return _0x493683;};}function handleError(_0x55f66c,_0x31427a){_0x31427a=_0x31427a||0x1f4;return function(_0x1f3073){logger[_0x6498('0x23')](_0x1f3073['stack']);if(_0x1f3073[_0x6498('0x37')]){delete _0x1f3073['name'];}_0x55f66c[_0x6498('0x28')](_0x31427a)[_0x6498('0x38')](_0x1f3073);};}exports[_0x6498('0x39')]=function(_0x2a5903,_0x32b0aa){var _0x3475c3={},_0x38b0d5={},_0x496a22={'count':0x0,'rows':[]};var _0x832980=_[_0x6498('0x3a')](db['ChatQueue'][_0x6498('0x3b')],function(_0x281b6a){return{'name':_0x281b6a[_0x6498('0x3c')],'type':_0x281b6a[_0x6498('0x3d')][_0x6498('0x3e')]};});_0x38b0d5['model']=_[_0x6498('0x3a')](_0x832980,_0x6498('0x37'));_0x38b0d5[_0x6498('0x3f')]=_['keys'](_0x2a5903[_0x6498('0x3f')]);_0x38b0d5[_0x6498('0x40')]=_['intersection'](_0x38b0d5[_0x6498('0x41')],_0x38b0d5[_0x6498('0x3f')]);_0x3475c3['attributes']=_[_0x6498('0x42')](_0x38b0d5[_0x6498('0x41')],qs[_0x6498('0x43')](_0x2a5903[_0x6498('0x3f')][_0x6498('0x43')]));_0x3475c3['attributes']=_0x3475c3['attributes'][_0x6498('0x44')]?_0x3475c3['attributes']:_0x38b0d5['model'];if(!_0x2a5903[_0x6498('0x3f')][_0x6498('0x45')]('nolimit')){_0x3475c3[_0x6498('0x2c')]=qs[_0x6498('0x2c')](_0x2a5903[_0x6498('0x3f')][_0x6498('0x2c')]);_0x3475c3[_0x6498('0x2a')]=qs[_0x6498('0x2a')](_0x2a5903[_0x6498('0x3f')][_0x6498('0x2a')]);}_0x3475c3[_0x6498('0x46')]=qs[_0x6498('0x47')](_0x2a5903[_0x6498('0x3f')]['sort']);_0x3475c3[_0x6498('0x48')]=qs[_0x6498('0x40')](_[_0x6498('0x49')](_0x2a5903[_0x6498('0x3f')],_0x38b0d5[_0x6498('0x40')]),_0x832980);if(_0x2a5903['query'][_0x6498('0x4a')]){_0x3475c3['where']=_[_0x6498('0x4b')](_0x3475c3[_0x6498('0x48')],{'$or':_['map'](_0x832980,function(_0x17dd27){if(_0x17dd27[_0x6498('0x3d')]!==_0x6498('0x4c')){var _0x2890ee={};_0x2890ee[_0x17dd27[_0x6498('0x37')]]={'$like':'%'+_0x2a5903[_0x6498('0x3f')][_0x6498('0x4a')]+'%'};return _0x2890ee;}})});}_0x3475c3=_[_0x6498('0x4b')]({},_0x3475c3,_0x2a5903['options']);var _0x26f525={'where':_0x3475c3[_0x6498('0x48')]};return db['ChatQueue'][_0x6498('0x2d')](_0x26f525)[_0x6498('0x1e')](function(_0x283ca4){_0x496a22[_0x6498('0x2d')]=_0x283ca4;if(_0x2a5903['query'][_0x6498('0x4d')]){_0x3475c3['include']=[{'all':!![]}];}return db[_0x6498('0x4e')][_0x6498('0x4f')](_0x3475c3);})[_0x6498('0x1e')](function(_0x217745){_0x496a22[_0x6498('0x50')]=_0x217745;return _0x496a22;})[_0x6498('0x1e')](respondWithFilteredResult(_0x32b0aa,_0x3475c3))['catch'](handleError(_0x32b0aa,null));};exports[_0x6498('0x51')]=function(_0x1e8dd3,_0x2383b2){var _0x4d61f7={'raw':!![],'where':{'id':_0x1e8dd3[_0x6498('0x52')]['id']}},_0x338f67={};_0x338f67[_0x6498('0x41')]=_[_0x6498('0x53')](db[_0x6498('0x4e')][_0x6498('0x3b')]);_0x338f67[_0x6498('0x3f')]=_[_0x6498('0x53')](_0x1e8dd3[_0x6498('0x3f')]);_0x338f67[_0x6498('0x40')]=_[_0x6498('0x42')](_0x338f67['model'],_0x338f67[_0x6498('0x3f')]);_0x4d61f7[_0x6498('0x54')]=_[_0x6498('0x42')](_0x338f67[_0x6498('0x41')],qs[_0x6498('0x43')](_0x1e8dd3[_0x6498('0x3f')]['fields']));_0x4d61f7[_0x6498('0x54')]=_0x4d61f7['attributes'][_0x6498('0x44')]?_0x4d61f7[_0x6498('0x54')]:_0x338f67[_0x6498('0x41')];if(_0x1e8dd3['query']['includeAll']){_0x4d61f7[_0x6498('0x55')]=[{'all':!![]}];}_0x4d61f7=_[_0x6498('0x4b')]({},_0x4d61f7,_0x1e8dd3['options']);return db[_0x6498('0x4e')]['find'](_0x4d61f7)[_0x6498('0x1e')](handleEntityNotFound(_0x2383b2,null))[_0x6498('0x1e')](respondWithResult(_0x2383b2,null))[_0x6498('0x27')](handleError(_0x2383b2,null));};exports[_0x6498('0x56')]=function(_0x189626,_0x150cdc){return db[_0x6498('0x4e')][_0x6498('0x56')](_0x189626[_0x6498('0x57')],{})['then'](function(_0x21cf8b){var _0x5bd5a9=_0x189626[_0x6498('0x58')][_0x6498('0x35')]({'plain':!![]});if(!_0x5bd5a9)throw new Error(_0x6498('0x59'));if(_0x5bd5a9[_0x6498('0x5a')]===_0x6498('0x58')){var _0x172e07=_0x21cf8b[_0x6498('0x35')]({'plain':!![]});var _0x2ea3bd=_0x6498('0x36');return db[_0x6498('0x5b')][_0x6498('0x5c')]({'where':{'name':_0x2ea3bd,'userProfileId':_0x5bd5a9['userProfileId']},'raw':!![]})[_0x6498('0x1e')](function(_0x3fce39){if(_0x3fce39&&_0x3fce39[_0x6498('0x5d')]===0x0){return db[_0x6498('0x5e')]['create']({'name':_0x172e07[_0x6498('0x37')],'resourceId':_0x172e07['id'],'type':_0x3fce39[_0x6498('0x37')],'sectionId':_0x3fce39['id']},{})['then'](function(){return _0x21cf8b;});}else{return _0x21cf8b;}})[_0x6498('0x27')](function(_0xaa0bca){logger[_0x6498('0x23')](_0x6498('0x5f'),_0xaa0bca);throw _0xaa0bca;});}return _0x21cf8b;})['then'](respondWithResult(_0x150cdc,0xc9))[_0x6498('0x27')](handleError(_0x150cdc,null));};exports[_0x6498('0x33')]=function(_0x3d06a8,_0x444a71){if(_0x3d06a8[_0x6498('0x57')]['id']){delete _0x3d06a8[_0x6498('0x57')]['id'];}return db[_0x6498('0x4e')][_0x6498('0x5c')]({'where':{'id':_0x3d06a8[_0x6498('0x52')]['id']}})['then'](handleEntityNotFound(_0x444a71,null))[_0x6498('0x1e')](saveUpdates(_0x3d06a8[_0x6498('0x57')],null))[_0x6498('0x1e')](respondWithResult(_0x444a71,null))[_0x6498('0x27')](handleError(_0x444a71,null));};exports[_0x6498('0x34')]=function(_0x701b12,_0x42491a){return db[_0x6498('0x4e')][_0x6498('0x5c')]({'where':{'id':_0x701b12[_0x6498('0x52')]['id']}})[_0x6498('0x1e')](handleEntityNotFound(_0x42491a,null))[_0x6498('0x1e')](removeEntity(_0x42491a,null))[_0x6498('0x27')](handleError(_0x42491a,null));};exports[_0x6498('0x60')]=function(_0x2dbf8c,_0x44eb6e){return db[_0x6498('0x4e')][_0x6498('0x60')]()['then'](respondWithResult(_0x44eb6e,null))[_0x6498('0x27')](handleError(_0x44eb6e,null));};exports[_0x6498('0x61')]=function(_0x5caf11,_0x33a721,_0x2de118){var _0x30b87e={'raw':!![],'where':{}},_0x2c9d50={},_0x36f6f9;return db[_0x6498('0x4e')]['findOne']({'where':{'id':_0x5caf11['params']['id']}})[_0x6498('0x1e')](handleEntityNotFound(_0x33a721,null))['then'](function(_0x574625){if(_0x574625){_0x36f6f9=_0x574625[_0x6498('0x35')]({'plain':!![]});_0x2c9d50[_0x6498('0x41')]=_['keys'](db[_0x6498('0x62')][_0x6498('0x3b')]);_0x2c9d50['query']=_[_0x6498('0x53')](_0x5caf11[_0x6498('0x3f')]);_0x2c9d50[_0x6498('0x40')]=_[_0x6498('0x42')](_0x2c9d50[_0x6498('0x41')],_0x2c9d50[_0x6498('0x3f')]);_0x30b87e['attributes']=_[_0x6498('0x42')](_0x2c9d50['model'],qs[_0x6498('0x43')](_0x5caf11[_0x6498('0x3f')]['fields']));_0x30b87e[_0x6498('0x54')]=_0x30b87e[_0x6498('0x54')][_0x6498('0x44')]?_0x30b87e['attributes']:_0x2c9d50[_0x6498('0x41')];if(!_0x5caf11[_0x6498('0x3f')][_0x6498('0x45')](_0x6498('0x63'))){_0x30b87e['limit']=qs[_0x6498('0x2c')](_0x5caf11[_0x6498('0x3f')]['limit']);_0x30b87e['offset']=qs[_0x6498('0x2a')](_0x5caf11[_0x6498('0x3f')][_0x6498('0x2a')]);}_0x30b87e['order']=qs[_0x6498('0x47')](_0x5caf11[_0x6498('0x3f')][_0x6498('0x47')]);_0x30b87e[_0x6498('0x48')]=qs[_0x6498('0x40')](_[_0x6498('0x49')](_0x5caf11[_0x6498('0x3f')],_0x2c9d50['filters']));_0x30b87e['where'][_0x6498('0x64')]=_0x574625['id'];if(_0x5caf11[_0x6498('0x3f')][_0x6498('0x4a')]){_0x30b87e[_0x6498('0x48')]=_[_0x6498('0x4b')](_0x30b87e[_0x6498('0x48')],{'$or':_['map'](_0x30b87e[_0x6498('0x54')],function(_0x20b637){var _0x1529d2={};_0x1529d2[_0x20b637]={'$like':'%'+_0x5caf11[_0x6498('0x3f')]['filter']+'%'};return _0x1529d2;})});}_0x30b87e=_['merge']({},_0x30b87e,_0x5caf11['options']);return db['UserChatQueue'][_0x6498('0x4f')](_0x30b87e);}})[_0x6498('0x1e')](function(_0x345d0b){if(_0x345d0b){return db[_0x6498('0x65')][_0x6498('0x66')]({'where':{'id':_[_0x6498('0x3a')](_0x345d0b,_0x6498('0x67')),'role':'agent'},'attributes':['id',_0x6498('0x37'),'chatPause',_0x6498('0x68'),_0x6498('0x69')]});}})['then'](function(_0x3fc3c4){if(_0x3fc3c4){return{'count':_0x3fc3c4[_0x6498('0x2d')],'rows':_[_0x6498('0x3a')](_0x3fc3c4[_0x6498('0x50')],function(_0x3e01b8){return{'membername':_0x3e01b8[_0x6498('0x37')],'UserId':_0x3e01b8['id'],'queue_name':_0x36f6f9['name'],'ChatQueueId':_0x36f6f9['id'],'interface':util['format'](_0x6498('0x6a'),'SIP',_0x3e01b8[_0x6498('0x37')]),'penalty':0x0,'paused':_0x3e01b8[_0x6498('0x6b')],'createdAt':_0x3e01b8[_0x6498('0x69')],'updatedAt':_0x3e01b8['updatedAt']};})};}else{return{'count':0x0,'rows':[]};}})[_0x6498('0x1e')](respondWithFilteredResult(_0x33a721,_0x30b87e))[_0x6498('0x27')](handleError(_0x33a721,null));};exports['getTeams']=function(_0x365a6b,_0x5bcead,_0x37e62a){var _0x1a2bef={};var _0x390f81={};var _0x841fe8;var _0x42902f;return db[_0x6498('0x4e')][_0x6498('0x6c')]({'where':{'id':_0x365a6b[_0x6498('0x52')]['id']}})[_0x6498('0x1e')](handleEntityNotFound(_0x5bcead,null))['then'](function(_0x15b1e0){if(_0x15b1e0){_0x841fe8=_0x15b1e0;_0x390f81[_0x6498('0x41')]=_[_0x6498('0x53')](db['Team'][_0x6498('0x3b')]);_0x390f81[_0x6498('0x3f')]=_['keys'](_0x365a6b['query']);_0x390f81[_0x6498('0x40')]=_[_0x6498('0x42')](_0x390f81[_0x6498('0x41')],_0x390f81[_0x6498('0x3f')]);_0x1a2bef[_0x6498('0x54')]=_['intersection'](_0x390f81[_0x6498('0x41')],qs[_0x6498('0x43')](_0x365a6b[_0x6498('0x3f')][_0x6498('0x43')]));_0x1a2bef['attributes']=_0x1a2bef[_0x6498('0x54')][_0x6498('0x44')]?_0x1a2bef[_0x6498('0x54')]:_0x390f81[_0x6498('0x41')];_0x1a2bef[_0x6498('0x46')]=qs[_0x6498('0x47')](_0x365a6b[_0x6498('0x3f')][_0x6498('0x47')]);_0x1a2bef[_0x6498('0x48')]=qs[_0x6498('0x40')](_[_0x6498('0x49')](_0x365a6b['query'],_0x390f81[_0x6498('0x40')]));if(_0x365a6b[_0x6498('0x3f')][_0x6498('0x4a')]){_0x1a2bef[_0x6498('0x48')]=_[_0x6498('0x4b')](_0x1a2bef[_0x6498('0x48')],{'$or':_[_0x6498('0x3a')](_0x1a2bef[_0x6498('0x54')],function(_0x3f4332){var _0x44e3af={};_0x44e3af[_0x3f4332]={'$like':'%'+_0x365a6b['query']['filter']+'%'};return _0x44e3af;})});}_0x1a2bef=_['merge']({},_0x1a2bef,_0x365a6b['options']);return _0x841fe8['getTeams'](_0x1a2bef);}})['then'](function(_0x585162){if(_0x585162){_0x42902f=_0x585162[_0x6498('0x44')];if(!_0x365a6b[_0x6498('0x3f')][_0x6498('0x45')](_0x6498('0x63'))){_0x1a2bef[_0x6498('0x2c')]=qs['limit'](_0x365a6b[_0x6498('0x3f')][_0x6498('0x2c')]);_0x1a2bef[_0x6498('0x2a')]=qs[_0x6498('0x2a')](_0x365a6b['query'][_0x6498('0x2a')]);}return _0x841fe8[_0x6498('0x6d')](_0x1a2bef);}})[_0x6498('0x1e')](function(_0x5bc624){if(_0x5bc624){return _0x5bc624?{'count':_0x42902f,'rows':_0x5bc624}:null;}})[_0x6498('0x1e')](respondWithResult(_0x5bcead,null))[_0x6498('0x27')](handleError(_0x5bcead,null));};exports[_0x6498('0x6e')]=function(_0x12209e,_0x40aafd,_0x13347b){var _0x557d67=_0x12209e['body'][_0x6498('0x6f')];return db[_0x6498('0x70')][_0x6498('0x4f')]({'where':{'id':_0x557d67},'attributes':['id'],'include':[{'model':db[_0x6498('0x65')],'as':_0x6498('0x71'),'attributes':['id',_0x6498('0x37'),_0x6498('0x72'),_0x6498('0x73'),_0x6498('0x74')],'raw':!![]}]})[_0x6498('0x1e')](function(_0x4aa67c){if(_0x4aa67c){var _0x3fbcb1=_[_0x6498('0x75')](_0x4aa67c,function(_0x12dfdc){var _0x1ac9ac=_0x12dfdc['get']({'plain':!![]});return _0x1ac9ac[_0x6498('0x71')];});return db[_0x6498('0x4e')][_0x6498('0x5c')]({'where':{'id':_0x12209e['params']['id']}})[_0x6498('0x1e')](function(_0x3d9d7b){return db[_0x6498('0x76')][_0x6498('0x77')](function(_0x127c54){return _0x3d9d7b[_0x6498('0x6e')](_0x557d67,{'transaction':_0x127c54})[_0x6498('0x1e')](function(){return BPromise[_0x6498('0x78')](_0x3fbcb1,function(_0x2b3f48){return db[_0x6498('0x62')][_0x6498('0x79')]({'where':{'UserId':_0x2b3f48['id'],'ChatQueueId':_0x12209e[_0x6498('0x52')]['id']},'transaction':_0x127c54});});})[_0x6498('0x1e')](function(){_0x3fbcb1[_0x6498('0x7a')](function(_0x3bafcd){socket[_0x6498('0x7b')](_0x6498('0x7c'),{'UserId':_0x3bafcd['id'],'ChatQueueId':_0x3d9d7b['id']});});});});});}})['then'](respondWithStatusCode(_0x40aafd,null))[_0x6498('0x27')](handleError(_0x40aafd,null));};exports[_0x6498('0x7d')]=function(_0x1cdade,_0x2727f7,_0x5386ed){return db[_0x6498('0x70')][_0x6498('0x4f')]({'where':{'id':_0x1cdade[_0x6498('0x3f')][_0x6498('0x6f')]},'attributes':['id'],'include':[{'model':db[_0x6498('0x65')],'as':_0x6498('0x71'),'attributes':['id'],'raw':!![]}]})[_0x6498('0x1e')](handleEntityNotFound(_0x2727f7,null))[_0x6498('0x1e')](function(_0x5b68e3){var _0xbd3a7e=_[_0x6498('0x3a')](_0x5b68e3,'id');var _0x6ed96e=[];var _0x44bf7b=[];var _0x483032=squel[_0x6498('0x7e')]();_0x483032[_0x6498('0x7f')](_0x6498('0x80'))['from'](_0x6498('0x81'),'tq')[_0x6498('0x82')](_0x6498('0x83'),'ut',_0x6498('0x84'))['where'](_0x6498('0x85'),_0x1cdade[_0x6498('0x52')]['id']);for(var _0x5731e6=0x0;_0x5731e6<_0x5b68e3[_0x6498('0x44')];_0x5731e6+=0x1){let _0x3db3c2=_0x5b68e3[_0x5731e6];for(var _0x6105fa=0x0;_0x6105fa<_0x3db3c2[_0x6498('0x71')][_0x6498('0x44')];_0x6105fa+=0x1){let _0x566d71=_0x3db3c2[_0x6498('0x71')][_0x6105fa];var _0x43f265=_0x483032[_0x6498('0x86')]();_0x43f265[_0x6498('0x48')](_0x6498('0x87'),_0x566d71['id']);_0x44bf7b[_0x6498('0x88')](db[_0x6498('0x76')]['query'](_0x43f265[_0x6498('0x89')](),{'type':db['sequelize']['QueryTypes'][_0x6498('0x8a')]})[_0x6498('0x1e')](function(_0x5c2bc3){if(_0x5c2bc3['length']===0x1){return _0x566d71['id'];}else{var _0x2fe0cb=_[_0x6498('0x8b')](_[_0x6498('0x3a')](_0x5c2bc3,_0x6498('0x8c')),function(_0x529cc4){return _[_0x6498('0x8d')](_0xbd3a7e,_0x529cc4);});if(_0x2fe0cb){return _0x566d71['id'];}}}));}}return BPromise[_0x6498('0x8e')](_0x44bf7b)[_0x6498('0x1e')](function(_0x577e11){_0x6ed96e=_(_0x6ed96e)[_0x6498('0x8f')](_0x577e11)[_0x6498('0x90')]()[_0x6498('0x91')]();return db[_0x6498('0x4e')][_0x6498('0x5c')]({'where':{'id':_0x1cdade['params']['id']}})[_0x6498('0x1e')](function(_0x174e03){return db['sequelize'][_0x6498('0x77')](function(_0x3260dc){return _0x174e03[_0x6498('0x7d')](_0x1cdade[_0x6498('0x3f')][_0x6498('0x6f')],{'transaction':_0x3260dc})[_0x6498('0x1e')](function(){if(!_[_0x6498('0x92')](_0x6ed96e)){return _0x174e03['removeAgents'](_0x6ed96e,{'transaction':_0x3260dc});}})[_0x6498('0x1e')](function(){_0x6ed96e[_0x6498('0x7a')](function(_0x13ce9f){socket[_0x6498('0x7b')](_0x6498('0x93'),{'UserId':_0x13ce9f,'ChatQueueId':_0x174e03['id']});});});});});});})[_0x6498('0x1e')](respondWithStatusCode(_0x2727f7,null))[_0x6498('0x27')](handleError(_0x2727f7,null));};exports[_0x6498('0x94')]=function(_0x3c7c38,_0x484df7,_0x1f2d19){return db['ChatQueue'][_0x6498('0x5c')]({'where':{'id':_0x3c7c38[_0x6498('0x52')]['id']}})[_0x6498('0x1e')](handleEntityNotFound(_0x484df7,null))[_0x6498('0x1e')](function(_0x520aa9){if(_0x520aa9){return _0x520aa9[_0x6498('0x94')](_0x3c7c38[_0x6498('0x57')][_0x6498('0x6f')],_['omit'](_0x3c7c38[_0x6498('0x57')],[_0x6498('0x6f'),'id'])||{})['spread'](function(_0x47de8){for(var _0x9388ac=0x0;_0x9388ac<_0x3c7c38[_0x6498('0x57')][_0x6498('0x6f')][_0x6498('0x44')];_0x9388ac+=0x1){socket[_0x6498('0x7b')]('userChatQueue:save',{'UserId':Number(_0x3c7c38['body']['ids'][_0x9388ac]),'ChatQueueId':Number(_0x3c7c38[_0x6498('0x52')]['id'])});}return _0x47de8;});}})[_0x6498('0x1e')](respondWithResult(_0x484df7,null))[_0x6498('0x27')](handleError(_0x484df7,null));};exports['removeAgents']=function(_0x1f5cab,_0x4550e4,_0x3bda1e){return db[_0x6498('0x4e')][_0x6498('0x5c')]({'where':{'id':_0x1f5cab['params']['id']}})[_0x6498('0x1e')](handleEntityNotFound(_0x4550e4,null))[_0x6498('0x1e')](function(_0x20f37d){if(_0x20f37d){return _0x20f37d[_0x6498('0x95')](_0x1f5cab['query']['ids'])['then'](function(){if(_[_0x6498('0x96')](_0x1f5cab['query'][_0x6498('0x6f')])){for(var _0x1c0a9b=0x0;_0x1c0a9b<_0x1f5cab[_0x6498('0x3f')][_0x6498('0x6f')][_0x6498('0x44')];_0x1c0a9b+=0x1){socket[_0x6498('0x7b')]('userChatQueue:remove',{'UserId':Number(_0x1f5cab[_0x6498('0x3f')][_0x6498('0x6f')][_0x1c0a9b]),'ChatQueueId':Number(_0x1f5cab[_0x6498('0x52')]['id'])});}}else{socket['emit'](_0x6498('0x93'),{'UserId':Number(_0x1f5cab[_0x6498('0x3f')]['ids']),'ChatQueueId':Number(_0x1f5cab[_0x6498('0x52')]['id'])});}});}})[_0x6498('0x1e')](respondWithStatusCode(_0x4550e4,null))[_0x6498('0x27')](handleError(_0x4550e4,null));};exports[_0x6498('0x97')]=function(_0x248bf5,_0x390f37,_0x7e3990){var _0x430e91={};var _0x1153bc={};var _0x2dc1be;var _0x4bab0f;return db[_0x6498('0x4e')][_0x6498('0x6c')]({'where':{'id':_0x248bf5[_0x6498('0x52')]['id']}})[_0x6498('0x1e')](handleEntityNotFound(_0x390f37,null))[_0x6498('0x1e')](function(_0x593756){if(_0x593756){_0x2dc1be=_0x593756;_0x1153bc[_0x6498('0x41')]=_['keys'](db[_0x6498('0x65')][_0x6498('0x3b')]);_0x1153bc[_0x6498('0x3f')]=_[_0x6498('0x53')](_0x248bf5[_0x6498('0x3f')]);_0x1153bc['filters']=_['intersection'](_0x1153bc['model'],_0x1153bc['query']);_0x430e91[_0x6498('0x54')]=_[_0x6498('0x42')](_0x1153bc['model'],qs[_0x6498('0x43')](_0x248bf5[_0x6498('0x3f')][_0x6498('0x43')]));_0x430e91['attributes']=_0x430e91['attributes']['length']?_0x430e91[_0x6498('0x54')]:_0x1153bc['model'];_0x430e91['order']=qs[_0x6498('0x47')](_0x248bf5[_0x6498('0x3f')][_0x6498('0x47')]);_0x430e91['where']=qs[_0x6498('0x40')](_[_0x6498('0x49')](_0x248bf5[_0x6498('0x3f')],_0x1153bc[_0x6498('0x40')]));if(_0x248bf5[_0x6498('0x3f')][_0x6498('0x4a')]){_0x430e91[_0x6498('0x48')]=_['merge'](_0x430e91[_0x6498('0x48')],{'$or':_[_0x6498('0x3a')](_0x430e91[_0x6498('0x54')],function(_0x4bc624){var _0x264a42={};_0x264a42[_0x4bc624]={'$like':'%'+_0x248bf5['query'][_0x6498('0x4a')]+'%'};return _0x264a42;})});}_0x430e91=_[_0x6498('0x4b')]({},_0x430e91,_0x248bf5[_0x6498('0x98')]);return _0x2dc1be['getAgents'](_0x430e91);}})[_0x6498('0x1e')](function(_0x115e20){if(_0x115e20){_0x4bab0f=_0x115e20[_0x6498('0x44')];if(!_0x248bf5[_0x6498('0x3f')][_0x6498('0x45')](_0x6498('0x63'))){_0x430e91[_0x6498('0x2c')]=qs[_0x6498('0x2c')](_0x248bf5['query'][_0x6498('0x2c')]);_0x430e91[_0x6498('0x2a')]=qs[_0x6498('0x2a')](_0x248bf5[_0x6498('0x3f')]['offset']);}return _0x2dc1be['getAgents'](_0x430e91);}})[_0x6498('0x1e')](function(_0x4a9d01){if(_0x4a9d01){return _0x4a9d01?{'count':_0x4bab0f,'rows':_0x4a9d01}:null;}})[_0x6498('0x1e')](respondWithResult(_0x390f37,null))[_0x6498('0x27')](handleError(_0x390f37,null));};
\ No newline at end of file
diff --git a/server/api/chatQueue/chatQueue.events.js b/server/api/chatQueue/chatQueue.events.js
index 386e0d4..e6214ea 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 _0x37cb=['emit','hasOwnProperty','hook','exports','events','../../mysqldb','ChatQueue','setMaxListeners','save','update','remove'];(function(_0x2440df,_0x453be8){var _0x1fa6fb=function(_0x1e0417){while(--_0x1e0417){_0x2440df['push'](_0x2440df['shift']());}};_0x1fa6fb(++_0x453be8);}(_0x37cb,0x12d));var _0xb37c=function(_0x9fd887,_0x47f76c){_0x9fd887=_0x9fd887-0x0;var _0x1a54ab=_0x37cb[_0x9fd887];return _0x1a54ab;};'use strict';var EventEmitter=require(_0xb37c('0x0'));var ChatQueue=require(_0xb37c('0x1'))['db'][_0xb37c('0x2')];var ChatQueueEvents=new EventEmitter();ChatQueueEvents[_0xb37c('0x3')](0x0);var events={'afterCreate':_0xb37c('0x4'),'afterUpdate':_0xb37c('0x5'),'afterDestroy':_0xb37c('0x6')};function emitEvent(_0x599668){return function(_0x4afd86,_0xe3fad,_0x2ebee6){ChatQueueEvents[_0xb37c('0x7')](_0x599668+':'+_0x4afd86['id'],_0x4afd86);ChatQueueEvents[_0xb37c('0x7')](_0x599668,_0x4afd86);_0x2ebee6(null);};}for(var e in events){if(events[_0xb37c('0x8')](e)){var event=events[e];ChatQueue[_0xb37c('0x9')](e,emitEvent(event));}}module[_0xb37c('0xa')]=ChatQueueEvents;
\ No newline at end of file
+var _0xe39c=['emit','hasOwnProperty','hook','exports','../../mysqldb','setMaxListeners'];(function(_0x34357e,_0x5af72a){var _0x488189=function(_0xa54a00){while(--_0xa54a00){_0x34357e['push'](_0x34357e['shift']());}};_0x488189(++_0x5af72a);}(_0xe39c,0x136));var _0xce39=function(_0x2ce6a7,_0x4d5a8e){_0x2ce6a7=_0x2ce6a7-0x0;var _0xd1d644=_0xe39c[_0x2ce6a7];return _0xd1d644;};'use strict';var EventEmitter=require('events');var ChatQueue=require(_0xce39('0x0'))['db']['ChatQueue'];var ChatQueueEvents=new EventEmitter();ChatQueueEvents[_0xce39('0x1')](0x0);var events={'afterCreate':'save','afterUpdate':'update','afterDestroy':'remove'};function emitEvent(_0x4333a4){return function(_0x1c0ca2,_0x1e078c,_0x111082){ChatQueueEvents[_0xce39('0x2')](_0x4333a4+':'+_0x1c0ca2['id'],_0x1c0ca2);ChatQueueEvents[_0xce39('0x2')](_0x4333a4,_0x1c0ca2);_0x111082(null);};}for(var e in events){if(events[_0xce39('0x3')](e)){var event=events[e];ChatQueue[_0xce39('0x4')](e,emitEvent(event));}}module[_0xce39('0x5')]=ChatQueueEvents;
\ No newline at end of file
diff --git a/server/api/chatQueue/chatQueue.model.js b/server/api/chatQueue/chatQueue.model.js
index 47e2b85..df9f421 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 _0x380f=['../../config/environment','./chatQueue.attributes','exports','define','ChatQueue','lodash','bluebird','rimraf'];(function(_0x43d06a,_0x2d46b6){var _0x4bd34f=function(_0x33a70b){while(--_0x33a70b){_0x43d06a['push'](_0x43d06a['shift']());}};_0x4bd34f(++_0x2d46b6);}(_0x380f,0x1c5));var _0xf380=function(_0x10f76a,_0x49542e){_0x10f76a=_0x10f76a-0x0;var _0x48540c=_0x380f[_0x10f76a];return _0x48540c;};'use strict';var _=require(_0xf380('0x0'));var util=require('util');var logger=require('../../config/logger')('api');var moment=require('moment');var BPromise=require(_0xf380('0x1'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0xf380('0x2'));var config=require(_0xf380('0x3'));var attributes=require(_0xf380('0x4'));module[_0xf380('0x5')]=function(_0x1cce88,_0x4d1598){return _0x1cce88[_0xf380('0x6')](_0xf380('0x7'),attributes,{'tableName':'chat_queues','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x3469=['chat_queues','util','../../config/logger','api','moment','bluebird','request-promise','path','../../config/environment','./chatQueue.attributes','ChatQueue'];(function(_0x2a14ac,_0x17b35d){var _0x506656=function(_0x4b26b8){while(--_0x4b26b8){_0x2a14ac['push'](_0x2a14ac['shift']());}};_0x506656(++_0x17b35d);}(_0x3469,0x90));var _0x9346=function(_0x2ce0c7,_0x708abd){_0x2ce0c7=_0x2ce0c7-0x0;var _0x15a5be=_0x3469[_0x2ce0c7];return _0x15a5be;};'use strict';var _=require('lodash');var util=require(_0x9346('0x0'));var logger=require(_0x9346('0x1'))(_0x9346('0x2'));var moment=require(_0x9346('0x3'));var BPromise=require(_0x9346('0x4'));var rp=require(_0x9346('0x5'));var fs=require('fs');var path=require(_0x9346('0x6'));var rimraf=require('rimraf');var config=require(_0x9346('0x7'));var attributes=require(_0x9346('0x8'));module['exports']=function(_0x1d56ab,_0x1546b5){return _0x1d56ab['define'](_0x9346('0x9'),attributes,{'tableName':_0x9346('0xa'),'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 304e3ab..dd1f232 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 _0x2f56=['request\x20sent','debug','error','code','message','result','catch','GetChatQueue','ChatQueue','findAll','options','raw','where','attributes','limit','include','map','model','stringify','find','ShowChatQueue','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','redis','localhost','./chatQueue.socket','request','then','info','ChatQueue,\x20%s,\x20%s'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x2f56,0xb5));var _0x62f5=function(_0x376edd,_0x320a46){_0x376edd=_0x376edd-0x0;var _0x123ee3=_0x2f56[_0x376edd];return _0x123ee3;};'use strict';var _=require(_0x62f5('0x0'));var util=require(_0x62f5('0x1'));var moment=require(_0x62f5('0x2'));var BPromise=require(_0x62f5('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x62f5('0x4'));var db=require(_0x62f5('0x5'))['db'];var utils=require(_0x62f5('0x6'));var logger=require(_0x62f5('0x7'))(_0x62f5('0x8'));var config=require('../../config/environment');var jayson=require(_0x62f5('0x9'));var client=jayson[_0x62f5('0xa')][_0x62f5('0xb')]({'port':0x232a});config[_0x62f5('0xc')]=_['defaults'](config[_0x62f5('0xc')],{'host':_0x62f5('0xd'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x62f5('0xc')]));require(_0x62f5('0xe'))['register'](socket);function respondWithRpcPromise(_0x2150bd,_0x1be97f,_0xceb497){return new BPromise(function(_0x58323f,_0x576754){return client[_0x62f5('0xf')](_0x2150bd,_0xceb497)[_0x62f5('0x10')](function(_0x151753){logger[_0x62f5('0x11')](_0x62f5('0x12'),_0x1be97f,_0x62f5('0x13'));logger[_0x62f5('0x14')]('ChatQueue,\x20%s,\x20%s,\x20%s',_0x1be97f,_0x62f5('0x13'),JSON['stringify'](_0x151753));if(_0x151753[_0x62f5('0x15')]){if(_0x151753[_0x62f5('0x15')][_0x62f5('0x16')]===0x1f4){logger[_0x62f5('0x15')]('ChatQueue,\x20%s,\x20%s',_0x1be97f,_0x151753[_0x62f5('0x15')]['message']);return _0x576754(_0x151753[_0x62f5('0x15')][_0x62f5('0x17')]);}logger[_0x62f5('0x15')](_0x62f5('0x12'),_0x1be97f,_0x151753[_0x62f5('0x15')][_0x62f5('0x17')]);return _0x58323f(_0x151753[_0x62f5('0x15')][_0x62f5('0x17')]);}else{logger['info']('ChatQueue,\x20%s,\x20%s',_0x1be97f,_0x62f5('0x13'));_0x58323f(_0x151753[_0x62f5('0x18')]['message']);}})[_0x62f5('0x19')](function(_0x29754f){logger[_0x62f5('0x15')]('ChatQueue,\x20%s,\x20%s',_0x1be97f,_0x29754f);_0x576754(_0x29754f);});});}exports[_0x62f5('0x1a')]=function(_0x160129){var _0x15a397=this;return new Promise(function(_0x5de28a,_0x52fdf6){return db[_0x62f5('0x1b')][_0x62f5('0x1c')]({'raw':_0x160129[_0x62f5('0x1d')]?_0x160129[_0x62f5('0x1d')][_0x62f5('0x1e')]===undefined?!![]:![]:!![],'where':_0x160129[_0x62f5('0x1d')]?_0x160129[_0x62f5('0x1d')][_0x62f5('0x1f')]||null:null,'attributes':_0x160129[_0x62f5('0x1d')]?_0x160129[_0x62f5('0x1d')][_0x62f5('0x20')]||null:null,'limit':_0x160129['options']?_0x160129['options'][_0x62f5('0x21')]||null:null,'include':_0x160129[_0x62f5('0x1d')]?_0x160129[_0x62f5('0x1d')][_0x62f5('0x22')]?_[_0x62f5('0x23')](_0x160129[_0x62f5('0x1d')]['include'],function(_0x28e94a){return{'model':db[_0x28e94a['model']],'as':_0x28e94a['as'],'attributes':_0x28e94a[_0x62f5('0x20')],'include':_0x28e94a['include']?_[_0x62f5('0x23')](_0x28e94a[_0x62f5('0x22')],function(_0x131832){return{'model':db[_0x131832[_0x62f5('0x24')]],'as':_0x131832['as'],'attributes':_0x131832[_0x62f5('0x20')],'include':_0x131832[_0x62f5('0x22')]?_[_0x62f5('0x23')](_0x131832['include'],function(_0x21d2c1){return{'model':db[_0x21d2c1['model']],'as':_0x21d2c1['as'],'attributes':_0x21d2c1['attributes']};}):[]};}):[]};}):[]:[]})['then'](function(_0x2426c7){logger[_0x62f5('0x11')](_0x62f5('0x1a'),_0x160129);logger[_0x62f5('0x14')](_0x62f5('0x1a'),_0x160129,JSON[_0x62f5('0x25')](_0x2426c7));_0x5de28a(_0x2426c7);})['catch'](function(_0x12f805){logger[_0x62f5('0x15')](_0x62f5('0x1a'),_0x12f805[_0x62f5('0x17')],_0x160129);_0x52fdf6(_0x15a397[_0x62f5('0x15')](0x1f4,_0x12f805[_0x62f5('0x17')]));});});};exports['ShowChatQueue']=function(_0x177f89){var _0x511421=this;return new Promise(function(_0x1d2541,_0xa08740){return db['ChatQueue'][_0x62f5('0x26')]({'raw':_0x177f89['options']?_0x177f89['options'][_0x62f5('0x1e')]===undefined?!![]:![]:!![],'where':_0x177f89['options']?_0x177f89[_0x62f5('0x1d')][_0x62f5('0x1f')]||null:null,'attributes':_0x177f89[_0x62f5('0x1d')]?_0x177f89['options']['attributes']||null:null,'include':_0x177f89[_0x62f5('0x1d')]?_0x177f89['options']['include']?_[_0x62f5('0x23')](_0x177f89[_0x62f5('0x1d')]['include'],function(_0x1a277f){return{'model':db[_0x1a277f[_0x62f5('0x24')]],'as':_0x1a277f['as'],'attributes':_0x1a277f[_0x62f5('0x20')],'include':_0x1a277f[_0x62f5('0x22')]?_['map'](_0x1a277f[_0x62f5('0x22')],function(_0x4f6e7d){return{'model':db[_0x4f6e7d[_0x62f5('0x24')]],'as':_0x4f6e7d['as'],'attributes':_0x4f6e7d[_0x62f5('0x20')],'include':_0x4f6e7d[_0x62f5('0x22')]?_['map'](_0x4f6e7d[_0x62f5('0x22')],function(_0x2e4712){return{'model':db[_0x2e4712['model']],'as':_0x2e4712['as'],'attributes':_0x2e4712['attributes']};}):[]};}):[]};}):[]:[]})[_0x62f5('0x10')](function(_0x5ad95d){logger['info']('ShowChatQueue',_0x177f89);logger[_0x62f5('0x14')](_0x62f5('0x27'),_0x177f89,JSON[_0x62f5('0x25')](_0x5ad95d));_0x1d2541(_0x5ad95d);})[_0x62f5('0x19')](function(_0x23edf0){logger['error'](_0x62f5('0x27'),_0x23edf0['message'],_0x177f89);_0xa08740(_0x511421[_0x62f5('0x15')](0x1f4,_0x23edf0[_0x62f5('0x17')]));});});};
\ No newline at end of file
+var _0x9ccd=['ChatQueue,\x20%s,\x20%s,\x20%s','error','message','catch','GetChatQueue','findAll','options','raw','where','attributes','limit','include','map','model','debug','stringify','ShowChatQueue','ChatQueue','find','lodash','moment','bluebird','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','./chatQueue.socket','register','request','then','info','ChatQueue,\x20%s,\x20%s','request\x20sent'];(function(_0x25d1e1,_0x3911ff){var _0xb75e99=function(_0x5e50ce){while(--_0x5e50ce){_0x25d1e1['push'](_0x25d1e1['shift']());}};_0xb75e99(++_0x3911ff);}(_0x9ccd,0x1a3));var _0xd9cc=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x9ccd[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0xd9cc('0x0'));var util=require('util');var moment=require(_0xd9cc('0x1'));var BPromise=require(_0xd9cc('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0xd9cc('0x3'))['db'];var utils=require('../../config/utils');var logger=require(_0xd9cc('0x4'))(_0xd9cc('0x5'));var config=require(_0xd9cc('0x6'));var jayson=require(_0xd9cc('0x7'));var client=jayson[_0xd9cc('0x8')][_0xd9cc('0x9')]({'port':0x232a});config[_0xd9cc('0xa')]=_[_0xd9cc('0xb')](config[_0xd9cc('0xa')],{'host':_0xd9cc('0xc'),'port':0x18eb});var socket=require(_0xd9cc('0xd'))(new Redis(config[_0xd9cc('0xa')]));require(_0xd9cc('0xe'))[_0xd9cc('0xf')](socket);function respondWithRpcPromise(_0xd731e1,_0x383bd4,_0x546ffb){return new BPromise(function(_0x46149b,_0x2b17db){return client[_0xd9cc('0x10')](_0xd731e1,_0x546ffb)[_0xd9cc('0x11')](function(_0x2e8a08){logger[_0xd9cc('0x12')](_0xd9cc('0x13'),_0x383bd4,_0xd9cc('0x14'));logger['debug'](_0xd9cc('0x15'),_0x383bd4,'request\x20sent',JSON['stringify'](_0x2e8a08));if(_0x2e8a08['error']){if(_0x2e8a08['error']['code']===0x1f4){logger[_0xd9cc('0x16')](_0xd9cc('0x13'),_0x383bd4,_0x2e8a08[_0xd9cc('0x16')][_0xd9cc('0x17')]);return _0x2b17db(_0x2e8a08[_0xd9cc('0x16')][_0xd9cc('0x17')]);}logger[_0xd9cc('0x16')]('ChatQueue,\x20%s,\x20%s',_0x383bd4,_0x2e8a08[_0xd9cc('0x16')][_0xd9cc('0x17')]);return _0x46149b(_0x2e8a08['error'][_0xd9cc('0x17')]);}else{logger[_0xd9cc('0x12')](_0xd9cc('0x13'),_0x383bd4,_0xd9cc('0x14'));_0x46149b(_0x2e8a08['result'][_0xd9cc('0x17')]);}})[_0xd9cc('0x18')](function(_0x4fa645){logger[_0xd9cc('0x16')](_0xd9cc('0x13'),_0x383bd4,_0x4fa645);_0x2b17db(_0x4fa645);});});}exports[_0xd9cc('0x19')]=function(_0x4707e3){var _0x471c05=this;return new Promise(function(_0xd69057,_0x59f00d){return db['ChatQueue'][_0xd9cc('0x1a')]({'raw':_0x4707e3[_0xd9cc('0x1b')]?_0x4707e3[_0xd9cc('0x1b')][_0xd9cc('0x1c')]===undefined?!![]:![]:!![],'where':_0x4707e3[_0xd9cc('0x1b')]?_0x4707e3[_0xd9cc('0x1b')][_0xd9cc('0x1d')]||null:null,'attributes':_0x4707e3[_0xd9cc('0x1b')]?_0x4707e3[_0xd9cc('0x1b')][_0xd9cc('0x1e')]||null:null,'limit':_0x4707e3[_0xd9cc('0x1b')]?_0x4707e3[_0xd9cc('0x1b')][_0xd9cc('0x1f')]||null:null,'include':_0x4707e3[_0xd9cc('0x1b')]?_0x4707e3['options'][_0xd9cc('0x20')]?_[_0xd9cc('0x21')](_0x4707e3['options'][_0xd9cc('0x20')],function(_0x1f2727){return{'model':db[_0x1f2727[_0xd9cc('0x22')]],'as':_0x1f2727['as'],'attributes':_0x1f2727[_0xd9cc('0x1e')],'include':_0x1f2727[_0xd9cc('0x20')]?_[_0xd9cc('0x21')](_0x1f2727[_0xd9cc('0x20')],function(_0xa61ac2){return{'model':db[_0xa61ac2[_0xd9cc('0x22')]],'as':_0xa61ac2['as'],'attributes':_0xa61ac2['attributes'],'include':_0xa61ac2[_0xd9cc('0x20')]?_[_0xd9cc('0x21')](_0xa61ac2[_0xd9cc('0x20')],function(_0x381b83){return{'model':db[_0x381b83[_0xd9cc('0x22')]],'as':_0x381b83['as'],'attributes':_0x381b83[_0xd9cc('0x1e')]};}):[]};}):[]};}):[]:[]})[_0xd9cc('0x11')](function(_0x10a7b1){logger['info'](_0xd9cc('0x19'),_0x4707e3);logger[_0xd9cc('0x23')](_0xd9cc('0x19'),_0x4707e3,JSON[_0xd9cc('0x24')](_0x10a7b1));_0xd69057(_0x10a7b1);})[_0xd9cc('0x18')](function(_0x2e147a){logger['error'](_0xd9cc('0x19'),_0x2e147a['message'],_0x4707e3);_0x59f00d(_0x471c05['error'](0x1f4,_0x2e147a[_0xd9cc('0x17')]));});});};exports[_0xd9cc('0x25')]=function(_0x3326ff){var _0x4b20a4=this;return new Promise(function(_0x2b1b5e,_0x4c0c08){return db[_0xd9cc('0x26')][_0xd9cc('0x27')]({'raw':_0x3326ff[_0xd9cc('0x1b')]?_0x3326ff['options'][_0xd9cc('0x1c')]===undefined?!![]:![]:!![],'where':_0x3326ff[_0xd9cc('0x1b')]?_0x3326ff[_0xd9cc('0x1b')]['where']||null:null,'attributes':_0x3326ff[_0xd9cc('0x1b')]?_0x3326ff[_0xd9cc('0x1b')][_0xd9cc('0x1e')]||null:null,'include':_0x3326ff[_0xd9cc('0x1b')]?_0x3326ff[_0xd9cc('0x1b')][_0xd9cc('0x20')]?_[_0xd9cc('0x21')](_0x3326ff['options'][_0xd9cc('0x20')],function(_0x1b9e5c){return{'model':db[_0x1b9e5c[_0xd9cc('0x22')]],'as':_0x1b9e5c['as'],'attributes':_0x1b9e5c['attributes'],'include':_0x1b9e5c[_0xd9cc('0x20')]?_[_0xd9cc('0x21')](_0x1b9e5c[_0xd9cc('0x20')],function(_0x166085){return{'model':db[_0x166085['model']],'as':_0x166085['as'],'attributes':_0x166085[_0xd9cc('0x1e')],'include':_0x166085[_0xd9cc('0x20')]?_[_0xd9cc('0x21')](_0x166085[_0xd9cc('0x20')],function(_0x326441){return{'model':db[_0x326441[_0xd9cc('0x22')]],'as':_0x326441['as'],'attributes':_0x326441[_0xd9cc('0x1e')]};}):[]};}):[]};}):[]:[]})[_0xd9cc('0x11')](function(_0x42fa8a){logger[_0xd9cc('0x12')](_0xd9cc('0x25'),_0x3326ff);logger['debug'](_0xd9cc('0x25'),_0x3326ff,JSON[_0xd9cc('0x24')](_0x42fa8a));_0x2b1b5e(_0x42fa8a);})[_0xd9cc('0x18')](function(_0x1667c3){logger[_0xd9cc('0x16')](_0xd9cc('0x25'),_0x1667c3['message'],_0x3326ff);_0x4c0c08(_0x4b20a4[_0xd9cc('0x16')](0x1f4,_0x1667c3[_0xd9cc('0x17')]));});});};
\ No newline at end of file
diff --git a/server/api/chatQueue/chatQueue.socket.js b/server/api/chatQueue/chatQueue.socket.js
index ed411f8..a8fcb29 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 _0xbd50=['length','./chatQueue.events','save','remove','emit'];(function(_0x529111,_0x5988fd){var _0x5afa9a=function(_0x46a0bc){while(--_0x46a0bc){_0x529111['push'](_0x529111['shift']());}};_0x5afa9a(++_0x5988fd);}(_0xbd50,0x196));var _0x0bd5=function(_0x523b6c,_0x1f102c){_0x523b6c=_0x523b6c-0x0;var _0x4f6771=_0xbd50[_0x523b6c];return _0x4f6771;};'use strict';var ChatQueueEvents=require(_0x0bd5('0x0'));var events=[_0x0bd5('0x1'),_0x0bd5('0x2'),'update'];function createListener(_0x44fcb9,_0x167372){return function(_0x37acba){_0x167372[_0x0bd5('0x3')](_0x44fcb9,_0x37acba);};}function removeListener(_0x15620d,_0x4c17ee){return function(){ChatQueueEvents['removeListener'](_0x15620d,_0x4c17ee);};}exports['register']=function(_0x376024){for(var _0x2ef1d0=0x0,_0xcc6cfa=events[_0x0bd5('0x4')];_0x2ef1d0<_0xcc6cfa;_0x2ef1d0++){var _0x1b99f3=events[_0x2ef1d0];var _0x5ebe64=createListener('chatQueue:'+_0x1b99f3,_0x376024);ChatQueueEvents['on'](_0x1b99f3,_0x5ebe64);}};
\ No newline at end of file
+var _0x579c=['chatQueue:','./chatQueue.events','save','remove','update','removeListener','register'];(function(_0x1a189c,_0x460fb7){var _0x2c97a6=function(_0x396728){while(--_0x396728){_0x1a189c['push'](_0x1a189c['shift']());}};_0x2c97a6(++_0x460fb7);}(_0x579c,0xda));var _0xc579=function(_0x39c7bc,_0x52cbca){_0x39c7bc=_0x39c7bc-0x0;var _0x3aaed4=_0x579c[_0x39c7bc];return _0x3aaed4;};'use strict';var ChatQueueEvents=require(_0xc579('0x0'));var events=[_0xc579('0x1'),_0xc579('0x2'),_0xc579('0x3')];function createListener(_0x397136,_0x586948){return function(_0x1e2808){_0x586948['emit'](_0x397136,_0x1e2808);};}function removeListener(_0x21a0a2,_0x3b913c){return function(){ChatQueueEvents[_0xc579('0x4')](_0x21a0a2,_0x3b913c);};}exports[_0xc579('0x5')]=function(_0x124ee5){for(var _0x1bd276=0x0,_0x2e451b=events['length'];_0x1bd276<_0x2e451b;_0x1bd276++){var _0x1c6d9c=events[_0x1bd276];var _0x293c4a=createListener(_0xc579('0x6')+_0x1c6d9c,_0x124ee5);ChatQueueEvents['on'](_0x1c6d9c,_0x293c4a);}};
\ No newline at end of file
diff --git a/server/api/chatQueue/index.js b/server/api/chatQueue/index.js
index ec61e33..b020359 100644
--- a/server/api/chatQueue/index.js
+++ b/server/api/chatQueue/index.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x3e74=['../../config/environment','./chatQueue.controller','get','isAuthenticated','index','/describe','describe','/:id','show','getMembers','/:id/teams','getTeams','getAgents','post','addTeams','addAgents','put','delete','removeTeams','/:id/users','removeAgents','exports','multer','path','connect-timeout','express','../../components/auth/service'];(function(_0x122ef9,_0x451d2a){var _0x42fba0=function(_0x17c9d3){while(--_0x17c9d3){_0x122ef9['push'](_0x122ef9['shift']());}};_0x42fba0(++_0x451d2a);}(_0x3e74,0x175));var _0x43e7=function(_0x189ba7,_0x46a2cf){_0x189ba7=_0x189ba7-0x0;var _0x574ebe=_0x3e74[_0x189ba7];return _0x574ebe;};'use strict';var multer=require(_0x43e7('0x0'));var util=require('util');var path=require(_0x43e7('0x1'));var timeout=require(_0x43e7('0x2'));var express=require(_0x43e7('0x3'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0x43e7('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0x43e7('0x5'));var controller=require(_0x43e7('0x6'));router[_0x43e7('0x7')]('/',auth[_0x43e7('0x8')](),controller[_0x43e7('0x9')]);router['get'](_0x43e7('0xa'),auth[_0x43e7('0x8')](),controller[_0x43e7('0xb')]);router[_0x43e7('0x7')](_0x43e7('0xc'),auth['isAuthenticated'](),controller[_0x43e7('0xd')]);router['get']('/:id/members',auth[_0x43e7('0x8')](),controller[_0x43e7('0xe')]);router['get'](_0x43e7('0xf'),auth['isAuthenticated'](),controller[_0x43e7('0x10')]);router[_0x43e7('0x7')]('/:id/users',auth[_0x43e7('0x8')](),controller[_0x43e7('0x11')]);router[_0x43e7('0x12')]('/',auth[_0x43e7('0x8')](),controller['create']);router['post'](_0x43e7('0xf'),auth[_0x43e7('0x8')](),controller[_0x43e7('0x13')]);router['post']('/:id/users',auth[_0x43e7('0x8')](),controller[_0x43e7('0x14')]);router[_0x43e7('0x15')](_0x43e7('0xc'),auth['isAuthenticated'](),controller['update']);router[_0x43e7('0x16')](_0x43e7('0xc'),auth[_0x43e7('0x8')](),controller['destroy']);router['delete'](_0x43e7('0xf'),auth[_0x43e7('0x8')](),controller[_0x43e7('0x17')]);router[_0x43e7('0x16')](_0x43e7('0x18'),auth[_0x43e7('0x8')](),controller[_0x43e7('0x19')]);module[_0x43e7('0x1a')]=router;
\ No newline at end of file
+var _0x814b=['/:id/members','getMembers','/:id/teams','getTeams','/:id/users','getAgents','post','create','addTeams','addAgents','put','update','delete','removeTeams','removeAgents','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatQueue.controller','get','isAuthenticated','/describe','describe','/:id','show'];(function(_0x560a06,_0x41d936){var _0x1a72eb=function(_0x3d0ce2){while(--_0x3d0ce2){_0x560a06['push'](_0x560a06['shift']());}};_0x1a72eb(++_0x41d936);}(_0x814b,0x1a2));var _0xb814=function(_0x48c2ae,_0x4cea90){_0x48c2ae=_0x48c2ae-0x0;var _0x8f7531=_0x814b[_0x48c2ae];return _0x8f7531;};'use strict';var multer=require(_0xb814('0x0'));var util=require(_0xb814('0x1'));var path=require(_0xb814('0x2'));var timeout=require(_0xb814('0x3'));var express=require(_0xb814('0x4'));var router=express[_0xb814('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0xb814('0x6'));var interaction=require(_0xb814('0x7'));var config=require(_0xb814('0x8'));var controller=require(_0xb814('0x9'));router[_0xb814('0xa')]('/',auth[_0xb814('0xb')](),controller['index']);router[_0xb814('0xa')](_0xb814('0xc'),auth['isAuthenticated'](),controller[_0xb814('0xd')]);router[_0xb814('0xa')](_0xb814('0xe'),auth[_0xb814('0xb')](),controller[_0xb814('0xf')]);router[_0xb814('0xa')](_0xb814('0x10'),auth[_0xb814('0xb')](),controller[_0xb814('0x11')]);router[_0xb814('0xa')](_0xb814('0x12'),auth['isAuthenticated'](),controller[_0xb814('0x13')]);router['get'](_0xb814('0x14'),auth[_0xb814('0xb')](),controller[_0xb814('0x15')]);router[_0xb814('0x16')]('/',auth[_0xb814('0xb')](),controller[_0xb814('0x17')]);router[_0xb814('0x16')](_0xb814('0x12'),auth[_0xb814('0xb')](),controller[_0xb814('0x18')]);router[_0xb814('0x16')](_0xb814('0x14'),auth[_0xb814('0xb')](),controller[_0xb814('0x19')]);router[_0xb814('0x1a')](_0xb814('0xe'),auth[_0xb814('0xb')](),controller[_0xb814('0x1b')]);router[_0xb814('0x1c')](_0xb814('0xe'),auth[_0xb814('0xb')](),controller['destroy']);router[_0xb814('0x1c')]('/:id/teams',auth[_0xb814('0xb')](),controller[_0xb814('0x1d')]);router['delete']('/:id/users',auth['isAuthenticated'](),controller[_0xb814('0x1e')]);module['exports']=router;
\ No newline at end of file
diff --git a/server/api/chatQueueReport/chatQueueReport.attributes.js b/server/api/chatQueueReport/chatQueueReport.attributes.js
index bf4d5e6..00d51f9 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 _0x4fed=['STRING','DATE','exports'];(function(_0x21a9d9,_0x4d5ac8){var _0x46adce=function(_0xfdd336){while(--_0xfdd336){_0x21a9d9['push'](_0x21a9d9['shift']());}};_0x46adce(++_0x4d5ac8);}(_0x4fed,0x107));var _0xd4fe=function(_0x946518,_0x22816f){_0x946518=_0x946518-0x0;var _0x909b69=_0x4fed[_0x946518];return _0x909b69;};'use strict';var moment=require('moment');var Sequelize=require('sequelize');module[_0xd4fe('0x0')]={'uniqueid':{'type':Sequelize[_0xd4fe('0x1')],'allowNull':![]},'from':{'type':Sequelize['STRING']},'joinAt':{'type':Sequelize[_0xd4fe('0x2')]},'leaveAt':{'type':Sequelize[_0xd4fe('0x2')]},'acceptAt':{'type':Sequelize[_0xd4fe('0x2')]},'exitAt':{'type':Sequelize[_0xd4fe('0x2')]},'reason':{'type':Sequelize[_0xd4fe('0x1')]}};
\ No newline at end of file
+var _0xdd04=['STRING','DATE','sequelize','exports'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xdd04,0xde));var _0x4dd0=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xdd04[_0x3dd15e];return _0x231fd0;};'use strict';var moment=require('moment');var Sequelize=require(_0x4dd0('0x0'));module[_0x4dd0('0x1')]={'uniqueid':{'type':Sequelize[_0x4dd0('0x2')],'allowNull':![]},'from':{'type':Sequelize[_0x4dd0('0x2')]},'joinAt':{'type':Sequelize[_0x4dd0('0x3')]},'leaveAt':{'type':Sequelize['DATE']},'acceptAt':{'type':Sequelize[_0x4dd0('0x3')]},'exitAt':{'type':Sequelize[_0x4dd0('0x3')]},'reason':{'type':Sequelize[_0x4dd0('0x2')]}};
\ No newline at end of file
diff --git a/server/api/chatQueueReport/chatQueueReport.controller.js b/server/api/chatQueueReport/chatQueueReport.controller.js
index 7a34795..86cbf11 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 _0x0024=['filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','VIRTUAL','filter','merge','options','count','includeAll','include','findAll','rows','catch','show','find','create','body','params','describe','rimraf','fast-json-patch','moment','util','path','ejs','fs-extra','lodash','squel','jsforce','desk.js','to-csv','querystring','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/license/util','../../mysqldb','sendStatus','status','end','offset','undefined','limit','Content-Range','json','apply','reject','save','update','then','destroy','error','stack','name','index','ChatQueueReport','rawAttributes','key','model','map','query','keys'];(function(_0x48aca4,_0x470f4f){var _0x39af1b=function(_0x53cf6f){while(--_0x53cf6f){_0x48aca4['push'](_0x48aca4['shift']());}};_0x39af1b(++_0x470f4f);}(_0x0024,0xa8));var _0x4002=function(_0x373d0a,_0x3075d6){_0x373d0a=_0x373d0a-0x0;var _0x2b9b88=_0x0024[_0x373d0a];return _0x2b9b88;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x4002('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0x4002('0x1'));var rp=require('request-promise');var moment=require(_0x4002('0x2'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x4002('0x3'));var path=require(_0x4002('0x4'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x4002('0x5'));var fs=require('fs');var fs_extra=require(_0x4002('0x6'));var _=require(_0x4002('0x7'));var squel=require(_0x4002('0x8'));var crypto=require('crypto');var jsforce=require(_0x4002('0x9'));var deskjs=require(_0x4002('0xa'));var toCsv=require(_0x4002('0xb'));var querystring=require(_0x4002('0xc'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x4002('0xd'));var qs=require(_0x4002('0xe'));var as=require(_0x4002('0xf'));var hardwareService=require(_0x4002('0x10'));var logger=require(_0x4002('0x11'))('api');var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0x4002('0x12'));var db=require(_0x4002('0x13'))['db'];function respondWithStatusCode(_0x1607e1,_0x29705c){_0x29705c=_0x29705c||0xcc;return function(_0x51c3cf){if(_0x51c3cf){return _0x1607e1[_0x4002('0x14')](_0x29705c);}return _0x1607e1[_0x4002('0x15')](_0x29705c)[_0x4002('0x16')]();};}function respondWithResult(_0x2db141,_0x46d1c1){_0x46d1c1=_0x46d1c1||0xc8;return function(_0x50a1a8){if(_0x50a1a8){return _0x2db141[_0x4002('0x15')](_0x46d1c1)['json'](_0x50a1a8);}};}function respondWithFilteredResult(_0x2f512d,_0x9631cb){return function(_0x213c05){if(_0x213c05){var _0x5813ff=typeof _0x9631cb[_0x4002('0x17')]==='undefined'&&typeof _0x9631cb['limit']===_0x4002('0x18');var _0x3facc1=_0x213c05['count'];var _0x1b3401=_0x5813ff?0x0:_0x9631cb['offset'];var _0x553918=_0x5813ff?_0x213c05['count']:_0x9631cb[_0x4002('0x17')]+_0x9631cb[_0x4002('0x19')];var _0x283708;if(_0x553918>=_0x3facc1){_0x553918=_0x3facc1;_0x283708=0xc8;}else{_0x283708=0xce;}_0x2f512d[_0x4002('0x15')](_0x283708);return _0x2f512d['set'](_0x4002('0x1a'),_0x1b3401+'-'+_0x553918+'/'+_0x3facc1)[_0x4002('0x1b')](_0x213c05);}return null;};}function patchUpdates(_0x172317){return function(_0x48ac6f){try{jsonpatch[_0x4002('0x1c')](_0x48ac6f,_0x172317,!![]);}catch(_0x51b709){return BPromise[_0x4002('0x1d')](_0x51b709);}return _0x48ac6f[_0x4002('0x1e')]();};}function saveUpdates(_0x2bc0c4,_0x5f29cb){return function(_0x52add8){if(_0x52add8){return _0x52add8[_0x4002('0x1f')](_0x2bc0c4)[_0x4002('0x20')](function(_0x254b67){return _0x254b67;});}return null;};}function removeEntity(_0x4c0ed7,_0x468d6e){return function(_0x27732c){if(_0x27732c){return _0x27732c[_0x4002('0x21')]()[_0x4002('0x20')](function(){_0x4c0ed7[_0x4002('0x15')](0xcc)['end']();});}};}function handleEntityNotFound(_0x3396d8,_0x1dfb81){return function(_0x385c35){if(!_0x385c35){_0x3396d8[_0x4002('0x14')](0x194);}return _0x385c35;};}function handleError(_0x31c601,_0x2087d5){_0x2087d5=_0x2087d5||0x1f4;return function(_0x55aca1){logger[_0x4002('0x22')](_0x55aca1[_0x4002('0x23')]);if(_0x55aca1['name']){delete _0x55aca1[_0x4002('0x24')];}_0x31c601[_0x4002('0x15')](_0x2087d5)['send'](_0x55aca1);};}exports[_0x4002('0x25')]=function(_0x278907,_0x227fc8){var _0x13a8f7={},_0x6e9b00={},_0x37ee79={'count':0x0,'rows':[]};var _0x153f1f=_['map'](db[_0x4002('0x26')][_0x4002('0x27')],function(_0x237704){return{'name':_0x237704['fieldName'],'type':_0x237704['type'][_0x4002('0x28')]};});_0x6e9b00[_0x4002('0x29')]=_[_0x4002('0x2a')](_0x153f1f,_0x4002('0x24'));_0x6e9b00[_0x4002('0x2b')]=_[_0x4002('0x2c')](_0x278907[_0x4002('0x2b')]);_0x6e9b00[_0x4002('0x2d')]=_[_0x4002('0x2e')](_0x6e9b00[_0x4002('0x29')],_0x6e9b00['query']);_0x13a8f7[_0x4002('0x2f')]=_[_0x4002('0x2e')](_0x6e9b00[_0x4002('0x29')],qs['fields'](_0x278907[_0x4002('0x2b')][_0x4002('0x30')]));_0x13a8f7[_0x4002('0x2f')]=_0x13a8f7['attributes'][_0x4002('0x31')]?_0x13a8f7[_0x4002('0x2f')]:_0x6e9b00[_0x4002('0x29')];if(!_0x278907[_0x4002('0x2b')][_0x4002('0x32')](_0x4002('0x33'))){_0x13a8f7[_0x4002('0x19')]=qs['limit'](_0x278907[_0x4002('0x2b')][_0x4002('0x19')]);_0x13a8f7['offset']=qs['offset'](_0x278907[_0x4002('0x2b')][_0x4002('0x17')]);}_0x13a8f7[_0x4002('0x34')]=qs[_0x4002('0x35')](_0x278907[_0x4002('0x2b')][_0x4002('0x35')]);_0x13a8f7[_0x4002('0x36')]=qs[_0x4002('0x2d')](_['pick'](_0x278907[_0x4002('0x2b')],_0x6e9b00[_0x4002('0x2d')]),_0x153f1f);if(_0x278907[_0x4002('0x2b')]['filter']){_0x13a8f7[_0x4002('0x36')]=_['merge'](_0x13a8f7[_0x4002('0x36')],{'$or':_['map'](_0x153f1f,function(_0x499bb0){if(_0x499bb0['type']!==_0x4002('0x37')){var _0x51d828={};_0x51d828[_0x499bb0['name']]={'$like':'%'+_0x278907['query'][_0x4002('0x38')]+'%'};return _0x51d828;}})});}_0x13a8f7=_[_0x4002('0x39')]({},_0x13a8f7,_0x278907[_0x4002('0x3a')]);var _0x5d65c1={'where':_0x13a8f7[_0x4002('0x36')]};return db[_0x4002('0x26')][_0x4002('0x3b')](_0x5d65c1)[_0x4002('0x20')](function(_0x14f2f1){_0x37ee79[_0x4002('0x3b')]=_0x14f2f1;if(_0x278907['query'][_0x4002('0x3c')]){_0x13a8f7[_0x4002('0x3d')]=[{'all':!![]}];}return db[_0x4002('0x26')][_0x4002('0x3e')](_0x13a8f7);})[_0x4002('0x20')](function(_0x579e24){_0x37ee79[_0x4002('0x3f')]=_0x579e24;return _0x37ee79;})['then'](respondWithFilteredResult(_0x227fc8,_0x13a8f7))[_0x4002('0x40')](handleError(_0x227fc8,null));};exports[_0x4002('0x41')]=function(_0x488875,_0x5810b4){var _0x39dfba={'raw':!![],'where':{'id':_0x488875['params']['id']}},_0xb0bb62={};_0xb0bb62['model']=_[_0x4002('0x2c')](db[_0x4002('0x26')]['rawAttributes']);_0xb0bb62[_0x4002('0x2b')]=_[_0x4002('0x2c')](_0x488875[_0x4002('0x2b')]);_0xb0bb62[_0x4002('0x2d')]=_[_0x4002('0x2e')](_0xb0bb62[_0x4002('0x29')],_0xb0bb62[_0x4002('0x2b')]);_0x39dfba[_0x4002('0x2f')]=_['intersection'](_0xb0bb62['model'],qs['fields'](_0x488875[_0x4002('0x2b')]['fields']));_0x39dfba[_0x4002('0x2f')]=_0x39dfba['attributes'][_0x4002('0x31')]?_0x39dfba[_0x4002('0x2f')]:_0xb0bb62[_0x4002('0x29')];if(_0x488875['query'][_0x4002('0x3c')]){_0x39dfba['include']=[{'all':!![]}];}_0x39dfba=_['merge']({},_0x39dfba,_0x488875[_0x4002('0x3a')]);return db[_0x4002('0x26')][_0x4002('0x42')](_0x39dfba)[_0x4002('0x20')](handleEntityNotFound(_0x5810b4,null))['then'](respondWithResult(_0x5810b4,null))['catch'](handleError(_0x5810b4,null));};exports[_0x4002('0x43')]=function(_0x27bbb2,_0x424f9b){return db['ChatQueueReport'][_0x4002('0x43')](_0x27bbb2['body'],{})[_0x4002('0x20')](respondWithResult(_0x424f9b,0xc9))['catch'](handleError(_0x424f9b,null));};exports['update']=function(_0x25d4db,_0x2c95e2){if(_0x25d4db['body']['id']){delete _0x25d4db[_0x4002('0x44')]['id'];}return db[_0x4002('0x26')][_0x4002('0x42')]({'where':{'id':_0x25d4db[_0x4002('0x45')]['id']}})['then'](handleEntityNotFound(_0x2c95e2,null))['then'](saveUpdates(_0x25d4db[_0x4002('0x44')],null))['then'](respondWithResult(_0x2c95e2,null))['catch'](handleError(_0x2c95e2,null));};exports['destroy']=function(_0xe374cb,_0x1ac24b){return db['ChatQueueReport'][_0x4002('0x42')]({'where':{'id':_0xe374cb[_0x4002('0x45')]['id']}})[_0x4002('0x20')](handleEntityNotFound(_0x1ac24b,null))[_0x4002('0x20')](removeEntity(_0x1ac24b,null))[_0x4002('0x40')](handleError(_0x1ac24b,null));};exports[_0x4002('0x46')]=function(_0x500af3,_0x450660){return db[_0x4002('0x26')]['describe']()[_0x4002('0x20')](respondWithResult(_0x450660,null))[_0x4002('0x40')](handleError(_0x450660,null));};
\ No newline at end of file
+var _0xc319=['zip-dir','request-promise','moment','mustache','util','path','sox','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','to-csv','querystring','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','offset','undefined','limit','count','Content-Range','json','apply','save','then','destroy','name','send','map','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','order','sort','where','pick','VIRTUAL','filter','merge','options','ChatQueueReport','includeAll','include','findAll','rows','show','params','catch','create','update','find','body','describe','eml-format','rimraf'];(function(_0x21a60b,_0x23cd68){var _0x170b5f=function(_0x2f813b){while(--_0x2f813b){_0x21a60b['push'](_0x21a60b['shift']());}};_0x170b5f(++_0x23cd68);}(_0xc319,0x12e));var _0x9c31=function(_0x34cd7c,_0x53b0c0){_0x34cd7c=_0x34cd7c-0x0;var _0x2b167a=_0xc319[_0x34cd7c];return _0x2b167a;};'use strict';var emlformat=require(_0x9c31('0x0'));var rimraf=require(_0x9c31('0x1'));var zipdir=require(_0x9c31('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x9c31('0x3'));var moment=require(_0x9c31('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x9c31('0x5'));var util=require(_0x9c31('0x6'));var path=require(_0x9c31('0x7'));var sox=require(_0x9c31('0x8'));var csv=require('to-csv');var ejs=require(_0x9c31('0x9'));var fs=require('fs');var fs_extra=require(_0x9c31('0xa'));var _=require(_0x9c31('0xb'));var squel=require(_0x9c31('0xc'));var crypto=require(_0x9c31('0xd'));var jsforce=require(_0x9c31('0xe'));var deskjs=require(_0x9c31('0xf'));var toCsv=require(_0x9c31('0x10'));var querystring=require(_0x9c31('0x11'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x9c31('0x12'));var as=require(_0x9c31('0x13'));var hardwareService=require(_0x9c31('0x14'));var logger=require(_0x9c31('0x15'))(_0x9c31('0x16'));var utils=require('../../config/utils');var config=require(_0x9c31('0x17'));var licenseUtil=require(_0x9c31('0x18'));var db=require(_0x9c31('0x19'))['db'];function respondWithStatusCode(_0x4d0175,_0x2012b1){_0x2012b1=_0x2012b1||0xcc;return function(_0x30fc7f){if(_0x30fc7f){return _0x4d0175[_0x9c31('0x1a')](_0x2012b1);}return _0x4d0175[_0x9c31('0x1b')](_0x2012b1)[_0x9c31('0x1c')]();};}function respondWithResult(_0x4d9601,_0x52037f){_0x52037f=_0x52037f||0xc8;return function(_0x513815){if(_0x513815){return _0x4d9601['status'](_0x52037f)['json'](_0x513815);}};}function respondWithFilteredResult(_0x13ba85,_0xb2e9b9){return function(_0x57a4ff){if(_0x57a4ff){var _0x3df9ad=typeof _0xb2e9b9[_0x9c31('0x1d')]===_0x9c31('0x1e')&&typeof _0xb2e9b9[_0x9c31('0x1f')]===_0x9c31('0x1e');var _0x5eec43=_0x57a4ff[_0x9c31('0x20')];var _0x47b5a7=_0x3df9ad?0x0:_0xb2e9b9[_0x9c31('0x1d')];var _0x4aacad=_0x3df9ad?_0x57a4ff[_0x9c31('0x20')]:_0xb2e9b9['offset']+_0xb2e9b9[_0x9c31('0x1f')];var _0x3ae089;if(_0x4aacad>=_0x5eec43){_0x4aacad=_0x5eec43;_0x3ae089=0xc8;}else{_0x3ae089=0xce;}_0x13ba85[_0x9c31('0x1b')](_0x3ae089);return _0x13ba85['set'](_0x9c31('0x21'),_0x47b5a7+'-'+_0x4aacad+'/'+_0x5eec43)[_0x9c31('0x22')](_0x57a4ff);}return null;};}function patchUpdates(_0x417360){return function(_0x4f8363){try{jsonpatch[_0x9c31('0x23')](_0x4f8363,_0x417360,!![]);}catch(_0x34eca6){return BPromise['reject'](_0x34eca6);}return _0x4f8363[_0x9c31('0x24')]();};}function saveUpdates(_0x297bc0,_0x316917){return function(_0x9fb534){if(_0x9fb534){return _0x9fb534['update'](_0x297bc0)[_0x9c31('0x25')](function(_0x3f66ee){return _0x3f66ee;});}return null;};}function removeEntity(_0x456d29,_0x438a05){return function(_0x3cfeba){if(_0x3cfeba){return _0x3cfeba[_0x9c31('0x26')]()[_0x9c31('0x25')](function(){_0x456d29['status'](0xcc)[_0x9c31('0x1c')]();});}};}function handleEntityNotFound(_0x1b9600,_0x2b9cd2){return function(_0x28297e){if(!_0x28297e){_0x1b9600[_0x9c31('0x1a')](0x194);}return _0x28297e;};}function handleError(_0x3a9b00,_0x5206c2){_0x5206c2=_0x5206c2||0x1f4;return function(_0x183916){logger['error'](_0x183916['stack']);if(_0x183916[_0x9c31('0x27')]){delete _0x183916[_0x9c31('0x27')];}_0x3a9b00[_0x9c31('0x1b')](_0x5206c2)[_0x9c31('0x28')](_0x183916);};}exports['index']=function(_0xa43ac0,_0x1273dd){var _0x30e8c3={},_0x2f7208={},_0x294039={'count':0x0,'rows':[]};var _0x8f7f55=_[_0x9c31('0x29')](db['ChatQueueReport'][_0x9c31('0x2a')],function(_0x2acfca){return{'name':_0x2acfca[_0x9c31('0x2b')],'type':_0x2acfca[_0x9c31('0x2c')][_0x9c31('0x2d')]};});_0x2f7208[_0x9c31('0x2e')]=_[_0x9c31('0x29')](_0x8f7f55,_0x9c31('0x27'));_0x2f7208[_0x9c31('0x2f')]=_[_0x9c31('0x30')](_0xa43ac0[_0x9c31('0x2f')]);_0x2f7208[_0x9c31('0x31')]=_[_0x9c31('0x32')](_0x2f7208['model'],_0x2f7208['query']);_0x30e8c3[_0x9c31('0x33')]=_[_0x9c31('0x32')](_0x2f7208[_0x9c31('0x2e')],qs[_0x9c31('0x34')](_0xa43ac0['query'][_0x9c31('0x34')]));_0x30e8c3[_0x9c31('0x33')]=_0x30e8c3[_0x9c31('0x33')][_0x9c31('0x35')]?_0x30e8c3[_0x9c31('0x33')]:_0x2f7208[_0x9c31('0x2e')];if(!_0xa43ac0[_0x9c31('0x2f')][_0x9c31('0x36')]('nolimit')){_0x30e8c3[_0x9c31('0x1f')]=qs[_0x9c31('0x1f')](_0xa43ac0[_0x9c31('0x2f')]['limit']);_0x30e8c3[_0x9c31('0x1d')]=qs[_0x9c31('0x1d')](_0xa43ac0[_0x9c31('0x2f')]['offset']);}_0x30e8c3[_0x9c31('0x37')]=qs[_0x9c31('0x38')](_0xa43ac0['query']['sort']);_0x30e8c3[_0x9c31('0x39')]=qs[_0x9c31('0x31')](_[_0x9c31('0x3a')](_0xa43ac0[_0x9c31('0x2f')],_0x2f7208[_0x9c31('0x31')]),_0x8f7f55);if(_0xa43ac0[_0x9c31('0x2f')]['filter']){_0x30e8c3[_0x9c31('0x39')]=_['merge'](_0x30e8c3[_0x9c31('0x39')],{'$or':_[_0x9c31('0x29')](_0x8f7f55,function(_0xc52dbd){if(_0xc52dbd[_0x9c31('0x2c')]!==_0x9c31('0x3b')){var _0x393439={};_0x393439[_0xc52dbd['name']]={'$like':'%'+_0xa43ac0['query'][_0x9c31('0x3c')]+'%'};return _0x393439;}})});}_0x30e8c3=_[_0x9c31('0x3d')]({},_0x30e8c3,_0xa43ac0[_0x9c31('0x3e')]);var _0x3939a9={'where':_0x30e8c3[_0x9c31('0x39')]};return db[_0x9c31('0x3f')][_0x9c31('0x20')](_0x3939a9)[_0x9c31('0x25')](function(_0x2bb1ab){_0x294039['count']=_0x2bb1ab;if(_0xa43ac0[_0x9c31('0x2f')][_0x9c31('0x40')]){_0x30e8c3[_0x9c31('0x41')]=[{'all':!![]}];}return db['ChatQueueReport'][_0x9c31('0x42')](_0x30e8c3);})[_0x9c31('0x25')](function(_0x315b43){_0x294039[_0x9c31('0x43')]=_0x315b43;return _0x294039;})[_0x9c31('0x25')](respondWithFilteredResult(_0x1273dd,_0x30e8c3))['catch'](handleError(_0x1273dd,null));};exports[_0x9c31('0x44')]=function(_0xd294a4,_0x2805ea){var _0x592fce={'raw':!![],'where':{'id':_0xd294a4[_0x9c31('0x45')]['id']}},_0x424c2a={};_0x424c2a[_0x9c31('0x2e')]=_[_0x9c31('0x30')](db[_0x9c31('0x3f')][_0x9c31('0x2a')]);_0x424c2a[_0x9c31('0x2f')]=_['keys'](_0xd294a4['query']);_0x424c2a[_0x9c31('0x31')]=_[_0x9c31('0x32')](_0x424c2a[_0x9c31('0x2e')],_0x424c2a[_0x9c31('0x2f')]);_0x592fce[_0x9c31('0x33')]=_['intersection'](_0x424c2a['model'],qs[_0x9c31('0x34')](_0xd294a4[_0x9c31('0x2f')][_0x9c31('0x34')]));_0x592fce[_0x9c31('0x33')]=_0x592fce[_0x9c31('0x33')][_0x9c31('0x35')]?_0x592fce[_0x9c31('0x33')]:_0x424c2a[_0x9c31('0x2e')];if(_0xd294a4['query'][_0x9c31('0x40')]){_0x592fce['include']=[{'all':!![]}];}_0x592fce=_['merge']({},_0x592fce,_0xd294a4[_0x9c31('0x3e')]);return db[_0x9c31('0x3f')]['find'](_0x592fce)['then'](handleEntityNotFound(_0x2805ea,null))[_0x9c31('0x25')](respondWithResult(_0x2805ea,null))[_0x9c31('0x46')](handleError(_0x2805ea,null));};exports[_0x9c31('0x47')]=function(_0x527057,_0x1dda1c){return db[_0x9c31('0x3f')][_0x9c31('0x47')](_0x527057['body'],{})[_0x9c31('0x25')](respondWithResult(_0x1dda1c,0xc9))[_0x9c31('0x46')](handleError(_0x1dda1c,null));};exports[_0x9c31('0x48')]=function(_0x25cb3d,_0x468b87){if(_0x25cb3d['body']['id']){delete _0x25cb3d['body']['id'];}return db[_0x9c31('0x3f')][_0x9c31('0x49')]({'where':{'id':_0x25cb3d[_0x9c31('0x45')]['id']}})['then'](handleEntityNotFound(_0x468b87,null))[_0x9c31('0x25')](saveUpdates(_0x25cb3d[_0x9c31('0x4a')],null))['then'](respondWithResult(_0x468b87,null))[_0x9c31('0x46')](handleError(_0x468b87,null));};exports[_0x9c31('0x26')]=function(_0x36faca,_0x13e8f8){return db['ChatQueueReport']['find']({'where':{'id':_0x36faca[_0x9c31('0x45')]['id']}})['then'](handleEntityNotFound(_0x13e8f8,null))[_0x9c31('0x25')](removeEntity(_0x13e8f8,null))[_0x9c31('0x46')](handleError(_0x13e8f8,null));};exports['describe']=function(_0xa57aa9,_0x58ba63){return db['ChatQueueReport'][_0x9c31('0x4b')]()[_0x9c31('0x25')](respondWithResult(_0x58ba63,null))[_0x9c31('0x46')](handleError(_0x58ba63,null));};
\ No newline at end of file
diff --git a/server/api/chatQueueReport/chatQueueReport.model.js b/server/api/chatQueueReport/chatQueueReport.model.js
index 12af40a..fdfbac9 100644
--- a/server/api/chatQueueReport/chatQueueReport.model.js
+++ b/server/api/chatQueueReport/chatQueueReport.model.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xb7e7=['../../config/logger','moment','request-promise','rimraf','../../config/environment','./chatQueueReport.attributes','define','ChatQueueReport','uniqueid','lodash'];(function(_0x5cf63c,_0x1bb2a6){var _0xe54df4=function(_0x3b5feb){while(--_0x3b5feb){_0x5cf63c['push'](_0x5cf63c['shift']());}};_0xe54df4(++_0x1bb2a6);}(_0xb7e7,0x121));var _0x7b7e=function(_0x2b4411,_0x2625ed){_0x2b4411=_0x2b4411-0x0;var _0x8e41ef=_0xb7e7[_0x2b4411];return _0x8e41ef;};'use strict';var _=require(_0x7b7e('0x0'));var util=require('util');var logger=require(_0x7b7e('0x1'))('api');var moment=require(_0x7b7e('0x2'));var BPromise=require('bluebird');var rp=require(_0x7b7e('0x3'));var fs=require('fs');var path=require('path');var rimraf=require(_0x7b7e('0x4'));var config=require(_0x7b7e('0x5'));var attributes=require(_0x7b7e('0x6'));module['exports']=function(_0x53ed64,_0x333fa4){return _0x53ed64[_0x7b7e('0x7')](_0x7b7e('0x8'),attributes,{'tableName':'report_chat_queue','paranoid':![],'indexes':[{'name':_0x7b7e('0x9'),'fields':[_0x7b7e('0x9')]}],'timestamps':!![]});};
\ No newline at end of file
+var _0xd8b0=['define','report_chat_queue','uniqueid','lodash','util','bluebird','request-promise','path','rimraf','../../config/environment'];(function(_0x3e4ee0,_0x37aaf8){var _0x5485ac=function(_0x404942){while(--_0x404942){_0x3e4ee0['push'](_0x3e4ee0['shift']());}};_0x5485ac(++_0x37aaf8);}(_0xd8b0,0xad));var _0x0d8b=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xd8b0[_0x20a584];return _0x4b41a8;};'use strict';var _=require(_0x0d8b('0x0'));var util=require(_0x0d8b('0x1'));var logger=require('../../config/logger')('api');var moment=require('moment');var BPromise=require(_0x0d8b('0x2'));var rp=require(_0x0d8b('0x3'));var fs=require('fs');var path=require(_0x0d8b('0x4'));var rimraf=require(_0x0d8b('0x5'));var config=require(_0x0d8b('0x6'));var attributes=require('./chatQueueReport.attributes');module['exports']=function(_0x3f8b6f,_0x227c63){return _0x3f8b6f[_0x0d8b('0x7')]('ChatQueueReport',attributes,{'tableName':_0x0d8b('0x8'),'paranoid':![],'indexes':[{'name':_0x0d8b('0x9'),'fields':['uniqueid']}],'timestamps':!![]});};
\ No newline at end of file
diff --git a/server/api/chatQueueReport/chatQueueReport.rpc.js b/server/api/chatQueueReport/chatQueueReport.rpc.js
index e0ecf51..eddf743 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 _0x4f6f=['body','options','raw','debug','stringify','UpdateChatQueueReport','ChatQueueReport','update','where','attributes','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','../../config/environment','jayson/promise','then','info','ChatQueueReport,\x20%s,\x20%s','request\x20sent','ChatQueueReport,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','CreateChatQueueReport'];(function(_0x40e83f,_0x4f467a){var _0x17207f=function(_0xbeb1f0){while(--_0xbeb1f0){_0x40e83f['push'](_0x40e83f['shift']());}};_0x17207f(++_0x4f467a);}(_0x4f6f,0x17e));var _0xf4f6=function(_0x15fc3c,_0x35665b){_0x15fc3c=_0x15fc3c-0x0;var _0x94c5c8=_0x4f6f[_0x15fc3c];return _0x94c5c8;};'use strict';var _=require(_0xf4f6('0x0'));var util=require(_0xf4f6('0x1'));var moment=require(_0xf4f6('0x2'));var BPromise=require(_0xf4f6('0x3'));var rs=require(_0xf4f6('0x4'));var fs=require('fs');var Redis=require(_0xf4f6('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0xf4f6('0x6'));var logger=require(_0xf4f6('0x7'))('rpc');var config=require(_0xf4f6('0x8'));var jayson=require(_0xf4f6('0x9'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x5764d8,_0x589c2a,_0x4f286b){return new BPromise(function(_0x8d4ffc,_0x44066c){return client['request'](_0x5764d8,_0x4f286b)[_0xf4f6('0xa')](function(_0x337807){logger[_0xf4f6('0xb')](_0xf4f6('0xc'),_0x589c2a,_0xf4f6('0xd'));logger['debug'](_0xf4f6('0xe'),_0x589c2a,'request\x20sent',JSON['stringify'](_0x337807));if(_0x337807[_0xf4f6('0xf')]){if(_0x337807[_0xf4f6('0xf')][_0xf4f6('0x10')]===0x1f4){logger[_0xf4f6('0xf')]('ChatQueueReport,\x20%s,\x20%s',_0x589c2a,_0x337807['error']['message']);return _0x44066c(_0x337807[_0xf4f6('0xf')][_0xf4f6('0x11')]);}logger[_0xf4f6('0xf')](_0xf4f6('0xc'),_0x589c2a,_0x337807['error'][_0xf4f6('0x11')]);return _0x8d4ffc(_0x337807[_0xf4f6('0xf')][_0xf4f6('0x11')]);}else{logger[_0xf4f6('0xb')](_0xf4f6('0xc'),_0x589c2a,'request\x20sent');_0x8d4ffc(_0x337807[_0xf4f6('0x12')][_0xf4f6('0x11')]);}})[_0xf4f6('0x13')](function(_0x295806){logger['error'](_0xf4f6('0xc'),_0x589c2a,_0x295806);_0x44066c(_0x295806);});});}exports[_0xf4f6('0x14')]=function(_0x10f445){var _0x3501d7=this;return new Promise(function(_0x1668d9,_0x372d2b){return db['ChatQueueReport']['create'](_0x10f445[_0xf4f6('0x15')],{'raw':_0x10f445['options']?_0x10f445[_0xf4f6('0x16')][_0xf4f6('0x17')]===undefined?!![]:![]:!![]})[_0xf4f6('0xa')](function(_0x40357a){logger['info'](_0xf4f6('0x14'),_0x10f445);logger[_0xf4f6('0x18')](_0xf4f6('0x14'),_0x10f445,JSON[_0xf4f6('0x19')](_0x40357a));_0x1668d9(_0x40357a);})[_0xf4f6('0x13')](function(_0x2a1eaa){logger[_0xf4f6('0xf')](_0xf4f6('0x14'),_0x2a1eaa['message'],_0x10f445);_0x372d2b(_0x3501d7['error'](0x1f4,_0x2a1eaa['message']));});});};exports[_0xf4f6('0x1a')]=function(_0x1926bd){var _0x1ebc1a=this;return new Promise(function(_0x238212,_0x1efef3){return db[_0xf4f6('0x1b')][_0xf4f6('0x1c')](_0x1926bd[_0xf4f6('0x15')],{'raw':_0x1926bd['options']?_0x1926bd[_0xf4f6('0x16')][_0xf4f6('0x17')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x1926bd['options']?_0x1926bd[_0xf4f6('0x16')][_0xf4f6('0x1d')]||null:null,'attributes':_0x1926bd[_0xf4f6('0x16')]?_0x1926bd[_0xf4f6('0x16')][_0xf4f6('0x1e')]||null:null,'limit':_0x1926bd[_0xf4f6('0x16')]?_0x1926bd['options']['limit']||null:null})[_0xf4f6('0xa')](function(_0x2080ad){logger[_0xf4f6('0xb')](_0xf4f6('0x1a'),_0x1926bd);logger[_0xf4f6('0x18')](_0xf4f6('0x1a'),_0x1926bd,JSON['stringify'](_0x2080ad));_0x238212(_0x2080ad);})['catch'](function(_0x400b83){logger[_0xf4f6('0xf')](_0xf4f6('0x1a'),_0x400b83['message'],_0x1926bd);_0x1efef3(_0x1ebc1a[_0xf4f6('0xf')](0x1f4,_0x400b83[_0xf4f6('0x11')]));});});};
\ No newline at end of file
+var _0x9414=['error','code','message','catch','CreateChatQueueReport','ChatQueueReport','create','body','options','raw','then','UpdateChatQueueReport','where','attributes','limit','debug','lodash','moment','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','info','ChatQueueReport,\x20%s,\x20%s','request\x20sent','stringify'];(function(_0x28019c,_0x67743){var _0x48ca39=function(_0x4c161e){while(--_0x4c161e){_0x28019c['push'](_0x28019c['shift']());}};_0x48ca39(++_0x67743);}(_0x9414,0x90));var _0x4941=function(_0x35d59c,_0x341ef9){_0x35d59c=_0x35d59c-0x0;var _0x18cd27=_0x9414[_0x35d59c];return _0x18cd27;};'use strict';var _=require(_0x4941('0x0'));var util=require('util');var moment=require(_0x4941('0x1'));var BPromise=require('bluebird');var rs=require(_0x4941('0x2'));var fs=require('fs');var Redis=require(_0x4941('0x3'));var db=require(_0x4941('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x4941('0x5'))(_0x4941('0x6'));var config=require(_0x4941('0x7'));var jayson=require(_0x4941('0x8'));var client=jayson[_0x4941('0x9')][_0x4941('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x4bd3fb,_0x48147a,_0x1bc90e){return new BPromise(function(_0x373246,_0x557583){return client[_0x4941('0xb')](_0x4bd3fb,_0x1bc90e)['then'](function(_0x2ed92a){logger[_0x4941('0xc')](_0x4941('0xd'),_0x48147a,_0x4941('0xe'));logger['debug']('ChatQueueReport,\x20%s,\x20%s,\x20%s',_0x48147a,'request\x20sent',JSON[_0x4941('0xf')](_0x2ed92a));if(_0x2ed92a['error']){if(_0x2ed92a[_0x4941('0x10')][_0x4941('0x11')]===0x1f4){logger[_0x4941('0x10')](_0x4941('0xd'),_0x48147a,_0x2ed92a['error'][_0x4941('0x12')]);return _0x557583(_0x2ed92a[_0x4941('0x10')]['message']);}logger[_0x4941('0x10')]('ChatQueueReport,\x20%s,\x20%s',_0x48147a,_0x2ed92a[_0x4941('0x10')][_0x4941('0x12')]);return _0x373246(_0x2ed92a[_0x4941('0x10')][_0x4941('0x12')]);}else{logger[_0x4941('0xc')](_0x4941('0xd'),_0x48147a,'request\x20sent');_0x373246(_0x2ed92a['result'][_0x4941('0x12')]);}})[_0x4941('0x13')](function(_0x495625){logger[_0x4941('0x10')](_0x4941('0xd'),_0x48147a,_0x495625);_0x557583(_0x495625);});});}exports[_0x4941('0x14')]=function(_0x299868){var _0x42d500=this;return new Promise(function(_0x4ea352,_0x23087e){return db[_0x4941('0x15')][_0x4941('0x16')](_0x299868[_0x4941('0x17')],{'raw':_0x299868[_0x4941('0x18')]?_0x299868[_0x4941('0x18')][_0x4941('0x19')]===undefined?!![]:![]:!![]})[_0x4941('0x1a')](function(_0x447327){logger[_0x4941('0xc')](_0x4941('0x14'),_0x299868);logger['debug'](_0x4941('0x14'),_0x299868,JSON[_0x4941('0xf')](_0x447327));_0x4ea352(_0x447327);})[_0x4941('0x13')](function(_0x350f52){logger[_0x4941('0x10')]('CreateChatQueueReport',_0x350f52['message'],_0x299868);_0x23087e(_0x42d500['error'](0x1f4,_0x350f52[_0x4941('0x12')]));});});};exports[_0x4941('0x1b')]=function(_0x4f5998){var _0x5b17d2=this;return new Promise(function(_0x3a628d,_0x4bfe31){return db[_0x4941('0x15')]['update'](_0x4f5998[_0x4941('0x17')],{'raw':_0x4f5998[_0x4941('0x18')]?_0x4f5998[_0x4941('0x18')][_0x4941('0x19')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x4f5998[_0x4941('0x18')]?_0x4f5998[_0x4941('0x18')][_0x4941('0x1c')]||null:null,'attributes':_0x4f5998[_0x4941('0x18')]?_0x4f5998[_0x4941('0x18')][_0x4941('0x1d')]||null:null,'limit':_0x4f5998['options']?_0x4f5998[_0x4941('0x18')][_0x4941('0x1e')]||null:null})[_0x4941('0x1a')](function(_0x360192){logger[_0x4941('0xc')](_0x4941('0x1b'),_0x4f5998);logger[_0x4941('0x1f')](_0x4941('0x1b'),_0x4f5998,JSON[_0x4941('0xf')](_0x360192));_0x3a628d(_0x360192);})['catch'](function(_0xaa9e32){logger[_0x4941('0x10')](_0x4941('0x1b'),_0xaa9e32[_0x4941('0x12')],_0x4f5998);_0x4bfe31(_0x5b17d2[_0x4941('0x10')](0x1f4,_0xaa9e32[_0x4941('0x12')]));});});};
\ No newline at end of file
diff --git a/server/api/chatQueueReport/index.js b/server/api/chatQueueReport/index.js
index 0f80fb8..af18529 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 _0x3793=['isAuthenticated','index','/describe','/:id','show','post','update','destroy','exports','multer','util','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./chatQueueReport.controller','get'];(function(_0x29c3b9,_0x4adaf7){var _0x637286=function(_0x36b4f3){while(--_0x36b4f3){_0x29c3b9['push'](_0x29c3b9['shift']());}};_0x637286(++_0x4adaf7);}(_0x3793,0xa1));var _0x3379=function(_0x569c5a,_0x9ef4b6){_0x569c5a=_0x569c5a-0x0;var _0x1676d0=_0x3793[_0x569c5a];return _0x1676d0;};'use strict';var multer=require(_0x3379('0x0'));var util=require(_0x3379('0x1'));var path=require('path');var timeout=require(_0x3379('0x2'));var express=require(_0x3379('0x3'));var router=express[_0x3379('0x4')]();var fs_extra=require(_0x3379('0x5'));var auth=require(_0x3379('0x6'));var interaction=require(_0x3379('0x7'));var config=require('../../config/environment');var controller=require(_0x3379('0x8'));router[_0x3379('0x9')]('/',auth[_0x3379('0xa')](),controller[_0x3379('0xb')]);router['get'](_0x3379('0xc'),auth[_0x3379('0xa')](),controller['describe']);router[_0x3379('0x9')](_0x3379('0xd'),auth[_0x3379('0xa')](),controller[_0x3379('0xe')]);router[_0x3379('0xf')]('/',auth[_0x3379('0xa')](),controller['create']);router['put'](_0x3379('0xd'),auth['isAuthenticated'](),controller[_0x3379('0x10')]);router['delete'](_0x3379('0xd'),auth[_0x3379('0xa')](),controller[_0x3379('0x11')]);module[_0x3379('0x12')]=router;
\ No newline at end of file
+var _0x067f=['../../config/environment','get','isAuthenticated','index','/describe','describe','/:id','create','put','update','delete','destroy','util','path','connect-timeout','Router','../../components/auth/service','../../components/interaction/service'];(function(_0xf9263f,_0x5cb19d){var _0x448192=function(_0x3cecf0){while(--_0x3cecf0){_0xf9263f['push'](_0xf9263f['shift']());}};_0x448192(++_0x5cb19d);}(_0x067f,0x186));var _0xf067=function(_0x3cce12,_0x5ab156){_0x3cce12=_0x3cce12-0x0;var _0x12ce5d=_0x067f[_0x3cce12];return _0x12ce5d;};'use strict';var multer=require('multer');var util=require(_0xf067('0x0'));var path=require(_0xf067('0x1'));var timeout=require(_0xf067('0x2'));var express=require('express');var router=express[_0xf067('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0xf067('0x4'));var interaction=require(_0xf067('0x5'));var config=require(_0xf067('0x6'));var controller=require('./chatQueueReport.controller');router[_0xf067('0x7')]('/',auth[_0xf067('0x8')](),controller[_0xf067('0x9')]);router[_0xf067('0x7')](_0xf067('0xa'),auth[_0xf067('0x8')](),controller[_0xf067('0xb')]);router[_0xf067('0x7')](_0xf067('0xc'),auth['isAuthenticated'](),controller['show']);router['post']('/',auth[_0xf067('0x8')](),controller[_0xf067('0xd')]);router[_0xf067('0xe')]('/:id',auth['isAuthenticated'](),controller[_0xf067('0xf')]);router[_0xf067('0x10')]('/:id',auth[_0xf067('0x8')](),controller[_0xf067('0x11')]);module['exports']=router;
\ No newline at end of file
diff --git a/server/api/chatTransferReport/chatTransferReport.attributes.js b/server/api/chatTransferReport/chatTransferReport.attributes.js
index 4b60d7c..3e09449 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 _0xf3cd=['exports','STRING','ENUM','account','queue','DATE','moment','sequelize'];(function(_0x3c231b,_0xf13470){var _0x394e62=function(_0x226d6f){while(--_0x226d6f){_0x3c231b['push'](_0x3c231b['shift']());}};_0x394e62(++_0xf13470);}(_0xf3cd,0xfe));var _0xdf3c=function(_0x564821,_0x4d037e){_0x564821=_0x564821-0x0;var _0x2b604d=_0xf3cd[_0x564821];return _0x2b604d;};'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
+var _0x54ef=['agent','queue','DATE','NOW','moment','sequelize','exports','ENUM','account'];(function(_0x3318c3,_0x35066){var _0x15c002=function(_0xd82271){while(--_0xd82271){_0x3318c3['push'](_0x3318c3['shift']());}};_0x15c002(++_0x35066);}(_0x54ef,0x112));var _0xf54e=function(_0x13147c,_0x22675b){_0x13147c=_0x13147c-0x0;var _0x2009de=_0x54ef[_0x13147c];return _0x2009de;};'use strict';var moment=require(_0xf54e('0x0'));var Sequelize=require(_0xf54e('0x1'));module[_0xf54e('0x2')]={'uniqueid':{'type':Sequelize['STRING'],'allowNull':![]},'type':{'type':Sequelize[_0xf54e('0x3')](_0xf54e('0x4'),_0xf54e('0x5'),_0xf54e('0x6')),'allowNull':![],'defaultValue':_0xf54e('0x6')},'transferredAt':{'type':Sequelize[_0xf54e('0x7')],'allowNull':![],'defaultValue':Sequelize[_0xf54e('0x8')]}};
\ No newline at end of file
diff --git a/server/api/chatTransferReport/chatTransferReport.controller.js b/server/api/chatTransferReport/chatTransferReport.controller.js
index deda079..099d552 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 _0x6136=['../../config/environment','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','set','Content-Range','apply','reject','save','then','destroy','error','stack','name','index','ChatTransferReport','rawAttributes','fieldName','type','key','map','query','keys','filters','intersection','model','attributes','fields','length','hasOwnProperty','order','sort','where','pick','filter','merge','options','count','include','findAll','catch','show','params','includeAll','find','create','body','update','describe','eml-format','rimraf','zip-dir','fast-json-patch','bluebird','mustache','util','to-csv','fs-extra','lodash','squel','jsforce','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','../../config/utils'];(function(_0x3dfc68,_0x304d60){var _0x245084=function(_0x3c1e0a){while(--_0x3c1e0a){_0x3dfc68['push'](_0x3dfc68['shift']());}};_0x245084(++_0x304d60);}(_0x6136,0x111));var _0x6613=function(_0x5cfd2a,_0x44a11c){_0x5cfd2a=_0x5cfd2a-0x0;var _0x3a4582=_0x6136[_0x5cfd2a];return _0x3a4582;};'use strict';var emlformat=require(_0x6613('0x0'));var rimraf=require(_0x6613('0x1'));var zipdir=require(_0x6613('0x2'));var jsonpatch=require(_0x6613('0x3'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x6613('0x4'));var Mustache=require(_0x6613('0x5'));var util=require(_0x6613('0x6'));var path=require('path');var sox=require('sox');var csv=require(_0x6613('0x7'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x6613('0x8'));var _=require(_0x6613('0x9'));var squel=require(_0x6613('0xa'));var crypto=require('crypto');var jsforce=require(_0x6613('0xb'));var deskjs=require('desk.js');var toCsv=require(_0x6613('0x7'));var querystring=require(_0x6613('0xc'));var Papa=require(_0x6613('0xd'));var Redis=require('ioredis');var authService=require(_0x6613('0xe'));var qs=require(_0x6613('0xf'));var as=require(_0x6613('0x10'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x6613('0x11'))('api');var utils=require(_0x6613('0x12'));var config=require(_0x6613('0x13'));var licenseUtil=require('../../config/license/util');var db=require(_0x6613('0x14'))['db'];function respondWithStatusCode(_0x1abe66,_0x46e81c){_0x46e81c=_0x46e81c||0xcc;return function(_0x11cf74){if(_0x11cf74){return _0x1abe66[_0x6613('0x15')](_0x46e81c);}return _0x1abe66[_0x6613('0x16')](_0x46e81c)[_0x6613('0x17')]();};}function respondWithResult(_0xfff29c,_0xa3e2ae){_0xa3e2ae=_0xa3e2ae||0xc8;return function(_0x13bc2e){if(_0x13bc2e){return _0xfff29c[_0x6613('0x16')](_0xa3e2ae)[_0x6613('0x18')](_0x13bc2e);}};}function respondWithFilteredResult(_0xb7c796,_0x21f9c7){return function(_0x5180b1){if(_0x5180b1){var _0x4bcac0=typeof _0x21f9c7[_0x6613('0x19')]===_0x6613('0x1a')&&typeof _0x21f9c7[_0x6613('0x1b')]===_0x6613('0x1a');var _0x10f5c5=_0x5180b1['count'];var _0x5b9ab2=_0x4bcac0?0x0:_0x21f9c7[_0x6613('0x19')];var _0x580112=_0x4bcac0?_0x5180b1['count']:_0x21f9c7[_0x6613('0x19')]+_0x21f9c7[_0x6613('0x1b')];var _0x1b1bad;if(_0x580112>=_0x10f5c5){_0x580112=_0x10f5c5;_0x1b1bad=0xc8;}else{_0x1b1bad=0xce;}_0xb7c796[_0x6613('0x16')](_0x1b1bad);return _0xb7c796[_0x6613('0x1c')](_0x6613('0x1d'),_0x5b9ab2+'-'+_0x580112+'/'+_0x10f5c5)[_0x6613('0x18')](_0x5180b1);}return null;};}function patchUpdates(_0x27f83e){return function(_0x4707c0){try{jsonpatch[_0x6613('0x1e')](_0x4707c0,_0x27f83e,!![]);}catch(_0x39c0fe){return BPromise[_0x6613('0x1f')](_0x39c0fe);}return _0x4707c0[_0x6613('0x20')]();};}function saveUpdates(_0x109abb,_0x5cef72){return function(_0x387a0c){if(_0x387a0c){return _0x387a0c['update'](_0x109abb)[_0x6613('0x21')](function(_0x20b373){return _0x20b373;});}return null;};}function removeEntity(_0x37fef1,_0x300179){return function(_0x62ed55){if(_0x62ed55){return _0x62ed55[_0x6613('0x22')]()['then'](function(){_0x37fef1['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x39e892,_0xc15507){return function(_0x23254b){if(!_0x23254b){_0x39e892[_0x6613('0x15')](0x194);}return _0x23254b;};}function handleError(_0x4a2448,_0x30fcc4){_0x30fcc4=_0x30fcc4||0x1f4;return function(_0x281488){logger[_0x6613('0x23')](_0x281488[_0x6613('0x24')]);if(_0x281488['name']){delete _0x281488[_0x6613('0x25')];}_0x4a2448[_0x6613('0x16')](_0x30fcc4)['send'](_0x281488);};}exports[_0x6613('0x26')]=function(_0x20e4f0,_0x2a85e6){var _0x433827={},_0x2ed167={},_0xc33d23={'count':0x0,'rows':[]};var _0x196bbf=_['map'](db[_0x6613('0x27')][_0x6613('0x28')],function(_0x4a4822){return{'name':_0x4a4822[_0x6613('0x29')],'type':_0x4a4822[_0x6613('0x2a')][_0x6613('0x2b')]};});_0x2ed167['model']=_[_0x6613('0x2c')](_0x196bbf,_0x6613('0x25'));_0x2ed167[_0x6613('0x2d')]=_[_0x6613('0x2e')](_0x20e4f0[_0x6613('0x2d')]);_0x2ed167[_0x6613('0x2f')]=_[_0x6613('0x30')](_0x2ed167[_0x6613('0x31')],_0x2ed167[_0x6613('0x2d')]);_0x433827[_0x6613('0x32')]=_['intersection'](_0x2ed167[_0x6613('0x31')],qs[_0x6613('0x33')](_0x20e4f0[_0x6613('0x2d')][_0x6613('0x33')]));_0x433827[_0x6613('0x32')]=_0x433827[_0x6613('0x32')][_0x6613('0x34')]?_0x433827[_0x6613('0x32')]:_0x2ed167[_0x6613('0x31')];if(!_0x20e4f0[_0x6613('0x2d')][_0x6613('0x35')]('nolimit')){_0x433827['limit']=qs[_0x6613('0x1b')](_0x20e4f0[_0x6613('0x2d')][_0x6613('0x1b')]);_0x433827[_0x6613('0x19')]=qs['offset'](_0x20e4f0[_0x6613('0x2d')]['offset']);}_0x433827[_0x6613('0x36')]=qs[_0x6613('0x37')](_0x20e4f0[_0x6613('0x2d')][_0x6613('0x37')]);_0x433827[_0x6613('0x38')]=qs[_0x6613('0x2f')](_[_0x6613('0x39')](_0x20e4f0[_0x6613('0x2d')],_0x2ed167['filters']),_0x196bbf);if(_0x20e4f0[_0x6613('0x2d')][_0x6613('0x3a')]){_0x433827[_0x6613('0x38')]=_[_0x6613('0x3b')](_0x433827[_0x6613('0x38')],{'$or':_[_0x6613('0x2c')](_0x196bbf,function(_0x56519a){if(_0x56519a['type']!=='VIRTUAL'){var _0x2512f7={};_0x2512f7[_0x56519a[_0x6613('0x25')]]={'$like':'%'+_0x20e4f0['query'][_0x6613('0x3a')]+'%'};return _0x2512f7;}})});}_0x433827=_[_0x6613('0x3b')]({},_0x433827,_0x20e4f0[_0x6613('0x3c')]);var _0x30061a={'where':_0x433827['where']};return db[_0x6613('0x27')][_0x6613('0x3d')](_0x30061a)['then'](function(_0x34f61c){_0xc33d23[_0x6613('0x3d')]=_0x34f61c;if(_0x20e4f0[_0x6613('0x2d')]['includeAll']){_0x433827[_0x6613('0x3e')]=[{'all':!![]}];}return db['ChatTransferReport'][_0x6613('0x3f')](_0x433827);})[_0x6613('0x21')](function(_0x2466cd){_0xc33d23['rows']=_0x2466cd;return _0xc33d23;})[_0x6613('0x21')](respondWithFilteredResult(_0x2a85e6,_0x433827))[_0x6613('0x40')](handleError(_0x2a85e6,null));};exports[_0x6613('0x41')]=function(_0x53db74,_0x1c0828){var _0xd421b8={'raw':!![],'where':{'id':_0x53db74[_0x6613('0x42')]['id']}},_0x4d142c={};_0x4d142c['model']=_[_0x6613('0x2e')](db['ChatTransferReport']['rawAttributes']);_0x4d142c['query']=_[_0x6613('0x2e')](_0x53db74[_0x6613('0x2d')]);_0x4d142c['filters']=_[_0x6613('0x30')](_0x4d142c[_0x6613('0x31')],_0x4d142c[_0x6613('0x2d')]);_0xd421b8['attributes']=_[_0x6613('0x30')](_0x4d142c['model'],qs[_0x6613('0x33')](_0x53db74[_0x6613('0x2d')]['fields']));_0xd421b8[_0x6613('0x32')]=_0xd421b8[_0x6613('0x32')][_0x6613('0x34')]?_0xd421b8['attributes']:_0x4d142c[_0x6613('0x31')];if(_0x53db74[_0x6613('0x2d')][_0x6613('0x43')]){_0xd421b8['include']=[{'all':!![]}];}_0xd421b8=_[_0x6613('0x3b')]({},_0xd421b8,_0x53db74['options']);return db[_0x6613('0x27')][_0x6613('0x44')](_0xd421b8)[_0x6613('0x21')](handleEntityNotFound(_0x1c0828,null))['then'](respondWithResult(_0x1c0828,null))[_0x6613('0x40')](handleError(_0x1c0828,null));};exports[_0x6613('0x45')]=function(_0x14f3b8,_0x58d500){return db[_0x6613('0x27')]['create'](_0x14f3b8[_0x6613('0x46')],{})['then'](respondWithResult(_0x58d500,0xc9))[_0x6613('0x40')](handleError(_0x58d500,null));};exports[_0x6613('0x47')]=function(_0x5860e0,_0x5af460){if(_0x5860e0[_0x6613('0x46')]['id']){delete _0x5860e0[_0x6613('0x46')]['id'];}return db[_0x6613('0x27')][_0x6613('0x44')]({'where':{'id':_0x5860e0['params']['id']}})[_0x6613('0x21')](handleEntityNotFound(_0x5af460,null))[_0x6613('0x21')](saveUpdates(_0x5860e0['body'],null))[_0x6613('0x21')](respondWithResult(_0x5af460,null))[_0x6613('0x40')](handleError(_0x5af460,null));};exports['destroy']=function(_0x595cd6,_0x4fd625){return db[_0x6613('0x27')][_0x6613('0x44')]({'where':{'id':_0x595cd6['params']['id']}})[_0x6613('0x21')](handleEntityNotFound(_0x4fd625,null))[_0x6613('0x21')](removeEntity(_0x4fd625,null))['catch'](handleError(_0x4fd625,null));};exports[_0x6613('0x48')]=function(_0x2f13c4,_0x23855d){return db[_0x6613('0x27')]['describe']()['then'](respondWithResult(_0x23855d,null))[_0x6613('0x40')](handleError(_0x23855d,null));};
\ No newline at end of file
+var _0x685a=['request-promise','moment','bluebird','mustache','util','path','sox','ejs','lodash','squel','crypto','jsforce','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','end','json','undefined','count','limit','status','set','Content-Range','apply','reject','save','update','then','destroy','error','stack','name','send','index','map','type','model','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','offset','where','pick','merge','options','ChatTransferReport','includeAll','findAll','catch','show','rawAttributes','find','create','params','describe','eml-format','rimraf','zip-dir','fast-json-patch'];(function(_0x4dac30,_0x3b1e61){var _0x4ae741=function(_0x1a22c3){while(--_0x1a22c3){_0x4dac30['push'](_0x4dac30['shift']());}};_0x4ae741(++_0x3b1e61);}(_0x685a,0x1b2));var _0xa685=function(_0x2d318e,_0x4780c0){_0x2d318e=_0x2d318e-0x0;var _0x105f8f=_0x685a[_0x2d318e];return _0x105f8f;};'use strict';var emlformat=require(_0xa685('0x0'));var rimraf=require(_0xa685('0x1'));var zipdir=require(_0xa685('0x2'));var jsonpatch=require(_0xa685('0x3'));var rp=require(_0xa685('0x4'));var moment=require(_0xa685('0x5'));var BPromise=require(_0xa685('0x6'));var Mustache=require(_0xa685('0x7'));var util=require(_0xa685('0x8'));var path=require(_0xa685('0x9'));var sox=require(_0xa685('0xa'));var csv=require('to-csv');var ejs=require(_0xa685('0xb'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xa685('0xc'));var squel=require(_0xa685('0xd'));var crypto=require(_0xa685('0xe'));var jsforce=require(_0xa685('0xf'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0xa685('0x10'));var Papa=require(_0xa685('0x11'));var Redis=require(_0xa685('0x12'));var authService=require('../../components/auth/service');var qs=require(_0xa685('0x13'));var as=require(_0xa685('0x14'));var hardwareService=require(_0xa685('0x15'));var logger=require(_0xa685('0x16'))('api');var utils=require(_0xa685('0x17'));var config=require('../../config/environment');var licenseUtil=require(_0xa685('0x18'));var db=require(_0xa685('0x19'))['db'];function respondWithStatusCode(_0x40cfa3,_0x506ea9){_0x506ea9=_0x506ea9||0xcc;return function(_0x5e0bdd){if(_0x5e0bdd){return _0x40cfa3[_0xa685('0x1a')](_0x506ea9);}return _0x40cfa3['status'](_0x506ea9)[_0xa685('0x1b')]();};}function respondWithResult(_0x13b37f,_0x5db52b){_0x5db52b=_0x5db52b||0xc8;return function(_0x252341){if(_0x252341){return _0x13b37f['status'](_0x5db52b)[_0xa685('0x1c')](_0x252341);}};}function respondWithFilteredResult(_0x10e311,_0x4516d8){return function(_0xb75c60){if(_0xb75c60){var _0xf85345=typeof _0x4516d8['offset']===_0xa685('0x1d')&&typeof _0x4516d8['limit']===_0xa685('0x1d');var _0x1eec42=_0xb75c60[_0xa685('0x1e')];var _0xbe0580=_0xf85345?0x0:_0x4516d8['offset'];var _0x5ba311=_0xf85345?_0xb75c60[_0xa685('0x1e')]:_0x4516d8['offset']+_0x4516d8[_0xa685('0x1f')];var _0x2877ca;if(_0x5ba311>=_0x1eec42){_0x5ba311=_0x1eec42;_0x2877ca=0xc8;}else{_0x2877ca=0xce;}_0x10e311[_0xa685('0x20')](_0x2877ca);return _0x10e311[_0xa685('0x21')](_0xa685('0x22'),_0xbe0580+'-'+_0x5ba311+'/'+_0x1eec42)['json'](_0xb75c60);}return null;};}function patchUpdates(_0x27e73c){return function(_0x1adb51){try{jsonpatch[_0xa685('0x23')](_0x1adb51,_0x27e73c,!![]);}catch(_0x83af21){return BPromise[_0xa685('0x24')](_0x83af21);}return _0x1adb51[_0xa685('0x25')]();};}function saveUpdates(_0x30d5a1,_0x4b4768){return function(_0xbf7583){if(_0xbf7583){return _0xbf7583[_0xa685('0x26')](_0x30d5a1)[_0xa685('0x27')](function(_0x2861cc){return _0x2861cc;});}return null;};}function removeEntity(_0x1d034d,_0x2869b8){return function(_0x4789af){if(_0x4789af){return _0x4789af[_0xa685('0x28')]()['then'](function(){_0x1d034d[_0xa685('0x20')](0xcc)[_0xa685('0x1b')]();});}};}function handleEntityNotFound(_0x3c848f,_0x3e6e51){return function(_0x3907c3){if(!_0x3907c3){_0x3c848f[_0xa685('0x1a')](0x194);}return _0x3907c3;};}function handleError(_0x441af4,_0x1ee61e){_0x1ee61e=_0x1ee61e||0x1f4;return function(_0x1b9aae){logger[_0xa685('0x29')](_0x1b9aae[_0xa685('0x2a')]);if(_0x1b9aae[_0xa685('0x2b')]){delete _0x1b9aae[_0xa685('0x2b')];}_0x441af4[_0xa685('0x20')](_0x1ee61e)[_0xa685('0x2c')](_0x1b9aae);};}exports[_0xa685('0x2d')]=function(_0x2690eb,_0x1ef89c){var _0x3d16d8={},_0x11c759={},_0x198fd0={'count':0x0,'rows':[]};var _0x14ff5d=_[_0xa685('0x2e')](db['ChatTransferReport']['rawAttributes'],function(_0x413fa3){return{'name':_0x413fa3['fieldName'],'type':_0x413fa3[_0xa685('0x2f')]['key']};});_0x11c759[_0xa685('0x30')]=_[_0xa685('0x2e')](_0x14ff5d,_0xa685('0x2b'));_0x11c759[_0xa685('0x31')]=_[_0xa685('0x32')](_0x2690eb['query']);_0x11c759[_0xa685('0x33')]=_[_0xa685('0x34')](_0x11c759[_0xa685('0x30')],_0x11c759['query']);_0x3d16d8['attributes']=_['intersection'](_0x11c759[_0xa685('0x30')],qs[_0xa685('0x35')](_0x2690eb[_0xa685('0x31')][_0xa685('0x35')]));_0x3d16d8['attributes']=_0x3d16d8[_0xa685('0x36')][_0xa685('0x37')]?_0x3d16d8[_0xa685('0x36')]:_0x11c759[_0xa685('0x30')];if(!_0x2690eb[_0xa685('0x31')][_0xa685('0x38')](_0xa685('0x39'))){_0x3d16d8['limit']=qs[_0xa685('0x1f')](_0x2690eb[_0xa685('0x31')][_0xa685('0x1f')]);_0x3d16d8[_0xa685('0x3a')]=qs[_0xa685('0x3a')](_0x2690eb[_0xa685('0x31')][_0xa685('0x3a')]);}_0x3d16d8['order']=qs['sort'](_0x2690eb[_0xa685('0x31')]['sort']);_0x3d16d8[_0xa685('0x3b')]=qs['filters'](_[_0xa685('0x3c')](_0x2690eb[_0xa685('0x31')],_0x11c759[_0xa685('0x33')]),_0x14ff5d);if(_0x2690eb[_0xa685('0x31')]['filter']){_0x3d16d8['where']=_[_0xa685('0x3d')](_0x3d16d8[_0xa685('0x3b')],{'$or':_[_0xa685('0x2e')](_0x14ff5d,function(_0x5647b3){if(_0x5647b3[_0xa685('0x2f')]!=='VIRTUAL'){var _0x26ac6c={};_0x26ac6c[_0x5647b3[_0xa685('0x2b')]]={'$like':'%'+_0x2690eb[_0xa685('0x31')]['filter']+'%'};return _0x26ac6c;}})});}_0x3d16d8=_['merge']({},_0x3d16d8,_0x2690eb[_0xa685('0x3e')]);var _0x4065af={'where':_0x3d16d8['where']};return db[_0xa685('0x3f')][_0xa685('0x1e')](_0x4065af)['then'](function(_0x10ad39){_0x198fd0[_0xa685('0x1e')]=_0x10ad39;if(_0x2690eb[_0xa685('0x31')][_0xa685('0x40')]){_0x3d16d8['include']=[{'all':!![]}];}return db[_0xa685('0x3f')][_0xa685('0x41')](_0x3d16d8);})[_0xa685('0x27')](function(_0x2bff6f){_0x198fd0['rows']=_0x2bff6f;return _0x198fd0;})[_0xa685('0x27')](respondWithFilteredResult(_0x1ef89c,_0x3d16d8))[_0xa685('0x42')](handleError(_0x1ef89c,null));};exports[_0xa685('0x43')]=function(_0x2a761b,_0x60eff7){var _0x55375c={'raw':!![],'where':{'id':_0x2a761b['params']['id']}},_0x2dfbcd={};_0x2dfbcd['model']=_['keys'](db[_0xa685('0x3f')][_0xa685('0x44')]);_0x2dfbcd['query']=_[_0xa685('0x32')](_0x2a761b[_0xa685('0x31')]);_0x2dfbcd['filters']=_[_0xa685('0x34')](_0x2dfbcd[_0xa685('0x30')],_0x2dfbcd[_0xa685('0x31')]);_0x55375c['attributes']=_[_0xa685('0x34')](_0x2dfbcd['model'],qs[_0xa685('0x35')](_0x2a761b[_0xa685('0x31')][_0xa685('0x35')]));_0x55375c['attributes']=_0x55375c[_0xa685('0x36')]['length']?_0x55375c[_0xa685('0x36')]:_0x2dfbcd[_0xa685('0x30')];if(_0x2a761b[_0xa685('0x31')][_0xa685('0x40')]){_0x55375c['include']=[{'all':!![]}];}_0x55375c=_[_0xa685('0x3d')]({},_0x55375c,_0x2a761b[_0xa685('0x3e')]);return db[_0xa685('0x3f')][_0xa685('0x45')](_0x55375c)[_0xa685('0x27')](handleEntityNotFound(_0x60eff7,null))['then'](respondWithResult(_0x60eff7,null))[_0xa685('0x42')](handleError(_0x60eff7,null));};exports[_0xa685('0x46')]=function(_0x3a2bdf,_0x3d7db3){return db[_0xa685('0x3f')][_0xa685('0x46')](_0x3a2bdf['body'],{})[_0xa685('0x27')](respondWithResult(_0x3d7db3,0xc9))['catch'](handleError(_0x3d7db3,null));};exports[_0xa685('0x26')]=function(_0x395dfe,_0x533a01){if(_0x395dfe['body']['id']){delete _0x395dfe['body']['id'];}return db['ChatTransferReport'][_0xa685('0x45')]({'where':{'id':_0x395dfe[_0xa685('0x47')]['id']}})[_0xa685('0x27')](handleEntityNotFound(_0x533a01,null))[_0xa685('0x27')](saveUpdates(_0x395dfe['body'],null))[_0xa685('0x27')](respondWithResult(_0x533a01,null))[_0xa685('0x42')](handleError(_0x533a01,null));};exports[_0xa685('0x28')]=function(_0x56a0a9,_0x1a2c74){return db[_0xa685('0x3f')][_0xa685('0x45')]({'where':{'id':_0x56a0a9[_0xa685('0x47')]['id']}})[_0xa685('0x27')](handleEntityNotFound(_0x1a2c74,null))['then'](removeEntity(_0x1a2c74,null))[_0xa685('0x42')](handleError(_0x1a2c74,null));};exports['describe']=function(_0x195d3f,_0x2727e1){return db['ChatTransferReport'][_0xa685('0x48')]()[_0xa685('0x27')](respondWithResult(_0x2727e1,null))[_0xa685('0x42')](handleError(_0x2727e1,null));};
\ No newline at end of file
diff --git a/server/api/chatTransferReport/chatTransferReport.model.js b/server/api/chatTransferReport/chatTransferReport.model.js
index 1e0edb0..0bfb0e9 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 _0xf40b=['uniqueid','lodash','../../config/logger','api','moment','bluebird','path','rimraf','../../config/environment','./chatTransferReport.attributes','exports','define','ChatTransferReport','report_chat_transfer'];(function(_0x13bb95,_0x5e079f){var _0x58a3f1=function(_0x3fe115){while(--_0x3fe115){_0x13bb95['push'](_0x13bb95['shift']());}};_0x58a3f1(++_0x5e079f);}(_0xf40b,0x7f));var _0xbf40=function(_0xc4a608,_0x45fecd){_0xc4a608=_0xc4a608-0x0;var _0x5e2730=_0xf40b[_0xc4a608];return _0x5e2730;};'use strict';var _=require(_0xbf40('0x0'));var util=require('util');var logger=require(_0xbf40('0x1'))(_0xbf40('0x2'));var moment=require(_0xbf40('0x3'));var BPromise=require(_0xbf40('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xbf40('0x5'));var rimraf=require(_0xbf40('0x6'));var config=require(_0xbf40('0x7'));var attributes=require(_0xbf40('0x8'));module[_0xbf40('0x9')]=function(_0x56b19e,_0x13707e){return _0x56b19e[_0xbf40('0xa')](_0xbf40('0xb'),attributes,{'tableName':_0xbf40('0xc'),'paranoid':![],'indexes':[{'name':_0xbf40('0xd'),'fields':[_0xbf40('0xd')]}],'timestamps':!![]});};
\ No newline at end of file
+var _0xf89a=['bluebird','request-promise','path','../../config/environment','./chatTransferReport.attributes','define','ChatTransferReport','report_chat_transfer','uniqueid','lodash','util','moment'];(function(_0x374ba0,_0x27ee7b){var _0x2c9388=function(_0x318869){while(--_0x318869){_0x374ba0['push'](_0x374ba0['shift']());}};_0x2c9388(++_0x27ee7b);}(_0xf89a,0x81));var _0xaf89=function(_0xb252a,_0x45867e){_0xb252a=_0xb252a-0x0;var _0x2d2bb5=_0xf89a[_0xb252a];return _0x2d2bb5;};'use strict';var _=require(_0xaf89('0x0'));var util=require(_0xaf89('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0xaf89('0x2'));var BPromise=require(_0xaf89('0x3'));var rp=require(_0xaf89('0x4'));var fs=require('fs');var path=require(_0xaf89('0x5'));var rimraf=require('rimraf');var config=require(_0xaf89('0x6'));var attributes=require(_0xaf89('0x7'));module['exports']=function(_0x4ed04c,_0x36f637){return _0x4ed04c[_0xaf89('0x8')](_0xaf89('0x9'),attributes,{'tableName':_0xaf89('0xa'),'paranoid':![],'indexes':[{'name':_0xaf89('0xb'),'fields':[_0xaf89('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 5dae12d..f48c040 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 _0x976c=['bluebird','randomstring','../../config/utils','../../config/environment','jayson/promise','client','http','request','then','info','ChatTransferReport,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','catch','lodash','moment'];(function(_0x312b25,_0xc2aa){var _0x5818f6=function(_0x1bfc44){while(--_0x1bfc44){_0x312b25['push'](_0x312b25['shift']());}};_0x5818f6(++_0xc2aa);}(_0x976c,0x67));var _0xc976=function(_0x4ddec0,_0x4d6267){_0x4ddec0=_0x4ddec0-0x0;var _0xc20418=_0x976c[_0x4ddec0];return _0xc20418;};'use strict';var _=require(_0xc976('0x0'));var util=require('util');var moment=require(_0xc976('0x1'));var BPromise=require(_0xc976('0x2'));var rs=require(_0xc976('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0xc976('0x4'));var logger=require('../../config/logger')('rpc');var config=require(_0xc976('0x5'));var jayson=require(_0xc976('0x6'));var client=jayson[_0xc976('0x7')][_0xc976('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x26f1bf,_0x5efa21,_0x2a19b9){return new BPromise(function(_0x5324ac,_0x471107){return client[_0xc976('0x9')](_0x26f1bf,_0x2a19b9)[_0xc976('0xa')](function(_0xe17884){logger[_0xc976('0xb')](_0xc976('0xc'),_0x5efa21,_0xc976('0xd'));logger[_0xc976('0xe')]('ChatTransferReport,\x20%s,\x20%s,\x20%s',_0x5efa21,'request\x20sent',JSON[_0xc976('0xf')](_0xe17884));if(_0xe17884[_0xc976('0x10')]){if(_0xe17884[_0xc976('0x10')][_0xc976('0x11')]===0x1f4){logger['error'](_0xc976('0xc'),_0x5efa21,_0xe17884['error']['message']);return _0x471107(_0xe17884[_0xc976('0x10')][_0xc976('0x12')]);}logger[_0xc976('0x10')](_0xc976('0xc'),_0x5efa21,_0xe17884[_0xc976('0x10')]['message']);return _0x5324ac(_0xe17884['error']['message']);}else{logger[_0xc976('0xb')](_0xc976('0xc'),_0x5efa21,_0xc976('0xd'));_0x5324ac(_0xe17884[_0xc976('0x13')]['message']);}})[_0xc976('0x14')](function(_0x5e09c8){logger[_0xc976('0x10')](_0xc976('0xc'),_0x5efa21,_0x5e09c8);_0x471107(_0x5e09c8);});});}
\ No newline at end of file
+var _0xc7bb=['info','ChatTransferReport,\x20%s,\x20%s','request\x20sent','debug','ChatTransferReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then'];(function(_0xb130db,_0x2950da){var _0x3aae0d=function(_0x5a5b0c){while(--_0x5a5b0c){_0xb130db['push'](_0xb130db['shift']());}};_0x3aae0d(++_0x2950da);}(_0xc7bb,0xa1));var _0xbc7b=function(_0x55d147,_0xbff6ef){_0x55d147=_0x55d147-0x0;var _0x2e4880=_0xc7bb[_0x55d147];return _0x2e4880;};'use strict';var _=require('lodash');var util=require(_0xbc7b('0x0'));var moment=require(_0xbc7b('0x1'));var BPromise=require(_0xbc7b('0x2'));var rs=require(_0xbc7b('0x3'));var fs=require('fs');var Redis=require(_0xbc7b('0x4'));var db=require(_0xbc7b('0x5'))['db'];var utils=require(_0xbc7b('0x6'));var logger=require(_0xbc7b('0x7'))(_0xbc7b('0x8'));var config=require(_0xbc7b('0x9'));var jayson=require(_0xbc7b('0xa'));var client=jayson['client'][_0xbc7b('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x4b0d82,_0x3da410,_0xaac7b1){return new BPromise(function(_0x23cb2d,_0x2a2a02){return client[_0xbc7b('0xc')](_0x4b0d82,_0xaac7b1)[_0xbc7b('0xd')](function(_0x1136dc){logger[_0xbc7b('0xe')](_0xbc7b('0xf'),_0x3da410,_0xbc7b('0x10'));logger[_0xbc7b('0x11')](_0xbc7b('0x12'),_0x3da410,_0xbc7b('0x10'),JSON[_0xbc7b('0x13')](_0x1136dc));if(_0x1136dc[_0xbc7b('0x14')]){if(_0x1136dc[_0xbc7b('0x14')][_0xbc7b('0x15')]===0x1f4){logger[_0xbc7b('0x14')](_0xbc7b('0xf'),_0x3da410,_0x1136dc['error'][_0xbc7b('0x16')]);return _0x2a2a02(_0x1136dc[_0xbc7b('0x14')][_0xbc7b('0x16')]);}logger[_0xbc7b('0x14')](_0xbc7b('0xf'),_0x3da410,_0x1136dc['error'][_0xbc7b('0x16')]);return _0x23cb2d(_0x1136dc['error'][_0xbc7b('0x16')]);}else{logger[_0xbc7b('0xe')](_0xbc7b('0xf'),_0x3da410,'request\x20sent');_0x23cb2d(_0x1136dc[_0xbc7b('0x17')]['message']);}})[_0xbc7b('0x18')](function(_0x51557b){logger[_0xbc7b('0x14')](_0xbc7b('0xf'),_0x3da410,_0x51557b);_0x2a2a02(_0x51557b);});});}
\ No newline at end of file
diff --git a/server/api/chatTransferReport/index.js b/server/api/chatTransferReport/index.js
index f9cc0a7..6bed48f 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 _0x86b2=['describe','/:id','show','post','create','update','delete','destroy','exports','util','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatTransferReport.controller','get','isAuthenticated','/describe'];(function(_0x1fc55d,_0x37e2f5){var _0x1652d4=function(_0x268ee0){while(--_0x268ee0){_0x1fc55d['push'](_0x1fc55d['shift']());}};_0x1652d4(++_0x37e2f5);}(_0x86b2,0xb1));var _0x286b=function(_0x486f4a,_0x478dc7){_0x486f4a=_0x486f4a-0x0;var _0x135d99=_0x86b2[_0x486f4a];return _0x135d99;};'use strict';var multer=require('multer');var util=require(_0x286b('0x0'));var path=require(_0x286b('0x1'));var timeout=require(_0x286b('0x2'));var express=require(_0x286b('0x3'));var router=express['Router']();var fs_extra=require(_0x286b('0x4'));var auth=require(_0x286b('0x5'));var interaction=require(_0x286b('0x6'));var config=require(_0x286b('0x7'));var controller=require(_0x286b('0x8'));router[_0x286b('0x9')]('/',auth[_0x286b('0xa')](),controller['index']);router[_0x286b('0x9')](_0x286b('0xb'),auth[_0x286b('0xa')](),controller[_0x286b('0xc')]);router[_0x286b('0x9')](_0x286b('0xd'),auth[_0x286b('0xa')](),controller[_0x286b('0xe')]);router[_0x286b('0xf')]('/',auth[_0x286b('0xa')](),controller[_0x286b('0x10')]);router['put'](_0x286b('0xd'),auth[_0x286b('0xa')](),controller[_0x286b('0x11')]);router[_0x286b('0x12')]('/:id',auth[_0x286b('0xa')](),controller[_0x286b('0x13')]);module[_0x286b('0x14')]=router;
\ No newline at end of file
+var _0xf3d7=['util','express','Router','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','describe','/:id','show','post','create','update','delete','destroy','exports','multer'];(function(_0x101e7b,_0x4ef05b){var _0x4995c0=function(_0x1a6488){while(--_0x1a6488){_0x101e7b['push'](_0x101e7b['shift']());}};_0x4995c0(++_0x4ef05b);}(_0xf3d7,0x1d3));var _0x7f3d=function(_0x3b0e76,_0x239221){_0x3b0e76=_0x3b0e76-0x0;var _0x1e4af4=_0xf3d7[_0x3b0e76];return _0x1e4af4;};'use strict';var multer=require(_0x7f3d('0x0'));var util=require(_0x7f3d('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0x7f3d('0x2'));var router=express[_0x7f3d('0x3')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0x7f3d('0x4'));var config=require(_0x7f3d('0x5'));var controller=require('./chatTransferReport.controller');router[_0x7f3d('0x6')]('/',auth[_0x7f3d('0x7')](),controller[_0x7f3d('0x8')]);router[_0x7f3d('0x6')]('/describe',auth['isAuthenticated'](),controller[_0x7f3d('0x9')]);router[_0x7f3d('0x6')](_0x7f3d('0xa'),auth[_0x7f3d('0x7')](),controller[_0x7f3d('0xb')]);router[_0x7f3d('0xc')]('/',auth[_0x7f3d('0x7')](),controller[_0x7f3d('0xd')]);router['put']('/:id',auth[_0x7f3d('0x7')](),controller[_0x7f3d('0xe')]);router[_0x7f3d('0xf')](_0x7f3d('0xa'),auth['isAuthenticated'](),controller[_0x7f3d('0x10')]);module[_0x7f3d('0x11')]=router;
\ No newline at end of file
diff --git a/server/api/chatWebsite/chatWebsite.attributes.js b/server/api/chatWebsite/chatWebsite.attributes.js
index 7e115cb..87c7d1b 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 _0x22fb=['email','Agent','#011F6A','#ffffff','INTEGER','BOOLEAN','ENUM','rounded','We\x20are\x20here!','Send','Contact\x20us','Form\x20properly\x20submitted','Form\x20submission\x20error','Thanks\x20you\x20for\x20your\x20time!','Skip','Feedback','star','TEXT','stringify','input','name','text','getDataValue','parse','setDataValue','textarea','offlineForm','generate','All\x20of\x20our\x20agents\x20are\x20busy\x20at\x20this\x20time.\x20Your\x20chat\x20is\x20very\x20important\x20to\x20us.','Please\x20hold\x20and\x20we\x20will\x20answer\x20your\x20request\x20as\x20soon\x20as\x20possible.','You\x20received\x20a\x20new\x20offline\x20message\x20from\x20websiteName.\x20Here\x20you\x20can\x20find\x20the\x20details\x20of\x20the\x20request:','Your\x20request\x20has\x20not\x20been\x20processed.','Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}','website_alias','bottom_right','CHAT','#fafafa','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','mandatoryDisposition','Generated\x20by\x20XCALLY\x20Motion','Meeting\x20generated\x20for\x20interaction\x20#{{interaction.id}}\x20by\x20{{agent.name}}','exports','STRING','address'];(function(_0x50b0bb,_0x4afe99){var _0x2002be=function(_0x59d745){while(--_0x59d745){_0x50b0bb['push'](_0x50b0bb['shift']());}};_0x2002be(++_0x4afe99);}(_0x22fb,0x192));var _0xb22f=function(_0x44690f,_0x1306b8){_0x44690f=_0x44690f-0x0;var _0x13d2a7=_0x22fb[_0x44690f];return _0x13d2a7;};'use strict';var Sequelize=require('sequelize');var rs=require('randomstring');module[_0xb22f('0x0')]={'name':{'type':Sequelize['STRING'],'allowNull':![]},'address':{'type':Sequelize[_0xb22f('0x1')],'allowNull':![],'unique':_0xb22f('0x2')},'description':{'type':Sequelize[_0xb22f('0x1')]},'mapKey':{'type':Sequelize[_0xb22f('0x1')],'defaultValue':_0xb22f('0x3')},'mapKeyOffline':{'type':Sequelize['STRING'],'defaultValue':_0xb22f('0x3')},'key':{'type':Sequelize[_0xb22f('0x1')],'allowNull':![]},'agentAlias':{'type':Sequelize[_0xb22f('0x1')],'defaultValue':_0xb22f('0x4')},'customerAlias':{'type':Sequelize[_0xb22f('0x1')],'defaultValue':'Me'},'color':{'type':Sequelize[_0xb22f('0x1')],'allowNull':![],'defaultValue':'#011F6A','validate':{'notEmpty':!![]}},'color_button':{'type':Sequelize[_0xb22f('0x1')],'allowNull':![],'defaultValue':_0xb22f('0x5'),'validate':{'notEmpty':!![]}},'textColor':{'type':Sequelize[_0xb22f('0x1')],'allowNull':![],'defaultValue':_0xb22f('0x6'),'validate':{'notEmpty':!![]}},'textButtonColor':{'type':Sequelize[_0xb22f('0x1')],'allowNull':![],'defaultValue':_0xb22f('0x6'),'validate':{'notEmpty':!![]}},'fontSize':{'type':Sequelize[_0xb22f('0x7')],'defaultValue':0xf},'remote':{'type':Sequelize[_0xb22f('0x1')]},'animation':{'type':Sequelize[_0xb22f('0x8')],'defaultValue':!![]},'header_shape':{'type':Sequelize[_0xb22f('0x9')](_0xb22f('0xa'),'squared'),'defaultValue':'rounded'},'header_online':{'type':Sequelize['STRING'],'defaultValue':_0xb22f('0xb')},'start_chat_button':{'type':Sequelize['STRING'],'defaultValue':'Chat'},'offline_chat_button':{'type':Sequelize['STRING'],'defaultValue':_0xb22f('0xc')},'header_offline':{'type':Sequelize[_0xb22f('0x1')],'defaultValue':_0xb22f('0xd')},'download_transcript':{'type':Sequelize[_0xb22f('0x8')],'defaultValue':!![]},'timeout':{'type':Sequelize[_0xb22f('0x7')],'defaultValue':0x0},'whiteLabel':{'type':Sequelize[_0xb22f('0x1')],'defaultValue':'Powered\x20by\x20xCALLY'},'defaultWhiteLabel':{'type':Sequelize[_0xb22f('0x8')],'defaultValue':!![]},'sitepic':{'type':Sequelize['TEXT']},'closingQuestion':{'type':Sequelize[_0xb22f('0x1')],'defaultValue':'Do\x20you\x20want\x20to\x20close\x20the\x20interaction?'},'formSubmitSuccessMessage':{'type':Sequelize[_0xb22f('0x1')],'defaultValue':_0xb22f('0xe')},'formSubmitFailureMessage':{'type':Sequelize[_0xb22f('0x1')],'defaultValue':_0xb22f('0xf')},'noteTitle':{'type':Sequelize[_0xb22f('0x1')],'defaultValue':'Note'},'placeholderMessage':{'type':Sequelize[_0xb22f('0x1')],'defaultValue':'Type\x20a\x20message'},'closingMessage':{'type':Sequelize[_0xb22f('0x1')],'defaultValue':_0xb22f('0x10')},'closingMessageButton':{'type':Sequelize[_0xb22f('0x1')],'defaultValue':_0xb22f('0xc')},'skipMessageButton':{'type':Sequelize[_0xb22f('0x1')],'defaultValue':_0xb22f('0x11')},'conditionAgreement':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'enableRating':{'type':Sequelize[_0xb22f('0x8')],'defaultValue':![]},'enableFeedback':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'enableSendButton':{'type':Sequelize[_0xb22f('0x8')],'defaultValue':![]},'feedbackTitle':{'type':Sequelize[_0xb22f('0x1')],'defaultValue':_0xb22f('0x12')},'ratingType':{'type':Sequelize[_0xb22f('0x9')](_0xb22f('0x13'),'thumb'),'defaultValue':'star'},'ratingStarsNumber':{'type':Sequelize[_0xb22f('0x7')],'defaultValue':0x5},'onlineForm':{'type':Sequelize[_0xb22f('0x14')],'defaultValue':function(){return JSON[_0xb22f('0x15')]({'items':[{'type':_0xb22f('0x16'),'variable':null,'config':{'placeholder':_0xb22f('0x17'),'type':_0xb22f('0x18'),'required':!![]},'props':{'title':_0xb22f('0x17'),'helpText':''}},{'type':_0xb22f('0x16'),'props':{'title':'email','helpText':''},'config':{'required':!![],'placeholder':'email','type':_0xb22f('0x3')},'variable':null}],'fromKey':0x1});},'get':function(){return this[_0xb22f('0x19')]('onlineForm')?JSON[_0xb22f('0x1a')](this[_0xb22f('0x19')]('onlineForm')):{};},'set':function(_0x4687f2){return this[_0xb22f('0x1b')]('onlineForm',JSON[_0xb22f('0x15')](_0x4687f2));}},'offlineForm':{'type':Sequelize[_0xb22f('0x14')],'defaultValue':function(){return JSON[_0xb22f('0x15')]({'items':[{'type':_0xb22f('0x16'),'props':{'title':_0xb22f('0x3'),'helpText':''},'config':{'required':!![],'placeholder':_0xb22f('0x3'),'type':_0xb22f('0x3')},'variable':null},{'type':_0xb22f('0x1c'),'config':{'placeholder':'Comments'},'props':{'title':'Comments','helpText':'Leave\x20your\x20comments'}}],'fromKey':0x0});},'get':function(){return this[_0xb22f('0x19')]('offlineForm')?JSON[_0xb22f('0x1a')](this[_0xb22f('0x19')](_0xb22f('0x1d'))):{};},'set':function(_0x413575){return this[_0xb22f('0x1b')]('offlineForm',JSON['stringify'](_0x413575));}},'token':{'type':Sequelize[_0xb22f('0x1')],'defaultValue':function(){return rs[_0xb22f('0x1e')]();}},'autoclose':{'type':Sequelize[_0xb22f('0x8')],'defaultValue':!![]},'enableCustomerWriting':{'type':Sequelize[_0xb22f('0x8')],'defaultValue':![]},'forwardTranscript':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'forwardTranscriptMessage':{'type':Sequelize[_0xb22f('0x1')]},'forwardOffline':{'type':Sequelize[_0xb22f('0x8')],'defaultValue':![]},'forwardOfflineAddress':{'type':Sequelize['STRING']},'waitingTitle':{'type':Sequelize[_0xb22f('0x1')],'defaultValue':_0xb22f('0x1f')},'waitingMessage':{'type':Sequelize[_0xb22f('0x1')],'defaultValue':_0xb22f('0x20')},'offlineMessageSubject':{'type':Sequelize[_0xb22f('0x1')],'defaultValue':'New\x20offline\x20message\x20from\x20websiteName'},'offlineMessageBody':{'type':Sequelize['STRING'],'defaultValue':_0xb22f('0x21')},'enableUnmanagedNote':{'type':Sequelize[_0xb22f('0x8')],'defaultValue':!![]},'unmanagedMessage':{'type':Sequelize[_0xb22f('0x1')],'defaultValue':_0xb22f('0x22')},'skipUnmanaged':{'type':Sequelize[_0xb22f('0x1')],'defaultValue':_0xb22f('0x11')},'sendUnmanaged':{'type':Sequelize[_0xb22f('0x1')],'defaultValue':_0xb22f('0xc')},'enableCustomerAttachment':{'type':Sequelize[_0xb22f('0x8')],'defaultValue':![]},'enableCustomerCheckmarks':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'agentAvatar':{'type':Sequelize[_0xb22f('0x14')]},'showAgentAvatar':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'timezone':{'type':Sequelize['STRING']},'notificationTemplate':{'type':Sequelize[_0xb22f('0x14')],'defaultValue':function(){return _0xb22f('0x23');}},'notificationSound':{'type':Sequelize[_0xb22f('0x8')],'defaultValue':!![]},'notificationShake':{'type':Sequelize[_0xb22f('0x8')],'defaultValue':![]},'hideWhenOffline':{'type':Sequelize[_0xb22f('0x8')],'defaultValue':![]},'agentIdentifier':{'type':Sequelize[_0xb22f('0x1')],'defaultValue':_0xb22f('0x24')},'waitForTheAssignedAgent':{'type':Sequelize[_0xb22f('0x7')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'alignment':{'type':Sequelize[_0xb22f('0x1')],'defaultValue':_0xb22f('0x25')},'verticalAlignment':{'type':Sequelize[_0xb22f('0x7')],'defaultValue':0x1e},'labelText':{'type':Sequelize[_0xb22f('0x1')],'defaultValue':_0xb22f('0x26')},'messagesAlignment':{'type':Sequelize['STRING'],'defaultValue':'alternate'},'defaultTitle':{'type':Sequelize[_0xb22f('0x1')]},'customerAvatar':{'type':Sequelize[_0xb22f('0x14')]},'showCustomerAvatar':{'type':Sequelize[_0xb22f('0x8')],'defaultValue':![]},'messageFontSize':{'type':Sequelize['INTEGER'],'defaultValue':0xc},'backgroundColor':{'type':Sequelize[_0xb22f('0x1')],'allowNull':![],'defaultValue':_0xb22f('0x27'),'validate':{'notEmpty':!![]}},'queueTransfer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0xb22f('0x8')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'systemAlias':{'type':Sequelize[_0xb22f('0x1')],'defaultValue':'System'},'systemAvatar':{'type':Sequelize[_0xb22f('0x14')]},'mandatoryDispositionPauseId':{'type':Sequelize[_0xb22f('0x7')],'comment':_0xb22f('0x28')},'mandatoryDisposition':{'type':Sequelize['BOOLEAN'],'defaultValue':![],'comment':_0xb22f('0x29'),'set':function(_0x2d265c){if(!_0x2d265c)this[_0xb22f('0x1b')]('mandatoryDispositionPauseId',null);this[_0xb22f('0x1b')](_0xb22f('0x2a'),_0x2d265c);}},'vidaooEscalation':{'type':Sequelize[_0xb22f('0x8')],'defaultValue':![]},'vidaooApiKey':{'type':Sequelize[_0xb22f('0x1')]},'vidaooTopic':{'type':Sequelize[_0xb22f('0x1')],'allowNull':![],'defaultValue':_0xb22f('0x2b')},'vidaooNote':{'type':Sequelize[_0xb22f('0x1')],'defaultValue':function(){return _0xb22f('0x2c');}},'vidaooMetadata':{'type':Sequelize[_0xb22f('0x14')],'defaultValue':null},'openNewInteraction':{'type':Sequelize[_0xb22f('0x8')],'defaultValue':![],'allowNull':!![]},'subjectOffline':{'type':Sequelize['TEXT']}};
\ No newline at end of file
+var _0x9f62=['Skip','Feedback','thumb','stringify','input','name','getDataValue','parse','setDataValue','onlineForm','textarea','Comments','Leave\x20your\x20comments','offlineForm','generate','All\x20of\x20our\x20agents\x20are\x20busy\x20at\x20this\x20time.\x20Your\x20chat\x20is\x20very\x20important\x20to\x20us.','New\x20offline\x20message\x20from\x20websiteName','You\x20received\x20a\x20new\x20offline\x20message\x20from\x20websiteName.\x20Here\x20you\x20can\x20find\x20the\x20details\x20of\x20the\x20request:','Your\x20request\x20has\x20not\x20been\x20processed.','Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}','website_alias','CHAT','mandatoryDisposition','Generated\x20by\x20XCALLY\x20Motion','Meeting\x20generated\x20for\x20interaction\x20#{{interaction.id}}\x20by\x20{{agent.name}}','randomstring','STRING','address','email','Agent','#011F6A','#ffffff','INTEGER','ENUM','rounded','Send','Contact\x20us','BOOLEAN','Powered\x20by\x20xCALLY','TEXT','Do\x20you\x20want\x20to\x20close\x20the\x20interaction?','Form\x20properly\x20submitted','Form\x20submission\x20error','Note','Thanks\x20you\x20for\x20your\x20time!'];(function(_0x63e7e8,_0x59eb07){var _0x249c2b=function(_0x1a0431){while(--_0x1a0431){_0x63e7e8['push'](_0x63e7e8['shift']());}};_0x249c2b(++_0x59eb07);}(_0x9f62,0x154));var _0x29f6=function(_0x382b75,_0x5669ba){_0x382b75=_0x382b75-0x0;var _0x150923=_0x9f62[_0x382b75];return _0x150923;};'use strict';var Sequelize=require('sequelize');var rs=require(_0x29f6('0x0'));module['exports']={'name':{'type':Sequelize[_0x29f6('0x1')],'allowNull':![]},'address':{'type':Sequelize[_0x29f6('0x1')],'allowNull':![],'unique':_0x29f6('0x2')},'description':{'type':Sequelize['STRING']},'mapKey':{'type':Sequelize['STRING'],'defaultValue':_0x29f6('0x3')},'mapKeyOffline':{'type':Sequelize[_0x29f6('0x1')],'defaultValue':_0x29f6('0x3')},'key':{'type':Sequelize[_0x29f6('0x1')],'allowNull':![]},'agentAlias':{'type':Sequelize['STRING'],'defaultValue':_0x29f6('0x4')},'customerAlias':{'type':Sequelize[_0x29f6('0x1')],'defaultValue':'Me'},'color':{'type':Sequelize[_0x29f6('0x1')],'allowNull':![],'defaultValue':_0x29f6('0x5'),'validate':{'notEmpty':!![]}},'color_button':{'type':Sequelize[_0x29f6('0x1')],'allowNull':![],'defaultValue':'#011F6A','validate':{'notEmpty':!![]}},'textColor':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':'#ffffff','validate':{'notEmpty':!![]}},'textButtonColor':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0x29f6('0x6'),'validate':{'notEmpty':!![]}},'fontSize':{'type':Sequelize[_0x29f6('0x7')],'defaultValue':0xf},'remote':{'type':Sequelize['STRING']},'animation':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'header_shape':{'type':Sequelize[_0x29f6('0x8')](_0x29f6('0x9'),'squared'),'defaultValue':_0x29f6('0x9')},'header_online':{'type':Sequelize[_0x29f6('0x1')],'defaultValue':'We\x20are\x20here!'},'start_chat_button':{'type':Sequelize['STRING'],'defaultValue':'Chat'},'offline_chat_button':{'type':Sequelize['STRING'],'defaultValue':_0x29f6('0xa')},'header_offline':{'type':Sequelize[_0x29f6('0x1')],'defaultValue':_0x29f6('0xb')},'download_transcript':{'type':Sequelize[_0x29f6('0xc')],'defaultValue':!![]},'timeout':{'type':Sequelize[_0x29f6('0x7')],'defaultValue':0x0},'whiteLabel':{'type':Sequelize[_0x29f6('0x1')],'defaultValue':_0x29f6('0xd')},'defaultWhiteLabel':{'type':Sequelize[_0x29f6('0xc')],'defaultValue':!![]},'sitepic':{'type':Sequelize[_0x29f6('0xe')]},'closingQuestion':{'type':Sequelize[_0x29f6('0x1')],'defaultValue':_0x29f6('0xf')},'formSubmitSuccessMessage':{'type':Sequelize[_0x29f6('0x1')],'defaultValue':_0x29f6('0x10')},'formSubmitFailureMessage':{'type':Sequelize[_0x29f6('0x1')],'defaultValue':_0x29f6('0x11')},'noteTitle':{'type':Sequelize[_0x29f6('0x1')],'defaultValue':_0x29f6('0x12')},'placeholderMessage':{'type':Sequelize['STRING'],'defaultValue':'Type\x20a\x20message'},'closingMessage':{'type':Sequelize[_0x29f6('0x1')],'defaultValue':_0x29f6('0x13')},'closingMessageButton':{'type':Sequelize[_0x29f6('0x1')],'defaultValue':'Send'},'skipMessageButton':{'type':Sequelize[_0x29f6('0x1')],'defaultValue':_0x29f6('0x14')},'conditionAgreement':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'enableRating':{'type':Sequelize[_0x29f6('0xc')],'defaultValue':![]},'enableFeedback':{'type':Sequelize[_0x29f6('0xc')],'defaultValue':![]},'enableSendButton':{'type':Sequelize[_0x29f6('0xc')],'defaultValue':![]},'feedbackTitle':{'type':Sequelize[_0x29f6('0x1')],'defaultValue':_0x29f6('0x15')},'ratingType':{'type':Sequelize[_0x29f6('0x8')]('star',_0x29f6('0x16')),'defaultValue':'star'},'ratingStarsNumber':{'type':Sequelize['INTEGER'],'defaultValue':0x5},'onlineForm':{'type':Sequelize[_0x29f6('0xe')],'defaultValue':function(){return JSON[_0x29f6('0x17')]({'items':[{'type':_0x29f6('0x18'),'variable':null,'config':{'placeholder':_0x29f6('0x19'),'type':'text','required':!![]},'props':{'title':_0x29f6('0x19'),'helpText':''}},{'type':'input','props':{'title':_0x29f6('0x3'),'helpText':''},'config':{'required':!![],'placeholder':_0x29f6('0x3'),'type':_0x29f6('0x3')},'variable':null}],'fromKey':0x1});},'get':function(){return this[_0x29f6('0x1a')]('onlineForm')?JSON[_0x29f6('0x1b')](this[_0x29f6('0x1a')]('onlineForm')):{};},'set':function(_0x1401fb){return this[_0x29f6('0x1c')](_0x29f6('0x1d'),JSON[_0x29f6('0x17')](_0x1401fb));}},'offlineForm':{'type':Sequelize[_0x29f6('0xe')],'defaultValue':function(){return JSON[_0x29f6('0x17')]({'items':[{'type':_0x29f6('0x18'),'props':{'title':'email','helpText':''},'config':{'required':!![],'placeholder':_0x29f6('0x3'),'type':_0x29f6('0x3')},'variable':null},{'type':_0x29f6('0x1e'),'config':{'placeholder':_0x29f6('0x1f')},'props':{'title':_0x29f6('0x1f'),'helpText':_0x29f6('0x20')}}],'fromKey':0x0});},'get':function(){return this[_0x29f6('0x1a')](_0x29f6('0x21'))?JSON[_0x29f6('0x1b')](this[_0x29f6('0x1a')](_0x29f6('0x21'))):{};},'set':function(_0x1c3f0b){return this[_0x29f6('0x1c')](_0x29f6('0x21'),JSON[_0x29f6('0x17')](_0x1c3f0b));}},'token':{'type':Sequelize[_0x29f6('0x1')],'defaultValue':function(){return rs[_0x29f6('0x22')]();}},'autoclose':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'enableCustomerWriting':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'forwardTranscript':{'type':Sequelize[_0x29f6('0xc')],'defaultValue':![]},'forwardTranscriptMessage':{'type':Sequelize['STRING']},'forwardOffline':{'type':Sequelize[_0x29f6('0xc')],'defaultValue':![]},'forwardOfflineAddress':{'type':Sequelize[_0x29f6('0x1')]},'waitingTitle':{'type':Sequelize[_0x29f6('0x1')],'defaultValue':_0x29f6('0x23')},'waitingMessage':{'type':Sequelize['STRING'],'defaultValue':'Please\x20hold\x20and\x20we\x20will\x20answer\x20your\x20request\x20as\x20soon\x20as\x20possible.'},'offlineMessageSubject':{'type':Sequelize[_0x29f6('0x1')],'defaultValue':_0x29f6('0x24')},'offlineMessageBody':{'type':Sequelize[_0x29f6('0x1')],'defaultValue':_0x29f6('0x25')},'enableUnmanagedNote':{'type':Sequelize[_0x29f6('0xc')],'defaultValue':!![]},'unmanagedMessage':{'type':Sequelize[_0x29f6('0x1')],'defaultValue':_0x29f6('0x26')},'skipUnmanaged':{'type':Sequelize[_0x29f6('0x1')],'defaultValue':_0x29f6('0x14')},'sendUnmanaged':{'type':Sequelize[_0x29f6('0x1')],'defaultValue':_0x29f6('0xa')},'enableCustomerAttachment':{'type':Sequelize[_0x29f6('0xc')],'defaultValue':![]},'enableCustomerCheckmarks':{'type':Sequelize[_0x29f6('0xc')],'defaultValue':![]},'agentAvatar':{'type':Sequelize[_0x29f6('0xe')]},'showAgentAvatar':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'timezone':{'type':Sequelize['STRING']},'notificationTemplate':{'type':Sequelize[_0x29f6('0xe')],'defaultValue':function(){return _0x29f6('0x27');}},'notificationSound':{'type':Sequelize[_0x29f6('0xc')],'defaultValue':!![]},'notificationShake':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'hideWhenOffline':{'type':Sequelize[_0x29f6('0xc')],'defaultValue':![]},'agentIdentifier':{'type':Sequelize[_0x29f6('0x1')],'defaultValue':_0x29f6('0x28')},'waitForTheAssignedAgent':{'type':Sequelize[_0x29f6('0x7')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'alignment':{'type':Sequelize[_0x29f6('0x1')],'defaultValue':'bottom_right'},'verticalAlignment':{'type':Sequelize[_0x29f6('0x7')],'defaultValue':0x1e},'labelText':{'type':Sequelize[_0x29f6('0x1')],'defaultValue':_0x29f6('0x29')},'messagesAlignment':{'type':Sequelize[_0x29f6('0x1')],'defaultValue':'alternate'},'defaultTitle':{'type':Sequelize[_0x29f6('0x1')]},'customerAvatar':{'type':Sequelize[_0x29f6('0xe')]},'showCustomerAvatar':{'type':Sequelize[_0x29f6('0xc')],'defaultValue':![]},'messageFontSize':{'type':Sequelize[_0x29f6('0x7')],'defaultValue':0xc},'backgroundColor':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':'#fafafa','validate':{'notEmpty':!![]}},'queueTransfer':{'type':Sequelize[_0x29f6('0xc')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0x29f6('0xc')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'systemAlias':{'type':Sequelize[_0x29f6('0x1')],'defaultValue':'System'},'systemAvatar':{'type':Sequelize[_0x29f6('0xe')]},'mandatoryDispositionPauseId':{'type':Sequelize[_0x29f6('0x7')],'comment':'Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled'},'mandatoryDisposition':{'type':Sequelize[_0x29f6('0xc')],'defaultValue':![],'comment':'Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','set':function(_0x3f3475){if(!_0x3f3475)this[_0x29f6('0x1c')]('mandatoryDispositionPauseId',null);this[_0x29f6('0x1c')](_0x29f6('0x2a'),_0x3f3475);}},'vidaooEscalation':{'type':Sequelize[_0x29f6('0xc')],'defaultValue':![]},'vidaooApiKey':{'type':Sequelize[_0x29f6('0x1')]},'vidaooTopic':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0x29f6('0x2b')},'vidaooNote':{'type':Sequelize[_0x29f6('0x1')],'defaultValue':function(){return _0x29f6('0x2c');}},'vidaooMetadata':{'type':Sequelize[_0x29f6('0xe')],'defaultValue':null},'openNewInteraction':{'type':Sequelize[_0x29f6('0xc')],'defaultValue':![],'allowNull':!![]},'subjectOffline':{'type':Sequelize['TEXT']}};
\ No newline at end of file
diff --git a/server/api/chatWebsite/chatWebsite.controller.js b/server/api/chatWebsite/chatWebsite.controller.js
index 0985ff2..294ef4d 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 _0xb6bc=['push','close','*,*,*,*','AttachmentId','UserId','User','unshift','waitForTheAssignedAgent','forcedOwnership','Start','startRouting','EventManager','notify','offline','files','mapKeyOffline\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','mapKeyOffline','mapKeyOffline\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','MailAccount','findOrCreate','readFileSync','utf8','render','toPairs','ChatOfflineMessage','fromString','originalname','mimetype','server','attachments','offline-chat','basename','openNewInteraction','sequelize','bulkCreate','Smtp','CloudProvider','forwardOffline','getSmtpOptions','SendMail','sendMail','email','forwardOfflineAddress','MailAccountId','subjectOffline','offlineMessageSubject','NotifyMailAccount','remove','addInteraction','omit','Contact','Owner','fullname','internal','Tag','color','tag','Command','getSnippet','timezone','iftime\x20%s','interval','indexOf','ONLINE','OFFLINE','No\x20timezone','[%s][INTERVAL][%s]\x20%s\x20%s\x20(%s)','inspect','Interval','Intervals','../../config/license/util','virtual','custom','License','increment','some','server/files/chat/iframe.ejs','URL','address','origin','3.1.0','remote','x-real-ip','connection','remoteAddress','replace','textColor','textButtonColor','color_button','hideWhenOffline','IntervalId','addApplications','transaction','ISOLATION_LEVELS','finally','getApplications','chatProactiveAction','addProactiveActions','getProactiveActions','getFields','online','offlineForm','items','fromKey','getOfflineMessages','Attachment','Attachments','addAgents','emit','removeAgents','userChatWebsite:remove','getAgents','mustache','ejs','fs-extra','lodash','querystring','ioredis','../../components/parsers/qs','../../config/logger','api','../../config/environment','url','../../mysqldb','redis','defaults','localhost','socket.io-emitter','register','html-to-text','jayson/promise','client','http','then','info','ChatWebsite,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','catch','sendStatus','status','end','json','offset','undefined','count','limit','set','Content-Range','destroy','get','ChatWebsites','stack','name','send','index','Pause','mandatoryDispositionPause','map','ChatWebsite','rawAttributes','type','key','model','query','keys','filters','intersection','fields','attributes','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','findAll','rows','show','length','include','find','create','body','user','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','params','describe','addDisposition','Disposition','getDispositions','findOne','hasOwnProperty','removeDispositions','ids','ChatWebsiteId','CannedAnswer','getAnswers','removeAnswers','addLogo','filename','agentAvatar','file','addCustomerAvatar','customerAvatar','addSystemAvatar','getLogo','join','root','server/files/images/logos/default_logo.svg','getLicense','isNil','sitepic','download','getAvatar','existsSync','server/files/images/avatars/','server/files/images/avatars/customer_avatar.png','showCustomerAvatar','getSystemAvatar','server/files/images/avatars/system_avatar.png','systemAvatar','user-agent-parser','setUA','headers','user-agent','chat','CmContact','Sequelize','ValidationError','no\x20available\x20attributes','difference','createdAt','updatedAt','CompanyId','ListId','from','body\x20is\x20mandatory\x20and\x20not\x20empty','mapKey','mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','includes','mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','List','Contacts','ChatApplication','Applications','account','applications','orderBy','priority','asc','contact','customerIp','cf-connecting-ip','x-forwarded-for','first','split','firstName','lastName','x-real-port','browser','version','unknown','format','%s\x20%s','device','vendor','%s\x20%s\x20%s','threadId','ChatInteraction','externalUrl','ContactId','interaction','spread','messageId','autoclose'];(function(_0x3537ba,_0x2d30d8){var _0x393f1e=function(_0x45aba0){while(--_0x45aba0){_0x3537ba['push'](_0x3537ba['shift']());}};_0x393f1e(++_0x2d30d8);}(_0xb6bc,0x70));var _0xcb6b=function(_0x13e741,_0x5d3c24){_0x13e741=_0x13e741-0x0;var _0x3f8bb3=_0xb6bc[_0x13e741];return _0x3f8bb3;};'use strict';var BPromise=require('bluebird');var Mustache=require(_0xcb6b('0x0'));var util=require('util');var path=require('path');var ejs=require(_0xcb6b('0x1'));var fs=require('fs');var fs_extra=require(_0xcb6b('0x2'));var _=require(_0xcb6b('0x3'));var querystring=require(_0xcb6b('0x4'));var Redis=require(_0xcb6b('0x5'));var qs=require(_0xcb6b('0x6'));var logger=require(_0xcb6b('0x7'))(_0xcb6b('0x8'));var config=require(_0xcb6b('0x9'));var url=require(_0xcb6b('0xa'));var db=require(_0xcb6b('0xb'))['db'];config[_0xcb6b('0xc')]=_[_0xcb6b('0xd')](config[_0xcb6b('0xc')],{'host':_0xcb6b('0xe'),'port':0x18eb});var socket=require(_0xcb6b('0xf'))(new Redis(config[_0xcb6b('0xc')]));require('./chatWebsite.socket')[_0xcb6b('0x10')](socket);var htmlToText=require(_0xcb6b('0x11'));var jayson=require(_0xcb6b('0x12'));var client=jayson[_0xcb6b('0x13')]['http']({'port':0x232c});var client9002=jayson[_0xcb6b('0x13')][_0xcb6b('0x14')]({'port':0x232a});var client9003=jayson['client'][_0xcb6b('0x14')]({'port':0x232b});var client9001=jayson[_0xcb6b('0x13')][_0xcb6b('0x14')]({'port':0x2329});function respondWithRpcPromise(_0x34b262,_0x322e16,_0x4e31fd,_0x44a21a){return new BPromise(function(_0x76a4c,_0x34dad0){var _0x1e0cf1=_0x44a21a||client;return _0x1e0cf1['request'](_0x34b262,_0x4e31fd)[_0xcb6b('0x15')](function(_0x2e7d15){logger[_0xcb6b('0x16')](_0xcb6b('0x17'),_0x322e16,_0xcb6b('0x18'));logger[_0xcb6b('0x19')]('ChatWebsite,\x20%s,\x20%s,\x20%s',_0x322e16,_0xcb6b('0x18'),JSON[_0xcb6b('0x1a')](_0x2e7d15));if(_0x2e7d15[_0xcb6b('0x1b')]){if(_0x2e7d15['error'][_0xcb6b('0x1c')]===0x1f4){logger['error']('ChatWebsite,\x20%s,\x20%s',_0x322e16,_0x2e7d15[_0xcb6b('0x1b')]['message']);return _0x34dad0(_0x2e7d15[_0xcb6b('0x1b')][_0xcb6b('0x1d')]);}logger[_0xcb6b('0x1b')]('ChatWebsite,\x20%s,\x20%s',_0x322e16,_0x2e7d15[_0xcb6b('0x1b')]['message']);return _0x76a4c(_0x2e7d15[_0xcb6b('0x1b')][_0xcb6b('0x1d')]);}else{logger[_0xcb6b('0x16')]('ChatWebsite,\x20%s,\x20%s',_0x322e16,'request\x20sent');_0x76a4c(_0x2e7d15['result'][_0xcb6b('0x1d')]);}})[_0xcb6b('0x1e')](function(_0x13b3e4){logger[_0xcb6b('0x1b')](_0xcb6b('0x17'),_0x322e16,_0x13b3e4);_0x34dad0(_0x13b3e4);});});}function respondWithStatusCode(_0x326aee,_0x3394a8){_0x3394a8=_0x3394a8||0xcc;return function(_0x433809){if(_0x433809){return _0x326aee[_0xcb6b('0x1f')](_0x3394a8);}return _0x326aee[_0xcb6b('0x20')](_0x3394a8)[_0xcb6b('0x21')]();};}function respondWithResult(_0x54947b,_0x14bfb0){_0x14bfb0=_0x14bfb0||0xc8;return function(_0x5397ce){if(_0x5397ce){return _0x54947b[_0xcb6b('0x20')](_0x14bfb0)[_0xcb6b('0x22')](_0x5397ce);}};}function respondWithFilteredResult(_0x20bfe5,_0x31ccf5){return function(_0xd8ba2b){if(_0xd8ba2b){var _0x2719d1=typeof _0x31ccf5[_0xcb6b('0x23')]===_0xcb6b('0x24')&&typeof _0x31ccf5['limit']===_0xcb6b('0x24');var _0x1ba8d6=_0xd8ba2b['count'];var _0x3386e3=_0x2719d1?0x0:_0x31ccf5[_0xcb6b('0x23')];var _0xc2652e=_0x2719d1?_0xd8ba2b[_0xcb6b('0x25')]:_0x31ccf5[_0xcb6b('0x23')]+_0x31ccf5[_0xcb6b('0x26')];var _0x3ee695;if(_0xc2652e>=_0x1ba8d6){_0xc2652e=_0x1ba8d6;_0x3ee695=0xc8;}else{_0x3ee695=0xce;}_0x20bfe5['status'](_0x3ee695);return _0x20bfe5[_0xcb6b('0x27')](_0xcb6b('0x28'),_0x3386e3+'-'+_0xc2652e+'/'+_0x1ba8d6)[_0xcb6b('0x22')](_0xd8ba2b);}return null;};}function saveUpdates(_0x3da9a7){return function(_0x5a193f){if(_0x5a193f){return _0x5a193f['update'](_0x3da9a7)[_0xcb6b('0x15')](function(_0x59539f){return _0x59539f;});}return null;};}function removeEntity(_0x2e7399){return function(_0x528c5e){if(_0x528c5e){return _0x528c5e[_0xcb6b('0x29')]()[_0xcb6b('0x15')](function(){var _0x42e4e8=_0x528c5e[_0xcb6b('0x2a')]({'plain':!![]});var _0x3317a7=_0xcb6b('0x2b');return db['UserProfileResource'][_0xcb6b('0x29')]({'where':{'type':_0x3317a7,'resourceId':_0x42e4e8['id']}})[_0xcb6b('0x15')](function(){return _0x528c5e;});})[_0xcb6b('0x15')](function(){_0x2e7399[_0xcb6b('0x20')](0xcc)[_0xcb6b('0x21')]();});}};}function handleEntityNotFound(_0xc8d9fa){return function(_0x5928f3){if(!_0x5928f3){_0xc8d9fa[_0xcb6b('0x1f')](0x194);}return _0x5928f3;};}function handleError(_0x298609,_0x2ed878){_0x2ed878=_0x2ed878||0x1f4;return function(_0x2f654a){logger['error'](_0x2f654a[_0xcb6b('0x2c')]);if(_0x2f654a[_0xcb6b('0x2d')]){delete _0x2f654a[_0xcb6b('0x2d')];}_0x298609['status'](_0x2ed878)[_0xcb6b('0x2e')](_0x2f654a);};}exports[_0xcb6b('0x2f')]=function(_0x17ee5f,_0x3fb597){var _0xd39505={'include':[{'model':db[_0xcb6b('0x30')],'as':_0xcb6b('0x31')}]},_0x226ab2={},_0x5a77cb={'count':0x0,'rows':[]};var _0x3aa1de=_[_0xcb6b('0x32')](db[_0xcb6b('0x33')][_0xcb6b('0x34')],function(_0x5eb3a8){return{'name':_0x5eb3a8['fieldName'],'type':_0x5eb3a8[_0xcb6b('0x35')][_0xcb6b('0x36')]};});_0x226ab2[_0xcb6b('0x37')]=_['map'](_0x3aa1de,_0xcb6b('0x2d'));_0x226ab2[_0xcb6b('0x38')]=_[_0xcb6b('0x39')](_0x17ee5f['query']);_0x226ab2[_0xcb6b('0x3a')]=_[_0xcb6b('0x3b')](_0x226ab2[_0xcb6b('0x37')],_0x226ab2[_0xcb6b('0x38')]);_0xd39505['attributes']=_[_0xcb6b('0x3b')](_0x226ab2[_0xcb6b('0x37')],qs[_0xcb6b('0x3c')](_0x17ee5f[_0xcb6b('0x38')][_0xcb6b('0x3c')]));_0xd39505[_0xcb6b('0x3d')]=_0xd39505[_0xcb6b('0x3d')]['length']?_0xd39505[_0xcb6b('0x3d')]:_0x226ab2[_0xcb6b('0x37')];if(!_0x17ee5f[_0xcb6b('0x38')]['hasOwnProperty'](_0xcb6b('0x3e'))){_0xd39505['limit']=qs[_0xcb6b('0x26')](_0x17ee5f['query'][_0xcb6b('0x26')]);_0xd39505[_0xcb6b('0x23')]=qs[_0xcb6b('0x23')](_0x17ee5f[_0xcb6b('0x38')]['offset']);}_0xd39505[_0xcb6b('0x3f')]=qs[_0xcb6b('0x40')](_0x17ee5f[_0xcb6b('0x38')][_0xcb6b('0x40')]);_0xd39505[_0xcb6b('0x41')]=qs[_0xcb6b('0x3a')](_[_0xcb6b('0x42')](_0x17ee5f['query'],_0x226ab2[_0xcb6b('0x3a')]),_0x3aa1de);if(_0x17ee5f[_0xcb6b('0x38')][_0xcb6b('0x43')]){_0xd39505[_0xcb6b('0x41')]=_[_0xcb6b('0x44')](_0xd39505['where'],{'$or':_['map'](_0x3aa1de,function(_0x162381){if(_0x162381[_0xcb6b('0x35')]!==_0xcb6b('0x45')){var _0x5033bb={};_0x5033bb[_0x162381[_0xcb6b('0x2d')]]={'$like':'%'+_0x17ee5f[_0xcb6b('0x38')][_0xcb6b('0x43')]+'%'};return _0x5033bb;}})});}_0xd39505=_[_0xcb6b('0x44')]({},_0xd39505,_0x17ee5f[_0xcb6b('0x46')]);var _0x253f48={'where':_0xd39505[_0xcb6b('0x41')]};return db[_0xcb6b('0x33')][_0xcb6b('0x25')](_0x253f48)[_0xcb6b('0x15')](function(_0x282d9e){_0x5a77cb['count']=_0x282d9e;if(_0x17ee5f[_0xcb6b('0x38')][_0xcb6b('0x47')]){_0xd39505['include']=[{'all':!![]}];}return db['ChatWebsite'][_0xcb6b('0x48')](_0xd39505);})['then'](function(_0x59b960){_0x5a77cb[_0xcb6b('0x49')]=_0x59b960;return _0x5a77cb;})[_0xcb6b('0x15')](respondWithFilteredResult(_0x3fb597,_0xd39505))[_0xcb6b('0x1e')](handleError(_0x3fb597,null));};exports[_0xcb6b('0x4a')]=function(_0x32f23a,_0x41bbf4){var _0x44957f={'raw':![],'where':{'id':_0x32f23a['params']['id']},'include':[{'model':db[_0xcb6b('0x30')],'as':_0xcb6b('0x31')}]},_0x9bc740={};_0x9bc740[_0xcb6b('0x37')]=_[_0xcb6b('0x39')](db['ChatWebsite'][_0xcb6b('0x34')]);_0x9bc740[_0xcb6b('0x38')]=_[_0xcb6b('0x39')](_0x32f23a[_0xcb6b('0x38')]);_0x9bc740['filters']=_[_0xcb6b('0x3b')](_0x9bc740[_0xcb6b('0x37')],_0x9bc740[_0xcb6b('0x38')]);_0x44957f[_0xcb6b('0x3d')]=_[_0xcb6b('0x3b')](_0x9bc740[_0xcb6b('0x37')],qs[_0xcb6b('0x3c')](_0x32f23a[_0xcb6b('0x38')][_0xcb6b('0x3c')]));_0x44957f[_0xcb6b('0x3d')]=_0x44957f['attributes'][_0xcb6b('0x4b')]?_0x44957f['attributes']:_0x9bc740[_0xcb6b('0x37')];if(_0x32f23a[_0xcb6b('0x38')][_0xcb6b('0x47')]){_0x44957f[_0xcb6b('0x4c')]=[{'all':!![]}];}_0x44957f=_[_0xcb6b('0x44')]({},_0x44957f,_0x32f23a[_0xcb6b('0x46')]);return db[_0xcb6b('0x33')][_0xcb6b('0x4d')](_0x44957f)[_0xcb6b('0x15')](handleEntityNotFound(_0x41bbf4,null))[_0xcb6b('0x15')](respondWithResult(_0x41bbf4,null))['catch'](handleError(_0x41bbf4,null));};exports[_0xcb6b('0x4e')]=function(_0x39222e,_0x2a8b26){return db[_0xcb6b('0x33')][_0xcb6b('0x4e')](_0x39222e[_0xcb6b('0x4f')],{})[_0xcb6b('0x15')](function(_0x640dbc){var _0x599255=_0x39222e[_0xcb6b('0x50')][_0xcb6b('0x2a')]({'plain':!![]});if(!_0x599255)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x599255['role']===_0xcb6b('0x50')){var _0x5bf453=_0x640dbc['get']({'plain':!![]});var _0x1d0b0b='ChatWebsites';return db[_0xcb6b('0x51')][_0xcb6b('0x4d')]({'where':{'name':_0x1d0b0b,'userProfileId':_0x599255[_0xcb6b('0x52')]},'raw':!![]})['then'](function(_0x387017){if(_0x387017&&_0x387017[_0xcb6b('0x53')]===0x0){return db['UserProfileResource'][_0xcb6b('0x4e')]({'name':_0x5bf453[_0xcb6b('0x2d')],'resourceId':_0x5bf453['id'],'type':_0x387017[_0xcb6b('0x2d')],'sectionId':_0x387017['id']},{})[_0xcb6b('0x15')](function(){return _0x640dbc;});}else{return _0x640dbc;}})[_0xcb6b('0x1e')](function(_0x5b7333){logger[_0xcb6b('0x1b')](_0xcb6b('0x54'),_0x5b7333);throw _0x5b7333;});}return _0x640dbc;})[_0xcb6b('0x15')](respondWithResult(_0x2a8b26,0xc9))[_0xcb6b('0x1e')](handleError(_0x2a8b26,null));};exports[_0xcb6b('0x55')]=function(_0x125869,_0x1c9978){if(_0x125869[_0xcb6b('0x4f')]['id']){delete _0x125869[_0xcb6b('0x4f')]['id'];}return db['ChatWebsite'][_0xcb6b('0x4d')]({'where':{'id':_0x125869[_0xcb6b('0x56')]['id']},'include':[{'model':db[_0xcb6b('0x30')],'as':_0xcb6b('0x31')}]})[_0xcb6b('0x15')](handleEntityNotFound(_0x1c9978,null))[_0xcb6b('0x15')](saveUpdates(_0x125869[_0xcb6b('0x4f')],null))[_0xcb6b('0x15')](respondWithResult(_0x1c9978,null))[_0xcb6b('0x1e')](handleError(_0x1c9978,null));};exports[_0xcb6b('0x29')]=function(_0x4c3194,_0x14ad23){return db[_0xcb6b('0x33')]['find']({'where':{'id':_0x4c3194[_0xcb6b('0x56')]['id']}})[_0xcb6b('0x15')](handleEntityNotFound(_0x14ad23,null))[_0xcb6b('0x15')](removeEntity(_0x14ad23,null))[_0xcb6b('0x1e')](handleError(_0x14ad23,null));};exports['describe']=function(_0x5293e1,_0xf71291){return db[_0xcb6b('0x33')][_0xcb6b('0x57')]()[_0xcb6b('0x15')](respondWithResult(_0xf71291,null))[_0xcb6b('0x1e')](handleError(_0xf71291,null));};exports[_0xcb6b('0x58')]=function(_0x3a4bd9,_0x1c60e7){if(_0x3a4bd9[_0xcb6b('0x4f')]['id']){delete _0x3a4bd9[_0xcb6b('0x4f')]['id'];}return db[_0xcb6b('0x33')][_0xcb6b('0x4d')]({'where':{'id':_0x3a4bd9['params']['id']}})[_0xcb6b('0x15')](handleEntityNotFound(_0x1c60e7,null))[_0xcb6b('0x15')](function(_0x3c7c8e){if(_0x3c7c8e){_0x3a4bd9['body']['ChatWebsiteId']=_0x3c7c8e['id'];return db[_0xcb6b('0x59')][_0xcb6b('0x4e')](_0x3a4bd9[_0xcb6b('0x4f')]);}})['then'](respondWithResult(_0x1c60e7,null))[_0xcb6b('0x1e')](handleError(_0x1c60e7,null));};exports[_0xcb6b('0x5a')]=function(_0x1821f3,_0x408dc8){var _0x531ffe={'raw':![],'where':{}};var _0x502f85={};var _0x5399ac={'count':0x0,'rows':[]};return db[_0xcb6b('0x33')][_0xcb6b('0x5b')]({'where':{'id':_0x1821f3[_0xcb6b('0x56')]['id']}})[_0xcb6b('0x15')](handleEntityNotFound(_0x408dc8,null))[_0xcb6b('0x15')](function(_0x1a4623){if(_0x1a4623){_0x502f85[_0xcb6b('0x37')]=_[_0xcb6b('0x39')](db[_0xcb6b('0x59')][_0xcb6b('0x34')]);_0x502f85[_0xcb6b('0x38')]=_[_0xcb6b('0x39')](_0x1821f3[_0xcb6b('0x38')]);_0x502f85[_0xcb6b('0x3a')]=_[_0xcb6b('0x3b')](_0x502f85[_0xcb6b('0x37')],_0x502f85[_0xcb6b('0x38')]);_0x531ffe[_0xcb6b('0x3d')]=_[_0xcb6b('0x3b')](_0x502f85['model'],qs[_0xcb6b('0x3c')](_0x1821f3['query'][_0xcb6b('0x3c')]));_0x531ffe[_0xcb6b('0x3d')]=_0x531ffe[_0xcb6b('0x3d')][_0xcb6b('0x4b')]?_0x531ffe[_0xcb6b('0x3d')]:_0x502f85[_0xcb6b('0x37')];if(!_0x1821f3[_0xcb6b('0x38')][_0xcb6b('0x5c')](_0xcb6b('0x3e'))){_0x531ffe[_0xcb6b('0x26')]=qs[_0xcb6b('0x26')](_0x1821f3[_0xcb6b('0x38')][_0xcb6b('0x26')]);_0x531ffe[_0xcb6b('0x23')]=qs[_0xcb6b('0x23')](_0x1821f3['query'][_0xcb6b('0x23')]);}_0x531ffe[_0xcb6b('0x3f')]=qs[_0xcb6b('0x40')](_0x1821f3[_0xcb6b('0x38')]['sort']);_0x531ffe[_0xcb6b('0x41')]=qs['filters'](_[_0xcb6b('0x42')](_0x1821f3[_0xcb6b('0x38')],_0x502f85['filters']));_0x531ffe['where']['ChatWebsiteId']=_0x1a4623['id'];if(_0x1821f3[_0xcb6b('0x38')][_0xcb6b('0x43')]){_0x531ffe[_0xcb6b('0x41')]=_['merge'](_0x531ffe[_0xcb6b('0x41')],{'$or':_['map'](_0x531ffe['attributes'],function(_0x5d9c79){var _0x21ba25={};_0x21ba25[_0x5d9c79]={'$like':'%'+_0x1821f3['query']['filter']+'%'};return _0x21ba25;})});}_0x531ffe=_[_0xcb6b('0x44')]({},_0x531ffe,_0x1821f3[_0xcb6b('0x46')]);return db[_0xcb6b('0x59')][_0xcb6b('0x25')]({'where':_0x531ffe[_0xcb6b('0x41')]})[_0xcb6b('0x15')](function(_0x1a6039){_0x5399ac['count']=_0x1a6039;if(_0x1821f3['query'][_0xcb6b('0x47')]){_0x531ffe[_0xcb6b('0x4c')]=[{'all':!![]}];}return db['Disposition'][_0xcb6b('0x48')](_0x531ffe);})['then'](function(_0x1f6aa5){_0x5399ac[_0xcb6b('0x49')]=_0x1f6aa5;return _0x5399ac;});}})[_0xcb6b('0x15')](respondWithFilteredResult(_0x408dc8,_0x531ffe))[_0xcb6b('0x1e')](handleError(_0x408dc8,null));};exports[_0xcb6b('0x5d')]=function(_0x55bd84,_0x1bd80b){return db[_0xcb6b('0x33')]['find']({'where':{'id':_0x55bd84['params']['id']}})[_0xcb6b('0x15')](handleEntityNotFound(_0x1bd80b,null))['then'](function(_0x3c5ebe){if(_0x3c5ebe){return _0x3c5ebe['removeDispositions'](_0x55bd84[_0xcb6b('0x38')][_0xcb6b('0x5e')]);}})[_0xcb6b('0x15')](respondWithStatusCode(_0x1bd80b,null))[_0xcb6b('0x1e')](handleError(_0x1bd80b,null));};exports['addAnswer']=function(_0x49501d,_0x37b4ad){if(_0x49501d[_0xcb6b('0x4f')]['id']){delete _0x49501d[_0xcb6b('0x4f')]['id'];}return db[_0xcb6b('0x33')]['find']({'where':{'id':_0x49501d[_0xcb6b('0x56')]['id']}})[_0xcb6b('0x15')](handleEntityNotFound(_0x37b4ad,null))[_0xcb6b('0x15')](function(_0x266acb){if(_0x266acb){_0x49501d['body'][_0xcb6b('0x5f')]=_0x266acb['id'];return db[_0xcb6b('0x60')]['create'](_0x49501d[_0xcb6b('0x4f')]);}})[_0xcb6b('0x15')](respondWithResult(_0x37b4ad,null))[_0xcb6b('0x1e')](handleError(_0x37b4ad,null));};exports[_0xcb6b('0x61')]=function(_0x4e584c,_0x42bec8){var _0x4d741a={'raw':![],'where':{}};var _0x113097={};var _0x123473={'count':0x0,'rows':[]};return db['ChatWebsite'][_0xcb6b('0x5b')]({'where':{'id':_0x4e584c[_0xcb6b('0x56')]['id']}})[_0xcb6b('0x15')](handleEntityNotFound(_0x42bec8,null))[_0xcb6b('0x15')](function(_0x1adb9b){if(_0x1adb9b){_0x113097[_0xcb6b('0x37')]=_['keys'](db[_0xcb6b('0x60')][_0xcb6b('0x34')]);_0x113097[_0xcb6b('0x38')]=_[_0xcb6b('0x39')](_0x4e584c[_0xcb6b('0x38')]);_0x113097[_0xcb6b('0x3a')]=_[_0xcb6b('0x3b')](_0x113097[_0xcb6b('0x37')],_0x113097[_0xcb6b('0x38')]);_0x4d741a[_0xcb6b('0x3d')]=_[_0xcb6b('0x3b')](_0x113097[_0xcb6b('0x37')],qs[_0xcb6b('0x3c')](_0x4e584c[_0xcb6b('0x38')]['fields']));_0x4d741a[_0xcb6b('0x3d')]=_0x4d741a['attributes'][_0xcb6b('0x4b')]?_0x4d741a[_0xcb6b('0x3d')]:_0x113097[_0xcb6b('0x37')];if(!_0x4e584c[_0xcb6b('0x38')][_0xcb6b('0x5c')]('nolimit')){_0x4d741a[_0xcb6b('0x26')]=qs[_0xcb6b('0x26')](_0x4e584c['query']['limit']);_0x4d741a[_0xcb6b('0x23')]=qs[_0xcb6b('0x23')](_0x4e584c['query'][_0xcb6b('0x23')]);}_0x4d741a['order']=qs[_0xcb6b('0x40')](_0x4e584c[_0xcb6b('0x38')][_0xcb6b('0x40')]);_0x4d741a[_0xcb6b('0x41')]=qs[_0xcb6b('0x3a')](_[_0xcb6b('0x42')](_0x4e584c['query'],_0x113097[_0xcb6b('0x3a')]));_0x4d741a[_0xcb6b('0x41')][_0xcb6b('0x5f')]=_0x1adb9b['id'];if(_0x4e584c['query']['filter']){_0x4d741a[_0xcb6b('0x41')]=_[_0xcb6b('0x44')](_0x4d741a[_0xcb6b('0x41')],{'$or':_[_0xcb6b('0x32')](_0x4d741a[_0xcb6b('0x3d')],function(_0x5196e7){var _0x5931b4={};_0x5931b4[_0x5196e7]={'$like':'%'+_0x4e584c['query']['filter']+'%'};return _0x5931b4;})});}_0x4d741a=_['merge']({},_0x4d741a,_0x4e584c[_0xcb6b('0x46')]);return db[_0xcb6b('0x60')]['count']({'where':_0x4d741a['where']})[_0xcb6b('0x15')](function(_0x16e496){_0x123473[_0xcb6b('0x25')]=_0x16e496;if(_0x4e584c[_0xcb6b('0x38')][_0xcb6b('0x47')]){_0x4d741a[_0xcb6b('0x4c')]=[{'all':!![]}];}return db[_0xcb6b('0x60')]['findAll'](_0x4d741a);})['then'](function(_0x61ddad){_0x123473[_0xcb6b('0x49')]=_0x61ddad;return _0x123473;});}})[_0xcb6b('0x15')](respondWithFilteredResult(_0x42bec8,_0x4d741a))['catch'](handleError(_0x42bec8,null));};exports[_0xcb6b('0x62')]=function(_0x5544ea,_0x56c4f6){return db[_0xcb6b('0x33')][_0xcb6b('0x4d')]({'where':{'id':_0x5544ea[_0xcb6b('0x56')]['id']}})[_0xcb6b('0x15')](handleEntityNotFound(_0x56c4f6,null))[_0xcb6b('0x15')](function(_0x56a002){if(_0x56a002){return _0x56a002[_0xcb6b('0x62')](_0x5544ea[_0xcb6b('0x38')][_0xcb6b('0x5e')]);}})[_0xcb6b('0x15')](respondWithStatusCode(_0x56c4f6,null))[_0xcb6b('0x1e')](handleError(_0x56c4f6,null));};exports[_0xcb6b('0x63')]=function(_0x4a7615,_0x383992){_0x4a7615[_0xcb6b('0x4f')]['sitepic']=_0x4a7615['file'][_0xcb6b('0x64')];return db[_0xcb6b('0x33')][_0xcb6b('0x4d')]({'where':{'id':_0x4a7615[_0xcb6b('0x56')]['id']}})[_0xcb6b('0x15')](handleEntityNotFound(_0x383992,null))[_0xcb6b('0x15')](saveUpdates(_0x4a7615[_0xcb6b('0x4f')],null))[_0xcb6b('0x15')](respondWithResult(_0x383992,null))[_0xcb6b('0x1e')](handleError(_0x383992,null));};exports['addAvatar']=function(_0x4e9e35,_0x24ce74){_0x4e9e35[_0xcb6b('0x4f')][_0xcb6b('0x65')]=_0x4e9e35[_0xcb6b('0x66')][_0xcb6b('0x64')];return db[_0xcb6b('0x33')]['find']({'where':{'id':_0x4e9e35[_0xcb6b('0x56')]['id']}})['then'](handleEntityNotFound(_0x24ce74,null))[_0xcb6b('0x15')](saveUpdates(_0x4e9e35['body'],null))['then'](respondWithResult(_0x24ce74,null))[_0xcb6b('0x1e')](handleError(_0x24ce74,null));};exports[_0xcb6b('0x67')]=function(_0x5b2633,_0x5b4a56){_0x5b2633[_0xcb6b('0x4f')][_0xcb6b('0x68')]=_0x5b2633[_0xcb6b('0x66')][_0xcb6b('0x64')];return db[_0xcb6b('0x33')]['find']({'where':{'id':_0x5b2633[_0xcb6b('0x56')]['id']}})[_0xcb6b('0x15')](handleEntityNotFound(_0x5b4a56,null))[_0xcb6b('0x15')](saveUpdates(_0x5b2633['body'],null))[_0xcb6b('0x15')](respondWithResult(_0x5b4a56,null))[_0xcb6b('0x1e')](handleError(_0x5b4a56,null));};exports[_0xcb6b('0x69')]=function(_0x23549f,_0x414932){_0x23549f['body']['systemAvatar']=_0x23549f[_0xcb6b('0x66')]['filename'];return db['ChatWebsite']['find']({'where':{'id':_0x23549f['params']['id']}})[_0xcb6b('0x15')](handleEntityNotFound(_0x414932,null))[_0xcb6b('0x15')](saveUpdates(_0x23549f[_0xcb6b('0x4f')],null))[_0xcb6b('0x15')](respondWithResult(_0x414932,null))['catch'](handleError(_0x414932,null));};exports[_0xcb6b('0x6a')]=function(_0x5b57d2,_0x5650a6){var _0x44959d=path[_0xcb6b('0x6b')](config[_0xcb6b('0x6c')],_0xcb6b('0x6d'));var _0x12a87a={'where':{'id':_0x5b57d2['params']['id']},'attributes':['id','sitepic'],'raw':!![]};var _0x5cf140=![];return require('../../config/license/util')[_0xcb6b('0x6e')]()[_0xcb6b('0x15')](function(_0x162e0e){if(_0x162e0e){_0x5cf140=_0x162e0e['custom'];}})['then'](function(){return db[_0xcb6b('0x33')]['find'](_0x12a87a);})[_0xcb6b('0x15')](handleEntityNotFound(_0x5650a6,null))[_0xcb6b('0x15')](function(_0x5e6c66){if(_0x5e6c66){if(!_[_0xcb6b('0x6f')](_0x5e6c66[_0xcb6b('0x70')])){if(fs['existsSync'](path['join'](config[_0xcb6b('0x6c')],'server/files/images/logos/',_0x5e6c66[_0xcb6b('0x70')]))&&_0x5cf140){_0x44959d=path[_0xcb6b('0x6b')](config[_0xcb6b('0x6c')],'server/files/images/logos/',_0x5e6c66['sitepic']);}}return _0x5650a6[_0xcb6b('0x71')](_0x44959d);}})[_0xcb6b('0x1e')](handleError(_0x5650a6,null));};exports[_0xcb6b('0x72')]=function(_0x354d9b,_0x50f977){var _0x9d8b67=path[_0xcb6b('0x6b')](config[_0xcb6b('0x6c')],'server/files/images/avatars/default_avatar.png');var _0x4dbdd2={'where':{'id':_0x354d9b[_0xcb6b('0x56')]['id']},'attributes':['id',_0xcb6b('0x65')],'raw':!![]};return db[_0xcb6b('0x33')]['find'](_0x4dbdd2)[_0xcb6b('0x15')](handleEntityNotFound(_0x50f977,null))['then'](function(_0x102acb){if(_0x102acb){if(!_['isNil'](_0x102acb[_0xcb6b('0x65')])){if(fs[_0xcb6b('0x73')](path['join'](config[_0xcb6b('0x6c')],_0xcb6b('0x74'),_0x102acb['agentAvatar']))){_0x9d8b67=path[_0xcb6b('0x6b')](config[_0xcb6b('0x6c')],'server/files/images/avatars/',_0x102acb[_0xcb6b('0x65')]);}}return _0x50f977[_0xcb6b('0x71')](_0x9d8b67);}})['catch'](handleError(_0x50f977,null));};exports['getCustomerAvatar']=function(_0x23c4d4,_0x5c5418){var _0x3674ad=path[_0xcb6b('0x6b')](config[_0xcb6b('0x6c')],_0xcb6b('0x75'));var _0x418e71={'where':{'id':_0x23c4d4[_0xcb6b('0x56')]['id']},'attributes':['id',_0xcb6b('0x68'),_0xcb6b('0x76')],'raw':!![]};return db[_0xcb6b('0x33')]['find'](_0x418e71)['then'](handleEntityNotFound(_0x5c5418,null))[_0xcb6b('0x15')](function(_0x1186ce){if(_0x1186ce){if(!_[_0xcb6b('0x6f')](_0x1186ce[_0xcb6b('0x68')])){if(fs['existsSync'](path[_0xcb6b('0x6b')](config[_0xcb6b('0x6c')],'server/files/images/avatars/',_0x1186ce['customerAvatar']))&&_0x1186ce[_0xcb6b('0x76')]){_0x3674ad=path[_0xcb6b('0x6b')](config[_0xcb6b('0x6c')],_0xcb6b('0x74'),_0x1186ce[_0xcb6b('0x68')]);}}return _0x5c5418[_0xcb6b('0x71')](_0x3674ad);}})[_0xcb6b('0x1e')](handleError(_0x5c5418,null));};exports[_0xcb6b('0x77')]=function(_0x4cb1b0,_0x98e193){var _0x725003=path['join'](config[_0xcb6b('0x6c')],_0xcb6b('0x78'));var _0x3b4087={'where':{'id':_0x4cb1b0[_0xcb6b('0x56')]['id']},'attributes':['id','systemAvatar'],'raw':!![]};return db[_0xcb6b('0x33')][_0xcb6b('0x4d')](_0x3b4087)[_0xcb6b('0x15')](handleEntityNotFound(_0x98e193,null))[_0xcb6b('0x15')](function(_0x2d4bbc){if(_0x2d4bbc){if(!_['isNil'](_0x2d4bbc[_0xcb6b('0x79')])){if(fs[_0xcb6b('0x73')](path[_0xcb6b('0x6b')](config[_0xcb6b('0x6c')],_0xcb6b('0x74'),_0x2d4bbc[_0xcb6b('0x79')]))){_0x725003=path[_0xcb6b('0x6b')](config['root'],'server/files/images/avatars/',_0x2d4bbc['systemAvatar']);}}return _0x98e193['download'](_0x725003);}})['catch'](handleError(_0x98e193,null));};exports['notify']=function(_0x213f41,_0x26af19){var _0x53d0e1=require(_0xcb6b('0x7a'));var _0x6af048=new _0x53d0e1();var _0xdb70d9=_0x6af048[_0xcb6b('0x7b')](_0x213f41[_0xcb6b('0x7c')][_0xcb6b('0x7d')])['getResult']();var _0x5dcd41={'body':_0x213f41['body'],'channel':_0xcb6b('0x7e')};var _0x1db364=[];var _0x228733=[];var _0x8dad9b={};var _0x197341=![];return db[_0xcb6b('0x7f')][_0xcb6b('0x57')]()[_0xcb6b('0x15')](function(_0x1c8895){if(!_0x1c8895){throw new db[(_0xcb6b('0x80'))][(_0xcb6b('0x81'))](_0xcb6b('0x82'));}_0x1db364=_[_0xcb6b('0x83')](_[_0xcb6b('0x39')](_0x1c8895),['createdAt','updatedAt']);_0x228733=_[_0xcb6b('0x83')](_[_0xcb6b('0x39')](_0x1c8895),[_0xcb6b('0x84'),_0xcb6b('0x85'),_0xcb6b('0x86'),_0xcb6b('0x87')]);if(_0x213f41[_0xcb6b('0x4f')]['id']){delete _0x213f41[_0xcb6b('0x4f')]['id'];}if(_[_0xcb6b('0x6f')](_0x213f41['body'][_0xcb6b('0x88')])){throw new db['Sequelize']['ValidationError']('from\x20is\x20mandatory');}if(_[_0xcb6b('0x6f')](_0x213f41[_0xcb6b('0x4f')][_0xcb6b('0x4f')])||_0x213f41[_0xcb6b('0x4f')]['body']===''){throw new db[(_0xcb6b('0x80'))]['ValidationError'](_0xcb6b('0x89'));}if(_['isNil'](_0x213f41[_0xcb6b('0x4f')][_0xcb6b('0x8a')])){throw new db[(_0xcb6b('0x80'))]['ValidationError'](_0xcb6b('0x8b')+_0x228733);}if(!_[_0xcb6b('0x8c')](_0x228733,_0x213f41[_0xcb6b('0x4f')][_0xcb6b('0x8a')])){throw new db[(_0xcb6b('0x80'))]['ValidationError'](_0xcb6b('0x8d')+_0x228733);}_0x8dad9b[_0x213f41[_0xcb6b('0x4f')][_0xcb6b('0x8a')]]=_0x213f41['body']['from'];})[_0xcb6b('0x15')](function(){return db[_0xcb6b('0x33')]['find']({'where':{'id':_0x213f41[_0xcb6b('0x56')]['id']},'include':[{'model':db['CmList'],'as':_0xcb6b('0x8e'),'include':[{'model':db['CmContact'],'as':_0xcb6b('0x8f'),'where':_0x8dad9b,'limit':0x1,'order':[[_0xcb6b('0x85'),'DESC']]}]},{'model':db[_0xcb6b('0x90')],'as':_0xcb6b('0x91')}]});})[_0xcb6b('0x15')](handleEntityNotFound(_0x26af19,null))[_0xcb6b('0x15')](function(_0x368fc8){if(_0x368fc8&&_0x368fc8[_0xcb6b('0x8e')]){_0x5dcd41[_0xcb6b('0x92')]=_0x368fc8;_0x5dcd41[_0xcb6b('0x93')]=_0x368fc8[_0xcb6b('0x91')];_0x5dcd41['list']=_0x368fc8[_0xcb6b('0x8e')];_0x5dcd41[_0xcb6b('0x93')]=_[_0xcb6b('0x94')](_0x5dcd41[_0xcb6b('0x93')],[_0xcb6b('0x95')],[_0xcb6b('0x96')]);if(_0x5dcd41['account'][_0xcb6b('0x91')]){delete _0x5dcd41[_0xcb6b('0x92')]['Applications'];}if(_0x5dcd41['account'][_0xcb6b('0x8e')]&&_0x5dcd41[_0xcb6b('0x92')]['List']['Contacts'][_0xcb6b('0x4b')]){return _0x5dcd41[_0xcb6b('0x92')][_0xcb6b('0x8e')][_0xcb6b('0x8f')][0x0];}var _0xcbd5af=_[_0xcb6b('0xd')](_0x213f41[_0xcb6b('0x4f')],{'firstName':_0x213f41['body'][_0xcb6b('0x88')],'ListId':_0x368fc8[_0xcb6b('0x87')]});_0xcbd5af[_0x213f41['body'][_0xcb6b('0x8a')]]=_0x213f41[_0xcb6b('0x4f')][_0xcb6b('0x88')];return db[_0xcb6b('0x7f')][_0xcb6b('0x4e')](_0xcbd5af,{'fields':_0x1db364,'raw':!![]});}})[_0xcb6b('0x15')](handleEntityNotFound(_0x26af19,null))[_0xcb6b('0x15')](function(_0x51aff8){_0x5dcd41[_0xcb6b('0x97')]=_0x51aff8;var _0x17e057=_0x213f41[_0xcb6b('0x4f')][_0xcb6b('0x98')];if(_0x213f41[_0xcb6b('0x7c')][_0xcb6b('0x99')]){_0x17e057=_0x213f41[_0xcb6b('0x7c')][_0xcb6b('0x99')];}else if(_0x213f41[_0xcb6b('0x7c')][_0xcb6b('0x9a')]){_0x17e057=_[_0xcb6b('0x9b')](_0x213f41['headers'][_0xcb6b('0x9a')][_0xcb6b('0x9c')](','));}if(_0x51aff8){var _0x52fffb={'ContactId':_0x51aff8['id'],'ChatWebsiteId':_0x213f41['params']['id'],'from':(_0x51aff8[_0xcb6b('0x9d')]||'')+'\x20'+(_0x51aff8[_0xcb6b('0x9e')]||''),'customerIp':_0x17e057,'customerPort':_0x213f41[_0xcb6b('0x7c')][_0xcb6b('0x9f')]?_0x213f41[_0xcb6b('0x7c')]['x-real-port']:null,'referer':_0x213f41[_0xcb6b('0x4f')]['referer'],'browserName':_0xdb70d9[_0xcb6b('0xa0')][_0xcb6b('0x2d')]&&_0xdb70d9[_0xcb6b('0xa0')][_0xcb6b('0xa1')]?util['format']('%s\x20%s',_0xdb70d9[_0xcb6b('0xa0')][_0xcb6b('0x2d')],_0xdb70d9[_0xcb6b('0xa0')][_0xcb6b('0xa1')]):_0xcb6b('0xa2'),'browserVersion':_0xdb70d9['browser']['version']||_0xcb6b('0xa2'),'osName':util[_0xcb6b('0xa3')](_0xcb6b('0xa4'),_0xdb70d9['os'][_0xcb6b('0x2d')],_0xdb70d9['os']['version']),'osVersion':_0xdb70d9['os'][_0xcb6b('0xa1')],'deviceModel':_0xdb70d9[_0xcb6b('0xa5')][_0xcb6b('0x37')]&&_0xdb70d9[_0xcb6b('0xa5')][_0xcb6b('0xa6')]?util[_0xcb6b('0xa3')](_0xcb6b('0xa7'),_0xdb70d9['device'][_0xcb6b('0x37')],_0xdb70d9[_0xcb6b('0xa5')]['vendor'],_0xdb70d9[_0xcb6b('0xa5')][_0xcb6b('0x35')]):null,'deviceVendor':_0xdb70d9['device'][_0xcb6b('0xa6')],'deviceType':_0xdb70d9[_0xcb6b('0xa5')][_0xcb6b('0x35')],'formData':JSON[_0xcb6b('0x1a')](_0x213f41[_0xcb6b('0x4f')])};var _0x5830ba={'ChatWebsiteId':_0x213f41['params']['id'],'closed':![]};if(_0x213f41[_0xcb6b('0x4f')]['threadId']){_0x5830ba[_0xcb6b('0xa8')]=_0x213f41[_0xcb6b('0x4f')]['threadId'];return db[_0xcb6b('0xa9')][_0xcb6b('0x4d')]({'where':_0x5830ba})[_0xcb6b('0x15')](function(_0x22d1d7){if(_0x22d1d7){return[_0x22d1d7,![]];}_0x52fffb[_0xcb6b('0xa8')]=_0x213f41[_0xcb6b('0x4f')]['threadId'];_0x52fffb[_0xcb6b('0xaa')]=_0x213f41['body'][_0xcb6b('0xaa')];return db[_0xcb6b('0xa9')][_0xcb6b('0x4e')](_0x52fffb)[_0xcb6b('0x15')](function(_0x12b7b1){return[_0x12b7b1,!![]];});});}_0x5830ba[_0xcb6b('0xab')]=_0x51aff8['id'];if(_0x213f41[_0xcb6b('0x4f')][_0xcb6b('0xac')]&&_0x213f41['body'][_0xcb6b('0xac')]['id']){_0x5830ba['id']=_0x213f41[_0xcb6b('0x4f')][_0xcb6b('0xac')]['id'];return db[_0xcb6b('0xa9')][_0xcb6b('0x4d')]({'where':_0x5830ba})[_0xcb6b('0x15')](function(_0x3ef06a){if(_0x3ef06a){return[_0x3ef06a,![]];}return db['ChatInteraction'][_0xcb6b('0x4e')](_0x52fffb)[_0xcb6b('0x15')](function(_0x4a5a20){return[_0x4a5a20,!![]];});});}return db['ChatInteraction'][_0xcb6b('0x4e')](_0x52fffb)[_0xcb6b('0x15')](function(_0x316e4b){return[_0x316e4b,!![]];});}})[_0xcb6b('0xad')](function(_0x1143fb,_0xc23e2f){if(_0x1143fb){_0x197341=_0xc23e2f;if(!_0xc23e2f){var _0x1753a8={'from':(_0x5dcd41[_0xcb6b('0x97')][_0xcb6b('0x9d')]||'')+'\x20'+(_0x5dcd41[_0xcb6b('0x97')]['lastName']||'')};if(_0x213f41['body'][_0xcb6b('0xa8')]&&_0x213f41[_0xcb6b('0x4f')][_0xcb6b('0xae')]&&_0x213f41[_0xcb6b('0x4f')][_0xcb6b('0xa8')]!=_0x213f41[_0xcb6b('0x4f')][_0xcb6b('0xae')]){_0x1753a8['threadId']=_0x213f41['body'][_0xcb6b('0xae')];}return _0x1143fb[_0xcb6b('0x55')](_0x1753a8);}else{return _0x1143fb;}}})['then'](function(_0x24a5f3){_0x5dcd41[_0xcb6b('0xac')]=_0x24a5f3['get']({'plain':!![]});_0x5dcd41[_0xcb6b('0xac')]['created']=_0x197341;if(_0x5dcd41[_0xcb6b('0xac')]['created']){if(_0x5dcd41[_0xcb6b('0x92')][_0xcb6b('0xaf')]){_0x5dcd41['applications'][_0xcb6b('0xb0')]({'id':0x0,'priority':_0x5dcd41['applications'][_0xcb6b('0x4b')]+0x1,'app':_0xcb6b('0xb1'),'appdata':'unmanaged','interval':_0xcb6b('0xb2')});}}return db['ChatMessage']['create']({'body':_0x213f41[_0xcb6b('0x4f')][_0xcb6b('0x4f')],'ChatWebsiteId':_0x213f41[_0xcb6b('0x56')]['id'],'ChatInteractionId':_0x24a5f3['id'],'direction':'in','ContactId':_0x5dcd41[_0xcb6b('0x97')]['id'],'AttachmentId':_0x213f41[_0xcb6b('0x4f')][_0xcb6b('0xb3')]});})['then'](function(_0x59bbd7){_0x5dcd41[_0xcb6b('0x1d')]=_0x59bbd7;if(_0x5dcd41[_0xcb6b('0xac')][_0xcb6b('0xb4')]){return db[_0xcb6b('0xb5')]['find']({'attributes':['id','name'],'where':{'id':_0x5dcd41[_0xcb6b('0xac')][_0xcb6b('0xb4')]}})[_0xcb6b('0x15')](function(_0x18380e){if(_0x18380e){_0x5dcd41['applications'][_0xcb6b('0xb6')]({'id':0x0,'priority':0x0,'app':'agent','appdata':_0x18380e[_0xcb6b('0x2d')]+','+(_0x5dcd41['account'][_0xcb6b('0xb7')]||0xa),'interval':'*,*,*,*'});_0x5dcd41[_0xcb6b('0xb8')]=!![];}return respondWithRpcPromise(_0xcb6b('0xb9'),_0xcb6b('0xba'),_0x5dcd41);});}return respondWithRpcPromise(_0xcb6b('0xb9'),'startRouting',_0x5dcd41);})[_0xcb6b('0x15')](function(_0xe64709){respondWithRpcPromise('EventManager',_0xcb6b('0xbb'),{'event':_0xcb6b('0xbc'),'message':_0xe64709},client9002);return _0xe64709;})[_0xcb6b('0x15')](respondWithResult(_0x26af19,null))[_0xcb6b('0x1e')](handleError(_0x26af19,null));};exports[_0xcb6b('0xbd')]=function(_0x3475c8,_0x37f5a3){var _0x2a9a26,_0x4945c2,_0x4e4324;var _0xea7466=[];var _0x1c923d={};var _0x219d06=_0x3475c8[_0xcb6b('0xbe')]||[];var _0x19f79b=[];var _0x2e6b98;return db[_0xcb6b('0x7f')][_0xcb6b('0x57')]()[_0xcb6b('0x15')](function(_0x7a05a6){if(!_0x7a05a6){throw new db[(_0xcb6b('0x80'))][(_0xcb6b('0x81'))](_0xcb6b('0x82'));}_0xea7466=_['difference'](_[_0xcb6b('0x39')](_0x7a05a6),['createdAt',_0xcb6b('0x85'),_0xcb6b('0x86'),_0xcb6b('0x87')]);if(_0x3475c8[_0xcb6b('0x4f')]['id']){delete _0x3475c8[_0xcb6b('0x4f')]['id'];}if(_['isNil'](_0x3475c8[_0xcb6b('0x4f')][_0xcb6b('0x88')])){throw _0x37f5a3[_0xcb6b('0x20')](0x1f4)[_0xcb6b('0x2e')](new db[(_0xcb6b('0x80'))]['ValidationError']('from\x20is\x20mandatory'));}if(_[_0xcb6b('0x6f')](_0x3475c8[_0xcb6b('0x4f')][_0xcb6b('0x4f')])||_0x3475c8[_0xcb6b('0x4f')][_0xcb6b('0x4f')]===''){throw _0x37f5a3[_0xcb6b('0x20')](0x1f4)['send'](new db[(_0xcb6b('0x80'))][(_0xcb6b('0x81'))](_0xcb6b('0x89')));}if(_['isNil'](_0x3475c8['body']['mapKeyOffline'])){throw _0x37f5a3[_0xcb6b('0x20')](0x1f4)[_0xcb6b('0x2e')](new db[(_0xcb6b('0x80'))]['ValidationError'](_0xcb6b('0xbf')+_0xea7466));}if(!_[_0xcb6b('0x8c')](_0xea7466,_0x3475c8[_0xcb6b('0x4f')][_0xcb6b('0xc0')])){throw _0x37f5a3[_0xcb6b('0x20')](0x1f4)[_0xcb6b('0x2e')](new db[(_0xcb6b('0x80'))][(_0xcb6b('0x81'))](_0xcb6b('0xc1')+_0xea7466));}_0x1c923d[_0x3475c8[_0xcb6b('0x4f')][_0xcb6b('0xc0')]]=_0x3475c8[_0xcb6b('0x4f')][_0xcb6b('0x88')];})[_0xcb6b('0x15')](function(){return db[_0xcb6b('0x33')][_0xcb6b('0x4d')]({'where':{'id':_0x3475c8[_0xcb6b('0x56')]['id']},'include':[{'model':db['CmList'],'as':_0xcb6b('0x8e')},{'model':db[_0xcb6b('0xc2')],'as':'MailAccount'}]});})[_0xcb6b('0x15')](handleEntityNotFound(_0x37f5a3,null))[_0xcb6b('0x15')](function(_0x511521){if(_0x511521&&_0x511521[_0xcb6b('0x8e')]){_0x4945c2=_0x511521;var _0x136fbc=_['defaults'](_0x3475c8[_0xcb6b('0x4f')],{'firstName':_0x3475c8[_0xcb6b('0x4f')][_0xcb6b('0x88')],'phone':_0x3475c8[_0xcb6b('0x4f')][_0xcb6b('0x88')],'ListId':_0x511521['ListId']});_0x136fbc[_0x3475c8[_0xcb6b('0x4f')][_0xcb6b('0xc0')]]=_0x3475c8['body'][_0xcb6b('0x88')];return db[_0xcb6b('0x7f')][_0xcb6b('0xc3')]({'where':_0x1c923d,'defaults':_0x136fbc});}})['spread'](function(_0x20ac01){if(_0x20ac01){_0x4e4324=_0x20ac01;var _0x3bc481=fs[_0xcb6b('0xc4')](path[_0xcb6b('0x6b')](config[_0xcb6b('0x6c')],'server/files/templates/chatOfflineMessage.ejs'),_0xcb6b('0xc5'));var _0x10912e=ejs[_0xcb6b('0xc6')](_0x3bc481,{'body':_[_0xcb6b('0xc7')](_0x3475c8[_0xcb6b('0x4f')][_0xcb6b('0x4f')]),'bodyTitle':_0x4945c2['offlineMessageBody']});return db[_0xcb6b('0xc8')][_0xcb6b('0x4e')]({'body':_0x10912e,'plainBody':htmlToText[_0xcb6b('0xc9')](_0x10912e),'ContactId':_0x20ac01['id'],'ChatWebsiteId':_0x4945c2['id']});}})[_0xcb6b('0x15')](function(_0x54af07){_0x2e6b98=_0x54af07;if(_0x219d06[_0xcb6b('0x4b')]){var _0x562ca5=_0x219d06[_0xcb6b('0x32')](function(_0x35bb9d){return{'name':_0x35bb9d[_0xcb6b('0xca')],'basename':_0x35bb9d[_0xcb6b('0x64')],'type':_0x35bb9d[_0xcb6b('0xcb')],'ChatOfflineMessageId':_0x54af07['id']};});_0x19f79b=_0x562ca5[_0xcb6b('0x32')](_0x15fa4a=>{var _0x5c85f2={'filename':_0x15fa4a[_0xcb6b('0x2d')],'path':path[_0xcb6b('0x6b')](config['root'],_0xcb6b('0xcc'),'files',_0xcb6b('0xcd'),_0xcb6b('0xce'),_0x15fa4a[_0xcb6b('0xcf')])};return _0x5c85f2;});if(!_0x4945c2[_0xcb6b('0xd0')]){return db[_0xcb6b('0xd1')]['transaction'](function(_0x5c29ee){return db['Attachment'][_0xcb6b('0xd2')](_0x562ca5,{'transaction':_0x5c29ee});});}}})[_0xcb6b('0x15')](function(){if(_0x2e6b98){_0x2a9a26=_0x2e6b98;return db[_0xcb6b('0xc2')][_0xcb6b('0x5b')]({'where':{'service':!![]},'include':[{'model':db['MailServerOut'],'as':_0xcb6b('0xd3'),'raw':!![],'include':[{'model':db[_0xcb6b('0xd4')],'as':_0xcb6b('0xd4'),'raw':!![]}]}]});}})[_0xcb6b('0x15')](function(_0x436b0f){if(_0x436b0f&&_0x436b0f[_0xcb6b('0xd3')]&&_0x4945c2[_0xcb6b('0xd5')]&&_0x4945c2['forwardOfflineAddress']){var _0x3b0d70=_0x436b0f[_0xcb6b('0xd6')]();return respondWithRpcPromise(_0xcb6b('0xd7'),_0xcb6b('0xd8'),{'account':_0x3b0d70,'message':{'from':util[_0xcb6b('0xa3')]('\x22%s\x22\x20<%s>',_0x436b0f[_0xcb6b('0x2d')],_0x436b0f[_0xcb6b('0xd9')]||_0x436b0f[_0xcb6b('0xd3')]['user']),'to':_0x4945c2[_0xcb6b('0xda')],'subject':_0x4945c2['offlineMessageSubject'],'html':_0x2a9a26['body'],'attachments':_0x19f79b}},client9003)[_0xcb6b('0x15')](function(){return _0x2a9a26;})['catch'](function(_0x3da4e9){logger['error'](_0x3da4e9);});}})[_0xcb6b('0x15')](function(){if(_0x4945c2&&_0x4945c2[_0xcb6b('0xd0')]&&_0x4945c2[_0xcb6b('0xdb')]){var _0xb16c65=[];if(_0x219d06[_0xcb6b('0x4b')]){_0xb16c65=_0x219d06['map'](function(_0x101d65){return{'name':_0x101d65[_0xcb6b('0xca')],'basename':_0x101d65['filename'],'type':_0x101d65[_0xcb6b('0xcb')],'ChatOfflineMessageId':_0x2e6b98['id']};});}var _0x1b3e27;if(!_[_0xcb6b('0x6f')](_0x4945c2['subjectOffline'])){var _0x3ae418=_[_0xcb6b('0x32')](_0x3475c8[_0xcb6b('0x4f')],function(_0x15f252){return _0x15f252;});var _0x178fb8=_['toPairsIn'](_0x3ae418)[0x0];var _0x476a9c=_['mapValues'](_0x178fb8,function(_0x560650){return _0x560650;});_0x1b3e27=_0x476a9c[0x1][_0x4945c2[_0xcb6b('0xdc')]];}var _0x22c977={'from':_0x4e4324['email'],'firstName':_0x4e4324[_0xcb6b('0x9d')],'lastName':_0x4e4324[_0xcb6b('0x9e')],'mapKey':'email','message':{'from':_0x4e4324[_0xcb6b('0xd9')],'to':_0x4945c2[_0xcb6b('0xc2')][_0xcb6b('0xd9')],'cc':'','subject':_[_0xcb6b('0x6f')](_0x1b3e27)?_0x4945c2[_0xcb6b('0xdd')]:_0x1b3e27,'messageId':'','sentAt':new Date(),'attach':_0xb16c65[_0xcb6b('0x4b')],'attachments':_0xb16c65,'originChannel':'Chat','ChatWebsiteId':_0x4945c2['id'],'ChatOfflineMessageId':_0x2a9a26['id'],'originTo':_0x4945c2[_0xcb6b('0xc2')]['email']},'body':_0x2a9a26[_0xcb6b('0x4f')]};var _0xf3fa27={'account':{'id':_0x4945c2[_0xcb6b('0xdb')]},'body':_0x22c977,'log':_0xcb6b('0xde')};return respondWithRpcPromise(_0xcb6b('0xde'),'notifyMail',_0xf3fa27,client9001)[_0xcb6b('0x15')](function(){return _0x2a9a26;})[_0xcb6b('0x1e')](function(_0x2e4c0b){logger[_0xcb6b('0x1b')](_0x2e4c0b);});}return;})[_0xcb6b('0x15')](function(){if(_0x2a9a26){return _0x2a9a26;}})[_0xcb6b('0x15')](respondWithResult(_0x37f5a3,null))[_0xcb6b('0x1e')](function(_0x16be04){logger[_0xcb6b('0x1b')](_0xcb6b('0x1e'),_0x16be04);for(var _0x134b46 of _0x219d06){var _0x38aa77=path[_0xcb6b('0x6b')](config[_0xcb6b('0x6c')],_0xcb6b('0xcc'),'files',_0xcb6b('0xcd'),_0xcb6b('0xce'),_0x134b46[_0xcb6b('0x64')]);fs_extra[_0xcb6b('0xdf')](_0x38aa77)[_0xcb6b('0x1e')](function(_0x35f529){logger['error']('Could\x20not\x20remove\x20attachment\x20file',_0x38aa77,_0x35f529);});}});};exports[_0xcb6b('0xe0')]=function(_0x4c6339,_0x2e7151){return db[_0xcb6b('0xa9')]['find']({'where':{'id':_0x4c6339[_0xcb6b('0x56')]['id']}})[_0xcb6b('0x15')](handleEntityNotFound(_0x2e7151,null))[_0xcb6b('0x15')](function(_0x121fd0){if(_0x121fd0){return _0x121fd0[_0xcb6b('0xe0')](_0x4c6339[_0xcb6b('0x4f')][_0xcb6b('0x5e')],_[_0xcb6b('0xe1')](_0x4c6339[_0xcb6b('0x4f')],[_0xcb6b('0x5e'),'id'])||{});}})[_0xcb6b('0x15')](respondWithResult(_0x2e7151,null))[_0xcb6b('0x1e')](handleError(_0x2e7151,null));};exports['getInteractions']=function(_0x4380e6,_0x1205de){var _0x129df8={'raw':![],'where':{}};var _0x5093d6={};var _0x2f63d0={'count':0x0,'rows':[]};return db['ChatWebsite'][_0xcb6b('0x5b')]({'where':{'id':_0x4380e6['params']['id']}})[_0xcb6b('0x15')](handleEntityNotFound(_0x1205de,null))[_0xcb6b('0x15')](function(_0x26a54e){if(_0x26a54e){_0x5093d6['model']=_[_0xcb6b('0x39')](db[_0xcb6b('0xa9')][_0xcb6b('0x34')]);_0x5093d6[_0xcb6b('0x38')]=_[_0xcb6b('0x39')](_0x4380e6['query']);_0x5093d6['filters']=_[_0xcb6b('0x3b')](_0x5093d6[_0xcb6b('0x37')],_0x5093d6[_0xcb6b('0x38')]);_0x129df8[_0xcb6b('0x3d')]=_['intersection'](_0x5093d6[_0xcb6b('0x37')],qs['fields'](_0x4380e6[_0xcb6b('0x38')][_0xcb6b('0x3c')]));_0x129df8['attributes']=_0x129df8['attributes'][_0xcb6b('0x4b')]?_0x129df8[_0xcb6b('0x3d')]:_0x5093d6[_0xcb6b('0x37')];if(!_0x4380e6['query'][_0xcb6b('0x5c')]('nolimit')){_0x129df8[_0xcb6b('0x26')]=qs[_0xcb6b('0x26')](_0x4380e6['query'][_0xcb6b('0x26')]);_0x129df8[_0xcb6b('0x23')]=qs[_0xcb6b('0x23')](_0x4380e6[_0xcb6b('0x38')][_0xcb6b('0x23')]);}_0x129df8[_0xcb6b('0x3f')]=qs[_0xcb6b('0x40')](_0x4380e6[_0xcb6b('0x38')][_0xcb6b('0x40')]);_0x129df8[_0xcb6b('0x41')]=qs[_0xcb6b('0x3a')](_[_0xcb6b('0x42')](_0x4380e6[_0xcb6b('0x38')],_0x5093d6['filters']));_0x129df8[_0xcb6b('0x41')][_0xcb6b('0x5f')]=_0x26a54e['id'];if(_0x4380e6[_0xcb6b('0x38')][_0xcb6b('0x43')]){_0x129df8[_0xcb6b('0x41')]=_['merge'](_0x129df8['where'],{'$or':_[_0xcb6b('0x32')](_0x129df8[_0xcb6b('0x3d')],function(_0x1b2223){var _0x3112dc={};_0x3112dc[_0x1b2223]={'$like':'%'+_0x4380e6[_0xcb6b('0x38')][_0xcb6b('0x43')]+'%'};return _0x3112dc;})});}_0x129df8=_[_0xcb6b('0x44')]({},_0x129df8,_0x4380e6['options']);return db[_0xcb6b('0xa9')]['count']({'where':_0x129df8[_0xcb6b('0x41')]})['then'](function(_0x50b9c2){_0x2f63d0[_0xcb6b('0x25')]=_0x50b9c2;if(_0x4380e6[_0xcb6b('0x38')][_0xcb6b('0x47')]){_0x129df8[_0xcb6b('0x4c')]=[{'model':db[_0xcb6b('0x7f')],'as':_0xcb6b('0xe2'),'required':![]},{'model':db[_0xcb6b('0xb5')],'as':_0xcb6b('0xe3'),'attributes':[_0xcb6b('0x2d'),_0xcb6b('0xe4'),_0xcb6b('0xe5')],'required':![]},{'model':db[_0xcb6b('0xe6')],'as':'Tags','attributes':['id',_0xcb6b('0x2d'),_0xcb6b('0xe7')],'where':_0x4380e6[_0xcb6b('0x38')]['tag']?{'id':_0x4380e6[_0xcb6b('0x38')][_0xcb6b('0xe8')]}:undefined,'required':_0x4380e6[_0xcb6b('0x38')]['tag']?!![]:![]}];}return db[_0xcb6b('0xa9')][_0xcb6b('0x48')](_0x129df8);})[_0xcb6b('0x15')](function(_0x2b064b){_0x2f63d0[_0xcb6b('0x49')]=_0x2b064b;return _0x2f63d0;});}})['then'](respondWithFilteredResult(_0x1205de,_0x129df8))['catch'](handleError(_0x1205de,null));};function iftimePromise(_0xe1f1de,_0x529295){return respondWithRpcPromise(_0xcb6b('0xe9'),_0xcb6b('0xea'),{'command':_0x529295[_0xcb6b('0xeb')]?util[_0xcb6b('0xa3')]('iftime\x20%s,%s',_0xe1f1de['interval'],_0x529295[_0xcb6b('0xeb')]):util['format'](_0xcb6b('0xec'),_0xe1f1de[_0xcb6b('0xed')])},client9002)['then'](function(_0x24ca97){var _0x38efc9=_0x24ca97&&_0x24ca97[_0xcb6b('0xee')]('true')>=0x0?!![]:![];logger[_0xcb6b('0x16')]('[%s][INTERVAL][%s]\x20%s\x20%s\x20(%s)',_0x529295['id'],_0xe1f1de['id'],_0xe1f1de['interval'],_0x38efc9?_0xcb6b('0xef'):_0xcb6b('0xf0'),_0x529295[_0xcb6b('0xeb')]?_0x529295[_0xcb6b('0xeb')]:_0xcb6b('0xf1'));return _0x38efc9;})['catch'](function(_0x57c0b9){logger[_0xcb6b('0x1b')](_0xcb6b('0xf2'),_0x529295['id'],_0xe1f1de['id'],_0xe1f1de[_0xcb6b('0xed')],util[_0xcb6b('0xf3')](_0x57c0b9,{'showHidden':![],'depth':null}),_0x529295[_0xcb6b('0xeb')]?_0x529295[_0xcb6b('0xeb')]:_0xcb6b('0xf1'));return![];});}exports['getSnippet']=function(_0x30f305,_0x44431e){var _0x25afd6=0x0;var _0x1fe8f0=0x0;var _0x116cda=![];var _0x363052;var _0x25310f;return db[_0xcb6b('0x33')][_0xcb6b('0x4d')]({'where':{'id':_0x30f305[_0xcb6b('0x56')]['id']},'include':[{'model':db[_0xcb6b('0xf4')],'as':'Interval','include':[{'model':db[_0xcb6b('0xf4')],'as':_0xcb6b('0xf5'),'attributes':['id','interval'],'raw':!![]}]}]})[_0xcb6b('0x15')](handleEntityNotFound(_0x44431e,null))[_0xcb6b('0x15')](function(_0x23fe0a){if(_0x23fe0a){_0x363052=_0x23fe0a;return _0x23fe0a['getProactiveActions']({'raw':!![]});}})[_0xcb6b('0x15')](function(_0x13874e){if(_0x363052){if(_0x13874e){_0x25310f=_0x13874e;}}return require(_0xcb6b('0xf6'))[_0xcb6b('0x6e')]();})[_0xcb6b('0x15')](function(_0x5c7273){if(_0x5c7273){_0x1fe8f0=_0x5c7273[_0xcb6b('0xf7')];_0x116cda=_0x5c7273[_0xcb6b('0xf8')];}})['then'](function(){return db[_0xcb6b('0xa9')][_0xcb6b('0x25')]({'where':{'closed':![]}});})['then'](function(_0x3b85f8){_0x25afd6=_0x3b85f8;if(_0x1fe8f0&&_0x3b85f8>_0x1fe8f0){return db[_0xcb6b('0xf9')][_0xcb6b('0x5b')]({'where':{'id':0x1}})[_0xcb6b('0x15')](function(_0x1191d2){if(_0x1191d2){_0x1191d2[_0xcb6b('0xfa')]('chatLicenseExceeded');}});}})[_0xcb6b('0x15')](function(){if(_0x363052[_0xcb6b('0xf4')]&&_0x363052[_0xcb6b('0xf4')]['Intervals']){var _0x302697=[];for(var _0x528369=0x0;_0x528369<_0x363052[_0xcb6b('0xf4')][_0xcb6b('0xf5')]['length'];_0x528369++){var _0x4186ec=_0x363052[_0xcb6b('0xf4')]['Intervals'][_0x528369][_0xcb6b('0x2a')]({'plain':!![]});_0x302697['push'](iftimePromise(_0x4186ec,_0x363052));}return BPromise['all'](_0x302697)[_0xcb6b('0x15')](function(_0x305f61){return _[_0xcb6b('0xfb')](_0x305f61);});}else{return!![];}})[_0xcb6b('0x15')](function(_0x4727a3){var _0x5082e4=fs['readFileSync'](path[_0xcb6b('0x6b')](config[_0xcb6b('0x6c')],_0xcb6b('0xfc')),_0xcb6b('0xc5'));var _0x39b3e1=new url[(_0xcb6b('0xfd'))](_0x363052[_0xcb6b('0xfe')])[_0xcb6b('0xff')];var _0x25d05d=_0xcb6b('0x100');var _0x52762a=![];var _0xd0e91b={'chatVersion':_0x25d05d,'chatWebsiteAddressOrigin':_0x39b3e1,'remote':_0x363052[_0xcb6b('0x101')],'query':querystring['stringify'](_['merge'](_0x363052[_0xcb6b('0x2a')]({'plain':!![]}),{'customerIp':_0x30f305['headers'][_0xcb6b('0x9a')]||_0x30f305[_0xcb6b('0x7c')][_0xcb6b('0x102')]||_0x30f305[_0xcb6b('0x103')][_0xcb6b('0x104')]||_0x30f305['ip'],'referer':_0x30f305[_0xcb6b('0x7c')]['referer'],'openedInteractions':_0x25afd6,'maxInteractions':_0x1fe8f0,'virtual':_0x116cda['virtual'],'online':_0x4727a3,'custom':_0x116cda}))[_0xcb6b('0x105')](/'/g,'\x5c\x27')};_0x44431e[_0xcb6b('0x2e')](ejs[_0xcb6b('0xc6')](Mustache[_0xcb6b('0xc6')](_0x5082e4,_0xd0e91b),{'proactiveActions':_0x25310f,'alignment':_0x363052['alignment'],'verticalAlignment':_0x363052['verticalAlignment'],'div_color':_0x363052[_0xcb6b('0xe7')],'labelText':_0x363052['labelText'],'text_color':_0x363052[_0xcb6b('0x106')],'text_button_color':_0x363052[_0xcb6b('0x107')],'button_color':_0x363052[_0xcb6b('0x108')],'background_color':_0x363052['backgroundColor'],'hideWhenOffline':_0x363052[_0xcb6b('0x109')],'intervalId':_0x363052[_0xcb6b('0x10a')],'isDevelopment':_0x52762a,'chatVersion':_0x25d05d}));})[_0xcb6b('0x1e')](handleError(_0x44431e,null));};exports[_0xcb6b('0x10b')]=function(_0xa22435,_0x4fe803){var _0x536ea1=_0xa22435[_0xcb6b('0x56')]['id'];var _0x139a40=_0xa22435[_0xcb6b('0x4f')];var _0x9a923a=0xc8;var _0x2c14fe=null;return db[_0xcb6b('0xd1')][_0xcb6b('0x10c')]({'isolationLevel':db['sequelize']['Transaction'][_0xcb6b('0x10d')]['READ_COMMITTED']},function(_0x1c5415){return db[_0xcb6b('0x33')]['findOne']({'where':{'id':_0x536ea1},'transaction':_0x1c5415})[_0xcb6b('0x15')](function(_0x4d6fd7){if(_0x4d6fd7){return db[_0xcb6b('0x90')][_0xcb6b('0x29')]({'where':{'ChatWebsiteId':_0x536ea1},'transaction':_0x1c5415})[_0xcb6b('0x15')](function(){var _0x3842c2=_[_0xcb6b('0x32')](_0x139a40,function(_0x57ebeb){_0x57ebeb[_0xcb6b('0x5f')]=_0x536ea1;return _0x57ebeb;});return db[_0xcb6b('0x90')][_0xcb6b('0xd2')](_0x3842c2,{'transaction':_0x1c5415});});}else{_0x9a923a=0x194;_0x2c14fe=[];}});})['then'](function(){if(_0x9a923a!==0x194){return db[_0xcb6b('0x90')]['findAndCountAll']({'where':{'ChatWebsiteId':_0x536ea1},'order':_0xcb6b('0x95')})[_0xcb6b('0x15')](function(_0x2421bd){_0x2c14fe=_0x2421bd;});}})[_0xcb6b('0x1e')](function(_0x32aabe){_0x9a923a=0x1f4;logger[_0xcb6b('0x1b')](_0x32aabe[_0xcb6b('0x2c')]);if(_0x32aabe['name']){delete _0x32aabe[_0xcb6b('0x2d')];}_0x2c14fe=_0x32aabe;})[_0xcb6b('0x10e')](function(){if(_0x2c14fe===null){_0x4fe803[_0xcb6b('0x1f')](_0x9a923a);}else{if(_0x9a923a===0x1f4){_0x4fe803['status'](_0x9a923a)['send'](_0x2c14fe);}else{_0x4fe803['status'](_0x9a923a)[_0xcb6b('0x22')](_0x2c14fe);}}});};exports[_0xcb6b('0x10f')]=function(_0x470997,_0x5d88ed){var _0x18f6cf={};var _0x3e56ea={};var _0x4374d6;var _0x1b800a;return db['ChatWebsite'][_0xcb6b('0x5b')]({'where':{'id':_0x470997['params']['id']}})[_0xcb6b('0x15')](handleEntityNotFound(_0x5d88ed,null))[_0xcb6b('0x15')](function(_0xe760cc){if(_0xe760cc){_0x4374d6=_0xe760cc;_0x3e56ea[_0xcb6b('0x37')]=_[_0xcb6b('0x39')](db['ChatApplication'][_0xcb6b('0x34')]);_0x3e56ea[_0xcb6b('0x38')]=_['keys'](_0x470997[_0xcb6b('0x38')]);_0x3e56ea[_0xcb6b('0x3a')]=_[_0xcb6b('0x3b')](_0x3e56ea['model'],_0x3e56ea[_0xcb6b('0x38')]);_0x18f6cf['attributes']=_[_0xcb6b('0x3b')](_0x3e56ea[_0xcb6b('0x37')],qs[_0xcb6b('0x3c')](_0x470997[_0xcb6b('0x38')]['fields']));_0x18f6cf[_0xcb6b('0x3d')]=_0x18f6cf[_0xcb6b('0x3d')]['length']?_0x18f6cf[_0xcb6b('0x3d')]:_0x3e56ea['model'];_0x18f6cf['order']=qs[_0xcb6b('0x40')](_0x470997[_0xcb6b('0x38')][_0xcb6b('0x40')]);_0x18f6cf[_0xcb6b('0x41')]=qs[_0xcb6b('0x3a')](_['pick'](_0x470997[_0xcb6b('0x38')],_0x3e56ea[_0xcb6b('0x3a')]));if(_0x470997['query'][_0xcb6b('0x43')]){_0x18f6cf[_0xcb6b('0x41')]=_['merge'](_0x18f6cf[_0xcb6b('0x41')],{'$or':_[_0xcb6b('0x32')](_0x18f6cf[_0xcb6b('0x3d')],function(_0x5180f6){var _0x1cfae5={};_0x1cfae5[_0x5180f6]={'$like':'%'+_0x470997['query'][_0xcb6b('0x43')]+'%'};return _0x1cfae5;})});}_0x18f6cf=_[_0xcb6b('0x44')]({},_0x18f6cf,_0x470997[_0xcb6b('0x46')]);return _0x4374d6['getApplications'](_0x18f6cf);}})[_0xcb6b('0x15')](function(_0x5c06fe){if(_0x5c06fe){_0x1b800a=_0x5c06fe[_0xcb6b('0x4b')];if(!_0x470997[_0xcb6b('0x38')][_0xcb6b('0x5c')](_0xcb6b('0x3e'))){_0x18f6cf[_0xcb6b('0x26')]=qs[_0xcb6b('0x26')](_0x470997['query']['limit']);_0x18f6cf['offset']=qs['offset'](_0x470997[_0xcb6b('0x38')]['offset']);}return _0x4374d6['getApplications'](_0x18f6cf);}})[_0xcb6b('0x15')](function(_0x429158){if(_0x429158){return _0x429158?{'count':_0x1b800a,'rows':_0x429158}:null;}})[_0xcb6b('0x15')](respondWithResult(_0x5d88ed,null))[_0xcb6b('0x1e')](handleError(_0x5d88ed,null));};exports['addProactiveActions']=function(_0x2cbe1e,_0x3a1654){return db[_0xcb6b('0x110')][_0xcb6b('0x4d')]({'where':{'id':_0x2cbe1e['params']['id']}})[_0xcb6b('0x15')](handleEntityNotFound(_0x3a1654,null))[_0xcb6b('0x15')](function(_0x1af52b){if(_0x1af52b){return _0x1af52b[_0xcb6b('0x111')](_0x2cbe1e['body'][_0xcb6b('0x5e')],_['omit'](_0x2cbe1e[_0xcb6b('0x4f')],['ids','id'])||{});}})[_0xcb6b('0x15')](respondWithResult(_0x3a1654,null))[_0xcb6b('0x1e')](handleError(_0x3a1654,null));};exports['getProactiveActions']=function(_0x2a7966,_0x5ef03e){var _0x233716={};var _0x299ea4={};var _0x27e6ae;var _0x4b4af2;return db['ChatWebsite'][_0xcb6b('0x5b')]({'where':{'id':_0x2a7966[_0xcb6b('0x56')]['id']}})['then'](handleEntityNotFound(_0x5ef03e,null))[_0xcb6b('0x15')](function(_0x50dd58){if(_0x50dd58){_0x27e6ae=_0x50dd58;_0x299ea4[_0xcb6b('0x37')]=_[_0xcb6b('0x39')](db['ChatProactiveAction'][_0xcb6b('0x34')]);_0x299ea4[_0xcb6b('0x38')]=_[_0xcb6b('0x39')](_0x2a7966[_0xcb6b('0x38')]);_0x299ea4[_0xcb6b('0x3a')]=_['intersection'](_0x299ea4['model'],_0x299ea4['query']);_0x233716[_0xcb6b('0x3d')]=_[_0xcb6b('0x3b')](_0x299ea4[_0xcb6b('0x37')],qs[_0xcb6b('0x3c')](_0x2a7966['query'][_0xcb6b('0x3c')]));_0x233716[_0xcb6b('0x3d')]=_0x233716[_0xcb6b('0x3d')][_0xcb6b('0x4b')]?_0x233716['attributes']:_0x299ea4[_0xcb6b('0x37')];_0x233716[_0xcb6b('0x3f')]=qs[_0xcb6b('0x40')](_0x2a7966[_0xcb6b('0x38')][_0xcb6b('0x40')]);_0x233716[_0xcb6b('0x41')]=qs[_0xcb6b('0x3a')](_[_0xcb6b('0x42')](_0x2a7966['query'],_0x299ea4['filters']));if(_0x2a7966[_0xcb6b('0x38')][_0xcb6b('0x43')]){_0x233716['where']=_[_0xcb6b('0x44')](_0x233716['where'],{'$or':_[_0xcb6b('0x32')](_0x233716['attributes'],function(_0x12c015){var _0x2e7dee={};_0x2e7dee[_0x12c015]={'$like':'%'+_0x2a7966[_0xcb6b('0x38')][_0xcb6b('0x43')]+'%'};return _0x2e7dee;})});}_0x233716=_[_0xcb6b('0x44')]({},_0x233716,_0x2a7966['options']);return _0x27e6ae[_0xcb6b('0x112')](_0x233716);}})['then'](function(_0x47d06b){if(_0x47d06b){_0x4b4af2=_0x47d06b[_0xcb6b('0x4b')];if(!_0x2a7966[_0xcb6b('0x38')][_0xcb6b('0x5c')]('nolimit')){_0x233716[_0xcb6b('0x26')]=qs[_0xcb6b('0x26')](_0x2a7966['query'][_0xcb6b('0x26')]);_0x233716[_0xcb6b('0x23')]=qs['offset'](_0x2a7966[_0xcb6b('0x38')][_0xcb6b('0x23')]);}return _0x27e6ae[_0xcb6b('0x112')](_0x233716);}})[_0xcb6b('0x15')](function(_0x549741){if(_0x549741){return _0x549741?{'count':_0x4b4af2,'rows':_0x549741}:null;}})[_0xcb6b('0x15')](respondWithResult(_0x5ef03e,null))['catch'](handleError(_0x5ef03e,null));};exports[_0xcb6b('0x113')]=function(_0xea4e91,_0x3bca24){var _0x5e2a57=_0xea4e91[_0xcb6b('0x38')][_0xcb6b('0x114')]==='false'?_0xcb6b('0x115'):'onlineForm';return db[_0xcb6b('0x33')]['find']({'attributes':['id',_0x5e2a57],'where':{'id':_0xea4e91[_0xcb6b('0x56')]['id']}})[_0xcb6b('0x15')](handleEntityNotFound(_0x3bca24,null))['then'](function(_0x279e55){if(_0x279e55){var _0x2614c9=_0x279e55[_0x5e2a57];var _0x13eeb6=_0x2614c9&&_0x2614c9['items']?_0x2614c9[_0xcb6b('0x116')]:[];_0x3bca24[_0xcb6b('0x2e')]({'fromKey':_[_0xcb6b('0x6f')](_0x2614c9[_0xcb6b('0x117')])?undefined:_0x2614c9[_0xcb6b('0x117')],'count':_0x13eeb6[_0xcb6b('0x4b')],'rows':_0x13eeb6});}})[_0xcb6b('0x1e')](handleError(_0x3bca24,null));};exports[_0xcb6b('0x118')]=function(_0x3f39b0,_0x2e0d03){var _0x1201a4={'raw':![],'where':{}};var _0xeedc59={};var _0x3e70c3={'count':0x0,'rows':[]};return db[_0xcb6b('0x33')]['findOne']({'where':{'id':_0x3f39b0[_0xcb6b('0x56')]['id']}})[_0xcb6b('0x15')](handleEntityNotFound(_0x2e0d03,null))[_0xcb6b('0x15')](function(_0x147cef){if(_0x147cef){_0xeedc59[_0xcb6b('0x37')]=_['keys'](db[_0xcb6b('0xc8')]['rawAttributes']);_0xeedc59['query']=_[_0xcb6b('0x39')](_0x3f39b0[_0xcb6b('0x38')]);_0xeedc59[_0xcb6b('0x3a')]=_[_0xcb6b('0x3b')](_0xeedc59['model'],_0xeedc59[_0xcb6b('0x38')]);_0x1201a4[_0xcb6b('0x3d')]=_['intersection'](_0xeedc59['model'],qs[_0xcb6b('0x3c')](_0x3f39b0[_0xcb6b('0x38')][_0xcb6b('0x3c')]));_0x1201a4[_0xcb6b('0x3d')]=_0x1201a4['attributes']['length']?_0x1201a4['attributes']:_0xeedc59['model'];if(!_0x3f39b0[_0xcb6b('0x38')][_0xcb6b('0x5c')](_0xcb6b('0x3e'))){_0x1201a4[_0xcb6b('0x26')]=qs[_0xcb6b('0x26')](_0x3f39b0[_0xcb6b('0x38')][_0xcb6b('0x26')]);_0x1201a4[_0xcb6b('0x23')]=qs[_0xcb6b('0x23')](_0x3f39b0[_0xcb6b('0x38')][_0xcb6b('0x23')]);}_0x1201a4[_0xcb6b('0x3f')]=qs[_0xcb6b('0x40')](_0x3f39b0[_0xcb6b('0x38')][_0xcb6b('0x40')]);_0x1201a4[_0xcb6b('0x41')]=qs[_0xcb6b('0x3a')](_[_0xcb6b('0x42')](_0x3f39b0['query'],_0xeedc59['filters']));_0x1201a4[_0xcb6b('0x41')]['ChatWebsiteId']=_0x147cef['id'];if(_0x3f39b0[_0xcb6b('0x38')][_0xcb6b('0x43')]){_0x1201a4['where']=_[_0xcb6b('0x44')](_0x1201a4[_0xcb6b('0x41')],{'$or':_[_0xcb6b('0x32')](_0x1201a4[_0xcb6b('0x3d')],function(_0x115c10){var _0x553848={};_0x553848[_0x115c10]={'$like':'%'+_0x3f39b0[_0xcb6b('0x38')][_0xcb6b('0x43')]+'%'};return _0x553848;})});}_0x1201a4=_[_0xcb6b('0x44')]({},_0x1201a4,_0x3f39b0['options']);return db[_0xcb6b('0xc8')][_0xcb6b('0x25')]({'where':_0x1201a4[_0xcb6b('0x41')]})[_0xcb6b('0x15')](function(_0x549be0){_0x3e70c3[_0xcb6b('0x25')]=_0x549be0;if(_0x3f39b0[_0xcb6b('0x38')]['includeAll']){_0x1201a4[_0xcb6b('0x4c')]=[{'all':!![]}];}else{_0x1201a4[_0xcb6b('0x4c')]=[{'model':db[_0xcb6b('0x7f')],'as':'Contact','required':![]},{'model':db[_0xcb6b('0x119')],'as':_0xcb6b('0x11a'),'required':![]}];}return db[_0xcb6b('0xc8')]['findAll'](_0x1201a4);})[_0xcb6b('0x15')](function(_0x37e7c8){_0x3e70c3[_0xcb6b('0x49')]=_0x37e7c8;return _0x3e70c3;});}})[_0xcb6b('0x15')](respondWithFilteredResult(_0x2e0d03,_0x1201a4))[_0xcb6b('0x1e')](handleError(_0x2e0d03,null));};exports[_0xcb6b('0x11b')]=function(_0x4d873e,_0x1ace33){return db[_0xcb6b('0x33')]['find']({'where':{'id':_0x4d873e[_0xcb6b('0x56')]['id']}})[_0xcb6b('0x15')](handleEntityNotFound(_0x1ace33,null))['then'](function(_0xaf382){if(_0xaf382){return _0xaf382[_0xcb6b('0x11b')](_0x4d873e['body'][_0xcb6b('0x5e')],_[_0xcb6b('0xe1')](_0x4d873e[_0xcb6b('0x4f')],[_0xcb6b('0x5e'),'id'])||{})[_0xcb6b('0xad')](function(_0x1252cb){for(var _0x46a072=0x0;_0x46a072<_0x4d873e[_0xcb6b('0x4f')][_0xcb6b('0x5e')][_0xcb6b('0x4b')];_0x46a072+=0x1){socket[_0xcb6b('0x11c')]('userChatWebsite:save',{'UserId':Number(_0x4d873e['body'][_0xcb6b('0x5e')][_0x46a072]),'ChatWebsiteId':Number(_0x4d873e[_0xcb6b('0x56')]['id'])});}return _0x1252cb;});}})['then'](respondWithResult(_0x1ace33,null))['catch'](handleError(_0x1ace33,null));};exports[_0xcb6b('0x11d')]=function(_0x5428c9,_0x349b6a){return db[_0xcb6b('0x33')][_0xcb6b('0x4d')]({'where':{'id':_0x5428c9['params']['id']}})[_0xcb6b('0x15')](handleEntityNotFound(_0x349b6a,null))['then'](function(_0x4af03c){if(_0x4af03c){return _0x4af03c['removeAgents'](_0x5428c9[_0xcb6b('0x38')][_0xcb6b('0x5e')])['then'](function(){if(_['isArray'](_0x5428c9['query'][_0xcb6b('0x5e')])){for(var _0x2663f9=0x0;_0x2663f9<_0x5428c9[_0xcb6b('0x38')]['ids'][_0xcb6b('0x4b')];_0x2663f9+=0x1){socket[_0xcb6b('0x11c')](_0xcb6b('0x11e'),{'UserId':Number(_0x5428c9[_0xcb6b('0x38')][_0xcb6b('0x5e')][_0x2663f9]),'ChatWebsiteId':Number(_0x5428c9[_0xcb6b('0x56')]['id'])});}}else{socket['emit'](_0xcb6b('0x11e'),{'UserId':Number(_0x5428c9['query'][_0xcb6b('0x5e')]),'ChatWebsiteId':Number(_0x5428c9[_0xcb6b('0x56')]['id'])});}});}})[_0xcb6b('0x15')](respondWithStatusCode(_0x349b6a,null))['catch'](handleError(_0x349b6a,null));};exports[_0xcb6b('0x11f')]=function(_0x5f3c08,_0x367382){var _0x16294f={};var _0x3a5783={};var _0x1b4c8e;var _0x197a40;return db['ChatWebsite']['findOne']({'where':{'id':_0x5f3c08['params']['id']}})[_0xcb6b('0x15')](handleEntityNotFound(_0x367382,null))[_0xcb6b('0x15')](function(_0x2e2a4f){if(_0x2e2a4f){_0x1b4c8e=_0x2e2a4f;_0x3a5783[_0xcb6b('0x37')]=_['keys'](db[_0xcb6b('0xb5')][_0xcb6b('0x34')]);_0x3a5783[_0xcb6b('0x38')]=_['keys'](_0x5f3c08[_0xcb6b('0x38')]);_0x3a5783[_0xcb6b('0x3a')]=_[_0xcb6b('0x3b')](_0x3a5783[_0xcb6b('0x37')],_0x3a5783[_0xcb6b('0x38')]);_0x16294f[_0xcb6b('0x3d')]=_[_0xcb6b('0x3b')](_0x3a5783[_0xcb6b('0x37')],qs[_0xcb6b('0x3c')](_0x5f3c08[_0xcb6b('0x38')][_0xcb6b('0x3c')]));_0x16294f[_0xcb6b('0x3d')]=_0x16294f[_0xcb6b('0x3d')][_0xcb6b('0x4b')]?_0x16294f['attributes']:_0x3a5783[_0xcb6b('0x37')];_0x16294f[_0xcb6b('0x3f')]=qs[_0xcb6b('0x40')](_0x5f3c08[_0xcb6b('0x38')][_0xcb6b('0x40')]);_0x16294f['where']=qs['filters'](_['pick'](_0x5f3c08[_0xcb6b('0x38')],_0x3a5783[_0xcb6b('0x3a')]));if(_0x5f3c08['query'][_0xcb6b('0x43')]){_0x16294f['where']=_[_0xcb6b('0x44')](_0x16294f['where'],{'$or':_[_0xcb6b('0x32')](_0x16294f[_0xcb6b('0x3d')],function(_0x5871ac){var _0x4522e0={};_0x4522e0[_0x5871ac]={'$like':'%'+_0x5f3c08[_0xcb6b('0x38')][_0xcb6b('0x43')]+'%'};return _0x4522e0;})});}_0x16294f=_[_0xcb6b('0x44')]({},_0x16294f,_0x5f3c08[_0xcb6b('0x46')]);return _0x1b4c8e[_0xcb6b('0x11f')](_0x16294f);}})[_0xcb6b('0x15')](function(_0x580d99){if(_0x580d99){_0x197a40=_0x580d99[_0xcb6b('0x4b')];if(!_0x5f3c08['query']['hasOwnProperty'](_0xcb6b('0x3e'))){_0x16294f[_0xcb6b('0x26')]=qs[_0xcb6b('0x26')](_0x5f3c08[_0xcb6b('0x38')][_0xcb6b('0x26')]);_0x16294f[_0xcb6b('0x23')]=qs[_0xcb6b('0x23')](_0x5f3c08[_0xcb6b('0x38')]['offset']);}return _0x1b4c8e[_0xcb6b('0x11f')](_0x16294f);}})[_0xcb6b('0x15')](function(_0x44b508){if(_0x44b508){return _0x44b508?{'count':_0x197a40,'rows':_0x44b508}:null;}})[_0xcb6b('0x15')](respondWithResult(_0x367382,null))[_0xcb6b('0x1e')](handleError(_0x367382,null));};
\ No newline at end of file
+var _0x8af9=['userChatWebsite:save','userChatWebsite:remove','getAgents','util','ejs','fs-extra','lodash','querystring','ioredis','../../components/parsers/qs','../../config/logger','api','../../config/environment','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./chatWebsite.socket','register','html-to-text','jayson/promise','client','http','then','request\x20sent','ChatWebsite,\x20%s,\x20%s,\x20%s','error','ChatWebsite,\x20%s,\x20%s','message','info','result','catch','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','update','destroy','get','ChatWebsites','UserProfileResource','name','send','index','Pause','mandatoryDispositionPause','map','ChatWebsite','rawAttributes','type','key','query','keys','filters','model','intersection','fields','attributes','length','hasOwnProperty','nolimit','sort','where','pick','filter','merge','VIRTUAL','includeAll','include','findAll','rows','show','params','find','body','role','user','UserProfileSection','userProfileId','autoAssociation','create','describe','addDisposition','ChatWebsiteId','Disposition','getDispositions','options','removeDispositions','ids','addAnswer','CannedAnswer','findOne','order','removeAnswers','addLogo','sitepic','file','filename','addAvatar','agentAvatar','addCustomerAvatar','customerAvatar','addSystemAvatar','systemAvatar','getLogo','join','root','server/files/images/logos/default_logo.svg','../../config/license/util','getLicense','custom','isNil','existsSync','server/files/images/logos/','server/files/images/avatars/default_avatar.png','server/files/images/avatars/','download','getCustomerAvatar','server/files/images/avatars/customer_avatar.png','showCustomerAvatar','getSystemAvatar','server/files/images/avatars/system_avatar.png','notify','setUA','getResult','chat','CmContact','Sequelize','ValidationError','no\x20available\x20attributes','difference','updatedAt','CompanyId','from\x20is\x20mandatory','mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','includes','mapKey','mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','CmList','List','Contacts','DESC','ChatApplication','Applications','applications','list','asc','account','ListId','from','contact','customerIp','headers','cf-connecting-ip','x-forwarded-for','first','split','firstName','lastName','x-real-port','browser','%s\x20%s','version','unknown','format','device','vendor','stringify','threadId','ChatInteraction','externalUrl','ContactId','interaction','messageId','created','autoclose','close','unmanaged','*,*,*,*','ChatMessage','UserId','User','unshift','agent','waitForTheAssignedAgent','forcedOwnership','Start','startRouting','EventManager','offline','files','createdAt','body\x20is\x20mandatory\x20and\x20not\x20empty','mapKeyOffline\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','mapKeyOffline','MailAccount','findOrCreate','readFileSync','utf8','render','toPairs','ChatOfflineMessage','fromString','mimetype','offline-chat','basename','openNewInteraction','sequelize','CloudProvider','Smtp','forwardOffline','forwardOfflineAddress','SendMail','sendMail','\x22%s\x22\x20<%s>','email','offlineMessageSubject','MailAccountId','originalname','subjectOffline','NotifyMailAccount','notifyMail','server','attachments','Could\x20not\x20remove\x20attachment\x20file','addInteraction','omit','getInteractions','Contact','Owner','fullname','internal','Tag','Tags','color','tag','Command','getSnippet','timezone','iftime\x20%s,%s','interval','iftime\x20%s','indexOf','OFFLINE','No\x20timezone','inspect','Interval','Intervals','getProactiveActions','License','increment','push','all','some','server/files/chat/iframe.ejs','address','origin','3.1.0','connection','remoteAddress','replace','alignment','verticalAlignment','textColor','textButtonColor','color_button','backgroundColor','IntervalId','addApplications','transaction','Transaction','ISOLATION_LEVELS','READ_COMMITTED','bulkCreate','priority','stack','getApplications','addProactiveActions','ChatProactiveAction','getFields','online','false','onlineForm','items','fromKey','getOfflineMessages','Attachment','Attachments','addAgents','spread','emit'];(function(_0x1a5d42,_0x51e6a1){var _0x23208b=function(_0x379b6f){while(--_0x379b6f){_0x1a5d42['push'](_0x1a5d42['shift']());}};_0x23208b(++_0x51e6a1);}(_0x8af9,0x12d));var _0x98af=function(_0x397b73,_0x365fca){_0x397b73=_0x397b73-0x0;var _0x477a3f=_0x8af9[_0x397b73];return _0x477a3f;};'use strict';var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x98af('0x0'));var path=require('path');var ejs=require(_0x98af('0x1'));var fs=require('fs');var fs_extra=require(_0x98af('0x2'));var _=require(_0x98af('0x3'));var querystring=require(_0x98af('0x4'));var Redis=require(_0x98af('0x5'));var qs=require(_0x98af('0x6'));var logger=require(_0x98af('0x7'))(_0x98af('0x8'));var config=require(_0x98af('0x9'));var db=require(_0x98af('0xa'))['db'];config[_0x98af('0xb')]=_[_0x98af('0xc')](config[_0x98af('0xb')],{'host':_0x98af('0xd'),'port':0x18eb});var socket=require(_0x98af('0xe'))(new Redis(config[_0x98af('0xb')]));require(_0x98af('0xf'))[_0x98af('0x10')](socket);var htmlToText=require(_0x98af('0x11'));var jayson=require(_0x98af('0x12'));var client=jayson[_0x98af('0x13')][_0x98af('0x14')]({'port':0x232c});var client9002=jayson[_0x98af('0x13')][_0x98af('0x14')]({'port':0x232a});var client9003=jayson[_0x98af('0x13')][_0x98af('0x14')]({'port':0x232b});var client9001=jayson[_0x98af('0x13')][_0x98af('0x14')]({'port':0x2329});function respondWithRpcPromise(_0x43615f,_0x564a9c,_0x24a1b1,_0x1e5a94){return new BPromise(function(_0x14184b,_0x1ae467){var _0x22fb7b=_0x1e5a94||client;return _0x22fb7b['request'](_0x43615f,_0x24a1b1)[_0x98af('0x15')](function(_0x5c6949){logger['info']('ChatWebsite,\x20%s,\x20%s',_0x564a9c,_0x98af('0x16'));logger['debug'](_0x98af('0x17'),_0x564a9c,_0x98af('0x16'),JSON['stringify'](_0x5c6949));if(_0x5c6949[_0x98af('0x18')]){if(_0x5c6949[_0x98af('0x18')]['code']===0x1f4){logger['error'](_0x98af('0x19'),_0x564a9c,_0x5c6949['error']['message']);return _0x1ae467(_0x5c6949[_0x98af('0x18')][_0x98af('0x1a')]);}logger[_0x98af('0x18')](_0x98af('0x19'),_0x564a9c,_0x5c6949[_0x98af('0x18')][_0x98af('0x1a')]);return _0x14184b(_0x5c6949[_0x98af('0x18')][_0x98af('0x1a')]);}else{logger[_0x98af('0x1b')]('ChatWebsite,\x20%s,\x20%s',_0x564a9c,_0x98af('0x16'));_0x14184b(_0x5c6949[_0x98af('0x1c')][_0x98af('0x1a')]);}})[_0x98af('0x1d')](function(_0x287c23){logger[_0x98af('0x18')](_0x98af('0x19'),_0x564a9c,_0x287c23);_0x1ae467(_0x287c23);});});}function respondWithStatusCode(_0x340d2d,_0x4272c6){_0x4272c6=_0x4272c6||0xcc;return function(_0x23b3b3){if(_0x23b3b3){return _0x340d2d[_0x98af('0x1e')](_0x4272c6);}return _0x340d2d[_0x98af('0x1f')](_0x4272c6)[_0x98af('0x20')]();};}function respondWithResult(_0xf831a5,_0x55cfe2){_0x55cfe2=_0x55cfe2||0xc8;return function(_0x54e709){if(_0x54e709){return _0xf831a5[_0x98af('0x1f')](_0x55cfe2)[_0x98af('0x21')](_0x54e709);}};}function respondWithFilteredResult(_0x33d253,_0x59266c){return function(_0x12d5ac){if(_0x12d5ac){var _0x202cb6=typeof _0x59266c[_0x98af('0x22')]===_0x98af('0x23')&&typeof _0x59266c[_0x98af('0x24')]===_0x98af('0x23');var _0x960429=_0x12d5ac['count'];var _0x53cea3=_0x202cb6?0x0:_0x59266c[_0x98af('0x22')];var _0x4d99c8=_0x202cb6?_0x12d5ac[_0x98af('0x25')]:_0x59266c[_0x98af('0x22')]+_0x59266c[_0x98af('0x24')];var _0x52bc3f;if(_0x4d99c8>=_0x960429){_0x4d99c8=_0x960429;_0x52bc3f=0xc8;}else{_0x52bc3f=0xce;}_0x33d253[_0x98af('0x1f')](_0x52bc3f);return _0x33d253[_0x98af('0x26')](_0x98af('0x27'),_0x53cea3+'-'+_0x4d99c8+'/'+_0x960429)['json'](_0x12d5ac);}return null;};}function saveUpdates(_0x36aaaa){return function(_0x36293a){if(_0x36293a){return _0x36293a[_0x98af('0x28')](_0x36aaaa)[_0x98af('0x15')](function(_0xf1cc99){return _0xf1cc99;});}return null;};}function removeEntity(_0x518a11){return function(_0x21c21c){if(_0x21c21c){return _0x21c21c[_0x98af('0x29')]()[_0x98af('0x15')](function(){var _0x1cfacc=_0x21c21c[_0x98af('0x2a')]({'plain':!![]});var _0x29f29b=_0x98af('0x2b');return db[_0x98af('0x2c')][_0x98af('0x29')]({'where':{'type':_0x29f29b,'resourceId':_0x1cfacc['id']}})[_0x98af('0x15')](function(){return _0x21c21c;});})[_0x98af('0x15')](function(){_0x518a11['status'](0xcc)[_0x98af('0x20')]();});}};}function handleEntityNotFound(_0x3581f9){return function(_0x35a674){if(!_0x35a674){_0x3581f9[_0x98af('0x1e')](0x194);}return _0x35a674;};}function handleError(_0x21c9e3,_0x77b491){_0x77b491=_0x77b491||0x1f4;return function(_0x391b61){logger[_0x98af('0x18')](_0x391b61['stack']);if(_0x391b61[_0x98af('0x2d')]){delete _0x391b61[_0x98af('0x2d')];}_0x21c9e3['status'](_0x77b491)[_0x98af('0x2e')](_0x391b61);};}exports[_0x98af('0x2f')]=function(_0x25c997,_0x26dd0b){var _0x30f93b={'include':[{'model':db[_0x98af('0x30')],'as':_0x98af('0x31')}]},_0x1996fd={},_0x262fd1={'count':0x0,'rows':[]};var _0x4303cb=_[_0x98af('0x32')](db[_0x98af('0x33')][_0x98af('0x34')],function(_0x1e814c){return{'name':_0x1e814c['fieldName'],'type':_0x1e814c[_0x98af('0x35')][_0x98af('0x36')]};});_0x1996fd['model']=_['map'](_0x4303cb,'name');_0x1996fd[_0x98af('0x37')]=_[_0x98af('0x38')](_0x25c997['query']);_0x1996fd[_0x98af('0x39')]=_['intersection'](_0x1996fd[_0x98af('0x3a')],_0x1996fd[_0x98af('0x37')]);_0x30f93b['attributes']=_[_0x98af('0x3b')](_0x1996fd[_0x98af('0x3a')],qs[_0x98af('0x3c')](_0x25c997[_0x98af('0x37')][_0x98af('0x3c')]));_0x30f93b['attributes']=_0x30f93b[_0x98af('0x3d')][_0x98af('0x3e')]?_0x30f93b[_0x98af('0x3d')]:_0x1996fd[_0x98af('0x3a')];if(!_0x25c997[_0x98af('0x37')][_0x98af('0x3f')](_0x98af('0x40'))){_0x30f93b['limit']=qs['limit'](_0x25c997[_0x98af('0x37')]['limit']);_0x30f93b[_0x98af('0x22')]=qs[_0x98af('0x22')](_0x25c997[_0x98af('0x37')]['offset']);}_0x30f93b['order']=qs[_0x98af('0x41')](_0x25c997[_0x98af('0x37')]['sort']);_0x30f93b[_0x98af('0x42')]=qs[_0x98af('0x39')](_[_0x98af('0x43')](_0x25c997[_0x98af('0x37')],_0x1996fd[_0x98af('0x39')]),_0x4303cb);if(_0x25c997['query'][_0x98af('0x44')]){_0x30f93b[_0x98af('0x42')]=_[_0x98af('0x45')](_0x30f93b['where'],{'$or':_[_0x98af('0x32')](_0x4303cb,function(_0x4f162b){if(_0x4f162b['type']!==_0x98af('0x46')){var _0x3f3ec2={};_0x3f3ec2[_0x4f162b[_0x98af('0x2d')]]={'$like':'%'+_0x25c997[_0x98af('0x37')][_0x98af('0x44')]+'%'};return _0x3f3ec2;}})});}_0x30f93b=_[_0x98af('0x45')]({},_0x30f93b,_0x25c997['options']);var _0x4c9335={'where':_0x30f93b['where']};return db['ChatWebsite'][_0x98af('0x25')](_0x4c9335)[_0x98af('0x15')](function(_0x2bede5){_0x262fd1['count']=_0x2bede5;if(_0x25c997[_0x98af('0x37')][_0x98af('0x47')]){_0x30f93b[_0x98af('0x48')]=[{'all':!![]}];}return db[_0x98af('0x33')][_0x98af('0x49')](_0x30f93b);})[_0x98af('0x15')](function(_0x2c3303){_0x262fd1[_0x98af('0x4a')]=_0x2c3303;return _0x262fd1;})[_0x98af('0x15')](respondWithFilteredResult(_0x26dd0b,_0x30f93b))[_0x98af('0x1d')](handleError(_0x26dd0b,null));};exports[_0x98af('0x4b')]=function(_0x5473f6,_0x29e445){var _0x163fc6={'raw':![],'where':{'id':_0x5473f6[_0x98af('0x4c')]['id']},'include':[{'model':db[_0x98af('0x30')],'as':_0x98af('0x31')}]},_0x101a23={};_0x101a23[_0x98af('0x3a')]=_[_0x98af('0x38')](db[_0x98af('0x33')][_0x98af('0x34')]);_0x101a23[_0x98af('0x37')]=_[_0x98af('0x38')](_0x5473f6[_0x98af('0x37')]);_0x101a23['filters']=_['intersection'](_0x101a23['model'],_0x101a23['query']);_0x163fc6[_0x98af('0x3d')]=_[_0x98af('0x3b')](_0x101a23[_0x98af('0x3a')],qs[_0x98af('0x3c')](_0x5473f6[_0x98af('0x37')]['fields']));_0x163fc6['attributes']=_0x163fc6[_0x98af('0x3d')]['length']?_0x163fc6[_0x98af('0x3d')]:_0x101a23[_0x98af('0x3a')];if(_0x5473f6[_0x98af('0x37')][_0x98af('0x47')]){_0x163fc6['include']=[{'all':!![]}];}_0x163fc6=_[_0x98af('0x45')]({},_0x163fc6,_0x5473f6['options']);return db[_0x98af('0x33')][_0x98af('0x4d')](_0x163fc6)['then'](handleEntityNotFound(_0x29e445,null))[_0x98af('0x15')](respondWithResult(_0x29e445,null))[_0x98af('0x1d')](handleError(_0x29e445,null));};exports['create']=function(_0x1a4586,_0x39c586){return db[_0x98af('0x33')]['create'](_0x1a4586[_0x98af('0x4e')],{})[_0x98af('0x15')](function(_0x114148){var _0x30738b=_0x1a4586['user']['get']({'plain':!![]});if(!_0x30738b)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x30738b[_0x98af('0x4f')]===_0x98af('0x50')){var _0x4ec475=_0x114148['get']({'plain':!![]});var _0x33c65b=_0x98af('0x2b');return db[_0x98af('0x51')][_0x98af('0x4d')]({'where':{'name':_0x33c65b,'userProfileId':_0x30738b[_0x98af('0x52')]},'raw':!![]})[_0x98af('0x15')](function(_0x12ab9a){if(_0x12ab9a&&_0x12ab9a[_0x98af('0x53')]===0x0){return db[_0x98af('0x2c')][_0x98af('0x54')]({'name':_0x4ec475['name'],'resourceId':_0x4ec475['id'],'type':_0x12ab9a[_0x98af('0x2d')],'sectionId':_0x12ab9a['id']},{})['then'](function(){return _0x114148;});}else{return _0x114148;}})['catch'](function(_0x516419){logger[_0x98af('0x18')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x516419);throw _0x516419;});}return _0x114148;})[_0x98af('0x15')](respondWithResult(_0x39c586,0xc9))[_0x98af('0x1d')](handleError(_0x39c586,null));};exports[_0x98af('0x28')]=function(_0x33dd84,_0x59189a){if(_0x33dd84['body']['id']){delete _0x33dd84[_0x98af('0x4e')]['id'];}return db[_0x98af('0x33')][_0x98af('0x4d')]({'where':{'id':_0x33dd84[_0x98af('0x4c')]['id']},'include':[{'model':db[_0x98af('0x30')],'as':_0x98af('0x31')}]})[_0x98af('0x15')](handleEntityNotFound(_0x59189a,null))['then'](saveUpdates(_0x33dd84[_0x98af('0x4e')],null))[_0x98af('0x15')](respondWithResult(_0x59189a,null))[_0x98af('0x1d')](handleError(_0x59189a,null));};exports['destroy']=function(_0x28d340,_0x5723fe){return db[_0x98af('0x33')]['find']({'where':{'id':_0x28d340[_0x98af('0x4c')]['id']}})[_0x98af('0x15')](handleEntityNotFound(_0x5723fe,null))['then'](removeEntity(_0x5723fe,null))['catch'](handleError(_0x5723fe,null));};exports[_0x98af('0x55')]=function(_0x14eec8,_0x582413){return db['ChatWebsite'][_0x98af('0x55')]()['then'](respondWithResult(_0x582413,null))[_0x98af('0x1d')](handleError(_0x582413,null));};exports[_0x98af('0x56')]=function(_0x348a3b,_0x4442d6){if(_0x348a3b[_0x98af('0x4e')]['id']){delete _0x348a3b[_0x98af('0x4e')]['id'];}return db[_0x98af('0x33')][_0x98af('0x4d')]({'where':{'id':_0x348a3b[_0x98af('0x4c')]['id']}})[_0x98af('0x15')](handleEntityNotFound(_0x4442d6,null))['then'](function(_0x354309){if(_0x354309){_0x348a3b[_0x98af('0x4e')][_0x98af('0x57')]=_0x354309['id'];return db[_0x98af('0x58')][_0x98af('0x54')](_0x348a3b[_0x98af('0x4e')]);}})[_0x98af('0x15')](respondWithResult(_0x4442d6,null))[_0x98af('0x1d')](handleError(_0x4442d6,null));};exports[_0x98af('0x59')]=function(_0x118d56,_0x4eab9f){var _0x10736e={'raw':![],'where':{}};var _0x5e95f1={};var _0x1a2b06={'count':0x0,'rows':[]};return db['ChatWebsite']['findOne']({'where':{'id':_0x118d56['params']['id']}})[_0x98af('0x15')](handleEntityNotFound(_0x4eab9f,null))['then'](function(_0x4d01d4){if(_0x4d01d4){_0x5e95f1[_0x98af('0x3a')]=_[_0x98af('0x38')](db['Disposition']['rawAttributes']);_0x5e95f1[_0x98af('0x37')]=_[_0x98af('0x38')](_0x118d56[_0x98af('0x37')]);_0x5e95f1[_0x98af('0x39')]=_[_0x98af('0x3b')](_0x5e95f1[_0x98af('0x3a')],_0x5e95f1[_0x98af('0x37')]);_0x10736e[_0x98af('0x3d')]=_['intersection'](_0x5e95f1[_0x98af('0x3a')],qs['fields'](_0x118d56[_0x98af('0x37')][_0x98af('0x3c')]));_0x10736e[_0x98af('0x3d')]=_0x10736e[_0x98af('0x3d')][_0x98af('0x3e')]?_0x10736e[_0x98af('0x3d')]:_0x5e95f1['model'];if(!_0x118d56['query']['hasOwnProperty'](_0x98af('0x40'))){_0x10736e['limit']=qs['limit'](_0x118d56[_0x98af('0x37')][_0x98af('0x24')]);_0x10736e[_0x98af('0x22')]=qs['offset'](_0x118d56['query']['offset']);}_0x10736e['order']=qs[_0x98af('0x41')](_0x118d56['query'][_0x98af('0x41')]);_0x10736e[_0x98af('0x42')]=qs['filters'](_[_0x98af('0x43')](_0x118d56[_0x98af('0x37')],_0x5e95f1[_0x98af('0x39')]));_0x10736e['where'][_0x98af('0x57')]=_0x4d01d4['id'];if(_0x118d56[_0x98af('0x37')][_0x98af('0x44')]){_0x10736e[_0x98af('0x42')]=_[_0x98af('0x45')](_0x10736e[_0x98af('0x42')],{'$or':_[_0x98af('0x32')](_0x10736e[_0x98af('0x3d')],function(_0x1feced){var _0x37ae9b={};_0x37ae9b[_0x1feced]={'$like':'%'+_0x118d56['query']['filter']+'%'};return _0x37ae9b;})});}_0x10736e=_['merge']({},_0x10736e,_0x118d56[_0x98af('0x5a')]);return db['Disposition']['count']({'where':_0x10736e[_0x98af('0x42')]})['then'](function(_0x3ced85){_0x1a2b06['count']=_0x3ced85;if(_0x118d56[_0x98af('0x37')][_0x98af('0x47')]){_0x10736e[_0x98af('0x48')]=[{'all':!![]}];}return db['Disposition'][_0x98af('0x49')](_0x10736e);})[_0x98af('0x15')](function(_0xd41825){_0x1a2b06[_0x98af('0x4a')]=_0xd41825;return _0x1a2b06;});}})[_0x98af('0x15')](respondWithFilteredResult(_0x4eab9f,_0x10736e))[_0x98af('0x1d')](handleError(_0x4eab9f,null));};exports['removeDispositions']=function(_0x28056f,_0x4b1992){return db[_0x98af('0x33')][_0x98af('0x4d')]({'where':{'id':_0x28056f[_0x98af('0x4c')]['id']}})['then'](handleEntityNotFound(_0x4b1992,null))[_0x98af('0x15')](function(_0x2f6736){if(_0x2f6736){return _0x2f6736[_0x98af('0x5b')](_0x28056f[_0x98af('0x37')][_0x98af('0x5c')]);}})[_0x98af('0x15')](respondWithStatusCode(_0x4b1992,null))[_0x98af('0x1d')](handleError(_0x4b1992,null));};exports[_0x98af('0x5d')]=function(_0xd90037,_0x40a315){if(_0xd90037[_0x98af('0x4e')]['id']){delete _0xd90037[_0x98af('0x4e')]['id'];}return db[_0x98af('0x33')][_0x98af('0x4d')]({'where':{'id':_0xd90037['params']['id']}})[_0x98af('0x15')](handleEntityNotFound(_0x40a315,null))[_0x98af('0x15')](function(_0x46ea60){if(_0x46ea60){_0xd90037[_0x98af('0x4e')]['ChatWebsiteId']=_0x46ea60['id'];return db[_0x98af('0x5e')][_0x98af('0x54')](_0xd90037[_0x98af('0x4e')]);}})[_0x98af('0x15')](respondWithResult(_0x40a315,null))['catch'](handleError(_0x40a315,null));};exports['getAnswers']=function(_0x135cb0,_0x357f7b){var _0x57c8c5={'raw':![],'where':{}};var _0x24d079={};var _0x302e69={'count':0x0,'rows':[]};return db[_0x98af('0x33')][_0x98af('0x5f')]({'where':{'id':_0x135cb0[_0x98af('0x4c')]['id']}})[_0x98af('0x15')](handleEntityNotFound(_0x357f7b,null))[_0x98af('0x15')](function(_0x201f4d){if(_0x201f4d){_0x24d079[_0x98af('0x3a')]=_[_0x98af('0x38')](db[_0x98af('0x5e')]['rawAttributes']);_0x24d079[_0x98af('0x37')]=_[_0x98af('0x38')](_0x135cb0['query']);_0x24d079[_0x98af('0x39')]=_[_0x98af('0x3b')](_0x24d079['model'],_0x24d079['query']);_0x57c8c5['attributes']=_[_0x98af('0x3b')](_0x24d079[_0x98af('0x3a')],qs['fields'](_0x135cb0[_0x98af('0x37')][_0x98af('0x3c')]));_0x57c8c5[_0x98af('0x3d')]=_0x57c8c5[_0x98af('0x3d')][_0x98af('0x3e')]?_0x57c8c5[_0x98af('0x3d')]:_0x24d079[_0x98af('0x3a')];if(!_0x135cb0[_0x98af('0x37')][_0x98af('0x3f')](_0x98af('0x40'))){_0x57c8c5[_0x98af('0x24')]=qs[_0x98af('0x24')](_0x135cb0['query']['limit']);_0x57c8c5[_0x98af('0x22')]=qs[_0x98af('0x22')](_0x135cb0[_0x98af('0x37')][_0x98af('0x22')]);}_0x57c8c5[_0x98af('0x60')]=qs[_0x98af('0x41')](_0x135cb0[_0x98af('0x37')][_0x98af('0x41')]);_0x57c8c5[_0x98af('0x42')]=qs[_0x98af('0x39')](_[_0x98af('0x43')](_0x135cb0[_0x98af('0x37')],_0x24d079[_0x98af('0x39')]));_0x57c8c5[_0x98af('0x42')][_0x98af('0x57')]=_0x201f4d['id'];if(_0x135cb0['query'][_0x98af('0x44')]){_0x57c8c5[_0x98af('0x42')]=_['merge'](_0x57c8c5['where'],{'$or':_['map'](_0x57c8c5[_0x98af('0x3d')],function(_0x1b1fac){var _0x14b338={};_0x14b338[_0x1b1fac]={'$like':'%'+_0x135cb0[_0x98af('0x37')][_0x98af('0x44')]+'%'};return _0x14b338;})});}_0x57c8c5=_['merge']({},_0x57c8c5,_0x135cb0['options']);return db[_0x98af('0x5e')]['count']({'where':_0x57c8c5[_0x98af('0x42')]})['then'](function(_0x441888){_0x302e69[_0x98af('0x25')]=_0x441888;if(_0x135cb0[_0x98af('0x37')]['includeAll']){_0x57c8c5[_0x98af('0x48')]=[{'all':!![]}];}return db[_0x98af('0x5e')][_0x98af('0x49')](_0x57c8c5);})[_0x98af('0x15')](function(_0x257e62){_0x302e69['rows']=_0x257e62;return _0x302e69;});}})[_0x98af('0x15')](respondWithFilteredResult(_0x357f7b,_0x57c8c5))[_0x98af('0x1d')](handleError(_0x357f7b,null));};exports[_0x98af('0x61')]=function(_0xfed27a,_0x3c46ca){return db[_0x98af('0x33')][_0x98af('0x4d')]({'where':{'id':_0xfed27a['params']['id']}})[_0x98af('0x15')](handleEntityNotFound(_0x3c46ca,null))[_0x98af('0x15')](function(_0x17cf6b){if(_0x17cf6b){return _0x17cf6b[_0x98af('0x61')](_0xfed27a[_0x98af('0x37')][_0x98af('0x5c')]);}})['then'](respondWithStatusCode(_0x3c46ca,null))[_0x98af('0x1d')](handleError(_0x3c46ca,null));};exports[_0x98af('0x62')]=function(_0x149de3,_0x52daa6){_0x149de3['body'][_0x98af('0x63')]=_0x149de3[_0x98af('0x64')][_0x98af('0x65')];return db['ChatWebsite']['find']({'where':{'id':_0x149de3[_0x98af('0x4c')]['id']}})[_0x98af('0x15')](handleEntityNotFound(_0x52daa6,null))['then'](saveUpdates(_0x149de3[_0x98af('0x4e')],null))[_0x98af('0x15')](respondWithResult(_0x52daa6,null))['catch'](handleError(_0x52daa6,null));};exports[_0x98af('0x66')]=function(_0x2bf3c8,_0x284e93){_0x2bf3c8['body'][_0x98af('0x67')]=_0x2bf3c8[_0x98af('0x64')][_0x98af('0x65')];return db[_0x98af('0x33')][_0x98af('0x4d')]({'where':{'id':_0x2bf3c8[_0x98af('0x4c')]['id']}})[_0x98af('0x15')](handleEntityNotFound(_0x284e93,null))[_0x98af('0x15')](saveUpdates(_0x2bf3c8[_0x98af('0x4e')],null))[_0x98af('0x15')](respondWithResult(_0x284e93,null))[_0x98af('0x1d')](handleError(_0x284e93,null));};exports[_0x98af('0x68')]=function(_0x4bc60d,_0x1b320a){_0x4bc60d[_0x98af('0x4e')][_0x98af('0x69')]=_0x4bc60d[_0x98af('0x64')][_0x98af('0x65')];return db[_0x98af('0x33')][_0x98af('0x4d')]({'where':{'id':_0x4bc60d['params']['id']}})[_0x98af('0x15')](handleEntityNotFound(_0x1b320a,null))[_0x98af('0x15')](saveUpdates(_0x4bc60d[_0x98af('0x4e')],null))[_0x98af('0x15')](respondWithResult(_0x1b320a,null))[_0x98af('0x1d')](handleError(_0x1b320a,null));};exports[_0x98af('0x6a')]=function(_0x3b0f94,_0x30d049){_0x3b0f94[_0x98af('0x4e')][_0x98af('0x6b')]=_0x3b0f94['file'][_0x98af('0x65')];return db[_0x98af('0x33')][_0x98af('0x4d')]({'where':{'id':_0x3b0f94[_0x98af('0x4c')]['id']}})[_0x98af('0x15')](handleEntityNotFound(_0x30d049,null))[_0x98af('0x15')](saveUpdates(_0x3b0f94['body'],null))['then'](respondWithResult(_0x30d049,null))[_0x98af('0x1d')](handleError(_0x30d049,null));};exports[_0x98af('0x6c')]=function(_0x5b2b2e,_0x37a75b){var _0x2935e4=path[_0x98af('0x6d')](config[_0x98af('0x6e')],_0x98af('0x6f'));var _0x39078d={'where':{'id':_0x5b2b2e[_0x98af('0x4c')]['id']},'attributes':['id',_0x98af('0x63')],'raw':!![]};var _0x47bcba=![];return require(_0x98af('0x70'))[_0x98af('0x71')]()['then'](function(_0xa06665){if(_0xa06665){_0x47bcba=_0xa06665[_0x98af('0x72')];}})['then'](function(){return db['ChatWebsite']['find'](_0x39078d);})['then'](handleEntityNotFound(_0x37a75b,null))[_0x98af('0x15')](function(_0x3b6ba5){if(_0x3b6ba5){if(!_[_0x98af('0x73')](_0x3b6ba5['sitepic'])){if(fs[_0x98af('0x74')](path[_0x98af('0x6d')](config[_0x98af('0x6e')],'server/files/images/logos/',_0x3b6ba5[_0x98af('0x63')]))&&_0x47bcba){_0x2935e4=path['join'](config[_0x98af('0x6e')],_0x98af('0x75'),_0x3b6ba5['sitepic']);}}return _0x37a75b['download'](_0x2935e4);}})['catch'](handleError(_0x37a75b,null));};exports['getAvatar']=function(_0x147bab,_0x2fe422){var _0x1db641=path['join'](config[_0x98af('0x6e')],_0x98af('0x76'));var _0xe1427a={'where':{'id':_0x147bab['params']['id']},'attributes':['id',_0x98af('0x67')],'raw':!![]};return db[_0x98af('0x33')][_0x98af('0x4d')](_0xe1427a)[_0x98af('0x15')](handleEntityNotFound(_0x2fe422,null))[_0x98af('0x15')](function(_0x38f05d){if(_0x38f05d){if(!_[_0x98af('0x73')](_0x38f05d['agentAvatar'])){if(fs[_0x98af('0x74')](path[_0x98af('0x6d')](config['root'],_0x98af('0x77'),_0x38f05d['agentAvatar']))){_0x1db641=path[_0x98af('0x6d')](config['root'],'server/files/images/avatars/',_0x38f05d[_0x98af('0x67')]);}}return _0x2fe422[_0x98af('0x78')](_0x1db641);}})[_0x98af('0x1d')](handleError(_0x2fe422,null));};exports[_0x98af('0x79')]=function(_0x4e64d5,_0x1d170c){var _0x167607=path[_0x98af('0x6d')](config['root'],_0x98af('0x7a'));var _0x4ab8ff={'where':{'id':_0x4e64d5['params']['id']},'attributes':['id',_0x98af('0x69'),'showCustomerAvatar'],'raw':!![]};return db[_0x98af('0x33')][_0x98af('0x4d')](_0x4ab8ff)[_0x98af('0x15')](handleEntityNotFound(_0x1d170c,null))[_0x98af('0x15')](function(_0x3ba31b){if(_0x3ba31b){if(!_['isNil'](_0x3ba31b[_0x98af('0x69')])){if(fs[_0x98af('0x74')](path[_0x98af('0x6d')](config[_0x98af('0x6e')],_0x98af('0x77'),_0x3ba31b['customerAvatar']))&&_0x3ba31b[_0x98af('0x7b')]){_0x167607=path[_0x98af('0x6d')](config[_0x98af('0x6e')],'server/files/images/avatars/',_0x3ba31b[_0x98af('0x69')]);}}return _0x1d170c[_0x98af('0x78')](_0x167607);}})['catch'](handleError(_0x1d170c,null));};exports[_0x98af('0x7c')]=function(_0x1b3948,_0x56932c){var _0x594a2b=path['join'](config[_0x98af('0x6e')],_0x98af('0x7d'));var _0x4e2971={'where':{'id':_0x1b3948[_0x98af('0x4c')]['id']},'attributes':['id',_0x98af('0x6b')],'raw':!![]};return db[_0x98af('0x33')][_0x98af('0x4d')](_0x4e2971)[_0x98af('0x15')](handleEntityNotFound(_0x56932c,null))[_0x98af('0x15')](function(_0x3c1dda){if(_0x3c1dda){if(!_[_0x98af('0x73')](_0x3c1dda[_0x98af('0x6b')])){if(fs[_0x98af('0x74')](path[_0x98af('0x6d')](config[_0x98af('0x6e')],_0x98af('0x77'),_0x3c1dda['systemAvatar']))){_0x594a2b=path[_0x98af('0x6d')](config['root'],_0x98af('0x77'),_0x3c1dda['systemAvatar']);}}return _0x56932c[_0x98af('0x78')](_0x594a2b);}})['catch'](handleError(_0x56932c,null));};exports[_0x98af('0x7e')]=function(_0x18a432,_0x38e57a){var _0x5d35f6=require('user-agent-parser');var _0x2f3949=new _0x5d35f6();var _0x10ec3d=_0x2f3949[_0x98af('0x7f')](_0x18a432['headers']['user-agent'])[_0x98af('0x80')]();var _0x21d1ee={'body':_0x18a432[_0x98af('0x4e')],'channel':_0x98af('0x81')};var _0x10aacc=[];var _0x54f010=[];var _0x332f16={};var _0x2ff79f=![];return db[_0x98af('0x82')][_0x98af('0x55')]()[_0x98af('0x15')](function(_0x359f01){if(!_0x359f01){throw new db[(_0x98af('0x83'))][(_0x98af('0x84'))](_0x98af('0x85'));}_0x10aacc=_[_0x98af('0x86')](_[_0x98af('0x38')](_0x359f01),['createdAt','updatedAt']);_0x54f010=_['difference'](_[_0x98af('0x38')](_0x359f01),['createdAt',_0x98af('0x87'),_0x98af('0x88'),'ListId']);if(_0x18a432[_0x98af('0x4e')]['id']){delete _0x18a432[_0x98af('0x4e')]['id'];}if(_[_0x98af('0x73')](_0x18a432[_0x98af('0x4e')]['from'])){throw new db[(_0x98af('0x83'))][(_0x98af('0x84'))](_0x98af('0x89'));}if(_[_0x98af('0x73')](_0x18a432[_0x98af('0x4e')][_0x98af('0x4e')])||_0x18a432[_0x98af('0x4e')][_0x98af('0x4e')]===''){throw new db[(_0x98af('0x83'))][(_0x98af('0x84'))]('body\x20is\x20mandatory\x20and\x20not\x20empty');}if(_[_0x98af('0x73')](_0x18a432[_0x98af('0x4e')]['mapKey'])){throw new db[(_0x98af('0x83'))][(_0x98af('0x84'))](_0x98af('0x8a')+_0x54f010);}if(!_[_0x98af('0x8b')](_0x54f010,_0x18a432[_0x98af('0x4e')][_0x98af('0x8c')])){throw new db[(_0x98af('0x83'))][(_0x98af('0x84'))](_0x98af('0x8d')+_0x54f010);}_0x332f16[_0x18a432[_0x98af('0x4e')][_0x98af('0x8c')]]=_0x18a432[_0x98af('0x4e')]['from'];})['then'](function(){return db[_0x98af('0x33')]['find']({'where':{'id':_0x18a432['params']['id']},'include':[{'model':db[_0x98af('0x8e')],'as':_0x98af('0x8f'),'include':[{'model':db[_0x98af('0x82')],'as':_0x98af('0x90'),'where':_0x332f16,'limit':0x1,'order':[[_0x98af('0x87'),_0x98af('0x91')]]}]},{'model':db[_0x98af('0x92')],'as':_0x98af('0x93')}]});})['then'](handleEntityNotFound(_0x38e57a,null))[_0x98af('0x15')](function(_0x5850c3){if(_0x5850c3&&_0x5850c3['List']){_0x21d1ee['account']=_0x5850c3;_0x21d1ee[_0x98af('0x94')]=_0x5850c3[_0x98af('0x93')];_0x21d1ee[_0x98af('0x95')]=_0x5850c3[_0x98af('0x8f')];_0x21d1ee[_0x98af('0x94')]=_['orderBy'](_0x21d1ee[_0x98af('0x94')],['priority'],[_0x98af('0x96')]);if(_0x21d1ee[_0x98af('0x97')]['Applications']){delete _0x21d1ee['account'][_0x98af('0x93')];}if(_0x21d1ee['account'][_0x98af('0x8f')]&&_0x21d1ee[_0x98af('0x97')]['List'][_0x98af('0x90')][_0x98af('0x3e')]){return _0x21d1ee[_0x98af('0x97')]['List']['Contacts'][0x0];}var _0x578cda=_[_0x98af('0xc')](_0x18a432[_0x98af('0x4e')],{'firstName':_0x18a432[_0x98af('0x4e')]['from'],'ListId':_0x5850c3[_0x98af('0x98')]});_0x578cda[_0x18a432[_0x98af('0x4e')][_0x98af('0x8c')]]=_0x18a432[_0x98af('0x4e')][_0x98af('0x99')];return db[_0x98af('0x82')][_0x98af('0x54')](_0x578cda,{'fields':_0x10aacc,'raw':!![]});}})['then'](handleEntityNotFound(_0x38e57a,null))[_0x98af('0x15')](function(_0x428e57){_0x21d1ee[_0x98af('0x9a')]=_0x428e57;var _0x2b67af=_0x18a432[_0x98af('0x4e')][_0x98af('0x9b')];if(_0x18a432[_0x98af('0x9c')][_0x98af('0x9d')]){_0x2b67af=_0x18a432[_0x98af('0x9c')][_0x98af('0x9d')];}else if(_0x18a432['headers'][_0x98af('0x9e')]){_0x2b67af=_[_0x98af('0x9f')](_0x18a432[_0x98af('0x9c')]['x-forwarded-for'][_0x98af('0xa0')](','));}if(_0x428e57){var _0x4854bd={'ContactId':_0x428e57['id'],'ChatWebsiteId':_0x18a432['params']['id'],'from':(_0x428e57[_0x98af('0xa1')]||'')+'\x20'+(_0x428e57[_0x98af('0xa2')]||''),'customerIp':_0x2b67af,'customerPort':_0x18a432[_0x98af('0x9c')][_0x98af('0xa3')]?_0x18a432['headers'][_0x98af('0xa3')]:null,'referer':_0x18a432[_0x98af('0x4e')]['referer'],'browserName':_0x10ec3d['browser'][_0x98af('0x2d')]&&_0x10ec3d[_0x98af('0xa4')]['version']?util['format'](_0x98af('0xa5'),_0x10ec3d[_0x98af('0xa4')][_0x98af('0x2d')],_0x10ec3d[_0x98af('0xa4')][_0x98af('0xa6')]):_0x98af('0xa7'),'browserVersion':_0x10ec3d[_0x98af('0xa4')]['version']||_0x98af('0xa7'),'osName':util[_0x98af('0xa8')](_0x98af('0xa5'),_0x10ec3d['os'][_0x98af('0x2d')],_0x10ec3d['os'][_0x98af('0xa6')]),'osVersion':_0x10ec3d['os']['version'],'deviceModel':_0x10ec3d[_0x98af('0xa9')][_0x98af('0x3a')]&&_0x10ec3d[_0x98af('0xa9')]['vendor']?util['format']('%s\x20%s\x20%s',_0x10ec3d[_0x98af('0xa9')][_0x98af('0x3a')],_0x10ec3d[_0x98af('0xa9')][_0x98af('0xaa')],_0x10ec3d[_0x98af('0xa9')][_0x98af('0x35')]):null,'deviceVendor':_0x10ec3d[_0x98af('0xa9')]['vendor'],'deviceType':_0x10ec3d['device'][_0x98af('0x35')],'formData':JSON[_0x98af('0xab')](_0x18a432[_0x98af('0x4e')])};var _0x109aa7={'ChatWebsiteId':_0x18a432[_0x98af('0x4c')]['id'],'closed':![]};if(_0x18a432[_0x98af('0x4e')]['threadId']){_0x109aa7[_0x98af('0xac')]=_0x18a432['body'][_0x98af('0xac')];return db[_0x98af('0xad')][_0x98af('0x4d')]({'where':_0x109aa7})[_0x98af('0x15')](function(_0x2ed791){if(_0x2ed791){return[_0x2ed791,![]];}_0x4854bd['threadId']=_0x18a432[_0x98af('0x4e')]['threadId'];_0x4854bd[_0x98af('0xae')]=_0x18a432['body'][_0x98af('0xae')];return db[_0x98af('0xad')]['create'](_0x4854bd)[_0x98af('0x15')](function(_0x139ae8){return[_0x139ae8,!![]];});});}_0x109aa7[_0x98af('0xaf')]=_0x428e57['id'];if(_0x18a432[_0x98af('0x4e')][_0x98af('0xb0')]&&_0x18a432[_0x98af('0x4e')][_0x98af('0xb0')]['id']){_0x109aa7['id']=_0x18a432[_0x98af('0x4e')][_0x98af('0xb0')]['id'];return db['ChatInteraction'][_0x98af('0x4d')]({'where':_0x109aa7})['then'](function(_0x173af1){if(_0x173af1){return[_0x173af1,![]];}return db['ChatInteraction'][_0x98af('0x54')](_0x4854bd)['then'](function(_0x54e78b){return[_0x54e78b,!![]];});});}return db[_0x98af('0xad')]['create'](_0x4854bd)[_0x98af('0x15')](function(_0x32b654){return[_0x32b654,!![]];});}})['spread'](function(_0x228d6c,_0x3d2f2d){if(_0x228d6c){_0x2ff79f=_0x3d2f2d;if(!_0x3d2f2d){var _0x1d9c2d={'from':(_0x21d1ee[_0x98af('0x9a')][_0x98af('0xa1')]||'')+'\x20'+(_0x21d1ee[_0x98af('0x9a')][_0x98af('0xa2')]||'')};if(_0x18a432[_0x98af('0x4e')][_0x98af('0xac')]&&_0x18a432['body']['messageId']&&_0x18a432[_0x98af('0x4e')][_0x98af('0xac')]!=_0x18a432['body'][_0x98af('0xb1')]){_0x1d9c2d['threadId']=_0x18a432[_0x98af('0x4e')]['messageId'];}return _0x228d6c[_0x98af('0x28')](_0x1d9c2d);}else{return _0x228d6c;}}})[_0x98af('0x15')](function(_0x12dd46){_0x21d1ee[_0x98af('0xb0')]=_0x12dd46[_0x98af('0x2a')]({'plain':!![]});_0x21d1ee[_0x98af('0xb0')][_0x98af('0xb2')]=_0x2ff79f;if(_0x21d1ee[_0x98af('0xb0')][_0x98af('0xb2')]){if(_0x21d1ee[_0x98af('0x97')][_0x98af('0xb3')]){_0x21d1ee[_0x98af('0x94')]['push']({'id':0x0,'priority':_0x21d1ee['applications'][_0x98af('0x3e')]+0x1,'app':_0x98af('0xb4'),'appdata':_0x98af('0xb5'),'interval':_0x98af('0xb6')});}}return db[_0x98af('0xb7')][_0x98af('0x54')]({'body':_0x18a432[_0x98af('0x4e')][_0x98af('0x4e')],'ChatWebsiteId':_0x18a432[_0x98af('0x4c')]['id'],'ChatInteractionId':_0x12dd46['id'],'direction':'in','ContactId':_0x21d1ee['contact']['id'],'AttachmentId':_0x18a432['body']['AttachmentId']});})[_0x98af('0x15')](function(_0x5960c9){_0x21d1ee[_0x98af('0x1a')]=_0x5960c9;if(_0x21d1ee[_0x98af('0xb0')][_0x98af('0xb8')]){return db[_0x98af('0xb9')][_0x98af('0x4d')]({'attributes':['id',_0x98af('0x2d')],'where':{'id':_0x21d1ee[_0x98af('0xb0')]['UserId']}})[_0x98af('0x15')](function(_0x25e1fc){if(_0x25e1fc){_0x21d1ee[_0x98af('0x94')][_0x98af('0xba')]({'id':0x0,'priority':0x0,'app':_0x98af('0xbb'),'appdata':_0x25e1fc[_0x98af('0x2d')]+','+(_0x21d1ee[_0x98af('0x97')][_0x98af('0xbc')]||0xa),'interval':'*,*,*,*'});_0x21d1ee[_0x98af('0xbd')]=!![];}return respondWithRpcPromise(_0x98af('0xbe'),_0x98af('0xbf'),_0x21d1ee);});}return respondWithRpcPromise('Start',_0x98af('0xbf'),_0x21d1ee);})['then'](function(_0x27869c){respondWithRpcPromise('EventManager',_0x98af('0xc0'),{'event':_0x98af('0x7e'),'message':_0x27869c},client9002);return _0x27869c;})[_0x98af('0x15')](respondWithResult(_0x38e57a,null))[_0x98af('0x1d')](handleError(_0x38e57a,null));};exports[_0x98af('0xc1')]=function(_0x574be8,_0x5ac0f4){var _0x20c13a,_0x51cbcf,_0x4fbad7;var _0x536301=[];var _0x15dc20={};var _0x2045f2=_0x574be8[_0x98af('0xc2')]||[];var _0x55a55b=[];var _0x38da84;return db[_0x98af('0x82')][_0x98af('0x55')]()[_0x98af('0x15')](function(_0x2ef849){if(!_0x2ef849){throw new db['Sequelize'][(_0x98af('0x84'))](_0x98af('0x85'));}_0x536301=_[_0x98af('0x86')](_[_0x98af('0x38')](_0x2ef849),[_0x98af('0xc3'),_0x98af('0x87'),_0x98af('0x88'),_0x98af('0x98')]);if(_0x574be8[_0x98af('0x4e')]['id']){delete _0x574be8[_0x98af('0x4e')]['id'];}if(_[_0x98af('0x73')](_0x574be8['body'][_0x98af('0x99')])){throw _0x5ac0f4['status'](0x1f4)[_0x98af('0x2e')](new db['Sequelize'][(_0x98af('0x84'))](_0x98af('0x89')));}if(_[_0x98af('0x73')](_0x574be8[_0x98af('0x4e')][_0x98af('0x4e')])||_0x574be8[_0x98af('0x4e')][_0x98af('0x4e')]===''){throw _0x5ac0f4[_0x98af('0x1f')](0x1f4)[_0x98af('0x2e')](new db[(_0x98af('0x83'))]['ValidationError'](_0x98af('0xc4')));}if(_[_0x98af('0x73')](_0x574be8[_0x98af('0x4e')]['mapKeyOffline'])){throw _0x5ac0f4['status'](0x1f4)[_0x98af('0x2e')](new db[(_0x98af('0x83'))][(_0x98af('0x84'))](_0x98af('0xc5')+_0x536301));}if(!_[_0x98af('0x8b')](_0x536301,_0x574be8[_0x98af('0x4e')][_0x98af('0xc6')])){throw _0x5ac0f4[_0x98af('0x1f')](0x1f4)['send'](new db[(_0x98af('0x83'))][(_0x98af('0x84'))]('mapKeyOffline\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20'+_0x536301));}_0x15dc20[_0x574be8[_0x98af('0x4e')][_0x98af('0xc6')]]=_0x574be8[_0x98af('0x4e')][_0x98af('0x99')];})[_0x98af('0x15')](function(){return db[_0x98af('0x33')]['find']({'where':{'id':_0x574be8['params']['id']},'include':[{'model':db[_0x98af('0x8e')],'as':_0x98af('0x8f')},{'model':db[_0x98af('0xc7')],'as':_0x98af('0xc7')}]});})[_0x98af('0x15')](handleEntityNotFound(_0x5ac0f4,null))[_0x98af('0x15')](function(_0x46bf74){if(_0x46bf74&&_0x46bf74['List']){_0x51cbcf=_0x46bf74;var _0x2f6af4=_['defaults'](_0x574be8[_0x98af('0x4e')],{'firstName':_0x574be8['body']['from'],'phone':_0x574be8[_0x98af('0x4e')]['from'],'ListId':_0x46bf74[_0x98af('0x98')]});_0x2f6af4[_0x574be8[_0x98af('0x4e')][_0x98af('0xc6')]]=_0x574be8[_0x98af('0x4e')][_0x98af('0x99')];return db[_0x98af('0x82')][_0x98af('0xc8')]({'where':_0x15dc20,'defaults':_0x2f6af4});}})['spread'](function(_0x308ec5){if(_0x308ec5){_0x4fbad7=_0x308ec5;var _0x59c49f=fs[_0x98af('0xc9')](path[_0x98af('0x6d')](config['root'],'server/files/templates/chatOfflineMessage.ejs'),_0x98af('0xca'));var _0x4c9dbf=ejs[_0x98af('0xcb')](_0x59c49f,{'body':_[_0x98af('0xcc')](_0x574be8[_0x98af('0x4e')][_0x98af('0x4e')]),'bodyTitle':_0x51cbcf['offlineMessageBody']});return db[_0x98af('0xcd')]['create']({'body':_0x4c9dbf,'plainBody':htmlToText[_0x98af('0xce')](_0x4c9dbf),'ContactId':_0x308ec5['id'],'ChatWebsiteId':_0x51cbcf['id']});}})[_0x98af('0x15')](function(_0x1c10a1){_0x38da84=_0x1c10a1;if(_0x2045f2[_0x98af('0x3e')]){var _0x125501=_0x2045f2[_0x98af('0x32')](function(_0x339704){return{'name':_0x339704['originalname'],'basename':_0x339704[_0x98af('0x65')],'type':_0x339704[_0x98af('0xcf')],'ChatOfflineMessageId':_0x1c10a1['id']};});_0x55a55b=_0x125501[_0x98af('0x32')](_0x210d73=>{var _0x150e1b={'filename':_0x210d73[_0x98af('0x2d')],'path':path[_0x98af('0x6d')](config[_0x98af('0x6e')],'server','files','attachments',_0x98af('0xd0'),_0x210d73[_0x98af('0xd1')])};return _0x150e1b;});if(!_0x51cbcf[_0x98af('0xd2')]){return db[_0x98af('0xd3')]['transaction'](function(_0x343389){return db['Attachment']['bulkCreate'](_0x125501,{'transaction':_0x343389});});}}})[_0x98af('0x15')](function(){if(_0x38da84){_0x20c13a=_0x38da84;return db[_0x98af('0xc7')]['findOne']({'where':{'service':!![]},'include':[{'model':db['MailServerOut'],'as':'Smtp','raw':!![],'include':[{'model':db[_0x98af('0xd4')],'as':_0x98af('0xd4'),'raw':!![]}]}]});}})[_0x98af('0x15')](function(_0x1dda47){if(_0x1dda47&&_0x1dda47[_0x98af('0xd5')]&&_0x51cbcf[_0x98af('0xd6')]&&_0x51cbcf[_0x98af('0xd7')]){var _0x292587=_0x1dda47['getSmtpOptions']();return respondWithRpcPromise(_0x98af('0xd8'),_0x98af('0xd9'),{'account':_0x292587,'message':{'from':util['format'](_0x98af('0xda'),_0x1dda47[_0x98af('0x2d')],_0x1dda47[_0x98af('0xdb')]||_0x1dda47['Smtp']['user']),'to':_0x51cbcf['forwardOfflineAddress'],'subject':_0x51cbcf[_0x98af('0xdc')],'html':_0x20c13a[_0x98af('0x4e')],'attachments':_0x55a55b}},client9003)[_0x98af('0x15')](function(){return _0x20c13a;})[_0x98af('0x1d')](function(_0x28323b){logger[_0x98af('0x18')](_0x28323b);});}})[_0x98af('0x15')](function(){if(_0x51cbcf&&_0x51cbcf['openNewInteraction']&&_0x51cbcf[_0x98af('0xdd')]){var _0x27d761=[];if(_0x2045f2[_0x98af('0x3e')]){_0x27d761=_0x2045f2[_0x98af('0x32')](function(_0x18f03e){return{'name':_0x18f03e[_0x98af('0xde')],'basename':_0x18f03e['filename'],'type':_0x18f03e['mimetype'],'ChatOfflineMessageId':_0x38da84['id']};});}var _0x30de15;if(!_[_0x98af('0x73')](_0x51cbcf[_0x98af('0xdf')])){var _0xe9a78c=_[_0x98af('0x32')](_0x574be8[_0x98af('0x4e')],function(_0xf240f7){return _0xf240f7;});var _0x14af43=_['toPairsIn'](_0xe9a78c)[0x0];var _0x1546d5=_['mapValues'](_0x14af43,function(_0xb04e09){return _0xb04e09;});_0x30de15=_0x1546d5[0x1][_0x51cbcf['subjectOffline']];}var _0x506488={'from':_0x4fbad7[_0x98af('0xdb')],'firstName':_0x4fbad7['firstName'],'lastName':_0x4fbad7[_0x98af('0xa2')],'mapKey':_0x98af('0xdb'),'message':{'from':_0x4fbad7[_0x98af('0xdb')],'to':_0x51cbcf[_0x98af('0xc7')][_0x98af('0xdb')],'cc':'','subject':_[_0x98af('0x73')](_0x30de15)?_0x51cbcf[_0x98af('0xdc')]:_0x30de15,'messageId':'','sentAt':new Date(),'attach':_0x27d761[_0x98af('0x3e')],'attachments':_0x27d761,'originChannel':'Chat','ChatWebsiteId':_0x51cbcf['id'],'ChatOfflineMessageId':_0x20c13a['id'],'originTo':_0x51cbcf[_0x98af('0xc7')][_0x98af('0xdb')]},'body':_0x20c13a['body']};var _0xbccc61={'account':{'id':_0x51cbcf[_0x98af('0xdd')]},'body':_0x506488,'log':_0x98af('0xe0')};return respondWithRpcPromise(_0x98af('0xe0'),_0x98af('0xe1'),_0xbccc61,client9001)[_0x98af('0x15')](function(){return _0x20c13a;})[_0x98af('0x1d')](function(_0x120c07){logger[_0x98af('0x18')](_0x120c07);});}return;})[_0x98af('0x15')](function(){if(_0x20c13a){return _0x20c13a;}})['then'](respondWithResult(_0x5ac0f4,null))[_0x98af('0x1d')](function(_0x446be8){logger[_0x98af('0x18')](_0x98af('0x1d'),_0x446be8);for(var _0x2b971e of _0x2045f2){var _0xbc1106=path[_0x98af('0x6d')](config[_0x98af('0x6e')],_0x98af('0xe2'),_0x98af('0xc2'),_0x98af('0xe3'),_0x98af('0xd0'),_0x2b971e[_0x98af('0x65')]);fs_extra['remove'](_0xbc1106)[_0x98af('0x1d')](function(_0x6d9665){logger[_0x98af('0x18')](_0x98af('0xe4'),_0xbc1106,_0x6d9665);});}});};exports['addInteraction']=function(_0x4ded1c,_0x21e169){return db[_0x98af('0xad')][_0x98af('0x4d')]({'where':{'id':_0x4ded1c[_0x98af('0x4c')]['id']}})[_0x98af('0x15')](handleEntityNotFound(_0x21e169,null))[_0x98af('0x15')](function(_0x48f290){if(_0x48f290){return _0x48f290[_0x98af('0xe5')](_0x4ded1c[_0x98af('0x4e')]['ids'],_[_0x98af('0xe6')](_0x4ded1c[_0x98af('0x4e')],[_0x98af('0x5c'),'id'])||{});}})[_0x98af('0x15')](respondWithResult(_0x21e169,null))['catch'](handleError(_0x21e169,null));};exports[_0x98af('0xe7')]=function(_0x19fe23,_0x1bacc5){var _0x2f11a7={'raw':![],'where':{}};var _0x30c7ff={};var _0x46f829={'count':0x0,'rows':[]};return db['ChatWebsite'][_0x98af('0x5f')]({'where':{'id':_0x19fe23[_0x98af('0x4c')]['id']}})[_0x98af('0x15')](handleEntityNotFound(_0x1bacc5,null))[_0x98af('0x15')](function(_0x200cdf){if(_0x200cdf){_0x30c7ff['model']=_[_0x98af('0x38')](db[_0x98af('0xad')]['rawAttributes']);_0x30c7ff[_0x98af('0x37')]=_['keys'](_0x19fe23['query']);_0x30c7ff[_0x98af('0x39')]=_[_0x98af('0x3b')](_0x30c7ff['model'],_0x30c7ff[_0x98af('0x37')]);_0x2f11a7[_0x98af('0x3d')]=_[_0x98af('0x3b')](_0x30c7ff[_0x98af('0x3a')],qs['fields'](_0x19fe23[_0x98af('0x37')][_0x98af('0x3c')]));_0x2f11a7[_0x98af('0x3d')]=_0x2f11a7[_0x98af('0x3d')][_0x98af('0x3e')]?_0x2f11a7[_0x98af('0x3d')]:_0x30c7ff[_0x98af('0x3a')];if(!_0x19fe23[_0x98af('0x37')]['hasOwnProperty'](_0x98af('0x40'))){_0x2f11a7[_0x98af('0x24')]=qs['limit'](_0x19fe23[_0x98af('0x37')]['limit']);_0x2f11a7[_0x98af('0x22')]=qs[_0x98af('0x22')](_0x19fe23[_0x98af('0x37')][_0x98af('0x22')]);}_0x2f11a7[_0x98af('0x60')]=qs['sort'](_0x19fe23[_0x98af('0x37')][_0x98af('0x41')]);_0x2f11a7[_0x98af('0x42')]=qs[_0x98af('0x39')](_['pick'](_0x19fe23[_0x98af('0x37')],_0x30c7ff[_0x98af('0x39')]));_0x2f11a7[_0x98af('0x42')][_0x98af('0x57')]=_0x200cdf['id'];if(_0x19fe23['query'][_0x98af('0x44')]){_0x2f11a7['where']=_[_0x98af('0x45')](_0x2f11a7['where'],{'$or':_[_0x98af('0x32')](_0x2f11a7[_0x98af('0x3d')],function(_0x1c39d9){var _0x4c9d84={};_0x4c9d84[_0x1c39d9]={'$like':'%'+_0x19fe23[_0x98af('0x37')][_0x98af('0x44')]+'%'};return _0x4c9d84;})});}_0x2f11a7=_[_0x98af('0x45')]({},_0x2f11a7,_0x19fe23[_0x98af('0x5a')]);return db[_0x98af('0xad')]['count']({'where':_0x2f11a7[_0x98af('0x42')]})[_0x98af('0x15')](function(_0x194bd6){_0x46f829['count']=_0x194bd6;if(_0x19fe23[_0x98af('0x37')][_0x98af('0x47')]){_0x2f11a7[_0x98af('0x48')]=[{'model':db[_0x98af('0x82')],'as':_0x98af('0xe8'),'required':![]},{'model':db[_0x98af('0xb9')],'as':_0x98af('0xe9'),'attributes':['name',_0x98af('0xea'),_0x98af('0xeb')],'required':![]},{'model':db[_0x98af('0xec')],'as':_0x98af('0xed'),'attributes':['id','name',_0x98af('0xee')],'where':_0x19fe23[_0x98af('0x37')][_0x98af('0xef')]?{'id':_0x19fe23[_0x98af('0x37')][_0x98af('0xef')]}:undefined,'required':_0x19fe23['query']['tag']?!![]:![]}];}return db[_0x98af('0xad')]['findAll'](_0x2f11a7);})['then'](function(_0x2e93a2){_0x46f829['rows']=_0x2e93a2;return _0x46f829;});}})[_0x98af('0x15')](respondWithFilteredResult(_0x1bacc5,_0x2f11a7))[_0x98af('0x1d')](handleError(_0x1bacc5,null));};function iftimePromise(_0x45cef5,_0x4c561b){return respondWithRpcPromise(_0x98af('0xf0'),_0x98af('0xf1'),{'command':_0x4c561b[_0x98af('0xf2')]?util[_0x98af('0xa8')](_0x98af('0xf3'),_0x45cef5[_0x98af('0xf4')],_0x4c561b[_0x98af('0xf2')]):util[_0x98af('0xa8')](_0x98af('0xf5'),_0x45cef5[_0x98af('0xf4')])},client9002)['then'](function(_0x2bc6cb){var _0x31326a=_0x2bc6cb&&_0x2bc6cb[_0x98af('0xf6')]('true')>=0x0?!![]:![];logger['info']('[%s][INTERVAL][%s]\x20%s\x20%s\x20(%s)',_0x4c561b['id'],_0x45cef5['id'],_0x45cef5[_0x98af('0xf4')],_0x31326a?'ONLINE':_0x98af('0xf7'),_0x4c561b[_0x98af('0xf2')]?_0x4c561b[_0x98af('0xf2')]:_0x98af('0xf8'));return _0x31326a;})[_0x98af('0x1d')](function(_0xe96fcb){logger['error']('[%s][INTERVAL][%s]\x20%s\x20%s\x20(%s)',_0x4c561b['id'],_0x45cef5['id'],_0x45cef5[_0x98af('0xf4')],util[_0x98af('0xf9')](_0xe96fcb,{'showHidden':![],'depth':null}),_0x4c561b[_0x98af('0xf2')]?_0x4c561b[_0x98af('0xf2')]:_0x98af('0xf8'));return![];});}exports[_0x98af('0xf1')]=function(_0x3d78f9,_0x220e58){var _0x4b0b63=0x0;var _0x11df48=0x0;var _0x3e93a4=![];var _0x4f1346;var _0x31265b;return db['ChatWebsite']['find']({'where':{'id':_0x3d78f9[_0x98af('0x4c')]['id']},'include':[{'model':db['Interval'],'as':_0x98af('0xfa'),'include':[{'model':db[_0x98af('0xfa')],'as':_0x98af('0xfb'),'attributes':['id','interval'],'raw':!![]}]}]})[_0x98af('0x15')](handleEntityNotFound(_0x220e58,null))[_0x98af('0x15')](function(_0x15ed70){if(_0x15ed70){_0x4f1346=_0x15ed70;return _0x15ed70[_0x98af('0xfc')]({'raw':!![]});}})[_0x98af('0x15')](function(_0x182c04){if(_0x4f1346){if(_0x182c04){_0x31265b=_0x182c04;}}return require('../../config/license/util')['getLicense']();})[_0x98af('0x15')](function(_0x1f46b1){if(_0x1f46b1){_0x11df48=_0x1f46b1['virtual'];_0x3e93a4=_0x1f46b1[_0x98af('0x72')];}})[_0x98af('0x15')](function(){return db[_0x98af('0xad')][_0x98af('0x25')]({'where':{'closed':![]}});})['then'](function(_0x2d3c08){_0x4b0b63=_0x2d3c08;if(_0x11df48&&_0x2d3c08>_0x11df48){return db[_0x98af('0xfd')][_0x98af('0x5f')]({'where':{'id':0x1}})[_0x98af('0x15')](function(_0xe48b46){if(_0xe48b46){_0xe48b46[_0x98af('0xfe')]('chatLicenseExceeded');}});}})[_0x98af('0x15')](function(){if(_0x4f1346['Interval']&&_0x4f1346[_0x98af('0xfa')][_0x98af('0xfb')]){var _0x1a8942=[];for(var _0x1b711d=0x0;_0x1b711d<_0x4f1346[_0x98af('0xfa')][_0x98af('0xfb')][_0x98af('0x3e')];_0x1b711d++){var _0x262c79=_0x4f1346[_0x98af('0xfa')][_0x98af('0xfb')][_0x1b711d][_0x98af('0x2a')]({'plain':!![]});_0x1a8942[_0x98af('0xff')](iftimePromise(_0x262c79,_0x4f1346));}return BPromise[_0x98af('0x100')](_0x1a8942)[_0x98af('0x15')](function(_0x324803){return _[_0x98af('0x101')](_0x324803);});}else{return!![];}})[_0x98af('0x15')](function(_0x46cba0){var _0xbed2d1=fs['readFileSync'](path[_0x98af('0x6d')](config['root'],_0x98af('0x102')),_0x98af('0xca'));var _0x93f81e=new URL(_0x4f1346[_0x98af('0x103')])[_0x98af('0x104')];var _0x1a3257=_0x98af('0x105');var _0x2ef657=![];var _0x4296c2={'chatVersion':_0x1a3257,'chatWebsiteAddressOrigin':_0x93f81e,'remote':_0x4f1346['remote'],'query':querystring[_0x98af('0xab')](_[_0x98af('0x45')](_0x4f1346[_0x98af('0x2a')]({'plain':!![]}),{'customerIp':_0x3d78f9[_0x98af('0x9c')][_0x98af('0x9e')]||_0x3d78f9['headers']['x-real-ip']||_0x3d78f9[_0x98af('0x106')][_0x98af('0x107')]||_0x3d78f9['ip'],'referer':_0x3d78f9[_0x98af('0x9c')]['referer'],'openedInteractions':_0x4b0b63,'maxInteractions':_0x11df48,'virtual':_0x3e93a4['virtual'],'online':_0x46cba0,'custom':_0x3e93a4}))[_0x98af('0x108')](/'/g,'\x5c\x27')};_0x220e58[_0x98af('0x2e')](ejs['render'](Mustache['render'](_0xbed2d1,_0x4296c2),{'proactiveActions':_0x31265b,'alignment':_0x4f1346[_0x98af('0x109')],'verticalAlignment':_0x4f1346[_0x98af('0x10a')],'div_color':_0x4f1346[_0x98af('0xee')],'labelText':_0x4f1346['labelText'],'text_color':_0x4f1346[_0x98af('0x10b')],'text_button_color':_0x4f1346[_0x98af('0x10c')],'button_color':_0x4f1346[_0x98af('0x10d')],'background_color':_0x4f1346[_0x98af('0x10e')],'hideWhenOffline':_0x4f1346['hideWhenOffline'],'intervalId':_0x4f1346[_0x98af('0x10f')],'isDevelopment':_0x2ef657,'chatVersion':_0x1a3257}));})['catch'](handleError(_0x220e58,null));};exports[_0x98af('0x110')]=function(_0xf96560,_0x24e187){var _0x26d8ae=_0xf96560[_0x98af('0x4c')]['id'];var _0x5c803c=_0xf96560['body'];var _0x1aec67=0xc8;var _0x50bdb9=null;return db[_0x98af('0xd3')][_0x98af('0x111')]({'isolationLevel':db['sequelize'][_0x98af('0x112')][_0x98af('0x113')][_0x98af('0x114')]},function(_0x3ae736){return db['ChatWebsite']['findOne']({'where':{'id':_0x26d8ae},'transaction':_0x3ae736})[_0x98af('0x15')](function(_0x44fa43){if(_0x44fa43){return db[_0x98af('0x92')]['destroy']({'where':{'ChatWebsiteId':_0x26d8ae},'transaction':_0x3ae736})[_0x98af('0x15')](function(){var _0x2be0d8=_[_0x98af('0x32')](_0x5c803c,function(_0x128c06){_0x128c06[_0x98af('0x57')]=_0x26d8ae;return _0x128c06;});return db[_0x98af('0x92')][_0x98af('0x115')](_0x2be0d8,{'transaction':_0x3ae736});});}else{_0x1aec67=0x194;_0x50bdb9=[];}});})[_0x98af('0x15')](function(){if(_0x1aec67!==0x194){return db['ChatApplication']['findAndCountAll']({'where':{'ChatWebsiteId':_0x26d8ae},'order':_0x98af('0x116')})['then'](function(_0x30e291){_0x50bdb9=_0x30e291;});}})[_0x98af('0x1d')](function(_0x4e1b54){_0x1aec67=0x1f4;logger[_0x98af('0x18')](_0x4e1b54[_0x98af('0x117')]);if(_0x4e1b54['name']){delete _0x4e1b54[_0x98af('0x2d')];}_0x50bdb9=_0x4e1b54;})['finally'](function(){if(_0x50bdb9===null){_0x24e187[_0x98af('0x1e')](_0x1aec67);}else{if(_0x1aec67===0x1f4){_0x24e187[_0x98af('0x1f')](_0x1aec67)[_0x98af('0x2e')](_0x50bdb9);}else{_0x24e187[_0x98af('0x1f')](_0x1aec67)[_0x98af('0x21')](_0x50bdb9);}}});};exports[_0x98af('0x118')]=function(_0x5810e7,_0x3b47d1){var _0x455baa={};var _0x1a5358={};var _0x410912;var _0x46e082;return db[_0x98af('0x33')][_0x98af('0x5f')]({'where':{'id':_0x5810e7[_0x98af('0x4c')]['id']}})[_0x98af('0x15')](handleEntityNotFound(_0x3b47d1,null))['then'](function(_0x4851f0){if(_0x4851f0){_0x410912=_0x4851f0;_0x1a5358[_0x98af('0x3a')]=_[_0x98af('0x38')](db[_0x98af('0x92')]['rawAttributes']);_0x1a5358[_0x98af('0x37')]=_[_0x98af('0x38')](_0x5810e7[_0x98af('0x37')]);_0x1a5358['filters']=_['intersection'](_0x1a5358[_0x98af('0x3a')],_0x1a5358['query']);_0x455baa[_0x98af('0x3d')]=_[_0x98af('0x3b')](_0x1a5358[_0x98af('0x3a')],qs['fields'](_0x5810e7[_0x98af('0x37')][_0x98af('0x3c')]));_0x455baa[_0x98af('0x3d')]=_0x455baa[_0x98af('0x3d')]['length']?_0x455baa['attributes']:_0x1a5358[_0x98af('0x3a')];_0x455baa['order']=qs['sort'](_0x5810e7[_0x98af('0x37')][_0x98af('0x41')]);_0x455baa[_0x98af('0x42')]=qs['filters'](_['pick'](_0x5810e7[_0x98af('0x37')],_0x1a5358[_0x98af('0x39')]));if(_0x5810e7[_0x98af('0x37')][_0x98af('0x44')]){_0x455baa[_0x98af('0x42')]=_[_0x98af('0x45')](_0x455baa[_0x98af('0x42')],{'$or':_[_0x98af('0x32')](_0x455baa[_0x98af('0x3d')],function(_0x23bcd8){var _0x5c040d={};_0x5c040d[_0x23bcd8]={'$like':'%'+_0x5810e7[_0x98af('0x37')][_0x98af('0x44')]+'%'};return _0x5c040d;})});}_0x455baa=_[_0x98af('0x45')]({},_0x455baa,_0x5810e7[_0x98af('0x5a')]);return _0x410912['getApplications'](_0x455baa);}})[_0x98af('0x15')](function(_0x2fe842){if(_0x2fe842){_0x46e082=_0x2fe842[_0x98af('0x3e')];if(!_0x5810e7[_0x98af('0x37')][_0x98af('0x3f')](_0x98af('0x40'))){_0x455baa['limit']=qs['limit'](_0x5810e7['query']['limit']);_0x455baa[_0x98af('0x22')]=qs[_0x98af('0x22')](_0x5810e7[_0x98af('0x37')][_0x98af('0x22')]);}return _0x410912[_0x98af('0x118')](_0x455baa);}})[_0x98af('0x15')](function(_0x13ccc9){if(_0x13ccc9){return _0x13ccc9?{'count':_0x46e082,'rows':_0x13ccc9}:null;}})[_0x98af('0x15')](respondWithResult(_0x3b47d1,null))[_0x98af('0x1d')](handleError(_0x3b47d1,null));};exports[_0x98af('0x119')]=function(_0x29acad,_0x1c1985){return db['chatProactiveAction'][_0x98af('0x4d')]({'where':{'id':_0x29acad[_0x98af('0x4c')]['id']}})['then'](handleEntityNotFound(_0x1c1985,null))[_0x98af('0x15')](function(_0x8532fb){if(_0x8532fb){return _0x8532fb['addProactiveActions'](_0x29acad[_0x98af('0x4e')]['ids'],_['omit'](_0x29acad[_0x98af('0x4e')],[_0x98af('0x5c'),'id'])||{});}})[_0x98af('0x15')](respondWithResult(_0x1c1985,null))[_0x98af('0x1d')](handleError(_0x1c1985,null));};exports[_0x98af('0xfc')]=function(_0x25ce99,_0x58790f){var _0xd188ed={};var _0x342f27={};var _0x2fddaa;var _0x2bfcc4;return db[_0x98af('0x33')]['findOne']({'where':{'id':_0x25ce99[_0x98af('0x4c')]['id']}})['then'](handleEntityNotFound(_0x58790f,null))['then'](function(_0x3adc8f){if(_0x3adc8f){_0x2fddaa=_0x3adc8f;_0x342f27[_0x98af('0x3a')]=_['keys'](db[_0x98af('0x11a')][_0x98af('0x34')]);_0x342f27[_0x98af('0x37')]=_[_0x98af('0x38')](_0x25ce99[_0x98af('0x37')]);_0x342f27['filters']=_[_0x98af('0x3b')](_0x342f27[_0x98af('0x3a')],_0x342f27[_0x98af('0x37')]);_0xd188ed[_0x98af('0x3d')]=_[_0x98af('0x3b')](_0x342f27[_0x98af('0x3a')],qs[_0x98af('0x3c')](_0x25ce99[_0x98af('0x37')]['fields']));_0xd188ed[_0x98af('0x3d')]=_0xd188ed[_0x98af('0x3d')]['length']?_0xd188ed[_0x98af('0x3d')]:_0x342f27[_0x98af('0x3a')];_0xd188ed['order']=qs[_0x98af('0x41')](_0x25ce99[_0x98af('0x37')]['sort']);_0xd188ed[_0x98af('0x42')]=qs[_0x98af('0x39')](_[_0x98af('0x43')](_0x25ce99['query'],_0x342f27[_0x98af('0x39')]));if(_0x25ce99[_0x98af('0x37')]['filter']){_0xd188ed[_0x98af('0x42')]=_[_0x98af('0x45')](_0xd188ed['where'],{'$or':_[_0x98af('0x32')](_0xd188ed[_0x98af('0x3d')],function(_0x2ca474){var _0x110d92={};_0x110d92[_0x2ca474]={'$like':'%'+_0x25ce99[_0x98af('0x37')]['filter']+'%'};return _0x110d92;})});}_0xd188ed=_[_0x98af('0x45')]({},_0xd188ed,_0x25ce99['options']);return _0x2fddaa['getProactiveActions'](_0xd188ed);}})[_0x98af('0x15')](function(_0x13ad68){if(_0x13ad68){_0x2bfcc4=_0x13ad68[_0x98af('0x3e')];if(!_0x25ce99['query']['hasOwnProperty']('nolimit')){_0xd188ed[_0x98af('0x24')]=qs[_0x98af('0x24')](_0x25ce99[_0x98af('0x37')][_0x98af('0x24')]);_0xd188ed['offset']=qs[_0x98af('0x22')](_0x25ce99[_0x98af('0x37')][_0x98af('0x22')]);}return _0x2fddaa[_0x98af('0xfc')](_0xd188ed);}})[_0x98af('0x15')](function(_0x177a03){if(_0x177a03){return _0x177a03?{'count':_0x2bfcc4,'rows':_0x177a03}:null;}})['then'](respondWithResult(_0x58790f,null))[_0x98af('0x1d')](handleError(_0x58790f,null));};exports[_0x98af('0x11b')]=function(_0x172a32,_0x4ed7ce){var _0x2c461b=_0x172a32[_0x98af('0x37')][_0x98af('0x11c')]===_0x98af('0x11d')?'offlineForm':_0x98af('0x11e');return db[_0x98af('0x33')][_0x98af('0x4d')]({'attributes':['id',_0x2c461b],'where':{'id':_0x172a32[_0x98af('0x4c')]['id']}})[_0x98af('0x15')](handleEntityNotFound(_0x4ed7ce,null))[_0x98af('0x15')](function(_0x99f006){if(_0x99f006){var _0x676dd1=_0x99f006[_0x2c461b];var _0x103bf2=_0x676dd1&&_0x676dd1['items']?_0x676dd1[_0x98af('0x11f')]:[];_0x4ed7ce['send']({'fromKey':_[_0x98af('0x73')](_0x676dd1[_0x98af('0x120')])?undefined:_0x676dd1[_0x98af('0x120')],'count':_0x103bf2[_0x98af('0x3e')],'rows':_0x103bf2});}})[_0x98af('0x1d')](handleError(_0x4ed7ce,null));};exports[_0x98af('0x121')]=function(_0x39a53b,_0x3b76a1){var _0x125c1f={'raw':![],'where':{}};var _0x335eb2={};var _0x236ee0={'count':0x0,'rows':[]};return db[_0x98af('0x33')][_0x98af('0x5f')]({'where':{'id':_0x39a53b[_0x98af('0x4c')]['id']}})[_0x98af('0x15')](handleEntityNotFound(_0x3b76a1,null))['then'](function(_0x467244){if(_0x467244){_0x335eb2[_0x98af('0x3a')]=_['keys'](db[_0x98af('0xcd')][_0x98af('0x34')]);_0x335eb2[_0x98af('0x37')]=_[_0x98af('0x38')](_0x39a53b[_0x98af('0x37')]);_0x335eb2['filters']=_[_0x98af('0x3b')](_0x335eb2[_0x98af('0x3a')],_0x335eb2[_0x98af('0x37')]);_0x125c1f[_0x98af('0x3d')]=_['intersection'](_0x335eb2['model'],qs['fields'](_0x39a53b['query'][_0x98af('0x3c')]));_0x125c1f[_0x98af('0x3d')]=_0x125c1f[_0x98af('0x3d')][_0x98af('0x3e')]?_0x125c1f['attributes']:_0x335eb2['model'];if(!_0x39a53b[_0x98af('0x37')][_0x98af('0x3f')](_0x98af('0x40'))){_0x125c1f['limit']=qs['limit'](_0x39a53b[_0x98af('0x37')][_0x98af('0x24')]);_0x125c1f[_0x98af('0x22')]=qs[_0x98af('0x22')](_0x39a53b['query'][_0x98af('0x22')]);}_0x125c1f[_0x98af('0x60')]=qs[_0x98af('0x41')](_0x39a53b[_0x98af('0x37')]['sort']);_0x125c1f['where']=qs[_0x98af('0x39')](_[_0x98af('0x43')](_0x39a53b['query'],_0x335eb2[_0x98af('0x39')]));_0x125c1f[_0x98af('0x42')][_0x98af('0x57')]=_0x467244['id'];if(_0x39a53b[_0x98af('0x37')][_0x98af('0x44')]){_0x125c1f[_0x98af('0x42')]=_['merge'](_0x125c1f[_0x98af('0x42')],{'$or':_[_0x98af('0x32')](_0x125c1f[_0x98af('0x3d')],function(_0x173666){var _0x39d6af={};_0x39d6af[_0x173666]={'$like':'%'+_0x39a53b['query'][_0x98af('0x44')]+'%'};return _0x39d6af;})});}_0x125c1f=_[_0x98af('0x45')]({},_0x125c1f,_0x39a53b[_0x98af('0x5a')]);return db[_0x98af('0xcd')]['count']({'where':_0x125c1f['where']})['then'](function(_0x711f5f){_0x236ee0['count']=_0x711f5f;if(_0x39a53b[_0x98af('0x37')][_0x98af('0x47')]){_0x125c1f[_0x98af('0x48')]=[{'all':!![]}];}else{_0x125c1f['include']=[{'model':db['CmContact'],'as':_0x98af('0xe8'),'required':![]},{'model':db[_0x98af('0x122')],'as':_0x98af('0x123'),'required':![]}];}return db[_0x98af('0xcd')][_0x98af('0x49')](_0x125c1f);})[_0x98af('0x15')](function(_0x452b2c){_0x236ee0[_0x98af('0x4a')]=_0x452b2c;return _0x236ee0;});}})[_0x98af('0x15')](respondWithFilteredResult(_0x3b76a1,_0x125c1f))[_0x98af('0x1d')](handleError(_0x3b76a1,null));};exports[_0x98af('0x124')]=function(_0x983fad,_0x1f7832){return db[_0x98af('0x33')][_0x98af('0x4d')]({'where':{'id':_0x983fad[_0x98af('0x4c')]['id']}})[_0x98af('0x15')](handleEntityNotFound(_0x1f7832,null))[_0x98af('0x15')](function(_0x43bfbe){if(_0x43bfbe){return _0x43bfbe[_0x98af('0x124')](_0x983fad[_0x98af('0x4e')][_0x98af('0x5c')],_[_0x98af('0xe6')](_0x983fad[_0x98af('0x4e')],[_0x98af('0x5c'),'id'])||{})[_0x98af('0x125')](function(_0x1f1a32){for(var _0x29dae4=0x0;_0x29dae4<_0x983fad[_0x98af('0x4e')][_0x98af('0x5c')][_0x98af('0x3e')];_0x29dae4+=0x1){socket[_0x98af('0x126')](_0x98af('0x127'),{'UserId':Number(_0x983fad[_0x98af('0x4e')][_0x98af('0x5c')][_0x29dae4]),'ChatWebsiteId':Number(_0x983fad[_0x98af('0x4c')]['id'])});}return _0x1f1a32;});}})[_0x98af('0x15')](respondWithResult(_0x1f7832,null))['catch'](handleError(_0x1f7832,null));};exports['removeAgents']=function(_0x5a19d7,_0x3af7f8){return db['ChatWebsite'][_0x98af('0x4d')]({'where':{'id':_0x5a19d7['params']['id']}})[_0x98af('0x15')](handleEntityNotFound(_0x3af7f8,null))[_0x98af('0x15')](function(_0x362283){if(_0x362283){return _0x362283['removeAgents'](_0x5a19d7['query']['ids'])[_0x98af('0x15')](function(){if(_['isArray'](_0x5a19d7['query'][_0x98af('0x5c')])){for(var _0x3e967e=0x0;_0x3e967e<_0x5a19d7[_0x98af('0x37')][_0x98af('0x5c')][_0x98af('0x3e')];_0x3e967e+=0x1){socket['emit'](_0x98af('0x128'),{'UserId':Number(_0x5a19d7['query']['ids'][_0x3e967e]),'ChatWebsiteId':Number(_0x5a19d7['params']['id'])});}}else{socket[_0x98af('0x126')](_0x98af('0x128'),{'UserId':Number(_0x5a19d7[_0x98af('0x37')]['ids']),'ChatWebsiteId':Number(_0x5a19d7[_0x98af('0x4c')]['id'])});}});}})[_0x98af('0x15')](respondWithStatusCode(_0x3af7f8,null))['catch'](handleError(_0x3af7f8,null));};exports['getAgents']=function(_0x5af45b,_0x23d3fc){var _0xfa0f1a={};var _0x476588={};var _0x105aed;var _0x5620ed;return db['ChatWebsite'][_0x98af('0x5f')]({'where':{'id':_0x5af45b[_0x98af('0x4c')]['id']}})[_0x98af('0x15')](handleEntityNotFound(_0x23d3fc,null))[_0x98af('0x15')](function(_0x23658f){if(_0x23658f){_0x105aed=_0x23658f;_0x476588['model']=_['keys'](db[_0x98af('0xb9')][_0x98af('0x34')]);_0x476588[_0x98af('0x37')]=_['keys'](_0x5af45b[_0x98af('0x37')]);_0x476588['filters']=_['intersection'](_0x476588['model'],_0x476588[_0x98af('0x37')]);_0xfa0f1a[_0x98af('0x3d')]=_[_0x98af('0x3b')](_0x476588['model'],qs[_0x98af('0x3c')](_0x5af45b[_0x98af('0x37')]['fields']));_0xfa0f1a[_0x98af('0x3d')]=_0xfa0f1a[_0x98af('0x3d')][_0x98af('0x3e')]?_0xfa0f1a[_0x98af('0x3d')]:_0x476588[_0x98af('0x3a')];_0xfa0f1a[_0x98af('0x60')]=qs['sort'](_0x5af45b[_0x98af('0x37')]['sort']);_0xfa0f1a[_0x98af('0x42')]=qs['filters'](_[_0x98af('0x43')](_0x5af45b[_0x98af('0x37')],_0x476588['filters']));if(_0x5af45b['query']['filter']){_0xfa0f1a[_0x98af('0x42')]=_[_0x98af('0x45')](_0xfa0f1a[_0x98af('0x42')],{'$or':_[_0x98af('0x32')](_0xfa0f1a[_0x98af('0x3d')],function(_0x162a37){var _0x332c05={};_0x332c05[_0x162a37]={'$like':'%'+_0x5af45b[_0x98af('0x37')]['filter']+'%'};return _0x332c05;})});}_0xfa0f1a=_['merge']({},_0xfa0f1a,_0x5af45b['options']);return _0x105aed[_0x98af('0x129')](_0xfa0f1a);}})['then'](function(_0x16e53f){if(_0x16e53f){_0x5620ed=_0x16e53f[_0x98af('0x3e')];if(!_0x5af45b[_0x98af('0x37')][_0x98af('0x3f')](_0x98af('0x40'))){_0xfa0f1a[_0x98af('0x24')]=qs['limit'](_0x5af45b[_0x98af('0x37')][_0x98af('0x24')]);_0xfa0f1a[_0x98af('0x22')]=qs['offset'](_0x5af45b[_0x98af('0x37')][_0x98af('0x22')]);}return _0x105aed['getAgents'](_0xfa0f1a);}})['then'](function(_0x45cb85){if(_0x45cb85){return _0x45cb85?{'count':_0x5620ed,'rows':_0x45cb85}:null;}})[_0x98af('0x15')](respondWithResult(_0x23d3fc,null))[_0x98af('0x1d')](handleError(_0x23d3fc,null));};
\ No newline at end of file
diff --git a/server/api/chatWebsite/chatWebsite.events.js b/server/api/chatWebsite/chatWebsite.events.js
index 6dc3993..3fc5062 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 _0x5eb8=['exports','../../mysqldb','ChatWebsite','update','remove','emit','hasOwnProperty','hook'];(function(_0x21a9d9,_0x4d5ac8){var _0x46adce=function(_0xfdd336){while(--_0xfdd336){_0x21a9d9['push'](_0x21a9d9['shift']());}};_0x46adce(++_0x4d5ac8);}(_0x5eb8,0x1d1));var _0x85eb=function(_0xd1c39b,_0x16f0c6){_0xd1c39b=_0xd1c39b-0x0;var _0x58f5bc=_0x5eb8[_0xd1c39b];return _0x58f5bc;};'use strict';var EventEmitter=require('events');var ChatWebsite=require(_0x85eb('0x0'))['db'][_0x85eb('0x1')];var ChatWebsiteEvents=new EventEmitter();ChatWebsiteEvents['setMaxListeners'](0x0);var events={'afterCreate':'save','afterUpdate':_0x85eb('0x2'),'afterDestroy':_0x85eb('0x3')};function emitEvent(_0x4aa372){return function(_0x41b11e,_0x30ac6a,_0x3174ce){ChatWebsiteEvents[_0x85eb('0x4')](_0x4aa372+':'+_0x41b11e['id'],_0x41b11e);ChatWebsiteEvents['emit'](_0x4aa372,_0x41b11e);_0x3174ce(null);};}for(var e in events){if(events[_0x85eb('0x5')](e)){var event=events[e];ChatWebsite[_0x85eb('0x6')](e,emitEvent(event));}}module[_0x85eb('0x7')]=ChatWebsiteEvents;
\ No newline at end of file
+var _0x9a22=['save','update','remove','emit','hasOwnProperty','hook','exports','events','../../mysqldb','ChatWebsite','setMaxListeners'];(function(_0x1ec938,_0x109d26){var _0x220f91=function(_0x413cf5){while(--_0x413cf5){_0x1ec938['push'](_0x1ec938['shift']());}};_0x220f91(++_0x109d26);}(_0x9a22,0x75));var _0x29a2=function(_0x6c993a,_0x5ea3ab){_0x6c993a=_0x6c993a-0x0;var _0x27f547=_0x9a22[_0x6c993a];return _0x27f547;};'use strict';var EventEmitter=require(_0x29a2('0x0'));var ChatWebsite=require(_0x29a2('0x1'))['db'][_0x29a2('0x2')];var ChatWebsiteEvents=new EventEmitter();ChatWebsiteEvents[_0x29a2('0x3')](0x0);var events={'afterCreate':_0x29a2('0x4'),'afterUpdate':_0x29a2('0x5'),'afterDestroy':_0x29a2('0x6')};function emitEvent(_0x4cbd7e){return function(_0x4e617e,_0x427d51,_0x2855c8){ChatWebsiteEvents[_0x29a2('0x7')](_0x4cbd7e+':'+_0x4e617e['id'],_0x4e617e);ChatWebsiteEvents[_0x29a2('0x7')](_0x4cbd7e,_0x4e617e);_0x2855c8(null);};}for(var e in events){if(events[_0x29a2('0x8')](e)){var event=events[e];ChatWebsite[_0x29a2('0x9')](e,emitEvent(event));}}module[_0x29a2('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 0a72a6d..134ea35 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 _0x5930=['api','moment','bluebird','request-promise','../../config/environment','./chatWebsite.attributes','exports','define','lodash'];(function(_0x117260,_0x14e08f){var _0x4d32f7=function(_0x1c5446){while(--_0x1c5446){_0x117260['push'](_0x117260['shift']());}};_0x4d32f7(++_0x14e08f);}(_0x5930,0x1af));var _0x0593=function(_0x5ad8dd,_0x27ec37){_0x5ad8dd=_0x5ad8dd-0x0;var _0x51d484=_0x5930[_0x5ad8dd];return _0x51d484;};'use strict';var _=require(_0x0593('0x0'));var util=require('util');var logger=require('../../config/logger')(_0x0593('0x1'));var moment=require(_0x0593('0x2'));var BPromise=require(_0x0593('0x3'));var rp=require(_0x0593('0x4'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x0593('0x5'));var attributes=require(_0x0593('0x6'));module[_0x0593('0x7')]=function(_0x3e070a,_0x1bf28b){return _0x3e070a[_0x0593('0x8')]('ChatWebsite',attributes,{'tableName':'chat_websites','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x7eeb=['moment','path','../../config/environment','./chatWebsite.attributes','define','ChatWebsite','util','../../config/logger','api'];(function(_0x315109,_0x447bfb){var _0x8c20ee=function(_0x2284a9){while(--_0x2284a9){_0x315109['push'](_0x315109['shift']());}};_0x8c20ee(++_0x447bfb);}(_0x7eeb,0x1d1));var _0xb7ee=function(_0x58b6d8,_0x3f3cb1){_0x58b6d8=_0x58b6d8-0x0;var _0x928a75=_0x7eeb[_0x58b6d8];return _0x928a75;};'use strict';var _=require('lodash');var util=require(_0xb7ee('0x0'));var logger=require(_0xb7ee('0x1'))(_0xb7ee('0x2'));var moment=require(_0xb7ee('0x3'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0xb7ee('0x4'));var rimraf=require('rimraf');var config=require(_0xb7ee('0x5'));var attributes=require(_0xb7ee('0x6'));module['exports']=function(_0x416583,_0x49e287){return _0x416583[_0xb7ee('0x7')](_0xb7ee('0x8'),attributes,{'tableName':'chat_websites','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
diff --git a/server/api/chatWebsite/chatWebsite.rpc.js b/server/api/chatWebsite/chatWebsite.rpc.js
index 66900d5..f028acd 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 _0x511d=['request\x20sent','debug','ChatWebsite,\x20%s,\x20%s,\x20%s','stringify','error','message','ChatWebsite,\x20%s,\x20%s','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','http','redis','socket.io-emitter','./chatWebsite.socket','request','then','info'];(function(_0x5671c9,_0x15f47e){var _0x24c8de=function(_0x533836){while(--_0x533836){_0x5671c9['push'](_0x5671c9['shift']());}};_0x24c8de(++_0x15f47e);}(_0x511d,0x165));var _0xd511=function(_0x53ccf2,_0x13cb67){_0x53ccf2=_0x53ccf2-0x0;var _0x5a2964=_0x511d[_0x53ccf2];return _0x5a2964;};'use strict';var _=require(_0xd511('0x0'));var util=require(_0xd511('0x1'));var moment=require(_0xd511('0x2'));var BPromise=require(_0xd511('0x3'));var rs=require(_0xd511('0x4'));var fs=require('fs');var Redis=require(_0xd511('0x5'));var db=require(_0xd511('0x6'))['db'];var utils=require(_0xd511('0x7'));var logger=require(_0xd511('0x8'))(_0xd511('0x9'));var config=require(_0xd511('0xa'));var jayson=require('jayson/promise');var client=jayson['client'][_0xd511('0xb')]({'port':0x232a});config[_0xd511('0xc')]=_['defaults'](config[_0xd511('0xc')],{'host':'localhost','port':0x18eb});var socket=require(_0xd511('0xd'))(new Redis(config[_0xd511('0xc')]));require(_0xd511('0xe'))['register'](socket);function respondWithRpcPromise(_0x515808,_0x24112d,_0x14758e){return new BPromise(function(_0x56b990,_0x279e05){return client[_0xd511('0xf')](_0x515808,_0x14758e)[_0xd511('0x10')](function(_0x5181cd){logger[_0xd511('0x11')]('ChatWebsite,\x20%s,\x20%s',_0x24112d,_0xd511('0x12'));logger[_0xd511('0x13')](_0xd511('0x14'),_0x24112d,'request\x20sent',JSON[_0xd511('0x15')](_0x5181cd));if(_0x5181cd[_0xd511('0x16')]){if(_0x5181cd[_0xd511('0x16')]['code']===0x1f4){logger[_0xd511('0x16')]('ChatWebsite,\x20%s,\x20%s',_0x24112d,_0x5181cd[_0xd511('0x16')]['message']);return _0x279e05(_0x5181cd[_0xd511('0x16')][_0xd511('0x17')]);}logger['error'](_0xd511('0x18'),_0x24112d,_0x5181cd['error']['message']);return _0x56b990(_0x5181cd['error'][_0xd511('0x17')]);}else{logger[_0xd511('0x11')](_0xd511('0x18'),_0x24112d,'request\x20sent');_0x56b990(_0x5181cd['result'][_0xd511('0x17')]);}})['catch'](function(_0xd9daae){logger[_0xd511('0x16')](_0xd511('0x18'),_0x24112d,_0xd9daae);_0x279e05(_0xd9daae);});});}
\ No newline at end of file
+var _0x51cf=['client','http','redis','defaults','localhost','./chatWebsite.socket','request','then','info','ChatWebsite,\x20%s,\x20%s','request\x20sent','debug','ChatWebsite,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise'];(function(_0x27cba8,_0x14f174){var _0x1b0776=function(_0x5848bf){while(--_0x5848bf){_0x27cba8['push'](_0x27cba8['shift']());}};_0x1b0776(++_0x14f174);}(_0x51cf,0x15d));var _0xf51c=function(_0x2f42ec,_0x5ddc9d){_0x2f42ec=_0x2f42ec-0x0;var _0x26ed3e=_0x51cf[_0x2f42ec];return _0x26ed3e;};'use strict';var _=require(_0xf51c('0x0'));var util=require(_0xf51c('0x1'));var moment=require(_0xf51c('0x2'));var BPromise=require(_0xf51c('0x3'));var rs=require(_0xf51c('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xf51c('0x5'))['db'];var utils=require(_0xf51c('0x6'));var logger=require(_0xf51c('0x7'))(_0xf51c('0x8'));var config=require(_0xf51c('0x9'));var jayson=require(_0xf51c('0xa'));var client=jayson[_0xf51c('0xb')][_0xf51c('0xc')]({'port':0x232a});config[_0xf51c('0xd')]=_[_0xf51c('0xe')](config[_0xf51c('0xd')],{'host':_0xf51c('0xf'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0xf51c('0x10'))['register'](socket);function respondWithRpcPromise(_0x2898b,_0x1b770e,_0xb86791){return new BPromise(function(_0x2bd6a9,_0x2e31bc){return client[_0xf51c('0x11')](_0x2898b,_0xb86791)[_0xf51c('0x12')](function(_0x5b3d9d){logger[_0xf51c('0x13')](_0xf51c('0x14'),_0x1b770e,_0xf51c('0x15'));logger[_0xf51c('0x16')](_0xf51c('0x17'),_0x1b770e,_0xf51c('0x15'),JSON[_0xf51c('0x18')](_0x5b3d9d));if(_0x5b3d9d[_0xf51c('0x19')]){if(_0x5b3d9d['error'][_0xf51c('0x1a')]===0x1f4){logger[_0xf51c('0x19')](_0xf51c('0x14'),_0x1b770e,_0x5b3d9d[_0xf51c('0x19')][_0xf51c('0x1b')]);return _0x2e31bc(_0x5b3d9d[_0xf51c('0x19')][_0xf51c('0x1b')]);}logger[_0xf51c('0x19')](_0xf51c('0x14'),_0x1b770e,_0x5b3d9d[_0xf51c('0x19')][_0xf51c('0x1b')]);return _0x2bd6a9(_0x5b3d9d['error']['message']);}else{logger[_0xf51c('0x13')](_0xf51c('0x14'),_0x1b770e,_0xf51c('0x15'));_0x2bd6a9(_0x5b3d9d[_0xf51c('0x1c')][_0xf51c('0x1b')]);}})[_0xf51c('0x1d')](function(_0x6621a9){logger[_0xf51c('0x19')](_0xf51c('0x14'),_0x1b770e,_0x6621a9);_0x2e31bc(_0x6621a9);});});}
\ No newline at end of file
diff --git a/server/api/chatWebsite/chatWebsite.socket.js b/server/api/chatWebsite/chatWebsite.socket.js
index 67049ce..9b2ac41 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 _0x48f8=['remove','update','emit','removeListener','length','chatWebsite:','./chatWebsite.events'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x48f8,0x15d));var _0x848f=function(_0x2b58d4,_0x2685bd){_0x2b58d4=_0x2b58d4-0x0;var _0x148fcd=_0x48f8[_0x2b58d4];return _0x148fcd;};'use strict';var ChatWebsiteEvents=require(_0x848f('0x0'));var events=['save',_0x848f('0x1'),_0x848f('0x2')];function createListener(_0x4536f8,_0x1c30e8){return function(_0x1da110){_0x1c30e8[_0x848f('0x3')](_0x4536f8,_0x1da110);};}function removeListener(_0x43aeea,_0x16e587){return function(){ChatWebsiteEvents[_0x848f('0x4')](_0x43aeea,_0x16e587);};}exports['register']=function(_0x61d051){for(var _0x3a8a27=0x0,_0x104d96=events[_0x848f('0x5')];_0x3a8a27<_0x104d96;_0x3a8a27++){var _0x4e6e01=events[_0x3a8a27];var _0x16188f=createListener(_0x848f('0x6')+_0x4e6e01,_0x61d051);ChatWebsiteEvents['on'](_0x4e6e01,_0x16188f);}};
\ No newline at end of file
+var _0x5533=['chatWebsite:','./chatWebsite.events','save','remove','update','emit','removeListener','register','length'];(function(_0x2afbb0,_0x44f16d){var _0x411ff2=function(_0x5edd7e){while(--_0x5edd7e){_0x2afbb0['push'](_0x2afbb0['shift']());}};_0x411ff2(++_0x44f16d);}(_0x5533,0x1d5));var _0x3553=function(_0x46c223,_0x5119b0){_0x46c223=_0x46c223-0x0;var _0x44d9f3=_0x5533[_0x46c223];return _0x44d9f3;};'use strict';var ChatWebsiteEvents=require(_0x3553('0x0'));var events=[_0x3553('0x1'),_0x3553('0x2'),_0x3553('0x3')];function createListener(_0x4b9945,_0xbb9b4){return function(_0x344262){_0xbb9b4[_0x3553('0x4')](_0x4b9945,_0x344262);};}function removeListener(_0x55d782,_0x3b8bdb){return function(){ChatWebsiteEvents[_0x3553('0x5')](_0x55d782,_0x3b8bdb);};}exports[_0x3553('0x6')]=function(_0x1d1613){for(var _0x994635=0x0,_0x3c04c1=events[_0x3553('0x7')];_0x994635<_0x3c04c1;_0x994635++){var _0x30326c=events[_0x994635];var _0x3aa311=createListener(_0x3553('0x8')+_0x30326c,_0x1d1613);ChatWebsiteEvents['on'](_0x30326c,_0x3aa311);}};
\ No newline at end of file
diff --git a/server/api/chatWebsite/index.js b/server/api/chatWebsite/index.js
index 5470ac7..2673a54 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 _0xa61b=['/:id/dispositions','getDispositions','/:id/logo','getLogo','/:id/avatar','getAvatar','/:id/customer_avatar','getSystemAvatar','/:id/interactions','/:id/snippet','getSnippet','/:id/applications','getApplications','/:id/proactive_actions','/:id/fields','getFields','/:id/offline_messages','getOfflineMessages','/:id/users','create','post','addDisposition','diskStorage','root','format','now','originalname','single','file','addLogo','server/files/images/avatars/','%s-%s','addAvatar','join','/:id/system_avatar','addSystemAvatar','/:id/notify','notify','attachments','ensureDir','replace','extname','/:id/offline','any','offline','addInteraction','addApplications','addAgents','put','delete','destroy','removeDispositions','/:id/canned_answers','removeAnswers','removeAgents','exports','multer','util','path','express','Router','fs-extra','../../components/interaction/service','../../config/environment','./chatWebsite.controller','get','isAuthenticated','index','/describe','describe','/:id','show'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0xa61b,0x1e8));var _0xba61=function(_0x9d2283,_0x451e89){_0x9d2283=_0x9d2283-0x0;var _0x1466d9=_0xa61b[_0x9d2283];return _0x1466d9;};'use strict';var multer=require(_0xba61('0x0'));var util=require(_0xba61('0x1'));var path=require(_0xba61('0x2'));var timeout=require('connect-timeout');var express=require(_0xba61('0x3'));var router=express[_0xba61('0x4')]();var fs_extra=require(_0xba61('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0xba61('0x6'));var config=require(_0xba61('0x7'));var controller=require(_0xba61('0x8'));router[_0xba61('0x9')]('/',auth[_0xba61('0xa')](),controller[_0xba61('0xb')]);router[_0xba61('0x9')](_0xba61('0xc'),auth['isAuthenticated'](),controller[_0xba61('0xd')]);router[_0xba61('0x9')](_0xba61('0xe'),auth[_0xba61('0xa')](),controller[_0xba61('0xf')]);router['get'](_0xba61('0x10'),auth[_0xba61('0xa')](),controller[_0xba61('0x11')]);router[_0xba61('0x9')]('/:id/canned_answers',auth['isAuthenticated'](),controller['getAnswers']);router[_0xba61('0x9')](_0xba61('0x12'),controller[_0xba61('0x13')]);router['get'](_0xba61('0x14'),controller[_0xba61('0x15')]);router['get'](_0xba61('0x16'),controller['getCustomerAvatar']);router[_0xba61('0x9')]('/:id/system_avatar',controller[_0xba61('0x17')]);router[_0xba61('0x9')](_0xba61('0x18'),auth[_0xba61('0xa')](),controller['getInteractions']);router[_0xba61('0x9')](_0xba61('0x19'),controller[_0xba61('0x1a')]);router[_0xba61('0x9')](_0xba61('0x1b'),auth[_0xba61('0xa')](),controller[_0xba61('0x1c')]);router[_0xba61('0x9')](_0xba61('0x1d'),auth[_0xba61('0xa')](),controller['getProactiveActions']);router[_0xba61('0x9')](_0xba61('0x1e'),controller[_0xba61('0x1f')]);router[_0xba61('0x9')](_0xba61('0x20'),auth[_0xba61('0xa')](),controller[_0xba61('0x21')]);router[_0xba61('0x9')](_0xba61('0x22'),auth[_0xba61('0xa')](),controller['getAgents']);router['post']('/',auth['isAuthenticated'](),controller[_0xba61('0x23')]);router[_0xba61('0x24')](_0xba61('0x10'),auth[_0xba61('0xa')](),controller[_0xba61('0x25')]);router[_0xba61('0x24')]('/:id/canned_answers',auth[_0xba61('0xa')](),controller['addAnswer']);var upload=multer({'storage':multer[_0xba61('0x26')]({'destination':function(_0x482c12,_0x2a5808,_0x2a5965){_0x2a5965(null,path['join'](config[_0xba61('0x27')],'server/files/images/logos/'));},'filename':function(_0x176eee,_0x5e306c,_0x591dc9){_0x591dc9(null,util[_0xba61('0x28')]('%s-%s',Date[_0xba61('0x29')](),_0x5e306c[_0xba61('0x2a')]));}})});router['post'](_0xba61('0x12'),upload[_0xba61('0x2b')](_0xba61('0x2c')),controller[_0xba61('0x2d')]);var upload=multer({'storage':multer[_0xba61('0x26')]({'destination':function(_0x393cb0,_0x128d0a,_0x37d8a7){_0x37d8a7(null,path['join'](config[_0xba61('0x27')],_0xba61('0x2e')));},'filename':function(_0x288d6d,_0x1960db,_0x4a16ea){_0x4a16ea(null,util['format'](_0xba61('0x2f'),Date[_0xba61('0x29')](),_0x1960db['originalname']));}})});router[_0xba61('0x24')](_0xba61('0x14'),upload[_0xba61('0x2b')](_0xba61('0x2c')),controller[_0xba61('0x30')]);var upload=multer({'storage':multer[_0xba61('0x26')]({'destination':function(_0x3e0fbc,_0x426d16,_0x4c025b){_0x4c025b(null,path[_0xba61('0x31')](config[_0xba61('0x27')],_0xba61('0x2e')));},'filename':function(_0x8ae8e3,_0x3a4875,_0x5a8308){_0x5a8308(null,util[_0xba61('0x28')](_0xba61('0x2f'),Date[_0xba61('0x29')](),_0x3a4875['originalname']));}})});router[_0xba61('0x24')](_0xba61('0x16'),upload[_0xba61('0x2b')](_0xba61('0x2c')),controller['addCustomerAvatar']);var upload=multer({'storage':multer[_0xba61('0x26')]({'destination':function(_0x14c672,_0x43d810,_0x515904){_0x515904(null,path['join'](config[_0xba61('0x27')],_0xba61('0x2e')));},'filename':function(_0x76816f,_0x307938,_0x12c2d9){_0x12c2d9(null,util[_0xba61('0x28')](_0xba61('0x2f'),Date[_0xba61('0x29')](),_0x307938[_0xba61('0x2a')]));}})});router[_0xba61('0x24')](_0xba61('0x32'),upload[_0xba61('0x2b')]('file'),controller[_0xba61('0x33')]);router[_0xba61('0x24')](_0xba61('0x34'),controller[_0xba61('0x35')]);const offlineUploadMulter=multer({'storage':multer[_0xba61('0x26')]({'destination':function(_0x48a265,_0x19b0d4,_0x353cd0){const _0xad53a1=path['join'](config[_0xba61('0x27')],'server/files',_0xba61('0x36'),'offline-chat');fs_extra[_0xba61('0x37')](_0xad53a1,function(){_0x353cd0(null,_0xad53a1);});},'filename':function(_0x5ab8bb,_0x39d21a,_0x461cfe){const _0x3d0471=_0x39d21a[_0xba61('0x2a')][_0xba61('0x38')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');const _0x1ac680=path[_0xba61('0x39')](_0x3d0471);const _0x32f431=Date[_0xba61('0x29')]()+'-'+_0x3d0471[_0xba61('0x38')](_0x1ac680,'')+_0x1ac680;_0x461cfe(null,_0x32f431);}})});router[_0xba61('0x24')](_0xba61('0x3a'),offlineUploadMulter[_0xba61('0x3b')](),controller[_0xba61('0x3c')]);router[_0xba61('0x24')]('/:id/interactions',auth[_0xba61('0xa')](),controller[_0xba61('0x3d')]);router[_0xba61('0x24')](_0xba61('0x1b'),auth[_0xba61('0xa')](),controller[_0xba61('0x3e')]);router[_0xba61('0x24')](_0xba61('0x1d'),auth[_0xba61('0xa')](),controller['addProactiveActions']);router['post'](_0xba61('0x22'),auth[_0xba61('0xa')](),controller[_0xba61('0x3f')]);router[_0xba61('0x40')](_0xba61('0xe'),auth[_0xba61('0xa')](),controller['update']);router[_0xba61('0x41')](_0xba61('0xe'),auth['isAuthenticated'](),controller[_0xba61('0x42')]);router['delete'](_0xba61('0x10'),auth[_0xba61('0xa')](),controller[_0xba61('0x43')]);router[_0xba61('0x41')](_0xba61('0x44'),auth[_0xba61('0xa')](),controller[_0xba61('0x45')]);router[_0xba61('0x41')](_0xba61('0x22'),auth[_0xba61('0xa')](),controller[_0xba61('0x46')]);module[_0xba61('0x47')]=router;
\ No newline at end of file
+var _0xb507=['/:id/interactions','getApplications','/:id/proactive_actions','getProactiveActions','/:id/fields','/:id/users','post','create','/:id/dispositions','addDisposition','addAnswer','diskStorage','join','root','server/files/images/logos/','format','%s-%s','now','single','file','addLogo','server/files/images/avatars/','originalname','addAvatar','addSystemAvatar','/:id/notify','notify','server/files','attachments','offline-chat','replace','/:id/offline','any','addInteraction','/:id/applications','addApplications','addProactiveActions','put','update','delete','destroy','removeDispositions','removeAgents','exports','multer','util','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','index','/describe','isAuthenticated','/:id','show','getDispositions','/:id/canned_answers','getAnswers','/:id/logo','getLogo','/:id/avatar','getAvatar','/:id/customer_avatar','getCustomerAvatar','/:id/system_avatar','getSystemAvatar'];(function(_0x28d1b9,_0x4d4388){var _0x3302c2=function(_0x324166){while(--_0x324166){_0x28d1b9['push'](_0x28d1b9['shift']());}};_0x3302c2(++_0x4d4388);}(_0xb507,0x1ca));var _0x7b50=function(_0x4ec42,_0x36177b){_0x4ec42=_0x4ec42-0x0;var _0x385e11=_0xb507[_0x4ec42];return _0x385e11;};'use strict';var multer=require(_0x7b50('0x0'));var util=require(_0x7b50('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0x7b50('0x2'));var router=express[_0x7b50('0x3')]();var fs_extra=require(_0x7b50('0x4'));var auth=require(_0x7b50('0x5'));var interaction=require(_0x7b50('0x6'));var config=require(_0x7b50('0x7'));var controller=require('./chatWebsite.controller');router[_0x7b50('0x8')]('/',auth['isAuthenticated'](),controller[_0x7b50('0x9')]);router[_0x7b50('0x8')](_0x7b50('0xa'),auth[_0x7b50('0xb')](),controller['describe']);router[_0x7b50('0x8')](_0x7b50('0xc'),auth[_0x7b50('0xb')](),controller[_0x7b50('0xd')]);router[_0x7b50('0x8')]('/:id/dispositions',auth['isAuthenticated'](),controller[_0x7b50('0xe')]);router[_0x7b50('0x8')](_0x7b50('0xf'),auth[_0x7b50('0xb')](),controller[_0x7b50('0x10')]);router[_0x7b50('0x8')](_0x7b50('0x11'),controller[_0x7b50('0x12')]);router[_0x7b50('0x8')](_0x7b50('0x13'),controller[_0x7b50('0x14')]);router[_0x7b50('0x8')](_0x7b50('0x15'),controller[_0x7b50('0x16')]);router[_0x7b50('0x8')](_0x7b50('0x17'),controller[_0x7b50('0x18')]);router[_0x7b50('0x8')](_0x7b50('0x19'),auth['isAuthenticated'](),controller['getInteractions']);router[_0x7b50('0x8')]('/:id/snippet',controller['getSnippet']);router['get']('/:id/applications',auth[_0x7b50('0xb')](),controller[_0x7b50('0x1a')]);router[_0x7b50('0x8')](_0x7b50('0x1b'),auth[_0x7b50('0xb')](),controller[_0x7b50('0x1c')]);router[_0x7b50('0x8')](_0x7b50('0x1d'),controller['getFields']);router[_0x7b50('0x8')]('/:id/offline_messages',auth[_0x7b50('0xb')](),controller['getOfflineMessages']);router[_0x7b50('0x8')](_0x7b50('0x1e'),auth[_0x7b50('0xb')](),controller['getAgents']);router[_0x7b50('0x1f')]('/',auth[_0x7b50('0xb')](),controller[_0x7b50('0x20')]);router[_0x7b50('0x1f')](_0x7b50('0x21'),auth[_0x7b50('0xb')](),controller[_0x7b50('0x22')]);router[_0x7b50('0x1f')](_0x7b50('0xf'),auth['isAuthenticated'](),controller[_0x7b50('0x23')]);var upload=multer({'storage':multer[_0x7b50('0x24')]({'destination':function(_0x34f826,_0x336130,_0x52e494){_0x52e494(null,path[_0x7b50('0x25')](config[_0x7b50('0x26')],_0x7b50('0x27')));},'filename':function(_0x3b065e,_0x108b30,_0x26913c){_0x26913c(null,util[_0x7b50('0x28')](_0x7b50('0x29'),Date[_0x7b50('0x2a')](),_0x108b30['originalname']));}})});router['post']('/:id/logo',upload[_0x7b50('0x2b')](_0x7b50('0x2c')),controller[_0x7b50('0x2d')]);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x2de558,_0x8681b9,_0x18fa86){_0x18fa86(null,path[_0x7b50('0x25')](config[_0x7b50('0x26')],_0x7b50('0x2e')));},'filename':function(_0x4eefdc,_0x9a1b60,_0x4f83cd){_0x4f83cd(null,util[_0x7b50('0x28')](_0x7b50('0x29'),Date[_0x7b50('0x2a')](),_0x9a1b60[_0x7b50('0x2f')]));}})});router[_0x7b50('0x1f')](_0x7b50('0x13'),upload[_0x7b50('0x2b')](_0x7b50('0x2c')),controller[_0x7b50('0x30')]);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x40890b,_0x4a9c9e,_0x3ac260){_0x3ac260(null,path[_0x7b50('0x25')](config[_0x7b50('0x26')],_0x7b50('0x2e')));},'filename':function(_0x5c914b,_0x28dc7b,_0xfcd410){_0xfcd410(null,util[_0x7b50('0x28')](_0x7b50('0x29'),Date['now'](),_0x28dc7b[_0x7b50('0x2f')]));}})});router[_0x7b50('0x1f')](_0x7b50('0x15'),upload[_0x7b50('0x2b')]('file'),controller['addCustomerAvatar']);var upload=multer({'storage':multer[_0x7b50('0x24')]({'destination':function(_0xc2c3b9,_0x6861e3,_0x23dbd3){_0x23dbd3(null,path[_0x7b50('0x25')](config['root'],'server/files/images/avatars/'));},'filename':function(_0x28f533,_0x55e96d,_0x4e5b0c){_0x4e5b0c(null,util[_0x7b50('0x28')](_0x7b50('0x29'),Date[_0x7b50('0x2a')](),_0x55e96d[_0x7b50('0x2f')]));}})});router[_0x7b50('0x1f')](_0x7b50('0x17'),upload[_0x7b50('0x2b')](_0x7b50('0x2c')),controller[_0x7b50('0x31')]);router[_0x7b50('0x1f')](_0x7b50('0x32'),controller[_0x7b50('0x33')]);const offlineUploadMulter=multer({'storage':multer['diskStorage']({'destination':function(_0x3f2ce0,_0x51cd9f,_0x31cd3f){const _0x239cf3=path[_0x7b50('0x25')](config['root'],_0x7b50('0x34'),_0x7b50('0x35'),_0x7b50('0x36'));fs_extra['ensureDir'](_0x239cf3,function(){_0x31cd3f(null,_0x239cf3);});},'filename':function(_0x115b22,_0x20e27c,_0x226d6a){const _0x51bd70=_0x20e27c['originalname']['replace'](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');const _0x1e754d=path['extname'](_0x51bd70);const _0x1a8ea6=Date['now']()+'-'+_0x51bd70[_0x7b50('0x37')](_0x1e754d,'')+_0x1e754d;_0x226d6a(null,_0x1a8ea6);}})});router[_0x7b50('0x1f')](_0x7b50('0x38'),offlineUploadMulter[_0x7b50('0x39')](),controller['offline']);router['post'](_0x7b50('0x19'),auth[_0x7b50('0xb')](),controller[_0x7b50('0x3a')]);router[_0x7b50('0x1f')](_0x7b50('0x3b'),auth['isAuthenticated'](),controller[_0x7b50('0x3c')]);router[_0x7b50('0x1f')](_0x7b50('0x1b'),auth[_0x7b50('0xb')](),controller[_0x7b50('0x3d')]);router[_0x7b50('0x1f')](_0x7b50('0x1e'),auth[_0x7b50('0xb')](),controller['addAgents']);router[_0x7b50('0x3e')](_0x7b50('0xc'),auth['isAuthenticated'](),controller[_0x7b50('0x3f')]);router[_0x7b50('0x40')]('/:id',auth['isAuthenticated'](),controller[_0x7b50('0x41')]);router['delete']('/:id/dispositions',auth[_0x7b50('0xb')](),controller[_0x7b50('0x42')]);router['delete'](_0x7b50('0xf'),auth['isAuthenticated'](),controller['removeAnswers']);router['delete'](_0x7b50('0x1e'),auth[_0x7b50('0xb')](),controller[_0x7b50('0x43')]);module[_0x7b50('0x44')]=router;
\ No newline at end of file
diff --git a/server/api/client-side-logs.js b/server/api/client-side-logs.js
index 838ecb8..74b74b4 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 _0x80e6=['Client-Side\x20logger\x20not\x20found!','expressEndpoint','/client-logs','use','isAuthenticated','beaver-logger/server','express','../config/environment','env','production','get'];(function(_0x116a96,_0xb3cb8c){var _0x57ad04=function(_0x556765){while(--_0x556765){_0x116a96['push'](_0x116a96['shift']());}};_0x57ad04(++_0xb3cb8c);}(_0x80e6,0xb5));var _0x680e=function(_0x2f534f,_0x3a4391){_0x2f534f=_0x2f534f-0x0;var _0x3ac9b8=_0x80e6[_0x2f534f];return _0x3ac9b8;};var beaverLogger=require(_0x680e('0x0'));var express=require(_0x680e('0x1'));var auth=require('../components/auth/service');var config=require(_0x680e('0x2'));var router=express['Router']();var isProduction=config[_0x680e('0x3')]===_0x680e('0x4')||![];function clientSideLogs(_0x47ee7b,_0x7cafb4,_0x36d976){var _0x2f1984=_0x47ee7b['app'][_0x680e('0x5')]('client-side-logger');if(!_0x2f1984){throw new Error(_0x680e('0x6'));}return beaverLogger[_0x680e('0x7')]({'uri':_0x680e('0x8'),'logger':_0x2f1984,'enableCors':!isProduction})(_0x47ee7b,_0x7cafb4,_0x36d976);}router[_0x680e('0x9')](auth[_0x680e('0xa')](),clientSideLogs);module['exports']=router;
\ No newline at end of file
+var _0xc382=['env','production','app','get','Client-Side\x20logger\x20not\x20found!','expressEndpoint','use','isAuthenticated','exports','beaver-logger/server','express','Router'];(function(_0x176d14,_0x3984ea){var _0x89522c=function(_0x3aba48){while(--_0x3aba48){_0x176d14['push'](_0x176d14['shift']());}};_0x89522c(++_0x3984ea);}(_0xc382,0x1ad));var _0x2c38=function(_0x16da8f,_0x4ddb80){_0x16da8f=_0x16da8f-0x0;var _0xd5dca8=_0xc382[_0x16da8f];return _0xd5dca8;};var beaverLogger=require(_0x2c38('0x0'));var express=require(_0x2c38('0x1'));var auth=require('../components/auth/service');var config=require('../config/environment');var router=express[_0x2c38('0x2')]();var isProduction=config[_0x2c38('0x3')]===_0x2c38('0x4')||![];function clientSideLogs(_0x480728,_0x28e9b6,_0x3b9781){var _0x292150=_0x480728[_0x2c38('0x5')][_0x2c38('0x6')]('client-side-logger');if(!_0x292150){throw new Error(_0x2c38('0x7'));}return beaverLogger[_0x2c38('0x8')]({'uri':'/client-logs','logger':_0x292150,'enableCors':!isProduction})(_0x480728,_0x28e9b6,_0x3b9781);}router[_0x2c38('0x9')](auth[_0x2c38('0xa')](),clientSideLogs);module[_0x2c38('0xb')]=router;
\ No newline at end of file
diff --git a/server/api/cloudProvider/cloudProvider.attributes.js b/server/api/cloudProvider/cloudProvider.attributes.js
index a2bd237..6b13536 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 _0xffed=['exports','ENUM','AmazonAWS','Google','Outlook365','Dynamics365','STRING','MicrosoftAzure\x20=>\x20redirect_uri','MicrosoftAzure\x20=>\x20access_token','TEXT','MicrosoftAzure\x20=>\x20refresh_token','MicrosoftAzure\x20=>\x20Dynamics365\x20=>\x20remote_uri'];(function(_0x84293f,_0x1b4173){var _0x15a611=function(_0x32f46b){while(--_0x32f46b){_0x84293f['push'](_0x84293f['shift']());}};_0x15a611(++_0x1b4173);}(_0xffed,0x1a4));var _0xdffe=function(_0xf20de,_0x297b52){_0xf20de=_0xf20de-0x0;var _0x172295=_0xffed[_0xf20de];return _0x172295;};'use strict';var Sequelize=require('sequelize');module[_0xdffe('0x0')]={'name':{'type':Sequelize['STRING'],'allowNull':![],'validate':{'notEmpty':!![]}},'service':{'type':Sequelize[_0xdffe('0x1')](_0xdffe('0x2'),_0xdffe('0x3'),'MicrosoftAzure'),'allowNull':![],'validate':{'notEmpty':!![]}},'type':{'type':Sequelize[_0xdffe('0x1')](_0xdffe('0x4'),_0xdffe('0x5'))},'data1':{'type':Sequelize[_0xdffe('0x6')],'comment':'MicrosoftAzure\x20=>\x20client_id'},'data2':{'type':Sequelize[_0xdffe('0x6')],'comment':'MicrosoftAzure\x20=>\x20tenant'},'data3':{'type':Sequelize[_0xdffe('0x6')],'comment':'MicrosoftAzure\x20=>\x20client_secret'},'data4':{'type':Sequelize[_0xdffe('0x6')],'comment':_0xdffe('0x7')},'data5':{'type':Sequelize['TEXT'],'comment':_0xdffe('0x8')},'data6':{'type':Sequelize[_0xdffe('0x9')],'comment':_0xdffe('0xa')},'data7':{'type':Sequelize[_0xdffe('0x9')],'comment':_0xdffe('0xb')}};
\ No newline at end of file
+var _0x0dc2=['Outlook365','Dynamics365','MicrosoftAzure\x20=>\x20client_id','MicrosoftAzure\x20=>\x20tenant','MicrosoftAzure\x20=>\x20client_secret','MicrosoftAzure\x20=>\x20access_token','TEXT','MicrosoftAzure\x20=>\x20refresh_token','exports','STRING','ENUM','Google','MicrosoftAzure'];(function(_0x3bd792,_0x171a3e){var _0x405c0f=function(_0x3c2cae){while(--_0x3c2cae){_0x3bd792['push'](_0x3bd792['shift']());}};_0x405c0f(++_0x171a3e);}(_0x0dc2,0x167));var _0x20dc=function(_0x45c61a,_0x1b9fd4){_0x45c61a=_0x45c61a-0x0;var _0x2b4bd2=_0x0dc2[_0x45c61a];return _0x2b4bd2;};'use strict';var Sequelize=require('sequelize');module[_0x20dc('0x0')]={'name':{'type':Sequelize[_0x20dc('0x1')],'allowNull':![],'validate':{'notEmpty':!![]}},'service':{'type':Sequelize[_0x20dc('0x2')]('AmazonAWS',_0x20dc('0x3'),_0x20dc('0x4')),'allowNull':![],'validate':{'notEmpty':!![]}},'type':{'type':Sequelize[_0x20dc('0x2')](_0x20dc('0x5'),_0x20dc('0x6'))},'data1':{'type':Sequelize[_0x20dc('0x1')],'comment':_0x20dc('0x7')},'data2':{'type':Sequelize[_0x20dc('0x1')],'comment':_0x20dc('0x8')},'data3':{'type':Sequelize[_0x20dc('0x1')],'comment':_0x20dc('0x9')},'data4':{'type':Sequelize[_0x20dc('0x1')],'comment':'MicrosoftAzure\x20=>\x20redirect_uri'},'data5':{'type':Sequelize['TEXT'],'comment':_0x20dc('0xa')},'data6':{'type':Sequelize[_0x20dc('0xb')],'comment':_0x20dc('0xc')},'data7':{'type':Sequelize[_0x20dc('0xb')],'comment':'MicrosoftAzure\x20=>\x20Dynamics365\x20=>\x20remote_uri'}};
\ No newline at end of file
diff --git a/server/api/cloudProvider/cloudProvider.controller.js b/server/api/cloudProvider/cloudProvider.controller.js
index fad38c8..b176b8a 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 _0x2d9c=['from','toString','id_token','getOauth2MicrosoftAccessToken','data5','access_token','data6','startRefreshInterval','emit','microsoftAuthorization:success','microsoftAuthorization:error','Invalid\x20authentication\x20state\x20parameter','message','Authentication\x20failed\x20for\x20cloud\x20provider\x20#%s,\x20err:%s','stringify','ioredis','../../components/encryptor','../../config/environment','api','../../mysqldb','./cloudProvider.oauth','redis','defaults','socket.io-emitter','sendStatus','end','offset','count','limit','status','set','Content-Range','json','update','then','destroy','error','name','send','padEnd','slice','index','map','CloudProvider','rawAttributes','fieldName','type','key','model','query','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','merge','VIRTUAL','filter','options','findAll','data3','catch','show','params','keys','filters','includeAll','find','service','MicrosoftAzure','decryptString','create','body','Service\x20parameter\x20not\x20specified','values','includes','Invalid\x20service\x20parameter.\x20Allowed\x20values:\x20','join','encryptString','oauth2MicrosoftAuthorize','findOne','generateMicrosoftAuthorizationUrl','user','get','state','Invalid\x20state\x20parameter','parse'];(function(_0x310cfb,_0x10b5ac){var _0x33735a=function(_0x1e1ae4){while(--_0x1e1ae4){_0x310cfb['push'](_0x310cfb['shift']());}};_0x33735a(++_0x10b5ac);}(_0x2d9c,0x1db));var _0xc2d9=function(_0x2d97d1,_0x5cc175){_0x2d97d1=_0x2d97d1-0x0;var _0xb912ef=_0x2d9c[_0x2d97d1];return _0xb912ef;};'use strict';var _=require('lodash');var Redis=require(_0xc2d9('0x0'));var qs=require('../../components/parsers/qs');var encryptor=require(_0xc2d9('0x1'));var config=require(_0xc2d9('0x2'));var logger=require('../../config/logger')(_0xc2d9('0x3'));var db=require(_0xc2d9('0x4'))['db'];var oauth=require(_0xc2d9('0x5'));config[_0xc2d9('0x6')]=_[_0xc2d9('0x7')](config[_0xc2d9('0x6')],{'host':'localhost','port':0x18eb});var socket=require(_0xc2d9('0x8'))(new Redis(config['redis']));var redis=new Redis(config[_0xc2d9('0x6')]);function respondWithStatusCode(_0x108faa,_0x169f14){_0x169f14=_0x169f14||0xcc;return function(_0x2cc8ad){if(_0x2cc8ad){return _0x108faa[_0xc2d9('0x9')](_0x169f14);}return _0x108faa['status'](_0x169f14)[_0xc2d9('0xa')]();};}function respondWithResult(_0x51354f,_0x37da75){_0x37da75=_0x37da75||0xc8;return function(_0x5ebe70){if(_0x5ebe70){return _0x51354f['status'](_0x37da75)['json'](_0x5ebe70);}};}function respondWithFilteredResult(_0x3d2756,_0x1c0d9c){return function(_0x484d0c){if(_0x484d0c){var _0x35027b=typeof _0x1c0d9c[_0xc2d9('0xb')]==='undefined'&&typeof _0x1c0d9c['limit']==='undefined';var _0x380137=_0x484d0c['count'];var _0x407f57=_0x35027b?0x0:_0x1c0d9c['offset'];var _0x5c1d29=_0x35027b?_0x484d0c[_0xc2d9('0xc')]:_0x1c0d9c[_0xc2d9('0xb')]+_0x1c0d9c[_0xc2d9('0xd')];var _0x52a5d1;if(_0x5c1d29>=_0x380137){_0x5c1d29=_0x380137;_0x52a5d1=0xc8;}else{_0x52a5d1=0xce;}_0x3d2756[_0xc2d9('0xe')](_0x52a5d1);return _0x3d2756[_0xc2d9('0xf')](_0xc2d9('0x10'),_0x407f57+'-'+_0x5c1d29+'/'+_0x380137)[_0xc2d9('0x11')](_0x484d0c);}return null;};}function saveUpdates(_0x1ad084){return function(_0x32d9b7){if(_0x32d9b7){return _0x32d9b7[_0xc2d9('0x12')](_0x1ad084)[_0xc2d9('0x13')](function(_0x80edda){return _0x80edda;});}return null;};}function removeEntity(_0x2bc4a9){return function(_0x88b13d){if(_0x88b13d){return _0x88b13d[_0xc2d9('0x14')]()[_0xc2d9('0x13')](function(){_0x2bc4a9[_0xc2d9('0xe')](0xcc)[_0xc2d9('0xa')]();});}};}function handleEntityNotFound(_0x188d37){return function(_0xebd15b){if(!_0xebd15b){_0x188d37[_0xc2d9('0x9')](0x194);}return _0xebd15b;};}function handleError(_0x14d60b,_0x5b0b85){_0x5b0b85=_0x5b0b85||0x1f4;return function(_0x3d974d){logger[_0xc2d9('0x15')](_0x3d974d['stack']);if(_0x3d974d[_0xc2d9('0x16')]){delete _0x3d974d[_0xc2d9('0x16')];}_0x14d60b[_0xc2d9('0xe')](_0x5b0b85)[_0xc2d9('0x17')](_0x3d974d);};}function maskClientSecret(_0xfba82b){return _[_0xc2d9('0x18')](_0xfba82b[_0xc2d9('0x19')](0x0,0x3),0x14,'*');}exports[_0xc2d9('0x1a')]=function(_0x2db643,_0x110060){var _0x1dff47={},_0x3a20a3={},_0x7876aa={'count':0x0,'rows':[]};var _0x13f678=_[_0xc2d9('0x1b')](db[_0xc2d9('0x1c')][_0xc2d9('0x1d')],function(_0x324ae3){return{'name':_0x324ae3[_0xc2d9('0x1e')],'type':_0x324ae3[_0xc2d9('0x1f')][_0xc2d9('0x20')]};});_0x3a20a3[_0xc2d9('0x21')]=_[_0xc2d9('0x1b')](_0x13f678,_0xc2d9('0x16'));_0x3a20a3[_0xc2d9('0x22')]=_['keys'](_0x2db643[_0xc2d9('0x22')]);_0x3a20a3['filters']=_[_0xc2d9('0x23')](_0x3a20a3[_0xc2d9('0x21')],_0x3a20a3[_0xc2d9('0x22')]);_0x1dff47[_0xc2d9('0x24')]=_[_0xc2d9('0x23')](_0x3a20a3[_0xc2d9('0x21')],qs[_0xc2d9('0x25')](_0x2db643[_0xc2d9('0x22')][_0xc2d9('0x25')]));_0x1dff47[_0xc2d9('0x24')]=_0x1dff47[_0xc2d9('0x24')][_0xc2d9('0x26')]?_0x1dff47[_0xc2d9('0x24')]:_0x3a20a3['model'];if(!_0x2db643[_0xc2d9('0x22')][_0xc2d9('0x27')](_0xc2d9('0x28'))){_0x1dff47[_0xc2d9('0xd')]=qs[_0xc2d9('0xd')](_0x2db643[_0xc2d9('0x22')][_0xc2d9('0xd')]);_0x1dff47[_0xc2d9('0xb')]=qs[_0xc2d9('0xb')](_0x2db643[_0xc2d9('0x22')][_0xc2d9('0xb')]);}_0x1dff47[_0xc2d9('0x29')]=qs[_0xc2d9('0x2a')](_0x2db643[_0xc2d9('0x22')][_0xc2d9('0x2a')]);_0x1dff47[_0xc2d9('0x2b')]=qs['filters'](_[_0xc2d9('0x2c')](_0x2db643['query'],_0x3a20a3['filters']),_0x13f678);if(_0x2db643[_0xc2d9('0x22')]['filter']){_0x1dff47[_0xc2d9('0x2b')]=_[_0xc2d9('0x2d')](_0x1dff47[_0xc2d9('0x2b')],{'$or':_[_0xc2d9('0x1b')](_0x13f678,function(_0x7089d5){if(_0x7089d5['type']!==_0xc2d9('0x2e')){var _0x242e07={};_0x242e07[_0x7089d5[_0xc2d9('0x16')]]={'$like':'%'+_0x2db643[_0xc2d9('0x22')][_0xc2d9('0x2f')]+'%'};return _0x242e07;}})});}_0x1dff47=_['merge']({},_0x1dff47,_0x2db643[_0xc2d9('0x30')]);var _0x4e363b={'where':_0x1dff47[_0xc2d9('0x2b')]};return db['CloudProvider']['count'](_0x4e363b)['then'](function(_0x102587){_0x7876aa['count']=_0x102587;if(_0x2db643[_0xc2d9('0x22')]['includeAll']){_0x1dff47['include']=[{'all':!![]}];}return db[_0xc2d9('0x1c')][_0xc2d9('0x31')](_0x1dff47);})[_0xc2d9('0x13')](function(_0x4a6243){_0x7876aa['rows']=_[_0xc2d9('0x1b')](_0x4a6243,function(_0x28f516){if(_0x28f516['service']==='MicrosoftAzure'){var _0x3bf291=encryptor['decryptString'](_0x28f516[_0xc2d9('0x32')]);_0x28f516[_0xc2d9('0x32')]=maskClientSecret(_0x3bf291);}return _0x28f516;});return _0x7876aa;})[_0xc2d9('0x13')](respondWithFilteredResult(_0x110060,_0x1dff47))[_0xc2d9('0x33')](handleError(_0x110060,null));};exports[_0xc2d9('0x34')]=function(_0x4a586c,_0x578303){var _0x1c1bad={'raw':!![],'where':{'id':_0x4a586c[_0xc2d9('0x35')]['id']}},_0x449f4e={};_0x449f4e[_0xc2d9('0x21')]=_[_0xc2d9('0x36')](db[_0xc2d9('0x1c')]['rawAttributes']);_0x449f4e[_0xc2d9('0x22')]=_[_0xc2d9('0x36')](_0x4a586c['query']);_0x449f4e[_0xc2d9('0x37')]=_[_0xc2d9('0x23')](_0x449f4e[_0xc2d9('0x21')],_0x449f4e[_0xc2d9('0x22')]);_0x1c1bad[_0xc2d9('0x24')]=_[_0xc2d9('0x23')](_0x449f4e[_0xc2d9('0x21')],qs[_0xc2d9('0x25')](_0x4a586c[_0xc2d9('0x22')][_0xc2d9('0x25')]));_0x1c1bad['attributes']=_0x1c1bad[_0xc2d9('0x24')][_0xc2d9('0x26')]?_0x1c1bad[_0xc2d9('0x24')]:_0x449f4e[_0xc2d9('0x21')];if(_0x4a586c[_0xc2d9('0x22')][_0xc2d9('0x38')]){_0x1c1bad['include']=[{'all':!![]}];}_0x1c1bad=_[_0xc2d9('0x2d')]({},_0x1c1bad,_0x4a586c[_0xc2d9('0x30')]);return db[_0xc2d9('0x1c')][_0xc2d9('0x39')](_0x1c1bad)[_0xc2d9('0x13')](handleEntityNotFound(_0x578303,null))[_0xc2d9('0x13')](function(_0x321e35){if(_0x321e35[_0xc2d9('0x3a')]===_0xc2d9('0x3b')){var _0x3a5a2a=encryptor[_0xc2d9('0x3c')](_0x321e35['data3']);_0x321e35['data3']=maskClientSecret(_0x3a5a2a);}return _0x321e35;})[_0xc2d9('0x13')](respondWithResult(_0x578303,null))['catch'](handleError(_0x578303,null));};exports[_0xc2d9('0x3d')]=function(_0x10e3ab,_0x1aa50a){if(!_0x10e3ab['body'][_0xc2d9('0x16')])throw new Error('Name\x20parameter\x20not\x20specified');if(!_0x10e3ab[_0xc2d9('0x3e')][_0xc2d9('0x3a')])throw new Error(_0xc2d9('0x3f'));var _0xe35171=db[_0xc2d9('0x1c')][_0xc2d9('0x1d')][_0xc2d9('0x3a')][_0xc2d9('0x40')];if(!_0xe35171[_0xc2d9('0x41')](_0x10e3ab['body'][_0xc2d9('0x3a')]))throw new Error(_0xc2d9('0x42')+_0xe35171[_0xc2d9('0x43')](',\x20'));if(_0x10e3ab[_0xc2d9('0x3e')]['service']===_0xc2d9('0x3b')&&_0x10e3ab[_0xc2d9('0x3e')]['data3']){_0x10e3ab[_0xc2d9('0x3e')][_0xc2d9('0x32')]=encryptor[_0xc2d9('0x44')](_0x10e3ab[_0xc2d9('0x3e')][_0xc2d9('0x32')]);}return db['CloudProvider'][_0xc2d9('0x3d')](_0x10e3ab[_0xc2d9('0x3e')],{})[_0xc2d9('0x13')](respondWithResult(_0x1aa50a,0xc9))[_0xc2d9('0x33')](handleError(_0x1aa50a,null));};exports[_0xc2d9('0x12')]=function(_0x1c9a02,_0x999125){if(_0x1c9a02['body']['id']){delete _0x1c9a02[_0xc2d9('0x3e')]['id'];}return db[_0xc2d9('0x1c')][_0xc2d9('0x39')]({'where':{'id':_0x1c9a02['params']['id']}})[_0xc2d9('0x13')](handleEntityNotFound(_0x999125,null))['then'](function(_0x3d611e){if(_0x3d611e[_0xc2d9('0x3a')]===_0xc2d9('0x3b')&&_0x1c9a02['body'][_0xc2d9('0x32')]){_0x1c9a02[_0xc2d9('0x3e')][_0xc2d9('0x32')]=encryptor[_0xc2d9('0x44')](_0x1c9a02[_0xc2d9('0x3e')][_0xc2d9('0x32')]);}return _0x3d611e;})[_0xc2d9('0x13')](saveUpdates(_0x1c9a02['body'],null))[_0xc2d9('0x13')](respondWithResult(_0x999125,null))[_0xc2d9('0x33')](handleError(_0x999125,null));};exports[_0xc2d9('0x14')]=function(_0x206055,_0x1bb2ab){return db[_0xc2d9('0x1c')][_0xc2d9('0x39')]({'where':{'id':_0x206055[_0xc2d9('0x35')]['id']}})['then'](handleEntityNotFound(_0x1bb2ab,null))['then'](removeEntity(_0x1bb2ab,null))['catch'](handleError(_0x1bb2ab,null));};exports[_0xc2d9('0x45')]=function(_0x155eb2,_0x5695d4){return db[_0xc2d9('0x1c')][_0xc2d9('0x46')]({'where':{'id':_0x155eb2['params']['id']},'raw':!![]})[_0xc2d9('0x13')](function(_0x3d361f){if(!_0x3d361f)return _0x5695d4[_0xc2d9('0x9')](0x194);return{'url':oauth[_0xc2d9('0x47')](_0x3d361f,_0x155eb2[_0xc2d9('0x48')]['id'])};})[_0xc2d9('0x13')](respondWithResult(_0x5695d4,null))[_0xc2d9('0x33')](handleError(_0x5695d4,null));};exports['oauth2MicrosoftCallback']=function(_0x36723e,_0x15b328){var _0x35bcf2=_0x36723e[_0xc2d9('0x3e')];var _0x28e773;var _0xe4a535;if(_0x35bcf2[_0xc2d9('0x15')])throw _0x35bcf2;redis[_0xc2d9('0x49')](_0x35bcf2[_0xc2d9('0x4a')])[_0xc2d9('0x13')](function(_0x37997f){if(!_0x37997f)throw new Error(_0xc2d9('0x4b'));_0x28e773=JSON[_0xc2d9('0x4c')](_0x37997f);var _0x1b5338=Buffer[_0xc2d9('0x4d')](_0x35bcf2['state'],'base64')[_0xc2d9('0x4e')]('ascii');_0xe4a535=JSON[_0xc2d9('0x4c')](_0x1b5338);if(!oauth['isValidIdToken'](_0x35bcf2[_0xc2d9('0x4f')],_0x28e773['oauth2Claims']))throw new Error('Unable\x20to\x20validate\x20id_token');redis['del'](_0x35bcf2['state']);return oauth[_0xc2d9('0x50')](_0x35bcf2['code'],_0x28e773);})['then'](function(_0x3111a0){_0x28e773[_0xc2d9('0x51')]=_0x3111a0[_0xc2d9('0x52')];_0x28e773[_0xc2d9('0x53')]=_0x3111a0['refresh_token'];return db[_0xc2d9('0x1c')][_0xc2d9('0x12')]({'data5':_0x28e773[_0xc2d9('0x51')],'data6':_0x28e773['data6']},{'where':{'id':_0x28e773['id']}});})[_0xc2d9('0x13')](function(){oauth[_0xc2d9('0x54')](_0x28e773);socket[_0xc2d9('0x55')](_0xc2d9('0x56'),{'id':_0xe4a535['id']});return;})['then'](respondWithStatusCode(_0x15b328,null))['catch'](function(_0x58181e){if(_0xe4a535){socket[_0xc2d9('0x55')](_0xc2d9('0x57'),{'id':_0xe4a535['id']});}if(!_0x28e773){logger[_0xc2d9('0x15')](_0xc2d9('0x58'),_0x58181e);return _0x15b328[_0xc2d9('0xe')](0x1f4)[_0xc2d9('0x17')](_0x58181e[_0xc2d9('0x59')]);}logger['error'](_0xc2d9('0x5a'),_0x28e773['id'],JSON[_0xc2d9('0x5b')](_0x58181e));});};
\ No newline at end of file
+var _0x1c5a=['data6','refresh_token','data5','startRefreshInterval','emit','microsoftAuthorization:success','microsoftAuthorization:error','Invalid\x20authentication\x20state\x20parameter','message','Authentication\x20failed\x20for\x20cloud\x20provider\x20#%s,\x20err:%s','stringify','lodash','ioredis','../../components/parsers/qs','../../components/encryptor','../../config/environment','api','../../mysqldb','./cloudProvider.oauth','redis','defaults','localhost','socket.io-emitter','status','json','offset','limit','undefined','count','set','update','destroy','then','end','sendStatus','error','stack','name','send','slice','map','CloudProvider','fieldName','type','key','model','keys','query','filters','intersection','attributes','fields','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','MicrosoftAzure','decryptString','catch','show','rawAttributes','length','find','service','data3','create','body','Service\x20parameter\x20not\x20specified','Invalid\x20service\x20parameter.\x20Allowed\x20values:\x20','join','encryptString','oauth2MicrosoftAuthorize','findOne','generateMicrosoftAuthorizationUrl','oauth2MicrosoftCallback','get','state','Invalid\x20state\x20parameter','parse','base64','oauth2Claims','del','getOauth2MicrosoftAccessToken','code','access_token'];(function(_0xf3e4a0,_0x16a172){var _0x43f1cc=function(_0x3abdf5){while(--_0x3abdf5){_0xf3e4a0['push'](_0xf3e4a0['shift']());}};_0x43f1cc(++_0x16a172);}(_0x1c5a,0xc7));var _0xa1c5=function(_0x1e7b16,_0x4607a1){_0x1e7b16=_0x1e7b16-0x0;var _0x37fadc=_0x1c5a[_0x1e7b16];return _0x37fadc;};'use strict';var _=require(_0xa1c5('0x0'));var Redis=require(_0xa1c5('0x1'));var qs=require(_0xa1c5('0x2'));var encryptor=require(_0xa1c5('0x3'));var config=require(_0xa1c5('0x4'));var logger=require('../../config/logger')(_0xa1c5('0x5'));var db=require(_0xa1c5('0x6'))['db'];var oauth=require(_0xa1c5('0x7'));config[_0xa1c5('0x8')]=_[_0xa1c5('0x9')](config[_0xa1c5('0x8')],{'host':_0xa1c5('0xa'),'port':0x18eb});var socket=require(_0xa1c5('0xb'))(new Redis(config['redis']));var redis=new Redis(config['redis']);function respondWithStatusCode(_0x5c3be3,_0x108d71){_0x108d71=_0x108d71||0xcc;return function(_0x3d4bf4){if(_0x3d4bf4){return _0x5c3be3['sendStatus'](_0x108d71);}return _0x5c3be3[_0xa1c5('0xc')](_0x108d71)['end']();};}function respondWithResult(_0x555906,_0x57691b){_0x57691b=_0x57691b||0xc8;return function(_0x4ce488){if(_0x4ce488){return _0x555906['status'](_0x57691b)[_0xa1c5('0xd')](_0x4ce488);}};}function respondWithFilteredResult(_0x35d25a,_0x1523b6){return function(_0x111683){if(_0x111683){var _0x102d8b=typeof _0x1523b6[_0xa1c5('0xe')]==='undefined'&&typeof _0x1523b6[_0xa1c5('0xf')]===_0xa1c5('0x10');var _0x395b63=_0x111683[_0xa1c5('0x11')];var _0x436cd3=_0x102d8b?0x0:_0x1523b6[_0xa1c5('0xe')];var _0x3a639c=_0x102d8b?_0x111683[_0xa1c5('0x11')]:_0x1523b6[_0xa1c5('0xe')]+_0x1523b6[_0xa1c5('0xf')];var _0xa34a5e;if(_0x3a639c>=_0x395b63){_0x3a639c=_0x395b63;_0xa34a5e=0xc8;}else{_0xa34a5e=0xce;}_0x35d25a[_0xa1c5('0xc')](_0xa34a5e);return _0x35d25a[_0xa1c5('0x12')]('Content-Range',_0x436cd3+'-'+_0x3a639c+'/'+_0x395b63)[_0xa1c5('0xd')](_0x111683);}return null;};}function saveUpdates(_0x415554){return function(_0x13c4a9){if(_0x13c4a9){return _0x13c4a9[_0xa1c5('0x13')](_0x415554)['then'](function(_0x67ffb3){return _0x67ffb3;});}return null;};}function removeEntity(_0x31f54d){return function(_0x280ece){if(_0x280ece){return _0x280ece[_0xa1c5('0x14')]()[_0xa1c5('0x15')](function(){_0x31f54d[_0xa1c5('0xc')](0xcc)[_0xa1c5('0x16')]();});}};}function handleEntityNotFound(_0x1e1528){return function(_0x49f199){if(!_0x49f199){_0x1e1528[_0xa1c5('0x17')](0x194);}return _0x49f199;};}function handleError(_0x2bd23c,_0x269a2d){_0x269a2d=_0x269a2d||0x1f4;return function(_0x3068fd){logger[_0xa1c5('0x18')](_0x3068fd[_0xa1c5('0x19')]);if(_0x3068fd['name']){delete _0x3068fd[_0xa1c5('0x1a')];}_0x2bd23c[_0xa1c5('0xc')](_0x269a2d)[_0xa1c5('0x1b')](_0x3068fd);};}function maskClientSecret(_0xa8c14c){return _['padEnd'](_0xa8c14c[_0xa1c5('0x1c')](0x0,0x3),0x14,'*');}exports['index']=function(_0x25a57a,_0x1435d7){var _0x41c9d4={},_0x44bf8e={},_0x262549={'count':0x0,'rows':[]};var _0x3d06c8=_[_0xa1c5('0x1d')](db[_0xa1c5('0x1e')]['rawAttributes'],function(_0x48faef){return{'name':_0x48faef[_0xa1c5('0x1f')],'type':_0x48faef[_0xa1c5('0x20')][_0xa1c5('0x21')]};});_0x44bf8e[_0xa1c5('0x22')]=_[_0xa1c5('0x1d')](_0x3d06c8,_0xa1c5('0x1a'));_0x44bf8e['query']=_[_0xa1c5('0x23')](_0x25a57a[_0xa1c5('0x24')]);_0x44bf8e[_0xa1c5('0x25')]=_[_0xa1c5('0x26')](_0x44bf8e[_0xa1c5('0x22')],_0x44bf8e[_0xa1c5('0x24')]);_0x41c9d4[_0xa1c5('0x27')]=_[_0xa1c5('0x26')](_0x44bf8e[_0xa1c5('0x22')],qs[_0xa1c5('0x28')](_0x25a57a['query']['fields']));_0x41c9d4[_0xa1c5('0x27')]=_0x41c9d4['attributes']['length']?_0x41c9d4[_0xa1c5('0x27')]:_0x44bf8e[_0xa1c5('0x22')];if(!_0x25a57a[_0xa1c5('0x24')]['hasOwnProperty'](_0xa1c5('0x29'))){_0x41c9d4[_0xa1c5('0xf')]=qs[_0xa1c5('0xf')](_0x25a57a['query'][_0xa1c5('0xf')]);_0x41c9d4[_0xa1c5('0xe')]=qs[_0xa1c5('0xe')](_0x25a57a[_0xa1c5('0x24')][_0xa1c5('0xe')]);}_0x41c9d4[_0xa1c5('0x2a')]=qs[_0xa1c5('0x2b')](_0x25a57a[_0xa1c5('0x24')][_0xa1c5('0x2b')]);_0x41c9d4[_0xa1c5('0x2c')]=qs[_0xa1c5('0x25')](_[_0xa1c5('0x2d')](_0x25a57a['query'],_0x44bf8e['filters']),_0x3d06c8);if(_0x25a57a['query'][_0xa1c5('0x2e')]){_0x41c9d4[_0xa1c5('0x2c')]=_[_0xa1c5('0x2f')](_0x41c9d4[_0xa1c5('0x2c')],{'$or':_['map'](_0x3d06c8,function(_0x2b8ec0){if(_0x2b8ec0[_0xa1c5('0x20')]!==_0xa1c5('0x30')){var _0xf59b58={};_0xf59b58[_0x2b8ec0[_0xa1c5('0x1a')]]={'$like':'%'+_0x25a57a['query']['filter']+'%'};return _0xf59b58;}})});}_0x41c9d4=_['merge']({},_0x41c9d4,_0x25a57a[_0xa1c5('0x31')]);var _0x569fe4={'where':_0x41c9d4[_0xa1c5('0x2c')]};return db[_0xa1c5('0x1e')][_0xa1c5('0x11')](_0x569fe4)[_0xa1c5('0x15')](function(_0x18f65a){_0x262549['count']=_0x18f65a;if(_0x25a57a[_0xa1c5('0x24')][_0xa1c5('0x32')]){_0x41c9d4[_0xa1c5('0x33')]=[{'all':!![]}];}return db['CloudProvider'][_0xa1c5('0x34')](_0x41c9d4);})[_0xa1c5('0x15')](function(_0x5ab8fb){_0x262549[_0xa1c5('0x35')]=_[_0xa1c5('0x1d')](_0x5ab8fb,function(_0x133974){if(_0x133974['service']===_0xa1c5('0x36')){var _0x4b3fae=encryptor[_0xa1c5('0x37')](_0x133974['data3']);_0x133974['data3']=maskClientSecret(_0x4b3fae);}return _0x133974;});return _0x262549;})[_0xa1c5('0x15')](respondWithFilteredResult(_0x1435d7,_0x41c9d4))[_0xa1c5('0x38')](handleError(_0x1435d7,null));};exports[_0xa1c5('0x39')]=function(_0x29a245,_0x2e1632){var _0x4f1b18={'raw':!![],'where':{'id':_0x29a245['params']['id']}},_0x254ee5={};_0x254ee5[_0xa1c5('0x22')]=_['keys'](db['CloudProvider'][_0xa1c5('0x3a')]);_0x254ee5[_0xa1c5('0x24')]=_[_0xa1c5('0x23')](_0x29a245['query']);_0x254ee5[_0xa1c5('0x25')]=_[_0xa1c5('0x26')](_0x254ee5[_0xa1c5('0x22')],_0x254ee5[_0xa1c5('0x24')]);_0x4f1b18[_0xa1c5('0x27')]=_[_0xa1c5('0x26')](_0x254ee5[_0xa1c5('0x22')],qs[_0xa1c5('0x28')](_0x29a245[_0xa1c5('0x24')][_0xa1c5('0x28')]));_0x4f1b18[_0xa1c5('0x27')]=_0x4f1b18[_0xa1c5('0x27')][_0xa1c5('0x3b')]?_0x4f1b18[_0xa1c5('0x27')]:_0x254ee5[_0xa1c5('0x22')];if(_0x29a245[_0xa1c5('0x24')][_0xa1c5('0x32')]){_0x4f1b18['include']=[{'all':!![]}];}_0x4f1b18=_[_0xa1c5('0x2f')]({},_0x4f1b18,_0x29a245[_0xa1c5('0x31')]);return db['CloudProvider'][_0xa1c5('0x3c')](_0x4f1b18)[_0xa1c5('0x15')](handleEntityNotFound(_0x2e1632,null))[_0xa1c5('0x15')](function(_0x2ae69c){if(_0x2ae69c[_0xa1c5('0x3d')]===_0xa1c5('0x36')){var _0x50eee8=encryptor[_0xa1c5('0x37')](_0x2ae69c[_0xa1c5('0x3e')]);_0x2ae69c[_0xa1c5('0x3e')]=maskClientSecret(_0x50eee8);}return _0x2ae69c;})[_0xa1c5('0x15')](respondWithResult(_0x2e1632,null))[_0xa1c5('0x38')](handleError(_0x2e1632,null));};exports[_0xa1c5('0x3f')]=function(_0x5c9b0b,_0x370a4b){if(!_0x5c9b0b['body'][_0xa1c5('0x1a')])throw new Error('Name\x20parameter\x20not\x20specified');if(!_0x5c9b0b[_0xa1c5('0x40')][_0xa1c5('0x3d')])throw new Error(_0xa1c5('0x41'));var _0x192090=db[_0xa1c5('0x1e')]['rawAttributes'][_0xa1c5('0x3d')]['values'];if(!_0x192090['includes'](_0x5c9b0b[_0xa1c5('0x40')][_0xa1c5('0x3d')]))throw new Error(_0xa1c5('0x42')+_0x192090[_0xa1c5('0x43')](',\x20'));if(_0x5c9b0b['body'][_0xa1c5('0x3d')]===_0xa1c5('0x36')&&_0x5c9b0b[_0xa1c5('0x40')][_0xa1c5('0x3e')]){_0x5c9b0b['body'][_0xa1c5('0x3e')]=encryptor[_0xa1c5('0x44')](_0x5c9b0b[_0xa1c5('0x40')]['data3']);}return db[_0xa1c5('0x1e')]['create'](_0x5c9b0b[_0xa1c5('0x40')],{})[_0xa1c5('0x15')](respondWithResult(_0x370a4b,0xc9))[_0xa1c5('0x38')](handleError(_0x370a4b,null));};exports[_0xa1c5('0x13')]=function(_0x39a062,_0xa1eb1){if(_0x39a062[_0xa1c5('0x40')]['id']){delete _0x39a062[_0xa1c5('0x40')]['id'];}return db[_0xa1c5('0x1e')][_0xa1c5('0x3c')]({'where':{'id':_0x39a062['params']['id']}})['then'](handleEntityNotFound(_0xa1eb1,null))[_0xa1c5('0x15')](function(_0x2b15aa){if(_0x2b15aa[_0xa1c5('0x3d')]===_0xa1c5('0x36')&&_0x39a062[_0xa1c5('0x40')][_0xa1c5('0x3e')]){_0x39a062[_0xa1c5('0x40')][_0xa1c5('0x3e')]=encryptor[_0xa1c5('0x44')](_0x39a062[_0xa1c5('0x40')][_0xa1c5('0x3e')]);}return _0x2b15aa;})[_0xa1c5('0x15')](saveUpdates(_0x39a062[_0xa1c5('0x40')],null))[_0xa1c5('0x15')](respondWithResult(_0xa1eb1,null))[_0xa1c5('0x38')](handleError(_0xa1eb1,null));};exports[_0xa1c5('0x14')]=function(_0x592909,_0x1a93be){return db[_0xa1c5('0x1e')]['find']({'where':{'id':_0x592909['params']['id']}})[_0xa1c5('0x15')](handleEntityNotFound(_0x1a93be,null))[_0xa1c5('0x15')](removeEntity(_0x1a93be,null))[_0xa1c5('0x38')](handleError(_0x1a93be,null));};exports[_0xa1c5('0x45')]=function(_0x567546,_0x840112){return db[_0xa1c5('0x1e')][_0xa1c5('0x46')]({'where':{'id':_0x567546['params']['id']},'raw':!![]})['then'](function(_0x362aa4){if(!_0x362aa4)return _0x840112[_0xa1c5('0x17')](0x194);return{'url':oauth[_0xa1c5('0x47')](_0x362aa4,_0x567546['user']['id'])};})['then'](respondWithResult(_0x840112,null))['catch'](handleError(_0x840112,null));};exports[_0xa1c5('0x48')]=function(_0x527015,_0x36dbdc){var _0x36e39a=_0x527015['body'];var _0x18dd47;var _0x2a54fb;if(_0x36e39a[_0xa1c5('0x18')])throw _0x36e39a;redis[_0xa1c5('0x49')](_0x36e39a[_0xa1c5('0x4a')])['then'](function(_0x6a4eab){if(!_0x6a4eab)throw new Error(_0xa1c5('0x4b'));_0x18dd47=JSON[_0xa1c5('0x4c')](_0x6a4eab);var _0x2aa4b7=Buffer['from'](_0x36e39a['state'],_0xa1c5('0x4d'))['toString']('ascii');_0x2a54fb=JSON['parse'](_0x2aa4b7);if(!oauth['isValidIdToken'](_0x36e39a['id_token'],_0x18dd47[_0xa1c5('0x4e')]))throw new Error('Unable\x20to\x20validate\x20id_token');redis[_0xa1c5('0x4f')](_0x36e39a['state']);return oauth[_0xa1c5('0x50')](_0x36e39a[_0xa1c5('0x51')],_0x18dd47);})[_0xa1c5('0x15')](function(_0xa42eb9){_0x18dd47['data5']=_0xa42eb9[_0xa1c5('0x52')];_0x18dd47[_0xa1c5('0x53')]=_0xa42eb9[_0xa1c5('0x54')];return db[_0xa1c5('0x1e')][_0xa1c5('0x13')]({'data5':_0x18dd47[_0xa1c5('0x55')],'data6':_0x18dd47[_0xa1c5('0x53')]},{'where':{'id':_0x18dd47['id']}});})[_0xa1c5('0x15')](function(){oauth[_0xa1c5('0x56')](_0x18dd47);socket[_0xa1c5('0x57')](_0xa1c5('0x58'),{'id':_0x2a54fb['id']});return;})[_0xa1c5('0x15')](respondWithStatusCode(_0x36dbdc,null))['catch'](function(_0x5ce9a0){if(_0x2a54fb){socket[_0xa1c5('0x57')](_0xa1c5('0x59'),{'id':_0x2a54fb['id']});}if(!_0x18dd47){logger['error'](_0xa1c5('0x5a'),_0x5ce9a0);return _0x36dbdc[_0xa1c5('0xc')](0x1f4)['send'](_0x5ce9a0[_0xa1c5('0x5b')]);}logger[_0xa1c5('0x18')](_0xa1c5('0x5c'),_0x18dd47['id'],JSON[_0xa1c5('0x5d')](_0x5ce9a0));});};
\ No newline at end of file
diff --git a/server/api/cloudProvider/cloudProvider.model.js b/server/api/cloudProvider/cloudProvider.model.js
index bb8e51d..b94ee99 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 _0xf920=['cloud_providers','lodash','util','../../config/logger','bluebird','request-promise','path','rimraf','./cloudProvider.attributes','exports','CloudProvider'];(function(_0x59117e,_0x444da3){var _0x59cf49=function(_0x53f9ba){while(--_0x53f9ba){_0x59117e['push'](_0x59117e['shift']());}};_0x59cf49(++_0x444da3);}(_0xf920,0x1b9));var _0x0f92=function(_0x4c1ad8,_0x55e28d){_0x4c1ad8=_0x4c1ad8-0x0;var _0x2c617b=_0xf920[_0x4c1ad8];return _0x2c617b;};'use strict';var _=require(_0x0f92('0x0'));var util=require(_0x0f92('0x1'));var logger=require(_0x0f92('0x2'))('api');var moment=require('moment');var BPromise=require(_0x0f92('0x3'));var rp=require(_0x0f92('0x4'));var fs=require('fs');var path=require(_0x0f92('0x5'));var rimraf=require(_0x0f92('0x6'));var config=require('../../config/environment');var attributes=require(_0x0f92('0x7'));module[_0x0f92('0x8')]=function(_0x4d50e0,_0x58570a){return _0x4d50e0['define'](_0x0f92('0x9'),attributes,{'tableName':_0x0f92('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xfc81=['bluebird','request-promise','rimraf','./cloudProvider.attributes','exports','define','CloudProvider','lodash','util','../../config/logger','api','moment'];(function(_0x29140f,_0x5a52ea){var _0x5f5428=function(_0x1c63cb){while(--_0x1c63cb){_0x29140f['push'](_0x29140f['shift']());}};_0x5f5428(++_0x5a52ea);}(_0xfc81,0x1e7));var _0x1fc8=function(_0x5eca50,_0xc1e3f8){_0x5eca50=_0x5eca50-0x0;var _0x41fb84=_0xfc81[_0x5eca50];return _0x41fb84;};'use strict';var _=require(_0x1fc8('0x0'));var util=require(_0x1fc8('0x1'));var logger=require(_0x1fc8('0x2'))(_0x1fc8('0x3'));var moment=require(_0x1fc8('0x4'));var BPromise=require(_0x1fc8('0x5'));var rp=require(_0x1fc8('0x6'));var fs=require('fs');var path=require('path');var rimraf=require(_0x1fc8('0x7'));var config=require('../../config/environment');var attributes=require(_0x1fc8('0x8'));module[_0x1fc8('0x9')]=function(_0x4d63d2,_0x42cfc4){return _0x4d63d2[_0x1fc8('0xa')](_0x1fc8('0xb'),attributes,{'tableName':'cloud_providers','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 dcdac19..cada408 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 _0x028d=['../../components/encryptor','../../config/logger','../../mysqldb','defaults','localhost','redis','https://login.microsoftonline.com/{TENANT_ID}/oauth2/v2.0','openid','profile','email','https://outlook.office.com/POP.AccessAsUser.All','https://outlook.office.com/SMTP.Send','offline_access','/authorize','/token','type','Dynamics365','push','data7','/.default','join','https://outlook.office365.com/IMAP.AccessAsUser.All','replace','{TENANT_ID}','code','from','stringify','toString','base64','client_id','data1','response_type','redirect_uri','data4','response_mode','scope','state','nonce','prompt','map','value','oauth2/','set','iss','issuer','aud','audience','exp','then','data3','CloudProvider','refresh_token','data6','decryptString','POST','data2','data5','access_token','update','catch','error','Failed\x20to\x20refresh\x20access\x20token\x20for\x20cloud\x20provider\x20#%s,\x20-\x20err:%s','authorization_code','intervals','findAll','inspect','[CLOUD_PROVIDER]\x20Error\x20while\x20refreshing\x20the\x20tokens\x20after\x20service\x20restart\x20error:%s','exports','crypto','jsonwebtoken','moment','ioredis','request-promise','util'];(function(_0x4525fc,_0x1ef6d7){var _0x2be4de=function(_0x5b0757){while(--_0x5b0757){_0x4525fc['push'](_0x4525fc['shift']());}};_0x2be4de(++_0x1ef6d7);}(_0x028d,0x1b6));var _0xd028=function(_0x3d9390,_0x4e6d7b){_0x3d9390=_0x3d9390-0x0;var _0x4e4cb4=_0x028d[_0x3d9390];return _0x4e4cb4;};'use strict';var _=require('lodash');var crypto=require(_0xd028('0x0'));var jwt=require(_0xd028('0x1'));var moment=require(_0xd028('0x2'));var Redis=require(_0xd028('0x3'));var rp=require(_0xd028('0x4'));var util=require(_0xd028('0x5'));var encryptor=require(_0xd028('0x6'));var config=require('../../config/environment');var logger=require(_0xd028('0x7'))('api');var schedule=require('../../config/schedule/cloud-provider');var db=require(_0xd028('0x8'))['db'];config['redis']=_[_0xd028('0x9')](config['redis'],{'host':_0xd028('0xa'),'port':0x18eb});var redis=new Redis(config[_0xd028('0xb')]);var MICROSOFT_AUTH_URL=_0xd028('0xc');var AZURE_AUTH_SCOPES={'Outlook365':[_0xd028('0xd'),_0xd028('0xe'),_0xd028('0xf'),'offline_access','https://outlook.office365.com/IMAP.AccessAsUser.All',_0xd028('0x10'),_0xd028('0x11')],'Dynamics365':[_0xd028('0xd'),_0xd028('0x12')]};var MICROSOFT_AUTH_ENDPOINT=_0xd028('0x13');var MICROSOFT_TOKEN_ENDPOINT=_0xd028('0x14');var OAUTH_REFRESH_INTERVAL=0xfa;function getAuthorizationScopes(_0x2283b3){var _0x5cfb34=_['map'](AZURE_AUTH_SCOPES[_0x2283b3['type']]);if(_0x2283b3[_0xd028('0x15')]===_0xd028('0x16'))_0x5cfb34[_0xd028('0x17')](_0x2283b3[_0xd028('0x18')]+_0xd028('0x19'));return _0x5cfb34[_0xd028('0x1a')]('\x20');}function getAccessTokenScope(_0x27fbd2){if(_0x27fbd2[_0xd028('0x15')]==='Outlook365')return _0xd028('0x1b');if(_0x27fbd2['type']===_0xd028('0x16'))return _0x27fbd2[_0xd028('0x18')]+_0xd028('0x19');}function generateMicrosoftAuthorizationUrl(_0x3fd50e,_0x4ad8c3){var _0x5e831e=MICROSOFT_AUTH_URL[_0xd028('0x1c')](_0xd028('0x1d'),_0x3fd50e['data2']);var _0x20d1c7=[_0xd028('0x1e'),'id_token'];var _0x2d9648=Buffer[_0xd028('0x1f')](JSON[_0xd028('0x20')]({'id':_0x4ad8c3}))[_0xd028('0x21')](_0xd028('0x22'));var _0x529455=crypto['randomBytes'](0x10)['toString']('hex');var _0x4405f3=getAuthorizationScopes(_0x3fd50e);var _0x4e6b1=[{'key':_0xd028('0x23'),'value':_0x3fd50e[_0xd028('0x24')]},{'key':_0xd028('0x25'),'value':encodeURIComponent(_0x20d1c7[_0xd028('0x1a')]('\x20'))},{'key':_0xd028('0x26'),'value':_0x3fd50e[_0xd028('0x27')]},{'key':_0xd028('0x28'),'value':'form_post'},{'key':_0xd028('0x29'),'value':encodeURIComponent(_0x4405f3)},{'key':_0xd028('0x2a'),'value':_0x2d9648},{'key':_0xd028('0x2b'),'value':_0x529455},{'key':_0xd028('0x2c'),'value':'login'}];var _0x90e917=_0x5e831e+MICROSOFT_AUTH_ENDPOINT+'?'+_[_0xd028('0x2d')](_0x4e6b1,function(_0x1845c3){return _0x1845c3['key']+'='+_0x1845c3[_0xd028('0x2e')];})[_0xd028('0x1a')]('&');_0x3fd50e['oauth2Claims']={'issuer':_0x5e831e[_0xd028('0x1c')](_0xd028('0x2f'),''),'audience':_0x3fd50e[_0xd028('0x24')],'state':_0x2d9648,'nonce':_0x529455};redis[_0xd028('0x30')](_0x2d9648,JSON[_0xd028('0x20')](_0x3fd50e));return _0x90e917;}function isValidIdToken(_0xa6ddd0,_0x210454){try{var _0x24b44f=jwt['decode'](_0xa6ddd0,{'complete':!![]});var _0x3aa511=_0x24b44f['payload'];if(_0x3aa511[_0xd028('0x31')]!==_0x210454[_0xd028('0x32')])return![];if(_0x3aa511[_0xd028('0x33')]!==_0x210454[_0xd028('0x34')])return![];if(_0x3aa511['nonce']!==_0x210454[_0xd028('0x2b')])return![];if(moment()['isAfter'](moment['unix'](_0x3aa511[_0xd028('0x35')])))return![];return!![];}catch(_0x2504d5){throw _0x2504d5;}}function refreshOauth2MicrosoftAccessToken(_0x47c9a6){return Promise['resolve']()[_0xd028('0x36')](function(){if(_0x47c9a6[_0xd028('0x37')])return _0x47c9a6;return db[_0xd028('0x38')]['findOne']({'where':{'id':_0x47c9a6['id']},'raw':!![]});})[_0xd028('0x36')](function(_0xa09c4e){var _0x55c3ef={'grant_type':_0xd028('0x39'),'refresh_token':_0xa09c4e[_0xd028('0x3a')],'scope':getAccessTokenScope(_0xa09c4e),'redirect_uri':_0xa09c4e[_0xd028('0x27')],'client_id':_0xa09c4e[_0xd028('0x24')],'client_secret':encryptor[_0xd028('0x3b')](_0xa09c4e[_0xd028('0x37')])};var _0xdc9589={'method':_0xd028('0x3c'),'uri':MICROSOFT_AUTH_URL['replace'](_0xd028('0x1d'),_0xa09c4e[_0xd028('0x3d')])+MICROSOFT_TOKEN_ENDPOINT,'form':_0x55c3ef,'json':!![]};return rp(_0xdc9589);})[_0xd028('0x36')](function(_0xa17273){_0x47c9a6[_0xd028('0x3e')]=_0xa17273[_0xd028('0x3f')];_0x47c9a6[_0xd028('0x3a')]=_0xa17273[_0xd028('0x39')];return db[_0xd028('0x38')][_0xd028('0x40')]({'data5':_0x47c9a6[_0xd028('0x3e')],'data6':_0x47c9a6['data6']},{'where':{'id':_0x47c9a6['id']}});})[_0xd028('0x36')](function(){return _0x47c9a6;})[_0xd028('0x41')](function(_0x325adc){logger[_0xd028('0x42')](_0xd028('0x43'),_0x47c9a6['id'],_0x325adc);});}function getOauth2MicrosoftAccessToken(_0x5bc529,_0x35bf33){var _0x192138={'grant_type':_0xd028('0x44'),'code':_0x5bc529,'scope':getAccessTokenScope(_0x35bf33),'redirect_uri':_0x35bf33[_0xd028('0x27')],'client_id':_0x35bf33[_0xd028('0x24')],'client_secret':encryptor[_0xd028('0x3b')](_0x35bf33[_0xd028('0x37')])};var _0x3ebd9a={'method':_0xd028('0x3c'),'uri':MICROSOFT_AUTH_URL[_0xd028('0x1c')]('{TENANT_ID}',_0x35bf33[_0xd028('0x3d')])+MICROSOFT_TOKEN_ENDPOINT,'form':_0x192138,'json':!![]};return rp(_0x3ebd9a);}function startRefreshInterval(_0x5638f1){var _0x3404a8=schedule[_0xd028('0x45')];if(_0x3404a8[_0x5638f1['id']])clearInterval(_0x3404a8[_0x5638f1['id']]);_0x3404a8[_0x5638f1['id']]=setInterval(refreshOauth2MicrosoftAccessToken['bind'](this,{'id':_0x5638f1['id']}),OAUTH_REFRESH_INTERVAL*0x3e8);schedule['intervals']=_0x3404a8;}function startAllRefreshIntervals(){return db[_0xd028('0x38')][_0xd028('0x46')]({'where':{'data6':{'$ne':null}},'raw':!![]})[_0xd028('0x36')](function(_0x54742){var _0x44e220=_0x54742[_0xd028('0x2d')](function(_0x1365d4){return refreshOauth2MicrosoftAccessToken(_0x1365d4)[_0xd028('0x36')](function(_0x15c1cd){startRefreshInterval(_0x15c1cd);});});return Promise['all'](_0x44e220);})[_0xd028('0x41')](function(_0x5f0ea8){var _0x151a73=_0x5f0ea8?util[_0xd028('0x47')](_0x5f0ea8,{'showHidden':![],'depth':null}):'';logger[_0xd028('0x42')](_0xd028('0x48'),_0x151a73);});}module[_0xd028('0x49')]={'generateMicrosoftAuthorizationUrl':generateMicrosoftAuthorizationUrl,'getOauth2MicrosoftAccessToken':getOauth2MicrosoftAccessToken,'isValidIdToken':isValidIdToken,'startAllRefreshIntervals':startAllRefreshIntervals,'refreshOauth2MicrosoftAccessToken':refreshOauth2MicrosoftAccessToken,'startRefreshInterval':startRefreshInterval};
\ No newline at end of file
+var _0x1a83=['stringify','toString','randomBytes','hex','client_id','data1','response_type','join','redirect_uri','data4','state','nonce','prompt','oauth2/','set','decode','payload','iss','issuer','audience','isAfter','unix','exp','then','data3','CloudProvider','findOne','refresh_token','decryptString','POST','data2','access_token','data6','update','data5','catch','error','Failed\x20to\x20refresh\x20access\x20token\x20for\x20cloud\x20provider\x20#%s,\x20-\x20err:%s','authorization_code','{TENANT_ID}','intervals','bind','findAll','all','[CLOUD_PROVIDER]\x20Error\x20while\x20refreshing\x20the\x20tokens\x20after\x20service\x20restart\x20error:%s','exports','crypto','jsonwebtoken','moment','request-promise','../../components/encryptor','../../config/environment','../../config/logger','api','../../mysqldb','redis','localhost','offline_access','https://outlook.office365.com/IMAP.AccessAsUser.All','https://outlook.office.com/POP.AccessAsUser.All','https://outlook.office.com/SMTP.Send','openid','/authorize','map','type','Dynamics365','push','data7','/.default','Outlook365','replace','from'];(function(_0x465028,_0x4570ac){var _0xb783d4=function(_0x5458c5){while(--_0x5458c5){_0x465028['push'](_0x465028['shift']());}};_0xb783d4(++_0x4570ac);}(_0x1a83,0x1de));var _0x31a8=function(_0x542869,_0x5ec5e5){_0x542869=_0x542869-0x0;var _0x1fd6d3=_0x1a83[_0x542869];return _0x1fd6d3;};'use strict';var _=require('lodash');var crypto=require(_0x31a8('0x0'));var jwt=require(_0x31a8('0x1'));var moment=require(_0x31a8('0x2'));var Redis=require('ioredis');var rp=require(_0x31a8('0x3'));var util=require('util');var encryptor=require(_0x31a8('0x4'));var config=require(_0x31a8('0x5'));var logger=require(_0x31a8('0x6'))(_0x31a8('0x7'));var schedule=require('../../config/schedule/cloud-provider');var db=require(_0x31a8('0x8'))['db'];config['redis']=_['defaults'](config[_0x31a8('0x9')],{'host':_0x31a8('0xa'),'port':0x18eb});var redis=new Redis(config[_0x31a8('0x9')]);var MICROSOFT_AUTH_URL='https://login.microsoftonline.com/{TENANT_ID}/oauth2/v2.0';var AZURE_AUTH_SCOPES={'Outlook365':['openid','profile','email',_0x31a8('0xb'),_0x31a8('0xc'),_0x31a8('0xd'),_0x31a8('0xe')],'Dynamics365':[_0x31a8('0xf'),_0x31a8('0xb')]};var MICROSOFT_AUTH_ENDPOINT=_0x31a8('0x10');var MICROSOFT_TOKEN_ENDPOINT='/token';var OAUTH_REFRESH_INTERVAL=0xfa;function getAuthorizationScopes(_0x302e32){var _0x105ce8=_[_0x31a8('0x11')](AZURE_AUTH_SCOPES[_0x302e32['type']]);if(_0x302e32[_0x31a8('0x12')]===_0x31a8('0x13'))_0x105ce8[_0x31a8('0x14')](_0x302e32[_0x31a8('0x15')]+_0x31a8('0x16'));return _0x105ce8['join']('\x20');}function getAccessTokenScope(_0x20017c){if(_0x20017c[_0x31a8('0x12')]===_0x31a8('0x17'))return _0x31a8('0xc');if(_0x20017c[_0x31a8('0x12')]===_0x31a8('0x13'))return _0x20017c['data7']+'/.default';}function generateMicrosoftAuthorizationUrl(_0x30a566,_0x2504be){var _0x2fe1d2=MICROSOFT_AUTH_URL[_0x31a8('0x18')]('{TENANT_ID}',_0x30a566['data2']);var _0x23ede3=['code','id_token'];var _0x4d7160=Buffer[_0x31a8('0x19')](JSON[_0x31a8('0x1a')]({'id':_0x2504be}))[_0x31a8('0x1b')]('base64');var _0x2d8ec1=crypto[_0x31a8('0x1c')](0x10)[_0x31a8('0x1b')](_0x31a8('0x1d'));var _0x45fdb2=getAuthorizationScopes(_0x30a566);var _0x107ad3=[{'key':_0x31a8('0x1e'),'value':_0x30a566[_0x31a8('0x1f')]},{'key':_0x31a8('0x20'),'value':encodeURIComponent(_0x23ede3[_0x31a8('0x21')]('\x20'))},{'key':_0x31a8('0x22'),'value':_0x30a566[_0x31a8('0x23')]},{'key':'response_mode','value':'form_post'},{'key':'scope','value':encodeURIComponent(_0x45fdb2)},{'key':_0x31a8('0x24'),'value':_0x4d7160},{'key':_0x31a8('0x25'),'value':_0x2d8ec1},{'key':_0x31a8('0x26'),'value':'login'}];var _0x46d640=_0x2fe1d2+MICROSOFT_AUTH_ENDPOINT+'?'+_['map'](_0x107ad3,function(_0x1af06a){return _0x1af06a['key']+'='+_0x1af06a['value'];})[_0x31a8('0x21')]('&');_0x30a566['oauth2Claims']={'issuer':_0x2fe1d2[_0x31a8('0x18')](_0x31a8('0x27'),''),'audience':_0x30a566['data1'],'state':_0x4d7160,'nonce':_0x2d8ec1};redis[_0x31a8('0x28')](_0x4d7160,JSON[_0x31a8('0x1a')](_0x30a566));return _0x46d640;}function isValidIdToken(_0xfb08fb,_0x4f87aa){try{var _0x20eba=jwt[_0x31a8('0x29')](_0xfb08fb,{'complete':!![]});var _0x5d8f86=_0x20eba[_0x31a8('0x2a')];if(_0x5d8f86[_0x31a8('0x2b')]!==_0x4f87aa[_0x31a8('0x2c')])return![];if(_0x5d8f86['aud']!==_0x4f87aa[_0x31a8('0x2d')])return![];if(_0x5d8f86[_0x31a8('0x25')]!==_0x4f87aa[_0x31a8('0x25')])return![];if(moment()[_0x31a8('0x2e')](moment[_0x31a8('0x2f')](_0x5d8f86[_0x31a8('0x30')])))return![];return!![];}catch(_0x55e65e){throw _0x55e65e;}}function refreshOauth2MicrosoftAccessToken(_0x2ce133){return Promise['resolve']()[_0x31a8('0x31')](function(){if(_0x2ce133[_0x31a8('0x32')])return _0x2ce133;return db[_0x31a8('0x33')][_0x31a8('0x34')]({'where':{'id':_0x2ce133['id']},'raw':!![]});})[_0x31a8('0x31')](function(_0x5d504d){var _0xf09bdd={'grant_type':_0x31a8('0x35'),'refresh_token':_0x5d504d['data6'],'scope':getAccessTokenScope(_0x5d504d),'redirect_uri':_0x5d504d[_0x31a8('0x23')],'client_id':_0x5d504d[_0x31a8('0x1f')],'client_secret':encryptor[_0x31a8('0x36')](_0x5d504d[_0x31a8('0x32')])};var _0x1dcf86={'method':_0x31a8('0x37'),'uri':MICROSOFT_AUTH_URL[_0x31a8('0x18')]('{TENANT_ID}',_0x5d504d[_0x31a8('0x38')])+MICROSOFT_TOKEN_ENDPOINT,'form':_0xf09bdd,'json':!![]};return rp(_0x1dcf86);})[_0x31a8('0x31')](function(_0x104532){_0x2ce133['data5']=_0x104532[_0x31a8('0x39')];_0x2ce133[_0x31a8('0x3a')]=_0x104532[_0x31a8('0x35')];return db[_0x31a8('0x33')][_0x31a8('0x3b')]({'data5':_0x2ce133[_0x31a8('0x3c')],'data6':_0x2ce133[_0x31a8('0x3a')]},{'where':{'id':_0x2ce133['id']}});})[_0x31a8('0x31')](function(){return _0x2ce133;})[_0x31a8('0x3d')](function(_0x2a22b6){logger[_0x31a8('0x3e')](_0x31a8('0x3f'),_0x2ce133['id'],_0x2a22b6);});}function getOauth2MicrosoftAccessToken(_0x466246,_0x579fd5){var _0x561828={'grant_type':_0x31a8('0x40'),'code':_0x466246,'scope':getAccessTokenScope(_0x579fd5),'redirect_uri':_0x579fd5[_0x31a8('0x23')],'client_id':_0x579fd5[_0x31a8('0x1f')],'client_secret':encryptor[_0x31a8('0x36')](_0x579fd5[_0x31a8('0x32')])};var _0x1bf7a6={'method':_0x31a8('0x37'),'uri':MICROSOFT_AUTH_URL[_0x31a8('0x18')](_0x31a8('0x41'),_0x579fd5[_0x31a8('0x38')])+MICROSOFT_TOKEN_ENDPOINT,'form':_0x561828,'json':!![]};return rp(_0x1bf7a6);}function startRefreshInterval(_0x5855b3){var _0x5db3ee=schedule[_0x31a8('0x42')];if(_0x5db3ee[_0x5855b3['id']])clearInterval(_0x5db3ee[_0x5855b3['id']]);_0x5db3ee[_0x5855b3['id']]=setInterval(refreshOauth2MicrosoftAccessToken[_0x31a8('0x43')](this,{'id':_0x5855b3['id']}),OAUTH_REFRESH_INTERVAL*0x3e8);schedule[_0x31a8('0x42')]=_0x5db3ee;}function startAllRefreshIntervals(){return db[_0x31a8('0x33')][_0x31a8('0x44')]({'where':{'data6':{'$ne':null}},'raw':!![]})[_0x31a8('0x31')](function(_0xb3471e){var _0xeebaee=_0xb3471e[_0x31a8('0x11')](function(_0x51a4ee){return refreshOauth2MicrosoftAccessToken(_0x51a4ee)[_0x31a8('0x31')](function(_0x12a073){startRefreshInterval(_0x12a073);});});return Promise[_0x31a8('0x45')](_0xeebaee);})[_0x31a8('0x3d')](function(_0x111adc){var _0x185f74=_0x111adc?util['inspect'](_0x111adc,{'showHidden':![],'depth':null}):'';logger[_0x31a8('0x3e')](_0x31a8('0x46'),_0x185f74);});}module[_0x31a8('0x47')]={'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 0909705..569e61c 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 _0xb6a6=['randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','then','info','CloudProvider,\x20%s,\x20%s','request\x20sent','stringify','code','error','message','catch','lodash','util'];(function(_0x475191,_0x5bce86){var _0x189e96=function(_0x46d6a2){while(--_0x46d6a2){_0x475191['push'](_0x475191['shift']());}};_0x189e96(++_0x5bce86);}(_0xb6a6,0x1a0));var _0x6b6a=function(_0x5c3649,_0x51f4e3){_0x5c3649=_0x5c3649-0x0;var _0x57ce71=_0xb6a6[_0x5c3649];return _0x57ce71;};'use strict';var _=require(_0x6b6a('0x0'));var util=require(_0x6b6a('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x6b6a('0x2'));var fs=require('fs');var Redis=require(_0x6b6a('0x3'));var db=require(_0x6b6a('0x4'))['db'];var utils=require(_0x6b6a('0x5'));var logger=require(_0x6b6a('0x6'))('rpc');var config=require(_0x6b6a('0x7'));var jayson=require(_0x6b6a('0x8'));var client=jayson[_0x6b6a('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x3ad201,_0x1895f7,_0x59e90c){return new BPromise(function(_0x43f878,_0x15ccc9){return client['request'](_0x3ad201,_0x59e90c)[_0x6b6a('0xa')](function(_0x58ff98){logger[_0x6b6a('0xb')](_0x6b6a('0xc'),_0x1895f7,_0x6b6a('0xd'));logger['debug']('CloudProvider,\x20%s,\x20%s,\x20%s',_0x1895f7,_0x6b6a('0xd'),JSON[_0x6b6a('0xe')](_0x58ff98));if(_0x58ff98['error']){if(_0x58ff98['error'][_0x6b6a('0xf')]===0x1f4){logger[_0x6b6a('0x10')]('CloudProvider,\x20%s,\x20%s',_0x1895f7,_0x58ff98[_0x6b6a('0x10')][_0x6b6a('0x11')]);return _0x15ccc9(_0x58ff98['error'][_0x6b6a('0x11')]);}logger[_0x6b6a('0x10')]('CloudProvider,\x20%s,\x20%s',_0x1895f7,_0x58ff98[_0x6b6a('0x10')][_0x6b6a('0x11')]);return _0x43f878(_0x58ff98[_0x6b6a('0x10')][_0x6b6a('0x11')]);}else{logger['info'](_0x6b6a('0xc'),_0x1895f7,_0x6b6a('0xd'));_0x43f878(_0x58ff98['result'][_0x6b6a('0x11')]);}})[_0x6b6a('0x12')](function(_0x126189){logger[_0x6b6a('0x10')](_0x6b6a('0xc'),_0x1895f7,_0x126189);_0x15ccc9(_0x126189);});});}
\ No newline at end of file
+var _0x3266=['../../config/environment','client','http','request','then','info','request\x20sent','debug','CloudProvider,\x20%s,\x20%s,\x20%s','stringify','error','code','CloudProvider,\x20%s,\x20%s','message','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger'];(function(_0x22bdd3,_0x552e50){var _0x44d9d9=function(_0x2b4ab9){while(--_0x2b4ab9){_0x22bdd3['push'](_0x22bdd3['shift']());}};_0x44d9d9(++_0x552e50);}(_0x3266,0x6a));var _0x6326=function(_0x1573ea,_0x434f02){_0x1573ea=_0x1573ea-0x0;var _0x51c0e2=_0x3266[_0x1573ea];return _0x51c0e2;};'use strict';var _=require(_0x6326('0x0'));var util=require(_0x6326('0x1'));var moment=require(_0x6326('0x2'));var BPromise=require(_0x6326('0x3'));var rs=require(_0x6326('0x4'));var fs=require('fs');var Redis=require(_0x6326('0x5'));var db=require(_0x6326('0x6'))['db'];var utils=require(_0x6326('0x7'));var logger=require(_0x6326('0x8'))('rpc');var config=require(_0x6326('0x9'));var jayson=require('jayson/promise');var client=jayson[_0x6326('0xa')][_0x6326('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x14208e,_0x5402e5,_0x161f4e){return new BPromise(function(_0x5730e7,_0x2af571){return client[_0x6326('0xc')](_0x14208e,_0x161f4e)[_0x6326('0xd')](function(_0x1aee60){logger[_0x6326('0xe')]('CloudProvider,\x20%s,\x20%s',_0x5402e5,_0x6326('0xf'));logger[_0x6326('0x10')](_0x6326('0x11'),_0x5402e5,_0x6326('0xf'),JSON[_0x6326('0x12')](_0x1aee60));if(_0x1aee60[_0x6326('0x13')]){if(_0x1aee60[_0x6326('0x13')][_0x6326('0x14')]===0x1f4){logger[_0x6326('0x13')](_0x6326('0x15'),_0x5402e5,_0x1aee60['error']['message']);return _0x2af571(_0x1aee60[_0x6326('0x13')][_0x6326('0x16')]);}logger['error'](_0x6326('0x15'),_0x5402e5,_0x1aee60['error'][_0x6326('0x16')]);return _0x5730e7(_0x1aee60[_0x6326('0x13')][_0x6326('0x16')]);}else{logger[_0x6326('0xe')](_0x6326('0x15'),_0x5402e5,_0x6326('0xf'));_0x5730e7(_0x1aee60['result'][_0x6326('0x16')]);}})['catch'](function(_0x5945ee){logger['error']('CloudProvider,\x20%s,\x20%s',_0x5402e5,_0x5945ee);_0x2af571(_0x5945ee);});});}
\ No newline at end of file
diff --git a/server/api/cloudProvider/index.js b/server/api/cloudProvider/index.js
index 5be8123..ae53579 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 _0x1261=['/:id','show','create','put','update','delete','/:id/oauth2/microsoft/authorize/','post','exports','Router','../../components/auth/service','./cloudProvider.controller','get','isAuthenticated','index'];(function(_0x2a558d,_0x2df0ff){var _0xa7bc9c=function(_0x12a30e){while(--_0x12a30e){_0x2a558d['push'](_0x2a558d['shift']());}};_0xa7bc9c(++_0x2df0ff);}(_0x1261,0x144));var _0x1126=function(_0x165718,_0x49ae0b){_0x165718=_0x165718-0x0;var _0x2e57b2=_0x1261[_0x165718];return _0x2e57b2;};'use strict';var express=require('express');var router=express[_0x1126('0x0')]();var auth=require(_0x1126('0x1'));var controller=require(_0x1126('0x2'));router[_0x1126('0x3')]('/',auth[_0x1126('0x4')](),controller[_0x1126('0x5')]);router[_0x1126('0x3')](_0x1126('0x6'),auth[_0x1126('0x4')](),controller[_0x1126('0x7')]);router['post']('/',auth['isAuthenticated'](),controller[_0x1126('0x8')]);router[_0x1126('0x9')]('/:id',auth[_0x1126('0x4')](),controller[_0x1126('0xa')]);router[_0x1126('0xb')](_0x1126('0x6'),auth[_0x1126('0x4')](),controller['destroy']);router[_0x1126('0x3')](_0x1126('0xc'),auth[_0x1126('0x4')](),controller['oauth2MicrosoftAuthorize']);router[_0x1126('0xd')]('/oauth2/microsoft/callback',controller['oauth2MicrosoftCallback']);module[_0x1126('0xe')]=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(_0x1cedfd,_0x2a4c73){var _0x4b854c=function(_0x77dd26){while(--_0x77dd26){_0x1cedfd['push'](_0x1cedfd['shift']());}};_0x4b854c(++_0x2a4c73);}(_0xadb5,0xad));var _0x5adb=function(_0x166d1e,_0x287db2){_0x166d1e=_0x166d1e-0x0;var _0x53dc60=_0xadb5[_0x166d1e];return _0x53dc60;};'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 ddff57d..b1dccb0 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 _0x5b7c=['STRING','name','exports'];(function(_0xc8db6b,_0x320abd){var _0x12cb81=function(_0x417540){while(--_0x417540){_0xc8db6b['push'](_0xc8db6b['shift']());}};_0x12cb81(++_0x320abd);}(_0x5b7c,0x107));var _0xc5b7=function(_0x4036aa,_0x514bb5){_0x4036aa=_0x4036aa-0x0;var _0x429d34=_0x5b7c[_0x4036aa];return _0x429d34;};'use strict';var Sequelize=require('sequelize');module[_0xc5b7('0x0')]={'name':{'type':Sequelize[_0xc5b7('0x1')],'unique':_0xc5b7('0x2'),'allowNull':![],'validate':{'notEmpty':!![]}},'vat':{'type':Sequelize[_0xc5b7('0x1')]},'companyId':{'type':Sequelize[_0xc5b7('0x1')]},'website':{'type':Sequelize['STRING']},'phone':{'type':Sequelize['STRING']},'fax':{'type':Sequelize[_0xc5b7('0x1')]},'type':{'type':Sequelize[_0xc5b7('0x1')]},'street':{'type':Sequelize[_0xc5b7('0x1')]},'postalCode':{'type':Sequelize[_0xc5b7('0x1')]},'city':{'type':Sequelize[_0xc5b7('0x1')]},'country':{'type':Sequelize[_0xc5b7('0x1')]},'email':{'type':Sequelize[_0xc5b7('0x1')],'validate':{'isEmail':!![]}},'emailDomain':{'type':Sequelize[_0xc5b7('0x1')]},'sStreet':{'type':Sequelize[_0xc5b7('0x1')]},'sPostalCode':{'type':Sequelize[_0xc5b7('0x1')]},'sCity':{'type':Sequelize[_0xc5b7('0x1')]},'sCountry':{'type':Sequelize[_0xc5b7('0x1')]},'description':{'type':Sequelize[_0xc5b7('0x1')]}};
\ No newline at end of file
+var _0xda9c=['exports','STRING','name','sequelize'];(function(_0x40d484,_0x32dbd9){var _0x85631c=function(_0x4fe3a0){while(--_0x4fe3a0){_0x40d484['push'](_0x40d484['shift']());}};_0x85631c(++_0x32dbd9);}(_0xda9c,0x7b));var _0xcda9=function(_0x5b6062,_0xc9963b){_0x5b6062=_0x5b6062-0x0;var _0x4b5a48=_0xda9c[_0x5b6062];return _0x4b5a48;};'use strict';var Sequelize=require(_0xcda9('0x0'));module[_0xcda9('0x1')]={'name':{'type':Sequelize[_0xcda9('0x2')],'unique':_0xcda9('0x3'),'allowNull':![],'validate':{'notEmpty':!![]}},'vat':{'type':Sequelize[_0xcda9('0x2')]},'companyId':{'type':Sequelize[_0xcda9('0x2')]},'website':{'type':Sequelize[_0xcda9('0x2')]},'phone':{'type':Sequelize[_0xcda9('0x2')]},'fax':{'type':Sequelize[_0xcda9('0x2')]},'type':{'type':Sequelize[_0xcda9('0x2')]},'street':{'type':Sequelize[_0xcda9('0x2')]},'postalCode':{'type':Sequelize[_0xcda9('0x2')]},'city':{'type':Sequelize[_0xcda9('0x2')]},'country':{'type':Sequelize['STRING']},'email':{'type':Sequelize['STRING'],'validate':{'isEmail':!![]}},'emailDomain':{'type':Sequelize['STRING']},'sStreet':{'type':Sequelize['STRING']},'sPostalCode':{'type':Sequelize[_0xcda9('0x2')]},'sCity':{'type':Sequelize[_0xcda9('0x2')]},'sCountry':{'type':Sequelize[_0xcda9('0x2')]},'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 fefc468..65ad10c 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 _0x12eb=['request-promise','bluebird','mustache','util','sox','to-csv','fs-extra','squel','crypto','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','sendStatus','status','end','json','offset','undefined','limit','count','Content-Range','apply','save','then','get','Companies','destroy','error','stack','name','send','describe','query','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filters','pick','filter','merge','map','options','CmCompany','includeAll','include','findAll','catch','show','params','keys','find','create','body','user','role','UserProfileSection','userProfileId','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','addContacts','CmContact','ids','omit','findOne','rawAttributes','getContacts','rimraf','zip-dir','fast-json-patch'];(function(_0x5c6a78,_0x5c0503){var _0x236c5e=function(_0x44ef45){while(--_0x44ef45){_0x5c6a78['push'](_0x5c6a78['shift']());}};_0x236c5e(++_0x5c0503);}(_0x12eb,0x1a6));var _0xb12e=function(_0x4a9fb1,_0x273043){_0x4a9fb1=_0x4a9fb1-0x0;var _0x348672=_0x12eb[_0x4a9fb1];return _0x348672;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xb12e('0x0'));var zipdir=require(_0xb12e('0x1'));var jsonpatch=require(_0xb12e('0x2'));var rp=require(_0xb12e('0x3'));var moment=require('moment');var BPromise=require(_0xb12e('0x4'));var Mustache=require(_0xb12e('0x5'));var util=require(_0xb12e('0x6'));var path=require('path');var sox=require(_0xb12e('0x7'));var csv=require(_0xb12e('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xb12e('0x9'));var _=require('lodash');var squel=require(_0xb12e('0xa'));var crypto=require(_0xb12e('0xb'));var jsforce=require('jsforce');var deskjs=require(_0xb12e('0xc'));var toCsv=require(_0xb12e('0x8'));var querystring=require(_0xb12e('0xd'));var Papa=require(_0xb12e('0xe'));var Redis=require(_0xb12e('0xf'));var authService=require(_0xb12e('0x10'));var qs=require('../../components/parsers/qs');var as=require(_0xb12e('0x11'));var hardwareService=require(_0xb12e('0x12'));var logger=require(_0xb12e('0x13'))(_0xb12e('0x14'));var utils=require(_0xb12e('0x15'));var config=require('../../config/environment');var licenseUtil=require(_0xb12e('0x16'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x5cac3f,_0x52d2fe){_0x52d2fe=_0x52d2fe||0xcc;return function(_0x44641c){if(_0x44641c){return _0x5cac3f[_0xb12e('0x17')](_0x52d2fe);}return _0x5cac3f[_0xb12e('0x18')](_0x52d2fe)[_0xb12e('0x19')]();};}function respondWithResult(_0x17ec95,_0x1227bb){_0x1227bb=_0x1227bb||0xc8;return function(_0x1215a0){if(_0x1215a0){return _0x17ec95[_0xb12e('0x18')](_0x1227bb)[_0xb12e('0x1a')](_0x1215a0);}};}function respondWithFilteredResult(_0xa4dc7d,_0x460c38){return function(_0x312ec0){if(_0x312ec0){var _0x5891f0=typeof _0x460c38[_0xb12e('0x1b')]===_0xb12e('0x1c')&&typeof _0x460c38[_0xb12e('0x1d')]===_0xb12e('0x1c');var _0x33f09e=_0x312ec0[_0xb12e('0x1e')];var _0x21fd27=_0x5891f0?0x0:_0x460c38[_0xb12e('0x1b')];var _0x5a7ed1=_0x5891f0?_0x312ec0[_0xb12e('0x1e')]:_0x460c38['offset']+_0x460c38['limit'];var _0x538bbf;if(_0x5a7ed1>=_0x33f09e){_0x5a7ed1=_0x33f09e;_0x538bbf=0xc8;}else{_0x538bbf=0xce;}_0xa4dc7d[_0xb12e('0x18')](_0x538bbf);return _0xa4dc7d['set'](_0xb12e('0x1f'),_0x21fd27+'-'+_0x5a7ed1+'/'+_0x33f09e)[_0xb12e('0x1a')](_0x312ec0);}return null;};}function patchUpdates(_0x4707a3){return function(_0x1537f6){try{jsonpatch[_0xb12e('0x20')](_0x1537f6,_0x4707a3,!![]);}catch(_0x2faad5){return BPromise['reject'](_0x2faad5);}return _0x1537f6[_0xb12e('0x21')]();};}function saveUpdates(_0x16508b,_0x4cb3fb){return function(_0x77d349){if(_0x77d349){return _0x77d349['update'](_0x16508b)[_0xb12e('0x22')](function(_0x19984d){return _0x19984d;});}return null;};}function removeEntity(_0x4e5af4,_0x27b7e1){return function(_0x488269){if(_0x488269){return _0x488269['destroy']()[_0xb12e('0x22')](function(){var _0x136a8a=_0x488269[_0xb12e('0x23')]({'plain':!![]});var _0x489650=_0xb12e('0x24');return db['UserProfileResource'][_0xb12e('0x25')]({'where':{'type':_0x489650,'resourceId':_0x136a8a['id']}})[_0xb12e('0x22')](function(){return _0x488269;});})[_0xb12e('0x22')](function(){_0x4e5af4[_0xb12e('0x18')](0xcc)[_0xb12e('0x19')]();});}};}function handleEntityNotFound(_0x5c77bf,_0x49d2db){return function(_0x31420b){if(!_0x31420b){_0x5c77bf[_0xb12e('0x17')](0x194);}return _0x31420b;};}function handleError(_0x251d19,_0xc41455){_0xc41455=_0xc41455||0x1f4;return function(_0x5dd180){logger[_0xb12e('0x26')](_0x5dd180[_0xb12e('0x27')]);if(_0x5dd180[_0xb12e('0x28')]){delete _0x5dd180['name'];}_0x251d19[_0xb12e('0x18')](_0xc41455)[_0xb12e('0x29')](_0x5dd180);};}exports['index']=function(_0xbec460,_0x3f79fd){var _0x4d826c={},_0x5a38c8={},_0xee58e4={'count':0x0,'rows':[]};return db['CmCompany'][_0xb12e('0x2a')]()[_0xb12e('0x22')](function(_0x14dbe9){_0x5a38c8['model']=_['keys'](_0x14dbe9);_0x5a38c8['query']=_['keys'](_0xbec460[_0xb12e('0x2b')]);_0x5a38c8['filters']=_[_0xb12e('0x2c')](_0x5a38c8[_0xb12e('0x2d')],_0x5a38c8[_0xb12e('0x2b')]);_0x4d826c[_0xb12e('0x2e')]=_[_0xb12e('0x2c')](_0x5a38c8[_0xb12e('0x2d')],qs[_0xb12e('0x2f')](_0xbec460[_0xb12e('0x2b')][_0xb12e('0x2f')]));_0x4d826c[_0xb12e('0x2e')]=_0x4d826c[_0xb12e('0x2e')][_0xb12e('0x30')]?_0x4d826c['attributes']:_0x5a38c8[_0xb12e('0x2d')];if(!_0xbec460['query'][_0xb12e('0x31')](_0xb12e('0x32'))){_0x4d826c[_0xb12e('0x1d')]=qs[_0xb12e('0x1d')](_0xbec460[_0xb12e('0x2b')][_0xb12e('0x1d')]);_0x4d826c['offset']=qs[_0xb12e('0x1b')](_0xbec460[_0xb12e('0x2b')][_0xb12e('0x1b')]);}_0x4d826c[_0xb12e('0x33')]=qs[_0xb12e('0x34')](_0xbec460['query'][_0xb12e('0x34')]);_0x4d826c[_0xb12e('0x35')]=qs[_0xb12e('0x36')](_[_0xb12e('0x37')](_0xbec460[_0xb12e('0x2b')],_0x5a38c8[_0xb12e('0x36')]),_0x14dbe9);if(_0xbec460[_0xb12e('0x2b')][_0xb12e('0x38')]){_0x4d826c[_0xb12e('0x35')]=_[_0xb12e('0x39')](_0x4d826c[_0xb12e('0x35')],{'$or':_[_0xb12e('0x3a')](_0x4d826c[_0xb12e('0x2e')],function(_0x34bee9){var _0x3940d9={};_0x3940d9[_0x34bee9]={'$like':'%'+_0xbec460[_0xb12e('0x2b')][_0xb12e('0x38')]+'%'};return _0x3940d9;})});}_0x4d826c=_['merge']({},_0x4d826c,_0xbec460[_0xb12e('0x3b')]);var _0x259056={'where':_0x4d826c[_0xb12e('0x35')]};return db[_0xb12e('0x3c')]['count'](_0x259056)[_0xb12e('0x22')](function(_0xe765e2){_0xee58e4[_0xb12e('0x1e')]=_0xe765e2;if(_0xbec460[_0xb12e('0x2b')][_0xb12e('0x3d')]){_0x4d826c[_0xb12e('0x3e')]=[{'all':!![]}];}return db[_0xb12e('0x3c')][_0xb12e('0x3f')](_0x4d826c);})[_0xb12e('0x22')](function(_0x517432){_0xee58e4['rows']=_0x517432;return _0xee58e4;})[_0xb12e('0x22')](respondWithFilteredResult(_0x3f79fd,_0x4d826c))[_0xb12e('0x40')](handleError(_0x3f79fd,null));})[_0xb12e('0x40')](handleError(_0x3f79fd,null));};exports[_0xb12e('0x41')]=function(_0x472c8b,_0x4f7ef7){var _0x4e4633={'raw':![],'where':{'id':_0x472c8b[_0xb12e('0x42')]['id']}},_0xa3e1ff={};_0xa3e1ff[_0xb12e('0x2d')]=_[_0xb12e('0x43')](db[_0xb12e('0x3c')]['rawAttributes']);_0xa3e1ff['query']=_['keys'](_0x472c8b['query']);_0xa3e1ff['filters']=_[_0xb12e('0x2c')](_0xa3e1ff[_0xb12e('0x2d')],_0xa3e1ff['query']);_0x4e4633[_0xb12e('0x2e')]=_[_0xb12e('0x2c')](_0xa3e1ff['model'],qs[_0xb12e('0x2f')](_0x472c8b[_0xb12e('0x2b')][_0xb12e('0x2f')]));_0x4e4633[_0xb12e('0x2e')]=_0x4e4633[_0xb12e('0x2e')]['length']?_0x4e4633[_0xb12e('0x2e')]:_0xa3e1ff[_0xb12e('0x2d')];if(_0x472c8b['query'][_0xb12e('0x3d')]){_0x4e4633[_0xb12e('0x3e')]=[{'all':!![]}];}_0x4e4633=_[_0xb12e('0x39')]({},_0x4e4633,_0x472c8b[_0xb12e('0x3b')]);return db[_0xb12e('0x3c')][_0xb12e('0x44')](_0x4e4633)[_0xb12e('0x22')](handleEntityNotFound(_0x4f7ef7,null))[_0xb12e('0x22')](respondWithResult(_0x4f7ef7,null))[_0xb12e('0x40')](handleError(_0x4f7ef7,null));};exports['create']=function(_0x2e7506,_0x4a3e1f){return db[_0xb12e('0x3c')][_0xb12e('0x45')](_0x2e7506[_0xb12e('0x46')],{})[_0xb12e('0x22')](function(_0x28584e){var _0x11fee8=_0x2e7506[_0xb12e('0x47')][_0xb12e('0x23')]({'plain':!![]});if(!_0x11fee8)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x11fee8[_0xb12e('0x48')]===_0xb12e('0x47')){var _0x55065b=_0x28584e[_0xb12e('0x23')]({'plain':!![]});var _0xd5d1f6='Companies';return db[_0xb12e('0x49')]['find']({'where':{'name':_0xd5d1f6,'userProfileId':_0x11fee8[_0xb12e('0x4a')]},'raw':!![]})[_0xb12e('0x22')](function(_0x8f02a8){if(_0x8f02a8&&_0x8f02a8['autoAssociation']===0x0){return db[_0xb12e('0x4b')][_0xb12e('0x45')]({'name':_0x55065b[_0xb12e('0x28')],'resourceId':_0x55065b['id'],'type':_0x8f02a8[_0xb12e('0x28')],'sectionId':_0x8f02a8['id']},{})['then'](function(){return _0x28584e;});}else{return _0x28584e;}})[_0xb12e('0x40')](function(_0x2a2e7c){logger[_0xb12e('0x26')](_0xb12e('0x4c'),_0x2a2e7c);throw _0x2a2e7c;});}return _0x28584e;})[_0xb12e('0x22')](respondWithResult(_0x4a3e1f,0xc9))['catch'](handleError(_0x4a3e1f,null));};exports[_0xb12e('0x4d')]=function(_0x1e7f1d,_0x1a1920){if(_0x1e7f1d[_0xb12e('0x46')]['id']){delete _0x1e7f1d[_0xb12e('0x46')]['id'];}return db[_0xb12e('0x3c')][_0xb12e('0x44')]({'where':{'id':_0x1e7f1d['params']['id']}})[_0xb12e('0x22')](handleEntityNotFound(_0x1a1920,null))[_0xb12e('0x22')](saveUpdates(_0x1e7f1d[_0xb12e('0x46')],null))['then'](respondWithResult(_0x1a1920,null))[_0xb12e('0x40')](handleError(_0x1a1920,null));};exports[_0xb12e('0x25')]=function(_0x54312e,_0x2aecf8){return db['CmCompany'][_0xb12e('0x44')]({'where':{'id':_0x54312e[_0xb12e('0x42')]['id']}})[_0xb12e('0x22')](handleEntityNotFound(_0x2aecf8,null))[_0xb12e('0x22')](removeEntity(_0x2aecf8,null))[_0xb12e('0x40')](handleError(_0x2aecf8,null));};exports['describe']=function(_0x202c1c,_0x165466){return db[_0xb12e('0x3c')][_0xb12e('0x2a')]()['then'](respondWithResult(_0x165466,null))[_0xb12e('0x40')](handleError(_0x165466,null));};exports[_0xb12e('0x4e')]=function(_0x122e0d,_0x3220e3,_0x5b4c8b){return db[_0xb12e('0x4f')][_0xb12e('0x44')]({'where':{'id':_0x122e0d[_0xb12e('0x42')]['id']}})[_0xb12e('0x22')](handleEntityNotFound(_0x3220e3,null))[_0xb12e('0x22')](function(_0x128b58){if(_0x128b58){return _0x128b58[_0xb12e('0x4e')](_0x122e0d['body'][_0xb12e('0x50')],_[_0xb12e('0x51')](_0x122e0d[_0xb12e('0x46')],['ids','id'])||{});}})[_0xb12e('0x22')](respondWithResult(_0x3220e3,null))['catch'](handleError(_0x3220e3,null));};exports['getContacts']=function(_0x56e621,_0x391c57,_0xb1be65){var _0x3af7f4={};var _0xaf364f={};var _0x1b2111;var _0x5aeecd;return db[_0xb12e('0x3c')][_0xb12e('0x52')]({'where':{'id':_0x56e621['params']['id']}})[_0xb12e('0x22')](handleEntityNotFound(_0x391c57,null))[_0xb12e('0x22')](function(_0x4f7692){if(_0x4f7692){_0x1b2111=_0x4f7692;_0xaf364f[_0xb12e('0x2d')]=_[_0xb12e('0x43')](db[_0xb12e('0x4f')][_0xb12e('0x53')]);_0xaf364f[_0xb12e('0x2b')]=_['keys'](_0x56e621['query']);_0xaf364f[_0xb12e('0x36')]=_['intersection'](_0xaf364f[_0xb12e('0x2d')],_0xaf364f[_0xb12e('0x2b')]);_0x3af7f4[_0xb12e('0x2e')]=_[_0xb12e('0x2c')](_0xaf364f[_0xb12e('0x2d')],qs['fields'](_0x56e621[_0xb12e('0x2b')]['fields']));_0x3af7f4[_0xb12e('0x2e')]=_0x3af7f4[_0xb12e('0x2e')][_0xb12e('0x30')]?_0x3af7f4[_0xb12e('0x2e')]:_0xaf364f['model'];_0x3af7f4[_0xb12e('0x33')]=qs[_0xb12e('0x34')](_0x56e621[_0xb12e('0x2b')]['sort']);_0x3af7f4['where']=qs[_0xb12e('0x36')](_[_0xb12e('0x37')](_0x56e621[_0xb12e('0x2b')],_0xaf364f[_0xb12e('0x36')]));if(_0x56e621[_0xb12e('0x2b')][_0xb12e('0x38')]){_0x3af7f4[_0xb12e('0x35')]=_[_0xb12e('0x39')](_0x3af7f4[_0xb12e('0x35')],{'$or':_[_0xb12e('0x3a')](_0x3af7f4[_0xb12e('0x2e')],function(_0x11accb){var _0x517660={};_0x517660[_0x11accb]={'$like':'%'+_0x56e621['query'][_0xb12e('0x38')]+'%'};return _0x517660;})});}_0x3af7f4=_[_0xb12e('0x39')]({},_0x3af7f4,_0x56e621['options']);return _0x1b2111['getContacts'](_0x3af7f4);}})[_0xb12e('0x22')](function(_0x18a594){if(_0x18a594){_0x5aeecd=_0x18a594[_0xb12e('0x30')];if(!_0x56e621[_0xb12e('0x2b')][_0xb12e('0x31')](_0xb12e('0x32'))){_0x3af7f4[_0xb12e('0x1d')]=qs[_0xb12e('0x1d')](_0x56e621[_0xb12e('0x2b')]['limit']);_0x3af7f4['offset']=qs[_0xb12e('0x1b')](_0x56e621[_0xb12e('0x2b')]['offset']);}return _0x1b2111[_0xb12e('0x54')](_0x3af7f4);}})[_0xb12e('0x22')](function(_0x2f3103){if(_0x2f3103){return _0x2f3103?{'count':_0x5aeecd,'rows':_0x2f3103}:null;}})[_0xb12e('0x22')](respondWithResult(_0x391c57,null))[_0xb12e('0x40')](handleError(_0x391c57,null));};
\ No newline at end of file
+var _0x9452=['offset','undefined','count','limit','set','Content-Range','reject','save','update','destroy','then','get','Companies','UserProfileResource','error','stack','name','send','index','describe','keys','query','filters','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','where','pick','merge','map','options','includeAll','include','CmCompany','findAll','rows','catch','rawAttributes','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','find','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','params','addContacts','CmContact','ids','omit','getContacts','findOne','sort','filter','zip-dir','fast-json-patch','request-promise','util','sox','to-csv','lodash','squel','crypto','jsforce','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/environment','../../config/license/util','sendStatus','end','status','json'];(function(_0x377e4d,_0x340622){var _0x5e1808=function(_0x2bf3dc){while(--_0x2bf3dc){_0x377e4d['push'](_0x377e4d['shift']());}};_0x5e1808(++_0x340622);}(_0x9452,0x139));var _0x2945=function(_0x113a43,_0x346326){_0x113a43=_0x113a43-0x0;var _0x2dc5e1=_0x9452[_0x113a43];return _0x2dc5e1;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x2945('0x0'));var jsonpatch=require(_0x2945('0x1'));var rp=require(_0x2945('0x2'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x2945('0x3'));var path=require('path');var sox=require(_0x2945('0x4'));var csv=require(_0x2945('0x5'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x2945('0x6'));var squel=require(_0x2945('0x7'));var crypto=require(_0x2945('0x8'));var jsforce=require(_0x2945('0x9'));var deskjs=require('desk.js');var toCsv=require(_0x2945('0x5'));var querystring=require(_0x2945('0xa'));var Papa=require(_0x2945('0xb'));var Redis=require('ioredis');var authService=require(_0x2945('0xc'));var qs=require(_0x2945('0xd'));var as=require(_0x2945('0xe'));var hardwareService=require(_0x2945('0xf'));var logger=require(_0x2945('0x10'))('api');var utils=require('../../config/utils');var config=require(_0x2945('0x11'));var licenseUtil=require(_0x2945('0x12'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x45d8a2,_0x4235bf){_0x4235bf=_0x4235bf||0xcc;return function(_0x4fe014){if(_0x4fe014){return _0x45d8a2[_0x2945('0x13')](_0x4235bf);}return _0x45d8a2['status'](_0x4235bf)[_0x2945('0x14')]();};}function respondWithResult(_0x524571,_0x255c9b){_0x255c9b=_0x255c9b||0xc8;return function(_0x283e0e){if(_0x283e0e){return _0x524571[_0x2945('0x15')](_0x255c9b)[_0x2945('0x16')](_0x283e0e);}};}function respondWithFilteredResult(_0x1a1904,_0x388279){return function(_0x2d8689){if(_0x2d8689){var _0x3057b7=typeof _0x388279[_0x2945('0x17')]==='undefined'&&typeof _0x388279['limit']===_0x2945('0x18');var _0x25cf31=_0x2d8689[_0x2945('0x19')];var _0x28784b=_0x3057b7?0x0:_0x388279['offset'];var _0x333993=_0x3057b7?_0x2d8689['count']:_0x388279[_0x2945('0x17')]+_0x388279[_0x2945('0x1a')];var _0x5b64c4;if(_0x333993>=_0x25cf31){_0x333993=_0x25cf31;_0x5b64c4=0xc8;}else{_0x5b64c4=0xce;}_0x1a1904[_0x2945('0x15')](_0x5b64c4);return _0x1a1904[_0x2945('0x1b')](_0x2945('0x1c'),_0x28784b+'-'+_0x333993+'/'+_0x25cf31)['json'](_0x2d8689);}return null;};}function patchUpdates(_0x296e8e){return function(_0x211c26){try{jsonpatch['apply'](_0x211c26,_0x296e8e,!![]);}catch(_0x253cf7){return BPromise[_0x2945('0x1d')](_0x253cf7);}return _0x211c26[_0x2945('0x1e')]();};}function saveUpdates(_0x46595b,_0xa3716b){return function(_0x5e43f4){if(_0x5e43f4){return _0x5e43f4[_0x2945('0x1f')](_0x46595b)['then'](function(_0x44ec14){return _0x44ec14;});}return null;};}function removeEntity(_0x33721a,_0x3964fc){return function(_0x175cf9){if(_0x175cf9){return _0x175cf9[_0x2945('0x20')]()[_0x2945('0x21')](function(){var _0xc146fe=_0x175cf9[_0x2945('0x22')]({'plain':!![]});var _0x15fb0e=_0x2945('0x23');return db[_0x2945('0x24')][_0x2945('0x20')]({'where':{'type':_0x15fb0e,'resourceId':_0xc146fe['id']}})['then'](function(){return _0x175cf9;});})[_0x2945('0x21')](function(){_0x33721a[_0x2945('0x15')](0xcc)['end']();});}};}function handleEntityNotFound(_0x189435,_0x130524){return function(_0x5d37e0){if(!_0x5d37e0){_0x189435['sendStatus'](0x194);}return _0x5d37e0;};}function handleError(_0x447987,_0xc99cd0){_0xc99cd0=_0xc99cd0||0x1f4;return function(_0x57dafa){logger[_0x2945('0x25')](_0x57dafa[_0x2945('0x26')]);if(_0x57dafa['name']){delete _0x57dafa[_0x2945('0x27')];}_0x447987['status'](_0xc99cd0)[_0x2945('0x28')](_0x57dafa);};}exports[_0x2945('0x29')]=function(_0x2c644e,_0x1587dd){var _0x114ef2={},_0x312553={},_0x5b6656={'count':0x0,'rows':[]};return db['CmCompany'][_0x2945('0x2a')]()[_0x2945('0x21')](function(_0x234c5e){_0x312553['model']=_[_0x2945('0x2b')](_0x234c5e);_0x312553[_0x2945('0x2c')]=_[_0x2945('0x2b')](_0x2c644e[_0x2945('0x2c')]);_0x312553[_0x2945('0x2d')]=_[_0x2945('0x2e')](_0x312553[_0x2945('0x2f')],_0x312553[_0x2945('0x2c')]);_0x114ef2[_0x2945('0x30')]=_[_0x2945('0x2e')](_0x312553[_0x2945('0x2f')],qs[_0x2945('0x31')](_0x2c644e[_0x2945('0x2c')][_0x2945('0x31')]));_0x114ef2['attributes']=_0x114ef2[_0x2945('0x30')][_0x2945('0x32')]?_0x114ef2[_0x2945('0x30')]:_0x312553[_0x2945('0x2f')];if(!_0x2c644e[_0x2945('0x2c')][_0x2945('0x33')](_0x2945('0x34'))){_0x114ef2[_0x2945('0x1a')]=qs[_0x2945('0x1a')](_0x2c644e[_0x2945('0x2c')][_0x2945('0x1a')]);_0x114ef2[_0x2945('0x17')]=qs[_0x2945('0x17')](_0x2c644e[_0x2945('0x2c')]['offset']);}_0x114ef2['order']=qs['sort'](_0x2c644e[_0x2945('0x2c')]['sort']);_0x114ef2[_0x2945('0x35')]=qs['filters'](_[_0x2945('0x36')](_0x2c644e[_0x2945('0x2c')],_0x312553[_0x2945('0x2d')]),_0x234c5e);if(_0x2c644e[_0x2945('0x2c')]['filter']){_0x114ef2[_0x2945('0x35')]=_[_0x2945('0x37')](_0x114ef2[_0x2945('0x35')],{'$or':_[_0x2945('0x38')](_0x114ef2['attributes'],function(_0x36699e){var _0x4b2326={};_0x4b2326[_0x36699e]={'$like':'%'+_0x2c644e[_0x2945('0x2c')]['filter']+'%'};return _0x4b2326;})});}_0x114ef2=_[_0x2945('0x37')]({},_0x114ef2,_0x2c644e[_0x2945('0x39')]);var _0x4893c1={'where':_0x114ef2[_0x2945('0x35')]};return db['CmCompany'][_0x2945('0x19')](_0x4893c1)[_0x2945('0x21')](function(_0x43301d){_0x5b6656[_0x2945('0x19')]=_0x43301d;if(_0x2c644e[_0x2945('0x2c')][_0x2945('0x3a')]){_0x114ef2[_0x2945('0x3b')]=[{'all':!![]}];}return db[_0x2945('0x3c')][_0x2945('0x3d')](_0x114ef2);})[_0x2945('0x21')](function(_0x58b0d5){_0x5b6656[_0x2945('0x3e')]=_0x58b0d5;return _0x5b6656;})[_0x2945('0x21')](respondWithFilteredResult(_0x1587dd,_0x114ef2))[_0x2945('0x3f')](handleError(_0x1587dd,null));})[_0x2945('0x3f')](handleError(_0x1587dd,null));};exports['show']=function(_0x18c483,_0x4a6a97){var _0x2a5e8c={'raw':![],'where':{'id':_0x18c483['params']['id']}},_0x4e4192={};_0x4e4192[_0x2945('0x2f')]=_['keys'](db[_0x2945('0x3c')][_0x2945('0x40')]);_0x4e4192[_0x2945('0x2c')]=_[_0x2945('0x2b')](_0x18c483['query']);_0x4e4192[_0x2945('0x2d')]=_[_0x2945('0x2e')](_0x4e4192[_0x2945('0x2f')],_0x4e4192[_0x2945('0x2c')]);_0x2a5e8c['attributes']=_[_0x2945('0x2e')](_0x4e4192['model'],qs[_0x2945('0x31')](_0x18c483['query']['fields']));_0x2a5e8c[_0x2945('0x30')]=_0x2a5e8c[_0x2945('0x30')][_0x2945('0x32')]?_0x2a5e8c[_0x2945('0x30')]:_0x4e4192[_0x2945('0x2f')];if(_0x18c483[_0x2945('0x2c')]['includeAll']){_0x2a5e8c[_0x2945('0x3b')]=[{'all':!![]}];}_0x2a5e8c=_['merge']({},_0x2a5e8c,_0x18c483[_0x2945('0x39')]);return db[_0x2945('0x3c')]['find'](_0x2a5e8c)[_0x2945('0x21')](handleEntityNotFound(_0x4a6a97,null))[_0x2945('0x21')](respondWithResult(_0x4a6a97,null))[_0x2945('0x3f')](handleError(_0x4a6a97,null));};exports[_0x2945('0x41')]=function(_0x5d1a0b,_0x11096a){return db['CmCompany']['create'](_0x5d1a0b['body'],{})['then'](function(_0x2a3180){var _0x85a80f=_0x5d1a0b[_0x2945('0x42')]['get']({'plain':!![]});if(!_0x85a80f)throw new Error(_0x2945('0x43'));if(_0x85a80f[_0x2945('0x44')]===_0x2945('0x42')){var _0x24e3f0=_0x2a3180[_0x2945('0x22')]({'plain':!![]});var _0x4fcb33='Companies';return db[_0x2945('0x45')][_0x2945('0x46')]({'where':{'name':_0x4fcb33,'userProfileId':_0x85a80f[_0x2945('0x47')]},'raw':!![]})[_0x2945('0x21')](function(_0x5a9238){if(_0x5a9238&&_0x5a9238[_0x2945('0x48')]===0x0){return db[_0x2945('0x24')][_0x2945('0x41')]({'name':_0x24e3f0[_0x2945('0x27')],'resourceId':_0x24e3f0['id'],'type':_0x5a9238[_0x2945('0x27')],'sectionId':_0x5a9238['id']},{})[_0x2945('0x21')](function(){return _0x2a3180;});}else{return _0x2a3180;}})[_0x2945('0x3f')](function(_0x27f609){logger['error'](_0x2945('0x49'),_0x27f609);throw _0x27f609;});}return _0x2a3180;})[_0x2945('0x21')](respondWithResult(_0x11096a,0xc9))[_0x2945('0x3f')](handleError(_0x11096a,null));};exports[_0x2945('0x1f')]=function(_0x3cfb82,_0x1d0f28){if(_0x3cfb82[_0x2945('0x4a')]['id']){delete _0x3cfb82['body']['id'];}return db[_0x2945('0x3c')][_0x2945('0x46')]({'where':{'id':_0x3cfb82[_0x2945('0x4b')]['id']}})[_0x2945('0x21')](handleEntityNotFound(_0x1d0f28,null))[_0x2945('0x21')](saveUpdates(_0x3cfb82[_0x2945('0x4a')],null))[_0x2945('0x21')](respondWithResult(_0x1d0f28,null))[_0x2945('0x3f')](handleError(_0x1d0f28,null));};exports['destroy']=function(_0x3f9718,_0x1cee35){return db[_0x2945('0x3c')][_0x2945('0x46')]({'where':{'id':_0x3f9718[_0x2945('0x4b')]['id']}})[_0x2945('0x21')](handleEntityNotFound(_0x1cee35,null))[_0x2945('0x21')](removeEntity(_0x1cee35,null))[_0x2945('0x3f')](handleError(_0x1cee35,null));};exports[_0x2945('0x2a')]=function(_0x3e5fc8,_0x3af17f){return db[_0x2945('0x3c')][_0x2945('0x2a')]()[_0x2945('0x21')](respondWithResult(_0x3af17f,null))['catch'](handleError(_0x3af17f,null));};exports[_0x2945('0x4c')]=function(_0xca3caa,_0x367841,_0x7e1d84){return db[_0x2945('0x4d')]['find']({'where':{'id':_0xca3caa[_0x2945('0x4b')]['id']}})[_0x2945('0x21')](handleEntityNotFound(_0x367841,null))[_0x2945('0x21')](function(_0x243f55){if(_0x243f55){return _0x243f55['addContacts'](_0xca3caa[_0x2945('0x4a')][_0x2945('0x4e')],_[_0x2945('0x4f')](_0xca3caa['body'],[_0x2945('0x4e'),'id'])||{});}})[_0x2945('0x21')](respondWithResult(_0x367841,null))[_0x2945('0x3f')](handleError(_0x367841,null));};exports[_0x2945('0x50')]=function(_0x985b10,_0x3f1905,_0x61b812){var _0x2420bc={};var _0x174fc4={};var _0x17f7d5;var _0x387472;return db[_0x2945('0x3c')][_0x2945('0x51')]({'where':{'id':_0x985b10['params']['id']}})['then'](handleEntityNotFound(_0x3f1905,null))[_0x2945('0x21')](function(_0x49d437){if(_0x49d437){_0x17f7d5=_0x49d437;_0x174fc4[_0x2945('0x2f')]=_[_0x2945('0x2b')](db[_0x2945('0x4d')]['rawAttributes']);_0x174fc4[_0x2945('0x2c')]=_[_0x2945('0x2b')](_0x985b10[_0x2945('0x2c')]);_0x174fc4[_0x2945('0x2d')]=_[_0x2945('0x2e')](_0x174fc4[_0x2945('0x2f')],_0x174fc4['query']);_0x2420bc[_0x2945('0x30')]=_[_0x2945('0x2e')](_0x174fc4[_0x2945('0x2f')],qs[_0x2945('0x31')](_0x985b10[_0x2945('0x2c')]['fields']));_0x2420bc[_0x2945('0x30')]=_0x2420bc[_0x2945('0x30')][_0x2945('0x32')]?_0x2420bc[_0x2945('0x30')]:_0x174fc4[_0x2945('0x2f')];_0x2420bc['order']=qs[_0x2945('0x52')](_0x985b10[_0x2945('0x2c')][_0x2945('0x52')]);_0x2420bc[_0x2945('0x35')]=qs[_0x2945('0x2d')](_[_0x2945('0x36')](_0x985b10[_0x2945('0x2c')],_0x174fc4[_0x2945('0x2d')]));if(_0x985b10[_0x2945('0x2c')]['filter']){_0x2420bc[_0x2945('0x35')]=_['merge'](_0x2420bc[_0x2945('0x35')],{'$or':_['map'](_0x2420bc[_0x2945('0x30')],function(_0x36ea65){var _0x54ca0b={};_0x54ca0b[_0x36ea65]={'$like':'%'+_0x985b10[_0x2945('0x2c')][_0x2945('0x53')]+'%'};return _0x54ca0b;})});}_0x2420bc=_['merge']({},_0x2420bc,_0x985b10['options']);return _0x17f7d5[_0x2945('0x50')](_0x2420bc);}})[_0x2945('0x21')](function(_0x3b0d37){if(_0x3b0d37){_0x387472=_0x3b0d37[_0x2945('0x32')];if(!_0x985b10['query'][_0x2945('0x33')](_0x2945('0x34'))){_0x2420bc[_0x2945('0x1a')]=qs['limit'](_0x985b10[_0x2945('0x2c')][_0x2945('0x1a')]);_0x2420bc[_0x2945('0x17')]=qs[_0x2945('0x17')](_0x985b10[_0x2945('0x2c')][_0x2945('0x17')]);}return _0x17f7d5['getContacts'](_0x2420bc);}})[_0x2945('0x21')](function(_0xeb1f0d){if(_0xeb1f0d){return _0xeb1f0d?{'count':_0x387472,'rows':_0xeb1f0d}:null;}})[_0x2945('0x21')](respondWithResult(_0x3f1905,null))[_0x2945('0x3f')](handleError(_0x3f1905,null));};
\ No newline at end of file
diff --git a/server/api/cmCompany/cmCompany.model.js b/server/api/cmCompany/cmCompany.model.js
index f79404e..02babea 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 _0x420d=['path','rimraf','../../config/environment','./cmCompany.attributes','exports','define','CmCompany','cm_companies','lodash','../../config/logger','api','moment','request-promise'];(function(_0xb4f705,_0x39327b){var _0x48e5b6=function(_0x37527e){while(--_0x37527e){_0xb4f705['push'](_0xb4f705['shift']());}};_0x48e5b6(++_0x39327b);}(_0x420d,0x126));var _0xd420=function(_0x5f1e00,_0x32a120){_0x5f1e00=_0x5f1e00-0x0;var _0x5d1743=_0x420d[_0x5f1e00];return _0x5d1743;};'use strict';var _=require(_0xd420('0x0'));var util=require('util');var logger=require(_0xd420('0x1'))(_0xd420('0x2'));var moment=require(_0xd420('0x3'));var BPromise=require('bluebird');var rp=require(_0xd420('0x4'));var fs=require('fs');var path=require(_0xd420('0x5'));var rimraf=require(_0xd420('0x6'));var config=require(_0xd420('0x7'));var attributes=require(_0xd420('0x8'));module[_0xd420('0x9')]=function(_0x44f838,_0x2cb500){return _0x44f838[_0xd420('0xa')](_0xd420('0xb'),attributes,{'tableName':_0xd420('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x89b0=['define','cm_companies','util','../../config/logger','api','moment','bluebird','path','rimraf','../../config/environment','./cmCompany.attributes','exports'];(function(_0x19950b,_0x53d0d7){var _0x3c6b41=function(_0x3924ad){while(--_0x3924ad){_0x19950b['push'](_0x19950b['shift']());}};_0x3c6b41(++_0x53d0d7);}(_0x89b0,0xda));var _0x089b=function(_0x4936e7,_0x3fc583){_0x4936e7=_0x4936e7-0x0;var _0x3e3f17=_0x89b0[_0x4936e7];return _0x3e3f17;};'use strict';var _=require('lodash');var util=require(_0x089b('0x0'));var logger=require(_0x089b('0x1'))(_0x089b('0x2'));var moment=require(_0x089b('0x3'));var BPromise=require(_0x089b('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x089b('0x5'));var rimraf=require(_0x089b('0x6'));var config=require(_0x089b('0x7'));var attributes=require(_0x089b('0x8'));module[_0x089b('0x9')]=function(_0x303c97,_0x516d9e){return _0x303c97[_0x089b('0xa')]('CmCompany',attributes,{'tableName':_0x089b('0xb'),'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 b12a161..b18f9de 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 _0x1894=['result','catch','lodash','moment','bluebird','randomstring','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','request','then','CmCompany,\x20%s,\x20%s','request\x20sent','debug','CmCompany,\x20%s,\x20%s,\x20%s','error','code','message','info'];(function(_0x2f82e7,_0x50f448){var _0x483927=function(_0x1f9d9c){while(--_0x1f9d9c){_0x2f82e7['push'](_0x2f82e7['shift']());}};_0x483927(++_0x50f448);}(_0x1894,0x1ce));var _0x4189=function(_0x8a30cf,_0x40f19b){_0x8a30cf=_0x8a30cf-0x0;var _0x20f439=_0x1894[_0x8a30cf];return _0x20f439;};'use strict';var _=require(_0x4189('0x0'));var util=require('util');var moment=require(_0x4189('0x1'));var BPromise=require(_0x4189('0x2'));var rs=require(_0x4189('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x4189('0x4'))['db'];var utils=require(_0x4189('0x5'));var logger=require('../../config/logger')(_0x4189('0x6'));var config=require(_0x4189('0x7'));var jayson=require(_0x4189('0x8'));var client=jayson[_0x4189('0x9')][_0x4189('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x448b,_0x342614,_0x4d4d43){return new BPromise(function(_0x2c7f64,_0x56bebd){return client[_0x4189('0xb')](_0x448b,_0x4d4d43)[_0x4189('0xc')](function(_0xb69e81){logger['info'](_0x4189('0xd'),_0x342614,_0x4189('0xe'));logger[_0x4189('0xf')](_0x4189('0x10'),_0x342614,_0x4189('0xe'),JSON['stringify'](_0xb69e81));if(_0xb69e81[_0x4189('0x11')]){if(_0xb69e81[_0x4189('0x11')][_0x4189('0x12')]===0x1f4){logger[_0x4189('0x11')](_0x4189('0xd'),_0x342614,_0xb69e81['error']['message']);return _0x56bebd(_0xb69e81[_0x4189('0x11')][_0x4189('0x13')]);}logger[_0x4189('0x11')]('CmCompany,\x20%s,\x20%s',_0x342614,_0xb69e81['error'][_0x4189('0x13')]);return _0x2c7f64(_0xb69e81[_0x4189('0x11')][_0x4189('0x13')]);}else{logger[_0x4189('0x14')]('CmCompany,\x20%s,\x20%s',_0x342614,_0x4189('0xe'));_0x2c7f64(_0xb69e81[_0x4189('0x15')][_0x4189('0x13')]);}})[_0x4189('0x16')](function(_0xa7730b){logger['error'](_0x4189('0xd'),_0x342614,_0xa7730b);_0x56bebd(_0xa7730b);});});}
\ No newline at end of file
+var _0x0efe=['lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','info','CmCompany,\x20%s,\x20%s','request\x20sent','debug','CmCompany,\x20%s,\x20%s,\x20%s','stringify','error','message','catch'];(function(_0x56482c,_0x16118d){var _0x5aae7a=function(_0x52512f){while(--_0x52512f){_0x56482c['push'](_0x56482c['shift']());}};_0x5aae7a(++_0x16118d);}(_0x0efe,0xd8));var _0xe0ef=function(_0x2fc7a2,_0x32ef0a){_0x2fc7a2=_0x2fc7a2-0x0;var _0x26cc9f=_0x0efe[_0x2fc7a2];return _0x26cc9f;};'use strict';var _=require(_0xe0ef('0x0'));var util=require(_0xe0ef('0x1'));var moment=require(_0xe0ef('0x2'));var BPromise=require(_0xe0ef('0x3'));var rs=require(_0xe0ef('0x4'));var fs=require('fs');var Redis=require(_0xe0ef('0x5'));var db=require(_0xe0ef('0x6'))['db'];var utils=require(_0xe0ef('0x7'));var logger=require(_0xe0ef('0x8'))(_0xe0ef('0x9'));var config=require(_0xe0ef('0xa'));var jayson=require(_0xe0ef('0xb'));var client=jayson[_0xe0ef('0xc')][_0xe0ef('0xd')]({'port':0x232a});function respondWithRpcPromise(_0x462c61,_0x2d8717,_0x34533e){return new BPromise(function(_0x701945,_0x1502c6){return client[_0xe0ef('0xe')](_0x462c61,_0x34533e)['then'](function(_0x81f8b8){logger[_0xe0ef('0xf')](_0xe0ef('0x10'),_0x2d8717,_0xe0ef('0x11'));logger[_0xe0ef('0x12')](_0xe0ef('0x13'),_0x2d8717,'request\x20sent',JSON[_0xe0ef('0x14')](_0x81f8b8));if(_0x81f8b8[_0xe0ef('0x15')]){if(_0x81f8b8[_0xe0ef('0x15')]['code']===0x1f4){logger[_0xe0ef('0x15')](_0xe0ef('0x10'),_0x2d8717,_0x81f8b8[_0xe0ef('0x15')][_0xe0ef('0x16')]);return _0x1502c6(_0x81f8b8[_0xe0ef('0x15')]['message']);}logger[_0xe0ef('0x15')](_0xe0ef('0x10'),_0x2d8717,_0x81f8b8[_0xe0ef('0x15')][_0xe0ef('0x16')]);return _0x701945(_0x81f8b8[_0xe0ef('0x15')][_0xe0ef('0x16')]);}else{logger['info'](_0xe0ef('0x10'),_0x2d8717,_0xe0ef('0x11'));_0x701945(_0x81f8b8['result'][_0xe0ef('0x16')]);}})[_0xe0ef('0x17')](function(_0x1fe7a0){logger[_0xe0ef('0x15')](_0xe0ef('0x10'),_0x2d8717,_0x1fe7a0);_0x1502c6(_0x1fe7a0);});});}
\ No newline at end of file
diff --git a/server/api/cmCompany/index.js b/server/api/cmCompany/index.js
index 4f83709..312cd79 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 _0xb48e=['getContacts','post','create','addContacts','put','update','delete','destroy','exports','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment','get','index','/describe','isAuthenticated','describe','/:id','show'];(function(_0x1e22c0,_0x1b0aec){var _0x2b9f0b=function(_0x25403d){while(--_0x25403d){_0x1e22c0['push'](_0x1e22c0['shift']());}};_0x2b9f0b(++_0x1b0aec);}(_0xb48e,0x1d1));var _0xeb48=function(_0x52ac2f,_0x1d478a){_0x52ac2f=_0x52ac2f-0x0;var _0x58e4ec=_0xb48e[_0x52ac2f];return _0x58e4ec;};'use strict';var multer=require('multer');var util=require(_0xeb48('0x0'));var path=require(_0xeb48('0x1'));var timeout=require(_0xeb48('0x2'));var express=require(_0xeb48('0x3'));var router=express[_0xeb48('0x4')]();var fs_extra=require(_0xeb48('0x5'));var auth=require(_0xeb48('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0xeb48('0x7'));var controller=require('./cmCompany.controller');router[_0xeb48('0x8')]('/',auth['isAuthenticated'](),controller[_0xeb48('0x9')]);router['get'](_0xeb48('0xa'),auth[_0xeb48('0xb')](),controller[_0xeb48('0xc')]);router[_0xeb48('0x8')](_0xeb48('0xd'),auth[_0xeb48('0xb')](),controller[_0xeb48('0xe')]);router[_0xeb48('0x8')]('/:id/contacts',auth['isAuthenticated'](),controller[_0xeb48('0xf')]);router[_0xeb48('0x10')]('/',auth[_0xeb48('0xb')](),controller[_0xeb48('0x11')]);router[_0xeb48('0x10')]('/:id/contacts',auth[_0xeb48('0xb')](),controller[_0xeb48('0x12')]);router[_0xeb48('0x13')]('/:id',auth[_0xeb48('0xb')](),controller[_0xeb48('0x14')]);router[_0xeb48('0x15')]('/:id',auth['isAuthenticated'](),controller[_0xeb48('0x16')]);module[_0xeb48('0x17')]=router;
\ No newline at end of file
+var _0xb03e=['../../config/environment','get','isAuthenticated','/describe','show','/:id/contacts','getContacts','post','create','addContacts','put','delete','/:id','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service'];(function(_0x4017b0,_0x4347db){var _0x5ed4f7=function(_0x706c26){while(--_0x706c26){_0x4017b0['push'](_0x4017b0['shift']());}};_0x5ed4f7(++_0x4347db);}(_0xb03e,0x6f));var _0xeb03=function(_0x410c76,_0xcbe5de){_0x410c76=_0x410c76-0x0;var _0x1a9850=_0xb03e[_0x410c76];return _0x1a9850;};'use strict';var multer=require(_0xeb03('0x0'));var util=require(_0xeb03('0x1'));var path=require(_0xeb03('0x2'));var timeout=require(_0xeb03('0x3'));var express=require(_0xeb03('0x4'));var router=express[_0xeb03('0x5')]();var fs_extra=require(_0xeb03('0x6'));var auth=require(_0xeb03('0x7'));var interaction=require(_0xeb03('0x8'));var config=require(_0xeb03('0x9'));var controller=require('./cmCompany.controller');router[_0xeb03('0xa')]('/',auth[_0xeb03('0xb')](),controller['index']);router[_0xeb03('0xa')](_0xeb03('0xc'),auth[_0xeb03('0xb')](),controller['describe']);router[_0xeb03('0xa')]('/:id',auth[_0xeb03('0xb')](),controller[_0xeb03('0xd')]);router[_0xeb03('0xa')](_0xeb03('0xe'),auth[_0xeb03('0xb')](),controller[_0xeb03('0xf')]);router[_0xeb03('0x10')]('/',auth[_0xeb03('0xb')](),controller[_0xeb03('0x11')]);router[_0xeb03('0x10')](_0xeb03('0xe'),auth[_0xeb03('0xb')](),controller[_0xeb03('0x12')]);router[_0xeb03('0x13')]('/:id',auth['isAuthenticated'](),controller['update']);router[_0xeb03('0x14')](_0xeb03('0x15'),auth[_0xeb03('0xb')](),controller[_0xeb03('0x16')]);module[_0xeb03('0x17')]=router;
\ No newline at end of file
diff --git a/server/api/cmContact/cmContact.attributes.js b/server/api/cmContact/cmContact.attributes.js
index 7afc6a3..24ec6d5 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 _0x1101=['NOW','sequelize','exports','STRING','INTEGER','UNSIGNED','DATE'];(function(_0x4fb528,_0xc63eda){var _0x531ede=function(_0x8ee2c5){while(--_0x8ee2c5){_0x4fb528['push'](_0x4fb528['shift']());}};_0x531ede(++_0xc63eda);}(_0x1101,0x1b3));var _0x1110=function(_0x402fc0,_0x2f2b08){_0x402fc0=_0x402fc0-0x0;var _0xef0202=_0x1101[_0x402fc0];return _0xef0202;};'use strict';var _=require('lodash');var Sequelize=require(_0x1110('0x0'));module[_0x1110('0x1')]={'firstName':{'type':Sequelize[_0x1110('0x2')],'allowNull':![]},'lastName':{'type':Sequelize['STRING']},'street':{'type':Sequelize['STRING']},'postalCode':{'type':Sequelize[_0x1110('0x2')]},'city':{'type':Sequelize[_0x1110('0x2')]},'country':{'type':Sequelize[_0x1110('0x2')]},'dateOfBirth':{'type':Sequelize[_0x1110('0x2')]},'description':{'type':Sequelize['TEXT']},'phone':{'type':Sequelize[_0x1110('0x2')]},'mobile':{'type':Sequelize['STRING']},'fax':{'type':Sequelize[_0x1110('0x2')]},'email':{'type':Sequelize[_0x1110('0x2')]},'url':{'type':Sequelize[_0x1110('0x2')]},'facebook':{'type':Sequelize[_0x1110('0x2')]},'fb_data':{'type':Sequelize[_0x1110('0x2')]},'twitter':{'type':Sequelize['STRING']},'skype':{'type':Sequelize['STRING']},'teams':{'type':Sequelize[_0x1110('0x2')]},'viber':{'type':Sequelize[_0x1110('0x2')]},'line':{'type':Sequelize['STRING']},'wechat':{'type':Sequelize['STRING']},'telegram':{'type':Sequelize[_0x1110('0x2')]},'UserId':{'type':Sequelize[_0x1110('0x3')]},'AdditionalPhones':{'type':Sequelize[_0x1110('0x2')]},'priority':{'type':Sequelize[_0x1110('0x3')](0x2)[_0x1110('0x4')],'defaultValue':0x2,'validate':{'min':0x0,'max':0x4}},'scheduledat':{'type':Sequelize[_0x1110('0x5')],'defaultValue':Sequelize[_0x1110('0x6')]},'dialTimezone':{'type':Sequelize['STRING']},'utcOffset':{'type':Sequelize['INTEGER']}};
\ No newline at end of file
+var _0x14fb=['UNSIGNED','NOW','lodash','sequelize','STRING','INTEGER'];(function(_0x46759d,_0x13e994){var _0x3e7fe0=function(_0x2f427d){while(--_0x2f427d){_0x46759d['push'](_0x46759d['shift']());}};_0x3e7fe0(++_0x13e994);}(_0x14fb,0x1ac));var _0xb14f=function(_0x500c46,_0x20da10){_0x500c46=_0x500c46-0x0;var _0x5ee964=_0x14fb[_0x500c46];return _0x5ee964;};'use strict';var _=require(_0xb14f('0x0'));var Sequelize=require(_0xb14f('0x1'));module['exports']={'firstName':{'type':Sequelize[_0xb14f('0x2')],'allowNull':![]},'lastName':{'type':Sequelize[_0xb14f('0x2')]},'street':{'type':Sequelize['STRING']},'postalCode':{'type':Sequelize[_0xb14f('0x2')]},'city':{'type':Sequelize[_0xb14f('0x2')]},'country':{'type':Sequelize[_0xb14f('0x2')]},'dateOfBirth':{'type':Sequelize[_0xb14f('0x2')]},'description':{'type':Sequelize['TEXT']},'phone':{'type':Sequelize[_0xb14f('0x2')]},'mobile':{'type':Sequelize[_0xb14f('0x2')]},'fax':{'type':Sequelize['STRING']},'email':{'type':Sequelize[_0xb14f('0x2')]},'url':{'type':Sequelize[_0xb14f('0x2')]},'facebook':{'type':Sequelize[_0xb14f('0x2')]},'fb_data':{'type':Sequelize[_0xb14f('0x2')]},'twitter':{'type':Sequelize[_0xb14f('0x2')]},'skype':{'type':Sequelize[_0xb14f('0x2')]},'teams':{'type':Sequelize[_0xb14f('0x2')]},'viber':{'type':Sequelize[_0xb14f('0x2')]},'line':{'type':Sequelize[_0xb14f('0x2')]},'wechat':{'type':Sequelize['STRING']},'telegram':{'type':Sequelize[_0xb14f('0x2')]},'UserId':{'type':Sequelize[_0xb14f('0x3')]},'AdditionalPhones':{'type':Sequelize[_0xb14f('0x2')]},'priority':{'type':Sequelize[_0xb14f('0x3')](0x2)[_0xb14f('0x4')],'defaultValue':0x2,'validate':{'min':0x0,'max':0x4}},'scheduledat':{'type':Sequelize['DATE'],'defaultValue':Sequelize[_0xb14f('0x5')]},'dialTimezone':{'type':Sequelize[_0xb14f('0x2')]},'utcOffset':{'type':Sequelize[_0xb14f('0x3')]}};
\ No newline at end of file
diff --git a/server/api/cmContact/cmContact.controller.js b/server/api/cmContact/cmContact.controller.js
index 2a5b88c..7e71771 100644
--- a/server/api/cmContact/cmContact.controller.js
+++ b/server/api/cmContact/cmContact.controller.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xa9e0=['source','destination','endtime','duration','note','createdAt','userDisposition','userSecondDisposition','userThirdDisposition','UserId','fullname','alias','DESC','findAndCountAll','startCase','Website','Account','closedAt','disposition','secondDisposition','thirdDisposition','Owner','browserName','customerIp','osName','ratingType','subject','substatus','externalUrl','threadId','Interaction','flatten','reverse','value','slice','moment','bluebird','util','squel','ioredis','../../components/contacts','../../components/parsers/qs','../../config/logger','api','../../config/environment/shared','../../mysqldb','redis','localhost','./cmContact.socket','register','status','offset','undefined','limit','count','Content-Range','then','destroy','end','sendStatus','stack','name','describe','getOptions','findAll','query','user','catch','CmContact','find','params','tags','keys','startsWith','cf_','displayName','analytics','CmCustomField','length','columnName','custom','type','values','forEach','hasOwnProperty','body','from','get','isArray','join','info','[CmContact][merge]\x20to\x20%s\x20from\x20%s','CmHopper','[CmContact][merge][destroy][CmHopper],\x20%s','CmHopperBlack','[CmContact][merge][destroy][CmHopperBlack],\x20%s','create','ChatInteraction','update','ChatMessage','ChatOfflineMessage','MailInteraction','MailMessage','SmsInteraction','SmsMessage','FaxInteraction','FaxMessage','OpenchannelInteraction','OpenchannelMessage','CmContactHasItem','CmHopperFinal','ReportAgentPreview','VoiceCallReport','ChatQueueReport','MailQueueReport','OpenchannelQueueReport','SmsQueueReport','WhatsappInteraction','WhatsappMessage','WhatsappQueueReport','dialTimezone','isNil','timezones','utcOffset','additionalPhones','bulkCreate','duplicates','where','$or','push','ListId','findOrCreate','spread','all','show','Tag','color','tag','Phones','ContactItemType','ItemType','literal','Phones.OrderBy','$and','map','format','omit','cf_%d','isEmpty','cm_contacts','id\x20=\x20?','toParam','text','phone','getTags','model','rawAttributes','filters','intersection','attributes','fields','order','sort','pick','filter','merge','nolimit','setTags','findOne','ids','setAdditionalPhones','OrderBy','items','item_types','ItemTypeId','description','contact\x20phone\x20exists','CmHopperAdditionalPhone','item','sequelize','`ItemType`.OrderBy','CmHopperId','ItemType.OrderBy','getAdditionalPhones','PHONE','duplicateAdditionalPhones','CmContactId','toContactId','rescheduleAdditionalPhones','ContactId','options','includeAll','include','getHopperHistories','CmHopperHistory','rows','getJscriptySessions','JscriptySessionReport','uploadCsv','No\x20ListId\x20specified','binding_keys','No\x20association\x20keys\x20specified!','binding_values','No\x20association\x20values\x20specified!','socket_timestamp','Unable\x20to\x20synchronize\x20socket,\x20no\x20timestamp\x20passed','split','Incorrect\x20binding\x20parameters\x20passed!','zipObject','No\x20phone\x20column\x20specified','firstName','No\x20firstName\x20column\x20specified','root','file','chmodSync','0777','child_process','fork','../../components/import/cm/csv','CompanyId','json','File\x20uploaded\x20correctly!','pid','send','path','meta','import','agent','binding','stringify','message','start\x20child\x20process\x20correctly!','error\x20child\x20process','importUpdates','User','../../components/import/cm/csvUpdates','exit','getJourney','mail','chat','sms','openchannel','fax','whatsapp','voice','-createdAt','resolve','channel','includes','toLowerCase','Invalid\x20channel','range','parse','isValid','Invalid\x20date\x20for\x20range\x20to\x20filter','Invalid\x20createdAt\x20filter'];(function(_0x5471ec,_0x1ce81a){var _0x121d4c=function(_0xefb655){while(--_0xefb655){_0x5471ec['push'](_0x5471ec['shift']());}};_0x121d4c(++_0x1ce81a);}(_0xa9e0,0x123));var _0x0a9e=function(_0x2a6809,_0x44edde){_0x2a6809=_0x2a6809-0x0;var _0x11c371=_0xa9e0[_0x2a6809];return _0x11c371;};'use strict';var moment=require(_0x0a9e('0x0'));var BPromise=require(_0x0a9e('0x1'));var util=require(_0x0a9e('0x2'));var path=require('path');var fs=require('fs');var _=require('lodash');var squel=require(_0x0a9e('0x3'));var Papa=require('papaparse');var Redis=require(_0x0a9e('0x4'));var contacts=require(_0x0a9e('0x5'));var qs=require(_0x0a9e('0x6'));var logger=require(_0x0a9e('0x7'))(_0x0a9e('0x8'));var config=require('../../config/environment');var shared=require(_0x0a9e('0x9'));var db=require(_0x0a9e('0xa'))['db'];config[_0x0a9e('0xb')]=_['defaults'](config['redis'],{'host':_0x0a9e('0xc'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0x0a9e('0xd'))[_0x0a9e('0xe')](socket);function respondWithResult(_0x307b3e,_0x3ab53f){_0x3ab53f=_0x3ab53f||0xc8;return function(_0xfeb75b){if(_0xfeb75b){return _0x307b3e[_0x0a9e('0xf')](_0x3ab53f)['json'](_0xfeb75b);}};}function respondWithFilteredResult(_0x50dfb2,_0x527cdd){return function(_0x4cfe67){if(_0x4cfe67){var _0x273d4d=typeof _0x527cdd[_0x0a9e('0x10')]===_0x0a9e('0x11')&&typeof _0x527cdd[_0x0a9e('0x12')]===_0x0a9e('0x11');var _0x69aeb7=_0x4cfe67['count'];var _0x4283ce=_0x273d4d?0x0:_0x527cdd[_0x0a9e('0x10')];var _0x2b4227=_0x273d4d?_0x4cfe67[_0x0a9e('0x13')]:_0x527cdd[_0x0a9e('0x10')]+_0x527cdd[_0x0a9e('0x12')];var _0x52a03d;if(_0x2b4227>=_0x69aeb7){_0x2b4227=_0x69aeb7;_0x52a03d=0xc8;}else{_0x52a03d=0xce;}_0x50dfb2[_0x0a9e('0xf')](_0x52a03d);return _0x50dfb2['set'](_0x0a9e('0x14'),_0x4283ce+'-'+_0x2b4227+'/'+_0x69aeb7)['json'](_0x4cfe67);}return null;};}function saveUpdates(_0x16033c){return function(_0x12066b){if(_0x12066b){return _0x12066b['update'](_0x16033c)[_0x0a9e('0x15')](function(_0x5a0a06){return _0x5a0a06;});}return null;};}function removeEntity(_0x459eb1){return function(_0x478723){if(_0x478723){return _0x478723[_0x0a9e('0x16')]()[_0x0a9e('0x15')](function(){_0x459eb1[_0x0a9e('0xf')](0xcc)[_0x0a9e('0x17')]();});}};}function handleEntityNotFound(_0x530eb7){return function(_0x20559e){if(!_0x20559e){_0x530eb7[_0x0a9e('0x18')](0x194);}return _0x20559e;};}function handleError(_0x112016,_0x1c696a){_0x1c696a=_0x1c696a||0x1f4;return function(_0x105080){logger['error'](_0x105080[_0x0a9e('0x19')]);if(_0x105080[_0x0a9e('0x1a')]){delete _0x105080['name'];}_0x112016[_0x0a9e('0xf')](_0x1c696a)['send'](_0x105080);};}exports['index']=function(_0x3a02e1,_0x432e56){var _0x38e7c4={};return contacts[_0x0a9e('0x1b')]()['then'](function(_0xfb6e48){_0x38e7c4=qs[_0x0a9e('0x1c')](_0xfb6e48,_0x3a02e1);return contacts[_0x0a9e('0x1d')](_0x3a02e1[_0x0a9e('0x1e')],_0x3a02e1[_0x0a9e('0x1f')],_0x38e7c4,_0xfb6e48);})[_0x0a9e('0x15')](respondWithFilteredResult(_0x432e56,_0x38e7c4))[_0x0a9e('0x20')](handleError(_0x432e56,null));};exports['destroy']=function(_0x59181e,_0x197ec0){return db[_0x0a9e('0x21')][_0x0a9e('0x22')]({'where':{'id':_0x59181e[_0x0a9e('0x23')]['id']}})['then'](handleEntityNotFound(_0x197ec0,null))[_0x0a9e('0x15')](removeEntity(_0x197ec0,null))['catch'](handleError(_0x197ec0,null));};exports[_0x0a9e('0x1b')]=function(_0x5bfb33,_0x1dc186){return db[_0x0a9e('0x21')][_0x0a9e('0x1b')]()[_0x0a9e('0x15')](function(_0x140511){delete _0x140511[_0x0a9e('0x24')];for(var _0x11c3b6=0x0;_0x11c3b6
','Attachments','from','Data','generateXOAuth2Token','user=','auth=Bearer\x20','utf-8','toString','base64','path','node-tnef','../../../config/logger','email','../../../config/environment','head','value','address','@xcally.com'];(function(_0x523cd6,_0x242aa1){var _0x3e3484=function(_0x360c02){while(--_0x360c02){_0x523cd6['push'](_0x523cd6['shift']());}};_0x3e3484(++_0x242aa1);}(_0xf0dc,0x117));var _0xcf0d=function(_0x80e9f,_0x1e84eb){_0x80e9f=_0x80e9f-0x0;var _0x49befa=_0xf0dc[_0x80e9f];return _0x49befa;};'use strict';var _=require('lodash');var moment=require('moment');var random=require('randomstring');var fs=require('fs');var path=require(_0xcf0d('0x0'));var util=require('util');var tnef=require(_0xcf0d('0x1'));var logger=require(_0xcf0d('0x2'))(_0xcf0d('0x3'));var config=require(_0xcf0d('0x4'));function getAddress(_0x45f23f){var _0x3373f5=_[_0xcf0d('0x5')](_0x45f23f[_0xcf0d('0x6')]);return _0x3373f5&&_0x3373f5[_0xcf0d('0x7')]?_0x3373f5[_0xcf0d('0x7')]:'anonymous'+random['generate'](0x6)+_0xcf0d('0x8');}function getFirstName(_0xe07844){var _0x598e7f=_[_0xcf0d('0x5')](_0xe07844['value']);if(_0x598e7f&&_0x598e7f['name']){if(_0x598e7f[_0xcf0d('0x9')]==_0x598e7f[_0xcf0d('0x7')]){return _0x598e7f[_0xcf0d('0x9')]['substring'](0x0,_0x598e7f['name'][_0xcf0d('0xa')]('@'));}var _0x2f79dc=_0x598e7f[_0xcf0d('0x9')][_0xcf0d('0xb')](/\s+/);return _0x2f79dc[_0xcf0d('0xc')]>0x1?_0x2f79dc[_0xcf0d('0xd')](0x0,-0x1)[_0xcf0d('0xe')]('\x20'):_0x598e7f[_0xcf0d('0x9')];}return'Anonymous';}function getLastName(_0x45342a){var _0x51d306=_[_0xcf0d('0x5')](_0x45342a[_0xcf0d('0x6')]);if(_0x51d306&&_0x51d306['name']){var _0x531990=_0x51d306[_0xcf0d('0x9')][_0xcf0d('0xb')](/\s+/);return _0x531990[_0xcf0d('0xc')]>0x1?_0x531990['pop']():'';}return'';}function getMails(_0x3a383c,_0x3bfc74){var _0x36405b='';for(var _0x21b7ec=0x0;_0x21b7ec<_0x3bfc74['value'][_0xcf0d('0xc')];_0x21b7ec+=0x1){if(_0x3bfc74['value'][_0x21b7ec][_0xcf0d('0x7')]!==_0x3a383c){if(!_['isEmpty'](_0x36405b)){_0x36405b+=',';}_0x36405b+=_0x3bfc74['value'][_0x21b7ec][_0xcf0d('0x9')]||_0x3bfc74['value'][_0x21b7ec]['address']||'';_0x36405b+='\x20<';_0x36405b+=_0x3bfc74[_0xcf0d('0x6')][_0x21b7ec]['address']?_0x3bfc74[_0xcf0d('0x6')][_0x21b7ec]['address']:_0xcf0d('0xf')+random[_0xcf0d('0x10')](0x6)+_0xcf0d('0x8');_0x36405b+='>';}}return _0x36405b;}function parseEmail(_0x1be55b,_0x36b964,_0x3f7fe4){if(_0x36b964[_0xcf0d('0x11')]){var _0x32400e=/