From: support
Date: Fri, 20 Jan 2023 10:06:55 +0000 (+0000)
Subject: Built motion from commit 6f14c8ba.|2.6.29
X-Git-Url: http://repos.xcallymotion.com/base//%22angular-material.themes.css/%22?a=commitdiff_plain;h=7f0621eff70afe3819793a54441bb1adf9d2cf44;p=motion2.git
Built motion from commit 6f14c8ba.|2.6.29
---
diff --git a/apidoc/api_project.js b/apidoc/api_project.js
index b473114..f73231f 100644
--- a/apidoc/api_project.js
+++ b/apidoc/api_project.js
@@ -1,6 +1,6 @@
define({
"name": "xCALLY Motion API",
- "version": "2.6.28",
+ "version": "2.6.29",
"description": "Thank you for choosing xCALLY MOTION, one of the first Omni Channel solution integrated with AsteriskTM and the most innovative real time solutions available on the market.",
"title": "xCALLY MOTION API",
"header": {
@@ -17,7 +17,7 @@ define({
"apidoc": "0.3.0",
"generator": {
"name": "apidoc",
- "time": "2023-01-19T16:17:14.316Z",
+ "time": "2023-01-20T09:58:30.833Z",
"url": "http://apidocjs.com",
"version": "0.24.0"
}
diff --git a/apidoc/api_project.json b/apidoc/api_project.json
index 3c188a4..7623dec 100644
--- a/apidoc/api_project.json
+++ b/apidoc/api_project.json
@@ -1,6 +1,6 @@
{
"name": "xCALLY Motion API",
- "version": "2.6.28",
+ "version": "2.6.29",
"description": "Thank you for choosing xCALLY MOTION, one of the first Omni Channel solution integrated with AsteriskTM and the most innovative real time solutions available on the market.",
"title": "xCALLY MOTION API",
"header": {
@@ -17,7 +17,7 @@
"apidoc": "0.3.0",
"generator": {
"name": "apidoc",
- "time": "2023-01-19T16:17:14.316Z",
+ "time": "2023-01-20T09:58:30.833Z",
"url": "http://apidocjs.com",
"version": "0.24.0"
}
diff --git a/npm-shrinkwrap.json b/npm-shrinkwrap.json
index 1b847b4..bec345e 100644
--- a/npm-shrinkwrap.json
+++ b/npm-shrinkwrap.json
@@ -1,6 +1,6 @@
{
"name": "motion",
- "version": "2.6.28",
+ "version": "2.6.29",
"dependencies": {
"@babel/code-frame": {
"version": "7.18.6",
diff --git a/package.json b/package.json
index 5371a30..c430d50 100644
--- a/package.json
+++ b/package.json
@@ -1,6 +1,6 @@
{
"name": "motion",
- "version": "2.6.28",
+ "version": "2.6.29",
"description": "xCALLY Motion is the new Realtime asynchronous solution for your multichannel contact center over Asterisk.",
"main": "server/app.js",
"engines": {
diff --git a/server/api/action/action.attributes.js b/server/api/action/action.attributes.js
index 7ff55fd..f597d88 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 _0x87fa=['jscripty[ProjectId],\x20browser[type(0=Popup,1=CTI\x20URL)],\x20contactManager[ListId],\x20urlForward[type(GET,POST,PUT,DELETE)],\x20script[info],\x20integration[intName(desk,dynamics365,freshdesk,freshsales,salesforce,sugarcrm,vtiger,zendesk,zoho)],\x20motionbar[type(0=Popup,1=CTI\x20URL,2=WinApp)]','contactManager[autoCreate(0=No,1=Yes)],\x20urlForward[URL],\x20script[type],\x20integration[AccountId],\x20motionbar[TemplateId,URL,WinAppPath],\x20browser[TemplateId,URL]','urlForward[timeout],\x20browser[windowWidth],\x20contactManager[ignoreDialerContactId]','urlForward[headers],\x20browser[wsindowHeight]','TEXT','urlForward[body]','sequelize','getDataValue','action','STRING','contactManager','browser','bot','script','Allowed\x20values:\x20contactManager,\x20integration,\x20motionbar,\x20jscripty,\x20urlForward,\x20browser,\x20bot,\x20script'];(function(_0x2f8c05,_0x551e3d){var _0x14cfde=function(_0x282d66){while(--_0x282d66){_0x2f8c05['push'](_0x2f8c05['shift']());}};_0x14cfde(++_0x551e3d);}(_0x87fa,0xf6));var _0xa87f=function(_0x505e73,_0x533864){_0x505e73=_0x505e73-0x0;var _0x2ac5b6=_0x87fa[_0x505e73];return _0x2ac5b6;};'use strict';var Sequelize=require(_0xa87f('0x0'));module['exports']={'name':{'type':Sequelize['VIRTUAL'],'get':function(_0x1a3085){return this[_0xa87f('0x1')](_0xa87f('0x2'));}},'action':{'type':Sequelize[_0xa87f('0x3')],'allowNull':![],'validate':{'isIn':{'args':[[_0xa87f('0x4'),'integration','motionbar','jscripty','urlForward',_0xa87f('0x5'),_0xa87f('0x6'),_0xa87f('0x7')]],'msg':_0xa87f('0x8')}},'comment':'Allowed\x20values:\x20contactManager,\x20integration,\x20motionbar,\x20jscripty,\x20urlForward,\x20browser,\x20bot,\x20script'},'data1':{'type':Sequelize[_0xa87f('0x3')](0x1000),'comment':_0xa87f('0x9')},'data2':{'type':Sequelize[_0xa87f('0x3')](0x1000),'comment':_0xa87f('0xa')},'data3':{'type':Sequelize[_0xa87f('0x3')](0x1000),'comment':'contactManager[searchFields],\x20script[script],\x20integration[ConfigurationId],\x20motionbar[NULL,eventVariables(0=No,1=Yes),WinAppArguments],\x20browser[NULL,eventVariables(0=No,1=Yes)]'},'data4':{'type':Sequelize['STRING'](0x1000),'comments':'browser[location(0=NewTab,1=NewWindow,2=MotionTab)],\x20contactManager[autoCreateField]'},'data5':{'type':Sequelize[_0xa87f('0x3')](0x1000),'comments':_0xa87f('0xb')},'data6':{'type':Sequelize[_0xa87f('0x3')],'comments':_0xa87f('0xc')},'data7':{'type':Sequelize[_0xa87f('0xd')],'comments':_0xa87f('0xe')}};
\ No newline at end of file
+var _0x9efe=['urlForward[timeout],\x20browser[windowWidth],\x20contactManager[ignoreDialerContactId]','urlForward[headers],\x20browser[wsindowHeight]','TEXT','urlForward[body]','exports','VIRTUAL','getDataValue','action','contactManager','integration','motionbar','jscripty','urlForward','browser','bot','STRING','jscripty[ProjectId],\x20browser[type(0=Popup,1=CTI\x20URL)],\x20contactManager[ListId],\x20urlForward[type(GET,POST,PUT,DELETE)],\x20script[info],\x20integration[intName(desk,dynamics365,freshdesk,freshsales,salesforce,sugarcrm,vtiger,zendesk,zoho)],\x20motionbar[type(0=Popup,1=CTI\x20URL,2=WinApp)]','browser[location(0=NewTab,1=NewWindow,2=MotionTab)],\x20contactManager[autoCreateField]'];(function(_0xc1a7d3,_0x6ac180){var _0x576e8d=function(_0x46d9cb){while(--_0x46d9cb){_0xc1a7d3['push'](_0xc1a7d3['shift']());}};_0x576e8d(++_0x6ac180);}(_0x9efe,0xca));var _0xe9ef=function(_0x530455,_0x41da2d){_0x530455=_0x530455-0x0;var _0x128a27=_0x9efe[_0x530455];return _0x128a27;};'use strict';var Sequelize=require('sequelize');module[_0xe9ef('0x0')]={'name':{'type':Sequelize[_0xe9ef('0x1')],'get':function(_0xb0e89c){return this[_0xe9ef('0x2')](_0xe9ef('0x3'));}},'action':{'type':Sequelize['STRING'],'allowNull':![],'validate':{'isIn':{'args':[[_0xe9ef('0x4'),_0xe9ef('0x5'),_0xe9ef('0x6'),_0xe9ef('0x7'),_0xe9ef('0x8'),_0xe9ef('0x9'),_0xe9ef('0xa'),'script']],'msg':'Allowed\x20values:\x20contactManager,\x20integration,\x20motionbar,\x20jscripty,\x20urlForward,\x20browser,\x20bot,\x20script'}},'comment':'Allowed\x20values:\x20contactManager,\x20integration,\x20motionbar,\x20jscripty,\x20urlForward,\x20browser,\x20bot,\x20script'},'data1':{'type':Sequelize[_0xe9ef('0xb')](0x1000),'comment':_0xe9ef('0xc')},'data2':{'type':Sequelize[_0xe9ef('0xb')](0x1000),'comment':'contactManager[autoCreate(0=No,1=Yes)],\x20urlForward[URL],\x20script[type],\x20integration[AccountId],\x20motionbar[TemplateId,URL,WinAppPath],\x20browser[TemplateId,URL]'},'data3':{'type':Sequelize['STRING'](0x1000),'comment':'contactManager[searchFields],\x20script[script],\x20integration[ConfigurationId],\x20motionbar[NULL,eventVariables(0=No,1=Yes),WinAppArguments],\x20browser[NULL,eventVariables(0=No,1=Yes)]'},'data4':{'type':Sequelize['STRING'](0x1000),'comments':_0xe9ef('0xd')},'data5':{'type':Sequelize[_0xe9ef('0xb')](0x1000),'comments':_0xe9ef('0xe')},'data6':{'type':Sequelize['STRING'],'comments':_0xe9ef('0xf')},'data7':{'type':Sequelize[_0xe9ef('0x10')],'comments':_0xe9ef('0x11')}};
\ No newline at end of file
diff --git a/server/api/action/action.controller.js b/server/api/action/action.controller.js
index 4893755..fe35464 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 _0xfda9=['json','offset','undefined','limit','count','apply','reject','save','update','then','destroy','error','stack','name','send','body','Action','find','params','catch','eml-format','zip-dir','mustache','util','path','sox','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','status'];(function(_0x5d4607,_0x6b5e7b){var _0x5e4a86=function(_0x46891a){while(--_0x46891a){_0x5d4607['push'](_0x5d4607['shift']());}};_0x5e4a86(++_0x6b5e7b);}(_0xfda9,0x15d));var _0x9fda=function(_0x29be5a,_0x33a386){_0x29be5a=_0x29be5a-0x0;var _0x4fe55e=_0xfda9[_0x29be5a];return _0x4fe55e;};'use strict';var emlformat=require(_0x9fda('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x9fda('0x1'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x9fda('0x2'));var util=require(_0x9fda('0x3'));var path=require(_0x9fda('0x4'));var sox=require(_0x9fda('0x5'));var csv=require('to-csv');var ejs=require(_0x9fda('0x6'));var fs=require('fs');var fs_extra=require(_0x9fda('0x7'));var _=require(_0x9fda('0x8'));var squel=require(_0x9fda('0x9'));var crypto=require(_0x9fda('0xa'));var jsforce=require(_0x9fda('0xb'));var deskjs=require(_0x9fda('0xc'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x9fda('0xd'));var Redis=require(_0x9fda('0xe'));var authService=require(_0x9fda('0xf'));var qs=require(_0x9fda('0x10'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x9fda('0x11'));var logger=require(_0x9fda('0x12'))(_0x9fda('0x13'));var utils=require(_0x9fda('0x14'));var config=require(_0x9fda('0x15'));var licenseUtil=require(_0x9fda('0x16'));var db=require(_0x9fda('0x17'))['db'];function respondWithStatusCode(_0x20837b,_0x16cd68){_0x16cd68=_0x16cd68||0xcc;return function(_0x42c318){if(_0x42c318){return _0x20837b[_0x9fda('0x18')](_0x16cd68);}return _0x20837b['status'](_0x16cd68)[_0x9fda('0x19')]();};}function respondWithResult(_0x54d804,_0x18c6b6){_0x18c6b6=_0x18c6b6||0xc8;return function(_0x14fbb4){if(_0x14fbb4){return _0x54d804[_0x9fda('0x1a')](_0x18c6b6)[_0x9fda('0x1b')](_0x14fbb4);}};}function respondWithFilteredResult(_0x129af5,_0x10f337){return function(_0x5d7cbc){if(_0x5d7cbc){var _0x3d8221=typeof _0x10f337[_0x9fda('0x1c')]===_0x9fda('0x1d')&&typeof _0x10f337[_0x9fda('0x1e')]===_0x9fda('0x1d');var _0x2b29b6=_0x5d7cbc['count'];var _0x317290=_0x3d8221?0x0:_0x10f337[_0x9fda('0x1c')];var _0x13e933=_0x3d8221?_0x5d7cbc[_0x9fda('0x1f')]:_0x10f337['offset']+_0x10f337['limit'];var _0x2e0f7c;if(_0x13e933>=_0x2b29b6){_0x13e933=_0x2b29b6;_0x2e0f7c=0xc8;}else{_0x2e0f7c=0xce;}_0x129af5[_0x9fda('0x1a')](_0x2e0f7c);return _0x129af5['set']('Content-Range',_0x317290+'-'+_0x13e933+'/'+_0x2b29b6)['json'](_0x5d7cbc);}return null;};}function patchUpdates(_0x2c5771){return function(_0x164f63){try{jsonpatch[_0x9fda('0x20')](_0x164f63,_0x2c5771,!![]);}catch(_0xd5fa0c){return BPromise[_0x9fda('0x21')](_0xd5fa0c);}return _0x164f63[_0x9fda('0x22')]();};}function saveUpdates(_0x59da93,_0x4d8bad){return function(_0x10cc3c){if(_0x10cc3c){return _0x10cc3c[_0x9fda('0x23')](_0x59da93)[_0x9fda('0x24')](function(_0x338fd7){return _0x338fd7;});}return null;};}function removeEntity(_0x3159ad,_0x1f8c24){return function(_0x4342e7){if(_0x4342e7){return _0x4342e7[_0x9fda('0x25')]()['then'](function(){_0x3159ad[_0x9fda('0x1a')](0xcc)[_0x9fda('0x19')]();});}};}function handleEntityNotFound(_0xc2efd3,_0x5ba132){return function(_0x1d4f51){if(!_0x1d4f51){_0xc2efd3['sendStatus'](0x194);}return _0x1d4f51;};}function handleError(_0x1cfd7a,_0x2750dc){_0x2750dc=_0x2750dc||0x1f4;return function(_0x2f26b1){logger[_0x9fda('0x26')](_0x2f26b1[_0x9fda('0x27')]);if(_0x2f26b1[_0x9fda('0x28')]){delete _0x2f26b1['name'];}_0x1cfd7a[_0x9fda('0x1a')](_0x2750dc)[_0x9fda('0x29')](_0x2f26b1);};}exports['update']=function(_0xfd1789,_0x1fc7e5){if(_0xfd1789[_0x9fda('0x2a')]['id']){delete _0xfd1789['body']['id'];}return db[_0x9fda('0x2b')][_0x9fda('0x2c')]({'where':{'id':_0xfd1789[_0x9fda('0x2d')]['id']}})[_0x9fda('0x24')](handleEntityNotFound(_0x1fc7e5,null))['then'](saveUpdates(_0xfd1789[_0x9fda('0x2a')],null))['then'](respondWithResult(_0x1fc7e5,null))['catch'](handleError(_0x1fc7e5,null));};exports[_0x9fda('0x25')]=function(_0x12cf18,_0x518933){return db[_0x9fda('0x2b')][_0x9fda('0x2c')]({'where':{'id':_0x12cf18[_0x9fda('0x2d')]['id']}})[_0x9fda('0x24')](handleEntityNotFound(_0x518933,null))[_0x9fda('0x24')](removeEntity(_0x518933,null))[_0x9fda('0x2e')](handleError(_0x518933,null));};
\ No newline at end of file
+var _0xa427=['fast-json-patch','request-promise','moment','bluebird','mustache','util','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','limit','undefined','count','Content-Range','reject','save','then','destroy','error','name','update','body','Action','params','catch','find','eml-format','zip-dir'];(function(_0x30ccbc,_0xa15176){var _0x28efee=function(_0xa0e41){while(--_0xa0e41){_0x30ccbc['push'](_0x30ccbc['shift']());}};_0x28efee(++_0xa15176);}(_0xa427,0xdf));var _0x7a42=function(_0x6aae3b,_0x1f366f){_0x6aae3b=_0x6aae3b-0x0;var _0x24d8b3=_0xa427[_0x6aae3b];return _0x24d8b3;};'use strict';var emlformat=require(_0x7a42('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x7a42('0x1'));var jsonpatch=require(_0x7a42('0x2'));var rp=require(_0x7a42('0x3'));var moment=require(_0x7a42('0x4'));var BPromise=require(_0x7a42('0x5'));var Mustache=require(_0x7a42('0x6'));var util=require(_0x7a42('0x7'));var path=require('path');var sox=require('sox');var csv=require(_0x7a42('0x8'));var ejs=require(_0x7a42('0x9'));var fs=require('fs');var fs_extra=require(_0x7a42('0xa'));var _=require(_0x7a42('0xb'));var squel=require(_0x7a42('0xc'));var crypto=require('crypto');var jsforce=require(_0x7a42('0xd'));var deskjs=require(_0x7a42('0xe'));var toCsv=require(_0x7a42('0x8'));var querystring=require('querystring');var Papa=require(_0x7a42('0xf'));var Redis=require(_0x7a42('0x10'));var authService=require('../../components/auth/service');var qs=require(_0x7a42('0x11'));var as=require(_0x7a42('0x12'));var hardwareService=require(_0x7a42('0x13'));var logger=require('../../config/logger')('api');var utils=require(_0x7a42('0x14'));var config=require(_0x7a42('0x15'));var licenseUtil=require(_0x7a42('0x16'));var db=require(_0x7a42('0x17'))['db'];function respondWithStatusCode(_0x73d2d5,_0x4407a2){_0x4407a2=_0x4407a2||0xcc;return function(_0x39b99f){if(_0x39b99f){return _0x73d2d5[_0x7a42('0x18')](_0x4407a2);}return _0x73d2d5[_0x7a42('0x19')](_0x4407a2)[_0x7a42('0x1a')]();};}function respondWithResult(_0x4f8528,_0x592215){_0x592215=_0x592215||0xc8;return function(_0x553100){if(_0x553100){return _0x4f8528[_0x7a42('0x19')](_0x592215)[_0x7a42('0x1b')](_0x553100);}};}function respondWithFilteredResult(_0x26b0a6,_0x566ea7){return function(_0x12cdf7){if(_0x12cdf7){var _0xa5bb93=typeof _0x566ea7[_0x7a42('0x1c')]==='undefined'&&typeof _0x566ea7[_0x7a42('0x1d')]===_0x7a42('0x1e');var _0x29d792=_0x12cdf7[_0x7a42('0x1f')];var _0x220491=_0xa5bb93?0x0:_0x566ea7[_0x7a42('0x1c')];var _0x368525=_0xa5bb93?_0x12cdf7['count']:_0x566ea7[_0x7a42('0x1c')]+_0x566ea7[_0x7a42('0x1d')];var _0x4477fb;if(_0x368525>=_0x29d792){_0x368525=_0x29d792;_0x4477fb=0xc8;}else{_0x4477fb=0xce;}_0x26b0a6[_0x7a42('0x19')](_0x4477fb);return _0x26b0a6['set'](_0x7a42('0x20'),_0x220491+'-'+_0x368525+'/'+_0x29d792)[_0x7a42('0x1b')](_0x12cdf7);}return null;};}function patchUpdates(_0x19a1b4){return function(_0x59e614){try{jsonpatch['apply'](_0x59e614,_0x19a1b4,!![]);}catch(_0x35d699){return BPromise[_0x7a42('0x21')](_0x35d699);}return _0x59e614[_0x7a42('0x22')]();};}function saveUpdates(_0x42e662,_0x488ec4){return function(_0x57b2e9){if(_0x57b2e9){return _0x57b2e9['update'](_0x42e662)[_0x7a42('0x23')](function(_0x118ed0){return _0x118ed0;});}return null;};}function removeEntity(_0x55f8d6,_0x19664e){return function(_0x58c143){if(_0x58c143){return _0x58c143[_0x7a42('0x24')]()[_0x7a42('0x23')](function(){_0x55f8d6[_0x7a42('0x19')](0xcc)['end']();});}};}function handleEntityNotFound(_0x3476ac,_0x51dae8){return function(_0x2e3103){if(!_0x2e3103){_0x3476ac[_0x7a42('0x18')](0x194);}return _0x2e3103;};}function handleError(_0x5095a2,_0x150b88){_0x150b88=_0x150b88||0x1f4;return function(_0x220a98){logger[_0x7a42('0x25')](_0x220a98['stack']);if(_0x220a98[_0x7a42('0x26')]){delete _0x220a98[_0x7a42('0x26')];}_0x5095a2[_0x7a42('0x19')](_0x150b88)['send'](_0x220a98);};}exports[_0x7a42('0x27')]=function(_0x1c6e23,_0x44b67c){if(_0x1c6e23['body']['id']){delete _0x1c6e23[_0x7a42('0x28')]['id'];}return db[_0x7a42('0x29')]['find']({'where':{'id':_0x1c6e23[_0x7a42('0x2a')]['id']}})[_0x7a42('0x23')](handleEntityNotFound(_0x44b67c,null))[_0x7a42('0x23')](saveUpdates(_0x1c6e23[_0x7a42('0x28')],null))[_0x7a42('0x23')](respondWithResult(_0x44b67c,null))[_0x7a42('0x2b')](handleError(_0x44b67c,null));};exports[_0x7a42('0x24')]=function(_0x316ecc,_0x2d33e6){return db[_0x7a42('0x29')][_0x7a42('0x2c')]({'where':{'id':_0x316ecc[_0x7a42('0x2a')]['id']}})[_0x7a42('0x23')](handleEntityNotFound(_0x2d33e6,null))[_0x7a42('0x23')](removeEntity(_0x2d33e6,null))[_0x7a42('0x2b')](handleError(_0x2d33e6,null));};
\ No newline at end of file
diff --git a/server/api/action/action.model.js b/server/api/action/action.model.js
index d845b43..1531542 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 _0xfa46=['util','../../config/logger','api','bluebird','request-promise','path','rimraf','../../config/environment','./action.attributes','define','Action','lodash'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xfa46,0x17f));var _0x6fa4=function(_0x17d9e3,_0x1f969c){_0x17d9e3=_0x17d9e3-0x0;var _0x14192d=_0xfa46[_0x17d9e3];return _0x14192d;};'use strict';var _=require(_0x6fa4('0x0'));var util=require(_0x6fa4('0x1'));var logger=require(_0x6fa4('0x2'))(_0x6fa4('0x3'));var moment=require('moment');var BPromise=require(_0x6fa4('0x4'));var rp=require(_0x6fa4('0x5'));var fs=require('fs');var path=require(_0x6fa4('0x6'));var rimraf=require(_0x6fa4('0x7'));var config=require(_0x6fa4('0x8'));var attributes=require(_0x6fa4('0x9'));module['exports']=function(_0xbb693c,_0x4a5b45){return _0xbb693c[_0x6fa4('0xa')](_0x6fa4('0xb'),attributes,{'tableName':'tools_actions','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xa222=['api','moment','bluebird','request-promise','rimraf','../../config/environment','./action.attributes','define','Action','tools_actions','lodash','util','../../config/logger'];(function(_0x14218e,_0x399ea2){var _0x2bbf30=function(_0x1d0361){while(--_0x1d0361){_0x14218e['push'](_0x14218e['shift']());}};_0x2bbf30(++_0x399ea2);}(_0xa222,0x1b7));var _0x2a22=function(_0x11ba83,_0xd5611a){_0x11ba83=_0x11ba83-0x0;var _0x3f3925=_0xa222[_0x11ba83];return _0x3f3925;};'use strict';var _=require(_0x2a22('0x0'));var util=require(_0x2a22('0x1'));var logger=require(_0x2a22('0x2'))(_0x2a22('0x3'));var moment=require(_0x2a22('0x4'));var BPromise=require(_0x2a22('0x5'));var rp=require(_0x2a22('0x6'));var fs=require('fs');var path=require('path');var rimraf=require(_0x2a22('0x7'));var config=require(_0x2a22('0x8'));var attributes=require(_0x2a22('0x9'));module['exports']=function(_0x131132,_0x2f2ace){return _0x131132[_0x2a22('0xa')](_0x2a22('0xb'),attributes,{'tableName':_0x2a22('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 3cd5083..d2b3c46 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 _0x814b=['info','Action,\x20%s,\x20%s','request\x20sent','debug','Action,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','request','then'];(function(_0x3bf83f,_0x181cac){var _0x22c4a9=function(_0xb3ff0d){while(--_0xb3ff0d){_0x3bf83f['push'](_0x3bf83f['shift']());}};_0x22c4a9(++_0x181cac);}(_0x814b,0x1a2));var _0xb814=function(_0x308dcc,_0x2d1178){_0x308dcc=_0x308dcc-0x0;var _0x361717=_0x814b[_0x308dcc];return _0x361717;};'use strict';var _=require(_0xb814('0x0'));var util=require(_0xb814('0x1'));var moment=require(_0xb814('0x2'));var BPromise=require(_0xb814('0x3'));var rs=require(_0xb814('0x4'));var fs=require('fs');var Redis=require(_0xb814('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0xb814('0x6'));var logger=require(_0xb814('0x7'))(_0xb814('0x8'));var config=require(_0xb814('0x9'));var jayson=require(_0xb814('0xa'));var client=jayson[_0xb814('0xb')]['http']({'port':0x232a});function respondWithRpcPromise(_0x3b0829,_0x2e6272,_0x5c8539){return new BPromise(function(_0x271af9,_0x2913a6){return client[_0xb814('0xc')](_0x3b0829,_0x5c8539)[_0xb814('0xd')](function(_0x1fea33){logger[_0xb814('0xe')](_0xb814('0xf'),_0x2e6272,_0xb814('0x10'));logger[_0xb814('0x11')](_0xb814('0x12'),_0x2e6272,_0xb814('0x10'),JSON['stringify'](_0x1fea33));if(_0x1fea33[_0xb814('0x13')]){if(_0x1fea33['error'][_0xb814('0x14')]===0x1f4){logger[_0xb814('0x13')](_0xb814('0xf'),_0x2e6272,_0x1fea33[_0xb814('0x13')][_0xb814('0x15')]);return _0x2913a6(_0x1fea33[_0xb814('0x13')][_0xb814('0x15')]);}logger[_0xb814('0x13')](_0xb814('0xf'),_0x2e6272,_0x1fea33[_0xb814('0x13')][_0xb814('0x15')]);return _0x271af9(_0x1fea33[_0xb814('0x13')][_0xb814('0x15')]);}else{logger[_0xb814('0xe')](_0xb814('0xf'),_0x2e6272,_0xb814('0x10'));_0x271af9(_0x1fea33[_0xb814('0x16')][_0xb814('0x15')]);}})[_0xb814('0x17')](function(_0x21b73f){logger[_0xb814('0x13')]('Action,\x20%s,\x20%s',_0x2e6272,_0x21b73f);_0x2913a6(_0x21b73f);});});}
\ No newline at end of file
+var _0x1cb9=['error','message','result','catch','lodash','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','request','info','Action,\x20%s,\x20%s','request\x20sent','debug','Action,\x20%s,\x20%s,\x20%s','stringify'];(function(_0x465028,_0x4570ac){var _0xb783d4=function(_0x5458c5){while(--_0x5458c5){_0x465028['push'](_0x465028['shift']());}};_0xb783d4(++_0x4570ac);}(_0x1cb9,0x14e));var _0x91cb=function(_0x533860,_0x4c625a){_0x533860=_0x533860-0x0;var _0x345815=_0x1cb9[_0x533860];return _0x345815;};'use strict';var _=require(_0x91cb('0x0'));var util=require('util');var moment=require(_0x91cb('0x1'));var BPromise=require(_0x91cb('0x2'));var rs=require(_0x91cb('0x3'));var fs=require('fs');var Redis=require(_0x91cb('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x91cb('0x5'));var logger=require(_0x91cb('0x6'))('rpc');var config=require(_0x91cb('0x7'));var jayson=require(_0x91cb('0x8'));var client=jayson[_0x91cb('0x9')][_0x91cb('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x3b9d98,_0x8f8a3b,_0x4c1f56){return new BPromise(function(_0x15c517,_0x5bda2f){return client[_0x91cb('0xb')](_0x3b9d98,_0x4c1f56)['then'](function(_0xa43e7a){logger[_0x91cb('0xc')](_0x91cb('0xd'),_0x8f8a3b,_0x91cb('0xe'));logger[_0x91cb('0xf')](_0x91cb('0x10'),_0x8f8a3b,_0x91cb('0xe'),JSON[_0x91cb('0x11')](_0xa43e7a));if(_0xa43e7a[_0x91cb('0x12')]){if(_0xa43e7a[_0x91cb('0x12')]['code']===0x1f4){logger[_0x91cb('0x12')](_0x91cb('0xd'),_0x8f8a3b,_0xa43e7a['error'][_0x91cb('0x13')]);return _0x5bda2f(_0xa43e7a[_0x91cb('0x12')][_0x91cb('0x13')]);}logger[_0x91cb('0x12')]('Action,\x20%s,\x20%s',_0x8f8a3b,_0xa43e7a['error'][_0x91cb('0x13')]);return _0x15c517(_0xa43e7a[_0x91cb('0x12')]['message']);}else{logger['info'](_0x91cb('0xd'),_0x8f8a3b,_0x91cb('0xe'));_0x15c517(_0xa43e7a[_0x91cb('0x14')]['message']);}})[_0x91cb('0x15')](function(_0x135890){logger['error'](_0x91cb('0xd'),_0x8f8a3b,_0x135890);_0x5bda2f(_0x135890);});});}
\ No newline at end of file
diff --git a/server/api/action/index.js b/server/api/action/index.js
index 4ea4ecf..80af3a2 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 _0xf8d8=['../../config/environment','./action.controller','put','/:id','isAuthenticated','update','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service'];(function(_0x693a6f,_0x3aac6f){var _0x4b9313=function(_0x4d920a){while(--_0x4d920a){_0x693a6f['push'](_0x693a6f['shift']());}};_0x4b9313(++_0x3aac6f);}(_0xf8d8,0x1a1));var _0x8f8d=function(_0x4b4277,_0x22676f){_0x4b4277=_0x4b4277-0x0;var _0x1ff405=_0xf8d8[_0x4b4277];return _0x1ff405;};'use strict';var multer=require(_0x8f8d('0x0'));var util=require(_0x8f8d('0x1'));var path=require(_0x8f8d('0x2'));var timeout=require(_0x8f8d('0x3'));var express=require(_0x8f8d('0x4'));var router=express[_0x8f8d('0x5')]();var fs_extra=require(_0x8f8d('0x6'));var auth=require('../../components/auth/service');var interaction=require(_0x8f8d('0x7'));var config=require(_0x8f8d('0x8'));var controller=require(_0x8f8d('0x9'));router[_0x8f8d('0xa')](_0x8f8d('0xb'),auth[_0x8f8d('0xc')](),controller[_0x8f8d('0xd')]);router[_0x8f8d('0xe')](_0x8f8d('0xb'),auth['isAuthenticated'](),controller[_0x8f8d('0xf')]);module[_0x8f8d('0x10')]=router;
\ No newline at end of file
+var _0x7863=['update','delete','destroy','exports','multer','connect-timeout','express','../../components/auth/service','../../components/interaction/service','../../config/environment','./action.controller','put','/:id','isAuthenticated'];(function(_0x2fafa5,_0x1ef53c){var _0x78aa81=function(_0x4836c5){while(--_0x4836c5){_0x2fafa5['push'](_0x2fafa5['shift']());}};_0x78aa81(++_0x1ef53c);}(_0x7863,0x11c));var _0x3786=function(_0x4fc4e7,_0x16bfc4){_0x4fc4e7=_0x4fc4e7-0x0;var _0x297133=_0x7863[_0x4fc4e7];return _0x297133;};'use strict';var multer=require(_0x3786('0x0'));var util=require('util');var path=require('path');var timeout=require(_0x3786('0x1'));var express=require(_0x3786('0x2'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0x3786('0x3'));var interaction=require(_0x3786('0x4'));var config=require(_0x3786('0x5'));var controller=require(_0x3786('0x6'));router[_0x3786('0x7')](_0x3786('0x8'),auth[_0x3786('0x9')](),controller[_0x3786('0xa')]);router[_0x3786('0xb')](_0x3786('0x8'),auth[_0x3786('0x9')](),controller[_0x3786('0xc')]);module[_0x3786('0xd')]=router;
\ No newline at end of file
diff --git a/server/api/analyticCustomReport/analyticCustomReport.attributes.js b/server/api/analyticCustomReport/analyticCustomReport.attributes.js
index 818cc0f..4a392aa 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 _0x1cb9=['TEXT','sequelize','STRING'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x1cb9,0x14e));var _0x91cb=function(_0x515ee4,_0x436b6b){_0x515ee4=_0x515ee4-0x0;var _0xe82fcb=_0x1cb9[_0x515ee4];return _0xe82fcb;};'use strict';var Sequelize=require(_0x91cb('0x0'));module['exports']={'name':{'type':Sequelize[_0x91cb('0x1')],'allowNull':![]},'description':{'type':Sequelize[_0x91cb('0x1')]},'parent':{'type':Sequelize[_0x91cb('0x1')]},'table':{'type':Sequelize[_0x91cb('0x1')]},'conditions':{'type':Sequelize['TEXT']},'joins':{'type':Sequelize[_0x91cb('0x2')]}};
\ No newline at end of file
+var _0xdc97=['exports','STRING','TEXT','sequelize'];(function(_0x342baa,_0x4a110f){var _0x1208f3=function(_0x56a645){while(--_0x56a645){_0x342baa['push'](_0x342baa['shift']());}};_0x1208f3(++_0x4a110f);}(_0xdc97,0x13b));var _0x7dc9=function(_0x214c71,_0x531fb8){_0x214c71=_0x214c71-0x0;var _0x23141b=_0xdc97[_0x214c71];return _0x23141b;};'use strict';var Sequelize=require(_0x7dc9('0x0'));module[_0x7dc9('0x1')]={'name':{'type':Sequelize[_0x7dc9('0x2')],'allowNull':![]},'description':{'type':Sequelize['STRING']},'parent':{'type':Sequelize[_0x7dc9('0x2')]},'table':{'type':Sequelize['STRING']},'conditions':{'type':Sequelize[_0x7dc9('0x3')]},'joins':{'type':Sequelize[_0x7dc9('0x3')]}};
\ No newline at end of file
diff --git a/server/api/analyticCustomReport/analyticCustomReport.controller.js b/server/api/analyticCustomReport/analyticCustomReport.controller.js
index 5da9466..0591871 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 _0xcfcb=['custom','AnalyticExtractedReport','cdr','.calldate\x20BETWEEN\x20?\x20AND\x20?','startDate','.createdAt\x20BETWEEN\x20?\x20AND\x20?','Run\x20Query:','child_process','../../components/export/','../../files/reports','countTable','run','COUNT(DISTINCT\x20%s)','MIN(%s)','SEC_TO_TIME(%s)','IS\x20NOT\x20EMPTY','Limited\x20Query:','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','sox','to-csv','ejs','fs-extra','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','then','get','CustomReports','UserProfileResource','destroy','stack','name','map','AnalyticCustomReport','fieldName','model','query','keys','attributes','intersection','length','hasOwnProperty','order','sort','where','filters','pick','filter','merge','type','VIRTUAL','options','includeAll','include','findAll','rows','params','rawAttributes','fields','find','create','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','UserProfileSection','catch','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','body','preview','join','left_join','cross_join','SUM(%s)','COUNT(%s)','AVG(%s)','GROUP_CONCAT(%s)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','DATE(%s)','HOUR(%s)','ROUND(%s)','UNIX_TIMESTAMP(%s)','IS\x20NULL','IS\x20NOT\x20NULL','IS\x20EMPTY','operator','rules','group','field','condition','value','getFields','Sequelize','Please\x20insert\x20at\x20least\x20one\x20field','AnalyticMetric','keyBy','select','table','MetricId','replace','function','format','orderBy','DESC','alias','joins','parse','includes','parentKey','foreignTable','%s.%s\x20=\x20%s.%s','foreignKey','conditions','clone','debug','toString','sequelize','QueryTypes','SELECT','right_join','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)','ValidationErrorItem','from','metric','groupBy','output','web','fullPath','randomstring','csv'];(function(_0x2bc44d,_0x286b2b){var _0x4df179=function(_0x3ae279){while(--_0x3ae279){_0x2bc44d['push'](_0x2bc44d['shift']());}};_0x4df179(++_0x286b2b);}(_0xcfcb,0x1f1));var _0xbcfc=function(_0x37bb40,_0x259deb){_0x37bb40=_0x37bb40-0x0;var _0x598fb0=_0xcfcb[_0x37bb40];return _0x598fb0;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xbcfc('0x0'));var zipdir=require(_0xbcfc('0x1'));var jsonpatch=require(_0xbcfc('0x2'));var rp=require(_0xbcfc('0x3'));var moment=require('moment');var BPromise=require(_0xbcfc('0x4'));var Mustache=require(_0xbcfc('0x5'));var util=require(_0xbcfc('0x6'));var path=require('path');var sox=require(_0xbcfc('0x7'));var csv=require(_0xbcfc('0x8'));var ejs=require(_0xbcfc('0x9'));var fs=require('fs');var fs_extra=require(_0xbcfc('0xa'));var _=require('lodash');var squel=require(_0xbcfc('0xb'));var crypto=require(_0xbcfc('0xc'));var jsforce=require(_0xbcfc('0xd'));var deskjs=require(_0xbcfc('0xe'));var toCsv=require(_0xbcfc('0x8'));var querystring=require(_0xbcfc('0xf'));var Papa=require(_0xbcfc('0x10'));var Redis=require(_0xbcfc('0x11'));var authService=require(_0xbcfc('0x12'));var qs=require(_0xbcfc('0x13'));var as=require(_0xbcfc('0x14'));var hardwareService=require(_0xbcfc('0x15'));var logger=require(_0xbcfc('0x16'))(_0xbcfc('0x17'));var utils=require(_0xbcfc('0x18'));var config=require(_0xbcfc('0x19'));var licenseUtil=require(_0xbcfc('0x1a'));var db=require(_0xbcfc('0x1b'))['db'];var dbH=require(_0xbcfc('0x1b'))['dbH'];function respondWithStatusCode(_0x32d260,_0x35511a){_0x35511a=_0x35511a||0xcc;return function(_0x4219f1){if(_0x4219f1){return _0x32d260['sendStatus'](_0x35511a);}return _0x32d260[_0xbcfc('0x1c')](_0x35511a)[_0xbcfc('0x1d')]();};}function respondWithResult(_0x27ba31,_0x6e2c68){_0x6e2c68=_0x6e2c68||0xc8;return function(_0x57baca){if(_0x57baca){return _0x27ba31[_0xbcfc('0x1c')](_0x6e2c68)[_0xbcfc('0x1e')](_0x57baca);}};}function respondWithFilteredResult(_0x4b8a0e,_0xcb19dd){return function(_0x319d90){if(_0x319d90){var _0x346555=typeof _0xcb19dd[_0xbcfc('0x1f')]===_0xbcfc('0x20')&&typeof _0xcb19dd[_0xbcfc('0x21')]===_0xbcfc('0x20');var _0x3c6b7a=_0x319d90[_0xbcfc('0x22')];var _0x5d80b8=_0x346555?0x0:_0xcb19dd[_0xbcfc('0x1f')];var _0x30997c=_0x346555?_0x319d90[_0xbcfc('0x22')]:_0xcb19dd[_0xbcfc('0x1f')]+_0xcb19dd[_0xbcfc('0x21')];var _0x1af8d4;if(_0x30997c>=_0x3c6b7a){_0x30997c=_0x3c6b7a;_0x1af8d4=0xc8;}else{_0x1af8d4=0xce;}_0x4b8a0e[_0xbcfc('0x1c')](_0x1af8d4);return _0x4b8a0e[_0xbcfc('0x23')](_0xbcfc('0x24'),_0x5d80b8+'-'+_0x30997c+'/'+_0x3c6b7a)[_0xbcfc('0x1e')](_0x319d90);}return null;};}function patchUpdates(_0x473e81){return function(_0x11ab21){try{jsonpatch[_0xbcfc('0x25')](_0x11ab21,_0x473e81,!![]);}catch(_0x521ad0){return BPromise['reject'](_0x521ad0);}return _0x11ab21['save']();};}function saveUpdates(_0x11a2b0,_0x126e35){return function(_0x555b14){if(_0x555b14){return _0x555b14['update'](_0x11a2b0)['then'](function(_0x12ec39){return _0x12ec39;});}return null;};}function removeEntity(_0xc1b55b,_0x334dae){return function(_0xb57db4){if(_0xb57db4){return _0xb57db4['destroy']()[_0xbcfc('0x26')](function(){var _0x49ec58=_0xb57db4[_0xbcfc('0x27')]({'plain':!![]});var _0x332229=_0xbcfc('0x28');return db[_0xbcfc('0x29')][_0xbcfc('0x2a')]({'where':{'type':_0x332229,'resourceId':_0x49ec58['id']}})[_0xbcfc('0x26')](function(){return _0xb57db4;});})[_0xbcfc('0x26')](function(){_0xc1b55b[_0xbcfc('0x1c')](0xcc)['end']();});}};}function handleEntityNotFound(_0x32ac48,_0x4deba6){return function(_0x2ae5b5){if(!_0x2ae5b5){_0x32ac48['sendStatus'](0x194);}return _0x2ae5b5;};}function handleError(_0x49b9d4,_0x4faf1c){_0x4faf1c=_0x4faf1c||0x1f4;return function(_0x1bbffd){logger['error'](_0x1bbffd[_0xbcfc('0x2b')]);if(_0x1bbffd['name']){delete _0x1bbffd[_0xbcfc('0x2c')];}_0x49b9d4[_0xbcfc('0x1c')](_0x4faf1c)['send'](_0x1bbffd);};}exports['index']=function(_0x3c2061,_0x5b7ed6){var _0x464309={},_0x36e897={},_0x3e6e70={'count':0x0,'rows':[]};var _0x517a71=_[_0xbcfc('0x2d')](db[_0xbcfc('0x2e')]['rawAttributes'],function(_0x303808){return{'name':_0x303808[_0xbcfc('0x2f')],'type':_0x303808['type']['key']};});_0x36e897[_0xbcfc('0x30')]=_['map'](_0x517a71,_0xbcfc('0x2c'));_0x36e897[_0xbcfc('0x31')]=_[_0xbcfc('0x32')](_0x3c2061['query']);_0x36e897['filters']=_['intersection'](_0x36e897[_0xbcfc('0x30')],_0x36e897[_0xbcfc('0x31')]);_0x464309[_0xbcfc('0x33')]=_[_0xbcfc('0x34')](_0x36e897['model'],qs['fields'](_0x3c2061['query']['fields']));_0x464309[_0xbcfc('0x33')]=_0x464309['attributes'][_0xbcfc('0x35')]?_0x464309['attributes']:_0x36e897[_0xbcfc('0x30')];if(!_0x3c2061[_0xbcfc('0x31')][_0xbcfc('0x36')]('nolimit')){_0x464309['limit']=qs[_0xbcfc('0x21')](_0x3c2061[_0xbcfc('0x31')]['limit']);_0x464309['offset']=qs[_0xbcfc('0x1f')](_0x3c2061[_0xbcfc('0x31')][_0xbcfc('0x1f')]);}_0x464309[_0xbcfc('0x37')]=qs[_0xbcfc('0x38')](_0x3c2061[_0xbcfc('0x31')][_0xbcfc('0x38')]);_0x464309[_0xbcfc('0x39')]=qs[_0xbcfc('0x3a')](_[_0xbcfc('0x3b')](_0x3c2061['query'],_0x36e897['filters']),_0x517a71);if(_0x3c2061[_0xbcfc('0x31')][_0xbcfc('0x3c')]){_0x464309[_0xbcfc('0x39')]=_[_0xbcfc('0x3d')](_0x464309[_0xbcfc('0x39')],{'$or':_[_0xbcfc('0x2d')](_0x517a71,function(_0x461314){if(_0x461314[_0xbcfc('0x3e')]!==_0xbcfc('0x3f')){var _0x44fce9={};_0x44fce9[_0x461314[_0xbcfc('0x2c')]]={'$like':'%'+_0x3c2061['query'][_0xbcfc('0x3c')]+'%'};return _0x44fce9;}})});}_0x464309=_[_0xbcfc('0x3d')]({},_0x464309,_0x3c2061[_0xbcfc('0x40')]);var _0x18bdaa={'where':_0x464309[_0xbcfc('0x39')]};return db[_0xbcfc('0x2e')][_0xbcfc('0x22')](_0x18bdaa)[_0xbcfc('0x26')](function(_0x496759){_0x3e6e70[_0xbcfc('0x22')]=_0x496759;if(_0x3c2061[_0xbcfc('0x31')][_0xbcfc('0x41')]){_0x464309[_0xbcfc('0x42')]=[{'all':!![]}];}return db[_0xbcfc('0x2e')][_0xbcfc('0x43')](_0x464309);})[_0xbcfc('0x26')](function(_0x44cc35){_0x3e6e70[_0xbcfc('0x44')]=_0x44cc35;return _0x3e6e70;})[_0xbcfc('0x26')](respondWithFilteredResult(_0x5b7ed6,_0x464309))['catch'](handleError(_0x5b7ed6,null));};exports['show']=function(_0x3f54c7,_0x57afd8){var _0x359e3b={'raw':![],'where':{'id':_0x3f54c7[_0xbcfc('0x45')]['id']}},_0x13d823={};_0x13d823[_0xbcfc('0x30')]=_[_0xbcfc('0x32')](db[_0xbcfc('0x2e')][_0xbcfc('0x46')]);_0x13d823['query']=_['keys'](_0x3f54c7[_0xbcfc('0x31')]);_0x13d823[_0xbcfc('0x3a')]=_['intersection'](_0x13d823['model'],_0x13d823['query']);_0x359e3b[_0xbcfc('0x33')]=_[_0xbcfc('0x34')](_0x13d823[_0xbcfc('0x30')],qs[_0xbcfc('0x47')](_0x3f54c7[_0xbcfc('0x31')][_0xbcfc('0x47')]));_0x359e3b[_0xbcfc('0x33')]=_0x359e3b[_0xbcfc('0x33')][_0xbcfc('0x35')]?_0x359e3b[_0xbcfc('0x33')]:_0x13d823[_0xbcfc('0x30')];if(_0x3f54c7[_0xbcfc('0x31')][_0xbcfc('0x41')]){_0x359e3b[_0xbcfc('0x42')]=[{'all':!![]}];}_0x359e3b=_['merge']({},_0x359e3b,_0x3f54c7[_0xbcfc('0x40')]);return db['AnalyticCustomReport'][_0xbcfc('0x48')](_0x359e3b)[_0xbcfc('0x26')](handleEntityNotFound(_0x57afd8,null))['then'](respondWithResult(_0x57afd8,null))['catch'](handleError(_0x57afd8,null));};exports[_0xbcfc('0x49')]=function(_0x2a5d1d,_0x296cc8){return db[_0xbcfc('0x2e')][_0xbcfc('0x49')](_0x2a5d1d['body'],{})['then'](function(_0x458def){var _0x4093c1=_0x2a5d1d['user'][_0xbcfc('0x27')]({'plain':!![]});if(!_0x4093c1)throw new Error(_0xbcfc('0x4a'));if(_0x4093c1[_0xbcfc('0x4b')]===_0xbcfc('0x4c')){var _0x56dfa2=_0x458def['get']({'plain':!![]});var _0x37902b='Reports';return db[_0xbcfc('0x4d')][_0xbcfc('0x48')]({'where':{'name':_0x37902b,'userProfileId':_0x4093c1['userProfileId']},'raw':!![]})[_0xbcfc('0x26')](function(_0x35987f){if(_0x35987f&&_0x35987f['autoAssociation']===0x0){return db[_0xbcfc('0x29')][_0xbcfc('0x49')]({'name':_0x56dfa2[_0xbcfc('0x2c')],'resourceId':_0x56dfa2['id'],'type':_0xbcfc('0x28'),'sectionId':_0x35987f['id']},{})['then'](function(){return _0x458def;});}else{return _0x458def;}})[_0xbcfc('0x4e')](function(_0x211c9f){logger['error'](_0xbcfc('0x4f'),_0x211c9f);throw _0x211c9f;});}return _0x458def;})[_0xbcfc('0x26')](respondWithResult(_0x296cc8,0xc9))['catch'](handleError(_0x296cc8,null));};exports[_0xbcfc('0x50')]=function(_0x3a816c,_0x151a4b){if(_0x3a816c[_0xbcfc('0x51')]['id']){delete _0x3a816c[_0xbcfc('0x51')]['id'];}return db[_0xbcfc('0x2e')][_0xbcfc('0x48')]({'where':{'id':_0x3a816c['params']['id']}})[_0xbcfc('0x26')](handleEntityNotFound(_0x151a4b,null))[_0xbcfc('0x26')](saveUpdates(_0x3a816c['body'],null))[_0xbcfc('0x26')](respondWithResult(_0x151a4b,null))[_0xbcfc('0x4e')](handleError(_0x151a4b,null));};exports[_0xbcfc('0x2a')]=function(_0x413483,_0xbe3ee3){return db[_0xbcfc('0x2e')][_0xbcfc('0x48')]({'where':{'id':_0x413483[_0xbcfc('0x45')]['id']}})[_0xbcfc('0x26')](handleEntityNotFound(_0xbe3ee3,null))[_0xbcfc('0x26')](removeEntity(_0xbe3ee3,null))[_0xbcfc('0x4e')](handleError(_0xbe3ee3,null));};exports[_0xbcfc('0x52')]=function(_0x48fb8f,_0x412dc0){var _0xfab25d=0xa;var _0x364036=[_0xbcfc('0x53'),_0xbcfc('0x54'),'right_join',_0xbcfc('0x55')];var _0x5d89c9={'SUM':_0xbcfc('0x56'),'COUNT':_0xbcfc('0x57'),'COUNT DISTINCT':'COUNT(DISTINCT\x20%s)','MAX':'MAX(%s)','MIN':'MIN(%s)','AVG':_0xbcfc('0x58'),'GROUP_CONCAT':_0xbcfc('0x59'),'GROUP_CONCAT ASC':_0xbcfc('0x5a'),'GROUP_CONCAT DESC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)'};var _0x213576={'SEC_TO_TIME':'SEC_TO_TIME(%s)','DATE':_0xbcfc('0x5b'),'HOUR':_0xbcfc('0x5c'),'ROUND':_0xbcfc('0x5d'),'UNIX_TIMESTAMP':_0xbcfc('0x5e')};var _0xeeb5eb=function(_0x4b6d11){return!_['includes']([_0xbcfc('0x5f'),_0xbcfc('0x60'),_0xbcfc('0x61'),'IS\x20NOT\x20EMPTY'],_0x4b6d11);};var _0x51ea89=function(_0x282460){if(!_0x282460||!_0x282460['rules']['length']){return'';}for(var _0x5bb98c='(',_0x5f08ab=0x0;_0x5f08ab<_0x282460['rules'][_0xbcfc('0x35')];_0x5f08ab+=0x1){_0x5f08ab>0x0&&(_0x5bb98c+='\x20'+_0x282460[_0xbcfc('0x62')]+'\x20');_0x5bb98c+=_0x282460[_0xbcfc('0x63')][_0x5f08ab][_0xbcfc('0x64')]?_0x51ea89(_0x282460[_0xbcfc('0x63')][_0x5f08ab][_0xbcfc('0x64')]):_0x282460[_0xbcfc('0x63')][_0x5f08ab][_0xbcfc('0x65')]+'\x20'+_0x282460['rules'][_0x5f08ab]['condition']+(_0xeeb5eb(_0x282460[_0xbcfc('0x63')][_0x5f08ab][_0xbcfc('0x66')])?'\x20'+_0x282460[_0xbcfc('0x63')][_0x5f08ab][_0xbcfc('0x67')]:'');}return _0x5bb98c+')';};var _0xe2d6b={'where':{'id':_0x48fb8f[_0xbcfc('0x45')]['id']}},_0x28e5fc,_0x56ad92,_0x4cb7dc,_0x31633e,_0x35863a;_0xe2d6b=_[_0xbcfc('0x3d')]({},_0xe2d6b,_0x48fb8f[_0xbcfc('0x40')]);return db[_0xbcfc('0x2e')][_0xbcfc('0x48')](_0xe2d6b)[_0xbcfc('0x26')](function(_0x2c754c){if(_0x2c754c){_0x28e5fc=_0x2c754c;return _0x2c754c[_0xbcfc('0x68')]();}return null;})[_0xbcfc('0x26')](function(_0x4f64d9){if(_0x4f64d9){if(!_0x4f64d9[_0xbcfc('0x35')]){throw new db[(_0xbcfc('0x69'))]['ValidationErrorItem'](_0xbcfc('0x6a'),0x193);}_0x56ad92=_0x4f64d9;return db[_0xbcfc('0x6b')][_0xbcfc('0x43')]({'raw':!![]});}return null;})[_0xbcfc('0x26')](function(_0x1b5eca){if(_0x1b5eca){_0x4cb7dc=_[_0xbcfc('0x6c')](_0x1b5eca,'id');var _0x580c43;var _0x564ebc=squel[_0xbcfc('0x6d')]();_0x564ebc['from'](_0x28e5fc[_0xbcfc('0x6e')]);for(var _0xf41b2e=0x0;_0xf41b2e<_0x56ad92[_0xbcfc('0x35')];_0xf41b2e+=0x1){_0x580c43=_0x56ad92[_0xf41b2e][_0xbcfc('0x6f')]?_0x4cb7dc[_0x56ad92[_0xf41b2e][_0xbcfc('0x6f')]]['metric']:_0x56ad92[_0xf41b2e][_0xbcfc('0x65')];_0x580c43=_0x56ad92[_0xf41b2e]['function']?_[_0xbcfc('0x70')](_0x5d89c9[_0x56ad92[_0xf41b2e][_0xbcfc('0x71')]],'%s',_0x580c43):_0x580c43;_0x580c43=_0x56ad92[_0xf41b2e][_0xbcfc('0x72')]?_[_0xbcfc('0x70')](_0x213576[_0x56ad92[_0xf41b2e]['format']],'%s',_0x580c43):_0x580c43;if(_0x56ad92[_0xf41b2e]['groupBy']){_0x564ebc[_0xbcfc('0x64')](_0x580c43);}_0x56ad92[_0xf41b2e][_0xbcfc('0x73')]&&_0x564ebc[_0xbcfc('0x37')](_0x580c43,_0x56ad92[_0xf41b2e]['orderBy']===_0xbcfc('0x74')?![]:!![]);_0x564ebc[_0xbcfc('0x65')](_0x580c43,_0x56ad92[_0xf41b2e][_0xbcfc('0x75')]||_0x580c43);}if(_0x28e5fc[_0xbcfc('0x76')]){_0x28e5fc['joins']=JSON[_0xbcfc('0x77')](_0x28e5fc[_0xbcfc('0x76')]);for(var _0x16b1de=0x0;_0x16b1de<_0x28e5fc['joins'][_0xbcfc('0x35')];_0x16b1de+=0x1){if(_0x28e5fc[_0xbcfc('0x76')][_0x16b1de][_0xbcfc('0x3e')]&&_[_0xbcfc('0x78')](_0x364036,_0x28e5fc[_0xbcfc('0x76')][_0x16b1de][_0xbcfc('0x3e')])&&_0x28e5fc['joins'][_0x16b1de][_0xbcfc('0x79')]&&_0x28e5fc[_0xbcfc('0x76')][_0x16b1de][_0xbcfc('0x7a')]&&_0x28e5fc[_0xbcfc('0x76')][_0x16b1de]['foreignKey']){_0x564ebc[_0x28e5fc[_0xbcfc('0x76')][_0x16b1de]['type']](_0x28e5fc[_0xbcfc('0x76')][_0x16b1de]['foreignTable'],null,util[_0xbcfc('0x72')](_0xbcfc('0x7b'),_0x28e5fc[_0xbcfc('0x6e')],_0x28e5fc[_0xbcfc('0x76')][_0x16b1de][_0xbcfc('0x79')],_0x28e5fc[_0xbcfc('0x76')][_0x16b1de][_0xbcfc('0x7a')],_0x28e5fc['joins'][_0x16b1de][_0xbcfc('0x7c')]));}}}if(_0x28e5fc[_0xbcfc('0x7d')]){_0x28e5fc[_0xbcfc('0x7d')]=JSON[_0xbcfc('0x77')](_0x28e5fc['conditions']);_0x564ebc[_0xbcfc('0x39')](_0x51ea89(_0x28e5fc[_0xbcfc('0x7d')][_0xbcfc('0x64')]));}_0x35863a=_0x564ebc[_0xbcfc('0x7e')]();_0x564ebc['limit'](_0xfab25d);_0x564ebc['offset'](0x0);logger[_0xbcfc('0x7f')]('Limited\x20Query:',_0x564ebc[_0xbcfc('0x80')]());return dbH['sequelize'][_0xbcfc('0x31')](_0x564ebc[_0xbcfc('0x80')](),{'type':dbH[_0xbcfc('0x81')][_0xbcfc('0x82')][_0xbcfc('0x83')]});}})[_0xbcfc('0x26')](respondWithResult(_0x412dc0,null))[_0xbcfc('0x4e')](handleError(_0x412dc0,null));};function runReport(_0x2632f3,_0x210aa6,_0xbf0c8c){var _0x1060b2=_0x210aa6['name'];var _0x53a7d7=0xa;var _0xa3c639=[_0xbcfc('0x53'),_0xbcfc('0x54'),_0xbcfc('0x84'),'cross_join'];var _0x301de5={'SUM':_0xbcfc('0x56'),'COUNT':'COUNT(%s)','COUNT DISTINCT':'COUNT(DISTINCT\x20%s)','MAX':'MAX(%s)','MIN':'MIN(%s)','AVG':_0xbcfc('0x58'),'GROUP_CONCAT':'GROUP_CONCAT(%s)','GROUP_CONCAT ASC':_0xbcfc('0x5a'),'GROUP_CONCAT DESC':_0xbcfc('0x85')};var _0xd0787f={'SEC_TO_TIME':'SEC_TO_TIME(%s)','DATE':_0xbcfc('0x5b'),'HOUR':'HOUR(%s)','ROUND':_0xbcfc('0x5d'),'UNIX_TIMESTAMP':'UNIX_TIMESTAMP(%s)'};var _0x1acc69=function(_0x3a685f){return!_[_0xbcfc('0x78')]([_0xbcfc('0x5f'),_0xbcfc('0x60'),_0xbcfc('0x61'),'IS\x20NOT\x20EMPTY'],_0x3a685f);};var _0x19e8ef=function(_0x24fa11){if(!_0x24fa11||!_0x24fa11['rules'][_0xbcfc('0x35')]){return'';}for(var _0x4fcd6d='(',_0x40644a=0x0;_0x40644a<_0x24fa11[_0xbcfc('0x63')][_0xbcfc('0x35')];_0x40644a+=0x1){_0x40644a>0x0&&(_0x4fcd6d+='\x20'+_0x24fa11[_0xbcfc('0x62')]+'\x20');_0x4fcd6d+=_0x24fa11['rules'][_0x40644a]['group']?_0x19e8ef(_0x24fa11[_0xbcfc('0x63')][_0x40644a][_0xbcfc('0x64')]):_0x24fa11[_0xbcfc('0x63')][_0x40644a][_0xbcfc('0x65')]+'\x20'+_0x24fa11['rules'][_0x40644a][_0xbcfc('0x66')]+(_0x1acc69(_0x24fa11['rules'][_0x40644a][_0xbcfc('0x66')])?'\x20'+_0x24fa11[_0xbcfc('0x63')][_0x40644a][_0xbcfc('0x67')]:'');}return _0x4fcd6d+')';};var _0x14cb47={'where':{'id':_0x2632f3['id']}},_0x1a86e7,_0xb744f1,_0x44be96,_0x4255c4,_0x33521f;_0x14cb47=_[_0xbcfc('0x3d')]({},_0x14cb47,_0xbf0c8c);return db[_0xbcfc('0x2e')]['find'](_0x14cb47)[_0xbcfc('0x26')](function(_0x38ea37){if(_0x38ea37){_0x1a86e7=_0x38ea37;return _0x38ea37['getFields']();}return null;})[_0xbcfc('0x26')](function(_0x517aaa){if(_0x517aaa){if(!_0x517aaa[_0xbcfc('0x35')]){throw new db[(_0xbcfc('0x69'))][(_0xbcfc('0x86'))](_0xbcfc('0x6a'),0x193);}_0xb744f1=_0x517aaa;return db[_0xbcfc('0x6b')][_0xbcfc('0x43')]({'raw':!![]});}return null;})[_0xbcfc('0x26')](function(_0x39d47c){if(_0x39d47c){_0x44be96=_[_0xbcfc('0x6c')](_0x39d47c,'id');var _0x51cc13;var _0x46a37e=squel[_0xbcfc('0x6d')]();_0x46a37e[_0xbcfc('0x87')](_0x1a86e7['table']);for(var _0x18472d=0x0;_0x18472d<_0xb744f1[_0xbcfc('0x35')];_0x18472d+=0x1){_0x51cc13=_0xb744f1[_0x18472d][_0xbcfc('0x6f')]?_0x44be96[_0xb744f1[_0x18472d][_0xbcfc('0x6f')]][_0xbcfc('0x88')]:_0xb744f1[_0x18472d][_0xbcfc('0x65')];_0x51cc13=_0xb744f1[_0x18472d][_0xbcfc('0x71')]?_[_0xbcfc('0x70')](_0x301de5[_0xb744f1[_0x18472d][_0xbcfc('0x71')]],'%s',_0x51cc13):_0x51cc13;_0x51cc13=_0xb744f1[_0x18472d][_0xbcfc('0x72')]?_[_0xbcfc('0x70')](_0xd0787f[_0xb744f1[_0x18472d][_0xbcfc('0x72')]],'%s',_0x51cc13):_0x51cc13;if(_0xb744f1[_0x18472d][_0xbcfc('0x89')]){_0x46a37e[_0xbcfc('0x64')](_0x51cc13);}_0xb744f1[_0x18472d][_0xbcfc('0x73')]&&_0x46a37e[_0xbcfc('0x37')](_0x51cc13,_0xb744f1[_0x18472d][_0xbcfc('0x73')]===_0xbcfc('0x74')?![]:!![]);_0x46a37e['field'](_0x51cc13,_0xb744f1[_0x18472d][_0xbcfc('0x75')]||_0x51cc13);}if(_0x1a86e7[_0xbcfc('0x76')]){_0x1a86e7[_0xbcfc('0x76')]=JSON[_0xbcfc('0x77')](_0x1a86e7['joins']);for(var _0x2786e9=0x0;_0x2786e9<_0x1a86e7[_0xbcfc('0x76')][_0xbcfc('0x35')];_0x2786e9+=0x1){if(_0x1a86e7['joins'][_0x2786e9][_0xbcfc('0x3e')]&&_[_0xbcfc('0x78')](_0xa3c639,_0x1a86e7[_0xbcfc('0x76')][_0x2786e9][_0xbcfc('0x3e')])&&_0x1a86e7['joins'][_0x2786e9]['parentKey']&&_0x1a86e7[_0xbcfc('0x76')][_0x2786e9][_0xbcfc('0x7a')]&&_0x1a86e7['joins'][_0x2786e9][_0xbcfc('0x7c')]){_0x46a37e[_0x1a86e7[_0xbcfc('0x76')][_0x2786e9][_0xbcfc('0x3e')]](_0x1a86e7[_0xbcfc('0x76')][_0x2786e9][_0xbcfc('0x7a')],null,util[_0xbcfc('0x72')](_0xbcfc('0x7b'),_0x1a86e7[_0xbcfc('0x6e')],_0x1a86e7['joins'][_0x2786e9][_0xbcfc('0x79')],_0x1a86e7[_0xbcfc('0x76')][_0x2786e9][_0xbcfc('0x7a')],_0x1a86e7[_0xbcfc('0x76')][_0x2786e9][_0xbcfc('0x7c')]));}}}if(_0x1a86e7[_0xbcfc('0x7d')]){_0x1a86e7[_0xbcfc('0x7d')]=JSON[_0xbcfc('0x77')](_0x1a86e7[_0xbcfc('0x7d')]);_0x46a37e[_0xbcfc('0x39')](_0x19e8ef(_0x1a86e7['conditions']['group']));}_0x33521f=_0x46a37e[_0xbcfc('0x7e')]();_0x46a37e[_0xbcfc('0x21')](_0x53a7d7);_0x46a37e[_0xbcfc('0x1f')](0x0);return;}})[_0xbcfc('0x26')](function(){if(_0x210aa6[_0xbcfc('0x8a')]===_0xbcfc('0x8b')){return null;}var _0x33bf35=_['merge'](_0x210aa6,{'name':_0x210aa6[_0xbcfc('0x8c')]||_0x210aa6[_0xbcfc('0x2c')]||_0x1a86e7[_0xbcfc('0x2c')],'basename':_0x1060b2,'savename':util[_0xbcfc('0x72')]('%s-%s.%s',_0x210aa6[_0xbcfc('0x2c')]||_0x1a86e7[_0xbcfc('0x2c')],require(_0xbcfc('0x8d'))['generate'](0x4),_0x210aa6[_0xbcfc('0x8a')]||_0xbcfc('0x8e')),'reportId':_0x1a86e7['id'],'reportType':_0xbcfc('0x8f')});return db[_0xbcfc('0x90')]['create'](_0x33bf35,{'raw':!![]});})[_0xbcfc('0x26')](function(_0x28a1dd){if(_0x1a86e7[_0xbcfc('0x6e')]===_0xbcfc('0x91')){_0x33521f[_0xbcfc('0x39')](_0x1a86e7[_0xbcfc('0x6e')]+_0xbcfc('0x92'),_0x210aa6[_0xbcfc('0x93')],_0x210aa6['endDate']);}else{_0x33521f[_0xbcfc('0x39')](_0x1a86e7[_0xbcfc('0x6e')]+_0xbcfc('0x94'),_0x210aa6['startDate'],_0x210aa6['endDate']);}if(_0x28a1dd){logger['info'](_0xbcfc('0x95'),_0x33521f['toString']());require(_0xbcfc('0x96'))['fork'](path[_0xbcfc('0x53')](__dirname,_0xbcfc('0x97'),_0x28a1dd['output']),[_0x28a1dd['id'],_0x33521f[_0xbcfc('0x80')](),path[_0xbcfc('0x53')](__dirname,_0xbcfc('0x98'),_0x28a1dd['savename']),_0x1060b2]);return _0x28a1dd;}else{var _0x4bd85a=squel[_0xbcfc('0x6d')]();_0x4bd85a['from']('('+_0x33521f[_0xbcfc('0x80')]()+')',_0xbcfc('0x99'));_0x4bd85a[_0xbcfc('0x65')]('COUNT(*)',_0xbcfc('0x22'));_0x33521f[_0xbcfc('0x21')](_0x210aa6['limit']||_0x53a7d7);_0x33521f[_0xbcfc('0x1f')](_0x210aa6[_0xbcfc('0x1f')]||0x0);return dbH['sequelize'][_0xbcfc('0x31')](_0x4bd85a[_0xbcfc('0x80')](),{'type':dbH['sequelize'][_0xbcfc('0x82')][_0xbcfc('0x83')]})[_0xbcfc('0x26')](function(_0x297669){if(!_0x297669[_0xbcfc('0x35')]){_0x4255c4=0x0;}else{_0x4255c4=_0x297669[0x0][_0xbcfc('0x22')]||0x0;}return dbH[_0xbcfc('0x81')][_0xbcfc('0x31')](_0x33521f[_0xbcfc('0x80')](),{'type':dbH[_0xbcfc('0x81')][_0xbcfc('0x82')][_0xbcfc('0x83')]});})[_0xbcfc('0x26')](function(_0x587fcb){return{'rows':_0x587fcb||[],'count':_0x4255c4};});}});}exports[_0xbcfc('0x9a')]=function(_0x5658ff,_0xd92d37){return runReport(_0x5658ff['params'],_0x5658ff[_0xbcfc('0x31')],_0x5658ff[_0xbcfc('0x40')])[_0xbcfc('0x26')](respondWithResult(_0xd92d37,null))[_0xbcfc('0x4e')](handleError(_0xd92d37,null));};exports['runReport']=runReport;exports[_0xbcfc('0x31')]=function(_0x347606,_0x2eabe4){var _0x5ddd60=0xa;var _0x3e7d8f=[_0xbcfc('0x53'),_0xbcfc('0x54'),'right_join','cross_join'];var _0x5a89ea={'SUM':_0xbcfc('0x56'),'COUNT':'COUNT(%s)','COUNT DISTINCT':_0xbcfc('0x9b'),'MAX':'MAX(%s)','MIN':_0xbcfc('0x9c'),'AVG':'AVG(%s)','GROUP_CONCAT':_0xbcfc('0x59'),'GROUP_CONCAT ASC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT DESC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)'};var _0x5edba5={'SEC_TO_TIME':_0xbcfc('0x9d'),'DATE':'DATE(%s)','HOUR':_0xbcfc('0x5c'),'ROUND':_0xbcfc('0x5d'),'UNIX_TIMESTAMP':'UNIX_TIMESTAMP(%s)'};var _0x4fc773=function(_0x3de9a0){return!_[_0xbcfc('0x78')](['IS\x20NULL',_0xbcfc('0x60'),_0xbcfc('0x61'),_0xbcfc('0x9e')],_0x3de9a0);};var _0x1ddda5=function(_0x304f67){if(!_0x304f67||!_0x304f67[_0xbcfc('0x63')][_0xbcfc('0x35')]){return'';}for(var _0x1348f3='(',_0x85641d=0x0;_0x85641d<_0x304f67[_0xbcfc('0x63')][_0xbcfc('0x35')];_0x85641d+=0x1){_0x85641d>0x0&&(_0x1348f3+='\x20'+_0x304f67[_0xbcfc('0x62')]+'\x20');_0x1348f3+=_0x304f67[_0xbcfc('0x63')][_0x85641d][_0xbcfc('0x64')]?_0x1ddda5(_0x304f67[_0xbcfc('0x63')][_0x85641d]['group']):_0x304f67[_0xbcfc('0x63')][_0x85641d][_0xbcfc('0x65')]+'\x20'+_0x304f67[_0xbcfc('0x63')][_0x85641d][_0xbcfc('0x66')]+(_0x4fc773(_0x304f67['rules'][_0x85641d][_0xbcfc('0x66')])?'\x20'+_0x304f67['rules'][_0x85641d]['value']:'');}return _0x1348f3+')';};var _0x1e3636={'where':{'id':_0x347606[_0xbcfc('0x45')]['id']}},_0xe2f605,_0x2ba7ad,_0x3c2517,_0x250b4c,_0x3cdef1;_0x1e3636=_[_0xbcfc('0x3d')]({},_0x1e3636,_0x347606[_0xbcfc('0x40')]);return db[_0xbcfc('0x2e')][_0xbcfc('0x48')](_0x1e3636)[_0xbcfc('0x26')](function(_0x4c91d6){if(_0x4c91d6){_0xe2f605=_0x4c91d6;return _0x4c91d6[_0xbcfc('0x68')]();}return null;})['then'](function(_0x4fda2d){if(_0x4fda2d){if(!_0x4fda2d['length']){throw new db[(_0xbcfc('0x69'))]['ValidationErrorItem']('Please\x20insert\x20at\x20least\x20one\x20field',0x193);}_0x2ba7ad=_0x4fda2d;return db[_0xbcfc('0x6b')][_0xbcfc('0x43')]({'raw':!![]});}return null;})[_0xbcfc('0x26')](function(_0x586ee3){if(_0x586ee3){_0x3c2517=_[_0xbcfc('0x6c')](_0x586ee3,'id');var _0x1a46a3;var _0x3336fe=squel[_0xbcfc('0x6d')]();_0x3336fe[_0xbcfc('0x87')](_0xe2f605['table']);for(var _0x6d53e7=0x0;_0x6d53e7<_0x2ba7ad['length'];_0x6d53e7+=0x1){_0x1a46a3=_0x2ba7ad[_0x6d53e7]['MetricId']?_0x3c2517[_0x2ba7ad[_0x6d53e7][_0xbcfc('0x6f')]][_0xbcfc('0x88')]:_0x2ba7ad[_0x6d53e7][_0xbcfc('0x65')];_0x1a46a3=_0x2ba7ad[_0x6d53e7][_0xbcfc('0x71')]?_['replace'](_0x5a89ea[_0x2ba7ad[_0x6d53e7]['function']],'%s',_0x1a46a3):_0x1a46a3;_0x1a46a3=_0x2ba7ad[_0x6d53e7][_0xbcfc('0x72')]?_[_0xbcfc('0x70')](_0x5edba5[_0x2ba7ad[_0x6d53e7][_0xbcfc('0x72')]],'%s',_0x1a46a3):_0x1a46a3;if(_0x2ba7ad[_0x6d53e7]['groupBy']){_0x3336fe[_0xbcfc('0x64')](_0x1a46a3);}_0x2ba7ad[_0x6d53e7][_0xbcfc('0x73')]&&_0x3336fe[_0xbcfc('0x37')](_0x1a46a3,_0x2ba7ad[_0x6d53e7][_0xbcfc('0x73')]===_0xbcfc('0x74')?![]:!![]);_0x3336fe[_0xbcfc('0x65')](_0x1a46a3,_0x2ba7ad[_0x6d53e7]['alias']||_0x1a46a3);}if(_0xe2f605[_0xbcfc('0x76')]){_0xe2f605[_0xbcfc('0x76')]=JSON[_0xbcfc('0x77')](_0xe2f605[_0xbcfc('0x76')]);for(var _0x2b9b32=0x0;_0x2b9b32<_0xe2f605[_0xbcfc('0x76')]['length'];_0x2b9b32+=0x1){if(_0xe2f605[_0xbcfc('0x76')][_0x2b9b32]['type']&&_[_0xbcfc('0x78')](_0x3e7d8f,_0xe2f605[_0xbcfc('0x76')][_0x2b9b32][_0xbcfc('0x3e')])&&_0xe2f605[_0xbcfc('0x76')][_0x2b9b32][_0xbcfc('0x79')]&&_0xe2f605[_0xbcfc('0x76')][_0x2b9b32][_0xbcfc('0x7a')]&&_0xe2f605[_0xbcfc('0x76')][_0x2b9b32][_0xbcfc('0x7c')]){_0x3336fe[_0xe2f605[_0xbcfc('0x76')][_0x2b9b32][_0xbcfc('0x3e')]](_0xe2f605[_0xbcfc('0x76')][_0x2b9b32][_0xbcfc('0x7a')],null,util[_0xbcfc('0x72')](_0xbcfc('0x7b'),_0xe2f605['table'],_0xe2f605[_0xbcfc('0x76')][_0x2b9b32][_0xbcfc('0x79')],_0xe2f605[_0xbcfc('0x76')][_0x2b9b32]['foreignTable'],_0xe2f605[_0xbcfc('0x76')][_0x2b9b32][_0xbcfc('0x7c')]));}}}if(_0xe2f605[_0xbcfc('0x7d')]){_0xe2f605['conditions']=JSON[_0xbcfc('0x77')](_0xe2f605['conditions']);_0x3336fe[_0xbcfc('0x39')](_0x1ddda5(_0xe2f605[_0xbcfc('0x7d')]['group']));}_0x3cdef1=_0x3336fe['clone']();_0x3336fe[_0xbcfc('0x21')](_0x5ddd60);_0x3336fe['offset'](0x0);logger[_0xbcfc('0x7f')](_0xbcfc('0x9f'),_0x3336fe[_0xbcfc('0x80')]());return dbH[_0xbcfc('0x81')][_0xbcfc('0x31')](_0x3336fe['toString'](),{'type':dbH[_0xbcfc('0x81')][_0xbcfc('0x82')]['SELECT']});}})[_0xbcfc('0x26')](function(){return{'sql':_0x3cdef1[_0xbcfc('0x80')]()};})[_0xbcfc('0x26')](respondWithResult(_0x2eabe4,null))[_0xbcfc('0x4e')](handleError(_0x2eabe4,null));};
\ No newline at end of file
+var _0x44d4=['then','destroy','CustomReports','UserProfileResource','error','stack','map','AnalyticCustomReport','rawAttributes','type','key','name','query','keys','filters','model','attributes','intersection','fields','length','hasOwnProperty','nolimit','offset','order','where','pick','filter','merge','options','include','findAll','catch','params','includeAll','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','get','Reports','UserProfileSection','autoAssociation','preview','join','left_join','cross_join','SUM(%s)','COUNT(%s)','COUNT(DISTINCT\x20%s)','MIN(%s)','AVG(%s)','GROUP_CONCAT(%s)','SEC_TO_TIME(%s)','DATE(%s)','HOUR(%s)','ROUND(%s)','UNIX_TIMESTAMP(%s)','includes','IS\x20NULL','IS\x20NOT\x20NULL','IS\x20EMPTY','IS\x20NOT\x20EMPTY','rules','operator','group','condition','value','getFields','Sequelize','ValidationErrorItem','Please\x20insert\x20at\x20least\x20one\x20field','keyBy','select','from','table','metric','field','function','replace','groupBy','orderBy','DESC','alias','joins','parse','parentKey','foreignKey','foreignTable','%s.%s\x20=\x20%s.%s','conditions','debug','toString','sequelize','QueryTypes','SELECT','right_join','MAX(%s)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)','AnalyticMetric','MetricId','format','clone','output','web','fullPath','randomstring','custom','AnalyticExtractedReport','cdr','.calldate\x20BETWEEN\x20?\x20AND\x20?','endDate','.createdAt\x20BETWEEN\x20?\x20AND\x20?','startDate','info','Run\x20Query:','child_process','fork','../../components/export/','../../files/reports','COUNT(*)','runReport','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','fs-extra','squel','crypto','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','dbH','sendStatus','status','end','json','limit','undefined','count','Content-Range','apply','reject','save','update'];(function(_0x279994,_0x582317){var _0x353d7a=function(_0x2c101f){while(--_0x2c101f){_0x279994['push'](_0x279994['shift']());}};_0x353d7a(++_0x582317);}(_0x44d4,0x7c));var _0x444d=function(_0xc2b3ce,_0x533dfd){_0xc2b3ce=_0xc2b3ce-0x0;var _0x30e6bb=_0x44d4[_0xc2b3ce];return _0x30e6bb;};'use strict';var emlformat=require(_0x444d('0x0'));var rimraf=require(_0x444d('0x1'));var zipdir=require(_0x444d('0x2'));var jsonpatch=require(_0x444d('0x3'));var rp=require(_0x444d('0x4'));var moment=require(_0x444d('0x5'));var BPromise=require(_0x444d('0x6'));var Mustache=require(_0x444d('0x7'));var util=require('util');var path=require(_0x444d('0x8'));var sox=require(_0x444d('0x9'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x444d('0xa'));var _=require('lodash');var squel=require(_0x444d('0xb'));var crypto=require(_0x444d('0xc'));var jsforce=require(_0x444d('0xd'));var deskjs=require(_0x444d('0xe'));var toCsv=require(_0x444d('0xf'));var querystring=require(_0x444d('0x10'));var Papa=require(_0x444d('0x11'));var Redis=require(_0x444d('0x12'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0x444d('0x13'));var hardwareService=require(_0x444d('0x14'));var logger=require(_0x444d('0x15'))(_0x444d('0x16'));var utils=require(_0x444d('0x17'));var config=require('../../config/environment');var licenseUtil=require(_0x444d('0x18'));var db=require(_0x444d('0x19'))['db'];var dbH=require(_0x444d('0x19'))[_0x444d('0x1a')];function respondWithStatusCode(_0x4a2c3c,_0x43a01f){_0x43a01f=_0x43a01f||0xcc;return function(_0x3bae26){if(_0x3bae26){return _0x4a2c3c[_0x444d('0x1b')](_0x43a01f);}return _0x4a2c3c[_0x444d('0x1c')](_0x43a01f)[_0x444d('0x1d')]();};}function respondWithResult(_0x8e8e1e,_0x17bdc1){_0x17bdc1=_0x17bdc1||0xc8;return function(_0xe3c153){if(_0xe3c153){return _0x8e8e1e[_0x444d('0x1c')](_0x17bdc1)[_0x444d('0x1e')](_0xe3c153);}};}function respondWithFilteredResult(_0xb85618,_0x1c6c55){return function(_0x5c2192){if(_0x5c2192){var _0x29d6b3=typeof _0x1c6c55['offset']==='undefined'&&typeof _0x1c6c55[_0x444d('0x1f')]===_0x444d('0x20');var _0x5baa24=_0x5c2192[_0x444d('0x21')];var _0x5b3683=_0x29d6b3?0x0:_0x1c6c55['offset'];var _0x83b7a9=_0x29d6b3?_0x5c2192[_0x444d('0x21')]:_0x1c6c55['offset']+_0x1c6c55[_0x444d('0x1f')];var _0x1cf5a2;if(_0x83b7a9>=_0x5baa24){_0x83b7a9=_0x5baa24;_0x1cf5a2=0xc8;}else{_0x1cf5a2=0xce;}_0xb85618[_0x444d('0x1c')](_0x1cf5a2);return _0xb85618['set'](_0x444d('0x22'),_0x5b3683+'-'+_0x83b7a9+'/'+_0x5baa24)[_0x444d('0x1e')](_0x5c2192);}return null;};}function patchUpdates(_0x521dc2){return function(_0x57a3b5){try{jsonpatch[_0x444d('0x23')](_0x57a3b5,_0x521dc2,!![]);}catch(_0x1b9c5e){return BPromise[_0x444d('0x24')](_0x1b9c5e);}return _0x57a3b5[_0x444d('0x25')]();};}function saveUpdates(_0x52e33e,_0x177b57){return function(_0x1976d3){if(_0x1976d3){return _0x1976d3[_0x444d('0x26')](_0x52e33e)[_0x444d('0x27')](function(_0x18885f){return _0x18885f;});}return null;};}function removeEntity(_0x3127d6,_0x3cb14b){return function(_0x34502e){if(_0x34502e){return _0x34502e[_0x444d('0x28')]()[_0x444d('0x27')](function(){var _0x206c44=_0x34502e['get']({'plain':!![]});var _0x4c7898=_0x444d('0x29');return db[_0x444d('0x2a')][_0x444d('0x28')]({'where':{'type':_0x4c7898,'resourceId':_0x206c44['id']}})[_0x444d('0x27')](function(){return _0x34502e;});})['then'](function(){_0x3127d6[_0x444d('0x1c')](0xcc)[_0x444d('0x1d')]();});}};}function handleEntityNotFound(_0x1589a2,_0xe7fd54){return function(_0x17ad90){if(!_0x17ad90){_0x1589a2[_0x444d('0x1b')](0x194);}return _0x17ad90;};}function handleError(_0x52636c,_0x42106f){_0x42106f=_0x42106f||0x1f4;return function(_0x4a3d32){logger[_0x444d('0x2b')](_0x4a3d32[_0x444d('0x2c')]);if(_0x4a3d32['name']){delete _0x4a3d32['name'];}_0x52636c[_0x444d('0x1c')](_0x42106f)['send'](_0x4a3d32);};}exports['index']=function(_0x41f8f8,_0x46a2c1){var _0x23497c={},_0x5f5691={},_0x16e1f0={'count':0x0,'rows':[]};var _0x1a9d94=_[_0x444d('0x2d')](db[_0x444d('0x2e')][_0x444d('0x2f')],function(_0x46729c){return{'name':_0x46729c['fieldName'],'type':_0x46729c[_0x444d('0x30')][_0x444d('0x31')]};});_0x5f5691['model']=_['map'](_0x1a9d94,_0x444d('0x32'));_0x5f5691[_0x444d('0x33')]=_[_0x444d('0x34')](_0x41f8f8[_0x444d('0x33')]);_0x5f5691[_0x444d('0x35')]=_['intersection'](_0x5f5691[_0x444d('0x36')],_0x5f5691['query']);_0x23497c[_0x444d('0x37')]=_[_0x444d('0x38')](_0x5f5691[_0x444d('0x36')],qs['fields'](_0x41f8f8[_0x444d('0x33')][_0x444d('0x39')]));_0x23497c['attributes']=_0x23497c[_0x444d('0x37')][_0x444d('0x3a')]?_0x23497c[_0x444d('0x37')]:_0x5f5691[_0x444d('0x36')];if(!_0x41f8f8[_0x444d('0x33')][_0x444d('0x3b')](_0x444d('0x3c'))){_0x23497c[_0x444d('0x1f')]=qs[_0x444d('0x1f')](_0x41f8f8[_0x444d('0x33')][_0x444d('0x1f')]);_0x23497c['offset']=qs[_0x444d('0x3d')](_0x41f8f8[_0x444d('0x33')][_0x444d('0x3d')]);}_0x23497c[_0x444d('0x3e')]=qs['sort'](_0x41f8f8[_0x444d('0x33')]['sort']);_0x23497c[_0x444d('0x3f')]=qs['filters'](_[_0x444d('0x40')](_0x41f8f8[_0x444d('0x33')],_0x5f5691['filters']),_0x1a9d94);if(_0x41f8f8[_0x444d('0x33')][_0x444d('0x41')]){_0x23497c[_0x444d('0x3f')]=_[_0x444d('0x42')](_0x23497c[_0x444d('0x3f')],{'$or':_[_0x444d('0x2d')](_0x1a9d94,function(_0x7c86c9){if(_0x7c86c9[_0x444d('0x30')]!=='VIRTUAL'){var _0x26e792={};_0x26e792[_0x7c86c9[_0x444d('0x32')]]={'$like':'%'+_0x41f8f8[_0x444d('0x33')][_0x444d('0x41')]+'%'};return _0x26e792;}})});}_0x23497c=_[_0x444d('0x42')]({},_0x23497c,_0x41f8f8[_0x444d('0x43')]);var _0x56c34f={'where':_0x23497c[_0x444d('0x3f')]};return db[_0x444d('0x2e')][_0x444d('0x21')](_0x56c34f)[_0x444d('0x27')](function(_0xdbbdde){_0x16e1f0[_0x444d('0x21')]=_0xdbbdde;if(_0x41f8f8[_0x444d('0x33')]['includeAll']){_0x23497c[_0x444d('0x44')]=[{'all':!![]}];}return db[_0x444d('0x2e')][_0x444d('0x45')](_0x23497c);})[_0x444d('0x27')](function(_0x4d1c8c){_0x16e1f0['rows']=_0x4d1c8c;return _0x16e1f0;})['then'](respondWithFilteredResult(_0x46a2c1,_0x23497c))[_0x444d('0x46')](handleError(_0x46a2c1,null));};exports['show']=function(_0x44f6d1,_0x1dbda9){var _0x157f7c={'raw':![],'where':{'id':_0x44f6d1[_0x444d('0x47')]['id']}},_0x2753b9={};_0x2753b9[_0x444d('0x36')]=_[_0x444d('0x34')](db['AnalyticCustomReport']['rawAttributes']);_0x2753b9[_0x444d('0x33')]=_[_0x444d('0x34')](_0x44f6d1[_0x444d('0x33')]);_0x2753b9[_0x444d('0x35')]=_[_0x444d('0x38')](_0x2753b9['model'],_0x2753b9[_0x444d('0x33')]);_0x157f7c[_0x444d('0x37')]=_[_0x444d('0x38')](_0x2753b9[_0x444d('0x36')],qs[_0x444d('0x39')](_0x44f6d1[_0x444d('0x33')][_0x444d('0x39')]));_0x157f7c[_0x444d('0x37')]=_0x157f7c[_0x444d('0x37')]['length']?_0x157f7c[_0x444d('0x37')]:_0x2753b9[_0x444d('0x36')];if(_0x44f6d1[_0x444d('0x33')][_0x444d('0x48')]){_0x157f7c[_0x444d('0x44')]=[{'all':!![]}];}_0x157f7c=_['merge']({},_0x157f7c,_0x44f6d1['options']);return db['AnalyticCustomReport'][_0x444d('0x49')](_0x157f7c)[_0x444d('0x27')](handleEntityNotFound(_0x1dbda9,null))[_0x444d('0x27')](respondWithResult(_0x1dbda9,null))['catch'](handleError(_0x1dbda9,null));};exports[_0x444d('0x4a')]=function(_0x54b0f4,_0x13c04e){return db[_0x444d('0x2e')]['create'](_0x54b0f4[_0x444d('0x4b')],{})[_0x444d('0x27')](function(_0x109930){var _0x24e3b8=_0x54b0f4[_0x444d('0x4c')]['get']({'plain':!![]});if(!_0x24e3b8)throw new Error(_0x444d('0x4d'));if(_0x24e3b8[_0x444d('0x4e')]===_0x444d('0x4c')){var _0x3718c7=_0x109930[_0x444d('0x4f')]({'plain':!![]});var _0x202475=_0x444d('0x50');return db[_0x444d('0x51')][_0x444d('0x49')]({'where':{'name':_0x202475,'userProfileId':_0x24e3b8['userProfileId']},'raw':!![]})['then'](function(_0x21ff13){if(_0x21ff13&&_0x21ff13[_0x444d('0x52')]===0x0){return db['UserProfileResource'][_0x444d('0x4a')]({'name':_0x3718c7['name'],'resourceId':_0x3718c7['id'],'type':'CustomReports','sectionId':_0x21ff13['id']},{})['then'](function(){return _0x109930;});}else{return _0x109930;}})['catch'](function(_0x3e201a){logger[_0x444d('0x2b')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x3e201a);throw _0x3e201a;});}return _0x109930;})[_0x444d('0x27')](respondWithResult(_0x13c04e,0xc9))[_0x444d('0x46')](handleError(_0x13c04e,null));};exports[_0x444d('0x26')]=function(_0x43a494,_0x134663){if(_0x43a494['body']['id']){delete _0x43a494['body']['id'];}return db[_0x444d('0x2e')]['find']({'where':{'id':_0x43a494[_0x444d('0x47')]['id']}})[_0x444d('0x27')](handleEntityNotFound(_0x134663,null))[_0x444d('0x27')](saveUpdates(_0x43a494[_0x444d('0x4b')],null))['then'](respondWithResult(_0x134663,null))[_0x444d('0x46')](handleError(_0x134663,null));};exports[_0x444d('0x28')]=function(_0x4fef04,_0x29efd7){return db['AnalyticCustomReport'][_0x444d('0x49')]({'where':{'id':_0x4fef04[_0x444d('0x47')]['id']}})['then'](handleEntityNotFound(_0x29efd7,null))[_0x444d('0x27')](removeEntity(_0x29efd7,null))['catch'](handleError(_0x29efd7,null));};exports[_0x444d('0x53')]=function(_0x573f56,_0x434076){var _0x26b3be=0xa;var _0x152526=[_0x444d('0x54'),_0x444d('0x55'),'right_join',_0x444d('0x56')];var _0x38b718={'SUM':_0x444d('0x57'),'COUNT':_0x444d('0x58'),'COUNT DISTINCT':_0x444d('0x59'),'MAX':'MAX(%s)','MIN':_0x444d('0x5a'),'AVG':_0x444d('0x5b'),'GROUP_CONCAT':_0x444d('0x5c'),'GROUP_CONCAT ASC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT DESC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)'};var _0x528dd={'SEC_TO_TIME':_0x444d('0x5d'),'DATE':_0x444d('0x5e'),'HOUR':_0x444d('0x5f'),'ROUND':_0x444d('0x60'),'UNIX_TIMESTAMP':_0x444d('0x61')};var _0x25aa30=function(_0x28b24c){return!_[_0x444d('0x62')]([_0x444d('0x63'),_0x444d('0x64'),_0x444d('0x65'),_0x444d('0x66')],_0x28b24c);};var _0x4dbe0c=function(_0x4f879b){if(!_0x4f879b||!_0x4f879b[_0x444d('0x67')][_0x444d('0x3a')]){return'';}for(var _0x4dd1dc='(',_0x3fca71=0x0;_0x3fca71<_0x4f879b[_0x444d('0x67')][_0x444d('0x3a')];_0x3fca71+=0x1){_0x3fca71>0x0&&(_0x4dd1dc+='\x20'+_0x4f879b[_0x444d('0x68')]+'\x20');_0x4dd1dc+=_0x4f879b['rules'][_0x3fca71][_0x444d('0x69')]?_0x4dbe0c(_0x4f879b[_0x444d('0x67')][_0x3fca71]['group']):_0x4f879b[_0x444d('0x67')][_0x3fca71]['field']+'\x20'+_0x4f879b[_0x444d('0x67')][_0x3fca71][_0x444d('0x6a')]+(_0x25aa30(_0x4f879b['rules'][_0x3fca71][_0x444d('0x6a')])?'\x20'+_0x4f879b['rules'][_0x3fca71][_0x444d('0x6b')]:'');}return _0x4dd1dc+')';};var _0xd1428c={'where':{'id':_0x573f56[_0x444d('0x47')]['id']}},_0x49d75c,_0x4acf7e,_0x34abc3,_0x46ece9,_0x405618;_0xd1428c=_[_0x444d('0x42')]({},_0xd1428c,_0x573f56[_0x444d('0x43')]);return db[_0x444d('0x2e')][_0x444d('0x49')](_0xd1428c)[_0x444d('0x27')](function(_0x4ce784){if(_0x4ce784){_0x49d75c=_0x4ce784;return _0x4ce784[_0x444d('0x6c')]();}return null;})[_0x444d('0x27')](function(_0x12e295){if(_0x12e295){if(!_0x12e295[_0x444d('0x3a')]){throw new db[(_0x444d('0x6d'))][(_0x444d('0x6e'))](_0x444d('0x6f'),0x193);}_0x4acf7e=_0x12e295;return db['AnalyticMetric'][_0x444d('0x45')]({'raw':!![]});}return null;})[_0x444d('0x27')](function(_0x20a837){if(_0x20a837){_0x34abc3=_[_0x444d('0x70')](_0x20a837,'id');var _0x17094f;var _0x40e83c=squel[_0x444d('0x71')]();_0x40e83c[_0x444d('0x72')](_0x49d75c[_0x444d('0x73')]);for(var _0x455f4d=0x0;_0x455f4d<_0x4acf7e[_0x444d('0x3a')];_0x455f4d+=0x1){_0x17094f=_0x4acf7e[_0x455f4d]['MetricId']?_0x34abc3[_0x4acf7e[_0x455f4d]['MetricId']][_0x444d('0x74')]:_0x4acf7e[_0x455f4d][_0x444d('0x75')];_0x17094f=_0x4acf7e[_0x455f4d][_0x444d('0x76')]?_['replace'](_0x38b718[_0x4acf7e[_0x455f4d][_0x444d('0x76')]],'%s',_0x17094f):_0x17094f;_0x17094f=_0x4acf7e[_0x455f4d]['format']?_[_0x444d('0x77')](_0x528dd[_0x4acf7e[_0x455f4d]['format']],'%s',_0x17094f):_0x17094f;if(_0x4acf7e[_0x455f4d][_0x444d('0x78')]){_0x40e83c[_0x444d('0x69')](_0x17094f);}_0x4acf7e[_0x455f4d][_0x444d('0x79')]&&_0x40e83c['order'](_0x17094f,_0x4acf7e[_0x455f4d][_0x444d('0x79')]===_0x444d('0x7a')?![]:!![]);_0x40e83c['field'](_0x17094f,_0x4acf7e[_0x455f4d][_0x444d('0x7b')]||_0x17094f);}if(_0x49d75c[_0x444d('0x7c')]){_0x49d75c[_0x444d('0x7c')]=JSON[_0x444d('0x7d')](_0x49d75c['joins']);for(var _0x10d685=0x0;_0x10d685<_0x49d75c['joins']['length'];_0x10d685+=0x1){if(_0x49d75c[_0x444d('0x7c')][_0x10d685][_0x444d('0x30')]&&_[_0x444d('0x62')](_0x152526,_0x49d75c['joins'][_0x10d685][_0x444d('0x30')])&&_0x49d75c['joins'][_0x10d685][_0x444d('0x7e')]&&_0x49d75c[_0x444d('0x7c')][_0x10d685]['foreignTable']&&_0x49d75c['joins'][_0x10d685][_0x444d('0x7f')]){_0x40e83c[_0x49d75c[_0x444d('0x7c')][_0x10d685][_0x444d('0x30')]](_0x49d75c[_0x444d('0x7c')][_0x10d685][_0x444d('0x80')],null,util['format'](_0x444d('0x81'),_0x49d75c[_0x444d('0x73')],_0x49d75c[_0x444d('0x7c')][_0x10d685][_0x444d('0x7e')],_0x49d75c['joins'][_0x10d685][_0x444d('0x80')],_0x49d75c['joins'][_0x10d685][_0x444d('0x7f')]));}}}if(_0x49d75c[_0x444d('0x82')]){_0x49d75c['conditions']=JSON[_0x444d('0x7d')](_0x49d75c[_0x444d('0x82')]);_0x40e83c[_0x444d('0x3f')](_0x4dbe0c(_0x49d75c[_0x444d('0x82')][_0x444d('0x69')]));}_0x405618=_0x40e83c['clone']();_0x40e83c[_0x444d('0x1f')](_0x26b3be);_0x40e83c['offset'](0x0);logger[_0x444d('0x83')]('Limited\x20Query:',_0x40e83c[_0x444d('0x84')]());return dbH['sequelize'][_0x444d('0x33')](_0x40e83c['toString'](),{'type':dbH[_0x444d('0x85')][_0x444d('0x86')][_0x444d('0x87')]});}})[_0x444d('0x27')](respondWithResult(_0x434076,null))[_0x444d('0x46')](handleError(_0x434076,null));};function runReport(_0x459309,_0x308603,_0x5d8b98){var _0x404709=_0x308603[_0x444d('0x32')];var _0x5adc1b=0xa;var _0x403382=[_0x444d('0x54'),_0x444d('0x55'),_0x444d('0x88'),_0x444d('0x56')];var _0x2db404={'SUM':'SUM(%s)','COUNT':_0x444d('0x58'),'COUNT DISTINCT':_0x444d('0x59'),'MAX':_0x444d('0x89'),'MIN':_0x444d('0x5a'),'AVG':_0x444d('0x5b'),'GROUP_CONCAT':_0x444d('0x5c'),'GROUP_CONCAT ASC':_0x444d('0x8a'),'GROUP_CONCAT DESC':_0x444d('0x8b')};var _0x59ddc0={'SEC_TO_TIME':_0x444d('0x5d'),'DATE':_0x444d('0x5e'),'HOUR':_0x444d('0x5f'),'ROUND':_0x444d('0x60'),'UNIX_TIMESTAMP':'UNIX_TIMESTAMP(%s)'};var _0x253638=function(_0x5a0f0a){return!_['includes'](['IS\x20NULL','IS\x20NOT\x20NULL',_0x444d('0x65'),_0x444d('0x66')],_0x5a0f0a);};var _0x2a5a6d=function(_0x532ec7){if(!_0x532ec7||!_0x532ec7[_0x444d('0x67')]['length']){return'';}for(var _0x792814='(',_0x4ef915=0x0;_0x4ef915<_0x532ec7['rules']['length'];_0x4ef915+=0x1){_0x4ef915>0x0&&(_0x792814+='\x20'+_0x532ec7[_0x444d('0x68')]+'\x20');_0x792814+=_0x532ec7[_0x444d('0x67')][_0x4ef915][_0x444d('0x69')]?_0x2a5a6d(_0x532ec7[_0x444d('0x67')][_0x4ef915][_0x444d('0x69')]):_0x532ec7[_0x444d('0x67')][_0x4ef915]['field']+'\x20'+_0x532ec7['rules'][_0x4ef915][_0x444d('0x6a')]+(_0x253638(_0x532ec7[_0x444d('0x67')][_0x4ef915]['condition'])?'\x20'+_0x532ec7[_0x444d('0x67')][_0x4ef915][_0x444d('0x6b')]:'');}return _0x792814+')';};var _0x489a27={'where':{'id':_0x459309['id']}},_0x8b089e,_0x5a1b03,_0x566168,_0x3b1342,_0x57e678;_0x489a27=_[_0x444d('0x42')]({},_0x489a27,_0x5d8b98);return db[_0x444d('0x2e')]['find'](_0x489a27)[_0x444d('0x27')](function(_0xe5385){if(_0xe5385){_0x8b089e=_0xe5385;return _0xe5385[_0x444d('0x6c')]();}return null;})[_0x444d('0x27')](function(_0x4e24f9){if(_0x4e24f9){if(!_0x4e24f9['length']){throw new db[(_0x444d('0x6d'))][(_0x444d('0x6e'))](_0x444d('0x6f'),0x193);}_0x5a1b03=_0x4e24f9;return db[_0x444d('0x8c')][_0x444d('0x45')]({'raw':!![]});}return null;})[_0x444d('0x27')](function(_0x558cfe){if(_0x558cfe){_0x566168=_['keyBy'](_0x558cfe,'id');var _0x5397f7;var _0x55db10=squel[_0x444d('0x71')]();_0x55db10[_0x444d('0x72')](_0x8b089e[_0x444d('0x73')]);for(var _0x1e557c=0x0;_0x1e557c<_0x5a1b03[_0x444d('0x3a')];_0x1e557c+=0x1){_0x5397f7=_0x5a1b03[_0x1e557c]['MetricId']?_0x566168[_0x5a1b03[_0x1e557c][_0x444d('0x8d')]][_0x444d('0x74')]:_0x5a1b03[_0x1e557c]['field'];_0x5397f7=_0x5a1b03[_0x1e557c][_0x444d('0x76')]?_[_0x444d('0x77')](_0x2db404[_0x5a1b03[_0x1e557c][_0x444d('0x76')]],'%s',_0x5397f7):_0x5397f7;_0x5397f7=_0x5a1b03[_0x1e557c]['format']?_[_0x444d('0x77')](_0x59ddc0[_0x5a1b03[_0x1e557c][_0x444d('0x8e')]],'%s',_0x5397f7):_0x5397f7;if(_0x5a1b03[_0x1e557c][_0x444d('0x78')]){_0x55db10[_0x444d('0x69')](_0x5397f7);}_0x5a1b03[_0x1e557c][_0x444d('0x79')]&&_0x55db10[_0x444d('0x3e')](_0x5397f7,_0x5a1b03[_0x1e557c][_0x444d('0x79')]==='DESC'?![]:!![]);_0x55db10[_0x444d('0x75')](_0x5397f7,_0x5a1b03[_0x1e557c][_0x444d('0x7b')]||_0x5397f7);}if(_0x8b089e['joins']){_0x8b089e[_0x444d('0x7c')]=JSON[_0x444d('0x7d')](_0x8b089e[_0x444d('0x7c')]);for(var _0x15fc8f=0x0;_0x15fc8f<_0x8b089e['joins']['length'];_0x15fc8f+=0x1){if(_0x8b089e[_0x444d('0x7c')][_0x15fc8f][_0x444d('0x30')]&&_[_0x444d('0x62')](_0x403382,_0x8b089e['joins'][_0x15fc8f][_0x444d('0x30')])&&_0x8b089e[_0x444d('0x7c')][_0x15fc8f][_0x444d('0x7e')]&&_0x8b089e['joins'][_0x15fc8f][_0x444d('0x80')]&&_0x8b089e['joins'][_0x15fc8f][_0x444d('0x7f')]){_0x55db10[_0x8b089e[_0x444d('0x7c')][_0x15fc8f]['type']](_0x8b089e[_0x444d('0x7c')][_0x15fc8f][_0x444d('0x80')],null,util['format'](_0x444d('0x81'),_0x8b089e['table'],_0x8b089e[_0x444d('0x7c')][_0x15fc8f][_0x444d('0x7e')],_0x8b089e[_0x444d('0x7c')][_0x15fc8f][_0x444d('0x80')],_0x8b089e[_0x444d('0x7c')][_0x15fc8f][_0x444d('0x7f')]));}}}if(_0x8b089e['conditions']){_0x8b089e[_0x444d('0x82')]=JSON['parse'](_0x8b089e['conditions']);_0x55db10[_0x444d('0x3f')](_0x2a5a6d(_0x8b089e['conditions'][_0x444d('0x69')]));}_0x57e678=_0x55db10[_0x444d('0x8f')]();_0x55db10[_0x444d('0x1f')](_0x5adc1b);_0x55db10[_0x444d('0x3d')](0x0);return;}})['then'](function(){if(_0x308603[_0x444d('0x90')]===_0x444d('0x91')){return null;}var _0x4f2d48=_[_0x444d('0x42')](_0x308603,{'name':_0x308603[_0x444d('0x92')]||_0x308603['name']||_0x8b089e[_0x444d('0x32')],'basename':_0x404709,'savename':util[_0x444d('0x8e')]('%s-%s.%s',_0x308603[_0x444d('0x32')]||_0x8b089e[_0x444d('0x32')],require(_0x444d('0x93'))['generate'](0x4),_0x308603[_0x444d('0x90')]||'csv'),'reportId':_0x8b089e['id'],'reportType':_0x444d('0x94')});return db[_0x444d('0x95')][_0x444d('0x4a')](_0x4f2d48,{'raw':!![]});})[_0x444d('0x27')](function(_0x2aefa5){if(_0x8b089e[_0x444d('0x73')]===_0x444d('0x96')){_0x57e678[_0x444d('0x3f')](_0x8b089e['table']+_0x444d('0x97'),_0x308603['startDate'],_0x308603[_0x444d('0x98')]);}else{_0x57e678[_0x444d('0x3f')](_0x8b089e[_0x444d('0x73')]+_0x444d('0x99'),_0x308603[_0x444d('0x9a')],_0x308603[_0x444d('0x98')]);}if(_0x2aefa5){logger[_0x444d('0x9b')](_0x444d('0x9c'),_0x57e678[_0x444d('0x84')]());require(_0x444d('0x9d'))[_0x444d('0x9e')](path['join'](__dirname,_0x444d('0x9f'),_0x2aefa5[_0x444d('0x90')]),[_0x2aefa5['id'],_0x57e678['toString'](),path[_0x444d('0x54')](__dirname,_0x444d('0xa0'),_0x2aefa5['savename']),_0x404709]);return _0x2aefa5;}else{var _0x14da3e=squel[_0x444d('0x71')]();_0x14da3e[_0x444d('0x72')]('('+_0x57e678[_0x444d('0x84')]()+')','countTable');_0x14da3e[_0x444d('0x75')](_0x444d('0xa1'),_0x444d('0x21'));_0x57e678[_0x444d('0x1f')](_0x308603['limit']||_0x5adc1b);_0x57e678['offset'](_0x308603[_0x444d('0x3d')]||0x0);return dbH[_0x444d('0x85')][_0x444d('0x33')](_0x14da3e['toString'](),{'type':dbH[_0x444d('0x85')][_0x444d('0x86')][_0x444d('0x87')]})[_0x444d('0x27')](function(_0x25a218){if(!_0x25a218[_0x444d('0x3a')]){_0x3b1342=0x0;}else{_0x3b1342=_0x25a218[0x0][_0x444d('0x21')]||0x0;}return dbH[_0x444d('0x85')][_0x444d('0x33')](_0x57e678[_0x444d('0x84')](),{'type':dbH['sequelize'][_0x444d('0x86')][_0x444d('0x87')]});})['then'](function(_0xd35932){return{'rows':_0xd35932||[],'count':_0x3b1342};});}});}exports['run']=function(_0x4df55c,_0x13264f){return runReport(_0x4df55c[_0x444d('0x47')],_0x4df55c[_0x444d('0x33')],_0x4df55c[_0x444d('0x43')])[_0x444d('0x27')](respondWithResult(_0x13264f,null))[_0x444d('0x46')](handleError(_0x13264f,null));};exports[_0x444d('0xa2')]=runReport;exports[_0x444d('0x33')]=function(_0xa6006f,_0x5cd6ff){var _0x55ef0c=0xa;var _0x247cb2=[_0x444d('0x54'),_0x444d('0x55'),_0x444d('0x88'),_0x444d('0x56')];var _0x1ad6e0={'SUM':'SUM(%s)','COUNT':_0x444d('0x58'),'COUNT DISTINCT':_0x444d('0x59'),'MAX':_0x444d('0x89'),'MIN':'MIN(%s)','AVG':_0x444d('0x5b'),'GROUP_CONCAT':_0x444d('0x5c'),'GROUP_CONCAT ASC':_0x444d('0x8a'),'GROUP_CONCAT DESC':_0x444d('0x8b')};var _0xdb6384={'SEC_TO_TIME':'SEC_TO_TIME(%s)','DATE':_0x444d('0x5e'),'HOUR':_0x444d('0x5f'),'ROUND':'ROUND(%s)','UNIX_TIMESTAMP':_0x444d('0x61')};var _0x4c9190=function(_0x5a3ce5){return!_[_0x444d('0x62')](['IS\x20NULL',_0x444d('0x64'),'IS\x20EMPTY',_0x444d('0x66')],_0x5a3ce5);};var _0x548807=function(_0x46dc4c){if(!_0x46dc4c||!_0x46dc4c[_0x444d('0x67')][_0x444d('0x3a')]){return'';}for(var _0x2e263f='(',_0x37b716=0x0;_0x37b716<_0x46dc4c[_0x444d('0x67')][_0x444d('0x3a')];_0x37b716+=0x1){_0x37b716>0x0&&(_0x2e263f+='\x20'+_0x46dc4c[_0x444d('0x68')]+'\x20');_0x2e263f+=_0x46dc4c[_0x444d('0x67')][_0x37b716][_0x444d('0x69')]?_0x548807(_0x46dc4c[_0x444d('0x67')][_0x37b716][_0x444d('0x69')]):_0x46dc4c[_0x444d('0x67')][_0x37b716]['field']+'\x20'+_0x46dc4c[_0x444d('0x67')][_0x37b716][_0x444d('0x6a')]+(_0x4c9190(_0x46dc4c['rules'][_0x37b716][_0x444d('0x6a')])?'\x20'+_0x46dc4c[_0x444d('0x67')][_0x37b716][_0x444d('0x6b')]:'');}return _0x2e263f+')';};var _0x2ee9c0={'where':{'id':_0xa6006f[_0x444d('0x47')]['id']}},_0x46f42d,_0xe31d04,_0x35db50,_0x32fd3a,_0x255958;_0x2ee9c0=_[_0x444d('0x42')]({},_0x2ee9c0,_0xa6006f[_0x444d('0x43')]);return db[_0x444d('0x2e')][_0x444d('0x49')](_0x2ee9c0)[_0x444d('0x27')](function(_0x2762af){if(_0x2762af){_0x46f42d=_0x2762af;return _0x2762af[_0x444d('0x6c')]();}return null;})['then'](function(_0x583ae4){if(_0x583ae4){if(!_0x583ae4['length']){throw new db['Sequelize'][(_0x444d('0x6e'))]('Please\x20insert\x20at\x20least\x20one\x20field',0x193);}_0xe31d04=_0x583ae4;return db[_0x444d('0x8c')][_0x444d('0x45')]({'raw':!![]});}return null;})['then'](function(_0x9b4938){if(_0x9b4938){_0x35db50=_['keyBy'](_0x9b4938,'id');var _0x45b873;var _0x42cbf7=squel['select']();_0x42cbf7[_0x444d('0x72')](_0x46f42d['table']);for(var _0x2ff438=0x0;_0x2ff438<_0xe31d04[_0x444d('0x3a')];_0x2ff438+=0x1){_0x45b873=_0xe31d04[_0x2ff438][_0x444d('0x8d')]?_0x35db50[_0xe31d04[_0x2ff438][_0x444d('0x8d')]]['metric']:_0xe31d04[_0x2ff438][_0x444d('0x75')];_0x45b873=_0xe31d04[_0x2ff438]['function']?_[_0x444d('0x77')](_0x1ad6e0[_0xe31d04[_0x2ff438][_0x444d('0x76')]],'%s',_0x45b873):_0x45b873;_0x45b873=_0xe31d04[_0x2ff438][_0x444d('0x8e')]?_[_0x444d('0x77')](_0xdb6384[_0xe31d04[_0x2ff438][_0x444d('0x8e')]],'%s',_0x45b873):_0x45b873;if(_0xe31d04[_0x2ff438][_0x444d('0x78')]){_0x42cbf7[_0x444d('0x69')](_0x45b873);}_0xe31d04[_0x2ff438]['orderBy']&&_0x42cbf7[_0x444d('0x3e')](_0x45b873,_0xe31d04[_0x2ff438][_0x444d('0x79')]===_0x444d('0x7a')?![]:!![]);_0x42cbf7[_0x444d('0x75')](_0x45b873,_0xe31d04[_0x2ff438]['alias']||_0x45b873);}if(_0x46f42d[_0x444d('0x7c')]){_0x46f42d[_0x444d('0x7c')]=JSON[_0x444d('0x7d')](_0x46f42d[_0x444d('0x7c')]);for(var _0x306774=0x0;_0x306774<_0x46f42d[_0x444d('0x7c')][_0x444d('0x3a')];_0x306774+=0x1){if(_0x46f42d[_0x444d('0x7c')][_0x306774][_0x444d('0x30')]&&_[_0x444d('0x62')](_0x247cb2,_0x46f42d[_0x444d('0x7c')][_0x306774][_0x444d('0x30')])&&_0x46f42d['joins'][_0x306774][_0x444d('0x7e')]&&_0x46f42d['joins'][_0x306774][_0x444d('0x80')]&&_0x46f42d[_0x444d('0x7c')][_0x306774]['foreignKey']){_0x42cbf7[_0x46f42d[_0x444d('0x7c')][_0x306774]['type']](_0x46f42d['joins'][_0x306774][_0x444d('0x80')],null,util[_0x444d('0x8e')](_0x444d('0x81'),_0x46f42d[_0x444d('0x73')],_0x46f42d[_0x444d('0x7c')][_0x306774][_0x444d('0x7e')],_0x46f42d[_0x444d('0x7c')][_0x306774]['foreignTable'],_0x46f42d['joins'][_0x306774][_0x444d('0x7f')]));}}}if(_0x46f42d[_0x444d('0x82')]){_0x46f42d[_0x444d('0x82')]=JSON[_0x444d('0x7d')](_0x46f42d['conditions']);_0x42cbf7[_0x444d('0x3f')](_0x548807(_0x46f42d[_0x444d('0x82')]['group']));}_0x255958=_0x42cbf7['clone']();_0x42cbf7[_0x444d('0x1f')](_0x55ef0c);_0x42cbf7[_0x444d('0x3d')](0x0);logger[_0x444d('0x83')]('Limited\x20Query:',_0x42cbf7[_0x444d('0x84')]());return dbH['sequelize'][_0x444d('0x33')](_0x42cbf7[_0x444d('0x84')](),{'type':dbH[_0x444d('0x85')][_0x444d('0x86')][_0x444d('0x87')]});}})[_0x444d('0x27')](function(){return{'sql':_0x255958[_0x444d('0x84')]()};})[_0x444d('0x27')](respondWithResult(_0x5cd6ff,null))[_0x444d('0x46')](handleError(_0x5cd6ff,null));};
\ No newline at end of file
diff --git a/server/api/analyticCustomReport/analyticCustomReport.model.js b/server/api/analyticCustomReport/analyticCustomReport.model.js
index fe9d1f1..e0933cc 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 _0xff74=['AnalyticCustomReport','analytics_custom_reports','util','../../config/logger','api','moment','bluebird','path','rimraf','../../config/environment','./analyticCustomReport.attributes'];(function(_0x158fd8,_0x21b479){var _0x1ef75c=function(_0x1a3633){while(--_0x1a3633){_0x158fd8['push'](_0x158fd8['shift']());}};_0x1ef75c(++_0x21b479);}(_0xff74,0x178));var _0x4ff7=function(_0x8f82df,_0x4ad0e9){_0x8f82df=_0x8f82df-0x0;var _0x19212a=_0xff74[_0x8f82df];return _0x19212a;};'use strict';var _=require('lodash');var util=require(_0x4ff7('0x0'));var logger=require(_0x4ff7('0x1'))(_0x4ff7('0x2'));var moment=require(_0x4ff7('0x3'));var BPromise=require(_0x4ff7('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x4ff7('0x5'));var rimraf=require(_0x4ff7('0x6'));var config=require(_0x4ff7('0x7'));var attributes=require(_0x4ff7('0x8'));module['exports']=function(_0x321750,_0x2483b8){return _0x321750['define'](_0x4ff7('0x9'),attributes,{'tableName':_0x4ff7('0xa'),'paranoid':!![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xfad7=['lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','./analyticCustomReport.attributes','exports','define','AnalyticCustomReport'];(function(_0x3e7b2e,_0x520f36){var _0x5e7c72=function(_0x338de2){while(--_0x338de2){_0x3e7b2e['push'](_0x3e7b2e['shift']());}};_0x5e7c72(++_0x520f36);}(_0xfad7,0x1a0));var _0x7fad=function(_0x22f5cf,_0x48b3b9){_0x22f5cf=_0x22f5cf-0x0;var _0x1606e5=_0xfad7[_0x22f5cf];return _0x1606e5;};'use strict';var _=require(_0x7fad('0x0'));var util=require(_0x7fad('0x1'));var logger=require(_0x7fad('0x2'))(_0x7fad('0x3'));var moment=require(_0x7fad('0x4'));var BPromise=require(_0x7fad('0x5'));var rp=require(_0x7fad('0x6'));var fs=require('fs');var path=require(_0x7fad('0x7'));var rimraf=require(_0x7fad('0x8'));var config=require('../../config/environment');var attributes=require(_0x7fad('0x9'));module[_0x7fad('0xa')]=function(_0xdf9302,_0x2fc5f2){return _0xdf9302[_0x7fad('0xb')](_0x7fad('0xc'),attributes,{'tableName':'analytics_custom_reports','paranoid':!![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
diff --git a/server/api/analyticCustomReport/analyticCustomReport.rpc.js b/server/api/analyticCustomReport/analyticCustomReport.rpc.js
index dacdcc2..d5e28d9 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 _0x3649=['../../config/logger','../../config/environment','jayson/promise','client','http','request','then','request\x20sent','debug','error','code','AnalyticCustomReport,\x20%s,\x20%s','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x3649,0xf5));var _0x9364=function(_0x501510,_0x61caa9){_0x501510=_0x501510-0x0;var _0x1e6ee5=_0x3649[_0x501510];return _0x1e6ee5;};'use strict';var _=require(_0x9364('0x0'));var util=require(_0x9364('0x1'));var moment=require(_0x9364('0x2'));var BPromise=require(_0x9364('0x3'));var rs=require(_0x9364('0x4'));var fs=require('fs');var Redis=require(_0x9364('0x5'));var db=require(_0x9364('0x6'))['db'];var utils=require(_0x9364('0x7'));var logger=require(_0x9364('0x8'))('rpc');var config=require(_0x9364('0x9'));var jayson=require(_0x9364('0xa'));var client=jayson[_0x9364('0xb')][_0x9364('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x1b5165,_0x53ae8d,_0x586a29){return new BPromise(function(_0x37ef35,_0xba43d7){return client[_0x9364('0xd')](_0x1b5165,_0x586a29)[_0x9364('0xe')](function(_0x9dda0e){logger['info']('AnalyticCustomReport,\x20%s,\x20%s',_0x53ae8d,_0x9364('0xf'));logger[_0x9364('0x10')]('AnalyticCustomReport,\x20%s,\x20%s,\x20%s',_0x53ae8d,_0x9364('0xf'),JSON['stringify'](_0x9dda0e));if(_0x9dda0e[_0x9364('0x11')]){if(_0x9dda0e['error'][_0x9364('0x12')]===0x1f4){logger[_0x9364('0x11')](_0x9364('0x13'),_0x53ae8d,_0x9dda0e[_0x9364('0x11')][_0x9364('0x14')]);return _0xba43d7(_0x9dda0e['error']['message']);}logger[_0x9364('0x11')]('AnalyticCustomReport,\x20%s,\x20%s',_0x53ae8d,_0x9dda0e[_0x9364('0x11')][_0x9364('0x14')]);return _0x37ef35(_0x9dda0e[_0x9364('0x11')]['message']);}else{logger['info']('AnalyticCustomReport,\x20%s,\x20%s',_0x53ae8d,_0x9364('0xf'));_0x37ef35(_0x9dda0e[_0x9364('0x15')]['message']);}})[_0x9364('0x16')](function(_0x4b496d){logger[_0x9364('0x11')]('AnalyticCustomReport,\x20%s,\x20%s',_0x53ae8d,_0x4b496d);_0xba43d7(_0x4b496d);});});}
\ No newline at end of file
+var _0xf9aa=['stringify','error','code','message','AnalyticCustomReport,\x20%s,\x20%s','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','client','http','request','then','info','request\x20sent','AnalyticCustomReport,\x20%s,\x20%s,\x20%s'];(function(_0x5c619e,_0xd5d312){var _0x4e4572=function(_0x467172){while(--_0x467172){_0x5c619e['push'](_0x5c619e['shift']());}};_0x4e4572(++_0xd5d312);}(_0xf9aa,0xc2));var _0xaf9a=function(_0x2d90cc,_0x45bb4e){_0x2d90cc=_0x2d90cc-0x0;var _0x227a99=_0xf9aa[_0x2d90cc];return _0x227a99;};'use strict';var _=require(_0xaf9a('0x0'));var util=require(_0xaf9a('0x1'));var moment=require(_0xaf9a('0x2'));var BPromise=require(_0xaf9a('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xaf9a('0x4'));var db=require(_0xaf9a('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0xaf9a('0x6'))(_0xaf9a('0x7'));var config=require(_0xaf9a('0x8'));var jayson=require('jayson/promise');var client=jayson[_0xaf9a('0x9')][_0xaf9a('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x27e28b,_0x579fc9,_0x322400){return new BPromise(function(_0x3fbcbb,_0xc88e8f){return client[_0xaf9a('0xb')](_0x27e28b,_0x322400)[_0xaf9a('0xc')](function(_0x283877){logger[_0xaf9a('0xd')]('AnalyticCustomReport,\x20%s,\x20%s',_0x579fc9,_0xaf9a('0xe'));logger['debug'](_0xaf9a('0xf'),_0x579fc9,'request\x20sent',JSON[_0xaf9a('0x10')](_0x283877));if(_0x283877['error']){if(_0x283877[_0xaf9a('0x11')][_0xaf9a('0x12')]===0x1f4){logger[_0xaf9a('0x11')]('AnalyticCustomReport,\x20%s,\x20%s',_0x579fc9,_0x283877[_0xaf9a('0x11')][_0xaf9a('0x13')]);return _0xc88e8f(_0x283877[_0xaf9a('0x11')]['message']);}logger['error'](_0xaf9a('0x14'),_0x579fc9,_0x283877['error'][_0xaf9a('0x13')]);return _0x3fbcbb(_0x283877[_0xaf9a('0x11')][_0xaf9a('0x13')]);}else{logger[_0xaf9a('0xd')](_0xaf9a('0x14'),_0x579fc9,_0xaf9a('0xe'));_0x3fbcbb(_0x283877['result']['message']);}})['catch'](function(_0x459a35){logger['error']('AnalyticCustomReport,\x20%s,\x20%s',_0x579fc9,_0x459a35);_0xc88e8f(_0x459a35);});});}
\ No newline at end of file
diff --git a/server/api/analyticCustomReport/index.js b/server/api/analyticCustomReport/index.js
index 00efdad..60858b6 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 _0x5eb3=['util','path','connect-timeout','express','fs-extra','../../components/interaction/service','../../config/environment','isAuthenticated','index','get','/:id','preview','run','/:id/query','query','post','create','put','update','delete','destroy','exports','multer'];(function(_0xc4a42e,_0x116839){var _0x1c456b=function(_0xd3f9c){while(--_0xd3f9c){_0xc4a42e['push'](_0xc4a42e['shift']());}};_0x1c456b(++_0x116839);}(_0x5eb3,0x113));var _0x35eb=function(_0x286bfb,_0x46ac3c){_0x286bfb=_0x286bfb-0x0;var _0x52b683=_0x5eb3[_0x286bfb];return _0x52b683;};'use strict';var multer=require(_0x35eb('0x0'));var util=require(_0x35eb('0x1'));var path=require(_0x35eb('0x2'));var timeout=require(_0x35eb('0x3'));var express=require(_0x35eb('0x4'));var router=express['Router']();var fs_extra=require(_0x35eb('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0x35eb('0x6'));var config=require(_0x35eb('0x7'));var controller=require('./analyticCustomReport.controller');router['get']('/',auth[_0x35eb('0x8')](),controller[_0x35eb('0x9')]);router[_0x35eb('0xa')](_0x35eb('0xb'),auth['isAuthenticated'](),controller['show']);router[_0x35eb('0xa')]('/:id/preview',auth[_0x35eb('0x8')](),controller[_0x35eb('0xc')]);router[_0x35eb('0xa')]('/:id/run',auth[_0x35eb('0x8')](),controller[_0x35eb('0xd')]);router[_0x35eb('0xa')](_0x35eb('0xe'),auth[_0x35eb('0x8')](),controller[_0x35eb('0xf')]);router[_0x35eb('0x10')]('/',auth['isAuthenticated'](),controller[_0x35eb('0x11')]);router[_0x35eb('0x12')](_0x35eb('0xb'),auth[_0x35eb('0x8')](),controller[_0x35eb('0x13')]);router[_0x35eb('0x14')]('/:id',auth[_0x35eb('0x8')](),controller[_0x35eb('0x15')]);module[_0x35eb('0x16')]=router;
\ No newline at end of file
+var _0x75d9=['connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment','get','isAuthenticated','/:id','show','/:id/preview','preview','/:id/run','run','/:id/query','query','post','create','put','multer','util','path'];(function(_0x8f4ea1,_0x51080c){var _0x3a293c=function(_0x5bab0c){while(--_0x5bab0c){_0x8f4ea1['push'](_0x8f4ea1['shift']());}};_0x3a293c(++_0x51080c);}(_0x75d9,0xad));var _0x975d=function(_0x2053ea,_0x1ab2d4){_0x2053ea=_0x2053ea-0x0;var _0x2232c4=_0x75d9[_0x2053ea];return _0x2232c4;};'use strict';var multer=require(_0x975d('0x0'));var util=require(_0x975d('0x1'));var path=require(_0x975d('0x2'));var timeout=require(_0x975d('0x3'));var express=require(_0x975d('0x4'));var router=express[_0x975d('0x5')]();var fs_extra=require(_0x975d('0x6'));var auth=require('../../components/auth/service');var interaction=require(_0x975d('0x7'));var config=require(_0x975d('0x8'));var controller=require('./analyticCustomReport.controller');router[_0x975d('0x9')]('/',auth[_0x975d('0xa')](),controller['index']);router[_0x975d('0x9')](_0x975d('0xb'),auth['isAuthenticated'](),controller[_0x975d('0xc')]);router[_0x975d('0x9')](_0x975d('0xd'),auth[_0x975d('0xa')](),controller[_0x975d('0xe')]);router[_0x975d('0x9')](_0x975d('0xf'),auth[_0x975d('0xa')](),controller[_0x975d('0x10')]);router[_0x975d('0x9')](_0x975d('0x11'),auth[_0x975d('0xa')](),controller[_0x975d('0x12')]);router[_0x975d('0x13')]('/',auth[_0x975d('0xa')](),controller[_0x975d('0x14')]);router[_0x975d('0x15')](_0x975d('0xb'),auth[_0x975d('0xa')](),controller['update']);router['delete'](_0x975d('0xb'),auth[_0x975d('0xa')](),controller['destroy']);module['exports']=router;
\ No newline at end of file
diff --git a/server/api/analyticDefaultReport/analyticDefaultReport.attributes.js b/server/api/analyticDefaultReport/analyticDefaultReport.attributes.js
index 9a4e542..612aa51 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 _0x98a8=['sequelize','exports','STRING','TEXT'];(function(_0x5eaefa,_0x24341a){var _0x11b447=function(_0x584abd){while(--_0x584abd){_0x5eaefa['push'](_0x5eaefa['shift']());}};_0x11b447(++_0x24341a);}(_0x98a8,0x12c));var _0x898a=function(_0x5a65a1,_0x3ff9bf){_0x5a65a1=_0x5a65a1-0x0;var _0x48f47e=_0x98a8[_0x5a65a1];return _0x48f47e;};'use strict';var Sequelize=require(_0x898a('0x0'));module[_0x898a('0x1')]={'name':{'type':Sequelize[_0x898a('0x2')],'allowNull':![]},'description':{'type':Sequelize[_0x898a('0x2')]},'parent':{'type':Sequelize[_0x898a('0x2')]},'table':{'type':Sequelize[_0x898a('0x2')]},'conditions':{'type':Sequelize[_0x898a('0x3')]},'joins':{'type':Sequelize['TEXT']}};
\ No newline at end of file
+var _0x6f47=['TEXT','exports','STRING'];(function(_0x24b83f,_0x46fefb){var _0x5163cc=function(_0x188235){while(--_0x188235){_0x24b83f['push'](_0x24b83f['shift']());}};_0x5163cc(++_0x46fefb);}(_0x6f47,0xc7));var _0x76f4=function(_0x138adb,_0x193fee){_0x138adb=_0x138adb-0x0;var _0x1b27f2=_0x6f47[_0x138adb];return _0x1b27f2;};'use strict';var Sequelize=require('sequelize');module[_0x76f4('0x0')]={'name':{'type':Sequelize[_0x76f4('0x1')],'allowNull':![]},'description':{'type':Sequelize['STRING']},'parent':{'type':Sequelize[_0x76f4('0x1')]},'table':{'type':Sequelize['STRING']},'conditions':{'type':Sequelize[_0x76f4('0x2')]},'joins':{'type':Sequelize['TEXT']}};
\ No newline at end of file
diff --git a/server/api/analyticDefaultReport/analyticDefaultReport.controller.js b/server/api/analyticDefaultReport/analyticDefaultReport.controller.js
index 838f9bf..77edc0a 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 _0xf494=['name','send','index','map','AnalyticDefaultReport','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','include','findAll','catch','show','includeAll','find','create','body','user','Reports','UserProfileSection','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','params','join','left_join','cross_join','COUNT(DISTINCT\x20%s)','MAX(%s)','MIN(%s)','AVG(%s)','GROUP_CONCAT(%s)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)','SEC_TO_TIME(%s)','DATE(%s)','HOUR(%s)','UNIX_TIMESTAMP(%s)','includes','IS\x20NOT\x20NULL','IS\x20EMPTY','rules','group','field','value','Sequelize','ValidationErrorItem','Please\x20insert\x20at\x20least\x20one\x20field','AnalyticMetric','keyBy','select','from','table','MetricId','metric','function','replace','format','orderBy','DESC','alias','joins','parse','foreignTable','%s.%s\x20=\x20%s.%s','parentKey','foreignKey','conditions','debug','Limited\x20Query:','sequelize','toString','QueryTypes','right_join','SUM(%s)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','ROUND(%s)','IS\x20NULL','operator','condition','getFields','groupBy','clone','output','fullPath','%s-%s.%s','generate','csv','default','AnalyticExtractedReport','cdr','.calldate\x20BETWEEN\x20?\x20AND\x20?','startDate','endDate','info','child_process','fork','../../components/export/','../../files/reports','savename','countTable','COUNT(*)','SELECT','run','runReport','IS\x20NOT\x20EMPTY','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','../../config/utils','../../mysqldb','sendStatus','status','end','json','offset','limit','undefined','count','set','Content-Range','reject','save','update','then','destroy','get','DefaultReports','error','stack'];(function(_0x17457c,_0x5c874d){var _0x18a702=function(_0x2be3e4){while(--_0x2be3e4){_0x17457c['push'](_0x17457c['shift']());}};_0x18a702(++_0x5c874d);}(_0xf494,0x1c6));var _0x4f49=function(_0x4603a3,_0x260168){_0x4603a3=_0x4603a3-0x0;var _0x532cbe=_0xf494[_0x4603a3];return _0x532cbe;};'use strict';var emlformat=require(_0x4f49('0x0'));var rimraf=require(_0x4f49('0x1'));var zipdir=require(_0x4f49('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x4f49('0x3'));var moment=require(_0x4f49('0x4'));var BPromise=require(_0x4f49('0x5'));var Mustache=require(_0x4f49('0x6'));var util=require(_0x4f49('0x7'));var path=require(_0x4f49('0x8'));var sox=require(_0x4f49('0x9'));var csv=require(_0x4f49('0xa'));var ejs=require(_0x4f49('0xb'));var fs=require('fs');var fs_extra=require(_0x4f49('0xc'));var _=require(_0x4f49('0xd'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x4f49('0xe'));var deskjs=require(_0x4f49('0xf'));var toCsv=require(_0x4f49('0xa'));var querystring=require(_0x4f49('0x10'));var Papa=require(_0x4f49('0x11'));var Redis=require(_0x4f49('0x12'));var authService=require(_0x4f49('0x13'));var qs=require(_0x4f49('0x14'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x4f49('0x15'));var logger=require(_0x4f49('0x16'))('api');var utils=require(_0x4f49('0x17'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0x4f49('0x18'))['db'];var dbH=require(_0x4f49('0x18'))['dbH'];function respondWithStatusCode(_0x1e1c37,_0x111a8b){_0x111a8b=_0x111a8b||0xcc;return function(_0x1b9145){if(_0x1b9145){return _0x1e1c37[_0x4f49('0x19')](_0x111a8b);}return _0x1e1c37[_0x4f49('0x1a')](_0x111a8b)[_0x4f49('0x1b')]();};}function respondWithResult(_0xfdb477,_0x5c373e){_0x5c373e=_0x5c373e||0xc8;return function(_0x515ace){if(_0x515ace){return _0xfdb477[_0x4f49('0x1a')](_0x5c373e)[_0x4f49('0x1c')](_0x515ace);}};}function respondWithFilteredResult(_0x5878f4,_0x5bdfaf){return function(_0x2f0a0d){if(_0x2f0a0d){var _0x2ecaaa=typeof _0x5bdfaf[_0x4f49('0x1d')]==='undefined'&&typeof _0x5bdfaf[_0x4f49('0x1e')]===_0x4f49('0x1f');var _0x4e85df=_0x2f0a0d['count'];var _0x5bb23b=_0x2ecaaa?0x0:_0x5bdfaf['offset'];var _0x47f1e8=_0x2ecaaa?_0x2f0a0d[_0x4f49('0x20')]:_0x5bdfaf[_0x4f49('0x1d')]+_0x5bdfaf[_0x4f49('0x1e')];var _0x407042;if(_0x47f1e8>=_0x4e85df){_0x47f1e8=_0x4e85df;_0x407042=0xc8;}else{_0x407042=0xce;}_0x5878f4['status'](_0x407042);return _0x5878f4[_0x4f49('0x21')](_0x4f49('0x22'),_0x5bb23b+'-'+_0x47f1e8+'/'+_0x4e85df)[_0x4f49('0x1c')](_0x2f0a0d);}return null;};}function patchUpdates(_0xaab5e7){return function(_0xea82f8){try{jsonpatch['apply'](_0xea82f8,_0xaab5e7,!![]);}catch(_0x3e7e28){return BPromise[_0x4f49('0x23')](_0x3e7e28);}return _0xea82f8[_0x4f49('0x24')]();};}function saveUpdates(_0x53b57d,_0x40755e){return function(_0x1d70a7){if(_0x1d70a7){return _0x1d70a7[_0x4f49('0x25')](_0x53b57d)[_0x4f49('0x26')](function(_0x9d30aa){return _0x9d30aa;});}return null;};}function removeEntity(_0x36187b,_0x559d98){return function(_0x4e9041){if(_0x4e9041){return _0x4e9041[_0x4f49('0x27')]()[_0x4f49('0x26')](function(){var _0x4fedbb=_0x4e9041[_0x4f49('0x28')]({'plain':!![]});var _0x2c1519=_0x4f49('0x29');return db['UserProfileResource'][_0x4f49('0x27')]({'where':{'type':_0x2c1519,'resourceId':_0x4fedbb['id']}})[_0x4f49('0x26')](function(){return _0x4e9041;});})[_0x4f49('0x26')](function(){_0x36187b[_0x4f49('0x1a')](0xcc)[_0x4f49('0x1b')]();});}};}function handleEntityNotFound(_0x122404,_0x4915af){return function(_0x50c571){if(!_0x50c571){_0x122404[_0x4f49('0x19')](0x194);}return _0x50c571;};}function handleError(_0x2c00ee,_0x605c91){_0x605c91=_0x605c91||0x1f4;return function(_0x560050){logger[_0x4f49('0x2a')](_0x560050[_0x4f49('0x2b')]);if(_0x560050[_0x4f49('0x2c')]){delete _0x560050['name'];}_0x2c00ee['status'](_0x605c91)[_0x4f49('0x2d')](_0x560050);};}exports[_0x4f49('0x2e')]=function(_0x7a6ea0,_0x5e7076){var _0x1eaac6={},_0x35aa33={},_0x173657={'count':0x0,'rows':[]};var _0x2ceda4=_[_0x4f49('0x2f')](db[_0x4f49('0x30')][_0x4f49('0x31')],function(_0x45ae19){return{'name':_0x45ae19[_0x4f49('0x32')],'type':_0x45ae19[_0x4f49('0x33')][_0x4f49('0x34')]};});_0x35aa33[_0x4f49('0x35')]=_[_0x4f49('0x2f')](_0x2ceda4,_0x4f49('0x2c'));_0x35aa33[_0x4f49('0x36')]=_[_0x4f49('0x37')](_0x7a6ea0[_0x4f49('0x36')]);_0x35aa33[_0x4f49('0x38')]=_[_0x4f49('0x39')](_0x35aa33['model'],_0x35aa33[_0x4f49('0x36')]);_0x1eaac6[_0x4f49('0x3a')]=_[_0x4f49('0x39')](_0x35aa33[_0x4f49('0x35')],qs[_0x4f49('0x3b')](_0x7a6ea0[_0x4f49('0x36')][_0x4f49('0x3b')]));_0x1eaac6[_0x4f49('0x3a')]=_0x1eaac6[_0x4f49('0x3a')][_0x4f49('0x3c')]?_0x1eaac6[_0x4f49('0x3a')]:_0x35aa33[_0x4f49('0x35')];if(!_0x7a6ea0[_0x4f49('0x36')]['hasOwnProperty'](_0x4f49('0x3d'))){_0x1eaac6[_0x4f49('0x1e')]=qs[_0x4f49('0x1e')](_0x7a6ea0[_0x4f49('0x36')][_0x4f49('0x1e')]);_0x1eaac6[_0x4f49('0x1d')]=qs[_0x4f49('0x1d')](_0x7a6ea0[_0x4f49('0x36')][_0x4f49('0x1d')]);}_0x1eaac6[_0x4f49('0x3e')]=qs[_0x4f49('0x3f')](_0x7a6ea0[_0x4f49('0x36')][_0x4f49('0x3f')]);_0x1eaac6[_0x4f49('0x40')]=qs['filters'](_[_0x4f49('0x41')](_0x7a6ea0[_0x4f49('0x36')],_0x35aa33['filters']),_0x2ceda4);if(_0x7a6ea0[_0x4f49('0x36')][_0x4f49('0x42')]){_0x1eaac6['where']=_[_0x4f49('0x43')](_0x1eaac6[_0x4f49('0x40')],{'$or':_[_0x4f49('0x2f')](_0x2ceda4,function(_0x200b1d){if(_0x200b1d[_0x4f49('0x33')]!==_0x4f49('0x44')){var _0x29e910={};_0x29e910[_0x200b1d['name']]={'$like':'%'+_0x7a6ea0['query']['filter']+'%'};return _0x29e910;}})});}_0x1eaac6=_[_0x4f49('0x43')]({},_0x1eaac6,_0x7a6ea0[_0x4f49('0x45')]);var _0x2e4355={'where':_0x1eaac6[_0x4f49('0x40')]};return db[_0x4f49('0x30')][_0x4f49('0x20')](_0x2e4355)[_0x4f49('0x26')](function(_0x23720a){_0x173657[_0x4f49('0x20')]=_0x23720a;if(_0x7a6ea0['query']['includeAll']){_0x1eaac6[_0x4f49('0x46')]=[{'all':!![]}];}return db[_0x4f49('0x30')][_0x4f49('0x47')](_0x1eaac6);})['then'](function(_0x2d6b56){_0x173657['rows']=_0x2d6b56;return _0x173657;})['then'](respondWithFilteredResult(_0x5e7076,_0x1eaac6))[_0x4f49('0x48')](handleError(_0x5e7076,null));};exports[_0x4f49('0x49')]=function(_0x40eadc,_0x497cb8){var _0x287781={'raw':!![],'where':{'id':_0x40eadc['params']['id']}},_0x11b4df={};_0x11b4df[_0x4f49('0x35')]=_['keys'](db[_0x4f49('0x30')][_0x4f49('0x31')]);_0x11b4df[_0x4f49('0x36')]=_['keys'](_0x40eadc[_0x4f49('0x36')]);_0x11b4df[_0x4f49('0x38')]=_[_0x4f49('0x39')](_0x11b4df[_0x4f49('0x35')],_0x11b4df[_0x4f49('0x36')]);_0x287781[_0x4f49('0x3a')]=_[_0x4f49('0x39')](_0x11b4df[_0x4f49('0x35')],qs[_0x4f49('0x3b')](_0x40eadc[_0x4f49('0x36')]['fields']));_0x287781[_0x4f49('0x3a')]=_0x287781[_0x4f49('0x3a')]['length']?_0x287781[_0x4f49('0x3a')]:_0x11b4df['model'];if(_0x40eadc[_0x4f49('0x36')][_0x4f49('0x4a')]){_0x287781[_0x4f49('0x46')]=[{'all':!![]}];}_0x287781=_[_0x4f49('0x43')]({},_0x287781,_0x40eadc['options']);return db[_0x4f49('0x30')][_0x4f49('0x4b')](_0x287781)[_0x4f49('0x26')](handleEntityNotFound(_0x497cb8,null))[_0x4f49('0x26')](respondWithResult(_0x497cb8,null))[_0x4f49('0x48')](handleError(_0x497cb8,null));};exports[_0x4f49('0x4c')]=function(_0x37fdb7,_0xd282c){return db[_0x4f49('0x30')][_0x4f49('0x4c')](_0x37fdb7[_0x4f49('0x4d')],{})[_0x4f49('0x26')](function(_0x148031){var _0x2104d0=_0x37fdb7[_0x4f49('0x4e')][_0x4f49('0x28')]({'plain':!![]});if(!_0x2104d0)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x2104d0['role']===_0x4f49('0x4e')){var _0x197670=_0x148031[_0x4f49('0x28')]({'plain':!![]});var _0xe46c90=_0x4f49('0x4f');return db[_0x4f49('0x50')][_0x4f49('0x4b')]({'where':{'name':_0xe46c90,'userProfileId':_0x2104d0['userProfileId']},'raw':!![]})[_0x4f49('0x26')](function(_0x4ff0a2){if(_0x4ff0a2&&_0x4ff0a2[_0x4f49('0x51')]===0x0){return db[_0x4f49('0x52')][_0x4f49('0x4c')]({'name':_0x197670[_0x4f49('0x2c')],'resourceId':_0x197670['id'],'type':'DefaultReports','sectionId':_0x4ff0a2['id']},{})[_0x4f49('0x26')](function(){return _0x148031;});}else{return _0x148031;}})['catch'](function(_0x52d18c){logger[_0x4f49('0x2a')](_0x4f49('0x53'),_0x52d18c);throw _0x52d18c;});}return _0x148031;})[_0x4f49('0x26')](respondWithResult(_0xd282c,0xc9))[_0x4f49('0x48')](handleError(_0xd282c,null));};exports['update']=function(_0x599c51,_0xd7f47b){if(_0x599c51[_0x4f49('0x4d')]['id']){delete _0x599c51['body']['id'];}return db[_0x4f49('0x30')]['find']({'where':{'id':_0x599c51['params']['id']}})[_0x4f49('0x26')](handleEntityNotFound(_0xd7f47b,null))['then'](saveUpdates(_0x599c51[_0x4f49('0x4d')],null))['then'](respondWithResult(_0xd7f47b,null))[_0x4f49('0x48')](handleError(_0xd7f47b,null));};exports[_0x4f49('0x27')]=function(_0x2472c9,_0x883408){return db[_0x4f49('0x30')][_0x4f49('0x4b')]({'where':{'id':_0x2472c9[_0x4f49('0x54')]['id']}})[_0x4f49('0x26')](handleEntityNotFound(_0x883408,null))['then'](removeEntity(_0x883408,null))[_0x4f49('0x48')](handleError(_0x883408,null));};exports['preview']=function(_0x213608,_0x1f640d){var _0xc4fc6b=0xa;var _0x467f12=[_0x4f49('0x55'),_0x4f49('0x56'),'right_join',_0x4f49('0x57')];var _0xd3689c={'SUM':'SUM(%s)','COUNT':'COUNT(%s)','COUNT DISTINCT':_0x4f49('0x58'),'MAX':_0x4f49('0x59'),'MIN':_0x4f49('0x5a'),'AVG':_0x4f49('0x5b'),'GROUP_CONCAT':_0x4f49('0x5c'),'GROUP_CONCAT ASC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT DESC':_0x4f49('0x5d')};var _0x564bf5={'SEC_TO_TIME':_0x4f49('0x5e'),'DATE':_0x4f49('0x5f'),'HOUR':_0x4f49('0x60'),'ROUND':'ROUND(%s)','UNIX_TIMESTAMP':_0x4f49('0x61')};var _0x21807e=function(_0x265988){return!_[_0x4f49('0x62')](['IS\x20NULL',_0x4f49('0x63'),_0x4f49('0x64'),'IS\x20NOT\x20EMPTY'],_0x265988);};var _0x293839=function(_0x17b15){if(!_0x17b15||!_0x17b15[_0x4f49('0x65')][_0x4f49('0x3c')]){return'';}for(var _0x28ea73='(',_0x1b80f2=0x0;_0x1b80f2<_0x17b15[_0x4f49('0x65')][_0x4f49('0x3c')];_0x1b80f2+=0x1){_0x1b80f2>0x0&&(_0x28ea73+='\x20'+_0x17b15['operator']+'\x20');_0x28ea73+=_0x17b15[_0x4f49('0x65')][_0x1b80f2][_0x4f49('0x66')]?_0x293839(_0x17b15[_0x4f49('0x65')][_0x1b80f2][_0x4f49('0x66')]):_0x17b15[_0x4f49('0x65')][_0x1b80f2][_0x4f49('0x67')]+'\x20'+_0x17b15[_0x4f49('0x65')][_0x1b80f2]['condition']+(_0x21807e(_0x17b15[_0x4f49('0x65')][_0x1b80f2]['condition'])?'\x20'+_0x17b15[_0x4f49('0x65')][_0x1b80f2][_0x4f49('0x68')]:'');}return _0x28ea73+')';};var _0x4714c7={'where':{'id':_0x213608[_0x4f49('0x54')]['id']}},_0xf29378,_0xc7743e,_0x3f2f3f,_0x61a565,_0x297698;_0x4714c7=_[_0x4f49('0x43')]({},_0x4714c7,_0x213608['options']);return db[_0x4f49('0x30')][_0x4f49('0x4b')](_0x4714c7)[_0x4f49('0x26')](function(_0x2cdaa4){if(_0x2cdaa4){_0xf29378=_0x2cdaa4;return _0x2cdaa4['getFields']();}return null;})['then'](function(_0x28e8ae){if(_0x28e8ae){if(!_0x28e8ae['length']){throw new db[(_0x4f49('0x69'))][(_0x4f49('0x6a'))](_0x4f49('0x6b'),0x193);}_0xc7743e=_0x28e8ae;return db[_0x4f49('0x6c')][_0x4f49('0x47')]({'raw':!![]});}return null;})[_0x4f49('0x26')](function(_0x179431){if(_0x179431){_0x3f2f3f=_[_0x4f49('0x6d')](_0x179431,'id');var _0x3823f0;var _0x3e9b47=squel[_0x4f49('0x6e')]();_0x3e9b47[_0x4f49('0x6f')](_0xf29378[_0x4f49('0x70')]);for(var _0xd53de8=0x0;_0xd53de8<_0xc7743e[_0x4f49('0x3c')];_0xd53de8+=0x1){_0x3823f0=_0xc7743e[_0xd53de8][_0x4f49('0x71')]?_0x3f2f3f[_0xc7743e[_0xd53de8][_0x4f49('0x71')]][_0x4f49('0x72')]:_0xc7743e[_0xd53de8][_0x4f49('0x67')];_0x3823f0=_0xc7743e[_0xd53de8][_0x4f49('0x73')]?_[_0x4f49('0x74')](_0xd3689c[_0xc7743e[_0xd53de8][_0x4f49('0x73')]],'%s',_0x3823f0):_0x3823f0;_0x3823f0=_0xc7743e[_0xd53de8][_0x4f49('0x75')]?_[_0x4f49('0x74')](_0x564bf5[_0xc7743e[_0xd53de8][_0x4f49('0x75')]],'%s',_0x3823f0):_0x3823f0;if(_0xc7743e[_0xd53de8]['groupBy']){_0x3e9b47[_0x4f49('0x66')](_0x3823f0);}_0xc7743e[_0xd53de8]['orderBy']&&_0x3e9b47[_0x4f49('0x3e')](_0x3823f0,_0xc7743e[_0xd53de8][_0x4f49('0x76')]===_0x4f49('0x77')?![]:!![]);_0x3e9b47[_0x4f49('0x67')](_0x3823f0,_0xc7743e[_0xd53de8][_0x4f49('0x78')]||_0x3823f0);}if(_0xf29378[_0x4f49('0x79')]){_0xf29378[_0x4f49('0x79')]=JSON[_0x4f49('0x7a')](_0xf29378[_0x4f49('0x79')]);for(var _0x541ac6=0x0;_0x541ac6<_0xf29378['joins'][_0x4f49('0x3c')];_0x541ac6+=0x1){if(_0xf29378['joins'][_0x541ac6][_0x4f49('0x33')]&&_[_0x4f49('0x62')](_0x467f12,_0xf29378[_0x4f49('0x79')][_0x541ac6][_0x4f49('0x33')])&&_0xf29378[_0x4f49('0x79')][_0x541ac6]['parentKey']&&_0xf29378['joins'][_0x541ac6][_0x4f49('0x7b')]&&_0xf29378[_0x4f49('0x79')][_0x541ac6]['foreignKey']){_0x3e9b47[_0xf29378[_0x4f49('0x79')][_0x541ac6][_0x4f49('0x33')]](_0xf29378['joins'][_0x541ac6][_0x4f49('0x7b')],null,util['format'](_0x4f49('0x7c'),_0xf29378[_0x4f49('0x70')],_0xf29378['joins'][_0x541ac6][_0x4f49('0x7d')],_0xf29378[_0x4f49('0x79')][_0x541ac6][_0x4f49('0x7b')],_0xf29378[_0x4f49('0x79')][_0x541ac6][_0x4f49('0x7e')]));}}}if(_0xf29378[_0x4f49('0x7f')]){_0xf29378['conditions']=JSON[_0x4f49('0x7a')](_0xf29378['conditions']);_0x3e9b47[_0x4f49('0x40')](_0x293839(_0xf29378['conditions'][_0x4f49('0x66')]));}_0x297698=_0x3e9b47['clone']();_0x3e9b47[_0x4f49('0x1e')](_0xc4fc6b);_0x3e9b47[_0x4f49('0x1d')](0x0);logger[_0x4f49('0x80')](_0x4f49('0x81'),_0x3e9b47['toString']());return dbH[_0x4f49('0x82')]['query'](_0x3e9b47[_0x4f49('0x83')](),{'type':dbH['sequelize'][_0x4f49('0x84')]['SELECT']});}})['then'](respondWithResult(_0x1f640d,null))[_0x4f49('0x48')](handleError(_0x1f640d,null));};function runReport(_0x20b2be,_0x16cb4d,_0x4c0e7a){var _0x289810=_0x16cb4d[_0x4f49('0x2c')];var _0x5c33c9=0xa;var _0x5d52ae=['join',_0x4f49('0x56'),_0x4f49('0x85'),_0x4f49('0x57')];var _0x87439={'SUM':_0x4f49('0x86'),'COUNT':'COUNT(%s)','COUNT DISTINCT':_0x4f49('0x58'),'MAX':_0x4f49('0x59'),'MIN':_0x4f49('0x5a'),'AVG':'AVG(%s)','GROUP_CONCAT':_0x4f49('0x5c'),'GROUP_CONCAT ASC':_0x4f49('0x87'),'GROUP_CONCAT DESC':_0x4f49('0x5d')};var _0x2902a1={'SEC_TO_TIME':'SEC_TO_TIME(%s)','DATE':_0x4f49('0x5f'),'HOUR':_0x4f49('0x60'),'ROUND':_0x4f49('0x88'),'UNIX_TIMESTAMP':_0x4f49('0x61')};var _0x389679=function(_0x5304c3){return!_[_0x4f49('0x62')]([_0x4f49('0x89'),'IS\x20NOT\x20NULL',_0x4f49('0x64'),'IS\x20NOT\x20EMPTY'],_0x5304c3);};var _0x351a33=function(_0x4d72a0){if(!_0x4d72a0||!_0x4d72a0[_0x4f49('0x65')][_0x4f49('0x3c')]){return'';}for(var _0x2ef19e='(',_0x6ad599=0x0;_0x6ad599<_0x4d72a0[_0x4f49('0x65')]['length'];_0x6ad599+=0x1){_0x6ad599>0x0&&(_0x2ef19e+='\x20'+_0x4d72a0[_0x4f49('0x8a')]+'\x20');_0x2ef19e+=_0x4d72a0[_0x4f49('0x65')][_0x6ad599][_0x4f49('0x66')]?_0x351a33(_0x4d72a0[_0x4f49('0x65')][_0x6ad599]['group']):_0x4d72a0[_0x4f49('0x65')][_0x6ad599]['field']+'\x20'+_0x4d72a0[_0x4f49('0x65')][_0x6ad599]['condition']+(_0x389679(_0x4d72a0[_0x4f49('0x65')][_0x6ad599][_0x4f49('0x8b')])?'\x20'+_0x4d72a0[_0x4f49('0x65')][_0x6ad599][_0x4f49('0x68')]:'');}return _0x2ef19e+')';};var _0x111e90={'where':{'id':_0x20b2be['id']}},_0xd253ed,_0x323a3a,_0xe0adc3,_0x3a26ff,_0x64f0ee;_0x111e90=_['merge']({},_0x111e90,_0x4c0e7a);return db[_0x4f49('0x30')][_0x4f49('0x4b')](_0x111e90)[_0x4f49('0x26')](function(_0x299849){if(_0x299849){_0xd253ed=_0x299849;return _0x299849[_0x4f49('0x8c')]();}return null;})[_0x4f49('0x26')](function(_0x55b28b){if(_0x55b28b){if(!_0x55b28b[_0x4f49('0x3c')]){throw new db[(_0x4f49('0x69'))][(_0x4f49('0x6a'))](_0x4f49('0x6b'),0x193);}_0x323a3a=_0x55b28b;return db['AnalyticMetric'][_0x4f49('0x47')]({'raw':!![]});}return null;})['then'](function(_0x3c4e88){if(_0x3c4e88){_0xe0adc3=_[_0x4f49('0x6d')](_0x3c4e88,'id');var _0x5c5d2;var _0xa880a2=squel['select']();_0xa880a2[_0x4f49('0x6f')](_0xd253ed[_0x4f49('0x70')]);for(var _0x11c0a0=0x0;_0x11c0a0<_0x323a3a[_0x4f49('0x3c')];_0x11c0a0+=0x1){_0x5c5d2=_0x323a3a[_0x11c0a0][_0x4f49('0x71')]?_0xe0adc3[_0x323a3a[_0x11c0a0][_0x4f49('0x71')]][_0x4f49('0x72')]:_0x323a3a[_0x11c0a0][_0x4f49('0x67')];_0x5c5d2=_0x323a3a[_0x11c0a0][_0x4f49('0x73')]?_[_0x4f49('0x74')](_0x87439[_0x323a3a[_0x11c0a0][_0x4f49('0x73')]],'%s',_0x5c5d2):_0x5c5d2;_0x5c5d2=_0x323a3a[_0x11c0a0][_0x4f49('0x75')]?_[_0x4f49('0x74')](_0x2902a1[_0x323a3a[_0x11c0a0][_0x4f49('0x75')]],'%s',_0x5c5d2):_0x5c5d2;if(_0x323a3a[_0x11c0a0][_0x4f49('0x8d')]){_0xa880a2[_0x4f49('0x66')](_0x5c5d2);}_0x323a3a[_0x11c0a0][_0x4f49('0x76')]&&_0xa880a2[_0x4f49('0x3e')](_0x5c5d2,_0x323a3a[_0x11c0a0]['orderBy']===_0x4f49('0x77')?![]:!![]);_0xa880a2[_0x4f49('0x67')](_0x5c5d2,_0x323a3a[_0x11c0a0][_0x4f49('0x78')]||_0x5c5d2);}if(_0xd253ed[_0x4f49('0x79')]){_0xd253ed['joins']=JSON[_0x4f49('0x7a')](_0xd253ed[_0x4f49('0x79')]);for(var _0x594460=0x0;_0x594460<_0xd253ed[_0x4f49('0x79')]['length'];_0x594460+=0x1){if(_0xd253ed[_0x4f49('0x79')][_0x594460][_0x4f49('0x33')]&&_[_0x4f49('0x62')](_0x5d52ae,_0xd253ed[_0x4f49('0x79')][_0x594460][_0x4f49('0x33')])&&_0xd253ed[_0x4f49('0x79')][_0x594460][_0x4f49('0x7d')]&&_0xd253ed[_0x4f49('0x79')][_0x594460][_0x4f49('0x7b')]&&_0xd253ed[_0x4f49('0x79')][_0x594460]['foreignKey']){_0xa880a2[_0xd253ed['joins'][_0x594460][_0x4f49('0x33')]](_0xd253ed['joins'][_0x594460][_0x4f49('0x7b')],null,util[_0x4f49('0x75')]('%s.%s\x20=\x20%s.%s',_0xd253ed['table'],_0xd253ed[_0x4f49('0x79')][_0x594460]['parentKey'],_0xd253ed[_0x4f49('0x79')][_0x594460][_0x4f49('0x7b')],_0xd253ed[_0x4f49('0x79')][_0x594460]['foreignKey']));}}}if(_0xd253ed[_0x4f49('0x7f')]){_0xd253ed['conditions']=JSON[_0x4f49('0x7a')](_0xd253ed[_0x4f49('0x7f')]);_0xa880a2[_0x4f49('0x40')](_0x351a33(_0xd253ed['conditions'][_0x4f49('0x66')]));}_0x64f0ee=_0xa880a2[_0x4f49('0x8e')]();_0xa880a2[_0x4f49('0x1e')](_0x5c33c9);_0xa880a2['offset'](0x0);return;}})['then'](function(){if(_0x16cb4d[_0x4f49('0x8f')]==='web'){return null;}var _0x2bc9df=_[_0x4f49('0x43')](_0x16cb4d,{'name':_0x16cb4d[_0x4f49('0x90')]||_0x16cb4d['name']||_0xd253ed[_0x4f49('0x2c')],'basename':_0x289810,'savename':util['format'](_0x4f49('0x91'),_0x16cb4d[_0x4f49('0x2c')]||_0xd253ed[_0x4f49('0x2c')],require('randomstring')[_0x4f49('0x92')](0x4),_0x16cb4d[_0x4f49('0x8f')]||_0x4f49('0x93')),'reportId':_0xd253ed['id'],'reportType':_0x4f49('0x94')});return db[_0x4f49('0x95')][_0x4f49('0x4c')](_0x2bc9df,{'raw':!![]});})['then'](function(_0x5b6ac7){if(_0xd253ed[_0x4f49('0x70')]===_0x4f49('0x96')){_0x64f0ee[_0x4f49('0x40')](_0xd253ed[_0x4f49('0x70')]+_0x4f49('0x97'),_0x16cb4d[_0x4f49('0x98')],_0x16cb4d[_0x4f49('0x99')]);}else{_0x64f0ee[_0x4f49('0x40')](_0xd253ed[_0x4f49('0x70')]+'.createdAt\x20BETWEEN\x20?\x20AND\x20?',_0x16cb4d[_0x4f49('0x98')],_0x16cb4d[_0x4f49('0x99')]);}if(_0x5b6ac7){logger[_0x4f49('0x9a')]('Run\x20Query:',_0x64f0ee[_0x4f49('0x83')]());require(_0x4f49('0x9b'))[_0x4f49('0x9c')](path['join'](__dirname,_0x4f49('0x9d'),_0x5b6ac7[_0x4f49('0x8f')]),[_0x5b6ac7['id'],_0x64f0ee[_0x4f49('0x83')](),path['join'](__dirname,_0x4f49('0x9e'),_0x5b6ac7[_0x4f49('0x9f')]),_0x289810]);return _0x5b6ac7;}else{var _0x5efb11=squel['select']();_0x5efb11[_0x4f49('0x6f')]('('+_0x64f0ee[_0x4f49('0x83')]()+')',_0x4f49('0xa0'));_0x5efb11[_0x4f49('0x67')](_0x4f49('0xa1'),_0x4f49('0x20'));_0x64f0ee['limit'](_0x16cb4d['limit']||_0x5c33c9);_0x64f0ee['offset'](_0x16cb4d[_0x4f49('0x1d')]||0x0);return dbH[_0x4f49('0x82')]['query'](_0x5efb11[_0x4f49('0x83')](),{'type':dbH[_0x4f49('0x82')][_0x4f49('0x84')]['SELECT']})['then'](function(_0x3633b5){if(!_0x3633b5['length']){_0x3a26ff=0x0;}else{_0x3a26ff=_0x3633b5[0x0][_0x4f49('0x20')]||0x0;}return dbH[_0x4f49('0x82')][_0x4f49('0x36')](_0x64f0ee[_0x4f49('0x83')](),{'type':dbH[_0x4f49('0x82')]['QueryTypes'][_0x4f49('0xa2')]});})[_0x4f49('0x26')](function(_0x45c938){return{'rows':_0x45c938||[],'count':_0x3a26ff};});}});}exports[_0x4f49('0xa3')]=function(_0x4a4d75,_0x93e85d){return runReport(_0x4a4d75[_0x4f49('0x54')],_0x4a4d75['query'],_0x4a4d75[_0x4f49('0x45')])[_0x4f49('0x26')](respondWithResult(_0x93e85d,null))[_0x4f49('0x48')](handleError(_0x93e85d,null));};exports[_0x4f49('0xa4')]=runReport;exports[_0x4f49('0x36')]=function(_0x40991b,_0x56290f){var _0x4994b6=0xa;var _0x1c7d87=[_0x4f49('0x55'),_0x4f49('0x56'),_0x4f49('0x85'),_0x4f49('0x57')];var _0x5cd00a={'SUM':_0x4f49('0x86'),'COUNT':'COUNT(%s)','COUNT DISTINCT':_0x4f49('0x58'),'MAX':'MAX(%s)','MIN':'MIN(%s)','AVG':_0x4f49('0x5b'),'GROUP_CONCAT':_0x4f49('0x5c'),'GROUP_CONCAT ASC':_0x4f49('0x87'),'GROUP_CONCAT DESC':_0x4f49('0x5d')};var _0xd876f1={'SEC_TO_TIME':_0x4f49('0x5e'),'DATE':_0x4f49('0x5f'),'HOUR':'HOUR(%s)','ROUND':_0x4f49('0x88'),'UNIX_TIMESTAMP':_0x4f49('0x61')};var _0x1ae2c9=function(_0x566634){return!_[_0x4f49('0x62')]([_0x4f49('0x89'),_0x4f49('0x63'),'IS\x20EMPTY',_0x4f49('0xa5')],_0x566634);};var _0x541dc2=function(_0x4061bf){if(!_0x4061bf||!_0x4061bf[_0x4f49('0x65')][_0x4f49('0x3c')]){return'';}for(var _0x1bc18d='(',_0x5e6103=0x0;_0x5e6103<_0x4061bf[_0x4f49('0x65')][_0x4f49('0x3c')];_0x5e6103+=0x1){_0x5e6103>0x0&&(_0x1bc18d+='\x20'+_0x4061bf[_0x4f49('0x8a')]+'\x20');_0x1bc18d+=_0x4061bf[_0x4f49('0x65')][_0x5e6103][_0x4f49('0x66')]?_0x541dc2(_0x4061bf[_0x4f49('0x65')][_0x5e6103][_0x4f49('0x66')]):_0x4061bf[_0x4f49('0x65')][_0x5e6103]['field']+'\x20'+_0x4061bf['rules'][_0x5e6103][_0x4f49('0x8b')]+(_0x1ae2c9(_0x4061bf[_0x4f49('0x65')][_0x5e6103][_0x4f49('0x8b')])?'\x20'+_0x4061bf[_0x4f49('0x65')][_0x5e6103][_0x4f49('0x68')]:'');}return _0x1bc18d+')';};var _0x29dbab={'where':{'id':_0x40991b[_0x4f49('0x54')]['id']}},_0x5f459b,_0x1d090f,_0x37d2f4,_0x5bcb36,_0x3f04fa;_0x29dbab=_[_0x4f49('0x43')]({},_0x29dbab,_0x40991b['options']);return db['AnalyticDefaultReport'][_0x4f49('0x4b')](_0x29dbab)[_0x4f49('0x26')](function(_0x200848){if(_0x200848){_0x5f459b=_0x200848;return _0x200848['getFields']();}return null;})[_0x4f49('0x26')](function(_0x48f4bc){if(_0x48f4bc){if(!_0x48f4bc[_0x4f49('0x3c')]){throw new db['Sequelize'][(_0x4f49('0x6a'))](_0x4f49('0x6b'),0x193);}_0x1d090f=_0x48f4bc;return db['AnalyticMetric'][_0x4f49('0x47')]({'raw':!![]});}return null;})[_0x4f49('0x26')](function(_0x513bc9){if(_0x513bc9){_0x37d2f4=_[_0x4f49('0x6d')](_0x513bc9,'id');var _0x47567c;var _0x5f1538=squel[_0x4f49('0x6e')]();_0x5f1538[_0x4f49('0x6f')](_0x5f459b[_0x4f49('0x70')]);for(var _0xd91e48=0x0;_0xd91e48<_0x1d090f[_0x4f49('0x3c')];_0xd91e48+=0x1){_0x47567c=_0x1d090f[_0xd91e48][_0x4f49('0x71')]?_0x37d2f4[_0x1d090f[_0xd91e48]['MetricId']][_0x4f49('0x72')]:_0x1d090f[_0xd91e48][_0x4f49('0x67')];_0x47567c=_0x1d090f[_0xd91e48][_0x4f49('0x73')]?_['replace'](_0x5cd00a[_0x1d090f[_0xd91e48][_0x4f49('0x73')]],'%s',_0x47567c):_0x47567c;_0x47567c=_0x1d090f[_0xd91e48][_0x4f49('0x75')]?_[_0x4f49('0x74')](_0xd876f1[_0x1d090f[_0xd91e48][_0x4f49('0x75')]],'%s',_0x47567c):_0x47567c;if(_0x1d090f[_0xd91e48][_0x4f49('0x8d')]){_0x5f1538[_0x4f49('0x66')](_0x47567c);}_0x1d090f[_0xd91e48][_0x4f49('0x76')]&&_0x5f1538['order'](_0x47567c,_0x1d090f[_0xd91e48][_0x4f49('0x76')]==='DESC'?![]:!![]);_0x5f1538['field'](_0x47567c,_0x1d090f[_0xd91e48][_0x4f49('0x78')]||_0x47567c);}if(_0x5f459b['joins']){_0x5f459b[_0x4f49('0x79')]=JSON[_0x4f49('0x7a')](_0x5f459b[_0x4f49('0x79')]);for(var _0x85eb3f=0x0;_0x85eb3f<_0x5f459b[_0x4f49('0x79')][_0x4f49('0x3c')];_0x85eb3f+=0x1){if(_0x5f459b['joins'][_0x85eb3f][_0x4f49('0x33')]&&_[_0x4f49('0x62')](_0x1c7d87,_0x5f459b[_0x4f49('0x79')][_0x85eb3f][_0x4f49('0x33')])&&_0x5f459b[_0x4f49('0x79')][_0x85eb3f][_0x4f49('0x7d')]&&_0x5f459b[_0x4f49('0x79')][_0x85eb3f]['foreignTable']&&_0x5f459b[_0x4f49('0x79')][_0x85eb3f][_0x4f49('0x7e')]){_0x5f1538[_0x5f459b[_0x4f49('0x79')][_0x85eb3f][_0x4f49('0x33')]](_0x5f459b[_0x4f49('0x79')][_0x85eb3f][_0x4f49('0x7b')],null,util[_0x4f49('0x75')](_0x4f49('0x7c'),_0x5f459b[_0x4f49('0x70')],_0x5f459b[_0x4f49('0x79')][_0x85eb3f][_0x4f49('0x7d')],_0x5f459b[_0x4f49('0x79')][_0x85eb3f]['foreignTable'],_0x5f459b[_0x4f49('0x79')][_0x85eb3f][_0x4f49('0x7e')]));}}}if(_0x5f459b['conditions']){_0x5f459b[_0x4f49('0x7f')]=JSON[_0x4f49('0x7a')](_0x5f459b[_0x4f49('0x7f')]);_0x5f1538[_0x4f49('0x40')](_0x541dc2(_0x5f459b[_0x4f49('0x7f')][_0x4f49('0x66')]));}_0x3f04fa=_0x5f1538['clone']();_0x5f1538['limit'](_0x4994b6);_0x5f1538['offset'](0x0);logger['debug'](_0x4f49('0x81'),_0x5f1538['toString']());return dbH[_0x4f49('0x82')][_0x4f49('0x36')](_0x5f1538[_0x4f49('0x83')](),{'type':dbH[_0x4f49('0x82')][_0x4f49('0x84')][_0x4f49('0xa2')]});}})['then'](function(){return{'sql':_0x3f04fa[_0x4f49('0x83')]()};})['then'](respondWithResult(_0x56290f,null))[_0x4f49('0x48')](handleError(_0x56290f,null));};
\ No newline at end of file
+var _0x0295=['default','AnalyticExtractedReport','cdr','.calldate\x20BETWEEN\x20?\x20AND\x20?','startDate','.createdAt\x20BETWEEN\x20?\x20AND\x20?','endDate','info','Run\x20Query:','fork','../../files/reports','COUNT(*)','SELECT','run','runReport','MAX(%s)','eml-format','fast-json-patch','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','desk.js','querystring','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','save','update','then','get','UserProfileResource','destroy','error','name','send','index','map','AnalyticDefaultReport','rawAttributes','type','model','query','keys','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filters','pick','filter','merge','VIRTUAL','includeAll','include','rows','catch','show','params','options','find','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','Reports','UserProfileSection','autoAssociation','DefaultReports','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','preview','join','left_join','right_join','cross_join','SUM(%s)','COUNT(%s)','MIN(%s)','AVG(%s)','GROUP_CONCAT(%s)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','SEC_TO_TIME(%s)','DATE(%s)','HOUR(%s)','ROUND(%s)','UNIX_TIMESTAMP(%s)','includes','IS\x20NULL','IS\x20NOT\x20NULL','IS\x20NOT\x20EMPTY','rules','field','condition','value','Sequelize','ValidationErrorItem','AnalyticMetric','keyBy','from','table','MetricId','metric','function','format','groupBy','orderBy','DESC','alias','joins','parse','parentKey','foreignTable','foreignKey','%s.%s\x20=\x20%s.%s','conditions','group','clone','debug','Limited\x20Query:','sequelize','toString','QueryTypes','COUNT(DISTINCT\x20%s)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)','IS\x20EMPTY','operator','getFields','findAll','select','replace','output','web','%s-%s.%s','randomstring','generate','csv'];(function(_0x641afe,_0x22d726){var _0x2dfe9a=function(_0x33a370){while(--_0x33a370){_0x641afe['push'](_0x641afe['shift']());}};_0x2dfe9a(++_0x22d726);}(_0x0295,0x1f0));var _0x5029=function(_0x5e2eb5,_0x3f4e6c){_0x5e2eb5=_0x5e2eb5-0x0;var _0x180baf=_0x0295[_0x5e2eb5];return _0x180baf;};'use strict';var emlformat=require(_0x5029('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0x5029('0x1'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x5029('0x2'));var Mustache=require(_0x5029('0x3'));var util=require(_0x5029('0x4'));var path=require(_0x5029('0x5'));var sox=require(_0x5029('0x6'));var csv=require(_0x5029('0x7'));var ejs=require(_0x5029('0x8'));var fs=require('fs');var fs_extra=require(_0x5029('0x9'));var _=require(_0x5029('0xa'));var squel=require('squel');var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x5029('0xb'));var toCsv=require('to-csv');var querystring=require(_0x5029('0xc'));var Papa=require('papaparse');var Redis=require(_0x5029('0xd'));var authService=require('../../components/auth/service');var qs=require(_0x5029('0xe'));var as=require(_0x5029('0xf'));var hardwareService=require(_0x5029('0x10'));var logger=require('../../config/logger')(_0x5029('0x11'));var utils=require(_0x5029('0x12'));var config=require(_0x5029('0x13'));var licenseUtil=require('../../config/license/util');var db=require(_0x5029('0x14'))['db'];var dbH=require(_0x5029('0x14'))['dbH'];function respondWithStatusCode(_0x4fa22d,_0x49f836){_0x49f836=_0x49f836||0xcc;return function(_0x4aebb6){if(_0x4aebb6){return _0x4fa22d[_0x5029('0x15')](_0x49f836);}return _0x4fa22d[_0x5029('0x16')](_0x49f836)[_0x5029('0x17')]();};}function respondWithResult(_0x434630,_0x2c0b33){_0x2c0b33=_0x2c0b33||0xc8;return function(_0x11c24b){if(_0x11c24b){return _0x434630[_0x5029('0x16')](_0x2c0b33)[_0x5029('0x18')](_0x11c24b);}};}function respondWithFilteredResult(_0x10bf55,_0x326923){return function(_0x457c73){if(_0x457c73){var _0x353cba=typeof _0x326923[_0x5029('0x19')]===_0x5029('0x1a')&&typeof _0x326923[_0x5029('0x1b')]==='undefined';var _0x1ed567=_0x457c73[_0x5029('0x1c')];var _0x35de81=_0x353cba?0x0:_0x326923[_0x5029('0x19')];var _0x8cea01=_0x353cba?_0x457c73[_0x5029('0x1c')]:_0x326923[_0x5029('0x19')]+_0x326923['limit'];var _0x226a5c;if(_0x8cea01>=_0x1ed567){_0x8cea01=_0x1ed567;_0x226a5c=0xc8;}else{_0x226a5c=0xce;}_0x10bf55['status'](_0x226a5c);return _0x10bf55[_0x5029('0x1d')](_0x5029('0x1e'),_0x35de81+'-'+_0x8cea01+'/'+_0x1ed567)[_0x5029('0x18')](_0x457c73);}return null;};}function patchUpdates(_0x3cf0fb){return function(_0x4b5854){try{jsonpatch['apply'](_0x4b5854,_0x3cf0fb,!![]);}catch(_0x4c9184){return BPromise['reject'](_0x4c9184);}return _0x4b5854[_0x5029('0x1f')]();};}function saveUpdates(_0x853a34,_0x1eb228){return function(_0x2bbbcb){if(_0x2bbbcb){return _0x2bbbcb[_0x5029('0x20')](_0x853a34)[_0x5029('0x21')](function(_0x125c26){return _0x125c26;});}return null;};}function removeEntity(_0x356dac,_0x3e857d){return function(_0x4ceaae){if(_0x4ceaae){return _0x4ceaae['destroy']()['then'](function(){var _0x588d90=_0x4ceaae[_0x5029('0x22')]({'plain':!![]});var _0x51093c='DefaultReports';return db[_0x5029('0x23')][_0x5029('0x24')]({'where':{'type':_0x51093c,'resourceId':_0x588d90['id']}})[_0x5029('0x21')](function(){return _0x4ceaae;});})['then'](function(){_0x356dac[_0x5029('0x16')](0xcc)[_0x5029('0x17')]();});}};}function handleEntityNotFound(_0x5e45c4,_0x2b6d99){return function(_0x31f0a0){if(!_0x31f0a0){_0x5e45c4[_0x5029('0x15')](0x194);}return _0x31f0a0;};}function handleError(_0x4a24b9,_0x32da06){_0x32da06=_0x32da06||0x1f4;return function(_0x251f99){logger[_0x5029('0x25')](_0x251f99['stack']);if(_0x251f99[_0x5029('0x26')]){delete _0x251f99[_0x5029('0x26')];}_0x4a24b9['status'](_0x32da06)[_0x5029('0x27')](_0x251f99);};}exports[_0x5029('0x28')]=function(_0x4434ff,_0x1c3dd9){var _0x196830={},_0x2a1ed6={},_0x44255a={'count':0x0,'rows':[]};var _0x465153=_[_0x5029('0x29')](db[_0x5029('0x2a')][_0x5029('0x2b')],function(_0x4519c8){return{'name':_0x4519c8['fieldName'],'type':_0x4519c8[_0x5029('0x2c')]['key']};});_0x2a1ed6[_0x5029('0x2d')]=_['map'](_0x465153,'name');_0x2a1ed6[_0x5029('0x2e')]=_[_0x5029('0x2f')](_0x4434ff[_0x5029('0x2e')]);_0x2a1ed6['filters']=_[_0x5029('0x30')](_0x2a1ed6[_0x5029('0x2d')],_0x2a1ed6[_0x5029('0x2e')]);_0x196830[_0x5029('0x31')]=_[_0x5029('0x30')](_0x2a1ed6[_0x5029('0x2d')],qs[_0x5029('0x32')](_0x4434ff[_0x5029('0x2e')][_0x5029('0x32')]));_0x196830['attributes']=_0x196830[_0x5029('0x31')][_0x5029('0x33')]?_0x196830[_0x5029('0x31')]:_0x2a1ed6[_0x5029('0x2d')];if(!_0x4434ff['query'][_0x5029('0x34')](_0x5029('0x35'))){_0x196830[_0x5029('0x1b')]=qs['limit'](_0x4434ff['query'][_0x5029('0x1b')]);_0x196830[_0x5029('0x19')]=qs['offset'](_0x4434ff['query'][_0x5029('0x19')]);}_0x196830[_0x5029('0x36')]=qs[_0x5029('0x37')](_0x4434ff[_0x5029('0x2e')][_0x5029('0x37')]);_0x196830[_0x5029('0x38')]=qs[_0x5029('0x39')](_[_0x5029('0x3a')](_0x4434ff[_0x5029('0x2e')],_0x2a1ed6[_0x5029('0x39')]),_0x465153);if(_0x4434ff[_0x5029('0x2e')][_0x5029('0x3b')]){_0x196830[_0x5029('0x38')]=_[_0x5029('0x3c')](_0x196830['where'],{'$or':_['map'](_0x465153,function(_0x73797c){if(_0x73797c[_0x5029('0x2c')]!==_0x5029('0x3d')){var _0x48c9eb={};_0x48c9eb[_0x73797c[_0x5029('0x26')]]={'$like':'%'+_0x4434ff[_0x5029('0x2e')]['filter']+'%'};return _0x48c9eb;}})});}_0x196830=_[_0x5029('0x3c')]({},_0x196830,_0x4434ff['options']);var _0x506f0d={'where':_0x196830['where']};return db[_0x5029('0x2a')][_0x5029('0x1c')](_0x506f0d)[_0x5029('0x21')](function(_0x78768){_0x44255a[_0x5029('0x1c')]=_0x78768;if(_0x4434ff[_0x5029('0x2e')][_0x5029('0x3e')]){_0x196830[_0x5029('0x3f')]=[{'all':!![]}];}return db[_0x5029('0x2a')]['findAll'](_0x196830);})[_0x5029('0x21')](function(_0x236455){_0x44255a[_0x5029('0x40')]=_0x236455;return _0x44255a;})[_0x5029('0x21')](respondWithFilteredResult(_0x1c3dd9,_0x196830))[_0x5029('0x41')](handleError(_0x1c3dd9,null));};exports[_0x5029('0x42')]=function(_0x5658a7,_0x259db8){var _0xa1580a={'raw':!![],'where':{'id':_0x5658a7[_0x5029('0x43')]['id']}},_0x9434ed={};_0x9434ed[_0x5029('0x2d')]=_['keys'](db[_0x5029('0x2a')][_0x5029('0x2b')]);_0x9434ed[_0x5029('0x2e')]=_[_0x5029('0x2f')](_0x5658a7[_0x5029('0x2e')]);_0x9434ed[_0x5029('0x39')]=_[_0x5029('0x30')](_0x9434ed[_0x5029('0x2d')],_0x9434ed[_0x5029('0x2e')]);_0xa1580a['attributes']=_[_0x5029('0x30')](_0x9434ed[_0x5029('0x2d')],qs[_0x5029('0x32')](_0x5658a7[_0x5029('0x2e')]['fields']));_0xa1580a['attributes']=_0xa1580a[_0x5029('0x31')][_0x5029('0x33')]?_0xa1580a[_0x5029('0x31')]:_0x9434ed[_0x5029('0x2d')];if(_0x5658a7[_0x5029('0x2e')][_0x5029('0x3e')]){_0xa1580a[_0x5029('0x3f')]=[{'all':!![]}];}_0xa1580a=_[_0x5029('0x3c')]({},_0xa1580a,_0x5658a7[_0x5029('0x44')]);return db[_0x5029('0x2a')][_0x5029('0x45')](_0xa1580a)[_0x5029('0x21')](handleEntityNotFound(_0x259db8,null))[_0x5029('0x21')](respondWithResult(_0x259db8,null))[_0x5029('0x41')](handleError(_0x259db8,null));};exports[_0x5029('0x46')]=function(_0x175cc0,_0x10fc07){return db[_0x5029('0x2a')][_0x5029('0x46')](_0x175cc0[_0x5029('0x47')],{})[_0x5029('0x21')](function(_0x489457){var _0x1069c4=_0x175cc0['user'][_0x5029('0x22')]({'plain':!![]});if(!_0x1069c4)throw new Error(_0x5029('0x48'));if(_0x1069c4['role']==='user'){var _0x319bff=_0x489457['get']({'plain':!![]});var _0x4aaa43=_0x5029('0x49');return db[_0x5029('0x4a')][_0x5029('0x45')]({'where':{'name':_0x4aaa43,'userProfileId':_0x1069c4['userProfileId']},'raw':!![]})['then'](function(_0x1510bb){if(_0x1510bb&&_0x1510bb[_0x5029('0x4b')]===0x0){return db['UserProfileResource'][_0x5029('0x46')]({'name':_0x319bff['name'],'resourceId':_0x319bff['id'],'type':_0x5029('0x4c'),'sectionId':_0x1510bb['id']},{})['then'](function(){return _0x489457;});}else{return _0x489457;}})[_0x5029('0x41')](function(_0x27e1c0){logger[_0x5029('0x25')](_0x5029('0x4d'),_0x27e1c0);throw _0x27e1c0;});}return _0x489457;})[_0x5029('0x21')](respondWithResult(_0x10fc07,0xc9))[_0x5029('0x41')](handleError(_0x10fc07,null));};exports[_0x5029('0x20')]=function(_0xa25013,_0x586936){if(_0xa25013[_0x5029('0x47')]['id']){delete _0xa25013['body']['id'];}return db[_0x5029('0x2a')][_0x5029('0x45')]({'where':{'id':_0xa25013['params']['id']}})[_0x5029('0x21')](handleEntityNotFound(_0x586936,null))['then'](saveUpdates(_0xa25013['body'],null))['then'](respondWithResult(_0x586936,null))[_0x5029('0x41')](handleError(_0x586936,null));};exports['destroy']=function(_0x49d1db,_0x353ae4){return db[_0x5029('0x2a')]['find']({'where':{'id':_0x49d1db[_0x5029('0x43')]['id']}})['then'](handleEntityNotFound(_0x353ae4,null))['then'](removeEntity(_0x353ae4,null))[_0x5029('0x41')](handleError(_0x353ae4,null));};exports[_0x5029('0x4e')]=function(_0x81e39c,_0x448273){var _0x164179=0xa;var _0x4e8d9f=[_0x5029('0x4f'),_0x5029('0x50'),_0x5029('0x51'),_0x5029('0x52')];var _0x4dca54={'SUM':_0x5029('0x53'),'COUNT':_0x5029('0x54'),'COUNT DISTINCT':'COUNT(DISTINCT\x20%s)','MAX':'MAX(%s)','MIN':_0x5029('0x55'),'AVG':_0x5029('0x56'),'GROUP_CONCAT':_0x5029('0x57'),'GROUP_CONCAT ASC':_0x5029('0x58'),'GROUP_CONCAT DESC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)'};var _0x4208ab={'SEC_TO_TIME':_0x5029('0x59'),'DATE':_0x5029('0x5a'),'HOUR':_0x5029('0x5b'),'ROUND':_0x5029('0x5c'),'UNIX_TIMESTAMP':_0x5029('0x5d')};var _0x59a718=function(_0x560324){return!_[_0x5029('0x5e')]([_0x5029('0x5f'),_0x5029('0x60'),'IS\x20EMPTY',_0x5029('0x61')],_0x560324);};var _0x2d439a=function(_0x105638){if(!_0x105638||!_0x105638[_0x5029('0x62')][_0x5029('0x33')]){return'';}for(var _0x5264c6='(',_0x2ec5d0=0x0;_0x2ec5d0<_0x105638[_0x5029('0x62')][_0x5029('0x33')];_0x2ec5d0+=0x1){_0x2ec5d0>0x0&&(_0x5264c6+='\x20'+_0x105638['operator']+'\x20');_0x5264c6+=_0x105638[_0x5029('0x62')][_0x2ec5d0]['group']?_0x2d439a(_0x105638[_0x5029('0x62')][_0x2ec5d0]['group']):_0x105638[_0x5029('0x62')][_0x2ec5d0][_0x5029('0x63')]+'\x20'+_0x105638[_0x5029('0x62')][_0x2ec5d0][_0x5029('0x64')]+(_0x59a718(_0x105638[_0x5029('0x62')][_0x2ec5d0][_0x5029('0x64')])?'\x20'+_0x105638['rules'][_0x2ec5d0][_0x5029('0x65')]:'');}return _0x5264c6+')';};var _0x19220d={'where':{'id':_0x81e39c['params']['id']}},_0x1ff8df,_0x151562,_0x389700,_0x506f74,_0x13ca47;_0x19220d=_[_0x5029('0x3c')]({},_0x19220d,_0x81e39c['options']);return db[_0x5029('0x2a')]['find'](_0x19220d)[_0x5029('0x21')](function(_0x54daf9){if(_0x54daf9){_0x1ff8df=_0x54daf9;return _0x54daf9['getFields']();}return null;})[_0x5029('0x21')](function(_0x575f09){if(_0x575f09){if(!_0x575f09[_0x5029('0x33')]){throw new db[(_0x5029('0x66'))][(_0x5029('0x67'))]('Please\x20insert\x20at\x20least\x20one\x20field',0x193);}_0x151562=_0x575f09;return db[_0x5029('0x68')]['findAll']({'raw':!![]});}return null;})[_0x5029('0x21')](function(_0x255dfb){if(_0x255dfb){_0x389700=_[_0x5029('0x69')](_0x255dfb,'id');var _0x1cca02;var _0x1deed7=squel['select']();_0x1deed7[_0x5029('0x6a')](_0x1ff8df[_0x5029('0x6b')]);for(var _0x5890ac=0x0;_0x5890ac<_0x151562[_0x5029('0x33')];_0x5890ac+=0x1){_0x1cca02=_0x151562[_0x5890ac][_0x5029('0x6c')]?_0x389700[_0x151562[_0x5890ac][_0x5029('0x6c')]][_0x5029('0x6d')]:_0x151562[_0x5890ac][_0x5029('0x63')];_0x1cca02=_0x151562[_0x5890ac][_0x5029('0x6e')]?_['replace'](_0x4dca54[_0x151562[_0x5890ac]['function']],'%s',_0x1cca02):_0x1cca02;_0x1cca02=_0x151562[_0x5890ac][_0x5029('0x6f')]?_['replace'](_0x4208ab[_0x151562[_0x5890ac][_0x5029('0x6f')]],'%s',_0x1cca02):_0x1cca02;if(_0x151562[_0x5890ac][_0x5029('0x70')]){_0x1deed7['group'](_0x1cca02);}_0x151562[_0x5890ac][_0x5029('0x71')]&&_0x1deed7['order'](_0x1cca02,_0x151562[_0x5890ac]['orderBy']===_0x5029('0x72')?![]:!![]);_0x1deed7[_0x5029('0x63')](_0x1cca02,_0x151562[_0x5890ac][_0x5029('0x73')]||_0x1cca02);}if(_0x1ff8df[_0x5029('0x74')]){_0x1ff8df['joins']=JSON[_0x5029('0x75')](_0x1ff8df[_0x5029('0x74')]);for(var _0x4a2ce8=0x0;_0x4a2ce8<_0x1ff8df[_0x5029('0x74')][_0x5029('0x33')];_0x4a2ce8+=0x1){if(_0x1ff8df['joins'][_0x4a2ce8]['type']&&_['includes'](_0x4e8d9f,_0x1ff8df[_0x5029('0x74')][_0x4a2ce8][_0x5029('0x2c')])&&_0x1ff8df[_0x5029('0x74')][_0x4a2ce8][_0x5029('0x76')]&&_0x1ff8df[_0x5029('0x74')][_0x4a2ce8][_0x5029('0x77')]&&_0x1ff8df[_0x5029('0x74')][_0x4a2ce8][_0x5029('0x78')]){_0x1deed7[_0x1ff8df[_0x5029('0x74')][_0x4a2ce8]['type']](_0x1ff8df['joins'][_0x4a2ce8][_0x5029('0x77')],null,util[_0x5029('0x6f')](_0x5029('0x79'),_0x1ff8df[_0x5029('0x6b')],_0x1ff8df[_0x5029('0x74')][_0x4a2ce8][_0x5029('0x76')],_0x1ff8df[_0x5029('0x74')][_0x4a2ce8]['foreignTable'],_0x1ff8df[_0x5029('0x74')][_0x4a2ce8][_0x5029('0x78')]));}}}if(_0x1ff8df[_0x5029('0x7a')]){_0x1ff8df['conditions']=JSON[_0x5029('0x75')](_0x1ff8df[_0x5029('0x7a')]);_0x1deed7[_0x5029('0x38')](_0x2d439a(_0x1ff8df['conditions'][_0x5029('0x7b')]));}_0x13ca47=_0x1deed7[_0x5029('0x7c')]();_0x1deed7[_0x5029('0x1b')](_0x164179);_0x1deed7['offset'](0x0);logger[_0x5029('0x7d')](_0x5029('0x7e'),_0x1deed7['toString']());return dbH[_0x5029('0x7f')][_0x5029('0x2e')](_0x1deed7[_0x5029('0x80')](),{'type':dbH[_0x5029('0x7f')][_0x5029('0x81')]['SELECT']});}})[_0x5029('0x21')](respondWithResult(_0x448273,null))[_0x5029('0x41')](handleError(_0x448273,null));};function runReport(_0x426d70,_0xe6ac28,_0x153cdc){var _0x5e7f50=_0xe6ac28[_0x5029('0x26')];var _0x202c51=0xa;var _0x344203=['join',_0x5029('0x50'),_0x5029('0x51'),_0x5029('0x52')];var _0x3e47bd={'SUM':_0x5029('0x53'),'COUNT':_0x5029('0x54'),'COUNT DISTINCT':_0x5029('0x82'),'MAX':'MAX(%s)','MIN':_0x5029('0x55'),'AVG':_0x5029('0x56'),'GROUP_CONCAT':_0x5029('0x57'),'GROUP_CONCAT ASC':_0x5029('0x58'),'GROUP_CONCAT DESC':_0x5029('0x83')};var _0x4c40d1={'SEC_TO_TIME':_0x5029('0x59'),'DATE':_0x5029('0x5a'),'HOUR':_0x5029('0x5b'),'ROUND':'ROUND(%s)','UNIX_TIMESTAMP':_0x5029('0x5d')};var _0x41e2d8=function(_0x51098a){return!_['includes'](['IS\x20NULL',_0x5029('0x60'),_0x5029('0x84'),_0x5029('0x61')],_0x51098a);};var _0x4007c8=function(_0x3dc05a){if(!_0x3dc05a||!_0x3dc05a['rules'][_0x5029('0x33')]){return'';}for(var _0x2e4782='(',_0x2c0540=0x0;_0x2c0540<_0x3dc05a['rules']['length'];_0x2c0540+=0x1){_0x2c0540>0x0&&(_0x2e4782+='\x20'+_0x3dc05a[_0x5029('0x85')]+'\x20');_0x2e4782+=_0x3dc05a[_0x5029('0x62')][_0x2c0540][_0x5029('0x7b')]?_0x4007c8(_0x3dc05a[_0x5029('0x62')][_0x2c0540]['group']):_0x3dc05a[_0x5029('0x62')][_0x2c0540][_0x5029('0x63')]+'\x20'+_0x3dc05a[_0x5029('0x62')][_0x2c0540][_0x5029('0x64')]+(_0x41e2d8(_0x3dc05a[_0x5029('0x62')][_0x2c0540][_0x5029('0x64')])?'\x20'+_0x3dc05a[_0x5029('0x62')][_0x2c0540][_0x5029('0x65')]:'');}return _0x2e4782+')';};var _0x5aecc2={'where':{'id':_0x426d70['id']}},_0x159450,_0x556c7a,_0x48bbe2,_0x3e3150,_0x533ee2;_0x5aecc2=_[_0x5029('0x3c')]({},_0x5aecc2,_0x153cdc);return db[_0x5029('0x2a')][_0x5029('0x45')](_0x5aecc2)[_0x5029('0x21')](function(_0x1b6f4c){if(_0x1b6f4c){_0x159450=_0x1b6f4c;return _0x1b6f4c[_0x5029('0x86')]();}return null;})[_0x5029('0x21')](function(_0x1d6092){if(_0x1d6092){if(!_0x1d6092['length']){throw new db['Sequelize'][(_0x5029('0x67'))]('Please\x20insert\x20at\x20least\x20one\x20field',0x193);}_0x556c7a=_0x1d6092;return db['AnalyticMetric'][_0x5029('0x87')]({'raw':!![]});}return null;})['then'](function(_0x4b25ed){if(_0x4b25ed){_0x48bbe2=_[_0x5029('0x69')](_0x4b25ed,'id');var _0xb8da0b;var _0x13e07e=squel[_0x5029('0x88')]();_0x13e07e[_0x5029('0x6a')](_0x159450['table']);for(var _0x38c02a=0x0;_0x38c02a<_0x556c7a[_0x5029('0x33')];_0x38c02a+=0x1){_0xb8da0b=_0x556c7a[_0x38c02a][_0x5029('0x6c')]?_0x48bbe2[_0x556c7a[_0x38c02a]['MetricId']][_0x5029('0x6d')]:_0x556c7a[_0x38c02a][_0x5029('0x63')];_0xb8da0b=_0x556c7a[_0x38c02a][_0x5029('0x6e')]?_[_0x5029('0x89')](_0x3e47bd[_0x556c7a[_0x38c02a][_0x5029('0x6e')]],'%s',_0xb8da0b):_0xb8da0b;_0xb8da0b=_0x556c7a[_0x38c02a]['format']?_['replace'](_0x4c40d1[_0x556c7a[_0x38c02a][_0x5029('0x6f')]],'%s',_0xb8da0b):_0xb8da0b;if(_0x556c7a[_0x38c02a][_0x5029('0x70')]){_0x13e07e['group'](_0xb8da0b);}_0x556c7a[_0x38c02a][_0x5029('0x71')]&&_0x13e07e[_0x5029('0x36')](_0xb8da0b,_0x556c7a[_0x38c02a][_0x5029('0x71')]===_0x5029('0x72')?![]:!![]);_0x13e07e[_0x5029('0x63')](_0xb8da0b,_0x556c7a[_0x38c02a][_0x5029('0x73')]||_0xb8da0b);}if(_0x159450[_0x5029('0x74')]){_0x159450[_0x5029('0x74')]=JSON['parse'](_0x159450['joins']);for(var _0x4243c3=0x0;_0x4243c3<_0x159450['joins'][_0x5029('0x33')];_0x4243c3+=0x1){if(_0x159450['joins'][_0x4243c3][_0x5029('0x2c')]&&_[_0x5029('0x5e')](_0x344203,_0x159450[_0x5029('0x74')][_0x4243c3]['type'])&&_0x159450[_0x5029('0x74')][_0x4243c3][_0x5029('0x76')]&&_0x159450[_0x5029('0x74')][_0x4243c3]['foreignTable']&&_0x159450[_0x5029('0x74')][_0x4243c3][_0x5029('0x78')]){_0x13e07e[_0x159450[_0x5029('0x74')][_0x4243c3][_0x5029('0x2c')]](_0x159450[_0x5029('0x74')][_0x4243c3][_0x5029('0x77')],null,util[_0x5029('0x6f')](_0x5029('0x79'),_0x159450[_0x5029('0x6b')],_0x159450[_0x5029('0x74')][_0x4243c3][_0x5029('0x76')],_0x159450[_0x5029('0x74')][_0x4243c3][_0x5029('0x77')],_0x159450[_0x5029('0x74')][_0x4243c3][_0x5029('0x78')]));}}}if(_0x159450[_0x5029('0x7a')]){_0x159450[_0x5029('0x7a')]=JSON[_0x5029('0x75')](_0x159450['conditions']);_0x13e07e[_0x5029('0x38')](_0x4007c8(_0x159450[_0x5029('0x7a')][_0x5029('0x7b')]));}_0x533ee2=_0x13e07e[_0x5029('0x7c')]();_0x13e07e[_0x5029('0x1b')](_0x202c51);_0x13e07e['offset'](0x0);return;}})[_0x5029('0x21')](function(){if(_0xe6ac28[_0x5029('0x8a')]===_0x5029('0x8b')){return null;}var _0xf7729c=_[_0x5029('0x3c')](_0xe6ac28,{'name':_0xe6ac28['fullPath']||_0xe6ac28[_0x5029('0x26')]||_0x159450[_0x5029('0x26')],'basename':_0x5e7f50,'savename':util[_0x5029('0x6f')](_0x5029('0x8c'),_0xe6ac28[_0x5029('0x26')]||_0x159450['name'],require(_0x5029('0x8d'))[_0x5029('0x8e')](0x4),_0xe6ac28[_0x5029('0x8a')]||_0x5029('0x8f')),'reportId':_0x159450['id'],'reportType':_0x5029('0x90')});return db[_0x5029('0x91')][_0x5029('0x46')](_0xf7729c,{'raw':!![]});})[_0x5029('0x21')](function(_0x4a7535){if(_0x159450['table']===_0x5029('0x92')){_0x533ee2[_0x5029('0x38')](_0x159450[_0x5029('0x6b')]+_0x5029('0x93'),_0xe6ac28[_0x5029('0x94')],_0xe6ac28['endDate']);}else{_0x533ee2[_0x5029('0x38')](_0x159450['table']+_0x5029('0x95'),_0xe6ac28[_0x5029('0x94')],_0xe6ac28[_0x5029('0x96')]);}if(_0x4a7535){logger[_0x5029('0x97')](_0x5029('0x98'),_0x533ee2[_0x5029('0x80')]());require('child_process')[_0x5029('0x99')](path[_0x5029('0x4f')](__dirname,'../../components/export/',_0x4a7535[_0x5029('0x8a')]),[_0x4a7535['id'],_0x533ee2[_0x5029('0x80')](),path['join'](__dirname,_0x5029('0x9a'),_0x4a7535['savename']),_0x5e7f50]);return _0x4a7535;}else{var _0x54c0f3=squel['select']();_0x54c0f3['from']('('+_0x533ee2[_0x5029('0x80')]()+')','countTable');_0x54c0f3[_0x5029('0x63')](_0x5029('0x9b'),'count');_0x533ee2[_0x5029('0x1b')](_0xe6ac28[_0x5029('0x1b')]||_0x202c51);_0x533ee2['offset'](_0xe6ac28[_0x5029('0x19')]||0x0);return dbH[_0x5029('0x7f')]['query'](_0x54c0f3[_0x5029('0x80')](),{'type':dbH[_0x5029('0x7f')]['QueryTypes'][_0x5029('0x9c')]})[_0x5029('0x21')](function(_0x17c755){if(!_0x17c755[_0x5029('0x33')]){_0x3e3150=0x0;}else{_0x3e3150=_0x17c755[0x0][_0x5029('0x1c')]||0x0;}return dbH[_0x5029('0x7f')]['query'](_0x533ee2[_0x5029('0x80')](),{'type':dbH['sequelize'][_0x5029('0x81')][_0x5029('0x9c')]});})[_0x5029('0x21')](function(_0x3ebe00){return{'rows':_0x3ebe00||[],'count':_0x3e3150};});}});}exports[_0x5029('0x9d')]=function(_0x2138cc,_0x331af8){return runReport(_0x2138cc[_0x5029('0x43')],_0x2138cc[_0x5029('0x2e')],_0x2138cc[_0x5029('0x44')])[_0x5029('0x21')](respondWithResult(_0x331af8,null))[_0x5029('0x41')](handleError(_0x331af8,null));};exports[_0x5029('0x9e')]=runReport;exports[_0x5029('0x2e')]=function(_0x9de076,_0x2ac88e){var _0x55ee4f=0xa;var _0x1fa9eb=[_0x5029('0x4f'),_0x5029('0x50'),_0x5029('0x51'),_0x5029('0x52')];var _0x405d47={'SUM':'SUM(%s)','COUNT':_0x5029('0x54'),'COUNT DISTINCT':_0x5029('0x82'),'MAX':_0x5029('0x9f'),'MIN':_0x5029('0x55'),'AVG':_0x5029('0x56'),'GROUP_CONCAT':'GROUP_CONCAT(%s)','GROUP_CONCAT ASC':_0x5029('0x58'),'GROUP_CONCAT DESC':_0x5029('0x83')};var _0x29c3a2={'SEC_TO_TIME':_0x5029('0x59'),'DATE':_0x5029('0x5a'),'HOUR':_0x5029('0x5b'),'ROUND':_0x5029('0x5c'),'UNIX_TIMESTAMP':_0x5029('0x5d')};var _0xb39e9d=function(_0x124c5e){return!_['includes']([_0x5029('0x5f'),'IS\x20NOT\x20NULL',_0x5029('0x84'),_0x5029('0x61')],_0x124c5e);};var _0x120acc=function(_0x21bb22){if(!_0x21bb22||!_0x21bb22['rules'][_0x5029('0x33')]){return'';}for(var _0x339112='(',_0x5d7c1a=0x0;_0x5d7c1a<_0x21bb22[_0x5029('0x62')][_0x5029('0x33')];_0x5d7c1a+=0x1){_0x5d7c1a>0x0&&(_0x339112+='\x20'+_0x21bb22['operator']+'\x20');_0x339112+=_0x21bb22[_0x5029('0x62')][_0x5d7c1a][_0x5029('0x7b')]?_0x120acc(_0x21bb22['rules'][_0x5d7c1a]['group']):_0x21bb22[_0x5029('0x62')][_0x5d7c1a]['field']+'\x20'+_0x21bb22['rules'][_0x5d7c1a][_0x5029('0x64')]+(_0xb39e9d(_0x21bb22['rules'][_0x5d7c1a][_0x5029('0x64')])?'\x20'+_0x21bb22[_0x5029('0x62')][_0x5d7c1a]['value']:'');}return _0x339112+')';};var _0x327299={'where':{'id':_0x9de076['params']['id']}},_0x3463cc,_0x590cc2,_0x3ac39a,_0x37c47b,_0x62e4af;_0x327299=_[_0x5029('0x3c')]({},_0x327299,_0x9de076['options']);return db[_0x5029('0x2a')][_0x5029('0x45')](_0x327299)[_0x5029('0x21')](function(_0x5e7ec8){if(_0x5e7ec8){_0x3463cc=_0x5e7ec8;return _0x5e7ec8[_0x5029('0x86')]();}return null;})[_0x5029('0x21')](function(_0x5aa480){if(_0x5aa480){if(!_0x5aa480[_0x5029('0x33')]){throw new db[(_0x5029('0x66'))]['ValidationErrorItem']('Please\x20insert\x20at\x20least\x20one\x20field',0x193);}_0x590cc2=_0x5aa480;return db[_0x5029('0x68')][_0x5029('0x87')]({'raw':!![]});}return null;})['then'](function(_0x5842a5){if(_0x5842a5){_0x3ac39a=_['keyBy'](_0x5842a5,'id');var _0x313bdb;var _0x1d38e0=squel[_0x5029('0x88')]();_0x1d38e0['from'](_0x3463cc[_0x5029('0x6b')]);for(var _0x581237=0x0;_0x581237<_0x590cc2[_0x5029('0x33')];_0x581237+=0x1){_0x313bdb=_0x590cc2[_0x581237]['MetricId']?_0x3ac39a[_0x590cc2[_0x581237]['MetricId']]['metric']:_0x590cc2[_0x581237]['field'];_0x313bdb=_0x590cc2[_0x581237][_0x5029('0x6e')]?_[_0x5029('0x89')](_0x405d47[_0x590cc2[_0x581237][_0x5029('0x6e')]],'%s',_0x313bdb):_0x313bdb;_0x313bdb=_0x590cc2[_0x581237][_0x5029('0x6f')]?_[_0x5029('0x89')](_0x29c3a2[_0x590cc2[_0x581237]['format']],'%s',_0x313bdb):_0x313bdb;if(_0x590cc2[_0x581237][_0x5029('0x70')]){_0x1d38e0[_0x5029('0x7b')](_0x313bdb);}_0x590cc2[_0x581237][_0x5029('0x71')]&&_0x1d38e0[_0x5029('0x36')](_0x313bdb,_0x590cc2[_0x581237][_0x5029('0x71')]===_0x5029('0x72')?![]:!![]);_0x1d38e0['field'](_0x313bdb,_0x590cc2[_0x581237][_0x5029('0x73')]||_0x313bdb);}if(_0x3463cc[_0x5029('0x74')]){_0x3463cc[_0x5029('0x74')]=JSON['parse'](_0x3463cc['joins']);for(var _0xd05bc9=0x0;_0xd05bc9<_0x3463cc[_0x5029('0x74')][_0x5029('0x33')];_0xd05bc9+=0x1){if(_0x3463cc[_0x5029('0x74')][_0xd05bc9][_0x5029('0x2c')]&&_[_0x5029('0x5e')](_0x1fa9eb,_0x3463cc[_0x5029('0x74')][_0xd05bc9][_0x5029('0x2c')])&&_0x3463cc['joins'][_0xd05bc9][_0x5029('0x76')]&&_0x3463cc[_0x5029('0x74')][_0xd05bc9][_0x5029('0x77')]&&_0x3463cc['joins'][_0xd05bc9][_0x5029('0x78')]){_0x1d38e0[_0x3463cc['joins'][_0xd05bc9][_0x5029('0x2c')]](_0x3463cc[_0x5029('0x74')][_0xd05bc9][_0x5029('0x77')],null,util[_0x5029('0x6f')](_0x5029('0x79'),_0x3463cc[_0x5029('0x6b')],_0x3463cc[_0x5029('0x74')][_0xd05bc9][_0x5029('0x76')],_0x3463cc['joins'][_0xd05bc9]['foreignTable'],_0x3463cc['joins'][_0xd05bc9][_0x5029('0x78')]));}}}if(_0x3463cc[_0x5029('0x7a')]){_0x3463cc[_0x5029('0x7a')]=JSON[_0x5029('0x75')](_0x3463cc[_0x5029('0x7a')]);_0x1d38e0['where'](_0x120acc(_0x3463cc[_0x5029('0x7a')][_0x5029('0x7b')]));}_0x62e4af=_0x1d38e0[_0x5029('0x7c')]();_0x1d38e0[_0x5029('0x1b')](_0x55ee4f);_0x1d38e0[_0x5029('0x19')](0x0);logger['debug'](_0x5029('0x7e'),_0x1d38e0[_0x5029('0x80')]());return dbH[_0x5029('0x7f')][_0x5029('0x2e')](_0x1d38e0[_0x5029('0x80')](),{'type':dbH[_0x5029('0x7f')][_0x5029('0x81')][_0x5029('0x9c')]});}})[_0x5029('0x21')](function(){return{'sql':_0x62e4af[_0x5029('0x80')]()};})[_0x5029('0x21')](respondWithResult(_0x2ac88e,null))[_0x5029('0x41')](handleError(_0x2ac88e,null));};
\ No newline at end of file
diff --git a/server/api/analyticDefaultReport/analyticDefaultReport.model.js b/server/api/analyticDefaultReport/analyticDefaultReport.model.js
index f1243ee..01dee0e 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 _0x231c=['../../config/logger','bluebird','request-promise','path','rimraf','../../config/environment','./analyticDefaultReport.attributes','exports','define','AnalyticDefaultReport','analytics_default_reports','lodash'];(function(_0x1ebfa0,_0x5c4047){var _0x4fd00c=function(_0x574d19){while(--_0x574d19){_0x1ebfa0['push'](_0x1ebfa0['shift']());}};_0x4fd00c(++_0x5c4047);}(_0x231c,0x197));var _0xc231=function(_0x4683ba,_0x2e8b9e){_0x4683ba=_0x4683ba-0x0;var _0x1e060e=_0x231c[_0x4683ba];return _0x1e060e;};'use strict';var _=require(_0xc231('0x0'));var util=require('util');var logger=require(_0xc231('0x1'))('api');var moment=require('moment');var BPromise=require(_0xc231('0x2'));var rp=require(_0xc231('0x3'));var fs=require('fs');var path=require(_0xc231('0x4'));var rimraf=require(_0xc231('0x5'));var config=require(_0xc231('0x6'));var attributes=require(_0xc231('0x7'));module[_0xc231('0x8')]=function(_0x2b6060,_0x22129a){return _0x2b6060[_0xc231('0x9')](_0xc231('0xa'),attributes,{'tableName':_0xc231('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xc647=['util','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./analyticDefaultReport.attributes','exports','define','AnalyticDefaultReport','analytics_default_reports'];(function(_0x1972e6,_0x19b7ae){var _0x31da35=function(_0x131336){while(--_0x131336){_0x1972e6['push'](_0x1972e6['shift']());}};_0x31da35(++_0x19b7ae);}(_0xc647,0x1ba));var _0x7c64=function(_0x484e36,_0x4482d8){_0x484e36=_0x484e36-0x0;var _0xafc85d=_0xc647[_0x484e36];return _0xafc85d;};'use strict';var _=require('lodash');var util=require(_0x7c64('0x0'));var logger=require('../../config/logger')(_0x7c64('0x1'));var moment=require(_0x7c64('0x2'));var BPromise=require(_0x7c64('0x3'));var rp=require(_0x7c64('0x4'));var fs=require('fs');var path=require(_0x7c64('0x5'));var rimraf=require(_0x7c64('0x6'));var config=require(_0x7c64('0x7'));var attributes=require(_0x7c64('0x8'));module[_0x7c64('0x9')]=function(_0xbd2e5,_0x107211){return _0xbd2e5[_0x7c64('0xa')](_0x7c64('0xb'),attributes,{'tableName':_0x7c64('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
diff --git a/server/api/analyticDefaultReport/analyticDefaultReport.rpc.js b/server/api/analyticDefaultReport/analyticDefaultReport.rpc.js
index d420789..223a034 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 _0x7c0f=['../../config/logger','rpc','../../config/environment','jayson/promise','request','then','info','request\x20sent','debug','AnalyticDefaultReport,\x20%s,\x20%s,\x20%s','stringify','error','code','AnalyticDefaultReport,\x20%s,\x20%s','message','result','catch','lodash','moment','bluebird','ioredis','../../config/utils'];(function(_0x1e9810,_0x31acc9){var _0x52a26d=function(_0x92b7e3){while(--_0x92b7e3){_0x1e9810['push'](_0x1e9810['shift']());}};_0x52a26d(++_0x31acc9);}(_0x7c0f,0x187));var _0xf7c0=function(_0x4bde24,_0x91cda4){_0x4bde24=_0x4bde24-0x0;var _0x2efb95=_0x7c0f[_0x4bde24];return _0x2efb95;};'use strict';var _=require(_0xf7c0('0x0'));var util=require('util');var moment=require(_0xf7c0('0x1'));var BPromise=require(_0xf7c0('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xf7c0('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0xf7c0('0x4'));var logger=require(_0xf7c0('0x5'))(_0xf7c0('0x6'));var config=require(_0xf7c0('0x7'));var jayson=require(_0xf7c0('0x8'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x4d90d9,_0x3ea663,_0x360cfb){return new BPromise(function(_0x109574,_0x587c22){return client[_0xf7c0('0x9')](_0x4d90d9,_0x360cfb)[_0xf7c0('0xa')](function(_0x141550){logger[_0xf7c0('0xb')]('AnalyticDefaultReport,\x20%s,\x20%s',_0x3ea663,_0xf7c0('0xc'));logger[_0xf7c0('0xd')](_0xf7c0('0xe'),_0x3ea663,_0xf7c0('0xc'),JSON[_0xf7c0('0xf')](_0x141550));if(_0x141550['error']){if(_0x141550[_0xf7c0('0x10')][_0xf7c0('0x11')]===0x1f4){logger[_0xf7c0('0x10')](_0xf7c0('0x12'),_0x3ea663,_0x141550[_0xf7c0('0x10')][_0xf7c0('0x13')]);return _0x587c22(_0x141550[_0xf7c0('0x10')]['message']);}logger[_0xf7c0('0x10')](_0xf7c0('0x12'),_0x3ea663,_0x141550[_0xf7c0('0x10')][_0xf7c0('0x13')]);return _0x109574(_0x141550[_0xf7c0('0x10')][_0xf7c0('0x13')]);}else{logger[_0xf7c0('0xb')]('AnalyticDefaultReport,\x20%s,\x20%s',_0x3ea663,_0xf7c0('0xc'));_0x109574(_0x141550[_0xf7c0('0x14')]['message']);}})[_0xf7c0('0x15')](function(_0x4989dc){logger[_0xf7c0('0x10')]('AnalyticDefaultReport,\x20%s,\x20%s',_0x3ea663,_0x4989dc);_0x587c22(_0x4989dc);});});}
\ No newline at end of file
+var _0xa124=['catch','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','request','info','AnalyticDefaultReport,\x20%s,\x20%s','debug','AnalyticDefaultReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','request\x20sent','result'];(function(_0x5847af,_0x20ec5a){var _0x388b22=function(_0x35ceb4){while(--_0x35ceb4){_0x5847af['push'](_0x5847af['shift']());}};_0x388b22(++_0x20ec5a);}(_0xa124,0x1cd));var _0x4a12=function(_0x470f24,_0x2436a9){_0x470f24=_0x470f24-0x0;var _0x2c6fc8=_0xa124[_0x470f24];return _0x2c6fc8;};'use strict';var _=require('lodash');var util=require(_0x4a12('0x0'));var moment=require(_0x4a12('0x1'));var BPromise=require(_0x4a12('0x2'));var rs=require(_0x4a12('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x4a12('0x4'))['db'];var utils=require(_0x4a12('0x5'));var logger=require(_0x4a12('0x6'))(_0x4a12('0x7'));var config=require(_0x4a12('0x8'));var jayson=require('jayson/promise');var client=jayson[_0x4a12('0x9')][_0x4a12('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x645ac8,_0x570641,_0xa4ee12){return new BPromise(function(_0x10f0f1,_0x2a01c0){return client[_0x4a12('0xb')](_0x645ac8,_0xa4ee12)['then'](function(_0x2b31a8){logger[_0x4a12('0xc')](_0x4a12('0xd'),_0x570641,'request\x20sent');logger[_0x4a12('0xe')](_0x4a12('0xf'),_0x570641,'request\x20sent',JSON[_0x4a12('0x10')](_0x2b31a8));if(_0x2b31a8['error']){if(_0x2b31a8[_0x4a12('0x11')][_0x4a12('0x12')]===0x1f4){logger['error'](_0x4a12('0xd'),_0x570641,_0x2b31a8[_0x4a12('0x11')][_0x4a12('0x13')]);return _0x2a01c0(_0x2b31a8[_0x4a12('0x11')]['message']);}logger[_0x4a12('0x11')](_0x4a12('0xd'),_0x570641,_0x2b31a8[_0x4a12('0x11')]['message']);return _0x10f0f1(_0x2b31a8['error'][_0x4a12('0x13')]);}else{logger[_0x4a12('0xc')](_0x4a12('0xd'),_0x570641,_0x4a12('0x14'));_0x10f0f1(_0x2b31a8[_0x4a12('0x15')][_0x4a12('0x13')]);}})[_0x4a12('0x16')](function(_0x403d18){logger[_0x4a12('0x11')](_0x4a12('0xd'),_0x570641,_0x403d18);_0x2a01c0(_0x403d18);});});}
\ No newline at end of file
diff --git a/server/api/analyticDefaultReport/index.js b/server/api/analyticDefaultReport/index.js
index 4a07ba7..4a434b2 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 _0xf8ae=['Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./analyticDefaultReport.controller','get','isAuthenticated','index','/:id','/:id/preview','preview','/:id/run','run','query','post','create','put','update','delete','destroy','exports','multer','util','connect-timeout','express'];(function(_0x50a0c2,_0x4befab){var _0x5ebadd=function(_0x3a3342){while(--_0x3a3342){_0x50a0c2['push'](_0x50a0c2['shift']());}};_0x5ebadd(++_0x4befab);}(_0xf8ae,0x168));var _0xef8a=function(_0x2b719f,_0x532745){_0x2b719f=_0x2b719f-0x0;var _0x37c8e8=_0xf8ae[_0x2b719f];return _0x37c8e8;};'use strict';var multer=require(_0xef8a('0x0'));var util=require(_0xef8a('0x1'));var path=require('path');var timeout=require(_0xef8a('0x2'));var express=require(_0xef8a('0x3'));var router=express[_0xef8a('0x4')]();var fs_extra=require(_0xef8a('0x5'));var auth=require(_0xef8a('0x6'));var interaction=require(_0xef8a('0x7'));var config=require(_0xef8a('0x8'));var controller=require(_0xef8a('0x9'));router[_0xef8a('0xa')]('/',auth[_0xef8a('0xb')](),controller[_0xef8a('0xc')]);router[_0xef8a('0xa')](_0xef8a('0xd'),auth[_0xef8a('0xb')](),controller['show']);router['get'](_0xef8a('0xe'),auth[_0xef8a('0xb')](),controller[_0xef8a('0xf')]);router['get'](_0xef8a('0x10'),auth[_0xef8a('0xb')](),controller[_0xef8a('0x11')]);router['get']('/:id/query',auth[_0xef8a('0xb')](),controller[_0xef8a('0x12')]);router[_0xef8a('0x13')]('/',auth[_0xef8a('0xb')](),controller[_0xef8a('0x14')]);router[_0xef8a('0x15')]('/:id',auth[_0xef8a('0xb')](),controller[_0xef8a('0x16')]);router[_0xef8a('0x17')](_0xef8a('0xd'),auth['isAuthenticated'](),controller[_0xef8a('0x18')]);module[_0xef8a('0x19')]=router;
\ No newline at end of file
+var _0x4644=['index','/:id','show','/:id/preview','preview','/:id/run','run','/:id/query','post','create','put','update','destroy','exports','multer','util','connect-timeout','express','Router','../../components/interaction/service','../../config/environment','./analyticDefaultReport.controller','get','isAuthenticated'];(function(_0x40a045,_0x516f0e){var _0x1a687c=function(_0x48c9fe){while(--_0x48c9fe){_0x40a045['push'](_0x40a045['shift']());}};_0x1a687c(++_0x516f0e);}(_0x4644,0x176));var _0x4464=function(_0x254899,_0x31bcde){_0x254899=_0x254899-0x0;var _0x7dd7b4=_0x4644[_0x254899];return _0x7dd7b4;};'use strict';var multer=require(_0x4464('0x0'));var util=require(_0x4464('0x1'));var path=require('path');var timeout=require(_0x4464('0x2'));var express=require(_0x4464('0x3'));var router=express[_0x4464('0x4')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0x4464('0x5'));var config=require(_0x4464('0x6'));var controller=require(_0x4464('0x7'));router[_0x4464('0x8')]('/',auth[_0x4464('0x9')](),controller[_0x4464('0xa')]);router[_0x4464('0x8')](_0x4464('0xb'),auth[_0x4464('0x9')](),controller[_0x4464('0xc')]);router['get'](_0x4464('0xd'),auth[_0x4464('0x9')](),controller[_0x4464('0xe')]);router['get'](_0x4464('0xf'),auth[_0x4464('0x9')](),controller[_0x4464('0x10')]);router['get'](_0x4464('0x11'),auth['isAuthenticated'](),controller['query']);router[_0x4464('0x12')]('/',auth[_0x4464('0x9')](),controller[_0x4464('0x13')]);router[_0x4464('0x14')](_0x4464('0xb'),auth[_0x4464('0x9')](),controller[_0x4464('0x15')]);router['delete'](_0x4464('0xb'),auth['isAuthenticated'](),controller[_0x4464('0x16')]);module[_0x4464('0x17')]=router;
\ No newline at end of file
diff --git a/server/api/analyticExtractedReport/analyticExtractedReport.attributes.js b/server/api/analyticExtractedReport/analyticExtractedReport.attributes.js
index 0871923..103c0b4 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 _0xd526=['csv','pdf','xlsx','DATE','Loading','manual','scheduled','UNSIGNED','moment','STRING','ENUM'];(function(_0x222df7,_0x3e073f){var _0x2cceae=function(_0x5e69ef){while(--_0x5e69ef){_0x222df7['push'](_0x222df7['shift']());}};_0x2cceae(++_0x3e073f);}(_0xd526,0xce));var _0x6d52=function(_0x6131cd,_0x4c26a1){_0x6131cd=_0x6131cd-0x0;var _0x47e916=_0xd526[_0x6131cd];return _0x47e916;};'use strict';var Sequelize=require('sequelize');var moment=require(_0x6d52('0x0'));module['exports']={'name':{'type':Sequelize['STRING'],'allowNull':![]},'basename':{'type':Sequelize[_0x6d52('0x1')],'allowNull':![]},'output':{'type':Sequelize[_0x6d52('0x2')](_0x6d52('0x3'),_0x6d52('0x4'),_0x6d52('0x5')),'allowNull':![],'defaultValue':_0x6d52('0x3')},'savename':{'type':Sequelize[_0x6d52('0x1')],'allowNull':![]},'startDate':{'type':Sequelize[_0x6d52('0x6')]},'endDate':{'type':Sequelize[_0x6d52('0x6')]},'status':{'type':Sequelize[_0x6d52('0x1')],'defaultValue':_0x6d52('0x7')},'type':{'type':Sequelize[_0x6d52('0x2')](_0x6d52('0x8'),_0x6d52('0x9')),'allowNull':![],'defaultValue':_0x6d52('0x8')},'reportId':{'type':Sequelize['INTEGER'](0xb)[_0x6d52('0xa')]},'reportType':{'type':Sequelize[_0x6d52('0x1')]}};
\ No newline at end of file
+var _0xd8c5=['STRING','csv','xlsx','DATE','Loading','ENUM','manual','scheduled','UNSIGNED','moment','exports'];(function(_0x396533,_0x53e4ac){var _0x2c4c93=function(_0x3fcb9b){while(--_0x3fcb9b){_0x396533['push'](_0x396533['shift']());}};_0x2c4c93(++_0x53e4ac);}(_0xd8c5,0x1d7));var _0x5d8c=function(_0x435953,_0x4b6280){_0x435953=_0x435953-0x0;var _0x78e0c=_0xd8c5[_0x435953];return _0x78e0c;};'use strict';var Sequelize=require('sequelize');var moment=require(_0x5d8c('0x0'));module[_0x5d8c('0x1')]={'name':{'type':Sequelize[_0x5d8c('0x2')],'allowNull':![]},'basename':{'type':Sequelize[_0x5d8c('0x2')],'allowNull':![]},'output':{'type':Sequelize['ENUM'](_0x5d8c('0x3'),'pdf',_0x5d8c('0x4')),'allowNull':![],'defaultValue':_0x5d8c('0x3')},'savename':{'type':Sequelize['STRING'],'allowNull':![]},'startDate':{'type':Sequelize[_0x5d8c('0x5')]},'endDate':{'type':Sequelize['DATE']},'status':{'type':Sequelize[_0x5d8c('0x2')],'defaultValue':_0x5d8c('0x6')},'type':{'type':Sequelize[_0x5d8c('0x7')](_0x5d8c('0x8'),_0x5d8c('0x9')),'allowNull':![],'defaultValue':'manual'},'reportId':{'type':Sequelize['INTEGER'](0xb)[_0x5d8c('0xa')]},'reportType':{'type':Sequelize[_0x5d8c('0x2')]}};
\ No newline at end of file
diff --git a/server/api/analyticExtractedReport/analyticExtractedReport.controller.js b/server/api/analyticExtractedReport/analyticExtractedReport.controller.js
index fc0764b..0fcb08a 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 _0xa6ea=['savename','output','join','Sequelize','ValidationError','Report\x20not\x20found\x20or\x20empty','exists','format','%s.%s','eml-format','rimraf','zip-dir','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','querystring','papaparse','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/environment','../../config/license/util','sendStatus','status','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','then','get','UserProfileResource','name','send','index','AnalyticExtractedReport','rawAttributes','fieldName','type','model','map','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','order','sort','where','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','ExtractedReports','UserProfileSection','userProfileId','autoAssociation','params','destroy','download','basename'];(function(_0x4d8ed9,_0x2ae284){var _0x1e2140=function(_0x9cca89){while(--_0x9cca89){_0x4d8ed9['push'](_0x4d8ed9['shift']());}};_0x1e2140(++_0x2ae284);}(_0xa6ea,0xc1));var _0xaa6e=function(_0x43bd81,_0x141189){_0x43bd81=_0x43bd81-0x0;var _0x5f0148=_0xa6ea[_0x43bd81];return _0x5f0148;};'use strict';var emlformat=require(_0xaa6e('0x0'));var rimraf=require(_0xaa6e('0x1'));var zipdir=require(_0xaa6e('0x2'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0xaa6e('0x3'));var BPromise=require(_0xaa6e('0x4'));var Mustache=require(_0xaa6e('0x5'));var util=require(_0xaa6e('0x6'));var path=require(_0xaa6e('0x7'));var sox=require(_0xaa6e('0x8'));var csv=require(_0xaa6e('0x9'));var ejs=require(_0xaa6e('0xa'));var fs=require('fs');var fs_extra=require(_0xaa6e('0xb'));var _=require(_0xaa6e('0xc'));var squel=require(_0xaa6e('0xd'));var crypto=require('crypto');var jsforce=require(_0xaa6e('0xe'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0xaa6e('0xf'));var Papa=require(_0xaa6e('0x10'));var Redis=require('ioredis');var authService=require(_0xaa6e('0x11'));var qs=require('../../components/parsers/qs');var as=require(_0xaa6e('0x12'));var hardwareService=require(_0xaa6e('0x13'));var logger=require('../../config/logger')(_0xaa6e('0x14'));var utils=require('../../config/utils');var config=require(_0xaa6e('0x15'));var licenseUtil=require(_0xaa6e('0x16'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x7881c2,_0x48625c){_0x48625c=_0x48625c||0xcc;return function(_0x409830){if(_0x409830){return _0x7881c2[_0xaa6e('0x17')](_0x48625c);}return _0x7881c2[_0xaa6e('0x18')](_0x48625c)['end']();};}function respondWithResult(_0x13fd6f,_0x59a129){_0x59a129=_0x59a129||0xc8;return function(_0x25f44f){if(_0x25f44f){return _0x13fd6f[_0xaa6e('0x18')](_0x59a129)[_0xaa6e('0x19')](_0x25f44f);}};}function respondWithFilteredResult(_0x109c76,_0x5f4762){return function(_0x4ae8eb){if(_0x4ae8eb){var _0x533029=typeof _0x5f4762[_0xaa6e('0x1a')]===_0xaa6e('0x1b')&&typeof _0x5f4762[_0xaa6e('0x1c')]===_0xaa6e('0x1b');var _0x265908=_0x4ae8eb[_0xaa6e('0x1d')];var _0x48f044=_0x533029?0x0:_0x5f4762[_0xaa6e('0x1a')];var _0x579510=_0x533029?_0x4ae8eb[_0xaa6e('0x1d')]:_0x5f4762['offset']+_0x5f4762['limit'];var _0x3f8f4b;if(_0x579510>=_0x265908){_0x579510=_0x265908;_0x3f8f4b=0xc8;}else{_0x3f8f4b=0xce;}_0x109c76[_0xaa6e('0x18')](_0x3f8f4b);return _0x109c76[_0xaa6e('0x1e')](_0xaa6e('0x1f'),_0x48f044+'-'+_0x579510+'/'+_0x265908)['json'](_0x4ae8eb);}return null;};}function patchUpdates(_0x392413){return function(_0x3c41b1){try{jsonpatch[_0xaa6e('0x20')](_0x3c41b1,_0x392413,!![]);}catch(_0x3644f7){return BPromise[_0xaa6e('0x21')](_0x3644f7);}return _0x3c41b1[_0xaa6e('0x22')]();};}function saveUpdates(_0x52c89f,_0x49b465){return function(_0x46e6b7){if(_0x46e6b7){return _0x46e6b7[_0xaa6e('0x23')](_0x52c89f)[_0xaa6e('0x24')](function(_0x1d5c59){return _0x1d5c59;});}return null;};}function removeEntity(_0xa25acb,_0x5b0bca){return function(_0x5b2140){if(_0x5b2140){return _0x5b2140['destroy']()[_0xaa6e('0x24')](function(){var _0x3e8e35=_0x5b2140[_0xaa6e('0x25')]({'plain':!![]});var _0x49bc47='ExtractedReports';return db[_0xaa6e('0x26')]['destroy']({'where':{'type':_0x49bc47,'resourceId':_0x3e8e35['id']}})['then'](function(){return _0x5b2140;});})[_0xaa6e('0x24')](function(){_0xa25acb['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x5c6eee,_0x2ce130){return function(_0x491f18){if(!_0x491f18){_0x5c6eee[_0xaa6e('0x17')](0x194);}return _0x491f18;};}function handleError(_0x2ec4fa,_0x4209e5){_0x4209e5=_0x4209e5||0x1f4;return function(_0x121ecf){logger['error'](_0x121ecf['stack']);if(_0x121ecf[_0xaa6e('0x27')]){delete _0x121ecf['name'];}_0x2ec4fa[_0xaa6e('0x18')](_0x4209e5)[_0xaa6e('0x28')](_0x121ecf);};}exports[_0xaa6e('0x29')]=function(_0x3accd9,_0x5d8db1){var _0x745b80={},_0x293d0e={},_0x442f45={'count':0x0,'rows':[]};var _0x405556=_['map'](db[_0xaa6e('0x2a')][_0xaa6e('0x2b')],function(_0x4dce89){return{'name':_0x4dce89[_0xaa6e('0x2c')],'type':_0x4dce89[_0xaa6e('0x2d')]['key']};});_0x293d0e[_0xaa6e('0x2e')]=_[_0xaa6e('0x2f')](_0x405556,_0xaa6e('0x27'));_0x293d0e['query']=_[_0xaa6e('0x30')](_0x3accd9[_0xaa6e('0x31')]);_0x293d0e[_0xaa6e('0x32')]=_[_0xaa6e('0x33')](_0x293d0e[_0xaa6e('0x2e')],_0x293d0e[_0xaa6e('0x31')]);_0x745b80[_0xaa6e('0x34')]=_[_0xaa6e('0x33')](_0x293d0e[_0xaa6e('0x2e')],qs[_0xaa6e('0x35')](_0x3accd9[_0xaa6e('0x31')][_0xaa6e('0x35')]));_0x745b80[_0xaa6e('0x34')]=_0x745b80[_0xaa6e('0x34')][_0xaa6e('0x36')]?_0x745b80[_0xaa6e('0x34')]:_0x293d0e[_0xaa6e('0x2e')];if(!_0x3accd9[_0xaa6e('0x31')][_0xaa6e('0x37')]('nolimit')){_0x745b80['limit']=qs['limit'](_0x3accd9[_0xaa6e('0x31')][_0xaa6e('0x1c')]);_0x745b80['offset']=qs['offset'](_0x3accd9['query'][_0xaa6e('0x1a')]);}_0x745b80[_0xaa6e('0x38')]=qs[_0xaa6e('0x39')](_0x3accd9[_0xaa6e('0x31')][_0xaa6e('0x39')]);_0x745b80[_0xaa6e('0x3a')]=qs[_0xaa6e('0x32')](_['pick'](_0x3accd9[_0xaa6e('0x31')],_0x293d0e['filters']),_0x405556);if(_0x3accd9[_0xaa6e('0x31')][_0xaa6e('0x3b')]){_0x745b80[_0xaa6e('0x3a')]=_[_0xaa6e('0x3c')](_0x745b80[_0xaa6e('0x3a')],{'$or':_[_0xaa6e('0x2f')](_0x405556,function(_0x6bd6b6){if(_0x6bd6b6[_0xaa6e('0x2d')]!==_0xaa6e('0x3d')){var _0xf13f28={};_0xf13f28[_0x6bd6b6[_0xaa6e('0x27')]]={'$like':'%'+_0x3accd9[_0xaa6e('0x31')][_0xaa6e('0x3b')]+'%'};return _0xf13f28;}})});}_0x745b80=_[_0xaa6e('0x3c')]({},_0x745b80,_0x3accd9[_0xaa6e('0x3e')]);var _0x4866a5={'where':_0x745b80['where']};return db[_0xaa6e('0x2a')][_0xaa6e('0x1d')](_0x4866a5)[_0xaa6e('0x24')](function(_0x25ac16){_0x442f45[_0xaa6e('0x1d')]=_0x25ac16;if(_0x3accd9['query'][_0xaa6e('0x3f')]){_0x745b80[_0xaa6e('0x40')]=[{'all':!![]}];}return db[_0xaa6e('0x2a')][_0xaa6e('0x41')](_0x745b80);})[_0xaa6e('0x24')](function(_0x185411){_0x442f45[_0xaa6e('0x42')]=_0x185411;return _0x442f45;})[_0xaa6e('0x24')](respondWithFilteredResult(_0x5d8db1,_0x745b80))[_0xaa6e('0x43')](handleError(_0x5d8db1,null));};exports[_0xaa6e('0x44')]=function(_0x499ca5,_0x4e9633){var _0x21d716={'raw':!![],'where':{'id':_0x499ca5['params']['id']}},_0x23703c={};_0x23703c[_0xaa6e('0x2e')]=_[_0xaa6e('0x30')](db[_0xaa6e('0x2a')]['rawAttributes']);_0x23703c['query']=_['keys'](_0x499ca5[_0xaa6e('0x31')]);_0x23703c['filters']=_[_0xaa6e('0x33')](_0x23703c[_0xaa6e('0x2e')],_0x23703c[_0xaa6e('0x31')]);_0x21d716['attributes']=_[_0xaa6e('0x33')](_0x23703c[_0xaa6e('0x2e')],qs[_0xaa6e('0x35')](_0x499ca5[_0xaa6e('0x31')]['fields']));_0x21d716[_0xaa6e('0x34')]=_0x21d716[_0xaa6e('0x34')][_0xaa6e('0x36')]?_0x21d716[_0xaa6e('0x34')]:_0x23703c['model'];if(_0x499ca5[_0xaa6e('0x31')]['includeAll']){_0x21d716[_0xaa6e('0x40')]=[{'all':!![]}];}_0x21d716=_[_0xaa6e('0x3c')]({},_0x21d716,_0x499ca5[_0xaa6e('0x3e')]);return db[_0xaa6e('0x2a')][_0xaa6e('0x45')](_0x21d716)[_0xaa6e('0x24')](handleEntityNotFound(_0x4e9633,null))['then'](respondWithResult(_0x4e9633,null))['catch'](handleError(_0x4e9633,null));};exports[_0xaa6e('0x46')]=function(_0x5ed2e5,_0x35d7f0){return db[_0xaa6e('0x2a')][_0xaa6e('0x46')](_0x5ed2e5[_0xaa6e('0x47')],{})['then'](function(_0x59c79f){var _0x572b3a=_0x5ed2e5[_0xaa6e('0x48')][_0xaa6e('0x25')]({'plain':!![]});if(!_0x572b3a)throw new Error(_0xaa6e('0x49'));if(_0x572b3a[_0xaa6e('0x4a')]===_0xaa6e('0x48')){var _0x17427f=_0x59c79f[_0xaa6e('0x25')]({'plain':!![]});var _0x20aafe=_0xaa6e('0x4b');return db[_0xaa6e('0x4c')]['find']({'where':{'name':_0x20aafe,'userProfileId':_0x572b3a[_0xaa6e('0x4d')]},'raw':!![]})[_0xaa6e('0x24')](function(_0x5ec41b){if(_0x5ec41b&&_0x5ec41b[_0xaa6e('0x4e')]===0x0){return db[_0xaa6e('0x26')][_0xaa6e('0x46')]({'name':_0x17427f[_0xaa6e('0x27')],'resourceId':_0x17427f['id'],'type':_0x5ec41b[_0xaa6e('0x27')],'sectionId':_0x5ec41b['id']},{})['then'](function(){return _0x59c79f;});}else{return _0x59c79f;}})[_0xaa6e('0x43')](function(_0xf046ed){logger['error']('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0xf046ed);throw _0xf046ed;});}return _0x59c79f;})['then'](respondWithResult(_0x35d7f0,0xc9))['catch'](handleError(_0x35d7f0,null));};exports[_0xaa6e('0x23')]=function(_0x6013e5,_0x241fb5){if(_0x6013e5['body']['id']){delete _0x6013e5[_0xaa6e('0x47')]['id'];}return db[_0xaa6e('0x2a')][_0xaa6e('0x45')]({'where':{'id':_0x6013e5[_0xaa6e('0x4f')]['id']}})['then'](handleEntityNotFound(_0x241fb5,null))['then'](saveUpdates(_0x6013e5['body'],null))[_0xaa6e('0x24')](respondWithResult(_0x241fb5,null))['catch'](handleError(_0x241fb5,null));};exports[_0xaa6e('0x50')]=function(_0x85ca37,_0x1be362){return db[_0xaa6e('0x2a')][_0xaa6e('0x45')]({'where':{'id':_0x85ca37['params']['id']}})[_0xaa6e('0x24')](handleEntityNotFound(_0x1be362,null))[_0xaa6e('0x24')](removeEntity(_0x1be362,null))[_0xaa6e('0x43')](handleError(_0x1be362,null));};exports[_0xaa6e('0x51')]=function(_0x4f38ab,_0x217f94,_0x2629f8){return db[_0xaa6e('0x2a')][_0xaa6e('0x45')]({'where':{'id':_0x4f38ab[_0xaa6e('0x4f')]['id']},'attributes':['name',_0xaa6e('0x52'),_0xaa6e('0x53'),_0xaa6e('0x54')],'raw':!![]})['then'](handleEntityNotFound(_0x217f94,null))['then'](function(_0x22ac28){if(_0x22ac28){if(!fs['existsSync'](path[_0xaa6e('0x55')](config['root'],'server/files/reports',_0x22ac28['savename']))){throw new db[(_0xaa6e('0x56'))][(_0xaa6e('0x57'))](_0xaa6e('0x58'));}if(_0x4f38ab[_0xaa6e('0x31')][_0xaa6e('0x59')]){return _0x217f94[_0xaa6e('0x17')](0xc8);}return _0x217f94[_0xaa6e('0x51')](path[_0xaa6e('0x55')](config['root'],'server/files/reports',_0x22ac28[_0xaa6e('0x53')]),util[_0xaa6e('0x5a')](_0xaa6e('0x5b'),_0x22ac28['basename']||_0x22ac28[_0xaa6e('0x27')],_0x22ac28[_0xaa6e('0x54')]['toLowerCase']()));}})['catch'](handleError(_0x217f94,null));};
\ No newline at end of file
+var _0x7300=['fields','attributes','hasOwnProperty','nolimit','order','sort','where','pick','filter','VIRTUAL','merge','options','includeAll','include','rows','catch','show','length','find','create','body','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','params','basename','savename','output','existsSync','join','root','server/files/reports','Sequelize','Report\x20not\x20found\x20or\x20empty','download','format','%s.%s','toLowerCase','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','querystring','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','sendStatus','status','json','offset','undefined','limit','count','set','Content-Range','reject','update','destroy','then','ExtractedReports','end','error','stack','name','send','map','AnalyticExtractedReport','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection'];(function(_0x92706d,_0x5e096c){var _0x15a7eb=function(_0x621d78){while(--_0x621d78){_0x92706d['push'](_0x92706d['shift']());}};_0x15a7eb(++_0x5e096c);}(_0x7300,0x14d));var _0x0730=function(_0x3abc16,_0x241b20){_0x3abc16=_0x3abc16-0x0;var _0x1c834f=_0x7300[_0x3abc16];return _0x1c834f;};'use strict';var emlformat=require(_0x0730('0x0'));var rimraf=require(_0x0730('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x0730('0x2'));var rp=require(_0x0730('0x3'));var moment=require(_0x0730('0x4'));var BPromise=require(_0x0730('0x5'));var Mustache=require(_0x0730('0x6'));var util=require(_0x0730('0x7'));var path=require(_0x0730('0x8'));var sox=require('sox');var csv=require(_0x0730('0x9'));var ejs=require(_0x0730('0xa'));var fs=require('fs');var fs_extra=require(_0x0730('0xb'));var _=require(_0x0730('0xc'));var squel=require(_0x0730('0xd'));var crypto=require(_0x0730('0xe'));var jsforce=require(_0x0730('0xf'));var deskjs=require('desk.js');var toCsv=require(_0x0730('0x9'));var querystring=require(_0x0730('0x10'));var Papa=require('papaparse');var Redis=require(_0x0730('0x11'));var authService=require(_0x0730('0x12'));var qs=require('../../components/parsers/qs');var as=require(_0x0730('0x13'));var hardwareService=require(_0x0730('0x14'));var logger=require(_0x0730('0x15'))(_0x0730('0x16'));var utils=require(_0x0730('0x17'));var config=require(_0x0730('0x18'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x21a553,_0x45c920){_0x45c920=_0x45c920||0xcc;return function(_0x4e4a87){if(_0x4e4a87){return _0x21a553[_0x0730('0x19')](_0x45c920);}return _0x21a553[_0x0730('0x1a')](_0x45c920)['end']();};}function respondWithResult(_0x106cb7,_0xd0a885){_0xd0a885=_0xd0a885||0xc8;return function(_0xc09d19){if(_0xc09d19){return _0x106cb7[_0x0730('0x1a')](_0xd0a885)[_0x0730('0x1b')](_0xc09d19);}};}function respondWithFilteredResult(_0x3ff557,_0x1c9154){return function(_0xca3eb6){if(_0xca3eb6){var _0x2ca670=typeof _0x1c9154[_0x0730('0x1c')]===_0x0730('0x1d')&&typeof _0x1c9154[_0x0730('0x1e')]==='undefined';var _0x2c4211=_0xca3eb6[_0x0730('0x1f')];var _0x2b2738=_0x2ca670?0x0:_0x1c9154[_0x0730('0x1c')];var _0x35ade7=_0x2ca670?_0xca3eb6[_0x0730('0x1f')]:_0x1c9154['offset']+_0x1c9154[_0x0730('0x1e')];var _0x127b86;if(_0x35ade7>=_0x2c4211){_0x35ade7=_0x2c4211;_0x127b86=0xc8;}else{_0x127b86=0xce;}_0x3ff557[_0x0730('0x1a')](_0x127b86);return _0x3ff557[_0x0730('0x20')](_0x0730('0x21'),_0x2b2738+'-'+_0x35ade7+'/'+_0x2c4211)[_0x0730('0x1b')](_0xca3eb6);}return null;};}function patchUpdates(_0x1c30a4){return function(_0x42d171){try{jsonpatch['apply'](_0x42d171,_0x1c30a4,!![]);}catch(_0x1c6b95){return BPromise[_0x0730('0x22')](_0x1c6b95);}return _0x42d171['save']();};}function saveUpdates(_0x2c2917,_0x51dc27){return function(_0x1df631){if(_0x1df631){return _0x1df631[_0x0730('0x23')](_0x2c2917)['then'](function(_0x184848){return _0x184848;});}return null;};}function removeEntity(_0x27b09b,_0x698344){return function(_0x1cd1b2){if(_0x1cd1b2){return _0x1cd1b2[_0x0730('0x24')]()[_0x0730('0x25')](function(){var _0x49db7b=_0x1cd1b2['get']({'plain':!![]});var _0x1d2ab7=_0x0730('0x26');return db['UserProfileResource'][_0x0730('0x24')]({'where':{'type':_0x1d2ab7,'resourceId':_0x49db7b['id']}})['then'](function(){return _0x1cd1b2;});})[_0x0730('0x25')](function(){_0x27b09b[_0x0730('0x1a')](0xcc)[_0x0730('0x27')]();});}};}function handleEntityNotFound(_0x5f4d8e,_0x3ad95f){return function(_0x518376){if(!_0x518376){_0x5f4d8e[_0x0730('0x19')](0x194);}return _0x518376;};}function handleError(_0x1d775a,_0x17d146){_0x17d146=_0x17d146||0x1f4;return function(_0xc767f){logger[_0x0730('0x28')](_0xc767f[_0x0730('0x29')]);if(_0xc767f[_0x0730('0x2a')]){delete _0xc767f[_0x0730('0x2a')];}_0x1d775a[_0x0730('0x1a')](_0x17d146)[_0x0730('0x2b')](_0xc767f);};}exports['index']=function(_0x45b24f,_0x35f615){var _0x3170ad={},_0x57eda1={},_0x3083f3={'count':0x0,'rows':[]};var _0x2c6b07=_[_0x0730('0x2c')](db[_0x0730('0x2d')][_0x0730('0x2e')],function(_0x9197af){return{'name':_0x9197af[_0x0730('0x2f')],'type':_0x9197af[_0x0730('0x30')][_0x0730('0x31')]};});_0x57eda1[_0x0730('0x32')]=_[_0x0730('0x2c')](_0x2c6b07,_0x0730('0x2a'));_0x57eda1[_0x0730('0x33')]=_[_0x0730('0x34')](_0x45b24f[_0x0730('0x33')]);_0x57eda1[_0x0730('0x35')]=_[_0x0730('0x36')](_0x57eda1[_0x0730('0x32')],_0x57eda1[_0x0730('0x33')]);_0x3170ad['attributes']=_[_0x0730('0x36')](_0x57eda1[_0x0730('0x32')],qs[_0x0730('0x37')](_0x45b24f[_0x0730('0x33')]['fields']));_0x3170ad[_0x0730('0x38')]=_0x3170ad[_0x0730('0x38')]['length']?_0x3170ad[_0x0730('0x38')]:_0x57eda1['model'];if(!_0x45b24f[_0x0730('0x33')][_0x0730('0x39')](_0x0730('0x3a'))){_0x3170ad['limit']=qs[_0x0730('0x1e')](_0x45b24f['query'][_0x0730('0x1e')]);_0x3170ad[_0x0730('0x1c')]=qs[_0x0730('0x1c')](_0x45b24f['query'][_0x0730('0x1c')]);}_0x3170ad[_0x0730('0x3b')]=qs[_0x0730('0x3c')](_0x45b24f[_0x0730('0x33')][_0x0730('0x3c')]);_0x3170ad[_0x0730('0x3d')]=qs['filters'](_[_0x0730('0x3e')](_0x45b24f[_0x0730('0x33')],_0x57eda1['filters']),_0x2c6b07);if(_0x45b24f[_0x0730('0x33')][_0x0730('0x3f')]){_0x3170ad[_0x0730('0x3d')]=_['merge'](_0x3170ad[_0x0730('0x3d')],{'$or':_['map'](_0x2c6b07,function(_0x4afd7d){if(_0x4afd7d['type']!==_0x0730('0x40')){var _0x35177d={};_0x35177d[_0x4afd7d[_0x0730('0x2a')]]={'$like':'%'+_0x45b24f['query'][_0x0730('0x3f')]+'%'};return _0x35177d;}})});}_0x3170ad=_[_0x0730('0x41')]({},_0x3170ad,_0x45b24f[_0x0730('0x42')]);var _0xacf5ca={'where':_0x3170ad['where']};return db[_0x0730('0x2d')][_0x0730('0x1f')](_0xacf5ca)['then'](function(_0x164a72){_0x3083f3[_0x0730('0x1f')]=_0x164a72;if(_0x45b24f['query'][_0x0730('0x43')]){_0x3170ad[_0x0730('0x44')]=[{'all':!![]}];}return db[_0x0730('0x2d')]['findAll'](_0x3170ad);})['then'](function(_0x6dc19d){_0x3083f3[_0x0730('0x45')]=_0x6dc19d;return _0x3083f3;})[_0x0730('0x25')](respondWithFilteredResult(_0x35f615,_0x3170ad))[_0x0730('0x46')](handleError(_0x35f615,null));};exports[_0x0730('0x47')]=function(_0x51098f,_0x47387b){var _0xdb7142={'raw':!![],'where':{'id':_0x51098f['params']['id']}},_0x403050={};_0x403050['model']=_[_0x0730('0x34')](db[_0x0730('0x2d')]['rawAttributes']);_0x403050[_0x0730('0x33')]=_['keys'](_0x51098f['query']);_0x403050[_0x0730('0x35')]=_[_0x0730('0x36')](_0x403050['model'],_0x403050[_0x0730('0x33')]);_0xdb7142[_0x0730('0x38')]=_['intersection'](_0x403050[_0x0730('0x32')],qs[_0x0730('0x37')](_0x51098f['query'][_0x0730('0x37')]));_0xdb7142[_0x0730('0x38')]=_0xdb7142[_0x0730('0x38')][_0x0730('0x48')]?_0xdb7142[_0x0730('0x38')]:_0x403050[_0x0730('0x32')];if(_0x51098f[_0x0730('0x33')][_0x0730('0x43')]){_0xdb7142[_0x0730('0x44')]=[{'all':!![]}];}_0xdb7142=_[_0x0730('0x41')]({},_0xdb7142,_0x51098f['options']);return db[_0x0730('0x2d')][_0x0730('0x49')](_0xdb7142)['then'](handleEntityNotFound(_0x47387b,null))[_0x0730('0x25')](respondWithResult(_0x47387b,null))[_0x0730('0x46')](handleError(_0x47387b,null));};exports[_0x0730('0x4a')]=function(_0x40abdc,_0x2ca559){return db[_0x0730('0x2d')][_0x0730('0x4a')](_0x40abdc[_0x0730('0x4b')],{})[_0x0730('0x25')](function(_0x2e7197){var _0x4c2520=_0x40abdc[_0x0730('0x4c')][_0x0730('0x4d')]({'plain':!![]});if(!_0x4c2520)throw new Error(_0x0730('0x4e'));if(_0x4c2520[_0x0730('0x4f')]===_0x0730('0x4c')){var _0xffc871=_0x2e7197[_0x0730('0x4d')]({'plain':!![]});var _0x288163=_0x0730('0x26');return db[_0x0730('0x50')][_0x0730('0x49')]({'where':{'name':_0x288163,'userProfileId':_0x4c2520[_0x0730('0x51')]},'raw':!![]})[_0x0730('0x25')](function(_0xa3aa9b){if(_0xa3aa9b&&_0xa3aa9b['autoAssociation']===0x0){return db['UserProfileResource'][_0x0730('0x4a')]({'name':_0xffc871[_0x0730('0x2a')],'resourceId':_0xffc871['id'],'type':_0xa3aa9b[_0x0730('0x2a')],'sectionId':_0xa3aa9b['id']},{})[_0x0730('0x25')](function(){return _0x2e7197;});}else{return _0x2e7197;}})[_0x0730('0x46')](function(_0x282d33){logger[_0x0730('0x28')](_0x0730('0x52'),_0x282d33);throw _0x282d33;});}return _0x2e7197;})[_0x0730('0x25')](respondWithResult(_0x2ca559,0xc9))[_0x0730('0x46')](handleError(_0x2ca559,null));};exports[_0x0730('0x23')]=function(_0x582681,_0x26d240){if(_0x582681[_0x0730('0x4b')]['id']){delete _0x582681[_0x0730('0x4b')]['id'];}return db[_0x0730('0x2d')]['find']({'where':{'id':_0x582681['params']['id']}})[_0x0730('0x25')](handleEntityNotFound(_0x26d240,null))['then'](saveUpdates(_0x582681[_0x0730('0x4b')],null))[_0x0730('0x25')](respondWithResult(_0x26d240,null))[_0x0730('0x46')](handleError(_0x26d240,null));};exports[_0x0730('0x24')]=function(_0x4d28e6,_0x1558e1){return db['AnalyticExtractedReport'][_0x0730('0x49')]({'where':{'id':_0x4d28e6[_0x0730('0x53')]['id']}})['then'](handleEntityNotFound(_0x1558e1,null))['then'](removeEntity(_0x1558e1,null))[_0x0730('0x46')](handleError(_0x1558e1,null));};exports['download']=function(_0x3d0357,_0x739519,_0x28d44d){return db['AnalyticExtractedReport']['find']({'where':{'id':_0x3d0357['params']['id']},'attributes':[_0x0730('0x2a'),_0x0730('0x54'),_0x0730('0x55'),_0x0730('0x56')],'raw':!![]})[_0x0730('0x25')](handleEntityNotFound(_0x739519,null))[_0x0730('0x25')](function(_0x38cb74){if(_0x38cb74){if(!fs[_0x0730('0x57')](path[_0x0730('0x58')](config[_0x0730('0x59')],_0x0730('0x5a'),_0x38cb74['savename']))){throw new db[(_0x0730('0x5b'))]['ValidationError'](_0x0730('0x5c'));}if(_0x3d0357[_0x0730('0x33')]['exists']){return _0x739519['sendStatus'](0xc8);}return _0x739519[_0x0730('0x5d')](path[_0x0730('0x58')](config['root'],_0x0730('0x5a'),_0x38cb74[_0x0730('0x55')]),util[_0x0730('0x5e')](_0x0730('0x5f'),_0x38cb74[_0x0730('0x54')]||_0x38cb74[_0x0730('0x2a')],_0x38cb74[_0x0730('0x56')][_0x0730('0x60')]()));}})[_0x0730('0x46')](handleError(_0x739519,null));};
\ No newline at end of file
diff --git a/server/api/analyticExtractedReport/analyticExtractedReport.model.js b/server/api/analyticExtractedReport/analyticExtractedReport.model.js
index 796e56e..d3f3016 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 _0x882b=['analytics_extracted_reports','lodash','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','./analyticExtractedReport.attributes','exports'];(function(_0x1d18f8,_0x2ba9d2){var _0x29865b=function(_0x10ab45){while(--_0x10ab45){_0x1d18f8['push'](_0x1d18f8['shift']());}};_0x29865b(++_0x2ba9d2);}(_0x882b,0x64));var _0xb882=function(_0x1035c1,_0x2d8583){_0x1035c1=_0x1035c1-0x0;var _0x308d67=_0x882b[_0x1035c1];return _0x308d67;};'use strict';var _=require(_0xb882('0x0'));var util=require('util');var logger=require(_0xb882('0x1'))(_0xb882('0x2'));var moment=require(_0xb882('0x3'));var BPromise=require(_0xb882('0x4'));var rp=require(_0xb882('0x5'));var fs=require('fs');var path=require(_0xb882('0x6'));var rimraf=require(_0xb882('0x7'));var config=require('../../config/environment');var attributes=require(_0xb882('0x8'));module[_0xb882('0x9')]=function(_0x27073d,_0x2a97d5){return _0x27073d['define']('AnalyticExtractedReport',attributes,{'tableName':_0xb882('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x0fc0=['./analyticExtractedReport.attributes','exports','define','lodash','util','../../config/logger','api','moment','request-promise','rimraf','../../config/environment'];(function(_0x5015ed,_0x2a7e06){var _0x247709=function(_0x24081d){while(--_0x24081d){_0x5015ed['push'](_0x5015ed['shift']());}};_0x247709(++_0x2a7e06);}(_0x0fc0,0x100));var _0x00fc=function(_0x4e676e,_0x2a7c6d){_0x4e676e=_0x4e676e-0x0;var _0x336a3c=_0x0fc0[_0x4e676e];return _0x336a3c;};'use strict';var _=require(_0x00fc('0x0'));var util=require(_0x00fc('0x1'));var logger=require(_0x00fc('0x2'))(_0x00fc('0x3'));var moment=require(_0x00fc('0x4'));var BPromise=require('bluebird');var rp=require(_0x00fc('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x00fc('0x6'));var config=require(_0x00fc('0x7'));var attributes=require(_0x00fc('0x8'));module[_0x00fc('0x9')]=function(_0x478adf,_0x2cb748){return _0x478adf[_0x00fc('0xa')]('AnalyticExtractedReport',attributes,{'tableName':'analytics_extracted_reports','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
diff --git a/server/api/analyticExtractedReport/analyticExtractedReport.rpc.js b/server/api/analyticExtractedReport/analyticExtractedReport.rpc.js
index 24c573d..e6acd7e 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 _0xe097=['request','AnalyticExtractedReport,\x20%s,\x20%s','AnalyticExtractedReport,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','info','result','lodash','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','jayson/promise','client','http'];(function(_0xd13a88,_0x3c5269){var _0x1c993c=function(_0x245af5){while(--_0x245af5){_0xd13a88['push'](_0xd13a88['shift']());}};_0x1c993c(++_0x3c5269);}(_0xe097,0x186));var _0x7e09=function(_0x28ded1,_0x6c21ef){_0x28ded1=_0x28ded1-0x0;var _0x3ea86e=_0xe097[_0x28ded1];return _0x3ea86e;};'use strict';var _=require(_0x7e09('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0x7e09('0x1'));var rs=require(_0x7e09('0x2'));var fs=require('fs');var Redis=require(_0x7e09('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x7e09('0x4'));var logger=require(_0x7e09('0x5'))(_0x7e09('0x6'));var config=require('../../config/environment');var jayson=require(_0x7e09('0x7'));var client=jayson[_0x7e09('0x8')][_0x7e09('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x216fc0,_0x2f2698,_0x11bd93){return new BPromise(function(_0x49cac2,_0x50c0da){return client[_0x7e09('0xa')](_0x216fc0,_0x11bd93)['then'](function(_0x35c1af){logger['info'](_0x7e09('0xb'),_0x2f2698,'request\x20sent');logger['debug'](_0x7e09('0xc'),_0x2f2698,_0x7e09('0xd'),JSON[_0x7e09('0xe')](_0x35c1af));if(_0x35c1af[_0x7e09('0xf')]){if(_0x35c1af[_0x7e09('0xf')][_0x7e09('0x10')]===0x1f4){logger[_0x7e09('0xf')]('AnalyticExtractedReport,\x20%s,\x20%s',_0x2f2698,_0x35c1af[_0x7e09('0xf')][_0x7e09('0x11')]);return _0x50c0da(_0x35c1af[_0x7e09('0xf')]['message']);}logger[_0x7e09('0xf')](_0x7e09('0xb'),_0x2f2698,_0x35c1af[_0x7e09('0xf')][_0x7e09('0x11')]);return _0x49cac2(_0x35c1af[_0x7e09('0xf')][_0x7e09('0x11')]);}else{logger[_0x7e09('0x12')]('AnalyticExtractedReport,\x20%s,\x20%s',_0x2f2698,'request\x20sent');_0x49cac2(_0x35c1af[_0x7e09('0x13')][_0x7e09('0x11')]);}})['catch'](function(_0x51737a){logger['error'](_0x7e09('0xb'),_0x2f2698,_0x51737a);_0x50c0da(_0x51737a);});});}
\ No newline at end of file
+var _0x95e4=['../../config/logger','../../config/environment','jayson/promise','client','http','request','then','info','AnalyticExtractedReport,\x20%s,\x20%s','request\x20sent','debug','AnalyticExtractedReport,\x20%s,\x20%s,\x20%s','error','code','message','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils'];(function(_0x582f72,_0x886d8){var _0x4cd5fe=function(_0x4ac1c7){while(--_0x4ac1c7){_0x582f72['push'](_0x582f72['shift']());}};_0x4cd5fe(++_0x886d8);}(_0x95e4,0xb1));var _0x495e=function(_0x1d19e0,_0x2b106f){_0x1d19e0=_0x1d19e0-0x0;var _0x10a66d=_0x95e4[_0x1d19e0];return _0x10a66d;};'use strict';var _=require(_0x495e('0x0'));var util=require(_0x495e('0x1'));var moment=require(_0x495e('0x2'));var BPromise=require(_0x495e('0x3'));var rs=require(_0x495e('0x4'));var fs=require('fs');var Redis=require(_0x495e('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0x495e('0x6'));var logger=require(_0x495e('0x7'))('rpc');var config=require(_0x495e('0x8'));var jayson=require(_0x495e('0x9'));var client=jayson[_0x495e('0xa')][_0x495e('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x502bb1,_0x373fb3,_0x2721c9){return new BPromise(function(_0x3bead3,_0x184b71){return client[_0x495e('0xc')](_0x502bb1,_0x2721c9)[_0x495e('0xd')](function(_0x531ba6){logger[_0x495e('0xe')](_0x495e('0xf'),_0x373fb3,_0x495e('0x10'));logger[_0x495e('0x11')](_0x495e('0x12'),_0x373fb3,'request\x20sent',JSON['stringify'](_0x531ba6));if(_0x531ba6[_0x495e('0x13')]){if(_0x531ba6['error'][_0x495e('0x14')]===0x1f4){logger[_0x495e('0x13')]('AnalyticExtractedReport,\x20%s,\x20%s',_0x373fb3,_0x531ba6[_0x495e('0x13')][_0x495e('0x15')]);return _0x184b71(_0x531ba6['error'][_0x495e('0x15')]);}logger[_0x495e('0x13')](_0x495e('0xf'),_0x373fb3,_0x531ba6['error'][_0x495e('0x15')]);return _0x3bead3(_0x531ba6[_0x495e('0x13')][_0x495e('0x15')]);}else{logger[_0x495e('0xe')]('AnalyticExtractedReport,\x20%s,\x20%s',_0x373fb3,_0x495e('0x10'));_0x3bead3(_0x531ba6['result'][_0x495e('0x15')]);}})[_0x495e('0x16')](function(_0x107be9){logger[_0x495e('0x13')]('AnalyticExtractedReport,\x20%s,\x20%s',_0x373fb3,_0x107be9);_0x184b71(_0x107be9);});});}
\ No newline at end of file
diff --git a/server/api/analyticExtractedReport/index.js b/server/api/analyticExtractedReport/index.js
index c69289b..0bd70ee 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 _0x6e20=['index','isAuthenticated','show','/:id/download','download','post','create','/:id','update','delete','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./analyticExtractedReport.controller','get'];(function(_0x5098f3,_0x32a027){var _0x28557e=function(_0x43aeca){while(--_0x43aeca){_0x5098f3['push'](_0x5098f3['shift']());}};_0x28557e(++_0x32a027);}(_0x6e20,0xac));var _0x06e2=function(_0x2b7764,_0x2606f1){_0x2b7764=_0x2b7764-0x0;var _0x848dcb=_0x6e20[_0x2b7764];return _0x848dcb;};'use strict';var multer=require(_0x06e2('0x0'));var util=require(_0x06e2('0x1'));var path=require(_0x06e2('0x2'));var timeout=require(_0x06e2('0x3'));var express=require(_0x06e2('0x4'));var router=express[_0x06e2('0x5')]();var fs_extra=require(_0x06e2('0x6'));var auth=require(_0x06e2('0x7'));var interaction=require(_0x06e2('0x8'));var config=require(_0x06e2('0x9'));var controller=require(_0x06e2('0xa'));router[_0x06e2('0xb')]('/',auth['isAuthenticated'](),controller[_0x06e2('0xc')]);router['get']('/:id',auth[_0x06e2('0xd')](),controller[_0x06e2('0xe')]);router[_0x06e2('0xb')](_0x06e2('0xf'),auth['isAuthenticated'](),controller[_0x06e2('0x10')]);router[_0x06e2('0x11')]('/',auth[_0x06e2('0xd')](),controller[_0x06e2('0x12')]);router['put'](_0x06e2('0x13'),auth['isAuthenticated'](),controller[_0x06e2('0x14')]);router[_0x06e2('0x15')]('/:id',auth[_0x06e2('0xd')](),controller['destroy']);module[_0x06e2('0x16')]=router;
\ No newline at end of file
+var _0x3e0b=['destroy','exports','multer','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./analyticExtractedReport.controller','get','index','/:id','show','/:id/download','isAuthenticated','download','post','create','put','update'];(function(_0x8de422,_0x58b3f6){var _0x48f5d2=function(_0x3304e4){while(--_0x3304e4){_0x8de422['push'](_0x8de422['shift']());}};_0x48f5d2(++_0x58b3f6);}(_0x3e0b,0xa3));var _0xb3e0=function(_0x12b464,_0x466d77){_0x12b464=_0x12b464-0x0;var _0x4804e9=_0x3e0b[_0x12b464];return _0x4804e9;};'use strict';var multer=require(_0xb3e0('0x0'));var util=require(_0xb3e0('0x1'));var path=require(_0xb3e0('0x2'));var timeout=require(_0xb3e0('0x3'));var express=require('express');var router=express[_0xb3e0('0x4')]();var fs_extra=require(_0xb3e0('0x5'));var auth=require(_0xb3e0('0x6'));var interaction=require(_0xb3e0('0x7'));var config=require(_0xb3e0('0x8'));var controller=require(_0xb3e0('0x9'));router[_0xb3e0('0xa')]('/',auth['isAuthenticated'](),controller[_0xb3e0('0xb')]);router[_0xb3e0('0xa')](_0xb3e0('0xc'),auth['isAuthenticated'](),controller[_0xb3e0('0xd')]);router[_0xb3e0('0xa')](_0xb3e0('0xe'),auth[_0xb3e0('0xf')](),controller[_0xb3e0('0x10')]);router[_0xb3e0('0x11')]('/',auth[_0xb3e0('0xf')](),controller[_0xb3e0('0x12')]);router[_0xb3e0('0x13')](_0xb3e0('0xc'),auth[_0xb3e0('0xf')](),controller[_0xb3e0('0x14')]);router['delete']('/:id',auth[_0xb3e0('0xf')](),controller[_0xb3e0('0x15')]);module[_0xb3e0('0x16')]=router;
\ No newline at end of file
diff --git a/server/api/analyticFieldReport/analyticFieldReport.attributes.js b/server/api/analyticFieldReport/analyticFieldReport.attributes.js
index edc622e..1f067a9 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 _0xcf71=['TEXT','STRING','BOOLEAN'];(function(_0x5b7cb5,_0x2dc0bd){var _0x34985b=function(_0x489e3d){while(--_0x489e3d){_0x5b7cb5['push'](_0x5b7cb5['shift']());}};_0x34985b(++_0x2dc0bd);}(_0xcf71,0x7e));var _0x1cf7=function(_0xdbbb14,_0x140263){_0xdbbb14=_0xdbbb14-0x0;var _0x3c3585=_0xcf71[_0xdbbb14];return _0x3c3585;};'use strict';var Sequelize=require('sequelize');module['exports']={'field':{'type':Sequelize[_0x1cf7('0x0')]},'alias':{'type':Sequelize[_0x1cf7('0x1')]},'function':{'type':Sequelize[_0x1cf7('0x1')]},'format':{'type':Sequelize[_0x1cf7('0x1')]},'groupBy':{'type':Sequelize[_0x1cf7('0x2')],'defaultValue':![]},'orderBy':{'type':Sequelize[_0x1cf7('0x1')]},'custom':{'type':Sequelize['BOOLEAN'],'defaultValue':![]}};
\ No newline at end of file
+var _0x4592=['STRING','BOOLEAN','sequelize','exports','TEXT'];(function(_0x2283dc,_0x2fcfc5){var _0x16db90=function(_0x376c35){while(--_0x376c35){_0x2283dc['push'](_0x2283dc['shift']());}};_0x16db90(++_0x2fcfc5);}(_0x4592,0x133));var _0x2459=function(_0x4b7bd8,_0x2513ad){_0x4b7bd8=_0x4b7bd8-0x0;var _0x4fa530=_0x4592[_0x4b7bd8];return _0x4fa530;};'use strict';var Sequelize=require(_0x2459('0x0'));module[_0x2459('0x1')]={'field':{'type':Sequelize[_0x2459('0x2')]},'alias':{'type':Sequelize['STRING']},'function':{'type':Sequelize[_0x2459('0x3')]},'format':{'type':Sequelize[_0x2459('0x3')]},'groupBy':{'type':Sequelize[_0x2459('0x4')],'defaultValue':![]},'orderBy':{'type':Sequelize[_0x2459('0x3')]},'custom':{'type':Sequelize[_0x2459('0x4')],'defaultValue':![]}};
\ No newline at end of file
diff --git a/server/api/analyticFieldReport/analyticFieldReport.controller.js b/server/api/analyticFieldReport/analyticFieldReport.controller.js
index 491bf94..cfe6b4f 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 _0x87de=['length','options','create','body','bulkCreate','find','bulkDestroy','ids','addFields','sequelize','transaction','CustomReportId','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','to-csv','fs-extra','lodash','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','offset','limit','undefined','count','set','Content-Range','json','apply','save','update','then','destroy','name','map','AnalyticFieldReport','rawAttributes','fieldName','type','key','model','query','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','includeAll','include','findAll','rows','catch','show','params','keys'];(function(_0x3a72a3,_0x5679ee){var _0x5588bb=function(_0x4eb76d){while(--_0x4eb76d){_0x3a72a3['push'](_0x3a72a3['shift']());}};_0x5588bb(++_0x5679ee);}(_0x87de,0xf9));var _0xe87d=function(_0x10c358,_0x76c981){_0x10c358=_0x10c358-0x0;var _0x40c343=_0x87de[_0x10c358];return _0x40c343;};'use strict';var emlformat=require(_0xe87d('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xe87d('0x1'));var jsonpatch=require(_0xe87d('0x2'));var rp=require(_0xe87d('0x3'));var moment=require(_0xe87d('0x4'));var BPromise=require(_0xe87d('0x5'));var Mustache=require(_0xe87d('0x6'));var util=require(_0xe87d('0x7'));var path=require('path');var sox=require('sox');var csv=require(_0xe87d('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xe87d('0x9'));var _=require(_0xe87d('0xa'));var squel=require(_0xe87d('0xb'));var crypto=require('crypto');var jsforce=require(_0xe87d('0xc'));var deskjs=require(_0xe87d('0xd'));var toCsv=require(_0xe87d('0x8'));var querystring=require(_0xe87d('0xe'));var Papa=require(_0xe87d('0xf'));var Redis=require(_0xe87d('0x10'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xe87d('0x11'));var logger=require(_0xe87d('0x12'))(_0xe87d('0x13'));var utils=require('../../config/utils');var config=require(_0xe87d('0x14'));var licenseUtil=require(_0xe87d('0x15'));var db=require(_0xe87d('0x16'))['db'];function respondWithStatusCode(_0x4b3b87,_0x175f81){_0x175f81=_0x175f81||0xcc;return function(_0x428a14){if(_0x428a14){return _0x4b3b87[_0xe87d('0x17')](_0x175f81);}return _0x4b3b87['status'](_0x175f81)['end']();};}function respondWithResult(_0x576e2e,_0x2dfb50){_0x2dfb50=_0x2dfb50||0xc8;return function(_0x226447){if(_0x226447){return _0x576e2e[_0xe87d('0x18')](_0x2dfb50)['json'](_0x226447);}};}function respondWithFilteredResult(_0x4fc9a2,_0x21802d){return function(_0x36fa7a){if(_0x36fa7a){var _0x31a813=typeof _0x21802d[_0xe87d('0x19')]==='undefined'&&typeof _0x21802d[_0xe87d('0x1a')]===_0xe87d('0x1b');var _0x516b9d=_0x36fa7a[_0xe87d('0x1c')];var _0x1ed3a=_0x31a813?0x0:_0x21802d['offset'];var _0x5833cf=_0x31a813?_0x36fa7a['count']:_0x21802d[_0xe87d('0x19')]+_0x21802d[_0xe87d('0x1a')];var _0x54bd8a;if(_0x5833cf>=_0x516b9d){_0x5833cf=_0x516b9d;_0x54bd8a=0xc8;}else{_0x54bd8a=0xce;}_0x4fc9a2[_0xe87d('0x18')](_0x54bd8a);return _0x4fc9a2[_0xe87d('0x1d')](_0xe87d('0x1e'),_0x1ed3a+'-'+_0x5833cf+'/'+_0x516b9d)[_0xe87d('0x1f')](_0x36fa7a);}return null;};}function patchUpdates(_0xbf99bd){return function(_0x183e4d){try{jsonpatch[_0xe87d('0x20')](_0x183e4d,_0xbf99bd,!![]);}catch(_0x10259a){return BPromise['reject'](_0x10259a);}return _0x183e4d[_0xe87d('0x21')]();};}function saveUpdates(_0x1fc19b,_0x23c4c8){return function(_0x175031){if(_0x175031){return _0x175031[_0xe87d('0x22')](_0x1fc19b)[_0xe87d('0x23')](function(_0x2ff5bf){return _0x2ff5bf;});}return null;};}function removeEntity(_0x39edc0,_0x2b7449){return function(_0x298662){if(_0x298662){return _0x298662[_0xe87d('0x24')]()[_0xe87d('0x23')](function(){_0x39edc0[_0xe87d('0x18')](0xcc)['end']();});}};}function handleEntityNotFound(_0x8c3228,_0x5cbccd){return function(_0x223f41){if(!_0x223f41){_0x8c3228[_0xe87d('0x17')](0x194);}return _0x223f41;};}function handleError(_0x3e0c3c,_0x229048){_0x229048=_0x229048||0x1f4;return function(_0x541110){logger['error'](_0x541110['stack']);if(_0x541110['name']){delete _0x541110[_0xe87d('0x25')];}_0x3e0c3c['status'](_0x229048)['send'](_0x541110);};}exports['index']=function(_0x201fa3,_0x16462c){var _0x36d252={},_0x43c748={},_0x15d418={'count':0x0,'rows':[]};var _0x3b9c36=_[_0xe87d('0x26')](db[_0xe87d('0x27')][_0xe87d('0x28')],function(_0x4e5acf){return{'name':_0x4e5acf[_0xe87d('0x29')],'type':_0x4e5acf[_0xe87d('0x2a')][_0xe87d('0x2b')]};});_0x43c748[_0xe87d('0x2c')]=_[_0xe87d('0x26')](_0x3b9c36,'name');_0x43c748['query']=_['keys'](_0x201fa3[_0xe87d('0x2d')]);_0x43c748[_0xe87d('0x2e')]=_[_0xe87d('0x2f')](_0x43c748['model'],_0x43c748['query']);_0x36d252[_0xe87d('0x30')]=_[_0xe87d('0x2f')](_0x43c748[_0xe87d('0x2c')],qs['fields'](_0x201fa3[_0xe87d('0x2d')][_0xe87d('0x31')]));_0x36d252['attributes']=_0x36d252[_0xe87d('0x30')]['length']?_0x36d252[_0xe87d('0x30')]:_0x43c748[_0xe87d('0x2c')];if(!_0x201fa3[_0xe87d('0x2d')][_0xe87d('0x32')](_0xe87d('0x33'))){_0x36d252[_0xe87d('0x1a')]=qs[_0xe87d('0x1a')](_0x201fa3[_0xe87d('0x2d')]['limit']);_0x36d252[_0xe87d('0x19')]=qs[_0xe87d('0x19')](_0x201fa3[_0xe87d('0x2d')][_0xe87d('0x19')]);}_0x36d252[_0xe87d('0x34')]=qs[_0xe87d('0x35')](_0x201fa3[_0xe87d('0x2d')][_0xe87d('0x35')]);_0x36d252[_0xe87d('0x36')]=qs['filters'](_[_0xe87d('0x37')](_0x201fa3[_0xe87d('0x2d')],_0x43c748[_0xe87d('0x2e')]),_0x3b9c36);if(_0x201fa3[_0xe87d('0x2d')][_0xe87d('0x38')]){_0x36d252[_0xe87d('0x36')]=_[_0xe87d('0x39')](_0x36d252[_0xe87d('0x36')],{'$or':_[_0xe87d('0x26')](_0x3b9c36,function(_0x109bf0){if(_0x109bf0['type']!==_0xe87d('0x3a')){var _0x9c4ed3={};_0x9c4ed3[_0x109bf0[_0xe87d('0x25')]]={'$like':'%'+_0x201fa3[_0xe87d('0x2d')][_0xe87d('0x38')]+'%'};return _0x9c4ed3;}})});}_0x36d252=_['merge']({},_0x36d252,_0x201fa3['options']);var _0x1b763b={'where':_0x36d252[_0xe87d('0x36')]};return db[_0xe87d('0x27')][_0xe87d('0x1c')](_0x1b763b)['then'](function(_0xf108ae){_0x15d418[_0xe87d('0x1c')]=_0xf108ae;if(_0x201fa3[_0xe87d('0x2d')][_0xe87d('0x3b')]){_0x36d252[_0xe87d('0x3c')]=[{'all':!![]}];}return db[_0xe87d('0x27')][_0xe87d('0x3d')](_0x36d252);})[_0xe87d('0x23')](function(_0x254d87){_0x15d418[_0xe87d('0x3e')]=_0x254d87;return _0x15d418;})['then'](respondWithFilteredResult(_0x16462c,_0x36d252))[_0xe87d('0x3f')](handleError(_0x16462c,null));};exports[_0xe87d('0x40')]=function(_0x41086e,_0x3424a4){var _0x26ab89={'raw':![],'where':{'id':_0x41086e[_0xe87d('0x41')]['id']}},_0x4bbbba={};_0x4bbbba[_0xe87d('0x2c')]=_[_0xe87d('0x42')](db[_0xe87d('0x27')][_0xe87d('0x28')]);_0x4bbbba[_0xe87d('0x2d')]=_['keys'](_0x41086e['query']);_0x4bbbba[_0xe87d('0x2e')]=_[_0xe87d('0x2f')](_0x4bbbba['model'],_0x4bbbba[_0xe87d('0x2d')]);_0x26ab89[_0xe87d('0x30')]=_[_0xe87d('0x2f')](_0x4bbbba[_0xe87d('0x2c')],qs[_0xe87d('0x31')](_0x41086e['query'][_0xe87d('0x31')]));_0x26ab89['attributes']=_0x26ab89['attributes'][_0xe87d('0x43')]?_0x26ab89[_0xe87d('0x30')]:_0x4bbbba['model'];if(_0x41086e['query']['includeAll']){_0x26ab89[_0xe87d('0x3c')]=[{'all':!![]}];}_0x26ab89=_[_0xe87d('0x39')]({},_0x26ab89,_0x41086e[_0xe87d('0x44')]);return db[_0xe87d('0x27')]['find'](_0x26ab89)[_0xe87d('0x23')](handleEntityNotFound(_0x3424a4,null))[_0xe87d('0x23')](respondWithResult(_0x3424a4,null))[_0xe87d('0x3f')](handleError(_0x3424a4,null));};exports[_0xe87d('0x45')]=function(_0x1dca58,_0x4d3299){return db['AnalyticFieldReport'][_0xe87d('0x45')](_0x1dca58[_0xe87d('0x46')],{})['then'](respondWithResult(_0x4d3299,0xc9))[_0xe87d('0x3f')](handleError(_0x4d3299,null));};exports[_0xe87d('0x47')]=function(_0xaf587,_0x350108){return db[_0xe87d('0x27')][_0xe87d('0x47')](_0xaf587[_0xe87d('0x46')],{'raw':![],'individualHooks':!![]})['then'](respondWithResult(_0x350108,0xc9))[_0xe87d('0x3f')](handleError(_0x350108,null));};exports['update']=function(_0x592eaf,_0x4629d8){if(_0x592eaf[_0xe87d('0x46')]['id']){delete _0x592eaf['body']['id'];}return db[_0xe87d('0x27')][_0xe87d('0x48')]({'where':{'id':_0x592eaf[_0xe87d('0x41')]['id']}})[_0xe87d('0x23')](handleEntityNotFound(_0x4629d8,null))['then'](saveUpdates(_0x592eaf['body'],null))[_0xe87d('0x23')](respondWithResult(_0x4629d8,null))['catch'](handleError(_0x4629d8,null));};exports[_0xe87d('0x24')]=function(_0x2ce2c8,_0x1d9d0b){return db[_0xe87d('0x27')][_0xe87d('0x48')]({'where':{'id':_0x2ce2c8[_0xe87d('0x41')]['id']}})[_0xe87d('0x23')](handleEntityNotFound(_0x1d9d0b,null))[_0xe87d('0x23')](removeEntity(_0x1d9d0b,null))['catch'](handleError(_0x1d9d0b,null));};exports[_0xe87d('0x49')]=function(_0x8bdfc6,_0x383de7){return db['AnalyticFieldReport'][_0xe87d('0x24')]({'where':{'id':_0x8bdfc6[_0xe87d('0x2d')][_0xe87d('0x4a')]||[]},'raw':![],'individualHooks':!![]})[_0xe87d('0x23')](respondWithResult(_0x383de7,0xcc))['catch'](handleError(_0x383de7,null));};exports[_0xe87d('0x4b')]=function(_0x2bf5ad,_0x16ab9e,_0x5c101f){return db['AnalyticCustomReport']['findOne']({'where':{'id':_0x2bf5ad[_0xe87d('0x41')]['id']}})[_0xe87d('0x23')](handleEntityNotFound(_0x16ab9e,null))[_0xe87d('0x23')](function(_0x4e2a9e){if(_0x4e2a9e){return db[_0xe87d('0x4c')][_0xe87d('0x4d')](function(_0x31fde0){return db['AnalyticFieldReport'][_0xe87d('0x24')]({'where':{'CustomReportId':_0x2bf5ad[_0xe87d('0x41')]['id']},'transaction':_0x31fde0})[_0xe87d('0x23')](function(_0x4079b9){var _0x2eb7f1=_['map'](_0x2bf5ad[_0xe87d('0x46')],function(_0x555445){delete _0x555445['id'];_0x555445[_0xe87d('0x4e')]=_0x2bf5ad['params']['id'];return _0x555445;});return db[_0xe87d('0x27')][_0xe87d('0x47')](_0x2eb7f1,{'transaction':_0x31fde0});});})[_0xe87d('0x23')](function(){return db['AnalyticFieldReport'][_0xe87d('0x3d')]({'where':{'CustomReportId':_0x2bf5ad['params']['id']}});});}})['then'](respondWithResult(_0x16ab9e,null))['catch'](handleError(_0x16ab9e,null));};
\ No newline at end of file
+var _0xfa15=['../../components/parsers/advancedSearch','../../config/license/hardware','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','update','destroy','then','error','stack','name','send','index','map','AnalyticFieldReport','rawAttributes','type','query','keys','filters','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','rows','catch','show','find','create','body','bulkCreate','params','bulkDestroy','ids','addFields','AnalyticCustomReport','findOne','sequelize','CustomReportId','findAll','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path','to-csv','ejs','fs-extra','squel','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs'];(function(_0x2845d7,_0xd09cb1){var _0x147181=function(_0x5c3b4a){while(--_0x5c3b4a){_0x2845d7['push'](_0x2845d7['shift']());}};_0x147181(++_0xd09cb1);}(_0xfa15,0x189));var _0x5fa1=function(_0x92ad86,_0x3c09c3){_0x92ad86=_0x92ad86-0x0;var _0x188fbb=_0xfa15[_0x92ad86];return _0x188fbb;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x5fa1('0x0'));var zipdir=require(_0x5fa1('0x1'));var jsonpatch=require(_0x5fa1('0x2'));var rp=require(_0x5fa1('0x3'));var moment=require(_0x5fa1('0x4'));var BPromise=require(_0x5fa1('0x5'));var Mustache=require(_0x5fa1('0x6'));var util=require('util');var path=require(_0x5fa1('0x7'));var sox=require('sox');var csv=require(_0x5fa1('0x8'));var ejs=require(_0x5fa1('0x9'));var fs=require('fs');var fs_extra=require(_0x5fa1('0xa'));var _=require('lodash');var squel=require(_0x5fa1('0xb'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x5fa1('0xc'));var toCsv=require(_0x5fa1('0x8'));var querystring=require(_0x5fa1('0xd'));var Papa=require(_0x5fa1('0xe'));var Redis=require(_0x5fa1('0xf'));var authService=require('../../components/auth/service');var qs=require(_0x5fa1('0x10'));var as=require(_0x5fa1('0x11'));var hardwareService=require(_0x5fa1('0x12'));var logger=require('../../config/logger')('api');var utils=require(_0x5fa1('0x13'));var config=require('../../config/environment');var licenseUtil=require(_0x5fa1('0x14'));var db=require(_0x5fa1('0x15'))['db'];function respondWithStatusCode(_0x24fe7d,_0x4808c6){_0x4808c6=_0x4808c6||0xcc;return function(_0x2e8da0){if(_0x2e8da0){return _0x24fe7d[_0x5fa1('0x16')](_0x4808c6);}return _0x24fe7d[_0x5fa1('0x17')](_0x4808c6)[_0x5fa1('0x18')]();};}function respondWithResult(_0x2e2a3d,_0x29e3a1){_0x29e3a1=_0x29e3a1||0xc8;return function(_0x22127b){if(_0x22127b){return _0x2e2a3d[_0x5fa1('0x17')](_0x29e3a1)[_0x5fa1('0x19')](_0x22127b);}};}function respondWithFilteredResult(_0x1d6491,_0x42c8b2){return function(_0xab0d6f){if(_0xab0d6f){var _0x54ada3=typeof _0x42c8b2[_0x5fa1('0x1a')]===_0x5fa1('0x1b')&&typeof _0x42c8b2[_0x5fa1('0x1c')]===_0x5fa1('0x1b');var _0x2f122a=_0xab0d6f[_0x5fa1('0x1d')];var _0xfd39f1=_0x54ada3?0x0:_0x42c8b2[_0x5fa1('0x1a')];var _0xda3180=_0x54ada3?_0xab0d6f[_0x5fa1('0x1d')]:_0x42c8b2[_0x5fa1('0x1a')]+_0x42c8b2[_0x5fa1('0x1c')];var _0x34860a;if(_0xda3180>=_0x2f122a){_0xda3180=_0x2f122a;_0x34860a=0xc8;}else{_0x34860a=0xce;}_0x1d6491[_0x5fa1('0x17')](_0x34860a);return _0x1d6491[_0x5fa1('0x1e')](_0x5fa1('0x1f'),_0xfd39f1+'-'+_0xda3180+'/'+_0x2f122a)['json'](_0xab0d6f);}return null;};}function patchUpdates(_0x17f1e8){return function(_0x5e4090){try{jsonpatch[_0x5fa1('0x20')](_0x5e4090,_0x17f1e8,!![]);}catch(_0x1e05e6){return BPromise[_0x5fa1('0x21')](_0x1e05e6);}return _0x5e4090['save']();};}function saveUpdates(_0x442d0c,_0x834005){return function(_0x548036){if(_0x548036){return _0x548036[_0x5fa1('0x22')](_0x442d0c)['then'](function(_0xbd74a5){return _0xbd74a5;});}return null;};}function removeEntity(_0x45d170,_0x69c79){return function(_0x56b8b2){if(_0x56b8b2){return _0x56b8b2[_0x5fa1('0x23')]()[_0x5fa1('0x24')](function(){_0x45d170[_0x5fa1('0x17')](0xcc)[_0x5fa1('0x18')]();});}};}function handleEntityNotFound(_0x5d1b51,_0x433ccb){return function(_0x2a9c4f){if(!_0x2a9c4f){_0x5d1b51[_0x5fa1('0x16')](0x194);}return _0x2a9c4f;};}function handleError(_0x1493c2,_0xa110cf){_0xa110cf=_0xa110cf||0x1f4;return function(_0x13c0bb){logger[_0x5fa1('0x25')](_0x13c0bb[_0x5fa1('0x26')]);if(_0x13c0bb[_0x5fa1('0x27')]){delete _0x13c0bb[_0x5fa1('0x27')];}_0x1493c2[_0x5fa1('0x17')](_0xa110cf)[_0x5fa1('0x28')](_0x13c0bb);};}exports[_0x5fa1('0x29')]=function(_0x4b69a1,_0x56981b){var _0x3d0e51={},_0x1adf6a={},_0x4296cd={'count':0x0,'rows':[]};var _0x5b7baf=_[_0x5fa1('0x2a')](db[_0x5fa1('0x2b')][_0x5fa1('0x2c')],function(_0x5aef7a){return{'name':_0x5aef7a['fieldName'],'type':_0x5aef7a[_0x5fa1('0x2d')]['key']};});_0x1adf6a['model']=_[_0x5fa1('0x2a')](_0x5b7baf,_0x5fa1('0x27'));_0x1adf6a[_0x5fa1('0x2e')]=_[_0x5fa1('0x2f')](_0x4b69a1[_0x5fa1('0x2e')]);_0x1adf6a[_0x5fa1('0x30')]=_[_0x5fa1('0x31')](_0x1adf6a[_0x5fa1('0x32')],_0x1adf6a[_0x5fa1('0x2e')]);_0x3d0e51[_0x5fa1('0x33')]=_[_0x5fa1('0x31')](_0x1adf6a[_0x5fa1('0x32')],qs[_0x5fa1('0x34')](_0x4b69a1[_0x5fa1('0x2e')][_0x5fa1('0x34')]));_0x3d0e51[_0x5fa1('0x33')]=_0x3d0e51['attributes'][_0x5fa1('0x35')]?_0x3d0e51[_0x5fa1('0x33')]:_0x1adf6a['model'];if(!_0x4b69a1[_0x5fa1('0x2e')][_0x5fa1('0x36')](_0x5fa1('0x37'))){_0x3d0e51['limit']=qs[_0x5fa1('0x1c')](_0x4b69a1[_0x5fa1('0x2e')][_0x5fa1('0x1c')]);_0x3d0e51[_0x5fa1('0x1a')]=qs['offset'](_0x4b69a1[_0x5fa1('0x2e')][_0x5fa1('0x1a')]);}_0x3d0e51[_0x5fa1('0x38')]=qs['sort'](_0x4b69a1['query'][_0x5fa1('0x39')]);_0x3d0e51[_0x5fa1('0x3a')]=qs[_0x5fa1('0x30')](_[_0x5fa1('0x3b')](_0x4b69a1[_0x5fa1('0x2e')],_0x1adf6a[_0x5fa1('0x30')]),_0x5b7baf);if(_0x4b69a1[_0x5fa1('0x2e')][_0x5fa1('0x3c')]){_0x3d0e51[_0x5fa1('0x3a')]=_[_0x5fa1('0x3d')](_0x3d0e51[_0x5fa1('0x3a')],{'$or':_[_0x5fa1('0x2a')](_0x5b7baf,function(_0x3a69b0){if(_0x3a69b0['type']!==_0x5fa1('0x3e')){var _0x24d3d7={};_0x24d3d7[_0x3a69b0[_0x5fa1('0x27')]]={'$like':'%'+_0x4b69a1[_0x5fa1('0x2e')][_0x5fa1('0x3c')]+'%'};return _0x24d3d7;}})});}_0x3d0e51=_[_0x5fa1('0x3d')]({},_0x3d0e51,_0x4b69a1[_0x5fa1('0x3f')]);var _0x4680b9={'where':_0x3d0e51[_0x5fa1('0x3a')]};return db[_0x5fa1('0x2b')][_0x5fa1('0x1d')](_0x4680b9)[_0x5fa1('0x24')](function(_0x41c6b6){_0x4296cd[_0x5fa1('0x1d')]=_0x41c6b6;if(_0x4b69a1[_0x5fa1('0x2e')][_0x5fa1('0x40')]){_0x3d0e51[_0x5fa1('0x41')]=[{'all':!![]}];}return db[_0x5fa1('0x2b')]['findAll'](_0x3d0e51);})[_0x5fa1('0x24')](function(_0x16760e){_0x4296cd[_0x5fa1('0x42')]=_0x16760e;return _0x4296cd;})['then'](respondWithFilteredResult(_0x56981b,_0x3d0e51))[_0x5fa1('0x43')](handleError(_0x56981b,null));};exports[_0x5fa1('0x44')]=function(_0x1c6409,_0x4dc3d4){var _0xa4d9e3={'raw':![],'where':{'id':_0x1c6409['params']['id']}},_0x186b1f={};_0x186b1f[_0x5fa1('0x32')]=_[_0x5fa1('0x2f')](db[_0x5fa1('0x2b')][_0x5fa1('0x2c')]);_0x186b1f[_0x5fa1('0x2e')]=_[_0x5fa1('0x2f')](_0x1c6409['query']);_0x186b1f[_0x5fa1('0x30')]=_['intersection'](_0x186b1f['model'],_0x186b1f[_0x5fa1('0x2e')]);_0xa4d9e3['attributes']=_[_0x5fa1('0x31')](_0x186b1f['model'],qs[_0x5fa1('0x34')](_0x1c6409[_0x5fa1('0x2e')]['fields']));_0xa4d9e3[_0x5fa1('0x33')]=_0xa4d9e3[_0x5fa1('0x33')]['length']?_0xa4d9e3[_0x5fa1('0x33')]:_0x186b1f['model'];if(_0x1c6409['query']['includeAll']){_0xa4d9e3[_0x5fa1('0x41')]=[{'all':!![]}];}_0xa4d9e3=_[_0x5fa1('0x3d')]({},_0xa4d9e3,_0x1c6409['options']);return db[_0x5fa1('0x2b')][_0x5fa1('0x45')](_0xa4d9e3)['then'](handleEntityNotFound(_0x4dc3d4,null))[_0x5fa1('0x24')](respondWithResult(_0x4dc3d4,null))[_0x5fa1('0x43')](handleError(_0x4dc3d4,null));};exports['create']=function(_0xe27449,_0x48b104){return db[_0x5fa1('0x2b')][_0x5fa1('0x46')](_0xe27449[_0x5fa1('0x47')],{})[_0x5fa1('0x24')](respondWithResult(_0x48b104,0xc9))[_0x5fa1('0x43')](handleError(_0x48b104,null));};exports[_0x5fa1('0x48')]=function(_0x33b0db,_0x3f75f0){return db['AnalyticFieldReport'][_0x5fa1('0x48')](_0x33b0db[_0x5fa1('0x47')],{'raw':![],'individualHooks':!![]})[_0x5fa1('0x24')](respondWithResult(_0x3f75f0,0xc9))[_0x5fa1('0x43')](handleError(_0x3f75f0,null));};exports[_0x5fa1('0x22')]=function(_0x1731bf,_0x31f351){if(_0x1731bf[_0x5fa1('0x47')]['id']){delete _0x1731bf['body']['id'];}return db[_0x5fa1('0x2b')]['find']({'where':{'id':_0x1731bf[_0x5fa1('0x49')]['id']}})[_0x5fa1('0x24')](handleEntityNotFound(_0x31f351,null))['then'](saveUpdates(_0x1731bf[_0x5fa1('0x47')],null))[_0x5fa1('0x24')](respondWithResult(_0x31f351,null))[_0x5fa1('0x43')](handleError(_0x31f351,null));};exports[_0x5fa1('0x23')]=function(_0x256dd9,_0x1074c5){return db[_0x5fa1('0x2b')][_0x5fa1('0x45')]({'where':{'id':_0x256dd9[_0x5fa1('0x49')]['id']}})[_0x5fa1('0x24')](handleEntityNotFound(_0x1074c5,null))[_0x5fa1('0x24')](removeEntity(_0x1074c5,null))[_0x5fa1('0x43')](handleError(_0x1074c5,null));};exports[_0x5fa1('0x4a')]=function(_0x56f1db,_0x3af007){return db['AnalyticFieldReport'][_0x5fa1('0x23')]({'where':{'id':_0x56f1db['query'][_0x5fa1('0x4b')]||[]},'raw':![],'individualHooks':!![]})[_0x5fa1('0x24')](respondWithResult(_0x3af007,0xcc))[_0x5fa1('0x43')](handleError(_0x3af007,null));};exports[_0x5fa1('0x4c')]=function(_0x56191a,_0x48aeb4,_0x5bdb69){return db[_0x5fa1('0x4d')][_0x5fa1('0x4e')]({'where':{'id':_0x56191a['params']['id']}})[_0x5fa1('0x24')](handleEntityNotFound(_0x48aeb4,null))[_0x5fa1('0x24')](function(_0x1f7ae3){if(_0x1f7ae3){return db[_0x5fa1('0x4f')]['transaction'](function(_0x2ff0a0){return db[_0x5fa1('0x2b')][_0x5fa1('0x23')]({'where':{'CustomReportId':_0x56191a[_0x5fa1('0x49')]['id']},'transaction':_0x2ff0a0})[_0x5fa1('0x24')](function(_0x305dd8){var _0x2c458e=_[_0x5fa1('0x2a')](_0x56191a[_0x5fa1('0x47')],function(_0xc64431){delete _0xc64431['id'];_0xc64431[_0x5fa1('0x50')]=_0x56191a[_0x5fa1('0x49')]['id'];return _0xc64431;});return db[_0x5fa1('0x2b')][_0x5fa1('0x48')](_0x2c458e,{'transaction':_0x2ff0a0});});})['then'](function(){return db[_0x5fa1('0x2b')][_0x5fa1('0x51')]({'where':{'CustomReportId':_0x56191a['params']['id']}});});}})[_0x5fa1('0x24')](respondWithResult(_0x48aeb4,null))[_0x5fa1('0x43')](handleError(_0x48aeb4,null));};
\ No newline at end of file
diff --git a/server/api/analyticFieldReport/analyticFieldReport.model.js b/server/api/analyticFieldReport/analyticFieldReport.model.js
index 66ac96a..f84dbdf 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 _0x8aa6=['path','rimraf','../../config/environment','exports','AnalyticFieldReport','analytics_report_fields','lodash','util','api','moment','request-promise'];(function(_0x46ddd3,_0x2f4887){var _0x3f7c8c=function(_0x44bec2){while(--_0x44bec2){_0x46ddd3['push'](_0x46ddd3['shift']());}};_0x3f7c8c(++_0x2f4887);}(_0x8aa6,0xe2));var _0x68aa=function(_0x47df54,_0x1aeb61){_0x47df54=_0x47df54-0x0;var _0x261b87=_0x8aa6[_0x47df54];return _0x261b87;};'use strict';var _=require(_0x68aa('0x0'));var util=require(_0x68aa('0x1'));var logger=require('../../config/logger')(_0x68aa('0x2'));var moment=require(_0x68aa('0x3'));var BPromise=require('bluebird');var rp=require(_0x68aa('0x4'));var fs=require('fs');var path=require(_0x68aa('0x5'));var rimraf=require(_0x68aa('0x6'));var config=require(_0x68aa('0x7'));var attributes=require('./analyticFieldReport.attributes');module[_0x68aa('0x8')]=function(_0x538992,_0x5b60fd){return _0x538992['define'](_0x68aa('0x9'),attributes,{'tableName':_0x68aa('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x9f77=['rimraf','../../config/environment','exports','define','AnalyticFieldReport','analytics_report_fields','lodash','api','moment','path'];(function(_0x4271f1,_0xdbdc80){var _0x1bc9c9=function(_0x463d31){while(--_0x463d31){_0x4271f1['push'](_0x4271f1['shift']());}};_0x1bc9c9(++_0xdbdc80);}(_0x9f77,0x1c8));var _0x79f7=function(_0x10309d,_0x226b6c){_0x10309d=_0x10309d-0x0;var _0x5e1e70=_0x9f77[_0x10309d];return _0x5e1e70;};'use strict';var _=require(_0x79f7('0x0'));var util=require('util');var logger=require('../../config/logger')(_0x79f7('0x1'));var moment=require(_0x79f7('0x2'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x79f7('0x3'));var rimraf=require(_0x79f7('0x4'));var config=require(_0x79f7('0x5'));var attributes=require('./analyticFieldReport.attributes');module[_0x79f7('0x6')]=function(_0x1ce1cc,_0x1bc93d){return _0x1ce1cc[_0x79f7('0x7')](_0x79f7('0x8'),attributes,{'tableName':_0x79f7('0x9'),'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 bae1418..55a0a2b 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 _0x6404=['code','message','result','util','moment','bluebird','ioredis','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','request','then','info','AnalyticFieldReport,\x20%s,\x20%s','request\x20sent','debug','stringify','error'];(function(_0x389971,_0x3c6bf8){var _0x347a60=function(_0xbf68eb){while(--_0xbf68eb){_0x389971['push'](_0x389971['shift']());}};_0x347a60(++_0x3c6bf8);}(_0x6404,0x1a7));var _0x4640=function(_0x3ec323,_0x5aa147){_0x3ec323=_0x3ec323-0x0;var _0x3261c6=_0x6404[_0x3ec323];return _0x3261c6;};'use strict';var _=require('lodash');var util=require(_0x4640('0x0'));var moment=require(_0x4640('0x1'));var BPromise=require(_0x4640('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x4640('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x4640('0x4'));var logger=require('../../config/logger')(_0x4640('0x5'));var config=require(_0x4640('0x6'));var jayson=require(_0x4640('0x7'));var client=jayson[_0x4640('0x8')][_0x4640('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x48e1b6,_0x5cfd18,_0x583454){return new BPromise(function(_0xb9524e,_0x4ed004){return client[_0x4640('0xa')](_0x48e1b6,_0x583454)[_0x4640('0xb')](function(_0x4411eb){logger[_0x4640('0xc')](_0x4640('0xd'),_0x5cfd18,_0x4640('0xe'));logger[_0x4640('0xf')]('AnalyticFieldReport,\x20%s,\x20%s,\x20%s',_0x5cfd18,_0x4640('0xe'),JSON[_0x4640('0x10')](_0x4411eb));if(_0x4411eb['error']){if(_0x4411eb[_0x4640('0x11')][_0x4640('0x12')]===0x1f4){logger[_0x4640('0x11')](_0x4640('0xd'),_0x5cfd18,_0x4411eb[_0x4640('0x11')][_0x4640('0x13')]);return _0x4ed004(_0x4411eb[_0x4640('0x11')]['message']);}logger[_0x4640('0x11')](_0x4640('0xd'),_0x5cfd18,_0x4411eb[_0x4640('0x11')][_0x4640('0x13')]);return _0xb9524e(_0x4411eb[_0x4640('0x11')][_0x4640('0x13')]);}else{logger[_0x4640('0xc')](_0x4640('0xd'),_0x5cfd18,_0x4640('0xe'));_0xb9524e(_0x4411eb[_0x4640('0x14')]['message']);}})['catch'](function(_0xa0804){logger[_0x4640('0x11')]('AnalyticFieldReport,\x20%s,\x20%s',_0x5cfd18,_0xa0804);_0x4ed004(_0xa0804);});});}
\ No newline at end of file
+var _0xd79d=['rpc','../../config/environment','client','request','AnalyticFieldReport,\x20%s,\x20%s','request\x20sent','debug','error','message','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger'];(function(_0xf4d811,_0x11d532){var _0x1677f9=function(_0x55208f){while(--_0x55208f){_0xf4d811['push'](_0xf4d811['shift']());}};_0x1677f9(++_0x11d532);}(_0xd79d,0xf7));var _0xdd79=function(_0x58c608,_0x16f6df){_0x58c608=_0x58c608-0x0;var _0x4fb8aa=_0xd79d[_0x58c608];return _0x4fb8aa;};'use strict';var _=require(_0xdd79('0x0'));var util=require(_0xdd79('0x1'));var moment=require(_0xdd79('0x2'));var BPromise=require(_0xdd79('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xdd79('0x4'));var db=require(_0xdd79('0x5'))['db'];var utils=require(_0xdd79('0x6'));var logger=require(_0xdd79('0x7'))(_0xdd79('0x8'));var config=require(_0xdd79('0x9'));var jayson=require('jayson/promise');var client=jayson[_0xdd79('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x3c8fe4,_0xcf50f8,_0x374fcb){return new BPromise(function(_0x1c5a95,_0x19ca9a){return client[_0xdd79('0xb')](_0x3c8fe4,_0x374fcb)['then'](function(_0x42c343){logger['info'](_0xdd79('0xc'),_0xcf50f8,_0xdd79('0xd'));logger[_0xdd79('0xe')]('AnalyticFieldReport,\x20%s,\x20%s,\x20%s',_0xcf50f8,_0xdd79('0xd'),JSON['stringify'](_0x42c343));if(_0x42c343['error']){if(_0x42c343[_0xdd79('0xf')]['code']===0x1f4){logger[_0xdd79('0xf')](_0xdd79('0xc'),_0xcf50f8,_0x42c343[_0xdd79('0xf')][_0xdd79('0x10')]);return _0x19ca9a(_0x42c343[_0xdd79('0xf')][_0xdd79('0x10')]);}logger[_0xdd79('0xf')](_0xdd79('0xc'),_0xcf50f8,_0x42c343[_0xdd79('0xf')][_0xdd79('0x10')]);return _0x1c5a95(_0x42c343[_0xdd79('0xf')][_0xdd79('0x10')]);}else{logger['info'](_0xdd79('0xc'),_0xcf50f8,_0xdd79('0xd'));_0x1c5a95(_0x42c343['result'][_0xdd79('0x10')]);}})['catch'](function(_0x12a804){logger[_0xdd79('0xf')](_0xdd79('0xc'),_0xcf50f8,_0x12a804);_0x19ca9a(_0x12a804);});});}
\ No newline at end of file
diff --git a/server/api/analyticFieldReport/index.js b/server/api/analyticFieldReport/index.js
index 88bae48..e8d8d18 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(_0xf62d77,_0x21dbc9){var _0x5f28c5=function(_0x509777){while(--_0x509777){_0xf62d77['push'](_0xf62d77['shift']());}};_0x5f28c5(++_0x21dbc9);}(_0xa9e0,0x123));var _0x0a9e=function(_0x49ca18,_0x5e6d05){_0x49ca18=_0x49ca18-0x0;var _0x145d54=_0xa9e0[_0x49ca18];return _0x145d54;};'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(_0x4fec6a,_0x385d3b){var _0x471be2=function(_0x5b8c11){while(--_0x5b8c11){_0x4fec6a['push'](_0x4fec6a['shift']());}};_0x471be2(++_0x385d3b);}(_0xa9e0,0x123));var _0x0a9e=function(_0x12d033,_0x25fa2f){_0x12d033=_0x12d033-0x0;var _0x3b4e80=_0xa9e0[_0x12d033];return _0x3b4e80;};'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 7c1be9f..6c751db 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 _0x1bd1=['sequelize','exports','STRING'];(function(_0x5c2050,_0x5bbe89){var _0x13a867=function(_0x21c4d8){while(--_0x21c4d8){_0x5c2050['push'](_0x5c2050['shift']());}};_0x13a867(++_0x5bbe89);}(_0x1bd1,0x123));var _0x11bd=function(_0x558222,_0x105cdb){_0x558222=_0x558222-0x0;var _0x4e1044=_0x1bd1[_0x558222];return _0x4e1044;};'use strict';var Sequelize=require(_0x11bd('0x0'));module[_0x11bd('0x1')]={'name':{'type':Sequelize[_0x11bd('0x2')],'allowNull':![],'unique':'name'},'table':{'type':Sequelize[_0x11bd('0x2')]},'metric':{'type':Sequelize['TEXT']},'description':{'type':Sequelize['STRING']}};
\ No newline at end of file
+var _0xa3b9=['exports','STRING','name','TEXT','sequelize'];(function(_0x5b5ae3,_0xff9830){var _0x242c57=function(_0x1f63ab){while(--_0x1f63ab){_0x5b5ae3['push'](_0x5b5ae3['shift']());}};_0x242c57(++_0xff9830);}(_0xa3b9,0x112));var _0x9a3b=function(_0x241489,_0x30de1c){_0x241489=_0x241489-0x0;var _0x359dc5=_0xa3b9[_0x241489];return _0x359dc5;};'use strict';var Sequelize=require(_0x9a3b('0x0'));module[_0x9a3b('0x1')]={'name':{'type':Sequelize[_0x9a3b('0x2')],'allowNull':![],'unique':_0x9a3b('0x3')},'table':{'type':Sequelize[_0x9a3b('0x2')]},'metric':{'type':Sequelize[_0x9a3b('0x4')]},'description':{'type':Sequelize['STRING']}};
\ No newline at end of file
diff --git a/server/api/analyticMetric/analyticMetric.controller.js b/server/api/analyticMetric/analyticMetric.controller.js
index fd20dd1..c68c502 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 _0xdc97=['mustache','path','sox','to-csv','ejs','lodash','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','status','end','offset','undefined','limit','count','set','Content-Range','json','apply','update','then','get','destroy','sendStatus','error','stack','name','send','AnalyticMetric','rawAttributes','fieldName','type','key','query','filters','intersection','model','attributes','length','nolimit','order','sort','where','pick','filter','merge','map','VIRTUAL','includeAll','findAll','rows','catch','params','keys','fields','options','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','Metrics','userProfileId','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','find','eml-format','rimraf','zip-dir','request-promise','bluebird'];(function(_0x25b9e7,_0x63bd23){var _0x3aa8a2=function(_0x57ee77){while(--_0x57ee77){_0x25b9e7['push'](_0x25b9e7['shift']());}};_0x3aa8a2(++_0x63bd23);}(_0xdc97,0x13b));var _0x7dc9=function(_0x418ffa,_0x23a8b0){_0x418ffa=_0x418ffa-0x0;var _0x4064d8=_0xdc97[_0x418ffa];return _0x4064d8;};'use strict';var emlformat=require(_0x7dc9('0x0'));var rimraf=require(_0x7dc9('0x1'));var zipdir=require(_0x7dc9('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x7dc9('0x3'));var moment=require('moment');var BPromise=require(_0x7dc9('0x4'));var Mustache=require(_0x7dc9('0x5'));var util=require('util');var path=require(_0x7dc9('0x6'));var sox=require(_0x7dc9('0x7'));var csv=require(_0x7dc9('0x8'));var ejs=require(_0x7dc9('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x7dc9('0xa'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x7dc9('0xb'));var deskjs=require(_0x7dc9('0xc'));var toCsv=require(_0x7dc9('0x8'));var querystring=require(_0x7dc9('0xd'));var Papa=require(_0x7dc9('0xe'));var Redis=require('ioredis');var authService=require(_0x7dc9('0xf'));var qs=require(_0x7dc9('0x10'));var as=require(_0x7dc9('0x11'));var hardwareService=require(_0x7dc9('0x12'));var logger=require(_0x7dc9('0x13'))(_0x7dc9('0x14'));var utils=require(_0x7dc9('0x15'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x599ef1,_0x94c75a){_0x94c75a=_0x94c75a||0xcc;return function(_0x14e5db){if(_0x14e5db){return _0x599ef1['sendStatus'](_0x94c75a);}return _0x599ef1[_0x7dc9('0x16')](_0x94c75a)[_0x7dc9('0x17')]();};}function respondWithResult(_0xaadf2,_0xf37bc7){_0xf37bc7=_0xf37bc7||0xc8;return function(_0x31d43d){if(_0x31d43d){return _0xaadf2[_0x7dc9('0x16')](_0xf37bc7)['json'](_0x31d43d);}};}function respondWithFilteredResult(_0x3a54f2,_0x278191){return function(_0x1b0aa1){if(_0x1b0aa1){var _0x442819=typeof _0x278191[_0x7dc9('0x18')]===_0x7dc9('0x19')&&typeof _0x278191[_0x7dc9('0x1a')]===_0x7dc9('0x19');var _0x4778d5=_0x1b0aa1['count'];var _0x22577e=_0x442819?0x0:_0x278191['offset'];var _0x1f5906=_0x442819?_0x1b0aa1[_0x7dc9('0x1b')]:_0x278191['offset']+_0x278191[_0x7dc9('0x1a')];var _0x3b738a;if(_0x1f5906>=_0x4778d5){_0x1f5906=_0x4778d5;_0x3b738a=0xc8;}else{_0x3b738a=0xce;}_0x3a54f2[_0x7dc9('0x16')](_0x3b738a);return _0x3a54f2[_0x7dc9('0x1c')](_0x7dc9('0x1d'),_0x22577e+'-'+_0x1f5906+'/'+_0x4778d5)[_0x7dc9('0x1e')](_0x1b0aa1);}return null;};}function patchUpdates(_0x2dad65){return function(_0x2895f5){try{jsonpatch[_0x7dc9('0x1f')](_0x2895f5,_0x2dad65,!![]);}catch(_0x2b38d6){return BPromise['reject'](_0x2b38d6);}return _0x2895f5['save']();};}function saveUpdates(_0x12954f,_0x5981e2){return function(_0x596e0f){if(_0x596e0f){return _0x596e0f[_0x7dc9('0x20')](_0x12954f)[_0x7dc9('0x21')](function(_0x5e9525){return _0x5e9525;});}return null;};}function removeEntity(_0xffc080,_0x43d31f){return function(_0x41110a){if(_0x41110a){return _0x41110a['destroy']()[_0x7dc9('0x21')](function(){var _0x1e3a8d=_0x41110a[_0x7dc9('0x22')]({'plain':!![]});var _0x55a482='Metrics';return db['UserProfileResource'][_0x7dc9('0x23')]({'where':{'type':_0x55a482,'resourceId':_0x1e3a8d['id']}})[_0x7dc9('0x21')](function(){return _0x41110a;});})['then'](function(){_0xffc080['status'](0xcc)[_0x7dc9('0x17')]();});}};}function handleEntityNotFound(_0x5afb7d,_0x2d22eb){return function(_0x1c690b){if(!_0x1c690b){_0x5afb7d[_0x7dc9('0x24')](0x194);}return _0x1c690b;};}function handleError(_0x3e4102,_0xa2aaa9){_0xa2aaa9=_0xa2aaa9||0x1f4;return function(_0x450124){logger[_0x7dc9('0x25')](_0x450124[_0x7dc9('0x26')]);if(_0x450124[_0x7dc9('0x27')]){delete _0x450124[_0x7dc9('0x27')];}_0x3e4102[_0x7dc9('0x16')](_0xa2aaa9)[_0x7dc9('0x28')](_0x450124);};}exports['index']=function(_0x4e929c,_0x513dd6){var _0x49a4a5={},_0x4a68f0={},_0x553a03={'count':0x0,'rows':[]};var _0x58c4e8=_['map'](db[_0x7dc9('0x29')][_0x7dc9('0x2a')],function(_0x29dcef){return{'name':_0x29dcef[_0x7dc9('0x2b')],'type':_0x29dcef[_0x7dc9('0x2c')][_0x7dc9('0x2d')]};});_0x4a68f0['model']=_['map'](_0x58c4e8,'name');_0x4a68f0[_0x7dc9('0x2e')]=_['keys'](_0x4e929c[_0x7dc9('0x2e')]);_0x4a68f0[_0x7dc9('0x2f')]=_[_0x7dc9('0x30')](_0x4a68f0[_0x7dc9('0x31')],_0x4a68f0[_0x7dc9('0x2e')]);_0x49a4a5[_0x7dc9('0x32')]=_[_0x7dc9('0x30')](_0x4a68f0[_0x7dc9('0x31')],qs['fields'](_0x4e929c[_0x7dc9('0x2e')]['fields']));_0x49a4a5[_0x7dc9('0x32')]=_0x49a4a5[_0x7dc9('0x32')][_0x7dc9('0x33')]?_0x49a4a5[_0x7dc9('0x32')]:_0x4a68f0['model'];if(!_0x4e929c[_0x7dc9('0x2e')]['hasOwnProperty'](_0x7dc9('0x34'))){_0x49a4a5['limit']=qs['limit'](_0x4e929c[_0x7dc9('0x2e')][_0x7dc9('0x1a')]);_0x49a4a5[_0x7dc9('0x18')]=qs[_0x7dc9('0x18')](_0x4e929c['query'][_0x7dc9('0x18')]);}_0x49a4a5[_0x7dc9('0x35')]=qs[_0x7dc9('0x36')](_0x4e929c[_0x7dc9('0x2e')][_0x7dc9('0x36')]);_0x49a4a5[_0x7dc9('0x37')]=qs[_0x7dc9('0x2f')](_[_0x7dc9('0x38')](_0x4e929c[_0x7dc9('0x2e')],_0x4a68f0[_0x7dc9('0x2f')]),_0x58c4e8);if(_0x4e929c[_0x7dc9('0x2e')][_0x7dc9('0x39')]){_0x49a4a5['where']=_[_0x7dc9('0x3a')](_0x49a4a5[_0x7dc9('0x37')],{'$or':_[_0x7dc9('0x3b')](_0x58c4e8,function(_0xfd2612){if(_0xfd2612['type']!==_0x7dc9('0x3c')){var _0x89db0e={};_0x89db0e[_0xfd2612[_0x7dc9('0x27')]]={'$like':'%'+_0x4e929c[_0x7dc9('0x2e')][_0x7dc9('0x39')]+'%'};return _0x89db0e;}})});}_0x49a4a5=_[_0x7dc9('0x3a')]({},_0x49a4a5,_0x4e929c['options']);var _0x553230={'where':_0x49a4a5[_0x7dc9('0x37')]};return db[_0x7dc9('0x29')]['count'](_0x553230)[_0x7dc9('0x21')](function(_0x4a37ec){_0x553a03[_0x7dc9('0x1b')]=_0x4a37ec;if(_0x4e929c[_0x7dc9('0x2e')][_0x7dc9('0x3d')]){_0x49a4a5['include']=[{'all':!![]}];}return db[_0x7dc9('0x29')][_0x7dc9('0x3e')](_0x49a4a5);})[_0x7dc9('0x21')](function(_0x95513c){_0x553a03[_0x7dc9('0x3f')]=_0x95513c;return _0x553a03;})[_0x7dc9('0x21')](respondWithFilteredResult(_0x513dd6,_0x49a4a5))[_0x7dc9('0x40')](handleError(_0x513dd6,null));};exports['show']=function(_0x187aa6,_0x4f29b2){var _0x52d883={'raw':!![],'where':{'id':_0x187aa6[_0x7dc9('0x41')]['id']}},_0xcced6c={};_0xcced6c[_0x7dc9('0x31')]=_[_0x7dc9('0x42')](db[_0x7dc9('0x29')][_0x7dc9('0x2a')]);_0xcced6c[_0x7dc9('0x2e')]=_[_0x7dc9('0x42')](_0x187aa6[_0x7dc9('0x2e')]);_0xcced6c['filters']=_[_0x7dc9('0x30')](_0xcced6c[_0x7dc9('0x31')],_0xcced6c[_0x7dc9('0x2e')]);_0x52d883[_0x7dc9('0x32')]=_[_0x7dc9('0x30')](_0xcced6c[_0x7dc9('0x31')],qs['fields'](_0x187aa6[_0x7dc9('0x2e')][_0x7dc9('0x43')]));_0x52d883['attributes']=_0x52d883[_0x7dc9('0x32')][_0x7dc9('0x33')]?_0x52d883[_0x7dc9('0x32')]:_0xcced6c['model'];if(_0x187aa6[_0x7dc9('0x2e')]['includeAll']){_0x52d883['include']=[{'all':!![]}];}_0x52d883=_[_0x7dc9('0x3a')]({},_0x52d883,_0x187aa6[_0x7dc9('0x44')]);return db[_0x7dc9('0x29')]['find'](_0x52d883)['then'](handleEntityNotFound(_0x4f29b2,null))[_0x7dc9('0x21')](respondWithResult(_0x4f29b2,null))['catch'](handleError(_0x4f29b2,null));};exports[_0x7dc9('0x45')]=function(_0x4ab558,_0x5e2d59){return db[_0x7dc9('0x29')][_0x7dc9('0x45')](_0x4ab558[_0x7dc9('0x46')],{})[_0x7dc9('0x21')](function(_0x414bf4){var _0x113087=_0x4ab558[_0x7dc9('0x47')][_0x7dc9('0x22')]({'plain':!![]});if(!_0x113087)throw new Error(_0x7dc9('0x48'));if(_0x113087[_0x7dc9('0x49')]===_0x7dc9('0x47')){var _0x13580b=_0x414bf4[_0x7dc9('0x22')]({'plain':!![]});var _0x59be9b=_0x7dc9('0x4a');return db['UserProfileSection']['find']({'where':{'name':_0x59be9b,'userProfileId':_0x113087[_0x7dc9('0x4b')]},'raw':!![]})[_0x7dc9('0x21')](function(_0x40e382){if(_0x40e382&&_0x40e382[_0x7dc9('0x4c')]===0x0){return db[_0x7dc9('0x4d')]['create']({'name':_0x13580b[_0x7dc9('0x27')],'resourceId':_0x13580b['id'],'type':_0x40e382[_0x7dc9('0x27')],'sectionId':_0x40e382['id']},{})[_0x7dc9('0x21')](function(){return _0x414bf4;});}else{return _0x414bf4;}})['catch'](function(_0x341909){logger[_0x7dc9('0x25')](_0x7dc9('0x4e'),_0x341909);throw _0x341909;});}return _0x414bf4;})[_0x7dc9('0x21')](respondWithResult(_0x5e2d59,0xc9))[_0x7dc9('0x40')](handleError(_0x5e2d59,null));};exports[_0x7dc9('0x20')]=function(_0x593132,_0x366b8b){if(_0x593132[_0x7dc9('0x46')]['id']){delete _0x593132[_0x7dc9('0x46')]['id'];}return db[_0x7dc9('0x29')][_0x7dc9('0x4f')]({'where':{'id':_0x593132[_0x7dc9('0x41')]['id']}})[_0x7dc9('0x21')](handleEntityNotFound(_0x366b8b,null))[_0x7dc9('0x21')](saveUpdates(_0x593132[_0x7dc9('0x46')],null))[_0x7dc9('0x21')](respondWithResult(_0x366b8b,null))[_0x7dc9('0x40')](handleError(_0x366b8b,null));};exports[_0x7dc9('0x23')]=function(_0x4fec6e,_0x1767b6){return db[_0x7dc9('0x29')][_0x7dc9('0x4f')]({'where':{'id':_0x4fec6e[_0x7dc9('0x41')]['id']}})[_0x7dc9('0x21')](handleEntityNotFound(_0x1767b6,null))['then'](removeEntity(_0x1767b6,null))[_0x7dc9('0x40')](handleError(_0x1767b6,null));};
\ No newline at end of file
+var _0xe14b=['papaparse','ioredis','../../components/auth/service','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','undefined','limit','count','offset','set','json','apply','save','update','then','get','Metrics','UserProfileResource','destroy','error','stack','name','send','index','map','AnalyticMetric','rawAttributes','fieldName','type','model','query','filters','attributes','intersection','fields','order','sort','pick','filter','where','merge','VIRTUAL','options','include','findAll','rows','show','keys','length','includeAll','find','catch','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','params','eml-format','rimraf','request-promise','moment','mustache','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','querystring'];(function(_0x5a91f6,_0x25bb7a){var _0x2b3e71=function(_0x207fd8){while(--_0x207fd8){_0x5a91f6['push'](_0x5a91f6['shift']());}};_0x2b3e71(++_0x25bb7a);}(_0xe14b,0x93));var _0xbe14=function(_0x177e71,_0x4158be){_0x177e71=_0x177e71-0x0;var _0x20143d=_0xe14b[_0x177e71];return _0x20143d;};'use strict';var emlformat=require(_0xbe14('0x0'));var rimraf=require(_0xbe14('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0xbe14('0x2'));var moment=require(_0xbe14('0x3'));var BPromise=require('bluebird');var Mustache=require(_0xbe14('0x4'));var util=require('util');var path=require('path');var sox=require(_0xbe14('0x5'));var csv=require(_0xbe14('0x6'));var ejs=require(_0xbe14('0x7'));var fs=require('fs');var fs_extra=require(_0xbe14('0x8'));var _=require(_0xbe14('0x9'));var squel=require(_0xbe14('0xa'));var crypto=require(_0xbe14('0xb'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0xbe14('0xc'));var Papa=require(_0xbe14('0xd'));var Redis=require(_0xbe14('0xe'));var authService=require(_0xbe14('0xf'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xbe14('0x10'));var logger=require(_0xbe14('0x11'))('api');var utils=require(_0xbe14('0x12'));var config=require(_0xbe14('0x13'));var licenseUtil=require(_0xbe14('0x14'));var db=require(_0xbe14('0x15'))['db'];function respondWithStatusCode(_0x27792f,_0x3b898d){_0x3b898d=_0x3b898d||0xcc;return function(_0x23a730){if(_0x23a730){return _0x27792f[_0xbe14('0x16')](_0x3b898d);}return _0x27792f[_0xbe14('0x17')](_0x3b898d)[_0xbe14('0x18')]();};}function respondWithResult(_0x1e4826,_0x33fd54){_0x33fd54=_0x33fd54||0xc8;return function(_0x813399){if(_0x813399){return _0x1e4826['status'](_0x33fd54)['json'](_0x813399);}};}function respondWithFilteredResult(_0x3f58f5,_0x3dc4a9){return function(_0xf4ac9){if(_0xf4ac9){var _0x37ce4e=typeof _0x3dc4a9['offset']===_0xbe14('0x19')&&typeof _0x3dc4a9[_0xbe14('0x1a')]===_0xbe14('0x19');var _0x123ede=_0xf4ac9[_0xbe14('0x1b')];var _0x29ab73=_0x37ce4e?0x0:_0x3dc4a9[_0xbe14('0x1c')];var _0x5ea1f8=_0x37ce4e?_0xf4ac9[_0xbe14('0x1b')]:_0x3dc4a9[_0xbe14('0x1c')]+_0x3dc4a9[_0xbe14('0x1a')];var _0x433459;if(_0x5ea1f8>=_0x123ede){_0x5ea1f8=_0x123ede;_0x433459=0xc8;}else{_0x433459=0xce;}_0x3f58f5[_0xbe14('0x17')](_0x433459);return _0x3f58f5[_0xbe14('0x1d')]('Content-Range',_0x29ab73+'-'+_0x5ea1f8+'/'+_0x123ede)[_0xbe14('0x1e')](_0xf4ac9);}return null;};}function patchUpdates(_0x4a1bbd){return function(_0x417c8d){try{jsonpatch[_0xbe14('0x1f')](_0x417c8d,_0x4a1bbd,!![]);}catch(_0x188ec4){return BPromise['reject'](_0x188ec4);}return _0x417c8d[_0xbe14('0x20')]();};}function saveUpdates(_0x56d845,_0x3c1c85){return function(_0x56e80c){if(_0x56e80c){return _0x56e80c[_0xbe14('0x21')](_0x56d845)['then'](function(_0x274018){return _0x274018;});}return null;};}function removeEntity(_0x3d3608,_0x505dbd){return function(_0x2da350){if(_0x2da350){return _0x2da350['destroy']()[_0xbe14('0x22')](function(){var _0x4851f8=_0x2da350[_0xbe14('0x23')]({'plain':!![]});var _0x5fa043=_0xbe14('0x24');return db[_0xbe14('0x25')][_0xbe14('0x26')]({'where':{'type':_0x5fa043,'resourceId':_0x4851f8['id']}})[_0xbe14('0x22')](function(){return _0x2da350;});})['then'](function(){_0x3d3608[_0xbe14('0x17')](0xcc)[_0xbe14('0x18')]();});}};}function handleEntityNotFound(_0x391556,_0x169369){return function(_0x5dd475){if(!_0x5dd475){_0x391556[_0xbe14('0x16')](0x194);}return _0x5dd475;};}function handleError(_0x29fc64,_0x59bf34){_0x59bf34=_0x59bf34||0x1f4;return function(_0x3c3613){logger[_0xbe14('0x27')](_0x3c3613[_0xbe14('0x28')]);if(_0x3c3613[_0xbe14('0x29')]){delete _0x3c3613[_0xbe14('0x29')];}_0x29fc64[_0xbe14('0x17')](_0x59bf34)[_0xbe14('0x2a')](_0x3c3613);};}exports[_0xbe14('0x2b')]=function(_0x4168c8,_0x16a159){var _0x40538f={},_0x3bf43c={},_0x39dc0a={'count':0x0,'rows':[]};var _0x10ae36=_[_0xbe14('0x2c')](db[_0xbe14('0x2d')][_0xbe14('0x2e')],function(_0x2ff48e){return{'name':_0x2ff48e[_0xbe14('0x2f')],'type':_0x2ff48e[_0xbe14('0x30')]['key']};});_0x3bf43c[_0xbe14('0x31')]=_['map'](_0x10ae36,'name');_0x3bf43c[_0xbe14('0x32')]=_['keys'](_0x4168c8[_0xbe14('0x32')]);_0x3bf43c[_0xbe14('0x33')]=_['intersection'](_0x3bf43c['model'],_0x3bf43c['query']);_0x40538f[_0xbe14('0x34')]=_[_0xbe14('0x35')](_0x3bf43c['model'],qs[_0xbe14('0x36')](_0x4168c8[_0xbe14('0x32')][_0xbe14('0x36')]));_0x40538f[_0xbe14('0x34')]=_0x40538f[_0xbe14('0x34')]['length']?_0x40538f['attributes']:_0x3bf43c[_0xbe14('0x31')];if(!_0x4168c8['query']['hasOwnProperty']('nolimit')){_0x40538f[_0xbe14('0x1a')]=qs[_0xbe14('0x1a')](_0x4168c8[_0xbe14('0x32')][_0xbe14('0x1a')]);_0x40538f[_0xbe14('0x1c')]=qs[_0xbe14('0x1c')](_0x4168c8[_0xbe14('0x32')][_0xbe14('0x1c')]);}_0x40538f[_0xbe14('0x37')]=qs[_0xbe14('0x38')](_0x4168c8[_0xbe14('0x32')][_0xbe14('0x38')]);_0x40538f['where']=qs['filters'](_[_0xbe14('0x39')](_0x4168c8[_0xbe14('0x32')],_0x3bf43c[_0xbe14('0x33')]),_0x10ae36);if(_0x4168c8['query'][_0xbe14('0x3a')]){_0x40538f[_0xbe14('0x3b')]=_[_0xbe14('0x3c')](_0x40538f[_0xbe14('0x3b')],{'$or':_[_0xbe14('0x2c')](_0x10ae36,function(_0x25ee1f){if(_0x25ee1f[_0xbe14('0x30')]!==_0xbe14('0x3d')){var _0x1b2608={};_0x1b2608[_0x25ee1f['name']]={'$like':'%'+_0x4168c8[_0xbe14('0x32')][_0xbe14('0x3a')]+'%'};return _0x1b2608;}})});}_0x40538f=_[_0xbe14('0x3c')]({},_0x40538f,_0x4168c8[_0xbe14('0x3e')]);var _0x3287b9={'where':_0x40538f[_0xbe14('0x3b')]};return db['AnalyticMetric'][_0xbe14('0x1b')](_0x3287b9)[_0xbe14('0x22')](function(_0x1220c9){_0x39dc0a[_0xbe14('0x1b')]=_0x1220c9;if(_0x4168c8['query']['includeAll']){_0x40538f[_0xbe14('0x3f')]=[{'all':!![]}];}return db[_0xbe14('0x2d')][_0xbe14('0x40')](_0x40538f);})['then'](function(_0x5d5318){_0x39dc0a[_0xbe14('0x41')]=_0x5d5318;return _0x39dc0a;})['then'](respondWithFilteredResult(_0x16a159,_0x40538f))['catch'](handleError(_0x16a159,null));};exports[_0xbe14('0x42')]=function(_0x1f0355,_0x8216c3){var _0x5051e4={'raw':!![],'where':{'id':_0x1f0355['params']['id']}},_0x558525={};_0x558525[_0xbe14('0x31')]=_[_0xbe14('0x43')](db[_0xbe14('0x2d')]['rawAttributes']);_0x558525[_0xbe14('0x32')]=_[_0xbe14('0x43')](_0x1f0355[_0xbe14('0x32')]);_0x558525[_0xbe14('0x33')]=_['intersection'](_0x558525['model'],_0x558525[_0xbe14('0x32')]);_0x5051e4[_0xbe14('0x34')]=_[_0xbe14('0x35')](_0x558525[_0xbe14('0x31')],qs[_0xbe14('0x36')](_0x1f0355['query']['fields']));_0x5051e4[_0xbe14('0x34')]=_0x5051e4[_0xbe14('0x34')][_0xbe14('0x44')]?_0x5051e4[_0xbe14('0x34')]:_0x558525['model'];if(_0x1f0355[_0xbe14('0x32')][_0xbe14('0x45')]){_0x5051e4['include']=[{'all':!![]}];}_0x5051e4=_[_0xbe14('0x3c')]({},_0x5051e4,_0x1f0355[_0xbe14('0x3e')]);return db[_0xbe14('0x2d')][_0xbe14('0x46')](_0x5051e4)['then'](handleEntityNotFound(_0x8216c3,null))['then'](respondWithResult(_0x8216c3,null))[_0xbe14('0x47')](handleError(_0x8216c3,null));};exports[_0xbe14('0x48')]=function(_0x4a1a37,_0x5acf90){return db[_0xbe14('0x2d')][_0xbe14('0x48')](_0x4a1a37[_0xbe14('0x49')],{})[_0xbe14('0x22')](function(_0xdbc6e1){var _0xd04fd5=_0x4a1a37[_0xbe14('0x4a')]['get']({'plain':!![]});if(!_0xd04fd5)throw new Error(_0xbe14('0x4b'));if(_0xd04fd5[_0xbe14('0x4c')]===_0xbe14('0x4a')){var _0x22b1f8=_0xdbc6e1[_0xbe14('0x23')]({'plain':!![]});var _0x494c32=_0xbe14('0x24');return db[_0xbe14('0x4d')][_0xbe14('0x46')]({'where':{'name':_0x494c32,'userProfileId':_0xd04fd5[_0xbe14('0x4e')]},'raw':!![]})[_0xbe14('0x22')](function(_0x2dbeb1){if(_0x2dbeb1&&_0x2dbeb1['autoAssociation']===0x0){return db['UserProfileResource'][_0xbe14('0x48')]({'name':_0x22b1f8[_0xbe14('0x29')],'resourceId':_0x22b1f8['id'],'type':_0x2dbeb1[_0xbe14('0x29')],'sectionId':_0x2dbeb1['id']},{})['then'](function(){return _0xdbc6e1;});}else{return _0xdbc6e1;}})['catch'](function(_0x44fe0d){logger[_0xbe14('0x27')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x44fe0d);throw _0x44fe0d;});}return _0xdbc6e1;})[_0xbe14('0x22')](respondWithResult(_0x5acf90,0xc9))[_0xbe14('0x47')](handleError(_0x5acf90,null));};exports['update']=function(_0x28f995,_0x4a40d2){if(_0x28f995[_0xbe14('0x49')]['id']){delete _0x28f995[_0xbe14('0x49')]['id'];}return db[_0xbe14('0x2d')]['find']({'where':{'id':_0x28f995[_0xbe14('0x4f')]['id']}})[_0xbe14('0x22')](handleEntityNotFound(_0x4a40d2,null))['then'](saveUpdates(_0x28f995[_0xbe14('0x49')],null))[_0xbe14('0x22')](respondWithResult(_0x4a40d2,null))[_0xbe14('0x47')](handleError(_0x4a40d2,null));};exports[_0xbe14('0x26')]=function(_0x49322f,_0x4f06a3){return db[_0xbe14('0x2d')][_0xbe14('0x46')]({'where':{'id':_0x49322f[_0xbe14('0x4f')]['id']}})[_0xbe14('0x22')](handleEntityNotFound(_0x4f06a3,null))[_0xbe14('0x22')](removeEntity(_0x4f06a3,null))[_0xbe14('0x47')](handleError(_0x4f06a3,null));};
\ No newline at end of file
diff --git a/server/api/analyticMetric/analyticMetric.model.js b/server/api/analyticMetric/analyticMetric.model.js
index 3ab4192..40a0c54 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 _0x5398=['request-promise','path','./analyticMetric.attributes','exports','define','AnalyticMetric','util','../../config/logger','api','moment','bluebird'];(function(_0x2261ce,_0x9ed8b6){var _0x524640=function(_0x3cbb90){while(--_0x3cbb90){_0x2261ce['push'](_0x2261ce['shift']());}};_0x524640(++_0x9ed8b6);}(_0x5398,0xe2));var _0x8539=function(_0x121027,_0x37547f){_0x121027=_0x121027-0x0;var _0x4eaded=_0x5398[_0x121027];return _0x4eaded;};'use strict';var _=require('lodash');var util=require(_0x8539('0x0'));var logger=require(_0x8539('0x1'))(_0x8539('0x2'));var moment=require(_0x8539('0x3'));var BPromise=require(_0x8539('0x4'));var rp=require(_0x8539('0x5'));var fs=require('fs');var path=require(_0x8539('0x6'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x8539('0x7'));module[_0x8539('0x8')]=function(_0x14ddc9,_0xcca1c0){return _0x14ddc9[_0x8539('0x9')](_0x8539('0xa'),attributes,{'tableName':'analytics_metrics','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x0b3d=['moment','request-promise','rimraf','./analyticMetric.attributes','exports','AnalyticMetric','lodash','../../config/logger'];(function(_0x1271e0,_0x1e479d){var _0x445023=function(_0x56b6c7){while(--_0x56b6c7){_0x1271e0['push'](_0x1271e0['shift']());}};_0x445023(++_0x1e479d);}(_0x0b3d,0x76));var _0xd0b3=function(_0xe336e0,_0x18f796){_0xe336e0=_0xe336e0-0x0;var _0x19d2c6=_0x0b3d[_0xe336e0];return _0x19d2c6;};'use strict';var _=require(_0xd0b3('0x0'));var util=require('util');var logger=require(_0xd0b3('0x1'))('api');var moment=require(_0xd0b3('0x2'));var BPromise=require('bluebird');var rp=require(_0xd0b3('0x3'));var fs=require('fs');var path=require('path');var rimraf=require(_0xd0b3('0x4'));var config=require('../../config/environment');var attributes=require(_0xd0b3('0x5'));module[_0xd0b3('0x6')]=function(_0x5b80df,_0x2968c9){return _0x5b80df['define'](_0xd0b3('0x7'),attributes,{'tableName':'analytics_metrics','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 4808d80..a07c4ca 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 _0x5785=['error','code','AnalyticMetric,\x20%s,\x20%s','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../config/logger','../../config/environment','client','http','request','then','info','request\x20sent','debug','AnalyticMetric,\x20%s,\x20%s,\x20%s'];(function(_0x3d94cb,_0x41d809){var _0x1e093d=function(_0x14fd5b){while(--_0x14fd5b){_0x3d94cb['push'](_0x3d94cb['shift']());}};_0x1e093d(++_0x41d809);}(_0x5785,0x124));var _0x5578=function(_0xc4001c,_0x1bf8f0){_0xc4001c=_0xc4001c-0x0;var _0x49f7bc=_0x5785[_0xc4001c];return _0x49f7bc;};'use strict';var _=require(_0x5578('0x0'));var util=require(_0x5578('0x1'));var moment=require(_0x5578('0x2'));var BPromise=require(_0x5578('0x3'));var rs=require(_0x5578('0x4'));var fs=require('fs');var Redis=require(_0x5578('0x5'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x5578('0x6'))('rpc');var config=require(_0x5578('0x7'));var jayson=require('jayson/promise');var client=jayson[_0x5578('0x8')][_0x5578('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x405c04,_0x4906d6,_0xd994f){return new BPromise(function(_0x5b2e9a,_0x36d5b1){return client[_0x5578('0xa')](_0x405c04,_0xd994f)[_0x5578('0xb')](function(_0x3bb7dd){logger[_0x5578('0xc')]('AnalyticMetric,\x20%s,\x20%s',_0x4906d6,_0x5578('0xd'));logger[_0x5578('0xe')](_0x5578('0xf'),_0x4906d6,_0x5578('0xd'),JSON['stringify'](_0x3bb7dd));if(_0x3bb7dd['error']){if(_0x3bb7dd[_0x5578('0x10')][_0x5578('0x11')]===0x1f4){logger[_0x5578('0x10')](_0x5578('0x12'),_0x4906d6,_0x3bb7dd[_0x5578('0x10')][_0x5578('0x13')]);return _0x36d5b1(_0x3bb7dd[_0x5578('0x10')][_0x5578('0x13')]);}logger[_0x5578('0x10')](_0x5578('0x12'),_0x4906d6,_0x3bb7dd[_0x5578('0x10')][_0x5578('0x13')]);return _0x5b2e9a(_0x3bb7dd[_0x5578('0x10')]['message']);}else{logger[_0x5578('0xc')](_0x5578('0x12'),_0x4906d6,'request\x20sent');_0x5b2e9a(_0x3bb7dd[_0x5578('0x14')][_0x5578('0x13')]);}})[_0x5578('0x15')](function(_0x2a1030){logger[_0x5578('0x10')](_0x5578('0x12'),_0x4906d6,_0x2a1030);_0x36d5b1(_0x2a1030);});});}
\ No newline at end of file
+var _0x06ec=['http','then','info','AnalyticMetric,\x20%s,\x20%s','request\x20sent','debug','AnalyticMetric,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','bluebird','randomstring','../../config/utils','rpc','../../config/environment','jayson/promise','client'];(function(_0x584683,_0x46a0a4){var _0x57bbf4=function(_0x3180c6){while(--_0x3180c6){_0x584683['push'](_0x584683['shift']());}};_0x57bbf4(++_0x46a0a4);}(_0x06ec,0xf4));var _0xc06e=function(_0x184966,_0x456a47){_0x184966=_0x184966-0x0;var _0x4c2820=_0x06ec[_0x184966];return _0x4c2820;};'use strict';var _=require(_0xc06e('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0xc06e('0x1'));var rs=require(_0xc06e('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0xc06e('0x3'));var logger=require('../../config/logger')(_0xc06e('0x4'));var config=require(_0xc06e('0x5'));var jayson=require(_0xc06e('0x6'));var client=jayson[_0xc06e('0x7')][_0xc06e('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x44fa2f,_0x6c1faf,_0x23a112){return new BPromise(function(_0x598358,_0x568589){return client['request'](_0x44fa2f,_0x23a112)[_0xc06e('0x9')](function(_0x3b6092){logger[_0xc06e('0xa')](_0xc06e('0xb'),_0x6c1faf,_0xc06e('0xc'));logger[_0xc06e('0xd')](_0xc06e('0xe'),_0x6c1faf,_0xc06e('0xc'),JSON[_0xc06e('0xf')](_0x3b6092));if(_0x3b6092[_0xc06e('0x10')]){if(_0x3b6092['error'][_0xc06e('0x11')]===0x1f4){logger['error'](_0xc06e('0xb'),_0x6c1faf,_0x3b6092['error'][_0xc06e('0x12')]);return _0x568589(_0x3b6092['error'][_0xc06e('0x12')]);}logger[_0xc06e('0x10')](_0xc06e('0xb'),_0x6c1faf,_0x3b6092[_0xc06e('0x10')][_0xc06e('0x12')]);return _0x598358(_0x3b6092[_0xc06e('0x10')][_0xc06e('0x12')]);}else{logger[_0xc06e('0xa')](_0xc06e('0xb'),_0x6c1faf,_0xc06e('0xc'));_0x598358(_0x3b6092[_0xc06e('0x13')]['message']);}})[_0xc06e('0x14')](function(_0x8b62d){logger['error'](_0xc06e('0xb'),_0x6c1faf,_0x8b62d);_0x568589(_0x8b62d);});});}
\ No newline at end of file
diff --git a/server/api/analyticMetric/index.js b/server/api/analyticMetric/index.js
index 2fb3e09..d594626 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 _0x6bb4=['path','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./analyticMetric.controller','get','isAuthenticated','/:id','create','put','update','delete','destroy','multer','util'];(function(_0x115b39,_0x2dfdbe){var _0x32e700=function(_0x4c0dd0){while(--_0x4c0dd0){_0x115b39['push'](_0x115b39['shift']());}};_0x32e700(++_0x2dfdbe);}(_0x6bb4,0x1a7));var _0x46bb=function(_0x17ef56,_0x374f14){_0x17ef56=_0x17ef56-0x0;var _0xf75b6f=_0x6bb4[_0x17ef56];return _0xf75b6f;};'use strict';var multer=require(_0x46bb('0x0'));var util=require(_0x46bb('0x1'));var path=require(_0x46bb('0x2'));var timeout=require('connect-timeout');var express=require(_0x46bb('0x3'));var router=express[_0x46bb('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x46bb('0x5'));var interaction=require(_0x46bb('0x6'));var config=require(_0x46bb('0x7'));var controller=require(_0x46bb('0x8'));router[_0x46bb('0x9')]('/',auth[_0x46bb('0xa')](),controller['index']);router['get'](_0x46bb('0xb'),auth[_0x46bb('0xa')](),controller['show']);router['post']('/',auth['isAuthenticated'](),controller[_0x46bb('0xc')]);router[_0x46bb('0xd')]('/:id',auth[_0x46bb('0xa')](),controller[_0x46bb('0xe')]);router[_0x46bb('0xf')]('/:id',auth[_0x46bb('0xa')](),controller[_0x46bb('0x10')]);module['exports']=router;
\ No newline at end of file
+var _0x1f75=['../../components/auth/service','../../components/interaction/service','../../config/environment','./analyticMetric.controller','get','isAuthenticated','index','/:id','show','post','delete','exports','multer','util','path','express','Router','fs-extra'];(function(_0x40a045,_0x516f0e){var _0x1a687c=function(_0x48c9fe){while(--_0x48c9fe){_0x40a045['push'](_0x40a045['shift']());}};_0x1a687c(++_0x516f0e);}(_0x1f75,0x12c));var _0x51f7=function(_0x1ac595,_0x5d2081){_0x1ac595=_0x1ac595-0x0;var _0x455fff=_0x1f75[_0x1ac595];return _0x455fff;};'use strict';var multer=require(_0x51f7('0x0'));var util=require(_0x51f7('0x1'));var path=require(_0x51f7('0x2'));var timeout=require('connect-timeout');var express=require(_0x51f7('0x3'));var router=express[_0x51f7('0x4')]();var fs_extra=require(_0x51f7('0x5'));var auth=require(_0x51f7('0x6'));var interaction=require(_0x51f7('0x7'));var config=require(_0x51f7('0x8'));var controller=require(_0x51f7('0x9'));router[_0x51f7('0xa')]('/',auth[_0x51f7('0xb')](),controller[_0x51f7('0xc')]);router[_0x51f7('0xa')](_0x51f7('0xd'),auth['isAuthenticated'](),controller[_0x51f7('0xe')]);router[_0x51f7('0xf')]('/',auth[_0x51f7('0xb')](),controller['create']);router['put'](_0x51f7('0xd'),auth[_0x51f7('0xb')](),controller['update']);router[_0x51f7('0x10')](_0x51f7('0xd'),auth['isAuthenticated'](),controller['destroy']);module[_0x51f7('0x11')]=router;
\ No newline at end of file
diff --git a/server/api/analyticTreeReport/analyticTreeReport.attributes.js b/server/api/analyticTreeReport/analyticTreeReport.attributes.js
index 4dd3ad5..7c9c811 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 _0xc1df=['exports','TEXT','sequelize'];(function(_0x2185fd,_0x123181){var _0x1eec9b=function(_0x4d0bd4){while(--_0x4d0bd4){_0x2185fd['push'](_0x2185fd['shift']());}};_0x1eec9b(++_0x123181);}(_0xc1df,0x15b));var _0xfc1d=function(_0x42cae2,_0x284ef8){_0x42cae2=_0x42cae2-0x0;var _0x5f256f=_0xc1df[_0x42cae2];return _0x5f256f;};'use strict';var Sequelize=require(_0xfc1d('0x0'));module[_0xfc1d('0x1')]={'tree':{'type':Sequelize[_0xfc1d('0x2')],'allowNull':![]}};
\ No newline at end of file
+var _0x724c=['sequelize','exports'];(function(_0x5dbeee,_0x2620ef){var _0x25f820=function(_0x57d990){while(--_0x57d990){_0x5dbeee['push'](_0x5dbeee['shift']());}};_0x25f820(++_0x2620ef);}(_0x724c,0x10a));var _0xc724=function(_0x4aaab1,_0x452f18){_0x4aaab1=_0x4aaab1-0x0;var _0x5604e8=_0x724c[_0x4aaab1];return _0x5604e8;};'use strict';var Sequelize=require(_0xc724('0x0'));module[_0xc724('0x1')]={'tree':{'type':Sequelize['TEXT'],'allowNull':![]}};
\ No newline at end of file
diff --git a/server/api/analyticTreeReport/analyticTreeReport.controller.js b/server/api/analyticTreeReport/analyticTreeReport.controller.js
index d69e77c..9fc6087 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 _0x5354=['fieldName','key','model','map','query','keys','filters','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','sort','where','merge','type','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','params','rawAttributes','find','create','body','destroy','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','mustache','path','to-csv','fs-extra','lodash','crypto','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','sendStatus','status','end','json','undefined','limit','offset','count','Content-Range','apply','save','update','then','error','stack','name','index','AnalyticTreeReport'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x5354,0xb0));var _0x4535=function(_0x396457,_0xaaf513){_0x396457=_0x396457-0x0;var _0x130a1c=_0x5354[_0x396457];return _0x130a1c;};'use strict';var emlformat=require(_0x4535('0x0'));var rimraf=require(_0x4535('0x1'));var zipdir=require(_0x4535('0x2'));var jsonpatch=require(_0x4535('0x3'));var rp=require(_0x4535('0x4'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x4535('0x5'));var util=require('util');var path=require(_0x4535('0x6'));var sox=require('sox');var csv=require(_0x4535('0x7'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x4535('0x8'));var _=require(_0x4535('0x9'));var squel=require('squel');var crypto=require(_0x4535('0xa'));var jsforce=require(_0x4535('0xb'));var deskjs=require('desk.js');var toCsv=require(_0x4535('0x7'));var querystring=require(_0x4535('0xc'));var Papa=require(_0x4535('0xd'));var Redis=require(_0x4535('0xe'));var authService=require(_0x4535('0xf'));var qs=require(_0x4535('0x10'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x4535('0x11'));var logger=require(_0x4535('0x12'))(_0x4535('0x13'));var utils=require('../../config/utils');var config=require(_0x4535('0x14'));var licenseUtil=require(_0x4535('0x15'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x491859,_0x3d885b){_0x3d885b=_0x3d885b||0xcc;return function(_0x26fca6){if(_0x26fca6){return _0x491859[_0x4535('0x16')](_0x3d885b);}return _0x491859[_0x4535('0x17')](_0x3d885b)[_0x4535('0x18')]();};}function respondWithResult(_0x2bb086,_0x546c58){_0x546c58=_0x546c58||0xc8;return function(_0x79fd2c){if(_0x79fd2c){return _0x2bb086['status'](_0x546c58)[_0x4535('0x19')](_0x79fd2c);}};}function respondWithFilteredResult(_0x24b691,_0x440276){return function(_0x5f2765){if(_0x5f2765){var _0x21e612=typeof _0x440276['offset']===_0x4535('0x1a')&&typeof _0x440276[_0x4535('0x1b')]==='undefined';var _0x14030b=_0x5f2765['count'];var _0x2642cb=_0x21e612?0x0:_0x440276[_0x4535('0x1c')];var _0x51ab8c=_0x21e612?_0x5f2765[_0x4535('0x1d')]:_0x440276[_0x4535('0x1c')]+_0x440276[_0x4535('0x1b')];var _0x1d11a0;if(_0x51ab8c>=_0x14030b){_0x51ab8c=_0x14030b;_0x1d11a0=0xc8;}else{_0x1d11a0=0xce;}_0x24b691[_0x4535('0x17')](_0x1d11a0);return _0x24b691['set'](_0x4535('0x1e'),_0x2642cb+'-'+_0x51ab8c+'/'+_0x14030b)[_0x4535('0x19')](_0x5f2765);}return null;};}function patchUpdates(_0x560f9e){return function(_0x353e13){try{jsonpatch[_0x4535('0x1f')](_0x353e13,_0x560f9e,!![]);}catch(_0x9c9729){return BPromise['reject'](_0x9c9729);}return _0x353e13[_0x4535('0x20')]();};}function saveUpdates(_0x3b44d8,_0x290e23){return function(_0x339c79){if(_0x339c79){return _0x339c79[_0x4535('0x21')](_0x3b44d8)[_0x4535('0x22')](function(_0x3aa816){return _0x3aa816;});}return null;};}function removeEntity(_0x25c45b,_0x10836b){return function(_0x473e6f){if(_0x473e6f){return _0x473e6f['destroy']()[_0x4535('0x22')](function(){_0x25c45b[_0x4535('0x17')](0xcc)[_0x4535('0x18')]();});}};}function handleEntityNotFound(_0x5ef96a,_0x40be67){return function(_0x315532){if(!_0x315532){_0x5ef96a[_0x4535('0x16')](0x194);}return _0x315532;};}function handleError(_0x5b8157,_0x39f759){_0x39f759=_0x39f759||0x1f4;return function(_0x369c79){logger[_0x4535('0x23')](_0x369c79[_0x4535('0x24')]);if(_0x369c79[_0x4535('0x25')]){delete _0x369c79[_0x4535('0x25')];}_0x5b8157['status'](_0x39f759)['send'](_0x369c79);};}exports[_0x4535('0x26')]=function(_0x1d02cb,_0x5afbb5){var _0x3204a2={},_0x277e79={},_0x1255b9={'count':0x0,'rows':[]};var _0x427926=_['map'](db[_0x4535('0x27')]['rawAttributes'],function(_0x4331d6){return{'name':_0x4331d6[_0x4535('0x28')],'type':_0x4331d6['type'][_0x4535('0x29')]};});_0x277e79[_0x4535('0x2a')]=_[_0x4535('0x2b')](_0x427926,_0x4535('0x25'));_0x277e79[_0x4535('0x2c')]=_[_0x4535('0x2d')](_0x1d02cb[_0x4535('0x2c')]);_0x277e79[_0x4535('0x2e')]=_['intersection'](_0x277e79[_0x4535('0x2a')],_0x277e79[_0x4535('0x2c')]);_0x3204a2[_0x4535('0x2f')]=_[_0x4535('0x30')](_0x277e79[_0x4535('0x2a')],qs[_0x4535('0x31')](_0x1d02cb['query']['fields']));_0x3204a2[_0x4535('0x2f')]=_0x3204a2[_0x4535('0x2f')][_0x4535('0x32')]?_0x3204a2[_0x4535('0x2f')]:_0x277e79[_0x4535('0x2a')];if(!_0x1d02cb[_0x4535('0x2c')][_0x4535('0x33')](_0x4535('0x34'))){_0x3204a2[_0x4535('0x1b')]=qs[_0x4535('0x1b')](_0x1d02cb[_0x4535('0x2c')][_0x4535('0x1b')]);_0x3204a2[_0x4535('0x1c')]=qs[_0x4535('0x1c')](_0x1d02cb[_0x4535('0x2c')][_0x4535('0x1c')]);}_0x3204a2[_0x4535('0x35')]=qs[_0x4535('0x36')](_0x1d02cb[_0x4535('0x2c')][_0x4535('0x36')]);_0x3204a2['where']=qs[_0x4535('0x2e')](_['pick'](_0x1d02cb[_0x4535('0x2c')],_0x277e79[_0x4535('0x2e')]),_0x427926);if(_0x1d02cb['query']['filter']){_0x3204a2[_0x4535('0x37')]=_[_0x4535('0x38')](_0x3204a2[_0x4535('0x37')],{'$or':_[_0x4535('0x2b')](_0x427926,function(_0x4b884b){if(_0x4b884b[_0x4535('0x39')]!==_0x4535('0x3a')){var _0xcb0e7f={};_0xcb0e7f[_0x4b884b[_0x4535('0x25')]]={'$like':'%'+_0x1d02cb[_0x4535('0x2c')]['filter']+'%'};return _0xcb0e7f;}})});}_0x3204a2=_[_0x4535('0x38')]({},_0x3204a2,_0x1d02cb[_0x4535('0x3b')]);var _0xe28605={'where':_0x3204a2['where']};return db[_0x4535('0x27')][_0x4535('0x1d')](_0xe28605)['then'](function(_0x3ac05c){_0x1255b9[_0x4535('0x1d')]=_0x3ac05c;if(_0x1d02cb[_0x4535('0x2c')][_0x4535('0x3c')]){_0x3204a2[_0x4535('0x3d')]=[{'all':!![]}];}return db[_0x4535('0x27')][_0x4535('0x3e')](_0x3204a2);})[_0x4535('0x22')](function(_0x554ab4){_0x1255b9[_0x4535('0x3f')]=_0x554ab4;return _0x1255b9;})['then'](respondWithFilteredResult(_0x5afbb5,_0x3204a2))[_0x4535('0x40')](handleError(_0x5afbb5,null));};exports[_0x4535('0x41')]=function(_0x10256c,_0x893ddf){var _0x13c4e1={'raw':!![],'where':{'id':_0x10256c[_0x4535('0x42')]['id']}},_0xf9e814={};_0xf9e814[_0x4535('0x2a')]=_[_0x4535('0x2d')](db['AnalyticTreeReport'][_0x4535('0x43')]);_0xf9e814[_0x4535('0x2c')]=_[_0x4535('0x2d')](_0x10256c[_0x4535('0x2c')]);_0xf9e814['filters']=_[_0x4535('0x30')](_0xf9e814[_0x4535('0x2a')],_0xf9e814[_0x4535('0x2c')]);_0x13c4e1[_0x4535('0x2f')]=_['intersection'](_0xf9e814['model'],qs[_0x4535('0x31')](_0x10256c[_0x4535('0x2c')][_0x4535('0x31')]));_0x13c4e1[_0x4535('0x2f')]=_0x13c4e1['attributes'][_0x4535('0x32')]?_0x13c4e1['attributes']:_0xf9e814[_0x4535('0x2a')];if(_0x10256c['query'][_0x4535('0x3c')]){_0x13c4e1[_0x4535('0x3d')]=[{'all':!![]}];}_0x13c4e1=_['merge']({},_0x13c4e1,_0x10256c[_0x4535('0x3b')]);return db[_0x4535('0x27')][_0x4535('0x44')](_0x13c4e1)[_0x4535('0x22')](handleEntityNotFound(_0x893ddf,null))['then'](respondWithResult(_0x893ddf,null))['catch'](handleError(_0x893ddf,null));};exports[_0x4535('0x45')]=function(_0x3458aa,_0x3bcfbb){return db[_0x4535('0x27')][_0x4535('0x45')](_0x3458aa[_0x4535('0x46')],{})[_0x4535('0x22')](respondWithResult(_0x3bcfbb,0xc9))[_0x4535('0x40')](handleError(_0x3bcfbb,null));};exports[_0x4535('0x21')]=function(_0x5580db,_0x3c2543){if(_0x5580db[_0x4535('0x46')]['id']){delete _0x5580db['body']['id'];}return db[_0x4535('0x27')][_0x4535('0x44')]({'where':{'id':_0x5580db[_0x4535('0x42')]['id']}})[_0x4535('0x22')](handleEntityNotFound(_0x3c2543,null))['then'](saveUpdates(_0x5580db[_0x4535('0x46')],null))[_0x4535('0x22')](respondWithResult(_0x3c2543,null))['catch'](handleError(_0x3c2543,null));};exports[_0x4535('0x47')]=function(_0x599698,_0x4cd3ee){return db['AnalyticTreeReport'][_0x4535('0x44')]({'where':{'id':_0x599698[_0x4535('0x42')]['id']}})[_0x4535('0x22')](handleEntityNotFound(_0x4cd3ee,null))[_0x4535('0x22')](removeEntity(_0x4cd3ee,null))[_0x4535('0x40')](handleError(_0x4cd3ee,null));};
\ No newline at end of file
+var _0xb4b7=['fast-json-patch','request-promise','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','squel','desk.js','querystring','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','offset','undefined','limit','count','Content-Range','apply','reject','save','then','destroy','error','stack','name','index','fieldName','type','key','model','query','keys','intersection','fields','attributes','length','nolimit','order','sort','filters','filter','where','merge','map','VIRTUAL','options','AnalyticTreeReport','includeAll','include','findAll','rows','show','rawAttributes','find','create','catch','body','params','eml-format','zip-dir'];(function(_0x11f523,_0x5326b5){var _0x5c1012=function(_0x190e79){while(--_0x190e79){_0x11f523['push'](_0x11f523['shift']());}};_0x5c1012(++_0x5326b5);}(_0xb4b7,0xd9));var _0x7b4b=function(_0x37b744,_0x5e8e01){_0x37b744=_0x37b744-0x0;var _0x1634a6=_0xb4b7[_0x37b744];return _0x1634a6;};'use strict';var emlformat=require(_0x7b4b('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x7b4b('0x1'));var jsonpatch=require(_0x7b4b('0x2'));var rp=require(_0x7b4b('0x3'));var moment=require('moment');var BPromise=require(_0x7b4b('0x4'));var Mustache=require(_0x7b4b('0x5'));var util=require(_0x7b4b('0x6'));var path=require(_0x7b4b('0x7'));var sox=require(_0x7b4b('0x8'));var csv=require(_0x7b4b('0x9'));var ejs=require(_0x7b4b('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x7b4b('0xb'));var squel=require(_0x7b4b('0xc'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x7b4b('0xd'));var toCsv=require(_0x7b4b('0x9'));var querystring=require(_0x7b4b('0xe'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x7b4b('0xf'));var qs=require(_0x7b4b('0x10'));var as=require(_0x7b4b('0x11'));var hardwareService=require(_0x7b4b('0x12'));var logger=require(_0x7b4b('0x13'))('api');var utils=require(_0x7b4b('0x14'));var config=require(_0x7b4b('0x15'));var licenseUtil=require(_0x7b4b('0x16'));var db=require(_0x7b4b('0x17'))['db'];function respondWithStatusCode(_0x3be6f0,_0x1bba62){_0x1bba62=_0x1bba62||0xcc;return function(_0x58dbd2){if(_0x58dbd2){return _0x3be6f0[_0x7b4b('0x18')](_0x1bba62);}return _0x3be6f0[_0x7b4b('0x19')](_0x1bba62)[_0x7b4b('0x1a')]();};}function respondWithResult(_0x1946e1,_0x1911f6){_0x1911f6=_0x1911f6||0xc8;return function(_0x5cb297){if(_0x5cb297){return _0x1946e1[_0x7b4b('0x19')](_0x1911f6)['json'](_0x5cb297);}};}function respondWithFilteredResult(_0x25b45d,_0x5a4376){return function(_0x3d9349){if(_0x3d9349){var _0x4053bb=typeof _0x5a4376[_0x7b4b('0x1b')]===_0x7b4b('0x1c')&&typeof _0x5a4376[_0x7b4b('0x1d')]===_0x7b4b('0x1c');var _0x345429=_0x3d9349['count'];var _0x451dd5=_0x4053bb?0x0:_0x5a4376[_0x7b4b('0x1b')];var _0x25cfcc=_0x4053bb?_0x3d9349[_0x7b4b('0x1e')]:_0x5a4376[_0x7b4b('0x1b')]+_0x5a4376[_0x7b4b('0x1d')];var _0xec8171;if(_0x25cfcc>=_0x345429){_0x25cfcc=_0x345429;_0xec8171=0xc8;}else{_0xec8171=0xce;}_0x25b45d[_0x7b4b('0x19')](_0xec8171);return _0x25b45d['set'](_0x7b4b('0x1f'),_0x451dd5+'-'+_0x25cfcc+'/'+_0x345429)['json'](_0x3d9349);}return null;};}function patchUpdates(_0x4ded2c){return function(_0x4dcd57){try{jsonpatch[_0x7b4b('0x20')](_0x4dcd57,_0x4ded2c,!![]);}catch(_0x543163){return BPromise[_0x7b4b('0x21')](_0x543163);}return _0x4dcd57[_0x7b4b('0x22')]();};}function saveUpdates(_0x4c1612,_0x483a6e){return function(_0x558bad){if(_0x558bad){return _0x558bad['update'](_0x4c1612)[_0x7b4b('0x23')](function(_0x53f4c7){return _0x53f4c7;});}return null;};}function removeEntity(_0x40d8e1,_0x21c2e8){return function(_0x5787e0){if(_0x5787e0){return _0x5787e0[_0x7b4b('0x24')]()['then'](function(){_0x40d8e1[_0x7b4b('0x19')](0xcc)[_0x7b4b('0x1a')]();});}};}function handleEntityNotFound(_0x475499,_0x3bd146){return function(_0x263f0a){if(!_0x263f0a){_0x475499['sendStatus'](0x194);}return _0x263f0a;};}function handleError(_0x46f485,_0x21ef47){_0x21ef47=_0x21ef47||0x1f4;return function(_0x5b9de7){logger[_0x7b4b('0x25')](_0x5b9de7[_0x7b4b('0x26')]);if(_0x5b9de7[_0x7b4b('0x27')]){delete _0x5b9de7[_0x7b4b('0x27')];}_0x46f485[_0x7b4b('0x19')](_0x21ef47)['send'](_0x5b9de7);};}exports[_0x7b4b('0x28')]=function(_0x257597,_0x42c672){var _0x1043b6={},_0x5d3edc={},_0x520237={'count':0x0,'rows':[]};var _0x4ee0c3=_['map'](db['AnalyticTreeReport']['rawAttributes'],function(_0x195792){return{'name':_0x195792[_0x7b4b('0x29')],'type':_0x195792[_0x7b4b('0x2a')][_0x7b4b('0x2b')]};});_0x5d3edc[_0x7b4b('0x2c')]=_['map'](_0x4ee0c3,_0x7b4b('0x27'));_0x5d3edc[_0x7b4b('0x2d')]=_[_0x7b4b('0x2e')](_0x257597[_0x7b4b('0x2d')]);_0x5d3edc['filters']=_[_0x7b4b('0x2f')](_0x5d3edc[_0x7b4b('0x2c')],_0x5d3edc['query']);_0x1043b6['attributes']=_[_0x7b4b('0x2f')](_0x5d3edc['model'],qs[_0x7b4b('0x30')](_0x257597['query']['fields']));_0x1043b6[_0x7b4b('0x31')]=_0x1043b6[_0x7b4b('0x31')][_0x7b4b('0x32')]?_0x1043b6[_0x7b4b('0x31')]:_0x5d3edc[_0x7b4b('0x2c')];if(!_0x257597[_0x7b4b('0x2d')]['hasOwnProperty'](_0x7b4b('0x33'))){_0x1043b6[_0x7b4b('0x1d')]=qs[_0x7b4b('0x1d')](_0x257597[_0x7b4b('0x2d')][_0x7b4b('0x1d')]);_0x1043b6[_0x7b4b('0x1b')]=qs[_0x7b4b('0x1b')](_0x257597[_0x7b4b('0x2d')][_0x7b4b('0x1b')]);}_0x1043b6[_0x7b4b('0x34')]=qs[_0x7b4b('0x35')](_0x257597[_0x7b4b('0x2d')]['sort']);_0x1043b6['where']=qs[_0x7b4b('0x36')](_['pick'](_0x257597['query'],_0x5d3edc['filters']),_0x4ee0c3);if(_0x257597[_0x7b4b('0x2d')][_0x7b4b('0x37')]){_0x1043b6[_0x7b4b('0x38')]=_[_0x7b4b('0x39')](_0x1043b6[_0x7b4b('0x38')],{'$or':_[_0x7b4b('0x3a')](_0x4ee0c3,function(_0x250bd1){if(_0x250bd1[_0x7b4b('0x2a')]!==_0x7b4b('0x3b')){var _0x1617bd={};_0x1617bd[_0x250bd1['name']]={'$like':'%'+_0x257597['query'][_0x7b4b('0x37')]+'%'};return _0x1617bd;}})});}_0x1043b6=_[_0x7b4b('0x39')]({},_0x1043b6,_0x257597[_0x7b4b('0x3c')]);var _0xc29bc={'where':_0x1043b6[_0x7b4b('0x38')]};return db[_0x7b4b('0x3d')][_0x7b4b('0x1e')](_0xc29bc)[_0x7b4b('0x23')](function(_0x147afc){_0x520237[_0x7b4b('0x1e')]=_0x147afc;if(_0x257597[_0x7b4b('0x2d')][_0x7b4b('0x3e')]){_0x1043b6[_0x7b4b('0x3f')]=[{'all':!![]}];}return db[_0x7b4b('0x3d')][_0x7b4b('0x40')](_0x1043b6);})['then'](function(_0x2189e5){_0x520237[_0x7b4b('0x41')]=_0x2189e5;return _0x520237;})['then'](respondWithFilteredResult(_0x42c672,_0x1043b6))['catch'](handleError(_0x42c672,null));};exports[_0x7b4b('0x42')]=function(_0x773e6d,_0x83eda8){var _0x4a3723={'raw':!![],'where':{'id':_0x773e6d['params']['id']}},_0x23aacd={};_0x23aacd['model']=_['keys'](db[_0x7b4b('0x3d')][_0x7b4b('0x43')]);_0x23aacd[_0x7b4b('0x2d')]=_[_0x7b4b('0x2e')](_0x773e6d[_0x7b4b('0x2d')]);_0x23aacd[_0x7b4b('0x36')]=_[_0x7b4b('0x2f')](_0x23aacd[_0x7b4b('0x2c')],_0x23aacd[_0x7b4b('0x2d')]);_0x4a3723[_0x7b4b('0x31')]=_['intersection'](_0x23aacd[_0x7b4b('0x2c')],qs['fields'](_0x773e6d[_0x7b4b('0x2d')]['fields']));_0x4a3723['attributes']=_0x4a3723['attributes'][_0x7b4b('0x32')]?_0x4a3723[_0x7b4b('0x31')]:_0x23aacd[_0x7b4b('0x2c')];if(_0x773e6d[_0x7b4b('0x2d')][_0x7b4b('0x3e')]){_0x4a3723[_0x7b4b('0x3f')]=[{'all':!![]}];}_0x4a3723=_[_0x7b4b('0x39')]({},_0x4a3723,_0x773e6d[_0x7b4b('0x3c')]);return db[_0x7b4b('0x3d')][_0x7b4b('0x44')](_0x4a3723)['then'](handleEntityNotFound(_0x83eda8,null))[_0x7b4b('0x23')](respondWithResult(_0x83eda8,null))['catch'](handleError(_0x83eda8,null));};exports[_0x7b4b('0x45')]=function(_0x9cca88,_0x3afb08){return db[_0x7b4b('0x3d')][_0x7b4b('0x45')](_0x9cca88['body'],{})[_0x7b4b('0x23')](respondWithResult(_0x3afb08,0xc9))[_0x7b4b('0x46')](handleError(_0x3afb08,null));};exports['update']=function(_0x475568,_0x5e5d3f){if(_0x475568['body']['id']){delete _0x475568[_0x7b4b('0x47')]['id'];}return db[_0x7b4b('0x3d')][_0x7b4b('0x44')]({'where':{'id':_0x475568[_0x7b4b('0x48')]['id']}})['then'](handleEntityNotFound(_0x5e5d3f,null))[_0x7b4b('0x23')](saveUpdates(_0x475568['body'],null))[_0x7b4b('0x23')](respondWithResult(_0x5e5d3f,null))['catch'](handleError(_0x5e5d3f,null));};exports['destroy']=function(_0x5d10ba,_0x566562){return db['AnalyticTreeReport'][_0x7b4b('0x44')]({'where':{'id':_0x5d10ba[_0x7b4b('0x48')]['id']}})[_0x7b4b('0x23')](handleEntityNotFound(_0x566562,null))['then'](removeEntity(_0x566562,null))[_0x7b4b('0x46')](handleError(_0x566562,null));};
\ No newline at end of file
diff --git a/server/api/analyticTreeReport/analyticTreeReport.model.js b/server/api/analyticTreeReport/analyticTreeReport.model.js
index 67e30c2..0500fe7 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 _0x894f=['exports','analytics_report_trees','lodash','util','../../config/logger','api','request-promise','path','rimraf','../../config/environment','./analyticTreeReport.attributes'];(function(_0x8e1290,_0x4afa81){var _0x17e43b=function(_0x16bacf){while(--_0x16bacf){_0x8e1290['push'](_0x8e1290['shift']());}};_0x17e43b(++_0x4afa81);}(_0x894f,0xf4));var _0xf894=function(_0xf9e9af,_0x385820){_0xf9e9af=_0xf9e9af-0x0;var _0x527419=_0x894f[_0xf9e9af];return _0x527419;};'use strict';var _=require(_0xf894('0x0'));var util=require(_0xf894('0x1'));var logger=require(_0xf894('0x2'))(_0xf894('0x3'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0xf894('0x4'));var fs=require('fs');var path=require(_0xf894('0x5'));var rimraf=require(_0xf894('0x6'));var config=require(_0xf894('0x7'));var attributes=require(_0xf894('0x8'));module[_0xf894('0x9')]=function(_0x1b6732,_0x22f3d7){return _0x1b6732['define']('AnalyticTreeReport',attributes,{'tableName':_0xf894('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xbe2f=['./analyticTreeReport.attributes','define','AnalyticTreeReport','analytics_report_trees','lodash','util','../../config/logger','api','bluebird','request-promise','rimraf'];(function(_0x167cc1,_0x56ef5a){var _0x10bc4b=function(_0xd6a255){while(--_0xd6a255){_0x167cc1['push'](_0x167cc1['shift']());}};_0x10bc4b(++_0x56ef5a);}(_0xbe2f,0x72));var _0xfbe2=function(_0x15294b,_0x508f63){_0x15294b=_0x15294b-0x0;var _0x1b8041=_0xbe2f[_0x15294b];return _0x1b8041;};'use strict';var _=require(_0xfbe2('0x0'));var util=require(_0xfbe2('0x1'));var logger=require(_0xfbe2('0x2'))(_0xfbe2('0x3'));var moment=require('moment');var BPromise=require(_0xfbe2('0x4'));var rp=require(_0xfbe2('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0xfbe2('0x6'));var config=require('../../config/environment');var attributes=require(_0xfbe2('0x7'));module['exports']=function(_0x54b706,_0x4558fb){return _0x54b706[_0xfbe2('0x8')](_0xfbe2('0x9'),attributes,{'tableName':_0xfbe2('0xa'),'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 e371eca..0f0b500 100644
--- a/server/api/analyticTreeReport/analyticTreeReport.rpc.js
+++ b/server/api/analyticTreeReport/analyticTreeReport.rpc.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x5f2f=['lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/environment','jayson/promise','client','http','request','info','AnalyticTreeReport,\x20%s,\x20%s','debug','stringify','error','code','message','request\x20sent','result','catch'];(function(_0x5f3a24,_0x3ec2fa){var _0x24ac1d=function(_0xa56db2){while(--_0xa56db2){_0x5f3a24['push'](_0x5f3a24['shift']());}};_0x24ac1d(++_0x3ec2fa);}(_0x5f2f,0x73));var _0xf5f2=function(_0x32c037,_0x7bda34){_0x32c037=_0x32c037-0x0;var _0x3e1f71=_0x5f2f[_0x32c037];return _0x3e1f71;};'use strict';var _=require(_0xf5f2('0x0'));var util=require(_0xf5f2('0x1'));var moment=require(_0xf5f2('0x2'));var BPromise=require(_0xf5f2('0x3'));var rs=require(_0xf5f2('0x4'));var fs=require('fs');var Redis=require(_0xf5f2('0x5'));var db=require(_0xf5f2('0x6'))['db'];var utils=require(_0xf5f2('0x7'));var logger=require('../../config/logger')('rpc');var config=require(_0xf5f2('0x8'));var jayson=require(_0xf5f2('0x9'));var client=jayson[_0xf5f2('0xa')][_0xf5f2('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x3133bc,_0x473100,_0x5907aa){return new BPromise(function(_0x466882,_0x46cd9c){return client[_0xf5f2('0xc')](_0x3133bc,_0x5907aa)['then'](function(_0x375da4){logger[_0xf5f2('0xd')](_0xf5f2('0xe'),_0x473100,'request\x20sent');logger[_0xf5f2('0xf')]('AnalyticTreeReport,\x20%s,\x20%s,\x20%s',_0x473100,'request\x20sent',JSON[_0xf5f2('0x10')](_0x375da4));if(_0x375da4[_0xf5f2('0x11')]){if(_0x375da4['error'][_0xf5f2('0x12')]===0x1f4){logger[_0xf5f2('0x11')](_0xf5f2('0xe'),_0x473100,_0x375da4[_0xf5f2('0x11')][_0xf5f2('0x13')]);return _0x46cd9c(_0x375da4[_0xf5f2('0x11')]['message']);}logger[_0xf5f2('0x11')](_0xf5f2('0xe'),_0x473100,_0x375da4[_0xf5f2('0x11')][_0xf5f2('0x13')]);return _0x466882(_0x375da4[_0xf5f2('0x11')]['message']);}else{logger[_0xf5f2('0xd')](_0xf5f2('0xe'),_0x473100,_0xf5f2('0x14'));_0x466882(_0x375da4[_0xf5f2('0x15')][_0xf5f2('0x13')]);}})[_0xf5f2('0x16')](function(_0xdb61b3){logger[_0xf5f2('0x11')](_0xf5f2('0xe'),_0x473100,_0xdb61b3);_0x46cd9c(_0xdb61b3);});});}
\ No newline at end of file
+var _0xadb5=['error','code','message','result','catch','util','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','request','then','info','AnalyticTreeReport,\x20%s,\x20%s','request\x20sent','stringify'];(function(_0x28d06c,_0xf80378){var _0x594317=function(_0x4f0187){while(--_0x4f0187){_0x28d06c['push'](_0x28d06c['shift']());}};_0x594317(++_0xf80378);}(_0xadb5,0xad));var _0x5adb=function(_0x1b42b4,_0x5a58db){_0x1b42b4=_0x1b42b4-0x0;var _0x40a7be=_0xadb5[_0x1b42b4];return _0x40a7be;};'use strict';var _=require('lodash');var util=require(_0x5adb('0x0'));var moment=require('moment');var BPromise=require(_0x5adb('0x1'));var rs=require(_0x5adb('0x2'));var fs=require('fs');var Redis=require(_0x5adb('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x5adb('0x4'));var logger=require(_0x5adb('0x5'))(_0x5adb('0x6'));var config=require('../../config/environment');var jayson=require(_0x5adb('0x7'));var client=jayson[_0x5adb('0x8')][_0x5adb('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x3213e8,_0xdf3776,_0x353885){return new BPromise(function(_0x47228a,_0x6d1b45){return client[_0x5adb('0xa')](_0x3213e8,_0x353885)[_0x5adb('0xb')](function(_0x34f59d){logger[_0x5adb('0xc')](_0x5adb('0xd'),_0xdf3776,_0x5adb('0xe'));logger['debug']('AnalyticTreeReport,\x20%s,\x20%s,\x20%s',_0xdf3776,_0x5adb('0xe'),JSON[_0x5adb('0xf')](_0x34f59d));if(_0x34f59d[_0x5adb('0x10')]){if(_0x34f59d['error'][_0x5adb('0x11')]===0x1f4){logger['error'](_0x5adb('0xd'),_0xdf3776,_0x34f59d['error'][_0x5adb('0x12')]);return _0x6d1b45(_0x34f59d[_0x5adb('0x10')][_0x5adb('0x12')]);}logger['error'](_0x5adb('0xd'),_0xdf3776,_0x34f59d[_0x5adb('0x10')][_0x5adb('0x12')]);return _0x47228a(_0x34f59d['error'][_0x5adb('0x12')]);}else{logger['info'](_0x5adb('0xd'),_0xdf3776,_0x5adb('0xe'));_0x47228a(_0x34f59d[_0x5adb('0x13')][_0x5adb('0x12')]);}})[_0x5adb('0x14')](function(_0x39d24d){logger[_0x5adb('0x10')](_0x5adb('0xd'),_0xdf3776,_0x39d24d);_0x6d1b45(_0x39d24d);});});}
\ No newline at end of file
diff --git a/server/api/analyticTreeReport/index.js b/server/api/analyticTreeReport/index.js
index b13de24..6c6902e 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 _0xac9b=['show','post','create','put','/:id','exports','multer','util','path','express','Router','fs-extra','../../components/auth/service','../../config/environment','./analyticTreeReport.controller','get','isAuthenticated'];(function(_0x7782d7,_0xce2d0e){var _0x881ef7=function(_0x14cb6d){while(--_0x14cb6d){_0x7782d7['push'](_0x7782d7['shift']());}};_0x881ef7(++_0xce2d0e);}(_0xac9b,0xc1));var _0xbac9=function(_0x4704dc,_0x575a5f){_0x4704dc=_0x4704dc-0x0;var _0x254d81=_0xac9b[_0x4704dc];return _0x254d81;};'use strict';var multer=require(_0xbac9('0x0'));var util=require(_0xbac9('0x1'));var path=require(_0xbac9('0x2'));var timeout=require('connect-timeout');var express=require(_0xbac9('0x3'));var router=express[_0xbac9('0x4')]();var fs_extra=require(_0xbac9('0x5'));var auth=require(_0xbac9('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0xbac9('0x7'));var controller=require(_0xbac9('0x8'));router[_0xbac9('0x9')]('/',auth[_0xbac9('0xa')](),controller['index']);router[_0xbac9('0x9')]('/:id',auth['isAuthenticated'](),controller[_0xbac9('0xb')]);router[_0xbac9('0xc')]('/',auth[_0xbac9('0xa')](),controller[_0xbac9('0xd')]);router[_0xbac9('0xe')](_0xbac9('0xf'),auth[_0xbac9('0xa')](),controller['update']);router['delete']('/:id',auth['isAuthenticated'](),controller['destroy']);module[_0xbac9('0x10')]=router;
\ No newline at end of file
+var _0xae7a=['util','path','connect-timeout','express','fs-extra','../../components/interaction/service','../../config/environment','get','isAuthenticated','/:id','show','create','put','update','destroy','exports','multer'];(function(_0x5cb537,_0x574c06){var _0x4eb6ec=function(_0x4a1885){while(--_0x4a1885){_0x5cb537['push'](_0x5cb537['shift']());}};_0x4eb6ec(++_0x574c06);}(_0xae7a,0xcb));var _0xaae7=function(_0x5e8398,_0x1b4120){_0x5e8398=_0x5e8398-0x0;var _0x192dc6=_0xae7a[_0x5e8398];return _0x192dc6;};'use strict';var multer=require(_0xaae7('0x0'));var util=require(_0xaae7('0x1'));var path=require(_0xaae7('0x2'));var timeout=require(_0xaae7('0x3'));var express=require(_0xaae7('0x4'));var router=express['Router']();var fs_extra=require(_0xaae7('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0xaae7('0x6'));var config=require(_0xaae7('0x7'));var controller=require('./analyticTreeReport.controller');router[_0xaae7('0x8')]('/',auth[_0xaae7('0x9')](),controller['index']);router['get'](_0xaae7('0xa'),auth[_0xaae7('0x9')](),controller[_0xaae7('0xb')]);router['post']('/',auth[_0xaae7('0x9')](),controller[_0xaae7('0xc')]);router[_0xaae7('0xd')](_0xaae7('0xa'),auth[_0xaae7('0x9')](),controller[_0xaae7('0xe')]);router['delete'](_0xaae7('0xa'),auth['isAuthenticated'](),controller[_0xaae7('0xf')]);module[_0xaae7('0x10')]=router;
\ No newline at end of file
diff --git a/server/api/attachment/attachment.attributes.js b/server/api/attachment/attachment.attributes.js
index 2d2a020..97f4068 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 _0x1280=['sequelize','exports','STRING'];(function(_0x158f01,_0x12af3e){var _0x5ef74e=function(_0x5e7adc){while(--_0x5e7adc){_0x158f01['push'](_0x158f01['shift']());}};_0x5ef74e(++_0x12af3e);}(_0x1280,0xba));var _0x0128=function(_0x3cbe3a,_0x78bfce){_0x3cbe3a=_0x3cbe3a-0x0;var _0x24ffc1=_0x1280[_0x3cbe3a];return _0x24ffc1;};'use strict';var Sequelize=require(_0x0128('0x0'));module[_0x0128('0x1')]={'name':{'type':Sequelize[_0x0128('0x2')]},'basename':{'type':Sequelize[_0x0128('0x2')]},'type':{'type':Sequelize[_0x0128('0x2')]}};
\ No newline at end of file
+var _0x32ef=['sequelize','exports','STRING'];(function(_0xb2443d,_0x1617e1){var _0x227b2f=function(_0x4661d2){while(--_0x4661d2){_0xb2443d['push'](_0xb2443d['shift']());}};_0x227b2f(++_0x1617e1);}(_0x32ef,0xf9));var _0xf32e=function(_0x900479,_0x1e5efc){_0x900479=_0x900479-0x0;var _0x5d44c2=_0x32ef[_0x900479];return _0x5d44c2;};'use strict';var Sequelize=require(_0xf32e('0x0'));module[_0xf32e('0x1')]={'name':{'type':Sequelize[_0xf32e('0x2')]},'basename':{'type':Sequelize[_0xf32e('0x2')]},'type':{'type':Sequelize[_0xf32e('0x2')]}};
\ No newline at end of file
diff --git a/server/api/attachment/attachment.controller.js b/server/api/attachment/attachment.controller.js
index e6bacdd..5a8645f 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 _0x84f9=['attributes','fields','nolimit','order','sort','where','pick','filter','merge','type','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','params','rawAttributes','length','clone','get','omit','updatedAt','body','createdAt','create','find','destroy','file','originalname','basename','filename','mimetype','download','findOne','ChatOfflineMessageId','join','root','server/files/attachments/','offline-chat/','eml-format','rimraf','zip-dir','moment','mustache','util','path','to-csv','ejs','fs-extra','lodash','squel','crypto','desk.js','querystring','papaparse','ioredis','../../components/parsers/advancedSearch','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','limit','undefined','count','set','Content-Range','apply','reject','update','then','error','stack','name','send','index','map','Attachment','key','model','query','keys','filters','intersection'];(function(_0x4154a6,_0x2c0b8e){var _0x3b2786=function(_0x2f5936){while(--_0x2f5936){_0x4154a6['push'](_0x4154a6['shift']());}};_0x3b2786(++_0x2c0b8e);}(_0x84f9,0xde));var _0x984f=function(_0xf67f9a,_0x164ef4){_0xf67f9a=_0xf67f9a-0x0;var _0xdd0dc3=_0x84f9[_0xf67f9a];return _0xdd0dc3;};'use strict';var emlformat=require(_0x984f('0x0'));var rimraf=require(_0x984f('0x1'));var zipdir=require(_0x984f('0x2'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x984f('0x3'));var BPromise=require('bluebird');var Mustache=require(_0x984f('0x4'));var util=require(_0x984f('0x5'));var path=require(_0x984f('0x6'));var sox=require('sox');var csv=require(_0x984f('0x7'));var ejs=require(_0x984f('0x8'));var fs=require('fs');var fs_extra=require(_0x984f('0x9'));var _=require(_0x984f('0xa'));var squel=require(_0x984f('0xb'));var crypto=require(_0x984f('0xc'));var jsforce=require('jsforce');var deskjs=require(_0x984f('0xd'));var toCsv=require(_0x984f('0x7'));var querystring=require(_0x984f('0xe'));var Papa=require(_0x984f('0xf'));var Redis=require(_0x984f('0x10'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0x984f('0x11'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')('api');var utils=require('../../config/utils');var config=require(_0x984f('0x12'));var licenseUtil=require(_0x984f('0x13'));var db=require(_0x984f('0x14'))['db'];function respondWithStatusCode(_0x40e63a,_0x3de318){_0x3de318=_0x3de318||0xcc;return function(_0x14e90c){if(_0x14e90c){return _0x40e63a[_0x984f('0x15')](_0x3de318);}return _0x40e63a[_0x984f('0x16')](_0x3de318)[_0x984f('0x17')]();};}function respondWithResult(_0x2dd5de,_0x32f9eb){_0x32f9eb=_0x32f9eb||0xc8;return function(_0xdafeb7){if(_0xdafeb7){return _0x2dd5de['status'](_0x32f9eb)[_0x984f('0x18')](_0xdafeb7);}};}function respondWithFilteredResult(_0x5092df,_0x2e7caa){return function(_0x19685f){if(_0x19685f){var _0x40b887=typeof _0x2e7caa[_0x984f('0x19')]==='undefined'&&typeof _0x2e7caa[_0x984f('0x1a')]===_0x984f('0x1b');var _0x443638=_0x19685f['count'];var _0xe0f4b7=_0x40b887?0x0:_0x2e7caa[_0x984f('0x19')];var _0x533887=_0x40b887?_0x19685f[_0x984f('0x1c')]:_0x2e7caa[_0x984f('0x19')]+_0x2e7caa[_0x984f('0x1a')];var _0x779125;if(_0x533887>=_0x443638){_0x533887=_0x443638;_0x779125=0xc8;}else{_0x779125=0xce;}_0x5092df[_0x984f('0x16')](_0x779125);return _0x5092df[_0x984f('0x1d')](_0x984f('0x1e'),_0xe0f4b7+'-'+_0x533887+'/'+_0x443638)[_0x984f('0x18')](_0x19685f);}return null;};}function patchUpdates(_0x443727){return function(_0xc8610f){try{jsonpatch[_0x984f('0x1f')](_0xc8610f,_0x443727,!![]);}catch(_0x1a0db0){return BPromise[_0x984f('0x20')](_0x1a0db0);}return _0xc8610f['save']();};}function saveUpdates(_0x113cc9,_0x2c5a0d){return function(_0x11b865){if(_0x11b865){return _0x11b865[_0x984f('0x21')](_0x113cc9)[_0x984f('0x22')](function(_0x67d58c){return _0x67d58c;});}return null;};}function removeEntity(_0x224b51,_0x31dcaa){return function(_0x46647a){if(_0x46647a){return _0x46647a['destroy']()[_0x984f('0x22')](function(){_0x224b51[_0x984f('0x16')](0xcc)['end']();});}};}function handleEntityNotFound(_0xbacc9b,_0x7f7349){return function(_0x2fdbb3){if(!_0x2fdbb3){_0xbacc9b[_0x984f('0x15')](0x194);}return _0x2fdbb3;};}function handleError(_0x4a6691,_0x28332d){_0x28332d=_0x28332d||0x1f4;return function(_0x33439d){logger[_0x984f('0x23')](_0x33439d[_0x984f('0x24')]);if(_0x33439d[_0x984f('0x25')]){delete _0x33439d[_0x984f('0x25')];}_0x4a6691[_0x984f('0x16')](_0x28332d)[_0x984f('0x26')](_0x33439d);};}exports[_0x984f('0x27')]=function(_0x313d0c,_0x56d71d){var _0x53d93f={},_0x1bf5dd={},_0x41d740={'count':0x0,'rows':[]};var _0x425e35=_[_0x984f('0x28')](db[_0x984f('0x29')]['rawAttributes'],function(_0x48c906){return{'name':_0x48c906['fieldName'],'type':_0x48c906['type'][_0x984f('0x2a')]};});_0x1bf5dd[_0x984f('0x2b')]=_[_0x984f('0x28')](_0x425e35,_0x984f('0x25'));_0x1bf5dd[_0x984f('0x2c')]=_[_0x984f('0x2d')](_0x313d0c[_0x984f('0x2c')]);_0x1bf5dd[_0x984f('0x2e')]=_[_0x984f('0x2f')](_0x1bf5dd[_0x984f('0x2b')],_0x1bf5dd[_0x984f('0x2c')]);_0x53d93f[_0x984f('0x30')]=_[_0x984f('0x2f')](_0x1bf5dd[_0x984f('0x2b')],qs[_0x984f('0x31')](_0x313d0c[_0x984f('0x2c')]['fields']));_0x53d93f['attributes']=_0x53d93f[_0x984f('0x30')]['length']?_0x53d93f['attributes']:_0x1bf5dd[_0x984f('0x2b')];if(!_0x313d0c[_0x984f('0x2c')]['hasOwnProperty'](_0x984f('0x32'))){_0x53d93f[_0x984f('0x1a')]=qs[_0x984f('0x1a')](_0x313d0c[_0x984f('0x2c')][_0x984f('0x1a')]);_0x53d93f[_0x984f('0x19')]=qs[_0x984f('0x19')](_0x313d0c[_0x984f('0x2c')][_0x984f('0x19')]);}_0x53d93f[_0x984f('0x33')]=qs[_0x984f('0x34')](_0x313d0c[_0x984f('0x2c')][_0x984f('0x34')]);_0x53d93f[_0x984f('0x35')]=qs[_0x984f('0x2e')](_[_0x984f('0x36')](_0x313d0c['query'],_0x1bf5dd['filters']),_0x425e35);if(_0x313d0c[_0x984f('0x2c')][_0x984f('0x37')]){_0x53d93f[_0x984f('0x35')]=_[_0x984f('0x38')](_0x53d93f[_0x984f('0x35')],{'$or':_[_0x984f('0x28')](_0x425e35,function(_0x557287){if(_0x557287[_0x984f('0x39')]!==_0x984f('0x3a')){var _0x5ca913={};_0x5ca913[_0x557287[_0x984f('0x25')]]={'$like':'%'+_0x313d0c[_0x984f('0x2c')][_0x984f('0x37')]+'%'};return _0x5ca913;}})});}_0x53d93f=_[_0x984f('0x38')]({},_0x53d93f,_0x313d0c[_0x984f('0x3b')]);var _0x3f2111={'where':_0x53d93f['where']};return db['Attachment'][_0x984f('0x1c')](_0x3f2111)[_0x984f('0x22')](function(_0xb1a230){_0x41d740['count']=_0xb1a230;if(_0x313d0c[_0x984f('0x2c')][_0x984f('0x3c')]){_0x53d93f[_0x984f('0x3d')]=[{'all':!![]}];}return db[_0x984f('0x29')][_0x984f('0x3e')](_0x53d93f);})[_0x984f('0x22')](function(_0x1e6d19){_0x41d740[_0x984f('0x3f')]=_0x1e6d19;return _0x41d740;})[_0x984f('0x22')](respondWithFilteredResult(_0x56d71d,_0x53d93f))[_0x984f('0x40')](handleError(_0x56d71d,null));};exports[_0x984f('0x41')]=function(_0x1c76ef,_0x4a92aa){var _0x45321b={'raw':!![],'where':{'id':_0x1c76ef[_0x984f('0x42')]['id']}},_0x9e082b={};_0x9e082b[_0x984f('0x2b')]=_[_0x984f('0x2d')](db[_0x984f('0x29')][_0x984f('0x43')]);_0x9e082b[_0x984f('0x2c')]=_['keys'](_0x1c76ef[_0x984f('0x2c')]);_0x9e082b[_0x984f('0x2e')]=_[_0x984f('0x2f')](_0x9e082b['model'],_0x9e082b['query']);_0x45321b[_0x984f('0x30')]=_[_0x984f('0x2f')](_0x9e082b[_0x984f('0x2b')],qs['fields'](_0x1c76ef[_0x984f('0x2c')][_0x984f('0x31')]));_0x45321b[_0x984f('0x30')]=_0x45321b[_0x984f('0x30')][_0x984f('0x44')]?_0x45321b[_0x984f('0x30')]:_0x9e082b[_0x984f('0x2b')];if(_0x1c76ef['query']['includeAll']){_0x45321b[_0x984f('0x3d')]=[{'all':!![]}];}_0x45321b=_[_0x984f('0x38')]({},_0x45321b,_0x1c76ef['options']);return db[_0x984f('0x29')]['find'](_0x45321b)[_0x984f('0x22')](handleEntityNotFound(_0x4a92aa,null))[_0x984f('0x22')](respondWithResult(_0x4a92aa,null))[_0x984f('0x40')](handleError(_0x4a92aa,null));};exports[_0x984f('0x45')]=function(_0x4fe305,_0x3f0215){var _0x20a3bc={'where':{'id':_0x4fe305[_0x984f('0x42')]['id']}},_0x33ed43={};_0x33ed43[_0x984f('0x2b')]=_[_0x984f('0x2d')](db[_0x984f('0x29')][_0x984f('0x43')]);_0x20a3bc[_0x984f('0x30')]=_[_0x984f('0x2f')](_0x33ed43[_0x984f('0x2b')],qs[_0x984f('0x31')](_0x4fe305['query']['fields']));_0x20a3bc[_0x984f('0x30')]=_0x20a3bc[_0x984f('0x30')][_0x984f('0x44')]?_0x20a3bc[_0x984f('0x30')]:_0x33ed43[_0x984f('0x2b')];if(_0x4fe305['query']['includeAll']){_0x20a3bc[_0x984f('0x3d')]=[{'all':!![]}];}_0x20a3bc=_[_0x984f('0x38')]({},_0x20a3bc,_0x4fe305[_0x984f('0x3b')]);return db[_0x984f('0x29')]['find'](_0x20a3bc)[_0x984f('0x22')](handleEntityNotFound(_0x3f0215,null))['then'](function(_0x117557){if(_0x117557){var _0x1131d1=_0x117557[_0x984f('0x46')]({'plain':!![]});_0x1131d1=qs[_0x984f('0x47')](_0x1131d1,['id','createdAt',_0x984f('0x48')]);_0x4fe305[_0x984f('0x49')]=_['omit'](_0x4fe305['body'],['id',_0x984f('0x4a'),'updatedAt']);return db[_0x984f('0x29')][_0x984f('0x4b')](_['merge'](_0x1131d1,_0x4fe305[_0x984f('0x49')]),{'include':_0x4fe305[_0x984f('0x2c')][_0x984f('0x3c')]?[{'all':!![]}]:undefined});}})[_0x984f('0x22')](respondWithResult(_0x3f0215,0xc9))[_0x984f('0x40')](handleError(_0x3f0215,null));};exports[_0x984f('0x21')]=function(_0x113584,_0x5c6c87){if(_0x113584[_0x984f('0x49')]['id']){delete _0x113584[_0x984f('0x49')]['id'];}return db[_0x984f('0x29')][_0x984f('0x4c')]({'where':{'id':_0x113584['params']['id']}})[_0x984f('0x22')](handleEntityNotFound(_0x5c6c87,null))['then'](saveUpdates(_0x113584[_0x984f('0x49')],null))[_0x984f('0x22')](respondWithResult(_0x5c6c87,null))[_0x984f('0x40')](handleError(_0x5c6c87,null));};exports[_0x984f('0x4d')]=function(_0x363814,_0x57de31){return db[_0x984f('0x29')][_0x984f('0x4c')]({'where':{'id':_0x363814[_0x984f('0x42')]['id']}})['then'](handleEntityNotFound(_0x57de31,null))['then'](removeEntity(_0x57de31,null))['catch'](handleError(_0x57de31,null));};exports[_0x984f('0x4b')]=function(_0x42363f,_0xba30dd,_0x26a1c9){_0x42363f[_0x984f('0x49')][_0x984f('0x25')]=_0x42363f[_0x984f('0x4e')][_0x984f('0x4f')];_0x42363f['body'][_0x984f('0x50')]=_0x42363f[_0x984f('0x4e')][_0x984f('0x51')];_0x42363f[_0x984f('0x49')][_0x984f('0x39')]=_0x42363f[_0x984f('0x4e')][_0x984f('0x52')];return db[_0x984f('0x29')][_0x984f('0x4b')](_0x42363f[_0x984f('0x49')])[_0x984f('0x22')](respondWithResult(_0xba30dd,0xc9))[_0x984f('0x40')](handleError(_0xba30dd,null));};exports[_0x984f('0x53')]=function(_0x3bc29f,_0x5b12c9,_0x2be444){return db[_0x984f('0x29')][_0x984f('0x54')]({'where':{'id':_0x3bc29f['params']['id']},'raw':!![]})[_0x984f('0x22')](handleEntityNotFound(_0x5b12c9,null))[_0x984f('0x22')](function(_0x52f460){if(_0x52f460){var _0x530010=_0x52f460[_0x984f('0x55')]!==null;var _0x52ecf3=path[_0x984f('0x56')](config[_0x984f('0x57')],_0x984f('0x58'));if(_0x530010){_0x52ecf3=path[_0x984f('0x56')](_0x52ecf3,_0x984f('0x59'));}var _0x4d33f7=path[_0x984f('0x56')](_0x52ecf3,_0x52f460[_0x984f('0x50')]);return _0x5b12c9[_0x984f('0x53')](_0x4d33f7);}})[_0x984f('0x40')](handleError(_0x5b12c9,null));};
\ No newline at end of file
+var _0xb2f8=['then','destroy','error','stack','name','send','index','Attachment','fieldName','type','key','model','map','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','options','includeAll','include','findAll','rows','catch','show','params','keys','rawAttributes','find','clone','get','createdAt','updatedAt','omit','body','update','create','originalname','basename','file','filename','mimetype','download','findOne','join','server/files/attachments/','eml-format','fast-json-patch','request-promise','bluebird','mustache','util','path','to-csv','ejs','fs-extra','squel','crypto','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject'];(function(_0x5af95b,_0x4ea204){var _0x57c65f=function(_0x379139){while(--_0x379139){_0x5af95b['push'](_0x5af95b['shift']());}};_0x57c65f(++_0x4ea204);}(_0xb2f8,0x145));var _0x8b2f=function(_0x25d386,_0x108d0d){_0x25d386=_0x25d386-0x0;var _0x857f4a=_0xb2f8[_0x25d386];return _0x857f4a;};'use strict';var emlformat=require(_0x8b2f('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0x8b2f('0x1'));var rp=require(_0x8b2f('0x2'));var moment=require('moment');var BPromise=require(_0x8b2f('0x3'));var Mustache=require(_0x8b2f('0x4'));var util=require(_0x8b2f('0x5'));var path=require(_0x8b2f('0x6'));var sox=require('sox');var csv=require(_0x8b2f('0x7'));var ejs=require(_0x8b2f('0x8'));var fs=require('fs');var fs_extra=require(_0x8b2f('0x9'));var _=require('lodash');var squel=require(_0x8b2f('0xa'));var crypto=require(_0x8b2f('0xb'));var jsforce=require('jsforce');var deskjs=require(_0x8b2f('0xc'));var toCsv=require('to-csv');var querystring=require(_0x8b2f('0xd'));var Papa=require('papaparse');var Redis=require(_0x8b2f('0xe'));var authService=require(_0x8b2f('0xf'));var qs=require(_0x8b2f('0x10'));var as=require(_0x8b2f('0x11'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x8b2f('0x12'));var utils=require(_0x8b2f('0x13'));var config=require(_0x8b2f('0x14'));var licenseUtil=require(_0x8b2f('0x15'));var db=require(_0x8b2f('0x16'))['db'];function respondWithStatusCode(_0x26bf2d,_0x5b086e){_0x5b086e=_0x5b086e||0xcc;return function(_0x252353){if(_0x252353){return _0x26bf2d[_0x8b2f('0x17')](_0x5b086e);}return _0x26bf2d[_0x8b2f('0x18')](_0x5b086e)[_0x8b2f('0x19')]();};}function respondWithResult(_0x51cdb7,_0x548751){_0x548751=_0x548751||0xc8;return function(_0x3be344){if(_0x3be344){return _0x51cdb7[_0x8b2f('0x18')](_0x548751)[_0x8b2f('0x1a')](_0x3be344);}};}function respondWithFilteredResult(_0x5637ab,_0x234a4b){return function(_0x33c0a8){if(_0x33c0a8){var _0x302dc1=typeof _0x234a4b[_0x8b2f('0x1b')]===_0x8b2f('0x1c')&&typeof _0x234a4b[_0x8b2f('0x1d')]===_0x8b2f('0x1c');var _0x40eac3=_0x33c0a8[_0x8b2f('0x1e')];var _0x1be94c=_0x302dc1?0x0:_0x234a4b[_0x8b2f('0x1b')];var _0x1b7a4c=_0x302dc1?_0x33c0a8['count']:_0x234a4b[_0x8b2f('0x1b')]+_0x234a4b[_0x8b2f('0x1d')];var _0x41b271;if(_0x1b7a4c>=_0x40eac3){_0x1b7a4c=_0x40eac3;_0x41b271=0xc8;}else{_0x41b271=0xce;}_0x5637ab[_0x8b2f('0x18')](_0x41b271);return _0x5637ab[_0x8b2f('0x1f')](_0x8b2f('0x20'),_0x1be94c+'-'+_0x1b7a4c+'/'+_0x40eac3)['json'](_0x33c0a8);}return null;};}function patchUpdates(_0x3f0017){return function(_0x83c992){try{jsonpatch[_0x8b2f('0x21')](_0x83c992,_0x3f0017,!![]);}catch(_0x11d8e7){return BPromise[_0x8b2f('0x22')](_0x11d8e7);}return _0x83c992['save']();};}function saveUpdates(_0x3b4f81,_0x2bef90){return function(_0x17fef3){if(_0x17fef3){return _0x17fef3['update'](_0x3b4f81)[_0x8b2f('0x23')](function(_0x5c81a4){return _0x5c81a4;});}return null;};}function removeEntity(_0x56cb03,_0x5ac304){return function(_0x5a69e0){if(_0x5a69e0){return _0x5a69e0[_0x8b2f('0x24')]()['then'](function(){_0x56cb03['status'](0xcc)[_0x8b2f('0x19')]();});}};}function handleEntityNotFound(_0x2ac6c9,_0x462b0f){return function(_0x4f23d2){if(!_0x4f23d2){_0x2ac6c9['sendStatus'](0x194);}return _0x4f23d2;};}function handleError(_0x23f5e3,_0x21fc57){_0x21fc57=_0x21fc57||0x1f4;return function(_0x3d79d3){logger[_0x8b2f('0x25')](_0x3d79d3[_0x8b2f('0x26')]);if(_0x3d79d3[_0x8b2f('0x27')]){delete _0x3d79d3['name'];}_0x23f5e3[_0x8b2f('0x18')](_0x21fc57)[_0x8b2f('0x28')](_0x3d79d3);};}exports[_0x8b2f('0x29')]=function(_0x38857e,_0x1021d6){var _0x52fbe3={},_0x7543c6={},_0x246095={'count':0x0,'rows':[]};var _0x398587=_['map'](db[_0x8b2f('0x2a')]['rawAttributes'],function(_0x3dc404){return{'name':_0x3dc404[_0x8b2f('0x2b')],'type':_0x3dc404[_0x8b2f('0x2c')][_0x8b2f('0x2d')]};});_0x7543c6[_0x8b2f('0x2e')]=_[_0x8b2f('0x2f')](_0x398587,_0x8b2f('0x27'));_0x7543c6[_0x8b2f('0x30')]=_['keys'](_0x38857e[_0x8b2f('0x30')]);_0x7543c6[_0x8b2f('0x31')]=_[_0x8b2f('0x32')](_0x7543c6['model'],_0x7543c6[_0x8b2f('0x30')]);_0x52fbe3[_0x8b2f('0x33')]=_[_0x8b2f('0x32')](_0x7543c6[_0x8b2f('0x2e')],qs[_0x8b2f('0x34')](_0x38857e[_0x8b2f('0x30')][_0x8b2f('0x34')]));_0x52fbe3['attributes']=_0x52fbe3[_0x8b2f('0x33')][_0x8b2f('0x35')]?_0x52fbe3[_0x8b2f('0x33')]:_0x7543c6[_0x8b2f('0x2e')];if(!_0x38857e['query'][_0x8b2f('0x36')](_0x8b2f('0x37'))){_0x52fbe3[_0x8b2f('0x1d')]=qs[_0x8b2f('0x1d')](_0x38857e['query']['limit']);_0x52fbe3[_0x8b2f('0x1b')]=qs[_0x8b2f('0x1b')](_0x38857e[_0x8b2f('0x30')][_0x8b2f('0x1b')]);}_0x52fbe3[_0x8b2f('0x38')]=qs[_0x8b2f('0x39')](_0x38857e[_0x8b2f('0x30')]['sort']);_0x52fbe3[_0x8b2f('0x3a')]=qs['filters'](_[_0x8b2f('0x3b')](_0x38857e['query'],_0x7543c6[_0x8b2f('0x31')]),_0x398587);if(_0x38857e[_0x8b2f('0x30')][_0x8b2f('0x3c')]){_0x52fbe3[_0x8b2f('0x3a')]=_[_0x8b2f('0x3d')](_0x52fbe3[_0x8b2f('0x3a')],{'$or':_[_0x8b2f('0x2f')](_0x398587,function(_0x371fe4){if(_0x371fe4[_0x8b2f('0x2c')]!=='VIRTUAL'){var _0x13071d={};_0x13071d[_0x371fe4[_0x8b2f('0x27')]]={'$like':'%'+_0x38857e[_0x8b2f('0x30')][_0x8b2f('0x3c')]+'%'};return _0x13071d;}})});}_0x52fbe3=_['merge']({},_0x52fbe3,_0x38857e[_0x8b2f('0x3e')]);var _0x52b324={'where':_0x52fbe3[_0x8b2f('0x3a')]};return db[_0x8b2f('0x2a')][_0x8b2f('0x1e')](_0x52b324)['then'](function(_0x187ab6){_0x246095['count']=_0x187ab6;if(_0x38857e['query'][_0x8b2f('0x3f')]){_0x52fbe3[_0x8b2f('0x40')]=[{'all':!![]}];}return db[_0x8b2f('0x2a')][_0x8b2f('0x41')](_0x52fbe3);})[_0x8b2f('0x23')](function(_0x228d0){_0x246095[_0x8b2f('0x42')]=_0x228d0;return _0x246095;})[_0x8b2f('0x23')](respondWithFilteredResult(_0x1021d6,_0x52fbe3))[_0x8b2f('0x43')](handleError(_0x1021d6,null));};exports[_0x8b2f('0x44')]=function(_0x419d21,_0x12e4c4){var _0x2bb63a={'raw':!![],'where':{'id':_0x419d21[_0x8b2f('0x45')]['id']}},_0x29e095={};_0x29e095[_0x8b2f('0x2e')]=_[_0x8b2f('0x46')](db[_0x8b2f('0x2a')][_0x8b2f('0x47')]);_0x29e095[_0x8b2f('0x30')]=_[_0x8b2f('0x46')](_0x419d21[_0x8b2f('0x30')]);_0x29e095[_0x8b2f('0x31')]=_['intersection'](_0x29e095[_0x8b2f('0x2e')],_0x29e095['query']);_0x2bb63a[_0x8b2f('0x33')]=_[_0x8b2f('0x32')](_0x29e095[_0x8b2f('0x2e')],qs['fields'](_0x419d21[_0x8b2f('0x30')]['fields']));_0x2bb63a['attributes']=_0x2bb63a['attributes']['length']?_0x2bb63a['attributes']:_0x29e095[_0x8b2f('0x2e')];if(_0x419d21[_0x8b2f('0x30')][_0x8b2f('0x3f')]){_0x2bb63a[_0x8b2f('0x40')]=[{'all':!![]}];}_0x2bb63a=_['merge']({},_0x2bb63a,_0x419d21[_0x8b2f('0x3e')]);return db[_0x8b2f('0x2a')][_0x8b2f('0x48')](_0x2bb63a)[_0x8b2f('0x23')](handleEntityNotFound(_0x12e4c4,null))[_0x8b2f('0x23')](respondWithResult(_0x12e4c4,null))['catch'](handleError(_0x12e4c4,null));};exports[_0x8b2f('0x49')]=function(_0x3636b6,_0x3f45fb){var _0x779464={'where':{'id':_0x3636b6[_0x8b2f('0x45')]['id']}},_0x5de2fb={};_0x5de2fb['model']=_[_0x8b2f('0x46')](db['Attachment'][_0x8b2f('0x47')]);_0x779464[_0x8b2f('0x33')]=_[_0x8b2f('0x32')](_0x5de2fb[_0x8b2f('0x2e')],qs[_0x8b2f('0x34')](_0x3636b6[_0x8b2f('0x30')][_0x8b2f('0x34')]));_0x779464[_0x8b2f('0x33')]=_0x779464[_0x8b2f('0x33')][_0x8b2f('0x35')]?_0x779464['attributes']:_0x5de2fb[_0x8b2f('0x2e')];if(_0x3636b6[_0x8b2f('0x30')][_0x8b2f('0x3f')]){_0x779464[_0x8b2f('0x40')]=[{'all':!![]}];}_0x779464=_[_0x8b2f('0x3d')]({},_0x779464,_0x3636b6[_0x8b2f('0x3e')]);return db[_0x8b2f('0x2a')][_0x8b2f('0x48')](_0x779464)[_0x8b2f('0x23')](handleEntityNotFound(_0x3f45fb,null))[_0x8b2f('0x23')](function(_0x1c61b7){if(_0x1c61b7){var _0x56196d=_0x1c61b7[_0x8b2f('0x4a')]({'plain':!![]});_0x56196d=qs['omit'](_0x56196d,['id',_0x8b2f('0x4b'),_0x8b2f('0x4c')]);_0x3636b6['body']=_[_0x8b2f('0x4d')](_0x3636b6['body'],['id',_0x8b2f('0x4b'),'updatedAt']);return db[_0x8b2f('0x2a')]['create'](_['merge'](_0x56196d,_0x3636b6[_0x8b2f('0x4e')]),{'include':_0x3636b6[_0x8b2f('0x30')][_0x8b2f('0x3f')]?[{'all':!![]}]:undefined});}})[_0x8b2f('0x23')](respondWithResult(_0x3f45fb,0xc9))[_0x8b2f('0x43')](handleError(_0x3f45fb,null));};exports[_0x8b2f('0x4f')]=function(_0x39732b,_0x57e999){if(_0x39732b[_0x8b2f('0x4e')]['id']){delete _0x39732b[_0x8b2f('0x4e')]['id'];}return db[_0x8b2f('0x2a')]['find']({'where':{'id':_0x39732b['params']['id']}})[_0x8b2f('0x23')](handleEntityNotFound(_0x57e999,null))['then'](saveUpdates(_0x39732b[_0x8b2f('0x4e')],null))[_0x8b2f('0x23')](respondWithResult(_0x57e999,null))[_0x8b2f('0x43')](handleError(_0x57e999,null));};exports[_0x8b2f('0x24')]=function(_0x52b63e,_0x4bfc62){return db[_0x8b2f('0x2a')][_0x8b2f('0x48')]({'where':{'id':_0x52b63e[_0x8b2f('0x45')]['id']}})[_0x8b2f('0x23')](handleEntityNotFound(_0x4bfc62,null))[_0x8b2f('0x23')](removeEntity(_0x4bfc62,null))[_0x8b2f('0x43')](handleError(_0x4bfc62,null));};exports[_0x8b2f('0x50')]=function(_0x1a48b2,_0x4305a6,_0x142d42){_0x1a48b2[_0x8b2f('0x4e')][_0x8b2f('0x27')]=_0x1a48b2['file'][_0x8b2f('0x51')];_0x1a48b2[_0x8b2f('0x4e')][_0x8b2f('0x52')]=_0x1a48b2[_0x8b2f('0x53')][_0x8b2f('0x54')];_0x1a48b2[_0x8b2f('0x4e')][_0x8b2f('0x2c')]=_0x1a48b2[_0x8b2f('0x53')][_0x8b2f('0x55')];return db[_0x8b2f('0x2a')]['create'](_0x1a48b2['body'])[_0x8b2f('0x23')](respondWithResult(_0x4305a6,0xc9))[_0x8b2f('0x43')](handleError(_0x4305a6,null));};exports[_0x8b2f('0x56')]=function(_0x582f61,_0x48dbe4,_0x30b555){return db['Attachment'][_0x8b2f('0x57')]({'where':{'id':_0x582f61[_0x8b2f('0x45')]['id']},'raw':!![]})['then'](handleEntityNotFound(_0x48dbe4,null))[_0x8b2f('0x23')](function(_0x5ccce9){if(_0x5ccce9){var _0x23cacf=_0x5ccce9['ChatOfflineMessageId']!==null;var _0x25bfde=path[_0x8b2f('0x58')](config['root'],_0x8b2f('0x59'));if(_0x23cacf){_0x25bfde=path[_0x8b2f('0x58')](_0x25bfde,'offline-chat/');}var _0xd100e7=path[_0x8b2f('0x58')](_0x25bfde,_0x5ccce9[_0x8b2f('0x52')]);return _0x48dbe4['download'](_0xd100e7);}})[_0x8b2f('0x43')](handleError(_0x48dbe4,null));};
\ No newline at end of file
diff --git a/server/api/attachment/attachment.model.js b/server/api/attachment/attachment.model.js
index a72196c..fdd407c 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 _0xe6d3=['request-promise','path','rimraf','exports','Attachment','attachments','lodash','util','../../config/logger','api','moment','bluebird'];(function(_0x1e24b1,_0x14ab30){var _0x212baf=function(_0x2bd3e9){while(--_0x2bd3e9){_0x1e24b1['push'](_0x1e24b1['shift']());}};_0x212baf(++_0x14ab30);}(_0xe6d3,0xf6));var _0x3e6d=function(_0x6c993a,_0x5ea3ab){_0x6c993a=_0x6c993a-0x0;var _0x27f547=_0xe6d3[_0x6c993a];return _0x27f547;};'use strict';var _=require(_0x3e6d('0x0'));var util=require(_0x3e6d('0x1'));var logger=require(_0x3e6d('0x2'))(_0x3e6d('0x3'));var moment=require(_0x3e6d('0x4'));var BPromise=require(_0x3e6d('0x5'));var rp=require(_0x3e6d('0x6'));var fs=require('fs');var path=require(_0x3e6d('0x7'));var rimraf=require(_0x3e6d('0x8'));var config=require('../../config/environment');var attributes=require('./attachment.attributes');module[_0x3e6d('0x9')]=function(_0x42cadc,_0x527676){return _0x42cadc['define'](_0x3e6d('0xa'),attributes,{'tableName':_0x3e6d('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x8b8b=['rimraf','../../config/environment','./attachment.attributes','exports','define','Attachment','attachments','util','../../config/logger','api','moment','request-promise'];(function(_0x34c886,_0x546999){var _0x3b5e96=function(_0x55dddb){while(--_0x55dddb){_0x34c886['push'](_0x34c886['shift']());}};_0x3b5e96(++_0x546999);}(_0x8b8b,0x67));var _0xb8b8=function(_0x43c33b,_0x247952){_0x43c33b=_0x43c33b-0x0;var _0x2c6838=_0x8b8b[_0x43c33b];return _0x2c6838;};'use strict';var _=require('lodash');var util=require(_0xb8b8('0x0'));var logger=require(_0xb8b8('0x1'))(_0xb8b8('0x2'));var moment=require(_0xb8b8('0x3'));var BPromise=require('bluebird');var rp=require(_0xb8b8('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0xb8b8('0x5'));var config=require(_0xb8b8('0x6'));var attributes=require(_0xb8b8('0x7'));module[_0xb8b8('0x8')]=function(_0x4b2ad8,_0x468dcb){return _0x4b2ad8[_0xb8b8('0x9')](_0xb8b8('0xa'),attributes,{'tableName':_0xb8b8('0xb'),'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 f5ca6a8..9a617c9 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 _0x402f=['../../config/utils','rpc','jayson/promise','client','http','request','then','info','Attachment,\x20%s,\x20%s','request\x20sent','debug','message','error','CreateAttachment','Attachment','create','options','raw','catch','lodash','moment','ioredis','../../mysqldb'];(function(_0x56b9f0,_0x42676e){var _0x5a00f3=function(_0x4ac9b5){while(--_0x4ac9b5){_0x56b9f0['push'](_0x56b9f0['shift']());}};_0x5a00f3(++_0x42676e);}(_0x402f,0x6f));var _0xf402=function(_0x4af3e7,_0x526823){_0x4af3e7=_0x4af3e7-0x0;var _0x544823=_0x402f[_0x4af3e7];return _0x544823;};'use strict';var _=require(_0xf402('0x0'));var util=require('util');var moment=require(_0xf402('0x1'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xf402('0x2'));var db=require(_0xf402('0x3'))['db'];var utils=require(_0xf402('0x4'));var logger=require('../../config/logger')(_0xf402('0x5'));var config=require('../../config/environment');var jayson=require(_0xf402('0x6'));var client=jayson[_0xf402('0x7')][_0xf402('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x2a8774,_0xa1b27d,_0x55c515){return new BPromise(function(_0x4d1771,_0x2f0ffe){return client[_0xf402('0x9')](_0x2a8774,_0x55c515)[_0xf402('0xa')](function(_0xdc18e0){logger[_0xf402('0xb')](_0xf402('0xc'),_0xa1b27d,_0xf402('0xd'));logger[_0xf402('0xe')]('Attachment,\x20%s,\x20%s,\x20%s',_0xa1b27d,_0xf402('0xd'),JSON['stringify'](_0xdc18e0));if(_0xdc18e0['error']){if(_0xdc18e0['error']['code']===0x1f4){logger['error'](_0xf402('0xc'),_0xa1b27d,_0xdc18e0['error']['message']);return _0x2f0ffe(_0xdc18e0['error'][_0xf402('0xf')]);}logger['error'](_0xf402('0xc'),_0xa1b27d,_0xdc18e0[_0xf402('0x10')][_0xf402('0xf')]);return _0x4d1771(_0xdc18e0[_0xf402('0x10')]['message']);}else{logger[_0xf402('0xb')]('Attachment,\x20%s,\x20%s',_0xa1b27d,_0xf402('0xd'));_0x4d1771(_0xdc18e0['result']['message']);}})['catch'](function(_0xb45d00){logger[_0xf402('0x10')](_0xf402('0xc'),_0xa1b27d,_0xb45d00);_0x2f0ffe(_0xb45d00);});});}exports[_0xf402('0x11')]=function(_0x2fbe36){var _0x5d7236=this;return new Promise(function(_0x3ed3eb,_0x151166){return db[_0xf402('0x12')][_0xf402('0x13')](_0x2fbe36['body'],{'raw':_0x2fbe36[_0xf402('0x14')]?_0x2fbe36[_0xf402('0x14')][_0xf402('0x15')]===undefined?!![]:![]:!![]})[_0xf402('0xa')](function(_0x3d3ed4){logger[_0xf402('0xb')](_0xf402('0x11'),_0x2fbe36);logger[_0xf402('0xe')](_0xf402('0x11'),_0x2fbe36,JSON['stringify'](_0x3d3ed4));_0x3ed3eb(_0x3d3ed4);})[_0xf402('0x16')](function(_0x4ffe46){logger[_0xf402('0x10')](_0xf402('0x11'),_0x4ffe46[_0xf402('0xf')],_0x2fbe36);_0x151166(_0x5d7236[_0xf402('0x10')](0x1f4,_0x4ffe46[_0xf402('0xf')]));});});};
\ No newline at end of file
+var _0x630e=['code','Attachment,\x20%s,\x20%s','message','result','catch','CreateAttachment','Attachment','create','body','options','raw','lodash','moment','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','then','info','debug','Attachment,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error'];(function(_0x251e8c,_0x277c33){var _0x1e0c1d=function(_0x20b89c){while(--_0x20b89c){_0x251e8c['push'](_0x251e8c['shift']());}};_0x1e0c1d(++_0x277c33);}(_0x630e,0x1af));var _0xe630=function(_0x37c495,_0x41f868){_0x37c495=_0x37c495-0x0;var _0x5c9b51=_0x630e[_0x37c495];return _0x5c9b51;};'use strict';var _=require(_0xe630('0x0'));var util=require('util');var moment=require(_0xe630('0x1'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xe630('0x2'));var db=require(_0xe630('0x3'))['db'];var utils=require(_0xe630('0x4'));var logger=require('../../config/logger')(_0xe630('0x5'));var config=require(_0xe630('0x6'));var jayson=require(_0xe630('0x7'));var client=jayson[_0xe630('0x8')][_0xe630('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x481b21,_0x20193d,_0x34bad4){return new BPromise(function(_0x5a73ad,_0x267926){return client['request'](_0x481b21,_0x34bad4)[_0xe630('0xa')](function(_0x3da641){logger[_0xe630('0xb')]('Attachment,\x20%s,\x20%s',_0x20193d,'request\x20sent');logger[_0xe630('0xc')](_0xe630('0xd'),_0x20193d,_0xe630('0xe'),JSON[_0xe630('0xf')](_0x3da641));if(_0x3da641['error']){if(_0x3da641[_0xe630('0x10')][_0xe630('0x11')]===0x1f4){logger[_0xe630('0x10')](_0xe630('0x12'),_0x20193d,_0x3da641[_0xe630('0x10')][_0xe630('0x13')]);return _0x267926(_0x3da641[_0xe630('0x10')][_0xe630('0x13')]);}logger[_0xe630('0x10')](_0xe630('0x12'),_0x20193d,_0x3da641[_0xe630('0x10')][_0xe630('0x13')]);return _0x5a73ad(_0x3da641[_0xe630('0x10')]['message']);}else{logger[_0xe630('0xb')](_0xe630('0x12'),_0x20193d,_0xe630('0xe'));_0x5a73ad(_0x3da641[_0xe630('0x14')][_0xe630('0x13')]);}})[_0xe630('0x15')](function(_0x26a2b7){logger[_0xe630('0x10')](_0xe630('0x12'),_0x20193d,_0x26a2b7);_0x267926(_0x26a2b7);});});}exports[_0xe630('0x16')]=function(_0x3dbcf6){var _0x9721fa=this;return new Promise(function(_0xafcf13,_0x79213e){return db[_0xe630('0x17')][_0xe630('0x18')](_0x3dbcf6[_0xe630('0x19')],{'raw':_0x3dbcf6[_0xe630('0x1a')]?_0x3dbcf6[_0xe630('0x1a')][_0xe630('0x1b')]===undefined?!![]:![]:!![]})[_0xe630('0xa')](function(_0x22fa75){logger[_0xe630('0xb')](_0xe630('0x16'),_0x3dbcf6);logger[_0xe630('0xc')](_0xe630('0x16'),_0x3dbcf6,JSON['stringify'](_0x22fa75));_0xafcf13(_0x22fa75);})[_0xe630('0x15')](function(_0x35e869){logger[_0xe630('0x10')]('CreateAttachment',_0x35e869[_0xe630('0x13')],_0x3dbcf6);_0x79213e(_0x9721fa[_0xe630('0x10')](0x1f4,_0x35e869[_0xe630('0x13')]));});});};
\ No newline at end of file
diff --git a/server/api/attachment/index.js b/server/api/attachment/index.js
index f0a3203..0b1a689 100644
--- a/server/api/attachment/index.js
+++ b/server/api/attachment/index.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xb10b=['originalname','replace','single','file','create','put','/:id','update','destroy','exports','multer','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./attachment.controller','get','index','isAuthenticated','show','/:id/download','download','post','/:id/clone','diskStorage','join','server/files/attachments/','format','%s-%s'];(function(_0x12be71,_0x35b2e9){var _0xdb495c=function(_0x1a52b6){while(--_0x1a52b6){_0x12be71['push'](_0x12be71['shift']());}};_0xdb495c(++_0x35b2e9);}(_0xb10b,0x12a));var _0xbb10=function(_0x9a138c,_0x2607f8){_0x9a138c=_0x9a138c-0x0;var _0x3771a3=_0xb10b[_0x9a138c];return _0x3771a3;};'use strict';var multer=require(_0xbb10('0x0'));var util=require('util');var path=require(_0xbb10('0x1'));var timeout=require(_0xbb10('0x2'));var express=require(_0xbb10('0x3'));var router=express['Router']();var fs_extra=require(_0xbb10('0x4'));var auth=require(_0xbb10('0x5'));var interaction=require(_0xbb10('0x6'));var config=require(_0xbb10('0x7'));var controller=require(_0xbb10('0x8'));router[_0xbb10('0x9')]('/',auth['isAuthenticated'](),controller[_0xbb10('0xa')]);router[_0xbb10('0x9')]('/:id',auth[_0xbb10('0xb')](),controller[_0xbb10('0xc')]);router[_0xbb10('0x9')](_0xbb10('0xd'),auth[_0xbb10('0xb')](),controller[_0xbb10('0xe')]);router[_0xbb10('0xf')](_0xbb10('0x10'),auth['isAuthenticated'](),controller['clone']);var upload=multer({'storage':multer[_0xbb10('0x11')]({'destination':function(_0x118a74,_0xce64f3,_0x5e136d){_0x5e136d(null,path[_0xbb10('0x12')](config['root'],_0xbb10('0x13')));},'filename':function(_0x916a32,_0x285009,_0x193a27){_0x193a27(null,util[_0xbb10('0x14')](_0xbb10('0x15'),Date['now'](),_0x285009[_0xbb10('0x16')][_0xbb10('0x17')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-')));}})});router[_0xbb10('0xf')]('/',upload[_0xbb10('0x18')](_0xbb10('0x19')),controller[_0xbb10('0x1a')]);router[_0xbb10('0x1b')](_0xbb10('0x1c'),auth[_0xbb10('0xb')](),controller[_0xbb10('0x1d')]);router['delete'](_0xbb10('0x1c'),auth[_0xbb10('0xb')](),controller[_0xbb10('0x1e')]);module[_0xbb10('0x1f')]=router;
\ No newline at end of file
+var _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(_0x17d9e3,_0x1f969c){var _0x14192d=function(_0x159745){while(--_0x159745){_0x17d9e3['push'](_0x17d9e3['shift']());}};_0x14192d(++_0x1f969c);}(_0x0b0e,0x187));var _0xe0b0=function(_0x81fe53,_0x5b8f05){_0x81fe53=_0x81fe53-0x0;var _0x56f7a7=_0x0b0e[_0x81fe53];return _0x56f7a7;};'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 89350d4..092925e 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 _0x5bc9=['../../config/environment','../../config/logger','activedirectory','baseDN','url','domain','authenticate','error','Error\x20authenticate\x20%s:\x20%s','inspect','Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.','Error\x20authenticate\x20%s:\x20Wrong\x20credentials','Error\x20authenticate\x20%s:\x20Active\x20Directory\x20not\x20configured','Setting','findOne','adSsoEnabled','blockDuration','then','Error\x20authenticate\x20%s:\x20Active\x20Directory\x20not\x20enabled','password','salt','blocked','blockedAt','online','admin','user','agent','name','disabled','add','minutes','clearBlockUser','getLicense','catch','status','send','ad-login','Something\x20went\x20wrong,\x20please\x20try\x20again.','role','signToken','json','use','User','passport','passport-local','Strategy','moment','activedirectory2','bluebird','util','../../mysqldb','../../components/auth/service'];(function(_0x20ef64,_0x4a8fe9){var _0x3707d8=function(_0x5b9a88){while(--_0x5b9a88){_0x20ef64['push'](_0x20ef64['shift']());}};_0x3707d8(++_0x4a8fe9);}(_0x5bc9,0x93));var _0x95bc=function(_0x15d9d0,_0x7c0dc){_0x15d9d0=_0x15d9d0-0x0;var _0x4fb06a=_0x5bc9[_0x15d9d0];return _0x4fb06a;};'use strict';var passport=require(_0x95bc('0x0'));var LocalStrategy=require(_0x95bc('0x1'))[_0x95bc('0x2')];var moment=require(_0x95bc('0x3'));var ActiveDirectory=require(_0x95bc('0x4'));var BPromise=require(_0x95bc('0x5'));var util=require(_0x95bc('0x6'));var db=require(_0x95bc('0x7'))['db'];var authService=require(_0x95bc('0x8'));var utils=require('../../config/utils');var config=require(_0x95bc('0x9'));var logger=require(_0x95bc('0xa'))('api');function isActiveDirectoryConfigured(_0x3bb544){var _0xdd8fa9=![];if(typeof _0x3bb544[_0x95bc('0xb')]!=='undefined'){_0xdd8fa9=_0x3bb544[_0x95bc('0xb')][_0x95bc('0xc')]&&_0x3bb544[_0x95bc('0xb')][_0x95bc('0xd')]&&_0x3bb544[_0x95bc('0xb')][_0x95bc('0xe')];}return _0xdd8fa9;}function adAuthenticate(_0x516301,_0x17c9b4,_0x6a902){return new BPromise(function(_0x112751,_0x264df2){try{var _0x143110=new ActiveDirectory(_0x516301);_0x143110[_0x95bc('0xf')](_0x17c9b4,_0x6a902,function(_0x4f6463,_0x1e1d01){if(_0x4f6463){logger[_0x95bc('0x10')](_0x95bc('0x11'),_0x17c9b4,util[_0x95bc('0x12')](_0x4f6463,{'showHidden':![],'depth':null}));_0x264df2(_0x95bc('0x13'));}else if(!_0x1e1d01){logger['error'](_0x95bc('0x14'),_0x17c9b4);_0x264df2(_0x95bc('0x13'));}else{_0x112751(_0x1e1d01);}});}catch(_0x43719b){_0x264df2(_0x43719b);}});}function ActiveDirectoryAuthenticate(_0x42ccd8,_0x5b27d9,_0x5462d2,_0x1f92fb){var _0x37d120,_0x3cbbff;if(!isActiveDirectoryConfigured(config)){logger[_0x95bc('0x10')](_0x95bc('0x15'),_0x5b27d9);return _0x1f92fb(null,![],{'message':_0x95bc('0x13')});}return db[_0x95bc('0x16')][_0x95bc('0x17')]({'where':{'id':0x1},'attributes':[_0x95bc('0x18'),_0x95bc('0x19')],'raw':!![]})[_0x95bc('0x1a')](function(_0x5069ba){_0x37d120=_0x5069ba;if(!_0x37d120['adSsoEnabled']){logger['error'](_0x95bc('0x1b'),_0x5b27d9);throw new Error(_0x95bc('0x13'));}return _0x42ccd8[_0x95bc('0x17')]({'attributes':['id','name',_0x95bc('0x1c'),_0x95bc('0x1d'),'role','disabled',_0x95bc('0x1e'),_0x95bc('0x1f'),_0x95bc('0x20')],'where':{'name':_0x5b27d9,'role':{'$or':[_0x95bc('0x21'),_0x95bc('0x22'),_0x95bc('0x23')]},'adSsoEnabled':!![]}});})['then'](function(_0x1125d7){if(!_0x1125d7||_0x1125d7&&_0x1125d7[_0x95bc('0x24')]!==_0x5b27d9){throw new Error(_0x95bc('0x13'));}_0x3cbbff=_0x1125d7;var _0x145993=_0x3cbbff[_0x95bc('0x24')]+'@'+config[_0x95bc('0xb')][_0x95bc('0xe')];return adAuthenticate(config['activedirectory'],_0x145993,_0x5462d2);})[_0x95bc('0x1a')](function(_0x8387a0){if(_0x3cbbff[_0x95bc('0x25')]){throw new Error('Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.');}if(_0x37d120[_0x95bc('0x19')]>0x0){if(_0x3cbbff[_0x95bc('0x1e')]){if(moment(_0x3cbbff[_0x95bc('0x1f')])[_0x95bc('0x26')](_0x37d120['blockDuration'],_0x95bc('0x27'))>moment()){throw new Error(_0x95bc('0x13'));}return utils[_0x95bc('0x28')](_0x3cbbff,0x0,![],null)[_0x95bc('0x1a')](function(){return utils[_0x95bc('0x29')](_0x3cbbff);})[_0x95bc('0x1a')](function(){return _0x1f92fb(null,_0x3cbbff);});}else{return utils[_0x95bc('0x29')](_0x3cbbff)[_0x95bc('0x1a')](function(){return _0x1f92fb(null,_0x3cbbff);});}}else{return utils[_0x95bc('0x29')](_0x3cbbff)[_0x95bc('0x1a')](function(){return _0x1f92fb(null,_0x3cbbff);});}})[_0x95bc('0x2a')](function(_0x25c9d4){return _0x1f92fb(null,![],_0x25c9d4);});}function handleError(_0x57385a,_0x525596,_0x5d7ac5){return _0x57385a[_0x95bc('0x2b')](_0x525596||0x1f4)[_0x95bc('0x2c')]({'message':_0x5d7ac5?_0x5d7ac5['message']||_0x5d7ac5:''});}exports['login']=function(_0x51c584,_0x21278f,_0x513b54){passport[_0x95bc('0xf')](_0x95bc('0x2d'),function(_0x36448a,_0x5420b7,_0x2a1ec0){var _0x1f7c37=_0x36448a||_0x2a1ec0;if(_0x1f7c37){return handleError(_0x21278f,0x191,_0x1f7c37);}if(!_0x5420b7){return handleError(_0x21278f,0x194,{'message':_0x95bc('0x2e')});}else{var _0x56ee3d={'payload':{'id':_0x5420b7['id'],'role':_0x5420b7[_0x95bc('0x2f')]},'options':{'expiresIn':0x15180}};return authService[_0x95bc('0x30')](_0x56ee3d)[_0x95bc('0x1a')](function(_0x547f9e){_0x21278f[_0x95bc('0x31')]({'id':_0x5420b7['id'],'token':_0x547f9e,'statusCall':'','isAlreadyLogged':_0x5420b7[_0x95bc('0x20')]});});}})(_0x51c584,_0x21278f,_0x513b54);};passport[_0x95bc('0x32')](_0x95bc('0x2d'),new LocalStrategy({'usernameField':'name','passwordField':_0x95bc('0x1c')},function(_0x3da76a,_0x3b67a3,_0x8a96b4){return ActiveDirectoryAuthenticate(db[_0x95bc('0x33')],_0x3da76a,_0x3b67a3,_0x8a96b4);}));
\ No newline at end of file
+var _0xe314=['Error\x20authenticate\x20%s:\x20%s','inspect','Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.','Error\x20authenticate\x20%s:\x20Wrong\x20credentials','Error\x20authenticate\x20%s:\x20Active\x20Directory\x20not\x20configured','Setting','adSsoEnabled','blockDuration','then','Error\x20authenticate\x20%s:\x20Active\x20Directory\x20not\x20enabled','findOne','name','role','disabled','blocked','blockedAt','online','admin','user','add','minutes','clearBlockUser','getLicense','send','message','ad-login','Something\x20went\x20wrong,\x20please\x20try\x20again.','signToken','json','password','passport-local','Strategy','moment','activedirectory2','bluebird','util','../../mysqldb','../../components/auth/service','../../config/utils','../../config/environment','activedirectory','undefined','baseDN','url','domain','authenticate','error'];(function(_0x4b369d,_0x265eb8){var _0x571a98=function(_0x56341a){while(--_0x56341a){_0x4b369d['push'](_0x4b369d['shift']());}};_0x571a98(++_0x265eb8);}(_0xe314,0x7c));var _0x4e31=function(_0x1895fe,_0x3cd743){_0x1895fe=_0x1895fe-0x0;var _0x13d929=_0xe314[_0x1895fe];return _0x13d929;};'use strict';var passport=require('passport');var LocalStrategy=require(_0x4e31('0x0'))[_0x4e31('0x1')];var moment=require(_0x4e31('0x2'));var ActiveDirectory=require(_0x4e31('0x3'));var BPromise=require(_0x4e31('0x4'));var util=require(_0x4e31('0x5'));var db=require(_0x4e31('0x6'))['db'];var authService=require(_0x4e31('0x7'));var utils=require(_0x4e31('0x8'));var config=require(_0x4e31('0x9'));var logger=require('../../config/logger')('api');function isActiveDirectoryConfigured(_0x3c5e06){var _0x29d63d=![];if(typeof _0x3c5e06[_0x4e31('0xa')]!==_0x4e31('0xb')){_0x29d63d=_0x3c5e06[_0x4e31('0xa')][_0x4e31('0xc')]&&_0x3c5e06['activedirectory'][_0x4e31('0xd')]&&_0x3c5e06[_0x4e31('0xa')][_0x4e31('0xe')];}return _0x29d63d;}function adAuthenticate(_0x412fbe,_0x4e822f,_0x36389d){return new BPromise(function(_0xd0bbe0,_0x41fd32){try{var _0x456086=new ActiveDirectory(_0x412fbe);_0x456086[_0x4e31('0xf')](_0x4e822f,_0x36389d,function(_0x3459ba,_0x3bf7ce){if(_0x3459ba){logger[_0x4e31('0x10')](_0x4e31('0x11'),_0x4e822f,util[_0x4e31('0x12')](_0x3459ba,{'showHidden':![],'depth':null}));_0x41fd32(_0x4e31('0x13'));}else if(!_0x3bf7ce){logger[_0x4e31('0x10')](_0x4e31('0x14'),_0x4e822f);_0x41fd32(_0x4e31('0x13'));}else{_0xd0bbe0(_0x3bf7ce);}});}catch(_0x9d0d2){_0x41fd32(_0x9d0d2);}});}function ActiveDirectoryAuthenticate(_0x3f7e56,_0x8389a9,_0x2a3d6c,_0x5e846f){var _0xee6bb9,_0x2e8651;if(!isActiveDirectoryConfigured(config)){logger['error'](_0x4e31('0x15'),_0x8389a9);return _0x5e846f(null,![],{'message':_0x4e31('0x13')});}return db[_0x4e31('0x16')]['findOne']({'where':{'id':0x1},'attributes':[_0x4e31('0x17'),_0x4e31('0x18')],'raw':!![]})[_0x4e31('0x19')](function(_0x5cdcba){_0xee6bb9=_0x5cdcba;if(!_0xee6bb9[_0x4e31('0x17')]){logger[_0x4e31('0x10')](_0x4e31('0x1a'),_0x8389a9);throw new Error('Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.');}return _0x3f7e56[_0x4e31('0x1b')]({'attributes':['id',_0x4e31('0x1c'),'password','salt',_0x4e31('0x1d'),_0x4e31('0x1e'),_0x4e31('0x1f'),_0x4e31('0x20'),_0x4e31('0x21')],'where':{'name':_0x8389a9,'role':{'$or':[_0x4e31('0x22'),_0x4e31('0x23'),'agent']},'adSsoEnabled':!![]}});})[_0x4e31('0x19')](function(_0x31c5dc){if(!_0x31c5dc||_0x31c5dc&&_0x31c5dc[_0x4e31('0x1c')]!==_0x8389a9){throw new Error('Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.');}_0x2e8651=_0x31c5dc;var _0x1056ea=_0x2e8651[_0x4e31('0x1c')]+'@'+config[_0x4e31('0xa')][_0x4e31('0xe')];return adAuthenticate(config[_0x4e31('0xa')],_0x1056ea,_0x2a3d6c);})['then'](function(_0x25f1c9){if(_0x2e8651[_0x4e31('0x1e')]){throw new Error(_0x4e31('0x13'));}if(_0xee6bb9['blockDuration']>0x0){if(_0x2e8651[_0x4e31('0x1f')]){if(moment(_0x2e8651[_0x4e31('0x20')])[_0x4e31('0x24')](_0xee6bb9[_0x4e31('0x18')],_0x4e31('0x25'))>moment()){throw new Error(_0x4e31('0x13'));}return utils[_0x4e31('0x26')](_0x2e8651,0x0,![],null)[_0x4e31('0x19')](function(){return utils[_0x4e31('0x27')](_0x2e8651);})[_0x4e31('0x19')](function(){return _0x5e846f(null,_0x2e8651);});}else{return utils[_0x4e31('0x27')](_0x2e8651)['then'](function(){return _0x5e846f(null,_0x2e8651);});}}else{return utils[_0x4e31('0x27')](_0x2e8651)[_0x4e31('0x19')](function(){return _0x5e846f(null,_0x2e8651);});}})['catch'](function(_0x32d9bf){return _0x5e846f(null,![],_0x32d9bf);});}function handleError(_0x41d0eb,_0x522374,_0x2fb71b){return _0x41d0eb['status'](_0x522374||0x1f4)[_0x4e31('0x28')]({'message':_0x2fb71b?_0x2fb71b[_0x4e31('0x29')]||_0x2fb71b:''});}exports['login']=function(_0x3d721c,_0x446df6,_0x46d380){passport[_0x4e31('0xf')](_0x4e31('0x2a'),function(_0x271672,_0x26f79b,_0x1027bc){var _0x4e210f=_0x271672||_0x1027bc;if(_0x4e210f){return handleError(_0x446df6,0x191,_0x4e210f);}if(!_0x26f79b){return handleError(_0x446df6,0x194,{'message':_0x4e31('0x2b')});}else{var _0x5a309e={'payload':{'id':_0x26f79b['id'],'role':_0x26f79b[_0x4e31('0x1d')]},'options':{'expiresIn':0x15180}};return authService[_0x4e31('0x2c')](_0x5a309e)['then'](function(_0x2dc913){_0x446df6[_0x4e31('0x2d')]({'id':_0x26f79b['id'],'token':_0x2dc913,'statusCall':'','isAlreadyLogged':_0x26f79b[_0x4e31('0x21')]});});}})(_0x3d721c,_0x446df6,_0x46d380);};passport['use'](_0x4e31('0x2a'),new LocalStrategy({'usernameField':_0x4e31('0x1c'),'passwordField':_0x4e31('0x2e')},function(_0x209d9a,_0x5d21de,_0x2862fc){return ActiveDirectoryAuthenticate(db['User'],_0x209d9a,_0x5d21de,_0x2862fc);}));
\ No newline at end of file
diff --git a/server/api/authActiveDirectory/index.js b/server/api/authActiveDirectory/index.js
index fe8e676..69927da 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 _0x7ba3=['login','exports','express','./authActiveDirectory.controller','post'];(function(_0x370d3d,_0x2b1c24){var _0x15e2a5=function(_0x434903){while(--_0x434903){_0x370d3d['push'](_0x370d3d['shift']());}};_0x15e2a5(++_0x2b1c24);}(_0x7ba3,0x133));var _0x37ba=function(_0x267484,_0x3eb131){_0x267484=_0x267484-0x0;var _0x14a356=_0x7ba3[_0x267484];return _0x14a356;};'use strict';var express=require(_0x37ba('0x0'));var router=express['Router']();var controller=require(_0x37ba('0x1'));router[_0x37ba('0x2')]('/',controller[_0x37ba('0x3')]);module[_0x37ba('0x4')]=router;
\ No newline at end of file
+var _0x683b=['./authActiveDirectory.controller','post','express'];(function(_0x2c1b7f,_0x10e904){var _0x4e2203=function(_0x3fd472){while(--_0x3fd472){_0x2c1b7f['push'](_0x2c1b7f['shift']());}};_0x4e2203(++_0x10e904);}(_0x683b,0x92));var _0xb683=function(_0x142b3f,_0x3dd08d){_0x142b3f=_0x142b3f-0x0;var _0x2dfbe0=_0x683b[_0x142b3f];return _0x2dfbe0;};'use strict';var express=require(_0xb683('0x0'));var router=express['Router']();var controller=require(_0xb683('0x1'));router[_0xb683('0x2')]('/',controller['login']);module['exports']=router;
\ No newline at end of file
diff --git a/server/api/authGoogle/authGoogle.controller.js b/server/api/authGoogle/authGoogle.controller.js
index 6e00210..d1ebf1a 100644
--- a/server/api/authGoogle/authGoogle.controller.js
+++ b/server/api/authGoogle/authGoogle.controller.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x9957=['../../config/environment','../../config/utils','login','google','/login','profile','email','callback','authenticate','use','clientID','clientSecret','secret','callbackURL','Setting','findOne','allowedLoginAttempts','User','find','map','emails','value','admin','user','then','disabled','Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.','blockDuration','blocked','blockedAt','add','getLicense','catch','lodash','passport','passport-google-oauth20','Strategy','../../mysqldb'];(function(_0x436fb2,_0x5cba16){var _0x3cb885=function(_0x1ba810){while(--_0x1ba810){_0x436fb2['push'](_0x436fb2['shift']());}};_0x3cb885(++_0x5cba16);}(_0x9957,0x93));var _0x7995=function(_0x1ac595,_0x5d2081){_0x1ac595=_0x1ac595-0x0;var _0x455fff=_0x9957[_0x1ac595];return _0x455fff;};'use strict';var _=require(_0x7995('0x0'));var passport=require(_0x7995('0x1'));var GoogleStrategy=require(_0x7995('0x2'))[_0x7995('0x3')];var moment=require('moment');var db=require(_0x7995('0x4'))['db'];var config=require(_0x7995('0x5'));var utils=require(_0x7995('0x6'));exports[_0x7995('0x7')]=passport['authenticate'](_0x7995('0x8'),{'failureRedirect':_0x7995('0x9'),'scope':[_0x7995('0xa'),_0x7995('0xb')],'session':![]});exports[_0x7995('0xc')]=passport[_0x7995('0xd')]('google',{'failureRedirect':_0x7995('0x9'),'session':![]});passport[_0x7995('0xe')](new GoogleStrategy({'clientID':config['google']?config[_0x7995('0x8')][_0x7995('0xf')]:'id','clientSecret':config[_0x7995('0x8')]?config[_0x7995('0x8')][_0x7995('0x10')]:_0x7995('0x11'),'callbackURL':config[_0x7995('0x8')]?config['google'][_0x7995('0x12')]:''},function(_0x41c652,_0x581f22,_0xb0c872,_0x2cb37a){var _0x19a27e,_0x385f00;return db[_0x7995('0x13')][_0x7995('0x14')]({'where':{'id':0x1},'attributes':[_0x7995('0x15'),'blockDuration'],'raw':!![]})['then'](function(_0x2b4e94){_0x19a27e=_0x2b4e94;return db[_0x7995('0x16')][_0x7995('0x17')]({'where':{'email':_[_0x7995('0x18')](_0xb0c872[_0x7995('0x19')],_0x7995('0x1a')),'role':{'$or':[_0x7995('0x1b'),_0x7995('0x1c'),'agent']}}});})[_0x7995('0x1d')](function(_0x565d97){_0x385f00=_0x565d97;if(_0x385f00){if(_0x385f00[_0x7995('0x1e')]){return _0x2cb37a(_0x7995('0x1f'));}else if(_0x19a27e[_0x7995('0x20')]>0x0){if(_0x385f00[_0x7995('0x21')]){if(moment(_0x385f00[_0x7995('0x22')])[_0x7995('0x23')](_0x19a27e['blockDuration'],'minutes')>moment()){return _0x2cb37a(_0x7995('0x1f'));}else{return utils['clearBlockUser'](_0x385f00,0x0,![],null)['then'](function(){return utils[_0x7995('0x24')](_0x385f00);})[_0x7995('0x1d')](function(){return _0x2cb37a(null,_0x385f00);});}}else{return utils['getLicense'](_0x385f00)[_0x7995('0x1d')](function(){return _0x2cb37a(null,_0x385f00);});}}else{return utils['getLicense'](_0x385f00)['then'](function(){return _0x2cb37a(null,_0x385f00);});}}return _0x2cb37a(_0x7995('0x1f'));})[_0x7995('0x25')](function(_0x350fd9){_0x2cb37a(_0x350fd9);});}));
\ No newline at end of file
+var _0x7a54=['blockedAt','add','minutes','clearBlockUser','getLicense','catch','lodash','passport','passport-google-oauth20','moment','../../mysqldb','../../config/utils','login','authenticate','google','/login','email','use','secret','callbackURL','findOne','allowedLoginAttempts','blockDuration','then','User','find','map','value','admin','user','agent','Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'];(function(_0x2c91e9,_0x2fb965){var _0x13f0ff=function(_0xb39edf){while(--_0xb39edf){_0x2c91e9['push'](_0x2c91e9['shift']());}};_0x13f0ff(++_0x2fb965);}(_0x7a54,0x106));var _0x47a5=function(_0xf62cf0,_0x3a09ac){_0xf62cf0=_0xf62cf0-0x0;var _0x16a65c=_0x7a54[_0xf62cf0];return _0x16a65c;};'use strict';var _=require(_0x47a5('0x0'));var passport=require(_0x47a5('0x1'));var GoogleStrategy=require(_0x47a5('0x2'))['Strategy'];var moment=require(_0x47a5('0x3'));var db=require(_0x47a5('0x4'))['db'];var config=require('../../config/environment');var utils=require(_0x47a5('0x5'));exports[_0x47a5('0x6')]=passport[_0x47a5('0x7')](_0x47a5('0x8'),{'failureRedirect':_0x47a5('0x9'),'scope':['profile',_0x47a5('0xa')],'session':![]});exports['callback']=passport[_0x47a5('0x7')](_0x47a5('0x8'),{'failureRedirect':'/login','session':![]});passport[_0x47a5('0xb')](new GoogleStrategy({'clientID':config['google']?config['google']['clientID']:'id','clientSecret':config[_0x47a5('0x8')]?config[_0x47a5('0x8')]['clientSecret']:_0x47a5('0xc'),'callbackURL':config['google']?config['google'][_0x47a5('0xd')]:''},function(_0x69e4d4,_0x2f399b,_0x250fad,_0xd612dd){var _0xd308b8,_0x1eae59;return db['Setting'][_0x47a5('0xe')]({'where':{'id':0x1},'attributes':[_0x47a5('0xf'),_0x47a5('0x10')],'raw':!![]})[_0x47a5('0x11')](function(_0x139f25){_0xd308b8=_0x139f25;return db[_0x47a5('0x12')][_0x47a5('0x13')]({'where':{'email':_[_0x47a5('0x14')](_0x250fad['emails'],_0x47a5('0x15')),'role':{'$or':[_0x47a5('0x16'),_0x47a5('0x17'),_0x47a5('0x18')]}}});})[_0x47a5('0x11')](function(_0x574af6){_0x1eae59=_0x574af6;if(_0x1eae59){if(_0x1eae59['disabled']){return _0xd612dd(_0x47a5('0x19'));}else if(_0xd308b8['blockDuration']>0x0){if(_0x1eae59['blocked']){if(moment(_0x1eae59[_0x47a5('0x1a')])[_0x47a5('0x1b')](_0xd308b8[_0x47a5('0x10')],_0x47a5('0x1c'))>moment()){return _0xd612dd(_0x47a5('0x19'));}else{return utils[_0x47a5('0x1d')](_0x1eae59,0x0,![],null)[_0x47a5('0x11')](function(){return utils[_0x47a5('0x1e')](_0x1eae59);})[_0x47a5('0x11')](function(){return _0xd612dd(null,_0x1eae59);});}}else{return utils['getLicense'](_0x1eae59)[_0x47a5('0x11')](function(){return _0xd612dd(null,_0x1eae59);});}}else{return utils[_0x47a5('0x1e')](_0x1eae59)['then'](function(){return _0xd612dd(null,_0x1eae59);});}}return _0xd612dd(_0x47a5('0x19'));})[_0x47a5('0x1f')](function(_0x36874d){_0xd612dd(_0x36874d);});}));
\ No newline at end of file
diff --git a/server/api/authGoogle/index.js b/server/api/authGoogle/index.js
index a7cfbe4..6967ecf 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 _0xa2ad=['get','login','/callback','callback','isMiddleware','setTokenCookie','exports','express','passport','Router','./authGoogle.controller','../user/user.controller.js','../../components/auth/service'];(function(_0x20b7f9,_0x4fcb64){var _0x4df976=function(_0x3b7694){while(--_0x3b7694){_0x20b7f9['push'](_0x20b7f9['shift']());}};_0x4df976(++_0x4fcb64);}(_0xa2ad,0xa3));var _0xda2a=function(_0x232cf2,_0x4ffb79){_0x232cf2=_0x232cf2-0x0;var _0x463cec=_0xa2ad[_0x232cf2];return _0x463cec;};'use strict';var express=require(_0xda2a('0x0'));var passport=require(_0xda2a('0x1'));var router=express[_0xda2a('0x2')]();var controller=require(_0xda2a('0x3'));var userController=require(_0xda2a('0x4'));var authService=require(_0xda2a('0x5'));router[_0xda2a('0x6')]('/',controller[_0xda2a('0x7')]);router[_0xda2a('0x6')](_0xda2a('0x8'),controller[_0xda2a('0x9')],authService[_0xda2a('0xa')],userController[_0xda2a('0x7')],authService[_0xda2a('0xb')]);module[_0xda2a('0xc')]=router;
\ No newline at end of file
+var _0x9d3f=['passport','Router','../../components/auth/service','get','login','/callback','isMiddleware','exports','express'];(function(_0xc78bf7,_0x584020){var _0xfce0da=function(_0x4aebc2){while(--_0x4aebc2){_0xc78bf7['push'](_0xc78bf7['shift']());}};_0xfce0da(++_0x584020);}(_0x9d3f,0x1b8));var _0xf9d3=function(_0x2be1e0,_0x2ec1d3){_0x2be1e0=_0x2be1e0-0x0;var _0x57485b=_0x9d3f[_0x2be1e0];return _0x57485b;};'use strict';var express=require(_0xf9d3('0x0'));var passport=require(_0xf9d3('0x1'));var router=express[_0xf9d3('0x2')]();var controller=require('./authGoogle.controller');var userController=require('../user/user.controller.js');var authService=require(_0xf9d3('0x3'));router[_0xf9d3('0x4')]('/',controller[_0xf9d3('0x5')]);router['get'](_0xf9d3('0x6'),controller['callback'],authService[_0xf9d3('0x7')],userController['login'],authService['setTokenCookie']);module[_0xf9d3('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 de8d5f9..a3b1652 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 _0x48e4=['add','clearBlockUser','minutes','getLicense','catch','find','email','MailServerOut','Smtp','CloudProvider','Unable\x20to\x20find\x20a\x20configured\x20SMTP\x20service!','getSmtpOptions','merge','format','\x22%s\x22\x20<%s>','request','error','SendMail\x20error:\x20%s.\x20Please\x20contact\x20your\x20Administrator!','message','stringify','send','local-login','Something\x20went\x20wrong,\x20please\x20try\x20again.','signToken','online','forgot','Email\x20parameter\x20is\x20missing','generate','body','trim','toLowerCase','Setting','User','This\x20email\x20is\x20not\x20registered.','The\x20user\x20is\x20disabled.\x20Please\x20contact\x20the\x20administrator.','The\x20user\x20is\x20blocked.\x20Please\x20contact\x20the\x20administrator.','save','xCally\x20Motion\x20Password\x20Reset','You\x20are\x20receiving\x20this\x20because\x20you\x20(or\x20someone\x20else)\x20have\x20requested\x20the\x20reset\x20of\x20the\x20password\x20for\x20your\x20account.\x0a\x0a','Please\x20click\x20on\x20the\x20following\x20link,\x20or\x20paste\x20this\x20into\x20your\x20browser\x20to\x20complete\x20the\x20process:\x0a\x0a','headers','/reset/','Reset\x20Email\x20sent!','reset','params','token','now','securePassword','enforcePasswordHistory','previousPasswords','resetPasswordToken','resetPasswordExpires','Password\x20reset!','use','util','passport','passport-local','Strategy','jayson/promise','lodash','randomstring','../../mysqldb','../../components/auth/service','client','http','allowedLoginAttempts','blockDuration','then','findOne','password','role','disabled','blocked','blockedAt','admin','user','agent','name','authenticate','Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'];(function(_0x4bea82,_0x3e54a6){var _0x39dd76=function(_0x331d00){while(--_0x331d00){_0x4bea82['push'](_0x4bea82['shift']());}};_0x39dd76(++_0x3e54a6);}(_0x48e4,0x126));var _0x448e=function(_0x5f53d5,_0x317b0f){_0x5f53d5=_0x5f53d5-0x0;var _0x5749cc=_0x48e4[_0x5f53d5];return _0x5749cc;};'use strict';var util=require(_0x448e('0x0'));var passport=require(_0x448e('0x1'));var LocalStrategy=require(_0x448e('0x2'))[_0x448e('0x3')];var jayson=require(_0x448e('0x4'));var _=require(_0x448e('0x5'));var rs=require(_0x448e('0x6'));var moment=require('moment');var db=require(_0x448e('0x7'))['db'];var authService=require(_0x448e('0x8'));var utils=require('../../config/utils');var client=jayson[_0x448e('0x9')][_0x448e('0xa')]({'port':0x232b});function localAuthenticate(_0xbd24d4,_0x374c23,_0x372df5,_0x43d96f){var _0x45ac8e,_0x1a3538;return db['Setting']['findOne']({'where':{'id':0x1},'attributes':[_0x448e('0xb'),_0x448e('0xc')],'raw':!![]})[_0x448e('0xd')](function(_0x138e65){_0x45ac8e=_0x138e65;return _0xbd24d4[_0x448e('0xe')]({'attributes':['id','name',_0x448e('0xf'),'salt',_0x448e('0x10'),_0x448e('0x11'),_0x448e('0x12'),_0x448e('0x13'),'loginAttempts'],'where':{'name':_0x374c23,'role':{'$or':[_0x448e('0x14'),_0x448e('0x15'),_0x448e('0x16')]}}});})[_0x448e('0xd')](function(_0x576225){if(!_0x576225||_0x576225&&_0x576225[_0x448e('0x17')]!==_0x374c23){throw new Error('Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.');}else{_0x1a3538=_0x576225;return _0x1a3538;}})[_0x448e('0xd')](function(){_0x1a3538[_0x448e('0x18')](_0x372df5,function(_0x46f14b,_0x40e7ef){var _0x5a3039=_0x1a3538['loginAttempts']+0x1;if(_0x46f14b){return _0x43d96f(_0x46f14b);}else if(!_0x40e7ef){if(_0x1a3538[_0x448e('0x11')]){return _0x43d96f(null,![],{'message':_0x448e('0x19')});}else if(_0x45ac8e[_0x448e('0xb')]>0x0){if(_0x1a3538[_0x448e('0x12')]){if(_0x45ac8e[_0x448e('0xc')]>0x0){if(moment(_0x1a3538[_0x448e('0x13')])[_0x448e('0x1a')](_0x45ac8e['blockDuration'],'minutes')>moment()){return _0x43d96f(null,![],{'message':_0x448e('0x19')});}else{return utils[_0x448e('0x1b')](_0x1a3538,_0x5a3039,![],null)[_0x448e('0xd')](function(){return _0x43d96f(null,![],{'message':_0x448e('0x19')});});}}else{return _0x43d96f(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});}}else{if(_0x5a3039>=_0x45ac8e[_0x448e('0xb')]){return utils[_0x448e('0x1b')](_0x1a3538,0x0,!![],moment())[_0x448e('0xd')](function(){return _0x43d96f(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});});}else{return utils[_0x448e('0x1b')](_0x1a3538,_0x5a3039,![],null)[_0x448e('0xd')](function(){return _0x43d96f(null,![],{'message':_0x448e('0x19')});});}}}else{return _0x43d96f(null,![],{'message':_0x448e('0x19')});}}else{if(_0x1a3538[_0x448e('0x11')]){return _0x43d96f(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});}else if(_0x45ac8e[_0x448e('0xb')]>0x0){if(_0x1a3538[_0x448e('0x12')]){if(_0x45ac8e[_0x448e('0xc')]>0x0){if(moment(_0x1a3538[_0x448e('0x13')])[_0x448e('0x1a')](_0x45ac8e['blockDuration'],_0x448e('0x1c'))>moment()){return _0x43d96f(null,![],{'message':_0x448e('0x19')});}else{return utils[_0x448e('0x1b')](_0x1a3538,0x0,![],null)['then'](function(){return utils[_0x448e('0x1d')](_0x1a3538);})['then'](function(){return _0x43d96f(null,_0x1a3538);});}}else{return _0x43d96f(null,![],{'message':_0x448e('0x19')});}}else{return utils[_0x448e('0x1b')](_0x1a3538,0x0,![],null)[_0x448e('0xd')](function(){return utils[_0x448e('0x1d')](_0x1a3538);})[_0x448e('0xd')](function(){return _0x43d96f(null,_0x1a3538);})[_0x448e('0x1e')](function(_0xb83ea0){return _0x43d96f(null,![],_0xb83ea0);});}}else{if(_0x1a3538[_0x448e('0x12')]){return _0x43d96f(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});}else{return utils[_0x448e('0x1d')](_0x1a3538)['then'](function(){return _0x43d96f(null,_0x1a3538);});}}}});})[_0x448e('0x1e')](function(_0x9ea4d){return _0x43d96f(null,![],_0x9ea4d);});}function sendServiceMail(_0x84ce48){return db['MailAccount'][_0x448e('0x1f')]({'where':{'service':!![]},'attributes':['id','name',_0x448e('0x20')],'include':[{'model':db[_0x448e('0x21')],'as':_0x448e('0x22'),'include':[{'model':db[_0x448e('0x23')],'as':_0x448e('0x23')}]}]})['then'](function(_0x1fbfd8){if(!_0x1fbfd8){throw new Error(_0x448e('0x24'));}var _0x31a5ae=_0x1fbfd8[_0x448e('0x25')]();var _0x266255={'account':_0x31a5ae,'message':_[_0x448e('0x26')]({'from':util[_0x448e('0x27')](_0x448e('0x28'),_0x1fbfd8[_0x448e('0x17')],_0x1fbfd8[_0x448e('0x20')]||_0x1fbfd8[_0x448e('0x22')][_0x448e('0x15')])},_0x84ce48)};return client[_0x448e('0x29')]('SendMail',_0x266255);})[_0x448e('0xd')](function(_0x53114e){if(_0x53114e[_0x448e('0x2a')]){throw new Error(util[_0x448e('0x27')](_0x448e('0x2b'),_0x53114e[_0x448e('0x2a')][_0x448e('0x2c')]||JSON[_0x448e('0x2d')](_0x53114e[_0x448e('0x2a')])));}return!![];});}function handleError(_0x6aaaa6,_0x48f3ed,_0x475c98){return _0x6aaaa6['status'](_0x48f3ed||0x1f4)[_0x448e('0x2e')]({'message':_0x475c98?_0x475c98['message']||_0x475c98:''});}exports['login']=function(_0x17170f,_0x51c489,_0x48342b){passport[_0x448e('0x18')](_0x448e('0x2f'),function(_0x5ba985,_0xd5afd1,_0x4a4372){var _0x2052a4=_0x5ba985||_0x4a4372;if(_0x2052a4){return handleError(_0x51c489,0x191,_0x2052a4);}if(!_0xd5afd1){return handleError(_0x51c489,0x194,{'message':_0x448e('0x30')});}else{var _0xc91447={'payload':{'id':_0xd5afd1['id'],'role':_0xd5afd1[_0x448e('0x10')]},'options':{'expiresIn':0x15180}};return authService[_0x448e('0x31')](_0xc91447)[_0x448e('0xd')](function(_0x48b063){_0x51c489['json']({'id':_0xd5afd1['id'],'token':_0x48b063,'statusCall':'','isAlreadyLogged':_0xd5afd1[_0x448e('0x32')]});});}})(_0x17170f,_0x51c489,_0x48342b);};exports[_0x448e('0x33')]=function(_0x250988,_0x3fa6ed){if(!_0x250988['body'][_0x448e('0x20')]){return handleError(_0x3fa6ed,0x1f4,{'message':_0x448e('0x34')});}var _0x5333f9=rs[_0x448e('0x35')]();_0x250988[_0x448e('0x36')][_0x448e('0x20')]=_0x250988[_0x448e('0x36')][_0x448e('0x20')][_0x448e('0x37')]()[_0x448e('0x38')]();var _0x6ada55;return db[_0x448e('0x39')]['findOne']({'where':{'id':0x1},'attributes':[_0x448e('0xb'),_0x448e('0xc')],'raw':!![]})['then'](function(_0x2fc8f2){_0x6ada55=_0x2fc8f2;return db[_0x448e('0x3a')][_0x448e('0x1f')]({'where':{'email':_0x250988[_0x448e('0x36')][_0x448e('0x20')]}});})[_0x448e('0xd')](function(_0x366bd4){if(!_0x366bd4){throw new Error(_0x448e('0x3b'));}if(_0x366bd4['disabled']){throw new Error(_0x448e('0x3c'));}if(_0x366bd4[_0x448e('0x12')]){if(moment(_0x366bd4[_0x448e('0x13')])[_0x448e('0x1a')](_0x6ada55[_0x448e('0xc')],_0x448e('0x1c'))>moment()){throw new Error(_0x448e('0x3d'));}else{_0x366bd4[_0x448e('0x12')]=![];_0x366bd4['blockedAt']=null;}}_0x366bd4['resetPasswordToken']=_0x5333f9;_0x366bd4['resetPasswordExpires']=Date['now']()+0x36ee80;return _0x366bd4[_0x448e('0x3e')]();})[_0x448e('0xd')](function(){return sendServiceMail({'to':_0x250988[_0x448e('0x36')][_0x448e('0x20')],'subject':_0x448e('0x3f'),'text':_0x448e('0x40')+_0x448e('0x41')+'https://'+_0x250988[_0x448e('0x42')]['host']+_0x448e('0x43')+_0x5333f9+'\x0a\x0a'+'If\x20you\x20did\x20not\x20request\x20this,\x20please\x20ignore\x20this\x20email\x20and\x20your\x20password\x20will\x20remain\x20unchanged.\x0a'});})[_0x448e('0xd')](function(){_0x3fa6ed['status'](0xc8)['send']({'message':_0x448e('0x44')});})[_0x448e('0x1e')](function(_0x418140){return handleError(_0x3fa6ed,0x1f4,_0x418140);});};exports[_0x448e('0x45')]=function(_0x46ad64,_0x5df23e){return db[_0x448e('0x3a')][_0x448e('0x1f')]({'where':{'resetPasswordToken':_0x46ad64[_0x448e('0x46')][_0x448e('0x47')],'resetPasswordExpires':{'$gt':Date[_0x448e('0x48')]()}}})[_0x448e('0xd')](function(_0x509648){if(!_0x509648){throw new Error('Password\x20reset\x20token\x20is\x20invalid\x20or\x20has\x20expired.');}return db[_0x448e('0x39')][_0x448e('0xe')]({'attributes':['id',_0x448e('0x49'),_0x448e('0x4a'),'passwordHistoryLimit']})[_0x448e('0xd')](function(_0x13d493){if(_0x13d493[_0x448e('0x49')])authService['validatePasswordPattern'](_0x46ad64[_0x448e('0x36')][_0x448e('0xf')]);if(!_0x13d493[_0x448e('0x4a')]||!_0x509648[_0x448e('0x4b')])return _0x509648;authService['validatePasswordHistory'](_0x46ad64[_0x448e('0x36')][_0x448e('0xf')],_0x509648[_0x448e('0x4b')],_0x13d493['passwordHistoryLimit']);return _0x509648;})[_0x448e('0xd')](function(){_0x509648['password']=_0x46ad64['body'][_0x448e('0xf')];_0x509648[_0x448e('0x4c')]=null;_0x509648[_0x448e('0x4d')]=null;return _0x509648['save']();});})[_0x448e('0xd')](function(){_0x5df23e['status'](0xc8)[_0x448e('0x2e')]({'message':_0x448e('0x4e')});})[_0x448e('0x1e')](function(_0x2d0a7c){return handleError(_0x5df23e,0x1f4,_0x2d0a7c);});};passport[_0x448e('0x4f')](_0x448e('0x2f'),new LocalStrategy({'usernameField':_0x448e('0x17'),'passwordField':_0x448e('0xf')},function(_0x278657,_0x261b00,_0x109338){return localAuthenticate(db['User'],_0x278657,_0x261b00,_0x109338);}));
\ No newline at end of file
+var _0x01f1=['catch','MailAccount','find','email','MailServerOut','Smtp','getSmtpOptions','merge','\x22%s\x22\x20<%s>','SendMail','error','format','message','stringify','status','send','login','authenticate','Something\x20went\x20wrong,\x20please\x20try\x20again.','role','signToken','online','body','Email\x20parameter\x20is\x20missing','generate','trim','toLowerCase','User','The\x20user\x20is\x20disabled.\x20Please\x20contact\x20the\x20administrator.','add','resetPasswordToken','save','xCally\x20Motion\x20Password\x20Reset','You\x20are\x20receiving\x20this\x20because\x20you\x20(or\x20someone\x20else)\x20have\x20requested\x20the\x20reset\x20of\x20the\x20password\x20for\x20your\x20account.\x0a\x0a','https://','headers','host','If\x20you\x20did\x20not\x20request\x20this,\x20please\x20ignore\x20this\x20email\x20and\x20your\x20password\x20will\x20remain\x20unchanged.\x0a','reset','params','token','securePassword','enforcePasswordHistory','previousPasswords','validatePasswordHistory','resetPasswordExpires','use','local-login','util','passport','passport-local','jayson/promise','randomstring','moment','../../mysqldb','../../components/auth/service','http','Setting','findOne','allowedLoginAttempts','name','password','salt','blocked','blockedAt','loginAttempts','admin','agent','then','Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.','disabled','blockDuration','minutes','clearBlockUser','getLicense'];(function(_0x389ec3,_0x341011){var _0x2da23e=function(_0x14edc8){while(--_0x14edc8){_0x389ec3['push'](_0x389ec3['shift']());}};_0x2da23e(++_0x341011);}(_0x01f1,0x111));var _0x101f=function(_0x3b76f7,_0x566c53){_0x3b76f7=_0x3b76f7-0x0;var _0x43984e=_0x01f1[_0x3b76f7];return _0x43984e;};'use strict';var util=require(_0x101f('0x0'));var passport=require(_0x101f('0x1'));var LocalStrategy=require(_0x101f('0x2'))['Strategy'];var jayson=require(_0x101f('0x3'));var _=require('lodash');var rs=require(_0x101f('0x4'));var moment=require(_0x101f('0x5'));var db=require(_0x101f('0x6'))['db'];var authService=require(_0x101f('0x7'));var utils=require('../../config/utils');var client=jayson['client'][_0x101f('0x8')]({'port':0x232b});function localAuthenticate(_0x2a8ee0,_0x3db6f6,_0x5a34ba,_0x44338b){var _0x5f3770,_0x859b1f;return db[_0x101f('0x9')][_0x101f('0xa')]({'where':{'id':0x1},'attributes':[_0x101f('0xb'),'blockDuration'],'raw':!![]})['then'](function(_0x485d28){_0x5f3770=_0x485d28;return _0x2a8ee0[_0x101f('0xa')]({'attributes':['id',_0x101f('0xc'),_0x101f('0xd'),_0x101f('0xe'),'role','disabled',_0x101f('0xf'),_0x101f('0x10'),_0x101f('0x11')],'where':{'name':_0x3db6f6,'role':{'$or':[_0x101f('0x12'),'user',_0x101f('0x13')]}}});})[_0x101f('0x14')](function(_0x3c2479){if(!_0x3c2479||_0x3c2479&&_0x3c2479[_0x101f('0xc')]!==_0x3db6f6){throw new Error(_0x101f('0x15'));}else{_0x859b1f=_0x3c2479;return _0x859b1f;}})[_0x101f('0x14')](function(){_0x859b1f['authenticate'](_0x5a34ba,function(_0x4f84f9,_0x10938c){var _0x45a172=_0x859b1f[_0x101f('0x11')]+0x1;if(_0x4f84f9){return _0x44338b(_0x4f84f9);}else if(!_0x10938c){if(_0x859b1f[_0x101f('0x16')]){return _0x44338b(null,![],{'message':_0x101f('0x15')});}else if(_0x5f3770['allowedLoginAttempts']>0x0){if(_0x859b1f[_0x101f('0xf')]){if(_0x5f3770[_0x101f('0x17')]>0x0){if(moment(_0x859b1f[_0x101f('0x10')])['add'](_0x5f3770[_0x101f('0x17')],_0x101f('0x18'))>moment()){return _0x44338b(null,![],{'message':_0x101f('0x15')});}else{return utils[_0x101f('0x19')](_0x859b1f,_0x45a172,![],null)[_0x101f('0x14')](function(){return _0x44338b(null,![],{'message':_0x101f('0x15')});});}}else{return _0x44338b(null,![],{'message':_0x101f('0x15')});}}else{if(_0x45a172>=_0x5f3770['allowedLoginAttempts']){return utils[_0x101f('0x19')](_0x859b1f,0x0,!![],moment())[_0x101f('0x14')](function(){return _0x44338b(null,![],{'message':_0x101f('0x15')});});}else{return utils[_0x101f('0x19')](_0x859b1f,_0x45a172,![],null)['then'](function(){return _0x44338b(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});});}}}else{return _0x44338b(null,![],{'message':_0x101f('0x15')});}}else{if(_0x859b1f[_0x101f('0x16')]){return _0x44338b(null,![],{'message':_0x101f('0x15')});}else if(_0x5f3770['allowedLoginAttempts']>0x0){if(_0x859b1f[_0x101f('0xf')]){if(_0x5f3770[_0x101f('0x17')]>0x0){if(moment(_0x859b1f['blockedAt'])['add'](_0x5f3770[_0x101f('0x17')],_0x101f('0x18'))>moment()){return _0x44338b(null,![],{'message':_0x101f('0x15')});}else{return utils[_0x101f('0x19')](_0x859b1f,0x0,![],null)[_0x101f('0x14')](function(){return utils[_0x101f('0x1a')](_0x859b1f);})['then'](function(){return _0x44338b(null,_0x859b1f);});}}else{return _0x44338b(null,![],{'message':_0x101f('0x15')});}}else{return utils[_0x101f('0x19')](_0x859b1f,0x0,![],null)[_0x101f('0x14')](function(){return utils[_0x101f('0x1a')](_0x859b1f);})[_0x101f('0x14')](function(){return _0x44338b(null,_0x859b1f);})['catch'](function(_0x4da7db){return _0x44338b(null,![],_0x4da7db);});}}else{if(_0x859b1f['blocked']){return _0x44338b(null,![],{'message':_0x101f('0x15')});}else{return utils[_0x101f('0x1a')](_0x859b1f)[_0x101f('0x14')](function(){return _0x44338b(null,_0x859b1f);});}}}});})[_0x101f('0x1b')](function(_0x3b21d2){return _0x44338b(null,![],_0x3b21d2);});}function sendServiceMail(_0x5b55bd){return db[_0x101f('0x1c')][_0x101f('0x1d')]({'where':{'service':!![]},'attributes':['id',_0x101f('0xc'),_0x101f('0x1e')],'include':[{'model':db[_0x101f('0x1f')],'as':_0x101f('0x20'),'include':[{'model':db['CloudProvider'],'as':'CloudProvider'}]}]})[_0x101f('0x14')](function(_0x1ccf6a){if(!_0x1ccf6a){throw new Error('Unable\x20to\x20find\x20a\x20configured\x20SMTP\x20service!');}var _0x5c824f=_0x1ccf6a[_0x101f('0x21')]();var _0x4f81d2={'account':_0x5c824f,'message':_[_0x101f('0x22')]({'from':util['format'](_0x101f('0x23'),_0x1ccf6a[_0x101f('0xc')],_0x1ccf6a[_0x101f('0x1e')]||_0x1ccf6a['Smtp']['user'])},_0x5b55bd)};return client['request'](_0x101f('0x24'),_0x4f81d2);})[_0x101f('0x14')](function(_0x43c2fe){if(_0x43c2fe[_0x101f('0x25')]){throw new Error(util[_0x101f('0x26')]('SendMail\x20error:\x20%s.\x20Please\x20contact\x20your\x20Administrator!',_0x43c2fe['error'][_0x101f('0x27')]||JSON[_0x101f('0x28')](_0x43c2fe[_0x101f('0x25')])));}return!![];});}function handleError(_0x3ead58,_0x241fb1,_0x1229a1){return _0x3ead58[_0x101f('0x29')](_0x241fb1||0x1f4)[_0x101f('0x2a')]({'message':_0x1229a1?_0x1229a1[_0x101f('0x27')]||_0x1229a1:''});}exports[_0x101f('0x2b')]=function(_0x1e167f,_0x1b6866,_0x17189c){passport[_0x101f('0x2c')]('local-login',function(_0x379777,_0x16029e,_0x47b7f5){var _0x4e7288=_0x379777||_0x47b7f5;if(_0x4e7288){return handleError(_0x1b6866,0x191,_0x4e7288);}if(!_0x16029e){return handleError(_0x1b6866,0x194,{'message':_0x101f('0x2d')});}else{var _0x59cf03={'payload':{'id':_0x16029e['id'],'role':_0x16029e[_0x101f('0x2e')]},'options':{'expiresIn':0x15180}};return authService[_0x101f('0x2f')](_0x59cf03)[_0x101f('0x14')](function(_0x27d39f){_0x1b6866['json']({'id':_0x16029e['id'],'token':_0x27d39f,'statusCall':'','isAlreadyLogged':_0x16029e[_0x101f('0x30')]});});}})(_0x1e167f,_0x1b6866,_0x17189c);};exports['forgot']=function(_0x5b3849,_0x5a26a8){if(!_0x5b3849[_0x101f('0x31')]['email']){return handleError(_0x5a26a8,0x1f4,{'message':_0x101f('0x32')});}var _0x105193=rs[_0x101f('0x33')]();_0x5b3849[_0x101f('0x31')][_0x101f('0x1e')]=_0x5b3849[_0x101f('0x31')][_0x101f('0x1e')][_0x101f('0x34')]()[_0x101f('0x35')]();var _0x65d6a0;return db[_0x101f('0x9')][_0x101f('0xa')]({'where':{'id':0x1},'attributes':[_0x101f('0xb'),'blockDuration'],'raw':!![]})[_0x101f('0x14')](function(_0x51e363){_0x65d6a0=_0x51e363;return db[_0x101f('0x36')][_0x101f('0x1d')]({'where':{'email':_0x5b3849[_0x101f('0x31')]['email']}});})[_0x101f('0x14')](function(_0x24fe96){if(!_0x24fe96){throw new Error('This\x20email\x20is\x20not\x20registered.');}if(_0x24fe96[_0x101f('0x16')]){throw new Error(_0x101f('0x37'));}if(_0x24fe96[_0x101f('0xf')]){if(moment(_0x24fe96[_0x101f('0x10')])[_0x101f('0x38')](_0x65d6a0[_0x101f('0x17')],_0x101f('0x18'))>moment()){throw new Error('The\x20user\x20is\x20blocked.\x20Please\x20contact\x20the\x20administrator.');}else{_0x24fe96[_0x101f('0xf')]=![];_0x24fe96[_0x101f('0x10')]=null;}}_0x24fe96[_0x101f('0x39')]=_0x105193;_0x24fe96['resetPasswordExpires']=Date['now']()+0x36ee80;return _0x24fe96[_0x101f('0x3a')]();})[_0x101f('0x14')](function(){return sendServiceMail({'to':_0x5b3849[_0x101f('0x31')]['email'],'subject':_0x101f('0x3b'),'text':_0x101f('0x3c')+'Please\x20click\x20on\x20the\x20following\x20link,\x20or\x20paste\x20this\x20into\x20your\x20browser\x20to\x20complete\x20the\x20process:\x0a\x0a'+_0x101f('0x3d')+_0x5b3849[_0x101f('0x3e')][_0x101f('0x3f')]+'/reset/'+_0x105193+'\x0a\x0a'+_0x101f('0x40')});})['then'](function(){_0x5a26a8[_0x101f('0x29')](0xc8)[_0x101f('0x2a')]({'message':'Reset\x20Email\x20sent!'});})[_0x101f('0x1b')](function(_0x482dcd){return handleError(_0x5a26a8,0x1f4,_0x482dcd);});};exports[_0x101f('0x41')]=function(_0x4e4698,_0x23c9d8){return db[_0x101f('0x36')][_0x101f('0x1d')]({'where':{'resetPasswordToken':_0x4e4698[_0x101f('0x42')][_0x101f('0x43')],'resetPasswordExpires':{'$gt':Date['now']()}}})[_0x101f('0x14')](function(_0x490c0f){if(!_0x490c0f){throw new Error('Password\x20reset\x20token\x20is\x20invalid\x20or\x20has\x20expired.');}return db[_0x101f('0x9')][_0x101f('0xa')]({'attributes':['id',_0x101f('0x44'),_0x101f('0x45'),'passwordHistoryLimit']})['then'](function(_0x21b91c){if(_0x21b91c[_0x101f('0x44')])authService['validatePasswordPattern'](_0x4e4698[_0x101f('0x31')][_0x101f('0xd')]);if(!_0x21b91c[_0x101f('0x45')]||!_0x490c0f[_0x101f('0x46')])return _0x490c0f;authService[_0x101f('0x47')](_0x4e4698['body'][_0x101f('0xd')],_0x490c0f[_0x101f('0x46')],_0x21b91c['passwordHistoryLimit']);return _0x490c0f;})['then'](function(){_0x490c0f[_0x101f('0xd')]=_0x4e4698[_0x101f('0x31')][_0x101f('0xd')];_0x490c0f['resetPasswordToken']=null;_0x490c0f[_0x101f('0x48')]=null;return _0x490c0f[_0x101f('0x3a')]();});})[_0x101f('0x14')](function(){_0x23c9d8[_0x101f('0x29')](0xc8)[_0x101f('0x2a')]({'message':'Password\x20reset!'});})['catch'](function(_0x596053){return handleError(_0x23c9d8,0x1f4,_0x596053);});};passport[_0x101f('0x49')](_0x101f('0x4a'),new LocalStrategy({'usernameField':_0x101f('0xc'),'passwordField':_0x101f('0xd')},function(_0x34e8a0,_0x12bf97,_0x5359df){return localAuthenticate(db[_0x101f('0x36')],_0x34e8a0,_0x12bf97,_0x5359df);}));
\ No newline at end of file
diff --git a/server/api/authLocal/index.js b/server/api/authLocal/index.js
index 4e600fb..9f86a4b 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 _0x35ac=['./authLocal.controller','post','login','/forgot','forgot','/reset/:token','reset','exports','Router'];(function(_0x2febd4,_0x28a82d){var _0x3c9b77=function(_0x1412c8){while(--_0x1412c8){_0x2febd4['push'](_0x2febd4['shift']());}};_0x3c9b77(++_0x28a82d);}(_0x35ac,0x167));var _0xc35a=function(_0x30deed,_0x1825f0){_0x30deed=_0x30deed-0x0;var _0x217863=_0x35ac[_0x30deed];return _0x217863;};'use strict';var express=require('express');var router=express[_0xc35a('0x0')]();var controller=require(_0xc35a('0x1'));router[_0xc35a('0x2')]('/',controller[_0xc35a('0x3')]);router['post'](_0xc35a('0x4'),controller[_0xc35a('0x5')]);router[_0xc35a('0x2')](_0xc35a('0x6'),controller[_0xc35a('0x7')]);module[_0xc35a('0x8')]=router;
\ No newline at end of file
+var _0x5e1d=['post','login','/forgot','forgot','/reset/:token','reset','exports','express','Router'];(function(_0x282731,_0x4dc6b6){var _0x53c281=function(_0x48d343){while(--_0x48d343){_0x282731['push'](_0x282731['shift']());}};_0x53c281(++_0x4dc6b6);}(_0x5e1d,0xf1));var _0xd5e1=function(_0x4283c0,_0xc694d5){_0x4283c0=_0x4283c0-0x0;var _0x6b47ab=_0x5e1d[_0x4283c0];return _0x6b47ab;};'use strict';var express=require(_0xd5e1('0x0'));var router=express[_0xd5e1('0x1')]();var controller=require('./authLocal.controller');router[_0xd5e1('0x2')]('/',controller[_0xd5e1('0x3')]);router[_0xd5e1('0x2')](_0xd5e1('0x4'),controller[_0xd5e1('0x5')]);router[_0xd5e1('0x2')](_0xd5e1('0x6'),controller[_0xd5e1('0x7')]);module[_0xd5e1('0x8')]=router;
\ No newline at end of file
diff --git a/server/api/automation/automation.attributes.js b/server/api/automation/automation.attributes.js
index 456d260..b819448 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 _0xc7b7=['STRING','BOOLEAN','sequelize','exports'];(function(_0xc36fe1,_0x4e8695){var _0x48ce2a=function(_0x59d307){while(--_0x59d307){_0xc36fe1['push'](_0xc36fe1['shift']());}};_0x48ce2a(++_0x4e8695);}(_0xc7b7,0x6a));var _0x7c7b=function(_0x28111f,_0x254934){_0x28111f=_0x28111f-0x0;var _0x5203e6=_0xc7b7[_0x28111f];return _0x5203e6;};'use strict';var Sequelize=require(_0x7c7b('0x0'));module[_0x7c7b('0x1')]={'name':{'type':Sequelize['STRING'],'allowNull':![]},'channel':{'type':Sequelize[_0x7c7b('0x2')]},'description':{'type':Sequelize['STRING']},'status':{'type':Sequelize[_0x7c7b('0x3')],'defaultValue':![]},'timeout':{'type':Sequelize['INTEGER'],'defaultValue':0xa}};
\ No newline at end of file
+var _0xabdb=['sequelize','STRING','BOOLEAN','INTEGER'];(function(_0x2b4411,_0x2625ed){var _0x8e41ef=function(_0x2aa8c1){while(--_0x2aa8c1){_0x2b4411['push'](_0x2b4411['shift']());}};_0x8e41ef(++_0x2625ed);}(_0xabdb,0x14c));var _0xbabd=function(_0x3e19ef,_0x3ebb39){_0x3e19ef=_0x3e19ef-0x0;var _0xc087e7=_0xabdb[_0x3e19ef];return _0xc087e7;};'use strict';var Sequelize=require(_0xbabd('0x0'));module['exports']={'name':{'type':Sequelize[_0xbabd('0x1')],'allowNull':![]},'channel':{'type':Sequelize[_0xbabd('0x1')]},'description':{'type':Sequelize[_0xbabd('0x1')]},'status':{'type':Sequelize[_0xbabd('0x2')],'defaultValue':![]},'timeout':{'type':Sequelize[_0xbabd('0x3')],'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 be5941f..b8e4517 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 _0x9e6e=['set','apply','save','update','then','destroy','end','sendStatus','error','stack','name','send','map','Automation','rawAttributes','fieldName','type','key','model','keys','query','filters','intersection','attributes','fields','length','nolimit','order','where','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','find','catch','create','body','params','addConditions','Condition','ids','getConditions','sort','hasOwnProperty','Action','omit','getActions','findOne','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','sox','to-csv','ejs','fs-extra','squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/parsers/qs','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','status','json','undefined','limit','count','offset'];(function(_0x5de214,_0x107e9d){var _0x4df627=function(_0x4199e1){while(--_0x4199e1){_0x5de214['push'](_0x5de214['shift']());}};_0x4df627(++_0x107e9d);}(_0x9e6e,0x12e));var _0xe9e6=function(_0x479dfd,_0x47ff77){_0x479dfd=_0x479dfd-0x0;var _0x5b82b4=_0x9e6e[_0x479dfd];return _0x5b82b4;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xe9e6('0x0'));var zipdir=require(_0xe9e6('0x1'));var jsonpatch=require(_0xe9e6('0x2'));var rp=require(_0xe9e6('0x3'));var moment=require(_0xe9e6('0x4'));var BPromise=require('bluebird');var Mustache=require(_0xe9e6('0x5'));var util=require(_0xe9e6('0x6'));var path=require(_0xe9e6('0x7'));var sox=require(_0xe9e6('0x8'));var csv=require(_0xe9e6('0x9'));var ejs=require(_0xe9e6('0xa'));var fs=require('fs');var fs_extra=require(_0xe9e6('0xb'));var _=require('lodash');var squel=require(_0xe9e6('0xc'));var crypto=require(_0xe9e6('0xd'));var jsforce=require(_0xe9e6('0xe'));var deskjs=require(_0xe9e6('0xf'));var toCsv=require('to-csv');var querystring=require(_0xe9e6('0x10'));var Papa=require('papaparse');var Redis=require(_0xe9e6('0x11'));var authService=require('../../components/auth/service');var qs=require(_0xe9e6('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0xe9e6('0x13'))(_0xe9e6('0x14'));var utils=require('../../config/utils');var config=require(_0xe9e6('0x15'));var licenseUtil=require(_0xe9e6('0x16'));var db=require(_0xe9e6('0x17'))['db'];function respondWithStatusCode(_0x4c4671,_0x3a2af7){_0x3a2af7=_0x3a2af7||0xcc;return function(_0x52bfaf){if(_0x52bfaf){return _0x4c4671['sendStatus'](_0x3a2af7);}return _0x4c4671[_0xe9e6('0x18')](_0x3a2af7)['end']();};}function respondWithResult(_0x5bfe18,_0x2d34ea){_0x2d34ea=_0x2d34ea||0xc8;return function(_0x116967){if(_0x116967){return _0x5bfe18[_0xe9e6('0x18')](_0x2d34ea)[_0xe9e6('0x19')](_0x116967);}};}function respondWithFilteredResult(_0x2ca322,_0x28cea7){return function(_0x491e56){if(_0x491e56){var _0x14a56d=typeof _0x28cea7['offset']===_0xe9e6('0x1a')&&typeof _0x28cea7[_0xe9e6('0x1b')]==='undefined';var _0x104d7c=_0x491e56[_0xe9e6('0x1c')];var _0x34bfc4=_0x14a56d?0x0:_0x28cea7[_0xe9e6('0x1d')];var _0x5874c1=_0x14a56d?_0x491e56[_0xe9e6('0x1c')]:_0x28cea7[_0xe9e6('0x1d')]+_0x28cea7[_0xe9e6('0x1b')];var _0x173c26;if(_0x5874c1>=_0x104d7c){_0x5874c1=_0x104d7c;_0x173c26=0xc8;}else{_0x173c26=0xce;}_0x2ca322[_0xe9e6('0x18')](_0x173c26);return _0x2ca322[_0xe9e6('0x1e')]('Content-Range',_0x34bfc4+'-'+_0x5874c1+'/'+_0x104d7c)['json'](_0x491e56);}return null;};}function patchUpdates(_0xd69fa6){return function(_0x1e7160){try{jsonpatch[_0xe9e6('0x1f')](_0x1e7160,_0xd69fa6,!![]);}catch(_0x176b2c){return BPromise['reject'](_0x176b2c);}return _0x1e7160[_0xe9e6('0x20')]();};}function saveUpdates(_0x45dd61,_0x2b5ea5){return function(_0x19a179){if(_0x19a179){return _0x19a179[_0xe9e6('0x21')](_0x45dd61)[_0xe9e6('0x22')](function(_0x59a29d){return _0x59a29d;});}return null;};}function removeEntity(_0x26a47f,_0x494639){return function(_0x3b5e36){if(_0x3b5e36){return _0x3b5e36[_0xe9e6('0x23')]()[_0xe9e6('0x22')](function(){_0x26a47f[_0xe9e6('0x18')](0xcc)[_0xe9e6('0x24')]();});}};}function handleEntityNotFound(_0x207b43,_0x565e63){return function(_0x274cc5){if(!_0x274cc5){_0x207b43[_0xe9e6('0x25')](0x194);}return _0x274cc5;};}function handleError(_0x97217,_0x223e84){_0x223e84=_0x223e84||0x1f4;return function(_0x22e7f3){logger[_0xe9e6('0x26')](_0x22e7f3[_0xe9e6('0x27')]);if(_0x22e7f3[_0xe9e6('0x28')]){delete _0x22e7f3[_0xe9e6('0x28')];}_0x97217['status'](_0x223e84)[_0xe9e6('0x29')](_0x22e7f3);};}exports['index']=function(_0x35cffd,_0x2ae056){var _0x5ac634={},_0x45848c={},_0x1ce18b={'count':0x0,'rows':[]};var _0x1e6560=_[_0xe9e6('0x2a')](db[_0xe9e6('0x2b')][_0xe9e6('0x2c')],function(_0x4f150b){return{'name':_0x4f150b[_0xe9e6('0x2d')],'type':_0x4f150b[_0xe9e6('0x2e')][_0xe9e6('0x2f')]};});_0x45848c[_0xe9e6('0x30')]=_['map'](_0x1e6560,_0xe9e6('0x28'));_0x45848c['query']=_[_0xe9e6('0x31')](_0x35cffd[_0xe9e6('0x32')]);_0x45848c[_0xe9e6('0x33')]=_[_0xe9e6('0x34')](_0x45848c[_0xe9e6('0x30')],_0x45848c[_0xe9e6('0x32')]);_0x5ac634[_0xe9e6('0x35')]=_['intersection'](_0x45848c[_0xe9e6('0x30')],qs[_0xe9e6('0x36')](_0x35cffd[_0xe9e6('0x32')]['fields']));_0x5ac634[_0xe9e6('0x35')]=_0x5ac634[_0xe9e6('0x35')][_0xe9e6('0x37')]?_0x5ac634[_0xe9e6('0x35')]:_0x45848c[_0xe9e6('0x30')];if(!_0x35cffd[_0xe9e6('0x32')]['hasOwnProperty'](_0xe9e6('0x38'))){_0x5ac634[_0xe9e6('0x1b')]=qs[_0xe9e6('0x1b')](_0x35cffd[_0xe9e6('0x32')][_0xe9e6('0x1b')]);_0x5ac634[_0xe9e6('0x1d')]=qs[_0xe9e6('0x1d')](_0x35cffd[_0xe9e6('0x32')][_0xe9e6('0x1d')]);}_0x5ac634[_0xe9e6('0x39')]=qs['sort'](_0x35cffd[_0xe9e6('0x32')]['sort']);_0x5ac634[_0xe9e6('0x3a')]=qs[_0xe9e6('0x33')](_[_0xe9e6('0x3b')](_0x35cffd[_0xe9e6('0x32')],_0x45848c[_0xe9e6('0x33')]),_0x1e6560);if(_0x35cffd[_0xe9e6('0x32')][_0xe9e6('0x3c')]){_0x5ac634[_0xe9e6('0x3a')]=_[_0xe9e6('0x3d')](_0x5ac634['where'],{'$or':_[_0xe9e6('0x2a')](_0x1e6560,function(_0x29eb40){if(_0x29eb40[_0xe9e6('0x2e')]!==_0xe9e6('0x3e')){var _0x5b2bbf={};_0x5b2bbf[_0x29eb40[_0xe9e6('0x28')]]={'$like':'%'+_0x35cffd['query']['filter']+'%'};return _0x5b2bbf;}})});}_0x5ac634=_[_0xe9e6('0x3d')]({},_0x5ac634,_0x35cffd[_0xe9e6('0x3f')]);var _0xcff5bd={'where':_0x5ac634[_0xe9e6('0x3a')]};return db[_0xe9e6('0x2b')]['count'](_0xcff5bd)['then'](function(_0x3d13fb){_0x1ce18b[_0xe9e6('0x1c')]=_0x3d13fb;if(_0x35cffd[_0xe9e6('0x32')][_0xe9e6('0x40')]){_0x5ac634[_0xe9e6('0x41')]=[{'all':!![]}];}return db[_0xe9e6('0x2b')][_0xe9e6('0x42')](_0x5ac634);})[_0xe9e6('0x22')](function(_0x1ecbe0){_0x1ce18b[_0xe9e6('0x43')]=_0x1ecbe0;return _0x1ce18b;})['then'](respondWithFilteredResult(_0x2ae056,_0x5ac634))['catch'](handleError(_0x2ae056,null));};exports['show']=function(_0x2a66d6,_0x30457f){var _0x52796c={'raw':![],'where':{'id':_0x2a66d6['params']['id']}},_0x242323={};_0x242323[_0xe9e6('0x30')]=_[_0xe9e6('0x31')](db[_0xe9e6('0x2b')]['rawAttributes']);_0x242323[_0xe9e6('0x32')]=_[_0xe9e6('0x31')](_0x2a66d6['query']);_0x242323[_0xe9e6('0x33')]=_['intersection'](_0x242323[_0xe9e6('0x30')],_0x242323[_0xe9e6('0x32')]);_0x52796c[_0xe9e6('0x35')]=_[_0xe9e6('0x34')](_0x242323[_0xe9e6('0x30')],qs[_0xe9e6('0x36')](_0x2a66d6[_0xe9e6('0x32')][_0xe9e6('0x36')]));_0x52796c[_0xe9e6('0x35')]=_0x52796c[_0xe9e6('0x35')][_0xe9e6('0x37')]?_0x52796c[_0xe9e6('0x35')]:_0x242323[_0xe9e6('0x30')];if(_0x2a66d6['query'][_0xe9e6('0x40')]){_0x52796c['include']=[{'all':!![]}];}_0x52796c=_['merge']({},_0x52796c,_0x2a66d6['options']);return db[_0xe9e6('0x2b')][_0xe9e6('0x44')](_0x52796c)[_0xe9e6('0x22')](handleEntityNotFound(_0x30457f,null))[_0xe9e6('0x22')](respondWithResult(_0x30457f,null))[_0xe9e6('0x45')](handleError(_0x30457f,null));};exports[_0xe9e6('0x46')]=function(_0x465c79,_0x3e8c7d){return db[_0xe9e6('0x2b')][_0xe9e6('0x46')](_0x465c79[_0xe9e6('0x47')],{})[_0xe9e6('0x22')](respondWithResult(_0x3e8c7d,0xc9))[_0xe9e6('0x45')](handleError(_0x3e8c7d,null));};exports[_0xe9e6('0x21')]=function(_0x4cae64,_0x309cca){if(_0x4cae64[_0xe9e6('0x47')]['id']){delete _0x4cae64['body']['id'];}return db['Automation']['find']({'where':{'id':_0x4cae64['params']['id']}})[_0xe9e6('0x22')](handleEntityNotFound(_0x309cca,null))[_0xe9e6('0x22')](saveUpdates(_0x4cae64[_0xe9e6('0x47')],null))[_0xe9e6('0x22')](respondWithResult(_0x309cca,null))[_0xe9e6('0x45')](handleError(_0x309cca,null));};exports[_0xe9e6('0x23')]=function(_0x165b43,_0x197fdc){return db[_0xe9e6('0x2b')][_0xe9e6('0x44')]({'where':{'id':_0x165b43[_0xe9e6('0x48')]['id']}})['then'](handleEntityNotFound(_0x197fdc,null))['then'](removeEntity(_0x197fdc,null))[_0xe9e6('0x45')](handleError(_0x197fdc,null));};exports[_0xe9e6('0x49')]=function(_0x271075,_0x2741e0,_0x3a4b6f){return db[_0xe9e6('0x4a')][_0xe9e6('0x44')]({'where':{'id':_0x271075[_0xe9e6('0x48')]['id']}})[_0xe9e6('0x22')](handleEntityNotFound(_0x2741e0,null))[_0xe9e6('0x22')](function(_0x3d6197){if(_0x3d6197){return _0x3d6197[_0xe9e6('0x49')](_0x271075[_0xe9e6('0x47')][_0xe9e6('0x4b')],_['omit'](_0x271075['body'],[_0xe9e6('0x4b'),'id'])||{});}})[_0xe9e6('0x22')](respondWithResult(_0x2741e0,null))['catch'](handleError(_0x2741e0,null));};exports[_0xe9e6('0x4c')]=function(_0x511309,_0x183af5,_0x2a9fc2){var _0x59e49f={};var _0x50d9ca={};var _0x547d9e;var _0x4d8da6;return db[_0xe9e6('0x2b')]['findOne']({'where':{'id':_0x511309[_0xe9e6('0x48')]['id']}})[_0xe9e6('0x22')](handleEntityNotFound(_0x183af5,null))['then'](function(_0x305ecc){if(_0x305ecc){_0x547d9e=_0x305ecc;_0x50d9ca[_0xe9e6('0x30')]=_[_0xe9e6('0x31')](db[_0xe9e6('0x4a')][_0xe9e6('0x2c')]);_0x50d9ca[_0xe9e6('0x32')]=_[_0xe9e6('0x31')](_0x511309[_0xe9e6('0x32')]);_0x50d9ca['filters']=_[_0xe9e6('0x34')](_0x50d9ca[_0xe9e6('0x30')],_0x50d9ca[_0xe9e6('0x32')]);_0x59e49f[_0xe9e6('0x35')]=_['intersection'](_0x50d9ca[_0xe9e6('0x30')],qs['fields'](_0x511309[_0xe9e6('0x32')][_0xe9e6('0x36')]));_0x59e49f[_0xe9e6('0x35')]=_0x59e49f['attributes']['length']?_0x59e49f[_0xe9e6('0x35')]:_0x50d9ca['model'];_0x59e49f['order']=qs[_0xe9e6('0x4d')](_0x511309[_0xe9e6('0x32')][_0xe9e6('0x4d')]);_0x59e49f[_0xe9e6('0x3a')]=qs[_0xe9e6('0x33')](_[_0xe9e6('0x3b')](_0x511309[_0xe9e6('0x32')],_0x50d9ca[_0xe9e6('0x33')]));if(_0x511309[_0xe9e6('0x32')]['filter']){_0x59e49f[_0xe9e6('0x3a')]=_[_0xe9e6('0x3d')](_0x59e49f[_0xe9e6('0x3a')],{'$or':_[_0xe9e6('0x2a')](_0x59e49f[_0xe9e6('0x35')],function(_0x19f827){var _0x25b205={};_0x25b205[_0x19f827]={'$like':'%'+_0x511309[_0xe9e6('0x32')][_0xe9e6('0x3c')]+'%'};return _0x25b205;})});}_0x59e49f=_[_0xe9e6('0x3d')]({},_0x59e49f,_0x511309['options']);return _0x547d9e['getConditions'](_0x59e49f);}})[_0xe9e6('0x22')](function(_0x306a07){if(_0x306a07){_0x4d8da6=_0x306a07[_0xe9e6('0x37')];if(!_0x511309[_0xe9e6('0x32')][_0xe9e6('0x4e')]('nolimit')){_0x59e49f[_0xe9e6('0x1b')]=qs['limit'](_0x511309[_0xe9e6('0x32')]['limit']);_0x59e49f[_0xe9e6('0x1d')]=qs[_0xe9e6('0x1d')](_0x511309[_0xe9e6('0x32')]['offset']);}return _0x547d9e[_0xe9e6('0x4c')](_0x59e49f);}})[_0xe9e6('0x22')](function(_0x2bc01d){if(_0x2bc01d){return _0x2bc01d?{'count':_0x4d8da6,'rows':_0x2bc01d}:null;}})[_0xe9e6('0x22')](respondWithResult(_0x183af5,null))[_0xe9e6('0x45')](handleError(_0x183af5,null));};exports['addActions']=function(_0x36b547,_0x228453,_0x1c0e1b){return db[_0xe9e6('0x4f')]['find']({'where':{'id':_0x36b547[_0xe9e6('0x48')]['id']}})[_0xe9e6('0x22')](handleEntityNotFound(_0x228453,null))[_0xe9e6('0x22')](function(_0xdf54e2){if(_0xdf54e2){return _0xdf54e2['addActions'](_0x36b547[_0xe9e6('0x47')]['ids'],_[_0xe9e6('0x50')](_0x36b547['body'],[_0xe9e6('0x4b'),'id'])||{});}})[_0xe9e6('0x22')](respondWithResult(_0x228453,null))[_0xe9e6('0x45')](handleError(_0x228453,null));};exports[_0xe9e6('0x51')]=function(_0x3de6a1,_0x3bfee2,_0x322a64){var _0x1be6bb={};var _0x560299={};var _0x3a7abf;var _0x417b76;return db[_0xe9e6('0x2b')][_0xe9e6('0x52')]({'where':{'id':_0x3de6a1[_0xe9e6('0x48')]['id']}})[_0xe9e6('0x22')](handleEntityNotFound(_0x3bfee2,null))[_0xe9e6('0x22')](function(_0x56f782){if(_0x56f782){_0x3a7abf=_0x56f782;_0x560299['model']=_[_0xe9e6('0x31')](db[_0xe9e6('0x4f')][_0xe9e6('0x2c')]);_0x560299[_0xe9e6('0x32')]=_['keys'](_0x3de6a1[_0xe9e6('0x32')]);_0x560299[_0xe9e6('0x33')]=_[_0xe9e6('0x34')](_0x560299[_0xe9e6('0x30')],_0x560299['query']);_0x1be6bb[_0xe9e6('0x35')]=_[_0xe9e6('0x34')](_0x560299[_0xe9e6('0x30')],qs['fields'](_0x3de6a1[_0xe9e6('0x32')][_0xe9e6('0x36')]));_0x1be6bb[_0xe9e6('0x35')]=_0x1be6bb[_0xe9e6('0x35')]['length']?_0x1be6bb[_0xe9e6('0x35')]:_0x560299['model'];_0x1be6bb[_0xe9e6('0x39')]=qs['sort'](_0x3de6a1[_0xe9e6('0x32')][_0xe9e6('0x4d')]);_0x1be6bb[_0xe9e6('0x3a')]=qs['filters'](_[_0xe9e6('0x3b')](_0x3de6a1[_0xe9e6('0x32')],_0x560299[_0xe9e6('0x33')]));if(_0x3de6a1[_0xe9e6('0x32')][_0xe9e6('0x3c')]){_0x1be6bb[_0xe9e6('0x3a')]=_[_0xe9e6('0x3d')](_0x1be6bb['where'],{'$or':_['map'](_0x1be6bb[_0xe9e6('0x35')],function(_0x1e64e1){var _0xf2b8a7={};_0xf2b8a7[_0x1e64e1]={'$like':'%'+_0x3de6a1[_0xe9e6('0x32')][_0xe9e6('0x3c')]+'%'};return _0xf2b8a7;})});}_0x1be6bb=_['merge']({},_0x1be6bb,_0x3de6a1[_0xe9e6('0x3f')]);return _0x3a7abf[_0xe9e6('0x51')](_0x1be6bb);}})['then'](function(_0x32460b){if(_0x32460b){_0x417b76=_0x32460b[_0xe9e6('0x37')];if(!_0x3de6a1[_0xe9e6('0x32')][_0xe9e6('0x4e')](_0xe9e6('0x38'))){_0x1be6bb['limit']=qs[_0xe9e6('0x1b')](_0x3de6a1['query']['limit']);_0x1be6bb[_0xe9e6('0x1d')]=qs[_0xe9e6('0x1d')](_0x3de6a1[_0xe9e6('0x32')]['offset']);}return _0x3a7abf[_0xe9e6('0x51')](_0x1be6bb);}})['then'](function(_0x479ef0){if(_0x479ef0){return _0x479ef0?{'count':_0x417b76,'rows':_0x479ef0}:null;}})[_0xe9e6('0x22')](respondWithResult(_0x3bfee2,null))[_0xe9e6('0x45')](handleError(_0x3bfee2,null));};
\ No newline at end of file
+var _0xbf82=['where','filters','pick','filter','merge','VIRTUAL','options','count','rows','catch','params','keys','length','includeAll','include','find','create','body','addConditions','Condition','omit','getConditions','findOne','addActions','Action','ids','getActions','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','path','sox','to-csv','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/parsers/advancedSearch','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','limit','undefined','set','Content-Range','update','then','destroy','error','stack','name','send','index','map','Automation','rawAttributes','fieldName','type','key','query','intersection','attributes','model','fields','hasOwnProperty','nolimit','order','sort'];(function(_0x377a55,_0x9545a6){var _0x44f60d=function(_0xbf8aed){while(--_0xbf8aed){_0x377a55['push'](_0x377a55['shift']());}};_0x44f60d(++_0x9545a6);}(_0xbf82,0xbf));var _0x2bf8=function(_0x3433c8,_0x42f4dd){_0x3433c8=_0x3433c8-0x0;var _0x56edc3=_0xbf82[_0x3433c8];return _0x56edc3;};'use strict';var emlformat=require(_0x2bf8('0x0'));var rimraf=require(_0x2bf8('0x1'));var zipdir=require(_0x2bf8('0x2'));var jsonpatch=require(_0x2bf8('0x3'));var rp=require(_0x2bf8('0x4'));var moment=require(_0x2bf8('0x5'));var BPromise=require('bluebird');var Mustache=require(_0x2bf8('0x6'));var util=require('util');var path=require(_0x2bf8('0x7'));var sox=require(_0x2bf8('0x8'));var csv=require(_0x2bf8('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x2bf8('0xa'));var _=require(_0x2bf8('0xb'));var squel=require(_0x2bf8('0xc'));var crypto=require(_0x2bf8('0xd'));var jsforce=require(_0x2bf8('0xe'));var deskjs=require(_0x2bf8('0xf'));var toCsv=require('to-csv');var querystring=require(_0x2bf8('0x10'));var Papa=require(_0x2bf8('0x11'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0x2bf8('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x2bf8('0x13'));var utils=require(_0x2bf8('0x14'));var config=require('../../config/environment');var licenseUtil=require(_0x2bf8('0x15'));var db=require(_0x2bf8('0x16'))['db'];function respondWithStatusCode(_0x3f1a57,_0x118c35){_0x118c35=_0x118c35||0xcc;return function(_0x364682){if(_0x364682){return _0x3f1a57[_0x2bf8('0x17')](_0x118c35);}return _0x3f1a57[_0x2bf8('0x18')](_0x118c35)[_0x2bf8('0x19')]();};}function respondWithResult(_0x43bedf,_0x432f0c){_0x432f0c=_0x432f0c||0xc8;return function(_0x304e5c){if(_0x304e5c){return _0x43bedf[_0x2bf8('0x18')](_0x432f0c)[_0x2bf8('0x1a')](_0x304e5c);}};}function respondWithFilteredResult(_0x3cda98,_0xb9ceb0){return function(_0x18b3cf){if(_0x18b3cf){var _0x481055=typeof _0xb9ceb0[_0x2bf8('0x1b')]==='undefined'&&typeof _0xb9ceb0[_0x2bf8('0x1c')]===_0x2bf8('0x1d');var _0x5d2899=_0x18b3cf['count'];var _0x1646a5=_0x481055?0x0:_0xb9ceb0[_0x2bf8('0x1b')];var _0x3ef40a=_0x481055?_0x18b3cf['count']:_0xb9ceb0['offset']+_0xb9ceb0['limit'];var _0x10b07a;if(_0x3ef40a>=_0x5d2899){_0x3ef40a=_0x5d2899;_0x10b07a=0xc8;}else{_0x10b07a=0xce;}_0x3cda98[_0x2bf8('0x18')](_0x10b07a);return _0x3cda98[_0x2bf8('0x1e')](_0x2bf8('0x1f'),_0x1646a5+'-'+_0x3ef40a+'/'+_0x5d2899)[_0x2bf8('0x1a')](_0x18b3cf);}return null;};}function patchUpdates(_0x38b743){return function(_0x5c6497){try{jsonpatch['apply'](_0x5c6497,_0x38b743,!![]);}catch(_0x7f867a){return BPromise['reject'](_0x7f867a);}return _0x5c6497['save']();};}function saveUpdates(_0x56c9c5,_0x5ae37c){return function(_0x47a276){if(_0x47a276){return _0x47a276[_0x2bf8('0x20')](_0x56c9c5)[_0x2bf8('0x21')](function(_0x5cd5d1){return _0x5cd5d1;});}return null;};}function removeEntity(_0x1a488f,_0x19410f){return function(_0x231eb8){if(_0x231eb8){return _0x231eb8[_0x2bf8('0x22')]()['then'](function(){_0x1a488f[_0x2bf8('0x18')](0xcc)['end']();});}};}function handleEntityNotFound(_0x4a9a9e,_0xf1b7dc){return function(_0x1586a1){if(!_0x1586a1){_0x4a9a9e[_0x2bf8('0x17')](0x194);}return _0x1586a1;};}function handleError(_0x5ce628,_0x113acb){_0x113acb=_0x113acb||0x1f4;return function(_0x2143a3){logger[_0x2bf8('0x23')](_0x2143a3[_0x2bf8('0x24')]);if(_0x2143a3[_0x2bf8('0x25')]){delete _0x2143a3[_0x2bf8('0x25')];}_0x5ce628[_0x2bf8('0x18')](_0x113acb)[_0x2bf8('0x26')](_0x2143a3);};}exports[_0x2bf8('0x27')]=function(_0x58f915,_0x7e368c){var _0x1c0f77={},_0x45e9d2={},_0x1fa1db={'count':0x0,'rows':[]};var _0x44f8aa=_[_0x2bf8('0x28')](db[_0x2bf8('0x29')][_0x2bf8('0x2a')],function(_0xbec4cd){return{'name':_0xbec4cd[_0x2bf8('0x2b')],'type':_0xbec4cd[_0x2bf8('0x2c')][_0x2bf8('0x2d')]};});_0x45e9d2['model']=_[_0x2bf8('0x28')](_0x44f8aa,'name');_0x45e9d2[_0x2bf8('0x2e')]=_['keys'](_0x58f915[_0x2bf8('0x2e')]);_0x45e9d2['filters']=_[_0x2bf8('0x2f')](_0x45e9d2['model'],_0x45e9d2['query']);_0x1c0f77[_0x2bf8('0x30')]=_['intersection'](_0x45e9d2[_0x2bf8('0x31')],qs[_0x2bf8('0x32')](_0x58f915[_0x2bf8('0x2e')][_0x2bf8('0x32')]));_0x1c0f77['attributes']=_0x1c0f77[_0x2bf8('0x30')]['length']?_0x1c0f77[_0x2bf8('0x30')]:_0x45e9d2[_0x2bf8('0x31')];if(!_0x58f915['query'][_0x2bf8('0x33')](_0x2bf8('0x34'))){_0x1c0f77[_0x2bf8('0x1c')]=qs['limit'](_0x58f915[_0x2bf8('0x2e')][_0x2bf8('0x1c')]);_0x1c0f77['offset']=qs[_0x2bf8('0x1b')](_0x58f915[_0x2bf8('0x2e')]['offset']);}_0x1c0f77[_0x2bf8('0x35')]=qs[_0x2bf8('0x36')](_0x58f915['query'][_0x2bf8('0x36')]);_0x1c0f77[_0x2bf8('0x37')]=qs[_0x2bf8('0x38')](_[_0x2bf8('0x39')](_0x58f915[_0x2bf8('0x2e')],_0x45e9d2['filters']),_0x44f8aa);if(_0x58f915['query'][_0x2bf8('0x3a')]){_0x1c0f77[_0x2bf8('0x37')]=_[_0x2bf8('0x3b')](_0x1c0f77[_0x2bf8('0x37')],{'$or':_['map'](_0x44f8aa,function(_0x10ae89){if(_0x10ae89[_0x2bf8('0x2c')]!==_0x2bf8('0x3c')){var _0xb4209a={};_0xb4209a[_0x10ae89['name']]={'$like':'%'+_0x58f915[_0x2bf8('0x2e')][_0x2bf8('0x3a')]+'%'};return _0xb4209a;}})});}_0x1c0f77=_[_0x2bf8('0x3b')]({},_0x1c0f77,_0x58f915[_0x2bf8('0x3d')]);var _0x1dc095={'where':_0x1c0f77[_0x2bf8('0x37')]};return db[_0x2bf8('0x29')][_0x2bf8('0x3e')](_0x1dc095)['then'](function(_0x3ab3c8){_0x1fa1db[_0x2bf8('0x3e')]=_0x3ab3c8;if(_0x58f915[_0x2bf8('0x2e')]['includeAll']){_0x1c0f77['include']=[{'all':!![]}];}return db['Automation']['findAll'](_0x1c0f77);})['then'](function(_0x4128f8){_0x1fa1db[_0x2bf8('0x3f')]=_0x4128f8;return _0x1fa1db;})['then'](respondWithFilteredResult(_0x7e368c,_0x1c0f77))[_0x2bf8('0x40')](handleError(_0x7e368c,null));};exports['show']=function(_0x1667d8,_0x12aa2d){var _0x2c06d2={'raw':![],'where':{'id':_0x1667d8[_0x2bf8('0x41')]['id']}},_0x314274={};_0x314274[_0x2bf8('0x31')]=_[_0x2bf8('0x42')](db[_0x2bf8('0x29')][_0x2bf8('0x2a')]);_0x314274['query']=_[_0x2bf8('0x42')](_0x1667d8[_0x2bf8('0x2e')]);_0x314274[_0x2bf8('0x38')]=_[_0x2bf8('0x2f')](_0x314274['model'],_0x314274['query']);_0x2c06d2[_0x2bf8('0x30')]=_[_0x2bf8('0x2f')](_0x314274['model'],qs[_0x2bf8('0x32')](_0x1667d8[_0x2bf8('0x2e')][_0x2bf8('0x32')]));_0x2c06d2[_0x2bf8('0x30')]=_0x2c06d2[_0x2bf8('0x30')][_0x2bf8('0x43')]?_0x2c06d2[_0x2bf8('0x30')]:_0x314274[_0x2bf8('0x31')];if(_0x1667d8[_0x2bf8('0x2e')][_0x2bf8('0x44')]){_0x2c06d2[_0x2bf8('0x45')]=[{'all':!![]}];}_0x2c06d2=_[_0x2bf8('0x3b')]({},_0x2c06d2,_0x1667d8[_0x2bf8('0x3d')]);return db[_0x2bf8('0x29')][_0x2bf8('0x46')](_0x2c06d2)['then'](handleEntityNotFound(_0x12aa2d,null))[_0x2bf8('0x21')](respondWithResult(_0x12aa2d,null))['catch'](handleError(_0x12aa2d,null));};exports[_0x2bf8('0x47')]=function(_0x45e5f7,_0x2043af){return db[_0x2bf8('0x29')][_0x2bf8('0x47')](_0x45e5f7[_0x2bf8('0x48')],{})['then'](respondWithResult(_0x2043af,0xc9))[_0x2bf8('0x40')](handleError(_0x2043af,null));};exports[_0x2bf8('0x20')]=function(_0x4212e5,_0x2dab0a){if(_0x4212e5['body']['id']){delete _0x4212e5[_0x2bf8('0x48')]['id'];}return db[_0x2bf8('0x29')][_0x2bf8('0x46')]({'where':{'id':_0x4212e5['params']['id']}})[_0x2bf8('0x21')](handleEntityNotFound(_0x2dab0a,null))[_0x2bf8('0x21')](saveUpdates(_0x4212e5['body'],null))['then'](respondWithResult(_0x2dab0a,null))['catch'](handleError(_0x2dab0a,null));};exports[_0x2bf8('0x22')]=function(_0x4109a1,_0x3ee7ad){return db['Automation'][_0x2bf8('0x46')]({'where':{'id':_0x4109a1[_0x2bf8('0x41')]['id']}})[_0x2bf8('0x21')](handleEntityNotFound(_0x3ee7ad,null))[_0x2bf8('0x21')](removeEntity(_0x3ee7ad,null))[_0x2bf8('0x40')](handleError(_0x3ee7ad,null));};exports[_0x2bf8('0x49')]=function(_0x557b34,_0x36de37,_0x229263){return db[_0x2bf8('0x4a')]['find']({'where':{'id':_0x557b34[_0x2bf8('0x41')]['id']}})['then'](handleEntityNotFound(_0x36de37,null))['then'](function(_0xf4a030){if(_0xf4a030){return _0xf4a030['addConditions'](_0x557b34[_0x2bf8('0x48')]['ids'],_[_0x2bf8('0x4b')](_0x557b34[_0x2bf8('0x48')],['ids','id'])||{});}})[_0x2bf8('0x21')](respondWithResult(_0x36de37,null))[_0x2bf8('0x40')](handleError(_0x36de37,null));};exports[_0x2bf8('0x4c')]=function(_0x14034b,_0x4bb71d,_0x96bbe2){var _0x1517d6={};var _0x44f888={};var _0x210cc7;var _0x313bcb;return db[_0x2bf8('0x29')][_0x2bf8('0x4d')]({'where':{'id':_0x14034b[_0x2bf8('0x41')]['id']}})['then'](handleEntityNotFound(_0x4bb71d,null))['then'](function(_0x33804f){if(_0x33804f){_0x210cc7=_0x33804f;_0x44f888[_0x2bf8('0x31')]=_[_0x2bf8('0x42')](db[_0x2bf8('0x4a')][_0x2bf8('0x2a')]);_0x44f888['query']=_['keys'](_0x14034b['query']);_0x44f888[_0x2bf8('0x38')]=_['intersection'](_0x44f888[_0x2bf8('0x31')],_0x44f888[_0x2bf8('0x2e')]);_0x1517d6[_0x2bf8('0x30')]=_[_0x2bf8('0x2f')](_0x44f888['model'],qs[_0x2bf8('0x32')](_0x14034b['query'][_0x2bf8('0x32')]));_0x1517d6['attributes']=_0x1517d6[_0x2bf8('0x30')]['length']?_0x1517d6[_0x2bf8('0x30')]:_0x44f888[_0x2bf8('0x31')];_0x1517d6['order']=qs[_0x2bf8('0x36')](_0x14034b[_0x2bf8('0x2e')][_0x2bf8('0x36')]);_0x1517d6[_0x2bf8('0x37')]=qs[_0x2bf8('0x38')](_[_0x2bf8('0x39')](_0x14034b[_0x2bf8('0x2e')],_0x44f888[_0x2bf8('0x38')]));if(_0x14034b['query']['filter']){_0x1517d6[_0x2bf8('0x37')]=_[_0x2bf8('0x3b')](_0x1517d6[_0x2bf8('0x37')],{'$or':_[_0x2bf8('0x28')](_0x1517d6[_0x2bf8('0x30')],function(_0x555d0a){var _0x4898cf={};_0x4898cf[_0x555d0a]={'$like':'%'+_0x14034b[_0x2bf8('0x2e')][_0x2bf8('0x3a')]+'%'};return _0x4898cf;})});}_0x1517d6=_['merge']({},_0x1517d6,_0x14034b['options']);return _0x210cc7['getConditions'](_0x1517d6);}})['then'](function(_0x421d05){if(_0x421d05){_0x313bcb=_0x421d05[_0x2bf8('0x43')];if(!_0x14034b[_0x2bf8('0x2e')][_0x2bf8('0x33')]('nolimit')){_0x1517d6['limit']=qs[_0x2bf8('0x1c')](_0x14034b[_0x2bf8('0x2e')]['limit']);_0x1517d6['offset']=qs[_0x2bf8('0x1b')](_0x14034b[_0x2bf8('0x2e')][_0x2bf8('0x1b')]);}return _0x210cc7[_0x2bf8('0x4c')](_0x1517d6);}})[_0x2bf8('0x21')](function(_0x2e2ff0){if(_0x2e2ff0){return _0x2e2ff0?{'count':_0x313bcb,'rows':_0x2e2ff0}:null;}})[_0x2bf8('0x21')](respondWithResult(_0x4bb71d,null))['catch'](handleError(_0x4bb71d,null));};exports[_0x2bf8('0x4e')]=function(_0x2177d8,_0x2e20e3,_0x2bfce9){return db[_0x2bf8('0x4f')]['find']({'where':{'id':_0x2177d8[_0x2bf8('0x41')]['id']}})[_0x2bf8('0x21')](handleEntityNotFound(_0x2e20e3,null))[_0x2bf8('0x21')](function(_0x2accc7){if(_0x2accc7){return _0x2accc7[_0x2bf8('0x4e')](_0x2177d8[_0x2bf8('0x48')][_0x2bf8('0x50')],_[_0x2bf8('0x4b')](_0x2177d8[_0x2bf8('0x48')],[_0x2bf8('0x50'),'id'])||{});}})['then'](respondWithResult(_0x2e20e3,null))[_0x2bf8('0x40')](handleError(_0x2e20e3,null));};exports[_0x2bf8('0x51')]=function(_0x56cb71,_0x59d88a,_0x5e8a3a){var _0x5ac76a={};var _0x5cd366={};var _0x3c7993;var _0x53b090;return db[_0x2bf8('0x29')][_0x2bf8('0x4d')]({'where':{'id':_0x56cb71[_0x2bf8('0x41')]['id']}})[_0x2bf8('0x21')](handleEntityNotFound(_0x59d88a,null))['then'](function(_0x1a63ce){if(_0x1a63ce){_0x3c7993=_0x1a63ce;_0x5cd366['model']=_[_0x2bf8('0x42')](db['Action'][_0x2bf8('0x2a')]);_0x5cd366[_0x2bf8('0x2e')]=_[_0x2bf8('0x42')](_0x56cb71[_0x2bf8('0x2e')]);_0x5cd366[_0x2bf8('0x38')]=_[_0x2bf8('0x2f')](_0x5cd366[_0x2bf8('0x31')],_0x5cd366[_0x2bf8('0x2e')]);_0x5ac76a[_0x2bf8('0x30')]=_[_0x2bf8('0x2f')](_0x5cd366['model'],qs[_0x2bf8('0x32')](_0x56cb71[_0x2bf8('0x2e')][_0x2bf8('0x32')]));_0x5ac76a[_0x2bf8('0x30')]=_0x5ac76a[_0x2bf8('0x30')]['length']?_0x5ac76a[_0x2bf8('0x30')]:_0x5cd366['model'];_0x5ac76a[_0x2bf8('0x35')]=qs['sort'](_0x56cb71[_0x2bf8('0x2e')][_0x2bf8('0x36')]);_0x5ac76a[_0x2bf8('0x37')]=qs[_0x2bf8('0x38')](_[_0x2bf8('0x39')](_0x56cb71[_0x2bf8('0x2e')],_0x5cd366['filters']));if(_0x56cb71['query'][_0x2bf8('0x3a')]){_0x5ac76a[_0x2bf8('0x37')]=_[_0x2bf8('0x3b')](_0x5ac76a[_0x2bf8('0x37')],{'$or':_['map'](_0x5ac76a[_0x2bf8('0x30')],function(_0x4751dc){var _0x297f3c={};_0x297f3c[_0x4751dc]={'$like':'%'+_0x56cb71['query'][_0x2bf8('0x3a')]+'%'};return _0x297f3c;})});}_0x5ac76a=_[_0x2bf8('0x3b')]({},_0x5ac76a,_0x56cb71[_0x2bf8('0x3d')]);return _0x3c7993['getActions'](_0x5ac76a);}})[_0x2bf8('0x21')](function(_0x20bbe5){if(_0x20bbe5){_0x53b090=_0x20bbe5['length'];if(!_0x56cb71[_0x2bf8('0x2e')]['hasOwnProperty'](_0x2bf8('0x34'))){_0x5ac76a[_0x2bf8('0x1c')]=qs[_0x2bf8('0x1c')](_0x56cb71['query'][_0x2bf8('0x1c')]);_0x5ac76a[_0x2bf8('0x1b')]=qs[_0x2bf8('0x1b')](_0x56cb71[_0x2bf8('0x2e')]['offset']);}return _0x3c7993[_0x2bf8('0x51')](_0x5ac76a);}})[_0x2bf8('0x21')](function(_0x28cd49){if(_0x28cd49){return _0x28cd49?{'count':_0x53b090,'rows':_0x28cd49}:null;}})['then'](respondWithResult(_0x59d88a,null))[_0x2bf8('0x40')](handleError(_0x59d88a,null));};
\ No newline at end of file
diff --git a/server/api/automation/automation.model.js b/server/api/automation/automation.model.js
index fcf3f17..2f4ef2a 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 _0x77dd=['../../config/logger','api','moment','request-promise','path','rimraf','./automation.attributes','tools_automations','lodash','util'];(function(_0xc92336,_0x23849f){var _0x57b44d=function(_0xf99d63){while(--_0xf99d63){_0xc92336['push'](_0xc92336['shift']());}};_0x57b44d(++_0x23849f);}(_0x77dd,0x15c));var _0xd77d=function(_0x14a0a0,_0x45d0cf){_0x14a0a0=_0x14a0a0-0x0;var _0x56b651=_0x77dd[_0x14a0a0];return _0x56b651;};'use strict';var _=require(_0xd77d('0x0'));var util=require(_0xd77d('0x1'));var logger=require(_0xd77d('0x2'))(_0xd77d('0x3'));var moment=require(_0xd77d('0x4'));var BPromise=require('bluebird');var rp=require(_0xd77d('0x5'));var fs=require('fs');var path=require(_0xd77d('0x6'));var rimraf=require(_0xd77d('0x7'));var config=require('../../config/environment');var attributes=require(_0xd77d('0x8'));module['exports']=function(_0x2ce7a5,_0x232a6b){return _0x2ce7a5['define']('Automation',attributes,{'tableName':_0xd77d('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x588a=['bluebird','request-promise','rimraf','../../config/environment','./automation.attributes','exports','define','Automation','lodash','../../config/logger','api'];(function(_0x5f5495,_0x30d087){var _0x14d8a3=function(_0x40e773){while(--_0x40e773){_0x5f5495['push'](_0x5f5495['shift']());}};_0x14d8a3(++_0x30d087);}(_0x588a,0x19f));var _0xa588=function(_0x2ef586,_0x17cc0c){_0x2ef586=_0x2ef586-0x0;var _0x2bf324=_0x588a[_0x2ef586];return _0x2bf324;};'use strict';var _=require(_0xa588('0x0'));var util=require('util');var logger=require(_0xa588('0x1'))(_0xa588('0x2'));var moment=require('moment');var BPromise=require(_0xa588('0x3'));var rp=require(_0xa588('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0xa588('0x5'));var config=require(_0xa588('0x6'));var attributes=require(_0xa588('0x7'));module[_0xa588('0x8')]=function(_0x2edab6,_0x1644cc){return _0x2edab6[_0xa588('0x9')](_0xa588('0xa'),attributes,{'tableName':'tools_automations','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
diff --git a/server/api/automation/automation.rpc.js b/server/api/automation/automation.rpc.js
index 7cd85a7..5cf1cb0 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 _0x404d=['stringify','error','code','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','http','info','Automation,\x20%s,\x20%s','request\x20sent'];(function(_0x28b7f1,_0x4c6a8e){var _0x4f79d4=function(_0x337526){while(--_0x337526){_0x28b7f1['push'](_0x28b7f1['shift']());}};_0x4f79d4(++_0x4c6a8e);}(_0x404d,0x1e9));var _0xd404=function(_0x24558f,_0x5f2233){_0x24558f=_0x24558f-0x0;var _0x514db8=_0x404d[_0x24558f];return _0x514db8;};'use strict';var _=require(_0xd404('0x0'));var util=require(_0xd404('0x1'));var moment=require(_0xd404('0x2'));var BPromise=require(_0xd404('0x3'));var rs=require(_0xd404('0x4'));var fs=require('fs');var Redis=require(_0xd404('0x5'));var db=require(_0xd404('0x6'))['db'];var utils=require(_0xd404('0x7'));var logger=require(_0xd404('0x8'))('rpc');var config=require(_0xd404('0x9'));var jayson=require(_0xd404('0xa'));var client=jayson['client'][_0xd404('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x7faf39,_0x5da99f,_0x5c335f){return new BPromise(function(_0x10021a,_0x3d7e8a){return client['request'](_0x7faf39,_0x5c335f)['then'](function(_0x3096f0){logger[_0xd404('0xc')](_0xd404('0xd'),_0x5da99f,_0xd404('0xe'));logger['debug']('Automation,\x20%s,\x20%s,\x20%s',_0x5da99f,_0xd404('0xe'),JSON[_0xd404('0xf')](_0x3096f0));if(_0x3096f0['error']){if(_0x3096f0[_0xd404('0x10')][_0xd404('0x11')]===0x1f4){logger[_0xd404('0x10')](_0xd404('0xd'),_0x5da99f,_0x3096f0[_0xd404('0x10')][_0xd404('0x12')]);return _0x3d7e8a(_0x3096f0[_0xd404('0x10')][_0xd404('0x12')]);}logger[_0xd404('0x10')](_0xd404('0xd'),_0x5da99f,_0x3096f0[_0xd404('0x10')][_0xd404('0x12')]);return _0x10021a(_0x3096f0[_0xd404('0x10')][_0xd404('0x12')]);}else{logger[_0xd404('0xc')](_0xd404('0xd'),_0x5da99f,_0xd404('0xe'));_0x10021a(_0x3096f0[_0xd404('0x13')][_0xd404('0x12')]);}})[_0xd404('0x14')](function(_0x155186){logger['error'](_0xd404('0xd'),_0x5da99f,_0x155186);_0x3d7e8a(_0x155186);});});}
\ No newline at end of file
+var _0x6302=['moment','bluebird','randomstring','../../config/utils','../../config/environment','jayson/promise','client','http','then','Automation,\x20%s,\x20%s','debug','request\x20sent','stringify','error','code','message','result','catch','util'];(function(_0x20593e,_0x2f8bde){var _0x4f8546=function(_0x41cac5){while(--_0x41cac5){_0x20593e['push'](_0x20593e['shift']());}};_0x4f8546(++_0x2f8bde);}(_0x6302,0x109));var _0x2630=function(_0x4e9d06,_0x41825e){_0x4e9d06=_0x4e9d06-0x0;var _0xdea836=_0x6302[_0x4e9d06];return _0xdea836;};'use strict';var _=require('lodash');var util=require(_0x2630('0x0'));var moment=require(_0x2630('0x1'));var BPromise=require(_0x2630('0x2'));var rs=require(_0x2630('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x2630('0x4'));var logger=require('../../config/logger')('rpc');var config=require(_0x2630('0x5'));var jayson=require(_0x2630('0x6'));var client=jayson[_0x2630('0x7')][_0x2630('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x2867f8,_0x19231a,_0x2e1867){return new BPromise(function(_0x353f73,_0x581f4d){return client['request'](_0x2867f8,_0x2e1867)[_0x2630('0x9')](function(_0x10ffdf){logger['info'](_0x2630('0xa'),_0x19231a,'request\x20sent');logger[_0x2630('0xb')]('Automation,\x20%s,\x20%s,\x20%s',_0x19231a,_0x2630('0xc'),JSON[_0x2630('0xd')](_0x10ffdf));if(_0x10ffdf[_0x2630('0xe')]){if(_0x10ffdf[_0x2630('0xe')][_0x2630('0xf')]===0x1f4){logger[_0x2630('0xe')]('Automation,\x20%s,\x20%s',_0x19231a,_0x10ffdf[_0x2630('0xe')][_0x2630('0x10')]);return _0x581f4d(_0x10ffdf[_0x2630('0xe')][_0x2630('0x10')]);}logger['error'](_0x2630('0xa'),_0x19231a,_0x10ffdf[_0x2630('0xe')][_0x2630('0x10')]);return _0x353f73(_0x10ffdf['error'][_0x2630('0x10')]);}else{logger['info'](_0x2630('0xa'),_0x19231a,_0x2630('0xc'));_0x353f73(_0x10ffdf[_0x2630('0x11')][_0x2630('0x10')]);}})[_0x2630('0x12')](function(_0x18b2b0){logger[_0x2630('0xe')](_0x2630('0xa'),_0x19231a,_0x18b2b0);_0x581f4d(_0x18b2b0);});});}
\ No newline at end of file
diff --git a/server/api/automation/index.js b/server/api/automation/index.js
index ce117a7..e712289 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 _0x57cf=['Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','index','isAuthenticated','/:id/conditions','/:id/actions','getActions','create','post','addActions','/:id','update','delete','destroy','exports','multer','util','path','connect-timeout','express'];(function(_0x28236f,_0x313b4a){var _0x578bdf=function(_0xd18fc2){while(--_0xd18fc2){_0x28236f['push'](_0x28236f['shift']());}};_0x578bdf(++_0x313b4a);}(_0x57cf,0x11b));var _0xf57c=function(_0x3d11be,_0x1b9a8c){_0x3d11be=_0x3d11be-0x0;var _0x4b657b=_0x57cf[_0x3d11be];return _0x4b657b;};'use strict';var multer=require(_0xf57c('0x0'));var util=require(_0xf57c('0x1'));var path=require(_0xf57c('0x2'));var timeout=require(_0xf57c('0x3'));var express=require(_0xf57c('0x4'));var router=express[_0xf57c('0x5')]();var fs_extra=require(_0xf57c('0x6'));var auth=require(_0xf57c('0x7'));var interaction=require(_0xf57c('0x8'));var config=require(_0xf57c('0x9'));var controller=require('./automation.controller');router[_0xf57c('0xa')]('/',auth['isAuthenticated'](),controller[_0xf57c('0xb')]);router['get']('/:id',auth[_0xf57c('0xc')](),controller['show']);router[_0xf57c('0xa')](_0xf57c('0xd'),auth['isAuthenticated'](),controller['getConditions']);router[_0xf57c('0xa')](_0xf57c('0xe'),auth[_0xf57c('0xc')](),controller[_0xf57c('0xf')]);router['post']('/',auth[_0xf57c('0xc')](),controller[_0xf57c('0x10')]);router[_0xf57c('0x11')]('/:id/conditions',auth[_0xf57c('0xc')](),controller['addConditions']);router[_0xf57c('0x11')](_0xf57c('0xe'),auth['isAuthenticated'](),controller[_0xf57c('0x12')]);router['put'](_0xf57c('0x13'),auth['isAuthenticated'](),controller[_0xf57c('0x14')]);router[_0xf57c('0x15')](_0xf57c('0x13'),auth[_0xf57c('0xc')](),controller[_0xf57c('0x16')]);module[_0xf57c('0x17')]=router;
\ No newline at end of file
+var _0x0eec=['Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','index','/:id','isAuthenticated','show','/:id/conditions','getConditions','/:id/actions','getActions','post','addConditions','addActions','put','update','delete','destroy','exports','multer','connect-timeout','express'];(function(_0x3303ff,_0x29549a){var _0x32270a=function(_0x3ac1eb){while(--_0x3ac1eb){_0x3303ff['push'](_0x3303ff['shift']());}};_0x32270a(++_0x29549a);}(_0x0eec,0xac));var _0xc0ee=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x0eec[_0x20a584];return _0x4b41a8;};'use strict';var multer=require(_0xc0ee('0x0'));var util=require('util');var path=require('path');var timeout=require(_0xc0ee('0x1'));var express=require(_0xc0ee('0x2'));var router=express[_0xc0ee('0x3')]();var fs_extra=require(_0xc0ee('0x4'));var auth=require(_0xc0ee('0x5'));var interaction=require(_0xc0ee('0x6'));var config=require(_0xc0ee('0x7'));var controller=require('./automation.controller');router[_0xc0ee('0x8')]('/',auth['isAuthenticated'](),controller[_0xc0ee('0x9')]);router[_0xc0ee('0x8')](_0xc0ee('0xa'),auth[_0xc0ee('0xb')](),controller[_0xc0ee('0xc')]);router[_0xc0ee('0x8')](_0xc0ee('0xd'),auth['isAuthenticated'](),controller[_0xc0ee('0xe')]);router[_0xc0ee('0x8')](_0xc0ee('0xf'),auth[_0xc0ee('0xb')](),controller[_0xc0ee('0x10')]);router[_0xc0ee('0x11')]('/',auth[_0xc0ee('0xb')](),controller['create']);router[_0xc0ee('0x11')](_0xc0ee('0xd'),auth[_0xc0ee('0xb')](),controller[_0xc0ee('0x12')]);router[_0xc0ee('0x11')](_0xc0ee('0xf'),auth[_0xc0ee('0xb')](),controller[_0xc0ee('0x13')]);router[_0xc0ee('0x14')]('/:id',auth['isAuthenticated'](),controller[_0xc0ee('0x15')]);router[_0xc0ee('0x16')](_0xc0ee('0xa'),auth['isAuthenticated'](),controller[_0xc0ee('0x17')]);module[_0xc0ee('0x18')]=router;
\ No newline at end of file
diff --git a/server/api/campaign/campaign.attributes.js b/server/api/campaign/campaign.attributes.js
index cd09c90..fb9d62f 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 _0x0055=['Busy\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#NoAnswer\x20Retry\x20(min:1,\x20max:999)','NoAnswer\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Global\x20Max\x20Retry\x20(min:1,\x20max:999)','always','never','Active/Disactive\x20AMD','#AMD\x20Initial\x20Silence','#AMD\x20Greeting','#AMD\x20After\x20Greeting\x20Silence','#AMD\x20Total\x20Analysis\x20Time','#AMD\x20Min\x20Word\x20Length','#AMD\x20Maximum\x20Number\x20Of\x20Words','#AMD\x20Maximum\x20Word\x20Length','ASC','Random\x20Last\x20Digit\x20(min:1,\x20max:15)','#NoSuchNumber\x20Retry\x20(min:1,\x20max:999)','NoSuchNumber\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Drop\x20Retry\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)','sequelize','exports','name','ENUM','ivr','BOOLEAN','Active/Disactive\x20Campaign','Max\x20200\x20calls.','STRING','UNSIGNED','#Congestion\x20Retry\x20(min:1,\x20max:999)','INTEGER','Congestion\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Busy\x20Retry\x20(min:1,\x20max:999)'];(function(_0x34a9d4,_0x8839c8){var _0x35f05c=function(_0x534b30){while(--_0x534b30){_0x34a9d4['push'](_0x34a9d4['shift']());}};_0x35f05c(++_0x8839c8);}(_0x0055,0x1ed));var _0x5005=function(_0x2656e0,_0x2d9a12){_0x2656e0=_0x2656e0-0x0;var _0x10fe8c=_0x0055[_0x2656e0];return _0x10fe8c;};'use strict';var Sequelize=require(_0x5005('0x0'));module[_0x5005('0x1')]={'name':{'type':Sequelize['STRING'],'unique':_0x5005('0x2'),'allowNull':![],'validate':{'is':/[A-Za-z0-9._\\+*!-]+/,'notEmpty':!![]}},'type':{'type':Sequelize[_0x5005('0x3')](_0x5005('0x4')),'allowNull':![],'defaultValue':_0x5005('0x4')},'description':{'type':Sequelize['STRING']},'active':{'type':Sequelize[_0x5005('0x5')],'defaultValue':0x0,'comment':_0x5005('0x6')},'limitCalls':{'type':Sequelize['INTEGER'](0x4)['UNSIGNED'],'defaultValue':0x1e,'validate':{'min':0x1,'max':0xc8},'comment':_0x5005('0x7')},'dialOriginateCallerIdName':{'type':Sequelize[_0x5005('0x8')]},'dialOriginateCallerIdNumber':{'type':Sequelize[_0x5005('0x8')]},'dialOriginateTimeout':{'type':Sequelize['INTEGER'](0x3)[_0x5005('0x9')],'defaultValue':0x1e,'validate':{'min':0x1,'max':0x3e7},'comment':'Originate\x20Timeout\x20Seconds\x20(min:1,\x20max:999)'},'dialCongestionMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0x5005('0x9')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x5005('0xa')},'dialCongestionRetryFrequency':{'type':Sequelize[_0x5005('0xb')](0x5)[_0x5005('0x9')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x5005('0xc')},'dialBusyMaxRetry':{'type':Sequelize[_0x5005('0xb')](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x5005('0xd')},'dialBusyRetryFrequency':{'type':Sequelize['INTEGER'](0x5)[_0x5005('0x9')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x5005('0xe')},'dialNoAnswerMaxRetry':{'type':Sequelize['INTEGER'](0x3)['UNSIGNED'],'defaultValue':0x3,'comment':_0x5005('0xf')},'dialNoAnswerRetryFrequency':{'type':Sequelize[_0x5005('0xb')](0x5)[_0x5005('0x9')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x5005('0x10')},'dialGlobalMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0x5005('0x9')],'validate':{'min':0x1,'max':0x3e7},'defaultValue':0x4,'comment':_0x5005('0x11')},'dialTimezone':{'type':Sequelize[_0x5005('0x8')],'defaultValue':null},'dialGlobalInterval':{'type':Sequelize[_0x5005('0x8')],'defaultValue':'07:00-22:00,*,*,*'},'dialCheckDuplicateType':{'type':Sequelize['ENUM'](_0x5005('0x12'),_0x5005('0x13'),'onlyIfOpen'),'defaultValue':_0x5005('0x12')},'dialAMDActive':{'type':Sequelize[_0x5005('0x5')],'defaultValue':0x0,'comment':_0x5005('0x14')},'dialAMDInitialSilence':{'type':Sequelize[_0x5005('0xb')](0x9)['UNSIGNED'],'defaultValue':0x9c4,'validate':{'min':0x0},'comment':_0x5005('0x15')},'dialAMDGreeting':{'type':Sequelize[_0x5005('0xb')](0x9)[_0x5005('0x9')],'defaultValue':0x5dc,'validate':{'min':0x0},'comment':_0x5005('0x16')},'dialAMDAfterGreetingSilence':{'type':Sequelize[_0x5005('0xb')](0x9)['UNSIGNED'],'defaultValue':0x320,'validate':{'min':0x0},'comment':_0x5005('0x17')},'dialAMDTotalAnalysisTime':{'type':Sequelize['INTEGER'](0x9)[_0x5005('0x9')],'defaultValue':0x1388,'validate':{'min':0x0},'comment':_0x5005('0x18')},'dialAMDMinWordLength':{'type':Sequelize[_0x5005('0xb')](0x9)[_0x5005('0x9')],'defaultValue':0x64,'validate':{'min':0x0},'comment':_0x5005('0x19')},'dialAMDBetweenWordsSilence':{'type':Sequelize[_0x5005('0xb')](0x9)[_0x5005('0x9')],'defaultValue':0x32,'validate':{'min':0x0},'comment':'#AMD\x20Between\x20Words\x20Silence'},'dialAMDMaximumNumberOfWords':{'type':Sequelize[_0x5005('0xb')](0x9)[_0x5005('0x9')],'defaultValue':0x3,'validate':{'min':0x0},'comment':_0x5005('0x1a')},'dialAMDSilenceThreshold':{'type':Sequelize[_0x5005('0xb')](0x5)[_0x5005('0x9')],'validate':{'min':0x0,'max':0x7fff},'defaultValue':0x100,'comment':'#AMD\x20Silence\x20Threshold\x20(min:0,\x20max:32767)'},'dialAMDMaximumWordLength':{'type':Sequelize[_0x5005('0xb')](0x9)[_0x5005('0x9')],'defaultValue':0x1388,'validate':{'min':0x0},'comment':_0x5005('0x1b')},'dialOrderByScheduledAt':{'type':Sequelize[_0x5005('0x3')]('DESC',_0x5005('0x1c')),'defaultValue':'DESC'},'dialPrefix':{'type':Sequelize[_0x5005('0x8')],'defaultValue':null},'dialRandomLastDigitCallerIdNumber':{'type':Sequelize[_0x5005('0xb')](0x3)['UNSIGNED'],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':_0x5005('0x1d')},'dialCutDigit':{'type':Sequelize[_0x5005('0xb')](0x3)[_0x5005('0x9')],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':'Cut\x20Digit\x20(min:1,\x20max:15)'},'dialNoSuchNumberMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0x5005('0x9')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x5005('0x1e')},'dialNoSuchNumberRetryFrequency':{'type':Sequelize['INTEGER'](0x5)[_0x5005('0x9')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x5005('0x1f')},'dialDropMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0x5005('0x9')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x5005('0x20')},'dialDropRetryFrequency':{'type':Sequelize['INTEGER'](0x5)[_0x5005('0x9')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'Drop\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialAbandonedMaxRetry':{'type':Sequelize[_0x5005('0xb')](0x3)[_0x5005('0x9')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x5005('0x21')},'dialAbandonedRetryFrequency':{'type':Sequelize[_0x5005('0xb')](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x5005('0x22')},'dialMachineMaxRetry':{'type':Sequelize[_0x5005('0xb')](0x3)[_0x5005('0x9')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x5005('0x23')},'dialMachineRetryFrequency':{'type':Sequelize[_0x5005('0xb')](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x5005('0x24')},'dialAgentRejectMaxRetry':{'type':Sequelize[_0x5005('0xb')](0x3)[_0x5005('0x9')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x5005('0x25')},'dialAgentRejectRetryFrequency':{'type':Sequelize['INTEGER'](0x5)[_0x5005('0x9')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x5005('0x26')}};
\ No newline at end of file
+var _0x7425=['UNSIGNED','Max\x20200\x20calls.','#Congestion\x20Retry\x20(min:1,\x20max:999)','Congestion\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','Busy\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#NoAnswer\x20Retry\x20(min:1,\x20max:999)','NoAnswer\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Global\x20Max\x20Retry\x20(min:1,\x20max:999)','07:00-22:00,*,*,*','never','onlyIfOpen','always','BOOLEAN','#AMD\x20Initial\x20Silence','#AMD\x20Greeting','#AMD\x20After\x20Greeting\x20Silence','#AMD\x20Total\x20Analysis\x20Time','#AMD\x20Min\x20Word\x20Length','#AMD\x20Between\x20Words\x20Silence','#AMD\x20Maximum\x20Number\x20Of\x20Words','#AMD\x20Silence\x20Threshold\x20(min:0,\x20max:32767)','#AMD\x20Maximum\x20Word\x20Length','ASC','DESC','Cut\x20Digit\x20(min:1,\x20max:15)','#NoSuchNumber\x20Retry\x20(min:1,\x20max:999)','NoSuchNumber\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Drop\x20Retry\x20(min:1,\x20max:999)','Abandoned\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Machine\x20Retry\x20(min:1,\x20max:999)','Machine\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#AgentReject\x20Retry\x20(min:1,\x20max:999)','AgentReject\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','sequelize','exports','STRING','ENUM','ivr','INTEGER'];(function(_0x45bf86,_0x75586e){var _0x1f02b7=function(_0x1ea8a3){while(--_0x1ea8a3){_0x45bf86['push'](_0x45bf86['shift']());}};_0x1f02b7(++_0x75586e);}(_0x7425,0x10b));var _0x5742=function(_0x338378,_0x14c014){_0x338378=_0x338378-0x0;var _0x395bf7=_0x7425[_0x338378];return _0x395bf7;};'use strict';var Sequelize=require(_0x5742('0x0'));module[_0x5742('0x1')]={'name':{'type':Sequelize[_0x5742('0x2')],'unique':'name','allowNull':![],'validate':{'is':/[A-Za-z0-9._\\+*!-]+/,'notEmpty':!![]}},'type':{'type':Sequelize[_0x5742('0x3')](_0x5742('0x4')),'allowNull':![],'defaultValue':'ivr'},'description':{'type':Sequelize[_0x5742('0x2')]},'active':{'type':Sequelize['BOOLEAN'],'defaultValue':0x0,'comment':'Active/Disactive\x20Campaign'},'limitCalls':{'type':Sequelize[_0x5742('0x5')](0x4)[_0x5742('0x6')],'defaultValue':0x1e,'validate':{'min':0x1,'max':0xc8},'comment':_0x5742('0x7')},'dialOriginateCallerIdName':{'type':Sequelize['STRING']},'dialOriginateCallerIdNumber':{'type':Sequelize[_0x5742('0x2')]},'dialOriginateTimeout':{'type':Sequelize[_0x5742('0x5')](0x3)['UNSIGNED'],'defaultValue':0x1e,'validate':{'min':0x1,'max':0x3e7},'comment':'Originate\x20Timeout\x20Seconds\x20(min:1,\x20max:999)'},'dialCongestionMaxRetry':{'type':Sequelize[_0x5742('0x5')](0x3)[_0x5742('0x6')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x5742('0x8')},'dialCongestionRetryFrequency':{'type':Sequelize[_0x5742('0x5')](0x5)[_0x5742('0x6')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x5742('0x9')},'dialBusyMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0x5742('0x6')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#Busy\x20Retry\x20(min:1,\x20max:999)'},'dialBusyRetryFrequency':{'type':Sequelize['INTEGER'](0x5)[_0x5742('0x6')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x5742('0xa')},'dialNoAnswerMaxRetry':{'type':Sequelize['INTEGER'](0x3)['UNSIGNED'],'defaultValue':0x3,'comment':_0x5742('0xb')},'dialNoAnswerRetryFrequency':{'type':Sequelize[_0x5742('0x5')](0x5)[_0x5742('0x6')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x5742('0xc')},'dialGlobalMaxRetry':{'type':Sequelize[_0x5742('0x5')](0x3)['UNSIGNED'],'validate':{'min':0x1,'max':0x3e7},'defaultValue':0x4,'comment':_0x5742('0xd')},'dialTimezone':{'type':Sequelize['STRING'],'defaultValue':null},'dialGlobalInterval':{'type':Sequelize['STRING'],'defaultValue':_0x5742('0xe')},'dialCheckDuplicateType':{'type':Sequelize[_0x5742('0x3')]('always',_0x5742('0xf'),_0x5742('0x10')),'defaultValue':_0x5742('0x11')},'dialAMDActive':{'type':Sequelize[_0x5742('0x12')],'defaultValue':0x0,'comment':'Active/Disactive\x20AMD'},'dialAMDInitialSilence':{'type':Sequelize['INTEGER'](0x9)[_0x5742('0x6')],'defaultValue':0x9c4,'validate':{'min':0x0},'comment':_0x5742('0x13')},'dialAMDGreeting':{'type':Sequelize[_0x5742('0x5')](0x9)[_0x5742('0x6')],'defaultValue':0x5dc,'validate':{'min':0x0},'comment':_0x5742('0x14')},'dialAMDAfterGreetingSilence':{'type':Sequelize[_0x5742('0x5')](0x9)[_0x5742('0x6')],'defaultValue':0x320,'validate':{'min':0x0},'comment':_0x5742('0x15')},'dialAMDTotalAnalysisTime':{'type':Sequelize['INTEGER'](0x9)[_0x5742('0x6')],'defaultValue':0x1388,'validate':{'min':0x0},'comment':_0x5742('0x16')},'dialAMDMinWordLength':{'type':Sequelize['INTEGER'](0x9)[_0x5742('0x6')],'defaultValue':0x64,'validate':{'min':0x0},'comment':_0x5742('0x17')},'dialAMDBetweenWordsSilence':{'type':Sequelize['INTEGER'](0x9)[_0x5742('0x6')],'defaultValue':0x32,'validate':{'min':0x0},'comment':_0x5742('0x18')},'dialAMDMaximumNumberOfWords':{'type':Sequelize[_0x5742('0x5')](0x9)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x0},'comment':_0x5742('0x19')},'dialAMDSilenceThreshold':{'type':Sequelize[_0x5742('0x5')](0x5)[_0x5742('0x6')],'validate':{'min':0x0,'max':0x7fff},'defaultValue':0x100,'comment':_0x5742('0x1a')},'dialAMDMaximumWordLength':{'type':Sequelize[_0x5742('0x5')](0x9)['UNSIGNED'],'defaultValue':0x1388,'validate':{'min':0x0},'comment':_0x5742('0x1b')},'dialOrderByScheduledAt':{'type':Sequelize[_0x5742('0x3')]('DESC',_0x5742('0x1c')),'defaultValue':_0x5742('0x1d')},'dialPrefix':{'type':Sequelize['STRING'],'defaultValue':null},'dialRandomLastDigitCallerIdNumber':{'type':Sequelize['INTEGER'](0x3)['UNSIGNED'],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':'Random\x20Last\x20Digit\x20(min:1,\x20max:15)'},'dialCutDigit':{'type':Sequelize['INTEGER'](0x3)[_0x5742('0x6')],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':_0x5742('0x1e')},'dialNoSuchNumberMaxRetry':{'type':Sequelize[_0x5742('0x5')](0x3)[_0x5742('0x6')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x5742('0x1f')},'dialNoSuchNumberRetryFrequency':{'type':Sequelize[_0x5742('0x5')](0x5)[_0x5742('0x6')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x5742('0x20')},'dialDropMaxRetry':{'type':Sequelize[_0x5742('0x5')](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x5742('0x21')},'dialDropRetryFrequency':{'type':Sequelize[_0x5742('0x5')](0x5)[_0x5742('0x6')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'Drop\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialAbandonedMaxRetry':{'type':Sequelize[_0x5742('0x5')](0x3)[_0x5742('0x6')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#Abandoned\x20Retry\x20(min:1,\x20max:999)'},'dialAbandonedRetryFrequency':{'type':Sequelize[_0x5742('0x5')](0x5)[_0x5742('0x6')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x5742('0x22')},'dialMachineMaxRetry':{'type':Sequelize['INTEGER'](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x5742('0x23')},'dialMachineRetryFrequency':{'type':Sequelize[_0x5742('0x5')](0x5)[_0x5742('0x6')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x5742('0x24')},'dialAgentRejectMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0x5742('0x6')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x5742('0x25')},'dialAgentRejectRetryFrequency':{'type':Sequelize[_0x5742('0x5')](0x5)[_0x5742('0x6')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x5742('0x26')}};
\ No newline at end of file
diff --git a/server/api/campaign/campaign.controller.js b/server/api/campaign/campaign.controller.js
index c13372b..60e2821 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 _0x8978=['h.createdAt\x20=\x20?','push','sequelize','all','removeLists','ids','getBlackLists','addBlackLists','cm_hopper_black','removeBlackLists','zip-dir','request-promise','bluebird','mustache','util','path','sox','ejs','fs-extra','squel','crypto','jsforce','to-csv','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','json','offset','undefined','limit','set','Content-Range','apply','reject','save','update','then','destroy','get','IvrCampaigns','UserProfileResource','stack','name','send','index','map','Campaign','fieldName','type','key','model','query','keys','intersection','attributes','fields','length','nolimit','order','sort','where','filters','merge','VIRTUAL','count','includeAll','include','findAll','rows','catch','show','params','rawAttributes','options','find','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','clone','omit','createdAt','body','updatedAt','error','getHoppers','CmHopper','pick','CampaignId','filter','getHopperHistories','findOne','CmHopperHistory','getHopperFinals','CmHopperFinal','hasOwnProperty','CmHopperBlack','getLists','CmList','format','YYYY-MM-DD\x20HH:mm:ss','spread','dialCheckDuplicateType','always','into','fromQuery','phone','ContactId','ListId','field','NOW()','scheduledAt','CmListId','toString','from','cm_contacts','deletedAt\x20IS\x20NULL','phone\x20NOT\x20IN\x20(?)','select','COALESCE(calleridnum,\x27\x27)','cm_hopper_final','CampaignId\x20=\x20?','COALESCE(phone,\x27\x27)','onlyIfOpen','insert','cm_hopper','ListId\x20=\x20?','phone\x20IS\x20NOT\x20NULL','cm_hopper_additional_phones','h.id','ci.item','ci.OrderBY','OrderBy','cm_contact_has_items','join','h.ContactId\x20=\x20ci.CmContactId','h.CampaignId=?'];(function(_0x13da85,_0x1fd5b5){var _0x54be2c=function(_0x31faaa){while(--_0x31faaa){_0x13da85['push'](_0x13da85['shift']());}};_0x54be2c(++_0x1fd5b5);}(_0x8978,0x1cc));var _0x8897=function(_0x5c351c,_0x2046d8){_0x5c351c=_0x5c351c-0x0;var _0x26f3b3=_0x8978[_0x5c351c];return _0x26f3b3;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x8897('0x0'));var jsonpatch=require('fast-json-patch');var rp=require(_0x8897('0x1'));var moment=require('moment');var BPromise=require(_0x8897('0x2'));var Mustache=require(_0x8897('0x3'));var util=require(_0x8897('0x4'));var path=require(_0x8897('0x5'));var sox=require(_0x8897('0x6'));var csv=require('to-csv');var ejs=require(_0x8897('0x7'));var fs=require('fs');var fs_extra=require(_0x8897('0x8'));var _=require('lodash');var squel=require(_0x8897('0x9'));var crypto=require(_0x8897('0xa'));var jsforce=require(_0x8897('0xb'));var deskjs=require('desk.js');var toCsv=require(_0x8897('0xc'));var querystring=require('querystring');var Papa=require(_0x8897('0xd'));var Redis=require('ioredis');var authService=require(_0x8897('0xe'));var qs=require(_0x8897('0xf'));var as=require(_0x8897('0x10'));var hardwareService=require(_0x8897('0x11'));var logger=require('../../config/logger')(_0x8897('0x12'));var utils=require(_0x8897('0x13'));var config=require(_0x8897('0x14'));var licenseUtil=require(_0x8897('0x15'));var db=require(_0x8897('0x16'))['db'];function respondWithStatusCode(_0xd9bb97,_0x294348){_0x294348=_0x294348||0xcc;return function(_0x487eae){if(_0x487eae){return _0xd9bb97[_0x8897('0x17')](_0x294348);}return _0xd9bb97['status'](_0x294348)['end']();};}function respondWithResult(_0x550559,_0x4a5070){_0x4a5070=_0x4a5070||0xc8;return function(_0x490a9a){if(_0x490a9a){return _0x550559[_0x8897('0x18')](_0x4a5070)[_0x8897('0x19')](_0x490a9a);}};}function respondWithFilteredResult(_0x3cc0e9,_0x14383b){return function(_0x2528e3){if(_0x2528e3){var _0x28e689=typeof _0x14383b[_0x8897('0x1a')]===_0x8897('0x1b')&&typeof _0x14383b[_0x8897('0x1c')]==='undefined';var _0x5044dc=_0x2528e3['count'];var _0x3603a8=_0x28e689?0x0:_0x14383b['offset'];var _0x44fa9f=_0x28e689?_0x2528e3['count']:_0x14383b['offset']+_0x14383b[_0x8897('0x1c')];var _0x5d0353;if(_0x44fa9f>=_0x5044dc){_0x44fa9f=_0x5044dc;_0x5d0353=0xc8;}else{_0x5d0353=0xce;}_0x3cc0e9[_0x8897('0x18')](_0x5d0353);return _0x3cc0e9[_0x8897('0x1d')](_0x8897('0x1e'),_0x3603a8+'-'+_0x44fa9f+'/'+_0x5044dc)['json'](_0x2528e3);}return null;};}function patchUpdates(_0x72b5b3){return function(_0x9139a7){try{jsonpatch[_0x8897('0x1f')](_0x9139a7,_0x72b5b3,!![]);}catch(_0x27ba89){return BPromise[_0x8897('0x20')](_0x27ba89);}return _0x9139a7[_0x8897('0x21')]();};}function saveUpdates(_0x5d81c1,_0x2bf87d){return function(_0x70b9f9){if(_0x70b9f9){return _0x70b9f9[_0x8897('0x22')](_0x5d81c1)[_0x8897('0x23')](function(_0x4d329c){return _0x4d329c;});}return null;};}function removeEntity(_0x42f426,_0x3aa1d1){return function(_0x328c88){if(_0x328c88){return _0x328c88[_0x8897('0x24')]()['then'](function(){var _0x2bd4c3=_0x328c88[_0x8897('0x25')]({'plain':!![]});var _0x2816f2=_0x8897('0x26');return db[_0x8897('0x27')]['destroy']({'where':{'type':_0x2816f2,'resourceId':_0x2bd4c3['id']}})[_0x8897('0x23')](function(){return _0x328c88;});})[_0x8897('0x23')](function(){_0x42f426[_0x8897('0x18')](0xcc)['end']();});}};}function handleEntityNotFound(_0x55bfa4,_0x190e5c){return function(_0x52fb49){if(!_0x52fb49){_0x55bfa4[_0x8897('0x17')](0x194);}return _0x52fb49;};}function handleError(_0xdc1a23,_0x1773a3){_0x1773a3=_0x1773a3||0x1f4;return function(_0x37e290){logger['error'](_0x37e290[_0x8897('0x28')]);if(_0x37e290[_0x8897('0x29')]){delete _0x37e290[_0x8897('0x29')];}_0xdc1a23[_0x8897('0x18')](_0x1773a3)[_0x8897('0x2a')](_0x37e290);};}exports[_0x8897('0x2b')]=function(_0x2190b6,_0x1915ec){var _0x5a3f6e={},_0xbf004c={},_0x548896={'count':0x0,'rows':[]};var _0x216b0c=_[_0x8897('0x2c')](db[_0x8897('0x2d')]['rawAttributes'],function(_0x3bb20e){return{'name':_0x3bb20e[_0x8897('0x2e')],'type':_0x3bb20e[_0x8897('0x2f')][_0x8897('0x30')]};});_0xbf004c[_0x8897('0x31')]=_[_0x8897('0x2c')](_0x216b0c,_0x8897('0x29'));_0xbf004c[_0x8897('0x32')]=_[_0x8897('0x33')](_0x2190b6[_0x8897('0x32')]);_0xbf004c['filters']=_[_0x8897('0x34')](_0xbf004c[_0x8897('0x31')],_0xbf004c[_0x8897('0x32')]);_0x5a3f6e[_0x8897('0x35')]=_[_0x8897('0x34')](_0xbf004c[_0x8897('0x31')],qs['fields'](_0x2190b6[_0x8897('0x32')][_0x8897('0x36')]));_0x5a3f6e[_0x8897('0x35')]=_0x5a3f6e[_0x8897('0x35')][_0x8897('0x37')]?_0x5a3f6e['attributes']:_0xbf004c[_0x8897('0x31')];if(!_0x2190b6['query']['hasOwnProperty'](_0x8897('0x38'))){_0x5a3f6e[_0x8897('0x1c')]=qs['limit'](_0x2190b6[_0x8897('0x32')][_0x8897('0x1c')]);_0x5a3f6e[_0x8897('0x1a')]=qs['offset'](_0x2190b6[_0x8897('0x32')][_0x8897('0x1a')]);}_0x5a3f6e[_0x8897('0x39')]=qs[_0x8897('0x3a')](_0x2190b6[_0x8897('0x32')]['sort']);_0x5a3f6e[_0x8897('0x3b')]=qs[_0x8897('0x3c')](_['pick'](_0x2190b6['query'],_0xbf004c['filters']),_0x216b0c);if(_0x2190b6['query']['filter']){_0x5a3f6e[_0x8897('0x3b')]=_[_0x8897('0x3d')](_0x5a3f6e['where'],{'$or':_[_0x8897('0x2c')](_0x216b0c,function(_0x8e6377){if(_0x8e6377['type']!==_0x8897('0x3e')){var _0x48eb00={};_0x48eb00[_0x8e6377[_0x8897('0x29')]]={'$like':'%'+_0x2190b6[_0x8897('0x32')]['filter']+'%'};return _0x48eb00;}})});}_0x5a3f6e=_[_0x8897('0x3d')]({},_0x5a3f6e,_0x2190b6['options']);var _0xe763a3={'where':_0x5a3f6e[_0x8897('0x3b')]};return db[_0x8897('0x2d')]['count'](_0xe763a3)[_0x8897('0x23')](function(_0x5028dc){_0x548896[_0x8897('0x3f')]=_0x5028dc;if(_0x2190b6[_0x8897('0x32')][_0x8897('0x40')]){_0x5a3f6e[_0x8897('0x41')]=[{'all':!![]}];}return db[_0x8897('0x2d')][_0x8897('0x42')](_0x5a3f6e);})['then'](function(_0x24a72b){_0x548896[_0x8897('0x43')]=_0x24a72b;return _0x548896;})[_0x8897('0x23')](respondWithFilteredResult(_0x1915ec,_0x5a3f6e))[_0x8897('0x44')](handleError(_0x1915ec,null));};exports[_0x8897('0x45')]=function(_0x14ac70,_0x5478e0){var _0x2c35d5={'raw':![],'where':{'id':_0x14ac70[_0x8897('0x46')]['id']}},_0x335f6b={};_0x335f6b[_0x8897('0x31')]=_[_0x8897('0x33')](db[_0x8897('0x2d')][_0x8897('0x47')]);_0x335f6b[_0x8897('0x32')]=_[_0x8897('0x33')](_0x14ac70[_0x8897('0x32')]);_0x335f6b[_0x8897('0x3c')]=_[_0x8897('0x34')](_0x335f6b[_0x8897('0x31')],_0x335f6b['query']);_0x2c35d5[_0x8897('0x35')]=_[_0x8897('0x34')](_0x335f6b[_0x8897('0x31')],qs[_0x8897('0x36')](_0x14ac70['query'][_0x8897('0x36')]));_0x2c35d5[_0x8897('0x35')]=_0x2c35d5[_0x8897('0x35')][_0x8897('0x37')]?_0x2c35d5[_0x8897('0x35')]:_0x335f6b['model'];if(_0x14ac70[_0x8897('0x32')]['includeAll']){_0x2c35d5[_0x8897('0x41')]=[{'all':!![]}];}_0x2c35d5=_[_0x8897('0x3d')]({},_0x2c35d5,_0x14ac70[_0x8897('0x48')]);return db[_0x8897('0x2d')][_0x8897('0x49')](_0x2c35d5)[_0x8897('0x23')](handleEntityNotFound(_0x5478e0,null))[_0x8897('0x23')](respondWithResult(_0x5478e0,null))[_0x8897('0x44')](handleError(_0x5478e0,null));};exports[_0x8897('0x4a')]=function(_0x1d753f,_0x1daa1d){return db[_0x8897('0x2d')][_0x8897('0x4a')](_0x1d753f['body'],{})['then'](function(_0xba406c){var _0x2ee5cc=_0x1d753f[_0x8897('0x4b')]['get']({'plain':!![]});if(!_0x2ee5cc)throw new Error(_0x8897('0x4c'));if(_0x2ee5cc[_0x8897('0x4d')]===_0x8897('0x4b')){var _0x3e8001=_0xba406c['get']({'plain':!![]});var _0x4312aa=_0x8897('0x26');return db[_0x8897('0x4e')][_0x8897('0x49')]({'where':{'name':_0x4312aa,'userProfileId':_0x2ee5cc[_0x8897('0x4f')]},'raw':!![]})[_0x8897('0x23')](function(_0x22f3e2){if(_0x22f3e2&&_0x22f3e2[_0x8897('0x50')]===0x0){return db[_0x8897('0x27')][_0x8897('0x4a')]({'name':_0x3e8001[_0x8897('0x29')],'resourceId':_0x3e8001['id'],'type':_0x22f3e2[_0x8897('0x29')],'sectionId':_0x22f3e2['id']},{})[_0x8897('0x23')](function(){return _0xba406c;});}else{return _0xba406c;}})[_0x8897('0x44')](function(_0x47487a){logger['error'](_0x8897('0x51'),_0x47487a);throw _0x47487a;});}return _0xba406c;})[_0x8897('0x23')](respondWithResult(_0x1daa1d,0xc9))[_0x8897('0x44')](handleError(_0x1daa1d,null));};exports[_0x8897('0x52')]=function(_0x47b8dc,_0xf63a2b){var _0x1f3ea8={'where':{'id':_0x47b8dc[_0x8897('0x46')]['id']}},_0x3cc500={};_0x3cc500[_0x8897('0x31')]=_[_0x8897('0x33')](db[_0x8897('0x2d')]['rawAttributes']);_0x1f3ea8['attributes']=_[_0x8897('0x34')](_0x3cc500[_0x8897('0x31')],qs[_0x8897('0x36')](_0x47b8dc[_0x8897('0x32')][_0x8897('0x36')]));_0x1f3ea8[_0x8897('0x35')]=_0x1f3ea8[_0x8897('0x35')][_0x8897('0x37')]?_0x1f3ea8['attributes']:_0x3cc500[_0x8897('0x31')];if(_0x47b8dc[_0x8897('0x32')]['includeAll']){_0x1f3ea8['include']=[{'all':!![]}];}_0x1f3ea8=_['merge']({},_0x1f3ea8,_0x47b8dc['options']);return db['Campaign'][_0x8897('0x49')](_0x1f3ea8)[_0x8897('0x23')](handleEntityNotFound(_0xf63a2b,null))[_0x8897('0x23')](function(_0x7066da){if(_0x7066da){var _0x29400e=_0x7066da['get']({'plain':!![]});_0x29400e=qs[_0x8897('0x53')](_0x29400e,['id',_0x8897('0x54'),'updatedAt']);_0x47b8dc[_0x8897('0x55')]=_['omit'](_0x47b8dc[_0x8897('0x55')],['id',_0x8897('0x54'),_0x8897('0x56')]);return db['Campaign'][_0x8897('0x4a')](_[_0x8897('0x3d')](_0x29400e,_0x47b8dc[_0x8897('0x55')]),{'include':_0x47b8dc[_0x8897('0x32')][_0x8897('0x40')]?[{'all':!![]}]:undefined})['then'](function(_0x3b5dbd){var _0x541260=_0x47b8dc[_0x8897('0x4b')][_0x8897('0x25')]({'plain':!![]});if(!_0x541260)throw new Error(_0x8897('0x4c'));if(_0x541260[_0x8897('0x4d')]===_0x8897('0x4b')){var _0x3af18a=_0x3b5dbd[_0x8897('0x25')]({'plain':!![]});var _0x45cf0d=_0x8897('0x26');return db[_0x8897('0x4e')]['find']({'where':{'name':_0x45cf0d,'userProfileId':_0x541260[_0x8897('0x4f')]},'raw':!![]})[_0x8897('0x23')](function(_0xa46650){if(_0xa46650&&_0xa46650['autoAssociation']===0x0){return db[_0x8897('0x27')][_0x8897('0x4a')]({'name':_0x3af18a[_0x8897('0x29')],'resourceId':_0x3af18a['id'],'type':_0xa46650[_0x8897('0x29')],'sectionId':_0xa46650['id']},{})[_0x8897('0x23')](function(){return _0x3b5dbd;});}else{return _0x3b5dbd;}})[_0x8897('0x44')](function(_0x10c7e2){logger[_0x8897('0x57')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x10c7e2);throw _0x10c7e2;});}return _0x3b5dbd;});}})[_0x8897('0x23')](respondWithResult(_0xf63a2b,0xc9))[_0x8897('0x44')](handleError(_0xf63a2b,null));};exports[_0x8897('0x22')]=function(_0x544d2a,_0x29a02c){if(_0x544d2a[_0x8897('0x55')]['id']){delete _0x544d2a[_0x8897('0x55')]['id'];}return db['Campaign'][_0x8897('0x49')]({'where':{'id':_0x544d2a[_0x8897('0x46')]['id']}})['then'](handleEntityNotFound(_0x29a02c,null))['then'](saveUpdates(_0x544d2a[_0x8897('0x55')],null))[_0x8897('0x23')](respondWithResult(_0x29a02c,null))[_0x8897('0x44')](handleError(_0x29a02c,null));};exports[_0x8897('0x24')]=function(_0x8b2e6,_0xcc0bd3){return db[_0x8897('0x2d')][_0x8897('0x49')]({'where':{'id':_0x8b2e6[_0x8897('0x46')]['id']}})[_0x8897('0x23')](handleEntityNotFound(_0xcc0bd3,null))[_0x8897('0x23')](removeEntity(_0xcc0bd3,null))['catch'](handleError(_0xcc0bd3,null));};exports[_0x8897('0x58')]=function(_0x57fca5,_0x52141a,_0x4218e3){var _0xd0c2b7={'raw':!![],'where':{}};var _0x352fcb={};var _0x2a051c={'count':0x0,'rows':[]};return db[_0x8897('0x2d')]['findOne']({'where':{'id':_0x57fca5[_0x8897('0x46')]['id']}})[_0x8897('0x23')](handleEntityNotFound(_0x52141a,null))[_0x8897('0x23')](function(_0x4554b9){if(_0x4554b9){_0x352fcb[_0x8897('0x31')]=_[_0x8897('0x33')](db[_0x8897('0x59')][_0x8897('0x47')]);_0x352fcb['query']=_[_0x8897('0x33')](_0x57fca5['query']);_0x352fcb['filters']=_['intersection'](_0x352fcb[_0x8897('0x31')],_0x352fcb[_0x8897('0x32')]);_0xd0c2b7[_0x8897('0x35')]=_['intersection'](_0x352fcb['model'],qs[_0x8897('0x36')](_0x57fca5[_0x8897('0x32')][_0x8897('0x36')]));_0xd0c2b7['attributes']=_0xd0c2b7[_0x8897('0x35')]['length']?_0xd0c2b7[_0x8897('0x35')]:_0x352fcb['model'];if(!_0x57fca5[_0x8897('0x32')]['hasOwnProperty'](_0x8897('0x38'))){_0xd0c2b7['limit']=qs[_0x8897('0x1c')](_0x57fca5[_0x8897('0x32')][_0x8897('0x1c')]);_0xd0c2b7[_0x8897('0x1a')]=qs[_0x8897('0x1a')](_0x57fca5[_0x8897('0x32')]['offset']);}_0xd0c2b7[_0x8897('0x39')]=qs[_0x8897('0x3a')](_0x57fca5[_0x8897('0x32')][_0x8897('0x3a')]);_0xd0c2b7[_0x8897('0x3b')]=qs[_0x8897('0x3c')](_[_0x8897('0x5a')](_0x57fca5[_0x8897('0x32')],_0x352fcb[_0x8897('0x3c')]));_0xd0c2b7[_0x8897('0x3b')][_0x8897('0x5b')]=_0x4554b9['id'];if(_0x57fca5[_0x8897('0x32')]['filter']){_0xd0c2b7[_0x8897('0x3b')]=_['merge'](_0xd0c2b7['where'],{'$or':_[_0x8897('0x2c')](_0xd0c2b7['attributes'],function(_0x4ac2cf){var _0x3a3cc2={};_0x3a3cc2[_0x4ac2cf]={'$like':'%'+_0x57fca5['query'][_0x8897('0x5c')]+'%'};return _0x3a3cc2;})});}_0xd0c2b7=_['merge']({},_0xd0c2b7,_0x57fca5['options']);return db[_0x8897('0x59')]['count']({'where':_0xd0c2b7[_0x8897('0x3b')]})[_0x8897('0x23')](function(_0x10ab07){_0x2a051c['count']=_0x10ab07;if(_0x57fca5[_0x8897('0x32')][_0x8897('0x40')]){_0xd0c2b7['include']=[{'all':!![]}];}return db['CmHopper']['findAll'](_0xd0c2b7);})[_0x8897('0x23')](function(_0x475e82){_0x2a051c[_0x8897('0x43')]=_0x475e82;return _0x2a051c;});}})['then'](respondWithFilteredResult(_0x52141a,_0xd0c2b7))['catch'](handleError(_0x52141a,null));};exports[_0x8897('0x5d')]=function(_0x163045,_0x154ed6,_0x546821){var _0x129cbe={'raw':!![],'where':{}};var _0x273030={};var _0x5e8fc4={'count':0x0,'rows':[]};return db[_0x8897('0x2d')][_0x8897('0x5e')]({'where':{'id':_0x163045[_0x8897('0x46')]['id']}})['then'](handleEntityNotFound(_0x154ed6,null))[_0x8897('0x23')](function(_0x3bebf0){if(_0x3bebf0){_0x273030[_0x8897('0x31')]=_[_0x8897('0x33')](db['CmHopperHistory'][_0x8897('0x47')]);_0x273030['query']=_['keys'](_0x163045['query']);_0x273030['filters']=_['intersection'](_0x273030[_0x8897('0x31')],_0x273030['query']);_0x129cbe[_0x8897('0x35')]=_[_0x8897('0x34')](_0x273030[_0x8897('0x31')],qs[_0x8897('0x36')](_0x163045['query']['fields']));_0x129cbe[_0x8897('0x35')]=_0x129cbe['attributes'][_0x8897('0x37')]?_0x129cbe[_0x8897('0x35')]:_0x273030[_0x8897('0x31')];if(!_0x163045[_0x8897('0x32')]['hasOwnProperty'](_0x8897('0x38'))){_0x129cbe[_0x8897('0x1c')]=qs[_0x8897('0x1c')](_0x163045[_0x8897('0x32')]['limit']);_0x129cbe[_0x8897('0x1a')]=qs[_0x8897('0x1a')](_0x163045[_0x8897('0x32')]['offset']);}_0x129cbe['order']=qs[_0x8897('0x3a')](_0x163045[_0x8897('0x32')][_0x8897('0x3a')]);_0x129cbe[_0x8897('0x3b')]=qs[_0x8897('0x3c')](_[_0x8897('0x5a')](_0x163045[_0x8897('0x32')],_0x273030['filters']));_0x129cbe[_0x8897('0x3b')]['CampaignId']=_0x3bebf0['id'];if(_0x163045[_0x8897('0x32')][_0x8897('0x5c')]){_0x129cbe[_0x8897('0x3b')]=_[_0x8897('0x3d')](_0x129cbe['where'],{'$or':_[_0x8897('0x2c')](_0x129cbe[_0x8897('0x35')],function(_0x4c7e21){var _0x1e08d7={};_0x1e08d7[_0x4c7e21]={'$like':'%'+_0x163045[_0x8897('0x32')][_0x8897('0x5c')]+'%'};return _0x1e08d7;})});}_0x129cbe=_[_0x8897('0x3d')]({},_0x129cbe,_0x163045[_0x8897('0x48')]);return db[_0x8897('0x5f')][_0x8897('0x3f')]({'where':_0x129cbe[_0x8897('0x3b')]})[_0x8897('0x23')](function(_0x4cc314){_0x5e8fc4[_0x8897('0x3f')]=_0x4cc314;if(_0x163045[_0x8897('0x32')]['includeAll']){_0x129cbe[_0x8897('0x41')]=[{'all':!![]}];}return db[_0x8897('0x5f')][_0x8897('0x42')](_0x129cbe);})[_0x8897('0x23')](function(_0x2b095b){_0x5e8fc4[_0x8897('0x43')]=_0x2b095b;return _0x5e8fc4;});}})['then'](respondWithFilteredResult(_0x154ed6,_0x129cbe))[_0x8897('0x44')](handleError(_0x154ed6,null));};exports[_0x8897('0x60')]=function(_0x3f52af,_0x3a46b5,_0x58ae92){var _0x77577e={'raw':!![],'where':{}};var _0x430e52={};var _0x2d153e={'count':0x0,'rows':[]};return db[_0x8897('0x2d')]['findOne']({'where':{'id':_0x3f52af[_0x8897('0x46')]['id']}})[_0x8897('0x23')](handleEntityNotFound(_0x3a46b5,null))[_0x8897('0x23')](function(_0x8a2b5c){if(_0x8a2b5c){_0x430e52[_0x8897('0x31')]=_[_0x8897('0x33')](db[_0x8897('0x61')][_0x8897('0x47')]);_0x430e52[_0x8897('0x32')]=_[_0x8897('0x33')](_0x3f52af[_0x8897('0x32')]);_0x430e52[_0x8897('0x3c')]=_['intersection'](_0x430e52[_0x8897('0x31')],_0x430e52[_0x8897('0x32')]);_0x77577e['attributes']=_[_0x8897('0x34')](_0x430e52['model'],qs[_0x8897('0x36')](_0x3f52af['query'][_0x8897('0x36')]));_0x77577e[_0x8897('0x35')]=_0x77577e[_0x8897('0x35')][_0x8897('0x37')]?_0x77577e[_0x8897('0x35')]:_0x430e52[_0x8897('0x31')];if(!_0x3f52af[_0x8897('0x32')][_0x8897('0x62')](_0x8897('0x38'))){_0x77577e[_0x8897('0x1c')]=qs[_0x8897('0x1c')](_0x3f52af[_0x8897('0x32')][_0x8897('0x1c')]);_0x77577e[_0x8897('0x1a')]=qs[_0x8897('0x1a')](_0x3f52af[_0x8897('0x32')][_0x8897('0x1a')]);}_0x77577e[_0x8897('0x39')]=qs['sort'](_0x3f52af[_0x8897('0x32')]['sort']);_0x77577e[_0x8897('0x3b')]=qs[_0x8897('0x3c')](_[_0x8897('0x5a')](_0x3f52af['query'],_0x430e52[_0x8897('0x3c')]));_0x77577e[_0x8897('0x3b')]['CampaignId']=_0x8a2b5c['id'];if(_0x3f52af[_0x8897('0x32')][_0x8897('0x5c')]){_0x77577e[_0x8897('0x3b')]=_[_0x8897('0x3d')](_0x77577e['where'],{'$or':_['map'](_0x77577e[_0x8897('0x35')],function(_0x6ad77f){var _0x29eca1={};_0x29eca1[_0x6ad77f]={'$like':'%'+_0x3f52af[_0x8897('0x32')][_0x8897('0x5c')]+'%'};return _0x29eca1;})});}_0x77577e=_['merge']({},_0x77577e,_0x3f52af[_0x8897('0x48')]);return db[_0x8897('0x61')][_0x8897('0x3f')]({'where':_0x77577e[_0x8897('0x3b')]})[_0x8897('0x23')](function(_0x2cabf0){_0x2d153e[_0x8897('0x3f')]=_0x2cabf0;if(_0x3f52af[_0x8897('0x32')]['includeAll']){_0x77577e[_0x8897('0x41')]=[{'all':!![]}];}return db[_0x8897('0x61')][_0x8897('0x42')](_0x77577e);})[_0x8897('0x23')](function(_0x427de2){_0x2d153e['rows']=_0x427de2;return _0x2d153e;});}})[_0x8897('0x23')](respondWithFilteredResult(_0x3a46b5,_0x77577e))[_0x8897('0x44')](handleError(_0x3a46b5,null));};exports['getHopperBlacks']=function(_0x36479e,_0x465cd2,_0x489b9d){var _0x4e4de3={'raw':!![],'where':{}};var _0x5b3f22={};var _0x5707ab={'count':0x0,'rows':[]};return db[_0x8897('0x2d')]['findOne']({'where':{'id':_0x36479e[_0x8897('0x46')]['id']}})[_0x8897('0x23')](handleEntityNotFound(_0x465cd2,null))[_0x8897('0x23')](function(_0x29ef59){if(_0x29ef59){_0x5b3f22['model']=_[_0x8897('0x33')](db['CmHopperBlack']['rawAttributes']);_0x5b3f22[_0x8897('0x32')]=_[_0x8897('0x33')](_0x36479e[_0x8897('0x32')]);_0x5b3f22[_0x8897('0x3c')]=_[_0x8897('0x34')](_0x5b3f22['model'],_0x5b3f22['query']);_0x4e4de3[_0x8897('0x35')]=_['intersection'](_0x5b3f22[_0x8897('0x31')],qs[_0x8897('0x36')](_0x36479e[_0x8897('0x32')][_0x8897('0x36')]));_0x4e4de3[_0x8897('0x35')]=_0x4e4de3[_0x8897('0x35')][_0x8897('0x37')]?_0x4e4de3[_0x8897('0x35')]:_0x5b3f22[_0x8897('0x31')];if(!_0x36479e['query'][_0x8897('0x62')](_0x8897('0x38'))){_0x4e4de3[_0x8897('0x1c')]=qs[_0x8897('0x1c')](_0x36479e[_0x8897('0x32')][_0x8897('0x1c')]);_0x4e4de3[_0x8897('0x1a')]=qs[_0x8897('0x1a')](_0x36479e[_0x8897('0x32')][_0x8897('0x1a')]);}_0x4e4de3[_0x8897('0x39')]=qs[_0x8897('0x3a')](_0x36479e['query']['sort']);_0x4e4de3[_0x8897('0x3b')]=qs[_0x8897('0x3c')](_[_0x8897('0x5a')](_0x36479e[_0x8897('0x32')],_0x5b3f22[_0x8897('0x3c')]));_0x4e4de3[_0x8897('0x3b')][_0x8897('0x5b')]=_0x29ef59['id'];if(_0x36479e[_0x8897('0x32')][_0x8897('0x5c')]){_0x4e4de3[_0x8897('0x3b')]=_[_0x8897('0x3d')](_0x4e4de3[_0x8897('0x3b')],{'$or':_[_0x8897('0x2c')](_0x4e4de3[_0x8897('0x35')],function(_0x148da3){var _0x3a93b1={};_0x3a93b1[_0x148da3]={'$like':'%'+_0x36479e[_0x8897('0x32')][_0x8897('0x5c')]+'%'};return _0x3a93b1;})});}_0x4e4de3=_[_0x8897('0x3d')]({},_0x4e4de3,_0x36479e['options']);return db[_0x8897('0x63')][_0x8897('0x3f')]({'where':_0x4e4de3[_0x8897('0x3b')]})[_0x8897('0x23')](function(_0x4dd361){_0x5707ab[_0x8897('0x3f')]=_0x4dd361;if(_0x36479e[_0x8897('0x32')][_0x8897('0x40')]){_0x4e4de3[_0x8897('0x41')]=[{'all':!![]}];}return db[_0x8897('0x63')][_0x8897('0x42')](_0x4e4de3);})[_0x8897('0x23')](function(_0x3e84ef){_0x5707ab['rows']=_0x3e84ef;return _0x5707ab;});}})['then'](respondWithFilteredResult(_0x465cd2,_0x4e4de3))[_0x8897('0x44')](handleError(_0x465cd2,null));};exports[_0x8897('0x64')]=function(_0x5b3b3c,_0x7cf32f,_0x525591){var _0x138a2c={};var _0x1bf8f4={};var _0x543dfc;var _0x3ed31e;return db[_0x8897('0x2d')][_0x8897('0x5e')]({'where':{'id':_0x5b3b3c[_0x8897('0x46')]['id']}})[_0x8897('0x23')](handleEntityNotFound(_0x7cf32f,null))[_0x8897('0x23')](function(_0x1b4c25){if(_0x1b4c25){_0x543dfc=_0x1b4c25;_0x1bf8f4['model']=_[_0x8897('0x33')](db[_0x8897('0x65')]['rawAttributes']);_0x1bf8f4[_0x8897('0x32')]=_[_0x8897('0x33')](_0x5b3b3c[_0x8897('0x32')]);_0x1bf8f4[_0x8897('0x3c')]=_[_0x8897('0x34')](_0x1bf8f4[_0x8897('0x31')],_0x1bf8f4['query']);_0x138a2c[_0x8897('0x35')]=_[_0x8897('0x34')](_0x1bf8f4[_0x8897('0x31')],qs['fields'](_0x5b3b3c[_0x8897('0x32')][_0x8897('0x36')]));_0x138a2c[_0x8897('0x35')]=_0x138a2c[_0x8897('0x35')]['length']?_0x138a2c['attributes']:_0x1bf8f4[_0x8897('0x31')];_0x138a2c[_0x8897('0x39')]=qs[_0x8897('0x3a')](_0x5b3b3c['query']['sort']);_0x138a2c[_0x8897('0x3b')]=qs['filters'](_['pick'](_0x5b3b3c[_0x8897('0x32')],_0x1bf8f4[_0x8897('0x3c')]));if(_0x5b3b3c[_0x8897('0x32')]['filter']){_0x138a2c[_0x8897('0x3b')]=_[_0x8897('0x3d')](_0x138a2c[_0x8897('0x3b')],{'$or':_[_0x8897('0x2c')](_0x138a2c[_0x8897('0x35')],function(_0x2d4008){var _0x55b014={};_0x55b014[_0x2d4008]={'$like':'%'+_0x5b3b3c[_0x8897('0x32')]['filter']+'%'};return _0x55b014;})});}_0x138a2c=_[_0x8897('0x3d')]({},_0x138a2c,_0x5b3b3c[_0x8897('0x48')]);return _0x543dfc[_0x8897('0x64')](_0x138a2c);}})[_0x8897('0x23')](function(_0x499d83){if(_0x499d83){_0x3ed31e=_0x499d83[_0x8897('0x37')];if(!_0x5b3b3c[_0x8897('0x32')]['hasOwnProperty'](_0x8897('0x38'))){_0x138a2c[_0x8897('0x1c')]=qs[_0x8897('0x1c')](_0x5b3b3c['query']['limit']);_0x138a2c[_0x8897('0x1a')]=qs[_0x8897('0x1a')](_0x5b3b3c[_0x8897('0x32')][_0x8897('0x1a')]);}return _0x543dfc[_0x8897('0x64')](_0x138a2c);}})[_0x8897('0x23')](function(_0x441d9e){if(_0x441d9e){return _0x441d9e?{'count':_0x3ed31e,'rows':_0x441d9e}:null;}})[_0x8897('0x23')](respondWithResult(_0x7cf32f,null))['catch'](handleError(_0x7cf32f,null));};exports['addLists']=function(_0x40b13f,_0x4d9c0b,_0x1027b6){var _0x277c68,_0x2db80f;var _0x2f708f=[];var _0x1b7c82=moment()[_0x8897('0x66')](_0x8897('0x67'));return db['Campaign']['find']({'where':{'id':_0x40b13f[_0x8897('0x46')]['id']}})[_0x8897('0x23')](handleEntityNotFound(_0x4d9c0b,null))[_0x8897('0x23')](function(_0x2866f9){if(_0x2866f9){_0x2db80f=_0x2866f9;return _0x2866f9['addLists'](_0x40b13f[_0x8897('0x55')]['ids'],_[_0x8897('0x53')](_0x40b13f[_0x8897('0x55')],['ids','id'])||{});}return null;})[_0x8897('0x68')](function(_0x903564){var _0x23c25b;var _0xed6491;_0x277c68=_0x903564||[];var _0x87f7aa=[];if(_0x903564){for(var _0x31eae5=0x0;_0x31eae5<_0x903564[_0x8897('0x37')];_0x31eae5+=0x1){var _0x49b892=_0x903564[_0x31eae5][_0x8897('0x25')]({'plain':!![]});_0x2db80f['dialCheckDuplicateType']=_0x40b13f[_0x8897('0x55')][_0x8897('0x69')]?_0x40b13f['body'][_0x8897('0x69')]:_0x2db80f[_0x8897('0x69')];switch(_0x2db80f[_0x8897('0x69')]){case _0x8897('0x6a'):_0x23c25b=squel['insert']()[_0x8897('0x6b')]('cm_hopper')[_0x8897('0x6c')]([_0x8897('0x6d'),'scheduledAt',_0x8897('0x6e'),_0x8897('0x6f'),_0x8897('0x5b'),_0x8897('0x54'),_0x8897('0x56')],squel['select']()[_0x8897('0x70')](_0x8897('0x6d'),_0x8897('0x6d'))[_0x8897('0x70')](_0x8897('0x71'),_0x8897('0x72'))[_0x8897('0x70')]('id',_0x8897('0x6e'))[_0x8897('0x70')](_0x49b892[_0x8897('0x73')][_0x8897('0x74')](),_0x8897('0x6f'))['field'](_0x40b13f[_0x8897('0x46')]['id'][_0x8897('0x74')](),_0x8897('0x5b'))['field']('\x27'+_0x1b7c82+'\x27',_0x8897('0x54'))[_0x8897('0x70')]('\x27'+_0x1b7c82+'\x27',_0x8897('0x56'))[_0x8897('0x75')](_0x8897('0x76'))[_0x8897('0x3b')](_0x8897('0x77'))[_0x8897('0x3b')]('ListId\x20=\x20?',_0x49b892[_0x8897('0x73')][_0x8897('0x74')]())[_0x8897('0x3b')]('phone\x20IS\x20NOT\x20NULL')[_0x8897('0x3b')](_0x8897('0x78'),squel[_0x8897('0x79')]()[_0x8897('0x70')](_0x8897('0x7a'))[_0x8897('0x75')](_0x8897('0x7b'))[_0x8897('0x3b')](_0x8897('0x7c'),_0x40b13f[_0x8897('0x46')]['id'][_0x8897('0x74')]()))[_0x8897('0x3b')](_0x8897('0x78'),squel[_0x8897('0x79')]()[_0x8897('0x70')](_0x8897('0x7d'))['from']('cm_hopper')[_0x8897('0x3b')](_0x8897('0x7c'),_0x40b13f['params']['id'][_0x8897('0x74')]())))['toString']();break;case _0x8897('0x7e'):_0x23c25b=squel[_0x8897('0x7f')]()[_0x8897('0x6b')](_0x8897('0x80'))[_0x8897('0x6c')]([_0x8897('0x6d'),'scheduledAt','ContactId','ListId',_0x8897('0x5b'),_0x8897('0x54'),'updatedAt'],squel[_0x8897('0x79')]()[_0x8897('0x70')]('phone',_0x8897('0x6d'))[_0x8897('0x70')](_0x8897('0x71'),'scheduledAt')['field']('id',_0x8897('0x6e'))['field'](_0x49b892[_0x8897('0x73')]['toString'](),'ListId')['field'](_0x40b13f['params']['id'][_0x8897('0x74')](),_0x8897('0x5b'))[_0x8897('0x70')]('\x27'+_0x1b7c82+'\x27',_0x8897('0x54'))[_0x8897('0x70')]('\x27'+_0x1b7c82+'\x27','updatedAt')[_0x8897('0x75')](_0x8897('0x76'))['where']('deletedAt\x20IS\x20NULL')['where'](_0x8897('0x81'),_0x49b892[_0x8897('0x73')][_0x8897('0x74')]())['where'](_0x8897('0x82'))[_0x8897('0x3b')]('phone\x20NOT\x20IN\x20(?)',squel[_0x8897('0x79')]()[_0x8897('0x70')]('COALESCE(phone,\x27\x27)')[_0x8897('0x75')](_0x8897('0x80'))[_0x8897('0x3b')](_0x8897('0x7c'),_0x40b13f[_0x8897('0x46')]['id'][_0x8897('0x74')]())))[_0x8897('0x74')]();break;default:_0x23c25b=squel[_0x8897('0x7f')]()[_0x8897('0x6b')]('cm_hopper')[_0x8897('0x6c')](['phone',_0x8897('0x72'),_0x8897('0x6e'),'ListId',_0x8897('0x5b'),'createdAt',_0x8897('0x56')],squel[_0x8897('0x79')]()[_0x8897('0x70')](_0x8897('0x6d'),_0x8897('0x6d'))[_0x8897('0x70')]('NOW()',_0x8897('0x72'))['field']('id',_0x8897('0x6e'))['field'](_0x49b892['CmListId']['toString'](),'ListId')[_0x8897('0x70')](_0x40b13f[_0x8897('0x46')]['id']['toString'](),_0x8897('0x5b'))[_0x8897('0x70')]('\x27'+_0x1b7c82+'\x27',_0x8897('0x54'))[_0x8897('0x70')]('\x27'+_0x1b7c82+'\x27',_0x8897('0x56'))[_0x8897('0x75')](_0x8897('0x76'))[_0x8897('0x3b')](_0x8897('0x77'))[_0x8897('0x3b')](_0x8897('0x81'),_0x49b892[_0x8897('0x73')]['toString']())[_0x8897('0x3b')](_0x8897('0x82')))['toString']();}_0xed6491=squel[_0x8897('0x7f')]()['into'](_0x8897('0x83'))[_0x8897('0x6c')](['cmHopperId',_0x8897('0x72'),'phone','OrderBy',_0x8897('0x54'),_0x8897('0x56')],squel['select']()[_0x8897('0x70')](_0x8897('0x84'),'id')[_0x8897('0x70')](_0x8897('0x71'),_0x8897('0x72'))['field'](_0x8897('0x85'),_0x8897('0x6d'))['field'](_0x8897('0x86'),_0x8897('0x87'))[_0x8897('0x70')]('\x27'+_0x1b7c82+'\x27',_0x8897('0x54'))[_0x8897('0x70')]('\x27'+_0x1b7c82+'\x27',_0x8897('0x56'))[_0x8897('0x75')](_0x8897('0x88'),'ci')[_0x8897('0x89')](_0x8897('0x80'),'h',_0x8897('0x8a'))[_0x8897('0x3b')]('h.ListId\x20=\x20?',_0x49b892['CmListId']['toString']())[_0x8897('0x3b')](_0x8897('0x8b'),_0x40b13f[_0x8897('0x46')]['id'][_0x8897('0x74')]())[_0x8897('0x3b')](_0x8897('0x8c'),_0x1b7c82))[_0x8897('0x74')]();_0x87f7aa[_0x8897('0x8d')](db[_0x8897('0x8e')][_0x8897('0x32')](_0x23c25b));_0x2f708f[_0x8897('0x8d')](db[_0x8897('0x8e')][_0x8897('0x32')](_0xed6491));}return BPromise['all'](_0x87f7aa);}})['then'](function(){return BPromise[_0x8897('0x8f')](_0x2f708f);})[_0x8897('0x23')](function(){return _0x277c68;})['then'](respondWithResult(_0x4d9c0b,null))[_0x8897('0x44')](handleError(_0x4d9c0b,null));};exports[_0x8897('0x90')]=function(_0x29bff6,_0x1783fa,_0x3ce812){return db[_0x8897('0x2d')][_0x8897('0x49')]({'where':{'id':_0x29bff6['params']['id']}})[_0x8897('0x23')](handleEntityNotFound(_0x1783fa,null))['then'](function(_0x6076b8){if(_0x6076b8){return _0x6076b8[_0x8897('0x90')](_0x29bff6[_0x8897('0x32')][_0x8897('0x91')]);}})[_0x8897('0x23')](function(_0x14524c){if(_0x14524c){return db[_0x8897('0x59')]['destroy']({'where':{'ListId':_0x29bff6[_0x8897('0x32')]['ids'],'CampaignId':_0x29bff6[_0x8897('0x46')]['id']}})[_0x8897('0x23')](function(){return _0x14524c;});}})[_0x8897('0x23')](respondWithStatusCode(_0x1783fa,null))[_0x8897('0x44')](handleError(_0x1783fa,null));};exports[_0x8897('0x92')]=function(_0x55437c,_0x459d1a,_0xab977e){var _0x357b06={};var _0x4256ee={};var _0x55b845;var _0x22a5e9;return db[_0x8897('0x2d')]['findOne']({'where':{'id':_0x55437c[_0x8897('0x46')]['id']}})[_0x8897('0x23')](handleEntityNotFound(_0x459d1a,null))[_0x8897('0x23')](function(_0x87634){if(_0x87634){_0x55b845=_0x87634;_0x4256ee[_0x8897('0x31')]=_[_0x8897('0x33')](db['CmList'][_0x8897('0x47')]);_0x4256ee[_0x8897('0x32')]=_[_0x8897('0x33')](_0x55437c[_0x8897('0x32')]);_0x4256ee[_0x8897('0x3c')]=_[_0x8897('0x34')](_0x4256ee[_0x8897('0x31')],_0x4256ee['query']);_0x357b06[_0x8897('0x35')]=_['intersection'](_0x4256ee[_0x8897('0x31')],qs['fields'](_0x55437c[_0x8897('0x32')][_0x8897('0x36')]));_0x357b06[_0x8897('0x35')]=_0x357b06['attributes'][_0x8897('0x37')]?_0x357b06['attributes']:_0x4256ee['model'];_0x357b06[_0x8897('0x39')]=qs[_0x8897('0x3a')](_0x55437c['query'][_0x8897('0x3a')]);_0x357b06[_0x8897('0x3b')]=qs[_0x8897('0x3c')](_['pick'](_0x55437c[_0x8897('0x32')],_0x4256ee[_0x8897('0x3c')]));if(_0x55437c[_0x8897('0x32')][_0x8897('0x5c')]){_0x357b06[_0x8897('0x3b')]=_[_0x8897('0x3d')](_0x357b06[_0x8897('0x3b')],{'$or':_[_0x8897('0x2c')](_0x357b06['attributes'],function(_0x51bd6d){var _0xccef7f={};_0xccef7f[_0x51bd6d]={'$like':'%'+_0x55437c[_0x8897('0x32')][_0x8897('0x5c')]+'%'};return _0xccef7f;})});}_0x357b06=_[_0x8897('0x3d')]({},_0x357b06,_0x55437c[_0x8897('0x48')]);return _0x55b845[_0x8897('0x92')](_0x357b06);}})['then'](function(_0x586c72){if(_0x586c72){_0x22a5e9=_0x586c72[_0x8897('0x37')];if(!_0x55437c[_0x8897('0x32')]['hasOwnProperty'](_0x8897('0x38'))){_0x357b06['limit']=qs[_0x8897('0x1c')](_0x55437c[_0x8897('0x32')][_0x8897('0x1c')]);_0x357b06[_0x8897('0x1a')]=qs['offset'](_0x55437c[_0x8897('0x32')]['offset']);}return _0x55b845[_0x8897('0x92')](_0x357b06);}})[_0x8897('0x23')](function(_0x12d801){if(_0x12d801){return _0x12d801?{'count':_0x22a5e9,'rows':_0x12d801}:null;}})[_0x8897('0x23')](respondWithResult(_0x459d1a,null))['catch'](handleError(_0x459d1a,null));};exports[_0x8897('0x93')]=function(_0x35ac01,_0x84b127,_0x5e2c9a){var _0x1020d4,_0x20cc7d;var _0x581507=[];var _0x55aef4=moment()['format'](_0x8897('0x67'));return db[_0x8897('0x2d')][_0x8897('0x49')]({'where':{'id':_0x35ac01['params']['id']}})[_0x8897('0x23')](handleEntityNotFound(_0x84b127,null))[_0x8897('0x23')](function(_0x4a3e8d){if(_0x4a3e8d){_0x20cc7d=_0x4a3e8d;return _0x4a3e8d[_0x8897('0x93')](_0x35ac01[_0x8897('0x55')][_0x8897('0x91')],_[_0x8897('0x53')](_0x35ac01[_0x8897('0x55')],[_0x8897('0x91'),'id'])||{});}return null;})[_0x8897('0x68')](function(_0x5126f0){var _0x1e67f4;var _0x5ecabc;_0x1020d4=_0x5126f0||[];var _0x429f7f=[];if(_0x5126f0){for(var _0x21d0bc=0x0;_0x21d0bc<_0x5126f0['length'];_0x21d0bc+=0x1){var _0x269f6a=_0x5126f0[_0x21d0bc][_0x8897('0x25')]({'plain':!![]});_0x1e67f4=squel[_0x8897('0x7f')]()[_0x8897('0x6b')](_0x8897('0x94'))['fromQuery']([_0x8897('0x6d'),_0x8897('0x6e'),_0x8897('0x6f'),_0x8897('0x5b'),'createdAt',_0x8897('0x56')],squel[_0x8897('0x79')]()['field'](_0x8897('0x6d'),_0x8897('0x6d'))[_0x8897('0x70')]('id',_0x8897('0x6e'))['field'](_0x269f6a[_0x8897('0x73')][_0x8897('0x74')](),_0x8897('0x6f'))[_0x8897('0x70')](_0x35ac01[_0x8897('0x46')]['id'][_0x8897('0x74')](),'CampaignId')['field'](_0x8897('0x71'),_0x8897('0x54'))[_0x8897('0x70')]('NOW()',_0x8897('0x56'))[_0x8897('0x75')](_0x8897('0x76'))[_0x8897('0x3b')](_0x8897('0x77'))[_0x8897('0x3b')]('ListId\x20=\x20?',_0x269f6a['CmListId'][_0x8897('0x74')]())[_0x8897('0x3b')]('phone\x20IS\x20NOT\x20NULL'))[_0x8897('0x74')]();_0x429f7f[_0x8897('0x8d')](db[_0x8897('0x8e')][_0x8897('0x32')](_0x1e67f4));}return BPromise['all'](_0x429f7f);}})[_0x8897('0x23')](function(){return _0x1020d4;})['then'](respondWithResult(_0x84b127,null))[_0x8897('0x44')](handleError(_0x84b127,null));};exports[_0x8897('0x95')]=function(_0xa56a56,_0x108364,_0x3bf4f7){return db[_0x8897('0x2d')][_0x8897('0x49')]({'where':{'id':_0xa56a56['params']['id']}})[_0x8897('0x23')](handleEntityNotFound(_0x108364,null))[_0x8897('0x23')](function(_0x47e67b){if(_0x47e67b){return _0x47e67b[_0x8897('0x95')](_0xa56a56[_0x8897('0x32')][_0x8897('0x91')]);}})['then'](function(_0xdf5b91){if(_0xdf5b91){return db[_0x8897('0x63')][_0x8897('0x24')]({'where':{'ListId':_0xa56a56[_0x8897('0x32')][_0x8897('0x91')],'CampaignId':_0xa56a56[_0x8897('0x46')]['id']}})['then'](function(){return _0xdf5b91;});}})['then'](respondWithStatusCode(_0x108364,null))[_0x8897('0x44')](handleError(_0x108364,null));};
\ No newline at end of file
+var _0x77f4=['../../config/environment','../../mysqldb','end','status','json','offset','undefined','limit','count','set','Content-Range','destroy','get','IvrCampaigns','UserProfileResource','then','sendStatus','error','stack','name','send','index','rawAttributes','fieldName','key','map','query','keys','model','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','where','filters','pick','filter','merge','type','VIRTUAL','options','Campaign','includeAll','include','show','params','find','catch','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','clone','omit','createdAt','updatedAt','getHoppers','findOne','CmHopper','CampaignId','findAll','rows','CmHopperHistory','sort','getHopperFinals','CmHopperFinal','getHopperBlacks','CmHopperBlack','getLists','format','YYYY-MM-DD\x20HH:mm:ss','addLists','ids','dialCheckDuplicateType','always','insert','into','cm_hopper','phone','scheduledAt','ContactId','ListId','select','field','NOW()','CmListId','toString','from','cm_contacts','deletedAt\x20IS\x20NULL','ListId\x20=\x20?','phone\x20IS\x20NOT\x20NULL','COALESCE(calleridnum,\x27\x27)','phone\x20NOT\x20IN\x20(?)','COALESCE(phone,\x27\x27)','CampaignId\x20=\x20?','fromQuery','cm_hopper_additional_phones','cmHopperId','OrderBy','h.id','ci.item','ci.OrderBY','cm_contact_has_items','join','h.ContactId\x20=\x20ci.CmContactId','h.ListId\x20=\x20?','h.CampaignId=?','push','sequelize','all','removeLists','getBlackLists','CmList','addBlackLists','cm_hopper_black','removeBlackLists','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path','to-csv','lodash','crypto','jsforce','desk.js','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils'];(function(_0xf26c2e,_0x56c3ea){var _0x46ecb4=function(_0x1be516){while(--_0x1be516){_0xf26c2e['push'](_0xf26c2e['shift']());}};_0x46ecb4(++_0x56c3ea);}(_0x77f4,0x1a1));var _0x477f=function(_0x2a1461,_0x38448e){_0x2a1461=_0x2a1461-0x0;var _0x288523=_0x77f4[_0x2a1461];return _0x288523;};'use strict';var emlformat=require(_0x477f('0x0'));var rimraf=require(_0x477f('0x1'));var zipdir=require(_0x477f('0x2'));var jsonpatch=require(_0x477f('0x3'));var rp=require(_0x477f('0x4'));var moment=require(_0x477f('0x5'));var BPromise=require(_0x477f('0x6'));var Mustache=require(_0x477f('0x7'));var util=require('util');var path=require(_0x477f('0x8'));var sox=require('sox');var csv=require(_0x477f('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x477f('0xa'));var squel=require('squel');var crypto=require(_0x477f('0xb'));var jsforce=require(_0x477f('0xc'));var deskjs=require(_0x477f('0xd'));var toCsv=require(_0x477f('0x9'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x477f('0xe'));var authService=require(_0x477f('0xf'));var qs=require('../../components/parsers/qs');var as=require(_0x477f('0x10'));var hardwareService=require(_0x477f('0x11'));var logger=require(_0x477f('0x12'))(_0x477f('0x13'));var utils=require(_0x477f('0x14'));var config=require(_0x477f('0x15'));var licenseUtil=require('../../config/license/util');var db=require(_0x477f('0x16'))['db'];function respondWithStatusCode(_0x5b4fac,_0x4860b9){_0x4860b9=_0x4860b9||0xcc;return function(_0x1d2556){if(_0x1d2556){return _0x5b4fac['sendStatus'](_0x4860b9);}return _0x5b4fac['status'](_0x4860b9)[_0x477f('0x17')]();};}function respondWithResult(_0x42b6b9,_0x343671){_0x343671=_0x343671||0xc8;return function(_0x3d184c){if(_0x3d184c){return _0x42b6b9[_0x477f('0x18')](_0x343671)[_0x477f('0x19')](_0x3d184c);}};}function respondWithFilteredResult(_0x4b184a,_0x2b1a0c){return function(_0x321b59){if(_0x321b59){var _0x4e0268=typeof _0x2b1a0c[_0x477f('0x1a')]===_0x477f('0x1b')&&typeof _0x2b1a0c[_0x477f('0x1c')]==='undefined';var _0x18bef6=_0x321b59[_0x477f('0x1d')];var _0x1f92cc=_0x4e0268?0x0:_0x2b1a0c[_0x477f('0x1a')];var _0x48fe64=_0x4e0268?_0x321b59[_0x477f('0x1d')]:_0x2b1a0c[_0x477f('0x1a')]+_0x2b1a0c[_0x477f('0x1c')];var _0x1d7039;if(_0x48fe64>=_0x18bef6){_0x48fe64=_0x18bef6;_0x1d7039=0xc8;}else{_0x1d7039=0xce;}_0x4b184a[_0x477f('0x18')](_0x1d7039);return _0x4b184a[_0x477f('0x1e')](_0x477f('0x1f'),_0x1f92cc+'-'+_0x48fe64+'/'+_0x18bef6)[_0x477f('0x19')](_0x321b59);}return null;};}function patchUpdates(_0x2c125e){return function(_0x1b5d2d){try{jsonpatch['apply'](_0x1b5d2d,_0x2c125e,!![]);}catch(_0x473317){return BPromise['reject'](_0x473317);}return _0x1b5d2d['save']();};}function saveUpdates(_0x5d2767,_0x396276){return function(_0x2df32a){if(_0x2df32a){return _0x2df32a['update'](_0x5d2767)['then'](function(_0x3fd20f){return _0x3fd20f;});}return null;};}function removeEntity(_0x5a2acf,_0x28a355){return function(_0x145a79){if(_0x145a79){return _0x145a79[_0x477f('0x20')]()['then'](function(){var _0x3300c0=_0x145a79[_0x477f('0x21')]({'plain':!![]});var _0x296347=_0x477f('0x22');return db[_0x477f('0x23')]['destroy']({'where':{'type':_0x296347,'resourceId':_0x3300c0['id']}})[_0x477f('0x24')](function(){return _0x145a79;});})['then'](function(){_0x5a2acf['status'](0xcc)[_0x477f('0x17')]();});}};}function handleEntityNotFound(_0x47d23a,_0x4a86a0){return function(_0x52f4ed){if(!_0x52f4ed){_0x47d23a[_0x477f('0x25')](0x194);}return _0x52f4ed;};}function handleError(_0x338e21,_0x101716){_0x101716=_0x101716||0x1f4;return function(_0x31cc66){logger[_0x477f('0x26')](_0x31cc66[_0x477f('0x27')]);if(_0x31cc66[_0x477f('0x28')]){delete _0x31cc66[_0x477f('0x28')];}_0x338e21[_0x477f('0x18')](_0x101716)[_0x477f('0x29')](_0x31cc66);};}exports[_0x477f('0x2a')]=function(_0x2a58b7,_0x4d65f2){var _0x432170={},_0x3cb99f={},_0x47b20a={'count':0x0,'rows':[]};var _0x57ec38=_['map'](db['Campaign'][_0x477f('0x2b')],function(_0x23d17c){return{'name':_0x23d17c[_0x477f('0x2c')],'type':_0x23d17c['type'][_0x477f('0x2d')]};});_0x3cb99f['model']=_[_0x477f('0x2e')](_0x57ec38,'name');_0x3cb99f[_0x477f('0x2f')]=_[_0x477f('0x30')](_0x2a58b7[_0x477f('0x2f')]);_0x3cb99f['filters']=_['intersection'](_0x3cb99f[_0x477f('0x31')],_0x3cb99f[_0x477f('0x2f')]);_0x432170[_0x477f('0x32')]=_[_0x477f('0x33')](_0x3cb99f[_0x477f('0x31')],qs['fields'](_0x2a58b7[_0x477f('0x2f')][_0x477f('0x34')]));_0x432170[_0x477f('0x32')]=_0x432170[_0x477f('0x32')][_0x477f('0x35')]?_0x432170[_0x477f('0x32')]:_0x3cb99f[_0x477f('0x31')];if(!_0x2a58b7[_0x477f('0x2f')][_0x477f('0x36')](_0x477f('0x37'))){_0x432170['limit']=qs[_0x477f('0x1c')](_0x2a58b7[_0x477f('0x2f')][_0x477f('0x1c')]);_0x432170[_0x477f('0x1a')]=qs[_0x477f('0x1a')](_0x2a58b7[_0x477f('0x2f')][_0x477f('0x1a')]);}_0x432170[_0x477f('0x38')]=qs['sort'](_0x2a58b7[_0x477f('0x2f')]['sort']);_0x432170[_0x477f('0x39')]=qs[_0x477f('0x3a')](_[_0x477f('0x3b')](_0x2a58b7['query'],_0x3cb99f[_0x477f('0x3a')]),_0x57ec38);if(_0x2a58b7['query'][_0x477f('0x3c')]){_0x432170['where']=_[_0x477f('0x3d')](_0x432170[_0x477f('0x39')],{'$or':_[_0x477f('0x2e')](_0x57ec38,function(_0x123058){if(_0x123058[_0x477f('0x3e')]!==_0x477f('0x3f')){var _0x32b3b1={};_0x32b3b1[_0x123058[_0x477f('0x28')]]={'$like':'%'+_0x2a58b7[_0x477f('0x2f')][_0x477f('0x3c')]+'%'};return _0x32b3b1;}})});}_0x432170=_['merge']({},_0x432170,_0x2a58b7[_0x477f('0x40')]);var _0x1c9760={'where':_0x432170['where']};return db[_0x477f('0x41')][_0x477f('0x1d')](_0x1c9760)[_0x477f('0x24')](function(_0xf7881b){_0x47b20a['count']=_0xf7881b;if(_0x2a58b7['query'][_0x477f('0x42')]){_0x432170[_0x477f('0x43')]=[{'all':!![]}];}return db[_0x477f('0x41')]['findAll'](_0x432170);})[_0x477f('0x24')](function(_0x9dadc0){_0x47b20a['rows']=_0x9dadc0;return _0x47b20a;})[_0x477f('0x24')](respondWithFilteredResult(_0x4d65f2,_0x432170))['catch'](handleError(_0x4d65f2,null));};exports[_0x477f('0x44')]=function(_0x13be6c,_0x1db340){var _0x56fefb={'raw':![],'where':{'id':_0x13be6c[_0x477f('0x45')]['id']}},_0x29e3ef={};_0x29e3ef[_0x477f('0x31')]=_['keys'](db[_0x477f('0x41')][_0x477f('0x2b')]);_0x29e3ef[_0x477f('0x2f')]=_[_0x477f('0x30')](_0x13be6c['query']);_0x29e3ef['filters']=_[_0x477f('0x33')](_0x29e3ef['model'],_0x29e3ef[_0x477f('0x2f')]);_0x56fefb[_0x477f('0x32')]=_[_0x477f('0x33')](_0x29e3ef[_0x477f('0x31')],qs['fields'](_0x13be6c[_0x477f('0x2f')]['fields']));_0x56fefb[_0x477f('0x32')]=_0x56fefb[_0x477f('0x32')]['length']?_0x56fefb[_0x477f('0x32')]:_0x29e3ef['model'];if(_0x13be6c[_0x477f('0x2f')][_0x477f('0x42')]){_0x56fefb[_0x477f('0x43')]=[{'all':!![]}];}_0x56fefb=_[_0x477f('0x3d')]({},_0x56fefb,_0x13be6c[_0x477f('0x40')]);return db[_0x477f('0x41')][_0x477f('0x46')](_0x56fefb)[_0x477f('0x24')](handleEntityNotFound(_0x1db340,null))[_0x477f('0x24')](respondWithResult(_0x1db340,null))[_0x477f('0x47')](handleError(_0x1db340,null));};exports['create']=function(_0x5c30c1,_0x2fa9e0){return db[_0x477f('0x41')][_0x477f('0x48')](_0x5c30c1[_0x477f('0x49')],{})[_0x477f('0x24')](function(_0x2a3695){var _0x59f17c=_0x5c30c1[_0x477f('0x4a')][_0x477f('0x21')]({'plain':!![]});if(!_0x59f17c)throw new Error(_0x477f('0x4b'));if(_0x59f17c[_0x477f('0x4c')]===_0x477f('0x4a')){var _0x4b4071=_0x2a3695[_0x477f('0x21')]({'plain':!![]});var _0x41f3f9=_0x477f('0x22');return db[_0x477f('0x4d')][_0x477f('0x46')]({'where':{'name':_0x41f3f9,'userProfileId':_0x59f17c[_0x477f('0x4e')]},'raw':!![]})[_0x477f('0x24')](function(_0x191100){if(_0x191100&&_0x191100[_0x477f('0x4f')]===0x0){return db[_0x477f('0x23')]['create']({'name':_0x4b4071[_0x477f('0x28')],'resourceId':_0x4b4071['id'],'type':_0x191100['name'],'sectionId':_0x191100['id']},{})['then'](function(){return _0x2a3695;});}else{return _0x2a3695;}})[_0x477f('0x47')](function(_0x52ef69){logger['error'](_0x477f('0x50'),_0x52ef69);throw _0x52ef69;});}return _0x2a3695;})['then'](respondWithResult(_0x2fa9e0,0xc9))[_0x477f('0x47')](handleError(_0x2fa9e0,null));};exports[_0x477f('0x51')]=function(_0x501b7e,_0x28b9d6){var _0x57f366={'where':{'id':_0x501b7e[_0x477f('0x45')]['id']}},_0x52fafc={};_0x52fafc[_0x477f('0x31')]=_[_0x477f('0x30')](db[_0x477f('0x41')]['rawAttributes']);_0x57f366[_0x477f('0x32')]=_[_0x477f('0x33')](_0x52fafc[_0x477f('0x31')],qs[_0x477f('0x34')](_0x501b7e[_0x477f('0x2f')][_0x477f('0x34')]));_0x57f366['attributes']=_0x57f366['attributes'][_0x477f('0x35')]?_0x57f366[_0x477f('0x32')]:_0x52fafc[_0x477f('0x31')];if(_0x501b7e[_0x477f('0x2f')][_0x477f('0x42')]){_0x57f366[_0x477f('0x43')]=[{'all':!![]}];}_0x57f366=_[_0x477f('0x3d')]({},_0x57f366,_0x501b7e[_0x477f('0x40')]);return db[_0x477f('0x41')][_0x477f('0x46')](_0x57f366)[_0x477f('0x24')](handleEntityNotFound(_0x28b9d6,null))['then'](function(_0x140c93){if(_0x140c93){var _0x522baa=_0x140c93[_0x477f('0x21')]({'plain':!![]});_0x522baa=qs[_0x477f('0x52')](_0x522baa,['id',_0x477f('0x53'),_0x477f('0x54')]);_0x501b7e[_0x477f('0x49')]=_['omit'](_0x501b7e[_0x477f('0x49')],['id',_0x477f('0x53'),_0x477f('0x54')]);return db[_0x477f('0x41')][_0x477f('0x48')](_[_0x477f('0x3d')](_0x522baa,_0x501b7e[_0x477f('0x49')]),{'include':_0x501b7e[_0x477f('0x2f')][_0x477f('0x42')]?[{'all':!![]}]:undefined})[_0x477f('0x24')](function(_0x433bbd){var _0x4463c6=_0x501b7e[_0x477f('0x4a')][_0x477f('0x21')]({'plain':!![]});if(!_0x4463c6)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x4463c6[_0x477f('0x4c')]==='user'){var _0x40eb86=_0x433bbd[_0x477f('0x21')]({'plain':!![]});var _0x540b26=_0x477f('0x22');return db[_0x477f('0x4d')]['find']({'where':{'name':_0x540b26,'userProfileId':_0x4463c6[_0x477f('0x4e')]},'raw':!![]})['then'](function(_0x33ec9d){if(_0x33ec9d&&_0x33ec9d[_0x477f('0x4f')]===0x0){return db['UserProfileResource'][_0x477f('0x48')]({'name':_0x40eb86[_0x477f('0x28')],'resourceId':_0x40eb86['id'],'type':_0x33ec9d['name'],'sectionId':_0x33ec9d['id']},{})[_0x477f('0x24')](function(){return _0x433bbd;});}else{return _0x433bbd;}})[_0x477f('0x47')](function(_0x1882a9){logger[_0x477f('0x26')](_0x477f('0x50'),_0x1882a9);throw _0x1882a9;});}return _0x433bbd;});}})[_0x477f('0x24')](respondWithResult(_0x28b9d6,0xc9))[_0x477f('0x47')](handleError(_0x28b9d6,null));};exports['update']=function(_0x27737f,_0x398696){if(_0x27737f['body']['id']){delete _0x27737f[_0x477f('0x49')]['id'];}return db[_0x477f('0x41')][_0x477f('0x46')]({'where':{'id':_0x27737f[_0x477f('0x45')]['id']}})['then'](handleEntityNotFound(_0x398696,null))[_0x477f('0x24')](saveUpdates(_0x27737f['body'],null))['then'](respondWithResult(_0x398696,null))[_0x477f('0x47')](handleError(_0x398696,null));};exports[_0x477f('0x20')]=function(_0x4405d3,_0xf55191){return db[_0x477f('0x41')][_0x477f('0x46')]({'where':{'id':_0x4405d3['params']['id']}})[_0x477f('0x24')](handleEntityNotFound(_0xf55191,null))[_0x477f('0x24')](removeEntity(_0xf55191,null))[_0x477f('0x47')](handleError(_0xf55191,null));};exports[_0x477f('0x55')]=function(_0x2aeaa6,_0x27a093,_0x553724){var _0xaf6099={'raw':!![],'where':{}};var _0x97a9ef={};var _0x99b156={'count':0x0,'rows':[]};return db[_0x477f('0x41')][_0x477f('0x56')]({'where':{'id':_0x2aeaa6[_0x477f('0x45')]['id']}})[_0x477f('0x24')](handleEntityNotFound(_0x27a093,null))[_0x477f('0x24')](function(_0x1881df){if(_0x1881df){_0x97a9ef[_0x477f('0x31')]=_['keys'](db[_0x477f('0x57')][_0x477f('0x2b')]);_0x97a9ef[_0x477f('0x2f')]=_[_0x477f('0x30')](_0x2aeaa6[_0x477f('0x2f')]);_0x97a9ef[_0x477f('0x3a')]=_['intersection'](_0x97a9ef[_0x477f('0x31')],_0x97a9ef[_0x477f('0x2f')]);_0xaf6099[_0x477f('0x32')]=_[_0x477f('0x33')](_0x97a9ef[_0x477f('0x31')],qs[_0x477f('0x34')](_0x2aeaa6[_0x477f('0x2f')][_0x477f('0x34')]));_0xaf6099[_0x477f('0x32')]=_0xaf6099[_0x477f('0x32')][_0x477f('0x35')]?_0xaf6099[_0x477f('0x32')]:_0x97a9ef[_0x477f('0x31')];if(!_0x2aeaa6[_0x477f('0x2f')]['hasOwnProperty'](_0x477f('0x37'))){_0xaf6099['limit']=qs['limit'](_0x2aeaa6['query'][_0x477f('0x1c')]);_0xaf6099[_0x477f('0x1a')]=qs[_0x477f('0x1a')](_0x2aeaa6['query']['offset']);}_0xaf6099[_0x477f('0x38')]=qs['sort'](_0x2aeaa6[_0x477f('0x2f')]['sort']);_0xaf6099[_0x477f('0x39')]=qs[_0x477f('0x3a')](_[_0x477f('0x3b')](_0x2aeaa6[_0x477f('0x2f')],_0x97a9ef[_0x477f('0x3a')]));_0xaf6099[_0x477f('0x39')][_0x477f('0x58')]=_0x1881df['id'];if(_0x2aeaa6[_0x477f('0x2f')][_0x477f('0x3c')]){_0xaf6099[_0x477f('0x39')]=_[_0x477f('0x3d')](_0xaf6099[_0x477f('0x39')],{'$or':_[_0x477f('0x2e')](_0xaf6099[_0x477f('0x32')],function(_0x3ab630){var _0x5df0e3={};_0x5df0e3[_0x3ab630]={'$like':'%'+_0x2aeaa6[_0x477f('0x2f')]['filter']+'%'};return _0x5df0e3;})});}_0xaf6099=_['merge']({},_0xaf6099,_0x2aeaa6[_0x477f('0x40')]);return db[_0x477f('0x57')][_0x477f('0x1d')]({'where':_0xaf6099[_0x477f('0x39')]})['then'](function(_0x4cd461){_0x99b156[_0x477f('0x1d')]=_0x4cd461;if(_0x2aeaa6[_0x477f('0x2f')]['includeAll']){_0xaf6099[_0x477f('0x43')]=[{'all':!![]}];}return db[_0x477f('0x57')][_0x477f('0x59')](_0xaf6099);})['then'](function(_0x43d220){_0x99b156[_0x477f('0x5a')]=_0x43d220;return _0x99b156;});}})[_0x477f('0x24')](respondWithFilteredResult(_0x27a093,_0xaf6099))['catch'](handleError(_0x27a093,null));};exports['getHopperHistories']=function(_0x4377be,_0x3d8cb8,_0x170c42){var _0x32620f={'raw':!![],'where':{}};var _0x1ba8bd={};var _0x179c96={'count':0x0,'rows':[]};return db[_0x477f('0x41')][_0x477f('0x56')]({'where':{'id':_0x4377be[_0x477f('0x45')]['id']}})['then'](handleEntityNotFound(_0x3d8cb8,null))['then'](function(_0x48e786){if(_0x48e786){_0x1ba8bd[_0x477f('0x31')]=_['keys'](db[_0x477f('0x5b')]['rawAttributes']);_0x1ba8bd[_0x477f('0x2f')]=_[_0x477f('0x30')](_0x4377be[_0x477f('0x2f')]);_0x1ba8bd[_0x477f('0x3a')]=_['intersection'](_0x1ba8bd[_0x477f('0x31')],_0x1ba8bd[_0x477f('0x2f')]);_0x32620f['attributes']=_[_0x477f('0x33')](_0x1ba8bd[_0x477f('0x31')],qs['fields'](_0x4377be[_0x477f('0x2f')][_0x477f('0x34')]));_0x32620f[_0x477f('0x32')]=_0x32620f['attributes'][_0x477f('0x35')]?_0x32620f[_0x477f('0x32')]:_0x1ba8bd[_0x477f('0x31')];if(!_0x4377be[_0x477f('0x2f')][_0x477f('0x36')](_0x477f('0x37'))){_0x32620f[_0x477f('0x1c')]=qs[_0x477f('0x1c')](_0x4377be[_0x477f('0x2f')]['limit']);_0x32620f[_0x477f('0x1a')]=qs['offset'](_0x4377be[_0x477f('0x2f')][_0x477f('0x1a')]);}_0x32620f[_0x477f('0x38')]=qs[_0x477f('0x5c')](_0x4377be[_0x477f('0x2f')]['sort']);_0x32620f[_0x477f('0x39')]=qs['filters'](_[_0x477f('0x3b')](_0x4377be[_0x477f('0x2f')],_0x1ba8bd[_0x477f('0x3a')]));_0x32620f[_0x477f('0x39')][_0x477f('0x58')]=_0x48e786['id'];if(_0x4377be[_0x477f('0x2f')][_0x477f('0x3c')]){_0x32620f[_0x477f('0x39')]=_[_0x477f('0x3d')](_0x32620f['where'],{'$or':_[_0x477f('0x2e')](_0x32620f['attributes'],function(_0x477246){var _0x537fa2={};_0x537fa2[_0x477246]={'$like':'%'+_0x4377be[_0x477f('0x2f')]['filter']+'%'};return _0x537fa2;})});}_0x32620f=_['merge']({},_0x32620f,_0x4377be['options']);return db[_0x477f('0x5b')][_0x477f('0x1d')]({'where':_0x32620f['where']})['then'](function(_0xd6ac28){_0x179c96[_0x477f('0x1d')]=_0xd6ac28;if(_0x4377be['query'][_0x477f('0x42')]){_0x32620f['include']=[{'all':!![]}];}return db[_0x477f('0x5b')]['findAll'](_0x32620f);})['then'](function(_0x520507){_0x179c96[_0x477f('0x5a')]=_0x520507;return _0x179c96;});}})['then'](respondWithFilteredResult(_0x3d8cb8,_0x32620f))[_0x477f('0x47')](handleError(_0x3d8cb8,null));};exports[_0x477f('0x5d')]=function(_0x1607ab,_0x2e5ade,_0x3a6f4c){var _0x2ea14f={'raw':!![],'where':{}};var _0x4db972={};var _0x42d51d={'count':0x0,'rows':[]};return db[_0x477f('0x41')]['findOne']({'where':{'id':_0x1607ab[_0x477f('0x45')]['id']}})['then'](handleEntityNotFound(_0x2e5ade,null))[_0x477f('0x24')](function(_0x1e4907){if(_0x1e4907){_0x4db972['model']=_[_0x477f('0x30')](db[_0x477f('0x5e')][_0x477f('0x2b')]);_0x4db972[_0x477f('0x2f')]=_[_0x477f('0x30')](_0x1607ab[_0x477f('0x2f')]);_0x4db972['filters']=_[_0x477f('0x33')](_0x4db972['model'],_0x4db972['query']);_0x2ea14f[_0x477f('0x32')]=_['intersection'](_0x4db972[_0x477f('0x31')],qs[_0x477f('0x34')](_0x1607ab[_0x477f('0x2f')]['fields']));_0x2ea14f[_0x477f('0x32')]=_0x2ea14f['attributes'][_0x477f('0x35')]?_0x2ea14f['attributes']:_0x4db972[_0x477f('0x31')];if(!_0x1607ab['query'][_0x477f('0x36')]('nolimit')){_0x2ea14f[_0x477f('0x1c')]=qs[_0x477f('0x1c')](_0x1607ab[_0x477f('0x2f')][_0x477f('0x1c')]);_0x2ea14f[_0x477f('0x1a')]=qs[_0x477f('0x1a')](_0x1607ab[_0x477f('0x2f')][_0x477f('0x1a')]);}_0x2ea14f[_0x477f('0x38')]=qs[_0x477f('0x5c')](_0x1607ab[_0x477f('0x2f')]['sort']);_0x2ea14f[_0x477f('0x39')]=qs[_0x477f('0x3a')](_['pick'](_0x1607ab[_0x477f('0x2f')],_0x4db972[_0x477f('0x3a')]));_0x2ea14f[_0x477f('0x39')][_0x477f('0x58')]=_0x1e4907['id'];if(_0x1607ab[_0x477f('0x2f')][_0x477f('0x3c')]){_0x2ea14f[_0x477f('0x39')]=_[_0x477f('0x3d')](_0x2ea14f[_0x477f('0x39')],{'$or':_[_0x477f('0x2e')](_0x2ea14f['attributes'],function(_0xcf7d28){var _0x90f66={};_0x90f66[_0xcf7d28]={'$like':'%'+_0x1607ab['query']['filter']+'%'};return _0x90f66;})});}_0x2ea14f=_[_0x477f('0x3d')]({},_0x2ea14f,_0x1607ab['options']);return db['CmHopperFinal'][_0x477f('0x1d')]({'where':_0x2ea14f[_0x477f('0x39')]})[_0x477f('0x24')](function(_0x2c391b){_0x42d51d[_0x477f('0x1d')]=_0x2c391b;if(_0x1607ab[_0x477f('0x2f')][_0x477f('0x42')]){_0x2ea14f[_0x477f('0x43')]=[{'all':!![]}];}return db[_0x477f('0x5e')][_0x477f('0x59')](_0x2ea14f);})[_0x477f('0x24')](function(_0x586501){_0x42d51d['rows']=_0x586501;return _0x42d51d;});}})[_0x477f('0x24')](respondWithFilteredResult(_0x2e5ade,_0x2ea14f))[_0x477f('0x47')](handleError(_0x2e5ade,null));};exports[_0x477f('0x5f')]=function(_0x1fe95a,_0x5f05d8,_0x36b9ab){var _0x2e6d19={'raw':!![],'where':{}};var _0x5c7307={};var _0x258b09={'count':0x0,'rows':[]};return db[_0x477f('0x41')][_0x477f('0x56')]({'where':{'id':_0x1fe95a[_0x477f('0x45')]['id']}})[_0x477f('0x24')](handleEntityNotFound(_0x5f05d8,null))['then'](function(_0x547c6a){if(_0x547c6a){_0x5c7307[_0x477f('0x31')]=_[_0x477f('0x30')](db[_0x477f('0x60')][_0x477f('0x2b')]);_0x5c7307['query']=_['keys'](_0x1fe95a[_0x477f('0x2f')]);_0x5c7307[_0x477f('0x3a')]=_['intersection'](_0x5c7307[_0x477f('0x31')],_0x5c7307[_0x477f('0x2f')]);_0x2e6d19['attributes']=_[_0x477f('0x33')](_0x5c7307[_0x477f('0x31')],qs['fields'](_0x1fe95a[_0x477f('0x2f')][_0x477f('0x34')]));_0x2e6d19['attributes']=_0x2e6d19['attributes'][_0x477f('0x35')]?_0x2e6d19[_0x477f('0x32')]:_0x5c7307[_0x477f('0x31')];if(!_0x1fe95a[_0x477f('0x2f')][_0x477f('0x36')](_0x477f('0x37'))){_0x2e6d19[_0x477f('0x1c')]=qs['limit'](_0x1fe95a[_0x477f('0x2f')]['limit']);_0x2e6d19['offset']=qs[_0x477f('0x1a')](_0x1fe95a[_0x477f('0x2f')][_0x477f('0x1a')]);}_0x2e6d19[_0x477f('0x38')]=qs[_0x477f('0x5c')](_0x1fe95a[_0x477f('0x2f')][_0x477f('0x5c')]);_0x2e6d19['where']=qs['filters'](_['pick'](_0x1fe95a[_0x477f('0x2f')],_0x5c7307['filters']));_0x2e6d19['where']['CampaignId']=_0x547c6a['id'];if(_0x1fe95a['query']['filter']){_0x2e6d19[_0x477f('0x39')]=_['merge'](_0x2e6d19[_0x477f('0x39')],{'$or':_[_0x477f('0x2e')](_0x2e6d19['attributes'],function(_0x796dd){var _0x49803e={};_0x49803e[_0x796dd]={'$like':'%'+_0x1fe95a[_0x477f('0x2f')]['filter']+'%'};return _0x49803e;})});}_0x2e6d19=_['merge']({},_0x2e6d19,_0x1fe95a[_0x477f('0x40')]);return db['CmHopperBlack'][_0x477f('0x1d')]({'where':_0x2e6d19[_0x477f('0x39')]})[_0x477f('0x24')](function(_0x3aef1c){_0x258b09[_0x477f('0x1d')]=_0x3aef1c;if(_0x1fe95a[_0x477f('0x2f')][_0x477f('0x42')]){_0x2e6d19[_0x477f('0x43')]=[{'all':!![]}];}return db[_0x477f('0x60')][_0x477f('0x59')](_0x2e6d19);})[_0x477f('0x24')](function(_0x363702){_0x258b09[_0x477f('0x5a')]=_0x363702;return _0x258b09;});}})[_0x477f('0x24')](respondWithFilteredResult(_0x5f05d8,_0x2e6d19))[_0x477f('0x47')](handleError(_0x5f05d8,null));};exports['getLists']=function(_0x86c749,_0x547773,_0x391ba9){var _0x348c9d={};var _0x29470e={};var _0x5ecb4a;var _0x3baf6a;return db[_0x477f('0x41')][_0x477f('0x56')]({'where':{'id':_0x86c749['params']['id']}})[_0x477f('0x24')](handleEntityNotFound(_0x547773,null))[_0x477f('0x24')](function(_0x6f7a53){if(_0x6f7a53){_0x5ecb4a=_0x6f7a53;_0x29470e[_0x477f('0x31')]=_[_0x477f('0x30')](db['CmList'][_0x477f('0x2b')]);_0x29470e['query']=_[_0x477f('0x30')](_0x86c749['query']);_0x29470e[_0x477f('0x3a')]=_[_0x477f('0x33')](_0x29470e[_0x477f('0x31')],_0x29470e[_0x477f('0x2f')]);_0x348c9d[_0x477f('0x32')]=_[_0x477f('0x33')](_0x29470e[_0x477f('0x31')],qs[_0x477f('0x34')](_0x86c749['query'][_0x477f('0x34')]));_0x348c9d[_0x477f('0x32')]=_0x348c9d['attributes'][_0x477f('0x35')]?_0x348c9d[_0x477f('0x32')]:_0x29470e['model'];_0x348c9d['order']=qs['sort'](_0x86c749[_0x477f('0x2f')][_0x477f('0x5c')]);_0x348c9d[_0x477f('0x39')]=qs['filters'](_['pick'](_0x86c749[_0x477f('0x2f')],_0x29470e[_0x477f('0x3a')]));if(_0x86c749[_0x477f('0x2f')]['filter']){_0x348c9d[_0x477f('0x39')]=_[_0x477f('0x3d')](_0x348c9d[_0x477f('0x39')],{'$or':_[_0x477f('0x2e')](_0x348c9d['attributes'],function(_0x3108fb){var _0xa21787={};_0xa21787[_0x3108fb]={'$like':'%'+_0x86c749[_0x477f('0x2f')][_0x477f('0x3c')]+'%'};return _0xa21787;})});}_0x348c9d=_['merge']({},_0x348c9d,_0x86c749[_0x477f('0x40')]);return _0x5ecb4a[_0x477f('0x61')](_0x348c9d);}})['then'](function(_0x548afd){if(_0x548afd){_0x3baf6a=_0x548afd[_0x477f('0x35')];if(!_0x86c749['query']['hasOwnProperty']('nolimit')){_0x348c9d[_0x477f('0x1c')]=qs[_0x477f('0x1c')](_0x86c749[_0x477f('0x2f')]['limit']);_0x348c9d[_0x477f('0x1a')]=qs[_0x477f('0x1a')](_0x86c749[_0x477f('0x2f')][_0x477f('0x1a')]);}return _0x5ecb4a[_0x477f('0x61')](_0x348c9d);}})[_0x477f('0x24')](function(_0x2d68f8){if(_0x2d68f8){return _0x2d68f8?{'count':_0x3baf6a,'rows':_0x2d68f8}:null;}})[_0x477f('0x24')](respondWithResult(_0x547773,null))[_0x477f('0x47')](handleError(_0x547773,null));};exports['addLists']=function(_0x17c9a1,_0x265c8d,_0x588f70){var _0x1d4134,_0x210112;var _0x55f76a=[];var _0x5f1d21=moment()[_0x477f('0x62')](_0x477f('0x63'));return db['Campaign'][_0x477f('0x46')]({'where':{'id':_0x17c9a1['params']['id']}})[_0x477f('0x24')](handleEntityNotFound(_0x265c8d,null))[_0x477f('0x24')](function(_0x164ba5){if(_0x164ba5){_0x210112=_0x164ba5;return _0x164ba5[_0x477f('0x64')](_0x17c9a1['body'][_0x477f('0x65')],_['omit'](_0x17c9a1[_0x477f('0x49')],['ids','id'])||{});}return null;})['spread'](function(_0xd596dc){var _0x1ddc2c;var _0x1da91;_0x1d4134=_0xd596dc||[];var _0x4a9143=[];if(_0xd596dc){for(var _0x74340d=0x0;_0x74340d<_0xd596dc[_0x477f('0x35')];_0x74340d+=0x1){var _0x787a74=_0xd596dc[_0x74340d][_0x477f('0x21')]({'plain':!![]});_0x210112[_0x477f('0x66')]=_0x17c9a1['body'][_0x477f('0x66')]?_0x17c9a1['body']['dialCheckDuplicateType']:_0x210112[_0x477f('0x66')];switch(_0x210112[_0x477f('0x66')]){case _0x477f('0x67'):_0x1ddc2c=squel[_0x477f('0x68')]()[_0x477f('0x69')](_0x477f('0x6a'))['fromQuery']([_0x477f('0x6b'),_0x477f('0x6c'),_0x477f('0x6d'),_0x477f('0x6e'),_0x477f('0x58'),_0x477f('0x53'),'updatedAt'],squel[_0x477f('0x6f')]()[_0x477f('0x70')]('phone',_0x477f('0x6b'))[_0x477f('0x70')](_0x477f('0x71'),'scheduledAt')[_0x477f('0x70')]('id','ContactId')[_0x477f('0x70')](_0x787a74[_0x477f('0x72')][_0x477f('0x73')](),_0x477f('0x6e'))[_0x477f('0x70')](_0x17c9a1[_0x477f('0x45')]['id'][_0x477f('0x73')](),_0x477f('0x58'))[_0x477f('0x70')]('\x27'+_0x5f1d21+'\x27',_0x477f('0x53'))[_0x477f('0x70')]('\x27'+_0x5f1d21+'\x27',_0x477f('0x54'))[_0x477f('0x74')](_0x477f('0x75'))[_0x477f('0x39')](_0x477f('0x76'))[_0x477f('0x39')](_0x477f('0x77'),_0x787a74[_0x477f('0x72')]['toString']())['where'](_0x477f('0x78'))[_0x477f('0x39')]('phone\x20NOT\x20IN\x20(?)',squel[_0x477f('0x6f')]()[_0x477f('0x70')](_0x477f('0x79'))['from']('cm_hopper_final')[_0x477f('0x39')]('CampaignId\x20=\x20?',_0x17c9a1[_0x477f('0x45')]['id'][_0x477f('0x73')]()))[_0x477f('0x39')](_0x477f('0x7a'),squel[_0x477f('0x6f')]()[_0x477f('0x70')](_0x477f('0x7b'))[_0x477f('0x74')](_0x477f('0x6a'))[_0x477f('0x39')](_0x477f('0x7c'),_0x17c9a1[_0x477f('0x45')]['id'][_0x477f('0x73')]())))[_0x477f('0x73')]();break;case'onlyIfOpen':_0x1ddc2c=squel['insert']()[_0x477f('0x69')](_0x477f('0x6a'))[_0x477f('0x7d')]([_0x477f('0x6b'),_0x477f('0x6c'),_0x477f('0x6d'),_0x477f('0x6e'),_0x477f('0x58'),_0x477f('0x53'),_0x477f('0x54')],squel[_0x477f('0x6f')]()[_0x477f('0x70')]('phone',_0x477f('0x6b'))[_0x477f('0x70')](_0x477f('0x71'),_0x477f('0x6c'))[_0x477f('0x70')]('id',_0x477f('0x6d'))[_0x477f('0x70')](_0x787a74['CmListId'][_0x477f('0x73')](),_0x477f('0x6e'))[_0x477f('0x70')](_0x17c9a1[_0x477f('0x45')]['id']['toString'](),_0x477f('0x58'))[_0x477f('0x70')]('\x27'+_0x5f1d21+'\x27',_0x477f('0x53'))[_0x477f('0x70')]('\x27'+_0x5f1d21+'\x27','updatedAt')[_0x477f('0x74')](_0x477f('0x75'))['where']('deletedAt\x20IS\x20NULL')[_0x477f('0x39')](_0x477f('0x77'),_0x787a74[_0x477f('0x72')][_0x477f('0x73')]())[_0x477f('0x39')](_0x477f('0x78'))['where']('phone\x20NOT\x20IN\x20(?)',squel[_0x477f('0x6f')]()[_0x477f('0x70')]('COALESCE(phone,\x27\x27)')[_0x477f('0x74')](_0x477f('0x6a'))[_0x477f('0x39')](_0x477f('0x7c'),_0x17c9a1[_0x477f('0x45')]['id'][_0x477f('0x73')]())))[_0x477f('0x73')]();break;default:_0x1ddc2c=squel[_0x477f('0x68')]()[_0x477f('0x69')](_0x477f('0x6a'))[_0x477f('0x7d')]([_0x477f('0x6b'),_0x477f('0x6c'),_0x477f('0x6d'),_0x477f('0x6e'),'CampaignId',_0x477f('0x53'),_0x477f('0x54')],squel['select']()[_0x477f('0x70')](_0x477f('0x6b'),'phone')[_0x477f('0x70')]('NOW()',_0x477f('0x6c'))[_0x477f('0x70')]('id',_0x477f('0x6d'))['field'](_0x787a74[_0x477f('0x72')][_0x477f('0x73')](),_0x477f('0x6e'))[_0x477f('0x70')](_0x17c9a1['params']['id'][_0x477f('0x73')](),_0x477f('0x58'))[_0x477f('0x70')]('\x27'+_0x5f1d21+'\x27',_0x477f('0x53'))[_0x477f('0x70')]('\x27'+_0x5f1d21+'\x27',_0x477f('0x54'))[_0x477f('0x74')](_0x477f('0x75'))['where'](_0x477f('0x76'))[_0x477f('0x39')](_0x477f('0x77'),_0x787a74['CmListId'][_0x477f('0x73')]())[_0x477f('0x39')](_0x477f('0x78')))[_0x477f('0x73')]();}_0x1da91=squel[_0x477f('0x68')]()[_0x477f('0x69')](_0x477f('0x7e'))[_0x477f('0x7d')]([_0x477f('0x7f'),_0x477f('0x6c'),_0x477f('0x6b'),_0x477f('0x80'),'createdAt','updatedAt'],squel['select']()[_0x477f('0x70')](_0x477f('0x81'),'id')['field'](_0x477f('0x71'),_0x477f('0x6c'))[_0x477f('0x70')](_0x477f('0x82'),_0x477f('0x6b'))['field'](_0x477f('0x83'),_0x477f('0x80'))[_0x477f('0x70')]('\x27'+_0x5f1d21+'\x27','createdAt')[_0x477f('0x70')]('\x27'+_0x5f1d21+'\x27',_0x477f('0x54'))['from'](_0x477f('0x84'),'ci')[_0x477f('0x85')]('cm_hopper','h',_0x477f('0x86'))[_0x477f('0x39')](_0x477f('0x87'),_0x787a74[_0x477f('0x72')][_0x477f('0x73')]())[_0x477f('0x39')](_0x477f('0x88'),_0x17c9a1[_0x477f('0x45')]['id']['toString']())['where']('h.createdAt\x20=\x20?',_0x5f1d21))[_0x477f('0x73')]();_0x4a9143[_0x477f('0x89')](db[_0x477f('0x8a')]['query'](_0x1ddc2c));_0x55f76a[_0x477f('0x89')](db[_0x477f('0x8a')][_0x477f('0x2f')](_0x1da91));}return BPromise[_0x477f('0x8b')](_0x4a9143);}})[_0x477f('0x24')](function(){return BPromise[_0x477f('0x8b')](_0x55f76a);})['then'](function(){return _0x1d4134;})[_0x477f('0x24')](respondWithResult(_0x265c8d,null))[_0x477f('0x47')](handleError(_0x265c8d,null));};exports['removeLists']=function(_0xe9dcc1,_0xe86e97,_0x1c3a68){return db[_0x477f('0x41')][_0x477f('0x46')]({'where':{'id':_0xe9dcc1[_0x477f('0x45')]['id']}})['then'](handleEntityNotFound(_0xe86e97,null))[_0x477f('0x24')](function(_0x3e82df){if(_0x3e82df){return _0x3e82df[_0x477f('0x8c')](_0xe9dcc1[_0x477f('0x2f')][_0x477f('0x65')]);}})[_0x477f('0x24')](function(_0x2e0d8f){if(_0x2e0d8f){return db['CmHopper'][_0x477f('0x20')]({'where':{'ListId':_0xe9dcc1[_0x477f('0x2f')][_0x477f('0x65')],'CampaignId':_0xe9dcc1['params']['id']}})[_0x477f('0x24')](function(){return _0x2e0d8f;});}})[_0x477f('0x24')](respondWithStatusCode(_0xe86e97,null))[_0x477f('0x47')](handleError(_0xe86e97,null));};exports[_0x477f('0x8d')]=function(_0x59c23b,_0x17a62a,_0x133b48){var _0x170f18={};var _0x361c36={};var _0x427517;var _0x3caea4;return db[_0x477f('0x41')][_0x477f('0x56')]({'where':{'id':_0x59c23b['params']['id']}})[_0x477f('0x24')](handleEntityNotFound(_0x17a62a,null))['then'](function(_0x15f818){if(_0x15f818){_0x427517=_0x15f818;_0x361c36[_0x477f('0x31')]=_['keys'](db[_0x477f('0x8e')]['rawAttributes']);_0x361c36[_0x477f('0x2f')]=_[_0x477f('0x30')](_0x59c23b[_0x477f('0x2f')]);_0x361c36[_0x477f('0x3a')]=_[_0x477f('0x33')](_0x361c36[_0x477f('0x31')],_0x361c36[_0x477f('0x2f')]);_0x170f18[_0x477f('0x32')]=_[_0x477f('0x33')](_0x361c36['model'],qs['fields'](_0x59c23b['query'][_0x477f('0x34')]));_0x170f18[_0x477f('0x32')]=_0x170f18['attributes']['length']?_0x170f18[_0x477f('0x32')]:_0x361c36[_0x477f('0x31')];_0x170f18[_0x477f('0x38')]=qs['sort'](_0x59c23b[_0x477f('0x2f')][_0x477f('0x5c')]);_0x170f18[_0x477f('0x39')]=qs[_0x477f('0x3a')](_[_0x477f('0x3b')](_0x59c23b[_0x477f('0x2f')],_0x361c36[_0x477f('0x3a')]));if(_0x59c23b[_0x477f('0x2f')][_0x477f('0x3c')]){_0x170f18[_0x477f('0x39')]=_['merge'](_0x170f18[_0x477f('0x39')],{'$or':_[_0x477f('0x2e')](_0x170f18[_0x477f('0x32')],function(_0x291110){var _0x5657b9={};_0x5657b9[_0x291110]={'$like':'%'+_0x59c23b[_0x477f('0x2f')][_0x477f('0x3c')]+'%'};return _0x5657b9;})});}_0x170f18=_[_0x477f('0x3d')]({},_0x170f18,_0x59c23b[_0x477f('0x40')]);return _0x427517[_0x477f('0x8d')](_0x170f18);}})[_0x477f('0x24')](function(_0x2ecc31){if(_0x2ecc31){_0x3caea4=_0x2ecc31[_0x477f('0x35')];if(!_0x59c23b['query']['hasOwnProperty'](_0x477f('0x37'))){_0x170f18[_0x477f('0x1c')]=qs[_0x477f('0x1c')](_0x59c23b[_0x477f('0x2f')][_0x477f('0x1c')]);_0x170f18[_0x477f('0x1a')]=qs['offset'](_0x59c23b['query'][_0x477f('0x1a')]);}return _0x427517[_0x477f('0x8d')](_0x170f18);}})[_0x477f('0x24')](function(_0xc329b1){if(_0xc329b1){return _0xc329b1?{'count':_0x3caea4,'rows':_0xc329b1}:null;}})[_0x477f('0x24')](respondWithResult(_0x17a62a,null))[_0x477f('0x47')](handleError(_0x17a62a,null));};exports[_0x477f('0x8f')]=function(_0x2f9299,_0x454450,_0xf24a7b){var _0x310861,_0x16cb5e;var _0x153b86=[];var _0x1f2ce6=moment()[_0x477f('0x62')](_0x477f('0x63'));return db['Campaign'][_0x477f('0x46')]({'where':{'id':_0x2f9299['params']['id']}})[_0x477f('0x24')](handleEntityNotFound(_0x454450,null))['then'](function(_0x5db7af){if(_0x5db7af){_0x16cb5e=_0x5db7af;return _0x5db7af[_0x477f('0x8f')](_0x2f9299[_0x477f('0x49')][_0x477f('0x65')],_['omit'](_0x2f9299[_0x477f('0x49')],[_0x477f('0x65'),'id'])||{});}return null;})['spread'](function(_0x5af7d8){var _0x4227d7;var _0x30bc0d;_0x310861=_0x5af7d8||[];var _0x200bff=[];if(_0x5af7d8){for(var _0xaa954b=0x0;_0xaa954b<_0x5af7d8[_0x477f('0x35')];_0xaa954b+=0x1){var _0x272b62=_0x5af7d8[_0xaa954b]['get']({'plain':!![]});_0x4227d7=squel[_0x477f('0x68')]()[_0x477f('0x69')](_0x477f('0x90'))['fromQuery']([_0x477f('0x6b'),'ContactId',_0x477f('0x6e'),_0x477f('0x58'),_0x477f('0x53'),_0x477f('0x54')],squel[_0x477f('0x6f')]()[_0x477f('0x70')](_0x477f('0x6b'),'phone')[_0x477f('0x70')]('id',_0x477f('0x6d'))[_0x477f('0x70')](_0x272b62[_0x477f('0x72')][_0x477f('0x73')](),'ListId')[_0x477f('0x70')](_0x2f9299[_0x477f('0x45')]['id'][_0x477f('0x73')](),_0x477f('0x58'))['field'](_0x477f('0x71'),'createdAt')[_0x477f('0x70')](_0x477f('0x71'),'updatedAt')[_0x477f('0x74')](_0x477f('0x75'))['where']('deletedAt\x20IS\x20NULL')[_0x477f('0x39')](_0x477f('0x77'),_0x272b62['CmListId'][_0x477f('0x73')]())[_0x477f('0x39')](_0x477f('0x78')))['toString']();_0x200bff[_0x477f('0x89')](db['sequelize']['query'](_0x4227d7));}return BPromise[_0x477f('0x8b')](_0x200bff);}})[_0x477f('0x24')](function(){return _0x310861;})[_0x477f('0x24')](respondWithResult(_0x454450,null))[_0x477f('0x47')](handleError(_0x454450,null));};exports[_0x477f('0x91')]=function(_0x51d469,_0x4baa80,_0x31ecb2){return db[_0x477f('0x41')][_0x477f('0x46')]({'where':{'id':_0x51d469[_0x477f('0x45')]['id']}})[_0x477f('0x24')](handleEntityNotFound(_0x4baa80,null))['then'](function(_0x30cc2b){if(_0x30cc2b){return _0x30cc2b[_0x477f('0x91')](_0x51d469[_0x477f('0x2f')]['ids']);}})['then'](function(_0x3bba46){if(_0x3bba46){return db['CmHopperBlack']['destroy']({'where':{'ListId':_0x51d469['query'][_0x477f('0x65')],'CampaignId':_0x51d469['params']['id']}})[_0x477f('0x24')](function(){return _0x3bba46;});}})[_0x477f('0x24')](respondWithStatusCode(_0x4baa80,null))[_0x477f('0x47')](handleError(_0x4baa80,null));};
\ No newline at end of file
diff --git a/server/api/campaign/campaign.model.js b/server/api/campaign/campaign.model.js
index f4df359..6e56022 100644
--- a/server/api/campaign/campaign.model.js
+++ b/server/api/campaign/campaign.model.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x9957=['exports','define','Campaign','lodash','util','../../config/logger','api','bluebird','request-promise','path','rimraf','./campaign.attributes'];(function(_0x176329,_0x568c84){var _0x31997c=function(_0x3d64df){while(--_0x3d64df){_0x176329['push'](_0x176329['shift']());}};_0x31997c(++_0x568c84);}(_0x9957,0x93));var _0x7995=function(_0x1facfa,_0x1acf7d){_0x1facfa=_0x1facfa-0x0;var _0x9ec701=_0x9957[_0x1facfa];return _0x9ec701;};'use strict';var _=require(_0x7995('0x0'));var util=require(_0x7995('0x1'));var logger=require(_0x7995('0x2'))(_0x7995('0x3'));var moment=require('moment');var BPromise=require(_0x7995('0x4'));var rp=require(_0x7995('0x5'));var fs=require('fs');var path=require(_0x7995('0x6'));var rimraf=require(_0x7995('0x7'));var config=require('../../config/environment');var attributes=require(_0x7995('0x8'));module[_0x7995('0x9')]=function(_0x137b6b,_0x219534){return _0x137b6b[_0x7995('0xa')](_0x7995('0xb'),attributes,{'tableName':'campaigns','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x9957=['exports','define','Campaign','lodash','util','../../config/logger','api','bluebird','request-promise','path','rimraf','./campaign.attributes'];(function(_0x22b68a,_0x2bffc3){var _0x1ac67a=function(_0x25f9d5){while(--_0x25f9d5){_0x22b68a['push'](_0x22b68a['shift']());}};_0x1ac67a(++_0x2bffc3);}(_0x9957,0x93));var _0x7995=function(_0x5b644e,_0x2e5e07){_0x5b644e=_0x5b644e-0x0;var _0x49c6bf=_0x9957[_0x5b644e];return _0x49c6bf;};'use strict';var _=require(_0x7995('0x0'));var util=require(_0x7995('0x1'));var logger=require(_0x7995('0x2'))(_0x7995('0x3'));var moment=require('moment');var BPromise=require(_0x7995('0x4'));var rp=require(_0x7995('0x5'));var fs=require('fs');var path=require(_0x7995('0x6'));var rimraf=require(_0x7995('0x7'));var config=require('../../config/environment');var attributes=require(_0x7995('0x8'));module[_0x7995('0x9')]=function(_0x137b6b,_0x219534){return _0x137b6b[_0x7995('0xa')](_0x7995('0xb'),attributes,{'tableName':'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 3d977be..ced9d11 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 _0x136c=['include','map','model','then','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','info','Campaign,\x20%s,\x20%s','request\x20sent','debug','Campaign,\x20%s,\x20%s,\x20%s','stringify','error','message','catch','GetCampaign','Campaign','options','raw','where','attributes','limit'];(function(_0x54f609,_0x50b70d){var _0x13522e=function(_0x27546c){while(--_0x27546c){_0x54f609['push'](_0x54f609['shift']());}};_0x13522e(++_0x50b70d);}(_0x136c,0x1d2));var _0xc136=function(_0x7b203c,_0x4db126){_0x7b203c=_0x7b203c-0x0;var _0x26098b=_0x136c[_0x7b203c];return _0x26098b;};'use strict';var _=require(_0xc136('0x0'));var util=require(_0xc136('0x1'));var moment=require('moment');var BPromise=require(_0xc136('0x2'));var rs=require(_0xc136('0x3'));var fs=require('fs');var Redis=require(_0xc136('0x4'));var db=require(_0xc136('0x5'))['db'];var utils=require(_0xc136('0x6'));var logger=require(_0xc136('0x7'))(_0xc136('0x8'));var config=require(_0xc136('0x9'));var jayson=require(_0xc136('0xa'));var client=jayson['client'][_0xc136('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x594112,_0x361a52,_0x3993f2){return new BPromise(function(_0x1804c1,_0x500376){return client[_0xc136('0xc')](_0x594112,_0x3993f2)['then'](function(_0x1ea07d){logger[_0xc136('0xd')](_0xc136('0xe'),_0x361a52,_0xc136('0xf'));logger[_0xc136('0x10')](_0xc136('0x11'),_0x361a52,_0xc136('0xf'),JSON[_0xc136('0x12')](_0x1ea07d));if(_0x1ea07d[_0xc136('0x13')]){if(_0x1ea07d['error']['code']===0x1f4){logger[_0xc136('0x13')]('Campaign,\x20%s,\x20%s',_0x361a52,_0x1ea07d[_0xc136('0x13')][_0xc136('0x14')]);return _0x500376(_0x1ea07d[_0xc136('0x13')]['message']);}logger['error'](_0xc136('0xe'),_0x361a52,_0x1ea07d[_0xc136('0x13')][_0xc136('0x14')]);return _0x1804c1(_0x1ea07d['error']['message']);}else{logger[_0xc136('0xd')](_0xc136('0xe'),_0x361a52,'request\x20sent');_0x1804c1(_0x1ea07d['result']['message']);}})[_0xc136('0x15')](function(_0x3daf55){logger[_0xc136('0x13')](_0xc136('0xe'),_0x361a52,_0x3daf55);_0x500376(_0x3daf55);});});}exports[_0xc136('0x16')]=function(_0x1ccf5f){var _0x59503b=this;return new Promise(function(_0x5df9b7,_0x4d56cb){return db[_0xc136('0x17')]['findAll']({'raw':_0x1ccf5f[_0xc136('0x18')]?_0x1ccf5f[_0xc136('0x18')][_0xc136('0x19')]===undefined?!![]:![]:!![],'where':_0x1ccf5f[_0xc136('0x18')]?_0x1ccf5f['options'][_0xc136('0x1a')]||null:null,'attributes':_0x1ccf5f[_0xc136('0x18')]?_0x1ccf5f['options'][_0xc136('0x1b')]||null:null,'limit':_0x1ccf5f['options']?_0x1ccf5f['options'][_0xc136('0x1c')]||null:null,'include':_0x1ccf5f[_0xc136('0x18')]?_0x1ccf5f['options'][_0xc136('0x1d')]?_[_0xc136('0x1e')](_0x1ccf5f[_0xc136('0x18')][_0xc136('0x1d')],function(_0x5d8300){return{'model':db[_0x5d8300[_0xc136('0x1f')]],'as':_0x5d8300['as'],'attributes':_0x5d8300[_0xc136('0x1b')],'include':_0x5d8300['include']?_[_0xc136('0x1e')](_0x5d8300['include'],function(_0x21a163){return{'model':db[_0x21a163[_0xc136('0x1f')]],'as':_0x21a163['as'],'attributes':_0x21a163['attributes'],'include':_0x21a163['include']?_[_0xc136('0x1e')](_0x21a163[_0xc136('0x1d')],function(_0x549a60){return{'model':db[_0x549a60[_0xc136('0x1f')]],'as':_0x549a60['as'],'attributes':_0x549a60[_0xc136('0x1b')]};}):[]};}):[]};}):[]:[]})[_0xc136('0x20')](function(_0x2608b8){logger[_0xc136('0xd')](_0xc136('0x16'),_0x1ccf5f);logger[_0xc136('0x10')]('GetCampaign',_0x1ccf5f,JSON[_0xc136('0x12')](_0x2608b8));_0x5df9b7(_0x2608b8);})[_0xc136('0x15')](function(_0x1ad50f){logger[_0xc136('0x13')](_0xc136('0x16'),_0x1ad50f[_0xc136('0x14')],_0x1ccf5f);_0x4d56cb(_0x59503b[_0xc136('0x13')](0x1f4,_0x1ad50f[_0xc136('0x14')]));});});};
\ No newline at end of file
+var _0x8b29=['GetCampaign','findAll','options','raw','where','attributes','map','include','model','catch','lodash','moment','bluebird','../../mysqldb','../../config/utils','rpc','jayson/promise','client','http','request','then','Campaign,\x20%s,\x20%s','request\x20sent','debug','Campaign,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info'];(function(_0x310b61,_0x17e19c){var _0x426630=function(_0x26b871){while(--_0x26b871){_0x310b61['push'](_0x310b61['shift']());}};_0x426630(++_0x17e19c);}(_0x8b29,0xbe));var _0x98b2=function(_0x3e850c,_0x1e5575){_0x3e850c=_0x3e850c-0x0;var _0x912b2=_0x8b29[_0x3e850c];return _0x912b2;};'use strict';var _=require(_0x98b2('0x0'));var util=require('util');var moment=require(_0x98b2('0x1'));var BPromise=require(_0x98b2('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x98b2('0x3'))['db'];var utils=require(_0x98b2('0x4'));var logger=require('../../config/logger')(_0x98b2('0x5'));var config=require('../../config/environment');var jayson=require(_0x98b2('0x6'));var client=jayson[_0x98b2('0x7')][_0x98b2('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x3e7ef5,_0x221cee,_0x2cd0cb){return new BPromise(function(_0x417ca6,_0x388827){return client[_0x98b2('0x9')](_0x3e7ef5,_0x2cd0cb)[_0x98b2('0xa')](function(_0x501b51){logger['info'](_0x98b2('0xb'),_0x221cee,_0x98b2('0xc'));logger[_0x98b2('0xd')](_0x98b2('0xe'),_0x221cee,_0x98b2('0xc'),JSON[_0x98b2('0xf')](_0x501b51));if(_0x501b51['error']){if(_0x501b51[_0x98b2('0x10')][_0x98b2('0x11')]===0x1f4){logger['error'](_0x98b2('0xb'),_0x221cee,_0x501b51[_0x98b2('0x10')][_0x98b2('0x12')]);return _0x388827(_0x501b51['error']['message']);}logger[_0x98b2('0x10')]('Campaign,\x20%s,\x20%s',_0x221cee,_0x501b51[_0x98b2('0x10')]['message']);return _0x417ca6(_0x501b51['error']['message']);}else{logger[_0x98b2('0x13')](_0x98b2('0xb'),_0x221cee,_0x98b2('0xc'));_0x417ca6(_0x501b51['result']['message']);}})['catch'](function(_0x389d22){logger[_0x98b2('0x10')](_0x98b2('0xb'),_0x221cee,_0x389d22);_0x388827(_0x389d22);});});}exports[_0x98b2('0x14')]=function(_0x4b9f2c){var _0x1cd8c6=this;return new Promise(function(_0x588837,_0x989082){return db['Campaign'][_0x98b2('0x15')]({'raw':_0x4b9f2c[_0x98b2('0x16')]?_0x4b9f2c[_0x98b2('0x16')][_0x98b2('0x17')]===undefined?!![]:![]:!![],'where':_0x4b9f2c['options']?_0x4b9f2c[_0x98b2('0x16')][_0x98b2('0x18')]||null:null,'attributes':_0x4b9f2c['options']?_0x4b9f2c['options'][_0x98b2('0x19')]||null:null,'limit':_0x4b9f2c[_0x98b2('0x16')]?_0x4b9f2c['options']['limit']||null:null,'include':_0x4b9f2c[_0x98b2('0x16')]?_0x4b9f2c[_0x98b2('0x16')]['include']?_[_0x98b2('0x1a')](_0x4b9f2c[_0x98b2('0x16')][_0x98b2('0x1b')],function(_0x4f33d8){return{'model':db[_0x4f33d8[_0x98b2('0x1c')]],'as':_0x4f33d8['as'],'attributes':_0x4f33d8['attributes'],'include':_0x4f33d8[_0x98b2('0x1b')]?_['map'](_0x4f33d8['include'],function(_0x7b6ebc){return{'model':db[_0x7b6ebc[_0x98b2('0x1c')]],'as':_0x7b6ebc['as'],'attributes':_0x7b6ebc[_0x98b2('0x19')],'include':_0x7b6ebc['include']?_['map'](_0x7b6ebc['include'],function(_0x11c6aa){return{'model':db[_0x11c6aa[_0x98b2('0x1c')]],'as':_0x11c6aa['as'],'attributes':_0x11c6aa['attributes']};}):[]};}):[]};}):[]:[]})[_0x98b2('0xa')](function(_0x28db65){logger[_0x98b2('0x13')]('GetCampaign',_0x4b9f2c);logger[_0x98b2('0xd')](_0x98b2('0x14'),_0x4b9f2c,JSON[_0x98b2('0xf')](_0x28db65));_0x588837(_0x28db65);})[_0x98b2('0x1d')](function(_0x25393d){logger['error'](_0x98b2('0x14'),_0x25393d['message'],_0x4b9f2c);_0x989082(_0x1cd8c6[_0x98b2('0x10')](0x1f4,_0x25393d[_0x98b2('0x12')]));});});};
\ No newline at end of file
diff --git a/server/api/campaign/index.js b/server/api/campaign/index.js
index 90f8e08..e960084 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 _0xa884=['/:id/hoppers','getHoppers','/:id/hopper_histories','getHopperHistories','/:id/hopper_finals','getHopperFinals','/:id/hopper_black','getHopperBlacks','getLists','/:id/blacklists','getBlackLists','create','post','clone','addLists','addBlackLists','put','update','/:id/lists','removeLists','delete','exports','multer','util','path','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./campaign.controller','get','index','/:id','isAuthenticated','show'];(function(_0x33d8a9,_0x4d0f1a){var _0x19894c=function(_0x591b78){while(--_0x591b78){_0x33d8a9['push'](_0x33d8a9['shift']());}};_0x19894c(++_0x4d0f1a);}(_0xa884,0x15a));var _0x4a88=function(_0x32c012,_0xe3c576){_0x32c012=_0x32c012-0x0;var _0x48562e=_0xa884[_0x32c012];return _0x48562e;};'use strict';var multer=require(_0x4a88('0x0'));var util=require(_0x4a88('0x1'));var path=require(_0x4a88('0x2'));var timeout=require('connect-timeout');var express=require(_0x4a88('0x3'));var router=express[_0x4a88('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x4a88('0x5'));var interaction=require(_0x4a88('0x6'));var config=require(_0x4a88('0x7'));var controller=require(_0x4a88('0x8'));router[_0x4a88('0x9')]('/',auth['isAuthenticated'](),controller[_0x4a88('0xa')]);router['get'](_0x4a88('0xb'),auth[_0x4a88('0xc')](),controller[_0x4a88('0xd')]);router[_0x4a88('0x9')](_0x4a88('0xe'),auth['isAuthenticated'](),controller[_0x4a88('0xf')]);router['get'](_0x4a88('0x10'),auth[_0x4a88('0xc')](),controller[_0x4a88('0x11')]);router[_0x4a88('0x9')](_0x4a88('0x12'),auth['isAuthenticated'](),controller[_0x4a88('0x13')]);router[_0x4a88('0x9')](_0x4a88('0x14'),auth[_0x4a88('0xc')](),controller[_0x4a88('0x15')]);router[_0x4a88('0x9')]('/:id/lists',auth[_0x4a88('0xc')](),controller[_0x4a88('0x16')]);router[_0x4a88('0x9')](_0x4a88('0x17'),auth[_0x4a88('0xc')](),controller[_0x4a88('0x18')]);router['post']('/',auth[_0x4a88('0xc')](),controller[_0x4a88('0x19')]);router[_0x4a88('0x1a')]('/:id/clone',auth[_0x4a88('0xc')](),controller[_0x4a88('0x1b')]);router[_0x4a88('0x1a')]('/:id/lists',auth['isAuthenticated'](),controller[_0x4a88('0x1c')]);router[_0x4a88('0x1a')]('/:id/blacklists',auth[_0x4a88('0xc')](),controller[_0x4a88('0x1d')]);router[_0x4a88('0x1e')]('/:id',auth[_0x4a88('0xc')](),controller[_0x4a88('0x1f')]);router['delete']('/:id',auth[_0x4a88('0xc')](),controller['destroy']);router['delete'](_0x4a88('0x20'),auth[_0x4a88('0xc')](),controller[_0x4a88('0x21')]);router[_0x4a88('0x22')](_0x4a88('0x17'),auth[_0x4a88('0xc')](),controller['removeBlackLists']);module[_0x4a88('0x23')]=router;
\ No newline at end of file
+var _0xc3b0=['/:id/hopper_histories','getHopperHistories','/:id/hopper_finals','getHopperFinals','getLists','/:id/blacklists','getBlackLists','/:id/clone','clone','post','/:id/lists','put','update','delete','removeLists','removeBlackLists','exports','multer','util','path','connect-timeout','fs-extra','../../components/auth/service','../../config/environment','./campaign.controller','get','index','/:id','/:id/hoppers','isAuthenticated','getHoppers'];(function(_0x11cc64,_0x16499f){var _0x5ae080=function(_0x4335b3){while(--_0x4335b3){_0x11cc64['push'](_0x11cc64['shift']());}};_0x5ae080(++_0x16499f);}(_0xc3b0,0x166));var _0x0c3b=function(_0x1d6ece,_0x177a0e){_0x1d6ece=_0x1d6ece-0x0;var _0x5f2ea3=_0xc3b0[_0x1d6ece];return _0x5f2ea3;};'use strict';var multer=require(_0x0c3b('0x0'));var util=require(_0x0c3b('0x1'));var path=require(_0x0c3b('0x2'));var timeout=require(_0x0c3b('0x3'));var express=require('express');var router=express['Router']();var fs_extra=require(_0x0c3b('0x4'));var auth=require(_0x0c3b('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x0c3b('0x6'));var controller=require(_0x0c3b('0x7'));router[_0x0c3b('0x8')]('/',auth['isAuthenticated'](),controller[_0x0c3b('0x9')]);router[_0x0c3b('0x8')](_0x0c3b('0xa'),auth['isAuthenticated'](),controller['show']);router['get'](_0x0c3b('0xb'),auth[_0x0c3b('0xc')](),controller[_0x0c3b('0xd')]);router[_0x0c3b('0x8')](_0x0c3b('0xe'),auth[_0x0c3b('0xc')](),controller[_0x0c3b('0xf')]);router[_0x0c3b('0x8')](_0x0c3b('0x10'),auth[_0x0c3b('0xc')](),controller[_0x0c3b('0x11')]);router[_0x0c3b('0x8')]('/:id/hopper_black',auth[_0x0c3b('0xc')](),controller['getHopperBlacks']);router[_0x0c3b('0x8')]('/:id/lists',auth[_0x0c3b('0xc')](),controller[_0x0c3b('0x12')]);router[_0x0c3b('0x8')](_0x0c3b('0x13'),auth[_0x0c3b('0xc')](),controller[_0x0c3b('0x14')]);router['post']('/',auth[_0x0c3b('0xc')](),controller['create']);router['post'](_0x0c3b('0x15'),auth[_0x0c3b('0xc')](),controller[_0x0c3b('0x16')]);router[_0x0c3b('0x17')](_0x0c3b('0x18'),auth['isAuthenticated'](),controller['addLists']);router[_0x0c3b('0x17')](_0x0c3b('0x13'),auth[_0x0c3b('0xc')](),controller['addBlackLists']);router[_0x0c3b('0x19')](_0x0c3b('0xa'),auth[_0x0c3b('0xc')](),controller[_0x0c3b('0x1a')]);router[_0x0c3b('0x1b')](_0x0c3b('0xa'),auth[_0x0c3b('0xc')](),controller['destroy']);router[_0x0c3b('0x1b')]('/:id/lists',auth[_0x0c3b('0xc')](),controller[_0x0c3b('0x1c')]);router[_0x0c3b('0x1b')](_0x0c3b('0x13'),auth[_0x0c3b('0xc')](),controller[_0x0c3b('0x1d')]);module[_0x0c3b('0x1e')]=router;
\ No newline at end of file
diff --git a/server/api/cannedAnswer/cannedAnswer.attributes.js b/server/api/cannedAnswer/cannedAnswer.attributes.js
index f0c8327..2aa316a 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 _0xb9f7=['key','sequelize','STRING','TEXT','medium','VIRTUAL','getDataValue'];(function(_0x3909ae,_0x3183c7){var _0x15000b=function(_0x591ff5){while(--_0x591ff5){_0x3909ae['push'](_0x3909ae['shift']());}};_0x15000b(++_0x3183c7);}(_0xb9f7,0xf6));var _0x7b9f=function(_0x125ff8,_0x41925f){_0x125ff8=_0x125ff8-0x0;var _0x2d9ef=_0xb9f7[_0x125ff8];return _0x2d9ef;};'use strict';var Sequelize=require(_0x7b9f('0x0'));module['exports']={'key':{'type':Sequelize[_0x7b9f('0x1')],'allowNull':![]},'value':{'type':Sequelize[_0x7b9f('0x2')],'length':_0x7b9f('0x3'),'allowNull':![]},'description':{'type':Sequelize[_0x7b9f('0x1')]},'name':{'type':Sequelize[_0x7b9f('0x4')],'get':function(){return this[_0x7b9f('0x5')](_0x7b9f('0x6'));}}};
\ No newline at end of file
+var _0x3f1b=['medium','VIRTUAL','getDataValue','key','sequelize','STRING','TEXT'];(function(_0x75fa10,_0x3f6194){var _0x2bbb6b=function(_0x29aa77){while(--_0x29aa77){_0x75fa10['push'](_0x75fa10['shift']());}};_0x2bbb6b(++_0x3f6194);}(_0x3f1b,0x6d));var _0xb3f1=function(_0xfcb4af,_0x294f24){_0xfcb4af=_0xfcb4af-0x0;var _0x5cba4b=_0x3f1b[_0xfcb4af];return _0x5cba4b;};'use strict';var Sequelize=require(_0xb3f1('0x0'));module['exports']={'key':{'type':Sequelize[_0xb3f1('0x1')],'allowNull':![]},'value':{'type':Sequelize[_0xb3f1('0x2')],'length':_0xb3f1('0x3'),'allowNull':![]},'description':{'type':Sequelize[_0xb3f1('0x1')]},'name':{'type':Sequelize[_0xb3f1('0x4')],'get':function(){return this[_0xb3f1('0x5')](_0xb3f1('0x6'));}}};
\ No newline at end of file
diff --git a/server/api/cannedAnswer/cannedAnswer.controller.js b/server/api/cannedAnswer/cannedAnswer.controller.js
index 291896a..0641dce 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 _0x86bf=['includeAll','include','findAll','rows','catch','show','params','find','body','create','MailAccountId','SmsAccountId','OpenchannelAccountId','ChatWebsiteId','Sequelize','ValidationError','The\x20inserted\x20key\x20already\x20exists.','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','rimraf','zip-dir','moment','util','sox','ejs','lodash','squel','crypto','jsforce','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','update','then','destroy','get','CannedAnswers','UserProfileResource','name','send','index','map','CannedAnswer','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','nolimit','order','sort','where','pick','filter','merge'];(function(_0x54a3ed,_0x18d540){var _0xb20ccc=function(_0x3475af){while(--_0x3475af){_0x54a3ed['push'](_0x54a3ed['shift']());}};_0xb20ccc(++_0x18d540);}(_0x86bf,0xc4));var _0xf86b=function(_0x426086,_0x4cf84c){_0x426086=_0x426086-0x0;var _0xaecb04=_0x86bf[_0x426086];return _0xaecb04;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xf86b('0x0'));var zipdir=require(_0xf86b('0x1'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0xf86b('0x2'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0xf86b('0x3'));var path=require('path');var sox=require(_0xf86b('0x4'));var csv=require('to-csv');var ejs=require(_0xf86b('0x5'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xf86b('0x6'));var squel=require(_0xf86b('0x7'));var crypto=require(_0xf86b('0x8'));var jsforce=require(_0xf86b('0x9'));var deskjs=require('desk.js');var toCsv=require(_0xf86b('0xa'));var querystring=require(_0xf86b('0xb'));var Papa=require(_0xf86b('0xc'));var Redis=require(_0xf86b('0xd'));var authService=require(_0xf86b('0xe'));var qs=require('../../components/parsers/qs');var as=require(_0xf86b('0xf'));var hardwareService=require(_0xf86b('0x10'));var logger=require(_0xf86b('0x11'))('api');var utils=require(_0xf86b('0x12'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0xf86b('0x13'))['db'];function respondWithStatusCode(_0x5f05db,_0x30f340){_0x30f340=_0x30f340||0xcc;return function(_0x16bc10){if(_0x16bc10){return _0x5f05db[_0xf86b('0x14')](_0x30f340);}return _0x5f05db[_0xf86b('0x15')](_0x30f340)[_0xf86b('0x16')]();};}function respondWithResult(_0xb01d48,_0xf371ea){_0xf371ea=_0xf371ea||0xc8;return function(_0x3190b6){if(_0x3190b6){return _0xb01d48[_0xf86b('0x15')](_0xf371ea)[_0xf86b('0x17')](_0x3190b6);}};}function respondWithFilteredResult(_0x223453,_0x559a84){return function(_0x581044){if(_0x581044){var _0x30ff01=typeof _0x559a84[_0xf86b('0x18')]===_0xf86b('0x19')&&typeof _0x559a84[_0xf86b('0x1a')]==='undefined';var _0x10b060=_0x581044['count'];var _0x4e2223=_0x30ff01?0x0:_0x559a84[_0xf86b('0x18')];var _0x45e92c=_0x30ff01?_0x581044[_0xf86b('0x1b')]:_0x559a84[_0xf86b('0x18')]+_0x559a84[_0xf86b('0x1a')];var _0x35e079;if(_0x45e92c>=_0x10b060){_0x45e92c=_0x10b060;_0x35e079=0xc8;}else{_0x35e079=0xce;}_0x223453[_0xf86b('0x15')](_0x35e079);return _0x223453[_0xf86b('0x1c')](_0xf86b('0x1d'),_0x4e2223+'-'+_0x45e92c+'/'+_0x10b060)[_0xf86b('0x17')](_0x581044);}return null;};}function patchUpdates(_0x111f68){return function(_0x31026d){try{jsonpatch[_0xf86b('0x1e')](_0x31026d,_0x111f68,!![]);}catch(_0x46024e){return BPromise[_0xf86b('0x1f')](_0x46024e);}return _0x31026d['save']();};}function saveUpdates(_0x492439,_0x16782e){return function(_0x198460){if(_0x198460){return _0x198460[_0xf86b('0x20')](_0x492439)[_0xf86b('0x21')](function(_0xf1cdfc){return _0xf1cdfc;});}return null;};}function removeEntity(_0x72749e,_0x31bb05){return function(_0xd9bdba){if(_0xd9bdba){return _0xd9bdba[_0xf86b('0x22')]()[_0xf86b('0x21')](function(){var _0x39a8bc=_0xd9bdba[_0xf86b('0x23')]({'plain':!![]});var _0x4a8e75=_0xf86b('0x24');return db[_0xf86b('0x25')]['destroy']({'where':{'type':_0x4a8e75,'resourceId':_0x39a8bc['id']}})['then'](function(){return _0xd9bdba;});})[_0xf86b('0x21')](function(){_0x72749e['status'](0xcc)[_0xf86b('0x16')]();});}};}function handleEntityNotFound(_0x5b19c5,_0x286118){return function(_0x5730d4){if(!_0x5730d4){_0x5b19c5[_0xf86b('0x14')](0x194);}return _0x5730d4;};}function handleError(_0x20b615,_0x212c28){_0x212c28=_0x212c28||0x1f4;return function(_0x26247d){logger['error'](_0x26247d['stack']);if(_0x26247d['name']){delete _0x26247d[_0xf86b('0x26')];}_0x20b615['status'](_0x212c28)[_0xf86b('0x27')](_0x26247d);};}exports[_0xf86b('0x28')]=function(_0x1733be,_0x470459){var _0xc5da82={},_0x44b40a={},_0x5c01b7={'count':0x0,'rows':[]};var _0x196855=_[_0xf86b('0x29')](db[_0xf86b('0x2a')][_0xf86b('0x2b')],function(_0x206e33){return{'name':_0x206e33[_0xf86b('0x2c')],'type':_0x206e33[_0xf86b('0x2d')][_0xf86b('0x2e')]};});_0x44b40a[_0xf86b('0x2f')]=_[_0xf86b('0x29')](_0x196855,_0xf86b('0x26'));_0x44b40a[_0xf86b('0x30')]=_[_0xf86b('0x31')](_0x1733be['query']);_0x44b40a[_0xf86b('0x32')]=_[_0xf86b('0x33')](_0x44b40a[_0xf86b('0x2f')],_0x44b40a[_0xf86b('0x30')]);_0xc5da82[_0xf86b('0x34')]=_['intersection'](_0x44b40a[_0xf86b('0x2f')],qs['fields'](_0x1733be['query'][_0xf86b('0x35')]));_0xc5da82['attributes']=_0xc5da82[_0xf86b('0x34')][_0xf86b('0x36')]?_0xc5da82[_0xf86b('0x34')]:_0x44b40a[_0xf86b('0x2f')];if(!_0x1733be[_0xf86b('0x30')]['hasOwnProperty'](_0xf86b('0x37'))){_0xc5da82[_0xf86b('0x1a')]=qs[_0xf86b('0x1a')](_0x1733be['query'][_0xf86b('0x1a')]);_0xc5da82[_0xf86b('0x18')]=qs[_0xf86b('0x18')](_0x1733be[_0xf86b('0x30')][_0xf86b('0x18')]);}_0xc5da82[_0xf86b('0x38')]=qs[_0xf86b('0x39')](_0x1733be[_0xf86b('0x30')][_0xf86b('0x39')]);_0xc5da82[_0xf86b('0x3a')]=qs[_0xf86b('0x32')](_[_0xf86b('0x3b')](_0x1733be['query'],_0x44b40a[_0xf86b('0x32')]),_0x196855);if(_0x1733be[_0xf86b('0x30')][_0xf86b('0x3c')]){_0xc5da82['where']=_[_0xf86b('0x3d')](_0xc5da82[_0xf86b('0x3a')],{'$or':[{'key':{'$like':'%'+_0x1733be[_0xf86b('0x30')][_0xf86b('0x3c')]+'%'}},{'value':{'$like':'%'+_0x1733be['query'][_0xf86b('0x3c')]+'%'}}]});}_0xc5da82=_[_0xf86b('0x3d')]({},_0xc5da82,_0x1733be['options']);var _0x48c41b={'where':_0xc5da82['where']};return db[_0xf86b('0x2a')][_0xf86b('0x1b')](_0x48c41b)[_0xf86b('0x21')](function(_0x9b89e){_0x5c01b7[_0xf86b('0x1b')]=_0x9b89e;if(_0x1733be['query'][_0xf86b('0x3e')]){_0xc5da82[_0xf86b('0x3f')]=[{'all':!![]}];}return db[_0xf86b('0x2a')][_0xf86b('0x40')](_0xc5da82);})[_0xf86b('0x21')](function(_0xd04210){_0x5c01b7[_0xf86b('0x41')]=_0xd04210;return _0x5c01b7;})['then'](respondWithFilteredResult(_0x470459,_0xc5da82))[_0xf86b('0x42')](handleError(_0x470459,null));};exports[_0xf86b('0x43')]=function(_0x4a2cc1,_0x58e9dc){var _0x549d43={'raw':!![],'where':{'id':_0x4a2cc1[_0xf86b('0x44')]['id']}},_0x3ee9ff={};_0x3ee9ff[_0xf86b('0x2f')]=_['keys'](db[_0xf86b('0x2a')]['rawAttributes']);_0x3ee9ff[_0xf86b('0x30')]=_['keys'](_0x4a2cc1[_0xf86b('0x30')]);_0x3ee9ff[_0xf86b('0x32')]=_[_0xf86b('0x33')](_0x3ee9ff[_0xf86b('0x2f')],_0x3ee9ff['query']);_0x549d43[_0xf86b('0x34')]=_['intersection'](_0x3ee9ff['model'],qs['fields'](_0x4a2cc1[_0xf86b('0x30')][_0xf86b('0x35')]));_0x549d43[_0xf86b('0x34')]=_0x549d43[_0xf86b('0x34')]['length']?_0x549d43[_0xf86b('0x34')]:_0x3ee9ff['model'];if(_0x4a2cc1[_0xf86b('0x30')][_0xf86b('0x3e')]){_0x549d43['include']=[{'all':!![]}];}_0x549d43=_['merge']({},_0x549d43,_0x4a2cc1['options']);return db[_0xf86b('0x2a')][_0xf86b('0x45')](_0x549d43)[_0xf86b('0x21')](handleEntityNotFound(_0x58e9dc,null))['then'](respondWithResult(_0x58e9dc,null))[_0xf86b('0x42')](handleError(_0x58e9dc,null));};exports[_0xf86b('0x20')]=function(_0x30275b,_0x34cdc7){if(_0x30275b[_0xf86b('0x46')]['id']){delete _0x30275b[_0xf86b('0x46')]['id'];}return db[_0xf86b('0x2a')][_0xf86b('0x45')]({'where':{'id':_0x30275b['params']['id']}})[_0xf86b('0x21')](handleEntityNotFound(_0x34cdc7,null))[_0xf86b('0x21')](saveUpdates(_0x30275b[_0xf86b('0x46')],null))[_0xf86b('0x21')](respondWithResult(_0x34cdc7,null))['catch'](handleError(_0x34cdc7,null));};exports[_0xf86b('0x22')]=function(_0x3b6c63,_0x3fe320){return db[_0xf86b('0x2a')][_0xf86b('0x45')]({'where':{'id':_0x3b6c63['params']['id']}})[_0xf86b('0x21')](handleEntityNotFound(_0x3fe320,null))[_0xf86b('0x21')](removeEntity(_0x3fe320,null))['catch'](handleError(_0x3fe320,null));};exports[_0xf86b('0x47')]=function(_0x76a847,_0x3a8a0d){var _0xb93a4c={'key':_0x76a847[_0xf86b('0x46')][_0xf86b('0x2e')]};if(_0x76a847[_0xf86b('0x46')][_0xf86b('0x48')]){_0xb93a4c['MailAccountId']=_0x76a847[_0xf86b('0x46')][_0xf86b('0x48')];}else if(_0x76a847[_0xf86b('0x46')][_0xf86b('0x49')]){_0xb93a4c[_0xf86b('0x49')]=_0x76a847['body'][_0xf86b('0x49')];}else if(_0x76a847[_0xf86b('0x46')][_0xf86b('0x4a')]){_0xb93a4c[_0xf86b('0x4a')]=_0x76a847[_0xf86b('0x46')]['OpenchannelAccountId'];}else if(_0x76a847[_0xf86b('0x46')][_0xf86b('0x4b')]){_0xb93a4c[_0xf86b('0x4b')]=_0x76a847[_0xf86b('0x46')][_0xf86b('0x4b')];}return db[_0xf86b('0x2a')][_0xf86b('0x45')]({'where':_0xb93a4c})[_0xf86b('0x21')](function(_0x2968ba){if(_0x2968ba){throw new db[(_0xf86b('0x4c'))][(_0xf86b('0x4d'))](_0xf86b('0x4e'));}return db[_0xf86b('0x2a')][_0xf86b('0x47')](_0x76a847[_0xf86b('0x46')]);})[_0xf86b('0x21')](function(_0x5d534f){var _0x45f478=_0x76a847[_0xf86b('0x4f')][_0xf86b('0x23')]({'plain':!![]});if(!_0x45f478)throw new Error(_0xf86b('0x50'));if(_0x45f478[_0xf86b('0x51')]===_0xf86b('0x4f')){var _0x4003e7=_0x5d534f[_0xf86b('0x23')]({'plain':!![]});return db[_0xf86b('0x52')]['find']({'where':{'name':_0xf86b('0x24'),'userProfileId':_0x45f478[_0xf86b('0x53')]},'raw':!![]})[_0xf86b('0x21')](function(_0x597745){if(_0x597745&&_0x597745['autoAssociation']===0x0){return db[_0xf86b('0x25')][_0xf86b('0x47')]({'name':_0x4003e7['name'],'resourceId':_0x4003e7['id'],'type':_0x597745[_0xf86b('0x26')],'sectionId':_0x597745['id']},{})[_0xf86b('0x21')](function(){return _0x5d534f;});}else{return _0x5d534f;}})[_0xf86b('0x42')](function(_0x5be4ac){logger[_0xf86b('0x54')](_0xf86b('0x55'),_0x5be4ac);throw _0x5be4ac;});}return _0x5d534f;})['then'](respondWithResult(_0x3a8a0d,0xc9))['catch'](handleError(_0x3a8a0d,null));};
\ No newline at end of file
+var _0x9f43=['model','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','merge','filter','CannedAnswer','includeAll','include','findAll','rows','catch','show','params','intersection','find','body','key','MailAccountId','SmsAccountId','OpenchannelAccountId','ChatWebsiteId','Sequelize','The\x20inserted\x20key\x20already\x20exists.','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','userProfileId','autoAssociation','create','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../mysqldb','sendStatus','status','json','offset','limit','undefined','count','set','Content-Range','apply','reject','update','then','CannedAnswers','UserProfileResource','destroy','end','error','stack','name','index','map','rawAttributes','fieldName','query','keys','filters'];(function(_0x436d7a,_0x4bcaf0){var _0x32003b=function(_0x5db190){while(--_0x5db190){_0x436d7a['push'](_0x436d7a['shift']());}};_0x32003b(++_0x4bcaf0);}(_0x9f43,0xd9));var _0x39f4=function(_0x3635ce,_0x33a6f9){_0x3635ce=_0x3635ce-0x0;var _0x97ecd0=_0x9f43[_0x3635ce];return _0x97ecd0;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x39f4('0x0'));var zipdir=require(_0x39f4('0x1'));var jsonpatch=require(_0x39f4('0x2'));var rp=require(_0x39f4('0x3'));var moment=require(_0x39f4('0x4'));var BPromise=require(_0x39f4('0x5'));var Mustache=require('mustache');var util=require(_0x39f4('0x6'));var path=require(_0x39f4('0x7'));var sox=require(_0x39f4('0x8'));var csv=require(_0x39f4('0x9'));var ejs=require(_0x39f4('0xa'));var fs=require('fs');var fs_extra=require(_0x39f4('0xb'));var _=require(_0x39f4('0xc'));var squel=require(_0x39f4('0xd'));var crypto=require(_0x39f4('0xe'));var jsforce=require(_0x39f4('0xf'));var deskjs=require(_0x39f4('0x10'));var toCsv=require(_0x39f4('0x9'));var querystring=require(_0x39f4('0x11'));var Papa=require('papaparse');var Redis=require(_0x39f4('0x12'));var authService=require(_0x39f4('0x13'));var qs=require('../../components/parsers/qs');var as=require(_0x39f4('0x14'));var hardwareService=require(_0x39f4('0x15'));var logger=require(_0x39f4('0x16'))(_0x39f4('0x17'));var utils=require(_0x39f4('0x18'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0x39f4('0x19'))['db'];function respondWithStatusCode(_0x2acbc2,_0xe2b53b){_0xe2b53b=_0xe2b53b||0xcc;return function(_0x1c946f){if(_0x1c946f){return _0x2acbc2[_0x39f4('0x1a')](_0xe2b53b);}return _0x2acbc2[_0x39f4('0x1b')](_0xe2b53b)['end']();};}function respondWithResult(_0x18a85a,_0x1171fe){_0x1171fe=_0x1171fe||0xc8;return function(_0x4128b5){if(_0x4128b5){return _0x18a85a[_0x39f4('0x1b')](_0x1171fe)[_0x39f4('0x1c')](_0x4128b5);}};}function respondWithFilteredResult(_0x18327c,_0x36eea4){return function(_0x4c334e){if(_0x4c334e){var _0x3f5f73=typeof _0x36eea4[_0x39f4('0x1d')]==='undefined'&&typeof _0x36eea4[_0x39f4('0x1e')]===_0x39f4('0x1f');var _0x4e2e3b=_0x4c334e['count'];var _0x23d2cf=_0x3f5f73?0x0:_0x36eea4['offset'];var _0x5b3bde=_0x3f5f73?_0x4c334e[_0x39f4('0x20')]:_0x36eea4[_0x39f4('0x1d')]+_0x36eea4[_0x39f4('0x1e')];var _0x3738ab;if(_0x5b3bde>=_0x4e2e3b){_0x5b3bde=_0x4e2e3b;_0x3738ab=0xc8;}else{_0x3738ab=0xce;}_0x18327c[_0x39f4('0x1b')](_0x3738ab);return _0x18327c[_0x39f4('0x21')](_0x39f4('0x22'),_0x23d2cf+'-'+_0x5b3bde+'/'+_0x4e2e3b)[_0x39f4('0x1c')](_0x4c334e);}return null;};}function patchUpdates(_0x55caf3){return function(_0x35fe6d){try{jsonpatch[_0x39f4('0x23')](_0x35fe6d,_0x55caf3,!![]);}catch(_0x117ff9){return BPromise[_0x39f4('0x24')](_0x117ff9);}return _0x35fe6d['save']();};}function saveUpdates(_0x28819e,_0x5c5ca1){return function(_0x46c3e4){if(_0x46c3e4){return _0x46c3e4[_0x39f4('0x25')](_0x28819e)[_0x39f4('0x26')](function(_0x21f430){return _0x21f430;});}return null;};}function removeEntity(_0x2713d3,_0x198267){return function(_0x5243a9){if(_0x5243a9){return _0x5243a9['destroy']()[_0x39f4('0x26')](function(){var _0x48e2ac=_0x5243a9['get']({'plain':!![]});var _0x17d301=_0x39f4('0x27');return db[_0x39f4('0x28')][_0x39f4('0x29')]({'where':{'type':_0x17d301,'resourceId':_0x48e2ac['id']}})[_0x39f4('0x26')](function(){return _0x5243a9;});})[_0x39f4('0x26')](function(){_0x2713d3[_0x39f4('0x1b')](0xcc)[_0x39f4('0x2a')]();});}};}function handleEntityNotFound(_0x2f270d,_0x552ed8){return function(_0x3d929e){if(!_0x3d929e){_0x2f270d[_0x39f4('0x1a')](0x194);}return _0x3d929e;};}function handleError(_0x40b1a8,_0x553dc6){_0x553dc6=_0x553dc6||0x1f4;return function(_0x1764d0){logger[_0x39f4('0x2b')](_0x1764d0[_0x39f4('0x2c')]);if(_0x1764d0[_0x39f4('0x2d')]){delete _0x1764d0['name'];}_0x40b1a8['status'](_0x553dc6)['send'](_0x1764d0);};}exports[_0x39f4('0x2e')]=function(_0xc01795,_0x385c4a){var _0x4d1f81={},_0x124c8c={},_0x56abbe={'count':0x0,'rows':[]};var _0x5e2313=_[_0x39f4('0x2f')](db['CannedAnswer'][_0x39f4('0x30')],function(_0x3d7265){return{'name':_0x3d7265[_0x39f4('0x31')],'type':_0x3d7265['type']['key']};});_0x124c8c['model']=_['map'](_0x5e2313,_0x39f4('0x2d'));_0x124c8c[_0x39f4('0x32')]=_[_0x39f4('0x33')](_0xc01795[_0x39f4('0x32')]);_0x124c8c[_0x39f4('0x34')]=_['intersection'](_0x124c8c[_0x39f4('0x35')],_0x124c8c[_0x39f4('0x32')]);_0x4d1f81[_0x39f4('0x36')]=_['intersection'](_0x124c8c[_0x39f4('0x35')],qs[_0x39f4('0x37')](_0xc01795[_0x39f4('0x32')]['fields']));_0x4d1f81['attributes']=_0x4d1f81[_0x39f4('0x36')][_0x39f4('0x38')]?_0x4d1f81[_0x39f4('0x36')]:_0x124c8c[_0x39f4('0x35')];if(!_0xc01795[_0x39f4('0x32')][_0x39f4('0x39')](_0x39f4('0x3a'))){_0x4d1f81[_0x39f4('0x1e')]=qs[_0x39f4('0x1e')](_0xc01795[_0x39f4('0x32')][_0x39f4('0x1e')]);_0x4d1f81[_0x39f4('0x1d')]=qs[_0x39f4('0x1d')](_0xc01795[_0x39f4('0x32')]['offset']);}_0x4d1f81[_0x39f4('0x3b')]=qs[_0x39f4('0x3c')](_0xc01795[_0x39f4('0x32')][_0x39f4('0x3c')]);_0x4d1f81['where']=qs[_0x39f4('0x34')](_['pick'](_0xc01795[_0x39f4('0x32')],_0x124c8c[_0x39f4('0x34')]),_0x5e2313);if(_0xc01795['query']['filter']){_0x4d1f81[_0x39f4('0x3d')]=_[_0x39f4('0x3e')](_0x4d1f81[_0x39f4('0x3d')],{'$or':[{'key':{'$like':'%'+_0xc01795[_0x39f4('0x32')]['filter']+'%'}},{'value':{'$like':'%'+_0xc01795[_0x39f4('0x32')][_0x39f4('0x3f')]+'%'}}]});}_0x4d1f81=_[_0x39f4('0x3e')]({},_0x4d1f81,_0xc01795['options']);var _0x47e572={'where':_0x4d1f81[_0x39f4('0x3d')]};return db[_0x39f4('0x40')][_0x39f4('0x20')](_0x47e572)[_0x39f4('0x26')](function(_0xb94238){_0x56abbe[_0x39f4('0x20')]=_0xb94238;if(_0xc01795[_0x39f4('0x32')][_0x39f4('0x41')]){_0x4d1f81[_0x39f4('0x42')]=[{'all':!![]}];}return db[_0x39f4('0x40')][_0x39f4('0x43')](_0x4d1f81);})['then'](function(_0x568bb1){_0x56abbe[_0x39f4('0x44')]=_0x568bb1;return _0x56abbe;})[_0x39f4('0x26')](respondWithFilteredResult(_0x385c4a,_0x4d1f81))[_0x39f4('0x45')](handleError(_0x385c4a,null));};exports[_0x39f4('0x46')]=function(_0x213bff,_0x1446c6){var _0x2e30ac={'raw':!![],'where':{'id':_0x213bff[_0x39f4('0x47')]['id']}},_0x528183={};_0x528183['model']=_[_0x39f4('0x33')](db[_0x39f4('0x40')]['rawAttributes']);_0x528183[_0x39f4('0x32')]=_['keys'](_0x213bff[_0x39f4('0x32')]);_0x528183[_0x39f4('0x34')]=_[_0x39f4('0x48')](_0x528183['model'],_0x528183['query']);_0x2e30ac[_0x39f4('0x36')]=_[_0x39f4('0x48')](_0x528183[_0x39f4('0x35')],qs[_0x39f4('0x37')](_0x213bff[_0x39f4('0x32')][_0x39f4('0x37')]));_0x2e30ac['attributes']=_0x2e30ac[_0x39f4('0x36')]['length']?_0x2e30ac[_0x39f4('0x36')]:_0x528183[_0x39f4('0x35')];if(_0x213bff[_0x39f4('0x32')][_0x39f4('0x41')]){_0x2e30ac[_0x39f4('0x42')]=[{'all':!![]}];}_0x2e30ac=_['merge']({},_0x2e30ac,_0x213bff['options']);return db[_0x39f4('0x40')][_0x39f4('0x49')](_0x2e30ac)[_0x39f4('0x26')](handleEntityNotFound(_0x1446c6,null))['then'](respondWithResult(_0x1446c6,null))['catch'](handleError(_0x1446c6,null));};exports[_0x39f4('0x25')]=function(_0x3638e6,_0x38a850){if(_0x3638e6[_0x39f4('0x4a')]['id']){delete _0x3638e6[_0x39f4('0x4a')]['id'];}return db[_0x39f4('0x40')][_0x39f4('0x49')]({'where':{'id':_0x3638e6[_0x39f4('0x47')]['id']}})['then'](handleEntityNotFound(_0x38a850,null))[_0x39f4('0x26')](saveUpdates(_0x3638e6['body'],null))['then'](respondWithResult(_0x38a850,null))[_0x39f4('0x45')](handleError(_0x38a850,null));};exports[_0x39f4('0x29')]=function(_0xf5e0cd,_0x178967){return db[_0x39f4('0x40')]['find']({'where':{'id':_0xf5e0cd[_0x39f4('0x47')]['id']}})[_0x39f4('0x26')](handleEntityNotFound(_0x178967,null))[_0x39f4('0x26')](removeEntity(_0x178967,null))[_0x39f4('0x45')](handleError(_0x178967,null));};exports['create']=function(_0x23092a,_0x4fee1b){var _0x54bcc5={'key':_0x23092a['body'][_0x39f4('0x4b')]};if(_0x23092a['body'][_0x39f4('0x4c')]){_0x54bcc5[_0x39f4('0x4c')]=_0x23092a[_0x39f4('0x4a')][_0x39f4('0x4c')];}else if(_0x23092a[_0x39f4('0x4a')]['SmsAccountId']){_0x54bcc5[_0x39f4('0x4d')]=_0x23092a['body'][_0x39f4('0x4d')];}else if(_0x23092a['body'][_0x39f4('0x4e')]){_0x54bcc5['OpenchannelAccountId']=_0x23092a['body']['OpenchannelAccountId'];}else if(_0x23092a[_0x39f4('0x4a')]['ChatWebsiteId']){_0x54bcc5[_0x39f4('0x4f')]=_0x23092a[_0x39f4('0x4a')][_0x39f4('0x4f')];}return db[_0x39f4('0x40')][_0x39f4('0x49')]({'where':_0x54bcc5})[_0x39f4('0x26')](function(_0x4dd26f){if(_0x4dd26f){throw new db[(_0x39f4('0x50'))]['ValidationError'](_0x39f4('0x51'));}return db['CannedAnswer']['create'](_0x23092a[_0x39f4('0x4a')]);})['then'](function(_0xb831c8){var _0xd15be=_0x23092a[_0x39f4('0x52')][_0x39f4('0x53')]({'plain':!![]});if(!_0xd15be)throw new Error(_0x39f4('0x54'));if(_0xd15be['role']==='user'){var _0x43e8a0=_0xb831c8['get']({'plain':!![]});return db[_0x39f4('0x55')][_0x39f4('0x49')]({'where':{'name':'CannedAnswers','userProfileId':_0xd15be[_0x39f4('0x56')]},'raw':!![]})[_0x39f4('0x26')](function(_0x390b83){if(_0x390b83&&_0x390b83[_0x39f4('0x57')]===0x0){return db[_0x39f4('0x28')][_0x39f4('0x58')]({'name':_0x43e8a0['name'],'resourceId':_0x43e8a0['id'],'type':_0x390b83[_0x39f4('0x2d')],'sectionId':_0x390b83['id']},{})[_0x39f4('0x26')](function(){return _0xb831c8;});}else{return _0xb831c8;}})[_0x39f4('0x45')](function(_0x1916c1){logger[_0x39f4('0x2b')](_0x39f4('0x59'),_0x1916c1);throw _0x1916c1;});}return _0xb831c8;})[_0x39f4('0x26')](respondWithResult(_0x4fee1b,0xc9))[_0x39f4('0x45')](handleError(_0x4fee1b,null));};
\ No newline at end of file
diff --git a/server/api/cannedAnswer/cannedAnswer.model.js b/server/api/cannedAnswer/cannedAnswer.model.js
index 235e8e4..1e3266a 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 _0xf44f=['define','tools_canned_answers','utf8mb4','utf8mb4_unicode_ci','lodash','util','../../config/logger','api','moment','bluebird','path','rimraf','../../config/environment','./cannedAnswer.attributes'];(function(_0x5c2e64,_0x4f9d84){var _0x1ed606=function(_0x1e478b){while(--_0x1e478b){_0x5c2e64['push'](_0x5c2e64['shift']());}};_0x1ed606(++_0x4f9d84);}(_0xf44f,0x138));var _0xff44=function(_0x11dfc1,_0x20d24b){_0x11dfc1=_0x11dfc1-0x0;var _0x2f056e=_0xf44f[_0x11dfc1];return _0x2f056e;};'use strict';var _=require(_0xff44('0x0'));var util=require(_0xff44('0x1'));var logger=require(_0xff44('0x2'))(_0xff44('0x3'));var moment=require(_0xff44('0x4'));var BPromise=require(_0xff44('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xff44('0x6'));var rimraf=require(_0xff44('0x7'));var config=require(_0xff44('0x8'));var attributes=require(_0xff44('0x9'));module['exports']=function(_0x20411d,_0x19ef4d){return _0x20411d[_0xff44('0xa')]('CannedAnswer',attributes,{'tableName':_0xff44('0xb'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0xff44('0xc'),'collate':_0xff44('0xd')});};
\ No newline at end of file
+var _0x2c31=['lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','../../config/environment','./cannedAnswer.attributes','define','tools_canned_answers','utf8mb4','utf8mb4_unicode_ci'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x2c31,0xee));var _0x12c3=function(_0x7a8884,_0x3bf33c){_0x7a8884=_0x7a8884-0x0;var _0xe75372=_0x2c31[_0x7a8884];return _0xe75372;};'use strict';var _=require(_0x12c3('0x0'));var util=require(_0x12c3('0x1'));var logger=require(_0x12c3('0x2'))(_0x12c3('0x3'));var moment=require(_0x12c3('0x4'));var BPromise=require(_0x12c3('0x5'));var rp=require(_0x12c3('0x6'));var fs=require('fs');var path=require(_0x12c3('0x7'));var rimraf=require('rimraf');var config=require(_0x12c3('0x8'));var attributes=require(_0x12c3('0x9'));module['exports']=function(_0x25585c,_0x173947){return _0x25585c[_0x12c3('0xa')]('CannedAnswer',attributes,{'tableName':_0x12c3('0xb'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x12c3('0xc'),'collate':_0x12c3('0xd')});};
\ No newline at end of file
diff --git a/server/api/cannedAnswer/cannedAnswer.rpc.js b/server/api/cannedAnswer/cannedAnswer.rpc.js
index 82d87e9..59f0d24 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(_0x21f4b4,_0x236672){var _0x4f945c=function(_0xe3676a){while(--_0xe3676a){_0x21f4b4['push'](_0x21f4b4['shift']());}};_0x4f945c(++_0x236672);}(_0xa9e0,0x123));var _0x0a9e=function(_0x2576d7,_0x167624){_0x2576d7=_0x2576d7-0x0;var _0x16a08c=_0xa9e0[_0x2576d7];return _0x16a08c;};'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(_0x1cdc9b,_0x4dcceb){var _0x30333f=function(_0x51a802){while(--_0x51a802){_0x1cdc9b['push'](_0x1cdc9b['shift']());}};_0x30333f(++_0x4dcceb);}(_0xa9e0,0x123));var _0x0a9e=function(_0x2b4411,_0x2625ed){_0x2b4411=_0x2b4411-0x0;var _0x8e41ef=_0xa9e0[_0x2b4411];return _0x8e41ef;};'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 94e3dc8..295f8e8 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 _0x304f=['fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./cannedAnswer.controller','get','isAuthenticated','/:id','show','create','put','delete','destroy','exports','multer','util','connect-timeout','express','Router'];(function(_0x346044,_0x522b93){var _0x2d8d01=function(_0x436ed0){while(--_0x436ed0){_0x346044['push'](_0x346044['shift']());}};_0x2d8d01(++_0x522b93);}(_0x304f,0x177));var _0xf304=function(_0x397e5f,_0x454c8f){_0x397e5f=_0x397e5f-0x0;var _0x5302b8=_0x304f[_0x397e5f];return _0x5302b8;};'use strict';var multer=require(_0xf304('0x0'));var util=require(_0xf304('0x1'));var path=require('path');var timeout=require(_0xf304('0x2'));var express=require(_0xf304('0x3'));var router=express[_0xf304('0x4')]();var fs_extra=require(_0xf304('0x5'));var auth=require(_0xf304('0x6'));var interaction=require(_0xf304('0x7'));var config=require(_0xf304('0x8'));var controller=require(_0xf304('0x9'));router[_0xf304('0xa')]('/',auth[_0xf304('0xb')](),controller['index']);router['get'](_0xf304('0xc'),auth[_0xf304('0xb')](),controller[_0xf304('0xd')]);router['post']('/',auth[_0xf304('0xb')](),controller[_0xf304('0xe')]);router[_0xf304('0xf')]('/:id',auth['isAuthenticated'](),controller['update']);router[_0xf304('0x10')]('/:id',auth['isAuthenticated'](),controller[_0xf304('0x11')]);module[_0xf304('0x12')]=router;
\ No newline at end of file
+var _0xb125=['put','update','exports','path','connect-timeout','express','Router','../../components/interaction/service','get','isAuthenticated','index','/:id','show','post','create'];(function(_0x396152,_0x25d180){var _0x2db4ea=function(_0x2839b3){while(--_0x2839b3){_0x396152['push'](_0x396152['shift']());}};_0x2db4ea(++_0x25d180);}(_0xb125,0xd5));var _0x5b12=function(_0x42e722,_0x5c0998){_0x42e722=_0x42e722-0x0;var _0x5efcd9=_0xb125[_0x42e722];return _0x5efcd9;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x5b12('0x0'));var timeout=require(_0x5b12('0x1'));var express=require(_0x5b12('0x2'));var router=express[_0x5b12('0x3')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0x5b12('0x4'));var config=require('../../config/environment');var controller=require('./cannedAnswer.controller');router[_0x5b12('0x5')]('/',auth[_0x5b12('0x6')](),controller[_0x5b12('0x7')]);router[_0x5b12('0x5')](_0x5b12('0x8'),auth[_0x5b12('0x6')](),controller[_0x5b12('0x9')]);router[_0x5b12('0xa')]('/',auth['isAuthenticated'](),controller[_0x5b12('0xb')]);router[_0x5b12('0xc')](_0x5b12('0x8'),auth[_0x5b12('0x6')](),controller[_0x5b12('0xd')]);router['delete'](_0x5b12('0x8'),auth['isAuthenticated'](),controller['destroy']);module[_0x5b12('0xe')]=router;
\ No newline at end of file
diff --git a/server/api/cdr/cdr.attributes.js b/server/api/cdr/cdr.attributes.js
index 42348a5..e20c851 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 _0x7008=['DATE','STRING','INTEGER'];(function(_0x3c5432,_0x4e13dc){var _0x20c67d=function(_0xd828fd){while(--_0xd828fd){_0x3c5432['push'](_0x3c5432['shift']());}};_0x20c67d(++_0x4e13dc);}(_0x7008,0x1ec));var _0x8700=function(_0x3e06bd,_0x421610){_0x3e06bd=_0x3e06bd-0x0;var _0x1f7f2b=_0x7008[_0x3e06bd];return _0x1f7f2b;};'use strict';var Sequelize=require('sequelize');module['exports']={'calldate':{'type':Sequelize[_0x8700('0x0')],'allowNull':![],'defaultValue':'1970-01-01\x2000:00:01'},'clid':{'type':Sequelize[_0x8700('0x1')]},'src':{'type':Sequelize['STRING']},'dst':{'type':Sequelize[_0x8700('0x1')]},'dcontext':{'type':Sequelize['STRING']},'channel':{'type':Sequelize[_0x8700('0x1')]},'dstchannel':{'type':Sequelize[_0x8700('0x1')]},'lastapp':{'type':Sequelize['STRING']},'lastdata':{'type':Sequelize[_0x8700('0x1')]},'duration':{'type':Sequelize[_0x8700('0x2')],'allowNull':![],'defaultValue':0x0},'billsec':{'type':Sequelize[_0x8700('0x2')],'allowNull':![],'defaultValue':0x0},'disposition':{'type':Sequelize[_0x8700('0x1')]},'amaflags':{'type':Sequelize['INTEGER'],'allowNull':![],'defaultValue':0x0},'accountcode':{'type':Sequelize[_0x8700('0x1')]},'userfield':{'type':Sequelize[_0x8700('0x1')]},'uniqueid':{'type':Sequelize[_0x8700('0x1')]},'linkedid':{'type':Sequelize[_0x8700('0x1')]},'sequence':{'type':Sequelize[_0x8700('0x1')]},'peeraccount':{'type':Sequelize[_0x8700('0x1')]},'type':{'type':Sequelize['STRING']},'tag':{'type':Sequelize['STRING']}};
\ No newline at end of file
+var _0x4065=['INTEGER','1970-01-01\x2000:00:01','STRING'];(function(_0xa464c9,_0x7c86d8){var _0x3d73c4=function(_0x5c2056){while(--_0x5c2056){_0xa464c9['push'](_0xa464c9['shift']());}};_0x3d73c4(++_0x7c86d8);}(_0x4065,0xdc));var _0x5406=function(_0x5f2772,_0x373a47){_0x5f2772=_0x5f2772-0x0;var _0xc83e16=_0x4065[_0x5f2772];return _0xc83e16;};'use strict';var Sequelize=require('sequelize');module['exports']={'calldate':{'type':Sequelize['DATE'],'allowNull':![],'defaultValue':_0x5406('0x0')},'clid':{'type':Sequelize['STRING']},'src':{'type':Sequelize[_0x5406('0x1')]},'dst':{'type':Sequelize[_0x5406('0x1')]},'dcontext':{'type':Sequelize[_0x5406('0x1')]},'channel':{'type':Sequelize['STRING']},'dstchannel':{'type':Sequelize[_0x5406('0x1')]},'lastapp':{'type':Sequelize[_0x5406('0x1')]},'lastdata':{'type':Sequelize['STRING']},'duration':{'type':Sequelize[_0x5406('0x2')],'allowNull':![],'defaultValue':0x0},'billsec':{'type':Sequelize[_0x5406('0x2')],'allowNull':![],'defaultValue':0x0},'disposition':{'type':Sequelize[_0x5406('0x1')]},'amaflags':{'type':Sequelize[_0x5406('0x2')],'allowNull':![],'defaultValue':0x0},'accountcode':{'type':Sequelize[_0x5406('0x1')]},'userfield':{'type':Sequelize[_0x5406('0x1')]},'uniqueid':{'type':Sequelize['STRING']},'linkedid':{'type':Sequelize[_0x5406('0x1')]},'sequence':{'type':Sequelize[_0x5406('0x1')]},'peeraccount':{'type':Sequelize[_0x5406('0x1')]},'type':{'type':Sequelize[_0x5406('0x1')]},'tag':{'type':Sequelize[_0x5406('0x1')]}};
\ No newline at end of file
diff --git a/server/api/cdr/cdr.controller.js b/server/api/cdr/cdr.controller.js
index a8f6f21..0b2aa63 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 _0x3c17=['apply','reject','save','update','destroy','error','stack','name','send','index','map','Cdr','rawAttributes','fieldName','model','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','where','pick','filter','merge','type','options','then','includeAll','findAll','rows','catch','show','params','keys','include','find','create','body','eml-format','zip-dir','request-promise','moment','bluebird','util','path','sox','to-csv','fs-extra','squel','crypto','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','status','offset','undefined','limit','count','Content-Range','json'];(function(_0x5f57b1,_0x546449){var _0xf31a3=function(_0x3acd0c){while(--_0x3acd0c){_0x5f57b1['push'](_0x5f57b1['shift']());}};_0xf31a3(++_0x546449);}(_0x3c17,0x1a1));var _0x73c1=function(_0x5b561d,_0x422b7c){_0x5b561d=_0x5b561d-0x0;var _0x431060=_0x3c17[_0x5b561d];return _0x431060;};'use strict';var emlformat=require(_0x73c1('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x73c1('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0x73c1('0x2'));var moment=require(_0x73c1('0x3'));var BPromise=require(_0x73c1('0x4'));var Mustache=require('mustache');var util=require(_0x73c1('0x5'));var path=require(_0x73c1('0x6'));var sox=require(_0x73c1('0x7'));var csv=require(_0x73c1('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x73c1('0x9'));var _=require('lodash');var squel=require(_0x73c1('0xa'));var crypto=require(_0x73c1('0xb'));var jsforce=require(_0x73c1('0xc'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x73c1('0xd'));var Papa=require(_0x73c1('0xe'));var Redis=require(_0x73c1('0xf'));var authService=require(_0x73c1('0x10'));var qs=require(_0x73c1('0x11'));var as=require(_0x73c1('0x12'));var hardwareService=require(_0x73c1('0x13'));var logger=require('../../config/logger')('api');var utils=require(_0x73c1('0x14'));var config=require(_0x73c1('0x15'));var licenseUtil=require(_0x73c1('0x16'));var db=require(_0x73c1('0x17'))['db'];function respondWithStatusCode(_0x592a6a,_0x2b77bc){_0x2b77bc=_0x2b77bc||0xcc;return function(_0x5e6b55){if(_0x5e6b55){return _0x592a6a[_0x73c1('0x18')](_0x2b77bc);}return _0x592a6a['status'](_0x2b77bc)[_0x73c1('0x19')]();};}function respondWithResult(_0x3ecf5a,_0x57cb11){_0x57cb11=_0x57cb11||0xc8;return function(_0x537965){if(_0x537965){return _0x3ecf5a[_0x73c1('0x1a')](_0x57cb11)['json'](_0x537965);}};}function respondWithFilteredResult(_0x72a36,_0x52d0ff){return function(_0xe5d5c8){if(_0xe5d5c8){var _0x47d81e=typeof _0x52d0ff[_0x73c1('0x1b')]===_0x73c1('0x1c')&&typeof _0x52d0ff[_0x73c1('0x1d')]===_0x73c1('0x1c');var _0x8c0803=_0xe5d5c8[_0x73c1('0x1e')];var _0x16deb6=_0x47d81e?0x0:_0x52d0ff[_0x73c1('0x1b')];var _0x1ce19e=_0x47d81e?_0xe5d5c8['count']:_0x52d0ff[_0x73c1('0x1b')]+_0x52d0ff[_0x73c1('0x1d')];var _0x28df60;if(_0x1ce19e>=_0x8c0803){_0x1ce19e=_0x8c0803;_0x28df60=0xc8;}else{_0x28df60=0xce;}_0x72a36[_0x73c1('0x1a')](_0x28df60);return _0x72a36['set'](_0x73c1('0x1f'),_0x16deb6+'-'+_0x1ce19e+'/'+_0x8c0803)[_0x73c1('0x20')](_0xe5d5c8);}return null;};}function patchUpdates(_0x344fb5){return function(_0x2e17e5){try{jsonpatch[_0x73c1('0x21')](_0x2e17e5,_0x344fb5,!![]);}catch(_0x2aa7df){return BPromise[_0x73c1('0x22')](_0x2aa7df);}return _0x2e17e5[_0x73c1('0x23')]();};}function saveUpdates(_0x49b817,_0x2eba51){return function(_0x32b379){if(_0x32b379){return _0x32b379[_0x73c1('0x24')](_0x49b817)['then'](function(_0x10254c){return _0x10254c;});}return null;};}function removeEntity(_0x2ebfda,_0x1125ff){return function(_0x3abaab){if(_0x3abaab){return _0x3abaab[_0x73c1('0x25')]()['then'](function(){_0x2ebfda[_0x73c1('0x1a')](0xcc)['end']();});}};}function handleEntityNotFound(_0x54feeb,_0x2301b7){return function(_0x1c567d){if(!_0x1c567d){_0x54feeb[_0x73c1('0x18')](0x194);}return _0x1c567d;};}function handleError(_0x1c54aa,_0x123cc0){_0x123cc0=_0x123cc0||0x1f4;return function(_0x30ec73){logger[_0x73c1('0x26')](_0x30ec73[_0x73c1('0x27')]);if(_0x30ec73[_0x73c1('0x28')]){delete _0x30ec73[_0x73c1('0x28')];}_0x1c54aa[_0x73c1('0x1a')](_0x123cc0)[_0x73c1('0x29')](_0x30ec73);};}exports[_0x73c1('0x2a')]=function(_0x240137,_0x5bf2b1){var _0x2b2996={},_0x9050fd={},_0x33b5bc={'count':0x0,'rows':[]};var _0x153141=_[_0x73c1('0x2b')](db[_0x73c1('0x2c')][_0x73c1('0x2d')],function(_0x45c411){return{'name':_0x45c411[_0x73c1('0x2e')],'type':_0x45c411['type']['key']};});_0x9050fd[_0x73c1('0x2f')]=_[_0x73c1('0x2b')](_0x153141,_0x73c1('0x28'));_0x9050fd[_0x73c1('0x30')]=_['keys'](_0x240137[_0x73c1('0x30')]);_0x9050fd[_0x73c1('0x31')]=_[_0x73c1('0x32')](_0x9050fd['model'],_0x9050fd[_0x73c1('0x30')]);_0x2b2996[_0x73c1('0x33')]=_[_0x73c1('0x32')](_0x9050fd[_0x73c1('0x2f')],qs[_0x73c1('0x34')](_0x240137[_0x73c1('0x30')]['fields']));_0x2b2996[_0x73c1('0x33')]=_0x2b2996[_0x73c1('0x33')][_0x73c1('0x35')]?_0x2b2996[_0x73c1('0x33')]:_0x9050fd[_0x73c1('0x2f')];if(!_0x240137[_0x73c1('0x30')][_0x73c1('0x36')](_0x73c1('0x37'))){_0x2b2996[_0x73c1('0x1d')]=qs[_0x73c1('0x1d')](_0x240137['query'][_0x73c1('0x1d')]);_0x2b2996['offset']=qs[_0x73c1('0x1b')](_0x240137[_0x73c1('0x30')][_0x73c1('0x1b')]);}_0x2b2996[_0x73c1('0x38')]=qs['sort'](_0x240137['query']['sort']);_0x2b2996[_0x73c1('0x39')]=qs['filters'](_[_0x73c1('0x3a')](_0x240137[_0x73c1('0x30')],_0x9050fd[_0x73c1('0x31')]),_0x153141);if(_0x240137[_0x73c1('0x30')][_0x73c1('0x3b')]){_0x2b2996[_0x73c1('0x39')]=_[_0x73c1('0x3c')](_0x2b2996[_0x73c1('0x39')],{'$or':_[_0x73c1('0x2b')](_0x153141,function(_0x304c2b){if(_0x304c2b[_0x73c1('0x3d')]!=='VIRTUAL'){var _0x2bb535={};_0x2bb535[_0x304c2b[_0x73c1('0x28')]]={'$like':'%'+_0x240137[_0x73c1('0x30')][_0x73c1('0x3b')]+'%'};return _0x2bb535;}})});}_0x2b2996=_[_0x73c1('0x3c')]({},_0x2b2996,_0x240137[_0x73c1('0x3e')]);var _0x5a8c11={'where':_0x2b2996[_0x73c1('0x39')]};return db[_0x73c1('0x2c')][_0x73c1('0x1e')](_0x5a8c11)[_0x73c1('0x3f')](function(_0x21feb9){_0x33b5bc[_0x73c1('0x1e')]=_0x21feb9;if(_0x240137['query'][_0x73c1('0x40')]){_0x2b2996['include']=[{'all':!![]}];}return db[_0x73c1('0x2c')][_0x73c1('0x41')](_0x2b2996);})['then'](function(_0x57d843){_0x33b5bc[_0x73c1('0x42')]=_0x57d843;return _0x33b5bc;})[_0x73c1('0x3f')](respondWithFilteredResult(_0x5bf2b1,_0x2b2996))[_0x73c1('0x43')](handleError(_0x5bf2b1,null));};exports[_0x73c1('0x44')]=function(_0x689ca5,_0x282b73){var _0x515a52={'raw':!![],'where':{'id':_0x689ca5[_0x73c1('0x45')]['id']}},_0x5c70b9={};_0x5c70b9[_0x73c1('0x2f')]=_['keys'](db['Cdr'][_0x73c1('0x2d')]);_0x5c70b9['query']=_[_0x73c1('0x46')](_0x689ca5[_0x73c1('0x30')]);_0x5c70b9[_0x73c1('0x31')]=_[_0x73c1('0x32')](_0x5c70b9[_0x73c1('0x2f')],_0x5c70b9[_0x73c1('0x30')]);_0x515a52[_0x73c1('0x33')]=_[_0x73c1('0x32')](_0x5c70b9['model'],qs['fields'](_0x689ca5[_0x73c1('0x30')][_0x73c1('0x34')]));_0x515a52[_0x73c1('0x33')]=_0x515a52['attributes'][_0x73c1('0x35')]?_0x515a52[_0x73c1('0x33')]:_0x5c70b9[_0x73c1('0x2f')];if(_0x689ca5[_0x73c1('0x30')][_0x73c1('0x40')]){_0x515a52[_0x73c1('0x47')]=[{'all':!![]}];}_0x515a52=_[_0x73c1('0x3c')]({},_0x515a52,_0x689ca5[_0x73c1('0x3e')]);return db[_0x73c1('0x2c')][_0x73c1('0x48')](_0x515a52)[_0x73c1('0x3f')](handleEntityNotFound(_0x282b73,null))[_0x73c1('0x3f')](respondWithResult(_0x282b73,null))['catch'](handleError(_0x282b73,null));};exports[_0x73c1('0x49')]=function(_0x512295,_0x1a681c){return db[_0x73c1('0x2c')][_0x73c1('0x49')](_0x512295[_0x73c1('0x4a')],{})[_0x73c1('0x3f')](respondWithResult(_0x1a681c,0xc9))[_0x73c1('0x43')](handleError(_0x1a681c,null));};exports['update']=function(_0x34093c,_0x2ccd11){if(_0x34093c[_0x73c1('0x4a')]['id']){delete _0x34093c['body']['id'];}return db[_0x73c1('0x2c')][_0x73c1('0x48')]({'where':{'id':_0x34093c[_0x73c1('0x45')]['id']}})[_0x73c1('0x3f')](handleEntityNotFound(_0x2ccd11,null))[_0x73c1('0x3f')](saveUpdates(_0x34093c[_0x73c1('0x4a')],null))[_0x73c1('0x3f')](respondWithResult(_0x2ccd11,null))[_0x73c1('0x43')](handleError(_0x2ccd11,null));};exports[_0x73c1('0x25')]=function(_0x53d491,_0x3291db){return db['Cdr']['find']({'where':{'id':_0x53d491['params']['id']}})['then'](handleEntityNotFound(_0x3291db,null))['then'](removeEntity(_0x3291db,null))[_0x73c1('0x43')](handleError(_0x3291db,null));};exports['describe']=function(_0x3c31e8,_0x47e3ca){return db['Cdr']['describe']()[_0x73c1('0x3f')](respondWithResult(_0x47e3ca,null))['catch'](handleError(_0x47e3ca,null));};
\ No newline at end of file
+var _0x1cb9=['rawAttributes','fieldName','type','key','model','query','keys','intersection','attributes','fields','nolimit','order','sort','where','filters','merge','VIRTUAL','filter','options','includeAll','include','rows','catch','show','length','find','create','body','params','describe','eml-format','zip-dir','fast-json-patch','request-promise','moment','mustache','util','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','undefined','limit','count','offset','Content-Range','json','reject','save','update','then','destroy','error','stack','name','send','index','map','Cdr'];(function(_0x100987,_0x25a1bd){var _0x2c982e=function(_0x1c5fdc){while(--_0x1c5fdc){_0x100987['push'](_0x100987['shift']());}};_0x2c982e(++_0x25a1bd);}(_0x1cb9,0x14e));var _0x91cb=function(_0x3ab30d,_0x4da38f){_0x3ab30d=_0x3ab30d-0x0;var _0xdd820b=_0x1cb9[_0x3ab30d];return _0xdd820b;};'use strict';var emlformat=require(_0x91cb('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x91cb('0x1'));var jsonpatch=require(_0x91cb('0x2'));var rp=require(_0x91cb('0x3'));var moment=require(_0x91cb('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x91cb('0x5'));var util=require(_0x91cb('0x6'));var path=require('path');var sox=require(_0x91cb('0x7'));var csv=require(_0x91cb('0x8'));var ejs=require(_0x91cb('0x9'));var fs=require('fs');var fs_extra=require(_0x91cb('0xa'));var _=require(_0x91cb('0xb'));var squel=require(_0x91cb('0xc'));var crypto=require('crypto');var jsforce=require(_0x91cb('0xd'));var deskjs=require('desk.js');var toCsv=require(_0x91cb('0x8'));var querystring=require('querystring');var Papa=require(_0x91cb('0xe'));var Redis=require(_0x91cb('0xf'));var authService=require(_0x91cb('0x10'));var qs=require(_0x91cb('0x11'));var as=require(_0x91cb('0x12'));var hardwareService=require(_0x91cb('0x13'));var logger=require(_0x91cb('0x14'))(_0x91cb('0x15'));var utils=require(_0x91cb('0x16'));var config=require(_0x91cb('0x17'));var licenseUtil=require('../../config/license/util');var db=require(_0x91cb('0x18'))['db'];function respondWithStatusCode(_0x366f09,_0x4ba2f2){_0x4ba2f2=_0x4ba2f2||0xcc;return function(_0x20e6e0){if(_0x20e6e0){return _0x366f09[_0x91cb('0x19')](_0x4ba2f2);}return _0x366f09[_0x91cb('0x1a')](_0x4ba2f2)[_0x91cb('0x1b')]();};}function respondWithResult(_0x4a7d45,_0x4cc6ef){_0x4cc6ef=_0x4cc6ef||0xc8;return function(_0x4aae25){if(_0x4aae25){return _0x4a7d45[_0x91cb('0x1a')](_0x4cc6ef)['json'](_0x4aae25);}};}function respondWithFilteredResult(_0x528f73,_0x576369){return function(_0xc3629e){if(_0xc3629e){var _0x347980=typeof _0x576369['offset']===_0x91cb('0x1c')&&typeof _0x576369[_0x91cb('0x1d')]==='undefined';var _0xc594e3=_0xc3629e[_0x91cb('0x1e')];var _0x1cd34b=_0x347980?0x0:_0x576369[_0x91cb('0x1f')];var _0x5cc1c3=_0x347980?_0xc3629e[_0x91cb('0x1e')]:_0x576369[_0x91cb('0x1f')]+_0x576369['limit'];var _0x123847;if(_0x5cc1c3>=_0xc594e3){_0x5cc1c3=_0xc594e3;_0x123847=0xc8;}else{_0x123847=0xce;}_0x528f73['status'](_0x123847);return _0x528f73['set'](_0x91cb('0x20'),_0x1cd34b+'-'+_0x5cc1c3+'/'+_0xc594e3)[_0x91cb('0x21')](_0xc3629e);}return null;};}function patchUpdates(_0x56e409){return function(_0x51a1d5){try{jsonpatch['apply'](_0x51a1d5,_0x56e409,!![]);}catch(_0x438162){return BPromise[_0x91cb('0x22')](_0x438162);}return _0x51a1d5[_0x91cb('0x23')]();};}function saveUpdates(_0x1dbee2,_0x5c6a15){return function(_0x45c4b3){if(_0x45c4b3){return _0x45c4b3[_0x91cb('0x24')](_0x1dbee2)[_0x91cb('0x25')](function(_0x55fa78){return _0x55fa78;});}return null;};}function removeEntity(_0x26f18f,_0x1a7a54){return function(_0x2447e7){if(_0x2447e7){return _0x2447e7[_0x91cb('0x26')]()[_0x91cb('0x25')](function(){_0x26f18f[_0x91cb('0x1a')](0xcc)[_0x91cb('0x1b')]();});}};}function handleEntityNotFound(_0x423c4f,_0x264e9b){return function(_0x4c8438){if(!_0x4c8438){_0x423c4f['sendStatus'](0x194);}return _0x4c8438;};}function handleError(_0x234eb1,_0x554350){_0x554350=_0x554350||0x1f4;return function(_0x1c67d2){logger[_0x91cb('0x27')](_0x1c67d2[_0x91cb('0x28')]);if(_0x1c67d2['name']){delete _0x1c67d2[_0x91cb('0x29')];}_0x234eb1['status'](_0x554350)[_0x91cb('0x2a')](_0x1c67d2);};}exports[_0x91cb('0x2b')]=function(_0x3b3ee6,_0x2fb473){var _0x468908={},_0x504275={},_0x2f04a3={'count':0x0,'rows':[]};var _0x52670a=_[_0x91cb('0x2c')](db[_0x91cb('0x2d')][_0x91cb('0x2e')],function(_0x4944bd){return{'name':_0x4944bd[_0x91cb('0x2f')],'type':_0x4944bd[_0x91cb('0x30')][_0x91cb('0x31')]};});_0x504275[_0x91cb('0x32')]=_[_0x91cb('0x2c')](_0x52670a,_0x91cb('0x29'));_0x504275[_0x91cb('0x33')]=_[_0x91cb('0x34')](_0x3b3ee6[_0x91cb('0x33')]);_0x504275['filters']=_[_0x91cb('0x35')](_0x504275[_0x91cb('0x32')],_0x504275[_0x91cb('0x33')]);_0x468908[_0x91cb('0x36')]=_[_0x91cb('0x35')](_0x504275['model'],qs[_0x91cb('0x37')](_0x3b3ee6[_0x91cb('0x33')][_0x91cb('0x37')]));_0x468908[_0x91cb('0x36')]=_0x468908[_0x91cb('0x36')]['length']?_0x468908[_0x91cb('0x36')]:_0x504275['model'];if(!_0x3b3ee6['query']['hasOwnProperty'](_0x91cb('0x38'))){_0x468908['limit']=qs[_0x91cb('0x1d')](_0x3b3ee6['query']['limit']);_0x468908[_0x91cb('0x1f')]=qs[_0x91cb('0x1f')](_0x3b3ee6[_0x91cb('0x33')][_0x91cb('0x1f')]);}_0x468908[_0x91cb('0x39')]=qs['sort'](_0x3b3ee6[_0x91cb('0x33')][_0x91cb('0x3a')]);_0x468908[_0x91cb('0x3b')]=qs[_0x91cb('0x3c')](_['pick'](_0x3b3ee6['query'],_0x504275[_0x91cb('0x3c')]),_0x52670a);if(_0x3b3ee6[_0x91cb('0x33')]['filter']){_0x468908[_0x91cb('0x3b')]=_[_0x91cb('0x3d')](_0x468908['where'],{'$or':_[_0x91cb('0x2c')](_0x52670a,function(_0xddc409){if(_0xddc409['type']!==_0x91cb('0x3e')){var _0x545687={};_0x545687[_0xddc409[_0x91cb('0x29')]]={'$like':'%'+_0x3b3ee6[_0x91cb('0x33')][_0x91cb('0x3f')]+'%'};return _0x545687;}})});}_0x468908=_[_0x91cb('0x3d')]({},_0x468908,_0x3b3ee6[_0x91cb('0x40')]);var _0x20bf50={'where':_0x468908['where']};return db[_0x91cb('0x2d')][_0x91cb('0x1e')](_0x20bf50)['then'](function(_0x312581){_0x2f04a3['count']=_0x312581;if(_0x3b3ee6[_0x91cb('0x33')][_0x91cb('0x41')]){_0x468908[_0x91cb('0x42')]=[{'all':!![]}];}return db[_0x91cb('0x2d')]['findAll'](_0x468908);})[_0x91cb('0x25')](function(_0x5af0e6){_0x2f04a3[_0x91cb('0x43')]=_0x5af0e6;return _0x2f04a3;})[_0x91cb('0x25')](respondWithFilteredResult(_0x2fb473,_0x468908))[_0x91cb('0x44')](handleError(_0x2fb473,null));};exports[_0x91cb('0x45')]=function(_0x451463,_0x111cc0){var _0x325dca={'raw':!![],'where':{'id':_0x451463['params']['id']}},_0x3cc4c1={};_0x3cc4c1[_0x91cb('0x32')]=_['keys'](db[_0x91cb('0x2d')]['rawAttributes']);_0x3cc4c1[_0x91cb('0x33')]=_['keys'](_0x451463[_0x91cb('0x33')]);_0x3cc4c1[_0x91cb('0x3c')]=_[_0x91cb('0x35')](_0x3cc4c1[_0x91cb('0x32')],_0x3cc4c1['query']);_0x325dca[_0x91cb('0x36')]=_[_0x91cb('0x35')](_0x3cc4c1['model'],qs[_0x91cb('0x37')](_0x451463[_0x91cb('0x33')][_0x91cb('0x37')]));_0x325dca[_0x91cb('0x36')]=_0x325dca[_0x91cb('0x36')][_0x91cb('0x46')]?_0x325dca[_0x91cb('0x36')]:_0x3cc4c1[_0x91cb('0x32')];if(_0x451463[_0x91cb('0x33')]['includeAll']){_0x325dca[_0x91cb('0x42')]=[{'all':!![]}];}_0x325dca=_[_0x91cb('0x3d')]({},_0x325dca,_0x451463[_0x91cb('0x40')]);return db[_0x91cb('0x2d')][_0x91cb('0x47')](_0x325dca)[_0x91cb('0x25')](handleEntityNotFound(_0x111cc0,null))[_0x91cb('0x25')](respondWithResult(_0x111cc0,null))[_0x91cb('0x44')](handleError(_0x111cc0,null));};exports['create']=function(_0x348d78,_0x46caf1){return db[_0x91cb('0x2d')][_0x91cb('0x48')](_0x348d78['body'],{})[_0x91cb('0x25')](respondWithResult(_0x46caf1,0xc9))[_0x91cb('0x44')](handleError(_0x46caf1,null));};exports['update']=function(_0x212473,_0x47cdb7){if(_0x212473[_0x91cb('0x49')]['id']){delete _0x212473['body']['id'];}return db['Cdr']['find']({'where':{'id':_0x212473[_0x91cb('0x4a')]['id']}})[_0x91cb('0x25')](handleEntityNotFound(_0x47cdb7,null))[_0x91cb('0x25')](saveUpdates(_0x212473[_0x91cb('0x49')],null))[_0x91cb('0x25')](respondWithResult(_0x47cdb7,null))['catch'](handleError(_0x47cdb7,null));};exports['destroy']=function(_0x1d26b8,_0xfe6692){return db[_0x91cb('0x2d')][_0x91cb('0x47')]({'where':{'id':_0x1d26b8['params']['id']}})['then'](handleEntityNotFound(_0xfe6692,null))['then'](removeEntity(_0xfe6692,null))[_0x91cb('0x44')](handleError(_0xfe6692,null));};exports['describe']=function(_0x3f22a1,_0x4aa670){return db[_0x91cb('0x2d')][_0x91cb('0x4b')]()[_0x91cb('0x25')](respondWithResult(_0x4aa670,null))[_0x91cb('0x44')](handleError(_0x4aa670,null));};
\ No newline at end of file
diff --git a/server/api/cdr/cdr.model.js b/server/api/cdr/cdr.model.js
index 8452ca4..fdf1730 100644
--- a/server/api/cdr/cdr.model.js
+++ b/server/api/cdr/cdr.model.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x7a54=['Cdr','cdr','accountcode','disposition','dst','src','uniqueid','lodash','util','../../config/logger','moment','bluebird','path','rimraf','../../config/environment','./cdr.attributes','exports'];(function(_0x52a750,_0x7f9968){var _0x56eeab=function(_0x27fe53){while(--_0x27fe53){_0x52a750['push'](_0x52a750['shift']());}};_0x56eeab(++_0x7f9968);}(_0x7a54,0x106));var _0x47a5=function(_0x3c6425,_0xb0376c){_0x3c6425=_0x3c6425-0x0;var _0x37931b=_0x7a54[_0x3c6425];return _0x37931b;};'use strict';var _=require(_0x47a5('0x0'));var util=require(_0x47a5('0x1'));var logger=require(_0x47a5('0x2'))('api');var moment=require(_0x47a5('0x3'));var BPromise=require(_0x47a5('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x47a5('0x5'));var rimraf=require(_0x47a5('0x6'));var config=require(_0x47a5('0x7'));var attributes=require(_0x47a5('0x8'));module[_0x47a5('0x9')]=function(_0x545a97,_0x3d5629){return _0x545a97['define'](_0x47a5('0xa'),attributes,{'tableName':_0x47a5('0xb'),'paranoid':![],'indexes':[{'name':'accountcode','fields':[_0x47a5('0xc')]},{'name':'calldate','fields':['calldate']},{'name':'disposition','fields':[_0x47a5('0xd')]},{'name':_0x47a5('0xe'),'fields':['dst']},{'name':_0x47a5('0xf'),'fields':['src']},{'name':'uniqueid','fields':[_0x47a5('0x10')]}],'timestamps':![]});};
\ No newline at end of file
+var _0x9957=['dst','src','uniqueid','lodash','util','../../config/logger','api','bluebird','request-promise','path','rimraf','./cdr.attributes','exports','define','Cdr','accountcode','calldate','disposition'];(function(_0xf03956,_0x3a3e8e){var _0x43d7f1=function(_0x180c71){while(--_0x180c71){_0xf03956['push'](_0xf03956['shift']());}};_0x43d7f1(++_0x3a3e8e);}(_0x9957,0x93));var _0x7995=function(_0xbca1b1,_0x33f0ce){_0xbca1b1=_0xbca1b1-0x0;var _0x4e1686=_0x9957[_0xbca1b1];return _0x4e1686;};'use strict';var _=require(_0x7995('0x0'));var util=require(_0x7995('0x1'));var logger=require(_0x7995('0x2'))(_0x7995('0x3'));var moment=require('moment');var BPromise=require(_0x7995('0x4'));var rp=require(_0x7995('0x5'));var fs=require('fs');var path=require(_0x7995('0x6'));var rimraf=require(_0x7995('0x7'));var config=require('../../config/environment');var attributes=require(_0x7995('0x8'));module[_0x7995('0x9')]=function(_0x137b6b,_0x219534){return _0x137b6b[_0x7995('0xa')](_0x7995('0xb'),attributes,{'tableName':'cdr','paranoid':![],'indexes':[{'name':_0x7995('0xc'),'fields':[_0x7995('0xc')]},{'name':'calldate','fields':[_0x7995('0xd')]},{'name':_0x7995('0xe'),'fields':[_0x7995('0xe')]},{'name':_0x7995('0xf'),'fields':[_0x7995('0xf')]},{'name':_0x7995('0x10'),'fields':[_0x7995('0x10')]},{'name':'uniqueid','fields':[_0x7995('0x11')]}],'timestamps':![]});};
\ No newline at end of file
diff --git a/server/api/cdr/cdr.rpc.js b/server/api/cdr/cdr.rpc.js
index 9d1c53b..5f490ff 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 _0x7a53=['Cdr,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','catch','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','request','then','info'];(function(_0x9a88cc,_0x44328f){var _0x5e9985=function(_0x1f9250){while(--_0x1f9250){_0x9a88cc['push'](_0x9a88cc['shift']());}};_0x5e9985(++_0x44328f);}(_0x7a53,0xa1));var _0x37a5=function(_0x5696f0,_0x4c5bf7){_0x5696f0=_0x5696f0-0x0;var _0x2b4584=_0x7a53[_0x5696f0];return _0x2b4584;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x37a5('0x0'));var BPromise=require(_0x37a5('0x1'));var rs=require(_0x37a5('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x37a5('0x3'))['db'];var utils=require(_0x37a5('0x4'));var logger=require(_0x37a5('0x5'))(_0x37a5('0x6'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x3a232e,_0x49f520,_0x12d678){return new BPromise(function(_0x330cef,_0x5513b1){return client[_0x37a5('0x7')](_0x3a232e,_0x12d678)[_0x37a5('0x8')](function(_0x2543f2){logger[_0x37a5('0x9')](_0x37a5('0xa'),_0x49f520,_0x37a5('0xb'));logger[_0x37a5('0xc')]('Cdr,\x20%s,\x20%s,\x20%s',_0x49f520,_0x37a5('0xb'),JSON[_0x37a5('0xd')](_0x2543f2));if(_0x2543f2['error']){if(_0x2543f2[_0x37a5('0xe')][_0x37a5('0xf')]===0x1f4){logger[_0x37a5('0xe')](_0x37a5('0xa'),_0x49f520,_0x2543f2[_0x37a5('0xe')][_0x37a5('0x10')]);return _0x5513b1(_0x2543f2[_0x37a5('0xe')][_0x37a5('0x10')]);}logger[_0x37a5('0xe')](_0x37a5('0xa'),_0x49f520,_0x2543f2[_0x37a5('0xe')][_0x37a5('0x10')]);return _0x330cef(_0x2543f2[_0x37a5('0xe')][_0x37a5('0x10')]);}else{logger['info'](_0x37a5('0xa'),_0x49f520,_0x37a5('0xb'));_0x330cef(_0x2543f2[_0x37a5('0x11')][_0x37a5('0x10')]);}})[_0x37a5('0x12')](function(_0x55490d){logger[_0x37a5('0xe')]('Cdr,\x20%s,\x20%s',_0x49f520,_0x55490d);_0x5513b1(_0x55490d);});});}
\ No newline at end of file
+var _0x1ec0=['error','Cdr,\x20%s,\x20%s','message','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','http','request','then','info','Cdr,\x20%s,\x20%s,\x20%s','request\x20sent','stringify'];(function(_0x3e1fd,_0x23c726){var _0x1d7c98=function(_0x106d5f){while(--_0x106d5f){_0x3e1fd['push'](_0x3e1fd['shift']());}};_0x1d7c98(++_0x23c726);}(_0x1ec0,0x11b));var _0x01ec=function(_0x7ec229,_0x45291f){_0x7ec229=_0x7ec229-0x0;var _0x332ac1=_0x1ec0[_0x7ec229];return _0x332ac1;};'use strict';var _=require(_0x01ec('0x0'));var util=require('util');var moment=require(_0x01ec('0x1'));var BPromise=require(_0x01ec('0x2'));var rs=require(_0x01ec('0x3'));var fs=require('fs');var Redis=require(_0x01ec('0x4'));var db=require(_0x01ec('0x5'))['db'];var utils=require(_0x01ec('0x6'));var logger=require('../../config/logger')(_0x01ec('0x7'));var config=require(_0x01ec('0x8'));var jayson=require(_0x01ec('0x9'));var client=jayson['client'][_0x01ec('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x494686,_0x5373a4,_0x3b7ee3){return new BPromise(function(_0x42da39,_0x237cae){return client[_0x01ec('0xb')](_0x494686,_0x3b7ee3)[_0x01ec('0xc')](function(_0x398b68){logger[_0x01ec('0xd')]('Cdr,\x20%s,\x20%s',_0x5373a4,'request\x20sent');logger['debug'](_0x01ec('0xe'),_0x5373a4,_0x01ec('0xf'),JSON[_0x01ec('0x10')](_0x398b68));if(_0x398b68[_0x01ec('0x11')]){if(_0x398b68['error']['code']===0x1f4){logger[_0x01ec('0x11')](_0x01ec('0x12'),_0x5373a4,_0x398b68['error']['message']);return _0x237cae(_0x398b68[_0x01ec('0x11')][_0x01ec('0x13')]);}logger[_0x01ec('0x11')](_0x01ec('0x12'),_0x5373a4,_0x398b68[_0x01ec('0x11')][_0x01ec('0x13')]);return _0x42da39(_0x398b68[_0x01ec('0x11')][_0x01ec('0x13')]);}else{logger[_0x01ec('0xd')](_0x01ec('0x12'),_0x5373a4,_0x01ec('0xf'));_0x42da39(_0x398b68['result'][_0x01ec('0x13')]);}})['catch'](function(_0x29ad5f){logger['error'](_0x01ec('0x12'),_0x5373a4,_0x29ad5f);_0x237cae(_0x29ad5f);});});}
\ No newline at end of file
diff --git a/server/api/cdr/index.js b/server/api/cdr/index.js
index affd1c5..a6abebe 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(_0x5ed7af,_0x422676){var _0x29a495=function(_0x4dd4b6){while(--_0x4dd4b6){_0x5ed7af['push'](_0x5ed7af['shift']());}};_0x29a495(++_0x422676);}(_0xd8b0,0xad));var _0x0d8b=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xd8b0[_0x20a584];return _0x4b41a8;};'use strict';var multer=require(_0x0d8b('0x0'));var util=require(_0x0d8b('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0d8b('0x2')]();var fs_extra=require(_0x0d8b('0x3'));var auth=require(_0x0d8b('0x4'));var interaction=require(_0x0d8b('0x5'));var config=require(_0x0d8b('0x6'));var controller=require('./cdr.controller');router['get']('/',auth[_0x0d8b('0x7')](),controller[_0x0d8b('0x8')]);router[_0x0d8b('0x9')]('/describe',auth[_0x0d8b('0x7')](),controller[_0x0d8b('0xa')]);router['get'](_0x0d8b('0xb'),auth[_0x0d8b('0x7')](),controller[_0x0d8b('0xc')]);router[_0x0d8b('0xd')]('/',auth[_0x0d8b('0x7')](),controller[_0x0d8b('0xe')]);router[_0x0d8b('0xf')](_0x0d8b('0xb'),auth['isAuthenticated'](),controller[_0x0d8b('0x10')]);router['delete'](_0x0d8b('0xb'),auth[_0x0d8b('0x7')](),controller[_0x0d8b('0x11')]);module[_0x0d8b('0x12')]=router;
\ No newline at end of file
+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(_0x810e4d,_0x909ef4){var _0x13f01c=function(_0x12fd89){while(--_0x12fd89){_0x810e4d['push'](_0x810e4d['shift']());}};_0x13f01c(++_0x909ef4);}(_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
diff --git a/server/api/chatApplication/chatApplication.attributes.js b/server/api/chatApplication/chatApplication.attributes.js
index 1933196..fe56a9d 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 _0xde69=['*,*,*,*','sequelize','STRING','noop','TEXT'];(function(_0x422d6a,_0x20d24f){var _0x3bff4b=function(_0x3789a8){while(--_0x3789a8){_0x422d6a['push'](_0x422d6a['shift']());}};_0x3bff4b(++_0x20d24f);}(_0xde69,0xab));var _0x9de6=function(_0x2a0765,_0x3ae964){_0x2a0765=_0x2a0765-0x0;var _0x547461=_0xde69[_0x2a0765];return _0x547461;};'use strict';var Sequelize=require(_0x9de6('0x0'));module['exports']={'priority':{'type':Sequelize['INTEGER'],'allowNull':![]},'app':{'type':Sequelize[_0x9de6('0x1')],'allowNull':![],'defaultValue':_0x9de6('0x2')},'appdata':{'type':Sequelize[_0x9de6('0x3')]()},'description':{'type':Sequelize[_0x9de6('0x1')]},'interval':{'type':Sequelize['STRING'],'defaultValue':_0x9de6('0x4')}};
\ No newline at end of file
+var _0xd460=['TEXT','*,*,*,*','sequelize','exports','INTEGER','STRING','noop'];(function(_0x3d43f1,_0x44fed2){var _0x587dba=function(_0x16788a){while(--_0x16788a){_0x3d43f1['push'](_0x3d43f1['shift']());}};_0x587dba(++_0x44fed2);}(_0xd460,0x79));var _0x0d46=function(_0x5304c0,_0x240d71){_0x5304c0=_0x5304c0-0x0;var _0x11d983=_0xd460[_0x5304c0];return _0x11d983;};'use strict';var Sequelize=require(_0x0d46('0x0'));module[_0x0d46('0x1')]={'priority':{'type':Sequelize[_0x0d46('0x2')],'allowNull':![]},'app':{'type':Sequelize[_0x0d46('0x3')],'allowNull':![],'defaultValue':_0x0d46('0x4')},'appdata':{'type':Sequelize[_0x0d46('0x5')]()},'description':{'type':Sequelize['STRING']},'interval':{'type':Sequelize[_0x0d46('0x3')],'defaultValue':_0x0d46('0x6')}};
\ No newline at end of file
diff --git a/server/api/chatApplication/chatApplication.controller.js b/server/api/chatApplication/chatApplication.controller.js
index fc6ace6..babdb06 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 _0x1bd1=['then','destroy','name','send','show','params','keys','ChatApplication','query','filters','intersection','model','attributes','fields','length','include','merge','find','update','body','catch','eml-format','rimraf','zip-dir','request-promise','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','apply','reject'];(function(_0x244cfb,_0x23385d){var _0x477a8b=function(_0x1f3902){while(--_0x1f3902){_0x244cfb['push'](_0x244cfb['shift']());}};_0x477a8b(++_0x23385d);}(_0x1bd1,0x123));var _0x11bd=function(_0x26f657,_0x418743){_0x26f657=_0x26f657-0x0;var _0x1cca33=_0x1bd1[_0x26f657];return _0x1cca33;};'use strict';var emlformat=require(_0x11bd('0x0'));var rimraf=require(_0x11bd('0x1'));var zipdir=require(_0x11bd('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x11bd('0x3'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require('mustache');var util=require('util');var path=require(_0x11bd('0x4'));var sox=require(_0x11bd('0x5'));var csv=require(_0x11bd('0x6'));var ejs=require(_0x11bd('0x7'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x11bd('0x8'));var squel=require(_0x11bd('0x9'));var crypto=require(_0x11bd('0xa'));var jsforce=require(_0x11bd('0xb'));var deskjs=require(_0x11bd('0xc'));var toCsv=require('to-csv');var querystring=require(_0x11bd('0xd'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x11bd('0xe'));var qs=require(_0x11bd('0xf'));var as=require(_0x11bd('0x10'));var hardwareService=require(_0x11bd('0x11'));var logger=require(_0x11bd('0x12'))(_0x11bd('0x13'));var utils=require(_0x11bd('0x14'));var config=require(_0x11bd('0x15'));var licenseUtil=require('../../config/license/util');var db=require(_0x11bd('0x16'))['db'];function respondWithStatusCode(_0x1afe14,_0x2ceee2){_0x2ceee2=_0x2ceee2||0xcc;return function(_0x39b6b9){if(_0x39b6b9){return _0x1afe14[_0x11bd('0x17')](_0x2ceee2);}return _0x1afe14[_0x11bd('0x18')](_0x2ceee2)[_0x11bd('0x19')]();};}function respondWithResult(_0x4d6ebe,_0x5e4cc4){_0x5e4cc4=_0x5e4cc4||0xc8;return function(_0x1c832b){if(_0x1c832b){return _0x4d6ebe[_0x11bd('0x18')](_0x5e4cc4)[_0x11bd('0x1a')](_0x1c832b);}};}function respondWithFilteredResult(_0x5ca6bb,_0x384144){return function(_0x5b78cc){if(_0x5b78cc){var _0x59978e=typeof _0x384144[_0x11bd('0x1b')]===_0x11bd('0x1c')&&typeof _0x384144[_0x11bd('0x1d')]===_0x11bd('0x1c');var _0xd04657=_0x5b78cc['count'];var _0x904980=_0x59978e?0x0:_0x384144[_0x11bd('0x1b')];var _0x39de22=_0x59978e?_0x5b78cc[_0x11bd('0x1e')]:_0x384144[_0x11bd('0x1b')]+_0x384144[_0x11bd('0x1d')];var _0xd2ca8a;if(_0x39de22>=_0xd04657){_0x39de22=_0xd04657;_0xd2ca8a=0xc8;}else{_0xd2ca8a=0xce;}_0x5ca6bb[_0x11bd('0x18')](_0xd2ca8a);return _0x5ca6bb['set']('Content-Range',_0x904980+'-'+_0x39de22+'/'+_0xd04657)[_0x11bd('0x1a')](_0x5b78cc);}return null;};}function patchUpdates(_0x232811){return function(_0x19176e){try{jsonpatch[_0x11bd('0x1f')](_0x19176e,_0x232811,!![]);}catch(_0x5d0f2b){return BPromise[_0x11bd('0x20')](_0x5d0f2b);}return _0x19176e['save']();};}function saveUpdates(_0x232f11,_0x104357){return function(_0x1d7984){if(_0x1d7984){return _0x1d7984['update'](_0x232f11)[_0x11bd('0x21')](function(_0x40c7d2){return _0x40c7d2;});}return null;};}function removeEntity(_0x1c0522,_0x27c98c){return function(_0x3343da){if(_0x3343da){return _0x3343da[_0x11bd('0x22')]()[_0x11bd('0x21')](function(){_0x1c0522[_0x11bd('0x18')](0xcc)[_0x11bd('0x19')]();});}};}function handleEntityNotFound(_0x39fbf9,_0x344826){return function(_0x3c6dab){if(!_0x3c6dab){_0x39fbf9['sendStatus'](0x194);}return _0x3c6dab;};}function handleError(_0x255365,_0xfbe811){_0xfbe811=_0xfbe811||0x1f4;return function(_0xa08420){logger['error'](_0xa08420['stack']);if(_0xa08420['name']){delete _0xa08420[_0x11bd('0x23')];}_0x255365[_0x11bd('0x18')](_0xfbe811)[_0x11bd('0x24')](_0xa08420);};}exports[_0x11bd('0x25')]=function(_0x39c2e3,_0x4312b3){var _0x3cc87b={'raw':!![],'where':{'id':_0x39c2e3[_0x11bd('0x26')]['id']}},_0x599f40={};_0x599f40['model']=_[_0x11bd('0x27')](db[_0x11bd('0x28')]['rawAttributes']);_0x599f40[_0x11bd('0x29')]=_[_0x11bd('0x27')](_0x39c2e3[_0x11bd('0x29')]);_0x599f40[_0x11bd('0x2a')]=_[_0x11bd('0x2b')](_0x599f40[_0x11bd('0x2c')],_0x599f40[_0x11bd('0x29')]);_0x3cc87b[_0x11bd('0x2d')]=_['intersection'](_0x599f40[_0x11bd('0x2c')],qs[_0x11bd('0x2e')](_0x39c2e3[_0x11bd('0x29')][_0x11bd('0x2e')]));_0x3cc87b[_0x11bd('0x2d')]=_0x3cc87b[_0x11bd('0x2d')][_0x11bd('0x2f')]?_0x3cc87b[_0x11bd('0x2d')]:_0x599f40[_0x11bd('0x2c')];if(_0x39c2e3[_0x11bd('0x29')]['includeAll']){_0x3cc87b[_0x11bd('0x30')]=[{'all':!![]}];}_0x3cc87b=_[_0x11bd('0x31')]({},_0x3cc87b,_0x39c2e3['options']);return db[_0x11bd('0x28')][_0x11bd('0x32')](_0x3cc87b)[_0x11bd('0x21')](handleEntityNotFound(_0x4312b3,null))[_0x11bd('0x21')](respondWithResult(_0x4312b3,null))['catch'](handleError(_0x4312b3,null));};exports[_0x11bd('0x33')]=function(_0x485915,_0x3dc82f){if(_0x485915[_0x11bd('0x34')]['id']){delete _0x485915[_0x11bd('0x34')]['id'];}return db[_0x11bd('0x28')][_0x11bd('0x32')]({'where':{'id':_0x485915[_0x11bd('0x26')]['id']}})[_0x11bd('0x21')](handleEntityNotFound(_0x3dc82f,null))[_0x11bd('0x21')](saveUpdates(_0x485915[_0x11bd('0x34')],null))[_0x11bd('0x21')](respondWithResult(_0x3dc82f,null))[_0x11bd('0x35')](handleError(_0x3dc82f,null));};exports[_0x11bd('0x22')]=function(_0x12c1f4,_0x234a4b){return db['ChatApplication']['find']({'where':{'id':_0x12c1f4['params']['id']}})[_0x11bd('0x21')](handleEntityNotFound(_0x234a4b,null))[_0x11bd('0x21')](removeEntity(_0x234a4b,null))['catch'](handleError(_0x234a4b,null));};
\ No newline at end of file
+var _0xfecd=['undefined','limit','count','apply','reject','save','update','then','destroy','error','stack','name','send','params','model','keys','ChatApplication','rawAttributes','query','filters','intersection','attributes','fields','length','includeAll','include','merge','options','catch','body','find','eml-format','zip-dir','fast-json-patch','moment','bluebird','util','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/license/util','sendStatus','status','end','json','offset'];(function(_0x313c96,_0x3cee6e){var _0x522f53=function(_0x8961e){while(--_0x8961e){_0x313c96['push'](_0x313c96['shift']());}};_0x522f53(++_0x3cee6e);}(_0xfecd,0x107));var _0xdfec=function(_0x559378,_0x3ae562){_0x559378=_0x559378-0x0;var _0x34eab2=_0xfecd[_0x559378];return _0x34eab2;};'use strict';var emlformat=require(_0xdfec('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xdfec('0x1'));var jsonpatch=require(_0xdfec('0x2'));var rp=require('request-promise');var moment=require(_0xdfec('0x3'));var BPromise=require(_0xdfec('0x4'));var Mustache=require('mustache');var util=require(_0xdfec('0x5'));var path=require('path');var sox=require(_0xdfec('0x6'));var csv=require(_0xdfec('0x7'));var ejs=require(_0xdfec('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xdfec('0x9'));var squel=require(_0xdfec('0xa'));var crypto=require(_0xdfec('0xb'));var jsforce=require(_0xdfec('0xc'));var deskjs=require(_0xdfec('0xd'));var toCsv=require('to-csv');var querystring=require(_0xdfec('0xe'));var Papa=require(_0xdfec('0xf'));var Redis=require(_0xdfec('0x10'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0xdfec('0x11'));var hardwareService=require(_0xdfec('0x12'));var logger=require('../../config/logger')(_0xdfec('0x13'));var utils=require(_0xdfec('0x14'));var config=require('../../config/environment');var licenseUtil=require(_0xdfec('0x15'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x21371b,_0x367a3c){_0x367a3c=_0x367a3c||0xcc;return function(_0x2384f5){if(_0x2384f5){return _0x21371b[_0xdfec('0x16')](_0x367a3c);}return _0x21371b[_0xdfec('0x17')](_0x367a3c)[_0xdfec('0x18')]();};}function respondWithResult(_0x28ef24,_0x2ccc89){_0x2ccc89=_0x2ccc89||0xc8;return function(_0x4d7c6e){if(_0x4d7c6e){return _0x28ef24[_0xdfec('0x17')](_0x2ccc89)[_0xdfec('0x19')](_0x4d7c6e);}};}function respondWithFilteredResult(_0x493d12,_0x420e3b){return function(_0x53ef23){if(_0x53ef23){var _0x2fbbbb=typeof _0x420e3b[_0xdfec('0x1a')]===_0xdfec('0x1b')&&typeof _0x420e3b[_0xdfec('0x1c')]==='undefined';var _0x443d2f=_0x53ef23[_0xdfec('0x1d')];var _0x336abf=_0x2fbbbb?0x0:_0x420e3b[_0xdfec('0x1a')];var _0x10c44c=_0x2fbbbb?_0x53ef23['count']:_0x420e3b['offset']+_0x420e3b[_0xdfec('0x1c')];var _0x171377;if(_0x10c44c>=_0x443d2f){_0x10c44c=_0x443d2f;_0x171377=0xc8;}else{_0x171377=0xce;}_0x493d12[_0xdfec('0x17')](_0x171377);return _0x493d12['set']('Content-Range',_0x336abf+'-'+_0x10c44c+'/'+_0x443d2f)['json'](_0x53ef23);}return null;};}function patchUpdates(_0x4b9614){return function(_0xce9faf){try{jsonpatch[_0xdfec('0x1e')](_0xce9faf,_0x4b9614,!![]);}catch(_0x577a69){return BPromise[_0xdfec('0x1f')](_0x577a69);}return _0xce9faf[_0xdfec('0x20')]();};}function saveUpdates(_0x58f088,_0x23c8fd){return function(_0x4fb633){if(_0x4fb633){return _0x4fb633[_0xdfec('0x21')](_0x58f088)[_0xdfec('0x22')](function(_0x43d004){return _0x43d004;});}return null;};}function removeEntity(_0x1e1c81,_0x405aae){return function(_0x3e29aa){if(_0x3e29aa){return _0x3e29aa[_0xdfec('0x23')]()[_0xdfec('0x22')](function(){_0x1e1c81[_0xdfec('0x17')](0xcc)[_0xdfec('0x18')]();});}};}function handleEntityNotFound(_0x488212,_0x16c6a7){return function(_0x511574){if(!_0x511574){_0x488212[_0xdfec('0x16')](0x194);}return _0x511574;};}function handleError(_0x21722a,_0x314f98){_0x314f98=_0x314f98||0x1f4;return function(_0x3b96f1){logger[_0xdfec('0x24')](_0x3b96f1[_0xdfec('0x25')]);if(_0x3b96f1[_0xdfec('0x26')]){delete _0x3b96f1['name'];}_0x21722a[_0xdfec('0x17')](_0x314f98)[_0xdfec('0x27')](_0x3b96f1);};}exports['show']=function(_0x19a66a,_0x58c46b){var _0x5051bd={'raw':!![],'where':{'id':_0x19a66a[_0xdfec('0x28')]['id']}},_0x71aeae={};_0x71aeae[_0xdfec('0x29')]=_[_0xdfec('0x2a')](db[_0xdfec('0x2b')][_0xdfec('0x2c')]);_0x71aeae[_0xdfec('0x2d')]=_[_0xdfec('0x2a')](_0x19a66a[_0xdfec('0x2d')]);_0x71aeae[_0xdfec('0x2e')]=_[_0xdfec('0x2f')](_0x71aeae[_0xdfec('0x29')],_0x71aeae['query']);_0x5051bd[_0xdfec('0x30')]=_[_0xdfec('0x2f')](_0x71aeae[_0xdfec('0x29')],qs[_0xdfec('0x31')](_0x19a66a[_0xdfec('0x2d')][_0xdfec('0x31')]));_0x5051bd[_0xdfec('0x30')]=_0x5051bd[_0xdfec('0x30')][_0xdfec('0x32')]?_0x5051bd['attributes']:_0x71aeae['model'];if(_0x19a66a[_0xdfec('0x2d')][_0xdfec('0x33')]){_0x5051bd[_0xdfec('0x34')]=[{'all':!![]}];}_0x5051bd=_[_0xdfec('0x35')]({},_0x5051bd,_0x19a66a[_0xdfec('0x36')]);return db[_0xdfec('0x2b')]['find'](_0x5051bd)['then'](handleEntityNotFound(_0x58c46b,null))[_0xdfec('0x22')](respondWithResult(_0x58c46b,null))[_0xdfec('0x37')](handleError(_0x58c46b,null));};exports[_0xdfec('0x21')]=function(_0x399bcf,_0x2cbc61){if(_0x399bcf[_0xdfec('0x38')]['id']){delete _0x399bcf[_0xdfec('0x38')]['id'];}return db[_0xdfec('0x2b')][_0xdfec('0x39')]({'where':{'id':_0x399bcf[_0xdfec('0x28')]['id']}})[_0xdfec('0x22')](handleEntityNotFound(_0x2cbc61,null))['then'](saveUpdates(_0x399bcf[_0xdfec('0x38')],null))[_0xdfec('0x22')](respondWithResult(_0x2cbc61,null))[_0xdfec('0x37')](handleError(_0x2cbc61,null));};exports['destroy']=function(_0x2971a1,_0x515be2){return db[_0xdfec('0x2b')][_0xdfec('0x39')]({'where':{'id':_0x2971a1['params']['id']}})[_0xdfec('0x22')](handleEntityNotFound(_0x515be2,null))[_0xdfec('0x22')](removeEntity(_0x515be2,null))[_0xdfec('0x37')](handleError(_0x515be2,null));};
\ No newline at end of file
diff --git a/server/api/chatApplication/chatApplication.model.js b/server/api/chatApplication/chatApplication.model.js
index 39c920a..dca2ac2 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 _0x8ba1=['moment','bluebird','request-promise','rimraf','../../config/environment','exports','define','ChatApplication','chat_applications','utf8mb4','utf8mb4_unicode_ci','util','../../config/logger'];(function(_0x4e768b,_0x1143ec){var _0x4c5165=function(_0x3dd5e0){while(--_0x3dd5e0){_0x4e768b['push'](_0x4e768b['shift']());}};_0x4c5165(++_0x1143ec);}(_0x8ba1,0x19e));var _0x18ba=function(_0x299e65,_0x195479){_0x299e65=_0x299e65-0x0;var _0x1c1167=_0x8ba1[_0x299e65];return _0x1c1167;};'use strict';var _=require('lodash');var util=require(_0x18ba('0x0'));var logger=require(_0x18ba('0x1'))('api');var moment=require(_0x18ba('0x2'));var BPromise=require(_0x18ba('0x3'));var rp=require(_0x18ba('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x18ba('0x5'));var config=require(_0x18ba('0x6'));var attributes=require('./chatApplication.attributes');module[_0x18ba('0x7')]=function(_0x475280,_0x20ee68){return _0x475280[_0x18ba('0x8')](_0x18ba('0x9'),attributes,{'tableName':_0x18ba('0xa'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x18ba('0xb'),'collate':_0x18ba('0xc')});};
\ No newline at end of file
+var _0xb619=['ChatApplication','chat_applications','utf8mb4','utf8mb4_unicode_ci','lodash','util','../../config/logger','api','request-promise','path','rimraf','../../config/environment','./chatApplication.attributes','define'];(function(_0x4baae2,_0x487ab6){var _0x1a2285=function(_0x1cea47){while(--_0x1cea47){_0x4baae2['push'](_0x4baae2['shift']());}};_0x1a2285(++_0x487ab6);}(_0xb619,0x12a));var _0x9b61=function(_0x269d0a,_0x528d16){_0x269d0a=_0x269d0a-0x0;var _0x1be160=_0xb619[_0x269d0a];return _0x1be160;};'use strict';var _=require(_0x9b61('0x0'));var util=require(_0x9b61('0x1'));var logger=require(_0x9b61('0x2'))(_0x9b61('0x3'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x9b61('0x4'));var fs=require('fs');var path=require(_0x9b61('0x5'));var rimraf=require(_0x9b61('0x6'));var config=require(_0x9b61('0x7'));var attributes=require(_0x9b61('0x8'));module['exports']=function(_0x2efc64,_0x4c2553){return _0x2efc64[_0x9b61('0x9')](_0x9b61('0xa'),attributes,{'tableName':_0x9b61('0xb'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x9b61('0xc'),'collate':_0x9b61('0xd')});};
\ No newline at end of file
diff --git a/server/api/chatApplication/chatApplication.rpc.js b/server/api/chatApplication/chatApplication.rpc.js
index fdb34f9..e99b3c9 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 _0x8ad7=['result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','rpc','jayson/promise','then','info','ChatApplication,\x20%s,\x20%s','request\x20sent','debug','ChatApplication,\x20%s,\x20%s,\x20%s','stringify','error','code','message'];(function(_0x27637c,_0x281c79){var _0x409a6f=function(_0x4a4a6d){while(--_0x4a4a6d){_0x27637c['push'](_0x27637c['shift']());}};_0x409a6f(++_0x281c79);}(_0x8ad7,0x128));var _0x78ad=function(_0x178e48,_0x3c9509){_0x178e48=_0x178e48-0x0;var _0x440d7e=_0x8ad7[_0x178e48];return _0x440d7e;};'use strict';var _=require(_0x78ad('0x0'));var util=require(_0x78ad('0x1'));var moment=require(_0x78ad('0x2'));var BPromise=require(_0x78ad('0x3'));var rs=require(_0x78ad('0x4'));var fs=require('fs');var Redis=require(_0x78ad('0x5'));var db=require(_0x78ad('0x6'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x78ad('0x7'));var config=require('../../config/environment');var jayson=require(_0x78ad('0x8'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0xeac313,_0x18ec24,_0x37cefc){return new BPromise(function(_0x1e53d4,_0x322dcf){return client['request'](_0xeac313,_0x37cefc)[_0x78ad('0x9')](function(_0x52f0ee){logger[_0x78ad('0xa')](_0x78ad('0xb'),_0x18ec24,_0x78ad('0xc'));logger[_0x78ad('0xd')](_0x78ad('0xe'),_0x18ec24,_0x78ad('0xc'),JSON[_0x78ad('0xf')](_0x52f0ee));if(_0x52f0ee[_0x78ad('0x10')]){if(_0x52f0ee['error'][_0x78ad('0x11')]===0x1f4){logger['error']('ChatApplication,\x20%s,\x20%s',_0x18ec24,_0x52f0ee[_0x78ad('0x10')][_0x78ad('0x12')]);return _0x322dcf(_0x52f0ee[_0x78ad('0x10')][_0x78ad('0x12')]);}logger[_0x78ad('0x10')](_0x78ad('0xb'),_0x18ec24,_0x52f0ee[_0x78ad('0x10')][_0x78ad('0x12')]);return _0x1e53d4(_0x52f0ee[_0x78ad('0x10')][_0x78ad('0x12')]);}else{logger[_0x78ad('0xa')](_0x78ad('0xb'),_0x18ec24,_0x78ad('0xc'));_0x1e53d4(_0x52f0ee[_0x78ad('0x13')][_0x78ad('0x12')]);}})[_0x78ad('0x14')](function(_0x27e095){logger[_0x78ad('0x10')](_0x78ad('0xb'),_0x18ec24,_0x27e095);_0x322dcf(_0x27e095);});});}
\ No newline at end of file
+var _0xe451=['../../config/environment','jayson/promise','client','http','then','info','ChatApplication,\x20%s,\x20%s','request\x20sent','debug','ChatApplication,\x20%s,\x20%s,\x20%s','stringify','error','message','result','lodash','util','moment','bluebird','../../mysqldb','../../config/utils','../../config/logger'];(function(_0x1b4b23,_0x5dd6d6){var _0x2a325b=function(_0x175462){while(--_0x175462){_0x1b4b23['push'](_0x1b4b23['shift']());}};_0x2a325b(++_0x5dd6d6);}(_0xe451,0xcb));var _0x1e45=function(_0x1c3eb3,_0x5440a){_0x1c3eb3=_0x1c3eb3-0x0;var _0x12efae=_0xe451[_0x1c3eb3];return _0x12efae;};'use strict';var _=require(_0x1e45('0x0'));var util=require(_0x1e45('0x1'));var moment=require(_0x1e45('0x2'));var BPromise=require(_0x1e45('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x1e45('0x4'))['db'];var utils=require(_0x1e45('0x5'));var logger=require(_0x1e45('0x6'))('rpc');var config=require(_0x1e45('0x7'));var jayson=require(_0x1e45('0x8'));var client=jayson[_0x1e45('0x9')][_0x1e45('0xa')]({'port':0x232a});function respondWithRpcPromise(_0xb43dac,_0x1182c4,_0x6998ae){return new BPromise(function(_0x265b14,_0xb30251){return client['request'](_0xb43dac,_0x6998ae)[_0x1e45('0xb')](function(_0xea4b85){logger[_0x1e45('0xc')](_0x1e45('0xd'),_0x1182c4,_0x1e45('0xe'));logger[_0x1e45('0xf')](_0x1e45('0x10'),_0x1182c4,_0x1e45('0xe'),JSON[_0x1e45('0x11')](_0xea4b85));if(_0xea4b85['error']){if(_0xea4b85[_0x1e45('0x12')]['code']===0x1f4){logger[_0x1e45('0x12')]('ChatApplication,\x20%s,\x20%s',_0x1182c4,_0xea4b85[_0x1e45('0x12')][_0x1e45('0x13')]);return _0xb30251(_0xea4b85[_0x1e45('0x12')][_0x1e45('0x13')]);}logger[_0x1e45('0x12')]('ChatApplication,\x20%s,\x20%s',_0x1182c4,_0xea4b85['error'][_0x1e45('0x13')]);return _0x265b14(_0xea4b85[_0x1e45('0x12')][_0x1e45('0x13')]);}else{logger[_0x1e45('0xc')](_0x1e45('0xd'),_0x1182c4,_0x1e45('0xe'));_0x265b14(_0xea4b85[_0x1e45('0x14')][_0x1e45('0x13')]);}})['catch'](function(_0x7f25b){logger[_0x1e45('0x12')](_0x1e45('0xd'),_0x1182c4,_0x7f25b);_0xb30251(_0x7f25b);});});}
\ No newline at end of file
diff --git a/server/api/chatApplication/index.js b/server/api/chatApplication/index.js
index 0196f02..b126f86 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 _0xe483=['delete','/:id','isAuthenticated','destroy','exports','path','express','Router','fs-extra','../../components/auth/service','../../config/environment','./chatApplication.controller','get','show','update'];(function(_0x2de76b,_0x1c9dde){var _0x315ba7=function(_0x230a62){while(--_0x230a62){_0x2de76b['push'](_0x2de76b['shift']());}};_0x315ba7(++_0x1c9dde);}(_0xe483,0x18b));var _0x3e48=function(_0x535db5,_0x18ed2c){_0x535db5=_0x535db5-0x0;var _0x3a1a5c=_0xe483[_0x535db5];return _0x3a1a5c;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x3e48('0x0'));var timeout=require('connect-timeout');var express=require(_0x3e48('0x1'));var router=express[_0x3e48('0x2')]();var fs_extra=require(_0x3e48('0x3'));var auth=require(_0x3e48('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0x3e48('0x5'));var controller=require(_0x3e48('0x6'));router[_0x3e48('0x7')]('/:id',auth['isAuthenticated'](),controller[_0x3e48('0x8')]);router['put']('/:id',auth['isAuthenticated'](),controller[_0x3e48('0x9')]);router[_0x3e48('0xa')](_0x3e48('0xb'),auth[_0x3e48('0xc')](),controller[_0x3e48('0xd')]);module[_0x3e48('0xe')]=router;
\ No newline at end of file
+var _0x155a=['express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatApplication.controller','get','/:id','isAuthenticated','show','update','delete','destroy','exports','multer','util','path'];(function(_0x2dafbe,_0x5d04de){var _0x58a45a=function(_0x50ac96){while(--_0x50ac96){_0x2dafbe['push'](_0x2dafbe['shift']());}};_0x58a45a(++_0x5d04de);}(_0x155a,0x1d1));var _0xa155=function(_0x8c43de,_0x90ff31){_0x8c43de=_0x8c43de-0x0;var _0xa6591b=_0x155a[_0x8c43de];return _0xa6591b;};'use strict';var multer=require(_0xa155('0x0'));var util=require(_0xa155('0x1'));var path=require(_0xa155('0x2'));var timeout=require('connect-timeout');var express=require(_0xa155('0x3'));var router=express[_0xa155('0x4')]();var fs_extra=require(_0xa155('0x5'));var auth=require(_0xa155('0x6'));var interaction=require(_0xa155('0x7'));var config=require(_0xa155('0x8'));var controller=require(_0xa155('0x9'));router[_0xa155('0xa')](_0xa155('0xb'),auth[_0xa155('0xc')](),controller[_0xa155('0xd')]);router['put'](_0xa155('0xb'),auth[_0xa155('0xc')](),controller[_0xa155('0xe')]);router[_0xa155('0xf')](_0xa155('0xb'),auth[_0xa155('0xc')](),controller[_0xa155('0x10')]);module[_0xa155('0x11')]=router;
\ No newline at end of file
diff --git a/server/api/chatGroup/chatGroup.attributes.js b/server/api/chatGroup/chatGroup.attributes.js
index 769a05e..64bddda 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 _0xe5e3=['exports','STRING'];(function(_0x279940,_0x536361){var _0x2ae662=function(_0x1cd48f){while(--_0x1cd48f){_0x279940['push'](_0x279940['shift']());}};_0x2ae662(++_0x536361);}(_0xe5e3,0x17a));var _0x3e5e=function(_0x3ab721,_0x4a7ca6){_0x3ab721=_0x3ab721-0x0;var _0x324091=_0xe5e3[_0x3ab721];return _0x324091;};'use strict';var Sequelize=require('sequelize');module[_0x3e5e('0x0')]={'name':{'type':Sequelize[_0x3e5e('0x1')],'allowNull':![]},'description':{'type':Sequelize['STRING']},'write':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]}};
\ No newline at end of file
+var _0xd3e3=['exports','STRING','sequelize'];(function(_0xbd08b4,_0x4790ed){var _0x314f1e=function(_0x161589){while(--_0x161589){_0xbd08b4['push'](_0xbd08b4['shift']());}};_0x314f1e(++_0x4790ed);}(_0xd3e3,0xdd));var _0x3d3e=function(_0x3cf89d,_0x5c6c79){_0x3cf89d=_0x3cf89d-0x0;var _0x237ccf=_0xd3e3[_0x3cf89d];return _0x237ccf;};'use strict';var Sequelize=require(_0x3d3e('0x0'));module[_0x3d3e('0x1')]={'name':{'type':Sequelize[_0x3d3e('0x2')],'allowNull':![]},'description':{'type':Sequelize[_0x3d3e('0x2')]},'write':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]}};
\ No newline at end of file
diff --git a/server/api/chatGroup/chatGroup.controller.js b/server/api/chatGroup/chatGroup.controller.js
index 95db781..e46f3cb 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 _0xcf9d=['ChatInternalMessage','user','addMembers','ids','omit','getMembers','findOne','User','pick','nolimit','removeMembers','addMessage','$gte','split','format','YYYY-MM-DD\x20HH:mm:ss','getMessages','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','path','sox','to-csv','lodash','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../mysqldb','defaults','localhost','redis','./chatGroup.socket','register','status','json','offset','undefined','count','Content-Range','apply','save','update','then','destroy','end','sendStatus','error','stack','name','index','map','ChatGroup','fieldName','type','key','model','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','limit','order','sort','filter','merge','VIRTUAL','options','where','includeAll','findAll','rows','show','params','include','catch','create','body','find','describe','getUnread'];(function(_0x33ab3d,_0x4fa0ce){var _0x5c418b=function(_0x786bb8){while(--_0x786bb8){_0x33ab3d['push'](_0x33ab3d['shift']());}};_0x5c418b(++_0x4fa0ce);}(_0xcf9d,0x134));var _0xdcf9=function(_0x44dbbc,_0x1d18a8){_0x44dbbc=_0x44dbbc-0x0;var _0x1cbf30=_0xcf9d[_0x44dbbc];return _0x1cbf30;};'use strict';var emlformat=require(_0xdcf9('0x0'));var rimraf=require(_0xdcf9('0x1'));var zipdir=require(_0xdcf9('0x2'));var jsonpatch=require(_0xdcf9('0x3'));var rp=require(_0xdcf9('0x4'));var moment=require(_0xdcf9('0x5'));var BPromise=require('bluebird');var Mustache=require(_0xdcf9('0x6'));var util=require('util');var path=require(_0xdcf9('0x7'));var sox=require(_0xdcf9('0x8'));var csv=require(_0xdcf9('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xdcf9('0xa'));var squel=require('squel');var crypto=require(_0xdcf9('0xb'));var jsforce=require(_0xdcf9('0xc'));var deskjs=require(_0xdcf9('0xd'));var toCsv=require('to-csv');var querystring=require(_0xdcf9('0xe'));var Papa=require('papaparse');var Redis=require(_0xdcf9('0xf'));var authService=require(_0xdcf9('0x10'));var qs=require(_0xdcf9('0x11'));var as=require(_0xdcf9('0x12'));var hardwareService=require(_0xdcf9('0x13'));var logger=require(_0xdcf9('0x14'))(_0xdcf9('0x15'));var utils=require(_0xdcf9('0x16'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0xdcf9('0x17'))['db'];config['redis']=_[_0xdcf9('0x18')](config['redis'],{'host':_0xdcf9('0x19'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xdcf9('0x1a')]));require(_0xdcf9('0x1b'))[_0xdcf9('0x1c')](socket);function respondWithStatusCode(_0x583e93,_0x198f1a){_0x198f1a=_0x198f1a||0xcc;return function(_0x5885f1){if(_0x5885f1){return _0x583e93['sendStatus'](_0x198f1a);}return _0x583e93[_0xdcf9('0x1d')](_0x198f1a)['end']();};}function respondWithResult(_0x4e5537,_0x97d28e){_0x97d28e=_0x97d28e||0xc8;return function(_0x513d52){if(_0x513d52){return _0x4e5537[_0xdcf9('0x1d')](_0x97d28e)[_0xdcf9('0x1e')](_0x513d52);}};}function respondWithFilteredResult(_0x24cb91,_0x3d6064){return function(_0x3067ea){if(_0x3067ea){var _0x2a39ae=typeof _0x3d6064[_0xdcf9('0x1f')]===_0xdcf9('0x20')&&typeof _0x3d6064['limit']===_0xdcf9('0x20');var _0x57f822=_0x3067ea[_0xdcf9('0x21')];var _0x5ee72d=_0x2a39ae?0x0:_0x3d6064[_0xdcf9('0x1f')];var _0x4605e5=_0x2a39ae?_0x3067ea[_0xdcf9('0x21')]:_0x3d6064['offset']+_0x3d6064['limit'];var _0x23d13f;if(_0x4605e5>=_0x57f822){_0x4605e5=_0x57f822;_0x23d13f=0xc8;}else{_0x23d13f=0xce;}_0x24cb91[_0xdcf9('0x1d')](_0x23d13f);return _0x24cb91['set'](_0xdcf9('0x22'),_0x5ee72d+'-'+_0x4605e5+'/'+_0x57f822)[_0xdcf9('0x1e')](_0x3067ea);}return null;};}function patchUpdates(_0x33c6ed){return function(_0x6ae050){try{jsonpatch[_0xdcf9('0x23')](_0x6ae050,_0x33c6ed,!![]);}catch(_0x46d55f){return BPromise['reject'](_0x46d55f);}return _0x6ae050[_0xdcf9('0x24')]();};}function saveUpdates(_0x56e3dd,_0x148062){return function(_0x4e8da6){if(_0x4e8da6){return _0x4e8da6[_0xdcf9('0x25')](_0x56e3dd)[_0xdcf9('0x26')](function(_0x55532e){return _0x55532e;});}return null;};}function removeEntity(_0xfe08b2,_0x310363){return function(_0x345a2c){if(_0x345a2c){return _0x345a2c[_0xdcf9('0x27')]()[_0xdcf9('0x26')](function(){_0xfe08b2[_0xdcf9('0x1d')](0xcc)[_0xdcf9('0x28')]();});}};}function handleEntityNotFound(_0x2fa1f3,_0x420602){return function(_0x2a3421){if(!_0x2a3421){_0x2fa1f3[_0xdcf9('0x29')](0x194);}return _0x2a3421;};}function handleError(_0x492673,_0x463bf4){_0x463bf4=_0x463bf4||0x1f4;return function(_0x31a9b4){logger[_0xdcf9('0x2a')](_0x31a9b4[_0xdcf9('0x2b')]);if(_0x31a9b4[_0xdcf9('0x2c')]){delete _0x31a9b4[_0xdcf9('0x2c')];}_0x492673['status'](_0x463bf4)['send'](_0x31a9b4);};}exports[_0xdcf9('0x2d')]=function(_0x513365,_0x3236a9){var _0x1165a6={},_0x17e682={},_0x211684={'count':0x0,'rows':[]};var _0xe521b8=_[_0xdcf9('0x2e')](db[_0xdcf9('0x2f')]['rawAttributes'],function(_0x2d3c9a){return{'name':_0x2d3c9a[_0xdcf9('0x30')],'type':_0x2d3c9a[_0xdcf9('0x31')][_0xdcf9('0x32')]};});_0x17e682[_0xdcf9('0x33')]=_['map'](_0xe521b8,_0xdcf9('0x2c'));_0x17e682['query']=_[_0xdcf9('0x34')](_0x513365[_0xdcf9('0x35')]);_0x17e682[_0xdcf9('0x36')]=_[_0xdcf9('0x37')](_0x17e682[_0xdcf9('0x33')],_0x17e682[_0xdcf9('0x35')]);_0x1165a6[_0xdcf9('0x38')]=_['intersection'](_0x17e682[_0xdcf9('0x33')],qs['fields'](_0x513365[_0xdcf9('0x35')][_0xdcf9('0x39')]));_0x1165a6[_0xdcf9('0x38')]=_0x1165a6[_0xdcf9('0x38')][_0xdcf9('0x3a')]?_0x1165a6[_0xdcf9('0x38')]:_0x17e682[_0xdcf9('0x33')];if(!_0x513365[_0xdcf9('0x35')][_0xdcf9('0x3b')]('nolimit')){_0x1165a6['limit']=qs[_0xdcf9('0x3c')](_0x513365[_0xdcf9('0x35')][_0xdcf9('0x3c')]);_0x1165a6[_0xdcf9('0x1f')]=qs['offset'](_0x513365[_0xdcf9('0x35')][_0xdcf9('0x1f')]);}_0x1165a6[_0xdcf9('0x3d')]=qs[_0xdcf9('0x3e')](_0x513365[_0xdcf9('0x35')][_0xdcf9('0x3e')]);_0x1165a6['where']=qs[_0xdcf9('0x36')](_['pick'](_0x513365[_0xdcf9('0x35')],_0x17e682['filters']),_0xe521b8);if(_0x513365[_0xdcf9('0x35')][_0xdcf9('0x3f')]){_0x1165a6['where']=_[_0xdcf9('0x40')](_0x1165a6['where'],{'$or':_['map'](_0xe521b8,function(_0xcf9d9a){if(_0xcf9d9a[_0xdcf9('0x31')]!==_0xdcf9('0x41')){var _0x85d4b6={};_0x85d4b6[_0xcf9d9a[_0xdcf9('0x2c')]]={'$like':'%'+_0x513365['query'][_0xdcf9('0x3f')]+'%'};return _0x85d4b6;}})});}_0x1165a6=_[_0xdcf9('0x40')]({},_0x1165a6,_0x513365[_0xdcf9('0x42')]);var _0x1d977f={'where':_0x1165a6[_0xdcf9('0x43')]};return db[_0xdcf9('0x2f')][_0xdcf9('0x21')](_0x1d977f)[_0xdcf9('0x26')](function(_0x14b87e){_0x211684[_0xdcf9('0x21')]=_0x14b87e;if(_0x513365[_0xdcf9('0x35')][_0xdcf9('0x44')]){_0x1165a6['include']=[{'all':!![]}];}return db[_0xdcf9('0x2f')][_0xdcf9('0x45')](_0x1165a6);})['then'](function(_0x34cb9d){_0x211684[_0xdcf9('0x46')]=_0x34cb9d;return _0x211684;})[_0xdcf9('0x26')](respondWithFilteredResult(_0x3236a9,_0x1165a6))['catch'](handleError(_0x3236a9,null));};exports[_0xdcf9('0x47')]=function(_0x5677fc,_0x1e3afb){var _0x808df9={'raw':!![],'where':{'id':_0x5677fc[_0xdcf9('0x48')]['id']}},_0x103b25={};_0x103b25[_0xdcf9('0x33')]=_[_0xdcf9('0x34')](db['ChatGroup']['rawAttributes']);_0x103b25[_0xdcf9('0x35')]=_[_0xdcf9('0x34')](_0x5677fc[_0xdcf9('0x35')]);_0x103b25[_0xdcf9('0x36')]=_['intersection'](_0x103b25[_0xdcf9('0x33')],_0x103b25[_0xdcf9('0x35')]);_0x808df9['attributes']=_[_0xdcf9('0x37')](_0x103b25[_0xdcf9('0x33')],qs['fields'](_0x5677fc[_0xdcf9('0x35')]['fields']));_0x808df9[_0xdcf9('0x38')]=_0x808df9[_0xdcf9('0x38')][_0xdcf9('0x3a')]?_0x808df9[_0xdcf9('0x38')]:_0x103b25['model'];if(_0x5677fc['query'][_0xdcf9('0x44')]){_0x808df9[_0xdcf9('0x49')]=[{'all':!![]}];}_0x808df9=_[_0xdcf9('0x40')]({},_0x808df9,_0x5677fc[_0xdcf9('0x42')]);return db[_0xdcf9('0x2f')]['find'](_0x808df9)[_0xdcf9('0x26')](handleEntityNotFound(_0x1e3afb,null))[_0xdcf9('0x26')](respondWithResult(_0x1e3afb,null))[_0xdcf9('0x4a')](handleError(_0x1e3afb,null));};exports['create']=function(_0xc36e57,_0x173348){return db[_0xdcf9('0x2f')][_0xdcf9('0x4b')](_0xc36e57['body'],{})[_0xdcf9('0x26')](respondWithResult(_0x173348,0xc9))[_0xdcf9('0x4a')](handleError(_0x173348,null));};exports[_0xdcf9('0x25')]=function(_0x47b5db,_0x45c18e){if(_0x47b5db[_0xdcf9('0x4c')]['id']){delete _0x47b5db[_0xdcf9('0x4c')]['id'];}return db['ChatGroup'][_0xdcf9('0x4d')]({'where':{'id':_0x47b5db['params']['id']}})[_0xdcf9('0x26')](handleEntityNotFound(_0x45c18e,null))[_0xdcf9('0x26')](saveUpdates(_0x47b5db[_0xdcf9('0x4c')],null))['then'](respondWithResult(_0x45c18e,null))['catch'](handleError(_0x45c18e,null));};exports[_0xdcf9('0x27')]=function(_0x16ab18,_0x116be4){return db[_0xdcf9('0x2f')]['find']({'where':{'id':_0x16ab18[_0xdcf9('0x48')]['id']}})[_0xdcf9('0x26')](handleEntityNotFound(_0x116be4,null))['then'](removeEntity(_0x116be4,null))[_0xdcf9('0x4a')](handleError(_0x116be4,null));};exports[_0xdcf9('0x4e')]=function(_0x1053fb,_0x3851c2){return db[_0xdcf9('0x2f')][_0xdcf9('0x4e')]()[_0xdcf9('0x26')](respondWithResult(_0x3851c2,null))['catch'](handleError(_0x3851c2,null));};exports[_0xdcf9('0x4f')]=function(_0x4f3fba,_0x3f0a1e,_0x3c91cc){return db[_0xdcf9('0x50')]['count']({'where':{'ChatGroupId':_0x4f3fba[_0xdcf9('0x48')]['id'],'ToId':_0x4f3fba[_0xdcf9('0x51')]['id'],'read':![]}})[_0xdcf9('0x26')](function(_0x503226){return{'id':_['toInteger'](_0x4f3fba[_0xdcf9('0x48')]['id']),'count':_0x503226};})[_0xdcf9('0x26')](respondWithResult(_0x3f0a1e,null))[_0xdcf9('0x4a')](handleError(_0x3f0a1e,null));};exports[_0xdcf9('0x52')]=function(_0x43391c,_0x1f0af2,_0x3e5c32){return db[_0xdcf9('0x2f')][_0xdcf9('0x4d')]({'where':{'id':_0x43391c['params']['id']}})[_0xdcf9('0x26')](handleEntityNotFound(_0x1f0af2,null))[_0xdcf9('0x26')](function(_0x192466){if(_0x192466){return _0x192466[_0xdcf9('0x52')](_0x43391c['body'][_0xdcf9('0x53')],_[_0xdcf9('0x54')](_0x43391c[_0xdcf9('0x4c')],['ids','id'])||{});}})[_0xdcf9('0x26')](respondWithResult(_0x1f0af2,null))[_0xdcf9('0x4a')](handleError(_0x1f0af2,null));};exports[_0xdcf9('0x55')]=function(_0x4043e2,_0x37790c,_0x202c57){var _0x1a202f={};var _0x53455a={};var _0x3bf079;var _0x344b7c;return db[_0xdcf9('0x2f')][_0xdcf9('0x56')]({'where':{'id':_0x4043e2['params']['id']}})[_0xdcf9('0x26')](handleEntityNotFound(_0x37790c,null))['then'](function(_0x113317){if(_0x113317){_0x3bf079=_0x113317;_0x53455a[_0xdcf9('0x33')]=_[_0xdcf9('0x34')](db[_0xdcf9('0x57')]['rawAttributes']);_0x53455a['query']=_['keys'](_0x4043e2[_0xdcf9('0x35')]);_0x53455a[_0xdcf9('0x36')]=_['intersection'](_0x53455a[_0xdcf9('0x33')],_0x53455a[_0xdcf9('0x35')]);_0x1a202f['attributes']=_['intersection'](_0x53455a[_0xdcf9('0x33')],qs['fields'](_0x4043e2[_0xdcf9('0x35')]['fields']));_0x1a202f['attributes']=_0x1a202f[_0xdcf9('0x38')][_0xdcf9('0x3a')]?_0x1a202f[_0xdcf9('0x38')]:_0x53455a[_0xdcf9('0x33')];_0x1a202f[_0xdcf9('0x3d')]=qs[_0xdcf9('0x3e')](_0x4043e2['query']['sort']);_0x1a202f[_0xdcf9('0x43')]=qs['filters'](_[_0xdcf9('0x58')](_0x4043e2['query'],_0x53455a[_0xdcf9('0x36')]));if(_0x4043e2[_0xdcf9('0x35')][_0xdcf9('0x3f')]){_0x1a202f[_0xdcf9('0x43')]=_[_0xdcf9('0x40')](_0x1a202f[_0xdcf9('0x43')],{'$or':_[_0xdcf9('0x2e')](_0x1a202f['attributes'],function(_0x371750){var _0x25d5ef={};_0x25d5ef[_0x371750]={'$like':'%'+_0x4043e2['query']['filter']+'%'};return _0x25d5ef;})});}_0x1a202f=_[_0xdcf9('0x40')]({},_0x1a202f,_0x4043e2['options']);return _0x3bf079[_0xdcf9('0x55')](_0x1a202f);}})[_0xdcf9('0x26')](function(_0x28d3d5){if(_0x28d3d5){_0x344b7c=_0x28d3d5[_0xdcf9('0x3a')];if(!_0x4043e2[_0xdcf9('0x35')][_0xdcf9('0x3b')](_0xdcf9('0x59'))){_0x1a202f['limit']=qs['limit'](_0x4043e2['query'][_0xdcf9('0x3c')]);_0x1a202f['offset']=qs[_0xdcf9('0x1f')](_0x4043e2[_0xdcf9('0x35')][_0xdcf9('0x1f')]);}return _0x3bf079['getMembers'](_0x1a202f);}})[_0xdcf9('0x26')](function(_0x4f77eb){if(_0x4f77eb){return _0x4f77eb?{'count':_0x344b7c,'rows':_0x4f77eb}:null;}})[_0xdcf9('0x26')](respondWithResult(_0x37790c,null))[_0xdcf9('0x4a')](handleError(_0x37790c,null));};exports[_0xdcf9('0x5a')]=function(_0x5df34f,_0x1ba8fe,_0x1b69f3){return db[_0xdcf9('0x2f')][_0xdcf9('0x4d')]({'where':{'id':_0x5df34f['params']['id']}})[_0xdcf9('0x26')](handleEntityNotFound(_0x1ba8fe,null))[_0xdcf9('0x26')](function(_0x678fce){if(_0x678fce){return _0x678fce[_0xdcf9('0x5a')](_0x5df34f[_0xdcf9('0x35')]['ids']);}})[_0xdcf9('0x26')](respondWithStatusCode(_0x1ba8fe,null))[_0xdcf9('0x4a')](handleError(_0x1ba8fe,null));};exports[_0xdcf9('0x5b')]=function(_0x212238,_0x385289,_0x4b83d0){if(_0x212238[_0xdcf9('0x4c')]['id']){delete _0x212238['body']['id'];}return db[_0xdcf9('0x2f')][_0xdcf9('0x4d')]({'where':{'id':_0x212238[_0xdcf9('0x48')]['id']}})['then'](handleEntityNotFound(_0x385289,null))['then'](function(_0xba9080){if(_0xba9080){_0x212238[_0xdcf9('0x4c')]['ChatGroupId']=_0xba9080['id'];return db['ChatInternalMessage']['create'](_0x212238['body']);}})[_0xdcf9('0x26')](respondWithResult(_0x385289,null))['catch'](handleError(_0x385289,null));};exports['getMessages']=function(_0x163315,_0x4263b5,_0x20f879){var _0x1bf8ee={};var _0x1016e5={};var _0x582b4b;var _0x2f38b6;return db[_0xdcf9('0x2f')]['findOne']({'where':{'id':_0x163315[_0xdcf9('0x48')]['id']}})[_0xdcf9('0x26')](handleEntityNotFound(_0x4263b5,null))[_0xdcf9('0x26')](function(_0x4031b7){if(_0x4031b7){_0x582b4b=_0x4031b7;_0x1016e5[_0xdcf9('0x33')]=_[_0xdcf9('0x34')](db[_0xdcf9('0x50')]['rawAttributes']);_0x1016e5[_0xdcf9('0x35')]=_[_0xdcf9('0x34')](_0x163315[_0xdcf9('0x35')]);_0x1016e5['filters']=_[_0xdcf9('0x37')](_0x1016e5[_0xdcf9('0x33')],_0x1016e5[_0xdcf9('0x35')]);_0x1bf8ee[_0xdcf9('0x38')]=_['intersection'](_0x1016e5['model'],qs[_0xdcf9('0x39')](_0x163315[_0xdcf9('0x35')][_0xdcf9('0x39')]));_0x1bf8ee[_0xdcf9('0x38')]=_0x1bf8ee['attributes'][_0xdcf9('0x3a')]?_0x1bf8ee[_0xdcf9('0x38')]:_0x1016e5[_0xdcf9('0x33')];_0x1bf8ee['order']=qs[_0xdcf9('0x3e')](_0x163315['query']['sort']);_0x1bf8ee['where']=qs[_0xdcf9('0x36')](_['pick'](_0x163315[_0xdcf9('0x35')],_0x1016e5[_0xdcf9('0x36')]));if(_0x163315['query']['filter']){_0x1bf8ee[_0xdcf9('0x43')]=_[_0xdcf9('0x40')](_0x1bf8ee[_0xdcf9('0x43')],{'$or':_[_0xdcf9('0x2e')](_0x1bf8ee[_0xdcf9('0x38')],function(_0x1b666b){var _0x141756={};_0x141756[_0x1b666b]={'$like':'%'+_0x163315[_0xdcf9('0x35')][_0xdcf9('0x3f')]+'%'};return _0x141756;})});}if(_0x163315[_0xdcf9('0x35')][_0xdcf9('0x5c')]){var _0x3024e9=_0x163315[_0xdcf9('0x35')][_0xdcf9('0x5c')][_0xdcf9('0x5d')](',');var _0x46ceb1={};_0x46ceb1[_0x3024e9[0x0]]={'$gte':moment(_0x3024e9[0x1])[_0xdcf9('0x5e')](_0xdcf9('0x5f'))};_0x1bf8ee[_0xdcf9('0x43')]=_['merge'](_0x1bf8ee[_0xdcf9('0x43')],_0x46ceb1);}_0x1bf8ee=_[_0xdcf9('0x40')]({},_0x1bf8ee,_0x163315[_0xdcf9('0x42')]);return _0x582b4b['getMessages'](_0x1bf8ee);}})[_0xdcf9('0x26')](function(_0x411ce5){if(_0x411ce5){_0x2f38b6=_0x411ce5[_0xdcf9('0x3a')];if(!_0x163315[_0xdcf9('0x35')][_0xdcf9('0x3b')](_0xdcf9('0x59'))){_0x1bf8ee[_0xdcf9('0x3c')]=qs['limit'](_0x163315[_0xdcf9('0x35')][_0xdcf9('0x3c')]);_0x1bf8ee[_0xdcf9('0x1f')]=qs[_0xdcf9('0x1f')](_0x163315[_0xdcf9('0x35')][_0xdcf9('0x1f')]);}return _0x582b4b[_0xdcf9('0x60')](_0x1bf8ee);}})[_0xdcf9('0x26')](function(_0x2ff0a3){if(_0x2ff0a3){return _0x2ff0a3?{'count':_0x2f38b6,'rows':_0x2ff0a3}:null;}})[_0xdcf9('0x26')](respondWithResult(_0x4263b5,null))[_0xdcf9('0x4a')](handleError(_0x4263b5,null));};
\ No newline at end of file
+var _0x494d=['merge','VIRTUAL','options','includeAll','findAll','rows','catch','show','params','keys','include','find','create','body','getUnread','user','toInteger','ids','omit','getMembers','findOne','User','removeMembers','addMessage','ChatGroupId','ChatInternalMessage','getMessages','rawAttributes','$gte','format','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','util','path','sox','fs-extra','lodash','crypto','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','socket.io-emitter','./chatGroup.socket','sendStatus','status','end','json','offset','limit','count','set','Content-Range','reject','save','update','then','destroy','error','stack','name','index','map','ChatGroup','fieldName','type','key','model','query','filters','intersection','fields','length','attributes','hasOwnProperty','nolimit','order','sort','where','pick','filter'];(function(_0x2af29a,_0x4f44bc){var _0x5ef02f=function(_0x4349ef){while(--_0x4349ef){_0x2af29a['push'](_0x2af29a['shift']());}};_0x5ef02f(++_0x4f44bc);}(_0x494d,0x141));var _0xd494=function(_0x57a6b7,_0x28f887){_0x57a6b7=_0x57a6b7-0x0;var _0x59b063=_0x494d[_0x57a6b7];return _0x59b063;};'use strict';var emlformat=require(_0xd494('0x0'));var rimraf=require(_0xd494('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xd494('0x2'));var rp=require(_0xd494('0x3'));var moment=require(_0xd494('0x4'));var BPromise=require(_0xd494('0x5'));var Mustache=require('mustache');var util=require(_0xd494('0x6'));var path=require(_0xd494('0x7'));var sox=require(_0xd494('0x8'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xd494('0x9'));var _=require(_0xd494('0xa'));var squel=require('squel');var crypto=require(_0xd494('0xb'));var jsforce=require(_0xd494('0xc'));var deskjs=require(_0xd494('0xd'));var toCsv=require(_0xd494('0xe'));var querystring=require(_0xd494('0xf'));var Papa=require(_0xd494('0x10'));var Redis=require(_0xd494('0x11'));var authService=require('../../components/auth/service');var qs=require(_0xd494('0x12'));var as=require(_0xd494('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xd494('0x14'))(_0xd494('0x15'));var utils=require(_0xd494('0x16'));var config=require(_0xd494('0x17'));var licenseUtil=require(_0xd494('0x18'));var db=require(_0xd494('0x19'))['db'];config[_0xd494('0x1a')]=_[_0xd494('0x1b')](config[_0xd494('0x1a')],{'host':'localhost','port':0x18eb});var socket=require(_0xd494('0x1c'))(new Redis(config[_0xd494('0x1a')]));require(_0xd494('0x1d'))['register'](socket);function respondWithStatusCode(_0xb641c8,_0x1a8ca0){_0x1a8ca0=_0x1a8ca0||0xcc;return function(_0x4f4e1a){if(_0x4f4e1a){return _0xb641c8[_0xd494('0x1e')](_0x1a8ca0);}return _0xb641c8[_0xd494('0x1f')](_0x1a8ca0)[_0xd494('0x20')]();};}function respondWithResult(_0x1d8a6f,_0x335b6a){_0x335b6a=_0x335b6a||0xc8;return function(_0x5616c2){if(_0x5616c2){return _0x1d8a6f[_0xd494('0x1f')](_0x335b6a)[_0xd494('0x21')](_0x5616c2);}};}function respondWithFilteredResult(_0x398380,_0x131daf){return function(_0x22a20d){if(_0x22a20d){var _0x1bee06=typeof _0x131daf[_0xd494('0x22')]==='undefined'&&typeof _0x131daf[_0xd494('0x23')]==='undefined';var _0x3e8519=_0x22a20d[_0xd494('0x24')];var _0x3f1866=_0x1bee06?0x0:_0x131daf[_0xd494('0x22')];var _0x5cb0cf=_0x1bee06?_0x22a20d[_0xd494('0x24')]:_0x131daf['offset']+_0x131daf[_0xd494('0x23')];var _0x477493;if(_0x5cb0cf>=_0x3e8519){_0x5cb0cf=_0x3e8519;_0x477493=0xc8;}else{_0x477493=0xce;}_0x398380[_0xd494('0x1f')](_0x477493);return _0x398380[_0xd494('0x25')](_0xd494('0x26'),_0x3f1866+'-'+_0x5cb0cf+'/'+_0x3e8519)[_0xd494('0x21')](_0x22a20d);}return null;};}function patchUpdates(_0xa4468b){return function(_0x44786b){try{jsonpatch['apply'](_0x44786b,_0xa4468b,!![]);}catch(_0x5e31ff){return BPromise[_0xd494('0x27')](_0x5e31ff);}return _0x44786b[_0xd494('0x28')]();};}function saveUpdates(_0x233013,_0x2360f5){return function(_0x3089ab){if(_0x3089ab){return _0x3089ab[_0xd494('0x29')](_0x233013)[_0xd494('0x2a')](function(_0x3d0d90){return _0x3d0d90;});}return null;};}function removeEntity(_0x4c6672,_0x5296d1){return function(_0x1b6a55){if(_0x1b6a55){return _0x1b6a55[_0xd494('0x2b')]()[_0xd494('0x2a')](function(){_0x4c6672[_0xd494('0x1f')](0xcc)[_0xd494('0x20')]();});}};}function handleEntityNotFound(_0x394f39,_0x56e22c){return function(_0x27c2b2){if(!_0x27c2b2){_0x394f39[_0xd494('0x1e')](0x194);}return _0x27c2b2;};}function handleError(_0x17e12e,_0x4a2897){_0x4a2897=_0x4a2897||0x1f4;return function(_0x33c4ae){logger[_0xd494('0x2c')](_0x33c4ae[_0xd494('0x2d')]);if(_0x33c4ae[_0xd494('0x2e')]){delete _0x33c4ae[_0xd494('0x2e')];}_0x17e12e['status'](_0x4a2897)['send'](_0x33c4ae);};}exports[_0xd494('0x2f')]=function(_0x25a6d5,_0x47897d){var _0xf72e8c={},_0x12471d={},_0x5d1354={'count':0x0,'rows':[]};var _0x53d17c=_[_0xd494('0x30')](db[_0xd494('0x31')]['rawAttributes'],function(_0x1176ea){return{'name':_0x1176ea[_0xd494('0x32')],'type':_0x1176ea[_0xd494('0x33')][_0xd494('0x34')]};});_0x12471d[_0xd494('0x35')]=_[_0xd494('0x30')](_0x53d17c,'name');_0x12471d['query']=_['keys'](_0x25a6d5[_0xd494('0x36')]);_0x12471d[_0xd494('0x37')]=_['intersection'](_0x12471d[_0xd494('0x35')],_0x12471d[_0xd494('0x36')]);_0xf72e8c['attributes']=_[_0xd494('0x38')](_0x12471d[_0xd494('0x35')],qs['fields'](_0x25a6d5[_0xd494('0x36')][_0xd494('0x39')]));_0xf72e8c['attributes']=_0xf72e8c['attributes'][_0xd494('0x3a')]?_0xf72e8c[_0xd494('0x3b')]:_0x12471d[_0xd494('0x35')];if(!_0x25a6d5[_0xd494('0x36')][_0xd494('0x3c')](_0xd494('0x3d'))){_0xf72e8c['limit']=qs[_0xd494('0x23')](_0x25a6d5[_0xd494('0x36')][_0xd494('0x23')]);_0xf72e8c[_0xd494('0x22')]=qs[_0xd494('0x22')](_0x25a6d5[_0xd494('0x36')][_0xd494('0x22')]);}_0xf72e8c[_0xd494('0x3e')]=qs[_0xd494('0x3f')](_0x25a6d5['query']['sort']);_0xf72e8c[_0xd494('0x40')]=qs['filters'](_[_0xd494('0x41')](_0x25a6d5['query'],_0x12471d[_0xd494('0x37')]),_0x53d17c);if(_0x25a6d5[_0xd494('0x36')][_0xd494('0x42')]){_0xf72e8c[_0xd494('0x40')]=_[_0xd494('0x43')](_0xf72e8c[_0xd494('0x40')],{'$or':_[_0xd494('0x30')](_0x53d17c,function(_0x8582bd){if(_0x8582bd[_0xd494('0x33')]!==_0xd494('0x44')){var _0x445f6e={};_0x445f6e[_0x8582bd[_0xd494('0x2e')]]={'$like':'%'+_0x25a6d5['query'][_0xd494('0x42')]+'%'};return _0x445f6e;}})});}_0xf72e8c=_[_0xd494('0x43')]({},_0xf72e8c,_0x25a6d5[_0xd494('0x45')]);var _0x3c9da1={'where':_0xf72e8c['where']};return db[_0xd494('0x31')][_0xd494('0x24')](_0x3c9da1)[_0xd494('0x2a')](function(_0x5c29fc){_0x5d1354[_0xd494('0x24')]=_0x5c29fc;if(_0x25a6d5[_0xd494('0x36')][_0xd494('0x46')]){_0xf72e8c['include']=[{'all':!![]}];}return db[_0xd494('0x31')][_0xd494('0x47')](_0xf72e8c);})[_0xd494('0x2a')](function(_0x19d673){_0x5d1354[_0xd494('0x48')]=_0x19d673;return _0x5d1354;})[_0xd494('0x2a')](respondWithFilteredResult(_0x47897d,_0xf72e8c))[_0xd494('0x49')](handleError(_0x47897d,null));};exports[_0xd494('0x4a')]=function(_0x1d1eec,_0x42a16f){var _0x1cad9d={'raw':!![],'where':{'id':_0x1d1eec[_0xd494('0x4b')]['id']}},_0x93f18d={};_0x93f18d[_0xd494('0x35')]=_[_0xd494('0x4c')](db[_0xd494('0x31')]['rawAttributes']);_0x93f18d[_0xd494('0x36')]=_[_0xd494('0x4c')](_0x1d1eec[_0xd494('0x36')]);_0x93f18d['filters']=_['intersection'](_0x93f18d[_0xd494('0x35')],_0x93f18d['query']);_0x1cad9d[_0xd494('0x3b')]=_[_0xd494('0x38')](_0x93f18d[_0xd494('0x35')],qs['fields'](_0x1d1eec[_0xd494('0x36')][_0xd494('0x39')]));_0x1cad9d[_0xd494('0x3b')]=_0x1cad9d[_0xd494('0x3b')][_0xd494('0x3a')]?_0x1cad9d['attributes']:_0x93f18d[_0xd494('0x35')];if(_0x1d1eec['query'][_0xd494('0x46')]){_0x1cad9d[_0xd494('0x4d')]=[{'all':!![]}];}_0x1cad9d=_[_0xd494('0x43')]({},_0x1cad9d,_0x1d1eec['options']);return db[_0xd494('0x31')][_0xd494('0x4e')](_0x1cad9d)[_0xd494('0x2a')](handleEntityNotFound(_0x42a16f,null))[_0xd494('0x2a')](respondWithResult(_0x42a16f,null))[_0xd494('0x49')](handleError(_0x42a16f,null));};exports[_0xd494('0x4f')]=function(_0x4a751b,_0x216dcd){return db[_0xd494('0x31')][_0xd494('0x4f')](_0x4a751b[_0xd494('0x50')],{})['then'](respondWithResult(_0x216dcd,0xc9))[_0xd494('0x49')](handleError(_0x216dcd,null));};exports['update']=function(_0x56fd85,_0xccbda0){if(_0x56fd85[_0xd494('0x50')]['id']){delete _0x56fd85[_0xd494('0x50')]['id'];}return db[_0xd494('0x31')]['find']({'where':{'id':_0x56fd85[_0xd494('0x4b')]['id']}})['then'](handleEntityNotFound(_0xccbda0,null))[_0xd494('0x2a')](saveUpdates(_0x56fd85[_0xd494('0x50')],null))['then'](respondWithResult(_0xccbda0,null))[_0xd494('0x49')](handleError(_0xccbda0,null));};exports['destroy']=function(_0x589e32,_0x3b0697){return db[_0xd494('0x31')]['find']({'where':{'id':_0x589e32['params']['id']}})[_0xd494('0x2a')](handleEntityNotFound(_0x3b0697,null))[_0xd494('0x2a')](removeEntity(_0x3b0697,null))[_0xd494('0x49')](handleError(_0x3b0697,null));};exports['describe']=function(_0x34f767,_0x40cb2b){return db[_0xd494('0x31')]['describe']()[_0xd494('0x2a')](respondWithResult(_0x40cb2b,null))[_0xd494('0x49')](handleError(_0x40cb2b,null));};exports[_0xd494('0x51')]=function(_0x944916,_0x781085,_0x4b259d){return db['ChatInternalMessage']['count']({'where':{'ChatGroupId':_0x944916['params']['id'],'ToId':_0x944916[_0xd494('0x52')]['id'],'read':![]}})[_0xd494('0x2a')](function(_0xa2f2e5){return{'id':_[_0xd494('0x53')](_0x944916[_0xd494('0x4b')]['id']),'count':_0xa2f2e5};})[_0xd494('0x2a')](respondWithResult(_0x781085,null))[_0xd494('0x49')](handleError(_0x781085,null));};exports['addMembers']=function(_0x18e45d,_0x3c9f96,_0x4e8dfc){return db[_0xd494('0x31')][_0xd494('0x4e')]({'where':{'id':_0x18e45d[_0xd494('0x4b')]['id']}})[_0xd494('0x2a')](handleEntityNotFound(_0x3c9f96,null))[_0xd494('0x2a')](function(_0x23debb){if(_0x23debb){return _0x23debb['addMembers'](_0x18e45d[_0xd494('0x50')][_0xd494('0x54')],_[_0xd494('0x55')](_0x18e45d['body'],[_0xd494('0x54'),'id'])||{});}})[_0xd494('0x2a')](respondWithResult(_0x3c9f96,null))[_0xd494('0x49')](handleError(_0x3c9f96,null));};exports[_0xd494('0x56')]=function(_0x13146f,_0x46f6c1,_0x448ed8){var _0x3bce81={};var _0x2c0a57={};var _0x2fc7e0;var _0x1915c6;return db[_0xd494('0x31')][_0xd494('0x57')]({'where':{'id':_0x13146f[_0xd494('0x4b')]['id']}})['then'](handleEntityNotFound(_0x46f6c1,null))[_0xd494('0x2a')](function(_0xbe8c19){if(_0xbe8c19){_0x2fc7e0=_0xbe8c19;_0x2c0a57[_0xd494('0x35')]=_[_0xd494('0x4c')](db[_0xd494('0x58')]['rawAttributes']);_0x2c0a57[_0xd494('0x36')]=_[_0xd494('0x4c')](_0x13146f[_0xd494('0x36')]);_0x2c0a57[_0xd494('0x37')]=_['intersection'](_0x2c0a57[_0xd494('0x35')],_0x2c0a57[_0xd494('0x36')]);_0x3bce81[_0xd494('0x3b')]=_[_0xd494('0x38')](_0x2c0a57[_0xd494('0x35')],qs[_0xd494('0x39')](_0x13146f[_0xd494('0x36')][_0xd494('0x39')]));_0x3bce81['attributes']=_0x3bce81['attributes'][_0xd494('0x3a')]?_0x3bce81[_0xd494('0x3b')]:_0x2c0a57[_0xd494('0x35')];_0x3bce81[_0xd494('0x3e')]=qs[_0xd494('0x3f')](_0x13146f[_0xd494('0x36')][_0xd494('0x3f')]);_0x3bce81[_0xd494('0x40')]=qs[_0xd494('0x37')](_[_0xd494('0x41')](_0x13146f[_0xd494('0x36')],_0x2c0a57[_0xd494('0x37')]));if(_0x13146f['query']['filter']){_0x3bce81['where']=_[_0xd494('0x43')](_0x3bce81[_0xd494('0x40')],{'$or':_[_0xd494('0x30')](_0x3bce81['attributes'],function(_0x13f0dc){var _0x1b7d1a={};_0x1b7d1a[_0x13f0dc]={'$like':'%'+_0x13146f[_0xd494('0x36')][_0xd494('0x42')]+'%'};return _0x1b7d1a;})});}_0x3bce81=_['merge']({},_0x3bce81,_0x13146f[_0xd494('0x45')]);return _0x2fc7e0[_0xd494('0x56')](_0x3bce81);}})[_0xd494('0x2a')](function(_0x54f9d6){if(_0x54f9d6){_0x1915c6=_0x54f9d6['length'];if(!_0x13146f[_0xd494('0x36')]['hasOwnProperty'](_0xd494('0x3d'))){_0x3bce81[_0xd494('0x23')]=qs[_0xd494('0x23')](_0x13146f[_0xd494('0x36')][_0xd494('0x23')]);_0x3bce81[_0xd494('0x22')]=qs['offset'](_0x13146f[_0xd494('0x36')][_0xd494('0x22')]);}return _0x2fc7e0[_0xd494('0x56')](_0x3bce81);}})[_0xd494('0x2a')](function(_0x38330e){if(_0x38330e){return _0x38330e?{'count':_0x1915c6,'rows':_0x38330e}:null;}})[_0xd494('0x2a')](respondWithResult(_0x46f6c1,null))[_0xd494('0x49')](handleError(_0x46f6c1,null));};exports[_0xd494('0x59')]=function(_0x489c4f,_0x470e83,_0x26ce1e){return db[_0xd494('0x31')][_0xd494('0x4e')]({'where':{'id':_0x489c4f[_0xd494('0x4b')]['id']}})[_0xd494('0x2a')](handleEntityNotFound(_0x470e83,null))[_0xd494('0x2a')](function(_0x29efc7){if(_0x29efc7){return _0x29efc7[_0xd494('0x59')](_0x489c4f[_0xd494('0x36')]['ids']);}})[_0xd494('0x2a')](respondWithStatusCode(_0x470e83,null))[_0xd494('0x49')](handleError(_0x470e83,null));};exports[_0xd494('0x5a')]=function(_0x3f82b8,_0x1cbb4f,_0x57ab03){if(_0x3f82b8[_0xd494('0x50')]['id']){delete _0x3f82b8[_0xd494('0x50')]['id'];}return db['ChatGroup'][_0xd494('0x4e')]({'where':{'id':_0x3f82b8[_0xd494('0x4b')]['id']}})['then'](handleEntityNotFound(_0x1cbb4f,null))[_0xd494('0x2a')](function(_0x24173c){if(_0x24173c){_0x3f82b8[_0xd494('0x50')][_0xd494('0x5b')]=_0x24173c['id'];return db[_0xd494('0x5c')][_0xd494('0x4f')](_0x3f82b8[_0xd494('0x50')]);}})[_0xd494('0x2a')](respondWithResult(_0x1cbb4f,null))[_0xd494('0x49')](handleError(_0x1cbb4f,null));};exports[_0xd494('0x5d')]=function(_0x189298,_0x3e1430,_0x14b0ce){var _0x13dcf8={};var _0x53f53a={};var _0x49774b;var _0x2d85ee;return db[_0xd494('0x31')][_0xd494('0x57')]({'where':{'id':_0x189298[_0xd494('0x4b')]['id']}})['then'](handleEntityNotFound(_0x3e1430,null))['then'](function(_0x314647){if(_0x314647){_0x49774b=_0x314647;_0x53f53a['model']=_[_0xd494('0x4c')](db[_0xd494('0x5c')][_0xd494('0x5e')]);_0x53f53a[_0xd494('0x36')]=_[_0xd494('0x4c')](_0x189298[_0xd494('0x36')]);_0x53f53a[_0xd494('0x37')]=_[_0xd494('0x38')](_0x53f53a[_0xd494('0x35')],_0x53f53a[_0xd494('0x36')]);_0x13dcf8[_0xd494('0x3b')]=_[_0xd494('0x38')](_0x53f53a['model'],qs['fields'](_0x189298[_0xd494('0x36')]['fields']));_0x13dcf8[_0xd494('0x3b')]=_0x13dcf8['attributes'][_0xd494('0x3a')]?_0x13dcf8[_0xd494('0x3b')]:_0x53f53a['model'];_0x13dcf8[_0xd494('0x3e')]=qs['sort'](_0x189298['query'][_0xd494('0x3f')]);_0x13dcf8[_0xd494('0x40')]=qs[_0xd494('0x37')](_['pick'](_0x189298[_0xd494('0x36')],_0x53f53a['filters']));if(_0x189298[_0xd494('0x36')]['filter']){_0x13dcf8[_0xd494('0x40')]=_[_0xd494('0x43')](_0x13dcf8[_0xd494('0x40')],{'$or':_[_0xd494('0x30')](_0x13dcf8['attributes'],function(_0x11ab8a){var _0x486944={};_0x486944[_0x11ab8a]={'$like':'%'+_0x189298[_0xd494('0x36')][_0xd494('0x42')]+'%'};return _0x486944;})});}if(_0x189298[_0xd494('0x36')]['$gte']){var _0x36ef9f=_0x189298[_0xd494('0x36')][_0xd494('0x5f')]['split'](',');var _0x3c57d9={};_0x3c57d9[_0x36ef9f[0x0]]={'$gte':moment(_0x36ef9f[0x1])[_0xd494('0x60')]('YYYY-MM-DD\x20HH:mm:ss')};_0x13dcf8['where']=_[_0xd494('0x43')](_0x13dcf8[_0xd494('0x40')],_0x3c57d9);}_0x13dcf8=_[_0xd494('0x43')]({},_0x13dcf8,_0x189298[_0xd494('0x45')]);return _0x49774b[_0xd494('0x5d')](_0x13dcf8);}})[_0xd494('0x2a')](function(_0x3dced9){if(_0x3dced9){_0x2d85ee=_0x3dced9['length'];if(!_0x189298[_0xd494('0x36')][_0xd494('0x3c')]('nolimit')){_0x13dcf8[_0xd494('0x23')]=qs[_0xd494('0x23')](_0x189298[_0xd494('0x36')][_0xd494('0x23')]);_0x13dcf8[_0xd494('0x22')]=qs[_0xd494('0x22')](_0x189298['query'][_0xd494('0x22')]);}return _0x49774b[_0xd494('0x5d')](_0x13dcf8);}})[_0xd494('0x2a')](function(_0x2f9332){if(_0x2f9332){return _0x2f9332?{'count':_0x2d85ee,'rows':_0x2f9332}:null;}})[_0xd494('0x2a')](respondWithResult(_0x3e1430,null))[_0xd494('0x49')](handleError(_0x3e1430,null));};
\ No newline at end of file
diff --git a/server/api/chatGroup/chatGroup.events.js b/server/api/chatGroup/chatGroup.events.js
index fcf2c7f..82abe47 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 _0xcaf1=['emit','hasOwnProperty','hook','exports','../../mysqldb','ChatGroup','setMaxListeners','save','update'];(function(_0x3fe2be,_0x24cfba){var _0x16b3ca=function(_0x266d1e){while(--_0x266d1e){_0x3fe2be['push'](_0x3fe2be['shift']());}};_0x16b3ca(++_0x24cfba);}(_0xcaf1,0x82));var _0x1caf=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xcaf1[_0x3dd15e];return _0x231fd0;};'use strict';var EventEmitter=require('events');var ChatGroup=require(_0x1caf('0x0'))['db'][_0x1caf('0x1')];var ChatGroupEvents=new EventEmitter();ChatGroupEvents[_0x1caf('0x2')](0x0);var events={'afterCreate':_0x1caf('0x3'),'afterUpdate':_0x1caf('0x4'),'afterDestroy':'remove'};function emitEvent(_0x56a487){return function(_0x238dc4,_0xb5de2b,_0x249f41){ChatGroupEvents[_0x1caf('0x5')](_0x56a487+':'+_0x238dc4['id'],_0x238dc4);ChatGroupEvents[_0x1caf('0x5')](_0x56a487,_0x238dc4);_0x249f41(null);};}for(var e in events){if(events[_0x1caf('0x6')](e)){var event=events[e];ChatGroup[_0x1caf('0x7')](e,emitEvent(event));}}module[_0x1caf('0x8')]=ChatGroupEvents;
\ No newline at end of file
+var _0x4325=['hasOwnProperty','exports','events','../../mysqldb','setMaxListeners','save','update','emit'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x4325,0x1da));var _0x5432=function(_0x4b369d,_0x265eb8){_0x4b369d=_0x4b369d-0x0;var _0x571a98=_0x4325[_0x4b369d];return _0x571a98;};'use strict';var EventEmitter=require(_0x5432('0x0'));var ChatGroup=require(_0x5432('0x1'))['db']['ChatGroup'];var ChatGroupEvents=new EventEmitter();ChatGroupEvents[_0x5432('0x2')](0x0);var events={'afterCreate':_0x5432('0x3'),'afterUpdate':_0x5432('0x4'),'afterDestroy':'remove'};function emitEvent(_0x4fc4e9){return function(_0x20f704,_0x36ce53,_0xad26e9){ChatGroupEvents['emit'](_0x4fc4e9+':'+_0x20f704['id'],_0x20f704);ChatGroupEvents[_0x5432('0x5')](_0x4fc4e9,_0x20f704);_0xad26e9(null);};}for(var e in events){if(events[_0x5432('0x6')](e)){var event=events[e];ChatGroup['hook'](e,emitEvent(event));}}module[_0x5432('0x7')]=ChatGroupEvents;
\ No newline at end of file
diff --git a/server/api/chatGroup/chatGroup.model.js b/server/api/chatGroup/chatGroup.model.js
index 44569cb..89451ce 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 _0x84fb=['../../config/environment','./chatGroup.attributes','exports','define','ChatGroup','chat_groups','lodash','../../config/logger','api','moment','bluebird','request-promise','path','rimraf'];(function(_0x4fc7fc,_0x5d6d06){var _0x5e945e=function(_0x1bb78d){while(--_0x1bb78d){_0x4fc7fc['push'](_0x4fc7fc['shift']());}};_0x5e945e(++_0x5d6d06);}(_0x84fb,0x156));var _0xb84f=function(_0x5cedd4,_0xa8a678){_0x5cedd4=_0x5cedd4-0x0;var _0x2867e4=_0x84fb[_0x5cedd4];return _0x2867e4;};'use strict';var _=require(_0xb84f('0x0'));var util=require('util');var logger=require(_0xb84f('0x1'))(_0xb84f('0x2'));var moment=require(_0xb84f('0x3'));var BPromise=require(_0xb84f('0x4'));var rp=require(_0xb84f('0x5'));var fs=require('fs');var path=require(_0xb84f('0x6'));var rimraf=require(_0xb84f('0x7'));var config=require(_0xb84f('0x8'));var attributes=require(_0xb84f('0x9'));module[_0xb84f('0xa')]=function(_0x45230d,_0x117ff4){return _0x45230d[_0xb84f('0xb')](_0xb84f('0xc'),attributes,{'tableName':_0xb84f('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xfcc8=['bluebird','path','rimraf','../../config/environment','./chatGroup.attributes','exports','define','ChatGroup','util','../../config/logger'];(function(_0x3a6614,_0x223d00){var _0x2f4156=function(_0x4b222c){while(--_0x4b222c){_0x3a6614['push'](_0x3a6614['shift']());}};_0x2f4156(++_0x223d00);}(_0xfcc8,0x1d4));var _0x8fcc=function(_0x3acbb7,_0x232526){_0x3acbb7=_0x3acbb7-0x0;var _0x4681f8=_0xfcc8[_0x3acbb7];return _0x4681f8;};'use strict';var _=require('lodash');var util=require(_0x8fcc('0x0'));var logger=require(_0x8fcc('0x1'))('api');var moment=require('moment');var BPromise=require(_0x8fcc('0x2'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x8fcc('0x3'));var rimraf=require(_0x8fcc('0x4'));var config=require(_0x8fcc('0x5'));var attributes=require(_0x8fcc('0x6'));module[_0x8fcc('0x7')]=function(_0x2d84c6,_0x1b743d){return _0x2d84c6[_0x8fcc('0x8')](_0x8fcc('0x9'),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 560b83a..7a1bfd7 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 _0x7d86=['./chatGroup.socket','register','request','then','info','request\x20sent','debug','ChatGroup,\x20%s,\x20%s,\x20%s','stringify','error','code','ChatGroup,\x20%s,\x20%s','message','result','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter'];(function(_0x125358,_0xdcae13){var _0x55fe56=function(_0x3db609){while(--_0x3db609){_0x125358['push'](_0x125358['shift']());}};_0x55fe56(++_0xdcae13);}(_0x7d86,0x86));var _0x67d8=function(_0x28b720,_0x501c54){_0x28b720=_0x28b720-0x0;var _0x1e5657=_0x7d86[_0x28b720];return _0x1e5657;};'use strict';var _=require(_0x67d8('0x0'));var util=require('util');var moment=require(_0x67d8('0x1'));var BPromise=require(_0x67d8('0x2'));var rs=require(_0x67d8('0x3'));var fs=require('fs');var Redis=require(_0x67d8('0x4'));var db=require(_0x67d8('0x5'))['db'];var utils=require(_0x67d8('0x6'));var logger=require(_0x67d8('0x7'))('rpc');var config=require(_0x67d8('0x8'));var jayson=require(_0x67d8('0x9'));var client=jayson[_0x67d8('0xa')][_0x67d8('0xb')]({'port':0x232a});config[_0x67d8('0xc')]=_[_0x67d8('0xd')](config[_0x67d8('0xc')],{'host':_0x67d8('0xe'),'port':0x18eb});var socket=require(_0x67d8('0xf'))(new Redis(config[_0x67d8('0xc')]));require(_0x67d8('0x10'))[_0x67d8('0x11')](socket);function respondWithRpcPromise(_0x243de2,_0x265552,_0x2b1fe6){return new BPromise(function(_0x47382c,_0x2e5a0f){return client[_0x67d8('0x12')](_0x243de2,_0x2b1fe6)[_0x67d8('0x13')](function(_0x46b7f8){logger[_0x67d8('0x14')]('ChatGroup,\x20%s,\x20%s',_0x265552,_0x67d8('0x15'));logger[_0x67d8('0x16')](_0x67d8('0x17'),_0x265552,'request\x20sent',JSON[_0x67d8('0x18')](_0x46b7f8));if(_0x46b7f8[_0x67d8('0x19')]){if(_0x46b7f8[_0x67d8('0x19')][_0x67d8('0x1a')]===0x1f4){logger[_0x67d8('0x19')](_0x67d8('0x1b'),_0x265552,_0x46b7f8[_0x67d8('0x19')]['message']);return _0x2e5a0f(_0x46b7f8[_0x67d8('0x19')][_0x67d8('0x1c')]);}logger[_0x67d8('0x19')]('ChatGroup,\x20%s,\x20%s',_0x265552,_0x46b7f8[_0x67d8('0x19')][_0x67d8('0x1c')]);return _0x47382c(_0x46b7f8['error'][_0x67d8('0x1c')]);}else{logger[_0x67d8('0x14')](_0x67d8('0x1b'),_0x265552,_0x67d8('0x15'));_0x47382c(_0x46b7f8[_0x67d8('0x1d')][_0x67d8('0x1c')]);}})['catch'](function(_0x3de8d1){logger[_0x67d8('0x19')](_0x67d8('0x1b'),_0x265552,_0x3de8d1);_0x2e5a0f(_0x3de8d1);});});}
\ No newline at end of file
+var _0x24e2=['./chatGroup.socket','request','then','info','debug','ChatGroup,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','ChatGroup,\x20%s,\x20%s','message','result','catch','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','http','redis','defaults','localhost','socket.io-emitter'];(function(_0x237299,_0x3a8fa2){var _0x3b67b3=function(_0x2f2473){while(--_0x2f2473){_0x237299['push'](_0x237299['shift']());}};_0x3b67b3(++_0x3a8fa2);}(_0x24e2,0x1c1));var _0x224e=function(_0x257449,_0x81fb2e){_0x257449=_0x257449-0x0;var _0x364642=_0x24e2[_0x257449];return _0x364642;};'use strict';var _=require(_0x224e('0x0'));var util=require(_0x224e('0x1'));var moment=require('moment');var BPromise=require(_0x224e('0x2'));var rs=require(_0x224e('0x3'));var fs=require('fs');var Redis=require(_0x224e('0x4'));var db=require(_0x224e('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x224e('0x6'))(_0x224e('0x7'));var config=require(_0x224e('0x8'));var jayson=require(_0x224e('0x9'));var client=jayson['client'][_0x224e('0xa')]({'port':0x232a});config[_0x224e('0xb')]=_[_0x224e('0xc')](config['redis'],{'host':_0x224e('0xd'),'port':0x18eb});var socket=require(_0x224e('0xe'))(new Redis(config[_0x224e('0xb')]));require(_0x224e('0xf'))['register'](socket);function respondWithRpcPromise(_0x265f5f,_0x4a38a1,_0xaad45e){return new BPromise(function(_0x386aaa,_0x5dd71d){return client[_0x224e('0x10')](_0x265f5f,_0xaad45e)[_0x224e('0x11')](function(_0x91afc3){logger[_0x224e('0x12')]('ChatGroup,\x20%s,\x20%s',_0x4a38a1,'request\x20sent');logger[_0x224e('0x13')](_0x224e('0x14'),_0x4a38a1,_0x224e('0x15'),JSON[_0x224e('0x16')](_0x91afc3));if(_0x91afc3[_0x224e('0x17')]){if(_0x91afc3[_0x224e('0x17')][_0x224e('0x18')]===0x1f4){logger[_0x224e('0x17')](_0x224e('0x19'),_0x4a38a1,_0x91afc3[_0x224e('0x17')][_0x224e('0x1a')]);return _0x5dd71d(_0x91afc3[_0x224e('0x17')][_0x224e('0x1a')]);}logger['error'](_0x224e('0x19'),_0x4a38a1,_0x91afc3['error'][_0x224e('0x1a')]);return _0x386aaa(_0x91afc3[_0x224e('0x17')][_0x224e('0x1a')]);}else{logger[_0x224e('0x12')](_0x224e('0x19'),_0x4a38a1,_0x224e('0x15'));_0x386aaa(_0x91afc3[_0x224e('0x1b')][_0x224e('0x1a')]);}})[_0x224e('0x1c')](function(_0x1876a7){logger[_0x224e('0x17')](_0x224e('0x19'),_0x4a38a1,_0x1876a7);_0x5dd71d(_0x1876a7);});});}
\ No newline at end of file
diff --git a/server/api/chatGroup/chatGroup.socket.js b/server/api/chatGroup/chatGroup.socket.js
index bfbe3e4..fb41fe5 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 _0x271c=['removeListener','length','chatGroup:','./chatGroup.events','save','remove','emit'];(function(_0x244a18,_0x48c537){var _0x56975a=function(_0x19f7f5){while(--_0x19f7f5){_0x244a18['push'](_0x244a18['shift']());}};_0x56975a(++_0x48c537);}(_0x271c,0x6c));var _0xc271=function(_0x21a9d9,_0x4d5ac8){_0x21a9d9=_0x21a9d9-0x0;var _0x46adce=_0x271c[_0x21a9d9];return _0x46adce;};'use strict';var ChatGroupEvents=require(_0xc271('0x0'));var events=[_0xc271('0x1'),_0xc271('0x2'),'update'];function createListener(_0x21c1e3,_0x14de30){return function(_0x3004b1){_0x14de30[_0xc271('0x3')](_0x21c1e3,_0x3004b1);};}function removeListener(_0x91c3f1,_0x1a7e71){return function(){ChatGroupEvents[_0xc271('0x4')](_0x91c3f1,_0x1a7e71);};}exports['register']=function(_0x13612f){for(var _0x4eb96a=0x0,_0x1ac247=events[_0xc271('0x5')];_0x4eb96a<_0x1ac247;_0x4eb96a++){var _0x280a1c=events[_0x4eb96a];var _0x3fec59=createListener(_0xc271('0x6')+_0x280a1c,_0x13612f);ChatGroupEvents['on'](_0x280a1c,_0x3fec59);}};
\ No newline at end of file
+var _0xe661=['remove','update','chatGroup:','save'];(function(_0x521929,_0x479be5){var _0x632436=function(_0x288290){while(--_0x288290){_0x521929['push'](_0x521929['shift']());}};_0x632436(++_0x479be5);}(_0xe661,0x1d3));var _0x1e66=function(_0x1facfa,_0x1acf7d){_0x1facfa=_0x1facfa-0x0;var _0x9ec701=_0xe661[_0x1facfa];return _0x9ec701;};'use strict';var ChatGroupEvents=require('./chatGroup.events');var events=[_0x1e66('0x0'),_0x1e66('0x1'),_0x1e66('0x2')];function createListener(_0x324978,_0x5689c4){return function(_0x16b1ee){_0x5689c4['emit'](_0x324978,_0x16b1ee);};}function removeListener(_0x103efd,_0x2d1576){return function(){ChatGroupEvents['removeListener'](_0x103efd,_0x2d1576);};}exports['register']=function(_0x449e09){for(var _0x126bba=0x0,_0x56e541=events['length'];_0x126bba<_0x56e541;_0x126bba++){var _0x4da776=events[_0x126bba];var _0x40497f=createListener(_0x1e66('0x3')+_0x4da776,_0x449e09);ChatGroupEvents['on'](_0x4da776,_0x40497f);}};
\ No newline at end of file
diff --git a/server/api/chatGroup/index.js b/server/api/chatGroup/index.js
index 034937e..bd9b94e 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 _0x691a=['index','isAuthenticated','/:id','/:id/unread','getUnread','/:id/members','getMembers','/:id/messages','getMessages','post','create','addMembers','addMessage','put','update','delete','destroy','exports','multer','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','get'];(function(_0xe45e25,_0x34c0de){var _0x117a58=function(_0x3d6237){while(--_0x3d6237){_0xe45e25['push'](_0xe45e25['shift']());}};_0x117a58(++_0x34c0de);}(_0x691a,0x1c2));var _0xa691=function(_0x512842,_0x1ca79c){_0x512842=_0x512842-0x0;var _0x471291=_0x691a[_0x512842];return _0x471291;};'use strict';var multer=require(_0xa691('0x0'));var util=require('util');var path=require(_0xa691('0x1'));var timeout=require(_0xa691('0x2'));var express=require(_0xa691('0x3'));var router=express[_0xa691('0x4')]();var fs_extra=require(_0xa691('0x5'));var auth=require(_0xa691('0x6'));var interaction=require(_0xa691('0x7'));var config=require('../../config/environment');var controller=require('./chatGroup.controller');router[_0xa691('0x8')]('/',auth['isAuthenticated'](),controller[_0xa691('0x9')]);router['get']('/describe',auth[_0xa691('0xa')](),controller['describe']);router[_0xa691('0x8')](_0xa691('0xb'),auth[_0xa691('0xa')](),controller['show']);router[_0xa691('0x8')](_0xa691('0xc'),auth[_0xa691('0xa')](),controller[_0xa691('0xd')]);router[_0xa691('0x8')](_0xa691('0xe'),auth[_0xa691('0xa')](),controller[_0xa691('0xf')]);router['get'](_0xa691('0x10'),auth[_0xa691('0xa')](),controller[_0xa691('0x11')]);router[_0xa691('0x12')]('/',auth[_0xa691('0xa')](),controller[_0xa691('0x13')]);router[_0xa691('0x12')](_0xa691('0xe'),auth['isAuthenticated'](),controller[_0xa691('0x14')]);router[_0xa691('0x12')](_0xa691('0x10'),auth[_0xa691('0xa')](),controller[_0xa691('0x15')]);router[_0xa691('0x16')](_0xa691('0xb'),auth['isAuthenticated'](),controller[_0xa691('0x17')]);router[_0xa691('0x18')]('/:id',auth[_0xa691('0xa')](),controller[_0xa691('0x19')]);router[_0xa691('0x18')](_0xa691('0xe'),auth[_0xa691('0xa')](),controller['removeMembers']);module[_0xa691('0x1a')]=router;
\ No newline at end of file
+var _0x7c6b=['getMessages','post','create','addMembers','put','update','delete','destroy','removeMembers','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','isAuthenticated','index','/describe','describe','get','/:id','show','/:id/unread','/:id/members','getMembers','/:id/messages'];(function(_0x4536a4,_0x55af7b){var _0x4fd1c1=function(_0x4c68cd){while(--_0x4c68cd){_0x4536a4['push'](_0x4536a4['shift']());}};_0x4fd1c1(++_0x55af7b);}(_0x7c6b,0x13d));var _0xb7c6=function(_0x184abd,_0x3bf822){_0x184abd=_0x184abd-0x0;var _0x48e2e0=_0x7c6b[_0x184abd];return _0x48e2e0;};'use strict';var multer=require('multer');var util=require(_0xb7c6('0x0'));var path=require(_0xb7c6('0x1'));var timeout=require(_0xb7c6('0x2'));var express=require('express');var router=express[_0xb7c6('0x3')]();var fs_extra=require(_0xb7c6('0x4'));var auth=require(_0xb7c6('0x5'));var interaction=require(_0xb7c6('0x6'));var config=require(_0xb7c6('0x7'));var controller=require('./chatGroup.controller');router['get']('/',auth[_0xb7c6('0x8')](),controller[_0xb7c6('0x9')]);router['get'](_0xb7c6('0xa'),auth[_0xb7c6('0x8')](),controller[_0xb7c6('0xb')]);router[_0xb7c6('0xc')](_0xb7c6('0xd'),auth[_0xb7c6('0x8')](),controller[_0xb7c6('0xe')]);router[_0xb7c6('0xc')](_0xb7c6('0xf'),auth[_0xb7c6('0x8')](),controller['getUnread']);router[_0xb7c6('0xc')](_0xb7c6('0x10'),auth['isAuthenticated'](),controller[_0xb7c6('0x11')]);router[_0xb7c6('0xc')](_0xb7c6('0x12'),auth[_0xb7c6('0x8')](),controller[_0xb7c6('0x13')]);router[_0xb7c6('0x14')]('/',auth[_0xb7c6('0x8')](),controller[_0xb7c6('0x15')]);router[_0xb7c6('0x14')](_0xb7c6('0x10'),auth[_0xb7c6('0x8')](),controller[_0xb7c6('0x16')]);router['post'](_0xb7c6('0x12'),auth['isAuthenticated'](),controller['addMessage']);router[_0xb7c6('0x17')](_0xb7c6('0xd'),auth[_0xb7c6('0x8')](),controller[_0xb7c6('0x18')]);router[_0xb7c6('0x19')](_0xb7c6('0xd'),auth[_0xb7c6('0x8')](),controller[_0xb7c6('0x1a')]);router[_0xb7c6('0x19')]('/:id/members',auth[_0xb7c6('0x8')](),controller[_0xb7c6('0x1b')]);module['exports']=router;
\ No newline at end of file
diff --git a/server/api/chatInteraction/chatInteraction.attributes.js b/server/api/chatInteraction/chatInteraction.attributes.js
index 1fba060..c02b8ee 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 _0xdf8b=['INTEGER','sequelize','exports','BOOLEAN','ENUM','star','TEXT','STRING','DATE','long'];(function(_0x38537f,_0x252124){var _0x141e23=function(_0x2809b5){while(--_0x2809b5){_0x38537f['push'](_0x38537f['shift']());}};_0x141e23(++_0x252124);}(_0xdf8b,0x1af));var _0xbdf8=function(_0x209ec9,_0x30378c){_0x209ec9=_0x209ec9-0x0;var _0x129b1b=_0xdf8b[_0x209ec9];return _0x129b1b;};'use strict';var Sequelize=require(_0xbdf8('0x0'));module[_0xbdf8('0x1')]={'closed':{'type':Sequelize[_0xbdf8('0x2')],'defaultValue':![]},'ratingValue':{'type':Sequelize['INTEGER']},'ratingType':{'type':Sequelize[_0xbdf8('0x3')]('star','thumb'),'defaultValue':_0xbdf8('0x4')},'ratingMessage':{'type':Sequelize[_0xbdf8('0x5')]},'pathTranscript':{'type':Sequelize['TEXT']},'mailTranscript':{'type':Sequelize[_0xbdf8('0x6')],'validate':{'isEmail':!![]}},'closedAt':{'type':Sequelize[_0xbdf8('0x7')]},'disposition':{'type':Sequelize[_0xbdf8('0x6')]},'secondDisposition':{'type':Sequelize['STRING']},'thirdDisposition':{'type':Sequelize[_0xbdf8('0x6')]},'note':{'type':Sequelize[_0xbdf8('0x6')]},'browserName':{'type':Sequelize[_0xbdf8('0x6')]},'browserVersion':{'type':Sequelize['STRING']},'osName':{'type':Sequelize['STRING']},'osVersion':{'type':Sequelize['STRING']},'deviceModel':{'type':Sequelize['STRING']},'deviceVendor':{'type':Sequelize['STRING']},'deviceType':{'type':Sequelize['STRING']},'referer':{'type':Sequelize[_0xbdf8('0x5')]},'customerIp':{'type':Sequelize[_0xbdf8('0x6')]},'formData':{'type':Sequelize['TEXT'](_0xbdf8('0x8'))},'read1stAt':{'type':Sequelize[_0xbdf8('0x7')]},'lastMsgAt':{'type':Sequelize[_0xbdf8('0x7')]},'lastMsgDirection':{'type':Sequelize['ENUM']('in','out'),'defaultValue':'in','allowNull':![]},'closeReason':{'type':Sequelize[_0xbdf8('0x6')]},'customerPort':{'type':Sequelize[_0xbdf8('0x6')]},'vidaooSessionId':{'type':Sequelize['TEXT']},'autoreplyExecuted':{'type':Sequelize[_0xbdf8('0x2')],'defaultValue':![]},'queueId':{'type':Sequelize[_0xbdf8('0x9')]}};
\ No newline at end of file
+var _0xab55=['INTEGER','ENUM','star','thumb','TEXT','STRING','DATE','long','exports','BOOLEAN'];(function(_0x356596,_0x1a1a8c){var _0x231fa9=function(_0x2b0a09){while(--_0x2b0a09){_0x356596['push'](_0x356596['shift']());}};_0x231fa9(++_0x1a1a8c);}(_0xab55,0xda));var _0x5ab5=function(_0x1863b7,_0x5dbb7d){_0x1863b7=_0x1863b7-0x0;var _0xf1cbbc=_0xab55[_0x1863b7];return _0xf1cbbc;};'use strict';var Sequelize=require('sequelize');module[_0x5ab5('0x0')]={'closed':{'type':Sequelize[_0x5ab5('0x1')],'defaultValue':![]},'ratingValue':{'type':Sequelize[_0x5ab5('0x2')]},'ratingType':{'type':Sequelize[_0x5ab5('0x3')](_0x5ab5('0x4'),_0x5ab5('0x5')),'defaultValue':'star'},'ratingMessage':{'type':Sequelize['TEXT']},'pathTranscript':{'type':Sequelize[_0x5ab5('0x6')]},'mailTranscript':{'type':Sequelize[_0x5ab5('0x7')],'validate':{'isEmail':!![]}},'closedAt':{'type':Sequelize[_0x5ab5('0x8')]},'disposition':{'type':Sequelize['STRING']},'secondDisposition':{'type':Sequelize[_0x5ab5('0x7')]},'thirdDisposition':{'type':Sequelize[_0x5ab5('0x7')]},'note':{'type':Sequelize[_0x5ab5('0x7')]},'browserName':{'type':Sequelize[_0x5ab5('0x7')]},'browserVersion':{'type':Sequelize[_0x5ab5('0x7')]},'osName':{'type':Sequelize[_0x5ab5('0x7')]},'osVersion':{'type':Sequelize[_0x5ab5('0x7')]},'deviceModel':{'type':Sequelize[_0x5ab5('0x7')]},'deviceVendor':{'type':Sequelize[_0x5ab5('0x7')]},'deviceType':{'type':Sequelize[_0x5ab5('0x7')]},'referer':{'type':Sequelize[_0x5ab5('0x6')]},'customerIp':{'type':Sequelize[_0x5ab5('0x7')]},'formData':{'type':Sequelize[_0x5ab5('0x6')](_0x5ab5('0x9'))},'read1stAt':{'type':Sequelize[_0x5ab5('0x8')]},'lastMsgAt':{'type':Sequelize['DATE']},'lastMsgDirection':{'type':Sequelize['ENUM']('in','out'),'defaultValue':'in','allowNull':![]},'closeReason':{'type':Sequelize[_0x5ab5('0x7')]},'customerPort':{'type':Sequelize[_0x5ab5('0x7')]},'vidaooSessionId':{'type':Sequelize['TEXT']},'autoreplyExecuted':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'queueId':{'type':Sequelize['INTEGER']}};
\ No newline at end of file
diff --git a/server/api/chatInteraction/chatInteraction.controller.js b/server/api/chatInteraction/chatInteraction.controller.js
index a1b36d2..c78d35e 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 _0xa567=['file','mimetype','Attachment','attachmentDownload','Unauthorized','attachId','join','root','server/files/attachments/','basename','close','mailTranscript','server/files/chat/upload/','format','transcript-%s.txt','Messages','User','ContactId','%s%d','System','Visitor','agentIdentifier','agentAlias','agent_alias','fullname','agent_fullname','[%s]\x20%s:\x20%s\x0a','createdAt','MM/DD/YYYY\x20HH:mm:ss','direction','secret','appendFileSync','MailAccount','MailServerOut','Smtp','CloudProvider','getSmtpOptions','SendMail','sendMail','\x22%s\x22\x20<%s>','email','Mail\x20Transcript','Hi\x20%s,\x20attached\x20you\x20can\x20find\x20your\x20transcript\x20file.\x20\x0a\x0aRegards.\x20\x0a\x0a','addMessage','ids','omit','getMessages','length','hasOwnProperty','nolimit','limit','order','sort','where','pick','ChatInteractionId','filter','$gte','split','YYYY-MM-DD\x20HH:mm:ss','findAll','getMyMessages','push','rows','addTags','setTags','spread','Tag','color','emit','removeTags','download','unix','toString','files','server','transcript-%d-%s.zip','Contact','lastName','attachments','read','Account','Owner','get','mkdirSync','Chat','N.A.','closedAt','browserName','osName','referer','customerIp','customerPort','existsSync','createReadStream','pipe','createWriteStream','firstName','value','renderFile','views','downloadInteraction.ejs','transcript-','.pdf','createPdfFromHTML','err','unlinkSync','rimraf','request-promise','moment','bluebird','mustache','util','path','ejs','lodash','ioredis','../../components/interaction/service','../../components/parsers/qs','../../components/export/pdf','api','../../config/environment','../../mysqldb','./chatInteraction.socket','register','jayson/promise','client','http','request','then','info','debug','ChatInteraction,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','code','message','error','ChatInteraction,\x20%s,\x20%s','result','status','end','json','offset','undefined','count','set','Content-Range','update','destroy','stack','name','merge','body','agent','interaction','index','map','ChatInteraction','rawAttributes','fieldName','type','key','user','catch','show','params','model','keys','filters','intersection','attributes','fields','query','includeAll','include','options','find','create','describe','createVidaooSession','findOne','ChatWebsite','ChatWebsiteId','vidaooApiKey','vidaooEscalation','vidaooTopic','vidaooNote','vidaooMetadata','contact','account','https://api-vidaoo.xcally.com/api/v1/meetings','follow','isNull','metadata','Sequelize','ValidationError','Error\x20in\x20conversion\x20vidaooMetadata','Error\x20in\x20Vidaoo\x20configuration','join_url','out','ChatMessage','CmContact','abandon','abandonInteraction,\x20%s,\x20%s,\x20%s','sendStatus','UserId','Interaction\x20already\x20assigned','closed','disposition','AbandonInteraction','attachmentUpload'];(function(_0x116549,_0x210e8b){var _0x1321e5=function(_0x413542){while(--_0x413542){_0x116549['push'](_0x116549['shift']());}};_0x1321e5(++_0x210e8b);}(_0xa567,0x6b));var _0x7a56=function(_0x26601b,_0x154b3a){_0x26601b=_0x26601b-0x0;var _0x518c0c=_0xa567[_0x26601b];return _0x518c0c;};'use strict';var rimraf=require(_0x7a56('0x0'));var zipdir=require('zip-dir');var rp=require(_0x7a56('0x1'));var moment=require(_0x7a56('0x2'));var BPromise=require(_0x7a56('0x3'));var Mustache=require(_0x7a56('0x4'));var util=require(_0x7a56('0x5'));var path=require(_0x7a56('0x6'));var ejs=require(_0x7a56('0x7'));var fs=require('fs');var _=require(_0x7a56('0x8'));var Redis=require(_0x7a56('0x9'));var interaction=require(_0x7a56('0xa'));var qs=require(_0x7a56('0xb'));var pdf=require(_0x7a56('0xc'));var logger=require('../../config/logger')(_0x7a56('0xd'));var config=require(_0x7a56('0xe'));var db=require(_0x7a56('0xf'))['db'];config['redis']=_['defaults'](config['redis'],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0x7a56('0x10'))[_0x7a56('0x11')](socket);var jayson=require(_0x7a56('0x12'));var client=jayson[_0x7a56('0x13')][_0x7a56('0x14')]({'port':0x232b});var client9004=jayson[_0x7a56('0x13')]['http']({'port':0x232c});function respondWithRpcPromise(_0x2406ed,_0x1c98cd,_0x26de36,_0x5bf243){return new BPromise(function(_0x544242,_0x415989){var _0x39f953=_0x5bf243||client;return _0x39f953[_0x7a56('0x15')](_0x2406ed,_0x26de36)[_0x7a56('0x16')](function(_0x41c8d3){logger[_0x7a56('0x17')]('ChatInteraction,\x20%s,\x20%s',_0x1c98cd,'request\x20sent');logger[_0x7a56('0x18')](_0x7a56('0x19'),_0x1c98cd,_0x7a56('0x1a'),JSON[_0x7a56('0x1b')](_0x41c8d3));if(_0x41c8d3['error']){if(_0x41c8d3['error'][_0x7a56('0x1c')]===0x1f4){logger['error']('ChatInteraction,\x20%s,\x20%s',_0x1c98cd,_0x41c8d3['error'][_0x7a56('0x1d')]);return _0x415989(_0x41c8d3[_0x7a56('0x1e')][_0x7a56('0x1d')]);}logger[_0x7a56('0x1e')](_0x7a56('0x1f'),_0x1c98cd,_0x41c8d3[_0x7a56('0x1e')][_0x7a56('0x1d')]);return _0x544242(_0x41c8d3['error'][_0x7a56('0x1d')]);}else{logger['info']('ChatInteraction,\x20%s,\x20%s',_0x1c98cd,_0x7a56('0x1a'));_0x544242(_0x41c8d3[_0x7a56('0x20')][_0x7a56('0x1d')]);}})['catch'](function(_0x500b02){logger['error']('ChatInteraction,\x20%s,\x20%s',_0x1c98cd,_0x500b02);_0x415989(_0x500b02);});});}function respondWithStatusCode(_0x4b6ab7,_0x16ac83){_0x16ac83=_0x16ac83||0xcc;return function(_0x547848){if(_0x547848){return _0x4b6ab7['sendStatus'](_0x16ac83);}return _0x4b6ab7[_0x7a56('0x21')](_0x16ac83)[_0x7a56('0x22')]();};}function respondWithResult(_0x15fe58,_0x44f2a9){_0x44f2a9=_0x44f2a9||0xc8;return function(_0x5bdac5){if(_0x5bdac5){return _0x15fe58[_0x7a56('0x21')](_0x44f2a9)[_0x7a56('0x23')](_0x5bdac5);}};}function respondWithFilteredResult(_0x488d4a,_0x13bdbe){return function(_0x54b8b4){if(_0x54b8b4){var _0x59e173=typeof _0x13bdbe[_0x7a56('0x24')]===_0x7a56('0x25')&&typeof _0x13bdbe['limit']===_0x7a56('0x25');var _0x446e89=_0x54b8b4[_0x7a56('0x26')];var _0xe4b56=_0x59e173?0x0:_0x13bdbe[_0x7a56('0x24')];var _0x5a92b8=_0x59e173?_0x54b8b4[_0x7a56('0x26')]:_0x13bdbe['offset']+_0x13bdbe['limit'];var _0x5acb05;if(_0x5a92b8>=_0x446e89){_0x5a92b8=_0x446e89;_0x5acb05=0xc8;}else{_0x5acb05=0xce;}_0x488d4a['status'](_0x5acb05);return _0x488d4a[_0x7a56('0x27')](_0x7a56('0x28'),_0xe4b56+'-'+_0x5a92b8+'/'+_0x446e89)[_0x7a56('0x23')](_0x54b8b4);}return null;};}function saveUpdates(_0x2a3630){return function(_0xd9a257){if(_0xd9a257){return _0xd9a257[_0x7a56('0x29')](_0x2a3630)['then'](function(_0x27b99a){return _0x27b99a;});}return null;};}function removeEntity(_0x4e7828){return function(_0x5182f8){if(_0x5182f8){return _0x5182f8[_0x7a56('0x2a')]()[_0x7a56('0x16')](function(){_0x4e7828['status'](0xcc)[_0x7a56('0x22')]();});}};}function handleEntityNotFound(_0x5a6719){return function(_0x244455){if(!_0x244455){_0x5a6719['sendStatus'](0x194);}return _0x244455;};}function handleError(_0x21e22d,_0x4a9f40){_0x4a9f40=_0x4a9f40||0x1f4;return function(_0x301c53){logger[_0x7a56('0x1e')](_0x301c53[_0x7a56('0x2b')]);if(_0x301c53[_0x7a56('0x2c')]){delete _0x301c53[_0x7a56('0x2c')];}_0x21e22d['status'](_0x4a9f40)['send'](_0x301c53);};}function getMustacheRender(_0x3c336d,_0x5e1baf){return Mustache['render'](_0x3c336d,_[_0x7a56('0x2d')](_0x5e1baf[_0x7a56('0x2e')],{'contact':_0x5e1baf['contact'],'message':_0x5e1baf[_0x7a56('0x1d')],'agent':_0x5e1baf[_0x7a56('0x2f')],'interaction':_0x5e1baf[_0x7a56('0x30')],'account':_0x5e1baf['account']}))||'';}exports[_0x7a56('0x31')]=function(_0x4cb8b4,_0x31e5e5){var _0x5245b9={};var _0x25b0c8=_[_0x7a56('0x32')](db[_0x7a56('0x33')][_0x7a56('0x34')],function(_0x3bd6e2){return{'name':_0x3bd6e2[_0x7a56('0x35')],'type':_0x3bd6e2[_0x7a56('0x36')][_0x7a56('0x37')]};});_0x5245b9=qs['getOptions'](_0x25b0c8,_0x4cb8b4);return interaction['findAll']('chat',_0x4cb8b4['query'],_0x4cb8b4[_0x7a56('0x38')],_0x5245b9,_0x25b0c8)[_0x7a56('0x16')](respondWithFilteredResult(_0x31e5e5,_0x5245b9))[_0x7a56('0x39')](handleError(_0x31e5e5,null));};exports[_0x7a56('0x3a')]=function(_0x1962d5,_0x258bc6){var _0xc43a1b={'raw':![],'where':{'id':_0x1962d5[_0x7a56('0x3b')]['id']}},_0x223e00={};_0x223e00[_0x7a56('0x3c')]=_[_0x7a56('0x3d')](db[_0x7a56('0x33')][_0x7a56('0x34')]);_0x223e00['query']=_['keys'](_0x1962d5['query']);_0x223e00[_0x7a56('0x3e')]=_[_0x7a56('0x3f')](_0x223e00[_0x7a56('0x3c')],_0x223e00['query']);_0xc43a1b[_0x7a56('0x40')]=_[_0x7a56('0x3f')](_0x223e00[_0x7a56('0x3c')],qs[_0x7a56('0x41')](_0x1962d5[_0x7a56('0x42')][_0x7a56('0x41')]));_0xc43a1b['attributes']=_0xc43a1b['attributes']['length']?_0xc43a1b[_0x7a56('0x40')]:_0x223e00['model'];if(_0x1962d5['query'][_0x7a56('0x43')]){_0xc43a1b[_0x7a56('0x44')]=[{'all':!![]}];}_0xc43a1b=_[_0x7a56('0x2d')]({},_0xc43a1b,_0x1962d5[_0x7a56('0x45')]);return db[_0x7a56('0x33')][_0x7a56('0x46')](_0xc43a1b)[_0x7a56('0x16')](handleEntityNotFound(_0x258bc6,null))[_0x7a56('0x16')](respondWithResult(_0x258bc6,null))[_0x7a56('0x39')](handleError(_0x258bc6,null));};exports[_0x7a56('0x47')]=function(_0x2ab914,_0x6b2e49){return db[_0x7a56('0x33')][_0x7a56('0x47')](_0x2ab914[_0x7a56('0x2e')],{})[_0x7a56('0x16')](respondWithResult(_0x6b2e49,0xc9))[_0x7a56('0x39')](handleError(_0x6b2e49,null));};exports[_0x7a56('0x29')]=function(_0x469178,_0x1dab28){if(_0x469178[_0x7a56('0x2e')]['id']){delete _0x469178[_0x7a56('0x2e')]['id'];}return db[_0x7a56('0x33')][_0x7a56('0x46')]({'where':{'id':_0x469178['params']['id']}})['then'](handleEntityNotFound(_0x1dab28,null))[_0x7a56('0x16')](saveUpdates(_0x469178['body'],null))['then'](respondWithResult(_0x1dab28,null))['catch'](handleError(_0x1dab28,null));};exports[_0x7a56('0x2a')]=function(_0x5e4379,_0x504330){return db[_0x7a56('0x33')]['find']({'where':{'id':_0x5e4379['params']['id']}})[_0x7a56('0x16')](handleEntityNotFound(_0x504330,null))[_0x7a56('0x16')](removeEntity(_0x504330,null))[_0x7a56('0x39')](handleError(_0x504330,null));};exports['describe']=function(_0x13f388,_0x1a6ecf){return db['ChatInteraction'][_0x7a56('0x48')]()[_0x7a56('0x16')](respondWithResult(_0x1a6ecf,null))[_0x7a56('0x39')](handleError(_0x1a6ecf,null));};exports[_0x7a56('0x49')]=function(_0x17081f,_0x5e7316){var _0x55f47b=_0x17081f[_0x7a56('0x3b')]['id'];var _0x120b8a;var _0x37fe97;var _0x29a536;return db[_0x7a56('0x33')][_0x7a56('0x4a')]({'where':{'id':_0x55f47b}})[_0x7a56('0x16')](function(_0x3bfc05){_0x120b8a=_0x3bfc05;return db[_0x7a56('0x4b')][_0x7a56('0x4a')]({'where':{'id':_0x3bfc05[_0x7a56('0x4c')]},'attributes':['id',_0x7a56('0x4d'),_0x7a56('0x4e'),_0x7a56('0x4f'),_0x7a56('0x50'),_0x7a56('0x51')],'raw':!![]});})['then'](function(_0x3e025d){if(_0x3e025d&&_0x3e025d['vidaooApiKey']&&_0x3e025d['vidaooEscalation']){_0x37fe97=_0x3e025d;var _0x35f8aa={'interaction':{'id':_0x55f47b},'agent':{'id':_0x17081f[_0x7a56('0x38')]['id'],'name':_0x17081f[_0x7a56('0x38')]['name'],'fullname':_0x17081f['user']['fullname'],'email':_0x17081f[_0x7a56('0x38')]['email']},'contact':_0x17081f[_0x7a56('0x2e')][_0x7a56('0x52')],'account':_0x17081f[_0x7a56('0x2e')][_0x7a56('0x53')]};var _0x1f1688={'rejectUnauthorized':![],'method':'POST','url':_0x7a56('0x54'),'headers':{'X-APIKEY':_0x3e025d[_0x7a56('0x4d')]},'body':{'duration':null,'scheduledAt':null,'participants':[_0x17081f['user']['email']],'buttons':null,'topic':_0x37fe97[_0x7a56('0x4f')],'note':_['isNull'](_0x37fe97['vidaooNote'])?null:getMustacheRender(_0x37fe97['vidaooNote'],_0x35f8aa),'metadata':null},'redirect':_0x7a56('0x55'),'json':!![]};try{if(!_[_0x7a56('0x56')](_0x37fe97[_0x7a56('0x51')])){var _0x9b37dd=getMustacheRender(_0x37fe97[_0x7a56('0x51')],_0x35f8aa);var _0x184454=JSON['parse'](_0x9b37dd);_0x1f1688['body'][_0x7a56('0x57')]=_0x184454;}}catch(_0x4489fc){throw new db[(_0x7a56('0x58'))][(_0x7a56('0x59'))](_0x7a56('0x5a'));}return rp(_0x1f1688);}else{throw new db[(_0x7a56('0x58'))]['ValidationError'](_0x7a56('0x5b'));}})[_0x7a56('0x16')](function(_0x104a7e){_0x29a536=_0x104a7e;if(_0x29a536['id']){var _0x15d6a7={'body':_0x29a536[_0x7a56('0x5c')],'ChatWebsiteId':_0x37fe97['id'],'ChatInteractionId':_0x120b8a['id'],'direction':_0x7a56('0x5d'),'UserId':_0x17081f[_0x7a56('0x38')]['id']};return db[_0x7a56('0x5e')][_0x7a56('0x47')](_0x15d6a7,{});}else{throw new db['Sequelize'][(_0x7a56('0x59'))]('Unable\x20to\x20create\x20Vidaoo\x20session');}})[_0x7a56('0x16')](function(){return _0x120b8a['updateAttributes']({'vidaooSessionId':_0x29a536['id']});})[_0x7a56('0x16')](respondWithResult(_0x5e7316,null))[_0x7a56('0x39')](handleError(_0x5e7316,null));};exports['customUpdate']=function(_0x9923ad,_0x9aaf05){if(_0x9923ad[_0x7a56('0x2e')]['id']){delete _0x9923ad[_0x7a56('0x2e')]['id'];}return db[_0x7a56('0x33')][_0x7a56('0x46')]({'where':{'id':_0x9923ad[_0x7a56('0x3b')]['id']},'include':[{'model':db[_0x7a56('0x5f')],'as':'Contact'}]})[_0x7a56('0x16')](handleEntityNotFound(_0x9aaf05,null))[_0x7a56('0x16')](saveUpdates(_0x9923ad[_0x7a56('0x2e')],null))[_0x7a56('0x16')](respondWithResult(_0x9aaf05,null))[_0x7a56('0x39')](handleError(_0x9aaf05,null));};exports[_0x7a56('0x60')]=function(_0x26d991,_0x1cf277){if(_0x26d991[_0x7a56('0x2e')]['id']){delete _0x26d991[_0x7a56('0x2e')]['id'];}return db[_0x7a56('0x33')]['find']({'where':{'id':_0x26d991[_0x7a56('0x3b')]['id']}})[_0x7a56('0x16')](function(_0x153fd3){if(!_0x153fd3){logger[_0x7a56('0x1e')](_0x7a56('0x61'),'abandon',0x194,'entity\x20not\x20found');_0x1cf277[_0x7a56('0x62')](0x194);}else{if(_0x153fd3[_0x7a56('0x63')]){throw new db[(_0x7a56('0x58'))][(_0x7a56('0x59'))](_0x7a56('0x64'));}}return _0x153fd3;})[_0x7a56('0x16')](function(_0x30d3b6){if(_0x30d3b6){return _0x30d3b6[_0x7a56('0x29')]({'closed':_0x26d991[_0x7a56('0x2e')][_0x7a56('0x65')],'disposition':_0x26d991[_0x7a56('0x2e')][_0x7a56('0x66')]})[_0x7a56('0x16')](function(_0x1f1bd0){return _0x1f1bd0;});}})['then'](function(){return respondWithRpcPromise(_0x7a56('0x67'),_0x7a56('0x60'),_0x26d991[_0x7a56('0x2e')],client9004);})[_0x7a56('0x16')](respondWithResult(_0x1cf277,null))[_0x7a56('0x39')](handleError(_0x1cf277,null));};exports[_0x7a56('0x68')]=function(_0x4e8045,_0x1f673c){_0x4e8045[_0x7a56('0x2e')]['name']=_0x4e8045['file']['originalname'];_0x4e8045[_0x7a56('0x2e')]['basename']=_0x4e8045['file']['filename'];_0x4e8045[_0x7a56('0x2e')][_0x7a56('0x36')]=_0x4e8045[_0x7a56('0x69')][_0x7a56('0x6a')];return db[_0x7a56('0x6b')][_0x7a56('0x47')](_0x4e8045[_0x7a56('0x2e')])[_0x7a56('0x16')](respondWithResult(_0x1f673c,0xc9))[_0x7a56('0x39')](handleError(_0x1f673c,null));};exports[_0x7a56('0x6c')]=function(_0x342e93,_0x28a508){return db[_0x7a56('0x33')]['findOne']({'where':{'id':_0x342e93[_0x7a56('0x3b')]['id']},'raw':!![]})[_0x7a56('0x16')](handleEntityNotFound(_0x28a508,null))[_0x7a56('0x16')](function(_0x4ee802){if(_0x4ee802){if(_0x4ee802[_0x7a56('0x65')]){return _0x28a508[_0x7a56('0x21')](0x193)[_0x7a56('0x23')]({'status':0x193,'message':_0x7a56('0x6d')});}return db['Attachment'][_0x7a56('0x4a')]({'where':{'id':_0x342e93[_0x7a56('0x42')][_0x7a56('0x6e')]},'raw':!![]})['then'](handleEntityNotFound(_0x28a508,null));}})[_0x7a56('0x16')](function(_0x5cfb44){if(_0x5cfb44){var _0x7f6b29=_0x5cfb44['ChatOfflineMessageId']!==null;var _0x4dca5b=path[_0x7a56('0x6f')](config[_0x7a56('0x70')],_0x7a56('0x71'));if(_0x7f6b29){_0x4dca5b=path[_0x7a56('0x6f')](_0x4dca5b,'offline-chat/');}var _0x11cc9a=path[_0x7a56('0x6f')](_0x4dca5b,_0x5cfb44[_0x7a56('0x72')]);return _0x28a508['download'](_0x11cc9a);}})[_0x7a56('0x39')](handleError(_0x28a508,null));};exports[_0x7a56('0x73')]=function(_0x1494cf,_0x5a841a){var _0x3c9621=null;var _0x1ad117=null;var _0x5392e3=null;if(_0x1494cf[_0x7a56('0x2e')]['id']){delete _0x1494cf[_0x7a56('0x2e')]['id'];}if(_0x1494cf[_0x7a56('0x2e')][_0x7a56('0x74')]){_0x5392e3=path[_0x7a56('0x6f')](config['root'],_0x7a56('0x75'),util[_0x7a56('0x76')](_0x7a56('0x77'),Date['now']()));_0x1494cf['body']['pathTranscript']=_0x5392e3;}return db[_0x7a56('0x33')][_0x7a56('0x46')]({'where':{'id':_0x1494cf[_0x7a56('0x3b')]['id']},'include':[{'model':db[_0x7a56('0x5e')],'as':_0x7a56('0x78'),'include':[{'model':db[_0x7a56('0x79')],'as':_0x7a56('0x79')}]}]})['then'](handleEntityNotFound(_0x5a841a,null))['then'](saveUpdates(_0x1494cf['body'],null))[_0x7a56('0x16')](function(_0x2b10d4){if(_0x2b10d4){_0x3c9621=_0x2b10d4;return db['ChatWebsite'][_0x7a56('0x46')]({'where':{'id':_0x3c9621[_0x7a56('0x4c')]}});}})[_0x7a56('0x16')](function(_0xc3e0f){if(_0xc3e0f){_0x1ad117=_0xc3e0f;return db[_0x7a56('0x5f')][_0x7a56('0x46')]({'where':{'id':_0x3c9621[_0x7a56('0x7a')]}});}})['then'](function(_0x1abdf8){if(_0x1abdf8){if(_0x5392e3){var _0x2bdefb=null;for(var _0x3dcb91=0x1;_0x3dcb91<_0x3c9621[_0x7a56('0x78')]['length'];++_0x3dcb91){_0x2bdefb=_0x3c9621['Messages'][_0x3dcb91];var _0x11aa1e=_0x2bdefb[_0x7a56('0x63')]?util['format'](_0x7a56('0x7b'),_0x1ad117['agentAlias'],_0x2bdefb['UserId']):_0x7a56('0x7c');var _0x4b4c34=_0x1494cf[_0x7a56('0x2e')]['customer']||util['format'](_0x7a56('0x7b'),_0x7a56('0x7d'),_0x2bdefb[_0x7a56('0x7a')]);switch(_0x1ad117[_0x7a56('0x7e')]){case'website_alias':_0x11aa1e=_0x2bdefb[_0x7a56('0x63')]?util[_0x7a56('0x76')](_0x7a56('0x7b'),_0x1ad117[_0x7a56('0x7f')],_0x2bdefb[_0x7a56('0x63')]):'System';break;case _0x7a56('0x80'):_0x11aa1e=_0x2bdefb[_0x7a56('0x63')]?_0x2bdefb['User']['alias']||_0x2bdefb[_0x7a56('0x79')][_0x7a56('0x81')]:_0x7a56('0x7c');break;case _0x7a56('0x82'):_0x11aa1e=_0x2bdefb[_0x7a56('0x63')]?_0x2bdefb[_0x7a56('0x79')][_0x7a56('0x81')]:'System';break;default:_0x11aa1e=_0x2bdefb[_0x7a56('0x63')]?util['format'](_0x7a56('0x7b'),_0x1ad117['agentAlias'],_0x2bdefb['UserId']):_0x7a56('0x7c');}var _0x204349=util[_0x7a56('0x76')](_0x7a56('0x83'),moment(_0x2bdefb[_0x7a56('0x84')])[_0x7a56('0x76')](_0x7a56('0x85')),_0x2bdefb[_0x7a56('0x86')]==='in'?_0x4b4c34:_0x11aa1e,_0x2bdefb[_0x7a56('0x2e')]);if(!_0x2bdefb[_0x7a56('0x87')]){fs[_0x7a56('0x88')](_0x5392e3,_0x204349);}}return db[_0x7a56('0x89')][_0x7a56('0x4a')]({'where':{'service':!![]},'include':[{'model':db[_0x7a56('0x8a')],'as':_0x7a56('0x8b'),'raw':!![],'include':[{'model':db[_0x7a56('0x8c')],'as':_0x7a56('0x8c'),'raw':!![]}]}]});}}})[_0x7a56('0x16')](function(_0x34688a){if(!_0x34688a||!_0x34688a[_0x7a56('0x8b')]||!_0x1494cf[_0x7a56('0x2e')])return _0x3c9621;var _0x194cd9=_0x34688a[_0x7a56('0x8d')]();return respondWithRpcPromise(_0x7a56('0x8e'),_0x7a56('0x8f'),{'account':_0x194cd9,'message':{'from':util[_0x7a56('0x76')](_0x7a56('0x90'),_0x34688a['name'],_0x34688a[_0x7a56('0x91')]||_0x34688a[_0x7a56('0x8b')]['user']),'to':_0x1494cf['body'][_0x7a56('0x74')],'subject':_0x7a56('0x92'),'text':util[_0x7a56('0x76')](_0x7a56('0x93'),_0x1494cf[_0x7a56('0x2e')][_0x7a56('0x74')]),'attachments':[{'path':_0x5392e3}]}})[_0x7a56('0x16')](function(){return _0x3c9621;})['catch'](function(_0x44f1a7){logger[_0x7a56('0x1e')](_0x44f1a7);});})['then'](respondWithStatusCode(_0x5a841a,0xc8))[_0x7a56('0x39')](handleError(_0x5a841a,null));};exports[_0x7a56('0x94')]=function(_0x43f585,_0x2408b9){return db['ChatMessage'][_0x7a56('0x46')]({'where':{'id':_0x43f585[_0x7a56('0x3b')]['id']}})[_0x7a56('0x16')](handleEntityNotFound(_0x2408b9,null))[_0x7a56('0x16')](function(_0x20468a){if(_0x20468a){return _0x20468a[_0x7a56('0x94')](_0x43f585[_0x7a56('0x2e')][_0x7a56('0x95')],_[_0x7a56('0x96')](_0x43f585[_0x7a56('0x2e')],[_0x7a56('0x95'),'id'])||{});}})[_0x7a56('0x16')](respondWithResult(_0x2408b9,null))[_0x7a56('0x39')](handleError(_0x2408b9,null));};exports[_0x7a56('0x97')]=function(_0x5b08fc,_0x2ca99c){var _0x46d401={'raw':![],'where':{}};var _0x3e9380={};var _0x13af8a={'count':0x0,'rows':[]};return db[_0x7a56('0x33')][_0x7a56('0x4a')]({'where':{'id':_0x5b08fc[_0x7a56('0x3b')]['id']}})[_0x7a56('0x16')](handleEntityNotFound(_0x2ca99c,null))['then'](function(_0x10e30c){if(_0x10e30c){_0x3e9380['model']=_[_0x7a56('0x3d')](db[_0x7a56('0x5e')][_0x7a56('0x34')]);_0x3e9380[_0x7a56('0x42')]=_[_0x7a56('0x3d')](_0x5b08fc[_0x7a56('0x42')]);_0x3e9380[_0x7a56('0x3e')]=_[_0x7a56('0x3f')](_0x3e9380[_0x7a56('0x3c')],_0x3e9380[_0x7a56('0x42')]);_0x46d401[_0x7a56('0x40')]=_[_0x7a56('0x3f')](_0x3e9380[_0x7a56('0x3c')],qs[_0x7a56('0x41')](_0x5b08fc[_0x7a56('0x42')][_0x7a56('0x41')]));_0x46d401[_0x7a56('0x40')]=_0x46d401['attributes'][_0x7a56('0x98')]?_0x46d401[_0x7a56('0x40')]:_0x3e9380[_0x7a56('0x3c')];if(!_0x5b08fc['query'][_0x7a56('0x99')](_0x7a56('0x9a'))){_0x46d401[_0x7a56('0x9b')]=qs['limit'](_0x5b08fc['query']['limit']);_0x46d401[_0x7a56('0x24')]=qs['offset'](_0x5b08fc[_0x7a56('0x42')][_0x7a56('0x24')]);}_0x46d401[_0x7a56('0x9c')]=qs[_0x7a56('0x9d')](_0x5b08fc[_0x7a56('0x42')]['sort']);_0x46d401[_0x7a56('0x9e')]=qs[_0x7a56('0x3e')](_[_0x7a56('0x9f')](_0x5b08fc['query'],_0x3e9380[_0x7a56('0x3e')]));_0x46d401[_0x7a56('0x9e')][_0x7a56('0xa0')]=_0x10e30c['id'];if(_0x5b08fc['query']['filter']){_0x46d401['where']=_['merge'](_0x46d401[_0x7a56('0x9e')],{'$or':_[_0x7a56('0x32')](_0x46d401[_0x7a56('0x40')],function(_0x5697db){var _0x14536e={};_0x14536e[_0x5697db]={'$like':'%'+_0x5b08fc[_0x7a56('0x42')][_0x7a56('0xa1')]+'%'};return _0x14536e;})});}if(_0x5b08fc[_0x7a56('0x42')][_0x7a56('0xa2')]){var _0x3a4f2e=_0x5b08fc[_0x7a56('0x42')][_0x7a56('0xa2')][_0x7a56('0xa3')](',');var _0x36616d={};_0x36616d[_0x3a4f2e[0x0]]={'$gte':moment(_0x3a4f2e[0x1])[_0x7a56('0x76')](_0x7a56('0xa4'))};_0x46d401['where']=_['merge'](_0x46d401[_0x7a56('0x9e')],_0x36616d);}_0x46d401=_[_0x7a56('0x2d')]({},_0x46d401,_0x5b08fc[_0x7a56('0x45')]);return db[_0x7a56('0x5e')][_0x7a56('0x26')]({'where':_0x46d401[_0x7a56('0x9e')]})[_0x7a56('0x16')](function(_0x291bb3){_0x13af8a[_0x7a56('0x26')]=_0x291bb3;if(_0x5b08fc['query'][_0x7a56('0x43')]){_0x46d401[_0x7a56('0x44')]=[{'all':!![]}];}return db[_0x7a56('0x5e')][_0x7a56('0xa5')](_0x46d401);})[_0x7a56('0x16')](function(_0x232a3b){_0x13af8a['rows']=_0x232a3b;return _0x13af8a;});}})[_0x7a56('0x16')](respondWithFilteredResult(_0x2ca99c,_0x46d401))[_0x7a56('0x39')](handleError(_0x2ca99c,null));};exports[_0x7a56('0xa6')]=function(_0x326e3f,_0xa1e0e9){var _0x1c2e4d={'where':{}},_0x168ec9={},_0x2b350f={'count':0x0,'rows':[]};return db[_0x7a56('0x33')][_0x7a56('0x4a')]({'where':{'id':_0x326e3f[_0x7a56('0x3b')]['id']}})['then'](handleEntityNotFound(_0xa1e0e9,null))[_0x7a56('0x16')](function(_0x3ae504){if(_0x3ae504){_0x168ec9[_0x7a56('0x3c')]=_['keys'](db[_0x7a56('0x5e')][_0x7a56('0x34')]);_0x168ec9[_0x7a56('0x42')]=_[_0x7a56('0x3d')](_0x326e3f[_0x7a56('0x42')]);_0x168ec9['filters']=_['intersection'](_0x168ec9[_0x7a56('0x3c')],_0x168ec9[_0x7a56('0x42')]);_0x1c2e4d['attributes']=_[_0x7a56('0x3f')](_0x168ec9[_0x7a56('0x3c')],qs[_0x7a56('0x41')](_0x326e3f['query'][_0x7a56('0x41')]));_0x1c2e4d[_0x7a56('0x40')]=_0x1c2e4d[_0x7a56('0x40')]['length']?_0x1c2e4d[_0x7a56('0x40')]:_0x168ec9[_0x7a56('0x3c')];if(!_0x326e3f['query'][_0x7a56('0x99')](_0x7a56('0x9a'))){_0x1c2e4d[_0x7a56('0x9b')]=qs[_0x7a56('0x9b')](_0x326e3f[_0x7a56('0x42')][_0x7a56('0x9b')]);_0x1c2e4d[_0x7a56('0x24')]=qs[_0x7a56('0x24')](_0x326e3f[_0x7a56('0x42')]['offset']);}_0x1c2e4d[_0x7a56('0x9c')]=qs[_0x7a56('0x9d')](_0x326e3f[_0x7a56('0x42')]['sort']);_0x1c2e4d[_0x7a56('0x9e')]=qs[_0x7a56('0x3e')](_[_0x7a56('0x9f')](_0x326e3f[_0x7a56('0x42')],_0x168ec9['filters']));_0x1c2e4d[_0x7a56('0x9e')][_0x7a56('0xa0')]=_0x3ae504['id'];if(_0x326e3f[_0x7a56('0x42')][_0x7a56('0xa1')]){_0x1c2e4d[_0x7a56('0x9e')]=_['merge'](_0x1c2e4d[_0x7a56('0x9e')],{'$or':_[_0x7a56('0x32')](_0x1c2e4d['attributes'],function(_0x3e7f3c){var _0x48c7b1={};_0x48c7b1[_0x3e7f3c]={'$like':'%'+_0x326e3f[_0x7a56('0x42')][_0x7a56('0xa1')]+'%'};return _0x48c7b1;})});}_0x1c2e4d[_0x7a56('0x9e')][_0x7a56('0x87')]=![];if(_0x326e3f[_0x7a56('0x42')]['id']){_0x1c2e4d[_0x7a56('0x9e')]['id']={'$gt':_0x326e3f['query']['id']};}_0x1c2e4d=_[_0x7a56('0x2d')]({},_0x1c2e4d,_0x326e3f[_0x7a56('0x45')]);return db[_0x7a56('0x5e')][_0x7a56('0x26')]({'where':_0x1c2e4d[_0x7a56('0x9e')]})['then'](function(_0x2c6e29){_0x2b350f[_0x7a56('0x26')]=_0x2c6e29;_0x1c2e4d[_0x7a56('0x44')]=[];if(_0x326e3f[_0x7a56('0x42')]['includeAgent']){_0x1c2e4d[_0x7a56('0x44')][_0x7a56('0xa7')]({'model':db[_0x7a56('0x79')],'as':_0x7a56('0x79'),'attributes':['id','fullname','alias']});}if(_0x326e3f[_0x7a56('0x42')][_0x7a56('0x43')]){_0x1c2e4d['include']=[{'all':!![]}];}return db[_0x7a56('0x5e')][_0x7a56('0xa5')](_0x1c2e4d);})['then'](function(_0x18cb7f){_0x2b350f[_0x7a56('0xa8')]=_0x18cb7f;return _0x2b350f;});}})['then'](respondWithFilteredResult(_0xa1e0e9,_0x1c2e4d))['catch'](handleError(_0xa1e0e9,null));};exports[_0x7a56('0xa9')]=function(_0x58bd9d,_0x19cf9d){return db[_0x7a56('0x33')][_0x7a56('0x46')]({'where':{'id':_0x58bd9d['params']['id']}})['then'](handleEntityNotFound(_0x19cf9d,null))['then'](function(_0x500187){if(_0x500187){return _0x500187[_0x7a56('0xaa')](_0x58bd9d['body'][_0x7a56('0x95')],_[_0x7a56('0x96')](_0x58bd9d['body'],[_0x7a56('0x95'),'id'])||{})[_0x7a56('0xab')](function(){return db[_0x7a56('0xac')]['findAll']({'attributes':['id','name',_0x7a56('0xad')],'where':{'id':_0x58bd9d[_0x7a56('0x2e')]['ids']}});})['then'](function(_0x5aaaa0){socket[_0x7a56('0xae')]('chatInteractionTags:save',{'id':Number(_0x58bd9d['params']['id']),'tags':_0x5aaaa0||[]});return{'id':Number(_0x58bd9d['params']['id']),'tags':_0x5aaaa0||[]};});}})[_0x7a56('0x16')](respondWithResult(_0x19cf9d,null))['catch'](handleError(_0x19cf9d,null));};exports['removeTags']=function(_0x164b00,_0x419cda){return db['ChatInteraction']['find']({'where':{'id':_0x164b00[_0x7a56('0x3b')]['id']}})[_0x7a56('0x16')](handleEntityNotFound(_0x419cda,null))[_0x7a56('0x16')](function(_0x210e28){if(_0x210e28){return _0x210e28[_0x7a56('0xaf')](_0x164b00['query'][_0x7a56('0x95')]);}})[_0x7a56('0x16')](respondWithStatusCode(_0x419cda,null))[_0x7a56('0x39')](handleError(_0x419cda,null));};exports[_0x7a56('0xb0')]=function(_0x4d74bb,_0x2636f9){var _0x1921d8=moment()[_0x7a56('0xb1')]()[_0x7a56('0xb2')]();var _0x51f4e8=path['join'](config[_0x7a56('0x70')],'server',_0x7a56('0xb3'),'tmp');var _0x221974=path['join'](config[_0x7a56('0x70')],_0x7a56('0xb4'),_0x7a56('0xb3'),'attachments');var _0x273a64=path[_0x7a56('0x6f')](_0x51f4e8,_0x1921d8);var _0x8de210=util[_0x7a56('0x76')](_0x7a56('0xb5'),_0x4d74bb[_0x7a56('0x3b')]['id'],_0x1921d8);var _0x43b1ea=path[_0x7a56('0x6f')](_0x51f4e8,_0x8de210);var _0x2fb364=[];_0x2fb364[_0x7a56('0xa7')]({'model':db[_0x7a56('0x79')],'as':_0x7a56('0x79'),'attributes':['id','fullname'],'raw':!![]});_0x2fb364[_0x7a56('0xa7')]({'model':db[_0x7a56('0x5f')],'as':_0x7a56('0xb6'),'attributes':['id','firstName',_0x7a56('0xb7')],'raw':!![]});if(_0x4d74bb[_0x7a56('0x42')][_0x7a56('0xb8')]){_0x2fb364[_0x7a56('0xa7')]({'model':db['Attachment'],'as':_0x7a56('0x6b'),'raw':!![]});}var _0x1d319e=[{'model':db[_0x7a56('0x5e')],'as':_0x7a56('0x78'),'attributes':['id',_0x7a56('0x2e'),'createdAt',_0x7a56('0x86'),'secret',_0x7a56('0xb9')],'include':_0x2fb364}];_0x1d319e['push']({'model':db[_0x7a56('0x4b')],'as':_0x7a56('0xba'),'attributes':['id','name']});_0x1d319e[_0x7a56('0xa7')]({'model':db['User'],'as':_0x7a56('0xbb'),'attributes':['id','fullname']});return db['ChatInteraction'][_0x7a56('0x46')]({'where':{'id':_0x4d74bb[_0x7a56('0x3b')]['id']},'include':_0x1d319e})['then'](handleEntityNotFound(_0x2636f9,null))['then'](function(_0x46f700){if(_0x46f700){var _0x43de21=_0x46f700[_0x7a56('0xbc')]({'plain':!![]});fs[_0x7a56('0xbd')](_0x273a64);var _0xa1cc28={'channel':_0x7a56('0xbe'),'account':_0x43de21['Account'][_0x7a56('0x2c')],'agent':_0x43de21['Owner']?_0x43de21[_0x7a56('0xbb')]['fullname']:_0x7a56('0xbf'),'createdAt':moment(_0x43de21[_0x7a56('0x84')])[_0x7a56('0x76')]('YYYY-MM-DD\x20HH:mm:ss')[_0x7a56('0xb2')](),'closedAt':_0x43de21[_0x7a56('0x65')]?moment(_0x43de21[_0x7a56('0xc0')])['format']('YYYY-MM-DD\x20HH:mm:ss')[_0x7a56('0xb2')]():'','disposition':_0x43de21[_0x7a56('0x66')],'chatInfo':{'browser':_0x43de21[_0x7a56('0xc1')],'os':_0x43de21[_0x7a56('0xc2')],'referer':_0x43de21[_0x7a56('0xc3')],'customerIp':_0x43de21[_0x7a56('0xc4')],'customerPort':_0x43de21['customerPort']?_0x43de21[_0x7a56('0xc5')]:_0x7a56('0xbf')},'messages':_(_0x43de21['Messages'])['tail']()[_0x7a56('0xa1')]({'secret':![]})[_0x7a56('0x32')](function(_0x20e369){if(_0x20e369[_0x7a56('0x6b')]){var _0x1ae8b1=path[_0x7a56('0x6f')](_0x221974,_0x20e369[_0x7a56('0x6b')][_0x7a56('0x72')]);if(fs[_0x7a56('0xc6')](_0x1ae8b1)){fs[_0x7a56('0xc7')](_0x1ae8b1)[_0x7a56('0xc8')](fs[_0x7a56('0xc9')](path[_0x7a56('0x6f')](_0x273a64,_0x20e369['Attachment'][_0x7a56('0x72')])));}}return{'date':moment(_0x20e369[_0x7a56('0x84')])[_0x7a56('0x76')](_0x7a56('0xa4'))['toString'](),'sender':_0x20e369[_0x7a56('0x86')]===_0x7a56('0x5d')?_0x20e369[_0x7a56('0x79')]?_0x20e369[_0x7a56('0x79')]['fullname']:_0x7a56('0x7c'):_0x20e369[_0x7a56('0xb6')][_0x7a56('0xca')]+(_0x20e369[_0x7a56('0xb6')]['lastName']?'\x20'+_0x20e369[_0x7a56('0xb6')]['lastName']:''),'body':_0x20e369[_0x7a56('0x6b')]?_0x20e369['Attachment'][_0x7a56('0x72')]:_0x20e369['body'],'direction':_0x20e369['direction']===_0x7a56('0x5d')?'A':'C','secret':_0x20e369[_0x7a56('0x87')],'read':_0x20e369[_0x7a56('0xb9')],'attachment':_0x20e369[_0x7a56('0x6b')]};})[_0x7a56('0xcb')]()};return ejs[_0x7a56('0xcc')](path['join'](config['root'],_0x7a56('0xb4'),_0x7a56('0xcd'),_0x7a56('0xce')),{'interaction':_0xa1cc28})['then'](function(_0x3f659a){var _0x11eccb=path[_0x7a56('0x6f')](_0x273a64,_0x7a56('0xcf')+_0x43de21['id']+'-'+_0x1921d8+_0x7a56('0xd0'));var _0x2dc08c={'path':_0x11eccb,'channel':'Chat','interactionId':_0x43de21['id']};return pdf[_0x7a56('0xd1')](_0x3f659a,_0x2dc08c);})['then'](function(){return new Promise(function(_0x4908b7,_0x1e537e){zipdir(_0x273a64,{'saveTo':_0x43b1ea},function(_0x41d606,_0x757ec){if(_0x41d606)return _0x1e537e(_0x41d606);return _0x4908b7(_0x757ec);});})[_0x7a56('0x16')](function(){return new BPromise(function(_0x484345,_0x26f445){rimraf(_0x273a64,function(_0x4fccfe){if(_0x4fccfe)_0x26f445(_0x4fccfe);return _0x484345();});});})[_0x7a56('0x16')](function(){return _0x2636f9[_0x7a56('0xb0')](_0x43b1ea,_0x8de210,function(_0x3d04a9){if(_0x3d04a9){logger['error'](_0x7a56('0xd2'),_0x3d04a9);}else{fs[_0x7a56('0xd3')](_0x43b1ea);}});});});}else{return _0x2636f9[_0x7a56('0x62')](0xc8);}})[_0x7a56('0x39')](handleError(_0x2636f9,null));};
\ No newline at end of file
+var _0xf499=['bluebird','util','path','lodash','ioredis','../../components/interaction/service','../../components/parsers/qs','../../components/export/pdf','../../config/logger','../../config/environment','../../mysqldb','redis','defaults','localhost','client','http','request','info','ChatInteraction,\x20%s,\x20%s','request\x20sent','debug','ChatInteraction,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','sendStatus','status','end','json','offset','undefined','limit','count','set','then','destroy','stack','name','send','render','merge','body','contact','agent','interaction','account','index','map','ChatInteraction','rawAttributes','fieldName','type','key','getOptions','findAll','chat','query','user','catch','keys','intersection','model','attributes','fields','length','includeAll','include','options','find','create','update','describe','createVidaooSession','params','ChatWebsite','findOne','ChatWebsiteId','vidaooEscalation','vidaooTopic','vidaooNote','email','POST','https://api-vidaoo.xcally.com/api/v1/meetings','vidaooApiKey','follow','vidaooMetadata','parse','metadata','Sequelize','ValidationError','Error\x20in\x20conversion\x20vidaooMetadata','out','ChatMessage','updateAttributes','customUpdate','CmContact','Contact','abandon','abandonInteraction,\x20%s,\x20%s,\x20%s','entity\x20not\x20found','UserId','Interaction\x20already\x20assigned','closed','AbandonInteraction','attachmentUpload','originalname','basename','filename','file','mimetype','attachmentDownload','Unauthorized','Attachment','attachId','ChatOfflineMessageId','root','server/files/attachments/','join','offline-chat/','download','close','mailTranscript','server/files/chat/upload/','format','transcript-%s.txt','pathTranscript','Messages','User','System','customer','%s%d','ContactId','agentIdentifier','website_alias','agentAlias','agent_alias','alias','agent_fullname','[%s]\x20%s:\x20%s\x0a','MM/DD/YYYY\x20HH:mm:ss','direction','appendFileSync','MailServerOut','Smtp','getSmtpOptions','SendMail','sendMail','\x22%s\x22\x20<%s>','Mail\x20Transcript','Hi\x20%s,\x20attached\x20you\x20can\x20find\x20your\x20transcript\x20file.\x20\x0a\x0aRegards.\x20\x0a\x0a','addMessage','ids','omit','filters','nolimit','order','sort','where','pick','ChatInteractionId','filter','$gte','getMyMessages','hasOwnProperty','secret','fullname','rows','setTags','spread','Tag','color','emit','chatInteractionTags:save','unix','toString','server','tmp','attachments','transcript-%d-%s.zip','push','lastName','createdAt','read','Owner','mkdirSync','Chat','Account','N.A.','YYYY-MM-DD\x20HH:mm:ss','disposition','osName','referer','customerIp','customerPort','tail','createReadStream','createWriteStream','firstName','views','downloadInteraction.ejs','transcript-','.pdf','unlinkSync','rimraf','request-promise'];(function(_0x46e363,_0x45d7e2){var _0x3fb059=function(_0x5e6274){while(--_0x5e6274){_0x46e363['push'](_0x46e363['shift']());}};_0x3fb059(++_0x45d7e2);}(_0xf499,0x19c));var _0x9f49=function(_0x34b292,_0x1057d1){_0x34b292=_0x34b292-0x0;var _0x39f677=_0xf499[_0x34b292];return _0x39f677;};'use strict';var rimraf=require(_0x9f49('0x0'));var zipdir=require('zip-dir');var rp=require(_0x9f49('0x1'));var moment=require('moment');var BPromise=require(_0x9f49('0x2'));var Mustache=require('mustache');var util=require(_0x9f49('0x3'));var path=require(_0x9f49('0x4'));var ejs=require('ejs');var fs=require('fs');var _=require(_0x9f49('0x5'));var Redis=require(_0x9f49('0x6'));var interaction=require(_0x9f49('0x7'));var qs=require(_0x9f49('0x8'));var pdf=require(_0x9f49('0x9'));var logger=require(_0x9f49('0xa'))('api');var config=require(_0x9f49('0xb'));var db=require(_0x9f49('0xc'))['db'];config[_0x9f49('0xd')]=_[_0x9f49('0xe')](config['redis'],{'host':_0x9f49('0xf'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x9f49('0xd')]));require('./chatInteraction.socket')['register'](socket);var jayson=require('jayson/promise');var client=jayson[_0x9f49('0x10')][_0x9f49('0x11')]({'port':0x232b});var client9004=jayson[_0x9f49('0x10')][_0x9f49('0x11')]({'port':0x232c});function respondWithRpcPromise(_0x22faec,_0x3dd283,_0x1d8dc8,_0x29d769){return new BPromise(function(_0x3a3315,_0x2900a0){var _0x51488f=_0x29d769||client;return _0x51488f[_0x9f49('0x12')](_0x22faec,_0x1d8dc8)['then'](function(_0x273453){logger[_0x9f49('0x13')](_0x9f49('0x14'),_0x3dd283,_0x9f49('0x15'));logger[_0x9f49('0x16')](_0x9f49('0x17'),_0x3dd283,_0x9f49('0x15'),JSON[_0x9f49('0x18')](_0x273453));if(_0x273453[_0x9f49('0x19')]){if(_0x273453[_0x9f49('0x19')][_0x9f49('0x1a')]===0x1f4){logger[_0x9f49('0x19')](_0x9f49('0x14'),_0x3dd283,_0x273453[_0x9f49('0x19')][_0x9f49('0x1b')]);return _0x2900a0(_0x273453[_0x9f49('0x19')][_0x9f49('0x1b')]);}logger[_0x9f49('0x19')]('ChatInteraction,\x20%s,\x20%s',_0x3dd283,_0x273453[_0x9f49('0x19')][_0x9f49('0x1b')]);return _0x3a3315(_0x273453[_0x9f49('0x19')]['message']);}else{logger[_0x9f49('0x13')](_0x9f49('0x14'),_0x3dd283,_0x9f49('0x15'));_0x3a3315(_0x273453[_0x9f49('0x1c')][_0x9f49('0x1b')]);}})['catch'](function(_0x3e375f){logger[_0x9f49('0x19')](_0x9f49('0x14'),_0x3dd283,_0x3e375f);_0x2900a0(_0x3e375f);});});}function respondWithStatusCode(_0x5f060d,_0x43ea73){_0x43ea73=_0x43ea73||0xcc;return function(_0x113edf){if(_0x113edf){return _0x5f060d[_0x9f49('0x1d')](_0x43ea73);}return _0x5f060d[_0x9f49('0x1e')](_0x43ea73)[_0x9f49('0x1f')]();};}function respondWithResult(_0x5861b6,_0x545c92){_0x545c92=_0x545c92||0xc8;return function(_0x589e43){if(_0x589e43){return _0x5861b6['status'](_0x545c92)[_0x9f49('0x20')](_0x589e43);}};}function respondWithFilteredResult(_0x423ae5,_0x315833){return function(_0x1068fd){if(_0x1068fd){var _0x535ef1=typeof _0x315833[_0x9f49('0x21')]===_0x9f49('0x22')&&typeof _0x315833[_0x9f49('0x23')]==='undefined';var _0x252a73=_0x1068fd[_0x9f49('0x24')];var _0x4cd305=_0x535ef1?0x0:_0x315833['offset'];var _0x3c9880=_0x535ef1?_0x1068fd[_0x9f49('0x24')]:_0x315833[_0x9f49('0x21')]+_0x315833[_0x9f49('0x23')];var _0x3c2a75;if(_0x3c9880>=_0x252a73){_0x3c9880=_0x252a73;_0x3c2a75=0xc8;}else{_0x3c2a75=0xce;}_0x423ae5[_0x9f49('0x1e')](_0x3c2a75);return _0x423ae5[_0x9f49('0x25')]('Content-Range',_0x4cd305+'-'+_0x3c9880+'/'+_0x252a73)['json'](_0x1068fd);}return null;};}function saveUpdates(_0x237c2f){return function(_0x232745){if(_0x232745){return _0x232745['update'](_0x237c2f)[_0x9f49('0x26')](function(_0x2dc186){return _0x2dc186;});}return null;};}function removeEntity(_0x2463f8){return function(_0x367ec0){if(_0x367ec0){return _0x367ec0[_0x9f49('0x27')]()['then'](function(){_0x2463f8[_0x9f49('0x1e')](0xcc)[_0x9f49('0x1f')]();});}};}function handleEntityNotFound(_0xd8641b){return function(_0x19b6ad){if(!_0x19b6ad){_0xd8641b['sendStatus'](0x194);}return _0x19b6ad;};}function handleError(_0x4630d9,_0x3f1783){_0x3f1783=_0x3f1783||0x1f4;return function(_0x247eed){logger[_0x9f49('0x19')](_0x247eed[_0x9f49('0x28')]);if(_0x247eed[_0x9f49('0x29')]){delete _0x247eed['name'];}_0x4630d9[_0x9f49('0x1e')](_0x3f1783)[_0x9f49('0x2a')](_0x247eed);};}function getMustacheRender(_0x2078e8,_0x336d15){return Mustache[_0x9f49('0x2b')](_0x2078e8,_[_0x9f49('0x2c')](_0x336d15[_0x9f49('0x2d')],{'contact':_0x336d15[_0x9f49('0x2e')],'message':_0x336d15[_0x9f49('0x1b')],'agent':_0x336d15[_0x9f49('0x2f')],'interaction':_0x336d15[_0x9f49('0x30')],'account':_0x336d15[_0x9f49('0x31')]}))||'';}exports[_0x9f49('0x32')]=function(_0x5767ee,_0x4910e9){var _0x4861e7={};var _0x5389cd=_[_0x9f49('0x33')](db[_0x9f49('0x34')][_0x9f49('0x35')],function(_0x4c7c71){return{'name':_0x4c7c71[_0x9f49('0x36')],'type':_0x4c7c71[_0x9f49('0x37')][_0x9f49('0x38')]};});_0x4861e7=qs[_0x9f49('0x39')](_0x5389cd,_0x5767ee);return interaction[_0x9f49('0x3a')](_0x9f49('0x3b'),_0x5767ee[_0x9f49('0x3c')],_0x5767ee[_0x9f49('0x3d')],_0x4861e7,_0x5389cd)['then'](respondWithFilteredResult(_0x4910e9,_0x4861e7))[_0x9f49('0x3e')](handleError(_0x4910e9,null));};exports['show']=function(_0x37ff08,_0x462815){var _0x78ea79={'raw':![],'where':{'id':_0x37ff08['params']['id']}},_0xc164c4={};_0xc164c4['model']=_[_0x9f49('0x3f')](db[_0x9f49('0x34')][_0x9f49('0x35')]);_0xc164c4[_0x9f49('0x3c')]=_[_0x9f49('0x3f')](_0x37ff08[_0x9f49('0x3c')]);_0xc164c4['filters']=_[_0x9f49('0x40')](_0xc164c4[_0x9f49('0x41')],_0xc164c4[_0x9f49('0x3c')]);_0x78ea79[_0x9f49('0x42')]=_[_0x9f49('0x40')](_0xc164c4[_0x9f49('0x41')],qs['fields'](_0x37ff08['query'][_0x9f49('0x43')]));_0x78ea79[_0x9f49('0x42')]=_0x78ea79[_0x9f49('0x42')][_0x9f49('0x44')]?_0x78ea79[_0x9f49('0x42')]:_0xc164c4[_0x9f49('0x41')];if(_0x37ff08[_0x9f49('0x3c')][_0x9f49('0x45')]){_0x78ea79[_0x9f49('0x46')]=[{'all':!![]}];}_0x78ea79=_[_0x9f49('0x2c')]({},_0x78ea79,_0x37ff08[_0x9f49('0x47')]);return db[_0x9f49('0x34')][_0x9f49('0x48')](_0x78ea79)[_0x9f49('0x26')](handleEntityNotFound(_0x462815,null))[_0x9f49('0x26')](respondWithResult(_0x462815,null))[_0x9f49('0x3e')](handleError(_0x462815,null));};exports['create']=function(_0x1ae8be,_0x39a61e){return db[_0x9f49('0x34')][_0x9f49('0x49')](_0x1ae8be[_0x9f49('0x2d')],{})[_0x9f49('0x26')](respondWithResult(_0x39a61e,0xc9))['catch'](handleError(_0x39a61e,null));};exports[_0x9f49('0x4a')]=function(_0x497004,_0x322279){if(_0x497004[_0x9f49('0x2d')]['id']){delete _0x497004[_0x9f49('0x2d')]['id'];}return db['ChatInteraction'][_0x9f49('0x48')]({'where':{'id':_0x497004['params']['id']}})['then'](handleEntityNotFound(_0x322279,null))[_0x9f49('0x26')](saveUpdates(_0x497004[_0x9f49('0x2d')],null))[_0x9f49('0x26')](respondWithResult(_0x322279,null))['catch'](handleError(_0x322279,null));};exports[_0x9f49('0x27')]=function(_0x10904e,_0x37bb84){return db[_0x9f49('0x34')][_0x9f49('0x48')]({'where':{'id':_0x10904e['params']['id']}})[_0x9f49('0x26')](handleEntityNotFound(_0x37bb84,null))[_0x9f49('0x26')](removeEntity(_0x37bb84,null))['catch'](handleError(_0x37bb84,null));};exports[_0x9f49('0x4b')]=function(_0x1148de,_0x200b61){return db[_0x9f49('0x34')][_0x9f49('0x4b')]()[_0x9f49('0x26')](respondWithResult(_0x200b61,null))[_0x9f49('0x3e')](handleError(_0x200b61,null));};exports[_0x9f49('0x4c')]=function(_0x49fbd7,_0x4c18cb){var _0x11c295=_0x49fbd7[_0x9f49('0x4d')]['id'];var _0x59ffbf;var _0x463f0e;var _0x3ec50c;return db[_0x9f49('0x34')]['findOne']({'where':{'id':_0x11c295}})['then'](function(_0xf14786){_0x59ffbf=_0xf14786;return db[_0x9f49('0x4e')][_0x9f49('0x4f')]({'where':{'id':_0xf14786[_0x9f49('0x50')]},'attributes':['id','vidaooApiKey',_0x9f49('0x51'),_0x9f49('0x52'),_0x9f49('0x53'),'vidaooMetadata'],'raw':!![]});})['then'](function(_0x5a4e38){if(_0x5a4e38&&_0x5a4e38['vidaooApiKey']&&_0x5a4e38[_0x9f49('0x51')]){_0x463f0e=_0x5a4e38;var _0x34a4a5={'interaction':{'id':_0x11c295},'agent':{'id':_0x49fbd7['user']['id'],'name':_0x49fbd7[_0x9f49('0x3d')]['name'],'fullname':_0x49fbd7[_0x9f49('0x3d')]['fullname'],'email':_0x49fbd7[_0x9f49('0x3d')][_0x9f49('0x54')]},'contact':_0x49fbd7[_0x9f49('0x2d')]['contact'],'account':_0x49fbd7[_0x9f49('0x2d')][_0x9f49('0x31')]};var _0x2d043a={'rejectUnauthorized':![],'method':_0x9f49('0x55'),'url':_0x9f49('0x56'),'headers':{'X-APIKEY':_0x5a4e38[_0x9f49('0x57')]},'body':{'duration':null,'scheduledAt':null,'participants':[_0x49fbd7[_0x9f49('0x3d')][_0x9f49('0x54')]],'buttons':null,'topic':_0x463f0e[_0x9f49('0x52')],'note':_['isNull'](_0x463f0e[_0x9f49('0x53')])?null:getMustacheRender(_0x463f0e[_0x9f49('0x53')],_0x34a4a5),'metadata':null},'redirect':_0x9f49('0x58'),'json':!![]};try{if(!_['isNull'](_0x463f0e[_0x9f49('0x59')])){var _0x1c54c9=getMustacheRender(_0x463f0e['vidaooMetadata'],_0x34a4a5);var _0x4441ab=JSON[_0x9f49('0x5a')](_0x1c54c9);_0x2d043a[_0x9f49('0x2d')][_0x9f49('0x5b')]=_0x4441ab;}}catch(_0x3c3dad){throw new db[(_0x9f49('0x5c'))][(_0x9f49('0x5d'))](_0x9f49('0x5e'));}return rp(_0x2d043a);}else{throw new db[(_0x9f49('0x5c'))][(_0x9f49('0x5d'))]('Error\x20in\x20Vidaoo\x20configuration');}})[_0x9f49('0x26')](function(_0x18e783){_0x3ec50c=_0x18e783;if(_0x3ec50c['id']){var _0x47b0bf={'body':_0x3ec50c['join_url'],'ChatWebsiteId':_0x463f0e['id'],'ChatInteractionId':_0x59ffbf['id'],'direction':_0x9f49('0x5f'),'UserId':_0x49fbd7['user']['id']};return db[_0x9f49('0x60')][_0x9f49('0x49')](_0x47b0bf,{});}else{throw new db['Sequelize'][(_0x9f49('0x5d'))]('Unable\x20to\x20create\x20Vidaoo\x20session');}})[_0x9f49('0x26')](function(){return _0x59ffbf[_0x9f49('0x61')]({'vidaooSessionId':_0x3ec50c['id']});})[_0x9f49('0x26')](respondWithResult(_0x4c18cb,null))[_0x9f49('0x3e')](handleError(_0x4c18cb,null));};exports[_0x9f49('0x62')]=function(_0x3c55fa,_0x57e7f9){if(_0x3c55fa[_0x9f49('0x2d')]['id']){delete _0x3c55fa[_0x9f49('0x2d')]['id'];}return db[_0x9f49('0x34')]['find']({'where':{'id':_0x3c55fa[_0x9f49('0x4d')]['id']},'include':[{'model':db[_0x9f49('0x63')],'as':_0x9f49('0x64')}]})[_0x9f49('0x26')](handleEntityNotFound(_0x57e7f9,null))[_0x9f49('0x26')](saveUpdates(_0x3c55fa[_0x9f49('0x2d')],null))['then'](respondWithResult(_0x57e7f9,null))[_0x9f49('0x3e')](handleError(_0x57e7f9,null));};exports[_0x9f49('0x65')]=function(_0x9ac3e,_0x5a0c8b){if(_0x9ac3e[_0x9f49('0x2d')]['id']){delete _0x9ac3e['body']['id'];}return db[_0x9f49('0x34')]['find']({'where':{'id':_0x9ac3e[_0x9f49('0x4d')]['id']}})[_0x9f49('0x26')](function(_0x2b801f){if(!_0x2b801f){logger[_0x9f49('0x19')](_0x9f49('0x66'),_0x9f49('0x65'),0x194,_0x9f49('0x67'));_0x5a0c8b[_0x9f49('0x1d')](0x194);}else{if(_0x2b801f[_0x9f49('0x68')]){throw new db['Sequelize'][(_0x9f49('0x5d'))](_0x9f49('0x69'));}}return _0x2b801f;})['then'](function(_0x432b86){if(_0x432b86){return _0x432b86[_0x9f49('0x4a')]({'closed':_0x9ac3e['body'][_0x9f49('0x6a')],'disposition':_0x9ac3e[_0x9f49('0x2d')]['disposition']})[_0x9f49('0x26')](function(_0x343f1f){return _0x343f1f;});}})[_0x9f49('0x26')](function(){return respondWithRpcPromise(_0x9f49('0x6b'),_0x9f49('0x65'),_0x9ac3e['body'],client9004);})[_0x9f49('0x26')](respondWithResult(_0x5a0c8b,null))['catch'](handleError(_0x5a0c8b,null));};exports[_0x9f49('0x6c')]=function(_0x5d0091,_0x1ef838){_0x5d0091[_0x9f49('0x2d')][_0x9f49('0x29')]=_0x5d0091['file'][_0x9f49('0x6d')];_0x5d0091[_0x9f49('0x2d')][_0x9f49('0x6e')]=_0x5d0091['file'][_0x9f49('0x6f')];_0x5d0091[_0x9f49('0x2d')][_0x9f49('0x37')]=_0x5d0091[_0x9f49('0x70')][_0x9f49('0x71')];return db['Attachment'][_0x9f49('0x49')](_0x5d0091['body'])[_0x9f49('0x26')](respondWithResult(_0x1ef838,0xc9))[_0x9f49('0x3e')](handleError(_0x1ef838,null));};exports[_0x9f49('0x72')]=function(_0x327b70,_0x197faa){return db[_0x9f49('0x34')][_0x9f49('0x4f')]({'where':{'id':_0x327b70[_0x9f49('0x4d')]['id']},'raw':!![]})[_0x9f49('0x26')](handleEntityNotFound(_0x197faa,null))[_0x9f49('0x26')](function(_0x5d40f1){if(_0x5d40f1){if(_0x5d40f1[_0x9f49('0x6a')]){return _0x197faa[_0x9f49('0x1e')](0x193)[_0x9f49('0x20')]({'status':0x193,'message':_0x9f49('0x73')});}return db[_0x9f49('0x74')][_0x9f49('0x4f')]({'where':{'id':_0x327b70['query'][_0x9f49('0x75')]},'raw':!![]})[_0x9f49('0x26')](handleEntityNotFound(_0x197faa,null));}})[_0x9f49('0x26')](function(_0x1b30d9){if(_0x1b30d9){var _0x345b6d=_0x1b30d9[_0x9f49('0x76')]!==null;var _0x1eb54a=path['join'](config[_0x9f49('0x77')],_0x9f49('0x78'));if(_0x345b6d){_0x1eb54a=path[_0x9f49('0x79')](_0x1eb54a,_0x9f49('0x7a'));}var _0x39fe70=path[_0x9f49('0x79')](_0x1eb54a,_0x1b30d9[_0x9f49('0x6e')]);return _0x197faa[_0x9f49('0x7b')](_0x39fe70);}})[_0x9f49('0x3e')](handleError(_0x197faa,null));};exports[_0x9f49('0x7c')]=function(_0x26d17f,_0xbed905){var _0x466084=null;var _0x130fea=null;var _0x3a1003=null;if(_0x26d17f[_0x9f49('0x2d')]['id']){delete _0x26d17f[_0x9f49('0x2d')]['id'];}if(_0x26d17f[_0x9f49('0x2d')][_0x9f49('0x7d')]){_0x3a1003=path[_0x9f49('0x79')](config[_0x9f49('0x77')],_0x9f49('0x7e'),util[_0x9f49('0x7f')](_0x9f49('0x80'),Date['now']()));_0x26d17f[_0x9f49('0x2d')][_0x9f49('0x81')]=_0x3a1003;}return db[_0x9f49('0x34')][_0x9f49('0x48')]({'where':{'id':_0x26d17f['params']['id']},'include':[{'model':db[_0x9f49('0x60')],'as':_0x9f49('0x82'),'include':[{'model':db[_0x9f49('0x83')],'as':_0x9f49('0x83')}]}]})[_0x9f49('0x26')](handleEntityNotFound(_0xbed905,null))[_0x9f49('0x26')](saveUpdates(_0x26d17f[_0x9f49('0x2d')],null))['then'](function(_0x3b16d4){if(_0x3b16d4){_0x466084=_0x3b16d4;return db[_0x9f49('0x4e')][_0x9f49('0x48')]({'where':{'id':_0x466084[_0x9f49('0x50')]}});}})[_0x9f49('0x26')](function(_0x11061e){if(_0x11061e){_0x130fea=_0x11061e;return db[_0x9f49('0x63')][_0x9f49('0x48')]({'where':{'id':_0x466084['ContactId']}});}})[_0x9f49('0x26')](function(_0x4eb550){if(_0x4eb550){if(_0x3a1003){var _0x445fa7=null;for(var _0x22ee11=0x1;_0x22ee11<_0x466084['Messages'][_0x9f49('0x44')];++_0x22ee11){_0x445fa7=_0x466084[_0x9f49('0x82')][_0x22ee11];var _0x55f334=_0x445fa7[_0x9f49('0x68')]?util[_0x9f49('0x7f')]('%s%d',_0x130fea['agentAlias'],_0x445fa7[_0x9f49('0x68')]):_0x9f49('0x84');var _0xeaa7bd=_0x26d17f[_0x9f49('0x2d')][_0x9f49('0x85')]||util[_0x9f49('0x7f')](_0x9f49('0x86'),'Visitor',_0x445fa7[_0x9f49('0x87')]);switch(_0x130fea[_0x9f49('0x88')]){case _0x9f49('0x89'):_0x55f334=_0x445fa7[_0x9f49('0x68')]?util['format']('%s%d',_0x130fea[_0x9f49('0x8a')],_0x445fa7[_0x9f49('0x68')]):_0x9f49('0x84');break;case _0x9f49('0x8b'):_0x55f334=_0x445fa7[_0x9f49('0x68')]?_0x445fa7['User'][_0x9f49('0x8c')]||_0x445fa7[_0x9f49('0x83')]['fullname']:_0x9f49('0x84');break;case _0x9f49('0x8d'):_0x55f334=_0x445fa7[_0x9f49('0x68')]?_0x445fa7[_0x9f49('0x83')]['fullname']:_0x9f49('0x84');break;default:_0x55f334=_0x445fa7[_0x9f49('0x68')]?util[_0x9f49('0x7f')](_0x9f49('0x86'),_0x130fea[_0x9f49('0x8a')],_0x445fa7[_0x9f49('0x68')]):'System';}var _0x159875=util[_0x9f49('0x7f')](_0x9f49('0x8e'),moment(_0x445fa7['createdAt'])['format'](_0x9f49('0x8f')),_0x445fa7[_0x9f49('0x90')]==='in'?_0xeaa7bd:_0x55f334,_0x445fa7[_0x9f49('0x2d')]);if(!_0x445fa7['secret']){fs[_0x9f49('0x91')](_0x3a1003,_0x159875);}}return db['MailAccount'][_0x9f49('0x4f')]({'where':{'service':!![]},'include':[{'model':db[_0x9f49('0x92')],'as':_0x9f49('0x93'),'raw':!![],'include':[{'model':db['CloudProvider'],'as':'CloudProvider','raw':!![]}]}]});}}})[_0x9f49('0x26')](function(_0x334209){if(!_0x334209||!_0x334209['Smtp']||!_0x26d17f[_0x9f49('0x2d')])return _0x466084;var _0x4cecfe=_0x334209[_0x9f49('0x94')]();return respondWithRpcPromise(_0x9f49('0x95'),_0x9f49('0x96'),{'account':_0x4cecfe,'message':{'from':util[_0x9f49('0x7f')](_0x9f49('0x97'),_0x334209[_0x9f49('0x29')],_0x334209['email']||_0x334209[_0x9f49('0x93')]['user']),'to':_0x26d17f['body'][_0x9f49('0x7d')],'subject':_0x9f49('0x98'),'text':util[_0x9f49('0x7f')](_0x9f49('0x99'),_0x26d17f['body']['mailTranscript']),'attachments':[{'path':_0x3a1003}]}})[_0x9f49('0x26')](function(){return _0x466084;})[_0x9f49('0x3e')](function(_0x5445c0){logger[_0x9f49('0x19')](_0x5445c0);});})[_0x9f49('0x26')](respondWithStatusCode(_0xbed905,0xc8))[_0x9f49('0x3e')](handleError(_0xbed905,null));};exports['addMessage']=function(_0x247b4b,_0x8c6a87){return db['ChatMessage'][_0x9f49('0x48')]({'where':{'id':_0x247b4b[_0x9f49('0x4d')]['id']}})[_0x9f49('0x26')](handleEntityNotFound(_0x8c6a87,null))[_0x9f49('0x26')](function(_0x274035){if(_0x274035){return _0x274035[_0x9f49('0x9a')](_0x247b4b[_0x9f49('0x2d')][_0x9f49('0x9b')],_[_0x9f49('0x9c')](_0x247b4b[_0x9f49('0x2d')],[_0x9f49('0x9b'),'id'])||{});}})['then'](respondWithResult(_0x8c6a87,null))['catch'](handleError(_0x8c6a87,null));};exports['getMessages']=function(_0x14f3a5,_0x564604){var _0xcfea5e={'raw':![],'where':{}};var _0x36b073={};var _0x418aba={'count':0x0,'rows':[]};return db[_0x9f49('0x34')][_0x9f49('0x4f')]({'where':{'id':_0x14f3a5[_0x9f49('0x4d')]['id']}})[_0x9f49('0x26')](handleEntityNotFound(_0x564604,null))[_0x9f49('0x26')](function(_0x13faf5){if(_0x13faf5){_0x36b073[_0x9f49('0x41')]=_[_0x9f49('0x3f')](db[_0x9f49('0x60')]['rawAttributes']);_0x36b073['query']=_[_0x9f49('0x3f')](_0x14f3a5['query']);_0x36b073[_0x9f49('0x9d')]=_[_0x9f49('0x40')](_0x36b073[_0x9f49('0x41')],_0x36b073[_0x9f49('0x3c')]);_0xcfea5e['attributes']=_[_0x9f49('0x40')](_0x36b073[_0x9f49('0x41')],qs['fields'](_0x14f3a5['query'][_0x9f49('0x43')]));_0xcfea5e['attributes']=_0xcfea5e[_0x9f49('0x42')][_0x9f49('0x44')]?_0xcfea5e['attributes']:_0x36b073[_0x9f49('0x41')];if(!_0x14f3a5['query']['hasOwnProperty'](_0x9f49('0x9e'))){_0xcfea5e[_0x9f49('0x23')]=qs[_0x9f49('0x23')](_0x14f3a5[_0x9f49('0x3c')][_0x9f49('0x23')]);_0xcfea5e['offset']=qs[_0x9f49('0x21')](_0x14f3a5[_0x9f49('0x3c')][_0x9f49('0x21')]);}_0xcfea5e[_0x9f49('0x9f')]=qs[_0x9f49('0xa0')](_0x14f3a5[_0x9f49('0x3c')][_0x9f49('0xa0')]);_0xcfea5e[_0x9f49('0xa1')]=qs[_0x9f49('0x9d')](_[_0x9f49('0xa2')](_0x14f3a5[_0x9f49('0x3c')],_0x36b073[_0x9f49('0x9d')]));_0xcfea5e['where'][_0x9f49('0xa3')]=_0x13faf5['id'];if(_0x14f3a5[_0x9f49('0x3c')][_0x9f49('0xa4')]){_0xcfea5e['where']=_[_0x9f49('0x2c')](_0xcfea5e['where'],{'$or':_[_0x9f49('0x33')](_0xcfea5e[_0x9f49('0x42')],function(_0x47b463){var _0x10a859={};_0x10a859[_0x47b463]={'$like':'%'+_0x14f3a5[_0x9f49('0x3c')][_0x9f49('0xa4')]+'%'};return _0x10a859;})});}if(_0x14f3a5[_0x9f49('0x3c')][_0x9f49('0xa5')]){var _0x2218a1=_0x14f3a5['query'][_0x9f49('0xa5')]['split'](',');var _0x1c257b={};_0x1c257b[_0x2218a1[0x0]]={'$gte':moment(_0x2218a1[0x1])[_0x9f49('0x7f')]('YYYY-MM-DD\x20HH:mm:ss')};_0xcfea5e[_0x9f49('0xa1')]=_[_0x9f49('0x2c')](_0xcfea5e[_0x9f49('0xa1')],_0x1c257b);}_0xcfea5e=_[_0x9f49('0x2c')]({},_0xcfea5e,_0x14f3a5[_0x9f49('0x47')]);return db['ChatMessage']['count']({'where':_0xcfea5e[_0x9f49('0xa1')]})[_0x9f49('0x26')](function(_0x2bc1df){_0x418aba['count']=_0x2bc1df;if(_0x14f3a5[_0x9f49('0x3c')]['includeAll']){_0xcfea5e[_0x9f49('0x46')]=[{'all':!![]}];}return db[_0x9f49('0x60')]['findAll'](_0xcfea5e);})[_0x9f49('0x26')](function(_0x53f6f2){_0x418aba['rows']=_0x53f6f2;return _0x418aba;});}})[_0x9f49('0x26')](respondWithFilteredResult(_0x564604,_0xcfea5e))['catch'](handleError(_0x564604,null));};exports[_0x9f49('0xa6')]=function(_0x271fe2,_0x562cb7){var _0x4a59db={'where':{}},_0x2050aa={},_0x3545ac={'count':0x0,'rows':[]};return db[_0x9f49('0x34')][_0x9f49('0x4f')]({'where':{'id':_0x271fe2[_0x9f49('0x4d')]['id']}})[_0x9f49('0x26')](handleEntityNotFound(_0x562cb7,null))[_0x9f49('0x26')](function(_0x413072){if(_0x413072){_0x2050aa['model']=_[_0x9f49('0x3f')](db[_0x9f49('0x60')][_0x9f49('0x35')]);_0x2050aa[_0x9f49('0x3c')]=_['keys'](_0x271fe2[_0x9f49('0x3c')]);_0x2050aa[_0x9f49('0x9d')]=_['intersection'](_0x2050aa['model'],_0x2050aa[_0x9f49('0x3c')]);_0x4a59db[_0x9f49('0x42')]=_['intersection'](_0x2050aa[_0x9f49('0x41')],qs[_0x9f49('0x43')](_0x271fe2[_0x9f49('0x3c')][_0x9f49('0x43')]));_0x4a59db[_0x9f49('0x42')]=_0x4a59db[_0x9f49('0x42')][_0x9f49('0x44')]?_0x4a59db['attributes']:_0x2050aa['model'];if(!_0x271fe2[_0x9f49('0x3c')][_0x9f49('0xa7')](_0x9f49('0x9e'))){_0x4a59db[_0x9f49('0x23')]=qs[_0x9f49('0x23')](_0x271fe2['query']['limit']);_0x4a59db[_0x9f49('0x21')]=qs['offset'](_0x271fe2['query']['offset']);}_0x4a59db['order']=qs['sort'](_0x271fe2['query'][_0x9f49('0xa0')]);_0x4a59db[_0x9f49('0xa1')]=qs['filters'](_[_0x9f49('0xa2')](_0x271fe2['query'],_0x2050aa['filters']));_0x4a59db[_0x9f49('0xa1')][_0x9f49('0xa3')]=_0x413072['id'];if(_0x271fe2['query']['filter']){_0x4a59db[_0x9f49('0xa1')]=_[_0x9f49('0x2c')](_0x4a59db[_0x9f49('0xa1')],{'$or':_[_0x9f49('0x33')](_0x4a59db[_0x9f49('0x42')],function(_0x1fc4b3){var _0x28fee4={};_0x28fee4[_0x1fc4b3]={'$like':'%'+_0x271fe2[_0x9f49('0x3c')]['filter']+'%'};return _0x28fee4;})});}_0x4a59db[_0x9f49('0xa1')][_0x9f49('0xa8')]=![];if(_0x271fe2[_0x9f49('0x3c')]['id']){_0x4a59db[_0x9f49('0xa1')]['id']={'$gt':_0x271fe2[_0x9f49('0x3c')]['id']};}_0x4a59db=_[_0x9f49('0x2c')]({},_0x4a59db,_0x271fe2['options']);return db[_0x9f49('0x60')][_0x9f49('0x24')]({'where':_0x4a59db[_0x9f49('0xa1')]})[_0x9f49('0x26')](function(_0x4171a5){_0x3545ac[_0x9f49('0x24')]=_0x4171a5;_0x4a59db[_0x9f49('0x46')]=[];if(_0x271fe2[_0x9f49('0x3c')]['includeAgent']){_0x4a59db[_0x9f49('0x46')]['push']({'model':db[_0x9f49('0x83')],'as':_0x9f49('0x83'),'attributes':['id',_0x9f49('0xa9'),_0x9f49('0x8c')]});}if(_0x271fe2[_0x9f49('0x3c')][_0x9f49('0x45')]){_0x4a59db[_0x9f49('0x46')]=[{'all':!![]}];}return db[_0x9f49('0x60')][_0x9f49('0x3a')](_0x4a59db);})[_0x9f49('0x26')](function(_0x5221f3){_0x3545ac[_0x9f49('0xaa')]=_0x5221f3;return _0x3545ac;});}})[_0x9f49('0x26')](respondWithFilteredResult(_0x562cb7,_0x4a59db))[_0x9f49('0x3e')](handleError(_0x562cb7,null));};exports['addTags']=function(_0x49c2f8,_0xa5fe62){return db[_0x9f49('0x34')][_0x9f49('0x48')]({'where':{'id':_0x49c2f8['params']['id']}})[_0x9f49('0x26')](handleEntityNotFound(_0xa5fe62,null))[_0x9f49('0x26')](function(_0x4780a0){if(_0x4780a0){return _0x4780a0[_0x9f49('0xab')](_0x49c2f8[_0x9f49('0x2d')][_0x9f49('0x9b')],_[_0x9f49('0x9c')](_0x49c2f8[_0x9f49('0x2d')],[_0x9f49('0x9b'),'id'])||{})[_0x9f49('0xac')](function(){return db[_0x9f49('0xad')][_0x9f49('0x3a')]({'attributes':['id',_0x9f49('0x29'),_0x9f49('0xae')],'where':{'id':_0x49c2f8[_0x9f49('0x2d')][_0x9f49('0x9b')]}});})[_0x9f49('0x26')](function(_0x451f7a){socket[_0x9f49('0xaf')](_0x9f49('0xb0'),{'id':Number(_0x49c2f8[_0x9f49('0x4d')]['id']),'tags':_0x451f7a||[]});return{'id':Number(_0x49c2f8['params']['id']),'tags':_0x451f7a||[]};});}})[_0x9f49('0x26')](respondWithResult(_0xa5fe62,null))['catch'](handleError(_0xa5fe62,null));};exports['removeTags']=function(_0x40d377,_0x516804){return db[_0x9f49('0x34')][_0x9f49('0x48')]({'where':{'id':_0x40d377[_0x9f49('0x4d')]['id']}})['then'](handleEntityNotFound(_0x516804,null))['then'](function(_0x5d4bcf){if(_0x5d4bcf){return _0x5d4bcf['removeTags'](_0x40d377[_0x9f49('0x3c')]['ids']);}})[_0x9f49('0x26')](respondWithStatusCode(_0x516804,null))['catch'](handleError(_0x516804,null));};exports[_0x9f49('0x7b')]=function(_0x5e6261,_0x2874a3){var _0x22a0ac=moment()[_0x9f49('0xb1')]()[_0x9f49('0xb2')]();var _0x42383e=path[_0x9f49('0x79')](config[_0x9f49('0x77')],_0x9f49('0xb3'),'files',_0x9f49('0xb4'));var _0x3f17a9=path[_0x9f49('0x79')](config[_0x9f49('0x77')],'server','files',_0x9f49('0xb5'));var _0x220edf=path[_0x9f49('0x79')](_0x42383e,_0x22a0ac);var _0x986f3d=util[_0x9f49('0x7f')](_0x9f49('0xb6'),_0x5e6261[_0x9f49('0x4d')]['id'],_0x22a0ac);var _0x30e28b=path[_0x9f49('0x79')](_0x42383e,_0x986f3d);var _0x4e0fb4=[];_0x4e0fb4[_0x9f49('0xb7')]({'model':db['User'],'as':_0x9f49('0x83'),'attributes':['id',_0x9f49('0xa9')],'raw':!![]});_0x4e0fb4['push']({'model':db[_0x9f49('0x63')],'as':_0x9f49('0x64'),'attributes':['id','firstName',_0x9f49('0xb8')],'raw':!![]});if(_0x5e6261[_0x9f49('0x3c')]['attachments']){_0x4e0fb4[_0x9f49('0xb7')]({'model':db[_0x9f49('0x74')],'as':_0x9f49('0x74'),'raw':!![]});}var _0x5a787f=[{'model':db[_0x9f49('0x60')],'as':_0x9f49('0x82'),'attributes':['id',_0x9f49('0x2d'),_0x9f49('0xb9'),_0x9f49('0x90'),'secret',_0x9f49('0xba')],'include':_0x4e0fb4}];_0x5a787f[_0x9f49('0xb7')]({'model':db[_0x9f49('0x4e')],'as':'Account','attributes':['id',_0x9f49('0x29')]});_0x5a787f[_0x9f49('0xb7')]({'model':db[_0x9f49('0x83')],'as':_0x9f49('0xbb'),'attributes':['id',_0x9f49('0xa9')]});return db[_0x9f49('0x34')][_0x9f49('0x48')]({'where':{'id':_0x5e6261[_0x9f49('0x4d')]['id']},'include':_0x5a787f})['then'](handleEntityNotFound(_0x2874a3,null))['then'](function(_0x41779e){if(_0x41779e){var _0x2b03fa=_0x41779e['get']({'plain':!![]});fs[_0x9f49('0xbc')](_0x220edf);var _0x34c744={'channel':_0x9f49('0xbd'),'account':_0x2b03fa[_0x9f49('0xbe')][_0x9f49('0x29')],'agent':_0x2b03fa['Owner']?_0x2b03fa['Owner'][_0x9f49('0xa9')]:_0x9f49('0xbf'),'createdAt':moment(_0x2b03fa[_0x9f49('0xb9')])[_0x9f49('0x7f')]('YYYY-MM-DD\x20HH:mm:ss')[_0x9f49('0xb2')](),'closedAt':_0x2b03fa[_0x9f49('0x6a')]?moment(_0x2b03fa['closedAt'])['format'](_0x9f49('0xc0'))[_0x9f49('0xb2')]():'','disposition':_0x2b03fa[_0x9f49('0xc1')],'chatInfo':{'browser':_0x2b03fa['browserName'],'os':_0x2b03fa[_0x9f49('0xc2')],'referer':_0x2b03fa[_0x9f49('0xc3')],'customerIp':_0x2b03fa[_0x9f49('0xc4')],'customerPort':_0x2b03fa['customerPort']?_0x2b03fa[_0x9f49('0xc5')]:_0x9f49('0xbf')},'messages':_(_0x2b03fa['Messages'])[_0x9f49('0xc6')]()['filter']({'secret':![]})[_0x9f49('0x33')](function(_0x5f37c8){if(_0x5f37c8[_0x9f49('0x74')]){var _0x5bcb23=path[_0x9f49('0x79')](_0x3f17a9,_0x5f37c8[_0x9f49('0x74')][_0x9f49('0x6e')]);if(fs['existsSync'](_0x5bcb23)){fs[_0x9f49('0xc7')](_0x5bcb23)['pipe'](fs[_0x9f49('0xc8')](path[_0x9f49('0x79')](_0x220edf,_0x5f37c8[_0x9f49('0x74')]['basename'])));}}return{'date':moment(_0x5f37c8[_0x9f49('0xb9')])[_0x9f49('0x7f')](_0x9f49('0xc0'))[_0x9f49('0xb2')](),'sender':_0x5f37c8[_0x9f49('0x90')]==='out'?_0x5f37c8[_0x9f49('0x83')]?_0x5f37c8[_0x9f49('0x83')][_0x9f49('0xa9')]:_0x9f49('0x84'):_0x5f37c8[_0x9f49('0x64')][_0x9f49('0xc9')]+(_0x5f37c8[_0x9f49('0x64')]['lastName']?'\x20'+_0x5f37c8[_0x9f49('0x64')][_0x9f49('0xb8')]:''),'body':_0x5f37c8[_0x9f49('0x74')]?_0x5f37c8[_0x9f49('0x74')][_0x9f49('0x6e')]:_0x5f37c8[_0x9f49('0x2d')],'direction':_0x5f37c8[_0x9f49('0x90')]===_0x9f49('0x5f')?'A':'C','secret':_0x5f37c8[_0x9f49('0xa8')],'read':_0x5f37c8[_0x9f49('0xba')],'attachment':_0x5f37c8[_0x9f49('0x74')]};})['value']()};return ejs['renderFile'](path[_0x9f49('0x79')](config['root'],'server',_0x9f49('0xca'),_0x9f49('0xcb')),{'interaction':_0x34c744})[_0x9f49('0x26')](function(_0x22ac33){var _0x1fdd54=path[_0x9f49('0x79')](_0x220edf,_0x9f49('0xcc')+_0x2b03fa['id']+'-'+_0x22a0ac+_0x9f49('0xcd'));var _0x268a64={'path':_0x1fdd54,'channel':_0x9f49('0xbd'),'interactionId':_0x2b03fa['id']};return pdf['createPdfFromHTML'](_0x22ac33,_0x268a64);})['then'](function(){return new Promise(function(_0x7aeb26,_0x2b2d7c){zipdir(_0x220edf,{'saveTo':_0x30e28b},function(_0x297bb2,_0x4a9b1f){if(_0x297bb2)return _0x2b2d7c(_0x297bb2);return _0x7aeb26(_0x4a9b1f);});})[_0x9f49('0x26')](function(){return new BPromise(function(_0x108c19,_0x15f893){rimraf(_0x220edf,function(_0x101945){if(_0x101945)_0x15f893(_0x101945);return _0x108c19();});});})[_0x9f49('0x26')](function(){return _0x2874a3[_0x9f49('0x7b')](_0x30e28b,_0x986f3d,function(_0x19f2c5){if(_0x19f2c5){logger[_0x9f49('0x19')]('err',_0x19f2c5);}else{fs[_0x9f49('0xce')](_0x30e28b);}});});});}else{return _0x2874a3[_0x9f49('0x1d')](0xc8);}})['catch'](handleError(_0x2874a3,null));};
\ No newline at end of file
diff --git a/server/api/chatInteraction/chatInteraction.events.js b/server/api/chatInteraction/chatInteraction.events.js
index a7a272b..856877b 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 _0x7872=['save','update','getUsers','then','setDataValue','Users','map','findAll','unreadMessages','length','hasOwnProperty','hook','exports','events','../../mysqldb','ChatInteraction','ChatMessage'];(function(_0x5403f5,_0x5b5030){var _0xfd371c=function(_0x49fdaa){while(--_0x49fdaa){_0x5403f5['push'](_0x5403f5['shift']());}};_0xfd371c(++_0x5b5030);}(_0x7872,0x11d));var _0x2787=function(_0x20065b,_0x74d1ad){_0x20065b=_0x20065b-0x0;var _0x513277=_0x7872[_0x20065b];return _0x513277;};'use strict';var EventEmitter=require(_0x2787('0x0'));var ChatInteraction=require(_0x2787('0x1'))['db'][_0x2787('0x2')];var ChatMessage=require(_0x2787('0x1'))['db'][_0x2787('0x3')];var ChatInteractionEvents=new EventEmitter();ChatInteractionEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x2787('0x4'),'afterUpdate':_0x2787('0x5'),'afterDestroy':'remove'};function emitEvent(_0x2dc006){return function(_0x525c99,_0x535b51,_0x257eaf){_0x525c99[_0x2787('0x6')]({'attributes':['id'],'raw':!![]})[_0x2787('0x7')](function(_0x575e01){_0x525c99[_0x2787('0x8')](_0x2787('0x9'),_0x575e01[_0x2787('0xa')](function(_0x5bbbfb){return{'id':_0x5bbbfb['id']};}));return ChatMessage[_0x2787('0xb')]({'where':{'ChatInteractionId':_0x525c99['id'],'direction':'in','read':![]},'raw':!![]});})[_0x2787('0x7')](function(_0x31de16){_0x525c99[_0x2787('0x8')](_0x2787('0xc'),_0x31de16[_0x2787('0xd')]);ChatInteractionEvents['emit'](_0x2dc006+':'+_0x525c99['id'],_0x525c99);ChatInteractionEvents['emit'](_0x2dc006,_0x525c99);_0x257eaf(null);})['catch'](_0x257eaf(null));};}for(var e in events){if(events[_0x2787('0xe')](e)){var event=events[e];ChatInteraction[_0x2787('0xf')](e,emitEvent(event));}}module[_0x2787('0x10')]=ChatInteractionEvents;
\ No newline at end of file
+var _0x1574=['events','ChatInteraction','ChatMessage','setMaxListeners','save','update','getUsers','then','setDataValue','Users','findAll','length','emit','hasOwnProperty','hook','exports'];(function(_0x2c7226,_0x29e306){var _0x7853d8=function(_0x569660){while(--_0x569660){_0x2c7226['push'](_0x2c7226['shift']());}};_0x7853d8(++_0x29e306);}(_0x1574,0x70));var _0x4157=function(_0x34be0c,_0x5ca776){_0x34be0c=_0x34be0c-0x0;var _0x5b47c6=_0x1574[_0x34be0c];return _0x5b47c6;};'use strict';var EventEmitter=require(_0x4157('0x0'));var ChatInteraction=require('../../mysqldb')['db'][_0x4157('0x1')];var ChatMessage=require('../../mysqldb')['db'][_0x4157('0x2')];var ChatInteractionEvents=new EventEmitter();ChatInteractionEvents[_0x4157('0x3')](0x0);var events={'afterCreate':_0x4157('0x4'),'afterUpdate':_0x4157('0x5'),'afterDestroy':'remove'};function emitEvent(_0x41f331){return function(_0xdd4e2b,_0x5c7d11,_0x56f05d){_0xdd4e2b[_0x4157('0x6')]({'attributes':['id'],'raw':!![]})[_0x4157('0x7')](function(_0x16bf9d){_0xdd4e2b[_0x4157('0x8')](_0x4157('0x9'),_0x16bf9d['map'](function(_0x56a87e){return{'id':_0x56a87e['id']};}));return ChatMessage[_0x4157('0xa')]({'where':{'ChatInteractionId':_0xdd4e2b['id'],'direction':'in','read':![]},'raw':!![]});})['then'](function(_0x43ff3f){_0xdd4e2b[_0x4157('0x8')]('unreadMessages',_0x43ff3f[_0x4157('0xb')]);ChatInteractionEvents[_0x4157('0xc')](_0x41f331+':'+_0xdd4e2b['id'],_0xdd4e2b);ChatInteractionEvents[_0x4157('0xc')](_0x41f331,_0xdd4e2b);_0x56f05d(null);})['catch'](_0x56f05d(null));};}for(var e in events){if(events[_0x4157('0xd')](e)){var event=events[e];ChatInteraction[_0x4157('0xe')](e,emitEvent(event));}}module[_0x4157('0xf')]=ChatInteractionEvents;
\ No newline at end of file
diff --git a/server/api/chatInteraction/chatInteraction.model.js b/server/api/chatInteraction/chatInteraction.model.js
index 53d8a48..98a6d2f 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 _0x6fd5=['closed','closedAt','format','YYYY-MM-DD\x20HH:mm:ss','utf8mb4','lodash','util','../../config/logger','moment','bluebird','path','rimraf','../../config/environment','./chatInteraction.attributes','define','chat_interactions','changed'];(function(_0x1b4ef6,_0x5a5199){var _0x39539e=function(_0x3a0b95){while(--_0x3a0b95){_0x1b4ef6['push'](_0x1b4ef6['shift']());}};_0x39539e(++_0x5a5199);}(_0x6fd5,0x19d));var _0x56fd=function(_0x5ddb1c,_0x5ea4df){_0x5ddb1c=_0x5ddb1c-0x0;var _0x354adc=_0x6fd5[_0x5ddb1c];return _0x354adc;};'use strict';var _=require(_0x56fd('0x0'));var util=require(_0x56fd('0x1'));var logger=require(_0x56fd('0x2'))('api');var moment=require(_0x56fd('0x3'));var BPromise=require(_0x56fd('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x56fd('0x5'));var rimraf=require(_0x56fd('0x6'));var config=require(_0x56fd('0x7'));var attributes=require(_0x56fd('0x8'));module['exports']=function(_0x26a3aa,_0x1404e0){return _0x26a3aa[_0x56fd('0x9')]('ChatInteraction',attributes,{'tableName':_0x56fd('0xa'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x28a2f6,_0x397a9d,_0x28538e){if(_0x28a2f6[_0x56fd('0xb')](_0x56fd('0xc'))){_0x28a2f6[_0x56fd('0xd')]=moment()[_0x56fd('0xe')](_0x56fd('0xf'));}_0x28538e(null,_0x28a2f6);}},'charset':_0x56fd('0x10'),'collate':'utf8mb4_unicode_ci'});};
\ No newline at end of file
+var _0xf593=['request-promise','path','rimraf','../../config/environment','changed','format','utf8mb4','utf8mb4_unicode_ci','lodash','util','../../config/logger','api','moment'];(function(_0x1fa44b,_0x3f06d0){var _0x2f999f=function(_0x41c389){while(--_0x41c389){_0x1fa44b['push'](_0x1fa44b['shift']());}};_0x2f999f(++_0x3f06d0);}(_0xf593,0xb1));var _0x3f59=function(_0x50b867,_0x58a9b3){_0x50b867=_0x50b867-0x0;var _0x392636=_0xf593[_0x50b867];return _0x392636;};'use strict';var _=require(_0x3f59('0x0'));var util=require(_0x3f59('0x1'));var logger=require(_0x3f59('0x2'))(_0x3f59('0x3'));var moment=require(_0x3f59('0x4'));var BPromise=require('bluebird');var rp=require(_0x3f59('0x5'));var fs=require('fs');var path=require(_0x3f59('0x6'));var rimraf=require(_0x3f59('0x7'));var config=require(_0x3f59('0x8'));var attributes=require('./chatInteraction.attributes');module['exports']=function(_0x20c7d0,_0x2498dc){return _0x20c7d0['define']('ChatInteraction',attributes,{'tableName':'chat_interactions','paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x25ae03,_0xa67639,_0x25f11a){if(_0x25ae03[_0x3f59('0x9')]('closed')){_0x25ae03['closedAt']=moment()[_0x3f59('0xa')]('YYYY-MM-DD\x20HH:mm:ss');}_0x25f11a(null,_0x25ae03);}},'charset':_0x3f59('0xb'),'collate':_0x3f59('0xc')});};
\ No newline at end of file
diff --git a/server/api/chatInteraction/chatInteraction.rpc.js b/server/api/chatInteraction/chatInteraction.rpc.js
index 6cf6164..3d5a8cf 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 _0x5eaa=['ChatInteraction','find','where','addTags','ids','spread','AddTags','lodash','util','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/environment','http','redis','defaults','localhost','socket.io-emitter','./chatInteraction.socket','register','request','then','ChatInteraction,\x20%s,\x20%s','debug','ChatInteraction,\x20%s,\x20%s,\x20%s','stringify','error','message','request\x20sent','catch','UpdateChatInteraction','body','options','raw','attributes','limit','info','AddTagsToChatInteraction'];(function(_0x460423,_0x46c773){var _0x3c65f3=function(_0x11dbf7){while(--_0x11dbf7){_0x460423['push'](_0x460423['shift']());}};_0x3c65f3(++_0x46c773);}(_0x5eaa,0x13f));var _0xa5ea=function(_0x1f1de6,_0x257813){_0x1f1de6=_0x1f1de6-0x0;var _0x1a74cd=_0x5eaa[_0x1f1de6];return _0x1a74cd;};'use strict';var _=require(_0xa5ea('0x0'));var util=require(_0xa5ea('0x1'));var moment=require('moment');var BPromise=require(_0xa5ea('0x2'));var rs=require(_0xa5ea('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xa5ea('0x4'))['db'];var utils=require(_0xa5ea('0x5'));var logger=require('../../config/logger')('rpc');var config=require(_0xa5ea('0x6'));var jayson=require('jayson/promise');var client=jayson['client'][_0xa5ea('0x7')]({'port':0x232a});config[_0xa5ea('0x8')]=_[_0xa5ea('0x9')](config[_0xa5ea('0x8')],{'host':_0xa5ea('0xa'),'port':0x18eb});var socket=require(_0xa5ea('0xb'))(new Redis(config['redis']));require(_0xa5ea('0xc'))[_0xa5ea('0xd')](socket);function respondWithRpcPromise(_0x58d20d,_0x29972b,_0x332f0a){return new BPromise(function(_0x39a801,_0x3baf6d){return client[_0xa5ea('0xe')](_0x58d20d,_0x332f0a)[_0xa5ea('0xf')](function(_0x4629cd){logger['info'](_0xa5ea('0x10'),_0x29972b,'request\x20sent');logger[_0xa5ea('0x11')](_0xa5ea('0x12'),_0x29972b,'request\x20sent',JSON[_0xa5ea('0x13')](_0x4629cd));if(_0x4629cd[_0xa5ea('0x14')]){if(_0x4629cd['error']['code']===0x1f4){logger[_0xa5ea('0x14')](_0xa5ea('0x10'),_0x29972b,_0x4629cd['error'][_0xa5ea('0x15')]);return _0x3baf6d(_0x4629cd[_0xa5ea('0x14')]['message']);}logger[_0xa5ea('0x14')](_0xa5ea('0x10'),_0x29972b,_0x4629cd[_0xa5ea('0x14')][_0xa5ea('0x15')]);return _0x39a801(_0x4629cd[_0xa5ea('0x14')]['message']);}else{logger['info'](_0xa5ea('0x10'),_0x29972b,_0xa5ea('0x16'));_0x39a801(_0x4629cd['result'][_0xa5ea('0x15')]);}})[_0xa5ea('0x17')](function(_0x18b586){logger[_0xa5ea('0x14')](_0xa5ea('0x10'),_0x29972b,_0x18b586);_0x3baf6d(_0x18b586);});});}exports[_0xa5ea('0x18')]=function(_0x2f95d8){var _0x32cb84=this;return new Promise(function(_0x5e7e49,_0xde5196){return db['ChatInteraction']['update'](_0x2f95d8[_0xa5ea('0x19')],{'raw':_0x2f95d8[_0xa5ea('0x1a')]?_0x2f95d8[_0xa5ea('0x1a')][_0xa5ea('0x1b')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x2f95d8[_0xa5ea('0x1a')]?_0x2f95d8[_0xa5ea('0x1a')]['where']||null:null,'attributes':_0x2f95d8['options']?_0x2f95d8['options'][_0xa5ea('0x1c')]||null:null,'limit':_0x2f95d8['options']?_0x2f95d8['options'][_0xa5ea('0x1d')]||null:null})[_0xa5ea('0xf')](function(_0x2b51eb){logger[_0xa5ea('0x1e')](_0xa5ea('0x18'),_0x2f95d8);logger[_0xa5ea('0x11')](_0xa5ea('0x18'),_0x2f95d8,JSON[_0xa5ea('0x13')](_0x2b51eb));_0x5e7e49(_0x2b51eb);})[_0xa5ea('0x17')](function(_0x203971){logger[_0xa5ea('0x14')](_0xa5ea('0x18'),_0x203971[_0xa5ea('0x15')],_0x2f95d8);_0xde5196(_0x32cb84[_0xa5ea('0x14')](0x1f4,_0x203971[_0xa5ea('0x15')]));});});};exports[_0xa5ea('0x1f')]=function(_0xc18f90){return new Promise(function(_0x2c1155,_0x5d958b){return db[_0xa5ea('0x20')][_0xa5ea('0x21')]({'where':_0xc18f90[_0xa5ea('0x1a')]?_0xc18f90[_0xa5ea('0x1a')][_0xa5ea('0x22')]||null:null})[_0xa5ea('0xf')](function(_0x188b63){if(_0x188b63){return _0x188b63[_0xa5ea('0x23')](_0xc18f90[_0xa5ea('0x19')]['ids'],_['omit'](_0xc18f90['body'],[_0xa5ea('0x24'),'id'])||{});}})[_0xa5ea('0x25')](function(_0x47cc66){logger['info'](_0xa5ea('0x26'),_0xc18f90);logger[_0xa5ea('0x11')](_0xa5ea('0x26'),_0xc18f90,JSON['stringify'](_0x47cc66));_0x2c1155(_0x47cc66);})[_0xa5ea('0x17')](function(_0x1de26e){logger[_0xa5ea('0x14')](_0xa5ea('0x26'),_0x1de26e[_0xa5ea('0x15')],_0xc18f90);_0x5d958b(_this[_0xa5ea('0x14')](0x1f4,_0x1de26e[_0xa5ea('0x15')]));});});};
\ No newline at end of file
+var _0x924c=['lodash','util','moment','ioredis','../../mysqldb','../../config/logger','../../config/environment','client','http','redis','defaults','localhost','socket.io-emitter','./chatInteraction.socket','then','ChatInteraction,\x20%s,\x20%s','debug','ChatInteraction,\x20%s,\x20%s,\x20%s','stringify','error','message','info','request\x20sent','result','catch','ChatInteraction','update','body','options','raw','where','attributes','limit','UpdateChatInteraction','addTags','omit','ids','spread','AddTags'];(function(_0x5906ab,_0x1defc2){var _0x2dc711=function(_0x518a15){while(--_0x518a15){_0x5906ab['push'](_0x5906ab['shift']());}};_0x2dc711(++_0x1defc2);}(_0x924c,0x9c));var _0xc924=function(_0x533245,_0x1c1b71){_0x533245=_0x533245-0x0;var _0x27e99d=_0x924c[_0x533245];return _0x27e99d;};'use strict';var _=require(_0xc924('0x0'));var util=require(_0xc924('0x1'));var moment=require(_0xc924('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xc924('0x3'));var db=require(_0xc924('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0xc924('0x5'))('rpc');var config=require(_0xc924('0x6'));var jayson=require('jayson/promise');var client=jayson[_0xc924('0x7')][_0xc924('0x8')]({'port':0x232a});config[_0xc924('0x9')]=_[_0xc924('0xa')](config[_0xc924('0x9')],{'host':_0xc924('0xb'),'port':0x18eb});var socket=require(_0xc924('0xc'))(new Redis(config[_0xc924('0x9')]));require(_0xc924('0xd'))['register'](socket);function respondWithRpcPromise(_0x41427f,_0x5d7399,_0x145fb3){return new BPromise(function(_0x17097a,_0x16cc40){return client['request'](_0x41427f,_0x145fb3)[_0xc924('0xe')](function(_0x547021){logger['info'](_0xc924('0xf'),_0x5d7399,'request\x20sent');logger[_0xc924('0x10')](_0xc924('0x11'),_0x5d7399,'request\x20sent',JSON[_0xc924('0x12')](_0x547021));if(_0x547021[_0xc924('0x13')]){if(_0x547021[_0xc924('0x13')]['code']===0x1f4){logger[_0xc924('0x13')](_0xc924('0xf'),_0x5d7399,_0x547021[_0xc924('0x13')][_0xc924('0x14')]);return _0x16cc40(_0x547021[_0xc924('0x13')]['message']);}logger[_0xc924('0x13')](_0xc924('0xf'),_0x5d7399,_0x547021[_0xc924('0x13')][_0xc924('0x14')]);return _0x17097a(_0x547021[_0xc924('0x13')][_0xc924('0x14')]);}else{logger[_0xc924('0x15')](_0xc924('0xf'),_0x5d7399,_0xc924('0x16'));_0x17097a(_0x547021[_0xc924('0x17')][_0xc924('0x14')]);}})[_0xc924('0x18')](function(_0x47ddf1){logger['error'](_0xc924('0xf'),_0x5d7399,_0x47ddf1);_0x16cc40(_0x47ddf1);});});}exports['UpdateChatInteraction']=function(_0x478daf){var _0x335313=this;return new Promise(function(_0x5c5f31,_0x5586fa){return db[_0xc924('0x19')][_0xc924('0x1a')](_0x478daf[_0xc924('0x1b')],{'raw':_0x478daf[_0xc924('0x1c')]?_0x478daf[_0xc924('0x1c')][_0xc924('0x1d')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x478daf[_0xc924('0x1c')]?_0x478daf[_0xc924('0x1c')][_0xc924('0x1e')]||null:null,'attributes':_0x478daf[_0xc924('0x1c')]?_0x478daf[_0xc924('0x1c')][_0xc924('0x1f')]||null:null,'limit':_0x478daf['options']?_0x478daf[_0xc924('0x1c')][_0xc924('0x20')]||null:null})['then'](function(_0x5a5532){logger[_0xc924('0x15')]('UpdateChatInteraction',_0x478daf);logger['debug'](_0xc924('0x21'),_0x478daf,JSON[_0xc924('0x12')](_0x5a5532));_0x5c5f31(_0x5a5532);})[_0xc924('0x18')](function(_0x4ca29a){logger['error'](_0xc924('0x21'),_0x4ca29a['message'],_0x478daf);_0x5586fa(_0x335313[_0xc924('0x13')](0x1f4,_0x4ca29a[_0xc924('0x14')]));});});};exports['AddTagsToChatInteraction']=function(_0x39fa38){return new Promise(function(_0x2637ae,_0x9cbe44){return db[_0xc924('0x19')]['find']({'where':_0x39fa38['options']?_0x39fa38['options'][_0xc924('0x1e')]||null:null})[_0xc924('0xe')](function(_0xb655ff){if(_0xb655ff){return _0xb655ff[_0xc924('0x22')](_0x39fa38[_0xc924('0x1b')]['ids'],_[_0xc924('0x23')](_0x39fa38[_0xc924('0x1b')],[_0xc924('0x24'),'id'])||{});}})[_0xc924('0x25')](function(_0x12548f){logger[_0xc924('0x15')](_0xc924('0x26'),_0x39fa38);logger['debug'](_0xc924('0x26'),_0x39fa38,JSON[_0xc924('0x12')](_0x12548f));_0x2637ae(_0x12548f);})[_0xc924('0x18')](function(_0x1614fc){logger['error'](_0xc924('0x26'),_0x1614fc[_0xc924('0x14')],_0x39fa38);_0x9cbe44(_this[_0xc924('0x13')](0x1f4,_0x1614fc['message']));});});};
\ No newline at end of file
diff --git a/server/api/chatInteraction/chatInteraction.socket.js b/server/api/chatInteraction/chatInteraction.socket.js
index f0d67d7..c2c0d26 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 _0x0b35=['chatInteraction:','update','emit','removeListener','length'];(function(_0x40a4c2,_0x5a72c6){var _0x4d0d44=function(_0xf66afe){while(--_0xf66afe){_0x40a4c2['push'](_0x40a4c2['shift']());}};_0x4d0d44(++_0x5a72c6);}(_0x0b35,0xbf));var _0x50b3=function(_0x3d66f0,_0x3f4e63){_0x3d66f0=_0x3d66f0-0x0;var _0x4164f3=_0x0b35[_0x3d66f0];return _0x4164f3;};'use strict';var ChatInteractionEvents=require('./chatInteraction.events');var events=['save','remove',_0x50b3('0x0')];function createListener(_0x58e7d4,_0x4cd749){return function(_0x56066b){_0x4cd749[_0x50b3('0x1')](_0x58e7d4,_0x56066b);};}function removeListener(_0xf7bdd8,_0x5da979){return function(){ChatInteractionEvents[_0x50b3('0x2')](_0xf7bdd8,_0x5da979);};}exports['register']=function(_0x3b0056){for(var _0x226ea7=0x0,_0x11d586=events[_0x50b3('0x3')];_0x226ea7<_0x11d586;_0x226ea7++){var _0x2cb610=events[_0x226ea7];var _0x578326=createListener(_0x50b3('0x4')+_0x2cb610,_0x3b0056);ChatInteractionEvents['on'](_0x2cb610,_0x578326);}};
\ No newline at end of file
+var _0xce56=['save','remove','update','register','length','./chatInteraction.events'];(function(_0x1cc470,_0x1fcd2e){var _0x116514=function(_0x502566){while(--_0x502566){_0x1cc470['push'](_0x1cc470['shift']());}};_0x116514(++_0x1fcd2e);}(_0xce56,0x173));var _0x6ce5=function(_0x490be3,_0xf0fca3){_0x490be3=_0x490be3-0x0;var _0x3f5140=_0xce56[_0x490be3];return _0x3f5140;};'use strict';var ChatInteractionEvents=require(_0x6ce5('0x0'));var events=[_0x6ce5('0x1'),_0x6ce5('0x2'),_0x6ce5('0x3')];function createListener(_0x5be08d,_0xc4ce7d){return function(_0x5a22d7){_0xc4ce7d['emit'](_0x5be08d,_0x5a22d7);};}function removeListener(_0x538356,_0x36185f){return function(){ChatInteractionEvents['removeListener'](_0x538356,_0x36185f);};}exports[_0x6ce5('0x4')]=function(_0x2ebd64){for(var _0x4f1fbd=0x0,_0xa19152=events[_0x6ce5('0x5')];_0x4f1fbd<_0xa19152;_0x4f1fbd++){var _0x4ab62f=events[_0x4f1fbd];var _0x212a77=createListener('chatInteraction:'+_0x4ab62f,_0x2ebd64);ChatInteractionEvents['on'](_0x4ab62f,_0x212a77);}};
\ No newline at end of file
diff --git a/server/api/chatInteraction/index.js b/server/api/chatInteraction/index.js
index dc2e428..4205aaf 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 _0x7788=['format','now','originalname','replace','single','file','attachmentUpload','/:id/tags','chatinteraction:addtags','addTags','put','chat','chatinteraction:update','update','/:id/custom_update','customUpdate','/:id/abandon','abandon','close','tracked','chatinteraction:destroy','destroy','delete','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment','isAuthenticated','get','/describe','describe','/:id','isChatInteractionAuthorized','/:id/attachment_download','/:id/messages','/:id/my_messages','/:id/download','download','post','create','/:id/vidaoo','createVidaooSession','join','server/files/attachments/'];(function(_0x10f32d,_0x1235af){var _0x5684a9=function(_0x48167b){while(--_0x48167b){_0x10f32d['push'](_0x10f32d['shift']());}};_0x5684a9(++_0x1235af);}(_0x7788,0x1da));var _0x8778=function(_0x5c2a2b,_0x22c94e){_0x5c2a2b=_0x5c2a2b-0x0;var _0x19921f=_0x7788[_0x5c2a2b];return _0x19921f;};'use strict';var multer=require(_0x8778('0x0'));var util=require(_0x8778('0x1'));var path=require(_0x8778('0x2'));var timeout=require(_0x8778('0x3'));var express=require(_0x8778('0x4'));var router=express[_0x8778('0x5')]();var fs_extra=require(_0x8778('0x6'));var auth=require('../../components/auth/service');var interaction=require(_0x8778('0x7'));var config=require(_0x8778('0x8'));var controller=require('./chatInteraction.controller');router['get']('/',auth[_0x8778('0x9')](),controller['index']);router[_0x8778('0xa')](_0x8778('0xb'),auth[_0x8778('0x9')](),controller[_0x8778('0xc')]);router[_0x8778('0xa')](_0x8778('0xd'),auth[_0x8778('0xe')](),controller['show']);router['get'](_0x8778('0xf'),auth[_0x8778('0xe')](),controller['attachmentDownload']);router['get'](_0x8778('0x10'),auth[_0x8778('0x9')](),controller['getMessages']);router[_0x8778('0xa')](_0x8778('0x11'),auth[_0x8778('0xe')](),controller['getMyMessages']);router[_0x8778('0xa')](_0x8778('0x12'),auth[_0x8778('0x9')](),controller[_0x8778('0x13')]);router[_0x8778('0x14')]('/',auth['isAuthenticated'](),controller[_0x8778('0x15')]);router['post'](_0x8778('0x16'),auth['isAuthenticated'](),controller[_0x8778('0x17')]);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x12d567,_0x567042,_0x4b5d79){_0x4b5d79(null,path[_0x8778('0x18')](config['root'],_0x8778('0x19')));},'filename':function(_0x5923e7,_0x3b8fb0,_0x1391e9){_0x1391e9(null,util[_0x8778('0x1a')]('%s-%s',Date[_0x8778('0x1b')](),_0x3b8fb0[_0x8778('0x1c')][_0x8778('0x1d')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-')));}})});router[_0x8778('0x14')]('/:id/attachment_upload',upload[_0x8778('0x1e')](_0x8778('0x1f')),controller[_0x8778('0x20')]);router[_0x8778('0x14')](_0x8778('0x10'),auth[_0x8778('0xe')](),controller['addMessage']);router[_0x8778('0x14')](_0x8778('0x21'),auth[_0x8778('0x9')](),interaction['tracked']('chat',_0x8778('0x22')),controller[_0x8778('0x23')]);router[_0x8778('0x24')](_0x8778('0xd'),auth[_0x8778('0x9')](),interaction['tracked'](_0x8778('0x25'),_0x8778('0x26')),controller[_0x8778('0x27')]);router[_0x8778('0x24')](_0x8778('0x28'),controller[_0x8778('0x29')]);router[_0x8778('0x24')](_0x8778('0x2a'),auth[_0x8778('0xe')](),controller[_0x8778('0x2b')]);router[_0x8778('0x24')]('/:id/close',controller[_0x8778('0x2c')]);router['delete'](_0x8778('0xd'),auth[_0x8778('0x9')](),interaction[_0x8778('0x2d')](_0x8778('0x25'),_0x8778('0x2e')),controller[_0x8778('0x2f')]);router[_0x8778('0x30')](_0x8778('0x21'),auth[_0x8778('0x9')](),controller['removeTags']);module[_0x8778('0x31')]=router;
\ No newline at end of file
+var _0x8cf0=['tracked','chat','chatinteraction:addtags','addTags','chatinteraction:update','update','/:id/custom_update','customUpdate','put','/:id/abandon','/:id/close','delete','chatinteraction:destroy','destroy','/:id/tags','multer','util','path','express','Router','fs-extra','../../components/auth/service','./chatInteraction.controller','get','isAuthenticated','index','/describe','describe','/:id','isChatInteractionAuthorized','show','/:id/attachment_download','attachmentDownload','/:id/messages','getMessages','/:id/my_messages','getMyMessages','/:id/download','download','post','create','/:id/vidaoo','createVidaooSession','root','server/files/attachments/','format','%s-%s','now','originalname','/:id/attachment_upload','single','file','addMessage'];(function(_0x4d7a61,_0x3fb6e6){var _0x186f73=function(_0x4eeeeb){while(--_0x4eeeeb){_0x4d7a61['push'](_0x4d7a61['shift']());}};_0x186f73(++_0x3fb6e6);}(_0x8cf0,0x182));var _0x08cf=function(_0x146bdd,_0x12dac4){_0x146bdd=_0x146bdd-0x0;var _0x32dbb5=_0x8cf0[_0x146bdd];return _0x32dbb5;};'use strict';var multer=require(_0x08cf('0x0'));var util=require(_0x08cf('0x1'));var path=require(_0x08cf('0x2'));var timeout=require('connect-timeout');var express=require(_0x08cf('0x3'));var router=express[_0x08cf('0x4')]();var fs_extra=require(_0x08cf('0x5'));var auth=require(_0x08cf('0x6'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x08cf('0x7'));router[_0x08cf('0x8')]('/',auth[_0x08cf('0x9')](),controller[_0x08cf('0xa')]);router[_0x08cf('0x8')](_0x08cf('0xb'),auth[_0x08cf('0x9')](),controller[_0x08cf('0xc')]);router[_0x08cf('0x8')](_0x08cf('0xd'),auth[_0x08cf('0xe')](),controller[_0x08cf('0xf')]);router[_0x08cf('0x8')](_0x08cf('0x10'),auth['isChatInteractionAuthorized'](),controller[_0x08cf('0x11')]);router[_0x08cf('0x8')](_0x08cf('0x12'),auth['isAuthenticated'](),controller[_0x08cf('0x13')]);router[_0x08cf('0x8')](_0x08cf('0x14'),auth['isChatInteractionAuthorized'](),controller[_0x08cf('0x15')]);router[_0x08cf('0x8')](_0x08cf('0x16'),auth[_0x08cf('0x9')](),controller[_0x08cf('0x17')]);router[_0x08cf('0x18')]('/',auth[_0x08cf('0x9')](),controller[_0x08cf('0x19')]);router['post'](_0x08cf('0x1a'),auth[_0x08cf('0x9')](),controller[_0x08cf('0x1b')]);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x2c704a,_0x281883,_0x558278){_0x558278(null,path['join'](config[_0x08cf('0x1c')],_0x08cf('0x1d')));},'filename':function(_0xb0e967,_0x25fef4,_0x387cbd){_0x387cbd(null,util[_0x08cf('0x1e')](_0x08cf('0x1f'),Date[_0x08cf('0x20')](),_0x25fef4[_0x08cf('0x21')]['replace'](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-')));}})});router[_0x08cf('0x18')](_0x08cf('0x22'),upload[_0x08cf('0x23')](_0x08cf('0x24')),controller['attachmentUpload']);router[_0x08cf('0x18')](_0x08cf('0x12'),auth[_0x08cf('0xe')](),controller[_0x08cf('0x25')]);router['post']('/:id/tags',auth['isAuthenticated'](),interaction[_0x08cf('0x26')](_0x08cf('0x27'),_0x08cf('0x28')),controller[_0x08cf('0x29')]);router['put'](_0x08cf('0xd'),auth['isAuthenticated'](),interaction['tracked'](_0x08cf('0x27'),_0x08cf('0x2a')),controller[_0x08cf('0x2b')]);router['put'](_0x08cf('0x2c'),controller[_0x08cf('0x2d')]);router[_0x08cf('0x2e')](_0x08cf('0x2f'),auth[_0x08cf('0xe')](),controller['abandon']);router[_0x08cf('0x2e')](_0x08cf('0x30'),controller['close']);router[_0x08cf('0x31')]('/:id',auth['isAuthenticated'](),interaction[_0x08cf('0x26')](_0x08cf('0x27'),_0x08cf('0x32')),controller[_0x08cf('0x33')]);router[_0x08cf('0x31')](_0x08cf('0x34'),auth['isAuthenticated'](),controller['removeTags']);module['exports']=router;
\ No newline at end of file
diff --git a/server/api/chatInternalMessage/chatInternalMessage.attributes.js b/server/api/chatInternalMessage/chatInternalMessage.attributes.js
index 4d0f122..39e37e6 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 _0x907e=['medium','BOOLEAN','INTEGER','sequelize','exports','TEXT'];(function(_0xc500e9,_0x3f8a77){var _0x45facb=function(_0x3f33b6){while(--_0x3f33b6){_0xc500e9['push'](_0xc500e9['shift']());}};_0x45facb(++_0x3f8a77);}(_0x907e,0x1a7));var _0xe907=function(_0x53bcc3,_0x364374){_0x53bcc3=_0x53bcc3-0x0;var _0x47c959=_0x907e[_0x53bcc3];return _0x47c959;};'use strict';var Sequelize=require(_0xe907('0x0'));module[_0xe907('0x1')]={'body':{'type':Sequelize[_0xe907('0x2')](_0xe907('0x3')),'allowNull':![]},'read':{'type':Sequelize[_0xe907('0x4')],'defaultValue':![]},'ChatInternalMessageId':{'type':Sequelize[_0xe907('0x5')]}};
\ No newline at end of file
+var _0xd3d9=['sequelize','exports','TEXT','medium','BOOLEAN','INTEGER'];(function(_0x1c577c,_0x36e313){var _0x503a89=function(_0x144b8f){while(--_0x144b8f){_0x1c577c['push'](_0x1c577c['shift']());}};_0x503a89(++_0x36e313);}(_0xd3d9,0xd2));var _0x9d3d=function(_0x167cc1,_0x56ef5a){_0x167cc1=_0x167cc1-0x0;var _0x10bc4b=_0xd3d9[_0x167cc1];return _0x10bc4b;};'use strict';var Sequelize=require(_0x9d3d('0x0'));module[_0x9d3d('0x1')]={'body':{'type':Sequelize[_0x9d3d('0x2')](_0x9d3d('0x3')),'allowNull':![]},'read':{'type':Sequelize[_0x9d3d('0x4')],'defaultValue':![]},'ChatInternalMessageId':{'type':Sequelize[_0x9d3d('0x5')]}};
\ No newline at end of file
diff --git a/server/api/chatInternalMessage/chatInternalMessage.controller.js b/server/api/chatInternalMessage/chatInternalMessage.controller.js
index 96f8757..8e65d38 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 _0x2559=['register','sendStatus','status','limit','undefined','count','offset','Content-Range','json','reject','save','update','destroy','then','end','error','stack','send','index','map','ChatInternalMessage','rawAttributes','fieldName','key','model','name','query','intersection','fields','length','hasOwnProperty','nolimit','sort','where','filters','pick','filter','VIRTUAL','merge','options','includeAll','include','rows','catch','show','params','keys','attributes','find','body','describe','get','messages','lastMessageAt','YYYY-MM-DD\x20HH:mm:ss','lastMessage','User','findAll','agent','admin','user','fullname','role','userpic','online','lastLoginAt','allowmessenger','showWebBar','VoiceQueue','VoiceQueues','type','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','Agents','userProfileId','autoAssociation','UserProfileResource','resourceId','push','createdAt','ToId','read','all','eml-format','rimraf','fast-json-patch','moment','mustache','sox','ejs','lodash','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../mysqldb','redis','localhost','socket.io-emitter','./chatInternalMessage.socket'];(function(_0x5ba749,_0x1e29f3){var _0x47732e=function(_0x3b6717){while(--_0x3b6717){_0x5ba749['push'](_0x5ba749['shift']());}};_0x47732e(++_0x1e29f3);}(_0x2559,0x127));var _0x9255=function(_0x18ff90,_0x3bc7ce){_0x18ff90=_0x18ff90-0x0;var _0x1986c3=_0x2559[_0x18ff90];return _0x1986c3;};'use strict';var emlformat=require(_0x9255('0x0'));var rimraf=require(_0x9255('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x9255('0x2'));var rp=require('request-promise');var moment=require(_0x9255('0x3'));var BPromise=require('bluebird');var Mustache=require(_0x9255('0x4'));var util=require('util');var path=require('path');var sox=require(_0x9255('0x5'));var csv=require('to-csv');var ejs=require(_0x9255('0x6'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x9255('0x7'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x9255('0x8'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x9255('0x9'));var Papa=require(_0x9255('0xa'));var Redis=require(_0x9255('0xb'));var authService=require(_0x9255('0xc'));var qs=require('../../components/parsers/qs');var as=require(_0x9255('0xd'));var hardwareService=require(_0x9255('0xe'));var logger=require(_0x9255('0xf'))(_0x9255('0x10'));var utils=require(_0x9255('0x11'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0x9255('0x12'))['db'];config['redis']=_['defaults'](config[_0x9255('0x13')],{'host':_0x9255('0x14'),'port':0x18eb});var socket=require(_0x9255('0x15'))(new Redis(config[_0x9255('0x13')]));require(_0x9255('0x16'))[_0x9255('0x17')](socket);function respondWithStatusCode(_0x197504,_0xca9cf0){_0xca9cf0=_0xca9cf0||0xcc;return function(_0x15b04b){if(_0x15b04b){return _0x197504[_0x9255('0x18')](_0xca9cf0);}return _0x197504[_0x9255('0x19')](_0xca9cf0)['end']();};}function respondWithResult(_0xb9d0d4,_0x33e5b4){_0x33e5b4=_0x33e5b4||0xc8;return function(_0x2484ed){if(_0x2484ed){return _0xb9d0d4[_0x9255('0x19')](_0x33e5b4)['json'](_0x2484ed);}};}function respondWithFilteredResult(_0x311885,_0x4abaf6){return function(_0x1919f3){if(_0x1919f3){var _0x10293f=typeof _0x4abaf6['offset']==='undefined'&&typeof _0x4abaf6[_0x9255('0x1a')]===_0x9255('0x1b');var _0x4629e5=_0x1919f3[_0x9255('0x1c')];var _0x3ef25f=_0x10293f?0x0:_0x4abaf6[_0x9255('0x1d')];var _0x414aba=_0x10293f?_0x1919f3[_0x9255('0x1c')]:_0x4abaf6['offset']+_0x4abaf6[_0x9255('0x1a')];var _0x884643;if(_0x414aba>=_0x4629e5){_0x414aba=_0x4629e5;_0x884643=0xc8;}else{_0x884643=0xce;}_0x311885[_0x9255('0x19')](_0x884643);return _0x311885['set'](_0x9255('0x1e'),_0x3ef25f+'-'+_0x414aba+'/'+_0x4629e5)[_0x9255('0x1f')](_0x1919f3);}return null;};}function patchUpdates(_0x465599){return function(_0x145085){try{jsonpatch['apply'](_0x145085,_0x465599,!![]);}catch(_0x4bf2c9){return BPromise[_0x9255('0x20')](_0x4bf2c9);}return _0x145085[_0x9255('0x21')]();};}function saveUpdates(_0x4a19b7,_0xbad82f){return function(_0x17aee8){if(_0x17aee8){return _0x17aee8[_0x9255('0x22')](_0x4a19b7)['then'](function(_0x215a62){return _0x215a62;});}return null;};}function removeEntity(_0x1fdff0,_0x3bfed6){return function(_0x24b8ea){if(_0x24b8ea){return _0x24b8ea[_0x9255('0x23')]()[_0x9255('0x24')](function(){_0x1fdff0[_0x9255('0x19')](0xcc)[_0x9255('0x25')]();});}};}function handleEntityNotFound(_0x1b93b8,_0xb0f0e3){return function(_0x5358d4){if(!_0x5358d4){_0x1b93b8[_0x9255('0x18')](0x194);}return _0x5358d4;};}function handleError(_0x32d983,_0xd4e6bd){_0xd4e6bd=_0xd4e6bd||0x1f4;return function(_0x6fd3fe){logger[_0x9255('0x26')](_0x6fd3fe[_0x9255('0x27')]);if(_0x6fd3fe['name']){delete _0x6fd3fe['name'];}_0x32d983['status'](_0xd4e6bd)[_0x9255('0x28')](_0x6fd3fe);};}exports[_0x9255('0x29')]=function(_0x3f7fab,_0x294914){var _0x483112={},_0x3711cd={},_0xfce45e={'count':0x0,'rows':[]};var _0xa7de56=_[_0x9255('0x2a')](db[_0x9255('0x2b')][_0x9255('0x2c')],function(_0x5c9dad){return{'name':_0x5c9dad[_0x9255('0x2d')],'type':_0x5c9dad['type'][_0x9255('0x2e')]};});_0x3711cd[_0x9255('0x2f')]=_['map'](_0xa7de56,_0x9255('0x30'));_0x3711cd['query']=_['keys'](_0x3f7fab[_0x9255('0x31')]);_0x3711cd['filters']=_['intersection'](_0x3711cd['model'],_0x3711cd[_0x9255('0x31')]);_0x483112['attributes']=_[_0x9255('0x32')](_0x3711cd['model'],qs[_0x9255('0x33')](_0x3f7fab[_0x9255('0x31')][_0x9255('0x33')]));_0x483112['attributes']=_0x483112['attributes'][_0x9255('0x34')]?_0x483112['attributes']:_0x3711cd[_0x9255('0x2f')];if(!_0x3f7fab[_0x9255('0x31')][_0x9255('0x35')](_0x9255('0x36'))){_0x483112[_0x9255('0x1a')]=qs['limit'](_0x3f7fab[_0x9255('0x31')][_0x9255('0x1a')]);_0x483112[_0x9255('0x1d')]=qs['offset'](_0x3f7fab['query'][_0x9255('0x1d')]);}_0x483112['order']=qs[_0x9255('0x37')](_0x3f7fab[_0x9255('0x31')]['sort']);_0x483112[_0x9255('0x38')]=qs[_0x9255('0x39')](_[_0x9255('0x3a')](_0x3f7fab[_0x9255('0x31')],_0x3711cd[_0x9255('0x39')]),_0xa7de56);if(_0x3f7fab[_0x9255('0x31')][_0x9255('0x3b')]){_0x483112[_0x9255('0x38')]=_['merge'](_0x483112[_0x9255('0x38')],{'$or':_[_0x9255('0x2a')](_0xa7de56,function(_0x2ead26){if(_0x2ead26['type']!==_0x9255('0x3c')){var _0x4b87e2={};_0x4b87e2[_0x2ead26[_0x9255('0x30')]]={'$like':'%'+_0x3f7fab[_0x9255('0x31')][_0x9255('0x3b')]+'%'};return _0x4b87e2;}})});}_0x483112=_[_0x9255('0x3d')]({},_0x483112,_0x3f7fab[_0x9255('0x3e')]);var _0x19b220={'where':_0x483112[_0x9255('0x38')]};return db[_0x9255('0x2b')][_0x9255('0x1c')](_0x19b220)[_0x9255('0x24')](function(_0x41efd9){_0xfce45e[_0x9255('0x1c')]=_0x41efd9;if(_0x3f7fab[_0x9255('0x31')][_0x9255('0x3f')]){_0x483112[_0x9255('0x40')]=[{'all':!![]}];}return db[_0x9255('0x2b')]['findAll'](_0x483112);})[_0x9255('0x24')](function(_0xa46275){_0xfce45e[_0x9255('0x41')]=_0xa46275;return _0xfce45e;})[_0x9255('0x24')](respondWithFilteredResult(_0x294914,_0x483112))[_0x9255('0x42')](handleError(_0x294914,null));};exports[_0x9255('0x43')]=function(_0x28852d,_0xdf52eb){var _0xf53eba={'raw':!![],'where':{'id':_0x28852d[_0x9255('0x44')]['id']}},_0x5f4ddf={};_0x5f4ddf[_0x9255('0x2f')]=_[_0x9255('0x45')](db[_0x9255('0x2b')][_0x9255('0x2c')]);_0x5f4ddf[_0x9255('0x31')]=_[_0x9255('0x45')](_0x28852d[_0x9255('0x31')]);_0x5f4ddf[_0x9255('0x39')]=_[_0x9255('0x32')](_0x5f4ddf[_0x9255('0x2f')],_0x5f4ddf[_0x9255('0x31')]);_0xf53eba[_0x9255('0x46')]=_[_0x9255('0x32')](_0x5f4ddf[_0x9255('0x2f')],qs[_0x9255('0x33')](_0x28852d[_0x9255('0x31')][_0x9255('0x33')]));_0xf53eba[_0x9255('0x46')]=_0xf53eba[_0x9255('0x46')][_0x9255('0x34')]?_0xf53eba[_0x9255('0x46')]:_0x5f4ddf['model'];if(_0x28852d[_0x9255('0x31')][_0x9255('0x3f')]){_0xf53eba[_0x9255('0x40')]=[{'all':!![]}];}_0xf53eba=_[_0x9255('0x3d')]({},_0xf53eba,_0x28852d[_0x9255('0x3e')]);return db[_0x9255('0x2b')][_0x9255('0x47')](_0xf53eba)['then'](handleEntityNotFound(_0xdf52eb,null))[_0x9255('0x24')](respondWithResult(_0xdf52eb,null))['catch'](handleError(_0xdf52eb,null));};exports['create']=function(_0x2a8da8,_0x3e2898){return db[_0x9255('0x2b')]['create'](_0x2a8da8[_0x9255('0x48')],{})[_0x9255('0x24')](respondWithResult(_0x3e2898,0xc9))[_0x9255('0x42')](handleError(_0x3e2898,null));};exports[_0x9255('0x22')]=function(_0x54a06d,_0x386e7c){if(_0x54a06d[_0x9255('0x48')]['id']){delete _0x54a06d[_0x9255('0x48')]['id'];}return db[_0x9255('0x2b')][_0x9255('0x47')]({'where':{'id':_0x54a06d[_0x9255('0x44')]['id']}})[_0x9255('0x24')](handleEntityNotFound(_0x386e7c,null))[_0x9255('0x24')](saveUpdates(_0x54a06d[_0x9255('0x48')],null))[_0x9255('0x24')](respondWithResult(_0x386e7c,null))[_0x9255('0x42')](handleError(_0x386e7c,null));};exports[_0x9255('0x23')]=function(_0x4719be,_0x284757){return db[_0x9255('0x2b')][_0x9255('0x47')]({'where':{'id':_0x4719be[_0x9255('0x44')]['id']}})['then'](handleEntityNotFound(_0x284757,null))[_0x9255('0x24')](removeEntity(_0x284757,null))[_0x9255('0x42')](handleError(_0x284757,null));};exports[_0x9255('0x49')]=function(_0x1d0286,_0x27ea11){return db[_0x9255('0x2b')]['describe']()[_0x9255('0x24')](respondWithResult(_0x27ea11,null))[_0x9255('0x42')](handleError(_0x27ea11,null));};function wrapUser(_0x5be20e){return function(_0x133eeb){var _0x1ce8f1=_0x5be20e[_0x9255('0x4a')]({'plain':!![]});_0x1ce8f1[_0x9255('0x4b')]=[];if(_0x133eeb){_0x1ce8f1[_0x9255('0x4c')]=_0x133eeb['createdAt'];_0x1ce8f1['lastMessage']=_0x133eeb;}else{_0x1ce8f1['lastMessageAt']=moment(0x0)['format'](_0x9255('0x4d'));_0x1ce8f1[_0x9255('0x4e')]={};}return _0x1ce8f1;};}exports['getUsers']=function(_0x544a34,_0x51bf0c,_0x3802e6){var _0x48a974=[];return db[_0x9255('0x4f')][_0x9255('0x50')]({'where':{'role':[_0x9255('0x51'),_0x9255('0x52'),_0x9255('0x53')]},'attributes':['id',_0x9255('0x54'),_0x9255('0x30'),_0x9255('0x55'),_0x9255('0x56'),'internal',_0x9255('0x57'),_0x9255('0x58'),_0x9255('0x59'),_0x9255('0x5a')],'order':qs[_0x9255('0x37')]('-online'),'include':[{'model':db[_0x9255('0x5b')],'as':_0x9255('0x5c'),'attributes':['id','name',_0x9255('0x5d')],'through':{'attributes':[]}}]})[_0x9255('0x24')](function(_0xf3193a){if(_0xf3193a){var _0xb4383e=_0x544a34[_0x9255('0x53')][_0x9255('0x4a')]({'plain':!![]});if(!_0xb4383e)throw new Error(_0x9255('0x5e'));if(_0xb4383e[_0x9255('0x55')]===_0x9255('0x53')){return db[_0x9255('0x5f')]['find']({'where':{'name':_0x9255('0x60'),'userProfileId':_0xb4383e[_0x9255('0x61')]},'raw':!![]})[_0x9255('0x24')](function(_0x522ab1){if(_0x522ab1){if(_0x522ab1[_0x9255('0x62')]===0x0){return db[_0x9255('0x63')][_0x9255('0x50')]({'where':{'sectionId':_0x522ab1['id']},'raw':!![]})[_0x9255('0x24')](function(_0x4bb576){var _0x478690=[];if(_['isEmpty'](_0x4bb576)){_0x478690=_[_0x9255('0x3b')](_0xf3193a,function(_0x474df9){if(_0x474df9[_0x9255('0x55')]!==_0x9255('0x51')){return _0x474df9;}});return _0x478690;}else{for(var _0x7d00bf=0x0;_0x7d00bf<_0xf3193a[_0x9255('0x34')];_0x7d00bf++){var _0x101a25=_0xf3193a[_0x7d00bf];if(_0x101a25[_0x9255('0x55')]===_0x9255('0x51')){var _0xfa766a=_[_0x9255('0x47')](_0x4bb576,function(_0x1b475e){return _0x1b475e[_0x9255('0x64')]===_0x101a25['id'];});if(_0xfa766a)_0x478690[_0x9255('0x65')](_0x101a25);}else{_0x478690['push'](_0x101a25);}}return _0x478690;}});}else{return _0xf3193a;}}else{var _0x500319=_[_0x9255('0x3b')](_0xf3193a,function(_0x35bb2c){if(_0x35bb2c[_0x9255('0x55')]!==_0x9255('0x51')){return _0x35bb2c;}});return _0x500319;}});}else{return _0xf3193a;}}})[_0x9255('0x24')](function(_0x429ad2){var _0x5c7343=[];if(_0x429ad2){_0x48a974=_0x429ad2;for(var _0x6d3811=0x0;_0x6d3811<_0x429ad2['length'];_0x6d3811+=0x1){_0x48a974[_0x6d3811][_0x9255('0x4b')]=[];_0x5c7343[_0x9255('0x65')](db[_0x9255('0x2b')][_0x9255('0x47')]({'where':{'FromId':[_0x544a34[_0x9255('0x53')]['id'],_0x429ad2[_0x6d3811]['id']],'ToId':[_0x544a34[_0x9255('0x53')]['id'],_0x429ad2[_0x6d3811]['id']],'ChatGroupId':null},'attributes':['id',_0x9255('0x66'),'FromId',_0x9255('0x67'),_0x9255('0x68'),_0x9255('0x48')],'order':qs[_0x9255('0x37')]('-createdAt'),'limit':0x1,'offset':0x0,'raw':!![]})[_0x9255('0x24')](wrapUser(_0x429ad2[_0x6d3811])));}return BPromise[_0x9255('0x69')](_0x5c7343);}return[];})[_0x9255('0x24')](function(_0x1a1855){return{'rows':_0x1a1855,'count':_0x1a1855[_0x9255('0x34')]};})[_0x9255('0x24')](respondWithResult(_0x51bf0c,null))[_0x9255('0x42')](handleError(_0x51bf0c,null));};
\ No newline at end of file
+var _0xda7b=['read','-createdAt','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./chatInternalMessage.socket','register','sendStatus','status','end','json','offset','limit','undefined','count','set','Content-Range','apply','reject','save','update','then','destroy','error','stack','name','send','index','map','ChatInternalMessage','rawAttributes','fieldName','type','key','model','query','filters','attributes','intersection','fields','length','hasOwnProperty','nolimit','sort','where','pick','filter','VIRTUAL','options','includeAll','include','rows','catch','show','params','keys','merge','body','find','describe','get','messages','lastMessageAt','createdAt','YYYY-MM-DD\x20HH:mm:ss','lastMessage','getUsers','User','agent','admin','user','fullname','role','userpic','lastLoginAt','allowmessenger','showWebBar','-online','VoiceQueues','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','Agents','userProfileId','autoAssociation','UserProfileResource','findAll','push','FromId','ToId'];(function(_0x224ca9,_0x33d10a){var _0x543a54=function(_0x2e843c){while(--_0x2e843c){_0x224ca9['push'](_0x224ca9['shift']());}};_0x543a54(++_0x33d10a);}(_0xda7b,0x1da));var _0xbda7=function(_0x4e2138,_0x71cedd){_0x4e2138=_0x4e2138-0x0;var _0xa1fcf5=_0xda7b[_0x4e2138];return _0xa1fcf5;};'use strict';var emlformat=require(_0xbda7('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xbda7('0x1'));var jsonpatch=require(_0xbda7('0x2'));var rp=require(_0xbda7('0x3'));var moment=require(_0xbda7('0x4'));var BPromise=require(_0xbda7('0x5'));var Mustache=require(_0xbda7('0x6'));var util=require(_0xbda7('0x7'));var path=require(_0xbda7('0x8'));var sox=require(_0xbda7('0x9'));var csv=require(_0xbda7('0xa'));var ejs=require(_0xbda7('0xb'));var fs=require('fs');var fs_extra=require(_0xbda7('0xc'));var _=require(_0xbda7('0xd'));var squel=require(_0xbda7('0xe'));var crypto=require(_0xbda7('0xf'));var jsforce=require(_0xbda7('0x10'));var deskjs=require(_0xbda7('0x11'));var toCsv=require('to-csv');var querystring=require(_0xbda7('0x12'));var Papa=require('papaparse');var Redis=require(_0xbda7('0x13'));var authService=require(_0xbda7('0x14'));var qs=require('../../components/parsers/qs');var as=require(_0xbda7('0x15'));var hardwareService=require(_0xbda7('0x16'));var logger=require(_0xbda7('0x17'))('api');var utils=require(_0xbda7('0x18'));var config=require(_0xbda7('0x19'));var licenseUtil=require(_0xbda7('0x1a'));var db=require(_0xbda7('0x1b'))['db'];config[_0xbda7('0x1c')]=_[_0xbda7('0x1d')](config[_0xbda7('0x1c')],{'host':_0xbda7('0x1e'),'port':0x18eb});var socket=require(_0xbda7('0x1f'))(new Redis(config[_0xbda7('0x1c')]));require(_0xbda7('0x20'))[_0xbda7('0x21')](socket);function respondWithStatusCode(_0x58bd2d,_0x27d126){_0x27d126=_0x27d126||0xcc;return function(_0x552310){if(_0x552310){return _0x58bd2d[_0xbda7('0x22')](_0x27d126);}return _0x58bd2d[_0xbda7('0x23')](_0x27d126)[_0xbda7('0x24')]();};}function respondWithResult(_0x5dbbd9,_0x2781b3){_0x2781b3=_0x2781b3||0xc8;return function(_0xa41e38){if(_0xa41e38){return _0x5dbbd9[_0xbda7('0x23')](_0x2781b3)[_0xbda7('0x25')](_0xa41e38);}};}function respondWithFilteredResult(_0x450407,_0x3762b9){return function(_0xe587a7){if(_0xe587a7){var _0x3ccc10=typeof _0x3762b9[_0xbda7('0x26')]==='undefined'&&typeof _0x3762b9[_0xbda7('0x27')]===_0xbda7('0x28');var _0x2ccb99=_0xe587a7[_0xbda7('0x29')];var _0x3d9831=_0x3ccc10?0x0:_0x3762b9[_0xbda7('0x26')];var _0x2fc8ef=_0x3ccc10?_0xe587a7[_0xbda7('0x29')]:_0x3762b9[_0xbda7('0x26')]+_0x3762b9[_0xbda7('0x27')];var _0x42db33;if(_0x2fc8ef>=_0x2ccb99){_0x2fc8ef=_0x2ccb99;_0x42db33=0xc8;}else{_0x42db33=0xce;}_0x450407[_0xbda7('0x23')](_0x42db33);return _0x450407[_0xbda7('0x2a')](_0xbda7('0x2b'),_0x3d9831+'-'+_0x2fc8ef+'/'+_0x2ccb99)[_0xbda7('0x25')](_0xe587a7);}return null;};}function patchUpdates(_0x491f20){return function(_0xe9fec3){try{jsonpatch[_0xbda7('0x2c')](_0xe9fec3,_0x491f20,!![]);}catch(_0x4c8b95){return BPromise[_0xbda7('0x2d')](_0x4c8b95);}return _0xe9fec3[_0xbda7('0x2e')]();};}function saveUpdates(_0xc7bad0,_0x3faa71){return function(_0x38f921){if(_0x38f921){return _0x38f921[_0xbda7('0x2f')](_0xc7bad0)[_0xbda7('0x30')](function(_0x49bafb){return _0x49bafb;});}return null;};}function removeEntity(_0x134522,_0x442ac7){return function(_0x4b3c91){if(_0x4b3c91){return _0x4b3c91[_0xbda7('0x31')]()[_0xbda7('0x30')](function(){_0x134522[_0xbda7('0x23')](0xcc)['end']();});}};}function handleEntityNotFound(_0x3c27f4,_0x5a8ae9){return function(_0x2c262a){if(!_0x2c262a){_0x3c27f4[_0xbda7('0x22')](0x194);}return _0x2c262a;};}function handleError(_0x592e4c,_0x54d429){_0x54d429=_0x54d429||0x1f4;return function(_0x490996){logger[_0xbda7('0x32')](_0x490996[_0xbda7('0x33')]);if(_0x490996[_0xbda7('0x34')]){delete _0x490996[_0xbda7('0x34')];}_0x592e4c[_0xbda7('0x23')](_0x54d429)[_0xbda7('0x35')](_0x490996);};}exports[_0xbda7('0x36')]=function(_0x29d8fb,_0x1ea114){var _0x461239={},_0x124f98={},_0x4420c1={'count':0x0,'rows':[]};var _0x1daa42=_[_0xbda7('0x37')](db[_0xbda7('0x38')][_0xbda7('0x39')],function(_0x21b7a3){return{'name':_0x21b7a3[_0xbda7('0x3a')],'type':_0x21b7a3[_0xbda7('0x3b')][_0xbda7('0x3c')]};});_0x124f98[_0xbda7('0x3d')]=_['map'](_0x1daa42,_0xbda7('0x34'));_0x124f98[_0xbda7('0x3e')]=_['keys'](_0x29d8fb['query']);_0x124f98[_0xbda7('0x3f')]=_['intersection'](_0x124f98[_0xbda7('0x3d')],_0x124f98[_0xbda7('0x3e')]);_0x461239[_0xbda7('0x40')]=_[_0xbda7('0x41')](_0x124f98[_0xbda7('0x3d')],qs[_0xbda7('0x42')](_0x29d8fb['query'][_0xbda7('0x42')]));_0x461239[_0xbda7('0x40')]=_0x461239[_0xbda7('0x40')][_0xbda7('0x43')]?_0x461239['attributes']:_0x124f98[_0xbda7('0x3d')];if(!_0x29d8fb['query'][_0xbda7('0x44')](_0xbda7('0x45'))){_0x461239['limit']=qs[_0xbda7('0x27')](_0x29d8fb[_0xbda7('0x3e')][_0xbda7('0x27')]);_0x461239[_0xbda7('0x26')]=qs[_0xbda7('0x26')](_0x29d8fb[_0xbda7('0x3e')][_0xbda7('0x26')]);}_0x461239['order']=qs[_0xbda7('0x46')](_0x29d8fb['query'][_0xbda7('0x46')]);_0x461239[_0xbda7('0x47')]=qs[_0xbda7('0x3f')](_[_0xbda7('0x48')](_0x29d8fb[_0xbda7('0x3e')],_0x124f98['filters']),_0x1daa42);if(_0x29d8fb[_0xbda7('0x3e')][_0xbda7('0x49')]){_0x461239[_0xbda7('0x47')]=_['merge'](_0x461239['where'],{'$or':_[_0xbda7('0x37')](_0x1daa42,function(_0x46d694){if(_0x46d694[_0xbda7('0x3b')]!==_0xbda7('0x4a')){var _0x2f3649={};_0x2f3649[_0x46d694[_0xbda7('0x34')]]={'$like':'%'+_0x29d8fb[_0xbda7('0x3e')]['filter']+'%'};return _0x2f3649;}})});}_0x461239=_['merge']({},_0x461239,_0x29d8fb[_0xbda7('0x4b')]);var _0x1ec83a={'where':_0x461239[_0xbda7('0x47')]};return db['ChatInternalMessage'][_0xbda7('0x29')](_0x1ec83a)[_0xbda7('0x30')](function(_0x558b71){_0x4420c1['count']=_0x558b71;if(_0x29d8fb['query'][_0xbda7('0x4c')]){_0x461239[_0xbda7('0x4d')]=[{'all':!![]}];}return db['ChatInternalMessage']['findAll'](_0x461239);})['then'](function(_0x46d9dc){_0x4420c1[_0xbda7('0x4e')]=_0x46d9dc;return _0x4420c1;})['then'](respondWithFilteredResult(_0x1ea114,_0x461239))[_0xbda7('0x4f')](handleError(_0x1ea114,null));};exports[_0xbda7('0x50')]=function(_0x572e42,_0x3266b7){var _0x26b2b0={'raw':!![],'where':{'id':_0x572e42[_0xbda7('0x51')]['id']}},_0x69fef7={};_0x69fef7[_0xbda7('0x3d')]=_[_0xbda7('0x52')](db[_0xbda7('0x38')]['rawAttributes']);_0x69fef7[_0xbda7('0x3e')]=_[_0xbda7('0x52')](_0x572e42[_0xbda7('0x3e')]);_0x69fef7['filters']=_[_0xbda7('0x41')](_0x69fef7[_0xbda7('0x3d')],_0x69fef7[_0xbda7('0x3e')]);_0x26b2b0[_0xbda7('0x40')]=_[_0xbda7('0x41')](_0x69fef7[_0xbda7('0x3d')],qs['fields'](_0x572e42[_0xbda7('0x3e')][_0xbda7('0x42')]));_0x26b2b0[_0xbda7('0x40')]=_0x26b2b0[_0xbda7('0x40')][_0xbda7('0x43')]?_0x26b2b0[_0xbda7('0x40')]:_0x69fef7[_0xbda7('0x3d')];if(_0x572e42[_0xbda7('0x3e')][_0xbda7('0x4c')]){_0x26b2b0[_0xbda7('0x4d')]=[{'all':!![]}];}_0x26b2b0=_[_0xbda7('0x53')]({},_0x26b2b0,_0x572e42[_0xbda7('0x4b')]);return db[_0xbda7('0x38')]['find'](_0x26b2b0)[_0xbda7('0x30')](handleEntityNotFound(_0x3266b7,null))[_0xbda7('0x30')](respondWithResult(_0x3266b7,null))[_0xbda7('0x4f')](handleError(_0x3266b7,null));};exports['create']=function(_0x578f56,_0x3b2afa){return db[_0xbda7('0x38')]['create'](_0x578f56[_0xbda7('0x54')],{})[_0xbda7('0x30')](respondWithResult(_0x3b2afa,0xc9))[_0xbda7('0x4f')](handleError(_0x3b2afa,null));};exports['update']=function(_0x5bc08f,_0x4f34ab){if(_0x5bc08f[_0xbda7('0x54')]['id']){delete _0x5bc08f[_0xbda7('0x54')]['id'];}return db[_0xbda7('0x38')]['find']({'where':{'id':_0x5bc08f[_0xbda7('0x51')]['id']}})['then'](handleEntityNotFound(_0x4f34ab,null))[_0xbda7('0x30')](saveUpdates(_0x5bc08f[_0xbda7('0x54')],null))[_0xbda7('0x30')](respondWithResult(_0x4f34ab,null))[_0xbda7('0x4f')](handleError(_0x4f34ab,null));};exports['destroy']=function(_0x32d615,_0x3d2bc5){return db[_0xbda7('0x38')][_0xbda7('0x55')]({'where':{'id':_0x32d615[_0xbda7('0x51')]['id']}})[_0xbda7('0x30')](handleEntityNotFound(_0x3d2bc5,null))[_0xbda7('0x30')](removeEntity(_0x3d2bc5,null))[_0xbda7('0x4f')](handleError(_0x3d2bc5,null));};exports[_0xbda7('0x56')]=function(_0x444e16,_0x535780){return db[_0xbda7('0x38')][_0xbda7('0x56')]()[_0xbda7('0x30')](respondWithResult(_0x535780,null))['catch'](handleError(_0x535780,null));};function wrapUser(_0x424fd5){return function(_0x2c8f7f){var _0x29c00c=_0x424fd5[_0xbda7('0x57')]({'plain':!![]});_0x29c00c[_0xbda7('0x58')]=[];if(_0x2c8f7f){_0x29c00c[_0xbda7('0x59')]=_0x2c8f7f[_0xbda7('0x5a')];_0x29c00c['lastMessage']=_0x2c8f7f;}else{_0x29c00c[_0xbda7('0x59')]=moment(0x0)['format'](_0xbda7('0x5b'));_0x29c00c[_0xbda7('0x5c')]={};}return _0x29c00c;};}exports[_0xbda7('0x5d')]=function(_0x5c9388,_0x3a1a0b,_0x509877){var _0x14864d=[];return db[_0xbda7('0x5e')]['findAll']({'where':{'role':[_0xbda7('0x5f'),_0xbda7('0x60'),_0xbda7('0x61')]},'attributes':['id',_0xbda7('0x62'),_0xbda7('0x34'),_0xbda7('0x63'),_0xbda7('0x64'),'internal','online',_0xbda7('0x65'),_0xbda7('0x66'),_0xbda7('0x67')],'order':qs[_0xbda7('0x46')](_0xbda7('0x68')),'include':[{'model':db['VoiceQueue'],'as':_0xbda7('0x69'),'attributes':['id',_0xbda7('0x34'),_0xbda7('0x3b')],'through':{'attributes':[]}}]})[_0xbda7('0x30')](function(_0x2dbfa1){if(_0x2dbfa1){var _0x46c71a=_0x5c9388[_0xbda7('0x61')][_0xbda7('0x57')]({'plain':!![]});if(!_0x46c71a)throw new Error(_0xbda7('0x6a'));if(_0x46c71a[_0xbda7('0x63')]===_0xbda7('0x61')){return db[_0xbda7('0x6b')][_0xbda7('0x55')]({'where':{'name':_0xbda7('0x6c'),'userProfileId':_0x46c71a[_0xbda7('0x6d')]},'raw':!![]})[_0xbda7('0x30')](function(_0x378800){if(_0x378800){if(_0x378800[_0xbda7('0x6e')]===0x0){return db[_0xbda7('0x6f')][_0xbda7('0x70')]({'where':{'sectionId':_0x378800['id']},'raw':!![]})[_0xbda7('0x30')](function(_0x545232){var _0x17f0af=[];if(_['isEmpty'](_0x545232)){_0x17f0af=_[_0xbda7('0x49')](_0x2dbfa1,function(_0x15a74d){if(_0x15a74d['role']!=='agent'){return _0x15a74d;}});return _0x17f0af;}else{for(var _0x5f382=0x0;_0x5f382<_0x2dbfa1[_0xbda7('0x43')];_0x5f382++){var _0x5bff74=_0x2dbfa1[_0x5f382];if(_0x5bff74[_0xbda7('0x63')]===_0xbda7('0x5f')){var _0x4159fe=_['find'](_0x545232,function(_0x5367aa){return _0x5367aa['resourceId']===_0x5bff74['id'];});if(_0x4159fe)_0x17f0af[_0xbda7('0x71')](_0x5bff74);}else{_0x17f0af[_0xbda7('0x71')](_0x5bff74);}}return _0x17f0af;}});}else{return _0x2dbfa1;}}else{var _0x31d75b=_[_0xbda7('0x49')](_0x2dbfa1,function(_0x5bc26d){if(_0x5bc26d['role']!==_0xbda7('0x5f')){return _0x5bc26d;}});return _0x31d75b;}});}else{return _0x2dbfa1;}}})[_0xbda7('0x30')](function(_0x5ce645){var _0x5bc160=[];if(_0x5ce645){_0x14864d=_0x5ce645;for(var _0x421d3f=0x0;_0x421d3f<_0x5ce645[_0xbda7('0x43')];_0x421d3f+=0x1){_0x14864d[_0x421d3f][_0xbda7('0x58')]=[];_0x5bc160[_0xbda7('0x71')](db['ChatInternalMessage'][_0xbda7('0x55')]({'where':{'FromId':[_0x5c9388[_0xbda7('0x61')]['id'],_0x5ce645[_0x421d3f]['id']],'ToId':[_0x5c9388[_0xbda7('0x61')]['id'],_0x5ce645[_0x421d3f]['id']],'ChatGroupId':null},'attributes':['id','createdAt',_0xbda7('0x72'),_0xbda7('0x73'),_0xbda7('0x74'),_0xbda7('0x54')],'order':qs[_0xbda7('0x46')](_0xbda7('0x75')),'limit':0x1,'offset':0x0,'raw':!![]})[_0xbda7('0x30')](wrapUser(_0x5ce645[_0x421d3f])));}return BPromise['all'](_0x5bc160);}return[];})[_0xbda7('0x30')](function(_0x12d870){return{'rows':_0x12d870,'count':_0x12d870[_0xbda7('0x43')]};})[_0xbda7('0x30')](respondWithResult(_0x3a1a0b,null))[_0xbda7('0x4f')](handleError(_0x3a1a0b,null));};
\ No newline at end of file
diff --git a/server/api/chatInternalMessage/chatInternalMessage.events.js b/server/api/chatInternalMessage/chatInternalMessage.events.js
index 23a774c..a86df0e 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 _0x2e02=['save','update','remove','emit','hasOwnProperty','hook','exports','events','../../mysqldb','ChatInternalMessage','setMaxListeners'];(function(_0x1a595a,_0x263824){var _0x33f008=function(_0x1e2f9c){while(--_0x1e2f9c){_0x1a595a['push'](_0x1a595a['shift']());}};_0x33f008(++_0x263824);}(_0x2e02,0x80));var _0x22e0=function(_0x1dfebf,_0x1d6791){_0x1dfebf=_0x1dfebf-0x0;var _0x5ec3fe=_0x2e02[_0x1dfebf];return _0x5ec3fe;};'use strict';var EventEmitter=require(_0x22e0('0x0'));var ChatInternalMessage=require(_0x22e0('0x1'))['db'][_0x22e0('0x2')];var ChatInternalMessageEvents=new EventEmitter();ChatInternalMessageEvents[_0x22e0('0x3')](0x0);var events={'afterCreate':_0x22e0('0x4'),'afterUpdate':_0x22e0('0x5'),'afterDestroy':_0x22e0('0x6')};function emitEvent(_0x55a73c){return function(_0x55307a,_0x31163b,_0x4aee8f){ChatInternalMessageEvents[_0x22e0('0x7')](_0x55a73c+':'+_0x55307a['id'],_0x55307a);ChatInternalMessageEvents[_0x22e0('0x7')](_0x55a73c,_0x55307a);_0x4aee8f(null);};}for(var e in events){if(events[_0x22e0('0x8')](e)){var event=events[e];ChatInternalMessage[_0x22e0('0x9')](e,emitEvent(event));}}module[_0x22e0('0xa')]=ChatInternalMessageEvents;
\ No newline at end of file
+var _0x9ed0=['remove','emit','hasOwnProperty','hook','exports','events','../../mysqldb','ChatInternalMessage','setMaxListeners','save','update'];(function(_0x28c113,_0x4ec34e){var _0x2ae159=function(_0x1d3c38){while(--_0x1d3c38){_0x28c113['push'](_0x28c113['shift']());}};_0x2ae159(++_0x4ec34e);}(_0x9ed0,0xe1));var _0x09ed=function(_0x12a04a,_0x4e3d1a){_0x12a04a=_0x12a04a-0x0;var _0x6d5409=_0x9ed0[_0x12a04a];return _0x6d5409;};'use strict';var EventEmitter=require(_0x09ed('0x0'));var ChatInternalMessage=require(_0x09ed('0x1'))['db'][_0x09ed('0x2')];var ChatInternalMessageEvents=new EventEmitter();ChatInternalMessageEvents[_0x09ed('0x3')](0x0);var events={'afterCreate':_0x09ed('0x4'),'afterUpdate':_0x09ed('0x5'),'afterDestroy':_0x09ed('0x6')};function emitEvent(_0x122fd6){return function(_0x5d38dc,_0x10da4,_0x1ed605){ChatInternalMessageEvents[_0x09ed('0x7')](_0x122fd6+':'+_0x5d38dc['id'],_0x5d38dc);ChatInternalMessageEvents[_0x09ed('0x7')](_0x122fd6,_0x5d38dc);_0x1ed605(null);};}for(var e in events){if(events[_0x09ed('0x8')](e)){var event=events[e];ChatInternalMessage[_0x09ed('0x9')](e,emitEvent(event));}}module[_0x09ed('0xa')]=ChatInternalMessageEvents;
\ No newline at end of file
diff --git a/server/api/chatInternalMessage/chatInternalMessage.model.js b/server/api/chatInternalMessage/chatInternalMessage.model.js
index 85eb0b7..cfa18ca 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 _0x533a=['chat_internal_messages','lodash','bluebird','request-promise','exports','define','ChatInternalMessage'];(function(_0x3cb09b,_0x31c2a5){var _0x242048=function(_0x464aba){while(--_0x464aba){_0x3cb09b['push'](_0x3cb09b['shift']());}};_0x242048(++_0x31c2a5);}(_0x533a,0x158));var _0xa533=function(_0x4b366e,_0x479e1f){_0x4b366e=_0x4b366e-0x0;var _0x464dff=_0x533a[_0x4b366e];return _0x464dff;};'use strict';var _=require(_0xa533('0x0'));var util=require('util');var logger=require('../../config/logger')('api');var moment=require('moment');var BPromise=require(_0xa533('0x1'));var rp=require(_0xa533('0x2'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require('./chatInternalMessage.attributes');module[_0xa533('0x3')]=function(_0x1ce5f9,_0x5735c0){return _0x1ce5f9[_0xa533('0x4')](_0xa533('0x5'),attributes,{'tableName':_0xa533('0x6'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':'utf8mb4','collate':'utf8mb4_unicode_ci'});};
\ No newline at end of file
+var _0xb1b9=['lodash','util','api','moment','bluebird','request-promise','path','rimraf','./chatInternalMessage.attributes','exports','define','ChatInternalMessage'];(function(_0x49068b,_0x21c5a6){var _0x335c1c=function(_0x390f33){while(--_0x390f33){_0x49068b['push'](_0x49068b['shift']());}};_0x335c1c(++_0x21c5a6);}(_0xb1b9,0x90));var _0x9b1b=function(_0x5935ed,_0x28af81){_0x5935ed=_0x5935ed-0x0;var _0x2fbc13=_0xb1b9[_0x5935ed];return _0x2fbc13;};'use strict';var _=require(_0x9b1b('0x0'));var util=require(_0x9b1b('0x1'));var logger=require('../../config/logger')(_0x9b1b('0x2'));var moment=require(_0x9b1b('0x3'));var BPromise=require(_0x9b1b('0x4'));var rp=require(_0x9b1b('0x5'));var fs=require('fs');var path=require(_0x9b1b('0x6'));var rimraf=require(_0x9b1b('0x7'));var config=require('../../config/environment');var attributes=require(_0x9b1b('0x8'));module[_0x9b1b('0x9')]=function(_0x469cc1,_0x3147f3){return _0x469cc1[_0x9b1b('0xa')](_0x9b1b('0xb'),attributes,{'tableName':'chat_internal_messages','paranoid':![],'indexes':[],'timestamps':!![],'charset':'utf8mb4','collate':'utf8mb4_unicode_ci'});};
\ No newline at end of file
diff --git a/server/api/chatInternalMessage/chatInternalMessage.rpc.js b/server/api/chatInternalMessage/chatInternalMessage.rpc.js
index e9c64a5..67f231d 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 _0x4286=['defaults','localhost','socket.io-emitter','./chatInternalMessage.socket','register','then','info','ChatInternalMessage,\x20%s,\x20%s','request\x20sent','debug','ChatInternalMessage,\x20%s,\x20%s,\x20%s','error','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x4286,0xbd));var _0x6428=function(_0xcd4829,_0x356874){_0xcd4829=_0xcd4829-0x0;var _0x5ae938=_0x4286[_0xcd4829];return _0x5ae938;};'use strict';var _=require(_0x6428('0x0'));var util=require(_0x6428('0x1'));var moment=require(_0x6428('0x2'));var BPromise=require(_0x6428('0x3'));var rs=require(_0x6428('0x4'));var fs=require('fs');var Redis=require(_0x6428('0x5'));var db=require(_0x6428('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0x6428('0x7'))(_0x6428('0x8'));var config=require(_0x6428('0x9'));var jayson=require(_0x6428('0xa'));var client=jayson[_0x6428('0xb')][_0x6428('0xc')]({'port':0x232a});config[_0x6428('0xd')]=_[_0x6428('0xe')](config[_0x6428('0xd')],{'host':_0x6428('0xf'),'port':0x18eb});var socket=require(_0x6428('0x10'))(new Redis(config['redis']));require(_0x6428('0x11'))[_0x6428('0x12')](socket);function respondWithRpcPromise(_0x132401,_0x58b02f,_0x12111b){return new BPromise(function(_0x548c2b,_0x19cc1c){return client['request'](_0x132401,_0x12111b)[_0x6428('0x13')](function(_0x180e21){logger[_0x6428('0x14')](_0x6428('0x15'),_0x58b02f,_0x6428('0x16'));logger[_0x6428('0x17')](_0x6428('0x18'),_0x58b02f,'request\x20sent',JSON['stringify'](_0x180e21));if(_0x180e21[_0x6428('0x19')]){if(_0x180e21[_0x6428('0x19')]['code']===0x1f4){logger[_0x6428('0x19')](_0x6428('0x15'),_0x58b02f,_0x180e21[_0x6428('0x19')][_0x6428('0x1a')]);return _0x19cc1c(_0x180e21[_0x6428('0x19')][_0x6428('0x1a')]);}logger[_0x6428('0x19')](_0x6428('0x15'),_0x58b02f,_0x180e21[_0x6428('0x19')][_0x6428('0x1a')]);return _0x548c2b(_0x180e21[_0x6428('0x19')][_0x6428('0x1a')]);}else{logger['info'](_0x6428('0x15'),_0x58b02f,_0x6428('0x16'));_0x548c2b(_0x180e21[_0x6428('0x1b')][_0x6428('0x1a')]);}})[_0x6428('0x1c')](function(_0x36eead){logger['error']('ChatInternalMessage,\x20%s,\x20%s',_0x58b02f,_0x36eead);_0x19cc1c(_0x36eead);});});}
\ No newline at end of file
+var _0x4b1d=['util','moment','bluebird','randomstring','ioredis','../../config/utils','rpc','../../config/environment','jayson/promise','client','redis','defaults','localhost','./chatInternalMessage.socket','register','request','then','ChatInternalMessage,\x20%s,\x20%s','debug','ChatInternalMessage,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','info','result','lodash'];(function(_0x58f65e,_0x467d61){var _0x35684b=function(_0x17cafe){while(--_0x17cafe){_0x58f65e['push'](_0x58f65e['shift']());}};_0x35684b(++_0x467d61);}(_0x4b1d,0x16b));var _0xd4b1=function(_0x23413d,_0x52a1da){_0x23413d=_0x23413d-0x0;var _0x211326=_0x4b1d[_0x23413d];return _0x211326;};'use strict';var _=require(_0xd4b1('0x0'));var util=require(_0xd4b1('0x1'));var moment=require(_0xd4b1('0x2'));var BPromise=require(_0xd4b1('0x3'));var rs=require(_0xd4b1('0x4'));var fs=require('fs');var Redis=require(_0xd4b1('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0xd4b1('0x6'));var logger=require('../../config/logger')(_0xd4b1('0x7'));var config=require(_0xd4b1('0x8'));var jayson=require(_0xd4b1('0x9'));var client=jayson[_0xd4b1('0xa')]['http']({'port':0x232a});config[_0xd4b1('0xb')]=_[_0xd4b1('0xc')](config['redis'],{'host':_0xd4b1('0xd'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xd4b1('0xb')]));require(_0xd4b1('0xe'))[_0xd4b1('0xf')](socket);function respondWithRpcPromise(_0xd4a6f2,_0x113f74,_0x1c5658){return new BPromise(function(_0x2d6af1,_0x18ad68){return client[_0xd4b1('0x10')](_0xd4a6f2,_0x1c5658)[_0xd4b1('0x11')](function(_0x858626){logger['info'](_0xd4b1('0x12'),_0x113f74,'request\x20sent');logger[_0xd4b1('0x13')](_0xd4b1('0x14'),_0x113f74,_0xd4b1('0x15'),JSON[_0xd4b1('0x16')](_0x858626));if(_0x858626[_0xd4b1('0x17')]){if(_0x858626[_0xd4b1('0x17')][_0xd4b1('0x18')]===0x1f4){logger['error'](_0xd4b1('0x12'),_0x113f74,_0x858626['error']['message']);return _0x18ad68(_0x858626[_0xd4b1('0x17')][_0xd4b1('0x19')]);}logger[_0xd4b1('0x17')]('ChatInternalMessage,\x20%s,\x20%s',_0x113f74,_0x858626['error']['message']);return _0x2d6af1(_0x858626[_0xd4b1('0x17')][_0xd4b1('0x19')]);}else{logger[_0xd4b1('0x1a')](_0xd4b1('0x12'),_0x113f74,_0xd4b1('0x15'));_0x2d6af1(_0x858626[_0xd4b1('0x1b')][_0xd4b1('0x19')]);}})['catch'](function(_0x495a40){logger[_0xd4b1('0x17')](_0xd4b1('0x12'),_0x113f74,_0x495a40);_0x18ad68(_0x495a40);});});}
\ No newline at end of file
diff --git a/server/api/chatInternalMessage/chatInternalMessage.socket.js b/server/api/chatInternalMessage/chatInternalMessage.socket.js
index eb87fad..3b5c05c 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 _0xb1bd=['update','emit','removeListener','register','chatInternalMessage:','./chatInternalMessage.events','remove'];(function(_0x110d73,_0x440105){var _0x8b4b26=function(_0x413104){while(--_0x413104){_0x110d73['push'](_0x110d73['shift']());}};_0x8b4b26(++_0x440105);}(_0xb1bd,0x1d3));var _0xdb1b=function(_0x4df10c,_0x17c4d8){_0x4df10c=_0x4df10c-0x0;var _0xf1e479=_0xb1bd[_0x4df10c];return _0xf1e479;};'use strict';var ChatInternalMessageEvents=require(_0xdb1b('0x0'));var events=['save',_0xdb1b('0x1'),_0xdb1b('0x2')];function createListener(_0x16bacf,_0xcf33a7){return function(_0x3ee9bf){_0xcf33a7[_0xdb1b('0x3')](_0x16bacf,_0x3ee9bf);};}function removeListener(_0x54375c,_0x4afeea){return function(){ChatInternalMessageEvents[_0xdb1b('0x4')](_0x54375c,_0x4afeea);};}exports[_0xdb1b('0x5')]=function(_0x2aee1e){for(var _0x5d19ff=0x0,_0x21717f=events['length'];_0x5d19ff<_0x21717f;_0x5d19ff++){var _0x6b5435=events[_0x5d19ff];var _0x26cba1=createListener(_0xdb1b('0x6')+_0x6b5435,_0x2aee1e);ChatInternalMessageEvents['on'](_0x6b5435,_0x26cba1);}};
\ No newline at end of file
+var _0xdc9d=['length','remove','update','emit','removeListener'];(function(_0x1d1779,_0x284147){var _0x2377e9=function(_0x299f6f){while(--_0x299f6f){_0x1d1779['push'](_0x1d1779['shift']());}};_0x2377e9(++_0x284147);}(_0xdc9d,0x1af));var _0xddc9=function(_0x130633,_0x232fc2){_0x130633=_0x130633-0x0;var _0x209d56=_0xdc9d[_0x130633];return _0x209d56;};'use strict';var ChatInternalMessageEvents=require('./chatInternalMessage.events');var events=['save',_0xddc9('0x0'),_0xddc9('0x1')];function createListener(_0x3ab928,_0x1c78c9){return function(_0x357b32){_0x1c78c9[_0xddc9('0x2')](_0x3ab928,_0x357b32);};}function removeListener(_0x4a4fec,_0x4bbc4a){return function(){ChatInternalMessageEvents[_0xddc9('0x3')](_0x4a4fec,_0x4bbc4a);};}exports['register']=function(_0x3dac48){for(var _0x33bc24=0x0,_0x2a2f0e=events[_0xddc9('0x4')];_0x33bc24<_0x2a2f0e;_0x33bc24++){var _0x54facf=events[_0x33bc24];var _0x3f14db=createListener('chatInternalMessage:'+_0x54facf,_0x3dac48);ChatInternalMessageEvents['on'](_0x54facf,_0x3f14db);}};
\ No newline at end of file
diff --git a/server/api/chatInternalMessage/index.js b/server/api/chatInternalMessage/index.js
index 53671a1..662b42a 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 _0x8c54=['multer','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/describe','describe','/users','post','create','put','update','delete','/:id','destroy','exports'];(function(_0x5ca81d,_0x498baf){var _0x4b0a59=function(_0x107dc9){while(--_0x107dc9){_0x5ca81d['push'](_0x5ca81d['shift']());}};_0x4b0a59(++_0x498baf);}(_0x8c54,0xb8));var _0x48c5=function(_0x189ce7,_0x279721){_0x189ce7=_0x189ce7-0x0;var _0x2c5622=_0x8c54[_0x189ce7];return _0x2c5622;};'use strict';var multer=require(_0x48c5('0x0'));var util=require(_0x48c5('0x1'));var path=require(_0x48c5('0x2'));var timeout=require(_0x48c5('0x3'));var express=require('express');var router=express[_0x48c5('0x4')]();var fs_extra=require(_0x48c5('0x5'));var auth=require(_0x48c5('0x6'));var interaction=require(_0x48c5('0x7'));var config=require(_0x48c5('0x8'));var controller=require('./chatInternalMessage.controller');router[_0x48c5('0x9')]('/',auth[_0x48c5('0xa')](),controller[_0x48c5('0xb')]);router[_0x48c5('0x9')](_0x48c5('0xc'),auth[_0x48c5('0xa')](),controller[_0x48c5('0xd')]);router[_0x48c5('0x9')](_0x48c5('0xe'),auth[_0x48c5('0xa')](),controller['getUsers']);router[_0x48c5('0x9')]('/:id',auth['isAuthenticated'](),controller['show']);router[_0x48c5('0xf')]('/',auth[_0x48c5('0xa')](),controller[_0x48c5('0x10')]);router[_0x48c5('0x11')]('/:id',controller[_0x48c5('0x12')]);router[_0x48c5('0x13')](_0x48c5('0x14'),auth['isAuthenticated'](),controller[_0x48c5('0x15')]);module[_0x48c5('0x16')]=router;
\ No newline at end of file
+var _0x6a5d=['getUsers','show','post','create','put','/:id','update','delete','destroy','exports','multer','util','connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment','get','/describe','/users','isAuthenticated'];(function(_0x45346d,_0xffd56b){var _0x5ce7ca=function(_0x27ce87){while(--_0x27ce87){_0x45346d['push'](_0x45346d['shift']());}};_0x5ce7ca(++_0xffd56b);}(_0x6a5d,0xd0));var _0xd6a5=function(_0x60111d,_0x24f2a7){_0x60111d=_0x60111d-0x0;var _0x8589f1=_0x6a5d[_0x60111d];return _0x8589f1;};'use strict';var multer=require(_0xd6a5('0x0'));var util=require(_0xd6a5('0x1'));var path=require('path');var timeout=require(_0xd6a5('0x2'));var express=require(_0xd6a5('0x3'));var router=express[_0xd6a5('0x4')]();var fs_extra=require(_0xd6a5('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0xd6a5('0x6'));var config=require(_0xd6a5('0x7'));var controller=require('./chatInternalMessage.controller');router[_0xd6a5('0x8')]('/',auth['isAuthenticated'](),controller['index']);router['get'](_0xd6a5('0x9'),auth['isAuthenticated'](),controller['describe']);router[_0xd6a5('0x8')](_0xd6a5('0xa'),auth[_0xd6a5('0xb')](),controller[_0xd6a5('0xc')]);router[_0xd6a5('0x8')]('/:id',auth[_0xd6a5('0xb')](),controller[_0xd6a5('0xd')]);router[_0xd6a5('0xe')]('/',auth[_0xd6a5('0xb')](),controller[_0xd6a5('0xf')]);router[_0xd6a5('0x10')](_0xd6a5('0x11'),controller[_0xd6a5('0x12')]);router[_0xd6a5('0x13')](_0xd6a5('0x11'),auth[_0xd6a5('0xb')](),controller[_0xd6a5('0x14')]);module[_0xd6a5('0x15')]=router;
\ No newline at end of file
diff --git a/server/api/chatMessage/chatMessage.attributes.js b/server/api/chatMessage/chatMessage.attributes.js
index f26d9ec..c0fc6ae 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 _0x0c71=['medium','BOOLEAN','out','STRING','TEXT','exports'];(function(_0x233cb1,_0x8ca9a2){var _0x29ee7e=function(_0x20e277){while(--_0x20e277){_0x233cb1['push'](_0x233cb1['shift']());}};_0x29ee7e(++_0x8ca9a2);}(_0x0c71,0xfb));var _0x10c7=function(_0x4c87fd,_0x5863a6){_0x4c87fd=_0x4c87fd-0x0;var _0x1d4178=_0x0c71[_0x4c87fd];return _0x1d4178;};'use strict';var Sequelize=require('sequelize');module[_0x10c7('0x0')]={'body':{'type':Sequelize['TEXT'](_0x10c7('0x1')),'allowNull':![]},'read':{'type':Sequelize[_0x10c7('0x2')],'defaultValue':![]},'secret':{'type':Sequelize[_0x10c7('0x2')],'defaultValue':![]},'direction':{'type':Sequelize['ENUM']('in','out'),'defaultValue':_0x10c7('0x3'),'allowNull':![]},'readAt':{'type':Sequelize['DATE']},'providerName':{'type':Sequelize[_0x10c7('0x4')]},'providerResponse':{'type':Sequelize[_0x10c7('0x5')]}};
\ No newline at end of file
+var _0x5ea2=['ENUM','out','DATE','sequelize','medium','BOOLEAN'];(function(_0x5ae8f7,_0x330d91){var _0x54c636=function(_0x173188){while(--_0x173188){_0x5ae8f7['push'](_0x5ae8f7['shift']());}};_0x54c636(++_0x330d91);}(_0x5ea2,0x99));var _0x25ea=function(_0x4706f0,_0x30243c){_0x4706f0=_0x4706f0-0x0;var _0x139a13=_0x5ea2[_0x4706f0];return _0x139a13;};'use strict';var Sequelize=require(_0x25ea('0x0'));module['exports']={'body':{'type':Sequelize['TEXT'](_0x25ea('0x1')),'allowNull':![]},'read':{'type':Sequelize[_0x25ea('0x2')],'defaultValue':![]},'secret':{'type':Sequelize[_0x25ea('0x2')],'defaultValue':![]},'direction':{'type':Sequelize[_0x25ea('0x3')]('in',_0x25ea('0x4')),'defaultValue':'out','allowNull':![]},'readAt':{'type':Sequelize[_0x25ea('0x5')]},'providerName':{'type':Sequelize['STRING']},'providerResponse':{'type':Sequelize['TEXT']}};
\ No newline at end of file
diff --git a/server/api/chatMessage/chatMessage.controller.js b/server/api/chatMessage/chatMessage.controller.js
index 8cc4939..a2c1670 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 _0xb598=['status','end','json','undefined','limit','count','offset','set','apply','save','update','then','name','send','index','map','ChatMessage','rawAttributes','fieldName','type','key','model','query','filters','intersection','attributes','fields','hasOwnProperty','sort','where','pick','filter','merge','options','includeAll','include','findAll','rows','show','params','keys','find','create','body','describe','chat-interactions','chat','read','readAt','format','UserId','agent','get','ChatInteractionId','isNil','YYYY-MM-DD\x20HH:mm:ss','interaction','[CHATMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','user','null','AcceptMessage','acceptMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','ContactId','Sequelize','QueryTypes','SELECT','User','fullname','email','internal','manual','interface','channel','event','accept','EventManager','acceptmessage','parse','formData','[CHATMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','RejectMessage','rejectMessage','contact','SIP/%s','motionChannel','reject','rejectmessage','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','localhost','socket.io-emitter','./chatMessage.socket','register','jayson/promise','client','http','request','info','request\x20sent','debug','ChatMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','ChatMessage,\x20%s,\x20%s','message','result','catch','sendStatus'];(function(_0x5aeedc,_0x4a43ec){var _0x2645b2=function(_0x1e01af){while(--_0x1e01af){_0x5aeedc['push'](_0x5aeedc['shift']());}};_0x2645b2(++_0x4a43ec);}(_0xb598,0x168));var _0x8b59=function(_0x357930,_0x29c90d){_0x357930=_0x357930-0x0;var _0x7abbce=_0xb598[_0x357930];return _0x7abbce;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x8b59('0x0'));var jsonpatch=require(_0x8b59('0x1'));var rp=require(_0x8b59('0x2'));var moment=require(_0x8b59('0x3'));var BPromise=require(_0x8b59('0x4'));var Mustache=require(_0x8b59('0x5'));var util=require(_0x8b59('0x6'));var path=require(_0x8b59('0x7'));var sox=require(_0x8b59('0x8'));var csv=require(_0x8b59('0x9'));var ejs=require(_0x8b59('0xa'));var fs=require('fs');var fs_extra=require(_0x8b59('0xb'));var _=require(_0x8b59('0xc'));var squel=require('squel');var crypto=require(_0x8b59('0xd'));var jsforce=require(_0x8b59('0xe'));var deskjs=require(_0x8b59('0xf'));var toCsv=require(_0x8b59('0x9'));var querystring=require(_0x8b59('0x10'));var Papa=require('papaparse');var Redis=require(_0x8b59('0x11'));var authService=require(_0x8b59('0x12'));var qs=require('../../components/parsers/qs');var as=require(_0x8b59('0x13'));var hardwareService=require(_0x8b59('0x14'));var logger=require(_0x8b59('0x15'))(_0x8b59('0x16'));var utils=require(_0x8b59('0x17'));var config=require(_0x8b59('0x18'));var licenseUtil=require(_0x8b59('0x19'));var db=require(_0x8b59('0x1a'))['db'];config[_0x8b59('0x1b')]=_['defaults'](config['redis'],{'host':_0x8b59('0x1c'),'port':0x18eb});var socket=require(_0x8b59('0x1d'))(new Redis(config[_0x8b59('0x1b')]));require(_0x8b59('0x1e'))[_0x8b59('0x1f')](socket);var jayson=require(_0x8b59('0x20'));var client=jayson[_0x8b59('0x21')][_0x8b59('0x22')]({'port':0x232c});var client9002=jayson[_0x8b59('0x21')][_0x8b59('0x22')]({'port':0x232a});function respondWithRpcPromise(_0x5a3b73,_0x219c3f,_0x4888f2,_0x2147e0){return new BPromise(function(_0x473a8f,_0x49f196){var _0x5defdf=_0x2147e0||client;return _0x5defdf[_0x8b59('0x23')](_0x5a3b73,_0x4888f2)['then'](function(_0x2a1bb8){logger[_0x8b59('0x24')]('ChatMessage,\x20%s,\x20%s',_0x219c3f,_0x8b59('0x25'));logger[_0x8b59('0x26')](_0x8b59('0x27'),_0x219c3f,_0x8b59('0x25'),JSON[_0x8b59('0x28')](_0x2a1bb8));if(_0x2a1bb8['error']){if(_0x2a1bb8[_0x8b59('0x29')][_0x8b59('0x2a')]===0x1f4){logger[_0x8b59('0x29')](_0x8b59('0x2b'),_0x219c3f,_0x2a1bb8['error'][_0x8b59('0x2c')]);return _0x49f196(_0x2a1bb8[_0x8b59('0x29')][_0x8b59('0x2c')]);}logger[_0x8b59('0x29')]('ChatMessage,\x20%s,\x20%s',_0x219c3f,_0x2a1bb8[_0x8b59('0x29')][_0x8b59('0x2c')]);return _0x473a8f(_0x2a1bb8['error'][_0x8b59('0x2c')]);}else{logger[_0x8b59('0x24')](_0x8b59('0x2b'),_0x219c3f,_0x8b59('0x25'));_0x473a8f(_0x2a1bb8[_0x8b59('0x2d')][_0x8b59('0x2c')]);}})[_0x8b59('0x2e')](function(_0x1c1bc3){logger['error'](_0x8b59('0x2b'),_0x219c3f,_0x1c1bc3);_0x49f196(_0x1c1bc3);});});}function respondWithStatusCode(_0x186272,_0x93e5b3){_0x93e5b3=_0x93e5b3||0xcc;return function(_0x488cec){if(_0x488cec){return _0x186272[_0x8b59('0x2f')](_0x93e5b3);}return _0x186272[_0x8b59('0x30')](_0x93e5b3)[_0x8b59('0x31')]();};}function respondWithResult(_0x2bf48f,_0x94730f){_0x94730f=_0x94730f||0xc8;return function(_0x549fbf){if(_0x549fbf){return _0x2bf48f[_0x8b59('0x30')](_0x94730f)[_0x8b59('0x32')](_0x549fbf);}};}function respondWithFilteredResult(_0x211bc7,_0x16f7bf){return function(_0x4a4d88){if(_0x4a4d88){var _0x23f175=typeof _0x16f7bf['offset']===_0x8b59('0x33')&&typeof _0x16f7bf[_0x8b59('0x34')]===_0x8b59('0x33');var _0x5cd87c=_0x4a4d88[_0x8b59('0x35')];var _0xfbb542=_0x23f175?0x0:_0x16f7bf[_0x8b59('0x36')];var _0x290f85=_0x23f175?_0x4a4d88['count']:_0x16f7bf[_0x8b59('0x36')]+_0x16f7bf[_0x8b59('0x34')];var _0x2bb12a;if(_0x290f85>=_0x5cd87c){_0x290f85=_0x5cd87c;_0x2bb12a=0xc8;}else{_0x2bb12a=0xce;}_0x211bc7[_0x8b59('0x30')](_0x2bb12a);return _0x211bc7[_0x8b59('0x37')]('Content-Range',_0xfbb542+'-'+_0x290f85+'/'+_0x5cd87c)[_0x8b59('0x32')](_0x4a4d88);}return null;};}function patchUpdates(_0x38e1f8){return function(_0x481700){try{jsonpatch[_0x8b59('0x38')](_0x481700,_0x38e1f8,!![]);}catch(_0x32c0a4){return BPromise['reject'](_0x32c0a4);}return _0x481700[_0x8b59('0x39')]();};}function saveUpdates(_0x1fd3e1,_0x5e019e){return function(_0x3bea9e){if(_0x3bea9e){return _0x3bea9e[_0x8b59('0x3a')](_0x1fd3e1)['then'](function(_0x215420){return _0x215420;});}return null;};}function removeEntity(_0x1ed92b,_0x1c7652){return function(_0x11a2f6){if(_0x11a2f6){return _0x11a2f6['destroy']()[_0x8b59('0x3b')](function(){_0x1ed92b[_0x8b59('0x30')](0xcc)[_0x8b59('0x31')]();});}};}function handleEntityNotFound(_0x595057,_0x38b7b8){return function(_0x51fbf1){if(!_0x51fbf1){_0x595057[_0x8b59('0x2f')](0x194);}return _0x51fbf1;};}function handleError(_0x37c772,_0x90f0b7){_0x90f0b7=_0x90f0b7||0x1f4;return function(_0x48d7f7){logger[_0x8b59('0x29')](_0x48d7f7['stack']);if(_0x48d7f7[_0x8b59('0x3c')]){delete _0x48d7f7[_0x8b59('0x3c')];}_0x37c772['status'](_0x90f0b7)[_0x8b59('0x3d')](_0x48d7f7);};}exports[_0x8b59('0x3e')]=function(_0x3fbbb0,_0x20662b){var _0x38cb38={},_0x385e6e={},_0x5c4e3a={'count':0x0,'rows':[]};var _0x5237e9=_[_0x8b59('0x3f')](db[_0x8b59('0x40')][_0x8b59('0x41')],function(_0xf42b1e){return{'name':_0xf42b1e[_0x8b59('0x42')],'type':_0xf42b1e[_0x8b59('0x43')][_0x8b59('0x44')]};});_0x385e6e[_0x8b59('0x45')]=_[_0x8b59('0x3f')](_0x5237e9,_0x8b59('0x3c'));_0x385e6e[_0x8b59('0x46')]=_['keys'](_0x3fbbb0['query']);_0x385e6e[_0x8b59('0x47')]=_[_0x8b59('0x48')](_0x385e6e[_0x8b59('0x45')],_0x385e6e[_0x8b59('0x46')]);_0x38cb38[_0x8b59('0x49')]=_['intersection'](_0x385e6e['model'],qs[_0x8b59('0x4a')](_0x3fbbb0[_0x8b59('0x46')]['fields']));_0x38cb38['attributes']=_0x38cb38[_0x8b59('0x49')]['length']?_0x38cb38['attributes']:_0x385e6e[_0x8b59('0x45')];if(!_0x3fbbb0['query'][_0x8b59('0x4b')]('nolimit')){_0x38cb38[_0x8b59('0x34')]=qs[_0x8b59('0x34')](_0x3fbbb0['query'][_0x8b59('0x34')]);_0x38cb38[_0x8b59('0x36')]=qs[_0x8b59('0x36')](_0x3fbbb0['query']['offset']);}_0x38cb38['order']=qs[_0x8b59('0x4c')](_0x3fbbb0[_0x8b59('0x46')][_0x8b59('0x4c')]);_0x38cb38[_0x8b59('0x4d')]=qs[_0x8b59('0x47')](_[_0x8b59('0x4e')](_0x3fbbb0[_0x8b59('0x46')],_0x385e6e['filters']),_0x5237e9);if(_0x3fbbb0[_0x8b59('0x46')][_0x8b59('0x4f')]){_0x38cb38[_0x8b59('0x4d')]=_[_0x8b59('0x50')](_0x38cb38[_0x8b59('0x4d')],{'$or':_[_0x8b59('0x3f')](_0x5237e9,function(_0x33b3c7){if(_0x33b3c7[_0x8b59('0x43')]!=='VIRTUAL'){var _0x1a71cb={};_0x1a71cb[_0x33b3c7[_0x8b59('0x3c')]]={'$like':'%'+_0x3fbbb0['query'][_0x8b59('0x4f')]+'%'};return _0x1a71cb;}})});}_0x38cb38=_[_0x8b59('0x50')]({},_0x38cb38,_0x3fbbb0[_0x8b59('0x51')]);var _0x5d634d={'where':_0x38cb38['where']};return db['ChatMessage']['count'](_0x5d634d)[_0x8b59('0x3b')](function(_0x492e18){_0x5c4e3a[_0x8b59('0x35')]=_0x492e18;if(_0x3fbbb0[_0x8b59('0x46')][_0x8b59('0x52')]){_0x38cb38[_0x8b59('0x53')]=[{'all':!![]}];}return db['ChatMessage'][_0x8b59('0x54')](_0x38cb38);})[_0x8b59('0x3b')](function(_0x5ac391){_0x5c4e3a[_0x8b59('0x55')]=_0x5ac391;return _0x5c4e3a;})[_0x8b59('0x3b')](respondWithFilteredResult(_0x20662b,_0x38cb38))[_0x8b59('0x2e')](handleError(_0x20662b,null));};exports[_0x8b59('0x56')]=function(_0x1fe64b,_0x3d04ec){var _0xc74b00={'raw':!![],'where':{'id':_0x1fe64b[_0x8b59('0x57')]['id']}},_0x201de7={};_0x201de7[_0x8b59('0x45')]=_[_0x8b59('0x58')](db['ChatMessage'][_0x8b59('0x41')]);_0x201de7['query']=_['keys'](_0x1fe64b[_0x8b59('0x46')]);_0x201de7[_0x8b59('0x47')]=_[_0x8b59('0x48')](_0x201de7[_0x8b59('0x45')],_0x201de7[_0x8b59('0x46')]);_0xc74b00[_0x8b59('0x49')]=_[_0x8b59('0x48')](_0x201de7[_0x8b59('0x45')],qs[_0x8b59('0x4a')](_0x1fe64b['query']['fields']));_0xc74b00[_0x8b59('0x49')]=_0xc74b00[_0x8b59('0x49')]['length']?_0xc74b00[_0x8b59('0x49')]:_0x201de7[_0x8b59('0x45')];if(_0x1fe64b['query'][_0x8b59('0x52')]){_0xc74b00[_0x8b59('0x53')]=[{'all':!![]}];}_0xc74b00=_['merge']({},_0xc74b00,_0x1fe64b['options']);return db[_0x8b59('0x40')][_0x8b59('0x59')](_0xc74b00)[_0x8b59('0x3b')](handleEntityNotFound(_0x3d04ec,null))['then'](respondWithResult(_0x3d04ec,null))['catch'](handleError(_0x3d04ec,null));};exports[_0x8b59('0x5a')]=function(_0x1a7074,_0x3b8513){return db[_0x8b59('0x40')]['create'](_0x1a7074[_0x8b59('0x5b')],{})[_0x8b59('0x3b')](respondWithResult(_0x3b8513,0xc9))[_0x8b59('0x2e')](handleError(_0x3b8513,null));};exports['update']=function(_0xfcff6e,_0x3533c2){if(_0xfcff6e[_0x8b59('0x5b')]['id']){delete _0xfcff6e[_0x8b59('0x5b')]['id'];}return db[_0x8b59('0x40')][_0x8b59('0x59')]({'where':{'id':_0xfcff6e[_0x8b59('0x57')]['id']}})[_0x8b59('0x3b')](handleEntityNotFound(_0x3533c2,null))[_0x8b59('0x3b')](saveUpdates(_0xfcff6e[_0x8b59('0x5b')],null))[_0x8b59('0x3b')](respondWithResult(_0x3533c2,null))['catch'](handleError(_0x3533c2,null));};exports['destroy']=function(_0x53c490,_0x543008){return db[_0x8b59('0x40')]['find']({'where':{'id':_0x53c490['params']['id']}})[_0x8b59('0x3b')](handleEntityNotFound(_0x543008,null))[_0x8b59('0x3b')](removeEntity(_0x543008,null))[_0x8b59('0x2e')](handleError(_0x543008,null));};exports[_0x8b59('0x5c')]=function(_0x3f6730,_0x5dc468){return db['ChatMessage'][_0x8b59('0x5c')]()[_0x8b59('0x3b')](respondWithResult(_0x5dc468,null))['catch'](handleError(_0x5dc468,null));};var interaction_log=require(_0x8b59('0x15'))(_0x8b59('0x5d'));exports['accept']=function(_0x3dc0a7,_0x4ebeba,_0x57304e){var _0x269a9c={'agent':{},'channel':_0x8b59('0x5e')};if(_0x3dc0a7[_0x8b59('0x5b')]['id']){delete _0x3dc0a7[_0x8b59('0x5b')]['id'];}_0x3dc0a7[_0x8b59('0x5b')][_0x8b59('0x5f')]=!![];_0x3dc0a7[_0x8b59('0x5b')][_0x8b59('0x60')]=moment()[_0x8b59('0x61')]('YYYY-MM-DD\x20HH:mm:ss');_0x3dc0a7[_0x8b59('0x5b')][_0x8b59('0x62')]=_0x3dc0a7[_0x8b59('0x5b')][_0x8b59('0x62')]||_0x3dc0a7['user']['id'];_0x269a9c[_0x8b59('0x63')]['id']=_0x3dc0a7[_0x8b59('0x5b')][_0x8b59('0x62')];return db['ChatMessage'][_0x8b59('0x59')]({'where':{'id':_0x3dc0a7[_0x8b59('0x57')]['id'],'UserId':null}})[_0x8b59('0x3b')](handleEntityNotFound(_0x4ebeba,null))[_0x8b59('0x3b')](saveUpdates(_0x3dc0a7[_0x8b59('0x5b')],null))[_0x8b59('0x3b')](function(_0x586da6){if(_0x586da6){_0x269a9c[_0x8b59('0x2c')]=_0x586da6[_0x8b59('0x64')]({'plain':!![]});return db['ChatInteraction']['find']({'where':{'id':_0x586da6[_0x8b59('0x65')]}});}return null;})['then'](handleEntityNotFound(_0x4ebeba,null))[_0x8b59('0x3b')](function(_0x5f706b){if(_0x5f706b){return _0x5f706b['update']({'UserId':_0x3dc0a7['body'][_0x8b59('0x62')],'read1stAt':_[_0x8b59('0x66')](_0x5f706b['read1stAt'])?moment()[_0x8b59('0x61')](_0x8b59('0x67')):undefined});}return null;})[_0x8b59('0x3b')](function(_0x7651af){if(_0x7651af){_0x269a9c[_0x8b59('0x68')]=_0x7651af[_0x8b59('0x64')]({'plain':!![]});interaction_log[_0x8b59('0x24')](_0x8b59('0x69'),_0x3dc0a7[_0x8b59('0x6a')]['id'],_0x3dc0a7[_0x8b59('0x6a')][_0x8b59('0x3c')],_0x3dc0a7[_0x8b59('0x6a')]['role'],_0x269a9c[_0x8b59('0x68')]['id'],_0x3dc0a7[_0x8b59('0x5b')]?JSON[_0x8b59('0x28')](_0x3dc0a7[_0x8b59('0x5b')]):_0x8b59('0x6b'));return respondWithRpcPromise(_0x8b59('0x6c'),_0x8b59('0x6d'),_0x269a9c);}return null;})[_0x8b59('0x3b')](function(_0x41ba75){var _0x34df3f=_0x8b59('0x6e')+_0x41ba75[_0x8b59('0x2c')][_0x8b59('0x6f')];return db['sequelize']['query'](_0x34df3f,{'type':db[_0x8b59('0x70')][_0x8b59('0x71')][_0x8b59('0x72')],'raw':!![]})[_0x8b59('0x3b')](function(_0x3dda1b){return _0x3dda1b;});})[_0x8b59('0x3b')](function(_0x18cd0f){if(_0x18cd0f){_0x269a9c['message']['contact']=_0x18cd0f[0x0];if(!_0x3dc0a7[_0x8b59('0x5b')][_0x8b59('0x62')])return;return db[_0x8b59('0x73')][_0x8b59('0x59')]({'where':{'id':_0x3dc0a7[_0x8b59('0x5b')][_0x8b59('0x62')],'role':_0x8b59('0x63')},'attributes':['id',_0x8b59('0x3c'),_0x8b59('0x74'),_0x8b59('0x75'),_0x8b59('0x76')],'raw':!![]});}return null;})[_0x8b59('0x3b')](function(_0x23df88){if(!_0x23df88)return null;_0x269a9c['message'][_0x8b59('0x63')]=_0x23df88;return _0x269a9c;})[_0x8b59('0x3b')](function(_0x5571b3){if(_0x5571b3){if(_0x3dc0a7[_0x8b59('0x5b')][_0x8b59('0x77')]){_0x269a9c[_0x8b59('0x2c')][_0x8b59('0x78')]=util[_0x8b59('0x61')]('SIP/%s',_0x3dc0a7['user'][_0x8b59('0x3c')]);_0x269a9c[_0x8b59('0x2c')][_0x8b59('0x79')]=_0x269a9c[_0x8b59('0x79')];_0x269a9c['message']['motionChannel']=_0x269a9c['channel'];_0x269a9c[_0x8b59('0x2c')][_0x8b59('0x7a')]=_0x8b59('0x7b');return respondWithRpcPromise(_0x8b59('0x7c'),_0x8b59('0x7c'),{'event':_0x8b59('0x7d'),'message':_['merge'](_0x269a9c[_0x8b59('0x2c')],JSON[_0x8b59('0x7e')](_0x269a9c[_0x8b59('0x68')][_0x8b59('0x7f')]))},client9002)[_0x8b59('0x3b')](function(){return _0x269a9c;});}return _0x269a9c;}return null;})[_0x8b59('0x3b')](respondWithResult(_0x4ebeba,null))[_0x8b59('0x2e')](handleError(_0x4ebeba,null));};var interaction_log=require(_0x8b59('0x15'))(_0x8b59('0x5d'));exports['reject']=function(_0x34a3c2,_0x8f76fd,_0x1eff05){var _0x56d0da={'agent':{},'channel':_0x8b59('0x5e')};if(_0x34a3c2['body']['id']){delete _0x34a3c2[_0x8b59('0x5b')]['id'];}_0x34a3c2['body'][_0x8b59('0x62')]=_0x34a3c2[_0x8b59('0x5b')][_0x8b59('0x62')]||_0x34a3c2[_0x8b59('0x6a')]['id'];_0x56d0da[_0x8b59('0x63')]['id']=_0x34a3c2[_0x8b59('0x5b')][_0x8b59('0x62')];return db[_0x8b59('0x40')][_0x8b59('0x59')]({'where':{'id':_0x34a3c2['params']['id'],'UserId':null}})[_0x8b59('0x3b')](handleEntityNotFound(_0x8f76fd,null))['then'](function(_0x193c31){if(_0x193c31){_0x56d0da['message']=_0x193c31['get']({'plain':!![]});return db['ChatInteraction']['find']({'where':{'id':_0x193c31[_0x8b59('0x65')]}});}return null;})[_0x8b59('0x3b')](handleEntityNotFound(_0x8f76fd,null))[_0x8b59('0x3b')](function(_0x317c5a){if(_0x317c5a){_0x56d0da[_0x8b59('0x68')]=_0x317c5a['get']({'plain':!![]});interaction_log['info'](_0x8b59('0x80'),_0x34a3c2[_0x8b59('0x6a')]['id'],_0x34a3c2[_0x8b59('0x6a')][_0x8b59('0x3c')],_0x34a3c2[_0x8b59('0x6a')]['role'],_0x56d0da[_0x8b59('0x68')]['id'],_0x34a3c2[_0x8b59('0x5b')]?JSON[_0x8b59('0x28')](_0x34a3c2[_0x8b59('0x5b')]):_0x8b59('0x6b'));return respondWithRpcPromise(_0x8b59('0x81'),_0x8b59('0x82'),_0x56d0da);}return null;})[_0x8b59('0x3b')](function(_0x25af11){var _0x329eb3=_0x8b59('0x6e')+_0x25af11[_0x8b59('0x2c')][_0x8b59('0x6f')];return db['sequelize'][_0x8b59('0x46')](_0x329eb3,{'type':db[_0x8b59('0x70')][_0x8b59('0x71')][_0x8b59('0x72')],'raw':!![]})['then'](function(_0x574924){return _0x574924;});})[_0x8b59('0x3b')](function(_0x555a45){if(_0x555a45){_0x56d0da[_0x8b59('0x2c')][_0x8b59('0x83')]=_0x555a45[0x0];if(!_0x34a3c2[_0x8b59('0x5b')][_0x8b59('0x62')])return;return db['User'][_0x8b59('0x59')]({'where':{'id':_0x34a3c2[_0x8b59('0x5b')][_0x8b59('0x62')],'role':_0x8b59('0x63')},'attributes':['id','name',_0x8b59('0x74'),'email','internal'],'raw':!![]});}return null;})[_0x8b59('0x3b')](function(_0x48dd24){if(!_0x48dd24)return null;_0x56d0da[_0x8b59('0x2c')][_0x8b59('0x63')]=_0x48dd24;return _0x56d0da;})[_0x8b59('0x3b')](function(_0x5480a0){if(_0x5480a0){_0x5480a0[_0x8b59('0x2c')]['interface']=util[_0x8b59('0x61')](_0x8b59('0x84'),_0x34a3c2['user']['name']);_0x5480a0['message'][_0x8b59('0x79')]=_0x56d0da[_0x8b59('0x79')];_0x5480a0['message'][_0x8b59('0x85')]=_0x56d0da[_0x8b59('0x79')];_0x5480a0[_0x8b59('0x2c')]['event']=_0x8b59('0x86');respondWithRpcPromise(_0x8b59('0x7c'),'EventManager',{'event':_0x8b59('0x87'),'message':_['merge'](_0x56d0da[_0x8b59('0x2c')],JSON[_0x8b59('0x7e')](_0x56d0da[_0x8b59('0x68')][_0x8b59('0x7f')]))},client9002);return _0x56d0da;}return null;})[_0x8b59('0x3b')](respondWithResult(_0x8f76fd,null))[_0x8b59('0x2e')](handleError(_0x8f76fd,null));};
\ No newline at end of file
+var _0x0373=['null','acceptMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','ContactId','Sequelize','SELECT','contact','User','agent','email','interface','SIP/%s','channel','motionChannel','EventManager','acceptmessage','parse','chat','RejectMessage','rejectMessage','sequelize','QueryTypes','fullname','internal','event','rejectmessage','formData','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','ejs','fs-extra','squel','crypto','jsforce','desk.js','to-csv','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/utils','../../config/environment','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./chatMessage.socket','register','jayson/promise','http','client','then','ChatMessage,\x20%s,\x20%s','debug','ChatMessage,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','message','info','result','sendStatus','end','undefined','limit','offset','set','Content-Range','json','apply','reject','update','stack','name','status','send','index','map','ChatMessage','rawAttributes','fieldName','type','key','query','keys','filters','model','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','count','includeAll','include','findAll','rows','catch','show','params','options','find','create','body','destroy','describe','../../config/logger','chat-interactions','accept','read','format','YYYY-MM-DD\x20HH:mm:ss','UserId','user','get','ChatInteraction','ChatInteractionId','read1stAt','[CHATMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','role','interaction'];(function(_0x48e058,_0x4e4213){var _0x4df81a=function(_0xd989bb){while(--_0xd989bb){_0x48e058['push'](_0x48e058['shift']());}};_0x4df81a(++_0x4e4213);}(_0x0373,0x1c2));var _0x3037=function(_0x4dba2b,_0x4f2f25){_0x4dba2b=_0x4dba2b-0x0;var _0x4a3f5c=_0x0373[_0x4dba2b];return _0x4a3f5c;};'use strict';var emlformat=require(_0x3037('0x0'));var rimraf=require(_0x3037('0x1'));var zipdir=require(_0x3037('0x2'));var jsonpatch=require(_0x3037('0x3'));var rp=require(_0x3037('0x4'));var moment=require(_0x3037('0x5'));var BPromise=require(_0x3037('0x6'));var Mustache=require(_0x3037('0x7'));var util=require(_0x3037('0x8'));var path=require(_0x3037('0x9'));var sox=require(_0x3037('0xa'));var csv=require('to-csv');var ejs=require(_0x3037('0xb'));var fs=require('fs');var fs_extra=require(_0x3037('0xc'));var _=require('lodash');var squel=require(_0x3037('0xd'));var crypto=require(_0x3037('0xe'));var jsforce=require(_0x3037('0xf'));var deskjs=require(_0x3037('0x10'));var toCsv=require(_0x3037('0x11'));var querystring=require('querystring');var Papa=require(_0x3037('0x12'));var Redis=require(_0x3037('0x13'));var authService=require(_0x3037('0x14'));var qs=require(_0x3037('0x15'));var as=require(_0x3037('0x16'));var hardwareService=require(_0x3037('0x17'));var logger=require('../../config/logger')('api');var utils=require(_0x3037('0x18'));var config=require(_0x3037('0x19'));var licenseUtil=require('../../config/license/util');var db=require(_0x3037('0x1a'))['db'];config[_0x3037('0x1b')]=_[_0x3037('0x1c')](config[_0x3037('0x1b')],{'host':_0x3037('0x1d'),'port':0x18eb});var socket=require(_0x3037('0x1e'))(new Redis(config[_0x3037('0x1b')]));require(_0x3037('0x1f'))[_0x3037('0x20')](socket);var jayson=require(_0x3037('0x21'));var client=jayson['client'][_0x3037('0x22')]({'port':0x232c});var client9002=jayson[_0x3037('0x23')][_0x3037('0x22')]({'port':0x232a});function respondWithRpcPromise(_0x31b32f,_0xa2537e,_0x224af9,_0x507284){return new BPromise(function(_0x199ac7,_0x3390b9){var _0xf30e3a=_0x507284||client;return _0xf30e3a['request'](_0x31b32f,_0x224af9)[_0x3037('0x24')](function(_0x2de4a8){logger['info'](_0x3037('0x25'),_0xa2537e,'request\x20sent');logger[_0x3037('0x26')](_0x3037('0x27'),_0xa2537e,_0x3037('0x28'),JSON[_0x3037('0x29')](_0x2de4a8));if(_0x2de4a8['error']){if(_0x2de4a8[_0x3037('0x2a')]['code']===0x1f4){logger[_0x3037('0x2a')](_0x3037('0x25'),_0xa2537e,_0x2de4a8[_0x3037('0x2a')][_0x3037('0x2b')]);return _0x3390b9(_0x2de4a8[_0x3037('0x2a')][_0x3037('0x2b')]);}logger[_0x3037('0x2a')](_0x3037('0x25'),_0xa2537e,_0x2de4a8[_0x3037('0x2a')][_0x3037('0x2b')]);return _0x199ac7(_0x2de4a8['error']['message']);}else{logger[_0x3037('0x2c')](_0x3037('0x25'),_0xa2537e,_0x3037('0x28'));_0x199ac7(_0x2de4a8[_0x3037('0x2d')][_0x3037('0x2b')]);}})['catch'](function(_0x3694e7){logger[_0x3037('0x2a')](_0x3037('0x25'),_0xa2537e,_0x3694e7);_0x3390b9(_0x3694e7);});});}function respondWithStatusCode(_0xf834f6,_0x3ff074){_0x3ff074=_0x3ff074||0xcc;return function(_0x11f57c){if(_0x11f57c){return _0xf834f6[_0x3037('0x2e')](_0x3ff074);}return _0xf834f6['status'](_0x3ff074)[_0x3037('0x2f')]();};}function respondWithResult(_0x45fdef,_0x493d3f){_0x493d3f=_0x493d3f||0xc8;return function(_0x3f79c3){if(_0x3f79c3){return _0x45fdef['status'](_0x493d3f)['json'](_0x3f79c3);}};}function respondWithFilteredResult(_0x31d711,_0x16e7ea){return function(_0x3e1b3a){if(_0x3e1b3a){var _0x44fbd4=typeof _0x16e7ea['offset']===_0x3037('0x30')&&typeof _0x16e7ea[_0x3037('0x31')]==='undefined';var _0x217a97=_0x3e1b3a['count'];var _0x1af400=_0x44fbd4?0x0:_0x16e7ea[_0x3037('0x32')];var _0x23e473=_0x44fbd4?_0x3e1b3a['count']:_0x16e7ea['offset']+_0x16e7ea['limit'];var _0x29a2ba;if(_0x23e473>=_0x217a97){_0x23e473=_0x217a97;_0x29a2ba=0xc8;}else{_0x29a2ba=0xce;}_0x31d711['status'](_0x29a2ba);return _0x31d711[_0x3037('0x33')](_0x3037('0x34'),_0x1af400+'-'+_0x23e473+'/'+_0x217a97)[_0x3037('0x35')](_0x3e1b3a);}return null;};}function patchUpdates(_0x342632){return function(_0x48ebda){try{jsonpatch[_0x3037('0x36')](_0x48ebda,_0x342632,!![]);}catch(_0x2e4c1d){return BPromise[_0x3037('0x37')](_0x2e4c1d);}return _0x48ebda['save']();};}function saveUpdates(_0x4208af,_0x24e1e5){return function(_0x8ae799){if(_0x8ae799){return _0x8ae799[_0x3037('0x38')](_0x4208af)[_0x3037('0x24')](function(_0x2e3294){return _0x2e3294;});}return null;};}function removeEntity(_0x3f03c6,_0xe30905){return function(_0x5c58ae){if(_0x5c58ae){return _0x5c58ae['destroy']()[_0x3037('0x24')](function(){_0x3f03c6['status'](0xcc)[_0x3037('0x2f')]();});}};}function handleEntityNotFound(_0x1bb8aa,_0x52d9e6){return function(_0x6f623){if(!_0x6f623){_0x1bb8aa['sendStatus'](0x194);}return _0x6f623;};}function handleError(_0x4f3a01,_0x1b020d){_0x1b020d=_0x1b020d||0x1f4;return function(_0x55704e){logger[_0x3037('0x2a')](_0x55704e[_0x3037('0x39')]);if(_0x55704e['name']){delete _0x55704e[_0x3037('0x3a')];}_0x4f3a01[_0x3037('0x3b')](_0x1b020d)[_0x3037('0x3c')](_0x55704e);};}exports[_0x3037('0x3d')]=function(_0x4811a8,_0x152604){var _0x594c9a={},_0x15e05e={},_0x5b49c3={'count':0x0,'rows':[]};var _0x34e9a9=_[_0x3037('0x3e')](db[_0x3037('0x3f')][_0x3037('0x40')],function(_0x597c80){return{'name':_0x597c80[_0x3037('0x41')],'type':_0x597c80[_0x3037('0x42')][_0x3037('0x43')]};});_0x15e05e['model']=_['map'](_0x34e9a9,_0x3037('0x3a'));_0x15e05e[_0x3037('0x44')]=_[_0x3037('0x45')](_0x4811a8['query']);_0x15e05e[_0x3037('0x46')]=_['intersection'](_0x15e05e[_0x3037('0x47')],_0x15e05e[_0x3037('0x44')]);_0x594c9a['attributes']=_[_0x3037('0x48')](_0x15e05e['model'],qs[_0x3037('0x49')](_0x4811a8[_0x3037('0x44')][_0x3037('0x49')]));_0x594c9a[_0x3037('0x4a')]=_0x594c9a[_0x3037('0x4a')][_0x3037('0x4b')]?_0x594c9a['attributes']:_0x15e05e[_0x3037('0x47')];if(!_0x4811a8[_0x3037('0x44')][_0x3037('0x4c')](_0x3037('0x4d'))){_0x594c9a[_0x3037('0x31')]=qs['limit'](_0x4811a8[_0x3037('0x44')][_0x3037('0x31')]);_0x594c9a[_0x3037('0x32')]=qs[_0x3037('0x32')](_0x4811a8['query'][_0x3037('0x32')]);}_0x594c9a[_0x3037('0x4e')]=qs[_0x3037('0x4f')](_0x4811a8[_0x3037('0x44')]['sort']);_0x594c9a[_0x3037('0x50')]=qs[_0x3037('0x46')](_[_0x3037('0x51')](_0x4811a8[_0x3037('0x44')],_0x15e05e[_0x3037('0x46')]),_0x34e9a9);if(_0x4811a8[_0x3037('0x44')][_0x3037('0x52')]){_0x594c9a[_0x3037('0x50')]=_[_0x3037('0x53')](_0x594c9a[_0x3037('0x50')],{'$or':_[_0x3037('0x3e')](_0x34e9a9,function(_0x48b6e2){if(_0x48b6e2[_0x3037('0x42')]!==_0x3037('0x54')){var _0x48093d={};_0x48093d[_0x48b6e2[_0x3037('0x3a')]]={'$like':'%'+_0x4811a8[_0x3037('0x44')][_0x3037('0x52')]+'%'};return _0x48093d;}})});}_0x594c9a=_[_0x3037('0x53')]({},_0x594c9a,_0x4811a8['options']);var _0x4f7bab={'where':_0x594c9a[_0x3037('0x50')]};return db['ChatMessage'][_0x3037('0x55')](_0x4f7bab)[_0x3037('0x24')](function(_0x3c9b87){_0x5b49c3['count']=_0x3c9b87;if(_0x4811a8['query'][_0x3037('0x56')]){_0x594c9a[_0x3037('0x57')]=[{'all':!![]}];}return db[_0x3037('0x3f')][_0x3037('0x58')](_0x594c9a);})['then'](function(_0x20ff49){_0x5b49c3[_0x3037('0x59')]=_0x20ff49;return _0x5b49c3;})[_0x3037('0x24')](respondWithFilteredResult(_0x152604,_0x594c9a))[_0x3037('0x5a')](handleError(_0x152604,null));};exports[_0x3037('0x5b')]=function(_0x224b24,_0xa1d2e1){var _0x2af1f3={'raw':!![],'where':{'id':_0x224b24[_0x3037('0x5c')]['id']}},_0x12038a={};_0x12038a[_0x3037('0x47')]=_[_0x3037('0x45')](db['ChatMessage']['rawAttributes']);_0x12038a[_0x3037('0x44')]=_[_0x3037('0x45')](_0x224b24[_0x3037('0x44')]);_0x12038a[_0x3037('0x46')]=_[_0x3037('0x48')](_0x12038a['model'],_0x12038a[_0x3037('0x44')]);_0x2af1f3[_0x3037('0x4a')]=_[_0x3037('0x48')](_0x12038a[_0x3037('0x47')],qs['fields'](_0x224b24[_0x3037('0x44')]['fields']));_0x2af1f3[_0x3037('0x4a')]=_0x2af1f3[_0x3037('0x4a')][_0x3037('0x4b')]?_0x2af1f3[_0x3037('0x4a')]:_0x12038a[_0x3037('0x47')];if(_0x224b24[_0x3037('0x44')]['includeAll']){_0x2af1f3['include']=[{'all':!![]}];}_0x2af1f3=_[_0x3037('0x53')]({},_0x2af1f3,_0x224b24[_0x3037('0x5d')]);return db[_0x3037('0x3f')][_0x3037('0x5e')](_0x2af1f3)[_0x3037('0x24')](handleEntityNotFound(_0xa1d2e1,null))[_0x3037('0x24')](respondWithResult(_0xa1d2e1,null))[_0x3037('0x5a')](handleError(_0xa1d2e1,null));};exports['create']=function(_0x4c0fa6,_0x23ea77){return db[_0x3037('0x3f')][_0x3037('0x5f')](_0x4c0fa6[_0x3037('0x60')],{})['then'](respondWithResult(_0x23ea77,0xc9))[_0x3037('0x5a')](handleError(_0x23ea77,null));};exports[_0x3037('0x38')]=function(_0x11c1f8,_0x39934c){if(_0x11c1f8[_0x3037('0x60')]['id']){delete _0x11c1f8[_0x3037('0x60')]['id'];}return db[_0x3037('0x3f')]['find']({'where':{'id':_0x11c1f8[_0x3037('0x5c')]['id']}})[_0x3037('0x24')](handleEntityNotFound(_0x39934c,null))['then'](saveUpdates(_0x11c1f8[_0x3037('0x60')],null))[_0x3037('0x24')](respondWithResult(_0x39934c,null))[_0x3037('0x5a')](handleError(_0x39934c,null));};exports[_0x3037('0x61')]=function(_0x28ed77,_0x30a98f){return db[_0x3037('0x3f')][_0x3037('0x5e')]({'where':{'id':_0x28ed77[_0x3037('0x5c')]['id']}})[_0x3037('0x24')](handleEntityNotFound(_0x30a98f,null))[_0x3037('0x24')](removeEntity(_0x30a98f,null))[_0x3037('0x5a')](handleError(_0x30a98f,null));};exports[_0x3037('0x62')]=function(_0x184a34,_0x1dde0d){return db[_0x3037('0x3f')][_0x3037('0x62')]()[_0x3037('0x24')](respondWithResult(_0x1dde0d,null))[_0x3037('0x5a')](handleError(_0x1dde0d,null));};var interaction_log=require(_0x3037('0x63'))(_0x3037('0x64'));exports[_0x3037('0x65')]=function(_0xbfaac2,_0x3e9472,_0x1516ca){var _0x2786fa={'agent':{},'channel':'chat'};if(_0xbfaac2[_0x3037('0x60')]['id']){delete _0xbfaac2[_0x3037('0x60')]['id'];}_0xbfaac2[_0x3037('0x60')][_0x3037('0x66')]=!![];_0xbfaac2[_0x3037('0x60')]['readAt']=moment()[_0x3037('0x67')](_0x3037('0x68'));_0xbfaac2['body'][_0x3037('0x69')]=_0xbfaac2[_0x3037('0x60')]['UserId']||_0xbfaac2[_0x3037('0x6a')]['id'];_0x2786fa['agent']['id']=_0xbfaac2[_0x3037('0x60')][_0x3037('0x69')];return db[_0x3037('0x3f')][_0x3037('0x5e')]({'where':{'id':_0xbfaac2['params']['id'],'UserId':null}})[_0x3037('0x24')](handleEntityNotFound(_0x3e9472,null))[_0x3037('0x24')](saveUpdates(_0xbfaac2[_0x3037('0x60')],null))[_0x3037('0x24')](function(_0x1efeb4){if(_0x1efeb4){_0x2786fa[_0x3037('0x2b')]=_0x1efeb4[_0x3037('0x6b')]({'plain':!![]});return db[_0x3037('0x6c')][_0x3037('0x5e')]({'where':{'id':_0x1efeb4[_0x3037('0x6d')]}});}return null;})[_0x3037('0x24')](handleEntityNotFound(_0x3e9472,null))['then'](function(_0x1512a6){if(_0x1512a6){return _0x1512a6[_0x3037('0x38')]({'UserId':_0xbfaac2[_0x3037('0x60')]['UserId'],'read1stAt':_['isNil'](_0x1512a6[_0x3037('0x6e')])?moment()[_0x3037('0x67')]('YYYY-MM-DD\x20HH:mm:ss'):undefined});}return null;})[_0x3037('0x24')](function(_0x5988e1){if(_0x5988e1){_0x2786fa['interaction']=_0x5988e1[_0x3037('0x6b')]({'plain':!![]});interaction_log[_0x3037('0x2c')](_0x3037('0x6f'),_0xbfaac2['user']['id'],_0xbfaac2[_0x3037('0x6a')][_0x3037('0x3a')],_0xbfaac2[_0x3037('0x6a')][_0x3037('0x70')],_0x2786fa[_0x3037('0x71')]['id'],_0xbfaac2['body']?JSON['stringify'](_0xbfaac2[_0x3037('0x60')]):_0x3037('0x72'));return respondWithRpcPromise('AcceptMessage',_0x3037('0x73'),_0x2786fa);}return null;})['then'](function(_0x17c4ec){var _0x1bee08=_0x3037('0x74')+_0x17c4ec[_0x3037('0x2b')][_0x3037('0x75')];return db['sequelize'][_0x3037('0x44')](_0x1bee08,{'type':db[_0x3037('0x76')]['QueryTypes'][_0x3037('0x77')],'raw':!![]})[_0x3037('0x24')](function(_0x1473df){return _0x1473df;});})[_0x3037('0x24')](function(_0x134322){if(_0x134322){_0x2786fa[_0x3037('0x2b')][_0x3037('0x78')]=_0x134322[0x0];if(!_0xbfaac2[_0x3037('0x60')][_0x3037('0x69')])return;return db[_0x3037('0x79')][_0x3037('0x5e')]({'where':{'id':_0xbfaac2['body'][_0x3037('0x69')],'role':_0x3037('0x7a')},'attributes':['id',_0x3037('0x3a'),'fullname',_0x3037('0x7b'),'internal'],'raw':!![]});}return null;})[_0x3037('0x24')](function(_0x11f2c2){if(!_0x11f2c2)return null;_0x2786fa[_0x3037('0x2b')][_0x3037('0x7a')]=_0x11f2c2;return _0x2786fa;})['then'](function(_0x2a9248){if(_0x2a9248){if(_0xbfaac2[_0x3037('0x60')]['manual']){_0x2786fa[_0x3037('0x2b')][_0x3037('0x7c')]=util[_0x3037('0x67')](_0x3037('0x7d'),_0xbfaac2[_0x3037('0x6a')]['name']);_0x2786fa['message'][_0x3037('0x7e')]=_0x2786fa[_0x3037('0x7e')];_0x2786fa[_0x3037('0x2b')][_0x3037('0x7f')]=_0x2786fa[_0x3037('0x7e')];_0x2786fa[_0x3037('0x2b')]['event']=_0x3037('0x65');return respondWithRpcPromise(_0x3037('0x80'),'EventManager',{'event':_0x3037('0x81'),'message':_['merge'](_0x2786fa[_0x3037('0x2b')],JSON[_0x3037('0x82')](_0x2786fa['interaction']['formData']))},client9002)[_0x3037('0x24')](function(){return _0x2786fa;});}return _0x2786fa;}return null;})[_0x3037('0x24')](respondWithResult(_0x3e9472,null))['catch'](handleError(_0x3e9472,null));};var interaction_log=require(_0x3037('0x63'))(_0x3037('0x64'));exports[_0x3037('0x37')]=function(_0x25307b,_0x254197,_0x4c35c6){var _0x541f20={'agent':{},'channel':_0x3037('0x83')};if(_0x25307b['body']['id']){delete _0x25307b[_0x3037('0x60')]['id'];}_0x25307b[_0x3037('0x60')][_0x3037('0x69')]=_0x25307b[_0x3037('0x60')]['UserId']||_0x25307b[_0x3037('0x6a')]['id'];_0x541f20[_0x3037('0x7a')]['id']=_0x25307b['body']['UserId'];return db[_0x3037('0x3f')][_0x3037('0x5e')]({'where':{'id':_0x25307b[_0x3037('0x5c')]['id'],'UserId':null}})[_0x3037('0x24')](handleEntityNotFound(_0x254197,null))['then'](function(_0x51d49e){if(_0x51d49e){_0x541f20[_0x3037('0x2b')]=_0x51d49e[_0x3037('0x6b')]({'plain':!![]});return db['ChatInteraction']['find']({'where':{'id':_0x51d49e['ChatInteractionId']}});}return null;})['then'](handleEntityNotFound(_0x254197,null))['then'](function(_0x4f02d8){if(_0x4f02d8){_0x541f20[_0x3037('0x71')]=_0x4f02d8['get']({'plain':!![]});interaction_log[_0x3037('0x2c')]('[CHATMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s',_0x25307b[_0x3037('0x6a')]['id'],_0x25307b[_0x3037('0x6a')]['name'],_0x25307b[_0x3037('0x6a')][_0x3037('0x70')],_0x541f20[_0x3037('0x71')]['id'],_0x25307b[_0x3037('0x60')]?JSON[_0x3037('0x29')](_0x25307b[_0x3037('0x60')]):_0x3037('0x72'));return respondWithRpcPromise(_0x3037('0x84'),_0x3037('0x85'),_0x541f20);}return null;})[_0x3037('0x24')](function(_0x105b2d){var _0x5a4aa4='SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20'+_0x105b2d[_0x3037('0x2b')][_0x3037('0x75')];return db[_0x3037('0x86')][_0x3037('0x44')](_0x5a4aa4,{'type':db[_0x3037('0x76')][_0x3037('0x87')]['SELECT'],'raw':!![]})['then'](function(_0x3f9f56){return _0x3f9f56;});})['then'](function(_0x23f654){if(_0x23f654){_0x541f20[_0x3037('0x2b')]['contact']=_0x23f654[0x0];if(!_0x25307b[_0x3037('0x60')][_0x3037('0x69')])return;return db[_0x3037('0x79')][_0x3037('0x5e')]({'where':{'id':_0x25307b['body']['UserId'],'role':_0x3037('0x7a')},'attributes':['id',_0x3037('0x3a'),_0x3037('0x88'),_0x3037('0x7b'),_0x3037('0x89')],'raw':!![]});}return null;})[_0x3037('0x24')](function(_0x41bf54){if(!_0x41bf54)return null;_0x541f20['message'][_0x3037('0x7a')]=_0x41bf54;return _0x541f20;})[_0x3037('0x24')](function(_0x330eb7){if(_0x330eb7){_0x330eb7[_0x3037('0x2b')][_0x3037('0x7c')]=util[_0x3037('0x67')](_0x3037('0x7d'),_0x25307b[_0x3037('0x6a')][_0x3037('0x3a')]);_0x330eb7[_0x3037('0x2b')]['channel']=_0x541f20[_0x3037('0x7e')];_0x330eb7[_0x3037('0x2b')][_0x3037('0x7f')]=_0x541f20[_0x3037('0x7e')];_0x330eb7[_0x3037('0x2b')][_0x3037('0x8a')]=_0x3037('0x37');respondWithRpcPromise(_0x3037('0x80'),_0x3037('0x80'),{'event':_0x3037('0x8b'),'message':_[_0x3037('0x53')](_0x541f20[_0x3037('0x2b')],JSON['parse'](_0x541f20['interaction'][_0x3037('0x8c')]))},client9002);return _0x541f20;}return null;})[_0x3037('0x24')](respondWithResult(_0x254197,null))['catch'](handleError(_0x254197,null));};
\ No newline at end of file
diff --git a/server/api/chatMessage/chatMessage.events.js b/server/api/chatMessage/chatMessage.events.js
index d6351d7..a995e90 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 _0x26e2=['ChatMessage','setMaxListeners','save','update','remove','emit','hasOwnProperty','hook','exports','events','../../mysqldb'];(function(_0x507c81,_0x3e1b56){var _0x368a25=function(_0x1e7519){while(--_0x1e7519){_0x507c81['push'](_0x507c81['shift']());}};_0x368a25(++_0x3e1b56);}(_0x26e2,0xe5));var _0x226e=function(_0x31cd5a,_0x453c74){_0x31cd5a=_0x31cd5a-0x0;var _0x354584=_0x26e2[_0x31cd5a];return _0x354584;};'use strict';var EventEmitter=require(_0x226e('0x0'));var ChatMessage=require(_0x226e('0x1'))['db'][_0x226e('0x2')];var ChatMessageEvents=new EventEmitter();ChatMessageEvents[_0x226e('0x3')](0x0);var events={'afterCreate':_0x226e('0x4'),'afterUpdate':_0x226e('0x5'),'afterDestroy':_0x226e('0x6')};function emitEvent(_0x52387c){return function(_0x142e6c,_0xa46b28,_0x627b7b){ChatMessageEvents[_0x226e('0x7')](_0x52387c+':'+_0x142e6c['id'],_0x142e6c);ChatMessageEvents[_0x226e('0x7')](_0x52387c,_0x142e6c);_0x627b7b(null);};}for(var e in events){if(events[_0x226e('0x8')](e)){var event=events[e];ChatMessage[_0x226e('0x9')](e,emitEvent(event));}}module[_0x226e('0xa')]=ChatMessageEvents;
\ No newline at end of file
+var _0x66f9=['../../mysqldb','save','update','remove','emit','hasOwnProperty','hook','exports','events'];(function(_0x4ce6f2,_0x43c09b){var _0x4336d9=function(_0x42439c){while(--_0x42439c){_0x4ce6f2['push'](_0x4ce6f2['shift']());}};_0x4336d9(++_0x43c09b);}(_0x66f9,0xa1));var _0x966f=function(_0x392e93,_0x2aebd1){_0x392e93=_0x392e93-0x0;var _0x31d2f6=_0x66f9[_0x392e93];return _0x31d2f6;};'use strict';var EventEmitter=require(_0x966f('0x0'));var ChatMessage=require(_0x966f('0x1'))['db']['ChatMessage'];var ChatMessageEvents=new EventEmitter();ChatMessageEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x966f('0x2'),'afterUpdate':_0x966f('0x3'),'afterDestroy':_0x966f('0x4')};function emitEvent(_0x3e78a3){return function(_0x6d4dc3,_0x3d7d3a,_0x4e3278){ChatMessageEvents[_0x966f('0x5')](_0x3e78a3+':'+_0x6d4dc3['id'],_0x6d4dc3);ChatMessageEvents[_0x966f('0x5')](_0x3e78a3,_0x6d4dc3);_0x4e3278(null);};}for(var e in events){if(events[_0x966f('0x6')](e)){var event=events[e];ChatMessage[_0x966f('0x7')](e,emitEvent(event));}}module[_0x966f('0x8')]=ChatMessageEvents;
\ No newline at end of file
diff --git a/server/api/chatMessage/chatMessage.model.js b/server/api/chatMessage/chatMessage.model.js
index 20a1b1e..3ba4591 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 _0x057f=['moment','request-promise','path','./chatMessage.attributes','define','ChatMessage','chat_messages','fti_chat_messages','body','FULLTEXT','models','get','direction','toLowerCase','out','secret','isNil','ChatInteraction','findOne','ChatInteractionId','then','createdAt','catch','error','utf8mb4','util','../../config/logger'];(function(_0x31b5cd,_0x196e6a){var _0x242d1e=function(_0x30d929){while(--_0x30d929){_0x31b5cd['push'](_0x31b5cd['shift']());}};_0x242d1e(++_0x196e6a);}(_0x057f,0x85));var _0xf057=function(_0x405461,_0x17d34b){_0x405461=_0x405461-0x0;var _0x116438=_0x057f[_0x405461];return _0x116438;};'use strict';var _=require('lodash');var util=require(_0xf057('0x0'));var logger=require(_0xf057('0x1'))('api');var moment=require(_0xf057('0x2'));var BPromise=require('bluebird');var rp=require(_0xf057('0x3'));var fs=require('fs');var path=require(_0xf057('0x4'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0xf057('0x5'));module['exports']=function(_0x4f8620,_0x36cf9c){return _0x4f8620[_0xf057('0x6')](_0xf057('0x7'),attributes,{'tableName':_0xf057('0x8'),'paranoid':![],'indexes':[{'name':_0xf057('0x9'),'fields':[_0xf057('0xa')],'type':_0xf057('0xb')}],'timestamps':!![],'hooks':{'afterCreate':function(_0x354a8d,_0x2d97e6,_0x2300ed){var _0x57aed1=_0x4f8620[_0xf057('0xc')];var _0x1cfe39=_0x354a8d[_0xf057('0xd')]({'plain':!![]});if(_0x1cfe39[_0xf057('0xe')][_0xf057('0xf')]()==='in'||_0x1cfe39[_0xf057('0xe')][_0xf057('0xf')]()===_0xf057('0x10')&&!_0x1cfe39[_0xf057('0x11')]&&!_[_0xf057('0x12')](_0x1cfe39['UserId'])){_0x57aed1[_0xf057('0x13')][_0xf057('0x14')]({'where':{'id':_0x1cfe39[_0xf057('0x15')]}})[_0xf057('0x16')](function(_0x149e73){if(_0x149e73){_0x149e73['update']({'lastMsgAt':_0x1cfe39[_0xf057('0x17')],'lastMsgDirection':_0x1cfe39[_0xf057('0xe')]['toLowerCase']()});}})[_0xf057('0x18')](function(_0xa183de){console[_0xf057('0x19')](_0xa183de);});}_0x2300ed();}},'charset':_0xf057('0x1a'),'collate':'utf8mb4_unicode_ci'});};
\ No newline at end of file
+var _0x34c3=['utf8mb4_unicode_ci','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./chatMessage.attributes','exports','define','ChatMessage','chat_messages','fti_chat_messages','body','FULLTEXT','models','direction','toLowerCase','out','secret','isNil','UserId','ChatInteraction','then','error','utf8mb4'];(function(_0x119280,_0x439c3e){var _0x481797=function(_0x4265cb){while(--_0x4265cb){_0x119280['push'](_0x119280['shift']());}};_0x481797(++_0x439c3e);}(_0x34c3,0x1e1));var _0x334c=function(_0x278e3c,_0x1c9cfd){_0x278e3c=_0x278e3c-0x0;var _0x3e2d9b=_0x34c3[_0x278e3c];return _0x3e2d9b;};'use strict';var _=require(_0x334c('0x0'));var util=require(_0x334c('0x1'));var logger=require(_0x334c('0x2'))(_0x334c('0x3'));var moment=require(_0x334c('0x4'));var BPromise=require(_0x334c('0x5'));var rp=require(_0x334c('0x6'));var fs=require('fs');var path=require(_0x334c('0x7'));var rimraf=require(_0x334c('0x8'));var config=require(_0x334c('0x9'));var attributes=require(_0x334c('0xa'));module[_0x334c('0xb')]=function(_0x3cd037,_0x270906){return _0x3cd037[_0x334c('0xc')](_0x334c('0xd'),attributes,{'tableName':_0x334c('0xe'),'paranoid':![],'indexes':[{'name':_0x334c('0xf'),'fields':[_0x334c('0x10')],'type':_0x334c('0x11')}],'timestamps':!![],'hooks':{'afterCreate':function(_0x440a37,_0x332bb2,_0x127c22){var _0x15184e=_0x3cd037[_0x334c('0x12')];var _0x4b216d=_0x440a37['get']({'plain':!![]});if(_0x4b216d[_0x334c('0x13')]['toLowerCase']()==='in'||_0x4b216d[_0x334c('0x13')][_0x334c('0x14')]()===_0x334c('0x15')&&!_0x4b216d[_0x334c('0x16')]&&!_[_0x334c('0x17')](_0x4b216d[_0x334c('0x18')])){_0x15184e[_0x334c('0x19')]['findOne']({'where':{'id':_0x4b216d['ChatInteractionId']}})[_0x334c('0x1a')](function(_0x203ab7){if(_0x203ab7){_0x203ab7['update']({'lastMsgAt':_0x4b216d['createdAt'],'lastMsgDirection':_0x4b216d['direction'][_0x334c('0x14')]()});}})['catch'](function(_0x509352){console[_0x334c('0x1b')](_0x509352);});}_0x127c22();}},'charset':_0x334c('0x1c'),'collate':_0x334c('0x1d')});};
\ No newline at end of file
diff --git a/server/api/chatMessage/chatMessage.rpc.js b/server/api/chatMessage/chatMessage.rpc.js
index 1e1230f..17c513a 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 _0x238f=['ChatMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','message','request\x20sent','result','catch','ChatMessage','body','options','raw','CreateChatMessage','util','moment','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','socket.io-emitter','register','request','then','info','ChatMessage,\x20%s,\x20%s','debug'];(function(_0x2b5eae,_0x55010d){var _0x5f3ac9=function(_0x397bfc){while(--_0x397bfc){_0x2b5eae['push'](_0x2b5eae['shift']());}};_0x5f3ac9(++_0x55010d);}(_0x238f,0xad));var _0xf238=function(_0x580d0e,_0x108e68){_0x580d0e=_0x580d0e-0x0;var _0x18ac4b=_0x238f[_0x580d0e];return _0x18ac4b;};'use strict';var _=require('lodash');var util=require(_0xf238('0x0'));var moment=require(_0xf238('0x1'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xf238('0x2'));var db=require(_0xf238('0x3'))['db'];var utils=require('../../config/utils');var logger=require(_0xf238('0x4'))(_0xf238('0x5'));var config=require(_0xf238('0x6'));var jayson=require(_0xf238('0x7'));var client=jayson[_0xf238('0x8')][_0xf238('0x9')]({'port':0x232a});config[_0xf238('0xa')]=_[_0xf238('0xb')](config[_0xf238('0xa')],{'host':'localhost','port':0x18eb});var socket=require(_0xf238('0xc'))(new Redis(config[_0xf238('0xa')]));require('./chatMessage.socket')[_0xf238('0xd')](socket);function respondWithRpcPromise(_0x57b078,_0x1ff7c8,_0x1db8a9){return new BPromise(function(_0x33a1b6,_0x4e1c21){return client[_0xf238('0xe')](_0x57b078,_0x1db8a9)[_0xf238('0xf')](function(_0x21092d){logger[_0xf238('0x10')](_0xf238('0x11'),_0x1ff7c8,'request\x20sent');logger[_0xf238('0x12')](_0xf238('0x13'),_0x1ff7c8,'request\x20sent',JSON[_0xf238('0x14')](_0x21092d));if(_0x21092d[_0xf238('0x15')]){if(_0x21092d[_0xf238('0x15')][_0xf238('0x16')]===0x1f4){logger['error'](_0xf238('0x11'),_0x1ff7c8,_0x21092d[_0xf238('0x15')]['message']);return _0x4e1c21(_0x21092d[_0xf238('0x15')][_0xf238('0x17')]);}logger['error']('ChatMessage,\x20%s,\x20%s',_0x1ff7c8,_0x21092d['error'][_0xf238('0x17')]);return _0x33a1b6(_0x21092d[_0xf238('0x15')][_0xf238('0x17')]);}else{logger[_0xf238('0x10')](_0xf238('0x11'),_0x1ff7c8,_0xf238('0x18'));_0x33a1b6(_0x21092d[_0xf238('0x19')][_0xf238('0x17')]);}})[_0xf238('0x1a')](function(_0x5413ed){logger[_0xf238('0x15')](_0xf238('0x11'),_0x1ff7c8,_0x5413ed);_0x4e1c21(_0x5413ed);});});}exports['CreateChatMessage']=function(_0x1020e8){var _0x52a48b=this;return new Promise(function(_0x27a7c9,_0x224992){return db[_0xf238('0x1b')]['create'](_0x1020e8[_0xf238('0x1c')],{'raw':_0x1020e8[_0xf238('0x1d')]?_0x1020e8[_0xf238('0x1d')][_0xf238('0x1e')]===undefined?!![]:![]:!![]})[_0xf238('0xf')](function(_0x64476e){logger[_0xf238('0x10')](_0xf238('0x1f'),_0x1020e8);logger[_0xf238('0x12')](_0xf238('0x1f'),_0x1020e8,JSON[_0xf238('0x14')](_0x64476e));_0x27a7c9(_0x64476e);})[_0xf238('0x1a')](function(_0x68a9bf){logger[_0xf238('0x15')](_0xf238('0x1f'),_0x68a9bf[_0xf238('0x17')],_0x1020e8);_0x224992(_0x52a48b[_0xf238('0x15')](0x1f4,_0x68a9bf[_0xf238('0x17')]));});});};
\ No newline at end of file
+var _0x4886=['socket.io-emitter','./chatMessage.socket','register','request','info','request\x20sent','debug','ChatMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','ChatMessage,\x20%s,\x20%s','message','result','catch','CreateChatMessage','ChatMessage','body','options','then','lodash','moment','bluebird','randomstring','../../mysqldb','../../config/logger','rpc','../../config/environment','client','redis'];(function(_0x48b85c,_0x466989){var _0xe3335d=function(_0x2276b4){while(--_0x2276b4){_0x48b85c['push'](_0x48b85c['shift']());}};_0xe3335d(++_0x466989);}(_0x4886,0x122));var _0x6488=function(_0x1f3baa,_0x165669){_0x1f3baa=_0x1f3baa-0x0;var _0xc0dc6f=_0x4886[_0x1f3baa];return _0xc0dc6f;};'use strict';var _=require(_0x6488('0x0'));var util=require('util');var moment=require(_0x6488('0x1'));var BPromise=require(_0x6488('0x2'));var rs=require(_0x6488('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x6488('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x6488('0x5'))(_0x6488('0x6'));var config=require(_0x6488('0x7'));var jayson=require('jayson/promise');var client=jayson[_0x6488('0x8')]['http']({'port':0x232a});config[_0x6488('0x9')]=_['defaults'](config['redis'],{'host':'localhost','port':0x18eb});var socket=require(_0x6488('0xa'))(new Redis(config[_0x6488('0x9')]));require(_0x6488('0xb'))[_0x6488('0xc')](socket);function respondWithRpcPromise(_0x1b8f73,_0x1d5df9,_0x4aeb1e){return new BPromise(function(_0x758d48,_0x41bd86){return client[_0x6488('0xd')](_0x1b8f73,_0x4aeb1e)['then'](function(_0x435a82){logger[_0x6488('0xe')]('ChatMessage,\x20%s,\x20%s',_0x1d5df9,_0x6488('0xf'));logger[_0x6488('0x10')](_0x6488('0x11'),_0x1d5df9,_0x6488('0xf'),JSON[_0x6488('0x12')](_0x435a82));if(_0x435a82[_0x6488('0x13')]){if(_0x435a82[_0x6488('0x13')][_0x6488('0x14')]===0x1f4){logger[_0x6488('0x13')](_0x6488('0x15'),_0x1d5df9,_0x435a82['error'][_0x6488('0x16')]);return _0x41bd86(_0x435a82['error'][_0x6488('0x16')]);}logger[_0x6488('0x13')](_0x6488('0x15'),_0x1d5df9,_0x435a82[_0x6488('0x13')][_0x6488('0x16')]);return _0x758d48(_0x435a82['error']['message']);}else{logger['info'](_0x6488('0x15'),_0x1d5df9,'request\x20sent');_0x758d48(_0x435a82[_0x6488('0x17')][_0x6488('0x16')]);}})[_0x6488('0x18')](function(_0x254747){logger['error'](_0x6488('0x15'),_0x1d5df9,_0x254747);_0x41bd86(_0x254747);});});}exports[_0x6488('0x19')]=function(_0x4100eb){var _0x3674d6=this;return new Promise(function(_0x3dd294,_0x1217e0){return db[_0x6488('0x1a')]['create'](_0x4100eb[_0x6488('0x1b')],{'raw':_0x4100eb[_0x6488('0x1c')]?_0x4100eb[_0x6488('0x1c')]['raw']===undefined?!![]:![]:!![]})[_0x6488('0x1d')](function(_0x2c1ab7){logger['info'](_0x6488('0x19'),_0x4100eb);logger['debug'](_0x6488('0x19'),_0x4100eb,JSON[_0x6488('0x12')](_0x2c1ab7));_0x3dd294(_0x2c1ab7);})[_0x6488('0x18')](function(_0x4c66e7){logger[_0x6488('0x13')](_0x6488('0x19'),_0x4c66e7['message'],_0x4100eb);_0x1217e0(_0x3674d6[_0x6488('0x13')](0x1f4,_0x4c66e7['message']));});});};
\ No newline at end of file
diff --git a/server/api/chatMessage/chatMessage.socket.js b/server/api/chatMessage/chatMessage.socket.js
index 58a523a..d437b32 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 _0x448b=['emit','removeListener','register','length','chatMessage:','./chatMessage.events','save','remove','update'];(function(_0x33beba,_0x39ceff){var _0x35ab5a=function(_0x4e1fcb){while(--_0x4e1fcb){_0x33beba['push'](_0x33beba['shift']());}};_0x35ab5a(++_0x39ceff);}(_0x448b,0x125));var _0xb448=function(_0x9a9f76,_0x33ed7f){_0x9a9f76=_0x9a9f76-0x0;var _0x1fb5b2=_0x448b[_0x9a9f76];return _0x1fb5b2;};'use strict';var ChatMessageEvents=require(_0xb448('0x0'));var events=[_0xb448('0x1'),_0xb448('0x2'),_0xb448('0x3')];function createListener(_0x422fa2,_0x51583a){return function(_0x5bf7db){_0x51583a[_0xb448('0x4')](_0x422fa2,_0x5bf7db);};}function removeListener(_0x32bcae,_0x172a89){return function(){ChatMessageEvents[_0xb448('0x5')](_0x32bcae,_0x172a89);};}exports[_0xb448('0x6')]=function(_0x276466){for(var _0x3670cb=0x0,_0x5993ad=events[_0xb448('0x7')];_0x3670cb<_0x5993ad;_0x3670cb++){var _0x2f6f82=events[_0x3670cb];var _0x2c2bdd=createListener(_0xb448('0x8')+_0x2f6f82,_0x276466);ChatMessageEvents['on'](_0x2f6f82,_0x2c2bdd);}};
\ No newline at end of file
+var _0x8ba0=['emit','removeListener','register','length','chatMessage:','./chatMessage.events','save','remove','update'];(function(_0x2ad2ad,_0x4a1254){var _0x73089a=function(_0x32c78f){while(--_0x32c78f){_0x2ad2ad['push'](_0x2ad2ad['shift']());}};_0x73089a(++_0x4a1254);}(_0x8ba0,0x1c7));var _0x08ba=function(_0x93f1ca,_0x4bdf53){_0x93f1ca=_0x93f1ca-0x0;var _0x31c2c2=_0x8ba0[_0x93f1ca];return _0x31c2c2;};'use strict';var ChatMessageEvents=require(_0x08ba('0x0'));var events=[_0x08ba('0x1'),_0x08ba('0x2'),_0x08ba('0x3')];function createListener(_0x43ffb6,_0x5684f1){return function(_0x5e182a){_0x5684f1[_0x08ba('0x4')](_0x43ffb6,_0x5e182a);};}function removeListener(_0x802b7e,_0x3defcd){return function(){ChatMessageEvents[_0x08ba('0x5')](_0x802b7e,_0x3defcd);};}exports[_0x08ba('0x6')]=function(_0x161a9d){for(var _0x5f29fa=0x0,_0x235354=events[_0x08ba('0x7')];_0x5f29fa<_0x235354;_0x5f29fa++){var _0x37bcdf=events[_0x5f29fa];var _0x451f15=createListener(_0x08ba('0x8')+_0x37bcdf,_0x161a9d);ChatMessageEvents['on'](_0x37bcdf,_0x451f15);}};
\ No newline at end of file
diff --git a/server/api/chatMessage/index.js b/server/api/chatMessage/index.js
index ec4e384..41df606 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 _0x0278=['path','connect-timeout','Router','fs-extra','../../components/interaction/service','./chatMessage.controller','get','isAuthenticated','/describe','describe','show','post','tracked','chatmessage:create','put','/:id','accept','/:id/reject','delete','exports','multer'];(function(_0x120c37,_0x183682){var _0x19dd4b=function(_0x2a3905){while(--_0x2a3905){_0x120c37['push'](_0x120c37['shift']());}};_0x19dd4b(++_0x183682);}(_0x0278,0x110));var _0x8027=function(_0x1035c1,_0x2d8583){_0x1035c1=_0x1035c1-0x0;var _0x308d67=_0x0278[_0x1035c1];return _0x308d67;};'use strict';var multer=require(_0x8027('0x0'));var util=require('util');var path=require(_0x8027('0x1'));var timeout=require(_0x8027('0x2'));var express=require('express');var router=express[_0x8027('0x3')]();var fs_extra=require(_0x8027('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0x8027('0x5'));var config=require('../../config/environment');var controller=require(_0x8027('0x6'));router[_0x8027('0x7')]('/',auth[_0x8027('0x8')](),controller['index']);router['get'](_0x8027('0x9'),auth[_0x8027('0x8')](),controller[_0x8027('0xa')]);router['get']('/:id',auth[_0x8027('0x8')](),controller[_0x8027('0xb')]);router[_0x8027('0xc')]('/',auth['isAuthenticated'](),interaction[_0x8027('0xd')]('chat',_0x8027('0xe')),controller['create']);router[_0x8027('0xf')](_0x8027('0x10'),controller['update']);router[_0x8027('0xf')]('/:id/accept',auth[_0x8027('0x8')](),controller[_0x8027('0x11')]);router['put'](_0x8027('0x12'),auth[_0x8027('0x8')](),controller['reject']);router[_0x8027('0x13')](_0x8027('0x10'),auth['isAuthenticated'](),controller['destroy']);module[_0x8027('0x14')]=router;
\ No newline at end of file
+var _0xc544=['../../config/environment','get','index','/describe','isAuthenticated','describe','/:id','show','post','tracked','chat','chatmessage:create','create','put','update','/:id/accept','accept','/:id/reject','delete','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service'];(function(_0x4dc3b9,_0x29f0d3){var _0x162e7a=function(_0x1e4eea){while(--_0x1e4eea){_0x4dc3b9['push'](_0x4dc3b9['shift']());}};_0x162e7a(++_0x29f0d3);}(_0xc544,0xdf));var _0x4c54=function(_0x4eb288,_0x2bece5){_0x4eb288=_0x4eb288-0x0;var _0xf0f5d4=_0xc544[_0x4eb288];return _0xf0f5d4;};'use strict';var multer=require(_0x4c54('0x0'));var util=require(_0x4c54('0x1'));var path=require(_0x4c54('0x2'));var timeout=require(_0x4c54('0x3'));var express=require(_0x4c54('0x4'));var router=express[_0x4c54('0x5')]();var fs_extra=require(_0x4c54('0x6'));var auth=require(_0x4c54('0x7'));var interaction=require(_0x4c54('0x8'));var config=require(_0x4c54('0x9'));var controller=require('./chatMessage.controller');router[_0x4c54('0xa')]('/',auth['isAuthenticated'](),controller[_0x4c54('0xb')]);router['get'](_0x4c54('0xc'),auth[_0x4c54('0xd')](),controller[_0x4c54('0xe')]);router[_0x4c54('0xa')](_0x4c54('0xf'),auth[_0x4c54('0xd')](),controller[_0x4c54('0x10')]);router[_0x4c54('0x11')]('/',auth['isAuthenticated'](),interaction[_0x4c54('0x12')](_0x4c54('0x13'),_0x4c54('0x14')),controller[_0x4c54('0x15')]);router[_0x4c54('0x16')](_0x4c54('0xf'),controller[_0x4c54('0x17')]);router[_0x4c54('0x16')](_0x4c54('0x18'),auth[_0x4c54('0xd')](),controller[_0x4c54('0x19')]);router[_0x4c54('0x16')](_0x4c54('0x1a'),auth[_0x4c54('0xd')](),controller['reject']);router[_0x4c54('0x1b')](_0x4c54('0xf'),auth[_0x4c54('0xd')](),controller['destroy']);module[_0x4c54('0x1c')]=router;
\ No newline at end of file
diff --git a/server/api/chatOfflineMessage/chatOfflineMessage.attributes.js b/server/api/chatOfflineMessage/chatOfflineMessage.attributes.js
index ea5dc7d..c158ece 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 _0x0b0e=['medium','sequelize','TEXT'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x0b0e,0x187));var _0xe0b0=function(_0x59b48b,_0x584733){_0x59b48b=_0x59b48b-0x0;var _0x4c3f79=_0x0b0e[_0x59b48b];return _0x4c3f79;};'use strict';var Sequelize=require(_0xe0b0('0x0'));module['exports']={'body':{'type':Sequelize[_0xe0b0('0x1')]('medium'),'allowNull':![]},'plainBody':{'type':Sequelize[_0xe0b0('0x1')](_0xe0b0('0x2')),'allowNull':![]}};
\ No newline at end of file
+var _0xdb28=['TEXT','medium','sequelize','exports'];(function(_0x17c840,_0x13dbfe){var _0x3cd8f5=function(_0x38b565){while(--_0x38b565){_0x17c840['push'](_0x17c840['shift']());}};_0x3cd8f5(++_0x13dbfe);}(_0xdb28,0x106));var _0x8db2=function(_0x4c21fc,_0x2fa72c){_0x4c21fc=_0x4c21fc-0x0;var _0x51a541=_0xdb28[_0x4c21fc];return _0x51a541;};'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 b40f1d1..13b1b31 100644
--- a/server/api/chatOfflineMessage/chatOfflineMessage.controller.js
+++ b/server/api/chatOfflineMessage/chatOfflineMessage.controller.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x9957=['sendStatus','status','json','undefined','count','offset','limit','set','Content-Range','reject','save','then','destroy','error','name','send','index','fieldName','type','key','model','map','keys','filters','intersection','query','attributes','fields','length','hasOwnProperty','nolimit','sort','where','filter','merge','VIRTUAL','options','ChatOfflineMessage','findAll','rows','show','rawAttributes','includeAll','include','find','create','catch','body','params','Attachment','forEach','join','root','server','files','attachments','basename','existsSync','remove','describe','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/license/util','../../mysqldb'];(function(_0x527c5e,_0x36da9e){var _0x1ac69d=function(_0x23b137){while(--_0x23b137){_0x527c5e['push'](_0x527c5e['shift']());}};_0x1ac69d(++_0x36da9e);}(_0x9957,0x93));var _0x7995=function(_0x5b644e,_0x2e5e07){_0x5b644e=_0x5b644e-0x0;var _0x49c6bf=_0x9957[_0x5b644e];return _0x49c6bf;};'use strict';var emlformat=require(_0x7995('0x0'));var rimraf=require(_0x7995('0x1'));var zipdir=require(_0x7995('0x2'));var jsonpatch=require(_0x7995('0x3'));var rp=require('request-promise');var moment=require(_0x7995('0x4'));var BPromise=require(_0x7995('0x5'));var Mustache=require(_0x7995('0x6'));var util=require(_0x7995('0x7'));var path=require('path');var sox=require(_0x7995('0x8'));var csv=require(_0x7995('0x9'));var ejs=require(_0x7995('0xa'));var fs=require('fs');var fs_extra=require(_0x7995('0xb'));var _=require(_0x7995('0xc'));var squel=require(_0x7995('0xd'));var crypto=require('crypto');var jsforce=require(_0x7995('0xe'));var deskjs=require(_0x7995('0xf'));var toCsv=require('to-csv');var querystring=require(_0x7995('0x10'));var Papa=require(_0x7995('0x11'));var Redis=require(_0x7995('0x12'));var authService=require(_0x7995('0x13'));var qs=require(_0x7995('0x14'));var as=require(_0x7995('0x15'));var hardwareService=require(_0x7995('0x16'));var logger=require('../../config/logger')(_0x7995('0x17'));var utils=require(_0x7995('0x18'));var config=require('../../config/environment');var licenseUtil=require(_0x7995('0x19'));var db=require(_0x7995('0x1a'))['db'];function respondWithStatusCode(_0x19a27e,_0x385f00){_0x385f00=_0x385f00||0xcc;return function(_0x281576){if(_0x281576){return _0x19a27e[_0x7995('0x1b')](_0x385f00);}return _0x19a27e[_0x7995('0x1c')](_0x385f00)['end']();};}function respondWithResult(_0x58f5ad,_0x2b4e94){_0x2b4e94=_0x2b4e94||0xc8;return function(_0x2233dd){if(_0x2233dd){return _0x58f5ad[_0x7995('0x1c')](_0x2b4e94)[_0x7995('0x1d')](_0x2233dd);}};}function respondWithFilteredResult(_0x3f1d3e,_0x1a5310){return function(_0x2202ce){if(_0x2202ce){var _0x41cbf0=typeof _0x1a5310['offset']===_0x7995('0x1e')&&typeof _0x1a5310['limit']===_0x7995('0x1e');var _0x37f297=_0x2202ce[_0x7995('0x1f')];var _0x291317=_0x41cbf0?0x0:_0x1a5310[_0x7995('0x20')];var _0x37a7d4=_0x41cbf0?_0x2202ce['count']:_0x1a5310['offset']+_0x1a5310[_0x7995('0x21')];var _0x5e6f90;if(_0x37a7d4>=_0x37f297){_0x37a7d4=_0x37f297;_0x5e6f90=0xc8;}else{_0x5e6f90=0xce;}_0x3f1d3e['status'](_0x5e6f90);return _0x3f1d3e[_0x7995('0x22')](_0x7995('0x23'),_0x291317+'-'+_0x37a7d4+'/'+_0x37f297)['json'](_0x2202ce);}return null;};}function patchUpdates(_0x3a9b54){return function(_0x51f276){try{jsonpatch['apply'](_0x51f276,_0x3a9b54,!![]);}catch(_0x3e4c54){return BPromise[_0x7995('0x24')](_0x3e4c54);}return _0x51f276[_0x7995('0x25')]();};}function saveUpdates(_0x1a8568,_0x460924){return function(_0x1c278a){if(_0x1c278a){return _0x1c278a['update'](_0x1a8568)[_0x7995('0x26')](function(_0x46ee4b){return _0x46ee4b;});}return null;};}function removeEntity(_0x204507,_0x285437){return function(_0x563799){if(_0x563799){return _0x563799[_0x7995('0x27')]()[_0x7995('0x26')](function(){_0x204507[_0x7995('0x1c')](0xcc)['end']();});}};}function handleEntityNotFound(_0x39df42,_0x34e70c){return function(_0x401dc3){if(!_0x401dc3){_0x39df42[_0x7995('0x1b')](0x194);}return _0x401dc3;};}function handleError(_0x3a3fcf,_0x2a307e){_0x2a307e=_0x2a307e||0x1f4;return function(_0x56691a){logger[_0x7995('0x28')](_0x56691a['stack']);if(_0x56691a[_0x7995('0x29')]){delete _0x56691a[_0x7995('0x29')];}_0x3a3fcf[_0x7995('0x1c')](_0x2a307e)[_0x7995('0x2a')](_0x56691a);};}exports[_0x7995('0x2b')]=function(_0x4b6f99,_0x9b2a15){var _0x514445={},_0x456a28={},_0x3250e0={'count':0x0,'rows':[]};var _0x4253e5=_['map'](db['ChatOfflineMessage']['rawAttributes'],function(_0x3573be){return{'name':_0x3573be[_0x7995('0x2c')],'type':_0x3573be[_0x7995('0x2d')][_0x7995('0x2e')]};});_0x456a28[_0x7995('0x2f')]=_[_0x7995('0x30')](_0x4253e5,'name');_0x456a28['query']=_[_0x7995('0x31')](_0x4b6f99['query']);_0x456a28[_0x7995('0x32')]=_[_0x7995('0x33')](_0x456a28[_0x7995('0x2f')],_0x456a28[_0x7995('0x34')]);_0x514445[_0x7995('0x35')]=_['intersection'](_0x456a28[_0x7995('0x2f')],qs[_0x7995('0x36')](_0x4b6f99['query']['fields']));_0x514445['attributes']=_0x514445[_0x7995('0x35')][_0x7995('0x37')]?_0x514445['attributes']:_0x456a28[_0x7995('0x2f')];if(!_0x4b6f99['query'][_0x7995('0x38')](_0x7995('0x39'))){_0x514445[_0x7995('0x21')]=qs['limit'](_0x4b6f99['query'][_0x7995('0x21')]);_0x514445['offset']=qs['offset'](_0x4b6f99[_0x7995('0x34')][_0x7995('0x20')]);}_0x514445['order']=qs[_0x7995('0x3a')](_0x4b6f99[_0x7995('0x34')][_0x7995('0x3a')]);_0x514445[_0x7995('0x3b')]=qs[_0x7995('0x32')](_['pick'](_0x4b6f99[_0x7995('0x34')],_0x456a28[_0x7995('0x32')]),_0x4253e5);if(_0x4b6f99[_0x7995('0x34')][_0x7995('0x3c')]){_0x514445['where']=_[_0x7995('0x3d')](_0x514445[_0x7995('0x3b')],{'$or':_[_0x7995('0x30')](_0x4253e5,function(_0xe5ea43){if(_0xe5ea43[_0x7995('0x2d')]!==_0x7995('0x3e')){var _0x5688a1={};_0x5688a1[_0xe5ea43[_0x7995('0x29')]]={'$like':'%'+_0x4b6f99[_0x7995('0x34')][_0x7995('0x3c')]+'%'};return _0x5688a1;}})});}_0x514445=_[_0x7995('0x3d')]({},_0x514445,_0x4b6f99[_0x7995('0x3f')]);var _0x298fc2={'where':_0x514445[_0x7995('0x3b')]};return db[_0x7995('0x40')][_0x7995('0x1f')](_0x298fc2)[_0x7995('0x26')](function(_0x6fe77b){_0x3250e0[_0x7995('0x1f')]=_0x6fe77b;if(_0x4b6f99[_0x7995('0x34')]['includeAll']){_0x514445['include']=[{'all':!![]}];}return db[_0x7995('0x40')][_0x7995('0x41')](_0x514445);})['then'](function(_0x4b0855){_0x3250e0[_0x7995('0x42')]=_0x4b0855;return _0x3250e0;})['then'](respondWithFilteredResult(_0x9b2a15,_0x514445))['catch'](handleError(_0x9b2a15,null));};exports[_0x7995('0x43')]=function(_0x36e28b,_0x35c8ff){var _0x576b96={'raw':!![],'where':{'id':_0x36e28b['params']['id']}},_0x46ac4f={};_0x46ac4f[_0x7995('0x2f')]=_['keys'](db['ChatOfflineMessage'][_0x7995('0x44')]);_0x46ac4f[_0x7995('0x34')]=_[_0x7995('0x31')](_0x36e28b[_0x7995('0x34')]);_0x46ac4f['filters']=_[_0x7995('0x33')](_0x46ac4f[_0x7995('0x2f')],_0x46ac4f[_0x7995('0x34')]);_0x576b96[_0x7995('0x35')]=_['intersection'](_0x46ac4f['model'],qs[_0x7995('0x36')](_0x36e28b['query'][_0x7995('0x36')]));_0x576b96['attributes']=_0x576b96[_0x7995('0x35')]['length']?_0x576b96[_0x7995('0x35')]:_0x46ac4f[_0x7995('0x2f')];if(_0x36e28b['query'][_0x7995('0x45')]){_0x576b96[_0x7995('0x46')]=[{'all':!![]}];}_0x576b96=_[_0x7995('0x3d')]({},_0x576b96,_0x36e28b[_0x7995('0x3f')]);return db['ChatOfflineMessage'][_0x7995('0x47')](_0x576b96)[_0x7995('0x26')](handleEntityNotFound(_0x35c8ff,null))[_0x7995('0x26')](respondWithResult(_0x35c8ff,null))['catch'](handleError(_0x35c8ff,null));};exports[_0x7995('0x48')]=function(_0x44f516,_0x511567){return db[_0x7995('0x40')][_0x7995('0x48')](_0x44f516['body'],{})[_0x7995('0x26')](respondWithResult(_0x511567,0xc9))[_0x7995('0x49')](handleError(_0x511567,null));};exports['update']=function(_0x3d1dbb,_0x5843ba){if(_0x3d1dbb[_0x7995('0x4a')]['id']){delete _0x3d1dbb[_0x7995('0x4a')]['id'];}return db[_0x7995('0x40')][_0x7995('0x47')]({'where':{'id':_0x3d1dbb[_0x7995('0x4b')]['id']}})[_0x7995('0x26')](handleEntityNotFound(_0x5843ba,null))[_0x7995('0x26')](saveUpdates(_0x3d1dbb['body'],null))[_0x7995('0x26')](respondWithResult(_0x5843ba,null))[_0x7995('0x49')](handleError(_0x5843ba,null));};exports[_0x7995('0x27')]=function(_0x4ffc8a,_0x19da63){return db[_0x7995('0x4c')][_0x7995('0x41')]({'where':{'ChatOfflineMessageId':_0x4ffc8a['params']['id']},'raw':!![]})['then'](function(_0x5a592e){_0x5a592e[_0x7995('0x4d')](function(_0x1fd1ca){var _0x4cf5db=path[_0x7995('0x4e')](config[_0x7995('0x4f')],_0x7995('0x50'),_0x7995('0x51'),_0x7995('0x52'),'offline-chat',_0x1fd1ca[_0x7995('0x53')]);var _0x4ab09f=fs[_0x7995('0x54')](_0x4cf5db);if(_0x4ab09f)fs_extra[_0x7995('0x55')](_0x4cf5db);});})[_0x7995('0x26')](function(){return db['ChatOfflineMessage']['find']({'where':{'id':_0x4ffc8a['params']['id']},'individualHooks':!![]});})['then'](handleEntityNotFound(_0x19da63,null))[_0x7995('0x26')](removeEntity(_0x19da63,null))[_0x7995('0x49')](handleError(_0x19da63,null));};exports[_0x7995('0x56')]=function(_0x150261,_0x1d957e){return db[_0x7995('0x40')][_0x7995('0x56')]()[_0x7995('0x26')](respondWithResult(_0x1d957e,null))[_0x7995('0x49')](handleError(_0x1d957e,null));};
\ No newline at end of file
+var _0x9957=['sendStatus','status','json','undefined','count','offset','limit','set','Content-Range','reject','save','then','destroy','error','name','send','index','fieldName','type','key','model','map','keys','filters','intersection','query','attributes','fields','length','hasOwnProperty','nolimit','sort','where','filter','merge','VIRTUAL','options','ChatOfflineMessage','findAll','rows','show','rawAttributes','includeAll','include','find','create','catch','body','params','Attachment','forEach','join','root','server','files','attachments','basename','existsSync','remove','describe','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/license/util','../../mysqldb'];(function(_0x55de9d,_0x410c83){var _0xb81146=function(_0x1d0443){while(--_0x1d0443){_0x55de9d['push'](_0x55de9d['shift']());}};_0xb81146(++_0x410c83);}(_0x9957,0x93));var _0x7995=function(_0x6c993a,_0x5ea3ab){_0x6c993a=_0x6c993a-0x0;var _0x27f547=_0x9957[_0x6c993a];return _0x27f547;};'use strict';var emlformat=require(_0x7995('0x0'));var rimraf=require(_0x7995('0x1'));var zipdir=require(_0x7995('0x2'));var jsonpatch=require(_0x7995('0x3'));var rp=require('request-promise');var moment=require(_0x7995('0x4'));var BPromise=require(_0x7995('0x5'));var Mustache=require(_0x7995('0x6'));var util=require(_0x7995('0x7'));var path=require('path');var sox=require(_0x7995('0x8'));var csv=require(_0x7995('0x9'));var ejs=require(_0x7995('0xa'));var fs=require('fs');var fs_extra=require(_0x7995('0xb'));var _=require(_0x7995('0xc'));var squel=require(_0x7995('0xd'));var crypto=require('crypto');var jsforce=require(_0x7995('0xe'));var deskjs=require(_0x7995('0xf'));var toCsv=require('to-csv');var querystring=require(_0x7995('0x10'));var Papa=require(_0x7995('0x11'));var Redis=require(_0x7995('0x12'));var authService=require(_0x7995('0x13'));var qs=require(_0x7995('0x14'));var as=require(_0x7995('0x15'));var hardwareService=require(_0x7995('0x16'));var logger=require('../../config/logger')(_0x7995('0x17'));var utils=require(_0x7995('0x18'));var config=require('../../config/environment');var licenseUtil=require(_0x7995('0x19'));var db=require(_0x7995('0x1a'))['db'];function respondWithStatusCode(_0x19a27e,_0x385f00){_0x385f00=_0x385f00||0xcc;return function(_0x281576){if(_0x281576){return _0x19a27e[_0x7995('0x1b')](_0x385f00);}return _0x19a27e[_0x7995('0x1c')](_0x385f00)['end']();};}function respondWithResult(_0x58f5ad,_0x2b4e94){_0x2b4e94=_0x2b4e94||0xc8;return function(_0x2233dd){if(_0x2233dd){return _0x58f5ad[_0x7995('0x1c')](_0x2b4e94)[_0x7995('0x1d')](_0x2233dd);}};}function respondWithFilteredResult(_0x3f1d3e,_0x1a5310){return function(_0x2202ce){if(_0x2202ce){var _0x41cbf0=typeof _0x1a5310['offset']===_0x7995('0x1e')&&typeof _0x1a5310['limit']===_0x7995('0x1e');var _0x37f297=_0x2202ce[_0x7995('0x1f')];var _0x291317=_0x41cbf0?0x0:_0x1a5310[_0x7995('0x20')];var _0x37a7d4=_0x41cbf0?_0x2202ce['count']:_0x1a5310['offset']+_0x1a5310[_0x7995('0x21')];var _0x5e6f90;if(_0x37a7d4>=_0x37f297){_0x37a7d4=_0x37f297;_0x5e6f90=0xc8;}else{_0x5e6f90=0xce;}_0x3f1d3e['status'](_0x5e6f90);return _0x3f1d3e[_0x7995('0x22')](_0x7995('0x23'),_0x291317+'-'+_0x37a7d4+'/'+_0x37f297)['json'](_0x2202ce);}return null;};}function patchUpdates(_0x3a9b54){return function(_0x51f276){try{jsonpatch['apply'](_0x51f276,_0x3a9b54,!![]);}catch(_0x3e4c54){return BPromise[_0x7995('0x24')](_0x3e4c54);}return _0x51f276[_0x7995('0x25')]();};}function saveUpdates(_0x1a8568,_0x460924){return function(_0x1c278a){if(_0x1c278a){return _0x1c278a['update'](_0x1a8568)[_0x7995('0x26')](function(_0x46ee4b){return _0x46ee4b;});}return null;};}function removeEntity(_0x204507,_0x285437){return function(_0x563799){if(_0x563799){return _0x563799[_0x7995('0x27')]()[_0x7995('0x26')](function(){_0x204507[_0x7995('0x1c')](0xcc)['end']();});}};}function handleEntityNotFound(_0x39df42,_0x34e70c){return function(_0x401dc3){if(!_0x401dc3){_0x39df42[_0x7995('0x1b')](0x194);}return _0x401dc3;};}function handleError(_0x3a3fcf,_0x2a307e){_0x2a307e=_0x2a307e||0x1f4;return function(_0x56691a){logger[_0x7995('0x28')](_0x56691a['stack']);if(_0x56691a[_0x7995('0x29')]){delete _0x56691a[_0x7995('0x29')];}_0x3a3fcf[_0x7995('0x1c')](_0x2a307e)[_0x7995('0x2a')](_0x56691a);};}exports[_0x7995('0x2b')]=function(_0x4b6f99,_0x9b2a15){var _0x514445={},_0x456a28={},_0x3250e0={'count':0x0,'rows':[]};var _0x4253e5=_['map'](db['ChatOfflineMessage']['rawAttributes'],function(_0x3573be){return{'name':_0x3573be[_0x7995('0x2c')],'type':_0x3573be[_0x7995('0x2d')][_0x7995('0x2e')]};});_0x456a28[_0x7995('0x2f')]=_[_0x7995('0x30')](_0x4253e5,'name');_0x456a28['query']=_[_0x7995('0x31')](_0x4b6f99['query']);_0x456a28[_0x7995('0x32')]=_[_0x7995('0x33')](_0x456a28[_0x7995('0x2f')],_0x456a28[_0x7995('0x34')]);_0x514445[_0x7995('0x35')]=_['intersection'](_0x456a28[_0x7995('0x2f')],qs[_0x7995('0x36')](_0x4b6f99['query']['fields']));_0x514445['attributes']=_0x514445[_0x7995('0x35')][_0x7995('0x37')]?_0x514445['attributes']:_0x456a28[_0x7995('0x2f')];if(!_0x4b6f99['query'][_0x7995('0x38')](_0x7995('0x39'))){_0x514445[_0x7995('0x21')]=qs['limit'](_0x4b6f99['query'][_0x7995('0x21')]);_0x514445['offset']=qs['offset'](_0x4b6f99[_0x7995('0x34')][_0x7995('0x20')]);}_0x514445['order']=qs[_0x7995('0x3a')](_0x4b6f99[_0x7995('0x34')][_0x7995('0x3a')]);_0x514445[_0x7995('0x3b')]=qs[_0x7995('0x32')](_['pick'](_0x4b6f99[_0x7995('0x34')],_0x456a28[_0x7995('0x32')]),_0x4253e5);if(_0x4b6f99[_0x7995('0x34')][_0x7995('0x3c')]){_0x514445['where']=_[_0x7995('0x3d')](_0x514445[_0x7995('0x3b')],{'$or':_[_0x7995('0x30')](_0x4253e5,function(_0xe5ea43){if(_0xe5ea43[_0x7995('0x2d')]!==_0x7995('0x3e')){var _0x5688a1={};_0x5688a1[_0xe5ea43[_0x7995('0x29')]]={'$like':'%'+_0x4b6f99[_0x7995('0x34')][_0x7995('0x3c')]+'%'};return _0x5688a1;}})});}_0x514445=_[_0x7995('0x3d')]({},_0x514445,_0x4b6f99[_0x7995('0x3f')]);var _0x298fc2={'where':_0x514445[_0x7995('0x3b')]};return db[_0x7995('0x40')][_0x7995('0x1f')](_0x298fc2)[_0x7995('0x26')](function(_0x6fe77b){_0x3250e0[_0x7995('0x1f')]=_0x6fe77b;if(_0x4b6f99[_0x7995('0x34')]['includeAll']){_0x514445['include']=[{'all':!![]}];}return db[_0x7995('0x40')][_0x7995('0x41')](_0x514445);})['then'](function(_0x4b0855){_0x3250e0[_0x7995('0x42')]=_0x4b0855;return _0x3250e0;})['then'](respondWithFilteredResult(_0x9b2a15,_0x514445))['catch'](handleError(_0x9b2a15,null));};exports[_0x7995('0x43')]=function(_0x36e28b,_0x35c8ff){var _0x576b96={'raw':!![],'where':{'id':_0x36e28b['params']['id']}},_0x46ac4f={};_0x46ac4f[_0x7995('0x2f')]=_['keys'](db['ChatOfflineMessage'][_0x7995('0x44')]);_0x46ac4f[_0x7995('0x34')]=_[_0x7995('0x31')](_0x36e28b[_0x7995('0x34')]);_0x46ac4f['filters']=_[_0x7995('0x33')](_0x46ac4f[_0x7995('0x2f')],_0x46ac4f[_0x7995('0x34')]);_0x576b96[_0x7995('0x35')]=_['intersection'](_0x46ac4f['model'],qs[_0x7995('0x36')](_0x36e28b['query'][_0x7995('0x36')]));_0x576b96['attributes']=_0x576b96[_0x7995('0x35')]['length']?_0x576b96[_0x7995('0x35')]:_0x46ac4f[_0x7995('0x2f')];if(_0x36e28b['query'][_0x7995('0x45')]){_0x576b96[_0x7995('0x46')]=[{'all':!![]}];}_0x576b96=_[_0x7995('0x3d')]({},_0x576b96,_0x36e28b[_0x7995('0x3f')]);return db['ChatOfflineMessage'][_0x7995('0x47')](_0x576b96)[_0x7995('0x26')](handleEntityNotFound(_0x35c8ff,null))[_0x7995('0x26')](respondWithResult(_0x35c8ff,null))['catch'](handleError(_0x35c8ff,null));};exports[_0x7995('0x48')]=function(_0x44f516,_0x511567){return db[_0x7995('0x40')][_0x7995('0x48')](_0x44f516['body'],{})[_0x7995('0x26')](respondWithResult(_0x511567,0xc9))[_0x7995('0x49')](handleError(_0x511567,null));};exports['update']=function(_0x3d1dbb,_0x5843ba){if(_0x3d1dbb[_0x7995('0x4a')]['id']){delete _0x3d1dbb[_0x7995('0x4a')]['id'];}return db[_0x7995('0x40')][_0x7995('0x47')]({'where':{'id':_0x3d1dbb[_0x7995('0x4b')]['id']}})[_0x7995('0x26')](handleEntityNotFound(_0x5843ba,null))[_0x7995('0x26')](saveUpdates(_0x3d1dbb['body'],null))[_0x7995('0x26')](respondWithResult(_0x5843ba,null))[_0x7995('0x49')](handleError(_0x5843ba,null));};exports[_0x7995('0x27')]=function(_0x4ffc8a,_0x19da63){return db[_0x7995('0x4c')][_0x7995('0x41')]({'where':{'ChatOfflineMessageId':_0x4ffc8a['params']['id']},'raw':!![]})['then'](function(_0x5a592e){_0x5a592e[_0x7995('0x4d')](function(_0x1fd1ca){var _0x4cf5db=path[_0x7995('0x4e')](config[_0x7995('0x4f')],_0x7995('0x50'),_0x7995('0x51'),_0x7995('0x52'),'offline-chat',_0x1fd1ca[_0x7995('0x53')]);var _0x4ab09f=fs[_0x7995('0x54')](_0x4cf5db);if(_0x4ab09f)fs_extra[_0x7995('0x55')](_0x4cf5db);});})[_0x7995('0x26')](function(){return db['ChatOfflineMessage']['find']({'where':{'id':_0x4ffc8a['params']['id']},'individualHooks':!![]});})['then'](handleEntityNotFound(_0x19da63,null))[_0x7995('0x26')](removeEntity(_0x19da63,null))[_0x7995('0x49')](handleError(_0x19da63,null));};exports[_0x7995('0x56')]=function(_0x150261,_0x1d957e){return db[_0x7995('0x40')][_0x7995('0x56')]()[_0x7995('0x26')](respondWithResult(_0x1d957e,null))[_0x7995('0x49')](handleError(_0x1d957e,null));};
\ No newline at end of file
diff --git a/server/api/chatOfflineMessage/chatOfflineMessage.events.js b/server/api/chatOfflineMessage/chatOfflineMessage.events.js
index 05ca2ff..e9740ed 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 _0x1509=['ChatOfflineMessage','setMaxListeners','update','remove','emit','hasOwnProperty','hook','exports','events','../../mysqldb'];(function(_0x19e35c,_0x29cd1e){var _0x3e1fe8=function(_0x17258b){while(--_0x17258b){_0x19e35c['push'](_0x19e35c['shift']());}};_0x3e1fe8(++_0x29cd1e);}(_0x1509,0x15c));var _0x9150=function(_0x1b3812,_0x4f9418){_0x1b3812=_0x1b3812-0x0;var _0x450c01=_0x1509[_0x1b3812];return _0x450c01;};'use strict';var EventEmitter=require(_0x9150('0x0'));var ChatOfflineMessage=require(_0x9150('0x1'))['db'][_0x9150('0x2')];var ChatOfflineMessageEvents=new EventEmitter();ChatOfflineMessageEvents[_0x9150('0x3')](0x0);var events={'afterCreate':'save','afterUpdate':_0x9150('0x4'),'afterDestroy':_0x9150('0x5')};function emitEvent(_0x601dd5){return function(_0x13d2ec,_0x39c42d,_0x3d1a63){ChatOfflineMessageEvents['emit'](_0x601dd5+':'+_0x13d2ec['id'],_0x13d2ec);ChatOfflineMessageEvents[_0x9150('0x6')](_0x601dd5,_0x13d2ec);_0x3d1a63(null);};}for(var e in events){if(events[_0x9150('0x7')](e)){var event=events[e];ChatOfflineMessage[_0x9150('0x8')](e,emitEvent(event));}}module[_0x9150('0x9')]=ChatOfflineMessageEvents;
\ No newline at end of file
+var _0xda1f=['ChatOfflineMessage','setMaxListeners','save','update','remove','emit','hasOwnProperty','hook','exports','events','../../mysqldb'];(function(_0x5459b0,_0x4d2ef8){var _0x675a35=function(_0x538e11){while(--_0x538e11){_0x5459b0['push'](_0x5459b0['shift']());}};_0x675a35(++_0x4d2ef8);}(_0xda1f,0x18a));var _0xfda1=function(_0x5b27b9,_0x3f3943){_0x5b27b9=_0x5b27b9-0x0;var _0x3cb03e=_0xda1f[_0x5b27b9];return _0x3cb03e;};'use strict';var EventEmitter=require(_0xfda1('0x0'));var ChatOfflineMessage=require(_0xfda1('0x1'))['db'][_0xfda1('0x2')];var ChatOfflineMessageEvents=new EventEmitter();ChatOfflineMessageEvents[_0xfda1('0x3')](0x0);var events={'afterCreate':_0xfda1('0x4'),'afterUpdate':_0xfda1('0x5'),'afterDestroy':_0xfda1('0x6')};function emitEvent(_0x4fedce){return function(_0x3c2f4b,_0x3437ca,_0x2d4d73){ChatOfflineMessageEvents[_0xfda1('0x7')](_0x4fedce+':'+_0x3c2f4b['id'],_0x3c2f4b);ChatOfflineMessageEvents[_0xfda1('0x7')](_0x4fedce,_0x3c2f4b);_0x2d4d73(null);};}for(var e in events){if(events[_0xfda1('0x8')](e)){var event=events[e];ChatOfflineMessage[_0xfda1('0x9')](e,emitEvent(event));}}module[_0xfda1('0xa')]=ChatOfflineMessageEvents;
\ No newline at end of file
diff --git a/server/api/chatOfflineMessage/chatOfflineMessage.model.js b/server/api/chatOfflineMessage/chatOfflineMessage.model.js
index 591d358..e160427 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 _0xdc1e=['chat_offline_messages','utf8mb4','exports','define'];(function(_0xb875ee,_0x583042){var _0x4c7f3a=function(_0x1f6661){while(--_0x1f6661){_0xb875ee['push'](_0xb875ee['shift']());}};_0x4c7f3a(++_0x583042);}(_0xdc1e,0xa6));var _0xedc1=function(_0x571e79,_0x58e770){_0x571e79=_0x571e79-0x0;var _0x36b13b=_0xdc1e[_0x571e79];return _0x36b13b;};'use strict';var attributes=require('./chatOfflineMessage.attributes');module[_0xedc1('0x0')]=function(_0x25f89d){return _0x25f89d[_0xedc1('0x1')]('ChatOfflineMessage',attributes,{'tableName':_0xedc1('0x2'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0xedc1('0x3'),'collate':'utf8mb4_unicode_ci'});};
\ No newline at end of file
+var _0x741a=['chat_offline_messages','utf8mb4','utf8mb4_unicode_ci','exports','define','ChatOfflineMessage'];(function(_0x2bc3d2,_0x386d17){var _0x3b7dfe=function(_0x1b74d1){while(--_0x1b74d1){_0x2bc3d2['push'](_0x2bc3d2['shift']());}};_0x3b7dfe(++_0x386d17);}(_0x741a,0x135));var _0xa741=function(_0x2cde51,_0x41b85c){_0x2cde51=_0x2cde51-0x0;var _0x37177e=_0x741a[_0x2cde51];return _0x37177e;};'use strict';var attributes=require('./chatOfflineMessage.attributes');module[_0xa741('0x0')]=function(_0x52a40c){return _0x52a40c[_0xa741('0x1')](_0xa741('0x2'),attributes,{'tableName':_0xa741('0x3'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0xa741('0x4'),'collate':_0xa741('0x5')});};
\ No newline at end of file
diff --git a/server/api/chatOfflineMessage/chatOfflineMessage.rpc.js b/server/api/chatOfflineMessage/chatOfflineMessage.rpc.js
index bc278cb..6b81c0a 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 _0x76e4=['message','lodash','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','request','then','info','ChatOfflineMessage,\x20%s,\x20%s','request\x20sent','ChatOfflineMessage,\x20%s,\x20%s,\x20%s','error','code'];(function(_0x20ae15,_0x1828f5){var _0xc19495=function(_0x4d102a){while(--_0x4d102a){_0x20ae15['push'](_0x20ae15['shift']());}};_0xc19495(++_0x1828f5);}(_0x76e4,0x12d));var _0x476e=function(_0x70381f,_0x3ce152){_0x70381f=_0x70381f-0x0;var _0xc650ea=_0x76e4[_0x70381f];return _0xc650ea;};'use strict';var _=require(_0x476e('0x0'));var util=require('util');var moment=require(_0x476e('0x1'));var BPromise=require(_0x476e('0x2'));var rs=require(_0x476e('0x3'));var fs=require('fs');var Redis=require(_0x476e('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x476e('0x5'));var logger=require(_0x476e('0x6'))('rpc');var config=require(_0x476e('0x7'));var jayson=require(_0x476e('0x8'));var client=jayson[_0x476e('0x9')][_0x476e('0xa')]({'port':0x232a});function respondWithRpcPromise(_0xe6a8bc,_0x182cfc,_0x2a0f81){return new BPromise(function(_0x3f26eb,_0x18f94c){return client[_0x476e('0xb')](_0xe6a8bc,_0x2a0f81)[_0x476e('0xc')](function(_0x31e8e5){logger[_0x476e('0xd')](_0x476e('0xe'),_0x182cfc,_0x476e('0xf'));logger['debug'](_0x476e('0x10'),_0x182cfc,_0x476e('0xf'),JSON['stringify'](_0x31e8e5));if(_0x31e8e5['error']){if(_0x31e8e5[_0x476e('0x11')][_0x476e('0x12')]===0x1f4){logger[_0x476e('0x11')](_0x476e('0xe'),_0x182cfc,_0x31e8e5[_0x476e('0x11')][_0x476e('0x13')]);return _0x18f94c(_0x31e8e5[_0x476e('0x11')][_0x476e('0x13')]);}logger[_0x476e('0x11')](_0x476e('0xe'),_0x182cfc,_0x31e8e5['error'][_0x476e('0x13')]);return _0x3f26eb(_0x31e8e5[_0x476e('0x11')]['message']);}else{logger['info'](_0x476e('0xe'),_0x182cfc,_0x476e('0xf'));_0x3f26eb(_0x31e8e5['result'][_0x476e('0x13')]);}})['catch'](function(_0x2e8237){logger['error'](_0x476e('0xe'),_0x182cfc,_0x2e8237);_0x18f94c(_0x2e8237);});});}
\ No newline at end of file
+var _0x6170=['debug','ChatOfflineMessage,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','code','error','message','result','catch','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','then','ChatOfflineMessage,\x20%s,\x20%s'];(function(_0x4c632b,_0x3496bc){var _0x131619=function(_0x1c80f8){while(--_0x1c80f8){_0x4c632b['push'](_0x4c632b['shift']());}};_0x131619(++_0x3496bc);}(_0x6170,0x1d5));var _0x0617=function(_0x208c19,_0x3942a2){_0x208c19=_0x208c19-0x0;var _0x2d75c5=_0x6170[_0x208c19];return _0x2d75c5;};'use strict';var _=require(_0x0617('0x0'));var util=require('util');var moment=require(_0x0617('0x1'));var BPromise=require(_0x0617('0x2'));var rs=require(_0x0617('0x3'));var fs=require('fs');var Redis=require(_0x0617('0x4'));var db=require(_0x0617('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x0617('0x6'))(_0x0617('0x7'));var config=require(_0x0617('0x8'));var jayson=require(_0x0617('0x9'));var client=jayson[_0x0617('0xa')][_0x0617('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x1b49be,_0x1324b4,_0x39d9ee){return new BPromise(function(_0x4eb881,_0x25f482){return client['request'](_0x1b49be,_0x39d9ee)[_0x0617('0xc')](function(_0x2a84d9){logger['info'](_0x0617('0xd'),_0x1324b4,'request\x20sent');logger[_0x0617('0xe')](_0x0617('0xf'),_0x1324b4,_0x0617('0x10'),JSON[_0x0617('0x11')](_0x2a84d9));if(_0x2a84d9['error']){if(_0x2a84d9['error'][_0x0617('0x12')]===0x1f4){logger[_0x0617('0x13')]('ChatOfflineMessage,\x20%s,\x20%s',_0x1324b4,_0x2a84d9[_0x0617('0x13')][_0x0617('0x14')]);return _0x25f482(_0x2a84d9['error'][_0x0617('0x14')]);}logger[_0x0617('0x13')](_0x0617('0xd'),_0x1324b4,_0x2a84d9[_0x0617('0x13')][_0x0617('0x14')]);return _0x4eb881(_0x2a84d9[_0x0617('0x13')][_0x0617('0x14')]);}else{logger['info'](_0x0617('0xd'),_0x1324b4,_0x0617('0x10'));_0x4eb881(_0x2a84d9[_0x0617('0x15')]['message']);}})[_0x0617('0x16')](function(_0x517ae3){logger['error'](_0x0617('0xd'),_0x1324b4,_0x517ae3);_0x25f482(_0x517ae3);});});}
\ No newline at end of file
diff --git a/server/api/chatOfflineMessage/index.js b/server/api/chatOfflineMessage/index.js
index abb6b78..4baa76f 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 _0xfd54=['/describe','isAuthenticated','describe','show','post','create','put','delete','destroy','multer','util','path','express','Router','fs-extra','../../components/interaction/service','../../config/environment','./chatOfflineMessage.controller','get','index'];(function(_0x423097,_0x8a09f4){var _0x3a73f1=function(_0x9314f0){while(--_0x9314f0){_0x423097['push'](_0x423097['shift']());}};_0x3a73f1(++_0x8a09f4);}(_0xfd54,0x1ad));var _0x4fd5=function(_0x452fde,_0x50be29){_0x452fde=_0x452fde-0x0;var _0x533b5e=_0xfd54[_0x452fde];return _0x533b5e;};'use strict';var multer=require(_0x4fd5('0x0'));var util=require(_0x4fd5('0x1'));var path=require(_0x4fd5('0x2'));var timeout=require('connect-timeout');var express=require(_0x4fd5('0x3'));var router=express[_0x4fd5('0x4')]();var fs_extra=require(_0x4fd5('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0x4fd5('0x6'));var config=require(_0x4fd5('0x7'));var controller=require(_0x4fd5('0x8'));router[_0x4fd5('0x9')]('/',auth['isAuthenticated'](),controller[_0x4fd5('0xa')]);router['get'](_0x4fd5('0xb'),auth[_0x4fd5('0xc')](),controller[_0x4fd5('0xd')]);router[_0x4fd5('0x9')]('/:id',auth[_0x4fd5('0xc')](),controller[_0x4fd5('0xe')]);router[_0x4fd5('0xf')]('/',auth[_0x4fd5('0xc')](),controller[_0x4fd5('0x10')]);router[_0x4fd5('0x11')]('/:id',auth[_0x4fd5('0xc')](),controller['update']);router[_0x4fd5('0x12')]('/:id',auth[_0x4fd5('0xc')](),controller[_0x4fd5('0x13')]);module['exports']=router;
\ No newline at end of file
+var _0x91a0=['../../components/interaction/service','../../config/environment','./chatOfflineMessage.controller','get','isAuthenticated','index','/:id','show','create','put','update','destroy','exports','multer','util','path','express','Router','fs-extra','../../components/auth/service'];(function(_0x231486,_0xc3f646){var _0x1226f4=function(_0xc86f69){while(--_0xc86f69){_0x231486['push'](_0x231486['shift']());}};_0x1226f4(++_0xc3f646);}(_0x91a0,0xad));var _0x091a=function(_0x557fd2,_0x2c0a7a){_0x557fd2=_0x557fd2-0x0;var _0x1b54a2=_0x91a0[_0x557fd2];return _0x1b54a2;};'use strict';var multer=require(_0x091a('0x0'));var util=require(_0x091a('0x1'));var path=require(_0x091a('0x2'));var timeout=require('connect-timeout');var express=require(_0x091a('0x3'));var router=express[_0x091a('0x4')]();var fs_extra=require(_0x091a('0x5'));var auth=require(_0x091a('0x6'));var interaction=require(_0x091a('0x7'));var config=require(_0x091a('0x8'));var controller=require(_0x091a('0x9'));router[_0x091a('0xa')]('/',auth[_0x091a('0xb')](),controller[_0x091a('0xc')]);router['get']('/describe',auth[_0x091a('0xb')](),controller['describe']);router[_0x091a('0xa')](_0x091a('0xd'),auth[_0x091a('0xb')](),controller[_0x091a('0xe')]);router['post']('/',auth['isAuthenticated'](),controller[_0x091a('0xf')]);router[_0x091a('0x10')](_0x091a('0xd'),auth['isAuthenticated'](),controller[_0x091a('0x11')]);router['delete'](_0x091a('0xd'),auth['isAuthenticated'](),controller[_0x091a('0x12')]);module[_0x091a('0x13')]=router;
\ No newline at end of file
diff --git a/server/api/chatProactiveAction/chatProactiveAction.attributes.js b/server/api/chatProactiveAction/chatProactiveAction.attributes.js
index 9feee52..3f4d3cb 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 _0x590e=['timeout','INTEGER','exports','STRING','ENUM','mouseOver'];(function(_0x137625,_0x8ba94){var _0x3b9212=function(_0xa26ad9){while(--_0xa26ad9){_0x137625['push'](_0x137625['shift']());}};_0x3b9212(++_0x8ba94);}(_0x590e,0x1b8));var _0xe590=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x590e[_0x20a584];return _0x4b41a8;};'use strict';var Sequelize=require('sequelize');module[_0xe590('0x0')]={'name':{'type':Sequelize[_0xe590('0x1')],'allowNull':![]},'type':{'type':Sequelize[_0xe590('0x2')](_0xe590('0x3'),_0xe590('0x4')),'defaultValue':_0xe590('0x3')},'selector':{'type':Sequelize[_0xe590('0x1')]},'timeout':{'type':Sequelize[_0xe590('0x5')]}};
\ No newline at end of file
+var _0x56df=['exports','STRING','mouseOver','INTEGER','sequelize'];(function(_0x21b2e5,_0x57ed16){var _0x1d456b=function(_0x5a2260){while(--_0x5a2260){_0x21b2e5['push'](_0x21b2e5['shift']());}};_0x1d456b(++_0x57ed16);}(_0x56df,0xf4));var _0xf56d=function(_0x3fad0f,_0xc7abd7){_0x3fad0f=_0x3fad0f-0x0;var _0x5e13dd=_0x56df[_0x3fad0f];return _0x5e13dd;};'use strict';var Sequelize=require(_0xf56d('0x0'));module[_0xf56d('0x1')]={'name':{'type':Sequelize[_0xf56d('0x2')],'allowNull':![]},'type':{'type':Sequelize['ENUM'](_0xf56d('0x3'),'timeout'),'defaultValue':'mouseOver'},'selector':{'type':Sequelize[_0xf56d('0x2')]},'timeout':{'type':Sequelize[_0xf56d('0x4')]}};
\ No newline at end of file
diff --git a/server/api/chatProactiveAction/chatProactiveAction.controller.js b/server/api/chatProactiveAction/chatProactiveAction.controller.js
index 724d85d..3b55165 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 _0xa261=['limit','Content-Range','apply','save','then','error','stack','name','send','show','params','model','keys','ChatProactiveAction','filters','intersection','query','attributes','fields','length','includeAll','options','find','create','body','update','catch','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','sox','to-csv','ejs','fs-extra','lodash','crypto','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','end','json','offset','undefined'];(function(_0x12e3e3,_0x501eaf){var _0x26602e=function(_0x427882){while(--_0x427882){_0x12e3e3['push'](_0x12e3e3['shift']());}};_0x26602e(++_0x501eaf);}(_0xa261,0x1a3));var _0x1a26=function(_0x18341d,_0x39b468){_0x18341d=_0x18341d-0x0;var _0x4a69ea=_0xa261[_0x18341d];return _0x4a69ea;};'use strict';var emlformat=require(_0x1a26('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x1a26('0x1'));var jsonpatch=require(_0x1a26('0x2'));var rp=require(_0x1a26('0x3'));var moment=require(_0x1a26('0x4'));var BPromise=require(_0x1a26('0x5'));var Mustache=require('mustache');var util=require('util');var path=require('path');var sox=require(_0x1a26('0x6'));var csv=require(_0x1a26('0x7'));var ejs=require(_0x1a26('0x8'));var fs=require('fs');var fs_extra=require(_0x1a26('0x9'));var _=require(_0x1a26('0xa'));var squel=require('squel');var crypto=require(_0x1a26('0xb'));var jsforce=require('jsforce');var deskjs=require(_0x1a26('0xc'));var toCsv=require(_0x1a26('0x7'));var querystring=require(_0x1a26('0xd'));var Papa=require('papaparse');var Redis=require(_0x1a26('0xe'));var authService=require(_0x1a26('0xf'));var qs=require(_0x1a26('0x10'));var as=require(_0x1a26('0x11'));var hardwareService=require(_0x1a26('0x12'));var logger=require('../../config/logger')(_0x1a26('0x13'));var utils=require(_0x1a26('0x14'));var config=require(_0x1a26('0x15'));var licenseUtil=require(_0x1a26('0x16'));var db=require(_0x1a26('0x17'))['db'];function respondWithStatusCode(_0x36f211,_0x4db24e){_0x4db24e=_0x4db24e||0xcc;return function(_0x3396bf){if(_0x3396bf){return _0x36f211['sendStatus'](_0x4db24e);}return _0x36f211[_0x1a26('0x18')](_0x4db24e)[_0x1a26('0x19')]();};}function respondWithResult(_0xd3aede,_0x49398e){_0x49398e=_0x49398e||0xc8;return function(_0x2e5e02){if(_0x2e5e02){return _0xd3aede[_0x1a26('0x18')](_0x49398e)[_0x1a26('0x1a')](_0x2e5e02);}};}function respondWithFilteredResult(_0x354e7d,_0x1153ad){return function(_0x5a2d74){if(_0x5a2d74){var _0x30dd04=typeof _0x1153ad[_0x1a26('0x1b')]===_0x1a26('0x1c')&&typeof _0x1153ad[_0x1a26('0x1d')]===_0x1a26('0x1c');var _0x344c79=_0x5a2d74['count'];var _0x2f82a0=_0x30dd04?0x0:_0x1153ad['offset'];var _0x5ef863=_0x30dd04?_0x5a2d74['count']:_0x1153ad[_0x1a26('0x1b')]+_0x1153ad[_0x1a26('0x1d')];var _0x1ba20a;if(_0x5ef863>=_0x344c79){_0x5ef863=_0x344c79;_0x1ba20a=0xc8;}else{_0x1ba20a=0xce;}_0x354e7d[_0x1a26('0x18')](_0x1ba20a);return _0x354e7d['set'](_0x1a26('0x1e'),_0x2f82a0+'-'+_0x5ef863+'/'+_0x344c79)['json'](_0x5a2d74);}return null;};}function patchUpdates(_0x42c8af){return function(_0x2f7801){try{jsonpatch[_0x1a26('0x1f')](_0x2f7801,_0x42c8af,!![]);}catch(_0x2f4378){return BPromise['reject'](_0x2f4378);}return _0x2f7801[_0x1a26('0x20')]();};}function saveUpdates(_0x26a427,_0x28f7ae){return function(_0x4d76ad){if(_0x4d76ad){return _0x4d76ad['update'](_0x26a427)['then'](function(_0x4e67d6){return _0x4e67d6;});}return null;};}function removeEntity(_0x6550ee,_0x43fe62){return function(_0x128c00){if(_0x128c00){return _0x128c00['destroy']()[_0x1a26('0x21')](function(){_0x6550ee[_0x1a26('0x18')](0xcc)[_0x1a26('0x19')]();});}};}function handleEntityNotFound(_0x53eeb1,_0x3409bc){return function(_0x221643){if(!_0x221643){_0x53eeb1['sendStatus'](0x194);}return _0x221643;};}function handleError(_0x12a925,_0x24cfc9){_0x24cfc9=_0x24cfc9||0x1f4;return function(_0x7ac183){logger[_0x1a26('0x22')](_0x7ac183[_0x1a26('0x23')]);if(_0x7ac183[_0x1a26('0x24')]){delete _0x7ac183[_0x1a26('0x24')];}_0x12a925[_0x1a26('0x18')](_0x24cfc9)[_0x1a26('0x25')](_0x7ac183);};}exports[_0x1a26('0x26')]=function(_0x405cec,_0x58c63d){var _0x256226={'raw':!![],'where':{'id':_0x405cec[_0x1a26('0x27')]['id']}},_0x34e63e={};_0x34e63e[_0x1a26('0x28')]=_[_0x1a26('0x29')](db[_0x1a26('0x2a')]['rawAttributes']);_0x34e63e['query']=_['keys'](_0x405cec['query']);_0x34e63e[_0x1a26('0x2b')]=_[_0x1a26('0x2c')](_0x34e63e['model'],_0x34e63e[_0x1a26('0x2d')]);_0x256226[_0x1a26('0x2e')]=_[_0x1a26('0x2c')](_0x34e63e[_0x1a26('0x28')],qs[_0x1a26('0x2f')](_0x405cec[_0x1a26('0x2d')][_0x1a26('0x2f')]));_0x256226['attributes']=_0x256226['attributes'][_0x1a26('0x30')]?_0x256226[_0x1a26('0x2e')]:_0x34e63e[_0x1a26('0x28')];if(_0x405cec[_0x1a26('0x2d')][_0x1a26('0x31')]){_0x256226['include']=[{'all':!![]}];}_0x256226=_['merge']({},_0x256226,_0x405cec[_0x1a26('0x32')]);return db['ChatProactiveAction'][_0x1a26('0x33')](_0x256226)[_0x1a26('0x21')](handleEntityNotFound(_0x58c63d,null))[_0x1a26('0x21')](respondWithResult(_0x58c63d,null))['catch'](handleError(_0x58c63d,null));};exports[_0x1a26('0x34')]=function(_0x40a9f9,_0x1134d9){return db['ChatProactiveAction'][_0x1a26('0x34')](_0x40a9f9[_0x1a26('0x35')],{})[_0x1a26('0x21')](respondWithResult(_0x1134d9,0xc9))['catch'](handleError(_0x1134d9,null));};exports[_0x1a26('0x36')]=function(_0x25308c,_0x374d17){if(_0x25308c['body']['id']){delete _0x25308c[_0x1a26('0x35')]['id'];}return db[_0x1a26('0x2a')][_0x1a26('0x33')]({'where':{'id':_0x25308c[_0x1a26('0x27')]['id']}})[_0x1a26('0x21')](handleEntityNotFound(_0x374d17,null))[_0x1a26('0x21')](saveUpdates(_0x25308c[_0x1a26('0x35')],null))['then'](respondWithResult(_0x374d17,null))[_0x1a26('0x37')](handleError(_0x374d17,null));};exports['destroy']=function(_0x139600,_0xe3a339){return db['ChatProactiveAction'][_0x1a26('0x33')]({'where':{'id':_0x139600['params']['id']}})['then'](handleEntityNotFound(_0xe3a339,null))[_0x1a26('0x21')](removeEntity(_0xe3a339,null))[_0x1a26('0x37')](handleError(_0xe3a339,null));};
\ No newline at end of file
+var _0x455d=['save','update','then','end','stack','name','send','show','params','keys','rawAttributes','query','filters','intersection','model','fields','attributes','length','includeAll','include','merge','options','find','catch','create','ChatProactiveAction','body','destroy','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','crypto','jsforce','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','json','undefined','limit','count','offset','set','apply'];(function(_0x596a5b,_0x51af41){var _0x1b7e71=function(_0x37cb7d){while(--_0x37cb7d){_0x596a5b['push'](_0x596a5b['shift']());}};_0x1b7e71(++_0x51af41);}(_0x455d,0x190));var _0xd455=function(_0x4a88b5,_0x5aba47){_0x4a88b5=_0x4a88b5-0x0;var _0x4e8aa0=_0x455d[_0x4a88b5];return _0x4e8aa0;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0xd455('0x0'));var jsonpatch=require(_0xd455('0x1'));var rp=require(_0xd455('0x2'));var moment=require('moment');var BPromise=require(_0xd455('0x3'));var Mustache=require(_0xd455('0x4'));var util=require(_0xd455('0x5'));var path=require(_0xd455('0x6'));var sox=require(_0xd455('0x7'));var csv=require(_0xd455('0x8'));var ejs=require(_0xd455('0x9'));var fs=require('fs');var fs_extra=require(_0xd455('0xa'));var _=require(_0xd455('0xb'));var squel=require('squel');var crypto=require(_0xd455('0xc'));var jsforce=require(_0xd455('0xd'));var deskjs=require('desk.js');var toCsv=require(_0xd455('0x8'));var querystring=require(_0xd455('0xe'));var Papa=require(_0xd455('0xf'));var Redis=require(_0xd455('0x10'));var authService=require('../../components/auth/service');var qs=require(_0xd455('0x11'));var as=require(_0xd455('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xd455('0x13'))(_0xd455('0x14'));var utils=require(_0xd455('0x15'));var config=require(_0xd455('0x16'));var licenseUtil=require(_0xd455('0x17'));var db=require(_0xd455('0x18'))['db'];function respondWithStatusCode(_0x4cc3c1,_0x488c4b){_0x488c4b=_0x488c4b||0xcc;return function(_0x272ce4){if(_0x272ce4){return _0x4cc3c1[_0xd455('0x19')](_0x488c4b);}return _0x4cc3c1[_0xd455('0x1a')](_0x488c4b)['end']();};}function respondWithResult(_0x2ec160,_0x39fa8b){_0x39fa8b=_0x39fa8b||0xc8;return function(_0xca260c){if(_0xca260c){return _0x2ec160[_0xd455('0x1a')](_0x39fa8b)[_0xd455('0x1b')](_0xca260c);}};}function respondWithFilteredResult(_0x1958ca,_0xbcde64){return function(_0x28b621){if(_0x28b621){var _0x205f3b=typeof _0xbcde64['offset']===_0xd455('0x1c')&&typeof _0xbcde64[_0xd455('0x1d')]===_0xd455('0x1c');var _0x33e2ad=_0x28b621[_0xd455('0x1e')];var _0x1408a3=_0x205f3b?0x0:_0xbcde64[_0xd455('0x1f')];var _0x4c0bbb=_0x205f3b?_0x28b621[_0xd455('0x1e')]:_0xbcde64['offset']+_0xbcde64[_0xd455('0x1d')];var _0x43d85b;if(_0x4c0bbb>=_0x33e2ad){_0x4c0bbb=_0x33e2ad;_0x43d85b=0xc8;}else{_0x43d85b=0xce;}_0x1958ca[_0xd455('0x1a')](_0x43d85b);return _0x1958ca[_0xd455('0x20')]('Content-Range',_0x1408a3+'-'+_0x4c0bbb+'/'+_0x33e2ad)['json'](_0x28b621);}return null;};}function patchUpdates(_0x636ec3){return function(_0xfb071c){try{jsonpatch[_0xd455('0x21')](_0xfb071c,_0x636ec3,!![]);}catch(_0x219c58){return BPromise['reject'](_0x219c58);}return _0xfb071c[_0xd455('0x22')]();};}function saveUpdates(_0x2bafc4,_0x518e5c){return function(_0x25d7ad){if(_0x25d7ad){return _0x25d7ad[_0xd455('0x23')](_0x2bafc4)[_0xd455('0x24')](function(_0x349313){return _0x349313;});}return null;};}function removeEntity(_0x4becf3,_0x27d526){return function(_0x5341be){if(_0x5341be){return _0x5341be['destroy']()['then'](function(){_0x4becf3[_0xd455('0x1a')](0xcc)[_0xd455('0x25')]();});}};}function handleEntityNotFound(_0x4fd832,_0x20b320){return function(_0x3dd015){if(!_0x3dd015){_0x4fd832[_0xd455('0x19')](0x194);}return _0x3dd015;};}function handleError(_0x40c0fe,_0x26a9f4){_0x26a9f4=_0x26a9f4||0x1f4;return function(_0x2a5652){logger['error'](_0x2a5652[_0xd455('0x26')]);if(_0x2a5652[_0xd455('0x27')]){delete _0x2a5652[_0xd455('0x27')];}_0x40c0fe[_0xd455('0x1a')](_0x26a9f4)[_0xd455('0x28')](_0x2a5652);};}exports[_0xd455('0x29')]=function(_0x30eff6,_0x1cc374){var _0xc417f1={'raw':!![],'where':{'id':_0x30eff6[_0xd455('0x2a')]['id']}},_0x5ec076={};_0x5ec076['model']=_[_0xd455('0x2b')](db['ChatProactiveAction'][_0xd455('0x2c')]);_0x5ec076[_0xd455('0x2d')]=_[_0xd455('0x2b')](_0x30eff6['query']);_0x5ec076[_0xd455('0x2e')]=_[_0xd455('0x2f')](_0x5ec076[_0xd455('0x30')],_0x5ec076['query']);_0xc417f1['attributes']=_[_0xd455('0x2f')](_0x5ec076['model'],qs['fields'](_0x30eff6[_0xd455('0x2d')][_0xd455('0x31')]));_0xc417f1[_0xd455('0x32')]=_0xc417f1[_0xd455('0x32')][_0xd455('0x33')]?_0xc417f1[_0xd455('0x32')]:_0x5ec076[_0xd455('0x30')];if(_0x30eff6[_0xd455('0x2d')][_0xd455('0x34')]){_0xc417f1[_0xd455('0x35')]=[{'all':!![]}];}_0xc417f1=_[_0xd455('0x36')]({},_0xc417f1,_0x30eff6[_0xd455('0x37')]);return db['ChatProactiveAction'][_0xd455('0x38')](_0xc417f1)[_0xd455('0x24')](handleEntityNotFound(_0x1cc374,null))[_0xd455('0x24')](respondWithResult(_0x1cc374,null))[_0xd455('0x39')](handleError(_0x1cc374,null));};exports[_0xd455('0x3a')]=function(_0xd292f4,_0x3f3d7c){return db[_0xd455('0x3b')][_0xd455('0x3a')](_0xd292f4[_0xd455('0x3c')],{})[_0xd455('0x24')](respondWithResult(_0x3f3d7c,0xc9))[_0xd455('0x39')](handleError(_0x3f3d7c,null));};exports[_0xd455('0x23')]=function(_0xd7d621,_0x44e8c0){if(_0xd7d621[_0xd455('0x3c')]['id']){delete _0xd7d621[_0xd455('0x3c')]['id'];}return db[_0xd455('0x3b')][_0xd455('0x38')]({'where':{'id':_0xd7d621[_0xd455('0x2a')]['id']}})[_0xd455('0x24')](handleEntityNotFound(_0x44e8c0,null))[_0xd455('0x24')](saveUpdates(_0xd7d621[_0xd455('0x3c')],null))[_0xd455('0x24')](respondWithResult(_0x44e8c0,null))[_0xd455('0x39')](handleError(_0x44e8c0,null));};exports[_0xd455('0x3d')]=function(_0x116b28,_0x469b88){return db[_0xd455('0x3b')][_0xd455('0x38')]({'where':{'id':_0x116b28[_0xd455('0x2a')]['id']}})[_0xd455('0x24')](handleEntityNotFound(_0x469b88,null))[_0xd455('0x24')](removeEntity(_0x469b88,null))['catch'](handleError(_0x469b88,null));};
\ No newline at end of file
diff --git a/server/api/chatProactiveAction/chatProactiveAction.model.js b/server/api/chatProactiveAction/chatProactiveAction.model.js
index 27afae9..1dd2635 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 _0xe7c1=['exports','define','ChatProactiveAction','chat_proactive_actions','lodash','util','../../config/logger','api','request-promise','path','../../config/environment','./chatProactiveAction.attributes'];(function(_0x489f00,_0x2c890d){var _0x1a1d35=function(_0x58f62f){while(--_0x58f62f){_0x489f00['push'](_0x489f00['shift']());}};_0x1a1d35(++_0x2c890d);}(_0xe7c1,0x148));var _0x1e7c=function(_0x17d9e3,_0x1f969c){_0x17d9e3=_0x17d9e3-0x0;var _0x14192d=_0xe7c1[_0x17d9e3];return _0x14192d;};'use strict';var _=require(_0x1e7c('0x0'));var util=require(_0x1e7c('0x1'));var logger=require(_0x1e7c('0x2'))(_0x1e7c('0x3'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x1e7c('0x4'));var fs=require('fs');var path=require(_0x1e7c('0x5'));var rimraf=require('rimraf');var config=require(_0x1e7c('0x6'));var attributes=require(_0x1e7c('0x7'));module[_0x1e7c('0x8')]=function(_0x553ee0,_0x413897){return _0x553ee0[_0x1e7c('0x9')](_0x1e7c('0xa'),attributes,{'tableName':_0x1e7c('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x51cc=['ChatProactiveAction','lodash','util','../../config/logger','api','bluebird','path','rimraf','./chatProactiveAction.attributes','exports','define'];(function(_0x2ec461,_0x5f588a){var _0x28603d=function(_0x21114b){while(--_0x21114b){_0x2ec461['push'](_0x2ec461['shift']());}};_0x28603d(++_0x5f588a);}(_0x51cc,0x85));var _0xc51c=function(_0x17d9e3,_0x1f969c){_0x17d9e3=_0x17d9e3-0x0;var _0x14192d=_0x51cc[_0x17d9e3];return _0x14192d;};'use strict';var _=require(_0xc51c('0x0'));var util=require(_0xc51c('0x1'));var logger=require(_0xc51c('0x2'))(_0xc51c('0x3'));var moment=require('moment');var BPromise=require(_0xc51c('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xc51c('0x5'));var rimraf=require(_0xc51c('0x6'));var config=require('../../config/environment');var attributes=require(_0xc51c('0x7'));module[_0xc51c('0x8')]=function(_0x45fac7,_0x1a601b){return _0x45fac7[_0xc51c('0x9')](_0xc51c('0xa'),attributes,{'tableName':'chat_proactive_actions','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
diff --git a/server/api/chatProactiveAction/chatProactiveAction.rpc.js b/server/api/chatProactiveAction/chatProactiveAction.rpc.js
index d6538ad..5191233 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 _0x3dc9=['randomstring','../../config/utils','../../config/environment','jayson/promise','request','then','info','ChatProactiveAction,\x20%s,\x20%s','request\x20sent','ChatProactiveAction,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','lodash','util','moment','bluebird'];(function(_0x2c93e2,_0x4fb5e2){var _0x57264e=function(_0x386895){while(--_0x386895){_0x2c93e2['push'](_0x2c93e2['shift']());}};_0x57264e(++_0x4fb5e2);}(_0x3dc9,0xa7));var _0x93dc=function(_0x3d9796,_0x24b5bd){_0x3d9796=_0x3d9796-0x0;var _0x553455=_0x3dc9[_0x3d9796];return _0x553455;};'use strict';var _=require(_0x93dc('0x0'));var util=require(_0x93dc('0x1'));var moment=require(_0x93dc('0x2'));var BPromise=require(_0x93dc('0x3'));var rs=require(_0x93dc('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x93dc('0x5'));var logger=require('../../config/logger')('rpc');var config=require(_0x93dc('0x6'));var jayson=require(_0x93dc('0x7'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x3ec3d7,_0x2e4a60,_0x3b4d55){return new BPromise(function(_0x120cd7,_0x5dded5){return client[_0x93dc('0x8')](_0x3ec3d7,_0x3b4d55)[_0x93dc('0x9')](function(_0x5446ed){logger[_0x93dc('0xa')](_0x93dc('0xb'),_0x2e4a60,_0x93dc('0xc'));logger['debug'](_0x93dc('0xd'),_0x2e4a60,'request\x20sent',JSON[_0x93dc('0xe')](_0x5446ed));if(_0x5446ed[_0x93dc('0xf')]){if(_0x5446ed['error'][_0x93dc('0x10')]===0x1f4){logger['error'](_0x93dc('0xb'),_0x2e4a60,_0x5446ed['error'][_0x93dc('0x11')]);return _0x5dded5(_0x5446ed[_0x93dc('0xf')][_0x93dc('0x11')]);}logger['error']('ChatProactiveAction,\x20%s,\x20%s',_0x2e4a60,_0x5446ed['error'][_0x93dc('0x11')]);return _0x120cd7(_0x5446ed['error'][_0x93dc('0x11')]);}else{logger[_0x93dc('0xa')]('ChatProactiveAction,\x20%s,\x20%s',_0x2e4a60,'request\x20sent');_0x120cd7(_0x5446ed[_0x93dc('0x12')][_0x93dc('0x11')]);}})['catch'](function(_0x2ea1d5){logger['error'](_0x93dc('0xb'),_0x2e4a60,_0x2ea1d5);_0x5dded5(_0x2ea1d5);});});}
\ No newline at end of file
+var _0x64c2=['client','http','then','info','request\x20sent','debug','ChatProactiveAction,\x20%s,\x20%s,\x20%s','stringify','error','code','ChatProactiveAction,\x20%s,\x20%s','message','catch','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment'];(function(_0x302d62,_0x1159b5){var _0xec9d70=function(_0x5d6c67){while(--_0x5d6c67){_0x302d62['push'](_0x302d62['shift']());}};_0xec9d70(++_0x1159b5);}(_0x64c2,0x194));var _0x264c=function(_0x1bb1f6,_0x38709d){_0x1bb1f6=_0x1bb1f6-0x0;var _0x5698d8=_0x64c2[_0x1bb1f6];return _0x5698d8;};'use strict';var _=require(_0x264c('0x0'));var util=require(_0x264c('0x1'));var moment=require(_0x264c('0x2'));var BPromise=require('bluebird');var rs=require(_0x264c('0x3'));var fs=require('fs');var Redis=require(_0x264c('0x4'));var db=require(_0x264c('0x5'))['db'];var utils=require(_0x264c('0x6'));var logger=require(_0x264c('0x7'))(_0x264c('0x8'));var config=require(_0x264c('0x9'));var jayson=require('jayson/promise');var client=jayson[_0x264c('0xa')][_0x264c('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x54df58,_0x388487,_0x44cde4){return new BPromise(function(_0x20b0ab,_0x4bc271){return client['request'](_0x54df58,_0x44cde4)[_0x264c('0xc')](function(_0x1cc3e2){logger[_0x264c('0xd')]('ChatProactiveAction,\x20%s,\x20%s',_0x388487,_0x264c('0xe'));logger[_0x264c('0xf')](_0x264c('0x10'),_0x388487,_0x264c('0xe'),JSON[_0x264c('0x11')](_0x1cc3e2));if(_0x1cc3e2['error']){if(_0x1cc3e2[_0x264c('0x12')][_0x264c('0x13')]===0x1f4){logger[_0x264c('0x12')](_0x264c('0x14'),_0x388487,_0x1cc3e2[_0x264c('0x12')][_0x264c('0x15')]);return _0x4bc271(_0x1cc3e2['error'][_0x264c('0x15')]);}logger[_0x264c('0x12')]('ChatProactiveAction,\x20%s,\x20%s',_0x388487,_0x1cc3e2[_0x264c('0x12')][_0x264c('0x15')]);return _0x20b0ab(_0x1cc3e2[_0x264c('0x12')][_0x264c('0x15')]);}else{logger['info'](_0x264c('0x14'),_0x388487,'request\x20sent');_0x20b0ab(_0x1cc3e2['result'][_0x264c('0x15')]);}})[_0x264c('0x16')](function(_0x1ec561){logger['error'](_0x264c('0x14'),_0x388487,_0x1ec561);_0x4bc271(_0x1ec561);});});}
\ No newline at end of file
diff --git a/server/api/chatProactiveAction/index.js b/server/api/chatProactiveAction/index.js
index 285a230..cfd992b 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 _0x9957=['post','create','put','update','delete','destroy','exports','multer','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./chatProactiveAction.controller','get','/:id','isAuthenticated','show'];(function(_0x30182f,_0x30ce41){var _0x5207db=function(_0x50a417){while(--_0x50a417){_0x30182f['push'](_0x30182f['shift']());}};_0x5207db(++_0x30ce41);}(_0x9957,0x93));var _0x7995=function(_0x4cf98e,_0xba4b79){_0x4cf98e=_0x4cf98e-0x0;var _0x1623ac=_0x9957[_0x4cf98e];return _0x1623ac;};'use strict';var multer=require(_0x7995('0x0'));var util=require(_0x7995('0x1'));var path=require(_0x7995('0x2'));var timeout=require(_0x7995('0x3'));var express=require('express');var router=express[_0x7995('0x4')]();var fs_extra=require(_0x7995('0x5'));var auth=require(_0x7995('0x6'));var interaction=require(_0x7995('0x7'));var config=require('../../config/environment');var controller=require(_0x7995('0x8'));router[_0x7995('0x9')](_0x7995('0xa'),auth[_0x7995('0xb')](),controller[_0x7995('0xc')]);router[_0x7995('0xd')]('/',auth['isAuthenticated'](),controller[_0x7995('0xe')]);router[_0x7995('0xf')]('/:id',auth[_0x7995('0xb')](),controller[_0x7995('0x10')]);router[_0x7995('0x11')](_0x7995('0xa'),auth[_0x7995('0xb')](),controller[_0x7995('0x12')]);module[_0x7995('0x13')]=router;
\ No newline at end of file
+var _0xeff8=['isAuthenticated','show','post','create','put','destroy','multer','util','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatProactiveAction.controller','/:id'];(function(_0x550d12,_0x5384bd){var _0x12103d=function(_0x2a9834){while(--_0x2a9834){_0x550d12['push'](_0x550d12['shift']());}};_0x12103d(++_0x5384bd);}(_0xeff8,0x186));var _0x8eff=function(_0x2f3848,_0x48564d){_0x2f3848=_0x2f3848-0x0;var _0x102668=_0xeff8[_0x2f3848];return _0x102668;};'use strict';var multer=require(_0x8eff('0x0'));var util=require(_0x8eff('0x1'));var path=require('path');var timeout=require(_0x8eff('0x2'));var express=require(_0x8eff('0x3'));var router=express[_0x8eff('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x8eff('0x5'));var interaction=require(_0x8eff('0x6'));var config=require(_0x8eff('0x7'));var controller=require(_0x8eff('0x8'));router['get'](_0x8eff('0x9'),auth[_0x8eff('0xa')](),controller[_0x8eff('0xb')]);router[_0x8eff('0xc')]('/',auth['isAuthenticated'](),controller[_0x8eff('0xd')]);router[_0x8eff('0xe')](_0x8eff('0x9'),auth[_0x8eff('0xa')](),controller['update']);router['delete'](_0x8eff('0x9'),auth[_0x8eff('0xa')](),controller[_0x8eff('0xf')]);module['exports']=router;
\ No newline at end of file
diff --git a/server/api/chatQueue/chatQueue.attributes.js b/server/api/chatQueue/chatQueue.attributes.js
index 29e62b3..f8b0a6f 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 _0x45d0=['name','ENUM','rrmemory','beepall','sequelize','STRING'];(function(_0xbb9a63,_0x5ee35b){var _0x281450=function(_0x44c275){while(--_0x44c275){_0xbb9a63['push'](_0xbb9a63['shift']());}};_0x281450(++_0x5ee35b);}(_0x45d0,0x1d2));var _0x045d=function(_0x29042c,_0x5f355f){_0x29042c=_0x29042c-0x0;var _0xfccd0=_0x45d0[_0x29042c];return _0xfccd0;};'use strict';var Sequelize=require(_0x045d('0x0'));module['exports']={'name':{'type':Sequelize[_0x045d('0x1')],'unique':_0x045d('0x2'),'allowNull':![],'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize[_0x045d('0x1')]},'timeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0x045d('0x3')](_0x045d('0x4'),_0x045d('0x5'),'roundrobin')}};
\ No newline at end of file
+var _0xb2d2=['STRING','name','ENUM','beepall','roundrobin','sequelize','exports'];(function(_0x40a045,_0x516f0e){var _0x1a687c=function(_0x48c9fe){while(--_0x48c9fe){_0x40a045['push'](_0x40a045['shift']());}};_0x1a687c(++_0x516f0e);}(_0xb2d2,0x7c));var _0x2b2d=function(_0x3e9096,_0x517618){_0x3e9096=_0x3e9096-0x0;var _0x18210f=_0xb2d2[_0x3e9096];return _0x18210f;};'use strict';var Sequelize=require(_0x2b2d('0x0'));module[_0x2b2d('0x1')]={'name':{'type':Sequelize[_0x2b2d('0x2')],'unique':_0x2b2d('0x3'),'allowNull':![],'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize['STRING']},'timeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0x2b2d('0x4')]('rrmemory',_0x2b2d('0x5'),_0x2b2d('0x6'))}};
\ No newline at end of file
diff --git a/server/api/chatQueue/chatQueue.controller.js b/server/api/chatQueue/chatQueue.controller.js
index 4893ed5..3aaa8d9 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 _0x3443=['limit','count','Content-Range','update','then','ChatQueues','destroy','sendStatus','error','name','send','index','ChatQueue','fieldName','type','include','query','findAll','rows','catch','show','params','model','keys','rawAttributes','intersection','attributes','fields','length','includeAll','merge','options','find','create','body','get','user','UserProfileSection','userProfileId','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','describe','findOne','UserChatQueue','filters','hasOwnProperty','offset','order','sort','where','pick','map','filter','User','agent','chatPause','format','%s/%s','SIP','createdAt','updatedAt','getTeams','Team','nolimit','addTeams','ids','Agents','voicePause','flatMap','sequelize','transaction','each','findOrCreate','forEach','emit','userChatQueue:save','removeTeams','tq.TeamId','join','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','ChatQueueId\x20=\x20?','clone','QueryTypes','SELECT','every','TeamId','includes','all','isEmpty','removeAgents','userChatQueue:remove','omit','spread','isArray','getAgents','bluebird','util','lodash','squel','ioredis','../../config/logger','api','../../mysqldb','redis','localhost','./chatQueue.socket','register','status','end','json'];(function(_0x5a5651,_0x2b60b0){var _0x2582c5=function(_0x52bb86){while(--_0x52bb86){_0x5a5651['push'](_0x5a5651['shift']());}};_0x2582c5(++_0x2b60b0);}(_0x3443,0x1b1));var _0x3344=function(_0x3f2454,_0x34e0ff){_0x3f2454=_0x3f2454-0x0;var _0x29231b=_0x3443[_0x3f2454];return _0x29231b;};'use strict';var BPromise=require(_0x3344('0x0'));var util=require(_0x3344('0x1'));var _=require(_0x3344('0x2'));var squel=require(_0x3344('0x3'));var Redis=require(_0x3344('0x4'));var qs=require('../../components/parsers/qs');var logger=require(_0x3344('0x5'))(_0x3344('0x6'));var config=require('../../config/environment');var db=require(_0x3344('0x7'))['db'];config[_0x3344('0x8')]=_['defaults'](config[_0x3344('0x8')],{'host':_0x3344('0x9'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x3344('0x8')]));require(_0x3344('0xa'))[_0x3344('0xb')](socket);function respondWithStatusCode(_0x44c840,_0x4aca79){_0x4aca79=_0x4aca79||0xcc;return function(_0x5b7fa5){if(_0x5b7fa5){return _0x44c840['sendStatus'](_0x4aca79);}return _0x44c840[_0x3344('0xc')](_0x4aca79)[_0x3344('0xd')]();};}function respondWithResult(_0x215e8f,_0x325f01){_0x325f01=_0x325f01||0xc8;return function(_0x5adddf){if(_0x5adddf){return _0x215e8f[_0x3344('0xc')](_0x325f01)[_0x3344('0xe')](_0x5adddf);}};}function respondWithFilteredResult(_0x5bba34,_0x51d312){return function(_0x41f571){if(_0x41f571){var _0x49d8dc=typeof _0x51d312['offset']==='undefined'&&typeof _0x51d312[_0x3344('0xf')]==='undefined';var _0x34d157=_0x41f571[_0x3344('0x10')];var _0x221ef9=_0x49d8dc?0x0:_0x51d312['offset'];var _0x39cc81=_0x49d8dc?_0x41f571[_0x3344('0x10')]:_0x51d312['offset']+_0x51d312[_0x3344('0xf')];var _0x444068;if(_0x39cc81>=_0x34d157){_0x39cc81=_0x34d157;_0x444068=0xc8;}else{_0x444068=0xce;}_0x5bba34[_0x3344('0xc')](_0x444068);return _0x5bba34['set'](_0x3344('0x11'),_0x221ef9+'-'+_0x39cc81+'/'+_0x34d157)[_0x3344('0xe')](_0x41f571);}return null;};}function saveUpdates(_0x4bbf7e){return function(_0x2c828e){if(_0x2c828e){return _0x2c828e[_0x3344('0x12')](_0x4bbf7e)[_0x3344('0x13')](function(_0x1fb2e3){return _0x1fb2e3;});}return null;};}function removeEntity(_0x1e2e9a){return function(_0x4149d5){if(_0x4149d5){return _0x4149d5['destroy']()[_0x3344('0x13')](function(){var _0x3628d3=_0x4149d5['get']({'plain':!![]});var _0x233451=_0x3344('0x14');return db['UserProfileResource'][_0x3344('0x15')]({'where':{'type':_0x233451,'resourceId':_0x3628d3['id']}})[_0x3344('0x13')](function(){return _0x4149d5;});})[_0x3344('0x13')](function(){_0x1e2e9a[_0x3344('0xc')](0xcc)['end']();});}};}function handleEntityNotFound(_0x5b186a){return function(_0x1003ea){if(!_0x1003ea){_0x5b186a[_0x3344('0x16')](0x194);}return _0x1003ea;};}function handleError(_0x42428d,_0x3ab3b5){_0x3ab3b5=_0x3ab3b5||0x1f4;return function(_0x447cbf){logger[_0x3344('0x17')](_0x447cbf['stack']);if(_0x447cbf[_0x3344('0x18')]){delete _0x447cbf[_0x3344('0x18')];}_0x42428d[_0x3344('0xc')](_0x3ab3b5)[_0x3344('0x19')](_0x447cbf);};}exports[_0x3344('0x1a')]=function(_0x36de1a,_0x263b43){var _0x1e9471={};var _0x17b0a4={'count':0x0,'rows':[]};var _0x26dd46=_['map'](db[_0x3344('0x1b')]['rawAttributes'],function(_0x169e8a){return{'name':_0x169e8a[_0x3344('0x1c')],'type':_0x169e8a[_0x3344('0x1d')]['key']};});_0x1e9471=qs['getOptions'](_0x26dd46,_0x36de1a);var _0x1ea29f={'where':_0x1e9471['where']};return db[_0x3344('0x1b')][_0x3344('0x10')](_0x1ea29f)['then'](function(_0x111569){_0x17b0a4['count']=_0x111569;_0x1e9471['include']=qs[_0x3344('0x1e')](_0x36de1a[_0x3344('0x1f')]);return db[_0x3344('0x1b')][_0x3344('0x20')](_0x1e9471);})['then'](function(_0x523bcd){_0x17b0a4[_0x3344('0x21')]=_0x523bcd;return _0x17b0a4;})[_0x3344('0x13')](respondWithFilteredResult(_0x263b43,_0x1e9471))[_0x3344('0x22')](handleError(_0x263b43,null));};exports[_0x3344('0x23')]=function(_0xa8b4d4,_0x570eec){var _0x3db7a7={'raw':!![],'where':{'id':_0xa8b4d4[_0x3344('0x24')]['id']}},_0x3c50f5={};_0x3c50f5[_0x3344('0x25')]=_[_0x3344('0x26')](db['ChatQueue'][_0x3344('0x27')]);_0x3c50f5[_0x3344('0x1f')]=_[_0x3344('0x26')](_0xa8b4d4[_0x3344('0x1f')]);_0x3c50f5['filters']=_[_0x3344('0x28')](_0x3c50f5[_0x3344('0x25')],_0x3c50f5[_0x3344('0x1f')]);_0x3db7a7[_0x3344('0x29')]=_[_0x3344('0x28')](_0x3c50f5['model'],qs[_0x3344('0x2a')](_0xa8b4d4[_0x3344('0x1f')]['fields']));_0x3db7a7[_0x3344('0x29')]=_0x3db7a7[_0x3344('0x29')][_0x3344('0x2b')]?_0x3db7a7[_0x3344('0x29')]:_0x3c50f5[_0x3344('0x25')];if(_0xa8b4d4[_0x3344('0x1f')][_0x3344('0x2c')]){_0x3db7a7[_0x3344('0x1e')]=[{'all':!![]}];}_0x3db7a7=_[_0x3344('0x2d')]({},_0x3db7a7,_0xa8b4d4[_0x3344('0x2e')]);return db[_0x3344('0x1b')][_0x3344('0x2f')](_0x3db7a7)[_0x3344('0x13')](handleEntityNotFound(_0x570eec,null))[_0x3344('0x13')](respondWithResult(_0x570eec,null))['catch'](handleError(_0x570eec,null));};exports[_0x3344('0x30')]=function(_0x7f0c31,_0x337af9){return db[_0x3344('0x1b')][_0x3344('0x30')](_0x7f0c31[_0x3344('0x31')],{})['then'](function(_0xe5858){var _0xd5ee07=_0x7f0c31['user'][_0x3344('0x32')]({'plain':!![]});if(!_0xd5ee07)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0xd5ee07['role']===_0x3344('0x33')){var _0x301898=_0xe5858[_0x3344('0x32')]({'plain':!![]});var _0x257dc6=_0x3344('0x14');return db[_0x3344('0x34')]['find']({'where':{'name':_0x257dc6,'userProfileId':_0xd5ee07[_0x3344('0x35')]},'raw':!![]})[_0x3344('0x13')](function(_0x5b4912){if(_0x5b4912&&_0x5b4912[_0x3344('0x36')]===0x0){return db[_0x3344('0x37')][_0x3344('0x30')]({'name':_0x301898['name'],'resourceId':_0x301898['id'],'type':_0x5b4912['name'],'sectionId':_0x5b4912['id']},{})[_0x3344('0x13')](function(){return _0xe5858;});}else{return _0xe5858;}})[_0x3344('0x22')](function(_0x25a5b6){logger[_0x3344('0x17')](_0x3344('0x38'),_0x25a5b6);throw _0x25a5b6;});}return _0xe5858;})[_0x3344('0x13')](respondWithResult(_0x337af9,0xc9))['catch'](handleError(_0x337af9,null));};exports['update']=function(_0x114841,_0x468fdf){if(_0x114841[_0x3344('0x31')]['id']){delete _0x114841[_0x3344('0x31')]['id'];}return db[_0x3344('0x1b')][_0x3344('0x2f')]({'where':{'id':_0x114841[_0x3344('0x24')]['id']}})['then'](handleEntityNotFound(_0x468fdf,null))['then'](saveUpdates(_0x114841[_0x3344('0x31')],null))['then'](respondWithResult(_0x468fdf,null))[_0x3344('0x22')](handleError(_0x468fdf,null));};exports[_0x3344('0x15')]=function(_0x2fc8eb,_0x2d3b5e){return db[_0x3344('0x1b')][_0x3344('0x2f')]({'where':{'id':_0x2fc8eb[_0x3344('0x24')]['id']}})[_0x3344('0x13')](handleEntityNotFound(_0x2d3b5e,null))[_0x3344('0x13')](removeEntity(_0x2d3b5e,null))['catch'](handleError(_0x2d3b5e,null));};exports[_0x3344('0x39')]=function(_0x3f76ec,_0x402328){return db[_0x3344('0x1b')][_0x3344('0x39')]()['then'](respondWithResult(_0x402328,null))['catch'](handleError(_0x402328,null));};exports['getMembers']=function(_0x539b67,_0x47e744){var _0x171c18={'raw':!![],'where':{}},_0x3dc241={},_0x4547fe;return db[_0x3344('0x1b')][_0x3344('0x3a')]({'where':{'id':_0x539b67[_0x3344('0x24')]['id']}})['then'](handleEntityNotFound(_0x47e744,null))[_0x3344('0x13')](function(_0x5d04f9){if(_0x5d04f9){_0x4547fe=_0x5d04f9['get']({'plain':!![]});_0x3dc241['model']=_[_0x3344('0x26')](db[_0x3344('0x3b')][_0x3344('0x27')]);_0x3dc241[_0x3344('0x1f')]=_[_0x3344('0x26')](_0x539b67[_0x3344('0x1f')]);_0x3dc241[_0x3344('0x3c')]=_[_0x3344('0x28')](_0x3dc241['model'],_0x3dc241['query']);_0x171c18[_0x3344('0x29')]=_[_0x3344('0x28')](_0x3dc241[_0x3344('0x25')],qs['fields'](_0x539b67[_0x3344('0x1f')][_0x3344('0x2a')]));_0x171c18[_0x3344('0x29')]=_0x171c18[_0x3344('0x29')][_0x3344('0x2b')]?_0x171c18[_0x3344('0x29')]:_0x3dc241['model'];if(!_0x539b67[_0x3344('0x1f')][_0x3344('0x3d')]('nolimit')){_0x171c18[_0x3344('0xf')]=qs[_0x3344('0xf')](_0x539b67['query'][_0x3344('0xf')]);_0x171c18['offset']=qs[_0x3344('0x3e')](_0x539b67[_0x3344('0x1f')][_0x3344('0x3e')]);}_0x171c18[_0x3344('0x3f')]=qs[_0x3344('0x40')](_0x539b67[_0x3344('0x1f')]['sort']);_0x171c18[_0x3344('0x41')]=qs['filters'](_[_0x3344('0x42')](_0x539b67[_0x3344('0x1f')],_0x3dc241['filters']));_0x171c18[_0x3344('0x41')]['ChatQueueId']=_0x5d04f9['id'];if(_0x539b67[_0x3344('0x1f')]['filter']){_0x171c18['where']=_[_0x3344('0x2d')](_0x171c18['where'],{'$or':_[_0x3344('0x43')](_0x171c18['attributes'],function(_0x340948){var _0x4e1399={};_0x4e1399[_0x340948]={'$like':'%'+_0x539b67[_0x3344('0x1f')][_0x3344('0x44')]+'%'};return _0x4e1399;})});}_0x171c18=_[_0x3344('0x2d')]({},_0x171c18,_0x539b67[_0x3344('0x2e')]);return db[_0x3344('0x3b')][_0x3344('0x20')](_0x171c18);}})['then'](function(_0x5a2615){if(_0x5a2615){return db[_0x3344('0x45')]['findAndCountAll']({'where':{'id':_[_0x3344('0x43')](_0x5a2615,'UserId'),'role':_0x3344('0x46')},'attributes':['id',_0x3344('0x18'),_0x3344('0x47'),'updatedAt','createdAt']});}})[_0x3344('0x13')](function(_0x2c16e2){if(_0x2c16e2){return{'count':_0x2c16e2[_0x3344('0x10')],'rows':_[_0x3344('0x43')](_0x2c16e2[_0x3344('0x21')],function(_0x5e730b){return{'membername':_0x5e730b['name'],'UserId':_0x5e730b['id'],'queue_name':_0x4547fe[_0x3344('0x18')],'ChatQueueId':_0x4547fe['id'],'interface':util[_0x3344('0x48')](_0x3344('0x49'),_0x3344('0x4a'),_0x5e730b[_0x3344('0x18')]),'penalty':0x0,'paused':_0x5e730b[_0x3344('0x47')],'createdAt':_0x5e730b[_0x3344('0x4b')],'updatedAt':_0x5e730b[_0x3344('0x4c')]};})};}else{return{'count':0x0,'rows':[]};}})[_0x3344('0x13')](respondWithFilteredResult(_0x47e744,_0x171c18))[_0x3344('0x22')](handleError(_0x47e744,null));};exports[_0x3344('0x4d')]=function(_0x12ed59,_0x13fe30){var _0xbb5c54={};var _0x4cafe2={};var _0x10c316;var _0x52f092;return db[_0x3344('0x1b')][_0x3344('0x3a')]({'where':{'id':_0x12ed59['params']['id']}})[_0x3344('0x13')](handleEntityNotFound(_0x13fe30,null))[_0x3344('0x13')](function(_0x667468){if(_0x667468){_0x10c316=_0x667468;_0x4cafe2['model']=_[_0x3344('0x26')](db[_0x3344('0x4e')][_0x3344('0x27')]);_0x4cafe2[_0x3344('0x1f')]=_[_0x3344('0x26')](_0x12ed59[_0x3344('0x1f')]);_0x4cafe2[_0x3344('0x3c')]=_['intersection'](_0x4cafe2['model'],_0x4cafe2['query']);_0xbb5c54['attributes']=_[_0x3344('0x28')](_0x4cafe2[_0x3344('0x25')],qs[_0x3344('0x2a')](_0x12ed59[_0x3344('0x1f')][_0x3344('0x2a')]));_0xbb5c54[_0x3344('0x29')]=_0xbb5c54[_0x3344('0x29')][_0x3344('0x2b')]?_0xbb5c54[_0x3344('0x29')]:_0x4cafe2['model'];_0xbb5c54['order']=qs[_0x3344('0x40')](_0x12ed59[_0x3344('0x1f')][_0x3344('0x40')]);_0xbb5c54['where']=qs[_0x3344('0x3c')](_[_0x3344('0x42')](_0x12ed59[_0x3344('0x1f')],_0x4cafe2[_0x3344('0x3c')]));if(_0x12ed59[_0x3344('0x1f')][_0x3344('0x44')]){_0xbb5c54[_0x3344('0x41')]=_[_0x3344('0x2d')](_0xbb5c54[_0x3344('0x41')],{'$or':_[_0x3344('0x43')](_0xbb5c54[_0x3344('0x29')],function(_0x1f1094){var _0x16b842={};_0x16b842[_0x1f1094]={'$like':'%'+_0x12ed59['query'][_0x3344('0x44')]+'%'};return _0x16b842;})});}_0xbb5c54=_[_0x3344('0x2d')]({},_0xbb5c54,_0x12ed59[_0x3344('0x2e')]);return _0x10c316['getTeams'](_0xbb5c54);}})[_0x3344('0x13')](function(_0x311d34){if(_0x311d34){_0x52f092=_0x311d34['length'];if(!_0x12ed59[_0x3344('0x1f')][_0x3344('0x3d')](_0x3344('0x4f'))){_0xbb5c54[_0x3344('0xf')]=qs[_0x3344('0xf')](_0x12ed59[_0x3344('0x1f')][_0x3344('0xf')]);_0xbb5c54['offset']=qs[_0x3344('0x3e')](_0x12ed59[_0x3344('0x1f')]['offset']);}return _0x10c316[_0x3344('0x4d')](_0xbb5c54);}})[_0x3344('0x13')](function(_0xc4466c){if(_0xc4466c){return _0xc4466c?{'count':_0x52f092,'rows':_0xc4466c}:null;}})['then'](respondWithResult(_0x13fe30,null))[_0x3344('0x22')](handleError(_0x13fe30,null));};exports[_0x3344('0x50')]=function(_0x5679b8,_0x926f8b){var _0x241fd4=_0x5679b8['body'][_0x3344('0x51')];return db[_0x3344('0x4e')][_0x3344('0x20')]({'where':{'id':_0x241fd4},'attributes':['id'],'include':[{'model':db[_0x3344('0x45')],'as':_0x3344('0x52'),'attributes':['id','name','online',_0x3344('0x53'),'interface'],'raw':!![]}]})[_0x3344('0x13')](function(_0x5a3a40){if(_0x5a3a40){var _0x4d363c=_[_0x3344('0x54')](_0x5a3a40,function(_0x215f94){var _0x3302ee=_0x215f94[_0x3344('0x32')]({'plain':!![]});return _0x3302ee[_0x3344('0x52')];});return db[_0x3344('0x1b')][_0x3344('0x2f')]({'where':{'id':_0x5679b8[_0x3344('0x24')]['id']}})[_0x3344('0x13')](function(_0x2f211b){return db[_0x3344('0x55')][_0x3344('0x56')](function(_0x2e268a){return _0x2f211b[_0x3344('0x50')](_0x241fd4,{'transaction':_0x2e268a})['then'](function(){return BPromise[_0x3344('0x57')](_0x4d363c,function(_0x24b25e){return db[_0x3344('0x3b')][_0x3344('0x58')]({'where':{'UserId':_0x24b25e['id'],'ChatQueueId':_0x5679b8[_0x3344('0x24')]['id']},'transaction':_0x2e268a});});})['then'](function(){_0x4d363c[_0x3344('0x59')](function(_0x199645){socket[_0x3344('0x5a')](_0x3344('0x5b'),{'UserId':_0x199645['id'],'ChatQueueId':_0x2f211b['id']});});});});});}})['then'](respondWithStatusCode(_0x926f8b,null))[_0x3344('0x22')](handleError(_0x926f8b,null));};exports[_0x3344('0x5c')]=function(_0xbfda64,_0x557ea8){return db['Team'][_0x3344('0x20')]({'where':{'id':_0xbfda64['query']['ids']},'attributes':['id'],'include':[{'model':db['User'],'as':_0x3344('0x52'),'attributes':['id'],'raw':!![]}]})[_0x3344('0x13')](handleEntityNotFound(_0x557ea8,null))[_0x3344('0x13')](function(_0x3892e9){var _0x290faa=_[_0x3344('0x43')](_0x3892e9,'id');var _0x18cad3=[];var _0x23d7d8=[];var _0x33083b=squel['select']();_0x33083b['field'](_0x3344('0x5d'))['from']('team_has_chat_queues','tq')[_0x3344('0x5e')](_0x3344('0x5f'),'ut',_0x3344('0x60'))['where'](_0x3344('0x61'),_0xbfda64[_0x3344('0x24')]['id']);for(var _0x22f8d4=0x0;_0x22f8d4<_0x3892e9['length'];_0x22f8d4+=0x1){let _0x2a6540=_0x3892e9[_0x22f8d4];for(var _0x33ce18=0x0;_0x33ce18<_0x2a6540[_0x3344('0x52')][_0x3344('0x2b')];_0x33ce18+=0x1){let _0x83fc04=_0x2a6540[_0x3344('0x52')][_0x33ce18];var _0x40a829=_0x33083b[_0x3344('0x62')]();_0x40a829[_0x3344('0x41')]('ut.UserId\x20=\x20?',_0x83fc04['id']);_0x23d7d8['push'](db['sequelize'][_0x3344('0x1f')](_0x40a829['toString'](),{'type':db['sequelize'][_0x3344('0x63')][_0x3344('0x64')]})[_0x3344('0x13')](function(_0x5ab369){if(_0x5ab369[_0x3344('0x2b')]===0x1){return _0x83fc04['id'];}else{var _0xf29c11=_[_0x3344('0x65')](_[_0x3344('0x43')](_0x5ab369,_0x3344('0x66')),function(_0x17c227){return _[_0x3344('0x67')](_0x290faa,_0x17c227);});if(_0xf29c11){return _0x83fc04['id'];}}}));}}return BPromise[_0x3344('0x68')](_0x23d7d8)['then'](function(_0x198bc2){_0x18cad3=_(_0x18cad3)['union'](_0x198bc2)['compact']()['value']();return db[_0x3344('0x1b')][_0x3344('0x2f')]({'where':{'id':_0xbfda64[_0x3344('0x24')]['id']}})[_0x3344('0x13')](function(_0x41f087){return db['sequelize']['transaction'](function(_0x2c68b2){return _0x41f087[_0x3344('0x5c')](_0xbfda64[_0x3344('0x1f')]['ids'],{'transaction':_0x2c68b2})['then'](function(){if(!_[_0x3344('0x69')](_0x18cad3)){return _0x41f087[_0x3344('0x6a')](_0x18cad3,{'transaction':_0x2c68b2});}})[_0x3344('0x13')](function(){_0x18cad3[_0x3344('0x59')](function(_0x42a344){socket[_0x3344('0x5a')](_0x3344('0x6b'),{'UserId':_0x42a344,'ChatQueueId':_0x41f087['id']});});});});});});})[_0x3344('0x13')](respondWithStatusCode(_0x557ea8,null))[_0x3344('0x22')](handleError(_0x557ea8,null));};exports['addAgents']=function(_0x18e9bf,_0x744478){return db[_0x3344('0x1b')]['find']({'where':{'id':_0x18e9bf[_0x3344('0x24')]['id']}})[_0x3344('0x13')](handleEntityNotFound(_0x744478,null))[_0x3344('0x13')](function(_0x3ba6fb){if(_0x3ba6fb){return _0x3ba6fb['addAgents'](_0x18e9bf[_0x3344('0x31')]['ids'],_[_0x3344('0x6c')](_0x18e9bf[_0x3344('0x31')],[_0x3344('0x51'),'id'])||{})[_0x3344('0x6d')](function(_0x2b4da2){for(var _0x3ea322=0x0;_0x3ea322<_0x18e9bf['body']['ids'][_0x3344('0x2b')];_0x3ea322+=0x1){socket['emit'](_0x3344('0x5b'),{'UserId':Number(_0x18e9bf[_0x3344('0x31')]['ids'][_0x3ea322]),'ChatQueueId':Number(_0x18e9bf[_0x3344('0x24')]['id'])});}return _0x2b4da2;});}})[_0x3344('0x13')](respondWithResult(_0x744478,null))[_0x3344('0x22')](handleError(_0x744478,null));};exports['removeAgents']=function(_0x3a1426,_0xda02fe){return db[_0x3344('0x1b')][_0x3344('0x2f')]({'where':{'id':_0x3a1426[_0x3344('0x24')]['id']}})[_0x3344('0x13')](handleEntityNotFound(_0xda02fe,null))[_0x3344('0x13')](function(_0x1d1226){if(_0x1d1226){return _0x1d1226[_0x3344('0x6a')](_0x3a1426[_0x3344('0x1f')]['ids'])[_0x3344('0x13')](function(){if(_[_0x3344('0x6e')](_0x3a1426['query'][_0x3344('0x51')])){for(var _0x1b181c=0x0;_0x1b181c<_0x3a1426[_0x3344('0x1f')]['ids'][_0x3344('0x2b')];_0x1b181c+=0x1){socket[_0x3344('0x5a')](_0x3344('0x6b'),{'UserId':Number(_0x3a1426[_0x3344('0x1f')][_0x3344('0x51')][_0x1b181c]),'ChatQueueId':Number(_0x3a1426[_0x3344('0x24')]['id'])});}}else{socket[_0x3344('0x5a')](_0x3344('0x6b'),{'UserId':Number(_0x3a1426[_0x3344('0x1f')]['ids']),'ChatQueueId':Number(_0x3a1426[_0x3344('0x24')]['id'])});}});}})[_0x3344('0x13')](respondWithStatusCode(_0xda02fe,null))[_0x3344('0x22')](handleError(_0xda02fe,null));};exports[_0x3344('0x6f')]=function(_0x4af34f,_0x5efa00){var _0x162ead={};var _0xacc607={};var _0x5fab5d;var _0x1058a5;return db['ChatQueue'][_0x3344('0x3a')]({'where':{'id':_0x4af34f[_0x3344('0x24')]['id']}})['then'](handleEntityNotFound(_0x5efa00,null))[_0x3344('0x13')](function(_0x1fe196){if(_0x1fe196){_0x5fab5d=_0x1fe196;_0xacc607['model']=_[_0x3344('0x26')](db['User'][_0x3344('0x27')]);_0xacc607['query']=_[_0x3344('0x26')](_0x4af34f[_0x3344('0x1f')]);_0xacc607[_0x3344('0x3c')]=_[_0x3344('0x28')](_0xacc607['model'],_0xacc607['query']);_0x162ead['attributes']=_[_0x3344('0x28')](_0xacc607[_0x3344('0x25')],qs['fields'](_0x4af34f[_0x3344('0x1f')][_0x3344('0x2a')]));_0x162ead[_0x3344('0x29')]=_0x162ead[_0x3344('0x29')][_0x3344('0x2b')]?_0x162ead[_0x3344('0x29')]:_0xacc607[_0x3344('0x25')];_0x162ead[_0x3344('0x3f')]=qs[_0x3344('0x40')](_0x4af34f[_0x3344('0x1f')]['sort']);_0x162ead[_0x3344('0x41')]=qs[_0x3344('0x3c')](_['pick'](_0x4af34f[_0x3344('0x1f')],_0xacc607[_0x3344('0x3c')]));if(_0x4af34f[_0x3344('0x1f')]['filter']){_0x162ead[_0x3344('0x41')]=_[_0x3344('0x2d')](_0x162ead[_0x3344('0x41')],{'$or':_[_0x3344('0x43')](_0x162ead[_0x3344('0x29')],function(_0x377e73){var _0x1135a3={};_0x1135a3[_0x377e73]={'$like':'%'+_0x4af34f[_0x3344('0x1f')][_0x3344('0x44')]+'%'};return _0x1135a3;})});}_0x162ead=_[_0x3344('0x2d')]({},_0x162ead,_0x4af34f[_0x3344('0x2e')]);return _0x5fab5d[_0x3344('0x6f')](_0x162ead);}})[_0x3344('0x13')](function(_0x294a98){if(_0x294a98){_0x1058a5=_0x294a98[_0x3344('0x2b')];if(!_0x4af34f[_0x3344('0x1f')][_0x3344('0x3d')](_0x3344('0x4f'))){_0x162ead[_0x3344('0xf')]=qs[_0x3344('0xf')](_0x4af34f[_0x3344('0x1f')][_0x3344('0xf')]);_0x162ead[_0x3344('0x3e')]=qs[_0x3344('0x3e')](_0x4af34f[_0x3344('0x1f')][_0x3344('0x3e')]);}return _0x5fab5d[_0x3344('0x6f')](_0x162ead);}})[_0x3344('0x13')](function(_0x3221a0){if(_0x3221a0){return _0x3221a0?{'count':_0x1058a5,'rows':_0x3221a0}:null;}})[_0x3344('0x13')](respondWithResult(_0x5efa00,null))[_0x3344('0x22')](handleError(_0x5efa00,null));};
\ No newline at end of file
+var _0x17ad=['hasOwnProperty','addTeams','ids','Team','online','voicePause','interface','flatMap','Agents','sequelize','transaction','findOrCreate','select','field','from','team_has_chat_queues','join','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','ChatQueueId\x20=\x20?','clone','ut.UserId\x20=\x20?','QueryTypes','SELECT','every','TeamId','all','compact','value','removeTeams','isEmpty','removeAgents','forEach','emit','userChatQueue:remove','addAgents','omit','userChatQueue:save','getAgents','bluebird','util','squel','ioredis','../../components/parsers/qs','../../config/logger','api','../../config/environment','redis','defaults','localhost','./chatQueue.socket','register','sendStatus','status','end','json','undefined','offset','count','limit','set','Content-Range','update','then','destroy','get','ChatQueues','UserProfileResource','error','stack','name','send','index','map','ChatQueue','rawAttributes','fieldName','type','key','include','findAll','catch','show','params','model','keys','query','filters','attributes','fields','length','includeAll','merge','options','find','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','userProfileId','autoAssociation','getMembers','UserChatQueue','intersection','nolimit','order','sort','where','pick','ChatQueueId','filter','User','UserId','chatPause','updatedAt','createdAt','rows','format','%s/%s','SIP','getTeams'];(function(_0x32359e,_0x493d21){var _0x2a6741=function(_0x145004){while(--_0x145004){_0x32359e['push'](_0x32359e['shift']());}};_0x2a6741(++_0x493d21);}(_0x17ad,0xa1));var _0xd17a=function(_0xdbbc03,_0x5170df){_0xdbbc03=_0xdbbc03-0x0;var _0x2e573d=_0x17ad[_0xdbbc03];return _0x2e573d;};'use strict';var BPromise=require(_0xd17a('0x0'));var util=require(_0xd17a('0x1'));var _=require('lodash');var squel=require(_0xd17a('0x2'));var Redis=require(_0xd17a('0x3'));var qs=require(_0xd17a('0x4'));var logger=require(_0xd17a('0x5'))(_0xd17a('0x6'));var config=require(_0xd17a('0x7'));var db=require('../../mysqldb')['db'];config[_0xd17a('0x8')]=_[_0xd17a('0x9')](config[_0xd17a('0x8')],{'host':_0xd17a('0xa'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xd17a('0x8')]));require(_0xd17a('0xb'))[_0xd17a('0xc')](socket);function respondWithStatusCode(_0x1766c5,_0xe78234){_0xe78234=_0xe78234||0xcc;return function(_0x1e7a29){if(_0x1e7a29){return _0x1766c5[_0xd17a('0xd')](_0xe78234);}return _0x1766c5[_0xd17a('0xe')](_0xe78234)[_0xd17a('0xf')]();};}function respondWithResult(_0x2d3902,_0xaa0053){_0xaa0053=_0xaa0053||0xc8;return function(_0x4b57d6){if(_0x4b57d6){return _0x2d3902['status'](_0xaa0053)[_0xd17a('0x10')](_0x4b57d6);}};}function respondWithFilteredResult(_0x2fe2a7,_0x463bec){return function(_0x35e31c){if(_0x35e31c){var _0x1f669e=typeof _0x463bec['offset']===_0xd17a('0x11')&&typeof _0x463bec['limit']===_0xd17a('0x11');var _0x1d1551=_0x35e31c['count'];var _0x250cbd=_0x1f669e?0x0:_0x463bec[_0xd17a('0x12')];var _0x56503=_0x1f669e?_0x35e31c[_0xd17a('0x13')]:_0x463bec[_0xd17a('0x12')]+_0x463bec[_0xd17a('0x14')];var _0xe5795f;if(_0x56503>=_0x1d1551){_0x56503=_0x1d1551;_0xe5795f=0xc8;}else{_0xe5795f=0xce;}_0x2fe2a7['status'](_0xe5795f);return _0x2fe2a7[_0xd17a('0x15')](_0xd17a('0x16'),_0x250cbd+'-'+_0x56503+'/'+_0x1d1551)[_0xd17a('0x10')](_0x35e31c);}return null;};}function saveUpdates(_0x4bf9fc){return function(_0xab838e){if(_0xab838e){return _0xab838e[_0xd17a('0x17')](_0x4bf9fc)[_0xd17a('0x18')](function(_0x53571d){return _0x53571d;});}return null;};}function removeEntity(_0x479c12){return function(_0xb2aa76){if(_0xb2aa76){return _0xb2aa76[_0xd17a('0x19')]()[_0xd17a('0x18')](function(){var _0x49fd10=_0xb2aa76[_0xd17a('0x1a')]({'plain':!![]});var _0xff9e23=_0xd17a('0x1b');return db[_0xd17a('0x1c')][_0xd17a('0x19')]({'where':{'type':_0xff9e23,'resourceId':_0x49fd10['id']}})[_0xd17a('0x18')](function(){return _0xb2aa76;});})[_0xd17a('0x18')](function(){_0x479c12[_0xd17a('0xe')](0xcc)['end']();});}};}function handleEntityNotFound(_0x27fa2b){return function(_0x3e0f65){if(!_0x3e0f65){_0x27fa2b[_0xd17a('0xd')](0x194);}return _0x3e0f65;};}function handleError(_0x1cd0ba,_0x37d9e5){_0x37d9e5=_0x37d9e5||0x1f4;return function(_0x66919e){logger[_0xd17a('0x1d')](_0x66919e[_0xd17a('0x1e')]);if(_0x66919e[_0xd17a('0x1f')]){delete _0x66919e['name'];}_0x1cd0ba[_0xd17a('0xe')](_0x37d9e5)[_0xd17a('0x20')](_0x66919e);};}exports[_0xd17a('0x21')]=function(_0x5af9e2,_0x4f48ce){var _0x1187f8={};var _0xb8c5b8={'count':0x0,'rows':[]};var _0x280e61=_[_0xd17a('0x22')](db[_0xd17a('0x23')][_0xd17a('0x24')],function(_0x5afb0f){return{'name':_0x5afb0f[_0xd17a('0x25')],'type':_0x5afb0f[_0xd17a('0x26')][_0xd17a('0x27')]};});_0x1187f8=qs['getOptions'](_0x280e61,_0x5af9e2);var _0x21b98e={'where':_0x1187f8['where']};return db[_0xd17a('0x23')]['count'](_0x21b98e)[_0xd17a('0x18')](function(_0x33b36f){_0xb8c5b8[_0xd17a('0x13')]=_0x33b36f;_0x1187f8[_0xd17a('0x28')]=qs[_0xd17a('0x28')](_0x5af9e2['query']);return db[_0xd17a('0x23')][_0xd17a('0x29')](_0x1187f8);})[_0xd17a('0x18')](function(_0x2d9859){_0xb8c5b8['rows']=_0x2d9859;return _0xb8c5b8;})[_0xd17a('0x18')](respondWithFilteredResult(_0x4f48ce,_0x1187f8))[_0xd17a('0x2a')](handleError(_0x4f48ce,null));};exports[_0xd17a('0x2b')]=function(_0x1ec7d3,_0x3e2b5){var _0x2daaba={'raw':!![],'where':{'id':_0x1ec7d3[_0xd17a('0x2c')]['id']}},_0x50b6b1={};_0x50b6b1[_0xd17a('0x2d')]=_[_0xd17a('0x2e')](db[_0xd17a('0x23')][_0xd17a('0x24')]);_0x50b6b1['query']=_[_0xd17a('0x2e')](_0x1ec7d3[_0xd17a('0x2f')]);_0x50b6b1[_0xd17a('0x30')]=_['intersection'](_0x50b6b1[_0xd17a('0x2d')],_0x50b6b1[_0xd17a('0x2f')]);_0x2daaba[_0xd17a('0x31')]=_['intersection'](_0x50b6b1['model'],qs[_0xd17a('0x32')](_0x1ec7d3[_0xd17a('0x2f')][_0xd17a('0x32')]));_0x2daaba[_0xd17a('0x31')]=_0x2daaba[_0xd17a('0x31')][_0xd17a('0x33')]?_0x2daaba['attributes']:_0x50b6b1[_0xd17a('0x2d')];if(_0x1ec7d3[_0xd17a('0x2f')][_0xd17a('0x34')]){_0x2daaba[_0xd17a('0x28')]=[{'all':!![]}];}_0x2daaba=_[_0xd17a('0x35')]({},_0x2daaba,_0x1ec7d3[_0xd17a('0x36')]);return db['ChatQueue'][_0xd17a('0x37')](_0x2daaba)[_0xd17a('0x18')](handleEntityNotFound(_0x3e2b5,null))[_0xd17a('0x18')](respondWithResult(_0x3e2b5,null))[_0xd17a('0x2a')](handleError(_0x3e2b5,null));};exports[_0xd17a('0x38')]=function(_0x597ca8,_0x1eb2e4){return db[_0xd17a('0x23')][_0xd17a('0x38')](_0x597ca8[_0xd17a('0x39')],{})[_0xd17a('0x18')](function(_0x4b7839){var _0x1ee0e7=_0x597ca8['user'][_0xd17a('0x1a')]({'plain':!![]});if(!_0x1ee0e7)throw new Error(_0xd17a('0x3a'));if(_0x1ee0e7[_0xd17a('0x3b')]===_0xd17a('0x3c')){var _0x178cd2=_0x4b7839[_0xd17a('0x1a')]({'plain':!![]});var _0x583ab5=_0xd17a('0x1b');return db['UserProfileSection']['find']({'where':{'name':_0x583ab5,'userProfileId':_0x1ee0e7[_0xd17a('0x3d')]},'raw':!![]})[_0xd17a('0x18')](function(_0x9cd795){if(_0x9cd795&&_0x9cd795[_0xd17a('0x3e')]===0x0){return db[_0xd17a('0x1c')][_0xd17a('0x38')]({'name':_0x178cd2['name'],'resourceId':_0x178cd2['id'],'type':_0x9cd795[_0xd17a('0x1f')],'sectionId':_0x9cd795['id']},{})[_0xd17a('0x18')](function(){return _0x4b7839;});}else{return _0x4b7839;}})['catch'](function(_0x3221b2){logger[_0xd17a('0x1d')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x3221b2);throw _0x3221b2;});}return _0x4b7839;})['then'](respondWithResult(_0x1eb2e4,0xc9))['catch'](handleError(_0x1eb2e4,null));};exports[_0xd17a('0x17')]=function(_0x41977c,_0x494821){if(_0x41977c['body']['id']){delete _0x41977c[_0xd17a('0x39')]['id'];}return db[_0xd17a('0x23')][_0xd17a('0x37')]({'where':{'id':_0x41977c[_0xd17a('0x2c')]['id']}})[_0xd17a('0x18')](handleEntityNotFound(_0x494821,null))[_0xd17a('0x18')](saveUpdates(_0x41977c[_0xd17a('0x39')],null))[_0xd17a('0x18')](respondWithResult(_0x494821,null))[_0xd17a('0x2a')](handleError(_0x494821,null));};exports[_0xd17a('0x19')]=function(_0x2abf7b,_0x32cc01){return db['ChatQueue'][_0xd17a('0x37')]({'where':{'id':_0x2abf7b[_0xd17a('0x2c')]['id']}})[_0xd17a('0x18')](handleEntityNotFound(_0x32cc01,null))[_0xd17a('0x18')](removeEntity(_0x32cc01,null))[_0xd17a('0x2a')](handleError(_0x32cc01,null));};exports['describe']=function(_0x47860f,_0x38427d){return db[_0xd17a('0x23')]['describe']()[_0xd17a('0x18')](respondWithResult(_0x38427d,null))[_0xd17a('0x2a')](handleError(_0x38427d,null));};exports[_0xd17a('0x3f')]=function(_0x941f5c,_0x56167f){var _0x22f7fd={'raw':!![],'where':{}},_0x354597={},_0x20e293;return db['ChatQueue']['findOne']({'where':{'id':_0x941f5c[_0xd17a('0x2c')]['id']}})[_0xd17a('0x18')](handleEntityNotFound(_0x56167f,null))[_0xd17a('0x18')](function(_0x172d57){if(_0x172d57){_0x20e293=_0x172d57[_0xd17a('0x1a')]({'plain':!![]});_0x354597[_0xd17a('0x2d')]=_[_0xd17a('0x2e')](db[_0xd17a('0x40')][_0xd17a('0x24')]);_0x354597[_0xd17a('0x2f')]=_[_0xd17a('0x2e')](_0x941f5c[_0xd17a('0x2f')]);_0x354597[_0xd17a('0x30')]=_[_0xd17a('0x41')](_0x354597[_0xd17a('0x2d')],_0x354597[_0xd17a('0x2f')]);_0x22f7fd['attributes']=_[_0xd17a('0x41')](_0x354597[_0xd17a('0x2d')],qs[_0xd17a('0x32')](_0x941f5c['query']['fields']));_0x22f7fd[_0xd17a('0x31')]=_0x22f7fd[_0xd17a('0x31')][_0xd17a('0x33')]?_0x22f7fd['attributes']:_0x354597[_0xd17a('0x2d')];if(!_0x941f5c[_0xd17a('0x2f')]['hasOwnProperty'](_0xd17a('0x42'))){_0x22f7fd[_0xd17a('0x14')]=qs[_0xd17a('0x14')](_0x941f5c['query'][_0xd17a('0x14')]);_0x22f7fd[_0xd17a('0x12')]=qs[_0xd17a('0x12')](_0x941f5c['query'][_0xd17a('0x12')]);}_0x22f7fd[_0xd17a('0x43')]=qs[_0xd17a('0x44')](_0x941f5c['query'][_0xd17a('0x44')]);_0x22f7fd[_0xd17a('0x45')]=qs[_0xd17a('0x30')](_[_0xd17a('0x46')](_0x941f5c['query'],_0x354597['filters']));_0x22f7fd[_0xd17a('0x45')][_0xd17a('0x47')]=_0x172d57['id'];if(_0x941f5c[_0xd17a('0x2f')]['filter']){_0x22f7fd[_0xd17a('0x45')]=_[_0xd17a('0x35')](_0x22f7fd[_0xd17a('0x45')],{'$or':_[_0xd17a('0x22')](_0x22f7fd['attributes'],function(_0x393340){var _0x28314e={};_0x28314e[_0x393340]={'$like':'%'+_0x941f5c[_0xd17a('0x2f')][_0xd17a('0x48')]+'%'};return _0x28314e;})});}_0x22f7fd=_[_0xd17a('0x35')]({},_0x22f7fd,_0x941f5c['options']);return db['UserChatQueue'][_0xd17a('0x29')](_0x22f7fd);}})['then'](function(_0x477d3e){if(_0x477d3e){return db[_0xd17a('0x49')]['findAndCountAll']({'where':{'id':_[_0xd17a('0x22')](_0x477d3e,_0xd17a('0x4a')),'role':'agent'},'attributes':['id','name',_0xd17a('0x4b'),_0xd17a('0x4c'),_0xd17a('0x4d')]});}})[_0xd17a('0x18')](function(_0x3da51a){if(_0x3da51a){return{'count':_0x3da51a['count'],'rows':_[_0xd17a('0x22')](_0x3da51a[_0xd17a('0x4e')],function(_0x543609){return{'membername':_0x543609[_0xd17a('0x1f')],'UserId':_0x543609['id'],'queue_name':_0x20e293[_0xd17a('0x1f')],'ChatQueueId':_0x20e293['id'],'interface':util[_0xd17a('0x4f')](_0xd17a('0x50'),_0xd17a('0x51'),_0x543609[_0xd17a('0x1f')]),'penalty':0x0,'paused':_0x543609[_0xd17a('0x4b')],'createdAt':_0x543609[_0xd17a('0x4d')],'updatedAt':_0x543609[_0xd17a('0x4c')]};})};}else{return{'count':0x0,'rows':[]};}})[_0xd17a('0x18')](respondWithFilteredResult(_0x56167f,_0x22f7fd))[_0xd17a('0x2a')](handleError(_0x56167f,null));};exports[_0xd17a('0x52')]=function(_0x5623b0,_0x43756a){var _0x8fce54={};var _0x3582a6={};var _0x1cda37;var _0x2cfe19;return db[_0xd17a('0x23')]['findOne']({'where':{'id':_0x5623b0[_0xd17a('0x2c')]['id']}})[_0xd17a('0x18')](handleEntityNotFound(_0x43756a,null))[_0xd17a('0x18')](function(_0x3e568e){if(_0x3e568e){_0x1cda37=_0x3e568e;_0x3582a6[_0xd17a('0x2d')]=_['keys'](db['Team'][_0xd17a('0x24')]);_0x3582a6['query']=_['keys'](_0x5623b0['query']);_0x3582a6['filters']=_[_0xd17a('0x41')](_0x3582a6[_0xd17a('0x2d')],_0x3582a6[_0xd17a('0x2f')]);_0x8fce54[_0xd17a('0x31')]=_[_0xd17a('0x41')](_0x3582a6[_0xd17a('0x2d')],qs[_0xd17a('0x32')](_0x5623b0[_0xd17a('0x2f')][_0xd17a('0x32')]));_0x8fce54[_0xd17a('0x31')]=_0x8fce54['attributes'][_0xd17a('0x33')]?_0x8fce54[_0xd17a('0x31')]:_0x3582a6[_0xd17a('0x2d')];_0x8fce54[_0xd17a('0x43')]=qs[_0xd17a('0x44')](_0x5623b0[_0xd17a('0x2f')][_0xd17a('0x44')]);_0x8fce54['where']=qs[_0xd17a('0x30')](_['pick'](_0x5623b0[_0xd17a('0x2f')],_0x3582a6[_0xd17a('0x30')]));if(_0x5623b0[_0xd17a('0x2f')][_0xd17a('0x48')]){_0x8fce54[_0xd17a('0x45')]=_[_0xd17a('0x35')](_0x8fce54[_0xd17a('0x45')],{'$or':_[_0xd17a('0x22')](_0x8fce54[_0xd17a('0x31')],function(_0x3f1b04){var _0xe7847c={};_0xe7847c[_0x3f1b04]={'$like':'%'+_0x5623b0[_0xd17a('0x2f')][_0xd17a('0x48')]+'%'};return _0xe7847c;})});}_0x8fce54=_[_0xd17a('0x35')]({},_0x8fce54,_0x5623b0[_0xd17a('0x36')]);return _0x1cda37[_0xd17a('0x52')](_0x8fce54);}})['then'](function(_0x3f422d){if(_0x3f422d){_0x2cfe19=_0x3f422d[_0xd17a('0x33')];if(!_0x5623b0[_0xd17a('0x2f')][_0xd17a('0x53')](_0xd17a('0x42'))){_0x8fce54['limit']=qs[_0xd17a('0x14')](_0x5623b0[_0xd17a('0x2f')][_0xd17a('0x14')]);_0x8fce54[_0xd17a('0x12')]=qs[_0xd17a('0x12')](_0x5623b0[_0xd17a('0x2f')]['offset']);}return _0x1cda37['getTeams'](_0x8fce54);}})[_0xd17a('0x18')](function(_0x1727fb){if(_0x1727fb){return _0x1727fb?{'count':_0x2cfe19,'rows':_0x1727fb}:null;}})['then'](respondWithResult(_0x43756a,null))[_0xd17a('0x2a')](handleError(_0x43756a,null));};exports[_0xd17a('0x54')]=function(_0x3b7bd2,_0x49aae6){var _0x56510d=_0x3b7bd2['body'][_0xd17a('0x55')];return db[_0xd17a('0x56')][_0xd17a('0x29')]({'where':{'id':_0x56510d},'attributes':['id'],'include':[{'model':db['User'],'as':'Agents','attributes':['id',_0xd17a('0x1f'),_0xd17a('0x57'),_0xd17a('0x58'),_0xd17a('0x59')],'raw':!![]}]})[_0xd17a('0x18')](function(_0xcaaffd){if(_0xcaaffd){var _0x4a4dd5=_[_0xd17a('0x5a')](_0xcaaffd,function(_0x1a78ef){var _0x2c5d59=_0x1a78ef[_0xd17a('0x1a')]({'plain':!![]});return _0x2c5d59[_0xd17a('0x5b')];});return db['ChatQueue'][_0xd17a('0x37')]({'where':{'id':_0x3b7bd2[_0xd17a('0x2c')]['id']}})[_0xd17a('0x18')](function(_0xa6a89a){return db[_0xd17a('0x5c')][_0xd17a('0x5d')](function(_0x1177ea){return _0xa6a89a['addTeams'](_0x56510d,{'transaction':_0x1177ea})[_0xd17a('0x18')](function(){return BPromise['each'](_0x4a4dd5,function(_0x4115df){return db[_0xd17a('0x40')][_0xd17a('0x5e')]({'where':{'UserId':_0x4115df['id'],'ChatQueueId':_0x3b7bd2[_0xd17a('0x2c')]['id']},'transaction':_0x1177ea});});})[_0xd17a('0x18')](function(){_0x4a4dd5['forEach'](function(_0x4b65b2){socket['emit']('userChatQueue:save',{'UserId':_0x4b65b2['id'],'ChatQueueId':_0xa6a89a['id']});});});});});}})[_0xd17a('0x18')](respondWithStatusCode(_0x49aae6,null))['catch'](handleError(_0x49aae6,null));};exports['removeTeams']=function(_0xbd6340,_0x427b36){return db['Team'][_0xd17a('0x29')]({'where':{'id':_0xbd6340[_0xd17a('0x2f')][_0xd17a('0x55')]},'attributes':['id'],'include':[{'model':db['User'],'as':_0xd17a('0x5b'),'attributes':['id'],'raw':!![]}]})[_0xd17a('0x18')](handleEntityNotFound(_0x427b36,null))[_0xd17a('0x18')](function(_0x1f6e26){var _0x20aff3=_[_0xd17a('0x22')](_0x1f6e26,'id');var _0x3ee88d=[];var _0x547104=[];var _0x2523a7=squel[_0xd17a('0x5f')]();_0x2523a7[_0xd17a('0x60')]('tq.TeamId')[_0xd17a('0x61')](_0xd17a('0x62'),'tq')[_0xd17a('0x63')](_0xd17a('0x64'),'ut',_0xd17a('0x65'))[_0xd17a('0x45')](_0xd17a('0x66'),_0xbd6340[_0xd17a('0x2c')]['id']);for(var _0x4587a8=0x0;_0x4587a8<_0x1f6e26['length'];_0x4587a8+=0x1){let _0x15e602=_0x1f6e26[_0x4587a8];for(var _0x16a16a=0x0;_0x16a16a<_0x15e602[_0xd17a('0x5b')][_0xd17a('0x33')];_0x16a16a+=0x1){let _0x3e6ae9=_0x15e602[_0xd17a('0x5b')][_0x16a16a];var _0x5e0eef=_0x2523a7[_0xd17a('0x67')]();_0x5e0eef[_0xd17a('0x45')](_0xd17a('0x68'),_0x3e6ae9['id']);_0x547104['push'](db['sequelize']['query'](_0x5e0eef['toString'](),{'type':db[_0xd17a('0x5c')][_0xd17a('0x69')][_0xd17a('0x6a')]})[_0xd17a('0x18')](function(_0x5ada51){if(_0x5ada51[_0xd17a('0x33')]===0x1){return _0x3e6ae9['id'];}else{var _0x298452=_[_0xd17a('0x6b')](_[_0xd17a('0x22')](_0x5ada51,_0xd17a('0x6c')),function(_0x4c4c63){return _['includes'](_0x20aff3,_0x4c4c63);});if(_0x298452){return _0x3e6ae9['id'];}}}));}}return BPromise[_0xd17a('0x6d')](_0x547104)[_0xd17a('0x18')](function(_0x1027ff){_0x3ee88d=_(_0x3ee88d)['union'](_0x1027ff)[_0xd17a('0x6e')]()[_0xd17a('0x6f')]();return db['ChatQueue'][_0xd17a('0x37')]({'where':{'id':_0xbd6340[_0xd17a('0x2c')]['id']}})[_0xd17a('0x18')](function(_0x56e20d){return db['sequelize'][_0xd17a('0x5d')](function(_0x509cd6){return _0x56e20d[_0xd17a('0x70')](_0xbd6340[_0xd17a('0x2f')][_0xd17a('0x55')],{'transaction':_0x509cd6})[_0xd17a('0x18')](function(){if(!_[_0xd17a('0x71')](_0x3ee88d)){return _0x56e20d[_0xd17a('0x72')](_0x3ee88d,{'transaction':_0x509cd6});}})[_0xd17a('0x18')](function(){_0x3ee88d[_0xd17a('0x73')](function(_0x36a6ac){socket[_0xd17a('0x74')](_0xd17a('0x75'),{'UserId':_0x36a6ac,'ChatQueueId':_0x56e20d['id']});});});});});});})[_0xd17a('0x18')](respondWithStatusCode(_0x427b36,null))[_0xd17a('0x2a')](handleError(_0x427b36,null));};exports[_0xd17a('0x76')]=function(_0x4d1081,_0x23909a){return db[_0xd17a('0x23')]['find']({'where':{'id':_0x4d1081['params']['id']}})[_0xd17a('0x18')](handleEntityNotFound(_0x23909a,null))[_0xd17a('0x18')](function(_0x3006eb){if(_0x3006eb){return _0x3006eb[_0xd17a('0x76')](_0x4d1081[_0xd17a('0x39')][_0xd17a('0x55')],_[_0xd17a('0x77')](_0x4d1081[_0xd17a('0x39')],[_0xd17a('0x55'),'id'])||{})['spread'](function(_0x33883d){for(var _0x439105=0x0;_0x439105<_0x4d1081[_0xd17a('0x39')][_0xd17a('0x55')][_0xd17a('0x33')];_0x439105+=0x1){socket[_0xd17a('0x74')](_0xd17a('0x78'),{'UserId':Number(_0x4d1081['body'][_0xd17a('0x55')][_0x439105]),'ChatQueueId':Number(_0x4d1081[_0xd17a('0x2c')]['id'])});}return _0x33883d;});}})['then'](respondWithResult(_0x23909a,null))[_0xd17a('0x2a')](handleError(_0x23909a,null));};exports[_0xd17a('0x72')]=function(_0x25e17c,_0x3366af){return db[_0xd17a('0x23')][_0xd17a('0x37')]({'where':{'id':_0x25e17c[_0xd17a('0x2c')]['id']}})[_0xd17a('0x18')](handleEntityNotFound(_0x3366af,null))['then'](function(_0x295b1d){if(_0x295b1d){return _0x295b1d[_0xd17a('0x72')](_0x25e17c[_0xd17a('0x2f')][_0xd17a('0x55')])['then'](function(){if(_['isArray'](_0x25e17c[_0xd17a('0x2f')][_0xd17a('0x55')])){for(var _0x1107f8=0x0;_0x1107f8<_0x25e17c['query'][_0xd17a('0x55')][_0xd17a('0x33')];_0x1107f8+=0x1){socket[_0xd17a('0x74')](_0xd17a('0x75'),{'UserId':Number(_0x25e17c[_0xd17a('0x2f')]['ids'][_0x1107f8]),'ChatQueueId':Number(_0x25e17c['params']['id'])});}}else{socket[_0xd17a('0x74')](_0xd17a('0x75'),{'UserId':Number(_0x25e17c[_0xd17a('0x2f')]['ids']),'ChatQueueId':Number(_0x25e17c[_0xd17a('0x2c')]['id'])});}});}})[_0xd17a('0x18')](respondWithStatusCode(_0x3366af,null))[_0xd17a('0x2a')](handleError(_0x3366af,null));};exports[_0xd17a('0x79')]=function(_0x5b6f21,_0xc3312f){var _0x3d106d={};var _0x22ed26={};var _0x6dd81e;var _0x8a1ae7;return db[_0xd17a('0x23')]['findOne']({'where':{'id':_0x5b6f21[_0xd17a('0x2c')]['id']}})[_0xd17a('0x18')](handleEntityNotFound(_0xc3312f,null))['then'](function(_0x23e9b0){if(_0x23e9b0){_0x6dd81e=_0x23e9b0;_0x22ed26[_0xd17a('0x2d')]=_['keys'](db['User'][_0xd17a('0x24')]);_0x22ed26['query']=_[_0xd17a('0x2e')](_0x5b6f21[_0xd17a('0x2f')]);_0x22ed26['filters']=_[_0xd17a('0x41')](_0x22ed26['model'],_0x22ed26[_0xd17a('0x2f')]);_0x3d106d['attributes']=_[_0xd17a('0x41')](_0x22ed26['model'],qs['fields'](_0x5b6f21[_0xd17a('0x2f')][_0xd17a('0x32')]));_0x3d106d[_0xd17a('0x31')]=_0x3d106d[_0xd17a('0x31')][_0xd17a('0x33')]?_0x3d106d['attributes']:_0x22ed26[_0xd17a('0x2d')];_0x3d106d[_0xd17a('0x43')]=qs['sort'](_0x5b6f21['query'][_0xd17a('0x44')]);_0x3d106d['where']=qs[_0xd17a('0x30')](_[_0xd17a('0x46')](_0x5b6f21[_0xd17a('0x2f')],_0x22ed26[_0xd17a('0x30')]));if(_0x5b6f21['query'][_0xd17a('0x48')]){_0x3d106d[_0xd17a('0x45')]=_['merge'](_0x3d106d['where'],{'$or':_[_0xd17a('0x22')](_0x3d106d[_0xd17a('0x31')],function(_0x2330e6){var _0x3e1b56={};_0x3e1b56[_0x2330e6]={'$like':'%'+_0x5b6f21[_0xd17a('0x2f')]['filter']+'%'};return _0x3e1b56;})});}_0x3d106d=_[_0xd17a('0x35')]({},_0x3d106d,_0x5b6f21[_0xd17a('0x36')]);return _0x6dd81e[_0xd17a('0x79')](_0x3d106d);}})['then'](function(_0xf9ec6e){if(_0xf9ec6e){_0x8a1ae7=_0xf9ec6e[_0xd17a('0x33')];if(!_0x5b6f21[_0xd17a('0x2f')][_0xd17a('0x53')]('nolimit')){_0x3d106d[_0xd17a('0x14')]=qs[_0xd17a('0x14')](_0x5b6f21[_0xd17a('0x2f')][_0xd17a('0x14')]);_0x3d106d[_0xd17a('0x12')]=qs[_0xd17a('0x12')](_0x5b6f21['query'][_0xd17a('0x12')]);}return _0x6dd81e[_0xd17a('0x79')](_0x3d106d);}})[_0xd17a('0x18')](function(_0x5f1a0c){if(_0x5f1a0c){return _0x5f1a0c?{'count':_0x8a1ae7,'rows':_0x5f1a0c}:null;}})[_0xd17a('0x18')](respondWithResult(_0xc3312f,null))[_0xd17a('0x2a')](handleError(_0xc3312f,null));};
\ No newline at end of file
diff --git a/server/api/chatQueue/chatQueue.events.js b/server/api/chatQueue/chatQueue.events.js
index 000b286..5cceb8d 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 _0x2e30=['emit','hasOwnProperty','exports','update','remove'];(function(_0xbe809,_0x1cf5da){var _0x5b6ef0=function(_0x1e568a){while(--_0x1e568a){_0xbe809['push'](_0xbe809['shift']());}};_0x5b6ef0(++_0x1cf5da);}(_0x2e30,0x1e3));var _0x02e3=function(_0x2779fb,_0x4ffc56){_0x2779fb=_0x2779fb-0x0;var _0x3d63f3=_0x2e30[_0x2779fb];return _0x3d63f3;};'use strict';var EventEmitter=require('events');var ChatQueue=require('../../mysqldb')['db']['ChatQueue'];var ChatQueueEvents=new EventEmitter();ChatQueueEvents['setMaxListeners'](0x0);var events={'afterCreate':'save','afterUpdate':_0x02e3('0x0'),'afterDestroy':_0x02e3('0x1')};function emitEvent(_0xc85bb0){return function(_0x235d0f,_0x290f55,_0x4e04e4){ChatQueueEvents[_0x02e3('0x2')](_0xc85bb0+':'+_0x235d0f['id'],_0x235d0f);ChatQueueEvents['emit'](_0xc85bb0,_0x235d0f);_0x4e04e4(null);};}for(var e in events){if(events[_0x02e3('0x3')](e)){var event=events[e];ChatQueue['hook'](e,emitEvent(event));}}module[_0x02e3('0x4')]=ChatQueueEvents;
\ No newline at end of file
+var _0xf83c=['exports','../../mysqldb','setMaxListeners','save','remove','emit','hook'];(function(_0x575aed,_0x166a90){var _0x50e743=function(_0x171f68){while(--_0x171f68){_0x575aed['push'](_0x575aed['shift']());}};_0x50e743(++_0x166a90);}(_0xf83c,0x78));var _0xcf83=function(_0x5d9867,_0x5e9030){_0x5d9867=_0x5d9867-0x0;var _0x7d2118=_0xf83c[_0x5d9867];return _0x7d2118;};'use strict';var EventEmitter=require('events');var ChatQueue=require(_0xcf83('0x0'))['db']['ChatQueue'];var ChatQueueEvents=new EventEmitter();ChatQueueEvents[_0xcf83('0x1')](0x0);var events={'afterCreate':_0xcf83('0x2'),'afterUpdate':'update','afterDestroy':_0xcf83('0x3')};function emitEvent(_0x3ab731){return function(_0x484a2a,_0x459149,_0x3b25bb){ChatQueueEvents['emit'](_0x3ab731+':'+_0x484a2a['id'],_0x484a2a);ChatQueueEvents[_0xcf83('0x4')](_0x3ab731,_0x484a2a);_0x3b25bb(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];ChatQueue[_0xcf83('0x5')](e,emitEvent(event));}}module[_0xcf83('0x6')]=ChatQueueEvents;
\ No newline at end of file
diff --git a/server/api/chatQueue/chatQueue.model.js b/server/api/chatQueue/chatQueue.model.js
index 8fbb4d2..9ec7478 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 _0xbc4e=['chat_queues','util','../../config/logger','api','bluebird','request-promise','path','rimraf','exports','ChatQueue'];(function(_0x4df076,_0x482da3){var _0x5e8fed=function(_0x1d0eba){while(--_0x1d0eba){_0x4df076['push'](_0x4df076['shift']());}};_0x5e8fed(++_0x482da3);}(_0xbc4e,0xdd));var _0xebc4=function(_0x3845c1,_0x5090a2){_0x3845c1=_0x3845c1-0x0;var _0x4222f5=_0xbc4e[_0x3845c1];return _0x4222f5;};'use strict';var _=require('lodash');var util=require(_0xebc4('0x0'));var logger=require(_0xebc4('0x1'))(_0xebc4('0x2'));var moment=require('moment');var BPromise=require(_0xebc4('0x3'));var rp=require(_0xebc4('0x4'));var fs=require('fs');var path=require(_0xebc4('0x5'));var rimraf=require(_0xebc4('0x6'));var config=require('../../config/environment');var attributes=require('./chatQueue.attributes');module[_0xebc4('0x7')]=function(_0x5c45e5,_0x5a4756){return _0x5c45e5['define'](_0xebc4('0x8'),attributes,{'tableName':_0xebc4('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x6d76=['../../config/environment','exports','ChatQueue','chat_queues','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path'];(function(_0x3f9313,_0x134148){var _0x148fe2=function(_0x4e3ba8){while(--_0x4e3ba8){_0x3f9313['push'](_0x3f9313['shift']());}};_0x148fe2(++_0x134148);}(_0x6d76,0x16c));var _0x66d7=function(_0x3f5e14,_0x7b142a){_0x3f5e14=_0x3f5e14-0x0;var _0x516814=_0x6d76[_0x3f5e14];return _0x516814;};'use strict';var _=require(_0x66d7('0x0'));var util=require(_0x66d7('0x1'));var logger=require(_0x66d7('0x2'))(_0x66d7('0x3'));var moment=require(_0x66d7('0x4'));var BPromise=require(_0x66d7('0x5'));var rp=require(_0x66d7('0x6'));var fs=require('fs');var path=require(_0x66d7('0x7'));var rimraf=require('rimraf');var config=require(_0x66d7('0x8'));var attributes=require('./chatQueue.attributes');module[_0x66d7('0x9')]=function(_0x2833f6,_0x2c0a1f){return _0x2833f6['define'](_0x66d7('0xa'),attributes,{'tableName':_0x66d7('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
diff --git a/server/api/chatQueue/chatQueue.rpc.js b/server/api/chatQueue/chatQueue.rpc.js
index de429f6..9fb99d2 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 _0x9fda=['request\x20sent','debug','ChatQueue,\x20%s,\x20%s,\x20%s','error','code','ChatQueue,\x20%s,\x20%s','message','result','GetChatQueue','findAll','options','where','attributes','limit','include','map','model','stringify','catch','ShowChatQueue','ChatQueue','find','raw','lodash','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','jayson/promise','client','defaults','redis','localhost','socket.io-emitter','register','then','info'];(function(_0x44b7e7,_0x5b9902){var _0x11ed08=function(_0x3dc71c){while(--_0x3dc71c){_0x44b7e7['push'](_0x44b7e7['shift']());}};_0x11ed08(++_0x5b9902);}(_0x9fda,0x8c));var _0xa9fd=function(_0x1482b5,_0x259774){_0x1482b5=_0x1482b5-0x0;var _0x464db2=_0x9fda[_0x1482b5];return _0x464db2;};'use strict';var _=require(_0xa9fd('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0xa9fd('0x1'));var rs=require(_0xa9fd('0x2'));var fs=require('fs');var Redis=require(_0xa9fd('0x3'));var db=require(_0xa9fd('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0xa9fd('0x5'))(_0xa9fd('0x6'));var config=require('../../config/environment');var jayson=require(_0xa9fd('0x7'));var client=jayson[_0xa9fd('0x8')]['http']({'port':0x232a});config['redis']=_[_0xa9fd('0x9')](config[_0xa9fd('0xa')],{'host':_0xa9fd('0xb'),'port':0x18eb});var socket=require(_0xa9fd('0xc'))(new Redis(config[_0xa9fd('0xa')]));require('./chatQueue.socket')[_0xa9fd('0xd')](socket);function respondWithRpcPromise(_0x17c068,_0x32c4d2,_0x5d7915){return new BPromise(function(_0xe1b24b,_0x4a850d){return client['request'](_0x17c068,_0x5d7915)[_0xa9fd('0xe')](function(_0xa68009){logger[_0xa9fd('0xf')]('ChatQueue,\x20%s,\x20%s',_0x32c4d2,_0xa9fd('0x10'));logger[_0xa9fd('0x11')](_0xa9fd('0x12'),_0x32c4d2,_0xa9fd('0x10'),JSON['stringify'](_0xa68009));if(_0xa68009[_0xa9fd('0x13')]){if(_0xa68009[_0xa9fd('0x13')][_0xa9fd('0x14')]===0x1f4){logger[_0xa9fd('0x13')](_0xa9fd('0x15'),_0x32c4d2,_0xa68009[_0xa9fd('0x13')][_0xa9fd('0x16')]);return _0x4a850d(_0xa68009[_0xa9fd('0x13')]['message']);}logger[_0xa9fd('0x13')](_0xa9fd('0x15'),_0x32c4d2,_0xa68009['error']['message']);return _0xe1b24b(_0xa68009[_0xa9fd('0x13')][_0xa9fd('0x16')]);}else{logger[_0xa9fd('0xf')](_0xa9fd('0x15'),_0x32c4d2,_0xa9fd('0x10'));_0xe1b24b(_0xa68009[_0xa9fd('0x17')][_0xa9fd('0x16')]);}})['catch'](function(_0x48bb74){logger[_0xa9fd('0x13')](_0xa9fd('0x15'),_0x32c4d2,_0x48bb74);_0x4a850d(_0x48bb74);});});}exports[_0xa9fd('0x18')]=function(_0x3247ac){var _0x3940e3=this;return new Promise(function(_0x3560b6,_0x7c1572){return db['ChatQueue'][_0xa9fd('0x19')]({'raw':_0x3247ac['options']?_0x3247ac['options']['raw']===undefined?!![]:![]:!![],'where':_0x3247ac['options']?_0x3247ac[_0xa9fd('0x1a')][_0xa9fd('0x1b')]||null:null,'attributes':_0x3247ac[_0xa9fd('0x1a')]?_0x3247ac[_0xa9fd('0x1a')][_0xa9fd('0x1c')]||null:null,'limit':_0x3247ac['options']?_0x3247ac[_0xa9fd('0x1a')][_0xa9fd('0x1d')]||null:null,'include':_0x3247ac['options']?_0x3247ac[_0xa9fd('0x1a')][_0xa9fd('0x1e')]?_[_0xa9fd('0x1f')](_0x3247ac[_0xa9fd('0x1a')][_0xa9fd('0x1e')],function(_0x177eba){return{'model':db[_0x177eba[_0xa9fd('0x20')]],'as':_0x177eba['as'],'attributes':_0x177eba[_0xa9fd('0x1c')],'include':_0x177eba[_0xa9fd('0x1e')]?_[_0xa9fd('0x1f')](_0x177eba[_0xa9fd('0x1e')],function(_0x31c216){return{'model':db[_0x31c216[_0xa9fd('0x20')]],'as':_0x31c216['as'],'attributes':_0x31c216[_0xa9fd('0x1c')],'include':_0x31c216[_0xa9fd('0x1e')]?_[_0xa9fd('0x1f')](_0x31c216[_0xa9fd('0x1e')],function(_0x517a16){return{'model':db[_0x517a16[_0xa9fd('0x20')]],'as':_0x517a16['as'],'attributes':_0x517a16[_0xa9fd('0x1c')]};}):[]};}):[]};}):[]:[]})[_0xa9fd('0xe')](function(_0x5cb7b4){logger[_0xa9fd('0xf')](_0xa9fd('0x18'),_0x3247ac);logger[_0xa9fd('0x11')](_0xa9fd('0x18'),_0x3247ac,JSON[_0xa9fd('0x21')](_0x5cb7b4));_0x3560b6(_0x5cb7b4);})[_0xa9fd('0x22')](function(_0x34480a){logger['error'](_0xa9fd('0x18'),_0x34480a[_0xa9fd('0x16')],_0x3247ac);_0x7c1572(_0x3940e3[_0xa9fd('0x13')](0x1f4,_0x34480a['message']));});});};exports[_0xa9fd('0x23')]=function(_0x151ee8){var _0x45d0fd=this;return new Promise(function(_0x189b77,_0x4e7608){return db[_0xa9fd('0x24')][_0xa9fd('0x25')]({'raw':_0x151ee8[_0xa9fd('0x1a')]?_0x151ee8[_0xa9fd('0x1a')][_0xa9fd('0x26')]===undefined?!![]:![]:!![],'where':_0x151ee8[_0xa9fd('0x1a')]?_0x151ee8['options']['where']||null:null,'attributes':_0x151ee8[_0xa9fd('0x1a')]?_0x151ee8[_0xa9fd('0x1a')][_0xa9fd('0x1c')]||null:null,'include':_0x151ee8[_0xa9fd('0x1a')]?_0x151ee8['options'][_0xa9fd('0x1e')]?_['map'](_0x151ee8['options']['include'],function(_0x1c8989){return{'model':db[_0x1c8989[_0xa9fd('0x20')]],'as':_0x1c8989['as'],'attributes':_0x1c8989['attributes'],'include':_0x1c8989[_0xa9fd('0x1e')]?_[_0xa9fd('0x1f')](_0x1c8989[_0xa9fd('0x1e')],function(_0x469c8a){return{'model':db[_0x469c8a[_0xa9fd('0x20')]],'as':_0x469c8a['as'],'attributes':_0x469c8a['attributes'],'include':_0x469c8a['include']?_['map'](_0x469c8a[_0xa9fd('0x1e')],function(_0x1def7e){return{'model':db[_0x1def7e['model']],'as':_0x1def7e['as'],'attributes':_0x1def7e['attributes']};}):[]};}):[]};}):[]:[]})[_0xa9fd('0xe')](function(_0x16d098){logger[_0xa9fd('0xf')](_0xa9fd('0x23'),_0x151ee8);logger[_0xa9fd('0x11')](_0xa9fd('0x23'),_0x151ee8,JSON[_0xa9fd('0x21')](_0x16d098));_0x189b77(_0x16d098);})[_0xa9fd('0x22')](function(_0x379afd){logger[_0xa9fd('0x13')](_0xa9fd('0x23'),_0x379afd[_0xa9fd('0x16')],_0x151ee8);_0x4e7608(_0x45d0fd['error'](0x1f4,_0x379afd[_0xa9fd('0x16')]));});});};
\ No newline at end of file
+var _0x48ac=['../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','redis','localhost','socket.io-emitter','./chatQueue.socket','register','request','then','info','request\x20sent','debug','ChatQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','ChatQueue,\x20%s,\x20%s','message','result','catch','GetChatQueue','ChatQueue','options','raw','where','attributes','include','map','model','ShowChatQueue','find','util','bluebird','randomstring','ioredis'];(function(_0x15d913,_0x51cf7a){var _0x4ae65e=function(_0x2f39a1){while(--_0x2f39a1){_0x15d913['push'](_0x15d913['shift']());}};_0x4ae65e(++_0x51cf7a);}(_0x48ac,0xe0));var _0xc48a=function(_0x415430,_0x3f8a8a){_0x415430=_0x415430-0x0;var _0x5605b1=_0x48ac[_0x415430];return _0x5605b1;};'use strict';var _=require('lodash');var util=require(_0xc48a('0x0'));var moment=require('moment');var BPromise=require(_0xc48a('0x1'));var rs=require(_0xc48a('0x2'));var fs=require('fs');var Redis=require(_0xc48a('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0xc48a('0x4'));var logger=require(_0xc48a('0x5'))(_0xc48a('0x6'));var config=require(_0xc48a('0x7'));var jayson=require(_0xc48a('0x8'));var client=jayson['client']['http']({'port':0x232a});config['redis']=_['defaults'](config[_0xc48a('0x9')],{'host':_0xc48a('0xa'),'port':0x18eb});var socket=require(_0xc48a('0xb'))(new Redis(config['redis']));require(_0xc48a('0xc'))[_0xc48a('0xd')](socket);function respondWithRpcPromise(_0xca2440,_0xcefd1e,_0x3ec348){return new BPromise(function(_0x1c96ae,_0x1c4ce9){return client[_0xc48a('0xe')](_0xca2440,_0x3ec348)[_0xc48a('0xf')](function(_0x6d74f3){logger[_0xc48a('0x10')]('ChatQueue,\x20%s,\x20%s',_0xcefd1e,_0xc48a('0x11'));logger[_0xc48a('0x12')](_0xc48a('0x13'),_0xcefd1e,'request\x20sent',JSON[_0xc48a('0x14')](_0x6d74f3));if(_0x6d74f3[_0xc48a('0x15')]){if(_0x6d74f3['error'][_0xc48a('0x16')]===0x1f4){logger[_0xc48a('0x15')](_0xc48a('0x17'),_0xcefd1e,_0x6d74f3['error'][_0xc48a('0x18')]);return _0x1c4ce9(_0x6d74f3[_0xc48a('0x15')][_0xc48a('0x18')]);}logger['error'](_0xc48a('0x17'),_0xcefd1e,_0x6d74f3[_0xc48a('0x15')]['message']);return _0x1c96ae(_0x6d74f3['error'][_0xc48a('0x18')]);}else{logger['info'](_0xc48a('0x17'),_0xcefd1e,_0xc48a('0x11'));_0x1c96ae(_0x6d74f3[_0xc48a('0x19')][_0xc48a('0x18')]);}})[_0xc48a('0x1a')](function(_0x2deee6){logger[_0xc48a('0x15')]('ChatQueue,\x20%s,\x20%s',_0xcefd1e,_0x2deee6);_0x1c4ce9(_0x2deee6);});});}exports[_0xc48a('0x1b')]=function(_0x438b69){var _0x5b750c=this;return new Promise(function(_0x259bc2,_0x4e6e15){return db[_0xc48a('0x1c')]['findAll']({'raw':_0x438b69[_0xc48a('0x1d')]?_0x438b69[_0xc48a('0x1d')][_0xc48a('0x1e')]===undefined?!![]:![]:!![],'where':_0x438b69[_0xc48a('0x1d')]?_0x438b69[_0xc48a('0x1d')][_0xc48a('0x1f')]||null:null,'attributes':_0x438b69[_0xc48a('0x1d')]?_0x438b69[_0xc48a('0x1d')][_0xc48a('0x20')]||null:null,'limit':_0x438b69[_0xc48a('0x1d')]?_0x438b69[_0xc48a('0x1d')]['limit']||null:null,'include':_0x438b69['options']?_0x438b69[_0xc48a('0x1d')][_0xc48a('0x21')]?_[_0xc48a('0x22')](_0x438b69[_0xc48a('0x1d')]['include'],function(_0x5c5d61){return{'model':db[_0x5c5d61[_0xc48a('0x23')]],'as':_0x5c5d61['as'],'attributes':_0x5c5d61[_0xc48a('0x20')],'include':_0x5c5d61[_0xc48a('0x21')]?_['map'](_0x5c5d61[_0xc48a('0x21')],function(_0x4077f7){return{'model':db[_0x4077f7[_0xc48a('0x23')]],'as':_0x4077f7['as'],'attributes':_0x4077f7[_0xc48a('0x20')],'include':_0x4077f7[_0xc48a('0x21')]?_[_0xc48a('0x22')](_0x4077f7[_0xc48a('0x21')],function(_0x335532){return{'model':db[_0x335532[_0xc48a('0x23')]],'as':_0x335532['as'],'attributes':_0x335532[_0xc48a('0x20')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x5bf78a){logger[_0xc48a('0x10')]('GetChatQueue',_0x438b69);logger[_0xc48a('0x12')](_0xc48a('0x1b'),_0x438b69,JSON['stringify'](_0x5bf78a));_0x259bc2(_0x5bf78a);})[_0xc48a('0x1a')](function(_0x2ab3e1){logger[_0xc48a('0x15')]('GetChatQueue',_0x2ab3e1[_0xc48a('0x18')],_0x438b69);_0x4e6e15(_0x5b750c[_0xc48a('0x15')](0x1f4,_0x2ab3e1['message']));});});};exports[_0xc48a('0x24')]=function(_0x3f1bef){var _0x14bdfc=this;return new Promise(function(_0x4db7e2,_0x28a7f9){return db['ChatQueue'][_0xc48a('0x25')]({'raw':_0x3f1bef[_0xc48a('0x1d')]?_0x3f1bef[_0xc48a('0x1d')][_0xc48a('0x1e')]===undefined?!![]:![]:!![],'where':_0x3f1bef[_0xc48a('0x1d')]?_0x3f1bef[_0xc48a('0x1d')][_0xc48a('0x1f')]||null:null,'attributes':_0x3f1bef[_0xc48a('0x1d')]?_0x3f1bef['options'][_0xc48a('0x20')]||null:null,'include':_0x3f1bef[_0xc48a('0x1d')]?_0x3f1bef[_0xc48a('0x1d')][_0xc48a('0x21')]?_[_0xc48a('0x22')](_0x3f1bef[_0xc48a('0x1d')][_0xc48a('0x21')],function(_0x52b449){return{'model':db[_0x52b449[_0xc48a('0x23')]],'as':_0x52b449['as'],'attributes':_0x52b449[_0xc48a('0x20')],'include':_0x52b449[_0xc48a('0x21')]?_[_0xc48a('0x22')](_0x52b449['include'],function(_0x36378a){return{'model':db[_0x36378a[_0xc48a('0x23')]],'as':_0x36378a['as'],'attributes':_0x36378a['attributes'],'include':_0x36378a[_0xc48a('0x21')]?_['map'](_0x36378a[_0xc48a('0x21')],function(_0x53671c){return{'model':db[_0x53671c['model']],'as':_0x53671c['as'],'attributes':_0x53671c[_0xc48a('0x20')]};}):[]};}):[]};}):[]:[]})[_0xc48a('0xf')](function(_0x4cfd00){logger[_0xc48a('0x10')](_0xc48a('0x24'),_0x3f1bef);logger[_0xc48a('0x12')](_0xc48a('0x24'),_0x3f1bef,JSON['stringify'](_0x4cfd00));_0x4db7e2(_0x4cfd00);})[_0xc48a('0x1a')](function(_0x3e747a){logger[_0xc48a('0x15')](_0xc48a('0x24'),_0x3e747a['message'],_0x3f1bef);_0x28a7f9(_0x14bdfc[_0xc48a('0x15')](0x1f4,_0x3e747a['message']));});});};
\ No newline at end of file
diff --git a/server/api/chatQueue/chatQueue.socket.js b/server/api/chatQueue/chatQueue.socket.js
index 083010e..cb99caa 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 _0x34e8=['register','length','chatQueue:','./chatQueue.events','save','remove','update','emit','removeListener'];(function(_0x51ed62,_0x574379){var _0x34aee3=function(_0x2958bc){while(--_0x2958bc){_0x51ed62['push'](_0x51ed62['shift']());}};_0x34aee3(++_0x574379);}(_0x34e8,0x12c));var _0x834e=function(_0x30ca15,_0x5e4f04){_0x30ca15=_0x30ca15-0x0;var _0x30ed77=_0x34e8[_0x30ca15];return _0x30ed77;};'use strict';var ChatQueueEvents=require(_0x834e('0x0'));var events=[_0x834e('0x1'),_0x834e('0x2'),_0x834e('0x3')];function createListener(_0x530939,_0x832422){return function(_0x21e2e0){_0x832422[_0x834e('0x4')](_0x530939,_0x21e2e0);};}function removeListener(_0x31bf20,_0x289ef2){return function(){ChatQueueEvents[_0x834e('0x5')](_0x31bf20,_0x289ef2);};}exports[_0x834e('0x6')]=function(_0x4a2018){for(var _0x858aa1=0x0,_0x52056d=events[_0x834e('0x7')];_0x858aa1<_0x52056d;_0x858aa1++){var _0x3cc2e3=events[_0x858aa1];var _0x3a3ef6=createListener(_0x834e('0x8')+_0x3cc2e3,_0x4a2018);ChatQueueEvents['on'](_0x3cc2e3,_0x3a3ef6);}};
\ No newline at end of file
+var _0xa37e=['chatQueue:','remove','update','emit','removeListener','register'];(function(_0x231c9c,_0x5a3ce2){var _0xb28752=function(_0x4389a4){while(--_0x4389a4){_0x231c9c['push'](_0x231c9c['shift']());}};_0xb28752(++_0x5a3ce2);}(_0xa37e,0x97));var _0xea37=function(_0x545fdb,_0x37c361){_0x545fdb=_0x545fdb-0x0;var _0x4afd8e=_0xa37e[_0x545fdb];return _0x4afd8e;};'use strict';var ChatQueueEvents=require('./chatQueue.events');var events=['save',_0xea37('0x0'),_0xea37('0x1')];function createListener(_0x204a22,_0x475c71){return function(_0x5430aa){_0x475c71[_0xea37('0x2')](_0x204a22,_0x5430aa);};}function removeListener(_0x537c5a,_0x360ed5){return function(){ChatQueueEvents[_0xea37('0x3')](_0x537c5a,_0x360ed5);};}exports[_0xea37('0x4')]=function(_0x4d380b){for(var _0x57135b=0x0,_0x36c489=events['length'];_0x57135b<_0x36c489;_0x57135b++){var _0x4ae081=events[_0x57135b];var _0x2c2890=createListener(_0xea37('0x5')+_0x4ae081,_0x4d380b);ChatQueueEvents['on'](_0x4ae081,_0x2c2890);}};
\ No newline at end of file
diff --git a/server/api/chatQueue/index.js b/server/api/chatQueue/index.js
index 715e2b3..4b5461e 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 _0x7217=['../../config/environment','./chatQueue.controller','get','isAuthenticated','index','/describe','describe','/:id','show','/:id/members','getMembers','/:id/teams','getTeams','/:id/users','post','addTeams','update','delete','destroy','removeTeams','removeAgents','exports','multer','path','connect-timeout','express','Router','fs-extra'];(function(_0x3de556,_0x4151ae){var _0x48302d=function(_0x30fd38){while(--_0x30fd38){_0x3de556['push'](_0x3de556['shift']());}};_0x48302d(++_0x4151ae);}(_0x7217,0x19e));var _0x7721=function(_0x38a7ac,_0x45514b){_0x38a7ac=_0x38a7ac-0x0;var _0x53061a=_0x7217[_0x38a7ac];return _0x53061a;};'use strict';var multer=require(_0x7721('0x0'));var util=require('util');var path=require(_0x7721('0x1'));var timeout=require(_0x7721('0x2'));var express=require(_0x7721('0x3'));var router=express[_0x7721('0x4')]();var fs_extra=require(_0x7721('0x5'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x7721('0x6'));var controller=require(_0x7721('0x7'));router[_0x7721('0x8')]('/',auth[_0x7721('0x9')](),controller[_0x7721('0xa')]);router[_0x7721('0x8')](_0x7721('0xb'),auth[_0x7721('0x9')](),controller[_0x7721('0xc')]);router[_0x7721('0x8')](_0x7721('0xd'),auth[_0x7721('0x9')](),controller[_0x7721('0xe')]);router[_0x7721('0x8')](_0x7721('0xf'),auth['isAuthenticated'](),controller[_0x7721('0x10')]);router[_0x7721('0x8')](_0x7721('0x11'),auth[_0x7721('0x9')](),controller[_0x7721('0x12')]);router[_0x7721('0x8')](_0x7721('0x13'),auth[_0x7721('0x9')](),controller['getAgents']);router[_0x7721('0x14')]('/',auth[_0x7721('0x9')](),controller['create']);router[_0x7721('0x14')](_0x7721('0x11'),auth[_0x7721('0x9')](),controller[_0x7721('0x15')]);router['post'](_0x7721('0x13'),auth[_0x7721('0x9')](),controller['addAgents']);router['put']('/:id',auth[_0x7721('0x9')](),controller[_0x7721('0x16')]);router[_0x7721('0x17')](_0x7721('0xd'),auth['isAuthenticated'](),controller[_0x7721('0x18')]);router['delete'](_0x7721('0x11'),auth['isAuthenticated'](),controller[_0x7721('0x19')]);router[_0x7721('0x17')](_0x7721('0x13'),auth[_0x7721('0x9')](),controller[_0x7721('0x1a')]);module[_0x7721('0x1b')]=router;
\ No newline at end of file
+var _0x008c=['../../config/environment','./chatQueue.controller','get','isAuthenticated','index','show','/:id/teams','getTeams','/:id/users','getAgents','post','addTeams','addAgents','update','delete','/:id','removeTeams','multer','util','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service'];(function(_0xe7e72,_0x3e6f42){var _0x594f9d=function(_0x280e38){while(--_0x280e38){_0xe7e72['push'](_0xe7e72['shift']());}};_0x594f9d(++_0x3e6f42);}(_0x008c,0x188));var _0xc008=function(_0xe1f858,_0xb86c44){_0xe1f858=_0xe1f858-0x0;var _0x367af6=_0x008c[_0xe1f858];return _0x367af6;};'use strict';var multer=require(_0xc008('0x0'));var util=require(_0xc008('0x1'));var path=require(_0xc008('0x2'));var timeout=require(_0xc008('0x3'));var express=require(_0xc008('0x4'));var router=express['Router']();var fs_extra=require(_0xc008('0x5'));var auth=require(_0xc008('0x6'));var interaction=require(_0xc008('0x7'));var config=require(_0xc008('0x8'));var controller=require(_0xc008('0x9'));router[_0xc008('0xa')]('/',auth[_0xc008('0xb')](),controller[_0xc008('0xc')]);router[_0xc008('0xa')]('/describe',auth[_0xc008('0xb')](),controller['describe']);router[_0xc008('0xa')]('/:id',auth['isAuthenticated'](),controller[_0xc008('0xd')]);router[_0xc008('0xa')]('/:id/members',auth['isAuthenticated'](),controller['getMembers']);router[_0xc008('0xa')](_0xc008('0xe'),auth['isAuthenticated'](),controller[_0xc008('0xf')]);router[_0xc008('0xa')](_0xc008('0x10'),auth[_0xc008('0xb')](),controller[_0xc008('0x11')]);router[_0xc008('0x12')]('/',auth[_0xc008('0xb')](),controller['create']);router['post'](_0xc008('0xe'),auth['isAuthenticated'](),controller[_0xc008('0x13')]);router[_0xc008('0x12')](_0xc008('0x10'),auth[_0xc008('0xb')](),controller[_0xc008('0x14')]);router['put']('/:id',auth['isAuthenticated'](),controller[_0xc008('0x15')]);router[_0xc008('0x16')](_0xc008('0x17'),auth[_0xc008('0xb')](),controller['destroy']);router['delete']('/:id/teams',auth['isAuthenticated'](),controller[_0xc008('0x18')]);router[_0xc008('0x16')]('/:id/users',auth[_0xc008('0xb')](),controller['removeAgents']);module['exports']=router;
\ No newline at end of file
diff --git a/server/api/chatQueueReport/chatQueueReport.attributes.js b/server/api/chatQueueReport/chatQueueReport.attributes.js
index ad7fbdd..f85332d 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 _0xcc0e=['moment','exports','STRING','DATE'];(function(_0x501e90,_0x1e8f51){var _0x5dd09c=function(_0x5f3072){while(--_0x5f3072){_0x501e90['push'](_0x501e90['shift']());}};_0x5dd09c(++_0x1e8f51);}(_0xcc0e,0x8c));var _0xecc0=function(_0x17eb18,_0x927702){_0x17eb18=_0x17eb18-0x0;var _0x46516f=_0xcc0e[_0x17eb18];return _0x46516f;};'use strict';var moment=require(_0xecc0('0x0'));var Sequelize=require('sequelize');module[_0xecc0('0x1')]={'uniqueid':{'type':Sequelize[_0xecc0('0x2')],'allowNull':![]},'from':{'type':Sequelize[_0xecc0('0x2')]},'joinAt':{'type':Sequelize[_0xecc0('0x3')]},'leaveAt':{'type':Sequelize[_0xecc0('0x3')]},'acceptAt':{'type':Sequelize[_0xecc0('0x3')]},'exitAt':{'type':Sequelize['DATE']},'reason':{'type':Sequelize[_0xecc0('0x2')]}};
\ No newline at end of file
+var _0x4215=['sequelize','STRING','DATE','moment'];(function(_0x55fb18,_0x22ca43){var _0x4c7217=function(_0x3bac21){while(--_0x3bac21){_0x55fb18['push'](_0x55fb18['shift']());}};_0x4c7217(++_0x22ca43);}(_0x4215,0x19f));var _0x5421=function(_0x3372ec,_0x5445e9){_0x3372ec=_0x3372ec-0x0;var _0x4b076c=_0x4215[_0x3372ec];return _0x4b076c;};'use strict';var moment=require(_0x5421('0x0'));var Sequelize=require(_0x5421('0x1'));module['exports']={'uniqueid':{'type':Sequelize['STRING'],'allowNull':![]},'from':{'type':Sequelize[_0x5421('0x2')]},'joinAt':{'type':Sequelize[_0x5421('0x3')]},'leaveAt':{'type':Sequelize[_0x5421('0x3')]},'acceptAt':{'type':Sequelize['DATE']},'exitAt':{'type':Sequelize[_0x5421('0x3')]},'reason':{'type':Sequelize[_0x5421('0x2')]}};
\ No newline at end of file
diff --git a/server/api/chatQueueReport/chatQueueReport.controller.js b/server/api/chatQueueReport/chatQueueReport.controller.js
index 2dc1f68..4e6dbfb 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 _0xee9c=['rawAttributes','create','find','rimraf','zip-dir','fast-json-patch','request-promise','mustache','util','to-csv','fs-extra','lodash','squel','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','save','update','then','destroy','stack','name','send','index','map','ChatQueueReport','fieldName','type','key','keys','query','filters','intersection','attributes','model','fields','length','hasOwnProperty','nolimit','sort','where','pick','filter','merge','options','includeAll','include','findAll','catch','params'];(function(_0x1cfa0d,_0x4391f2){var _0xe33279=function(_0x3ce7c1){while(--_0x3ce7c1){_0x1cfa0d['push'](_0x1cfa0d['shift']());}};_0xe33279(++_0x4391f2);}(_0xee9c,0x1e6));var _0xcee9=function(_0x457b64,_0x49a219){_0x457b64=_0x457b64-0x0;var _0x437111=_0xee9c[_0x457b64];return _0x437111;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xcee9('0x0'));var zipdir=require(_0xcee9('0x1'));var jsonpatch=require(_0xcee9('0x2'));var rp=require(_0xcee9('0x3'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0xcee9('0x4'));var util=require(_0xcee9('0x5'));var path=require('path');var sox=require('sox');var csv=require(_0xcee9('0x6'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xcee9('0x7'));var _=require(_0xcee9('0x8'));var squel=require(_0xcee9('0x9'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0xcee9('0xa'));var toCsv=require(_0xcee9('0x6'));var querystring=require('querystring');var Papa=require(_0xcee9('0xb'));var Redis=require(_0xcee9('0xc'));var authService=require(_0xcee9('0xd'));var qs=require(_0xcee9('0xe'));var as=require(_0xcee9('0xf'));var hardwareService=require(_0xcee9('0x10'));var logger=require('../../config/logger')(_0xcee9('0x11'));var utils=require(_0xcee9('0x12'));var config=require('../../config/environment');var licenseUtil=require(_0xcee9('0x13'));var db=require(_0xcee9('0x14'))['db'];function respondWithStatusCode(_0x2df879,_0x562f74){_0x562f74=_0x562f74||0xcc;return function(_0x1ed4fc){if(_0x1ed4fc){return _0x2df879[_0xcee9('0x15')](_0x562f74);}return _0x2df879[_0xcee9('0x16')](_0x562f74)[_0xcee9('0x17')]();};}function respondWithResult(_0x1d93a2,_0x4a0125){_0x4a0125=_0x4a0125||0xc8;return function(_0x5e9930){if(_0x5e9930){return _0x1d93a2[_0xcee9('0x16')](_0x4a0125)[_0xcee9('0x18')](_0x5e9930);}};}function respondWithFilteredResult(_0x2558a2,_0x1eb62c){return function(_0x3a513f){if(_0x3a513f){var _0x1e3790=typeof _0x1eb62c[_0xcee9('0x19')]===_0xcee9('0x1a')&&typeof _0x1eb62c[_0xcee9('0x1b')]===_0xcee9('0x1a');var _0x1eec39=_0x3a513f[_0xcee9('0x1c')];var _0x552ca1=_0x1e3790?0x0:_0x1eb62c[_0xcee9('0x19')];var _0x414032=_0x1e3790?_0x3a513f[_0xcee9('0x1c')]:_0x1eb62c[_0xcee9('0x19')]+_0x1eb62c[_0xcee9('0x1b')];var _0x492fd6;if(_0x414032>=_0x1eec39){_0x414032=_0x1eec39;_0x492fd6=0xc8;}else{_0x492fd6=0xce;}_0x2558a2[_0xcee9('0x16')](_0x492fd6);return _0x2558a2[_0xcee9('0x1d')](_0xcee9('0x1e'),_0x552ca1+'-'+_0x414032+'/'+_0x1eec39)[_0xcee9('0x18')](_0x3a513f);}return null;};}function patchUpdates(_0x580b06){return function(_0x932166){try{jsonpatch[_0xcee9('0x1f')](_0x932166,_0x580b06,!![]);}catch(_0x4e5a1a){return BPromise['reject'](_0x4e5a1a);}return _0x932166[_0xcee9('0x20')]();};}function saveUpdates(_0x1c90b2,_0x146018){return function(_0x49afe8){if(_0x49afe8){return _0x49afe8[_0xcee9('0x21')](_0x1c90b2)[_0xcee9('0x22')](function(_0x39956f){return _0x39956f;});}return null;};}function removeEntity(_0x57b548,_0x2c219){return function(_0x5c1250){if(_0x5c1250){return _0x5c1250[_0xcee9('0x23')]()[_0xcee9('0x22')](function(){_0x57b548[_0xcee9('0x16')](0xcc)[_0xcee9('0x17')]();});}};}function handleEntityNotFound(_0xef4b0a,_0x3ce813){return function(_0x1c8d26){if(!_0x1c8d26){_0xef4b0a[_0xcee9('0x15')](0x194);}return _0x1c8d26;};}function handleError(_0x26d277,_0x2ec6ca){_0x2ec6ca=_0x2ec6ca||0x1f4;return function(_0x4cc9a1){logger['error'](_0x4cc9a1[_0xcee9('0x24')]);if(_0x4cc9a1['name']){delete _0x4cc9a1[_0xcee9('0x25')];}_0x26d277[_0xcee9('0x16')](_0x2ec6ca)[_0xcee9('0x26')](_0x4cc9a1);};}exports[_0xcee9('0x27')]=function(_0x5911bf,_0x277262){var _0x22efee={},_0x3e88cd={},_0x4c4d51={'count':0x0,'rows':[]};var _0x3d3027=_[_0xcee9('0x28')](db[_0xcee9('0x29')]['rawAttributes'],function(_0x6a9aa8){return{'name':_0x6a9aa8[_0xcee9('0x2a')],'type':_0x6a9aa8[_0xcee9('0x2b')][_0xcee9('0x2c')]};});_0x3e88cd['model']=_[_0xcee9('0x28')](_0x3d3027,_0xcee9('0x25'));_0x3e88cd['query']=_[_0xcee9('0x2d')](_0x5911bf[_0xcee9('0x2e')]);_0x3e88cd[_0xcee9('0x2f')]=_[_0xcee9('0x30')](_0x3e88cd['model'],_0x3e88cd['query']);_0x22efee[_0xcee9('0x31')]=_[_0xcee9('0x30')](_0x3e88cd[_0xcee9('0x32')],qs[_0xcee9('0x33')](_0x5911bf[_0xcee9('0x2e')][_0xcee9('0x33')]));_0x22efee[_0xcee9('0x31')]=_0x22efee['attributes'][_0xcee9('0x34')]?_0x22efee[_0xcee9('0x31')]:_0x3e88cd[_0xcee9('0x32')];if(!_0x5911bf['query'][_0xcee9('0x35')](_0xcee9('0x36'))){_0x22efee[_0xcee9('0x1b')]=qs[_0xcee9('0x1b')](_0x5911bf[_0xcee9('0x2e')]['limit']);_0x22efee['offset']=qs[_0xcee9('0x19')](_0x5911bf[_0xcee9('0x2e')][_0xcee9('0x19')]);}_0x22efee['order']=qs[_0xcee9('0x37')](_0x5911bf[_0xcee9('0x2e')][_0xcee9('0x37')]);_0x22efee[_0xcee9('0x38')]=qs[_0xcee9('0x2f')](_[_0xcee9('0x39')](_0x5911bf['query'],_0x3e88cd[_0xcee9('0x2f')]),_0x3d3027);if(_0x5911bf[_0xcee9('0x2e')][_0xcee9('0x3a')]){_0x22efee[_0xcee9('0x38')]=_['merge'](_0x22efee['where'],{'$or':_[_0xcee9('0x28')](_0x3d3027,function(_0x15b3a2){if(_0x15b3a2['type']!=='VIRTUAL'){var _0x192589={};_0x192589[_0x15b3a2[_0xcee9('0x25')]]={'$like':'%'+_0x5911bf['query'][_0xcee9('0x3a')]+'%'};return _0x192589;}})});}_0x22efee=_[_0xcee9('0x3b')]({},_0x22efee,_0x5911bf[_0xcee9('0x3c')]);var _0x5e6628={'where':_0x22efee['where']};return db[_0xcee9('0x29')][_0xcee9('0x1c')](_0x5e6628)[_0xcee9('0x22')](function(_0xe0ba07){_0x4c4d51[_0xcee9('0x1c')]=_0xe0ba07;if(_0x5911bf[_0xcee9('0x2e')][_0xcee9('0x3d')]){_0x22efee[_0xcee9('0x3e')]=[{'all':!![]}];}return db[_0xcee9('0x29')][_0xcee9('0x3f')](_0x22efee);})[_0xcee9('0x22')](function(_0x5827ae){_0x4c4d51['rows']=_0x5827ae;return _0x4c4d51;})[_0xcee9('0x22')](respondWithFilteredResult(_0x277262,_0x22efee))[_0xcee9('0x40')](handleError(_0x277262,null));};exports['show']=function(_0x33c17b,_0x11efe2){var _0x292645={'raw':!![],'where':{'id':_0x33c17b[_0xcee9('0x41')]['id']}},_0x53409e={};_0x53409e['model']=_[_0xcee9('0x2d')](db[_0xcee9('0x29')][_0xcee9('0x42')]);_0x53409e['query']=_[_0xcee9('0x2d')](_0x33c17b[_0xcee9('0x2e')]);_0x53409e[_0xcee9('0x2f')]=_['intersection'](_0x53409e[_0xcee9('0x32')],_0x53409e['query']);_0x292645[_0xcee9('0x31')]=_[_0xcee9('0x30')](_0x53409e[_0xcee9('0x32')],qs[_0xcee9('0x33')](_0x33c17b[_0xcee9('0x2e')][_0xcee9('0x33')]));_0x292645[_0xcee9('0x31')]=_0x292645[_0xcee9('0x31')][_0xcee9('0x34')]?_0x292645[_0xcee9('0x31')]:_0x53409e[_0xcee9('0x32')];if(_0x33c17b[_0xcee9('0x2e')]['includeAll']){_0x292645['include']=[{'all':!![]}];}_0x292645=_[_0xcee9('0x3b')]({},_0x292645,_0x33c17b[_0xcee9('0x3c')]);return db[_0xcee9('0x29')]['find'](_0x292645)['then'](handleEntityNotFound(_0x11efe2,null))['then'](respondWithResult(_0x11efe2,null))[_0xcee9('0x40')](handleError(_0x11efe2,null));};exports[_0xcee9('0x43')]=function(_0x1792af,_0x30976b){return db['ChatQueueReport'][_0xcee9('0x43')](_0x1792af['body'],{})[_0xcee9('0x22')](respondWithResult(_0x30976b,0xc9))[_0xcee9('0x40')](handleError(_0x30976b,null));};exports[_0xcee9('0x21')]=function(_0x315446,_0x499152){if(_0x315446['body']['id']){delete _0x315446['body']['id'];}return db['ChatQueueReport']['find']({'where':{'id':_0x315446['params']['id']}})[_0xcee9('0x22')](handleEntityNotFound(_0x499152,null))[_0xcee9('0x22')](saveUpdates(_0x315446['body'],null))[_0xcee9('0x22')](respondWithResult(_0x499152,null))[_0xcee9('0x40')](handleError(_0x499152,null));};exports[_0xcee9('0x23')]=function(_0x5d4448,_0x370f43){return db['ChatQueueReport'][_0xcee9('0x44')]({'where':{'id':_0x5d4448[_0xcee9('0x41')]['id']}})[_0xcee9('0x22')](handleEntityNotFound(_0x370f43,null))[_0xcee9('0x22')](removeEntity(_0x370f43,null))[_0xcee9('0x40')](handleError(_0x370f43,null));};exports['describe']=function(_0xcc2c79,_0x23c598){return db[_0xcee9('0x29')]['describe']()['then'](respondWithResult(_0x23c598,null))[_0xcee9('0x40')](handleError(_0x23c598,null));};
\ No newline at end of file
+var _0x0b78=['filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','map','VIRTUAL','options','include','rows','catch','show','params','keys','find','create','body','describe','rimraf','zip-dir','fast-json-patch','moment','bluebird','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','sendStatus','status','end','offset','undefined','limit','count','set','Content-Range','json','apply','reject','save','update','then','destroy','error','stack','name','send','index','ChatQueueReport','rawAttributes','fieldName','type','key','model','query'];(function(_0xb6afe,_0x38671f){var _0x335218=function(_0x325284){while(--_0x325284){_0xb6afe['push'](_0xb6afe['shift']());}};_0x335218(++_0x38671f);}(_0x0b78,0x1d6));var _0x80b7=function(_0x4b369d,_0x265eb8){_0x4b369d=_0x4b369d-0x0;var _0x571a98=_0x0b78[_0x4b369d];return _0x571a98;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x80b7('0x0'));var zipdir=require(_0x80b7('0x1'));var jsonpatch=require(_0x80b7('0x2'));var rp=require('request-promise');var moment=require(_0x80b7('0x3'));var BPromise=require(_0x80b7('0x4'));var Mustache=require('mustache');var util=require('util');var path=require('path');var sox=require(_0x80b7('0x5'));var csv=require(_0x80b7('0x6'));var ejs=require(_0x80b7('0x7'));var fs=require('fs');var fs_extra=require(_0x80b7('0x8'));var _=require(_0x80b7('0x9'));var squel=require(_0x80b7('0xa'));var crypto=require('crypto');var jsforce=require(_0x80b7('0xb'));var deskjs=require(_0x80b7('0xc'));var toCsv=require(_0x80b7('0x6'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x80b7('0xd'));var authService=require('../../components/auth/service');var qs=require(_0x80b7('0xe'));var as=require(_0x80b7('0xf'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x80b7('0x10'))(_0x80b7('0x11'));var utils=require(_0x80b7('0x12'));var config=require(_0x80b7('0x13'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x3ac007,_0x1bbe9f){_0x1bbe9f=_0x1bbe9f||0xcc;return function(_0x16976c){if(_0x16976c){return _0x3ac007[_0x80b7('0x14')](_0x1bbe9f);}return _0x3ac007[_0x80b7('0x15')](_0x1bbe9f)[_0x80b7('0x16')]();};}function respondWithResult(_0x3d71a0,_0x32cecc){_0x32cecc=_0x32cecc||0xc8;return function(_0x416d32){if(_0x416d32){return _0x3d71a0['status'](_0x32cecc)['json'](_0x416d32);}};}function respondWithFilteredResult(_0x5c64df,_0x57e428){return function(_0x2c6bff){if(_0x2c6bff){var _0x459f67=typeof _0x57e428[_0x80b7('0x17')]===_0x80b7('0x18')&&typeof _0x57e428[_0x80b7('0x19')]===_0x80b7('0x18');var _0x262cd5=_0x2c6bff[_0x80b7('0x1a')];var _0x22abaa=_0x459f67?0x0:_0x57e428[_0x80b7('0x17')];var _0x25b5e9=_0x459f67?_0x2c6bff[_0x80b7('0x1a')]:_0x57e428[_0x80b7('0x17')]+_0x57e428['limit'];var _0x2165df;if(_0x25b5e9>=_0x262cd5){_0x25b5e9=_0x262cd5;_0x2165df=0xc8;}else{_0x2165df=0xce;}_0x5c64df[_0x80b7('0x15')](_0x2165df);return _0x5c64df[_0x80b7('0x1b')](_0x80b7('0x1c'),_0x22abaa+'-'+_0x25b5e9+'/'+_0x262cd5)[_0x80b7('0x1d')](_0x2c6bff);}return null;};}function patchUpdates(_0x3ebdd6){return function(_0x220133){try{jsonpatch[_0x80b7('0x1e')](_0x220133,_0x3ebdd6,!![]);}catch(_0x3da240){return BPromise[_0x80b7('0x1f')](_0x3da240);}return _0x220133[_0x80b7('0x20')]();};}function saveUpdates(_0x1ef249,_0x53046f){return function(_0x55bf6e){if(_0x55bf6e){return _0x55bf6e[_0x80b7('0x21')](_0x1ef249)[_0x80b7('0x22')](function(_0x158b65){return _0x158b65;});}return null;};}function removeEntity(_0x5e8093,_0x9fccdc){return function(_0x390d8a){if(_0x390d8a){return _0x390d8a[_0x80b7('0x23')]()[_0x80b7('0x22')](function(){_0x5e8093[_0x80b7('0x15')](0xcc)[_0x80b7('0x16')]();});}};}function handleEntityNotFound(_0x44ab49,_0xea1ea0){return function(_0x23a876){if(!_0x23a876){_0x44ab49[_0x80b7('0x14')](0x194);}return _0x23a876;};}function handleError(_0x1221c7,_0x4cb8c9){_0x4cb8c9=_0x4cb8c9||0x1f4;return function(_0x328c15){logger[_0x80b7('0x24')](_0x328c15[_0x80b7('0x25')]);if(_0x328c15[_0x80b7('0x26')]){delete _0x328c15[_0x80b7('0x26')];}_0x1221c7[_0x80b7('0x15')](_0x4cb8c9)[_0x80b7('0x27')](_0x328c15);};}exports[_0x80b7('0x28')]=function(_0x479335,_0x42e7a6){var _0x23958b={},_0x1dc2df={},_0x396144={'count':0x0,'rows':[]};var _0x46b76b=_['map'](db[_0x80b7('0x29')][_0x80b7('0x2a')],function(_0x2cc6f7){return{'name':_0x2cc6f7[_0x80b7('0x2b')],'type':_0x2cc6f7[_0x80b7('0x2c')][_0x80b7('0x2d')]};});_0x1dc2df[_0x80b7('0x2e')]=_['map'](_0x46b76b,_0x80b7('0x26'));_0x1dc2df[_0x80b7('0x2f')]=_['keys'](_0x479335[_0x80b7('0x2f')]);_0x1dc2df[_0x80b7('0x30')]=_[_0x80b7('0x31')](_0x1dc2df[_0x80b7('0x2e')],_0x1dc2df[_0x80b7('0x2f')]);_0x23958b[_0x80b7('0x32')]=_['intersection'](_0x1dc2df[_0x80b7('0x2e')],qs[_0x80b7('0x33')](_0x479335[_0x80b7('0x2f')]['fields']));_0x23958b[_0x80b7('0x32')]=_0x23958b[_0x80b7('0x32')][_0x80b7('0x34')]?_0x23958b['attributes']:_0x1dc2df[_0x80b7('0x2e')];if(!_0x479335[_0x80b7('0x2f')][_0x80b7('0x35')](_0x80b7('0x36'))){_0x23958b[_0x80b7('0x19')]=qs[_0x80b7('0x19')](_0x479335[_0x80b7('0x2f')][_0x80b7('0x19')]);_0x23958b['offset']=qs['offset'](_0x479335[_0x80b7('0x2f')][_0x80b7('0x17')]);}_0x23958b[_0x80b7('0x37')]=qs[_0x80b7('0x38')](_0x479335['query']['sort']);_0x23958b[_0x80b7('0x39')]=qs[_0x80b7('0x30')](_[_0x80b7('0x3a')](_0x479335[_0x80b7('0x2f')],_0x1dc2df['filters']),_0x46b76b);if(_0x479335[_0x80b7('0x2f')][_0x80b7('0x3b')]){_0x23958b['where']=_[_0x80b7('0x3c')](_0x23958b['where'],{'$or':_[_0x80b7('0x3d')](_0x46b76b,function(_0x490b91){if(_0x490b91['type']!==_0x80b7('0x3e')){var _0x76ffba={};_0x76ffba[_0x490b91[_0x80b7('0x26')]]={'$like':'%'+_0x479335[_0x80b7('0x2f')]['filter']+'%'};return _0x76ffba;}})});}_0x23958b=_['merge']({},_0x23958b,_0x479335[_0x80b7('0x3f')]);var _0x4f50ca={'where':_0x23958b[_0x80b7('0x39')]};return db[_0x80b7('0x29')]['count'](_0x4f50ca)['then'](function(_0x15fe0d){_0x396144[_0x80b7('0x1a')]=_0x15fe0d;if(_0x479335[_0x80b7('0x2f')]['includeAll']){_0x23958b[_0x80b7('0x40')]=[{'all':!![]}];}return db['ChatQueueReport']['findAll'](_0x23958b);})[_0x80b7('0x22')](function(_0x1b2fda){_0x396144[_0x80b7('0x41')]=_0x1b2fda;return _0x396144;})[_0x80b7('0x22')](respondWithFilteredResult(_0x42e7a6,_0x23958b))[_0x80b7('0x42')](handleError(_0x42e7a6,null));};exports[_0x80b7('0x43')]=function(_0xa12f05,_0x2070fc){var _0xa5d1bf={'raw':!![],'where':{'id':_0xa12f05[_0x80b7('0x44')]['id']}},_0x190d41={};_0x190d41[_0x80b7('0x2e')]=_['keys'](db[_0x80b7('0x29')][_0x80b7('0x2a')]);_0x190d41[_0x80b7('0x2f')]=_[_0x80b7('0x45')](_0xa12f05[_0x80b7('0x2f')]);_0x190d41[_0x80b7('0x30')]=_[_0x80b7('0x31')](_0x190d41[_0x80b7('0x2e')],_0x190d41[_0x80b7('0x2f')]);_0xa5d1bf[_0x80b7('0x32')]=_[_0x80b7('0x31')](_0x190d41['model'],qs[_0x80b7('0x33')](_0xa12f05['query'][_0x80b7('0x33')]));_0xa5d1bf[_0x80b7('0x32')]=_0xa5d1bf[_0x80b7('0x32')][_0x80b7('0x34')]?_0xa5d1bf['attributes']:_0x190d41[_0x80b7('0x2e')];if(_0xa12f05[_0x80b7('0x2f')]['includeAll']){_0xa5d1bf[_0x80b7('0x40')]=[{'all':!![]}];}_0xa5d1bf=_[_0x80b7('0x3c')]({},_0xa5d1bf,_0xa12f05['options']);return db[_0x80b7('0x29')][_0x80b7('0x46')](_0xa5d1bf)['then'](handleEntityNotFound(_0x2070fc,null))['then'](respondWithResult(_0x2070fc,null))[_0x80b7('0x42')](handleError(_0x2070fc,null));};exports[_0x80b7('0x47')]=function(_0xb75a61,_0x29bee7){return db[_0x80b7('0x29')][_0x80b7('0x47')](_0xb75a61[_0x80b7('0x48')],{})['then'](respondWithResult(_0x29bee7,0xc9))['catch'](handleError(_0x29bee7,null));};exports['update']=function(_0x599205,_0x52fd0b){if(_0x599205['body']['id']){delete _0x599205[_0x80b7('0x48')]['id'];}return db[_0x80b7('0x29')][_0x80b7('0x46')]({'where':{'id':_0x599205['params']['id']}})[_0x80b7('0x22')](handleEntityNotFound(_0x52fd0b,null))[_0x80b7('0x22')](saveUpdates(_0x599205[_0x80b7('0x48')],null))['then'](respondWithResult(_0x52fd0b,null))[_0x80b7('0x42')](handleError(_0x52fd0b,null));};exports['destroy']=function(_0x1e7536,_0x2a642e){return db[_0x80b7('0x29')]['find']({'where':{'id':_0x1e7536[_0x80b7('0x44')]['id']}})['then'](handleEntityNotFound(_0x2a642e,null))['then'](removeEntity(_0x2a642e,null))[_0x80b7('0x42')](handleError(_0x2a642e,null));};exports[_0x80b7('0x49')]=function(_0x3d327d,_0xb9170b){return db[_0x80b7('0x29')][_0x80b7('0x49')]()[_0x80b7('0x22')](respondWithResult(_0xb9170b,null))[_0x80b7('0x42')](handleError(_0xb9170b,null));};
\ No newline at end of file
diff --git a/server/api/chatQueueReport/chatQueueReport.model.js b/server/api/chatQueueReport/chatQueueReport.model.js
index 6efc10a..3a8942f 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 _0x0713=['../../config/logger','api','moment','bluebird','request-promise','rimraf','../../config/environment','./chatQueueReport.attributes','exports','define','ChatQueueReport','report_chat_queue','uniqueid'];(function(_0x2f62aa,_0x108e95){var _0x1a341f=function(_0x3aedcf){while(--_0x3aedcf){_0x2f62aa['push'](_0x2f62aa['shift']());}};_0x1a341f(++_0x108e95);}(_0x0713,0x1ba));var _0x3071=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x0713[_0x3dd15e];return _0x231fd0;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x3071('0x0'))(_0x3071('0x1'));var moment=require(_0x3071('0x2'));var BPromise=require(_0x3071('0x3'));var rp=require(_0x3071('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x3071('0x5'));var config=require(_0x3071('0x6'));var attributes=require(_0x3071('0x7'));module[_0x3071('0x8')]=function(_0xabd7b6,_0x41cf76){return _0xabd7b6[_0x3071('0x9')](_0x3071('0xa'),attributes,{'tableName':_0x3071('0xb'),'paranoid':![],'indexes':[{'name':_0x3071('0xc'),'fields':[_0x3071('0xc')]}],'timestamps':!![]});};
\ No newline at end of file
+var _0xbaf0=['define','ChatQueueReport','report_chat_queue','uniqueid','util','../../config/logger','api','moment','bluebird','request-promise','rimraf','../../config/environment','./chatQueueReport.attributes','exports'];(function(_0x424d0c,_0x17e32e){var _0x3e1135=function(_0xa0e55f){while(--_0xa0e55f){_0x424d0c['push'](_0x424d0c['shift']());}};_0x3e1135(++_0x17e32e);}(_0xbaf0,0x12a));var _0x0baf=function(_0xa464c9,_0x7c86d8){_0xa464c9=_0xa464c9-0x0;var _0x3d73c4=_0xbaf0[_0xa464c9];return _0x3d73c4;};'use strict';var _=require('lodash');var util=require(_0x0baf('0x0'));var logger=require(_0x0baf('0x1'))(_0x0baf('0x2'));var moment=require(_0x0baf('0x3'));var BPromise=require(_0x0baf('0x4'));var rp=require(_0x0baf('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x0baf('0x6'));var config=require(_0x0baf('0x7'));var attributes=require(_0x0baf('0x8'));module[_0x0baf('0x9')]=function(_0xe4c3c4,_0x335e24){return _0xe4c3c4[_0x0baf('0xa')](_0x0baf('0xb'),attributes,{'tableName':_0x0baf('0xc'),'paranoid':![],'indexes':[{'name':'uniqueid','fields':[_0x0baf('0xd')]}],'timestamps':!![]});};
\ No newline at end of file
diff --git a/server/api/chatQueueReport/chatQueueReport.rpc.js b/server/api/chatQueueReport/chatQueueReport.rpc.js
index 130d56b..7a3821b 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 _0x47a1=['code','message','result','catch','create','body','options','raw','CreateChatQueueReport','UpdateChatQueueReport','ChatQueueReport','update','attributes','limit','util','moment','randomstring','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','request','then','info','ChatQueueReport,\x20%s,\x20%s','request\x20sent','debug','ChatQueueReport,\x20%s,\x20%s,\x20%s','stringify','error'];(function(_0x32f9ca,_0x2fa8bc){var _0x52e083=function(_0x4fd86a){while(--_0x4fd86a){_0x32f9ca['push'](_0x32f9ca['shift']());}};_0x52e083(++_0x2fa8bc);}(_0x47a1,0x179));var _0x147a=function(_0x8365cd,_0x3c72a1){_0x8365cd=_0x8365cd-0x0;var _0x16c08c=_0x47a1[_0x8365cd];return _0x16c08c;};'use strict';var _=require('lodash');var util=require(_0x147a('0x0'));var moment=require(_0x147a('0x1'));var BPromise=require('bluebird');var rs=require(_0x147a('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x147a('0x3'))['db'];var utils=require(_0x147a('0x4'));var logger=require('../../config/logger')(_0x147a('0x5'));var config=require(_0x147a('0x6'));var jayson=require(_0x147a('0x7'));var client=jayson[_0x147a('0x8')][_0x147a('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x575604,_0x3d39e3,_0x3ed04b){return new BPromise(function(_0x23ca54,_0x557edf){return client[_0x147a('0xa')](_0x575604,_0x3ed04b)[_0x147a('0xb')](function(_0x20178e){logger[_0x147a('0xc')](_0x147a('0xd'),_0x3d39e3,_0x147a('0xe'));logger[_0x147a('0xf')](_0x147a('0x10'),_0x3d39e3,_0x147a('0xe'),JSON[_0x147a('0x11')](_0x20178e));if(_0x20178e[_0x147a('0x12')]){if(_0x20178e[_0x147a('0x12')][_0x147a('0x13')]===0x1f4){logger[_0x147a('0x12')](_0x147a('0xd'),_0x3d39e3,_0x20178e[_0x147a('0x12')][_0x147a('0x14')]);return _0x557edf(_0x20178e['error'][_0x147a('0x14')]);}logger['error'](_0x147a('0xd'),_0x3d39e3,_0x20178e[_0x147a('0x12')][_0x147a('0x14')]);return _0x23ca54(_0x20178e['error'][_0x147a('0x14')]);}else{logger[_0x147a('0xc')](_0x147a('0xd'),_0x3d39e3,'request\x20sent');_0x23ca54(_0x20178e[_0x147a('0x15')][_0x147a('0x14')]);}})[_0x147a('0x16')](function(_0x58f49a){logger[_0x147a('0x12')](_0x147a('0xd'),_0x3d39e3,_0x58f49a);_0x557edf(_0x58f49a);});});}exports['CreateChatQueueReport']=function(_0x3afb93){var _0x11838a=this;return new Promise(function(_0x17f4da,_0x477e4e){return db['ChatQueueReport'][_0x147a('0x17')](_0x3afb93[_0x147a('0x18')],{'raw':_0x3afb93[_0x147a('0x19')]?_0x3afb93['options'][_0x147a('0x1a')]===undefined?!![]:![]:!![]})[_0x147a('0xb')](function(_0x5490b4){logger[_0x147a('0xc')](_0x147a('0x1b'),_0x3afb93);logger[_0x147a('0xf')](_0x147a('0x1b'),_0x3afb93,JSON[_0x147a('0x11')](_0x5490b4));_0x17f4da(_0x5490b4);})[_0x147a('0x16')](function(_0x2f37dc){logger[_0x147a('0x12')](_0x147a('0x1b'),_0x2f37dc[_0x147a('0x14')],_0x3afb93);_0x477e4e(_0x11838a[_0x147a('0x12')](0x1f4,_0x2f37dc[_0x147a('0x14')]));});});};exports[_0x147a('0x1c')]=function(_0x59d552){var _0x9c1f70=this;return new Promise(function(_0x5107c2,_0x34a6fd){return db[_0x147a('0x1d')][_0x147a('0x1e')](_0x59d552[_0x147a('0x18')],{'raw':_0x59d552['options']?_0x59d552['options'][_0x147a('0x1a')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x59d552[_0x147a('0x19')]?_0x59d552[_0x147a('0x19')]['where']||null:null,'attributes':_0x59d552[_0x147a('0x19')]?_0x59d552[_0x147a('0x19')][_0x147a('0x1f')]||null:null,'limit':_0x59d552[_0x147a('0x19')]?_0x59d552[_0x147a('0x19')][_0x147a('0x20')]||null:null})[_0x147a('0xb')](function(_0x1a3cb2){logger[_0x147a('0xc')](_0x147a('0x1c'),_0x59d552);logger[_0x147a('0xf')](_0x147a('0x1c'),_0x59d552,JSON['stringify'](_0x1a3cb2));_0x5107c2(_0x1a3cb2);})[_0x147a('0x16')](function(_0x11c8df){logger['error']('UpdateChatQueueReport',_0x11c8df[_0x147a('0x14')],_0x59d552);_0x34a6fd(_0x9c1f70[_0x147a('0x12')](0x1f4,_0x11c8df[_0x147a('0x14')]));});});};
\ No newline at end of file
+var _0xda44=['attributes','limit','UpdateChatQueueReport','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','request','then','info','ChatQueueReport,\x20%s,\x20%s','request\x20sent','ChatQueueReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','CreateChatQueueReport','ChatQueueReport','create','body','options','raw','debug','catch','update','where'];(function(_0x578a73,_0x1cbfb4){var _0x2e3780=function(_0x3a76c3){while(--_0x3a76c3){_0x578a73['push'](_0x578a73['shift']());}};_0x2e3780(++_0x1cbfb4);}(_0xda44,0x175));var _0x4da4=function(_0x376b45,_0x5964fb){_0x376b45=_0x376b45-0x0;var _0x2341b3=_0xda44[_0x376b45];return _0x2341b3;};'use strict';var _=require(_0x4da4('0x0'));var util=require(_0x4da4('0x1'));var moment=require(_0x4da4('0x2'));var BPromise=require(_0x4da4('0x3'));var rs=require(_0x4da4('0x4'));var fs=require('fs');var Redis=require(_0x4da4('0x5'));var db=require(_0x4da4('0x6'))['db'];var utils=require(_0x4da4('0x7'));var logger=require(_0x4da4('0x8'))(_0x4da4('0x9'));var config=require(_0x4da4('0xa'));var jayson=require('jayson/promise');var client=jayson[_0x4da4('0xb')][_0x4da4('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x195401,_0x1b94f6,_0x18e9c8){return new BPromise(function(_0x2d8335,_0x38c1a2){return client[_0x4da4('0xd')](_0x195401,_0x18e9c8)[_0x4da4('0xe')](function(_0x15c9ba){logger[_0x4da4('0xf')](_0x4da4('0x10'),_0x1b94f6,_0x4da4('0x11'));logger['debug'](_0x4da4('0x12'),_0x1b94f6,_0x4da4('0x11'),JSON[_0x4da4('0x13')](_0x15c9ba));if(_0x15c9ba[_0x4da4('0x14')]){if(_0x15c9ba['error'][_0x4da4('0x15')]===0x1f4){logger[_0x4da4('0x14')](_0x4da4('0x10'),_0x1b94f6,_0x15c9ba['error'][_0x4da4('0x16')]);return _0x38c1a2(_0x15c9ba[_0x4da4('0x14')][_0x4da4('0x16')]);}logger[_0x4da4('0x14')](_0x4da4('0x10'),_0x1b94f6,_0x15c9ba[_0x4da4('0x14')][_0x4da4('0x16')]);return _0x2d8335(_0x15c9ba[_0x4da4('0x14')][_0x4da4('0x16')]);}else{logger[_0x4da4('0xf')](_0x4da4('0x10'),_0x1b94f6,_0x4da4('0x11'));_0x2d8335(_0x15c9ba[_0x4da4('0x17')][_0x4da4('0x16')]);}})['catch'](function(_0x531ce5){logger[_0x4da4('0x14')](_0x4da4('0x10'),_0x1b94f6,_0x531ce5);_0x38c1a2(_0x531ce5);});});}exports[_0x4da4('0x18')]=function(_0x3ca699){var _0x5a6832=this;return new Promise(function(_0x26cddc,_0x5dbf62){return db[_0x4da4('0x19')][_0x4da4('0x1a')](_0x3ca699[_0x4da4('0x1b')],{'raw':_0x3ca699[_0x4da4('0x1c')]?_0x3ca699[_0x4da4('0x1c')][_0x4da4('0x1d')]===undefined?!![]:![]:!![]})[_0x4da4('0xe')](function(_0xfb56ff){logger['info']('CreateChatQueueReport',_0x3ca699);logger[_0x4da4('0x1e')]('CreateChatQueueReport',_0x3ca699,JSON[_0x4da4('0x13')](_0xfb56ff));_0x26cddc(_0xfb56ff);})[_0x4da4('0x1f')](function(_0x52afc5){logger['error'](_0x4da4('0x18'),_0x52afc5[_0x4da4('0x16')],_0x3ca699);_0x5dbf62(_0x5a6832[_0x4da4('0x14')](0x1f4,_0x52afc5[_0x4da4('0x16')]));});});};exports['UpdateChatQueueReport']=function(_0x117ee7){var _0x39d6e9=this;return new Promise(function(_0x33ecf4,_0x5d289d){return db['ChatQueueReport'][_0x4da4('0x20')](_0x117ee7[_0x4da4('0x1b')],{'raw':_0x117ee7[_0x4da4('0x1c')]?_0x117ee7['options'][_0x4da4('0x1d')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x117ee7['options']?_0x117ee7[_0x4da4('0x1c')][_0x4da4('0x21')]||null:null,'attributes':_0x117ee7[_0x4da4('0x1c')]?_0x117ee7[_0x4da4('0x1c')][_0x4da4('0x22')]||null:null,'limit':_0x117ee7[_0x4da4('0x1c')]?_0x117ee7[_0x4da4('0x1c')][_0x4da4('0x23')]||null:null})[_0x4da4('0xe')](function(_0x36370b){logger[_0x4da4('0xf')](_0x4da4('0x24'),_0x117ee7);logger[_0x4da4('0x1e')]('UpdateChatQueueReport',_0x117ee7,JSON[_0x4da4('0x13')](_0x36370b));_0x33ecf4(_0x36370b);})['catch'](function(_0x3ec659){logger['error'](_0x4da4('0x24'),_0x3ec659[_0x4da4('0x16')],_0x117ee7);_0x5d289d(_0x39d6e9[_0x4da4('0x14')](0x1f4,_0x3ec659[_0x4da4('0x16')]));});});};
\ No newline at end of file
diff --git a/server/api/chatQueueReport/index.js b/server/api/chatQueueReport/index.js
index 34f2e87..bf4ddb5 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 _0x623a=['/:id','update','delete','destroy','exports','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatQueueReport.controller','get','isAuthenticated','index','/describe','describe','show','create','put'];(function(_0x10dc60,_0x2fcce1){var _0x47dec5=function(_0x24b5e4){while(--_0x24b5e4){_0x10dc60['push'](_0x10dc60['shift']());}};_0x47dec5(++_0x2fcce1);}(_0x623a,0x159));var _0xa623=function(_0x13b02f,_0x462a53){_0x13b02f=_0x13b02f-0x0;var _0x12e9a6=_0x623a[_0x13b02f];return _0x12e9a6;};'use strict';var multer=require('multer');var util=require('util');var path=require('path');var timeout=require('connect-timeout');var express=require(_0xa623('0x0'));var router=express[_0xa623('0x1')]();var fs_extra=require(_0xa623('0x2'));var auth=require(_0xa623('0x3'));var interaction=require(_0xa623('0x4'));var config=require(_0xa623('0x5'));var controller=require(_0xa623('0x6'));router[_0xa623('0x7')]('/',auth[_0xa623('0x8')](),controller[_0xa623('0x9')]);router[_0xa623('0x7')](_0xa623('0xa'),auth['isAuthenticated'](),controller[_0xa623('0xb')]);router[_0xa623('0x7')]('/:id',auth[_0xa623('0x8')](),controller[_0xa623('0xc')]);router['post']('/',auth[_0xa623('0x8')](),controller[_0xa623('0xd')]);router[_0xa623('0xe')](_0xa623('0xf'),auth[_0xa623('0x8')](),controller[_0xa623('0x10')]);router[_0xa623('0x11')](_0xa623('0xf'),auth[_0xa623('0x8')](),controller[_0xa623('0x12')]);module[_0xa623('0x13')]=router;
\ No newline at end of file
+var _0x2869=['destroy','exports','util','path','connect-timeout','express','fs-extra','../../config/environment','get','isAuthenticated','/describe','/:id','show','post','put','update'];(function(_0x38ca3a,_0x203a0b){var _0x3434f9=function(_0x167589){while(--_0x167589){_0x38ca3a['push'](_0x38ca3a['shift']());}};_0x3434f9(++_0x203a0b);}(_0x2869,0x102));var _0x9286=function(_0x12c042,_0x1c18bd){_0x12c042=_0x12c042-0x0;var _0xff80ce=_0x2869[_0x12c042];return _0xff80ce;};'use strict';var multer=require('multer');var util=require(_0x9286('0x0'));var path=require(_0x9286('0x1'));var timeout=require(_0x9286('0x2'));var express=require(_0x9286('0x3'));var router=express['Router']();var fs_extra=require(_0x9286('0x4'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x9286('0x5'));var controller=require('./chatQueueReport.controller');router[_0x9286('0x6')]('/',auth[_0x9286('0x7')](),controller['index']);router[_0x9286('0x6')](_0x9286('0x8'),auth[_0x9286('0x7')](),controller['describe']);router[_0x9286('0x6')](_0x9286('0x9'),auth[_0x9286('0x7')](),controller[_0x9286('0xa')]);router[_0x9286('0xb')]('/',auth[_0x9286('0x7')](),controller['create']);router[_0x9286('0xc')](_0x9286('0x9'),auth[_0x9286('0x7')](),controller[_0x9286('0xd')]);router['delete'](_0x9286('0x9'),auth[_0x9286('0x7')](),controller[_0x9286('0xe')]);module[_0x9286('0xf')]=router;
\ No newline at end of file
diff --git a/server/api/chatTransferReport/chatTransferReport.attributes.js b/server/api/chatTransferReport/chatTransferReport.attributes.js
index ee80085..0b65ee0 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 _0xcb91=['STRING','ENUM','account','queue','NOW','exports'];(function(_0x5e93a1,_0x1b188b){var _0xc4e764=function(_0x129a78){while(--_0x129a78){_0x5e93a1['push'](_0x5e93a1['shift']());}};_0xc4e764(++_0x1b188b);}(_0xcb91,0x1a9));var _0x1cb9=function(_0x54ea7a,_0x19df9b){_0x54ea7a=_0x54ea7a-0x0;var _0x65a10d=_0xcb91[_0x54ea7a];return _0x65a10d;};'use strict';var moment=require('moment');var Sequelize=require('sequelize');module[_0x1cb9('0x0')]={'uniqueid':{'type':Sequelize[_0x1cb9('0x1')],'allowNull':![]},'type':{'type':Sequelize[_0x1cb9('0x2')](_0x1cb9('0x3'),'agent',_0x1cb9('0x4')),'allowNull':![],'defaultValue':_0x1cb9('0x4')},'transferredAt':{'type':Sequelize['DATE'],'allowNull':![],'defaultValue':Sequelize[_0x1cb9('0x5')]}};
\ No newline at end of file
+var _0xf3cd=['exports','STRING','ENUM','account','queue','DATE','moment','sequelize'];(function(_0xf126a5,_0x4497ba){var _0x4c8b4b=function(_0x38539d){while(--_0x38539d){_0xf126a5['push'](_0xf126a5['shift']());}};_0x4c8b4b(++_0x4497ba);}(_0xf3cd,0xfe));var _0xdf3c=function(_0x4ab99,_0x219ed2){_0x4ab99=_0x4ab99-0x0;var _0x29e39c=_0xf3cd[_0x4ab99];return _0x29e39c;};'use strict';var moment=require(_0xdf3c('0x0'));var Sequelize=require(_0xdf3c('0x1'));module[_0xdf3c('0x2')]={'uniqueid':{'type':Sequelize[_0xdf3c('0x3')],'allowNull':![]},'type':{'type':Sequelize[_0xdf3c('0x4')](_0xdf3c('0x5'),'agent',_0xdf3c('0x6')),'allowNull':![],'defaultValue':_0xdf3c('0x6')},'transferredAt':{'type':Sequelize[_0xdf3c('0x7')],'allowNull':![],'defaultValue':Sequelize['NOW']}};
\ No newline at end of file
diff --git a/server/api/chatTransferReport/chatTransferReport.controller.js b/server/api/chatTransferReport/chatTransferReport.controller.js
index 08bc979..a5478ab 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 _0x2e2c=['type','merge','options','ChatTransferReport','includeAll','include','findAll','rows','catch','keys','find','create','body','params','eml-format','zip-dir','fast-json-patch','moment','bluebird','mustache','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','status','json','offset','undefined','count','limit','set','Content-Range','apply','reject','update','then','destroy','end','stack','name','send','index','map','rawAttributes','fieldName','key','model','query','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','sort','where','pick','filter'];(function(_0x4dbb37,_0x3389ae){var _0x32cb2d=function(_0xbd4e34){while(--_0xbd4e34){_0x4dbb37['push'](_0x4dbb37['shift']());}};_0x32cb2d(++_0x3389ae);}(_0x2e2c,0xa4));var _0xc2e2=function(_0x46401e,_0x2a345b){_0x46401e=_0x46401e-0x0;var _0x447cba=_0x2e2c[_0x46401e];return _0x447cba;};'use strict';var emlformat=require(_0xc2e2('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xc2e2('0x1'));var jsonpatch=require(_0xc2e2('0x2'));var rp=require('request-promise');var moment=require(_0xc2e2('0x3'));var BPromise=require(_0xc2e2('0x4'));var Mustache=require(_0xc2e2('0x5'));var util=require('util');var path=require('path');var sox=require(_0xc2e2('0x6'));var csv=require(_0xc2e2('0x7'));var ejs=require(_0xc2e2('0x8'));var fs=require('fs');var fs_extra=require(_0xc2e2('0x9'));var _=require(_0xc2e2('0xa'));var squel=require(_0xc2e2('0xb'));var crypto=require(_0xc2e2('0xc'));var jsforce=require(_0xc2e2('0xd'));var deskjs=require(_0xc2e2('0xe'));var toCsv=require(_0xc2e2('0x7'));var querystring=require(_0xc2e2('0xf'));var Papa=require('papaparse');var Redis=require(_0xc2e2('0x10'));var authService=require(_0xc2e2('0x11'));var qs=require(_0xc2e2('0x12'));var as=require(_0xc2e2('0x13'));var hardwareService=require(_0xc2e2('0x14'));var logger=require(_0xc2e2('0x15'))(_0xc2e2('0x16'));var utils=require('../../config/utils');var config=require(_0xc2e2('0x17'));var licenseUtil=require(_0xc2e2('0x18'));var db=require(_0xc2e2('0x19'))['db'];function respondWithStatusCode(_0xb16fd2,_0x4a7134){_0x4a7134=_0x4a7134||0xcc;return function(_0x10d341){if(_0x10d341){return _0xb16fd2['sendStatus'](_0x4a7134);}return _0xb16fd2[_0xc2e2('0x1a')](_0x4a7134)['end']();};}function respondWithResult(_0x1d6553,_0x69123c){_0x69123c=_0x69123c||0xc8;return function(_0x4778ec){if(_0x4778ec){return _0x1d6553[_0xc2e2('0x1a')](_0x69123c)[_0xc2e2('0x1b')](_0x4778ec);}};}function respondWithFilteredResult(_0x505909,_0x40651a){return function(_0x284adf){if(_0x284adf){var _0x358a43=typeof _0x40651a[_0xc2e2('0x1c')]===_0xc2e2('0x1d')&&typeof _0x40651a['limit']==='undefined';var _0x5395b=_0x284adf[_0xc2e2('0x1e')];var _0x933cb2=_0x358a43?0x0:_0x40651a[_0xc2e2('0x1c')];var _0x52e34c=_0x358a43?_0x284adf['count']:_0x40651a['offset']+_0x40651a[_0xc2e2('0x1f')];var _0x9bd27c;if(_0x52e34c>=_0x5395b){_0x52e34c=_0x5395b;_0x9bd27c=0xc8;}else{_0x9bd27c=0xce;}_0x505909[_0xc2e2('0x1a')](_0x9bd27c);return _0x505909[_0xc2e2('0x20')](_0xc2e2('0x21'),_0x933cb2+'-'+_0x52e34c+'/'+_0x5395b)[_0xc2e2('0x1b')](_0x284adf);}return null;};}function patchUpdates(_0x3baa97){return function(_0x1fa59a){try{jsonpatch[_0xc2e2('0x22')](_0x1fa59a,_0x3baa97,!![]);}catch(_0x243126){return BPromise[_0xc2e2('0x23')](_0x243126);}return _0x1fa59a['save']();};}function saveUpdates(_0x55eeaa,_0x22df44){return function(_0x2f7323){if(_0x2f7323){return _0x2f7323[_0xc2e2('0x24')](_0x55eeaa)[_0xc2e2('0x25')](function(_0x1cfe77){return _0x1cfe77;});}return null;};}function removeEntity(_0x304328,_0x21723f){return function(_0x54298a){if(_0x54298a){return _0x54298a[_0xc2e2('0x26')]()['then'](function(){_0x304328[_0xc2e2('0x1a')](0xcc)[_0xc2e2('0x27')]();});}};}function handleEntityNotFound(_0x31ff,_0x4212d7){return function(_0x22331d){if(!_0x22331d){_0x31ff['sendStatus'](0x194);}return _0x22331d;};}function handleError(_0x973d2,_0x378325){_0x378325=_0x378325||0x1f4;return function(_0x1a7dd2){logger['error'](_0x1a7dd2[_0xc2e2('0x28')]);if(_0x1a7dd2[_0xc2e2('0x29')]){delete _0x1a7dd2['name'];}_0x973d2[_0xc2e2('0x1a')](_0x378325)[_0xc2e2('0x2a')](_0x1a7dd2);};}exports[_0xc2e2('0x2b')]=function(_0x4ac267,_0x5b2511){var _0x5365bd={},_0x2acb4c={},_0x3020b9={'count':0x0,'rows':[]};var _0x386208=_[_0xc2e2('0x2c')](db['ChatTransferReport'][_0xc2e2('0x2d')],function(_0x45ecd4){return{'name':_0x45ecd4[_0xc2e2('0x2e')],'type':_0x45ecd4['type'][_0xc2e2('0x2f')]};});_0x2acb4c[_0xc2e2('0x30')]=_['map'](_0x386208,'name');_0x2acb4c[_0xc2e2('0x31')]=_['keys'](_0x4ac267[_0xc2e2('0x31')]);_0x2acb4c[_0xc2e2('0x32')]=_[_0xc2e2('0x33')](_0x2acb4c[_0xc2e2('0x30')],_0x2acb4c[_0xc2e2('0x31')]);_0x5365bd['attributes']=_['intersection'](_0x2acb4c['model'],qs['fields'](_0x4ac267['query'][_0xc2e2('0x34')]));_0x5365bd[_0xc2e2('0x35')]=_0x5365bd['attributes'][_0xc2e2('0x36')]?_0x5365bd[_0xc2e2('0x35')]:_0x2acb4c['model'];if(!_0x4ac267['query'][_0xc2e2('0x37')](_0xc2e2('0x38'))){_0x5365bd[_0xc2e2('0x1f')]=qs[_0xc2e2('0x1f')](_0x4ac267['query'][_0xc2e2('0x1f')]);_0x5365bd[_0xc2e2('0x1c')]=qs[_0xc2e2('0x1c')](_0x4ac267[_0xc2e2('0x31')]['offset']);}_0x5365bd['order']=qs[_0xc2e2('0x39')](_0x4ac267[_0xc2e2('0x31')]['sort']);_0x5365bd[_0xc2e2('0x3a')]=qs['filters'](_[_0xc2e2('0x3b')](_0x4ac267[_0xc2e2('0x31')],_0x2acb4c[_0xc2e2('0x32')]),_0x386208);if(_0x4ac267[_0xc2e2('0x31')][_0xc2e2('0x3c')]){_0x5365bd[_0xc2e2('0x3a')]=_['merge'](_0x5365bd['where'],{'$or':_['map'](_0x386208,function(_0xc9aa79){if(_0xc9aa79[_0xc2e2('0x3d')]!=='VIRTUAL'){var _0x2022f5={};_0x2022f5[_0xc9aa79[_0xc2e2('0x29')]]={'$like':'%'+_0x4ac267[_0xc2e2('0x31')][_0xc2e2('0x3c')]+'%'};return _0x2022f5;}})});}_0x5365bd=_[_0xc2e2('0x3e')]({},_0x5365bd,_0x4ac267[_0xc2e2('0x3f')]);var _0xf3e154={'where':_0x5365bd[_0xc2e2('0x3a')]};return db[_0xc2e2('0x40')][_0xc2e2('0x1e')](_0xf3e154)[_0xc2e2('0x25')](function(_0x1b2fb3){_0x3020b9['count']=_0x1b2fb3;if(_0x4ac267[_0xc2e2('0x31')][_0xc2e2('0x41')]){_0x5365bd[_0xc2e2('0x42')]=[{'all':!![]}];}return db[_0xc2e2('0x40')][_0xc2e2('0x43')](_0x5365bd);})[_0xc2e2('0x25')](function(_0x2c06d9){_0x3020b9[_0xc2e2('0x44')]=_0x2c06d9;return _0x3020b9;})[_0xc2e2('0x25')](respondWithFilteredResult(_0x5b2511,_0x5365bd))[_0xc2e2('0x45')](handleError(_0x5b2511,null));};exports['show']=function(_0xdb553d,_0x36e3e7){var _0x8914ff={'raw':!![],'where':{'id':_0xdb553d['params']['id']}},_0x2c05a1={};_0x2c05a1['model']=_[_0xc2e2('0x46')](db['ChatTransferReport'][_0xc2e2('0x2d')]);_0x2c05a1['query']=_[_0xc2e2('0x46')](_0xdb553d[_0xc2e2('0x31')]);_0x2c05a1['filters']=_['intersection'](_0x2c05a1[_0xc2e2('0x30')],_0x2c05a1[_0xc2e2('0x31')]);_0x8914ff[_0xc2e2('0x35')]=_[_0xc2e2('0x33')](_0x2c05a1['model'],qs[_0xc2e2('0x34')](_0xdb553d[_0xc2e2('0x31')]['fields']));_0x8914ff[_0xc2e2('0x35')]=_0x8914ff[_0xc2e2('0x35')][_0xc2e2('0x36')]?_0x8914ff[_0xc2e2('0x35')]:_0x2c05a1['model'];if(_0xdb553d[_0xc2e2('0x31')][_0xc2e2('0x41')]){_0x8914ff[_0xc2e2('0x42')]=[{'all':!![]}];}_0x8914ff=_['merge']({},_0x8914ff,_0xdb553d['options']);return db['ChatTransferReport'][_0xc2e2('0x47')](_0x8914ff)[_0xc2e2('0x25')](handleEntityNotFound(_0x36e3e7,null))[_0xc2e2('0x25')](respondWithResult(_0x36e3e7,null))[_0xc2e2('0x45')](handleError(_0x36e3e7,null));};exports[_0xc2e2('0x48')]=function(_0x3bba86,_0x128225){return db[_0xc2e2('0x40')][_0xc2e2('0x48')](_0x3bba86[_0xc2e2('0x49')],{})[_0xc2e2('0x25')](respondWithResult(_0x128225,0xc9))[_0xc2e2('0x45')](handleError(_0x128225,null));};exports[_0xc2e2('0x24')]=function(_0x1ab051,_0x57aeb3){if(_0x1ab051['body']['id']){delete _0x1ab051[_0xc2e2('0x49')]['id'];}return db[_0xc2e2('0x40')][_0xc2e2('0x47')]({'where':{'id':_0x1ab051[_0xc2e2('0x4a')]['id']}})['then'](handleEntityNotFound(_0x57aeb3,null))[_0xc2e2('0x25')](saveUpdates(_0x1ab051[_0xc2e2('0x49')],null))[_0xc2e2('0x25')](respondWithResult(_0x57aeb3,null))['catch'](handleError(_0x57aeb3,null));};exports['destroy']=function(_0x4b1676,_0x24fa0f){return db[_0xc2e2('0x40')][_0xc2e2('0x47')]({'where':{'id':_0x4b1676['params']['id']}})[_0xc2e2('0x25')](handleEntityNotFound(_0x24fa0f,null))['then'](removeEntity(_0x24fa0f,null))[_0xc2e2('0x45')](handleError(_0x24fa0f,null));};exports['describe']=function(_0x52b193,_0x104a05){return db[_0xc2e2('0x40')]['describe']()[_0xc2e2('0x25')](respondWithResult(_0x104a05,null))[_0xc2e2('0x45')](handleError(_0x104a05,null));};
\ No newline at end of file
+var _0x5fa3=['index','rawAttributes','fieldName','type','key','map','query','filters','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','order','sort','pick','filter','where','VIRTUAL','merge','ChatTransferReport','includeAll','findAll','rows','catch','show','include','options','create','body','find','params','describe','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','end','json','offset','undefined','limit','count','status','set','Content-Range','reject','save','update','then','destroy','sendStatus','error','stack','name','send'];(function(_0xef3494,_0x21bbab){var _0x3be533=function(_0x8b1130){while(--_0x8b1130){_0xef3494['push'](_0xef3494['shift']());}};_0x3be533(++_0x21bbab);}(_0x5fa3,0xc1));var _0x35fa=function(_0x2b448c,_0x2130ce){_0x2b448c=_0x2b448c-0x0;var _0x1e7133=_0x5fa3[_0x2b448c];return _0x1e7133;};'use strict';var emlformat=require(_0x35fa('0x0'));var rimraf=require(_0x35fa('0x1'));var zipdir=require(_0x35fa('0x2'));var jsonpatch=require(_0x35fa('0x3'));var rp=require('request-promise');var moment=require(_0x35fa('0x4'));var BPromise=require(_0x35fa('0x5'));var Mustache=require(_0x35fa('0x6'));var util=require(_0x35fa('0x7'));var path=require(_0x35fa('0x8'));var sox=require(_0x35fa('0x9'));var csv=require(_0x35fa('0xa'));var ejs=require(_0x35fa('0xb'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x35fa('0xc'));var squel=require(_0x35fa('0xd'));var crypto=require(_0x35fa('0xe'));var jsforce=require(_0x35fa('0xf'));var deskjs=require(_0x35fa('0x10'));var toCsv=require(_0x35fa('0xa'));var querystring=require(_0x35fa('0x11'));var Papa=require(_0x35fa('0x12'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x35fa('0x13'));var logger=require(_0x35fa('0x14'))(_0x35fa('0x15'));var utils=require(_0x35fa('0x16'));var config=require('../../config/environment');var licenseUtil=require(_0x35fa('0x17'));var db=require(_0x35fa('0x18'))['db'];function respondWithStatusCode(_0x5b46d7,_0x1977ec){_0x1977ec=_0x1977ec||0xcc;return function(_0x2a6c52){if(_0x2a6c52){return _0x5b46d7['sendStatus'](_0x1977ec);}return _0x5b46d7['status'](_0x1977ec)[_0x35fa('0x19')]();};}function respondWithResult(_0x19df6b,_0x444ab3){_0x444ab3=_0x444ab3||0xc8;return function(_0x24b1cd){if(_0x24b1cd){return _0x19df6b['status'](_0x444ab3)[_0x35fa('0x1a')](_0x24b1cd);}};}function respondWithFilteredResult(_0x5845a1,_0x38e2a6){return function(_0x1597b0){if(_0x1597b0){var _0x33457a=typeof _0x38e2a6[_0x35fa('0x1b')]===_0x35fa('0x1c')&&typeof _0x38e2a6[_0x35fa('0x1d')]===_0x35fa('0x1c');var _0x5071eb=_0x1597b0[_0x35fa('0x1e')];var _0x445a40=_0x33457a?0x0:_0x38e2a6[_0x35fa('0x1b')];var _0x138e15=_0x33457a?_0x1597b0['count']:_0x38e2a6[_0x35fa('0x1b')]+_0x38e2a6[_0x35fa('0x1d')];var _0x183d65;if(_0x138e15>=_0x5071eb){_0x138e15=_0x5071eb;_0x183d65=0xc8;}else{_0x183d65=0xce;}_0x5845a1[_0x35fa('0x1f')](_0x183d65);return _0x5845a1[_0x35fa('0x20')](_0x35fa('0x21'),_0x445a40+'-'+_0x138e15+'/'+_0x5071eb)['json'](_0x1597b0);}return null;};}function patchUpdates(_0x356027){return function(_0x2903b7){try{jsonpatch['apply'](_0x2903b7,_0x356027,!![]);}catch(_0x182238){return BPromise[_0x35fa('0x22')](_0x182238);}return _0x2903b7[_0x35fa('0x23')]();};}function saveUpdates(_0x4d7af0,_0x271fff){return function(_0x33d7eb){if(_0x33d7eb){return _0x33d7eb[_0x35fa('0x24')](_0x4d7af0)[_0x35fa('0x25')](function(_0x373d81){return _0x373d81;});}return null;};}function removeEntity(_0x59a033,_0x4beedd){return function(_0x14c2fd){if(_0x14c2fd){return _0x14c2fd[_0x35fa('0x26')]()['then'](function(){_0x59a033[_0x35fa('0x1f')](0xcc)[_0x35fa('0x19')]();});}};}function handleEntityNotFound(_0x101ac9,_0x1d4054){return function(_0xc9a54){if(!_0xc9a54){_0x101ac9[_0x35fa('0x27')](0x194);}return _0xc9a54;};}function handleError(_0x16cfc3,_0x22a1a0){_0x22a1a0=_0x22a1a0||0x1f4;return function(_0x471819){logger[_0x35fa('0x28')](_0x471819[_0x35fa('0x29')]);if(_0x471819[_0x35fa('0x2a')]){delete _0x471819['name'];}_0x16cfc3[_0x35fa('0x1f')](_0x22a1a0)[_0x35fa('0x2b')](_0x471819);};}exports[_0x35fa('0x2c')]=function(_0x525560,_0x43f127){var _0x8ea3b6={},_0x5a8f78={},_0x4a2cc3={'count':0x0,'rows':[]};var _0x5eb9c6=_['map'](db['ChatTransferReport'][_0x35fa('0x2d')],function(_0x1142d4){return{'name':_0x1142d4[_0x35fa('0x2e')],'type':_0x1142d4[_0x35fa('0x2f')][_0x35fa('0x30')]};});_0x5a8f78['model']=_[_0x35fa('0x31')](_0x5eb9c6,_0x35fa('0x2a'));_0x5a8f78[_0x35fa('0x32')]=_['keys'](_0x525560[_0x35fa('0x32')]);_0x5a8f78[_0x35fa('0x33')]=_[_0x35fa('0x34')](_0x5a8f78[_0x35fa('0x35')],_0x5a8f78[_0x35fa('0x32')]);_0x8ea3b6[_0x35fa('0x36')]=_[_0x35fa('0x34')](_0x5a8f78['model'],qs[_0x35fa('0x37')](_0x525560[_0x35fa('0x32')][_0x35fa('0x37')]));_0x8ea3b6[_0x35fa('0x36')]=_0x8ea3b6[_0x35fa('0x36')][_0x35fa('0x38')]?_0x8ea3b6[_0x35fa('0x36')]:_0x5a8f78[_0x35fa('0x35')];if(!_0x525560[_0x35fa('0x32')][_0x35fa('0x39')](_0x35fa('0x3a'))){_0x8ea3b6['limit']=qs['limit'](_0x525560[_0x35fa('0x32')]['limit']);_0x8ea3b6['offset']=qs['offset'](_0x525560['query'][_0x35fa('0x1b')]);}_0x8ea3b6[_0x35fa('0x3b')]=qs[_0x35fa('0x3c')](_0x525560[_0x35fa('0x32')][_0x35fa('0x3c')]);_0x8ea3b6['where']=qs[_0x35fa('0x33')](_[_0x35fa('0x3d')](_0x525560[_0x35fa('0x32')],_0x5a8f78[_0x35fa('0x33')]),_0x5eb9c6);if(_0x525560['query'][_0x35fa('0x3e')]){_0x8ea3b6[_0x35fa('0x3f')]=_['merge'](_0x8ea3b6[_0x35fa('0x3f')],{'$or':_[_0x35fa('0x31')](_0x5eb9c6,function(_0x1b249f){if(_0x1b249f['type']!==_0x35fa('0x40')){var _0x256f3f={};_0x256f3f[_0x1b249f[_0x35fa('0x2a')]]={'$like':'%'+_0x525560['query']['filter']+'%'};return _0x256f3f;}})});}_0x8ea3b6=_[_0x35fa('0x41')]({},_0x8ea3b6,_0x525560['options']);var _0x275a0f={'where':_0x8ea3b6[_0x35fa('0x3f')]};return db[_0x35fa('0x42')][_0x35fa('0x1e')](_0x275a0f)[_0x35fa('0x25')](function(_0x2c6c9c){_0x4a2cc3[_0x35fa('0x1e')]=_0x2c6c9c;if(_0x525560[_0x35fa('0x32')][_0x35fa('0x43')]){_0x8ea3b6['include']=[{'all':!![]}];}return db[_0x35fa('0x42')][_0x35fa('0x44')](_0x8ea3b6);})[_0x35fa('0x25')](function(_0x52d3d8){_0x4a2cc3[_0x35fa('0x45')]=_0x52d3d8;return _0x4a2cc3;})[_0x35fa('0x25')](respondWithFilteredResult(_0x43f127,_0x8ea3b6))[_0x35fa('0x46')](handleError(_0x43f127,null));};exports[_0x35fa('0x47')]=function(_0x11a903,_0x3d0a84){var _0x4840a9={'raw':!![],'where':{'id':_0x11a903['params']['id']}},_0x429230={};_0x429230['model']=_['keys'](db[_0x35fa('0x42')][_0x35fa('0x2d')]);_0x429230[_0x35fa('0x32')]=_['keys'](_0x11a903['query']);_0x429230[_0x35fa('0x33')]=_[_0x35fa('0x34')](_0x429230['model'],_0x429230['query']);_0x4840a9['attributes']=_['intersection'](_0x429230[_0x35fa('0x35')],qs[_0x35fa('0x37')](_0x11a903[_0x35fa('0x32')]['fields']));_0x4840a9[_0x35fa('0x36')]=_0x4840a9[_0x35fa('0x36')][_0x35fa('0x38')]?_0x4840a9[_0x35fa('0x36')]:_0x429230[_0x35fa('0x35')];if(_0x11a903[_0x35fa('0x32')][_0x35fa('0x43')]){_0x4840a9[_0x35fa('0x48')]=[{'all':!![]}];}_0x4840a9=_['merge']({},_0x4840a9,_0x11a903[_0x35fa('0x49')]);return db['ChatTransferReport']['find'](_0x4840a9)[_0x35fa('0x25')](handleEntityNotFound(_0x3d0a84,null))[_0x35fa('0x25')](respondWithResult(_0x3d0a84,null))[_0x35fa('0x46')](handleError(_0x3d0a84,null));};exports[_0x35fa('0x4a')]=function(_0x3f27ea,_0x558dd9){return db['ChatTransferReport'][_0x35fa('0x4a')](_0x3f27ea[_0x35fa('0x4b')],{})[_0x35fa('0x25')](respondWithResult(_0x558dd9,0xc9))[_0x35fa('0x46')](handleError(_0x558dd9,null));};exports['update']=function(_0x36b2c4,_0x30f406){if(_0x36b2c4[_0x35fa('0x4b')]['id']){delete _0x36b2c4[_0x35fa('0x4b')]['id'];}return db[_0x35fa('0x42')][_0x35fa('0x4c')]({'where':{'id':_0x36b2c4[_0x35fa('0x4d')]['id']}})['then'](handleEntityNotFound(_0x30f406,null))[_0x35fa('0x25')](saveUpdates(_0x36b2c4[_0x35fa('0x4b')],null))['then'](respondWithResult(_0x30f406,null))['catch'](handleError(_0x30f406,null));};exports[_0x35fa('0x26')]=function(_0x384963,_0xe11102){return db[_0x35fa('0x42')][_0x35fa('0x4c')]({'where':{'id':_0x384963['params']['id']}})[_0x35fa('0x25')](handleEntityNotFound(_0xe11102,null))[_0x35fa('0x25')](removeEntity(_0xe11102,null))['catch'](handleError(_0xe11102,null));};exports[_0x35fa('0x4e')]=function(_0x42e178,_0x44f7e1){return db['ChatTransferReport'][_0x35fa('0x4e')]()[_0x35fa('0x25')](respondWithResult(_0x44f7e1,null))[_0x35fa('0x46')](handleError(_0x44f7e1,null));};
\ No newline at end of file
diff --git a/server/api/chatTransferReport/chatTransferReport.model.js b/server/api/chatTransferReport/chatTransferReport.model.js
index e27c14f..64122e9 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 _0xc57f=['api','moment','path','rimraf','../../config/environment','exports','define','ChatTransferReport','uniqueid','lodash','../../config/logger'];(function(_0x44d658,_0x5913f6){var _0x4bf7f3=function(_0x4550ad){while(--_0x4550ad){_0x44d658['push'](_0x44d658['shift']());}};_0x4bf7f3(++_0x5913f6);}(_0xc57f,0x98));var _0xfc57=function(_0x313c96,_0x3cee6e){_0x313c96=_0x313c96-0x0;var _0x522f53=_0xc57f[_0x313c96];return _0x522f53;};'use strict';var _=require(_0xfc57('0x0'));var util=require('util');var logger=require(_0xfc57('0x1'))(_0xfc57('0x2'));var moment=require(_0xfc57('0x3'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0xfc57('0x4'));var rimraf=require(_0xfc57('0x5'));var config=require(_0xfc57('0x6'));var attributes=require('./chatTransferReport.attributes');module[_0xfc57('0x7')]=function(_0xbcb4dc,_0xb777ba){return _0xbcb4dc[_0xfc57('0x8')](_0xfc57('0x9'),attributes,{'tableName':'report_chat_transfer','paranoid':![],'indexes':[{'name':_0xfc57('0xa'),'fields':[_0xfc57('0xa')]}],'timestamps':!![]});};
\ No newline at end of file
+var _0x3eba=['./chatTransferReport.attributes','exports','define','uniqueid','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment'];(function(_0x16dc61,_0x347337){var _0x39b213=function(_0x2ea896){while(--_0x2ea896){_0x16dc61['push'](_0x16dc61['shift']());}};_0x39b213(++_0x347337);}(_0x3eba,0x108));var _0xa3eb=function(_0x5619e7,_0x314577){_0x5619e7=_0x5619e7-0x0;var _0x399cb1=_0x3eba[_0x5619e7];return _0x399cb1;};'use strict';var _=require('lodash');var util=require(_0xa3eb('0x0'));var logger=require(_0xa3eb('0x1'))(_0xa3eb('0x2'));var moment=require(_0xa3eb('0x3'));var BPromise=require(_0xa3eb('0x4'));var rp=require(_0xa3eb('0x5'));var fs=require('fs');var path=require(_0xa3eb('0x6'));var rimraf=require(_0xa3eb('0x7'));var config=require(_0xa3eb('0x8'));var attributes=require(_0xa3eb('0x9'));module[_0xa3eb('0xa')]=function(_0x48dafe,_0x4d6ff2){return _0x48dafe[_0xa3eb('0xb')]('ChatTransferReport',attributes,{'tableName':'report_chat_transfer','paranoid':![],'indexes':[{'name':'uniqueid','fields':[_0xa3eb('0xc')]}],'timestamps':!![]});};
\ No newline at end of file
diff --git a/server/api/chatTransferReport/chatTransferReport.rpc.js b/server/api/chatTransferReport/chatTransferReport.rpc.js
index 571d51c..5f250d9 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 _0xb169=['request\x20sent','debug','ChatTransferReport,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','lodash','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','then','info','ChatTransferReport,\x20%s,\x20%s'];(function(_0x28e6e4,_0x2f6728){var _0x16b271=function(_0x53cec0){while(--_0x53cec0){_0x28e6e4['push'](_0x28e6e4['shift']());}};_0x16b271(++_0x2f6728);}(_0xb169,0x8c));var _0x9b16=function(_0x2920dd,_0x19d049){_0x2920dd=_0x2920dd-0x0;var _0x5d4e52=_0xb169[_0x2920dd];return _0x5d4e52;};'use strict';var _=require(_0x9b16('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0x9b16('0x1'));var rs=require(_0x9b16('0x2'));var fs=require('fs');var Redis=require(_0x9b16('0x3'));var db=require(_0x9b16('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x9b16('0x5'))(_0x9b16('0x6'));var config=require(_0x9b16('0x7'));var jayson=require(_0x9b16('0x8'));var client=jayson[_0x9b16('0x9')][_0x9b16('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x4b19f0,_0x40509a,_0x1611be){return new BPromise(function(_0x588242,_0x5d8482){return client['request'](_0x4b19f0,_0x1611be)[_0x9b16('0xb')](function(_0x35877e){logger[_0x9b16('0xc')](_0x9b16('0xd'),_0x40509a,_0x9b16('0xe'));logger[_0x9b16('0xf')](_0x9b16('0x10'),_0x40509a,_0x9b16('0xe'),JSON[_0x9b16('0x11')](_0x35877e));if(_0x35877e['error']){if(_0x35877e[_0x9b16('0x12')]['code']===0x1f4){logger[_0x9b16('0x12')](_0x9b16('0xd'),_0x40509a,_0x35877e['error']['message']);return _0x5d8482(_0x35877e['error']['message']);}logger[_0x9b16('0x12')](_0x9b16('0xd'),_0x40509a,_0x35877e['error']['message']);return _0x588242(_0x35877e[_0x9b16('0x12')][_0x9b16('0x13')]);}else{logger[_0x9b16('0xc')](_0x9b16('0xd'),_0x40509a,_0x9b16('0xe'));_0x588242(_0x35877e[_0x9b16('0x14')][_0x9b16('0x13')]);}})[_0x9b16('0x15')](function(_0x7ed35a){logger[_0x9b16('0x12')](_0x9b16('0xd'),_0x40509a,_0x7ed35a);_0x5d8482(_0x7ed35a);});});}
\ No newline at end of file
+var _0xf94d=['ChatTransferReport,\x20%s,\x20%s','message','catch','lodash','util','moment','bluebird','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','client','http','request','info','request\x20sent','debug','ChatTransferReport,\x20%s,\x20%s,\x20%s','stringify','error','code'];(function(_0x37a3f3,_0x663b49){var _0x4da923=function(_0x47713f){while(--_0x47713f){_0x37a3f3['push'](_0x37a3f3['shift']());}};_0x4da923(++_0x663b49);}(_0xf94d,0x13e));var _0xdf94=function(_0x3bf780,_0x38917d){_0x3bf780=_0x3bf780-0x0;var _0x145df2=_0xf94d[_0x3bf780];return _0x145df2;};'use strict';var _=require(_0xdf94('0x0'));var util=require(_0xdf94('0x1'));var moment=require(_0xdf94('0x2'));var BPromise=require(_0xdf94('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0xdf94('0x4'))['db'];var utils=require(_0xdf94('0x5'));var logger=require(_0xdf94('0x6'))('rpc');var config=require(_0xdf94('0x7'));var jayson=require('jayson/promise');var client=jayson[_0xdf94('0x8')][_0xdf94('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x20921b,_0x3cea31,_0x4cd1cd){return new BPromise(function(_0x29f3aa,_0x5e9c5e){return client[_0xdf94('0xa')](_0x20921b,_0x4cd1cd)['then'](function(_0x1d1514){logger[_0xdf94('0xb')]('ChatTransferReport,\x20%s,\x20%s',_0x3cea31,_0xdf94('0xc'));logger[_0xdf94('0xd')](_0xdf94('0xe'),_0x3cea31,'request\x20sent',JSON[_0xdf94('0xf')](_0x1d1514));if(_0x1d1514[_0xdf94('0x10')]){if(_0x1d1514[_0xdf94('0x10')][_0xdf94('0x11')]===0x1f4){logger[_0xdf94('0x10')](_0xdf94('0x12'),_0x3cea31,_0x1d1514[_0xdf94('0x10')][_0xdf94('0x13')]);return _0x5e9c5e(_0x1d1514[_0xdf94('0x10')]['message']);}logger['error'](_0xdf94('0x12'),_0x3cea31,_0x1d1514['error'][_0xdf94('0x13')]);return _0x29f3aa(_0x1d1514[_0xdf94('0x10')][_0xdf94('0x13')]);}else{logger['info']('ChatTransferReport,\x20%s,\x20%s',_0x3cea31,_0xdf94('0xc'));_0x29f3aa(_0x1d1514['result']['message']);}})[_0xdf94('0x14')](function(_0x4b2b8f){logger[_0xdf94('0x10')](_0xdf94('0x12'),_0x3cea31,_0x4b2b8f);_0x5e9c5e(_0x4b2b8f);});});}
\ No newline at end of file
diff --git a/server/api/chatTransferReport/index.js b/server/api/chatTransferReport/index.js
index 72e72c3..2982049 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 _0xdc00=['index','get','describe','create','put','/:id','update','destroy','multer','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./chatTransferReport.controller','isAuthenticated'];(function(_0x5c2161,_0x5a1984){var _0x377c24=function(_0xe43a12){while(--_0xe43a12){_0x5c2161['push'](_0x5c2161['shift']());}};_0x377c24(++_0x5a1984);}(_0xdc00,0x1ca));var _0x0dc0=function(_0x46e017,_0x25e4a9){_0x46e017=_0x46e017-0x0;var _0x56f77d=_0xdc00[_0x46e017];return _0x56f77d;};'use strict';var multer=require(_0x0dc0('0x0'));var util=require('util');var path=require(_0x0dc0('0x1'));var timeout=require(_0x0dc0('0x2'));var express=require(_0x0dc0('0x3'));var router=express[_0x0dc0('0x4')]();var fs_extra=require(_0x0dc0('0x5'));var auth=require(_0x0dc0('0x6'));var interaction=require(_0x0dc0('0x7'));var config=require('../../config/environment');var controller=require(_0x0dc0('0x8'));router['get']('/',auth[_0x0dc0('0x9')](),controller[_0x0dc0('0xa')]);router[_0x0dc0('0xb')]('/describe',auth[_0x0dc0('0x9')](),controller[_0x0dc0('0xc')]);router[_0x0dc0('0xb')]('/:id',auth[_0x0dc0('0x9')](),controller['show']);router['post']('/',auth[_0x0dc0('0x9')](),controller[_0x0dc0('0xd')]);router[_0x0dc0('0xe')](_0x0dc0('0xf'),auth[_0x0dc0('0x9')](),controller[_0x0dc0('0x10')]);router['delete'](_0x0dc0('0xf'),auth[_0x0dc0('0x9')](),controller[_0x0dc0('0x11')]);module['exports']=router;
\ No newline at end of file
+var _0x95cc=['index','/:id','show','post','put','update','delete','destroy','exports','multer','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatTransferReport.controller','get','isAuthenticated'];(function(_0x5382bd,_0x386378){var _0x141d54=function(_0x5a6caa){while(--_0x5a6caa){_0x5382bd['push'](_0x5382bd['shift']());}};_0x141d54(++_0x386378);}(_0x95cc,0xc7));var _0xc95c=function(_0x29fcea,_0x257199){_0x29fcea=_0x29fcea-0x0;var _0x243673=_0x95cc[_0x29fcea];return _0x243673;};'use strict';var multer=require(_0xc95c('0x0'));var util=require('util');var path=require('path');var timeout=require('connect-timeout');var express=require(_0xc95c('0x1'));var router=express[_0xc95c('0x2')]();var fs_extra=require(_0xc95c('0x3'));var auth=require(_0xc95c('0x4'));var interaction=require(_0xc95c('0x5'));var config=require(_0xc95c('0x6'));var controller=require(_0xc95c('0x7'));router[_0xc95c('0x8')]('/',auth[_0xc95c('0x9')](),controller[_0xc95c('0xa')]);router[_0xc95c('0x8')]('/describe',auth[_0xc95c('0x9')](),controller['describe']);router[_0xc95c('0x8')](_0xc95c('0xb'),auth[_0xc95c('0x9')](),controller[_0xc95c('0xc')]);router[_0xc95c('0xd')]('/',auth[_0xc95c('0x9')](),controller['create']);router[_0xc95c('0xe')](_0xc95c('0xb'),auth[_0xc95c('0x9')](),controller[_0xc95c('0xf')]);router[_0xc95c('0x10')](_0xc95c('0xb'),auth[_0xc95c('0x9')](),controller[_0xc95c('0x11')]);module[_0xc95c('0x12')]=router;
\ No newline at end of file
diff --git a/server/api/chatWebsite/chatWebsite.attributes.js b/server/api/chatWebsite/chatWebsite.attributes.js
index 4f52a47..0022417 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 _0x7045=['TEXT','Do\x20you\x20want\x20to\x20close\x20the\x20interaction?','Form\x20properly\x20submitted','Form\x20submission\x20error','Note','Type\x20a\x20message','Thanks\x20you\x20for\x20your\x20time!','Feedback','star','thumb','input','name','text','getDataValue','onlineForm','parse','setDataValue','stringify','Comments','Leave\x20your\x20comments','offlineForm','All\x20of\x20our\x20agents\x20are\x20busy\x20at\x20this\x20time.\x20Your\x20chat\x20is\x20very\x20important\x20to\x20us.','Please\x20hold\x20and\x20we\x20will\x20answer\x20your\x20request\x20as\x20soon\x20as\x20possible.','New\x20offline\x20message\x20from\x20websiteName','You\x20received\x20a\x20new\x20offline\x20message\x20from\x20websiteName.\x20Here\x20you\x20can\x20find\x20the\x20details\x20of\x20the\x20request:','Skip','Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}','website_alias','CHAT','alternate','#fafafa','System','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','mandatoryDispositionPauseId','mandatoryDisposition','Meeting\x20generated\x20for\x20interaction\x20#{{interaction.id}}\x20by\x20{{agent.name}}','sequelize','randomstring','STRING','email','Agent','#011F6A','#ffffff','BOOLEAN','ENUM','squared','rounded','We\x20are\x20here!','Chat','Send','Contact\x20us','INTEGER','Powered\x20by\x20xCALLY'];(function(_0x2e0967,_0x3fd097){var _0x180b59=function(_0x1048f2){while(--_0x1048f2){_0x2e0967['push'](_0x2e0967['shift']());}};_0x180b59(++_0x3fd097);}(_0x7045,0x1cc));var _0x5704=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x7045[_0x3dd15e];return _0x231fd0;};'use strict';var Sequelize=require(_0x5704('0x0'));var rs=require(_0x5704('0x1'));module['exports']={'name':{'type':Sequelize[_0x5704('0x2')],'allowNull':![]},'address':{'type':Sequelize['STRING'],'allowNull':![],'unique':'address'},'description':{'type':Sequelize['STRING']},'mapKey':{'type':Sequelize[_0x5704('0x2')],'defaultValue':_0x5704('0x3')},'mapKeyOffline':{'type':Sequelize[_0x5704('0x2')],'defaultValue':'email'},'key':{'type':Sequelize[_0x5704('0x2')],'allowNull':![]},'agentAlias':{'type':Sequelize[_0x5704('0x2')],'defaultValue':_0x5704('0x4')},'customerAlias':{'type':Sequelize[_0x5704('0x2')],'defaultValue':'Me'},'color':{'type':Sequelize[_0x5704('0x2')],'allowNull':![],'defaultValue':_0x5704('0x5'),'validate':{'notEmpty':!![]}},'color_button':{'type':Sequelize[_0x5704('0x2')],'allowNull':![],'defaultValue':_0x5704('0x5'),'validate':{'notEmpty':!![]}},'textColor':{'type':Sequelize[_0x5704('0x2')],'allowNull':![],'defaultValue':_0x5704('0x6'),'validate':{'notEmpty':!![]}},'textButtonColor':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':'#ffffff','validate':{'notEmpty':!![]}},'fontSize':{'type':Sequelize['INTEGER'],'defaultValue':0xf},'remote':{'type':Sequelize[_0x5704('0x2')]},'animation':{'type':Sequelize[_0x5704('0x7')],'defaultValue':!![]},'header_shape':{'type':Sequelize[_0x5704('0x8')]('rounded',_0x5704('0x9')),'defaultValue':_0x5704('0xa')},'header_online':{'type':Sequelize['STRING'],'defaultValue':_0x5704('0xb')},'start_chat_button':{'type':Sequelize[_0x5704('0x2')],'defaultValue':_0x5704('0xc')},'offline_chat_button':{'type':Sequelize[_0x5704('0x2')],'defaultValue':_0x5704('0xd')},'header_offline':{'type':Sequelize[_0x5704('0x2')],'defaultValue':_0x5704('0xe')},'download_transcript':{'type':Sequelize[_0x5704('0x7')],'defaultValue':!![]},'timeout':{'type':Sequelize[_0x5704('0xf')],'defaultValue':0x0},'whiteLabel':{'type':Sequelize[_0x5704('0x2')],'defaultValue':_0x5704('0x10')},'defaultWhiteLabel':{'type':Sequelize[_0x5704('0x7')],'defaultValue':!![]},'sitepic':{'type':Sequelize[_0x5704('0x11')]},'closingQuestion':{'type':Sequelize[_0x5704('0x2')],'defaultValue':_0x5704('0x12')},'formSubmitSuccessMessage':{'type':Sequelize[_0x5704('0x2')],'defaultValue':_0x5704('0x13')},'formSubmitFailureMessage':{'type':Sequelize[_0x5704('0x2')],'defaultValue':_0x5704('0x14')},'noteTitle':{'type':Sequelize[_0x5704('0x2')],'defaultValue':_0x5704('0x15')},'placeholderMessage':{'type':Sequelize[_0x5704('0x2')],'defaultValue':_0x5704('0x16')},'closingMessage':{'type':Sequelize['STRING'],'defaultValue':_0x5704('0x17')},'closingMessageButton':{'type':Sequelize[_0x5704('0x2')],'defaultValue':_0x5704('0xd')},'skipMessageButton':{'type':Sequelize[_0x5704('0x2')],'defaultValue':'Skip'},'conditionAgreement':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'enableRating':{'type':Sequelize[_0x5704('0x7')],'defaultValue':![]},'enableFeedback':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'enableSendButton':{'type':Sequelize[_0x5704('0x7')],'defaultValue':![]},'feedbackTitle':{'type':Sequelize[_0x5704('0x2')],'defaultValue':_0x5704('0x18')},'ratingType':{'type':Sequelize[_0x5704('0x8')](_0x5704('0x19'),_0x5704('0x1a')),'defaultValue':'star'},'ratingStarsNumber':{'type':Sequelize[_0x5704('0xf')],'defaultValue':0x5},'onlineForm':{'type':Sequelize[_0x5704('0x11')],'defaultValue':function(){return JSON['stringify']({'items':[{'type':_0x5704('0x1b'),'variable':null,'config':{'placeholder':_0x5704('0x1c'),'type':_0x5704('0x1d'),'required':!![]},'props':{'title':_0x5704('0x1c'),'helpText':''}},{'type':'input','props':{'title':'email','helpText':''},'config':{'required':!![],'placeholder':_0x5704('0x3'),'type':_0x5704('0x3')},'variable':null}],'fromKey':0x1});},'get':function(){return this[_0x5704('0x1e')](_0x5704('0x1f'))?JSON[_0x5704('0x20')](this[_0x5704('0x1e')]('onlineForm')):{};},'set':function(_0x571e54){return this[_0x5704('0x21')]('onlineForm',JSON[_0x5704('0x22')](_0x571e54));}},'offlineForm':{'type':Sequelize['TEXT'],'defaultValue':function(){return JSON['stringify']({'items':[{'type':_0x5704('0x1b'),'props':{'title':_0x5704('0x3'),'helpText':''},'config':{'required':!![],'placeholder':_0x5704('0x3'),'type':_0x5704('0x3')},'variable':null},{'type':'textarea','config':{'placeholder':_0x5704('0x23')},'props':{'title':_0x5704('0x23'),'helpText':_0x5704('0x24')}}],'fromKey':0x0});},'get':function(){return this['getDataValue'](_0x5704('0x25'))?JSON[_0x5704('0x20')](this['getDataValue'](_0x5704('0x25'))):{};},'set':function(_0x51cce1){return this[_0x5704('0x21')]('offlineForm',JSON[_0x5704('0x22')](_0x51cce1));}},'token':{'type':Sequelize[_0x5704('0x2')],'defaultValue':function(){return rs['generate']();}},'autoclose':{'type':Sequelize[_0x5704('0x7')],'defaultValue':!![]},'enableCustomerWriting':{'type':Sequelize[_0x5704('0x7')],'defaultValue':![]},'forwardTranscript':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'forwardTranscriptMessage':{'type':Sequelize['STRING']},'forwardOffline':{'type':Sequelize[_0x5704('0x7')],'defaultValue':![]},'forwardOfflineAddress':{'type':Sequelize['STRING']},'waitingTitle':{'type':Sequelize['STRING'],'defaultValue':_0x5704('0x26')},'waitingMessage':{'type':Sequelize['STRING'],'defaultValue':_0x5704('0x27')},'offlineMessageSubject':{'type':Sequelize['STRING'],'defaultValue':_0x5704('0x28')},'offlineMessageBody':{'type':Sequelize[_0x5704('0x2')],'defaultValue':_0x5704('0x29')},'enableUnmanagedNote':{'type':Sequelize[_0x5704('0x7')],'defaultValue':!![]},'unmanagedMessage':{'type':Sequelize[_0x5704('0x2')],'defaultValue':'Your\x20request\x20has\x20not\x20been\x20processed.'},'skipUnmanaged':{'type':Sequelize[_0x5704('0x2')],'defaultValue':_0x5704('0x2a')},'sendUnmanaged':{'type':Sequelize[_0x5704('0x2')],'defaultValue':_0x5704('0xd')},'enableCustomerAttachment':{'type':Sequelize[_0x5704('0x7')],'defaultValue':![]},'enableCustomerCheckmarks':{'type':Sequelize[_0x5704('0x7')],'defaultValue':![]},'agentAvatar':{'type':Sequelize[_0x5704('0x11')]},'showAgentAvatar':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'timezone':{'type':Sequelize[_0x5704('0x2')]},'notificationTemplate':{'type':Sequelize[_0x5704('0x11')],'defaultValue':function(){return _0x5704('0x2b');}},'notificationSound':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'notificationShake':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'hideWhenOffline':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'agentIdentifier':{'type':Sequelize[_0x5704('0x2')],'defaultValue':_0x5704('0x2c')},'waitForTheAssignedAgent':{'type':Sequelize[_0x5704('0xf')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'waitForTheAssignedQueue':{'type':Sequelize[_0x5704('0xf')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'alignment':{'type':Sequelize[_0x5704('0x2')],'defaultValue':'bottom_right'},'verticalAlignment':{'type':Sequelize[_0x5704('0xf')],'defaultValue':0x1e},'labelText':{'type':Sequelize[_0x5704('0x2')],'defaultValue':_0x5704('0x2d')},'messagesAlignment':{'type':Sequelize[_0x5704('0x2')],'defaultValue':_0x5704('0x2e')},'defaultTitle':{'type':Sequelize[_0x5704('0x2')]},'customerAvatar':{'type':Sequelize[_0x5704('0x11')]},'showCustomerAvatar':{'type':Sequelize[_0x5704('0x7')],'defaultValue':![]},'messageFontSize':{'type':Sequelize[_0x5704('0xf')],'defaultValue':0xc},'backgroundColor':{'type':Sequelize[_0x5704('0x2')],'allowNull':![],'defaultValue':_0x5704('0x2f'),'validate':{'notEmpty':!![]}},'queueTransfer':{'type':Sequelize[_0x5704('0x7')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0x5704('0xf')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0x5704('0x7')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0x5704('0xf')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'systemAlias':{'type':Sequelize['STRING'],'defaultValue':_0x5704('0x30')},'systemAvatar':{'type':Sequelize[_0x5704('0x11')]},'mandatoryDispositionPauseId':{'type':Sequelize[_0x5704('0xf')],'comment':'Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled'},'mandatoryDisposition':{'type':Sequelize[_0x5704('0x7')],'defaultValue':![],'comment':_0x5704('0x31'),'set':function(_0x5e1fb0){if(!_0x5e1fb0)this[_0x5704('0x21')](_0x5704('0x32'),null);this[_0x5704('0x21')](_0x5704('0x33'),_0x5e1fb0);}},'vidaooEscalation':{'type':Sequelize[_0x5704('0x7')],'defaultValue':![]},'vidaooApiKey':{'type':Sequelize[_0x5704('0x2')]},'vidaooTopic':{'type':Sequelize[_0x5704('0x2')],'allowNull':![],'defaultValue':'Generated\x20by\x20XCALLY\x20Motion'},'vidaooNote':{'type':Sequelize[_0x5704('0x2')],'defaultValue':function(){return _0x5704('0x34');}},'vidaooMetadata':{'type':Sequelize['TEXT'],'defaultValue':null},'openNewInteraction':{'type':Sequelize['BOOLEAN'],'defaultValue':![],'allowNull':!![]},'subjectOffline':{'type':Sequelize[_0x5704('0x11')]}};
\ No newline at end of file
+var _0x280e=['All\x20of\x20our\x20agents\x20are\x20busy\x20at\x20this\x20time.\x20Your\x20chat\x20is\x20very\x20important\x20to\x20us.','New\x20offline\x20message\x20from\x20websiteName','Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}','bottom_right','CHAT','#fafafa','System','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','mandatoryDispositionPauseId','mandatoryDisposition','Meeting\x20generated\x20for\x20interaction\x20#{{interaction.id}}\x20by\x20{{agent.name}}','sequelize','randomstring','STRING','address','email','#011F6A','#ffffff','INTEGER','BOOLEAN','ENUM','rounded','squared','Chat','Send','Contact\x20us','Powered\x20by\x20xCALLY','TEXT','Do\x20you\x20want\x20to\x20close\x20the\x20interaction?','Form\x20properly\x20submitted','Type\x20a\x20message','Thanks\x20you\x20for\x20your\x20time!','Feedback','star','input','name','text','getDataValue','parse','onlineForm','setDataValue','stringify','Comments','offlineForm','generate'];(function(_0x4169ff,_0x546a37){var _0x4f8185=function(_0x346823){while(--_0x346823){_0x4169ff['push'](_0x4169ff['shift']());}};_0x4f8185(++_0x546a37);}(_0x280e,0xf2));var _0xe280=function(_0x1a8f86,_0x5ed9c4){_0x1a8f86=_0x1a8f86-0x0;var _0x20d876=_0x280e[_0x1a8f86];return _0x20d876;};'use strict';var Sequelize=require(_0xe280('0x0'));var rs=require(_0xe280('0x1'));module['exports']={'name':{'type':Sequelize[_0xe280('0x2')],'allowNull':![]},'address':{'type':Sequelize[_0xe280('0x2')],'allowNull':![],'unique':_0xe280('0x3')},'description':{'type':Sequelize[_0xe280('0x2')]},'mapKey':{'type':Sequelize[_0xe280('0x2')],'defaultValue':_0xe280('0x4')},'mapKeyOffline':{'type':Sequelize['STRING'],'defaultValue':_0xe280('0x4')},'key':{'type':Sequelize[_0xe280('0x2')],'allowNull':![]},'agentAlias':{'type':Sequelize['STRING'],'defaultValue':'Agent'},'customerAlias':{'type':Sequelize[_0xe280('0x2')],'defaultValue':'Me'},'color':{'type':Sequelize[_0xe280('0x2')],'allowNull':![],'defaultValue':_0xe280('0x5'),'validate':{'notEmpty':!![]}},'color_button':{'type':Sequelize[_0xe280('0x2')],'allowNull':![],'defaultValue':_0xe280('0x5'),'validate':{'notEmpty':!![]}},'textColor':{'type':Sequelize[_0xe280('0x2')],'allowNull':![],'defaultValue':_0xe280('0x6'),'validate':{'notEmpty':!![]}},'textButtonColor':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0xe280('0x6'),'validate':{'notEmpty':!![]}},'fontSize':{'type':Sequelize[_0xe280('0x7')],'defaultValue':0xf},'remote':{'type':Sequelize['STRING']},'animation':{'type':Sequelize[_0xe280('0x8')],'defaultValue':!![]},'header_shape':{'type':Sequelize[_0xe280('0x9')](_0xe280('0xa'),_0xe280('0xb')),'defaultValue':_0xe280('0xa')},'header_online':{'type':Sequelize[_0xe280('0x2')],'defaultValue':'We\x20are\x20here!'},'start_chat_button':{'type':Sequelize['STRING'],'defaultValue':_0xe280('0xc')},'offline_chat_button':{'type':Sequelize['STRING'],'defaultValue':_0xe280('0xd')},'header_offline':{'type':Sequelize[_0xe280('0x2')],'defaultValue':_0xe280('0xe')},'download_transcript':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'timeout':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'whiteLabel':{'type':Sequelize[_0xe280('0x2')],'defaultValue':_0xe280('0xf')},'defaultWhiteLabel':{'type':Sequelize[_0xe280('0x8')],'defaultValue':!![]},'sitepic':{'type':Sequelize[_0xe280('0x10')]},'closingQuestion':{'type':Sequelize[_0xe280('0x2')],'defaultValue':_0xe280('0x11')},'formSubmitSuccessMessage':{'type':Sequelize[_0xe280('0x2')],'defaultValue':_0xe280('0x12')},'formSubmitFailureMessage':{'type':Sequelize[_0xe280('0x2')],'defaultValue':'Form\x20submission\x20error'},'noteTitle':{'type':Sequelize['STRING'],'defaultValue':'Note'},'placeholderMessage':{'type':Sequelize[_0xe280('0x2')],'defaultValue':_0xe280('0x13')},'closingMessage':{'type':Sequelize['STRING'],'defaultValue':_0xe280('0x14')},'closingMessageButton':{'type':Sequelize[_0xe280('0x2')],'defaultValue':_0xe280('0xd')},'skipMessageButton':{'type':Sequelize['STRING'],'defaultValue':'Skip'},'conditionAgreement':{'type':Sequelize[_0xe280('0x8')],'defaultValue':![]},'enableRating':{'type':Sequelize[_0xe280('0x8')],'defaultValue':![]},'enableFeedback':{'type':Sequelize[_0xe280('0x8')],'defaultValue':![]},'enableSendButton':{'type':Sequelize[_0xe280('0x8')],'defaultValue':![]},'feedbackTitle':{'type':Sequelize[_0xe280('0x2')],'defaultValue':_0xe280('0x15')},'ratingType':{'type':Sequelize[_0xe280('0x9')]('star','thumb'),'defaultValue':_0xe280('0x16')},'ratingStarsNumber':{'type':Sequelize[_0xe280('0x7')],'defaultValue':0x5},'onlineForm':{'type':Sequelize[_0xe280('0x10')],'defaultValue':function(){return JSON['stringify']({'items':[{'type':_0xe280('0x17'),'variable':null,'config':{'placeholder':_0xe280('0x18'),'type':_0xe280('0x19'),'required':!![]},'props':{'title':_0xe280('0x18'),'helpText':''}},{'type':_0xe280('0x17'),'props':{'title':_0xe280('0x4'),'helpText':''},'config':{'required':!![],'placeholder':_0xe280('0x4'),'type':_0xe280('0x4')},'variable':null}],'fromKey':0x1});},'get':function(){return this[_0xe280('0x1a')]('onlineForm')?JSON[_0xe280('0x1b')](this[_0xe280('0x1a')](_0xe280('0x1c'))):{};},'set':function(_0xd4683f){return this[_0xe280('0x1d')](_0xe280('0x1c'),JSON[_0xe280('0x1e')](_0xd4683f));}},'offlineForm':{'type':Sequelize[_0xe280('0x10')],'defaultValue':function(){return JSON[_0xe280('0x1e')]({'items':[{'type':_0xe280('0x17'),'props':{'title':_0xe280('0x4'),'helpText':''},'config':{'required':!![],'placeholder':_0xe280('0x4'),'type':'email'},'variable':null},{'type':'textarea','config':{'placeholder':_0xe280('0x1f')},'props':{'title':_0xe280('0x1f'),'helpText':'Leave\x20your\x20comments'}}],'fromKey':0x0});},'get':function(){return this[_0xe280('0x1a')](_0xe280('0x20'))?JSON[_0xe280('0x1b')](this['getDataValue'](_0xe280('0x20'))):{};},'set':function(_0x5ab89b){return this[_0xe280('0x1d')]('offlineForm',JSON[_0xe280('0x1e')](_0x5ab89b));}},'token':{'type':Sequelize['STRING'],'defaultValue':function(){return rs[_0xe280('0x21')]();}},'autoclose':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'enableCustomerWriting':{'type':Sequelize[_0xe280('0x8')],'defaultValue':![]},'forwardTranscript':{'type':Sequelize[_0xe280('0x8')],'defaultValue':![]},'forwardTranscriptMessage':{'type':Sequelize['STRING']},'forwardOffline':{'type':Sequelize[_0xe280('0x8')],'defaultValue':![]},'forwardOfflineAddress':{'type':Sequelize[_0xe280('0x2')]},'waitingTitle':{'type':Sequelize['STRING'],'defaultValue':_0xe280('0x22')},'waitingMessage':{'type':Sequelize[_0xe280('0x2')],'defaultValue':'Please\x20hold\x20and\x20we\x20will\x20answer\x20your\x20request\x20as\x20soon\x20as\x20possible.'},'offlineMessageSubject':{'type':Sequelize[_0xe280('0x2')],'defaultValue':_0xe280('0x23')},'offlineMessageBody':{'type':Sequelize[_0xe280('0x2')],'defaultValue':'You\x20received\x20a\x20new\x20offline\x20message\x20from\x20websiteName.\x20Here\x20you\x20can\x20find\x20the\x20details\x20of\x20the\x20request:'},'enableUnmanagedNote':{'type':Sequelize[_0xe280('0x8')],'defaultValue':!![]},'unmanagedMessage':{'type':Sequelize[_0xe280('0x2')],'defaultValue':'Your\x20request\x20has\x20not\x20been\x20processed.'},'skipUnmanaged':{'type':Sequelize[_0xe280('0x2')],'defaultValue':'Skip'},'sendUnmanaged':{'type':Sequelize[_0xe280('0x2')],'defaultValue':_0xe280('0xd')},'enableCustomerAttachment':{'type':Sequelize[_0xe280('0x8')],'defaultValue':![]},'enableCustomerCheckmarks':{'type':Sequelize[_0xe280('0x8')],'defaultValue':![]},'agentAvatar':{'type':Sequelize[_0xe280('0x10')]},'showAgentAvatar':{'type':Sequelize[_0xe280('0x8')],'defaultValue':![]},'timezone':{'type':Sequelize[_0xe280('0x2')]},'notificationTemplate':{'type':Sequelize[_0xe280('0x10')],'defaultValue':function(){return _0xe280('0x24');}},'notificationSound':{'type':Sequelize[_0xe280('0x8')],'defaultValue':!![]},'notificationShake':{'type':Sequelize[_0xe280('0x8')],'defaultValue':![]},'hideWhenOffline':{'type':Sequelize[_0xe280('0x8')],'defaultValue':![]},'agentIdentifier':{'type':Sequelize[_0xe280('0x2')],'defaultValue':'website_alias'},'waitForTheAssignedAgent':{'type':Sequelize[_0xe280('0x7')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'waitForTheAssignedQueue':{'type':Sequelize[_0xe280('0x7')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'alignment':{'type':Sequelize[_0xe280('0x2')],'defaultValue':_0xe280('0x25')},'verticalAlignment':{'type':Sequelize['INTEGER'],'defaultValue':0x1e},'labelText':{'type':Sequelize[_0xe280('0x2')],'defaultValue':_0xe280('0x26')},'messagesAlignment':{'type':Sequelize[_0xe280('0x2')],'defaultValue':'alternate'},'defaultTitle':{'type':Sequelize[_0xe280('0x2')]},'customerAvatar':{'type':Sequelize[_0xe280('0x10')]},'showCustomerAvatar':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'messageFontSize':{'type':Sequelize[_0xe280('0x7')],'defaultValue':0xc},'backgroundColor':{'type':Sequelize[_0xe280('0x2')],'allowNull':![],'defaultValue':_0xe280('0x27'),'validate':{'notEmpty':!![]}},'queueTransfer':{'type':Sequelize[_0xe280('0x8')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0xe280('0x7')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0xe280('0x8')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0xe280('0x7')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'systemAlias':{'type':Sequelize[_0xe280('0x2')],'defaultValue':_0xe280('0x28')},'systemAvatar':{'type':Sequelize[_0xe280('0x10')]},'mandatoryDispositionPauseId':{'type':Sequelize['INTEGER'],'comment':_0xe280('0x29')},'mandatoryDisposition':{'type':Sequelize['BOOLEAN'],'defaultValue':![],'comment':_0xe280('0x2a'),'set':function(_0x2ff267){if(!_0x2ff267)this['setDataValue'](_0xe280('0x2b'),null);this[_0xe280('0x1d')](_0xe280('0x2c'),_0x2ff267);}},'vidaooEscalation':{'type':Sequelize[_0xe280('0x8')],'defaultValue':![]},'vidaooApiKey':{'type':Sequelize[_0xe280('0x2')]},'vidaooTopic':{'type':Sequelize[_0xe280('0x2')],'allowNull':![],'defaultValue':'Generated\x20by\x20XCALLY\x20Motion'},'vidaooNote':{'type':Sequelize['STRING'],'defaultValue':function(){return _0xe280('0x2d');}},'vidaooMetadata':{'type':Sequelize['TEXT'],'defaultValue':null},'openNewInteraction':{'type':Sequelize[_0xe280('0x8')],'defaultValue':![],'allowNull':!![]},'subjectOffline':{'type':Sequelize[_0xe280('0x10')]}};
\ No newline at end of file
diff --git a/server/api/chatWebsite/chatWebsite.controller.js b/server/api/chatWebsite/chatWebsite.controller.js
index a791a14..1cde8c5 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 _0x4e8a=['*,*,*,*','ChatMessage','User','UserId','unshift','agent','waitForTheAssignedAgent','forcedOwnership','queueId','ChatQueue','queue','startRouting','EventManager','offline','Sequelize','no\x20available\x20attributes','difference','from','ValidationError','from\x20is\x20mandatory','body\x20is\x20mandatory\x20and\x20not\x20empty','mapKeyOffline','mapKeyOffline\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','MailAccount','findOrCreate','spread','utf8','render','toPairs','offlineMessageBody','originalname','mimetype','server','files','attachments','basename','openNewInteraction','sequelize','MailServerOut','Smtp','CloudProvider','forwardOffline','getSmtpOptions','SendMail','sendMail','\x22%s\x22\x20<%s>','email','forwardOfflineAddress','offlineMessageSubject','MailAccountId','subjectOffline','toPairsIn','mapValues','Chat','NotifyMailAccount','notifyMail','offline-chat','remove','Could\x20not\x20remove\x20attachment\x20file','addInteraction','getInteractions','Contact','Owner','fullname','internal','Tags','color','tag','getSnippet','getProactiveActions','virtual','custom','increment','chatLicenseExceeded','server/files/chat/iframe.ejs','3.9.0','headers','replace','testWebsiteWithWildcard','remote','x-real-ip','connection','verticalAlignment','labelText','textColor','textButtonColor','color_button','backgroundColor','hideWhenOffline','IntervalId','addApplications','transaction','Transaction','ISOLATION_LEVELS','READ_COMMITTED','ChatApplication','bulkCreate','findAndCountAll','finally','getApplications','chatProactiveAction','addProactiveActions','ChatProactiveAction','getFields','online','false','offlineForm','onlineForm','items','fromKey','getOfflineMessages','ChatOfflineMessage','Attachment','Attachments','addAgents','omit','emit','userChatWebsite:save','removeAgents','userChatWebsite:remove','getAgents','mustache','util','path','ejs','fs-extra','lodash','querystring','ioredis','jayson/promise','../../components/parsers/qs','api','../../config/environment','../../errors/api','APIBadRequestError','APINotFoundError','handleError','APIConflictError','URL','redis','localhost','socket.io-emitter','./chatWebsite.socket','register','client','http','request','info','ChatWebsite,\x20%s,\x20%s','request\x20sent','debug','ChatWebsite,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','sendStatus','end','offset','undefined','limit','count','status','Content-Range','update','then','get','ChatWebsites','UserProfileResource','stack','name','send','user-agent-parser','user-agent','cf-connecting-ip','x-forwarded-for','first','firstName','x-real-port','referer','browser','version','%s\x20%s','unknown','format','%s\x20%s\x20%s','device','model','vendor','type','stringify','Pause','map','ChatWebsite','fieldName','key','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','filter','merge','options','where','includeAll','include','findAll','rows','show','params','mandatoryDispositionPause','rawAttributes','find','create','body','address','\x22\x20is\x20not\x20a\x20valid\x20website\x20domain','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','testWildcardValidity','describe','ChatWebsiteId','Disposition','getDispositions','removeDispositions','CannedAnswer','getAnswers','findOne','pick','removeAnswers','ids','addLogo','sitepic','file','filename','agentAvatar','addCustomerAvatar','customerAvatar','systemAvatar','getLogo','root','server/files/images/logos/default_logo.svg','../../config/license/util','getLicense','isNil','join','server/files/images/logos/','download','server/files/images/avatars/default_avatar.png','existsSync','server/files/images/avatars/','server/files/images/avatars/system_avatar.png','Interval','resolve','timezone','ifTime','notify','chat','MapKey\x20is\x20mandatory','isEmpty','Body\x20is\x20mandatory','customerIp','createdAt','updatedAt','CompanyId','includes','mapKey','Invalid\x20MapKey\x20parameter.\x20Allowed\x20values:\x20','CmList','List','CmContact','Contacts','DESC','Applications','interval','Chat\x20Website\x20with\x20id\x20%s\x20not\x20found','account','applications','orderBy','priority','list','ListId','defaults','contact','threadId','closed','ChatInteraction','externalUrl','ContactId','interaction','Writing\x20on\x20closed\x20interaction','lastName','messageId','created','push','close','unmanaged'];(function(_0x2d88d5,_0x166b23){var _0x13edaa=function(_0xa8dfb1){while(--_0xa8dfb1){_0x2d88d5['push'](_0x2d88d5['shift']());}};_0x13edaa(++_0x166b23);}(_0x4e8a,0x1ae));var _0xa4e8=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x4e8a[_0x3dd15e];return _0x231fd0;};'use strict';var Mustache=require(_0xa4e8('0x0'));var util=require(_0xa4e8('0x1'));var path=require(_0xa4e8('0x2'));var ejs=require(_0xa4e8('0x3'));var fs=require('fs');var fs_extra=require(_0xa4e8('0x4'));var _=require(_0xa4e8('0x5'));var querystring=require(_0xa4e8('0x6'));var htmlToText=require('html-to-text');var Redis=require(_0xa4e8('0x7'));var jayson=require(_0xa4e8('0x8'));var qs=require(_0xa4e8('0x9'));var logger=require('../../config/logger')(_0xa4e8('0xa'));var config=require(_0xa4e8('0xb'));var APIBadRequestError=require(_0xa4e8('0xc'))[_0xa4e8('0xd')];var APINotFoundError=require('../../errors/api')[_0xa4e8('0xe')];var APIOutOfIntervalError=require('../../errors/api')['APIOutOfIntervalError'];var APIHandleError=require('../../errors/api')[_0xa4e8('0xf')];var APIConflictError=require(_0xa4e8('0xc'))[_0xa4e8('0x10')];var wildcardUtils=require('./helpers/wildcard-expressions');var URL=require('url')[_0xa4e8('0x11')];var db=require('../../mysqldb')['db'];config['redis']=_['defaults'](config[_0xa4e8('0x12')],{'host':_0xa4e8('0x13'),'port':0x18eb});var socket=require(_0xa4e8('0x14'))(new Redis(config['redis']));require(_0xa4e8('0x15'))[_0xa4e8('0x16')](socket);var client=jayson[_0xa4e8('0x17')][_0xa4e8('0x18')]({'port':0x232c});var client9002=jayson['client'][_0xa4e8('0x18')]({'port':0x232a});var client9003=jayson['client'][_0xa4e8('0x18')]({'port':0x232b});var client9001=jayson[_0xa4e8('0x17')][_0xa4e8('0x18')]({'port':0x2329});function respondWithRpcPromise(_0xafc910,_0x4e6467,_0x5b9c52,_0x37bbc8){return new Promise(function(_0x5c16b0,_0x43b6ce){var _0x158767=_0x37bbc8||client;return _0x158767[_0xa4e8('0x19')](_0xafc910,_0x5b9c52)['then'](function(_0xb85874){logger[_0xa4e8('0x1a')](_0xa4e8('0x1b'),_0x4e6467,_0xa4e8('0x1c'));logger[_0xa4e8('0x1d')](_0xa4e8('0x1e'),_0x4e6467,_0xa4e8('0x1c'),JSON['stringify'](_0xb85874));if(_0xb85874['error']){if(_0xb85874[_0xa4e8('0x1f')][_0xa4e8('0x20')]===0x1f4){logger['error'](_0xa4e8('0x1b'),_0x4e6467,_0xb85874['error'][_0xa4e8('0x21')]);return _0x43b6ce(_0xb85874[_0xa4e8('0x1f')][_0xa4e8('0x21')]);}logger[_0xa4e8('0x1f')]('ChatWebsite,\x20%s,\x20%s',_0x4e6467,_0xb85874[_0xa4e8('0x1f')][_0xa4e8('0x21')]);return _0x5c16b0(_0xb85874[_0xa4e8('0x1f')][_0xa4e8('0x21')]);}else{logger[_0xa4e8('0x1a')](_0xa4e8('0x1b'),_0x4e6467,_0xa4e8('0x1c'));_0x5c16b0(_0xb85874[_0xa4e8('0x22')]['message']);}})[_0xa4e8('0x23')](function(_0x5578fb){logger['error'](_0xa4e8('0x1b'),_0x4e6467,_0x5578fb);_0x43b6ce(_0x5578fb);});});}function respondWithStatusCode(_0x138bd1,_0x27d06b){_0x27d06b=_0x27d06b||0xcc;return function(_0x325e42){if(_0x325e42){return _0x138bd1[_0xa4e8('0x24')](_0x27d06b);}return _0x138bd1['status'](_0x27d06b)[_0xa4e8('0x25')]();};}function respondWithResult(_0x1bad49,_0x2cc633){_0x2cc633=_0x2cc633||0xc8;return function(_0x99a877){if(_0x99a877){return _0x1bad49['status'](_0x2cc633)['json'](_0x99a877);}};}function respondWithFilteredResult(_0x833308,_0x231702){return function(_0x38488a){if(_0x38488a){var _0x1599e7=typeof _0x231702[_0xa4e8('0x26')]===_0xa4e8('0x27')&&typeof _0x231702[_0xa4e8('0x28')]==='undefined';var _0x40051f=_0x38488a[_0xa4e8('0x29')];var _0x44bc23=_0x1599e7?0x0:_0x231702[_0xa4e8('0x26')];var _0x60faed=_0x1599e7?_0x38488a[_0xa4e8('0x29')]:_0x231702[_0xa4e8('0x26')]+_0x231702[_0xa4e8('0x28')];var _0x2344ce;if(_0x60faed>=_0x40051f){_0x60faed=_0x40051f;_0x2344ce=0xc8;}else{_0x2344ce=0xce;}_0x833308[_0xa4e8('0x2a')](_0x2344ce);return _0x833308['set'](_0xa4e8('0x2b'),_0x44bc23+'-'+_0x60faed+'/'+_0x40051f)['json'](_0x38488a);}return null;};}function saveUpdates(_0x1455e1){return function(_0x3ec8d5){if(_0x3ec8d5){return _0x3ec8d5[_0xa4e8('0x2c')](_0x1455e1)['then'](function(_0x488156){return _0x488156;});}return null;};}function removeEntity(_0x190021){return function(_0x19928a){if(_0x19928a){return _0x19928a['destroy']()[_0xa4e8('0x2d')](function(){var _0x5a0205=_0x19928a[_0xa4e8('0x2e')]({'plain':!![]});var _0x136270=_0xa4e8('0x2f');return db[_0xa4e8('0x30')]['destroy']({'where':{'type':_0x136270,'resourceId':_0x5a0205['id']}})[_0xa4e8('0x2d')](function(){return _0x19928a;});})[_0xa4e8('0x2d')](function(){_0x190021[_0xa4e8('0x2a')](0xcc)[_0xa4e8('0x25')]();});}};}function handleEntityNotFound(_0x4875fe){return function(_0xe90ff){if(!_0xe90ff){_0x4875fe[_0xa4e8('0x24')](0x194);}return _0xe90ff;};}function handleError(_0x54d7a7,_0x270e6d){_0x270e6d=_0x270e6d||0x1f4;return function(_0x2ea4d6){logger[_0xa4e8('0x1f')](_0x2ea4d6[_0xa4e8('0x31')]);if(_0x2ea4d6['name']){delete _0x2ea4d6[_0xa4e8('0x32')];}_0x54d7a7[_0xa4e8('0x2a')](_0x270e6d)[_0xa4e8('0x33')](_0x2ea4d6);};}function createInteractionObject(_0x4e4e9e,_0x45daad,_0x9c7991,_0x2e4f01){var _0x2287bd=require(_0xa4e8('0x34'));var _0x2ff0a9=new _0x2287bd();var _0x19b200=_0x2ff0a9['setUA'](_0x9c7991[_0xa4e8('0x35')])['getResult']();var _0x596898=_0x45daad['customerIp'];if(_0x9c7991['cf-connecting-ip']){_0x596898=_0x9c7991[_0xa4e8('0x36')];}else if(_0x9c7991[_0xa4e8('0x37')]){_0x596898=_[_0xa4e8('0x38')](_0x9c7991[_0xa4e8('0x37')]['split'](','));}return{'ContactId':_0x2e4f01['id'],'ChatWebsiteId':_0x4e4e9e,'from':(_0x2e4f01[_0xa4e8('0x39')]||'')+'\x20'+(_0x2e4f01['lastName']||''),'customerIp':_0x596898,'customerPort':_0x9c7991[_0xa4e8('0x3a')]?_0x9c7991[_0xa4e8('0x3a')]:null,'referer':_0x45daad[_0xa4e8('0x3b')],'browserName':_0x19b200[_0xa4e8('0x3c')][_0xa4e8('0x32')]&&_0x19b200[_0xa4e8('0x3c')][_0xa4e8('0x3d')]?util['format'](_0xa4e8('0x3e'),_0x19b200[_0xa4e8('0x3c')][_0xa4e8('0x32')],_0x19b200['browser'][_0xa4e8('0x3d')]):_0xa4e8('0x3f'),'browserVersion':_0x19b200[_0xa4e8('0x3c')][_0xa4e8('0x3d')]||_0xa4e8('0x3f'),'osName':util[_0xa4e8('0x40')](_0xa4e8('0x3e'),_0x19b200['os']['name'],_0x19b200['os'][_0xa4e8('0x3d')]),'osVersion':_0x19b200['os']['version'],'deviceModel':_0x19b200['device']['model']&&_0x19b200['device']['vendor']?util['format'](_0xa4e8('0x41'),_0x19b200[_0xa4e8('0x42')][_0xa4e8('0x43')],_0x19b200[_0xa4e8('0x42')][_0xa4e8('0x44')],_0x19b200[_0xa4e8('0x42')][_0xa4e8('0x45')]):null,'deviceVendor':_0x19b200[_0xa4e8('0x42')][_0xa4e8('0x44')],'deviceType':_0x19b200[_0xa4e8('0x42')][_0xa4e8('0x45')],'formData':JSON[_0xa4e8('0x46')](_0x45daad)};}exports['index']=function(_0x25da92,_0x59f528){var _0x32f10a={'include':[{'model':db[_0xa4e8('0x47')],'as':'mandatoryDispositionPause'}]},_0x51e858={},_0x2a8883={'count':0x0,'rows':[]};var _0x5f0f07=_[_0xa4e8('0x48')](db[_0xa4e8('0x49')]['rawAttributes'],function(_0x1c0cf6){return{'name':_0x1c0cf6[_0xa4e8('0x4a')],'type':_0x1c0cf6[_0xa4e8('0x45')][_0xa4e8('0x4b')]};});_0x51e858['model']=_[_0xa4e8('0x48')](_0x5f0f07,_0xa4e8('0x32'));_0x51e858[_0xa4e8('0x4c')]=_[_0xa4e8('0x4d')](_0x25da92[_0xa4e8('0x4c')]);_0x51e858[_0xa4e8('0x4e')]=_[_0xa4e8('0x4f')](_0x51e858[_0xa4e8('0x43')],_0x51e858[_0xa4e8('0x4c')]);_0x32f10a[_0xa4e8('0x50')]=_[_0xa4e8('0x4f')](_0x51e858[_0xa4e8('0x43')],qs[_0xa4e8('0x51')](_0x25da92[_0xa4e8('0x4c')][_0xa4e8('0x51')]));_0x32f10a[_0xa4e8('0x50')]=_0x32f10a[_0xa4e8('0x50')][_0xa4e8('0x52')]?_0x32f10a[_0xa4e8('0x50')]:_0x51e858[_0xa4e8('0x43')];if(!_0x25da92[_0xa4e8('0x4c')][_0xa4e8('0x53')](_0xa4e8('0x54'))){_0x32f10a[_0xa4e8('0x28')]=qs['limit'](_0x25da92[_0xa4e8('0x4c')]['limit']);_0x32f10a[_0xa4e8('0x26')]=qs[_0xa4e8('0x26')](_0x25da92[_0xa4e8('0x4c')]['offset']);}_0x32f10a[_0xa4e8('0x55')]=qs[_0xa4e8('0x56')](_0x25da92[_0xa4e8('0x4c')][_0xa4e8('0x56')]);_0x32f10a['where']=qs['filters'](_['pick'](_0x25da92[_0xa4e8('0x4c')],_0x51e858[_0xa4e8('0x4e')]),_0x5f0f07);if(_0x25da92[_0xa4e8('0x4c')]['filter']){_0x32f10a['where']=_['merge'](_0x32f10a['where'],{'$or':_['map'](_0x5f0f07,function(_0x4a1c35){if(_0x4a1c35['type']!=='VIRTUAL'){var _0x5fa13b={};_0x5fa13b[_0x4a1c35[_0xa4e8('0x32')]]={'$like':'%'+_0x25da92[_0xa4e8('0x4c')][_0xa4e8('0x57')]+'%'};return _0x5fa13b;}})});}_0x32f10a=_[_0xa4e8('0x58')]({},_0x32f10a,_0x25da92[_0xa4e8('0x59')]);var _0x16aaac={'where':_0x32f10a[_0xa4e8('0x5a')]};return db[_0xa4e8('0x49')][_0xa4e8('0x29')](_0x16aaac)['then'](function(_0x5be81f){_0x2a8883[_0xa4e8('0x29')]=_0x5be81f;if(_0x25da92[_0xa4e8('0x4c')][_0xa4e8('0x5b')]){_0x32f10a[_0xa4e8('0x5c')]=[{'all':!![]}];}return db[_0xa4e8('0x49')][_0xa4e8('0x5d')](_0x32f10a);})[_0xa4e8('0x2d')](function(_0x3cbde6){_0x2a8883[_0xa4e8('0x5e')]=_0x3cbde6;return _0x2a8883;})[_0xa4e8('0x2d')](respondWithFilteredResult(_0x59f528,_0x32f10a))['catch'](handleError(_0x59f528,null));};exports[_0xa4e8('0x5f')]=function(_0x56e1b2,_0x54e17b){var _0x5df81a={'raw':![],'where':{'id':_0x56e1b2[_0xa4e8('0x60')]['id']},'include':[{'model':db[_0xa4e8('0x47')],'as':_0xa4e8('0x61')}]},_0x592acc={};_0x592acc[_0xa4e8('0x43')]=_['keys'](db[_0xa4e8('0x49')][_0xa4e8('0x62')]);_0x592acc[_0xa4e8('0x4c')]=_[_0xa4e8('0x4d')](_0x56e1b2[_0xa4e8('0x4c')]);_0x592acc[_0xa4e8('0x4e')]=_[_0xa4e8('0x4f')](_0x592acc[_0xa4e8('0x43')],_0x592acc[_0xa4e8('0x4c')]);_0x5df81a[_0xa4e8('0x50')]=_[_0xa4e8('0x4f')](_0x592acc['model'],qs['fields'](_0x56e1b2['query'][_0xa4e8('0x51')]));_0x5df81a[_0xa4e8('0x50')]=_0x5df81a[_0xa4e8('0x50')][_0xa4e8('0x52')]?_0x5df81a[_0xa4e8('0x50')]:_0x592acc[_0xa4e8('0x43')];if(_0x56e1b2[_0xa4e8('0x4c')][_0xa4e8('0x5b')]){_0x5df81a[_0xa4e8('0x5c')]=[{'all':!![]}];}_0x5df81a=_['merge']({},_0x5df81a,_0x56e1b2[_0xa4e8('0x59')]);return db[_0xa4e8('0x49')][_0xa4e8('0x63')](_0x5df81a)[_0xa4e8('0x2d')](handleEntityNotFound(_0x54e17b,null))[_0xa4e8('0x2d')](respondWithResult(_0x54e17b,null))[_0xa4e8('0x23')](handleError(_0x54e17b,null));};exports[_0xa4e8('0x64')]=function(_0x1e49c7,_0x105f18){if(!wildcardUtils['testWildcardValidity'](_0x1e49c7[_0xa4e8('0x65')][_0xa4e8('0x66')])){return handleError(_0x105f18,null)(new APIBadRequestError('\x22'+_0x1e49c7[_0xa4e8('0x65')][_0xa4e8('0x66')]+_0xa4e8('0x67')));}return db['ChatWebsite'][_0xa4e8('0x64')](_0x1e49c7['body'],{})['then'](function(_0x323d2c){var _0x5ab10f=_0x1e49c7[_0xa4e8('0x68')][_0xa4e8('0x2e')]({'plain':!![]});if(!_0x5ab10f)throw new Error(_0xa4e8('0x69'));if(_0x5ab10f[_0xa4e8('0x6a')]===_0xa4e8('0x68')){var _0x1a71b5=_0x323d2c[_0xa4e8('0x2e')]({'plain':!![]});var _0x3f22f8='ChatWebsites';return db[_0xa4e8('0x6b')][_0xa4e8('0x63')]({'where':{'name':_0x3f22f8,'userProfileId':_0x5ab10f[_0xa4e8('0x6c')]},'raw':!![]})['then'](function(_0x1dd8fa){if(_0x1dd8fa&&_0x1dd8fa['autoAssociation']===0x0){return db[_0xa4e8('0x30')][_0xa4e8('0x64')]({'name':_0x1a71b5[_0xa4e8('0x32')],'resourceId':_0x1a71b5['id'],'type':_0x1dd8fa[_0xa4e8('0x32')],'sectionId':_0x1dd8fa['id']},{})[_0xa4e8('0x2d')](function(){return _0x323d2c;});}else{return _0x323d2c;}})[_0xa4e8('0x23')](function(_0x13fe49){logger[_0xa4e8('0x1f')](_0xa4e8('0x6d'),_0x13fe49);throw _0x13fe49;});}return _0x323d2c;})[_0xa4e8('0x2d')](respondWithResult(_0x105f18,0xc9))[_0xa4e8('0x23')](handleError(_0x105f18,null));};exports['update']=function(_0x11f3b3,_0x1889b4){if(!wildcardUtils[_0xa4e8('0x6e')](_0x11f3b3[_0xa4e8('0x65')]['address'])){return handleError(_0x1889b4,null)(new APIBadRequestError('\x22'+_0x11f3b3[_0xa4e8('0x65')]['address']+_0xa4e8('0x67')));}if(_0x11f3b3[_0xa4e8('0x65')]['id']){delete _0x11f3b3[_0xa4e8('0x65')]['id'];}return db[_0xa4e8('0x49')][_0xa4e8('0x63')]({'where':{'id':_0x11f3b3['params']['id']},'include':[{'model':db[_0xa4e8('0x47')],'as':_0xa4e8('0x61')}]})[_0xa4e8('0x2d')](handleEntityNotFound(_0x1889b4,null))[_0xa4e8('0x2d')](saveUpdates(_0x11f3b3[_0xa4e8('0x65')],null))[_0xa4e8('0x2d')](respondWithResult(_0x1889b4,null))['catch'](handleError(_0x1889b4,null));};exports['destroy']=function(_0x15ac38,_0x2e4c91){return db[_0xa4e8('0x49')][_0xa4e8('0x63')]({'where':{'id':_0x15ac38[_0xa4e8('0x60')]['id']}})[_0xa4e8('0x2d')](handleEntityNotFound(_0x2e4c91,null))[_0xa4e8('0x2d')](removeEntity(_0x2e4c91,null))[_0xa4e8('0x23')](handleError(_0x2e4c91,null));};exports[_0xa4e8('0x6f')]=function(_0x268245,_0x539034){return db[_0xa4e8('0x49')][_0xa4e8('0x6f')]()[_0xa4e8('0x2d')](respondWithResult(_0x539034,null))[_0xa4e8('0x23')](handleError(_0x539034,null));};exports['addDisposition']=function(_0x41e6ff,_0x53998d){if(_0x41e6ff[_0xa4e8('0x65')]['id']){delete _0x41e6ff[_0xa4e8('0x65')]['id'];}return db['ChatWebsite'][_0xa4e8('0x63')]({'where':{'id':_0x41e6ff['params']['id']}})[_0xa4e8('0x2d')](handleEntityNotFound(_0x53998d,null))[_0xa4e8('0x2d')](function(_0x5a20b7){if(_0x5a20b7){_0x41e6ff[_0xa4e8('0x65')][_0xa4e8('0x70')]=_0x5a20b7['id'];return db[_0xa4e8('0x71')]['create'](_0x41e6ff[_0xa4e8('0x65')]);}})[_0xa4e8('0x2d')](respondWithResult(_0x53998d,null))['catch'](handleError(_0x53998d,null));};exports[_0xa4e8('0x72')]=function(_0x2ff27a,_0x4234b1){var _0x548c79={'raw':![],'where':{}};var _0x1fb98c={};var _0x2c70c7={'count':0x0,'rows':[]};return db[_0xa4e8('0x49')]['findOne']({'where':{'id':_0x2ff27a[_0xa4e8('0x60')]['id']}})[_0xa4e8('0x2d')](handleEntityNotFound(_0x4234b1,null))[_0xa4e8('0x2d')](function(_0xb907dc){if(_0xb907dc){_0x1fb98c[_0xa4e8('0x43')]=_[_0xa4e8('0x4d')](db[_0xa4e8('0x71')][_0xa4e8('0x62')]);_0x1fb98c[_0xa4e8('0x4c')]=_['keys'](_0x2ff27a[_0xa4e8('0x4c')]);_0x1fb98c['filters']=_[_0xa4e8('0x4f')](_0x1fb98c[_0xa4e8('0x43')],_0x1fb98c['query']);_0x548c79[_0xa4e8('0x50')]=_[_0xa4e8('0x4f')](_0x1fb98c['model'],qs[_0xa4e8('0x51')](_0x2ff27a['query'][_0xa4e8('0x51')]));_0x548c79['attributes']=_0x548c79[_0xa4e8('0x50')][_0xa4e8('0x52')]?_0x548c79[_0xa4e8('0x50')]:_0x1fb98c[_0xa4e8('0x43')];if(!_0x2ff27a[_0xa4e8('0x4c')][_0xa4e8('0x53')](_0xa4e8('0x54'))){_0x548c79['limit']=qs[_0xa4e8('0x28')](_0x2ff27a[_0xa4e8('0x4c')][_0xa4e8('0x28')]);_0x548c79[_0xa4e8('0x26')]=qs[_0xa4e8('0x26')](_0x2ff27a[_0xa4e8('0x4c')][_0xa4e8('0x26')]);}_0x548c79[_0xa4e8('0x55')]=qs['sort'](_0x2ff27a[_0xa4e8('0x4c')][_0xa4e8('0x56')]);_0x548c79[_0xa4e8('0x5a')]=qs[_0xa4e8('0x4e')](_['pick'](_0x2ff27a[_0xa4e8('0x4c')],_0x1fb98c[_0xa4e8('0x4e')]));_0x548c79[_0xa4e8('0x5a')]['ChatWebsiteId']=_0xb907dc['id'];if(_0x2ff27a['query'][_0xa4e8('0x57')]){_0x548c79['where']=_[_0xa4e8('0x58')](_0x548c79[_0xa4e8('0x5a')],{'$or':_[_0xa4e8('0x48')](_0x548c79['attributes'],function(_0x3c44a4){var _0x23c4a7={};_0x23c4a7[_0x3c44a4]={'$like':'%'+_0x2ff27a[_0xa4e8('0x4c')][_0xa4e8('0x57')]+'%'};return _0x23c4a7;})});}_0x548c79=_[_0xa4e8('0x58')]({},_0x548c79,_0x2ff27a[_0xa4e8('0x59')]);return db[_0xa4e8('0x71')][_0xa4e8('0x29')]({'where':_0x548c79['where']})[_0xa4e8('0x2d')](function(_0x3b73c6){_0x2c70c7['count']=_0x3b73c6;if(_0x2ff27a['query'][_0xa4e8('0x5b')]){_0x548c79['include']=[{'all':!![]}];}return db['Disposition'][_0xa4e8('0x5d')](_0x548c79);})['then'](function(_0x1986bf){_0x2c70c7[_0xa4e8('0x5e')]=_0x1986bf;return _0x2c70c7;});}})[_0xa4e8('0x2d')](respondWithFilteredResult(_0x4234b1,_0x548c79))[_0xa4e8('0x23')](handleError(_0x4234b1,null));};exports[_0xa4e8('0x73')]=function(_0x14c978,_0x2045e3){return db[_0xa4e8('0x49')][_0xa4e8('0x63')]({'where':{'id':_0x14c978[_0xa4e8('0x60')]['id']}})['then'](handleEntityNotFound(_0x2045e3,null))['then'](function(_0x40ce27){if(_0x40ce27){return _0x40ce27['removeDispositions'](_0x14c978[_0xa4e8('0x4c')]['ids']);}})[_0xa4e8('0x2d')](respondWithStatusCode(_0x2045e3,null))[_0xa4e8('0x23')](handleError(_0x2045e3,null));};exports['addAnswer']=function(_0x5d6e60,_0x5c6872){if(_0x5d6e60['body']['id']){delete _0x5d6e60[_0xa4e8('0x65')]['id'];}return db['ChatWebsite'][_0xa4e8('0x63')]({'where':{'id':_0x5d6e60[_0xa4e8('0x60')]['id']}})[_0xa4e8('0x2d')](handleEntityNotFound(_0x5c6872,null))['then'](function(_0x19b7a5){if(_0x19b7a5){_0x5d6e60[_0xa4e8('0x65')][_0xa4e8('0x70')]=_0x19b7a5['id'];return db[_0xa4e8('0x74')][_0xa4e8('0x64')](_0x5d6e60[_0xa4e8('0x65')]);}})[_0xa4e8('0x2d')](respondWithResult(_0x5c6872,null))[_0xa4e8('0x23')](handleError(_0x5c6872,null));};exports[_0xa4e8('0x75')]=function(_0xde6dc5,_0x4b7f73){var _0x5d56aa={'raw':![],'where':{}};var _0x5621f5={};var _0x52f377={'count':0x0,'rows':[]};return db['ChatWebsite'][_0xa4e8('0x76')]({'where':{'id':_0xde6dc5[_0xa4e8('0x60')]['id']}})[_0xa4e8('0x2d')](handleEntityNotFound(_0x4b7f73,null))['then'](function(_0x410cb9){if(_0x410cb9){_0x5621f5[_0xa4e8('0x43')]=_['keys'](db[_0xa4e8('0x74')][_0xa4e8('0x62')]);_0x5621f5[_0xa4e8('0x4c')]=_[_0xa4e8('0x4d')](_0xde6dc5['query']);_0x5621f5[_0xa4e8('0x4e')]=_[_0xa4e8('0x4f')](_0x5621f5['model'],_0x5621f5[_0xa4e8('0x4c')]);_0x5d56aa[_0xa4e8('0x50')]=_[_0xa4e8('0x4f')](_0x5621f5['model'],qs[_0xa4e8('0x51')](_0xde6dc5['query'][_0xa4e8('0x51')]));_0x5d56aa[_0xa4e8('0x50')]=_0x5d56aa[_0xa4e8('0x50')][_0xa4e8('0x52')]?_0x5d56aa[_0xa4e8('0x50')]:_0x5621f5['model'];if(!_0xde6dc5[_0xa4e8('0x4c')][_0xa4e8('0x53')](_0xa4e8('0x54'))){_0x5d56aa['limit']=qs['limit'](_0xde6dc5['query'][_0xa4e8('0x28')]);_0x5d56aa['offset']=qs['offset'](_0xde6dc5[_0xa4e8('0x4c')][_0xa4e8('0x26')]);}_0x5d56aa['order']=qs[_0xa4e8('0x56')](_0xde6dc5['query'][_0xa4e8('0x56')]);_0x5d56aa['where']=qs[_0xa4e8('0x4e')](_[_0xa4e8('0x77')](_0xde6dc5[_0xa4e8('0x4c')],_0x5621f5[_0xa4e8('0x4e')]));_0x5d56aa[_0xa4e8('0x5a')]['ChatWebsiteId']=_0x410cb9['id'];if(_0xde6dc5['query'][_0xa4e8('0x57')]){_0x5d56aa[_0xa4e8('0x5a')]=_[_0xa4e8('0x58')](_0x5d56aa[_0xa4e8('0x5a')],{'$or':_[_0xa4e8('0x48')](_0x5d56aa[_0xa4e8('0x50')],function(_0x159166){var _0x5ee72b={};_0x5ee72b[_0x159166]={'$like':'%'+_0xde6dc5[_0xa4e8('0x4c')]['filter']+'%'};return _0x5ee72b;})});}_0x5d56aa=_[_0xa4e8('0x58')]({},_0x5d56aa,_0xde6dc5[_0xa4e8('0x59')]);return db[_0xa4e8('0x74')][_0xa4e8('0x29')]({'where':_0x5d56aa[_0xa4e8('0x5a')]})[_0xa4e8('0x2d')](function(_0x791899){_0x52f377[_0xa4e8('0x29')]=_0x791899;if(_0xde6dc5[_0xa4e8('0x4c')]['includeAll']){_0x5d56aa[_0xa4e8('0x5c')]=[{'all':!![]}];}return db[_0xa4e8('0x74')]['findAll'](_0x5d56aa);})[_0xa4e8('0x2d')](function(_0x1b32c9){_0x52f377[_0xa4e8('0x5e')]=_0x1b32c9;return _0x52f377;});}})[_0xa4e8('0x2d')](respondWithFilteredResult(_0x4b7f73,_0x5d56aa))[_0xa4e8('0x23')](handleError(_0x4b7f73,null));};exports[_0xa4e8('0x78')]=function(_0x5c51a9,_0x19b5b5){return db['ChatWebsite']['find']({'where':{'id':_0x5c51a9[_0xa4e8('0x60')]['id']}})['then'](handleEntityNotFound(_0x19b5b5,null))[_0xa4e8('0x2d')](function(_0x3002a7){if(_0x3002a7){return _0x3002a7['removeAnswers'](_0x5c51a9['query'][_0xa4e8('0x79')]);}})[_0xa4e8('0x2d')](respondWithStatusCode(_0x19b5b5,null))[_0xa4e8('0x23')](handleError(_0x19b5b5,null));};exports[_0xa4e8('0x7a')]=function(_0x40c509,_0x31c94e){_0x40c509[_0xa4e8('0x65')][_0xa4e8('0x7b')]=_0x40c509[_0xa4e8('0x7c')][_0xa4e8('0x7d')];return db[_0xa4e8('0x49')][_0xa4e8('0x63')]({'where':{'id':_0x40c509[_0xa4e8('0x60')]['id']}})['then'](handleEntityNotFound(_0x31c94e,null))[_0xa4e8('0x2d')](saveUpdates(_0x40c509[_0xa4e8('0x65')],null))['then'](respondWithResult(_0x31c94e,null))[_0xa4e8('0x23')](handleError(_0x31c94e,null));};exports['addAvatar']=function(_0x2dcded,_0x5531b7){_0x2dcded['body'][_0xa4e8('0x7e')]=_0x2dcded[_0xa4e8('0x7c')][_0xa4e8('0x7d')];return db[_0xa4e8('0x49')]['find']({'where':{'id':_0x2dcded[_0xa4e8('0x60')]['id']}})[_0xa4e8('0x2d')](handleEntityNotFound(_0x5531b7,null))[_0xa4e8('0x2d')](saveUpdates(_0x2dcded['body'],null))[_0xa4e8('0x2d')](respondWithResult(_0x5531b7,null))[_0xa4e8('0x23')](handleError(_0x5531b7,null));};exports[_0xa4e8('0x7f')]=function(_0x32aa40,_0x4c0301){_0x32aa40[_0xa4e8('0x65')][_0xa4e8('0x80')]=_0x32aa40[_0xa4e8('0x7c')]['filename'];return db[_0xa4e8('0x49')][_0xa4e8('0x63')]({'where':{'id':_0x32aa40['params']['id']}})['then'](handleEntityNotFound(_0x4c0301,null))['then'](saveUpdates(_0x32aa40[_0xa4e8('0x65')],null))[_0xa4e8('0x2d')](respondWithResult(_0x4c0301,null))[_0xa4e8('0x23')](handleError(_0x4c0301,null));};exports['addSystemAvatar']=function(_0x2d4e23,_0x553ce2){_0x2d4e23[_0xa4e8('0x65')][_0xa4e8('0x81')]=_0x2d4e23[_0xa4e8('0x7c')]['filename'];return db[_0xa4e8('0x49')][_0xa4e8('0x63')]({'where':{'id':_0x2d4e23['params']['id']}})[_0xa4e8('0x2d')](handleEntityNotFound(_0x553ce2,null))[_0xa4e8('0x2d')](saveUpdates(_0x2d4e23[_0xa4e8('0x65')],null))[_0xa4e8('0x2d')](respondWithResult(_0x553ce2,null))[_0xa4e8('0x23')](handleError(_0x553ce2,null));};exports[_0xa4e8('0x82')]=function(_0x1c4f3f,_0x132f4d){var _0x4e36ec=path['join'](config[_0xa4e8('0x83')],_0xa4e8('0x84'));var _0x33e4ed={'where':{'id':_0x1c4f3f[_0xa4e8('0x60')]['id']},'attributes':['id','sitepic'],'raw':!![]};var _0x5880e6=![];return require(_0xa4e8('0x85'))[_0xa4e8('0x86')]()[_0xa4e8('0x2d')](function(_0x12cefe){if(_0x12cefe){_0x5880e6=_0x12cefe['custom'];}})[_0xa4e8('0x2d')](function(){return db[_0xa4e8('0x49')][_0xa4e8('0x63')](_0x33e4ed);})[_0xa4e8('0x2d')](handleEntityNotFound(_0x132f4d,null))[_0xa4e8('0x2d')](function(_0x4ba6a1){if(_0x4ba6a1){if(!_[_0xa4e8('0x87')](_0x4ba6a1[_0xa4e8('0x7b')])){if(fs['existsSync'](path[_0xa4e8('0x88')](config[_0xa4e8('0x83')],_0xa4e8('0x89'),_0x4ba6a1['sitepic']))&&_0x5880e6){_0x4e36ec=path[_0xa4e8('0x88')](config['root'],'server/files/images/logos/',_0x4ba6a1['sitepic']);}}return _0x132f4d[_0xa4e8('0x8a')](_0x4e36ec);}})[_0xa4e8('0x23')](handleError(_0x132f4d,null));};exports['getAvatar']=function(_0xefd939,_0x20ac57){var _0x58abc2=path[_0xa4e8('0x88')](config[_0xa4e8('0x83')],_0xa4e8('0x8b'));var _0xb7270a={'where':{'id':_0xefd939[_0xa4e8('0x60')]['id']},'attributes':['id',_0xa4e8('0x7e')],'raw':!![]};return db[_0xa4e8('0x49')][_0xa4e8('0x63')](_0xb7270a)[_0xa4e8('0x2d')](handleEntityNotFound(_0x20ac57,null))[_0xa4e8('0x2d')](function(_0x28f435){if(_0x28f435){if(!_['isNil'](_0x28f435[_0xa4e8('0x7e')])){if(fs[_0xa4e8('0x8c')](path[_0xa4e8('0x88')](config[_0xa4e8('0x83')],_0xa4e8('0x8d'),_0x28f435[_0xa4e8('0x7e')]))){_0x58abc2=path[_0xa4e8('0x88')](config[_0xa4e8('0x83')],_0xa4e8('0x8d'),_0x28f435[_0xa4e8('0x7e')]);}}return _0x20ac57['download'](_0x58abc2);}})[_0xa4e8('0x23')](handleError(_0x20ac57,null));};exports['getCustomerAvatar']=function(_0x1a979b,_0x9ad3d7){var _0x3d1a25=path[_0xa4e8('0x88')](config[_0xa4e8('0x83')],'server/files/images/avatars/customer_avatar.png');var _0x4dba5c={'where':{'id':_0x1a979b['params']['id']},'attributes':['id',_0xa4e8('0x80'),'showCustomerAvatar'],'raw':!![]};return db['ChatWebsite'][_0xa4e8('0x63')](_0x4dba5c)[_0xa4e8('0x2d')](handleEntityNotFound(_0x9ad3d7,null))['then'](function(_0x3d2648){if(_0x3d2648){if(!_[_0xa4e8('0x87')](_0x3d2648[_0xa4e8('0x80')])){if(fs[_0xa4e8('0x8c')](path['join'](config[_0xa4e8('0x83')],'server/files/images/avatars/',_0x3d2648[_0xa4e8('0x80')]))&&_0x3d2648['showCustomerAvatar']){_0x3d1a25=path[_0xa4e8('0x88')](config[_0xa4e8('0x83')],_0xa4e8('0x8d'),_0x3d2648['customerAvatar']);}}return _0x9ad3d7['download'](_0x3d1a25);}})[_0xa4e8('0x23')](handleError(_0x9ad3d7,null));};exports['getSystemAvatar']=function(_0x2d2baa,_0x504cbb){var _0x3260d9=path[_0xa4e8('0x88')](config[_0xa4e8('0x83')],_0xa4e8('0x8e'));var _0x480102={'where':{'id':_0x2d2baa[_0xa4e8('0x60')]['id']},'attributes':['id',_0xa4e8('0x81')],'raw':!![]};return db['ChatWebsite']['find'](_0x480102)[_0xa4e8('0x2d')](handleEntityNotFound(_0x504cbb,null))['then'](function(_0x40e10d){if(_0x40e10d){if(!_[_0xa4e8('0x87')](_0x40e10d[_0xa4e8('0x81')])){if(fs['existsSync'](path[_0xa4e8('0x88')](config['root'],_0xa4e8('0x8d'),_0x40e10d[_0xa4e8('0x81')]))){_0x3260d9=path[_0xa4e8('0x88')](config['root'],_0xa4e8('0x8d'),_0x40e10d[_0xa4e8('0x81')]);}}return _0x504cbb[_0xa4e8('0x8a')](_0x3260d9);}})[_0xa4e8('0x23')](handleError(_0x504cbb,null));};function checkWebsiteInterval(_0xd665e7){var _0x494c65=_0xd665e7[_0xa4e8('0x8f')];if(!_0x494c65){return Promise[_0xa4e8('0x90')](_0xd665e7);}var _0x2fc723=_0xd665e7[_0xa4e8('0x91')]||undefined;return _0x494c65[_0xa4e8('0x92')](_0x2fc723)[_0xa4e8('0x2d')](function(_0x3247bb){if(!_0x3247bb){throw new APIOutOfIntervalError();}return _0xd665e7;});}exports[_0xa4e8('0x93')]=function(_0x348345,_0x230248){var _0x4ce14d={'body':_0x348345['body'],'channel':_0xa4e8('0x94')};var _0xea11e2=[];var _0x538a91=[];var _0x33b58f={};var _0x543dec=![];if(_0x348345[_0xa4e8('0x65')]['id']){delete _0x348345[_0xa4e8('0x65')]['id'];}if(_['isNil'](_0x348345[_0xa4e8('0x65')]['from'])){throw new APIBadRequestError('From\x20is\x20mandatory');}if(_[_0xa4e8('0x87')](_0x348345[_0xa4e8('0x65')]['mapKey'])){throw new APIBadRequestError(_0xa4e8('0x95'));}if(_[_0xa4e8('0x96')](_0x348345['body']['body'])){throw new APIBadRequestError(_0xa4e8('0x97'));}var _0x26eab2=_0x348345[_0xa4e8('0x65')][_0xa4e8('0x98')]&&_0x348345['body'][_0xa4e8('0x3b')];return db['CmContact'][_0xa4e8('0x6f')]()[_0xa4e8('0x2d')](function(_0x29da45){if(!_0x29da45){throw new Error('No\x20available\x20attributes');}_0xea11e2=Object[_0xa4e8('0x4d')](_0x29da45)[_0xa4e8('0x57')](function(_0x439a34){return![_0xa4e8('0x99'),_0xa4e8('0x9a')]['includes'](_0x439a34);});_0x538a91=Object[_0xa4e8('0x4d')](_0x29da45)[_0xa4e8('0x57')](function(_0x278403){return![_0xa4e8('0x99'),_0xa4e8('0x9a'),_0xa4e8('0x9b'),'ListId']['includes'](_0x278403);});if(!_[_0xa4e8('0x9c')](_0x538a91,_0x348345['body'][_0xa4e8('0x9d')])){throw new APIBadRequestError(_0xa4e8('0x9e')+_0x538a91['join'](',\x20'));}_0x33b58f[_0x348345['body'][_0xa4e8('0x9d')]]=_0x348345[_0xa4e8('0x65')]['from'];})['then'](function(){return db['ChatWebsite']['find']({'where':{'id':_0x348345['params']['id']},'include':[{'model':db[_0xa4e8('0x9f')],'as':_0xa4e8('0xa0'),'include':[{'model':db[_0xa4e8('0xa1')],'as':_0xa4e8('0xa2'),'where':_0x33b58f,'limit':0x1,'order':[[_0xa4e8('0x9a'),_0xa4e8('0xa3')]]}]},{'model':db['ChatApplication'],'as':_0xa4e8('0xa4')},{'model':db[_0xa4e8('0x8f')],'as':_0xa4e8('0x8f'),'include':[{'model':db[_0xa4e8('0x8f')],'as':'Intervals','attributes':['id',_0xa4e8('0xa5')],'raw':!![]}]}]});})[_0xa4e8('0x2d')](function(_0x2e8279){if(!_0x2e8279){throw new APINotFoundError(util[_0xa4e8('0x40')](_0xa4e8('0xa6'),_0x348345[_0xa4e8('0x60')]['id']));}if(_0x26eab2){return checkWebsiteInterval(_0x2e8279);}return _0x2e8279;})[_0xa4e8('0x2d')](function(_0x52d369){_0x4ce14d[_0xa4e8('0xa7')]=_0x52d369;_0x4ce14d[_0xa4e8('0xa8')]=_[_0xa4e8('0xa9')](_0x52d369[_0xa4e8('0xa4')],[_0xa4e8('0xaa')],['asc']);if(_0x4ce14d[_0xa4e8('0xa7')]['Applications']){delete _0x4ce14d[_0xa4e8('0xa7')][_0xa4e8('0xa4')];}_0x4ce14d[_0xa4e8('0xab')]=_0x52d369[_0xa4e8('0xa0')]||{'id':_0x52d369[_0xa4e8('0xac')]};if(_0x4ce14d['list']&&_0x4ce14d[_0xa4e8('0xab')][_0xa4e8('0xa2')][_0xa4e8('0x52')]){return _0x4ce14d[_0xa4e8('0xab')]['Contacts'][0x0];}var _0x4e4e38=_[_0xa4e8('0xad')](_0x348345['body'],{'firstName':_0x348345['body']['from'],'ListId':_0x52d369[_0xa4e8('0xac')]});_0x4e4e38[_0x348345[_0xa4e8('0x65')]['mapKey']]=_0x348345[_0xa4e8('0x65')]['from'];return db[_0xa4e8('0xa1')][_0xa4e8('0x64')](_0x4e4e38,{'fields':_0xea11e2,'raw':!![]});})[_0xa4e8('0x2d')](function(_0x1c2db1){_0x4ce14d[_0xa4e8('0xae')]=_0x1c2db1;var _0x5c44b9=createInteractionObject(_0x348345[_0xa4e8('0x60')]['id'],_0x348345['body'],_0x348345['headers'],_0x1c2db1);var _0x19ef89={'ChatWebsiteId':_0x348345['params']['id']};if(_0x348345[_0xa4e8('0x65')][_0xa4e8('0xaf')]){_0x19ef89[_0xa4e8('0xaf')]=_0x348345[_0xa4e8('0x65')]['threadId'];_0x19ef89[_0xa4e8('0xb0')]=![];return db[_0xa4e8('0xb1')][_0xa4e8('0x63')]({'where':_0x19ef89})[_0xa4e8('0x2d')](function(_0x48c0aa){var _0x49dfab=_0x348345['body'][_0xa4e8('0x98')]&&_0x348345[_0xa4e8('0x65')]['referer'];if(_0x48c0aa){_0x543dec=!![];return _0x48c0aa;}else if(!_0x49dfab&&_0x48c0aa&&_0x48c0aa[_0xa4e8('0xb0')]){throw new APIConflictError('Writing\x20on\x20closed\x20interaction');}_0x5c44b9['threadId']=_0x348345['body'][_0xa4e8('0xaf')];_0x5c44b9[_0xa4e8('0xb2')]=_0x348345['body'][_0xa4e8('0xb2')];return db[_0xa4e8('0xb1')][_0xa4e8('0x64')](_0x5c44b9);});}_0x19ef89[_0xa4e8('0xb3')]=_0x1c2db1['id'];if(_0x348345[_0xa4e8('0x65')][_0xa4e8('0xb4')]&&_0x348345[_0xa4e8('0x65')]['interaction']['id']){_0x19ef89['id']=_0x348345['body'][_0xa4e8('0xb4')]['id'];return db[_0xa4e8('0xb1')][_0xa4e8('0x63')]({'where':_0x19ef89})[_0xa4e8('0x2d')](function(_0x3b3efa){var _0x574d95=_0x348345['body'][_0xa4e8('0x98')]&&_0x348345[_0xa4e8('0x65')][_0xa4e8('0x3b')];if(!_0x574d95&&_0x3b3efa&&_0x3b3efa['closed']){throw new APIConflictError(_0xa4e8('0xb5'));}else if(_0x3b3efa){_0x543dec=!![];return _0x3b3efa;}else{return db[_0xa4e8('0xb1')][_0xa4e8('0x64')](_0x5c44b9);}});}return db[_0xa4e8('0xb1')][_0xa4e8('0x64')](_0x5c44b9);})[_0xa4e8('0x2d')](function(_0x27fb1c){if(!_0x543dec){return _0x27fb1c;}var _0x1b30a8={'from':(_0x4ce14d[_0xa4e8('0xae')]['firstName']||'')+'\x20'+(_0x4ce14d[_0xa4e8('0xae')][_0xa4e8('0xb6')]||'')};if(_0x348345[_0xa4e8('0x65')][_0xa4e8('0xaf')]&&_0x348345[_0xa4e8('0x65')][_0xa4e8('0xb7')]&&_0x348345[_0xa4e8('0x65')][_0xa4e8('0xaf')]!=_0x348345['body']['messageId']){_0x1b30a8['threadId']=_0x348345[_0xa4e8('0x65')][_0xa4e8('0xb7')];}return _0x27fb1c['update'](_0x1b30a8);})[_0xa4e8('0x2d')](function(_0x4a4ce8){_0x4ce14d[_0xa4e8('0xb4')]=_0x4a4ce8[_0xa4e8('0x2e')]({'plain':!![]});_0x4ce14d[_0xa4e8('0xb4')][_0xa4e8('0xb8')]=!_0x543dec;if(_0x4ce14d[_0xa4e8('0xb4')][_0xa4e8('0xb8')]){if(_0x4ce14d[_0xa4e8('0xa7')]['autoclose']){_0x4ce14d[_0xa4e8('0xa8')][_0xa4e8('0xb9')]({'id':0x0,'priority':_0x4ce14d[_0xa4e8('0xa8')]['length']+0x1,'app':_0xa4e8('0xba'),'appdata':_0xa4e8('0xbb'),'interval':_0xa4e8('0xbc')});}}return db[_0xa4e8('0xbd')][_0xa4e8('0x64')]({'body':_0x348345[_0xa4e8('0x65')][_0xa4e8('0x65')],'ChatWebsiteId':_0x348345[_0xa4e8('0x60')]['id'],'ChatInteractionId':_0x4a4ce8['id'],'direction':'in','ContactId':_0x4ce14d['contact']['id'],'AttachmentId':_0x348345[_0xa4e8('0x65')]['AttachmentId']});})[_0xa4e8('0x2d')](function(_0x375567){_0x4ce14d[_0xa4e8('0x21')]=_0x375567;if(!_0x4ce14d[_0xa4e8('0xb4')]['UserId']){return;}return db[_0xa4e8('0xbe')][_0xa4e8('0x63')]({'attributes':['id',_0xa4e8('0x32')],'where':{'id':_0x4ce14d[_0xa4e8('0xb4')][_0xa4e8('0xbf')]}});})[_0xa4e8('0x2d')](function(_0x444806){if(_0x444806){_0x4ce14d[_0xa4e8('0xa8')][_0xa4e8('0xc0')]({'id':0x0,'priority':0x0,'app':_0xa4e8('0xc1'),'appdata':_0x444806[_0xa4e8('0x32')]+','+(_0x4ce14d['account'][_0xa4e8('0xc2')]||0xa),'interval':_0xa4e8('0xbc')});_0x4ce14d[_0xa4e8('0xc3')]=!![];}if(!_0x4ce14d[_0xa4e8('0xb4')][_0xa4e8('0xc4')]){return;}return db[_0xa4e8('0xc5')][_0xa4e8('0x63')]({'attributes':['id',_0xa4e8('0x32')],'where':{'id':_0x4ce14d[_0xa4e8('0xb4')][_0xa4e8('0xc4')]}});})[_0xa4e8('0x2d')](function(_0x28a95c){if(_0x28a95c){_0x4ce14d[_0xa4e8('0xa8')][_0xa4e8('0xc0')]({'id':0x0,'priority':0x1,'app':_0xa4e8('0xc6'),'appdata':_0x28a95c[_0xa4e8('0x32')]+','+(_0x4ce14d[_0xa4e8('0xa7')]['waitForTheAssignedQueue']||0x12c),'interval':_0xa4e8('0xbc')});}return respondWithRpcPromise('Start',_0xa4e8('0xc7'),_0x4ce14d);})[_0xa4e8('0x2d')](function(_0x2c7d45){respondWithRpcPromise(_0xa4e8('0xc8'),_0xa4e8('0xc8'),{'event':'notify','message':_0x2c7d45},client9002);return _0x2c7d45;})['then'](respondWithResult(_0x230248,null))[_0xa4e8('0x23')](APIHandleError(_0x230248));};exports[_0xa4e8('0xc9')]=function(_0x5b9321,_0x39ef30){var _0x28dc37,_0x426ccb,_0x1b2eae;var _0x1052a1=[];var _0x26020f={};var _0x163b37=_0x5b9321['files']||[];var _0x5f2a26=[];var _0x1aa96e;return db[_0xa4e8('0xa1')][_0xa4e8('0x6f')]()['then'](function(_0x4aae64){if(!_0x4aae64){throw new db[(_0xa4e8('0xca'))]['ValidationError'](_0xa4e8('0xcb'));}_0x1052a1=_[_0xa4e8('0xcc')](_['keys'](_0x4aae64),['createdAt','updatedAt',_0xa4e8('0x9b'),'ListId']);if(_0x5b9321[_0xa4e8('0x65')]['id']){delete _0x5b9321[_0xa4e8('0x65')]['id'];}if(_[_0xa4e8('0x87')](_0x5b9321['body'][_0xa4e8('0xcd')])){throw _0x39ef30[_0xa4e8('0x2a')](0x1f4)[_0xa4e8('0x33')](new db['Sequelize'][(_0xa4e8('0xce'))](_0xa4e8('0xcf')));}if(_[_0xa4e8('0x87')](_0x5b9321[_0xa4e8('0x65')][_0xa4e8('0x65')])||_0x5b9321['body'][_0xa4e8('0x65')]===''){throw _0x39ef30['status'](0x1f4)['send'](new db[(_0xa4e8('0xca'))][(_0xa4e8('0xce'))](_0xa4e8('0xd0')));}if(_[_0xa4e8('0x87')](_0x5b9321[_0xa4e8('0x65')]['mapKeyOffline'])){throw _0x39ef30[_0xa4e8('0x2a')](0x1f4)[_0xa4e8('0x33')](new db[(_0xa4e8('0xca'))][(_0xa4e8('0xce'))]('mapKeyOffline\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20'+_0x1052a1));}if(!_[_0xa4e8('0x9c')](_0x1052a1,_0x5b9321[_0xa4e8('0x65')][_0xa4e8('0xd1')])){throw _0x39ef30['status'](0x1f4)['send'](new db[(_0xa4e8('0xca'))][(_0xa4e8('0xce'))](_0xa4e8('0xd2')+_0x1052a1));}_0x26020f[_0x5b9321[_0xa4e8('0x65')][_0xa4e8('0xd1')]]=_0x5b9321[_0xa4e8('0x65')][_0xa4e8('0xcd')];})[_0xa4e8('0x2d')](function(){return db['ChatWebsite'][_0xa4e8('0x63')]({'where':{'id':_0x5b9321[_0xa4e8('0x60')]['id']},'include':[{'model':db[_0xa4e8('0x9f')],'as':_0xa4e8('0xa0')},{'model':db[_0xa4e8('0xd3')],'as':_0xa4e8('0xd3')}]});})[_0xa4e8('0x2d')](handleEntityNotFound(_0x39ef30,null))[_0xa4e8('0x2d')](function(_0x4786e8){if(_0x4786e8&&_0x4786e8['List']){_0x426ccb=_0x4786e8;var _0x45226e=_[_0xa4e8('0xad')](_0x5b9321[_0xa4e8('0x65')],{'firstName':_0x5b9321[_0xa4e8('0x65')][_0xa4e8('0xcd')],'phone':_0x5b9321[_0xa4e8('0x65')][_0xa4e8('0xcd')],'ListId':_0x4786e8[_0xa4e8('0xac')]});_0x45226e[_0x5b9321[_0xa4e8('0x65')][_0xa4e8('0xd1')]]=_0x5b9321['body'][_0xa4e8('0xcd')];return db[_0xa4e8('0xa1')][_0xa4e8('0xd4')]({'where':_0x26020f,'defaults':_0x45226e});}})[_0xa4e8('0xd5')](function(_0x5402b2){if(_0x5402b2){_0x1b2eae=_0x5402b2;var _0x3368ea=fs['readFileSync'](path['join'](config[_0xa4e8('0x83')],'server/files/templates/chatOfflineMessage.ejs'),_0xa4e8('0xd6'));var _0x60d391=ejs[_0xa4e8('0xd7')](_0x3368ea,{'body':_[_0xa4e8('0xd8')](_0x5b9321[_0xa4e8('0x65')][_0xa4e8('0x65')]),'bodyTitle':_0x426ccb[_0xa4e8('0xd9')]});return db['ChatOfflineMessage'][_0xa4e8('0x64')]({'body':_0x60d391,'plainBody':htmlToText['fromString'](_0x60d391),'ContactId':_0x5402b2['id'],'ChatWebsiteId':_0x426ccb['id']});}})['then'](function(_0x47c9a4){_0x1aa96e=_0x47c9a4;if(_0x163b37[_0xa4e8('0x52')]){var _0x39d094=_0x163b37[_0xa4e8('0x48')](function(_0x2569c0){return{'name':_0x2569c0[_0xa4e8('0xda')],'basename':_0x2569c0['filename'],'type':_0x2569c0[_0xa4e8('0xdb')],'ChatOfflineMessageId':_0x47c9a4['id']};});_0x5f2a26=_0x39d094[_0xa4e8('0x48')](_0x46f721=>{var _0x5195c8={'filename':_0x46f721[_0xa4e8('0x32')],'path':path[_0xa4e8('0x88')](config[_0xa4e8('0x83')],_0xa4e8('0xdc'),_0xa4e8('0xdd'),_0xa4e8('0xde'),'offline-chat',_0x46f721[_0xa4e8('0xdf')])};return _0x5195c8;});if(!_0x426ccb[_0xa4e8('0xe0')]){return db[_0xa4e8('0xe1')]['transaction'](function(_0x2a972a){return db['Attachment']['bulkCreate'](_0x39d094,{'transaction':_0x2a972a});});}}})[_0xa4e8('0x2d')](function(){if(_0x1aa96e){_0x28dc37=_0x1aa96e;return db[_0xa4e8('0xd3')][_0xa4e8('0x76')]({'where':{'service':!![]},'include':[{'model':db[_0xa4e8('0xe2')],'as':_0xa4e8('0xe3'),'raw':!![],'include':[{'model':db['CloudProvider'],'as':_0xa4e8('0xe4'),'raw':!![]}]}]});}})[_0xa4e8('0x2d')](function(_0x53085f){if(_0x53085f&&_0x53085f[_0xa4e8('0xe3')]&&_0x426ccb[_0xa4e8('0xe5')]&&_0x426ccb['forwardOfflineAddress']){var _0x16a58d=_0x53085f[_0xa4e8('0xe6')]();return respondWithRpcPromise(_0xa4e8('0xe7'),_0xa4e8('0xe8'),{'account':_0x16a58d,'message':{'from':util[_0xa4e8('0x40')](_0xa4e8('0xe9'),_0x53085f[_0xa4e8('0x32')],_0x53085f[_0xa4e8('0xea')]||_0x53085f[_0xa4e8('0xe3')][_0xa4e8('0x68')]),'to':_0x426ccb[_0xa4e8('0xeb')],'subject':_0x426ccb[_0xa4e8('0xec')],'html':_0x28dc37[_0xa4e8('0x65')],'attachments':_0x5f2a26}},client9003)[_0xa4e8('0x2d')](function(){return _0x28dc37;})['catch'](function(_0xf29e2f){logger['error'](_0xf29e2f);});}})[_0xa4e8('0x2d')](function(){if(_0x426ccb&&_0x426ccb[_0xa4e8('0xe0')]&&_0x426ccb[_0xa4e8('0xed')]){var _0x58272a=[];if(_0x163b37[_0xa4e8('0x52')]){_0x58272a=_0x163b37[_0xa4e8('0x48')](function(_0x4893a7){return{'name':_0x4893a7[_0xa4e8('0xda')],'basename':_0x4893a7['filename'],'type':_0x4893a7[_0xa4e8('0xdb')],'ChatOfflineMessageId':_0x1aa96e['id']};});}var _0x708b11;if(!_[_0xa4e8('0x87')](_0x426ccb[_0xa4e8('0xee')])){var _0x1662e3=_[_0xa4e8('0x48')](_0x5b9321[_0xa4e8('0x65')],function(_0x2fba20){return _0x2fba20;});var _0x2f111f=_[_0xa4e8('0xef')](_0x1662e3)[0x0];var _0x338d1f=_[_0xa4e8('0xf0')](_0x2f111f,function(_0x149b49){return _0x149b49;});_0x708b11=_0x338d1f[0x1][_0x426ccb[_0xa4e8('0xee')]];}var _0x4fec75={'from':_0x1b2eae['email'],'firstName':_0x1b2eae['firstName'],'lastName':_0x1b2eae[_0xa4e8('0xb6')],'mapKey':_0xa4e8('0xea'),'message':{'from':_0x1b2eae[_0xa4e8('0xea')],'to':_0x426ccb[_0xa4e8('0xd3')][_0xa4e8('0xea')],'cc':'','subject':_[_0xa4e8('0x87')](_0x708b11)?_0x426ccb[_0xa4e8('0xec')]:_0x708b11,'messageId':'','sentAt':new Date(),'attach':_0x58272a['length'],'attachments':_0x58272a,'originChannel':_0xa4e8('0xf1'),'ChatWebsiteId':_0x426ccb['id'],'ChatOfflineMessageId':_0x28dc37['id'],'originTo':_0x426ccb[_0xa4e8('0xd3')][_0xa4e8('0xea')]},'body':_0x28dc37[_0xa4e8('0x65')]};var _0x5f5480={'account':{'id':_0x426ccb['MailAccountId']},'body':_0x4fec75,'log':_0xa4e8('0xf2')};return respondWithRpcPromise(_0xa4e8('0xf2'),_0xa4e8('0xf3'),_0x5f5480,client9001)[_0xa4e8('0x2d')](function(){return _0x28dc37;})[_0xa4e8('0x23')](function(_0x4de7f7){logger[_0xa4e8('0x1f')](_0x4de7f7);});}return;})[_0xa4e8('0x2d')](function(){if(_0x28dc37){return _0x28dc37;}})[_0xa4e8('0x2d')](respondWithResult(_0x39ef30,null))[_0xa4e8('0x23')](function(){for(var _0x128e63 of _0x163b37){var _0x3928bc=path[_0xa4e8('0x88')](config['root'],'server',_0xa4e8('0xdd'),'attachments',_0xa4e8('0xf4'),_0x128e63[_0xa4e8('0x7d')]);fs_extra[_0xa4e8('0xf5')](_0x3928bc)['catch'](function(_0x172b8a){logger[_0xa4e8('0x1f')](_0xa4e8('0xf6'),_0x3928bc,_0x172b8a);});}});};exports[_0xa4e8('0xf7')]=function(_0x317b60,_0x2660a0){return db[_0xa4e8('0xb1')]['find']({'where':{'id':_0x317b60[_0xa4e8('0x60')]['id']}})[_0xa4e8('0x2d')](handleEntityNotFound(_0x2660a0,null))[_0xa4e8('0x2d')](function(_0xaa074d){if(_0xaa074d){return _0xaa074d[_0xa4e8('0xf7')](_0x317b60[_0xa4e8('0x65')][_0xa4e8('0x79')],_['omit'](_0x317b60[_0xa4e8('0x65')],[_0xa4e8('0x79'),'id'])||{});}})[_0xa4e8('0x2d')](respondWithResult(_0x2660a0,null))['catch'](handleError(_0x2660a0,null));};exports[_0xa4e8('0xf8')]=function(_0x389069,_0x570a15){var _0x5931f6={'raw':![],'where':{}};var _0x2d7b44={};var _0x4f6578={'count':0x0,'rows':[]};return db[_0xa4e8('0x49')][_0xa4e8('0x76')]({'where':{'id':_0x389069[_0xa4e8('0x60')]['id']}})['then'](handleEntityNotFound(_0x570a15,null))[_0xa4e8('0x2d')](function(_0x1b1a62){if(_0x1b1a62){_0x2d7b44[_0xa4e8('0x43')]=_[_0xa4e8('0x4d')](db[_0xa4e8('0xb1')]['rawAttributes']);_0x2d7b44[_0xa4e8('0x4c')]=_[_0xa4e8('0x4d')](_0x389069[_0xa4e8('0x4c')]);_0x2d7b44['filters']=_['intersection'](_0x2d7b44[_0xa4e8('0x43')],_0x2d7b44[_0xa4e8('0x4c')]);_0x5931f6[_0xa4e8('0x50')]=_[_0xa4e8('0x4f')](_0x2d7b44[_0xa4e8('0x43')],qs[_0xa4e8('0x51')](_0x389069['query'][_0xa4e8('0x51')]));_0x5931f6['attributes']=_0x5931f6[_0xa4e8('0x50')]['length']?_0x5931f6[_0xa4e8('0x50')]:_0x2d7b44['model'];if(!_0x389069['query'][_0xa4e8('0x53')](_0xa4e8('0x54'))){_0x5931f6[_0xa4e8('0x28')]=qs[_0xa4e8('0x28')](_0x389069[_0xa4e8('0x4c')][_0xa4e8('0x28')]);_0x5931f6['offset']=qs[_0xa4e8('0x26')](_0x389069['query']['offset']);}_0x5931f6[_0xa4e8('0x55')]=qs[_0xa4e8('0x56')](_0x389069[_0xa4e8('0x4c')][_0xa4e8('0x56')]);_0x5931f6[_0xa4e8('0x5a')]=qs['filters'](_[_0xa4e8('0x77')](_0x389069['query'],_0x2d7b44['filters']));_0x5931f6[_0xa4e8('0x5a')][_0xa4e8('0x70')]=_0x1b1a62['id'];if(_0x389069[_0xa4e8('0x4c')][_0xa4e8('0x57')]){_0x5931f6[_0xa4e8('0x5a')]=_[_0xa4e8('0x58')](_0x5931f6[_0xa4e8('0x5a')],{'$or':_[_0xa4e8('0x48')](_0x5931f6[_0xa4e8('0x50')],function(_0x369335){var _0x5cd20a={};_0x5cd20a[_0x369335]={'$like':'%'+_0x389069[_0xa4e8('0x4c')][_0xa4e8('0x57')]+'%'};return _0x5cd20a;})});}_0x5931f6=_[_0xa4e8('0x58')]({},_0x5931f6,_0x389069[_0xa4e8('0x59')]);return db[_0xa4e8('0xb1')][_0xa4e8('0x29')]({'where':_0x5931f6[_0xa4e8('0x5a')]})[_0xa4e8('0x2d')](function(_0x2cc8fb){_0x4f6578[_0xa4e8('0x29')]=_0x2cc8fb;if(_0x389069['query'][_0xa4e8('0x5b')]){_0x5931f6['include']=[{'model':db[_0xa4e8('0xa1')],'as':_0xa4e8('0xf9'),'required':![]},{'model':db['User'],'as':_0xa4e8('0xfa'),'attributes':[_0xa4e8('0x32'),_0xa4e8('0xfb'),_0xa4e8('0xfc')],'required':![]},{'model':db['Tag'],'as':_0xa4e8('0xfd'),'attributes':['id','name',_0xa4e8('0xfe')],'where':_0x389069['query'][_0xa4e8('0xff')]?{'id':_0x389069[_0xa4e8('0x4c')][_0xa4e8('0xff')]}:undefined,'required':_0x389069[_0xa4e8('0x4c')][_0xa4e8('0xff')]?!![]:![]}];}return db[_0xa4e8('0xb1')][_0xa4e8('0x5d')](_0x5931f6);})[_0xa4e8('0x2d')](function(_0x16f5bb){_0x4f6578[_0xa4e8('0x5e')]=_0x16f5bb;return _0x4f6578;});}})[_0xa4e8('0x2d')](respondWithFilteredResult(_0x570a15,_0x5931f6))[_0xa4e8('0x23')](handleError(_0x570a15,null));};exports[_0xa4e8('0x100')]=function(_0x1f1b6c,_0x331aae){var _0x1696f4=0x0;var _0x5c4a8f=0x0;var _0x135918=![];var _0x2198a8;var _0x51614d;return db[_0xa4e8('0x49')][_0xa4e8('0x63')]({'where':{'id':_0x1f1b6c[_0xa4e8('0x60')]['id']},'include':[{'model':db[_0xa4e8('0x8f')],'as':_0xa4e8('0x8f'),'include':[{'model':db[_0xa4e8('0x8f')],'as':'Intervals','attributes':['id',_0xa4e8('0xa5')]}]}]})[_0xa4e8('0x2d')](handleEntityNotFound(_0x331aae,null))[_0xa4e8('0x2d')](function(_0x212f83){if(_0x212f83){_0x2198a8=_0x212f83;return _0x212f83[_0xa4e8('0x101')]({'raw':!![]});}})[_0xa4e8('0x2d')](function(_0x57f973){if(_0x2198a8){if(_0x57f973){_0x51614d=_0x57f973;}}return require('../../config/license/util')[_0xa4e8('0x86')]();})[_0xa4e8('0x2d')](function(_0x319ea5){if(_0x319ea5){_0x5c4a8f=_0x319ea5[_0xa4e8('0x102')];_0x135918=_0x319ea5[_0xa4e8('0x103')];}})[_0xa4e8('0x2d')](function(){return db['ChatInteraction'][_0xa4e8('0x29')]({'where':{'closed':![]}});})[_0xa4e8('0x2d')](function(_0x313804){_0x1696f4=_0x313804;if(_0x5c4a8f&&_0x313804>_0x5c4a8f){return db['License'][_0xa4e8('0x76')]({'where':{'id':0x1}})['then'](function(_0x6fbd81){if(_0x6fbd81){_0x6fbd81[_0xa4e8('0x104')](_0xa4e8('0x105'));}});}})[_0xa4e8('0x2d')](function(){var _0x55a04d=_0x2198a8[_0xa4e8('0x8f')];var _0xf259d4=_0x2198a8[_0xa4e8('0x91')]||undefined;return _0x55a04d?_0x55a04d[_0xa4e8('0x92')](_0xf259d4):!![];})[_0xa4e8('0x2d')](function(_0x48ec6e){var _0x21754a=fs['readFileSync'](path[_0xa4e8('0x88')](config['root'],_0xa4e8('0x106')),_0xa4e8('0xd6'));var _0x27af8b=_0xa4e8('0x107');var _0x15329=![];try{const _0x1ffd04=new URL(_0x2198a8[_0xa4e8('0x66')]);_0x2198a8[_0xa4e8('0x66')]=_0x1ffd04['origin'];}catch(_0x5531ae){}var _0x4f3147;if(_0x1f1b6c[_0xa4e8('0x108')][_0xa4e8('0x3b')]){_0x1f1b6c[_0xa4e8('0x108')]['referer']=_0x1f1b6c[_0xa4e8('0x108')][_0xa4e8('0x3b')][_0xa4e8('0x109')](/\/$/,'');_0x4f3147=wildcardUtils[_0xa4e8('0x10a')](_0x2198a8[_0xa4e8('0x66')],_0x1f1b6c['headers'][_0xa4e8('0x3b')]);}else{_0x1f1b6c[_0xa4e8('0x108')]['referer']=_0x2198a8['address'];_0x4f3147=!![];}var _0x2a8bc8={'chatVersion':_0x27af8b,'chatWebsiteAddressOrigin':_0x4f3147?_0x1f1b6c['headers'][_0xa4e8('0x3b')]:_0x2198a8[_0xa4e8('0x66')],'remote':_0x2198a8[_0xa4e8('0x10b')],'query':querystring[_0xa4e8('0x46')](_[_0xa4e8('0x58')](_0x2198a8[_0xa4e8('0x2e')]({'plain':!![]}),{'customerIp':_0x1f1b6c[_0xa4e8('0x108')][_0xa4e8('0x37')]||_0x1f1b6c['headers'][_0xa4e8('0x10c')]||_0x1f1b6c[_0xa4e8('0x10d')]['remoteAddress']||_0x1f1b6c['ip'],'referer':_0x1f1b6c['headers'][_0xa4e8('0x3b')],'openedInteractions':_0x1696f4,'maxInteractions':_0x5c4a8f,'virtual':_0x135918['virtual'],'online':_0x48ec6e,'custom':_0x135918,'address':_0x4f3147?_0x1f1b6c['headers'][_0xa4e8('0x3b')]:null}))[_0xa4e8('0x109')](/'/g,'\x5c\x27')};_0x331aae['send'](ejs['render'](Mustache[_0xa4e8('0xd7')](_0x21754a,_0x2a8bc8),{'proactiveActions':_0x51614d,'alignment':_0x2198a8['alignment'],'verticalAlignment':_0x2198a8[_0xa4e8('0x10e')],'div_color':_0x2198a8[_0xa4e8('0xfe')],'labelText':_0x2198a8[_0xa4e8('0x10f')],'text_color':_0x2198a8[_0xa4e8('0x110')],'text_button_color':_0x2198a8[_0xa4e8('0x111')],'button_color':_0x2198a8[_0xa4e8('0x112')],'background_color':_0x2198a8[_0xa4e8('0x113')],'hideWhenOffline':_0x2198a8[_0xa4e8('0x114')],'intervalId':_0x2198a8[_0xa4e8('0x115')],'isDevelopment':_0x15329,'chatVersion':_0x27af8b}));})['catch'](handleError(_0x331aae,null));};exports[_0xa4e8('0x116')]=function(_0x30ca35,_0x56746c){var _0x382bcb=_0x30ca35['params']['id'];var _0x28b1c1=_0x30ca35[_0xa4e8('0x65')];var _0x2cc9f5=0xc8;var _0x1ac3c9=null;return db[_0xa4e8('0xe1')][_0xa4e8('0x117')]({'isolationLevel':db['sequelize'][_0xa4e8('0x118')][_0xa4e8('0x119')][_0xa4e8('0x11a')]},function(_0x4945cb){return db[_0xa4e8('0x49')]['findOne']({'where':{'id':_0x382bcb},'transaction':_0x4945cb})[_0xa4e8('0x2d')](function(_0x1534b0){if(_0x1534b0){return db[_0xa4e8('0x11b')]['destroy']({'where':{'ChatWebsiteId':_0x382bcb},'transaction':_0x4945cb})[_0xa4e8('0x2d')](function(){var _0x329567=_[_0xa4e8('0x48')](_0x28b1c1,function(_0xb95b72){_0xb95b72[_0xa4e8('0x70')]=_0x382bcb;return _0xb95b72;});return db[_0xa4e8('0x11b')][_0xa4e8('0x11c')](_0x329567,{'transaction':_0x4945cb});});}else{_0x2cc9f5=0x194;_0x1ac3c9=[];}});})[_0xa4e8('0x2d')](function(){if(_0x2cc9f5!==0x194){return db[_0xa4e8('0x11b')][_0xa4e8('0x11d')]({'where':{'ChatWebsiteId':_0x382bcb},'order':_0xa4e8('0xaa')})['then'](function(_0x29ba07){_0x1ac3c9=_0x29ba07;});}})[_0xa4e8('0x23')](function(_0x4d08c7){_0x2cc9f5=0x1f4;logger[_0xa4e8('0x1f')](_0x4d08c7['stack']);if(_0x4d08c7[_0xa4e8('0x32')]){delete _0x4d08c7[_0xa4e8('0x32')];}_0x1ac3c9=_0x4d08c7;})[_0xa4e8('0x11e')](function(){if(_0x1ac3c9===null){_0x56746c[_0xa4e8('0x24')](_0x2cc9f5);}else{if(_0x2cc9f5===0x1f4){_0x56746c[_0xa4e8('0x2a')](_0x2cc9f5)[_0xa4e8('0x33')](_0x1ac3c9);}else{_0x56746c[_0xa4e8('0x2a')](_0x2cc9f5)['json'](_0x1ac3c9);}}});};exports[_0xa4e8('0x11f')]=function(_0x51c485,_0x7acadd){var _0x1687d3={};var _0x49458a={};var _0x12cc57;var _0x4ab294;return db['ChatWebsite']['findOne']({'where':{'id':_0x51c485[_0xa4e8('0x60')]['id']}})[_0xa4e8('0x2d')](handleEntityNotFound(_0x7acadd,null))[_0xa4e8('0x2d')](function(_0x3d4cee){if(_0x3d4cee){_0x12cc57=_0x3d4cee;_0x49458a[_0xa4e8('0x43')]=_[_0xa4e8('0x4d')](db[_0xa4e8('0x11b')][_0xa4e8('0x62')]);_0x49458a[_0xa4e8('0x4c')]=_[_0xa4e8('0x4d')](_0x51c485[_0xa4e8('0x4c')]);_0x49458a[_0xa4e8('0x4e')]=_['intersection'](_0x49458a['model'],_0x49458a['query']);_0x1687d3[_0xa4e8('0x50')]=_[_0xa4e8('0x4f')](_0x49458a['model'],qs[_0xa4e8('0x51')](_0x51c485[_0xa4e8('0x4c')][_0xa4e8('0x51')]));_0x1687d3[_0xa4e8('0x50')]=_0x1687d3[_0xa4e8('0x50')][_0xa4e8('0x52')]?_0x1687d3[_0xa4e8('0x50')]:_0x49458a[_0xa4e8('0x43')];_0x1687d3['order']=qs[_0xa4e8('0x56')](_0x51c485[_0xa4e8('0x4c')][_0xa4e8('0x56')]);_0x1687d3[_0xa4e8('0x5a')]=qs[_0xa4e8('0x4e')](_[_0xa4e8('0x77')](_0x51c485['query'],_0x49458a[_0xa4e8('0x4e')]));if(_0x51c485[_0xa4e8('0x4c')][_0xa4e8('0x57')]){_0x1687d3['where']=_[_0xa4e8('0x58')](_0x1687d3['where'],{'$or':_[_0xa4e8('0x48')](_0x1687d3[_0xa4e8('0x50')],function(_0x30c568){var _0x2388a5={};_0x2388a5[_0x30c568]={'$like':'%'+_0x51c485['query'][_0xa4e8('0x57')]+'%'};return _0x2388a5;})});}_0x1687d3=_['merge']({},_0x1687d3,_0x51c485[_0xa4e8('0x59')]);return _0x12cc57[_0xa4e8('0x11f')](_0x1687d3);}})[_0xa4e8('0x2d')](function(_0x1096a0){if(_0x1096a0){_0x4ab294=_0x1096a0['length'];if(!_0x51c485[_0xa4e8('0x4c')]['hasOwnProperty'](_0xa4e8('0x54'))){_0x1687d3[_0xa4e8('0x28')]=qs[_0xa4e8('0x28')](_0x51c485['query'][_0xa4e8('0x28')]);_0x1687d3[_0xa4e8('0x26')]=qs[_0xa4e8('0x26')](_0x51c485[_0xa4e8('0x4c')][_0xa4e8('0x26')]);}return _0x12cc57[_0xa4e8('0x11f')](_0x1687d3);}})[_0xa4e8('0x2d')](function(_0x3a3b36){if(_0x3a3b36){return _0x3a3b36?{'count':_0x4ab294,'rows':_0x3a3b36}:null;}})[_0xa4e8('0x2d')](respondWithResult(_0x7acadd,null))[_0xa4e8('0x23')](handleError(_0x7acadd,null));};exports['addProactiveActions']=function(_0x253bc0,_0x4b9dc9){return db[_0xa4e8('0x120')][_0xa4e8('0x63')]({'where':{'id':_0x253bc0[_0xa4e8('0x60')]['id']}})[_0xa4e8('0x2d')](handleEntityNotFound(_0x4b9dc9,null))[_0xa4e8('0x2d')](function(_0xc8d20c){if(_0xc8d20c){return _0xc8d20c[_0xa4e8('0x121')](_0x253bc0[_0xa4e8('0x65')][_0xa4e8('0x79')],_['omit'](_0x253bc0['body'],['ids','id'])||{});}})[_0xa4e8('0x2d')](respondWithResult(_0x4b9dc9,null))[_0xa4e8('0x23')](handleError(_0x4b9dc9,null));};exports[_0xa4e8('0x101')]=function(_0x40d14a,_0x3bb732){var _0x21b784={};var _0x204b95={};var _0x19dbc9;var _0x4da7c1;return db[_0xa4e8('0x49')][_0xa4e8('0x76')]({'where':{'id':_0x40d14a[_0xa4e8('0x60')]['id']}})[_0xa4e8('0x2d')](handleEntityNotFound(_0x3bb732,null))[_0xa4e8('0x2d')](function(_0x32e442){if(_0x32e442){_0x19dbc9=_0x32e442;_0x204b95[_0xa4e8('0x43')]=_[_0xa4e8('0x4d')](db[_0xa4e8('0x122')][_0xa4e8('0x62')]);_0x204b95[_0xa4e8('0x4c')]=_[_0xa4e8('0x4d')](_0x40d14a[_0xa4e8('0x4c')]);_0x204b95['filters']=_['intersection'](_0x204b95[_0xa4e8('0x43')],_0x204b95[_0xa4e8('0x4c')]);_0x21b784[_0xa4e8('0x50')]=_['intersection'](_0x204b95[_0xa4e8('0x43')],qs[_0xa4e8('0x51')](_0x40d14a[_0xa4e8('0x4c')][_0xa4e8('0x51')]));_0x21b784['attributes']=_0x21b784['attributes']['length']?_0x21b784[_0xa4e8('0x50')]:_0x204b95[_0xa4e8('0x43')];_0x21b784['order']=qs[_0xa4e8('0x56')](_0x40d14a['query'][_0xa4e8('0x56')]);_0x21b784[_0xa4e8('0x5a')]=qs[_0xa4e8('0x4e')](_[_0xa4e8('0x77')](_0x40d14a[_0xa4e8('0x4c')],_0x204b95[_0xa4e8('0x4e')]));if(_0x40d14a['query'][_0xa4e8('0x57')]){_0x21b784['where']=_['merge'](_0x21b784['where'],{'$or':_['map'](_0x21b784['attributes'],function(_0x8712e7){var _0x4f52ba={};_0x4f52ba[_0x8712e7]={'$like':'%'+_0x40d14a[_0xa4e8('0x4c')]['filter']+'%'};return _0x4f52ba;})});}_0x21b784=_[_0xa4e8('0x58')]({},_0x21b784,_0x40d14a[_0xa4e8('0x59')]);return _0x19dbc9[_0xa4e8('0x101')](_0x21b784);}})[_0xa4e8('0x2d')](function(_0x20d03e){if(_0x20d03e){_0x4da7c1=_0x20d03e[_0xa4e8('0x52')];if(!_0x40d14a['query'][_0xa4e8('0x53')](_0xa4e8('0x54'))){_0x21b784['limit']=qs['limit'](_0x40d14a[_0xa4e8('0x4c')]['limit']);_0x21b784['offset']=qs[_0xa4e8('0x26')](_0x40d14a[_0xa4e8('0x4c')][_0xa4e8('0x26')]);}return _0x19dbc9[_0xa4e8('0x101')](_0x21b784);}})[_0xa4e8('0x2d')](function(_0xbb5378){if(_0xbb5378){return _0xbb5378?{'count':_0x4da7c1,'rows':_0xbb5378}:null;}})['then'](respondWithResult(_0x3bb732,null))[_0xa4e8('0x23')](handleError(_0x3bb732,null));};exports[_0xa4e8('0x123')]=function(_0x59d382,_0x4c79eb){var _0x18cbcc=_0x59d382['query'][_0xa4e8('0x124')]===_0xa4e8('0x125')?_0xa4e8('0x126'):_0xa4e8('0x127');return db[_0xa4e8('0x49')][_0xa4e8('0x63')]({'attributes':['id',_0x18cbcc],'where':{'id':_0x59d382[_0xa4e8('0x60')]['id']}})[_0xa4e8('0x2d')](handleEntityNotFound(_0x4c79eb,null))[_0xa4e8('0x2d')](function(_0x8583ff){if(_0x8583ff){var _0x5c7c9b=_0x8583ff[_0x18cbcc];var _0x15ee6e=_0x5c7c9b&&_0x5c7c9b[_0xa4e8('0x128')]?_0x5c7c9b[_0xa4e8('0x128')]:[];_0x4c79eb[_0xa4e8('0x33')]({'fromKey':_[_0xa4e8('0x87')](_0x5c7c9b[_0xa4e8('0x129')])?undefined:_0x5c7c9b[_0xa4e8('0x129')],'count':_0x15ee6e[_0xa4e8('0x52')],'rows':_0x15ee6e});}})[_0xa4e8('0x23')](handleError(_0x4c79eb,null));};exports[_0xa4e8('0x12a')]=function(_0x2b496d,_0x3bb4b9){var _0x4e62b6={'raw':![],'where':{}};var _0x4b9075={};var _0x56a5f2={'count':0x0,'rows':[]};return db[_0xa4e8('0x49')][_0xa4e8('0x76')]({'where':{'id':_0x2b496d[_0xa4e8('0x60')]['id']}})['then'](handleEntityNotFound(_0x3bb4b9,null))[_0xa4e8('0x2d')](function(_0x3f8703){if(_0x3f8703){_0x4b9075[_0xa4e8('0x43')]=_[_0xa4e8('0x4d')](db[_0xa4e8('0x12b')][_0xa4e8('0x62')]);_0x4b9075[_0xa4e8('0x4c')]=_[_0xa4e8('0x4d')](_0x2b496d[_0xa4e8('0x4c')]);_0x4b9075['filters']=_[_0xa4e8('0x4f')](_0x4b9075['model'],_0x4b9075[_0xa4e8('0x4c')]);_0x4e62b6[_0xa4e8('0x50')]=_[_0xa4e8('0x4f')](_0x4b9075[_0xa4e8('0x43')],qs[_0xa4e8('0x51')](_0x2b496d[_0xa4e8('0x4c')]['fields']));_0x4e62b6[_0xa4e8('0x50')]=_0x4e62b6[_0xa4e8('0x50')][_0xa4e8('0x52')]?_0x4e62b6[_0xa4e8('0x50')]:_0x4b9075[_0xa4e8('0x43')];if(!_0x2b496d['query'][_0xa4e8('0x53')](_0xa4e8('0x54'))){_0x4e62b6['limit']=qs[_0xa4e8('0x28')](_0x2b496d[_0xa4e8('0x4c')][_0xa4e8('0x28')]);_0x4e62b6[_0xa4e8('0x26')]=qs[_0xa4e8('0x26')](_0x2b496d[_0xa4e8('0x4c')][_0xa4e8('0x26')]);}_0x4e62b6[_0xa4e8('0x55')]=qs['sort'](_0x2b496d[_0xa4e8('0x4c')][_0xa4e8('0x56')]);_0x4e62b6[_0xa4e8('0x5a')]=qs[_0xa4e8('0x4e')](_['pick'](_0x2b496d[_0xa4e8('0x4c')],_0x4b9075[_0xa4e8('0x4e')]));_0x4e62b6[_0xa4e8('0x5a')][_0xa4e8('0x70')]=_0x3f8703['id'];if(_0x2b496d['query'][_0xa4e8('0x57')]){_0x4e62b6[_0xa4e8('0x5a')]=_[_0xa4e8('0x58')](_0x4e62b6['where'],{'$or':_[_0xa4e8('0x48')](_0x4e62b6[_0xa4e8('0x50')],function(_0x5c18ad){var _0x1b4d99={};_0x1b4d99[_0x5c18ad]={'$like':'%'+_0x2b496d['query']['filter']+'%'};return _0x1b4d99;})});}_0x4e62b6=_['merge']({},_0x4e62b6,_0x2b496d[_0xa4e8('0x59')]);return db[_0xa4e8('0x12b')]['count']({'where':_0x4e62b6[_0xa4e8('0x5a')]})[_0xa4e8('0x2d')](function(_0x3436d5){_0x56a5f2[_0xa4e8('0x29')]=_0x3436d5;if(_0x2b496d[_0xa4e8('0x4c')][_0xa4e8('0x5b')]){_0x4e62b6[_0xa4e8('0x5c')]=[{'all':!![]}];}else{_0x4e62b6['include']=[{'model':db[_0xa4e8('0xa1')],'as':_0xa4e8('0xf9'),'required':![]},{'model':db[_0xa4e8('0x12c')],'as':_0xa4e8('0x12d'),'required':![]}];}return db[_0xa4e8('0x12b')][_0xa4e8('0x5d')](_0x4e62b6);})[_0xa4e8('0x2d')](function(_0x4a5717){_0x56a5f2['rows']=_0x4a5717;return _0x56a5f2;});}})['then'](respondWithFilteredResult(_0x3bb4b9,_0x4e62b6))[_0xa4e8('0x23')](handleError(_0x3bb4b9,null));};exports[_0xa4e8('0x12e')]=function(_0x2f2479,_0x2c21e0){return db[_0xa4e8('0x49')]['find']({'where':{'id':_0x2f2479[_0xa4e8('0x60')]['id']}})[_0xa4e8('0x2d')](handleEntityNotFound(_0x2c21e0,null))['then'](function(_0x2e9a16){if(_0x2e9a16){return _0x2e9a16['addAgents'](_0x2f2479[_0xa4e8('0x65')][_0xa4e8('0x79')],_[_0xa4e8('0x12f')](_0x2f2479[_0xa4e8('0x65')],['ids','id'])||{})['spread'](function(_0x5f0207){for(var _0x847eef=0x0;_0x847eef<_0x2f2479[_0xa4e8('0x65')][_0xa4e8('0x79')][_0xa4e8('0x52')];_0x847eef+=0x1){socket[_0xa4e8('0x130')](_0xa4e8('0x131'),{'UserId':Number(_0x2f2479[_0xa4e8('0x65')]['ids'][_0x847eef]),'ChatWebsiteId':Number(_0x2f2479['params']['id'])});}return _0x5f0207;});}})['then'](respondWithResult(_0x2c21e0,null))[_0xa4e8('0x23')](handleError(_0x2c21e0,null));};exports[_0xa4e8('0x132')]=function(_0x1da025,_0x2177af){return db[_0xa4e8('0x49')][_0xa4e8('0x63')]({'where':{'id':_0x1da025['params']['id']}})[_0xa4e8('0x2d')](handleEntityNotFound(_0x2177af,null))[_0xa4e8('0x2d')](function(_0x20bda5){if(_0x20bda5){return _0x20bda5[_0xa4e8('0x132')](_0x1da025['query'][_0xa4e8('0x79')])[_0xa4e8('0x2d')](function(){if(_['isArray'](_0x1da025[_0xa4e8('0x4c')]['ids'])){for(var _0xe4bb7d=0x0;_0xe4bb7d<_0x1da025[_0xa4e8('0x4c')]['ids'][_0xa4e8('0x52')];_0xe4bb7d+=0x1){socket[_0xa4e8('0x130')]('userChatWebsite:remove',{'UserId':Number(_0x1da025[_0xa4e8('0x4c')][_0xa4e8('0x79')][_0xe4bb7d]),'ChatWebsiteId':Number(_0x1da025['params']['id'])});}}else{socket['emit'](_0xa4e8('0x133'),{'UserId':Number(_0x1da025[_0xa4e8('0x4c')][_0xa4e8('0x79')]),'ChatWebsiteId':Number(_0x1da025[_0xa4e8('0x60')]['id'])});}});}})['then'](respondWithStatusCode(_0x2177af,null))['catch'](handleError(_0x2177af,null));};exports[_0xa4e8('0x134')]=function(_0x555a54,_0x50282e){var _0x18ae6c={};var _0x174902={};var _0x2fde66;var _0x1385dc;return db[_0xa4e8('0x49')][_0xa4e8('0x76')]({'where':{'id':_0x555a54[_0xa4e8('0x60')]['id']}})[_0xa4e8('0x2d')](handleEntityNotFound(_0x50282e,null))[_0xa4e8('0x2d')](function(_0x2ca2c1){if(_0x2ca2c1){_0x2fde66=_0x2ca2c1;_0x174902[_0xa4e8('0x43')]=_[_0xa4e8('0x4d')](db[_0xa4e8('0xbe')][_0xa4e8('0x62')]);_0x174902[_0xa4e8('0x4c')]=_[_0xa4e8('0x4d')](_0x555a54[_0xa4e8('0x4c')]);_0x174902['filters']=_[_0xa4e8('0x4f')](_0x174902[_0xa4e8('0x43')],_0x174902['query']);_0x18ae6c[_0xa4e8('0x50')]=_['intersection'](_0x174902['model'],qs[_0xa4e8('0x51')](_0x555a54[_0xa4e8('0x4c')]['fields']));_0x18ae6c[_0xa4e8('0x50')]=_0x18ae6c[_0xa4e8('0x50')][_0xa4e8('0x52')]?_0x18ae6c[_0xa4e8('0x50')]:_0x174902[_0xa4e8('0x43')];_0x18ae6c[_0xa4e8('0x55')]=qs[_0xa4e8('0x56')](_0x555a54[_0xa4e8('0x4c')]['sort']);_0x18ae6c['where']=qs[_0xa4e8('0x4e')](_[_0xa4e8('0x77')](_0x555a54['query'],_0x174902[_0xa4e8('0x4e')]));if(_0x555a54['query'][_0xa4e8('0x57')]){_0x18ae6c['where']=_[_0xa4e8('0x58')](_0x18ae6c[_0xa4e8('0x5a')],{'$or':_[_0xa4e8('0x48')](_0x18ae6c[_0xa4e8('0x50')],function(_0x146677){var _0x44434c={};_0x44434c[_0x146677]={'$like':'%'+_0x555a54['query'][_0xa4e8('0x57')]+'%'};return _0x44434c;})});}_0x18ae6c=_[_0xa4e8('0x58')]({},_0x18ae6c,_0x555a54['options']);return _0x2fde66[_0xa4e8('0x134')](_0x18ae6c);}})[_0xa4e8('0x2d')](function(_0x34c077){if(_0x34c077){_0x1385dc=_0x34c077[_0xa4e8('0x52')];if(!_0x555a54[_0xa4e8('0x4c')]['hasOwnProperty'](_0xa4e8('0x54'))){_0x18ae6c[_0xa4e8('0x28')]=qs[_0xa4e8('0x28')](_0x555a54['query']['limit']);_0x18ae6c[_0xa4e8('0x26')]=qs[_0xa4e8('0x26')](_0x555a54[_0xa4e8('0x4c')][_0xa4e8('0x26')]);}return _0x2fde66[_0xa4e8('0x134')](_0x18ae6c);}})['then'](function(_0x2b6896){if(_0x2b6896){return _0x2b6896?{'count':_0x1385dc,'rows':_0x2b6896}:null;}})['then'](respondWithResult(_0x50282e,null))[_0xa4e8('0x23')](handleError(_0x50282e,null));};
\ No newline at end of file
+var _0xb191=['rows','removeDispositions','ids','ChatWebsiteId','CannedAnswer','getAnswers','includeAll','removeAnswers','sitepic','file','filename','addAvatar','agentAvatar','addCustomerAvatar','addSystemAvatar','systemAvatar','getLogo','join','root','../../config/license/util','custom','isNil','existsSync','server/files/images/logos/','download','server/files/images/avatars/default_avatar.png','server/files/images/avatars/','getCustomerAvatar','server/files/images/avatars/customer_avatar.png','customerAvatar','showCustomerAvatar','getSystemAvatar','Interval','resolve','timezone','From\x20is\x20mandatory','MapKey\x20is\x20mandatory','isEmpty','Body\x20is\x20mandatory','CmContact','No\x20available\x20attributes','createdAt','updatedAt','includes','ListId','Invalid\x20MapKey\x20parameter.\x20Allowed\x20values:\x20','from','List','DESC','ChatApplication','Applications','Intervals','interval','Chat\x20Website\x20with\x20id\x20%s\x20not\x20found','account','applications','orderBy','priority','asc','list','Contacts','mapKey','contact','headers','threadId','customerIp','closed','Writing\x20on\x20closed\x20interaction','externalUrl','ChatInteraction','interaction','messageId','created','autoclose','push','unmanaged','*,*,*,*','ChatMessage','AttachmentId','UserId','User','unshift','waitForTheAssignedAgent','forcedOwnership','queueId','waitForTheAssignedQueue','Start','startRouting','EventManager','notify','files','no\x20available\x20attributes','difference','Sequelize','ValidationError','from\x20is\x20mandatory','mapKeyOffline','mapKeyOffline\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','MailAccount','findOrCreate','spread','readFileSync','utf8','render','toPairs','offlineMessageBody','ChatOfflineMessage','originalname','mimetype','server','attachments','offline-chat','openNewInteraction','sequelize','transaction','Attachment','findOne','Smtp','CloudProvider','forwardOffline','forwardOfflineAddress','getSmtpOptions','sendMail','\x22%s\x22\x20<%s>','email','offlineMessageSubject','MailAccountId','subjectOffline','toPairsIn','mapValues','Chat','NotifyMailAccount','notifyMail','remove','Could\x20not\x20remove\x20attachment\x20file','addInteraction','omit','getInteractions','Contact','Owner','fullname','internal','Tag','Tags','color','tag','getSnippet','getLicense','virtual','License','chatLicenseExceeded','server/files/chat/iframe.ejs','3.9.0','origin','http://localhost:9000','testWebsiteWithWildcard','remote','connection','remoteAddress','verticalAlignment','labelText','textColor','textButtonColor','color_button','backgroundColor','hideWhenOffline','Transaction','ISOLATION_LEVELS','READ_COMMITTED','bulkCreate','findAndCountAll','getApplications','addProactiveActions','chatProactiveAction','getProactiveActions','getFields','offlineForm','items','fromKey','getOfflineMessages','Attachments','addAgents','emit','userChatWebsite:save','removeAgents','userChatWebsite:remove','getAgents','mustache','util','path','lodash','querystring','ioredis','jayson/promise','../../config/logger','api','../../config/environment','APIBadRequestError','../../errors/api','APINotFoundError','APIOutOfIntervalError','APIConflictError','url','../../mysqldb','redis','defaults','localhost','./chatWebsite.socket','register','client','http','request','info','ChatWebsite,\x20%s,\x20%s,\x20%s','stringify','error','code','message','ChatWebsite,\x20%s,\x20%s','request\x20sent','result','sendStatus','status','end','json','offset','limit','undefined','count','Content-Range','then','destroy','get','ChatWebsites','UserProfileResource','stack','name','send','user-agent-parser','setUA','user-agent','getResult','cf-connecting-ip','x-forwarded-for','first','firstName','lastName','x-real-port','referer','browser','version','format','%s\x20%s','unknown','device','vendor','%s\x20%s\x20%s','type','mandatoryDispositionPause','map','ChatWebsite','fieldName','key','model','query','keys','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','where','filters','filter','merge','options','include','show','params','Pause','rawAttributes','find','catch','address','split','trim','testWildcardValidity','\x22\x20is\x20not\x20a\x20valid\x20wildcard\x20expression','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','forEach','describe','addDisposition','Disposition','getDispositions','sort','pick','findAll'];(function(_0x1626bd,_0x40a7a9){var _0x16c735=function(_0x42a37b){while(--_0x42a37b){_0x1626bd['push'](_0x1626bd['shift']());}};_0x16c735(++_0x40a7a9);}(_0xb191,0x1ed));var _0x1b19=function(_0x16e007,_0x4f727c){_0x16e007=_0x16e007-0x0;var _0x2f7681=_0xb191[_0x16e007];return _0x2f7681;};'use strict';var Mustache=require(_0x1b19('0x0'));var util=require(_0x1b19('0x1'));var path=require(_0x1b19('0x2'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x1b19('0x3'));var querystring=require(_0x1b19('0x4'));var htmlToText=require('html-to-text');var Redis=require(_0x1b19('0x5'));var jayson=require(_0x1b19('0x6'));var qs=require('../../components/parsers/qs');var logger=require(_0x1b19('0x7'))(_0x1b19('0x8'));var config=require(_0x1b19('0x9'));var APIBadRequestError=require('../../errors/api')[_0x1b19('0xa')];var APINotFoundError=require(_0x1b19('0xb'))[_0x1b19('0xc')];var APIOutOfIntervalError=require(_0x1b19('0xb'))[_0x1b19('0xd')];var APIHandleError=require(_0x1b19('0xb'))['handleError'];var APIConflictError=require(_0x1b19('0xb'))[_0x1b19('0xe')];var wildcardUtils=require('./helpers/wildcard-expressions');var URL=require(_0x1b19('0xf'))['URL'];var db=require(_0x1b19('0x10'))['db'];config[_0x1b19('0x11')]=_[_0x1b19('0x12')](config[_0x1b19('0x11')],{'host':_0x1b19('0x13'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x1b19('0x11')]));require(_0x1b19('0x14'))[_0x1b19('0x15')](socket);var client=jayson[_0x1b19('0x16')][_0x1b19('0x17')]({'port':0x232c});var client9002=jayson[_0x1b19('0x16')]['http']({'port':0x232a});var client9003=jayson[_0x1b19('0x16')]['http']({'port':0x232b});var client9001=jayson[_0x1b19('0x16')]['http']({'port':0x2329});function respondWithRpcPromise(_0x111564,_0x13f917,_0x11c6a3,_0x36e21a){return new Promise(function(_0x1286f2,_0x25a8e2){var _0x560880=_0x36e21a||client;return _0x560880[_0x1b19('0x18')](_0x111564,_0x11c6a3)['then'](function(_0x36424a){logger[_0x1b19('0x19')]('ChatWebsite,\x20%s,\x20%s',_0x13f917,'request\x20sent');logger['debug'](_0x1b19('0x1a'),_0x13f917,'request\x20sent',JSON[_0x1b19('0x1b')](_0x36424a));if(_0x36424a['error']){if(_0x36424a[_0x1b19('0x1c')][_0x1b19('0x1d')]===0x1f4){logger['error']('ChatWebsite,\x20%s,\x20%s',_0x13f917,_0x36424a[_0x1b19('0x1c')][_0x1b19('0x1e')]);return _0x25a8e2(_0x36424a[_0x1b19('0x1c')][_0x1b19('0x1e')]);}logger['error']('ChatWebsite,\x20%s,\x20%s',_0x13f917,_0x36424a[_0x1b19('0x1c')]['message']);return _0x1286f2(_0x36424a[_0x1b19('0x1c')][_0x1b19('0x1e')]);}else{logger[_0x1b19('0x19')](_0x1b19('0x1f'),_0x13f917,_0x1b19('0x20'));_0x1286f2(_0x36424a[_0x1b19('0x21')]['message']);}})['catch'](function(_0x40d8bc){logger[_0x1b19('0x1c')]('ChatWebsite,\x20%s,\x20%s',_0x13f917,_0x40d8bc);_0x25a8e2(_0x40d8bc);});});}function respondWithStatusCode(_0x5675d6,_0x515d58){_0x515d58=_0x515d58||0xcc;return function(_0x1ea1d1){if(_0x1ea1d1){return _0x5675d6[_0x1b19('0x22')](_0x515d58);}return _0x5675d6[_0x1b19('0x23')](_0x515d58)[_0x1b19('0x24')]();};}function respondWithResult(_0x2105e9,_0x497622){_0x497622=_0x497622||0xc8;return function(_0x350d6f){if(_0x350d6f){return _0x2105e9['status'](_0x497622)[_0x1b19('0x25')](_0x350d6f);}};}function respondWithFilteredResult(_0x3214f1,_0x54dbf3){return function(_0x151064){if(_0x151064){var _0x484791=typeof _0x54dbf3[_0x1b19('0x26')]==='undefined'&&typeof _0x54dbf3[_0x1b19('0x27')]===_0x1b19('0x28');var _0x43d06f=_0x151064[_0x1b19('0x29')];var _0xe277de=_0x484791?0x0:_0x54dbf3[_0x1b19('0x26')];var _0x487682=_0x484791?_0x151064[_0x1b19('0x29')]:_0x54dbf3[_0x1b19('0x26')]+_0x54dbf3[_0x1b19('0x27')];var _0x247aae;if(_0x487682>=_0x43d06f){_0x487682=_0x43d06f;_0x247aae=0xc8;}else{_0x247aae=0xce;}_0x3214f1['status'](_0x247aae);return _0x3214f1['set'](_0x1b19('0x2a'),_0xe277de+'-'+_0x487682+'/'+_0x43d06f)[_0x1b19('0x25')](_0x151064);}return null;};}function saveUpdates(_0x4cb1f8){return function(_0x2e691a){if(_0x2e691a){return _0x2e691a['update'](_0x4cb1f8)[_0x1b19('0x2b')](function(_0x15b281){return _0x15b281;});}return null;};}function removeEntity(_0xc85352){return function(_0x13aadc){if(_0x13aadc){return _0x13aadc[_0x1b19('0x2c')]()[_0x1b19('0x2b')](function(){var _0x261a4e=_0x13aadc[_0x1b19('0x2d')]({'plain':!![]});var _0x13a076=_0x1b19('0x2e');return db[_0x1b19('0x2f')][_0x1b19('0x2c')]({'where':{'type':_0x13a076,'resourceId':_0x261a4e['id']}})[_0x1b19('0x2b')](function(){return _0x13aadc;});})[_0x1b19('0x2b')](function(){_0xc85352[_0x1b19('0x23')](0xcc)[_0x1b19('0x24')]();});}};}function handleEntityNotFound(_0x5a9ad1){return function(_0x554fd3){if(!_0x554fd3){_0x5a9ad1['sendStatus'](0x194);}return _0x554fd3;};}function handleError(_0x25e3ef,_0xdb8f14){_0xdb8f14=_0xdb8f14||0x1f4;return function(_0x5a3968){logger['error'](_0x5a3968[_0x1b19('0x30')]);if(_0x5a3968[_0x1b19('0x31')]){delete _0x5a3968['name'];}_0x25e3ef[_0x1b19('0x23')](_0xdb8f14)[_0x1b19('0x32')](_0x5a3968);};}function createInteractionObject(_0x2daac6,_0x1713c8,_0x862c4f,_0x34f30f){var _0x5bc1c4=require(_0x1b19('0x33'));var _0x371955=new _0x5bc1c4();var _0x2ae258=_0x371955[_0x1b19('0x34')](_0x862c4f[_0x1b19('0x35')])[_0x1b19('0x36')]();var _0x479e67=_0x1713c8['customerIp'];if(_0x862c4f['cf-connecting-ip']){_0x479e67=_0x862c4f[_0x1b19('0x37')];}else if(_0x862c4f[_0x1b19('0x38')]){_0x479e67=_[_0x1b19('0x39')](_0x862c4f[_0x1b19('0x38')]['split'](','));}return{'ContactId':_0x34f30f['id'],'ChatWebsiteId':_0x2daac6,'from':(_0x34f30f[_0x1b19('0x3a')]||'')+'\x20'+(_0x34f30f[_0x1b19('0x3b')]||''),'customerIp':_0x479e67,'customerPort':_0x862c4f[_0x1b19('0x3c')]?_0x862c4f[_0x1b19('0x3c')]:null,'referer':_0x1713c8[_0x1b19('0x3d')],'browserName':_0x2ae258[_0x1b19('0x3e')][_0x1b19('0x31')]&&_0x2ae258[_0x1b19('0x3e')][_0x1b19('0x3f')]?util[_0x1b19('0x40')](_0x1b19('0x41'),_0x2ae258[_0x1b19('0x3e')]['name'],_0x2ae258[_0x1b19('0x3e')][_0x1b19('0x3f')]):_0x1b19('0x42'),'browserVersion':_0x2ae258['browser'][_0x1b19('0x3f')]||_0x1b19('0x42'),'osName':util['format']('%s\x20%s',_0x2ae258['os'][_0x1b19('0x31')],_0x2ae258['os']['version']),'osVersion':_0x2ae258['os'][_0x1b19('0x3f')],'deviceModel':_0x2ae258[_0x1b19('0x43')]['model']&&_0x2ae258[_0x1b19('0x43')][_0x1b19('0x44')]?util[_0x1b19('0x40')](_0x1b19('0x45'),_0x2ae258[_0x1b19('0x43')]['model'],_0x2ae258[_0x1b19('0x43')][_0x1b19('0x44')],_0x2ae258[_0x1b19('0x43')]['type']):null,'deviceVendor':_0x2ae258[_0x1b19('0x43')]['vendor'],'deviceType':_0x2ae258[_0x1b19('0x43')][_0x1b19('0x46')],'formData':JSON['stringify'](_0x1713c8)};}exports['index']=function(_0x1ee644,_0x45e1dc){var _0x15620d={'include':[{'model':db['Pause'],'as':_0x1b19('0x47')}]},_0x2047eb={},_0x1568c8={'count':0x0,'rows':[]};var _0x30fcb6=_[_0x1b19('0x48')](db[_0x1b19('0x49')]['rawAttributes'],function(_0x1e12fd){return{'name':_0x1e12fd[_0x1b19('0x4a')],'type':_0x1e12fd[_0x1b19('0x46')][_0x1b19('0x4b')]};});_0x2047eb[_0x1b19('0x4c')]=_[_0x1b19('0x48')](_0x30fcb6,'name');_0x2047eb[_0x1b19('0x4d')]=_[_0x1b19('0x4e')](_0x1ee644['query']);_0x2047eb['filters']=_[_0x1b19('0x4f')](_0x2047eb['model'],_0x2047eb[_0x1b19('0x4d')]);_0x15620d[_0x1b19('0x50')]=_['intersection'](_0x2047eb[_0x1b19('0x4c')],qs[_0x1b19('0x51')](_0x1ee644[_0x1b19('0x4d')]['fields']));_0x15620d[_0x1b19('0x50')]=_0x15620d['attributes'][_0x1b19('0x52')]?_0x15620d[_0x1b19('0x50')]:_0x2047eb[_0x1b19('0x4c')];if(!_0x1ee644[_0x1b19('0x4d')][_0x1b19('0x53')](_0x1b19('0x54'))){_0x15620d['limit']=qs[_0x1b19('0x27')](_0x1ee644['query'][_0x1b19('0x27')]);_0x15620d['offset']=qs[_0x1b19('0x26')](_0x1ee644[_0x1b19('0x4d')]['offset']);}_0x15620d[_0x1b19('0x55')]=qs['sort'](_0x1ee644[_0x1b19('0x4d')]['sort']);_0x15620d[_0x1b19('0x56')]=qs[_0x1b19('0x57')](_['pick'](_0x1ee644[_0x1b19('0x4d')],_0x2047eb[_0x1b19('0x57')]),_0x30fcb6);if(_0x1ee644[_0x1b19('0x4d')][_0x1b19('0x58')]){_0x15620d[_0x1b19('0x56')]=_['merge'](_0x15620d['where'],{'$or':_[_0x1b19('0x48')](_0x30fcb6,function(_0x4ac615){if(_0x4ac615[_0x1b19('0x46')]!=='VIRTUAL'){var _0x57a8e8={};_0x57a8e8[_0x4ac615[_0x1b19('0x31')]]={'$like':'%'+_0x1ee644[_0x1b19('0x4d')][_0x1b19('0x58')]+'%'};return _0x57a8e8;}})});}_0x15620d=_[_0x1b19('0x59')]({},_0x15620d,_0x1ee644[_0x1b19('0x5a')]);var _0x4fbe95={'where':_0x15620d[_0x1b19('0x56')]};return db[_0x1b19('0x49')][_0x1b19('0x29')](_0x4fbe95)[_0x1b19('0x2b')](function(_0x3300b3){_0x1568c8[_0x1b19('0x29')]=_0x3300b3;if(_0x1ee644[_0x1b19('0x4d')]['includeAll']){_0x15620d[_0x1b19('0x5b')]=[{'all':!![]}];}return db[_0x1b19('0x49')]['findAll'](_0x15620d);})[_0x1b19('0x2b')](function(_0x25aebd){_0x1568c8['rows']=_0x25aebd;return _0x1568c8;})[_0x1b19('0x2b')](respondWithFilteredResult(_0x45e1dc,_0x15620d))['catch'](handleError(_0x45e1dc,null));};exports[_0x1b19('0x5c')]=function(_0x56075f,_0x5f1b3d){var _0x2e3b1b={'raw':![],'where':{'id':_0x56075f[_0x1b19('0x5d')]['id']},'include':[{'model':db[_0x1b19('0x5e')],'as':'mandatoryDispositionPause'}]},_0x3ea1c5={};_0x3ea1c5[_0x1b19('0x4c')]=_['keys'](db[_0x1b19('0x49')][_0x1b19('0x5f')]);_0x3ea1c5[_0x1b19('0x4d')]=_[_0x1b19('0x4e')](_0x56075f['query']);_0x3ea1c5['filters']=_[_0x1b19('0x4f')](_0x3ea1c5[_0x1b19('0x4c')],_0x3ea1c5[_0x1b19('0x4d')]);_0x2e3b1b[_0x1b19('0x50')]=_[_0x1b19('0x4f')](_0x3ea1c5[_0x1b19('0x4c')],qs[_0x1b19('0x51')](_0x56075f[_0x1b19('0x4d')][_0x1b19('0x51')]));_0x2e3b1b[_0x1b19('0x50')]=_0x2e3b1b['attributes'][_0x1b19('0x52')]?_0x2e3b1b[_0x1b19('0x50')]:_0x3ea1c5['model'];if(_0x56075f[_0x1b19('0x4d')]['includeAll']){_0x2e3b1b[_0x1b19('0x5b')]=[{'all':!![]}];}_0x2e3b1b=_[_0x1b19('0x59')]({},_0x2e3b1b,_0x56075f[_0x1b19('0x5a')]);return db[_0x1b19('0x49')][_0x1b19('0x60')](_0x2e3b1b)[_0x1b19('0x2b')](handleEntityNotFound(_0x5f1b3d,null))[_0x1b19('0x2b')](respondWithResult(_0x5f1b3d,null))[_0x1b19('0x61')](handleError(_0x5f1b3d,null));};exports['create']=function(_0x1a4bac,_0x45c5b8){var _0x1d2631=null;_0x1a4bac['body'][_0x1b19('0x62')][_0x1b19('0x63')](',')['forEach'](_0x1a4ae5=>{if(_0x1a4ae5[_0x1b19('0x64')]()!==''&&!wildcardUtils[_0x1b19('0x65')](_0x1a4ae5['trim']())){_0x1d2631=new APIBadRequestError('\x22'+_0x1a4ae5+_0x1b19('0x66'));}});if(_0x1d2631){return handleError(_0x45c5b8,null)(_0x1d2631);}return db['ChatWebsite'][_0x1b19('0x67')](_0x1a4bac[_0x1b19('0x68')],{})[_0x1b19('0x2b')](function(_0xa94ac8){var _0x4dae46=_0x1a4bac[_0x1b19('0x69')]['get']({'plain':!![]});if(!_0x4dae46)throw new Error(_0x1b19('0x6a'));if(_0x4dae46['role']==='user'){var _0x49d7d5=_0xa94ac8[_0x1b19('0x2d')]({'plain':!![]});var _0x3cb0bb='ChatWebsites';return db[_0x1b19('0x6b')][_0x1b19('0x60')]({'where':{'name':_0x3cb0bb,'userProfileId':_0x4dae46[_0x1b19('0x6c')]},'raw':!![]})[_0x1b19('0x2b')](function(_0x505dc0){if(_0x505dc0&&_0x505dc0['autoAssociation']===0x0){return db[_0x1b19('0x2f')][_0x1b19('0x67')]({'name':_0x49d7d5[_0x1b19('0x31')],'resourceId':_0x49d7d5['id'],'type':_0x505dc0['name'],'sectionId':_0x505dc0['id']},{})['then'](function(){return _0xa94ac8;});}else{return _0xa94ac8;}})['catch'](function(_0x410221){logger[_0x1b19('0x1c')](_0x1b19('0x6d'),_0x410221);throw _0x410221;});}return _0xa94ac8;})[_0x1b19('0x2b')](respondWithResult(_0x45c5b8,0xc9))[_0x1b19('0x61')](handleError(_0x45c5b8,null));};exports[_0x1b19('0x6e')]=function(_0x31a672,_0x2cca5e){var _0x285689=null;_0x31a672['body'][_0x1b19('0x62')][_0x1b19('0x63')](',')[_0x1b19('0x6f')](_0x426812=>{if(_0x426812[_0x1b19('0x64')]()!==''&&!wildcardUtils[_0x1b19('0x65')](_0x426812[_0x1b19('0x64')]())){_0x285689=new APIBadRequestError('\x22'+_0x426812+_0x1b19('0x66'));}});if(_0x285689){return handleError(_0x2cca5e,null)(_0x285689);}if(_0x31a672[_0x1b19('0x68')]['id']){delete _0x31a672['body']['id'];}return db['ChatWebsite'][_0x1b19('0x60')]({'where':{'id':_0x31a672[_0x1b19('0x5d')]['id']},'include':[{'model':db[_0x1b19('0x5e')],'as':_0x1b19('0x47')}]})['then'](handleEntityNotFound(_0x2cca5e,null))[_0x1b19('0x2b')](saveUpdates(_0x31a672[_0x1b19('0x68')],null))['then'](respondWithResult(_0x2cca5e,null))[_0x1b19('0x61')](handleError(_0x2cca5e,null));};exports['destroy']=function(_0x555b56,_0x2ef299){return db['ChatWebsite'][_0x1b19('0x60')]({'where':{'id':_0x555b56[_0x1b19('0x5d')]['id']}})[_0x1b19('0x2b')](handleEntityNotFound(_0x2ef299,null))[_0x1b19('0x2b')](removeEntity(_0x2ef299,null))['catch'](handleError(_0x2ef299,null));};exports[_0x1b19('0x70')]=function(_0x1cbd87,_0x2473fb){return db[_0x1b19('0x49')][_0x1b19('0x70')]()[_0x1b19('0x2b')](respondWithResult(_0x2473fb,null))[_0x1b19('0x61')](handleError(_0x2473fb,null));};exports[_0x1b19('0x71')]=function(_0xe97a9b,_0x4b6772){if(_0xe97a9b[_0x1b19('0x68')]['id']){delete _0xe97a9b[_0x1b19('0x68')]['id'];}return db[_0x1b19('0x49')][_0x1b19('0x60')]({'where':{'id':_0xe97a9b[_0x1b19('0x5d')]['id']}})[_0x1b19('0x2b')](handleEntityNotFound(_0x4b6772,null))[_0x1b19('0x2b')](function(_0x430eda){if(_0x430eda){_0xe97a9b['body']['ChatWebsiteId']=_0x430eda['id'];return db[_0x1b19('0x72')]['create'](_0xe97a9b[_0x1b19('0x68')]);}})[_0x1b19('0x2b')](respondWithResult(_0x4b6772,null))[_0x1b19('0x61')](handleError(_0x4b6772,null));};exports[_0x1b19('0x73')]=function(_0x5a5d57,_0xf293f9){var _0x27ee6f={'raw':![],'where':{}};var _0x44360e={};var _0x30b942={'count':0x0,'rows':[]};return db[_0x1b19('0x49')]['findOne']({'where':{'id':_0x5a5d57[_0x1b19('0x5d')]['id']}})[_0x1b19('0x2b')](handleEntityNotFound(_0xf293f9,null))[_0x1b19('0x2b')](function(_0xf8c9d5){if(_0xf8c9d5){_0x44360e[_0x1b19('0x4c')]=_[_0x1b19('0x4e')](db[_0x1b19('0x72')][_0x1b19('0x5f')]);_0x44360e[_0x1b19('0x4d')]=_['keys'](_0x5a5d57[_0x1b19('0x4d')]);_0x44360e['filters']=_[_0x1b19('0x4f')](_0x44360e[_0x1b19('0x4c')],_0x44360e['query']);_0x27ee6f[_0x1b19('0x50')]=_['intersection'](_0x44360e[_0x1b19('0x4c')],qs[_0x1b19('0x51')](_0x5a5d57[_0x1b19('0x4d')][_0x1b19('0x51')]));_0x27ee6f[_0x1b19('0x50')]=_0x27ee6f['attributes'][_0x1b19('0x52')]?_0x27ee6f[_0x1b19('0x50')]:_0x44360e['model'];if(!_0x5a5d57['query']['hasOwnProperty'](_0x1b19('0x54'))){_0x27ee6f[_0x1b19('0x27')]=qs[_0x1b19('0x27')](_0x5a5d57['query'][_0x1b19('0x27')]);_0x27ee6f['offset']=qs[_0x1b19('0x26')](_0x5a5d57[_0x1b19('0x4d')][_0x1b19('0x26')]);}_0x27ee6f[_0x1b19('0x55')]=qs[_0x1b19('0x74')](_0x5a5d57[_0x1b19('0x4d')][_0x1b19('0x74')]);_0x27ee6f['where']=qs['filters'](_[_0x1b19('0x75')](_0x5a5d57[_0x1b19('0x4d')],_0x44360e[_0x1b19('0x57')]));_0x27ee6f['where']['ChatWebsiteId']=_0xf8c9d5['id'];if(_0x5a5d57[_0x1b19('0x4d')]['filter']){_0x27ee6f[_0x1b19('0x56')]=_[_0x1b19('0x59')](_0x27ee6f['where'],{'$or':_[_0x1b19('0x48')](_0x27ee6f['attributes'],function(_0x5387c1){var _0x49f795={};_0x49f795[_0x5387c1]={'$like':'%'+_0x5a5d57[_0x1b19('0x4d')]['filter']+'%'};return _0x49f795;})});}_0x27ee6f=_[_0x1b19('0x59')]({},_0x27ee6f,_0x5a5d57['options']);return db[_0x1b19('0x72')]['count']({'where':_0x27ee6f[_0x1b19('0x56')]})['then'](function(_0x5abb64){_0x30b942[_0x1b19('0x29')]=_0x5abb64;if(_0x5a5d57['query']['includeAll']){_0x27ee6f[_0x1b19('0x5b')]=[{'all':!![]}];}return db[_0x1b19('0x72')][_0x1b19('0x76')](_0x27ee6f);})[_0x1b19('0x2b')](function(_0x280d23){_0x30b942[_0x1b19('0x77')]=_0x280d23;return _0x30b942;});}})[_0x1b19('0x2b')](respondWithFilteredResult(_0xf293f9,_0x27ee6f))[_0x1b19('0x61')](handleError(_0xf293f9,null));};exports[_0x1b19('0x78')]=function(_0x56435a,_0x13ffed){return db[_0x1b19('0x49')]['find']({'where':{'id':_0x56435a['params']['id']}})[_0x1b19('0x2b')](handleEntityNotFound(_0x13ffed,null))[_0x1b19('0x2b')](function(_0x39e5ca){if(_0x39e5ca){return _0x39e5ca[_0x1b19('0x78')](_0x56435a[_0x1b19('0x4d')][_0x1b19('0x79')]);}})[_0x1b19('0x2b')](respondWithStatusCode(_0x13ffed,null))[_0x1b19('0x61')](handleError(_0x13ffed,null));};exports['addAnswer']=function(_0x5e0dea,_0x2788c0){if(_0x5e0dea[_0x1b19('0x68')]['id']){delete _0x5e0dea['body']['id'];}return db[_0x1b19('0x49')]['find']({'where':{'id':_0x5e0dea[_0x1b19('0x5d')]['id']}})[_0x1b19('0x2b')](handleEntityNotFound(_0x2788c0,null))['then'](function(_0x34f7c7){if(_0x34f7c7){_0x5e0dea[_0x1b19('0x68')][_0x1b19('0x7a')]=_0x34f7c7['id'];return db[_0x1b19('0x7b')][_0x1b19('0x67')](_0x5e0dea[_0x1b19('0x68')]);}})[_0x1b19('0x2b')](respondWithResult(_0x2788c0,null))[_0x1b19('0x61')](handleError(_0x2788c0,null));};exports[_0x1b19('0x7c')]=function(_0x57f7aa,_0x1a1499){var _0x226b99={'raw':![],'where':{}};var _0x44acca={};var _0x3914af={'count':0x0,'rows':[]};return db[_0x1b19('0x49')]['findOne']({'where':{'id':_0x57f7aa[_0x1b19('0x5d')]['id']}})[_0x1b19('0x2b')](handleEntityNotFound(_0x1a1499,null))[_0x1b19('0x2b')](function(_0x28b523){if(_0x28b523){_0x44acca[_0x1b19('0x4c')]=_[_0x1b19('0x4e')](db['CannedAnswer'][_0x1b19('0x5f')]);_0x44acca[_0x1b19('0x4d')]=_[_0x1b19('0x4e')](_0x57f7aa[_0x1b19('0x4d')]);_0x44acca['filters']=_[_0x1b19('0x4f')](_0x44acca[_0x1b19('0x4c')],_0x44acca['query']);_0x226b99[_0x1b19('0x50')]=_['intersection'](_0x44acca[_0x1b19('0x4c')],qs['fields'](_0x57f7aa['query']['fields']));_0x226b99[_0x1b19('0x50')]=_0x226b99[_0x1b19('0x50')][_0x1b19('0x52')]?_0x226b99['attributes']:_0x44acca['model'];if(!_0x57f7aa['query'][_0x1b19('0x53')](_0x1b19('0x54'))){_0x226b99['limit']=qs[_0x1b19('0x27')](_0x57f7aa[_0x1b19('0x4d')][_0x1b19('0x27')]);_0x226b99['offset']=qs[_0x1b19('0x26')](_0x57f7aa[_0x1b19('0x4d')]['offset']);}_0x226b99[_0x1b19('0x55')]=qs[_0x1b19('0x74')](_0x57f7aa['query']['sort']);_0x226b99[_0x1b19('0x56')]=qs['filters'](_[_0x1b19('0x75')](_0x57f7aa['query'],_0x44acca[_0x1b19('0x57')]));_0x226b99[_0x1b19('0x56')][_0x1b19('0x7a')]=_0x28b523['id'];if(_0x57f7aa[_0x1b19('0x4d')][_0x1b19('0x58')]){_0x226b99[_0x1b19('0x56')]=_[_0x1b19('0x59')](_0x226b99[_0x1b19('0x56')],{'$or':_[_0x1b19('0x48')](_0x226b99['attributes'],function(_0x11a77a){var _0x1ebaef={};_0x1ebaef[_0x11a77a]={'$like':'%'+_0x57f7aa[_0x1b19('0x4d')]['filter']+'%'};return _0x1ebaef;})});}_0x226b99=_[_0x1b19('0x59')]({},_0x226b99,_0x57f7aa[_0x1b19('0x5a')]);return db[_0x1b19('0x7b')][_0x1b19('0x29')]({'where':_0x226b99[_0x1b19('0x56')]})[_0x1b19('0x2b')](function(_0xb5e143){_0x3914af[_0x1b19('0x29')]=_0xb5e143;if(_0x57f7aa['query'][_0x1b19('0x7d')]){_0x226b99[_0x1b19('0x5b')]=[{'all':!![]}];}return db[_0x1b19('0x7b')][_0x1b19('0x76')](_0x226b99);})[_0x1b19('0x2b')](function(_0x2db94e){_0x3914af[_0x1b19('0x77')]=_0x2db94e;return _0x3914af;});}})[_0x1b19('0x2b')](respondWithFilteredResult(_0x1a1499,_0x226b99))[_0x1b19('0x61')](handleError(_0x1a1499,null));};exports['removeAnswers']=function(_0x193ccc,_0x4b4094){return db['ChatWebsite'][_0x1b19('0x60')]({'where':{'id':_0x193ccc['params']['id']}})[_0x1b19('0x2b')](handleEntityNotFound(_0x4b4094,null))[_0x1b19('0x2b')](function(_0x7f38d1){if(_0x7f38d1){return _0x7f38d1[_0x1b19('0x7e')](_0x193ccc['query']['ids']);}})[_0x1b19('0x2b')](respondWithStatusCode(_0x4b4094,null))[_0x1b19('0x61')](handleError(_0x4b4094,null));};exports['addLogo']=function(_0x9aaa10,_0x3b1e33){_0x9aaa10[_0x1b19('0x68')][_0x1b19('0x7f')]=_0x9aaa10[_0x1b19('0x80')][_0x1b19('0x81')];return db[_0x1b19('0x49')][_0x1b19('0x60')]({'where':{'id':_0x9aaa10[_0x1b19('0x5d')]['id']}})[_0x1b19('0x2b')](handleEntityNotFound(_0x3b1e33,null))[_0x1b19('0x2b')](saveUpdates(_0x9aaa10['body'],null))[_0x1b19('0x2b')](respondWithResult(_0x3b1e33,null))[_0x1b19('0x61')](handleError(_0x3b1e33,null));};exports[_0x1b19('0x82')]=function(_0x38f292,_0xb33399){_0x38f292[_0x1b19('0x68')][_0x1b19('0x83')]=_0x38f292[_0x1b19('0x80')][_0x1b19('0x81')];return db[_0x1b19('0x49')][_0x1b19('0x60')]({'where':{'id':_0x38f292['params']['id']}})[_0x1b19('0x2b')](handleEntityNotFound(_0xb33399,null))[_0x1b19('0x2b')](saveUpdates(_0x38f292[_0x1b19('0x68')],null))[_0x1b19('0x2b')](respondWithResult(_0xb33399,null))['catch'](handleError(_0xb33399,null));};exports[_0x1b19('0x84')]=function(_0x2ae62f,_0x1409dd){_0x2ae62f[_0x1b19('0x68')]['customerAvatar']=_0x2ae62f['file'][_0x1b19('0x81')];return db[_0x1b19('0x49')][_0x1b19('0x60')]({'where':{'id':_0x2ae62f['params']['id']}})['then'](handleEntityNotFound(_0x1409dd,null))[_0x1b19('0x2b')](saveUpdates(_0x2ae62f[_0x1b19('0x68')],null))['then'](respondWithResult(_0x1409dd,null))[_0x1b19('0x61')](handleError(_0x1409dd,null));};exports[_0x1b19('0x85')]=function(_0x3e1d44,_0x1c34df){_0x3e1d44['body'][_0x1b19('0x86')]=_0x3e1d44['file'][_0x1b19('0x81')];return db[_0x1b19('0x49')][_0x1b19('0x60')]({'where':{'id':_0x3e1d44[_0x1b19('0x5d')]['id']}})['then'](handleEntityNotFound(_0x1c34df,null))[_0x1b19('0x2b')](saveUpdates(_0x3e1d44['body'],null))['then'](respondWithResult(_0x1c34df,null))[_0x1b19('0x61')](handleError(_0x1c34df,null));};exports[_0x1b19('0x87')]=function(_0x57e7d4,_0x415ba3){var _0x3a2e57=path[_0x1b19('0x88')](config[_0x1b19('0x89')],'server/files/images/logos/default_logo.svg');var _0x4828d7={'where':{'id':_0x57e7d4['params']['id']},'attributes':['id',_0x1b19('0x7f')],'raw':!![]};var _0x4807ba=![];return require(_0x1b19('0x8a'))['getLicense']()[_0x1b19('0x2b')](function(_0x892759){if(_0x892759){_0x4807ba=_0x892759[_0x1b19('0x8b')];}})[_0x1b19('0x2b')](function(){return db['ChatWebsite'][_0x1b19('0x60')](_0x4828d7);})['then'](handleEntityNotFound(_0x415ba3,null))[_0x1b19('0x2b')](function(_0x34e999){if(_0x34e999){if(!_[_0x1b19('0x8c')](_0x34e999[_0x1b19('0x7f')])){if(fs[_0x1b19('0x8d')](path[_0x1b19('0x88')](config[_0x1b19('0x89')],_0x1b19('0x8e'),_0x34e999['sitepic']))&&_0x4807ba){_0x3a2e57=path[_0x1b19('0x88')](config[_0x1b19('0x89')],_0x1b19('0x8e'),_0x34e999[_0x1b19('0x7f')]);}}return _0x415ba3[_0x1b19('0x8f')](_0x3a2e57);}})[_0x1b19('0x61')](handleError(_0x415ba3,null));};exports['getAvatar']=function(_0x19adca,_0x48638b){var _0x2d500a=path['join'](config[_0x1b19('0x89')],_0x1b19('0x90'));var _0x1931cd={'where':{'id':_0x19adca['params']['id']},'attributes':['id',_0x1b19('0x83')],'raw':!![]};return db['ChatWebsite'][_0x1b19('0x60')](_0x1931cd)[_0x1b19('0x2b')](handleEntityNotFound(_0x48638b,null))[_0x1b19('0x2b')](function(_0x233630){if(_0x233630){if(!_['isNil'](_0x233630[_0x1b19('0x83')])){if(fs[_0x1b19('0x8d')](path[_0x1b19('0x88')](config[_0x1b19('0x89')],_0x1b19('0x91'),_0x233630[_0x1b19('0x83')]))){_0x2d500a=path[_0x1b19('0x88')](config[_0x1b19('0x89')],_0x1b19('0x91'),_0x233630[_0x1b19('0x83')]);}}return _0x48638b[_0x1b19('0x8f')](_0x2d500a);}})[_0x1b19('0x61')](handleError(_0x48638b,null));};exports[_0x1b19('0x92')]=function(_0x43c985,_0x3265f8){var _0x4557bc=path['join'](config[_0x1b19('0x89')],_0x1b19('0x93'));var _0x1cadcb={'where':{'id':_0x43c985[_0x1b19('0x5d')]['id']},'attributes':['id',_0x1b19('0x94'),_0x1b19('0x95')],'raw':!![]};return db[_0x1b19('0x49')][_0x1b19('0x60')](_0x1cadcb)[_0x1b19('0x2b')](handleEntityNotFound(_0x3265f8,null))[_0x1b19('0x2b')](function(_0x471d90){if(_0x471d90){if(!_[_0x1b19('0x8c')](_0x471d90['customerAvatar'])){if(fs[_0x1b19('0x8d')](path[_0x1b19('0x88')](config['root'],_0x1b19('0x91'),_0x471d90[_0x1b19('0x94')]))&&_0x471d90['showCustomerAvatar']){_0x4557bc=path[_0x1b19('0x88')](config['root'],_0x1b19('0x91'),_0x471d90['customerAvatar']);}}return _0x3265f8[_0x1b19('0x8f')](_0x4557bc);}})[_0x1b19('0x61')](handleError(_0x3265f8,null));};exports[_0x1b19('0x96')]=function(_0x4cb7bd,_0x155eb7){var _0x104fc4=path[_0x1b19('0x88')](config[_0x1b19('0x89')],'server/files/images/avatars/system_avatar.png');var _0x405547={'where':{'id':_0x4cb7bd['params']['id']},'attributes':['id',_0x1b19('0x86')],'raw':!![]};return db['ChatWebsite'][_0x1b19('0x60')](_0x405547)['then'](handleEntityNotFound(_0x155eb7,null))[_0x1b19('0x2b')](function(_0x3e8538){if(_0x3e8538){if(!_[_0x1b19('0x8c')](_0x3e8538['systemAvatar'])){if(fs[_0x1b19('0x8d')](path[_0x1b19('0x88')](config[_0x1b19('0x89')],_0x1b19('0x91'),_0x3e8538['systemAvatar']))){_0x104fc4=path[_0x1b19('0x88')](config[_0x1b19('0x89')],'server/files/images/avatars/',_0x3e8538[_0x1b19('0x86')]);}}return _0x155eb7['download'](_0x104fc4);}})[_0x1b19('0x61')](handleError(_0x155eb7,null));};function checkWebsiteInterval(_0x5894f4){var _0x4ab458=_0x5894f4[_0x1b19('0x97')];if(!_0x4ab458){return Promise[_0x1b19('0x98')](_0x5894f4);}var _0xffb33b=_0x5894f4[_0x1b19('0x99')]||undefined;return _0x4ab458['ifTime'](_0xffb33b)[_0x1b19('0x2b')](function(_0x2aed4a){if(!_0x2aed4a){throw new APIOutOfIntervalError();}return _0x5894f4;});}exports['notify']=function(_0xf67540,_0x478be4){var _0xc2b8f5={'body':_0xf67540[_0x1b19('0x68')],'channel':'chat'};var _0x3feecc=[];var _0x583d5a=[];var _0x4641f3={};var _0x51bd73=![];if(_0xf67540['body']['id']){delete _0xf67540['body']['id'];}if(_[_0x1b19('0x8c')](_0xf67540['body']['from'])){throw new APIBadRequestError(_0x1b19('0x9a'));}if(_['isNil'](_0xf67540[_0x1b19('0x68')]['mapKey'])){throw new APIBadRequestError(_0x1b19('0x9b'));}if(_[_0x1b19('0x9c')](_0xf67540[_0x1b19('0x68')]['body'])){throw new APIBadRequestError(_0x1b19('0x9d'));}var _0xab66ef=_0xf67540[_0x1b19('0x68')]['customerIp']&&_0xf67540[_0x1b19('0x68')][_0x1b19('0x3d')];return db[_0x1b19('0x9e')][_0x1b19('0x70')]()[_0x1b19('0x2b')](function(_0x5981fc){if(!_0x5981fc){throw new Error(_0x1b19('0x9f'));}_0x3feecc=Object[_0x1b19('0x4e')](_0x5981fc)[_0x1b19('0x58')](function(_0x2ebc3f){return![_0x1b19('0xa0'),_0x1b19('0xa1')][_0x1b19('0xa2')](_0x2ebc3f);});_0x583d5a=Object['keys'](_0x5981fc)[_0x1b19('0x58')](function(_0x49c4d7){return![_0x1b19('0xa0'),_0x1b19('0xa1'),'CompanyId',_0x1b19('0xa3')][_0x1b19('0xa2')](_0x49c4d7);});if(!_[_0x1b19('0xa2')](_0x583d5a,_0xf67540['body']['mapKey'])){throw new APIBadRequestError(_0x1b19('0xa4')+_0x583d5a[_0x1b19('0x88')](',\x20'));}_0x4641f3[_0xf67540['body']['mapKey']]=_0xf67540[_0x1b19('0x68')][_0x1b19('0xa5')];})[_0x1b19('0x2b')](function(){return db[_0x1b19('0x49')][_0x1b19('0x60')]({'where':{'id':_0xf67540[_0x1b19('0x5d')]['id']},'include':[{'model':db['CmList'],'as':_0x1b19('0xa6'),'include':[{'model':db[_0x1b19('0x9e')],'as':'Contacts','where':_0x4641f3,'limit':0x1,'order':[[_0x1b19('0xa1'),_0x1b19('0xa7')]]}]},{'model':db[_0x1b19('0xa8')],'as':_0x1b19('0xa9')},{'model':db[_0x1b19('0x97')],'as':_0x1b19('0x97'),'include':[{'model':db['Interval'],'as':_0x1b19('0xaa'),'attributes':['id',_0x1b19('0xab')],'raw':!![]}]}]});})[_0x1b19('0x2b')](function(_0x1bdfc3){if(!_0x1bdfc3){throw new APINotFoundError(util[_0x1b19('0x40')](_0x1b19('0xac'),_0xf67540[_0x1b19('0x5d')]['id']));}if(_0xab66ef){return checkWebsiteInterval(_0x1bdfc3);}return _0x1bdfc3;})[_0x1b19('0x2b')](function(_0x5b855e){_0xc2b8f5[_0x1b19('0xad')]=_0x5b855e;_0xc2b8f5[_0x1b19('0xae')]=_[_0x1b19('0xaf')](_0x5b855e[_0x1b19('0xa9')],[_0x1b19('0xb0')],[_0x1b19('0xb1')]);if(_0xc2b8f5['account'][_0x1b19('0xa9')]){delete _0xc2b8f5[_0x1b19('0xad')][_0x1b19('0xa9')];}_0xc2b8f5[_0x1b19('0xb2')]=_0x5b855e['List']||{'id':_0x5b855e['ListId']};if(_0xc2b8f5[_0x1b19('0xb2')]&&_0xc2b8f5[_0x1b19('0xb2')][_0x1b19('0xb3')][_0x1b19('0x52')]){return _0xc2b8f5['list'][_0x1b19('0xb3')][0x0];}var _0x2d2005=_[_0x1b19('0x12')](_0xf67540['body'],{'firstName':_0xf67540[_0x1b19('0x68')][_0x1b19('0xa5')],'ListId':_0x5b855e['ListId']});_0x2d2005[_0xf67540['body'][_0x1b19('0xb4')]]=_0xf67540[_0x1b19('0x68')]['from'];return db[_0x1b19('0x9e')][_0x1b19('0x67')](_0x2d2005,{'fields':_0x3feecc,'raw':!![]});})[_0x1b19('0x2b')](function(_0x4b88a7){_0xc2b8f5[_0x1b19('0xb5')]=_0x4b88a7;var _0x26f855=createInteractionObject(_0xf67540[_0x1b19('0x5d')]['id'],_0xf67540[_0x1b19('0x68')],_0xf67540[_0x1b19('0xb6')],_0x4b88a7);var _0x81a618={'ChatWebsiteId':_0xf67540['params']['id']};if(_0xf67540[_0x1b19('0x68')][_0x1b19('0xb7')]){_0x81a618[_0x1b19('0xb7')]=_0xf67540[_0x1b19('0x68')][_0x1b19('0xb7')];_0x81a618['closed']=![];return db['ChatInteraction'][_0x1b19('0x60')]({'where':_0x81a618})[_0x1b19('0x2b')](function(_0x59432d){var _0x420fe5=_0xf67540[_0x1b19('0x68')][_0x1b19('0xb8')]&&_0xf67540['body'][_0x1b19('0x3d')];if(_0x59432d){_0x51bd73=!![];return _0x59432d;}else if(!_0x420fe5&&_0x59432d&&_0x59432d[_0x1b19('0xb9')]){throw new APIConflictError(_0x1b19('0xba'));}_0x26f855[_0x1b19('0xb7')]=_0xf67540['body'][_0x1b19('0xb7')];_0x26f855[_0x1b19('0xbb')]=_0xf67540['body']['externalUrl'];return db[_0x1b19('0xbc')][_0x1b19('0x67')](_0x26f855);});}_0x81a618['ContactId']=_0x4b88a7['id'];if(_0xf67540['body'][_0x1b19('0xbd')]&&_0xf67540[_0x1b19('0x68')][_0x1b19('0xbd')]['id']){_0x81a618['id']=_0xf67540['body']['interaction']['id'];return db['ChatInteraction'][_0x1b19('0x60')]({'where':_0x81a618})[_0x1b19('0x2b')](function(_0x1b3140){var _0xb3bf16=_0xf67540[_0x1b19('0x68')]['customerIp']&&_0xf67540[_0x1b19('0x68')][_0x1b19('0x3d')];if(!_0xb3bf16&&_0x1b3140&&_0x1b3140[_0x1b19('0xb9')]){throw new APIConflictError(_0x1b19('0xba'));}else if(_0x1b3140){_0x51bd73=!![];return _0x1b3140;}else{return db['ChatInteraction'][_0x1b19('0x67')](_0x26f855);}});}return db[_0x1b19('0xbc')][_0x1b19('0x67')](_0x26f855);})['then'](function(_0x1afc2a){if(!_0x51bd73){return _0x1afc2a;}var _0x1322a4={'from':(_0xc2b8f5[_0x1b19('0xb5')][_0x1b19('0x3a')]||'')+'\x20'+(_0xc2b8f5[_0x1b19('0xb5')][_0x1b19('0x3b')]||'')};if(_0xf67540[_0x1b19('0x68')]['threadId']&&_0xf67540[_0x1b19('0x68')][_0x1b19('0xbe')]&&_0xf67540[_0x1b19('0x68')][_0x1b19('0xb7')]!=_0xf67540[_0x1b19('0x68')][_0x1b19('0xbe')]){_0x1322a4['threadId']=_0xf67540[_0x1b19('0x68')]['messageId'];}return _0x1afc2a[_0x1b19('0x6e')](_0x1322a4);})['then'](function(_0x4231a2){_0xc2b8f5['interaction']=_0x4231a2[_0x1b19('0x2d')]({'plain':!![]});_0xc2b8f5[_0x1b19('0xbd')][_0x1b19('0xbf')]=!_0x51bd73;if(_0xc2b8f5[_0x1b19('0xbd')][_0x1b19('0xbf')]){if(_0xc2b8f5[_0x1b19('0xad')][_0x1b19('0xc0')]){_0xc2b8f5['applications'][_0x1b19('0xc1')]({'id':0x0,'priority':_0xc2b8f5[_0x1b19('0xae')][_0x1b19('0x52')]+0x1,'app':'close','appdata':_0x1b19('0xc2'),'interval':_0x1b19('0xc3')});}}return db[_0x1b19('0xc4')][_0x1b19('0x67')]({'body':_0xf67540[_0x1b19('0x68')][_0x1b19('0x68')],'ChatWebsiteId':_0xf67540['params']['id'],'ChatInteractionId':_0x4231a2['id'],'direction':'in','ContactId':_0xc2b8f5[_0x1b19('0xb5')]['id'],'AttachmentId':_0xf67540[_0x1b19('0x68')][_0x1b19('0xc5')]});})[_0x1b19('0x2b')](function(_0x54ad50){_0xc2b8f5[_0x1b19('0x1e')]=_0x54ad50;if(!_0xc2b8f5[_0x1b19('0xbd')][_0x1b19('0xc6')]){return;}return db[_0x1b19('0xc7')][_0x1b19('0x60')]({'attributes':['id',_0x1b19('0x31')],'where':{'id':_0xc2b8f5['interaction'][_0x1b19('0xc6')]}});})[_0x1b19('0x2b')](function(_0x32deea){if(_0x32deea){_0xc2b8f5['applications'][_0x1b19('0xc8')]({'id':0x0,'priority':0x0,'app':'agent','appdata':_0x32deea['name']+','+(_0xc2b8f5['account'][_0x1b19('0xc9')]||0xa),'interval':_0x1b19('0xc3')});_0xc2b8f5[_0x1b19('0xca')]=!![];}if(!_0xc2b8f5[_0x1b19('0xbd')]['queueId']){return;}return db['ChatQueue'][_0x1b19('0x60')]({'attributes':['id',_0x1b19('0x31')],'where':{'id':_0xc2b8f5['interaction'][_0x1b19('0xcb')]}});})['then'](function(_0x239601){if(_0x239601){_0xc2b8f5[_0x1b19('0xae')]['unshift']({'id':0x0,'priority':0x1,'app':'queue','appdata':_0x239601['name']+','+(_0xc2b8f5[_0x1b19('0xad')][_0x1b19('0xcc')]||0x12c),'interval':_0x1b19('0xc3')});}return respondWithRpcPromise(_0x1b19('0xcd'),_0x1b19('0xce'),_0xc2b8f5);})[_0x1b19('0x2b')](function(_0x229b52){respondWithRpcPromise(_0x1b19('0xcf'),_0x1b19('0xcf'),{'event':_0x1b19('0xd0'),'message':_0x229b52},client9002);return _0x229b52;})[_0x1b19('0x2b')](respondWithResult(_0x478be4,null))['catch'](APIHandleError(_0x478be4));};exports['offline']=function(_0x2c9dda,_0x46ec11){var _0x30cbaf,_0x4cef0d,_0x107790;var _0x3cad36=[];var _0x2b51bd={};var _0x5c7272=_0x2c9dda[_0x1b19('0xd1')]||[];var _0x33532a=[];var _0x507770;return db[_0x1b19('0x9e')][_0x1b19('0x70')]()[_0x1b19('0x2b')](function(_0xfd4050){if(!_0xfd4050){throw new db['Sequelize']['ValidationError'](_0x1b19('0xd2'));}_0x3cad36=_[_0x1b19('0xd3')](_[_0x1b19('0x4e')](_0xfd4050),[_0x1b19('0xa0'),'updatedAt','CompanyId',_0x1b19('0xa3')]);if(_0x2c9dda['body']['id']){delete _0x2c9dda[_0x1b19('0x68')]['id'];}if(_[_0x1b19('0x8c')](_0x2c9dda[_0x1b19('0x68')][_0x1b19('0xa5')])){throw _0x46ec11[_0x1b19('0x23')](0x1f4)[_0x1b19('0x32')](new db[(_0x1b19('0xd4'))][(_0x1b19('0xd5'))](_0x1b19('0xd6')));}if(_[_0x1b19('0x8c')](_0x2c9dda['body']['body'])||_0x2c9dda[_0x1b19('0x68')][_0x1b19('0x68')]===''){throw _0x46ec11[_0x1b19('0x23')](0x1f4)['send'](new db['Sequelize'][(_0x1b19('0xd5'))]('body\x20is\x20mandatory\x20and\x20not\x20empty'));}if(_[_0x1b19('0x8c')](_0x2c9dda[_0x1b19('0x68')][_0x1b19('0xd7')])){throw _0x46ec11[_0x1b19('0x23')](0x1f4)['send'](new db['Sequelize'][(_0x1b19('0xd5'))](_0x1b19('0xd8')+_0x3cad36));}if(!_[_0x1b19('0xa2')](_0x3cad36,_0x2c9dda['body'][_0x1b19('0xd7')])){throw _0x46ec11['status'](0x1f4)[_0x1b19('0x32')](new db['Sequelize'][(_0x1b19('0xd5'))]('mapKeyOffline\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20'+_0x3cad36));}_0x2b51bd[_0x2c9dda[_0x1b19('0x68')][_0x1b19('0xd7')]]=_0x2c9dda[_0x1b19('0x68')][_0x1b19('0xa5')];})['then'](function(){return db[_0x1b19('0x49')][_0x1b19('0x60')]({'where':{'id':_0x2c9dda[_0x1b19('0x5d')]['id']},'include':[{'model':db['CmList'],'as':'List'},{'model':db[_0x1b19('0xd9')],'as':_0x1b19('0xd9')}]});})[_0x1b19('0x2b')](handleEntityNotFound(_0x46ec11,null))['then'](function(_0x180ecb){if(_0x180ecb&&_0x180ecb[_0x1b19('0xa6')]){_0x4cef0d=_0x180ecb;var _0x35a227=_['defaults'](_0x2c9dda['body'],{'firstName':_0x2c9dda[_0x1b19('0x68')][_0x1b19('0xa5')],'phone':_0x2c9dda['body'][_0x1b19('0xa5')],'ListId':_0x180ecb[_0x1b19('0xa3')]});_0x35a227[_0x2c9dda[_0x1b19('0x68')][_0x1b19('0xd7')]]=_0x2c9dda[_0x1b19('0x68')][_0x1b19('0xa5')];return db['CmContact'][_0x1b19('0xda')]({'where':_0x2b51bd,'defaults':_0x35a227});}})[_0x1b19('0xdb')](function(_0x920e2a){if(_0x920e2a){_0x107790=_0x920e2a;var _0x5d292a=fs[_0x1b19('0xdc')](path['join'](config['root'],'server/files/templates/chatOfflineMessage.ejs'),_0x1b19('0xdd'));var _0x2547f2=ejs[_0x1b19('0xde')](_0x5d292a,{'body':_[_0x1b19('0xdf')](_0x2c9dda['body'][_0x1b19('0x68')]),'bodyTitle':_0x4cef0d[_0x1b19('0xe0')]});return db[_0x1b19('0xe1')][_0x1b19('0x67')]({'body':_0x2547f2,'plainBody':htmlToText['fromString'](_0x2547f2),'ContactId':_0x920e2a['id'],'ChatWebsiteId':_0x4cef0d['id']});}})[_0x1b19('0x2b')](function(_0xe58ea3){_0x507770=_0xe58ea3;if(_0x5c7272['length']){var _0x8d01dd=_0x5c7272[_0x1b19('0x48')](function(_0x880a3c){return{'name':_0x880a3c[_0x1b19('0xe2')],'basename':_0x880a3c[_0x1b19('0x81')],'type':_0x880a3c[_0x1b19('0xe3')],'ChatOfflineMessageId':_0xe58ea3['id']};});_0x33532a=_0x8d01dd[_0x1b19('0x48')](_0x16aefe=>{var _0x480da0={'filename':_0x16aefe[_0x1b19('0x31')],'path':path[_0x1b19('0x88')](config[_0x1b19('0x89')],_0x1b19('0xe4'),'files',_0x1b19('0xe5'),_0x1b19('0xe6'),_0x16aefe['basename'])};return _0x480da0;});if(!_0x4cef0d[_0x1b19('0xe7')]){return db[_0x1b19('0xe8')][_0x1b19('0xe9')](function(_0x4494f1){return db[_0x1b19('0xea')]['bulkCreate'](_0x8d01dd,{'transaction':_0x4494f1});});}}})[_0x1b19('0x2b')](function(){if(_0x507770){_0x30cbaf=_0x507770;return db[_0x1b19('0xd9')][_0x1b19('0xeb')]({'where':{'service':!![]},'include':[{'model':db['MailServerOut'],'as':_0x1b19('0xec'),'raw':!![],'include':[{'model':db[_0x1b19('0xed')],'as':'CloudProvider','raw':!![]}]}]});}})[_0x1b19('0x2b')](function(_0x521279){if(_0x521279&&_0x521279[_0x1b19('0xec')]&&_0x4cef0d[_0x1b19('0xee')]&&_0x4cef0d[_0x1b19('0xef')]){var _0x39abd5=_0x521279[_0x1b19('0xf0')]();return respondWithRpcPromise('SendMail',_0x1b19('0xf1'),{'account':_0x39abd5,'message':{'from':util[_0x1b19('0x40')](_0x1b19('0xf2'),_0x521279['name'],_0x521279[_0x1b19('0xf3')]||_0x521279['Smtp'][_0x1b19('0x69')]),'to':_0x4cef0d[_0x1b19('0xef')],'subject':_0x4cef0d[_0x1b19('0xf4')],'html':_0x30cbaf[_0x1b19('0x68')],'attachments':_0x33532a}},client9003)[_0x1b19('0x2b')](function(){return _0x30cbaf;})['catch'](function(_0x4a3a2c){logger[_0x1b19('0x1c')](_0x4a3a2c);});}})[_0x1b19('0x2b')](function(){if(_0x4cef0d&&_0x4cef0d['openNewInteraction']&&_0x4cef0d[_0x1b19('0xf5')]){var _0x452180=[];if(_0x5c7272[_0x1b19('0x52')]){_0x452180=_0x5c7272[_0x1b19('0x48')](function(_0x310197){return{'name':_0x310197[_0x1b19('0xe2')],'basename':_0x310197[_0x1b19('0x81')],'type':_0x310197[_0x1b19('0xe3')],'ChatOfflineMessageId':_0x507770['id']};});}var _0x182213;if(!_[_0x1b19('0x8c')](_0x4cef0d[_0x1b19('0xf6')])){var _0x1d0f7c=_[_0x1b19('0x48')](_0x2c9dda[_0x1b19('0x68')],function(_0x4cbea7){return _0x4cbea7;});var _0x5615d4=_[_0x1b19('0xf7')](_0x1d0f7c)[0x0];var _0x21a68c=_[_0x1b19('0xf8')](_0x5615d4,function(_0x154f41){return _0x154f41;});_0x182213=_0x21a68c[0x1][_0x4cef0d[_0x1b19('0xf6')]];}var _0x4367cf={'from':_0x107790[_0x1b19('0xf3')],'firstName':_0x107790['firstName'],'lastName':_0x107790[_0x1b19('0x3b')],'mapKey':_0x1b19('0xf3'),'message':{'from':_0x107790[_0x1b19('0xf3')],'to':_0x4cef0d['MailAccount'][_0x1b19('0xf3')],'cc':'','subject':_[_0x1b19('0x8c')](_0x182213)?_0x4cef0d[_0x1b19('0xf4')]:_0x182213,'messageId':'','sentAt':new Date(),'attach':_0x452180[_0x1b19('0x52')],'attachments':_0x452180,'originChannel':_0x1b19('0xf9'),'ChatWebsiteId':_0x4cef0d['id'],'ChatOfflineMessageId':_0x30cbaf['id'],'originTo':_0x4cef0d['MailAccount'][_0x1b19('0xf3')]},'body':_0x30cbaf[_0x1b19('0x68')]};var _0x51111f={'account':{'id':_0x4cef0d['MailAccountId']},'body':_0x4367cf,'log':_0x1b19('0xfa')};return respondWithRpcPromise(_0x1b19('0xfa'),_0x1b19('0xfb'),_0x51111f,client9001)[_0x1b19('0x2b')](function(){return _0x30cbaf;})[_0x1b19('0x61')](function(_0x299aa1){logger[_0x1b19('0x1c')](_0x299aa1);});}return;})[_0x1b19('0x2b')](function(){if(_0x30cbaf){return _0x30cbaf;}})[_0x1b19('0x2b')](respondWithResult(_0x46ec11,null))[_0x1b19('0x61')](function(){for(var _0x2cd8a3 of _0x5c7272){var _0x5701ab=path[_0x1b19('0x88')](config[_0x1b19('0x89')],'server',_0x1b19('0xd1'),_0x1b19('0xe5'),_0x1b19('0xe6'),_0x2cd8a3['filename']);fs_extra[_0x1b19('0xfc')](_0x5701ab)[_0x1b19('0x61')](function(_0xaca3d5){logger[_0x1b19('0x1c')](_0x1b19('0xfd'),_0x5701ab,_0xaca3d5);});}});};exports['addInteraction']=function(_0x4dc472,_0x52d50a){return db[_0x1b19('0xbc')][_0x1b19('0x60')]({'where':{'id':_0x4dc472[_0x1b19('0x5d')]['id']}})[_0x1b19('0x2b')](handleEntityNotFound(_0x52d50a,null))[_0x1b19('0x2b')](function(_0xd40d65){if(_0xd40d65){return _0xd40d65[_0x1b19('0xfe')](_0x4dc472[_0x1b19('0x68')][_0x1b19('0x79')],_[_0x1b19('0xff')](_0x4dc472[_0x1b19('0x68')],[_0x1b19('0x79'),'id'])||{});}})[_0x1b19('0x2b')](respondWithResult(_0x52d50a,null))['catch'](handleError(_0x52d50a,null));};exports[_0x1b19('0x100')]=function(_0x54db2c,_0x566672){var _0x4447db={'raw':![],'where':{}};var _0x52bb75={};var _0x545893={'count':0x0,'rows':[]};return db[_0x1b19('0x49')][_0x1b19('0xeb')]({'where':{'id':_0x54db2c[_0x1b19('0x5d')]['id']}})[_0x1b19('0x2b')](handleEntityNotFound(_0x566672,null))[_0x1b19('0x2b')](function(_0x37d9d1){if(_0x37d9d1){_0x52bb75[_0x1b19('0x4c')]=_['keys'](db[_0x1b19('0xbc')][_0x1b19('0x5f')]);_0x52bb75[_0x1b19('0x4d')]=_['keys'](_0x54db2c[_0x1b19('0x4d')]);_0x52bb75[_0x1b19('0x57')]=_[_0x1b19('0x4f')](_0x52bb75['model'],_0x52bb75[_0x1b19('0x4d')]);_0x4447db[_0x1b19('0x50')]=_[_0x1b19('0x4f')](_0x52bb75['model'],qs[_0x1b19('0x51')](_0x54db2c[_0x1b19('0x4d')][_0x1b19('0x51')]));_0x4447db['attributes']=_0x4447db[_0x1b19('0x50')][_0x1b19('0x52')]?_0x4447db[_0x1b19('0x50')]:_0x52bb75['model'];if(!_0x54db2c[_0x1b19('0x4d')]['hasOwnProperty'](_0x1b19('0x54'))){_0x4447db['limit']=qs[_0x1b19('0x27')](_0x54db2c[_0x1b19('0x4d')]['limit']);_0x4447db[_0x1b19('0x26')]=qs['offset'](_0x54db2c['query']['offset']);}_0x4447db[_0x1b19('0x55')]=qs[_0x1b19('0x74')](_0x54db2c[_0x1b19('0x4d')]['sort']);_0x4447db['where']=qs[_0x1b19('0x57')](_['pick'](_0x54db2c['query'],_0x52bb75[_0x1b19('0x57')]));_0x4447db[_0x1b19('0x56')][_0x1b19('0x7a')]=_0x37d9d1['id'];if(_0x54db2c['query'][_0x1b19('0x58')]){_0x4447db[_0x1b19('0x56')]=_[_0x1b19('0x59')](_0x4447db[_0x1b19('0x56')],{'$or':_['map'](_0x4447db[_0x1b19('0x50')],function(_0x508f60){var _0x571a97={};_0x571a97[_0x508f60]={'$like':'%'+_0x54db2c[_0x1b19('0x4d')][_0x1b19('0x58')]+'%'};return _0x571a97;})});}_0x4447db=_[_0x1b19('0x59')]({},_0x4447db,_0x54db2c[_0x1b19('0x5a')]);return db[_0x1b19('0xbc')][_0x1b19('0x29')]({'where':_0x4447db['where']})[_0x1b19('0x2b')](function(_0x4e22f2){_0x545893[_0x1b19('0x29')]=_0x4e22f2;if(_0x54db2c[_0x1b19('0x4d')][_0x1b19('0x7d')]){_0x4447db[_0x1b19('0x5b')]=[{'model':db['CmContact'],'as':_0x1b19('0x101'),'required':![]},{'model':db[_0x1b19('0xc7')],'as':_0x1b19('0x102'),'attributes':['name',_0x1b19('0x103'),_0x1b19('0x104')],'required':![]},{'model':db[_0x1b19('0x105')],'as':_0x1b19('0x106'),'attributes':['id','name',_0x1b19('0x107')],'where':_0x54db2c[_0x1b19('0x4d')][_0x1b19('0x108')]?{'id':_0x54db2c[_0x1b19('0x4d')]['tag']}:undefined,'required':_0x54db2c[_0x1b19('0x4d')][_0x1b19('0x108')]?!![]:![]}];}return db[_0x1b19('0xbc')][_0x1b19('0x76')](_0x4447db);})['then'](function(_0x227a31){_0x545893[_0x1b19('0x77')]=_0x227a31;return _0x545893;});}})[_0x1b19('0x2b')](respondWithFilteredResult(_0x566672,_0x4447db))[_0x1b19('0x61')](handleError(_0x566672,null));};exports[_0x1b19('0x109')]=function(_0xa9748f,_0x27f343){var _0x5bfb7a=0x0;var _0x61627a=0x0;var _0x1f1b7e=![];var _0x272a3f;var _0x14aa11;return db[_0x1b19('0x49')][_0x1b19('0x60')]({'where':{'id':_0xa9748f[_0x1b19('0x5d')]['id']},'include':[{'model':db[_0x1b19('0x97')],'as':_0x1b19('0x97'),'include':[{'model':db[_0x1b19('0x97')],'as':_0x1b19('0xaa'),'attributes':['id',_0x1b19('0xab')]}]}]})['then'](handleEntityNotFound(_0x27f343,null))[_0x1b19('0x2b')](function(_0x130b91){if(_0x130b91){_0x272a3f=_0x130b91;return _0x130b91['getProactiveActions']({'raw':!![]});}})[_0x1b19('0x2b')](function(_0x102016){if(_0x272a3f){if(_0x102016){_0x14aa11=_0x102016;}}return require('../../config/license/util')[_0x1b19('0x10a')]();})['then'](function(_0xbb6242){if(_0xbb6242){_0x61627a=_0xbb6242[_0x1b19('0x10b')];_0x1f1b7e=_0xbb6242[_0x1b19('0x8b')];}})[_0x1b19('0x2b')](function(){return db[_0x1b19('0xbc')][_0x1b19('0x29')]({'where':{'closed':![]}});})[_0x1b19('0x2b')](function(_0x31e34a){_0x5bfb7a=_0x31e34a;if(_0x61627a&&_0x31e34a>_0x61627a){return db[_0x1b19('0x10c')][_0x1b19('0xeb')]({'where':{'id':0x1}})[_0x1b19('0x2b')](function(_0xf605e8){if(_0xf605e8){_0xf605e8['increment'](_0x1b19('0x10d'));}});}})[_0x1b19('0x2b')](function(){var _0x3ec983=_0x272a3f[_0x1b19('0x97')];var _0x5d94a2=_0x272a3f[_0x1b19('0x99')]||undefined;return _0x3ec983?_0x3ec983['ifTime'](_0x5d94a2):!![];})[_0x1b19('0x2b')](function(_0x4a381a){var _0x3023e9=fs[_0x1b19('0xdc')](path[_0x1b19('0x88')](config[_0x1b19('0x89')],_0x1b19('0x10e')),'utf8');var _0x32f811=_0x1b19('0x10f');var _0x13bdc0=![];var _0x508c14,_0x14f2dc;if(_0xa9748f[_0x1b19('0xb6')][_0x1b19('0x3d')]){_0x508c14=new URL(_0xa9748f[_0x1b19('0xb6')]['referer'])[_0x1b19('0x110')];}else if(_0xa9748f[_0x1b19('0xb6')][_0x1b19('0x110')]){_0x508c14=new URL(_0xa9748f[_0x1b19('0xb6')]['origin'])['origin'];}else{_0x508c14=_0x1b19('0x111');}_0x14f2dc=typeof _0x272a3f[_0x1b19('0x62')][_0x1b19('0x63')](',')[_0x1b19('0x60')](function(_0x25fe3c){return wildcardUtils[_0x1b19('0x112')](_0x25fe3c,_0x508c14);})!==_0x1b19('0x28');var _0x2c4d96={'chatVersion':_0x32f811,'chatWebsiteAddressOrigin':_0x14f2dc?_0xa9748f[_0x1b19('0xb6')][_0x1b19('0x3d')]:_0x272a3f[_0x1b19('0x62')],'remote':_0x272a3f[_0x1b19('0x113')],'query':querystring[_0x1b19('0x1b')](_[_0x1b19('0x59')](_0x272a3f[_0x1b19('0x2d')]({'plain':!![]}),{'customerIp':_0xa9748f[_0x1b19('0xb6')][_0x1b19('0x38')]||_0xa9748f[_0x1b19('0xb6')]['x-real-ip']||_0xa9748f[_0x1b19('0x114')][_0x1b19('0x115')]||_0xa9748f['ip'],'referer':_0xa9748f[_0x1b19('0xb6')][_0x1b19('0x3d')],'openedInteractions':_0x5bfb7a,'maxInteractions':_0x61627a,'virtual':_0x1f1b7e['virtual'],'online':_0x4a381a,'custom':_0x1f1b7e,'address':_0x14f2dc?_0xa9748f['headers']['referer']:null}))['replace'](/'/g,'\x5c\x27')};_0x27f343[_0x1b19('0x32')](ejs[_0x1b19('0xde')](Mustache[_0x1b19('0xde')](_0x3023e9,_0x2c4d96),{'proactiveActions':_0x14aa11,'alignment':_0x272a3f['alignment'],'verticalAlignment':_0x272a3f[_0x1b19('0x116')],'div_color':_0x272a3f[_0x1b19('0x107')],'labelText':_0x272a3f[_0x1b19('0x117')],'text_color':_0x272a3f[_0x1b19('0x118')],'text_button_color':_0x272a3f[_0x1b19('0x119')],'button_color':_0x272a3f[_0x1b19('0x11a')],'background_color':_0x272a3f[_0x1b19('0x11b')],'hideWhenOffline':_0x272a3f[_0x1b19('0x11c')],'intervalId':_0x272a3f['IntervalId'],'isDevelopment':_0x13bdc0,'chatVersion':_0x32f811}));})[_0x1b19('0x61')](handleError(_0x27f343,null));};exports['addApplications']=function(_0x3317fa,_0x361658){var _0x53dc98=_0x3317fa[_0x1b19('0x5d')]['id'];var _0x62f5e8=_0x3317fa[_0x1b19('0x68')];var _0x51fbc6=0xc8;var _0x16dbd6=null;return db[_0x1b19('0xe8')][_0x1b19('0xe9')]({'isolationLevel':db['sequelize'][_0x1b19('0x11d')][_0x1b19('0x11e')][_0x1b19('0x11f')]},function(_0x5dcc78){return db[_0x1b19('0x49')][_0x1b19('0xeb')]({'where':{'id':_0x53dc98},'transaction':_0x5dcc78})[_0x1b19('0x2b')](function(_0xb2e6d0){if(_0xb2e6d0){return db[_0x1b19('0xa8')][_0x1b19('0x2c')]({'where':{'ChatWebsiteId':_0x53dc98},'transaction':_0x5dcc78})[_0x1b19('0x2b')](function(){var _0x2a077e=_[_0x1b19('0x48')](_0x62f5e8,function(_0x556619){_0x556619[_0x1b19('0x7a')]=_0x53dc98;return _0x556619;});return db['ChatApplication'][_0x1b19('0x120')](_0x2a077e,{'transaction':_0x5dcc78});});}else{_0x51fbc6=0x194;_0x16dbd6=[];}});})[_0x1b19('0x2b')](function(){if(_0x51fbc6!==0x194){return db['ChatApplication'][_0x1b19('0x121')]({'where':{'ChatWebsiteId':_0x53dc98},'order':'priority'})[_0x1b19('0x2b')](function(_0x5519a0){_0x16dbd6=_0x5519a0;});}})[_0x1b19('0x61')](function(_0x202ef6){_0x51fbc6=0x1f4;logger[_0x1b19('0x1c')](_0x202ef6[_0x1b19('0x30')]);if(_0x202ef6[_0x1b19('0x31')]){delete _0x202ef6['name'];}_0x16dbd6=_0x202ef6;})['finally'](function(){if(_0x16dbd6===null){_0x361658[_0x1b19('0x22')](_0x51fbc6);}else{if(_0x51fbc6===0x1f4){_0x361658[_0x1b19('0x23')](_0x51fbc6)[_0x1b19('0x32')](_0x16dbd6);}else{_0x361658[_0x1b19('0x23')](_0x51fbc6)[_0x1b19('0x25')](_0x16dbd6);}}});};exports['getApplications']=function(_0x38246a,_0x45b354){var _0x243f38={};var _0x1a9634={};var _0x4581ed;var _0x558ac7;return db['ChatWebsite'][_0x1b19('0xeb')]({'where':{'id':_0x38246a['params']['id']}})['then'](handleEntityNotFound(_0x45b354,null))[_0x1b19('0x2b')](function(_0x5b7def){if(_0x5b7def){_0x4581ed=_0x5b7def;_0x1a9634[_0x1b19('0x4c')]=_[_0x1b19('0x4e')](db[_0x1b19('0xa8')][_0x1b19('0x5f')]);_0x1a9634['query']=_[_0x1b19('0x4e')](_0x38246a[_0x1b19('0x4d')]);_0x1a9634[_0x1b19('0x57')]=_[_0x1b19('0x4f')](_0x1a9634[_0x1b19('0x4c')],_0x1a9634[_0x1b19('0x4d')]);_0x243f38[_0x1b19('0x50')]=_[_0x1b19('0x4f')](_0x1a9634[_0x1b19('0x4c')],qs[_0x1b19('0x51')](_0x38246a[_0x1b19('0x4d')][_0x1b19('0x51')]));_0x243f38[_0x1b19('0x50')]=_0x243f38[_0x1b19('0x50')][_0x1b19('0x52')]?_0x243f38['attributes']:_0x1a9634[_0x1b19('0x4c')];_0x243f38[_0x1b19('0x55')]=qs[_0x1b19('0x74')](_0x38246a[_0x1b19('0x4d')][_0x1b19('0x74')]);_0x243f38['where']=qs['filters'](_[_0x1b19('0x75')](_0x38246a[_0x1b19('0x4d')],_0x1a9634['filters']));if(_0x38246a[_0x1b19('0x4d')][_0x1b19('0x58')]){_0x243f38[_0x1b19('0x56')]=_['merge'](_0x243f38[_0x1b19('0x56')],{'$or':_[_0x1b19('0x48')](_0x243f38[_0x1b19('0x50')],function(_0x2d3a59){var _0x25f044={};_0x25f044[_0x2d3a59]={'$like':'%'+_0x38246a[_0x1b19('0x4d')][_0x1b19('0x58')]+'%'};return _0x25f044;})});}_0x243f38=_[_0x1b19('0x59')]({},_0x243f38,_0x38246a[_0x1b19('0x5a')]);return _0x4581ed[_0x1b19('0x122')](_0x243f38);}})[_0x1b19('0x2b')](function(_0x44cb7c){if(_0x44cb7c){_0x558ac7=_0x44cb7c[_0x1b19('0x52')];if(!_0x38246a[_0x1b19('0x4d')][_0x1b19('0x53')](_0x1b19('0x54'))){_0x243f38[_0x1b19('0x27')]=qs[_0x1b19('0x27')](_0x38246a['query'][_0x1b19('0x27')]);_0x243f38[_0x1b19('0x26')]=qs[_0x1b19('0x26')](_0x38246a[_0x1b19('0x4d')][_0x1b19('0x26')]);}return _0x4581ed[_0x1b19('0x122')](_0x243f38);}})[_0x1b19('0x2b')](function(_0x51df47){if(_0x51df47){return _0x51df47?{'count':_0x558ac7,'rows':_0x51df47}:null;}})[_0x1b19('0x2b')](respondWithResult(_0x45b354,null))[_0x1b19('0x61')](handleError(_0x45b354,null));};exports[_0x1b19('0x123')]=function(_0x3de987,_0x148ea5){return db[_0x1b19('0x124')][_0x1b19('0x60')]({'where':{'id':_0x3de987[_0x1b19('0x5d')]['id']}})[_0x1b19('0x2b')](handleEntityNotFound(_0x148ea5,null))[_0x1b19('0x2b')](function(_0x2bf9d8){if(_0x2bf9d8){return _0x2bf9d8[_0x1b19('0x123')](_0x3de987[_0x1b19('0x68')][_0x1b19('0x79')],_[_0x1b19('0xff')](_0x3de987[_0x1b19('0x68')],[_0x1b19('0x79'),'id'])||{});}})[_0x1b19('0x2b')](respondWithResult(_0x148ea5,null))[_0x1b19('0x61')](handleError(_0x148ea5,null));};exports[_0x1b19('0x125')]=function(_0x4b87bc,_0x43c636){var _0x546ba9={};var _0x4db1f0={};var _0x54740b;var _0x51ba0a;return db[_0x1b19('0x49')][_0x1b19('0xeb')]({'where':{'id':_0x4b87bc[_0x1b19('0x5d')]['id']}})[_0x1b19('0x2b')](handleEntityNotFound(_0x43c636,null))[_0x1b19('0x2b')](function(_0x7705d){if(_0x7705d){_0x54740b=_0x7705d;_0x4db1f0[_0x1b19('0x4c')]=_['keys'](db['ChatProactiveAction']['rawAttributes']);_0x4db1f0[_0x1b19('0x4d')]=_[_0x1b19('0x4e')](_0x4b87bc[_0x1b19('0x4d')]);_0x4db1f0[_0x1b19('0x57')]=_[_0x1b19('0x4f')](_0x4db1f0[_0x1b19('0x4c')],_0x4db1f0[_0x1b19('0x4d')]);_0x546ba9[_0x1b19('0x50')]=_[_0x1b19('0x4f')](_0x4db1f0[_0x1b19('0x4c')],qs['fields'](_0x4b87bc['query'][_0x1b19('0x51')]));_0x546ba9[_0x1b19('0x50')]=_0x546ba9[_0x1b19('0x50')][_0x1b19('0x52')]?_0x546ba9[_0x1b19('0x50')]:_0x4db1f0[_0x1b19('0x4c')];_0x546ba9[_0x1b19('0x55')]=qs[_0x1b19('0x74')](_0x4b87bc[_0x1b19('0x4d')][_0x1b19('0x74')]);_0x546ba9[_0x1b19('0x56')]=qs[_0x1b19('0x57')](_[_0x1b19('0x75')](_0x4b87bc[_0x1b19('0x4d')],_0x4db1f0['filters']));if(_0x4b87bc[_0x1b19('0x4d')]['filter']){_0x546ba9['where']=_[_0x1b19('0x59')](_0x546ba9[_0x1b19('0x56')],{'$or':_[_0x1b19('0x48')](_0x546ba9[_0x1b19('0x50')],function(_0x591c91){var _0x2843b8={};_0x2843b8[_0x591c91]={'$like':'%'+_0x4b87bc['query'][_0x1b19('0x58')]+'%'};return _0x2843b8;})});}_0x546ba9=_[_0x1b19('0x59')]({},_0x546ba9,_0x4b87bc['options']);return _0x54740b[_0x1b19('0x125')](_0x546ba9);}})[_0x1b19('0x2b')](function(_0x2efd4b){if(_0x2efd4b){_0x51ba0a=_0x2efd4b[_0x1b19('0x52')];if(!_0x4b87bc[_0x1b19('0x4d')]['hasOwnProperty'](_0x1b19('0x54'))){_0x546ba9[_0x1b19('0x27')]=qs['limit'](_0x4b87bc[_0x1b19('0x4d')][_0x1b19('0x27')]);_0x546ba9[_0x1b19('0x26')]=qs[_0x1b19('0x26')](_0x4b87bc[_0x1b19('0x4d')][_0x1b19('0x26')]);}return _0x54740b[_0x1b19('0x125')](_0x546ba9);}})[_0x1b19('0x2b')](function(_0x53e698){if(_0x53e698){return _0x53e698?{'count':_0x51ba0a,'rows':_0x53e698}:null;}})['then'](respondWithResult(_0x43c636,null))[_0x1b19('0x61')](handleError(_0x43c636,null));};exports[_0x1b19('0x126')]=function(_0x2f4d07,_0x2d2952){var _0x1d8461=_0x2f4d07['query']['online']==='false'?_0x1b19('0x127'):'onlineForm';return db[_0x1b19('0x49')]['find']({'attributes':['id',_0x1d8461],'where':{'id':_0x2f4d07[_0x1b19('0x5d')]['id']}})[_0x1b19('0x2b')](handleEntityNotFound(_0x2d2952,null))[_0x1b19('0x2b')](function(_0x2cfb0d){if(_0x2cfb0d){var _0xc1c444=_0x2cfb0d[_0x1d8461];var _0x3a83c6=_0xc1c444&&_0xc1c444['items']?_0xc1c444[_0x1b19('0x128')]:[];_0x2d2952[_0x1b19('0x32')]({'fromKey':_[_0x1b19('0x8c')](_0xc1c444[_0x1b19('0x129')])?undefined:_0xc1c444[_0x1b19('0x129')],'count':_0x3a83c6['length'],'rows':_0x3a83c6});}})['catch'](handleError(_0x2d2952,null));};exports[_0x1b19('0x12a')]=function(_0x2a80f0,_0x2a6456){var _0x3468ea={'raw':![],'where':{}};var _0x364f9c={};var _0x8d3e2e={'count':0x0,'rows':[]};return db[_0x1b19('0x49')][_0x1b19('0xeb')]({'where':{'id':_0x2a80f0[_0x1b19('0x5d')]['id']}})[_0x1b19('0x2b')](handleEntityNotFound(_0x2a6456,null))[_0x1b19('0x2b')](function(_0x2abe0b){if(_0x2abe0b){_0x364f9c[_0x1b19('0x4c')]=_[_0x1b19('0x4e')](db[_0x1b19('0xe1')]['rawAttributes']);_0x364f9c[_0x1b19('0x4d')]=_[_0x1b19('0x4e')](_0x2a80f0[_0x1b19('0x4d')]);_0x364f9c[_0x1b19('0x57')]=_[_0x1b19('0x4f')](_0x364f9c[_0x1b19('0x4c')],_0x364f9c['query']);_0x3468ea[_0x1b19('0x50')]=_['intersection'](_0x364f9c[_0x1b19('0x4c')],qs[_0x1b19('0x51')](_0x2a80f0[_0x1b19('0x4d')][_0x1b19('0x51')]));_0x3468ea['attributes']=_0x3468ea[_0x1b19('0x50')]['length']?_0x3468ea['attributes']:_0x364f9c[_0x1b19('0x4c')];if(!_0x2a80f0['query'][_0x1b19('0x53')](_0x1b19('0x54'))){_0x3468ea['limit']=qs[_0x1b19('0x27')](_0x2a80f0[_0x1b19('0x4d')][_0x1b19('0x27')]);_0x3468ea[_0x1b19('0x26')]=qs[_0x1b19('0x26')](_0x2a80f0['query'][_0x1b19('0x26')]);}_0x3468ea[_0x1b19('0x55')]=qs['sort'](_0x2a80f0[_0x1b19('0x4d')][_0x1b19('0x74')]);_0x3468ea[_0x1b19('0x56')]=qs['filters'](_['pick'](_0x2a80f0['query'],_0x364f9c[_0x1b19('0x57')]));_0x3468ea[_0x1b19('0x56')]['ChatWebsiteId']=_0x2abe0b['id'];if(_0x2a80f0[_0x1b19('0x4d')]['filter']){_0x3468ea['where']=_[_0x1b19('0x59')](_0x3468ea[_0x1b19('0x56')],{'$or':_[_0x1b19('0x48')](_0x3468ea[_0x1b19('0x50')],function(_0x5049f5){var _0x48284b={};_0x48284b[_0x5049f5]={'$like':'%'+_0x2a80f0[_0x1b19('0x4d')][_0x1b19('0x58')]+'%'};return _0x48284b;})});}_0x3468ea=_[_0x1b19('0x59')]({},_0x3468ea,_0x2a80f0[_0x1b19('0x5a')]);return db[_0x1b19('0xe1')][_0x1b19('0x29')]({'where':_0x3468ea['where']})[_0x1b19('0x2b')](function(_0x2a764f){_0x8d3e2e[_0x1b19('0x29')]=_0x2a764f;if(_0x2a80f0[_0x1b19('0x4d')][_0x1b19('0x7d')]){_0x3468ea[_0x1b19('0x5b')]=[{'all':!![]}];}else{_0x3468ea[_0x1b19('0x5b')]=[{'model':db[_0x1b19('0x9e')],'as':'Contact','required':![]},{'model':db['Attachment'],'as':_0x1b19('0x12b'),'required':![]}];}return db[_0x1b19('0xe1')][_0x1b19('0x76')](_0x3468ea);})[_0x1b19('0x2b')](function(_0x3f63f5){_0x8d3e2e[_0x1b19('0x77')]=_0x3f63f5;return _0x8d3e2e;});}})['then'](respondWithFilteredResult(_0x2a6456,_0x3468ea))[_0x1b19('0x61')](handleError(_0x2a6456,null));};exports[_0x1b19('0x12c')]=function(_0x36761b,_0x438e38){return db[_0x1b19('0x49')]['find']({'where':{'id':_0x36761b[_0x1b19('0x5d')]['id']}})[_0x1b19('0x2b')](handleEntityNotFound(_0x438e38,null))[_0x1b19('0x2b')](function(_0x51c8d1){if(_0x51c8d1){return _0x51c8d1['addAgents'](_0x36761b[_0x1b19('0x68')][_0x1b19('0x79')],_[_0x1b19('0xff')](_0x36761b[_0x1b19('0x68')],[_0x1b19('0x79'),'id'])||{})[_0x1b19('0xdb')](function(_0x58c8b4){for(var _0xf419f2=0x0;_0xf419f2<_0x36761b[_0x1b19('0x68')][_0x1b19('0x79')]['length'];_0xf419f2+=0x1){socket[_0x1b19('0x12d')](_0x1b19('0x12e'),{'UserId':Number(_0x36761b['body'][_0x1b19('0x79')][_0xf419f2]),'ChatWebsiteId':Number(_0x36761b[_0x1b19('0x5d')]['id'])});}return _0x58c8b4;});}})[_0x1b19('0x2b')](respondWithResult(_0x438e38,null))['catch'](handleError(_0x438e38,null));};exports[_0x1b19('0x12f')]=function(_0x17fadd,_0xac896b){return db[_0x1b19('0x49')][_0x1b19('0x60')]({'where':{'id':_0x17fadd[_0x1b19('0x5d')]['id']}})['then'](handleEntityNotFound(_0xac896b,null))[_0x1b19('0x2b')](function(_0x985d61){if(_0x985d61){return _0x985d61['removeAgents'](_0x17fadd[_0x1b19('0x4d')][_0x1b19('0x79')])['then'](function(){if(_['isArray'](_0x17fadd[_0x1b19('0x4d')]['ids'])){for(var _0x4e7b48=0x0;_0x4e7b48<_0x17fadd['query'][_0x1b19('0x79')]['length'];_0x4e7b48+=0x1){socket['emit'](_0x1b19('0x130'),{'UserId':Number(_0x17fadd[_0x1b19('0x4d')][_0x1b19('0x79')][_0x4e7b48]),'ChatWebsiteId':Number(_0x17fadd[_0x1b19('0x5d')]['id'])});}}else{socket[_0x1b19('0x12d')](_0x1b19('0x130'),{'UserId':Number(_0x17fadd[_0x1b19('0x4d')][_0x1b19('0x79')]),'ChatWebsiteId':Number(_0x17fadd[_0x1b19('0x5d')]['id'])});}});}})[_0x1b19('0x2b')](respondWithStatusCode(_0xac896b,null))[_0x1b19('0x61')](handleError(_0xac896b,null));};exports[_0x1b19('0x131')]=function(_0xcdcbfa,_0x38a6b5){var _0x1940ad={};var _0x2eef91={};var _0x145ece;var _0xa60590;return db[_0x1b19('0x49')][_0x1b19('0xeb')]({'where':{'id':_0xcdcbfa[_0x1b19('0x5d')]['id']}})[_0x1b19('0x2b')](handleEntityNotFound(_0x38a6b5,null))['then'](function(_0x5e7f30){if(_0x5e7f30){_0x145ece=_0x5e7f30;_0x2eef91[_0x1b19('0x4c')]=_['keys'](db[_0x1b19('0xc7')]['rawAttributes']);_0x2eef91[_0x1b19('0x4d')]=_[_0x1b19('0x4e')](_0xcdcbfa[_0x1b19('0x4d')]);_0x2eef91[_0x1b19('0x57')]=_['intersection'](_0x2eef91[_0x1b19('0x4c')],_0x2eef91[_0x1b19('0x4d')]);_0x1940ad[_0x1b19('0x50')]=_[_0x1b19('0x4f')](_0x2eef91[_0x1b19('0x4c')],qs[_0x1b19('0x51')](_0xcdcbfa[_0x1b19('0x4d')][_0x1b19('0x51')]));_0x1940ad[_0x1b19('0x50')]=_0x1940ad[_0x1b19('0x50')][_0x1b19('0x52')]?_0x1940ad[_0x1b19('0x50')]:_0x2eef91['model'];_0x1940ad['order']=qs[_0x1b19('0x74')](_0xcdcbfa['query']['sort']);_0x1940ad[_0x1b19('0x56')]=qs[_0x1b19('0x57')](_[_0x1b19('0x75')](_0xcdcbfa[_0x1b19('0x4d')],_0x2eef91[_0x1b19('0x57')]));if(_0xcdcbfa[_0x1b19('0x4d')][_0x1b19('0x58')]){_0x1940ad['where']=_[_0x1b19('0x59')](_0x1940ad[_0x1b19('0x56')],{'$or':_[_0x1b19('0x48')](_0x1940ad['attributes'],function(_0x463146){var _0x455fa9={};_0x455fa9[_0x463146]={'$like':'%'+_0xcdcbfa[_0x1b19('0x4d')][_0x1b19('0x58')]+'%'};return _0x455fa9;})});}_0x1940ad=_[_0x1b19('0x59')]({},_0x1940ad,_0xcdcbfa[_0x1b19('0x5a')]);return _0x145ece[_0x1b19('0x131')](_0x1940ad);}})['then'](function(_0x54aecb){if(_0x54aecb){_0xa60590=_0x54aecb[_0x1b19('0x52')];if(!_0xcdcbfa['query'][_0x1b19('0x53')]('nolimit')){_0x1940ad['limit']=qs[_0x1b19('0x27')](_0xcdcbfa[_0x1b19('0x4d')]['limit']);_0x1940ad[_0x1b19('0x26')]=qs[_0x1b19('0x26')](_0xcdcbfa[_0x1b19('0x4d')]['offset']);}return _0x145ece[_0x1b19('0x131')](_0x1940ad);}})['then'](function(_0x472db2){if(_0x472db2){return _0x472db2?{'count':_0xa60590,'rows':_0x472db2}:null;}})[_0x1b19('0x2b')](respondWithResult(_0x38a6b5,null))[_0x1b19('0x61')](handleError(_0x38a6b5,null));};
\ No newline at end of file
diff --git a/server/api/chatWebsite/chatWebsite.events.js b/server/api/chatWebsite/chatWebsite.events.js
index f52c24e..2557632 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 _0xb790=['exports','../../mysqldb','update','emit','hasOwnProperty','hook'];(function(_0x1669fa,_0x1617a6){var _0x172622=function(_0x57a81b){while(--_0x57a81b){_0x1669fa['push'](_0x1669fa['shift']());}};_0x172622(++_0x1617a6);}(_0xb790,0xe5));var _0x0b79=function(_0xe65ac8,_0x2691be){_0xe65ac8=_0xe65ac8-0x0;var _0x202ba1=_0xb790[_0xe65ac8];return _0x202ba1;};'use strict';var EventEmitter=require('events');var ChatWebsite=require(_0x0b79('0x0'))['db']['ChatWebsite'];var ChatWebsiteEvents=new EventEmitter();ChatWebsiteEvents['setMaxListeners'](0x0);var events={'afterCreate':'save','afterUpdate':_0x0b79('0x1'),'afterDestroy':'remove'};function emitEvent(_0x4d16f6){return function(_0x2d75b0,_0x30b3fa,_0x55d197){ChatWebsiteEvents[_0x0b79('0x2')](_0x4d16f6+':'+_0x2d75b0['id'],_0x2d75b0);ChatWebsiteEvents[_0x0b79('0x2')](_0x4d16f6,_0x2d75b0);_0x55d197(null);};}for(var e in events){if(events[_0x0b79('0x3')](e)){var event=events[e];ChatWebsite[_0x0b79('0x4')](e,emitEvent(event));}}module[_0x0b79('0x5')]=ChatWebsiteEvents;
\ No newline at end of file
+var _0xf483=['hasOwnProperty','exports','../../mysqldb','setMaxListeners','save','update','remove','emit'];(function(_0x4b369d,_0x265eb8){var _0x571a98=function(_0x56341a){while(--_0x56341a){_0x4b369d['push'](_0x4b369d['shift']());}};_0x571a98(++_0x265eb8);}(_0xf483,0xf2));var _0x3f48=function(_0x4de6f0,_0x4b9110){_0x4de6f0=_0x4de6f0-0x0;var _0xef444b=_0xf483[_0x4de6f0];return _0xef444b;};'use strict';var EventEmitter=require('events');var ChatWebsite=require(_0x3f48('0x0'))['db']['ChatWebsite'];var ChatWebsiteEvents=new EventEmitter();ChatWebsiteEvents[_0x3f48('0x1')](0x0);var events={'afterCreate':_0x3f48('0x2'),'afterUpdate':_0x3f48('0x3'),'afterDestroy':_0x3f48('0x4')};function emitEvent(_0x169391){return function(_0x312d9c,_0x5deb61,_0x49f64a){ChatWebsiteEvents['emit'](_0x169391+':'+_0x312d9c['id'],_0x312d9c);ChatWebsiteEvents[_0x3f48('0x5')](_0x169391,_0x312d9c);_0x49f64a(null);};}for(var e in events){if(events[_0x3f48('0x6')](e)){var event=events[e];ChatWebsite['hook'](e,emitEvent(event));}}module[_0x3f48('0x7')]=ChatWebsiteEvents;
\ No newline at end of file
diff --git a/server/api/chatWebsite/chatWebsite.model.js b/server/api/chatWebsite/chatWebsite.model.js
index 9917c8a..e73aedb 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 _0x542b=['util','../../config/logger','api','bluebird','request-promise','path','../../config/environment','./chatWebsite.attributes','exports','define','ChatWebsite','chat_websites','lodash'];(function(_0x4418b2,_0x5d6c76){var _0x379e74=function(_0x14b351){while(--_0x14b351){_0x4418b2['push'](_0x4418b2['shift']());}};_0x379e74(++_0x5d6c76);}(_0x542b,0xb5));var _0xb542=function(_0x54edc9,_0x345f01){_0x54edc9=_0x54edc9-0x0;var _0x2ae7a9=_0x542b[_0x54edc9];return _0x2ae7a9;};'use strict';var _=require(_0xb542('0x0'));var util=require(_0xb542('0x1'));var logger=require(_0xb542('0x2'))(_0xb542('0x3'));var moment=require('moment');var BPromise=require(_0xb542('0x4'));var rp=require(_0xb542('0x5'));var fs=require('fs');var path=require(_0xb542('0x6'));var rimraf=require('rimraf');var config=require(_0xb542('0x7'));var attributes=require(_0xb542('0x8'));module[_0xb542('0x9')]=function(_0x146e3d,_0x16ed4){return _0x146e3d[_0xb542('0xa')](_0xb542('0xb'),attributes,{'tableName':_0xb542('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x46e4=['rimraf','./chatWebsite.attributes','exports','define','ChatWebsite','lodash','util','../../config/logger','request-promise'];(function(_0x93de5d,_0x237c83){var _0x1b9a00=function(_0x32e693){while(--_0x32e693){_0x93de5d['push'](_0x93de5d['shift']());}};_0x1b9a00(++_0x237c83);}(_0x46e4,0x15b));var _0x446e=function(_0x50b16c,_0x5e9cce){_0x50b16c=_0x50b16c-0x0;var _0x4e939a=_0x46e4[_0x50b16c];return _0x4e939a;};'use strict';var _=require(_0x446e('0x0'));var util=require(_0x446e('0x1'));var logger=require(_0x446e('0x2'))('api');var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x446e('0x3'));var fs=require('fs');var path=require('path');var rimraf=require(_0x446e('0x4'));var config=require('../../config/environment');var attributes=require(_0x446e('0x5'));module[_0x446e('0x6')]=function(_0x48e35e,_0x2b6072){return _0x48e35e[_0x446e('0x7')](_0x446e('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 9324b0e..31626b2 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 _0xc476=['info','result','catch','lodash','util','moment','bluebird','ioredis','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','socket.io-emitter','./chatWebsite.socket','register','ChatWebsite,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message'];(function(_0x175f09,_0x5f158d){var _0x5d99fe=function(_0x4b828c){while(--_0x4b828c){_0x175f09['push'](_0x175f09['shift']());}};_0x5d99fe(++_0x5f158d);}(_0xc476,0x161));var _0x6c47=function(_0x3caae0,_0x2a5646){_0x3caae0=_0x3caae0-0x0;var _0x34e8bc=_0xc476[_0x3caae0];return _0x34e8bc;};'use strict';var _=require(_0x6c47('0x0'));var util=require(_0x6c47('0x1'));var moment=require(_0x6c47('0x2'));var BPromise=require(_0x6c47('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x6c47('0x4'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x6c47('0x5'));var config=require(_0x6c47('0x6'));var jayson=require(_0x6c47('0x7'));var client=jayson[_0x6c47('0x8')][_0x6c47('0x9')]({'port':0x232a});config[_0x6c47('0xa')]=_[_0x6c47('0xb')](config[_0x6c47('0xa')],{'host':'localhost','port':0x18eb});var socket=require(_0x6c47('0xc'))(new Redis(config['redis']));require(_0x6c47('0xd'))[_0x6c47('0xe')](socket);function respondWithRpcPromise(_0xe0471,_0x173604,_0x5b3814){return new BPromise(function(_0x16417e,_0x49355a){return client['request'](_0xe0471,_0x5b3814)['then'](function(_0x562cc0){logger['info'](_0x6c47('0xf'),_0x173604,_0x6c47('0x10'));logger[_0x6c47('0x11')]('ChatWebsite,\x20%s,\x20%s,\x20%s',_0x173604,_0x6c47('0x10'),JSON[_0x6c47('0x12')](_0x562cc0));if(_0x562cc0['error']){if(_0x562cc0[_0x6c47('0x13')][_0x6c47('0x14')]===0x1f4){logger['error'](_0x6c47('0xf'),_0x173604,_0x562cc0[_0x6c47('0x13')][_0x6c47('0x15')]);return _0x49355a(_0x562cc0[_0x6c47('0x13')][_0x6c47('0x15')]);}logger['error'](_0x6c47('0xf'),_0x173604,_0x562cc0[_0x6c47('0x13')][_0x6c47('0x15')]);return _0x16417e(_0x562cc0['error']['message']);}else{logger[_0x6c47('0x16')](_0x6c47('0xf'),_0x173604,_0x6c47('0x10'));_0x16417e(_0x562cc0[_0x6c47('0x17')][_0x6c47('0x15')]);}})[_0x6c47('0x18')](function(_0xb8dc09){logger[_0x6c47('0x13')](_0x6c47('0xf'),_0x173604,_0xb8dc09);_0x49355a(_0xb8dc09);});});}
\ No newline at end of file
+var _0xcc55=['result','catch','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','redis','defaults','socket.io-emitter','register','request','then','ChatWebsite,\x20%s,\x20%s','debug','ChatWebsite,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','info'];(function(_0x1f354d,_0x3c1285){var _0x48dedc=function(_0x9e309d){while(--_0x9e309d){_0x1f354d['push'](_0x1f354d['shift']());}};_0x48dedc(++_0x3c1285);}(_0xcc55,0x72));var _0x5cc5=function(_0x405f68,_0x507363){_0x405f68=_0x405f68-0x0;var _0x1b9c6f=_0xcc55[_0x405f68];return _0x1b9c6f;};'use strict';var _=require(_0x5cc5('0x0'));var util=require(_0x5cc5('0x1'));var moment=require(_0x5cc5('0x2'));var BPromise=require(_0x5cc5('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x5cc5('0x4'));var db=require(_0x5cc5('0x5'))['db'];var utils=require(_0x5cc5('0x6'));var logger=require(_0x5cc5('0x7'))(_0x5cc5('0x8'));var config=require(_0x5cc5('0x9'));var jayson=require(_0x5cc5('0xa'));var client=jayson['client']['http']({'port':0x232a});config[_0x5cc5('0xb')]=_[_0x5cc5('0xc')](config[_0x5cc5('0xb')],{'host':'localhost','port':0x18eb});var socket=require(_0x5cc5('0xd'))(new Redis(config[_0x5cc5('0xb')]));require('./chatWebsite.socket')[_0x5cc5('0xe')](socket);function respondWithRpcPromise(_0x277686,_0x46c961,_0x627975){return new BPromise(function(_0x5cd5f0,_0x4c8bc0){return client[_0x5cc5('0xf')](_0x277686,_0x627975)[_0x5cc5('0x10')](function(_0x5437d1){logger['info'](_0x5cc5('0x11'),_0x46c961,'request\x20sent');logger[_0x5cc5('0x12')](_0x5cc5('0x13'),_0x46c961,_0x5cc5('0x14'),JSON[_0x5cc5('0x15')](_0x5437d1));if(_0x5437d1[_0x5cc5('0x16')]){if(_0x5437d1[_0x5cc5('0x16')][_0x5cc5('0x17')]===0x1f4){logger[_0x5cc5('0x16')](_0x5cc5('0x11'),_0x46c961,_0x5437d1[_0x5cc5('0x16')][_0x5cc5('0x18')]);return _0x4c8bc0(_0x5437d1[_0x5cc5('0x16')][_0x5cc5('0x18')]);}logger[_0x5cc5('0x16')](_0x5cc5('0x11'),_0x46c961,_0x5437d1[_0x5cc5('0x16')]['message']);return _0x5cd5f0(_0x5437d1[_0x5cc5('0x16')][_0x5cc5('0x18')]);}else{logger[_0x5cc5('0x19')](_0x5cc5('0x11'),_0x46c961,'request\x20sent');_0x5cd5f0(_0x5437d1[_0x5cc5('0x1a')]['message']);}})[_0x5cc5('0x1b')](function(_0x543fb7){logger[_0x5cc5('0x16')](_0x5cc5('0x11'),_0x46c961,_0x543fb7);_0x4c8bc0(_0x543fb7);});});}
\ No newline at end of file
diff --git a/server/api/chatWebsite/chatWebsite.socket.js b/server/api/chatWebsite/chatWebsite.socket.js
index 38780d4..2a0d5ff 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 _0xb958=['chatWebsite:','./chatWebsite.events','update','emit','removeListener','register','length'];(function(_0x1bb7be,_0x84652d){var _0x2101d4=function(_0x242a89){while(--_0x242a89){_0x1bb7be['push'](_0x1bb7be['shift']());}};_0x2101d4(++_0x84652d);}(_0xb958,0xb0));var _0x8b95=function(_0x1c37a5,_0x59ee51){_0x1c37a5=_0x1c37a5-0x0;var _0x389d03=_0xb958[_0x1c37a5];return _0x389d03;};'use strict';var ChatWebsiteEvents=require(_0x8b95('0x0'));var events=['save','remove',_0x8b95('0x1')];function createListener(_0x266166,_0x47c5a0){return function(_0x527bc1){_0x47c5a0[_0x8b95('0x2')](_0x266166,_0x527bc1);};}function removeListener(_0x1bf94b,_0x1bb8be){return function(){ChatWebsiteEvents[_0x8b95('0x3')](_0x1bf94b,_0x1bb8be);};}exports[_0x8b95('0x4')]=function(_0x18c7fe){for(var _0x385991=0x0,_0x1b7a2b=events[_0x8b95('0x5')];_0x385991<_0x1b7a2b;_0x385991++){var _0x14b3c9=events[_0x385991];var _0x4dd3f6=createListener(_0x8b95('0x6')+_0x14b3c9,_0x18c7fe);ChatWebsiteEvents['on'](_0x14b3c9,_0x4dd3f6);}};
\ No newline at end of file
+var _0x78d0=['emit','removeListener','length','./chatWebsite.events','remove','update'];(function(_0x329918,_0x36a6a4){var _0xa2730c=function(_0x538c84){while(--_0x538c84){_0x329918['push'](_0x329918['shift']());}};_0xa2730c(++_0x36a6a4);}(_0x78d0,0x129));var _0x078d=function(_0xc95bb4,_0x49d6fa){_0xc95bb4=_0xc95bb4-0x0;var _0x23f569=_0x78d0[_0xc95bb4];return _0x23f569;};'use strict';var ChatWebsiteEvents=require(_0x078d('0x0'));var events=['save',_0x078d('0x1'),_0x078d('0x2')];function createListener(_0x1cb794,_0x42beb7){return function(_0x53ed98){_0x42beb7[_0x078d('0x3')](_0x1cb794,_0x53ed98);};}function removeListener(_0x2f518c,_0x5d548c){return function(){ChatWebsiteEvents[_0x078d('0x4')](_0x2f518c,_0x5d548c);};}exports['register']=function(_0x562528){for(var _0x15cd02=0x0,_0x4a786d=events[_0x078d('0x5')];_0x15cd02<_0x4a786d;_0x15cd02++){var _0x2f1d3f=events[_0x15cd02];var _0x193476=createListener('chatWebsite:'+_0x2f1d3f,_0x562528);ChatWebsiteEvents['on'](_0x2f1d3f,_0x193476);}};
\ No newline at end of file
diff --git a/server/api/chatWebsite/helpers/wildcard-expressions.js b/server/api/chatWebsite/helpers/wildcard-expressions.js
index 7c45fa3..1b6c77f 100644
--- a/server/api/chatWebsite/helpers/wildcard-expressions.js
+++ b/server/api/chatWebsite/helpers/wildcard-expressions.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x43fd=['../../../utils/misc','escapeRegExp','URL','replace','localhost','test','([\x5cw]+)','exports'];(function(_0x20a9d0,_0x1ab2b3){var _0xf67c4e=function(_0x217a43){while(--_0x217a43){_0x20a9d0['push'](_0x20a9d0['shift']());}};_0xf67c4e(++_0x1ab2b3);}(_0x43fd,0x150));var _0xd43f=function(_0x33dd78,_0x13c918){_0x33dd78=_0x33dd78-0x0;var _0x3efdaf=_0x43fd[_0x33dd78];return _0x3efdaf;};var escapeRegExp=require(_0xd43f('0x0'))[_0xd43f('0x1')];var URL=require('url')[_0xd43f('0x2')];function testWildcardValidity(_0x4fcc11){let _0x3ba8e5=!![];try{new URL(_0x4fcc11[_0xd43f('0x3')]('*',_0xd43f('0x4')));}catch(_0x466a7a){_0x3ba8e5=![];}return _0x3ba8e5&&new RegExp(/(http(s)?):\/\/(\*|(((\*\.)+)?([a-zA-Z0-9\-_]+\.){0,}([a-zA-Z0-9\-_]+)))(:[\d]+)?\/?$/)[_0xd43f('0x5')](_0x4fcc11);}function testWebsiteWithWildcard(_0x14e48f,_0xdd2104){let _0x2807ed;const _0xfede84=escapeRegExp(_0x14e48f)[_0xd43f('0x3')]('\x5c*',_0xd43f('0x6'));try{new URL(_0x14e48f[_0xd43f('0x3')]('\x5c*',_0xd43f('0x4')));_0x2807ed=new RegExp(_0xfede84)[_0xd43f('0x5')](_0xdd2104);}catch(_0x587add){_0x2807ed=![];}return _0x2807ed;}module[_0xd43f('0x7')]={'testWebsiteWithWildcard':testWebsiteWithWildcard,'testWildcardValidity':testWildcardValidity};
\ No newline at end of file
+var _0x0adf=['url','replace','localhost','test','trim','([\x5cw]+)','exports','../../../utils/misc','escapeRegExp'];(function(_0x3e3a17,_0x4e928b){var _0x2a74a2=function(_0x251e9f){while(--_0x251e9f){_0x3e3a17['push'](_0x3e3a17['shift']());}};_0x2a74a2(++_0x4e928b);}(_0x0adf,0x1d2));var _0xf0ad=function(_0x101199,_0x1dbe12){_0x101199=_0x101199-0x0;var _0x767ecc=_0x0adf[_0x101199];return _0x767ecc;};var escapeRegExp=require(_0xf0ad('0x0'))[_0xf0ad('0x1')];var URL=require(_0xf0ad('0x2'))['URL'];function testWildcardValidity(_0x4a97fd){var _0x10cf5b=!![];try{new URL(_0x4a97fd[_0xf0ad('0x3')]('*',_0xf0ad('0x4')));}catch(_0x27d666){_0x10cf5b=![];}return _0x10cf5b&&new RegExp(/(http(s)?):\/\/(\*|(((\*\.)+)?([a-zA-Z0-9\-_]+\.){0,}([a-zA-Z0-9\-_]+)))(:[\d]+)?\/?$/)[_0xf0ad('0x5')](_0x4a97fd);}function testWebsiteWithWildcard(_0x719547,_0x59a588){var _0x3bbf85;var _0x53221f=escapeRegExp(_0x719547[_0xf0ad('0x6')]()[_0xf0ad('0x3')](/\/$/,''))[_0xf0ad('0x3')]('\x5c*',_0xf0ad('0x7'));try{new URL(_0x719547[_0xf0ad('0x3')]('\x5c*',_0xf0ad('0x4')));_0x3bbf85=new RegExp(_0x53221f)[_0xf0ad('0x5')](_0x59a588);}catch(_0x5bdf69){_0x3bbf85=![];}return _0x3bbf85;}module[_0xf0ad('0x8')]={'testWebsiteWithWildcard':testWebsiteWithWildcard,'testWildcardValidity':testWildcardValidity};
\ No newline at end of file
diff --git a/server/api/chatWebsite/index.js b/server/api/chatWebsite/index.js
index 5201ecd..3364c47 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 _0xd900=['removeAgents','multer','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./chatWebsite.controller','isAuthenticated','index','get','show','/:id/dispositions','getAnswers','/:id/logo','/:id/avatar','getAvatar','getCustomerAvatar','/:id/system_avatar','getSystemAvatar','/:id/interactions','/:id/snippet','/:id/proactive_actions','getProactiveActions','getFields','/:id/offline_messages','post','create','addDisposition','/:id/canned_answers','addAnswer','diskStorage','join','root','server/files/images/logos/','format','%s-%s','now','originalname','file','addLogo','server/files/images/avatars/','single','addAvatar','/:id/customer_avatar','addCustomerAvatar','/:id/notify','notify','server/files','attachments','ensureDir','replace','extname','any','addInteraction','/:id/applications','addApplications','addProactiveActions','/:id/users','put','/:id','update','delete','removeDispositions'];(function(_0x436d89,_0x439faa){var _0x5f58d9=function(_0x2357ea){while(--_0x2357ea){_0x436d89['push'](_0x436d89['shift']());}};_0x5f58d9(++_0x439faa);}(_0xd900,0x109));var _0x0d90=function(_0x334d1e,_0x28a488){_0x334d1e=_0x334d1e-0x0;var _0x3b33ba=_0xd900[_0x334d1e];return _0x3b33ba;};'use strict';var multer=require(_0x0d90('0x0'));var util=require('util');var path=require(_0x0d90('0x1'));var timeout=require(_0x0d90('0x2'));var express=require(_0x0d90('0x3'));var router=express[_0x0d90('0x4')]();var fs_extra=require(_0x0d90('0x5'));var auth=require(_0x0d90('0x6'));var interaction=require(_0x0d90('0x7'));var config=require('../../config/environment');var controller=require(_0x0d90('0x8'));router['get']('/',auth[_0x0d90('0x9')](),controller[_0x0d90('0xa')]);router[_0x0d90('0xb')]('/describe',auth[_0x0d90('0x9')](),controller['describe']);router[_0x0d90('0xb')]('/:id',auth['isAuthenticated'](),controller[_0x0d90('0xc')]);router[_0x0d90('0xb')](_0x0d90('0xd'),auth[_0x0d90('0x9')](),controller['getDispositions']);router[_0x0d90('0xb')]('/:id/canned_answers',auth[_0x0d90('0x9')](),controller[_0x0d90('0xe')]);router[_0x0d90('0xb')](_0x0d90('0xf'),controller['getLogo']);router['get'](_0x0d90('0x10'),controller[_0x0d90('0x11')]);router[_0x0d90('0xb')]('/:id/customer_avatar',controller[_0x0d90('0x12')]);router[_0x0d90('0xb')](_0x0d90('0x13'),controller[_0x0d90('0x14')]);router['get'](_0x0d90('0x15'),auth[_0x0d90('0x9')](),controller['getInteractions']);router[_0x0d90('0xb')](_0x0d90('0x16'),controller['getSnippet']);router[_0x0d90('0xb')]('/:id/applications',auth[_0x0d90('0x9')](),controller['getApplications']);router[_0x0d90('0xb')](_0x0d90('0x17'),auth[_0x0d90('0x9')](),controller[_0x0d90('0x18')]);router[_0x0d90('0xb')]('/:id/fields',controller[_0x0d90('0x19')]);router[_0x0d90('0xb')](_0x0d90('0x1a'),auth[_0x0d90('0x9')](),controller['getOfflineMessages']);router['get']('/:id/users',auth[_0x0d90('0x9')](),controller['getAgents']);router[_0x0d90('0x1b')]('/',auth[_0x0d90('0x9')](),controller[_0x0d90('0x1c')]);router[_0x0d90('0x1b')](_0x0d90('0xd'),auth[_0x0d90('0x9')](),controller[_0x0d90('0x1d')]);router[_0x0d90('0x1b')](_0x0d90('0x1e'),auth[_0x0d90('0x9')](),controller[_0x0d90('0x1f')]);var upload=multer({'storage':multer[_0x0d90('0x20')]({'destination':function(_0x52db11,_0x4d5b9b,_0x509644){_0x509644(null,path[_0x0d90('0x21')](config[_0x0d90('0x22')],_0x0d90('0x23')));},'filename':function(_0x99822,_0x1a519e,_0x4f93c8){_0x4f93c8(null,util[_0x0d90('0x24')](_0x0d90('0x25'),Date[_0x0d90('0x26')](),_0x1a519e[_0x0d90('0x27')]));}})});router['post'](_0x0d90('0xf'),upload['single'](_0x0d90('0x28')),controller[_0x0d90('0x29')]);var upload=multer({'storage':multer[_0x0d90('0x20')]({'destination':function(_0x37c0c7,_0x284b04,_0x464fa2){_0x464fa2(null,path['join'](config[_0x0d90('0x22')],_0x0d90('0x2a')));},'filename':function(_0x5ab6a,_0x31a5a4,_0x1e5aa8){_0x1e5aa8(null,util[_0x0d90('0x24')]('%s-%s',Date[_0x0d90('0x26')](),_0x31a5a4[_0x0d90('0x27')]));}})});router['post'](_0x0d90('0x10'),upload[_0x0d90('0x2b')]('file'),controller[_0x0d90('0x2c')]);var upload=multer({'storage':multer[_0x0d90('0x20')]({'destination':function(_0x2cc138,_0x5b73ba,_0x119526){_0x119526(null,path[_0x0d90('0x21')](config[_0x0d90('0x22')],'server/files/images/avatars/'));},'filename':function(_0x31c708,_0x154b1b,_0x1ba13e){_0x1ba13e(null,util[_0x0d90('0x24')]('%s-%s',Date[_0x0d90('0x26')](),_0x154b1b[_0x0d90('0x27')]));}})});router[_0x0d90('0x1b')](_0x0d90('0x2d'),upload[_0x0d90('0x2b')]('file'),controller[_0x0d90('0x2e')]);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x12f956,_0x1325e9,_0x31ed2e){_0x31ed2e(null,path[_0x0d90('0x21')](config[_0x0d90('0x22')],_0x0d90('0x2a')));},'filename':function(_0x128eac,_0x5b81b9,_0x217c69){_0x217c69(null,util[_0x0d90('0x24')](_0x0d90('0x25'),Date['now'](),_0x5b81b9['originalname']));}})});router['post'](_0x0d90('0x13'),upload[_0x0d90('0x2b')](_0x0d90('0x28')),controller['addSystemAvatar']);router[_0x0d90('0x1b')](_0x0d90('0x2f'),controller[_0x0d90('0x30')]);const offlineUploadMulter=multer({'storage':multer[_0x0d90('0x20')]({'destination':function(_0x1d7233,_0x1da3a4,_0x386f2b){const _0x1c7fbe=path[_0x0d90('0x21')](config[_0x0d90('0x22')],_0x0d90('0x31'),_0x0d90('0x32'),'offline-chat');fs_extra[_0x0d90('0x33')](_0x1c7fbe,function(){_0x386f2b(null,_0x1c7fbe);});},'filename':function(_0x1fb115,_0x200d02,_0x3b55c6){const _0x279d72=_0x200d02[_0x0d90('0x27')][_0x0d90('0x34')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');const _0x506fe5=path[_0x0d90('0x35')](_0x279d72);const _0x9a651a=Date['now']()+'-'+_0x279d72[_0x0d90('0x34')](_0x506fe5,'')+_0x506fe5;_0x3b55c6(null,_0x9a651a);}})});router['post']('/:id/offline',offlineUploadMulter[_0x0d90('0x36')](),controller['offline']);router[_0x0d90('0x1b')](_0x0d90('0x15'),auth[_0x0d90('0x9')](),controller[_0x0d90('0x37')]);router[_0x0d90('0x1b')](_0x0d90('0x38'),auth[_0x0d90('0x9')](),controller[_0x0d90('0x39')]);router['post']('/:id/proactive_actions',auth['isAuthenticated'](),controller[_0x0d90('0x3a')]);router['post'](_0x0d90('0x3b'),auth[_0x0d90('0x9')](),controller['addAgents']);router[_0x0d90('0x3c')](_0x0d90('0x3d'),auth[_0x0d90('0x9')](),controller[_0x0d90('0x3e')]);router[_0x0d90('0x3f')](_0x0d90('0x3d'),auth[_0x0d90('0x9')](),controller['destroy']);router[_0x0d90('0x3f')](_0x0d90('0xd'),auth[_0x0d90('0x9')](),controller[_0x0d90('0x40')]);router[_0x0d90('0x3f')](_0x0d90('0x1e'),auth[_0x0d90('0x9')](),controller['removeAnswers']);router[_0x0d90('0x3f')]('/:id/users',auth['isAuthenticated'](),controller[_0x0d90('0x41')]);module['exports']=router;
\ No newline at end of file
+var _0xfefc=['removeDispositions','removeAnswers','removeAgents','exports','express','Router','../../components/auth/service','../../config/environment','./chatWebsite.controller','get','isAuthenticated','index','/describe','describe','show','/:id/dispositions','/:id/canned_answers','getAnswers','/:id/logo','/:id/avatar','getAvatar','/:id/customer_avatar','getCustomerAvatar','/:id/system_avatar','getSystemAvatar','/:id/interactions','/:id/snippet','getSnippet','/:id/applications','getApplications','/:id/proactive_actions','/:id/fields','getFields','create','post','addAnswer','root','format','now','originalname','single','file','addLogo','diskStorage','join','server/files/images/avatars/','%s-%s','addAvatar','addCustomerAvatar','addSystemAvatar','/:id/notify','notify','server/files','attachments','offline-chat','ensureDir','replace','extname','any','addInteraction','/:id','update','destroy','delete'];(function(_0x538e56,_0x4fa43c){var _0x232357=function(_0x2de1ad){while(--_0x2de1ad){_0x538e56['push'](_0x538e56['shift']());}};_0x232357(++_0x4fa43c);}(_0xfefc,0xc4));var _0xcfef=function(_0x3c5436,_0x154db5){_0x3c5436=_0x3c5436-0x0;var _0xf8c236=_0xfefc[_0x3c5436];return _0xf8c236;};'use strict';var multer=require('multer');var util=require('util');var path=require('path');var timeout=require('connect-timeout');var express=require(_0xcfef('0x0'));var router=express[_0xcfef('0x1')]();var fs_extra=require('fs-extra');var auth=require(_0xcfef('0x2'));var interaction=require('../../components/interaction/service');var config=require(_0xcfef('0x3'));var controller=require(_0xcfef('0x4'));router[_0xcfef('0x5')]('/',auth[_0xcfef('0x6')](),controller[_0xcfef('0x7')]);router[_0xcfef('0x5')](_0xcfef('0x8'),auth[_0xcfef('0x6')](),controller[_0xcfef('0x9')]);router[_0xcfef('0x5')]('/:id',auth['isAuthenticated'](),controller[_0xcfef('0xa')]);router[_0xcfef('0x5')](_0xcfef('0xb'),auth[_0xcfef('0x6')](),controller['getDispositions']);router[_0xcfef('0x5')](_0xcfef('0xc'),auth[_0xcfef('0x6')](),controller[_0xcfef('0xd')]);router[_0xcfef('0x5')](_0xcfef('0xe'),controller['getLogo']);router[_0xcfef('0x5')](_0xcfef('0xf'),controller[_0xcfef('0x10')]);router[_0xcfef('0x5')](_0xcfef('0x11'),controller[_0xcfef('0x12')]);router[_0xcfef('0x5')](_0xcfef('0x13'),controller[_0xcfef('0x14')]);router[_0xcfef('0x5')](_0xcfef('0x15'),auth[_0xcfef('0x6')](),controller['getInteractions']);router['get'](_0xcfef('0x16'),controller[_0xcfef('0x17')]);router['get'](_0xcfef('0x18'),auth[_0xcfef('0x6')](),controller[_0xcfef('0x19')]);router[_0xcfef('0x5')](_0xcfef('0x1a'),auth[_0xcfef('0x6')](),controller['getProactiveActions']);router[_0xcfef('0x5')](_0xcfef('0x1b'),controller[_0xcfef('0x1c')]);router[_0xcfef('0x5')]('/:id/offline_messages',auth[_0xcfef('0x6')](),controller['getOfflineMessages']);router['get']('/:id/users',auth[_0xcfef('0x6')](),controller['getAgents']);router['post']('/',auth[_0xcfef('0x6')](),controller[_0xcfef('0x1d')]);router['post']('/:id/dispositions',auth[_0xcfef('0x6')](),controller['addDisposition']);router[_0xcfef('0x1e')](_0xcfef('0xc'),auth['isAuthenticated'](),controller[_0xcfef('0x1f')]);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x1869f6,_0x3aa6da,_0x485d7c){_0x485d7c(null,path['join'](config[_0xcfef('0x20')],'server/files/images/logos/'));},'filename':function(_0x498563,_0x48a67f,_0x5c71ae){_0x5c71ae(null,util[_0xcfef('0x21')]('%s-%s',Date[_0xcfef('0x22')](),_0x48a67f[_0xcfef('0x23')]));}})});router['post'](_0xcfef('0xe'),upload[_0xcfef('0x24')](_0xcfef('0x25')),controller[_0xcfef('0x26')]);var upload=multer({'storage':multer[_0xcfef('0x27')]({'destination':function(_0x2e0248,_0x1d8b38,_0x1b3ff2){_0x1b3ff2(null,path[_0xcfef('0x28')](config[_0xcfef('0x20')],_0xcfef('0x29')));},'filename':function(_0x37eadf,_0x4f6483,_0x4e02f1){_0x4e02f1(null,util['format'](_0xcfef('0x2a'),Date[_0xcfef('0x22')](),_0x4f6483[_0xcfef('0x23')]));}})});router['post'](_0xcfef('0xf'),upload[_0xcfef('0x24')](_0xcfef('0x25')),controller[_0xcfef('0x2b')]);var upload=multer({'storage':multer[_0xcfef('0x27')]({'destination':function(_0x2a59ed,_0x4f539f,_0x61940e){_0x61940e(null,path[_0xcfef('0x28')](config['root'],_0xcfef('0x29')));},'filename':function(_0x420dec,_0x2a2bd0,_0x42d667){_0x42d667(null,util[_0xcfef('0x21')](_0xcfef('0x2a'),Date[_0xcfef('0x22')](),_0x2a2bd0[_0xcfef('0x23')]));}})});router[_0xcfef('0x1e')]('/:id/customer_avatar',upload[_0xcfef('0x24')](_0xcfef('0x25')),controller[_0xcfef('0x2c')]);var upload=multer({'storage':multer[_0xcfef('0x27')]({'destination':function(_0x36dd0c,_0x6a8e50,_0x47dc4e){_0x47dc4e(null,path['join'](config['root'],'server/files/images/avatars/'));},'filename':function(_0x2f69d0,_0xe35381,_0xcdb06e){_0xcdb06e(null,util[_0xcfef('0x21')]('%s-%s',Date[_0xcfef('0x22')](),_0xe35381['originalname']));}})});router['post']('/:id/system_avatar',upload[_0xcfef('0x24')](_0xcfef('0x25')),controller[_0xcfef('0x2d')]);router['post'](_0xcfef('0x2e'),controller[_0xcfef('0x2f')]);const offlineUploadMulter=multer({'storage':multer[_0xcfef('0x27')]({'destination':function(_0x93be99,_0x148933,_0x14edb0){const _0xd6ddcf=path[_0xcfef('0x28')](config[_0xcfef('0x20')],_0xcfef('0x30'),_0xcfef('0x31'),_0xcfef('0x32'));fs_extra[_0xcfef('0x33')](_0xd6ddcf,function(){_0x14edb0(null,_0xd6ddcf);});},'filename':function(_0x41a8cf,_0x4ddf4a,_0x361e1a){const _0x9ae86f=_0x4ddf4a[_0xcfef('0x23')][_0xcfef('0x34')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');const _0x3151ac=path[_0xcfef('0x35')](_0x9ae86f);const _0x2be1fc=Date['now']()+'-'+_0x9ae86f[_0xcfef('0x34')](_0x3151ac,'')+_0x3151ac;_0x361e1a(null,_0x2be1fc);}})});router[_0xcfef('0x1e')]('/:id/offline',offlineUploadMulter[_0xcfef('0x36')](),controller['offline']);router[_0xcfef('0x1e')]('/:id/interactions',auth['isAuthenticated'](),controller[_0xcfef('0x37')]);router[_0xcfef('0x1e')](_0xcfef('0x18'),auth[_0xcfef('0x6')](),controller['addApplications']);router[_0xcfef('0x1e')]('/:id/proactive_actions',auth[_0xcfef('0x6')](),controller['addProactiveActions']);router[_0xcfef('0x1e')]('/:id/users',auth[_0xcfef('0x6')](),controller['addAgents']);router['put'](_0xcfef('0x38'),auth['isAuthenticated'](),controller[_0xcfef('0x39')]);router['delete'](_0xcfef('0x38'),auth[_0xcfef('0x6')](),controller[_0xcfef('0x3a')]);router[_0xcfef('0x3b')](_0xcfef('0xb'),auth[_0xcfef('0x6')](),controller[_0xcfef('0x3c')]);router[_0xcfef('0x3b')](_0xcfef('0xc'),auth[_0xcfef('0x6')](),controller[_0xcfef('0x3d')]);router[_0xcfef('0x3b')]('/:id/users',auth[_0xcfef('0x6')](),controller[_0xcfef('0x3e')]);module[_0xcfef('0x3f')]=router;
\ No newline at end of file
diff --git a/server/api/client-side-logs.js b/server/api/client-side-logs.js
index 3390d3d..f722553 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 _0x380d=['env','app','get','client-side-logger','Client-Side\x20logger\x20not\x20found!','expressEndpoint','/client-logs','use','exports','beaver-logger/server','express','../components/auth/service'];(function(_0x3ce466,_0x1163b5){var _0x321502=function(_0x234978){while(--_0x234978){_0x3ce466['push'](_0x3ce466['shift']());}};_0x321502(++_0x1163b5);}(_0x380d,0x165));var _0xd380=function(_0x364009,_0x4f2fbe){_0x364009=_0x364009-0x0;var _0x2c0b12=_0x380d[_0x364009];return _0x2c0b12;};var beaverLogger=require(_0xd380('0x0'));var express=require(_0xd380('0x1'));var auth=require(_0xd380('0x2'));var config=require('../config/environment');var router=express['Router']();var isProduction=config[_0xd380('0x3')]==='production'||![];function clientSideLogs(_0x4fcb83,_0x3436f6,_0x19db5f){var _0x4d73d7=_0x4fcb83[_0xd380('0x4')][_0xd380('0x5')](_0xd380('0x6'));if(!_0x4d73d7){throw new Error(_0xd380('0x7'));}return beaverLogger[_0xd380('0x8')]({'uri':_0xd380('0x9'),'logger':_0x4d73d7,'enableCors':!isProduction})(_0x4fcb83,_0x3436f6,_0x19db5f);}router[_0xd380('0xa')](auth['isAuthenticated'](),clientSideLogs);module[_0xd380('0xb')]=router;
\ No newline at end of file
+var _0x3b55=['../config/environment','env','production','app','get','Client-Side\x20logger\x20not\x20found!','expressEndpoint','/client-logs','use','isAuthenticated','exports','beaver-logger/server','express','../components/auth/service'];(function(_0x2c81aa,_0xec314c){var _0x5a194a=function(_0x23cf5c){while(--_0x23cf5c){_0x2c81aa['push'](_0x2c81aa['shift']());}};_0x5a194a(++_0xec314c);}(_0x3b55,0x1e7));var _0x53b5=function(_0x163742,_0x467e36){_0x163742=_0x163742-0x0;var _0x1152ac=_0x3b55[_0x163742];return _0x1152ac;};var beaverLogger=require(_0x53b5('0x0'));var express=require(_0x53b5('0x1'));var auth=require(_0x53b5('0x2'));var config=require(_0x53b5('0x3'));var router=express['Router']();var isProduction=config[_0x53b5('0x4')]===_0x53b5('0x5')||![];function clientSideLogs(_0x22cb0b,_0x333644,_0x26396d){var _0x4673a4=_0x22cb0b[_0x53b5('0x6')][_0x53b5('0x7')]('client-side-logger');if(!_0x4673a4){throw new Error(_0x53b5('0x8'));}return beaverLogger[_0x53b5('0x9')]({'uri':_0x53b5('0xa'),'logger':_0x4673a4,'enableCors':!isProduction})(_0x22cb0b,_0x333644,_0x26396d);}router[_0x53b5('0xb')](auth[_0x53b5('0xc')](),clientSideLogs);module[_0x53b5('0xd')]=router;
\ No newline at end of file
diff --git a/server/api/cloudProvider/cloudProvider.attributes.js b/server/api/cloudProvider/cloudProvider.attributes.js
index 7b8c4f4..f82685e 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 _0xdbc9=['MicrosoftAzure\x20=>\x20access_token','MicrosoftAzure\x20=>\x20Dynamics365\x20=>\x20remote_uri','sequelize','STRING','ENUM','AmazonAWS','Google','MicrosoftAzure','Dynamics365','MicrosoftAzure\x20=>\x20client_id','MicrosoftAzure\x20=>\x20tenant','MicrosoftAzure\x20=>\x20redirect_uri','TEXT'];(function(_0x5b33be,_0x20b6e7){var _0x1497f4=function(_0x1e5014){while(--_0x1e5014){_0x5b33be['push'](_0x5b33be['shift']());}};_0x1497f4(++_0x20b6e7);}(_0xdbc9,0xab));var _0x9dbc=function(_0xc54a8f,_0x246670){_0xc54a8f=_0xc54a8f-0x0;var _0x4def87=_0xdbc9[_0xc54a8f];return _0x4def87;};'use strict';var Sequelize=require(_0x9dbc('0x0'));module['exports']={'name':{'type':Sequelize[_0x9dbc('0x1')],'allowNull':![],'validate':{'notEmpty':!![]}},'service':{'type':Sequelize[_0x9dbc('0x2')](_0x9dbc('0x3'),_0x9dbc('0x4'),_0x9dbc('0x5')),'allowNull':![],'validate':{'notEmpty':!![]}},'type':{'type':Sequelize[_0x9dbc('0x2')]('Outlook365',_0x9dbc('0x6'))},'data1':{'type':Sequelize[_0x9dbc('0x1')],'comment':_0x9dbc('0x7')},'data2':{'type':Sequelize[_0x9dbc('0x1')],'comment':_0x9dbc('0x8')},'data3':{'type':Sequelize[_0x9dbc('0x1')],'comment':'MicrosoftAzure\x20=>\x20client_secret'},'data4':{'type':Sequelize[_0x9dbc('0x1')],'comment':_0x9dbc('0x9')},'data5':{'type':Sequelize[_0x9dbc('0xa')],'comment':_0x9dbc('0xb')},'data6':{'type':Sequelize[_0x9dbc('0xa')],'comment':'MicrosoftAzure\x20=>\x20refresh_token'},'data7':{'type':Sequelize[_0x9dbc('0xa')],'comment':_0x9dbc('0xc')}};
\ No newline at end of file
+var _0xe3b3=['Dynamics365','STRING','MicrosoftAzure\x20=>\x20client_id','MicrosoftAzure\x20=>\x20tenant','MicrosoftAzure\x20=>\x20client_secret','MicrosoftAzure\x20=>\x20redirect_uri','TEXT','MicrosoftAzure\x20=>\x20Dynamics365\x20=>\x20remote_uri','sequelize','exports','ENUM','AmazonAWS','Google','MicrosoftAzure','Outlook365'];(function(_0x2826c7,_0x39ff47){var _0x3cea7d=function(_0x113053){while(--_0x113053){_0x2826c7['push'](_0x2826c7['shift']());}};_0x3cea7d(++_0x39ff47);}(_0xe3b3,0x170));var _0x3e3b=function(_0x46ae93,_0x5db71b){_0x46ae93=_0x46ae93-0x0;var _0x1ccc63=_0xe3b3[_0x46ae93];return _0x1ccc63;};'use strict';var Sequelize=require(_0x3e3b('0x0'));module[_0x3e3b('0x1')]={'name':{'type':Sequelize['STRING'],'allowNull':![],'validate':{'notEmpty':!![]}},'service':{'type':Sequelize[_0x3e3b('0x2')](_0x3e3b('0x3'),_0x3e3b('0x4'),_0x3e3b('0x5')),'allowNull':![],'validate':{'notEmpty':!![]}},'type':{'type':Sequelize['ENUM'](_0x3e3b('0x6'),_0x3e3b('0x7'))},'data1':{'type':Sequelize[_0x3e3b('0x8')],'comment':_0x3e3b('0x9')},'data2':{'type':Sequelize[_0x3e3b('0x8')],'comment':_0x3e3b('0xa')},'data3':{'type':Sequelize['STRING'],'comment':_0x3e3b('0xb')},'data4':{'type':Sequelize[_0x3e3b('0x8')],'comment':_0x3e3b('0xc')},'data5':{'type':Sequelize[_0x3e3b('0xd')],'comment':'MicrosoftAzure\x20=>\x20access_token'},'data6':{'type':Sequelize[_0x3e3b('0xd')],'comment':'MicrosoftAzure\x20=>\x20refresh_token'},'data7':{'type':Sequelize[_0x3e3b('0xd')],'comment':_0x3e3b('0xe')}};
\ No newline at end of file
diff --git a/server/api/cloudProvider/cloudProvider.controller.js b/server/api/cloudProvider/cloudProvider.controller.js
index 06dda82..a0e178c 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 _0xb9e4=['filter','merge','VIRTUAL','options','include','findAll','rows','service','MicrosoftAzure','data3','catch','show','params','find','create','Name\x20parameter\x20not\x20specified','body','Service\x20parameter\x20not\x20specified','values','includes','Invalid\x20service\x20parameter.\x20Allowed\x20values:\x20','join','findOne','generateMicrosoftAuthorizationUrl','oauth2MicrosoftCallback','get','state','base64','toString','isValidIdToken','id_token','oauth2Claims','Unable\x20to\x20validate\x20id_token','getOauth2MicrosoftAccessToken','data5','access_token','refresh_token','data6','startRefreshInterval','emit','microsoftAuthorization:success','microsoftAuthorization:error','Invalid\x20authentication\x20state\x20parameter','Authentication\x20failed\x20for\x20cloud\x20provider\x20#%s,\x20err:%s','stringify','lodash','ioredis','../../components/parsers/qs','../../components/encryptor','../../config/environment','../../config/logger','api','../../mysqldb','./cloudProvider.oauth','defaults','localhost','socket.io-emitter','redis','sendStatus','status','end','json','offset','undefined','count','set','Content-Range','update','then','destroy','error','stack','name','send','padEnd','index','map','CloudProvider','rawAttributes','fieldName','type','key','model','query','keys','intersection','attributes','fields','length','hasOwnProperty','limit','order','sort','where','pick','filters'];(function(_0x549443,_0x2e04c8){var _0x372ed3=function(_0x214a87){while(--_0x214a87){_0x549443['push'](_0x549443['shift']());}};_0x372ed3(++_0x2e04c8);}(_0xb9e4,0x1ad));var _0x4b9e=function(_0x4b6e9a,_0x5945f4){_0x4b6e9a=_0x4b6e9a-0x0;var _0x3130ac=_0xb9e4[_0x4b6e9a];return _0x3130ac;};'use strict';var _=require(_0x4b9e('0x0'));var Redis=require(_0x4b9e('0x1'));var qs=require(_0x4b9e('0x2'));var encryptor=require(_0x4b9e('0x3'));var config=require(_0x4b9e('0x4'));var logger=require(_0x4b9e('0x5'))(_0x4b9e('0x6'));var db=require(_0x4b9e('0x7'))['db'];var oauth=require(_0x4b9e('0x8'));config['redis']=_[_0x4b9e('0x9')](config['redis'],{'host':_0x4b9e('0xa'),'port':0x18eb});var socket=require(_0x4b9e('0xb'))(new Redis(config[_0x4b9e('0xc')]));var redis=new Redis(config['redis']);function respondWithStatusCode(_0x19a0bc,_0x1e22e8){_0x1e22e8=_0x1e22e8||0xcc;return function(_0x5bc699){if(_0x5bc699){return _0x19a0bc[_0x4b9e('0xd')](_0x1e22e8);}return _0x19a0bc[_0x4b9e('0xe')](_0x1e22e8)[_0x4b9e('0xf')]();};}function respondWithResult(_0x493c74,_0x4b376f){_0x4b376f=_0x4b376f||0xc8;return function(_0x26f4f9){if(_0x26f4f9){return _0x493c74['status'](_0x4b376f)[_0x4b9e('0x10')](_0x26f4f9);}};}function respondWithFilteredResult(_0x3b7beb,_0x4c6ffb){return function(_0x67e5af){if(_0x67e5af){var _0x3571a8=typeof _0x4c6ffb[_0x4b9e('0x11')]===_0x4b9e('0x12')&&typeof _0x4c6ffb['limit']===_0x4b9e('0x12');var _0xa5f295=_0x67e5af[_0x4b9e('0x13')];var _0x2ddbbf=_0x3571a8?0x0:_0x4c6ffb['offset'];var _0x22dd0a=_0x3571a8?_0x67e5af[_0x4b9e('0x13')]:_0x4c6ffb[_0x4b9e('0x11')]+_0x4c6ffb['limit'];var _0x285110;if(_0x22dd0a>=_0xa5f295){_0x22dd0a=_0xa5f295;_0x285110=0xc8;}else{_0x285110=0xce;}_0x3b7beb['status'](_0x285110);return _0x3b7beb[_0x4b9e('0x14')](_0x4b9e('0x15'),_0x2ddbbf+'-'+_0x22dd0a+'/'+_0xa5f295)[_0x4b9e('0x10')](_0x67e5af);}return null;};}function saveUpdates(_0x1ae6d2){return function(_0x36abf5){if(_0x36abf5){return _0x36abf5[_0x4b9e('0x16')](_0x1ae6d2)[_0x4b9e('0x17')](function(_0x188d4a){return _0x188d4a;});}return null;};}function removeEntity(_0x5629b3){return function(_0x521287){if(_0x521287){return _0x521287[_0x4b9e('0x18')]()[_0x4b9e('0x17')](function(){_0x5629b3[_0x4b9e('0xe')](0xcc)[_0x4b9e('0xf')]();});}};}function handleEntityNotFound(_0x393f09){return function(_0x29a8ed){if(!_0x29a8ed){_0x393f09[_0x4b9e('0xd')](0x194);}return _0x29a8ed;};}function handleError(_0x364cc7,_0x180122){_0x180122=_0x180122||0x1f4;return function(_0x1b749b){logger[_0x4b9e('0x19')](_0x1b749b[_0x4b9e('0x1a')]);if(_0x1b749b[_0x4b9e('0x1b')]){delete _0x1b749b[_0x4b9e('0x1b')];}_0x364cc7[_0x4b9e('0xe')](_0x180122)[_0x4b9e('0x1c')](_0x1b749b);};}function maskClientSecret(_0x197262){return _[_0x4b9e('0x1d')](_0x197262['slice'](0x0,0x3),0x14,'*');}exports[_0x4b9e('0x1e')]=function(_0x496a52,_0x5a003e){var _0x4cfdc3={},_0x3caabf={},_0x21e6d9={'count':0x0,'rows':[]};var _0x10fb07=_[_0x4b9e('0x1f')](db[_0x4b9e('0x20')][_0x4b9e('0x21')],function(_0x2c3dbf){return{'name':_0x2c3dbf[_0x4b9e('0x22')],'type':_0x2c3dbf[_0x4b9e('0x23')][_0x4b9e('0x24')]};});_0x3caabf[_0x4b9e('0x25')]=_['map'](_0x10fb07,_0x4b9e('0x1b'));_0x3caabf[_0x4b9e('0x26')]=_[_0x4b9e('0x27')](_0x496a52['query']);_0x3caabf['filters']=_[_0x4b9e('0x28')](_0x3caabf[_0x4b9e('0x25')],_0x3caabf['query']);_0x4cfdc3[_0x4b9e('0x29')]=_[_0x4b9e('0x28')](_0x3caabf[_0x4b9e('0x25')],qs[_0x4b9e('0x2a')](_0x496a52[_0x4b9e('0x26')][_0x4b9e('0x2a')]));_0x4cfdc3['attributes']=_0x4cfdc3[_0x4b9e('0x29')][_0x4b9e('0x2b')]?_0x4cfdc3[_0x4b9e('0x29')]:_0x3caabf[_0x4b9e('0x25')];if(!_0x496a52[_0x4b9e('0x26')][_0x4b9e('0x2c')]('nolimit')){_0x4cfdc3[_0x4b9e('0x2d')]=qs[_0x4b9e('0x2d')](_0x496a52[_0x4b9e('0x26')]['limit']);_0x4cfdc3[_0x4b9e('0x11')]=qs[_0x4b9e('0x11')](_0x496a52[_0x4b9e('0x26')][_0x4b9e('0x11')]);}_0x4cfdc3[_0x4b9e('0x2e')]=qs[_0x4b9e('0x2f')](_0x496a52[_0x4b9e('0x26')]['sort']);_0x4cfdc3[_0x4b9e('0x30')]=qs['filters'](_[_0x4b9e('0x31')](_0x496a52[_0x4b9e('0x26')],_0x3caabf[_0x4b9e('0x32')]),_0x10fb07);if(_0x496a52[_0x4b9e('0x26')][_0x4b9e('0x33')]){_0x4cfdc3['where']=_[_0x4b9e('0x34')](_0x4cfdc3[_0x4b9e('0x30')],{'$or':_['map'](_0x10fb07,function(_0x549008){if(_0x549008[_0x4b9e('0x23')]!==_0x4b9e('0x35')){var _0x40b939={};_0x40b939[_0x549008[_0x4b9e('0x1b')]]={'$like':'%'+_0x496a52[_0x4b9e('0x26')][_0x4b9e('0x33')]+'%'};return _0x40b939;}})});}_0x4cfdc3=_[_0x4b9e('0x34')]({},_0x4cfdc3,_0x496a52[_0x4b9e('0x36')]);var _0x12014e={'where':_0x4cfdc3[_0x4b9e('0x30')]};return db['CloudProvider'][_0x4b9e('0x13')](_0x12014e)[_0x4b9e('0x17')](function(_0x230be5){_0x21e6d9[_0x4b9e('0x13')]=_0x230be5;if(_0x496a52[_0x4b9e('0x26')]['includeAll']){_0x4cfdc3[_0x4b9e('0x37')]=[{'all':!![]}];}return db[_0x4b9e('0x20')][_0x4b9e('0x38')](_0x4cfdc3);})['then'](function(_0x383f04){_0x21e6d9[_0x4b9e('0x39')]=_[_0x4b9e('0x1f')](_0x383f04,function(_0x52dc97){if(_0x52dc97[_0x4b9e('0x3a')]===_0x4b9e('0x3b')){var _0x37390b=encryptor['decryptString'](_0x52dc97[_0x4b9e('0x3c')]);_0x52dc97[_0x4b9e('0x3c')]=maskClientSecret(_0x37390b);}return _0x52dc97;});return _0x21e6d9;})['then'](respondWithFilteredResult(_0x5a003e,_0x4cfdc3))[_0x4b9e('0x3d')](handleError(_0x5a003e,null));};exports[_0x4b9e('0x3e')]=function(_0x3c5abc,_0x324842){var _0x1e4cfb={'raw':!![],'where':{'id':_0x3c5abc[_0x4b9e('0x3f')]['id']}},_0xae75c2={};_0xae75c2[_0x4b9e('0x25')]=_[_0x4b9e('0x27')](db['CloudProvider'][_0x4b9e('0x21')]);_0xae75c2[_0x4b9e('0x26')]=_['keys'](_0x3c5abc[_0x4b9e('0x26')]);_0xae75c2['filters']=_[_0x4b9e('0x28')](_0xae75c2[_0x4b9e('0x25')],_0xae75c2['query']);_0x1e4cfb[_0x4b9e('0x29')]=_[_0x4b9e('0x28')](_0xae75c2[_0x4b9e('0x25')],qs[_0x4b9e('0x2a')](_0x3c5abc[_0x4b9e('0x26')][_0x4b9e('0x2a')]));_0x1e4cfb[_0x4b9e('0x29')]=_0x1e4cfb['attributes'][_0x4b9e('0x2b')]?_0x1e4cfb[_0x4b9e('0x29')]:_0xae75c2[_0x4b9e('0x25')];if(_0x3c5abc[_0x4b9e('0x26')]['includeAll']){_0x1e4cfb[_0x4b9e('0x37')]=[{'all':!![]}];}_0x1e4cfb=_[_0x4b9e('0x34')]({},_0x1e4cfb,_0x3c5abc[_0x4b9e('0x36')]);return db[_0x4b9e('0x20')][_0x4b9e('0x40')](_0x1e4cfb)[_0x4b9e('0x17')](handleEntityNotFound(_0x324842,null))[_0x4b9e('0x17')](function(_0x581d0c){if(_0x581d0c[_0x4b9e('0x3a')]===_0x4b9e('0x3b')){var _0x376b2e=encryptor['decryptString'](_0x581d0c['data3']);_0x581d0c[_0x4b9e('0x3c')]=maskClientSecret(_0x376b2e);}return _0x581d0c;})[_0x4b9e('0x17')](respondWithResult(_0x324842,null))[_0x4b9e('0x3d')](handleError(_0x324842,null));};exports[_0x4b9e('0x41')]=function(_0x360c80,_0x101e17){if(!_0x360c80['body']['name'])throw new Error(_0x4b9e('0x42'));if(!_0x360c80[_0x4b9e('0x43')][_0x4b9e('0x3a')])throw new Error(_0x4b9e('0x44'));var _0xd99842=db[_0x4b9e('0x20')]['rawAttributes'][_0x4b9e('0x3a')][_0x4b9e('0x45')];if(!_0xd99842[_0x4b9e('0x46')](_0x360c80[_0x4b9e('0x43')]['service']))throw new Error(_0x4b9e('0x47')+_0xd99842[_0x4b9e('0x48')](',\x20'));if(_0x360c80[_0x4b9e('0x43')][_0x4b9e('0x3a')]===_0x4b9e('0x3b')&&_0x360c80[_0x4b9e('0x43')]['data3']){_0x360c80[_0x4b9e('0x43')][_0x4b9e('0x3c')]=encryptor['encryptString'](_0x360c80[_0x4b9e('0x43')]['data3']);}return db[_0x4b9e('0x20')][_0x4b9e('0x41')](_0x360c80[_0x4b9e('0x43')],{})[_0x4b9e('0x17')](respondWithResult(_0x101e17,0xc9))['catch'](handleError(_0x101e17,null));};exports['update']=function(_0x442270,_0x15e573){if(_0x442270['body']['id']){delete _0x442270[_0x4b9e('0x43')]['id'];}return db[_0x4b9e('0x20')]['find']({'where':{'id':_0x442270[_0x4b9e('0x3f')]['id']}})[_0x4b9e('0x17')](handleEntityNotFound(_0x15e573,null))[_0x4b9e('0x17')](function(_0x5de6d0){if(_0x5de6d0['service']===_0x4b9e('0x3b')&&_0x442270[_0x4b9e('0x43')][_0x4b9e('0x3c')]){_0x442270[_0x4b9e('0x43')]['data3']=encryptor['encryptString'](_0x442270[_0x4b9e('0x43')][_0x4b9e('0x3c')]);}return _0x5de6d0;})['then'](saveUpdates(_0x442270[_0x4b9e('0x43')],null))['then'](respondWithResult(_0x15e573,null))[_0x4b9e('0x3d')](handleError(_0x15e573,null));};exports[_0x4b9e('0x18')]=function(_0x21398a,_0x9416e1){return db[_0x4b9e('0x20')]['find']({'where':{'id':_0x21398a['params']['id']}})[_0x4b9e('0x17')](handleEntityNotFound(_0x9416e1,null))['then'](removeEntity(_0x9416e1,null))[_0x4b9e('0x3d')](handleError(_0x9416e1,null));};exports['oauth2MicrosoftAuthorize']=function(_0x1c6fe2,_0xf57ca9){return db['CloudProvider'][_0x4b9e('0x49')]({'where':{'id':_0x1c6fe2[_0x4b9e('0x3f')]['id']},'raw':!![]})['then'](function(_0x10df07){if(!_0x10df07)return _0xf57ca9[_0x4b9e('0xd')](0x194);return{'url':oauth[_0x4b9e('0x4a')](_0x10df07,_0x1c6fe2['user']['id'])};})['then'](respondWithResult(_0xf57ca9,null))[_0x4b9e('0x3d')](handleError(_0xf57ca9,null));};exports[_0x4b9e('0x4b')]=function(_0x153121,_0x1e240c){var _0x2c0394=_0x153121[_0x4b9e('0x43')];var _0x3367f8;var _0xf9d622;if(_0x2c0394['error'])throw _0x2c0394;redis[_0x4b9e('0x4c')](_0x2c0394['state'])[_0x4b9e('0x17')](function(_0x3c5f9a){if(!_0x3c5f9a)throw new Error('Invalid\x20state\x20parameter');_0x3367f8=JSON['parse'](_0x3c5f9a);var _0x3717e8=Buffer['from'](_0x2c0394[_0x4b9e('0x4d')],_0x4b9e('0x4e'))[_0x4b9e('0x4f')]('ascii');_0xf9d622=JSON['parse'](_0x3717e8);if(!oauth[_0x4b9e('0x50')](_0x2c0394[_0x4b9e('0x51')],_0x3367f8[_0x4b9e('0x52')]))throw new Error(_0x4b9e('0x53'));redis['del'](_0x2c0394[_0x4b9e('0x4d')]);return oauth[_0x4b9e('0x54')](_0x2c0394['code'],_0x3367f8);})[_0x4b9e('0x17')](function(_0x4703cb){_0x3367f8[_0x4b9e('0x55')]=_0x4703cb[_0x4b9e('0x56')];_0x3367f8['data6']=_0x4703cb[_0x4b9e('0x57')];return db['CloudProvider'][_0x4b9e('0x16')]({'data5':_0x3367f8[_0x4b9e('0x55')],'data6':_0x3367f8[_0x4b9e('0x58')]},{'where':{'id':_0x3367f8['id']}});})[_0x4b9e('0x17')](function(){oauth[_0x4b9e('0x59')](_0x3367f8);socket[_0x4b9e('0x5a')](_0x4b9e('0x5b'),{'id':_0xf9d622['id']});return;})[_0x4b9e('0x17')](respondWithStatusCode(_0x1e240c,null))[_0x4b9e('0x3d')](function(_0x234b1d){if(_0xf9d622){socket[_0x4b9e('0x5a')](_0x4b9e('0x5c'),{'id':_0xf9d622['id']});}if(!_0x3367f8){logger[_0x4b9e('0x19')](_0x4b9e('0x5d'),_0x234b1d);return _0x1e240c['status'](0x1f4)[_0x4b9e('0x1c')](_0x234b1d['message']);}logger[_0x4b9e('0x19')](_0x4b9e('0x5e'),_0x3367f8['id'],JSON[_0x4b9e('0x5f')](_0x234b1d));});};
\ No newline at end of file
+var _0x4b14=['data6','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','../../config/logger','api','./cloudProvider.oauth','redis','defaults','localhost','status','end','json','offset','undefined','count','limit','Content-Range','then','destroy','sendStatus','error','name','send','index','map','CloudProvider','type','model','query','keys','filters','intersection','attributes','fields','hasOwnProperty','order','sort','pick','filter','VIRTUAL','options','where','include','rows','service','decryptString','data3','catch','params','length','MicrosoftAzure','create','body','Service\x20parameter\x20not\x20specified','join','encryptString','find','oauth2MicrosoftAuthorize','findOne','generateMicrosoftAuthorizationUrl','user','get','state','Invalid\x20state\x20parameter','parse','base64','toString','isValidIdToken','Unable\x20to\x20validate\x20id_token','del','getOauth2MicrosoftAccessToken','code','data5','refresh_token'];(function(_0x4b5b86,_0x23c37a){var _0xd965ac=function(_0x51f2cb){while(--_0x51f2cb){_0x4b5b86['push'](_0x4b5b86['shift']());}};_0xd965ac(++_0x23c37a);}(_0x4b14,0x108));var _0x44b1=function(_0x43752e,_0x42bc14){_0x43752e=_0x43752e-0x0;var _0xb07ab3=_0x4b14[_0x43752e];return _0xb07ab3;};'use strict';var _=require(_0x44b1('0x0'));var Redis=require(_0x44b1('0x1'));var qs=require(_0x44b1('0x2'));var encryptor=require(_0x44b1('0x3'));var config=require(_0x44b1('0x4'));var logger=require(_0x44b1('0x5'))(_0x44b1('0x6'));var db=require('../../mysqldb')['db'];var oauth=require(_0x44b1('0x7'));config[_0x44b1('0x8')]=_[_0x44b1('0x9')](config[_0x44b1('0x8')],{'host':_0x44b1('0xa'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x44b1('0x8')]));var redis=new Redis(config[_0x44b1('0x8')]);function respondWithStatusCode(_0x311f62,_0x9baece){_0x9baece=_0x9baece||0xcc;return function(_0x44933b){if(_0x44933b){return _0x311f62['sendStatus'](_0x9baece);}return _0x311f62[_0x44b1('0xb')](_0x9baece)[_0x44b1('0xc')]();};}function respondWithResult(_0x229649,_0x20f7d0){_0x20f7d0=_0x20f7d0||0xc8;return function(_0xa3bb39){if(_0xa3bb39){return _0x229649[_0x44b1('0xb')](_0x20f7d0)[_0x44b1('0xd')](_0xa3bb39);}};}function respondWithFilteredResult(_0x59aa49,_0x412618){return function(_0x3b1725){if(_0x3b1725){var _0x4dd3ef=typeof _0x412618[_0x44b1('0xe')]===_0x44b1('0xf')&&typeof _0x412618['limit']===_0x44b1('0xf');var _0x3618d0=_0x3b1725[_0x44b1('0x10')];var _0x39ed28=_0x4dd3ef?0x0:_0x412618[_0x44b1('0xe')];var _0x16a69d=_0x4dd3ef?_0x3b1725['count']:_0x412618[_0x44b1('0xe')]+_0x412618[_0x44b1('0x11')];var _0x3afbd1;if(_0x16a69d>=_0x3618d0){_0x16a69d=_0x3618d0;_0x3afbd1=0xc8;}else{_0x3afbd1=0xce;}_0x59aa49['status'](_0x3afbd1);return _0x59aa49['set'](_0x44b1('0x12'),_0x39ed28+'-'+_0x16a69d+'/'+_0x3618d0)[_0x44b1('0xd')](_0x3b1725);}return null;};}function saveUpdates(_0x11ea81){return function(_0x2fcfc1){if(_0x2fcfc1){return _0x2fcfc1['update'](_0x11ea81)[_0x44b1('0x13')](function(_0x5cc436){return _0x5cc436;});}return null;};}function removeEntity(_0x382541){return function(_0x90337a){if(_0x90337a){return _0x90337a[_0x44b1('0x14')]()[_0x44b1('0x13')](function(){_0x382541['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x385ac1){return function(_0x11e15b){if(!_0x11e15b){_0x385ac1[_0x44b1('0x15')](0x194);}return _0x11e15b;};}function handleError(_0x4d481a,_0xa00a62){_0xa00a62=_0xa00a62||0x1f4;return function(_0x13fc01){logger[_0x44b1('0x16')](_0x13fc01['stack']);if(_0x13fc01[_0x44b1('0x17')]){delete _0x13fc01['name'];}_0x4d481a[_0x44b1('0xb')](_0xa00a62)[_0x44b1('0x18')](_0x13fc01);};}function maskClientSecret(_0x2c07c9){return _['padEnd'](_0x2c07c9['slice'](0x0,0x3),0x14,'*');}exports[_0x44b1('0x19')]=function(_0x115c09,_0x195f5c){var _0x563b84={},_0x5c9034={},_0x9a48fb={'count':0x0,'rows':[]};var _0x233e2d=_[_0x44b1('0x1a')](db[_0x44b1('0x1b')]['rawAttributes'],function(_0x112d3c){return{'name':_0x112d3c['fieldName'],'type':_0x112d3c[_0x44b1('0x1c')]['key']};});_0x5c9034[_0x44b1('0x1d')]=_[_0x44b1('0x1a')](_0x233e2d,'name');_0x5c9034[_0x44b1('0x1e')]=_[_0x44b1('0x1f')](_0x115c09[_0x44b1('0x1e')]);_0x5c9034[_0x44b1('0x20')]=_[_0x44b1('0x21')](_0x5c9034[_0x44b1('0x1d')],_0x5c9034[_0x44b1('0x1e')]);_0x563b84[_0x44b1('0x22')]=_[_0x44b1('0x21')](_0x5c9034[_0x44b1('0x1d')],qs[_0x44b1('0x23')](_0x115c09[_0x44b1('0x1e')]['fields']));_0x563b84[_0x44b1('0x22')]=_0x563b84[_0x44b1('0x22')]['length']?_0x563b84[_0x44b1('0x22')]:_0x5c9034[_0x44b1('0x1d')];if(!_0x115c09[_0x44b1('0x1e')][_0x44b1('0x24')]('nolimit')){_0x563b84[_0x44b1('0x11')]=qs[_0x44b1('0x11')](_0x115c09[_0x44b1('0x1e')][_0x44b1('0x11')]);_0x563b84[_0x44b1('0xe')]=qs[_0x44b1('0xe')](_0x115c09[_0x44b1('0x1e')][_0x44b1('0xe')]);}_0x563b84[_0x44b1('0x25')]=qs[_0x44b1('0x26')](_0x115c09['query'][_0x44b1('0x26')]);_0x563b84['where']=qs[_0x44b1('0x20')](_[_0x44b1('0x27')](_0x115c09['query'],_0x5c9034[_0x44b1('0x20')]),_0x233e2d);if(_0x115c09[_0x44b1('0x1e')][_0x44b1('0x28')]){_0x563b84['where']=_['merge'](_0x563b84['where'],{'$or':_['map'](_0x233e2d,function(_0xe7d390){if(_0xe7d390[_0x44b1('0x1c')]!==_0x44b1('0x29')){var _0x3e6d22={};_0x3e6d22[_0xe7d390['name']]={'$like':'%'+_0x115c09[_0x44b1('0x1e')][_0x44b1('0x28')]+'%'};return _0x3e6d22;}})});}_0x563b84=_['merge']({},_0x563b84,_0x115c09[_0x44b1('0x2a')]);var _0xa21b20={'where':_0x563b84[_0x44b1('0x2b')]};return db[_0x44b1('0x1b')][_0x44b1('0x10')](_0xa21b20)[_0x44b1('0x13')](function(_0x2dff9e){_0x9a48fb[_0x44b1('0x10')]=_0x2dff9e;if(_0x115c09[_0x44b1('0x1e')]['includeAll']){_0x563b84[_0x44b1('0x2c')]=[{'all':!![]}];}return db[_0x44b1('0x1b')]['findAll'](_0x563b84);})['then'](function(_0x1b957b){_0x9a48fb[_0x44b1('0x2d')]=_['map'](_0x1b957b,function(_0x1e1ecb){if(_0x1e1ecb[_0x44b1('0x2e')]==='MicrosoftAzure'){var _0x1953c6=encryptor[_0x44b1('0x2f')](_0x1e1ecb[_0x44b1('0x30')]);_0x1e1ecb[_0x44b1('0x30')]=maskClientSecret(_0x1953c6);}return _0x1e1ecb;});return _0x9a48fb;})[_0x44b1('0x13')](respondWithFilteredResult(_0x195f5c,_0x563b84))[_0x44b1('0x31')](handleError(_0x195f5c,null));};exports['show']=function(_0xad9455,_0x263bbb){var _0x2d24c2={'raw':!![],'where':{'id':_0xad9455[_0x44b1('0x32')]['id']}},_0x5a63ef={};_0x5a63ef[_0x44b1('0x1d')]=_['keys'](db[_0x44b1('0x1b')]['rawAttributes']);_0x5a63ef[_0x44b1('0x1e')]=_['keys'](_0xad9455[_0x44b1('0x1e')]);_0x5a63ef[_0x44b1('0x20')]=_['intersection'](_0x5a63ef[_0x44b1('0x1d')],_0x5a63ef['query']);_0x2d24c2[_0x44b1('0x22')]=_['intersection'](_0x5a63ef['model'],qs['fields'](_0xad9455[_0x44b1('0x1e')][_0x44b1('0x23')]));_0x2d24c2[_0x44b1('0x22')]=_0x2d24c2[_0x44b1('0x22')][_0x44b1('0x33')]?_0x2d24c2[_0x44b1('0x22')]:_0x5a63ef[_0x44b1('0x1d')];if(_0xad9455['query']['includeAll']){_0x2d24c2[_0x44b1('0x2c')]=[{'all':!![]}];}_0x2d24c2=_['merge']({},_0x2d24c2,_0xad9455[_0x44b1('0x2a')]);return db[_0x44b1('0x1b')]['find'](_0x2d24c2)[_0x44b1('0x13')](handleEntityNotFound(_0x263bbb,null))[_0x44b1('0x13')](function(_0x39db9c){if(_0x39db9c[_0x44b1('0x2e')]===_0x44b1('0x34')){var _0xd488a4=encryptor[_0x44b1('0x2f')](_0x39db9c[_0x44b1('0x30')]);_0x39db9c[_0x44b1('0x30')]=maskClientSecret(_0xd488a4);}return _0x39db9c;})[_0x44b1('0x13')](respondWithResult(_0x263bbb,null))[_0x44b1('0x31')](handleError(_0x263bbb,null));};exports[_0x44b1('0x35')]=function(_0x239cd7,_0x270440){if(!_0x239cd7[_0x44b1('0x36')][_0x44b1('0x17')])throw new Error('Name\x20parameter\x20not\x20specified');if(!_0x239cd7['body']['service'])throw new Error(_0x44b1('0x37'));var _0x6aab56=db[_0x44b1('0x1b')]['rawAttributes']['service']['values'];if(!_0x6aab56['includes'](_0x239cd7['body']['service']))throw new Error('Invalid\x20service\x20parameter.\x20Allowed\x20values:\x20'+_0x6aab56[_0x44b1('0x38')](',\x20'));if(_0x239cd7['body'][_0x44b1('0x2e')]===_0x44b1('0x34')&&_0x239cd7[_0x44b1('0x36')][_0x44b1('0x30')]){_0x239cd7[_0x44b1('0x36')]['data3']=encryptor[_0x44b1('0x39')](_0x239cd7['body']['data3']);}return db[_0x44b1('0x1b')]['create'](_0x239cd7['body'],{})['then'](respondWithResult(_0x270440,0xc9))[_0x44b1('0x31')](handleError(_0x270440,null));};exports['update']=function(_0x42b99d,_0x17c26d){if(_0x42b99d[_0x44b1('0x36')]['id']){delete _0x42b99d[_0x44b1('0x36')]['id'];}return db[_0x44b1('0x1b')][_0x44b1('0x3a')]({'where':{'id':_0x42b99d['params']['id']}})[_0x44b1('0x13')](handleEntityNotFound(_0x17c26d,null))[_0x44b1('0x13')](function(_0x2aec19){if(_0x2aec19['service']===_0x44b1('0x34')&&_0x42b99d[_0x44b1('0x36')][_0x44b1('0x30')]){_0x42b99d[_0x44b1('0x36')][_0x44b1('0x30')]=encryptor[_0x44b1('0x39')](_0x42b99d[_0x44b1('0x36')]['data3']);}return _0x2aec19;})['then'](saveUpdates(_0x42b99d[_0x44b1('0x36')],null))[_0x44b1('0x13')](respondWithResult(_0x17c26d,null))[_0x44b1('0x31')](handleError(_0x17c26d,null));};exports['destroy']=function(_0x1a4e22,_0x16885a){return db[_0x44b1('0x1b')]['find']({'where':{'id':_0x1a4e22[_0x44b1('0x32')]['id']}})[_0x44b1('0x13')](handleEntityNotFound(_0x16885a,null))[_0x44b1('0x13')](removeEntity(_0x16885a,null))[_0x44b1('0x31')](handleError(_0x16885a,null));};exports[_0x44b1('0x3b')]=function(_0x3a0f9e,_0x344e35){return db['CloudProvider'][_0x44b1('0x3c')]({'where':{'id':_0x3a0f9e['params']['id']},'raw':!![]})[_0x44b1('0x13')](function(_0x54e364){if(!_0x54e364)return _0x344e35[_0x44b1('0x15')](0x194);return{'url':oauth[_0x44b1('0x3d')](_0x54e364,_0x3a0f9e[_0x44b1('0x3e')]['id'])};})[_0x44b1('0x13')](respondWithResult(_0x344e35,null))[_0x44b1('0x31')](handleError(_0x344e35,null));};exports['oauth2MicrosoftCallback']=function(_0x717a38,_0x3400d7){var _0x429328=_0x717a38[_0x44b1('0x36')];var _0x150a53;var _0x14fe93;if(_0x429328[_0x44b1('0x16')])throw _0x429328;redis[_0x44b1('0x3f')](_0x429328[_0x44b1('0x40')])[_0x44b1('0x13')](function(_0x5a8eff){if(!_0x5a8eff)throw new Error(_0x44b1('0x41'));_0x150a53=JSON[_0x44b1('0x42')](_0x5a8eff);var _0x2d6b20=Buffer['from'](_0x429328[_0x44b1('0x40')],_0x44b1('0x43'))[_0x44b1('0x44')]('ascii');_0x14fe93=JSON[_0x44b1('0x42')](_0x2d6b20);if(!oauth[_0x44b1('0x45')](_0x429328['id_token'],_0x150a53['oauth2Claims']))throw new Error(_0x44b1('0x46'));redis[_0x44b1('0x47')](_0x429328['state']);return oauth[_0x44b1('0x48')](_0x429328[_0x44b1('0x49')],_0x150a53);})['then'](function(_0x46ea7a){_0x150a53[_0x44b1('0x4a')]=_0x46ea7a['access_token'];_0x150a53['data6']=_0x46ea7a[_0x44b1('0x4b')];return db['CloudProvider']['update']({'data5':_0x150a53[_0x44b1('0x4a')],'data6':_0x150a53[_0x44b1('0x4c')]},{'where':{'id':_0x150a53['id']}});})[_0x44b1('0x13')](function(){oauth[_0x44b1('0x4d')](_0x150a53);socket[_0x44b1('0x4e')](_0x44b1('0x4f'),{'id':_0x14fe93['id']});return;})[_0x44b1('0x13')](respondWithStatusCode(_0x3400d7,null))[_0x44b1('0x31')](function(_0x2bef39){if(_0x14fe93){socket[_0x44b1('0x4e')](_0x44b1('0x50'),{'id':_0x14fe93['id']});}if(!_0x150a53){logger[_0x44b1('0x16')](_0x44b1('0x51'),_0x2bef39);return _0x3400d7[_0x44b1('0xb')](0x1f4)[_0x44b1('0x18')](_0x2bef39[_0x44b1('0x52')]);}logger[_0x44b1('0x16')](_0x44b1('0x53'),_0x150a53['id'],JSON[_0x44b1('0x54')](_0x2bef39));});};
\ No newline at end of file
diff --git a/server/api/cloudProvider/cloudProvider.model.js b/server/api/cloudProvider/cloudProvider.model.js
index 137dcc2..92eed38 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 _0xd9d3=['CloudProvider','cloud_providers','lodash','util','api','bluebird','path','../../config/environment','exports','define'];(function(_0x2451c3,_0x2c16e0){var _0x4bc3bb=function(_0x378dd5){while(--_0x378dd5){_0x2451c3['push'](_0x2451c3['shift']());}};_0x4bc3bb(++_0x2c16e0);}(_0xd9d3,0x174));var _0x3d9d=function(_0x3aacd4,_0x46ed3b){_0x3aacd4=_0x3aacd4-0x0;var _0x3b4e07=_0xd9d3[_0x3aacd4];return _0x3b4e07;};'use strict';var _=require(_0x3d9d('0x0'));var util=require(_0x3d9d('0x1'));var logger=require('../../config/logger')(_0x3d9d('0x2'));var moment=require('moment');var BPromise=require(_0x3d9d('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x3d9d('0x4'));var rimraf=require('rimraf');var config=require(_0x3d9d('0x5'));var attributes=require('./cloudProvider.attributes');module[_0x3d9d('0x6')]=function(_0x185a55,_0xebbd0){return _0x185a55[_0x3d9d('0x7')](_0x3d9d('0x8'),attributes,{'tableName':_0x3d9d('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xdbb7=['util','../../config/logger','api','request-promise','path','rimraf','../../config/environment','./cloudProvider.attributes','exports','define','cloud_providers'];(function(_0x10ed77,_0x108116){var _0x23c3e7=function(_0x2a4a23){while(--_0x2a4a23){_0x10ed77['push'](_0x10ed77['shift']());}};_0x23c3e7(++_0x108116);}(_0xdbb7,0x9a));var _0x7dbb=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xdbb7[_0x3dd15e];return _0x231fd0;};'use strict';var _=require('lodash');var util=require(_0x7dbb('0x0'));var logger=require(_0x7dbb('0x1'))(_0x7dbb('0x2'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x7dbb('0x3'));var fs=require('fs');var path=require(_0x7dbb('0x4'));var rimraf=require(_0x7dbb('0x5'));var config=require(_0x7dbb('0x6'));var attributes=require(_0x7dbb('0x7'));module[_0x7dbb('0x8')]=function(_0x4ee702,_0x289582){return _0x4ee702[_0x7dbb('0x9')]('CloudProvider',attributes,{'tableName':_0x7dbb('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
diff --git a/server/api/cloudProvider/cloudProvider.oauth.js b/server/api/cloudProvider/cloudProvider.oauth.js
index 1e7b0d1..0196691 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 _0xbe81=['redis','defaults','localhost','https://login.microsoftonline.com/{TENANT_ID}/oauth2/v2.0','openid','profile','email','offline_access','https://outlook.office365.com/IMAP.AccessAsUser.All','https://outlook.office.com/POP.AccessAsUser.All','https://outlook.office.com/SMTP.Send','/token','map','type','Dynamics365','/.default','join','Outlook365','replace','{TENANT_ID}','data2','code','from','base64','toString','hex','client_id','data1','redirect_uri','data4','response_mode','scope','state','nonce','login','key','value','oauth2Claims','oauth2/','set','stringify','payload','iss','issuer','audience','isAfter','unix','exp','resolve','data3','then','refresh_token','data6','decryptString','POST','data5','access_token','CloudProvider','update','catch','error','Failed\x20to\x20refresh\x20access\x20token\x20for\x20cloud\x20provider\x20#%s,\x20-\x20err:%s','authorization_code','findAll','all','inspect','exports','lodash','ioredis','request-promise','../../components/encryptor','../../config/logger','../../config/schedule/cloud-provider','../../mysqldb'];(function(_0x149c91,_0x10138a){var _0x552396=function(_0x487233){while(--_0x487233){_0x149c91['push'](_0x149c91['shift']());}};_0x552396(++_0x10138a);}(_0xbe81,0x121));var _0x1be8=function(_0x584b9d,_0x1cb5c5){_0x584b9d=_0x584b9d-0x0;var _0x172053=_0xbe81[_0x584b9d];return _0x172053;};'use strict';var _=require(_0x1be8('0x0'));var crypto=require('crypto');var jwt=require('jsonwebtoken');var moment=require('moment');var Redis=require(_0x1be8('0x1'));var rp=require(_0x1be8('0x2'));var util=require('util');var encryptor=require(_0x1be8('0x3'));var config=require('../../config/environment');var logger=require(_0x1be8('0x4'))('api');var schedule=require(_0x1be8('0x5'));var db=require(_0x1be8('0x6'))['db'];config[_0x1be8('0x7')]=_[_0x1be8('0x8')](config[_0x1be8('0x7')],{'host':_0x1be8('0x9'),'port':0x18eb});var redis=new Redis(config['redis']);var MICROSOFT_AUTH_URL=_0x1be8('0xa');var AZURE_AUTH_SCOPES={'Outlook365':[_0x1be8('0xb'),_0x1be8('0xc'),_0x1be8('0xd'),_0x1be8('0xe'),_0x1be8('0xf'),_0x1be8('0x10'),_0x1be8('0x11')],'Dynamics365':['openid',_0x1be8('0xe')]};var MICROSOFT_AUTH_ENDPOINT='/authorize';var MICROSOFT_TOKEN_ENDPOINT=_0x1be8('0x12');var OAUTH_REFRESH_INTERVAL=0xfa;function getAuthorizationScopes(_0x225013){var _0x5dd7d6=_[_0x1be8('0x13')](AZURE_AUTH_SCOPES[_0x225013[_0x1be8('0x14')]]);if(_0x225013['type']===_0x1be8('0x15'))_0x5dd7d6['push'](_0x225013['data7']+_0x1be8('0x16'));return _0x5dd7d6[_0x1be8('0x17')]('\x20');}function getAccessTokenScope(_0x2ed6a2){if(_0x2ed6a2[_0x1be8('0x14')]===_0x1be8('0x18'))return'https://outlook.office365.com/IMAP.AccessAsUser.All';if(_0x2ed6a2[_0x1be8('0x14')]===_0x1be8('0x15'))return _0x2ed6a2['data7']+_0x1be8('0x16');}function generateMicrosoftAuthorizationUrl(_0x40dafb,_0x356590){var _0x3afdb4=MICROSOFT_AUTH_URL[_0x1be8('0x19')](_0x1be8('0x1a'),_0x40dafb[_0x1be8('0x1b')]);var _0x576f27=[_0x1be8('0x1c'),'id_token'];var _0x7a6d92=Buffer[_0x1be8('0x1d')](JSON['stringify']({'id':_0x356590}))['toString'](_0x1be8('0x1e'));var _0x72f7e1=crypto['randomBytes'](0x10)[_0x1be8('0x1f')](_0x1be8('0x20'));var _0x1c3019=getAuthorizationScopes(_0x40dafb);var _0x5017d2=[{'key':_0x1be8('0x21'),'value':_0x40dafb[_0x1be8('0x22')]},{'key':'response_type','value':encodeURIComponent(_0x576f27[_0x1be8('0x17')]('\x20'))},{'key':_0x1be8('0x23'),'value':_0x40dafb[_0x1be8('0x24')]},{'key':_0x1be8('0x25'),'value':'form_post'},{'key':_0x1be8('0x26'),'value':encodeURIComponent(_0x1c3019)},{'key':_0x1be8('0x27'),'value':_0x7a6d92},{'key':_0x1be8('0x28'),'value':_0x72f7e1},{'key':'prompt','value':_0x1be8('0x29')}];var _0x5b463f=_0x3afdb4+MICROSOFT_AUTH_ENDPOINT+'?'+_[_0x1be8('0x13')](_0x5017d2,function(_0x5da5de){return _0x5da5de[_0x1be8('0x2a')]+'='+_0x5da5de[_0x1be8('0x2b')];})[_0x1be8('0x17')]('&');_0x40dafb[_0x1be8('0x2c')]={'issuer':_0x3afdb4['replace'](_0x1be8('0x2d'),''),'audience':_0x40dafb['data1'],'state':_0x7a6d92,'nonce':_0x72f7e1};redis[_0x1be8('0x2e')](_0x7a6d92,JSON[_0x1be8('0x2f')](_0x40dafb));return _0x5b463f;}function isValidIdToken(_0x1a9402,_0x3b7b0c){try{var _0xfef6fe=jwt['decode'](_0x1a9402,{'complete':!![]});var _0x11f64d=_0xfef6fe[_0x1be8('0x30')];if(_0x11f64d[_0x1be8('0x31')]!==_0x3b7b0c[_0x1be8('0x32')])return![];if(_0x11f64d['aud']!==_0x3b7b0c[_0x1be8('0x33')])return![];if(_0x11f64d['nonce']!==_0x3b7b0c['nonce'])return![];if(moment()[_0x1be8('0x34')](moment[_0x1be8('0x35')](_0x11f64d[_0x1be8('0x36')])))return![];return!![];}catch(_0xdea15b){throw _0xdea15b;}}function refreshOauth2MicrosoftAccessToken(_0x459717){return Promise[_0x1be8('0x37')]()['then'](function(){if(_0x459717[_0x1be8('0x38')])return _0x459717;return db['CloudProvider']['findOne']({'where':{'id':_0x459717['id']},'raw':!![]});})[_0x1be8('0x39')](function(_0x38e41c){var _0xe65bd7={'grant_type':_0x1be8('0x3a'),'refresh_token':_0x38e41c[_0x1be8('0x3b')],'scope':getAccessTokenScope(_0x38e41c),'redirect_uri':_0x38e41c[_0x1be8('0x24')],'client_id':_0x38e41c[_0x1be8('0x22')],'client_secret':encryptor[_0x1be8('0x3c')](_0x38e41c[_0x1be8('0x38')])};var _0x4215a6={'method':_0x1be8('0x3d'),'uri':MICROSOFT_AUTH_URL[_0x1be8('0x19')]('{TENANT_ID}',_0x38e41c[_0x1be8('0x1b')])+MICROSOFT_TOKEN_ENDPOINT,'form':_0xe65bd7,'json':!![]};return rp(_0x4215a6);})[_0x1be8('0x39')](function(_0x39221d){_0x459717[_0x1be8('0x3e')]=_0x39221d[_0x1be8('0x3f')];_0x459717['data6']=_0x39221d['refresh_token'];return db[_0x1be8('0x40')][_0x1be8('0x41')]({'data5':_0x459717[_0x1be8('0x3e')],'data6':_0x459717['data6']},{'where':{'id':_0x459717['id']}});})[_0x1be8('0x39')](function(){return _0x459717;})[_0x1be8('0x42')](function(_0x5712a4){logger[_0x1be8('0x43')](_0x1be8('0x44'),_0x459717['id'],_0x5712a4);});}function getOauth2MicrosoftAccessToken(_0x43d717,_0xa05819){var _0x407b8d={'grant_type':_0x1be8('0x45'),'code':_0x43d717,'scope':getAccessTokenScope(_0xa05819),'redirect_uri':_0xa05819[_0x1be8('0x24')],'client_id':_0xa05819[_0x1be8('0x22')],'client_secret':encryptor['decryptString'](_0xa05819[_0x1be8('0x38')])};var _0x148ca0={'method':_0x1be8('0x3d'),'uri':MICROSOFT_AUTH_URL[_0x1be8('0x19')]('{TENANT_ID}',_0xa05819[_0x1be8('0x1b')])+MICROSOFT_TOKEN_ENDPOINT,'form':_0x407b8d,'json':!![]};return rp(_0x148ca0);}function startRefreshInterval(_0x469d16){var _0x5d0cd7=schedule['intervals'];if(_0x5d0cd7[_0x469d16['id']])clearInterval(_0x5d0cd7[_0x469d16['id']]);_0x5d0cd7[_0x469d16['id']]=setInterval(refreshOauth2MicrosoftAccessToken['bind'](this,{'id':_0x469d16['id']}),OAUTH_REFRESH_INTERVAL*0x3e8);schedule['intervals']=_0x5d0cd7;}function startAllRefreshIntervals(){return db[_0x1be8('0x40')][_0x1be8('0x46')]({'where':{'data6':{'$ne':null}},'raw':!![]})[_0x1be8('0x39')](function(_0x3ef62d){var _0x36b146=_0x3ef62d[_0x1be8('0x13')](function(_0x1c3b8b){return refreshOauth2MicrosoftAccessToken(_0x1c3b8b)[_0x1be8('0x39')](function(_0x1d8019){startRefreshInterval(_0x1d8019);});});return Promise[_0x1be8('0x47')](_0x36b146);})[_0x1be8('0x42')](function(_0x239cf8){var _0x126297=_0x239cf8?util[_0x1be8('0x48')](_0x239cf8,{'showHidden':![],'depth':null}):'';logger[_0x1be8('0x43')]('[CLOUD_PROVIDER]\x20Error\x20while\x20refreshing\x20the\x20tokens\x20after\x20service\x20restart\x20error:%s',_0x126297);});}module[_0x1be8('0x49')]={'generateMicrosoftAuthorizationUrl':generateMicrosoftAuthorizationUrl,'getOauth2MicrosoftAccessToken':getOauth2MicrosoftAccessToken,'isValidIdToken':isValidIdToken,'startAllRefreshIntervals':startAllRefreshIntervals,'refreshOauth2MicrosoftAccessToken':refreshOauth2MicrosoftAccessToken,'startRefreshInterval':startRefreshInterval};
\ No newline at end of file
+var _0x00a1=['type','Dynamics365','push','/.default','Outlook365','data7','replace','{TENANT_ID}','data2','code','id_token','from','stringify','toString','hex','client_id','data1','response_type','join','redirect_uri','data4','form_post','prompt','map','oauth2Claims','oauth2/','set','iss','issuer','aud','audience','nonce','isAfter','unix','resolve','then','data3','CloudProvider','findOne','decryptString','data5','access_token','data6','catch','error','authorization_code','intervals','findAll','lodash','moment','request-promise','util','../../components/encryptor','../../config/logger','api','../../config/schedule/cloud-provider','../../mysqldb','redis','defaults','localhost','https://login.microsoftonline.com/{TENANT_ID}/oauth2/v2.0','openid','profile','email','https://outlook.office365.com/IMAP.AccessAsUser.All','https://outlook.office.com/POP.AccessAsUser.All','https://outlook.office.com/SMTP.Send','offline_access'];(function(_0x16539a,_0x31409a){var _0x200796=function(_0xfe7803){while(--_0xfe7803){_0x16539a['push'](_0x16539a['shift']());}};_0x200796(++_0x31409a);}(_0x00a1,0x184));var _0x100a=function(_0x38d3ad,_0x331801){_0x38d3ad=_0x38d3ad-0x0;var _0x4f3d1e=_0x00a1[_0x38d3ad];return _0x4f3d1e;};'use strict';var _=require(_0x100a('0x0'));var crypto=require('crypto');var jwt=require('jsonwebtoken');var moment=require(_0x100a('0x1'));var Redis=require('ioredis');var rp=require(_0x100a('0x2'));var util=require(_0x100a('0x3'));var encryptor=require(_0x100a('0x4'));var config=require('../../config/environment');var logger=require(_0x100a('0x5'))(_0x100a('0x6'));var schedule=require(_0x100a('0x7'));var db=require(_0x100a('0x8'))['db'];config[_0x100a('0x9')]=_[_0x100a('0xa')](config[_0x100a('0x9')],{'host':_0x100a('0xb'),'port':0x18eb});var redis=new Redis(config[_0x100a('0x9')]);var MICROSOFT_AUTH_URL=_0x100a('0xc');var AZURE_AUTH_SCOPES={'Outlook365':[_0x100a('0xd'),_0x100a('0xe'),_0x100a('0xf'),'offline_access',_0x100a('0x10'),_0x100a('0x11'),_0x100a('0x12')],'Dynamics365':[_0x100a('0xd'),_0x100a('0x13')]};var MICROSOFT_AUTH_ENDPOINT='/authorize';var MICROSOFT_TOKEN_ENDPOINT='/token';var OAUTH_REFRESH_INTERVAL=0xfa;function getAuthorizationScopes(_0x575405){var _0x37bb4f=_['map'](AZURE_AUTH_SCOPES[_0x575405['type']]);if(_0x575405[_0x100a('0x14')]===_0x100a('0x15'))_0x37bb4f[_0x100a('0x16')](_0x575405['data7']+_0x100a('0x17'));return _0x37bb4f['join']('\x20');}function getAccessTokenScope(_0x4df2ed){if(_0x4df2ed[_0x100a('0x14')]===_0x100a('0x18'))return'https://outlook.office365.com/IMAP.AccessAsUser.All';if(_0x4df2ed[_0x100a('0x14')]===_0x100a('0x15'))return _0x4df2ed[_0x100a('0x19')]+'/.default';}function generateMicrosoftAuthorizationUrl(_0x2f49bb,_0x2429bf){var _0x4f5afd=MICROSOFT_AUTH_URL[_0x100a('0x1a')](_0x100a('0x1b'),_0x2f49bb[_0x100a('0x1c')]);var _0x1d5a3f=[_0x100a('0x1d'),_0x100a('0x1e')];var _0x83eab4=Buffer[_0x100a('0x1f')](JSON[_0x100a('0x20')]({'id':_0x2429bf}))[_0x100a('0x21')]('base64');var _0x3a35cf=crypto['randomBytes'](0x10)['toString'](_0x100a('0x22'));var _0x2342be=getAuthorizationScopes(_0x2f49bb);var _0x1211a8=[{'key':_0x100a('0x23'),'value':_0x2f49bb[_0x100a('0x24')]},{'key':_0x100a('0x25'),'value':encodeURIComponent(_0x1d5a3f[_0x100a('0x26')]('\x20'))},{'key':_0x100a('0x27'),'value':_0x2f49bb[_0x100a('0x28')]},{'key':'response_mode','value':_0x100a('0x29')},{'key':'scope','value':encodeURIComponent(_0x2342be)},{'key':'state','value':_0x83eab4},{'key':'nonce','value':_0x3a35cf},{'key':_0x100a('0x2a'),'value':'login'}];var _0xf300cc=_0x4f5afd+MICROSOFT_AUTH_ENDPOINT+'?'+_[_0x100a('0x2b')](_0x1211a8,function(_0x317c8a){return _0x317c8a['key']+'='+_0x317c8a['value'];})[_0x100a('0x26')]('&');_0x2f49bb[_0x100a('0x2c')]={'issuer':_0x4f5afd[_0x100a('0x1a')](_0x100a('0x2d'),''),'audience':_0x2f49bb[_0x100a('0x24')],'state':_0x83eab4,'nonce':_0x3a35cf};redis[_0x100a('0x2e')](_0x83eab4,JSON[_0x100a('0x20')](_0x2f49bb));return _0xf300cc;}function isValidIdToken(_0x4785a0,_0x50bd09){try{var _0x1d1ee1=jwt['decode'](_0x4785a0,{'complete':!![]});var _0x2f607b=_0x1d1ee1['payload'];if(_0x2f607b[_0x100a('0x2f')]!==_0x50bd09[_0x100a('0x30')])return![];if(_0x2f607b[_0x100a('0x31')]!==_0x50bd09[_0x100a('0x32')])return![];if(_0x2f607b[_0x100a('0x33')]!==_0x50bd09['nonce'])return![];if(moment()[_0x100a('0x34')](moment[_0x100a('0x35')](_0x2f607b['exp'])))return![];return!![];}catch(_0xd50f6){throw _0xd50f6;}}function refreshOauth2MicrosoftAccessToken(_0xfcc4d6){return Promise[_0x100a('0x36')]()[_0x100a('0x37')](function(){if(_0xfcc4d6[_0x100a('0x38')])return _0xfcc4d6;return db[_0x100a('0x39')][_0x100a('0x3a')]({'where':{'id':_0xfcc4d6['id']},'raw':!![]});})[_0x100a('0x37')](function(_0x215248){var _0x187ca0={'grant_type':'refresh_token','refresh_token':_0x215248['data6'],'scope':getAccessTokenScope(_0x215248),'redirect_uri':_0x215248[_0x100a('0x28')],'client_id':_0x215248[_0x100a('0x24')],'client_secret':encryptor[_0x100a('0x3b')](_0x215248['data3'])};var _0x5e66f0={'method':'POST','uri':MICROSOFT_AUTH_URL['replace'](_0x100a('0x1b'),_0x215248[_0x100a('0x1c')])+MICROSOFT_TOKEN_ENDPOINT,'form':_0x187ca0,'json':!![]};return rp(_0x5e66f0);})[_0x100a('0x37')](function(_0x39e563){_0xfcc4d6[_0x100a('0x3c')]=_0x39e563[_0x100a('0x3d')];_0xfcc4d6[_0x100a('0x3e')]=_0x39e563['refresh_token'];return db[_0x100a('0x39')]['update']({'data5':_0xfcc4d6[_0x100a('0x3c')],'data6':_0xfcc4d6[_0x100a('0x3e')]},{'where':{'id':_0xfcc4d6['id']}});})['then'](function(){return _0xfcc4d6;})[_0x100a('0x3f')](function(_0x4e4439){logger[_0x100a('0x40')]('Failed\x20to\x20refresh\x20access\x20token\x20for\x20cloud\x20provider\x20#%s,\x20-\x20err:%s',_0xfcc4d6['id'],_0x4e4439);});}function getOauth2MicrosoftAccessToken(_0x574bdd,_0x4b9782){var _0x27e0c4={'grant_type':_0x100a('0x41'),'code':_0x574bdd,'scope':getAccessTokenScope(_0x4b9782),'redirect_uri':_0x4b9782['data4'],'client_id':_0x4b9782['data1'],'client_secret':encryptor[_0x100a('0x3b')](_0x4b9782['data3'])};var _0xef293e={'method':'POST','uri':MICROSOFT_AUTH_URL[_0x100a('0x1a')](_0x100a('0x1b'),_0x4b9782[_0x100a('0x1c')])+MICROSOFT_TOKEN_ENDPOINT,'form':_0x27e0c4,'json':!![]};return rp(_0xef293e);}function startRefreshInterval(_0x4bfd3d){var _0x422f16=schedule[_0x100a('0x42')];if(_0x422f16[_0x4bfd3d['id']])clearInterval(_0x422f16[_0x4bfd3d['id']]);_0x422f16[_0x4bfd3d['id']]=setInterval(refreshOauth2MicrosoftAccessToken['bind'](this,{'id':_0x4bfd3d['id']}),OAUTH_REFRESH_INTERVAL*0x3e8);schedule['intervals']=_0x422f16;}function startAllRefreshIntervals(){return db[_0x100a('0x39')][_0x100a('0x43')]({'where':{'data6':{'$ne':null}},'raw':!![]})[_0x100a('0x37')](function(_0x2e1036){var _0x3c74f8=_0x2e1036[_0x100a('0x2b')](function(_0x8027d0){return refreshOauth2MicrosoftAccessToken(_0x8027d0)[_0x100a('0x37')](function(_0x29b6f2){startRefreshInterval(_0x29b6f2);});});return Promise['all'](_0x3c74f8);})[_0x100a('0x3f')](function(_0x1cd042){var _0x23cc68=_0x1cd042?util['inspect'](_0x1cd042,{'showHidden':![],'depth':null}):'';logger[_0x100a('0x40')]('[CLOUD_PROVIDER]\x20Error\x20while\x20refreshing\x20the\x20tokens\x20after\x20service\x20restart\x20error:%s',_0x23cc68);});}module['exports']={'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 c0d3a44..02d32c4 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 _0x4e2e=['../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then','info','CloudProvider,\x20%s,\x20%s','request\x20sent','CloudProvider,\x20%s,\x20%s,\x20%s','stringify','error','message','result','util','moment','bluebird','randomstring','ioredis','../../mysqldb'];(function(_0x42c1d9,_0x404ad8){var _0x210da3=function(_0x472452){while(--_0x472452){_0x42c1d9['push'](_0x42c1d9['shift']());}};_0x210da3(++_0x404ad8);}(_0x4e2e,0x1f2));var _0xe4e2=function(_0x1a74cd,_0x18a485){_0x1a74cd=_0x1a74cd-0x0;var _0x4dadd1=_0x4e2e[_0x1a74cd];return _0x4dadd1;};'use strict';var _=require('lodash');var util=require(_0xe4e2('0x0'));var moment=require(_0xe4e2('0x1'));var BPromise=require(_0xe4e2('0x2'));var rs=require(_0xe4e2('0x3'));var fs=require('fs');var Redis=require(_0xe4e2('0x4'));var db=require(_0xe4e2('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0xe4e2('0x6'))(_0xe4e2('0x7'));var config=require(_0xe4e2('0x8'));var jayson=require(_0xe4e2('0x9'));var client=jayson['client'][_0xe4e2('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x36b1c6,_0x1c4e64,_0x125338){return new BPromise(function(_0x956c75,_0x27304b){return client[_0xe4e2('0xb')](_0x36b1c6,_0x125338)[_0xe4e2('0xc')](function(_0x4912da){logger[_0xe4e2('0xd')](_0xe4e2('0xe'),_0x1c4e64,_0xe4e2('0xf'));logger['debug'](_0xe4e2('0x10'),_0x1c4e64,_0xe4e2('0xf'),JSON[_0xe4e2('0x11')](_0x4912da));if(_0x4912da[_0xe4e2('0x12')]){if(_0x4912da[_0xe4e2('0x12')]['code']===0x1f4){logger[_0xe4e2('0x12')](_0xe4e2('0xe'),_0x1c4e64,_0x4912da[_0xe4e2('0x12')][_0xe4e2('0x13')]);return _0x27304b(_0x4912da['error'][_0xe4e2('0x13')]);}logger[_0xe4e2('0x12')](_0xe4e2('0xe'),_0x1c4e64,_0x4912da[_0xe4e2('0x12')][_0xe4e2('0x13')]);return _0x956c75(_0x4912da['error']['message']);}else{logger[_0xe4e2('0xd')](_0xe4e2('0xe'),_0x1c4e64,_0xe4e2('0xf'));_0x956c75(_0x4912da[_0xe4e2('0x14')][_0xe4e2('0x13')]);}})['catch'](function(_0x754778){logger[_0xe4e2('0x12')](_0xe4e2('0xe'),_0x1c4e64,_0x754778);_0x27304b(_0x754778);});});}
\ No newline at end of file
+var _0x530f=['message','result','util','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then','info','request\x20sent','debug','CloudProvider,\x20%s,\x20%s,\x20%s','stringify','error','CloudProvider,\x20%s,\x20%s'];(function(_0x29db9d,_0x3dc4a2){var _0x57b45c=function(_0x4a3f87){while(--_0x4a3f87){_0x29db9d['push'](_0x29db9d['shift']());}};_0x57b45c(++_0x3dc4a2);}(_0x530f,0x167));var _0xf530=function(_0x2d357c,_0x58bd29){_0x2d357c=_0x2d357c-0x0;var _0x1a3480=_0x530f[_0x2d357c];return _0x1a3480;};'use strict';var _=require('lodash');var util=require(_0xf530('0x0'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0xf530('0x1'));var fs=require('fs');var Redis=require(_0xf530('0x2'));var db=require(_0xf530('0x3'))['db'];var utils=require(_0xf530('0x4'));var logger=require(_0xf530('0x5'))(_0xf530('0x6'));var config=require(_0xf530('0x7'));var jayson=require(_0xf530('0x8'));var client=jayson['client'][_0xf530('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x2ce7f8,_0x1e8282,_0x50682f){return new BPromise(function(_0x2bbe3c,_0xf205be){return client[_0xf530('0xa')](_0x2ce7f8,_0x50682f)[_0xf530('0xb')](function(_0x4132bf){logger[_0xf530('0xc')]('CloudProvider,\x20%s,\x20%s',_0x1e8282,_0xf530('0xd'));logger[_0xf530('0xe')](_0xf530('0xf'),_0x1e8282,_0xf530('0xd'),JSON[_0xf530('0x10')](_0x4132bf));if(_0x4132bf[_0xf530('0x11')]){if(_0x4132bf['error']['code']===0x1f4){logger[_0xf530('0x11')](_0xf530('0x12'),_0x1e8282,_0x4132bf[_0xf530('0x11')][_0xf530('0x13')]);return _0xf205be(_0x4132bf[_0xf530('0x11')]['message']);}logger[_0xf530('0x11')](_0xf530('0x12'),_0x1e8282,_0x4132bf[_0xf530('0x11')][_0xf530('0x13')]);return _0x2bbe3c(_0x4132bf[_0xf530('0x11')][_0xf530('0x13')]);}else{logger[_0xf530('0xc')](_0xf530('0x12'),_0x1e8282,'request\x20sent');_0x2bbe3c(_0x4132bf[_0xf530('0x14')][_0xf530('0x13')]);}})['catch'](function(_0x32eaea){logger[_0xf530('0x11')]('CloudProvider,\x20%s,\x20%s',_0x1e8282,_0x32eaea);_0xf205be(_0x32eaea);});});}
\ No newline at end of file
diff --git a/server/api/cloudProvider/index.js b/server/api/cloudProvider/index.js
index be6eca6..c92debd 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 _0x5f2f=['exports','express','Router','../../components/auth/service','./cloudProvider.controller','get','isAuthenticated','index','show','post','create','put','/:id','update','delete','destroy','/:id/oauth2/microsoft/authorize/','oauth2MicrosoftAuthorize','oauth2MicrosoftCallback'];(function(_0x5751e6,_0x125e5e){var _0x4199e4=function(_0x559843){while(--_0x559843){_0x5751e6['push'](_0x5751e6['shift']());}};_0x4199e4(++_0x125e5e);}(_0x5f2f,0x73));var _0xf5f2=function(_0xd1730e,_0x4adb9f){_0xd1730e=_0xd1730e-0x0;var _0x4ce7d4=_0x5f2f[_0xd1730e];return _0x4ce7d4;};'use strict';var express=require(_0xf5f2('0x0'));var router=express[_0xf5f2('0x1')]();var auth=require(_0xf5f2('0x2'));var controller=require(_0xf5f2('0x3'));router[_0xf5f2('0x4')]('/',auth[_0xf5f2('0x5')](),controller[_0xf5f2('0x6')]);router[_0xf5f2('0x4')]('/:id',auth['isAuthenticated'](),controller[_0xf5f2('0x7')]);router[_0xf5f2('0x8')]('/',auth[_0xf5f2('0x5')](),controller[_0xf5f2('0x9')]);router[_0xf5f2('0xa')](_0xf5f2('0xb'),auth['isAuthenticated'](),controller[_0xf5f2('0xc')]);router[_0xf5f2('0xd')](_0xf5f2('0xb'),auth['isAuthenticated'](),controller[_0xf5f2('0xe')]);router[_0xf5f2('0x4')](_0xf5f2('0xf'),auth['isAuthenticated'](),controller[_0xf5f2('0x10')]);router['post']('/oauth2/microsoft/callback',controller[_0xf5f2('0x11')]);module[_0xf5f2('0x12')]=router;
\ No newline at end of file
+var _0x1261=['/:id','show','create','put','update','delete','/:id/oauth2/microsoft/authorize/','post','exports','Router','../../components/auth/service','./cloudProvider.controller','get','isAuthenticated','index'];(function(_0x318256,_0xa773f3){var _0xb1e352=function(_0x4bb14e){while(--_0x4bb14e){_0x318256['push'](_0x318256['shift']());}};_0xb1e352(++_0xa773f3);}(_0x1261,0x144));var _0x1126=function(_0x183c00,_0x5327b8){_0x183c00=_0x183c00-0x0;var _0x4a8361=_0x1261[_0x183c00];return _0x4a8361;};'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
diff --git a/server/api/cmCompany/cmCompany.attributes.js b/server/api/cmCompany/cmCompany.attributes.js
index 9a82dbe..8744be8 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 _0x023b=['STRING','sequelize'];(function(_0x32088f,_0x538e0a){var _0x43abf1=function(_0x52c41d){while(--_0x52c41d){_0x32088f['push'](_0x32088f['shift']());}};_0x43abf1(++_0x538e0a);}(_0x023b,0x123));var _0xb023=function(_0x170d59,_0x4743ad){_0x170d59=_0x170d59-0x0;var _0x53ed9f=_0x023b[_0x170d59];return _0x53ed9f;};'use strict';var Sequelize=require(_0xb023('0x0'));module['exports']={'name':{'type':Sequelize[_0xb023('0x1')],'unique':'name','allowNull':![],'validate':{'notEmpty':!![]}},'vat':{'type':Sequelize[_0xb023('0x1')]},'companyId':{'type':Sequelize[_0xb023('0x1')]},'website':{'type':Sequelize[_0xb023('0x1')]},'phone':{'type':Sequelize[_0xb023('0x1')]},'fax':{'type':Sequelize[_0xb023('0x1')]},'type':{'type':Sequelize[_0xb023('0x1')]},'street':{'type':Sequelize[_0xb023('0x1')]},'postalCode':{'type':Sequelize[_0xb023('0x1')]},'city':{'type':Sequelize[_0xb023('0x1')]},'country':{'type':Sequelize['STRING']},'email':{'type':Sequelize[_0xb023('0x1')],'validate':{'isEmail':!![]}},'emailDomain':{'type':Sequelize[_0xb023('0x1')]},'sStreet':{'type':Sequelize[_0xb023('0x1')]},'sPostalCode':{'type':Sequelize[_0xb023('0x1')]},'sCity':{'type':Sequelize['STRING']},'sCountry':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0xb023('0x1')]}};
\ No newline at end of file
+var _0x117d=['STRING','sequelize','exports'];(function(_0x45681b,_0x26d516){var _0x52a933=function(_0x2fe75c){while(--_0x2fe75c){_0x45681b['push'](_0x45681b['shift']());}};_0x52a933(++_0x26d516);}(_0x117d,0xac));var _0xd117=function(_0x44946b,_0xf874ec){_0x44946b=_0x44946b-0x0;var _0x249bc4=_0x117d[_0x44946b];return _0x249bc4;};'use strict';var Sequelize=require(_0xd117('0x0'));module[_0xd117('0x1')]={'name':{'type':Sequelize[_0xd117('0x2')],'unique':'name','allowNull':![],'validate':{'notEmpty':!![]}},'vat':{'type':Sequelize[_0xd117('0x2')]},'companyId':{'type':Sequelize[_0xd117('0x2')]},'website':{'type':Sequelize[_0xd117('0x2')]},'phone':{'type':Sequelize[_0xd117('0x2')]},'fax':{'type':Sequelize[_0xd117('0x2')]},'type':{'type':Sequelize['STRING']},'street':{'type':Sequelize[_0xd117('0x2')]},'postalCode':{'type':Sequelize[_0xd117('0x2')]},'city':{'type':Sequelize[_0xd117('0x2')]},'country':{'type':Sequelize[_0xd117('0x2')]},'email':{'type':Sequelize['STRING'],'validate':{'isEmail':!![]}},'emailDomain':{'type':Sequelize['STRING']},'sStreet':{'type':Sequelize[_0xd117('0x2')]},'sPostalCode':{'type':Sequelize[_0xd117('0x2')]},'sCity':{'type':Sequelize[_0xd117('0x2')]},'sCountry':{'type':Sequelize[_0xd117('0x2')]},'description':{'type':Sequelize[_0xd117('0x2')]}};
\ No newline at end of file
diff --git a/server/api/cmCompany/cmCompany.controller.js b/server/api/cmCompany/cmCompany.controller.js
index 7ec3256..d2ae468 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 _0xc815=['index','CmCompany','describe','keys','query','intersection','model','attributes','fields','length','hasOwnProperty','order','sort','where','pick','filter','merge','map','includeAll','findAll','rows','catch','params','rawAttributes','filters','include','options','create','body','user','role','Companies','find','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','addContacts','CmContact','ids','omit','findOne','getContacts','nolimit','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','path','sox','ejs','fs-extra','squel','crypto','jsforce','desk.js','to-csv','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','api','../../config/environment','../../mysqldb','status','json','offset','count','limit','set','apply','reject','save','update','then','destroy','get','UserProfileResource','end','sendStatus','name','send'];(function(_0x19ef72,_0x275be0){var _0x541034=function(_0x161a14){while(--_0x161a14){_0x19ef72['push'](_0x19ef72['shift']());}};_0x541034(++_0x275be0);}(_0xc815,0x1d4));var _0x5c81=function(_0x16b9ed,_0x56517a){_0x16b9ed=_0x16b9ed-0x0;var _0x66b1f8=_0xc815[_0x16b9ed];return _0x66b1f8;};'use strict';var emlformat=require(_0x5c81('0x0'));var rimraf=require(_0x5c81('0x1'));var zipdir=require(_0x5c81('0x2'));var jsonpatch=require(_0x5c81('0x3'));var rp=require(_0x5c81('0x4'));var moment=require('moment');var BPromise=require(_0x5c81('0x5'));var Mustache=require(_0x5c81('0x6'));var util=require('util');var path=require(_0x5c81('0x7'));var sox=require(_0x5c81('0x8'));var csv=require('to-csv');var ejs=require(_0x5c81('0x9'));var fs=require('fs');var fs_extra=require(_0x5c81('0xa'));var _=require('lodash');var squel=require(_0x5c81('0xb'));var crypto=require(_0x5c81('0xc'));var jsforce=require(_0x5c81('0xd'));var deskjs=require(_0x5c81('0xe'));var toCsv=require(_0x5c81('0xf'));var querystring=require(_0x5c81('0x10'));var Papa=require(_0x5c81('0x11'));var Redis=require('ioredis');var authService=require(_0x5c81('0x12'));var qs=require(_0x5c81('0x13'));var as=require(_0x5c81('0x14'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x5c81('0x15'));var utils=require('../../config/utils');var config=require(_0x5c81('0x16'));var licenseUtil=require('../../config/license/util');var db=require(_0x5c81('0x17'))['db'];function respondWithStatusCode(_0x256024,_0x14e20a){_0x14e20a=_0x14e20a||0xcc;return function(_0x5c95ac){if(_0x5c95ac){return _0x256024['sendStatus'](_0x14e20a);}return _0x256024[_0x5c81('0x18')](_0x14e20a)['end']();};}function respondWithResult(_0x197479,_0x1a5728){_0x1a5728=_0x1a5728||0xc8;return function(_0x121c00){if(_0x121c00){return _0x197479[_0x5c81('0x18')](_0x1a5728)[_0x5c81('0x19')](_0x121c00);}};}function respondWithFilteredResult(_0x549bd1,_0x3d7009){return function(_0x3e2487){if(_0x3e2487){var _0x124e3a=typeof _0x3d7009[_0x5c81('0x1a')]==='undefined'&&typeof _0x3d7009['limit']==='undefined';var _0x1f190e=_0x3e2487[_0x5c81('0x1b')];var _0x190233=_0x124e3a?0x0:_0x3d7009[_0x5c81('0x1a')];var _0x32d374=_0x124e3a?_0x3e2487[_0x5c81('0x1b')]:_0x3d7009[_0x5c81('0x1a')]+_0x3d7009[_0x5c81('0x1c')];var _0x18ca33;if(_0x32d374>=_0x1f190e){_0x32d374=_0x1f190e;_0x18ca33=0xc8;}else{_0x18ca33=0xce;}_0x549bd1['status'](_0x18ca33);return _0x549bd1[_0x5c81('0x1d')]('Content-Range',_0x190233+'-'+_0x32d374+'/'+_0x1f190e)['json'](_0x3e2487);}return null;};}function patchUpdates(_0x5ca887){return function(_0x3e146f){try{jsonpatch[_0x5c81('0x1e')](_0x3e146f,_0x5ca887,!![]);}catch(_0x1b33d2){return BPromise[_0x5c81('0x1f')](_0x1b33d2);}return _0x3e146f[_0x5c81('0x20')]();};}function saveUpdates(_0x1e8d8b,_0x3830a0){return function(_0x249c17){if(_0x249c17){return _0x249c17[_0x5c81('0x21')](_0x1e8d8b)[_0x5c81('0x22')](function(_0x1c77e3){return _0x1c77e3;});}return null;};}function removeEntity(_0x1a02be,_0xfa73d){return function(_0x4f96c8){if(_0x4f96c8){return _0x4f96c8[_0x5c81('0x23')]()[_0x5c81('0x22')](function(){var _0x3ef49e=_0x4f96c8[_0x5c81('0x24')]({'plain':!![]});var _0x31e1bf='Companies';return db[_0x5c81('0x25')]['destroy']({'where':{'type':_0x31e1bf,'resourceId':_0x3ef49e['id']}})[_0x5c81('0x22')](function(){return _0x4f96c8;});})[_0x5c81('0x22')](function(){_0x1a02be[_0x5c81('0x18')](0xcc)[_0x5c81('0x26')]();});}};}function handleEntityNotFound(_0x18689c,_0x1ff427){return function(_0x477ab6){if(!_0x477ab6){_0x18689c[_0x5c81('0x27')](0x194);}return _0x477ab6;};}function handleError(_0x4a26d7,_0xf477a9){_0xf477a9=_0xf477a9||0x1f4;return function(_0x61d7a){logger['error'](_0x61d7a['stack']);if(_0x61d7a[_0x5c81('0x28')]){delete _0x61d7a[_0x5c81('0x28')];}_0x4a26d7[_0x5c81('0x18')](_0xf477a9)[_0x5c81('0x29')](_0x61d7a);};}exports[_0x5c81('0x2a')]=function(_0x267a4b,_0x566923){var _0x39934d={},_0x38f01a={},_0x373d01={'count':0x0,'rows':[]};return db[_0x5c81('0x2b')][_0x5c81('0x2c')]()[_0x5c81('0x22')](function(_0x461022){_0x38f01a['model']=_[_0x5c81('0x2d')](_0x461022);_0x38f01a[_0x5c81('0x2e')]=_[_0x5c81('0x2d')](_0x267a4b[_0x5c81('0x2e')]);_0x38f01a['filters']=_[_0x5c81('0x2f')](_0x38f01a[_0x5c81('0x30')],_0x38f01a[_0x5c81('0x2e')]);_0x39934d[_0x5c81('0x31')]=_[_0x5c81('0x2f')](_0x38f01a[_0x5c81('0x30')],qs[_0x5c81('0x32')](_0x267a4b['query']['fields']));_0x39934d[_0x5c81('0x31')]=_0x39934d[_0x5c81('0x31')][_0x5c81('0x33')]?_0x39934d[_0x5c81('0x31')]:_0x38f01a[_0x5c81('0x30')];if(!_0x267a4b[_0x5c81('0x2e')][_0x5c81('0x34')]('nolimit')){_0x39934d['limit']=qs[_0x5c81('0x1c')](_0x267a4b[_0x5c81('0x2e')][_0x5c81('0x1c')]);_0x39934d[_0x5c81('0x1a')]=qs['offset'](_0x267a4b[_0x5c81('0x2e')][_0x5c81('0x1a')]);}_0x39934d[_0x5c81('0x35')]=qs[_0x5c81('0x36')](_0x267a4b['query'][_0x5c81('0x36')]);_0x39934d[_0x5c81('0x37')]=qs['filters'](_[_0x5c81('0x38')](_0x267a4b['query'],_0x38f01a['filters']),_0x461022);if(_0x267a4b[_0x5c81('0x2e')][_0x5c81('0x39')]){_0x39934d['where']=_[_0x5c81('0x3a')](_0x39934d['where'],{'$or':_[_0x5c81('0x3b')](_0x39934d[_0x5c81('0x31')],function(_0x333649){var _0x9ecd38={};_0x9ecd38[_0x333649]={'$like':'%'+_0x267a4b[_0x5c81('0x2e')][_0x5c81('0x39')]+'%'};return _0x9ecd38;})});}_0x39934d=_['merge']({},_0x39934d,_0x267a4b['options']);var _0x41c97f={'where':_0x39934d['where']};return db['CmCompany'][_0x5c81('0x1b')](_0x41c97f)[_0x5c81('0x22')](function(_0x3b3161){_0x373d01[_0x5c81('0x1b')]=_0x3b3161;if(_0x267a4b['query'][_0x5c81('0x3c')]){_0x39934d['include']=[{'all':!![]}];}return db[_0x5c81('0x2b')][_0x5c81('0x3d')](_0x39934d);})[_0x5c81('0x22')](function(_0x1f40c9){_0x373d01[_0x5c81('0x3e')]=_0x1f40c9;return _0x373d01;})['then'](respondWithFilteredResult(_0x566923,_0x39934d))[_0x5c81('0x3f')](handleError(_0x566923,null));})['catch'](handleError(_0x566923,null));};exports['show']=function(_0x30985c,_0x5a80b9){var _0x152bd7={'raw':![],'where':{'id':_0x30985c[_0x5c81('0x40')]['id']}},_0x38642f={};_0x38642f[_0x5c81('0x30')]=_[_0x5c81('0x2d')](db['CmCompany'][_0x5c81('0x41')]);_0x38642f[_0x5c81('0x2e')]=_[_0x5c81('0x2d')](_0x30985c[_0x5c81('0x2e')]);_0x38642f[_0x5c81('0x42')]=_[_0x5c81('0x2f')](_0x38642f[_0x5c81('0x30')],_0x38642f[_0x5c81('0x2e')]);_0x152bd7['attributes']=_[_0x5c81('0x2f')](_0x38642f['model'],qs[_0x5c81('0x32')](_0x30985c[_0x5c81('0x2e')][_0x5c81('0x32')]));_0x152bd7[_0x5c81('0x31')]=_0x152bd7[_0x5c81('0x31')][_0x5c81('0x33')]?_0x152bd7[_0x5c81('0x31')]:_0x38642f[_0x5c81('0x30')];if(_0x30985c[_0x5c81('0x2e')]['includeAll']){_0x152bd7[_0x5c81('0x43')]=[{'all':!![]}];}_0x152bd7=_[_0x5c81('0x3a')]({},_0x152bd7,_0x30985c[_0x5c81('0x44')]);return db['CmCompany']['find'](_0x152bd7)['then'](handleEntityNotFound(_0x5a80b9,null))['then'](respondWithResult(_0x5a80b9,null))['catch'](handleError(_0x5a80b9,null));};exports[_0x5c81('0x45')]=function(_0x535e3a,_0xaa5e60){return db['CmCompany'][_0x5c81('0x45')](_0x535e3a[_0x5c81('0x46')],{})[_0x5c81('0x22')](function(_0x13027e){var _0x3e9b44=_0x535e3a[_0x5c81('0x47')]['get']({'plain':!![]});if(!_0x3e9b44)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x3e9b44[_0x5c81('0x48')]===_0x5c81('0x47')){var _0x441600=_0x13027e[_0x5c81('0x24')]({'plain':!![]});var _0x219ccc=_0x5c81('0x49');return db['UserProfileSection'][_0x5c81('0x4a')]({'where':{'name':_0x219ccc,'userProfileId':_0x3e9b44[_0x5c81('0x4b')]},'raw':!![]})[_0x5c81('0x22')](function(_0x2a6971){if(_0x2a6971&&_0x2a6971[_0x5c81('0x4c')]===0x0){return db[_0x5c81('0x25')][_0x5c81('0x45')]({'name':_0x441600[_0x5c81('0x28')],'resourceId':_0x441600['id'],'type':_0x2a6971[_0x5c81('0x28')],'sectionId':_0x2a6971['id']},{})['then'](function(){return _0x13027e;});}else{return _0x13027e;}})[_0x5c81('0x3f')](function(_0x381e51){logger['error'](_0x5c81('0x4d'),_0x381e51);throw _0x381e51;});}return _0x13027e;})[_0x5c81('0x22')](respondWithResult(_0xaa5e60,0xc9))[_0x5c81('0x3f')](handleError(_0xaa5e60,null));};exports['update']=function(_0x39a93a,_0x2da11b){if(_0x39a93a[_0x5c81('0x46')]['id']){delete _0x39a93a[_0x5c81('0x46')]['id'];}return db[_0x5c81('0x2b')][_0x5c81('0x4a')]({'where':{'id':_0x39a93a[_0x5c81('0x40')]['id']}})[_0x5c81('0x22')](handleEntityNotFound(_0x2da11b,null))[_0x5c81('0x22')](saveUpdates(_0x39a93a[_0x5c81('0x46')],null))[_0x5c81('0x22')](respondWithResult(_0x2da11b,null))[_0x5c81('0x3f')](handleError(_0x2da11b,null));};exports[_0x5c81('0x23')]=function(_0x2267ff,_0x4f43ab){return db[_0x5c81('0x2b')]['find']({'where':{'id':_0x2267ff[_0x5c81('0x40')]['id']}})[_0x5c81('0x22')](handleEntityNotFound(_0x4f43ab,null))[_0x5c81('0x22')](removeEntity(_0x4f43ab,null))['catch'](handleError(_0x4f43ab,null));};exports[_0x5c81('0x2c')]=function(_0x4c5a7d,_0x56df9e){return db[_0x5c81('0x2b')][_0x5c81('0x2c')]()['then'](respondWithResult(_0x56df9e,null))[_0x5c81('0x3f')](handleError(_0x56df9e,null));};exports[_0x5c81('0x4e')]=function(_0x35a51a,_0xf84bad,_0x102570){return db[_0x5c81('0x4f')][_0x5c81('0x4a')]({'where':{'id':_0x35a51a[_0x5c81('0x40')]['id']}})[_0x5c81('0x22')](handleEntityNotFound(_0xf84bad,null))[_0x5c81('0x22')](function(_0x4a30d8){if(_0x4a30d8){return _0x4a30d8['addContacts'](_0x35a51a[_0x5c81('0x46')][_0x5c81('0x50')],_[_0x5c81('0x51')](_0x35a51a[_0x5c81('0x46')],[_0x5c81('0x50'),'id'])||{});}})['then'](respondWithResult(_0xf84bad,null))[_0x5c81('0x3f')](handleError(_0xf84bad,null));};exports['getContacts']=function(_0x14aa9d,_0x260b68,_0x1de365){var _0x597d0b={};var _0x9781fc={};var _0x521eea;var _0x33b412;return db[_0x5c81('0x2b')][_0x5c81('0x52')]({'where':{'id':_0x14aa9d['params']['id']}})[_0x5c81('0x22')](handleEntityNotFound(_0x260b68,null))[_0x5c81('0x22')](function(_0x309c90){if(_0x309c90){_0x521eea=_0x309c90;_0x9781fc[_0x5c81('0x30')]=_[_0x5c81('0x2d')](db[_0x5c81('0x4f')][_0x5c81('0x41')]);_0x9781fc[_0x5c81('0x2e')]=_[_0x5c81('0x2d')](_0x14aa9d[_0x5c81('0x2e')]);_0x9781fc[_0x5c81('0x42')]=_[_0x5c81('0x2f')](_0x9781fc[_0x5c81('0x30')],_0x9781fc['query']);_0x597d0b[_0x5c81('0x31')]=_[_0x5c81('0x2f')](_0x9781fc['model'],qs[_0x5c81('0x32')](_0x14aa9d['query']['fields']));_0x597d0b[_0x5c81('0x31')]=_0x597d0b[_0x5c81('0x31')][_0x5c81('0x33')]?_0x597d0b['attributes']:_0x9781fc[_0x5c81('0x30')];_0x597d0b[_0x5c81('0x35')]=qs['sort'](_0x14aa9d[_0x5c81('0x2e')][_0x5c81('0x36')]);_0x597d0b[_0x5c81('0x37')]=qs[_0x5c81('0x42')](_[_0x5c81('0x38')](_0x14aa9d[_0x5c81('0x2e')],_0x9781fc[_0x5c81('0x42')]));if(_0x14aa9d[_0x5c81('0x2e')][_0x5c81('0x39')]){_0x597d0b[_0x5c81('0x37')]=_[_0x5c81('0x3a')](_0x597d0b['where'],{'$or':_[_0x5c81('0x3b')](_0x597d0b[_0x5c81('0x31')],function(_0x42e3fc){var _0x487e98={};_0x487e98[_0x42e3fc]={'$like':'%'+_0x14aa9d[_0x5c81('0x2e')][_0x5c81('0x39')]+'%'};return _0x487e98;})});}_0x597d0b=_[_0x5c81('0x3a')]({},_0x597d0b,_0x14aa9d[_0x5c81('0x44')]);return _0x521eea[_0x5c81('0x53')](_0x597d0b);}})['then'](function(_0x44a4a5){if(_0x44a4a5){_0x33b412=_0x44a4a5[_0x5c81('0x33')];if(!_0x14aa9d[_0x5c81('0x2e')][_0x5c81('0x34')](_0x5c81('0x54'))){_0x597d0b[_0x5c81('0x1c')]=qs[_0x5c81('0x1c')](_0x14aa9d[_0x5c81('0x2e')][_0x5c81('0x1c')]);_0x597d0b[_0x5c81('0x1a')]=qs[_0x5c81('0x1a')](_0x14aa9d['query'][_0x5c81('0x1a')]);}return _0x521eea['getContacts'](_0x597d0b);}})[_0x5c81('0x22')](function(_0x226420){if(_0x226420){return _0x226420?{'count':_0x33b412,'rows':_0x226420}:null;}})[_0x5c81('0x22')](respondWithResult(_0x260b68,null))[_0x5c81('0x3f')](handleError(_0x260b68,null));};
\ No newline at end of file
+var _0x9711=['where','merge','map','filter','includeAll','include','findAll','rows','catch','show','rawAttributes','intersection','length','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','Companies','userProfileId','autoAssociation','params','describe','addContacts','CmContact','ids','omit','getContacts','findOne','pick','nolimit','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','path','to-csv','ejs','lodash','squel','crypto','jsforce','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','save','update','then','destroy','get','UserProfileResource','sendStatus','error','stack','name','index','CmCompany','model','keys','query','filters','fields','attributes','hasOwnProperty','order','sort'];(function(_0x3da02c,_0xe172b1){var _0x265b44=function(_0x1c4ddc){while(--_0x1c4ddc){_0x3da02c['push'](_0x3da02c['shift']());}};_0x265b44(++_0xe172b1);}(_0x9711,0x122));var _0x1971=function(_0x3f6a7b,_0x5be424){_0x3f6a7b=_0x3f6a7b-0x0;var _0x6b830f=_0x9711[_0x3f6a7b];return _0x6b830f;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x1971('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0x1971('0x1'));var rp=require(_0x1971('0x2'));var moment=require(_0x1971('0x3'));var BPromise=require(_0x1971('0x4'));var Mustache=require(_0x1971('0x5'));var util=require('util');var path=require(_0x1971('0x6'));var sox=require('sox');var csv=require(_0x1971('0x7'));var ejs=require(_0x1971('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x1971('0x9'));var squel=require(_0x1971('0xa'));var crypto=require(_0x1971('0xb'));var jsforce=require(_0x1971('0xc'));var deskjs=require('desk.js');var toCsv=require(_0x1971('0x7'));var querystring=require(_0x1971('0xd'));var Papa=require('papaparse');var Redis=require(_0x1971('0xe'));var authService=require(_0x1971('0xf'));var qs=require(_0x1971('0x10'));var as=require(_0x1971('0x11'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x1971('0x12'))('api');var utils=require(_0x1971('0x13'));var config=require(_0x1971('0x14'));var licenseUtil=require(_0x1971('0x15'));var db=require(_0x1971('0x16'))['db'];function respondWithStatusCode(_0x2bef9e,_0x9aea9c){_0x9aea9c=_0x9aea9c||0xcc;return function(_0x4b2ec8){if(_0x4b2ec8){return _0x2bef9e['sendStatus'](_0x9aea9c);}return _0x2bef9e[_0x1971('0x17')](_0x9aea9c)[_0x1971('0x18')]();};}function respondWithResult(_0x2daf1a,_0x3e62e4){_0x3e62e4=_0x3e62e4||0xc8;return function(_0x5c51f9){if(_0x5c51f9){return _0x2daf1a[_0x1971('0x17')](_0x3e62e4)[_0x1971('0x19')](_0x5c51f9);}};}function respondWithFilteredResult(_0x5c8d41,_0x5646bd){return function(_0x350dd7){if(_0x350dd7){var _0x4fdc53=typeof _0x5646bd[_0x1971('0x1a')]===_0x1971('0x1b')&&typeof _0x5646bd[_0x1971('0x1c')]===_0x1971('0x1b');var _0x33c19b=_0x350dd7[_0x1971('0x1d')];var _0x577f64=_0x4fdc53?0x0:_0x5646bd['offset'];var _0x102356=_0x4fdc53?_0x350dd7[_0x1971('0x1d')]:_0x5646bd[_0x1971('0x1a')]+_0x5646bd['limit'];var _0x2f2b23;if(_0x102356>=_0x33c19b){_0x102356=_0x33c19b;_0x2f2b23=0xc8;}else{_0x2f2b23=0xce;}_0x5c8d41[_0x1971('0x17')](_0x2f2b23);return _0x5c8d41[_0x1971('0x1e')](_0x1971('0x1f'),_0x577f64+'-'+_0x102356+'/'+_0x33c19b)[_0x1971('0x19')](_0x350dd7);}return null;};}function patchUpdates(_0x33195d){return function(_0x355172){try{jsonpatch[_0x1971('0x20')](_0x355172,_0x33195d,!![]);}catch(_0x471419){return BPromise['reject'](_0x471419);}return _0x355172[_0x1971('0x21')]();};}function saveUpdates(_0x1a0b33,_0x308afa){return function(_0x4b6736){if(_0x4b6736){return _0x4b6736[_0x1971('0x22')](_0x1a0b33)[_0x1971('0x23')](function(_0x329de3){return _0x329de3;});}return null;};}function removeEntity(_0x1bfbc9,_0x449532){return function(_0x105b9a){if(_0x105b9a){return _0x105b9a[_0x1971('0x24')]()[_0x1971('0x23')](function(){var _0x1185a7=_0x105b9a[_0x1971('0x25')]({'plain':!![]});var _0x121f9d='Companies';return db[_0x1971('0x26')][_0x1971('0x24')]({'where':{'type':_0x121f9d,'resourceId':_0x1185a7['id']}})[_0x1971('0x23')](function(){return _0x105b9a;});})['then'](function(){_0x1bfbc9['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x5c2565,_0x1ea7f7){return function(_0x16ad03){if(!_0x16ad03){_0x5c2565[_0x1971('0x27')](0x194);}return _0x16ad03;};}function handleError(_0x203b3e,_0x18167a){_0x18167a=_0x18167a||0x1f4;return function(_0x278534){logger[_0x1971('0x28')](_0x278534[_0x1971('0x29')]);if(_0x278534[_0x1971('0x2a')]){delete _0x278534['name'];}_0x203b3e[_0x1971('0x17')](_0x18167a)['send'](_0x278534);};}exports[_0x1971('0x2b')]=function(_0x536149,_0x9f464f){var _0x112158={},_0x52757b={},_0x2eb47b={'count':0x0,'rows':[]};return db[_0x1971('0x2c')]['describe']()[_0x1971('0x23')](function(_0x51559a){_0x52757b[_0x1971('0x2d')]=_[_0x1971('0x2e')](_0x51559a);_0x52757b[_0x1971('0x2f')]=_['keys'](_0x536149['query']);_0x52757b[_0x1971('0x30')]=_['intersection'](_0x52757b[_0x1971('0x2d')],_0x52757b['query']);_0x112158['attributes']=_['intersection'](_0x52757b['model'],qs[_0x1971('0x31')](_0x536149[_0x1971('0x2f')][_0x1971('0x31')]));_0x112158[_0x1971('0x32')]=_0x112158[_0x1971('0x32')]['length']?_0x112158['attributes']:_0x52757b['model'];if(!_0x536149['query'][_0x1971('0x33')]('nolimit')){_0x112158['limit']=qs[_0x1971('0x1c')](_0x536149[_0x1971('0x2f')][_0x1971('0x1c')]);_0x112158[_0x1971('0x1a')]=qs[_0x1971('0x1a')](_0x536149[_0x1971('0x2f')][_0x1971('0x1a')]);}_0x112158[_0x1971('0x34')]=qs[_0x1971('0x35')](_0x536149[_0x1971('0x2f')][_0x1971('0x35')]);_0x112158[_0x1971('0x36')]=qs[_0x1971('0x30')](_['pick'](_0x536149[_0x1971('0x2f')],_0x52757b[_0x1971('0x30')]),_0x51559a);if(_0x536149[_0x1971('0x2f')]['filter']){_0x112158[_0x1971('0x36')]=_[_0x1971('0x37')](_0x112158[_0x1971('0x36')],{'$or':_[_0x1971('0x38')](_0x112158[_0x1971('0x32')],function(_0x310df7){var _0x336424={};_0x336424[_0x310df7]={'$like':'%'+_0x536149[_0x1971('0x2f')][_0x1971('0x39')]+'%'};return _0x336424;})});}_0x112158=_['merge']({},_0x112158,_0x536149['options']);var _0xcb6534={'where':_0x112158[_0x1971('0x36')]};return db[_0x1971('0x2c')][_0x1971('0x1d')](_0xcb6534)['then'](function(_0x5a306c){_0x2eb47b[_0x1971('0x1d')]=_0x5a306c;if(_0x536149[_0x1971('0x2f')][_0x1971('0x3a')]){_0x112158[_0x1971('0x3b')]=[{'all':!![]}];}return db[_0x1971('0x2c')][_0x1971('0x3c')](_0x112158);})[_0x1971('0x23')](function(_0x5778a5){_0x2eb47b[_0x1971('0x3d')]=_0x5778a5;return _0x2eb47b;})[_0x1971('0x23')](respondWithFilteredResult(_0x9f464f,_0x112158))['catch'](handleError(_0x9f464f,null));})[_0x1971('0x3e')](handleError(_0x9f464f,null));};exports[_0x1971('0x3f')]=function(_0xc72bb8,_0x34a744){var _0x5605cb={'raw':![],'where':{'id':_0xc72bb8['params']['id']}},_0x34a002={};_0x34a002[_0x1971('0x2d')]=_[_0x1971('0x2e')](db[_0x1971('0x2c')][_0x1971('0x40')]);_0x34a002[_0x1971('0x2f')]=_[_0x1971('0x2e')](_0xc72bb8[_0x1971('0x2f')]);_0x34a002['filters']=_[_0x1971('0x41')](_0x34a002['model'],_0x34a002['query']);_0x5605cb[_0x1971('0x32')]=_[_0x1971('0x41')](_0x34a002[_0x1971('0x2d')],qs[_0x1971('0x31')](_0xc72bb8[_0x1971('0x2f')][_0x1971('0x31')]));_0x5605cb[_0x1971('0x32')]=_0x5605cb[_0x1971('0x32')][_0x1971('0x42')]?_0x5605cb['attributes']:_0x34a002['model'];if(_0xc72bb8[_0x1971('0x2f')][_0x1971('0x3a')]){_0x5605cb[_0x1971('0x3b')]=[{'all':!![]}];}_0x5605cb=_[_0x1971('0x37')]({},_0x5605cb,_0xc72bb8['options']);return db[_0x1971('0x2c')][_0x1971('0x43')](_0x5605cb)[_0x1971('0x23')](handleEntityNotFound(_0x34a744,null))['then'](respondWithResult(_0x34a744,null))[_0x1971('0x3e')](handleError(_0x34a744,null));};exports[_0x1971('0x44')]=function(_0x4389d0,_0x2fa355){return db[_0x1971('0x2c')]['create'](_0x4389d0[_0x1971('0x45')],{})['then'](function(_0x1eeca7){var _0x679786=_0x4389d0[_0x1971('0x46')][_0x1971('0x25')]({'plain':!![]});if(!_0x679786)throw new Error(_0x1971('0x47'));if(_0x679786[_0x1971('0x48')]===_0x1971('0x46')){var _0x6bc95d=_0x1eeca7[_0x1971('0x25')]({'plain':!![]});var _0x4b11ce=_0x1971('0x49');return db['UserProfileSection'][_0x1971('0x43')]({'where':{'name':_0x4b11ce,'userProfileId':_0x679786[_0x1971('0x4a')]},'raw':!![]})['then'](function(_0x1aa97a){if(_0x1aa97a&&_0x1aa97a[_0x1971('0x4b')]===0x0){return db[_0x1971('0x26')][_0x1971('0x44')]({'name':_0x6bc95d[_0x1971('0x2a')],'resourceId':_0x6bc95d['id'],'type':_0x1aa97a['name'],'sectionId':_0x1aa97a['id']},{})['then'](function(){return _0x1eeca7;});}else{return _0x1eeca7;}})['catch'](function(_0x2cfcfd){logger[_0x1971('0x28')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x2cfcfd);throw _0x2cfcfd;});}return _0x1eeca7;})[_0x1971('0x23')](respondWithResult(_0x2fa355,0xc9))[_0x1971('0x3e')](handleError(_0x2fa355,null));};exports[_0x1971('0x22')]=function(_0x4435ab,_0x351b53){if(_0x4435ab[_0x1971('0x45')]['id']){delete _0x4435ab[_0x1971('0x45')]['id'];}return db[_0x1971('0x2c')]['find']({'where':{'id':_0x4435ab[_0x1971('0x4c')]['id']}})[_0x1971('0x23')](handleEntityNotFound(_0x351b53,null))[_0x1971('0x23')](saveUpdates(_0x4435ab[_0x1971('0x45')],null))[_0x1971('0x23')](respondWithResult(_0x351b53,null))['catch'](handleError(_0x351b53,null));};exports[_0x1971('0x24')]=function(_0x2365b1,_0x5d3922){return db['CmCompany'][_0x1971('0x43')]({'where':{'id':_0x2365b1['params']['id']}})['then'](handleEntityNotFound(_0x5d3922,null))['then'](removeEntity(_0x5d3922,null))[_0x1971('0x3e')](handleError(_0x5d3922,null));};exports[_0x1971('0x4d')]=function(_0x552d10,_0x37b5a1){return db[_0x1971('0x2c')][_0x1971('0x4d')]()[_0x1971('0x23')](respondWithResult(_0x37b5a1,null))['catch'](handleError(_0x37b5a1,null));};exports[_0x1971('0x4e')]=function(_0x4da108,_0x8adb,_0x58350e){return db[_0x1971('0x4f')][_0x1971('0x43')]({'where':{'id':_0x4da108[_0x1971('0x4c')]['id']}})[_0x1971('0x23')](handleEntityNotFound(_0x8adb,null))[_0x1971('0x23')](function(_0x547ef0){if(_0x547ef0){return _0x547ef0[_0x1971('0x4e')](_0x4da108[_0x1971('0x45')][_0x1971('0x50')],_[_0x1971('0x51')](_0x4da108[_0x1971('0x45')],[_0x1971('0x50'),'id'])||{});}})['then'](respondWithResult(_0x8adb,null))[_0x1971('0x3e')](handleError(_0x8adb,null));};exports[_0x1971('0x52')]=function(_0x80adb8,_0xc18ed0,_0x5e6f07){var _0x1784e1={};var _0x446f77={};var _0xb3a773;var _0x2bafe6;return db[_0x1971('0x2c')][_0x1971('0x53')]({'where':{'id':_0x80adb8['params']['id']}})['then'](handleEntityNotFound(_0xc18ed0,null))['then'](function(_0x3c7bd6){if(_0x3c7bd6){_0xb3a773=_0x3c7bd6;_0x446f77['model']=_[_0x1971('0x2e')](db[_0x1971('0x4f')]['rawAttributes']);_0x446f77['query']=_[_0x1971('0x2e')](_0x80adb8[_0x1971('0x2f')]);_0x446f77[_0x1971('0x30')]=_['intersection'](_0x446f77['model'],_0x446f77[_0x1971('0x2f')]);_0x1784e1[_0x1971('0x32')]=_[_0x1971('0x41')](_0x446f77[_0x1971('0x2d')],qs['fields'](_0x80adb8[_0x1971('0x2f')][_0x1971('0x31')]));_0x1784e1[_0x1971('0x32')]=_0x1784e1['attributes']['length']?_0x1784e1[_0x1971('0x32')]:_0x446f77['model'];_0x1784e1[_0x1971('0x34')]=qs[_0x1971('0x35')](_0x80adb8['query'][_0x1971('0x35')]);_0x1784e1[_0x1971('0x36')]=qs[_0x1971('0x30')](_[_0x1971('0x54')](_0x80adb8['query'],_0x446f77['filters']));if(_0x80adb8[_0x1971('0x2f')][_0x1971('0x39')]){_0x1784e1[_0x1971('0x36')]=_[_0x1971('0x37')](_0x1784e1[_0x1971('0x36')],{'$or':_[_0x1971('0x38')](_0x1784e1[_0x1971('0x32')],function(_0x2586d6){var _0x2e281f={};_0x2e281f[_0x2586d6]={'$like':'%'+_0x80adb8[_0x1971('0x2f')]['filter']+'%'};return _0x2e281f;})});}_0x1784e1=_[_0x1971('0x37')]({},_0x1784e1,_0x80adb8['options']);return _0xb3a773['getContacts'](_0x1784e1);}})[_0x1971('0x23')](function(_0x28143c){if(_0x28143c){_0x2bafe6=_0x28143c[_0x1971('0x42')];if(!_0x80adb8[_0x1971('0x2f')][_0x1971('0x33')](_0x1971('0x55'))){_0x1784e1[_0x1971('0x1c')]=qs[_0x1971('0x1c')](_0x80adb8[_0x1971('0x2f')][_0x1971('0x1c')]);_0x1784e1[_0x1971('0x1a')]=qs[_0x1971('0x1a')](_0x80adb8[_0x1971('0x2f')][_0x1971('0x1a')]);}return _0xb3a773[_0x1971('0x52')](_0x1784e1);}})[_0x1971('0x23')](function(_0x5747c2){if(_0x5747c2){return _0x5747c2?{'count':_0x2bafe6,'rows':_0x5747c2}:null;}})['then'](respondWithResult(_0xc18ed0,null))[_0x1971('0x3e')](handleError(_0xc18ed0,null));};
\ No newline at end of file
diff --git a/server/api/cmCompany/cmCompany.model.js b/server/api/cmCompany/cmCompany.model.js
index 7b81260..79f589b 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 _0x667f=['../../config/environment','./cmCompany.attributes','exports','define','CmCompany','cm_companies','util','../../config/logger','api','bluebird','request-promise','path'];(function(_0x18f3dc,_0x1289b9){var _0x2a10c5=function(_0x37b935){while(--_0x37b935){_0x18f3dc['push'](_0x18f3dc['shift']());}};_0x2a10c5(++_0x1289b9);}(_0x667f,0x192));var _0xf667=function(_0x32e835,_0x4f2b26){_0x32e835=_0x32e835-0x0;var _0x3cef1b=_0x667f[_0x32e835];return _0x3cef1b;};'use strict';var _=require('lodash');var util=require(_0xf667('0x0'));var logger=require(_0xf667('0x1'))(_0xf667('0x2'));var moment=require('moment');var BPromise=require(_0xf667('0x3'));var rp=require(_0xf667('0x4'));var fs=require('fs');var path=require(_0xf667('0x5'));var rimraf=require('rimraf');var config=require(_0xf667('0x6'));var attributes=require(_0xf667('0x7'));module[_0xf667('0x8')]=function(_0x592201,_0x21c5d1){return _0x592201[_0xf667('0x9')](_0xf667('0xa'),attributes,{'tableName':_0xf667('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xe6bf=['../../config/logger','api','moment','bluebird','path','./cmCompany.attributes','define','CmCompany','cm_companies','util'];(function(_0x10bf87,_0xabfac1){var _0x4c737e=function(_0x20f937){while(--_0x20f937){_0x10bf87['push'](_0x10bf87['shift']());}};_0x4c737e(++_0xabfac1);}(_0xe6bf,0xef));var _0xfe6b=function(_0xab649b,_0x1519e9){_0xab649b=_0xab649b-0x0;var _0x3b7584=_0xe6bf[_0xab649b];return _0x3b7584;};'use strict';var _=require('lodash');var util=require(_0xfe6b('0x0'));var logger=require(_0xfe6b('0x1'))(_0xfe6b('0x2'));var moment=require(_0xfe6b('0x3'));var BPromise=require(_0xfe6b('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xfe6b('0x5'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0xfe6b('0x6'));module['exports']=function(_0x1147be,_0x1b442f){return _0x1147be[_0xfe6b('0x7')](_0xfe6b('0x8'),attributes,{'tableName':_0xfe6b('0x9'),'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 bc636a8..9dd8f4d 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 _0xc430=['stringify','error','code','message','CmCompany,\x20%s,\x20%s','result','catch','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','request\x20sent'];(function(_0x2dafbe,_0x5d04de){var _0x58a45a=function(_0x50ac96){while(--_0x50ac96){_0x2dafbe['push'](_0x2dafbe['shift']());}};_0x58a45a(++_0x5d04de);}(_0xc430,0xaf));var _0x0c43=function(_0x278a54,_0x8f113b){_0x278a54=_0x278a54-0x0;var _0x1e8b43=_0xc430[_0x278a54];return _0x1e8b43;};'use strict';var _=require(_0x0c43('0x0'));var util=require(_0x0c43('0x1'));var moment=require('moment');var BPromise=require(_0x0c43('0x2'));var rs=require(_0x0c43('0x3'));var fs=require('fs');var Redis=require(_0x0c43('0x4'));var db=require(_0x0c43('0x5'))['db'];var utils=require(_0x0c43('0x6'));var logger=require(_0x0c43('0x7'))(_0x0c43('0x8'));var config=require(_0x0c43('0x9'));var jayson=require(_0x0c43('0xa'));var client=jayson[_0x0c43('0xb')][_0x0c43('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x31abbf,_0x3cdb8e,_0x9d71ea){return new BPromise(function(_0x492a9a,_0x59d536){return client[_0x0c43('0xd')](_0x31abbf,_0x9d71ea)[_0x0c43('0xe')](function(_0x4bb719){logger[_0x0c43('0xf')]('CmCompany,\x20%s,\x20%s',_0x3cdb8e,_0x0c43('0x10'));logger['debug']('CmCompany,\x20%s,\x20%s,\x20%s',_0x3cdb8e,_0x0c43('0x10'),JSON[_0x0c43('0x11')](_0x4bb719));if(_0x4bb719[_0x0c43('0x12')]){if(_0x4bb719[_0x0c43('0x12')][_0x0c43('0x13')]===0x1f4){logger[_0x0c43('0x12')]('CmCompany,\x20%s,\x20%s',_0x3cdb8e,_0x4bb719['error'][_0x0c43('0x14')]);return _0x59d536(_0x4bb719[_0x0c43('0x12')][_0x0c43('0x14')]);}logger['error'](_0x0c43('0x15'),_0x3cdb8e,_0x4bb719['error'][_0x0c43('0x14')]);return _0x492a9a(_0x4bb719[_0x0c43('0x12')]['message']);}else{logger[_0x0c43('0xf')](_0x0c43('0x15'),_0x3cdb8e,'request\x20sent');_0x492a9a(_0x4bb719[_0x0c43('0x16')][_0x0c43('0x14')]);}})[_0x0c43('0x17')](function(_0x1c7b86){logger[_0x0c43('0x12')](_0x0c43('0x15'),_0x3cdb8e,_0x1c7b86);_0x59d536(_0x1c7b86);});});}
\ No newline at end of file
+var _0x43eb=['info','request\x20sent','debug','CmCompany,\x20%s,\x20%s,\x20%s','stringify','error','code','message','CmCompany,\x20%s,\x20%s','result','catch','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','request','then'];(function(_0x4f32de,_0x5bd4a){var _0x149821=function(_0x205885){while(--_0x205885){_0x4f32de['push'](_0x4f32de['shift']());}};_0x149821(++_0x5bd4a);}(_0x43eb,0x17b));var _0xb43e=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x43eb[_0x3dd15e];return _0x231fd0;};'use strict';var _=require('lodash');var util=require(_0xb43e('0x0'));var moment=require('moment');var BPromise=require(_0xb43e('0x1'));var rs=require(_0xb43e('0x2'));var fs=require('fs');var Redis=require(_0xb43e('0x3'));var db=require(_0xb43e('0x4'))['db'];var utils=require(_0xb43e('0x5'));var logger=require(_0xb43e('0x6'))('rpc');var config=require(_0xb43e('0x7'));var jayson=require(_0xb43e('0x8'));var client=jayson[_0xb43e('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x2f3f34,_0x3bc048,_0x373678){return new BPromise(function(_0x5cbe4e,_0x20ed9b){return client[_0xb43e('0xa')](_0x2f3f34,_0x373678)[_0xb43e('0xb')](function(_0x14a8ba){logger[_0xb43e('0xc')]('CmCompany,\x20%s,\x20%s',_0x3bc048,_0xb43e('0xd'));logger[_0xb43e('0xe')](_0xb43e('0xf'),_0x3bc048,_0xb43e('0xd'),JSON[_0xb43e('0x10')](_0x14a8ba));if(_0x14a8ba[_0xb43e('0x11')]){if(_0x14a8ba[_0xb43e('0x11')][_0xb43e('0x12')]===0x1f4){logger[_0xb43e('0x11')]('CmCompany,\x20%s,\x20%s',_0x3bc048,_0x14a8ba[_0xb43e('0x11')][_0xb43e('0x13')]);return _0x20ed9b(_0x14a8ba[_0xb43e('0x11')][_0xb43e('0x13')]);}logger[_0xb43e('0x11')]('CmCompany,\x20%s,\x20%s',_0x3bc048,_0x14a8ba['error'][_0xb43e('0x13')]);return _0x5cbe4e(_0x14a8ba[_0xb43e('0x11')]['message']);}else{logger[_0xb43e('0xc')](_0xb43e('0x14'),_0x3bc048,_0xb43e('0xd'));_0x5cbe4e(_0x14a8ba[_0xb43e('0x15')][_0xb43e('0x13')]);}})[_0xb43e('0x16')](function(_0x89ff54){logger[_0xb43e('0x11')](_0xb43e('0x14'),_0x3bc048,_0x89ff54);_0x20ed9b(_0x89ff54);});});}
\ No newline at end of file
diff --git a/server/api/cmCompany/index.js b/server/api/cmCompany/index.js
index 05676e8..4b0be54 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 _0x2175=['describe','show','/:id/contacts','getContacts','post','create','addContacts','put','update','delete','/:id','destroy','exports','multer','util','connect-timeout','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated'];(function(_0x30ae5e,_0x391fc4){var _0x1f2e93=function(_0x60307d){while(--_0x60307d){_0x30ae5e['push'](_0x30ae5e['shift']());}};_0x1f2e93(++_0x391fc4);}(_0x2175,0xa7));var _0x5217=function(_0x12d533,_0x2f6b8c){_0x12d533=_0x12d533-0x0;var _0x56f21b=_0x2175[_0x12d533];return _0x56f21b;};'use strict';var multer=require(_0x5217('0x0'));var util=require(_0x5217('0x1'));var path=require('path');var timeout=require(_0x5217('0x2'));var express=require('express');var router=express['Router']();var fs_extra=require(_0x5217('0x3'));var auth=require(_0x5217('0x4'));var interaction=require(_0x5217('0x5'));var config=require(_0x5217('0x6'));var controller=require('./cmCompany.controller');router[_0x5217('0x7')]('/',auth[_0x5217('0x8')](),controller['index']);router[_0x5217('0x7')]('/describe',auth[_0x5217('0x8')](),controller[_0x5217('0x9')]);router[_0x5217('0x7')]('/:id',auth[_0x5217('0x8')](),controller[_0x5217('0xa')]);router['get'](_0x5217('0xb'),auth[_0x5217('0x8')](),controller[_0x5217('0xc')]);router[_0x5217('0xd')]('/',auth[_0x5217('0x8')](),controller[_0x5217('0xe')]);router['post']('/:id/contacts',auth['isAuthenticated'](),controller[_0x5217('0xf')]);router[_0x5217('0x10')]('/:id',auth[_0x5217('0x8')](),controller[_0x5217('0x11')]);router[_0x5217('0x12')](_0x5217('0x13'),auth['isAuthenticated'](),controller[_0x5217('0x14')]);module[_0x5217('0x15')]=router;
\ No newline at end of file
+var _0xd3a9=['exports','util','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./cmCompany.controller','get','index','isAuthenticated','describe','/:id','/:id/contacts','getContacts','post','addContacts','put','update','delete','destroy'];(function(_0x103be5,_0xe24819){var _0x306562=function(_0x3fbcdc){while(--_0x3fbcdc){_0x103be5['push'](_0x103be5['shift']());}};_0x306562(++_0xe24819);}(_0xd3a9,0x1e5));var _0x9d3a=function(_0x5373ec,_0x357a81){_0x5373ec=_0x5373ec-0x0;var _0x3af206=_0xd3a9[_0x5373ec];return _0x3af206;};'use strict';var multer=require('multer');var util=require(_0x9d3a('0x0'));var path=require(_0x9d3a('0x1'));var timeout=require('connect-timeout');var express=require(_0x9d3a('0x2'));var router=express[_0x9d3a('0x3')]();var fs_extra=require(_0x9d3a('0x4'));var auth=require(_0x9d3a('0x5'));var interaction=require(_0x9d3a('0x6'));var config=require('../../config/environment');var controller=require(_0x9d3a('0x7'));router[_0x9d3a('0x8')]('/',auth['isAuthenticated'](),controller[_0x9d3a('0x9')]);router[_0x9d3a('0x8')]('/describe',auth[_0x9d3a('0xa')](),controller[_0x9d3a('0xb')]);router[_0x9d3a('0x8')](_0x9d3a('0xc'),auth[_0x9d3a('0xa')](),controller['show']);router[_0x9d3a('0x8')](_0x9d3a('0xd'),auth['isAuthenticated'](),controller[_0x9d3a('0xe')]);router[_0x9d3a('0xf')]('/',auth[_0x9d3a('0xa')](),controller['create']);router[_0x9d3a('0xf')](_0x9d3a('0xd'),auth['isAuthenticated'](),controller[_0x9d3a('0x10')]);router[_0x9d3a('0x11')]('/:id',auth[_0x9d3a('0xa')](),controller[_0x9d3a('0x12')]);router[_0x9d3a('0x13')](_0x9d3a('0xc'),auth[_0x9d3a('0xa')](),controller[_0x9d3a('0x14')]);module[_0x9d3a('0x15')]=router;
\ No newline at end of file
diff --git a/server/api/cmContact/cmContact.attributes.js b/server/api/cmContact/cmContact.attributes.js
index cb5513a..96aa574 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 _0xe150=['INTEGER','UNSIGNED','NOW','lodash','sequelize','exports','STRING','TEXT'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0xe150,0x11b));var _0x0e15=function(_0x18d85e,_0x293097){_0x18d85e=_0x18d85e-0x0;var _0x1f7760=_0xe150[_0x18d85e];return _0x1f7760;};'use strict';var _=require(_0x0e15('0x0'));var Sequelize=require(_0x0e15('0x1'));module[_0x0e15('0x2')]={'firstName':{'type':Sequelize[_0x0e15('0x3')],'allowNull':![]},'lastName':{'type':Sequelize[_0x0e15('0x3')]},'street':{'type':Sequelize[_0x0e15('0x3')]},'postalCode':{'type':Sequelize[_0x0e15('0x3')]},'city':{'type':Sequelize['STRING']},'country':{'type':Sequelize['STRING']},'dateOfBirth':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0x0e15('0x4')]},'phone':{'type':Sequelize[_0x0e15('0x3')]},'mobile':{'type':Sequelize['STRING']},'fax':{'type':Sequelize[_0x0e15('0x3')]},'email':{'type':Sequelize[_0x0e15('0x3')]},'url':{'type':Sequelize[_0x0e15('0x3')]},'facebook':{'type':Sequelize[_0x0e15('0x3')]},'fb_data':{'type':Sequelize['STRING']},'twitter':{'type':Sequelize[_0x0e15('0x3')]},'skype':{'type':Sequelize[_0x0e15('0x3')]},'teams':{'type':Sequelize[_0x0e15('0x3')]},'viber':{'type':Sequelize[_0x0e15('0x3')]},'line':{'type':Sequelize[_0x0e15('0x3')]},'wechat':{'type':Sequelize[_0x0e15('0x3')]},'telegram':{'type':Sequelize['STRING']},'UserId':{'type':Sequelize[_0x0e15('0x5')]},'AdditionalPhones':{'type':Sequelize['STRING']},'priority':{'type':Sequelize[_0x0e15('0x5')](0x2)[_0x0e15('0x6')],'defaultValue':0x2,'validate':{'min':0x0,'max':0x4}},'scheduledat':{'type':Sequelize['DATE'],'defaultValue':Sequelize[_0x0e15('0x7')]},'dialTimezone':{'type':Sequelize[_0x0e15('0x3')]},'utcOffset':{'type':Sequelize[_0x0e15('0x5')]}};
\ No newline at end of file
+var _0xcb0f=['INTEGER','UNSIGNED','DATE','NOW','sequelize','exports','STRING','TEXT'];(function(_0x4136ea,_0x2d93aa){var _0x281aab=function(_0xbc7772){while(--_0xbc7772){_0x4136ea['push'](_0x4136ea['shift']());}};_0x281aab(++_0x2d93aa);}(_0xcb0f,0x114));var _0xfcb0=function(_0x58fe47,_0x495c0d){_0x58fe47=_0x58fe47-0x0;var _0x3fa0fb=_0xcb0f[_0x58fe47];return _0x3fa0fb;};'use strict';var _=require('lodash');var Sequelize=require(_0xfcb0('0x0'));module[_0xfcb0('0x1')]={'firstName':{'type':Sequelize['STRING'],'allowNull':![]},'lastName':{'type':Sequelize['STRING']},'street':{'type':Sequelize[_0xfcb0('0x2')]},'postalCode':{'type':Sequelize['STRING']},'city':{'type':Sequelize[_0xfcb0('0x2')]},'country':{'type':Sequelize['STRING']},'dateOfBirth':{'type':Sequelize[_0xfcb0('0x2')]},'description':{'type':Sequelize[_0xfcb0('0x3')]},'phone':{'type':Sequelize[_0xfcb0('0x2')]},'mobile':{'type':Sequelize[_0xfcb0('0x2')]},'fax':{'type':Sequelize[_0xfcb0('0x2')]},'email':{'type':Sequelize[_0xfcb0('0x2')]},'url':{'type':Sequelize[_0xfcb0('0x2')]},'facebook':{'type':Sequelize[_0xfcb0('0x2')]},'fb_data':{'type':Sequelize[_0xfcb0('0x2')]},'twitter':{'type':Sequelize[_0xfcb0('0x2')]},'skype':{'type':Sequelize[_0xfcb0('0x2')]},'teams':{'type':Sequelize[_0xfcb0('0x2')]},'viber':{'type':Sequelize['STRING']},'line':{'type':Sequelize[_0xfcb0('0x2')]},'wechat':{'type':Sequelize[_0xfcb0('0x2')]},'telegram':{'type':Sequelize[_0xfcb0('0x2')]},'UserId':{'type':Sequelize['INTEGER']},'AdditionalPhones':{'type':Sequelize[_0xfcb0('0x2')]},'priority':{'type':Sequelize[_0xfcb0('0x4')](0x2)[_0xfcb0('0x5')],'defaultValue':0x2,'validate':{'min':0x0,'max':0x4}},'scheduledat':{'type':Sequelize[_0xfcb0('0x6')],'defaultValue':Sequelize[_0xfcb0('0x7')]},'dialTimezone':{'type':Sequelize[_0xfcb0('0x2')]},'utcOffset':{'type':Sequelize[_0xfcb0('0x4')]}};
\ No newline at end of file
diff --git a/server/api/cmContact/cmContact.controller.js b/server/api/cmContact/cmContact.controller.js
index 18be428..3331344 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 _0xda27=['find','params','describe','tags','keys','length','startsWith','columnName','displayName','analytics','cf_','custom','type','values','Custom\x20field\x20%s\x20not\x20found\x20on\x20cm_contacts\x20table','forEach','hasOwnProperty','merge','body','from','get','mergeWith','isArray','join','info','[CmContact][merge]\x20to\x20%s\x20from\x20%s','CmHopper','CmHopperBlack','ChatInteraction','ChatMessage','MailInteraction','MailMessage','SmsMessage','OpenchannelInteraction','OpenchannelMessage','CmContactHasItem','CmHopperFinal','CmHopperHistory','ReportAgentPreview','ChatQueueReport','FaxQueueReport','MailQueueReport','OpenchannelQueueReport','SmsQueueReport','JscriptySessionReport','WhatsappInteraction','create','dialTimezone','isNil','timezones','utcOffset','additionalPhones','bulkCreate','each','duplicates','where','$or','push','ListId','findOrCreate','contact','all','show','Tag','Tags','color','tag','Phones','ItemType','literal','Phones.OrderBy','$and','omit','format','cf_%d','CmCustomField','pickBy','map','isEmpty','table','cm_contacts','setFields','id\x20=\x20?','phone','getTags','findOne','model','rawAttributes','intersection','fields','attributes','sort','filters','pick','filter','options','setTags','ids','setAdditionalPhones','ContactItemType','OrderBy','items','item_types','ItemTypeId','description','contact\x20phone\x20exists','PHONE','item','sequelize','`ItemType`.OrderBy','CmHopperId','ItemType.OrderBy','CmHopperAdditionalPhone','getAdditionalPhones','fromContactId','CmContactId','toContactId','rescheduleAdditionalPhones','getHoppers','nolimit','order','ContactId','includeAll','rows','getHopperHistories','getHopperFinals','include','getJscriptySessions','uploadCsv','No\x20ListId\x20specified','binding_keys','No\x20association\x20keys\x20specified!','binding_values','No\x20association\x20values\x20specified!','Unable\x20to\x20synchronize\x20socket,\x20no\x20timestamp\x20passed','split','zipObject','firstName','No\x20firstName\x20column\x20specified','root','server/files/tmp','filename','0777','child_process','fork','../../components/import/cm/csv','CompanyId','pid','upload','createReadStream','file','parse','User','agent','binding','No\x20phone\x20column\x20specified','socket_timestamp','../../components/import/cm/csv2','stringify','message','start\x20child\x20process\x20correctly!','exit','error\x20child\x20process','importUpdates','getJourney','mail','fax','whatsapp','voice','-createdAt','resolve','channel','includes','toLowerCase','Invalid\x20channel','range','Invalid\x20date\x20for\x20range\x20from\x20filter','isValid','Invalid\x20date\x20for\x20range\x20to\x20filter','Invalid\x20createdAt\x20filter','uniqueid','destination','callerid','starttime','endtime','duration','note','userDisposition','userSecondDisposition','userThirdDisposition','UserId','fullname','alias','createdAt','DESC','findAndCountAll','startCase','chat','Website','Account','closedAt','disposition','secondDisposition','thirdDisposition','key','Owner','browserName','customerIp','customerPort','deviceModel','osName','ratingMessage','ratingValue','referer','subject','substatus','openchannel','threadId','Interaction','flatten','sortBy','reverse','value','slice','moment','bluebird','util','squel','papaparse','ioredis','../../components/contacts','../../components/parsers/qs','api','../../config/environment','../../config/environment/shared','../../mysqldb','redis','defaults','socket.io-emitter','./cmContact.socket','register','status','json','offset','limit','undefined','count','set','Content-Range','update','then','destroy','end','sendStatus','error','name','send','index','getOptions','findAll','query','user','catch','CmContact'];(function(_0x3b25e8,_0x548a8f){var _0x4db9fa=function(_0x20cfda){while(--_0x20cfda){_0x3b25e8['push'](_0x3b25e8['shift']());}};_0x4db9fa(++_0x548a8f);}(_0xda27,0x1e8));var _0x7da2=function(_0x4165cc,_0x1b4780){_0x4165cc=_0x4165cc-0x0;var _0x5e3a4c=_0xda27[_0x4165cc];return _0x5e3a4c;};'use strict';var moment=require(_0x7da2('0x0'));var BPromise=require(_0x7da2('0x1'));var util=require(_0x7da2('0x2'));var path=require('path');var fs=require('fs');var _=require('lodash');var squel=require(_0x7da2('0x3'));var Papa=require(_0x7da2('0x4'));var Redis=require(_0x7da2('0x5'));var contacts=require(_0x7da2('0x6'));var qs=require(_0x7da2('0x7'));var logger=require('../../config/logger')(_0x7da2('0x8'));var config=require(_0x7da2('0x9'));var shared=require(_0x7da2('0xa'));var db=require(_0x7da2('0xb'))['db'];config[_0x7da2('0xc')]=_[_0x7da2('0xd')](config[_0x7da2('0xc')],{'host':'localhost','port':0x18eb});var socket=require(_0x7da2('0xe'))(new Redis(config[_0x7da2('0xc')]));require(_0x7da2('0xf'))[_0x7da2('0x10')](socket);function respondWithResult(_0x49c0b3,_0x158d88){_0x158d88=_0x158d88||0xc8;return function(_0x138afd){if(_0x138afd){return _0x49c0b3[_0x7da2('0x11')](_0x158d88)[_0x7da2('0x12')](_0x138afd);}};}function respondWithFilteredResult(_0x53aa63,_0x3c4eb6){return function(_0x2449ea){if(_0x2449ea){var _0xdb5ea8=typeof _0x3c4eb6[_0x7da2('0x13')]==='undefined'&&typeof _0x3c4eb6[_0x7da2('0x14')]===_0x7da2('0x15');var _0x3fbfdd=_0x2449ea['count'];var _0x4ff261=_0xdb5ea8?0x0:_0x3c4eb6[_0x7da2('0x13')];var _0x8b55d=_0xdb5ea8?_0x2449ea[_0x7da2('0x16')]:_0x3c4eb6[_0x7da2('0x13')]+_0x3c4eb6[_0x7da2('0x14')];var _0x551931;if(_0x8b55d>=_0x3fbfdd){_0x8b55d=_0x3fbfdd;_0x551931=0xc8;}else{_0x551931=0xce;}_0x53aa63[_0x7da2('0x11')](_0x551931);return _0x53aa63[_0x7da2('0x17')](_0x7da2('0x18'),_0x4ff261+'-'+_0x8b55d+'/'+_0x3fbfdd)[_0x7da2('0x12')](_0x2449ea);}return null;};}function saveUpdates(_0x2d2e32){return function(_0x374dc0){if(_0x374dc0){return _0x374dc0[_0x7da2('0x19')](_0x2d2e32)[_0x7da2('0x1a')](function(_0x1ccbc2){return _0x1ccbc2;});}return null;};}function removeEntity(_0x409550){return function(_0x5f0764){if(_0x5f0764){return _0x5f0764[_0x7da2('0x1b')]()[_0x7da2('0x1a')](function(){_0x409550[_0x7da2('0x11')](0xcc)[_0x7da2('0x1c')]();});}};}function handleEntityNotFound(_0x2e9e11){return function(_0x1a03c8){if(!_0x1a03c8){_0x2e9e11[_0x7da2('0x1d')](0x194);}return _0x1a03c8;};}function handleError(_0xf18457,_0x51435e){_0x51435e=_0x51435e||0x1f4;return function(_0x577f33){logger[_0x7da2('0x1e')](_0x577f33['stack']);if(_0x577f33[_0x7da2('0x1f')]){delete _0x577f33['name'];}_0xf18457[_0x7da2('0x11')](_0x51435e)[_0x7da2('0x20')](_0x577f33);};}exports[_0x7da2('0x21')]=function(_0x456d77,_0x136671){var _0xc46f9c={};return contacts['describe']()['then'](function(_0x1e4948){_0xc46f9c=qs[_0x7da2('0x22')](_0x1e4948,_0x456d77);return contacts[_0x7da2('0x23')](_0x456d77[_0x7da2('0x24')],_0x456d77[_0x7da2('0x25')],_0xc46f9c,_0x1e4948);})[_0x7da2('0x1a')](respondWithFilteredResult(_0x136671,_0xc46f9c))[_0x7da2('0x26')](handleError(_0x136671,null));};exports[_0x7da2('0x1b')]=function(_0x5de172,_0x1137b2){return db[_0x7da2('0x27')][_0x7da2('0x28')]({'where':{'id':_0x5de172[_0x7da2('0x29')]['id']}})[_0x7da2('0x1a')](handleEntityNotFound(_0x1137b2,null))[_0x7da2('0x1a')](removeEntity(_0x1137b2,null))[_0x7da2('0x26')](handleError(_0x1137b2,null));};exports['describe']=function(_0x5f46e2,_0x2390dd){return db[_0x7da2('0x27')][_0x7da2('0x2a')]()['then'](function(_0x1a5d35){delete _0x1a5d35[_0x7da2('0x2b')];for(var _0x2bb0a4=0x0;_0x2bb0a4
','Attachments','Title','Data','generateXOAuth2Token','user=','auth=Bearer\x20','lodash','moment','randomstring','path','util','node-tnef','../../../config/logger','../../../config/environment','head','value','address','anonymous','generate','@xcally.com','name','substring'];(function(_0x58d580,_0x4c8f86){var _0x3c096c=function(_0x1385cf){while(--_0x1385cf){_0x58d580['push'](_0x58d580['shift']());}};_0x3c096c(++_0x4c8f86);}(_0xdd38,0x1c4));var _0x8dd3=function(_0x1ff329,_0x33e086){_0x1ff329=_0x1ff329-0x0;var _0x28501d=_0xdd38[_0x1ff329];return _0x28501d;};'use strict';var _=require(_0x8dd3('0x0'));var moment=require(_0x8dd3('0x1'));var random=require(_0x8dd3('0x2'));var fs=require('fs');var path=require(_0x8dd3('0x3'));var util=require(_0x8dd3('0x4'));var tnef=require(_0x8dd3('0x5'));var logger=require(_0x8dd3('0x6'))('email');var config=require(_0x8dd3('0x7'));function getAddress(_0x551dd0){var _0x17440f=_[_0x8dd3('0x8')](_0x551dd0[_0x8dd3('0x9')]);return _0x17440f&&_0x17440f[_0x8dd3('0xa')]?_0x17440f[_0x8dd3('0xa')]:_0x8dd3('0xb')+random[_0x8dd3('0xc')](0x6)+_0x8dd3('0xd');}function getFirstName(_0x4a9352){var _0x47ee25=_[_0x8dd3('0x8')](_0x4a9352[_0x8dd3('0x9')]);if(_0x47ee25&&_0x47ee25[_0x8dd3('0xe')]){if(_0x47ee25[_0x8dd3('0xe')]==_0x47ee25[_0x8dd3('0xa')]){return _0x47ee25[_0x8dd3('0xe')][_0x8dd3('0xf')](0x0,_0x47ee25[_0x8dd3('0xe')][_0x8dd3('0x10')]('@'));}var _0x60d675=_0x47ee25[_0x8dd3('0xe')]['split'](/\s+/);return _0x60d675[_0x8dd3('0x11')]>0x1?_0x60d675[_0x8dd3('0x12')](0x0,-0x1)[_0x8dd3('0x13')]('\x20'):_0x47ee25[_0x8dd3('0xe')];}return _0x8dd3('0x14');}function getLastName(_0x559ebf){var _0x186654=_[_0x8dd3('0x8')](_0x559ebf['value']);if(_0x186654&&_0x186654[_0x8dd3('0xe')]){var _0xb211d=_0x186654[_0x8dd3('0xe')]['split'](/\s+/);return _0xb211d[_0x8dd3('0x11')]>0x1?_0xb211d[_0x8dd3('0x15')]():'';}return'';}function getMails(_0x2a979d,_0x15f239){var _0x3449af='';for(var _0x20045f=0x0;_0x20045f<_0x15f239[_0x8dd3('0x9')][_0x8dd3('0x11')];_0x20045f+=0x1){if(_0x15f239['value'][_0x20045f]['address']!==_0x2a979d){if(!_[_0x8dd3('0x16')](_0x3449af)){_0x3449af+=',';}_0x3449af+=_0x15f239[_0x8dd3('0x9')][_0x20045f][_0x8dd3('0xe')]||_0x15f239['value'][_0x20045f]['address']||'';_0x3449af+='\x20<';_0x3449af+=_0x15f239[_0x8dd3('0x9')][_0x20045f][_0x8dd3('0xa')]?_0x15f239[_0x8dd3('0x9')][_0x20045f]['address']:_0x8dd3('0xb')+random[_0x8dd3('0xc')](0x6)+_0x8dd3('0xd');_0x3449af+='>';}}return _0x3449af;}function parseEmail(_0x3724c1,_0x1e6b05,_0x430b65){if(_0x1e6b05[_0x8dd3('0x17')]){var _0x4813c5=/