From 66f3ba823aade02643c061072c0b360cc3cf650a Mon Sep 17 00:00:00 2001
From: Andrea Amorese
Date: Wed, 25 Aug 2021 09:31:02 +0200
Subject: [PATCH] Built motion from commit c498a62d.|2.5.34
---
apidoc/api_project.js | 2 +-
apidoc/api_project.json | 2 +-
server/api/action/action.attributes.js | 2 +-
server/api/action/action.controller.js | 2 +-
server/api/action/action.model.js | 2 +-
server/api/action/action.rpc.js | 2 +-
server/api/action/index.js | 2 +-
.../analyticCustomReport.attributes.js | 2 +-
.../analyticCustomReport.controller.js | 2 +-
.../analyticCustomReport.model.js | 2 +-
.../analyticCustomReport.rpc.js | 2 +-
server/api/analyticCustomReport/index.js | 2 +-
.../analyticDefaultReport.attributes.js | 2 +-
.../analyticDefaultReport.controller.js | 2 +-
.../analyticDefaultReport.model.js | 2 +-
.../analyticDefaultReport.rpc.js | 2 +-
server/api/analyticDefaultReport/index.js | 2 +-
.../analyticExtractedReport.attributes.js | 2 +-
.../analyticExtractedReport.controller.js | 2 +-
.../analyticExtractedReport.model.js | 2 +-
.../analyticExtractedReport.rpc.js | 2 +-
server/api/analyticExtractedReport/index.js | 2 +-
.../analyticFieldReport.attributes.js | 2 +-
.../analyticFieldReport.controller.js | 2 +-
.../analyticFieldReport.model.js | 2 +-
.../analyticFieldReport/analyticFieldReport.rpc.js | 2 +-
server/api/analyticFieldReport/index.js | 2 +-
.../analyticMetric/analyticMetric.attributes.js | 2 +-
.../analyticMetric/analyticMetric.controller.js | 2 +-
server/api/analyticMetric/analyticMetric.model.js | 2 +-
server/api/analyticMetric/analyticMetric.rpc.js | 2 +-
server/api/analyticMetric/index.js | 2 +-
.../analyticTreeReport.attributes.js | 2 +-
.../analyticTreeReport.controller.js | 2 +-
.../analyticTreeReport/analyticTreeReport.model.js | 2 +-
.../analyticTreeReport/analyticTreeReport.rpc.js | 2 +-
server/api/analyticTreeReport/index.js | 2 +-
server/api/attachment/attachment.attributes.js | 2 +-
server/api/attachment/attachment.controller.js | 2 +-
server/api/attachment/attachment.model.js | 2 +-
server/api/attachment/attachment.rpc.js | 2 +-
server/api/attachment/index.js | 2 +-
server/api/authGoogle/authGoogle.controller.js | 2 +-
server/api/authGoogle/index.js | 2 +-
server/api/authLocal/authLocal.controller.js | 2 +-
server/api/authLocal/index.js | 2 +-
server/api/automation/automation.attributes.js | 2 +-
server/api/automation/automation.controller.js | 2 +-
server/api/automation/automation.model.js | 2 +-
server/api/automation/automation.rpc.js | 2 +-
server/api/automation/index.js | 2 +-
server/api/campaign/campaign.attributes.js | 2 +-
server/api/campaign/campaign.controller.js | 2 +-
server/api/campaign/campaign.model.js | 2 +-
server/api/campaign/campaign.rpc.js | 2 +-
server/api/campaign/index.js | 2 +-
server/api/cannedAnswer/cannedAnswer.attributes.js | 2 +-
server/api/cannedAnswer/cannedAnswer.controller.js | 2 +-
server/api/cannedAnswer/cannedAnswer.model.js | 2 +-
server/api/cannedAnswer/cannedAnswer.rpc.js | 2 +-
server/api/cannedAnswer/index.js | 2 +-
server/api/cdr/cdr.attributes.js | 2 +-
server/api/cdr/cdr.controller.js | 2 +-
server/api/cdr/cdr.model.js | 2 +-
server/api/cdr/cdr.rpc.js | 2 +-
server/api/cdr/index.js | 2 +-
.../chatApplication/chatApplication.attributes.js | 2 +-
.../chatApplication/chatApplication.controller.js | 2 +-
.../api/chatApplication/chatApplication.model.js | 2 +-
server/api/chatApplication/chatApplication.rpc.js | 2 +-
server/api/chatApplication/index.js | 2 +-
server/api/chatGroup/chatGroup.attributes.js | 2 +-
server/api/chatGroup/chatGroup.controller.js | 2 +-
server/api/chatGroup/chatGroup.events.js | 2 +-
server/api/chatGroup/chatGroup.model.js | 2 +-
server/api/chatGroup/chatGroup.rpc.js | 2 +-
server/api/chatGroup/chatGroup.socket.js | 2 +-
server/api/chatGroup/index.js | 2 +-
.../chatInteraction/chatInteraction.attributes.js | 2 +-
.../chatInteraction/chatInteraction.controller.js | 2 +-
.../api/chatInteraction/chatInteraction.events.js | 2 +-
.../api/chatInteraction/chatInteraction.model.js | 2 +-
server/api/chatInteraction/chatInteraction.rpc.js | 2 +-
.../api/chatInteraction/chatInteraction.socket.js | 2 +-
server/api/chatInteraction/index.js | 2 +-
.../chatInternalMessage.attributes.js | 2 +-
.../chatInternalMessage.controller.js | 2 +-
.../chatInternalMessage.events.js | 2 +-
.../chatInternalMessage.model.js | 2 +-
.../chatInternalMessage/chatInternalMessage.rpc.js | 2 +-
.../chatInternalMessage.socket.js | 2 +-
server/api/chatInternalMessage/index.js | 2 +-
server/api/chatMessage/chatMessage.attributes.js | 2 +-
server/api/chatMessage/chatMessage.controller.js | 2 +-
server/api/chatMessage/chatMessage.events.js | 2 +-
server/api/chatMessage/chatMessage.model.js | 2 +-
server/api/chatMessage/chatMessage.rpc.js | 2 +-
server/api/chatMessage/chatMessage.socket.js | 2 +-
server/api/chatMessage/index.js | 2 +-
.../chatOfflineMessage.attributes.js | 2 +-
.../chatOfflineMessage.controller.js | 2 +-
.../chatOfflineMessage/chatOfflineMessage.model.js | 2 +-
.../chatOfflineMessage/chatOfflineMessage.rpc.js | 2 +-
server/api/chatOfflineMessage/index.js | 2 +-
.../chatProactiveAction.attributes.js | 2 +-
.../chatProactiveAction.controller.js | 2 +-
.../chatProactiveAction.model.js | 2 +-
.../chatProactiveAction/chatProactiveAction.rpc.js | 2 +-
server/api/chatProactiveAction/index.js | 2 +-
server/api/chatQueue/chatQueue.attributes.js | 2 +-
server/api/chatQueue/chatQueue.controller.js | 2 +-
server/api/chatQueue/chatQueue.events.js | 2 +-
server/api/chatQueue/chatQueue.model.js | 2 +-
server/api/chatQueue/chatQueue.rpc.js | 2 +-
server/api/chatQueue/chatQueue.socket.js | 2 +-
server/api/chatQueue/index.js | 2 +-
.../chatQueueReport/chatQueueReport.attributes.js | 2 +-
.../chatQueueReport/chatQueueReport.controller.js | 2 +-
.../api/chatQueueReport/chatQueueReport.model.js | 2 +-
server/api/chatQueueReport/chatQueueReport.rpc.js | 2 +-
server/api/chatQueueReport/index.js | 2 +-
.../chatTransferReport.attributes.js | 2 +-
.../chatTransferReport.controller.js | 2 +-
.../chatTransferReport/chatTransferReport.model.js | 2 +-
.../chatTransferReport/chatTransferReport.rpc.js | 2 +-
server/api/chatTransferReport/index.js | 2 +-
server/api/chatWebsite/chatWebsite.attributes.js | 2 +-
server/api/chatWebsite/chatWebsite.controller.js | 2 +-
server/api/chatWebsite/chatWebsite.events.js | 2 +-
server/api/chatWebsite/chatWebsite.model.js | 2 +-
server/api/chatWebsite/chatWebsite.rpc.js | 2 +-
server/api/chatWebsite/chatWebsite.socket.js | 2 +-
server/api/chatWebsite/index.js | 2 +-
.../api/cloudProvider/cloudProvider.attributes.js | 2 +-
.../api/cloudProvider/cloudProvider.controller.js | 2 +-
server/api/cloudProvider/cloudProvider.model.js | 2 +-
server/api/cloudProvider/cloudProvider.rpc.js | 2 +-
server/api/cloudProvider/index.js | 2 +-
server/api/cmCompany/cmCompany.attributes.js | 2 +-
server/api/cmCompany/cmCompany.controller.js | 2 +-
server/api/cmCompany/cmCompany.model.js | 2 +-
server/api/cmCompany/cmCompany.rpc.js | 2 +-
server/api/cmCompany/index.js | 2 +-
server/api/cmContact/cmContact.attributes.js | 2 +-
server/api/cmContact/cmContact.controller.js | 2 +-
server/api/cmContact/cmContact.events.js | 2 +-
server/api/cmContact/cmContact.model.js | 2 +-
server/api/cmContact/cmContact.rpc.js | 2 +-
server/api/cmContact/cmContact.socket.js | 2 +-
server/api/cmContact/index.js | 2 +-
.../api/cmCustomField/cmCustomField.attributes.js | 2 +-
.../api/cmCustomField/cmCustomField.controller.js | 2 +-
server/api/cmCustomField/cmCustomField.model.js | 2 +-
server/api/cmCustomField/cmCustomField.rpc.js | 2 +-
server/api/cmCustomField/index.js | 2 +-
server/api/cmHopper/cmHopper.attributes.js | 2 +-
server/api/cmHopper/cmHopper.controller.js | 2 +-
server/api/cmHopper/cmHopper.model.js | 2 +-
server/api/cmHopper/cmHopper.rpc.js | 2 +-
server/api/cmHopper/index.js | 2 +-
.../api/cmHopperBlack/cmHopperBlack.attributes.js | 2 +-
.../api/cmHopperBlack/cmHopperBlack.controller.js | 2 +-
server/api/cmHopperBlack/cmHopperBlack.model.js | 2 +-
server/api/cmHopperBlack/cmHopperBlack.rpc.js | 2 +-
server/api/cmHopperBlack/index.js | 2 +-
.../api/cmHopperFinal/cmHopperFinal.attributes.js | 2 +-
.../api/cmHopperFinal/cmHopperFinal.controller.js | 2 +-
server/api/cmHopperFinal/cmHopperFinal.model.js | 2 +-
server/api/cmHopperFinal/cmHopperFinal.rpc.js | 2 +-
server/api/cmHopperFinal/index.js | 2 +-
.../cmHopperHistory/cmHopperHistory.attributes.js | 2 +-
.../cmHopperHistory/cmHopperHistory.controller.js | 2 +-
.../api/cmHopperHistory/cmHopperHistory.model.js | 2 +-
server/api/cmHopperHistory/cmHopperHistory.rpc.js | 2 +-
server/api/cmHopperHistory/index.js | 2 +-
server/api/cmList/cmList.attributes.js | 2 +-
server/api/cmList/cmList.controller.js | 2 +-
server/api/cmList/cmList.events.js | 2 +-
server/api/cmList/cmList.model.js | 2 +-
server/api/cmList/cmList.rpc.js | 2 +-
server/api/cmList/cmList.socket.js | 2 +-
server/api/cmList/index.js | 2 +-
server/api/condition/condition.attributes.js | 2 +-
server/api/condition/condition.controller.js | 2 +-
server/api/condition/condition.model.js | 2 +-
server/api/condition/condition.rpc.js | 2 +-
server/api/condition/index.js | 2 +-
server/api/dashboard/dashboard.attributes.js | 2 +-
server/api/dashboard/dashboard.controller.js | 2 +-
server/api/dashboard/dashboard.events.js | 2 +-
server/api/dashboard/dashboard.model.js | 2 +-
server/api/dashboard/dashboard.rpc.js | 2 +-
server/api/dashboard/dashboard.socket.js | 2 +-
server/api/dashboard/index.js | 2 +-
.../api/dashboardItem/dashboardItem.attributes.js | 2 +-
.../api/dashboardItem/dashboardItem.controller.js | 2 +-
server/api/dashboardItem/dashboardItem.events.js | 2 +-
server/api/dashboardItem/dashboardItem.model.js | 2 +-
server/api/dashboardItem/dashboardItem.rpc.js | 2 +-
server/api/dashboardItem/dashboardItem.socket.js | 2 +-
server/api/dashboardItem/index.js | 2 +-
server/api/disposition/disposition.attributes.js | 2 +-
server/api/disposition/disposition.controller.js | 2 +-
server/api/disposition/disposition.model.js | 2 +-
server/api/disposition/disposition.rpc.js | 2 +-
server/api/disposition/index.js | 2 +-
server/api/faxAccount/faxAccount.attributes.js | 2 +-
server/api/faxAccount/faxAccount.controller.js | 2 +-
server/api/faxAccount/faxAccount.events.js | 2 +-
server/api/faxAccount/faxAccount.model.js | 2 +-
server/api/faxAccount/faxAccount.rpc.js | 2 +-
server/api/faxAccount/faxAccount.socket.js | 2 +-
server/api/faxAccount/index.js | 2 +-
.../faxApplication/faxApplication.attributes.js | 2 +-
.../faxApplication/faxApplication.controller.js | 2 +-
server/api/faxApplication/faxApplication.model.js | 2 +-
server/api/faxApplication/faxApplication.rpc.js | 2 +-
server/api/faxApplication/index.js | 2 +-
.../faxInteraction/faxInteraction.attributes.js | 2 +-
.../faxInteraction/faxInteraction.controller.js | 2 +-
server/api/faxInteraction/faxInteraction.events.js | 2 +-
server/api/faxInteraction/faxInteraction.model.js | 2 +-
server/api/faxInteraction/faxInteraction.rpc.js | 2 +-
server/api/faxInteraction/faxInteraction.socket.js | 2 +-
server/api/faxInteraction/index.js | 2 +-
server/api/faxMessage/faxMessage.attributes.js | 2 +-
server/api/faxMessage/faxMessage.controller.js | 2 +-
server/api/faxMessage/faxMessage.events.js | 2 +-
server/api/faxMessage/faxMessage.model.js | 2 +-
server/api/faxMessage/faxMessage.rpc.js | 2 +-
server/api/faxMessage/faxMessage.socket.js | 2 +-
server/api/faxMessage/index.js | 2 +-
server/api/faxQueue/faxQueue.attributes.js | 2 +-
server/api/faxQueue/faxQueue.controller.js | 2 +-
server/api/faxQueue/faxQueue.events.js | 2 +-
server/api/faxQueue/faxQueue.model.js | 2 +-
server/api/faxQueue/faxQueue.rpc.js | 2 +-
server/api/faxQueue/faxQueue.socket.js | 2 +-
server/api/faxQueue/index.js | 2 +-
.../faxQueueReport/faxQueueReport.attributes.js | 2 +-
.../faxQueueReport/faxQueueReport.controller.js | 2 +-
server/api/faxQueueReport/faxQueueReport.model.js | 2 +-
server/api/faxQueueReport/faxQueueReport.rpc.js | 2 +-
server/api/faxQueueReport/index.js | 2 +-
.../faxTransferReport.attributes.js | 2 +-
.../faxTransferReport.controller.js | 2 +-
.../faxTransferReport/faxTransferReport.model.js | 2 +-
.../api/faxTransferReport/faxTransferReport.rpc.js | 2 +-
server/api/faxTransferReport/index.js | 2 +-
server/api/intDeskAccount/index.js | 2 +-
.../intDeskAccount/intDeskAccount.attributes.js | 2 +-
.../intDeskAccount/intDeskAccount.controller.js | 2 +-
server/api/intDeskAccount/intDeskAccount.model.js | 2 +-
server/api/intDeskAccount/intDeskAccount.rpc.js | 2 +-
server/api/intDeskConfiguration/index.js | 2 +-
.../intDeskConfiguration.attributes.js | 2 +-
.../intDeskConfiguration.controller.js | 2 +-
.../intDeskConfiguration.model.js | 2 +-
.../intDeskConfiguration.rpc.js | 2 +-
server/api/intDeskField/index.js | 2 +-
server/api/intDeskField/intDeskField.attributes.js | 2 +-
server/api/intDeskField/intDeskField.controller.js | 2 +-
server/api/intDeskField/intDeskField.model.js | 2 +-
server/api/intDeskField/intDeskField.rpc.js | 2 +-
server/api/intDynamics365Account/index.js | 2 +-
.../intDynamics365Account.attributes.js | 2 +-
.../intDynamics365Account.controller.js | 2 +-
.../intDynamics365Account.model.js | 2 +-
.../intDynamics365Account.rpc.js | 2 +-
server/api/intDynamics365Configuration/index.js | 2 +-
.../intDynamics365Configuration.attributes.js | 2 +-
.../intDynamics365Configuration.controller.js | 2 +-
.../intDynamics365Configuration.model.js | 2 +-
.../intDynamics365Configuration.rpc.js | 2 +-
server/api/intDynamics365Field/index.js | 2 +-
.../intDynamics365Field.attributes.js | 2 +-
.../intDynamics365Field.controller.js | 2 +-
.../intDynamics365Field.model.js | 2 +-
.../intDynamics365Field/intDynamics365Field.rpc.js | 2 +-
server/api/intFreshdeskAccount/index.js | 2 +-
.../intFreshdeskAccount.attributes.js | 2 +-
.../intFreshdeskAccount.controller.js | 2 +-
.../intFreshdeskAccount.model.js | 2 +-
.../intFreshdeskAccount/intFreshdeskAccount.rpc.js | 2 +-
server/api/intFreshdeskConfiguration/index.js | 2 +-
.../intFreshdeskConfiguration.attributes.js | 2 +-
.../intFreshdeskConfiguration.controller.js | 2 +-
.../intFreshdeskConfiguration.model.js | 2 +-
.../intFreshdeskConfiguration.rpc.js | 2 +-
server/api/intFreshdeskField/index.js | 2 +-
.../intFreshdeskField.attributes.js | 2 +-
.../intFreshdeskField.controller.js | 2 +-
.../intFreshdeskField/intFreshdeskField.model.js | 2 +-
.../api/intFreshdeskField/intFreshdeskField.rpc.js | 2 +-
server/api/intFreshsalesAccount/index.js | 2 +-
.../intFreshsalesAccount.attributes.js | 2 +-
.../intFreshsalesAccount.controller.js | 2 +-
.../intFreshsalesAccount.model.js | 2 +-
.../intFreshsalesAccount.rpc.js | 2 +-
server/api/intFreshsalesConfiguration/index.js | 2 +-
.../intFreshsalesConfiguration.attributes.js | 2 +-
.../intFreshsalesConfiguration.controller.js | 2 +-
.../intFreshsalesConfiguration.model.js | 2 +-
.../intFreshsalesConfiguration.rpc.js | 2 +-
server/api/intFreshsalesField/index.js | 2 +-
.../intFreshsalesField.attributes.js | 2 +-
.../intFreshsalesField.controller.js | 2 +-
.../intFreshsalesField/intFreshsalesField.model.js | 2 +-
.../intFreshsalesField/intFreshsalesField.rpc.js | 2 +-
server/api/intSalesforceAccount/index.js | 2 +-
.../intSalesforceAccount.attributes.js | 2 +-
.../intSalesforceAccount.controller.js | 2 +-
.../intSalesforceAccount.model.js | 2 +-
.../intSalesforceAccount.rpc.js | 2 +-
server/api/intSalesforceConfiguration/index.js | 2 +-
.../intSalesforceConfiguration.attributes.js | 2 +-
.../intSalesforceConfiguration.controller.js | 2 +-
.../intSalesforceConfiguration.model.js | 2 +-
.../intSalesforceConfiguration.rpc.js | 2 +-
server/api/intSalesforceField/index.js | 2 +-
.../intSalesforceField.attributes.js | 2 +-
.../intSalesforceField.controller.js | 2 +-
.../intSalesforceField/intSalesforceField.model.js | 2 +-
.../intSalesforceField/intSalesforceField.rpc.js | 2 +-
server/api/intServicenowAccount/index.js | 2 +-
.../intServicenowAccount.attributes.js | 2 +-
.../intServicenowAccount.controller.js | 2 +-
.../intServicenowAccount.model.js | 2 +-
.../intServicenowAccount.rpc.js | 2 +-
server/api/intServicenowConfiguration/index.js | 2 +-
.../intServicenowConfiguration.attributes.js | 2 +-
.../intServicenowConfiguration.controller.js | 2 +-
.../intServicenowConfiguration.model.js | 2 +-
.../intServicenowConfiguration.rpc.js | 2 +-
server/api/intServicenowField/index.js | 2 +-
.../intServicenowField.attributes.js | 2 +-
.../intServicenowField.controller.js | 2 +-
.../intServicenowField/intServicenowField.model.js | 2 +-
.../intServicenowField/intServicenowField.rpc.js | 2 +-
server/api/intSugarcrmAccount/index.js | 2 +-
.../intSugarcrmAccount.attributes.js | 2 +-
.../intSugarcrmAccount.controller.js | 2 +-
.../intSugarcrmAccount/intSugarcrmAccount.model.js | 2 +-
.../intSugarcrmAccount/intSugarcrmAccount.rpc.js | 2 +-
server/api/intSugarcrmConfiguration/index.js | 2 +-
.../intSugarcrmConfiguration.attributes.js | 2 +-
.../intSugarcrmConfiguration.controller.js | 2 +-
.../intSugarcrmConfiguration.model.js | 2 +-
.../intSugarcrmConfiguration.rpc.js | 2 +-
server/api/intSugarcrmField/index.js | 2 +-
.../intSugarcrmField.attributes.js | 2 +-
.../intSugarcrmField.controller.js | 2 +-
.../api/intSugarcrmField/intSugarcrmField.model.js | 2 +-
.../api/intSugarcrmField/intSugarcrmField.rpc.js | 2 +-
server/api/intVtigerAccount/index.js | 2 +-
.../intVtigerAccount.attributes.js | 2 +-
.../intVtigerAccount.controller.js | 2 +-
.../api/intVtigerAccount/intVtigerAccount.model.js | 2 +-
.../api/intVtigerAccount/intVtigerAccount.rpc.js | 2 +-
server/api/intVtigerConfiguration/index.js | 2 +-
.../intVtigerConfiguration.attributes.js | 2 +-
.../intVtigerConfiguration.controller.js | 2 +-
.../intVtigerConfiguration.model.js | 2 +-
.../intVtigerConfiguration.rpc.js | 2 +-
server/api/intVtigerField/index.js | 2 +-
.../intVtigerField/intVtigerField.attributes.js | 2 +-
.../intVtigerField/intVtigerField.controller.js | 2 +-
server/api/intVtigerField/intVtigerField.model.js | 2 +-
server/api/intVtigerField/intVtigerField.rpc.js | 2 +-
server/api/intZendeskAccount/index.js | 2 +-
.../intZendeskAccount.attributes.js | 2 +-
.../intZendeskAccount.controller.js | 2 +-
.../intZendeskAccount/intZendeskAccount.model.js | 2 +-
.../api/intZendeskAccount/intZendeskAccount.rpc.js | 2 +-
server/api/intZendeskConfiguration/index.js | 2 +-
.../intZendeskConfiguration.attributes.js | 2 +-
.../intZendeskConfiguration.controller.js | 2 +-
.../intZendeskConfiguration.model.js | 2 +-
.../intZendeskConfiguration.rpc.js | 2 +-
server/api/intZendeskField/index.js | 2 +-
.../intZendeskField/intZendeskField.attributes.js | 2 +-
.../intZendeskField/intZendeskField.controller.js | 2 +-
.../api/intZendeskField/intZendeskField.model.js | 2 +-
server/api/intZendeskField/intZendeskField.rpc.js | 2 +-
server/api/intZohoAccount/index.js | 2 +-
.../intZohoAccount/intZohoAccount.attributes.js | 2 +-
.../intZohoAccount/intZohoAccount.controller.js | 2 +-
server/api/intZohoAccount/intZohoAccount.model.js | 2 +-
server/api/intZohoAccount/intZohoAccount.rpc.js | 2 +-
server/api/intZohoConfiguration/index.js | 2 +-
.../intZohoConfiguration.attributes.js | 2 +-
.../intZohoConfiguration.controller.js | 2 +-
.../intZohoConfiguration.model.js | 2 +-
.../intZohoConfiguration.rpc.js | 2 +-
server/api/intZohoField/index.js | 2 +-
server/api/intZohoField/intZohoField.attributes.js | 2 +-
server/api/intZohoField/intZohoField.controller.js | 2 +-
server/api/intZohoField/intZohoField.model.js | 2 +-
server/api/intZohoField/intZohoField.rpc.js | 2 +-
server/api/integration/index.js | 2 +-
server/api/integration/integration.attributes.js | 2 +-
server/api/integration/integration.controller.js | 2 +-
server/api/integration/integration.model.js | 2 +-
server/api/integration/integration.rpc.js | 2 +-
server/api/integrationReport/index.js | 2 +-
.../integrationReport.attributes.js | 2 +-
.../integrationReport.controller.js | 2 +-
.../integrationReport/integrationReport.model.js | 2 +-
.../api/integrationReport/integrationReport.rpc.js | 2 +-
server/api/interval/index.js | 2 +-
server/api/interval/interval.attributes.js | 2 +-
server/api/interval/interval.controller.js | 2 +-
server/api/interval/interval.model.js | 2 +-
server/api/interval/interval.rpc.js | 2 +-
server/api/jira/index.js | 2 +-
server/api/jira/jira.controller.js | 2 +-
server/api/jscriptyAnswerReport/index.js | 2 +-
.../jscriptyAnswerReport.attributes.js | 2 +-
.../jscriptyAnswerReport.controller.js | 2 +-
.../jscriptyAnswerReport.model.js | 2 +-
.../jscriptyAnswerReport.rpc.js | 2 +-
server/api/jscriptyProject/index.js | 2 +-
.../jscriptyProject/jscriptyProject.attributes.js | 2 +-
.../jscriptyProject/jscriptyProject.controller.js | 2 +-
.../api/jscriptyProject/jscriptyProject.model.js | 2 +-
server/api/jscriptyProject/jscriptyProject.rpc.js | 2 +-
server/api/jscriptyQuestionReport/index.js | 2 +-
.../jscriptyQuestionReport.attributes.js | 2 +-
.../jscriptyQuestionReport.controller.js | 2 +-
.../jscriptyQuestionReport.model.js | 2 +-
.../jscriptyQuestionReport.rpc.js | 2 +-
server/api/jscriptySessionReport/index.js | 2 +-
.../jscriptySessionReport.attributes.js | 2 +-
.../jscriptySessionReport.controller.js | 2 +-
.../jscriptySessionReport.model.js | 2 +-
.../jscriptySessionReport.rpc.js | 2 +-
server/api/license/index.js | 2 +-
server/api/license/license.attributes.js | 2 +-
server/api/license/license.controller.js | 2 +-
server/api/license/license.model.js | 2 +-
server/api/license/license.rpc.js | 2 +-
server/api/mailAccount/index.js | 2 +-
server/api/mailAccount/mailAccount.attributes.js | 2 +-
server/api/mailAccount/mailAccount.controller.js | 2 +-
server/api/mailAccount/mailAccount.events.js | 2 +-
server/api/mailAccount/mailAccount.model.js | 2 +-
server/api/mailAccount/mailAccount.rpc.js | 2 +-
server/api/mailAccount/mailAccount.socket.js | 2 +-
server/api/mailApplication/index.js | 2 +-
.../mailApplication/mailApplication.attributes.js | 2 +-
.../mailApplication/mailApplication.controller.js | 2 +-
.../api/mailApplication/mailApplication.model.js | 2 +-
server/api/mailApplication/mailApplication.rpc.js | 2 +-
server/api/mailInteraction/index.js | 2 +-
.../mailInteraction/mailInteraction.attributes.js | 2 +-
.../mailInteraction/mailInteraction.controller.js | 2 +-
.../api/mailInteraction/mailInteraction.events.js | 2 +-
.../api/mailInteraction/mailInteraction.model.js | 2 +-
server/api/mailInteraction/mailInteraction.rpc.js | 2 +-
.../api/mailInteraction/mailInteraction.socket.js | 2 +-
server/api/mailMessage/index.js | 2 +-
server/api/mailMessage/mailMessage.attributes.js | 2 +-
server/api/mailMessage/mailMessage.controller.js | 2 +-
server/api/mailMessage/mailMessage.events.js | 2 +-
server/api/mailMessage/mailMessage.model.js | 2 +-
server/api/mailMessage/mailMessage.rpc.js | 2 +-
server/api/mailMessage/mailMessage.socket.js | 2 +-
server/api/mailQueue/index.js | 2 +-
server/api/mailQueue/mailQueue.attributes.js | 2 +-
server/api/mailQueue/mailQueue.controller.js | 2 +-
server/api/mailQueue/mailQueue.events.js | 2 +-
server/api/mailQueue/mailQueue.model.js | 2 +-
server/api/mailQueue/mailQueue.rpc.js | 2 +-
server/api/mailQueue/mailQueue.socket.js | 2 +-
server/api/mailQueueReport/index.js | 2 +-
.../mailQueueReport/mailQueueReport.attributes.js | 2 +-
.../mailQueueReport/mailQueueReport.controller.js | 2 +-
.../api/mailQueueReport/mailQueueReport.model.js | 2 +-
server/api/mailQueueReport/mailQueueReport.rpc.js | 2 +-
server/api/mailServerIn/index.js | 2 +-
server/api/mailServerIn/mailServerIn.attributes.js | 2 +-
server/api/mailServerIn/mailServerIn.model.js | 2 +-
server/api/mailServerIn/mailServerIn.rpc.js | 2 +-
server/api/mailServerOut/index.js | 2 +-
.../api/mailServerOut/mailServerOut.attributes.js | 2 +-
.../api/mailServerOut/mailServerOut.controller.js | 2 +-
server/api/mailServerOut/mailServerOut.model.js | 2 +-
server/api/mailServerOut/mailServerOut.rpc.js | 2 +-
server/api/mailSubstatus/index.js | 2 +-
.../api/mailSubstatus/mailSubstatus.attributes.js | 2 +-
.../api/mailSubstatus/mailSubstatus.controller.js | 2 +-
server/api/mailSubstatus/mailSubstatus.model.js | 2 +-
server/api/mailSubstatus/mailSubstatus.rpc.js | 2 +-
server/api/mailTransferReport/index.js | 2 +-
.../mailTransferReport.attributes.js | 2 +-
.../mailTransferReport.controller.js | 2 +-
.../mailTransferReport/mailTransferReport.model.js | 2 +-
.../mailTransferReport/mailTransferReport.rpc.js | 2 +-
server/api/memberReport/index.js | 2 +-
server/api/memberReport/memberReport.attributes.js | 2 +-
server/api/memberReport/memberReport.controller.js | 2 +-
server/api/memberReport/memberReport.model.js | 2 +-
server/api/memberReport/memberReport.rpc.js | 2 +-
server/api/migration/index.js | 2 +-
server/api/migration/migration.attributes.js | 2 +-
server/api/migration/migration.controller.js | 2 +-
server/api/migration/migration.model.js | 2 +-
server/api/migration/migration.rpc.js | 2 +-
server/api/network/index.js | 2 +-
server/api/network/network.attributes.js | 2 +-
server/api/network/network.controller.js | 2 +-
server/api/network/network.model.js | 2 +-
server/api/network/network.rpc.js | 2 +-
server/api/openchannelAccount/index.js | 2 +-
.../openchannelAccount.attributes.js | 2 +-
.../openchannelAccount.controller.js | 2 +-
.../openchannelAccount.events.js | 2 +-
.../openchannelAccount/openchannelAccount.model.js | 2 +-
.../openchannelAccount/openchannelAccount.rpc.js | 2 +-
.../openchannelAccount.socket.js | 2 +-
server/api/openchannelApplication/index.js | 2 +-
.../openchannelApplication.attributes.js | 2 +-
.../openchannelApplication.controller.js | 2 +-
.../openchannelApplication.model.js | 2 +-
.../openchannelApplication.rpc.js | 2 +-
server/api/openchannelInteraction/index.js | 2 +-
.../openchannelInteraction.attributes.js | 2 +-
.../openchannelInteraction.controller.js | 2 +-
.../openchannelInteraction.events.js | 2 +-
.../openchannelInteraction.model.js | 2 +-
.../openchannelInteraction.rpc.js | 2 +-
.../openchannelInteraction.socket.js | 2 +-
server/api/openchannelMessage/index.js | 2 +-
.../openchannelMessage.attributes.js | 2 +-
.../openchannelMessage.controller.js | 2 +-
.../openchannelMessage.events.js | 2 +-
.../openchannelMessage/openchannelMessage.model.js | 2 +-
.../openchannelMessage/openchannelMessage.rpc.js | 2 +-
.../openchannelMessage.socket.js | 2 +-
server/api/openchannelQueue/index.js | 2 +-
.../openchannelQueue.attributes.js | 2 +-
.../openchannelQueue.controller.js | 2 +-
.../openchannelQueue/openchannelQueue.events.js | 2 +-
.../api/openchannelQueue/openchannelQueue.model.js | 2 +-
.../api/openchannelQueue/openchannelQueue.rpc.js | 2 +-
.../openchannelQueue/openchannelQueue.socket.js | 2 +-
server/api/openchannelQueueReport/index.js | 2 +-
.../openchannelQueueReport.attributes.js | 2 +-
.../openchannelQueueReport.controller.js | 2 +-
.../openchannelQueueReport.model.js | 2 +-
.../openchannelQueueReport.rpc.js | 2 +-
server/api/openchannelTransferReport/index.js | 2 +-
.../openchannelTransferReport.attributes.js | 2 +-
.../openchannelTransferReport.controller.js | 2 +-
.../openchannelTransferReport.model.js | 2 +-
.../openchannelTransferReport.rpc.js | 2 +-
server/api/pause/index.js | 2 +-
server/api/pause/pause.attributes.js | 2 +-
server/api/pause/pause.controller.js | 2 +-
server/api/pause/pause.model.js | 2 +-
server/api/pause/pause.rpc.js | 2 +-
server/api/plugin/index.js | 2 +-
server/api/plugin/plugin.attributes.js | 2 +-
server/api/plugin/plugin.controller.js | 2 +-
server/api/plugin/plugin.events.js | 2 +-
server/api/plugin/plugin.model.js | 2 +-
server/api/plugin/plugin.rpc.js | 2 +-
server/api/plugin/plugin.socket.js | 2 +-
server/api/pm2/index.js | 2 +-
server/api/pm2/pm2.controller.js | 2 +-
server/api/realtime/index.js | 2 +-
server/api/realtime/realtime.controller.js | 2 +-
server/api/realtime/realtime.model.js | 2 +-
server/api/reportAgentPreview/index.js | 2 +-
.../reportAgentPreview.attributes.js | 2 +-
.../reportAgentPreview/reportAgentPreview.model.js | 2 +-
.../reportAgentPreview/reportAgentPreview.rpc.js | 2 +-
server/api/rpc/index.js | 2 +-
server/api/rpc/rpc.controller.js | 2 +-
server/api/schedule/index.js | 2 +-
server/api/schedule/schedule.attributes.js | 2 +-
server/api/schedule/schedule.controller.js | 2 +-
server/api/schedule/schedule.model.js | 2 +-
server/api/schedule/schedule.rpc.js | 2 +-
server/api/screenRecording/index.js | 2 +-
.../screenRecording/screenRecording.attributes.js | 2 +-
.../screenRecording/screenRecording.controller.js | 2 +-
.../api/screenRecording/screenRecording.model.js | 2 +-
server/api/screenRecording/screenRecording.rpc.js | 2 +-
server/api/setting/index.js | 2 +-
server/api/setting/setting.attributes.js | 2 +-
server/api/setting/setting.controller.js | 2 +-
server/api/setting/setting.model.js | 2 +-
server/api/setting/setting.rpc.js | 2 +-
server/api/smsAccount/index.js | 2 +-
server/api/smsAccount/smsAccount.attributes.js | 2 +-
server/api/smsAccount/smsAccount.controller.js | 2 +-
server/api/smsAccount/smsAccount.events.js | 2 +-
server/api/smsAccount/smsAccount.model.js | 2 +-
server/api/smsAccount/smsAccount.rpc.js | 2 +-
server/api/smsAccount/smsAccount.socket.js | 2 +-
server/api/smsApplication/index.js | 2 +-
.../smsApplication/smsApplication.attributes.js | 2 +-
.../smsApplication/smsApplication.controller.js | 2 +-
server/api/smsApplication/smsApplication.model.js | 2 +-
server/api/smsApplication/smsApplication.rpc.js | 2 +-
server/api/smsInteraction/index.js | 2 +-
.../smsInteraction/smsInteraction.attributes.js | 2 +-
.../smsInteraction/smsInteraction.controller.js | 2 +-
server/api/smsInteraction/smsInteraction.events.js | 2 +-
server/api/smsInteraction/smsInteraction.model.js | 2 +-
server/api/smsInteraction/smsInteraction.rpc.js | 2 +-
server/api/smsInteraction/smsInteraction.socket.js | 2 +-
server/api/smsMessage/index.js | 2 +-
server/api/smsMessage/smsMessage.attributes.js | 2 +-
server/api/smsMessage/smsMessage.controller.js | 2 +-
server/api/smsMessage/smsMessage.events.js | 2 +-
server/api/smsMessage/smsMessage.model.js | 2 +-
server/api/smsMessage/smsMessage.rpc.js | 2 +-
server/api/smsMessage/smsMessage.socket.js | 2 +-
server/api/smsQueue/index.js | 2 +-
server/api/smsQueue/smsQueue.attributes.js | 2 +-
server/api/smsQueue/smsQueue.controller.js | 2 +-
server/api/smsQueue/smsQueue.events.js | 2 +-
server/api/smsQueue/smsQueue.model.js | 2 +-
server/api/smsQueue/smsQueue.rpc.js | 2 +-
server/api/smsQueue/smsQueue.socket.js | 2 +-
server/api/smsQueueReport/index.js | 2 +-
.../smsQueueReport/smsQueueReport.attributes.js | 2 +-
.../smsQueueReport/smsQueueReport.controller.js | 2 +-
server/api/smsQueueReport/smsQueueReport.model.js | 2 +-
server/api/smsQueueReport/smsQueueReport.rpc.js | 2 +-
server/api/smsTransferReport/index.js | 2 +-
.../smsTransferReport.attributes.js | 2 +-
.../smsTransferReport.controller.js | 2 +-
.../smsTransferReport/smsTransferReport.model.js | 2 +-
.../api/smsTransferReport/smsTransferReport.rpc.js | 2 +-
server/api/sound/index.js | 2 +-
server/api/sound/sound.attributes.js | 2 +-
server/api/sound/sound.controller.js | 2 +-
server/api/sound/sound.model.js | 2 +-
server/api/sound/sound.rpc.js | 2 +-
server/api/squareMessage/index.js | 2 +-
.../api/squareMessage/squareMessage.attributes.js | 2 +-
.../api/squareMessage/squareMessage.controller.js | 2 +-
server/api/squareMessage/squareMessage.model.js | 2 +-
server/api/squareMessage/squareMessage.rpc.js | 2 +-
server/api/squareOdbc/index.js | 2 +-
server/api/squareOdbc/squareOdbc.attributes.js | 2 +-
server/api/squareOdbc/squareOdbc.controller.js | 2 +-
server/api/squareOdbc/squareOdbc.model.js | 2 +-
server/api/squareOdbc/squareOdbc.rpc.js | 2 +-
server/api/squareProject/index.js | 2 +-
.../api/squareProject/squareProject.attributes.js | 2 +-
.../api/squareProject/squareProject.controller.js | 2 +-
server/api/squareProject/squareProject.events.js | 2 +-
server/api/squareProject/squareProject.model.js | 2 +-
server/api/squareProject/squareProject.rpc.js | 2 +-
server/api/squareProject/squareProject.socket.js | 2 +-
server/api/squareRecording/index.js | 2 +-
.../squareRecording/squareRecording.attributes.js | 2 +-
.../squareRecording/squareRecording.controller.js | 2 +-
.../api/squareRecording/squareRecording.model.js | 2 +-
server/api/squareRecording/squareRecording.rpc.js | 2 +-
server/api/squareReport/index.js | 2 +-
server/api/squareReport/squareReport.attributes.js | 2 +-
server/api/squareReport/squareReport.controller.js | 2 +-
server/api/squareReport/squareReport.model.js | 2 +-
server/api/squareReport/squareReport.rpc.js | 2 +-
server/api/squareReportDetail/index.js | 2 +-
.../squareReportDetail.attributes.js | 2 +-
.../squareReportDetail.controller.js | 2 +-
.../squareReportDetail/squareReportDetail.model.js | 2 +-
.../squareReportDetail/squareReportDetail.rpc.js | 2 +-
server/api/system/index.js | 2 +-
server/api/system/system.controller.js | 2 +-
server/api/tag/index.js | 2 +-
server/api/tag/tag.attributes.js | 2 +-
server/api/tag/tag.controller.js | 2 +-
server/api/tag/tag.model.js | 2 +-
server/api/tag/tag.rpc.js | 2 +-
server/api/team/index.js | 2 +-
server/api/team/team.attributes.js | 2 +-
server/api/team/team.controller.js | 2 +-
server/api/team/team.events.js | 2 +-
server/api/team/team.model.js | 2 +-
server/api/team/team.rpc.js | 2 +-
server/api/team/team.socket.js | 2 +-
server/api/teamVoiceQueue/index.js | 2 +-
.../teamVoiceQueue/teamVoiceQueue.attributes.js | 2 +-
server/api/teamVoiceQueue/teamVoiceQueue.model.js | 2 +-
server/api/teamVoiceQueue/teamVoiceQueue.rpc.js | 2 +-
server/api/template/index.js | 2 +-
server/api/template/template.attributes.js | 2 +-
server/api/template/template.controller.js | 2 +-
server/api/template/template.model.js | 2 +-
server/api/template/template.rpc.js | 2 +-
server/api/trigger/index.js | 2 +-
server/api/trigger/trigger.attributes.js | 2 +-
server/api/trigger/trigger.controller.js | 2 +-
server/api/trigger/trigger.model.js | 2 +-
server/api/trigger/trigger.rpc.js | 2 +-
server/api/trunk/index.js | 2 +-
server/api/trunk/trunk.attributes.js | 2 +-
server/api/trunk/trunk.controller.js | 2 +-
server/api/trunk/trunk.model.js | 2 +-
server/api/trunk/trunk.rpc.js | 2 +-
server/api/user/index.js | 2 +-
server/api/user/user.attributes.js | 2 +-
server/api/user/user.controller.js | 2 +-
server/api/user/user.events.js | 2 +-
server/api/user/user.model.js | 2 +-
server/api/user/user.rpc.js | 2 +-
server/api/user/user.socket.js | 2 +-
server/api/userChatQueue/index.js | 2 +-
.../api/userChatQueue/userChatQueue.attributes.js | 2 +-
server/api/userChatQueue/userChatQueue.model.js | 2 +-
server/api/userChatQueue/userChatQueue.rpc.js | 2 +-
server/api/userFaxQueue/index.js | 2 +-
server/api/userFaxQueue/userFaxQueue.attributes.js | 2 +-
server/api/userFaxQueue/userFaxQueue.model.js | 2 +-
server/api/userFaxQueue/userFaxQueue.rpc.js | 2 +-
server/api/userMailQueue/index.js | 2 +-
.../api/userMailQueue/userMailQueue.attributes.js | 2 +-
server/api/userMailQueue/userMailQueue.model.js | 2 +-
server/api/userMailQueue/userMailQueue.rpc.js | 2 +-
server/api/userNotification/index.js | 2 +-
.../userNotification.attributes.js | 2 +-
.../userNotification.controller.js | 2 +-
.../userNotification/userNotification.events.js | 2 +-
.../api/userNotification/userNotification.model.js | 2 +-
.../api/userNotification/userNotification.rpc.js | 2 +-
.../userNotification/userNotification.socket.js | 2 +-
server/api/userOpenchannelQueue/index.js | 2 +-
.../userOpenchannelQueue.attributes.js | 2 +-
.../userOpenchannelQueue.model.js | 2 +-
.../userOpenchannelQueue.rpc.js | 2 +-
server/api/userProfile/index.js | 2 +-
server/api/userProfile/userProfile.attributes.js | 2 +-
server/api/userProfile/userProfile.controller.js | 2 +-
server/api/userProfile/userProfile.events.js | 2 +-
server/api/userProfile/userProfile.model.js | 2 +-
server/api/userProfile/userProfile.rpc.js | 2 +-
server/api/userProfile/userProfile.socket.js | 2 +-
server/api/userProfileResource/index.js | 2 +-
.../userProfileResource.attributes.js | 2 +-
.../userProfileResource.controller.js | 2 +-
.../userProfileResource.model.js | 2 +-
.../userProfileResource/userProfileResource.rpc.js | 2 +-
server/api/userProfileSection/index.js | 2 +-
.../userProfileSection.attributes.js | 2 +-
.../userProfileSection.controller.js | 2 +-
.../userProfileSection/userProfileSection.model.js | 2 +-
.../userProfileSection/userProfileSection.rpc.js | 2 +-
server/api/userSmsQueue/index.js | 2 +-
server/api/userSmsQueue/userSmsQueue.attributes.js | 2 +-
server/api/userSmsQueue/userSmsQueue.model.js | 2 +-
server/api/userSmsQueue/userSmsQueue.rpc.js | 2 +-
server/api/userVoiceQueue/index.js | 2 +-
.../userVoiceQueue/userVoiceQueue.attributes.js | 2 +-
server/api/userVoiceQueue/userVoiceQueue.model.js | 2 +-
server/api/userVoiceQueue/userVoiceQueue.rpc.js | 2 +-
server/api/userVoiceQueueRt/index.js | 2 +-
.../userVoiceQueueRt.attributes.js | 2 +-
.../userVoiceQueueRt/userVoiceQueueRt.events.js | 2 +-
.../api/userVoiceQueueRt/userVoiceQueueRt.model.js | 2 +-
.../api/userVoiceQueueRt/userVoiceQueueRt.rpc.js | 2 +-
.../userVoiceQueueRt/userVoiceQueueRt.socket.js | 2 +-
server/api/userWhatsappQueue/index.js | 2 +-
.../userWhatsappQueue.attributes.js | 2 +-
.../userWhatsappQueue/userWhatsappQueue.model.js | 2 +-
.../api/userWhatsappQueue/userWhatsappQueue.rpc.js | 2 +-
server/api/variable/index.js | 2 +-
server/api/variable/variable.attributes.js | 2 +-
server/api/variable/variable.controller.js | 2 +-
server/api/variable/variable.model.js | 2 +-
server/api/variable/variable.rpc.js | 2 +-
server/api/version/index.js | 2 +-
server/api/version/version.controller.js | 2 +-
server/api/voiceAgentReport/index.js | 2 +-
.../voiceAgentReport.attributes.js | 2 +-
.../voiceAgentReport.controller.js | 2 +-
.../api/voiceAgentReport/voiceAgentReport.model.js | 2 +-
.../api/voiceAgentReport/voiceAgentReport.rpc.js | 2 +-
server/api/voiceCallReport/index.js | 2 +-
.../voiceCallReport/voiceCallReport.attributes.js | 2 +-
.../voiceCallReport/voiceCallReport.controller.js | 2 +-
.../api/voiceCallReport/voiceCallReport.model.js | 2 +-
server/api/voiceCallReport/voiceCallReport.rpc.js | 2 +-
server/api/voiceChanSpy/index.js | 2 +-
server/api/voiceChanSpy/voiceChanSpy.attributes.js | 2 +-
server/api/voiceChanSpy/voiceChanSpy.controller.js | 2 +-
server/api/voiceChanSpy/voiceChanSpy.model.js | 2 +-
server/api/voiceChanSpy/voiceChanSpy.rpc.js | 2 +-
server/api/voiceContext/index.js | 2 +-
server/api/voiceContext/voiceContext.attributes.js | 2 +-
server/api/voiceContext/voiceContext.controller.js | 2 +-
server/api/voiceContext/voiceContext.model.js | 2 +-
server/api/voiceContext/voiceContext.rpc.js | 2 +-
server/api/voiceDialReport/index.js | 2 +-
.../voiceDialReport/voiceDialReport.attributes.js | 2 +-
.../voiceDialReport/voiceDialReport.controller.js | 2 +-
.../api/voiceDialReport/voiceDialReport.model.js | 2 +-
server/api/voiceDialReport/voiceDialReport.rpc.js | 2 +-
server/api/voiceExtension/index.js | 2 +-
.../voiceExtension/voiceExtension.attributes.js | 2 +-
.../voiceExtension/voiceExtension.controller.js | 2 +-
server/api/voiceExtension/voiceExtension.events.js | 2 +-
server/api/voiceExtension/voiceExtension.model.js | 2 +-
server/api/voiceExtension/voiceExtension.rpc.js | 2 +-
server/api/voiceExtension/voiceExtension.socket.js | 2 +-
server/api/voiceMail/index.js | 2 +-
server/api/voiceMail/voiceMail.attributes.js | 2 +-
server/api/voiceMail/voiceMail.controller.js | 2 +-
server/api/voiceMail/voiceMail.model.js | 2 +-
server/api/voiceMail/voiceMail.rpc.js | 2 +-
server/api/voiceMailMessage/index.js | 2 +-
.../voiceMailMessage.attributes.js | 2 +-
.../voiceMailMessage.controller.js | 2 +-
.../api/voiceMailMessage/voiceMailMessage.model.js | 2 +-
.../api/voiceMailMessage/voiceMailMessage.rpc.js | 2 +-
server/api/voiceMusicOnHold/index.js | 2 +-
.../voiceMusicOnHold.attributes.js | 2 +-
.../voiceMusicOnHold.controller.js | 2 +-
.../api/voiceMusicOnHold/voiceMusicOnHold.model.js | 2 +-
.../api/voiceMusicOnHold/voiceMusicOnHold.rpc.js | 2 +-
server/api/voicePrefix/index.js | 2 +-
server/api/voicePrefix/voicePrefix.attributes.js | 2 +-
server/api/voicePrefix/voicePrefix.controller.js | 2 +-
server/api/voicePrefix/voicePrefix.events.js | 2 +-
server/api/voicePrefix/voicePrefix.model.js | 2 +-
server/api/voicePrefix/voicePrefix.rpc.js | 2 +-
server/api/voicePrefix/voicePrefix.socket.js | 2 +-
server/api/voiceQueue/index.js | 2 +-
server/api/voiceQueue/voiceQueue.attributes.js | 2 +-
server/api/voiceQueue/voiceQueue.controller.js | 2 +-
server/api/voiceQueue/voiceQueue.events.js | 2 +-
server/api/voiceQueue/voiceQueue.model.js | 2 +-
server/api/voiceQueue/voiceQueue.rpc.js | 2 +-
server/api/voiceQueue/voiceQueue.socket.js | 2 +-
server/api/voiceQueueReport/index.js | 2 +-
.../voiceQueueReport.attributes.js | 2 +-
.../voiceQueueReport.controller.js | 2 +-
.../voiceQueueReport/voiceQueueReport.events.js | 2 +-
.../api/voiceQueueReport/voiceQueueReport.model.js | 2 +-
.../api/voiceQueueReport/voiceQueueReport.rpc.js | 2 +-
.../voiceQueueReport/voiceQueueReport.socket.js | 2 +-
server/api/voiceQueuesLog/index.js | 2 +-
.../voiceQueuesLog/voiceQueuesLog.attributes.js | 2 +-
.../voiceQueuesLog/voiceQueuesLog.controller.js | 2 +-
server/api/voiceQueuesLog/voiceQueuesLog.model.js | 2 +-
server/api/voiceQueuesLog/voiceQueuesLog.rpc.js | 2 +-
server/api/voiceRecording/index.js | 2 +-
.../voiceRecording/voiceRecording.attributes.js | 2 +-
.../voiceRecording/voiceRecording.controller.js | 2 +-
server/api/voiceRecording/voiceRecording.model.js | 2 +-
server/api/voiceRecording/voiceRecording.rpc.js | 2 +-
server/api/voiceTransferReport/index.js | 2 +-
.../voiceTransferReport.attributes.js | 2 +-
.../voiceTransferReport.controller.js | 2 +-
.../voiceTransferReport.model.js | 2 +-
.../voiceTransferReport/voiceTransferReport.rpc.js | 2 +-
server/api/webbar/index.js | 2 +-
server/api/webbar/webbar.controller.js | 2 +-
server/api/whatsappAccount/index.js | 2 +-
.../whatsappAccount/whatsappAccount.attributes.js | 2 +-
.../whatsappAccount/whatsappAccount.controller.js | 2 +-
.../api/whatsappAccount/whatsappAccount.events.js | 2 +-
.../api/whatsappAccount/whatsappAccount.model.js | 2 +-
server/api/whatsappAccount/whatsappAccount.rpc.js | 2 +-
.../api/whatsappAccount/whatsappAccount.socket.js | 2 +-
server/api/whatsappApplication/index.js | 2 +-
.../whatsappApplication.attributes.js | 2 +-
.../whatsappApplication.controller.js | 2 +-
.../whatsappApplication.model.js | 2 +-
.../whatsappApplication/whatsappApplication.rpc.js | 2 +-
server/api/whatsappInteraction/index.js | 2 +-
.../whatsappInteraction.attributes.js | 2 +-
.../whatsappInteraction.controller.js | 2 +-
.../whatsappInteraction.events.js | 2 +-
.../whatsappInteraction.model.js | 2 +-
.../whatsappInteraction/whatsappInteraction.rpc.js | 2 +-
.../whatsappInteraction.socket.js | 2 +-
server/api/whatsappMessage/index.js | 2 +-
.../whatsappMessage/whatsappMessage.attributes.js | 2 +-
.../whatsappMessage/whatsappMessage.controller.js | 2 +-
.../api/whatsappMessage/whatsappMessage.events.js | 2 +-
.../api/whatsappMessage/whatsappMessage.model.js | 2 +-
server/api/whatsappMessage/whatsappMessage.rpc.js | 2 +-
.../api/whatsappMessage/whatsappMessage.socket.js | 2 +-
server/api/whatsappQueue/index.js | 2 +-
.../api/whatsappQueue/whatsappQueue.attributes.js | 2 +-
.../api/whatsappQueue/whatsappQueue.controller.js | 2 +-
server/api/whatsappQueue/whatsappQueue.events.js | 2 +-
server/api/whatsappQueue/whatsappQueue.model.js | 2 +-
server/api/whatsappQueue/whatsappQueue.rpc.js | 2 +-
server/api/whatsappQueue/whatsappQueue.socket.js | 2 +-
server/api/whatsappQueueReport/index.js | 2 +-
.../whatsappQueueReport.attributes.js | 2 +-
.../whatsappQueueReport.controller.js | 2 +-
.../whatsappQueueReport.model.js | 2 +-
.../whatsappQueueReport/whatsappQueueReport.rpc.js | 2 +-
server/api/whatsappTransferReport/index.js | 2 +-
.../whatsappTransferReport.attributes.js | 2 +-
.../whatsappTransferReport.controller.js | 2 +-
.../whatsappTransferReport.model.js | 2 +-
.../whatsappTransferReport.rpc.js | 2 +-
server/app.js | 2 +-
server/components/auth/service.js | 2 +-
server/components/encryptor/index.js | 2 +-
server/components/export/csv.js | 2 +-
server/components/export/pdf.js | 2 +-
server/components/export/xlsx.js | 2 +-
server/components/extensions/rewrite.js | 2 +-
server/components/import/cm/csv.js | 2 +-
server/components/import/cm/csv2.js | 2 +-
server/components/integrations/configuration.js | 2 +-
server/components/interaction/service.js | 2 +-
server/components/license/service.js | 2 +-
server/components/parsers/advancedSearch.js | 2 +-
server/components/parsers/qs.js | 2 +-
server/config/express.js | 2 +-
server/config/license/hardware.js | 2 +-
server/config/license/index.js | 2 +-
server/config/license/util.js | 2 +-
server/config/local.env.js | 2 +-
server/config/logger.js | 2 +-
server/config/pm2/config.js | 2 +-
server/config/pm2/index.js | 2 +-
server/config/schedule/chat.js | 2 +-
server/config/schedule/index.js | 2 +-
server/config/schedule/transcribe.js | 2 +-
server/config/schedule/whatsapp.js | 2 +-
server/config/seedContact.js | 2 +-
server/config/seedUsers.js | 2 +-
server/config/socketio.js | 2 +-
server/config/triggers/index.js | 2 +-
server/config/utils.js | 2 +-
server/errors/index.js | 2 +-
server/mysqldb/index.js | 2 +-
server/routes.js | 2 +-
server/rpc/index.js | 2 +-
server/services/agi/channel.js | 2 +-
server/services/agi/error.js | 2 +-
server/services/agi/graph/index.js | 2 +-
server/services/agi/index.js | 2 +-
server/services/agi/mailRpc/index.js | 2 +-
server/services/agi/reply.js | 2 +-
server/services/agi/rpc/index.js | 2 +-
server/services/agi/scripts/aws/index.js | 2 +-
server/services/agi/scripts/aws/lex/index.js | 2 +-
server/services/agi/scripts/aws/lex/lib/api.js | 2 +-
server/services/agi/scripts/aws/polly/index.js | 2 +-
server/services/agi/scripts/aws/polly/lib/api.js | 2 +-
server/services/agi/scripts/google/asr/index.js | 2 +-
server/services/agi/scripts/google/asr/lib/api.js | 2 +-
server/services/agi/scripts/google/index.js | 2 +-
server/services/agi/scripts/index.js | 2 +-
server/services/agi/scripts/sestek/index.js | 2 +-
server/services/agi/scripts/sestek/nda/index.js | 2 +-
server/services/agi/scripts/tilde/asr/index.js | 2 +-
server/services/agi/scripts/tilde/asr/lib/api.js | 2 +-
server/services/agi/scripts/tilde/index.js | 2 +-
server/services/agi/server.js | 2 +-
server/services/agi/vertices.js | 2 +-
server/services/ami/acw/index.js | 2 +-
server/services/ami/ami.js | 2 +-
server/services/ami/client.js | 2 +-
server/services/ami/dialer/action.js | 2 +-
server/services/ami/dialer/agentComplete.js | 2 +-
server/services/ami/dialer/final.js | 2 +-
server/services/ami/dialer/hangup.js | 2 +-
server/services/ami/dialer/history.js | 2 +-
server/services/ami/dialer/index.js | 2 +-
server/services/ami/dialer/queueCallerAbandon.js | 2 +-
server/services/ami/fax/action.js | 2 +-
server/services/ami/fax/index.js | 2 +-
server/services/ami/fax/rpcDb.js | 2 +-
server/services/ami/fax/util/gs.js | 2 +-
server/services/ami/fax/util/util.js | 2 +-
server/services/ami/index.js | 2 +-
server/services/ami/model/agent.js | 2 +-
server/services/ami/model/campaign.js | 2 +-
server/services/ami/model/channel.js | 2 +-
server/services/ami/model/deskAccount.js | 2 +-
server/services/ami/model/dynamics365Account.js | 2 +-
server/services/ami/model/faxAccount.js | 2 +-
server/services/ami/model/freshdeskAccount.js | 2 +-
server/services/ami/model/freshsalesAccount.js | 2 +-
server/services/ami/model/queueReport.js | 2 +-
server/services/ami/model/salesforceAccount.js | 2 +-
server/services/ami/model/servicenowAccount.js | 2 +-
server/services/ami/model/sugarcrmAccount.js | 2 +-
server/services/ami/model/telephone.js | 2 +-
server/services/ami/model/template.js | 2 +-
server/services/ami/model/trigger.js | 2 +-
server/services/ami/model/trunk.js | 2 +-
server/services/ami/model/voiceExtension.js | 2 +-
server/services/ami/model/voiceQueue.js | 2 +-
server/services/ami/model/vtigerAccount.js | 2 +-
server/services/ami/model/zendeskAccount.js | 2 +-
server/services/ami/model/zohoAccount.js | 2 +-
server/services/ami/preview/action.js | 2 +-
server/services/ami/preview/index.js | 2 +-
server/services/ami/preview/rpcDb.js | 2 +-
server/services/ami/preview/util/util.js | 2 +-
server/services/ami/properties.js | 2 +-
server/services/ami/realtime/index.js | 2 +-
server/services/ami/report/index.js | 2 +-
server/services/ami/report/userReport.js | 2 +-
server/services/ami/report/voiceAgentReport.js | 2 +-
server/services/ami/report/voiceCallReport.js | 2 +-
server/services/ami/report/voiceDialReport.js | 2 +-
server/services/ami/report/voiceQueueReport.js | 2 +-
server/services/ami/rpc/agentReportPreview.js | 2 +-
server/services/ami/rpc/attachment.js | 2 +-
server/services/ami/rpc/campaign.js | 2 +-
server/services/ami/rpc/cmContact.js | 2 +-
server/services/ami/rpc/cmHopper.js | 2 +-
server/services/ami/rpc/cmHopperBlack.js | 2 +-
server/services/ami/rpc/cmHopperFinal.js | 2 +-
server/services/ami/rpc/cmHopperHistory.js | 2 +-
server/services/ami/rpc/faxAccount.js | 2 +-
server/services/ami/rpc/faxMessage.js | 2 +-
server/services/ami/rpc/integrations/desk.js | 2 +-
.../services/ami/rpc/integrations/dynamics365.js | 2 +-
server/services/ami/rpc/integrations/freshdesk.js | 2 +-
server/services/ami/rpc/integrations/freshsales.js | 2 +-
server/services/ami/rpc/integrations/salesforce.js | 2 +-
server/services/ami/rpc/integrations/servicenow.js | 2 +-
server/services/ami/rpc/integrations/sugarcrm.js | 2 +-
server/services/ami/rpc/integrations/vtiger.js | 2 +-
server/services/ami/rpc/integrations/zendesk.js | 2 +-
server/services/ami/rpc/integrations/zoho.js | 2 +-
server/services/ami/rpc/memberReport.js | 2 +-
server/services/ami/rpc/setting.js | 2 +-
server/services/ami/rpc/template.js | 2 +-
server/services/ami/rpc/trigger.js | 2 +-
server/services/ami/rpc/trunk.js | 2 +-
server/services/ami/rpc/user.js | 2 +-
server/services/ami/rpc/voiceAgentReport.js | 2 +-
server/services/ami/rpc/voiceCallReport.js | 2 +-
server/services/ami/rpc/voiceDialReport.js | 2 +-
server/services/ami/rpc/voiceExtension.js | 2 +-
server/services/ami/rpc/voiceQueue.js | 2 +-
server/services/ami/rpc/voiceQueueReport.js | 2 +-
server/services/ami/rpc/voiceQueueRt.js | 2 +-
server/services/ami/rpc/voiceRecording.js | 2 +-
server/services/ami/rpc/voiceTransferReport.js | 2 +-
server/services/ami/server/index.js | 2 +-
server/services/ami/trigger/cmContact/index.js | 2 +-
server/services/ami/trigger/index.js | 2 +-
server/services/ami/trigger/integration/desk.js | 2 +-
.../ami/trigger/integration/dynamics365.js | 2 +-
.../services/ami/trigger/integration/freshdesk.js | 2 +-
.../services/ami/trigger/integration/freshsales.js | 2 +-
server/services/ami/trigger/integration/index.js | 2 +-
.../services/ami/trigger/integration/salesforce.js | 2 +-
.../services/ami/trigger/integration/servicenow.js | 2 +-
.../services/ami/trigger/integration/sugarcrm.js | 2 +-
server/services/ami/trigger/integration/util.js | 2 +-
server/services/ami/trigger/integration/vtiger.js | 2 +-
server/services/ami/trigger/integration/zendesk.js | 2 +-
server/services/ami/trigger/integration/zoho.js | 2 +-
server/services/ami/trigger/script/index.js | 2 +-
server/services/ami/trigger/urlforward/index.js | 2 +-
server/services/email/client.js | 2 +-
server/services/email/index.js | 2 +-
server/services/email/lib/email.js | 2 +-
server/services/email/lib/imap.js | 2 +-
server/services/email/lib/smtp.js | 2 +-
server/services/email/lib/utils.js | 2 +-
server/services/email/model/mailAccount.js | 2 +-
server/services/email/realtime/index.js | 2 +-
server/services/email/rpc/mailAccount.js | 2 +-
server/services/email/rpc/setting.js | 2 +-
server/services/email/server/index.js | 2 +-
server/services/express/index.js | 2 +-
server/services/routing/client.js | 2 +-
server/services/routing/index.js | 2 +-
server/services/routing/lib/rule-engine.js | 2 +-
server/services/routing/mailRpc/index.js | 2 +-
server/services/routing/model/agent.js | 2 +-
server/services/routing/model/chatQueue.js | 2 +-
server/services/routing/model/faxQueue.js | 2 +-
server/services/routing/model/interval.js | 2 +-
server/services/routing/model/mailQueue.js | 2 +-
server/services/routing/model/openchannelQueue.js | 2 +-
server/services/routing/model/smsQueue.js | 2 +-
server/services/routing/model/whatsappQueue.js | 2 +-
server/services/routing/realtime/index.js | 2 +-
server/services/routing/rpc/chatInteraction.js | 2 +-
server/services/routing/rpc/chatMessage.js | 2 +-
server/services/routing/rpc/chatQueue.js | 2 +-
server/services/routing/rpc/chatQueueReport.js | 2 +-
server/services/routing/rpc/faxInteraction.js | 2 +-
server/services/routing/rpc/faxMessage.js | 2 +-
server/services/routing/rpc/faxQueue.js | 2 +-
server/services/routing/rpc/faxQueueReport.js | 2 +-
server/services/routing/rpc/interval.js | 2 +-
server/services/routing/rpc/mailInteraction.js | 2 +-
server/services/routing/rpc/mailMessage.js | 2 +-
server/services/routing/rpc/mailQueue.js | 2 +-
server/services/routing/rpc/mailQueueReport.js | 2 +-
.../services/routing/rpc/openchannelInteraction.js | 2 +-
server/services/routing/rpc/openchannelMessage.js | 2 +-
server/services/routing/rpc/openchannelQueue.js | 2 +-
.../services/routing/rpc/openchannelQueueReport.js | 2 +-
server/services/routing/rpc/smsInteraction.js | 2 +-
server/services/routing/rpc/smsMessage.js | 2 +-
server/services/routing/rpc/smsQueue.js | 2 +-
server/services/routing/rpc/smsQueueReport.js | 2 +-
server/services/routing/rpc/user.js | 2 +-
server/services/routing/rpc/whatsappInteraction.js | 2 +-
server/services/routing/rpc/whatsappMessage.js | 2 +-
server/services/routing/rpc/whatsappQueue.js | 2 +-
server/services/routing/rpc/whatsappQueueReport.js | 2 +-
.../services/routing/server/applications/agent.js | 2 +-
.../routing/server/applications/amazonlex.js | 2 +-
.../routing/server/applications/autoreply.js | 2 +-
.../services/routing/server/applications/close.js | 2 +-
.../routing/server/applications/dialogflow.js | 2 +-
.../routing/server/applications/dialogflowV2.js | 2 +-
.../services/routing/server/applications/gotoif.js | 2 +-
.../services/routing/server/applications/gotop.js | 2 +-
.../routing/server/applications/message.js | 2 +-
.../services/routing/server/applications/noop.js | 2 +-
.../services/routing/server/applications/queue.js | 2 +-
.../routing/server/applications/strategy/agent.js | 2 +-
.../server/applications/strategy/beepall.js | 2 +-
.../routing/server/applications/strategy/index.js | 2 +-
.../server/applications/strategy/rrmemory.js | 2 +-
.../routing/server/applications/strategy/util.js | 2 +-
.../services/routing/server/applications/system.js | 2 +-
server/services/routing/server/applications/tag.js | 2 +-
.../services/routing/server/applications/utils.js | 2 +-
server/services/routing/server/index.js | 2 +-
server/services/routing/server/interval.js | 2 +-
server/services/xdr/agents.controller.js | 2 +-
server/services/xdr/calls.controller.js | 2 +-
server/services/xdr/core.controller.js | 2 +-
server/services/xdr/dials.controller.js | 2 +-
server/services/xdr/index.js | 2 +-
server/services/xdr/members.controller.js | 2 +-
server/services/xdr/queues.controller.js | 2 +-
server/services/xdr/recordings.controller.js | 2 +-
server/services/xdr/transfers.controller.js | 2 +-
server/services/xdr/utils.js | 2 +-
1148 files changed, 1148 insertions(+), 1148 deletions(-)
diff --git a/apidoc/api_project.js b/apidoc/api_project.js
index f352e6b..bbf6a10 100644
--- a/apidoc/api_project.js
+++ b/apidoc/api_project.js
@@ -17,7 +17,7 @@ define({
"apidoc": "0.3.0",
"generator": {
"name": "apidoc",
- "time": "2021-08-25T07:04:19.289Z",
+ "time": "2021-08-25T07:23:07.049Z",
"url": "http://apidocjs.com",
"version": "0.24.0"
}
diff --git a/apidoc/api_project.json b/apidoc/api_project.json
index a561fd8..924e7b3 100644
--- a/apidoc/api_project.json
+++ b/apidoc/api_project.json
@@ -17,7 +17,7 @@
"apidoc": "0.3.0",
"generator": {
"name": "apidoc",
- "time": "2021-08-25T07:04:19.289Z",
+ "time": "2021-08-25T07:23:07.049Z",
"url": "http://apidocjs.com",
"version": "0.24.0"
}
diff --git a/server/api/action/action.attributes.js b/server/api/action/action.attributes.js
index 3b1aa20..a4e816d 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 _0x9140=['TEXT','sequelize','exports','getDataValue','action','STRING','integration','motionbar','urlForward','browser','bot','script','Allowed\x20values:\x20contactManager,\x20integration,\x20motionbar,\x20jscripty,\x20urlForward,\x20browser,\x20bot,\x20script','integration[AccountId],\x20motionbar[TemplateId,URL,WinAppPath],\x20urlForward[URL]'];(function(_0x1f99dc,_0x1b95ef){var _0x1ddea2=function(_0x2783c7){while(--_0x2783c7){_0x1f99dc['push'](_0x1f99dc['shift']());}};_0x1ddea2(++_0x1b95ef);}(_0x9140,0xc5));var _0x0914=function(_0x31c16b,_0x78b23){_0x31c16b=_0x31c16b-0x0;var _0x53e603=_0x9140[_0x31c16b];return _0x53e603;};'use strict';var Sequelize=require(_0x0914('0x0'));module[_0x0914('0x1')]={'name':{'type':Sequelize['VIRTUAL'],'get':function(_0x5196f2){return this[_0x0914('0x2')](_0x0914('0x3'));}},'action':{'type':Sequelize[_0x0914('0x4')],'allowNull':![],'validate':{'isIn':{'args':[['contactManager',_0x0914('0x5'),_0x0914('0x6'),'jscripty',_0x0914('0x7'),_0x0914('0x8'),_0x0914('0x9'),_0x0914('0xa')]],'msg':_0x0914('0xb')}},'comment':_0x0914('0xb')},'data1':{'type':Sequelize[_0x0914('0x4')](0x1000),'comment':'contactManager[ListId],\x20integration[intName(zendesk)],\x20motionbar[Popup(0),URL(1),WinApp(2)],\x20urlForward[GET,POST],\x20browser[TemplateId(0),URL(1)]'},'data2':{'type':Sequelize[_0x0914('0x4')](0x1000),'comment':_0x0914('0xc')},'data3':{'type':Sequelize[_0x0914('0x4')](0x1000),'comment':'motionbar[NULL,NULL,WinAppArguments]'},'data4':{'type':Sequelize['STRING'](0x1000)},'data5':{'type':Sequelize['STRING'](0x1000)},'data6':{'type':Sequelize[_0x0914('0x4')]},'data7':{'type':Sequelize[_0x0914('0xd')]}};
\ No newline at end of file
+var _0x4594=['action','STRING','contactManager','integration','motionbar','jscripty','urlForward','browser','contactManager[ListId],\x20integration[intName(zendesk)],\x20motionbar[Popup(0),URL(1),WinApp(2)],\x20urlForward[GET,POST],\x20browser[TemplateId(0),URL(1)]','sequelize','exports','VIRTUAL'];(function(_0x35688d,_0x1708dd){var _0x3c99a7=function(_0x467577){while(--_0x467577){_0x35688d['push'](_0x35688d['shift']());}};_0x3c99a7(++_0x1708dd);}(_0x4594,0xc9));var _0x4459=function(_0x36e397,_0x4054c1){_0x36e397=_0x36e397-0x0;var _0x5741ce=_0x4594[_0x36e397];return _0x5741ce;};'use strict';var Sequelize=require(_0x4459('0x0'));module[_0x4459('0x1')]={'name':{'type':Sequelize[_0x4459('0x2')],'get':function(_0x4a4f3c){return this['getDataValue'](_0x4459('0x3'));}},'action':{'type':Sequelize[_0x4459('0x4')],'allowNull':![],'validate':{'isIn':{'args':[[_0x4459('0x5'),_0x4459('0x6'),_0x4459('0x7'),_0x4459('0x8'),_0x4459('0x9'),_0x4459('0xa'),'bot','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[_0x4459('0x4')](0x1000),'comment':_0x4459('0xb')},'data2':{'type':Sequelize['STRING'](0x1000),'comment':'integration[AccountId],\x20motionbar[TemplateId,URL,WinAppPath],\x20urlForward[URL]'},'data3':{'type':Sequelize[_0x4459('0x4')](0x1000),'comment':'motionbar[NULL,NULL,WinAppArguments]'},'data4':{'type':Sequelize[_0x4459('0x4')](0x1000)},'data5':{'type':Sequelize['STRING'](0x1000)},'data6':{'type':Sequelize[_0x4459('0x4')]},'data7':{'type':Sequelize['TEXT']}};
\ No newline at end of file
diff --git a/server/api/action/action.controller.js b/server/api/action/action.controller.js
index bc3e734..6bb411a 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 _0x647d=['to-csv','fs-extra','lodash','squel','crypto','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','sendStatus','status','json','undefined','count','offset','set','Content-Range','apply','reject','save','update','then','end','stack','name','send','body','Action','find','params','catch','destroy','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','path'];(function(_0x14825b,_0x1274e7){var _0x698d7a=function(_0x46150b){while(--_0x46150b){_0x14825b['push'](_0x14825b['shift']());}};_0x698d7a(++_0x1274e7);}(_0x647d,0x13c));var _0xd647=function(_0x33d48e,_0xaa5330){_0x33d48e=_0x33d48e-0x0;var _0x308091=_0x647d[_0x33d48e];return _0x308091;};'use strict';var emlformat=require(_0xd647('0x0'));var rimraf=require(_0xd647('0x1'));var zipdir=require(_0xd647('0x2'));var jsonpatch=require(_0xd647('0x3'));var rp=require(_0xd647('0x4'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require('mustache');var util=require('util');var path=require(_0xd647('0x5'));var sox=require('sox');var csv=require(_0xd647('0x6'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xd647('0x7'));var _=require(_0xd647('0x8'));var squel=require(_0xd647('0x9'));var crypto=require(_0xd647('0xa'));var jsforce=require(_0xd647('0xb'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0xd647('0xc'));var Papa=require(_0xd647('0xd'));var Redis=require(_0xd647('0xe'));var authService=require(_0xd647('0xf'));var qs=require('../../components/parsers/qs');var as=require(_0xd647('0x10'));var hardwareService=require(_0xd647('0x11'));var logger=require(_0xd647('0x12'))(_0xd647('0x13'));var utils=require(_0xd647('0x14'));var config=require(_0xd647('0x15'));var licenseUtil=require(_0xd647('0x16'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x5c8c30,_0x2a8751){_0x2a8751=_0x2a8751||0xcc;return function(_0x5ec0b7){if(_0x5ec0b7){return _0x5c8c30[_0xd647('0x17')](_0x2a8751);}return _0x5c8c30['status'](_0x2a8751)['end']();};}function respondWithResult(_0x2ee6af,_0x2f6e77){_0x2f6e77=_0x2f6e77||0xc8;return function(_0x4d26ab){if(_0x4d26ab){return _0x2ee6af[_0xd647('0x18')](_0x2f6e77)[_0xd647('0x19')](_0x4d26ab);}};}function respondWithFilteredResult(_0x4a3727,_0x37999a){return function(_0x5227c2){if(_0x5227c2){var _0x5db489=typeof _0x37999a['offset']===_0xd647('0x1a')&&typeof _0x37999a['limit']==='undefined';var _0x5717eb=_0x5227c2[_0xd647('0x1b')];var _0x28615a=_0x5db489?0x0:_0x37999a[_0xd647('0x1c')];var _0x4b5a91=_0x5db489?_0x5227c2[_0xd647('0x1b')]:_0x37999a[_0xd647('0x1c')]+_0x37999a['limit'];var _0x2e066c;if(_0x4b5a91>=_0x5717eb){_0x4b5a91=_0x5717eb;_0x2e066c=0xc8;}else{_0x2e066c=0xce;}_0x4a3727[_0xd647('0x18')](_0x2e066c);return _0x4a3727[_0xd647('0x1d')](_0xd647('0x1e'),_0x28615a+'-'+_0x4b5a91+'/'+_0x5717eb)['json'](_0x5227c2);}return null;};}function patchUpdates(_0x504b43){return function(_0x1a5152){try{jsonpatch[_0xd647('0x1f')](_0x1a5152,_0x504b43,!![]);}catch(_0xf385b4){return BPromise[_0xd647('0x20')](_0xf385b4);}return _0x1a5152[_0xd647('0x21')]();};}function saveUpdates(_0x17be84,_0x12ae08){return function(_0x10b310){if(_0x10b310){return _0x10b310[_0xd647('0x22')](_0x17be84)[_0xd647('0x23')](function(_0x557f79){return _0x557f79;});}return null;};}function removeEntity(_0x5bffc2,_0x244d5f){return function(_0x1990d2){if(_0x1990d2){return _0x1990d2['destroy']()[_0xd647('0x23')](function(){_0x5bffc2[_0xd647('0x18')](0xcc)[_0xd647('0x24')]();});}};}function handleEntityNotFound(_0x23adc5,_0x2931ca){return function(_0x31cb3c){if(!_0x31cb3c){_0x23adc5[_0xd647('0x17')](0x194);}return _0x31cb3c;};}function handleError(_0x53d1f6,_0xe88a59){_0xe88a59=_0xe88a59||0x1f4;return function(_0x478a4f){logger['error'](_0x478a4f[_0xd647('0x25')]);if(_0x478a4f['name']){delete _0x478a4f[_0xd647('0x26')];}_0x53d1f6[_0xd647('0x18')](_0xe88a59)[_0xd647('0x27')](_0x478a4f);};}exports[_0xd647('0x22')]=function(_0x11a30a,_0x4e4372){if(_0x11a30a[_0xd647('0x28')]['id']){delete _0x11a30a[_0xd647('0x28')]['id'];}return db[_0xd647('0x29')][_0xd647('0x2a')]({'where':{'id':_0x11a30a[_0xd647('0x2b')]['id']}})[_0xd647('0x23')](handleEntityNotFound(_0x4e4372,null))[_0xd647('0x23')](saveUpdates(_0x11a30a['body'],null))[_0xd647('0x23')](respondWithResult(_0x4e4372,null))[_0xd647('0x2c')](handleError(_0x4e4372,null));};exports[_0xd647('0x2d')]=function(_0x263d74,_0x249fe7){return db['Action'][_0xd647('0x2a')]({'where':{'id':_0x263d74[_0xd647('0x2b')]['id']}})['then'](handleEntityNotFound(_0x249fe7,null))[_0xd647('0x23')](removeEntity(_0x249fe7,null))[_0xd647('0x2c')](handleError(_0x249fe7,null));};
\ No newline at end of file
+var _0xdf44=['save','update','then','error','stack','name','send','body','find','params','catch','destroy','Action','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','mustache','path','fs-extra','lodash','squel','crypto','jsforce','to-csv','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','undefined','limit','count','offset','set','Content-Range','apply'];(function(_0x3305de,_0x16582f){var _0x3b5a84=function(_0x57d7e1){while(--_0x57d7e1){_0x3305de['push'](_0x3305de['shift']());}};_0x3b5a84(++_0x16582f);}(_0xdf44,0x1d9));var _0x4df4=function(_0x3e5086,_0x48f4a2){_0x3e5086=_0x3e5086-0x0;var _0xfeb102=_0xdf44[_0x3e5086];return _0xfeb102;};'use strict';var emlformat=require(_0x4df4('0x0'));var rimraf=require(_0x4df4('0x1'));var zipdir=require(_0x4df4('0x2'));var jsonpatch=require(_0x4df4('0x3'));var rp=require(_0x4df4('0x4'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x4df4('0x5'));var util=require('util');var path=require(_0x4df4('0x6'));var sox=require('sox');var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x4df4('0x7'));var _=require(_0x4df4('0x8'));var squel=require(_0x4df4('0x9'));var crypto=require(_0x4df4('0xa'));var jsforce=require(_0x4df4('0xb'));var deskjs=require('desk.js');var toCsv=require(_0x4df4('0xc'));var querystring=require(_0x4df4('0xd'));var Papa=require('papaparse');var Redis=require(_0x4df4('0xe'));var authService=require(_0x4df4('0xf'));var qs=require(_0x4df4('0x10'));var as=require(_0x4df4('0x11'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x4df4('0x12'));var utils=require('../../config/utils');var config=require(_0x4df4('0x13'));var licenseUtil=require(_0x4df4('0x14'));var db=require(_0x4df4('0x15'))['db'];function respondWithStatusCode(_0x12c392,_0x1a2e48){_0x1a2e48=_0x1a2e48||0xcc;return function(_0x58ead3){if(_0x58ead3){return _0x12c392[_0x4df4('0x16')](_0x1a2e48);}return _0x12c392[_0x4df4('0x17')](_0x1a2e48)[_0x4df4('0x18')]();};}function respondWithResult(_0x1dbb19,_0x2c574c){_0x2c574c=_0x2c574c||0xc8;return function(_0x2d0dcc){if(_0x2d0dcc){return _0x1dbb19[_0x4df4('0x17')](_0x2c574c)[_0x4df4('0x19')](_0x2d0dcc);}};}function respondWithFilteredResult(_0xd6f538,_0x5413f7){return function(_0x3d6a32){if(_0x3d6a32){var _0x5621e8=typeof _0x5413f7['offset']===_0x4df4('0x1a')&&typeof _0x5413f7[_0x4df4('0x1b')]===_0x4df4('0x1a');var _0x386605=_0x3d6a32[_0x4df4('0x1c')];var _0x149ea3=_0x5621e8?0x0:_0x5413f7[_0x4df4('0x1d')];var _0x5568d2=_0x5621e8?_0x3d6a32[_0x4df4('0x1c')]:_0x5413f7[_0x4df4('0x1d')]+_0x5413f7['limit'];var _0x2404c6;if(_0x5568d2>=_0x386605){_0x5568d2=_0x386605;_0x2404c6=0xc8;}else{_0x2404c6=0xce;}_0xd6f538['status'](_0x2404c6);return _0xd6f538[_0x4df4('0x1e')](_0x4df4('0x1f'),_0x149ea3+'-'+_0x5568d2+'/'+_0x386605)[_0x4df4('0x19')](_0x3d6a32);}return null;};}function patchUpdates(_0x4c201c){return function(_0x1e39c8){try{jsonpatch[_0x4df4('0x20')](_0x1e39c8,_0x4c201c,!![]);}catch(_0x21202a){return BPromise['reject'](_0x21202a);}return _0x1e39c8[_0x4df4('0x21')]();};}function saveUpdates(_0x3f703f,_0x2e11bd){return function(_0x3f77b7){if(_0x3f77b7){return _0x3f77b7[_0x4df4('0x22')](_0x3f703f)[_0x4df4('0x23')](function(_0x5bbb68){return _0x5bbb68;});}return null;};}function removeEntity(_0x2161f8,_0x3c3794){return function(_0x4039e1){if(_0x4039e1){return _0x4039e1['destroy']()[_0x4df4('0x23')](function(){_0x2161f8['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x5f1a3d,_0x5e6052){return function(_0x4d0cbc){if(!_0x4d0cbc){_0x5f1a3d['sendStatus'](0x194);}return _0x4d0cbc;};}function handleError(_0x12f397,_0x392972){_0x392972=_0x392972||0x1f4;return function(_0xc5aec7){logger[_0x4df4('0x24')](_0xc5aec7[_0x4df4('0x25')]);if(_0xc5aec7[_0x4df4('0x26')]){delete _0xc5aec7[_0x4df4('0x26')];}_0x12f397[_0x4df4('0x17')](_0x392972)[_0x4df4('0x27')](_0xc5aec7);};}exports[_0x4df4('0x22')]=function(_0x28c220,_0x3d871e){if(_0x28c220[_0x4df4('0x28')]['id']){delete _0x28c220[_0x4df4('0x28')]['id'];}return db['Action'][_0x4df4('0x29')]({'where':{'id':_0x28c220[_0x4df4('0x2a')]['id']}})['then'](handleEntityNotFound(_0x3d871e,null))['then'](saveUpdates(_0x28c220[_0x4df4('0x28')],null))[_0x4df4('0x23')](respondWithResult(_0x3d871e,null))[_0x4df4('0x2b')](handleError(_0x3d871e,null));};exports[_0x4df4('0x2c')]=function(_0x4ce3fa,_0x4bc539){return db[_0x4df4('0x2d')]['find']({'where':{'id':_0x4ce3fa[_0x4df4('0x2a')]['id']}})[_0x4df4('0x23')](handleEntityNotFound(_0x4bc539,null))[_0x4df4('0x23')](removeEntity(_0x4bc539,null))[_0x4df4('0x2b')](handleError(_0x4bc539,null));};
\ No newline at end of file
diff --git a/server/api/action/action.model.js b/server/api/action/action.model.js
index 177158c..2420f09 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 _0x19a8=['moment','path','rimraf','../../config/environment','exports','define','Action','tools_actions','lodash','util'];(function(_0x488c11,_0x4e1752){var _0x218b84=function(_0x3d7462){while(--_0x3d7462){_0x488c11['push'](_0x488c11['shift']());}};_0x218b84(++_0x4e1752);}(_0x19a8,0x120));var _0x819a=function(_0x445066,_0x197ece){_0x445066=_0x445066-0x0;var _0x55c794=_0x19a8[_0x445066];return _0x55c794;};'use strict';var _=require(_0x819a('0x0'));var util=require(_0x819a('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0x819a('0x2'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x819a('0x3'));var rimraf=require(_0x819a('0x4'));var config=require(_0x819a('0x5'));var attributes=require('./action.attributes');module[_0x819a('0x6')]=function(_0x2aa6bd,_0x10bf31){return _0x2aa6bd[_0x819a('0x7')](_0x819a('0x8'),attributes,{'tableName':_0x819a('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xd2fa=['../../config/environment','./action.attributes','exports','define','Action','tools_actions','lodash','util','api','bluebird','path','rimraf'];(function(_0x1ee351,_0x54261b){var _0x245aaf=function(_0x3e4b65){while(--_0x3e4b65){_0x1ee351['push'](_0x1ee351['shift']());}};_0x245aaf(++_0x54261b);}(_0xd2fa,0x16e));var _0xad2f=function(_0x3b1c09,_0x118b1b){_0x3b1c09=_0x3b1c09-0x0;var _0x1dba35=_0xd2fa[_0x3b1c09];return _0x1dba35;};'use strict';var _=require(_0xad2f('0x0'));var util=require(_0xad2f('0x1'));var logger=require('../../config/logger')(_0xad2f('0x2'));var moment=require('moment');var BPromise=require(_0xad2f('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xad2f('0x4'));var rimraf=require(_0xad2f('0x5'));var config=require(_0xad2f('0x6'));var attributes=require(_0xad2f('0x7'));module[_0xad2f('0x8')]=function(_0x5355d2,_0x3e48f7){return _0x5355d2[_0xad2f('0x9')](_0xad2f('0xa'),attributes,{'tableName':_0xad2f('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
diff --git a/server/api/action/action.rpc.js b/server/api/action/action.rpc.js
index c0d7f69..5b1bcc4 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 _0x7217=['stringify','error','code','message','result','catch','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','rpc','../../config/environment','jayson/promise','client','http','request','then','info','Action,\x20%s,\x20%s','debug','Action,\x20%s,\x20%s,\x20%s','request\x20sent'];(function(_0x5416db,_0x55683a){var _0x243e35=function(_0x1eb623){while(--_0x1eb623){_0x5416db['push'](_0x5416db['shift']());}};_0x243e35(++_0x55683a);}(_0x7217,0x19e));var _0x7721=function(_0x6c993a,_0x5ea3ab){_0x6c993a=_0x6c993a-0x0;var _0x27f547=_0x7217[_0x6c993a];return _0x27f547;};'use strict';var _=require(_0x7721('0x0'));var util=require('util');var moment=require(_0x7721('0x1'));var BPromise=require(_0x7721('0x2'));var rs=require(_0x7721('0x3'));var fs=require('fs');var Redis=require(_0x7721('0x4'));var db=require(_0x7721('0x5'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x7721('0x6'));var config=require(_0x7721('0x7'));var jayson=require(_0x7721('0x8'));var client=jayson[_0x7721('0x9')][_0x7721('0xa')]({'port':0x232a});function respondWithRpcPromise(_0xf7ff37,_0x18ab6b,_0x21f680){return new BPromise(function(_0x225610,_0x2f99ed){return client[_0x7721('0xb')](_0xf7ff37,_0x21f680)[_0x7721('0xc')](function(_0xfa8835){logger[_0x7721('0xd')](_0x7721('0xe'),_0x18ab6b,'request\x20sent');logger[_0x7721('0xf')](_0x7721('0x10'),_0x18ab6b,_0x7721('0x11'),JSON[_0x7721('0x12')](_0xfa8835));if(_0xfa8835[_0x7721('0x13')]){if(_0xfa8835[_0x7721('0x13')][_0x7721('0x14')]===0x1f4){logger[_0x7721('0x13')]('Action,\x20%s,\x20%s',_0x18ab6b,_0xfa8835[_0x7721('0x13')][_0x7721('0x15')]);return _0x2f99ed(_0xfa8835['error'][_0x7721('0x15')]);}logger[_0x7721('0x13')](_0x7721('0xe'),_0x18ab6b,_0xfa8835[_0x7721('0x13')]['message']);return _0x225610(_0xfa8835[_0x7721('0x13')][_0x7721('0x15')]);}else{logger['info']('Action,\x20%s,\x20%s',_0x18ab6b,'request\x20sent');_0x225610(_0xfa8835[_0x7721('0x16')][_0x7721('0x15')]);}})[_0x7721('0x17')](function(_0x32550d){logger['error'](_0x7721('0xe'),_0x18ab6b,_0x32550d);_0x2f99ed(_0x32550d);});});}
\ No newline at end of file
+var _0x1261=['then','info','Action,\x20%s,\x20%s','request\x20sent','Action,\x20%s,\x20%s,\x20%s','error','code','message','catch','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','http','request'];(function(_0x3a41d4,_0x4dd092){var _0x2b906e=function(_0x450b7f){while(--_0x450b7f){_0x3a41d4['push'](_0x3a41d4['shift']());}};_0x2b906e(++_0x4dd092);}(_0x1261,0x144));var _0x1126=function(_0x503ea8,_0x22e391){_0x503ea8=_0x503ea8-0x0;var _0x427e5d=_0x1261[_0x503ea8];return _0x427e5d;};'use strict';var _=require('lodash');var util=require(_0x1126('0x0'));var moment=require(_0x1126('0x1'));var BPromise=require(_0x1126('0x2'));var rs=require(_0x1126('0x3'));var fs=require('fs');var Redis=require(_0x1126('0x4'));var db=require(_0x1126('0x5'))['db'];var utils=require(_0x1126('0x6'));var logger=require(_0x1126('0x7'))(_0x1126('0x8'));var config=require(_0x1126('0x9'));var jayson=require('jayson/promise');var client=jayson['client'][_0x1126('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x907180,_0x4f239c,_0x17e5f0){return new BPromise(function(_0x28772d,_0x245be9){return client[_0x1126('0xb')](_0x907180,_0x17e5f0)[_0x1126('0xc')](function(_0x59cfa1){logger[_0x1126('0xd')](_0x1126('0xe'),_0x4f239c,_0x1126('0xf'));logger['debug'](_0x1126('0x10'),_0x4f239c,'request\x20sent',JSON['stringify'](_0x59cfa1));if(_0x59cfa1[_0x1126('0x11')]){if(_0x59cfa1['error'][_0x1126('0x12')]===0x1f4){logger[_0x1126('0x11')](_0x1126('0xe'),_0x4f239c,_0x59cfa1[_0x1126('0x11')][_0x1126('0x13')]);return _0x245be9(_0x59cfa1[_0x1126('0x11')][_0x1126('0x13')]);}logger[_0x1126('0x11')](_0x1126('0xe'),_0x4f239c,_0x59cfa1['error']['message']);return _0x28772d(_0x59cfa1[_0x1126('0x11')][_0x1126('0x13')]);}else{logger[_0x1126('0xd')]('Action,\x20%s,\x20%s',_0x4f239c,_0x1126('0xf'));_0x28772d(_0x59cfa1['result'][_0x1126('0x13')]);}})[_0x1126('0x14')](function(_0x257b5f){logger['error'](_0x1126('0xe'),_0x4f239c,_0x257b5f);_0x245be9(_0x257b5f);});});}
\ No newline at end of file
diff --git a/server/api/action/index.js b/server/api/action/index.js
index bc5d71f..b4f55c2 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 _0x5475=['../../components/auth/service','../../components/interaction/service','../../config/environment','./action.controller','put','/:id','isAuthenticated','update','destroy','multer','path','express','Router','fs-extra'];(function(_0x4fde08,_0x463a36){var _0x12e725=function(_0x2670c5){while(--_0x2670c5){_0x4fde08['push'](_0x4fde08['shift']());}};_0x12e725(++_0x463a36);}(_0x5475,0x1d7));var _0x5547=function(_0x2e4aa2,_0x11956a){_0x2e4aa2=_0x2e4aa2-0x0;var _0x5e6092=_0x5475[_0x2e4aa2];return _0x5e6092;};'use strict';var multer=require(_0x5547('0x0'));var util=require('util');var path=require(_0x5547('0x1'));var timeout=require('connect-timeout');var express=require(_0x5547('0x2'));var router=express[_0x5547('0x3')]();var fs_extra=require(_0x5547('0x4'));var auth=require(_0x5547('0x5'));var interaction=require(_0x5547('0x6'));var config=require(_0x5547('0x7'));var controller=require(_0x5547('0x8'));router[_0x5547('0x9')](_0x5547('0xa'),auth[_0x5547('0xb')](),controller[_0x5547('0xc')]);router['delete']('/:id',auth[_0x5547('0xb')](),controller[_0x5547('0xd')]);module['exports']=router;
\ No newline at end of file
+var _0xa213=['connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./action.controller','put','/:id','update','delete','isAuthenticated','exports','path'];(function(_0x334651,_0x6e99f6){var _0x29657c=function(_0x420a94){while(--_0x420a94){_0x334651['push'](_0x334651['shift']());}};_0x29657c(++_0x6e99f6);}(_0xa213,0xa4));var _0x3a21=function(_0x95abe4,_0x49785b){_0x95abe4=_0x95abe4-0x0;var _0x2fa910=_0xa213[_0x95abe4];return _0x2fa910;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x3a21('0x0'));var timeout=require(_0x3a21('0x1'));var express=require(_0x3a21('0x2'));var router=express[_0x3a21('0x3')]();var fs_extra=require(_0x3a21('0x4'));var auth=require(_0x3a21('0x5'));var interaction=require(_0x3a21('0x6'));var config=require(_0x3a21('0x7'));var controller=require(_0x3a21('0x8'));router[_0x3a21('0x9')](_0x3a21('0xa'),auth['isAuthenticated'](),controller[_0x3a21('0xb')]);router[_0x3a21('0xc')](_0x3a21('0xa'),auth[_0x3a21('0xd')](),controller['destroy']);module[_0x3a21('0xe')]=router;
\ No newline at end of file
diff --git a/server/api/analyticCustomReport/analyticCustomReport.attributes.js b/server/api/analyticCustomReport/analyticCustomReport.attributes.js
index 7485e33..adb6626 100644
--- a/server/api/analyticCustomReport/analyticCustomReport.attributes.js
+++ b/server/api/analyticCustomReport/analyticCustomReport.attributes.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x2675=['sequelize','STRING','TEXT'];(function(_0x529f1c,_0x437ed1){var _0x4d57ab=function(_0x39d479){while(--_0x39d479){_0x529f1c['push'](_0x529f1c['shift']());}};_0x4d57ab(++_0x437ed1);}(_0x2675,0x75));var _0x5267=function(_0x87f551,_0x39bf50){_0x87f551=_0x87f551-0x0;var _0x36a950=_0x2675[_0x87f551];return _0x36a950;};'use strict';var Sequelize=require(_0x5267('0x0'));module['exports']={'name':{'type':Sequelize['STRING'],'allowNull':![]},'description':{'type':Sequelize['STRING']},'parent':{'type':Sequelize[_0x5267('0x1')]},'table':{'type':Sequelize[_0x5267('0x1')]},'conditions':{'type':Sequelize['TEXT']},'joins':{'type':Sequelize[_0x5267('0x2')]}};
\ No newline at end of file
+var _0x33c5=['STRING','TEXT','exports'];(function(_0x48add3,_0x12fcb4){var _0x472fc9=function(_0x442ce9){while(--_0x442ce9){_0x48add3['push'](_0x48add3['shift']());}};_0x472fc9(++_0x12fcb4);}(_0x33c5,0xe6));var _0x533c=function(_0x2755fb,_0x5970f1){_0x2755fb=_0x2755fb-0x0;var _0x293f12=_0x33c5[_0x2755fb];return _0x293f12;};'use strict';var Sequelize=require('sequelize');module[_0x533c('0x0')]={'name':{'type':Sequelize[_0x533c('0x1')],'allowNull':![]},'description':{'type':Sequelize['STRING']},'parent':{'type':Sequelize[_0x533c('0x1')]},'table':{'type':Sequelize[_0x533c('0x1')]},'conditions':{'type':Sequelize[_0x533c('0x2')]},'joins':{'type':Sequelize[_0x533c('0x2')]}};
\ No newline at end of file
diff --git a/server/api/analyticCustomReport/analyticCustomReport.controller.js b/server/api/analyticCustomReport/analyticCustomReport.controller.js
index 22daa2f..efaa587 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 _0x30ee=['from','MetricId','metric','function','replace','format','groupBy','orderBy','DESC','alias','joins','parse','parentKey','foreignKey','foreignTable','conditions','clone','debug','sequelize','QueryTypes','SELECT','right_join','SEC_TO_TIME(%s)','ROUND(%s)','IS\x20NULL','findAll','table','field','%s.%s\x20=\x20%s.%s','output','web','fullPath','%s-%s.%s','randomstring','custom','AnalyticExtractedReport','cdr','startDate','.createdAt\x20BETWEEN\x20?\x20AND\x20?','endDate','info','Run\x20Query:','toString','child_process','fork','../../components/export/','../../files/reports','savename','countTable','COUNT(*)','runReport','HOUR(%s)','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','dbH','sendStatus','status','json','offset','undefined','limit','count','set','apply','reject','save','update','then','destroy','get','CustomReports','UserProfileResource','end','error','stack','name','send','index','map','AnalyticCustomReport','rawAttributes','fieldName','type','query','keys','filters','intersection','model','attributes','fields','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','include','catch','show','params','includeAll','create','user','role','Reports','UserProfileSection','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','find','preview','join','left_join','cross_join','SUM(%s)','COUNT(%s)','COUNT(DISTINCT\x20%s)','MAX(%s)','MIN(%s)','AVG(%s)','GROUP_CONCAT(%s)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)','DATE(%s)','UNIX_TIMESTAMP(%s)','includes','IS\x20NOT\x20NULL','IS\x20EMPTY','IS\x20NOT\x20EMPTY','rules','length','operator','group','condition','value','getFields','Sequelize','ValidationErrorItem','Please\x20insert\x20at\x20least\x20one\x20field','AnalyticMetric','keyBy','select'];(function(_0x5d238c,_0x44edce){var _0x229c99=function(_0x13a62c){while(--_0x13a62c){_0x5d238c['push'](_0x5d238c['shift']());}};_0x229c99(++_0x44edce);}(_0x30ee,0x18a));var _0xe30e=function(_0xa45395,_0x5579e6){_0xa45395=_0xa45395-0x0;var _0x3c83d2=_0x30ee[_0xa45395];return _0x3c83d2;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xe30e('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0xe30e('0x1'));var rp=require(_0xe30e('0x2'));var moment=require(_0xe30e('0x3'));var BPromise=require(_0xe30e('0x4'));var Mustache=require(_0xe30e('0x5'));var util=require('util');var path=require(_0xe30e('0x6'));var sox=require(_0xe30e('0x7'));var csv=require(_0xe30e('0x8'));var ejs=require(_0xe30e('0x9'));var fs=require('fs');var fs_extra=require(_0xe30e('0xa'));var _=require(_0xe30e('0xb'));var squel=require(_0xe30e('0xc'));var crypto=require(_0xe30e('0xd'));var jsforce=require(_0xe30e('0xe'));var deskjs=require('desk.js');var toCsv=require(_0xe30e('0x8'));var querystring=require(_0xe30e('0xf'));var Papa=require(_0xe30e('0x10'));var Redis=require(_0xe30e('0x11'));var authService=require(_0xe30e('0x12'));var qs=require(_0xe30e('0x13'));var as=require(_0xe30e('0x14'));var hardwareService=require(_0xe30e('0x15'));var logger=require(_0xe30e('0x16'))(_0xe30e('0x17'));var utils=require(_0xe30e('0x18'));var config=require(_0xe30e('0x19'));var licenseUtil=require('../../config/license/util');var db=require(_0xe30e('0x1a'))['db'];var dbH=require(_0xe30e('0x1a'))[_0xe30e('0x1b')];function respondWithStatusCode(_0xb74f04,_0x1d5a98){_0x1d5a98=_0x1d5a98||0xcc;return function(_0x2247ec){if(_0x2247ec){return _0xb74f04[_0xe30e('0x1c')](_0x1d5a98);}return _0xb74f04[_0xe30e('0x1d')](_0x1d5a98)['end']();};}function respondWithResult(_0x21a2fa,_0x305827){_0x305827=_0x305827||0xc8;return function(_0x43dd0a){if(_0x43dd0a){return _0x21a2fa[_0xe30e('0x1d')](_0x305827)[_0xe30e('0x1e')](_0x43dd0a);}};}function respondWithFilteredResult(_0x31a9ac,_0x3cd77b){return function(_0x3d6005){if(_0x3d6005){var _0x43db88=typeof _0x3cd77b[_0xe30e('0x1f')]===_0xe30e('0x20')&&typeof _0x3cd77b[_0xe30e('0x21')]==='undefined';var _0x5f3d01=_0x3d6005[_0xe30e('0x22')];var _0x2bd7fd=_0x43db88?0x0:_0x3cd77b[_0xe30e('0x1f')];var _0x482f13=_0x43db88?_0x3d6005[_0xe30e('0x22')]:_0x3cd77b[_0xe30e('0x1f')]+_0x3cd77b[_0xe30e('0x21')];var _0x22968b;if(_0x482f13>=_0x5f3d01){_0x482f13=_0x5f3d01;_0x22968b=0xc8;}else{_0x22968b=0xce;}_0x31a9ac['status'](_0x22968b);return _0x31a9ac[_0xe30e('0x23')]('Content-Range',_0x2bd7fd+'-'+_0x482f13+'/'+_0x5f3d01)[_0xe30e('0x1e')](_0x3d6005);}return null;};}function patchUpdates(_0x23fafe){return function(_0x1eb7d9){try{jsonpatch[_0xe30e('0x24')](_0x1eb7d9,_0x23fafe,!![]);}catch(_0x464ac1){return BPromise[_0xe30e('0x25')](_0x464ac1);}return _0x1eb7d9[_0xe30e('0x26')]();};}function saveUpdates(_0x54f187,_0x383863){return function(_0xabd873){if(_0xabd873){return _0xabd873[_0xe30e('0x27')](_0x54f187)[_0xe30e('0x28')](function(_0x4ac257){return _0x4ac257;});}return null;};}function removeEntity(_0x3084f6,_0x1a0774){return function(_0x13f26d){if(_0x13f26d){return _0x13f26d[_0xe30e('0x29')]()['then'](function(){var _0x551b5a=_0x13f26d[_0xe30e('0x2a')]({'plain':!![]});var _0x14c763=_0xe30e('0x2b');return db[_0xe30e('0x2c')]['destroy']({'where':{'type':_0x14c763,'resourceId':_0x551b5a['id']}})[_0xe30e('0x28')](function(){return _0x13f26d;});})['then'](function(){_0x3084f6[_0xe30e('0x1d')](0xcc)[_0xe30e('0x2d')]();});}};}function handleEntityNotFound(_0x398ed9,_0x33101f){return function(_0x2ed03b){if(!_0x2ed03b){_0x398ed9[_0xe30e('0x1c')](0x194);}return _0x2ed03b;};}function handleError(_0x50fa91,_0x5a24cc){_0x5a24cc=_0x5a24cc||0x1f4;return function(_0x564bdb){logger[_0xe30e('0x2e')](_0x564bdb[_0xe30e('0x2f')]);if(_0x564bdb[_0xe30e('0x30')]){delete _0x564bdb[_0xe30e('0x30')];}_0x50fa91[_0xe30e('0x1d')](_0x5a24cc)[_0xe30e('0x31')](_0x564bdb);};}exports[_0xe30e('0x32')]=function(_0x4e5d65,_0x575e4d){var _0x25eccd={},_0x1cab0f={},_0x4b24e1={'count':0x0,'rows':[]};var _0x46456a=_[_0xe30e('0x33')](db[_0xe30e('0x34')][_0xe30e('0x35')],function(_0x2e4b2d){return{'name':_0x2e4b2d[_0xe30e('0x36')],'type':_0x2e4b2d[_0xe30e('0x37')]['key']};});_0x1cab0f['model']=_[_0xe30e('0x33')](_0x46456a,'name');_0x1cab0f[_0xe30e('0x38')]=_[_0xe30e('0x39')](_0x4e5d65[_0xe30e('0x38')]);_0x1cab0f[_0xe30e('0x3a')]=_[_0xe30e('0x3b')](_0x1cab0f[_0xe30e('0x3c')],_0x1cab0f[_0xe30e('0x38')]);_0x25eccd[_0xe30e('0x3d')]=_[_0xe30e('0x3b')](_0x1cab0f[_0xe30e('0x3c')],qs[_0xe30e('0x3e')](_0x4e5d65[_0xe30e('0x38')]['fields']));_0x25eccd[_0xe30e('0x3d')]=_0x25eccd[_0xe30e('0x3d')]['length']?_0x25eccd[_0xe30e('0x3d')]:_0x1cab0f[_0xe30e('0x3c')];if(!_0x4e5d65[_0xe30e('0x38')][_0xe30e('0x3f')](_0xe30e('0x40'))){_0x25eccd['limit']=qs['limit'](_0x4e5d65[_0xe30e('0x38')][_0xe30e('0x21')]);_0x25eccd[_0xe30e('0x1f')]=qs[_0xe30e('0x1f')](_0x4e5d65[_0xe30e('0x38')][_0xe30e('0x1f')]);}_0x25eccd[_0xe30e('0x41')]=qs[_0xe30e('0x42')](_0x4e5d65[_0xe30e('0x38')][_0xe30e('0x42')]);_0x25eccd[_0xe30e('0x43')]=qs[_0xe30e('0x3a')](_[_0xe30e('0x44')](_0x4e5d65['query'],_0x1cab0f[_0xe30e('0x3a')]),_0x46456a);if(_0x4e5d65['query'][_0xe30e('0x45')]){_0x25eccd[_0xe30e('0x43')]=_[_0xe30e('0x46')](_0x25eccd['where'],{'$or':_['map'](_0x46456a,function(_0xdc154c){if(_0xdc154c['type']!==_0xe30e('0x47')){var _0x29710d={};_0x29710d[_0xdc154c['name']]={'$like':'%'+_0x4e5d65[_0xe30e('0x38')][_0xe30e('0x45')]+'%'};return _0x29710d;}})});}_0x25eccd=_[_0xe30e('0x46')]({},_0x25eccd,_0x4e5d65[_0xe30e('0x48')]);var _0x2d7775={'where':_0x25eccd['where']};return db['AnalyticCustomReport'][_0xe30e('0x22')](_0x2d7775)[_0xe30e('0x28')](function(_0x51d95b){_0x4b24e1['count']=_0x51d95b;if(_0x4e5d65[_0xe30e('0x38')]['includeAll']){_0x25eccd[_0xe30e('0x49')]=[{'all':!![]}];}return db[_0xe30e('0x34')]['findAll'](_0x25eccd);})[_0xe30e('0x28')](function(_0x3f1b0a){_0x4b24e1['rows']=_0x3f1b0a;return _0x4b24e1;})['then'](respondWithFilteredResult(_0x575e4d,_0x25eccd))[_0xe30e('0x4a')](handleError(_0x575e4d,null));};exports[_0xe30e('0x4b')]=function(_0x209593,_0x3574da){var _0x4cd893={'raw':![],'where':{'id':_0x209593[_0xe30e('0x4c')]['id']}},_0x436f01={};_0x436f01[_0xe30e('0x3c')]=_[_0xe30e('0x39')](db[_0xe30e('0x34')]['rawAttributes']);_0x436f01[_0xe30e('0x38')]=_[_0xe30e('0x39')](_0x209593[_0xe30e('0x38')]);_0x436f01[_0xe30e('0x3a')]=_[_0xe30e('0x3b')](_0x436f01[_0xe30e('0x3c')],_0x436f01[_0xe30e('0x38')]);_0x4cd893[_0xe30e('0x3d')]=_[_0xe30e('0x3b')](_0x436f01[_0xe30e('0x3c')],qs['fields'](_0x209593[_0xe30e('0x38')]['fields']));_0x4cd893[_0xe30e('0x3d')]=_0x4cd893['attributes']['length']?_0x4cd893[_0xe30e('0x3d')]:_0x436f01['model'];if(_0x209593[_0xe30e('0x38')][_0xe30e('0x4d')]){_0x4cd893['include']=[{'all':!![]}];}_0x4cd893=_[_0xe30e('0x46')]({},_0x4cd893,_0x209593[_0xe30e('0x48')]);return db[_0xe30e('0x34')]['find'](_0x4cd893)['then'](handleEntityNotFound(_0x3574da,null))['then'](respondWithResult(_0x3574da,null))[_0xe30e('0x4a')](handleError(_0x3574da,null));};exports[_0xe30e('0x4e')]=function(_0x342c73,_0xf8db03){return db[_0xe30e('0x34')]['create'](_0x342c73['body'],{})[_0xe30e('0x28')](function(_0x3cc698){var _0x2211a3=_0x342c73[_0xe30e('0x4f')][_0xe30e('0x2a')]({'plain':!![]});if(!_0x2211a3)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x2211a3[_0xe30e('0x50')]===_0xe30e('0x4f')){var _0x39af70=_0x3cc698[_0xe30e('0x2a')]({'plain':!![]});var _0x3a0613=_0xe30e('0x51');return db[_0xe30e('0x52')]['find']({'where':{'name':_0x3a0613,'userProfileId':_0x2211a3[_0xe30e('0x53')]},'raw':!![]})['then'](function(_0x30e19e){if(_0x30e19e&&_0x30e19e['autoAssociation']===0x0){return db[_0xe30e('0x2c')]['create']({'name':_0x39af70[_0xe30e('0x30')],'resourceId':_0x39af70['id'],'type':_0xe30e('0x2b'),'sectionId':_0x30e19e['id']},{})['then'](function(){return _0x3cc698;});}else{return _0x3cc698;}})[_0xe30e('0x4a')](function(_0x1c2fd3){logger['error'](_0xe30e('0x54'),_0x1c2fd3);throw _0x1c2fd3;});}return _0x3cc698;})[_0xe30e('0x28')](respondWithResult(_0xf8db03,0xc9))[_0xe30e('0x4a')](handleError(_0xf8db03,null));};exports['update']=function(_0x26f328,_0x2fb376){if(_0x26f328[_0xe30e('0x55')]['id']){delete _0x26f328[_0xe30e('0x55')]['id'];}return db['AnalyticCustomReport'][_0xe30e('0x56')]({'where':{'id':_0x26f328['params']['id']}})[_0xe30e('0x28')](handleEntityNotFound(_0x2fb376,null))[_0xe30e('0x28')](saveUpdates(_0x26f328['body'],null))['then'](respondWithResult(_0x2fb376,null))[_0xe30e('0x4a')](handleError(_0x2fb376,null));};exports[_0xe30e('0x29')]=function(_0x96fbde,_0x13ae0a){return db[_0xe30e('0x34')][_0xe30e('0x56')]({'where':{'id':_0x96fbde[_0xe30e('0x4c')]['id']}})['then'](handleEntityNotFound(_0x13ae0a,null))['then'](removeEntity(_0x13ae0a,null))[_0xe30e('0x4a')](handleError(_0x13ae0a,null));};exports[_0xe30e('0x57')]=function(_0x5280f3,_0x559b70){var _0x37cfb1=0xa;var _0x2c9a4a=[_0xe30e('0x58'),_0xe30e('0x59'),'right_join',_0xe30e('0x5a')];var _0x55cdbd={'SUM':_0xe30e('0x5b'),'COUNT':_0xe30e('0x5c'),'COUNT DISTINCT':_0xe30e('0x5d'),'MAX':_0xe30e('0x5e'),'MIN':_0xe30e('0x5f'),'AVG':_0xe30e('0x60'),'GROUP_CONCAT':_0xe30e('0x61'),'GROUP_CONCAT ASC':_0xe30e('0x62'),'GROUP_CONCAT DESC':_0xe30e('0x63')};var _0x8d61c8={'SEC_TO_TIME':'SEC_TO_TIME(%s)','DATE':_0xe30e('0x64'),'HOUR':'HOUR(%s)','ROUND':'ROUND(%s)','UNIX_TIMESTAMP':_0xe30e('0x65')};var _0x1f3a22=function(_0x2fa469){return!_[_0xe30e('0x66')](['IS\x20NULL',_0xe30e('0x67'),_0xe30e('0x68'),_0xe30e('0x69')],_0x2fa469);};var _0x5973ba=function(_0x347641){if(!_0x347641||!_0x347641[_0xe30e('0x6a')][_0xe30e('0x6b')]){return'';}for(var _0xedaff8='(',_0x5d33e2=0x0;_0x5d33e2<_0x347641[_0xe30e('0x6a')][_0xe30e('0x6b')];_0x5d33e2+=0x1){_0x5d33e2>0x0&&(_0xedaff8+='\x20'+_0x347641[_0xe30e('0x6c')]+'\x20');_0xedaff8+=_0x347641['rules'][_0x5d33e2][_0xe30e('0x6d')]?_0x5973ba(_0x347641[_0xe30e('0x6a')][_0x5d33e2][_0xe30e('0x6d')]):_0x347641[_0xe30e('0x6a')][_0x5d33e2]['field']+'\x20'+_0x347641[_0xe30e('0x6a')][_0x5d33e2][_0xe30e('0x6e')]+(_0x1f3a22(_0x347641[_0xe30e('0x6a')][_0x5d33e2][_0xe30e('0x6e')])?'\x20'+_0x347641[_0xe30e('0x6a')][_0x5d33e2][_0xe30e('0x6f')]:'');}return _0xedaff8+')';};var _0x6ac1bf={'where':{'id':_0x5280f3[_0xe30e('0x4c')]['id']}},_0x874e7,_0x544f14,_0x39a160,_0x5b3070,_0x500c89;_0x6ac1bf=_[_0xe30e('0x46')]({},_0x6ac1bf,_0x5280f3['options']);return db['AnalyticCustomReport'][_0xe30e('0x56')](_0x6ac1bf)[_0xe30e('0x28')](function(_0x3dfade){if(_0x3dfade){_0x874e7=_0x3dfade;return _0x3dfade[_0xe30e('0x70')]();}return null;})[_0xe30e('0x28')](function(_0x5abffb){if(_0x5abffb){if(!_0x5abffb[_0xe30e('0x6b')]){throw new db[(_0xe30e('0x71'))][(_0xe30e('0x72'))](_0xe30e('0x73'),0x193);}_0x544f14=_0x5abffb;return db[_0xe30e('0x74')]['findAll']({'raw':!![]});}return null;})['then'](function(_0x10f807){if(_0x10f807){_0x39a160=_[_0xe30e('0x75')](_0x10f807,'id');var _0xf09b61;var _0x4ef117=squel[_0xe30e('0x76')]();_0x4ef117[_0xe30e('0x77')](_0x874e7['table']);for(var _0x33e602=0x0;_0x33e602<_0x544f14[_0xe30e('0x6b')];_0x33e602+=0x1){_0xf09b61=_0x544f14[_0x33e602][_0xe30e('0x78')]?_0x39a160[_0x544f14[_0x33e602][_0xe30e('0x78')]][_0xe30e('0x79')]:_0x544f14[_0x33e602]['field'];_0xf09b61=_0x544f14[_0x33e602][_0xe30e('0x7a')]?_[_0xe30e('0x7b')](_0x55cdbd[_0x544f14[_0x33e602][_0xe30e('0x7a')]],'%s',_0xf09b61):_0xf09b61;_0xf09b61=_0x544f14[_0x33e602][_0xe30e('0x7c')]?_['replace'](_0x8d61c8[_0x544f14[_0x33e602][_0xe30e('0x7c')]],'%s',_0xf09b61):_0xf09b61;if(_0x544f14[_0x33e602][_0xe30e('0x7d')]){_0x4ef117[_0xe30e('0x6d')](_0xf09b61);}_0x544f14[_0x33e602][_0xe30e('0x7e')]&&_0x4ef117[_0xe30e('0x41')](_0xf09b61,_0x544f14[_0x33e602]['orderBy']===_0xe30e('0x7f')?![]:!![]);_0x4ef117['field'](_0xf09b61,_0x544f14[_0x33e602][_0xe30e('0x80')]||_0xf09b61);}if(_0x874e7['joins']){_0x874e7[_0xe30e('0x81')]=JSON[_0xe30e('0x82')](_0x874e7['joins']);for(var _0x3d408f=0x0;_0x3d408f<_0x874e7['joins'][_0xe30e('0x6b')];_0x3d408f+=0x1){if(_0x874e7['joins'][_0x3d408f]['type']&&_['includes'](_0x2c9a4a,_0x874e7[_0xe30e('0x81')][_0x3d408f][_0xe30e('0x37')])&&_0x874e7[_0xe30e('0x81')][_0x3d408f][_0xe30e('0x83')]&&_0x874e7[_0xe30e('0x81')][_0x3d408f]['foreignTable']&&_0x874e7[_0xe30e('0x81')][_0x3d408f][_0xe30e('0x84')]){_0x4ef117[_0x874e7[_0xe30e('0x81')][_0x3d408f]['type']](_0x874e7['joins'][_0x3d408f][_0xe30e('0x85')],null,util[_0xe30e('0x7c')]('%s.%s\x20=\x20%s.%s',_0x874e7['table'],_0x874e7['joins'][_0x3d408f][_0xe30e('0x83')],_0x874e7[_0xe30e('0x81')][_0x3d408f][_0xe30e('0x85')],_0x874e7['joins'][_0x3d408f][_0xe30e('0x84')]));}}}if(_0x874e7[_0xe30e('0x86')]){_0x874e7[_0xe30e('0x86')]=JSON['parse'](_0x874e7[_0xe30e('0x86')]);_0x4ef117[_0xe30e('0x43')](_0x5973ba(_0x874e7[_0xe30e('0x86')][_0xe30e('0x6d')]));}_0x500c89=_0x4ef117[_0xe30e('0x87')]();_0x4ef117[_0xe30e('0x21')](_0x37cfb1);_0x4ef117[_0xe30e('0x1f')](0x0);logger[_0xe30e('0x88')]('Limited\x20Query:',_0x4ef117['toString']());return dbH[_0xe30e('0x89')]['query'](_0x4ef117['toString'](),{'type':dbH[_0xe30e('0x89')][_0xe30e('0x8a')][_0xe30e('0x8b')]});}})[_0xe30e('0x28')](respondWithResult(_0x559b70,null))[_0xe30e('0x4a')](handleError(_0x559b70,null));};function runReport(_0x1a2352,_0x354424,_0x2523bd){var _0x2f07b3=_0x354424[_0xe30e('0x30')];var _0x4de068=0xa;var _0x4d27ce=['join','left_join',_0xe30e('0x8c'),_0xe30e('0x5a')];var _0x4568b9={'SUM':_0xe30e('0x5b'),'COUNT':'COUNT(%s)','COUNT DISTINCT':_0xe30e('0x5d'),'MAX':'MAX(%s)','MIN':'MIN(%s)','AVG':_0xe30e('0x60'),'GROUP_CONCAT':_0xe30e('0x61'),'GROUP_CONCAT ASC':_0xe30e('0x62'),'GROUP_CONCAT DESC':_0xe30e('0x63')};var _0x2f73b8={'SEC_TO_TIME':_0xe30e('0x8d'),'DATE':'DATE(%s)','HOUR':'HOUR(%s)','ROUND':_0xe30e('0x8e'),'UNIX_TIMESTAMP':_0xe30e('0x65')};var _0x4e19af=function(_0x5deba1){return!_['includes']([_0xe30e('0x8f'),_0xe30e('0x67'),'IS\x20EMPTY',_0xe30e('0x69')],_0x5deba1);};var _0x34d52d=function(_0x3dbbae){if(!_0x3dbbae||!_0x3dbbae[_0xe30e('0x6a')]['length']){return'';}for(var _0x445da6='(',_0x6bc7e6=0x0;_0x6bc7e6<_0x3dbbae['rules'][_0xe30e('0x6b')];_0x6bc7e6+=0x1){_0x6bc7e6>0x0&&(_0x445da6+='\x20'+_0x3dbbae[_0xe30e('0x6c')]+'\x20');_0x445da6+=_0x3dbbae['rules'][_0x6bc7e6][_0xe30e('0x6d')]?_0x34d52d(_0x3dbbae[_0xe30e('0x6a')][_0x6bc7e6]['group']):_0x3dbbae[_0xe30e('0x6a')][_0x6bc7e6]['field']+'\x20'+_0x3dbbae[_0xe30e('0x6a')][_0x6bc7e6]['condition']+(_0x4e19af(_0x3dbbae[_0xe30e('0x6a')][_0x6bc7e6][_0xe30e('0x6e')])?'\x20'+_0x3dbbae[_0xe30e('0x6a')][_0x6bc7e6][_0xe30e('0x6f')]:'');}return _0x445da6+')';};var _0x23b882={'where':{'id':_0x1a2352['id']}},_0x45322f,_0x3debc4,_0x188260,_0x222a50,_0x272c70;_0x23b882=_[_0xe30e('0x46')]({},_0x23b882,_0x2523bd);return db[_0xe30e('0x34')][_0xe30e('0x56')](_0x23b882)[_0xe30e('0x28')](function(_0x40ff23){if(_0x40ff23){_0x45322f=_0x40ff23;return _0x40ff23[_0xe30e('0x70')]();}return null;})[_0xe30e('0x28')](function(_0x469ebf){if(_0x469ebf){if(!_0x469ebf[_0xe30e('0x6b')]){throw new db['Sequelize']['ValidationErrorItem'](_0xe30e('0x73'),0x193);}_0x3debc4=_0x469ebf;return db['AnalyticMetric'][_0xe30e('0x90')]({'raw':!![]});}return null;})['then'](function(_0x3df26f){if(_0x3df26f){_0x188260=_[_0xe30e('0x75')](_0x3df26f,'id');var _0x220b9a;var _0x252200=squel[_0xe30e('0x76')]();_0x252200[_0xe30e('0x77')](_0x45322f[_0xe30e('0x91')]);for(var _0x374fe7=0x0;_0x374fe7<_0x3debc4[_0xe30e('0x6b')];_0x374fe7+=0x1){_0x220b9a=_0x3debc4[_0x374fe7][_0xe30e('0x78')]?_0x188260[_0x3debc4[_0x374fe7][_0xe30e('0x78')]][_0xe30e('0x79')]:_0x3debc4[_0x374fe7][_0xe30e('0x92')];_0x220b9a=_0x3debc4[_0x374fe7][_0xe30e('0x7a')]?_['replace'](_0x4568b9[_0x3debc4[_0x374fe7][_0xe30e('0x7a')]],'%s',_0x220b9a):_0x220b9a;_0x220b9a=_0x3debc4[_0x374fe7][_0xe30e('0x7c')]?_['replace'](_0x2f73b8[_0x3debc4[_0x374fe7][_0xe30e('0x7c')]],'%s',_0x220b9a):_0x220b9a;if(_0x3debc4[_0x374fe7]['groupBy']){_0x252200['group'](_0x220b9a);}_0x3debc4[_0x374fe7]['orderBy']&&_0x252200[_0xe30e('0x41')](_0x220b9a,_0x3debc4[_0x374fe7][_0xe30e('0x7e')]===_0xe30e('0x7f')?![]:!![]);_0x252200[_0xe30e('0x92')](_0x220b9a,_0x3debc4[_0x374fe7][_0xe30e('0x80')]||_0x220b9a);}if(_0x45322f[_0xe30e('0x81')]){_0x45322f[_0xe30e('0x81')]=JSON[_0xe30e('0x82')](_0x45322f[_0xe30e('0x81')]);for(var _0x389652=0x0;_0x389652<_0x45322f['joins'][_0xe30e('0x6b')];_0x389652+=0x1){if(_0x45322f[_0xe30e('0x81')][_0x389652][_0xe30e('0x37')]&&_[_0xe30e('0x66')](_0x4d27ce,_0x45322f['joins'][_0x389652][_0xe30e('0x37')])&&_0x45322f['joins'][_0x389652]['parentKey']&&_0x45322f['joins'][_0x389652][_0xe30e('0x85')]&&_0x45322f['joins'][_0x389652]['foreignKey']){_0x252200[_0x45322f[_0xe30e('0x81')][_0x389652][_0xe30e('0x37')]](_0x45322f[_0xe30e('0x81')][_0x389652][_0xe30e('0x85')],null,util[_0xe30e('0x7c')](_0xe30e('0x93'),_0x45322f[_0xe30e('0x91')],_0x45322f[_0xe30e('0x81')][_0x389652][_0xe30e('0x83')],_0x45322f[_0xe30e('0x81')][_0x389652][_0xe30e('0x85')],_0x45322f['joins'][_0x389652][_0xe30e('0x84')]));}}}if(_0x45322f['conditions']){_0x45322f[_0xe30e('0x86')]=JSON[_0xe30e('0x82')](_0x45322f['conditions']);_0x252200[_0xe30e('0x43')](_0x34d52d(_0x45322f[_0xe30e('0x86')]['group']));}_0x272c70=_0x252200[_0xe30e('0x87')]();_0x252200[_0xe30e('0x21')](_0x4de068);_0x252200[_0xe30e('0x1f')](0x0);return;}})[_0xe30e('0x28')](function(){if(_0x354424[_0xe30e('0x94')]===_0xe30e('0x95')){return null;}var _0x2117b4=_[_0xe30e('0x46')](_0x354424,{'name':_0x354424[_0xe30e('0x96')]||_0x354424[_0xe30e('0x30')]||_0x45322f['name'],'basename':_0x2f07b3,'savename':util[_0xe30e('0x7c')](_0xe30e('0x97'),_0x354424[_0xe30e('0x30')]||_0x45322f[_0xe30e('0x30')],require(_0xe30e('0x98'))['generate'](0x4),_0x354424[_0xe30e('0x94')]||'csv'),'reportId':_0x45322f['id'],'reportType':_0xe30e('0x99')});return db[_0xe30e('0x9a')][_0xe30e('0x4e')](_0x2117b4,{'raw':!![]});})[_0xe30e('0x28')](function(_0x1109e0){if(_0x45322f['table']===_0xe30e('0x9b')){_0x272c70[_0xe30e('0x43')](_0x45322f['table']+'.calldate\x20BETWEEN\x20?\x20AND\x20?',_0x354424[_0xe30e('0x9c')],_0x354424['endDate']);}else{_0x272c70['where'](_0x45322f[_0xe30e('0x91')]+_0xe30e('0x9d'),_0x354424[_0xe30e('0x9c')],_0x354424[_0xe30e('0x9e')]);}if(_0x1109e0){logger[_0xe30e('0x9f')](_0xe30e('0xa0'),_0x272c70[_0xe30e('0xa1')]());require(_0xe30e('0xa2'))[_0xe30e('0xa3')](path['join'](__dirname,_0xe30e('0xa4'),_0x1109e0[_0xe30e('0x94')]),[_0x1109e0['id'],_0x272c70[_0xe30e('0xa1')](),path[_0xe30e('0x58')](__dirname,_0xe30e('0xa5'),_0x1109e0[_0xe30e('0xa6')]),_0x2f07b3]);return _0x1109e0;}else{var _0x1d3099=squel[_0xe30e('0x76')]();_0x1d3099['from']('('+_0x272c70[_0xe30e('0xa1')]()+')',_0xe30e('0xa7'));_0x1d3099['field'](_0xe30e('0xa8'),_0xe30e('0x22'));_0x272c70[_0xe30e('0x21')](_0x354424[_0xe30e('0x21')]||_0x4de068);_0x272c70['offset'](_0x354424['offset']||0x0);return dbH[_0xe30e('0x89')][_0xe30e('0x38')](_0x1d3099['toString'](),{'type':dbH['sequelize'][_0xe30e('0x8a')][_0xe30e('0x8b')]})[_0xe30e('0x28')](function(_0x32b525){if(!_0x32b525['length']){_0x222a50=0x0;}else{_0x222a50=_0x32b525[0x0][_0xe30e('0x22')]||0x0;}return dbH[_0xe30e('0x89')][_0xe30e('0x38')](_0x272c70[_0xe30e('0xa1')](),{'type':dbH[_0xe30e('0x89')]['QueryTypes']['SELECT']});})[_0xe30e('0x28')](function(_0xf93d08){return{'rows':_0xf93d08||[],'count':_0x222a50};});}});}exports['run']=function(_0x1793c4,_0x202871){return runReport(_0x1793c4[_0xe30e('0x4c')],_0x1793c4[_0xe30e('0x38')],_0x1793c4[_0xe30e('0x48')])[_0xe30e('0x28')](respondWithResult(_0x202871,null))['catch'](handleError(_0x202871,null));};exports[_0xe30e('0xa9')]=runReport;exports[_0xe30e('0x38')]=function(_0x422a1a,_0x8ed9a2){var _0x3b054c=0xa;var _0x561ab3=['join',_0xe30e('0x59'),_0xe30e('0x8c'),_0xe30e('0x5a')];var _0x240731={'SUM':_0xe30e('0x5b'),'COUNT':'COUNT(%s)','COUNT DISTINCT':_0xe30e('0x5d'),'MAX':_0xe30e('0x5e'),'MIN':_0xe30e('0x5f'),'AVG':_0xe30e('0x60'),'GROUP_CONCAT':_0xe30e('0x61'),'GROUP_CONCAT ASC':_0xe30e('0x62'),'GROUP_CONCAT DESC':_0xe30e('0x63')};var _0x3f2547={'SEC_TO_TIME':_0xe30e('0x8d'),'DATE':_0xe30e('0x64'),'HOUR':_0xe30e('0xaa'),'ROUND':_0xe30e('0x8e'),'UNIX_TIMESTAMP':_0xe30e('0x65')};var _0x568dcd=function(_0x310e6c){return!_[_0xe30e('0x66')]([_0xe30e('0x8f'),'IS\x20NOT\x20NULL',_0xe30e('0x68'),_0xe30e('0x69')],_0x310e6c);};var _0xe2d9fe=function(_0x59969d){if(!_0x59969d||!_0x59969d[_0xe30e('0x6a')][_0xe30e('0x6b')]){return'';}for(var _0x2f3ab3='(',_0x4963ce=0x0;_0x4963ce<_0x59969d[_0xe30e('0x6a')]['length'];_0x4963ce+=0x1){_0x4963ce>0x0&&(_0x2f3ab3+='\x20'+_0x59969d[_0xe30e('0x6c')]+'\x20');_0x2f3ab3+=_0x59969d[_0xe30e('0x6a')][_0x4963ce][_0xe30e('0x6d')]?_0xe2d9fe(_0x59969d[_0xe30e('0x6a')][_0x4963ce][_0xe30e('0x6d')]):_0x59969d[_0xe30e('0x6a')][_0x4963ce][_0xe30e('0x92')]+'\x20'+_0x59969d['rules'][_0x4963ce][_0xe30e('0x6e')]+(_0x568dcd(_0x59969d[_0xe30e('0x6a')][_0x4963ce]['condition'])?'\x20'+_0x59969d['rules'][_0x4963ce][_0xe30e('0x6f')]:'');}return _0x2f3ab3+')';};var _0x20d1d2={'where':{'id':_0x422a1a[_0xe30e('0x4c')]['id']}},_0x52a747,_0x99a02,_0x3a7a11,_0x2e572f,_0x307d3e;_0x20d1d2=_[_0xe30e('0x46')]({},_0x20d1d2,_0x422a1a[_0xe30e('0x48')]);return db[_0xe30e('0x34')][_0xe30e('0x56')](_0x20d1d2)[_0xe30e('0x28')](function(_0x110645){if(_0x110645){_0x52a747=_0x110645;return _0x110645[_0xe30e('0x70')]();}return null;})[_0xe30e('0x28')](function(_0x55e00c){if(_0x55e00c){if(!_0x55e00c['length']){throw new db[(_0xe30e('0x71'))][(_0xe30e('0x72'))](_0xe30e('0x73'),0x193);}_0x99a02=_0x55e00c;return db[_0xe30e('0x74')][_0xe30e('0x90')]({'raw':!![]});}return null;})['then'](function(_0x4888d1){if(_0x4888d1){_0x3a7a11=_['keyBy'](_0x4888d1,'id');var _0x2d7003;var _0x1d1315=squel[_0xe30e('0x76')]();_0x1d1315['from'](_0x52a747['table']);for(var _0xbad5a5=0x0;_0xbad5a5<_0x99a02[_0xe30e('0x6b')];_0xbad5a5+=0x1){_0x2d7003=_0x99a02[_0xbad5a5][_0xe30e('0x78')]?_0x3a7a11[_0x99a02[_0xbad5a5]['MetricId']]['metric']:_0x99a02[_0xbad5a5][_0xe30e('0x92')];_0x2d7003=_0x99a02[_0xbad5a5]['function']?_[_0xe30e('0x7b')](_0x240731[_0x99a02[_0xbad5a5][_0xe30e('0x7a')]],'%s',_0x2d7003):_0x2d7003;_0x2d7003=_0x99a02[_0xbad5a5]['format']?_['replace'](_0x3f2547[_0x99a02[_0xbad5a5][_0xe30e('0x7c')]],'%s',_0x2d7003):_0x2d7003;if(_0x99a02[_0xbad5a5][_0xe30e('0x7d')]){_0x1d1315['group'](_0x2d7003);}_0x99a02[_0xbad5a5][_0xe30e('0x7e')]&&_0x1d1315[_0xe30e('0x41')](_0x2d7003,_0x99a02[_0xbad5a5][_0xe30e('0x7e')]===_0xe30e('0x7f')?![]:!![]);_0x1d1315[_0xe30e('0x92')](_0x2d7003,_0x99a02[_0xbad5a5]['alias']||_0x2d7003);}if(_0x52a747['joins']){_0x52a747[_0xe30e('0x81')]=JSON[_0xe30e('0x82')](_0x52a747[_0xe30e('0x81')]);for(var _0xe87dde=0x0;_0xe87dde<_0x52a747[_0xe30e('0x81')]['length'];_0xe87dde+=0x1){if(_0x52a747[_0xe30e('0x81')][_0xe87dde][_0xe30e('0x37')]&&_['includes'](_0x561ab3,_0x52a747[_0xe30e('0x81')][_0xe87dde][_0xe30e('0x37')])&&_0x52a747[_0xe30e('0x81')][_0xe87dde][_0xe30e('0x83')]&&_0x52a747['joins'][_0xe87dde][_0xe30e('0x85')]&&_0x52a747[_0xe30e('0x81')][_0xe87dde][_0xe30e('0x84')]){_0x1d1315[_0x52a747['joins'][_0xe87dde][_0xe30e('0x37')]](_0x52a747[_0xe30e('0x81')][_0xe87dde][_0xe30e('0x85')],null,util[_0xe30e('0x7c')](_0xe30e('0x93'),_0x52a747[_0xe30e('0x91')],_0x52a747[_0xe30e('0x81')][_0xe87dde][_0xe30e('0x83')],_0x52a747['joins'][_0xe87dde][_0xe30e('0x85')],_0x52a747[_0xe30e('0x81')][_0xe87dde][_0xe30e('0x84')]));}}}if(_0x52a747[_0xe30e('0x86')]){_0x52a747[_0xe30e('0x86')]=JSON[_0xe30e('0x82')](_0x52a747[_0xe30e('0x86')]);_0x1d1315[_0xe30e('0x43')](_0xe2d9fe(_0x52a747[_0xe30e('0x86')][_0xe30e('0x6d')]));}_0x307d3e=_0x1d1315[_0xe30e('0x87')]();_0x1d1315[_0xe30e('0x21')](_0x3b054c);_0x1d1315[_0xe30e('0x1f')](0x0);logger[_0xe30e('0x88')]('Limited\x20Query:',_0x1d1315[_0xe30e('0xa1')]());return dbH['sequelize'][_0xe30e('0x38')](_0x1d1315[_0xe30e('0xa1')](),{'type':dbH[_0xe30e('0x89')]['QueryTypes']['SELECT']});}})[_0xe30e('0x28')](function(){return{'sql':_0x307d3e[_0xe30e('0xa1')]()};})['then'](respondWithResult(_0x8ed9a2,null))['catch'](handleError(_0x8ed9a2,null));};
\ No newline at end of file
+var _0x3e23=['fs-extra','lodash','crypto','desk.js','to-csv','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../mysqldb','dbH','sendStatus','status','end','json','offset','undefined','count','limit','set','Content-Range','apply','reject','save','update','then','destroy','CustomReports','error','stack','name','send','index','AnalyticCustomReport','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','order','sort','where','pick','filter','merge','map','VIRTUAL','options','include','findAll','rows','show','params','catch','create','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','Reports','UserProfileSection','find','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','preview','join','left_join','COUNT(%s)','COUNT(DISTINCT\x20%s)','MAX(%s)','MIN(%s)','GROUP_CONCAT(%s)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)','SEC_TO_TIME(%s)','HOUR(%s)','ROUND(%s)','UNIX_TIMESTAMP(%s)','IS\x20NOT\x20NULL','IS\x20EMPTY','IS\x20NOT\x20EMPTY','rules','operator','field','condition','Sequelize','ValidationErrorItem','Please\x20insert\x20at\x20least\x20one\x20field','AnalyticMetric','keyBy','select','from','table','MetricId','metric','replace','function','format','groupBy','group','orderBy','DESC','alias','joins','parse','includes','parentKey','%s.%s\x20=\x20%s.%s','foreignTable','foreignKey','conditions','clone','debug','toString','sequelize','QueryTypes','SELECT','right_join','cross_join','SUM(%s)','DATE(%s)','IS\x20NULL','value','getFields','output','web','fullPath','%s-%s.%s','randomstring','generate','custom','cdr','.calldate\x20BETWEEN\x20?\x20AND\x20?','startDate','endDate','info','Run\x20Query:','child_process','fork','../../components/export/','countTable','COUNT(*)','run','AVG(%s)','Limited\x20Query:','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','path','sox','ejs'];(function(_0x437f59,_0x2e9342){var _0x2ba6a4=function(_0x34dc69){while(--_0x34dc69){_0x437f59['push'](_0x437f59['shift']());}};_0x2ba6a4(++_0x2e9342);}(_0x3e23,0x9c));var _0x33e2=function(_0x338f73,_0x1945c8){_0x338f73=_0x338f73-0x0;var _0x163fdf=_0x3e23[_0x338f73];return _0x163fdf;};'use strict';var emlformat=require(_0x33e2('0x0'));var rimraf=require(_0x33e2('0x1'));var zipdir=require(_0x33e2('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x33e2('0x3'));var moment=require(_0x33e2('0x4'));var BPromise=require(_0x33e2('0x5'));var Mustache=require(_0x33e2('0x6'));var util=require('util');var path=require(_0x33e2('0x7'));var sox=require(_0x33e2('0x8'));var csv=require('to-csv');var ejs=require(_0x33e2('0x9'));var fs=require('fs');var fs_extra=require(_0x33e2('0xa'));var _=require(_0x33e2('0xb'));var squel=require('squel');var crypto=require(_0x33e2('0xc'));var jsforce=require('jsforce');var deskjs=require(_0x33e2('0xd'));var toCsv=require(_0x33e2('0xe'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x33e2('0xf'));var as=require(_0x33e2('0x10'));var hardwareService=require(_0x33e2('0x11'));var logger=require('../../config/logger')(_0x33e2('0x12'));var utils=require(_0x33e2('0x13'));var config=require(_0x33e2('0x14'));var licenseUtil=require('../../config/license/util');var db=require(_0x33e2('0x15'))['db'];var dbH=require(_0x33e2('0x15'))[_0x33e2('0x16')];function respondWithStatusCode(_0x44477c,_0x14d64d){_0x14d64d=_0x14d64d||0xcc;return function(_0x102c63){if(_0x102c63){return _0x44477c[_0x33e2('0x17')](_0x14d64d);}return _0x44477c[_0x33e2('0x18')](_0x14d64d)[_0x33e2('0x19')]();};}function respondWithResult(_0x26c07d,_0x41ecd3){_0x41ecd3=_0x41ecd3||0xc8;return function(_0x19da1c){if(_0x19da1c){return _0x26c07d['status'](_0x41ecd3)[_0x33e2('0x1a')](_0x19da1c);}};}function respondWithFilteredResult(_0xcfadf1,_0x1827cc){return function(_0x19da65){if(_0x19da65){var _0x1036c2=typeof _0x1827cc[_0x33e2('0x1b')]==='undefined'&&typeof _0x1827cc['limit']===_0x33e2('0x1c');var _0x590a05=_0x19da65[_0x33e2('0x1d')];var _0x1bcfc2=_0x1036c2?0x0:_0x1827cc[_0x33e2('0x1b')];var _0x17a7d9=_0x1036c2?_0x19da65[_0x33e2('0x1d')]:_0x1827cc[_0x33e2('0x1b')]+_0x1827cc[_0x33e2('0x1e')];var _0x3d15af;if(_0x17a7d9>=_0x590a05){_0x17a7d9=_0x590a05;_0x3d15af=0xc8;}else{_0x3d15af=0xce;}_0xcfadf1[_0x33e2('0x18')](_0x3d15af);return _0xcfadf1[_0x33e2('0x1f')](_0x33e2('0x20'),_0x1bcfc2+'-'+_0x17a7d9+'/'+_0x590a05)[_0x33e2('0x1a')](_0x19da65);}return null;};}function patchUpdates(_0x576571){return function(_0x38cea4){try{jsonpatch[_0x33e2('0x21')](_0x38cea4,_0x576571,!![]);}catch(_0x30fb14){return BPromise[_0x33e2('0x22')](_0x30fb14);}return _0x38cea4[_0x33e2('0x23')]();};}function saveUpdates(_0x37f794,_0x49c9db){return function(_0x3e438f){if(_0x3e438f){return _0x3e438f[_0x33e2('0x24')](_0x37f794)[_0x33e2('0x25')](function(_0x5e5168){return _0x5e5168;});}return null;};}function removeEntity(_0x15c5d6,_0x3a9f5b){return function(_0x4dac27){if(_0x4dac27){return _0x4dac27[_0x33e2('0x26')]()['then'](function(){var _0x11379c=_0x4dac27['get']({'plain':!![]});var _0x4522e6=_0x33e2('0x27');return db['UserProfileResource'][_0x33e2('0x26')]({'where':{'type':_0x4522e6,'resourceId':_0x11379c['id']}})[_0x33e2('0x25')](function(){return _0x4dac27;});})[_0x33e2('0x25')](function(){_0x15c5d6[_0x33e2('0x18')](0xcc)['end']();});}};}function handleEntityNotFound(_0x14e59c,_0x4d7afb){return function(_0x1fda6a){if(!_0x1fda6a){_0x14e59c[_0x33e2('0x17')](0x194);}return _0x1fda6a;};}function handleError(_0x25e06f,_0xd7f9fa){_0xd7f9fa=_0xd7f9fa||0x1f4;return function(_0xf0e466){logger[_0x33e2('0x28')](_0xf0e466[_0x33e2('0x29')]);if(_0xf0e466[_0x33e2('0x2a')]){delete _0xf0e466[_0x33e2('0x2a')];}_0x25e06f[_0x33e2('0x18')](_0xd7f9fa)[_0x33e2('0x2b')](_0xf0e466);};}exports[_0x33e2('0x2c')]=function(_0xf2a2c5,_0x5af84e){var _0x42fd41={},_0x28cc24={},_0x391c38={'count':0x0,'rows':[]};var _0xf93ddd=_['map'](db[_0x33e2('0x2d')][_0x33e2('0x2e')],function(_0x552915){return{'name':_0x552915[_0x33e2('0x2f')],'type':_0x552915[_0x33e2('0x30')][_0x33e2('0x31')]};});_0x28cc24[_0x33e2('0x32')]=_['map'](_0xf93ddd,_0x33e2('0x2a'));_0x28cc24[_0x33e2('0x33')]=_[_0x33e2('0x34')](_0xf2a2c5[_0x33e2('0x33')]);_0x28cc24[_0x33e2('0x35')]=_[_0x33e2('0x36')](_0x28cc24['model'],_0x28cc24['query']);_0x42fd41[_0x33e2('0x37')]=_[_0x33e2('0x36')](_0x28cc24[_0x33e2('0x32')],qs[_0x33e2('0x38')](_0xf2a2c5[_0x33e2('0x33')]['fields']));_0x42fd41[_0x33e2('0x37')]=_0x42fd41[_0x33e2('0x37')][_0x33e2('0x39')]?_0x42fd41['attributes']:_0x28cc24[_0x33e2('0x32')];if(!_0xf2a2c5[_0x33e2('0x33')]['hasOwnProperty']('nolimit')){_0x42fd41[_0x33e2('0x1e')]=qs[_0x33e2('0x1e')](_0xf2a2c5['query']['limit']);_0x42fd41[_0x33e2('0x1b')]=qs[_0x33e2('0x1b')](_0xf2a2c5[_0x33e2('0x33')]['offset']);}_0x42fd41[_0x33e2('0x3a')]=qs[_0x33e2('0x3b')](_0xf2a2c5['query'][_0x33e2('0x3b')]);_0x42fd41[_0x33e2('0x3c')]=qs['filters'](_[_0x33e2('0x3d')](_0xf2a2c5[_0x33e2('0x33')],_0x28cc24[_0x33e2('0x35')]),_0xf93ddd);if(_0xf2a2c5['query'][_0x33e2('0x3e')]){_0x42fd41[_0x33e2('0x3c')]=_[_0x33e2('0x3f')](_0x42fd41['where'],{'$or':_[_0x33e2('0x40')](_0xf93ddd,function(_0x45dfb3){if(_0x45dfb3[_0x33e2('0x30')]!==_0x33e2('0x41')){var _0x3e2f0b={};_0x3e2f0b[_0x45dfb3[_0x33e2('0x2a')]]={'$like':'%'+_0xf2a2c5[_0x33e2('0x33')][_0x33e2('0x3e')]+'%'};return _0x3e2f0b;}})});}_0x42fd41=_[_0x33e2('0x3f')]({},_0x42fd41,_0xf2a2c5[_0x33e2('0x42')]);var _0x841131={'where':_0x42fd41[_0x33e2('0x3c')]};return db[_0x33e2('0x2d')]['count'](_0x841131)[_0x33e2('0x25')](function(_0x21a553){_0x391c38[_0x33e2('0x1d')]=_0x21a553;if(_0xf2a2c5['query']['includeAll']){_0x42fd41[_0x33e2('0x43')]=[{'all':!![]}];}return db[_0x33e2('0x2d')][_0x33e2('0x44')](_0x42fd41);})[_0x33e2('0x25')](function(_0x17beca){_0x391c38[_0x33e2('0x45')]=_0x17beca;return _0x391c38;})[_0x33e2('0x25')](respondWithFilteredResult(_0x5af84e,_0x42fd41))['catch'](handleError(_0x5af84e,null));};exports[_0x33e2('0x46')]=function(_0xa7d2e6,_0x23e014){var _0x362541={'raw':![],'where':{'id':_0xa7d2e6[_0x33e2('0x47')]['id']}},_0xce203b={};_0xce203b[_0x33e2('0x32')]=_['keys'](db['AnalyticCustomReport'][_0x33e2('0x2e')]);_0xce203b['query']=_['keys'](_0xa7d2e6[_0x33e2('0x33')]);_0xce203b['filters']=_[_0x33e2('0x36')](_0xce203b[_0x33e2('0x32')],_0xce203b['query']);_0x362541[_0x33e2('0x37')]=_[_0x33e2('0x36')](_0xce203b[_0x33e2('0x32')],qs[_0x33e2('0x38')](_0xa7d2e6['query']['fields']));_0x362541[_0x33e2('0x37')]=_0x362541[_0x33e2('0x37')][_0x33e2('0x39')]?_0x362541[_0x33e2('0x37')]:_0xce203b['model'];if(_0xa7d2e6[_0x33e2('0x33')]['includeAll']){_0x362541[_0x33e2('0x43')]=[{'all':!![]}];}_0x362541=_[_0x33e2('0x3f')]({},_0x362541,_0xa7d2e6[_0x33e2('0x42')]);return db[_0x33e2('0x2d')]['find'](_0x362541)[_0x33e2('0x25')](handleEntityNotFound(_0x23e014,null))[_0x33e2('0x25')](respondWithResult(_0x23e014,null))[_0x33e2('0x48')](handleError(_0x23e014,null));};exports[_0x33e2('0x49')]=function(_0x115d5b,_0xfc7992){return db[_0x33e2('0x2d')]['create'](_0x115d5b['body'],{})[_0x33e2('0x25')](function(_0x4803c1){var _0x1c8908=_0x115d5b[_0x33e2('0x4a')][_0x33e2('0x4b')]({'plain':!![]});if(!_0x1c8908)throw new Error(_0x33e2('0x4c'));if(_0x1c8908[_0x33e2('0x4d')]===_0x33e2('0x4a')){var _0x518275=_0x4803c1[_0x33e2('0x4b')]({'plain':!![]});var _0x48d498=_0x33e2('0x4e');return db[_0x33e2('0x4f')][_0x33e2('0x50')]({'where':{'name':_0x48d498,'userProfileId':_0x1c8908['userProfileId']},'raw':!![]})['then'](function(_0x254c78){if(_0x254c78&&_0x254c78[_0x33e2('0x51')]===0x0){return db[_0x33e2('0x52')]['create']({'name':_0x518275[_0x33e2('0x2a')],'resourceId':_0x518275['id'],'type':_0x33e2('0x27'),'sectionId':_0x254c78['id']},{})[_0x33e2('0x25')](function(){return _0x4803c1;});}else{return _0x4803c1;}})['catch'](function(_0x40ab1a){logger[_0x33e2('0x28')](_0x33e2('0x53'),_0x40ab1a);throw _0x40ab1a;});}return _0x4803c1;})[_0x33e2('0x25')](respondWithResult(_0xfc7992,0xc9))[_0x33e2('0x48')](handleError(_0xfc7992,null));};exports['update']=function(_0x22418b,_0x2dfb6f){if(_0x22418b[_0x33e2('0x54')]['id']){delete _0x22418b[_0x33e2('0x54')]['id'];}return db['AnalyticCustomReport'][_0x33e2('0x50')]({'where':{'id':_0x22418b[_0x33e2('0x47')]['id']}})['then'](handleEntityNotFound(_0x2dfb6f,null))[_0x33e2('0x25')](saveUpdates(_0x22418b['body'],null))[_0x33e2('0x25')](respondWithResult(_0x2dfb6f,null))[_0x33e2('0x48')](handleError(_0x2dfb6f,null));};exports['destroy']=function(_0xf87344,_0xcd5419){return db[_0x33e2('0x2d')]['find']({'where':{'id':_0xf87344[_0x33e2('0x47')]['id']}})[_0x33e2('0x25')](handleEntityNotFound(_0xcd5419,null))[_0x33e2('0x25')](removeEntity(_0xcd5419,null))[_0x33e2('0x48')](handleError(_0xcd5419,null));};exports[_0x33e2('0x55')]=function(_0x4862b9,_0x37fce5){var _0x1aa602=0xa;var _0x1e692c=[_0x33e2('0x56'),_0x33e2('0x57'),'right_join','cross_join'];var _0xb30d2c={'SUM':'SUM(%s)','COUNT':_0x33e2('0x58'),'COUNT DISTINCT':_0x33e2('0x59'),'MAX':_0x33e2('0x5a'),'MIN':_0x33e2('0x5b'),'AVG':'AVG(%s)','GROUP_CONCAT':_0x33e2('0x5c'),'GROUP_CONCAT ASC':_0x33e2('0x5d'),'GROUP_CONCAT DESC':_0x33e2('0x5e')};var _0x1f34aa={'SEC_TO_TIME':_0x33e2('0x5f'),'DATE':'DATE(%s)','HOUR':_0x33e2('0x60'),'ROUND':_0x33e2('0x61'),'UNIX_TIMESTAMP':_0x33e2('0x62')};var _0x46a222=function(_0x577099){return!_['includes'](['IS\x20NULL',_0x33e2('0x63'),_0x33e2('0x64'),_0x33e2('0x65')],_0x577099);};var _0x24404e=function(_0x64fd82){if(!_0x64fd82||!_0x64fd82['rules'][_0x33e2('0x39')]){return'';}for(var _0x508b28='(',_0x459e2d=0x0;_0x459e2d<_0x64fd82[_0x33e2('0x66')][_0x33e2('0x39')];_0x459e2d+=0x1){_0x459e2d>0x0&&(_0x508b28+='\x20'+_0x64fd82[_0x33e2('0x67')]+'\x20');_0x508b28+=_0x64fd82[_0x33e2('0x66')][_0x459e2d]['group']?_0x24404e(_0x64fd82['rules'][_0x459e2d]['group']):_0x64fd82[_0x33e2('0x66')][_0x459e2d][_0x33e2('0x68')]+'\x20'+_0x64fd82[_0x33e2('0x66')][_0x459e2d]['condition']+(_0x46a222(_0x64fd82[_0x33e2('0x66')][_0x459e2d][_0x33e2('0x69')])?'\x20'+_0x64fd82[_0x33e2('0x66')][_0x459e2d]['value']:'');}return _0x508b28+')';};var _0x37694e={'where':{'id':_0x4862b9['params']['id']}},_0x2e52e1,_0x160c95,_0x5e1889,_0x15ee8e,_0x448eea;_0x37694e=_['merge']({},_0x37694e,_0x4862b9['options']);return db[_0x33e2('0x2d')][_0x33e2('0x50')](_0x37694e)[_0x33e2('0x25')](function(_0x2b09af){if(_0x2b09af){_0x2e52e1=_0x2b09af;return _0x2b09af['getFields']();}return null;})[_0x33e2('0x25')](function(_0x47b3f1){if(_0x47b3f1){if(!_0x47b3f1[_0x33e2('0x39')]){throw new db[(_0x33e2('0x6a'))][(_0x33e2('0x6b'))](_0x33e2('0x6c'),0x193);}_0x160c95=_0x47b3f1;return db[_0x33e2('0x6d')][_0x33e2('0x44')]({'raw':!![]});}return null;})[_0x33e2('0x25')](function(_0x2a3d6a){if(_0x2a3d6a){_0x5e1889=_[_0x33e2('0x6e')](_0x2a3d6a,'id');var _0xabc62e;var _0x5835fc=squel[_0x33e2('0x6f')]();_0x5835fc[_0x33e2('0x70')](_0x2e52e1[_0x33e2('0x71')]);for(var _0x2741d8=0x0;_0x2741d8<_0x160c95[_0x33e2('0x39')];_0x2741d8+=0x1){_0xabc62e=_0x160c95[_0x2741d8][_0x33e2('0x72')]?_0x5e1889[_0x160c95[_0x2741d8][_0x33e2('0x72')]][_0x33e2('0x73')]:_0x160c95[_0x2741d8][_0x33e2('0x68')];_0xabc62e=_0x160c95[_0x2741d8]['function']?_[_0x33e2('0x74')](_0xb30d2c[_0x160c95[_0x2741d8][_0x33e2('0x75')]],'%s',_0xabc62e):_0xabc62e;_0xabc62e=_0x160c95[_0x2741d8][_0x33e2('0x76')]?_['replace'](_0x1f34aa[_0x160c95[_0x2741d8][_0x33e2('0x76')]],'%s',_0xabc62e):_0xabc62e;if(_0x160c95[_0x2741d8][_0x33e2('0x77')]){_0x5835fc[_0x33e2('0x78')](_0xabc62e);}_0x160c95[_0x2741d8][_0x33e2('0x79')]&&_0x5835fc['order'](_0xabc62e,_0x160c95[_0x2741d8][_0x33e2('0x79')]===_0x33e2('0x7a')?![]:!![]);_0x5835fc[_0x33e2('0x68')](_0xabc62e,_0x160c95[_0x2741d8][_0x33e2('0x7b')]||_0xabc62e);}if(_0x2e52e1[_0x33e2('0x7c')]){_0x2e52e1[_0x33e2('0x7c')]=JSON[_0x33e2('0x7d')](_0x2e52e1[_0x33e2('0x7c')]);for(var _0x2c8c94=0x0;_0x2c8c94<_0x2e52e1['joins'][_0x33e2('0x39')];_0x2c8c94+=0x1){if(_0x2e52e1[_0x33e2('0x7c')][_0x2c8c94][_0x33e2('0x30')]&&_[_0x33e2('0x7e')](_0x1e692c,_0x2e52e1[_0x33e2('0x7c')][_0x2c8c94][_0x33e2('0x30')])&&_0x2e52e1[_0x33e2('0x7c')][_0x2c8c94][_0x33e2('0x7f')]&&_0x2e52e1[_0x33e2('0x7c')][_0x2c8c94]['foreignTable']&&_0x2e52e1[_0x33e2('0x7c')][_0x2c8c94]['foreignKey']){_0x5835fc[_0x2e52e1[_0x33e2('0x7c')][_0x2c8c94][_0x33e2('0x30')]](_0x2e52e1[_0x33e2('0x7c')][_0x2c8c94]['foreignTable'],null,util[_0x33e2('0x76')](_0x33e2('0x80'),_0x2e52e1[_0x33e2('0x71')],_0x2e52e1['joins'][_0x2c8c94]['parentKey'],_0x2e52e1[_0x33e2('0x7c')][_0x2c8c94][_0x33e2('0x81')],_0x2e52e1[_0x33e2('0x7c')][_0x2c8c94][_0x33e2('0x82')]));}}}if(_0x2e52e1[_0x33e2('0x83')]){_0x2e52e1[_0x33e2('0x83')]=JSON[_0x33e2('0x7d')](_0x2e52e1[_0x33e2('0x83')]);_0x5835fc['where'](_0x24404e(_0x2e52e1[_0x33e2('0x83')][_0x33e2('0x78')]));}_0x448eea=_0x5835fc[_0x33e2('0x84')]();_0x5835fc[_0x33e2('0x1e')](_0x1aa602);_0x5835fc[_0x33e2('0x1b')](0x0);logger[_0x33e2('0x85')]('Limited\x20Query:',_0x5835fc[_0x33e2('0x86')]());return dbH[_0x33e2('0x87')][_0x33e2('0x33')](_0x5835fc[_0x33e2('0x86')](),{'type':dbH[_0x33e2('0x87')][_0x33e2('0x88')][_0x33e2('0x89')]});}})[_0x33e2('0x25')](respondWithResult(_0x37fce5,null))[_0x33e2('0x48')](handleError(_0x37fce5,null));};function runReport(_0x2edf3d,_0x3c4075,_0x49304b){var _0x51e3d1=_0x3c4075[_0x33e2('0x2a')];var _0xc3b39a=0xa;var _0x52fe95=[_0x33e2('0x56'),'left_join',_0x33e2('0x8a'),_0x33e2('0x8b')];var _0x10964d={'SUM':_0x33e2('0x8c'),'COUNT':_0x33e2('0x58'),'COUNT DISTINCT':_0x33e2('0x59'),'MAX':'MAX(%s)','MIN':_0x33e2('0x5b'),'AVG':'AVG(%s)','GROUP_CONCAT':_0x33e2('0x5c'),'GROUP_CONCAT ASC':_0x33e2('0x5d'),'GROUP_CONCAT DESC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)'};var _0x13ecee={'SEC_TO_TIME':'SEC_TO_TIME(%s)','DATE':_0x33e2('0x8d'),'HOUR':'HOUR(%s)','ROUND':_0x33e2('0x61'),'UNIX_TIMESTAMP':'UNIX_TIMESTAMP(%s)'};var _0x291510=function(_0x3ebfea){return!_['includes']([_0x33e2('0x8e'),_0x33e2('0x63'),_0x33e2('0x64'),'IS\x20NOT\x20EMPTY'],_0x3ebfea);};var _0x5ec08f=function(_0x45acab){if(!_0x45acab||!_0x45acab[_0x33e2('0x66')]['length']){return'';}for(var _0x1ddb13='(',_0x35609f=0x0;_0x35609f<_0x45acab[_0x33e2('0x66')]['length'];_0x35609f+=0x1){_0x35609f>0x0&&(_0x1ddb13+='\x20'+_0x45acab[_0x33e2('0x67')]+'\x20');_0x1ddb13+=_0x45acab[_0x33e2('0x66')][_0x35609f][_0x33e2('0x78')]?_0x5ec08f(_0x45acab['rules'][_0x35609f][_0x33e2('0x78')]):_0x45acab[_0x33e2('0x66')][_0x35609f]['field']+'\x20'+_0x45acab[_0x33e2('0x66')][_0x35609f][_0x33e2('0x69')]+(_0x291510(_0x45acab[_0x33e2('0x66')][_0x35609f]['condition'])?'\x20'+_0x45acab[_0x33e2('0x66')][_0x35609f][_0x33e2('0x8f')]:'');}return _0x1ddb13+')';};var _0x49bb54={'where':{'id':_0x2edf3d['id']}},_0x228c8f,_0x571a5b,_0x4318cb,_0x2316f1,_0x37cefe;_0x49bb54=_['merge']({},_0x49bb54,_0x49304b);return db[_0x33e2('0x2d')][_0x33e2('0x50')](_0x49bb54)[_0x33e2('0x25')](function(_0x1d15e1){if(_0x1d15e1){_0x228c8f=_0x1d15e1;return _0x1d15e1[_0x33e2('0x90')]();}return null;})['then'](function(_0x1e1f5a){if(_0x1e1f5a){if(!_0x1e1f5a[_0x33e2('0x39')]){throw new db[(_0x33e2('0x6a'))][(_0x33e2('0x6b'))](_0x33e2('0x6c'),0x193);}_0x571a5b=_0x1e1f5a;return db[_0x33e2('0x6d')][_0x33e2('0x44')]({'raw':!![]});}return null;})[_0x33e2('0x25')](function(_0xbd56d3){if(_0xbd56d3){_0x4318cb=_[_0x33e2('0x6e')](_0xbd56d3,'id');var _0x3084b3;var _0x48fe8f=squel[_0x33e2('0x6f')]();_0x48fe8f[_0x33e2('0x70')](_0x228c8f[_0x33e2('0x71')]);for(var _0x3d5e0a=0x0;_0x3d5e0a<_0x571a5b[_0x33e2('0x39')];_0x3d5e0a+=0x1){_0x3084b3=_0x571a5b[_0x3d5e0a][_0x33e2('0x72')]?_0x4318cb[_0x571a5b[_0x3d5e0a]['MetricId']][_0x33e2('0x73')]:_0x571a5b[_0x3d5e0a][_0x33e2('0x68')];_0x3084b3=_0x571a5b[_0x3d5e0a][_0x33e2('0x75')]?_[_0x33e2('0x74')](_0x10964d[_0x571a5b[_0x3d5e0a][_0x33e2('0x75')]],'%s',_0x3084b3):_0x3084b3;_0x3084b3=_0x571a5b[_0x3d5e0a][_0x33e2('0x76')]?_[_0x33e2('0x74')](_0x13ecee[_0x571a5b[_0x3d5e0a][_0x33e2('0x76')]],'%s',_0x3084b3):_0x3084b3;if(_0x571a5b[_0x3d5e0a][_0x33e2('0x77')]){_0x48fe8f[_0x33e2('0x78')](_0x3084b3);}_0x571a5b[_0x3d5e0a]['orderBy']&&_0x48fe8f['order'](_0x3084b3,_0x571a5b[_0x3d5e0a][_0x33e2('0x79')]===_0x33e2('0x7a')?![]:!![]);_0x48fe8f['field'](_0x3084b3,_0x571a5b[_0x3d5e0a]['alias']||_0x3084b3);}if(_0x228c8f[_0x33e2('0x7c')]){_0x228c8f[_0x33e2('0x7c')]=JSON[_0x33e2('0x7d')](_0x228c8f[_0x33e2('0x7c')]);for(var _0x27aef6=0x0;_0x27aef6<_0x228c8f['joins'][_0x33e2('0x39')];_0x27aef6+=0x1){if(_0x228c8f[_0x33e2('0x7c')][_0x27aef6][_0x33e2('0x30')]&&_[_0x33e2('0x7e')](_0x52fe95,_0x228c8f['joins'][_0x27aef6][_0x33e2('0x30')])&&_0x228c8f[_0x33e2('0x7c')][_0x27aef6][_0x33e2('0x7f')]&&_0x228c8f[_0x33e2('0x7c')][_0x27aef6][_0x33e2('0x81')]&&_0x228c8f[_0x33e2('0x7c')][_0x27aef6][_0x33e2('0x82')]){_0x48fe8f[_0x228c8f[_0x33e2('0x7c')][_0x27aef6]['type']](_0x228c8f[_0x33e2('0x7c')][_0x27aef6]['foreignTable'],null,util['format'](_0x33e2('0x80'),_0x228c8f[_0x33e2('0x71')],_0x228c8f[_0x33e2('0x7c')][_0x27aef6][_0x33e2('0x7f')],_0x228c8f[_0x33e2('0x7c')][_0x27aef6][_0x33e2('0x81')],_0x228c8f[_0x33e2('0x7c')][_0x27aef6][_0x33e2('0x82')]));}}}if(_0x228c8f[_0x33e2('0x83')]){_0x228c8f[_0x33e2('0x83')]=JSON['parse'](_0x228c8f[_0x33e2('0x83')]);_0x48fe8f[_0x33e2('0x3c')](_0x5ec08f(_0x228c8f[_0x33e2('0x83')][_0x33e2('0x78')]));}_0x37cefe=_0x48fe8f[_0x33e2('0x84')]();_0x48fe8f[_0x33e2('0x1e')](_0xc3b39a);_0x48fe8f[_0x33e2('0x1b')](0x0);return;}})[_0x33e2('0x25')](function(){if(_0x3c4075[_0x33e2('0x91')]===_0x33e2('0x92')){return null;}var _0x48c4c0=_[_0x33e2('0x3f')](_0x3c4075,{'name':_0x3c4075[_0x33e2('0x93')]||_0x3c4075[_0x33e2('0x2a')]||_0x228c8f[_0x33e2('0x2a')],'basename':_0x51e3d1,'savename':util[_0x33e2('0x76')](_0x33e2('0x94'),_0x3c4075[_0x33e2('0x2a')]||_0x228c8f[_0x33e2('0x2a')],require(_0x33e2('0x95'))[_0x33e2('0x96')](0x4),_0x3c4075[_0x33e2('0x91')]||'csv'),'reportId':_0x228c8f['id'],'reportType':_0x33e2('0x97')});return db['AnalyticExtractedReport'][_0x33e2('0x49')](_0x48c4c0,{'raw':!![]});})[_0x33e2('0x25')](function(_0x4504f3){if(_0x228c8f[_0x33e2('0x71')]===_0x33e2('0x98')){_0x37cefe[_0x33e2('0x3c')](_0x228c8f[_0x33e2('0x71')]+_0x33e2('0x99'),_0x3c4075[_0x33e2('0x9a')],_0x3c4075[_0x33e2('0x9b')]);}else{_0x37cefe[_0x33e2('0x3c')](_0x228c8f[_0x33e2('0x71')]+'.createdAt\x20BETWEEN\x20?\x20AND\x20?',_0x3c4075['startDate'],_0x3c4075['endDate']);}if(_0x4504f3){logger[_0x33e2('0x9c')](_0x33e2('0x9d'),_0x37cefe['toString']());require(_0x33e2('0x9e'))[_0x33e2('0x9f')](path['join'](__dirname,_0x33e2('0xa0'),_0x4504f3[_0x33e2('0x91')]),[_0x4504f3['id'],_0x37cefe[_0x33e2('0x86')](),path[_0x33e2('0x56')](__dirname,'../../files/reports',_0x4504f3['savename']),_0x51e3d1]);return _0x4504f3;}else{var _0x5abe34=squel[_0x33e2('0x6f')]();_0x5abe34[_0x33e2('0x70')]('('+_0x37cefe[_0x33e2('0x86')]()+')',_0x33e2('0xa1'));_0x5abe34[_0x33e2('0x68')](_0x33e2('0xa2'),_0x33e2('0x1d'));_0x37cefe[_0x33e2('0x1e')](_0x3c4075['limit']||_0xc3b39a);_0x37cefe[_0x33e2('0x1b')](_0x3c4075['offset']||0x0);return dbH['sequelize'][_0x33e2('0x33')](_0x5abe34['toString'](),{'type':dbH[_0x33e2('0x87')][_0x33e2('0x88')][_0x33e2('0x89')]})['then'](function(_0x16e1ef){if(!_0x16e1ef[_0x33e2('0x39')]){_0x2316f1=0x0;}else{_0x2316f1=_0x16e1ef[0x0][_0x33e2('0x1d')]||0x0;}return dbH[_0x33e2('0x87')]['query'](_0x37cefe[_0x33e2('0x86')](),{'type':dbH['sequelize'][_0x33e2('0x88')][_0x33e2('0x89')]});})[_0x33e2('0x25')](function(_0x284085){return{'rows':_0x284085||[],'count':_0x2316f1};});}});}exports[_0x33e2('0xa3')]=function(_0x812f4f,_0x3a0dc5){return runReport(_0x812f4f[_0x33e2('0x47')],_0x812f4f['query'],_0x812f4f['options'])[_0x33e2('0x25')](respondWithResult(_0x3a0dc5,null))['catch'](handleError(_0x3a0dc5,null));};exports['runReport']=runReport;exports[_0x33e2('0x33')]=function(_0x39a69e,_0x21c283){var _0x48a7cd=0xa;var _0x49ac83=['join',_0x33e2('0x57'),_0x33e2('0x8a'),_0x33e2('0x8b')];var _0x192f0f={'SUM':_0x33e2('0x8c'),'COUNT':'COUNT(%s)','COUNT DISTINCT':_0x33e2('0x59'),'MAX':_0x33e2('0x5a'),'MIN':_0x33e2('0x5b'),'AVG':_0x33e2('0xa4'),'GROUP_CONCAT':_0x33e2('0x5c'),'GROUP_CONCAT ASC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT DESC':_0x33e2('0x5e')};var _0xb494f3={'SEC_TO_TIME':_0x33e2('0x5f'),'DATE':_0x33e2('0x8d'),'HOUR':_0x33e2('0x60'),'ROUND':_0x33e2('0x61'),'UNIX_TIMESTAMP':_0x33e2('0x62')};var _0x2552bd=function(_0x7fb861){return!_[_0x33e2('0x7e')]([_0x33e2('0x8e'),_0x33e2('0x63'),_0x33e2('0x64'),'IS\x20NOT\x20EMPTY'],_0x7fb861);};var _0x5d56e8=function(_0x4327d8){if(!_0x4327d8||!_0x4327d8[_0x33e2('0x66')][_0x33e2('0x39')]){return'';}for(var _0x4d906d='(',_0x17e810=0x0;_0x17e810<_0x4327d8[_0x33e2('0x66')][_0x33e2('0x39')];_0x17e810+=0x1){_0x17e810>0x0&&(_0x4d906d+='\x20'+_0x4327d8[_0x33e2('0x67')]+'\x20');_0x4d906d+=_0x4327d8['rules'][_0x17e810]['group']?_0x5d56e8(_0x4327d8['rules'][_0x17e810][_0x33e2('0x78')]):_0x4327d8[_0x33e2('0x66')][_0x17e810][_0x33e2('0x68')]+'\x20'+_0x4327d8[_0x33e2('0x66')][_0x17e810][_0x33e2('0x69')]+(_0x2552bd(_0x4327d8[_0x33e2('0x66')][_0x17e810][_0x33e2('0x69')])?'\x20'+_0x4327d8[_0x33e2('0x66')][_0x17e810][_0x33e2('0x8f')]:'');}return _0x4d906d+')';};var _0x199ebf={'where':{'id':_0x39a69e[_0x33e2('0x47')]['id']}},_0x19f269,_0x5192f9,_0x2db2b3,_0x81b465,_0x4318bb;_0x199ebf=_[_0x33e2('0x3f')]({},_0x199ebf,_0x39a69e[_0x33e2('0x42')]);return db[_0x33e2('0x2d')][_0x33e2('0x50')](_0x199ebf)[_0x33e2('0x25')](function(_0x3d898a){if(_0x3d898a){_0x19f269=_0x3d898a;return _0x3d898a[_0x33e2('0x90')]();}return null;})[_0x33e2('0x25')](function(_0x4138cd){if(_0x4138cd){if(!_0x4138cd['length']){throw new db[(_0x33e2('0x6a'))][(_0x33e2('0x6b'))](_0x33e2('0x6c'),0x193);}_0x5192f9=_0x4138cd;return db[_0x33e2('0x6d')][_0x33e2('0x44')]({'raw':!![]});}return null;})[_0x33e2('0x25')](function(_0x1b2b6e){if(_0x1b2b6e){_0x2db2b3=_['keyBy'](_0x1b2b6e,'id');var _0x2ff199;var _0x1b1268=squel[_0x33e2('0x6f')]();_0x1b1268[_0x33e2('0x70')](_0x19f269[_0x33e2('0x71')]);for(var _0x3f87b8=0x0;_0x3f87b8<_0x5192f9[_0x33e2('0x39')];_0x3f87b8+=0x1){_0x2ff199=_0x5192f9[_0x3f87b8][_0x33e2('0x72')]?_0x2db2b3[_0x5192f9[_0x3f87b8]['MetricId']][_0x33e2('0x73')]:_0x5192f9[_0x3f87b8][_0x33e2('0x68')];_0x2ff199=_0x5192f9[_0x3f87b8][_0x33e2('0x75')]?_[_0x33e2('0x74')](_0x192f0f[_0x5192f9[_0x3f87b8][_0x33e2('0x75')]],'%s',_0x2ff199):_0x2ff199;_0x2ff199=_0x5192f9[_0x3f87b8][_0x33e2('0x76')]?_[_0x33e2('0x74')](_0xb494f3[_0x5192f9[_0x3f87b8][_0x33e2('0x76')]],'%s',_0x2ff199):_0x2ff199;if(_0x5192f9[_0x3f87b8]['groupBy']){_0x1b1268[_0x33e2('0x78')](_0x2ff199);}_0x5192f9[_0x3f87b8]['orderBy']&&_0x1b1268['order'](_0x2ff199,_0x5192f9[_0x3f87b8][_0x33e2('0x79')]===_0x33e2('0x7a')?![]:!![]);_0x1b1268['field'](_0x2ff199,_0x5192f9[_0x3f87b8][_0x33e2('0x7b')]||_0x2ff199);}if(_0x19f269[_0x33e2('0x7c')]){_0x19f269['joins']=JSON[_0x33e2('0x7d')](_0x19f269[_0x33e2('0x7c')]);for(var _0x587582=0x0;_0x587582<_0x19f269[_0x33e2('0x7c')][_0x33e2('0x39')];_0x587582+=0x1){if(_0x19f269[_0x33e2('0x7c')][_0x587582]['type']&&_[_0x33e2('0x7e')](_0x49ac83,_0x19f269['joins'][_0x587582][_0x33e2('0x30')])&&_0x19f269[_0x33e2('0x7c')][_0x587582][_0x33e2('0x7f')]&&_0x19f269[_0x33e2('0x7c')][_0x587582][_0x33e2('0x81')]&&_0x19f269[_0x33e2('0x7c')][_0x587582][_0x33e2('0x82')]){_0x1b1268[_0x19f269['joins'][_0x587582][_0x33e2('0x30')]](_0x19f269[_0x33e2('0x7c')][_0x587582]['foreignTable'],null,util[_0x33e2('0x76')](_0x33e2('0x80'),_0x19f269['table'],_0x19f269[_0x33e2('0x7c')][_0x587582][_0x33e2('0x7f')],_0x19f269[_0x33e2('0x7c')][_0x587582][_0x33e2('0x81')],_0x19f269[_0x33e2('0x7c')][_0x587582][_0x33e2('0x82')]));}}}if(_0x19f269[_0x33e2('0x83')]){_0x19f269[_0x33e2('0x83')]=JSON['parse'](_0x19f269[_0x33e2('0x83')]);_0x1b1268[_0x33e2('0x3c')](_0x5d56e8(_0x19f269[_0x33e2('0x83')][_0x33e2('0x78')]));}_0x4318bb=_0x1b1268['clone']();_0x1b1268[_0x33e2('0x1e')](_0x48a7cd);_0x1b1268[_0x33e2('0x1b')](0x0);logger[_0x33e2('0x85')](_0x33e2('0xa5'),_0x1b1268[_0x33e2('0x86')]());return dbH[_0x33e2('0x87')][_0x33e2('0x33')](_0x1b1268[_0x33e2('0x86')](),{'type':dbH[_0x33e2('0x87')][_0x33e2('0x88')]['SELECT']});}})['then'](function(){return{'sql':_0x4318bb[_0x33e2('0x86')]()};})[_0x33e2('0x25')](respondWithResult(_0x21c283,null))[_0x33e2('0x48')](handleError(_0x21c283,null));};
\ No newline at end of file
diff --git a/server/api/analyticCustomReport/analyticCustomReport.model.js b/server/api/analyticCustomReport/analyticCustomReport.model.js
index 65d5630..af78096 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 _0xc5cd=['rimraf','./analyticCustomReport.attributes','exports','AnalyticCustomReport','analytics_custom_reports','lodash','../../config/logger','api','moment','bluebird','request-promise','path'];(function(_0xfae23b,_0x2be4ba){var _0x200640=function(_0x4ae258){while(--_0x4ae258){_0xfae23b['push'](_0xfae23b['shift']());}};_0x200640(++_0x2be4ba);}(_0xc5cd,0x185));var _0xdc5c=function(_0x1bee7a,_0xacfa2a){_0x1bee7a=_0x1bee7a-0x0;var _0x5d69d7=_0xc5cd[_0x1bee7a];return _0x5d69d7;};'use strict';var _=require(_0xdc5c('0x0'));var util=require('util');var logger=require(_0xdc5c('0x1'))(_0xdc5c('0x2'));var moment=require(_0xdc5c('0x3'));var BPromise=require(_0xdc5c('0x4'));var rp=require(_0xdc5c('0x5'));var fs=require('fs');var path=require(_0xdc5c('0x6'));var rimraf=require(_0xdc5c('0x7'));var config=require('../../config/environment');var attributes=require(_0xdc5c('0x8'));module[_0xdc5c('0x9')]=function(_0x224ce6,_0x24f44f){return _0x224ce6['define'](_0xdc5c('0xa'),attributes,{'tableName':_0xdc5c('0xb'),'paranoid':!![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x7d81=['util','api','moment','bluebird','request-promise','path','rimraf','define','AnalyticCustomReport','analytics_custom_reports','lodash'];(function(_0x4ae180,_0x42793f){var _0x361241=function(_0x4b884d){while(--_0x4b884d){_0x4ae180['push'](_0x4ae180['shift']());}};_0x361241(++_0x42793f);}(_0x7d81,0x6d));var _0x17d8=function(_0x14f555,_0x1e3f48){_0x14f555=_0x14f555-0x0;var _0x371ec1=_0x7d81[_0x14f555];return _0x371ec1;};'use strict';var _=require(_0x17d8('0x0'));var util=require(_0x17d8('0x1'));var logger=require('../../config/logger')(_0x17d8('0x2'));var moment=require(_0x17d8('0x3'));var BPromise=require(_0x17d8('0x4'));var rp=require(_0x17d8('0x5'));var fs=require('fs');var path=require(_0x17d8('0x6'));var rimraf=require(_0x17d8('0x7'));var config=require('../../config/environment');var attributes=require('./analyticCustomReport.attributes');module['exports']=function(_0x595f4d,_0xa92c8c){return _0x595f4d[_0x17d8('0x8')](_0x17d8('0x9'),attributes,{'tableName':_0x17d8('0xa'),'paranoid':!![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
diff --git a/server/api/analyticCustomReport/analyticCustomReport.rpc.js b/server/api/analyticCustomReport/analyticCustomReport.rpc.js
index 3c258d6..7024ed0 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 _0x2af6=['message','catch','lodash','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','jayson/promise','client','http','request','then','info','AnalyticCustomReport,\x20%s,\x20%s','request\x20sent','debug','AnalyticCustomReport,\x20%s,\x20%s,\x20%s','stringify','error','code'];(function(_0x24dbdf,_0x1857df){var _0x11af73=function(_0x4ce926){while(--_0x4ce926){_0x24dbdf['push'](_0x24dbdf['shift']());}};_0x11af73(++_0x1857df);}(_0x2af6,0x1e6));var _0x62af=function(_0x2f5e32,_0x3e2712){_0x2f5e32=_0x2f5e32-0x0;var _0x392a35=_0x2af6[_0x2f5e32];return _0x392a35;};'use strict';var _=require(_0x62af('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0x62af('0x1'));var rs=require(_0x62af('0x2'));var fs=require('fs');var Redis=require(_0x62af('0x3'));var db=require(_0x62af('0x4'))['db'];var utils=require(_0x62af('0x5'));var logger=require(_0x62af('0x6'))('rpc');var config=require('../../config/environment');var jayson=require(_0x62af('0x7'));var client=jayson[_0x62af('0x8')][_0x62af('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x53633b,_0x4247c3,_0x298ac4){return new BPromise(function(_0x3f7b97,_0x552562){return client[_0x62af('0xa')](_0x53633b,_0x298ac4)[_0x62af('0xb')](function(_0x186b8a){logger[_0x62af('0xc')](_0x62af('0xd'),_0x4247c3,_0x62af('0xe'));logger[_0x62af('0xf')](_0x62af('0x10'),_0x4247c3,'request\x20sent',JSON[_0x62af('0x11')](_0x186b8a));if(_0x186b8a['error']){if(_0x186b8a[_0x62af('0x12')][_0x62af('0x13')]===0x1f4){logger['error']('AnalyticCustomReport,\x20%s,\x20%s',_0x4247c3,_0x186b8a[_0x62af('0x12')][_0x62af('0x14')]);return _0x552562(_0x186b8a['error']['message']);}logger[_0x62af('0x12')](_0x62af('0xd'),_0x4247c3,_0x186b8a[_0x62af('0x12')][_0x62af('0x14')]);return _0x3f7b97(_0x186b8a[_0x62af('0x12')][_0x62af('0x14')]);}else{logger['info'](_0x62af('0xd'),_0x4247c3,_0x62af('0xe'));_0x3f7b97(_0x186b8a['result'][_0x62af('0x14')]);}})[_0x62af('0x15')](function(_0x5d4c7c){logger[_0x62af('0x12')](_0x62af('0xd'),_0x4247c3,_0x5d4c7c);_0x552562(_0x5d4c7c);});});}
\ No newline at end of file
+var _0x5ace=['util','randomstring','../../mysqldb','../../config/utils','rpc','client','http','request','then','info','debug','AnalyticCustomReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','AnalyticCustomReport,\x20%s,\x20%s','request\x20sent','result','catch','lodash'];(function(_0x410e39,_0x53b28b){var _0x14208c=function(_0x12118d){while(--_0x12118d){_0x410e39['push'](_0x410e39['shift']());}};_0x14208c(++_0x53b28b);}(_0x5ace,0x1e2));var _0xe5ac=function(_0x199bc4,_0x338105){_0x199bc4=_0x199bc4-0x0;var _0x136ffb=_0x5ace[_0x199bc4];return _0x136ffb;};'use strict';var _=require(_0xe5ac('0x0'));var util=require(_0xe5ac('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0xe5ac('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xe5ac('0x3'))['db'];var utils=require(_0xe5ac('0x4'));var logger=require('../../config/logger')(_0xe5ac('0x5'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0xe5ac('0x6')][_0xe5ac('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x30aeb1,_0x186d8d,_0x37af1c){return new BPromise(function(_0x35ce29,_0x14105e){return client[_0xe5ac('0x8')](_0x30aeb1,_0x37af1c)[_0xe5ac('0x9')](function(_0x53cce0){logger[_0xe5ac('0xa')]('AnalyticCustomReport,\x20%s,\x20%s',_0x186d8d,'request\x20sent');logger[_0xe5ac('0xb')](_0xe5ac('0xc'),_0x186d8d,'request\x20sent',JSON[_0xe5ac('0xd')](_0x53cce0));if(_0x53cce0['error']){if(_0x53cce0[_0xe5ac('0xe')][_0xe5ac('0xf')]===0x1f4){logger[_0xe5ac('0xe')]('AnalyticCustomReport,\x20%s,\x20%s',_0x186d8d,_0x53cce0[_0xe5ac('0xe')][_0xe5ac('0x10')]);return _0x14105e(_0x53cce0[_0xe5ac('0xe')][_0xe5ac('0x10')]);}logger[_0xe5ac('0xe')](_0xe5ac('0x11'),_0x186d8d,_0x53cce0[_0xe5ac('0xe')]['message']);return _0x35ce29(_0x53cce0[_0xe5ac('0xe')][_0xe5ac('0x10')]);}else{logger[_0xe5ac('0xa')]('AnalyticCustomReport,\x20%s,\x20%s',_0x186d8d,_0xe5ac('0x12'));_0x35ce29(_0x53cce0[_0xe5ac('0x13')][_0xe5ac('0x10')]);}})[_0xe5ac('0x14')](function(_0x4dceb4){logger['error'](_0xe5ac('0x11'),_0x186d8d,_0x4dceb4);_0x14105e(_0x4dceb4);});});}
\ No newline at end of file
diff --git a/server/api/analyticCustomReport/index.js b/server/api/analyticCustomReport/index.js
index c772c9d..0049ce4 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 _0x1658=['./analyticCustomReport.controller','get','isAuthenticated','/:id','show','/:id/preview','preview','/:id/run','query','post','create','put','delete','exports','multer','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment'];(function(_0xcad728,_0x13b7ab){var _0x3502a1=function(_0x57d777){while(--_0x57d777){_0xcad728['push'](_0xcad728['shift']());}};_0x3502a1(++_0x13b7ab);}(_0x1658,0x1f2));var _0x8165=function(_0x47f7fd,_0x4d350f){_0x47f7fd=_0x47f7fd-0x0;var _0x45ecc6=_0x1658[_0x47f7fd];return _0x45ecc6;};'use strict';var multer=require(_0x8165('0x0'));var util=require('util');var path=require(_0x8165('0x1'));var timeout=require(_0x8165('0x2'));var express=require(_0x8165('0x3'));var router=express[_0x8165('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x8165('0x5'));var interaction=require(_0x8165('0x6'));var config=require(_0x8165('0x7'));var controller=require(_0x8165('0x8'));router[_0x8165('0x9')]('/',auth[_0x8165('0xa')](),controller['index']);router[_0x8165('0x9')](_0x8165('0xb'),auth['isAuthenticated'](),controller[_0x8165('0xc')]);router[_0x8165('0x9')](_0x8165('0xd'),auth['isAuthenticated'](),controller[_0x8165('0xe')]);router[_0x8165('0x9')](_0x8165('0xf'),auth[_0x8165('0xa')](),controller['run']);router['get']('/:id/query',auth['isAuthenticated'](),controller[_0x8165('0x10')]);router[_0x8165('0x11')]('/',auth[_0x8165('0xa')](),controller[_0x8165('0x12')]);router[_0x8165('0x13')](_0x8165('0xb'),auth[_0x8165('0xa')](),controller['update']);router[_0x8165('0x14')]('/:id',auth['isAuthenticated'](),controller['destroy']);module[_0x8165('0x15')]=router;
\ No newline at end of file
+var _0x99c5=['get','index','show','/:id/preview','isAuthenticated','preview','/:id/run','run','/:id/query','query','post','create','/:id','update','delete','destroy','exports','multer','util','Router','../../config/environment','./analyticCustomReport.controller'];(function(_0x367895,_0x59a6c5){var _0x842b67=function(_0x6b8bc0){while(--_0x6b8bc0){_0x367895['push'](_0x367895['shift']());}};_0x842b67(++_0x59a6c5);}(_0x99c5,0x12f));var _0x599c=function(_0x436a2,_0x4d0382){_0x436a2=_0x436a2-0x0;var _0x3fb9c9=_0x99c5[_0x436a2];return _0x3fb9c9;};'use strict';var multer=require(_0x599c('0x0'));var util=require(_0x599c('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require('express');var router=express[_0x599c('0x2')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x599c('0x3'));var controller=require(_0x599c('0x4'));router[_0x599c('0x5')]('/',auth['isAuthenticated'](),controller[_0x599c('0x6')]);router[_0x599c('0x5')]('/:id',auth['isAuthenticated'](),controller[_0x599c('0x7')]);router[_0x599c('0x5')](_0x599c('0x8'),auth[_0x599c('0x9')](),controller[_0x599c('0xa')]);router[_0x599c('0x5')](_0x599c('0xb'),auth[_0x599c('0x9')](),controller[_0x599c('0xc')]);router[_0x599c('0x5')](_0x599c('0xd'),auth['isAuthenticated'](),controller[_0x599c('0xe')]);router[_0x599c('0xf')]('/',auth['isAuthenticated'](),controller[_0x599c('0x10')]);router['put'](_0x599c('0x11'),auth[_0x599c('0x9')](),controller[_0x599c('0x12')]);router[_0x599c('0x13')]('/:id',auth['isAuthenticated'](),controller[_0x599c('0x14')]);module[_0x599c('0x15')]=router;
\ No newline at end of file
diff --git a/server/api/analyticDefaultReport/analyticDefaultReport.attributes.js b/server/api/analyticDefaultReport/analyticDefaultReport.attributes.js
index 3ebc4f0..701f957 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 _0x1cb9=['TEXT','sequelize','STRING'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x1cb9,0x14e));var _0x91cb=function(_0x215ea5,_0x3d3eb2){_0x215ea5=_0x215ea5-0x0;var _0x7a1c01=_0x1cb9[_0x215ea5];return _0x7a1c01;};'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 _0x5fc3=['sequelize','exports','STRING','TEXT'];(function(_0x54e4fc,_0x1d8c7f){var _0x13bd1c=function(_0x28a915){while(--_0x28a915){_0x54e4fc['push'](_0x54e4fc['shift']());}};_0x13bd1c(++_0x1d8c7f);}(_0x5fc3,0xa8));var _0x35fc=function(_0x1afabf,_0x56fdcc){_0x1afabf=_0x1afabf-0x0;var _0x497ff1=_0x5fc3[_0x1afabf];return _0x497ff1;};'use strict';var Sequelize=require(_0x35fc('0x0'));module[_0x35fc('0x1')]={'name':{'type':Sequelize['STRING'],'allowNull':![]},'description':{'type':Sequelize[_0x35fc('0x2')]},'parent':{'type':Sequelize[_0x35fc('0x2')]},'table':{'type':Sequelize[_0x35fc('0x2')]},'conditions':{'type':Sequelize[_0x35fc('0x3')]},'joins':{'type':Sequelize[_0x35fc('0x3')]}};
\ No newline at end of file
diff --git a/server/api/analyticDefaultReport/analyticDefaultReport.controller.js b/server/api/analyticDefaultReport/analyticDefaultReport.controller.js
index de74a03..5a23288 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 _0x814b=['attributes','intersection','length','nolimit','limit','order','where','filter','merge','options','includeAll','findAll','catch','show','params','rawAttributes','fields','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','Reports','preview','join','cross_join','SUM(%s)','COUNT(%s)','COUNT(DISTINCT\x20%s)','MIN(%s)','GROUP_CONCAT(%s)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)','SEC_TO_TIME(%s)','DATE(%s)','HOUR(%s)','ROUND(%s)','UNIX_TIMESTAMP(%s)','includes','IS\x20NULL','IS\x20NOT\x20NULL','IS\x20EMPTY','IS\x20NOT\x20EMPTY','rules','group','field','condition','getFields','ValidationErrorItem','Please\x20insert\x20at\x20least\x20one\x20field','AnalyticMetric','select','table','MetricId','metric','replace','function','format','orderBy','DESC','alias','joins','parse','parentKey','foreignTable','foreignKey','conditions','clone','debug','Limited\x20Query:','toString','sequelize','QueryTypes','left_join','right_join','MAX(%s)','operator','value','Sequelize','keyBy','from','groupBy','%s.%s\x20=\x20%s.%s','output','web','fullPath','csv','default','AnalyticExtractedReport','cdr','startDate','endDate','.createdAt\x20BETWEEN\x20?\x20AND\x20?','info','Run\x20Query:','child_process','fork','../../components/export/','../../files/reports','SELECT','run','runReport','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','sox','to-csv','ejs','lodash','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/license/util','../../mysqldb','dbH','sendStatus','status','end','json','offset','undefined','count','set','Content-Range','apply','reject','save','then','destroy','get','DefaultReports','UserProfileResource','error','name','send','map','AnalyticDefaultReport','fieldName','type','model','query','keys','filters'];(function(_0x21d627,_0x4e52f9){var _0x2f3d99=function(_0x2589c0){while(--_0x2589c0){_0x21d627['push'](_0x21d627['shift']());}};_0x2f3d99(++_0x4e52f9);}(_0x814b,0x1a2));var _0xb814=function(_0x3e9ef3,_0x21a7e4){_0x3e9ef3=_0x3e9ef3-0x0;var _0x333748=_0x814b[_0x3e9ef3];return _0x333748;};'use strict';var emlformat=require(_0xb814('0x0'));var rimraf=require(_0xb814('0x1'));var zipdir=require(_0xb814('0x2'));var jsonpatch=require(_0xb814('0x3'));var rp=require(_0xb814('0x4'));var moment=require(_0xb814('0x5'));var BPromise=require('bluebird');var Mustache=require(_0xb814('0x6'));var util=require(_0xb814('0x7'));var path=require(_0xb814('0x8'));var sox=require(_0xb814('0x9'));var csv=require(_0xb814('0xa'));var ejs=require(_0xb814('0xb'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xb814('0xc'));var squel=require(_0xb814('0xd'));var crypto=require('crypto');var jsforce=require(_0xb814('0xe'));var deskjs=require(_0xb814('0xf'));var toCsv=require(_0xb814('0xa'));var querystring=require(_0xb814('0x10'));var Papa=require(_0xb814('0x11'));var Redis=require(_0xb814('0x12'));var authService=require(_0xb814('0x13'));var qs=require(_0xb814('0x14'));var as=require(_0xb814('0x15'));var hardwareService=require(_0xb814('0x16'));var logger=require(_0xb814('0x17'))('api');var utils=require(_0xb814('0x18'));var config=require('../../config/environment');var licenseUtil=require(_0xb814('0x19'));var db=require(_0xb814('0x1a'))['db'];var dbH=require(_0xb814('0x1a'))[_0xb814('0x1b')];function respondWithStatusCode(_0x2ce718,_0x3bde14){_0x3bde14=_0x3bde14||0xcc;return function(_0x1438e7){if(_0x1438e7){return _0x2ce718[_0xb814('0x1c')](_0x3bde14);}return _0x2ce718[_0xb814('0x1d')](_0x3bde14)[_0xb814('0x1e')]();};}function respondWithResult(_0x3f4881,_0x44fb96){_0x44fb96=_0x44fb96||0xc8;return function(_0x17f5bd){if(_0x17f5bd){return _0x3f4881[_0xb814('0x1d')](_0x44fb96)[_0xb814('0x1f')](_0x17f5bd);}};}function respondWithFilteredResult(_0x3a71d6,_0x45e0d0){return function(_0x265a83){if(_0x265a83){var _0x125ce2=typeof _0x45e0d0[_0xb814('0x20')]===_0xb814('0x21')&&typeof _0x45e0d0['limit']===_0xb814('0x21');var _0x55ba16=_0x265a83[_0xb814('0x22')];var _0xfac75b=_0x125ce2?0x0:_0x45e0d0['offset'];var _0x4b55a7=_0x125ce2?_0x265a83['count']:_0x45e0d0[_0xb814('0x20')]+_0x45e0d0['limit'];var _0x57c128;if(_0x4b55a7>=_0x55ba16){_0x4b55a7=_0x55ba16;_0x57c128=0xc8;}else{_0x57c128=0xce;}_0x3a71d6[_0xb814('0x1d')](_0x57c128);return _0x3a71d6[_0xb814('0x23')](_0xb814('0x24'),_0xfac75b+'-'+_0x4b55a7+'/'+_0x55ba16)['json'](_0x265a83);}return null;};}function patchUpdates(_0xf5b8aa){return function(_0x531032){try{jsonpatch[_0xb814('0x25')](_0x531032,_0xf5b8aa,!![]);}catch(_0x1808a3){return BPromise[_0xb814('0x26')](_0x1808a3);}return _0x531032[_0xb814('0x27')]();};}function saveUpdates(_0x27352e,_0x2bd039){return function(_0x1f5d40){if(_0x1f5d40){return _0x1f5d40['update'](_0x27352e)[_0xb814('0x28')](function(_0x52b7a3){return _0x52b7a3;});}return null;};}function removeEntity(_0x3f81d0,_0x457dac){return function(_0x31c7ec){if(_0x31c7ec){return _0x31c7ec[_0xb814('0x29')]()[_0xb814('0x28')](function(){var _0xb9e57d=_0x31c7ec[_0xb814('0x2a')]({'plain':!![]});var _0x5755ea=_0xb814('0x2b');return db[_0xb814('0x2c')][_0xb814('0x29')]({'where':{'type':_0x5755ea,'resourceId':_0xb9e57d['id']}})[_0xb814('0x28')](function(){return _0x31c7ec;});})[_0xb814('0x28')](function(){_0x3f81d0[_0xb814('0x1d')](0xcc)[_0xb814('0x1e')]();});}};}function handleEntityNotFound(_0x1e4e89,_0x5a6291){return function(_0x271aa8){if(!_0x271aa8){_0x1e4e89[_0xb814('0x1c')](0x194);}return _0x271aa8;};}function handleError(_0x52ed64,_0x9008b2){_0x9008b2=_0x9008b2||0x1f4;return function(_0x37d24d){logger[_0xb814('0x2d')](_0x37d24d['stack']);if(_0x37d24d[_0xb814('0x2e')]){delete _0x37d24d[_0xb814('0x2e')];}_0x52ed64['status'](_0x9008b2)[_0xb814('0x2f')](_0x37d24d);};}exports['index']=function(_0x6efe9a,_0x5f3e9b){var _0x4cfc58={},_0x419cd9={},_0x4a4f27={'count':0x0,'rows':[]};var _0x2431e2=_[_0xb814('0x30')](db[_0xb814('0x31')]['rawAttributes'],function(_0x51d5ae){return{'name':_0x51d5ae[_0xb814('0x32')],'type':_0x51d5ae[_0xb814('0x33')]['key']};});_0x419cd9[_0xb814('0x34')]=_[_0xb814('0x30')](_0x2431e2,_0xb814('0x2e'));_0x419cd9[_0xb814('0x35')]=_[_0xb814('0x36')](_0x6efe9a[_0xb814('0x35')]);_0x419cd9[_0xb814('0x37')]=_['intersection'](_0x419cd9[_0xb814('0x34')],_0x419cd9[_0xb814('0x35')]);_0x4cfc58[_0xb814('0x38')]=_[_0xb814('0x39')](_0x419cd9[_0xb814('0x34')],qs['fields'](_0x6efe9a[_0xb814('0x35')]['fields']));_0x4cfc58[_0xb814('0x38')]=_0x4cfc58[_0xb814('0x38')][_0xb814('0x3a')]?_0x4cfc58['attributes']:_0x419cd9[_0xb814('0x34')];if(!_0x6efe9a[_0xb814('0x35')]['hasOwnProperty'](_0xb814('0x3b'))){_0x4cfc58[_0xb814('0x3c')]=qs[_0xb814('0x3c')](_0x6efe9a[_0xb814('0x35')][_0xb814('0x3c')]);_0x4cfc58[_0xb814('0x20')]=qs['offset'](_0x6efe9a[_0xb814('0x35')]['offset']);}_0x4cfc58[_0xb814('0x3d')]=qs['sort'](_0x6efe9a[_0xb814('0x35')]['sort']);_0x4cfc58[_0xb814('0x3e')]=qs[_0xb814('0x37')](_['pick'](_0x6efe9a['query'],_0x419cd9['filters']),_0x2431e2);if(_0x6efe9a['query'][_0xb814('0x3f')]){_0x4cfc58[_0xb814('0x3e')]=_[_0xb814('0x40')](_0x4cfc58[_0xb814('0x3e')],{'$or':_['map'](_0x2431e2,function(_0x47d782){if(_0x47d782[_0xb814('0x33')]!=='VIRTUAL'){var _0x2a93da={};_0x2a93da[_0x47d782[_0xb814('0x2e')]]={'$like':'%'+_0x6efe9a[_0xb814('0x35')][_0xb814('0x3f')]+'%'};return _0x2a93da;}})});}_0x4cfc58=_[_0xb814('0x40')]({},_0x4cfc58,_0x6efe9a[_0xb814('0x41')]);var _0x3b7f5a={'where':_0x4cfc58[_0xb814('0x3e')]};return db[_0xb814('0x31')]['count'](_0x3b7f5a)['then'](function(_0x5d26be){_0x4a4f27[_0xb814('0x22')]=_0x5d26be;if(_0x6efe9a['query'][_0xb814('0x42')]){_0x4cfc58['include']=[{'all':!![]}];}return db[_0xb814('0x31')][_0xb814('0x43')](_0x4cfc58);})[_0xb814('0x28')](function(_0x2e97cc){_0x4a4f27['rows']=_0x2e97cc;return _0x4a4f27;})[_0xb814('0x28')](respondWithFilteredResult(_0x5f3e9b,_0x4cfc58))[_0xb814('0x44')](handleError(_0x5f3e9b,null));};exports[_0xb814('0x45')]=function(_0x22cf27,_0x7d92aa){var _0x450a08={'raw':!![],'where':{'id':_0x22cf27[_0xb814('0x46')]['id']}},_0x534eb8={};_0x534eb8[_0xb814('0x34')]=_[_0xb814('0x36')](db[_0xb814('0x31')][_0xb814('0x47')]);_0x534eb8[_0xb814('0x35')]=_[_0xb814('0x36')](_0x22cf27['query']);_0x534eb8['filters']=_[_0xb814('0x39')](_0x534eb8[_0xb814('0x34')],_0x534eb8[_0xb814('0x35')]);_0x450a08[_0xb814('0x38')]=_[_0xb814('0x39')](_0x534eb8[_0xb814('0x34')],qs[_0xb814('0x48')](_0x22cf27[_0xb814('0x35')][_0xb814('0x48')]));_0x450a08[_0xb814('0x38')]=_0x450a08[_0xb814('0x38')]['length']?_0x450a08[_0xb814('0x38')]:_0x534eb8[_0xb814('0x34')];if(_0x22cf27['query'][_0xb814('0x42')]){_0x450a08['include']=[{'all':!![]}];}_0x450a08=_[_0xb814('0x40')]({},_0x450a08,_0x22cf27[_0xb814('0x41')]);return db[_0xb814('0x31')][_0xb814('0x49')](_0x450a08)[_0xb814('0x28')](handleEntityNotFound(_0x7d92aa,null))[_0xb814('0x28')](respondWithResult(_0x7d92aa,null))[_0xb814('0x44')](handleError(_0x7d92aa,null));};exports[_0xb814('0x4a')]=function(_0x32a397,_0x2a422a){return db['AnalyticDefaultReport']['create'](_0x32a397[_0xb814('0x4b')],{})[_0xb814('0x28')](function(_0x4156d8){var _0x3f8e29=_0x32a397[_0xb814('0x4c')][_0xb814('0x2a')]({'plain':!![]});if(!_0x3f8e29)throw new Error(_0xb814('0x4d'));if(_0x3f8e29['role']===_0xb814('0x4c')){var _0x388324=_0x4156d8[_0xb814('0x2a')]({'plain':!![]});var _0x5a916d=_0xb814('0x4e');return db['UserProfileSection'][_0xb814('0x49')]({'where':{'name':_0x5a916d,'userProfileId':_0x3f8e29['userProfileId']},'raw':!![]})[_0xb814('0x28')](function(_0x3cf8f8){if(_0x3cf8f8&&_0x3cf8f8['autoAssociation']===0x0){return db[_0xb814('0x2c')][_0xb814('0x4a')]({'name':_0x388324[_0xb814('0x2e')],'resourceId':_0x388324['id'],'type':'DefaultReports','sectionId':_0x3cf8f8['id']},{})[_0xb814('0x28')](function(){return _0x4156d8;});}else{return _0x4156d8;}})['catch'](function(_0x13bdcf){logger[_0xb814('0x2d')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x13bdcf);throw _0x13bdcf;});}return _0x4156d8;})[_0xb814('0x28')](respondWithResult(_0x2a422a,0xc9))['catch'](handleError(_0x2a422a,null));};exports['update']=function(_0x3b9709,_0x35f59a){if(_0x3b9709[_0xb814('0x4b')]['id']){delete _0x3b9709['body']['id'];}return db[_0xb814('0x31')]['find']({'where':{'id':_0x3b9709[_0xb814('0x46')]['id']}})[_0xb814('0x28')](handleEntityNotFound(_0x35f59a,null))['then'](saveUpdates(_0x3b9709[_0xb814('0x4b')],null))['then'](respondWithResult(_0x35f59a,null))[_0xb814('0x44')](handleError(_0x35f59a,null));};exports[_0xb814('0x29')]=function(_0xb2bd82,_0x113fe5){return db[_0xb814('0x31')][_0xb814('0x49')]({'where':{'id':_0xb2bd82[_0xb814('0x46')]['id']}})[_0xb814('0x28')](handleEntityNotFound(_0x113fe5,null))['then'](removeEntity(_0x113fe5,null))[_0xb814('0x44')](handleError(_0x113fe5,null));};exports[_0xb814('0x4f')]=function(_0x5d71d5,_0x29a127){var _0xe14249=0xa;var _0x4d13db=[_0xb814('0x50'),'left_join','right_join',_0xb814('0x51')];var _0x5257be={'SUM':_0xb814('0x52'),'COUNT':_0xb814('0x53'),'COUNT DISTINCT':_0xb814('0x54'),'MAX':'MAX(%s)','MIN':_0xb814('0x55'),'AVG':'AVG(%s)','GROUP_CONCAT':_0xb814('0x56'),'GROUP_CONCAT ASC':_0xb814('0x57'),'GROUP_CONCAT DESC':_0xb814('0x58')};var _0x176585={'SEC_TO_TIME':_0xb814('0x59'),'DATE':_0xb814('0x5a'),'HOUR':_0xb814('0x5b'),'ROUND':_0xb814('0x5c'),'UNIX_TIMESTAMP':_0xb814('0x5d')};var _0x4d611d=function(_0x211194){return!_[_0xb814('0x5e')]([_0xb814('0x5f'),_0xb814('0x60'),_0xb814('0x61'),_0xb814('0x62')],_0x211194);};var _0x52edfa=function(_0x135e13){if(!_0x135e13||!_0x135e13['rules'][_0xb814('0x3a')]){return'';}for(var _0x39b754='(',_0xac95cf=0x0;_0xac95cf<_0x135e13['rules'][_0xb814('0x3a')];_0xac95cf+=0x1){_0xac95cf>0x0&&(_0x39b754+='\x20'+_0x135e13['operator']+'\x20');_0x39b754+=_0x135e13[_0xb814('0x63')][_0xac95cf]['group']?_0x52edfa(_0x135e13[_0xb814('0x63')][_0xac95cf][_0xb814('0x64')]):_0x135e13[_0xb814('0x63')][_0xac95cf][_0xb814('0x65')]+'\x20'+_0x135e13[_0xb814('0x63')][_0xac95cf][_0xb814('0x66')]+(_0x4d611d(_0x135e13[_0xb814('0x63')][_0xac95cf]['condition'])?'\x20'+_0x135e13[_0xb814('0x63')][_0xac95cf]['value']:'');}return _0x39b754+')';};var _0x255047={'where':{'id':_0x5d71d5['params']['id']}},_0x22c73f,_0x1b989d,_0x3dcaeb,_0x19fa45,_0x139531;_0x255047=_[_0xb814('0x40')]({},_0x255047,_0x5d71d5[_0xb814('0x41')]);return db['AnalyticDefaultReport'][_0xb814('0x49')](_0x255047)[_0xb814('0x28')](function(_0x263699){if(_0x263699){_0x22c73f=_0x263699;return _0x263699[_0xb814('0x67')]();}return null;})[_0xb814('0x28')](function(_0x51d834){if(_0x51d834){if(!_0x51d834[_0xb814('0x3a')]){throw new db['Sequelize'][(_0xb814('0x68'))](_0xb814('0x69'),0x193);}_0x1b989d=_0x51d834;return db[_0xb814('0x6a')][_0xb814('0x43')]({'raw':!![]});}return null;})[_0xb814('0x28')](function(_0x41bcaf){if(_0x41bcaf){_0x3dcaeb=_['keyBy'](_0x41bcaf,'id');var _0x506bf2;var _0x5d064b=squel[_0xb814('0x6b')]();_0x5d064b['from'](_0x22c73f[_0xb814('0x6c')]);for(var _0x1d3954=0x0;_0x1d3954<_0x1b989d[_0xb814('0x3a')];_0x1d3954+=0x1){_0x506bf2=_0x1b989d[_0x1d3954]['MetricId']?_0x3dcaeb[_0x1b989d[_0x1d3954][_0xb814('0x6d')]][_0xb814('0x6e')]:_0x1b989d[_0x1d3954][_0xb814('0x65')];_0x506bf2=_0x1b989d[_0x1d3954]['function']?_[_0xb814('0x6f')](_0x5257be[_0x1b989d[_0x1d3954][_0xb814('0x70')]],'%s',_0x506bf2):_0x506bf2;_0x506bf2=_0x1b989d[_0x1d3954][_0xb814('0x71')]?_[_0xb814('0x6f')](_0x176585[_0x1b989d[_0x1d3954]['format']],'%s',_0x506bf2):_0x506bf2;if(_0x1b989d[_0x1d3954]['groupBy']){_0x5d064b[_0xb814('0x64')](_0x506bf2);}_0x1b989d[_0x1d3954][_0xb814('0x72')]&&_0x5d064b[_0xb814('0x3d')](_0x506bf2,_0x1b989d[_0x1d3954][_0xb814('0x72')]===_0xb814('0x73')?![]:!![]);_0x5d064b[_0xb814('0x65')](_0x506bf2,_0x1b989d[_0x1d3954][_0xb814('0x74')]||_0x506bf2);}if(_0x22c73f[_0xb814('0x75')]){_0x22c73f[_0xb814('0x75')]=JSON[_0xb814('0x76')](_0x22c73f[_0xb814('0x75')]);for(var _0x226b0e=0x0;_0x226b0e<_0x22c73f[_0xb814('0x75')][_0xb814('0x3a')];_0x226b0e+=0x1){if(_0x22c73f[_0xb814('0x75')][_0x226b0e]['type']&&_[_0xb814('0x5e')](_0x4d13db,_0x22c73f[_0xb814('0x75')][_0x226b0e][_0xb814('0x33')])&&_0x22c73f[_0xb814('0x75')][_0x226b0e][_0xb814('0x77')]&&_0x22c73f[_0xb814('0x75')][_0x226b0e]['foreignTable']&&_0x22c73f[_0xb814('0x75')][_0x226b0e]['foreignKey']){_0x5d064b[_0x22c73f[_0xb814('0x75')][_0x226b0e][_0xb814('0x33')]](_0x22c73f[_0xb814('0x75')][_0x226b0e][_0xb814('0x78')],null,util[_0xb814('0x71')]('%s.%s\x20=\x20%s.%s',_0x22c73f['table'],_0x22c73f[_0xb814('0x75')][_0x226b0e][_0xb814('0x77')],_0x22c73f[_0xb814('0x75')][_0x226b0e][_0xb814('0x78')],_0x22c73f['joins'][_0x226b0e][_0xb814('0x79')]));}}}if(_0x22c73f['conditions']){_0x22c73f[_0xb814('0x7a')]=JSON[_0xb814('0x76')](_0x22c73f['conditions']);_0x5d064b['where'](_0x52edfa(_0x22c73f[_0xb814('0x7a')]['group']));}_0x139531=_0x5d064b[_0xb814('0x7b')]();_0x5d064b[_0xb814('0x3c')](_0xe14249);_0x5d064b[_0xb814('0x20')](0x0);logger[_0xb814('0x7c')](_0xb814('0x7d'),_0x5d064b[_0xb814('0x7e')]());return dbH[_0xb814('0x7f')]['query'](_0x5d064b[_0xb814('0x7e')](),{'type':dbH['sequelize'][_0xb814('0x80')]['SELECT']});}})[_0xb814('0x28')](respondWithResult(_0x29a127,null))[_0xb814('0x44')](handleError(_0x29a127,null));};function runReport(_0x58d56c,_0x10a90d,_0x583f26){var _0x37adec=_0x10a90d[_0xb814('0x2e')];var _0x4e15c2=0xa;var _0x5a0c4a=[_0xb814('0x50'),_0xb814('0x81'),_0xb814('0x82'),_0xb814('0x51')];var _0x220f8b={'SUM':_0xb814('0x52'),'COUNT':_0xb814('0x53'),'COUNT DISTINCT':_0xb814('0x54'),'MAX':_0xb814('0x83'),'MIN':_0xb814('0x55'),'AVG':'AVG(%s)','GROUP_CONCAT':'GROUP_CONCAT(%s)','GROUP_CONCAT ASC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT DESC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)'};var _0x52b6da={'SEC_TO_TIME':_0xb814('0x59'),'DATE':_0xb814('0x5a'),'HOUR':_0xb814('0x5b'),'ROUND':'ROUND(%s)','UNIX_TIMESTAMP':_0xb814('0x5d')};var _0x1fb1ea=function(_0x31c072){return!_[_0xb814('0x5e')]([_0xb814('0x5f'),_0xb814('0x60'),_0xb814('0x61'),_0xb814('0x62')],_0x31c072);};var _0x5cf5ad=function(_0x20efc3){if(!_0x20efc3||!_0x20efc3[_0xb814('0x63')][_0xb814('0x3a')]){return'';}for(var _0x30faa0='(',_0x55ceb8=0x0;_0x55ceb8<_0x20efc3[_0xb814('0x63')][_0xb814('0x3a')];_0x55ceb8+=0x1){_0x55ceb8>0x0&&(_0x30faa0+='\x20'+_0x20efc3[_0xb814('0x84')]+'\x20');_0x30faa0+=_0x20efc3[_0xb814('0x63')][_0x55ceb8][_0xb814('0x64')]?_0x5cf5ad(_0x20efc3['rules'][_0x55ceb8]['group']):_0x20efc3[_0xb814('0x63')][_0x55ceb8]['field']+'\x20'+_0x20efc3[_0xb814('0x63')][_0x55ceb8][_0xb814('0x66')]+(_0x1fb1ea(_0x20efc3['rules'][_0x55ceb8][_0xb814('0x66')])?'\x20'+_0x20efc3['rules'][_0x55ceb8][_0xb814('0x85')]:'');}return _0x30faa0+')';};var _0x520d0f={'where':{'id':_0x58d56c['id']}},_0x44e668,_0x1aff2b,_0x41867b,_0x2c3948,_0x2d8899;_0x520d0f=_[_0xb814('0x40')]({},_0x520d0f,_0x583f26);return db[_0xb814('0x31')]['find'](_0x520d0f)['then'](function(_0x21aa36){if(_0x21aa36){_0x44e668=_0x21aa36;return _0x21aa36['getFields']();}return null;})['then'](function(_0x2d0061){if(_0x2d0061){if(!_0x2d0061[_0xb814('0x3a')]){throw new db[(_0xb814('0x86'))]['ValidationErrorItem'](_0xb814('0x69'),0x193);}_0x1aff2b=_0x2d0061;return db['AnalyticMetric'][_0xb814('0x43')]({'raw':!![]});}return null;})[_0xb814('0x28')](function(_0x14ec54){if(_0x14ec54){_0x41867b=_[_0xb814('0x87')](_0x14ec54,'id');var _0x4c8a00;var _0x1454b3=squel[_0xb814('0x6b')]();_0x1454b3[_0xb814('0x88')](_0x44e668['table']);for(var _0x1ebbf6=0x0;_0x1ebbf6<_0x1aff2b[_0xb814('0x3a')];_0x1ebbf6+=0x1){_0x4c8a00=_0x1aff2b[_0x1ebbf6][_0xb814('0x6d')]?_0x41867b[_0x1aff2b[_0x1ebbf6]['MetricId']][_0xb814('0x6e')]:_0x1aff2b[_0x1ebbf6][_0xb814('0x65')];_0x4c8a00=_0x1aff2b[_0x1ebbf6][_0xb814('0x70')]?_[_0xb814('0x6f')](_0x220f8b[_0x1aff2b[_0x1ebbf6][_0xb814('0x70')]],'%s',_0x4c8a00):_0x4c8a00;_0x4c8a00=_0x1aff2b[_0x1ebbf6][_0xb814('0x71')]?_[_0xb814('0x6f')](_0x52b6da[_0x1aff2b[_0x1ebbf6][_0xb814('0x71')]],'%s',_0x4c8a00):_0x4c8a00;if(_0x1aff2b[_0x1ebbf6][_0xb814('0x89')]){_0x1454b3[_0xb814('0x64')](_0x4c8a00);}_0x1aff2b[_0x1ebbf6][_0xb814('0x72')]&&_0x1454b3[_0xb814('0x3d')](_0x4c8a00,_0x1aff2b[_0x1ebbf6][_0xb814('0x72')]==='DESC'?![]:!![]);_0x1454b3['field'](_0x4c8a00,_0x1aff2b[_0x1ebbf6][_0xb814('0x74')]||_0x4c8a00);}if(_0x44e668['joins']){_0x44e668[_0xb814('0x75')]=JSON[_0xb814('0x76')](_0x44e668[_0xb814('0x75')]);for(var _0x2bc95b=0x0;_0x2bc95b<_0x44e668[_0xb814('0x75')][_0xb814('0x3a')];_0x2bc95b+=0x1){if(_0x44e668[_0xb814('0x75')][_0x2bc95b]['type']&&_['includes'](_0x5a0c4a,_0x44e668[_0xb814('0x75')][_0x2bc95b]['type'])&&_0x44e668[_0xb814('0x75')][_0x2bc95b][_0xb814('0x77')]&&_0x44e668[_0xb814('0x75')][_0x2bc95b]['foreignTable']&&_0x44e668[_0xb814('0x75')][_0x2bc95b][_0xb814('0x79')]){_0x1454b3[_0x44e668[_0xb814('0x75')][_0x2bc95b][_0xb814('0x33')]](_0x44e668[_0xb814('0x75')][_0x2bc95b]['foreignTable'],null,util[_0xb814('0x71')](_0xb814('0x8a'),_0x44e668['table'],_0x44e668[_0xb814('0x75')][_0x2bc95b][_0xb814('0x77')],_0x44e668[_0xb814('0x75')][_0x2bc95b]['foreignTable'],_0x44e668[_0xb814('0x75')][_0x2bc95b][_0xb814('0x79')]));}}}if(_0x44e668['conditions']){_0x44e668[_0xb814('0x7a')]=JSON[_0xb814('0x76')](_0x44e668['conditions']);_0x1454b3[_0xb814('0x3e')](_0x5cf5ad(_0x44e668[_0xb814('0x7a')][_0xb814('0x64')]));}_0x2d8899=_0x1454b3[_0xb814('0x7b')]();_0x1454b3[_0xb814('0x3c')](_0x4e15c2);_0x1454b3[_0xb814('0x20')](0x0);return;}})[_0xb814('0x28')](function(){if(_0x10a90d[_0xb814('0x8b')]===_0xb814('0x8c')){return null;}var _0x1f8c7a=_[_0xb814('0x40')](_0x10a90d,{'name':_0x10a90d[_0xb814('0x8d')]||_0x10a90d['name']||_0x44e668['name'],'basename':_0x37adec,'savename':util[_0xb814('0x71')]('%s-%s.%s',_0x10a90d['name']||_0x44e668[_0xb814('0x2e')],require('randomstring')['generate'](0x4),_0x10a90d['output']||_0xb814('0x8e')),'reportId':_0x44e668['id'],'reportType':_0xb814('0x8f')});return db[_0xb814('0x90')]['create'](_0x1f8c7a,{'raw':!![]});})[_0xb814('0x28')](function(_0x4dbe89){if(_0x44e668[_0xb814('0x6c')]===_0xb814('0x91')){_0x2d8899['where'](_0x44e668[_0xb814('0x6c')]+'.calldate\x20BETWEEN\x20?\x20AND\x20?',_0x10a90d[_0xb814('0x92')],_0x10a90d[_0xb814('0x93')]);}else{_0x2d8899[_0xb814('0x3e')](_0x44e668[_0xb814('0x6c')]+_0xb814('0x94'),_0x10a90d[_0xb814('0x92')],_0x10a90d[_0xb814('0x93')]);}if(_0x4dbe89){logger[_0xb814('0x95')](_0xb814('0x96'),_0x2d8899[_0xb814('0x7e')]());require(_0xb814('0x97'))[_0xb814('0x98')](path[_0xb814('0x50')](__dirname,_0xb814('0x99'),_0x4dbe89[_0xb814('0x8b')]),[_0x4dbe89['id'],_0x2d8899['toString'](),path[_0xb814('0x50')](__dirname,_0xb814('0x9a'),_0x4dbe89['savename']),_0x37adec]);return _0x4dbe89;}else{var _0x2c7cd6=squel[_0xb814('0x6b')]();_0x2c7cd6[_0xb814('0x88')]('('+_0x2d8899['toString']()+')','countTable');_0x2c7cd6[_0xb814('0x65')]('COUNT(*)',_0xb814('0x22'));_0x2d8899['limit'](_0x10a90d[_0xb814('0x3c')]||_0x4e15c2);_0x2d8899['offset'](_0x10a90d['offset']||0x0);return dbH[_0xb814('0x7f')][_0xb814('0x35')](_0x2c7cd6[_0xb814('0x7e')](),{'type':dbH[_0xb814('0x7f')][_0xb814('0x80')][_0xb814('0x9b')]})[_0xb814('0x28')](function(_0x4543c3){if(!_0x4543c3[_0xb814('0x3a')]){_0x2c3948=0x0;}else{_0x2c3948=_0x4543c3[0x0][_0xb814('0x22')]||0x0;}return dbH[_0xb814('0x7f')]['query'](_0x2d8899[_0xb814('0x7e')](),{'type':dbH['sequelize'][_0xb814('0x80')][_0xb814('0x9b')]});})[_0xb814('0x28')](function(_0x4fde6a){return{'rows':_0x4fde6a||[],'count':_0x2c3948};});}});}exports[_0xb814('0x9c')]=function(_0x18fb74,_0x371e92){return runReport(_0x18fb74[_0xb814('0x46')],_0x18fb74[_0xb814('0x35')],_0x18fb74[_0xb814('0x41')])[_0xb814('0x28')](respondWithResult(_0x371e92,null))[_0xb814('0x44')](handleError(_0x371e92,null));};exports[_0xb814('0x9d')]=runReport;exports[_0xb814('0x35')]=function(_0x3b65c0,_0x11e0c3){var _0x22c811=0xa;var _0x3fd24c=[_0xb814('0x50'),'left_join',_0xb814('0x82'),_0xb814('0x51')];var _0x3e61eb={'SUM':'SUM(%s)','COUNT':'COUNT(%s)','COUNT DISTINCT':_0xb814('0x54'),'MAX':'MAX(%s)','MIN':'MIN(%s)','AVG':'AVG(%s)','GROUP_CONCAT':'GROUP_CONCAT(%s)','GROUP_CONCAT ASC':_0xb814('0x57'),'GROUP_CONCAT DESC':_0xb814('0x58')};var _0x5be0bb={'SEC_TO_TIME':_0xb814('0x59'),'DATE':_0xb814('0x5a'),'HOUR':_0xb814('0x5b'),'ROUND':_0xb814('0x5c'),'UNIX_TIMESTAMP':_0xb814('0x5d')};var _0x1bd9ab=function(_0x20e608){return!_[_0xb814('0x5e')]([_0xb814('0x5f'),_0xb814('0x60'),_0xb814('0x61'),'IS\x20NOT\x20EMPTY'],_0x20e608);};var _0x2a5dff=function(_0x553635){if(!_0x553635||!_0x553635[_0xb814('0x63')][_0xb814('0x3a')]){return'';}for(var _0x35e8f7='(',_0xa7ff62=0x0;_0xa7ff62<_0x553635[_0xb814('0x63')][_0xb814('0x3a')];_0xa7ff62+=0x1){_0xa7ff62>0x0&&(_0x35e8f7+='\x20'+_0x553635[_0xb814('0x84')]+'\x20');_0x35e8f7+=_0x553635[_0xb814('0x63')][_0xa7ff62]['group']?_0x2a5dff(_0x553635['rules'][_0xa7ff62]['group']):_0x553635[_0xb814('0x63')][_0xa7ff62][_0xb814('0x65')]+'\x20'+_0x553635[_0xb814('0x63')][_0xa7ff62][_0xb814('0x66')]+(_0x1bd9ab(_0x553635[_0xb814('0x63')][_0xa7ff62][_0xb814('0x66')])?'\x20'+_0x553635[_0xb814('0x63')][_0xa7ff62][_0xb814('0x85')]:'');}return _0x35e8f7+')';};var _0x41847e={'where':{'id':_0x3b65c0[_0xb814('0x46')]['id']}},_0x1a5685,_0x51313d,_0x5c989a,_0x41486b,_0x16c05b;_0x41847e=_[_0xb814('0x40')]({},_0x41847e,_0x3b65c0[_0xb814('0x41')]);return db[_0xb814('0x31')]['find'](_0x41847e)[_0xb814('0x28')](function(_0x52899a){if(_0x52899a){_0x1a5685=_0x52899a;return _0x52899a[_0xb814('0x67')]();}return null;})[_0xb814('0x28')](function(_0x205c6c){if(_0x205c6c){if(!_0x205c6c[_0xb814('0x3a')]){throw new db[(_0xb814('0x86'))][(_0xb814('0x68'))](_0xb814('0x69'),0x193);}_0x51313d=_0x205c6c;return db['AnalyticMetric'][_0xb814('0x43')]({'raw':!![]});}return null;})[_0xb814('0x28')](function(_0x1f04eb){if(_0x1f04eb){_0x5c989a=_[_0xb814('0x87')](_0x1f04eb,'id');var _0x4a1c4e;var _0x17c63b=squel[_0xb814('0x6b')]();_0x17c63b[_0xb814('0x88')](_0x1a5685[_0xb814('0x6c')]);for(var _0xa66ca3=0x0;_0xa66ca3<_0x51313d['length'];_0xa66ca3+=0x1){_0x4a1c4e=_0x51313d[_0xa66ca3][_0xb814('0x6d')]?_0x5c989a[_0x51313d[_0xa66ca3][_0xb814('0x6d')]][_0xb814('0x6e')]:_0x51313d[_0xa66ca3]['field'];_0x4a1c4e=_0x51313d[_0xa66ca3][_0xb814('0x70')]?_['replace'](_0x3e61eb[_0x51313d[_0xa66ca3][_0xb814('0x70')]],'%s',_0x4a1c4e):_0x4a1c4e;_0x4a1c4e=_0x51313d[_0xa66ca3]['format']?_[_0xb814('0x6f')](_0x5be0bb[_0x51313d[_0xa66ca3][_0xb814('0x71')]],'%s',_0x4a1c4e):_0x4a1c4e;if(_0x51313d[_0xa66ca3][_0xb814('0x89')]){_0x17c63b[_0xb814('0x64')](_0x4a1c4e);}_0x51313d[_0xa66ca3]['orderBy']&&_0x17c63b[_0xb814('0x3d')](_0x4a1c4e,_0x51313d[_0xa66ca3][_0xb814('0x72')]===_0xb814('0x73')?![]:!![]);_0x17c63b[_0xb814('0x65')](_0x4a1c4e,_0x51313d[_0xa66ca3][_0xb814('0x74')]||_0x4a1c4e);}if(_0x1a5685[_0xb814('0x75')]){_0x1a5685[_0xb814('0x75')]=JSON[_0xb814('0x76')](_0x1a5685[_0xb814('0x75')]);for(var _0x152260=0x0;_0x152260<_0x1a5685[_0xb814('0x75')][_0xb814('0x3a')];_0x152260+=0x1){if(_0x1a5685[_0xb814('0x75')][_0x152260][_0xb814('0x33')]&&_[_0xb814('0x5e')](_0x3fd24c,_0x1a5685['joins'][_0x152260][_0xb814('0x33')])&&_0x1a5685[_0xb814('0x75')][_0x152260][_0xb814('0x77')]&&_0x1a5685[_0xb814('0x75')][_0x152260][_0xb814('0x78')]&&_0x1a5685[_0xb814('0x75')][_0x152260]['foreignKey']){_0x17c63b[_0x1a5685[_0xb814('0x75')][_0x152260][_0xb814('0x33')]](_0x1a5685[_0xb814('0x75')][_0x152260][_0xb814('0x78')],null,util['format']('%s.%s\x20=\x20%s.%s',_0x1a5685[_0xb814('0x6c')],_0x1a5685[_0xb814('0x75')][_0x152260][_0xb814('0x77')],_0x1a5685[_0xb814('0x75')][_0x152260][_0xb814('0x78')],_0x1a5685[_0xb814('0x75')][_0x152260]['foreignKey']));}}}if(_0x1a5685[_0xb814('0x7a')]){_0x1a5685[_0xb814('0x7a')]=JSON[_0xb814('0x76')](_0x1a5685[_0xb814('0x7a')]);_0x17c63b['where'](_0x2a5dff(_0x1a5685[_0xb814('0x7a')][_0xb814('0x64')]));}_0x16c05b=_0x17c63b[_0xb814('0x7b')]();_0x17c63b[_0xb814('0x3c')](_0x22c811);_0x17c63b[_0xb814('0x20')](0x0);logger['debug'](_0xb814('0x7d'),_0x17c63b[_0xb814('0x7e')]());return dbH[_0xb814('0x7f')][_0xb814('0x35')](_0x17c63b[_0xb814('0x7e')](),{'type':dbH[_0xb814('0x7f')][_0xb814('0x80')][_0xb814('0x9b')]});}})[_0xb814('0x28')](function(){return{'sql':_0x16c05b[_0xb814('0x7e')]()};})[_0xb814('0x28')](respondWithResult(_0x11e0c3,null))[_0xb814('0x44')](handleError(_0x11e0c3,null));};
\ No newline at end of file
+var _0x31f0=['fullPath','%s-%s.%s','randomstring','generate','default','cdr','.calldate\x20BETWEEN\x20?\x20AND\x20?','startDate','endDate','.createdAt\x20BETWEEN\x20?\x20AND\x20?','info','child_process','../../components/export/','../../files/reports','countTable','COUNT(*)','run','runReport','DATE(%s)','keyBy','eml-format','zip-dir','request-promise','moment','bluebird','mustache','path','sox','lodash','crypto','jsforce','desk.js','to-csv','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','dbH','sendStatus','status','end','json','offset','undefined','count','limit','set','Content-Range','apply','save','then','get','DefaultReports','destroy','error','name','send','index','AnalyticDefaultReport','rawAttributes','fieldName','type','key','model','map','query','keys','filters','intersection','fields','attributes','hasOwnProperty','nolimit','order','sort','where','pick','merge','options','include','findAll','rows','catch','params','length','find','create','user','role','Reports','userProfileId','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','body','preview','join','left_join','right_join','SUM(%s)','COUNT(%s)','MAX(%s)','MIN(%s)','GROUP_CONCAT(%s)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)','UNIX_TIMESTAMP(%s)','includes','IS\x20NULL','IS\x20EMPTY','IS\x20NOT\x20EMPTY','rules','operator','group','condition','value','Sequelize','ValidationErrorItem','Please\x20insert\x20at\x20least\x20one\x20field','AnalyticMetric','select','from','table','function','replace','format','orderBy','DESC','field','alias','parse','joins','parentKey','foreignKey','%s.%s\x20=\x20%s.%s','foreignTable','conditions','clone','debug','Limited\x20Query:','toString','sequelize','QueryTypes','SELECT','cross_join','COUNT(DISTINCT\x20%s)','AVG(%s)','HOUR(%s)','ROUND(%s)','IS\x20NOT\x20NULL','getFields','MetricId','metric','groupBy','output','web'];(function(_0x56837e,_0x56f32b){var _0x55f545=function(_0x27d376){while(--_0x27d376){_0x56837e['push'](_0x56837e['shift']());}};_0x55f545(++_0x56f32b);}(_0x31f0,0xb7));var _0x031f=function(_0x2b0bcc,_0x1f8d23){_0x2b0bcc=_0x2b0bcc-0x0;var _0x116666=_0x31f0[_0x2b0bcc];return _0x116666;};'use strict';var emlformat=require(_0x031f('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x031f('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0x031f('0x2'));var moment=require(_0x031f('0x3'));var BPromise=require(_0x031f('0x4'));var Mustache=require(_0x031f('0x5'));var util=require('util');var path=require(_0x031f('0x6'));var sox=require(_0x031f('0x7'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x031f('0x8'));var squel=require('squel');var crypto=require(_0x031f('0x9'));var jsforce=require(_0x031f('0xa'));var deskjs=require(_0x031f('0xb'));var toCsv=require(_0x031f('0xc'));var querystring=require('querystring');var Papa=require(_0x031f('0xd'));var Redis=require(_0x031f('0xe'));var authService=require(_0x031f('0xf'));var qs=require(_0x031f('0x10'));var as=require(_0x031f('0x11'));var hardwareService=require(_0x031f('0x12'));var logger=require(_0x031f('0x13'))(_0x031f('0x14'));var utils=require('../../config/utils');var config=require(_0x031f('0x15'));var licenseUtil=require(_0x031f('0x16'));var db=require(_0x031f('0x17'))['db'];var dbH=require(_0x031f('0x17'))[_0x031f('0x18')];function respondWithStatusCode(_0x405896,_0x1c230d){_0x1c230d=_0x1c230d||0xcc;return function(_0x5d0457){if(_0x5d0457){return _0x405896[_0x031f('0x19')](_0x1c230d);}return _0x405896[_0x031f('0x1a')](_0x1c230d)[_0x031f('0x1b')]();};}function respondWithResult(_0x2e3dfe,_0x2ea549){_0x2ea549=_0x2ea549||0xc8;return function(_0x57f9c0){if(_0x57f9c0){return _0x2e3dfe['status'](_0x2ea549)[_0x031f('0x1c')](_0x57f9c0);}};}function respondWithFilteredResult(_0x3a10aa,_0xe4fc1d){return function(_0x286177){if(_0x286177){var _0x5196b1=typeof _0xe4fc1d[_0x031f('0x1d')]===_0x031f('0x1e')&&typeof _0xe4fc1d['limit']===_0x031f('0x1e');var _0x535e70=_0x286177[_0x031f('0x1f')];var _0x5f2199=_0x5196b1?0x0:_0xe4fc1d[_0x031f('0x1d')];var _0xaa155=_0x5196b1?_0x286177[_0x031f('0x1f')]:_0xe4fc1d[_0x031f('0x1d')]+_0xe4fc1d[_0x031f('0x20')];var _0x2825ef;if(_0xaa155>=_0x535e70){_0xaa155=_0x535e70;_0x2825ef=0xc8;}else{_0x2825ef=0xce;}_0x3a10aa[_0x031f('0x1a')](_0x2825ef);return _0x3a10aa[_0x031f('0x21')](_0x031f('0x22'),_0x5f2199+'-'+_0xaa155+'/'+_0x535e70)['json'](_0x286177);}return null;};}function patchUpdates(_0xf72793){return function(_0x33926c){try{jsonpatch[_0x031f('0x23')](_0x33926c,_0xf72793,!![]);}catch(_0x4d6706){return BPromise['reject'](_0x4d6706);}return _0x33926c[_0x031f('0x24')]();};}function saveUpdates(_0x4d0f92,_0x3472a2){return function(_0x57f6c4){if(_0x57f6c4){return _0x57f6c4['update'](_0x4d0f92)['then'](function(_0x971691){return _0x971691;});}return null;};}function removeEntity(_0x12c406,_0x2920cd){return function(_0x4c8126){if(_0x4c8126){return _0x4c8126['destroy']()[_0x031f('0x25')](function(){var _0x5a64c0=_0x4c8126[_0x031f('0x26')]({'plain':!![]});var _0x1f5a14=_0x031f('0x27');return db['UserProfileResource'][_0x031f('0x28')]({'where':{'type':_0x1f5a14,'resourceId':_0x5a64c0['id']}})[_0x031f('0x25')](function(){return _0x4c8126;});})['then'](function(){_0x12c406[_0x031f('0x1a')](0xcc)[_0x031f('0x1b')]();});}};}function handleEntityNotFound(_0x2403e9,_0x5395ea){return function(_0xa308b){if(!_0xa308b){_0x2403e9[_0x031f('0x19')](0x194);}return _0xa308b;};}function handleError(_0xb6ed6c,_0xaf5bea){_0xaf5bea=_0xaf5bea||0x1f4;return function(_0xfaa36){logger[_0x031f('0x29')](_0xfaa36['stack']);if(_0xfaa36[_0x031f('0x2a')]){delete _0xfaa36[_0x031f('0x2a')];}_0xb6ed6c[_0x031f('0x1a')](_0xaf5bea)[_0x031f('0x2b')](_0xfaa36);};}exports[_0x031f('0x2c')]=function(_0x2d24f0,_0x378692){var _0x87dc07={},_0x2034ac={},_0xfc4a89={'count':0x0,'rows':[]};var _0x2cf3a8=_['map'](db[_0x031f('0x2d')][_0x031f('0x2e')],function(_0xb3a6bd){return{'name':_0xb3a6bd[_0x031f('0x2f')],'type':_0xb3a6bd[_0x031f('0x30')][_0x031f('0x31')]};});_0x2034ac[_0x031f('0x32')]=_[_0x031f('0x33')](_0x2cf3a8,_0x031f('0x2a'));_0x2034ac[_0x031f('0x34')]=_[_0x031f('0x35')](_0x2d24f0[_0x031f('0x34')]);_0x2034ac[_0x031f('0x36')]=_['intersection'](_0x2034ac[_0x031f('0x32')],_0x2034ac[_0x031f('0x34')]);_0x87dc07['attributes']=_[_0x031f('0x37')](_0x2034ac[_0x031f('0x32')],qs['fields'](_0x2d24f0[_0x031f('0x34')][_0x031f('0x38')]));_0x87dc07[_0x031f('0x39')]=_0x87dc07[_0x031f('0x39')]['length']?_0x87dc07['attributes']:_0x2034ac[_0x031f('0x32')];if(!_0x2d24f0['query'][_0x031f('0x3a')](_0x031f('0x3b'))){_0x87dc07[_0x031f('0x20')]=qs['limit'](_0x2d24f0['query'][_0x031f('0x20')]);_0x87dc07['offset']=qs['offset'](_0x2d24f0[_0x031f('0x34')][_0x031f('0x1d')]);}_0x87dc07[_0x031f('0x3c')]=qs[_0x031f('0x3d')](_0x2d24f0[_0x031f('0x34')][_0x031f('0x3d')]);_0x87dc07[_0x031f('0x3e')]=qs['filters'](_[_0x031f('0x3f')](_0x2d24f0[_0x031f('0x34')],_0x2034ac[_0x031f('0x36')]),_0x2cf3a8);if(_0x2d24f0[_0x031f('0x34')]['filter']){_0x87dc07[_0x031f('0x3e')]=_[_0x031f('0x40')](_0x87dc07[_0x031f('0x3e')],{'$or':_['map'](_0x2cf3a8,function(_0x24ec95){if(_0x24ec95[_0x031f('0x30')]!=='VIRTUAL'){var _0x36bafa={};_0x36bafa[_0x24ec95[_0x031f('0x2a')]]={'$like':'%'+_0x2d24f0['query']['filter']+'%'};return _0x36bafa;}})});}_0x87dc07=_[_0x031f('0x40')]({},_0x87dc07,_0x2d24f0[_0x031f('0x41')]);var _0x9efbc4={'where':_0x87dc07[_0x031f('0x3e')]};return db[_0x031f('0x2d')][_0x031f('0x1f')](_0x9efbc4)[_0x031f('0x25')](function(_0x5a212c){_0xfc4a89[_0x031f('0x1f')]=_0x5a212c;if(_0x2d24f0[_0x031f('0x34')]['includeAll']){_0x87dc07[_0x031f('0x42')]=[{'all':!![]}];}return db['AnalyticDefaultReport'][_0x031f('0x43')](_0x87dc07);})[_0x031f('0x25')](function(_0x56dd24){_0xfc4a89[_0x031f('0x44')]=_0x56dd24;return _0xfc4a89;})[_0x031f('0x25')](respondWithFilteredResult(_0x378692,_0x87dc07))[_0x031f('0x45')](handleError(_0x378692,null));};exports['show']=function(_0x98747f,_0x213e1c){var _0x1d3324={'raw':!![],'where':{'id':_0x98747f[_0x031f('0x46')]['id']}},_0x2a6cba={};_0x2a6cba[_0x031f('0x32')]=_[_0x031f('0x35')](db[_0x031f('0x2d')][_0x031f('0x2e')]);_0x2a6cba['query']=_[_0x031f('0x35')](_0x98747f[_0x031f('0x34')]);_0x2a6cba[_0x031f('0x36')]=_[_0x031f('0x37')](_0x2a6cba[_0x031f('0x32')],_0x2a6cba[_0x031f('0x34')]);_0x1d3324[_0x031f('0x39')]=_[_0x031f('0x37')](_0x2a6cba[_0x031f('0x32')],qs['fields'](_0x98747f[_0x031f('0x34')]['fields']));_0x1d3324['attributes']=_0x1d3324[_0x031f('0x39')][_0x031f('0x47')]?_0x1d3324[_0x031f('0x39')]:_0x2a6cba[_0x031f('0x32')];if(_0x98747f[_0x031f('0x34')]['includeAll']){_0x1d3324[_0x031f('0x42')]=[{'all':!![]}];}_0x1d3324=_[_0x031f('0x40')]({},_0x1d3324,_0x98747f[_0x031f('0x41')]);return db['AnalyticDefaultReport'][_0x031f('0x48')](_0x1d3324)[_0x031f('0x25')](handleEntityNotFound(_0x213e1c,null))[_0x031f('0x25')](respondWithResult(_0x213e1c,null))[_0x031f('0x45')](handleError(_0x213e1c,null));};exports[_0x031f('0x49')]=function(_0x12d28e,_0x5caeb5){return db['AnalyticDefaultReport'][_0x031f('0x49')](_0x12d28e['body'],{})[_0x031f('0x25')](function(_0x3bba44){var _0x5a29e0=_0x12d28e[_0x031f('0x4a')]['get']({'plain':!![]});if(!_0x5a29e0)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x5a29e0[_0x031f('0x4b')]==='user'){var _0x16bade=_0x3bba44['get']({'plain':!![]});var _0x11bf43=_0x031f('0x4c');return db['UserProfileSection'][_0x031f('0x48')]({'where':{'name':_0x11bf43,'userProfileId':_0x5a29e0[_0x031f('0x4d')]},'raw':!![]})['then'](function(_0x46471a){if(_0x46471a&&_0x46471a['autoAssociation']===0x0){return db[_0x031f('0x4e')]['create']({'name':_0x16bade[_0x031f('0x2a')],'resourceId':_0x16bade['id'],'type':_0x031f('0x27'),'sectionId':_0x46471a['id']},{})[_0x031f('0x25')](function(){return _0x3bba44;});}else{return _0x3bba44;}})[_0x031f('0x45')](function(_0x691a68){logger['error'](_0x031f('0x4f'),_0x691a68);throw _0x691a68;});}return _0x3bba44;})['then'](respondWithResult(_0x5caeb5,0xc9))[_0x031f('0x45')](handleError(_0x5caeb5,null));};exports[_0x031f('0x50')]=function(_0x4d49f8,_0x1f9c55){if(_0x4d49f8[_0x031f('0x51')]['id']){delete _0x4d49f8['body']['id'];}return db[_0x031f('0x2d')][_0x031f('0x48')]({'where':{'id':_0x4d49f8[_0x031f('0x46')]['id']}})['then'](handleEntityNotFound(_0x1f9c55,null))[_0x031f('0x25')](saveUpdates(_0x4d49f8['body'],null))[_0x031f('0x25')](respondWithResult(_0x1f9c55,null))['catch'](handleError(_0x1f9c55,null));};exports[_0x031f('0x28')]=function(_0x561a2b,_0xa52a54){return db[_0x031f('0x2d')]['find']({'where':{'id':_0x561a2b['params']['id']}})[_0x031f('0x25')](handleEntityNotFound(_0xa52a54,null))[_0x031f('0x25')](removeEntity(_0xa52a54,null))['catch'](handleError(_0xa52a54,null));};exports[_0x031f('0x52')]=function(_0xb44c73,_0x255003){var _0x286d4e=0xa;var _0x21a89d=[_0x031f('0x53'),_0x031f('0x54'),_0x031f('0x55'),'cross_join'];var _0xe452c2={'SUM':_0x031f('0x56'),'COUNT':_0x031f('0x57'),'COUNT DISTINCT':'COUNT(DISTINCT\x20%s)','MAX':_0x031f('0x58'),'MIN':_0x031f('0x59'),'AVG':'AVG(%s)','GROUP_CONCAT':_0x031f('0x5a'),'GROUP_CONCAT ASC':_0x031f('0x5b'),'GROUP_CONCAT DESC':_0x031f('0x5c')};var _0x198e2e={'SEC_TO_TIME':'SEC_TO_TIME(%s)','DATE':'DATE(%s)','HOUR':'HOUR(%s)','ROUND':'ROUND(%s)','UNIX_TIMESTAMP':_0x031f('0x5d')};var _0xcf8b7=function(_0x4a7fbb){return!_[_0x031f('0x5e')]([_0x031f('0x5f'),'IS\x20NOT\x20NULL',_0x031f('0x60'),_0x031f('0x61')],_0x4a7fbb);};var _0x451c71=function(_0x22d211){if(!_0x22d211||!_0x22d211[_0x031f('0x62')][_0x031f('0x47')]){return'';}for(var _0x2ddf15='(',_0x4527e5=0x0;_0x4527e5<_0x22d211[_0x031f('0x62')]['length'];_0x4527e5+=0x1){_0x4527e5>0x0&&(_0x2ddf15+='\x20'+_0x22d211[_0x031f('0x63')]+'\x20');_0x2ddf15+=_0x22d211['rules'][_0x4527e5][_0x031f('0x64')]?_0x451c71(_0x22d211[_0x031f('0x62')][_0x4527e5][_0x031f('0x64')]):_0x22d211['rules'][_0x4527e5]['field']+'\x20'+_0x22d211[_0x031f('0x62')][_0x4527e5][_0x031f('0x65')]+(_0xcf8b7(_0x22d211[_0x031f('0x62')][_0x4527e5][_0x031f('0x65')])?'\x20'+_0x22d211['rules'][_0x4527e5][_0x031f('0x66')]:'');}return _0x2ddf15+')';};var _0x5a181c={'where':{'id':_0xb44c73[_0x031f('0x46')]['id']}},_0x478982,_0x2179ee,_0x534bae,_0x50d618,_0x71e67;_0x5a181c=_[_0x031f('0x40')]({},_0x5a181c,_0xb44c73[_0x031f('0x41')]);return db[_0x031f('0x2d')]['find'](_0x5a181c)['then'](function(_0x214eec){if(_0x214eec){_0x478982=_0x214eec;return _0x214eec['getFields']();}return null;})[_0x031f('0x25')](function(_0xa921b2){if(_0xa921b2){if(!_0xa921b2['length']){throw new db[(_0x031f('0x67'))][(_0x031f('0x68'))](_0x031f('0x69'),0x193);}_0x2179ee=_0xa921b2;return db[_0x031f('0x6a')][_0x031f('0x43')]({'raw':!![]});}return null;})[_0x031f('0x25')](function(_0x5bea08){if(_0x5bea08){_0x534bae=_['keyBy'](_0x5bea08,'id');var _0x3bcc7e;var _0x232b62=squel[_0x031f('0x6b')]();_0x232b62[_0x031f('0x6c')](_0x478982[_0x031f('0x6d')]);for(var _0x26fa57=0x0;_0x26fa57<_0x2179ee[_0x031f('0x47')];_0x26fa57+=0x1){_0x3bcc7e=_0x2179ee[_0x26fa57]['MetricId']?_0x534bae[_0x2179ee[_0x26fa57]['MetricId']]['metric']:_0x2179ee[_0x26fa57]['field'];_0x3bcc7e=_0x2179ee[_0x26fa57][_0x031f('0x6e')]?_[_0x031f('0x6f')](_0xe452c2[_0x2179ee[_0x26fa57][_0x031f('0x6e')]],'%s',_0x3bcc7e):_0x3bcc7e;_0x3bcc7e=_0x2179ee[_0x26fa57]['format']?_[_0x031f('0x6f')](_0x198e2e[_0x2179ee[_0x26fa57][_0x031f('0x70')]],'%s',_0x3bcc7e):_0x3bcc7e;if(_0x2179ee[_0x26fa57]['groupBy']){_0x232b62[_0x031f('0x64')](_0x3bcc7e);}_0x2179ee[_0x26fa57][_0x031f('0x71')]&&_0x232b62[_0x031f('0x3c')](_0x3bcc7e,_0x2179ee[_0x26fa57][_0x031f('0x71')]===_0x031f('0x72')?![]:!![]);_0x232b62[_0x031f('0x73')](_0x3bcc7e,_0x2179ee[_0x26fa57][_0x031f('0x74')]||_0x3bcc7e);}if(_0x478982['joins']){_0x478982['joins']=JSON[_0x031f('0x75')](_0x478982['joins']);for(var _0x2ed9c1=0x0;_0x2ed9c1<_0x478982['joins'][_0x031f('0x47')];_0x2ed9c1+=0x1){if(_0x478982[_0x031f('0x76')][_0x2ed9c1][_0x031f('0x30')]&&_['includes'](_0x21a89d,_0x478982[_0x031f('0x76')][_0x2ed9c1]['type'])&&_0x478982[_0x031f('0x76')][_0x2ed9c1][_0x031f('0x77')]&&_0x478982[_0x031f('0x76')][_0x2ed9c1]['foreignTable']&&_0x478982[_0x031f('0x76')][_0x2ed9c1][_0x031f('0x78')]){_0x232b62[_0x478982[_0x031f('0x76')][_0x2ed9c1][_0x031f('0x30')]](_0x478982[_0x031f('0x76')][_0x2ed9c1]['foreignTable'],null,util['format'](_0x031f('0x79'),_0x478982[_0x031f('0x6d')],_0x478982['joins'][_0x2ed9c1][_0x031f('0x77')],_0x478982['joins'][_0x2ed9c1][_0x031f('0x7a')],_0x478982[_0x031f('0x76')][_0x2ed9c1][_0x031f('0x78')]));}}}if(_0x478982[_0x031f('0x7b')]){_0x478982['conditions']=JSON[_0x031f('0x75')](_0x478982[_0x031f('0x7b')]);_0x232b62[_0x031f('0x3e')](_0x451c71(_0x478982['conditions'][_0x031f('0x64')]));}_0x71e67=_0x232b62[_0x031f('0x7c')]();_0x232b62['limit'](_0x286d4e);_0x232b62[_0x031f('0x1d')](0x0);logger[_0x031f('0x7d')](_0x031f('0x7e'),_0x232b62[_0x031f('0x7f')]());return dbH[_0x031f('0x80')][_0x031f('0x34')](_0x232b62[_0x031f('0x7f')](),{'type':dbH['sequelize'][_0x031f('0x81')][_0x031f('0x82')]});}})[_0x031f('0x25')](respondWithResult(_0x255003,null))['catch'](handleError(_0x255003,null));};function runReport(_0x4f4aff,_0x26de7c,_0x5bd344){var _0x54f02d=_0x26de7c[_0x031f('0x2a')];var _0x184bbd=0xa;var _0x1c8055=[_0x031f('0x53'),_0x031f('0x54'),_0x031f('0x55'),_0x031f('0x83')];var _0x32c626={'SUM':_0x031f('0x56'),'COUNT':_0x031f('0x57'),'COUNT DISTINCT':_0x031f('0x84'),'MAX':'MAX(%s)','MIN':_0x031f('0x59'),'AVG':_0x031f('0x85'),'GROUP_CONCAT':_0x031f('0x5a'),'GROUP_CONCAT ASC':_0x031f('0x5b'),'GROUP_CONCAT DESC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)'};var _0x6970f5={'SEC_TO_TIME':'SEC_TO_TIME(%s)','DATE':'DATE(%s)','HOUR':_0x031f('0x86'),'ROUND':_0x031f('0x87'),'UNIX_TIMESTAMP':'UNIX_TIMESTAMP(%s)'};var _0x510bb6=function(_0x3cfaa4){return!_[_0x031f('0x5e')]([_0x031f('0x5f'),_0x031f('0x88'),_0x031f('0x60'),_0x031f('0x61')],_0x3cfaa4);};var _0x5e0853=function(_0x263658){if(!_0x263658||!_0x263658[_0x031f('0x62')]['length']){return'';}for(var _0x25ea89='(',_0x2f2e96=0x0;_0x2f2e96<_0x263658[_0x031f('0x62')][_0x031f('0x47')];_0x2f2e96+=0x1){_0x2f2e96>0x0&&(_0x25ea89+='\x20'+_0x263658[_0x031f('0x63')]+'\x20');_0x25ea89+=_0x263658[_0x031f('0x62')][_0x2f2e96][_0x031f('0x64')]?_0x5e0853(_0x263658['rules'][_0x2f2e96][_0x031f('0x64')]):_0x263658['rules'][_0x2f2e96][_0x031f('0x73')]+'\x20'+_0x263658[_0x031f('0x62')][_0x2f2e96][_0x031f('0x65')]+(_0x510bb6(_0x263658['rules'][_0x2f2e96]['condition'])?'\x20'+_0x263658['rules'][_0x2f2e96][_0x031f('0x66')]:'');}return _0x25ea89+')';};var _0xee744={'where':{'id':_0x4f4aff['id']}},_0x8f0afd,_0x2985fe,_0x290f82,_0x307246,_0x232aa0;_0xee744=_['merge']({},_0xee744,_0x5bd344);return db['AnalyticDefaultReport'][_0x031f('0x48')](_0xee744)[_0x031f('0x25')](function(_0x54d86e){if(_0x54d86e){_0x8f0afd=_0x54d86e;return _0x54d86e[_0x031f('0x89')]();}return null;})['then'](function(_0x1c31d5){if(_0x1c31d5){if(!_0x1c31d5[_0x031f('0x47')]){throw new db['Sequelize'][(_0x031f('0x68'))](_0x031f('0x69'),0x193);}_0x2985fe=_0x1c31d5;return db['AnalyticMetric'][_0x031f('0x43')]({'raw':!![]});}return null;})[_0x031f('0x25')](function(_0x1b588e){if(_0x1b588e){_0x290f82=_['keyBy'](_0x1b588e,'id');var _0xa9b5e2;var _0x31504b=squel[_0x031f('0x6b')]();_0x31504b[_0x031f('0x6c')](_0x8f0afd[_0x031f('0x6d')]);for(var _0x2b3326=0x0;_0x2b3326<_0x2985fe['length'];_0x2b3326+=0x1){_0xa9b5e2=_0x2985fe[_0x2b3326][_0x031f('0x8a')]?_0x290f82[_0x2985fe[_0x2b3326][_0x031f('0x8a')]][_0x031f('0x8b')]:_0x2985fe[_0x2b3326][_0x031f('0x73')];_0xa9b5e2=_0x2985fe[_0x2b3326]['function']?_[_0x031f('0x6f')](_0x32c626[_0x2985fe[_0x2b3326][_0x031f('0x6e')]],'%s',_0xa9b5e2):_0xa9b5e2;_0xa9b5e2=_0x2985fe[_0x2b3326]['format']?_[_0x031f('0x6f')](_0x6970f5[_0x2985fe[_0x2b3326][_0x031f('0x70')]],'%s',_0xa9b5e2):_0xa9b5e2;if(_0x2985fe[_0x2b3326][_0x031f('0x8c')]){_0x31504b[_0x031f('0x64')](_0xa9b5e2);}_0x2985fe[_0x2b3326][_0x031f('0x71')]&&_0x31504b[_0x031f('0x3c')](_0xa9b5e2,_0x2985fe[_0x2b3326][_0x031f('0x71')]===_0x031f('0x72')?![]:!![]);_0x31504b[_0x031f('0x73')](_0xa9b5e2,_0x2985fe[_0x2b3326][_0x031f('0x74')]||_0xa9b5e2);}if(_0x8f0afd[_0x031f('0x76')]){_0x8f0afd[_0x031f('0x76')]=JSON[_0x031f('0x75')](_0x8f0afd[_0x031f('0x76')]);for(var _0x2433ce=0x0;_0x2433ce<_0x8f0afd['joins'][_0x031f('0x47')];_0x2433ce+=0x1){if(_0x8f0afd[_0x031f('0x76')][_0x2433ce][_0x031f('0x30')]&&_[_0x031f('0x5e')](_0x1c8055,_0x8f0afd[_0x031f('0x76')][_0x2433ce][_0x031f('0x30')])&&_0x8f0afd['joins'][_0x2433ce]['parentKey']&&_0x8f0afd['joins'][_0x2433ce][_0x031f('0x7a')]&&_0x8f0afd[_0x031f('0x76')][_0x2433ce]['foreignKey']){_0x31504b[_0x8f0afd[_0x031f('0x76')][_0x2433ce][_0x031f('0x30')]](_0x8f0afd[_0x031f('0x76')][_0x2433ce][_0x031f('0x7a')],null,util['format'](_0x031f('0x79'),_0x8f0afd[_0x031f('0x6d')],_0x8f0afd[_0x031f('0x76')][_0x2433ce][_0x031f('0x77')],_0x8f0afd[_0x031f('0x76')][_0x2433ce][_0x031f('0x7a')],_0x8f0afd[_0x031f('0x76')][_0x2433ce][_0x031f('0x78')]));}}}if(_0x8f0afd[_0x031f('0x7b')]){_0x8f0afd[_0x031f('0x7b')]=JSON[_0x031f('0x75')](_0x8f0afd[_0x031f('0x7b')]);_0x31504b['where'](_0x5e0853(_0x8f0afd[_0x031f('0x7b')][_0x031f('0x64')]));}_0x232aa0=_0x31504b['clone']();_0x31504b[_0x031f('0x20')](_0x184bbd);_0x31504b[_0x031f('0x1d')](0x0);return;}})['then'](function(){if(_0x26de7c[_0x031f('0x8d')]===_0x031f('0x8e')){return null;}var _0x1ade73=_[_0x031f('0x40')](_0x26de7c,{'name':_0x26de7c[_0x031f('0x8f')]||_0x26de7c[_0x031f('0x2a')]||_0x8f0afd[_0x031f('0x2a')],'basename':_0x54f02d,'savename':util[_0x031f('0x70')](_0x031f('0x90'),_0x26de7c['name']||_0x8f0afd[_0x031f('0x2a')],require(_0x031f('0x91'))[_0x031f('0x92')](0x4),_0x26de7c['output']||'csv'),'reportId':_0x8f0afd['id'],'reportType':_0x031f('0x93')});return db['AnalyticExtractedReport'][_0x031f('0x49')](_0x1ade73,{'raw':!![]});})[_0x031f('0x25')](function(_0x4a96f2){if(_0x8f0afd[_0x031f('0x6d')]===_0x031f('0x94')){_0x232aa0[_0x031f('0x3e')](_0x8f0afd[_0x031f('0x6d')]+_0x031f('0x95'),_0x26de7c[_0x031f('0x96')],_0x26de7c[_0x031f('0x97')]);}else{_0x232aa0[_0x031f('0x3e')](_0x8f0afd[_0x031f('0x6d')]+_0x031f('0x98'),_0x26de7c[_0x031f('0x96')],_0x26de7c[_0x031f('0x97')]);}if(_0x4a96f2){logger[_0x031f('0x99')]('Run\x20Query:',_0x232aa0['toString']());require(_0x031f('0x9a'))['fork'](path[_0x031f('0x53')](__dirname,_0x031f('0x9b'),_0x4a96f2[_0x031f('0x8d')]),[_0x4a96f2['id'],_0x232aa0['toString'](),path[_0x031f('0x53')](__dirname,_0x031f('0x9c'),_0x4a96f2['savename']),_0x54f02d]);return _0x4a96f2;}else{var _0x185085=squel[_0x031f('0x6b')]();_0x185085[_0x031f('0x6c')]('('+_0x232aa0[_0x031f('0x7f')]()+')',_0x031f('0x9d'));_0x185085[_0x031f('0x73')](_0x031f('0x9e'),'count');_0x232aa0[_0x031f('0x20')](_0x26de7c[_0x031f('0x20')]||_0x184bbd);_0x232aa0[_0x031f('0x1d')](_0x26de7c[_0x031f('0x1d')]||0x0);return dbH['sequelize']['query'](_0x185085[_0x031f('0x7f')](),{'type':dbH['sequelize']['QueryTypes'][_0x031f('0x82')]})['then'](function(_0x579ade){if(!_0x579ade[_0x031f('0x47')]){_0x307246=0x0;}else{_0x307246=_0x579ade[0x0][_0x031f('0x1f')]||0x0;}return dbH[_0x031f('0x80')][_0x031f('0x34')](_0x232aa0[_0x031f('0x7f')](),{'type':dbH[_0x031f('0x80')]['QueryTypes'][_0x031f('0x82')]});})[_0x031f('0x25')](function(_0x52a3f0){return{'rows':_0x52a3f0||[],'count':_0x307246};});}});}exports[_0x031f('0x9f')]=function(_0x355e1a,_0x30c32f){return runReport(_0x355e1a[_0x031f('0x46')],_0x355e1a['query'],_0x355e1a['options'])['then'](respondWithResult(_0x30c32f,null))[_0x031f('0x45')](handleError(_0x30c32f,null));};exports[_0x031f('0xa0')]=runReport;exports[_0x031f('0x34')]=function(_0x3ec98a,_0x3ed663){var _0xac324f=0xa;var _0xcf0af9=[_0x031f('0x53'),_0x031f('0x54'),'right_join',_0x031f('0x83')];var _0xde544e={'SUM':_0x031f('0x56'),'COUNT':_0x031f('0x57'),'COUNT DISTINCT':_0x031f('0x84'),'MAX':'MAX(%s)','MIN':'MIN(%s)','AVG':'AVG(%s)','GROUP_CONCAT':_0x031f('0x5a'),'GROUP_CONCAT ASC':_0x031f('0x5b'),'GROUP_CONCAT DESC':_0x031f('0x5c')};var _0x84cd0c={'SEC_TO_TIME':'SEC_TO_TIME(%s)','DATE':_0x031f('0xa1'),'HOUR':'HOUR(%s)','ROUND':_0x031f('0x87'),'UNIX_TIMESTAMP':_0x031f('0x5d')};var _0x24aff3=function(_0x35a1f1){return!_[_0x031f('0x5e')](['IS\x20NULL',_0x031f('0x88'),_0x031f('0x60'),_0x031f('0x61')],_0x35a1f1);};var _0x3cb099=function(_0x4a4d8f){if(!_0x4a4d8f||!_0x4a4d8f[_0x031f('0x62')][_0x031f('0x47')]){return'';}for(var _0x578201='(',_0xdbf09f=0x0;_0xdbf09f<_0x4a4d8f['rules'][_0x031f('0x47')];_0xdbf09f+=0x1){_0xdbf09f>0x0&&(_0x578201+='\x20'+_0x4a4d8f[_0x031f('0x63')]+'\x20');_0x578201+=_0x4a4d8f[_0x031f('0x62')][_0xdbf09f][_0x031f('0x64')]?_0x3cb099(_0x4a4d8f[_0x031f('0x62')][_0xdbf09f]['group']):_0x4a4d8f[_0x031f('0x62')][_0xdbf09f]['field']+'\x20'+_0x4a4d8f[_0x031f('0x62')][_0xdbf09f][_0x031f('0x65')]+(_0x24aff3(_0x4a4d8f['rules'][_0xdbf09f][_0x031f('0x65')])?'\x20'+_0x4a4d8f[_0x031f('0x62')][_0xdbf09f][_0x031f('0x66')]:'');}return _0x578201+')';};var _0x123b4d={'where':{'id':_0x3ec98a['params']['id']}},_0x3f80b5,_0x53cd67,_0x516f11,_0x50cdb2,_0x2e9a3b;_0x123b4d=_[_0x031f('0x40')]({},_0x123b4d,_0x3ec98a[_0x031f('0x41')]);return db[_0x031f('0x2d')][_0x031f('0x48')](_0x123b4d)[_0x031f('0x25')](function(_0x53911d){if(_0x53911d){_0x3f80b5=_0x53911d;return _0x53911d[_0x031f('0x89')]();}return null;})['then'](function(_0x30fa18){if(_0x30fa18){if(!_0x30fa18[_0x031f('0x47')]){throw new db[(_0x031f('0x67'))]['ValidationErrorItem'](_0x031f('0x69'),0x193);}_0x53cd67=_0x30fa18;return db[_0x031f('0x6a')][_0x031f('0x43')]({'raw':!![]});}return null;})[_0x031f('0x25')](function(_0x5b092c){if(_0x5b092c){_0x516f11=_[_0x031f('0xa2')](_0x5b092c,'id');var _0x7b8699;var _0x14a497=squel[_0x031f('0x6b')]();_0x14a497[_0x031f('0x6c')](_0x3f80b5[_0x031f('0x6d')]);for(var _0x59fd9a=0x0;_0x59fd9a<_0x53cd67[_0x031f('0x47')];_0x59fd9a+=0x1){_0x7b8699=_0x53cd67[_0x59fd9a][_0x031f('0x8a')]?_0x516f11[_0x53cd67[_0x59fd9a][_0x031f('0x8a')]][_0x031f('0x8b')]:_0x53cd67[_0x59fd9a][_0x031f('0x73')];_0x7b8699=_0x53cd67[_0x59fd9a][_0x031f('0x6e')]?_[_0x031f('0x6f')](_0xde544e[_0x53cd67[_0x59fd9a]['function']],'%s',_0x7b8699):_0x7b8699;_0x7b8699=_0x53cd67[_0x59fd9a][_0x031f('0x70')]?_[_0x031f('0x6f')](_0x84cd0c[_0x53cd67[_0x59fd9a][_0x031f('0x70')]],'%s',_0x7b8699):_0x7b8699;if(_0x53cd67[_0x59fd9a][_0x031f('0x8c')]){_0x14a497[_0x031f('0x64')](_0x7b8699);}_0x53cd67[_0x59fd9a]['orderBy']&&_0x14a497[_0x031f('0x3c')](_0x7b8699,_0x53cd67[_0x59fd9a][_0x031f('0x71')]===_0x031f('0x72')?![]:!![]);_0x14a497[_0x031f('0x73')](_0x7b8699,_0x53cd67[_0x59fd9a][_0x031f('0x74')]||_0x7b8699);}if(_0x3f80b5['joins']){_0x3f80b5[_0x031f('0x76')]=JSON[_0x031f('0x75')](_0x3f80b5[_0x031f('0x76')]);for(var _0x110747=0x0;_0x110747<_0x3f80b5[_0x031f('0x76')]['length'];_0x110747+=0x1){if(_0x3f80b5['joins'][_0x110747][_0x031f('0x30')]&&_[_0x031f('0x5e')](_0xcf0af9,_0x3f80b5['joins'][_0x110747][_0x031f('0x30')])&&_0x3f80b5['joins'][_0x110747][_0x031f('0x77')]&&_0x3f80b5[_0x031f('0x76')][_0x110747][_0x031f('0x7a')]&&_0x3f80b5[_0x031f('0x76')][_0x110747]['foreignKey']){_0x14a497[_0x3f80b5['joins'][_0x110747][_0x031f('0x30')]](_0x3f80b5[_0x031f('0x76')][_0x110747][_0x031f('0x7a')],null,util[_0x031f('0x70')]('%s.%s\x20=\x20%s.%s',_0x3f80b5[_0x031f('0x6d')],_0x3f80b5[_0x031f('0x76')][_0x110747][_0x031f('0x77')],_0x3f80b5['joins'][_0x110747][_0x031f('0x7a')],_0x3f80b5[_0x031f('0x76')][_0x110747][_0x031f('0x78')]));}}}if(_0x3f80b5['conditions']){_0x3f80b5[_0x031f('0x7b')]=JSON[_0x031f('0x75')](_0x3f80b5[_0x031f('0x7b')]);_0x14a497[_0x031f('0x3e')](_0x3cb099(_0x3f80b5[_0x031f('0x7b')]['group']));}_0x2e9a3b=_0x14a497[_0x031f('0x7c')]();_0x14a497[_0x031f('0x20')](_0xac324f);_0x14a497[_0x031f('0x1d')](0x0);logger[_0x031f('0x7d')](_0x031f('0x7e'),_0x14a497[_0x031f('0x7f')]());return dbH['sequelize']['query'](_0x14a497[_0x031f('0x7f')](),{'type':dbH[_0x031f('0x80')][_0x031f('0x81')][_0x031f('0x82')]});}})[_0x031f('0x25')](function(){return{'sql':_0x2e9a3b[_0x031f('0x7f')]()};})[_0x031f('0x25')](respondWithResult(_0x3ed663,null))['catch'](handleError(_0x3ed663,null));};
\ No newline at end of file
diff --git a/server/api/analyticDefaultReport/analyticDefaultReport.model.js b/server/api/analyticDefaultReport/analyticDefaultReport.model.js
index 3153f42..e163047 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 _0x3669=['rimraf','./analyticDefaultReport.attributes','exports','define','AnalyticDefaultReport','analytics_default_reports','lodash','util','api','moment','bluebird','request-promise','path'];(function(_0x132254,_0x4af975){var _0x32b2fa=function(_0x72c86e){while(--_0x72c86e){_0x132254['push'](_0x132254['shift']());}};_0x32b2fa(++_0x4af975);}(_0x3669,0x1e7));var _0x9366=function(_0xf3671b,_0x5ef77b){_0xf3671b=_0xf3671b-0x0;var _0x1f815f=_0x3669[_0xf3671b];return _0x1f815f;};'use strict';var _=require(_0x9366('0x0'));var util=require(_0x9366('0x1'));var logger=require('../../config/logger')(_0x9366('0x2'));var moment=require(_0x9366('0x3'));var BPromise=require(_0x9366('0x4'));var rp=require(_0x9366('0x5'));var fs=require('fs');var path=require(_0x9366('0x6'));var rimraf=require(_0x9366('0x7'));var config=require('../../config/environment');var attributes=require(_0x9366('0x8'));module[_0x9366('0x9')]=function(_0xa2a28e,_0x2cd122){return _0xa2a28e[_0x9366('0xa')](_0x9366('0xb'),attributes,{'tableName':_0x9366('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xb326=['./analyticDefaultReport.attributes','exports','AnalyticDefaultReport','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','../../config/environment'];(function(_0x1fc560,_0x2e67b2){var _0x4b0c1d=function(_0x4a69e4){while(--_0x4a69e4){_0x1fc560['push'](_0x1fc560['shift']());}};_0x4b0c1d(++_0x2e67b2);}(_0xb326,0xcf));var _0x6b32=function(_0x1d3923,_0x5569c6){_0x1d3923=_0x1d3923-0x0;var _0x58bb2d=_0xb326[_0x1d3923];return _0x58bb2d;};'use strict';var _=require(_0x6b32('0x0'));var util=require(_0x6b32('0x1'));var logger=require(_0x6b32('0x2'))(_0x6b32('0x3'));var moment=require(_0x6b32('0x4'));var BPromise=require(_0x6b32('0x5'));var rp=require(_0x6b32('0x6'));var fs=require('fs');var path=require(_0x6b32('0x7'));var rimraf=require('rimraf');var config=require(_0x6b32('0x8'));var attributes=require(_0x6b32('0x9'));module[_0x6b32('0xa')]=function(_0x2f6e80,_0x193e7d){return _0x2f6e80['define'](_0x6b32('0xb'),attributes,{'tableName':'analytics_default_reports','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 1d04428..3a6a44a 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 _0xe087=['request\x20sent','result','catch','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','client','request','then','info','AnalyticDefaultReport,\x20%s,\x20%s,\x20%s','error','message','AnalyticDefaultReport,\x20%s,\x20%s'];(function(_0x57aae5,_0x4b0939){var _0x33225e=function(_0x2f7904){while(--_0x2f7904){_0x57aae5['push'](_0x57aae5['shift']());}};_0x33225e(++_0x4b0939);}(_0xe087,0xae));var _0x7e08=function(_0x100efd,_0x94358d){_0x100efd=_0x100efd-0x0;var _0x49e58b=_0xe087[_0x100efd];return _0x49e58b;};'use strict';var _=require('lodash');var util=require(_0x7e08('0x0'));var moment=require(_0x7e08('0x1'));var BPromise=require(_0x7e08('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x7e08('0x3'));var db=require(_0x7e08('0x4'))['db'];var utils=require(_0x7e08('0x5'));var logger=require(_0x7e08('0x6'))(_0x7e08('0x7'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x7e08('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0xb91b4a,_0x4342dc,_0x57db10){return new BPromise(function(_0x141c51,_0x2f89e3){return client[_0x7e08('0x9')](_0xb91b4a,_0x57db10)[_0x7e08('0xa')](function(_0x38bb27){logger[_0x7e08('0xb')]('AnalyticDefaultReport,\x20%s,\x20%s',_0x4342dc,'request\x20sent');logger['debug'](_0x7e08('0xc'),_0x4342dc,'request\x20sent',JSON['stringify'](_0x38bb27));if(_0x38bb27[_0x7e08('0xd')]){if(_0x38bb27[_0x7e08('0xd')]['code']===0x1f4){logger[_0x7e08('0xd')]('AnalyticDefaultReport,\x20%s,\x20%s',_0x4342dc,_0x38bb27['error'][_0x7e08('0xe')]);return _0x2f89e3(_0x38bb27[_0x7e08('0xd')][_0x7e08('0xe')]);}logger[_0x7e08('0xd')](_0x7e08('0xf'),_0x4342dc,_0x38bb27['error'][_0x7e08('0xe')]);return _0x141c51(_0x38bb27[_0x7e08('0xd')][_0x7e08('0xe')]);}else{logger[_0x7e08('0xb')](_0x7e08('0xf'),_0x4342dc,_0x7e08('0x10'));_0x141c51(_0x38bb27[_0x7e08('0x11')][_0x7e08('0xe')]);}})[_0x7e08('0x12')](function(_0x1579b5){logger['error']('AnalyticDefaultReport,\x20%s,\x20%s',_0x4342dc,_0x1579b5);_0x2f89e3(_0x1579b5);});});}
\ No newline at end of file
+var _0xf4ba=['AnalyticDefaultReport,\x20%s,\x20%s','request\x20sent','debug','AnalyticDefaultReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../config/logger','../../config/environment','http','request','then'];(function(_0x2bf0b1,_0x171aaa){var _0x29456f=function(_0x20b690){while(--_0x20b690){_0x2bf0b1['push'](_0x2bf0b1['shift']());}};_0x29456f(++_0x171aaa);}(_0xf4ba,0x130));var _0xaf4b=function(_0x37d031,_0x13049){_0x37d031=_0x37d031-0x0;var _0x1de593=_0xf4ba[_0x37d031];return _0x1de593;};'use strict';var _=require(_0xaf4b('0x0'));var util=require(_0xaf4b('0x1'));var moment=require(_0xaf4b('0x2'));var BPromise=require(_0xaf4b('0x3'));var rs=require(_0xaf4b('0x4'));var fs=require('fs');var Redis=require(_0xaf4b('0x5'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0xaf4b('0x6'))('rpc');var config=require(_0xaf4b('0x7'));var jayson=require('jayson/promise');var client=jayson['client'][_0xaf4b('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x1340d1,_0x597f24,_0x4bf7c8){return new BPromise(function(_0x8e75e5,_0x490c5a){return client[_0xaf4b('0x9')](_0x1340d1,_0x4bf7c8)[_0xaf4b('0xa')](function(_0x1c6899){logger['info'](_0xaf4b('0xb'),_0x597f24,_0xaf4b('0xc'));logger[_0xaf4b('0xd')](_0xaf4b('0xe'),_0x597f24,_0xaf4b('0xc'),JSON[_0xaf4b('0xf')](_0x1c6899));if(_0x1c6899[_0xaf4b('0x10')]){if(_0x1c6899['error'][_0xaf4b('0x11')]===0x1f4){logger[_0xaf4b('0x10')](_0xaf4b('0xb'),_0x597f24,_0x1c6899[_0xaf4b('0x10')][_0xaf4b('0x12')]);return _0x490c5a(_0x1c6899[_0xaf4b('0x10')][_0xaf4b('0x12')]);}logger[_0xaf4b('0x10')](_0xaf4b('0xb'),_0x597f24,_0x1c6899[_0xaf4b('0x10')][_0xaf4b('0x12')]);return _0x8e75e5(_0x1c6899['error']['message']);}else{logger[_0xaf4b('0x13')](_0xaf4b('0xb'),_0x597f24,_0xaf4b('0xc'));_0x8e75e5(_0x1c6899['result'][_0xaf4b('0x12')]);}})[_0xaf4b('0x14')](function(_0x68fe26){logger[_0xaf4b('0x10')](_0xaf4b('0xb'),_0x597f24,_0x68fe26);_0x490c5a(_0x68fe26);});});}
\ No newline at end of file
diff --git a/server/api/analyticDefaultReport/index.js b/server/api/analyticDefaultReport/index.js
index f69334b..33e0971 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 _0xeb94=['query','post','put','update','destroy','exports','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment','./analyticDefaultReport.controller','get','isAuthenticated','index','/:id','show','/:id/preview','preview','run'];(function(_0x4c41ff,_0x40061e){var _0x2e10f5=function(_0x19a0af){while(--_0x19a0af){_0x4c41ff['push'](_0x4c41ff['shift']());}};_0x2e10f5(++_0x40061e);}(_0xeb94,0x1d2));var _0x4eb9=function(_0x2acb61,_0x4436ab){_0x2acb61=_0x2acb61-0x0;var _0x5361bf=_0xeb94[_0x2acb61];return _0x5361bf;};'use strict';var multer=require('multer');var util=require(_0x4eb9('0x0'));var path=require(_0x4eb9('0x1'));var timeout=require(_0x4eb9('0x2'));var express=require(_0x4eb9('0x3'));var router=express[_0x4eb9('0x4')]();var fs_extra=require(_0x4eb9('0x5'));var auth=require(_0x4eb9('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0x4eb9('0x7'));var controller=require(_0x4eb9('0x8'));router[_0x4eb9('0x9')]('/',auth[_0x4eb9('0xa')](),controller[_0x4eb9('0xb')]);router[_0x4eb9('0x9')](_0x4eb9('0xc'),auth[_0x4eb9('0xa')](),controller[_0x4eb9('0xd')]);router[_0x4eb9('0x9')](_0x4eb9('0xe'),auth[_0x4eb9('0xa')](),controller[_0x4eb9('0xf')]);router[_0x4eb9('0x9')]('/:id/run',auth['isAuthenticated'](),controller[_0x4eb9('0x10')]);router[_0x4eb9('0x9')]('/:id/query',auth['isAuthenticated'](),controller[_0x4eb9('0x11')]);router[_0x4eb9('0x12')]('/',auth[_0x4eb9('0xa')](),controller['create']);router[_0x4eb9('0x13')]('/:id',auth['isAuthenticated'](),controller[_0x4eb9('0x14')]);router['delete'](_0x4eb9('0xc'),auth[_0x4eb9('0xa')](),controller[_0x4eb9('0x15')]);module[_0x4eb9('0x16')]=router;
\ No newline at end of file
+var _0x6016=['create','delete','destroy','exports','multer','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./analyticDefaultReport.controller','index','get','/:id','isAuthenticated','show','/:id/preview','preview','/:id/run','run','query'];(function(_0x195b13,_0x609368){var _0x345feb=function(_0x4b5fe5){while(--_0x4b5fe5){_0x195b13['push'](_0x195b13['shift']());}};_0x345feb(++_0x609368);}(_0x6016,0x101));var _0x6601=function(_0xe896bf,_0x4f8e5e){_0xe896bf=_0xe896bf-0x0;var _0x4c7a8a=_0x6016[_0xe896bf];return _0x4c7a8a;};'use strict';var multer=require(_0x6601('0x0'));var util=require('util');var path=require(_0x6601('0x1'));var timeout=require(_0x6601('0x2'));var express=require('express');var router=express[_0x6601('0x3')]();var fs_extra=require(_0x6601('0x4'));var auth=require(_0x6601('0x5'));var interaction=require(_0x6601('0x6'));var config=require(_0x6601('0x7'));var controller=require(_0x6601('0x8'));router['get']('/',auth['isAuthenticated'](),controller[_0x6601('0x9')]);router[_0x6601('0xa')](_0x6601('0xb'),auth[_0x6601('0xc')](),controller[_0x6601('0xd')]);router['get'](_0x6601('0xe'),auth[_0x6601('0xc')](),controller[_0x6601('0xf')]);router[_0x6601('0xa')](_0x6601('0x10'),auth[_0x6601('0xc')](),controller[_0x6601('0x11')]);router['get']('/:id/query',auth[_0x6601('0xc')](),controller[_0x6601('0x12')]);router['post']('/',auth['isAuthenticated'](),controller[_0x6601('0x13')]);router['put'](_0x6601('0xb'),auth['isAuthenticated'](),controller['update']);router[_0x6601('0x14')]('/:id',auth['isAuthenticated'](),controller[_0x6601('0x15')]);module[_0x6601('0x16')]=router;
\ No newline at end of file
diff --git a/server/api/analyticExtractedReport/analyticExtractedReport.attributes.js b/server/api/analyticExtractedReport/analyticExtractedReport.attributes.js
index 1dde8a9..462554f 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 _0x6aa9=['STRING','ENUM','csv','xlsx','DATE','Loading','manual','scheduled','INTEGER','moment','exports'];(function(_0x122ef9,_0x451d2a){var _0x42fba0=function(_0x17c9d3){while(--_0x17c9d3){_0x122ef9['push'](_0x122ef9['shift']());}};_0x42fba0(++_0x451d2a);}(_0x6aa9,0x82));var _0x96aa=function(_0x5e29eb,_0x2ed36d){_0x5e29eb=_0x5e29eb-0x0;var _0x3e6df1=_0x6aa9[_0x5e29eb];return _0x3e6df1;};'use strict';var Sequelize=require('sequelize');var moment=require(_0x96aa('0x0'));module[_0x96aa('0x1')]={'name':{'type':Sequelize[_0x96aa('0x2')],'allowNull':![]},'basename':{'type':Sequelize[_0x96aa('0x2')],'allowNull':![]},'output':{'type':Sequelize[_0x96aa('0x3')](_0x96aa('0x4'),'pdf',_0x96aa('0x5')),'allowNull':![],'defaultValue':'csv'},'savename':{'type':Sequelize[_0x96aa('0x2')],'allowNull':![]},'startDate':{'type':Sequelize[_0x96aa('0x6')]},'endDate':{'type':Sequelize['DATE']},'status':{'type':Sequelize[_0x96aa('0x2')],'defaultValue':_0x96aa('0x7')},'type':{'type':Sequelize[_0x96aa('0x3')](_0x96aa('0x8'),_0x96aa('0x9')),'allowNull':![],'defaultValue':_0x96aa('0x8')},'reportId':{'type':Sequelize[_0x96aa('0xa')](0xb)['UNSIGNED']},'reportType':{'type':Sequelize[_0x96aa('0x2')]}};
\ No newline at end of file
+var _0xcf78=['sequelize','moment','exports','STRING','ENUM','csv','pdf','xlsx','DATE','Loading','manual','INTEGER','UNSIGNED'];(function(_0x5d8b42,_0x4cd40d){var _0x453a08=function(_0x54cc72){while(--_0x54cc72){_0x5d8b42['push'](_0x5d8b42['shift']());}};_0x453a08(++_0x4cd40d);}(_0xcf78,0xf7));var _0x8cf7=function(_0x376011,_0x5699d7){_0x376011=_0x376011-0x0;var _0x383b79=_0xcf78[_0x376011];return _0x383b79;};'use strict';var Sequelize=require(_0x8cf7('0x0'));var moment=require(_0x8cf7('0x1'));module[_0x8cf7('0x2')]={'name':{'type':Sequelize['STRING'],'allowNull':![]},'basename':{'type':Sequelize[_0x8cf7('0x3')],'allowNull':![]},'output':{'type':Sequelize[_0x8cf7('0x4')](_0x8cf7('0x5'),_0x8cf7('0x6'),_0x8cf7('0x7')),'allowNull':![],'defaultValue':_0x8cf7('0x5')},'savename':{'type':Sequelize[_0x8cf7('0x3')],'allowNull':![]},'startDate':{'type':Sequelize[_0x8cf7('0x8')]},'endDate':{'type':Sequelize[_0x8cf7('0x8')]},'status':{'type':Sequelize[_0x8cf7('0x3')],'defaultValue':_0x8cf7('0x9')},'type':{'type':Sequelize[_0x8cf7('0x4')](_0x8cf7('0xa'),'scheduled'),'allowNull':![],'defaultValue':_0x8cf7('0xa')},'reportId':{'type':Sequelize[_0x8cf7('0xb')](0xb)[_0x8cf7('0xc')]},'reportType':{'type':Sequelize[_0x8cf7('0x3')]}};
\ No newline at end of file
diff --git a/server/api/analyticExtractedReport/analyticExtractedReport.controller.js b/server/api/analyticExtractedReport/analyticExtractedReport.controller.js
index e864752..ba0135d 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 _0xfbfa=['Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','params','download','savename','output','existsSync','join','server/files/reports','ValidationError','Report\x20not\x20found\x20or\x20empty','exists','format','%s.%s','toLowerCase','eml-format','rimraf','zip-dir','moment','bluebird','mustache','util','path','sox','ejs','squel','crypto','desk.js','to-csv','querystring','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','limit','undefined','count','set','Content-Range','apply','reject','save','update','then','destroy','ExtractedReports','UserProfileResource','error','name','send','index','map','rawAttributes','fieldName','type','key','model','intersection','attributes','fields','query','length','order','sort','where','filters','pick','merge','VIRTUAL','filter','options','AnalyticExtractedReport','includeAll','include','rows','catch','show','keys','find','create','body','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId'];(function(_0xbf098b,_0x269d81){var _0x2f1446=function(_0xa84d24){while(--_0xa84d24){_0xbf098b['push'](_0xbf098b['shift']());}};_0x2f1446(++_0x269d81);}(_0xfbfa,0x192));var _0xafbf=function(_0x4b2d65,_0x235972){_0x4b2d65=_0x4b2d65-0x0;var _0x3d6879=_0xfbfa[_0x4b2d65];return _0x3d6879;};'use strict';var emlformat=require(_0xafbf('0x0'));var rimraf=require(_0xafbf('0x1'));var zipdir=require(_0xafbf('0x2'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0xafbf('0x3'));var BPromise=require(_0xafbf('0x4'));var Mustache=require(_0xafbf('0x5'));var util=require(_0xafbf('0x6'));var path=require(_0xafbf('0x7'));var sox=require(_0xafbf('0x8'));var csv=require('to-csv');var ejs=require(_0xafbf('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0xafbf('0xa'));var crypto=require(_0xafbf('0xb'));var jsforce=require('jsforce');var deskjs=require(_0xafbf('0xc'));var toCsv=require(_0xafbf('0xd'));var querystring=require(_0xafbf('0xe'));var Papa=require(_0xafbf('0xf'));var Redis=require(_0xafbf('0x10'));var authService=require(_0xafbf('0x11'));var qs=require(_0xafbf('0x12'));var as=require(_0xafbf('0x13'));var hardwareService=require(_0xafbf('0x14'));var logger=require('../../config/logger')(_0xafbf('0x15'));var utils=require(_0xafbf('0x16'));var config=require('../../config/environment');var licenseUtil=require(_0xafbf('0x17'));var db=require(_0xafbf('0x18'))['db'];function respondWithStatusCode(_0x569b08,_0xabbd62){_0xabbd62=_0xabbd62||0xcc;return function(_0x65fd42){if(_0x65fd42){return _0x569b08[_0xafbf('0x19')](_0xabbd62);}return _0x569b08[_0xafbf('0x1a')](_0xabbd62)[_0xafbf('0x1b')]();};}function respondWithResult(_0xc438af,_0x1dcbf7){_0x1dcbf7=_0x1dcbf7||0xc8;return function(_0xc712bf){if(_0xc712bf){return _0xc438af[_0xafbf('0x1a')](_0x1dcbf7)[_0xafbf('0x1c')](_0xc712bf);}};}function respondWithFilteredResult(_0x4f60a4,_0x22a438){return function(_0x5e6ecd){if(_0x5e6ecd){var _0x4abdbb=typeof _0x22a438[_0xafbf('0x1d')]==='undefined'&&typeof _0x22a438[_0xafbf('0x1e')]===_0xafbf('0x1f');var _0x5e783b=_0x5e6ecd['count'];var _0x55ba5d=_0x4abdbb?0x0:_0x22a438[_0xafbf('0x1d')];var _0x46e8d7=_0x4abdbb?_0x5e6ecd[_0xafbf('0x20')]:_0x22a438[_0xafbf('0x1d')]+_0x22a438[_0xafbf('0x1e')];var _0x154c15;if(_0x46e8d7>=_0x5e783b){_0x46e8d7=_0x5e783b;_0x154c15=0xc8;}else{_0x154c15=0xce;}_0x4f60a4[_0xafbf('0x1a')](_0x154c15);return _0x4f60a4[_0xafbf('0x21')](_0xafbf('0x22'),_0x55ba5d+'-'+_0x46e8d7+'/'+_0x5e783b)[_0xafbf('0x1c')](_0x5e6ecd);}return null;};}function patchUpdates(_0x33550a){return function(_0x254ad0){try{jsonpatch[_0xafbf('0x23')](_0x254ad0,_0x33550a,!![]);}catch(_0x80cc0c){return BPromise[_0xafbf('0x24')](_0x80cc0c);}return _0x254ad0[_0xafbf('0x25')]();};}function saveUpdates(_0x39c365,_0xbcc091){return function(_0x18674d){if(_0x18674d){return _0x18674d[_0xafbf('0x26')](_0x39c365)[_0xafbf('0x27')](function(_0x172c10){return _0x172c10;});}return null;};}function removeEntity(_0x54a5dd,_0xc4a778){return function(_0x56deca){if(_0x56deca){return _0x56deca[_0xafbf('0x28')]()[_0xafbf('0x27')](function(){var _0x4259d0=_0x56deca['get']({'plain':!![]});var _0x467581=_0xafbf('0x29');return db[_0xafbf('0x2a')]['destroy']({'where':{'type':_0x467581,'resourceId':_0x4259d0['id']}})[_0xafbf('0x27')](function(){return _0x56deca;});})[_0xafbf('0x27')](function(){_0x54a5dd[_0xafbf('0x1a')](0xcc)['end']();});}};}function handleEntityNotFound(_0x308198,_0x396ec9){return function(_0x52cc69){if(!_0x52cc69){_0x308198[_0xafbf('0x19')](0x194);}return _0x52cc69;};}function handleError(_0xd71bab,_0x3c90c6){_0x3c90c6=_0x3c90c6||0x1f4;return function(_0x3067bf){logger[_0xafbf('0x2b')](_0x3067bf['stack']);if(_0x3067bf[_0xafbf('0x2c')]){delete _0x3067bf[_0xafbf('0x2c')];}_0xd71bab[_0xafbf('0x1a')](_0x3c90c6)[_0xafbf('0x2d')](_0x3067bf);};}exports[_0xafbf('0x2e')]=function(_0x411b4a,_0xfaed28){var _0x322b2f={},_0x279f50={},_0x2a5028={'count':0x0,'rows':[]};var _0x26812e=_[_0xafbf('0x2f')](db['AnalyticExtractedReport'][_0xafbf('0x30')],function(_0x2d8726){return{'name':_0x2d8726[_0xafbf('0x31')],'type':_0x2d8726[_0xafbf('0x32')][_0xafbf('0x33')]};});_0x279f50[_0xafbf('0x34')]=_[_0xafbf('0x2f')](_0x26812e,_0xafbf('0x2c'));_0x279f50['query']=_['keys'](_0x411b4a['query']);_0x279f50['filters']=_[_0xafbf('0x35')](_0x279f50[_0xafbf('0x34')],_0x279f50['query']);_0x322b2f[_0xafbf('0x36')]=_[_0xafbf('0x35')](_0x279f50[_0xafbf('0x34')],qs[_0xafbf('0x37')](_0x411b4a[_0xafbf('0x38')][_0xafbf('0x37')]));_0x322b2f[_0xafbf('0x36')]=_0x322b2f[_0xafbf('0x36')][_0xafbf('0x39')]?_0x322b2f[_0xafbf('0x36')]:_0x279f50[_0xafbf('0x34')];if(!_0x411b4a[_0xafbf('0x38')]['hasOwnProperty']('nolimit')){_0x322b2f[_0xafbf('0x1e')]=qs[_0xafbf('0x1e')](_0x411b4a[_0xafbf('0x38')][_0xafbf('0x1e')]);_0x322b2f[_0xafbf('0x1d')]=qs['offset'](_0x411b4a[_0xafbf('0x38')][_0xafbf('0x1d')]);}_0x322b2f[_0xafbf('0x3a')]=qs[_0xafbf('0x3b')](_0x411b4a[_0xafbf('0x38')][_0xafbf('0x3b')]);_0x322b2f[_0xafbf('0x3c')]=qs[_0xafbf('0x3d')](_[_0xafbf('0x3e')](_0x411b4a[_0xafbf('0x38')],_0x279f50[_0xafbf('0x3d')]),_0x26812e);if(_0x411b4a[_0xafbf('0x38')]['filter']){_0x322b2f[_0xafbf('0x3c')]=_[_0xafbf('0x3f')](_0x322b2f[_0xafbf('0x3c')],{'$or':_[_0xafbf('0x2f')](_0x26812e,function(_0x5a047c){if(_0x5a047c[_0xafbf('0x32')]!==_0xafbf('0x40')){var _0xc68b6f={};_0xc68b6f[_0x5a047c[_0xafbf('0x2c')]]={'$like':'%'+_0x411b4a[_0xafbf('0x38')][_0xafbf('0x41')]+'%'};return _0xc68b6f;}})});}_0x322b2f=_[_0xafbf('0x3f')]({},_0x322b2f,_0x411b4a[_0xafbf('0x42')]);var _0x109698={'where':_0x322b2f[_0xafbf('0x3c')]};return db[_0xafbf('0x43')][_0xafbf('0x20')](_0x109698)[_0xafbf('0x27')](function(_0x227ea3){_0x2a5028[_0xafbf('0x20')]=_0x227ea3;if(_0x411b4a['query'][_0xafbf('0x44')]){_0x322b2f[_0xafbf('0x45')]=[{'all':!![]}];}return db[_0xafbf('0x43')]['findAll'](_0x322b2f);})[_0xafbf('0x27')](function(_0xce46a4){_0x2a5028[_0xafbf('0x46')]=_0xce46a4;return _0x2a5028;})['then'](respondWithFilteredResult(_0xfaed28,_0x322b2f))[_0xafbf('0x47')](handleError(_0xfaed28,null));};exports[_0xafbf('0x48')]=function(_0xdd2b50,_0x142b85){var _0x34d847={'raw':!![],'where':{'id':_0xdd2b50['params']['id']}},_0x7e9443={};_0x7e9443[_0xafbf('0x34')]=_[_0xafbf('0x49')](db[_0xafbf('0x43')][_0xafbf('0x30')]);_0x7e9443[_0xafbf('0x38')]=_[_0xafbf('0x49')](_0xdd2b50['query']);_0x7e9443[_0xafbf('0x3d')]=_[_0xafbf('0x35')](_0x7e9443['model'],_0x7e9443['query']);_0x34d847['attributes']=_[_0xafbf('0x35')](_0x7e9443['model'],qs[_0xafbf('0x37')](_0xdd2b50[_0xafbf('0x38')][_0xafbf('0x37')]));_0x34d847[_0xafbf('0x36')]=_0x34d847[_0xafbf('0x36')]['length']?_0x34d847[_0xafbf('0x36')]:_0x7e9443[_0xafbf('0x34')];if(_0xdd2b50[_0xafbf('0x38')][_0xafbf('0x44')]){_0x34d847[_0xafbf('0x45')]=[{'all':!![]}];}_0x34d847=_[_0xafbf('0x3f')]({},_0x34d847,_0xdd2b50[_0xafbf('0x42')]);return db[_0xafbf('0x43')][_0xafbf('0x4a')](_0x34d847)[_0xafbf('0x27')](handleEntityNotFound(_0x142b85,null))[_0xafbf('0x27')](respondWithResult(_0x142b85,null))['catch'](handleError(_0x142b85,null));};exports[_0xafbf('0x4b')]=function(_0x16c177,_0x2c3223){return db[_0xafbf('0x43')][_0xafbf('0x4b')](_0x16c177[_0xafbf('0x4c')],{})[_0xafbf('0x27')](function(_0x43c3eb){var _0x39411a=_0x16c177[_0xafbf('0x4d')][_0xafbf('0x4e')]({'plain':!![]});if(!_0x39411a)throw new Error(_0xafbf('0x4f'));if(_0x39411a[_0xafbf('0x50')]===_0xafbf('0x4d')){var _0x500800=_0x43c3eb[_0xafbf('0x4e')]({'plain':!![]});var _0x490110=_0xafbf('0x29');return db[_0xafbf('0x51')]['find']({'where':{'name':_0x490110,'userProfileId':_0x39411a[_0xafbf('0x52')]},'raw':!![]})[_0xafbf('0x27')](function(_0xf8895b){if(_0xf8895b&&_0xf8895b['autoAssociation']===0x0){return db[_0xafbf('0x2a')]['create']({'name':_0x500800['name'],'resourceId':_0x500800['id'],'type':_0xf8895b[_0xafbf('0x2c')],'sectionId':_0xf8895b['id']},{})[_0xafbf('0x27')](function(){return _0x43c3eb;});}else{return _0x43c3eb;}})[_0xafbf('0x47')](function(_0x29c627){logger[_0xafbf('0x2b')](_0xafbf('0x53'),_0x29c627);throw _0x29c627;});}return _0x43c3eb;})[_0xafbf('0x27')](respondWithResult(_0x2c3223,0xc9))[_0xafbf('0x47')](handleError(_0x2c3223,null));};exports[_0xafbf('0x26')]=function(_0x5a33aa,_0x57ea68){if(_0x5a33aa['body']['id']){delete _0x5a33aa[_0xafbf('0x4c')]['id'];}return db[_0xafbf('0x43')]['find']({'where':{'id':_0x5a33aa[_0xafbf('0x54')]['id']}})[_0xafbf('0x27')](handleEntityNotFound(_0x57ea68,null))['then'](saveUpdates(_0x5a33aa[_0xafbf('0x4c')],null))[_0xafbf('0x27')](respondWithResult(_0x57ea68,null))[_0xafbf('0x47')](handleError(_0x57ea68,null));};exports[_0xafbf('0x28')]=function(_0x57d502,_0x2c1a28){return db['AnalyticExtractedReport'][_0xafbf('0x4a')]({'where':{'id':_0x57d502['params']['id']}})['then'](handleEntityNotFound(_0x2c1a28,null))[_0xafbf('0x27')](removeEntity(_0x2c1a28,null))[_0xafbf('0x47')](handleError(_0x2c1a28,null));};exports[_0xafbf('0x55')]=function(_0x137cbd,_0x176b47,_0x21fc79){return db[_0xafbf('0x43')]['find']({'where':{'id':_0x137cbd[_0xafbf('0x54')]['id']},'attributes':[_0xafbf('0x2c'),'basename',_0xafbf('0x56'),_0xafbf('0x57')],'raw':!![]})[_0xafbf('0x27')](handleEntityNotFound(_0x176b47,null))[_0xafbf('0x27')](function(_0x55e928){if(_0x55e928){if(!fs[_0xafbf('0x58')](path[_0xafbf('0x59')](config['root'],_0xafbf('0x5a'),_0x55e928['savename']))){throw new db['Sequelize'][(_0xafbf('0x5b'))](_0xafbf('0x5c'));}if(_0x137cbd[_0xafbf('0x38')][_0xafbf('0x5d')]){return _0x176b47[_0xafbf('0x19')](0xc8);}return _0x176b47[_0xafbf('0x55')](path[_0xafbf('0x59')](config['root'],_0xafbf('0x5a'),_0x55e928[_0xafbf('0x56')]),util[_0xafbf('0x5e')](_0xafbf('0x5f'),_0x55e928['basename']||_0x55e928[_0xafbf('0x2c')],_0x55e928[_0xafbf('0x57')][_0xafbf('0x60')]()));}})[_0xafbf('0x47')](handleError(_0x176b47,null));};
\ No newline at end of file
+var _0x98f3=['destroy','sendStatus','error','name','send','index','map','AnalyticExtractedReport','rawAttributes','fieldName','type','model','query','keys','filters','intersection','attributes','fields','length','nolimit','order','sort','filter','where','merge','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','params','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','download','basename','savename','output','existsSync','server/files/reports','Sequelize','ValidationError','Report\x20not\x20found\x20or\x20empty','exists','join','root','format','%s.%s','eml-format','zip-dir','fast-json-patch','moment','mustache','util','path','sox','ejs','lodash','squel','crypto','jsforce','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../mysqldb','end','status','offset','undefined','limit','count','set','json','apply','save','update','then','get','ExtractedReports','UserProfileResource'];(function(_0x53f1bb,_0x17ac53){var _0x2e55e6=function(_0x57b236){while(--_0x57b236){_0x53f1bb['push'](_0x53f1bb['shift']());}};_0x2e55e6(++_0x17ac53);}(_0x98f3,0x160));var _0x398f=function(_0x43a4c2,_0x4e400f){_0x43a4c2=_0x43a4c2-0x0;var _0x3cd4fb=_0x98f3[_0x43a4c2];return _0x3cd4fb;};'use strict';var emlformat=require(_0x398f('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x398f('0x1'));var jsonpatch=require(_0x398f('0x2'));var rp=require('request-promise');var moment=require(_0x398f('0x3'));var BPromise=require('bluebird');var Mustache=require(_0x398f('0x4'));var util=require(_0x398f('0x5'));var path=require(_0x398f('0x6'));var sox=require(_0x398f('0x7'));var csv=require('to-csv');var ejs=require(_0x398f('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x398f('0x9'));var squel=require(_0x398f('0xa'));var crypto=require(_0x398f('0xb'));var jsforce=require(_0x398f('0xc'));var deskjs=require('desk.js');var toCsv=require(_0x398f('0xd'));var querystring=require(_0x398f('0xe'));var Papa=require(_0x398f('0xf'));var Redis=require(_0x398f('0x10'));var authService=require(_0x398f('0x11'));var qs=require(_0x398f('0x12'));var as=require(_0x398f('0x13'));var hardwareService=require(_0x398f('0x14'));var logger=require(_0x398f('0x15'))(_0x398f('0x16'));var utils=require(_0x398f('0x17'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0x398f('0x18'))['db'];function respondWithStatusCode(_0x146ca1,_0x114f0a){_0x114f0a=_0x114f0a||0xcc;return function(_0xd04d5){if(_0xd04d5){return _0x146ca1['sendStatus'](_0x114f0a);}return _0x146ca1['status'](_0x114f0a)[_0x398f('0x19')]();};}function respondWithResult(_0xba7adc,_0x354a27){_0x354a27=_0x354a27||0xc8;return function(_0x3757aa){if(_0x3757aa){return _0xba7adc[_0x398f('0x1a')](_0x354a27)['json'](_0x3757aa);}};}function respondWithFilteredResult(_0x592f31,_0x3de773){return function(_0x2415ca){if(_0x2415ca){var _0xff5783=typeof _0x3de773[_0x398f('0x1b')]===_0x398f('0x1c')&&typeof _0x3de773[_0x398f('0x1d')]==='undefined';var _0x3b023f=_0x2415ca[_0x398f('0x1e')];var _0x4656bc=_0xff5783?0x0:_0x3de773['offset'];var _0x457365=_0xff5783?_0x2415ca['count']:_0x3de773['offset']+_0x3de773['limit'];var _0x4bf50c;if(_0x457365>=_0x3b023f){_0x457365=_0x3b023f;_0x4bf50c=0xc8;}else{_0x4bf50c=0xce;}_0x592f31[_0x398f('0x1a')](_0x4bf50c);return _0x592f31[_0x398f('0x1f')]('Content-Range',_0x4656bc+'-'+_0x457365+'/'+_0x3b023f)[_0x398f('0x20')](_0x2415ca);}return null;};}function patchUpdates(_0x5493a1){return function(_0xb64ff){try{jsonpatch[_0x398f('0x21')](_0xb64ff,_0x5493a1,!![]);}catch(_0x2769c0){return BPromise['reject'](_0x2769c0);}return _0xb64ff[_0x398f('0x22')]();};}function saveUpdates(_0x45e3d4,_0x59a41c){return function(_0x1e7848){if(_0x1e7848){return _0x1e7848[_0x398f('0x23')](_0x45e3d4)['then'](function(_0x1edaae){return _0x1edaae;});}return null;};}function removeEntity(_0x1ec868,_0x2be535){return function(_0x1ed881){if(_0x1ed881){return _0x1ed881['destroy']()[_0x398f('0x24')](function(){var _0x12675e=_0x1ed881[_0x398f('0x25')]({'plain':!![]});var _0x1482af=_0x398f('0x26');return db[_0x398f('0x27')][_0x398f('0x28')]({'where':{'type':_0x1482af,'resourceId':_0x12675e['id']}})['then'](function(){return _0x1ed881;});})[_0x398f('0x24')](function(){_0x1ec868[_0x398f('0x1a')](0xcc)[_0x398f('0x19')]();});}};}function handleEntityNotFound(_0x236782,_0x4bf143){return function(_0x1f251b){if(!_0x1f251b){_0x236782[_0x398f('0x29')](0x194);}return _0x1f251b;};}function handleError(_0x2bbcb8,_0xa3c1a1){_0xa3c1a1=_0xa3c1a1||0x1f4;return function(_0x5ad454){logger[_0x398f('0x2a')](_0x5ad454['stack']);if(_0x5ad454[_0x398f('0x2b')]){delete _0x5ad454['name'];}_0x2bbcb8[_0x398f('0x1a')](_0xa3c1a1)[_0x398f('0x2c')](_0x5ad454);};}exports[_0x398f('0x2d')]=function(_0x316726,_0x59d74f){var _0x4f76a3={},_0x4c5e26={},_0x12fa03={'count':0x0,'rows':[]};var _0x182773=_[_0x398f('0x2e')](db[_0x398f('0x2f')][_0x398f('0x30')],function(_0x37d3fb){return{'name':_0x37d3fb[_0x398f('0x31')],'type':_0x37d3fb[_0x398f('0x32')]['key']};});_0x4c5e26[_0x398f('0x33')]=_[_0x398f('0x2e')](_0x182773,_0x398f('0x2b'));_0x4c5e26[_0x398f('0x34')]=_[_0x398f('0x35')](_0x316726[_0x398f('0x34')]);_0x4c5e26[_0x398f('0x36')]=_[_0x398f('0x37')](_0x4c5e26['model'],_0x4c5e26[_0x398f('0x34')]);_0x4f76a3[_0x398f('0x38')]=_[_0x398f('0x37')](_0x4c5e26['model'],qs[_0x398f('0x39')](_0x316726[_0x398f('0x34')][_0x398f('0x39')]));_0x4f76a3[_0x398f('0x38')]=_0x4f76a3[_0x398f('0x38')][_0x398f('0x3a')]?_0x4f76a3[_0x398f('0x38')]:_0x4c5e26[_0x398f('0x33')];if(!_0x316726[_0x398f('0x34')]['hasOwnProperty'](_0x398f('0x3b'))){_0x4f76a3[_0x398f('0x1d')]=qs[_0x398f('0x1d')](_0x316726[_0x398f('0x34')][_0x398f('0x1d')]);_0x4f76a3[_0x398f('0x1b')]=qs[_0x398f('0x1b')](_0x316726[_0x398f('0x34')][_0x398f('0x1b')]);}_0x4f76a3[_0x398f('0x3c')]=qs[_0x398f('0x3d')](_0x316726[_0x398f('0x34')][_0x398f('0x3d')]);_0x4f76a3['where']=qs['filters'](_['pick'](_0x316726[_0x398f('0x34')],_0x4c5e26[_0x398f('0x36')]),_0x182773);if(_0x316726[_0x398f('0x34')][_0x398f('0x3e')]){_0x4f76a3[_0x398f('0x3f')]=_[_0x398f('0x40')](_0x4f76a3[_0x398f('0x3f')],{'$or':_[_0x398f('0x2e')](_0x182773,function(_0x180464){if(_0x180464['type']!==_0x398f('0x41')){var _0x5232d2={};_0x5232d2[_0x180464[_0x398f('0x2b')]]={'$like':'%'+_0x316726[_0x398f('0x34')]['filter']+'%'};return _0x5232d2;}})});}_0x4f76a3=_[_0x398f('0x40')]({},_0x4f76a3,_0x316726[_0x398f('0x42')]);var _0x48cfc6={'where':_0x4f76a3['where']};return db['AnalyticExtractedReport'][_0x398f('0x1e')](_0x48cfc6)[_0x398f('0x24')](function(_0x3ee153){_0x12fa03[_0x398f('0x1e')]=_0x3ee153;if(_0x316726['query'][_0x398f('0x43')]){_0x4f76a3[_0x398f('0x44')]=[{'all':!![]}];}return db['AnalyticExtractedReport'][_0x398f('0x45')](_0x4f76a3);})['then'](function(_0x317bb9){_0x12fa03[_0x398f('0x46')]=_0x317bb9;return _0x12fa03;})['then'](respondWithFilteredResult(_0x59d74f,_0x4f76a3))[_0x398f('0x47')](handleError(_0x59d74f,null));};exports[_0x398f('0x48')]=function(_0x5d869f,_0x351530){var _0x49a3b2={'raw':!![],'where':{'id':_0x5d869f[_0x398f('0x49')]['id']}},_0x8d0909={};_0x8d0909[_0x398f('0x33')]=_[_0x398f('0x35')](db[_0x398f('0x2f')][_0x398f('0x30')]);_0x8d0909[_0x398f('0x34')]=_['keys'](_0x5d869f[_0x398f('0x34')]);_0x8d0909['filters']=_[_0x398f('0x37')](_0x8d0909[_0x398f('0x33')],_0x8d0909[_0x398f('0x34')]);_0x49a3b2[_0x398f('0x38')]=_[_0x398f('0x37')](_0x8d0909[_0x398f('0x33')],qs[_0x398f('0x39')](_0x5d869f[_0x398f('0x34')][_0x398f('0x39')]));_0x49a3b2[_0x398f('0x38')]=_0x49a3b2['attributes']['length']?_0x49a3b2['attributes']:_0x8d0909[_0x398f('0x33')];if(_0x5d869f['query'][_0x398f('0x43')]){_0x49a3b2[_0x398f('0x44')]=[{'all':!![]}];}_0x49a3b2=_[_0x398f('0x40')]({},_0x49a3b2,_0x5d869f['options']);return db[_0x398f('0x2f')][_0x398f('0x4a')](_0x49a3b2)[_0x398f('0x24')](handleEntityNotFound(_0x351530,null))[_0x398f('0x24')](respondWithResult(_0x351530,null))[_0x398f('0x47')](handleError(_0x351530,null));};exports[_0x398f('0x4b')]=function(_0x26f4c4,_0x52f9e9){return db[_0x398f('0x2f')][_0x398f('0x4b')](_0x26f4c4[_0x398f('0x4c')],{})['then'](function(_0xdf91da){var _0x4a7393=_0x26f4c4[_0x398f('0x4d')][_0x398f('0x25')]({'plain':!![]});if(!_0x4a7393)throw new Error(_0x398f('0x4e'));if(_0x4a7393[_0x398f('0x4f')]===_0x398f('0x4d')){var _0x4b7e43=_0xdf91da[_0x398f('0x25')]({'plain':!![]});var _0x46a44d=_0x398f('0x26');return db[_0x398f('0x50')]['find']({'where':{'name':_0x46a44d,'userProfileId':_0x4a7393[_0x398f('0x51')]},'raw':!![]})[_0x398f('0x24')](function(_0x144f8a){if(_0x144f8a&&_0x144f8a[_0x398f('0x52')]===0x0){return db['UserProfileResource']['create']({'name':_0x4b7e43[_0x398f('0x2b')],'resourceId':_0x4b7e43['id'],'type':_0x144f8a[_0x398f('0x2b')],'sectionId':_0x144f8a['id']},{})[_0x398f('0x24')](function(){return _0xdf91da;});}else{return _0xdf91da;}})[_0x398f('0x47')](function(_0x1f10e1){logger['error'](_0x398f('0x53'),_0x1f10e1);throw _0x1f10e1;});}return _0xdf91da;})[_0x398f('0x24')](respondWithResult(_0x52f9e9,0xc9))[_0x398f('0x47')](handleError(_0x52f9e9,null));};exports[_0x398f('0x23')]=function(_0x1bd493,_0x172ea3){if(_0x1bd493[_0x398f('0x4c')]['id']){delete _0x1bd493['body']['id'];}return db['AnalyticExtractedReport'][_0x398f('0x4a')]({'where':{'id':_0x1bd493[_0x398f('0x49')]['id']}})[_0x398f('0x24')](handleEntityNotFound(_0x172ea3,null))[_0x398f('0x24')](saveUpdates(_0x1bd493[_0x398f('0x4c')],null))[_0x398f('0x24')](respondWithResult(_0x172ea3,null))[_0x398f('0x47')](handleError(_0x172ea3,null));};exports[_0x398f('0x28')]=function(_0xcca89f,_0x12801b){return db[_0x398f('0x2f')][_0x398f('0x4a')]({'where':{'id':_0xcca89f[_0x398f('0x49')]['id']}})['then'](handleEntityNotFound(_0x12801b,null))[_0x398f('0x24')](removeEntity(_0x12801b,null))[_0x398f('0x47')](handleError(_0x12801b,null));};exports[_0x398f('0x54')]=function(_0x569505,_0x50e339,_0x25bfc3){return db[_0x398f('0x2f')][_0x398f('0x4a')]({'where':{'id':_0x569505['params']['id']},'attributes':[_0x398f('0x2b'),_0x398f('0x55'),_0x398f('0x56'),_0x398f('0x57')],'raw':!![]})[_0x398f('0x24')](handleEntityNotFound(_0x50e339,null))['then'](function(_0x20aac8){if(_0x20aac8){if(!fs[_0x398f('0x58')](path['join'](config['root'],_0x398f('0x59'),_0x20aac8[_0x398f('0x56')]))){throw new db[(_0x398f('0x5a'))][(_0x398f('0x5b'))](_0x398f('0x5c'));}if(_0x569505[_0x398f('0x34')][_0x398f('0x5d')]){return _0x50e339[_0x398f('0x29')](0xc8);}return _0x50e339['download'](path[_0x398f('0x5e')](config[_0x398f('0x5f')],_0x398f('0x59'),_0x20aac8[_0x398f('0x56')]),util[_0x398f('0x60')](_0x398f('0x61'),_0x20aac8[_0x398f('0x55')]||_0x20aac8[_0x398f('0x2b')],_0x20aac8['output']['toLowerCase']()));}})[_0x398f('0x47')](handleError(_0x50e339,null));};
\ No newline at end of file
diff --git a/server/api/analyticExtractedReport/analyticExtractedReport.model.js b/server/api/analyticExtractedReport/analyticExtractedReport.model.js
index cc20943..0c9bdcd 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 _0x4b67=['lodash','util','api','bluebird','path','../../config/environment','./analyticExtractedReport.attributes','exports','define','analytics_extracted_reports'];(function(_0x480433,_0x5dbba1){var _0x2ae111=function(_0x357dfd){while(--_0x357dfd){_0x480433['push'](_0x480433['shift']());}};_0x2ae111(++_0x5dbba1);}(_0x4b67,0x1a4));var _0x74b6=function(_0x17ab89,_0x4aaf5f){_0x17ab89=_0x17ab89-0x0;var _0x333bb9=_0x4b67[_0x17ab89];return _0x333bb9;};'use strict';var _=require(_0x74b6('0x0'));var util=require(_0x74b6('0x1'));var logger=require('../../config/logger')(_0x74b6('0x2'));var moment=require('moment');var BPromise=require(_0x74b6('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x74b6('0x4'));var rimraf=require('rimraf');var config=require(_0x74b6('0x5'));var attributes=require(_0x74b6('0x6'));module[_0x74b6('0x7')]=function(_0x1cc00a,_0x4b2442){return _0x1cc00a[_0x74b6('0x8')]('AnalyticExtractedReport',attributes,{'tableName':_0x74b6('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x353e=['../../config/environment','define','AnalyticExtractedReport','lodash','util','../../config/logger','moment','rimraf'];(function(_0xc43980,_0x11ba0f){var _0x22bb21=function(_0x10a337){while(--_0x10a337){_0xc43980['push'](_0xc43980['shift']());}};_0x22bb21(++_0x11ba0f);}(_0x353e,0x1cb));var _0xe353=function(_0x42e152,_0x2ea287){_0x42e152=_0x42e152-0x0;var _0x2609bc=_0x353e[_0x42e152];return _0x2609bc;};'use strict';var _=require(_0xe353('0x0'));var util=require(_0xe353('0x1'));var logger=require(_0xe353('0x2'))('api');var moment=require(_0xe353('0x3'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0xe353('0x4'));var config=require(_0xe353('0x5'));var attributes=require('./analyticExtractedReport.attributes');module['exports']=function(_0x415e37,_0x32d645){return _0x415e37[_0xe353('0x6')](_0xe353('0x7'),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 08dac6f..fa10671 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 _0x792f=['../../config/logger','rpc','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','result','catch','util','moment','bluebird','randomstring','ioredis','../../config/utils'];(function(_0x29e1ad,_0x569e63){var _0xe60afd=function(_0x2b6a50){while(--_0x2b6a50){_0x29e1ad['push'](_0x29e1ad['shift']());}};_0xe60afd(++_0x569e63);}(_0x792f,0x10e));var _0xf792=function(_0x4a599b,_0x1d2125){_0x4a599b=_0x4a599b-0x0;var _0x2d53d3=_0x792f[_0x4a599b];return _0x2d53d3;};'use strict';var _=require('lodash');var util=require(_0xf792('0x0'));var moment=require(_0xf792('0x1'));var BPromise=require(_0xf792('0x2'));var rs=require(_0xf792('0x3'));var fs=require('fs');var Redis=require(_0xf792('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0xf792('0x5'));var logger=require(_0xf792('0x6'))(_0xf792('0x7'));var config=require('../../config/environment');var jayson=require(_0xf792('0x8'));var client=jayson[_0xf792('0x9')][_0xf792('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x3f7cdc,_0x35634c,_0x48f50a){return new BPromise(function(_0xc9a946,_0x25e810){return client[_0xf792('0xb')](_0x3f7cdc,_0x48f50a)[_0xf792('0xc')](function(_0x47603e){logger[_0xf792('0xd')](_0xf792('0xe'),_0x35634c,_0xf792('0xf'));logger[_0xf792('0x10')](_0xf792('0x11'),_0x35634c,_0xf792('0xf'),JSON['stringify'](_0x47603e));if(_0x47603e['error']){if(_0x47603e[_0xf792('0x12')][_0xf792('0x13')]===0x1f4){logger[_0xf792('0x12')]('AnalyticExtractedReport,\x20%s,\x20%s',_0x35634c,_0x47603e[_0xf792('0x12')][_0xf792('0x14')]);return _0x25e810(_0x47603e[_0xf792('0x12')][_0xf792('0x14')]);}logger['error']('AnalyticExtractedReport,\x20%s,\x20%s',_0x35634c,_0x47603e['error']['message']);return _0xc9a946(_0x47603e[_0xf792('0x12')][_0xf792('0x14')]);}else{logger[_0xf792('0xd')]('AnalyticExtractedReport,\x20%s,\x20%s',_0x35634c,_0xf792('0xf'));_0xc9a946(_0x47603e[_0xf792('0x15')][_0xf792('0x14')]);}})[_0xf792('0x16')](function(_0x2e8811){logger[_0xf792('0x12')](_0xf792('0xe'),_0x35634c,_0x2e8811);_0x25e810(_0x2e8811);});});}
\ No newline at end of file
+var _0xf117=['code','message','result','catch','util','moment','bluebird','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','then','info','AnalyticExtractedReport,\x20%s,\x20%s','request\x20sent','debug','AnalyticExtractedReport,\x20%s,\x20%s,\x20%s','error'];(function(_0x3f0b30,_0x159bc8){var _0x2748a5=function(_0x3b42cc){while(--_0x3b42cc){_0x3f0b30['push'](_0x3f0b30['shift']());}};_0x2748a5(++_0x159bc8);}(_0xf117,0x122));var _0x7f11=function(_0x29d94e,_0xf386d6){_0x29d94e=_0x29d94e-0x0;var _0x106237=_0xf117[_0x29d94e];return _0x106237;};'use strict';var _=require('lodash');var util=require(_0x7f11('0x0'));var moment=require(_0x7f11('0x1'));var BPromise=require(_0x7f11('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x7f11('0x3'))['db'];var utils=require(_0x7f11('0x4'));var logger=require(_0x7f11('0x5'))(_0x7f11('0x6'));var config=require(_0x7f11('0x7'));var jayson=require(_0x7f11('0x8'));var client=jayson[_0x7f11('0x9')][_0x7f11('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x403fc2,_0x736b91,_0x19b223){return new BPromise(function(_0x432802,_0x4f98c1){return client['request'](_0x403fc2,_0x19b223)[_0x7f11('0xb')](function(_0x44c8e3){logger[_0x7f11('0xc')](_0x7f11('0xd'),_0x736b91,_0x7f11('0xe'));logger[_0x7f11('0xf')](_0x7f11('0x10'),_0x736b91,_0x7f11('0xe'),JSON['stringify'](_0x44c8e3));if(_0x44c8e3[_0x7f11('0x11')]){if(_0x44c8e3[_0x7f11('0x11')][_0x7f11('0x12')]===0x1f4){logger[_0x7f11('0x11')](_0x7f11('0xd'),_0x736b91,_0x44c8e3[_0x7f11('0x11')][_0x7f11('0x13')]);return _0x4f98c1(_0x44c8e3[_0x7f11('0x11')]['message']);}logger['error'](_0x7f11('0xd'),_0x736b91,_0x44c8e3[_0x7f11('0x11')]['message']);return _0x432802(_0x44c8e3['error'][_0x7f11('0x13')]);}else{logger[_0x7f11('0xc')](_0x7f11('0xd'),_0x736b91,_0x7f11('0xe'));_0x432802(_0x44c8e3[_0x7f11('0x14')][_0x7f11('0x13')]);}})[_0x7f11('0x15')](function(_0x328e2b){logger[_0x7f11('0x11')](_0x7f11('0xd'),_0x736b91,_0x328e2b);_0x4f98c1(_0x328e2b);});});}
\ No newline at end of file
diff --git a/server/api/analyticExtractedReport/index.js b/server/api/analyticExtractedReport/index.js
index 65ce6ea..29f901f 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 _0x43b0=['exports','multer','util','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','isAuthenticated','get','/:id','/:id/download','download','post','delete'];(function(_0x35b1f5,_0x5205cb){var _0xaa3672=function(_0x4c410b){while(--_0x4c410b){_0x35b1f5['push'](_0x35b1f5['shift']());}};_0xaa3672(++_0x5205cb);}(_0x43b0,0x1f1));var _0x043b=function(_0x5cbd00,_0x94392f){_0x5cbd00=_0x5cbd00-0x0;var _0x4dd707=_0x43b0[_0x5cbd00];return _0x4dd707;};'use strict';var multer=require(_0x043b('0x0'));var util=require(_0x043b('0x1'));var path=require(_0x043b('0x2'));var timeout=require('connect-timeout');var express=require(_0x043b('0x3'));var router=express[_0x043b('0x4')]();var fs_extra=require(_0x043b('0x5'));var auth=require(_0x043b('0x6'));var interaction=require(_0x043b('0x7'));var config=require('../../config/environment');var controller=require('./analyticExtractedReport.controller');router['get']('/',auth[_0x043b('0x8')](),controller['index']);router[_0x043b('0x9')](_0x043b('0xa'),auth[_0x043b('0x8')](),controller['show']);router['get'](_0x043b('0xb'),auth[_0x043b('0x8')](),controller[_0x043b('0xc')]);router[_0x043b('0xd')]('/',auth['isAuthenticated'](),controller['create']);router['put'](_0x043b('0xa'),auth['isAuthenticated'](),controller['update']);router[_0x043b('0xe')](_0x043b('0xa'),auth[_0x043b('0x8')](),controller['destroy']);module[_0x043b('0xf')]=router;
\ No newline at end of file
+var _0x805c=['./analyticExtractedReport.controller','index','get','/:id','isAuthenticated','/:id/download','download','put','update','destroy','exports','path','connect-timeout','../../components/auth/service','../../components/interaction/service','../../config/environment'];(function(_0x576266,_0x4002b0){var _0x18234f=function(_0x4e9ad5){while(--_0x4e9ad5){_0x576266['push'](_0x576266['shift']());}};_0x18234f(++_0x4002b0);}(_0x805c,0x6b));var _0xc805=function(_0x3b80a3,_0x3611cd){_0x3b80a3=_0x3b80a3-0x0;var _0x85491b=_0x805c[_0x3b80a3];return _0x85491b;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0xc805('0x0'));var timeout=require(_0xc805('0x1'));var express=require('express');var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0xc805('0x2'));var interaction=require(_0xc805('0x3'));var config=require(_0xc805('0x4'));var controller=require(_0xc805('0x5'));router['get']('/',auth['isAuthenticated'](),controller[_0xc805('0x6')]);router[_0xc805('0x7')](_0xc805('0x8'),auth[_0xc805('0x9')](),controller['show']);router[_0xc805('0x7')](_0xc805('0xa'),auth[_0xc805('0x9')](),controller[_0xc805('0xb')]);router['post']('/',auth[_0xc805('0x9')](),controller['create']);router[_0xc805('0xc')]('/:id',auth[_0xc805('0x9')](),controller[_0xc805('0xd')]);router['delete'](_0xc805('0x8'),auth['isAuthenticated'](),controller[_0xc805('0xe')]);module[_0xc805('0xf')]=router;
\ No newline at end of file
diff --git a/server/api/analyticFieldReport/analyticFieldReport.attributes.js b/server/api/analyticFieldReport/analyticFieldReport.attributes.js
index 6eb6151..bca549e 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 _0x36e9=['TEXT','STRING','BOOLEAN','sequelize'];(function(_0x257642,_0x270a80){var _0x3d813b=function(_0x2a1c8a){while(--_0x2a1c8a){_0x257642['push'](_0x257642['shift']());}};_0x3d813b(++_0x270a80);}(_0x36e9,0x15b));var _0x936e=function(_0x49ca18,_0x5e6d05){_0x49ca18=_0x49ca18-0x0;var _0x145d54=_0x36e9[_0x49ca18];return _0x145d54;};'use strict';var Sequelize=require(_0x936e('0x0'));module['exports']={'field':{'type':Sequelize[_0x936e('0x1')]},'alias':{'type':Sequelize['STRING']},'function':{'type':Sequelize[_0x936e('0x2')]},'format':{'type':Sequelize[_0x936e('0x2')]},'groupBy':{'type':Sequelize[_0x936e('0x3')],'defaultValue':![]},'orderBy':{'type':Sequelize[_0x936e('0x2')]},'custom':{'type':Sequelize[_0x936e('0x3')],'defaultValue':![]}};
\ No newline at end of file
+var _0x3895=['sequelize','exports','TEXT','STRING','BOOLEAN'];(function(_0x295caa,_0x1eb8a6){var _0x1f6de3=function(_0x34f4be){while(--_0x34f4be){_0x295caa['push'](_0x295caa['shift']());}};_0x1f6de3(++_0x1eb8a6);}(_0x3895,0x14a));var _0x5389=function(_0x113c41,_0x3666f0){_0x113c41=_0x113c41-0x0;var _0x3d7d33=_0x3895[_0x113c41];return _0x3d7d33;};'use strict';var Sequelize=require(_0x5389('0x0'));module[_0x5389('0x1')]={'field':{'type':Sequelize[_0x5389('0x2')]},'alias':{'type':Sequelize['STRING']},'function':{'type':Sequelize[_0x5389('0x3')]},'format':{'type':Sequelize['STRING']},'groupBy':{'type':Sequelize[_0x5389('0x4')],'defaultValue':![]},'orderBy':{'type':Sequelize[_0x5389('0x3')]},'custom':{'type':Sequelize[_0x5389('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 53f08cf..fa5004d 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 _0x978a=['lodash','squel','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','sendStatus','status','json','offset','undefined','limit','count','set','Content-Range','reject','save','then','error','stack','name','index','map','AnalyticFieldReport','fieldName','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','order','sort','pick','filter','where','merge','type','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','params','rawAttributes','find','create','body','bulkCreate','destroy','bulkDestroy','addFields','AnalyticCustomReport','findOne','CustomReportId','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','ejs'];(function(_0x3cc31a,_0x4bbb08){var _0xe50e0c=function(_0x319830){while(--_0x319830){_0x3cc31a['push'](_0x3cc31a['shift']());}};_0xe50e0c(++_0x4bbb08);}(_0x978a,0x190));var _0xa978=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x978a[_0x3dd15e];return _0x231fd0;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xa978('0x0'));var zipdir=require(_0xa978('0x1'));var jsonpatch=require(_0xa978('0x2'));var rp=require(_0xa978('0x3'));var moment=require(_0xa978('0x4'));var BPromise=require(_0xa978('0x5'));var Mustache=require(_0xa978('0x6'));var util=require(_0xa978('0x7'));var path=require(_0xa978('0x8'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0xa978('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xa978('0xa'));var squel=require(_0xa978('0xb'));var crypto=require('crypto');var jsforce=require(_0xa978('0xc'));var deskjs=require(_0xa978('0xd'));var toCsv=require(_0xa978('0xe'));var querystring=require(_0xa978('0xf'));var Papa=require(_0xa978('0x10'));var Redis=require(_0xa978('0x11'));var authService=require(_0xa978('0x12'));var qs=require(_0xa978('0x13'));var as=require(_0xa978('0x14'));var hardwareService=require(_0xa978('0x15'));var logger=require(_0xa978('0x16'))(_0xa978('0x17'));var utils=require('../../config/utils');var config=require(_0xa978('0x18'));var licenseUtil=require(_0xa978('0x19'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x422715,_0x2e6dc4){_0x2e6dc4=_0x2e6dc4||0xcc;return function(_0x37377a){if(_0x37377a){return _0x422715[_0xa978('0x1a')](_0x2e6dc4);}return _0x422715[_0xa978('0x1b')](_0x2e6dc4)['end']();};}function respondWithResult(_0x345e57,_0x2db5f2){_0x2db5f2=_0x2db5f2||0xc8;return function(_0x154655){if(_0x154655){return _0x345e57[_0xa978('0x1b')](_0x2db5f2)[_0xa978('0x1c')](_0x154655);}};}function respondWithFilteredResult(_0x2eae1b,_0x3b2e61){return function(_0x3c1856){if(_0x3c1856){var _0x162098=typeof _0x3b2e61[_0xa978('0x1d')]===_0xa978('0x1e')&&typeof _0x3b2e61[_0xa978('0x1f')]===_0xa978('0x1e');var _0x1600e0=_0x3c1856[_0xa978('0x20')];var _0x1a6448=_0x162098?0x0:_0x3b2e61[_0xa978('0x1d')];var _0x10a235=_0x162098?_0x3c1856[_0xa978('0x20')]:_0x3b2e61[_0xa978('0x1d')]+_0x3b2e61['limit'];var _0x239477;if(_0x10a235>=_0x1600e0){_0x10a235=_0x1600e0;_0x239477=0xc8;}else{_0x239477=0xce;}_0x2eae1b[_0xa978('0x1b')](_0x239477);return _0x2eae1b[_0xa978('0x21')](_0xa978('0x22'),_0x1a6448+'-'+_0x10a235+'/'+_0x1600e0)['json'](_0x3c1856);}return null;};}function patchUpdates(_0x2c64ab){return function(_0x24c712){try{jsonpatch['apply'](_0x24c712,_0x2c64ab,!![]);}catch(_0x5e882c){return BPromise[_0xa978('0x23')](_0x5e882c);}return _0x24c712[_0xa978('0x24')]();};}function saveUpdates(_0x1f2dbb,_0x925572){return function(_0x466462){if(_0x466462){return _0x466462['update'](_0x1f2dbb)[_0xa978('0x25')](function(_0xba3c79){return _0xba3c79;});}return null;};}function removeEntity(_0x123c23,_0x9073c4){return function(_0x564546){if(_0x564546){return _0x564546['destroy']()[_0xa978('0x25')](function(){_0x123c23[_0xa978('0x1b')](0xcc)['end']();});}};}function handleEntityNotFound(_0x2905c7,_0x3d49d0){return function(_0x43613e){if(!_0x43613e){_0x2905c7['sendStatus'](0x194);}return _0x43613e;};}function handleError(_0x3c9f92,_0x1dd266){_0x1dd266=_0x1dd266||0x1f4;return function(_0xdba941){logger[_0xa978('0x26')](_0xdba941[_0xa978('0x27')]);if(_0xdba941[_0xa978('0x28')]){delete _0xdba941[_0xa978('0x28')];}_0x3c9f92['status'](_0x1dd266)['send'](_0xdba941);};}exports[_0xa978('0x29')]=function(_0x13f891,_0x4b584b){var _0x32e38a={},_0x5b803d={},_0x525739={'count':0x0,'rows':[]};var _0x1154ae=_[_0xa978('0x2a')](db[_0xa978('0x2b')]['rawAttributes'],function(_0x403c5c){return{'name':_0x403c5c[_0xa978('0x2c')],'type':_0x403c5c['type'][_0xa978('0x2d')]};});_0x5b803d[_0xa978('0x2e')]=_[_0xa978('0x2a')](_0x1154ae,'name');_0x5b803d[_0xa978('0x2f')]=_[_0xa978('0x30')](_0x13f891[_0xa978('0x2f')]);_0x5b803d[_0xa978('0x31')]=_[_0xa978('0x32')](_0x5b803d['model'],_0x5b803d[_0xa978('0x2f')]);_0x32e38a[_0xa978('0x33')]=_[_0xa978('0x32')](_0x5b803d['model'],qs[_0xa978('0x34')](_0x13f891['query'][_0xa978('0x34')]));_0x32e38a[_0xa978('0x33')]=_0x32e38a[_0xa978('0x33')][_0xa978('0x35')]?_0x32e38a[_0xa978('0x33')]:_0x5b803d[_0xa978('0x2e')];if(!_0x13f891['query'][_0xa978('0x36')]('nolimit')){_0x32e38a[_0xa978('0x1f')]=qs[_0xa978('0x1f')](_0x13f891[_0xa978('0x2f')][_0xa978('0x1f')]);_0x32e38a[_0xa978('0x1d')]=qs['offset'](_0x13f891[_0xa978('0x2f')][_0xa978('0x1d')]);}_0x32e38a[_0xa978('0x37')]=qs['sort'](_0x13f891[_0xa978('0x2f')][_0xa978('0x38')]);_0x32e38a['where']=qs['filters'](_[_0xa978('0x39')](_0x13f891[_0xa978('0x2f')],_0x5b803d[_0xa978('0x31')]),_0x1154ae);if(_0x13f891[_0xa978('0x2f')][_0xa978('0x3a')]){_0x32e38a[_0xa978('0x3b')]=_[_0xa978('0x3c')](_0x32e38a[_0xa978('0x3b')],{'$or':_[_0xa978('0x2a')](_0x1154ae,function(_0x45027b){if(_0x45027b[_0xa978('0x3d')]!==_0xa978('0x3e')){var _0x160e91={};_0x160e91[_0x45027b['name']]={'$like':'%'+_0x13f891[_0xa978('0x2f')][_0xa978('0x3a')]+'%'};return _0x160e91;}})});}_0x32e38a=_['merge']({},_0x32e38a,_0x13f891[_0xa978('0x3f')]);var _0x4d7df0={'where':_0x32e38a[_0xa978('0x3b')]};return db[_0xa978('0x2b')][_0xa978('0x20')](_0x4d7df0)[_0xa978('0x25')](function(_0x3b41ff){_0x525739[_0xa978('0x20')]=_0x3b41ff;if(_0x13f891[_0xa978('0x2f')][_0xa978('0x40')]){_0x32e38a[_0xa978('0x41')]=[{'all':!![]}];}return db[_0xa978('0x2b')][_0xa978('0x42')](_0x32e38a);})['then'](function(_0x17c872){_0x525739[_0xa978('0x43')]=_0x17c872;return _0x525739;})['then'](respondWithFilteredResult(_0x4b584b,_0x32e38a))[_0xa978('0x44')](handleError(_0x4b584b,null));};exports[_0xa978('0x45')]=function(_0x4b20d1,_0x4a0b15){var _0x1a3ee2={'raw':![],'where':{'id':_0x4b20d1[_0xa978('0x46')]['id']}},_0x3ba5ea={};_0x3ba5ea[_0xa978('0x2e')]=_[_0xa978('0x30')](db[_0xa978('0x2b')][_0xa978('0x47')]);_0x3ba5ea[_0xa978('0x2f')]=_[_0xa978('0x30')](_0x4b20d1[_0xa978('0x2f')]);_0x3ba5ea[_0xa978('0x31')]=_[_0xa978('0x32')](_0x3ba5ea[_0xa978('0x2e')],_0x3ba5ea[_0xa978('0x2f')]);_0x1a3ee2[_0xa978('0x33')]=_[_0xa978('0x32')](_0x3ba5ea['model'],qs['fields'](_0x4b20d1[_0xa978('0x2f')][_0xa978('0x34')]));_0x1a3ee2['attributes']=_0x1a3ee2[_0xa978('0x33')][_0xa978('0x35')]?_0x1a3ee2['attributes']:_0x3ba5ea['model'];if(_0x4b20d1[_0xa978('0x2f')]['includeAll']){_0x1a3ee2[_0xa978('0x41')]=[{'all':!![]}];}_0x1a3ee2=_[_0xa978('0x3c')]({},_0x1a3ee2,_0x4b20d1[_0xa978('0x3f')]);return db[_0xa978('0x2b')][_0xa978('0x48')](_0x1a3ee2)['then'](handleEntityNotFound(_0x4a0b15,null))['then'](respondWithResult(_0x4a0b15,null))['catch'](handleError(_0x4a0b15,null));};exports[_0xa978('0x49')]=function(_0x5db3cd,_0x1846e4){return db[_0xa978('0x2b')][_0xa978('0x49')](_0x5db3cd[_0xa978('0x4a')],{})[_0xa978('0x25')](respondWithResult(_0x1846e4,0xc9))[_0xa978('0x44')](handleError(_0x1846e4,null));};exports[_0xa978('0x4b')]=function(_0x5da8ae,_0x34042d){return db[_0xa978('0x2b')][_0xa978('0x4b')](_0x5da8ae['body'],{'raw':![],'individualHooks':!![]})[_0xa978('0x25')](respondWithResult(_0x34042d,0xc9))[_0xa978('0x44')](handleError(_0x34042d,null));};exports['update']=function(_0x32828b,_0x56b306){if(_0x32828b[_0xa978('0x4a')]['id']){delete _0x32828b['body']['id'];}return db['AnalyticFieldReport'][_0xa978('0x48')]({'where':{'id':_0x32828b[_0xa978('0x46')]['id']}})[_0xa978('0x25')](handleEntityNotFound(_0x56b306,null))[_0xa978('0x25')](saveUpdates(_0x32828b[_0xa978('0x4a')],null))[_0xa978('0x25')](respondWithResult(_0x56b306,null))['catch'](handleError(_0x56b306,null));};exports[_0xa978('0x4c')]=function(_0x4539ef,_0x3ce330){return db['AnalyticFieldReport'][_0xa978('0x48')]({'where':{'id':_0x4539ef[_0xa978('0x46')]['id']}})[_0xa978('0x25')](handleEntityNotFound(_0x3ce330,null))[_0xa978('0x25')](removeEntity(_0x3ce330,null))[_0xa978('0x44')](handleError(_0x3ce330,null));};exports[_0xa978('0x4d')]=function(_0x491c4e,_0x3e1a30){return db[_0xa978('0x2b')][_0xa978('0x4c')]({'where':{'id':_0x491c4e['query']['ids']||[]},'raw':![],'individualHooks':!![]})[_0xa978('0x25')](respondWithResult(_0x3e1a30,0xcc))[_0xa978('0x44')](handleError(_0x3e1a30,null));};exports[_0xa978('0x4e')]=function(_0x4da522,_0x39b1d9,_0xaacb4c){return db[_0xa978('0x4f')][_0xa978('0x50')]({'where':{'id':_0x4da522[_0xa978('0x46')]['id']}})[_0xa978('0x25')](handleEntityNotFound(_0x39b1d9,null))['then'](function(_0x4d6552){if(_0x4d6552){return db['sequelize']['transaction'](function(_0xf425ef){return db[_0xa978('0x2b')]['destroy']({'where':{'CustomReportId':_0x4da522[_0xa978('0x46')]['id']},'transaction':_0xf425ef})[_0xa978('0x25')](function(_0xb8f552){var _0x5e0367=_[_0xa978('0x2a')](_0x4da522[_0xa978('0x4a')],function(_0x5e60ba){delete _0x5e60ba['id'];_0x5e60ba[_0xa978('0x51')]=_0x4da522[_0xa978('0x46')]['id'];return _0x5e60ba;});return db[_0xa978('0x2b')]['bulkCreate'](_0x5e0367,{'transaction':_0xf425ef});});})[_0xa978('0x25')](function(){return db[_0xa978('0x2b')][_0xa978('0x42')]({'where':{'CustomReportId':_0x4da522[_0xa978('0x46')]['id']}});});}})[_0xa978('0x25')](respondWithResult(_0x39b1d9,null))[_0xa978('0x44')](handleError(_0x39b1d9,null));};
\ No newline at end of file
+var _0x6447=['create','body','catch','bulkCreate','ids','addFields','AnalyticCustomReport','findOne','CustomReportId','findAll','eml-format','zip-dir','request-promise','moment','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','sendStatus','status','end','json','offset','undefined','count','limit','set','reject','update','then','destroy','name','send','index','map','AnalyticFieldReport','fieldName','type','key','model','query','keys','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','where','filters','filter','merge','VIRTUAL','options','includeAll','include','rows','show','params','find'];(function(_0x8c43de,_0x90ff31){var _0xa6591b=function(_0x469716){while(--_0x469716){_0x8c43de['push'](_0x8c43de['shift']());}};_0xa6591b(++_0x90ff31);}(_0x6447,0x14e));var _0x7644=function(_0x1a0daa,_0x2a4634){_0x1a0daa=_0x1a0daa-0x0;var _0x1dbe15=_0x6447[_0x1a0daa];return _0x1dbe15;};'use strict';var emlformat=require(_0x7644('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x7644('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0x7644('0x2'));var moment=require(_0x7644('0x3'));var BPromise=require(_0x7644('0x4'));var Mustache=require(_0x7644('0x5'));var util=require(_0x7644('0x6'));var path=require('path');var sox=require(_0x7644('0x7'));var csv=require(_0x7644('0x8'));var ejs=require(_0x7644('0x9'));var fs=require('fs');var fs_extra=require(_0x7644('0xa'));var _=require('lodash');var squel=require(_0x7644('0xb'));var crypto=require(_0x7644('0xc'));var jsforce=require(_0x7644('0xd'));var deskjs=require(_0x7644('0xe'));var toCsv=require('to-csv');var querystring=require(_0x7644('0xf'));var Papa=require(_0x7644('0x10'));var Redis=require(_0x7644('0x11'));var authService=require(_0x7644('0x12'));var qs=require(_0x7644('0x13'));var as=require(_0x7644('0x14'));var hardwareService=require(_0x7644('0x15'));var logger=require(_0x7644('0x16'))(_0x7644('0x17'));var utils=require(_0x7644('0x18'));var config=require(_0x7644('0x19'));var licenseUtil=require(_0x7644('0x1a'));var db=require(_0x7644('0x1b'))['db'];function respondWithStatusCode(_0x2ff6a9,_0x25cd1b){_0x25cd1b=_0x25cd1b||0xcc;return function(_0x14c908){if(_0x14c908){return _0x2ff6a9[_0x7644('0x1c')](_0x25cd1b);}return _0x2ff6a9[_0x7644('0x1d')](_0x25cd1b)[_0x7644('0x1e')]();};}function respondWithResult(_0x4a937a,_0x14966f){_0x14966f=_0x14966f||0xc8;return function(_0x5077de){if(_0x5077de){return _0x4a937a[_0x7644('0x1d')](_0x14966f)[_0x7644('0x1f')](_0x5077de);}};}function respondWithFilteredResult(_0x20259e,_0x5709f2){return function(_0x16a11f){if(_0x16a11f){var _0x44130f=typeof _0x5709f2[_0x7644('0x20')]===_0x7644('0x21')&&typeof _0x5709f2['limit']===_0x7644('0x21');var _0x516995=_0x16a11f[_0x7644('0x22')];var _0x28c8cb=_0x44130f?0x0:_0x5709f2[_0x7644('0x20')];var _0x44e58=_0x44130f?_0x16a11f[_0x7644('0x22')]:_0x5709f2[_0x7644('0x20')]+_0x5709f2[_0x7644('0x23')];var _0x150954;if(_0x44e58>=_0x516995){_0x44e58=_0x516995;_0x150954=0xc8;}else{_0x150954=0xce;}_0x20259e[_0x7644('0x1d')](_0x150954);return _0x20259e[_0x7644('0x24')]('Content-Range',_0x28c8cb+'-'+_0x44e58+'/'+_0x516995)['json'](_0x16a11f);}return null;};}function patchUpdates(_0x5c8004){return function(_0x32f988){try{jsonpatch['apply'](_0x32f988,_0x5c8004,!![]);}catch(_0x2e3a52){return BPromise[_0x7644('0x25')](_0x2e3a52);}return _0x32f988['save']();};}function saveUpdates(_0x39b113,_0x9a61a0){return function(_0x1968f8){if(_0x1968f8){return _0x1968f8[_0x7644('0x26')](_0x39b113)[_0x7644('0x27')](function(_0x231d41){return _0x231d41;});}return null;};}function removeEntity(_0x1cfe25,_0x3cfb4e){return function(_0x8a12ac){if(_0x8a12ac){return _0x8a12ac[_0x7644('0x28')]()[_0x7644('0x27')](function(){_0x1cfe25[_0x7644('0x1d')](0xcc)[_0x7644('0x1e')]();});}};}function handleEntityNotFound(_0x5b33cd,_0x4ea7f5){return function(_0x467672){if(!_0x467672){_0x5b33cd['sendStatus'](0x194);}return _0x467672;};}function handleError(_0x1f209c,_0x44dded){_0x44dded=_0x44dded||0x1f4;return function(_0x4e546e){logger['error'](_0x4e546e['stack']);if(_0x4e546e[_0x7644('0x29')]){delete _0x4e546e[_0x7644('0x29')];}_0x1f209c[_0x7644('0x1d')](_0x44dded)[_0x7644('0x2a')](_0x4e546e);};}exports[_0x7644('0x2b')]=function(_0x33489d,_0x3cff86){var _0x3df4b9={},_0x3f8e8d={},_0x215c54={'count':0x0,'rows':[]};var _0x4a0f2=_[_0x7644('0x2c')](db[_0x7644('0x2d')]['rawAttributes'],function(_0x1531b1){return{'name':_0x1531b1[_0x7644('0x2e')],'type':_0x1531b1[_0x7644('0x2f')][_0x7644('0x30')]};});_0x3f8e8d[_0x7644('0x31')]=_['map'](_0x4a0f2,'name');_0x3f8e8d[_0x7644('0x32')]=_[_0x7644('0x33')](_0x33489d['query']);_0x3f8e8d['filters']=_[_0x7644('0x34')](_0x3f8e8d[_0x7644('0x31')],_0x3f8e8d[_0x7644('0x32')]);_0x3df4b9[_0x7644('0x35')]=_[_0x7644('0x34')](_0x3f8e8d[_0x7644('0x31')],qs[_0x7644('0x36')](_0x33489d[_0x7644('0x32')][_0x7644('0x36')]));_0x3df4b9['attributes']=_0x3df4b9['attributes'][_0x7644('0x37')]?_0x3df4b9[_0x7644('0x35')]:_0x3f8e8d[_0x7644('0x31')];if(!_0x33489d[_0x7644('0x32')][_0x7644('0x38')](_0x7644('0x39'))){_0x3df4b9['limit']=qs[_0x7644('0x23')](_0x33489d[_0x7644('0x32')][_0x7644('0x23')]);_0x3df4b9[_0x7644('0x20')]=qs[_0x7644('0x20')](_0x33489d['query'][_0x7644('0x20')]);}_0x3df4b9['order']=qs[_0x7644('0x3a')](_0x33489d['query'][_0x7644('0x3a')]);_0x3df4b9[_0x7644('0x3b')]=qs['filters'](_['pick'](_0x33489d[_0x7644('0x32')],_0x3f8e8d[_0x7644('0x3c')]),_0x4a0f2);if(_0x33489d[_0x7644('0x32')][_0x7644('0x3d')]){_0x3df4b9['where']=_[_0x7644('0x3e')](_0x3df4b9[_0x7644('0x3b')],{'$or':_['map'](_0x4a0f2,function(_0x14fe16){if(_0x14fe16['type']!==_0x7644('0x3f')){var _0x7aa60c={};_0x7aa60c[_0x14fe16[_0x7644('0x29')]]={'$like':'%'+_0x33489d[_0x7644('0x32')][_0x7644('0x3d')]+'%'};return _0x7aa60c;}})});}_0x3df4b9=_[_0x7644('0x3e')]({},_0x3df4b9,_0x33489d[_0x7644('0x40')]);var _0x5cae0d={'where':_0x3df4b9[_0x7644('0x3b')]};return db['AnalyticFieldReport'][_0x7644('0x22')](_0x5cae0d)['then'](function(_0x5caef5){_0x215c54[_0x7644('0x22')]=_0x5caef5;if(_0x33489d[_0x7644('0x32')][_0x7644('0x41')]){_0x3df4b9[_0x7644('0x42')]=[{'all':!![]}];}return db[_0x7644('0x2d')]['findAll'](_0x3df4b9);})[_0x7644('0x27')](function(_0x2feafe){_0x215c54[_0x7644('0x43')]=_0x2feafe;return _0x215c54;})[_0x7644('0x27')](respondWithFilteredResult(_0x3cff86,_0x3df4b9))['catch'](handleError(_0x3cff86,null));};exports[_0x7644('0x44')]=function(_0x514f24,_0x2c82e9){var _0x3a18e0={'raw':![],'where':{'id':_0x514f24[_0x7644('0x45')]['id']}},_0x1f4e12={};_0x1f4e12[_0x7644('0x31')]=_[_0x7644('0x33')](db[_0x7644('0x2d')]['rawAttributes']);_0x1f4e12[_0x7644('0x32')]=_[_0x7644('0x33')](_0x514f24[_0x7644('0x32')]);_0x1f4e12[_0x7644('0x3c')]=_[_0x7644('0x34')](_0x1f4e12[_0x7644('0x31')],_0x1f4e12[_0x7644('0x32')]);_0x3a18e0[_0x7644('0x35')]=_[_0x7644('0x34')](_0x1f4e12[_0x7644('0x31')],qs[_0x7644('0x36')](_0x514f24[_0x7644('0x32')]['fields']));_0x3a18e0['attributes']=_0x3a18e0[_0x7644('0x35')][_0x7644('0x37')]?_0x3a18e0[_0x7644('0x35')]:_0x1f4e12[_0x7644('0x31')];if(_0x514f24[_0x7644('0x32')]['includeAll']){_0x3a18e0['include']=[{'all':!![]}];}_0x3a18e0=_[_0x7644('0x3e')]({},_0x3a18e0,_0x514f24['options']);return db[_0x7644('0x2d')][_0x7644('0x46')](_0x3a18e0)[_0x7644('0x27')](handleEntityNotFound(_0x2c82e9,null))['then'](respondWithResult(_0x2c82e9,null))['catch'](handleError(_0x2c82e9,null));};exports[_0x7644('0x47')]=function(_0x1ae4f7,_0x7d89c7){return db[_0x7644('0x2d')][_0x7644('0x47')](_0x1ae4f7[_0x7644('0x48')],{})['then'](respondWithResult(_0x7d89c7,0xc9))[_0x7644('0x49')](handleError(_0x7d89c7,null));};exports[_0x7644('0x4a')]=function(_0x47bbe4,_0x3f2515){return db[_0x7644('0x2d')]['bulkCreate'](_0x47bbe4[_0x7644('0x48')],{'raw':![],'individualHooks':!![]})[_0x7644('0x27')](respondWithResult(_0x3f2515,0xc9))[_0x7644('0x49')](handleError(_0x3f2515,null));};exports['update']=function(_0x7b2189,_0x1d878d){if(_0x7b2189[_0x7644('0x48')]['id']){delete _0x7b2189['body']['id'];}return db[_0x7644('0x2d')][_0x7644('0x46')]({'where':{'id':_0x7b2189['params']['id']}})[_0x7644('0x27')](handleEntityNotFound(_0x1d878d,null))[_0x7644('0x27')](saveUpdates(_0x7b2189[_0x7644('0x48')],null))['then'](respondWithResult(_0x1d878d,null))[_0x7644('0x49')](handleError(_0x1d878d,null));};exports[_0x7644('0x28')]=function(_0x5213cb,_0x812e36){return db[_0x7644('0x2d')][_0x7644('0x46')]({'where':{'id':_0x5213cb[_0x7644('0x45')]['id']}})[_0x7644('0x27')](handleEntityNotFound(_0x812e36,null))['then'](removeEntity(_0x812e36,null))[_0x7644('0x49')](handleError(_0x812e36,null));};exports['bulkDestroy']=function(_0x9ad28b,_0xb4c340){return db[_0x7644('0x2d')][_0x7644('0x28')]({'where':{'id':_0x9ad28b[_0x7644('0x32')][_0x7644('0x4b')]||[]},'raw':![],'individualHooks':!![]})[_0x7644('0x27')](respondWithResult(_0xb4c340,0xcc))[_0x7644('0x49')](handleError(_0xb4c340,null));};exports[_0x7644('0x4c')]=function(_0x1f598f,_0x52426c,_0x3e0d9a){return db[_0x7644('0x4d')][_0x7644('0x4e')]({'where':{'id':_0x1f598f[_0x7644('0x45')]['id']}})['then'](handleEntityNotFound(_0x52426c,null))[_0x7644('0x27')](function(_0x10fdd4){if(_0x10fdd4){return db['sequelize']['transaction'](function(_0x1f7591){return db['AnalyticFieldReport'][_0x7644('0x28')]({'where':{'CustomReportId':_0x1f598f[_0x7644('0x45')]['id']},'transaction':_0x1f7591})[_0x7644('0x27')](function(_0x4f8e75){var _0x408d34=_['map'](_0x1f598f[_0x7644('0x48')],function(_0x300a51){delete _0x300a51['id'];_0x300a51[_0x7644('0x4f')]=_0x1f598f['params']['id'];return _0x300a51;});return db['AnalyticFieldReport'][_0x7644('0x4a')](_0x408d34,{'transaction':_0x1f7591});});})[_0x7644('0x27')](function(){return db[_0x7644('0x2d')][_0x7644('0x50')]({'where':{'CustomReportId':_0x1f598f[_0x7644('0x45')]['id']}});});}})['then'](respondWithResult(_0x52426c,null))['catch'](handleError(_0x52426c,null));};
\ No newline at end of file
diff --git a/server/api/analyticFieldReport/analyticFieldReport.model.js b/server/api/analyticFieldReport/analyticFieldReport.model.js
index f0a107c..9da1392 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 _0x893b=['rimraf','../../config/environment','./analyticFieldReport.attributes','AnalyticFieldReport','analytics_report_fields','lodash','util','../../config/logger','api','bluebird','request-promise','path'];(function(_0x177f2a,_0x2f3e55){var _0x39086a=function(_0x5b7cf6){while(--_0x5b7cf6){_0x177f2a['push'](_0x177f2a['shift']());}};_0x39086a(++_0x2f3e55);}(_0x893b,0x185));var _0xb893=function(_0x1dcb68,_0x238c44){_0x1dcb68=_0x1dcb68-0x0;var _0x2ca316=_0x893b[_0x1dcb68];return _0x2ca316;};'use strict';var _=require(_0xb893('0x0'));var util=require(_0xb893('0x1'));var logger=require(_0xb893('0x2'))(_0xb893('0x3'));var moment=require('moment');var BPromise=require(_0xb893('0x4'));var rp=require(_0xb893('0x5'));var fs=require('fs');var path=require(_0xb893('0x6'));var rimraf=require(_0xb893('0x7'));var config=require(_0xb893('0x8'));var attributes=require(_0xb893('0x9'));module['exports']=function(_0x5265bc,_0x1b7a09){return _0x5265bc['define'](_0xb893('0xa'),attributes,{'tableName':_0xb893('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x09e0=['bluebird','path','rimraf','./analyticFieldReport.attributes','exports','AnalyticFieldReport','analytics_report_fields','lodash','util','api','moment'];(function(_0x5a8bf9,_0x1e6560){var _0x261738=function(_0xf70b15){while(--_0xf70b15){_0x5a8bf9['push'](_0x5a8bf9['shift']());}};_0x261738(++_0x1e6560);}(_0x09e0,0x130));var _0x009e=function(_0x43c4fc,_0x94577d){_0x43c4fc=_0x43c4fc-0x0;var _0x5571ca=_0x09e0[_0x43c4fc];return _0x5571ca;};'use strict';var _=require(_0x009e('0x0'));var util=require(_0x009e('0x1'));var logger=require('../../config/logger')(_0x009e('0x2'));var moment=require(_0x009e('0x3'));var BPromise=require(_0x009e('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x009e('0x5'));var rimraf=require(_0x009e('0x6'));var config=require('../../config/environment');var attributes=require(_0x009e('0x7'));module[_0x009e('0x8')]=function(_0x2f4d83,_0x55aa09){return _0x2f4d83['define'](_0x009e('0x9'),attributes,{'tableName':_0x009e('0xa'),'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 ad77c81..24fe6eb 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 _0x085b=['../../config/logger','rpc','../../config/environment','client','http','request','then','info','AnalyticFieldReport,\x20%s,\x20%s','request\x20sent','AnalyticFieldReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb'];(function(_0x9e15c3,_0x120d01){var _0x32c175=function(_0x5cdcc1){while(--_0x5cdcc1){_0x9e15c3['push'](_0x9e15c3['shift']());}};_0x32c175(++_0x120d01);}(_0x085b,0x6c));var _0xb085=function(_0x39c65b,_0x4b5a02){_0x39c65b=_0x39c65b-0x0;var _0x487fee=_0x085b[_0x39c65b];return _0x487fee;};'use strict';var _=require(_0xb085('0x0'));var util=require(_0xb085('0x1'));var moment=require(_0xb085('0x2'));var BPromise=require(_0xb085('0x3'));var rs=require(_0xb085('0x4'));var fs=require('fs');var Redis=require(_0xb085('0x5'));var db=require(_0xb085('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0xb085('0x7'))(_0xb085('0x8'));var config=require(_0xb085('0x9'));var jayson=require('jayson/promise');var client=jayson[_0xb085('0xa')][_0xb085('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x26ee81,_0x13fe5c,_0x45a868){return new BPromise(function(_0x912f4,_0xe9556f){return client[_0xb085('0xc')](_0x26ee81,_0x45a868)[_0xb085('0xd')](function(_0x1aad31){logger[_0xb085('0xe')](_0xb085('0xf'),_0x13fe5c,_0xb085('0x10'));logger['debug'](_0xb085('0x11'),_0x13fe5c,_0xb085('0x10'),JSON[_0xb085('0x12')](_0x1aad31));if(_0x1aad31[_0xb085('0x13')]){if(_0x1aad31[_0xb085('0x13')][_0xb085('0x14')]===0x1f4){logger[_0xb085('0x13')](_0xb085('0xf'),_0x13fe5c,_0x1aad31['error'][_0xb085('0x15')]);return _0xe9556f(_0x1aad31[_0xb085('0x13')][_0xb085('0x15')]);}logger[_0xb085('0x13')]('AnalyticFieldReport,\x20%s,\x20%s',_0x13fe5c,_0x1aad31[_0xb085('0x13')]['message']);return _0x912f4(_0x1aad31['error'][_0xb085('0x15')]);}else{logger[_0xb085('0xe')](_0xb085('0xf'),_0x13fe5c,_0xb085('0x10'));_0x912f4(_0x1aad31[_0xb085('0x16')][_0xb085('0x15')]);}})['catch'](function(_0x140027){logger['error'](_0xb085('0xf'),_0x13fe5c,_0x140027);_0xe9556f(_0x140027);});});}
\ No newline at end of file
+var _0x1de2=['AnalyticFieldReport,\x20%s,\x20%s,\x20%s','error','message','AnalyticFieldReport,\x20%s,\x20%s','result','catch','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','client','request','then','info','request\x20sent','debug'];(function(_0x165448,_0x1725ba){var _0x1bcb38=function(_0x47fb70){while(--_0x47fb70){_0x165448['push'](_0x165448['shift']());}};_0x1bcb38(++_0x1725ba);}(_0x1de2,0x1e1));var _0x21de=function(_0x41382c,_0xc3ffd1){_0x41382c=_0x41382c-0x0;var _0x4da35b=_0x1de2[_0x41382c];return _0x4da35b;};'use strict';var _=require('lodash');var util=require(_0x21de('0x0'));var moment=require(_0x21de('0x1'));var BPromise=require(_0x21de('0x2'));var rs=require(_0x21de('0x3'));var fs=require('fs');var Redis=require(_0x21de('0x4'));var db=require(_0x21de('0x5'))['db'];var utils=require(_0x21de('0x6'));var logger=require('../../config/logger')('rpc');var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x21de('0x7')]['http']({'port':0x232a});function respondWithRpcPromise(_0x1d8972,_0x3f4d1a,_0x4df2c8){return new BPromise(function(_0x35ae1c,_0x844225){return client[_0x21de('0x8')](_0x1d8972,_0x4df2c8)[_0x21de('0x9')](function(_0x2c1643){logger[_0x21de('0xa')]('AnalyticFieldReport,\x20%s,\x20%s',_0x3f4d1a,_0x21de('0xb'));logger[_0x21de('0xc')](_0x21de('0xd'),_0x3f4d1a,_0x21de('0xb'),JSON['stringify'](_0x2c1643));if(_0x2c1643['error']){if(_0x2c1643[_0x21de('0xe')]['code']===0x1f4){logger[_0x21de('0xe')]('AnalyticFieldReport,\x20%s,\x20%s',_0x3f4d1a,_0x2c1643[_0x21de('0xe')][_0x21de('0xf')]);return _0x844225(_0x2c1643[_0x21de('0xe')]['message']);}logger[_0x21de('0xe')](_0x21de('0x10'),_0x3f4d1a,_0x2c1643[_0x21de('0xe')]['message']);return _0x35ae1c(_0x2c1643['error'][_0x21de('0xf')]);}else{logger['info'](_0x21de('0x10'),_0x3f4d1a,'request\x20sent');_0x35ae1c(_0x2c1643[_0x21de('0x11')][_0x21de('0xf')]);}})[_0x21de('0x12')](function(_0x4573f4){logger[_0x21de('0xe')](_0x21de('0x10'),_0x3f4d1a,_0x4573f4);_0x844225(_0x4573f4);});});}
\ No newline at end of file
diff --git a/server/api/analyticFieldReport/index.js b/server/api/analyticFieldReport/index.js
index 3befd0a..027a45f 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(_0xed0bb8,_0x26e01a){var _0x55a32b=function(_0xf009bf){while(--_0xf009bf){_0xed0bb8['push'](_0xed0bb8['shift']());}};_0x55a32b(++_0x26e01a);}(_0xa9e0,0x123));var _0x0a9e=function(_0x1facfa,_0x1acf7d){_0x1facfa=_0x1facfa-0x0;var _0x9ec701=_0xa9e0[_0x1facfa];return _0x9ec701;};'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(_0x252938,_0x4d41c8){var _0x5ef26e=function(_0x29824e){while(--_0x29824e){_0x252938['push'](_0x252938['shift']());}};_0x5ef26e(++_0x4d41c8);}(_0xa9e0,0x123));var _0x0a9e=function(_0x4bfac3,_0x58324d){_0x4bfac3=_0x4bfac3-0x0;var _0x15f0f2=_0xa9e0[_0x4bfac3];return _0x15f0f2;};'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 82a3614..470d764 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 _0xb677=['TEXT','sequelize','STRING','name'];(function(_0x155d73,_0x127098){var _0x18eedc=function(_0xfcd7d7){while(--_0xfcd7d7){_0x155d73['push'](_0x155d73['shift']());}};_0x18eedc(++_0x127098);}(_0xb677,0x119));var _0x7b67=function(_0x5aea32,_0x3bfbde){_0x5aea32=_0x5aea32-0x0;var _0x673243=_0xb677[_0x5aea32];return _0x673243;};'use strict';var Sequelize=require(_0x7b67('0x0'));module['exports']={'name':{'type':Sequelize[_0x7b67('0x1')],'allowNull':![],'unique':_0x7b67('0x2')},'table':{'type':Sequelize[_0x7b67('0x1')]},'metric':{'type':Sequelize[_0x7b67('0x3')]},'description':{'type':Sequelize[_0x7b67('0x1')]}};
\ No newline at end of file
+var _0xd757=['name','sequelize','exports','STRING'];(function(_0x26b1b4,_0x32a9c8){var _0x2896e2=function(_0x573323){while(--_0x573323){_0x26b1b4['push'](_0x26b1b4['shift']());}};_0x2896e2(++_0x32a9c8);}(_0xd757,0x1e5));var _0x7d75=function(_0xe01b77,_0x1e25d8){_0xe01b77=_0xe01b77-0x0;var _0x53b173=_0xd757[_0xe01b77];return _0x53b173;};'use strict';var Sequelize=require(_0x7d75('0x0'));module[_0x7d75('0x1')]={'name':{'type':Sequelize[_0x7d75('0x2')],'allowNull':![],'unique':_0x7d75('0x3')},'table':{'type':Sequelize['STRING']},'metric':{'type':Sequelize['TEXT']},'description':{'type':Sequelize[_0x7d75('0x2')]}};
\ No newline at end of file
diff --git a/server/api/analyticMetric/analyticMetric.controller.js b/server/api/analyticMetric/analyticMetric.controller.js
index fa43326..d103c78 100644
--- a/server/api/analyticMetric/analyticMetric.controller.js
+++ b/server/api/analyticMetric/analyticMetric.controller.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x7fbe=['util','path','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','querystring','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','json','offset','undefined','limit','count','Content-Range','apply','save','update','then','get','UserProfileResource','destroy','end','error','stack','name','send','index','AnalyticMetric','fieldName','type','key','map','query','keys','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filters','pick','filter','merge','VIRTUAL','options','rows','show','params','create','body','role','user','Metrics','find','autoAssociation','catch','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache'];(function(_0x27300b,_0x298344){var _0x518a12=function(_0x60c85c){while(--_0x60c85c){_0x27300b['push'](_0x27300b['shift']());}};_0x518a12(++_0x298344);}(_0x7fbe,0x1ec));var _0xe7fb=function(_0x45c957,_0x1762a2){_0x45c957=_0x45c957-0x0;var _0x455a3b=_0x7fbe[_0x45c957];return _0x455a3b;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0xe7fb('0x0'));var jsonpatch=require(_0xe7fb('0x1'));var rp=require(_0xe7fb('0x2'));var moment=require(_0xe7fb('0x3'));var BPromise=require(_0xe7fb('0x4'));var Mustache=require(_0xe7fb('0x5'));var util=require(_0xe7fb('0x6'));var path=require(_0xe7fb('0x7'));var sox=require(_0xe7fb('0x8'));var csv=require(_0xe7fb('0x9'));var ejs=require(_0xe7fb('0xa'));var fs=require('fs');var fs_extra=require(_0xe7fb('0xb'));var _=require(_0xe7fb('0xc'));var squel=require(_0xe7fb('0xd'));var crypto=require('crypto');var jsforce=require(_0xe7fb('0xe'));var deskjs=require(_0xe7fb('0xf'));var toCsv=require(_0xe7fb('0x9'));var querystring=require(_0xe7fb('0x10'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0xe7fb('0x11'));var qs=require(_0xe7fb('0x12'));var as=require(_0xe7fb('0x13'));var hardwareService=require(_0xe7fb('0x14'));var logger=require(_0xe7fb('0x15'))(_0xe7fb('0x16'));var utils=require(_0xe7fb('0x17'));var config=require(_0xe7fb('0x18'));var licenseUtil=require(_0xe7fb('0x19'));var db=require(_0xe7fb('0x1a'))['db'];function respondWithStatusCode(_0x2437d4,_0x188e1d){_0x188e1d=_0x188e1d||0xcc;return function(_0xdf9760){if(_0xdf9760){return _0x2437d4[_0xe7fb('0x1b')](_0x188e1d);}return _0x2437d4[_0xe7fb('0x1c')](_0x188e1d)['end']();};}function respondWithResult(_0x278b75,_0x2225e5){_0x2225e5=_0x2225e5||0xc8;return function(_0x5573ab){if(_0x5573ab){return _0x278b75[_0xe7fb('0x1c')](_0x2225e5)[_0xe7fb('0x1d')](_0x5573ab);}};}function respondWithFilteredResult(_0x482f7d,_0xa76acf){return function(_0x559129){if(_0x559129){var _0x12fff6=typeof _0xa76acf[_0xe7fb('0x1e')]===_0xe7fb('0x1f')&&typeof _0xa76acf[_0xe7fb('0x20')]==='undefined';var _0x892b0f=_0x559129['count'];var _0x293a47=_0x12fff6?0x0:_0xa76acf['offset'];var _0x1e77fd=_0x12fff6?_0x559129[_0xe7fb('0x21')]:_0xa76acf[_0xe7fb('0x1e')]+_0xa76acf[_0xe7fb('0x20')];var _0x5df1a1;if(_0x1e77fd>=_0x892b0f){_0x1e77fd=_0x892b0f;_0x5df1a1=0xc8;}else{_0x5df1a1=0xce;}_0x482f7d[_0xe7fb('0x1c')](_0x5df1a1);return _0x482f7d['set'](_0xe7fb('0x22'),_0x293a47+'-'+_0x1e77fd+'/'+_0x892b0f)['json'](_0x559129);}return null;};}function patchUpdates(_0x15f7a4){return function(_0x4ea664){try{jsonpatch[_0xe7fb('0x23')](_0x4ea664,_0x15f7a4,!![]);}catch(_0x135624){return BPromise['reject'](_0x135624);}return _0x4ea664[_0xe7fb('0x24')]();};}function saveUpdates(_0x4742bd,_0x3ae8f1){return function(_0x4dcb4b){if(_0x4dcb4b){return _0x4dcb4b[_0xe7fb('0x25')](_0x4742bd)[_0xe7fb('0x26')](function(_0x5da3d9){return _0x5da3d9;});}return null;};}function removeEntity(_0x5bea27,_0x52f08b){return function(_0x35e4db){if(_0x35e4db){return _0x35e4db['destroy']()['then'](function(){var _0x4026b1=_0x35e4db[_0xe7fb('0x27')]({'plain':!![]});var _0x2996ae='Metrics';return db[_0xe7fb('0x28')][_0xe7fb('0x29')]({'where':{'type':_0x2996ae,'resourceId':_0x4026b1['id']}})[_0xe7fb('0x26')](function(){return _0x35e4db;});})[_0xe7fb('0x26')](function(){_0x5bea27[_0xe7fb('0x1c')](0xcc)[_0xe7fb('0x2a')]();});}};}function handleEntityNotFound(_0x380130,_0x59e015){return function(_0x5df9f2){if(!_0x5df9f2){_0x380130[_0xe7fb('0x1b')](0x194);}return _0x5df9f2;};}function handleError(_0x3bdee9,_0xead63){_0xead63=_0xead63||0x1f4;return function(_0x4fd290){logger[_0xe7fb('0x2b')](_0x4fd290[_0xe7fb('0x2c')]);if(_0x4fd290[_0xe7fb('0x2d')]){delete _0x4fd290[_0xe7fb('0x2d')];}_0x3bdee9[_0xe7fb('0x1c')](_0xead63)[_0xe7fb('0x2e')](_0x4fd290);};}exports[_0xe7fb('0x2f')]=function(_0x3dd0be,_0x4ce993){var _0x3d1fb5={},_0x1742f3={},_0x29d1ca={'count':0x0,'rows':[]};var _0x547a04=_['map'](db[_0xe7fb('0x30')]['rawAttributes'],function(_0xac56b4){return{'name':_0xac56b4[_0xe7fb('0x31')],'type':_0xac56b4[_0xe7fb('0x32')][_0xe7fb('0x33')]};});_0x1742f3['model']=_[_0xe7fb('0x34')](_0x547a04,_0xe7fb('0x2d'));_0x1742f3[_0xe7fb('0x35')]=_[_0xe7fb('0x36')](_0x3dd0be[_0xe7fb('0x35')]);_0x1742f3['filters']=_[_0xe7fb('0x37')](_0x1742f3[_0xe7fb('0x38')],_0x1742f3[_0xe7fb('0x35')]);_0x3d1fb5[_0xe7fb('0x39')]=_[_0xe7fb('0x37')](_0x1742f3[_0xe7fb('0x38')],qs[_0xe7fb('0x3a')](_0x3dd0be[_0xe7fb('0x35')][_0xe7fb('0x3a')]));_0x3d1fb5['attributes']=_0x3d1fb5[_0xe7fb('0x39')][_0xe7fb('0x3b')]?_0x3d1fb5[_0xe7fb('0x39')]:_0x1742f3['model'];if(!_0x3dd0be[_0xe7fb('0x35')][_0xe7fb('0x3c')](_0xe7fb('0x3d'))){_0x3d1fb5[_0xe7fb('0x20')]=qs[_0xe7fb('0x20')](_0x3dd0be[_0xe7fb('0x35')][_0xe7fb('0x20')]);_0x3d1fb5[_0xe7fb('0x1e')]=qs[_0xe7fb('0x1e')](_0x3dd0be[_0xe7fb('0x35')][_0xe7fb('0x1e')]);}_0x3d1fb5[_0xe7fb('0x3e')]=qs[_0xe7fb('0x3f')](_0x3dd0be[_0xe7fb('0x35')][_0xe7fb('0x3f')]);_0x3d1fb5[_0xe7fb('0x40')]=qs[_0xe7fb('0x41')](_[_0xe7fb('0x42')](_0x3dd0be[_0xe7fb('0x35')],_0x1742f3['filters']),_0x547a04);if(_0x3dd0be[_0xe7fb('0x35')][_0xe7fb('0x43')]){_0x3d1fb5[_0xe7fb('0x40')]=_[_0xe7fb('0x44')](_0x3d1fb5['where'],{'$or':_[_0xe7fb('0x34')](_0x547a04,function(_0x186418){if(_0x186418[_0xe7fb('0x32')]!==_0xe7fb('0x45')){var _0x49fe9d={};_0x49fe9d[_0x186418[_0xe7fb('0x2d')]]={'$like':'%'+_0x3dd0be[_0xe7fb('0x35')][_0xe7fb('0x43')]+'%'};return _0x49fe9d;}})});}_0x3d1fb5=_[_0xe7fb('0x44')]({},_0x3d1fb5,_0x3dd0be[_0xe7fb('0x46')]);var _0xb729fc={'where':_0x3d1fb5['where']};return db[_0xe7fb('0x30')][_0xe7fb('0x21')](_0xb729fc)[_0xe7fb('0x26')](function(_0x4b263d){_0x29d1ca[_0xe7fb('0x21')]=_0x4b263d;if(_0x3dd0be[_0xe7fb('0x35')]['includeAll']){_0x3d1fb5['include']=[{'all':!![]}];}return db['AnalyticMetric']['findAll'](_0x3d1fb5);})['then'](function(_0x900d67){_0x29d1ca[_0xe7fb('0x47')]=_0x900d67;return _0x29d1ca;})[_0xe7fb('0x26')](respondWithFilteredResult(_0x4ce993,_0x3d1fb5))['catch'](handleError(_0x4ce993,null));};exports[_0xe7fb('0x48')]=function(_0x58d743,_0x19277f){var _0x32cfa4={'raw':!![],'where':{'id':_0x58d743[_0xe7fb('0x49')]['id']}},_0x4d29d3={};_0x4d29d3[_0xe7fb('0x38')]=_[_0xe7fb('0x36')](db[_0xe7fb('0x30')]['rawAttributes']);_0x4d29d3[_0xe7fb('0x35')]=_[_0xe7fb('0x36')](_0x58d743[_0xe7fb('0x35')]);_0x4d29d3['filters']=_[_0xe7fb('0x37')](_0x4d29d3[_0xe7fb('0x38')],_0x4d29d3[_0xe7fb('0x35')]);_0x32cfa4[_0xe7fb('0x39')]=_[_0xe7fb('0x37')](_0x4d29d3['model'],qs[_0xe7fb('0x3a')](_0x58d743['query'][_0xe7fb('0x3a')]));_0x32cfa4[_0xe7fb('0x39')]=_0x32cfa4[_0xe7fb('0x39')][_0xe7fb('0x3b')]?_0x32cfa4[_0xe7fb('0x39')]:_0x4d29d3['model'];if(_0x58d743[_0xe7fb('0x35')]['includeAll']){_0x32cfa4['include']=[{'all':!![]}];}_0x32cfa4=_[_0xe7fb('0x44')]({},_0x32cfa4,_0x58d743[_0xe7fb('0x46')]);return db[_0xe7fb('0x30')]['find'](_0x32cfa4)[_0xe7fb('0x26')](handleEntityNotFound(_0x19277f,null))[_0xe7fb('0x26')](respondWithResult(_0x19277f,null))['catch'](handleError(_0x19277f,null));};exports['create']=function(_0x284bcb,_0x42270b){return db[_0xe7fb('0x30')][_0xe7fb('0x4a')](_0x284bcb[_0xe7fb('0x4b')],{})[_0xe7fb('0x26')](function(_0x18a590){var _0x347177=_0x284bcb['user'][_0xe7fb('0x27')]({'plain':!![]});if(!_0x347177)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x347177[_0xe7fb('0x4c')]===_0xe7fb('0x4d')){var _0x5cedfb=_0x18a590[_0xe7fb('0x27')]({'plain':!![]});var _0x5efd24=_0xe7fb('0x4e');return db['UserProfileSection'][_0xe7fb('0x4f')]({'where':{'name':_0x5efd24,'userProfileId':_0x347177['userProfileId']},'raw':!![]})[_0xe7fb('0x26')](function(_0x59158c){if(_0x59158c&&_0x59158c[_0xe7fb('0x50')]===0x0){return db[_0xe7fb('0x28')][_0xe7fb('0x4a')]({'name':_0x5cedfb[_0xe7fb('0x2d')],'resourceId':_0x5cedfb['id'],'type':_0x59158c[_0xe7fb('0x2d')],'sectionId':_0x59158c['id']},{})[_0xe7fb('0x26')](function(){return _0x18a590;});}else{return _0x18a590;}})[_0xe7fb('0x51')](function(_0x582a4a){logger['error'](_0xe7fb('0x52'),_0x582a4a);throw _0x582a4a;});}return _0x18a590;})['then'](respondWithResult(_0x42270b,0xc9))['catch'](handleError(_0x42270b,null));};exports['update']=function(_0x50b8df,_0x539252){if(_0x50b8df[_0xe7fb('0x4b')]['id']){delete _0x50b8df[_0xe7fb('0x4b')]['id'];}return db[_0xe7fb('0x30')][_0xe7fb('0x4f')]({'where':{'id':_0x50b8df['params']['id']}})[_0xe7fb('0x26')](handleEntityNotFound(_0x539252,null))[_0xe7fb('0x26')](saveUpdates(_0x50b8df[_0xe7fb('0x4b')],null))['then'](respondWithResult(_0x539252,null))['catch'](handleError(_0x539252,null));};exports[_0xe7fb('0x29')]=function(_0x377e5f,_0x300b8e){return db['AnalyticMetric'][_0xe7fb('0x4f')]({'where':{'id':_0x377e5f[_0xe7fb('0x49')]['id']}})[_0xe7fb('0x26')](handleEntityNotFound(_0x300b8e,null))[_0xe7fb('0x26')](removeEntity(_0x300b8e,null))['catch'](handleError(_0x300b8e,null));};
\ No newline at end of file
+var _0x7fbe=['util','path','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','querystring','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','json','offset','undefined','limit','count','Content-Range','apply','save','update','then','get','UserProfileResource','destroy','end','error','stack','name','send','index','AnalyticMetric','fieldName','type','key','map','query','keys','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filters','pick','filter','merge','VIRTUAL','options','rows','show','params','create','body','role','user','Metrics','find','autoAssociation','catch','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache'];(function(_0x1d9078,_0x2c5ced){var _0x50cfb3=function(_0x3614ef){while(--_0x3614ef){_0x1d9078['push'](_0x1d9078['shift']());}};_0x50cfb3(++_0x2c5ced);}(_0x7fbe,0x1ec));var _0xe7fb=function(_0x4e0417,_0x574fd4){_0x4e0417=_0x4e0417-0x0;var _0x5d6909=_0x7fbe[_0x4e0417];return _0x5d6909;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0xe7fb('0x0'));var jsonpatch=require(_0xe7fb('0x1'));var rp=require(_0xe7fb('0x2'));var moment=require(_0xe7fb('0x3'));var BPromise=require(_0xe7fb('0x4'));var Mustache=require(_0xe7fb('0x5'));var util=require(_0xe7fb('0x6'));var path=require(_0xe7fb('0x7'));var sox=require(_0xe7fb('0x8'));var csv=require(_0xe7fb('0x9'));var ejs=require(_0xe7fb('0xa'));var fs=require('fs');var fs_extra=require(_0xe7fb('0xb'));var _=require(_0xe7fb('0xc'));var squel=require(_0xe7fb('0xd'));var crypto=require('crypto');var jsforce=require(_0xe7fb('0xe'));var deskjs=require(_0xe7fb('0xf'));var toCsv=require(_0xe7fb('0x9'));var querystring=require(_0xe7fb('0x10'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0xe7fb('0x11'));var qs=require(_0xe7fb('0x12'));var as=require(_0xe7fb('0x13'));var hardwareService=require(_0xe7fb('0x14'));var logger=require(_0xe7fb('0x15'))(_0xe7fb('0x16'));var utils=require(_0xe7fb('0x17'));var config=require(_0xe7fb('0x18'));var licenseUtil=require(_0xe7fb('0x19'));var db=require(_0xe7fb('0x1a'))['db'];function respondWithStatusCode(_0x2437d4,_0x188e1d){_0x188e1d=_0x188e1d||0xcc;return function(_0xdf9760){if(_0xdf9760){return _0x2437d4[_0xe7fb('0x1b')](_0x188e1d);}return _0x2437d4[_0xe7fb('0x1c')](_0x188e1d)['end']();};}function respondWithResult(_0x278b75,_0x2225e5){_0x2225e5=_0x2225e5||0xc8;return function(_0x5573ab){if(_0x5573ab){return _0x278b75[_0xe7fb('0x1c')](_0x2225e5)[_0xe7fb('0x1d')](_0x5573ab);}};}function respondWithFilteredResult(_0x482f7d,_0xa76acf){return function(_0x559129){if(_0x559129){var _0x12fff6=typeof _0xa76acf[_0xe7fb('0x1e')]===_0xe7fb('0x1f')&&typeof _0xa76acf[_0xe7fb('0x20')]==='undefined';var _0x892b0f=_0x559129['count'];var _0x293a47=_0x12fff6?0x0:_0xa76acf['offset'];var _0x1e77fd=_0x12fff6?_0x559129[_0xe7fb('0x21')]:_0xa76acf[_0xe7fb('0x1e')]+_0xa76acf[_0xe7fb('0x20')];var _0x5df1a1;if(_0x1e77fd>=_0x892b0f){_0x1e77fd=_0x892b0f;_0x5df1a1=0xc8;}else{_0x5df1a1=0xce;}_0x482f7d[_0xe7fb('0x1c')](_0x5df1a1);return _0x482f7d['set'](_0xe7fb('0x22'),_0x293a47+'-'+_0x1e77fd+'/'+_0x892b0f)['json'](_0x559129);}return null;};}function patchUpdates(_0x15f7a4){return function(_0x4ea664){try{jsonpatch[_0xe7fb('0x23')](_0x4ea664,_0x15f7a4,!![]);}catch(_0x135624){return BPromise['reject'](_0x135624);}return _0x4ea664[_0xe7fb('0x24')]();};}function saveUpdates(_0x4742bd,_0x3ae8f1){return function(_0x4dcb4b){if(_0x4dcb4b){return _0x4dcb4b[_0xe7fb('0x25')](_0x4742bd)[_0xe7fb('0x26')](function(_0x5da3d9){return _0x5da3d9;});}return null;};}function removeEntity(_0x5bea27,_0x52f08b){return function(_0x35e4db){if(_0x35e4db){return _0x35e4db['destroy']()['then'](function(){var _0x4026b1=_0x35e4db[_0xe7fb('0x27')]({'plain':!![]});var _0x2996ae='Metrics';return db[_0xe7fb('0x28')][_0xe7fb('0x29')]({'where':{'type':_0x2996ae,'resourceId':_0x4026b1['id']}})[_0xe7fb('0x26')](function(){return _0x35e4db;});})[_0xe7fb('0x26')](function(){_0x5bea27[_0xe7fb('0x1c')](0xcc)[_0xe7fb('0x2a')]();});}};}function handleEntityNotFound(_0x380130,_0x59e015){return function(_0x5df9f2){if(!_0x5df9f2){_0x380130[_0xe7fb('0x1b')](0x194);}return _0x5df9f2;};}function handleError(_0x3bdee9,_0xead63){_0xead63=_0xead63||0x1f4;return function(_0x4fd290){logger[_0xe7fb('0x2b')](_0x4fd290[_0xe7fb('0x2c')]);if(_0x4fd290[_0xe7fb('0x2d')]){delete _0x4fd290[_0xe7fb('0x2d')];}_0x3bdee9[_0xe7fb('0x1c')](_0xead63)[_0xe7fb('0x2e')](_0x4fd290);};}exports[_0xe7fb('0x2f')]=function(_0x3dd0be,_0x4ce993){var _0x3d1fb5={},_0x1742f3={},_0x29d1ca={'count':0x0,'rows':[]};var _0x547a04=_['map'](db[_0xe7fb('0x30')]['rawAttributes'],function(_0xac56b4){return{'name':_0xac56b4[_0xe7fb('0x31')],'type':_0xac56b4[_0xe7fb('0x32')][_0xe7fb('0x33')]};});_0x1742f3['model']=_[_0xe7fb('0x34')](_0x547a04,_0xe7fb('0x2d'));_0x1742f3[_0xe7fb('0x35')]=_[_0xe7fb('0x36')](_0x3dd0be[_0xe7fb('0x35')]);_0x1742f3['filters']=_[_0xe7fb('0x37')](_0x1742f3[_0xe7fb('0x38')],_0x1742f3[_0xe7fb('0x35')]);_0x3d1fb5[_0xe7fb('0x39')]=_[_0xe7fb('0x37')](_0x1742f3[_0xe7fb('0x38')],qs[_0xe7fb('0x3a')](_0x3dd0be[_0xe7fb('0x35')][_0xe7fb('0x3a')]));_0x3d1fb5['attributes']=_0x3d1fb5[_0xe7fb('0x39')][_0xe7fb('0x3b')]?_0x3d1fb5[_0xe7fb('0x39')]:_0x1742f3['model'];if(!_0x3dd0be[_0xe7fb('0x35')][_0xe7fb('0x3c')](_0xe7fb('0x3d'))){_0x3d1fb5[_0xe7fb('0x20')]=qs[_0xe7fb('0x20')](_0x3dd0be[_0xe7fb('0x35')][_0xe7fb('0x20')]);_0x3d1fb5[_0xe7fb('0x1e')]=qs[_0xe7fb('0x1e')](_0x3dd0be[_0xe7fb('0x35')][_0xe7fb('0x1e')]);}_0x3d1fb5[_0xe7fb('0x3e')]=qs[_0xe7fb('0x3f')](_0x3dd0be[_0xe7fb('0x35')][_0xe7fb('0x3f')]);_0x3d1fb5[_0xe7fb('0x40')]=qs[_0xe7fb('0x41')](_[_0xe7fb('0x42')](_0x3dd0be[_0xe7fb('0x35')],_0x1742f3['filters']),_0x547a04);if(_0x3dd0be[_0xe7fb('0x35')][_0xe7fb('0x43')]){_0x3d1fb5[_0xe7fb('0x40')]=_[_0xe7fb('0x44')](_0x3d1fb5['where'],{'$or':_[_0xe7fb('0x34')](_0x547a04,function(_0x186418){if(_0x186418[_0xe7fb('0x32')]!==_0xe7fb('0x45')){var _0x49fe9d={};_0x49fe9d[_0x186418[_0xe7fb('0x2d')]]={'$like':'%'+_0x3dd0be[_0xe7fb('0x35')][_0xe7fb('0x43')]+'%'};return _0x49fe9d;}})});}_0x3d1fb5=_[_0xe7fb('0x44')]({},_0x3d1fb5,_0x3dd0be[_0xe7fb('0x46')]);var _0xb729fc={'where':_0x3d1fb5['where']};return db[_0xe7fb('0x30')][_0xe7fb('0x21')](_0xb729fc)[_0xe7fb('0x26')](function(_0x4b263d){_0x29d1ca[_0xe7fb('0x21')]=_0x4b263d;if(_0x3dd0be[_0xe7fb('0x35')]['includeAll']){_0x3d1fb5['include']=[{'all':!![]}];}return db['AnalyticMetric']['findAll'](_0x3d1fb5);})['then'](function(_0x900d67){_0x29d1ca[_0xe7fb('0x47')]=_0x900d67;return _0x29d1ca;})[_0xe7fb('0x26')](respondWithFilteredResult(_0x4ce993,_0x3d1fb5))['catch'](handleError(_0x4ce993,null));};exports[_0xe7fb('0x48')]=function(_0x58d743,_0x19277f){var _0x32cfa4={'raw':!![],'where':{'id':_0x58d743[_0xe7fb('0x49')]['id']}},_0x4d29d3={};_0x4d29d3[_0xe7fb('0x38')]=_[_0xe7fb('0x36')](db[_0xe7fb('0x30')]['rawAttributes']);_0x4d29d3[_0xe7fb('0x35')]=_[_0xe7fb('0x36')](_0x58d743[_0xe7fb('0x35')]);_0x4d29d3['filters']=_[_0xe7fb('0x37')](_0x4d29d3[_0xe7fb('0x38')],_0x4d29d3[_0xe7fb('0x35')]);_0x32cfa4[_0xe7fb('0x39')]=_[_0xe7fb('0x37')](_0x4d29d3['model'],qs[_0xe7fb('0x3a')](_0x58d743['query'][_0xe7fb('0x3a')]));_0x32cfa4[_0xe7fb('0x39')]=_0x32cfa4[_0xe7fb('0x39')][_0xe7fb('0x3b')]?_0x32cfa4[_0xe7fb('0x39')]:_0x4d29d3['model'];if(_0x58d743[_0xe7fb('0x35')]['includeAll']){_0x32cfa4['include']=[{'all':!![]}];}_0x32cfa4=_[_0xe7fb('0x44')]({},_0x32cfa4,_0x58d743[_0xe7fb('0x46')]);return db[_0xe7fb('0x30')]['find'](_0x32cfa4)[_0xe7fb('0x26')](handleEntityNotFound(_0x19277f,null))[_0xe7fb('0x26')](respondWithResult(_0x19277f,null))['catch'](handleError(_0x19277f,null));};exports['create']=function(_0x284bcb,_0x42270b){return db[_0xe7fb('0x30')][_0xe7fb('0x4a')](_0x284bcb[_0xe7fb('0x4b')],{})[_0xe7fb('0x26')](function(_0x18a590){var _0x347177=_0x284bcb['user'][_0xe7fb('0x27')]({'plain':!![]});if(!_0x347177)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x347177[_0xe7fb('0x4c')]===_0xe7fb('0x4d')){var _0x5cedfb=_0x18a590[_0xe7fb('0x27')]({'plain':!![]});var _0x5efd24=_0xe7fb('0x4e');return db['UserProfileSection'][_0xe7fb('0x4f')]({'where':{'name':_0x5efd24,'userProfileId':_0x347177['userProfileId']},'raw':!![]})[_0xe7fb('0x26')](function(_0x59158c){if(_0x59158c&&_0x59158c[_0xe7fb('0x50')]===0x0){return db[_0xe7fb('0x28')][_0xe7fb('0x4a')]({'name':_0x5cedfb[_0xe7fb('0x2d')],'resourceId':_0x5cedfb['id'],'type':_0x59158c[_0xe7fb('0x2d')],'sectionId':_0x59158c['id']},{})[_0xe7fb('0x26')](function(){return _0x18a590;});}else{return _0x18a590;}})[_0xe7fb('0x51')](function(_0x582a4a){logger['error'](_0xe7fb('0x52'),_0x582a4a);throw _0x582a4a;});}return _0x18a590;})['then'](respondWithResult(_0x42270b,0xc9))['catch'](handleError(_0x42270b,null));};exports['update']=function(_0x50b8df,_0x539252){if(_0x50b8df[_0xe7fb('0x4b')]['id']){delete _0x50b8df[_0xe7fb('0x4b')]['id'];}return db[_0xe7fb('0x30')][_0xe7fb('0x4f')]({'where':{'id':_0x50b8df['params']['id']}})[_0xe7fb('0x26')](handleEntityNotFound(_0x539252,null))[_0xe7fb('0x26')](saveUpdates(_0x50b8df[_0xe7fb('0x4b')],null))['then'](respondWithResult(_0x539252,null))['catch'](handleError(_0x539252,null));};exports[_0xe7fb('0x29')]=function(_0x377e5f,_0x300b8e){return db['AnalyticMetric'][_0xe7fb('0x4f')]({'where':{'id':_0x377e5f[_0xe7fb('0x49')]['id']}})[_0xe7fb('0x26')](handleEntityNotFound(_0x300b8e,null))[_0xe7fb('0x26')](removeEntity(_0x300b8e,null))['catch'](handleError(_0x300b8e,null));};
\ No newline at end of file
diff --git a/server/api/analyticMetric/analyticMetric.model.js b/server/api/analyticMetric/analyticMetric.model.js
index d45fa82..22cae40 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 _0x649f=['bluebird','path','rimraf','../../config/environment','./analyticMetric.attributes','exports','define','lodash','util','../../config/logger'];(function(_0xae7c2f,_0xf31e04){var _0x5d7001=function(_0x4eeadb){while(--_0x4eeadb){_0xae7c2f['push'](_0xae7c2f['shift']());}};_0x5d7001(++_0xf31e04);}(_0x649f,0x93));var _0xf649=function(_0x36c5b0,_0x5001da){_0x36c5b0=_0x36c5b0-0x0;var _0xf19333=_0x649f[_0x36c5b0];return _0xf19333;};'use strict';var _=require(_0xf649('0x0'));var util=require(_0xf649('0x1'));var logger=require(_0xf649('0x2'))('api');var moment=require('moment');var BPromise=require(_0xf649('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xf649('0x4'));var rimraf=require(_0xf649('0x5'));var config=require(_0xf649('0x6'));var attributes=require(_0xf649('0x7'));module[_0xf649('0x8')]=function(_0x3e2e46,_0x580748){return _0x3e2e46[_0xf649('0x9')]('AnalyticMetric',attributes,{'tableName':'analytics_metrics','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xc1c6=['moment','request-promise','path','rimraf','exports','AnalyticMetric','analytics_metrics','lodash','util','../../config/logger'];(function(_0x2ea1d4,_0x23f303){var _0x566ecc=function(_0x415e04){while(--_0x415e04){_0x2ea1d4['push'](_0x2ea1d4['shift']());}};_0x566ecc(++_0x23f303);}(_0xc1c6,0xf7));var _0x6c1c=function(_0x17a28e,_0x41e687){_0x17a28e=_0x17a28e-0x0;var _0x306811=_0xc1c6[_0x17a28e];return _0x306811;};'use strict';var _=require(_0x6c1c('0x0'));var util=require(_0x6c1c('0x1'));var logger=require(_0x6c1c('0x2'))('api');var moment=require(_0x6c1c('0x3'));var BPromise=require('bluebird');var rp=require(_0x6c1c('0x4'));var fs=require('fs');var path=require(_0x6c1c('0x5'));var rimraf=require(_0x6c1c('0x6'));var config=require('../../config/environment');var attributes=require('./analyticMetric.attributes');module[_0x6c1c('0x7')]=function(_0x524a6b,_0x50c1bb){return _0x524a6b['define'](_0x6c1c('0x8'),attributes,{'tableName':_0x6c1c('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
diff --git a/server/api/analyticMetric/analyticMetric.rpc.js b/server/api/analyticMetric/analyticMetric.rpc.js
index ae3d458..49bbcf7 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 _0x886a=['error','code','message','result','catch','lodash','util','moment','bluebird','randomstring','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','info','AnalyticMetric,\x20%s,\x20%s','request\x20sent','debug','AnalyticMetric,\x20%s,\x20%s,\x20%s','stringify'];(function(_0x147523,_0x25c13b){var _0x419b1a=function(_0x4fdf20){while(--_0x4fdf20){_0x147523['push'](_0x147523['shift']());}};_0x419b1a(++_0x25c13b);}(_0x886a,0x119));var _0xa886=function(_0x386b03,_0x5d0000){_0x386b03=_0x386b03-0x0;var _0xd3d524=_0x886a[_0x386b03];return _0xd3d524;};'use strict';var _=require(_0xa886('0x0'));var util=require(_0xa886('0x1'));var moment=require(_0xa886('0x2'));var BPromise=require(_0xa886('0x3'));var rs=require(_0xa886('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0xa886('0x5'));var logger=require(_0xa886('0x6'))(_0xa886('0x7'));var config=require(_0xa886('0x8'));var jayson=require(_0xa886('0x9'));var client=jayson[_0xa886('0xa')][_0xa886('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x5d9bd1,_0x4d12d8,_0x20c97f){return new BPromise(function(_0x228917,_0x15b7ba){return client['request'](_0x5d9bd1,_0x20c97f)['then'](function(_0x1ce5b6){logger[_0xa886('0xc')](_0xa886('0xd'),_0x4d12d8,_0xa886('0xe'));logger[_0xa886('0xf')](_0xa886('0x10'),_0x4d12d8,_0xa886('0xe'),JSON[_0xa886('0x11')](_0x1ce5b6));if(_0x1ce5b6[_0xa886('0x12')]){if(_0x1ce5b6['error'][_0xa886('0x13')]===0x1f4){logger[_0xa886('0x12')]('AnalyticMetric,\x20%s,\x20%s',_0x4d12d8,_0x1ce5b6[_0xa886('0x12')][_0xa886('0x14')]);return _0x15b7ba(_0x1ce5b6[_0xa886('0x12')]['message']);}logger[_0xa886('0x12')](_0xa886('0xd'),_0x4d12d8,_0x1ce5b6['error'][_0xa886('0x14')]);return _0x228917(_0x1ce5b6[_0xa886('0x12')][_0xa886('0x14')]);}else{logger[_0xa886('0xc')]('AnalyticMetric,\x20%s,\x20%s',_0x4d12d8,_0xa886('0xe'));_0x228917(_0x1ce5b6[_0xa886('0x15')][_0xa886('0x14')]);}})[_0xa886('0x16')](function(_0x32df5d){logger['error']('AnalyticMetric,\x20%s,\x20%s',_0x4d12d8,_0x32df5d);_0x15b7ba(_0x32df5d);});});}
\ No newline at end of file
+var _0xedae=['../../mysqldb','../../config/utils','../../config/logger','../../config/environment','http','request','then','info','AnalyticMetric,\x20%s,\x20%s','request\x20sent','debug','AnalyticMetric,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','lodash','util','bluebird','randomstring','ioredis'];(function(_0x4ae625,_0xf396d0){var _0x31accf=function(_0x3ded6b){while(--_0x3ded6b){_0x4ae625['push'](_0x4ae625['shift']());}};_0x31accf(++_0xf396d0);}(_0xedae,0x69));var _0xeeda=function(_0x18a79d,_0x57bd2c){_0x18a79d=_0x18a79d-0x0;var _0x4f8848=_0xedae[_0x18a79d];return _0x4f8848;};'use strict';var _=require(_0xeeda('0x0'));var util=require(_0xeeda('0x1'));var moment=require('moment');var BPromise=require(_0xeeda('0x2'));var rs=require(_0xeeda('0x3'));var fs=require('fs');var Redis=require(_0xeeda('0x4'));var db=require(_0xeeda('0x5'))['db'];var utils=require(_0xeeda('0x6'));var logger=require(_0xeeda('0x7'))('rpc');var config=require(_0xeeda('0x8'));var jayson=require('jayson/promise');var client=jayson['client'][_0xeeda('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x3fa4e9,_0x4033ce,_0x3418da){return new BPromise(function(_0xf06d65,_0x4c3d6e){return client[_0xeeda('0xa')](_0x3fa4e9,_0x3418da)[_0xeeda('0xb')](function(_0x25b219){logger[_0xeeda('0xc')](_0xeeda('0xd'),_0x4033ce,_0xeeda('0xe'));logger[_0xeeda('0xf')](_0xeeda('0x10'),_0x4033ce,_0xeeda('0xe'),JSON[_0xeeda('0x11')](_0x25b219));if(_0x25b219[_0xeeda('0x12')]){if(_0x25b219[_0xeeda('0x12')][_0xeeda('0x13')]===0x1f4){logger['error'](_0xeeda('0xd'),_0x4033ce,_0x25b219[_0xeeda('0x12')]['message']);return _0x4c3d6e(_0x25b219[_0xeeda('0x12')]['message']);}logger[_0xeeda('0x12')](_0xeeda('0xd'),_0x4033ce,_0x25b219[_0xeeda('0x12')][_0xeeda('0x14')]);return _0xf06d65(_0x25b219[_0xeeda('0x12')][_0xeeda('0x14')]);}else{logger[_0xeeda('0xc')](_0xeeda('0xd'),_0x4033ce,_0xeeda('0xe'));_0xf06d65(_0x25b219[_0xeeda('0x15')][_0xeeda('0x14')]);}})['catch'](function(_0x37331a){logger[_0xeeda('0x12')](_0xeeda('0xd'),_0x4033ce,_0x37331a);_0x4c3d6e(_0x37331a);});});}
\ No newline at end of file
diff --git a/server/api/analyticMetric/index.js b/server/api/analyticMetric/index.js
index b6a8989..5d523e5 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 _0xdd0c=['util','path','connect-timeout','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./analyticMetric.controller','get','index','/:id','isAuthenticated','show','update','delete','destroy','exports'];(function(_0x2132a3,_0x4639e9){var _0x21890c=function(_0x34b73d){while(--_0x34b73d){_0x2132a3['push'](_0x2132a3['shift']());}};_0x21890c(++_0x4639e9);}(_0xdd0c,0x165));var _0xcdd0=function(_0xf318bb,_0x31af4f){_0xf318bb=_0xf318bb-0x0;var _0xb5d6d=_0xdd0c[_0xf318bb];return _0xb5d6d;};'use strict';var multer=require('multer');var util=require(_0xcdd0('0x0'));var path=require(_0xcdd0('0x1'));var timeout=require(_0xcdd0('0x2'));var express=require('express');var router=express[_0xcdd0('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0xcdd0('0x4'));var interaction=require(_0xcdd0('0x5'));var config=require(_0xcdd0('0x6'));var controller=require(_0xcdd0('0x7'));router[_0xcdd0('0x8')]('/',auth['isAuthenticated'](),controller[_0xcdd0('0x9')]);router[_0xcdd0('0x8')](_0xcdd0('0xa'),auth[_0xcdd0('0xb')](),controller[_0xcdd0('0xc')]);router['post']('/',auth[_0xcdd0('0xb')](),controller['create']);router['put'](_0xcdd0('0xa'),auth[_0xcdd0('0xb')](),controller[_0xcdd0('0xd')]);router[_0xcdd0('0xe')](_0xcdd0('0xa'),auth[_0xcdd0('0xb')](),controller[_0xcdd0('0xf')]);module[_0xcdd0('0x10')]=router;
\ No newline at end of file
+var _0xbdfd=['delete','destroy','exports','multer','connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment','get','isAuthenticated','/:id','show','post','create','put','update'];(function(_0x30182f,_0x30ce41){var _0x5207db=function(_0x50a417){while(--_0x50a417){_0x30182f['push'](_0x30182f['shift']());}};_0x5207db(++_0x30ce41);}(_0xbdfd,0x135));var _0xdbdf=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0xbdfd[_0x321bb2];return _0x9c12ed;};'use strict';var multer=require(_0xdbdf('0x0'));var util=require('util');var path=require('path');var timeout=require(_0xdbdf('0x1'));var express=require(_0xdbdf('0x2'));var router=express[_0xdbdf('0x3')]();var fs_extra=require(_0xdbdf('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0xdbdf('0x5'));var config=require(_0xdbdf('0x6'));var controller=require('./analyticMetric.controller');router[_0xdbdf('0x7')]('/',auth[_0xdbdf('0x8')](),controller['index']);router[_0xdbdf('0x7')](_0xdbdf('0x9'),auth[_0xdbdf('0x8')](),controller[_0xdbdf('0xa')]);router[_0xdbdf('0xb')]('/',auth['isAuthenticated'](),controller[_0xdbdf('0xc')]);router[_0xdbdf('0xd')](_0xdbdf('0x9'),auth[_0xdbdf('0x8')](),controller[_0xdbdf('0xe')]);router[_0xdbdf('0xf')]('/:id',auth['isAuthenticated'](),controller[_0xdbdf('0x10')]);module[_0xdbdf('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 6d91c52..ade2547 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 _0xfb89=['TEXT'];(function(_0x3bc82d,_0x59187f){var _0x2cfb3d=function(_0x515ac3){while(--_0x515ac3){_0x3bc82d['push'](_0x3bc82d['shift']());}};_0x2cfb3d(++_0x59187f);}(_0xfb89,0x196));var _0x9fb8=function(_0x3e478c,_0x152670){_0x3e478c=_0x3e478c-0x0;var _0x29ef89=_0xfb89[_0x3e478c];return _0x29ef89;};'use strict';var Sequelize=require('sequelize');module['exports']={'tree':{'type':Sequelize[_0x9fb8('0x0')],'allowNull':![]}};
\ No newline at end of file
+var _0xd8f3=['TEXT','sequelize','exports'];(function(_0x2da9df,_0x3a6b87){var _0x2fecc3=function(_0x3663e1){while(--_0x3663e1){_0x2da9df['push'](_0x2da9df['shift']());}};_0x2fecc3(++_0x3a6b87);}(_0xd8f3,0x154));var _0x3d8f=function(_0x128641,_0x5b428c){_0x128641=_0x128641-0x0;var _0x28f3b2=_0xd8f3[_0x128641];return _0x28f3b2;};'use strict';var Sequelize=require(_0x3d8f('0x0'));module[_0x3d8f('0x1')]={'tree':{'type':Sequelize[_0x3d8f('0x2')],'allowNull':![]}};
\ No newline at end of file
diff --git a/server/api/analyticTreeReport/analyticTreeReport.controller.js b/server/api/analyticTreeReport/analyticTreeReport.controller.js
index b26ede3..7061bd0 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 _0x35ff=['attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','VIRTUAL','filter','merge','options','includeAll','AnalyticTreeReport','findAll','rows','catch','show','params','include','find','create','body','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','sox','lodash','squel','crypto','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','offset','limit','undefined','count','set','Content-Range','json','apply','reject','save','update','then','destroy','error','stack','name','send','rawAttributes','fieldName','type','key','map','query','keys','filters','intersection','model','fields'];(function(_0x47a768,_0x3357cc){var _0x5d756d=function(_0x3d89b4){while(--_0x3d89b4){_0x47a768['push'](_0x47a768['shift']());}};_0x5d756d(++_0x3357cc);}(_0x35ff,0x1ac));var _0xf35f=function(_0x93f225,_0x208206){_0x93f225=_0x93f225-0x0;var _0x272bf4=_0x35ff[_0x93f225];return _0x272bf4;};'use strict';var emlformat=require(_0xf35f('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xf35f('0x1'));var jsonpatch=require(_0xf35f('0x2'));var rp=require(_0xf35f('0x3'));var moment=require(_0xf35f('0x4'));var BPromise=require(_0xf35f('0x5'));var Mustache=require('mustache');var util=require(_0xf35f('0x6'));var path=require(_0xf35f('0x7'));var sox=require(_0xf35f('0x8'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xf35f('0x9'));var squel=require(_0xf35f('0xa'));var crypto=require(_0xf35f('0xb'));var jsforce=require(_0xf35f('0xc'));var deskjs=require(_0xf35f('0xd'));var toCsv=require(_0xf35f('0xe'));var querystring=require(_0xf35f('0xf'));var Papa=require(_0xf35f('0x10'));var Redis=require(_0xf35f('0x11'));var authService=require(_0xf35f('0x12'));var qs=require(_0xf35f('0x13'));var as=require(_0xf35f('0x14'));var hardwareService=require(_0xf35f('0x15'));var logger=require(_0xf35f('0x16'))(_0xf35f('0x17'));var utils=require('../../config/utils');var config=require(_0xf35f('0x18'));var licenseUtil=require(_0xf35f('0x19'));var db=require(_0xf35f('0x1a'))['db'];function respondWithStatusCode(_0x326f58,_0x58d2b4){_0x58d2b4=_0x58d2b4||0xcc;return function(_0x26c10c){if(_0x26c10c){return _0x326f58[_0xf35f('0x1b')](_0x58d2b4);}return _0x326f58[_0xf35f('0x1c')](_0x58d2b4)[_0xf35f('0x1d')]();};}function respondWithResult(_0x30a4e9,_0x48e45b){_0x48e45b=_0x48e45b||0xc8;return function(_0x1b28ad){if(_0x1b28ad){return _0x30a4e9[_0xf35f('0x1c')](_0x48e45b)['json'](_0x1b28ad);}};}function respondWithFilteredResult(_0x3d68af,_0x35a830){return function(_0xa458a2){if(_0xa458a2){var _0x585cb6=typeof _0x35a830[_0xf35f('0x1e')]==='undefined'&&typeof _0x35a830[_0xf35f('0x1f')]===_0xf35f('0x20');var _0x1473f7=_0xa458a2[_0xf35f('0x21')];var _0x550877=_0x585cb6?0x0:_0x35a830[_0xf35f('0x1e')];var _0x1a3086=_0x585cb6?_0xa458a2[_0xf35f('0x21')]:_0x35a830[_0xf35f('0x1e')]+_0x35a830['limit'];var _0x449c22;if(_0x1a3086>=_0x1473f7){_0x1a3086=_0x1473f7;_0x449c22=0xc8;}else{_0x449c22=0xce;}_0x3d68af[_0xf35f('0x1c')](_0x449c22);return _0x3d68af[_0xf35f('0x22')](_0xf35f('0x23'),_0x550877+'-'+_0x1a3086+'/'+_0x1473f7)[_0xf35f('0x24')](_0xa458a2);}return null;};}function patchUpdates(_0x2c9b3c){return function(_0x40a5ae){try{jsonpatch[_0xf35f('0x25')](_0x40a5ae,_0x2c9b3c,!![]);}catch(_0x30bd95){return BPromise[_0xf35f('0x26')](_0x30bd95);}return _0x40a5ae[_0xf35f('0x27')]();};}function saveUpdates(_0x340967,_0x588353){return function(_0x616a9e){if(_0x616a9e){return _0x616a9e[_0xf35f('0x28')](_0x340967)[_0xf35f('0x29')](function(_0x7b5931){return _0x7b5931;});}return null;};}function removeEntity(_0x539d88,_0x4bedef){return function(_0x1fc44d){if(_0x1fc44d){return _0x1fc44d[_0xf35f('0x2a')]()[_0xf35f('0x29')](function(){_0x539d88[_0xf35f('0x1c')](0xcc)['end']();});}};}function handleEntityNotFound(_0x1e491c,_0x3b6797){return function(_0x2aa3b0){if(!_0x2aa3b0){_0x1e491c[_0xf35f('0x1b')](0x194);}return _0x2aa3b0;};}function handleError(_0x5e1a20,_0x17bc62){_0x17bc62=_0x17bc62||0x1f4;return function(_0x3e2842){logger[_0xf35f('0x2b')](_0x3e2842[_0xf35f('0x2c')]);if(_0x3e2842[_0xf35f('0x2d')]){delete _0x3e2842['name'];}_0x5e1a20[_0xf35f('0x1c')](_0x17bc62)[_0xf35f('0x2e')](_0x3e2842);};}exports['index']=function(_0x3c6667,_0x42adf3){var _0x3612b1={},_0x5c6577={},_0x596ce4={'count':0x0,'rows':[]};var _0x38ed09=_['map'](db['AnalyticTreeReport'][_0xf35f('0x2f')],function(_0x5db0c1){return{'name':_0x5db0c1[_0xf35f('0x30')],'type':_0x5db0c1[_0xf35f('0x31')][_0xf35f('0x32')]};});_0x5c6577['model']=_[_0xf35f('0x33')](_0x38ed09,_0xf35f('0x2d'));_0x5c6577[_0xf35f('0x34')]=_[_0xf35f('0x35')](_0x3c6667[_0xf35f('0x34')]);_0x5c6577[_0xf35f('0x36')]=_[_0xf35f('0x37')](_0x5c6577[_0xf35f('0x38')],_0x5c6577['query']);_0x3612b1['attributes']=_['intersection'](_0x5c6577[_0xf35f('0x38')],qs['fields'](_0x3c6667[_0xf35f('0x34')][_0xf35f('0x39')]));_0x3612b1[_0xf35f('0x3a')]=_0x3612b1[_0xf35f('0x3a')][_0xf35f('0x3b')]?_0x3612b1[_0xf35f('0x3a')]:_0x5c6577[_0xf35f('0x38')];if(!_0x3c6667[_0xf35f('0x34')][_0xf35f('0x3c')](_0xf35f('0x3d'))){_0x3612b1[_0xf35f('0x1f')]=qs[_0xf35f('0x1f')](_0x3c6667[_0xf35f('0x34')][_0xf35f('0x1f')]);_0x3612b1[_0xf35f('0x1e')]=qs[_0xf35f('0x1e')](_0x3c6667[_0xf35f('0x34')][_0xf35f('0x1e')]);}_0x3612b1[_0xf35f('0x3e')]=qs[_0xf35f('0x3f')](_0x3c6667['query'][_0xf35f('0x3f')]);_0x3612b1[_0xf35f('0x40')]=qs[_0xf35f('0x36')](_[_0xf35f('0x41')](_0x3c6667[_0xf35f('0x34')],_0x5c6577[_0xf35f('0x36')]),_0x38ed09);if(_0x3c6667[_0xf35f('0x34')]['filter']){_0x3612b1[_0xf35f('0x40')]=_['merge'](_0x3612b1[_0xf35f('0x40')],{'$or':_[_0xf35f('0x33')](_0x38ed09,function(_0x19b01a){if(_0x19b01a['type']!==_0xf35f('0x42')){var _0x33bdd0={};_0x33bdd0[_0x19b01a[_0xf35f('0x2d')]]={'$like':'%'+_0x3c6667[_0xf35f('0x34')][_0xf35f('0x43')]+'%'};return _0x33bdd0;}})});}_0x3612b1=_[_0xf35f('0x44')]({},_0x3612b1,_0x3c6667[_0xf35f('0x45')]);var _0x5e000f={'where':_0x3612b1[_0xf35f('0x40')]};return db['AnalyticTreeReport'][_0xf35f('0x21')](_0x5e000f)[_0xf35f('0x29')](function(_0x2ff544){_0x596ce4[_0xf35f('0x21')]=_0x2ff544;if(_0x3c6667[_0xf35f('0x34')][_0xf35f('0x46')]){_0x3612b1['include']=[{'all':!![]}];}return db[_0xf35f('0x47')][_0xf35f('0x48')](_0x3612b1);})['then'](function(_0x7ea5c7){_0x596ce4[_0xf35f('0x49')]=_0x7ea5c7;return _0x596ce4;})['then'](respondWithFilteredResult(_0x42adf3,_0x3612b1))[_0xf35f('0x4a')](handleError(_0x42adf3,null));};exports[_0xf35f('0x4b')]=function(_0x353b4f,_0xf4f4b6){var _0x3515f1={'raw':!![],'where':{'id':_0x353b4f[_0xf35f('0x4c')]['id']}},_0x38b23a={};_0x38b23a['model']=_[_0xf35f('0x35')](db[_0xf35f('0x47')][_0xf35f('0x2f')]);_0x38b23a['query']=_['keys'](_0x353b4f[_0xf35f('0x34')]);_0x38b23a[_0xf35f('0x36')]=_[_0xf35f('0x37')](_0x38b23a[_0xf35f('0x38')],_0x38b23a['query']);_0x3515f1['attributes']=_[_0xf35f('0x37')](_0x38b23a['model'],qs['fields'](_0x353b4f[_0xf35f('0x34')][_0xf35f('0x39')]));_0x3515f1[_0xf35f('0x3a')]=_0x3515f1[_0xf35f('0x3a')][_0xf35f('0x3b')]?_0x3515f1[_0xf35f('0x3a')]:_0x38b23a[_0xf35f('0x38')];if(_0x353b4f[_0xf35f('0x34')]['includeAll']){_0x3515f1[_0xf35f('0x4d')]=[{'all':!![]}];}_0x3515f1=_['merge']({},_0x3515f1,_0x353b4f[_0xf35f('0x45')]);return db[_0xf35f('0x47')][_0xf35f('0x4e')](_0x3515f1)[_0xf35f('0x29')](handleEntityNotFound(_0xf4f4b6,null))[_0xf35f('0x29')](respondWithResult(_0xf4f4b6,null))[_0xf35f('0x4a')](handleError(_0xf4f4b6,null));};exports[_0xf35f('0x4f')]=function(_0x3aa682,_0x2be68b){return db['AnalyticTreeReport'][_0xf35f('0x4f')](_0x3aa682[_0xf35f('0x50')],{})['then'](respondWithResult(_0x2be68b,0xc9))['catch'](handleError(_0x2be68b,null));};exports[_0xf35f('0x28')]=function(_0x110a6c,_0x521eee){if(_0x110a6c['body']['id']){delete _0x110a6c[_0xf35f('0x50')]['id'];}return db[_0xf35f('0x47')][_0xf35f('0x4e')]({'where':{'id':_0x110a6c[_0xf35f('0x4c')]['id']}})[_0xf35f('0x29')](handleEntityNotFound(_0x521eee,null))[_0xf35f('0x29')](saveUpdates(_0x110a6c[_0xf35f('0x50')],null))[_0xf35f('0x29')](respondWithResult(_0x521eee,null))[_0xf35f('0x4a')](handleError(_0x521eee,null));};exports[_0xf35f('0x2a')]=function(_0x274094,_0x2917b7){return db['AnalyticTreeReport'][_0xf35f('0x4e')]({'where':{'id':_0x274094['params']['id']}})[_0xf35f('0x29')](handleEntityNotFound(_0x2917b7,null))[_0xf35f('0x29')](removeEntity(_0x2917b7,null))['catch'](handleError(_0x2917b7,null));};
\ No newline at end of file
+var _0x0523=['../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','end','offset','limit','undefined','count','set','Content-Range','json','apply','save','update','then','sendStatus','error','stack','name','index','AnalyticTreeReport','rawAttributes','type','key','model','map','query','keys','filters','intersection','attributes','fields','hasOwnProperty','order','sort','filter','where','merge','options','includeAll','include','findAll','rows','catch','show','params','length','find','create','body','destroy','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','to-csv','ejs','fs-extra','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','api'];(function(_0x2e4e19,_0x493b50){var _0x9ba20b=function(_0x2f6456){while(--_0x2f6456){_0x2e4e19['push'](_0x2e4e19['shift']());}};_0x9ba20b(++_0x493b50);}(_0x0523,0x1a7));var _0x3052=function(_0x374bcf,_0x1c761c){_0x374bcf=_0x374bcf-0x0;var _0x53e31b=_0x0523[_0x374bcf];return _0x53e31b;};'use strict';var emlformat=require(_0x3052('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x3052('0x1'));var jsonpatch=require(_0x3052('0x2'));var rp=require(_0x3052('0x3'));var moment=require(_0x3052('0x4'));var BPromise=require(_0x3052('0x5'));var Mustache=require(_0x3052('0x6'));var util=require(_0x3052('0x7'));var path=require('path');var sox=require(_0x3052('0x8'));var csv=require(_0x3052('0x9'));var ejs=require(_0x3052('0xa'));var fs=require('fs');var fs_extra=require(_0x3052('0xb'));var _=require('lodash');var squel=require(_0x3052('0xc'));var crypto=require('crypto');var jsforce=require(_0x3052('0xd'));var deskjs=require(_0x3052('0xe'));var toCsv=require('to-csv');var querystring=require(_0x3052('0xf'));var Papa=require(_0x3052('0x10'));var Redis=require(_0x3052('0x11'));var authService=require(_0x3052('0x12'));var qs=require('../../components/parsers/qs');var as=require(_0x3052('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x3052('0x14'));var utils=require(_0x3052('0x15'));var config=require(_0x3052('0x16'));var licenseUtil=require(_0x3052('0x17'));var db=require(_0x3052('0x18'))['db'];function respondWithStatusCode(_0x3153d0,_0x141ef2){_0x141ef2=_0x141ef2||0xcc;return function(_0x3b3af5){if(_0x3b3af5){return _0x3153d0['sendStatus'](_0x141ef2);}return _0x3153d0[_0x3052('0x19')](_0x141ef2)[_0x3052('0x1a')]();};}function respondWithResult(_0x2f6672,_0x641b1a){_0x641b1a=_0x641b1a||0xc8;return function(_0x10eac3){if(_0x10eac3){return _0x2f6672[_0x3052('0x19')](_0x641b1a)['json'](_0x10eac3);}};}function respondWithFilteredResult(_0xfd29e5,_0x15410b){return function(_0x3da043){if(_0x3da043){var _0x305d4=typeof _0x15410b[_0x3052('0x1b')]==='undefined'&&typeof _0x15410b[_0x3052('0x1c')]===_0x3052('0x1d');var _0x243afe=_0x3da043['count'];var _0x1fff1c=_0x305d4?0x0:_0x15410b[_0x3052('0x1b')];var _0x416300=_0x305d4?_0x3da043[_0x3052('0x1e')]:_0x15410b[_0x3052('0x1b')]+_0x15410b[_0x3052('0x1c')];var _0x3ba0be;if(_0x416300>=_0x243afe){_0x416300=_0x243afe;_0x3ba0be=0xc8;}else{_0x3ba0be=0xce;}_0xfd29e5[_0x3052('0x19')](_0x3ba0be);return _0xfd29e5[_0x3052('0x1f')](_0x3052('0x20'),_0x1fff1c+'-'+_0x416300+'/'+_0x243afe)[_0x3052('0x21')](_0x3da043);}return null;};}function patchUpdates(_0x42635e){return function(_0x41444c){try{jsonpatch[_0x3052('0x22')](_0x41444c,_0x42635e,!![]);}catch(_0x573f3a){return BPromise['reject'](_0x573f3a);}return _0x41444c[_0x3052('0x23')]();};}function saveUpdates(_0x123ed,_0x340d68){return function(_0x1bd2fd){if(_0x1bd2fd){return _0x1bd2fd[_0x3052('0x24')](_0x123ed)[_0x3052('0x25')](function(_0x567987){return _0x567987;});}return null;};}function removeEntity(_0x26260b,_0x2a6da4){return function(_0x47f9a9){if(_0x47f9a9){return _0x47f9a9['destroy']()[_0x3052('0x25')](function(){_0x26260b[_0x3052('0x19')](0xcc)[_0x3052('0x1a')]();});}};}function handleEntityNotFound(_0x422a8b,_0x231217){return function(_0x1b3c0e){if(!_0x1b3c0e){_0x422a8b[_0x3052('0x26')](0x194);}return _0x1b3c0e;};}function handleError(_0x1a1644,_0x51a0d5){_0x51a0d5=_0x51a0d5||0x1f4;return function(_0x5ad2e5){logger[_0x3052('0x27')](_0x5ad2e5[_0x3052('0x28')]);if(_0x5ad2e5[_0x3052('0x29')]){delete _0x5ad2e5[_0x3052('0x29')];}_0x1a1644['status'](_0x51a0d5)['send'](_0x5ad2e5);};}exports[_0x3052('0x2a')]=function(_0x22722b,_0x362cce){var _0x372104={},_0x2c19ed={},_0x4f8522={'count':0x0,'rows':[]};var _0x329a9b=_['map'](db[_0x3052('0x2b')][_0x3052('0x2c')],function(_0x22a031){return{'name':_0x22a031['fieldName'],'type':_0x22a031[_0x3052('0x2d')][_0x3052('0x2e')]};});_0x2c19ed[_0x3052('0x2f')]=_[_0x3052('0x30')](_0x329a9b,_0x3052('0x29'));_0x2c19ed[_0x3052('0x31')]=_[_0x3052('0x32')](_0x22722b['query']);_0x2c19ed[_0x3052('0x33')]=_[_0x3052('0x34')](_0x2c19ed[_0x3052('0x2f')],_0x2c19ed[_0x3052('0x31')]);_0x372104[_0x3052('0x35')]=_[_0x3052('0x34')](_0x2c19ed['model'],qs[_0x3052('0x36')](_0x22722b[_0x3052('0x31')]['fields']));_0x372104['attributes']=_0x372104[_0x3052('0x35')]['length']?_0x372104[_0x3052('0x35')]:_0x2c19ed[_0x3052('0x2f')];if(!_0x22722b['query'][_0x3052('0x37')]('nolimit')){_0x372104[_0x3052('0x1c')]=qs[_0x3052('0x1c')](_0x22722b['query']['limit']);_0x372104[_0x3052('0x1b')]=qs[_0x3052('0x1b')](_0x22722b[_0x3052('0x31')][_0x3052('0x1b')]);}_0x372104[_0x3052('0x38')]=qs[_0x3052('0x39')](_0x22722b[_0x3052('0x31')][_0x3052('0x39')]);_0x372104['where']=qs['filters'](_['pick'](_0x22722b['query'],_0x2c19ed[_0x3052('0x33')]),_0x329a9b);if(_0x22722b['query'][_0x3052('0x3a')]){_0x372104[_0x3052('0x3b')]=_[_0x3052('0x3c')](_0x372104[_0x3052('0x3b')],{'$or':_[_0x3052('0x30')](_0x329a9b,function(_0x1f546a){if(_0x1f546a[_0x3052('0x2d')]!=='VIRTUAL'){var _0x390fdc={};_0x390fdc[_0x1f546a[_0x3052('0x29')]]={'$like':'%'+_0x22722b[_0x3052('0x31')][_0x3052('0x3a')]+'%'};return _0x390fdc;}})});}_0x372104=_['merge']({},_0x372104,_0x22722b[_0x3052('0x3d')]);var _0x7daecf={'where':_0x372104['where']};return db[_0x3052('0x2b')]['count'](_0x7daecf)[_0x3052('0x25')](function(_0x16bac0){_0x4f8522[_0x3052('0x1e')]=_0x16bac0;if(_0x22722b['query'][_0x3052('0x3e')]){_0x372104[_0x3052('0x3f')]=[{'all':!![]}];}return db['AnalyticTreeReport'][_0x3052('0x40')](_0x372104);})[_0x3052('0x25')](function(_0x4c45d4){_0x4f8522[_0x3052('0x41')]=_0x4c45d4;return _0x4f8522;})[_0x3052('0x25')](respondWithFilteredResult(_0x362cce,_0x372104))[_0x3052('0x42')](handleError(_0x362cce,null));};exports[_0x3052('0x43')]=function(_0x14d1e9,_0x2475da){var _0x24a183={'raw':!![],'where':{'id':_0x14d1e9[_0x3052('0x44')]['id']}},_0x35f678={};_0x35f678['model']=_[_0x3052('0x32')](db['AnalyticTreeReport'][_0x3052('0x2c')]);_0x35f678[_0x3052('0x31')]=_[_0x3052('0x32')](_0x14d1e9[_0x3052('0x31')]);_0x35f678[_0x3052('0x33')]=_[_0x3052('0x34')](_0x35f678['model'],_0x35f678[_0x3052('0x31')]);_0x24a183[_0x3052('0x35')]=_[_0x3052('0x34')](_0x35f678['model'],qs['fields'](_0x14d1e9[_0x3052('0x31')][_0x3052('0x36')]));_0x24a183[_0x3052('0x35')]=_0x24a183[_0x3052('0x35')][_0x3052('0x45')]?_0x24a183[_0x3052('0x35')]:_0x35f678[_0x3052('0x2f')];if(_0x14d1e9[_0x3052('0x31')]['includeAll']){_0x24a183[_0x3052('0x3f')]=[{'all':!![]}];}_0x24a183=_['merge']({},_0x24a183,_0x14d1e9[_0x3052('0x3d')]);return db[_0x3052('0x2b')][_0x3052('0x46')](_0x24a183)['then'](handleEntityNotFound(_0x2475da,null))[_0x3052('0x25')](respondWithResult(_0x2475da,null))[_0x3052('0x42')](handleError(_0x2475da,null));};exports[_0x3052('0x47')]=function(_0x5ed1d7,_0x39f02c){return db[_0x3052('0x2b')][_0x3052('0x47')](_0x5ed1d7[_0x3052('0x48')],{})[_0x3052('0x25')](respondWithResult(_0x39f02c,0xc9))['catch'](handleError(_0x39f02c,null));};exports[_0x3052('0x24')]=function(_0x3622b7,_0x50336e){if(_0x3622b7[_0x3052('0x48')]['id']){delete _0x3622b7['body']['id'];}return db[_0x3052('0x2b')][_0x3052('0x46')]({'where':{'id':_0x3622b7[_0x3052('0x44')]['id']}})['then'](handleEntityNotFound(_0x50336e,null))['then'](saveUpdates(_0x3622b7['body'],null))['then'](respondWithResult(_0x50336e,null))[_0x3052('0x42')](handleError(_0x50336e,null));};exports[_0x3052('0x49')]=function(_0x5c9791,_0x5b19dc){return db[_0x3052('0x2b')][_0x3052('0x46')]({'where':{'id':_0x5c9791[_0x3052('0x44')]['id']}})[_0x3052('0x25')](handleEntityNotFound(_0x5b19dc,null))[_0x3052('0x25')](removeEntity(_0x5b19dc,null))[_0x3052('0x42')](handleError(_0x5b19dc,null));};
\ No newline at end of file
diff --git a/server/api/analyticTreeReport/analyticTreeReport.model.js b/server/api/analyticTreeReport/analyticTreeReport.model.js
index 61c0e25..e732bb4 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 _0x8d1a=['exports','AnalyticTreeReport','analytics_report_trees','util','../../config/logger','api','moment','bluebird','request-promise','path','../../config/environment'];(function(_0xa148b7,_0x2f3eb2){var _0x51efd3=function(_0x34bcec){while(--_0x34bcec){_0xa148b7['push'](_0xa148b7['shift']());}};_0x51efd3(++_0x2f3eb2);}(_0x8d1a,0x10b));var _0xa8d1=function(_0x1b0cc8,_0x6e3392){_0x1b0cc8=_0x1b0cc8-0x0;var _0x441d1a=_0x8d1a[_0x1b0cc8];return _0x441d1a;};'use strict';var _=require('lodash');var util=require(_0xa8d1('0x0'));var logger=require(_0xa8d1('0x1'))(_0xa8d1('0x2'));var moment=require(_0xa8d1('0x3'));var BPromise=require(_0xa8d1('0x4'));var rp=require(_0xa8d1('0x5'));var fs=require('fs');var path=require(_0xa8d1('0x6'));var rimraf=require('rimraf');var config=require(_0xa8d1('0x7'));var attributes=require('./analyticTreeReport.attributes');module[_0xa8d1('0x8')]=function(_0x216b44,_0x449fd0){return _0x216b44['define'](_0xa8d1('0x9'),attributes,{'tableName':_0xa8d1('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x1795=['bluebird','request-promise','path','rimraf','./analyticTreeReport.attributes','exports','define','analytics_report_trees','util','../../config/logger'];(function(_0xea41f1,_0x562290){var _0x484896=function(_0x2e20e3){while(--_0x2e20e3){_0xea41f1['push'](_0xea41f1['shift']());}};_0x484896(++_0x562290);}(_0x1795,0x76));var _0x5179=function(_0x14e504,_0x5e4fd4){_0x14e504=_0x14e504-0x0;var _0x3fb819=_0x1795[_0x14e504];return _0x3fb819;};'use strict';var _=require('lodash');var util=require(_0x5179('0x0'));var logger=require(_0x5179('0x1'))('api');var moment=require('moment');var BPromise=require(_0x5179('0x2'));var rp=require(_0x5179('0x3'));var fs=require('fs');var path=require(_0x5179('0x4'));var rimraf=require(_0x5179('0x5'));var config=require('../../config/environment');var attributes=require(_0x5179('0x6'));module[_0x5179('0x7')]=function(_0x182143,_0x32ed59){return _0x182143[_0x5179('0x8')]('AnalyticTreeReport',attributes,{'tableName':_0x5179('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
diff --git a/server/api/analyticTreeReport/analyticTreeReport.rpc.js b/server/api/analyticTreeReport/analyticTreeReport.rpc.js
index 34ce82d..5eb4d17 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 _0x5f66=['../../mysqldb','../../config/utils','rpc','jayson/promise','client','request','then','AnalyticTreeReport,\x20%s,\x20%s','request\x20sent','debug','AnalyticTreeReport,\x20%s,\x20%s,\x20%s','stringify','code','message','error','info','catch','util','bluebird','randomstring','ioredis'];(function(_0x5bd9fc,_0x5943d9){var _0x6f81eb=function(_0x2b7e51){while(--_0x2b7e51){_0x5bd9fc['push'](_0x5bd9fc['shift']());}};_0x6f81eb(++_0x5943d9);}(_0x5f66,0x1a0));var _0x65f6=function(_0x4154a6,_0x2c0b8e){_0x4154a6=_0x4154a6-0x0;var _0x3b2786=_0x5f66[_0x4154a6];return _0x3b2786;};'use strict';var _=require('lodash');var util=require(_0x65f6('0x0'));var moment=require('moment');var BPromise=require(_0x65f6('0x1'));var rs=require(_0x65f6('0x2'));var fs=require('fs');var Redis=require(_0x65f6('0x3'));var db=require(_0x65f6('0x4'))['db'];var utils=require(_0x65f6('0x5'));var logger=require('../../config/logger')(_0x65f6('0x6'));var config=require('../../config/environment');var jayson=require(_0x65f6('0x7'));var client=jayson[_0x65f6('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x4ed98f,_0x1c0e12,_0x2c6571){return new BPromise(function(_0x112079,_0x8f6451){return client[_0x65f6('0x9')](_0x4ed98f,_0x2c6571)[_0x65f6('0xa')](function(_0x48d85c){logger['info'](_0x65f6('0xb'),_0x1c0e12,_0x65f6('0xc'));logger[_0x65f6('0xd')](_0x65f6('0xe'),_0x1c0e12,'request\x20sent',JSON[_0x65f6('0xf')](_0x48d85c));if(_0x48d85c['error']){if(_0x48d85c['error'][_0x65f6('0x10')]===0x1f4){logger['error'](_0x65f6('0xb'),_0x1c0e12,_0x48d85c['error'][_0x65f6('0x11')]);return _0x8f6451(_0x48d85c[_0x65f6('0x12')][_0x65f6('0x11')]);}logger[_0x65f6('0x12')](_0x65f6('0xb'),_0x1c0e12,_0x48d85c[_0x65f6('0x12')][_0x65f6('0x11')]);return _0x112079(_0x48d85c[_0x65f6('0x12')][_0x65f6('0x11')]);}else{logger[_0x65f6('0x13')]('AnalyticTreeReport,\x20%s,\x20%s',_0x1c0e12,_0x65f6('0xc'));_0x112079(_0x48d85c['result']['message']);}})[_0x65f6('0x14')](function(_0x5c69f8){logger[_0x65f6('0x12')](_0x65f6('0xb'),_0x1c0e12,_0x5c69f8);_0x8f6451(_0x5c69f8);});});}
\ No newline at end of file
+var _0x7a54=['info','AnalyticTreeReport,\x20%s,\x20%s','debug','stringify','error','code','message','request\x20sent','result','catch','lodash','util','moment','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http'];(function(_0x397e5f,_0x454c8f){var _0x5302b8=function(_0x1a29ef){while(--_0x1a29ef){_0x397e5f['push'](_0x397e5f['shift']());}};_0x5302b8(++_0x454c8f);}(_0x7a54,0x106));var _0x47a5=function(_0x6fc0d1,_0x2d2513){_0x6fc0d1=_0x6fc0d1-0x0;var _0x4aa763=_0x7a54[_0x6fc0d1];return _0x4aa763;};'use strict';var _=require(_0x47a5('0x0'));var util=require(_0x47a5('0x1'));var moment=require(_0x47a5('0x2'));var BPromise=require('bluebird');var rs=require(_0x47a5('0x3'));var fs=require('fs');var Redis=require(_0x47a5('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x47a5('0x5'));var logger=require(_0x47a5('0x6'))(_0x47a5('0x7'));var config=require(_0x47a5('0x8'));var jayson=require(_0x47a5('0x9'));var client=jayson['client'][_0x47a5('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x59199c,_0x343372,_0x30e405){return new BPromise(function(_0x506eda,_0x194fb0){return client['request'](_0x59199c,_0x30e405)['then'](function(_0x582352){logger[_0x47a5('0xb')](_0x47a5('0xc'),_0x343372,'request\x20sent');logger[_0x47a5('0xd')]('AnalyticTreeReport,\x20%s,\x20%s,\x20%s',_0x343372,'request\x20sent',JSON[_0x47a5('0xe')](_0x582352));if(_0x582352[_0x47a5('0xf')]){if(_0x582352[_0x47a5('0xf')][_0x47a5('0x10')]===0x1f4){logger[_0x47a5('0xf')](_0x47a5('0xc'),_0x343372,_0x582352[_0x47a5('0xf')]['message']);return _0x194fb0(_0x582352[_0x47a5('0xf')][_0x47a5('0x11')]);}logger[_0x47a5('0xf')](_0x47a5('0xc'),_0x343372,_0x582352[_0x47a5('0xf')][_0x47a5('0x11')]);return _0x506eda(_0x582352[_0x47a5('0xf')][_0x47a5('0x11')]);}else{logger['info'](_0x47a5('0xc'),_0x343372,_0x47a5('0x12'));_0x506eda(_0x582352[_0x47a5('0x13')][_0x47a5('0x11')]);}})[_0x47a5('0x14')](function(_0x574af6){logger['error'](_0x47a5('0xc'),_0x343372,_0x574af6);_0x194fb0(_0x574af6);});});}
\ No newline at end of file
diff --git a/server/api/analyticTreeReport/index.js b/server/api/analyticTreeReport/index.js
index ea3b688..ada77cf 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 _0x8e2e=['show','post','create','put','destroy','exports','multer','util','path','Router','fs-extra','../../components/auth/service','get','isAuthenticated','/:id'];(function(_0x3cea78,_0x4a6751){var _0x33b66b=function(_0x1f45cd){while(--_0x1f45cd){_0x3cea78['push'](_0x3cea78['shift']());}};_0x33b66b(++_0x4a6751);}(_0x8e2e,0x19b));var _0xe8e2=function(_0x544b3f,_0x4d8b66){_0x544b3f=_0x544b3f-0x0;var _0x15787f=_0x8e2e[_0x544b3f];return _0x15787f;};'use strict';var multer=require(_0xe8e2('0x0'));var util=require(_0xe8e2('0x1'));var path=require(_0xe8e2('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0xe8e2('0x3')]();var fs_extra=require(_0xe8e2('0x4'));var auth=require(_0xe8e2('0x5'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require('./analyticTreeReport.controller');router[_0xe8e2('0x6')]('/',auth[_0xe8e2('0x7')](),controller['index']);router[_0xe8e2('0x6')](_0xe8e2('0x8'),auth[_0xe8e2('0x7')](),controller[_0xe8e2('0x9')]);router[_0xe8e2('0xa')]('/',auth['isAuthenticated'](),controller[_0xe8e2('0xb')]);router[_0xe8e2('0xc')](_0xe8e2('0x8'),auth['isAuthenticated'](),controller['update']);router['delete'](_0xe8e2('0x8'),auth[_0xe8e2('0x7')](),controller[_0xe8e2('0xd')]);module[_0xe8e2('0xe')]=router;
\ No newline at end of file
+var _0x6baa=['../../config/environment','./analyticTreeReport.controller','get','isAuthenticated','show','create','put','delete','/:id','exports','multer','util','path','connect-timeout','express','Router','../../components/interaction/service'];(function(_0x19dfef,_0x51721e){var _0x347527=function(_0x1d11f8){while(--_0x1d11f8){_0x19dfef['push'](_0x19dfef['shift']());}};_0x347527(++_0x51721e);}(_0x6baa,0xb4));var _0xa6ba=function(_0x818a29,_0x5afa36){_0x818a29=_0x818a29-0x0;var _0x4b60ac=_0x6baa[_0x818a29];return _0x4b60ac;};'use strict';var multer=require(_0xa6ba('0x0'));var util=require(_0xa6ba('0x1'));var path=require(_0xa6ba('0x2'));var timeout=require(_0xa6ba('0x3'));var express=require(_0xa6ba('0x4'));var router=express[_0xa6ba('0x5')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0xa6ba('0x6'));var config=require(_0xa6ba('0x7'));var controller=require(_0xa6ba('0x8'));router[_0xa6ba('0x9')]('/',auth[_0xa6ba('0xa')](),controller['index']);router[_0xa6ba('0x9')]('/:id',auth['isAuthenticated'](),controller[_0xa6ba('0xb')]);router['post']('/',auth[_0xa6ba('0xa')](),controller[_0xa6ba('0xc')]);router[_0xa6ba('0xd')]('/:id',auth[_0xa6ba('0xa')](),controller['update']);router[_0xa6ba('0xe')](_0xa6ba('0xf'),auth[_0xa6ba('0xa')](),controller['destroy']);module[_0xa6ba('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 f805c81..748f447 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 _0x544f=['sequelize','STRING'];(function(_0x325430,_0x81f8df){var _0x47e948=function(_0x438af0){while(--_0x438af0){_0x325430['push'](_0x325430['shift']());}};_0x47e948(++_0x81f8df);}(_0x544f,0x14c));var _0xf544=function(_0x429948,_0x1a6851){_0x429948=_0x429948-0x0;var _0x35d5d1=_0x544f[_0x429948];return _0x35d5d1;};'use strict';var Sequelize=require(_0xf544('0x0'));module['exports']={'name':{'type':Sequelize['STRING']},'basename':{'type':Sequelize[_0xf544('0x1')]},'type':{'type':Sequelize[_0xf544('0x1')]}};
\ No newline at end of file
+var _0xe356=['exports','STRING','sequelize'];(function(_0xcfeda9,_0xd418ae){var _0x4826c7=function(_0x45dc9d){while(--_0x45dc9d){_0xcfeda9['push'](_0xcfeda9['shift']());}};_0x4826c7(++_0xd418ae);}(_0xe356,0x1ee));var _0x6e35=function(_0x36ed0f,_0x292e11){_0x36ed0f=_0x36ed0f-0x0;var _0x3321ad=_0xe356[_0x36ed0f];return _0x3321ad;};'use strict';var Sequelize=require(_0x6e35('0x0'));module[_0x6e35('0x1')]={'name':{'type':Sequelize[_0x6e35('0x2')]},'basename':{'type':Sequelize[_0x6e35('0x2')]},'type':{'type':Sequelize['STRING']}};
\ No newline at end of file
diff --git a/server/api/attachment/attachment.controller.js b/server/api/attachment/attachment.controller.js
index 1ef30f4..84ffe88 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 _0xc8e5=['keys','filters','attributes','intersection','fields','length','nolimit','order','sort','filter','where','merge','options','includeAll','include','findAll','rows','catch','params','find','get','omit','body','createdAt','create','file','basename','filename','mimetype','download','findOne','ChatOfflineMessageId','join','server/files/attachments/','offline-chat/','eml-format','zip-dir','request-promise','bluebird','mustache','util','ejs','fs-extra','lodash','squel','crypto','jsforce','to-csv','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','status','end','json','undefined','count','offset','limit','set','Content-Range','apply','reject','save','update','then','destroy','sendStatus','stack','name','send','index','map','Attachment','rawAttributes','fieldName','type','key','model','query'];(function(_0x359b13,_0x11788c){var _0x28dc12=function(_0x895e88){while(--_0x895e88){_0x359b13['push'](_0x359b13['shift']());}};_0x28dc12(++_0x11788c);}(_0xc8e5,0x79));var _0x5c8e=function(_0x220f6a,_0x2a8b9c){_0x220f6a=_0x220f6a-0x0;var _0x54ef68=_0xc8e5[_0x220f6a];return _0x54ef68;};'use strict';var emlformat=require(_0x5c8e('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x5c8e('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0x5c8e('0x2'));var moment=require('moment');var BPromise=require(_0x5c8e('0x3'));var Mustache=require(_0x5c8e('0x4'));var util=require(_0x5c8e('0x5'));var path=require('path');var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x5c8e('0x6'));var fs=require('fs');var fs_extra=require(_0x5c8e('0x7'));var _=require(_0x5c8e('0x8'));var squel=require(_0x5c8e('0x9'));var crypto=require(_0x5c8e('0xa'));var jsforce=require(_0x5c8e('0xb'));var deskjs=require('desk.js');var toCsv=require(_0x5c8e('0xc'));var querystring=require(_0x5c8e('0xd'));var Papa=require(_0x5c8e('0xe'));var Redis=require('ioredis');var authService=require(_0x5c8e('0xf'));var qs=require(_0x5c8e('0x10'));var as=require(_0x5c8e('0x11'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x5c8e('0x12'))(_0x5c8e('0x13'));var utils=require(_0x5c8e('0x14'));var config=require(_0x5c8e('0x15'));var licenseUtil=require(_0x5c8e('0x16'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x428ff0,_0x2cac48){_0x2cac48=_0x2cac48||0xcc;return function(_0x325496){if(_0x325496){return _0x428ff0['sendStatus'](_0x2cac48);}return _0x428ff0[_0x5c8e('0x17')](_0x2cac48)[_0x5c8e('0x18')]();};}function respondWithResult(_0x11189b,_0x4c39b6){_0x4c39b6=_0x4c39b6||0xc8;return function(_0x30c98d){if(_0x30c98d){return _0x11189b['status'](_0x4c39b6)[_0x5c8e('0x19')](_0x30c98d);}};}function respondWithFilteredResult(_0x4df204,_0x5e0553){return function(_0x280d14){if(_0x280d14){var _0x303ebc=typeof _0x5e0553['offset']===_0x5c8e('0x1a')&&typeof _0x5e0553['limit']===_0x5c8e('0x1a');var _0x89a428=_0x280d14[_0x5c8e('0x1b')];var _0x3b311f=_0x303ebc?0x0:_0x5e0553[_0x5c8e('0x1c')];var _0x3fe437=_0x303ebc?_0x280d14[_0x5c8e('0x1b')]:_0x5e0553[_0x5c8e('0x1c')]+_0x5e0553[_0x5c8e('0x1d')];var _0x1e9280;if(_0x3fe437>=_0x89a428){_0x3fe437=_0x89a428;_0x1e9280=0xc8;}else{_0x1e9280=0xce;}_0x4df204[_0x5c8e('0x17')](_0x1e9280);return _0x4df204[_0x5c8e('0x1e')](_0x5c8e('0x1f'),_0x3b311f+'-'+_0x3fe437+'/'+_0x89a428)[_0x5c8e('0x19')](_0x280d14);}return null;};}function patchUpdates(_0x567874){return function(_0x273f39){try{jsonpatch[_0x5c8e('0x20')](_0x273f39,_0x567874,!![]);}catch(_0x533390){return BPromise[_0x5c8e('0x21')](_0x533390);}return _0x273f39[_0x5c8e('0x22')]();};}function saveUpdates(_0x28010c,_0x5264e6){return function(_0x48a397){if(_0x48a397){return _0x48a397[_0x5c8e('0x23')](_0x28010c)[_0x5c8e('0x24')](function(_0x4f3ae0){return _0x4f3ae0;});}return null;};}function removeEntity(_0x44e800,_0x18273a){return function(_0x581201){if(_0x581201){return _0x581201[_0x5c8e('0x25')]()[_0x5c8e('0x24')](function(){_0x44e800[_0x5c8e('0x17')](0xcc)[_0x5c8e('0x18')]();});}};}function handleEntityNotFound(_0x37e2b4,_0x43538e){return function(_0x4c7c53){if(!_0x4c7c53){_0x37e2b4[_0x5c8e('0x26')](0x194);}return _0x4c7c53;};}function handleError(_0x51b200,_0x298f77){_0x298f77=_0x298f77||0x1f4;return function(_0x3e296e){logger['error'](_0x3e296e[_0x5c8e('0x27')]);if(_0x3e296e['name']){delete _0x3e296e[_0x5c8e('0x28')];}_0x51b200['status'](_0x298f77)[_0x5c8e('0x29')](_0x3e296e);};}exports[_0x5c8e('0x2a')]=function(_0x21c6f6,_0x16f9c1){var _0x2c9863={},_0x12d07f={},_0x277e09={'count':0x0,'rows':[]};var _0x558466=_[_0x5c8e('0x2b')](db[_0x5c8e('0x2c')][_0x5c8e('0x2d')],function(_0x74903a){return{'name':_0x74903a[_0x5c8e('0x2e')],'type':_0x74903a[_0x5c8e('0x2f')][_0x5c8e('0x30')]};});_0x12d07f[_0x5c8e('0x31')]=_['map'](_0x558466,_0x5c8e('0x28'));_0x12d07f[_0x5c8e('0x32')]=_[_0x5c8e('0x33')](_0x21c6f6[_0x5c8e('0x32')]);_0x12d07f[_0x5c8e('0x34')]=_['intersection'](_0x12d07f['model'],_0x12d07f[_0x5c8e('0x32')]);_0x2c9863[_0x5c8e('0x35')]=_[_0x5c8e('0x36')](_0x12d07f[_0x5c8e('0x31')],qs['fields'](_0x21c6f6[_0x5c8e('0x32')][_0x5c8e('0x37')]));_0x2c9863[_0x5c8e('0x35')]=_0x2c9863[_0x5c8e('0x35')][_0x5c8e('0x38')]?_0x2c9863[_0x5c8e('0x35')]:_0x12d07f[_0x5c8e('0x31')];if(!_0x21c6f6[_0x5c8e('0x32')]['hasOwnProperty'](_0x5c8e('0x39'))){_0x2c9863[_0x5c8e('0x1d')]=qs[_0x5c8e('0x1d')](_0x21c6f6['query'][_0x5c8e('0x1d')]);_0x2c9863[_0x5c8e('0x1c')]=qs[_0x5c8e('0x1c')](_0x21c6f6[_0x5c8e('0x32')][_0x5c8e('0x1c')]);}_0x2c9863[_0x5c8e('0x3a')]=qs[_0x5c8e('0x3b')](_0x21c6f6[_0x5c8e('0x32')]['sort']);_0x2c9863['where']=qs[_0x5c8e('0x34')](_['pick'](_0x21c6f6[_0x5c8e('0x32')],_0x12d07f[_0x5c8e('0x34')]),_0x558466);if(_0x21c6f6[_0x5c8e('0x32')][_0x5c8e('0x3c')]){_0x2c9863[_0x5c8e('0x3d')]=_[_0x5c8e('0x3e')](_0x2c9863[_0x5c8e('0x3d')],{'$or':_[_0x5c8e('0x2b')](_0x558466,function(_0x75189a){if(_0x75189a[_0x5c8e('0x2f')]!=='VIRTUAL'){var _0x2e253a={};_0x2e253a[_0x75189a[_0x5c8e('0x28')]]={'$like':'%'+_0x21c6f6['query'][_0x5c8e('0x3c')]+'%'};return _0x2e253a;}})});}_0x2c9863=_[_0x5c8e('0x3e')]({},_0x2c9863,_0x21c6f6[_0x5c8e('0x3f')]);var _0x3506c8={'where':_0x2c9863[_0x5c8e('0x3d')]};return db[_0x5c8e('0x2c')]['count'](_0x3506c8)[_0x5c8e('0x24')](function(_0x17019e){_0x277e09[_0x5c8e('0x1b')]=_0x17019e;if(_0x21c6f6['query'][_0x5c8e('0x40')]){_0x2c9863[_0x5c8e('0x41')]=[{'all':!![]}];}return db['Attachment'][_0x5c8e('0x42')](_0x2c9863);})[_0x5c8e('0x24')](function(_0x3f21e4){_0x277e09[_0x5c8e('0x43')]=_0x3f21e4;return _0x277e09;})[_0x5c8e('0x24')](respondWithFilteredResult(_0x16f9c1,_0x2c9863))[_0x5c8e('0x44')](handleError(_0x16f9c1,null));};exports['show']=function(_0x48be33,_0x4ea88e){var _0xe020bb={'raw':!![],'where':{'id':_0x48be33[_0x5c8e('0x45')]['id']}},_0x5c3bf3={};_0x5c3bf3['model']=_['keys'](db['Attachment'][_0x5c8e('0x2d')]);_0x5c3bf3[_0x5c8e('0x32')]=_[_0x5c8e('0x33')](_0x48be33[_0x5c8e('0x32')]);_0x5c3bf3[_0x5c8e('0x34')]=_[_0x5c8e('0x36')](_0x5c3bf3[_0x5c8e('0x31')],_0x5c3bf3[_0x5c8e('0x32')]);_0xe020bb[_0x5c8e('0x35')]=_[_0x5c8e('0x36')](_0x5c3bf3[_0x5c8e('0x31')],qs[_0x5c8e('0x37')](_0x48be33[_0x5c8e('0x32')][_0x5c8e('0x37')]));_0xe020bb[_0x5c8e('0x35')]=_0xe020bb[_0x5c8e('0x35')]['length']?_0xe020bb[_0x5c8e('0x35')]:_0x5c3bf3['model'];if(_0x48be33[_0x5c8e('0x32')][_0x5c8e('0x40')]){_0xe020bb['include']=[{'all':!![]}];}_0xe020bb=_[_0x5c8e('0x3e')]({},_0xe020bb,_0x48be33[_0x5c8e('0x3f')]);return db[_0x5c8e('0x2c')]['find'](_0xe020bb)[_0x5c8e('0x24')](handleEntityNotFound(_0x4ea88e,null))[_0x5c8e('0x24')](respondWithResult(_0x4ea88e,null))[_0x5c8e('0x44')](handleError(_0x4ea88e,null));};exports['clone']=function(_0x173aed,_0x3a63e3){var _0x522c78={'where':{'id':_0x173aed[_0x5c8e('0x45')]['id']}},_0x372fd5={};_0x372fd5[_0x5c8e('0x31')]=_['keys'](db[_0x5c8e('0x2c')][_0x5c8e('0x2d')]);_0x522c78['attributes']=_['intersection'](_0x372fd5['model'],qs[_0x5c8e('0x37')](_0x173aed['query']['fields']));_0x522c78['attributes']=_0x522c78['attributes'][_0x5c8e('0x38')]?_0x522c78[_0x5c8e('0x35')]:_0x372fd5['model'];if(_0x173aed[_0x5c8e('0x32')]['includeAll']){_0x522c78[_0x5c8e('0x41')]=[{'all':!![]}];}_0x522c78=_[_0x5c8e('0x3e')]({},_0x522c78,_0x173aed[_0x5c8e('0x3f')]);return db[_0x5c8e('0x2c')][_0x5c8e('0x46')](_0x522c78)[_0x5c8e('0x24')](handleEntityNotFound(_0x3a63e3,null))[_0x5c8e('0x24')](function(_0x2b3417){if(_0x2b3417){var _0xaa52d4=_0x2b3417[_0x5c8e('0x47')]({'plain':!![]});_0xaa52d4=qs['omit'](_0xaa52d4,['id','createdAt','updatedAt']);_0x173aed['body']=_[_0x5c8e('0x48')](_0x173aed[_0x5c8e('0x49')],['id',_0x5c8e('0x4a'),'updatedAt']);return db['Attachment'][_0x5c8e('0x4b')](_['merge'](_0xaa52d4,_0x173aed[_0x5c8e('0x49')]),{'include':_0x173aed['query'][_0x5c8e('0x40')]?[{'all':!![]}]:undefined});}})[_0x5c8e('0x24')](respondWithResult(_0x3a63e3,0xc9))[_0x5c8e('0x44')](handleError(_0x3a63e3,null));};exports[_0x5c8e('0x23')]=function(_0x13214a,_0x402eea){if(_0x13214a[_0x5c8e('0x49')]['id']){delete _0x13214a[_0x5c8e('0x49')]['id'];}return db['Attachment'][_0x5c8e('0x46')]({'where':{'id':_0x13214a[_0x5c8e('0x45')]['id']}})[_0x5c8e('0x24')](handleEntityNotFound(_0x402eea,null))[_0x5c8e('0x24')](saveUpdates(_0x13214a['body'],null))[_0x5c8e('0x24')](respondWithResult(_0x402eea,null))[_0x5c8e('0x44')](handleError(_0x402eea,null));};exports[_0x5c8e('0x25')]=function(_0xd7b80d,_0x55b190){return db[_0x5c8e('0x2c')][_0x5c8e('0x46')]({'where':{'id':_0xd7b80d[_0x5c8e('0x45')]['id']}})[_0x5c8e('0x24')](handleEntityNotFound(_0x55b190,null))[_0x5c8e('0x24')](removeEntity(_0x55b190,null))['catch'](handleError(_0x55b190,null));};exports['create']=function(_0x5eae33,_0x917947,_0x71fe1){_0x5eae33[_0x5c8e('0x49')][_0x5c8e('0x28')]=_0x5eae33[_0x5c8e('0x4c')]['originalname'];_0x5eae33[_0x5c8e('0x49')][_0x5c8e('0x4d')]=_0x5eae33[_0x5c8e('0x4c')][_0x5c8e('0x4e')];_0x5eae33[_0x5c8e('0x49')][_0x5c8e('0x2f')]=_0x5eae33['file'][_0x5c8e('0x4f')];return db[_0x5c8e('0x2c')][_0x5c8e('0x4b')](_0x5eae33[_0x5c8e('0x49')])[_0x5c8e('0x24')](respondWithResult(_0x917947,0xc9))[_0x5c8e('0x44')](handleError(_0x917947,null));};exports[_0x5c8e('0x50')]=function(_0x47238b,_0x16ac58,_0x3e4083){return db['Attachment'][_0x5c8e('0x51')]({'where':{'id':_0x47238b[_0x5c8e('0x45')]['id']},'raw':!![]})['then'](handleEntityNotFound(_0x16ac58,null))['then'](function(_0x52d377){if(_0x52d377){var _0x202257=_0x52d377[_0x5c8e('0x52')]!==null;var _0x46e708=path[_0x5c8e('0x53')](config['root'],_0x5c8e('0x54'));if(_0x202257){_0x46e708=path[_0x5c8e('0x53')](_0x46e708,_0x5c8e('0x55'));}var _0x5679bd=path[_0x5c8e('0x53')](_0x46e708,_0x52d377[_0x5c8e('0x4d')]);return _0x16ac58[_0x5c8e('0x50')](_0x5679bd);}})[_0x5c8e('0x44')](handleError(_0x16ac58,null));};
\ No newline at end of file
+var _0xc1b6=['moment','bluebird','mustache','util','path','sox','to-csv','fs-extra','lodash','crypto','jsforce','desk.js','papaparse','ioredis','../../config/license/hardware','../../config/logger','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','set','save','update','then','destroy','error','name','send','index','map','Attachment','rawAttributes','fieldName','query','keys','filters','intersection','model','attributes','fields','length','hasOwnProperty','sort','where','pick','filter','merge','type','VIRTUAL','options','count','includeAll','include','findAll','rows','catch','show','params','find','clone','get','omit','createdAt','body','create','file','originalname','filename','mimetype','download','findOne','ChatOfflineMessageId','join','server/files/attachments/','offline-chat/','basename','eml-format','zip-dir','fast-json-patch','request-promise'];(function(_0x2a6773,_0x4fc9f1){var _0x30e631=function(_0x44210f){while(--_0x44210f){_0x2a6773['push'](_0x2a6773['shift']());}};_0x30e631(++_0x4fc9f1);}(_0xc1b6,0xa8));var _0x6c1b=function(_0x212348,_0x55415c){_0x212348=_0x212348-0x0;var _0x1696e9=_0xc1b6[_0x212348];return _0x1696e9;};'use strict';var emlformat=require(_0x6c1b('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x6c1b('0x1'));var jsonpatch=require(_0x6c1b('0x2'));var rp=require(_0x6c1b('0x3'));var moment=require(_0x6c1b('0x4'));var BPromise=require(_0x6c1b('0x5'));var Mustache=require(_0x6c1b('0x6'));var util=require(_0x6c1b('0x7'));var path=require(_0x6c1b('0x8'));var sox=require(_0x6c1b('0x9'));var csv=require(_0x6c1b('0xa'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x6c1b('0xb'));var _=require(_0x6c1b('0xc'));var squel=require('squel');var crypto=require(_0x6c1b('0xd'));var jsforce=require(_0x6c1b('0xe'));var deskjs=require(_0x6c1b('0xf'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x6c1b('0x10'));var Redis=require(_0x6c1b('0x11'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x6c1b('0x12'));var logger=require(_0x6c1b('0x13'))('api');var utils=require(_0x6c1b('0x14'));var config=require('../../config/environment');var licenseUtil=require(_0x6c1b('0x15'));var db=require(_0x6c1b('0x16'))['db'];function respondWithStatusCode(_0x420113,_0x5e1ee2){_0x5e1ee2=_0x5e1ee2||0xcc;return function(_0x2c58ec){if(_0x2c58ec){return _0x420113[_0x6c1b('0x17')](_0x5e1ee2);}return _0x420113[_0x6c1b('0x18')](_0x5e1ee2)[_0x6c1b('0x19')]();};}function respondWithResult(_0x4cc53c,_0x18de3a){_0x18de3a=_0x18de3a||0xc8;return function(_0x4d567d){if(_0x4d567d){return _0x4cc53c['status'](_0x18de3a)[_0x6c1b('0x1a')](_0x4d567d);}};}function respondWithFilteredResult(_0x545208,_0x323f97){return function(_0x40f65d){if(_0x40f65d){var _0x3df97f=typeof _0x323f97[_0x6c1b('0x1b')]===_0x6c1b('0x1c')&&typeof _0x323f97['limit']==='undefined';var _0x3dd05e=_0x40f65d['count'];var _0x3d0ec0=_0x3df97f?0x0:_0x323f97[_0x6c1b('0x1b')];var _0x2ba1b5=_0x3df97f?_0x40f65d['count']:_0x323f97['offset']+_0x323f97[_0x6c1b('0x1d')];var _0x5c84db;if(_0x2ba1b5>=_0x3dd05e){_0x2ba1b5=_0x3dd05e;_0x5c84db=0xc8;}else{_0x5c84db=0xce;}_0x545208[_0x6c1b('0x18')](_0x5c84db);return _0x545208[_0x6c1b('0x1e')]('Content-Range',_0x3d0ec0+'-'+_0x2ba1b5+'/'+_0x3dd05e)[_0x6c1b('0x1a')](_0x40f65d);}return null;};}function patchUpdates(_0x32f0e5){return function(_0x28b681){try{jsonpatch['apply'](_0x28b681,_0x32f0e5,!![]);}catch(_0x556b8b){return BPromise['reject'](_0x556b8b);}return _0x28b681[_0x6c1b('0x1f')]();};}function saveUpdates(_0x3aa36c,_0x321834){return function(_0x266a74){if(_0x266a74){return _0x266a74[_0x6c1b('0x20')](_0x3aa36c)[_0x6c1b('0x21')](function(_0x5b9302){return _0x5b9302;});}return null;};}function removeEntity(_0x5cd30f,_0x2e1b5c){return function(_0x474f5f){if(_0x474f5f){return _0x474f5f[_0x6c1b('0x22')]()[_0x6c1b('0x21')](function(){_0x5cd30f['status'](0xcc)[_0x6c1b('0x19')]();});}};}function handleEntityNotFound(_0x2b67a8,_0x254092){return function(_0x762a50){if(!_0x762a50){_0x2b67a8[_0x6c1b('0x17')](0x194);}return _0x762a50;};}function handleError(_0xc4b925,_0x44eda1){_0x44eda1=_0x44eda1||0x1f4;return function(_0x346a8f){logger[_0x6c1b('0x23')](_0x346a8f['stack']);if(_0x346a8f[_0x6c1b('0x24')]){delete _0x346a8f[_0x6c1b('0x24')];}_0xc4b925[_0x6c1b('0x18')](_0x44eda1)[_0x6c1b('0x25')](_0x346a8f);};}exports[_0x6c1b('0x26')]=function(_0x1b3f5a,_0x1a1dec){var _0x1c4ee4={},_0x312dfc={},_0x47f5b3={'count':0x0,'rows':[]};var _0x4817b9=_[_0x6c1b('0x27')](db[_0x6c1b('0x28')][_0x6c1b('0x29')],function(_0x160143){return{'name':_0x160143[_0x6c1b('0x2a')],'type':_0x160143['type']['key']};});_0x312dfc['model']=_[_0x6c1b('0x27')](_0x4817b9,_0x6c1b('0x24'));_0x312dfc[_0x6c1b('0x2b')]=_[_0x6c1b('0x2c')](_0x1b3f5a[_0x6c1b('0x2b')]);_0x312dfc[_0x6c1b('0x2d')]=_[_0x6c1b('0x2e')](_0x312dfc[_0x6c1b('0x2f')],_0x312dfc[_0x6c1b('0x2b')]);_0x1c4ee4[_0x6c1b('0x30')]=_['intersection'](_0x312dfc[_0x6c1b('0x2f')],qs[_0x6c1b('0x31')](_0x1b3f5a[_0x6c1b('0x2b')]['fields']));_0x1c4ee4['attributes']=_0x1c4ee4[_0x6c1b('0x30')][_0x6c1b('0x32')]?_0x1c4ee4[_0x6c1b('0x30')]:_0x312dfc[_0x6c1b('0x2f')];if(!_0x1b3f5a[_0x6c1b('0x2b')][_0x6c1b('0x33')]('nolimit')){_0x1c4ee4['limit']=qs[_0x6c1b('0x1d')](_0x1b3f5a['query']['limit']);_0x1c4ee4['offset']=qs['offset'](_0x1b3f5a[_0x6c1b('0x2b')]['offset']);}_0x1c4ee4['order']=qs[_0x6c1b('0x34')](_0x1b3f5a['query']['sort']);_0x1c4ee4[_0x6c1b('0x35')]=qs[_0x6c1b('0x2d')](_[_0x6c1b('0x36')](_0x1b3f5a[_0x6c1b('0x2b')],_0x312dfc['filters']),_0x4817b9);if(_0x1b3f5a[_0x6c1b('0x2b')][_0x6c1b('0x37')]){_0x1c4ee4[_0x6c1b('0x35')]=_[_0x6c1b('0x38')](_0x1c4ee4[_0x6c1b('0x35')],{'$or':_[_0x6c1b('0x27')](_0x4817b9,function(_0x2e3f71){if(_0x2e3f71[_0x6c1b('0x39')]!==_0x6c1b('0x3a')){var _0x5d91dc={};_0x5d91dc[_0x2e3f71[_0x6c1b('0x24')]]={'$like':'%'+_0x1b3f5a[_0x6c1b('0x2b')]['filter']+'%'};return _0x5d91dc;}})});}_0x1c4ee4=_['merge']({},_0x1c4ee4,_0x1b3f5a[_0x6c1b('0x3b')]);var _0x34c788={'where':_0x1c4ee4['where']};return db[_0x6c1b('0x28')][_0x6c1b('0x3c')](_0x34c788)[_0x6c1b('0x21')](function(_0x547c69){_0x47f5b3['count']=_0x547c69;if(_0x1b3f5a[_0x6c1b('0x2b')][_0x6c1b('0x3d')]){_0x1c4ee4[_0x6c1b('0x3e')]=[{'all':!![]}];}return db[_0x6c1b('0x28')][_0x6c1b('0x3f')](_0x1c4ee4);})[_0x6c1b('0x21')](function(_0x46ab5a){_0x47f5b3[_0x6c1b('0x40')]=_0x46ab5a;return _0x47f5b3;})[_0x6c1b('0x21')](respondWithFilteredResult(_0x1a1dec,_0x1c4ee4))[_0x6c1b('0x41')](handleError(_0x1a1dec,null));};exports[_0x6c1b('0x42')]=function(_0x18a866,_0x58e04c){var _0x42fef0={'raw':!![],'where':{'id':_0x18a866[_0x6c1b('0x43')]['id']}},_0x3c83db={};_0x3c83db[_0x6c1b('0x2f')]=_['keys'](db[_0x6c1b('0x28')][_0x6c1b('0x29')]);_0x3c83db['query']=_[_0x6c1b('0x2c')](_0x18a866[_0x6c1b('0x2b')]);_0x3c83db[_0x6c1b('0x2d')]=_[_0x6c1b('0x2e')](_0x3c83db['model'],_0x3c83db[_0x6c1b('0x2b')]);_0x42fef0['attributes']=_[_0x6c1b('0x2e')](_0x3c83db[_0x6c1b('0x2f')],qs[_0x6c1b('0x31')](_0x18a866[_0x6c1b('0x2b')][_0x6c1b('0x31')]));_0x42fef0[_0x6c1b('0x30')]=_0x42fef0[_0x6c1b('0x30')]['length']?_0x42fef0['attributes']:_0x3c83db[_0x6c1b('0x2f')];if(_0x18a866[_0x6c1b('0x2b')][_0x6c1b('0x3d')]){_0x42fef0[_0x6c1b('0x3e')]=[{'all':!![]}];}_0x42fef0=_[_0x6c1b('0x38')]({},_0x42fef0,_0x18a866[_0x6c1b('0x3b')]);return db[_0x6c1b('0x28')][_0x6c1b('0x44')](_0x42fef0)[_0x6c1b('0x21')](handleEntityNotFound(_0x58e04c,null))[_0x6c1b('0x21')](respondWithResult(_0x58e04c,null))['catch'](handleError(_0x58e04c,null));};exports[_0x6c1b('0x45')]=function(_0x263eca,_0x2fdb41){var _0x2a9922={'where':{'id':_0x263eca['params']['id']}},_0x5cff86={};_0x5cff86[_0x6c1b('0x2f')]=_[_0x6c1b('0x2c')](db[_0x6c1b('0x28')][_0x6c1b('0x29')]);_0x2a9922['attributes']=_[_0x6c1b('0x2e')](_0x5cff86[_0x6c1b('0x2f')],qs['fields'](_0x263eca[_0x6c1b('0x2b')]['fields']));_0x2a9922[_0x6c1b('0x30')]=_0x2a9922[_0x6c1b('0x30')][_0x6c1b('0x32')]?_0x2a9922[_0x6c1b('0x30')]:_0x5cff86[_0x6c1b('0x2f')];if(_0x263eca[_0x6c1b('0x2b')][_0x6c1b('0x3d')]){_0x2a9922[_0x6c1b('0x3e')]=[{'all':!![]}];}_0x2a9922=_[_0x6c1b('0x38')]({},_0x2a9922,_0x263eca[_0x6c1b('0x3b')]);return db[_0x6c1b('0x28')][_0x6c1b('0x44')](_0x2a9922)['then'](handleEntityNotFound(_0x2fdb41,null))[_0x6c1b('0x21')](function(_0x26af5a){if(_0x26af5a){var _0x3d6647=_0x26af5a[_0x6c1b('0x46')]({'plain':!![]});_0x3d6647=qs[_0x6c1b('0x47')](_0x3d6647,['id',_0x6c1b('0x48'),'updatedAt']);_0x263eca['body']=_[_0x6c1b('0x47')](_0x263eca[_0x6c1b('0x49')],['id',_0x6c1b('0x48'),'updatedAt']);return db['Attachment']['create'](_[_0x6c1b('0x38')](_0x3d6647,_0x263eca[_0x6c1b('0x49')]),{'include':_0x263eca[_0x6c1b('0x2b')][_0x6c1b('0x3d')]?[{'all':!![]}]:undefined});}})[_0x6c1b('0x21')](respondWithResult(_0x2fdb41,0xc9))[_0x6c1b('0x41')](handleError(_0x2fdb41,null));};exports['update']=function(_0x119dec,_0x2376ba){if(_0x119dec[_0x6c1b('0x49')]['id']){delete _0x119dec['body']['id'];}return db[_0x6c1b('0x28')][_0x6c1b('0x44')]({'where':{'id':_0x119dec[_0x6c1b('0x43')]['id']}})[_0x6c1b('0x21')](handleEntityNotFound(_0x2376ba,null))['then'](saveUpdates(_0x119dec[_0x6c1b('0x49')],null))['then'](respondWithResult(_0x2376ba,null))[_0x6c1b('0x41')](handleError(_0x2376ba,null));};exports[_0x6c1b('0x22')]=function(_0x978d9a,_0xdf7702){return db[_0x6c1b('0x28')][_0x6c1b('0x44')]({'where':{'id':_0x978d9a[_0x6c1b('0x43')]['id']}})[_0x6c1b('0x21')](handleEntityNotFound(_0xdf7702,null))[_0x6c1b('0x21')](removeEntity(_0xdf7702,null))[_0x6c1b('0x41')](handleError(_0xdf7702,null));};exports[_0x6c1b('0x4a')]=function(_0xce3760,_0x4c4841,_0x2da76b){_0xce3760[_0x6c1b('0x49')][_0x6c1b('0x24')]=_0xce3760[_0x6c1b('0x4b')][_0x6c1b('0x4c')];_0xce3760[_0x6c1b('0x49')]['basename']=_0xce3760[_0x6c1b('0x4b')][_0x6c1b('0x4d')];_0xce3760['body'][_0x6c1b('0x39')]=_0xce3760[_0x6c1b('0x4b')][_0x6c1b('0x4e')];return db[_0x6c1b('0x28')][_0x6c1b('0x4a')](_0xce3760[_0x6c1b('0x49')])[_0x6c1b('0x21')](respondWithResult(_0x4c4841,0xc9))[_0x6c1b('0x41')](handleError(_0x4c4841,null));};exports[_0x6c1b('0x4f')]=function(_0x318588,_0xf64ac6,_0x52f35d){return db[_0x6c1b('0x28')][_0x6c1b('0x50')]({'where':{'id':_0x318588[_0x6c1b('0x43')]['id']},'raw':!![]})['then'](handleEntityNotFound(_0xf64ac6,null))[_0x6c1b('0x21')](function(_0x4c3a07){if(_0x4c3a07){var _0x34ba4e=_0x4c3a07[_0x6c1b('0x51')]!==null;var _0x4a33dc=path[_0x6c1b('0x52')](config['root'],_0x6c1b('0x53'));if(_0x34ba4e){_0x4a33dc=path[_0x6c1b('0x52')](_0x4a33dc,_0x6c1b('0x54'));}var _0x1f970b=path[_0x6c1b('0x52')](_0x4a33dc,_0x4c3a07[_0x6c1b('0x55')]);return _0xf64ac6[_0x6c1b('0x4f')](_0x1f970b);}})[_0x6c1b('0x41')](handleError(_0xf64ac6,null));};
\ No newline at end of file
diff --git a/server/api/attachment/attachment.model.js b/server/api/attachment/attachment.model.js
index af727d2..b3c26fb 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 _0xa686=['../../config/logger','moment','bluebird','request-promise','rimraf','./attachment.attributes','define','attachments','lodash','util'];(function(_0x4370cc,_0xa2d157){var _0x3214c7=function(_0x29e0e9){while(--_0x29e0e9){_0x4370cc['push'](_0x4370cc['shift']());}};_0x3214c7(++_0xa2d157);}(_0xa686,0xc6));var _0x6a68=function(_0x46a003,_0x56cb62){_0x46a003=_0x46a003-0x0;var _0x4d0baf=_0xa686[_0x46a003];return _0x4d0baf;};'use strict';var _=require(_0x6a68('0x0'));var util=require(_0x6a68('0x1'));var logger=require(_0x6a68('0x2'))('api');var moment=require(_0x6a68('0x3'));var BPromise=require(_0x6a68('0x4'));var rp=require(_0x6a68('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x6a68('0x6'));var config=require('../../config/environment');var attributes=require(_0x6a68('0x7'));module['exports']=function(_0x5cb288,_0x52f474){return _0x5cb288[_0x6a68('0x8')]('Attachment',attributes,{'tableName':_0x6a68('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x3f02=['request-promise','path','../../config/environment','exports','define','Attachment','attachments','util','../../config/logger','api','bluebird'];(function(_0x4d77a4,_0x3be85a){var _0x15a00e=function(_0x3dc23b){while(--_0x3dc23b){_0x4d77a4['push'](_0x4d77a4['shift']());}};_0x15a00e(++_0x3be85a);}(_0x3f02,0xee));var _0x23f0=function(_0x3f6b1b,_0x58d3d6){_0x3f6b1b=_0x3f6b1b-0x0;var _0x4a3d2b=_0x3f02[_0x3f6b1b];return _0x4a3d2b;};'use strict';var _=require('lodash');var util=require(_0x23f0('0x0'));var logger=require(_0x23f0('0x1'))(_0x23f0('0x2'));var moment=require('moment');var BPromise=require(_0x23f0('0x3'));var rp=require(_0x23f0('0x4'));var fs=require('fs');var path=require(_0x23f0('0x5'));var rimraf=require('rimraf');var config=require(_0x23f0('0x6'));var attributes=require('./attachment.attributes');module[_0x23f0('0x7')]=function(_0x6e2c0,_0x5e9449){return _0x6e2c0[_0x23f0('0x8')](_0x23f0('0x9'),attributes,{'tableName':_0x23f0('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
diff --git a/server/api/attachment/attachment.rpc.js b/server/api/attachment/attachment.rpc.js
index c8d5212..6a4082c 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 _0xf194=['info','Attachment,\x20%s,\x20%s','request\x20sent','debug','Attachment,\x20%s,\x20%s,\x20%s','code','error','message','result','CreateAttachment','Attachment','create','options','stringify','catch','lodash','util','moment','bluebird','ioredis','rpc','../../config/environment','jayson/promise','http','request','then'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0xf194,0x91));var _0x4f19=function(_0x41b6db,_0x3c962b){_0x41b6db=_0x41b6db-0x0;var _0x4d29dc=_0xf194[_0x41b6db];return _0x4d29dc;};'use strict';var _=require(_0x4f19('0x0'));var util=require(_0x4f19('0x1'));var moment=require(_0x4f19('0x2'));var BPromise=require(_0x4f19('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x4f19('0x4'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x4f19('0x5'));var config=require(_0x4f19('0x6'));var jayson=require(_0x4f19('0x7'));var client=jayson['client'][_0x4f19('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x45c88a,_0x514d93,_0x4b023f){return new BPromise(function(_0x265d15,_0x116780){return client[_0x4f19('0x9')](_0x45c88a,_0x4b023f)[_0x4f19('0xa')](function(_0x4aaf89){logger[_0x4f19('0xb')](_0x4f19('0xc'),_0x514d93,_0x4f19('0xd'));logger[_0x4f19('0xe')](_0x4f19('0xf'),_0x514d93,_0x4f19('0xd'),JSON['stringify'](_0x4aaf89));if(_0x4aaf89['error']){if(_0x4aaf89['error'][_0x4f19('0x10')]===0x1f4){logger[_0x4f19('0x11')]('Attachment,\x20%s,\x20%s',_0x514d93,_0x4aaf89[_0x4f19('0x11')][_0x4f19('0x12')]);return _0x116780(_0x4aaf89[_0x4f19('0x11')][_0x4f19('0x12')]);}logger['error'](_0x4f19('0xc'),_0x514d93,_0x4aaf89[_0x4f19('0x11')]['message']);return _0x265d15(_0x4aaf89[_0x4f19('0x11')][_0x4f19('0x12')]);}else{logger['info'](_0x4f19('0xc'),_0x514d93,'request\x20sent');_0x265d15(_0x4aaf89[_0x4f19('0x13')][_0x4f19('0x12')]);}})['catch'](function(_0x4d8021){logger[_0x4f19('0x11')](_0x4f19('0xc'),_0x514d93,_0x4d8021);_0x116780(_0x4d8021);});});}exports[_0x4f19('0x14')]=function(_0x576eef){var _0x1d9bf3=this;return new Promise(function(_0x205fee,_0x1b4d79){return db[_0x4f19('0x15')][_0x4f19('0x16')](_0x576eef['body'],{'raw':_0x576eef[_0x4f19('0x17')]?_0x576eef[_0x4f19('0x17')]['raw']===undefined?!![]:![]:!![]})[_0x4f19('0xa')](function(_0x14ff93){logger[_0x4f19('0xb')](_0x4f19('0x14'),_0x576eef);logger['debug'](_0x4f19('0x14'),_0x576eef,JSON[_0x4f19('0x18')](_0x14ff93));_0x205fee(_0x14ff93);})[_0x4f19('0x19')](function(_0xcbe002){logger[_0x4f19('0x11')](_0x4f19('0x14'),_0xcbe002[_0x4f19('0x12')],_0x576eef);_0x1b4d79(_0x1d9bf3[_0x4f19('0x11')](0x1f4,_0xcbe002[_0x4f19('0x12')]));});});};
\ No newline at end of file
+var _0xad95=['ioredis','../../mysqldb','rpc','then','Attachment,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','info','result','catch','CreateAttachment','Attachment','create','body','options','raw','lodash','util','moment'];(function(_0x126558,_0x143c9a){var _0x1f6d14=function(_0x2b0eea){while(--_0x2b0eea){_0x126558['push'](_0x126558['shift']());}};_0x1f6d14(++_0x143c9a);}(_0xad95,0x70));var _0x5ad9=function(_0x313477,_0x2c636c){_0x313477=_0x313477-0x0;var _0x2902a0=_0xad95[_0x313477];return _0x2902a0;};'use strict';var _=require(_0x5ad9('0x0'));var util=require(_0x5ad9('0x1'));var moment=require(_0x5ad9('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x5ad9('0x3'));var db=require(_0x5ad9('0x4'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x5ad9('0x5'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x2bef4e,_0x117fde,_0x2a0915){return new BPromise(function(_0x3d937a,_0x404b33){return client['request'](_0x2bef4e,_0x2a0915)[_0x5ad9('0x6')](function(_0x4fdb7b){logger['info'](_0x5ad9('0x7'),_0x117fde,_0x5ad9('0x8'));logger[_0x5ad9('0x9')]('Attachment,\x20%s,\x20%s,\x20%s',_0x117fde,_0x5ad9('0x8'),JSON[_0x5ad9('0xa')](_0x4fdb7b));if(_0x4fdb7b['error']){if(_0x4fdb7b[_0x5ad9('0xb')][_0x5ad9('0xc')]===0x1f4){logger[_0x5ad9('0xb')](_0x5ad9('0x7'),_0x117fde,_0x4fdb7b[_0x5ad9('0xb')][_0x5ad9('0xd')]);return _0x404b33(_0x4fdb7b['error']['message']);}logger['error'](_0x5ad9('0x7'),_0x117fde,_0x4fdb7b[_0x5ad9('0xb')]['message']);return _0x3d937a(_0x4fdb7b[_0x5ad9('0xb')][_0x5ad9('0xd')]);}else{logger[_0x5ad9('0xe')](_0x5ad9('0x7'),_0x117fde,_0x5ad9('0x8'));_0x3d937a(_0x4fdb7b[_0x5ad9('0xf')][_0x5ad9('0xd')]);}})[_0x5ad9('0x10')](function(_0x36e61f){logger[_0x5ad9('0xb')]('Attachment,\x20%s,\x20%s',_0x117fde,_0x36e61f);_0x404b33(_0x36e61f);});});}exports[_0x5ad9('0x11')]=function(_0x54f392){var _0x3d1c8f=this;return new Promise(function(_0x28682f,_0xe4171b){return db[_0x5ad9('0x12')][_0x5ad9('0x13')](_0x54f392[_0x5ad9('0x14')],{'raw':_0x54f392[_0x5ad9('0x15')]?_0x54f392['options'][_0x5ad9('0x16')]===undefined?!![]:![]:!![]})['then'](function(_0x49363b){logger[_0x5ad9('0xe')]('CreateAttachment',_0x54f392);logger[_0x5ad9('0x9')](_0x5ad9('0x11'),_0x54f392,JSON[_0x5ad9('0xa')](_0x49363b));_0x28682f(_0x49363b);})[_0x5ad9('0x10')](function(_0x1274f7){logger['error'](_0x5ad9('0x11'),_0x1274f7['message'],_0x54f392);_0xe4171b(_0x3d1c8f[_0x5ad9('0xb')](0x1f4,_0x1274f7['message']));});});};
\ No newline at end of file
diff --git a/server/api/attachment/index.js b/server/api/attachment/index.js
index 0cfb9ef..87d2f5a 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(_0x3c7b15,_0x4eeab6){var _0x40044c=function(_0x4283b3){while(--_0x4283b3){_0x3c7b15['push'](_0x3c7b15['shift']());}};_0x40044c(++_0x4eeab6);}(_0xb10b,0x12a));var _0xbb10=function(_0x12d93a,_0x460b08){_0x12d93a=_0x12d93a-0x0;var _0x5e0913=_0xb10b[_0x12d93a];return _0x5e0913;};'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 _0xdb28=['path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','/:id','show','/:id/download','download','/:id/clone','clone','join','root','server/files/attachments/','%s-%s','now','originalname','replace','post','single','file','create','put','update','delete','destroy','exports','multer','util'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xdb28,0x106));var _0x8db2=function(_0x227b10,_0x4658fd){_0x227b10=_0x227b10-0x0;var _0x2fe070=_0xdb28[_0x227b10];return _0x2fe070;};'use strict';var multer=require(_0x8db2('0x0'));var util=require(_0x8db2('0x1'));var path=require(_0x8db2('0x2'));var timeout=require(_0x8db2('0x3'));var express=require('express');var router=express[_0x8db2('0x4')]();var fs_extra=require(_0x8db2('0x5'));var auth=require(_0x8db2('0x6'));var interaction=require(_0x8db2('0x7'));var config=require(_0x8db2('0x8'));var controller=require('./attachment.controller');router[_0x8db2('0x9')]('/',auth[_0x8db2('0xa')](),controller['index']);router['get'](_0x8db2('0xb'),auth[_0x8db2('0xa')](),controller[_0x8db2('0xc')]);router[_0x8db2('0x9')](_0x8db2('0xd'),auth[_0x8db2('0xa')](),controller[_0x8db2('0xe')]);router['post'](_0x8db2('0xf'),auth[_0x8db2('0xa')](),controller[_0x8db2('0x10')]);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x1d9371,_0x150942,_0x576475){_0x576475(null,path[_0x8db2('0x11')](config[_0x8db2('0x12')],_0x8db2('0x13')));},'filename':function(_0x204f49,_0x37d017,_0x559fb1){_0x559fb1(null,util['format'](_0x8db2('0x14'),Date[_0x8db2('0x15')](),_0x37d017[_0x8db2('0x16')][_0x8db2('0x17')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-')));}})});router[_0x8db2('0x18')]('/',upload[_0x8db2('0x19')](_0x8db2('0x1a')),controller[_0x8db2('0x1b')]);router[_0x8db2('0x1c')](_0x8db2('0xb'),auth['isAuthenticated'](),controller[_0x8db2('0x1d')]);router[_0x8db2('0x1e')]('/:id',auth[_0x8db2('0xa')](),controller[_0x8db2('0x1f')]);module[_0x8db2('0x20')]=router;
\ No newline at end of file
diff --git a/server/api/authGoogle/authGoogle.controller.js b/server/api/authGoogle/authGoogle.controller.js
index b2d7e2e..6262107 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 _0xa932=['allowedLoginAttempts','blockDuration','User','find','map','emails','admin','user','agent','then','Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.','blocked','blockedAt','minutes','getLicense','catch','lodash','passport','passport-google-oauth20','Strategy','moment','../../mysqldb','../../config/environment','../../components/auth/service','signToken','login','google','profile','callback','authenticate','/login','clientID','clientSecret','callbackURL','Setting'];(function(_0x52ed18,_0x722adb){var _0x5d0a9e=function(_0x464a){while(--_0x464a){_0x52ed18['push'](_0x52ed18['shift']());}};_0x5d0a9e(++_0x722adb);}(_0xa932,0x1d7));var _0x2a93=function(_0x1e028c,_0x2bd5b0){_0x1e028c=_0x1e028c-0x0;var _0x336831=_0xa932[_0x1e028c];return _0x336831;};'use strict';var _=require(_0x2a93('0x0'));var passport=require(_0x2a93('0x1'));var GoogleStrategy=require(_0x2a93('0x2'))[_0x2a93('0x3')];var moment=require(_0x2a93('0x4'));var db=require(_0x2a93('0x5'))['db'];var config=require(_0x2a93('0x6'));var signToken=require(_0x2a93('0x7'))[_0x2a93('0x8')];var utils=require('../../config/utils');exports[_0x2a93('0x9')]=passport['authenticate'](_0x2a93('0xa'),{'failureRedirect':'/login','scope':[_0x2a93('0xb'),'email'],'session':![]});exports[_0x2a93('0xc')]=passport[_0x2a93('0xd')](_0x2a93('0xa'),{'failureRedirect':_0x2a93('0xe'),'session':![]});passport['use'](new GoogleStrategy({'clientID':config[_0x2a93('0xa')]?config['google'][_0x2a93('0xf')]:'id','clientSecret':config[_0x2a93('0xa')]?config[_0x2a93('0xa')][_0x2a93('0x10')]:'secret','callbackURL':config[_0x2a93('0xa')]?config['google'][_0x2a93('0x11')]:''},function(_0x40f930,_0x11e422,_0x14004f,_0x26c26d){var _0x4d1f97,_0x2f6abb;return db[_0x2a93('0x12')]['findOne']({'where':{'id':0x1},'attributes':[_0x2a93('0x13'),_0x2a93('0x14')],'raw':!![]})['then'](function(_0x139af1){_0x4d1f97=_0x139af1;return db[_0x2a93('0x15')][_0x2a93('0x16')]({'where':{'email':_[_0x2a93('0x17')](_0x14004f[_0x2a93('0x18')],'value'),'role':{'$or':[_0x2a93('0x19'),_0x2a93('0x1a'),_0x2a93('0x1b')]}}});})[_0x2a93('0x1c')](function(_0x4355ec){_0x2f6abb=_0x4355ec;if(_0x2f6abb){if(_0x2f6abb['disabled']){return _0x26c26d(_0x2a93('0x1d'));}else if(_0x4d1f97[_0x2a93('0x14')]>0x0){if(_0x2f6abb[_0x2a93('0x1e')]){if(moment(_0x2f6abb[_0x2a93('0x1f')])['add'](_0x4d1f97[_0x2a93('0x14')],_0x2a93('0x20'))>moment()){return _0x26c26d(_0x2a93('0x1d'));}else{return utils['clearBlockUser'](_0x2f6abb,0x0,![],null)[_0x2a93('0x1c')](function(){return utils[_0x2a93('0x21')](_0x2f6abb);})[_0x2a93('0x1c')](function(){return _0x26c26d(null,_0x2f6abb);});}}else{return utils['getLicense'](_0x2f6abb)[_0x2a93('0x1c')](function(){return _0x26c26d(null,_0x2f6abb);});}}else{return utils[_0x2a93('0x21')](_0x2f6abb)[_0x2a93('0x1c')](function(){return _0x26c26d(null,_0x2f6abb);});}}return _0x26c26d(_0x2a93('0x1d'));})[_0x2a93('0x22')](function(_0x2b958d){_0x26c26d(_0x2b958d);});}));
\ No newline at end of file
+var _0xd328=['getLicense','catch','lodash','passport','passport-google-oauth20','moment','../../config/environment','../../components/auth/service','../../config/utils','login','authenticate','google','/login','profile','email','use','clientSecret','secret','callbackURL','Setting','allowedLoginAttempts','blockDuration','then','User','find','emails','admin','user','agent','disabled','blockedAt','add','minutes','Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.','clearBlockUser'];(function(_0x25f9ac,_0x3c3cff){var _0x352783=function(_0x1cdda9){while(--_0x1cdda9){_0x25f9ac['push'](_0x25f9ac['shift']());}};_0x352783(++_0x3c3cff);}(_0xd328,0x13d));var _0x8d32=function(_0x1f3193,_0x49da07){_0x1f3193=_0x1f3193-0x0;var _0x27b09e=_0xd328[_0x1f3193];return _0x27b09e;};'use strict';var _=require(_0x8d32('0x0'));var passport=require(_0x8d32('0x1'));var GoogleStrategy=require(_0x8d32('0x2'))['Strategy'];var moment=require(_0x8d32('0x3'));var db=require('../../mysqldb')['db'];var config=require(_0x8d32('0x4'));var signToken=require(_0x8d32('0x5'))['signToken'];var utils=require(_0x8d32('0x6'));exports[_0x8d32('0x7')]=passport[_0x8d32('0x8')](_0x8d32('0x9'),{'failureRedirect':_0x8d32('0xa'),'scope':[_0x8d32('0xb'),_0x8d32('0xc')],'session':![]});exports['callback']=passport[_0x8d32('0x8')](_0x8d32('0x9'),{'failureRedirect':_0x8d32('0xa'),'session':![]});passport[_0x8d32('0xd')](new GoogleStrategy({'clientID':config[_0x8d32('0x9')]?config[_0x8d32('0x9')]['clientID']:'id','clientSecret':config[_0x8d32('0x9')]?config[_0x8d32('0x9')][_0x8d32('0xe')]:_0x8d32('0xf'),'callbackURL':config['google']?config[_0x8d32('0x9')][_0x8d32('0x10')]:''},function(_0x40bc2a,_0x488502,_0x1727db,_0x5d641e){var _0x2b1c6e,_0xb542b2;return db[_0x8d32('0x11')]['findOne']({'where':{'id':0x1},'attributes':[_0x8d32('0x12'),_0x8d32('0x13')],'raw':!![]})[_0x8d32('0x14')](function(_0x15afa7){_0x2b1c6e=_0x15afa7;return db[_0x8d32('0x15')][_0x8d32('0x16')]({'where':{'email':_['map'](_0x1727db[_0x8d32('0x17')],'value'),'role':{'$or':[_0x8d32('0x18'),_0x8d32('0x19'),_0x8d32('0x1a')]}}});})[_0x8d32('0x14')](function(_0x161c0a){_0xb542b2=_0x161c0a;if(_0xb542b2){if(_0xb542b2[_0x8d32('0x1b')]){return _0x5d641e('Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.');}else if(_0x2b1c6e['blockDuration']>0x0){if(_0xb542b2['blocked']){if(moment(_0xb542b2[_0x8d32('0x1c')])[_0x8d32('0x1d')](_0x2b1c6e[_0x8d32('0x13')],_0x8d32('0x1e'))>moment()){return _0x5d641e(_0x8d32('0x1f'));}else{return utils[_0x8d32('0x20')](_0xb542b2,0x0,![],null)['then'](function(){return utils[_0x8d32('0x21')](_0xb542b2);})['then'](function(){return _0x5d641e(null,_0xb542b2);});}}else{return utils[_0x8d32('0x21')](_0xb542b2)['then'](function(){return _0x5d641e(null,_0xb542b2);});}}else{return utils[_0x8d32('0x21')](_0xb542b2)[_0x8d32('0x14')](function(){return _0x5d641e(null,_0xb542b2);});}}return _0x5d641e(_0x8d32('0x1f'));})[_0x8d32('0x22')](function(_0x78a403){_0x5d641e(_0x78a403);});}));
\ No newline at end of file
diff --git a/server/api/authGoogle/index.js b/server/api/authGoogle/index.js
index dd2ac78..9b8c286 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 _0x7288=['isMiddleware','login','setTokenCookie','exports','express','passport','Router','./authGoogle.controller','../user/user.controller.js','get'];(function(_0x17421a,_0x138b91){var _0x3d4c2a=function(_0x2b4a8b){while(--_0x2b4a8b){_0x17421a['push'](_0x17421a['shift']());}};_0x3d4c2a(++_0x138b91);}(_0x7288,0x144));var _0x8728=function(_0x117795,_0x49281c){_0x117795=_0x117795-0x0;var _0x306edf=_0x7288[_0x117795];return _0x306edf;};'use strict';var express=require(_0x8728('0x0'));var passport=require(_0x8728('0x1'));var router=express[_0x8728('0x2')]();var controller=require(_0x8728('0x3'));var userController=require(_0x8728('0x4'));var authService=require('../../components/auth/service');router[_0x8728('0x5')]('/',controller['login']);router[_0x8728('0x5')]('/callback',controller['callback'],authService[_0x8728('0x6')],userController[_0x8728('0x7')],authService[_0x8728('0x8')]);module[_0x8728('0x9')]=router;
\ No newline at end of file
+var _0xd9c7=['callback','isMiddleware','login','setTokenCookie','express','passport','Router','../user/user.controller.js','get','/callback'];(function(_0x441f9b,_0x207036){var _0x6d55b9=function(_0xc7f8ed){while(--_0xc7f8ed){_0x441f9b['push'](_0x441f9b['shift']());}};_0x6d55b9(++_0x207036);}(_0xd9c7,0x72));var _0x7d9c=function(_0x12feb4,_0x2f63bb){_0x12feb4=_0x12feb4-0x0;var _0x15f37b=_0xd9c7[_0x12feb4];return _0x15f37b;};'use strict';var express=require(_0x7d9c('0x0'));var passport=require(_0x7d9c('0x1'));var router=express[_0x7d9c('0x2')]();var controller=require('./authGoogle.controller');var userController=require(_0x7d9c('0x3'));var authService=require('../../components/auth/service');router[_0x7d9c('0x4')]('/',controller['login']);router[_0x7d9c('0x4')](_0x7d9c('0x5'),controller[_0x7d9c('0x6')],authService[_0x7d9c('0x7')],userController[_0x7d9c('0x8')],authService[_0x7d9c('0x9')]);module['exports']=router;
\ No newline at end of file
diff --git a/server/api/authLocal/authLocal.controller.js b/server/api/authLocal/authLocal.controller.js
index 71f366f..edd43fc 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 _0x1535=['moment','../../mysqldb','../../config/utils','http','findOne','allowedLoginAttempts','blockDuration','then','name','password','salt','role','blocked','loginAttempts','admin','user','Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.','authenticate','blockedAt','add','clearBlockUser','disabled','minutes','getLicense','catch','find','email','Smtp','service','host','port','secure','authentication','auth','format','\x22%s\x22\x20<%s>','request','SendMail','error','message','stringify','status','send','login','local','Something\x20went\x20wrong,\x20please\x20try\x20again.','json','online','Email\x20parameter\x20is\x20missing','generate','body','trim','toLowerCase','Setting','User','The\x20user\x20is\x20disabled.\x20Please\x20contact\x20the\x20administrator.','The\x20user\x20is\x20blocked.\x20Please\x20contact\x20the\x20administrator.','resetPasswordToken','resetPasswordExpires','now','save','xCally\x20Motion\x20Password\x20Reset','Please\x20click\x20on\x20the\x20following\x20link,\x20or\x20paste\x20this\x20into\x20your\x20browser\x20to\x20complete\x20the\x20process:\x0a\x0a','headers','reset','params','token','Password\x20reset\x20token\x20is\x20invalid\x20or\x20has\x20expired.','securePassword','passwordHistoryLimit','validatePasswordPattern','previousPasswords','validatePasswordHistory','Password\x20reset!','use','util','passport','passport-local','Strategy','jayson/promise','lodash','randomstring'];(function(_0x1e9cda,_0x3b3ffc){var _0x238e6a=function(_0x3979e4){while(--_0x3979e4){_0x1e9cda['push'](_0x1e9cda['shift']());}};_0x238e6a(++_0x3b3ffc);}(_0x1535,0x9d));var _0x5153=function(_0xb81c46,_0x4845e1){_0xb81c46=_0xb81c46-0x0;var _0x39c47d=_0x1535[_0xb81c46];return _0x39c47d;};'use strict';var util=require(_0x5153('0x0'));var passport=require(_0x5153('0x1'));var LocalStrategy=require(_0x5153('0x2'))[_0x5153('0x3')];var jayson=require(_0x5153('0x4'));var _=require(_0x5153('0x5'));var rs=require(_0x5153('0x6'));var moment=require(_0x5153('0x7'));var db=require(_0x5153('0x8'))['db'];var authService=require('../../components/auth/service');var utils=require(_0x5153('0x9'));var client=jayson['client'][_0x5153('0xa')]({'port':0x232b});function localAuthenticate(_0x91007a,_0x109af7,_0x1ca57e,_0x3b3288){var _0x25b803,_0x1e1ec7;return db['Setting'][_0x5153('0xb')]({'where':{'id':0x1},'attributes':[_0x5153('0xc'),_0x5153('0xd')],'raw':!![]})[_0x5153('0xe')](function(_0x5152f8){_0x25b803=_0x5152f8;return _0x91007a[_0x5153('0xb')]({'attributes':['id',_0x5153('0xf'),_0x5153('0x10'),_0x5153('0x11'),_0x5153('0x12'),'disabled',_0x5153('0x13'),'blockedAt',_0x5153('0x14')],'where':{'name':_0x109af7,'role':{'$or':[_0x5153('0x15'),_0x5153('0x16'),'agent']}}});})[_0x5153('0xe')](function(_0x10550b){if(!_0x10550b||_0x10550b&&_0x10550b['name']!==_0x109af7){throw new Error(_0x5153('0x17'));}else{_0x1e1ec7=_0x10550b;return _0x1e1ec7;}})['then'](function(){_0x1e1ec7[_0x5153('0x18')](_0x1ca57e,function(_0x2a1cdd,_0x2e3993){var _0x5f3b97=_0x1e1ec7[_0x5153('0x14')]+0x1;if(_0x2a1cdd){return _0x3b3288(_0x2a1cdd);}else if(!_0x2e3993){if(_0x1e1ec7['disabled']){return _0x3b3288(null,![],{'message':_0x5153('0x17')});}else if(_0x25b803['allowedLoginAttempts']>0x0){if(_0x1e1ec7[_0x5153('0x13')]){if(_0x25b803[_0x5153('0xd')]>0x0){if(moment(_0x1e1ec7[_0x5153('0x19')])[_0x5153('0x1a')](_0x25b803[_0x5153('0xd')],'minutes')>moment()){return _0x3b3288(null,![],{'message':_0x5153('0x17')});}else{return utils[_0x5153('0x1b')](_0x1e1ec7,_0x5f3b97,![],null)[_0x5153('0xe')](function(){return _0x3b3288(null,![],{'message':_0x5153('0x17')});});}}else{return _0x3b3288(null,![],{'message':_0x5153('0x17')});}}else{if(_0x5f3b97>=_0x25b803[_0x5153('0xc')]){return utils[_0x5153('0x1b')](_0x1e1ec7,0x0,!![],moment())['then'](function(){return _0x3b3288(null,![],{'message':_0x5153('0x17')});});}else{return utils[_0x5153('0x1b')](_0x1e1ec7,_0x5f3b97,![],null)[_0x5153('0xe')](function(){return _0x3b3288(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});});}}}else{return _0x3b3288(null,![],{'message':_0x5153('0x17')});}}else{if(_0x1e1ec7[_0x5153('0x1c')]){return _0x3b3288(null,![],{'message':_0x5153('0x17')});}else if(_0x25b803[_0x5153('0xc')]>0x0){if(_0x1e1ec7[_0x5153('0x13')]){if(_0x25b803[_0x5153('0xd')]>0x0){if(moment(_0x1e1ec7[_0x5153('0x19')])[_0x5153('0x1a')](_0x25b803['blockDuration'],_0x5153('0x1d'))>moment()){return _0x3b3288(null,![],{'message':_0x5153('0x17')});}else{return utils[_0x5153('0x1b')](_0x1e1ec7,0x0,![],null)['then'](function(){return utils['getLicense'](_0x1e1ec7);})[_0x5153('0xe')](function(){return _0x3b3288(null,_0x1e1ec7);});}}else{return _0x3b3288(null,![],{'message':_0x5153('0x17')});}}else{return utils['clearBlockUser'](_0x1e1ec7,0x0,![],null)[_0x5153('0xe')](function(){return utils[_0x5153('0x1e')](_0x1e1ec7);})[_0x5153('0xe')](function(){return _0x3b3288(null,_0x1e1ec7);})['catch'](function(_0x38f8a2){return _0x3b3288(null,![],_0x38f8a2);});}}else{if(_0x1e1ec7['blocked']){return _0x3b3288(null,![],{'message':_0x5153('0x17')});}else{return utils[_0x5153('0x1e')](_0x1e1ec7)['then'](function(){return _0x3b3288(null,_0x1e1ec7);});}}}});})[_0x5153('0x1f')](function(_0x58899d){return _0x3b3288(null,![],_0x58899d);});}function sendServiceMail(_0x1977b4){return db['MailAccount'][_0x5153('0x20')]({'where':{'service':!![]},'attributes':['id',_0x5153('0xf'),_0x5153('0x21')],'include':[{'model':db['MailServerOut'],'as':_0x5153('0x22')}]})[_0x5153('0xe')](function(_0x3ffa33){if(!_0x3ffa33){throw new Error('Unable\x20to\x20find\x20a\x20configured\x20SMTP\x20service!');}var _0x742ea4={'tls':{'rejectUnauthorized':![]}};if(_0x3ffa33[_0x5153('0x22')]['service']){_0x742ea4['service']=_0x3ffa33[_0x5153('0x22')][_0x5153('0x23')];}else{_0x742ea4[_0x5153('0x24')]=_0x3ffa33[_0x5153('0x22')][_0x5153('0x24')];_0x742ea4[_0x5153('0x25')]=_0x3ffa33[_0x5153('0x22')][_0x5153('0x25')];_0x742ea4[_0x5153('0x26')]=_0x3ffa33[_0x5153('0x22')]['secure'];}if(_0x3ffa33[_0x5153('0x22')][_0x5153('0x27')]){_0x742ea4[_0x5153('0x28')]={'user':_0x3ffa33[_0x5153('0x22')][_0x5153('0x16')],'pass':_0x3ffa33['Smtp']['pass']};}var _0x3b357d={'account':_0x742ea4,'message':_['merge']({'from':util[_0x5153('0x29')](_0x5153('0x2a'),_0x3ffa33[_0x5153('0xf')],_0x3ffa33['email']||_0x3ffa33[_0x5153('0x22')][_0x5153('0x16')])},_0x1977b4)};return client[_0x5153('0x2b')](_0x5153('0x2c'),_0x3b357d);})['then'](function(_0x4110c8){if(_0x4110c8[_0x5153('0x2d')]){throw new Error(util['format']('SendMail\x20error:\x20%s.\x20Please\x20contact\x20your\x20Administrator!',_0x4110c8[_0x5153('0x2d')][_0x5153('0x2e')]||JSON[_0x5153('0x2f')](_0x4110c8[_0x5153('0x2d')])));}return!![];});}function handleError(_0xcead54,_0x2be57e,_0x54a0cd){return _0xcead54[_0x5153('0x30')](_0x2be57e||0x1f4)[_0x5153('0x31')]({'message':_0x54a0cd?_0x54a0cd['message']||_0x54a0cd:''});}exports[_0x5153('0x32')]=function(_0x5cac26,_0x16e65b,_0x3eb4f6){passport[_0x5153('0x18')](_0x5153('0x33'),function(_0x281d56,_0x2a7b45,_0x289c15){var _0x608e4=_0x281d56||_0x289c15;if(_0x608e4){return handleError(_0x16e65b,0x191,_0x608e4);}if(!_0x2a7b45){return handleError(_0x16e65b,0x194,{'message':_0x5153('0x34')});}else{var _0x55505a={'payload':{'id':_0x2a7b45['id'],'role':_0x2a7b45[_0x5153('0x12')]},'options':{'expiresIn':0x15180}};return authService['signToken'](_0x55505a)[_0x5153('0xe')](function(_0x557cd3){_0x16e65b[_0x5153('0x35')]({'id':_0x2a7b45['id'],'token':_0x557cd3,'statusCall':'','isAlreadyLogged':_0x2a7b45[_0x5153('0x36')]});});}})(_0x5cac26,_0x16e65b,_0x3eb4f6);};exports['forgot']=function(_0x594bda,_0x55b2e7,_0x2cfd60){if(!_0x594bda['body']['email']){return handleError(_0x55b2e7,0x1f4,{'message':_0x5153('0x37')});}var _0x5512ea=rs[_0x5153('0x38')]();_0x594bda[_0x5153('0x39')]['email']=_0x594bda[_0x5153('0x39')][_0x5153('0x21')][_0x5153('0x3a')]()[_0x5153('0x3b')]();var _0x4ca56e;return db[_0x5153('0x3c')][_0x5153('0xb')]({'where':{'id':0x1},'attributes':[_0x5153('0xc'),_0x5153('0xd')],'raw':!![]})[_0x5153('0xe')](function(_0x1e57c9){_0x4ca56e=_0x1e57c9;return db[_0x5153('0x3d')]['find']({'where':{'email':_0x594bda[_0x5153('0x39')][_0x5153('0x21')]}});})[_0x5153('0xe')](function(_0x971070){if(!_0x971070){throw new Error('This\x20email\x20is\x20not\x20registered.');}if(_0x971070[_0x5153('0x1c')]){throw new Error(_0x5153('0x3e'));}if(_0x971070[_0x5153('0x13')]){if(moment(_0x971070[_0x5153('0x19')])['add'](_0x4ca56e['blockDuration'],_0x5153('0x1d'))>moment()){throw new Error(_0x5153('0x3f'));}else{_0x971070['blocked']=![];_0x971070[_0x5153('0x19')]=null;}}_0x971070[_0x5153('0x40')]=_0x5512ea;_0x971070[_0x5153('0x41')]=Date[_0x5153('0x42')]()+0x36ee80;return _0x971070[_0x5153('0x43')]();})[_0x5153('0xe')](function(){return sendServiceMail({'to':_0x594bda[_0x5153('0x39')][_0x5153('0x21')],'subject':_0x5153('0x44'),'text':'You\x20are\x20receiving\x20this\x20because\x20you\x20(or\x20someone\x20else)\x20have\x20requested\x20the\x20reset\x20of\x20the\x20password\x20for\x20your\x20account.\x0a\x0a'+_0x5153('0x45')+'https://'+_0x594bda[_0x5153('0x46')][_0x5153('0x24')]+'/reset/'+_0x5512ea+'\x0a\x0a'+'If\x20you\x20did\x20not\x20request\x20this,\x20please\x20ignore\x20this\x20email\x20and\x20your\x20password\x20will\x20remain\x20unchanged.\x0a'});})[_0x5153('0xe')](function(){_0x55b2e7[_0x5153('0x30')](0xc8)[_0x5153('0x31')]({'message':'Reset\x20Email\x20sent!'});})['catch'](function(_0x40fb82){return handleError(_0x55b2e7,0x1f4,_0x40fb82);});};exports[_0x5153('0x47')]=function(_0x14bedf,_0x5909dd,_0x46da73){return db[_0x5153('0x3d')]['find']({'where':{'resetPasswordToken':_0x14bedf[_0x5153('0x48')][_0x5153('0x49')],'resetPasswordExpires':{'$gt':Date[_0x5153('0x42')]()}}})[_0x5153('0xe')](function(_0x3ad911){if(!_0x3ad911){throw new Error(_0x5153('0x4a'));}return db[_0x5153('0x3c')][_0x5153('0xb')]({'attributes':['id',_0x5153('0x4b'),'enforcePasswordHistory',_0x5153('0x4c')]})[_0x5153('0xe')](function(_0x306621){if(_0x306621[_0x5153('0x4b')])authService[_0x5153('0x4d')](_0x14bedf[_0x5153('0x39')][_0x5153('0x10')]);if(!_0x306621['enforcePasswordHistory']||!_0x3ad911[_0x5153('0x4e')])return _0x3ad911;authService[_0x5153('0x4f')](_0x14bedf['body']['password'],_0x3ad911[_0x5153('0x4e')],_0x306621[_0x5153('0x4c')]);return _0x3ad911;})[_0x5153('0xe')](function(){_0x3ad911[_0x5153('0x10')]=_0x14bedf[_0x5153('0x39')][_0x5153('0x10')];_0x3ad911['resetPasswordToken']=null;_0x3ad911['resetPasswordExpires']=null;return _0x3ad911[_0x5153('0x43')]();});})['then'](function(){_0x5909dd[_0x5153('0x30')](0xc8)[_0x5153('0x31')]({'message':_0x5153('0x50')});})['catch'](function(_0x187410){return handleError(_0x5909dd,0x1f4,_0x187410);});};passport[_0x5153('0x51')](new LocalStrategy({'usernameField':_0x5153('0xf'),'passwordField':_0x5153('0x10')},function(_0x35aa78,_0x1afba2,_0x13cf4a){return localAuthenticate(db[_0x5153('0x3d')],_0x35aa78,_0x1afba2,_0x13cf4a);}));
\ No newline at end of file
+var _0x3cad=['validatePasswordHistory','previousPasswords','Password\x20reset!','util','passport-local','Strategy','jayson/promise','lodash','../../components/auth/service','../../config/utils','client','http','Setting','findOne','allowedLoginAttempts','blockDuration','then','name','password','salt','disabled','blocked','blockedAt','loginAttempts','admin','user','Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.','authenticate','add','minutes','clearBlockUser','getLicense','catch','MailAccount','find','email','MailServerOut','Smtp','Unable\x20to\x20find\x20a\x20configured\x20SMTP\x20service!','service','host','port','secure','auth','request','format','SendMail\x20error:\x20%s.\x20Please\x20contact\x20your\x20Administrator!','error','message','stringify','status','send','login','Something\x20went\x20wrong,\x20please\x20try\x20again.','role','signToken','json','online','forgot','Email\x20parameter\x20is\x20missing','generate','body','trim','toLowerCase','User','This\x20email\x20is\x20not\x20registered.','The\x20user\x20is\x20blocked.\x20Please\x20contact\x20the\x20administrator.','resetPasswordToken','resetPasswordExpires','now','save','xCally\x20Motion\x20Password\x20Reset','You\x20are\x20receiving\x20this\x20because\x20you\x20(or\x20someone\x20else)\x20have\x20requested\x20the\x20reset\x20of\x20the\x20password\x20for\x20your\x20account.\x0a\x0a','https://','headers','/reset/','If\x20you\x20did\x20not\x20request\x20this,\x20please\x20ignore\x20this\x20email\x20and\x20your\x20password\x20will\x20remain\x20unchanged.\x0a','reset','params','token','Password\x20reset\x20token\x20is\x20invalid\x20or\x20has\x20expired.','enforcePasswordHistory','passwordHistoryLimit','securePassword','validatePasswordPattern'];(function(_0x13d07a,_0x41efc3){var _0x5ee0ee=function(_0x4ca94a){while(--_0x4ca94a){_0x13d07a['push'](_0x13d07a['shift']());}};_0x5ee0ee(++_0x41efc3);}(_0x3cad,0x102));var _0xd3ca=function(_0x41f484,_0x50f835){_0x41f484=_0x41f484-0x0;var _0x2f9acb=_0x3cad[_0x41f484];return _0x2f9acb;};'use strict';var util=require(_0xd3ca('0x0'));var passport=require('passport');var LocalStrategy=require(_0xd3ca('0x1'))[_0xd3ca('0x2')];var jayson=require(_0xd3ca('0x3'));var _=require(_0xd3ca('0x4'));var rs=require('randomstring');var moment=require('moment');var db=require('../../mysqldb')['db'];var authService=require(_0xd3ca('0x5'));var utils=require(_0xd3ca('0x6'));var client=jayson[_0xd3ca('0x7')][_0xd3ca('0x8')]({'port':0x232b});function localAuthenticate(_0x2e5c2d,_0xbea659,_0x5ea2b2,_0x1dfa6e){var _0x452206,_0x73df6c;return db[_0xd3ca('0x9')][_0xd3ca('0xa')]({'where':{'id':0x1},'attributes':[_0xd3ca('0xb'),_0xd3ca('0xc')],'raw':!![]})[_0xd3ca('0xd')](function(_0x5589fc){_0x452206=_0x5589fc;return _0x2e5c2d[_0xd3ca('0xa')]({'attributes':['id',_0xd3ca('0xe'),_0xd3ca('0xf'),_0xd3ca('0x10'),'role',_0xd3ca('0x11'),_0xd3ca('0x12'),_0xd3ca('0x13'),_0xd3ca('0x14')],'where':{'name':_0xbea659,'role':{'$or':[_0xd3ca('0x15'),_0xd3ca('0x16'),'agent']}}});})['then'](function(_0x5c599c){if(!_0x5c599c||_0x5c599c&&_0x5c599c[_0xd3ca('0xe')]!==_0xbea659){throw new Error(_0xd3ca('0x17'));}else{_0x73df6c=_0x5c599c;return _0x73df6c;}})[_0xd3ca('0xd')](function(){_0x73df6c[_0xd3ca('0x18')](_0x5ea2b2,function(_0x2d2585,_0x2869f5){var _0x1e301b=_0x73df6c[_0xd3ca('0x14')]+0x1;if(_0x2d2585){return _0x1dfa6e(_0x2d2585);}else if(!_0x2869f5){if(_0x73df6c[_0xd3ca('0x11')]){return _0x1dfa6e(null,![],{'message':_0xd3ca('0x17')});}else if(_0x452206['allowedLoginAttempts']>0x0){if(_0x73df6c[_0xd3ca('0x12')]){if(_0x452206[_0xd3ca('0xc')]>0x0){if(moment(_0x73df6c[_0xd3ca('0x13')])[_0xd3ca('0x19')](_0x452206[_0xd3ca('0xc')],_0xd3ca('0x1a'))>moment()){return _0x1dfa6e(null,![],{'message':_0xd3ca('0x17')});}else{return utils[_0xd3ca('0x1b')](_0x73df6c,_0x1e301b,![],null)[_0xd3ca('0xd')](function(){return _0x1dfa6e(null,![],{'message':_0xd3ca('0x17')});});}}else{return _0x1dfa6e(null,![],{'message':_0xd3ca('0x17')});}}else{if(_0x1e301b>=_0x452206['allowedLoginAttempts']){return utils[_0xd3ca('0x1b')](_0x73df6c,0x0,!![],moment())[_0xd3ca('0xd')](function(){return _0x1dfa6e(null,![],{'message':_0xd3ca('0x17')});});}else{return utils[_0xd3ca('0x1b')](_0x73df6c,_0x1e301b,![],null)['then'](function(){return _0x1dfa6e(null,![],{'message':_0xd3ca('0x17')});});}}}else{return _0x1dfa6e(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});}}else{if(_0x73df6c[_0xd3ca('0x11')]){return _0x1dfa6e(null,![],{'message':_0xd3ca('0x17')});}else if(_0x452206['allowedLoginAttempts']>0x0){if(_0x73df6c['blocked']){if(_0x452206[_0xd3ca('0xc')]>0x0){if(moment(_0x73df6c['blockedAt'])['add'](_0x452206[_0xd3ca('0xc')],'minutes')>moment()){return _0x1dfa6e(null,![],{'message':_0xd3ca('0x17')});}else{return utils[_0xd3ca('0x1b')](_0x73df6c,0x0,![],null)['then'](function(){return utils[_0xd3ca('0x1c')](_0x73df6c);})[_0xd3ca('0xd')](function(){return _0x1dfa6e(null,_0x73df6c);});}}else{return _0x1dfa6e(null,![],{'message':_0xd3ca('0x17')});}}else{return utils['clearBlockUser'](_0x73df6c,0x0,![],null)[_0xd3ca('0xd')](function(){return utils[_0xd3ca('0x1c')](_0x73df6c);})[_0xd3ca('0xd')](function(){return _0x1dfa6e(null,_0x73df6c);})[_0xd3ca('0x1d')](function(_0x3fbfe2){return _0x1dfa6e(null,![],_0x3fbfe2);});}}else{if(_0x73df6c['blocked']){return _0x1dfa6e(null,![],{'message':_0xd3ca('0x17')});}else{return utils[_0xd3ca('0x1c')](_0x73df6c)[_0xd3ca('0xd')](function(){return _0x1dfa6e(null,_0x73df6c);});}}}});})['catch'](function(_0x50bbe1){return _0x1dfa6e(null,![],_0x50bbe1);});}function sendServiceMail(_0x4086a){return db[_0xd3ca('0x1e')][_0xd3ca('0x1f')]({'where':{'service':!![]},'attributes':['id',_0xd3ca('0xe'),_0xd3ca('0x20')],'include':[{'model':db[_0xd3ca('0x21')],'as':_0xd3ca('0x22')}]})[_0xd3ca('0xd')](function(_0x94b148){if(!_0x94b148){throw new Error(_0xd3ca('0x23'));}var _0x47d3ed={'tls':{'rejectUnauthorized':![]}};if(_0x94b148['Smtp']['service']){_0x47d3ed['service']=_0x94b148[_0xd3ca('0x22')][_0xd3ca('0x24')];}else{_0x47d3ed[_0xd3ca('0x25')]=_0x94b148['Smtp']['host'];_0x47d3ed[_0xd3ca('0x26')]=_0x94b148[_0xd3ca('0x22')]['port'];_0x47d3ed['secure']=_0x94b148['Smtp'][_0xd3ca('0x27')];}if(_0x94b148[_0xd3ca('0x22')]['authentication']){_0x47d3ed[_0xd3ca('0x28')]={'user':_0x94b148['Smtp']['user'],'pass':_0x94b148[_0xd3ca('0x22')]['pass']};}var _0x481c32={'account':_0x47d3ed,'message':_['merge']({'from':util['format']('\x22%s\x22\x20<%s>',_0x94b148[_0xd3ca('0xe')],_0x94b148[_0xd3ca('0x20')]||_0x94b148['Smtp'][_0xd3ca('0x16')])},_0x4086a)};return client[_0xd3ca('0x29')]('SendMail',_0x481c32);})[_0xd3ca('0xd')](function(_0x13c3c6){if(_0x13c3c6['error']){throw new Error(util[_0xd3ca('0x2a')](_0xd3ca('0x2b'),_0x13c3c6[_0xd3ca('0x2c')][_0xd3ca('0x2d')]||JSON[_0xd3ca('0x2e')](_0x13c3c6[_0xd3ca('0x2c')])));}return!![];});}function handleError(_0x3dbde6,_0x39c3c4,_0xb63e8b){return _0x3dbde6[_0xd3ca('0x2f')](_0x39c3c4||0x1f4)[_0xd3ca('0x30')]({'message':_0xb63e8b?_0xb63e8b[_0xd3ca('0x2d')]||_0xb63e8b:''});}exports[_0xd3ca('0x31')]=function(_0x5ee1fe,_0x4d78c0,_0x3eb0fb){passport[_0xd3ca('0x18')]('local',function(_0x4a0286,_0x46c91d,_0xc78c83){var _0x5715d1=_0x4a0286||_0xc78c83;if(_0x5715d1){return handleError(_0x4d78c0,0x191,_0x5715d1);}if(!_0x46c91d){return handleError(_0x4d78c0,0x194,{'message':_0xd3ca('0x32')});}else{var _0x2719c7={'payload':{'id':_0x46c91d['id'],'role':_0x46c91d[_0xd3ca('0x33')]},'options':{'expiresIn':0x15180}};return authService[_0xd3ca('0x34')](_0x2719c7)[_0xd3ca('0xd')](function(_0x19abf1){_0x4d78c0[_0xd3ca('0x35')]({'id':_0x46c91d['id'],'token':_0x19abf1,'statusCall':'','isAlreadyLogged':_0x46c91d[_0xd3ca('0x36')]});});}})(_0x5ee1fe,_0x4d78c0,_0x3eb0fb);};exports[_0xd3ca('0x37')]=function(_0x48322b,_0x1f6ed2,_0x115b64){if(!_0x48322b['body']['email']){return handleError(_0x1f6ed2,0x1f4,{'message':_0xd3ca('0x38')});}var _0x3436b3=rs[_0xd3ca('0x39')]();_0x48322b[_0xd3ca('0x3a')][_0xd3ca('0x20')]=_0x48322b[_0xd3ca('0x3a')][_0xd3ca('0x20')][_0xd3ca('0x3b')]()[_0xd3ca('0x3c')]();var _0x156375;return db[_0xd3ca('0x9')]['findOne']({'where':{'id':0x1},'attributes':[_0xd3ca('0xb'),'blockDuration'],'raw':!![]})[_0xd3ca('0xd')](function(_0x260d86){_0x156375=_0x260d86;return db[_0xd3ca('0x3d')][_0xd3ca('0x1f')]({'where':{'email':_0x48322b[_0xd3ca('0x3a')][_0xd3ca('0x20')]}});})[_0xd3ca('0xd')](function(_0x25e633){if(!_0x25e633){throw new Error(_0xd3ca('0x3e'));}if(_0x25e633[_0xd3ca('0x11')]){throw new Error('The\x20user\x20is\x20disabled.\x20Please\x20contact\x20the\x20administrator.');}if(_0x25e633['blocked']){if(moment(_0x25e633[_0xd3ca('0x13')])['add'](_0x156375['blockDuration'],'minutes')>moment()){throw new Error(_0xd3ca('0x3f'));}else{_0x25e633[_0xd3ca('0x12')]=![];_0x25e633['blockedAt']=null;}}_0x25e633[_0xd3ca('0x40')]=_0x3436b3;_0x25e633[_0xd3ca('0x41')]=Date[_0xd3ca('0x42')]()+0x36ee80;return _0x25e633[_0xd3ca('0x43')]();})['then'](function(){return sendServiceMail({'to':_0x48322b['body'][_0xd3ca('0x20')],'subject':_0xd3ca('0x44'),'text':_0xd3ca('0x45')+'Please\x20click\x20on\x20the\x20following\x20link,\x20or\x20paste\x20this\x20into\x20your\x20browser\x20to\x20complete\x20the\x20process:\x0a\x0a'+_0xd3ca('0x46')+_0x48322b[_0xd3ca('0x47')][_0xd3ca('0x25')]+_0xd3ca('0x48')+_0x3436b3+'\x0a\x0a'+_0xd3ca('0x49')});})['then'](function(){_0x1f6ed2['status'](0xc8)[_0xd3ca('0x30')]({'message':'Reset\x20Email\x20sent!'});})[_0xd3ca('0x1d')](function(_0x566710){return handleError(_0x1f6ed2,0x1f4,_0x566710);});};exports[_0xd3ca('0x4a')]=function(_0x1e30a7,_0x55cbf3,_0xbb0413){return db['User'][_0xd3ca('0x1f')]({'where':{'resetPasswordToken':_0x1e30a7[_0xd3ca('0x4b')][_0xd3ca('0x4c')],'resetPasswordExpires':{'$gt':Date[_0xd3ca('0x42')]()}}})[_0xd3ca('0xd')](function(_0xf03dac){if(!_0xf03dac){throw new Error(_0xd3ca('0x4d'));}return db[_0xd3ca('0x9')][_0xd3ca('0xa')]({'attributes':['id','securePassword',_0xd3ca('0x4e'),_0xd3ca('0x4f')]})[_0xd3ca('0xd')](function(_0xdf1e49){if(_0xdf1e49[_0xd3ca('0x50')])authService[_0xd3ca('0x51')](_0x1e30a7[_0xd3ca('0x3a')][_0xd3ca('0xf')]);if(!_0xdf1e49[_0xd3ca('0x4e')]||!_0xf03dac['previousPasswords'])return _0xf03dac;authService[_0xd3ca('0x52')](_0x1e30a7[_0xd3ca('0x3a')][_0xd3ca('0xf')],_0xf03dac[_0xd3ca('0x53')],_0xdf1e49[_0xd3ca('0x4f')]);return _0xf03dac;})[_0xd3ca('0xd')](function(){_0xf03dac[_0xd3ca('0xf')]=_0x1e30a7[_0xd3ca('0x3a')][_0xd3ca('0xf')];_0xf03dac[_0xd3ca('0x40')]=null;_0xf03dac[_0xd3ca('0x41')]=null;return _0xf03dac[_0xd3ca('0x43')]();});})[_0xd3ca('0xd')](function(){_0x55cbf3[_0xd3ca('0x2f')](0xc8)['send']({'message':_0xd3ca('0x54')});})[_0xd3ca('0x1d')](function(_0x49ef5c){return handleError(_0x55cbf3,0x1f4,_0x49ef5c);});};passport['use'](new LocalStrategy({'usernameField':_0xd3ca('0xe'),'passwordField':_0xd3ca('0xf')},function(_0x582616,_0x3f5c77,_0x8169c6){return localAuthenticate(db['User'],_0x582616,_0x3f5c77,_0x8169c6);}));
\ No newline at end of file
diff --git a/server/api/authLocal/index.js b/server/api/authLocal/index.js
index 3760042..c85753c 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 _0x0bfd=['/reset/:token','reset','exports','Router','./authLocal.controller','post','login','/forgot'];(function(_0x5a7e78,_0x400b57){var _0xa8d4a1=function(_0x486659){while(--_0x486659){_0x5a7e78['push'](_0x5a7e78['shift']());}};_0xa8d4a1(++_0x400b57);}(_0x0bfd,0x7b));var _0xd0bf=function(_0x35e289,_0x5cca85){_0x35e289=_0x35e289-0x0;var _0x22eb84=_0x0bfd[_0x35e289];return _0x22eb84;};'use strict';var express=require('express');var router=express[_0xd0bf('0x0')]();var controller=require(_0xd0bf('0x1'));router[_0xd0bf('0x2')]('/',controller[_0xd0bf('0x3')]);router[_0xd0bf('0x2')](_0xd0bf('0x4'),controller['forgot']);router[_0xd0bf('0x2')](_0xd0bf('0x5'),controller[_0xd0bf('0x6')]);module[_0xd0bf('0x7')]=router;
\ No newline at end of file
+var _0x4f0c=['forgot','/reset/:token','reset','exports','Router','post','login'];(function(_0x47b19f,_0x77c99f){var _0x1fd067=function(_0x2b7688){while(--_0x2b7688){_0x47b19f['push'](_0x47b19f['shift']());}};_0x1fd067(++_0x77c99f);}(_0x4f0c,0xac));var _0xc4f0=function(_0x3a574c,_0x33598e){_0x3a574c=_0x3a574c-0x0;var _0x28c69f=_0x4f0c[_0x3a574c];return _0x28c69f;};'use strict';var express=require('express');var router=express[_0xc4f0('0x0')]();var controller=require('./authLocal.controller');router[_0xc4f0('0x1')]('/',controller[_0xc4f0('0x2')]);router[_0xc4f0('0x1')]('/forgot',controller[_0xc4f0('0x3')]);router[_0xc4f0('0x1')](_0xc4f0('0x4'),controller[_0xc4f0('0x5')]);module[_0xc4f0('0x6')]=router;
\ No newline at end of file
diff --git a/server/api/automation/automation.attributes.js b/server/api/automation/automation.attributes.js
index 6b14aaa..948af2a 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 _0x3d2f=['sequelize','exports','STRING','BOOLEAN','INTEGER'];(function(_0x14b8ee,_0x26d31a){var _0x50ef2b=function(_0x27d7bc){while(--_0x27d7bc){_0x14b8ee['push'](_0x14b8ee['shift']());}};_0x50ef2b(++_0x26d31a);}(_0x3d2f,0x14a));var _0xf3d2=function(_0x6143bc,_0x547322){_0x6143bc=_0x6143bc-0x0;var _0x277165=_0x3d2f[_0x6143bc];return _0x277165;};'use strict';var Sequelize=require(_0xf3d2('0x0'));module[_0xf3d2('0x1')]={'name':{'type':Sequelize[_0xf3d2('0x2')],'allowNull':![]},'channel':{'type':Sequelize[_0xf3d2('0x2')]},'description':{'type':Sequelize[_0xf3d2('0x2')]},'status':{'type':Sequelize[_0xf3d2('0x3')],'defaultValue':![]},'timeout':{'type':Sequelize[_0xf3d2('0x4')],'defaultValue':0xa}};
\ No newline at end of file
+var _0xfeef=['exports','STRING','INTEGER'];(function(_0x3f4642,_0xaf8701){var _0x383322=function(_0x3cd476){while(--_0x3cd476){_0x3f4642['push'](_0x3f4642['shift']());}};_0x383322(++_0xaf8701);}(_0xfeef,0x90));var _0xffee=function(_0x1f8542,_0x161f82){_0x1f8542=_0x1f8542-0x0;var _0x55536d=_0xfeef[_0x1f8542];return _0x55536d;};'use strict';var Sequelize=require('sequelize');module[_0xffee('0x0')]={'name':{'type':Sequelize['STRING'],'allowNull':![]},'channel':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0xffee('0x1')]},'status':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'timeout':{'type':Sequelize[_0xffee('0x2')],'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 fa3819d..622f2f9 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 _0xf664=['ioredis','../../components/auth/service','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','offset','undefined','count','set','apply','reject','update','stack','name','send','index','map','rawAttributes','fieldName','type','key','query','filters','intersection','model','attributes','fields','nolimit','limit','order','sort','pick','filter','where','VIRTUAL','merge','options','then','includeAll','include','Automation','findAll','catch','show','params','keys','length','find','create','body','destroy','addConditions','Condition','ids','omit','getConditions','hasOwnProperty','addActions','Action','getActions','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','path','to-csv','ejs','fs-extra','lodash','squel','crypto','querystring','papaparse'];(function(_0x465a0c,_0x19d4d5){var _0x1e202e=function(_0x27bd8a){while(--_0x27bd8a){_0x465a0c['push'](_0x465a0c['shift']());}};_0x1e202e(++_0x19d4d5);}(_0xf664,0xe9));var _0x4f66=function(_0x1b70e3,_0x3a15b1){_0x1b70e3=_0x1b70e3-0x0;var _0x1452ab=_0xf664[_0x1b70e3];return _0x1452ab;};'use strict';var emlformat=require(_0x4f66('0x0'));var rimraf=require(_0x4f66('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x4f66('0x2'));var rp=require(_0x4f66('0x3'));var moment=require(_0x4f66('0x4'));var BPromise=require(_0x4f66('0x5'));var Mustache=require(_0x4f66('0x6'));var util=require('util');var path=require(_0x4f66('0x7'));var sox=require('sox');var csv=require(_0x4f66('0x8'));var ejs=require(_0x4f66('0x9'));var fs=require('fs');var fs_extra=require(_0x4f66('0xa'));var _=require(_0x4f66('0xb'));var squel=require(_0x4f66('0xc'));var crypto=require(_0x4f66('0xd'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x4f66('0x8'));var querystring=require(_0x4f66('0xe'));var Papa=require(_0x4f66('0xf'));var Redis=require(_0x4f66('0x10'));var authService=require(_0x4f66('0x11'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x4f66('0x12'));var logger=require(_0x4f66('0x13'))(_0x4f66('0x14'));var utils=require(_0x4f66('0x15'));var config=require(_0x4f66('0x16'));var licenseUtil=require('../../config/license/util');var db=require(_0x4f66('0x17'))['db'];function respondWithStatusCode(_0x5222e0,_0x29b4e6){_0x29b4e6=_0x29b4e6||0xcc;return function(_0x11fc50){if(_0x11fc50){return _0x5222e0[_0x4f66('0x18')](_0x29b4e6);}return _0x5222e0[_0x4f66('0x19')](_0x29b4e6)[_0x4f66('0x1a')]();};}function respondWithResult(_0x370962,_0x4df47e){_0x4df47e=_0x4df47e||0xc8;return function(_0x180bdc){if(_0x180bdc){return _0x370962[_0x4f66('0x19')](_0x4df47e)[_0x4f66('0x1b')](_0x180bdc);}};}function respondWithFilteredResult(_0x4c3fa2,_0x28c1ae){return function(_0x4e4e5b){if(_0x4e4e5b){var _0x4463d8=typeof _0x28c1ae[_0x4f66('0x1c')]===_0x4f66('0x1d')&&typeof _0x28c1ae['limit']===_0x4f66('0x1d');var _0x12128d=_0x4e4e5b[_0x4f66('0x1e')];var _0x562a15=_0x4463d8?0x0:_0x28c1ae['offset'];var _0x5d6a4b=_0x4463d8?_0x4e4e5b[_0x4f66('0x1e')]:_0x28c1ae['offset']+_0x28c1ae['limit'];var _0x11c886;if(_0x5d6a4b>=_0x12128d){_0x5d6a4b=_0x12128d;_0x11c886=0xc8;}else{_0x11c886=0xce;}_0x4c3fa2[_0x4f66('0x19')](_0x11c886);return _0x4c3fa2[_0x4f66('0x1f')]('Content-Range',_0x562a15+'-'+_0x5d6a4b+'/'+_0x12128d)[_0x4f66('0x1b')](_0x4e4e5b);}return null;};}function patchUpdates(_0x3d7586){return function(_0x39ce74){try{jsonpatch[_0x4f66('0x20')](_0x39ce74,_0x3d7586,!![]);}catch(_0x3b671e){return BPromise[_0x4f66('0x21')](_0x3b671e);}return _0x39ce74['save']();};}function saveUpdates(_0x5584a4,_0x19cd27){return function(_0x4bd7bb){if(_0x4bd7bb){return _0x4bd7bb[_0x4f66('0x22')](_0x5584a4)['then'](function(_0x4c0689){return _0x4c0689;});}return null;};}function removeEntity(_0x46f3ad,_0x2a3373){return function(_0x573fc2){if(_0x573fc2){return _0x573fc2['destroy']()['then'](function(){_0x46f3ad['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x203cab,_0x4a703b){return function(_0x56884a){if(!_0x56884a){_0x203cab[_0x4f66('0x18')](0x194);}return _0x56884a;};}function handleError(_0x57bb5d,_0xcc4a80){_0xcc4a80=_0xcc4a80||0x1f4;return function(_0x324030){logger['error'](_0x324030[_0x4f66('0x23')]);if(_0x324030[_0x4f66('0x24')]){delete _0x324030[_0x4f66('0x24')];}_0x57bb5d['status'](_0xcc4a80)[_0x4f66('0x25')](_0x324030);};}exports[_0x4f66('0x26')]=function(_0x21cb92,_0x1cc05b){var _0x1ae922={},_0x46770c={},_0x41bd47={'count':0x0,'rows':[]};var _0xd243fe=_[_0x4f66('0x27')](db['Automation'][_0x4f66('0x28')],function(_0x2914a0){return{'name':_0x2914a0[_0x4f66('0x29')],'type':_0x2914a0[_0x4f66('0x2a')][_0x4f66('0x2b')]};});_0x46770c['model']=_[_0x4f66('0x27')](_0xd243fe,_0x4f66('0x24'));_0x46770c[_0x4f66('0x2c')]=_['keys'](_0x21cb92[_0x4f66('0x2c')]);_0x46770c[_0x4f66('0x2d')]=_[_0x4f66('0x2e')](_0x46770c[_0x4f66('0x2f')],_0x46770c[_0x4f66('0x2c')]);_0x1ae922[_0x4f66('0x30')]=_[_0x4f66('0x2e')](_0x46770c[_0x4f66('0x2f')],qs[_0x4f66('0x31')](_0x21cb92[_0x4f66('0x2c')][_0x4f66('0x31')]));_0x1ae922[_0x4f66('0x30')]=_0x1ae922[_0x4f66('0x30')]['length']?_0x1ae922[_0x4f66('0x30')]:_0x46770c['model'];if(!_0x21cb92[_0x4f66('0x2c')]['hasOwnProperty'](_0x4f66('0x32'))){_0x1ae922[_0x4f66('0x33')]=qs[_0x4f66('0x33')](_0x21cb92[_0x4f66('0x2c')][_0x4f66('0x33')]);_0x1ae922['offset']=qs[_0x4f66('0x1c')](_0x21cb92[_0x4f66('0x2c')][_0x4f66('0x1c')]);}_0x1ae922[_0x4f66('0x34')]=qs[_0x4f66('0x35')](_0x21cb92[_0x4f66('0x2c')][_0x4f66('0x35')]);_0x1ae922['where']=qs[_0x4f66('0x2d')](_[_0x4f66('0x36')](_0x21cb92[_0x4f66('0x2c')],_0x46770c['filters']),_0xd243fe);if(_0x21cb92[_0x4f66('0x2c')][_0x4f66('0x37')]){_0x1ae922[_0x4f66('0x38')]=_['merge'](_0x1ae922[_0x4f66('0x38')],{'$or':_['map'](_0xd243fe,function(_0x1f0ebc){if(_0x1f0ebc['type']!==_0x4f66('0x39')){var _0x3c0d08={};_0x3c0d08[_0x1f0ebc[_0x4f66('0x24')]]={'$like':'%'+_0x21cb92[_0x4f66('0x2c')][_0x4f66('0x37')]+'%'};return _0x3c0d08;}})});}_0x1ae922=_[_0x4f66('0x3a')]({},_0x1ae922,_0x21cb92[_0x4f66('0x3b')]);var _0x3eab06={'where':_0x1ae922[_0x4f66('0x38')]};return db['Automation'][_0x4f66('0x1e')](_0x3eab06)[_0x4f66('0x3c')](function(_0x32e846){_0x41bd47[_0x4f66('0x1e')]=_0x32e846;if(_0x21cb92[_0x4f66('0x2c')][_0x4f66('0x3d')]){_0x1ae922[_0x4f66('0x3e')]=[{'all':!![]}];}return db[_0x4f66('0x3f')][_0x4f66('0x40')](_0x1ae922);})[_0x4f66('0x3c')](function(_0x390461){_0x41bd47['rows']=_0x390461;return _0x41bd47;})[_0x4f66('0x3c')](respondWithFilteredResult(_0x1cc05b,_0x1ae922))[_0x4f66('0x41')](handleError(_0x1cc05b,null));};exports[_0x4f66('0x42')]=function(_0x495ff8,_0x27fe31){var _0x230013={'raw':![],'where':{'id':_0x495ff8[_0x4f66('0x43')]['id']}},_0x6647b8={};_0x6647b8[_0x4f66('0x2f')]=_[_0x4f66('0x44')](db['Automation'][_0x4f66('0x28')]);_0x6647b8['query']=_[_0x4f66('0x44')](_0x495ff8[_0x4f66('0x2c')]);_0x6647b8[_0x4f66('0x2d')]=_['intersection'](_0x6647b8[_0x4f66('0x2f')],_0x6647b8['query']);_0x230013[_0x4f66('0x30')]=_[_0x4f66('0x2e')](_0x6647b8[_0x4f66('0x2f')],qs['fields'](_0x495ff8[_0x4f66('0x2c')][_0x4f66('0x31')]));_0x230013[_0x4f66('0x30')]=_0x230013[_0x4f66('0x30')][_0x4f66('0x45')]?_0x230013[_0x4f66('0x30')]:_0x6647b8[_0x4f66('0x2f')];if(_0x495ff8['query'][_0x4f66('0x3d')]){_0x230013[_0x4f66('0x3e')]=[{'all':!![]}];}_0x230013=_[_0x4f66('0x3a')]({},_0x230013,_0x495ff8[_0x4f66('0x3b')]);return db['Automation'][_0x4f66('0x46')](_0x230013)['then'](handleEntityNotFound(_0x27fe31,null))[_0x4f66('0x3c')](respondWithResult(_0x27fe31,null))[_0x4f66('0x41')](handleError(_0x27fe31,null));};exports[_0x4f66('0x47')]=function(_0x11a9f7,_0x6db65c){return db['Automation'][_0x4f66('0x47')](_0x11a9f7['body'],{})[_0x4f66('0x3c')](respondWithResult(_0x6db65c,0xc9))[_0x4f66('0x41')](handleError(_0x6db65c,null));};exports[_0x4f66('0x22')]=function(_0x3d80f1,_0x39d707){if(_0x3d80f1[_0x4f66('0x48')]['id']){delete _0x3d80f1[_0x4f66('0x48')]['id'];}return db[_0x4f66('0x3f')]['find']({'where':{'id':_0x3d80f1[_0x4f66('0x43')]['id']}})[_0x4f66('0x3c')](handleEntityNotFound(_0x39d707,null))[_0x4f66('0x3c')](saveUpdates(_0x3d80f1[_0x4f66('0x48')],null))[_0x4f66('0x3c')](respondWithResult(_0x39d707,null))['catch'](handleError(_0x39d707,null));};exports[_0x4f66('0x49')]=function(_0x2a4437,_0x9f2cb2){return db[_0x4f66('0x3f')]['find']({'where':{'id':_0x2a4437[_0x4f66('0x43')]['id']}})['then'](handleEntityNotFound(_0x9f2cb2,null))[_0x4f66('0x3c')](removeEntity(_0x9f2cb2,null))[_0x4f66('0x41')](handleError(_0x9f2cb2,null));};exports[_0x4f66('0x4a')]=function(_0x1fb54b,_0x1a602e,_0x5cea04){return db[_0x4f66('0x4b')][_0x4f66('0x46')]({'where':{'id':_0x1fb54b[_0x4f66('0x43')]['id']}})['then'](handleEntityNotFound(_0x1a602e,null))['then'](function(_0x1f7408){if(_0x1f7408){return _0x1f7408[_0x4f66('0x4a')](_0x1fb54b[_0x4f66('0x48')][_0x4f66('0x4c')],_[_0x4f66('0x4d')](_0x1fb54b[_0x4f66('0x48')],['ids','id'])||{});}})[_0x4f66('0x3c')](respondWithResult(_0x1a602e,null))[_0x4f66('0x41')](handleError(_0x1a602e,null));};exports[_0x4f66('0x4e')]=function(_0x1dc654,_0x134bd2,_0x3b5eec){var _0x426376={};var _0x26e73b={};var _0x61a5ba;var _0x2800d6;return db[_0x4f66('0x3f')]['findOne']({'where':{'id':_0x1dc654['params']['id']}})[_0x4f66('0x3c')](handleEntityNotFound(_0x134bd2,null))[_0x4f66('0x3c')](function(_0x2b0484){if(_0x2b0484){_0x61a5ba=_0x2b0484;_0x26e73b[_0x4f66('0x2f')]=_['keys'](db[_0x4f66('0x4b')][_0x4f66('0x28')]);_0x26e73b[_0x4f66('0x2c')]=_[_0x4f66('0x44')](_0x1dc654['query']);_0x26e73b[_0x4f66('0x2d')]=_[_0x4f66('0x2e')](_0x26e73b[_0x4f66('0x2f')],_0x26e73b[_0x4f66('0x2c')]);_0x426376['attributes']=_['intersection'](_0x26e73b[_0x4f66('0x2f')],qs[_0x4f66('0x31')](_0x1dc654['query'][_0x4f66('0x31')]));_0x426376['attributes']=_0x426376['attributes'][_0x4f66('0x45')]?_0x426376[_0x4f66('0x30')]:_0x26e73b[_0x4f66('0x2f')];_0x426376['order']=qs[_0x4f66('0x35')](_0x1dc654['query'][_0x4f66('0x35')]);_0x426376[_0x4f66('0x38')]=qs['filters'](_[_0x4f66('0x36')](_0x1dc654[_0x4f66('0x2c')],_0x26e73b['filters']));if(_0x1dc654['query']['filter']){_0x426376[_0x4f66('0x38')]=_[_0x4f66('0x3a')](_0x426376[_0x4f66('0x38')],{'$or':_[_0x4f66('0x27')](_0x426376[_0x4f66('0x30')],function(_0x48584f){var _0x4a52ea={};_0x4a52ea[_0x48584f]={'$like':'%'+_0x1dc654['query'][_0x4f66('0x37')]+'%'};return _0x4a52ea;})});}_0x426376=_[_0x4f66('0x3a')]({},_0x426376,_0x1dc654[_0x4f66('0x3b')]);return _0x61a5ba[_0x4f66('0x4e')](_0x426376);}})[_0x4f66('0x3c')](function(_0x2ac200){if(_0x2ac200){_0x2800d6=_0x2ac200['length'];if(!_0x1dc654['query'][_0x4f66('0x4f')]('nolimit')){_0x426376[_0x4f66('0x33')]=qs[_0x4f66('0x33')](_0x1dc654[_0x4f66('0x2c')][_0x4f66('0x33')]);_0x426376[_0x4f66('0x1c')]=qs['offset'](_0x1dc654[_0x4f66('0x2c')]['offset']);}return _0x61a5ba[_0x4f66('0x4e')](_0x426376);}})[_0x4f66('0x3c')](function(_0x13edb0){if(_0x13edb0){return _0x13edb0?{'count':_0x2800d6,'rows':_0x13edb0}:null;}})[_0x4f66('0x3c')](respondWithResult(_0x134bd2,null))[_0x4f66('0x41')](handleError(_0x134bd2,null));};exports[_0x4f66('0x50')]=function(_0xe93bd4,_0x2622db,_0x3830b2){return db[_0x4f66('0x51')][_0x4f66('0x46')]({'where':{'id':_0xe93bd4[_0x4f66('0x43')]['id']}})[_0x4f66('0x3c')](handleEntityNotFound(_0x2622db,null))[_0x4f66('0x3c')](function(_0x4bbd75){if(_0x4bbd75){return _0x4bbd75[_0x4f66('0x50')](_0xe93bd4[_0x4f66('0x48')]['ids'],_[_0x4f66('0x4d')](_0xe93bd4[_0x4f66('0x48')],[_0x4f66('0x4c'),'id'])||{});}})[_0x4f66('0x3c')](respondWithResult(_0x2622db,null))[_0x4f66('0x41')](handleError(_0x2622db,null));};exports['getActions']=function(_0x2f4e3f,_0x39faea,_0x347937){var _0x5d5dd5={};var _0x153613={};var _0x2f1207;var _0x55fc31;return db[_0x4f66('0x3f')]['findOne']({'where':{'id':_0x2f4e3f['params']['id']}})[_0x4f66('0x3c')](handleEntityNotFound(_0x39faea,null))[_0x4f66('0x3c')](function(_0x297362){if(_0x297362){_0x2f1207=_0x297362;_0x153613['model']=_[_0x4f66('0x44')](db['Action'][_0x4f66('0x28')]);_0x153613[_0x4f66('0x2c')]=_[_0x4f66('0x44')](_0x2f4e3f[_0x4f66('0x2c')]);_0x153613[_0x4f66('0x2d')]=_[_0x4f66('0x2e')](_0x153613['model'],_0x153613[_0x4f66('0x2c')]);_0x5d5dd5[_0x4f66('0x30')]=_['intersection'](_0x153613[_0x4f66('0x2f')],qs[_0x4f66('0x31')](_0x2f4e3f[_0x4f66('0x2c')][_0x4f66('0x31')]));_0x5d5dd5[_0x4f66('0x30')]=_0x5d5dd5[_0x4f66('0x30')][_0x4f66('0x45')]?_0x5d5dd5[_0x4f66('0x30')]:_0x153613[_0x4f66('0x2f')];_0x5d5dd5[_0x4f66('0x34')]=qs[_0x4f66('0x35')](_0x2f4e3f[_0x4f66('0x2c')][_0x4f66('0x35')]);_0x5d5dd5[_0x4f66('0x38')]=qs[_0x4f66('0x2d')](_[_0x4f66('0x36')](_0x2f4e3f[_0x4f66('0x2c')],_0x153613[_0x4f66('0x2d')]));if(_0x2f4e3f[_0x4f66('0x2c')][_0x4f66('0x37')]){_0x5d5dd5[_0x4f66('0x38')]=_[_0x4f66('0x3a')](_0x5d5dd5[_0x4f66('0x38')],{'$or':_['map'](_0x5d5dd5[_0x4f66('0x30')],function(_0x4107c4){var _0x39bc04={};_0x39bc04[_0x4107c4]={'$like':'%'+_0x2f4e3f[_0x4f66('0x2c')][_0x4f66('0x37')]+'%'};return _0x39bc04;})});}_0x5d5dd5=_[_0x4f66('0x3a')]({},_0x5d5dd5,_0x2f4e3f[_0x4f66('0x3b')]);return _0x2f1207[_0x4f66('0x52')](_0x5d5dd5);}})[_0x4f66('0x3c')](function(_0x14c407){if(_0x14c407){_0x55fc31=_0x14c407['length'];if(!_0x2f4e3f[_0x4f66('0x2c')][_0x4f66('0x4f')](_0x4f66('0x32'))){_0x5d5dd5['limit']=qs['limit'](_0x2f4e3f[_0x4f66('0x2c')][_0x4f66('0x33')]);_0x5d5dd5[_0x4f66('0x1c')]=qs[_0x4f66('0x1c')](_0x2f4e3f[_0x4f66('0x2c')][_0x4f66('0x1c')]);}return _0x2f1207[_0x4f66('0x52')](_0x5d5dd5);}})[_0x4f66('0x3c')](function(_0x20268d){if(_0x20268d){return _0x20268d?{'count':_0x55fc31,'rows':_0x20268d}:null;}})['then'](respondWithResult(_0x39faea,null))[_0x4f66('0x41')](handleError(_0x39faea,null));};
\ No newline at end of file
+var _0x882e=['rawAttributes','fieldName','type','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','where','pick','filter','merge','VIRTUAL','options','include','findAll','catch','show','params','includeAll','find','create','body','addConditions','omit','ids','findOne','Condition','getConditions','addActions','Action','getActions','rimraf','fast-json-patch','bluebird','mustache','util','path','ejs','fs-extra','squel','crypto','jsforce','desk.js','to-csv','querystring','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','sendStatus','status','json','undefined','limit','count','offset','set','Content-Range','apply','reject','save','update','then','destroy','end','error','stack','name','send','map','Automation'];(function(_0x5c6299,_0x11bd28){var _0x23b564=function(_0x329ed6){while(--_0x329ed6){_0x5c6299['push'](_0x5c6299['shift']());}};_0x23b564(++_0x11bd28);}(_0x882e,0x11f));var _0xe882=function(_0x199685,_0x1ed29f){_0x199685=_0x199685-0x0;var _0x46d148=_0x882e[_0x199685];return _0x46d148;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xe882('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0xe882('0x1'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0xe882('0x2'));var Mustache=require(_0xe882('0x3'));var util=require(_0xe882('0x4'));var path=require(_0xe882('0x5'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0xe882('0x6'));var fs=require('fs');var fs_extra=require(_0xe882('0x7'));var _=require('lodash');var squel=require(_0xe882('0x8'));var crypto=require(_0xe882('0x9'));var jsforce=require(_0xe882('0xa'));var deskjs=require(_0xe882('0xb'));var toCsv=require(_0xe882('0xc'));var querystring=require(_0xe882('0xd'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0xe882('0xe'));var qs=require(_0xe882('0xf'));var as=require(_0xe882('0x10'));var hardwareService=require(_0xe882('0x11'));var logger=require(_0xe882('0x12'))(_0xe882('0x13'));var utils=require(_0xe882('0x14'));var config=require(_0xe882('0x15'));var licenseUtil=require(_0xe882('0x16'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x381152,_0x582025){_0x582025=_0x582025||0xcc;return function(_0x3b0834){if(_0x3b0834){return _0x381152[_0xe882('0x17')](_0x582025);}return _0x381152[_0xe882('0x18')](_0x582025)['end']();};}function respondWithResult(_0x338d8c,_0x11c057){_0x11c057=_0x11c057||0xc8;return function(_0x249b75){if(_0x249b75){return _0x338d8c[_0xe882('0x18')](_0x11c057)[_0xe882('0x19')](_0x249b75);}};}function respondWithFilteredResult(_0x4e3d9f,_0x749d9e){return function(_0x4bd2f0){if(_0x4bd2f0){var _0x5449b1=typeof _0x749d9e['offset']===_0xe882('0x1a')&&typeof _0x749d9e[_0xe882('0x1b')]===_0xe882('0x1a');var _0x23e200=_0x4bd2f0[_0xe882('0x1c')];var _0x5941f4=_0x5449b1?0x0:_0x749d9e[_0xe882('0x1d')];var _0x1569c1=_0x5449b1?_0x4bd2f0['count']:_0x749d9e[_0xe882('0x1d')]+_0x749d9e[_0xe882('0x1b')];var _0x44764a;if(_0x1569c1>=_0x23e200){_0x1569c1=_0x23e200;_0x44764a=0xc8;}else{_0x44764a=0xce;}_0x4e3d9f[_0xe882('0x18')](_0x44764a);return _0x4e3d9f[_0xe882('0x1e')](_0xe882('0x1f'),_0x5941f4+'-'+_0x1569c1+'/'+_0x23e200)[_0xe882('0x19')](_0x4bd2f0);}return null;};}function patchUpdates(_0x3a25fc){return function(_0x3b48c1){try{jsonpatch[_0xe882('0x20')](_0x3b48c1,_0x3a25fc,!![]);}catch(_0x5d7c96){return BPromise[_0xe882('0x21')](_0x5d7c96);}return _0x3b48c1[_0xe882('0x22')]();};}function saveUpdates(_0x225b2e,_0x9e9fde){return function(_0x21d982){if(_0x21d982){return _0x21d982[_0xe882('0x23')](_0x225b2e)[_0xe882('0x24')](function(_0x3c4963){return _0x3c4963;});}return null;};}function removeEntity(_0x1ee06f,_0x193688){return function(_0x2c0dbe){if(_0x2c0dbe){return _0x2c0dbe[_0xe882('0x25')]()[_0xe882('0x24')](function(){_0x1ee06f[_0xe882('0x18')](0xcc)[_0xe882('0x26')]();});}};}function handleEntityNotFound(_0xef7b46,_0x430526){return function(_0xa71108){if(!_0xa71108){_0xef7b46['sendStatus'](0x194);}return _0xa71108;};}function handleError(_0x2ab363,_0x38be5f){_0x38be5f=_0x38be5f||0x1f4;return function(_0x3499a4){logger[_0xe882('0x27')](_0x3499a4[_0xe882('0x28')]);if(_0x3499a4[_0xe882('0x29')]){delete _0x3499a4['name'];}_0x2ab363['status'](_0x38be5f)[_0xe882('0x2a')](_0x3499a4);};}exports['index']=function(_0x145ea9,_0x1a112a){var _0x211910={},_0x523fab={},_0x163dee={'count':0x0,'rows':[]};var _0x204066=_[_0xe882('0x2b')](db[_0xe882('0x2c')][_0xe882('0x2d')],function(_0x1038a2){return{'name':_0x1038a2[_0xe882('0x2e')],'type':_0x1038a2[_0xe882('0x2f')]['key']};});_0x523fab[_0xe882('0x30')]=_[_0xe882('0x2b')](_0x204066,'name');_0x523fab[_0xe882('0x31')]=_[_0xe882('0x32')](_0x145ea9[_0xe882('0x31')]);_0x523fab[_0xe882('0x33')]=_[_0xe882('0x34')](_0x523fab[_0xe882('0x30')],_0x523fab['query']);_0x211910[_0xe882('0x35')]=_[_0xe882('0x34')](_0x523fab['model'],qs[_0xe882('0x36')](_0x145ea9[_0xe882('0x31')]['fields']));_0x211910['attributes']=_0x211910[_0xe882('0x35')][_0xe882('0x37')]?_0x211910[_0xe882('0x35')]:_0x523fab[_0xe882('0x30')];if(!_0x145ea9[_0xe882('0x31')][_0xe882('0x38')](_0xe882('0x39'))){_0x211910[_0xe882('0x1b')]=qs['limit'](_0x145ea9['query'][_0xe882('0x1b')]);_0x211910[_0xe882('0x1d')]=qs['offset'](_0x145ea9['query'][_0xe882('0x1d')]);}_0x211910['order']=qs['sort'](_0x145ea9['query'][_0xe882('0x3a')]);_0x211910[_0xe882('0x3b')]=qs[_0xe882('0x33')](_[_0xe882('0x3c')](_0x145ea9[_0xe882('0x31')],_0x523fab[_0xe882('0x33')]),_0x204066);if(_0x145ea9[_0xe882('0x31')][_0xe882('0x3d')]){_0x211910[_0xe882('0x3b')]=_[_0xe882('0x3e')](_0x211910[_0xe882('0x3b')],{'$or':_['map'](_0x204066,function(_0x488261){if(_0x488261[_0xe882('0x2f')]!==_0xe882('0x3f')){var _0x51dee6={};_0x51dee6[_0x488261[_0xe882('0x29')]]={'$like':'%'+_0x145ea9[_0xe882('0x31')]['filter']+'%'};return _0x51dee6;}})});}_0x211910=_[_0xe882('0x3e')]({},_0x211910,_0x145ea9[_0xe882('0x40')]);var _0x27a2e8={'where':_0x211910[_0xe882('0x3b')]};return db[_0xe882('0x2c')]['count'](_0x27a2e8)['then'](function(_0x3bf72d){_0x163dee[_0xe882('0x1c')]=_0x3bf72d;if(_0x145ea9[_0xe882('0x31')]['includeAll']){_0x211910[_0xe882('0x41')]=[{'all':!![]}];}return db[_0xe882('0x2c')][_0xe882('0x42')](_0x211910);})[_0xe882('0x24')](function(_0x367141){_0x163dee['rows']=_0x367141;return _0x163dee;})[_0xe882('0x24')](respondWithFilteredResult(_0x1a112a,_0x211910))[_0xe882('0x43')](handleError(_0x1a112a,null));};exports[_0xe882('0x44')]=function(_0x3b287b,_0x2e5cbf){var _0xb20aa={'raw':![],'where':{'id':_0x3b287b[_0xe882('0x45')]['id']}},_0x25449a={};_0x25449a[_0xe882('0x30')]=_[_0xe882('0x32')](db[_0xe882('0x2c')][_0xe882('0x2d')]);_0x25449a[_0xe882('0x31')]=_[_0xe882('0x32')](_0x3b287b[_0xe882('0x31')]);_0x25449a[_0xe882('0x33')]=_[_0xe882('0x34')](_0x25449a['model'],_0x25449a['query']);_0xb20aa[_0xe882('0x35')]=_[_0xe882('0x34')](_0x25449a[_0xe882('0x30')],qs[_0xe882('0x36')](_0x3b287b[_0xe882('0x31')]['fields']));_0xb20aa[_0xe882('0x35')]=_0xb20aa[_0xe882('0x35')][_0xe882('0x37')]?_0xb20aa[_0xe882('0x35')]:_0x25449a[_0xe882('0x30')];if(_0x3b287b['query'][_0xe882('0x46')]){_0xb20aa[_0xe882('0x41')]=[{'all':!![]}];}_0xb20aa=_[_0xe882('0x3e')]({},_0xb20aa,_0x3b287b[_0xe882('0x40')]);return db[_0xe882('0x2c')][_0xe882('0x47')](_0xb20aa)[_0xe882('0x24')](handleEntityNotFound(_0x2e5cbf,null))['then'](respondWithResult(_0x2e5cbf,null))[_0xe882('0x43')](handleError(_0x2e5cbf,null));};exports[_0xe882('0x48')]=function(_0x17d3a0,_0x214ac1){return db[_0xe882('0x2c')]['create'](_0x17d3a0[_0xe882('0x49')],{})['then'](respondWithResult(_0x214ac1,0xc9))[_0xe882('0x43')](handleError(_0x214ac1,null));};exports[_0xe882('0x23')]=function(_0x1d4e85,_0xd198a6){if(_0x1d4e85[_0xe882('0x49')]['id']){delete _0x1d4e85['body']['id'];}return db[_0xe882('0x2c')][_0xe882('0x47')]({'where':{'id':_0x1d4e85['params']['id']}})[_0xe882('0x24')](handleEntityNotFound(_0xd198a6,null))[_0xe882('0x24')](saveUpdates(_0x1d4e85[_0xe882('0x49')],null))[_0xe882('0x24')](respondWithResult(_0xd198a6,null))['catch'](handleError(_0xd198a6,null));};exports[_0xe882('0x25')]=function(_0x2d5140,_0x5b1da5){return db[_0xe882('0x2c')][_0xe882('0x47')]({'where':{'id':_0x2d5140[_0xe882('0x45')]['id']}})[_0xe882('0x24')](handleEntityNotFound(_0x5b1da5,null))[_0xe882('0x24')](removeEntity(_0x5b1da5,null))['catch'](handleError(_0x5b1da5,null));};exports[_0xe882('0x4a')]=function(_0x35f515,_0x501847,_0x152301){return db['Condition'][_0xe882('0x47')]({'where':{'id':_0x35f515[_0xe882('0x45')]['id']}})[_0xe882('0x24')](handleEntityNotFound(_0x501847,null))[_0xe882('0x24')](function(_0x11779a){if(_0x11779a){return _0x11779a[_0xe882('0x4a')](_0x35f515[_0xe882('0x49')]['ids'],_[_0xe882('0x4b')](_0x35f515[_0xe882('0x49')],[_0xe882('0x4c'),'id'])||{});}})[_0xe882('0x24')](respondWithResult(_0x501847,null))[_0xe882('0x43')](handleError(_0x501847,null));};exports['getConditions']=function(_0x41e3cd,_0x2ada91,_0x33c14c){var _0x2037b1={};var _0x3516da={};var _0x45f197;var _0x5a6200;return db[_0xe882('0x2c')][_0xe882('0x4d')]({'where':{'id':_0x41e3cd['params']['id']}})[_0xe882('0x24')](handleEntityNotFound(_0x2ada91,null))[_0xe882('0x24')](function(_0x57a4ee){if(_0x57a4ee){_0x45f197=_0x57a4ee;_0x3516da[_0xe882('0x30')]=_[_0xe882('0x32')](db[_0xe882('0x4e')][_0xe882('0x2d')]);_0x3516da['query']=_['keys'](_0x41e3cd[_0xe882('0x31')]);_0x3516da[_0xe882('0x33')]=_[_0xe882('0x34')](_0x3516da[_0xe882('0x30')],_0x3516da['query']);_0x2037b1['attributes']=_[_0xe882('0x34')](_0x3516da[_0xe882('0x30')],qs['fields'](_0x41e3cd[_0xe882('0x31')][_0xe882('0x36')]));_0x2037b1[_0xe882('0x35')]=_0x2037b1[_0xe882('0x35')][_0xe882('0x37')]?_0x2037b1['attributes']:_0x3516da['model'];_0x2037b1['order']=qs[_0xe882('0x3a')](_0x41e3cd[_0xe882('0x31')][_0xe882('0x3a')]);_0x2037b1['where']=qs[_0xe882('0x33')](_[_0xe882('0x3c')](_0x41e3cd['query'],_0x3516da[_0xe882('0x33')]));if(_0x41e3cd[_0xe882('0x31')][_0xe882('0x3d')]){_0x2037b1[_0xe882('0x3b')]=_[_0xe882('0x3e')](_0x2037b1[_0xe882('0x3b')],{'$or':_[_0xe882('0x2b')](_0x2037b1[_0xe882('0x35')],function(_0x59c500){var _0x1d8b0e={};_0x1d8b0e[_0x59c500]={'$like':'%'+_0x41e3cd[_0xe882('0x31')][_0xe882('0x3d')]+'%'};return _0x1d8b0e;})});}_0x2037b1=_[_0xe882('0x3e')]({},_0x2037b1,_0x41e3cd[_0xe882('0x40')]);return _0x45f197[_0xe882('0x4f')](_0x2037b1);}})[_0xe882('0x24')](function(_0x41a7cb){if(_0x41a7cb){_0x5a6200=_0x41a7cb['length'];if(!_0x41e3cd[_0xe882('0x31')][_0xe882('0x38')](_0xe882('0x39'))){_0x2037b1[_0xe882('0x1b')]=qs[_0xe882('0x1b')](_0x41e3cd[_0xe882('0x31')][_0xe882('0x1b')]);_0x2037b1[_0xe882('0x1d')]=qs[_0xe882('0x1d')](_0x41e3cd[_0xe882('0x31')][_0xe882('0x1d')]);}return _0x45f197['getConditions'](_0x2037b1);}})[_0xe882('0x24')](function(_0x5d381a){if(_0x5d381a){return _0x5d381a?{'count':_0x5a6200,'rows':_0x5d381a}:null;}})[_0xe882('0x24')](respondWithResult(_0x2ada91,null))[_0xe882('0x43')](handleError(_0x2ada91,null));};exports[_0xe882('0x50')]=function(_0x142e9b,_0x3ed407,_0x2d9377){return db[_0xe882('0x51')]['find']({'where':{'id':_0x142e9b[_0xe882('0x45')]['id']}})[_0xe882('0x24')](handleEntityNotFound(_0x3ed407,null))[_0xe882('0x24')](function(_0x177f47){if(_0x177f47){return _0x177f47[_0xe882('0x50')](_0x142e9b['body'][_0xe882('0x4c')],_['omit'](_0x142e9b[_0xe882('0x49')],[_0xe882('0x4c'),'id'])||{});}})[_0xe882('0x24')](respondWithResult(_0x3ed407,null))[_0xe882('0x43')](handleError(_0x3ed407,null));};exports[_0xe882('0x52')]=function(_0x5cc5bb,_0x1f1dcb,_0x43a7b7){var _0x9d7c69={};var _0x1145d1={};var _0x22420c;var _0xb69637;return db[_0xe882('0x2c')]['findOne']({'where':{'id':_0x5cc5bb[_0xe882('0x45')]['id']}})[_0xe882('0x24')](handleEntityNotFound(_0x1f1dcb,null))['then'](function(_0x267315){if(_0x267315){_0x22420c=_0x267315;_0x1145d1[_0xe882('0x30')]=_[_0xe882('0x32')](db[_0xe882('0x51')][_0xe882('0x2d')]);_0x1145d1[_0xe882('0x31')]=_[_0xe882('0x32')](_0x5cc5bb[_0xe882('0x31')]);_0x1145d1[_0xe882('0x33')]=_[_0xe882('0x34')](_0x1145d1[_0xe882('0x30')],_0x1145d1[_0xe882('0x31')]);_0x9d7c69[_0xe882('0x35')]=_[_0xe882('0x34')](_0x1145d1[_0xe882('0x30')],qs['fields'](_0x5cc5bb[_0xe882('0x31')][_0xe882('0x36')]));_0x9d7c69[_0xe882('0x35')]=_0x9d7c69['attributes'][_0xe882('0x37')]?_0x9d7c69['attributes']:_0x1145d1[_0xe882('0x30')];_0x9d7c69['order']=qs[_0xe882('0x3a')](_0x5cc5bb['query'][_0xe882('0x3a')]);_0x9d7c69[_0xe882('0x3b')]=qs[_0xe882('0x33')](_['pick'](_0x5cc5bb[_0xe882('0x31')],_0x1145d1['filters']));if(_0x5cc5bb[_0xe882('0x31')]['filter']){_0x9d7c69['where']=_[_0xe882('0x3e')](_0x9d7c69[_0xe882('0x3b')],{'$or':_[_0xe882('0x2b')](_0x9d7c69[_0xe882('0x35')],function(_0x2fc093){var _0x3f98e1={};_0x3f98e1[_0x2fc093]={'$like':'%'+_0x5cc5bb[_0xe882('0x31')][_0xe882('0x3d')]+'%'};return _0x3f98e1;})});}_0x9d7c69=_[_0xe882('0x3e')]({},_0x9d7c69,_0x5cc5bb[_0xe882('0x40')]);return _0x22420c['getActions'](_0x9d7c69);}})[_0xe882('0x24')](function(_0x4cc0d7){if(_0x4cc0d7){_0xb69637=_0x4cc0d7[_0xe882('0x37')];if(!_0x5cc5bb[_0xe882('0x31')][_0xe882('0x38')](_0xe882('0x39'))){_0x9d7c69[_0xe882('0x1b')]=qs[_0xe882('0x1b')](_0x5cc5bb[_0xe882('0x31')]['limit']);_0x9d7c69[_0xe882('0x1d')]=qs[_0xe882('0x1d')](_0x5cc5bb[_0xe882('0x31')][_0xe882('0x1d')]);}return _0x22420c['getActions'](_0x9d7c69);}})[_0xe882('0x24')](function(_0x5ee96a){if(_0x5ee96a){return _0x5ee96a?{'count':_0xb69637,'rows':_0x5ee96a}:null;}})[_0xe882('0x24')](respondWithResult(_0x1f1dcb,null))[_0xe882('0x43')](handleError(_0x1f1dcb,null));};
\ No newline at end of file
diff --git a/server/api/automation/automation.model.js b/server/api/automation/automation.model.js
index 8f00047..3062d6e 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 _0xe9d6=['lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','./automation.attributes','exports'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xe9d6,0x1f4));var _0x6e9d=function(_0x20e589,_0x246220){_0x20e589=_0x20e589-0x0;var _0x1d6527=_0xe9d6[_0x20e589];return _0x1d6527;};'use strict';var _=require(_0x6e9d('0x0'));var util=require(_0x6e9d('0x1'));var logger=require(_0x6e9d('0x2'))(_0x6e9d('0x3'));var moment=require(_0x6e9d('0x4'));var BPromise=require(_0x6e9d('0x5'));var rp=require(_0x6e9d('0x6'));var fs=require('fs');var path=require(_0x6e9d('0x7'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x6e9d('0x8'));module[_0x6e9d('0x9')]=function(_0xbea913,_0x2e72df){return _0xbea913['define']('Automation',attributes,{'tableName':'tools_automations','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x6480=['util','../../config/logger','api','moment','bluebird','rimraf','../../config/environment','./automation.attributes','define','Automation','tools_automations'];(function(_0x495f12,_0x220c4a){var _0x1fff37=function(_0x5851f5){while(--_0x5851f5){_0x495f12['push'](_0x495f12['shift']());}};_0x1fff37(++_0x220c4a);}(_0x6480,0x1d9));var _0x0648=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x6480[_0x3dd15e];return _0x231fd0;};'use strict';var _=require('lodash');var util=require(_0x0648('0x0'));var logger=require(_0x0648('0x1'))(_0x0648('0x2'));var moment=require(_0x0648('0x3'));var BPromise=require(_0x0648('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x0648('0x5'));var config=require(_0x0648('0x6'));var attributes=require(_0x0648('0x7'));module['exports']=function(_0x2acb12,_0x153b6f){return _0x2acb12[_0x0648('0x8')](_0x0648('0x9'),attributes,{'tableName':_0x0648('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
diff --git a/server/api/automation/automation.rpc.js b/server/api/automation/automation.rpc.js
index 55300d7..d2308a8 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 _0xb7e2=['rpc','../../config/environment','jayson/promise','client','http','request','then','info','Automation,\x20%s,\x20%s','Automation,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','lodash','moment','randomstring','../../mysqldb','../../config/logger'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xb7e2,0x103));var _0x2b7e=function(_0x5f28c1,_0x2d429d){_0x5f28c1=_0x5f28c1-0x0;var _0x244481=_0xb7e2[_0x5f28c1];return _0x244481;};'use strict';var _=require(_0x2b7e('0x0'));var util=require('util');var moment=require(_0x2b7e('0x1'));var BPromise=require('bluebird');var rs=require(_0x2b7e('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x2b7e('0x3'))['db'];var utils=require('../../config/utils');var logger=require(_0x2b7e('0x4'))(_0x2b7e('0x5'));var config=require(_0x2b7e('0x6'));var jayson=require(_0x2b7e('0x7'));var client=jayson[_0x2b7e('0x8')][_0x2b7e('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x4d7a0b,_0xc23ec4,_0x45dc9f){return new BPromise(function(_0x10a31d,_0x49491c){return client[_0x2b7e('0xa')](_0x4d7a0b,_0x45dc9f)[_0x2b7e('0xb')](function(_0x2f5991){logger[_0x2b7e('0xc')](_0x2b7e('0xd'),_0xc23ec4,'request\x20sent');logger['debug'](_0x2b7e('0xe'),_0xc23ec4,_0x2b7e('0xf'),JSON[_0x2b7e('0x10')](_0x2f5991));if(_0x2f5991[_0x2b7e('0x11')]){if(_0x2f5991[_0x2b7e('0x11')][_0x2b7e('0x12')]===0x1f4){logger[_0x2b7e('0x11')]('Automation,\x20%s,\x20%s',_0xc23ec4,_0x2f5991[_0x2b7e('0x11')][_0x2b7e('0x13')]);return _0x49491c(_0x2f5991[_0x2b7e('0x11')][_0x2b7e('0x13')]);}logger['error']('Automation,\x20%s,\x20%s',_0xc23ec4,_0x2f5991['error'][_0x2b7e('0x13')]);return _0x10a31d(_0x2f5991['error'][_0x2b7e('0x13')]);}else{logger['info'](_0x2b7e('0xd'),_0xc23ec4,'request\x20sent');_0x10a31d(_0x2f5991[_0x2b7e('0x14')][_0x2b7e('0x13')]);}})[_0x2b7e('0x15')](function(_0x4d85c3){logger[_0x2b7e('0x11')](_0x2b7e('0xd'),_0xc23ec4,_0x4d85c3);_0x49491c(_0x4d85c3);});});}
\ No newline at end of file
+var _0x4ca7=['util','moment','randomstring','ioredis','../../config/logger','../../config/environment','jayson/promise','http','request','then','Automation,\x20%s,\x20%s','debug','Automation,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','request\x20sent','result','catch','lodash'];(function(_0x54d731,_0x3f0c48){var _0x55de76=function(_0x345741){while(--_0x345741){_0x54d731['push'](_0x54d731['shift']());}};_0x55de76(++_0x3f0c48);}(_0x4ca7,0x1e3));var _0x74ca=function(_0x2ef905,_0x5a10fe){_0x2ef905=_0x2ef905-0x0;var _0x2e1e7e=_0x4ca7[_0x2ef905];return _0x2e1e7e;};'use strict';var _=require(_0x74ca('0x0'));var util=require(_0x74ca('0x1'));var moment=require(_0x74ca('0x2'));var BPromise=require('bluebird');var rs=require(_0x74ca('0x3'));var fs=require('fs');var Redis=require(_0x74ca('0x4'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x74ca('0x5'))('rpc');var config=require(_0x74ca('0x6'));var jayson=require(_0x74ca('0x7'));var client=jayson['client'][_0x74ca('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x572dc2,_0x453b45,_0x1d28e1){return new BPromise(function(_0x33cabd,_0x407524){return client[_0x74ca('0x9')](_0x572dc2,_0x1d28e1)[_0x74ca('0xa')](function(_0x116715){logger['info'](_0x74ca('0xb'),_0x453b45,'request\x20sent');logger[_0x74ca('0xc')](_0x74ca('0xd'),_0x453b45,'request\x20sent',JSON[_0x74ca('0xe')](_0x116715));if(_0x116715[_0x74ca('0xf')]){if(_0x116715[_0x74ca('0xf')][_0x74ca('0x10')]===0x1f4){logger[_0x74ca('0xf')](_0x74ca('0xb'),_0x453b45,_0x116715[_0x74ca('0xf')][_0x74ca('0x11')]);return _0x407524(_0x116715['error'][_0x74ca('0x11')]);}logger[_0x74ca('0xf')](_0x74ca('0xb'),_0x453b45,_0x116715[_0x74ca('0xf')][_0x74ca('0x11')]);return _0x33cabd(_0x116715[_0x74ca('0xf')][_0x74ca('0x11')]);}else{logger[_0x74ca('0x12')](_0x74ca('0xb'),_0x453b45,_0x74ca('0x13'));_0x33cabd(_0x116715[_0x74ca('0x14')][_0x74ca('0x11')]);}})[_0x74ca('0x15')](function(_0x42b90e){logger['error'](_0x74ca('0xb'),_0x453b45,_0x42b90e);_0x407524(_0x42b90e);});});}
\ No newline at end of file
diff --git a/server/api/automation/index.js b/server/api/automation/index.js
index 1891a1e..332dc7b 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 _0xbdb0=['express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./automation.controller','isAuthenticated','get','/:id','show','/:id/conditions','getActions','create','addConditions','post','/:id/actions','put','destroy','exports','multer','util','path'];(function(_0x1deb03,_0xd05ad8){var _0x189fe7=function(_0x321225){while(--_0x321225){_0x1deb03['push'](_0x1deb03['shift']());}};_0x189fe7(++_0xd05ad8);}(_0xbdb0,0x189));var _0x0bdb=function(_0x411add,_0x1aed38){_0x411add=_0x411add-0x0;var _0x238242=_0xbdb0[_0x411add];return _0x238242;};'use strict';var multer=require(_0x0bdb('0x0'));var util=require(_0x0bdb('0x1'));var path=require(_0x0bdb('0x2'));var timeout=require('connect-timeout');var express=require(_0x0bdb('0x3'));var router=express[_0x0bdb('0x4')]();var fs_extra=require(_0x0bdb('0x5'));var auth=require(_0x0bdb('0x6'));var interaction=require(_0x0bdb('0x7'));var config=require('../../config/environment');var controller=require(_0x0bdb('0x8'));router['get']('/',auth[_0x0bdb('0x9')](),controller['index']);router[_0x0bdb('0xa')](_0x0bdb('0xb'),auth[_0x0bdb('0x9')](),controller[_0x0bdb('0xc')]);router[_0x0bdb('0xa')](_0x0bdb('0xd'),auth[_0x0bdb('0x9')](),controller['getConditions']);router[_0x0bdb('0xa')]('/:id/actions',auth['isAuthenticated'](),controller[_0x0bdb('0xe')]);router['post']('/',auth['isAuthenticated'](),controller[_0x0bdb('0xf')]);router['post']('/:id/conditions',auth[_0x0bdb('0x9')](),controller[_0x0bdb('0x10')]);router[_0x0bdb('0x11')](_0x0bdb('0x12'),auth[_0x0bdb('0x9')](),controller['addActions']);router[_0x0bdb('0x13')](_0x0bdb('0xb'),auth[_0x0bdb('0x9')](),controller['update']);router['delete']('/:id',auth[_0x0bdb('0x9')](),controller[_0x0bdb('0x14')]);module[_0x0bdb('0x15')]=router;
\ No newline at end of file
+var _0xbe22=['../../config/environment','./automation.controller','get','isAuthenticated','index','/:id','show','/:id/conditions','getConditions','/:id/actions','getActions','post','create','addConditions','addActions','update','exports','multer','util','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service'];(function(_0x13cfa1,_0x2ae2db){var _0x4686ed=function(_0x1690e5){while(--_0x1690e5){_0x13cfa1['push'](_0x13cfa1['shift']());}};_0x4686ed(++_0x2ae2db);}(_0xbe22,0x1c1));var _0x2be2=function(_0xf0916f,_0x447c4e){_0xf0916f=_0xf0916f-0x0;var _0x4a2393=_0xbe22[_0xf0916f];return _0x4a2393;};'use strict';var multer=require(_0x2be2('0x0'));var util=require(_0x2be2('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0x2be2('0x2'));var router=express[_0x2be2('0x3')]();var fs_extra=require(_0x2be2('0x4'));var auth=require(_0x2be2('0x5'));var interaction=require(_0x2be2('0x6'));var config=require(_0x2be2('0x7'));var controller=require(_0x2be2('0x8'));router[_0x2be2('0x9')]('/',auth[_0x2be2('0xa')](),controller[_0x2be2('0xb')]);router['get'](_0x2be2('0xc'),auth[_0x2be2('0xa')](),controller[_0x2be2('0xd')]);router['get'](_0x2be2('0xe'),auth[_0x2be2('0xa')](),controller[_0x2be2('0xf')]);router[_0x2be2('0x9')](_0x2be2('0x10'),auth[_0x2be2('0xa')](),controller[_0x2be2('0x11')]);router[_0x2be2('0x12')]('/',auth['isAuthenticated'](),controller[_0x2be2('0x13')]);router[_0x2be2('0x12')]('/:id/conditions',auth[_0x2be2('0xa')](),controller[_0x2be2('0x14')]);router[_0x2be2('0x12')]('/:id/actions',auth[_0x2be2('0xa')](),controller[_0x2be2('0x15')]);router['put'](_0x2be2('0xc'),auth[_0x2be2('0xa')](),controller[_0x2be2('0x16')]);router['delete'](_0x2be2('0xc'),auth[_0x2be2('0xa')](),controller['destroy']);module[_0x2be2('0x17')]=router;
\ No newline at end of file
diff --git a/server/api/campaign/campaign.attributes.js b/server/api/campaign/campaign.attributes.js
index ab6d661..e4d542f 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 _0x1e87=['#Machine\x20Retry\x20(min:1,\x20max:999)','Machine\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#AgentReject\x20Retry\x20(min:1,\x20max:999)','AgentReject\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','exports','ENUM','ivr','STRING','BOOLEAN','Active/Disactive\x20Campaign','INTEGER','UNSIGNED','Max\x20200\x20calls.','Originate\x20Timeout\x20Seconds\x20(min:1,\x20max:999)','#Congestion\x20Retry\x20(min:1,\x20max:999)','Congestion\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Busy\x20Retry\x20(min:1,\x20max:999)','NoAnswer\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','always','never','onlyIfOpen','Active/Disactive\x20AMD','#AMD\x20Initial\x20Silence','#AMD\x20After\x20Greeting\x20Silence','#AMD\x20Min\x20Word\x20Length','#AMD\x20Between\x20Words\x20Silence','#AMD\x20Silence\x20Threshold\x20(min:0,\x20max:32767)','#AMD\x20Maximum\x20Word\x20Length','DESC','ASC','Random\x20Last\x20Digit\x20(min:1,\x20max:15)','Cut\x20Digit\x20(min:1,\x20max:15)','NoSuchNumber\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','Drop\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','Abandoned\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'];(function(_0x37b8a8,_0x4735a4){var _0x247770=function(_0x2c702a){while(--_0x2c702a){_0x37b8a8['push'](_0x37b8a8['shift']());}};_0x247770(++_0x4735a4);}(_0x1e87,0x162));var _0x71e8=function(_0x2b5a41,_0x5ac813){_0x2b5a41=_0x2b5a41-0x0;var _0x50f282=_0x1e87[_0x2b5a41];return _0x50f282;};'use strict';var Sequelize=require('sequelize');module[_0x71e8('0x0')]={'name':{'type':Sequelize['STRING'],'unique':'name','allowNull':![],'validate':{'is':/[A-Za-z0-9._\\+*!-]+/,'notEmpty':!![]}},'type':{'type':Sequelize[_0x71e8('0x1')](_0x71e8('0x2')),'allowNull':![],'defaultValue':_0x71e8('0x2')},'description':{'type':Sequelize[_0x71e8('0x3')]},'active':{'type':Sequelize[_0x71e8('0x4')],'defaultValue':0x0,'comment':_0x71e8('0x5')},'limitCalls':{'type':Sequelize[_0x71e8('0x6')](0x4)[_0x71e8('0x7')],'defaultValue':0x1e,'validate':{'min':0x1,'max':0xc8},'comment':_0x71e8('0x8')},'dialOriginateCallerIdName':{'type':Sequelize[_0x71e8('0x3')]},'dialOriginateCallerIdNumber':{'type':Sequelize[_0x71e8('0x3')]},'dialOriginateTimeout':{'type':Sequelize['INTEGER'](0x3)[_0x71e8('0x7')],'defaultValue':0x1e,'validate':{'min':0x1,'max':0x3e7},'comment':_0x71e8('0x9')},'dialCongestionMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0x71e8('0x7')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x71e8('0xa')},'dialCongestionRetryFrequency':{'type':Sequelize['INTEGER'](0x5)[_0x71e8('0x7')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x71e8('0xb')},'dialBusyMaxRetry':{'type':Sequelize[_0x71e8('0x6')](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x71e8('0xc')},'dialBusyRetryFrequency':{'type':Sequelize[_0x71e8('0x6')](0x5)[_0x71e8('0x7')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'Busy\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialNoAnswerMaxRetry':{'type':Sequelize[_0x71e8('0x6')](0x3)[_0x71e8('0x7')],'defaultValue':0x3,'comment':'#NoAnswer\x20Retry\x20(min:1,\x20max:999)'},'dialNoAnswerRetryFrequency':{'type':Sequelize['INTEGER'](0x5)[_0x71e8('0x7')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x71e8('0xd')},'dialGlobalMaxRetry':{'type':Sequelize[_0x71e8('0x6')](0x3)[_0x71e8('0x7')],'validate':{'min':0x1,'max':0x3e7},'defaultValue':0x4,'comment':'#Global\x20Max\x20Retry\x20(min:1,\x20max:999)'},'dialTimezone':{'type':Sequelize[_0x71e8('0x3')],'defaultValue':null},'dialGlobalInterval':{'type':Sequelize[_0x71e8('0x3')],'defaultValue':'07:00-22:00,*,*,*'},'dialCheckDuplicateType':{'type':Sequelize[_0x71e8('0x1')](_0x71e8('0xe'),_0x71e8('0xf'),_0x71e8('0x10')),'defaultValue':'always'},'dialAMDActive':{'type':Sequelize['BOOLEAN'],'defaultValue':0x0,'comment':_0x71e8('0x11')},'dialAMDInitialSilence':{'type':Sequelize[_0x71e8('0x6')](0x9)[_0x71e8('0x7')],'defaultValue':0x9c4,'validate':{'min':0x0},'comment':_0x71e8('0x12')},'dialAMDGreeting':{'type':Sequelize[_0x71e8('0x6')](0x9)[_0x71e8('0x7')],'defaultValue':0x5dc,'validate':{'min':0x0},'comment':'#AMD\x20Greeting'},'dialAMDAfterGreetingSilence':{'type':Sequelize[_0x71e8('0x6')](0x9)['UNSIGNED'],'defaultValue':0x320,'validate':{'min':0x0},'comment':_0x71e8('0x13')},'dialAMDTotalAnalysisTime':{'type':Sequelize['INTEGER'](0x9)[_0x71e8('0x7')],'defaultValue':0x1388,'validate':{'min':0x0},'comment':'#AMD\x20Total\x20Analysis\x20Time'},'dialAMDMinWordLength':{'type':Sequelize['INTEGER'](0x9)[_0x71e8('0x7')],'defaultValue':0x64,'validate':{'min':0x0},'comment':_0x71e8('0x14')},'dialAMDBetweenWordsSilence':{'type':Sequelize[_0x71e8('0x6')](0x9)['UNSIGNED'],'defaultValue':0x32,'validate':{'min':0x0},'comment':_0x71e8('0x15')},'dialAMDMaximumNumberOfWords':{'type':Sequelize[_0x71e8('0x6')](0x9)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x0},'comment':'#AMD\x20Maximum\x20Number\x20Of\x20Words'},'dialAMDSilenceThreshold':{'type':Sequelize['INTEGER'](0x5)[_0x71e8('0x7')],'validate':{'min':0x0,'max':0x7fff},'defaultValue':0x100,'comment':_0x71e8('0x16')},'dialAMDMaximumWordLength':{'type':Sequelize[_0x71e8('0x6')](0x9)[_0x71e8('0x7')],'defaultValue':0x1388,'validate':{'min':0x0},'comment':_0x71e8('0x17')},'dialOrderByScheduledAt':{'type':Sequelize[_0x71e8('0x1')](_0x71e8('0x18'),_0x71e8('0x19')),'defaultValue':_0x71e8('0x18')},'dialPrefix':{'type':Sequelize['STRING'],'defaultValue':null},'dialRandomLastDigitCallerIdNumber':{'type':Sequelize[_0x71e8('0x6')](0x3)[_0x71e8('0x7')],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':_0x71e8('0x1a')},'dialCutDigit':{'type':Sequelize[_0x71e8('0x6')](0x3)['UNSIGNED'],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':_0x71e8('0x1b')},'dialNoSuchNumberMaxRetry':{'type':Sequelize[_0x71e8('0x6')](0x3)[_0x71e8('0x7')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#NoSuchNumber\x20Retry\x20(min:1,\x20max:999)'},'dialNoSuchNumberRetryFrequency':{'type':Sequelize[_0x71e8('0x6')](0x5)[_0x71e8('0x7')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x71e8('0x1c')},'dialDropMaxRetry':{'type':Sequelize[_0x71e8('0x6')](0x3)[_0x71e8('0x7')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#Drop\x20Retry\x20(min:1,\x20max:999)'},'dialDropRetryFrequency':{'type':Sequelize['INTEGER'](0x5)[_0x71e8('0x7')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x71e8('0x1d')},'dialAbandonedMaxRetry':{'type':Sequelize[_0x71e8('0x6')](0x3)[_0x71e8('0x7')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#Abandoned\x20Retry\x20(min:1,\x20max:999)'},'dialAbandonedRetryFrequency':{'type':Sequelize[_0x71e8('0x6')](0x5)[_0x71e8('0x7')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x71e8('0x1e')},'dialMachineMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0x71e8('0x7')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x71e8('0x1f')},'dialMachineRetryFrequency':{'type':Sequelize[_0x71e8('0x6')](0x5)[_0x71e8('0x7')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x71e8('0x20')},'dialAgentRejectMaxRetry':{'type':Sequelize[_0x71e8('0x6')](0x3)[_0x71e8('0x7')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x71e8('0x21')},'dialAgentRejectRetryFrequency':{'type':Sequelize[_0x71e8('0x6')](0x5)[_0x71e8('0x7')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x71e8('0x22')}};
\ No newline at end of file
+var _0x04e4=['Originate\x20Timeout\x20Seconds\x20(min:1,\x20max:999)','UNSIGNED','#Congestion\x20Retry\x20(min:1,\x20max:999)','Congestion\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Busy\x20Retry\x20(min:1,\x20max:999)','Busy\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#NoAnswer\x20Retry\x20(min:1,\x20max:999)','NoAnswer\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Global\x20Max\x20Retry\x20(min:1,\x20max:999)','07:00-22:00,*,*,*','always','never','onlyIfOpen','Active/Disactive\x20AMD','#AMD\x20Greeting','#AMD\x20After\x20Greeting\x20Silence','#AMD\x20Total\x20Analysis\x20Time','#AMD\x20Between\x20Words\x20Silence','#AMD\x20Maximum\x20Word\x20Length','DESC','ASC','Random\x20Last\x20Digit\x20(min:1,\x20max:15)','Cut\x20Digit\x20(min:1,\x20max:15)','NoSuchNumber\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Drop\x20Retry\x20(min:1,\x20max:999)','#Abandoned\x20Retry\x20(min:1,\x20max:999)','#Machine\x20Retry\x20(min:1,\x20max:999)','Machine\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#AgentReject\x20Retry\x20(min:1,\x20max:999)','AgentReject\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','sequelize','exports','STRING','name','ENUM','ivr','BOOLEAN','INTEGER','Max\x20200\x20calls.'];(function(_0x2556f6,_0x40cb2d){var _0x249844=function(_0xe33268){while(--_0xe33268){_0x2556f6['push'](_0x2556f6['shift']());}};_0x249844(++_0x40cb2d);}(_0x04e4,0x17d));var _0x404e=function(_0x2d83be,_0x2cb3f1){_0x2d83be=_0x2d83be-0x0;var _0x6e5c60=_0x04e4[_0x2d83be];return _0x6e5c60;};'use strict';var Sequelize=require(_0x404e('0x0'));module[_0x404e('0x1')]={'name':{'type':Sequelize[_0x404e('0x2')],'unique':_0x404e('0x3'),'allowNull':![],'validate':{'is':/[A-Za-z0-9._\\+*!-]+/,'notEmpty':!![]}},'type':{'type':Sequelize[_0x404e('0x4')]('ivr'),'allowNull':![],'defaultValue':_0x404e('0x5')},'description':{'type':Sequelize[_0x404e('0x2')]},'active':{'type':Sequelize[_0x404e('0x6')],'defaultValue':0x0,'comment':'Active/Disactive\x20Campaign'},'limitCalls':{'type':Sequelize[_0x404e('0x7')](0x4)['UNSIGNED'],'defaultValue':0x1e,'validate':{'min':0x1,'max':0xc8},'comment':_0x404e('0x8')},'dialOriginateCallerIdName':{'type':Sequelize['STRING']},'dialOriginateCallerIdNumber':{'type':Sequelize[_0x404e('0x2')]},'dialOriginateTimeout':{'type':Sequelize[_0x404e('0x7')](0x3)['UNSIGNED'],'defaultValue':0x1e,'validate':{'min':0x1,'max':0x3e7},'comment':_0x404e('0x9')},'dialCongestionMaxRetry':{'type':Sequelize[_0x404e('0x7')](0x3)[_0x404e('0xa')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x404e('0xb')},'dialCongestionRetryFrequency':{'type':Sequelize[_0x404e('0x7')](0x5)[_0x404e('0xa')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x404e('0xc')},'dialBusyMaxRetry':{'type':Sequelize[_0x404e('0x7')](0x3)[_0x404e('0xa')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x404e('0xd')},'dialBusyRetryFrequency':{'type':Sequelize[_0x404e('0x7')](0x5)[_0x404e('0xa')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x404e('0xe')},'dialNoAnswerMaxRetry':{'type':Sequelize[_0x404e('0x7')](0x3)[_0x404e('0xa')],'defaultValue':0x3,'comment':_0x404e('0xf')},'dialNoAnswerRetryFrequency':{'type':Sequelize[_0x404e('0x7')](0x5)[_0x404e('0xa')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x404e('0x10')},'dialGlobalMaxRetry':{'type':Sequelize[_0x404e('0x7')](0x3)['UNSIGNED'],'validate':{'min':0x1,'max':0x3e7},'defaultValue':0x4,'comment':_0x404e('0x11')},'dialTimezone':{'type':Sequelize[_0x404e('0x2')],'defaultValue':null},'dialGlobalInterval':{'type':Sequelize[_0x404e('0x2')],'defaultValue':_0x404e('0x12')},'dialCheckDuplicateType':{'type':Sequelize[_0x404e('0x4')](_0x404e('0x13'),_0x404e('0x14'),_0x404e('0x15')),'defaultValue':_0x404e('0x13')},'dialAMDActive':{'type':Sequelize['BOOLEAN'],'defaultValue':0x0,'comment':_0x404e('0x16')},'dialAMDInitialSilence':{'type':Sequelize[_0x404e('0x7')](0x9)[_0x404e('0xa')],'defaultValue':0x9c4,'validate':{'min':0x0},'comment':'#AMD\x20Initial\x20Silence'},'dialAMDGreeting':{'type':Sequelize['INTEGER'](0x9)[_0x404e('0xa')],'defaultValue':0x5dc,'validate':{'min':0x0},'comment':_0x404e('0x17')},'dialAMDAfterGreetingSilence':{'type':Sequelize[_0x404e('0x7')](0x9)['UNSIGNED'],'defaultValue':0x320,'validate':{'min':0x0},'comment':_0x404e('0x18')},'dialAMDTotalAnalysisTime':{'type':Sequelize['INTEGER'](0x9)[_0x404e('0xa')],'defaultValue':0x1388,'validate':{'min':0x0},'comment':_0x404e('0x19')},'dialAMDMinWordLength':{'type':Sequelize['INTEGER'](0x9)[_0x404e('0xa')],'defaultValue':0x64,'validate':{'min':0x0},'comment':'#AMD\x20Min\x20Word\x20Length'},'dialAMDBetweenWordsSilence':{'type':Sequelize['INTEGER'](0x9)[_0x404e('0xa')],'defaultValue':0x32,'validate':{'min':0x0},'comment':_0x404e('0x1a')},'dialAMDMaximumNumberOfWords':{'type':Sequelize['INTEGER'](0x9)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x0},'comment':'#AMD\x20Maximum\x20Number\x20Of\x20Words'},'dialAMDSilenceThreshold':{'type':Sequelize[_0x404e('0x7')](0x5)[_0x404e('0xa')],'validate':{'min':0x0,'max':0x7fff},'defaultValue':0x100,'comment':'#AMD\x20Silence\x20Threshold\x20(min:0,\x20max:32767)'},'dialAMDMaximumWordLength':{'type':Sequelize[_0x404e('0x7')](0x9)[_0x404e('0xa')],'defaultValue':0x1388,'validate':{'min':0x0},'comment':_0x404e('0x1b')},'dialOrderByScheduledAt':{'type':Sequelize[_0x404e('0x4')](_0x404e('0x1c'),_0x404e('0x1d')),'defaultValue':_0x404e('0x1c')},'dialPrefix':{'type':Sequelize[_0x404e('0x2')],'defaultValue':null},'dialRandomLastDigitCallerIdNumber':{'type':Sequelize[_0x404e('0x7')](0x3)[_0x404e('0xa')],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':_0x404e('0x1e')},'dialCutDigit':{'type':Sequelize[_0x404e('0x7')](0x3)[_0x404e('0xa')],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':_0x404e('0x1f')},'dialNoSuchNumberMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0x404e('0xa')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#NoSuchNumber\x20Retry\x20(min:1,\x20max:999)'},'dialNoSuchNumberRetryFrequency':{'type':Sequelize[_0x404e('0x7')](0x5)[_0x404e('0xa')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x404e('0x20')},'dialDropMaxRetry':{'type':Sequelize[_0x404e('0x7')](0x3)[_0x404e('0xa')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x404e('0x21')},'dialDropRetryFrequency':{'type':Sequelize[_0x404e('0x7')](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'Drop\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialAbandonedMaxRetry':{'type':Sequelize[_0x404e('0x7')](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x404e('0x22')},'dialAbandonedRetryFrequency':{'type':Sequelize[_0x404e('0x7')](0x5)[_0x404e('0xa')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'Abandoned\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialMachineMaxRetry':{'type':Sequelize[_0x404e('0x7')](0x3)[_0x404e('0xa')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x404e('0x23')},'dialMachineRetryFrequency':{'type':Sequelize['INTEGER'](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x404e('0x24')},'dialAgentRejectMaxRetry':{'type':Sequelize[_0x404e('0x7')](0x3)[_0x404e('0xa')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x404e('0x25')},'dialAgentRejectRetryFrequency':{'type':Sequelize['INTEGER'](0x5)[_0x404e('0xa')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x404e('0x26')}};
\ No newline at end of file
diff --git a/server/api/campaign/campaign.controller.js b/server/api/campaign/campaign.controller.js
index fe892b2..308b878 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 _0xd3f6=['Content-Range','apply','reject','save','update','then','destroy','get','IvrCampaigns','UserProfileResource','error','stack','name','send','index','map','rawAttributes','fieldName','type','model','query','intersection','attributes','fields','length','hasOwnProperty','nolimit','limit','order','sort','filters','pick','filter','where','merge','VIRTUAL','Campaign','includeAll','include','findAll','rows','catch','show','params','keys','options','find','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','clone','omit','createdAt','updatedAt','create','role','autoAssociation','getHoppers','findOne','CmHopper','getHopperHistories','CmHopperHistory','CampaignId','getHopperFinals','CmHopperFinal','getHopperBlacks','CmHopperBlack','getLists','addLists','ids','spread','dialCheckDuplicateType','always','insert','into','fromQuery','phone','ContactId','ListId','select','field','NOW()','scheduledAt','CmListId','toString','from','cm_contacts','deletedAt\x20IS\x20NULL','ListId\x20=\x20?','phone\x20IS\x20NOT\x20NULL','phone\x20NOT\x20IN\x20(?)','COALESCE(calleridnum,\x27\x27)','CampaignId\x20=\x20?','cm_hopper','COALESCE(phone,\x27\x27)','push','sequelize','removeLists','getBlackLists','CmList','addBlackLists','cm_hopper_black','removeBlackLists','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','jsforce','querystring','papaparse','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','count','set'];(function(_0x2ec461,_0x5f588a){var _0x28603d=function(_0x21114b){while(--_0x21114b){_0x2ec461['push'](_0x2ec461['shift']());}};_0x28603d(++_0x5f588a);}(_0xd3f6,0x6a));var _0x6d3f=function(_0x55a89e,_0x1a05ab){_0x55a89e=_0x55a89e-0x0;var _0x3aa2bd=_0xd3f6[_0x55a89e];return _0x3aa2bd;};'use strict';var emlformat=require(_0x6d3f('0x0'));var rimraf=require(_0x6d3f('0x1'));var zipdir=require(_0x6d3f('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x6d3f('0x3'));var moment=require(_0x6d3f('0x4'));var BPromise=require(_0x6d3f('0x5'));var Mustache=require(_0x6d3f('0x6'));var util=require(_0x6d3f('0x7'));var path=require(_0x6d3f('0x8'));var sox=require(_0x6d3f('0x9'));var csv=require(_0x6d3f('0xa'));var ejs=require(_0x6d3f('0xb'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x6d3f('0xc'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x6d3f('0xd'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x6d3f('0xe'));var Papa=require(_0x6d3f('0xf'));var Redis=require('ioredis');var authService=require(_0x6d3f('0x10'));var qs=require('../../components/parsers/qs');var as=require(_0x6d3f('0x11'));var hardwareService=require(_0x6d3f('0x12'));var logger=require(_0x6d3f('0x13'))(_0x6d3f('0x14'));var utils=require(_0x6d3f('0x15'));var config=require(_0x6d3f('0x16'));var licenseUtil=require(_0x6d3f('0x17'));var db=require(_0x6d3f('0x18'))['db'];function respondWithStatusCode(_0x110010,_0x382579){_0x382579=_0x382579||0xcc;return function(_0x4fab1b){if(_0x4fab1b){return _0x110010[_0x6d3f('0x19')](_0x382579);}return _0x110010[_0x6d3f('0x1a')](_0x382579)[_0x6d3f('0x1b')]();};}function respondWithResult(_0x2a8310,_0x2887ff){_0x2887ff=_0x2887ff||0xc8;return function(_0x2b4d69){if(_0x2b4d69){return _0x2a8310[_0x6d3f('0x1a')](_0x2887ff)[_0x6d3f('0x1c')](_0x2b4d69);}};}function respondWithFilteredResult(_0x4c4cd8,_0xe3124){return function(_0x4098e5){if(_0x4098e5){var _0x1fbc0c=typeof _0xe3124[_0x6d3f('0x1d')]===_0x6d3f('0x1e')&&typeof _0xe3124['limit']===_0x6d3f('0x1e');var _0x3effcc=_0x4098e5[_0x6d3f('0x1f')];var _0x273f2e=_0x1fbc0c?0x0:_0xe3124[_0x6d3f('0x1d')];var _0x313736=_0x1fbc0c?_0x4098e5[_0x6d3f('0x1f')]:_0xe3124[_0x6d3f('0x1d')]+_0xe3124['limit'];var _0x545258;if(_0x313736>=_0x3effcc){_0x313736=_0x3effcc;_0x545258=0xc8;}else{_0x545258=0xce;}_0x4c4cd8[_0x6d3f('0x1a')](_0x545258);return _0x4c4cd8[_0x6d3f('0x20')](_0x6d3f('0x21'),_0x273f2e+'-'+_0x313736+'/'+_0x3effcc)[_0x6d3f('0x1c')](_0x4098e5);}return null;};}function patchUpdates(_0x515e03){return function(_0x31e522){try{jsonpatch[_0x6d3f('0x22')](_0x31e522,_0x515e03,!![]);}catch(_0x380bde){return BPromise[_0x6d3f('0x23')](_0x380bde);}return _0x31e522[_0x6d3f('0x24')]();};}function saveUpdates(_0x580d7d,_0x216b8c){return function(_0x17d291){if(_0x17d291){return _0x17d291[_0x6d3f('0x25')](_0x580d7d)[_0x6d3f('0x26')](function(_0x2e472b){return _0x2e472b;});}return null;};}function removeEntity(_0x44599c,_0x38428b){return function(_0x40d0ee){if(_0x40d0ee){return _0x40d0ee[_0x6d3f('0x27')]()[_0x6d3f('0x26')](function(){var _0x24c0b8=_0x40d0ee[_0x6d3f('0x28')]({'plain':!![]});var _0x2c1f4e=_0x6d3f('0x29');return db[_0x6d3f('0x2a')]['destroy']({'where':{'type':_0x2c1f4e,'resourceId':_0x24c0b8['id']}})[_0x6d3f('0x26')](function(){return _0x40d0ee;});})['then'](function(){_0x44599c[_0x6d3f('0x1a')](0xcc)[_0x6d3f('0x1b')]();});}};}function handleEntityNotFound(_0x160c03,_0x238f29){return function(_0x71e35e){if(!_0x71e35e){_0x160c03[_0x6d3f('0x19')](0x194);}return _0x71e35e;};}function handleError(_0x9d8daf,_0x3c5445){_0x3c5445=_0x3c5445||0x1f4;return function(_0x36ff20){logger[_0x6d3f('0x2b')](_0x36ff20[_0x6d3f('0x2c')]);if(_0x36ff20[_0x6d3f('0x2d')]){delete _0x36ff20['name'];}_0x9d8daf[_0x6d3f('0x1a')](_0x3c5445)[_0x6d3f('0x2e')](_0x36ff20);};}exports[_0x6d3f('0x2f')]=function(_0x470019,_0x40754e){var _0x17b983={},_0x161771={},_0x49ee16={'count':0x0,'rows':[]};var _0x217753=_[_0x6d3f('0x30')](db['Campaign'][_0x6d3f('0x31')],function(_0x5e8234){return{'name':_0x5e8234[_0x6d3f('0x32')],'type':_0x5e8234[_0x6d3f('0x33')]['key']};});_0x161771[_0x6d3f('0x34')]=_['map'](_0x217753,_0x6d3f('0x2d'));_0x161771[_0x6d3f('0x35')]=_['keys'](_0x470019['query']);_0x161771['filters']=_[_0x6d3f('0x36')](_0x161771[_0x6d3f('0x34')],_0x161771['query']);_0x17b983[_0x6d3f('0x37')]=_[_0x6d3f('0x36')](_0x161771[_0x6d3f('0x34')],qs[_0x6d3f('0x38')](_0x470019[_0x6d3f('0x35')]['fields']));_0x17b983['attributes']=_0x17b983[_0x6d3f('0x37')][_0x6d3f('0x39')]?_0x17b983[_0x6d3f('0x37')]:_0x161771[_0x6d3f('0x34')];if(!_0x470019[_0x6d3f('0x35')][_0x6d3f('0x3a')](_0x6d3f('0x3b'))){_0x17b983['limit']=qs[_0x6d3f('0x3c')](_0x470019[_0x6d3f('0x35')][_0x6d3f('0x3c')]);_0x17b983[_0x6d3f('0x1d')]=qs[_0x6d3f('0x1d')](_0x470019['query']['offset']);}_0x17b983[_0x6d3f('0x3d')]=qs[_0x6d3f('0x3e')](_0x470019[_0x6d3f('0x35')]['sort']);_0x17b983['where']=qs[_0x6d3f('0x3f')](_[_0x6d3f('0x40')](_0x470019[_0x6d3f('0x35')],_0x161771[_0x6d3f('0x3f')]),_0x217753);if(_0x470019['query'][_0x6d3f('0x41')]){_0x17b983[_0x6d3f('0x42')]=_[_0x6d3f('0x43')](_0x17b983[_0x6d3f('0x42')],{'$or':_[_0x6d3f('0x30')](_0x217753,function(_0x2be777){if(_0x2be777[_0x6d3f('0x33')]!==_0x6d3f('0x44')){var _0x4f2a14={};_0x4f2a14[_0x2be777[_0x6d3f('0x2d')]]={'$like':'%'+_0x470019[_0x6d3f('0x35')][_0x6d3f('0x41')]+'%'};return _0x4f2a14;}})});}_0x17b983=_[_0x6d3f('0x43')]({},_0x17b983,_0x470019['options']);var _0x388df2={'where':_0x17b983[_0x6d3f('0x42')]};return db[_0x6d3f('0x45')]['count'](_0x388df2)[_0x6d3f('0x26')](function(_0x5d1c43){_0x49ee16[_0x6d3f('0x1f')]=_0x5d1c43;if(_0x470019[_0x6d3f('0x35')][_0x6d3f('0x46')]){_0x17b983[_0x6d3f('0x47')]=[{'all':!![]}];}return db[_0x6d3f('0x45')][_0x6d3f('0x48')](_0x17b983);})[_0x6d3f('0x26')](function(_0x33b251){_0x49ee16[_0x6d3f('0x49')]=_0x33b251;return _0x49ee16;})[_0x6d3f('0x26')](respondWithFilteredResult(_0x40754e,_0x17b983))[_0x6d3f('0x4a')](handleError(_0x40754e,null));};exports[_0x6d3f('0x4b')]=function(_0x1043e4,_0x4d0fd3){var _0x52c636={'raw':![],'where':{'id':_0x1043e4[_0x6d3f('0x4c')]['id']}},_0x42a3ca={};_0x42a3ca[_0x6d3f('0x34')]=_[_0x6d3f('0x4d')](db[_0x6d3f('0x45')]['rawAttributes']);_0x42a3ca['query']=_[_0x6d3f('0x4d')](_0x1043e4['query']);_0x42a3ca[_0x6d3f('0x3f')]=_[_0x6d3f('0x36')](_0x42a3ca[_0x6d3f('0x34')],_0x42a3ca['query']);_0x52c636['attributes']=_['intersection'](_0x42a3ca['model'],qs[_0x6d3f('0x38')](_0x1043e4['query'][_0x6d3f('0x38')]));_0x52c636[_0x6d3f('0x37')]=_0x52c636[_0x6d3f('0x37')][_0x6d3f('0x39')]?_0x52c636['attributes']:_0x42a3ca[_0x6d3f('0x34')];if(_0x1043e4[_0x6d3f('0x35')][_0x6d3f('0x46')]){_0x52c636[_0x6d3f('0x47')]=[{'all':!![]}];}_0x52c636=_[_0x6d3f('0x43')]({},_0x52c636,_0x1043e4[_0x6d3f('0x4e')]);return db[_0x6d3f('0x45')][_0x6d3f('0x4f')](_0x52c636)[_0x6d3f('0x26')](handleEntityNotFound(_0x4d0fd3,null))[_0x6d3f('0x26')](respondWithResult(_0x4d0fd3,null))[_0x6d3f('0x4a')](handleError(_0x4d0fd3,null));};exports['create']=function(_0x1ff459,_0x474d98){return db['Campaign']['create'](_0x1ff459[_0x6d3f('0x50')],{})[_0x6d3f('0x26')](function(_0x2aa8a9){var _0x3f8cce=_0x1ff459[_0x6d3f('0x51')][_0x6d3f('0x28')]({'plain':!![]});if(!_0x3f8cce)throw new Error(_0x6d3f('0x52'));if(_0x3f8cce['role']===_0x6d3f('0x51')){var _0x4d9121=_0x2aa8a9[_0x6d3f('0x28')]({'plain':!![]});var _0x1ce10d=_0x6d3f('0x29');return db[_0x6d3f('0x53')][_0x6d3f('0x4f')]({'where':{'name':_0x1ce10d,'userProfileId':_0x3f8cce[_0x6d3f('0x54')]},'raw':!![]})[_0x6d3f('0x26')](function(_0x280497){if(_0x280497&&_0x280497['autoAssociation']===0x0){return db[_0x6d3f('0x2a')]['create']({'name':_0x4d9121['name'],'resourceId':_0x4d9121['id'],'type':_0x280497[_0x6d3f('0x2d')],'sectionId':_0x280497['id']},{})[_0x6d3f('0x26')](function(){return _0x2aa8a9;});}else{return _0x2aa8a9;}})[_0x6d3f('0x4a')](function(_0x5cfafb){logger[_0x6d3f('0x2b')](_0x6d3f('0x55'),_0x5cfafb);throw _0x5cfafb;});}return _0x2aa8a9;})['then'](respondWithResult(_0x474d98,0xc9))['catch'](handleError(_0x474d98,null));};exports[_0x6d3f('0x56')]=function(_0x4b70db,_0x570a53){var _0x223c79={'where':{'id':_0x4b70db[_0x6d3f('0x4c')]['id']}},_0x443813={};_0x443813[_0x6d3f('0x34')]=_['keys'](db['Campaign']['rawAttributes']);_0x223c79['attributes']=_[_0x6d3f('0x36')](_0x443813['model'],qs[_0x6d3f('0x38')](_0x4b70db[_0x6d3f('0x35')][_0x6d3f('0x38')]));_0x223c79[_0x6d3f('0x37')]=_0x223c79[_0x6d3f('0x37')]['length']?_0x223c79[_0x6d3f('0x37')]:_0x443813['model'];if(_0x4b70db[_0x6d3f('0x35')][_0x6d3f('0x46')]){_0x223c79[_0x6d3f('0x47')]=[{'all':!![]}];}_0x223c79=_[_0x6d3f('0x43')]({},_0x223c79,_0x4b70db['options']);return db[_0x6d3f('0x45')][_0x6d3f('0x4f')](_0x223c79)[_0x6d3f('0x26')](handleEntityNotFound(_0x570a53,null))[_0x6d3f('0x26')](function(_0x27cf83){if(_0x27cf83){var _0x528905=_0x27cf83[_0x6d3f('0x28')]({'plain':!![]});_0x528905=qs[_0x6d3f('0x57')](_0x528905,['id',_0x6d3f('0x58'),'updatedAt']);_0x4b70db[_0x6d3f('0x50')]=_[_0x6d3f('0x57')](_0x4b70db[_0x6d3f('0x50')],['id',_0x6d3f('0x58'),_0x6d3f('0x59')]);return db[_0x6d3f('0x45')][_0x6d3f('0x5a')](_[_0x6d3f('0x43')](_0x528905,_0x4b70db[_0x6d3f('0x50')]),{'include':_0x4b70db[_0x6d3f('0x35')][_0x6d3f('0x46')]?[{'all':!![]}]:undefined})['then'](function(_0x1c9202){var _0x1d8289=_0x4b70db[_0x6d3f('0x51')][_0x6d3f('0x28')]({'plain':!![]});if(!_0x1d8289)throw new Error(_0x6d3f('0x52'));if(_0x1d8289[_0x6d3f('0x5b')]===_0x6d3f('0x51')){var _0x2e3410=_0x1c9202[_0x6d3f('0x28')]({'plain':!![]});var _0x4a5237='IvrCampaigns';return db['UserProfileSection'][_0x6d3f('0x4f')]({'where':{'name':_0x4a5237,'userProfileId':_0x1d8289[_0x6d3f('0x54')]},'raw':!![]})[_0x6d3f('0x26')](function(_0xbb8d20){if(_0xbb8d20&&_0xbb8d20[_0x6d3f('0x5c')]===0x0){return db[_0x6d3f('0x2a')]['create']({'name':_0x2e3410['name'],'resourceId':_0x2e3410['id'],'type':_0xbb8d20[_0x6d3f('0x2d')],'sectionId':_0xbb8d20['id']},{})[_0x6d3f('0x26')](function(){return _0x1c9202;});}else{return _0x1c9202;}})[_0x6d3f('0x4a')](function(_0x1d4217){logger[_0x6d3f('0x2b')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x1d4217);throw _0x1d4217;});}return _0x1c9202;});}})[_0x6d3f('0x26')](respondWithResult(_0x570a53,0xc9))[_0x6d3f('0x4a')](handleError(_0x570a53,null));};exports['update']=function(_0x39f23d,_0x7c9aaf){if(_0x39f23d['body']['id']){delete _0x39f23d[_0x6d3f('0x50')]['id'];}return db[_0x6d3f('0x45')][_0x6d3f('0x4f')]({'where':{'id':_0x39f23d[_0x6d3f('0x4c')]['id']}})[_0x6d3f('0x26')](handleEntityNotFound(_0x7c9aaf,null))['then'](saveUpdates(_0x39f23d[_0x6d3f('0x50')],null))[_0x6d3f('0x26')](respondWithResult(_0x7c9aaf,null))[_0x6d3f('0x4a')](handleError(_0x7c9aaf,null));};exports[_0x6d3f('0x27')]=function(_0xaee091,_0x212f84){return db[_0x6d3f('0x45')][_0x6d3f('0x4f')]({'where':{'id':_0xaee091[_0x6d3f('0x4c')]['id']}})[_0x6d3f('0x26')](handleEntityNotFound(_0x212f84,null))[_0x6d3f('0x26')](removeEntity(_0x212f84,null))[_0x6d3f('0x4a')](handleError(_0x212f84,null));};exports[_0x6d3f('0x5d')]=function(_0x3c2d29,_0x2934a3,_0x228fc5){var _0x35a24c={'raw':!![],'where':{}};var _0x3da96a={};var _0x3add03={'count':0x0,'rows':[]};return db[_0x6d3f('0x45')][_0x6d3f('0x5e')]({'where':{'id':_0x3c2d29['params']['id']}})['then'](handleEntityNotFound(_0x2934a3,null))[_0x6d3f('0x26')](function(_0x3eeabe){if(_0x3eeabe){_0x3da96a[_0x6d3f('0x34')]=_[_0x6d3f('0x4d')](db['CmHopper']['rawAttributes']);_0x3da96a['query']=_[_0x6d3f('0x4d')](_0x3c2d29[_0x6d3f('0x35')]);_0x3da96a[_0x6d3f('0x3f')]=_[_0x6d3f('0x36')](_0x3da96a[_0x6d3f('0x34')],_0x3da96a[_0x6d3f('0x35')]);_0x35a24c[_0x6d3f('0x37')]=_[_0x6d3f('0x36')](_0x3da96a[_0x6d3f('0x34')],qs[_0x6d3f('0x38')](_0x3c2d29[_0x6d3f('0x35')][_0x6d3f('0x38')]));_0x35a24c[_0x6d3f('0x37')]=_0x35a24c[_0x6d3f('0x37')][_0x6d3f('0x39')]?_0x35a24c[_0x6d3f('0x37')]:_0x3da96a['model'];if(!_0x3c2d29['query'][_0x6d3f('0x3a')](_0x6d3f('0x3b'))){_0x35a24c[_0x6d3f('0x3c')]=qs['limit'](_0x3c2d29['query']['limit']);_0x35a24c[_0x6d3f('0x1d')]=qs[_0x6d3f('0x1d')](_0x3c2d29[_0x6d3f('0x35')][_0x6d3f('0x1d')]);}_0x35a24c['order']=qs[_0x6d3f('0x3e')](_0x3c2d29[_0x6d3f('0x35')][_0x6d3f('0x3e')]);_0x35a24c['where']=qs[_0x6d3f('0x3f')](_[_0x6d3f('0x40')](_0x3c2d29[_0x6d3f('0x35')],_0x3da96a[_0x6d3f('0x3f')]));_0x35a24c[_0x6d3f('0x42')]['CampaignId']=_0x3eeabe['id'];if(_0x3c2d29['query']['filter']){_0x35a24c[_0x6d3f('0x42')]=_[_0x6d3f('0x43')](_0x35a24c[_0x6d3f('0x42')],{'$or':_[_0x6d3f('0x30')](_0x35a24c[_0x6d3f('0x37')],function(_0x4ab5b8){var _0x27bbfb={};_0x27bbfb[_0x4ab5b8]={'$like':'%'+_0x3c2d29[_0x6d3f('0x35')][_0x6d3f('0x41')]+'%'};return _0x27bbfb;})});}_0x35a24c=_['merge']({},_0x35a24c,_0x3c2d29[_0x6d3f('0x4e')]);return db[_0x6d3f('0x5f')]['count']({'where':_0x35a24c[_0x6d3f('0x42')]})[_0x6d3f('0x26')](function(_0x403544){_0x3add03[_0x6d3f('0x1f')]=_0x403544;if(_0x3c2d29['query'][_0x6d3f('0x46')]){_0x35a24c['include']=[{'all':!![]}];}return db['CmHopper']['findAll'](_0x35a24c);})[_0x6d3f('0x26')](function(_0x4272c5){_0x3add03[_0x6d3f('0x49')]=_0x4272c5;return _0x3add03;});}})[_0x6d3f('0x26')](respondWithFilteredResult(_0x2934a3,_0x35a24c))['catch'](handleError(_0x2934a3,null));};exports[_0x6d3f('0x60')]=function(_0x4805df,_0x47d6d1,_0x1497c4){var _0x4c8767={'raw':!![],'where':{}};var _0x5344f6={};var _0x2e0b3e={'count':0x0,'rows':[]};return db['Campaign'][_0x6d3f('0x5e')]({'where':{'id':_0x4805df[_0x6d3f('0x4c')]['id']}})['then'](handleEntityNotFound(_0x47d6d1,null))[_0x6d3f('0x26')](function(_0x3eb98f){if(_0x3eb98f){_0x5344f6['model']=_['keys'](db[_0x6d3f('0x61')][_0x6d3f('0x31')]);_0x5344f6[_0x6d3f('0x35')]=_[_0x6d3f('0x4d')](_0x4805df[_0x6d3f('0x35')]);_0x5344f6[_0x6d3f('0x3f')]=_['intersection'](_0x5344f6[_0x6d3f('0x34')],_0x5344f6[_0x6d3f('0x35')]);_0x4c8767['attributes']=_['intersection'](_0x5344f6[_0x6d3f('0x34')],qs['fields'](_0x4805df[_0x6d3f('0x35')]['fields']));_0x4c8767[_0x6d3f('0x37')]=_0x4c8767[_0x6d3f('0x37')][_0x6d3f('0x39')]?_0x4c8767[_0x6d3f('0x37')]:_0x5344f6['model'];if(!_0x4805df[_0x6d3f('0x35')][_0x6d3f('0x3a')](_0x6d3f('0x3b'))){_0x4c8767[_0x6d3f('0x3c')]=qs[_0x6d3f('0x3c')](_0x4805df[_0x6d3f('0x35')][_0x6d3f('0x3c')]);_0x4c8767['offset']=qs[_0x6d3f('0x1d')](_0x4805df[_0x6d3f('0x35')][_0x6d3f('0x1d')]);}_0x4c8767[_0x6d3f('0x3d')]=qs[_0x6d3f('0x3e')](_0x4805df[_0x6d3f('0x35')]['sort']);_0x4c8767[_0x6d3f('0x42')]=qs[_0x6d3f('0x3f')](_['pick'](_0x4805df['query'],_0x5344f6[_0x6d3f('0x3f')]));_0x4c8767[_0x6d3f('0x42')][_0x6d3f('0x62')]=_0x3eb98f['id'];if(_0x4805df['query']['filter']){_0x4c8767['where']=_['merge'](_0x4c8767[_0x6d3f('0x42')],{'$or':_[_0x6d3f('0x30')](_0x4c8767[_0x6d3f('0x37')],function(_0x316676){var _0x5284c5={};_0x5284c5[_0x316676]={'$like':'%'+_0x4805df['query'][_0x6d3f('0x41')]+'%'};return _0x5284c5;})});}_0x4c8767=_['merge']({},_0x4c8767,_0x4805df[_0x6d3f('0x4e')]);return db[_0x6d3f('0x61')]['count']({'where':_0x4c8767[_0x6d3f('0x42')]})[_0x6d3f('0x26')](function(_0x373c99){_0x2e0b3e[_0x6d3f('0x1f')]=_0x373c99;if(_0x4805df['query'][_0x6d3f('0x46')]){_0x4c8767[_0x6d3f('0x47')]=[{'all':!![]}];}return db[_0x6d3f('0x61')]['findAll'](_0x4c8767);})['then'](function(_0x1880eb){_0x2e0b3e[_0x6d3f('0x49')]=_0x1880eb;return _0x2e0b3e;});}})[_0x6d3f('0x26')](respondWithFilteredResult(_0x47d6d1,_0x4c8767))['catch'](handleError(_0x47d6d1,null));};exports[_0x6d3f('0x63')]=function(_0x13ee04,_0x45e430,_0x5a354d){var _0x52be23={'raw':!![],'where':{}};var _0x5e2dae={};var _0xfb228b={'count':0x0,'rows':[]};return db[_0x6d3f('0x45')][_0x6d3f('0x5e')]({'where':{'id':_0x13ee04['params']['id']}})['then'](handleEntityNotFound(_0x45e430,null))[_0x6d3f('0x26')](function(_0x49d03f){if(_0x49d03f){_0x5e2dae[_0x6d3f('0x34')]=_['keys'](db['CmHopperFinal'][_0x6d3f('0x31')]);_0x5e2dae['query']=_['keys'](_0x13ee04[_0x6d3f('0x35')]);_0x5e2dae['filters']=_[_0x6d3f('0x36')](_0x5e2dae[_0x6d3f('0x34')],_0x5e2dae[_0x6d3f('0x35')]);_0x52be23[_0x6d3f('0x37')]=_[_0x6d3f('0x36')](_0x5e2dae['model'],qs[_0x6d3f('0x38')](_0x13ee04[_0x6d3f('0x35')][_0x6d3f('0x38')]));_0x52be23[_0x6d3f('0x37')]=_0x52be23[_0x6d3f('0x37')]['length']?_0x52be23[_0x6d3f('0x37')]:_0x5e2dae['model'];if(!_0x13ee04[_0x6d3f('0x35')]['hasOwnProperty'](_0x6d3f('0x3b'))){_0x52be23['limit']=qs[_0x6d3f('0x3c')](_0x13ee04[_0x6d3f('0x35')][_0x6d3f('0x3c')]);_0x52be23[_0x6d3f('0x1d')]=qs[_0x6d3f('0x1d')](_0x13ee04[_0x6d3f('0x35')]['offset']);}_0x52be23[_0x6d3f('0x3d')]=qs[_0x6d3f('0x3e')](_0x13ee04[_0x6d3f('0x35')][_0x6d3f('0x3e')]);_0x52be23[_0x6d3f('0x42')]=qs[_0x6d3f('0x3f')](_[_0x6d3f('0x40')](_0x13ee04[_0x6d3f('0x35')],_0x5e2dae[_0x6d3f('0x3f')]));_0x52be23['where'][_0x6d3f('0x62')]=_0x49d03f['id'];if(_0x13ee04[_0x6d3f('0x35')][_0x6d3f('0x41')]){_0x52be23[_0x6d3f('0x42')]=_[_0x6d3f('0x43')](_0x52be23[_0x6d3f('0x42')],{'$or':_[_0x6d3f('0x30')](_0x52be23['attributes'],function(_0x218840){var _0x591d24={};_0x591d24[_0x218840]={'$like':'%'+_0x13ee04[_0x6d3f('0x35')]['filter']+'%'};return _0x591d24;})});}_0x52be23=_[_0x6d3f('0x43')]({},_0x52be23,_0x13ee04[_0x6d3f('0x4e')]);return db[_0x6d3f('0x64')][_0x6d3f('0x1f')]({'where':_0x52be23[_0x6d3f('0x42')]})['then'](function(_0x14d6d2){_0xfb228b[_0x6d3f('0x1f')]=_0x14d6d2;if(_0x13ee04[_0x6d3f('0x35')][_0x6d3f('0x46')]){_0x52be23['include']=[{'all':!![]}];}return db[_0x6d3f('0x64')][_0x6d3f('0x48')](_0x52be23);})[_0x6d3f('0x26')](function(_0x39420c){_0xfb228b[_0x6d3f('0x49')]=_0x39420c;return _0xfb228b;});}})['then'](respondWithFilteredResult(_0x45e430,_0x52be23))[_0x6d3f('0x4a')](handleError(_0x45e430,null));};exports[_0x6d3f('0x65')]=function(_0x5805ba,_0x31e9bc,_0x479e92){var _0x4d8cc2={'raw':!![],'where':{}};var _0x46b5e5={};var _0x2b0aa0={'count':0x0,'rows':[]};return db[_0x6d3f('0x45')][_0x6d3f('0x5e')]({'where':{'id':_0x5805ba[_0x6d3f('0x4c')]['id']}})['then'](handleEntityNotFound(_0x31e9bc,null))[_0x6d3f('0x26')](function(_0x59c808){if(_0x59c808){_0x46b5e5['model']=_['keys'](db[_0x6d3f('0x66')][_0x6d3f('0x31')]);_0x46b5e5['query']=_[_0x6d3f('0x4d')](_0x5805ba[_0x6d3f('0x35')]);_0x46b5e5['filters']=_[_0x6d3f('0x36')](_0x46b5e5[_0x6d3f('0x34')],_0x46b5e5[_0x6d3f('0x35')]);_0x4d8cc2[_0x6d3f('0x37')]=_[_0x6d3f('0x36')](_0x46b5e5[_0x6d3f('0x34')],qs[_0x6d3f('0x38')](_0x5805ba['query'][_0x6d3f('0x38')]));_0x4d8cc2[_0x6d3f('0x37')]=_0x4d8cc2[_0x6d3f('0x37')][_0x6d3f('0x39')]?_0x4d8cc2['attributes']:_0x46b5e5['model'];if(!_0x5805ba[_0x6d3f('0x35')][_0x6d3f('0x3a')](_0x6d3f('0x3b'))){_0x4d8cc2[_0x6d3f('0x3c')]=qs[_0x6d3f('0x3c')](_0x5805ba['query'][_0x6d3f('0x3c')]);_0x4d8cc2[_0x6d3f('0x1d')]=qs[_0x6d3f('0x1d')](_0x5805ba[_0x6d3f('0x35')][_0x6d3f('0x1d')]);}_0x4d8cc2[_0x6d3f('0x3d')]=qs[_0x6d3f('0x3e')](_0x5805ba[_0x6d3f('0x35')][_0x6d3f('0x3e')]);_0x4d8cc2[_0x6d3f('0x42')]=qs[_0x6d3f('0x3f')](_[_0x6d3f('0x40')](_0x5805ba[_0x6d3f('0x35')],_0x46b5e5['filters']));_0x4d8cc2[_0x6d3f('0x42')][_0x6d3f('0x62')]=_0x59c808['id'];if(_0x5805ba[_0x6d3f('0x35')][_0x6d3f('0x41')]){_0x4d8cc2[_0x6d3f('0x42')]=_[_0x6d3f('0x43')](_0x4d8cc2[_0x6d3f('0x42')],{'$or':_[_0x6d3f('0x30')](_0x4d8cc2[_0x6d3f('0x37')],function(_0x36c528){var _0x19748a={};_0x19748a[_0x36c528]={'$like':'%'+_0x5805ba[_0x6d3f('0x35')][_0x6d3f('0x41')]+'%'};return _0x19748a;})});}_0x4d8cc2=_[_0x6d3f('0x43')]({},_0x4d8cc2,_0x5805ba[_0x6d3f('0x4e')]);return db[_0x6d3f('0x66')][_0x6d3f('0x1f')]({'where':_0x4d8cc2[_0x6d3f('0x42')]})[_0x6d3f('0x26')](function(_0x50fcc0){_0x2b0aa0['count']=_0x50fcc0;if(_0x5805ba[_0x6d3f('0x35')]['includeAll']){_0x4d8cc2['include']=[{'all':!![]}];}return db[_0x6d3f('0x66')][_0x6d3f('0x48')](_0x4d8cc2);})['then'](function(_0x53c57a){_0x2b0aa0[_0x6d3f('0x49')]=_0x53c57a;return _0x2b0aa0;});}})[_0x6d3f('0x26')](respondWithFilteredResult(_0x31e9bc,_0x4d8cc2))[_0x6d3f('0x4a')](handleError(_0x31e9bc,null));};exports[_0x6d3f('0x67')]=function(_0x229a6d,_0x5c7da0,_0xf1ad88){var _0x39f533={};var _0x1117b6={};var _0x295cca;var _0x4c90c3;return db['Campaign'][_0x6d3f('0x5e')]({'where':{'id':_0x229a6d[_0x6d3f('0x4c')]['id']}})[_0x6d3f('0x26')](handleEntityNotFound(_0x5c7da0,null))[_0x6d3f('0x26')](function(_0x2a3034){if(_0x2a3034){_0x295cca=_0x2a3034;_0x1117b6[_0x6d3f('0x34')]=_['keys'](db['CmList'][_0x6d3f('0x31')]);_0x1117b6[_0x6d3f('0x35')]=_['keys'](_0x229a6d['query']);_0x1117b6['filters']=_[_0x6d3f('0x36')](_0x1117b6[_0x6d3f('0x34')],_0x1117b6[_0x6d3f('0x35')]);_0x39f533[_0x6d3f('0x37')]=_[_0x6d3f('0x36')](_0x1117b6['model'],qs[_0x6d3f('0x38')](_0x229a6d[_0x6d3f('0x35')][_0x6d3f('0x38')]));_0x39f533[_0x6d3f('0x37')]=_0x39f533[_0x6d3f('0x37')][_0x6d3f('0x39')]?_0x39f533[_0x6d3f('0x37')]:_0x1117b6[_0x6d3f('0x34')];_0x39f533[_0x6d3f('0x3d')]=qs[_0x6d3f('0x3e')](_0x229a6d[_0x6d3f('0x35')]['sort']);_0x39f533['where']=qs[_0x6d3f('0x3f')](_[_0x6d3f('0x40')](_0x229a6d['query'],_0x1117b6['filters']));if(_0x229a6d[_0x6d3f('0x35')][_0x6d3f('0x41')]){_0x39f533[_0x6d3f('0x42')]=_[_0x6d3f('0x43')](_0x39f533[_0x6d3f('0x42')],{'$or':_[_0x6d3f('0x30')](_0x39f533[_0x6d3f('0x37')],function(_0x5323e7){var _0x593999={};_0x593999[_0x5323e7]={'$like':'%'+_0x229a6d[_0x6d3f('0x35')][_0x6d3f('0x41')]+'%'};return _0x593999;})});}_0x39f533=_[_0x6d3f('0x43')]({},_0x39f533,_0x229a6d[_0x6d3f('0x4e')]);return _0x295cca['getLists'](_0x39f533);}})[_0x6d3f('0x26')](function(_0x3b49c2){if(_0x3b49c2){_0x4c90c3=_0x3b49c2[_0x6d3f('0x39')];if(!_0x229a6d[_0x6d3f('0x35')][_0x6d3f('0x3a')](_0x6d3f('0x3b'))){_0x39f533[_0x6d3f('0x3c')]=qs['limit'](_0x229a6d[_0x6d3f('0x35')][_0x6d3f('0x3c')]);_0x39f533[_0x6d3f('0x1d')]=qs[_0x6d3f('0x1d')](_0x229a6d['query'][_0x6d3f('0x1d')]);}return _0x295cca[_0x6d3f('0x67')](_0x39f533);}})[_0x6d3f('0x26')](function(_0xe2007e){if(_0xe2007e){return _0xe2007e?{'count':_0x4c90c3,'rows':_0xe2007e}:null;}})['then'](respondWithResult(_0x5c7da0,null))[_0x6d3f('0x4a')](handleError(_0x5c7da0,null));};exports['addLists']=function(_0x1663e9,_0x10f4e2,_0x3b5bba){var _0x51ac04,_0x5049c0;return db[_0x6d3f('0x45')][_0x6d3f('0x4f')]({'where':{'id':_0x1663e9['params']['id']}})[_0x6d3f('0x26')](handleEntityNotFound(_0x10f4e2,null))[_0x6d3f('0x26')](function(_0x1f9e1f){if(_0x1f9e1f){_0x5049c0=_0x1f9e1f;return _0x1f9e1f[_0x6d3f('0x68')](_0x1663e9[_0x6d3f('0x50')][_0x6d3f('0x69')],_[_0x6d3f('0x57')](_0x1663e9['body'],[_0x6d3f('0x69'),'id'])||{});}return null;})[_0x6d3f('0x6a')](function(_0x54caae){var _0x28584e;_0x51ac04=_0x54caae||[];var _0x4460de=[];if(_0x54caae){for(var _0x1bb987=0x0;_0x1bb987<_0x54caae[_0x6d3f('0x39')];_0x1bb987+=0x1){var _0x129129=_0x54caae[_0x1bb987][_0x6d3f('0x28')]({'plain':!![]});_0x5049c0[_0x6d3f('0x6b')]=_0x1663e9[_0x6d3f('0x50')][_0x6d3f('0x6b')]?_0x1663e9[_0x6d3f('0x50')][_0x6d3f('0x6b')]:_0x5049c0[_0x6d3f('0x6b')];switch(_0x5049c0[_0x6d3f('0x6b')]){case _0x6d3f('0x6c'):_0x28584e=squel[_0x6d3f('0x6d')]()[_0x6d3f('0x6e')]('cm_hopper')[_0x6d3f('0x6f')]([_0x6d3f('0x70'),'scheduledAt',_0x6d3f('0x71'),_0x6d3f('0x72'),_0x6d3f('0x62'),_0x6d3f('0x58'),_0x6d3f('0x59')],squel[_0x6d3f('0x73')]()['field'](_0x6d3f('0x70'),_0x6d3f('0x70'))[_0x6d3f('0x74')](_0x6d3f('0x75'),_0x6d3f('0x76'))[_0x6d3f('0x74')]('id',_0x6d3f('0x71'))[_0x6d3f('0x74')](_0x129129[_0x6d3f('0x77')][_0x6d3f('0x78')](),'ListId')[_0x6d3f('0x74')](_0x1663e9['params']['id'][_0x6d3f('0x78')](),_0x6d3f('0x62'))[_0x6d3f('0x74')](_0x6d3f('0x75'),_0x6d3f('0x58'))['field'](_0x6d3f('0x75'),_0x6d3f('0x59'))[_0x6d3f('0x79')](_0x6d3f('0x7a'))[_0x6d3f('0x42')](_0x6d3f('0x7b'))[_0x6d3f('0x42')](_0x6d3f('0x7c'),_0x129129[_0x6d3f('0x77')]['toString']())[_0x6d3f('0x42')](_0x6d3f('0x7d'))[_0x6d3f('0x42')](_0x6d3f('0x7e'),squel[_0x6d3f('0x73')]()[_0x6d3f('0x74')](_0x6d3f('0x7f'))[_0x6d3f('0x79')]('cm_hopper_final')[_0x6d3f('0x42')](_0x6d3f('0x80'),_0x1663e9[_0x6d3f('0x4c')]['id'][_0x6d3f('0x78')]()))[_0x6d3f('0x42')](_0x6d3f('0x7e'),squel[_0x6d3f('0x73')]()['field']('COALESCE(phone,\x27\x27)')['from'](_0x6d3f('0x81'))[_0x6d3f('0x42')](_0x6d3f('0x80'),_0x1663e9[_0x6d3f('0x4c')]['id'][_0x6d3f('0x78')]())))[_0x6d3f('0x78')]();break;case'onlyIfOpen':_0x28584e=squel[_0x6d3f('0x6d')]()[_0x6d3f('0x6e')]('cm_hopper')['fromQuery']([_0x6d3f('0x70'),'scheduledAt',_0x6d3f('0x71'),_0x6d3f('0x72'),_0x6d3f('0x62'),_0x6d3f('0x58'),_0x6d3f('0x59')],squel[_0x6d3f('0x73')]()[_0x6d3f('0x74')](_0x6d3f('0x70'),'phone')['field'](_0x6d3f('0x75'),_0x6d3f('0x76'))['field']('id','ContactId')[_0x6d3f('0x74')](_0x129129[_0x6d3f('0x77')][_0x6d3f('0x78')](),_0x6d3f('0x72'))[_0x6d3f('0x74')](_0x1663e9['params']['id'][_0x6d3f('0x78')](),_0x6d3f('0x62'))[_0x6d3f('0x74')](_0x6d3f('0x75'),'createdAt')[_0x6d3f('0x74')](_0x6d3f('0x75'),'updatedAt')[_0x6d3f('0x79')](_0x6d3f('0x7a'))[_0x6d3f('0x42')](_0x6d3f('0x7b'))[_0x6d3f('0x42')](_0x6d3f('0x7c'),_0x129129[_0x6d3f('0x77')][_0x6d3f('0x78')]())[_0x6d3f('0x42')]('phone\x20IS\x20NOT\x20NULL')[_0x6d3f('0x42')]('phone\x20NOT\x20IN\x20(?)',squel['select']()[_0x6d3f('0x74')](_0x6d3f('0x82'))['from']('cm_hopper')['where'](_0x6d3f('0x80'),_0x1663e9[_0x6d3f('0x4c')]['id'][_0x6d3f('0x78')]())))[_0x6d3f('0x78')]();break;default:_0x28584e=squel['insert']()[_0x6d3f('0x6e')]('cm_hopper')[_0x6d3f('0x6f')](['phone',_0x6d3f('0x76'),_0x6d3f('0x71'),_0x6d3f('0x72'),_0x6d3f('0x62'),'createdAt',_0x6d3f('0x59')],squel[_0x6d3f('0x73')]()[_0x6d3f('0x74')]('phone','phone')[_0x6d3f('0x74')](_0x6d3f('0x75'),_0x6d3f('0x76'))['field']('id',_0x6d3f('0x71'))[_0x6d3f('0x74')](_0x129129[_0x6d3f('0x77')]['toString'](),_0x6d3f('0x72'))[_0x6d3f('0x74')](_0x1663e9['params']['id'][_0x6d3f('0x78')](),'CampaignId')[_0x6d3f('0x74')]('NOW()',_0x6d3f('0x58'))[_0x6d3f('0x74')](_0x6d3f('0x75'),'updatedAt')['from']('cm_contacts')[_0x6d3f('0x42')](_0x6d3f('0x7b'))['where'](_0x6d3f('0x7c'),_0x129129['CmListId'][_0x6d3f('0x78')]())[_0x6d3f('0x42')](_0x6d3f('0x7d')))['toString']();}_0x4460de[_0x6d3f('0x83')](db[_0x6d3f('0x84')][_0x6d3f('0x35')](_0x28584e));}return BPromise['all'](_0x4460de);}})[_0x6d3f('0x26')](function(){return _0x51ac04;})[_0x6d3f('0x26')](respondWithResult(_0x10f4e2,null))[_0x6d3f('0x4a')](handleError(_0x10f4e2,null));};exports[_0x6d3f('0x85')]=function(_0x2ad8a7,_0x34d13f,_0x4cc81d){return db[_0x6d3f('0x45')][_0x6d3f('0x4f')]({'where':{'id':_0x2ad8a7[_0x6d3f('0x4c')]['id']}})['then'](handleEntityNotFound(_0x34d13f,null))[_0x6d3f('0x26')](function(_0x43a25a){if(_0x43a25a){return _0x43a25a[_0x6d3f('0x85')](_0x2ad8a7[_0x6d3f('0x35')][_0x6d3f('0x69')]);}})['then'](function(_0x2e7812){if(_0x2e7812){return db[_0x6d3f('0x5f')][_0x6d3f('0x27')]({'where':{'ListId':_0x2ad8a7[_0x6d3f('0x35')]['ids'],'CampaignId':_0x2ad8a7[_0x6d3f('0x4c')]['id']}})[_0x6d3f('0x26')](function(){return _0x2e7812;});}})[_0x6d3f('0x26')](respondWithStatusCode(_0x34d13f,null))[_0x6d3f('0x4a')](handleError(_0x34d13f,null));};exports[_0x6d3f('0x86')]=function(_0x21ffac,_0x5452fc,_0x196a59){var _0x25e32d={};var _0x346728={};var _0x3a5e34;var _0x4cc69e;return db[_0x6d3f('0x45')][_0x6d3f('0x5e')]({'where':{'id':_0x21ffac['params']['id']}})[_0x6d3f('0x26')](handleEntityNotFound(_0x5452fc,null))[_0x6d3f('0x26')](function(_0x536b6e){if(_0x536b6e){_0x3a5e34=_0x536b6e;_0x346728[_0x6d3f('0x34')]=_[_0x6d3f('0x4d')](db[_0x6d3f('0x87')][_0x6d3f('0x31')]);_0x346728[_0x6d3f('0x35')]=_['keys'](_0x21ffac[_0x6d3f('0x35')]);_0x346728['filters']=_[_0x6d3f('0x36')](_0x346728['model'],_0x346728['query']);_0x25e32d[_0x6d3f('0x37')]=_[_0x6d3f('0x36')](_0x346728[_0x6d3f('0x34')],qs['fields'](_0x21ffac[_0x6d3f('0x35')][_0x6d3f('0x38')]));_0x25e32d[_0x6d3f('0x37')]=_0x25e32d[_0x6d3f('0x37')][_0x6d3f('0x39')]?_0x25e32d[_0x6d3f('0x37')]:_0x346728[_0x6d3f('0x34')];_0x25e32d[_0x6d3f('0x3d')]=qs[_0x6d3f('0x3e')](_0x21ffac['query'][_0x6d3f('0x3e')]);_0x25e32d[_0x6d3f('0x42')]=qs[_0x6d3f('0x3f')](_['pick'](_0x21ffac['query'],_0x346728[_0x6d3f('0x3f')]));if(_0x21ffac[_0x6d3f('0x35')][_0x6d3f('0x41')]){_0x25e32d[_0x6d3f('0x42')]=_['merge'](_0x25e32d[_0x6d3f('0x42')],{'$or':_['map'](_0x25e32d[_0x6d3f('0x37')],function(_0x4b518c){var _0x240041={};_0x240041[_0x4b518c]={'$like':'%'+_0x21ffac[_0x6d3f('0x35')]['filter']+'%'};return _0x240041;})});}_0x25e32d=_[_0x6d3f('0x43')]({},_0x25e32d,_0x21ffac[_0x6d3f('0x4e')]);return _0x3a5e34['getBlackLists'](_0x25e32d);}})[_0x6d3f('0x26')](function(_0x5685a5){if(_0x5685a5){_0x4cc69e=_0x5685a5[_0x6d3f('0x39')];if(!_0x21ffac['query']['hasOwnProperty'](_0x6d3f('0x3b'))){_0x25e32d[_0x6d3f('0x3c')]=qs['limit'](_0x21ffac[_0x6d3f('0x35')][_0x6d3f('0x3c')]);_0x25e32d[_0x6d3f('0x1d')]=qs[_0x6d3f('0x1d')](_0x21ffac[_0x6d3f('0x35')][_0x6d3f('0x1d')]);}return _0x3a5e34['getBlackLists'](_0x25e32d);}})[_0x6d3f('0x26')](function(_0x8fc1a1){if(_0x8fc1a1){return _0x8fc1a1?{'count':_0x4cc69e,'rows':_0x8fc1a1}:null;}})[_0x6d3f('0x26')](respondWithResult(_0x5452fc,null))[_0x6d3f('0x4a')](handleError(_0x5452fc,null));};exports[_0x6d3f('0x88')]=function(_0x2ef715,_0x13db9f,_0x1b5a95){var _0x2048cf,_0x57e44a;return db[_0x6d3f('0x45')]['find']({'where':{'id':_0x2ef715[_0x6d3f('0x4c')]['id']}})[_0x6d3f('0x26')](handleEntityNotFound(_0x13db9f,null))[_0x6d3f('0x26')](function(_0x10cede){if(_0x10cede){_0x57e44a=_0x10cede;return _0x10cede['addBlackLists'](_0x2ef715['body'][_0x6d3f('0x69')],_[_0x6d3f('0x57')](_0x2ef715[_0x6d3f('0x50')],['ids','id'])||{});}return null;})[_0x6d3f('0x6a')](function(_0x3d680e){var _0x5e6029;_0x2048cf=_0x3d680e||[];var _0x601f83=[];if(_0x3d680e){for(var _0x2f2cd3=0x0;_0x2f2cd3<_0x3d680e[_0x6d3f('0x39')];_0x2f2cd3+=0x1){var _0x4f32da=_0x3d680e[_0x2f2cd3][_0x6d3f('0x28')]({'plain':!![]});_0x5e6029=squel[_0x6d3f('0x6d')]()['into'](_0x6d3f('0x89'))[_0x6d3f('0x6f')]([_0x6d3f('0x70'),_0x6d3f('0x71'),'ListId',_0x6d3f('0x62'),_0x6d3f('0x58'),_0x6d3f('0x59')],squel[_0x6d3f('0x73')]()[_0x6d3f('0x74')](_0x6d3f('0x70'),_0x6d3f('0x70'))[_0x6d3f('0x74')]('id',_0x6d3f('0x71'))[_0x6d3f('0x74')](_0x4f32da[_0x6d3f('0x77')]['toString'](),'ListId')[_0x6d3f('0x74')](_0x2ef715[_0x6d3f('0x4c')]['id'][_0x6d3f('0x78')](),_0x6d3f('0x62'))[_0x6d3f('0x74')](_0x6d3f('0x75'),_0x6d3f('0x58'))[_0x6d3f('0x74')]('NOW()',_0x6d3f('0x59'))['from'](_0x6d3f('0x7a'))['where'](_0x6d3f('0x7b'))[_0x6d3f('0x42')](_0x6d3f('0x7c'),_0x4f32da[_0x6d3f('0x77')][_0x6d3f('0x78')]())[_0x6d3f('0x42')](_0x6d3f('0x7d')))[_0x6d3f('0x78')]();_0x601f83[_0x6d3f('0x83')](db['sequelize']['query'](_0x5e6029));}return BPromise['all'](_0x601f83);}})[_0x6d3f('0x26')](function(){return _0x2048cf;})[_0x6d3f('0x26')](respondWithResult(_0x13db9f,null))[_0x6d3f('0x4a')](handleError(_0x13db9f,null));};exports[_0x6d3f('0x8a')]=function(_0x43a756,_0x11125f,_0x279708){return db[_0x6d3f('0x45')][_0x6d3f('0x4f')]({'where':{'id':_0x43a756['params']['id']}})[_0x6d3f('0x26')](handleEntityNotFound(_0x11125f,null))[_0x6d3f('0x26')](function(_0x4d0f63){if(_0x4d0f63){return _0x4d0f63['removeBlackLists'](_0x43a756[_0x6d3f('0x35')][_0x6d3f('0x69')]);}})['then'](function(_0x574c3b){if(_0x574c3b){return db[_0x6d3f('0x66')][_0x6d3f('0x27')]({'where':{'ListId':_0x43a756[_0x6d3f('0x35')]['ids'],'CampaignId':_0x43a756[_0x6d3f('0x4c')]['id']}})[_0x6d3f('0x26')](function(){return _0x574c3b;});}})[_0x6d3f('0x26')](respondWithStatusCode(_0x11125f,null))['catch'](handleError(_0x11125f,null));};
\ No newline at end of file
+var _0xf876=['all','removeLists','getBlackLists','addBlackLists','cm_hopper_black','sequelize','removeBlackLists','eml-format','rimraf','moment','mustache','util','path','to-csv','ejs','fs-extra','crypto','jsforce','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','end','status','offset','undefined','limit','count','set','Content-Range','json','apply','reject','save','update','then','get','IvrCampaigns','UserProfileResource','destroy','error','stack','index','map','fieldName','type','key','model','name','query','keys','intersection','fields','attributes','length','nolimit','order','sort','where','filters','merge','VIRTUAL','filter','options','Campaign','includeAll','include','findAll','rows','catch','show','rawAttributes','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','find','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','clone','omit','createdAt','updatedAt','params','findOne','hasOwnProperty','pick','CampaignId','CmHopper','getHopperHistories','CmHopperHistory','getHopperFinals','CmHopperFinal','getHopperBlacks','CmHopperBlack','CmList','getLists','addLists','ids','spread','dialCheckDuplicateType','always','insert','into','cm_hopper','fromQuery','ListId','select','field','phone','NOW()','ContactId','toString','from','deletedAt\x20IS\x20NULL','ListId\x20=\x20?','CmListId','phone\x20IS\x20NOT\x20NULL','COALESCE(calleridnum,\x27\x27)','cm_hopper_final','CampaignId\x20=\x20?','phone\x20NOT\x20IN\x20(?)','scheduledAt','cm_contacts','COALESCE(phone,\x27\x27)','push'];(function(_0x543412,_0x4d2bea){var _0x4cab53=function(_0x21519f){while(--_0x21519f){_0x543412['push'](_0x543412['shift']());}};_0x4cab53(++_0x4d2bea);}(_0xf876,0x19f));var _0x6f87=function(_0xd02bb,_0x26e2d0){_0xd02bb=_0xd02bb-0x0;var _0x1cdf23=_0xf876[_0xd02bb];return _0x1cdf23;};'use strict';var emlformat=require(_0x6f87('0x0'));var rimraf=require(_0x6f87('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x6f87('0x2'));var BPromise=require('bluebird');var Mustache=require(_0x6f87('0x3'));var util=require(_0x6f87('0x4'));var path=require(_0x6f87('0x5'));var sox=require('sox');var csv=require(_0x6f87('0x6'));var ejs=require(_0x6f87('0x7'));var fs=require('fs');var fs_extra=require(_0x6f87('0x8'));var _=require('lodash');var squel=require('squel');var crypto=require(_0x6f87('0x9'));var jsforce=require(_0x6f87('0xa'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x6f87('0xb'));var Papa=require(_0x6f87('0xc'));var Redis=require('ioredis');var authService=require(_0x6f87('0xd'));var qs=require(_0x6f87('0xe'));var as=require(_0x6f87('0xf'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x6f87('0x10'))(_0x6f87('0x11'));var utils=require(_0x6f87('0x12'));var config=require('../../config/environment');var licenseUtil=require(_0x6f87('0x13'));var db=require(_0x6f87('0x14'))['db'];function respondWithStatusCode(_0x5d897b,_0x2e6f20){_0x2e6f20=_0x2e6f20||0xcc;return function(_0x18642b){if(_0x18642b){return _0x5d897b[_0x6f87('0x15')](_0x2e6f20);}return _0x5d897b['status'](_0x2e6f20)[_0x6f87('0x16')]();};}function respondWithResult(_0x3fa836,_0x249103){_0x249103=_0x249103||0xc8;return function(_0x5a10ba){if(_0x5a10ba){return _0x3fa836[_0x6f87('0x17')](_0x249103)['json'](_0x5a10ba);}};}function respondWithFilteredResult(_0x2b33be,_0x19e860){return function(_0x2bcb12){if(_0x2bcb12){var _0xd74ebb=typeof _0x19e860[_0x6f87('0x18')]===_0x6f87('0x19')&&typeof _0x19e860[_0x6f87('0x1a')]===_0x6f87('0x19');var _0x56a083=_0x2bcb12['count'];var _0x4fc1a9=_0xd74ebb?0x0:_0x19e860[_0x6f87('0x18')];var _0x2126d8=_0xd74ebb?_0x2bcb12[_0x6f87('0x1b')]:_0x19e860[_0x6f87('0x18')]+_0x19e860[_0x6f87('0x1a')];var _0x2b02b0;if(_0x2126d8>=_0x56a083){_0x2126d8=_0x56a083;_0x2b02b0=0xc8;}else{_0x2b02b0=0xce;}_0x2b33be['status'](_0x2b02b0);return _0x2b33be[_0x6f87('0x1c')](_0x6f87('0x1d'),_0x4fc1a9+'-'+_0x2126d8+'/'+_0x56a083)[_0x6f87('0x1e')](_0x2bcb12);}return null;};}function patchUpdates(_0x28ceba){return function(_0x21e7da){try{jsonpatch[_0x6f87('0x1f')](_0x21e7da,_0x28ceba,!![]);}catch(_0x5a95f9){return BPromise[_0x6f87('0x20')](_0x5a95f9);}return _0x21e7da[_0x6f87('0x21')]();};}function saveUpdates(_0x5bc29d,_0xd40831){return function(_0x3713d3){if(_0x3713d3){return _0x3713d3[_0x6f87('0x22')](_0x5bc29d)[_0x6f87('0x23')](function(_0x205b8d){return _0x205b8d;});}return null;};}function removeEntity(_0x1e2ecc,_0x374506){return function(_0xadd95d){if(_0xadd95d){return _0xadd95d['destroy']()[_0x6f87('0x23')](function(){var _0x1407b2=_0xadd95d[_0x6f87('0x24')]({'plain':!![]});var _0x6a7776=_0x6f87('0x25');return db[_0x6f87('0x26')][_0x6f87('0x27')]({'where':{'type':_0x6a7776,'resourceId':_0x1407b2['id']}})[_0x6f87('0x23')](function(){return _0xadd95d;});})[_0x6f87('0x23')](function(){_0x1e2ecc['status'](0xcc)[_0x6f87('0x16')]();});}};}function handleEntityNotFound(_0x177039,_0x307b19){return function(_0x1935c2){if(!_0x1935c2){_0x177039[_0x6f87('0x15')](0x194);}return _0x1935c2;};}function handleError(_0x1372c7,_0x427006){_0x427006=_0x427006||0x1f4;return function(_0x50b2b3){logger[_0x6f87('0x28')](_0x50b2b3[_0x6f87('0x29')]);if(_0x50b2b3['name']){delete _0x50b2b3['name'];}_0x1372c7['status'](_0x427006)['send'](_0x50b2b3);};}exports[_0x6f87('0x2a')]=function(_0x2901a8,_0x5f0d65){var _0x20fdb7={},_0x2e5e68={},_0x22e301={'count':0x0,'rows':[]};var _0x295006=_[_0x6f87('0x2b')](db['Campaign']['rawAttributes'],function(_0x4cf91f){return{'name':_0x4cf91f[_0x6f87('0x2c')],'type':_0x4cf91f[_0x6f87('0x2d')][_0x6f87('0x2e')]};});_0x2e5e68[_0x6f87('0x2f')]=_['map'](_0x295006,_0x6f87('0x30'));_0x2e5e68[_0x6f87('0x31')]=_[_0x6f87('0x32')](_0x2901a8[_0x6f87('0x31')]);_0x2e5e68['filters']=_['intersection'](_0x2e5e68[_0x6f87('0x2f')],_0x2e5e68[_0x6f87('0x31')]);_0x20fdb7['attributes']=_[_0x6f87('0x33')](_0x2e5e68[_0x6f87('0x2f')],qs[_0x6f87('0x34')](_0x2901a8[_0x6f87('0x31')]['fields']));_0x20fdb7[_0x6f87('0x35')]=_0x20fdb7[_0x6f87('0x35')][_0x6f87('0x36')]?_0x20fdb7['attributes']:_0x2e5e68[_0x6f87('0x2f')];if(!_0x2901a8[_0x6f87('0x31')]['hasOwnProperty'](_0x6f87('0x37'))){_0x20fdb7[_0x6f87('0x1a')]=qs[_0x6f87('0x1a')](_0x2901a8[_0x6f87('0x31')][_0x6f87('0x1a')]);_0x20fdb7['offset']=qs[_0x6f87('0x18')](_0x2901a8['query'][_0x6f87('0x18')]);}_0x20fdb7[_0x6f87('0x38')]=qs['sort'](_0x2901a8[_0x6f87('0x31')][_0x6f87('0x39')]);_0x20fdb7[_0x6f87('0x3a')]=qs[_0x6f87('0x3b')](_['pick'](_0x2901a8[_0x6f87('0x31')],_0x2e5e68[_0x6f87('0x3b')]),_0x295006);if(_0x2901a8[_0x6f87('0x31')]['filter']){_0x20fdb7[_0x6f87('0x3a')]=_[_0x6f87('0x3c')](_0x20fdb7[_0x6f87('0x3a')],{'$or':_[_0x6f87('0x2b')](_0x295006,function(_0x279f5c){if(_0x279f5c[_0x6f87('0x2d')]!==_0x6f87('0x3d')){var _0x2a0334={};_0x2a0334[_0x279f5c[_0x6f87('0x30')]]={'$like':'%'+_0x2901a8[_0x6f87('0x31')][_0x6f87('0x3e')]+'%'};return _0x2a0334;}})});}_0x20fdb7=_[_0x6f87('0x3c')]({},_0x20fdb7,_0x2901a8[_0x6f87('0x3f')]);var _0xcad1e4={'where':_0x20fdb7[_0x6f87('0x3a')]};return db[_0x6f87('0x40')][_0x6f87('0x1b')](_0xcad1e4)[_0x6f87('0x23')](function(_0x863ff8){_0x22e301[_0x6f87('0x1b')]=_0x863ff8;if(_0x2901a8[_0x6f87('0x31')][_0x6f87('0x41')]){_0x20fdb7[_0x6f87('0x42')]=[{'all':!![]}];}return db[_0x6f87('0x40')][_0x6f87('0x43')](_0x20fdb7);})[_0x6f87('0x23')](function(_0xa30b08){_0x22e301[_0x6f87('0x44')]=_0xa30b08;return _0x22e301;})['then'](respondWithFilteredResult(_0x5f0d65,_0x20fdb7))[_0x6f87('0x45')](handleError(_0x5f0d65,null));};exports[_0x6f87('0x46')]=function(_0x38e0f1,_0x38db63){var _0x3cd7a5={'raw':![],'where':{'id':_0x38e0f1['params']['id']}},_0x35f0c6={};_0x35f0c6[_0x6f87('0x2f')]=_[_0x6f87('0x32')](db[_0x6f87('0x40')][_0x6f87('0x47')]);_0x35f0c6[_0x6f87('0x31')]=_[_0x6f87('0x32')](_0x38e0f1[_0x6f87('0x31')]);_0x35f0c6[_0x6f87('0x3b')]=_[_0x6f87('0x33')](_0x35f0c6[_0x6f87('0x2f')],_0x35f0c6[_0x6f87('0x31')]);_0x3cd7a5[_0x6f87('0x35')]=_[_0x6f87('0x33')](_0x35f0c6[_0x6f87('0x2f')],qs[_0x6f87('0x34')](_0x38e0f1[_0x6f87('0x31')][_0x6f87('0x34')]));_0x3cd7a5['attributes']=_0x3cd7a5['attributes'][_0x6f87('0x36')]?_0x3cd7a5[_0x6f87('0x35')]:_0x35f0c6[_0x6f87('0x2f')];if(_0x38e0f1[_0x6f87('0x31')]['includeAll']){_0x3cd7a5[_0x6f87('0x42')]=[{'all':!![]}];}_0x3cd7a5=_[_0x6f87('0x3c')]({},_0x3cd7a5,_0x38e0f1[_0x6f87('0x3f')]);return db[_0x6f87('0x40')]['find'](_0x3cd7a5)[_0x6f87('0x23')](handleEntityNotFound(_0x38db63,null))['then'](respondWithResult(_0x38db63,null))['catch'](handleError(_0x38db63,null));};exports[_0x6f87('0x48')]=function(_0x56674f,_0x9e7874){return db[_0x6f87('0x40')][_0x6f87('0x48')](_0x56674f[_0x6f87('0x49')],{})[_0x6f87('0x23')](function(_0x431af5){var _0x610b06=_0x56674f[_0x6f87('0x4a')][_0x6f87('0x24')]({'plain':!![]});if(!_0x610b06)throw new Error(_0x6f87('0x4b'));if(_0x610b06[_0x6f87('0x4c')]===_0x6f87('0x4a')){var _0x2253d5=_0x431af5[_0x6f87('0x24')]({'plain':!![]});var _0x36e3e3=_0x6f87('0x25');return db[_0x6f87('0x4d')][_0x6f87('0x4e')]({'where':{'name':_0x36e3e3,'userProfileId':_0x610b06[_0x6f87('0x4f')]},'raw':!![]})[_0x6f87('0x23')](function(_0x3a130d){if(_0x3a130d&&_0x3a130d[_0x6f87('0x50')]===0x0){return db[_0x6f87('0x26')]['create']({'name':_0x2253d5[_0x6f87('0x30')],'resourceId':_0x2253d5['id'],'type':_0x3a130d[_0x6f87('0x30')],'sectionId':_0x3a130d['id']},{})[_0x6f87('0x23')](function(){return _0x431af5;});}else{return _0x431af5;}})[_0x6f87('0x45')](function(_0x16f4d5){logger['error'](_0x6f87('0x51'),_0x16f4d5);throw _0x16f4d5;});}return _0x431af5;})['then'](respondWithResult(_0x9e7874,0xc9))[_0x6f87('0x45')](handleError(_0x9e7874,null));};exports[_0x6f87('0x52')]=function(_0x4bc9ef,_0x3d60e3){var _0x57ba38={'where':{'id':_0x4bc9ef['params']['id']}},_0x5b56ac={};_0x5b56ac['model']=_[_0x6f87('0x32')](db[_0x6f87('0x40')]['rawAttributes']);_0x57ba38[_0x6f87('0x35')]=_[_0x6f87('0x33')](_0x5b56ac[_0x6f87('0x2f')],qs[_0x6f87('0x34')](_0x4bc9ef['query']['fields']));_0x57ba38[_0x6f87('0x35')]=_0x57ba38['attributes'][_0x6f87('0x36')]?_0x57ba38[_0x6f87('0x35')]:_0x5b56ac[_0x6f87('0x2f')];if(_0x4bc9ef[_0x6f87('0x31')][_0x6f87('0x41')]){_0x57ba38['include']=[{'all':!![]}];}_0x57ba38=_[_0x6f87('0x3c')]({},_0x57ba38,_0x4bc9ef[_0x6f87('0x3f')]);return db['Campaign'][_0x6f87('0x4e')](_0x57ba38)['then'](handleEntityNotFound(_0x3d60e3,null))['then'](function(_0x5dc29a){if(_0x5dc29a){var _0x1528a7=_0x5dc29a[_0x6f87('0x24')]({'plain':!![]});_0x1528a7=qs[_0x6f87('0x53')](_0x1528a7,['id',_0x6f87('0x54'),_0x6f87('0x55')]);_0x4bc9ef[_0x6f87('0x49')]=_[_0x6f87('0x53')](_0x4bc9ef[_0x6f87('0x49')],['id',_0x6f87('0x54'),_0x6f87('0x55')]);return db['Campaign'][_0x6f87('0x48')](_['merge'](_0x1528a7,_0x4bc9ef[_0x6f87('0x49')]),{'include':_0x4bc9ef[_0x6f87('0x31')]['includeAll']?[{'all':!![]}]:undefined})[_0x6f87('0x23')](function(_0x1ebe13){var _0xfc6bf5=_0x4bc9ef[_0x6f87('0x4a')][_0x6f87('0x24')]({'plain':!![]});if(!_0xfc6bf5)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0xfc6bf5[_0x6f87('0x4c')]===_0x6f87('0x4a')){var _0x261bbd=_0x1ebe13['get']({'plain':!![]});var _0x1ca59c=_0x6f87('0x25');return db['UserProfileSection'][_0x6f87('0x4e')]({'where':{'name':_0x1ca59c,'userProfileId':_0xfc6bf5[_0x6f87('0x4f')]},'raw':!![]})[_0x6f87('0x23')](function(_0x5421fa){if(_0x5421fa&&_0x5421fa[_0x6f87('0x50')]===0x0){return db[_0x6f87('0x26')]['create']({'name':_0x261bbd['name'],'resourceId':_0x261bbd['id'],'type':_0x5421fa[_0x6f87('0x30')],'sectionId':_0x5421fa['id']},{})['then'](function(){return _0x1ebe13;});}else{return _0x1ebe13;}})[_0x6f87('0x45')](function(_0x4ec34a){logger[_0x6f87('0x28')](_0x6f87('0x51'),_0x4ec34a);throw _0x4ec34a;});}return _0x1ebe13;});}})[_0x6f87('0x23')](respondWithResult(_0x3d60e3,0xc9))[_0x6f87('0x45')](handleError(_0x3d60e3,null));};exports[_0x6f87('0x22')]=function(_0x257ff4,_0x393d8f){if(_0x257ff4[_0x6f87('0x49')]['id']){delete _0x257ff4[_0x6f87('0x49')]['id'];}return db[_0x6f87('0x40')][_0x6f87('0x4e')]({'where':{'id':_0x257ff4[_0x6f87('0x56')]['id']}})[_0x6f87('0x23')](handleEntityNotFound(_0x393d8f,null))[_0x6f87('0x23')](saveUpdates(_0x257ff4[_0x6f87('0x49')],null))[_0x6f87('0x23')](respondWithResult(_0x393d8f,null))['catch'](handleError(_0x393d8f,null));};exports[_0x6f87('0x27')]=function(_0x22e651,_0x467ca6){return db['Campaign'][_0x6f87('0x4e')]({'where':{'id':_0x22e651[_0x6f87('0x56')]['id']}})[_0x6f87('0x23')](handleEntityNotFound(_0x467ca6,null))[_0x6f87('0x23')](removeEntity(_0x467ca6,null))[_0x6f87('0x45')](handleError(_0x467ca6,null));};exports['getHoppers']=function(_0x373754,_0x2c5fbe,_0x22ae85){var _0x49d3a4={'raw':!![],'where':{}};var _0x175f18={};var _0x1b7d56={'count':0x0,'rows':[]};return db['Campaign'][_0x6f87('0x57')]({'where':{'id':_0x373754[_0x6f87('0x56')]['id']}})['then'](handleEntityNotFound(_0x2c5fbe,null))[_0x6f87('0x23')](function(_0x45756a){if(_0x45756a){_0x175f18[_0x6f87('0x2f')]=_[_0x6f87('0x32')](db['CmHopper'][_0x6f87('0x47')]);_0x175f18[_0x6f87('0x31')]=_[_0x6f87('0x32')](_0x373754['query']);_0x175f18['filters']=_[_0x6f87('0x33')](_0x175f18[_0x6f87('0x2f')],_0x175f18[_0x6f87('0x31')]);_0x49d3a4[_0x6f87('0x35')]=_[_0x6f87('0x33')](_0x175f18['model'],qs[_0x6f87('0x34')](_0x373754[_0x6f87('0x31')][_0x6f87('0x34')]));_0x49d3a4[_0x6f87('0x35')]=_0x49d3a4[_0x6f87('0x35')]['length']?_0x49d3a4[_0x6f87('0x35')]:_0x175f18[_0x6f87('0x2f')];if(!_0x373754[_0x6f87('0x31')][_0x6f87('0x58')](_0x6f87('0x37'))){_0x49d3a4[_0x6f87('0x1a')]=qs['limit'](_0x373754[_0x6f87('0x31')][_0x6f87('0x1a')]);_0x49d3a4['offset']=qs[_0x6f87('0x18')](_0x373754[_0x6f87('0x31')][_0x6f87('0x18')]);}_0x49d3a4[_0x6f87('0x38')]=qs[_0x6f87('0x39')](_0x373754[_0x6f87('0x31')][_0x6f87('0x39')]);_0x49d3a4[_0x6f87('0x3a')]=qs[_0x6f87('0x3b')](_[_0x6f87('0x59')](_0x373754['query'],_0x175f18[_0x6f87('0x3b')]));_0x49d3a4['where'][_0x6f87('0x5a')]=_0x45756a['id'];if(_0x373754[_0x6f87('0x31')][_0x6f87('0x3e')]){_0x49d3a4['where']=_['merge'](_0x49d3a4[_0x6f87('0x3a')],{'$or':_[_0x6f87('0x2b')](_0x49d3a4[_0x6f87('0x35')],function(_0x2b42dc){var _0x5b5330={};_0x5b5330[_0x2b42dc]={'$like':'%'+_0x373754[_0x6f87('0x31')][_0x6f87('0x3e')]+'%'};return _0x5b5330;})});}_0x49d3a4=_['merge']({},_0x49d3a4,_0x373754[_0x6f87('0x3f')]);return db['CmHopper'][_0x6f87('0x1b')]({'where':_0x49d3a4[_0x6f87('0x3a')]})[_0x6f87('0x23')](function(_0xdd5c85){_0x1b7d56[_0x6f87('0x1b')]=_0xdd5c85;if(_0x373754[_0x6f87('0x31')][_0x6f87('0x41')]){_0x49d3a4[_0x6f87('0x42')]=[{'all':!![]}];}return db[_0x6f87('0x5b')]['findAll'](_0x49d3a4);})[_0x6f87('0x23')](function(_0x6dc45c){_0x1b7d56[_0x6f87('0x44')]=_0x6dc45c;return _0x1b7d56;});}})[_0x6f87('0x23')](respondWithFilteredResult(_0x2c5fbe,_0x49d3a4))[_0x6f87('0x45')](handleError(_0x2c5fbe,null));};exports[_0x6f87('0x5c')]=function(_0x9d389d,_0x210e9c,_0x3dbd79){var _0x253bf6={'raw':!![],'where':{}};var _0x58cd32={};var _0x3e9a9f={'count':0x0,'rows':[]};return db[_0x6f87('0x40')][_0x6f87('0x57')]({'where':{'id':_0x9d389d[_0x6f87('0x56')]['id']}})[_0x6f87('0x23')](handleEntityNotFound(_0x210e9c,null))[_0x6f87('0x23')](function(_0x28c4a6){if(_0x28c4a6){_0x58cd32[_0x6f87('0x2f')]=_['keys'](db['CmHopperHistory']['rawAttributes']);_0x58cd32[_0x6f87('0x31')]=_[_0x6f87('0x32')](_0x9d389d[_0x6f87('0x31')]);_0x58cd32[_0x6f87('0x3b')]=_['intersection'](_0x58cd32[_0x6f87('0x2f')],_0x58cd32[_0x6f87('0x31')]);_0x253bf6['attributes']=_['intersection'](_0x58cd32[_0x6f87('0x2f')],qs[_0x6f87('0x34')](_0x9d389d['query'][_0x6f87('0x34')]));_0x253bf6['attributes']=_0x253bf6[_0x6f87('0x35')][_0x6f87('0x36')]?_0x253bf6[_0x6f87('0x35')]:_0x58cd32[_0x6f87('0x2f')];if(!_0x9d389d['query'][_0x6f87('0x58')](_0x6f87('0x37'))){_0x253bf6[_0x6f87('0x1a')]=qs[_0x6f87('0x1a')](_0x9d389d[_0x6f87('0x31')][_0x6f87('0x1a')]);_0x253bf6[_0x6f87('0x18')]=qs['offset'](_0x9d389d['query'][_0x6f87('0x18')]);}_0x253bf6[_0x6f87('0x38')]=qs[_0x6f87('0x39')](_0x9d389d[_0x6f87('0x31')][_0x6f87('0x39')]);_0x253bf6[_0x6f87('0x3a')]=qs[_0x6f87('0x3b')](_['pick'](_0x9d389d['query'],_0x58cd32['filters']));_0x253bf6[_0x6f87('0x3a')][_0x6f87('0x5a')]=_0x28c4a6['id'];if(_0x9d389d[_0x6f87('0x31')][_0x6f87('0x3e')]){_0x253bf6[_0x6f87('0x3a')]=_[_0x6f87('0x3c')](_0x253bf6[_0x6f87('0x3a')],{'$or':_['map'](_0x253bf6[_0x6f87('0x35')],function(_0x1543df){var _0x51049a={};_0x51049a[_0x1543df]={'$like':'%'+_0x9d389d[_0x6f87('0x31')][_0x6f87('0x3e')]+'%'};return _0x51049a;})});}_0x253bf6=_[_0x6f87('0x3c')]({},_0x253bf6,_0x9d389d[_0x6f87('0x3f')]);return db['CmHopperHistory'][_0x6f87('0x1b')]({'where':_0x253bf6[_0x6f87('0x3a')]})[_0x6f87('0x23')](function(_0x136d4c){_0x3e9a9f[_0x6f87('0x1b')]=_0x136d4c;if(_0x9d389d[_0x6f87('0x31')][_0x6f87('0x41')]){_0x253bf6[_0x6f87('0x42')]=[{'all':!![]}];}return db[_0x6f87('0x5d')][_0x6f87('0x43')](_0x253bf6);})[_0x6f87('0x23')](function(_0x3aaa74){_0x3e9a9f[_0x6f87('0x44')]=_0x3aaa74;return _0x3e9a9f;});}})[_0x6f87('0x23')](respondWithFilteredResult(_0x210e9c,_0x253bf6))[_0x6f87('0x45')](handleError(_0x210e9c,null));};exports[_0x6f87('0x5e')]=function(_0x1d3e31,_0x262a7c,_0x17002c){var _0x3a150a={'raw':!![],'where':{}};var _0x53d362={};var _0x54082c={'count':0x0,'rows':[]};return db[_0x6f87('0x40')][_0x6f87('0x57')]({'where':{'id':_0x1d3e31[_0x6f87('0x56')]['id']}})['then'](handleEntityNotFound(_0x262a7c,null))[_0x6f87('0x23')](function(_0x1cf867){if(_0x1cf867){_0x53d362[_0x6f87('0x2f')]=_[_0x6f87('0x32')](db[_0x6f87('0x5f')][_0x6f87('0x47')]);_0x53d362[_0x6f87('0x31')]=_[_0x6f87('0x32')](_0x1d3e31[_0x6f87('0x31')]);_0x53d362[_0x6f87('0x3b')]=_[_0x6f87('0x33')](_0x53d362[_0x6f87('0x2f')],_0x53d362[_0x6f87('0x31')]);_0x3a150a[_0x6f87('0x35')]=_[_0x6f87('0x33')](_0x53d362[_0x6f87('0x2f')],qs[_0x6f87('0x34')](_0x1d3e31[_0x6f87('0x31')]['fields']));_0x3a150a['attributes']=_0x3a150a[_0x6f87('0x35')][_0x6f87('0x36')]?_0x3a150a['attributes']:_0x53d362[_0x6f87('0x2f')];if(!_0x1d3e31[_0x6f87('0x31')][_0x6f87('0x58')](_0x6f87('0x37'))){_0x3a150a[_0x6f87('0x1a')]=qs[_0x6f87('0x1a')](_0x1d3e31[_0x6f87('0x31')][_0x6f87('0x1a')]);_0x3a150a[_0x6f87('0x18')]=qs[_0x6f87('0x18')](_0x1d3e31[_0x6f87('0x31')][_0x6f87('0x18')]);}_0x3a150a[_0x6f87('0x38')]=qs[_0x6f87('0x39')](_0x1d3e31['query'][_0x6f87('0x39')]);_0x3a150a[_0x6f87('0x3a')]=qs[_0x6f87('0x3b')](_['pick'](_0x1d3e31[_0x6f87('0x31')],_0x53d362[_0x6f87('0x3b')]));_0x3a150a['where'][_0x6f87('0x5a')]=_0x1cf867['id'];if(_0x1d3e31[_0x6f87('0x31')][_0x6f87('0x3e')]){_0x3a150a['where']=_['merge'](_0x3a150a[_0x6f87('0x3a')],{'$or':_[_0x6f87('0x2b')](_0x3a150a['attributes'],function(_0x5afb68){var _0x2d460e={};_0x2d460e[_0x5afb68]={'$like':'%'+_0x1d3e31[_0x6f87('0x31')][_0x6f87('0x3e')]+'%'};return _0x2d460e;})});}_0x3a150a=_[_0x6f87('0x3c')]({},_0x3a150a,_0x1d3e31['options']);return db[_0x6f87('0x5f')]['count']({'where':_0x3a150a[_0x6f87('0x3a')]})[_0x6f87('0x23')](function(_0xbb043d){_0x54082c[_0x6f87('0x1b')]=_0xbb043d;if(_0x1d3e31[_0x6f87('0x31')][_0x6f87('0x41')]){_0x3a150a['include']=[{'all':!![]}];}return db[_0x6f87('0x5f')][_0x6f87('0x43')](_0x3a150a);})[_0x6f87('0x23')](function(_0x2d9668){_0x54082c[_0x6f87('0x44')]=_0x2d9668;return _0x54082c;});}})[_0x6f87('0x23')](respondWithFilteredResult(_0x262a7c,_0x3a150a))[_0x6f87('0x45')](handleError(_0x262a7c,null));};exports[_0x6f87('0x60')]=function(_0x5df24a,_0x57b0f3,_0x195da5){var _0x1b5197={'raw':!![],'where':{}};var _0x511e4c={};var _0xddeea5={'count':0x0,'rows':[]};return db[_0x6f87('0x40')][_0x6f87('0x57')]({'where':{'id':_0x5df24a[_0x6f87('0x56')]['id']}})[_0x6f87('0x23')](handleEntityNotFound(_0x57b0f3,null))[_0x6f87('0x23')](function(_0x3100d2){if(_0x3100d2){_0x511e4c['model']=_['keys'](db['CmHopperBlack']['rawAttributes']);_0x511e4c[_0x6f87('0x31')]=_[_0x6f87('0x32')](_0x5df24a[_0x6f87('0x31')]);_0x511e4c[_0x6f87('0x3b')]=_['intersection'](_0x511e4c['model'],_0x511e4c['query']);_0x1b5197[_0x6f87('0x35')]=_[_0x6f87('0x33')](_0x511e4c[_0x6f87('0x2f')],qs['fields'](_0x5df24a[_0x6f87('0x31')][_0x6f87('0x34')]));_0x1b5197[_0x6f87('0x35')]=_0x1b5197['attributes'][_0x6f87('0x36')]?_0x1b5197[_0x6f87('0x35')]:_0x511e4c[_0x6f87('0x2f')];if(!_0x5df24a['query'][_0x6f87('0x58')]('nolimit')){_0x1b5197[_0x6f87('0x1a')]=qs[_0x6f87('0x1a')](_0x5df24a['query'][_0x6f87('0x1a')]);_0x1b5197[_0x6f87('0x18')]=qs[_0x6f87('0x18')](_0x5df24a[_0x6f87('0x31')][_0x6f87('0x18')]);}_0x1b5197[_0x6f87('0x38')]=qs['sort'](_0x5df24a[_0x6f87('0x31')][_0x6f87('0x39')]);_0x1b5197['where']=qs[_0x6f87('0x3b')](_[_0x6f87('0x59')](_0x5df24a[_0x6f87('0x31')],_0x511e4c[_0x6f87('0x3b')]));_0x1b5197['where'][_0x6f87('0x5a')]=_0x3100d2['id'];if(_0x5df24a[_0x6f87('0x31')]['filter']){_0x1b5197[_0x6f87('0x3a')]=_[_0x6f87('0x3c')](_0x1b5197['where'],{'$or':_['map'](_0x1b5197[_0x6f87('0x35')],function(_0x192556){var _0x4ca52e={};_0x4ca52e[_0x192556]={'$like':'%'+_0x5df24a[_0x6f87('0x31')][_0x6f87('0x3e')]+'%'};return _0x4ca52e;})});}_0x1b5197=_['merge']({},_0x1b5197,_0x5df24a['options']);return db[_0x6f87('0x61')][_0x6f87('0x1b')]({'where':_0x1b5197[_0x6f87('0x3a')]})[_0x6f87('0x23')](function(_0x41eb67){_0xddeea5[_0x6f87('0x1b')]=_0x41eb67;if(_0x5df24a['query'][_0x6f87('0x41')]){_0x1b5197[_0x6f87('0x42')]=[{'all':!![]}];}return db[_0x6f87('0x61')][_0x6f87('0x43')](_0x1b5197);})[_0x6f87('0x23')](function(_0x20b2a2){_0xddeea5[_0x6f87('0x44')]=_0x20b2a2;return _0xddeea5;});}})['then'](respondWithFilteredResult(_0x57b0f3,_0x1b5197))[_0x6f87('0x45')](handleError(_0x57b0f3,null));};exports['getLists']=function(_0x5eca16,_0x1803ce,_0x11b3da){var _0x176506={};var _0xe5ff32={};var _0x511974;var _0x4b645d;return db[_0x6f87('0x40')][_0x6f87('0x57')]({'where':{'id':_0x5eca16['params']['id']}})[_0x6f87('0x23')](handleEntityNotFound(_0x1803ce,null))[_0x6f87('0x23')](function(_0x1e322b){if(_0x1e322b){_0x511974=_0x1e322b;_0xe5ff32[_0x6f87('0x2f')]=_[_0x6f87('0x32')](db[_0x6f87('0x62')]['rawAttributes']);_0xe5ff32[_0x6f87('0x31')]=_[_0x6f87('0x32')](_0x5eca16[_0x6f87('0x31')]);_0xe5ff32['filters']=_['intersection'](_0xe5ff32[_0x6f87('0x2f')],_0xe5ff32['query']);_0x176506[_0x6f87('0x35')]=_[_0x6f87('0x33')](_0xe5ff32[_0x6f87('0x2f')],qs[_0x6f87('0x34')](_0x5eca16[_0x6f87('0x31')][_0x6f87('0x34')]));_0x176506['attributes']=_0x176506['attributes'][_0x6f87('0x36')]?_0x176506[_0x6f87('0x35')]:_0xe5ff32['model'];_0x176506[_0x6f87('0x38')]=qs[_0x6f87('0x39')](_0x5eca16[_0x6f87('0x31')][_0x6f87('0x39')]);_0x176506['where']=qs['filters'](_[_0x6f87('0x59')](_0x5eca16[_0x6f87('0x31')],_0xe5ff32['filters']));if(_0x5eca16['query'][_0x6f87('0x3e')]){_0x176506[_0x6f87('0x3a')]=_[_0x6f87('0x3c')](_0x176506['where'],{'$or':_[_0x6f87('0x2b')](_0x176506[_0x6f87('0x35')],function(_0x4f4bf7){var _0x5133d9={};_0x5133d9[_0x4f4bf7]={'$like':'%'+_0x5eca16[_0x6f87('0x31')]['filter']+'%'};return _0x5133d9;})});}_0x176506=_[_0x6f87('0x3c')]({},_0x176506,_0x5eca16['options']);return _0x511974[_0x6f87('0x63')](_0x176506);}})[_0x6f87('0x23')](function(_0x3ad776){if(_0x3ad776){_0x4b645d=_0x3ad776[_0x6f87('0x36')];if(!_0x5eca16[_0x6f87('0x31')]['hasOwnProperty'](_0x6f87('0x37'))){_0x176506['limit']=qs[_0x6f87('0x1a')](_0x5eca16[_0x6f87('0x31')][_0x6f87('0x1a')]);_0x176506[_0x6f87('0x18')]=qs[_0x6f87('0x18')](_0x5eca16[_0x6f87('0x31')][_0x6f87('0x18')]);}return _0x511974[_0x6f87('0x63')](_0x176506);}})[_0x6f87('0x23')](function(_0x20144c){if(_0x20144c){return _0x20144c?{'count':_0x4b645d,'rows':_0x20144c}:null;}})['then'](respondWithResult(_0x1803ce,null))['catch'](handleError(_0x1803ce,null));};exports[_0x6f87('0x64')]=function(_0xb0c29b,_0x2a01b4,_0x4a7d8b){var _0x323fe9,_0x9a5d6f;return db[_0x6f87('0x40')][_0x6f87('0x4e')]({'where':{'id':_0xb0c29b[_0x6f87('0x56')]['id']}})[_0x6f87('0x23')](handleEntityNotFound(_0x2a01b4,null))[_0x6f87('0x23')](function(_0x3c5f67){if(_0x3c5f67){_0x9a5d6f=_0x3c5f67;return _0x3c5f67[_0x6f87('0x64')](_0xb0c29b[_0x6f87('0x49')][_0x6f87('0x65')],_[_0x6f87('0x53')](_0xb0c29b[_0x6f87('0x49')],[_0x6f87('0x65'),'id'])||{});}return null;})[_0x6f87('0x66')](function(_0xf22be0){var _0x254340;_0x323fe9=_0xf22be0||[];var _0x270d3c=[];if(_0xf22be0){for(var _0x3cf8e1=0x0;_0x3cf8e1<_0xf22be0['length'];_0x3cf8e1+=0x1){var _0x15ec40=_0xf22be0[_0x3cf8e1]['get']({'plain':!![]});_0x9a5d6f[_0x6f87('0x67')]=_0xb0c29b[_0x6f87('0x49')][_0x6f87('0x67')]?_0xb0c29b[_0x6f87('0x49')][_0x6f87('0x67')]:_0x9a5d6f['dialCheckDuplicateType'];switch(_0x9a5d6f[_0x6f87('0x67')]){case _0x6f87('0x68'):_0x254340=squel[_0x6f87('0x69')]()[_0x6f87('0x6a')](_0x6f87('0x6b'))[_0x6f87('0x6c')](['phone','scheduledAt','ContactId',_0x6f87('0x6d'),_0x6f87('0x5a'),_0x6f87('0x54'),_0x6f87('0x55')],squel[_0x6f87('0x6e')]()[_0x6f87('0x6f')](_0x6f87('0x70'),'phone')[_0x6f87('0x6f')](_0x6f87('0x71'),'scheduledAt')[_0x6f87('0x6f')]('id',_0x6f87('0x72'))[_0x6f87('0x6f')](_0x15ec40['CmListId'][_0x6f87('0x73')](),_0x6f87('0x6d'))['field'](_0xb0c29b['params']['id']['toString'](),_0x6f87('0x5a'))['field'](_0x6f87('0x71'),_0x6f87('0x54'))[_0x6f87('0x6f')](_0x6f87('0x71'),_0x6f87('0x55'))[_0x6f87('0x74')]('cm_contacts')['where'](_0x6f87('0x75'))[_0x6f87('0x3a')](_0x6f87('0x76'),_0x15ec40[_0x6f87('0x77')][_0x6f87('0x73')]())[_0x6f87('0x3a')](_0x6f87('0x78'))['where']('phone\x20NOT\x20IN\x20(?)',squel[_0x6f87('0x6e')]()[_0x6f87('0x6f')](_0x6f87('0x79'))[_0x6f87('0x74')](_0x6f87('0x7a'))[_0x6f87('0x3a')](_0x6f87('0x7b'),_0xb0c29b[_0x6f87('0x56')]['id']['toString']()))[_0x6f87('0x3a')](_0x6f87('0x7c'),squel['select']()[_0x6f87('0x6f')]('COALESCE(phone,\x27\x27)')[_0x6f87('0x74')](_0x6f87('0x6b'))[_0x6f87('0x3a')](_0x6f87('0x7b'),_0xb0c29b[_0x6f87('0x56')]['id']['toString']())))['toString']();break;case'onlyIfOpen':_0x254340=squel[_0x6f87('0x69')]()[_0x6f87('0x6a')](_0x6f87('0x6b'))[_0x6f87('0x6c')]([_0x6f87('0x70'),_0x6f87('0x7d'),_0x6f87('0x72'),'ListId','CampaignId',_0x6f87('0x54'),_0x6f87('0x55')],squel[_0x6f87('0x6e')]()[_0x6f87('0x6f')](_0x6f87('0x70'),_0x6f87('0x70'))[_0x6f87('0x6f')](_0x6f87('0x71'),_0x6f87('0x7d'))['field']('id',_0x6f87('0x72'))[_0x6f87('0x6f')](_0x15ec40[_0x6f87('0x77')]['toString'](),_0x6f87('0x6d'))[_0x6f87('0x6f')](_0xb0c29b[_0x6f87('0x56')]['id'][_0x6f87('0x73')](),_0x6f87('0x5a'))['field'](_0x6f87('0x71'),_0x6f87('0x54'))['field']('NOW()','updatedAt')[_0x6f87('0x74')](_0x6f87('0x7e'))[_0x6f87('0x3a')](_0x6f87('0x75'))[_0x6f87('0x3a')](_0x6f87('0x76'),_0x15ec40[_0x6f87('0x77')][_0x6f87('0x73')]())[_0x6f87('0x3a')](_0x6f87('0x78'))[_0x6f87('0x3a')](_0x6f87('0x7c'),squel['select']()['field'](_0x6f87('0x7f'))[_0x6f87('0x74')](_0x6f87('0x6b'))[_0x6f87('0x3a')](_0x6f87('0x7b'),_0xb0c29b[_0x6f87('0x56')]['id'][_0x6f87('0x73')]())))['toString']();break;default:_0x254340=squel['insert']()[_0x6f87('0x6a')](_0x6f87('0x6b'))[_0x6f87('0x6c')]([_0x6f87('0x70'),_0x6f87('0x7d'),_0x6f87('0x72'),_0x6f87('0x6d'),_0x6f87('0x5a'),_0x6f87('0x54'),_0x6f87('0x55')],squel[_0x6f87('0x6e')]()[_0x6f87('0x6f')]('phone','phone')['field'](_0x6f87('0x71'),_0x6f87('0x7d'))['field']('id',_0x6f87('0x72'))[_0x6f87('0x6f')](_0x15ec40[_0x6f87('0x77')][_0x6f87('0x73')](),_0x6f87('0x6d'))[_0x6f87('0x6f')](_0xb0c29b[_0x6f87('0x56')]['id'][_0x6f87('0x73')](),'CampaignId')[_0x6f87('0x6f')](_0x6f87('0x71'),_0x6f87('0x54'))[_0x6f87('0x6f')](_0x6f87('0x71'),_0x6f87('0x55'))[_0x6f87('0x74')]('cm_contacts')[_0x6f87('0x3a')](_0x6f87('0x75'))['where']('ListId\x20=\x20?',_0x15ec40[_0x6f87('0x77')][_0x6f87('0x73')]())[_0x6f87('0x3a')]('phone\x20IS\x20NOT\x20NULL'))[_0x6f87('0x73')]();}_0x270d3c[_0x6f87('0x80')](db['sequelize'][_0x6f87('0x31')](_0x254340));}return BPromise[_0x6f87('0x81')](_0x270d3c);}})[_0x6f87('0x23')](function(){return _0x323fe9;})[_0x6f87('0x23')](respondWithResult(_0x2a01b4,null))['catch'](handleError(_0x2a01b4,null));};exports[_0x6f87('0x82')]=function(_0x19b4a0,_0x588627,_0x28b865){return db[_0x6f87('0x40')][_0x6f87('0x4e')]({'where':{'id':_0x19b4a0[_0x6f87('0x56')]['id']}})['then'](handleEntityNotFound(_0x588627,null))[_0x6f87('0x23')](function(_0x342154){if(_0x342154){return _0x342154[_0x6f87('0x82')](_0x19b4a0['query'][_0x6f87('0x65')]);}})['then'](function(_0x52440b){if(_0x52440b){return db[_0x6f87('0x5b')]['destroy']({'where':{'ListId':_0x19b4a0['query']['ids'],'CampaignId':_0x19b4a0[_0x6f87('0x56')]['id']}})[_0x6f87('0x23')](function(){return _0x52440b;});}})[_0x6f87('0x23')](respondWithStatusCode(_0x588627,null))['catch'](handleError(_0x588627,null));};exports[_0x6f87('0x83')]=function(_0x5f223d,_0x48e932,_0x18a6f3){var _0x4271eb={};var _0x5b37f6={};var _0x4f9c0a;var _0x27c1ac;return db[_0x6f87('0x40')][_0x6f87('0x57')]({'where':{'id':_0x5f223d[_0x6f87('0x56')]['id']}})[_0x6f87('0x23')](handleEntityNotFound(_0x48e932,null))[_0x6f87('0x23')](function(_0x239693){if(_0x239693){_0x4f9c0a=_0x239693;_0x5b37f6[_0x6f87('0x2f')]=_[_0x6f87('0x32')](db[_0x6f87('0x62')][_0x6f87('0x47')]);_0x5b37f6[_0x6f87('0x31')]=_['keys'](_0x5f223d[_0x6f87('0x31')]);_0x5b37f6[_0x6f87('0x3b')]=_[_0x6f87('0x33')](_0x5b37f6['model'],_0x5b37f6[_0x6f87('0x31')]);_0x4271eb[_0x6f87('0x35')]=_['intersection'](_0x5b37f6[_0x6f87('0x2f')],qs['fields'](_0x5f223d[_0x6f87('0x31')][_0x6f87('0x34')]));_0x4271eb[_0x6f87('0x35')]=_0x4271eb[_0x6f87('0x35')][_0x6f87('0x36')]?_0x4271eb['attributes']:_0x5b37f6[_0x6f87('0x2f')];_0x4271eb[_0x6f87('0x38')]=qs[_0x6f87('0x39')](_0x5f223d[_0x6f87('0x31')]['sort']);_0x4271eb[_0x6f87('0x3a')]=qs['filters'](_[_0x6f87('0x59')](_0x5f223d[_0x6f87('0x31')],_0x5b37f6[_0x6f87('0x3b')]));if(_0x5f223d[_0x6f87('0x31')][_0x6f87('0x3e')]){_0x4271eb[_0x6f87('0x3a')]=_['merge'](_0x4271eb['where'],{'$or':_[_0x6f87('0x2b')](_0x4271eb[_0x6f87('0x35')],function(_0x249fa8){var _0x1b0c25={};_0x1b0c25[_0x249fa8]={'$like':'%'+_0x5f223d[_0x6f87('0x31')][_0x6f87('0x3e')]+'%'};return _0x1b0c25;})});}_0x4271eb=_[_0x6f87('0x3c')]({},_0x4271eb,_0x5f223d['options']);return _0x4f9c0a[_0x6f87('0x83')](_0x4271eb);}})['then'](function(_0x321343){if(_0x321343){_0x27c1ac=_0x321343[_0x6f87('0x36')];if(!_0x5f223d[_0x6f87('0x31')]['hasOwnProperty'](_0x6f87('0x37'))){_0x4271eb[_0x6f87('0x1a')]=qs['limit'](_0x5f223d[_0x6f87('0x31')][_0x6f87('0x1a')]);_0x4271eb['offset']=qs['offset'](_0x5f223d[_0x6f87('0x31')][_0x6f87('0x18')]);}return _0x4f9c0a[_0x6f87('0x83')](_0x4271eb);}})[_0x6f87('0x23')](function(_0x248787){if(_0x248787){return _0x248787?{'count':_0x27c1ac,'rows':_0x248787}:null;}})[_0x6f87('0x23')](respondWithResult(_0x48e932,null))[_0x6f87('0x45')](handleError(_0x48e932,null));};exports[_0x6f87('0x84')]=function(_0x4d0fb8,_0x328543,_0x5642a2){var _0x4fbf58,_0x34563e;return db[_0x6f87('0x40')][_0x6f87('0x4e')]({'where':{'id':_0x4d0fb8[_0x6f87('0x56')]['id']}})[_0x6f87('0x23')](handleEntityNotFound(_0x328543,null))[_0x6f87('0x23')](function(_0x3e2d5d){if(_0x3e2d5d){_0x34563e=_0x3e2d5d;return _0x3e2d5d[_0x6f87('0x84')](_0x4d0fb8[_0x6f87('0x49')]['ids'],_[_0x6f87('0x53')](_0x4d0fb8['body'],['ids','id'])||{});}return null;})[_0x6f87('0x66')](function(_0x2ac94e){var _0x402c70;_0x4fbf58=_0x2ac94e||[];var _0x564c88=[];if(_0x2ac94e){for(var _0x393d14=0x0;_0x393d14<_0x2ac94e[_0x6f87('0x36')];_0x393d14+=0x1){var _0x587e50=_0x2ac94e[_0x393d14][_0x6f87('0x24')]({'plain':!![]});_0x402c70=squel[_0x6f87('0x69')]()[_0x6f87('0x6a')](_0x6f87('0x85'))['fromQuery'](['phone',_0x6f87('0x72'),_0x6f87('0x6d'),_0x6f87('0x5a'),'createdAt',_0x6f87('0x55')],squel[_0x6f87('0x6e')]()[_0x6f87('0x6f')]('phone',_0x6f87('0x70'))['field']('id','ContactId')[_0x6f87('0x6f')](_0x587e50['CmListId']['toString'](),_0x6f87('0x6d'))[_0x6f87('0x6f')](_0x4d0fb8[_0x6f87('0x56')]['id'][_0x6f87('0x73')](),_0x6f87('0x5a'))[_0x6f87('0x6f')](_0x6f87('0x71'),_0x6f87('0x54'))[_0x6f87('0x6f')]('NOW()',_0x6f87('0x55'))['from'](_0x6f87('0x7e'))['where'](_0x6f87('0x75'))[_0x6f87('0x3a')]('ListId\x20=\x20?',_0x587e50[_0x6f87('0x77')][_0x6f87('0x73')]())[_0x6f87('0x3a')](_0x6f87('0x78')))[_0x6f87('0x73')]();_0x564c88[_0x6f87('0x80')](db[_0x6f87('0x86')][_0x6f87('0x31')](_0x402c70));}return BPromise['all'](_0x564c88);}})['then'](function(){return _0x4fbf58;})['then'](respondWithResult(_0x328543,null))[_0x6f87('0x45')](handleError(_0x328543,null));};exports[_0x6f87('0x87')]=function(_0x49ac0e,_0x363b2a,_0x2be477){return db[_0x6f87('0x40')]['find']({'where':{'id':_0x49ac0e[_0x6f87('0x56')]['id']}})[_0x6f87('0x23')](handleEntityNotFound(_0x363b2a,null))[_0x6f87('0x23')](function(_0x4f6a1b){if(_0x4f6a1b){return _0x4f6a1b[_0x6f87('0x87')](_0x49ac0e[_0x6f87('0x31')][_0x6f87('0x65')]);}})['then'](function(_0x1fe021){if(_0x1fe021){return db[_0x6f87('0x61')][_0x6f87('0x27')]({'where':{'ListId':_0x49ac0e[_0x6f87('0x31')]['ids'],'CampaignId':_0x49ac0e[_0x6f87('0x56')]['id']}})[_0x6f87('0x23')](function(){return _0x1fe021;});}})[_0x6f87('0x23')](respondWithStatusCode(_0x363b2a,null))[_0x6f87('0x45')](handleError(_0x363b2a,null));};
\ No newline at end of file
diff --git a/server/api/campaign/campaign.model.js b/server/api/campaign/campaign.model.js
index a649b1d..c382a89 100644
--- a/server/api/campaign/campaign.model.js
+++ b/server/api/campaign/campaign.model.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x7a54=['../../config/logger','moment','bluebird','path','rimraf','../../config/environment','./campaign.attributes','exports','Campaign','campaigns','lodash','util'];(function(_0x2dbcef,_0x1cfecb){var _0x5a90ea=function(_0x189054){while(--_0x189054){_0x2dbcef['push'](_0x2dbcef['shift']());}};_0x5a90ea(++_0x1cfecb);}(_0x7a54,0x106));var _0x47a5=function(_0x350a59,_0x219dbe){_0x350a59=_0x350a59-0x0;var _0x12a03b=_0x7a54[_0x350a59];return _0x12a03b;};'use strict';var _=require(_0x47a5('0x0'));var util=require(_0x47a5('0x1'));var logger=require(_0x47a5('0x2'))('api');var moment=require(_0x47a5('0x3'));var BPromise=require(_0x47a5('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x47a5('0x5'));var rimraf=require(_0x47a5('0x6'));var config=require(_0x47a5('0x7'));var attributes=require(_0x47a5('0x8'));module[_0x47a5('0x9')]=function(_0x545a97,_0x3d5629){return _0x545a97['define'](_0x47a5('0xa'),attributes,{'tableName':_0x47a5('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x9957=['exports','define','Campaign','lodash','util','../../config/logger','api','bluebird','request-promise','path','rimraf','./campaign.attributes'];(function(_0x580647,_0x43d2c3){var _0x5f0792=function(_0x386cef){while(--_0x386cef){_0x580647['push'](_0x580647['shift']());}};_0x5f0792(++_0x43d2c3);}(_0x9957,0x93));var _0x7995=function(_0x5ddb1c,_0x5ea4df){_0x5ddb1c=_0x5ddb1c-0x0;var _0x354adc=_0x9957[_0x5ddb1c];return _0x354adc;};'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 fc84bfe..cdc6872 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 _0x0487=['map','attributes','model','GetCampaign','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','rpc','../../config/environment','jayson/promise','client','then','info','Campaign,\x20%s,\x20%s','request\x20sent','debug','Campaign,\x20%s,\x20%s,\x20%s','stringify','error','message','findAll','options','where','limit','include'];(function(_0x369151,_0x179f72){var _0x4292d5=function(_0x330422){while(--_0x330422){_0x369151['push'](_0x369151['shift']());}};_0x4292d5(++_0x179f72);}(_0x0487,0x14f));var _0x7048=function(_0x37a7c6,_0x3a84b6){_0x37a7c6=_0x37a7c6-0x0;var _0x539905=_0x0487[_0x37a7c6];return _0x539905;};'use strict';var _=require(_0x7048('0x0'));var util=require(_0x7048('0x1'));var moment=require(_0x7048('0x2'));var BPromise=require(_0x7048('0x3'));var rs=require(_0x7048('0x4'));var fs=require('fs');var Redis=require(_0x7048('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0x7048('0x6'));var logger=require('../../config/logger')(_0x7048('0x7'));var config=require(_0x7048('0x8'));var jayson=require(_0x7048('0x9'));var client=jayson[_0x7048('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x2aaedd,_0x140c84,_0xf90179){return new BPromise(function(_0x5683ce,_0x40c685){return client['request'](_0x2aaedd,_0xf90179)[_0x7048('0xb')](function(_0x40fc92){logger[_0x7048('0xc')](_0x7048('0xd'),_0x140c84,_0x7048('0xe'));logger[_0x7048('0xf')](_0x7048('0x10'),_0x140c84,'request\x20sent',JSON[_0x7048('0x11')](_0x40fc92));if(_0x40fc92[_0x7048('0x12')]){if(_0x40fc92[_0x7048('0x12')]['code']===0x1f4){logger[_0x7048('0x12')](_0x7048('0xd'),_0x140c84,_0x40fc92['error'][_0x7048('0x13')]);return _0x40c685(_0x40fc92[_0x7048('0x12')][_0x7048('0x13')]);}logger[_0x7048('0x12')](_0x7048('0xd'),_0x140c84,_0x40fc92['error'][_0x7048('0x13')]);return _0x5683ce(_0x40fc92['error'][_0x7048('0x13')]);}else{logger[_0x7048('0xc')](_0x7048('0xd'),_0x140c84,_0x7048('0xe'));_0x5683ce(_0x40fc92['result'][_0x7048('0x13')]);}})['catch'](function(_0x1082a0){logger[_0x7048('0x12')]('Campaign,\x20%s,\x20%s',_0x140c84,_0x1082a0);_0x40c685(_0x1082a0);});});}exports['GetCampaign']=function(_0x255d5d){var _0xbef931=this;return new Promise(function(_0x1db323,_0xe5fd91){return db['Campaign'][_0x7048('0x14')]({'raw':_0x255d5d['options']?_0x255d5d['options']['raw']===undefined?!![]:![]:!![],'where':_0x255d5d[_0x7048('0x15')]?_0x255d5d[_0x7048('0x15')][_0x7048('0x16')]||null:null,'attributes':_0x255d5d[_0x7048('0x15')]?_0x255d5d[_0x7048('0x15')]['attributes']||null:null,'limit':_0x255d5d[_0x7048('0x15')]?_0x255d5d['options'][_0x7048('0x17')]||null:null,'include':_0x255d5d[_0x7048('0x15')]?_0x255d5d[_0x7048('0x15')][_0x7048('0x18')]?_[_0x7048('0x19')](_0x255d5d[_0x7048('0x15')]['include'],function(_0x4c8709){return{'model':db[_0x4c8709['model']],'as':_0x4c8709['as'],'attributes':_0x4c8709[_0x7048('0x1a')],'include':_0x4c8709['include']?_[_0x7048('0x19')](_0x4c8709[_0x7048('0x18')],function(_0x3c7c96){return{'model':db[_0x3c7c96['model']],'as':_0x3c7c96['as'],'attributes':_0x3c7c96[_0x7048('0x1a')],'include':_0x3c7c96['include']?_[_0x7048('0x19')](_0x3c7c96['include'],function(_0xe3b552){return{'model':db[_0xe3b552[_0x7048('0x1b')]],'as':_0xe3b552['as'],'attributes':_0xe3b552[_0x7048('0x1a')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x384ff7){logger['info'](_0x7048('0x1c'),_0x255d5d);logger['debug'](_0x7048('0x1c'),_0x255d5d,JSON['stringify'](_0x384ff7));_0x1db323(_0x384ff7);})[_0x7048('0x1d')](function(_0x3ccc34){logger['error']('GetCampaign',_0x3ccc34['message'],_0x255d5d);_0xe5fd91(_0xbef931[_0x7048('0x12')](0x1f4,_0x3ccc34[_0x7048('0x13')]));});});};
\ No newline at end of file
+var _0x0962=['jayson/promise','client','http','request','then','info','Campaign,\x20%s,\x20%s','request\x20sent','Campaign,\x20%s,\x20%s,\x20%s','error','code','message','catch','GetCampaign','Campaign','options','raw','where','attributes','include','model','map','debug','stringify','lodash','util','moment','bluebird','ioredis','../../config/logger','rpc','../../config/environment'];(function(_0x34a11a,_0x131ee5){var _0x5220be=function(_0x215bbc){while(--_0x215bbc){_0x34a11a['push'](_0x34a11a['shift']());}};_0x5220be(++_0x131ee5);}(_0x0962,0x198));var _0x2096=function(_0x474c90,_0x96f754){_0x474c90=_0x474c90-0x0;var _0x23e956=_0x0962[_0x474c90];return _0x23e956;};'use strict';var _=require(_0x2096('0x0'));var util=require(_0x2096('0x1'));var moment=require(_0x2096('0x2'));var BPromise=require(_0x2096('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x2096('0x4'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x2096('0x5'))(_0x2096('0x6'));var config=require(_0x2096('0x7'));var jayson=require(_0x2096('0x8'));var client=jayson[_0x2096('0x9')][_0x2096('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x130711,_0x39471c,_0x4b5f76){return new BPromise(function(_0x16799f,_0x10b0e7){return client[_0x2096('0xb')](_0x130711,_0x4b5f76)[_0x2096('0xc')](function(_0x2f49bf){logger[_0x2096('0xd')](_0x2096('0xe'),_0x39471c,_0x2096('0xf'));logger['debug'](_0x2096('0x10'),_0x39471c,_0x2096('0xf'),JSON['stringify'](_0x2f49bf));if(_0x2f49bf[_0x2096('0x11')]){if(_0x2f49bf[_0x2096('0x11')][_0x2096('0x12')]===0x1f4){logger[_0x2096('0x11')](_0x2096('0xe'),_0x39471c,_0x2f49bf['error'][_0x2096('0x13')]);return _0x10b0e7(_0x2f49bf[_0x2096('0x11')][_0x2096('0x13')]);}logger['error'](_0x2096('0xe'),_0x39471c,_0x2f49bf[_0x2096('0x11')][_0x2096('0x13')]);return _0x16799f(_0x2f49bf['error'][_0x2096('0x13')]);}else{logger[_0x2096('0xd')](_0x2096('0xe'),_0x39471c,_0x2096('0xf'));_0x16799f(_0x2f49bf['result'][_0x2096('0x13')]);}})[_0x2096('0x14')](function(_0x1ffbb8){logger['error']('Campaign,\x20%s,\x20%s',_0x39471c,_0x1ffbb8);_0x10b0e7(_0x1ffbb8);});});}exports[_0x2096('0x15')]=function(_0x22c478){var _0x4e4dc2=this;return new Promise(function(_0xd7e9e0,_0x2b7da7){return db[_0x2096('0x16')]['findAll']({'raw':_0x22c478[_0x2096('0x17')]?_0x22c478['options'][_0x2096('0x18')]===undefined?!![]:![]:!![],'where':_0x22c478[_0x2096('0x17')]?_0x22c478[_0x2096('0x17')][_0x2096('0x19')]||null:null,'attributes':_0x22c478[_0x2096('0x17')]?_0x22c478[_0x2096('0x17')][_0x2096('0x1a')]||null:null,'limit':_0x22c478[_0x2096('0x17')]?_0x22c478[_0x2096('0x17')]['limit']||null:null,'include':_0x22c478[_0x2096('0x17')]?_0x22c478['options'][_0x2096('0x1b')]?_['map'](_0x22c478['options'][_0x2096('0x1b')],function(_0x686f15){return{'model':db[_0x686f15[_0x2096('0x1c')]],'as':_0x686f15['as'],'attributes':_0x686f15[_0x2096('0x1a')],'include':_0x686f15[_0x2096('0x1b')]?_[_0x2096('0x1d')](_0x686f15[_0x2096('0x1b')],function(_0xe72b8a){return{'model':db[_0xe72b8a[_0x2096('0x1c')]],'as':_0xe72b8a['as'],'attributes':_0xe72b8a[_0x2096('0x1a')],'include':_0xe72b8a[_0x2096('0x1b')]?_[_0x2096('0x1d')](_0xe72b8a['include'],function(_0x4a78e7){return{'model':db[_0x4a78e7[_0x2096('0x1c')]],'as':_0x4a78e7['as'],'attributes':_0x4a78e7[_0x2096('0x1a')]};}):[]};}):[]};}):[]:[]})[_0x2096('0xc')](function(_0x35f1c3){logger[_0x2096('0xd')](_0x2096('0x15'),_0x22c478);logger[_0x2096('0x1e')](_0x2096('0x15'),_0x22c478,JSON[_0x2096('0x1f')](_0x35f1c3));_0xd7e9e0(_0x35f1c3);})['catch'](function(_0x1524de){logger[_0x2096('0x11')](_0x2096('0x15'),_0x1524de[_0x2096('0x13')],_0x22c478);_0x2b7da7(_0x4e4dc2[_0x2096('0x11')](0x1f4,_0x1524de[_0x2096('0x13')]));});});};
\ No newline at end of file
diff --git a/server/api/campaign/index.js b/server/api/campaign/index.js
index 7843dd2..1ba6412 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 _0x8b7c=['../../components/auth/service','../../config/environment','./campaign.controller','get','index','/:id','isAuthenticated','show','/:id/hopper_histories','getHopperHistories','/:id/hopper_black','getHopperBlacks','getLists','/:id/blacklists','getBlackLists','post','create','clone','/:id/lists','addLists','addBlackLists','put','delete','removeLists','removeBlackLists','multer','util','path','connect-timeout','express','Router','fs-extra'];(function(_0x11a92c,_0xd10035){var _0x190b60=function(_0x1ffbaa){while(--_0x1ffbaa){_0x11a92c['push'](_0x11a92c['shift']());}};_0x190b60(++_0xd10035);}(_0x8b7c,0x119));var _0xc8b7=function(_0x486f1d,_0x90c2b5){_0x486f1d=_0x486f1d-0x0;var _0x5a2c2d=_0x8b7c[_0x486f1d];return _0x5a2c2d;};'use strict';var multer=require(_0xc8b7('0x0'));var util=require(_0xc8b7('0x1'));var path=require(_0xc8b7('0x2'));var timeout=require(_0xc8b7('0x3'));var express=require(_0xc8b7('0x4'));var router=express[_0xc8b7('0x5')]();var fs_extra=require(_0xc8b7('0x6'));var auth=require(_0xc8b7('0x7'));var interaction=require('../../components/interaction/service');var config=require(_0xc8b7('0x8'));var controller=require(_0xc8b7('0x9'));router[_0xc8b7('0xa')]('/',auth['isAuthenticated'](),controller[_0xc8b7('0xb')]);router[_0xc8b7('0xa')](_0xc8b7('0xc'),auth[_0xc8b7('0xd')](),controller[_0xc8b7('0xe')]);router[_0xc8b7('0xa')]('/:id/hoppers',auth[_0xc8b7('0xd')](),controller['getHoppers']);router[_0xc8b7('0xa')](_0xc8b7('0xf'),auth[_0xc8b7('0xd')](),controller[_0xc8b7('0x10')]);router[_0xc8b7('0xa')]('/:id/hopper_finals',auth['isAuthenticated'](),controller['getHopperFinals']);router[_0xc8b7('0xa')](_0xc8b7('0x11'),auth[_0xc8b7('0xd')](),controller[_0xc8b7('0x12')]);router['get']('/:id/lists',auth['isAuthenticated'](),controller[_0xc8b7('0x13')]);router[_0xc8b7('0xa')](_0xc8b7('0x14'),auth['isAuthenticated'](),controller[_0xc8b7('0x15')]);router[_0xc8b7('0x16')]('/',auth[_0xc8b7('0xd')](),controller[_0xc8b7('0x17')]);router[_0xc8b7('0x16')]('/:id/clone',auth[_0xc8b7('0xd')](),controller[_0xc8b7('0x18')]);router[_0xc8b7('0x16')](_0xc8b7('0x19'),auth[_0xc8b7('0xd')](),controller[_0xc8b7('0x1a')]);router[_0xc8b7('0x16')]('/:id/blacklists',auth['isAuthenticated'](),controller[_0xc8b7('0x1b')]);router[_0xc8b7('0x1c')](_0xc8b7('0xc'),auth['isAuthenticated'](),controller['update']);router[_0xc8b7('0x1d')]('/:id',auth[_0xc8b7('0xd')](),controller['destroy']);router[_0xc8b7('0x1d')](_0xc8b7('0x19'),auth['isAuthenticated'](),controller[_0xc8b7('0x1e')]);router['delete'](_0xc8b7('0x14'),auth[_0xc8b7('0xd')](),controller[_0xc8b7('0x1f')]);module['exports']=router;
\ No newline at end of file
+var _0x193f=['destroy','removeLists','removeBlackLists','exports','multer','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','./campaign.controller','get','isAuthenticated','index','/:id','show','/:id/hoppers','/:id/hopper_histories','getHopperHistories','getHopperFinals','/:id/hopper_black','/:id/lists','/:id/blacklists','getBlackLists','post','/:id/clone','clone','put','update','delete'];(function(_0x59d89e,_0x55edf5){var _0x554e93=function(_0x3d40bc){while(--_0x3d40bc){_0x59d89e['push'](_0x59d89e['shift']());}};_0x554e93(++_0x55edf5);}(_0x193f,0x9f));var _0xf193=function(_0x265aa2,_0x220072){_0x265aa2=_0x265aa2-0x0;var _0x447a3a=_0x193f[_0x265aa2];return _0x447a3a;};'use strict';var multer=require(_0xf193('0x0'));var util=require(_0xf193('0x1'));var path=require(_0xf193('0x2'));var timeout=require(_0xf193('0x3'));var express=require('express');var router=express[_0xf193('0x4')]();var fs_extra=require(_0xf193('0x5'));var auth=require(_0xf193('0x6'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0xf193('0x7'));router[_0xf193('0x8')]('/',auth[_0xf193('0x9')](),controller[_0xf193('0xa')]);router[_0xf193('0x8')](_0xf193('0xb'),auth[_0xf193('0x9')](),controller[_0xf193('0xc')]);router['get'](_0xf193('0xd'),auth[_0xf193('0x9')](),controller['getHoppers']);router[_0xf193('0x8')](_0xf193('0xe'),auth[_0xf193('0x9')](),controller[_0xf193('0xf')]);router[_0xf193('0x8')]('/:id/hopper_finals',auth[_0xf193('0x9')](),controller[_0xf193('0x10')]);router[_0xf193('0x8')](_0xf193('0x11'),auth[_0xf193('0x9')](),controller['getHopperBlacks']);router[_0xf193('0x8')](_0xf193('0x12'),auth[_0xf193('0x9')](),controller['getLists']);router[_0xf193('0x8')](_0xf193('0x13'),auth[_0xf193('0x9')](),controller[_0xf193('0x14')]);router[_0xf193('0x15')]('/',auth[_0xf193('0x9')](),controller['create']);router[_0xf193('0x15')](_0xf193('0x16'),auth[_0xf193('0x9')](),controller[_0xf193('0x17')]);router[_0xf193('0x15')](_0xf193('0x12'),auth[_0xf193('0x9')](),controller['addLists']);router[_0xf193('0x15')]('/:id/blacklists',auth['isAuthenticated'](),controller['addBlackLists']);router[_0xf193('0x18')](_0xf193('0xb'),auth[_0xf193('0x9')](),controller[_0xf193('0x19')]);router[_0xf193('0x1a')](_0xf193('0xb'),auth[_0xf193('0x9')](),controller[_0xf193('0x1b')]);router['delete'](_0xf193('0x12'),auth[_0xf193('0x9')](),controller[_0xf193('0x1c')]);router[_0xf193('0x1a')](_0xf193('0x13'),auth['isAuthenticated'](),controller[_0xf193('0x1d')]);module[_0xf193('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 908c69b..0f4cb81 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 _0xda19=['exports','STRING','TEXT','VIRTUAL','key'];(function(_0xa4c85,_0x2b52a7){var _0x172c1f=function(_0x149473){while(--_0x149473){_0xa4c85['push'](_0xa4c85['shift']());}};_0x172c1f(++_0x2b52a7);}(_0xda19,0x181));var _0x9da1=function(_0x1c4004,_0x5bb18d){_0x1c4004=_0x1c4004-0x0;var _0x2b9169=_0xda19[_0x1c4004];return _0x2b9169;};'use strict';var Sequelize=require('sequelize');module[_0x9da1('0x0')]={'key':{'type':Sequelize[_0x9da1('0x1')],'allowNull':![]},'value':{'type':Sequelize[_0x9da1('0x2')],'allowNull':![]},'description':{'type':Sequelize[_0x9da1('0x1')]},'name':{'type':Sequelize[_0x9da1('0x3')],'get':function(){return this['getDataValue'](_0x9da1('0x4'));}}};
\ No newline at end of file
+var _0x3b45=['key','exports','TEXT','STRING','VIRTUAL','getDataValue'];(function(_0x1e1020,_0xd64a27){var _0x464719=function(_0x376ffa){while(--_0x376ffa){_0x1e1020['push'](_0x1e1020['shift']());}};_0x464719(++_0xd64a27);}(_0x3b45,0x67));var _0x53b4=function(_0x382052,_0xc612bc){_0x382052=_0x382052-0x0;var _0x31d728=_0x3b45[_0x382052];return _0x31d728;};'use strict';var Sequelize=require('sequelize');module[_0x53b4('0x0')]={'key':{'type':Sequelize['STRING'],'allowNull':![]},'value':{'type':Sequelize[_0x53b4('0x1')],'allowNull':![]},'description':{'type':Sequelize[_0x53b4('0x2')]},'name':{'type':Sequelize[_0x53b4('0x3')],'get':function(){return this[_0x53b4('0x4')](_0x53b4('0x5'));}}};
\ No newline at end of file
diff --git a/server/api/cannedAnswer/cannedAnswer.controller.js b/server/api/cannedAnswer/cannedAnswer.controller.js
index f32ee36..4a99313 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 _0xdc2c=['rawAttributes','type','key','model','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','filter','merge','count','findAll','rows','catch','show','params','include','options','find','body','create','MailAccountId','SmsAccountId','OpenchannelAccountId','ChatWebsiteId','Sequelize','ValidationError','The\x20inserted\x20key\x20already\x20exists.','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','to-csv','ejs','lodash','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/license/util','../../mysqldb','status','end','offset','undefined','limit','set','apply','reject','update','then','destroy','get','UserProfileResource','sendStatus','error','stack','name','send','map','CannedAnswer'];(function(_0x4ea69d,_0x290f53){var _0x5318e0=function(_0x18e081){while(--_0x18e081){_0x4ea69d['push'](_0x4ea69d['shift']());}};_0x5318e0(++_0x290f53);}(_0xdc2c,0x1de));var _0xcdc2=function(_0x13aadd,_0x39015c){_0x13aadd=_0x13aadd-0x0;var _0x29ed22=_0xdc2c[_0x13aadd];return _0x29ed22;};'use strict';var emlformat=require(_0xcdc2('0x0'));var rimraf=require(_0xcdc2('0x1'));var zipdir=require(_0xcdc2('0x2'));var jsonpatch=require(_0xcdc2('0x3'));var rp=require(_0xcdc2('0x4'));var moment=require(_0xcdc2('0x5'));var BPromise=require(_0xcdc2('0x6'));var Mustache=require(_0xcdc2('0x7'));var util=require('util');var path=require(_0xcdc2('0x8'));var sox=require(_0xcdc2('0x9'));var csv=require(_0xcdc2('0xa'));var ejs=require(_0xcdc2('0xb'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xcdc2('0xc'));var squel=require(_0xcdc2('0xd'));var crypto=require('crypto');var jsforce=require(_0xcdc2('0xe'));var deskjs=require(_0xcdc2('0xf'));var toCsv=require(_0xcdc2('0xa'));var querystring=require(_0xcdc2('0x10'));var Papa=require(_0xcdc2('0x11'));var Redis=require(_0xcdc2('0x12'));var authService=require(_0xcdc2('0x13'));var qs=require(_0xcdc2('0x14'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xcdc2('0x15'));var logger=require('../../config/logger')('api');var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0xcdc2('0x16'));var db=require(_0xcdc2('0x17'))['db'];function respondWithStatusCode(_0x40508b,_0x5a6e5c){_0x5a6e5c=_0x5a6e5c||0xcc;return function(_0x1da005){if(_0x1da005){return _0x40508b['sendStatus'](_0x5a6e5c);}return _0x40508b[_0xcdc2('0x18')](_0x5a6e5c)[_0xcdc2('0x19')]();};}function respondWithResult(_0x202ab7,_0xa8b6f2){_0xa8b6f2=_0xa8b6f2||0xc8;return function(_0x4c5e53){if(_0x4c5e53){return _0x202ab7[_0xcdc2('0x18')](_0xa8b6f2)['json'](_0x4c5e53);}};}function respondWithFilteredResult(_0x2a50ae,_0x279c08){return function(_0x33e4b2){if(_0x33e4b2){var _0x243e0a=typeof _0x279c08[_0xcdc2('0x1a')]===_0xcdc2('0x1b')&&typeof _0x279c08[_0xcdc2('0x1c')]===_0xcdc2('0x1b');var _0x51a928=_0x33e4b2['count'];var _0x1ed73e=_0x243e0a?0x0:_0x279c08[_0xcdc2('0x1a')];var _0x5f44ae=_0x243e0a?_0x33e4b2['count']:_0x279c08[_0xcdc2('0x1a')]+_0x279c08[_0xcdc2('0x1c')];var _0x4ae36e;if(_0x5f44ae>=_0x51a928){_0x5f44ae=_0x51a928;_0x4ae36e=0xc8;}else{_0x4ae36e=0xce;}_0x2a50ae[_0xcdc2('0x18')](_0x4ae36e);return _0x2a50ae[_0xcdc2('0x1d')]('Content-Range',_0x1ed73e+'-'+_0x5f44ae+'/'+_0x51a928)['json'](_0x33e4b2);}return null;};}function patchUpdates(_0x51fe92){return function(_0x4bb4ca){try{jsonpatch[_0xcdc2('0x1e')](_0x4bb4ca,_0x51fe92,!![]);}catch(_0x3af1d8){return BPromise[_0xcdc2('0x1f')](_0x3af1d8);}return _0x4bb4ca['save']();};}function saveUpdates(_0x2f8208,_0x223bdb){return function(_0x4f0902){if(_0x4f0902){return _0x4f0902[_0xcdc2('0x20')](_0x2f8208)[_0xcdc2('0x21')](function(_0x36629d){return _0x36629d;});}return null;};}function removeEntity(_0x32d717,_0x551ddc){return function(_0x53cb1a){if(_0x53cb1a){return _0x53cb1a[_0xcdc2('0x22')]()[_0xcdc2('0x21')](function(){var _0x44ea68=_0x53cb1a[_0xcdc2('0x23')]({'plain':!![]});var _0x5d4007='CannedAnswers';return db[_0xcdc2('0x24')][_0xcdc2('0x22')]({'where':{'type':_0x5d4007,'resourceId':_0x44ea68['id']}})[_0xcdc2('0x21')](function(){return _0x53cb1a;});})['then'](function(){_0x32d717[_0xcdc2('0x18')](0xcc)[_0xcdc2('0x19')]();});}};}function handleEntityNotFound(_0x45fb59,_0xb90491){return function(_0x529d37){if(!_0x529d37){_0x45fb59[_0xcdc2('0x25')](0x194);}return _0x529d37;};}function handleError(_0x5e58cb,_0x3e33b7){_0x3e33b7=_0x3e33b7||0x1f4;return function(_0x34cd55){logger[_0xcdc2('0x26')](_0x34cd55[_0xcdc2('0x27')]);if(_0x34cd55[_0xcdc2('0x28')]){delete _0x34cd55['name'];}_0x5e58cb[_0xcdc2('0x18')](_0x3e33b7)[_0xcdc2('0x29')](_0x34cd55);};}exports['index']=function(_0x5a40da,_0x748f33){var _0x9c5da7={},_0x350c01={},_0x3e5294={'count':0x0,'rows':[]};var _0xf9b713=_[_0xcdc2('0x2a')](db[_0xcdc2('0x2b')][_0xcdc2('0x2c')],function(_0x347364){return{'name':_0x347364['fieldName'],'type':_0x347364[_0xcdc2('0x2d')][_0xcdc2('0x2e')]};});_0x350c01[_0xcdc2('0x2f')]=_[_0xcdc2('0x2a')](_0xf9b713,'name');_0x350c01[_0xcdc2('0x30')]=_[_0xcdc2('0x31')](_0x5a40da['query']);_0x350c01[_0xcdc2('0x32')]=_[_0xcdc2('0x33')](_0x350c01[_0xcdc2('0x2f')],_0x350c01[_0xcdc2('0x30')]);_0x9c5da7['attributes']=_[_0xcdc2('0x33')](_0x350c01[_0xcdc2('0x2f')],qs[_0xcdc2('0x34')](_0x5a40da['query'][_0xcdc2('0x34')]));_0x9c5da7[_0xcdc2('0x35')]=_0x9c5da7[_0xcdc2('0x35')][_0xcdc2('0x36')]?_0x9c5da7['attributes']:_0x350c01['model'];if(!_0x5a40da[_0xcdc2('0x30')][_0xcdc2('0x37')](_0xcdc2('0x38'))){_0x9c5da7[_0xcdc2('0x1c')]=qs[_0xcdc2('0x1c')](_0x5a40da[_0xcdc2('0x30')][_0xcdc2('0x1c')]);_0x9c5da7['offset']=qs[_0xcdc2('0x1a')](_0x5a40da[_0xcdc2('0x30')][_0xcdc2('0x1a')]);}_0x9c5da7[_0xcdc2('0x39')]=qs[_0xcdc2('0x3a')](_0x5a40da[_0xcdc2('0x30')][_0xcdc2('0x3a')]);_0x9c5da7[_0xcdc2('0x3b')]=qs[_0xcdc2('0x32')](_['pick'](_0x5a40da[_0xcdc2('0x30')],_0x350c01[_0xcdc2('0x32')]),_0xf9b713);if(_0x5a40da[_0xcdc2('0x30')][_0xcdc2('0x3c')]){_0x9c5da7[_0xcdc2('0x3b')]=_[_0xcdc2('0x3d')](_0x9c5da7[_0xcdc2('0x3b')],{'$or':[{'key':{'$like':'%'+_0x5a40da[_0xcdc2('0x30')]['filter']+'%'}},{'value':{'$like':'%'+_0x5a40da['query'][_0xcdc2('0x3c')]+'%'}}]});}_0x9c5da7=_['merge']({},_0x9c5da7,_0x5a40da['options']);var _0x355bb8={'where':_0x9c5da7[_0xcdc2('0x3b')]};return db[_0xcdc2('0x2b')]['count'](_0x355bb8)[_0xcdc2('0x21')](function(_0x4d863b){_0x3e5294[_0xcdc2('0x3e')]=_0x4d863b;if(_0x5a40da[_0xcdc2('0x30')]['includeAll']){_0x9c5da7['include']=[{'all':!![]}];}return db[_0xcdc2('0x2b')][_0xcdc2('0x3f')](_0x9c5da7);})[_0xcdc2('0x21')](function(_0x3a7264){_0x3e5294[_0xcdc2('0x40')]=_0x3a7264;return _0x3e5294;})['then'](respondWithFilteredResult(_0x748f33,_0x9c5da7))[_0xcdc2('0x41')](handleError(_0x748f33,null));};exports[_0xcdc2('0x42')]=function(_0x2a404b,_0x28ff06){var _0x55fd21={'raw':!![],'where':{'id':_0x2a404b[_0xcdc2('0x43')]['id']}},_0x230d9c={};_0x230d9c[_0xcdc2('0x2f')]=_['keys'](db['CannedAnswer'][_0xcdc2('0x2c')]);_0x230d9c['query']=_[_0xcdc2('0x31')](_0x2a404b[_0xcdc2('0x30')]);_0x230d9c[_0xcdc2('0x32')]=_[_0xcdc2('0x33')](_0x230d9c[_0xcdc2('0x2f')],_0x230d9c[_0xcdc2('0x30')]);_0x55fd21[_0xcdc2('0x35')]=_['intersection'](_0x230d9c[_0xcdc2('0x2f')],qs[_0xcdc2('0x34')](_0x2a404b[_0xcdc2('0x30')][_0xcdc2('0x34')]));_0x55fd21[_0xcdc2('0x35')]=_0x55fd21['attributes']['length']?_0x55fd21[_0xcdc2('0x35')]:_0x230d9c[_0xcdc2('0x2f')];if(_0x2a404b[_0xcdc2('0x30')]['includeAll']){_0x55fd21[_0xcdc2('0x44')]=[{'all':!![]}];}_0x55fd21=_['merge']({},_0x55fd21,_0x2a404b[_0xcdc2('0x45')]);return db[_0xcdc2('0x2b')][_0xcdc2('0x46')](_0x55fd21)[_0xcdc2('0x21')](handleEntityNotFound(_0x28ff06,null))[_0xcdc2('0x21')](respondWithResult(_0x28ff06,null))[_0xcdc2('0x41')](handleError(_0x28ff06,null));};exports[_0xcdc2('0x20')]=function(_0xab5ff9,_0x27479b){if(_0xab5ff9[_0xcdc2('0x47')]['id']){delete _0xab5ff9[_0xcdc2('0x47')]['id'];}return db[_0xcdc2('0x2b')][_0xcdc2('0x46')]({'where':{'id':_0xab5ff9[_0xcdc2('0x43')]['id']}})[_0xcdc2('0x21')](handleEntityNotFound(_0x27479b,null))[_0xcdc2('0x21')](saveUpdates(_0xab5ff9['body'],null))['then'](respondWithResult(_0x27479b,null))['catch'](handleError(_0x27479b,null));};exports['destroy']=function(_0x3cafe5,_0x4ee330){return db[_0xcdc2('0x2b')][_0xcdc2('0x46')]({'where':{'id':_0x3cafe5[_0xcdc2('0x43')]['id']}})['then'](handleEntityNotFound(_0x4ee330,null))['then'](removeEntity(_0x4ee330,null))[_0xcdc2('0x41')](handleError(_0x4ee330,null));};exports[_0xcdc2('0x48')]=function(_0x3edc00,_0xd09d67){var _0x589417={'key':_0x3edc00[_0xcdc2('0x47')][_0xcdc2('0x2e')]};if(_0x3edc00[_0xcdc2('0x47')][_0xcdc2('0x49')]){_0x589417[_0xcdc2('0x49')]=_0x3edc00['body'][_0xcdc2('0x49')];}else if(_0x3edc00[_0xcdc2('0x47')][_0xcdc2('0x4a')]){_0x589417[_0xcdc2('0x4a')]=_0x3edc00['body'][_0xcdc2('0x4a')];}else if(_0x3edc00[_0xcdc2('0x47')][_0xcdc2('0x4b')]){_0x589417[_0xcdc2('0x4b')]=_0x3edc00[_0xcdc2('0x47')]['OpenchannelAccountId'];}else if(_0x3edc00[_0xcdc2('0x47')][_0xcdc2('0x4c')]){_0x589417[_0xcdc2('0x4c')]=_0x3edc00[_0xcdc2('0x47')][_0xcdc2('0x4c')];}return db['CannedAnswer'][_0xcdc2('0x46')]({'where':_0x589417})[_0xcdc2('0x21')](function(_0x4978ac){if(_0x4978ac){throw new db[(_0xcdc2('0x4d'))][(_0xcdc2('0x4e'))](_0xcdc2('0x4f'));}return db['CannedAnswer'][_0xcdc2('0x48')](_0x3edc00[_0xcdc2('0x47')]);})['then'](function(_0x2f17bd){var _0x29b535=_0x3edc00[_0xcdc2('0x50')][_0xcdc2('0x23')]({'plain':!![]});if(!_0x29b535)throw new Error(_0xcdc2('0x51'));if(_0x29b535[_0xcdc2('0x52')]===_0xcdc2('0x50')){var _0x2dc711=_0x2f17bd[_0xcdc2('0x23')]({'plain':!![]});return db[_0xcdc2('0x53')][_0xcdc2('0x46')]({'where':{'name':'CannedAnswers','userProfileId':_0x29b535[_0xcdc2('0x54')]},'raw':!![]})[_0xcdc2('0x21')](function(_0x22badb){if(_0x22badb&&_0x22badb[_0xcdc2('0x55')]===0x0){return db[_0xcdc2('0x24')][_0xcdc2('0x48')]({'name':_0x2dc711['name'],'resourceId':_0x2dc711['id'],'type':_0x22badb[_0xcdc2('0x28')],'sectionId':_0x22badb['id']},{})[_0xcdc2('0x21')](function(){return _0x2f17bd;});}else{return _0x2f17bd;}})[_0xcdc2('0x41')](function(_0x39af5f){logger[_0xcdc2('0x26')](_0xcdc2('0x56'),_0x39af5f);throw _0x39af5f;});}return _0x2f17bd;})[_0xcdc2('0x21')](respondWithResult(_0xd09d67,0xc9))[_0xcdc2('0x41')](handleError(_0xd09d67,null));};
\ No newline at end of file
+var _0xae23=['../../config/license/hardware','../../config/logger','../../config/utils','../../mysqldb','sendStatus','status','end','json','limit','undefined','count','offset','set','reject','save','update','then','get','CannedAnswers','UserProfileResource','destroy','error','stack','name','send','index','map','CannedAnswer','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','includeAll','include','findAll','rows','catch','show','params','body','find','create','MailAccountId','SmsAccountId','OpenchannelAccountId','ChatWebsiteId','Sequelize','The\x20inserted\x20key\x20already\x20exists.','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','eml-format','rimraf','zip-dir','fast-json-patch','moment','mustache','util','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch'];(function(_0x1088c0,_0x114580){var _0xb9df7c=function(_0x423af7){while(--_0x423af7){_0x1088c0['push'](_0x1088c0['shift']());}};_0xb9df7c(++_0x114580);}(_0xae23,0x1b6));var _0x3ae2=function(_0x30ae5e,_0x391fc4){_0x30ae5e=_0x30ae5e-0x0;var _0x1f2e93=_0xae23[_0x30ae5e];return _0x1f2e93;};'use strict';var emlformat=require(_0x3ae2('0x0'));var rimraf=require(_0x3ae2('0x1'));var zipdir=require(_0x3ae2('0x2'));var jsonpatch=require(_0x3ae2('0x3'));var rp=require('request-promise');var moment=require(_0x3ae2('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x3ae2('0x5'));var util=require(_0x3ae2('0x6'));var path=require(_0x3ae2('0x7'));var sox=require(_0x3ae2('0x8'));var csv=require(_0x3ae2('0x9'));var ejs=require(_0x3ae2('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x3ae2('0xb'));var squel=require(_0x3ae2('0xc'));var crypto=require(_0x3ae2('0xd'));var jsforce=require(_0x3ae2('0xe'));var deskjs=require(_0x3ae2('0xf'));var toCsv=require(_0x3ae2('0x9'));var querystring=require(_0x3ae2('0x10'));var Papa=require(_0x3ae2('0x11'));var Redis=require(_0x3ae2('0x12'));var authService=require(_0x3ae2('0x13'));var qs=require(_0x3ae2('0x14'));var as=require(_0x3ae2('0x15'));var hardwareService=require(_0x3ae2('0x16'));var logger=require(_0x3ae2('0x17'))('api');var utils=require(_0x3ae2('0x18'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0x3ae2('0x19'))['db'];function respondWithStatusCode(_0xa4bac2,_0x10ec5b){_0x10ec5b=_0x10ec5b||0xcc;return function(_0x33b52e){if(_0x33b52e){return _0xa4bac2[_0x3ae2('0x1a')](_0x10ec5b);}return _0xa4bac2[_0x3ae2('0x1b')](_0x10ec5b)[_0x3ae2('0x1c')]();};}function respondWithResult(_0x57797a,_0x548dcb){_0x548dcb=_0x548dcb||0xc8;return function(_0xdb61b8){if(_0xdb61b8){return _0x57797a[_0x3ae2('0x1b')](_0x548dcb)[_0x3ae2('0x1d')](_0xdb61b8);}};}function respondWithFilteredResult(_0x1d2d1e,_0x1519c9){return function(_0x194488){if(_0x194488){var _0x11e0fb=typeof _0x1519c9['offset']==='undefined'&&typeof _0x1519c9[_0x3ae2('0x1e')]===_0x3ae2('0x1f');var _0xd5379c=_0x194488[_0x3ae2('0x20')];var _0x4cabc1=_0x11e0fb?0x0:_0x1519c9[_0x3ae2('0x21')];var _0x2c65d0=_0x11e0fb?_0x194488[_0x3ae2('0x20')]:_0x1519c9[_0x3ae2('0x21')]+_0x1519c9[_0x3ae2('0x1e')];var _0x1f76ee;if(_0x2c65d0>=_0xd5379c){_0x2c65d0=_0xd5379c;_0x1f76ee=0xc8;}else{_0x1f76ee=0xce;}_0x1d2d1e[_0x3ae2('0x1b')](_0x1f76ee);return _0x1d2d1e[_0x3ae2('0x22')]('Content-Range',_0x4cabc1+'-'+_0x2c65d0+'/'+_0xd5379c)[_0x3ae2('0x1d')](_0x194488);}return null;};}function patchUpdates(_0x168b98){return function(_0x1e6249){try{jsonpatch['apply'](_0x1e6249,_0x168b98,!![]);}catch(_0x2f316e){return BPromise[_0x3ae2('0x23')](_0x2f316e);}return _0x1e6249[_0x3ae2('0x24')]();};}function saveUpdates(_0x46f350,_0x3932e8){return function(_0x469eef){if(_0x469eef){return _0x469eef[_0x3ae2('0x25')](_0x46f350)[_0x3ae2('0x26')](function(_0x225a01){return _0x225a01;});}return null;};}function removeEntity(_0x44bdd4,_0x535548){return function(_0x394c2c){if(_0x394c2c){return _0x394c2c['destroy']()['then'](function(){var _0x2db469=_0x394c2c[_0x3ae2('0x27')]({'plain':!![]});var _0x1a6a15=_0x3ae2('0x28');return db[_0x3ae2('0x29')][_0x3ae2('0x2a')]({'where':{'type':_0x1a6a15,'resourceId':_0x2db469['id']}})['then'](function(){return _0x394c2c;});})[_0x3ae2('0x26')](function(){_0x44bdd4['status'](0xcc)[_0x3ae2('0x1c')]();});}};}function handleEntityNotFound(_0x5f26be,_0x2cdffb){return function(_0x211ae6){if(!_0x211ae6){_0x5f26be['sendStatus'](0x194);}return _0x211ae6;};}function handleError(_0x2a0598,_0x3e0825){_0x3e0825=_0x3e0825||0x1f4;return function(_0x558895){logger[_0x3ae2('0x2b')](_0x558895[_0x3ae2('0x2c')]);if(_0x558895[_0x3ae2('0x2d')]){delete _0x558895['name'];}_0x2a0598[_0x3ae2('0x1b')](_0x3e0825)[_0x3ae2('0x2e')](_0x558895);};}exports[_0x3ae2('0x2f')]=function(_0x5ab86f,_0x4e838c){var _0x45decb={},_0x5932bb={},_0x2bc291={'count':0x0,'rows':[]};var _0x82097e=_[_0x3ae2('0x30')](db[_0x3ae2('0x31')][_0x3ae2('0x32')],function(_0x116be6){return{'name':_0x116be6[_0x3ae2('0x33')],'type':_0x116be6[_0x3ae2('0x34')][_0x3ae2('0x35')]};});_0x5932bb[_0x3ae2('0x36')]=_[_0x3ae2('0x30')](_0x82097e,'name');_0x5932bb[_0x3ae2('0x37')]=_[_0x3ae2('0x38')](_0x5ab86f[_0x3ae2('0x37')]);_0x5932bb[_0x3ae2('0x39')]=_[_0x3ae2('0x3a')](_0x5932bb[_0x3ae2('0x36')],_0x5932bb[_0x3ae2('0x37')]);_0x45decb[_0x3ae2('0x3b')]=_[_0x3ae2('0x3a')](_0x5932bb['model'],qs[_0x3ae2('0x3c')](_0x5ab86f[_0x3ae2('0x37')][_0x3ae2('0x3c')]));_0x45decb[_0x3ae2('0x3b')]=_0x45decb['attributes'][_0x3ae2('0x3d')]?_0x45decb[_0x3ae2('0x3b')]:_0x5932bb[_0x3ae2('0x36')];if(!_0x5ab86f[_0x3ae2('0x37')][_0x3ae2('0x3e')](_0x3ae2('0x3f'))){_0x45decb['limit']=qs[_0x3ae2('0x1e')](_0x5ab86f[_0x3ae2('0x37')][_0x3ae2('0x1e')]);_0x45decb[_0x3ae2('0x21')]=qs[_0x3ae2('0x21')](_0x5ab86f['query'][_0x3ae2('0x21')]);}_0x45decb[_0x3ae2('0x40')]=qs[_0x3ae2('0x41')](_0x5ab86f[_0x3ae2('0x37')]['sort']);_0x45decb[_0x3ae2('0x42')]=qs['filters'](_[_0x3ae2('0x43')](_0x5ab86f[_0x3ae2('0x37')],_0x5932bb[_0x3ae2('0x39')]),_0x82097e);if(_0x5ab86f[_0x3ae2('0x37')][_0x3ae2('0x44')]){_0x45decb[_0x3ae2('0x42')]=_[_0x3ae2('0x45')](_0x45decb['where'],{'$or':[{'key':{'$like':'%'+_0x5ab86f['query'][_0x3ae2('0x44')]+'%'}},{'value':{'$like':'%'+_0x5ab86f['query'][_0x3ae2('0x44')]+'%'}}]});}_0x45decb=_[_0x3ae2('0x45')]({},_0x45decb,_0x5ab86f['options']);var _0x55ebed={'where':_0x45decb[_0x3ae2('0x42')]};return db['CannedAnswer'][_0x3ae2('0x20')](_0x55ebed)[_0x3ae2('0x26')](function(_0x3a07d3){_0x2bc291[_0x3ae2('0x20')]=_0x3a07d3;if(_0x5ab86f[_0x3ae2('0x37')][_0x3ae2('0x46')]){_0x45decb[_0x3ae2('0x47')]=[{'all':!![]}];}return db[_0x3ae2('0x31')][_0x3ae2('0x48')](_0x45decb);})[_0x3ae2('0x26')](function(_0x1734df){_0x2bc291[_0x3ae2('0x49')]=_0x1734df;return _0x2bc291;})['then'](respondWithFilteredResult(_0x4e838c,_0x45decb))[_0x3ae2('0x4a')](handleError(_0x4e838c,null));};exports[_0x3ae2('0x4b')]=function(_0x46e412,_0x15ca33){var _0x29b119={'raw':!![],'where':{'id':_0x46e412[_0x3ae2('0x4c')]['id']}},_0xd55020={};_0xd55020['model']=_[_0x3ae2('0x38')](db[_0x3ae2('0x31')][_0x3ae2('0x32')]);_0xd55020['query']=_[_0x3ae2('0x38')](_0x46e412['query']);_0xd55020[_0x3ae2('0x39')]=_[_0x3ae2('0x3a')](_0xd55020[_0x3ae2('0x36')],_0xd55020[_0x3ae2('0x37')]);_0x29b119[_0x3ae2('0x3b')]=_['intersection'](_0xd55020['model'],qs[_0x3ae2('0x3c')](_0x46e412[_0x3ae2('0x37')]['fields']));_0x29b119['attributes']=_0x29b119[_0x3ae2('0x3b')][_0x3ae2('0x3d')]?_0x29b119['attributes']:_0xd55020[_0x3ae2('0x36')];if(_0x46e412['query'][_0x3ae2('0x46')]){_0x29b119['include']=[{'all':!![]}];}_0x29b119=_[_0x3ae2('0x45')]({},_0x29b119,_0x46e412['options']);return db[_0x3ae2('0x31')]['find'](_0x29b119)[_0x3ae2('0x26')](handleEntityNotFound(_0x15ca33,null))['then'](respondWithResult(_0x15ca33,null))[_0x3ae2('0x4a')](handleError(_0x15ca33,null));};exports['update']=function(_0x2903fe,_0x3f0fd3){if(_0x2903fe[_0x3ae2('0x4d')]['id']){delete _0x2903fe[_0x3ae2('0x4d')]['id'];}return db[_0x3ae2('0x31')]['find']({'where':{'id':_0x2903fe[_0x3ae2('0x4c')]['id']}})[_0x3ae2('0x26')](handleEntityNotFound(_0x3f0fd3,null))[_0x3ae2('0x26')](saveUpdates(_0x2903fe[_0x3ae2('0x4d')],null))['then'](respondWithResult(_0x3f0fd3,null))[_0x3ae2('0x4a')](handleError(_0x3f0fd3,null));};exports['destroy']=function(_0x8316e4,_0x5872d2){return db[_0x3ae2('0x31')][_0x3ae2('0x4e')]({'where':{'id':_0x8316e4[_0x3ae2('0x4c')]['id']}})[_0x3ae2('0x26')](handleEntityNotFound(_0x5872d2,null))[_0x3ae2('0x26')](removeEntity(_0x5872d2,null))[_0x3ae2('0x4a')](handleError(_0x5872d2,null));};exports[_0x3ae2('0x4f')]=function(_0x340d21,_0x436188){var _0x4a4e25={'key':_0x340d21[_0x3ae2('0x4d')][_0x3ae2('0x35')]};if(_0x340d21[_0x3ae2('0x4d')][_0x3ae2('0x50')]){_0x4a4e25[_0x3ae2('0x50')]=_0x340d21[_0x3ae2('0x4d')][_0x3ae2('0x50')];}else if(_0x340d21[_0x3ae2('0x4d')][_0x3ae2('0x51')]){_0x4a4e25[_0x3ae2('0x51')]=_0x340d21['body']['SmsAccountId'];}else if(_0x340d21[_0x3ae2('0x4d')][_0x3ae2('0x52')]){_0x4a4e25[_0x3ae2('0x52')]=_0x340d21[_0x3ae2('0x4d')][_0x3ae2('0x52')];}else if(_0x340d21[_0x3ae2('0x4d')][_0x3ae2('0x53')]){_0x4a4e25['ChatWebsiteId']=_0x340d21[_0x3ae2('0x4d')][_0x3ae2('0x53')];}return db[_0x3ae2('0x31')][_0x3ae2('0x4e')]({'where':_0x4a4e25})[_0x3ae2('0x26')](function(_0x59cd0e){if(_0x59cd0e){throw new db[(_0x3ae2('0x54'))]['ValidationError'](_0x3ae2('0x55'));}return db[_0x3ae2('0x31')]['create'](_0x340d21[_0x3ae2('0x4d')]);})['then'](function(_0x371332){var _0x10755c=_0x340d21[_0x3ae2('0x56')]['get']({'plain':!![]});if(!_0x10755c)throw new Error(_0x3ae2('0x57'));if(_0x10755c['role']===_0x3ae2('0x56')){var _0x29b114=_0x371332[_0x3ae2('0x27')]({'plain':!![]});return db[_0x3ae2('0x58')]['find']({'where':{'name':_0x3ae2('0x28'),'userProfileId':_0x10755c[_0x3ae2('0x59')]},'raw':!![]})['then'](function(_0x54b446){if(_0x54b446&&_0x54b446[_0x3ae2('0x5a')]===0x0){return db['UserProfileResource'][_0x3ae2('0x4f')]({'name':_0x29b114[_0x3ae2('0x2d')],'resourceId':_0x29b114['id'],'type':_0x54b446[_0x3ae2('0x2d')],'sectionId':_0x54b446['id']},{})[_0x3ae2('0x26')](function(){return _0x371332;});}else{return _0x371332;}})[_0x3ae2('0x4a')](function(_0x5a9ea0){logger['error'](_0x3ae2('0x5b'),_0x5a9ea0);throw _0x5a9ea0;});}return _0x371332;})[_0x3ae2('0x26')](respondWithResult(_0x436188,0xc9))['catch'](handleError(_0x436188,null));};
\ No newline at end of file
diff --git a/server/api/cannedAnswer/cannedAnswer.model.js b/server/api/cannedAnswer/cannedAnswer.model.js
index 0d45808..921fabf 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 _0x5e03=['./cannedAnswer.attributes','exports','define','CannedAnswer','tools_canned_answers','utf8mb4','util','../../config/logger','api','moment','bluebird','rimraf'];(function(_0x4c4037,_0x15054b){var _0x357862=function(_0x480015){while(--_0x480015){_0x4c4037['push'](_0x4c4037['shift']());}};_0x357862(++_0x15054b);}(_0x5e03,0x192));var _0x35e0=function(_0x51846b,_0x1dcdbb){_0x51846b=_0x51846b-0x0;var _0x583622=_0x5e03[_0x51846b];return _0x583622;};'use strict';var _=require('lodash');var util=require(_0x35e0('0x0'));var logger=require(_0x35e0('0x1'))(_0x35e0('0x2'));var moment=require(_0x35e0('0x3'));var BPromise=require(_0x35e0('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x35e0('0x5'));var config=require('../../config/environment');var attributes=require(_0x35e0('0x6'));module[_0x35e0('0x7')]=function(_0x1a0687,_0x982db6){return _0x1a0687[_0x35e0('0x8')](_0x35e0('0x9'),attributes,{'tableName':_0x35e0('0xa'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x35e0('0xb'),'collate':'utf8mb4_unicode_ci'});};
\ No newline at end of file
+var _0x57f8=['CannedAnswer','tools_canned_answers','utf8mb4_unicode_ci','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./cannedAnswer.attributes','exports','define'];(function(_0x2d560b,_0x4278af){var _0x49a56c=function(_0x4652d0){while(--_0x4652d0){_0x2d560b['push'](_0x2d560b['shift']());}};_0x49a56c(++_0x4278af);}(_0x57f8,0x198));var _0x857f=function(_0xf8aecd,_0x4631e1){_0xf8aecd=_0xf8aecd-0x0;var _0x41b3a1=_0x57f8[_0xf8aecd];return _0x41b3a1;};'use strict';var _=require('lodash');var util=require(_0x857f('0x0'));var logger=require(_0x857f('0x1'))(_0x857f('0x2'));var moment=require(_0x857f('0x3'));var BPromise=require(_0x857f('0x4'));var rp=require(_0x857f('0x5'));var fs=require('fs');var path=require(_0x857f('0x6'));var rimraf=require(_0x857f('0x7'));var config=require(_0x857f('0x8'));var attributes=require(_0x857f('0x9'));module[_0x857f('0xa')]=function(_0x369c40,_0x5d22e4){return _0x369c40[_0x857f('0xb')](_0x857f('0xc'),attributes,{'tableName':_0x857f('0xd'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':'utf8mb4','collate':_0x857f('0xe')});};
\ No newline at end of file
diff --git a/server/api/cannedAnswer/cannedAnswer.rpc.js b/server/api/cannedAnswer/cannedAnswer.rpc.js
index 9378ee6..04796dd 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(_0x42edc8,_0x28b98e){var _0x199b79=function(_0x45e8f0){while(--_0x45e8f0){_0x42edc8['push'](_0x42edc8['shift']());}};_0x199b79(++_0x28b98e);}(_0xa9e0,0x123));var _0x0a9e=function(_0x3ce3c,_0x319337){_0x3ce3c=_0x3ce3c-0x0;var _0x55a2c9=_0xa9e0[_0x3ce3c];return _0x55a2c9;};'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(_0x56d972,_0x42f7f5){var _0x10d843=function(_0x93873c){while(--_0x93873c){_0x56d972['push'](_0x56d972['shift']());}};_0x10d843(++_0x42f7f5);}(_0xa9e0,0x123));var _0x0a9e=function(_0x47a7d0,_0x4e182d){_0x47a7d0=_0x47a7d0-0x0;var _0xb9bd08=_0xa9e0[_0x47a7d0];return _0xb9bd08;};'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 26523f8..77cb68a 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 _0x27fd=['../../components/interaction/service','../../config/environment','./cannedAnswer.controller','get','index','/:id','isAuthenticated','show','post','create','put','update','delete','destroy','exports','multer','util','path','connect-timeout','Router','fs-extra'];(function(_0x327e8b,_0x912506){var _0x89151=function(_0x25f76c){while(--_0x25f76c){_0x327e8b['push'](_0x327e8b['shift']());}};_0x89151(++_0x912506);}(_0x27fd,0x1dd));var _0xd27f=function(_0xbc2974,_0xec3342){_0xbc2974=_0xbc2974-0x0;var _0x3a5b4f=_0x27fd[_0xbc2974];return _0x3a5b4f;};'use strict';var multer=require(_0xd27f('0x0'));var util=require(_0xd27f('0x1'));var path=require(_0xd27f('0x2'));var timeout=require(_0xd27f('0x3'));var express=require('express');var router=express[_0xd27f('0x4')]();var fs_extra=require(_0xd27f('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0xd27f('0x6'));var config=require(_0xd27f('0x7'));var controller=require(_0xd27f('0x8'));router[_0xd27f('0x9')]('/',auth['isAuthenticated'](),controller[_0xd27f('0xa')]);router[_0xd27f('0x9')](_0xd27f('0xb'),auth[_0xd27f('0xc')](),controller[_0xd27f('0xd')]);router[_0xd27f('0xe')]('/',auth[_0xd27f('0xc')](),controller[_0xd27f('0xf')]);router[_0xd27f('0x10')]('/:id',auth[_0xd27f('0xc')](),controller[_0xd27f('0x11')]);router[_0xd27f('0x12')](_0xd27f('0xb'),auth[_0xd27f('0xc')](),controller[_0xd27f('0x13')]);module[_0xd27f('0x14')]=router;
\ No newline at end of file
+var _0x1f06=['destroy','exports','util','path','connect-timeout','express','fs-extra','../../components/auth/service','./cannedAnswer.controller','get','isAuthenticated','show','create','put','delete','/:id'];(function(_0x1ac595,_0x5d2081){var _0x455fff=function(_0x3043ee){while(--_0x3043ee){_0x1ac595['push'](_0x1ac595['shift']());}};_0x455fff(++_0x5d2081);}(_0x1f06,0x172));var _0x61f0=function(_0x3eab66,_0x455323){_0x3eab66=_0x3eab66-0x0;var _0x20dd81=_0x1f06[_0x3eab66];return _0x20dd81;};'use strict';var multer=require('multer');var util=require(_0x61f0('0x0'));var path=require(_0x61f0('0x1'));var timeout=require(_0x61f0('0x2'));var express=require(_0x61f0('0x3'));var router=express['Router']();var fs_extra=require(_0x61f0('0x4'));var auth=require(_0x61f0('0x5'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x61f0('0x6'));router[_0x61f0('0x7')]('/',auth[_0x61f0('0x8')](),controller['index']);router[_0x61f0('0x7')]('/:id',auth[_0x61f0('0x8')](),controller[_0x61f0('0x9')]);router['post']('/',auth[_0x61f0('0x8')](),controller[_0x61f0('0xa')]);router[_0x61f0('0xb')]('/:id',auth[_0x61f0('0x8')](),controller['update']);router[_0x61f0('0xc')](_0x61f0('0xd'),auth['isAuthenticated'](),controller[_0x61f0('0xe')]);module[_0x61f0('0xf')]=router;
\ No newline at end of file
diff --git a/server/api/cdr/cdr.attributes.js b/server/api/cdr/cdr.attributes.js
index 93cc63e..401219e 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 _0x8696=['1970-01-01\x2000:00:01','STRING','INTEGER','sequelize','exports'];(function(_0x369b84,_0xaa28c8){var _0x56eeeb=function(_0x194fc1){while(--_0x194fc1){_0x369b84['push'](_0x369b84['shift']());}};_0x56eeeb(++_0xaa28c8);}(_0x8696,0x143));var _0x6869=function(_0x18f121,_0x38bb8b){_0x18f121=_0x18f121-0x0;var _0x161741=_0x8696[_0x18f121];return _0x161741;};'use strict';var Sequelize=require(_0x6869('0x0'));module[_0x6869('0x1')]={'calldate':{'type':Sequelize['DATE'],'allowNull':![],'defaultValue':_0x6869('0x2')},'clid':{'type':Sequelize['STRING']},'src':{'type':Sequelize[_0x6869('0x3')]},'dst':{'type':Sequelize[_0x6869('0x3')]},'dcontext':{'type':Sequelize[_0x6869('0x3')]},'channel':{'type':Sequelize['STRING']},'dstchannel':{'type':Sequelize[_0x6869('0x3')]},'lastapp':{'type':Sequelize['STRING']},'lastdata':{'type':Sequelize[_0x6869('0x3')]},'duration':{'type':Sequelize[_0x6869('0x4')],'allowNull':![],'defaultValue':0x0},'billsec':{'type':Sequelize['INTEGER'],'allowNull':![],'defaultValue':0x0},'disposition':{'type':Sequelize['STRING']},'amaflags':{'type':Sequelize[_0x6869('0x4')],'allowNull':![],'defaultValue':0x0},'accountcode':{'type':Sequelize[_0x6869('0x3')]},'userfield':{'type':Sequelize[_0x6869('0x3')]},'uniqueid':{'type':Sequelize[_0x6869('0x3')]},'linkedid':{'type':Sequelize[_0x6869('0x3')]},'sequence':{'type':Sequelize[_0x6869('0x3')]},'peeraccount':{'type':Sequelize[_0x6869('0x3')]},'type':{'type':Sequelize['STRING']},'tag':{'type':Sequelize[_0x6869('0x3')]}};
\ No newline at end of file
+var _0xefd7=['1970-01-01\x2000:00:01','STRING','INTEGER','sequelize','DATE'];(function(_0x50de89,_0x3b695a){var _0x119c44=function(_0x49e152){while(--_0x49e152){_0x50de89['push'](_0x50de89['shift']());}};_0x119c44(++_0x3b695a);}(_0xefd7,0x99));var _0x7efd=function(_0x397e5f,_0x454c8f){_0x397e5f=_0x397e5f-0x0;var _0x5302b8=_0xefd7[_0x397e5f];return _0x5302b8;};'use strict';var Sequelize=require(_0x7efd('0x0'));module['exports']={'calldate':{'type':Sequelize[_0x7efd('0x1')],'allowNull':![],'defaultValue':_0x7efd('0x2')},'clid':{'type':Sequelize[_0x7efd('0x3')]},'src':{'type':Sequelize['STRING']},'dst':{'type':Sequelize[_0x7efd('0x3')]},'dcontext':{'type':Sequelize[_0x7efd('0x3')]},'channel':{'type':Sequelize[_0x7efd('0x3')]},'dstchannel':{'type':Sequelize[_0x7efd('0x3')]},'lastapp':{'type':Sequelize['STRING']},'lastdata':{'type':Sequelize[_0x7efd('0x3')]},'duration':{'type':Sequelize[_0x7efd('0x4')],'allowNull':![],'defaultValue':0x0},'billsec':{'type':Sequelize[_0x7efd('0x4')],'allowNull':![],'defaultValue':0x0},'disposition':{'type':Sequelize[_0x7efd('0x3')]},'amaflags':{'type':Sequelize[_0x7efd('0x4')],'allowNull':![],'defaultValue':0x0},'accountcode':{'type':Sequelize[_0x7efd('0x3')]},'userfield':{'type':Sequelize[_0x7efd('0x3')]},'uniqueid':{'type':Sequelize[_0x7efd('0x3')]},'linkedid':{'type':Sequelize[_0x7efd('0x3')]},'sequence':{'type':Sequelize['STRING']},'peeraccount':{'type':Sequelize[_0x7efd('0x3')]},'type':{'type':Sequelize[_0x7efd('0x3')]},'tag':{'type':Sequelize['STRING']}};
\ No newline at end of file
diff --git a/server/api/cdr/cdr.controller.js b/server/api/cdr/cdr.controller.js
index f2d2e3f..ae1e5de 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 _0x7c09=['map','Cdr','rawAttributes','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','where','pick','filter','type','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','params','merge','find','create','body','describe','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','path','sox','lodash','squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','offset','undefined','count','limit','set','Content-Range','apply','save','update','then','destroy','stack','name','send','index'];(function(_0x45c450,_0x2d46e9){var _0x355dff=function(_0x5a79bd){while(--_0x5a79bd){_0x45c450['push'](_0x45c450['shift']());}};_0x355dff(++_0x2d46e9);}(_0x7c09,0x102));var _0x97c0=function(_0x3c81b5,_0x3c4d22){_0x3c81b5=_0x3c81b5-0x0;var _0x49b8d3=_0x7c09[_0x3c81b5];return _0x49b8d3;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x97c0('0x0'));var zipdir=require(_0x97c0('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0x97c0('0x2'));var moment=require(_0x97c0('0x3'));var BPromise=require(_0x97c0('0x4'));var Mustache=require(_0x97c0('0x5'));var util=require(_0x97c0('0x6'));var path=require(_0x97c0('0x7'));var sox=require(_0x97c0('0x8'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x97c0('0x9'));var squel=require(_0x97c0('0xa'));var crypto=require(_0x97c0('0xb'));var jsforce=require(_0x97c0('0xc'));var deskjs=require(_0x97c0('0xd'));var toCsv=require('to-csv');var querystring=require(_0x97c0('0xe'));var Papa=require('papaparse');var Redis=require(_0x97c0('0xf'));var authService=require(_0x97c0('0x10'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x97c0('0x11'));var logger=require(_0x97c0('0x12'))(_0x97c0('0x13'));var utils=require(_0x97c0('0x14'));var config=require(_0x97c0('0x15'));var licenseUtil=require(_0x97c0('0x16'));var db=require(_0x97c0('0x17'))['db'];function respondWithStatusCode(_0x39a3b4,_0x9ca3c1){_0x9ca3c1=_0x9ca3c1||0xcc;return function(_0x2ecf34){if(_0x2ecf34){return _0x39a3b4[_0x97c0('0x18')](_0x9ca3c1);}return _0x39a3b4[_0x97c0('0x19')](_0x9ca3c1)[_0x97c0('0x1a')]();};}function respondWithResult(_0x514782,_0x3f2fc2){_0x3f2fc2=_0x3f2fc2||0xc8;return function(_0x15b336){if(_0x15b336){return _0x514782[_0x97c0('0x19')](_0x3f2fc2)['json'](_0x15b336);}};}function respondWithFilteredResult(_0x42027d,_0x9ca6a8){return function(_0x379951){if(_0x379951){var _0x21e5f7=typeof _0x9ca6a8[_0x97c0('0x1b')]===_0x97c0('0x1c')&&typeof _0x9ca6a8['limit']===_0x97c0('0x1c');var _0x3ae7c4=_0x379951['count'];var _0x560ac0=_0x21e5f7?0x0:_0x9ca6a8[_0x97c0('0x1b')];var _0x179d43=_0x21e5f7?_0x379951[_0x97c0('0x1d')]:_0x9ca6a8[_0x97c0('0x1b')]+_0x9ca6a8[_0x97c0('0x1e')];var _0x4fed42;if(_0x179d43>=_0x3ae7c4){_0x179d43=_0x3ae7c4;_0x4fed42=0xc8;}else{_0x4fed42=0xce;}_0x42027d[_0x97c0('0x19')](_0x4fed42);return _0x42027d[_0x97c0('0x1f')](_0x97c0('0x20'),_0x560ac0+'-'+_0x179d43+'/'+_0x3ae7c4)['json'](_0x379951);}return null;};}function patchUpdates(_0x554122){return function(_0x2b74a2){try{jsonpatch[_0x97c0('0x21')](_0x2b74a2,_0x554122,!![]);}catch(_0x169f19){return BPromise['reject'](_0x169f19);}return _0x2b74a2[_0x97c0('0x22')]();};}function saveUpdates(_0x20bc4c,_0x31ffb7){return function(_0x272314){if(_0x272314){return _0x272314[_0x97c0('0x23')](_0x20bc4c)[_0x97c0('0x24')](function(_0x9dff60){return _0x9dff60;});}return null;};}function removeEntity(_0x5ac457,_0x60ab00){return function(_0x29b3aa){if(_0x29b3aa){return _0x29b3aa[_0x97c0('0x25')]()[_0x97c0('0x24')](function(){_0x5ac457['status'](0xcc)[_0x97c0('0x1a')]();});}};}function handleEntityNotFound(_0x14cada,_0x52a429){return function(_0x2ec9d6){if(!_0x2ec9d6){_0x14cada[_0x97c0('0x18')](0x194);}return _0x2ec9d6;};}function handleError(_0x447316,_0x4af5a5){_0x4af5a5=_0x4af5a5||0x1f4;return function(_0x4f11ba){logger['error'](_0x4f11ba[_0x97c0('0x26')]);if(_0x4f11ba[_0x97c0('0x27')]){delete _0x4f11ba[_0x97c0('0x27')];}_0x447316[_0x97c0('0x19')](_0x4af5a5)[_0x97c0('0x28')](_0x4f11ba);};}exports[_0x97c0('0x29')]=function(_0x4a3645,_0x10e47e){var _0x1c183f={},_0x325090={},_0x4ad645={'count':0x0,'rows':[]};var _0x14617c=_[_0x97c0('0x2a')](db[_0x97c0('0x2b')][_0x97c0('0x2c')],function(_0x2a7b2b){return{'name':_0x2a7b2b['fieldName'],'type':_0x2a7b2b['type'][_0x97c0('0x2d')]};});_0x325090[_0x97c0('0x2e')]=_[_0x97c0('0x2a')](_0x14617c,'name');_0x325090[_0x97c0('0x2f')]=_[_0x97c0('0x30')](_0x4a3645['query']);_0x325090[_0x97c0('0x31')]=_[_0x97c0('0x32')](_0x325090[_0x97c0('0x2e')],_0x325090[_0x97c0('0x2f')]);_0x1c183f[_0x97c0('0x33')]=_[_0x97c0('0x32')](_0x325090[_0x97c0('0x2e')],qs[_0x97c0('0x34')](_0x4a3645[_0x97c0('0x2f')][_0x97c0('0x34')]));_0x1c183f[_0x97c0('0x33')]=_0x1c183f[_0x97c0('0x33')][_0x97c0('0x35')]?_0x1c183f[_0x97c0('0x33')]:_0x325090[_0x97c0('0x2e')];if(!_0x4a3645['query'][_0x97c0('0x36')](_0x97c0('0x37'))){_0x1c183f[_0x97c0('0x1e')]=qs[_0x97c0('0x1e')](_0x4a3645[_0x97c0('0x2f')][_0x97c0('0x1e')]);_0x1c183f[_0x97c0('0x1b')]=qs[_0x97c0('0x1b')](_0x4a3645['query'][_0x97c0('0x1b')]);}_0x1c183f['order']=qs[_0x97c0('0x38')](_0x4a3645[_0x97c0('0x2f')][_0x97c0('0x38')]);_0x1c183f[_0x97c0('0x39')]=qs[_0x97c0('0x31')](_[_0x97c0('0x3a')](_0x4a3645[_0x97c0('0x2f')],_0x325090[_0x97c0('0x31')]),_0x14617c);if(_0x4a3645[_0x97c0('0x2f')][_0x97c0('0x3b')]){_0x1c183f[_0x97c0('0x39')]=_['merge'](_0x1c183f[_0x97c0('0x39')],{'$or':_[_0x97c0('0x2a')](_0x14617c,function(_0x4d47b1){if(_0x4d47b1[_0x97c0('0x3c')]!==_0x97c0('0x3d')){var _0x2aeffc={};_0x2aeffc[_0x4d47b1[_0x97c0('0x27')]]={'$like':'%'+_0x4a3645['query'][_0x97c0('0x3b')]+'%'};return _0x2aeffc;}})});}_0x1c183f=_['merge']({},_0x1c183f,_0x4a3645[_0x97c0('0x3e')]);var _0x64cfcd={'where':_0x1c183f['where']};return db[_0x97c0('0x2b')][_0x97c0('0x1d')](_0x64cfcd)[_0x97c0('0x24')](function(_0xb13649){_0x4ad645[_0x97c0('0x1d')]=_0xb13649;if(_0x4a3645[_0x97c0('0x2f')][_0x97c0('0x3f')]){_0x1c183f[_0x97c0('0x40')]=[{'all':!![]}];}return db[_0x97c0('0x2b')][_0x97c0('0x41')](_0x1c183f);})[_0x97c0('0x24')](function(_0x2cca4c){_0x4ad645[_0x97c0('0x42')]=_0x2cca4c;return _0x4ad645;})['then'](respondWithFilteredResult(_0x10e47e,_0x1c183f))[_0x97c0('0x43')](handleError(_0x10e47e,null));};exports[_0x97c0('0x44')]=function(_0x1dc6ff,_0x142421){var _0x312fce={'raw':!![],'where':{'id':_0x1dc6ff[_0x97c0('0x45')]['id']}},_0x375ebc={};_0x375ebc['model']=_['keys'](db[_0x97c0('0x2b')][_0x97c0('0x2c')]);_0x375ebc[_0x97c0('0x2f')]=_[_0x97c0('0x30')](_0x1dc6ff[_0x97c0('0x2f')]);_0x375ebc['filters']=_['intersection'](_0x375ebc['model'],_0x375ebc[_0x97c0('0x2f')]);_0x312fce['attributes']=_['intersection'](_0x375ebc[_0x97c0('0x2e')],qs[_0x97c0('0x34')](_0x1dc6ff[_0x97c0('0x2f')][_0x97c0('0x34')]));_0x312fce[_0x97c0('0x33')]=_0x312fce['attributes'][_0x97c0('0x35')]?_0x312fce[_0x97c0('0x33')]:_0x375ebc[_0x97c0('0x2e')];if(_0x1dc6ff[_0x97c0('0x2f')][_0x97c0('0x3f')]){_0x312fce[_0x97c0('0x40')]=[{'all':!![]}];}_0x312fce=_[_0x97c0('0x46')]({},_0x312fce,_0x1dc6ff[_0x97c0('0x3e')]);return db[_0x97c0('0x2b')][_0x97c0('0x47')](_0x312fce)['then'](handleEntityNotFound(_0x142421,null))[_0x97c0('0x24')](respondWithResult(_0x142421,null))[_0x97c0('0x43')](handleError(_0x142421,null));};exports[_0x97c0('0x48')]=function(_0x276c98,_0x4ff0a5){return db['Cdr'][_0x97c0('0x48')](_0x276c98[_0x97c0('0x49')],{})[_0x97c0('0x24')](respondWithResult(_0x4ff0a5,0xc9))['catch'](handleError(_0x4ff0a5,null));};exports[_0x97c0('0x23')]=function(_0xac56ac,_0x240f68){if(_0xac56ac[_0x97c0('0x49')]['id']){delete _0xac56ac[_0x97c0('0x49')]['id'];}return db['Cdr'][_0x97c0('0x47')]({'where':{'id':_0xac56ac[_0x97c0('0x45')]['id']}})[_0x97c0('0x24')](handleEntityNotFound(_0x240f68,null))['then'](saveUpdates(_0xac56ac['body'],null))[_0x97c0('0x24')](respondWithResult(_0x240f68,null))['catch'](handleError(_0x240f68,null));};exports['destroy']=function(_0x473b63,_0x20e2a5){return db[_0x97c0('0x2b')]['find']({'where':{'id':_0x473b63['params']['id']}})['then'](handleEntityNotFound(_0x20e2a5,null))[_0x97c0('0x24')](removeEntity(_0x20e2a5,null))[_0x97c0('0x43')](handleError(_0x20e2a5,null));};exports[_0x97c0('0x4a')]=function(_0xdb2767,_0x397065){return db[_0x97c0('0x2b')][_0x97c0('0x4a')]()['then'](respondWithResult(_0x397065,null))[_0x97c0('0x43')](handleError(_0x397065,null));};
\ No newline at end of file
+var _0x3831=['error','stack','name','send','map','Cdr','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','order','sort','where','pick','filter','merge','options','count','include','rows','catch','show','params','length','includeAll','find','create','body','describe','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','sox','lodash','crypto','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','set','apply','reject','save','update','then','destroy'];(function(_0x3b085,_0x250543){var _0x476a57=function(_0x480941){while(--_0x480941){_0x3b085['push'](_0x3b085['shift']());}};_0x476a57(++_0x250543);}(_0x3831,0x14c));var _0x1383=function(_0x576710,_0x2766d0){_0x576710=_0x576710-0x0;var _0x792aaa=_0x3831[_0x576710];return _0x792aaa;};'use strict';var emlformat=require(_0x1383('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x1383('0x1'));var jsonpatch=require(_0x1383('0x2'));var rp=require(_0x1383('0x3'));var moment=require(_0x1383('0x4'));var BPromise=require(_0x1383('0x5'));var Mustache=require('mustache');var util=require(_0x1383('0x6'));var path=require('path');var sox=require(_0x1383('0x7'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x1383('0x8'));var squel=require('squel');var crypto=require(_0x1383('0x9'));var jsforce=require(_0x1383('0xa'));var deskjs=require(_0x1383('0xb'));var toCsv=require(_0x1383('0xc'));var querystring=require(_0x1383('0xd'));var Papa=require(_0x1383('0xe'));var Redis=require(_0x1383('0xf'));var authService=require(_0x1383('0x10'));var qs=require('../../components/parsers/qs');var as=require(_0x1383('0x11'));var hardwareService=require(_0x1383('0x12'));var logger=require(_0x1383('0x13'))(_0x1383('0x14'));var utils=require(_0x1383('0x15'));var config=require('../../config/environment');var licenseUtil=require(_0x1383('0x16'));var db=require(_0x1383('0x17'))['db'];function respondWithStatusCode(_0x1d35fc,_0x48c107){_0x48c107=_0x48c107||0xcc;return function(_0x5e7f63){if(_0x5e7f63){return _0x1d35fc[_0x1383('0x18')](_0x48c107);}return _0x1d35fc[_0x1383('0x19')](_0x48c107)[_0x1383('0x1a')]();};}function respondWithResult(_0x1ba3d1,_0x1e02d7){_0x1e02d7=_0x1e02d7||0xc8;return function(_0x2c8931){if(_0x2c8931){return _0x1ba3d1[_0x1383('0x19')](_0x1e02d7)[_0x1383('0x1b')](_0x2c8931);}};}function respondWithFilteredResult(_0x5e9ed9,_0x7a50d0){return function(_0x1f46de){if(_0x1f46de){var _0x41d895=typeof _0x7a50d0[_0x1383('0x1c')]===_0x1383('0x1d')&&typeof _0x7a50d0[_0x1383('0x1e')]===_0x1383('0x1d');var _0x5ca7fc=_0x1f46de['count'];var _0x2301a6=_0x41d895?0x0:_0x7a50d0['offset'];var _0x236b29=_0x41d895?_0x1f46de['count']:_0x7a50d0['offset']+_0x7a50d0['limit'];var _0x1c8fe7;if(_0x236b29>=_0x5ca7fc){_0x236b29=_0x5ca7fc;_0x1c8fe7=0xc8;}else{_0x1c8fe7=0xce;}_0x5e9ed9['status'](_0x1c8fe7);return _0x5e9ed9[_0x1383('0x1f')]('Content-Range',_0x2301a6+'-'+_0x236b29+'/'+_0x5ca7fc)[_0x1383('0x1b')](_0x1f46de);}return null;};}function patchUpdates(_0x1e6d5e){return function(_0xca314){try{jsonpatch[_0x1383('0x20')](_0xca314,_0x1e6d5e,!![]);}catch(_0x32fb05){return BPromise[_0x1383('0x21')](_0x32fb05);}return _0xca314[_0x1383('0x22')]();};}function saveUpdates(_0x10ed33,_0x2afbd2){return function(_0x505093){if(_0x505093){return _0x505093[_0x1383('0x23')](_0x10ed33)[_0x1383('0x24')](function(_0x39fea2){return _0x39fea2;});}return null;};}function removeEntity(_0x241c3d,_0x186524){return function(_0x2a9502){if(_0x2a9502){return _0x2a9502[_0x1383('0x25')]()['then'](function(){_0x241c3d['status'](0xcc)[_0x1383('0x1a')]();});}};}function handleEntityNotFound(_0x160497,_0x38b48a){return function(_0x3b158d){if(!_0x3b158d){_0x160497[_0x1383('0x18')](0x194);}return _0x3b158d;};}function handleError(_0x4aaee1,_0x5391e0){_0x5391e0=_0x5391e0||0x1f4;return function(_0x4a8b6e){logger[_0x1383('0x26')](_0x4a8b6e[_0x1383('0x27')]);if(_0x4a8b6e[_0x1383('0x28')]){delete _0x4a8b6e[_0x1383('0x28')];}_0x4aaee1['status'](_0x5391e0)[_0x1383('0x29')](_0x4a8b6e);};}exports['index']=function(_0x3c788b,_0xf0037f){var _0x42d63f={},_0x23e541={},_0x3357e9={'count':0x0,'rows':[]};var _0x15a3c4=_[_0x1383('0x2a')](db[_0x1383('0x2b')][_0x1383('0x2c')],function(_0x29ca05){return{'name':_0x29ca05[_0x1383('0x2d')],'type':_0x29ca05[_0x1383('0x2e')][_0x1383('0x2f')]};});_0x23e541[_0x1383('0x30')]=_['map'](_0x15a3c4,_0x1383('0x28'));_0x23e541[_0x1383('0x31')]=_[_0x1383('0x32')](_0x3c788b[_0x1383('0x31')]);_0x23e541[_0x1383('0x33')]=_[_0x1383('0x34')](_0x23e541['model'],_0x23e541[_0x1383('0x31')]);_0x42d63f[_0x1383('0x35')]=_[_0x1383('0x34')](_0x23e541[_0x1383('0x30')],qs[_0x1383('0x36')](_0x3c788b[_0x1383('0x31')]['fields']));_0x42d63f[_0x1383('0x35')]=_0x42d63f['attributes']['length']?_0x42d63f[_0x1383('0x35')]:_0x23e541[_0x1383('0x30')];if(!_0x3c788b[_0x1383('0x31')]['hasOwnProperty']('nolimit')){_0x42d63f['limit']=qs[_0x1383('0x1e')](_0x3c788b[_0x1383('0x31')][_0x1383('0x1e')]);_0x42d63f['offset']=qs['offset'](_0x3c788b[_0x1383('0x31')][_0x1383('0x1c')]);}_0x42d63f[_0x1383('0x37')]=qs[_0x1383('0x38')](_0x3c788b['query']['sort']);_0x42d63f[_0x1383('0x39')]=qs[_0x1383('0x33')](_[_0x1383('0x3a')](_0x3c788b[_0x1383('0x31')],_0x23e541[_0x1383('0x33')]),_0x15a3c4);if(_0x3c788b[_0x1383('0x31')][_0x1383('0x3b')]){_0x42d63f['where']=_[_0x1383('0x3c')](_0x42d63f['where'],{'$or':_[_0x1383('0x2a')](_0x15a3c4,function(_0x311072){if(_0x311072[_0x1383('0x2e')]!=='VIRTUAL'){var _0x277689={};_0x277689[_0x311072['name']]={'$like':'%'+_0x3c788b['query'][_0x1383('0x3b')]+'%'};return _0x277689;}})});}_0x42d63f=_[_0x1383('0x3c')]({},_0x42d63f,_0x3c788b[_0x1383('0x3d')]);var _0x53bcb0={'where':_0x42d63f[_0x1383('0x39')]};return db[_0x1383('0x2b')][_0x1383('0x3e')](_0x53bcb0)[_0x1383('0x24')](function(_0x56c269){_0x3357e9[_0x1383('0x3e')]=_0x56c269;if(_0x3c788b['query']['includeAll']){_0x42d63f[_0x1383('0x3f')]=[{'all':!![]}];}return db[_0x1383('0x2b')]['findAll'](_0x42d63f);})['then'](function(_0x5ca90f){_0x3357e9[_0x1383('0x40')]=_0x5ca90f;return _0x3357e9;})[_0x1383('0x24')](respondWithFilteredResult(_0xf0037f,_0x42d63f))[_0x1383('0x41')](handleError(_0xf0037f,null));};exports[_0x1383('0x42')]=function(_0x3dea24,_0x3e737a){var _0x12d58d={'raw':!![],'where':{'id':_0x3dea24[_0x1383('0x43')]['id']}},_0x43ac2f={};_0x43ac2f['model']=_[_0x1383('0x32')](db[_0x1383('0x2b')][_0x1383('0x2c')]);_0x43ac2f['query']=_[_0x1383('0x32')](_0x3dea24['query']);_0x43ac2f[_0x1383('0x33')]=_[_0x1383('0x34')](_0x43ac2f[_0x1383('0x30')],_0x43ac2f[_0x1383('0x31')]);_0x12d58d[_0x1383('0x35')]=_[_0x1383('0x34')](_0x43ac2f[_0x1383('0x30')],qs[_0x1383('0x36')](_0x3dea24[_0x1383('0x31')]['fields']));_0x12d58d['attributes']=_0x12d58d['attributes'][_0x1383('0x44')]?_0x12d58d[_0x1383('0x35')]:_0x43ac2f[_0x1383('0x30')];if(_0x3dea24[_0x1383('0x31')][_0x1383('0x45')]){_0x12d58d[_0x1383('0x3f')]=[{'all':!![]}];}_0x12d58d=_['merge']({},_0x12d58d,_0x3dea24[_0x1383('0x3d')]);return db[_0x1383('0x2b')][_0x1383('0x46')](_0x12d58d)['then'](handleEntityNotFound(_0x3e737a,null))[_0x1383('0x24')](respondWithResult(_0x3e737a,null))[_0x1383('0x41')](handleError(_0x3e737a,null));};exports[_0x1383('0x47')]=function(_0x1bc99a,_0x171066){return db['Cdr'][_0x1383('0x47')](_0x1bc99a['body'],{})[_0x1383('0x24')](respondWithResult(_0x171066,0xc9))[_0x1383('0x41')](handleError(_0x171066,null));};exports['update']=function(_0x16c74e,_0x2e41c3){if(_0x16c74e[_0x1383('0x48')]['id']){delete _0x16c74e[_0x1383('0x48')]['id'];}return db[_0x1383('0x2b')][_0x1383('0x46')]({'where':{'id':_0x16c74e[_0x1383('0x43')]['id']}})[_0x1383('0x24')](handleEntityNotFound(_0x2e41c3,null))[_0x1383('0x24')](saveUpdates(_0x16c74e[_0x1383('0x48')],null))['then'](respondWithResult(_0x2e41c3,null))[_0x1383('0x41')](handleError(_0x2e41c3,null));};exports[_0x1383('0x25')]=function(_0x23f8d7,_0x2ac880){return db[_0x1383('0x2b')][_0x1383('0x46')]({'where':{'id':_0x23f8d7[_0x1383('0x43')]['id']}})[_0x1383('0x24')](handleEntityNotFound(_0x2ac880,null))[_0x1383('0x24')](removeEntity(_0x2ac880,null))['catch'](handleError(_0x2ac880,null));};exports[_0x1383('0x49')]=function(_0x228af7,_0x45a3e5){return db['Cdr'][_0x1383('0x49')]()[_0x1383('0x24')](respondWithResult(_0x45a3e5,null))['catch'](handleError(_0x45a3e5,null));};
\ No newline at end of file
diff --git a/server/api/cdr/cdr.model.js b/server/api/cdr/cdr.model.js
index 7f0d19f..6e8abbe 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(_0x233efc,_0x4fa9e6){var _0x2d50d5=function(_0x5b6d57){while(--_0x5b6d57){_0x233efc['push'](_0x233efc['shift']());}};_0x2d50d5(++_0x4fa9e6);}(_0x7a54,0x106));var _0x47a5=function(_0xc755a3,_0x5cfc48){_0xc755a3=_0xc755a3-0x0;var _0x47332c=_0x7a54[_0xc755a3];return _0x47332c;};'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(_0x131578,_0x166d47){var _0x5cda0d=function(_0x527a5f){while(--_0x527a5f){_0x131578['push'](_0x131578['shift']());}};_0x5cda0d(++_0x166d47);}(_0x9957,0x93));var _0x7995=function(_0x6c993a,_0x5ea3ab){_0x6c993a=_0x6c993a-0x0;var _0x27f547=_0x9957[_0x6c993a];return _0x27f547;};'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 cd2eae2..9c22cfd 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 _0xc62c=['result','catch','lodash','moment','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','Cdr,\x20%s,\x20%s','request\x20sent','debug','Cdr,\x20%s,\x20%s,\x20%s','error','code','message'];(function(_0x240e74,_0x119815){var _0x2a3d80=function(_0x9b48a5){while(--_0x9b48a5){_0x240e74['push'](_0x240e74['shift']());}};_0x2a3d80(++_0x119815);}(_0xc62c,0x15b));var _0xcc62=function(_0xbf608e,_0x354703){_0xbf608e=_0xbf608e-0x0;var _0x9086a5=_0xc62c[_0xbf608e];return _0x9086a5;};'use strict';var _=require(_0xcc62('0x0'));var util=require('util');var moment=require(_0xcc62('0x1'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xcc62('0x2'));var db=require(_0xcc62('0x3'))['db'];var utils=require(_0xcc62('0x4'));var logger=require(_0xcc62('0x5'))(_0xcc62('0x6'));var config=require(_0xcc62('0x7'));var jayson=require(_0xcc62('0x8'));var client=jayson[_0xcc62('0x9')][_0xcc62('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x3d9f58,_0x20cbbb,_0x5d2f4c){return new BPromise(function(_0x689569,_0x35b99a){return client[_0xcc62('0xb')](_0x3d9f58,_0x5d2f4c)[_0xcc62('0xc')](function(_0x467fb9){logger[_0xcc62('0xd')](_0xcc62('0xe'),_0x20cbbb,_0xcc62('0xf'));logger[_0xcc62('0x10')](_0xcc62('0x11'),_0x20cbbb,'request\x20sent',JSON['stringify'](_0x467fb9));if(_0x467fb9['error']){if(_0x467fb9[_0xcc62('0x12')][_0xcc62('0x13')]===0x1f4){logger[_0xcc62('0x12')](_0xcc62('0xe'),_0x20cbbb,_0x467fb9['error']['message']);return _0x35b99a(_0x467fb9[_0xcc62('0x12')]['message']);}logger[_0xcc62('0x12')](_0xcc62('0xe'),_0x20cbbb,_0x467fb9[_0xcc62('0x12')]['message']);return _0x689569(_0x467fb9['error'][_0xcc62('0x14')]);}else{logger[_0xcc62('0xd')](_0xcc62('0xe'),_0x20cbbb,_0xcc62('0xf'));_0x689569(_0x467fb9[_0xcc62('0x15')][_0xcc62('0x14')]);}})[_0xcc62('0x16')](function(_0x3c84be){logger[_0xcc62('0x12')](_0xcc62('0xe'),_0x20cbbb,_0x3c84be);_0x35b99a(_0x3c84be);});});}
\ No newline at end of file
+var _0xa301=['message','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','request','info','Cdr,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code'];(function(_0x440813,_0x159ba4){var _0x13fbc4=function(_0x4642be){while(--_0x4642be){_0x440813['push'](_0x440813['shift']());}};_0x13fbc4(++_0x159ba4);}(_0xa301,0x119));var _0x1a30=function(_0x49b5ee,_0x362e84){_0x49b5ee=_0x49b5ee-0x0;var _0x3379af=_0xa301[_0x49b5ee];return _0x3379af;};'use strict';var _=require(_0x1a30('0x0'));var util=require(_0x1a30('0x1'));var moment=require(_0x1a30('0x2'));var BPromise=require(_0x1a30('0x3'));var rs=require(_0x1a30('0x4'));var fs=require('fs');var Redis=require(_0x1a30('0x5'));var db=require(_0x1a30('0x6'))['db'];var utils=require(_0x1a30('0x7'));var logger=require(_0x1a30('0x8'))(_0x1a30('0x9'));var config=require('../../config/environment');var jayson=require(_0x1a30('0xa'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x1fc84c,_0x1a55c7,_0x2418fd){return new BPromise(function(_0x5c1ff9,_0x29bb3b){return client[_0x1a30('0xb')](_0x1fc84c,_0x2418fd)['then'](function(_0x4572dd){logger[_0x1a30('0xc')](_0x1a30('0xd'),_0x1a55c7,_0x1a30('0xe'));logger[_0x1a30('0xf')]('Cdr,\x20%s,\x20%s,\x20%s',_0x1a55c7,_0x1a30('0xe'),JSON[_0x1a30('0x10')](_0x4572dd));if(_0x4572dd[_0x1a30('0x11')]){if(_0x4572dd['error'][_0x1a30('0x12')]===0x1f4){logger[_0x1a30('0x11')](_0x1a30('0xd'),_0x1a55c7,_0x4572dd['error'][_0x1a30('0x13')]);return _0x29bb3b(_0x4572dd[_0x1a30('0x11')][_0x1a30('0x13')]);}logger[_0x1a30('0x11')](_0x1a30('0xd'),_0x1a55c7,_0x4572dd[_0x1a30('0x11')]['message']);return _0x5c1ff9(_0x4572dd['error']['message']);}else{logger['info'](_0x1a30('0xd'),_0x1a55c7,_0x1a30('0xe'));_0x5c1ff9(_0x4572dd['result'][_0x1a30('0x13')]);}})['catch'](function(_0x5dc684){logger[_0x1a30('0x11')](_0x1a30('0xd'),_0x1a55c7,_0x5dc684);_0x29bb3b(_0x5dc684);});});}
\ No newline at end of file
diff --git a/server/api/cdr/index.js b/server/api/cdr/index.js
index 6131395..3a82534 100644
--- a/server/api/cdr/index.js
+++ b/server/api/cdr/index.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xa9e0=['isAuthenticated','create','put','/:id','destroy','exports','multer','util','path','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./cdr.controller','get','index','/describe','show','post'];(function(_0xc40b9f,_0x17ec1f){var _0x535b9c=function(_0x591b19){while(--_0x591b19){_0xc40b9f['push'](_0xc40b9f['shift']());}};_0x535b9c(++_0x17ec1f);}(_0xa9e0,0x123));var _0x0a9e=function(_0x34bc30,_0x177cb0){_0x34bc30=_0x34bc30-0x0;var _0x5706de=_0xa9e0[_0x34bc30];return _0x5706de;};'use strict';var multer=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var path=require(_0x0a9e('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0a9e('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x0a9e('0x4'));var interaction=require(_0x0a9e('0x5'));var config=require(_0x0a9e('0x6'));var controller=require(_0x0a9e('0x7'));router[_0x0a9e('0x8')]('/',auth['isAuthenticated'](),controller[_0x0a9e('0x9')]);router[_0x0a9e('0x8')](_0x0a9e('0xa'),auth['isAuthenticated'](),controller['describe']);router[_0x0a9e('0x8')]('/:id',auth['isAuthenticated'](),controller[_0x0a9e('0xb')]);router[_0x0a9e('0xc')]('/',auth[_0x0a9e('0xd')](),controller[_0x0a9e('0xe')]);router[_0x0a9e('0xf')](_0x0a9e('0x10'),auth['isAuthenticated'](),controller['update']);router['delete']('/:id',auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x11')]);module[_0x0a9e('0x12')]=router;
\ No newline at end of file
+var _0xd8b0=['destroy','exports','multer','util','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','isAuthenticated','index','get','describe','/:id','show','post','create','put','update'];(function(_0x43daa8,_0x2b964e){var _0x42a182=function(_0x16a94b){while(--_0x16a94b){_0x43daa8['push'](_0x43daa8['shift']());}};_0x42a182(++_0x2b964e);}(_0xd8b0,0xad));var _0x0d8b=function(_0xa464c9,_0x7c86d8){_0xa464c9=_0xa464c9-0x0;var _0x3d73c4=_0xd8b0[_0xa464c9];return _0x3d73c4;};'use strict';var multer=require(_0x0d8b('0x0'));var util=require(_0x0d8b('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0d8b('0x2')]();var fs_extra=require(_0x0d8b('0x3'));var auth=require(_0x0d8b('0x4'));var interaction=require(_0x0d8b('0x5'));var config=require(_0x0d8b('0x6'));var controller=require('./cdr.controller');router['get']('/',auth[_0x0d8b('0x7')](),controller[_0x0d8b('0x8')]);router[_0x0d8b('0x9')]('/describe',auth[_0x0d8b('0x7')](),controller[_0x0d8b('0xa')]);router['get'](_0x0d8b('0xb'),auth[_0x0d8b('0x7')](),controller[_0x0d8b('0xc')]);router[_0x0d8b('0xd')]('/',auth[_0x0d8b('0x7')](),controller[_0x0d8b('0xe')]);router[_0x0d8b('0xf')](_0x0d8b('0xb'),auth['isAuthenticated'](),controller[_0x0d8b('0x10')]);router['delete'](_0x0d8b('0xb'),auth[_0x0d8b('0x7')](),controller[_0x0d8b('0x11')]);module[_0x0d8b('0x12')]=router;
\ No newline at end of file
diff --git a/server/api/chatApplication/chatApplication.attributes.js b/server/api/chatApplication/chatApplication.attributes.js
index 20672bc..6ee3df8 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 _0xd02f=['TEXT','*,*,*,*','sequelize','exports','INTEGER','STRING','noop'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xd02f,0x80));var _0xfd02=function(_0x2332e1,_0x433415){_0x2332e1=_0x2332e1-0x0;var _0x2c3bda=_0xd02f[_0x2332e1];return _0x2c3bda;};'use strict';var Sequelize=require(_0xfd02('0x0'));module[_0xfd02('0x1')]={'priority':{'type':Sequelize[_0xfd02('0x2')],'allowNull':![]},'app':{'type':Sequelize[_0xfd02('0x3')],'allowNull':![],'defaultValue':_0xfd02('0x4')},'appdata':{'type':Sequelize[_0xfd02('0x5')]()},'description':{'type':Sequelize[_0xfd02('0x3')]},'interval':{'type':Sequelize[_0xfd02('0x3')],'defaultValue':_0xfd02('0x6')}};
\ No newline at end of file
+var _0x1bc6=['*,*,*,*','sequelize','exports','INTEGER','STRING','noop','TEXT'];(function(_0x7cd008,_0x35f2fa){var _0x5cbed1=function(_0x23ba84){while(--_0x23ba84){_0x7cd008['push'](_0x7cd008['shift']());}};_0x5cbed1(++_0x35f2fa);}(_0x1bc6,0x94));var _0x61bc=function(_0x3c953b,_0xdd526a){_0x3c953b=_0x3c953b-0x0;var _0x133793=_0x1bc6[_0x3c953b];return _0x133793;};'use strict';var Sequelize=require(_0x61bc('0x0'));module[_0x61bc('0x1')]={'priority':{'type':Sequelize[_0x61bc('0x2')],'allowNull':![]},'app':{'type':Sequelize[_0x61bc('0x3')],'allowNull':![],'defaultValue':_0x61bc('0x4')},'appdata':{'type':Sequelize[_0x61bc('0x5')]()},'description':{'type':Sequelize[_0x61bc('0x3')]},'interval':{'type':Sequelize['STRING'],'defaultValue':_0x61bc('0x6')}};
\ No newline at end of file
diff --git a/server/api/chatApplication/chatApplication.controller.js b/server/api/chatApplication/chatApplication.controller.js
index f8dcdaa..f02615f 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 _0x1be1=['mustache','util','sox','to-csv','ejs','lodash','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','status','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','then','end','sendStatus','stack','name','send','show','params','keys','ChatApplication','query','filters','intersection','model','attributes','fields','length','includeAll','include','merge','options','find','body','catch','zip-dir','fast-json-patch','moment','bluebird'];(function(_0x131d54,_0x4ad89b){var _0x4df77c=function(_0x52d892){while(--_0x52d892){_0x131d54['push'](_0x131d54['shift']());}};_0x4df77c(++_0x4ad89b);}(_0x1be1,0x192));var _0x11be=function(_0x12d2fa,_0x27d8ba){_0x12d2fa=_0x12d2fa-0x0;var _0x220d2c=_0x1be1[_0x12d2fa];return _0x220d2c;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x11be('0x0'));var jsonpatch=require(_0x11be('0x1'));var rp=require('request-promise');var moment=require(_0x11be('0x2'));var BPromise=require(_0x11be('0x3'));var Mustache=require(_0x11be('0x4'));var util=require(_0x11be('0x5'));var path=require('path');var sox=require(_0x11be('0x6'));var csv=require(_0x11be('0x7'));var ejs=require(_0x11be('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x11be('0x9'));var squel=require('squel');var crypto=require(_0x11be('0xa'));var jsforce=require(_0x11be('0xb'));var deskjs=require(_0x11be('0xc'));var toCsv=require(_0x11be('0x7'));var querystring=require(_0x11be('0xd'));var Papa=require('papaparse');var Redis=require(_0x11be('0xe'));var authService=require(_0x11be('0xf'));var qs=require('../../components/parsers/qs');var as=require(_0x11be('0x10'));var hardwareService=require(_0x11be('0x11'));var logger=require(_0x11be('0x12'))(_0x11be('0x13'));var utils=require('../../config/utils');var config=require(_0x11be('0x14'));var licenseUtil=require(_0x11be('0x15'));var db=require(_0x11be('0x16'))['db'];function respondWithStatusCode(_0x4b36c8,_0x3ff31f){_0x3ff31f=_0x3ff31f||0xcc;return function(_0x2dad05){if(_0x2dad05){return _0x4b36c8['sendStatus'](_0x3ff31f);}return _0x4b36c8[_0x11be('0x17')](_0x3ff31f)['end']();};}function respondWithResult(_0x49228e,_0x569842){_0x569842=_0x569842||0xc8;return function(_0x4b6e7e){if(_0x4b6e7e){return _0x49228e['status'](_0x569842)['json'](_0x4b6e7e);}};}function respondWithFilteredResult(_0x588871,_0x2280e2){return function(_0x52bbef){if(_0x52bbef){var _0x31047c=typeof _0x2280e2[_0x11be('0x18')]===_0x11be('0x19')&&typeof _0x2280e2[_0x11be('0x1a')]==='undefined';var _0x2ed725=_0x52bbef[_0x11be('0x1b')];var _0x56ab61=_0x31047c?0x0:_0x2280e2[_0x11be('0x18')];var _0xc3263c=_0x31047c?_0x52bbef[_0x11be('0x1b')]:_0x2280e2['offset']+_0x2280e2['limit'];var _0x141391;if(_0xc3263c>=_0x2ed725){_0xc3263c=_0x2ed725;_0x141391=0xc8;}else{_0x141391=0xce;}_0x588871[_0x11be('0x17')](_0x141391);return _0x588871[_0x11be('0x1c')](_0x11be('0x1d'),_0x56ab61+'-'+_0xc3263c+'/'+_0x2ed725)['json'](_0x52bbef);}return null;};}function patchUpdates(_0x12a5bd){return function(_0x45136f){try{jsonpatch[_0x11be('0x1e')](_0x45136f,_0x12a5bd,!![]);}catch(_0x452315){return BPromise[_0x11be('0x1f')](_0x452315);}return _0x45136f[_0x11be('0x20')]();};}function saveUpdates(_0xa944ac,_0x17678d){return function(_0x3aea14){if(_0x3aea14){return _0x3aea14[_0x11be('0x21')](_0xa944ac)['then'](function(_0xfe3737){return _0xfe3737;});}return null;};}function removeEntity(_0x46b7c2,_0x2fe43c){return function(_0x5d1690){if(_0x5d1690){return _0x5d1690['destroy']()[_0x11be('0x22')](function(){_0x46b7c2[_0x11be('0x17')](0xcc)[_0x11be('0x23')]();});}};}function handleEntityNotFound(_0x4cb27f,_0x106167){return function(_0x518e2b){if(!_0x518e2b){_0x4cb27f[_0x11be('0x24')](0x194);}return _0x518e2b;};}function handleError(_0x563e01,_0x28310d){_0x28310d=_0x28310d||0x1f4;return function(_0xb11f3d){logger['error'](_0xb11f3d[_0x11be('0x25')]);if(_0xb11f3d[_0x11be('0x26')]){delete _0xb11f3d[_0x11be('0x26')];}_0x563e01[_0x11be('0x17')](_0x28310d)[_0x11be('0x27')](_0xb11f3d);};}exports[_0x11be('0x28')]=function(_0xf5a6ac,_0x2cf9aa){var _0x43ab30={'raw':!![],'where':{'id':_0xf5a6ac[_0x11be('0x29')]['id']}},_0x5966c5={};_0x5966c5['model']=_[_0x11be('0x2a')](db[_0x11be('0x2b')]['rawAttributes']);_0x5966c5['query']=_[_0x11be('0x2a')](_0xf5a6ac[_0x11be('0x2c')]);_0x5966c5[_0x11be('0x2d')]=_[_0x11be('0x2e')](_0x5966c5[_0x11be('0x2f')],_0x5966c5[_0x11be('0x2c')]);_0x43ab30[_0x11be('0x30')]=_[_0x11be('0x2e')](_0x5966c5[_0x11be('0x2f')],qs['fields'](_0xf5a6ac[_0x11be('0x2c')][_0x11be('0x31')]));_0x43ab30[_0x11be('0x30')]=_0x43ab30[_0x11be('0x30')][_0x11be('0x32')]?_0x43ab30[_0x11be('0x30')]:_0x5966c5['model'];if(_0xf5a6ac[_0x11be('0x2c')][_0x11be('0x33')]){_0x43ab30[_0x11be('0x34')]=[{'all':!![]}];}_0x43ab30=_[_0x11be('0x35')]({},_0x43ab30,_0xf5a6ac[_0x11be('0x36')]);return db['ChatApplication'][_0x11be('0x37')](_0x43ab30)[_0x11be('0x22')](handleEntityNotFound(_0x2cf9aa,null))[_0x11be('0x22')](respondWithResult(_0x2cf9aa,null))['catch'](handleError(_0x2cf9aa,null));};exports[_0x11be('0x21')]=function(_0x51ae3a,_0x4c7b47){if(_0x51ae3a['body']['id']){delete _0x51ae3a['body']['id'];}return db[_0x11be('0x2b')][_0x11be('0x37')]({'where':{'id':_0x51ae3a[_0x11be('0x29')]['id']}})['then'](handleEntityNotFound(_0x4c7b47,null))[_0x11be('0x22')](saveUpdates(_0x51ae3a[_0x11be('0x38')],null))['then'](respondWithResult(_0x4c7b47,null))[_0x11be('0x39')](handleError(_0x4c7b47,null));};exports['destroy']=function(_0x222f84,_0x58e702){return db[_0x11be('0x2b')][_0x11be('0x37')]({'where':{'id':_0x222f84[_0x11be('0x29')]['id']}})[_0x11be('0x22')](handleEntityNotFound(_0x58e702,null))['then'](removeEntity(_0x58e702,null))[_0x11be('0x39')](handleError(_0x58e702,null));};
\ No newline at end of file
+var _0xbf5c=['options','find','catch','body','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','util','path','to-csv','ejs','fs-extra','squel','crypto','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','destroy','then','sendStatus','stack','name','send','params','model','ChatApplication','rawAttributes','query','keys','filters','intersection','attributes','fields','includeAll','include','merge'];(function(_0xf765b6,_0x2033e2){var _0x493102=function(_0x4bc013){while(--_0x4bc013){_0xf765b6['push'](_0xf765b6['shift']());}};_0x493102(++_0x2033e2);}(_0xbf5c,0xb8));var _0xcbf5=function(_0x4c6233,_0x12bc76){_0x4c6233=_0x4c6233-0x0;var _0x1949b4=_0xbf5c[_0x4c6233];return _0x1949b4;};'use strict';var emlformat=require(_0xcbf5('0x0'));var rimraf=require(_0xcbf5('0x1'));var zipdir=require(_0xcbf5('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xcbf5('0x3'));var moment=require(_0xcbf5('0x4'));var BPromise=require(_0xcbf5('0x5'));var Mustache=require('mustache');var util=require(_0xcbf5('0x6'));var path=require(_0xcbf5('0x7'));var sox=require('sox');var csv=require(_0xcbf5('0x8'));var ejs=require(_0xcbf5('0x9'));var fs=require('fs');var fs_extra=require(_0xcbf5('0xa'));var _=require('lodash');var squel=require(_0xcbf5('0xb'));var crypto=require(_0xcbf5('0xc'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0xcbf5('0x8'));var querystring=require(_0xcbf5('0xd'));var Papa=require(_0xcbf5('0xe'));var Redis=require('ioredis');var authService=require(_0xcbf5('0xf'));var qs=require(_0xcbf5('0x10'));var as=require(_0xcbf5('0x11'));var hardwareService=require(_0xcbf5('0x12'));var logger=require(_0xcbf5('0x13'))(_0xcbf5('0x14'));var utils=require('../../config/utils');var config=require(_0xcbf5('0x15'));var licenseUtil=require(_0xcbf5('0x16'));var db=require(_0xcbf5('0x17'))['db'];function respondWithStatusCode(_0x4a894b,_0x5e5307){_0x5e5307=_0x5e5307||0xcc;return function(_0x18c2fe){if(_0x18c2fe){return _0x4a894b['sendStatus'](_0x5e5307);}return _0x4a894b[_0xcbf5('0x18')](_0x5e5307)[_0xcbf5('0x19')]();};}function respondWithResult(_0x5cbcf6,_0x2e7536){_0x2e7536=_0x2e7536||0xc8;return function(_0x51b1d2){if(_0x51b1d2){return _0x5cbcf6['status'](_0x2e7536)[_0xcbf5('0x1a')](_0x51b1d2);}};}function respondWithFilteredResult(_0x550e21,_0x2c58ba){return function(_0x5348ce){if(_0x5348ce){var _0x4fc535=typeof _0x2c58ba[_0xcbf5('0x1b')]===_0xcbf5('0x1c')&&typeof _0x2c58ba[_0xcbf5('0x1d')]===_0xcbf5('0x1c');var _0x7f2153=_0x5348ce[_0xcbf5('0x1e')];var _0x462d46=_0x4fc535?0x0:_0x2c58ba['offset'];var _0xcf3d18=_0x4fc535?_0x5348ce[_0xcbf5('0x1e')]:_0x2c58ba[_0xcbf5('0x1b')]+_0x2c58ba[_0xcbf5('0x1d')];var _0x269b01;if(_0xcf3d18>=_0x7f2153){_0xcf3d18=_0x7f2153;_0x269b01=0xc8;}else{_0x269b01=0xce;}_0x550e21[_0xcbf5('0x18')](_0x269b01);return _0x550e21[_0xcbf5('0x1f')](_0xcbf5('0x20'),_0x462d46+'-'+_0xcf3d18+'/'+_0x7f2153)['json'](_0x5348ce);}return null;};}function patchUpdates(_0x155147){return function(_0x4e8874){try{jsonpatch[_0xcbf5('0x21')](_0x4e8874,_0x155147,!![]);}catch(_0x4c7b1e){return BPromise[_0xcbf5('0x22')](_0x4c7b1e);}return _0x4e8874[_0xcbf5('0x23')]();};}function saveUpdates(_0x2334f1,_0xf2360){return function(_0x3e9548){if(_0x3e9548){return _0x3e9548[_0xcbf5('0x24')](_0x2334f1)['then'](function(_0x17bbc8){return _0x17bbc8;});}return null;};}function removeEntity(_0x5602fd,_0x965482){return function(_0x1b59d4){if(_0x1b59d4){return _0x1b59d4[_0xcbf5('0x25')]()[_0xcbf5('0x26')](function(){_0x5602fd['status'](0xcc)[_0xcbf5('0x19')]();});}};}function handleEntityNotFound(_0x43e9af,_0x2aa7c){return function(_0x41d465){if(!_0x41d465){_0x43e9af[_0xcbf5('0x27')](0x194);}return _0x41d465;};}function handleError(_0x27557f,_0x149b61){_0x149b61=_0x149b61||0x1f4;return function(_0xe6742){logger['error'](_0xe6742[_0xcbf5('0x28')]);if(_0xe6742[_0xcbf5('0x29')]){delete _0xe6742[_0xcbf5('0x29')];}_0x27557f[_0xcbf5('0x18')](_0x149b61)[_0xcbf5('0x2a')](_0xe6742);};}exports['show']=function(_0x1293ab,_0x367eb0){var _0x9ce00={'raw':!![],'where':{'id':_0x1293ab[_0xcbf5('0x2b')]['id']}},_0x3389a1={};_0x3389a1[_0xcbf5('0x2c')]=_['keys'](db[_0xcbf5('0x2d')][_0xcbf5('0x2e')]);_0x3389a1[_0xcbf5('0x2f')]=_[_0xcbf5('0x30')](_0x1293ab[_0xcbf5('0x2f')]);_0x3389a1[_0xcbf5('0x31')]=_[_0xcbf5('0x32')](_0x3389a1['model'],_0x3389a1['query']);_0x9ce00[_0xcbf5('0x33')]=_['intersection'](_0x3389a1[_0xcbf5('0x2c')],qs[_0xcbf5('0x34')](_0x1293ab[_0xcbf5('0x2f')][_0xcbf5('0x34')]));_0x9ce00[_0xcbf5('0x33')]=_0x9ce00['attributes']['length']?_0x9ce00[_0xcbf5('0x33')]:_0x3389a1[_0xcbf5('0x2c')];if(_0x1293ab[_0xcbf5('0x2f')][_0xcbf5('0x35')]){_0x9ce00[_0xcbf5('0x36')]=[{'all':!![]}];}_0x9ce00=_[_0xcbf5('0x37')]({},_0x9ce00,_0x1293ab[_0xcbf5('0x38')]);return db['ChatApplication'][_0xcbf5('0x39')](_0x9ce00)[_0xcbf5('0x26')](handleEntityNotFound(_0x367eb0,null))[_0xcbf5('0x26')](respondWithResult(_0x367eb0,null))[_0xcbf5('0x3a')](handleError(_0x367eb0,null));};exports['update']=function(_0x4840fe,_0x3e180c){if(_0x4840fe['body']['id']){delete _0x4840fe[_0xcbf5('0x3b')]['id'];}return db[_0xcbf5('0x2d')]['find']({'where':{'id':_0x4840fe['params']['id']}})[_0xcbf5('0x26')](handleEntityNotFound(_0x3e180c,null))[_0xcbf5('0x26')](saveUpdates(_0x4840fe[_0xcbf5('0x3b')],null))[_0xcbf5('0x26')](respondWithResult(_0x3e180c,null))['catch'](handleError(_0x3e180c,null));};exports[_0xcbf5('0x25')]=function(_0x3c70e6,_0x11a8ea){return db[_0xcbf5('0x2d')]['find']({'where':{'id':_0x3c70e6[_0xcbf5('0x2b')]['id']}})[_0xcbf5('0x26')](handleEntityNotFound(_0x11a8ea,null))['then'](removeEntity(_0x11a8ea,null))['catch'](handleError(_0x11a8ea,null));};
\ No newline at end of file
diff --git a/server/api/chatApplication/chatApplication.model.js b/server/api/chatApplication/chatApplication.model.js
index 942c160..7cf9994 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 _0xd8df=['ChatApplication','chat_applications','utf8mb4_unicode_ci','lodash','util','../../config/logger','request-promise','path','rimraf','exports','define'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xd8df,0x163));var _0xfd8d=function(_0x98e599,_0x1e2d07){_0x98e599=_0x98e599-0x0;var _0x5e5dbe=_0xd8df[_0x98e599];return _0x5e5dbe;};'use strict';var _=require(_0xfd8d('0x0'));var util=require(_0xfd8d('0x1'));var logger=require(_0xfd8d('0x2'))('api');var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0xfd8d('0x3'));var fs=require('fs');var path=require(_0xfd8d('0x4'));var rimraf=require(_0xfd8d('0x5'));var config=require('../../config/environment');var attributes=require('./chatApplication.attributes');module[_0xfd8d('0x6')]=function(_0x18a1a6,_0x219b7e){return _0x18a1a6[_0xfd8d('0x7')](_0xfd8d('0x8'),attributes,{'tableName':_0xfd8d('0x9'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':'utf8mb4','collate':_0xfd8d('0xa')});};
\ No newline at end of file
+var _0xe1dc=['bluebird','request-promise','rimraf','exports','define','ChatApplication','chat_applications','utf8mb4_unicode_ci','lodash','util','../../config/logger','api','moment'];(function(_0x48619d,_0x27276f){var _0x337673=function(_0x1d9fd0){while(--_0x1d9fd0){_0x48619d['push'](_0x48619d['shift']());}};_0x337673(++_0x27276f);}(_0xe1dc,0x8a));var _0xce1d=function(_0x110b75,_0x146dbc){_0x110b75=_0x110b75-0x0;var _0x332394=_0xe1dc[_0x110b75];return _0x332394;};'use strict';var _=require(_0xce1d('0x0'));var util=require(_0xce1d('0x1'));var logger=require(_0xce1d('0x2'))(_0xce1d('0x3'));var moment=require(_0xce1d('0x4'));var BPromise=require(_0xce1d('0x5'));var rp=require(_0xce1d('0x6'));var fs=require('fs');var path=require('path');var rimraf=require(_0xce1d('0x7'));var config=require('../../config/environment');var attributes=require('./chatApplication.attributes');module[_0xce1d('0x8')]=function(_0x232005,_0x2782b7){return _0x232005[_0xce1d('0x9')](_0xce1d('0xa'),attributes,{'tableName':_0xce1d('0xb'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':'utf8mb4','collate':_0xce1d('0xc')});};
\ No newline at end of file
diff --git a/server/api/chatApplication/chatApplication.rpc.js b/server/api/chatApplication/chatApplication.rpc.js
index 4fff472..e57a6f1 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 _0x6743=['../../config/environment','jayson/promise','http','request','then','info','ChatApplication,\x20%s,\x20%s','request\x20sent','debug','ChatApplication,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger'];(function(_0x525051,_0x57efe1){var _0x3cd649=function(_0x5b726d){while(--_0x5b726d){_0x525051['push'](_0x525051['shift']());}};_0x3cd649(++_0x57efe1);}(_0x6743,0x100));var _0x3674=function(_0x6a0266,_0x1552d6){_0x6a0266=_0x6a0266-0x0;var _0x309e00=_0x6743[_0x6a0266];return _0x309e00;};'use strict';var _=require(_0x3674('0x0'));var util=require(_0x3674('0x1'));var moment=require(_0x3674('0x2'));var BPromise=require(_0x3674('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x3674('0x4'));var db=require(_0x3674('0x5'))['db'];var utils=require(_0x3674('0x6'));var logger=require(_0x3674('0x7'))('rpc');var config=require(_0x3674('0x8'));var jayson=require(_0x3674('0x9'));var client=jayson['client'][_0x3674('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x148da6,_0x3e4022,_0x53dfa0){return new BPromise(function(_0x2d5aa9,_0x5cacc0){return client[_0x3674('0xb')](_0x148da6,_0x53dfa0)[_0x3674('0xc')](function(_0x510985){logger[_0x3674('0xd')](_0x3674('0xe'),_0x3e4022,_0x3674('0xf'));logger[_0x3674('0x10')](_0x3674('0x11'),_0x3e4022,_0x3674('0xf'),JSON[_0x3674('0x12')](_0x510985));if(_0x510985[_0x3674('0x13')]){if(_0x510985[_0x3674('0x13')][_0x3674('0x14')]===0x1f4){logger['error']('ChatApplication,\x20%s,\x20%s',_0x3e4022,_0x510985[_0x3674('0x13')]['message']);return _0x5cacc0(_0x510985[_0x3674('0x13')][_0x3674('0x15')]);}logger[_0x3674('0x13')](_0x3674('0xe'),_0x3e4022,_0x510985['error'][_0x3674('0x15')]);return _0x2d5aa9(_0x510985[_0x3674('0x13')]['message']);}else{logger[_0x3674('0xd')](_0x3674('0xe'),_0x3e4022,_0x3674('0xf'));_0x2d5aa9(_0x510985[_0x3674('0x16')][_0x3674('0x15')]);}})[_0x3674('0x17')](function(_0x324f9c){logger['error']('ChatApplication,\x20%s,\x20%s',_0x3e4022,_0x324f9c);_0x5cacc0(_0x324f9c);});});}
\ No newline at end of file
+var _0x64ec=['moment','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','info','request\x20sent','debug','ChatApplication,\x20%s,\x20%s,\x20%s','stringify','error','code','ChatApplication,\x20%s,\x20%s','message','result','lodash','util'];(function(_0x4f19de,_0x27fbec){var _0x10b304=function(_0x2619ee){while(--_0x2619ee){_0x4f19de['push'](_0x4f19de['shift']());}};_0x10b304(++_0x27fbec);}(_0x64ec,0xfb));var _0xc64e=function(_0x15e9b6,_0x8d872c){_0x15e9b6=_0x15e9b6-0x0;var _0x39a432=_0x64ec[_0x15e9b6];return _0x39a432;};'use strict';var _=require(_0xc64e('0x0'));var util=require(_0xc64e('0x1'));var moment=require(_0xc64e('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xc64e('0x3'));var db=require(_0xc64e('0x4'))['db'];var utils=require(_0xc64e('0x5'));var logger=require(_0xc64e('0x6'))(_0xc64e('0x7'));var config=require(_0xc64e('0x8'));var jayson=require(_0xc64e('0x9'));var client=jayson[_0xc64e('0xa')][_0xc64e('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x38b377,_0x3d2eef,_0x32024f){return new BPromise(function(_0x44bc67,_0x46f3c7){return client[_0xc64e('0xc')](_0x38b377,_0x32024f)['then'](function(_0x4e31fc){logger[_0xc64e('0xd')]('ChatApplication,\x20%s,\x20%s',_0x3d2eef,_0xc64e('0xe'));logger[_0xc64e('0xf')](_0xc64e('0x10'),_0x3d2eef,_0xc64e('0xe'),JSON[_0xc64e('0x11')](_0x4e31fc));if(_0x4e31fc[_0xc64e('0x12')]){if(_0x4e31fc[_0xc64e('0x12')][_0xc64e('0x13')]===0x1f4){logger[_0xc64e('0x12')](_0xc64e('0x14'),_0x3d2eef,_0x4e31fc[_0xc64e('0x12')][_0xc64e('0x15')]);return _0x46f3c7(_0x4e31fc[_0xc64e('0x12')]['message']);}logger[_0xc64e('0x12')](_0xc64e('0x14'),_0x3d2eef,_0x4e31fc['error'][_0xc64e('0x15')]);return _0x44bc67(_0x4e31fc[_0xc64e('0x12')][_0xc64e('0x15')]);}else{logger[_0xc64e('0xd')](_0xc64e('0x14'),_0x3d2eef,'request\x20sent');_0x44bc67(_0x4e31fc[_0xc64e('0x16')][_0xc64e('0x15')]);}})['catch'](function(_0x2f9692){logger[_0xc64e('0x12')](_0xc64e('0x14'),_0x3d2eef,_0x2f9692);_0x46f3c7(_0x2f9692);});});}
\ No newline at end of file
diff --git a/server/api/chatApplication/index.js b/server/api/chatApplication/index.js
index 6274da6..92b59d4 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 _0x9948=['fs-extra','../../components/interaction/service','../../config/environment','./chatApplication.controller','get','/:id','isAuthenticated','show','put','update','destroy','exports','path'];(function(_0x2baf2d,_0x4a2974){var _0x4c0c1d=function(_0xabb949){while(--_0xabb949){_0x2baf2d['push'](_0x2baf2d['shift']());}};_0x4c0c1d(++_0x4a2974);}(_0x9948,0xdc));var _0x8994=function(_0x2b1b89,_0x133d34){_0x2b1b89=_0x2b1b89-0x0;var _0x3b8916=_0x9948[_0x2b1b89];return _0x3b8916;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x8994('0x0'));var timeout=require('connect-timeout');var express=require('express');var router=express['Router']();var fs_extra=require(_0x8994('0x1'));var auth=require('../../components/auth/service');var interaction=require(_0x8994('0x2'));var config=require(_0x8994('0x3'));var controller=require(_0x8994('0x4'));router[_0x8994('0x5')](_0x8994('0x6'),auth[_0x8994('0x7')](),controller[_0x8994('0x8')]);router[_0x8994('0x9')](_0x8994('0x6'),auth['isAuthenticated'](),controller[_0x8994('0xa')]);router['delete'](_0x8994('0x6'),auth['isAuthenticated'](),controller[_0x8994('0xb')]);module[_0x8994('0xc')]=router;
\ No newline at end of file
+var _0x7f87=['delete','destroy','exports','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','get','/:id','show','put','isAuthenticated','update'];(function(_0x9df060,_0x253d33){var _0x338dfe=function(_0x17d9a5){while(--_0x17d9a5){_0x9df060['push'](_0x9df060['shift']());}};_0x338dfe(++_0x253d33);}(_0x7f87,0x93));var _0x77f8=function(_0x2aba79,_0x167d90){_0x2aba79=_0x2aba79-0x0;var _0x5ac1b9=_0x7f87[_0x2aba79];return _0x5ac1b9;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x77f8('0x0'));var timeout=require(_0x77f8('0x1'));var express=require(_0x77f8('0x2'));var router=express[_0x77f8('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x77f8('0x4'));var interaction=require(_0x77f8('0x5'));var config=require(_0x77f8('0x6'));var controller=require('./chatApplication.controller');router[_0x77f8('0x7')](_0x77f8('0x8'),auth['isAuthenticated'](),controller[_0x77f8('0x9')]);router[_0x77f8('0xa')](_0x77f8('0x8'),auth[_0x77f8('0xb')](),controller[_0x77f8('0xc')]);router[_0x77f8('0xd')](_0x77f8('0x8'),auth[_0x77f8('0xb')](),controller[_0x77f8('0xe')]);module[_0x77f8('0xf')]=router;
\ No newline at end of file
diff --git a/server/api/chatGroup/chatGroup.attributes.js b/server/api/chatGroup/chatGroup.attributes.js
index 132515c..914098c 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 _0x2bad=['BOOLEAN','sequelize','exports','STRING'];(function(_0x20821d,_0x316833){var _0x409cc6=function(_0xb90d26){while(--_0xb90d26){_0x20821d['push'](_0x20821d['shift']());}};_0x409cc6(++_0x316833);}(_0x2bad,0xed));var _0xd2ba=function(_0x3644b9,_0x5cd3a6){_0x3644b9=_0x3644b9-0x0;var _0x4d196d=_0x2bad[_0x3644b9];return _0x4d196d;};'use strict';var Sequelize=require(_0xd2ba('0x0'));module[_0xd2ba('0x1')]={'name':{'type':Sequelize[_0xd2ba('0x2')],'allowNull':![]},'description':{'type':Sequelize[_0xd2ba('0x2')]},'write':{'type':Sequelize[_0xd2ba('0x3')],'defaultValue':!![]}};
\ No newline at end of file
+var _0xdab3=['exports','STRING','BOOLEAN','sequelize'];(function(_0x52b750,_0x551e8b){var _0x2aa67a=function(_0x43f785){while(--_0x43f785){_0x52b750['push'](_0x52b750['shift']());}};_0x2aa67a(++_0x551e8b);}(_0xdab3,0xeb));var _0x3dab=function(_0xd4d0b2,_0xae09d5){_0xd4d0b2=_0xd4d0b2-0x0;var _0x43f942=_0xdab3[_0xd4d0b2];return _0x43f942;};'use strict';var Sequelize=require(_0x3dab('0x0'));module[_0x3dab('0x1')]={'name':{'type':Sequelize['STRING'],'allowNull':![]},'description':{'type':Sequelize[_0x3dab('0x2')]},'write':{'type':Sequelize[_0x3dab('0x3')],'defaultValue':!![]}};
\ No newline at end of file
diff --git a/server/api/chatGroup/chatGroup.controller.js b/server/api/chatGroup/chatGroup.controller.js
index 4a658f8..c4dd610 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 _0x7538=['omit','ids','getMembers','findOne','User','removeMembers','addMessage','ChatGroupId','getMessages','order','$gte','split','format','YYYY-MM-DD\x20HH:mm:ss','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','path','sox','to-csv','ejs','squel','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','redis','localhost','socket.io-emitter','./chatGroup.socket','register','sendStatus','end','status','json','offset','undefined','count','limit','set','apply','update','destroy','then','error','name','send','map','ChatGroup','rawAttributes','fieldName','type','key','model','filters','intersection','query','fields','attributes','length','hasOwnProperty','nolimit','sort','pick','filter','where','merge','options','includeAll','include','show','keys','find','create','body','catch','params','describe','getUnread','ChatInternalMessage','user','toInteger','addMembers'];(function(_0x21a9d9,_0x4d5ac8){var _0x46adce=function(_0xfdd336){while(--_0xfdd336){_0x21a9d9['push'](_0x21a9d9['shift']());}};_0x46adce(++_0x4d5ac8);}(_0x7538,0x6c));var _0x8753=function(_0x33c1f3,_0x13b859){_0x33c1f3=_0x33c1f3-0x0;var _0x222082=_0x7538[_0x33c1f3];return _0x222082;};'use strict';var emlformat=require(_0x8753('0x0'));var rimraf=require(_0x8753('0x1'));var zipdir=require(_0x8753('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x8753('0x3'));var moment=require(_0x8753('0x4'));var BPromise=require(_0x8753('0x5'));var Mustache=require(_0x8753('0x6'));var util=require('util');var path=require(_0x8753('0x7'));var sox=require(_0x8753('0x8'));var csv=require(_0x8753('0x9'));var ejs=require(_0x8753('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0x8753('0xb'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x8753('0xc'));var toCsv=require('to-csv');var querystring=require(_0x8753('0xd'));var Papa=require(_0x8753('0xe'));var Redis=require(_0x8753('0xf'));var authService=require(_0x8753('0x10'));var qs=require(_0x8753('0x11'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x8753('0x12'));var logger=require(_0x8753('0x13'))('api');var utils=require(_0x8753('0x14'));var config=require(_0x8753('0x15'));var licenseUtil=require(_0x8753('0x16'));var db=require('../../mysqldb')['db'];config[_0x8753('0x17')]=_['defaults'](config[_0x8753('0x17')],{'host':_0x8753('0x18'),'port':0x18eb});var socket=require(_0x8753('0x19'))(new Redis(config[_0x8753('0x17')]));require(_0x8753('0x1a'))[_0x8753('0x1b')](socket);function respondWithStatusCode(_0x4ca2d5,_0x165257){_0x165257=_0x165257||0xcc;return function(_0x2b6481){if(_0x2b6481){return _0x4ca2d5[_0x8753('0x1c')](_0x165257);}return _0x4ca2d5['status'](_0x165257)[_0x8753('0x1d')]();};}function respondWithResult(_0x343765,_0x5b83aa){_0x5b83aa=_0x5b83aa||0xc8;return function(_0x80188a){if(_0x80188a){return _0x343765[_0x8753('0x1e')](_0x5b83aa)[_0x8753('0x1f')](_0x80188a);}};}function respondWithFilteredResult(_0x583c9b,_0x23ed5a){return function(_0x3d44d6){if(_0x3d44d6){var _0x533439=typeof _0x23ed5a[_0x8753('0x20')]===_0x8753('0x21')&&typeof _0x23ed5a['limit']==='undefined';var _0x4da8b3=_0x3d44d6[_0x8753('0x22')];var _0x2756bf=_0x533439?0x0:_0x23ed5a[_0x8753('0x20')];var _0x2985e4=_0x533439?_0x3d44d6[_0x8753('0x22')]:_0x23ed5a[_0x8753('0x20')]+_0x23ed5a[_0x8753('0x23')];var _0x2a834c;if(_0x2985e4>=_0x4da8b3){_0x2985e4=_0x4da8b3;_0x2a834c=0xc8;}else{_0x2a834c=0xce;}_0x583c9b[_0x8753('0x1e')](_0x2a834c);return _0x583c9b[_0x8753('0x24')]('Content-Range',_0x2756bf+'-'+_0x2985e4+'/'+_0x4da8b3)[_0x8753('0x1f')](_0x3d44d6);}return null;};}function patchUpdates(_0x6ed567){return function(_0x348318){try{jsonpatch[_0x8753('0x25')](_0x348318,_0x6ed567,!![]);}catch(_0x5a8a88){return BPromise['reject'](_0x5a8a88);}return _0x348318['save']();};}function saveUpdates(_0x5da4f1,_0x3631f6){return function(_0x125476){if(_0x125476){return _0x125476[_0x8753('0x26')](_0x5da4f1)['then'](function(_0x3d7c87){return _0x3d7c87;});}return null;};}function removeEntity(_0x559ce4,_0x6bdfe){return function(_0x2026eb){if(_0x2026eb){return _0x2026eb[_0x8753('0x27')]()[_0x8753('0x28')](function(){_0x559ce4[_0x8753('0x1e')](0xcc)[_0x8753('0x1d')]();});}};}function handleEntityNotFound(_0x5ea825,_0x2460c6){return function(_0x5091f2){if(!_0x5091f2){_0x5ea825[_0x8753('0x1c')](0x194);}return _0x5091f2;};}function handleError(_0x50b51b,_0xaf0554){_0xaf0554=_0xaf0554||0x1f4;return function(_0x218361){logger[_0x8753('0x29')](_0x218361['stack']);if(_0x218361['name']){delete _0x218361[_0x8753('0x2a')];}_0x50b51b['status'](_0xaf0554)[_0x8753('0x2b')](_0x218361);};}exports['index']=function(_0x2835e9,_0x47935f){var _0x515a6c={},_0x1a6bf0={},_0x50fcc6={'count':0x0,'rows':[]};var _0x2977c1=_[_0x8753('0x2c')](db[_0x8753('0x2d')][_0x8753('0x2e')],function(_0x2dcc5d){return{'name':_0x2dcc5d[_0x8753('0x2f')],'type':_0x2dcc5d[_0x8753('0x30')][_0x8753('0x31')]};});_0x1a6bf0[_0x8753('0x32')]=_['map'](_0x2977c1,_0x8753('0x2a'));_0x1a6bf0['query']=_['keys'](_0x2835e9['query']);_0x1a6bf0[_0x8753('0x33')]=_[_0x8753('0x34')](_0x1a6bf0['model'],_0x1a6bf0[_0x8753('0x35')]);_0x515a6c['attributes']=_['intersection'](_0x1a6bf0[_0x8753('0x32')],qs['fields'](_0x2835e9[_0x8753('0x35')][_0x8753('0x36')]));_0x515a6c[_0x8753('0x37')]=_0x515a6c['attributes'][_0x8753('0x38')]?_0x515a6c[_0x8753('0x37')]:_0x1a6bf0['model'];if(!_0x2835e9['query'][_0x8753('0x39')](_0x8753('0x3a'))){_0x515a6c['limit']=qs[_0x8753('0x23')](_0x2835e9['query'][_0x8753('0x23')]);_0x515a6c[_0x8753('0x20')]=qs[_0x8753('0x20')](_0x2835e9[_0x8753('0x35')][_0x8753('0x20')]);}_0x515a6c['order']=qs[_0x8753('0x3b')](_0x2835e9['query'][_0x8753('0x3b')]);_0x515a6c['where']=qs['filters'](_[_0x8753('0x3c')](_0x2835e9[_0x8753('0x35')],_0x1a6bf0[_0x8753('0x33')]),_0x2977c1);if(_0x2835e9['query'][_0x8753('0x3d')]){_0x515a6c[_0x8753('0x3e')]=_[_0x8753('0x3f')](_0x515a6c[_0x8753('0x3e')],{'$or':_[_0x8753('0x2c')](_0x2977c1,function(_0x121294){if(_0x121294['type']!=='VIRTUAL'){var _0x3006c8={};_0x3006c8[_0x121294[_0x8753('0x2a')]]={'$like':'%'+_0x2835e9['query'][_0x8753('0x3d')]+'%'};return _0x3006c8;}})});}_0x515a6c=_['merge']({},_0x515a6c,_0x2835e9[_0x8753('0x40')]);var _0x1ae9f6={'where':_0x515a6c[_0x8753('0x3e')]};return db[_0x8753('0x2d')][_0x8753('0x22')](_0x1ae9f6)[_0x8753('0x28')](function(_0xa3b820){_0x50fcc6[_0x8753('0x22')]=_0xa3b820;if(_0x2835e9[_0x8753('0x35')][_0x8753('0x41')]){_0x515a6c[_0x8753('0x42')]=[{'all':!![]}];}return db['ChatGroup']['findAll'](_0x515a6c);})[_0x8753('0x28')](function(_0x3887ac){_0x50fcc6['rows']=_0x3887ac;return _0x50fcc6;})[_0x8753('0x28')](respondWithFilteredResult(_0x47935f,_0x515a6c))['catch'](handleError(_0x47935f,null));};exports[_0x8753('0x43')]=function(_0x573e5d,_0x59c1aa){var _0x70ddea={'raw':!![],'where':{'id':_0x573e5d['params']['id']}},_0x1f7ed7={};_0x1f7ed7[_0x8753('0x32')]=_[_0x8753('0x44')](db[_0x8753('0x2d')][_0x8753('0x2e')]);_0x1f7ed7[_0x8753('0x35')]=_[_0x8753('0x44')](_0x573e5d[_0x8753('0x35')]);_0x1f7ed7[_0x8753('0x33')]=_['intersection'](_0x1f7ed7[_0x8753('0x32')],_0x1f7ed7[_0x8753('0x35')]);_0x70ddea[_0x8753('0x37')]=_['intersection'](_0x1f7ed7[_0x8753('0x32')],qs[_0x8753('0x36')](_0x573e5d['query']['fields']));_0x70ddea[_0x8753('0x37')]=_0x70ddea[_0x8753('0x37')][_0x8753('0x38')]?_0x70ddea[_0x8753('0x37')]:_0x1f7ed7[_0x8753('0x32')];if(_0x573e5d[_0x8753('0x35')]['includeAll']){_0x70ddea[_0x8753('0x42')]=[{'all':!![]}];}_0x70ddea=_[_0x8753('0x3f')]({},_0x70ddea,_0x573e5d[_0x8753('0x40')]);return db[_0x8753('0x2d')][_0x8753('0x45')](_0x70ddea)[_0x8753('0x28')](handleEntityNotFound(_0x59c1aa,null))[_0x8753('0x28')](respondWithResult(_0x59c1aa,null))['catch'](handleError(_0x59c1aa,null));};exports[_0x8753('0x46')]=function(_0x312433,_0x164aaa){return db[_0x8753('0x2d')]['create'](_0x312433[_0x8753('0x47')],{})[_0x8753('0x28')](respondWithResult(_0x164aaa,0xc9))['catch'](handleError(_0x164aaa,null));};exports[_0x8753('0x26')]=function(_0x1a3e1c,_0x885d70){if(_0x1a3e1c[_0x8753('0x47')]['id']){delete _0x1a3e1c['body']['id'];}return db[_0x8753('0x2d')][_0x8753('0x45')]({'where':{'id':_0x1a3e1c['params']['id']}})[_0x8753('0x28')](handleEntityNotFound(_0x885d70,null))[_0x8753('0x28')](saveUpdates(_0x1a3e1c['body'],null))[_0x8753('0x28')](respondWithResult(_0x885d70,null))[_0x8753('0x48')](handleError(_0x885d70,null));};exports[_0x8753('0x27')]=function(_0x2e4e04,_0x5a3798){return db['ChatGroup'][_0x8753('0x45')]({'where':{'id':_0x2e4e04[_0x8753('0x49')]['id']}})[_0x8753('0x28')](handleEntityNotFound(_0x5a3798,null))[_0x8753('0x28')](removeEntity(_0x5a3798,null))[_0x8753('0x48')](handleError(_0x5a3798,null));};exports[_0x8753('0x4a')]=function(_0x211523,_0x2cde6c){return db['ChatGroup']['describe']()[_0x8753('0x28')](respondWithResult(_0x2cde6c,null))['catch'](handleError(_0x2cde6c,null));};exports[_0x8753('0x4b')]=function(_0x378c2d,_0x372e09,_0x31477a){return db[_0x8753('0x4c')]['count']({'where':{'ChatGroupId':_0x378c2d['params']['id'],'ToId':_0x378c2d[_0x8753('0x4d')]['id'],'read':![]}})['then'](function(_0x297afa){return{'id':_[_0x8753('0x4e')](_0x378c2d[_0x8753('0x49')]['id']),'count':_0x297afa};})[_0x8753('0x28')](respondWithResult(_0x372e09,null))[_0x8753('0x48')](handleError(_0x372e09,null));};exports[_0x8753('0x4f')]=function(_0x13b9e0,_0x3338ac,_0x2d1a49){return db[_0x8753('0x2d')][_0x8753('0x45')]({'where':{'id':_0x13b9e0[_0x8753('0x49')]['id']}})[_0x8753('0x28')](handleEntityNotFound(_0x3338ac,null))['then'](function(_0x3cecb2){if(_0x3cecb2){return _0x3cecb2[_0x8753('0x4f')](_0x13b9e0[_0x8753('0x47')]['ids'],_[_0x8753('0x50')](_0x13b9e0[_0x8753('0x47')],[_0x8753('0x51'),'id'])||{});}})[_0x8753('0x28')](respondWithResult(_0x3338ac,null))[_0x8753('0x48')](handleError(_0x3338ac,null));};exports[_0x8753('0x52')]=function(_0x57f06c,_0x579312,_0x4d9854){var _0x1184f3={};var _0xda2735={};var _0xf05de4;var _0x31f878;return db['ChatGroup'][_0x8753('0x53')]({'where':{'id':_0x57f06c[_0x8753('0x49')]['id']}})['then'](handleEntityNotFound(_0x579312,null))[_0x8753('0x28')](function(_0x40031e){if(_0x40031e){_0xf05de4=_0x40031e;_0xda2735[_0x8753('0x32')]=_[_0x8753('0x44')](db[_0x8753('0x54')][_0x8753('0x2e')]);_0xda2735[_0x8753('0x35')]=_[_0x8753('0x44')](_0x57f06c[_0x8753('0x35')]);_0xda2735[_0x8753('0x33')]=_['intersection'](_0xda2735[_0x8753('0x32')],_0xda2735[_0x8753('0x35')]);_0x1184f3[_0x8753('0x37')]=_['intersection'](_0xda2735[_0x8753('0x32')],qs[_0x8753('0x36')](_0x57f06c['query'][_0x8753('0x36')]));_0x1184f3[_0x8753('0x37')]=_0x1184f3['attributes']['length']?_0x1184f3['attributes']:_0xda2735[_0x8753('0x32')];_0x1184f3['order']=qs[_0x8753('0x3b')](_0x57f06c[_0x8753('0x35')][_0x8753('0x3b')]);_0x1184f3[_0x8753('0x3e')]=qs[_0x8753('0x33')](_[_0x8753('0x3c')](_0x57f06c['query'],_0xda2735['filters']));if(_0x57f06c[_0x8753('0x35')][_0x8753('0x3d')]){_0x1184f3[_0x8753('0x3e')]=_[_0x8753('0x3f')](_0x1184f3['where'],{'$or':_[_0x8753('0x2c')](_0x1184f3[_0x8753('0x37')],function(_0xdaa23d){var _0x9a89ac={};_0x9a89ac[_0xdaa23d]={'$like':'%'+_0x57f06c[_0x8753('0x35')][_0x8753('0x3d')]+'%'};return _0x9a89ac;})});}_0x1184f3=_[_0x8753('0x3f')]({},_0x1184f3,_0x57f06c[_0x8753('0x40')]);return _0xf05de4['getMembers'](_0x1184f3);}})['then'](function(_0x4e92e0){if(_0x4e92e0){_0x31f878=_0x4e92e0['length'];if(!_0x57f06c[_0x8753('0x35')]['hasOwnProperty'](_0x8753('0x3a'))){_0x1184f3[_0x8753('0x23')]=qs[_0x8753('0x23')](_0x57f06c[_0x8753('0x35')]['limit']);_0x1184f3[_0x8753('0x20')]=qs[_0x8753('0x20')](_0x57f06c[_0x8753('0x35')][_0x8753('0x20')]);}return _0xf05de4[_0x8753('0x52')](_0x1184f3);}})[_0x8753('0x28')](function(_0x2548c){if(_0x2548c){return _0x2548c?{'count':_0x31f878,'rows':_0x2548c}:null;}})[_0x8753('0x28')](respondWithResult(_0x579312,null))[_0x8753('0x48')](handleError(_0x579312,null));};exports[_0x8753('0x55')]=function(_0x170fc6,_0x3c56c9,_0x54e11b){return db['ChatGroup'][_0x8753('0x45')]({'where':{'id':_0x170fc6[_0x8753('0x49')]['id']}})['then'](handleEntityNotFound(_0x3c56c9,null))['then'](function(_0x58dc9c){if(_0x58dc9c){return _0x58dc9c[_0x8753('0x55')](_0x170fc6['query'][_0x8753('0x51')]);}})[_0x8753('0x28')](respondWithStatusCode(_0x3c56c9,null))[_0x8753('0x48')](handleError(_0x3c56c9,null));};exports[_0x8753('0x56')]=function(_0x4aaa8f,_0x1fc4d9,_0x9a7638){if(_0x4aaa8f[_0x8753('0x47')]['id']){delete _0x4aaa8f[_0x8753('0x47')]['id'];}return db[_0x8753('0x2d')][_0x8753('0x45')]({'where':{'id':_0x4aaa8f[_0x8753('0x49')]['id']}})[_0x8753('0x28')](handleEntityNotFound(_0x1fc4d9,null))['then'](function(_0x5de353){if(_0x5de353){_0x4aaa8f[_0x8753('0x47')][_0x8753('0x57')]=_0x5de353['id'];return db[_0x8753('0x4c')]['create'](_0x4aaa8f['body']);}})[_0x8753('0x28')](respondWithResult(_0x1fc4d9,null))[_0x8753('0x48')](handleError(_0x1fc4d9,null));};exports[_0x8753('0x58')]=function(_0x2cae4d,_0x3e44ab,_0xbff884){var _0x22de04={};var _0x53ed88={};var _0x1ff812;var _0x427575;return db[_0x8753('0x2d')][_0x8753('0x53')]({'where':{'id':_0x2cae4d[_0x8753('0x49')]['id']}})[_0x8753('0x28')](handleEntityNotFound(_0x3e44ab,null))['then'](function(_0x21e321){if(_0x21e321){_0x1ff812=_0x21e321;_0x53ed88[_0x8753('0x32')]=_[_0x8753('0x44')](db[_0x8753('0x4c')][_0x8753('0x2e')]);_0x53ed88[_0x8753('0x35')]=_['keys'](_0x2cae4d[_0x8753('0x35')]);_0x53ed88[_0x8753('0x33')]=_['intersection'](_0x53ed88[_0x8753('0x32')],_0x53ed88[_0x8753('0x35')]);_0x22de04[_0x8753('0x37')]=_[_0x8753('0x34')](_0x53ed88[_0x8753('0x32')],qs['fields'](_0x2cae4d['query'][_0x8753('0x36')]));_0x22de04['attributes']=_0x22de04[_0x8753('0x37')][_0x8753('0x38')]?_0x22de04[_0x8753('0x37')]:_0x53ed88[_0x8753('0x32')];_0x22de04[_0x8753('0x59')]=qs[_0x8753('0x3b')](_0x2cae4d[_0x8753('0x35')][_0x8753('0x3b')]);_0x22de04[_0x8753('0x3e')]=qs['filters'](_[_0x8753('0x3c')](_0x2cae4d['query'],_0x53ed88[_0x8753('0x33')]));if(_0x2cae4d[_0x8753('0x35')]['filter']){_0x22de04[_0x8753('0x3e')]=_['merge'](_0x22de04['where'],{'$or':_['map'](_0x22de04[_0x8753('0x37')],function(_0x2b9e0b){var _0x58c264={};_0x58c264[_0x2b9e0b]={'$like':'%'+_0x2cae4d[_0x8753('0x35')][_0x8753('0x3d')]+'%'};return _0x58c264;})});}if(_0x2cae4d['query']['$gte']){var _0x48f73e=_0x2cae4d[_0x8753('0x35')][_0x8753('0x5a')][_0x8753('0x5b')](',');var _0x251d7={};_0x251d7[_0x48f73e[0x0]]={'$gte':moment(_0x48f73e[0x1])[_0x8753('0x5c')](_0x8753('0x5d'))};_0x22de04[_0x8753('0x3e')]=_[_0x8753('0x3f')](_0x22de04[_0x8753('0x3e')],_0x251d7);}_0x22de04=_[_0x8753('0x3f')]({},_0x22de04,_0x2cae4d[_0x8753('0x40')]);return _0x1ff812[_0x8753('0x58')](_0x22de04);}})[_0x8753('0x28')](function(_0x44746d){if(_0x44746d){_0x427575=_0x44746d['length'];if(!_0x2cae4d[_0x8753('0x35')][_0x8753('0x39')]('nolimit')){_0x22de04['limit']=qs[_0x8753('0x23')](_0x2cae4d[_0x8753('0x35')][_0x8753('0x23')]);_0x22de04[_0x8753('0x20')]=qs[_0x8753('0x20')](_0x2cae4d[_0x8753('0x35')][_0x8753('0x20')]);}return _0x1ff812['getMessages'](_0x22de04);}})[_0x8753('0x28')](function(_0x4e03aa){if(_0x4e03aa){return _0x4e03aa?{'count':_0x427575,'rows':_0x4e03aa}:null;}})[_0x8753('0x28')](respondWithResult(_0x3e44ab,null))[_0x8753('0x48')](handleError(_0x3e44ab,null));};
\ No newline at end of file
+var _0x9060=['bluebird','util','sox','to-csv','fs-extra','squel','jsforce','desk.js','querystring','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','api','../../config/utils','../../config/environment','redis','defaults','localhost','socket.io-emitter','./chatGroup.socket','register','sendStatus','status','end','json','offset','undefined','limit','count','set','apply','reject','save','update','then','error','stack','name','index','rawAttributes','fieldName','type','key','model','map','query','keys','filters','intersection','attributes','fields','length','nolimit','order','sort','pick','where','merge','VIRTUAL','filter','ChatGroup','includeAll','findAll','rows','catch','params','include','options','find','create','body','describe','getUnread','user','toInteger','addMembers','ids','omit','getMembers','findOne','hasOwnProperty','removeMembers','addMessage','ChatInternalMessage','getMessages','$gte','split','format','YYYY-MM-DD\x20HH:mm:ss','eml-format','fast-json-patch','moment'];(function(_0x415c63,_0x72e8d8){var _0x479b50=function(_0x18eeca){while(--_0x18eeca){_0x415c63['push'](_0x415c63['shift']());}};_0x479b50(++_0x72e8d8);}(_0x9060,0x111));var _0x0906=function(_0x4c0622,_0x5dacaf){_0x4c0622=_0x4c0622-0x0;var _0x1799d8=_0x9060[_0x4c0622];return _0x1799d8;};'use strict';var emlformat=require(_0x0906('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0x0906('0x1'));var rp=require('request-promise');var moment=require(_0x0906('0x2'));var BPromise=require(_0x0906('0x3'));var Mustache=require('mustache');var util=require(_0x0906('0x4'));var path=require('path');var sox=require(_0x0906('0x5'));var csv=require(_0x0906('0x6'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x0906('0x7'));var _=require('lodash');var squel=require(_0x0906('0x8'));var crypto=require('crypto');var jsforce=require(_0x0906('0x9'));var deskjs=require(_0x0906('0xa'));var toCsv=require(_0x0906('0x6'));var querystring=require(_0x0906('0xb'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x0906('0xc'));var qs=require(_0x0906('0xd'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x0906('0xe'));var logger=require('../../config/logger')(_0x0906('0xf'));var utils=require(_0x0906('0x10'));var config=require(_0x0906('0x11'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];config[_0x0906('0x12')]=_[_0x0906('0x13')](config[_0x0906('0x12')],{'host':_0x0906('0x14'),'port':0x18eb});var socket=require(_0x0906('0x15'))(new Redis(config[_0x0906('0x12')]));require(_0x0906('0x16'))[_0x0906('0x17')](socket);function respondWithStatusCode(_0x5782d8,_0x388ec8){_0x388ec8=_0x388ec8||0xcc;return function(_0x3fd62e){if(_0x3fd62e){return _0x5782d8[_0x0906('0x18')](_0x388ec8);}return _0x5782d8[_0x0906('0x19')](_0x388ec8)[_0x0906('0x1a')]();};}function respondWithResult(_0x32a54c,_0x223d4c){_0x223d4c=_0x223d4c||0xc8;return function(_0xba0dbc){if(_0xba0dbc){return _0x32a54c[_0x0906('0x19')](_0x223d4c)[_0x0906('0x1b')](_0xba0dbc);}};}function respondWithFilteredResult(_0x2f1772,_0x5cbc8a){return function(_0x160e7b){if(_0x160e7b){var _0x50c45a=typeof _0x5cbc8a[_0x0906('0x1c')]===_0x0906('0x1d')&&typeof _0x5cbc8a[_0x0906('0x1e')]===_0x0906('0x1d');var _0x2a011d=_0x160e7b[_0x0906('0x1f')];var _0x2b2446=_0x50c45a?0x0:_0x5cbc8a['offset'];var _0x3386f4=_0x50c45a?_0x160e7b['count']:_0x5cbc8a[_0x0906('0x1c')]+_0x5cbc8a[_0x0906('0x1e')];var _0x3d86a6;if(_0x3386f4>=_0x2a011d){_0x3386f4=_0x2a011d;_0x3d86a6=0xc8;}else{_0x3d86a6=0xce;}_0x2f1772['status'](_0x3d86a6);return _0x2f1772[_0x0906('0x20')]('Content-Range',_0x2b2446+'-'+_0x3386f4+'/'+_0x2a011d)[_0x0906('0x1b')](_0x160e7b);}return null;};}function patchUpdates(_0x834c0){return function(_0x296aa3){try{jsonpatch[_0x0906('0x21')](_0x296aa3,_0x834c0,!![]);}catch(_0x4daf76){return BPromise[_0x0906('0x22')](_0x4daf76);}return _0x296aa3[_0x0906('0x23')]();};}function saveUpdates(_0x39c3c6,_0x5a678a){return function(_0x37b5b6){if(_0x37b5b6){return _0x37b5b6[_0x0906('0x24')](_0x39c3c6)[_0x0906('0x25')](function(_0x5b04c9){return _0x5b04c9;});}return null;};}function removeEntity(_0x2f0411,_0x4868cf){return function(_0x1633eb){if(_0x1633eb){return _0x1633eb['destroy']()[_0x0906('0x25')](function(){_0x2f0411[_0x0906('0x19')](0xcc)[_0x0906('0x1a')]();});}};}function handleEntityNotFound(_0x599193,_0x2f59a6){return function(_0x3c1c2d){if(!_0x3c1c2d){_0x599193[_0x0906('0x18')](0x194);}return _0x3c1c2d;};}function handleError(_0x5604a8,_0x2091fa){_0x2091fa=_0x2091fa||0x1f4;return function(_0x47dcb8){logger[_0x0906('0x26')](_0x47dcb8[_0x0906('0x27')]);if(_0x47dcb8[_0x0906('0x28')]){delete _0x47dcb8[_0x0906('0x28')];}_0x5604a8['status'](_0x2091fa)['send'](_0x47dcb8);};}exports[_0x0906('0x29')]=function(_0x1f95f,_0x3c6161){var _0x1cdaef={},_0x589410={},_0x58b2f2={'count':0x0,'rows':[]};var _0x1b9b56=_['map'](db['ChatGroup'][_0x0906('0x2a')],function(_0x1adfee){return{'name':_0x1adfee[_0x0906('0x2b')],'type':_0x1adfee[_0x0906('0x2c')][_0x0906('0x2d')]};});_0x589410[_0x0906('0x2e')]=_[_0x0906('0x2f')](_0x1b9b56,_0x0906('0x28'));_0x589410[_0x0906('0x30')]=_[_0x0906('0x31')](_0x1f95f[_0x0906('0x30')]);_0x589410[_0x0906('0x32')]=_[_0x0906('0x33')](_0x589410['model'],_0x589410['query']);_0x1cdaef[_0x0906('0x34')]=_[_0x0906('0x33')](_0x589410[_0x0906('0x2e')],qs[_0x0906('0x35')](_0x1f95f[_0x0906('0x30')][_0x0906('0x35')]));_0x1cdaef['attributes']=_0x1cdaef[_0x0906('0x34')][_0x0906('0x36')]?_0x1cdaef[_0x0906('0x34')]:_0x589410[_0x0906('0x2e')];if(!_0x1f95f['query']['hasOwnProperty'](_0x0906('0x37'))){_0x1cdaef['limit']=qs[_0x0906('0x1e')](_0x1f95f[_0x0906('0x30')][_0x0906('0x1e')]);_0x1cdaef[_0x0906('0x1c')]=qs[_0x0906('0x1c')](_0x1f95f[_0x0906('0x30')][_0x0906('0x1c')]);}_0x1cdaef[_0x0906('0x38')]=qs[_0x0906('0x39')](_0x1f95f[_0x0906('0x30')]['sort']);_0x1cdaef['where']=qs[_0x0906('0x32')](_[_0x0906('0x3a')](_0x1f95f[_0x0906('0x30')],_0x589410[_0x0906('0x32')]),_0x1b9b56);if(_0x1f95f['query']['filter']){_0x1cdaef[_0x0906('0x3b')]=_[_0x0906('0x3c')](_0x1cdaef[_0x0906('0x3b')],{'$or':_[_0x0906('0x2f')](_0x1b9b56,function(_0x343615){if(_0x343615[_0x0906('0x2c')]!==_0x0906('0x3d')){var _0x34b9d9={};_0x34b9d9[_0x343615[_0x0906('0x28')]]={'$like':'%'+_0x1f95f['query'][_0x0906('0x3e')]+'%'};return _0x34b9d9;}})});}_0x1cdaef=_[_0x0906('0x3c')]({},_0x1cdaef,_0x1f95f['options']);var _0x51bfad={'where':_0x1cdaef[_0x0906('0x3b')]};return db[_0x0906('0x3f')][_0x0906('0x1f')](_0x51bfad)['then'](function(_0x39e3b9){_0x58b2f2[_0x0906('0x1f')]=_0x39e3b9;if(_0x1f95f['query'][_0x0906('0x40')]){_0x1cdaef['include']=[{'all':!![]}];}return db[_0x0906('0x3f')][_0x0906('0x41')](_0x1cdaef);})['then'](function(_0x34615c){_0x58b2f2[_0x0906('0x42')]=_0x34615c;return _0x58b2f2;})[_0x0906('0x25')](respondWithFilteredResult(_0x3c6161,_0x1cdaef))[_0x0906('0x43')](handleError(_0x3c6161,null));};exports['show']=function(_0x596307,_0x47c5ed){var _0x6ba49a={'raw':!![],'where':{'id':_0x596307[_0x0906('0x44')]['id']}},_0x5c7606={};_0x5c7606[_0x0906('0x2e')]=_[_0x0906('0x31')](db[_0x0906('0x3f')][_0x0906('0x2a')]);_0x5c7606['query']=_[_0x0906('0x31')](_0x596307[_0x0906('0x30')]);_0x5c7606[_0x0906('0x32')]=_['intersection'](_0x5c7606['model'],_0x5c7606[_0x0906('0x30')]);_0x6ba49a[_0x0906('0x34')]=_[_0x0906('0x33')](_0x5c7606[_0x0906('0x2e')],qs['fields'](_0x596307[_0x0906('0x30')][_0x0906('0x35')]));_0x6ba49a[_0x0906('0x34')]=_0x6ba49a['attributes']['length']?_0x6ba49a[_0x0906('0x34')]:_0x5c7606[_0x0906('0x2e')];if(_0x596307['query'][_0x0906('0x40')]){_0x6ba49a[_0x0906('0x45')]=[{'all':!![]}];}_0x6ba49a=_['merge']({},_0x6ba49a,_0x596307[_0x0906('0x46')]);return db[_0x0906('0x3f')][_0x0906('0x47')](_0x6ba49a)[_0x0906('0x25')](handleEntityNotFound(_0x47c5ed,null))[_0x0906('0x25')](respondWithResult(_0x47c5ed,null))[_0x0906('0x43')](handleError(_0x47c5ed,null));};exports[_0x0906('0x48')]=function(_0x2c7260,_0x202f26){return db[_0x0906('0x3f')]['create'](_0x2c7260[_0x0906('0x49')],{})['then'](respondWithResult(_0x202f26,0xc9))[_0x0906('0x43')](handleError(_0x202f26,null));};exports[_0x0906('0x24')]=function(_0x2b683a,_0x529169){if(_0x2b683a[_0x0906('0x49')]['id']){delete _0x2b683a[_0x0906('0x49')]['id'];}return db[_0x0906('0x3f')][_0x0906('0x47')]({'where':{'id':_0x2b683a['params']['id']}})[_0x0906('0x25')](handleEntityNotFound(_0x529169,null))[_0x0906('0x25')](saveUpdates(_0x2b683a[_0x0906('0x49')],null))['then'](respondWithResult(_0x529169,null))[_0x0906('0x43')](handleError(_0x529169,null));};exports['destroy']=function(_0xd11596,_0x111fc7){return db[_0x0906('0x3f')]['find']({'where':{'id':_0xd11596[_0x0906('0x44')]['id']}})['then'](handleEntityNotFound(_0x111fc7,null))['then'](removeEntity(_0x111fc7,null))[_0x0906('0x43')](handleError(_0x111fc7,null));};exports[_0x0906('0x4a')]=function(_0x4459ef,_0x5f0b18){return db[_0x0906('0x3f')][_0x0906('0x4a')]()[_0x0906('0x25')](respondWithResult(_0x5f0b18,null))[_0x0906('0x43')](handleError(_0x5f0b18,null));};exports[_0x0906('0x4b')]=function(_0x28373f,_0x53091c,_0x445da8){return db['ChatInternalMessage'][_0x0906('0x1f')]({'where':{'ChatGroupId':_0x28373f[_0x0906('0x44')]['id'],'ToId':_0x28373f[_0x0906('0x4c')]['id'],'read':![]}})[_0x0906('0x25')](function(_0x23459f){return{'id':_[_0x0906('0x4d')](_0x28373f[_0x0906('0x44')]['id']),'count':_0x23459f};})[_0x0906('0x25')](respondWithResult(_0x53091c,null))['catch'](handleError(_0x53091c,null));};exports[_0x0906('0x4e')]=function(_0x103e7c,_0x4afa17,_0x15e30d){return db[_0x0906('0x3f')][_0x0906('0x47')]({'where':{'id':_0x103e7c[_0x0906('0x44')]['id']}})[_0x0906('0x25')](handleEntityNotFound(_0x4afa17,null))[_0x0906('0x25')](function(_0x58464c){if(_0x58464c){return _0x58464c[_0x0906('0x4e')](_0x103e7c[_0x0906('0x49')][_0x0906('0x4f')],_[_0x0906('0x50')](_0x103e7c[_0x0906('0x49')],['ids','id'])||{});}})[_0x0906('0x25')](respondWithResult(_0x4afa17,null))[_0x0906('0x43')](handleError(_0x4afa17,null));};exports[_0x0906('0x51')]=function(_0xc9cc25,_0x357242,_0x250d36){var _0x32eead={};var _0x106dbe={};var _0x459b00;var _0xb52234;return db[_0x0906('0x3f')][_0x0906('0x52')]({'where':{'id':_0xc9cc25[_0x0906('0x44')]['id']}})[_0x0906('0x25')](handleEntityNotFound(_0x357242,null))[_0x0906('0x25')](function(_0x37efe3){if(_0x37efe3){_0x459b00=_0x37efe3;_0x106dbe[_0x0906('0x2e')]=_[_0x0906('0x31')](db['User'][_0x0906('0x2a')]);_0x106dbe[_0x0906('0x30')]=_[_0x0906('0x31')](_0xc9cc25[_0x0906('0x30')]);_0x106dbe[_0x0906('0x32')]=_['intersection'](_0x106dbe[_0x0906('0x2e')],_0x106dbe[_0x0906('0x30')]);_0x32eead[_0x0906('0x34')]=_['intersection'](_0x106dbe[_0x0906('0x2e')],qs[_0x0906('0x35')](_0xc9cc25[_0x0906('0x30')][_0x0906('0x35')]));_0x32eead[_0x0906('0x34')]=_0x32eead[_0x0906('0x34')][_0x0906('0x36')]?_0x32eead[_0x0906('0x34')]:_0x106dbe[_0x0906('0x2e')];_0x32eead['order']=qs[_0x0906('0x39')](_0xc9cc25[_0x0906('0x30')]['sort']);_0x32eead['where']=qs[_0x0906('0x32')](_[_0x0906('0x3a')](_0xc9cc25[_0x0906('0x30')],_0x106dbe[_0x0906('0x32')]));if(_0xc9cc25[_0x0906('0x30')][_0x0906('0x3e')]){_0x32eead[_0x0906('0x3b')]=_[_0x0906('0x3c')](_0x32eead[_0x0906('0x3b')],{'$or':_[_0x0906('0x2f')](_0x32eead['attributes'],function(_0x26d645){var _0x100a83={};_0x100a83[_0x26d645]={'$like':'%'+_0xc9cc25['query'][_0x0906('0x3e')]+'%'};return _0x100a83;})});}_0x32eead=_[_0x0906('0x3c')]({},_0x32eead,_0xc9cc25[_0x0906('0x46')]);return _0x459b00[_0x0906('0x51')](_0x32eead);}})[_0x0906('0x25')](function(_0x341f3a){if(_0x341f3a){_0xb52234=_0x341f3a['length'];if(!_0xc9cc25[_0x0906('0x30')][_0x0906('0x53')](_0x0906('0x37'))){_0x32eead['limit']=qs['limit'](_0xc9cc25[_0x0906('0x30')][_0x0906('0x1e')]);_0x32eead[_0x0906('0x1c')]=qs['offset'](_0xc9cc25[_0x0906('0x30')][_0x0906('0x1c')]);}return _0x459b00[_0x0906('0x51')](_0x32eead);}})['then'](function(_0x942b6e){if(_0x942b6e){return _0x942b6e?{'count':_0xb52234,'rows':_0x942b6e}:null;}})['then'](respondWithResult(_0x357242,null))['catch'](handleError(_0x357242,null));};exports[_0x0906('0x54')]=function(_0x15eff7,_0x50756c,_0x2d9b6b){return db[_0x0906('0x3f')][_0x0906('0x47')]({'where':{'id':_0x15eff7['params']['id']}})[_0x0906('0x25')](handleEntityNotFound(_0x50756c,null))['then'](function(_0x5a3f01){if(_0x5a3f01){return _0x5a3f01[_0x0906('0x54')](_0x15eff7[_0x0906('0x30')]['ids']);}})['then'](respondWithStatusCode(_0x50756c,null))['catch'](handleError(_0x50756c,null));};exports[_0x0906('0x55')]=function(_0x395f40,_0x1a112f,_0x1e5ab5){if(_0x395f40['body']['id']){delete _0x395f40['body']['id'];}return db[_0x0906('0x3f')][_0x0906('0x47')]({'where':{'id':_0x395f40['params']['id']}})[_0x0906('0x25')](handleEntityNotFound(_0x1a112f,null))[_0x0906('0x25')](function(_0x717c4c){if(_0x717c4c){_0x395f40[_0x0906('0x49')]['ChatGroupId']=_0x717c4c['id'];return db[_0x0906('0x56')]['create'](_0x395f40[_0x0906('0x49')]);}})['then'](respondWithResult(_0x1a112f,null))[_0x0906('0x43')](handleError(_0x1a112f,null));};exports[_0x0906('0x57')]=function(_0x437169,_0xf68325,_0x59996c){var _0x3e754a={};var _0x299811={};var _0x43ac9b;var _0x257b21;return db[_0x0906('0x3f')][_0x0906('0x52')]({'where':{'id':_0x437169[_0x0906('0x44')]['id']}})['then'](handleEntityNotFound(_0xf68325,null))[_0x0906('0x25')](function(_0x228f0a){if(_0x228f0a){_0x43ac9b=_0x228f0a;_0x299811['model']=_['keys'](db[_0x0906('0x56')][_0x0906('0x2a')]);_0x299811[_0x0906('0x30')]=_[_0x0906('0x31')](_0x437169[_0x0906('0x30')]);_0x299811[_0x0906('0x32')]=_[_0x0906('0x33')](_0x299811[_0x0906('0x2e')],_0x299811['query']);_0x3e754a[_0x0906('0x34')]=_[_0x0906('0x33')](_0x299811[_0x0906('0x2e')],qs[_0x0906('0x35')](_0x437169[_0x0906('0x30')][_0x0906('0x35')]));_0x3e754a['attributes']=_0x3e754a['attributes'][_0x0906('0x36')]?_0x3e754a['attributes']:_0x299811[_0x0906('0x2e')];_0x3e754a[_0x0906('0x38')]=qs['sort'](_0x437169['query']['sort']);_0x3e754a[_0x0906('0x3b')]=qs[_0x0906('0x32')](_[_0x0906('0x3a')](_0x437169['query'],_0x299811[_0x0906('0x32')]));if(_0x437169[_0x0906('0x30')][_0x0906('0x3e')]){_0x3e754a[_0x0906('0x3b')]=_[_0x0906('0x3c')](_0x3e754a[_0x0906('0x3b')],{'$or':_[_0x0906('0x2f')](_0x3e754a[_0x0906('0x34')],function(_0x30db87){var _0xc20e73={};_0xc20e73[_0x30db87]={'$like':'%'+_0x437169[_0x0906('0x30')][_0x0906('0x3e')]+'%'};return _0xc20e73;})});}if(_0x437169['query'][_0x0906('0x58')]){var _0x973a73=_0x437169[_0x0906('0x30')]['$gte'][_0x0906('0x59')](',');var _0x3ca345={};_0x3ca345[_0x973a73[0x0]]={'$gte':moment(_0x973a73[0x1])[_0x0906('0x5a')](_0x0906('0x5b'))};_0x3e754a[_0x0906('0x3b')]=_['merge'](_0x3e754a['where'],_0x3ca345);}_0x3e754a=_[_0x0906('0x3c')]({},_0x3e754a,_0x437169[_0x0906('0x46')]);return _0x43ac9b[_0x0906('0x57')](_0x3e754a);}})['then'](function(_0x3a3008){if(_0x3a3008){_0x257b21=_0x3a3008['length'];if(!_0x437169[_0x0906('0x30')][_0x0906('0x53')](_0x0906('0x37'))){_0x3e754a[_0x0906('0x1e')]=qs[_0x0906('0x1e')](_0x437169[_0x0906('0x30')]['limit']);_0x3e754a[_0x0906('0x1c')]=qs[_0x0906('0x1c')](_0x437169[_0x0906('0x30')][_0x0906('0x1c')]);}return _0x43ac9b[_0x0906('0x57')](_0x3e754a);}})[_0x0906('0x25')](function(_0x34f054){if(_0x34f054){return _0x34f054?{'count':_0x257b21,'rows':_0x34f054}:null;}})[_0x0906('0x25')](respondWithResult(_0xf68325,null))['catch'](handleError(_0xf68325,null));};
\ No newline at end of file
diff --git a/server/api/chatGroup/chatGroup.events.js b/server/api/chatGroup/chatGroup.events.js
index a0f5c02..74fa34a 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 _0x1409=['hook','../../mysqldb','ChatGroup','setMaxListeners','save','update','emit','hasOwnProperty'];(function(_0x28d18f,_0x1131c3){var _0x400c52=function(_0x4851be){while(--_0x4851be){_0x28d18f['push'](_0x28d18f['shift']());}};_0x400c52(++_0x1131c3);}(_0x1409,0x79));var _0x9140=function(_0x4b646a,_0x4ec531){_0x4b646a=_0x4b646a-0x0;var _0x21c6b1=_0x1409[_0x4b646a];return _0x21c6b1;};'use strict';var EventEmitter=require('events');var ChatGroup=require(_0x9140('0x0'))['db'][_0x9140('0x1')];var ChatGroupEvents=new EventEmitter();ChatGroupEvents[_0x9140('0x2')](0x0);var events={'afterCreate':_0x9140('0x3'),'afterUpdate':_0x9140('0x4'),'afterDestroy':'remove'};function emitEvent(_0x13e6a9){return function(_0x74a3a6,_0x5e0721,_0xcead8a){ChatGroupEvents[_0x9140('0x5')](_0x13e6a9+':'+_0x74a3a6['id'],_0x74a3a6);ChatGroupEvents['emit'](_0x13e6a9,_0x74a3a6);_0xcead8a(null);};}for(var e in events){if(events[_0x9140('0x6')](e)){var event=events[e];ChatGroup[_0x9140('0x7')](e,emitEvent(event));}}module['exports']=ChatGroupEvents;
\ No newline at end of file
+var _0x9aac=['hook','events','ChatGroup','setMaxListeners','update','emit','hasOwnProperty'];(function(_0x4ab6a1,_0x4d64d5){var _0x2a24cc=function(_0x2625a0){while(--_0x2625a0){_0x4ab6a1['push'](_0x4ab6a1['shift']());}};_0x2a24cc(++_0x4d64d5);}(_0x9aac,0x135));var _0xc9aa=function(_0xa39f64,_0x681888){_0xa39f64=_0xa39f64-0x0;var _0x222314=_0x9aac[_0xa39f64];return _0x222314;};'use strict';var EventEmitter=require(_0xc9aa('0x0'));var ChatGroup=require('../../mysqldb')['db'][_0xc9aa('0x1')];var ChatGroupEvents=new EventEmitter();ChatGroupEvents[_0xc9aa('0x2')](0x0);var events={'afterCreate':'save','afterUpdate':_0xc9aa('0x3'),'afterDestroy':'remove'};function emitEvent(_0x8ca086){return function(_0x5c8ce2,_0x28c49c,_0x267772){ChatGroupEvents['emit'](_0x8ca086+':'+_0x5c8ce2['id'],_0x5c8ce2);ChatGroupEvents[_0xc9aa('0x4')](_0x8ca086,_0x5c8ce2);_0x267772(null);};}for(var e in events){if(events[_0xc9aa('0x5')](e)){var event=events[e];ChatGroup[_0xc9aa('0x6')](e,emitEvent(event));}}module['exports']=ChatGroupEvents;
\ No newline at end of file
diff --git a/server/api/chatGroup/chatGroup.model.js b/server/api/chatGroup/chatGroup.model.js
index 4553101..3758259 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 _0xbc5b=['./chatGroup.attributes','exports','define','ChatGroup','chat_groups','lodash','util','../../config/logger','api','moment','request-promise','path','rimraf','../../config/environment'];(function(_0x2be7dd,_0x226547){var _0x4c94e1=function(_0x97d18c){while(--_0x97d18c){_0x2be7dd['push'](_0x2be7dd['shift']());}};_0x4c94e1(++_0x226547);}(_0xbc5b,0x17f));var _0xbbc5=function(_0x2c91e9,_0x2fb965){_0x2c91e9=_0x2c91e9-0x0;var _0x13f0ff=_0xbc5b[_0x2c91e9];return _0x13f0ff;};'use strict';var _=require(_0xbbc5('0x0'));var util=require(_0xbbc5('0x1'));var logger=require(_0xbbc5('0x2'))(_0xbbc5('0x3'));var moment=require(_0xbbc5('0x4'));var BPromise=require('bluebird');var rp=require(_0xbbc5('0x5'));var fs=require('fs');var path=require(_0xbbc5('0x6'));var rimraf=require(_0xbbc5('0x7'));var config=require(_0xbbc5('0x8'));var attributes=require(_0xbbc5('0x9'));module[_0xbbc5('0xa')]=function(_0x339b08,_0x1a5e25){return _0x339b08[_0xbbc5('0xb')](_0xbbc5('0xc'),attributes,{'tableName':_0xbbc5('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xf294=['path','../../config/environment','./chatGroup.attributes','exports','define','chat_groups','lodash','util','../../config/logger','api','moment','bluebird','request-promise'];(function(_0x1dcc1b,_0x22002f){var _0x5ba0c5=function(_0x1633a5){while(--_0x1633a5){_0x1dcc1b['push'](_0x1dcc1b['shift']());}};_0x5ba0c5(++_0x22002f);}(_0xf294,0xa2));var _0x4f29=function(_0x39ad4c,_0x2fa27e){_0x39ad4c=_0x39ad4c-0x0;var _0xf3314d=_0xf294[_0x39ad4c];return _0xf3314d;};'use strict';var _=require(_0x4f29('0x0'));var util=require(_0x4f29('0x1'));var logger=require(_0x4f29('0x2'))(_0x4f29('0x3'));var moment=require(_0x4f29('0x4'));var BPromise=require(_0x4f29('0x5'));var rp=require(_0x4f29('0x6'));var fs=require('fs');var path=require(_0x4f29('0x7'));var rimraf=require('rimraf');var config=require(_0x4f29('0x8'));var attributes=require(_0x4f29('0x9'));module[_0x4f29('0xa')]=function(_0x46e8c2,_0x7e69b9){return _0x46e8c2[_0x4f29('0xb')]('ChatGroup',attributes,{'tableName':_0x4f29('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
diff --git a/server/api/chatGroup/chatGroup.rpc.js b/server/api/chatGroup/chatGroup.rpc.js
index fc0310a..5ddbd37 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 _0x7617=['client','http','redis','localhost','socket.io-emitter','./chatGroup.socket','register','request','info','ChatGroup,\x20%s,\x20%s','request\x20sent','debug','ChatGroup,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','util','bluebird','ioredis','rpc','../../config/environment','jayson/promise'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x7617,0x1cd));var _0x7761=function(_0x3f0014,_0x22b6a7){_0x3f0014=_0x3f0014-0x0;var _0x137811=_0x7617[_0x3f0014];return _0x137811;};'use strict';var _=require(_0x7761('0x0'));var util=require(_0x7761('0x1'));var moment=require('moment');var BPromise=require(_0x7761('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x7761('0x3'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x7761('0x4'));var config=require(_0x7761('0x5'));var jayson=require(_0x7761('0x6'));var client=jayson[_0x7761('0x7')][_0x7761('0x8')]({'port':0x232a});config[_0x7761('0x9')]=_['defaults'](config['redis'],{'host':_0x7761('0xa'),'port':0x18eb});var socket=require(_0x7761('0xb'))(new Redis(config[_0x7761('0x9')]));require(_0x7761('0xc'))[_0x7761('0xd')](socket);function respondWithRpcPromise(_0x354369,_0x57015c,_0x329ba5){return new BPromise(function(_0x1dbf7d,_0x43b7a8){return client[_0x7761('0xe')](_0x354369,_0x329ba5)['then'](function(_0x117f89){logger[_0x7761('0xf')](_0x7761('0x10'),_0x57015c,_0x7761('0x11'));logger[_0x7761('0x12')](_0x7761('0x13'),_0x57015c,'request\x20sent',JSON[_0x7761('0x14')](_0x117f89));if(_0x117f89[_0x7761('0x15')]){if(_0x117f89[_0x7761('0x15')][_0x7761('0x16')]===0x1f4){logger[_0x7761('0x15')](_0x7761('0x10'),_0x57015c,_0x117f89[_0x7761('0x15')]['message']);return _0x43b7a8(_0x117f89[_0x7761('0x15')][_0x7761('0x17')]);}logger['error'](_0x7761('0x10'),_0x57015c,_0x117f89['error'][_0x7761('0x17')]);return _0x1dbf7d(_0x117f89['error'][_0x7761('0x17')]);}else{logger[_0x7761('0xf')]('ChatGroup,\x20%s,\x20%s',_0x57015c,'request\x20sent');_0x1dbf7d(_0x117f89[_0x7761('0x18')][_0x7761('0x17')]);}})[_0x7761('0x19')](function(_0x1fcda2){logger['error'](_0x7761('0x10'),_0x57015c,_0x1fcda2);_0x43b7a8(_0x1fcda2);});});}
\ No newline at end of file
+var _0x9dc3=['info','ChatGroup,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','catch','lodash','util','moment','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','redis','defaults','localhost','register','request','then'];(function(_0x15fc3c,_0x35665b){var _0x94c5c8=function(_0xbab268){while(--_0xbab268){_0x15fc3c['push'](_0x15fc3c['shift']());}};_0x94c5c8(++_0x35665b);}(_0x9dc3,0xa5));var _0x39dc=function(_0x340340,_0xc747c2){_0x340340=_0x340340-0x0;var _0x261359=_0x9dc3[_0x340340];return _0x261359;};'use strict';var _=require(_0x39dc('0x0'));var util=require(_0x39dc('0x1'));var moment=require(_0x39dc('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x39dc('0x3'));var db=require(_0x39dc('0x4'))['db'];var utils=require(_0x39dc('0x5'));var logger=require(_0x39dc('0x6'))(_0x39dc('0x7'));var config=require(_0x39dc('0x8'));var jayson=require('jayson/promise');var client=jayson[_0x39dc('0x9')][_0x39dc('0xa')]({'port':0x232a});config[_0x39dc('0xb')]=_[_0x39dc('0xc')](config[_0x39dc('0xb')],{'host':_0x39dc('0xd'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require('./chatGroup.socket')[_0x39dc('0xe')](socket);function respondWithRpcPromise(_0x44f334,_0x16bbbd,_0xffe473){return new BPromise(function(_0x2b4d22,_0x1eebb1){return client[_0x39dc('0xf')](_0x44f334,_0xffe473)[_0x39dc('0x10')](function(_0x54490e){logger[_0x39dc('0x11')](_0x39dc('0x12'),_0x16bbbd,_0x39dc('0x13'));logger[_0x39dc('0x14')]('ChatGroup,\x20%s,\x20%s,\x20%s',_0x16bbbd,_0x39dc('0x13'),JSON[_0x39dc('0x15')](_0x54490e));if(_0x54490e[_0x39dc('0x16')]){if(_0x54490e['error'][_0x39dc('0x17')]===0x1f4){logger[_0x39dc('0x16')](_0x39dc('0x12'),_0x16bbbd,_0x54490e[_0x39dc('0x16')][_0x39dc('0x18')]);return _0x1eebb1(_0x54490e['error'][_0x39dc('0x18')]);}logger[_0x39dc('0x16')](_0x39dc('0x12'),_0x16bbbd,_0x54490e[_0x39dc('0x16')][_0x39dc('0x18')]);return _0x2b4d22(_0x54490e[_0x39dc('0x16')][_0x39dc('0x18')]);}else{logger['info'](_0x39dc('0x12'),_0x16bbbd,_0x39dc('0x13'));_0x2b4d22(_0x54490e['result']['message']);}})[_0x39dc('0x19')](function(_0x11fb9b){logger[_0x39dc('0x16')](_0x39dc('0x12'),_0x16bbbd,_0x11fb9b);_0x1eebb1(_0x11fb9b);});});}
\ No newline at end of file
diff --git a/server/api/chatGroup/chatGroup.socket.js b/server/api/chatGroup/chatGroup.socket.js
index 48d3b31..fa6cc67 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 _0x26a6=['save','remove','update','removeListener','register','chatGroup:'];(function(_0x13ae53,_0x4729cc){var _0x247e55=function(_0x1800ec){while(--_0x1800ec){_0x13ae53['push'](_0x13ae53['shift']());}};_0x247e55(++_0x4729cc);}(_0x26a6,0x6c));var _0x626a=function(_0x3c3825,_0x518587){_0x3c3825=_0x3c3825-0x0;var _0x2e7ee2=_0x26a6[_0x3c3825];return _0x2e7ee2;};'use strict';var ChatGroupEvents=require('./chatGroup.events');var events=[_0x626a('0x0'),_0x626a('0x1'),_0x626a('0x2')];function createListener(_0x180a23,_0xb13125){return function(_0x2aa0a2){_0xb13125['emit'](_0x180a23,_0x2aa0a2);};}function removeListener(_0x2767d7,_0x5dbe37){return function(){ChatGroupEvents[_0x626a('0x3')](_0x2767d7,_0x5dbe37);};}exports[_0x626a('0x4')]=function(_0x305afe){for(var _0x2f020c=0x0,_0x1f0fb6=events['length'];_0x2f020c<_0x1f0fb6;_0x2f020c++){var _0x44c1e9=events[_0x2f020c];var _0x458286=createListener(_0x626a('0x5')+_0x44c1e9,_0x305afe);ChatGroupEvents['on'](_0x44c1e9,_0x458286);}};
\ No newline at end of file
+var _0xaded=['./chatGroup.events','save','remove','emit','register','chatGroup:'];(function(_0x5df25b,_0x1bc928){var _0x19f252=function(_0x41de28){while(--_0x41de28){_0x5df25b['push'](_0x5df25b['shift']());}};_0x19f252(++_0x1bc928);}(_0xaded,0x10e));var _0xdade=function(_0x5efe23,_0x5c40e7){_0x5efe23=_0x5efe23-0x0;var _0x2b176a=_0xaded[_0x5efe23];return _0x2b176a;};'use strict';var ChatGroupEvents=require(_0xdade('0x0'));var events=[_0xdade('0x1'),_0xdade('0x2'),'update'];function createListener(_0x35e53f,_0x5e7ad3){return function(_0x13e193){_0x5e7ad3[_0xdade('0x3')](_0x35e53f,_0x13e193);};}function removeListener(_0x991f3d,_0x3aa5df){return function(){ChatGroupEvents['removeListener'](_0x991f3d,_0x3aa5df);};}exports[_0xdade('0x4')]=function(_0x356d33){for(var _0x5db69e=0x0,_0x512eca=events['length'];_0x5db69e<_0x512eca;_0x5db69e++){var _0x599b6e=events[_0x5db69e];var _0x5e01a7=createListener(_0xdade('0x5')+_0x599b6e,_0x356d33);ChatGroupEvents['on'](_0x599b6e,_0x5e01a7);}};
\ No newline at end of file
diff --git a/server/api/chatGroup/index.js b/server/api/chatGroup/index.js
index 0dd8ad4..13f8c63 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 _0x27c3=['/:id/members','addMembers','addMessage','put','update','delete','destroy','removeMembers','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','/describe','describe','/:id','show','/:id/unread','getUnread','post'];(function(_0x17b6e3,_0x4522ed){var _0x3906f3=function(_0x430f87){while(--_0x430f87){_0x17b6e3['push'](_0x17b6e3['shift']());}};_0x3906f3(++_0x4522ed);}(_0x27c3,0x159));var _0x327c=function(_0x27fe26,_0x3b8ca7){_0x27fe26=_0x27fe26-0x0;var _0x4fcb35=_0x27c3[_0x27fe26];return _0x4fcb35;};'use strict';var multer=require(_0x327c('0x0'));var util=require(_0x327c('0x1'));var path=require(_0x327c('0x2'));var timeout=require(_0x327c('0x3'));var express=require(_0x327c('0x4'));var router=express[_0x327c('0x5')]();var fs_extra=require(_0x327c('0x6'));var auth=require(_0x327c('0x7'));var interaction=require(_0x327c('0x8'));var config=require(_0x327c('0x9'));var controller=require('./chatGroup.controller');router[_0x327c('0xa')]('/',auth[_0x327c('0xb')](),controller['index']);router[_0x327c('0xa')](_0x327c('0xc'),auth[_0x327c('0xb')](),controller[_0x327c('0xd')]);router[_0x327c('0xa')](_0x327c('0xe'),auth[_0x327c('0xb')](),controller[_0x327c('0xf')]);router['get'](_0x327c('0x10'),auth[_0x327c('0xb')](),controller[_0x327c('0x11')]);router[_0x327c('0xa')]('/:id/members',auth[_0x327c('0xb')](),controller['getMembers']);router[_0x327c('0xa')]('/:id/messages',auth[_0x327c('0xb')](),controller['getMessages']);router[_0x327c('0x12')]('/',auth[_0x327c('0xb')](),controller['create']);router[_0x327c('0x12')](_0x327c('0x13'),auth[_0x327c('0xb')](),controller[_0x327c('0x14')]);router[_0x327c('0x12')]('/:id/messages',auth[_0x327c('0xb')](),controller[_0x327c('0x15')]);router[_0x327c('0x16')](_0x327c('0xe'),auth[_0x327c('0xb')](),controller[_0x327c('0x17')]);router[_0x327c('0x18')](_0x327c('0xe'),auth['isAuthenticated'](),controller[_0x327c('0x19')]);router['delete'](_0x327c('0x13'),auth['isAuthenticated'](),controller[_0x327c('0x1a')]);module[_0x327c('0x1b')]=router;
\ No newline at end of file
+var _0xddd2=['post','create','addMessage','put','update','delete','/:id/members','exports','multer','util','connect-timeout','express','Router','fs-extra','../../components/auth/service','get','isAuthenticated','index','/describe','describe','/:id','show','/:id/unread','getUnread','getMembers','/:id/messages','getMessages'];(function(_0x52f3e2,_0x422aec){var _0x3ca491=function(_0x2fed77){while(--_0x2fed77){_0x52f3e2['push'](_0x52f3e2['shift']());}};_0x3ca491(++_0x422aec);}(_0xddd2,0x1b8));var _0x2ddd=function(_0x3bcd0b,_0x118ab4){_0x3bcd0b=_0x3bcd0b-0x0;var _0x307096=_0xddd2[_0x3bcd0b];return _0x307096;};'use strict';var multer=require(_0x2ddd('0x0'));var util=require(_0x2ddd('0x1'));var path=require('path');var timeout=require(_0x2ddd('0x2'));var express=require(_0x2ddd('0x3'));var router=express[_0x2ddd('0x4')]();var fs_extra=require(_0x2ddd('0x5'));var auth=require(_0x2ddd('0x6'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require('./chatGroup.controller');router[_0x2ddd('0x7')]('/',auth[_0x2ddd('0x8')](),controller[_0x2ddd('0x9')]);router[_0x2ddd('0x7')](_0x2ddd('0xa'),auth['isAuthenticated'](),controller[_0x2ddd('0xb')]);router[_0x2ddd('0x7')](_0x2ddd('0xc'),auth[_0x2ddd('0x8')](),controller[_0x2ddd('0xd')]);router[_0x2ddd('0x7')](_0x2ddd('0xe'),auth['isAuthenticated'](),controller[_0x2ddd('0xf')]);router[_0x2ddd('0x7')]('/:id/members',auth[_0x2ddd('0x8')](),controller[_0x2ddd('0x10')]);router[_0x2ddd('0x7')](_0x2ddd('0x11'),auth[_0x2ddd('0x8')](),controller[_0x2ddd('0x12')]);router[_0x2ddd('0x13')]('/',auth[_0x2ddd('0x8')](),controller[_0x2ddd('0x14')]);router[_0x2ddd('0x13')]('/:id/members',auth[_0x2ddd('0x8')](),controller['addMembers']);router[_0x2ddd('0x13')]('/:id/messages',auth[_0x2ddd('0x8')](),controller[_0x2ddd('0x15')]);router[_0x2ddd('0x16')]('/:id',auth[_0x2ddd('0x8')](),controller[_0x2ddd('0x17')]);router[_0x2ddd('0x18')](_0x2ddd('0xc'),auth[_0x2ddd('0x8')](),controller['destroy']);router[_0x2ddd('0x18')](_0x2ddd('0x19'),auth['isAuthenticated'](),controller['removeMembers']);module[_0x2ddd('0x1a')]=router;
\ No newline at end of file
diff --git a/server/api/chatInteraction/chatInteraction.attributes.js b/server/api/chatInteraction/chatInteraction.attributes.js
index 723fc9a..51c7aac 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 _0x3c81=['INTEGER','ENUM','TEXT','STRING','DATE','long','out','BOOLEAN','sequelize','exports'];(function(_0x1002e5,_0x46556c){var _0x4a6654=function(_0x1ad73b){while(--_0x1ad73b){_0x1002e5['push'](_0x1002e5['shift']());}};_0x4a6654(++_0x46556c);}(_0x3c81,0x102));var _0x13c8=function(_0xb1348f,_0x41a781){_0xb1348f=_0xb1348f-0x0;var _0x6665de=_0x3c81[_0xb1348f];return _0x6665de;};'use strict';var Sequelize=require(_0x13c8('0x0'));module[_0x13c8('0x1')]={'closed':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'ratingValue':{'type':Sequelize[_0x13c8('0x2')]},'ratingType':{'type':Sequelize[_0x13c8('0x3')]('star','thumb'),'defaultValue':'star'},'ratingMessage':{'type':Sequelize['TEXT']},'pathTranscript':{'type':Sequelize[_0x13c8('0x4')]},'mailTranscript':{'type':Sequelize[_0x13c8('0x5')],'validate':{'isEmail':!![]}},'closedAt':{'type':Sequelize[_0x13c8('0x6')]},'disposition':{'type':Sequelize[_0x13c8('0x5')]},'secondDisposition':{'type':Sequelize[_0x13c8('0x5')]},'thirdDisposition':{'type':Sequelize[_0x13c8('0x5')]},'note':{'type':Sequelize[_0x13c8('0x5')]},'browserName':{'type':Sequelize['STRING']},'browserVersion':{'type':Sequelize[_0x13c8('0x5')]},'osName':{'type':Sequelize['STRING']},'osVersion':{'type':Sequelize[_0x13c8('0x5')]},'deviceModel':{'type':Sequelize[_0x13c8('0x5')]},'deviceVendor':{'type':Sequelize[_0x13c8('0x5')]},'deviceType':{'type':Sequelize[_0x13c8('0x5')]},'referer':{'type':Sequelize[_0x13c8('0x4')]},'customerIp':{'type':Sequelize[_0x13c8('0x5')]},'formData':{'type':Sequelize[_0x13c8('0x4')](_0x13c8('0x7'))},'read1stAt':{'type':Sequelize[_0x13c8('0x6')]},'lastMsgAt':{'type':Sequelize[_0x13c8('0x6')]},'lastMsgDirection':{'type':Sequelize[_0x13c8('0x3')]('in',_0x13c8('0x8')),'defaultValue':'in','allowNull':![]},'closeReason':{'type':Sequelize[_0x13c8('0x5')]},'customerPort':{'type':Sequelize[_0x13c8('0x5')]},'vidaooSessionId':{'type':Sequelize['TEXT']},'autoreplyExecuted':{'type':Sequelize[_0x13c8('0x9')],'defaultValue':![]}};
\ No newline at end of file
+var _0x6836=['BOOLEAN','ENUM','thumb','TEXT','STRING','DATE','out','sequelize','exports'];(function(_0x47e7cb,_0x4c1b8d){var _0x2a8874=function(_0x36498f){while(--_0x36498f){_0x47e7cb['push'](_0x47e7cb['shift']());}};_0x2a8874(++_0x4c1b8d);}(_0x6836,0x1c0));var _0x6683=function(_0x1beef3,_0x57c4b8){_0x1beef3=_0x1beef3-0x0;var _0x5af964=_0x6836[_0x1beef3];return _0x5af964;};'use strict';var Sequelize=require(_0x6683('0x0'));module[_0x6683('0x1')]={'closed':{'type':Sequelize[_0x6683('0x2')],'defaultValue':![]},'ratingValue':{'type':Sequelize['INTEGER']},'ratingType':{'type':Sequelize[_0x6683('0x3')]('star',_0x6683('0x4')),'defaultValue':'star'},'ratingMessage':{'type':Sequelize[_0x6683('0x5')]},'pathTranscript':{'type':Sequelize['TEXT']},'mailTranscript':{'type':Sequelize[_0x6683('0x6')],'validate':{'isEmail':!![]}},'closedAt':{'type':Sequelize[_0x6683('0x7')]},'disposition':{'type':Sequelize[_0x6683('0x6')]},'secondDisposition':{'type':Sequelize[_0x6683('0x6')]},'thirdDisposition':{'type':Sequelize['STRING']},'note':{'type':Sequelize[_0x6683('0x6')]},'browserName':{'type':Sequelize[_0x6683('0x6')]},'browserVersion':{'type':Sequelize[_0x6683('0x6')]},'osName':{'type':Sequelize[_0x6683('0x6')]},'osVersion':{'type':Sequelize[_0x6683('0x6')]},'deviceModel':{'type':Sequelize[_0x6683('0x6')]},'deviceVendor':{'type':Sequelize['STRING']},'deviceType':{'type':Sequelize['STRING']},'referer':{'type':Sequelize[_0x6683('0x5')]},'customerIp':{'type':Sequelize[_0x6683('0x6')]},'formData':{'type':Sequelize[_0x6683('0x5')]('long')},'read1stAt':{'type':Sequelize[_0x6683('0x7')]},'lastMsgAt':{'type':Sequelize['DATE']},'lastMsgDirection':{'type':Sequelize[_0x6683('0x3')]('in',_0x6683('0x8')),'defaultValue':'in','allowNull':![]},'closeReason':{'type':Sequelize[_0x6683('0x6')]},'customerPort':{'type':Sequelize[_0x6683('0x6')]},'vidaooSessionId':{'type':Sequelize[_0x6683('0x5')]},'autoreplyExecuted':{'type':Sequelize[_0x6683('0x2')],'defaultValue':![]}};
\ No newline at end of file
diff --git a/server/api/chatInteraction/chatInteraction.controller.js b/server/api/chatInteraction/chatInteraction.controller.js
index ff44a5c..9185ee2 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 _0x9ffd=['MATCH\x20(me.body)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','CONCAT(c.firstName,\x20\x27\x20\x27,\x20c.lastName)\x20LIKE\x20?','i.id','Sequelize','QueryTypes','SELECT','clone','SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)','order','contactName','DESC','resolve','i.ChatWebsiteId\x20IS\x20NOT\x20NULL','user','agent','getChatWebsites','isEmpty','i.ChatWebsiteId\x20IS\x20NULL','role','sequelize','keyBy','a.key','a.mandatoryDisposition','Account.mandatoryDisposition','CASE\x20WHEN\x20(c.firstName\x20IS\x20NOT\x20NULL\x20AND\x20c.firstName\x20<>\x20\x27\x27)\x20OR\x20(c.lastName\x20IS\x20NOT\x20NULL\x20AND\x20c.lastName\x20<>\x20\x27\x27)\x20THEN\x20CONCAT(IFNULL(c.firstName,\x20\x27\x27),\x20\x27\x20\x27,\x20IFNULL(c.lastName,\x20\x27\x27))\x20ELSE\x20\x27Unknown\x27\x20END','i.*','c.firstName','Contact.firstName','c.lastName','c.email','c.phone','Contact.phone','c.mobile','Contact.mobile','c.fax','Contact.fax','o.fullname','Owner.fullname','GROUP_CONCAT(DISTINCT\x20t.id)','toString','ui.ChatInteractionId\x20IN\x20?','groupBy','params','includeAll','find','destroy','describe','createVidaooSession','findOne','ChatWebsite','vidaooNote','vidaooApiKey','vidaooEscalation','email','POST','https://api-vidaoo.xcally.com/api/v1/meetings','isNull','follow','vidaooMetadata','metadata','ValidationError','Error\x20in\x20conversion\x20vidaooMetadata','join_url','out','ChatMessage','create','updateAttributes','customUpdate','abandonInteraction,\x20%s,\x20%s,\x20%s','Interaction\x20already\x20assigned','closed','disposition','AbandonInteraction','abandon','attachmentUpload','file','originalname','basename','filename','Attachment','attachmentDownload','attachId','ChatOfflineMessageId','join','root','server/files/attachments/','offline-chat/','download','close','mailTranscript','server/files/chat/upload/','format','transcript-%s.txt','now','pathTranscript','Messages','%s%d','agentAlias','System','Visitor','agentIdentifier','website_alias','agent_alias','alias','agent_fullname','[%s]\x20%s:\x20%s\x0a','MM/DD/YYYY\x20HH:mm:ss','direction','appendFileSync','MailAccount','Smtp','service','host','port','secure','authentication','auth','pass','SendMail','sendMail','\x22%s\x22\x20<%s>','addMessage','ids','omit','getMessages','ChatInteractionId','YYYY-MM-DD\x20HH:mm:ss','options','findAll','rows','secret','include','includeAgent','push','setTags','spread','Tag','emit','chatInteractionTags:save','removeTags','unix','tmp','server','files','CmContact','firstName','attachments','Account','Owner','get','mkdirSync','Chat','closedAt','browserName','osName','referer','customerIp','customerPort','tail','existsSync','createReadStream','pipe','lastName','views','downloadInteraction.ejs','transcript-','.pdf','createPdfFromHTML','err','unlinkSync','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','path','sox','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','to-csv','querystring','../../components/parsers/advancedSearch','../../components/export/pdf','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','defaults','redis','localhost','socket.io-emitter','register','jayson/promise','http','request','then','info','ChatInteraction,\x20%s,\x20%s','request\x20sent','debug','ChatInteraction,\x20%s,\x20%s,\x20%s','stringify','code','error','message','result','catch','sendStatus','end','json','offset','undefined','limit','count','status','set','apply','reject','save','update','stack','name','render','merge','body','contact','account','Users','fullname','Tags','TagIds','split','forEach','index','ChatInteraction','rawAttributes','fieldName','type','keys','query','filters','model','intersection','fields','attributes','length','hasOwnProperty','nolimit','sort','pick','select','field','color','from','left_join','u.id\x20=\x20ui.UserId','chat_interactions','c.id\x20=\x20i.ContactId\x20AND\x20c.deletedAt\x20IS\x20NULL','users','chat_websites','a.id\x20=\x20i.ChatWebsiteId','chat_messages','chat_interaction_has_tags','it.ChatInteractionId\x20=\x20i.id','tools_tags','t.id\x20=\x20it.TagId','parseSearch','search','conditions','unreadMessages','value','having','`\x20=\x200','`\x20>\x200','Contact','operator','$substring','getFullTextValue','c.firstName\x20LIKE\x20?\x20OR\x20c.lastName\x20LIKE\x20?\x20OR\x20c.email\x20LIKE\x20?','ContactId','buildExpression','text','map','CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','union','User','CONCAT_WS(\x27\x20\x27,\x20o.name,\x20o.fullname)\x20LIKE\x20?','UserId','start','compact','ChatWebsiteId','where','i.ChatWebsiteId\x20IN\x20?','createdAt','parse','$gte','$lte','i.createdAt\x20BETWEEN\x20?\x20AND\x20?','null','\x20IS\x20NULL','\x20=\x20?','read','`unreadMessages`\x20=\x200','`unreadMessages`\x20>\x200','tag','filter','replace','isNumeric','i.id\x20LIKE\x20?'];(function(_0x54d4fe,_0x55e869){var _0x1ab5bb=function(_0x5b1af2){while(--_0x5b1af2){_0x54d4fe['push'](_0x54d4fe['shift']());}};_0x1ab5bb(++_0x55e869);}(_0x9ffd,0xaa));var _0xd9ff=function(_0x1add26,_0x26c68c){_0x1add26=_0x1add26-0x0;var _0x2d393e=_0x9ffd[_0x1add26];return _0x2d393e;};'use strict';var emlformat=require(_0xd9ff('0x0'));var rimraf=require(_0xd9ff('0x1'));var zipdir=require(_0xd9ff('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xd9ff('0x3'));var moment=require(_0xd9ff('0x4'));var BPromise=require(_0xd9ff('0x5'));var Mustache=require(_0xd9ff('0x6'));var util=require('util');var path=require(_0xd9ff('0x7'));var sox=require(_0xd9ff('0x8'));var csv=require('to-csv');var ejs=require(_0xd9ff('0x9'));var fs=require('fs');var fs_extra=require(_0xd9ff('0xa'));var _=require(_0xd9ff('0xb'));var squel=require(_0xd9ff('0xc'));var crypto=require(_0xd9ff('0xd'));var jsforce=require(_0xd9ff('0xe'));var deskjs=require(_0xd9ff('0xf'));var toCsv=require(_0xd9ff('0x10'));var querystring=require(_0xd9ff('0x11'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0xd9ff('0x12'));var pdf=require(_0xd9ff('0x13'));var hardwareService=require(_0xd9ff('0x14'));var logger=require(_0xd9ff('0x15'))(_0xd9ff('0x16'));var utils=require(_0xd9ff('0x17'));var config=require(_0xd9ff('0x18'));var licenseUtil=require(_0xd9ff('0x19'));var db=require('../../mysqldb')['db'];config['redis']=_[_0xd9ff('0x1a')](config[_0xd9ff('0x1b')],{'host':_0xd9ff('0x1c'),'port':0x18eb});var socket=require(_0xd9ff('0x1d'))(new Redis(config[_0xd9ff('0x1b')]));require('./chatInteraction.socket')[_0xd9ff('0x1e')](socket);var jayson=require(_0xd9ff('0x1f'));var client=jayson['client'][_0xd9ff('0x20')]({'port':0x232b});var client9004=jayson['client']['http']({'port':0x232c});function respondWithRpcPromise(_0x547e28,_0x4c5718,_0x271287,_0x4f9d6d){return new BPromise(function(_0x35679e,_0xa30fd2){var _0x39c6ce=_0x4f9d6d||client;return _0x39c6ce[_0xd9ff('0x21')](_0x547e28,_0x271287)[_0xd9ff('0x22')](function(_0x2d4df1){logger[_0xd9ff('0x23')](_0xd9ff('0x24'),_0x4c5718,_0xd9ff('0x25'));logger[_0xd9ff('0x26')](_0xd9ff('0x27'),_0x4c5718,_0xd9ff('0x25'),JSON[_0xd9ff('0x28')](_0x2d4df1));if(_0x2d4df1['error']){if(_0x2d4df1['error'][_0xd9ff('0x29')]===0x1f4){logger[_0xd9ff('0x2a')]('ChatInteraction,\x20%s,\x20%s',_0x4c5718,_0x2d4df1['error']['message']);return _0xa30fd2(_0x2d4df1['error'][_0xd9ff('0x2b')]);}logger['error'](_0xd9ff('0x24'),_0x4c5718,_0x2d4df1[_0xd9ff('0x2a')][_0xd9ff('0x2b')]);return _0x35679e(_0x2d4df1[_0xd9ff('0x2a')][_0xd9ff('0x2b')]);}else{logger[_0xd9ff('0x23')]('ChatInteraction,\x20%s,\x20%s',_0x4c5718,'request\x20sent');_0x35679e(_0x2d4df1[_0xd9ff('0x2c')]['message']);}})[_0xd9ff('0x2d')](function(_0x4d86fe){logger[_0xd9ff('0x2a')]('ChatInteraction,\x20%s,\x20%s',_0x4c5718,_0x4d86fe);_0xa30fd2(_0x4d86fe);});});}function respondWithStatusCode(_0x10cbdd,_0x159e56){_0x159e56=_0x159e56||0xcc;return function(_0x2138b4){if(_0x2138b4){return _0x10cbdd[_0xd9ff('0x2e')](_0x159e56);}return _0x10cbdd['status'](_0x159e56)[_0xd9ff('0x2f')]();};}function respondWithResult(_0xe11f88,_0x1c78c4){_0x1c78c4=_0x1c78c4||0xc8;return function(_0x4390f7){if(_0x4390f7){return _0xe11f88['status'](_0x1c78c4)[_0xd9ff('0x30')](_0x4390f7);}};}function respondWithFilteredResult(_0x3792d9,_0x44b5a7){return function(_0x45fb63){if(_0x45fb63){var _0x263d3a=typeof _0x44b5a7[_0xd9ff('0x31')]===_0xd9ff('0x32')&&typeof _0x44b5a7[_0xd9ff('0x33')]===_0xd9ff('0x32');var _0x5706cf=_0x45fb63[_0xd9ff('0x34')];var _0x4ba2be=_0x263d3a?0x0:_0x44b5a7[_0xd9ff('0x31')];var _0x29c532=_0x263d3a?_0x45fb63[_0xd9ff('0x34')]:_0x44b5a7['offset']+_0x44b5a7[_0xd9ff('0x33')];var _0x3b26da;if(_0x29c532>=_0x5706cf){_0x29c532=_0x5706cf;_0x3b26da=0xc8;}else{_0x3b26da=0xce;}_0x3792d9[_0xd9ff('0x35')](_0x3b26da);return _0x3792d9[_0xd9ff('0x36')]('Content-Range',_0x4ba2be+'-'+_0x29c532+'/'+_0x5706cf)[_0xd9ff('0x30')](_0x45fb63);}return null;};}function patchUpdates(_0x5743de){return function(_0x18c28b){try{jsonpatch[_0xd9ff('0x37')](_0x18c28b,_0x5743de,!![]);}catch(_0x323cb5){return BPromise[_0xd9ff('0x38')](_0x323cb5);}return _0x18c28b[_0xd9ff('0x39')]();};}function saveUpdates(_0xdf3947,_0x2cc2ae){return function(_0x281c7b){if(_0x281c7b){return _0x281c7b[_0xd9ff('0x3a')](_0xdf3947)[_0xd9ff('0x22')](function(_0x4813a5){return _0x4813a5;});}return null;};}function removeEntity(_0x34e9a9,_0x4670e4){return function(_0x66f4d){if(_0x66f4d){return _0x66f4d['destroy']()[_0xd9ff('0x22')](function(){_0x34e9a9[_0xd9ff('0x35')](0xcc)[_0xd9ff('0x2f')]();});}};}function handleEntityNotFound(_0x4ab10f,_0x3d449d){return function(_0x5e3ff9){if(!_0x5e3ff9){_0x4ab10f[_0xd9ff('0x2e')](0x194);}return _0x5e3ff9;};}function handleError(_0x4ae56b,_0x20a021){_0x20a021=_0x20a021||0x1f4;return function(_0x5db498){logger[_0xd9ff('0x2a')](_0x5db498[_0xd9ff('0x3b')]);if(_0x5db498[_0xd9ff('0x3c')]){delete _0x5db498['name'];}_0x4ae56b['status'](_0x20a021)['send'](_0x5db498);};}function getMustacheRender(_0x7ac3d1,_0x30fc5b){return Mustache[_0xd9ff('0x3d')](_0x7ac3d1,_[_0xd9ff('0x3e')](_0x30fc5b[_0xd9ff('0x3f')],{'contact':_0x30fc5b[_0xd9ff('0x40')],'message':_0x30fc5b['message'],'agent':_0x30fc5b['agent'],'interaction':_0x30fc5b['interaction'],'account':_0x30fc5b[_0xd9ff('0x41')]}))||'';}function getInteractionUsers(_0x252edc,_0x918c9a){return new BPromise(function(_0x32adae,_0x56b94d){try{if(_0x918c9a[_0x252edc['id']]){_0x252edc[_0xd9ff('0x42')]=_['map'](_0x918c9a[_0x252edc['id']],function(_0x3cff52){return{'id':_0x3cff52['id'],'fullname':_0x3cff52[_0xd9ff('0x43')]};});}}catch(_0x1bedaf){_0x56b94d(_0x1bedaf);}_0x32adae(_0x252edc);});}function getInteractionTags(_0x169dc7,_0x59fc07){return new BPromise(function(_0x1e34da,_0x2d4d97){try{if(_0x169dc7['TagIds']){_0x169dc7[_0xd9ff('0x44')]=[];_0x169dc7[_0xd9ff('0x45')][_0xd9ff('0x46')](',')[_0xd9ff('0x47')](function(_0x1fe44d){_0x169dc7[_0xd9ff('0x44')]['push'](_0x59fc07[_0x1fe44d]);});}delete _0x169dc7[_0xd9ff('0x45')];}catch(_0x116f28){_0x2d4d97(_0x116f28);}_0x1e34da(_0x169dc7);});}function updateChatInteraction(_0x10533a,_0x39fbbb,_0x472724){return new BPromise(function(_0x52aab8,_0x3178cd){return getInteractionUsers(_0x10533a,_0x472724)[_0xd9ff('0x22')](function(_0xe0bc49){return getInteractionTags(_0xe0bc49,_0x39fbbb);})['then'](function(_0x5d06dd){_0x52aab8(_0x5d06dd);})[_0xd9ff('0x2d')](function(_0x7eb1a){_0x3178cd(_0x7eb1a);});});}exports[_0xd9ff('0x48')]=function(_0x2dfb8f,_0x437561){var _0x30c69d={},_0x564ef4={},_0xd64585={'count':0x0,'rows':[]};var _0x2d3013=_['map'](db[_0xd9ff('0x49')][_0xd9ff('0x4a')],function(_0x13a1ec){return{'name':_0x13a1ec[_0xd9ff('0x4b')],'type':_0x13a1ec[_0xd9ff('0x4c')]['key']};});_0x564ef4['model']=_['map'](_0x2d3013,_0xd9ff('0x3c'));_0x564ef4['query']=_[_0xd9ff('0x4d')](_0x2dfb8f[_0xd9ff('0x4e')]);_0x564ef4[_0xd9ff('0x4f')]=_['intersection'](_0x564ef4[_0xd9ff('0x50')],_0x564ef4[_0xd9ff('0x4e')]);_0x30c69d['attributes']=_[_0xd9ff('0x51')](_0x564ef4[_0xd9ff('0x50')],qs[_0xd9ff('0x52')](_0x2dfb8f[_0xd9ff('0x4e')]['fields']));_0x30c69d[_0xd9ff('0x53')]=_0x30c69d['attributes'][_0xd9ff('0x54')]?_0x30c69d['attributes']:_0x564ef4[_0xd9ff('0x50')];if(!_0x2dfb8f[_0xd9ff('0x4e')][_0xd9ff('0x55')](_0xd9ff('0x56'))){_0x30c69d[_0xd9ff('0x33')]=qs['limit'](_0x2dfb8f[_0xd9ff('0x4e')][_0xd9ff('0x33')]);_0x30c69d[_0xd9ff('0x31')]=qs[_0xd9ff('0x31')](_0x2dfb8f['query']['offset']);}_0x30c69d['order']=qs[_0xd9ff('0x57')](_0x2dfb8f[_0xd9ff('0x4e')][_0xd9ff('0x57')]);_0x30c69d['where']=qs[_0xd9ff('0x4f')](_[_0xd9ff('0x58')](_0x2dfb8f[_0xd9ff('0x4e')],_0x564ef4[_0xd9ff('0x4f')]),_0x2d3013);var _0xfede73=[];var _0x40d391=squel[_0xd9ff('0x59')]()[_0xd9ff('0x5a')]('id')[_0xd9ff('0x5a')](_0xd9ff('0x3c'))[_0xd9ff('0x5a')](_0xd9ff('0x5b'))[_0xd9ff('0x5c')]('tools_tags');var _0x3ed112=squel['select']()[_0xd9ff('0x5a')]('u.id')[_0xd9ff('0x5a')]('u.fullname')[_0xd9ff('0x5a')]('ui.ChatInteractionId')[_0xd9ff('0x5c')]('user_has_chat_interactions','ui')[_0xd9ff('0x5d')]('users','u',_0xd9ff('0x5e'));var _0x5da1a8=squel[_0xd9ff('0x59')]()[_0xd9ff('0x5c')](_0xd9ff('0x5f'),'i')[_0xd9ff('0x5d')]('cm_contacts','c',_0xd9ff('0x60'))[_0xd9ff('0x5d')](_0xd9ff('0x61'),'o','o.id\x20=\x20i.UserId')[_0xd9ff('0x5d')](_0xd9ff('0x62'),'a',_0xd9ff('0x63'))[_0xd9ff('0x5d')](_0xd9ff('0x64'),'me','me.ChatInteractionId\x20=\x20i.id')[_0xd9ff('0x5d')](_0xd9ff('0x65'),'it',_0xd9ff('0x66'))[_0xd9ff('0x5d')](_0xd9ff('0x67'),'t',_0xd9ff('0x68'));var _0x458fd4=squel['expr']();var _0x3be850=[];var _0x11251f=squel['expr']();var _0x1c885f;if(_0x2dfb8f[_0xd9ff('0x4e')]['search']){_0x1c885f=as[_0xd9ff('0x69')](_0x2dfb8f[_0xd9ff('0x4e')][_0xd9ff('0x6a')]);var _0x54ea27=_0x1c885f['sqlOperator'];for(var _0x39473e=0x0;_0x39473e<_0x1c885f['conditions'][_0xd9ff('0x54')];_0x39473e++){var _0x1e4d0c=_0x1c885f[_0xd9ff('0x6b')][_0x39473e];var _0x102aea='i';var _0x53a230=_['find'](_0x2d3013,['name',_0x1e4d0c[_0xd9ff('0x5a')]]);if(!_0x53a230){switch(_0x1e4d0c[_0xd9ff('0x5a')]){case _0xd9ff('0x6c'):if(_0x1e4d0c[_0xd9ff('0x6d')]==0x1){_0x5da1a8[_0xd9ff('0x6e')]('`'+_0x1e4d0c['field']+_0xd9ff('0x6f'));}else{_0x5da1a8['having']('`'+_0x1e4d0c[_0xd9ff('0x5a')]+_0xd9ff('0x70'));}break;case _0xd9ff('0x71'):if(_0x1e4d0c[_0xd9ff('0x72')]===_0xd9ff('0x73')){if(_0x1e4d0c[_0xd9ff('0x6d')][_0xd9ff('0x46')]('\x20')[_0xd9ff('0x54')]>0x1){_0x458fd4[_0x54ea27]('MATCH\x20(c.firstName,\x20c.lastName,\x20c.phone,\x20c.mobile,\x20c.fax,\x20c.email)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)',qs[_0xd9ff('0x74')](_0x1e4d0c[_0xd9ff('0x6d')]),null);}else{var _0x4f5338='%'+_0x1e4d0c['value']+'%';_0x458fd4[_0x54ea27](_0xd9ff('0x75'),_0x4f5338,_0x4f5338,_0x4f5338);}}else{_0x53a230=_['find'](_0x2d3013,[_0xd9ff('0x3c'),_0xd9ff('0x76')]);_0x1e4d0c['field']=_0xd9ff('0x76');_0x58c9c2=as[_0xd9ff('0x77')](_0x102aea,_0x53a230[_0xd9ff('0x4c')],_0x1e4d0c);_0x458fd4[_0x54ea27](_0x58c9c2[_0xd9ff('0x78')],_0x58c9c2[_0xd9ff('0x6d')]['start'],_0x58c9c2[_0xd9ff('0x6d')]['end']);}break;case'Tag':var _0x3dabb1=_0x1e4d0c[_0xd9ff('0x6d')][_0xd9ff('0x46')](',')[_0xd9ff('0x79')](function(_0x56d822){return Number(_0x56d822);});_0x3dabb1[_0xd9ff('0x47')](function(_0x23b816){_0x11251f['or'](_0xd9ff('0x7a'),'%,'+_0x23b816+',%');});_0x3be850=_[_0xd9ff('0x7b')](_0x3be850,_0x3dabb1);break;case _0xd9ff('0x7c'):if(_0x1e4d0c[_0xd9ff('0x72')]===_0xd9ff('0x73')){_0x458fd4[_0x54ea27](_0xd9ff('0x7d'),'%'+_0x1e4d0c['value']+'%',null);}else{_0x53a230=_['find'](_0x2d3013,['name',_0xd9ff('0x7e')]);_0x1e4d0c[_0xd9ff('0x5a')]='UserId';_0x58c9c2=as[_0xd9ff('0x77')](_0x102aea,_0x53a230[_0xd9ff('0x4c')],_0x1e4d0c);_0x458fd4[_0x54ea27](_0x58c9c2[_0xd9ff('0x78')],_0x58c9c2[_0xd9ff('0x6d')][_0xd9ff('0x7f')],_0x58c9c2[_0xd9ff('0x6d')][_0xd9ff('0x2f')]);}break;case _0xd9ff('0x3f'):_0x58c9c2=as['buildExpression']('me',null,_0x1e4d0c);_0x458fd4[_0x54ea27](_0x58c9c2[_0xd9ff('0x78')],_0x58c9c2[_0xd9ff('0x6d')][_0xd9ff('0x7f')],_0x58c9c2['value'][_0xd9ff('0x2f')]);break;}}else{var _0x58c9c2=as[_0xd9ff('0x77')](_0x102aea,_0x53a230[_0xd9ff('0x4c')],_0x1e4d0c);_0x458fd4[_0x54ea27](_0x58c9c2[_0xd9ff('0x78')],_0x58c9c2['value'][_0xd9ff('0x7f')],_0x58c9c2[_0xd9ff('0x6d')][_0xd9ff('0x2f')]);}}}else{var _0x1cd620=_(_0x2dfb8f['query'])[_0xd9ff('0x4d')]()[_0xd9ff('0x79')](function(_0x1de5c9){return _['some'](_0x2d3013,[_0xd9ff('0x3c'),_0x1de5c9])?_0x1de5c9:undefined;})[_0xd9ff('0x80')]()[_0xd9ff('0x6d')]();if(!_['isEmpty'](_0x1cd620)){_0x1cd620[_0xd9ff('0x47')](function(_0x35926f){if(_0x35926f===_0xd9ff('0x81')){_0x5da1a8[_0xd9ff('0x82')](_0xd9ff('0x83'),[]['concat'](_0x2dfb8f[_0xd9ff('0x4e')][_0x35926f]));}else if(_0x35926f===_0xd9ff('0x84')){var _0x59af0a=JSON[_0xd9ff('0x85')](_0x2dfb8f[_0xd9ff('0x4e')][_0x35926f])[_0xd9ff('0x86')];var _0x5d1973=JSON[_0xd9ff('0x85')](_0x2dfb8f['query'][_0x35926f])[_0xd9ff('0x87')];_0x5da1a8['where'](_0xd9ff('0x88'),_0x59af0a,_0x5d1973);}else{if(_0x2dfb8f[_0xd9ff('0x4e')][_0x35926f]===_0xd9ff('0x89')){_0x5da1a8[_0xd9ff('0x82')]('i.'+_0x35926f+_0xd9ff('0x8a'));}else{_0x5da1a8[_0xd9ff('0x82')]('i.'+_0x35926f+_0xd9ff('0x8b'),_0x2dfb8f[_0xd9ff('0x4e')][_0x35926f]);}}});}if(_0x2dfb8f[_0xd9ff('0x4e')][_0xd9ff('0x8c')]){if(_0x2dfb8f['query'][_0xd9ff('0x8c')]==0x1){_0x5da1a8[_0xd9ff('0x6e')](_0xd9ff('0x8d'));}else{_0x5da1a8[_0xd9ff('0x6e')](_0xd9ff('0x8e'));}}if(_0x2dfb8f[_0xd9ff('0x4e')]['tag']){_0x3be850=_['isArray'](_0x2dfb8f[_0xd9ff('0x4e')][_0xd9ff('0x8f')])?_0x2dfb8f[_0xd9ff('0x4e')][_0xd9ff('0x8f')]:new Array(_0x2dfb8f[_0xd9ff('0x4e')][_0xd9ff('0x8f')]);_0x3be850['forEach'](function(_0x1d34a1){_0x11251f['or'](_0xd9ff('0x7a'),'%,'+_0x1d34a1+',%');});}if(_0x2dfb8f[_0xd9ff('0x4e')][_0xd9ff('0x90')]){var _0x14c89f=_0x2dfb8f[_0xd9ff('0x4e')]['filter'][_0xd9ff('0x91')]('\x5c','\x5c\x5c')[_0xd9ff('0x91')](/'/g,'\x27\x27');if(qs[_0xd9ff('0x92')](_0x14c89f)){_0x458fd4['or'](_0xd9ff('0x93'),_0x14c89f+'%');}else{_0x458fd4['or'](_0xd9ff('0x94'),qs[_0xd9ff('0x74')](_0x14c89f))['or'](_0xd9ff('0x95'),_0x14c89f+'%');}}}_0x5da1a8[_0xd9ff('0x82')](_0x458fd4);_0x5da1a8['group'](_0xd9ff('0x96'));var _0x4c2ad5={'type':db[_0xd9ff('0x97')][_0xd9ff('0x98')][_0xd9ff('0x99')],'raw':!![]};var _0x2d2d1c=_0x5da1a8[_0xd9ff('0x9a')]();_0x2d2d1c[_0xd9ff('0x5a')](_0xd9ff('0x96'));_0x2d2d1c[_0xd9ff('0x5a')](_0xd9ff('0x9b'),_0xd9ff('0x6c'));if(_0x30c69d[_0xd9ff('0x9c')]){_0x30c69d[_0xd9ff('0x9c')][_0xd9ff('0x47')](function(_0x5d29b9){var _0x4413c4=_0x5d29b9[0x0]===_0xd9ff('0x9d')?_0x5d29b9[0x0]:'i.'+_0x5d29b9[0x0];_0x5da1a8[_0xd9ff('0x9c')](_0x4413c4,_0x5d29b9[0x1]===_0xd9ff('0x9e')?![]:!![]);});}if(!_['isEmpty'](_0x3be850)){_0x5da1a8[_0xd9ff('0x6e')](_0x11251f);_0x2d2d1c[_0xd9ff('0x82')]('t.id\x20IN\x20?',_0x3be850);}BPromise[_0xd9ff('0x9f')]()[_0xd9ff('0x22')](function(){if(!_0x1c885f){if(_0x2dfb8f[_0xd9ff('0x4e')][_0xd9ff('0x81')])return;_0x2d2d1c[_0xd9ff('0x82')](_0xd9ff('0xa0'));_0x5da1a8[_0xd9ff('0x82')]('i.ChatWebsiteId\x20IS\x20NOT\x20NULL');return;}if(_0x2dfb8f[_0xd9ff('0xa1')]['role']!==_0xd9ff('0xa2'))return;return _0x2dfb8f[_0xd9ff('0xa1')][_0xd9ff('0xa3')]({'attributes':['id'],'raw':!![]})[_0xd9ff('0x22')](function(_0x320adb){if(_[_0xd9ff('0xa4')](_0x320adb)){_0x2d2d1c[_0xd9ff('0x82')](_0xd9ff('0xa5'));_0x5da1a8[_0xd9ff('0x82')](_0xd9ff('0xa5'));}else{_0x2d2d1c[_0xd9ff('0x82')]('i.ChatWebsiteId\x20IN\x20?',_[_0xd9ff('0x79')](_0x320adb,'id'));_0x5da1a8[_0xd9ff('0x82')]('i.ChatWebsiteId\x20IN\x20?',_[_0xd9ff('0x79')](_0x320adb,'id'));}});})[_0xd9ff('0x22')](function(){if(_0x2dfb8f[_0xd9ff('0xa1')][_0xd9ff('0xa6')]===_0xd9ff('0xa2')&&!_0x1c885f&&!_0x2dfb8f[_0xd9ff('0x4e')]['ChatWebsiteId'])return[];return db['sequelize'][_0xd9ff('0x4e')](_0x2d2d1c['toString'](),_0x4c2ad5);})['then'](function(_0x4a55c1){_0xd64585['count']=_0x4a55c1[_0xd9ff('0x54')];if(_0xd64585[_0xd9ff('0x34')]===0x0)return[];return db[_0xd9ff('0xa7')]['query'](_0x40d391['toString'](),_0x4c2ad5)[_0xd9ff('0x22')](function(_0x5e7f52){_0xfede73=_[_0xd9ff('0xa8')](_0x5e7f52,'id');_0x4c2ad5=_['merge'](_0x4c2ad5,{'model':db[_0xd9ff('0x49')],'mapToModel':!![],'raw':!![],'nest':!![]});if(_0x2dfb8f[_0xd9ff('0x4e')][_0xd9ff('0x52')]){_0x30c69d[_0xd9ff('0x53')][_0xd9ff('0x47')](function(_0x4e6dd2){_0x5da1a8['field']('i.'+_0x4e6dd2);});}else{_0x5da1a8[_0xd9ff('0x5a')](_0xd9ff('0x9b'),_0xd9ff('0x6c'));_0x5da1a8[_0xd9ff('0x5a')](_0xd9ff('0xa9'),'Account.key');_0x5da1a8[_0xd9ff('0x5a')](_0xd9ff('0xaa'),_0xd9ff('0xab'));_0x5da1a8[_0xd9ff('0x5a')](_0xd9ff('0xac'),_0xd9ff('0x9d'));_0x5da1a8[_0xd9ff('0x5a')](_0xd9ff('0xad'));_0x5da1a8[_0xd9ff('0x5a')](_0xd9ff('0xae'),_0xd9ff('0xaf'));_0x5da1a8[_0xd9ff('0x5a')](_0xd9ff('0xb0'),'Contact.lastName');_0x5da1a8[_0xd9ff('0x5a')](_0xd9ff('0xb1'),'Contact.email');_0x5da1a8['field'](_0xd9ff('0xb2'),_0xd9ff('0xb3'));_0x5da1a8['field'](_0xd9ff('0xb4'),_0xd9ff('0xb5'));_0x5da1a8[_0xd9ff('0x5a')](_0xd9ff('0xb6'),_0xd9ff('0xb7'));_0x5da1a8[_0xd9ff('0x5a')](_0xd9ff('0xb8'),_0xd9ff('0xb9'));_0x5da1a8['field']('o.internal','Owner.internal');_0x5da1a8[_0xd9ff('0x5a')](_0xd9ff('0xba'),_0xd9ff('0x45'));}if(_0x30c69d['limit'])_0x5da1a8[_0xd9ff('0x33')](_0x30c69d[_0xd9ff('0x33')]);if(_0x30c69d[_0xd9ff('0x31')])_0x5da1a8[_0xd9ff('0x31')](_0x30c69d[_0xd9ff('0x31')]);return db[_0xd9ff('0xa7')]['query'](_0x5da1a8[_0xd9ff('0xbb')](),_0x4c2ad5);})['then'](function(_0x5cb3af){if(_0x5cb3af[_0xd9ff('0x54')]>0x0)_0x3ed112[_0xd9ff('0x82')](_0xd9ff('0xbc'),_['map'](_0x5cb3af,'id'));return db[_0xd9ff('0xa7')][_0xd9ff('0x4e')](_0x3ed112['toString'](),_0x4c2ad5)['then'](function(_0x4aa6d5){var _0x11840a=_[_0xd9ff('0xbd')](_0x4aa6d5,'ChatInteractionId');var _0x2871ec=[];_0x5cb3af[_0xd9ff('0x47')](function(_0x16e130){_0x2871ec['push'](updateChatInteraction(_0x16e130,_0xfede73,_0x11840a));});return BPromise['all'](_0x2871ec);});});})['then'](function(_0xdf2e33){_0xd64585['rows']=_0xdf2e33;return _0xd64585;})[_0xd9ff('0x22')](respondWithFilteredResult(_0x437561,_0x30c69d))[_0xd9ff('0x2d')](handleError(_0x437561,null));};exports['show']=function(_0x1b048b,_0x5eeeaf){var _0x3339e5={'raw':![],'where':{'id':_0x1b048b[_0xd9ff('0xbe')]['id']}},_0x1f7d87={};_0x1f7d87['model']=_[_0xd9ff('0x4d')](db['ChatInteraction']['rawAttributes']);_0x1f7d87['query']=_[_0xd9ff('0x4d')](_0x1b048b[_0xd9ff('0x4e')]);_0x1f7d87[_0xd9ff('0x4f')]=_[_0xd9ff('0x51')](_0x1f7d87['model'],_0x1f7d87['query']);_0x3339e5[_0xd9ff('0x53')]=_[_0xd9ff('0x51')](_0x1f7d87[_0xd9ff('0x50')],qs[_0xd9ff('0x52')](_0x1b048b[_0xd9ff('0x4e')]['fields']));_0x3339e5['attributes']=_0x3339e5[_0xd9ff('0x53')][_0xd9ff('0x54')]?_0x3339e5[_0xd9ff('0x53')]:_0x1f7d87[_0xd9ff('0x50')];if(_0x1b048b[_0xd9ff('0x4e')][_0xd9ff('0xbf')]){_0x3339e5['include']=[{'all':!![]}];}_0x3339e5=_[_0xd9ff('0x3e')]({},_0x3339e5,_0x1b048b['options']);return db['ChatInteraction'][_0xd9ff('0xc0')](_0x3339e5)[_0xd9ff('0x22')](handleEntityNotFound(_0x5eeeaf,null))[_0xd9ff('0x22')](respondWithResult(_0x5eeeaf,null))[_0xd9ff('0x2d')](handleError(_0x5eeeaf,null));};exports['create']=function(_0x4e3fdd,_0x2cf8da){return db['ChatInteraction']['create'](_0x4e3fdd[_0xd9ff('0x3f')],{})['then'](respondWithResult(_0x2cf8da,0xc9))[_0xd9ff('0x2d')](handleError(_0x2cf8da,null));};exports['update']=function(_0x327cd8,_0xd95329){if(_0x327cd8[_0xd9ff('0x3f')]['id']){delete _0x327cd8[_0xd9ff('0x3f')]['id'];}return db[_0xd9ff('0x49')][_0xd9ff('0xc0')]({'where':{'id':_0x327cd8[_0xd9ff('0xbe')]['id']}})['then'](handleEntityNotFound(_0xd95329,null))[_0xd9ff('0x22')](saveUpdates(_0x327cd8['body'],null))['then'](respondWithResult(_0xd95329,null))[_0xd9ff('0x2d')](handleError(_0xd95329,null));};exports[_0xd9ff('0xc1')]=function(_0x499869,_0x3c86ac){return db['ChatInteraction']['find']({'where':{'id':_0x499869[_0xd9ff('0xbe')]['id']}})[_0xd9ff('0x22')](handleEntityNotFound(_0x3c86ac,null))[_0xd9ff('0x22')](removeEntity(_0x3c86ac,null))[_0xd9ff('0x2d')](handleError(_0x3c86ac,null));};exports[_0xd9ff('0xc2')]=function(_0x11c84f,_0x2d0261){return db[_0xd9ff('0x49')][_0xd9ff('0xc2')]()[_0xd9ff('0x22')](respondWithResult(_0x2d0261,null))[_0xd9ff('0x2d')](handleError(_0x2d0261,null));};exports[_0xd9ff('0xc3')]=function(_0x73cfcf,_0x538f20){var _0x51feff=_0x73cfcf['params']['id'];var _0x30c62c;var _0x50b6b2;var _0x413aef;return db[_0xd9ff('0x49')][_0xd9ff('0xc4')]({'where':{'id':_0x51feff}})[_0xd9ff('0x22')](function(_0x54c390){_0x30c62c=_0x54c390;return db[_0xd9ff('0xc5')]['findOne']({'where':{'id':_0x54c390[_0xd9ff('0x81')]},'attributes':['id','vidaooApiKey','vidaooEscalation','vidaooTopic',_0xd9ff('0xc6'),'vidaooMetadata'],'raw':!![]});})[_0xd9ff('0x22')](function(_0x54524c){if(_0x54524c&&_0x54524c[_0xd9ff('0xc7')]&&_0x54524c[_0xd9ff('0xc8')]){_0x50b6b2=_0x54524c;var _0x696e18={'interaction':{'id':_0x51feff},'agent':{'id':_0x73cfcf[_0xd9ff('0xa1')]['id'],'name':_0x73cfcf[_0xd9ff('0xa1')][_0xd9ff('0x3c')],'fullname':_0x73cfcf['user']['fullname'],'email':_0x73cfcf[_0xd9ff('0xa1')][_0xd9ff('0xc9')]},'contact':_0x73cfcf[_0xd9ff('0x3f')][_0xd9ff('0x40')],'account':_0x73cfcf[_0xd9ff('0x3f')]['account']};var _0x432854={'rejectUnauthorized':![],'method':_0xd9ff('0xca'),'url':_0xd9ff('0xcb'),'headers':{'X-APIKEY':_0x54524c[_0xd9ff('0xc7')]},'body':{'duration':null,'scheduledAt':null,'participants':[_0x73cfcf[_0xd9ff('0xa1')][_0xd9ff('0xc9')]],'buttons':null,'topic':_0x50b6b2['vidaooTopic'],'note':_[_0xd9ff('0xcc')](_0x50b6b2[_0xd9ff('0xc6')])?null:getMustacheRender(_0x50b6b2[_0xd9ff('0xc6')],_0x696e18),'metadata':null},'redirect':_0xd9ff('0xcd'),'json':!![]};try{if(!_[_0xd9ff('0xcc')](_0x50b6b2[_0xd9ff('0xce')])){var _0x1c8e55=getMustacheRender(_0x50b6b2[_0xd9ff('0xce')],_0x696e18);var _0x29fdb8=JSON[_0xd9ff('0x85')](_0x1c8e55);_0x432854[_0xd9ff('0x3f')][_0xd9ff('0xcf')]=_0x29fdb8;}}catch(_0xfc755a){throw new db[(_0xd9ff('0x97'))][(_0xd9ff('0xd0'))](_0xd9ff('0xd1'));}return rp(_0x432854);}else{throw new db[(_0xd9ff('0x97'))][(_0xd9ff('0xd0'))]('Error\x20in\x20Vidaoo\x20configuration');}})[_0xd9ff('0x22')](function(_0x282183){_0x413aef=_0x282183;if(_0x413aef['id']){var _0x3aba00={'body':_0x413aef[_0xd9ff('0xd2')],'ChatWebsiteId':_0x50b6b2['id'],'ChatInteractionId':_0x30c62c['id'],'direction':_0xd9ff('0xd3'),'UserId':_0x73cfcf[_0xd9ff('0xa1')]['id']};return db[_0xd9ff('0xd4')][_0xd9ff('0xd5')](_0x3aba00,{});}else{throw new db['Sequelize'][(_0xd9ff('0xd0'))]('Unable\x20to\x20create\x20Vidaoo\x20session');}})[_0xd9ff('0x22')](function(){return _0x30c62c[_0xd9ff('0xd6')]({'vidaooSessionId':_0x413aef['id']});})[_0xd9ff('0x22')](respondWithResult(_0x538f20,null))[_0xd9ff('0x2d')](handleError(_0x538f20,null));};exports[_0xd9ff('0xd7')]=function(_0x204127,_0xf98666){if(_0x204127['body']['id']){delete _0x204127[_0xd9ff('0x3f')]['id'];}return db[_0xd9ff('0x49')][_0xd9ff('0xc0')]({'where':{'id':_0x204127[_0xd9ff('0xbe')]['id']},'include':[{'model':db['CmContact'],'as':_0xd9ff('0x71')}]})[_0xd9ff('0x22')](handleEntityNotFound(_0xf98666,null))['then'](saveUpdates(_0x204127[_0xd9ff('0x3f')],null))[_0xd9ff('0x22')](respondWithResult(_0xf98666,null))['catch'](handleError(_0xf98666,null));};exports['abandon']=function(_0x5c4138,_0x560ea2,_0x1e6d5a){if(_0x5c4138[_0xd9ff('0x3f')]['id']){delete _0x5c4138[_0xd9ff('0x3f')]['id'];}return db['ChatInteraction']['find']({'where':{'id':_0x5c4138[_0xd9ff('0xbe')]['id']}})['then'](function(_0x43a941){if(!_0x43a941){logger[_0xd9ff('0x2a')](_0xd9ff('0xd8'),'abandon',0x194,'entity\x20not\x20found');_0x560ea2['sendStatus'](0x194);}else{if(_0x43a941[_0xd9ff('0x7e')]){throw new db[(_0xd9ff('0x97'))]['ValidationError'](_0xd9ff('0xd9'));}}return _0x43a941;})[_0xd9ff('0x22')](function(_0x7efe12){if(_0x7efe12){return _0x7efe12[_0xd9ff('0x3a')]({'closed':_0x5c4138[_0xd9ff('0x3f')][_0xd9ff('0xda')],'disposition':_0x5c4138[_0xd9ff('0x3f')][_0xd9ff('0xdb')]})[_0xd9ff('0x22')](function(_0x3b7aeb){return _0x3b7aeb;});}})[_0xd9ff('0x22')](function(_0x37eb49){return respondWithRpcPromise(_0xd9ff('0xdc'),_0xd9ff('0xdd'),_0x5c4138[_0xd9ff('0x3f')],client9004);})[_0xd9ff('0x22')](respondWithResult(_0x560ea2,null))[_0xd9ff('0x2d')](handleError(_0x560ea2,null));};exports[_0xd9ff('0xde')]=function(_0x3b05c4,_0x32c04e,_0x1bcf8f){_0x3b05c4[_0xd9ff('0x3f')][_0xd9ff('0x3c')]=_0x3b05c4[_0xd9ff('0xdf')][_0xd9ff('0xe0')];_0x3b05c4[_0xd9ff('0x3f')][_0xd9ff('0xe1')]=_0x3b05c4[_0xd9ff('0xdf')][_0xd9ff('0xe2')];_0x3b05c4['body'][_0xd9ff('0x4c')]=_0x3b05c4[_0xd9ff('0xdf')]['mimetype'];return db[_0xd9ff('0xe3')][_0xd9ff('0xd5')](_0x3b05c4[_0xd9ff('0x3f')])[_0xd9ff('0x22')](respondWithResult(_0x32c04e,0xc9))[_0xd9ff('0x2d')](handleError(_0x32c04e,null));};exports[_0xd9ff('0xe4')]=function(_0x5978ad,_0x4ddfe7,_0x30c520){return db['ChatInteraction']['findOne']({'where':{'id':_0x5978ad[_0xd9ff('0xbe')]['id']},'raw':!![]})[_0xd9ff('0x22')](handleEntityNotFound(_0x4ddfe7,null))['then'](function(_0x327362){if(_0x327362){if(_0x327362[_0xd9ff('0xda')]){return _0x4ddfe7[_0xd9ff('0x35')](0x193)[_0xd9ff('0x30')]({'status':0x193,'message':'Unauthorized'});}return db[_0xd9ff('0xe3')][_0xd9ff('0xc4')]({'where':{'id':_0x5978ad['query'][_0xd9ff('0xe5')]},'raw':!![]})[_0xd9ff('0x22')](handleEntityNotFound(_0x4ddfe7,null));}})['then'](function(_0x62f1f3){if(_0x62f1f3){var _0xd188cf=_0x62f1f3[_0xd9ff('0xe6')]!==null;var _0x5b2e9c=path[_0xd9ff('0xe7')](config[_0xd9ff('0xe8')],_0xd9ff('0xe9'));if(_0xd188cf){_0x5b2e9c=path['join'](_0x5b2e9c,_0xd9ff('0xea'));}var _0x53a25a=path[_0xd9ff('0xe7')](_0x5b2e9c,_0x62f1f3[_0xd9ff('0xe1')]);return _0x4ddfe7[_0xd9ff('0xeb')](_0x53a25a);}})[_0xd9ff('0x2d')](handleError(_0x4ddfe7,null));};exports[_0xd9ff('0xec')]=function(_0x10397d,_0x51039f){var _0x37ea50=null;var _0x3cf2ef=null;var _0x171195=null;var _0x24c066=null;if(_0x10397d[_0xd9ff('0x3f')]['id']){delete _0x10397d['body']['id'];}if(_0x10397d[_0xd9ff('0x3f')][_0xd9ff('0xed')]){_0x24c066=path['join'](config[_0xd9ff('0xe8')],_0xd9ff('0xee'),util[_0xd9ff('0xef')](_0xd9ff('0xf0'),Date[_0xd9ff('0xf1')]()));_0x10397d[_0xd9ff('0x3f')][_0xd9ff('0xf2')]=_0x24c066;}return db[_0xd9ff('0x49')][_0xd9ff('0xc0')]({'where':{'id':_0x10397d[_0xd9ff('0xbe')]['id']},'include':[{'model':db[_0xd9ff('0xd4')],'as':_0xd9ff('0xf3'),'include':[{'model':db[_0xd9ff('0x7c')],'as':_0xd9ff('0x7c')}]}]})[_0xd9ff('0x22')](handleEntityNotFound(_0x51039f,null))[_0xd9ff('0x22')](saveUpdates(_0x10397d['body'],null))['then'](function(_0x497e36){if(_0x497e36){_0x37ea50=_0x497e36;return db[_0xd9ff('0xc5')]['find']({'where':{'id':_0x37ea50[_0xd9ff('0x81')]}});}})['then'](function(_0x4d4cc0){if(_0x4d4cc0){_0x171195=_0x4d4cc0;return db['CmContact'][_0xd9ff('0xc0')]({'where':{'id':_0x37ea50['ContactId']}});}})['then'](function(_0x474b4c){if(_0x474b4c){_0x3cf2ef=_0x474b4c;if(_0x24c066){var _0x144cf7=null;for(var _0x9eac7f=0x1;_0x9eac7f<_0x37ea50[_0xd9ff('0xf3')][_0xd9ff('0x54')];++_0x9eac7f){_0x144cf7=_0x37ea50[_0xd9ff('0xf3')][_0x9eac7f];var _0x2450da=_0x144cf7[_0xd9ff('0x7e')]?util[_0xd9ff('0xef')](_0xd9ff('0xf4'),_0x171195[_0xd9ff('0xf5')],_0x144cf7[_0xd9ff('0x7e')]):_0xd9ff('0xf6');var _0x4531bc=_0x10397d['body']['customer']||util[_0xd9ff('0xef')](_0xd9ff('0xf4'),_0xd9ff('0xf7'),_0x144cf7[_0xd9ff('0x76')]);switch(_0x171195[_0xd9ff('0xf8')]){case _0xd9ff('0xf9'):_0x2450da=_0x144cf7[_0xd9ff('0x7e')]?util[_0xd9ff('0xef')]('%s%d',_0x171195[_0xd9ff('0xf5')],_0x144cf7[_0xd9ff('0x7e')]):_0xd9ff('0xf6');break;case _0xd9ff('0xfa'):_0x2450da=_0x144cf7['UserId']?_0x144cf7['User'][_0xd9ff('0xfb')]||_0x144cf7[_0xd9ff('0x7c')]['fullname']:_0xd9ff('0xf6');break;case _0xd9ff('0xfc'):_0x2450da=_0x144cf7['UserId']?_0x144cf7[_0xd9ff('0x7c')][_0xd9ff('0x43')]:_0xd9ff('0xf6');break;default:_0x2450da=_0x144cf7[_0xd9ff('0x7e')]?util[_0xd9ff('0xef')](_0xd9ff('0xf4'),_0x171195[_0xd9ff('0xf5')],_0x144cf7['UserId']):_0xd9ff('0xf6');}var _0x62b518=util[_0xd9ff('0xef')](_0xd9ff('0xfd'),moment(_0x144cf7[_0xd9ff('0x84')])['format'](_0xd9ff('0xfe')),_0x144cf7[_0xd9ff('0xff')]==='in'?_0x4531bc:_0x2450da,_0x144cf7[_0xd9ff('0x3f')]);if(!_0x144cf7['secret']){fs[_0xd9ff('0x100')](_0x24c066,_0x62b518);}}return db[_0xd9ff('0x101')][_0xd9ff('0xc4')]({'where':{'service':!![]},'include':[{'model':db['MailServerOut'],'as':_0xd9ff('0x102'),'raw':!![]}]});}}})['then'](function(_0x5e07ae){if(_0x5e07ae&&_0x5e07ae['Smtp']&&_0x10397d['body']){var _0x578f41={'tls':{'rejectUnauthorized':![]}};if(_0x5e07ae[_0xd9ff('0x102')][_0xd9ff('0x103')]){_0x578f41['service']=_0x5e07ae[_0xd9ff('0x102')][_0xd9ff('0x103')];}else{_0x578f41[_0xd9ff('0x104')]=_0x5e07ae['Smtp'][_0xd9ff('0x104')];_0x578f41['port']=_0x5e07ae['Smtp'][_0xd9ff('0x105')];_0x578f41[_0xd9ff('0x106')]=_0x5e07ae[_0xd9ff('0x102')]['secure'];}if(_0x5e07ae['Smtp'][_0xd9ff('0x107')]){_0x578f41[_0xd9ff('0x108')]={'user':_0x5e07ae['Smtp'][_0xd9ff('0xa1')],'pass':_0x5e07ae[_0xd9ff('0x102')][_0xd9ff('0x109')]};}return respondWithRpcPromise(_0xd9ff('0x10a'),_0xd9ff('0x10b'),{'account':_0x578f41,'message':{'from':util[_0xd9ff('0xef')](_0xd9ff('0x10c'),_0x5e07ae['name'],_0x5e07ae[_0xd9ff('0xc9')]||_0x5e07ae[_0xd9ff('0x102')]['user']),'to':_0x10397d[_0xd9ff('0x3f')][_0xd9ff('0xed')],'subject':'Mail\x20Transcript','text':util[_0xd9ff('0xef')]('Hi\x20%s,\x20attached\x20you\x20can\x20find\x20your\x20transcript\x20file.\x20\x0a\x0aRegards.\x20\x0a\x0a',_0x10397d[_0xd9ff('0x3f')][_0xd9ff('0xed')]),'attachments':[{'path':_0x24c066}]}})['then'](function(){return _0x37ea50;})[_0xd9ff('0x2d')](function(_0x4d6172){console[_0xd9ff('0x2a')](_0x4d6172);});}else{return _0x37ea50;}})[_0xd9ff('0x22')](respondWithStatusCode(_0x51039f,0xc8))[_0xd9ff('0x2d')](handleError(_0x51039f,null));};exports[_0xd9ff('0x10d')]=function(_0x6a2524,_0x356583,_0x5c1165){return db['ChatMessage'][_0xd9ff('0xc0')]({'where':{'id':_0x6a2524['params']['id']}})[_0xd9ff('0x22')](handleEntityNotFound(_0x356583,null))[_0xd9ff('0x22')](function(_0x599273){if(_0x599273){return _0x599273['addMessage'](_0x6a2524['body'][_0xd9ff('0x10e')],_[_0xd9ff('0x10f')](_0x6a2524[_0xd9ff('0x3f')],['ids','id'])||{});}})[_0xd9ff('0x22')](respondWithResult(_0x356583,null))[_0xd9ff('0x2d')](handleError(_0x356583,null));};exports[_0xd9ff('0x110')]=function(_0x2832b7,_0x618c47,_0x109140){var _0x278670={'raw':![],'where':{}};var _0x5e064d={};var _0x231b46={'count':0x0,'rows':[]};return db[_0xd9ff('0x49')][_0xd9ff('0xc4')]({'where':{'id':_0x2832b7[_0xd9ff('0xbe')]['id']}})[_0xd9ff('0x22')](handleEntityNotFound(_0x618c47,null))[_0xd9ff('0x22')](function(_0x1802b1){if(_0x1802b1){_0x5e064d[_0xd9ff('0x50')]=_[_0xd9ff('0x4d')](db[_0xd9ff('0xd4')][_0xd9ff('0x4a')]);_0x5e064d['query']=_['keys'](_0x2832b7[_0xd9ff('0x4e')]);_0x5e064d['filters']=_['intersection'](_0x5e064d[_0xd9ff('0x50')],_0x5e064d[_0xd9ff('0x4e')]);_0x278670[_0xd9ff('0x53')]=_[_0xd9ff('0x51')](_0x5e064d[_0xd9ff('0x50')],qs['fields'](_0x2832b7[_0xd9ff('0x4e')]['fields']));_0x278670[_0xd9ff('0x53')]=_0x278670[_0xd9ff('0x53')]['length']?_0x278670[_0xd9ff('0x53')]:_0x5e064d[_0xd9ff('0x50')];if(!_0x2832b7[_0xd9ff('0x4e')][_0xd9ff('0x55')](_0xd9ff('0x56'))){_0x278670[_0xd9ff('0x33')]=qs[_0xd9ff('0x33')](_0x2832b7['query'][_0xd9ff('0x33')]);_0x278670[_0xd9ff('0x31')]=qs[_0xd9ff('0x31')](_0x2832b7[_0xd9ff('0x4e')][_0xd9ff('0x31')]);}_0x278670[_0xd9ff('0x9c')]=qs['sort'](_0x2832b7[_0xd9ff('0x4e')][_0xd9ff('0x57')]);_0x278670[_0xd9ff('0x82')]=qs['filters'](_[_0xd9ff('0x58')](_0x2832b7['query'],_0x5e064d[_0xd9ff('0x4f')]));_0x278670['where'][_0xd9ff('0x111')]=_0x1802b1['id'];if(_0x2832b7[_0xd9ff('0x4e')][_0xd9ff('0x90')]){_0x278670['where']=_[_0xd9ff('0x3e')](_0x278670['where'],{'$or':_[_0xd9ff('0x79')](_0x278670[_0xd9ff('0x53')],function(_0x2b2a50){var _0x34f3f0={};_0x34f3f0[_0x2b2a50]={'$like':'%'+_0x2832b7[_0xd9ff('0x4e')]['filter']+'%'};return _0x34f3f0;})});}if(_0x2832b7[_0xd9ff('0x4e')][_0xd9ff('0x86')]){var _0x955328=_0x2832b7[_0xd9ff('0x4e')][_0xd9ff('0x86')][_0xd9ff('0x46')](',');var _0x5d95b1={};_0x5d95b1[_0x955328[0x0]]={'$gte':moment(_0x955328[0x1])['format'](_0xd9ff('0x112'))};_0x278670[_0xd9ff('0x82')]=_[_0xd9ff('0x3e')](_0x278670[_0xd9ff('0x82')],_0x5d95b1);}_0x278670=_[_0xd9ff('0x3e')]({},_0x278670,_0x2832b7[_0xd9ff('0x113')]);return db[_0xd9ff('0xd4')]['count']({'where':_0x278670[_0xd9ff('0x82')]})[_0xd9ff('0x22')](function(_0x3e90fe){_0x231b46[_0xd9ff('0x34')]=_0x3e90fe;if(_0x2832b7[_0xd9ff('0x4e')][_0xd9ff('0xbf')]){_0x278670['include']=[{'all':!![]}];}return db[_0xd9ff('0xd4')][_0xd9ff('0x114')](_0x278670);})[_0xd9ff('0x22')](function(_0x33f933){_0x231b46[_0xd9ff('0x115')]=_0x33f933;return _0x231b46;});}})[_0xd9ff('0x22')](respondWithFilteredResult(_0x618c47,_0x278670))['catch'](handleError(_0x618c47,null));};exports['getMyMessages']=function(_0xf3a93b,_0x473ecf,_0x1213a4){var _0x6f731a={'where':{}},_0x193c57={},_0x4572b2={'count':0x0,'rows':[]};return db[_0xd9ff('0x49')][_0xd9ff('0xc4')]({'where':{'id':_0xf3a93b['params']['id']}})[_0xd9ff('0x22')](handleEntityNotFound(_0x473ecf,null))[_0xd9ff('0x22')](function(_0x4115a3){if(_0x4115a3){_0x193c57[_0xd9ff('0x50')]=_[_0xd9ff('0x4d')](db[_0xd9ff('0xd4')]['rawAttributes']);_0x193c57[_0xd9ff('0x4e')]=_['keys'](_0xf3a93b['query']);_0x193c57[_0xd9ff('0x4f')]=_[_0xd9ff('0x51')](_0x193c57[_0xd9ff('0x50')],_0x193c57[_0xd9ff('0x4e')]);_0x6f731a[_0xd9ff('0x53')]=_[_0xd9ff('0x51')](_0x193c57[_0xd9ff('0x50')],qs[_0xd9ff('0x52')](_0xf3a93b['query'][_0xd9ff('0x52')]));_0x6f731a['attributes']=_0x6f731a[_0xd9ff('0x53')][_0xd9ff('0x54')]?_0x6f731a[_0xd9ff('0x53')]:_0x193c57[_0xd9ff('0x50')];if(!_0xf3a93b['query'][_0xd9ff('0x55')](_0xd9ff('0x56'))){_0x6f731a[_0xd9ff('0x33')]=qs[_0xd9ff('0x33')](_0xf3a93b[_0xd9ff('0x4e')][_0xd9ff('0x33')]);_0x6f731a[_0xd9ff('0x31')]=qs[_0xd9ff('0x31')](_0xf3a93b[_0xd9ff('0x4e')]['offset']);}_0x6f731a[_0xd9ff('0x9c')]=qs['sort'](_0xf3a93b['query'][_0xd9ff('0x57')]);_0x6f731a[_0xd9ff('0x82')]=qs[_0xd9ff('0x4f')](_[_0xd9ff('0x58')](_0xf3a93b[_0xd9ff('0x4e')],_0x193c57[_0xd9ff('0x4f')]));_0x6f731a[_0xd9ff('0x82')][_0xd9ff('0x111')]=_0x4115a3['id'];if(_0xf3a93b[_0xd9ff('0x4e')][_0xd9ff('0x90')]){_0x6f731a[_0xd9ff('0x82')]=_[_0xd9ff('0x3e')](_0x6f731a['where'],{'$or':_[_0xd9ff('0x79')](_0x6f731a['attributes'],function(_0x1bb980){var _0x3ccf5d={};_0x3ccf5d[_0x1bb980]={'$like':'%'+_0xf3a93b['query']['filter']+'%'};return _0x3ccf5d;})});}_0x6f731a[_0xd9ff('0x82')][_0xd9ff('0x116')]=![];if(_0xf3a93b['query']['id']){_0x6f731a[_0xd9ff('0x82')]['id']={'$gt':_0xf3a93b[_0xd9ff('0x4e')]['id']};}_0x6f731a=_['merge']({},_0x6f731a,_0xf3a93b[_0xd9ff('0x113')]);return db['ChatMessage'][_0xd9ff('0x34')]({'where':_0x6f731a[_0xd9ff('0x82')]})[_0xd9ff('0x22')](function(_0x42d9ff){_0x4572b2[_0xd9ff('0x34')]=_0x42d9ff;_0x6f731a[_0xd9ff('0x117')]=[];if(_0xf3a93b[_0xd9ff('0x4e')][_0xd9ff('0x118')]){_0x6f731a[_0xd9ff('0x117')][_0xd9ff('0x119')]({'model':db[_0xd9ff('0x7c')],'as':_0xd9ff('0x7c'),'attributes':['id',_0xd9ff('0x43'),_0xd9ff('0xfb')]});}if(_0xf3a93b['query'][_0xd9ff('0xbf')]){_0x6f731a[_0xd9ff('0x117')]=[{'all':!![]}];}return db[_0xd9ff('0xd4')][_0xd9ff('0x114')](_0x6f731a);})[_0xd9ff('0x22')](function(_0x314f18){_0x4572b2['rows']=_0x314f18;return _0x4572b2;});}})['then'](respondWithFilteredResult(_0x473ecf,_0x6f731a))['catch'](handleError(_0x473ecf,null));};exports['addTags']=function(_0x4699d3,_0x2e91a8,_0x4956b2){return db[_0xd9ff('0x49')][_0xd9ff('0xc0')]({'where':{'id':_0x4699d3[_0xd9ff('0xbe')]['id']}})['then'](handleEntityNotFound(_0x2e91a8,null))['then'](function(_0x217023){if(_0x217023){return _0x217023[_0xd9ff('0x11a')](_0x4699d3['body']['ids'],_['omit'](_0x4699d3['body'],['ids','id'])||{})[_0xd9ff('0x11b')](function(){return db[_0xd9ff('0x11c')][_0xd9ff('0x114')]({'attributes':['id',_0xd9ff('0x3c'),_0xd9ff('0x5b')],'where':{'id':_0x4699d3[_0xd9ff('0x3f')][_0xd9ff('0x10e')]}});})[_0xd9ff('0x22')](function(_0x317f93){socket[_0xd9ff('0x11d')](_0xd9ff('0x11e'),{'id':Number(_0x4699d3[_0xd9ff('0xbe')]['id']),'tags':_0x317f93||[]});return{'id':Number(_0x4699d3[_0xd9ff('0xbe')]['id']),'tags':_0x317f93||[]};});}})[_0xd9ff('0x22')](respondWithResult(_0x2e91a8,null))[_0xd9ff('0x2d')](handleError(_0x2e91a8,null));};exports[_0xd9ff('0x11f')]=function(_0x404baf,_0x5d73cd,_0xdb719b){return db['ChatInteraction'][_0xd9ff('0xc0')]({'where':{'id':_0x404baf['params']['id']}})[_0xd9ff('0x22')](handleEntityNotFound(_0x5d73cd,null))[_0xd9ff('0x22')](function(_0x10935d){if(_0x10935d){return _0x10935d['removeTags'](_0x404baf['query']['ids']);}})['then'](respondWithStatusCode(_0x5d73cd,null))['catch'](handleError(_0x5d73cd,null));};exports[_0xd9ff('0xeb')]=function(_0x2031e9,_0x3b50d9){var _0x410fae=moment()[_0xd9ff('0x120')]()[_0xd9ff('0xbb')]();var _0x494da6=path[_0xd9ff('0xe7')](config[_0xd9ff('0xe8')],'server','files',_0xd9ff('0x121'));var _0x49c9cc=path[_0xd9ff('0xe7')](config['root'],_0xd9ff('0x122'),_0xd9ff('0x123'),'attachments');var _0x378746=path[_0xd9ff('0xe7')](_0x494da6,_0x410fae);var _0x2acbe3=util[_0xd9ff('0xef')]('transcript-%d-%s.zip',_0x2031e9['params']['id'],_0x410fae);var _0x46d12c=path[_0xd9ff('0xe7')](_0x494da6,_0x2acbe3);var _0x54f4aa=[];_0x54f4aa[_0xd9ff('0x119')]({'model':db['User'],'as':_0xd9ff('0x7c'),'attributes':['id',_0xd9ff('0x43')],'raw':!![]});_0x54f4aa[_0xd9ff('0x119')]({'model':db[_0xd9ff('0x124')],'as':_0xd9ff('0x71'),'attributes':['id',_0xd9ff('0x125'),'lastName'],'raw':!![]});if(_0x2031e9['query'][_0xd9ff('0x126')]){_0x54f4aa['push']({'model':db[_0xd9ff('0xe3')],'as':'Attachment','raw':!![]});}var _0xd015e9=[{'model':db[_0xd9ff('0xd4')],'as':_0xd9ff('0xf3'),'attributes':['id','body',_0xd9ff('0x84'),_0xd9ff('0xff'),'secret','read'],'include':_0x54f4aa}];_0xd015e9['push']({'model':db[_0xd9ff('0xc5')],'as':_0xd9ff('0x127'),'attributes':['id',_0xd9ff('0x3c')]});_0xd015e9[_0xd9ff('0x119')]({'model':db[_0xd9ff('0x7c')],'as':_0xd9ff('0x128'),'attributes':['id',_0xd9ff('0x43')]});return db[_0xd9ff('0x49')]['find']({'where':{'id':_0x2031e9[_0xd9ff('0xbe')]['id']},'include':_0xd015e9})[_0xd9ff('0x22')](handleEntityNotFound(_0x3b50d9,null))[_0xd9ff('0x22')](function(_0x1b452e){if(_0x1b452e){var _0x3ab927=_0x1b452e[_0xd9ff('0x129')]({'plain':!![]});fs[_0xd9ff('0x12a')](_0x378746);var _0x2b6e15={'channel':_0xd9ff('0x12b'),'account':_0x3ab927['Account']['name'],'agent':_0x3ab927['Owner']?_0x3ab927[_0xd9ff('0x128')][_0xd9ff('0x43')]:'N.A.','createdAt':moment(_0x3ab927[_0xd9ff('0x84')])['format']('YYYY-MM-DD\x20HH:mm:ss')[_0xd9ff('0xbb')](),'closedAt':_0x3ab927[_0xd9ff('0xda')]?moment(_0x3ab927[_0xd9ff('0x12c')])[_0xd9ff('0xef')](_0xd9ff('0x112'))[_0xd9ff('0xbb')]():'','disposition':_0x3ab927['disposition'],'chatInfo':{'browser':_0x3ab927[_0xd9ff('0x12d')],'os':_0x3ab927[_0xd9ff('0x12e')],'referer':_0x3ab927[_0xd9ff('0x12f')],'customerIp':_0x3ab927[_0xd9ff('0x130')],'customerPort':_0x3ab927[_0xd9ff('0x131')]?_0x3ab927['customerPort']:'N.A.'},'messages':_(_0x3ab927[_0xd9ff('0xf3')])[_0xd9ff('0x132')]()[_0xd9ff('0x90')]({'secret':![]})[_0xd9ff('0x79')](function(_0x319248){if(_0x319248[_0xd9ff('0xe3')]){var _0x1ea603=path[_0xd9ff('0xe7')](_0x49c9cc,_0x319248[_0xd9ff('0xe3')][_0xd9ff('0xe1')]);if(fs[_0xd9ff('0x133')](_0x1ea603)){fs[_0xd9ff('0x134')](_0x1ea603)[_0xd9ff('0x135')](fs['createWriteStream'](path[_0xd9ff('0xe7')](_0x378746,_0x319248[_0xd9ff('0xe3')][_0xd9ff('0xe1')])));}}return{'date':moment(_0x319248[_0xd9ff('0x84')])[_0xd9ff('0xef')](_0xd9ff('0x112'))[_0xd9ff('0xbb')](),'sender':_0x319248[_0xd9ff('0xff')]===_0xd9ff('0xd3')?_0x319248[_0xd9ff('0x7c')]?_0x319248[_0xd9ff('0x7c')][_0xd9ff('0x43')]:_0xd9ff('0xf6'):_0x319248['Contact'][_0xd9ff('0x125')]+(_0x319248[_0xd9ff('0x71')][_0xd9ff('0x136')]?'\x20'+_0x319248[_0xd9ff('0x71')]['lastName']:''),'body':_0x319248[_0xd9ff('0xe3')]?_0x319248['Attachment']['basename']:_0x319248[_0xd9ff('0x3f')],'direction':_0x319248[_0xd9ff('0xff')]===_0xd9ff('0xd3')?'A':'C','secret':_0x319248[_0xd9ff('0x116')],'read':_0x319248[_0xd9ff('0x8c')],'attachment':_0x319248[_0xd9ff('0xe3')]};})[_0xd9ff('0x6d')]()};return ejs['renderFile'](path[_0xd9ff('0xe7')](config[_0xd9ff('0xe8')],'server',_0xd9ff('0x137'),_0xd9ff('0x138')),{'interaction':_0x2b6e15})[_0xd9ff('0x22')](function(_0xb07a14){var _0x1c419f=path[_0xd9ff('0xe7')](_0x378746,_0xd9ff('0x139')+_0x3ab927['id']+'-'+_0x410fae+_0xd9ff('0x13a'));var _0x3156c8={'path':_0x1c419f,'channel':_0xd9ff('0x12b'),'interactionId':_0x3ab927['id']};return pdf[_0xd9ff('0x13b')](_0xb07a14,_0x3156c8);})['then'](function(){return new BPromise(function(_0x567007,_0x1019f9){zipdir(_0x378746,{'saveTo':_0x46d12c},function(_0x2ab78a,_0x4649d9){if(_0x2ab78a)return _0x1019f9(_0x2ab78a);return _0x567007(_0x4649d9);});})[_0xd9ff('0x22')](function(){return new BPromise(function(_0x166033,_0x3c40e4){rimraf(_0x378746,function(_0x346d93){if(_0x346d93)_0x3c40e4(_0x346d93);return _0x166033();});});})[_0xd9ff('0x22')](function(){return _0x3b50d9['download'](_0x46d12c,_0x2acbe3,function(_0x22680e){if(_0x22680e){console['log'](_0xd9ff('0x13c'),_0x22680e);}else{fs[_0xd9ff('0x13d')](_0x46d12c);}});});});}else{return _0x3b50d9['sendStatus'](0xc8);}})[_0xd9ff('0x2d')](handleError(_0x3b50d9,null));};
\ No newline at end of file
+var _0xea28=['fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','to-csv','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','localhost','./chatInteraction.socket','register','jayson/promise','client','http','request','then','info','ChatInteraction,\x20%s,\x20%s','request\x20sent','debug','ChatInteraction,\x20%s,\x20%s,\x20%s','error','code','message','catch','status','end','json','offset','undefined','limit','count','Content-Range','apply','update','destroy','sendStatus','stack','name','merge','contact','agent','interaction','account','Users','map','TagIds','Tags','split','forEach','index','ChatInteraction','rawAttributes','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','select','field','color','u.id','ui.ChatInteractionId','from','user_has_chat_interactions','users','u.id\x20=\x20ui.UserId','chat_interactions','left_join','cm_contacts','o.id\x20=\x20i.UserId','chat_websites','a.id\x20=\x20i.ChatWebsiteId','chat_messages','me.ChatInteractionId\x20=\x20i.id','tools_tags','t.id\x20=\x20it.TagId','search','parseSearch','conditions','find','unreadMessages','having','`\x20=\x200','Contact','$substring','value','getFullTextValue','c.firstName\x20LIKE\x20?\x20OR\x20c.lastName\x20LIKE\x20?\x20OR\x20c.email\x20LIKE\x20?','ContactId','buildExpression','start','Tag','union','User','operator','CONCAT_WS(\x27\x20\x27,\x20o.name,\x20o.fullname)\x20LIKE\x20?','UserId','text','compact','i.ChatWebsiteId\x20IN\x20?','concat','createdAt','parse','$gte','$lte','i.createdAt\x20BETWEEN\x20?\x20AND\x20?','null','\x20IS\x20NULL','\x20=\x20?','`unreadMessages`\x20=\x200','`unreadMessages`\x20>\x200','tag','isArray','CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','filter','isNumeric','MATCH\x20(me.body)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','CONCAT(c.firstName,\x20\x27\x20\x27,\x20c.lastName)\x20LIKE\x20?','group','i.id','Sequelize','QueryTypes','SELECT','clone','SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)','contactName','DESC','isEmpty','t.id\x20IN\x20?','resolve','i.ChatWebsiteId\x20IS\x20NOT\x20NULL','role','user','getChatWebsites','i.ChatWebsiteId\x20IS\x20NULL','sequelize','toString','keyBy','a.key','Account.key','a.mandatoryDisposition','Account.mandatoryDisposition','CASE\x20WHEN\x20(c.firstName\x20IS\x20NOT\x20NULL\x20AND\x20c.firstName\x20<>\x20\x27\x27)\x20OR\x20(c.lastName\x20IS\x20NOT\x20NULL\x20AND\x20c.lastName\x20<>\x20\x27\x27)\x20THEN\x20CONCAT(IFNULL(c.firstName,\x20\x27\x27),\x20\x27\x20\x27,\x20IFNULL(c.lastName,\x20\x27\x27))\x20ELSE\x20\x27Unknown\x27\x20END','i.*','Contact.firstName','Contact.lastName','Contact.email','Contact.phone','c.mobile','Contact.mobile','Contact.fax','o.fullname','Owner.fullname','o.internal','Owner.internal','GROUP_CONCAT(DISTINCT\x20t.id)','ui.ChatInteractionId\x20IN\x20?','groupBy','ChatInteractionId','push','all','params','includeAll','options','create','body','describe','createVidaooSession','findOne','ChatWebsite','ChatWebsiteId','vidaooApiKey','vidaooEscalation','vidaooNote','vidaooMetadata','POST','https://api-vidaoo.xcally.com/api/v1/meetings','email','isNull','follow','metadata','ValidationError','Error\x20in\x20conversion\x20vidaooMetadata','join_url','ChatMessage','Unable\x20to\x20create\x20Vidaoo\x20session','updateAttributes','customUpdate','CmContact','abandon','entity\x20not\x20found','Interaction\x20already\x20assigned','disposition','AbandonInteraction','attachmentUpload','file','originalname','basename','filename','mimetype','attachmentDownload','closed','Unauthorized','Attachment','attachId','ChatOfflineMessageId','join','root','server/files/attachments/','offline-chat/','download','close','mailTranscript','server/files/chat/upload/','now','pathTranscript','%s%d','agentAlias','System','customer','format','Visitor','agentIdentifier','website_alias','agent_alias','alias','agent_fullname','fullname','[%s]\x20%s:\x20%s\x0a','direction','appendFileSync','MailServerOut','Smtp','service','port','secure','authentication','auth','SendMail','sendMail','\x22%s\x22\x20<%s>','Mail\x20Transcript','addMessage','ids','omit','getMessages','include','findAll','rows','getMyMessages','secret','includeAgent','addTags','setTags','spread','emit','removeTags','files','attachments','transcript-%d-%s.zip','firstName','lastName','Messages','read','Account','Chat','Owner','YYYY-MM-DD\x20HH:mm:ss','browserName','customerIp','customerPort','tail','existsSync','createReadStream','pipe','createWriteStream','out','renderFile','views','downloadInteraction.ejs','transcript-','log','unlinkSync','eml-format','rimraf','zip-dir'];(function(_0x4bc676,_0xa0df1c){var _0x4757e2=function(_0xe56289){while(--_0xe56289){_0x4bc676['push'](_0x4bc676['shift']());}};_0x4757e2(++_0xa0df1c);}(_0xea28,0x13a));var _0x8ea2=function(_0x375e36,_0x29c47a){_0x375e36=_0x375e36-0x0;var _0x4c8cfa=_0xea28[_0x375e36];return _0x4c8cfa;};'use strict';var emlformat=require(_0x8ea2('0x0'));var rimraf=require(_0x8ea2('0x1'));var zipdir=require(_0x8ea2('0x2'));var jsonpatch=require(_0x8ea2('0x3'));var rp=require(_0x8ea2('0x4'));var moment=require(_0x8ea2('0x5'));var BPromise=require(_0x8ea2('0x6'));var Mustache=require(_0x8ea2('0x7'));var util=require('util');var path=require(_0x8ea2('0x8'));var sox=require(_0x8ea2('0x9'));var csv=require(_0x8ea2('0xa'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x8ea2('0xb'));var _=require(_0x8ea2('0xc'));var squel=require(_0x8ea2('0xd'));var crypto=require(_0x8ea2('0xe'));var jsforce=require(_0x8ea2('0xf'));var deskjs=require(_0x8ea2('0x10'));var toCsv=require(_0x8ea2('0xa'));var querystring=require(_0x8ea2('0x11'));var Papa=require(_0x8ea2('0x12'));var Redis=require(_0x8ea2('0x13'));var authService=require(_0x8ea2('0x14'));var qs=require(_0x8ea2('0x15'));var as=require('../../components/parsers/advancedSearch');var pdf=require('../../components/export/pdf');var hardwareService=require(_0x8ea2('0x16'));var logger=require(_0x8ea2('0x17'))(_0x8ea2('0x18'));var utils=require('../../config/utils');var config=require(_0x8ea2('0x19'));var licenseUtil=require(_0x8ea2('0x1a'));var db=require(_0x8ea2('0x1b'))['db'];config[_0x8ea2('0x1c')]=_[_0x8ea2('0x1d')](config['redis'],{'host':_0x8ea2('0x1e'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0x8ea2('0x1f'))[_0x8ea2('0x20')](socket);var jayson=require(_0x8ea2('0x21'));var client=jayson[_0x8ea2('0x22')][_0x8ea2('0x23')]({'port':0x232b});var client9004=jayson[_0x8ea2('0x22')][_0x8ea2('0x23')]({'port':0x232c});function respondWithRpcPromise(_0x11f5e8,_0x474873,_0x396aab,_0x2dfa7c){return new BPromise(function(_0x1c1715,_0x3bc774){var _0xaa8abf=_0x2dfa7c||client;return _0xaa8abf[_0x8ea2('0x24')](_0x11f5e8,_0x396aab)[_0x8ea2('0x25')](function(_0x467045){logger[_0x8ea2('0x26')](_0x8ea2('0x27'),_0x474873,_0x8ea2('0x28'));logger[_0x8ea2('0x29')](_0x8ea2('0x2a'),_0x474873,'request\x20sent',JSON['stringify'](_0x467045));if(_0x467045[_0x8ea2('0x2b')]){if(_0x467045[_0x8ea2('0x2b')][_0x8ea2('0x2c')]===0x1f4){logger['error'](_0x8ea2('0x27'),_0x474873,_0x467045[_0x8ea2('0x2b')]['message']);return _0x3bc774(_0x467045[_0x8ea2('0x2b')][_0x8ea2('0x2d')]);}logger[_0x8ea2('0x2b')](_0x8ea2('0x27'),_0x474873,_0x467045[_0x8ea2('0x2b')][_0x8ea2('0x2d')]);return _0x1c1715(_0x467045[_0x8ea2('0x2b')][_0x8ea2('0x2d')]);}else{logger[_0x8ea2('0x26')]('ChatInteraction,\x20%s,\x20%s',_0x474873,_0x8ea2('0x28'));_0x1c1715(_0x467045['result'][_0x8ea2('0x2d')]);}})[_0x8ea2('0x2e')](function(_0x29b38f){logger['error']('ChatInteraction,\x20%s,\x20%s',_0x474873,_0x29b38f);_0x3bc774(_0x29b38f);});});}function respondWithStatusCode(_0x2e4da3,_0x4dc7bf){_0x4dc7bf=_0x4dc7bf||0xcc;return function(_0x200a49){if(_0x200a49){return _0x2e4da3['sendStatus'](_0x4dc7bf);}return _0x2e4da3[_0x8ea2('0x2f')](_0x4dc7bf)[_0x8ea2('0x30')]();};}function respondWithResult(_0x21c526,_0x266db8){_0x266db8=_0x266db8||0xc8;return function(_0x4e1b90){if(_0x4e1b90){return _0x21c526['status'](_0x266db8)[_0x8ea2('0x31')](_0x4e1b90);}};}function respondWithFilteredResult(_0x4da5b3,_0x4a9875){return function(_0x287078){if(_0x287078){var _0x24f187=typeof _0x4a9875[_0x8ea2('0x32')]===_0x8ea2('0x33')&&typeof _0x4a9875[_0x8ea2('0x34')]===_0x8ea2('0x33');var _0x316707=_0x287078[_0x8ea2('0x35')];var _0x9c5fac=_0x24f187?0x0:_0x4a9875['offset'];var _0x5b7ff9=_0x24f187?_0x287078[_0x8ea2('0x35')]:_0x4a9875[_0x8ea2('0x32')]+_0x4a9875['limit'];var _0x4a110f;if(_0x5b7ff9>=_0x316707){_0x5b7ff9=_0x316707;_0x4a110f=0xc8;}else{_0x4a110f=0xce;}_0x4da5b3[_0x8ea2('0x2f')](_0x4a110f);return _0x4da5b3['set'](_0x8ea2('0x36'),_0x9c5fac+'-'+_0x5b7ff9+'/'+_0x316707)[_0x8ea2('0x31')](_0x287078);}return null;};}function patchUpdates(_0x53fd06){return function(_0x17b21c){try{jsonpatch[_0x8ea2('0x37')](_0x17b21c,_0x53fd06,!![]);}catch(_0x33abc8){return BPromise['reject'](_0x33abc8);}return _0x17b21c['save']();};}function saveUpdates(_0x49a252,_0x3880c3){return function(_0x233e12){if(_0x233e12){return _0x233e12[_0x8ea2('0x38')](_0x49a252)['then'](function(_0x456487){return _0x456487;});}return null;};}function removeEntity(_0x391b08,_0x3d5bf0){return function(_0x278e5d){if(_0x278e5d){return _0x278e5d[_0x8ea2('0x39')]()[_0x8ea2('0x25')](function(){_0x391b08[_0x8ea2('0x2f')](0xcc)[_0x8ea2('0x30')]();});}};}function handleEntityNotFound(_0x5e9b1f,_0x955ef3){return function(_0x29e3f5){if(!_0x29e3f5){_0x5e9b1f[_0x8ea2('0x3a')](0x194);}return _0x29e3f5;};}function handleError(_0x467d97,_0x4eebc1){_0x4eebc1=_0x4eebc1||0x1f4;return function(_0x2a1f14){logger['error'](_0x2a1f14[_0x8ea2('0x3b')]);if(_0x2a1f14[_0x8ea2('0x3c')]){delete _0x2a1f14[_0x8ea2('0x3c')];}_0x467d97[_0x8ea2('0x2f')](_0x4eebc1)['send'](_0x2a1f14);};}function getMustacheRender(_0x2bed24,_0x531979){return Mustache['render'](_0x2bed24,_[_0x8ea2('0x3d')](_0x531979['body'],{'contact':_0x531979[_0x8ea2('0x3e')],'message':_0x531979[_0x8ea2('0x2d')],'agent':_0x531979[_0x8ea2('0x3f')],'interaction':_0x531979[_0x8ea2('0x40')],'account':_0x531979[_0x8ea2('0x41')]}))||'';}function getInteractionUsers(_0x4ae536,_0x84685d){return new BPromise(function(_0x5c5d2d,_0x12a6c2){try{if(_0x84685d[_0x4ae536['id']]){_0x4ae536[_0x8ea2('0x42')]=_[_0x8ea2('0x43')](_0x84685d[_0x4ae536['id']],function(_0x3995ff){return{'id':_0x3995ff['id'],'fullname':_0x3995ff['fullname']};});}}catch(_0x44e8bc){_0x12a6c2(_0x44e8bc);}_0x5c5d2d(_0x4ae536);});}function getInteractionTags(_0x57a6b8,_0x3f0c78){return new BPromise(function(_0x5ba351,_0x2ee78b){try{if(_0x57a6b8[_0x8ea2('0x44')]){_0x57a6b8[_0x8ea2('0x45')]=[];_0x57a6b8[_0x8ea2('0x44')][_0x8ea2('0x46')](',')[_0x8ea2('0x47')](function(_0x2f4fa8){_0x57a6b8['Tags']['push'](_0x3f0c78[_0x2f4fa8]);});}delete _0x57a6b8[_0x8ea2('0x44')];}catch(_0x53455a){_0x2ee78b(_0x53455a);}_0x5ba351(_0x57a6b8);});}function updateChatInteraction(_0x4b03fa,_0x59e2fa,_0x3cbc09){return new BPromise(function(_0x5d9ba0,_0x40a532){return getInteractionUsers(_0x4b03fa,_0x3cbc09)[_0x8ea2('0x25')](function(_0x39c944){return getInteractionTags(_0x39c944,_0x59e2fa);})[_0x8ea2('0x25')](function(_0x989d9b){_0x5d9ba0(_0x989d9b);})[_0x8ea2('0x2e')](function(_0x3b2219){_0x40a532(_0x3b2219);});});}exports[_0x8ea2('0x48')]=function(_0x5352b9,_0x3afb80){var _0x1ef615={},_0x1db25c={},_0x5cb6ad={'count':0x0,'rows':[]};var _0x2d6bbb=_[_0x8ea2('0x43')](db[_0x8ea2('0x49')][_0x8ea2('0x4a')],function(_0x20992d){return{'name':_0x20992d['fieldName'],'type':_0x20992d[_0x8ea2('0x4b')][_0x8ea2('0x4c')]};});_0x1db25c[_0x8ea2('0x4d')]=_['map'](_0x2d6bbb,_0x8ea2('0x3c'));_0x1db25c[_0x8ea2('0x4e')]=_[_0x8ea2('0x4f')](_0x5352b9[_0x8ea2('0x4e')]);_0x1db25c[_0x8ea2('0x50')]=_[_0x8ea2('0x51')](_0x1db25c[_0x8ea2('0x4d')],_0x1db25c[_0x8ea2('0x4e')]);_0x1ef615[_0x8ea2('0x52')]=_[_0x8ea2('0x51')](_0x1db25c[_0x8ea2('0x4d')],qs[_0x8ea2('0x53')](_0x5352b9[_0x8ea2('0x4e')][_0x8ea2('0x53')]));_0x1ef615['attributes']=_0x1ef615[_0x8ea2('0x52')][_0x8ea2('0x54')]?_0x1ef615[_0x8ea2('0x52')]:_0x1db25c[_0x8ea2('0x4d')];if(!_0x5352b9[_0x8ea2('0x4e')][_0x8ea2('0x55')](_0x8ea2('0x56'))){_0x1ef615[_0x8ea2('0x34')]=qs['limit'](_0x5352b9[_0x8ea2('0x4e')][_0x8ea2('0x34')]);_0x1ef615[_0x8ea2('0x32')]=qs['offset'](_0x5352b9['query'][_0x8ea2('0x32')]);}_0x1ef615[_0x8ea2('0x57')]=qs[_0x8ea2('0x58')](_0x5352b9['query'][_0x8ea2('0x58')]);_0x1ef615[_0x8ea2('0x59')]=qs[_0x8ea2('0x50')](_[_0x8ea2('0x5a')](_0x5352b9[_0x8ea2('0x4e')],_0x1db25c['filters']),_0x2d6bbb);var _0x4afd85=[];var _0x24a22a=squel[_0x8ea2('0x5b')]()[_0x8ea2('0x5c')]('id')['field'](_0x8ea2('0x3c'))[_0x8ea2('0x5c')](_0x8ea2('0x5d'))['from']('tools_tags');var _0x48aebf=squel['select']()['field'](_0x8ea2('0x5e'))[_0x8ea2('0x5c')]('u.fullname')['field'](_0x8ea2('0x5f'))[_0x8ea2('0x60')](_0x8ea2('0x61'),'ui')['left_join'](_0x8ea2('0x62'),'u',_0x8ea2('0x63'));var _0x59e3df=squel[_0x8ea2('0x5b')]()[_0x8ea2('0x60')](_0x8ea2('0x64'),'i')[_0x8ea2('0x65')](_0x8ea2('0x66'),'c','c.id\x20=\x20i.ContactId\x20AND\x20c.deletedAt\x20IS\x20NULL')['left_join']('users','o',_0x8ea2('0x67'))[_0x8ea2('0x65')](_0x8ea2('0x68'),'a',_0x8ea2('0x69'))[_0x8ea2('0x65')](_0x8ea2('0x6a'),'me',_0x8ea2('0x6b'))['left_join']('chat_interaction_has_tags','it','it.ChatInteractionId\x20=\x20i.id')[_0x8ea2('0x65')](_0x8ea2('0x6c'),'t',_0x8ea2('0x6d'));var _0x2bbec0=squel['expr']();var _0x11824e=[];var _0x2b8662=squel['expr']();var _0x21485a;if(_0x5352b9[_0x8ea2('0x4e')][_0x8ea2('0x6e')]){_0x21485a=as[_0x8ea2('0x6f')](_0x5352b9[_0x8ea2('0x4e')]['search']);var _0x479c05=_0x21485a['sqlOperator'];for(var _0x53a62c=0x0;_0x53a62c<_0x21485a[_0x8ea2('0x70')][_0x8ea2('0x54')];_0x53a62c++){var _0x2d8221=_0x21485a[_0x8ea2('0x70')][_0x53a62c];var _0x491d3d='i';var _0x461d32=_[_0x8ea2('0x71')](_0x2d6bbb,[_0x8ea2('0x3c'),_0x2d8221[_0x8ea2('0x5c')]]);if(!_0x461d32){switch(_0x2d8221['field']){case _0x8ea2('0x72'):if(_0x2d8221['value']==0x1){_0x59e3df[_0x8ea2('0x73')]('`'+_0x2d8221['field']+_0x8ea2('0x74'));}else{_0x59e3df[_0x8ea2('0x73')]('`'+_0x2d8221['field']+'`\x20>\x200');}break;case _0x8ea2('0x75'):if(_0x2d8221['operator']===_0x8ea2('0x76')){if(_0x2d8221[_0x8ea2('0x77')][_0x8ea2('0x46')]('\x20')[_0x8ea2('0x54')]>0x1){_0x2bbec0[_0x479c05]('MATCH\x20(c.firstName,\x20c.lastName,\x20c.phone,\x20c.mobile,\x20c.fax,\x20c.email)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)',qs[_0x8ea2('0x78')](_0x2d8221[_0x8ea2('0x77')]),null);}else{var _0x39776d='%'+_0x2d8221[_0x8ea2('0x77')]+'%';_0x2bbec0[_0x479c05](_0x8ea2('0x79'),_0x39776d,_0x39776d,_0x39776d);}}else{_0x461d32=_[_0x8ea2('0x71')](_0x2d6bbb,[_0x8ea2('0x3c'),_0x8ea2('0x7a')]);_0x2d8221[_0x8ea2('0x5c')]=_0x8ea2('0x7a');_0x3d55db=as[_0x8ea2('0x7b')](_0x491d3d,_0x461d32[_0x8ea2('0x4b')],_0x2d8221);_0x2bbec0[_0x479c05](_0x3d55db['text'],_0x3d55db[_0x8ea2('0x77')][_0x8ea2('0x7c')],_0x3d55db[_0x8ea2('0x77')][_0x8ea2('0x30')]);}break;case _0x8ea2('0x7d'):var _0x219f78=_0x2d8221[_0x8ea2('0x77')][_0x8ea2('0x46')](',')[_0x8ea2('0x43')](function(_0xefb7b){return Number(_0xefb7b);});_0x219f78[_0x8ea2('0x47')](function(_0x35cfc5){_0x2b8662['or']('CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','%,'+_0x35cfc5+',%');});_0x11824e=_[_0x8ea2('0x7e')](_0x11824e,_0x219f78);break;case _0x8ea2('0x7f'):if(_0x2d8221[_0x8ea2('0x80')]===_0x8ea2('0x76')){_0x2bbec0[_0x479c05](_0x8ea2('0x81'),'%'+_0x2d8221['value']+'%',null);}else{_0x461d32=_['find'](_0x2d6bbb,['name',_0x8ea2('0x82')]);_0x2d8221[_0x8ea2('0x5c')]=_0x8ea2('0x82');_0x3d55db=as[_0x8ea2('0x7b')](_0x491d3d,_0x461d32[_0x8ea2('0x4b')],_0x2d8221);_0x2bbec0[_0x479c05](_0x3d55db[_0x8ea2('0x83')],_0x3d55db['value'][_0x8ea2('0x7c')],_0x3d55db[_0x8ea2('0x77')]['end']);}break;case'body':_0x3d55db=as[_0x8ea2('0x7b')]('me',null,_0x2d8221);_0x2bbec0[_0x479c05](_0x3d55db[_0x8ea2('0x83')],_0x3d55db[_0x8ea2('0x77')][_0x8ea2('0x7c')],_0x3d55db[_0x8ea2('0x77')][_0x8ea2('0x30')]);break;}}else{var _0x3d55db=as['buildExpression'](_0x491d3d,_0x461d32[_0x8ea2('0x4b')],_0x2d8221);_0x2bbec0[_0x479c05](_0x3d55db[_0x8ea2('0x83')],_0x3d55db[_0x8ea2('0x77')][_0x8ea2('0x7c')],_0x3d55db['value'][_0x8ea2('0x30')]);}}}else{var _0x356099=_(_0x5352b9[_0x8ea2('0x4e')])['keys']()[_0x8ea2('0x43')](function(_0x5c2d05){return _['some'](_0x2d6bbb,[_0x8ea2('0x3c'),_0x5c2d05])?_0x5c2d05:undefined;})[_0x8ea2('0x84')]()['value']();if(!_['isEmpty'](_0x356099)){_0x356099['forEach'](function(_0x167f15){if(_0x167f15==='ChatWebsiteId'){_0x59e3df['where'](_0x8ea2('0x85'),[][_0x8ea2('0x86')](_0x5352b9[_0x8ea2('0x4e')][_0x167f15]));}else if(_0x167f15===_0x8ea2('0x87')){var _0x1681d8=JSON[_0x8ea2('0x88')](_0x5352b9[_0x8ea2('0x4e')][_0x167f15])[_0x8ea2('0x89')];var _0x14a5de=JSON[_0x8ea2('0x88')](_0x5352b9[_0x8ea2('0x4e')][_0x167f15])[_0x8ea2('0x8a')];_0x59e3df[_0x8ea2('0x59')](_0x8ea2('0x8b'),_0x1681d8,_0x14a5de);}else{if(_0x5352b9['query'][_0x167f15]===_0x8ea2('0x8c')){_0x59e3df[_0x8ea2('0x59')]('i.'+_0x167f15+_0x8ea2('0x8d'));}else{_0x59e3df['where']('i.'+_0x167f15+_0x8ea2('0x8e'),_0x5352b9['query'][_0x167f15]);}}});}if(_0x5352b9[_0x8ea2('0x4e')]['read']){if(_0x5352b9[_0x8ea2('0x4e')]['read']==0x1){_0x59e3df[_0x8ea2('0x73')](_0x8ea2('0x8f'));}else{_0x59e3df['having'](_0x8ea2('0x90'));}}if(_0x5352b9['query'][_0x8ea2('0x91')]){_0x11824e=_[_0x8ea2('0x92')](_0x5352b9[_0x8ea2('0x4e')][_0x8ea2('0x91')])?_0x5352b9[_0x8ea2('0x4e')]['tag']:new Array(_0x5352b9['query'][_0x8ea2('0x91')]);_0x11824e['forEach'](function(_0x410f78){_0x2b8662['or'](_0x8ea2('0x93'),'%,'+_0x410f78+',%');});}if(_0x5352b9[_0x8ea2('0x4e')][_0x8ea2('0x94')]){var _0x262cef=_0x5352b9[_0x8ea2('0x4e')]['filter']['replace']('\x5c','\x5c\x5c')['replace'](/'/g,'\x27\x27');if(qs[_0x8ea2('0x95')](_0x262cef)){_0x2bbec0['or']('i.id\x20LIKE\x20?',_0x262cef+'%');}else{_0x2bbec0['or'](_0x8ea2('0x96'),qs[_0x8ea2('0x78')](_0x262cef))['or'](_0x8ea2('0x97'),_0x262cef+'%');}}}_0x59e3df[_0x8ea2('0x59')](_0x2bbec0);_0x59e3df[_0x8ea2('0x98')](_0x8ea2('0x99'));var _0x4b4d64={'type':db[_0x8ea2('0x9a')][_0x8ea2('0x9b')][_0x8ea2('0x9c')],'raw':!![]};var _0x335a96=_0x59e3df[_0x8ea2('0x9d')]();_0x335a96['field']('i.id');_0x335a96[_0x8ea2('0x5c')](_0x8ea2('0x9e'),_0x8ea2('0x72'));if(_0x1ef615[_0x8ea2('0x57')]){_0x1ef615[_0x8ea2('0x57')][_0x8ea2('0x47')](function(_0x2e0bbe){var _0x9c4960=_0x2e0bbe[0x0]===_0x8ea2('0x9f')?_0x2e0bbe[0x0]:'i.'+_0x2e0bbe[0x0];_0x59e3df[_0x8ea2('0x57')](_0x9c4960,_0x2e0bbe[0x1]===_0x8ea2('0xa0')?![]:!![]);});}if(!_[_0x8ea2('0xa1')](_0x11824e)){_0x59e3df[_0x8ea2('0x73')](_0x2b8662);_0x335a96[_0x8ea2('0x59')](_0x8ea2('0xa2'),_0x11824e);}BPromise[_0x8ea2('0xa3')]()[_0x8ea2('0x25')](function(){if(!_0x21485a){if(_0x5352b9['query']['ChatWebsiteId'])return;_0x335a96[_0x8ea2('0x59')]('i.ChatWebsiteId\x20IS\x20NOT\x20NULL');_0x59e3df[_0x8ea2('0x59')](_0x8ea2('0xa4'));return;}if(_0x5352b9['user'][_0x8ea2('0xa5')]!=='agent')return;return _0x5352b9[_0x8ea2('0xa6')][_0x8ea2('0xa7')]({'attributes':['id'],'raw':!![]})['then'](function(_0x17dee8){if(_[_0x8ea2('0xa1')](_0x17dee8)){_0x335a96[_0x8ea2('0x59')](_0x8ea2('0xa8'));_0x59e3df[_0x8ea2('0x59')](_0x8ea2('0xa8'));}else{_0x335a96[_0x8ea2('0x59')](_0x8ea2('0x85'),_[_0x8ea2('0x43')](_0x17dee8,'id'));_0x59e3df[_0x8ea2('0x59')]('i.ChatWebsiteId\x20IN\x20?',_[_0x8ea2('0x43')](_0x17dee8,'id'));}});})[_0x8ea2('0x25')](function(){if(_0x5352b9['user'][_0x8ea2('0xa5')]==='agent'&&!_0x21485a&&!_0x5352b9['query']['ChatWebsiteId'])return[];return db[_0x8ea2('0xa9')]['query'](_0x335a96[_0x8ea2('0xaa')](),_0x4b4d64);})[_0x8ea2('0x25')](function(_0x12ed20){_0x5cb6ad[_0x8ea2('0x35')]=_0x12ed20[_0x8ea2('0x54')];if(_0x5cb6ad[_0x8ea2('0x35')]===0x0)return[];return db['sequelize'][_0x8ea2('0x4e')](_0x24a22a['toString'](),_0x4b4d64)[_0x8ea2('0x25')](function(_0x18aa81){_0x4afd85=_[_0x8ea2('0xab')](_0x18aa81,'id');_0x4b4d64=_[_0x8ea2('0x3d')](_0x4b4d64,{'model':db[_0x8ea2('0x49')],'mapToModel':!![],'raw':!![],'nest':!![]});if(_0x5352b9['query'][_0x8ea2('0x53')]){_0x1ef615[_0x8ea2('0x52')][_0x8ea2('0x47')](function(_0x2a82b2){_0x59e3df[_0x8ea2('0x5c')]('i.'+_0x2a82b2);});}else{_0x59e3df[_0x8ea2('0x5c')](_0x8ea2('0x9e'),_0x8ea2('0x72'));_0x59e3df[_0x8ea2('0x5c')](_0x8ea2('0xac'),_0x8ea2('0xad'));_0x59e3df[_0x8ea2('0x5c')](_0x8ea2('0xae'),_0x8ea2('0xaf'));_0x59e3df[_0x8ea2('0x5c')](_0x8ea2('0xb0'),_0x8ea2('0x9f'));_0x59e3df['field'](_0x8ea2('0xb1'));_0x59e3df['field']('c.firstName',_0x8ea2('0xb2'));_0x59e3df[_0x8ea2('0x5c')]('c.lastName',_0x8ea2('0xb3'));_0x59e3df[_0x8ea2('0x5c')]('c.email',_0x8ea2('0xb4'));_0x59e3df[_0x8ea2('0x5c')]('c.phone',_0x8ea2('0xb5'));_0x59e3df[_0x8ea2('0x5c')](_0x8ea2('0xb6'),_0x8ea2('0xb7'));_0x59e3df[_0x8ea2('0x5c')]('c.fax',_0x8ea2('0xb8'));_0x59e3df[_0x8ea2('0x5c')](_0x8ea2('0xb9'),_0x8ea2('0xba'));_0x59e3df[_0x8ea2('0x5c')](_0x8ea2('0xbb'),_0x8ea2('0xbc'));_0x59e3df[_0x8ea2('0x5c')](_0x8ea2('0xbd'),'TagIds');}if(_0x1ef615[_0x8ea2('0x34')])_0x59e3df['limit'](_0x1ef615[_0x8ea2('0x34')]);if(_0x1ef615[_0x8ea2('0x32')])_0x59e3df[_0x8ea2('0x32')](_0x1ef615[_0x8ea2('0x32')]);return db[_0x8ea2('0xa9')]['query'](_0x59e3df[_0x8ea2('0xaa')](),_0x4b4d64);})[_0x8ea2('0x25')](function(_0x4fdd16){if(_0x4fdd16['length']>0x0)_0x48aebf[_0x8ea2('0x59')](_0x8ea2('0xbe'),_['map'](_0x4fdd16,'id'));return db['sequelize'][_0x8ea2('0x4e')](_0x48aebf[_0x8ea2('0xaa')](),_0x4b4d64)['then'](function(_0x2b7e80){var _0x2f6673=_[_0x8ea2('0xbf')](_0x2b7e80,_0x8ea2('0xc0'));var _0xdf4de9=[];_0x4fdd16['forEach'](function(_0x2e3a5d){_0xdf4de9[_0x8ea2('0xc1')](updateChatInteraction(_0x2e3a5d,_0x4afd85,_0x2f6673));});return BPromise[_0x8ea2('0xc2')](_0xdf4de9);});});})[_0x8ea2('0x25')](function(_0x412af1){_0x5cb6ad['rows']=_0x412af1;return _0x5cb6ad;})[_0x8ea2('0x25')](respondWithFilteredResult(_0x3afb80,_0x1ef615))['catch'](handleError(_0x3afb80,null));};exports['show']=function(_0x9468be,_0x17e9fc){var _0x5c95ec={'raw':![],'where':{'id':_0x9468be[_0x8ea2('0xc3')]['id']}},_0x239516={};_0x239516[_0x8ea2('0x4d')]=_[_0x8ea2('0x4f')](db[_0x8ea2('0x49')][_0x8ea2('0x4a')]);_0x239516['query']=_[_0x8ea2('0x4f')](_0x9468be[_0x8ea2('0x4e')]);_0x239516[_0x8ea2('0x50')]=_['intersection'](_0x239516[_0x8ea2('0x4d')],_0x239516[_0x8ea2('0x4e')]);_0x5c95ec[_0x8ea2('0x52')]=_[_0x8ea2('0x51')](_0x239516[_0x8ea2('0x4d')],qs['fields'](_0x9468be[_0x8ea2('0x4e')][_0x8ea2('0x53')]));_0x5c95ec[_0x8ea2('0x52')]=_0x5c95ec[_0x8ea2('0x52')]['length']?_0x5c95ec['attributes']:_0x239516[_0x8ea2('0x4d')];if(_0x9468be['query'][_0x8ea2('0xc4')]){_0x5c95ec['include']=[{'all':!![]}];}_0x5c95ec=_[_0x8ea2('0x3d')]({},_0x5c95ec,_0x9468be[_0x8ea2('0xc5')]);return db[_0x8ea2('0x49')][_0x8ea2('0x71')](_0x5c95ec)[_0x8ea2('0x25')](handleEntityNotFound(_0x17e9fc,null))[_0x8ea2('0x25')](respondWithResult(_0x17e9fc,null))[_0x8ea2('0x2e')](handleError(_0x17e9fc,null));};exports['create']=function(_0x2c5677,_0x224fca){return db[_0x8ea2('0x49')][_0x8ea2('0xc6')](_0x2c5677[_0x8ea2('0xc7')],{})[_0x8ea2('0x25')](respondWithResult(_0x224fca,0xc9))['catch'](handleError(_0x224fca,null));};exports[_0x8ea2('0x38')]=function(_0x463372,_0x76085){if(_0x463372[_0x8ea2('0xc7')]['id']){delete _0x463372['body']['id'];}return db['ChatInteraction']['find']({'where':{'id':_0x463372[_0x8ea2('0xc3')]['id']}})[_0x8ea2('0x25')](handleEntityNotFound(_0x76085,null))[_0x8ea2('0x25')](saveUpdates(_0x463372['body'],null))[_0x8ea2('0x25')](respondWithResult(_0x76085,null))[_0x8ea2('0x2e')](handleError(_0x76085,null));};exports[_0x8ea2('0x39')]=function(_0x500b47,_0x331019){return db[_0x8ea2('0x49')]['find']({'where':{'id':_0x500b47[_0x8ea2('0xc3')]['id']}})['then'](handleEntityNotFound(_0x331019,null))['then'](removeEntity(_0x331019,null))[_0x8ea2('0x2e')](handleError(_0x331019,null));};exports[_0x8ea2('0xc8')]=function(_0x405020,_0x5c9359){return db[_0x8ea2('0x49')][_0x8ea2('0xc8')]()[_0x8ea2('0x25')](respondWithResult(_0x5c9359,null))[_0x8ea2('0x2e')](handleError(_0x5c9359,null));};exports[_0x8ea2('0xc9')]=function(_0x11c59e,_0x11b02a){var _0x5ab2c4=_0x11c59e[_0x8ea2('0xc3')]['id'];var _0x111f97;var _0xf76d70;var _0x384500;return db[_0x8ea2('0x49')][_0x8ea2('0xca')]({'where':{'id':_0x5ab2c4}})[_0x8ea2('0x25')](function(_0x568581){_0x111f97=_0x568581;return db[_0x8ea2('0xcb')][_0x8ea2('0xca')]({'where':{'id':_0x568581[_0x8ea2('0xcc')]},'attributes':['id',_0x8ea2('0xcd'),_0x8ea2('0xce'),'vidaooTopic',_0x8ea2('0xcf'),_0x8ea2('0xd0')],'raw':!![]});})[_0x8ea2('0x25')](function(_0x1c336e){if(_0x1c336e&&_0x1c336e[_0x8ea2('0xcd')]&&_0x1c336e[_0x8ea2('0xce')]){_0xf76d70=_0x1c336e;var _0x473ae2={'interaction':{'id':_0x5ab2c4},'agent':{'id':_0x11c59e[_0x8ea2('0xa6')]['id'],'name':_0x11c59e[_0x8ea2('0xa6')]['name'],'fullname':_0x11c59e['user']['fullname'],'email':_0x11c59e[_0x8ea2('0xa6')]['email']},'contact':_0x11c59e[_0x8ea2('0xc7')][_0x8ea2('0x3e')],'account':_0x11c59e[_0x8ea2('0xc7')][_0x8ea2('0x41')]};var _0x6c0ccc={'rejectUnauthorized':![],'method':_0x8ea2('0xd1'),'url':_0x8ea2('0xd2'),'headers':{'X-APIKEY':_0x1c336e[_0x8ea2('0xcd')]},'body':{'duration':null,'scheduledAt':null,'participants':[_0x11c59e[_0x8ea2('0xa6')][_0x8ea2('0xd3')]],'buttons':null,'topic':_0xf76d70['vidaooTopic'],'note':_[_0x8ea2('0xd4')](_0xf76d70[_0x8ea2('0xcf')])?null:getMustacheRender(_0xf76d70[_0x8ea2('0xcf')],_0x473ae2),'metadata':null},'redirect':_0x8ea2('0xd5'),'json':!![]};try{if(!_[_0x8ea2('0xd4')](_0xf76d70[_0x8ea2('0xd0')])){var _0xc6888c=getMustacheRender(_0xf76d70[_0x8ea2('0xd0')],_0x473ae2);var _0x152d46=JSON[_0x8ea2('0x88')](_0xc6888c);_0x6c0ccc[_0x8ea2('0xc7')][_0x8ea2('0xd6')]=_0x152d46;}}catch(_0x465e7f){throw new db[(_0x8ea2('0x9a'))][(_0x8ea2('0xd7'))](_0x8ea2('0xd8'));}return rp(_0x6c0ccc);}else{throw new db[(_0x8ea2('0x9a'))]['ValidationError']('Error\x20in\x20Vidaoo\x20configuration');}})['then'](function(_0x4b2c0f){_0x384500=_0x4b2c0f;if(_0x384500['id']){var _0x2fcddc={'body':_0x384500[_0x8ea2('0xd9')],'ChatWebsiteId':_0xf76d70['id'],'ChatInteractionId':_0x111f97['id'],'direction':'out','UserId':_0x11c59e[_0x8ea2('0xa6')]['id']};return db[_0x8ea2('0xda')][_0x8ea2('0xc6')](_0x2fcddc,{});}else{throw new db[(_0x8ea2('0x9a'))]['ValidationError'](_0x8ea2('0xdb'));}})['then'](function(){return _0x111f97[_0x8ea2('0xdc')]({'vidaooSessionId':_0x384500['id']});})[_0x8ea2('0x25')](respondWithResult(_0x11b02a,null))[_0x8ea2('0x2e')](handleError(_0x11b02a,null));};exports[_0x8ea2('0xdd')]=function(_0x3b6b03,_0x3292bc){if(_0x3b6b03['body']['id']){delete _0x3b6b03['body']['id'];}return db[_0x8ea2('0x49')][_0x8ea2('0x71')]({'where':{'id':_0x3b6b03['params']['id']},'include':[{'model':db[_0x8ea2('0xde')],'as':'Contact'}]})[_0x8ea2('0x25')](handleEntityNotFound(_0x3292bc,null))[_0x8ea2('0x25')](saveUpdates(_0x3b6b03[_0x8ea2('0xc7')],null))[_0x8ea2('0x25')](respondWithResult(_0x3292bc,null))[_0x8ea2('0x2e')](handleError(_0x3292bc,null));};exports[_0x8ea2('0xdf')]=function(_0x1383b4,_0x4c1b9d,_0x3f3822){if(_0x1383b4[_0x8ea2('0xc7')]['id']){delete _0x1383b4[_0x8ea2('0xc7')]['id'];}return db[_0x8ea2('0x49')][_0x8ea2('0x71')]({'where':{'id':_0x1383b4[_0x8ea2('0xc3')]['id']}})[_0x8ea2('0x25')](function(_0x1c974d){if(!_0x1c974d){logger[_0x8ea2('0x2b')]('abandonInteraction,\x20%s,\x20%s,\x20%s',_0x8ea2('0xdf'),0x194,_0x8ea2('0xe0'));_0x4c1b9d[_0x8ea2('0x3a')](0x194);}else{if(_0x1c974d['UserId']){throw new db[(_0x8ea2('0x9a'))][(_0x8ea2('0xd7'))](_0x8ea2('0xe1'));}}return _0x1c974d;})[_0x8ea2('0x25')](function(_0xe18090){if(_0xe18090){return _0xe18090[_0x8ea2('0x38')]({'closed':_0x1383b4['body']['closed'],'disposition':_0x1383b4[_0x8ea2('0xc7')][_0x8ea2('0xe2')]})[_0x8ea2('0x25')](function(_0x695f4a){return _0x695f4a;});}})[_0x8ea2('0x25')](function(_0x57ff72){return respondWithRpcPromise(_0x8ea2('0xe3'),'abandon',_0x1383b4[_0x8ea2('0xc7')],client9004);})[_0x8ea2('0x25')](respondWithResult(_0x4c1b9d,null))['catch'](handleError(_0x4c1b9d,null));};exports[_0x8ea2('0xe4')]=function(_0x254b51,_0x2c11d2,_0x2aaa88){_0x254b51[_0x8ea2('0xc7')][_0x8ea2('0x3c')]=_0x254b51[_0x8ea2('0xe5')][_0x8ea2('0xe6')];_0x254b51[_0x8ea2('0xc7')][_0x8ea2('0xe7')]=_0x254b51['file'][_0x8ea2('0xe8')];_0x254b51[_0x8ea2('0xc7')][_0x8ea2('0x4b')]=_0x254b51['file'][_0x8ea2('0xe9')];return db['Attachment'][_0x8ea2('0xc6')](_0x254b51[_0x8ea2('0xc7')])[_0x8ea2('0x25')](respondWithResult(_0x2c11d2,0xc9))[_0x8ea2('0x2e')](handleError(_0x2c11d2,null));};exports[_0x8ea2('0xea')]=function(_0x1786ac,_0x7a45a8,_0x3a68e2){return db[_0x8ea2('0x49')]['findOne']({'where':{'id':_0x1786ac[_0x8ea2('0xc3')]['id']},'raw':!![]})[_0x8ea2('0x25')](handleEntityNotFound(_0x7a45a8,null))[_0x8ea2('0x25')](function(_0x8d4abd){if(_0x8d4abd){if(_0x8d4abd[_0x8ea2('0xeb')]){return _0x7a45a8[_0x8ea2('0x2f')](0x193)[_0x8ea2('0x31')]({'status':0x193,'message':_0x8ea2('0xec')});}return db[_0x8ea2('0xed')]['findOne']({'where':{'id':_0x1786ac[_0x8ea2('0x4e')][_0x8ea2('0xee')]},'raw':!![]})[_0x8ea2('0x25')](handleEntityNotFound(_0x7a45a8,null));}})[_0x8ea2('0x25')](function(_0xcbb6b3){if(_0xcbb6b3){var _0x4bdbe0=_0xcbb6b3[_0x8ea2('0xef')]!==null;var _0x44791f=path[_0x8ea2('0xf0')](config[_0x8ea2('0xf1')],_0x8ea2('0xf2'));if(_0x4bdbe0){_0x44791f=path['join'](_0x44791f,_0x8ea2('0xf3'));}var _0x4e7aff=path[_0x8ea2('0xf0')](_0x44791f,_0xcbb6b3[_0x8ea2('0xe7')]);return _0x7a45a8[_0x8ea2('0xf4')](_0x4e7aff);}})['catch'](handleError(_0x7a45a8,null));};exports[_0x8ea2('0xf5')]=function(_0x48a2e2,_0x4e804c){var _0x487bab=null;var _0x1a0966=null;var _0x50087b=null;var _0x196b89=null;if(_0x48a2e2[_0x8ea2('0xc7')]['id']){delete _0x48a2e2[_0x8ea2('0xc7')]['id'];}if(_0x48a2e2[_0x8ea2('0xc7')][_0x8ea2('0xf6')]){_0x196b89=path[_0x8ea2('0xf0')](config[_0x8ea2('0xf1')],_0x8ea2('0xf7'),util['format']('transcript-%s.txt',Date[_0x8ea2('0xf8')]()));_0x48a2e2[_0x8ea2('0xc7')][_0x8ea2('0xf9')]=_0x196b89;}return db['ChatInteraction']['find']({'where':{'id':_0x48a2e2['params']['id']},'include':[{'model':db[_0x8ea2('0xda')],'as':'Messages','include':[{'model':db['User'],'as':_0x8ea2('0x7f')}]}]})[_0x8ea2('0x25')](handleEntityNotFound(_0x4e804c,null))['then'](saveUpdates(_0x48a2e2['body'],null))[_0x8ea2('0x25')](function(_0x48eac8){if(_0x48eac8){_0x487bab=_0x48eac8;return db['ChatWebsite'][_0x8ea2('0x71')]({'where':{'id':_0x487bab[_0x8ea2('0xcc')]}});}})[_0x8ea2('0x25')](function(_0x54da21){if(_0x54da21){_0x50087b=_0x54da21;return db[_0x8ea2('0xde')][_0x8ea2('0x71')]({'where':{'id':_0x487bab[_0x8ea2('0x7a')]}});}})[_0x8ea2('0x25')](function(_0x3a43d5){if(_0x3a43d5){_0x1a0966=_0x3a43d5;if(_0x196b89){var _0x535b01=null;for(var _0x22e4cd=0x1;_0x22e4cd<_0x487bab['Messages'][_0x8ea2('0x54')];++_0x22e4cd){_0x535b01=_0x487bab['Messages'][_0x22e4cd];var _0x230a70=_0x535b01['UserId']?util['format'](_0x8ea2('0xfa'),_0x50087b[_0x8ea2('0xfb')],_0x535b01[_0x8ea2('0x82')]):_0x8ea2('0xfc');var _0x332670=_0x48a2e2[_0x8ea2('0xc7')][_0x8ea2('0xfd')]||util[_0x8ea2('0xfe')]('%s%d',_0x8ea2('0xff'),_0x535b01[_0x8ea2('0x7a')]);switch(_0x50087b[_0x8ea2('0x100')]){case _0x8ea2('0x101'):_0x230a70=_0x535b01[_0x8ea2('0x82')]?util['format'](_0x8ea2('0xfa'),_0x50087b['agentAlias'],_0x535b01[_0x8ea2('0x82')]):'System';break;case _0x8ea2('0x102'):_0x230a70=_0x535b01[_0x8ea2('0x82')]?_0x535b01[_0x8ea2('0x7f')][_0x8ea2('0x103')]||_0x535b01['User']['fullname']:'System';break;case _0x8ea2('0x104'):_0x230a70=_0x535b01[_0x8ea2('0x82')]?_0x535b01['User'][_0x8ea2('0x105')]:_0x8ea2('0xfc');break;default:_0x230a70=_0x535b01[_0x8ea2('0x82')]?util[_0x8ea2('0xfe')](_0x8ea2('0xfa'),_0x50087b[_0x8ea2('0xfb')],_0x535b01[_0x8ea2('0x82')]):_0x8ea2('0xfc');}var _0x422280=util[_0x8ea2('0xfe')](_0x8ea2('0x106'),moment(_0x535b01[_0x8ea2('0x87')])[_0x8ea2('0xfe')]('MM/DD/YYYY\x20HH:mm:ss'),_0x535b01[_0x8ea2('0x107')]==='in'?_0x332670:_0x230a70,_0x535b01['body']);if(!_0x535b01['secret']){fs[_0x8ea2('0x108')](_0x196b89,_0x422280);}}return db['MailAccount'][_0x8ea2('0xca')]({'where':{'service':!![]},'include':[{'model':db[_0x8ea2('0x109')],'as':_0x8ea2('0x10a'),'raw':!![]}]});}}})[_0x8ea2('0x25')](function(_0xff0fae){if(_0xff0fae&&_0xff0fae['Smtp']&&_0x48a2e2[_0x8ea2('0xc7')]){var _0x3f5688={'tls':{'rejectUnauthorized':![]}};if(_0xff0fae[_0x8ea2('0x10a')]['service']){_0x3f5688['service']=_0xff0fae[_0x8ea2('0x10a')][_0x8ea2('0x10b')];}else{_0x3f5688['host']=_0xff0fae[_0x8ea2('0x10a')]['host'];_0x3f5688[_0x8ea2('0x10c')]=_0xff0fae[_0x8ea2('0x10a')][_0x8ea2('0x10c')];_0x3f5688[_0x8ea2('0x10d')]=_0xff0fae[_0x8ea2('0x10a')][_0x8ea2('0x10d')];}if(_0xff0fae[_0x8ea2('0x10a')][_0x8ea2('0x10e')]){_0x3f5688[_0x8ea2('0x10f')]={'user':_0xff0fae['Smtp']['user'],'pass':_0xff0fae[_0x8ea2('0x10a')]['pass']};}return respondWithRpcPromise(_0x8ea2('0x110'),_0x8ea2('0x111'),{'account':_0x3f5688,'message':{'from':util[_0x8ea2('0xfe')](_0x8ea2('0x112'),_0xff0fae['name'],_0xff0fae[_0x8ea2('0xd3')]||_0xff0fae[_0x8ea2('0x10a')]['user']),'to':_0x48a2e2[_0x8ea2('0xc7')][_0x8ea2('0xf6')],'subject':_0x8ea2('0x113'),'text':util['format']('Hi\x20%s,\x20attached\x20you\x20can\x20find\x20your\x20transcript\x20file.\x20\x0a\x0aRegards.\x20\x0a\x0a',_0x48a2e2['body'][_0x8ea2('0xf6')]),'attachments':[{'path':_0x196b89}]}})['then'](function(){return _0x487bab;})[_0x8ea2('0x2e')](function(_0x488acb){console[_0x8ea2('0x2b')](_0x488acb);});}else{return _0x487bab;}})[_0x8ea2('0x25')](respondWithStatusCode(_0x4e804c,0xc8))[_0x8ea2('0x2e')](handleError(_0x4e804c,null));};exports[_0x8ea2('0x114')]=function(_0x54925a,_0x295339,_0x55c23c){return db['ChatMessage']['find']({'where':{'id':_0x54925a[_0x8ea2('0xc3')]['id']}})[_0x8ea2('0x25')](handleEntityNotFound(_0x295339,null))[_0x8ea2('0x25')](function(_0x48b51d){if(_0x48b51d){return _0x48b51d[_0x8ea2('0x114')](_0x54925a[_0x8ea2('0xc7')][_0x8ea2('0x115')],_[_0x8ea2('0x116')](_0x54925a[_0x8ea2('0xc7')],[_0x8ea2('0x115'),'id'])||{});}})[_0x8ea2('0x25')](respondWithResult(_0x295339,null))[_0x8ea2('0x2e')](handleError(_0x295339,null));};exports[_0x8ea2('0x117')]=function(_0x102d70,_0x2b014d,_0xc35654){var _0x355b91={'raw':![],'where':{}};var _0x1cf414={};var _0x48e543={'count':0x0,'rows':[]};return db['ChatInteraction'][_0x8ea2('0xca')]({'where':{'id':_0x102d70['params']['id']}})[_0x8ea2('0x25')](handleEntityNotFound(_0x2b014d,null))[_0x8ea2('0x25')](function(_0x3ebbc8){if(_0x3ebbc8){_0x1cf414['model']=_[_0x8ea2('0x4f')](db['ChatMessage']['rawAttributes']);_0x1cf414[_0x8ea2('0x4e')]=_[_0x8ea2('0x4f')](_0x102d70[_0x8ea2('0x4e')]);_0x1cf414[_0x8ea2('0x50')]=_[_0x8ea2('0x51')](_0x1cf414[_0x8ea2('0x4d')],_0x1cf414[_0x8ea2('0x4e')]);_0x355b91['attributes']=_[_0x8ea2('0x51')](_0x1cf414[_0x8ea2('0x4d')],qs[_0x8ea2('0x53')](_0x102d70['query'][_0x8ea2('0x53')]));_0x355b91[_0x8ea2('0x52')]=_0x355b91[_0x8ea2('0x52')]['length']?_0x355b91[_0x8ea2('0x52')]:_0x1cf414[_0x8ea2('0x4d')];if(!_0x102d70[_0x8ea2('0x4e')]['hasOwnProperty']('nolimit')){_0x355b91[_0x8ea2('0x34')]=qs['limit'](_0x102d70[_0x8ea2('0x4e')]['limit']);_0x355b91[_0x8ea2('0x32')]=qs[_0x8ea2('0x32')](_0x102d70[_0x8ea2('0x4e')][_0x8ea2('0x32')]);}_0x355b91[_0x8ea2('0x57')]=qs['sort'](_0x102d70[_0x8ea2('0x4e')][_0x8ea2('0x58')]);_0x355b91[_0x8ea2('0x59')]=qs[_0x8ea2('0x50')](_[_0x8ea2('0x5a')](_0x102d70[_0x8ea2('0x4e')],_0x1cf414['filters']));_0x355b91['where'][_0x8ea2('0xc0')]=_0x3ebbc8['id'];if(_0x102d70[_0x8ea2('0x4e')]['filter']){_0x355b91[_0x8ea2('0x59')]=_[_0x8ea2('0x3d')](_0x355b91[_0x8ea2('0x59')],{'$or':_[_0x8ea2('0x43')](_0x355b91['attributes'],function(_0x19ea2b){var _0x4450e8={};_0x4450e8[_0x19ea2b]={'$like':'%'+_0x102d70['query'][_0x8ea2('0x94')]+'%'};return _0x4450e8;})});}if(_0x102d70['query'][_0x8ea2('0x89')]){var _0x479b40=_0x102d70['query'][_0x8ea2('0x89')][_0x8ea2('0x46')](',');var _0xbb5964={};_0xbb5964[_0x479b40[0x0]]={'$gte':moment(_0x479b40[0x1])[_0x8ea2('0xfe')]('YYYY-MM-DD\x20HH:mm:ss')};_0x355b91[_0x8ea2('0x59')]=_[_0x8ea2('0x3d')](_0x355b91[_0x8ea2('0x59')],_0xbb5964);}_0x355b91=_['merge']({},_0x355b91,_0x102d70[_0x8ea2('0xc5')]);return db[_0x8ea2('0xda')][_0x8ea2('0x35')]({'where':_0x355b91[_0x8ea2('0x59')]})[_0x8ea2('0x25')](function(_0x46d38e){_0x48e543[_0x8ea2('0x35')]=_0x46d38e;if(_0x102d70['query'][_0x8ea2('0xc4')]){_0x355b91[_0x8ea2('0x118')]=[{'all':!![]}];}return db[_0x8ea2('0xda')][_0x8ea2('0x119')](_0x355b91);})[_0x8ea2('0x25')](function(_0x23f247){_0x48e543[_0x8ea2('0x11a')]=_0x23f247;return _0x48e543;});}})[_0x8ea2('0x25')](respondWithFilteredResult(_0x2b014d,_0x355b91))[_0x8ea2('0x2e')](handleError(_0x2b014d,null));};exports[_0x8ea2('0x11b')]=function(_0x3a37fb,_0x455009,_0x556919){var _0x58a0e5={'where':{}},_0x3be2ce={},_0x56a973={'count':0x0,'rows':[]};return db[_0x8ea2('0x49')][_0x8ea2('0xca')]({'where':{'id':_0x3a37fb[_0x8ea2('0xc3')]['id']}})[_0x8ea2('0x25')](handleEntityNotFound(_0x455009,null))[_0x8ea2('0x25')](function(_0x515381){if(_0x515381){_0x3be2ce[_0x8ea2('0x4d')]=_[_0x8ea2('0x4f')](db['ChatMessage'][_0x8ea2('0x4a')]);_0x3be2ce[_0x8ea2('0x4e')]=_[_0x8ea2('0x4f')](_0x3a37fb[_0x8ea2('0x4e')]);_0x3be2ce['filters']=_[_0x8ea2('0x51')](_0x3be2ce[_0x8ea2('0x4d')],_0x3be2ce[_0x8ea2('0x4e')]);_0x58a0e5[_0x8ea2('0x52')]=_['intersection'](_0x3be2ce[_0x8ea2('0x4d')],qs[_0x8ea2('0x53')](_0x3a37fb[_0x8ea2('0x4e')]['fields']));_0x58a0e5[_0x8ea2('0x52')]=_0x58a0e5[_0x8ea2('0x52')][_0x8ea2('0x54')]?_0x58a0e5['attributes']:_0x3be2ce['model'];if(!_0x3a37fb[_0x8ea2('0x4e')]['hasOwnProperty'](_0x8ea2('0x56'))){_0x58a0e5[_0x8ea2('0x34')]=qs[_0x8ea2('0x34')](_0x3a37fb[_0x8ea2('0x4e')]['limit']);_0x58a0e5[_0x8ea2('0x32')]=qs['offset'](_0x3a37fb['query']['offset']);}_0x58a0e5['order']=qs[_0x8ea2('0x58')](_0x3a37fb[_0x8ea2('0x4e')][_0x8ea2('0x58')]);_0x58a0e5[_0x8ea2('0x59')]=qs[_0x8ea2('0x50')](_['pick'](_0x3a37fb['query'],_0x3be2ce[_0x8ea2('0x50')]));_0x58a0e5['where']['ChatInteractionId']=_0x515381['id'];if(_0x3a37fb[_0x8ea2('0x4e')][_0x8ea2('0x94')]){_0x58a0e5[_0x8ea2('0x59')]=_['merge'](_0x58a0e5[_0x8ea2('0x59')],{'$or':_['map'](_0x58a0e5[_0x8ea2('0x52')],function(_0x4041ec){var _0x56178b={};_0x56178b[_0x4041ec]={'$like':'%'+_0x3a37fb[_0x8ea2('0x4e')][_0x8ea2('0x94')]+'%'};return _0x56178b;})});}_0x58a0e5['where'][_0x8ea2('0x11c')]=![];if(_0x3a37fb[_0x8ea2('0x4e')]['id']){_0x58a0e5[_0x8ea2('0x59')]['id']={'$gt':_0x3a37fb[_0x8ea2('0x4e')]['id']};}_0x58a0e5=_[_0x8ea2('0x3d')]({},_0x58a0e5,_0x3a37fb[_0x8ea2('0xc5')]);return db[_0x8ea2('0xda')][_0x8ea2('0x35')]({'where':_0x58a0e5[_0x8ea2('0x59')]})['then'](function(_0xcedece){_0x56a973['count']=_0xcedece;_0x58a0e5[_0x8ea2('0x118')]=[];if(_0x3a37fb[_0x8ea2('0x4e')][_0x8ea2('0x11d')]){_0x58a0e5[_0x8ea2('0x118')][_0x8ea2('0xc1')]({'model':db[_0x8ea2('0x7f')],'as':_0x8ea2('0x7f'),'attributes':['id',_0x8ea2('0x105'),'alias']});}if(_0x3a37fb['query'][_0x8ea2('0xc4')]){_0x58a0e5[_0x8ea2('0x118')]=[{'all':!![]}];}return db[_0x8ea2('0xda')][_0x8ea2('0x119')](_0x58a0e5);})[_0x8ea2('0x25')](function(_0x52bf7c){_0x56a973[_0x8ea2('0x11a')]=_0x52bf7c;return _0x56a973;});}})[_0x8ea2('0x25')](respondWithFilteredResult(_0x455009,_0x58a0e5))['catch'](handleError(_0x455009,null));};exports[_0x8ea2('0x11e')]=function(_0x3be5d0,_0x3ac848,_0x52ce76){return db['ChatInteraction'][_0x8ea2('0x71')]({'where':{'id':_0x3be5d0['params']['id']}})[_0x8ea2('0x25')](handleEntityNotFound(_0x3ac848,null))[_0x8ea2('0x25')](function(_0x1030c9){if(_0x1030c9){return _0x1030c9[_0x8ea2('0x11f')](_0x3be5d0[_0x8ea2('0xc7')][_0x8ea2('0x115')],_[_0x8ea2('0x116')](_0x3be5d0[_0x8ea2('0xc7')],[_0x8ea2('0x115'),'id'])||{})[_0x8ea2('0x120')](function(){return db[_0x8ea2('0x7d')][_0x8ea2('0x119')]({'attributes':['id',_0x8ea2('0x3c'),_0x8ea2('0x5d')],'where':{'id':_0x3be5d0[_0x8ea2('0xc7')][_0x8ea2('0x115')]}});})[_0x8ea2('0x25')](function(_0x452b94){socket[_0x8ea2('0x121')]('chatInteractionTags:save',{'id':Number(_0x3be5d0['params']['id']),'tags':_0x452b94||[]});return{'id':Number(_0x3be5d0['params']['id']),'tags':_0x452b94||[]};});}})[_0x8ea2('0x25')](respondWithResult(_0x3ac848,null))[_0x8ea2('0x2e')](handleError(_0x3ac848,null));};exports[_0x8ea2('0x122')]=function(_0x9410dd,_0x497671,_0x5e3e8d){return db[_0x8ea2('0x49')]['find']({'where':{'id':_0x9410dd[_0x8ea2('0xc3')]['id']}})[_0x8ea2('0x25')](handleEntityNotFound(_0x497671,null))[_0x8ea2('0x25')](function(_0x19b042){if(_0x19b042){return _0x19b042[_0x8ea2('0x122')](_0x9410dd[_0x8ea2('0x4e')][_0x8ea2('0x115')]);}})['then'](respondWithStatusCode(_0x497671,null))[_0x8ea2('0x2e')](handleError(_0x497671,null));};exports[_0x8ea2('0xf4')]=function(_0x2dc450,_0x34e1c5){var _0x5b929c=moment()['unix']()[_0x8ea2('0xaa')]();var _0x263123=path[_0x8ea2('0xf0')](config['root'],'server',_0x8ea2('0x123'),'tmp');var _0x40e8e6=path[_0x8ea2('0xf0')](config[_0x8ea2('0xf1')],'server',_0x8ea2('0x123'),_0x8ea2('0x124'));var _0x2dfabc=path[_0x8ea2('0xf0')](_0x263123,_0x5b929c);var _0x515049=util['format'](_0x8ea2('0x125'),_0x2dc450[_0x8ea2('0xc3')]['id'],_0x5b929c);var _0x39000d=path['join'](_0x263123,_0x515049);var _0x3a1752=[];_0x3a1752['push']({'model':db[_0x8ea2('0x7f')],'as':'User','attributes':['id',_0x8ea2('0x105')],'raw':!![]});_0x3a1752['push']({'model':db[_0x8ea2('0xde')],'as':_0x8ea2('0x75'),'attributes':['id',_0x8ea2('0x126'),_0x8ea2('0x127')],'raw':!![]});if(_0x2dc450['query'][_0x8ea2('0x124')]){_0x3a1752[_0x8ea2('0xc1')]({'model':db[_0x8ea2('0xed')],'as':_0x8ea2('0xed'),'raw':!![]});}var _0x5ba508=[{'model':db[_0x8ea2('0xda')],'as':_0x8ea2('0x128'),'attributes':['id',_0x8ea2('0xc7'),_0x8ea2('0x87'),_0x8ea2('0x107'),'secret',_0x8ea2('0x129')],'include':_0x3a1752}];_0x5ba508[_0x8ea2('0xc1')]({'model':db[_0x8ea2('0xcb')],'as':_0x8ea2('0x12a'),'attributes':['id','name']});_0x5ba508[_0x8ea2('0xc1')]({'model':db[_0x8ea2('0x7f')],'as':'Owner','attributes':['id','fullname']});return db['ChatInteraction'][_0x8ea2('0x71')]({'where':{'id':_0x2dc450[_0x8ea2('0xc3')]['id']},'include':_0x5ba508})[_0x8ea2('0x25')](handleEntityNotFound(_0x34e1c5,null))[_0x8ea2('0x25')](function(_0x3c9013){if(_0x3c9013){var _0x103c43=_0x3c9013['get']({'plain':!![]});fs['mkdirSync'](_0x2dfabc);var _0xc099b6={'channel':_0x8ea2('0x12b'),'account':_0x103c43[_0x8ea2('0x12a')]['name'],'agent':_0x103c43['Owner']?_0x103c43[_0x8ea2('0x12c')][_0x8ea2('0x105')]:'N.A.','createdAt':moment(_0x103c43[_0x8ea2('0x87')])['format'](_0x8ea2('0x12d'))[_0x8ea2('0xaa')](),'closedAt':_0x103c43[_0x8ea2('0xeb')]?moment(_0x103c43['closedAt'])[_0x8ea2('0xfe')](_0x8ea2('0x12d'))['toString']():'','disposition':_0x103c43[_0x8ea2('0xe2')],'chatInfo':{'browser':_0x103c43[_0x8ea2('0x12e')],'os':_0x103c43['osName'],'referer':_0x103c43['referer'],'customerIp':_0x103c43[_0x8ea2('0x12f')],'customerPort':_0x103c43[_0x8ea2('0x130')]?_0x103c43[_0x8ea2('0x130')]:'N.A.'},'messages':_(_0x103c43[_0x8ea2('0x128')])[_0x8ea2('0x131')]()[_0x8ea2('0x94')]({'secret':![]})[_0x8ea2('0x43')](function(_0x36799a){if(_0x36799a['Attachment']){var _0x1cc1d9=path['join'](_0x40e8e6,_0x36799a[_0x8ea2('0xed')]['basename']);if(fs[_0x8ea2('0x132')](_0x1cc1d9)){fs[_0x8ea2('0x133')](_0x1cc1d9)[_0x8ea2('0x134')](fs[_0x8ea2('0x135')](path['join'](_0x2dfabc,_0x36799a[_0x8ea2('0xed')][_0x8ea2('0xe7')])));}}return{'date':moment(_0x36799a[_0x8ea2('0x87')])[_0x8ea2('0xfe')](_0x8ea2('0x12d'))[_0x8ea2('0xaa')](),'sender':_0x36799a[_0x8ea2('0x107')]===_0x8ea2('0x136')?_0x36799a[_0x8ea2('0x7f')]?_0x36799a[_0x8ea2('0x7f')][_0x8ea2('0x105')]:'System':_0x36799a[_0x8ea2('0x75')][_0x8ea2('0x126')]+(_0x36799a[_0x8ea2('0x75')]['lastName']?'\x20'+_0x36799a[_0x8ea2('0x75')][_0x8ea2('0x127')]:''),'body':_0x36799a[_0x8ea2('0xed')]?_0x36799a[_0x8ea2('0xed')][_0x8ea2('0xe7')]:_0x36799a[_0x8ea2('0xc7')],'direction':_0x36799a[_0x8ea2('0x107')]===_0x8ea2('0x136')?'A':'C','secret':_0x36799a[_0x8ea2('0x11c')],'read':_0x36799a[_0x8ea2('0x129')],'attachment':_0x36799a['Attachment']};})[_0x8ea2('0x77')]()};return ejs[_0x8ea2('0x137')](path[_0x8ea2('0xf0')](config[_0x8ea2('0xf1')],'server',_0x8ea2('0x138'),_0x8ea2('0x139')),{'interaction':_0xc099b6})[_0x8ea2('0x25')](function(_0x10d2b3){var _0x12a217=path[_0x8ea2('0xf0')](_0x2dfabc,_0x8ea2('0x13a')+_0x103c43['id']+'-'+_0x5b929c+'.pdf');var _0x44b0dc={'path':_0x12a217,'channel':_0x8ea2('0x12b'),'interactionId':_0x103c43['id']};return pdf['createPdfFromHTML'](_0x10d2b3,_0x44b0dc);})[_0x8ea2('0x25')](function(){return new BPromise(function(_0x27f5e9,_0x19b678){zipdir(_0x2dfabc,{'saveTo':_0x39000d},function(_0x50ebcd,_0x5d6c63){if(_0x50ebcd)return _0x19b678(_0x50ebcd);return _0x27f5e9(_0x5d6c63);});})[_0x8ea2('0x25')](function(){return new BPromise(function(_0x55b3a1,_0x57e228){rimraf(_0x2dfabc,function(_0x3c669b){if(_0x3c669b)_0x57e228(_0x3c669b);return _0x55b3a1();});});})[_0x8ea2('0x25')](function(){return _0x34e1c5['download'](_0x39000d,_0x515049,function(_0x688d21){if(_0x688d21){console[_0x8ea2('0x13b')]('err',_0x688d21);}else{fs[_0x8ea2('0x13c')](_0x39000d);}});});});}else{return _0x34e1c5['sendStatus'](0xc8);}})[_0x8ea2('0x2e')](handleError(_0x34e1c5,null));};
\ No newline at end of file
diff --git a/server/api/chatInteraction/chatInteraction.events.js b/server/api/chatInteraction/chatInteraction.events.js
index 820c0f9..af2c8f2 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 _0xa391=['setMaxListeners','save','update','getUsers','then','setDataValue','Users','map','findAll','length','emit','catch','hook','exports','events','ChatInteraction','../../mysqldb','ChatMessage'];(function(_0x442365,_0x20c8ed){var _0xaa5e6=function(_0x1220da){while(--_0x1220da){_0x442365['push'](_0x442365['shift']());}};_0xaa5e6(++_0x20c8ed);}(_0xa391,0x188));var _0x1a39=function(_0x68c979,_0x431cff){_0x68c979=_0x68c979-0x0;var _0x4f0001=_0xa391[_0x68c979];return _0x4f0001;};'use strict';var EventEmitter=require(_0x1a39('0x0'));var ChatInteraction=require('../../mysqldb')['db'][_0x1a39('0x1')];var ChatMessage=require(_0x1a39('0x2'))['db'][_0x1a39('0x3')];var ChatInteractionEvents=new EventEmitter();ChatInteractionEvents[_0x1a39('0x4')](0x0);var events={'afterCreate':_0x1a39('0x5'),'afterUpdate':_0x1a39('0x6'),'afterDestroy':'remove'};function emitEvent(_0x1180eb){return function(_0x2cb431,_0x2f57a4,_0x195e28){_0x2cb431[_0x1a39('0x7')]({'attributes':['id'],'raw':!![]})[_0x1a39('0x8')](function(_0x3e60ba){_0x2cb431[_0x1a39('0x9')](_0x1a39('0xa'),_0x3e60ba[_0x1a39('0xb')](function(_0x5fe7ad){return{'id':_0x5fe7ad['id']};}));return ChatMessage[_0x1a39('0xc')]({'where':{'ChatInteractionId':_0x2cb431['id'],'direction':'in','read':![]},'raw':!![]});})[_0x1a39('0x8')](function(_0x38b0bf){_0x2cb431[_0x1a39('0x9')]('unreadMessages',_0x38b0bf[_0x1a39('0xd')]);ChatInteractionEvents[_0x1a39('0xe')](_0x1180eb+':'+_0x2cb431['id'],_0x2cb431);ChatInteractionEvents[_0x1a39('0xe')](_0x1180eb,_0x2cb431);_0x195e28(null);})[_0x1a39('0xf')](_0x195e28(null));};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];ChatInteraction[_0x1a39('0x10')](e,emitEvent(event));}}module[_0x1a39('0x11')]=ChatInteractionEvents;
\ No newline at end of file
+var _0xc7e5=['hook','exports','../../mysqldb','ChatMessage','update','remove','Users','map','findAll','then','setDataValue','unreadMessages','length','emit','catch','hasOwnProperty'];(function(_0x5ddb1c,_0x5ea4df){var _0x354adc=function(_0x2dfb1f){while(--_0x2dfb1f){_0x5ddb1c['push'](_0x5ddb1c['shift']());}};_0x354adc(++_0x5ea4df);}(_0xc7e5,0xf2));var _0x5c7e=function(_0x502849,_0x13391f){_0x502849=_0x502849-0x0;var _0x54d0f9=_0xc7e5[_0x502849];return _0x54d0f9;};'use strict';var EventEmitter=require('events');var ChatInteraction=require(_0x5c7e('0x0'))['db']['ChatInteraction'];var ChatMessage=require(_0x5c7e('0x0'))['db'][_0x5c7e('0x1')];var ChatInteractionEvents=new EventEmitter();ChatInteractionEvents['setMaxListeners'](0x0);var events={'afterCreate':'save','afterUpdate':_0x5c7e('0x2'),'afterDestroy':_0x5c7e('0x3')};function emitEvent(_0x54b97b){return function(_0x2be715,_0x13221c,_0x30be10){_0x2be715['getUsers']({'attributes':['id'],'raw':!![]})['then'](function(_0x8646a8){_0x2be715['setDataValue'](_0x5c7e('0x4'),_0x8646a8[_0x5c7e('0x5')](function(_0x5e7ed5){return{'id':_0x5e7ed5['id']};}));return ChatMessage[_0x5c7e('0x6')]({'where':{'ChatInteractionId':_0x2be715['id'],'direction':'in','read':![]},'raw':!![]});})[_0x5c7e('0x7')](function(_0x449316){_0x2be715[_0x5c7e('0x8')](_0x5c7e('0x9'),_0x449316[_0x5c7e('0xa')]);ChatInteractionEvents[_0x5c7e('0xb')](_0x54b97b+':'+_0x2be715['id'],_0x2be715);ChatInteractionEvents[_0x5c7e('0xb')](_0x54b97b,_0x2be715);_0x30be10(null);})[_0x5c7e('0xc')](_0x30be10(null));};}for(var e in events){if(events[_0x5c7e('0xd')](e)){var event=events[e];ChatInteraction[_0x5c7e('0xe')](e,emitEvent(event));}}module[_0x5c7e('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 15e53e5..18bbe86 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 _0x4ba0=['exports','ChatInteraction','chat_interactions','changed','closed','format','YYYY-MM-DD\x20HH:mm:ss','utf8mb4','utf8mb4_unicode_ci','lodash','util','moment','bluebird','path','rimraf','../../config/environment','./chatInteraction.attributes'];(function(_0x56ebfc,_0x87cf63){var _0x485816=function(_0x44bfb6){while(--_0x44bfb6){_0x56ebfc['push'](_0x56ebfc['shift']());}};_0x485816(++_0x87cf63);}(_0x4ba0,0xf7));var _0x04ba=function(_0x2e4e19,_0x493b50){_0x2e4e19=_0x2e4e19-0x0;var _0x9ba20b=_0x4ba0[_0x2e4e19];return _0x9ba20b;};'use strict';var _=require(_0x04ba('0x0'));var util=require(_0x04ba('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0x04ba('0x2'));var BPromise=require(_0x04ba('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x04ba('0x4'));var rimraf=require(_0x04ba('0x5'));var config=require(_0x04ba('0x6'));var attributes=require(_0x04ba('0x7'));module[_0x04ba('0x8')]=function(_0x54d1fe,_0x867bd4){return _0x54d1fe['define'](_0x04ba('0x9'),attributes,{'tableName':_0x04ba('0xa'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x14ef84,_0x33d19e,_0xf785c4){if(_0x14ef84[_0x04ba('0xb')](_0x04ba('0xc'))){_0x14ef84['closedAt']=moment()[_0x04ba('0xd')](_0x04ba('0xe'));}_0xf785c4(null,_0x14ef84);}},'charset':_0x04ba('0xf'),'collate':_0x04ba('0x10')});};
\ No newline at end of file
+var _0x8dd5=['closed','closedAt','format','utf8mb4_unicode_ci','lodash','util','../../config/logger','api','request-promise','path','rimraf','../../config/environment','./chatInteraction.attributes','exports','define','ChatInteraction','chat_interactions'];(function(_0x3bf83f,_0x181cac){var _0x22c4a9=function(_0xb3ff0d){while(--_0xb3ff0d){_0x3bf83f['push'](_0x3bf83f['shift']());}};_0x22c4a9(++_0x181cac);}(_0x8dd5,0xe1));var _0x58dd=function(_0x2b4448,_0x5bcc69){_0x2b4448=_0x2b4448-0x0;var _0xb4b465=_0x8dd5[_0x2b4448];return _0xb4b465;};'use strict';var _=require(_0x58dd('0x0'));var util=require(_0x58dd('0x1'));var logger=require(_0x58dd('0x2'))(_0x58dd('0x3'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x58dd('0x4'));var fs=require('fs');var path=require(_0x58dd('0x5'));var rimraf=require(_0x58dd('0x6'));var config=require(_0x58dd('0x7'));var attributes=require(_0x58dd('0x8'));module[_0x58dd('0x9')]=function(_0x4d02bd,_0x299601){return _0x4d02bd[_0x58dd('0xa')](_0x58dd('0xb'),attributes,{'tableName':_0x58dd('0xc'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x524e3d,_0x32838c,_0x217f00){if(_0x524e3d['changed'](_0x58dd('0xd'))){_0x524e3d[_0x58dd('0xe')]=moment()[_0x58dd('0xf')]('YYYY-MM-DD\x20HH:mm:ss');}_0x217f00(null,_0x524e3d);}},'charset':'utf8mb4','collate':_0x58dd('0x10')});};
\ No newline at end of file
diff --git a/server/api/chatInteraction/chatInteraction.rpc.js b/server/api/chatInteraction/chatInteraction.rpc.js
index 77149b7..3216a9d 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 _0x5b8e=['then','ids','spread','AddTags','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','defaults','redis','socket.io-emitter','./chatInteraction.socket','register','info','ChatInteraction,\x20%s,\x20%s','debug','request\x20sent','stringify','error','code','message','result','UpdateChatInteraction','ChatInteraction','body','options','raw','where','attributes','limit','catch','AddTagsToChatInteraction'];(function(_0x3af48d,_0x3b45e2){var _0x1108ab=function(_0x2d5b8f){while(--_0x2d5b8f){_0x3af48d['push'](_0x3af48d['shift']());}};_0x1108ab(++_0x3b45e2);}(_0x5b8e,0x1bc));var _0xe5b8=function(_0x23dda5,_0x221860){_0x23dda5=_0x23dda5-0x0;var _0x32c24e=_0x5b8e[_0x23dda5];return _0x32c24e;};'use strict';var _=require(_0xe5b8('0x0'));var util=require(_0xe5b8('0x1'));var moment=require(_0xe5b8('0x2'));var BPromise=require(_0xe5b8('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xe5b8('0x4'));var db=require(_0xe5b8('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0xe5b8('0x6'))(_0xe5b8('0x7'));var config=require(_0xe5b8('0x8'));var jayson=require(_0xe5b8('0x9'));var client=jayson[_0xe5b8('0xa')][_0xe5b8('0xb')]({'port':0x232a});config['redis']=_[_0xe5b8('0xc')](config[_0xe5b8('0xd')],{'host':'localhost','port':0x18eb});var socket=require(_0xe5b8('0xe'))(new Redis(config[_0xe5b8('0xd')]));require(_0xe5b8('0xf'))[_0xe5b8('0x10')](socket);function respondWithRpcPromise(_0x58f871,_0x1e1a56,_0x41e9aa){return new BPromise(function(_0x4c641a,_0x24ee5f){return client['request'](_0x58f871,_0x41e9aa)['then'](function(_0x3d4037){logger[_0xe5b8('0x11')](_0xe5b8('0x12'),_0x1e1a56,'request\x20sent');logger[_0xe5b8('0x13')]('ChatInteraction,\x20%s,\x20%s,\x20%s',_0x1e1a56,_0xe5b8('0x14'),JSON[_0xe5b8('0x15')](_0x3d4037));if(_0x3d4037[_0xe5b8('0x16')]){if(_0x3d4037[_0xe5b8('0x16')][_0xe5b8('0x17')]===0x1f4){logger[_0xe5b8('0x16')](_0xe5b8('0x12'),_0x1e1a56,_0x3d4037[_0xe5b8('0x16')][_0xe5b8('0x18')]);return _0x24ee5f(_0x3d4037[_0xe5b8('0x16')]['message']);}logger[_0xe5b8('0x16')](_0xe5b8('0x12'),_0x1e1a56,_0x3d4037[_0xe5b8('0x16')][_0xe5b8('0x18')]);return _0x4c641a(_0x3d4037['error']['message']);}else{logger[_0xe5b8('0x11')](_0xe5b8('0x12'),_0x1e1a56,_0xe5b8('0x14'));_0x4c641a(_0x3d4037[_0xe5b8('0x19')][_0xe5b8('0x18')]);}})['catch'](function(_0x24667e){logger['error']('ChatInteraction,\x20%s,\x20%s',_0x1e1a56,_0x24667e);_0x24ee5f(_0x24667e);});});}exports[_0xe5b8('0x1a')]=function(_0x1c25e0){var _0x310d4f=this;return new Promise(function(_0x28d9be,_0x3e7011){return db[_0xe5b8('0x1b')]['update'](_0x1c25e0[_0xe5b8('0x1c')],{'raw':_0x1c25e0[_0xe5b8('0x1d')]?_0x1c25e0[_0xe5b8('0x1d')][_0xe5b8('0x1e')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x1c25e0[_0xe5b8('0x1d')]?_0x1c25e0['options'][_0xe5b8('0x1f')]||null:null,'attributes':_0x1c25e0[_0xe5b8('0x1d')]?_0x1c25e0[_0xe5b8('0x1d')][_0xe5b8('0x20')]||null:null,'limit':_0x1c25e0['options']?_0x1c25e0[_0xe5b8('0x1d')][_0xe5b8('0x21')]||null:null})['then'](function(_0x48543f){logger[_0xe5b8('0x11')](_0xe5b8('0x1a'),_0x1c25e0);logger[_0xe5b8('0x13')]('UpdateChatInteraction',_0x1c25e0,JSON[_0xe5b8('0x15')](_0x48543f));_0x28d9be(_0x48543f);})[_0xe5b8('0x22')](function(_0x1f122c){logger['error'](_0xe5b8('0x1a'),_0x1f122c[_0xe5b8('0x18')],_0x1c25e0);_0x3e7011(_0x310d4f['error'](0x1f4,_0x1f122c[_0xe5b8('0x18')]));});});};exports[_0xe5b8('0x23')]=function(_0x37bb2f){return new Promise(function(_0x5cd549,_0x115d42){return db['ChatInteraction']['find']({'where':_0x37bb2f[_0xe5b8('0x1d')]?_0x37bb2f[_0xe5b8('0x1d')]['where']||null:null})[_0xe5b8('0x24')](function(_0x36eb2b){if(_0x36eb2b){return _0x36eb2b['addTags'](_0x37bb2f[_0xe5b8('0x1c')]['ids'],_['omit'](_0x37bb2f[_0xe5b8('0x1c')],[_0xe5b8('0x25'),'id'])||{});}})[_0xe5b8('0x26')](function(_0x2a003c){logger['info']('AddTags',_0x37bb2f);logger[_0xe5b8('0x13')](_0xe5b8('0x27'),_0x37bb2f,JSON[_0xe5b8('0x15')](_0x2a003c));_0x5cd549(_0x2a003c);})[_0xe5b8('0x22')](function(_0x1ae84a){logger[_0xe5b8('0x16')](_0xe5b8('0x27'),_0x1ae84a[_0xe5b8('0x18')],_0x37bb2f);_0x115d42(_this[_0xe5b8('0x16')](0x1f4,_0x1ae84a[_0xe5b8('0x18')]));});});};
\ No newline at end of file
+var _0x7bc7=['randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','./chatInteraction.socket','register','then','info','ChatInteraction,\x20%s,\x20%s','debug','request\x20sent','error','code','message','catch','UpdateChatInteraction','ChatInteraction','update','options','raw','attributes','limit','stringify','AddTagsToChatInteraction','addTags','ids','omit','body','AddTags','lodash','util','moment','bluebird'];(function(_0xaeb1b9,_0x20830a){var _0xcdbe94=function(_0x125e67){while(--_0x125e67){_0xaeb1b9['push'](_0xaeb1b9['shift']());}};_0xcdbe94(++_0x20830a);}(_0x7bc7,0xf2));var _0x77bc=function(_0x4b5288,_0x10d3ea){_0x4b5288=_0x4b5288-0x0;var _0x25bf4c=_0x7bc7[_0x4b5288];return _0x25bf4c;};'use strict';var _=require(_0x77bc('0x0'));var util=require(_0x77bc('0x1'));var moment=require(_0x77bc('0x2'));var BPromise=require(_0x77bc('0x3'));var rs=require(_0x77bc('0x4'));var fs=require('fs');var Redis=require(_0x77bc('0x5'));var db=require(_0x77bc('0x6'))['db'];var utils=require(_0x77bc('0x7'));var logger=require(_0x77bc('0x8'))('rpc');var config=require(_0x77bc('0x9'));var jayson=require(_0x77bc('0xa'));var client=jayson[_0x77bc('0xb')][_0x77bc('0xc')]({'port':0x232a});config[_0x77bc('0xd')]=_[_0x77bc('0xe')](config['redis'],{'host':_0x77bc('0xf'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x77bc('0xd')]));require(_0x77bc('0x10'))[_0x77bc('0x11')](socket);function respondWithRpcPromise(_0x386c5c,_0x177e50,_0xe5fa85){return new BPromise(function(_0x34007a,_0xca1c63){return client['request'](_0x386c5c,_0xe5fa85)[_0x77bc('0x12')](function(_0x302bb5){logger[_0x77bc('0x13')](_0x77bc('0x14'),_0x177e50,'request\x20sent');logger[_0x77bc('0x15')]('ChatInteraction,\x20%s,\x20%s,\x20%s',_0x177e50,_0x77bc('0x16'),JSON['stringify'](_0x302bb5));if(_0x302bb5[_0x77bc('0x17')]){if(_0x302bb5[_0x77bc('0x17')][_0x77bc('0x18')]===0x1f4){logger[_0x77bc('0x17')](_0x77bc('0x14'),_0x177e50,_0x302bb5[_0x77bc('0x17')][_0x77bc('0x19')]);return _0xca1c63(_0x302bb5[_0x77bc('0x17')]['message']);}logger[_0x77bc('0x17')]('ChatInteraction,\x20%s,\x20%s',_0x177e50,_0x302bb5[_0x77bc('0x17')][_0x77bc('0x19')]);return _0x34007a(_0x302bb5[_0x77bc('0x17')]['message']);}else{logger[_0x77bc('0x13')]('ChatInteraction,\x20%s,\x20%s',_0x177e50,_0x77bc('0x16'));_0x34007a(_0x302bb5['result'][_0x77bc('0x19')]);}})[_0x77bc('0x1a')](function(_0x12d9fc){logger[_0x77bc('0x17')]('ChatInteraction,\x20%s,\x20%s',_0x177e50,_0x12d9fc);_0xca1c63(_0x12d9fc);});});}exports[_0x77bc('0x1b')]=function(_0x503567){var _0x2c8c71=this;return new Promise(function(_0xbefe87,_0x4cef05){return db[_0x77bc('0x1c')][_0x77bc('0x1d')](_0x503567['body'],{'raw':_0x503567[_0x77bc('0x1e')]?_0x503567['options'][_0x77bc('0x1f')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x503567['options']?_0x503567[_0x77bc('0x1e')]['where']||null:null,'attributes':_0x503567['options']?_0x503567['options'][_0x77bc('0x20')]||null:null,'limit':_0x503567['options']?_0x503567['options'][_0x77bc('0x21')]||null:null})[_0x77bc('0x12')](function(_0x1726e5){logger[_0x77bc('0x13')]('UpdateChatInteraction',_0x503567);logger['debug'](_0x77bc('0x1b'),_0x503567,JSON[_0x77bc('0x22')](_0x1726e5));_0xbefe87(_0x1726e5);})[_0x77bc('0x1a')](function(_0x1ce0bb){logger[_0x77bc('0x17')]('UpdateChatInteraction',_0x1ce0bb[_0x77bc('0x19')],_0x503567);_0x4cef05(_0x2c8c71[_0x77bc('0x17')](0x1f4,_0x1ce0bb['message']));});});};exports[_0x77bc('0x23')]=function(_0x1bc303){return new Promise(function(_0x92acf9,_0x295eb4){return db[_0x77bc('0x1c')]['find']({'where':_0x1bc303[_0x77bc('0x1e')]?_0x1bc303[_0x77bc('0x1e')]['where']||null:null})['then'](function(_0x4ef0b4){if(_0x4ef0b4){return _0x4ef0b4[_0x77bc('0x24')](_0x1bc303['body'][_0x77bc('0x25')],_[_0x77bc('0x26')](_0x1bc303[_0x77bc('0x27')],['ids','id'])||{});}})['spread'](function(_0x4be764){logger['info']('AddTags',_0x1bc303);logger['debug']('AddTags',_0x1bc303,JSON['stringify'](_0x4be764));_0x92acf9(_0x4be764);})[_0x77bc('0x1a')](function(_0x504878){logger[_0x77bc('0x17')](_0x77bc('0x28'),_0x504878[_0x77bc('0x19')],_0x1bc303);_0x295eb4(_this[_0x77bc('0x17')](0x1f4,_0x504878[_0x77bc('0x19')]));});});};
\ No newline at end of file
diff --git a/server/api/chatInteraction/chatInteraction.socket.js b/server/api/chatInteraction/chatInteraction.socket.js
index 41f4fc1..c292639 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 _0xacda=['removeListener','register','length','chatInteraction:','./chatInteraction.events','save','remove','update'];(function(_0x20d6f0,_0x33e54c){var _0x105ceb=function(_0x4927e9){while(--_0x4927e9){_0x20d6f0['push'](_0x20d6f0['shift']());}};_0x105ceb(++_0x33e54c);}(_0xacda,0x7c));var _0xaacd=function(_0xec77c5,_0x3d51cb){_0xec77c5=_0xec77c5-0x0;var _0x3868f1=_0xacda[_0xec77c5];return _0x3868f1;};'use strict';var ChatInteractionEvents=require(_0xaacd('0x0'));var events=[_0xaacd('0x1'),_0xaacd('0x2'),_0xaacd('0x3')];function createListener(_0x5d2850,_0x4c9cd6){return function(_0x28ea09){_0x4c9cd6['emit'](_0x5d2850,_0x28ea09);};}function removeListener(_0x28b418,_0x447e4f){return function(){ChatInteractionEvents[_0xaacd('0x4')](_0x28b418,_0x447e4f);};}exports[_0xaacd('0x5')]=function(_0x1486f0){for(var _0x1ee8f3=0x0,_0x4899c1=events[_0xaacd('0x6')];_0x1ee8f3<_0x4899c1;_0x1ee8f3++){var _0x362ccf=events[_0x1ee8f3];var _0x231ec4=createListener(_0xaacd('0x7')+_0x362ccf,_0x1486f0);ChatInteractionEvents['on'](_0x362ccf,_0x231ec4);}};
\ No newline at end of file
+var _0x0896=['length','chatInteraction:','./chatInteraction.events','save','remove','update','emit','removeListener','register'];(function(_0x32aa36,_0x53b8a4){var _0xf1ca83=function(_0x2e7e62){while(--_0x2e7e62){_0x32aa36['push'](_0x32aa36['shift']());}};_0xf1ca83(++_0x53b8a4);}(_0x0896,0xc8));var _0x6089=function(_0x291905,_0x20e0e0){_0x291905=_0x291905-0x0;var _0x27ce23=_0x0896[_0x291905];return _0x27ce23;};'use strict';var ChatInteractionEvents=require(_0x6089('0x0'));var events=[_0x6089('0x1'),_0x6089('0x2'),_0x6089('0x3')];function createListener(_0x438261,_0xec47f9){return function(_0x370935){_0xec47f9[_0x6089('0x4')](_0x438261,_0x370935);};}function removeListener(_0x395d6a,_0x41a384){return function(){ChatInteractionEvents[_0x6089('0x5')](_0x395d6a,_0x41a384);};}exports[_0x6089('0x6')]=function(_0x4210ef){for(var _0x39d1e3=0x0,_0x17e3a2=events[_0x6089('0x7')];_0x39d1e3<_0x17e3a2;_0x39d1e3++){var _0x2370e6=events[_0x39d1e3];var _0x3e6950=createListener(_0x6089('0x8')+_0x2370e6,_0x4210ef);ChatInteractionEvents['on'](_0x2370e6,_0x3e6950);}};
\ No newline at end of file
diff --git a/server/api/chatInteraction/index.js b/server/api/chatInteraction/index.js
index e5e54aa..89221b2 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 _0xb28e=['server/files/attachments/','format','now','originalname','replace','/:id/attachment_upload','single','file','attachmentUpload','addMessage','/:id/tags','tracked','chat','chatinteraction:addtags','addTags','put','/:id','chatinteraction:update','update','/:id/custom_update','abandon','/:id/close','close','destroy','delete','removeTags','multer','path','connect-timeout','express','../../components/interaction/service','../../config/environment','./chatInteraction.controller','get','isAuthenticated','index','/describe','describe','isChatInteractionAuthorized','show','/:id/attachment_download','/:id/messages','getMessages','/:id/my_messages','/:id/download','post','create','/:id/vidaoo','diskStorage','join','root'];(function(_0x4420e7,_0x503ae9){var _0x3cfad0=function(_0xd98647){while(--_0xd98647){_0x4420e7['push'](_0x4420e7['shift']());}};_0x3cfad0(++_0x503ae9);}(_0xb28e,0xb3));var _0xeb28=function(_0x57d562,_0x379b0b){_0x57d562=_0x57d562-0x0;var _0x17ac79=_0xb28e[_0x57d562];return _0x17ac79;};'use strict';var multer=require(_0xeb28('0x0'));var util=require('util');var path=require(_0xeb28('0x1'));var timeout=require(_0xeb28('0x2'));var express=require(_0xeb28('0x3'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0xeb28('0x4'));var config=require(_0xeb28('0x5'));var controller=require(_0xeb28('0x6'));router[_0xeb28('0x7')]('/',auth[_0xeb28('0x8')](),controller[_0xeb28('0x9')]);router['get'](_0xeb28('0xa'),auth['isAuthenticated'](),controller[_0xeb28('0xb')]);router[_0xeb28('0x7')]('/:id',auth[_0xeb28('0xc')](),controller[_0xeb28('0xd')]);router[_0xeb28('0x7')](_0xeb28('0xe'),auth[_0xeb28('0xc')](),controller['attachmentDownload']);router[_0xeb28('0x7')](_0xeb28('0xf'),auth[_0xeb28('0x8')](),controller[_0xeb28('0x10')]);router[_0xeb28('0x7')](_0xeb28('0x11'),auth[_0xeb28('0xc')](),controller['getMyMessages']);router[_0xeb28('0x7')](_0xeb28('0x12'),auth[_0xeb28('0x8')](),controller['download']);router[_0xeb28('0x13')]('/',auth[_0xeb28('0x8')](),controller[_0xeb28('0x14')]);router[_0xeb28('0x13')](_0xeb28('0x15'),auth['isAuthenticated'](),controller['createVidaooSession']);var upload=multer({'storage':multer[_0xeb28('0x16')]({'destination':function(_0x23d12b,_0x21e130,_0x2cfa40){_0x2cfa40(null,path[_0xeb28('0x17')](config[_0xeb28('0x18')],_0xeb28('0x19')));},'filename':function(_0x12728f,_0x2162bf,_0x4a8d04){_0x4a8d04(null,util[_0xeb28('0x1a')]('%s-%s',Date[_0xeb28('0x1b')](),_0x2162bf[_0xeb28('0x1c')][_0xeb28('0x1d')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-')));}})});router[_0xeb28('0x13')](_0xeb28('0x1e'),upload[_0xeb28('0x1f')](_0xeb28('0x20')),controller[_0xeb28('0x21')]);router[_0xeb28('0x13')](_0xeb28('0xf'),auth[_0xeb28('0xc')](),controller[_0xeb28('0x22')]);router[_0xeb28('0x13')](_0xeb28('0x23'),auth[_0xeb28('0x8')](),interaction[_0xeb28('0x24')](_0xeb28('0x25'),_0xeb28('0x26')),controller[_0xeb28('0x27')]);router[_0xeb28('0x28')](_0xeb28('0x29'),auth[_0xeb28('0x8')](),interaction[_0xeb28('0x24')](_0xeb28('0x25'),_0xeb28('0x2a')),controller[_0xeb28('0x2b')]);router[_0xeb28('0x28')](_0xeb28('0x2c'),controller['customUpdate']);router['put']('/:id/abandon',auth[_0xeb28('0xc')](),controller[_0xeb28('0x2d')]);router['put'](_0xeb28('0x2e'),controller[_0xeb28('0x2f')]);router['delete'](_0xeb28('0x29'),auth[_0xeb28('0x8')](),interaction[_0xeb28('0x24')](_0xeb28('0x25'),'chatinteraction:destroy'),controller[_0xeb28('0x30')]);router[_0xeb28('0x31')](_0xeb28('0x23'),auth[_0xeb28('0x8')](),controller[_0xeb28('0x32')]);module['exports']=router;
\ No newline at end of file
+var _0xa616=['isChatInteractionAuthorized','show','attachmentDownload','/:id/messages','getMessages','/:id/my_messages','download','create','post','/:id/vidaoo','createVidaooSession','diskStorage','join','server/files/attachments/','format','now','originalname','replace','/:id/attachment_upload','single','/:id/tags','tracked','/:id','chat','update','put','/:id/custom_update','customUpdate','abandon','/:id/close','close','delete','destroy','exports','multer','util','Router','../../components/auth/service','../../config/environment','./chatInteraction.controller','isAuthenticated','index','/describe','describe','get'];(function(_0x68ee8b,_0x3cc6c5){var _0x5148f7=function(_0x5dcbd5){while(--_0x5dcbd5){_0x68ee8b['push'](_0x68ee8b['shift']());}};_0x5148f7(++_0x3cc6c5);}(_0xa616,0x103));var _0x6a61=function(_0x9d2d2,_0x1c1c2c){_0x9d2d2=_0x9d2d2-0x0;var _0x488242=_0xa616[_0x9d2d2];return _0x488242;};'use strict';var multer=require(_0x6a61('0x0'));var util=require(_0x6a61('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require('express');var router=express[_0x6a61('0x2')]();var fs_extra=require('fs-extra');var auth=require(_0x6a61('0x3'));var interaction=require('../../components/interaction/service');var config=require(_0x6a61('0x4'));var controller=require(_0x6a61('0x5'));router['get']('/',auth[_0x6a61('0x6')](),controller[_0x6a61('0x7')]);router['get'](_0x6a61('0x8'),auth['isAuthenticated'](),controller[_0x6a61('0x9')]);router[_0x6a61('0xa')]('/:id',auth[_0x6a61('0xb')](),controller[_0x6a61('0xc')]);router[_0x6a61('0xa')]('/:id/attachment_download',auth[_0x6a61('0xb')](),controller[_0x6a61('0xd')]);router['get'](_0x6a61('0xe'),auth[_0x6a61('0x6')](),controller[_0x6a61('0xf')]);router['get'](_0x6a61('0x10'),auth[_0x6a61('0xb')](),controller['getMyMessages']);router['get']('/:id/download',auth['isAuthenticated'](),controller[_0x6a61('0x11')]);router['post']('/',auth[_0x6a61('0x6')](),controller[_0x6a61('0x12')]);router[_0x6a61('0x13')](_0x6a61('0x14'),auth[_0x6a61('0x6')](),controller[_0x6a61('0x15')]);var upload=multer({'storage':multer[_0x6a61('0x16')]({'destination':function(_0x478ec3,_0x48e602,_0x565644){_0x565644(null,path[_0x6a61('0x17')](config['root'],_0x6a61('0x18')));},'filename':function(_0x37dee8,_0x3ed6b8,_0x11aec7){_0x11aec7(null,util[_0x6a61('0x19')]('%s-%s',Date[_0x6a61('0x1a')](),_0x3ed6b8[_0x6a61('0x1b')][_0x6a61('0x1c')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-')));}})});router[_0x6a61('0x13')](_0x6a61('0x1d'),upload[_0x6a61('0x1e')]('file'),controller['attachmentUpload']);router['post']('/:id/messages',auth['isChatInteractionAuthorized'](),controller['addMessage']);router[_0x6a61('0x13')](_0x6a61('0x1f'),auth[_0x6a61('0x6')](),interaction[_0x6a61('0x20')]('chat','chatinteraction:addtags'),controller['addTags']);router['put'](_0x6a61('0x21'),auth['isAuthenticated'](),interaction[_0x6a61('0x20')](_0x6a61('0x22'),'chatinteraction:update'),controller[_0x6a61('0x23')]);router[_0x6a61('0x24')](_0x6a61('0x25'),controller[_0x6a61('0x26')]);router['put']('/:id/abandon',auth[_0x6a61('0xb')](),controller[_0x6a61('0x27')]);router[_0x6a61('0x24')](_0x6a61('0x28'),controller[_0x6a61('0x29')]);router[_0x6a61('0x2a')](_0x6a61('0x21'),auth[_0x6a61('0x6')](),interaction['tracked']('chat','chatinteraction:destroy'),controller[_0x6a61('0x2b')]);router[_0x6a61('0x2a')]('/:id/tags',auth[_0x6a61('0x6')](),controller['removeTags']);module[_0x6a61('0x2c')]=router;
\ No newline at end of file
diff --git a/server/api/chatInternalMessage/chatInternalMessage.attributes.js b/server/api/chatInternalMessage/chatInternalMessage.attributes.js
index 7e675b5..17b7a86 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 _0x0f73=['INTEGER','sequelize','medium'];(function(_0x4882d2,_0x11d8af){var _0x22c366=function(_0x5c5119){while(--_0x5c5119){_0x4882d2['push'](_0x4882d2['shift']());}};_0x22c366(++_0x11d8af);}(_0x0f73,0x160));var _0x30f7=function(_0x9ca252,_0x591090){_0x9ca252=_0x9ca252-0x0;var _0x4aa69c=_0x0f73[_0x9ca252];return _0x4aa69c;};'use strict';var Sequelize=require(_0x30f7('0x0'));module['exports']={'body':{'type':Sequelize['TEXT'](_0x30f7('0x1')),'allowNull':![]},'read':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'ChatInternalMessageId':{'type':Sequelize[_0x30f7('0x2')]}};
\ No newline at end of file
+var _0xf5dc=['BOOLEAN','TEXT','medium'];(function(_0x1d1779,_0x284147){var _0x2377e9=function(_0x299f6f){while(--_0x299f6f){_0x1d1779['push'](_0x1d1779['shift']());}};_0x2377e9(++_0x284147);}(_0xf5dc,0xc4));var _0xcf5d=function(_0x42cae2,_0x284ef8){_0x42cae2=_0x42cae2-0x0;var _0x5f256f=_0xf5dc[_0x42cae2];return _0x5f256f;};'use strict';var Sequelize=require('sequelize');module['exports']={'body':{'type':Sequelize[_0xcf5d('0x0')](_0xcf5d('0x1')),'allowNull':![]},'read':{'type':Sequelize[_0xcf5d('0x2')],'defaultValue':![]},'ChatInternalMessageId':{'type':Sequelize['INTEGER']}};
\ No newline at end of file
diff --git a/server/api/chatInternalMessage/chatInternalMessage.controller.js b/server/api/chatInternalMessage/chatInternalMessage.controller.js
index 66e62ff..a5ea7e6 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 _0x5c47=['register','sendStatus','status','end','json','offset','undefined','limit','count','reject','save','update','then','destroy','error','stack','name','send','index','map','ChatInternalMessage','rawAttributes','fieldName','type','key','model','query','keys','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','includeAll','include','findAll','rows','catch','show','params','options','find','create','body','describe','get','messages','lastMessageAt','lastMessage','format','YYYY-MM-DD\x20HH:mm:ss','getUsers','User','admin','fullname','role','online','lastLoginAt','allowmessenger','showWebBar','-online','VoiceQueue','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','Agents','userProfileId','isEmpty','agent','resourceId','push','createdAt','read','-createdAt','all','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','to-csv','fs-extra','lodash','squel','crypto','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','socket.io-emitter','./chatInternalMessage.socket'];(function(_0x3ab325,_0x3b4302){var _0x38ef2a=function(_0x8bfb31){while(--_0x8bfb31){_0x3ab325['push'](_0x3ab325['shift']());}};_0x38ef2a(++_0x3b4302);}(_0x5c47,0xc1));var _0x75c4=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x5c47[_0x20a584];return _0x4b41a8;};'use strict';var emlformat=require(_0x75c4('0x0'));var rimraf=require(_0x75c4('0x1'));var zipdir=require(_0x75c4('0x2'));var jsonpatch=require(_0x75c4('0x3'));var rp=require(_0x75c4('0x4'));var moment=require(_0x75c4('0x5'));var BPromise=require(_0x75c4('0x6'));var Mustache=require('mustache');var util=require(_0x75c4('0x7'));var path=require('path');var sox=require('sox');var csv=require(_0x75c4('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x75c4('0x9'));var _=require(_0x75c4('0xa'));var squel=require(_0x75c4('0xb'));var crypto=require(_0x75c4('0xc'));var jsforce=require(_0x75c4('0xd'));var deskjs=require(_0x75c4('0xe'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x75c4('0xf'));var Redis=require(_0x75c4('0x10'));var authService=require(_0x75c4('0x11'));var qs=require(_0x75c4('0x12'));var as=require(_0x75c4('0x13'));var hardwareService=require(_0x75c4('0x14'));var logger=require('../../config/logger')('api');var utils=require(_0x75c4('0x15'));var config=require(_0x75c4('0x16'));var licenseUtil=require(_0x75c4('0x17'));var db=require(_0x75c4('0x18'))['db'];config[_0x75c4('0x19')]=_[_0x75c4('0x1a')](config[_0x75c4('0x19')],{'host':'localhost','port':0x18eb});var socket=require(_0x75c4('0x1b'))(new Redis(config[_0x75c4('0x19')]));require(_0x75c4('0x1c'))[_0x75c4('0x1d')](socket);function respondWithStatusCode(_0x6f7745,_0x167767){_0x167767=_0x167767||0xcc;return function(_0x1a0e38){if(_0x1a0e38){return _0x6f7745[_0x75c4('0x1e')](_0x167767);}return _0x6f7745[_0x75c4('0x1f')](_0x167767)[_0x75c4('0x20')]();};}function respondWithResult(_0x40d4e3,_0x5dada3){_0x5dada3=_0x5dada3||0xc8;return function(_0x36b18c){if(_0x36b18c){return _0x40d4e3['status'](_0x5dada3)[_0x75c4('0x21')](_0x36b18c);}};}function respondWithFilteredResult(_0x106fff,_0x275e79){return function(_0x853946){if(_0x853946){var _0x47158a=typeof _0x275e79[_0x75c4('0x22')]===_0x75c4('0x23')&&typeof _0x275e79[_0x75c4('0x24')]===_0x75c4('0x23');var _0x3df456=_0x853946[_0x75c4('0x25')];var _0x163e74=_0x47158a?0x0:_0x275e79[_0x75c4('0x22')];var _0x51dfa7=_0x47158a?_0x853946[_0x75c4('0x25')]:_0x275e79[_0x75c4('0x22')]+_0x275e79['limit'];var _0x3db3c6;if(_0x51dfa7>=_0x3df456){_0x51dfa7=_0x3df456;_0x3db3c6=0xc8;}else{_0x3db3c6=0xce;}_0x106fff[_0x75c4('0x1f')](_0x3db3c6);return _0x106fff['set']('Content-Range',_0x163e74+'-'+_0x51dfa7+'/'+_0x3df456)[_0x75c4('0x21')](_0x853946);}return null;};}function patchUpdates(_0x5e13dc){return function(_0x3e5f27){try{jsonpatch['apply'](_0x3e5f27,_0x5e13dc,!![]);}catch(_0x3d2046){return BPromise[_0x75c4('0x26')](_0x3d2046);}return _0x3e5f27[_0x75c4('0x27')]();};}function saveUpdates(_0x55f00e,_0x552eb1){return function(_0x1a1fd0){if(_0x1a1fd0){return _0x1a1fd0[_0x75c4('0x28')](_0x55f00e)[_0x75c4('0x29')](function(_0x5ca204){return _0x5ca204;});}return null;};}function removeEntity(_0x5efab6,_0x3f51a4){return function(_0x2714fb){if(_0x2714fb){return _0x2714fb[_0x75c4('0x2a')]()['then'](function(){_0x5efab6['status'](0xcc)[_0x75c4('0x20')]();});}};}function handleEntityNotFound(_0x4893ad,_0x4798ec){return function(_0x7d751b){if(!_0x7d751b){_0x4893ad[_0x75c4('0x1e')](0x194);}return _0x7d751b;};}function handleError(_0x1ca144,_0x37beec){_0x37beec=_0x37beec||0x1f4;return function(_0x570011){logger[_0x75c4('0x2b')](_0x570011[_0x75c4('0x2c')]);if(_0x570011[_0x75c4('0x2d')]){delete _0x570011[_0x75c4('0x2d')];}_0x1ca144[_0x75c4('0x1f')](_0x37beec)[_0x75c4('0x2e')](_0x570011);};}exports[_0x75c4('0x2f')]=function(_0x441d8e,_0x524122){var _0x40dee9={},_0x458914={},_0x4c6b52={'count':0x0,'rows':[]};var _0x473d78=_[_0x75c4('0x30')](db[_0x75c4('0x31')][_0x75c4('0x32')],function(_0x7a5b2a){return{'name':_0x7a5b2a[_0x75c4('0x33')],'type':_0x7a5b2a[_0x75c4('0x34')][_0x75c4('0x35')]};});_0x458914[_0x75c4('0x36')]=_[_0x75c4('0x30')](_0x473d78,_0x75c4('0x2d'));_0x458914[_0x75c4('0x37')]=_[_0x75c4('0x38')](_0x441d8e['query']);_0x458914['filters']=_['intersection'](_0x458914[_0x75c4('0x36')],_0x458914[_0x75c4('0x37')]);_0x40dee9[_0x75c4('0x39')]=_[_0x75c4('0x3a')](_0x458914[_0x75c4('0x36')],qs[_0x75c4('0x3b')](_0x441d8e[_0x75c4('0x37')][_0x75c4('0x3b')]));_0x40dee9['attributes']=_0x40dee9[_0x75c4('0x39')][_0x75c4('0x3c')]?_0x40dee9[_0x75c4('0x39')]:_0x458914[_0x75c4('0x36')];if(!_0x441d8e[_0x75c4('0x37')][_0x75c4('0x3d')](_0x75c4('0x3e'))){_0x40dee9[_0x75c4('0x24')]=qs[_0x75c4('0x24')](_0x441d8e[_0x75c4('0x37')][_0x75c4('0x24')]);_0x40dee9[_0x75c4('0x22')]=qs[_0x75c4('0x22')](_0x441d8e[_0x75c4('0x37')][_0x75c4('0x22')]);}_0x40dee9[_0x75c4('0x3f')]=qs['sort'](_0x441d8e[_0x75c4('0x37')][_0x75c4('0x40')]);_0x40dee9[_0x75c4('0x41')]=qs['filters'](_[_0x75c4('0x42')](_0x441d8e['query'],_0x458914['filters']),_0x473d78);if(_0x441d8e[_0x75c4('0x37')][_0x75c4('0x43')]){_0x40dee9[_0x75c4('0x41')]=_[_0x75c4('0x44')](_0x40dee9[_0x75c4('0x41')],{'$or':_[_0x75c4('0x30')](_0x473d78,function(_0x5c3e0e){if(_0x5c3e0e[_0x75c4('0x34')]!=='VIRTUAL'){var _0x2a6571={};_0x2a6571[_0x5c3e0e[_0x75c4('0x2d')]]={'$like':'%'+_0x441d8e[_0x75c4('0x37')][_0x75c4('0x43')]+'%'};return _0x2a6571;}})});}_0x40dee9=_[_0x75c4('0x44')]({},_0x40dee9,_0x441d8e['options']);var _0x167bc9={'where':_0x40dee9['where']};return db[_0x75c4('0x31')][_0x75c4('0x25')](_0x167bc9)['then'](function(_0x4b5988){_0x4c6b52[_0x75c4('0x25')]=_0x4b5988;if(_0x441d8e[_0x75c4('0x37')][_0x75c4('0x45')]){_0x40dee9[_0x75c4('0x46')]=[{'all':!![]}];}return db['ChatInternalMessage'][_0x75c4('0x47')](_0x40dee9);})[_0x75c4('0x29')](function(_0x1587ec){_0x4c6b52[_0x75c4('0x48')]=_0x1587ec;return _0x4c6b52;})[_0x75c4('0x29')](respondWithFilteredResult(_0x524122,_0x40dee9))[_0x75c4('0x49')](handleError(_0x524122,null));};exports[_0x75c4('0x4a')]=function(_0x185626,_0x1b5988){var _0x3f4e25={'raw':!![],'where':{'id':_0x185626[_0x75c4('0x4b')]['id']}},_0x4e3359={};_0x4e3359[_0x75c4('0x36')]=_[_0x75c4('0x38')](db[_0x75c4('0x31')][_0x75c4('0x32')]);_0x4e3359[_0x75c4('0x37')]=_[_0x75c4('0x38')](_0x185626['query']);_0x4e3359['filters']=_[_0x75c4('0x3a')](_0x4e3359[_0x75c4('0x36')],_0x4e3359['query']);_0x3f4e25[_0x75c4('0x39')]=_[_0x75c4('0x3a')](_0x4e3359[_0x75c4('0x36')],qs[_0x75c4('0x3b')](_0x185626['query'][_0x75c4('0x3b')]));_0x3f4e25[_0x75c4('0x39')]=_0x3f4e25[_0x75c4('0x39')][_0x75c4('0x3c')]?_0x3f4e25[_0x75c4('0x39')]:_0x4e3359[_0x75c4('0x36')];if(_0x185626['query'][_0x75c4('0x45')]){_0x3f4e25['include']=[{'all':!![]}];}_0x3f4e25=_[_0x75c4('0x44')]({},_0x3f4e25,_0x185626[_0x75c4('0x4c')]);return db[_0x75c4('0x31')][_0x75c4('0x4d')](_0x3f4e25)[_0x75c4('0x29')](handleEntityNotFound(_0x1b5988,null))[_0x75c4('0x29')](respondWithResult(_0x1b5988,null))['catch'](handleError(_0x1b5988,null));};exports[_0x75c4('0x4e')]=function(_0x65a0f2,_0x1dfa84){return db[_0x75c4('0x31')][_0x75c4('0x4e')](_0x65a0f2['body'],{})[_0x75c4('0x29')](respondWithResult(_0x1dfa84,0xc9))['catch'](handleError(_0x1dfa84,null));};exports[_0x75c4('0x28')]=function(_0x25f057,_0x2f95bd){if(_0x25f057['body']['id']){delete _0x25f057[_0x75c4('0x4f')]['id'];}return db[_0x75c4('0x31')][_0x75c4('0x4d')]({'where':{'id':_0x25f057[_0x75c4('0x4b')]['id']}})[_0x75c4('0x29')](handleEntityNotFound(_0x2f95bd,null))[_0x75c4('0x29')](saveUpdates(_0x25f057[_0x75c4('0x4f')],null))[_0x75c4('0x29')](respondWithResult(_0x2f95bd,null))[_0x75c4('0x49')](handleError(_0x2f95bd,null));};exports[_0x75c4('0x2a')]=function(_0x5df392,_0x267b52){return db[_0x75c4('0x31')][_0x75c4('0x4d')]({'where':{'id':_0x5df392[_0x75c4('0x4b')]['id']}})[_0x75c4('0x29')](handleEntityNotFound(_0x267b52,null))[_0x75c4('0x29')](removeEntity(_0x267b52,null))[_0x75c4('0x49')](handleError(_0x267b52,null));};exports['describe']=function(_0x53e10b,_0x4c2d1d){return db[_0x75c4('0x31')][_0x75c4('0x50')]()['then'](respondWithResult(_0x4c2d1d,null))[_0x75c4('0x49')](handleError(_0x4c2d1d,null));};function wrapUser(_0x471d8d){return function(_0x3d76d8){var _0x497b9f=_0x471d8d[_0x75c4('0x51')]({'plain':!![]});_0x497b9f[_0x75c4('0x52')]=[];if(_0x3d76d8){_0x497b9f[_0x75c4('0x53')]=_0x3d76d8['createdAt'];_0x497b9f[_0x75c4('0x54')]=_0x3d76d8;}else{_0x497b9f['lastMessageAt']=moment(0x0)[_0x75c4('0x55')](_0x75c4('0x56'));_0x497b9f[_0x75c4('0x54')]={};}return _0x497b9f;};}exports[_0x75c4('0x57')]=function(_0x379cb2,_0xcf3529,_0x548927){var _0x384cb6=[];return db[_0x75c4('0x58')][_0x75c4('0x47')]({'where':{'role':['agent',_0x75c4('0x59'),'user']},'attributes':['id',_0x75c4('0x5a'),_0x75c4('0x2d'),_0x75c4('0x5b'),'userpic','internal',_0x75c4('0x5c'),_0x75c4('0x5d'),_0x75c4('0x5e'),_0x75c4('0x5f')],'order':qs[_0x75c4('0x40')](_0x75c4('0x60')),'include':[{'model':db[_0x75c4('0x61')],'as':'VoiceQueues','attributes':['id',_0x75c4('0x2d'),_0x75c4('0x34')],'through':{'attributes':[]}}]})['then'](function(_0x48249e){if(_0x48249e){var _0x23187d=_0x379cb2[_0x75c4('0x62')][_0x75c4('0x51')]({'plain':!![]});if(!_0x23187d)throw new Error(_0x75c4('0x63'));if(_0x23187d[_0x75c4('0x5b')]===_0x75c4('0x62')){return db[_0x75c4('0x64')]['find']({'where':{'name':_0x75c4('0x65'),'userProfileId':_0x23187d[_0x75c4('0x66')]},'raw':!![]})[_0x75c4('0x29')](function(_0x56a47e){if(_0x56a47e){if(_0x56a47e['autoAssociation']===0x0){return db['UserProfileResource'][_0x75c4('0x47')]({'where':{'sectionId':_0x56a47e['id']},'raw':!![]})[_0x75c4('0x29')](function(_0x315732){var _0x21b77e=[];if(_[_0x75c4('0x67')](_0x315732)){_0x21b77e=_[_0x75c4('0x43')](_0x48249e,function(_0x3e6514){if(_0x3e6514['role']!==_0x75c4('0x68')){return _0x3e6514;}});return _0x21b77e;}else{for(var _0x6a1f92=0x0;_0x6a1f92<_0x48249e[_0x75c4('0x3c')];_0x6a1f92++){var _0x425bd3=_0x48249e[_0x6a1f92];if(_0x425bd3['role']===_0x75c4('0x68')){var _0x37eec9=_['find'](_0x315732,function(_0xff6806){return _0xff6806[_0x75c4('0x69')]===_0x425bd3['id'];});if(_0x37eec9)_0x21b77e[_0x75c4('0x6a')](_0x425bd3);}else{_0x21b77e['push'](_0x425bd3);}}return _0x21b77e;}});}else{return _0x48249e;}}else{var _0x21f0f0=_['filter'](_0x48249e,function(_0x47d74c){if(_0x47d74c[_0x75c4('0x5b')]!==_0x75c4('0x68')){return _0x47d74c;}});return _0x21f0f0;}});}else{return _0x48249e;}}})[_0x75c4('0x29')](function(_0x2cd985){var _0x1c51d4=[];if(_0x2cd985){_0x384cb6=_0x2cd985;for(var _0x42359d=0x0;_0x42359d<_0x2cd985[_0x75c4('0x3c')];_0x42359d+=0x1){_0x384cb6[_0x42359d]['messages']=[];_0x1c51d4[_0x75c4('0x6a')](db[_0x75c4('0x31')][_0x75c4('0x4d')]({'where':{'FromId':[_0x379cb2[_0x75c4('0x62')]['id'],_0x2cd985[_0x42359d]['id']],'ToId':[_0x379cb2['user']['id'],_0x2cd985[_0x42359d]['id']],'ChatGroupId':null},'attributes':['id',_0x75c4('0x6b'),'FromId','ToId',_0x75c4('0x6c'),_0x75c4('0x4f')],'order':qs['sort'](_0x75c4('0x6d')),'limit':0x1,'offset':0x0,'raw':!![]})[_0x75c4('0x29')](wrapUser(_0x2cd985[_0x42359d])));}return BPromise[_0x75c4('0x6e')](_0x1c51d4);}return[];})[_0x75c4('0x29')](function(_0x490c3b){return{'rows':_0x490c3b,'count':_0x490c3b[_0x75c4('0x3c')]};})[_0x75c4('0x29')](respondWithResult(_0xcf3529,null))[_0x75c4('0x49')](handleError(_0xcf3529,null));};
\ No newline at end of file
+var _0x3eb1=['offset','undefined','limit','count','set','Content-Range','json','apply','reject','save','then','sendStatus','error','stack','send','index','map','ChatInternalMessage','fieldName','type','key','name','keys','filters','intersection','model','query','fields','length','attributes','hasOwnProperty','nolimit','order','sort','where','VIRTUAL','filter','merge','options','includeAll','findAll','params','rawAttributes','include','catch','create','body','update','find','describe','get','messages','lastMessageAt','createdAt','lastMessage','User','agent','fullname','role','userpic','internal','online','lastLoginAt','allowmessenger','showWebBar','-online','VoiceQueue','VoiceQueues','Unable\x20to\x20retrieve\x20the\x20current\x20user','user','UserProfileSection','Agents','userProfileId','autoAssociation','isEmpty','resourceId','push','FromId','ToId','read','-createdAt','all','eml-format','rimraf','zip-dir','fast-json-patch','moment','util','path','sox','to-csv','fs-extra','crypto','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','defaults','redis','localhost','socket.io-emitter','register','status','end'];(function(_0x1aaf60,_0x207f75){var _0x4b2f42=function(_0x27071b){while(--_0x27071b){_0x1aaf60['push'](_0x1aaf60['shift']());}};_0x4b2f42(++_0x207f75);}(_0x3eb1,0x130));var _0x13eb=function(_0x5180c3,_0x4b35f7){_0x5180c3=_0x5180c3-0x0;var _0x55c975=_0x3eb1[_0x5180c3];return _0x55c975;};'use strict';var emlformat=require(_0x13eb('0x0'));var rimraf=require(_0x13eb('0x1'));var zipdir=require(_0x13eb('0x2'));var jsonpatch=require(_0x13eb('0x3'));var rp=require('request-promise');var moment=require(_0x13eb('0x4'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x13eb('0x5'));var path=require(_0x13eb('0x6'));var sox=require(_0x13eb('0x7'));var csv=require(_0x13eb('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x13eb('0x9'));var _=require('lodash');var squel=require('squel');var crypto=require(_0x13eb('0xa'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x13eb('0x8'));var querystring=require(_0x13eb('0xb'));var Papa=require(_0x13eb('0xc'));var Redis=require(_0x13eb('0xd'));var authService=require(_0x13eb('0xe'));var qs=require(_0x13eb('0xf'));var as=require(_0x13eb('0x10'));var hardwareService=require(_0x13eb('0x11'));var logger=require(_0x13eb('0x12'))(_0x13eb('0x13'));var utils=require(_0x13eb('0x14'));var config=require(_0x13eb('0x15'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];config['redis']=_[_0x13eb('0x16')](config[_0x13eb('0x17')],{'host':_0x13eb('0x18'),'port':0x18eb});var socket=require(_0x13eb('0x19'))(new Redis(config[_0x13eb('0x17')]));require('./chatInternalMessage.socket')[_0x13eb('0x1a')](socket);function respondWithStatusCode(_0xad335b,_0x3525c2){_0x3525c2=_0x3525c2||0xcc;return function(_0x7289dc){if(_0x7289dc){return _0xad335b['sendStatus'](_0x3525c2);}return _0xad335b[_0x13eb('0x1b')](_0x3525c2)[_0x13eb('0x1c')]();};}function respondWithResult(_0x1b7ee1,_0x580bb9){_0x580bb9=_0x580bb9||0xc8;return function(_0x5e3193){if(_0x5e3193){return _0x1b7ee1[_0x13eb('0x1b')](_0x580bb9)['json'](_0x5e3193);}};}function respondWithFilteredResult(_0xe2976a,_0x29fb80){return function(_0x10586d){if(_0x10586d){var _0x3c9f54=typeof _0x29fb80[_0x13eb('0x1d')]===_0x13eb('0x1e')&&typeof _0x29fb80[_0x13eb('0x1f')]===_0x13eb('0x1e');var _0x490c5f=_0x10586d[_0x13eb('0x20')];var _0x2959d6=_0x3c9f54?0x0:_0x29fb80[_0x13eb('0x1d')];var _0x3e43e3=_0x3c9f54?_0x10586d[_0x13eb('0x20')]:_0x29fb80[_0x13eb('0x1d')]+_0x29fb80[_0x13eb('0x1f')];var _0x2feae9;if(_0x3e43e3>=_0x490c5f){_0x3e43e3=_0x490c5f;_0x2feae9=0xc8;}else{_0x2feae9=0xce;}_0xe2976a['status'](_0x2feae9);return _0xe2976a[_0x13eb('0x21')](_0x13eb('0x22'),_0x2959d6+'-'+_0x3e43e3+'/'+_0x490c5f)[_0x13eb('0x23')](_0x10586d);}return null;};}function patchUpdates(_0x61713b){return function(_0x525c5f){try{jsonpatch[_0x13eb('0x24')](_0x525c5f,_0x61713b,!![]);}catch(_0x35ee5e){return BPromise[_0x13eb('0x25')](_0x35ee5e);}return _0x525c5f[_0x13eb('0x26')]();};}function saveUpdates(_0x427a29,_0x3bb6ab){return function(_0x554a01){if(_0x554a01){return _0x554a01['update'](_0x427a29)['then'](function(_0x29a9b4){return _0x29a9b4;});}return null;};}function removeEntity(_0x55b445,_0x91ce51){return function(_0x265440){if(_0x265440){return _0x265440['destroy']()[_0x13eb('0x27')](function(){_0x55b445[_0x13eb('0x1b')](0xcc)[_0x13eb('0x1c')]();});}};}function handleEntityNotFound(_0x20b4a2,_0x4fbfc9){return function(_0x33cb88){if(!_0x33cb88){_0x20b4a2[_0x13eb('0x28')](0x194);}return _0x33cb88;};}function handleError(_0x1ca546,_0x387754){_0x387754=_0x387754||0x1f4;return function(_0xa486bb){logger[_0x13eb('0x29')](_0xa486bb[_0x13eb('0x2a')]);if(_0xa486bb['name']){delete _0xa486bb['name'];}_0x1ca546[_0x13eb('0x1b')](_0x387754)[_0x13eb('0x2b')](_0xa486bb);};}exports[_0x13eb('0x2c')]=function(_0x4bd63e,_0x132e41){var _0x1544a7={},_0x558e9={},_0x275c3f={'count':0x0,'rows':[]};var _0x45bd1f=_[_0x13eb('0x2d')](db[_0x13eb('0x2e')]['rawAttributes'],function(_0x3e16d6){return{'name':_0x3e16d6[_0x13eb('0x2f')],'type':_0x3e16d6[_0x13eb('0x30')][_0x13eb('0x31')]};});_0x558e9['model']=_[_0x13eb('0x2d')](_0x45bd1f,_0x13eb('0x32'));_0x558e9['query']=_[_0x13eb('0x33')](_0x4bd63e['query']);_0x558e9[_0x13eb('0x34')]=_[_0x13eb('0x35')](_0x558e9[_0x13eb('0x36')],_0x558e9[_0x13eb('0x37')]);_0x1544a7['attributes']=_[_0x13eb('0x35')](_0x558e9[_0x13eb('0x36')],qs[_0x13eb('0x38')](_0x4bd63e[_0x13eb('0x37')][_0x13eb('0x38')]));_0x1544a7['attributes']=_0x1544a7['attributes'][_0x13eb('0x39')]?_0x1544a7[_0x13eb('0x3a')]:_0x558e9[_0x13eb('0x36')];if(!_0x4bd63e[_0x13eb('0x37')][_0x13eb('0x3b')](_0x13eb('0x3c'))){_0x1544a7[_0x13eb('0x1f')]=qs[_0x13eb('0x1f')](_0x4bd63e['query'][_0x13eb('0x1f')]);_0x1544a7[_0x13eb('0x1d')]=qs[_0x13eb('0x1d')](_0x4bd63e[_0x13eb('0x37')][_0x13eb('0x1d')]);}_0x1544a7[_0x13eb('0x3d')]=qs[_0x13eb('0x3e')](_0x4bd63e[_0x13eb('0x37')]['sort']);_0x1544a7[_0x13eb('0x3f')]=qs[_0x13eb('0x34')](_['pick'](_0x4bd63e[_0x13eb('0x37')],_0x558e9[_0x13eb('0x34')]),_0x45bd1f);if(_0x4bd63e['query']['filter']){_0x1544a7[_0x13eb('0x3f')]=_['merge'](_0x1544a7[_0x13eb('0x3f')],{'$or':_['map'](_0x45bd1f,function(_0x497fb1){if(_0x497fb1[_0x13eb('0x30')]!==_0x13eb('0x40')){var _0x23319f={};_0x23319f[_0x497fb1[_0x13eb('0x32')]]={'$like':'%'+_0x4bd63e[_0x13eb('0x37')][_0x13eb('0x41')]+'%'};return _0x23319f;}})});}_0x1544a7=_[_0x13eb('0x42')]({},_0x1544a7,_0x4bd63e[_0x13eb('0x43')]);var _0x5c8718={'where':_0x1544a7[_0x13eb('0x3f')]};return db[_0x13eb('0x2e')]['count'](_0x5c8718)[_0x13eb('0x27')](function(_0x4b49bb){_0x275c3f['count']=_0x4b49bb;if(_0x4bd63e[_0x13eb('0x37')][_0x13eb('0x44')]){_0x1544a7['include']=[{'all':!![]}];}return db[_0x13eb('0x2e')][_0x13eb('0x45')](_0x1544a7);})[_0x13eb('0x27')](function(_0x7bdabf){_0x275c3f['rows']=_0x7bdabf;return _0x275c3f;})[_0x13eb('0x27')](respondWithFilteredResult(_0x132e41,_0x1544a7))['catch'](handleError(_0x132e41,null));};exports['show']=function(_0x302cfe,_0xbf4863){var _0x274abb={'raw':!![],'where':{'id':_0x302cfe[_0x13eb('0x46')]['id']}},_0x1ec890={};_0x1ec890[_0x13eb('0x36')]=_[_0x13eb('0x33')](db[_0x13eb('0x2e')][_0x13eb('0x47')]);_0x1ec890[_0x13eb('0x37')]=_[_0x13eb('0x33')](_0x302cfe[_0x13eb('0x37')]);_0x1ec890['filters']=_['intersection'](_0x1ec890[_0x13eb('0x36')],_0x1ec890['query']);_0x274abb[_0x13eb('0x3a')]=_[_0x13eb('0x35')](_0x1ec890['model'],qs[_0x13eb('0x38')](_0x302cfe[_0x13eb('0x37')]['fields']));_0x274abb['attributes']=_0x274abb[_0x13eb('0x3a')][_0x13eb('0x39')]?_0x274abb[_0x13eb('0x3a')]:_0x1ec890[_0x13eb('0x36')];if(_0x302cfe[_0x13eb('0x37')]['includeAll']){_0x274abb[_0x13eb('0x48')]=[{'all':!![]}];}_0x274abb=_[_0x13eb('0x42')]({},_0x274abb,_0x302cfe[_0x13eb('0x43')]);return db[_0x13eb('0x2e')]['find'](_0x274abb)[_0x13eb('0x27')](handleEntityNotFound(_0xbf4863,null))[_0x13eb('0x27')](respondWithResult(_0xbf4863,null))[_0x13eb('0x49')](handleError(_0xbf4863,null));};exports['create']=function(_0x621377,_0x44ff3a){return db['ChatInternalMessage'][_0x13eb('0x4a')](_0x621377[_0x13eb('0x4b')],{})['then'](respondWithResult(_0x44ff3a,0xc9))[_0x13eb('0x49')](handleError(_0x44ff3a,null));};exports[_0x13eb('0x4c')]=function(_0xf7d122,_0x1402f2){if(_0xf7d122[_0x13eb('0x4b')]['id']){delete _0xf7d122['body']['id'];}return db['ChatInternalMessage'][_0x13eb('0x4d')]({'where':{'id':_0xf7d122[_0x13eb('0x46')]['id']}})['then'](handleEntityNotFound(_0x1402f2,null))[_0x13eb('0x27')](saveUpdates(_0xf7d122[_0x13eb('0x4b')],null))[_0x13eb('0x27')](respondWithResult(_0x1402f2,null))[_0x13eb('0x49')](handleError(_0x1402f2,null));};exports['destroy']=function(_0x322823,_0x3a63f6){return db['ChatInternalMessage'][_0x13eb('0x4d')]({'where':{'id':_0x322823[_0x13eb('0x46')]['id']}})[_0x13eb('0x27')](handleEntityNotFound(_0x3a63f6,null))[_0x13eb('0x27')](removeEntity(_0x3a63f6,null))[_0x13eb('0x49')](handleError(_0x3a63f6,null));};exports[_0x13eb('0x4e')]=function(_0x3df6b2,_0x340cf2){return db['ChatInternalMessage'][_0x13eb('0x4e')]()[_0x13eb('0x27')](respondWithResult(_0x340cf2,null))['catch'](handleError(_0x340cf2,null));};function wrapUser(_0x5a54b7){return function(_0x17a804){var _0xccb0b=_0x5a54b7[_0x13eb('0x4f')]({'plain':!![]});_0xccb0b[_0x13eb('0x50')]=[];if(_0x17a804){_0xccb0b[_0x13eb('0x51')]=_0x17a804[_0x13eb('0x52')];_0xccb0b[_0x13eb('0x53')]=_0x17a804;}else{_0xccb0b['lastMessageAt']=moment(0x0)['format']('YYYY-MM-DD\x20HH:mm:ss');_0xccb0b[_0x13eb('0x53')]={};}return _0xccb0b;};}exports['getUsers']=function(_0x1d4d62,_0x3054e7,_0x5d9abd){var _0x28748d=[];return db[_0x13eb('0x54')][_0x13eb('0x45')]({'where':{'role':[_0x13eb('0x55'),'admin','user']},'attributes':['id',_0x13eb('0x56'),_0x13eb('0x32'),_0x13eb('0x57'),_0x13eb('0x58'),_0x13eb('0x59'),_0x13eb('0x5a'),_0x13eb('0x5b'),_0x13eb('0x5c'),_0x13eb('0x5d')],'order':qs[_0x13eb('0x3e')](_0x13eb('0x5e')),'include':[{'model':db[_0x13eb('0x5f')],'as':_0x13eb('0x60'),'attributes':['id','name',_0x13eb('0x30')],'through':{'attributes':[]}}]})[_0x13eb('0x27')](function(_0x5d4d5f){if(_0x5d4d5f){var _0x14d346=_0x1d4d62['user'][_0x13eb('0x4f')]({'plain':!![]});if(!_0x14d346)throw new Error(_0x13eb('0x61'));if(_0x14d346[_0x13eb('0x57')]===_0x13eb('0x62')){return db[_0x13eb('0x63')][_0x13eb('0x4d')]({'where':{'name':_0x13eb('0x64'),'userProfileId':_0x14d346[_0x13eb('0x65')]},'raw':!![]})['then'](function(_0x4a320e){if(_0x4a320e){if(_0x4a320e[_0x13eb('0x66')]===0x0){return db['UserProfileResource'][_0x13eb('0x45')]({'where':{'sectionId':_0x4a320e['id']},'raw':!![]})[_0x13eb('0x27')](function(_0x42eae2){var _0x187608=[];if(_[_0x13eb('0x67')](_0x42eae2)){_0x187608=_[_0x13eb('0x41')](_0x5d4d5f,function(_0x4dfc14){if(_0x4dfc14['role']!==_0x13eb('0x55')){return _0x4dfc14;}});return _0x187608;}else{for(var _0x1b7f92=0x0;_0x1b7f92<_0x5d4d5f[_0x13eb('0x39')];_0x1b7f92++){var _0x27ca21=_0x5d4d5f[_0x1b7f92];if(_0x27ca21[_0x13eb('0x57')]===_0x13eb('0x55')){var _0x3c9572=_['find'](_0x42eae2,function(_0xf6323){return _0xf6323[_0x13eb('0x68')]===_0x27ca21['id'];});if(_0x3c9572)_0x187608[_0x13eb('0x69')](_0x27ca21);}else{_0x187608['push'](_0x27ca21);}}return _0x187608;}});}else{return _0x5d4d5f;}}else{var _0x16fb6b=_[_0x13eb('0x41')](_0x5d4d5f,function(_0x47a539){if(_0x47a539['role']!=='agent'){return _0x47a539;}});return _0x16fb6b;}});}else{return _0x5d4d5f;}}})[_0x13eb('0x27')](function(_0x1e50d7){var _0x1bfe41=[];if(_0x1e50d7){_0x28748d=_0x1e50d7;for(var _0x2bd8ef=0x0;_0x2bd8ef<_0x1e50d7['length'];_0x2bd8ef+=0x1){_0x28748d[_0x2bd8ef][_0x13eb('0x50')]=[];_0x1bfe41['push'](db[_0x13eb('0x2e')]['find']({'where':{'FromId':[_0x1d4d62[_0x13eb('0x62')]['id'],_0x1e50d7[_0x2bd8ef]['id']],'ToId':[_0x1d4d62[_0x13eb('0x62')]['id'],_0x1e50d7[_0x2bd8ef]['id']],'ChatGroupId':null},'attributes':['id',_0x13eb('0x52'),_0x13eb('0x6a'),_0x13eb('0x6b'),_0x13eb('0x6c'),_0x13eb('0x4b')],'order':qs[_0x13eb('0x3e')](_0x13eb('0x6d')),'limit':0x1,'offset':0x0,'raw':!![]})[_0x13eb('0x27')](wrapUser(_0x1e50d7[_0x2bd8ef])));}return BPromise[_0x13eb('0x6e')](_0x1bfe41);}return[];})[_0x13eb('0x27')](function(_0x3142b2){return{'rows':_0x3142b2,'count':_0x3142b2['length']};})[_0x13eb('0x27')](respondWithResult(_0x3054e7,null))[_0x13eb('0x49')](handleError(_0x3054e7,null));};
\ No newline at end of file
diff --git a/server/api/chatInternalMessage/chatInternalMessage.events.js b/server/api/chatInternalMessage/chatInternalMessage.events.js
index bb5ad48..2c04b6b 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 _0x971c=['emit','hasOwnProperty','hook','exports','events','ChatInternalMessage','save'];(function(_0x5ddb1c,_0x5ea4df){var _0x354adc=function(_0x2dfb1f){while(--_0x2dfb1f){_0x5ddb1c['push'](_0x5ddb1c['shift']());}};_0x354adc(++_0x5ea4df);}(_0x971c,0x66));var _0xc971=function(_0x1e7b16,_0x4607a1){_0x1e7b16=_0x1e7b16-0x0;var _0x37fadc=_0x971c[_0x1e7b16];return _0x37fadc;};'use strict';var EventEmitter=require(_0xc971('0x0'));var ChatInternalMessage=require('../../mysqldb')['db'][_0xc971('0x1')];var ChatInternalMessageEvents=new EventEmitter();ChatInternalMessageEvents['setMaxListeners'](0x0);var events={'afterCreate':_0xc971('0x2'),'afterUpdate':'update','afterDestroy':'remove'};function emitEvent(_0x2a3f43){return function(_0x172418,_0x49e8b4,_0x55ab63){ChatInternalMessageEvents['emit'](_0x2a3f43+':'+_0x172418['id'],_0x172418);ChatInternalMessageEvents[_0xc971('0x3')](_0x2a3f43,_0x172418);_0x55ab63(null);};}for(var e in events){if(events[_0xc971('0x4')](e)){var event=events[e];ChatInternalMessage[_0xc971('0x5')](e,emitEvent(event));}}module[_0xc971('0x6')]=ChatInternalMessageEvents;
\ No newline at end of file
+var _0xe149=['hook','exports','events','save','emit','hasOwnProperty'];(function(_0x479716,_0x3505ba){var _0x32ae1c=function(_0x537f1d){while(--_0x537f1d){_0x479716['push'](_0x479716['shift']());}};_0x32ae1c(++_0x3505ba);}(_0xe149,0x7a));var _0x9e14=function(_0x2bbe4e,_0x2f416d){_0x2bbe4e=_0x2bbe4e-0x0;var _0x9ffba7=_0xe149[_0x2bbe4e];return _0x9ffba7;};'use strict';var EventEmitter=require(_0x9e14('0x0'));var ChatInternalMessage=require('../../mysqldb')['db']['ChatInternalMessage'];var ChatInternalMessageEvents=new EventEmitter();ChatInternalMessageEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x9e14('0x1'),'afterUpdate':'update','afterDestroy':'remove'};function emitEvent(_0xc27309){return function(_0x42f9f4,_0x4d4482,_0x127777){ChatInternalMessageEvents[_0x9e14('0x2')](_0xc27309+':'+_0x42f9f4['id'],_0x42f9f4);ChatInternalMessageEvents[_0x9e14('0x2')](_0xc27309,_0x42f9f4);_0x127777(null);};}for(var e in events){if(events[_0x9e14('0x3')](e)){var event=events[e];ChatInternalMessage[_0x9e14('0x4')](e,emitEvent(event));}}module[_0x9e14('0x5')]=ChatInternalMessageEvents;
\ No newline at end of file
diff --git a/server/api/chatInternalMessage/chatInternalMessage.model.js b/server/api/chatInternalMessage/chatInternalMessage.model.js
index 17c322f..201265f 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 _0x149f=['rimraf','../../config/environment','./chatInternalMessage.attributes','exports','ChatInternalMessage','chat_internal_messages','utf8mb4','lodash','util','api','moment','bluebird','request-promise','path'];(function(_0x4035a7,_0x3463f7){var _0xa090a1=function(_0x5c97f9){while(--_0x5c97f9){_0x4035a7['push'](_0x4035a7['shift']());}};_0xa090a1(++_0x3463f7);}(_0x149f,0x149));var _0xf149=function(_0x45783c,_0x49c56d){_0x45783c=_0x45783c-0x0;var _0x1161da=_0x149f[_0x45783c];return _0x1161da;};'use strict';var _=require(_0xf149('0x0'));var util=require(_0xf149('0x1'));var logger=require('../../config/logger')(_0xf149('0x2'));var moment=require(_0xf149('0x3'));var BPromise=require(_0xf149('0x4'));var rp=require(_0xf149('0x5'));var fs=require('fs');var path=require(_0xf149('0x6'));var rimraf=require(_0xf149('0x7'));var config=require(_0xf149('0x8'));var attributes=require(_0xf149('0x9'));module[_0xf149('0xa')]=function(_0x1bb859,_0x4cc525){return _0x1bb859['define'](_0xf149('0xb'),attributes,{'tableName':_0xf149('0xc'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0xf149('0xd'),'collate':'utf8mb4_unicode_ci'});};
\ No newline at end of file
+var _0xbced=['utf8mb4_unicode_ci','lodash','../../config/logger','api','bluebird','path','rimraf','../../config/environment','./chatInternalMessage.attributes','exports','define','ChatInternalMessage','utf8mb4'];(function(_0x33f447,_0x2c4879){var _0x1a0e82=function(_0x5a3d8c){while(--_0x5a3d8c){_0x33f447['push'](_0x33f447['shift']());}};_0x1a0e82(++_0x2c4879);}(_0xbced,0x9d));var _0xdbce=function(_0x5a8d7d,_0x2ed942){_0x5a8d7d=_0x5a8d7d-0x0;var _0xcbb507=_0xbced[_0x5a8d7d];return _0xcbb507;};'use strict';var _=require(_0xdbce('0x0'));var util=require('util');var logger=require(_0xdbce('0x1'))(_0xdbce('0x2'));var moment=require('moment');var BPromise=require(_0xdbce('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xdbce('0x4'));var rimraf=require(_0xdbce('0x5'));var config=require(_0xdbce('0x6'));var attributes=require(_0xdbce('0x7'));module[_0xdbce('0x8')]=function(_0x46a042,_0x339779){return _0x46a042[_0xdbce('0x9')](_0xdbce('0xa'),attributes,{'tableName':'chat_internal_messages','paranoid':![],'indexes':[],'timestamps':!![],'charset':_0xdbce('0xb'),'collate':_0xdbce('0xc')});};
\ No newline at end of file
diff --git a/server/api/chatInternalMessage/chatInternalMessage.rpc.js b/server/api/chatInternalMessage/chatInternalMessage.rpc.js
index acf40cf..65927eb 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 _0xac9d=['./chatInternalMessage.socket','register','request','then','info','ChatInternalMessage,\x20%s,\x20%s','debug','ChatInternalMessage,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','jayson/promise','client','http','redis','defaults','socket.io-emitter'];(function(_0x448bf3,_0x240965){var _0x492b33=function(_0x40d4ef){while(--_0x40d4ef){_0x448bf3['push'](_0x448bf3['shift']());}};_0x492b33(++_0x240965);}(_0xac9d,0x14d));var _0xdac9=function(_0x5d64f3,_0x374d1a){_0x5d64f3=_0x5d64f3-0x0;var _0x2e5c81=_0xac9d[_0x5d64f3];return _0x2e5c81;};'use strict';var _=require(_0xdac9('0x0'));var util=require(_0xdac9('0x1'));var moment=require(_0xdac9('0x2'));var BPromise=require(_0xdac9('0x3'));var rs=require(_0xdac9('0x4'));var fs=require('fs');var Redis=require(_0xdac9('0x5'));var db=require(_0xdac9('0x6'))['db'];var utils=require(_0xdac9('0x7'));var logger=require('../../config/logger')(_0xdac9('0x8'));var config=require('../../config/environment');var jayson=require(_0xdac9('0x9'));var client=jayson[_0xdac9('0xa')][_0xdac9('0xb')]({'port':0x232a});config[_0xdac9('0xc')]=_[_0xdac9('0xd')](config[_0xdac9('0xc')],{'host':'localhost','port':0x18eb});var socket=require(_0xdac9('0xe'))(new Redis(config['redis']));require(_0xdac9('0xf'))[_0xdac9('0x10')](socket);function respondWithRpcPromise(_0x39c92c,_0x1a4674,_0x23ec14){return new BPromise(function(_0x2859bf,_0x255627){return client[_0xdac9('0x11')](_0x39c92c,_0x23ec14)[_0xdac9('0x12')](function(_0x5514c5){logger[_0xdac9('0x13')](_0xdac9('0x14'),_0x1a4674,'request\x20sent');logger[_0xdac9('0x15')](_0xdac9('0x16'),_0x1a4674,_0xdac9('0x17'),JSON['stringify'](_0x5514c5));if(_0x5514c5[_0xdac9('0x18')]){if(_0x5514c5[_0xdac9('0x18')][_0xdac9('0x19')]===0x1f4){logger['error']('ChatInternalMessage,\x20%s,\x20%s',_0x1a4674,_0x5514c5[_0xdac9('0x18')][_0xdac9('0x1a')]);return _0x255627(_0x5514c5['error'][_0xdac9('0x1a')]);}logger[_0xdac9('0x18')](_0xdac9('0x14'),_0x1a4674,_0x5514c5[_0xdac9('0x18')][_0xdac9('0x1a')]);return _0x2859bf(_0x5514c5[_0xdac9('0x18')][_0xdac9('0x1a')]);}else{logger[_0xdac9('0x13')]('ChatInternalMessage,\x20%s,\x20%s',_0x1a4674,_0xdac9('0x17'));_0x2859bf(_0x5514c5[_0xdac9('0x1b')]['message']);}})[_0xdac9('0x1c')](function(_0xa57f2d){logger[_0xdac9('0x18')](_0xdac9('0x14'),_0x1a4674,_0xa57f2d);_0x255627(_0xa57f2d);});});}
\ No newline at end of file
+var _0xe4d6=['ChatInternalMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/environment','client','http','redis','defaults','./chatInternalMessage.socket','register','request','then','ChatInternalMessage,\x20%s,\x20%s','request\x20sent','debug'];(function(_0x9aada2,_0xd2d349){var _0x196dff=function(_0x5ad061){while(--_0x5ad061){_0x9aada2['push'](_0x9aada2['shift']());}};_0x196dff(++_0xd2d349);}(_0xe4d6,0xd7));var _0x6e4d=function(_0x54dcb2,_0x130fe3){_0x54dcb2=_0x54dcb2-0x0;var _0x2c4ca8=_0xe4d6[_0x54dcb2];return _0x2c4ca8;};'use strict';var _=require(_0x6e4d('0x0'));var util=require(_0x6e4d('0x1'));var moment=require(_0x6e4d('0x2'));var BPromise=require(_0x6e4d('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x6e4d('0x4'));var db=require(_0x6e4d('0x5'))['db'];var utils=require(_0x6e4d('0x6'));var logger=require('../../config/logger')('rpc');var config=require(_0x6e4d('0x7'));var jayson=require('jayson/promise');var client=jayson[_0x6e4d('0x8')][_0x6e4d('0x9')]({'port':0x232a});config[_0x6e4d('0xa')]=_[_0x6e4d('0xb')](config[_0x6e4d('0xa')],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x6e4d('0xa')]));require(_0x6e4d('0xc'))[_0x6e4d('0xd')](socket);function respondWithRpcPromise(_0x502da3,_0x2d32e2,_0x540159){return new BPromise(function(_0x404f41,_0x31ff03){return client[_0x6e4d('0xe')](_0x502da3,_0x540159)[_0x6e4d('0xf')](function(_0x4d11a3){logger['info'](_0x6e4d('0x10'),_0x2d32e2,_0x6e4d('0x11'));logger[_0x6e4d('0x12')](_0x6e4d('0x13'),_0x2d32e2,_0x6e4d('0x11'),JSON[_0x6e4d('0x14')](_0x4d11a3));if(_0x4d11a3[_0x6e4d('0x15')]){if(_0x4d11a3[_0x6e4d('0x15')][_0x6e4d('0x16')]===0x1f4){logger['error'](_0x6e4d('0x10'),_0x2d32e2,_0x4d11a3[_0x6e4d('0x15')][_0x6e4d('0x17')]);return _0x31ff03(_0x4d11a3['error']['message']);}logger[_0x6e4d('0x15')]('ChatInternalMessage,\x20%s,\x20%s',_0x2d32e2,_0x4d11a3[_0x6e4d('0x15')][_0x6e4d('0x17')]);return _0x404f41(_0x4d11a3['error'][_0x6e4d('0x17')]);}else{logger['info'](_0x6e4d('0x10'),_0x2d32e2,_0x6e4d('0x11'));_0x404f41(_0x4d11a3[_0x6e4d('0x18')][_0x6e4d('0x17')]);}})[_0x6e4d('0x19')](function(_0x5cf5e4){logger[_0x6e4d('0x15')]('ChatInternalMessage,\x20%s,\x20%s',_0x2d32e2,_0x5cf5e4);_0x31ff03(_0x5cf5e4);});});}
\ No newline at end of file
diff --git a/server/api/chatInternalMessage/chatInternalMessage.socket.js b/server/api/chatInternalMessage/chatInternalMessage.socket.js
index cf7b5cf..b9253b8 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 _0x6580=['removeListener','register','chatInternalMessage:','update'];(function(_0x39106d,_0x4d5fef){var _0x42d497=function(_0x4a239c){while(--_0x4a239c){_0x39106d['push'](_0x39106d['shift']());}};_0x42d497(++_0x4d5fef);}(_0x6580,0xa3));var _0x0658=function(_0x3e21c7,_0x583119){_0x3e21c7=_0x3e21c7-0x0;var _0x5b9124=_0x6580[_0x3e21c7];return _0x5b9124;};'use strict';var ChatInternalMessageEvents=require('./chatInternalMessage.events');var events=['save','remove',_0x0658('0x0')];function createListener(_0x25d3e4,_0x3cc914){return function(_0x374248){_0x3cc914['emit'](_0x25d3e4,_0x374248);};}function removeListener(_0x5f1cde,_0x35531a){return function(){ChatInternalMessageEvents[_0x0658('0x1')](_0x5f1cde,_0x35531a);};}exports[_0x0658('0x2')]=function(_0x453af8){for(var _0x449b36=0x0,_0x4d6dae=events['length'];_0x449b36<_0x4d6dae;_0x449b36++){var _0x258483=events[_0x449b36];var _0x9bc9=createListener(_0x0658('0x3')+_0x258483,_0x453af8);ChatInternalMessageEvents['on'](_0x258483,_0x9bc9);}};
\ No newline at end of file
+var _0x786b=['register','length','chatInternalMessage:','./chatInternalMessage.events','update','emit'];(function(_0x47568e,_0x5ccdaf){var _0x33815b=function(_0x56b026){while(--_0x56b026){_0x47568e['push'](_0x47568e['shift']());}};_0x33815b(++_0x5ccdaf);}(_0x786b,0x1c5));var _0xb786=function(_0x2642cb,_0x4b917f){_0x2642cb=_0x2642cb-0x0;var _0xe6e41=_0x786b[_0x2642cb];return _0xe6e41;};'use strict';var ChatInternalMessageEvents=require(_0xb786('0x0'));var events=['save','remove',_0xb786('0x1')];function createListener(_0x1347a2,_0x21a3cf){return function(_0x306110){_0x21a3cf[_0xb786('0x2')](_0x1347a2,_0x306110);};}function removeListener(_0x601d55,_0x500328){return function(){ChatInternalMessageEvents['removeListener'](_0x601d55,_0x500328);};}exports[_0xb786('0x3')]=function(_0x130fce){for(var _0x25f7d6=0x0,_0x1e8165=events[_0xb786('0x4')];_0x25f7d6<_0x1e8165;_0x25f7d6++){var _0x2438ab=events[_0x25f7d6];var _0xf1cb76=createListener(_0xb786('0x5')+_0x2438ab,_0x130fce);ChatInternalMessageEvents['on'](_0x2438ab,_0xf1cb76);}};
\ No newline at end of file
diff --git a/server/api/chatInternalMessage/index.js b/server/api/chatInternalMessage/index.js
index a0ba644..1a794b0 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 _0x7d6f=['multer','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment','./chatInternalMessage.controller','get','isAuthenticated','/describe','describe','/users','/:id','show','post','create','put','update','delete','destroy'];(function(_0x5d4dd7,_0x38229c){var _0x2ce0ad=function(_0x54a7fb){while(--_0x54a7fb){_0x5d4dd7['push'](_0x5d4dd7['shift']());}};_0x2ce0ad(++_0x38229c);}(_0x7d6f,0x6e));var _0xf7d6=function(_0x3fd31e,_0x16ab10){_0x3fd31e=_0x3fd31e-0x0;var _0x422a79=_0x7d6f[_0x3fd31e];return _0x422a79;};'use strict';var multer=require(_0xf7d6('0x0'));var util=require('util');var path=require(_0xf7d6('0x1'));var timeout=require(_0xf7d6('0x2'));var express=require(_0xf7d6('0x3'));var router=express[_0xf7d6('0x4')]();var fs_extra=require(_0xf7d6('0x5'));var auth=require(_0xf7d6('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0xf7d6('0x7'));var controller=require(_0xf7d6('0x8'));router[_0xf7d6('0x9')]('/',auth[_0xf7d6('0xa')](),controller['index']);router[_0xf7d6('0x9')](_0xf7d6('0xb'),auth[_0xf7d6('0xa')](),controller[_0xf7d6('0xc')]);router[_0xf7d6('0x9')](_0xf7d6('0xd'),auth['isAuthenticated'](),controller['getUsers']);router[_0xf7d6('0x9')](_0xf7d6('0xe'),auth[_0xf7d6('0xa')](),controller[_0xf7d6('0xf')]);router[_0xf7d6('0x10')]('/',auth[_0xf7d6('0xa')](),controller[_0xf7d6('0x11')]);router[_0xf7d6('0x12')](_0xf7d6('0xe'),controller[_0xf7d6('0x13')]);router[_0xf7d6('0x14')](_0xf7d6('0xe'),auth[_0xf7d6('0xa')](),controller[_0xf7d6('0x15')]);module['exports']=router;
\ No newline at end of file
+var _0xe2a3=['./chatInternalMessage.controller','get','index','isAuthenticated','getUsers','/:id','post','create','put','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment'];(function(_0x5f09c5,_0x2bfca0){var _0x426ad9=function(_0x18fe5f){while(--_0x18fe5f){_0x5f09c5['push'](_0x5f09c5['shift']());}};_0x426ad9(++_0x2bfca0);}(_0xe2a3,0x1d7));var _0x3e2a=function(_0x1d7853,_0x1f20c3){_0x1d7853=_0x1d7853-0x0;var _0xbdebec=_0xe2a3[_0x1d7853];return _0xbdebec;};'use strict';var multer=require(_0x3e2a('0x0'));var util=require(_0x3e2a('0x1'));var path=require(_0x3e2a('0x2'));var timeout=require(_0x3e2a('0x3'));var express=require(_0x3e2a('0x4'));var router=express[_0x3e2a('0x5')]();var fs_extra=require(_0x3e2a('0x6'));var auth=require(_0x3e2a('0x7'));var interaction=require('../../components/interaction/service');var config=require(_0x3e2a('0x8'));var controller=require(_0x3e2a('0x9'));router[_0x3e2a('0xa')]('/',auth['isAuthenticated'](),controller[_0x3e2a('0xb')]);router[_0x3e2a('0xa')]('/describe',auth[_0x3e2a('0xc')](),controller['describe']);router[_0x3e2a('0xa')]('/users',auth['isAuthenticated'](),controller[_0x3e2a('0xd')]);router['get'](_0x3e2a('0xe'),auth[_0x3e2a('0xc')](),controller['show']);router[_0x3e2a('0xf')]('/',auth[_0x3e2a('0xc')](),controller[_0x3e2a('0x10')]);router[_0x3e2a('0x11')](_0x3e2a('0xe'),controller['update']);router['delete'](_0x3e2a('0xe'),auth[_0x3e2a('0xc')](),controller[_0x3e2a('0x12')]);module[_0x3e2a('0x13')]=router;
\ No newline at end of file
diff --git a/server/api/chatMessage/chatMessage.attributes.js b/server/api/chatMessage/chatMessage.attributes.js
index fbceb70..dababfd 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 _0x5eb1=['ENUM','out','DATE','STRING','exports','TEXT','medium','BOOLEAN'];(function(_0x32d457,_0x1a39c9){var _0x338386=function(_0x199d7a){while(--_0x199d7a){_0x32d457['push'](_0x32d457['shift']());}};_0x338386(++_0x1a39c9);}(_0x5eb1,0x7c));var _0x15eb=function(_0x499210,_0x325b29){_0x499210=_0x499210-0x0;var _0x2e153d=_0x5eb1[_0x499210];return _0x2e153d;};'use strict';var Sequelize=require('sequelize');module[_0x15eb('0x0')]={'body':{'type':Sequelize[_0x15eb('0x1')](_0x15eb('0x2')),'allowNull':![]},'read':{'type':Sequelize[_0x15eb('0x3')],'defaultValue':![]},'secret':{'type':Sequelize[_0x15eb('0x3')],'defaultValue':![]},'direction':{'type':Sequelize[_0x15eb('0x4')]('in','out'),'defaultValue':_0x15eb('0x5'),'allowNull':![]},'readAt':{'type':Sequelize[_0x15eb('0x6')]},'providerName':{'type':Sequelize[_0x15eb('0x7')]},'providerResponse':{'type':Sequelize[_0x15eb('0x1')]}};
\ No newline at end of file
+var _0x0b0e=['TEXT','BOOLEAN','ENUM','out','DATE','STRING','sequelize'];(function(_0xa148b7,_0x2f3eb2){var _0x51efd3=function(_0x34bcec){while(--_0x34bcec){_0xa148b7['push'](_0xa148b7['shift']());}};_0x51efd3(++_0x2f3eb2);}(_0x0b0e,0x187));var _0xe0b0=function(_0x403c20,_0x4a7b99){_0x403c20=_0x403c20-0x0;var _0x2b271a=_0x0b0e[_0x403c20];return _0x2b271a;};'use strict';var Sequelize=require(_0xe0b0('0x0'));module['exports']={'body':{'type':Sequelize[_0xe0b0('0x1')]('medium'),'allowNull':![]},'read':{'type':Sequelize[_0xe0b0('0x2')],'defaultValue':![]},'secret':{'type':Sequelize[_0xe0b0('0x2')],'defaultValue':![]},'direction':{'type':Sequelize[_0xe0b0('0x3')]('in',_0xe0b0('0x4')),'defaultValue':_0xe0b0('0x4'),'allowNull':![]},'readAt':{'type':Sequelize[_0xe0b0('0x5')]},'providerName':{'type':Sequelize[_0xe0b0('0x6')]},'providerResponse':{'type':Sequelize[_0xe0b0('0x1')]}};
\ No newline at end of file
diff --git a/server/api/chatMessage/chatMessage.controller.js b/server/api/chatMessage/chatMessage.controller.js
index 46ca048..259ed5f 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 _0xa9e0=['interaction','[CHATMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','user','role','null','AcceptMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','ContactId','sequelize','contact','email','internal','manual','interface','SIP/%s','channel','event','EventManager','acceptmessage','parse','formData','chat-interactions','chat','ChatInteraction','RejectMessage','rejectMessage','Sequelize','QueryTypes','SELECT','fullname','rejectmessage','eml-format','rimraf','zip-dir','moment','mustache','util','path','sox','to-csv','fs-extra','lodash','squel','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/license/util','../../mysqldb','redis','defaults','localhost','./chatMessage.socket','register','jayson/promise','client','http','then','info','ChatMessage,\x20%s,\x20%s','request\x20sent','debug','ChatMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','sendStatus','end','status','json','offset','undefined','count','limit','set','Content-Range','reject','save','update','destroy','stack','name','send','map','ChatMessage','fieldName','type','keys','query','filters','intersection','attributes','fields','length','model','hasOwnProperty','nolimit','sort','where','pick','filter','merge','VIRTUAL','includeAll','include','findAll','rows','show','params','body','find','describe','../../config/logger','accept','read','readAt','YYYY-MM-DD\x20HH:mm:ss','UserId','agent','get','ChatInteractionId','isNil','read1stAt','format'];(function(_0x4b56d2,_0x4c1a0f){var _0x4e29bd=function(_0x5c2292){while(--_0x5c2292){_0x4b56d2['push'](_0x4b56d2['shift']());}};_0x4e29bd(++_0x4c1a0f);}(_0xa9e0,0x123));var _0x0a9e=function(_0xf71120,_0x25b7f9){_0xf71120=_0xf71120-0x0;var _0xbe2fd3=_0xa9e0[_0xf71120];return _0xbe2fd3;};'use strict';var emlformat=require(_0x0a9e('0x0'));var rimraf=require(_0x0a9e('0x1'));var zipdir=require(_0x0a9e('0x2'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x0a9e('0x3'));var BPromise=require('bluebird');var Mustache=require(_0x0a9e('0x4'));var util=require(_0x0a9e('0x5'));var path=require(_0x0a9e('0x6'));var sox=require(_0x0a9e('0x7'));var csv=require(_0x0a9e('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x0a9e('0x9'));var _=require(_0x0a9e('0xa'));var squel=require(_0x0a9e('0xb'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x0a9e('0xc'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x0a9e('0xd'));var Redis=require(_0x0a9e('0xe'));var authService=require(_0x0a9e('0xf'));var qs=require(_0x0a9e('0x10'));var as=require(_0x0a9e('0x11'));var hardwareService=require(_0x0a9e('0x12'));var logger=require('../../config/logger')('api');var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0x0a9e('0x13'));var db=require(_0x0a9e('0x14'))['db'];config[_0x0a9e('0x15')]=_[_0x0a9e('0x16')](config[_0x0a9e('0x15')],{'host':_0x0a9e('0x17'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x0a9e('0x15')]));require(_0x0a9e('0x18'))[_0x0a9e('0x19')](socket);var jayson=require(_0x0a9e('0x1a'));var client=jayson[_0x0a9e('0x1b')][_0x0a9e('0x1c')]({'port':0x232c});var client9002=jayson['client'][_0x0a9e('0x1c')]({'port':0x232a});function respondWithRpcPromise(_0x5d0880,_0x1985b6,_0x519dfd,_0x16033c){return new BPromise(function(_0x12066b,_0x48f32d){var _0x225616=_0x16033c||client;return _0x225616['request'](_0x5d0880,_0x519dfd)[_0x0a9e('0x1d')](function(_0x478723){logger[_0x0a9e('0x1e')](_0x0a9e('0x1f'),_0x1985b6,_0x0a9e('0x20'));logger[_0x0a9e('0x21')](_0x0a9e('0x22'),_0x1985b6,_0x0a9e('0x20'),JSON[_0x0a9e('0x23')](_0x478723));if(_0x478723[_0x0a9e('0x24')]){if(_0x478723[_0x0a9e('0x24')][_0x0a9e('0x25')]===0x1f4){logger['error'](_0x0a9e('0x1f'),_0x1985b6,_0x478723[_0x0a9e('0x24')]['message']);return _0x48f32d(_0x478723[_0x0a9e('0x24')]['message']);}logger['error'](_0x0a9e('0x1f'),_0x1985b6,_0x478723[_0x0a9e('0x24')][_0x0a9e('0x26')]);return _0x12066b(_0x478723[_0x0a9e('0x24')]['message']);}else{logger[_0x0a9e('0x1e')](_0x0a9e('0x1f'),_0x1985b6,_0x0a9e('0x20'));_0x12066b(_0x478723[_0x0a9e('0x27')][_0x0a9e('0x26')]);}})[_0x0a9e('0x28')](function(_0x16b1ca){logger['error']('ChatMessage,\x20%s,\x20%s',_0x1985b6,_0x16b1ca);_0x48f32d(_0x16b1ca);});});}function respondWithStatusCode(_0x197ec0,_0x3a8e58){_0x3a8e58=_0x3a8e58||0xcc;return function(_0x40c424){if(_0x40c424){return _0x197ec0[_0x0a9e('0x29')](_0x3a8e58);}return _0x197ec0['status'](_0x3a8e58)[_0x0a9e('0x2a')]();};}function respondWithResult(_0x479bc4,_0x45a1e7){_0x45a1e7=_0x45a1e7||0xc8;return function(_0x5bfb33){if(_0x5bfb33){return _0x479bc4[_0x0a9e('0x2b')](_0x45a1e7)[_0x0a9e('0x2c')](_0x5bfb33);}};}function respondWithFilteredResult(_0x25fba9,_0x14433c){return function(_0x140511){if(_0x140511){var _0x1538a4=typeof _0x14433c[_0x0a9e('0x2d')]===_0x0a9e('0x2e')&&typeof _0x14433c['limit']===_0x0a9e('0x2e');var _0x468813=_0x140511[_0x0a9e('0x2f')];var _0x2ec755=_0x1538a4?0x0:_0x14433c['offset'];var _0x15b200=_0x1538a4?_0x140511[_0x0a9e('0x2f')]:_0x14433c[_0x0a9e('0x2d')]+_0x14433c[_0x0a9e('0x30')];var _0x58b06f;if(_0x15b200>=_0x468813){_0x15b200=_0x468813;_0x58b06f=0xc8;}else{_0x58b06f=0xce;}_0x25fba9[_0x0a9e('0x2b')](_0x58b06f);return _0x25fba9[_0x0a9e('0x31')](_0x0a9e('0x32'),_0x2ec755+'-'+_0x15b200+'/'+_0x468813)[_0x0a9e('0x2c')](_0x140511);}return null;};}function patchUpdates(_0x540530){return function(_0x426950){try{jsonpatch['apply'](_0x426950,_0x540530,!![]);}catch(_0x2407f9){return BPromise[_0x0a9e('0x33')](_0x2407f9);}return _0x426950[_0x0a9e('0x34')]();};}function saveUpdates(_0x33bdb7,_0x25ce3a){return function(_0x5180f1){if(_0x5180f1){return _0x5180f1[_0x0a9e('0x35')](_0x33bdb7)[_0x0a9e('0x1d')](function(_0x40cb85){return _0x40cb85;});}return null;};}function removeEntity(_0x2da5c0,_0x2b45ea){return function(_0x409319){if(_0x409319){return _0x409319[_0x0a9e('0x36')]()[_0x0a9e('0x1d')](function(){_0x2da5c0['status'](0xcc)[_0x0a9e('0x2a')]();});}};}function handleEntityNotFound(_0x5e7238,_0x2cc7a0){return function(_0x14b13f){if(!_0x14b13f){_0x5e7238[_0x0a9e('0x29')](0x194);}return _0x14b13f;};}function handleError(_0x3f3d41,_0x567193){_0x567193=_0x567193||0x1f4;return function(_0x191e91){logger[_0x0a9e('0x24')](_0x191e91[_0x0a9e('0x37')]);if(_0x191e91[_0x0a9e('0x38')]){delete _0x191e91['name'];}_0x3f3d41['status'](_0x567193)[_0x0a9e('0x39')](_0x191e91);};}exports['index']=function(_0x24936a,_0x3d9717){var _0x381c37={},_0x1ef87a={},_0x4f41ae={'count':0x0,'rows':[]};var _0x31916f=_[_0x0a9e('0x3a')](db[_0x0a9e('0x3b')]['rawAttributes'],function(_0x1dbf74){return{'name':_0x1dbf74[_0x0a9e('0x3c')],'type':_0x1dbf74[_0x0a9e('0x3d')]['key']};});_0x1ef87a['model']=_[_0x0a9e('0x3a')](_0x31916f,_0x0a9e('0x38'));_0x1ef87a['query']=_[_0x0a9e('0x3e')](_0x24936a[_0x0a9e('0x3f')]);_0x1ef87a[_0x0a9e('0x40')]=_[_0x0a9e('0x41')](_0x1ef87a['model'],_0x1ef87a['query']);_0x381c37[_0x0a9e('0x42')]=_[_0x0a9e('0x41')](_0x1ef87a['model'],qs[_0x0a9e('0x43')](_0x24936a[_0x0a9e('0x3f')][_0x0a9e('0x43')]));_0x381c37['attributes']=_0x381c37[_0x0a9e('0x42')][_0x0a9e('0x44')]?_0x381c37[_0x0a9e('0x42')]:_0x1ef87a[_0x0a9e('0x45')];if(!_0x24936a[_0x0a9e('0x3f')][_0x0a9e('0x46')](_0x0a9e('0x47'))){_0x381c37[_0x0a9e('0x30')]=qs[_0x0a9e('0x30')](_0x24936a[_0x0a9e('0x3f')][_0x0a9e('0x30')]);_0x381c37[_0x0a9e('0x2d')]=qs[_0x0a9e('0x2d')](_0x24936a[_0x0a9e('0x3f')][_0x0a9e('0x2d')]);}_0x381c37['order']=qs['sort'](_0x24936a[_0x0a9e('0x3f')][_0x0a9e('0x48')]);_0x381c37[_0x0a9e('0x49')]=qs[_0x0a9e('0x40')](_[_0x0a9e('0x4a')](_0x24936a[_0x0a9e('0x3f')],_0x1ef87a[_0x0a9e('0x40')]),_0x31916f);if(_0x24936a[_0x0a9e('0x3f')][_0x0a9e('0x4b')]){_0x381c37[_0x0a9e('0x49')]=_[_0x0a9e('0x4c')](_0x381c37[_0x0a9e('0x49')],{'$or':_['map'](_0x31916f,function(_0x117c99){if(_0x117c99[_0x0a9e('0x3d')]!==_0x0a9e('0x4d')){var _0xfbd5ad={};_0xfbd5ad[_0x117c99[_0x0a9e('0x38')]]={'$like':'%'+_0x24936a[_0x0a9e('0x3f')][_0x0a9e('0x4b')]+'%'};return _0xfbd5ad;}})});}_0x381c37=_[_0x0a9e('0x4c')]({},_0x381c37,_0x24936a['options']);var _0x2e9d90={'where':_0x381c37['where']};return db[_0x0a9e('0x3b')][_0x0a9e('0x2f')](_0x2e9d90)[_0x0a9e('0x1d')](function(_0x562fb4){_0x4f41ae[_0x0a9e('0x2f')]=_0x562fb4;if(_0x24936a[_0x0a9e('0x3f')][_0x0a9e('0x4e')]){_0x381c37[_0x0a9e('0x4f')]=[{'all':!![]}];}return db[_0x0a9e('0x3b')][_0x0a9e('0x50')](_0x381c37);})[_0x0a9e('0x1d')](function(_0x5bbcde){_0x4f41ae[_0x0a9e('0x51')]=_0x5bbcde;return _0x4f41ae;})[_0x0a9e('0x1d')](respondWithFilteredResult(_0x3d9717,_0x381c37))[_0x0a9e('0x28')](handleError(_0x3d9717,null));};exports[_0x0a9e('0x52')]=function(_0x409789,_0x992c77){var _0x6054ee={'raw':!![],'where':{'id':_0x409789[_0x0a9e('0x53')]['id']}},_0x19383e={};_0x19383e['model']=_[_0x0a9e('0x3e')](db[_0x0a9e('0x3b')]['rawAttributes']);_0x19383e['query']=_['keys'](_0x409789[_0x0a9e('0x3f')]);_0x19383e[_0x0a9e('0x40')]=_[_0x0a9e('0x41')](_0x19383e[_0x0a9e('0x45')],_0x19383e[_0x0a9e('0x3f')]);_0x6054ee[_0x0a9e('0x42')]=_[_0x0a9e('0x41')](_0x19383e[_0x0a9e('0x45')],qs['fields'](_0x409789['query']['fields']));_0x6054ee[_0x0a9e('0x42')]=_0x6054ee[_0x0a9e('0x42')][_0x0a9e('0x44')]?_0x6054ee['attributes']:_0x19383e[_0x0a9e('0x45')];if(_0x409789[_0x0a9e('0x3f')]['includeAll']){_0x6054ee['include']=[{'all':!![]}];}_0x6054ee=_[_0x0a9e('0x4c')]({},_0x6054ee,_0x409789['options']);return db[_0x0a9e('0x3b')]['find'](_0x6054ee)[_0x0a9e('0x1d')](handleEntityNotFound(_0x992c77,null))[_0x0a9e('0x1d')](respondWithResult(_0x992c77,null))[_0x0a9e('0x28')](handleError(_0x992c77,null));};exports['create']=function(_0x2f82da,_0x1bf38a){return db['ChatMessage']['create'](_0x2f82da[_0x0a9e('0x54')],{})[_0x0a9e('0x1d')](respondWithResult(_0x1bf38a,0xc9))['catch'](handleError(_0x1bf38a,null));};exports[_0x0a9e('0x35')]=function(_0x5ce9ac,_0x211ef9){if(_0x5ce9ac['body']['id']){delete _0x5ce9ac[_0x0a9e('0x54')]['id'];}return db['ChatMessage']['find']({'where':{'id':_0x5ce9ac['params']['id']}})[_0x0a9e('0x1d')](handleEntityNotFound(_0x211ef9,null))['then'](saveUpdates(_0x5ce9ac[_0x0a9e('0x54')],null))[_0x0a9e('0x1d')](respondWithResult(_0x211ef9,null))[_0x0a9e('0x28')](handleError(_0x211ef9,null));};exports[_0x0a9e('0x36')]=function(_0x232830,_0x272738){return db[_0x0a9e('0x3b')][_0x0a9e('0x55')]({'where':{'id':_0x232830['params']['id']}})[_0x0a9e('0x1d')](handleEntityNotFound(_0x272738,null))[_0x0a9e('0x1d')](removeEntity(_0x272738,null))[_0x0a9e('0x28')](handleError(_0x272738,null));};exports[_0x0a9e('0x56')]=function(_0xb83dfd,_0x156662){return db['ChatMessage'][_0x0a9e('0x56')]()[_0x0a9e('0x1d')](respondWithResult(_0x156662,null))['catch'](handleError(_0x156662,null));};var interaction_log=require(_0x0a9e('0x57'))('chat-interactions');exports[_0x0a9e('0x58')]=function(_0x5ba1f9,_0x4b3c1a,_0x5674ee){var _0x273cb5={'agent':{},'channel':'chat'};if(_0x5ba1f9[_0x0a9e('0x54')]['id']){delete _0x5ba1f9[_0x0a9e('0x54')]['id'];}_0x5ba1f9[_0x0a9e('0x54')][_0x0a9e('0x59')]=!![];_0x5ba1f9[_0x0a9e('0x54')][_0x0a9e('0x5a')]=moment()['format'](_0x0a9e('0x5b'));_0x5ba1f9['body'][_0x0a9e('0x5c')]=_0x5ba1f9[_0x0a9e('0x54')][_0x0a9e('0x5c')]||_0x5ba1f9['user']['id'];_0x273cb5[_0x0a9e('0x5d')]['id']=_0x5ba1f9[_0x0a9e('0x54')][_0x0a9e('0x5c')];return db[_0x0a9e('0x3b')]['find']({'where':{'id':_0x5ba1f9[_0x0a9e('0x53')]['id'],'UserId':null}})[_0x0a9e('0x1d')](handleEntityNotFound(_0x4b3c1a,null))['then'](saveUpdates(_0x5ba1f9[_0x0a9e('0x54')],null))[_0x0a9e('0x1d')](function(_0x88dcbf){if(_0x88dcbf){_0x273cb5[_0x0a9e('0x26')]=_0x88dcbf[_0x0a9e('0x5e')]({'plain':!![]});return db['ChatInteraction'][_0x0a9e('0x55')]({'where':{'id':_0x88dcbf[_0x0a9e('0x5f')]}});}return null;})[_0x0a9e('0x1d')](handleEntityNotFound(_0x4b3c1a,null))['then'](function(_0x3528b7){if(_0x3528b7){return _0x3528b7['update']({'UserId':_0x5ba1f9['body'][_0x0a9e('0x5c')],'read1stAt':_[_0x0a9e('0x60')](_0x3528b7[_0x0a9e('0x61')])?moment()[_0x0a9e('0x62')](_0x0a9e('0x5b')):undefined});}return null;})[_0x0a9e('0x1d')](function(_0x387489){if(_0x387489){_0x273cb5[_0x0a9e('0x63')]=_0x387489[_0x0a9e('0x5e')]({'plain':!![]});interaction_log[_0x0a9e('0x1e')](_0x0a9e('0x64'),_0x5ba1f9[_0x0a9e('0x65')]['id'],_0x5ba1f9[_0x0a9e('0x65')][_0x0a9e('0x38')],_0x5ba1f9[_0x0a9e('0x65')][_0x0a9e('0x66')],_0x273cb5[_0x0a9e('0x63')]['id'],_0x5ba1f9[_0x0a9e('0x54')]?JSON['stringify'](_0x5ba1f9[_0x0a9e('0x54')]):_0x0a9e('0x67'));return respondWithRpcPromise(_0x0a9e('0x68'),'acceptMessage',_0x273cb5);}return null;})[_0x0a9e('0x1d')](function(_0x30944e){var _0x4b341d=_0x0a9e('0x69')+_0x30944e[_0x0a9e('0x26')][_0x0a9e('0x6a')];return db[_0x0a9e('0x6b')][_0x0a9e('0x3f')](_0x4b341d,{'type':db['Sequelize']['QueryTypes']['SELECT'],'raw':!![]})[_0x0a9e('0x1d')](function(_0x18bf5d){return _0x18bf5d;});})[_0x0a9e('0x1d')](function(_0x23a7d3){if(_0x23a7d3){_0x273cb5[_0x0a9e('0x26')][_0x0a9e('0x6c')]=_0x23a7d3[0x0];if(!_0x5ba1f9[_0x0a9e('0x54')][_0x0a9e('0x5c')])return;return db['User'][_0x0a9e('0x55')]({'where':{'id':_0x5ba1f9[_0x0a9e('0x54')][_0x0a9e('0x5c')],'role':'agent'},'attributes':['id',_0x0a9e('0x38'),'fullname',_0x0a9e('0x6d'),_0x0a9e('0x6e')],'raw':!![]});}return null;})['then'](function(_0x2ed01e){if(!_0x2ed01e)return null;_0x273cb5[_0x0a9e('0x26')][_0x0a9e('0x5d')]=_0x2ed01e;return _0x273cb5;})[_0x0a9e('0x1d')](function(_0x542ece){if(_0x542ece){if(_0x5ba1f9[_0x0a9e('0x54')][_0x0a9e('0x6f')]){_0x273cb5[_0x0a9e('0x26')][_0x0a9e('0x70')]=util['format'](_0x0a9e('0x71'),_0x5ba1f9[_0x0a9e('0x65')][_0x0a9e('0x38')]);_0x273cb5[_0x0a9e('0x26')]['channel']=_0x273cb5[_0x0a9e('0x72')];_0x273cb5[_0x0a9e('0x26')][_0x0a9e('0x73')]=_0x0a9e('0x58');return respondWithRpcPromise(_0x0a9e('0x74'),_0x0a9e('0x74'),{'event':_0x0a9e('0x75'),'message':_[_0x0a9e('0x4c')](_0x273cb5[_0x0a9e('0x26')],JSON[_0x0a9e('0x76')](_0x273cb5[_0x0a9e('0x63')][_0x0a9e('0x77')]))},client9002)[_0x0a9e('0x1d')](function(){return _0x273cb5;});}return _0x273cb5;}return null;})[_0x0a9e('0x1d')](respondWithResult(_0x4b3c1a,null))['catch'](handleError(_0x4b3c1a,null));};var interaction_log=require(_0x0a9e('0x57'))(_0x0a9e('0x78'));exports[_0x0a9e('0x33')]=function(_0x563627,_0x3736e0,_0x33dda0){var _0x8cea96={'agent':{},'channel':_0x0a9e('0x79')};if(_0x563627['body']['id']){delete _0x563627['body']['id'];}_0x563627[_0x0a9e('0x54')][_0x0a9e('0x5c')]=_0x563627['body'][_0x0a9e('0x5c')]||_0x563627['user']['id'];_0x8cea96[_0x0a9e('0x5d')]['id']=_0x563627[_0x0a9e('0x54')]['UserId'];return db[_0x0a9e('0x3b')][_0x0a9e('0x55')]({'where':{'id':_0x563627[_0x0a9e('0x53')]['id'],'UserId':null}})[_0x0a9e('0x1d')](handleEntityNotFound(_0x3736e0,null))[_0x0a9e('0x1d')](function(_0x1f42a0){if(_0x1f42a0){_0x8cea96[_0x0a9e('0x26')]=_0x1f42a0['get']({'plain':!![]});return db[_0x0a9e('0x7a')][_0x0a9e('0x55')]({'where':{'id':_0x1f42a0[_0x0a9e('0x5f')]}});}return null;})[_0x0a9e('0x1d')](handleEntityNotFound(_0x3736e0,null))['then'](function(_0xf51744){if(_0xf51744){_0x8cea96[_0x0a9e('0x63')]=_0xf51744['get']({'plain':!![]});interaction_log[_0x0a9e('0x1e')]('[CHATMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s',_0x563627[_0x0a9e('0x65')]['id'],_0x563627[_0x0a9e('0x65')][_0x0a9e('0x38')],_0x563627[_0x0a9e('0x65')]['role'],_0x8cea96['interaction']['id'],_0x563627[_0x0a9e('0x54')]?JSON[_0x0a9e('0x23')](_0x563627[_0x0a9e('0x54')]):'null');return respondWithRpcPromise(_0x0a9e('0x7b'),_0x0a9e('0x7c'),_0x8cea96);}return null;})['then'](function(_0x4e46b2){var _0xf0a802='SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20'+_0x4e46b2['message']['ContactId'];return db[_0x0a9e('0x6b')][_0x0a9e('0x3f')](_0xf0a802,{'type':db[_0x0a9e('0x7d')][_0x0a9e('0x7e')][_0x0a9e('0x7f')],'raw':!![]})[_0x0a9e('0x1d')](function(_0x5a8854){return _0x5a8854;});})[_0x0a9e('0x1d')](function(_0x5955f1){if(_0x5955f1){_0x8cea96[_0x0a9e('0x26')][_0x0a9e('0x6c')]=_0x5955f1[0x0];if(!_0x563627[_0x0a9e('0x54')][_0x0a9e('0x5c')])return;return db['User'][_0x0a9e('0x55')]({'where':{'id':_0x563627[_0x0a9e('0x54')][_0x0a9e('0x5c')],'role':'agent'},'attributes':['id',_0x0a9e('0x38'),_0x0a9e('0x80'),_0x0a9e('0x6d'),_0x0a9e('0x6e')],'raw':!![]});}return null;})[_0x0a9e('0x1d')](function(_0x1910bf){if(!_0x1910bf)return null;_0x8cea96[_0x0a9e('0x26')][_0x0a9e('0x5d')]=_0x1910bf;return _0x8cea96;})['then'](function(_0x2645d6){if(_0x2645d6){_0x2645d6[_0x0a9e('0x26')]['interface']=util[_0x0a9e('0x62')](_0x0a9e('0x71'),_0x563627[_0x0a9e('0x65')]['name']);_0x2645d6[_0x0a9e('0x26')]['channel']=_0x8cea96[_0x0a9e('0x72')];_0x2645d6[_0x0a9e('0x26')][_0x0a9e('0x73')]=_0x0a9e('0x33');respondWithRpcPromise(_0x0a9e('0x74'),_0x0a9e('0x74'),{'event':_0x0a9e('0x81'),'message':_[_0x0a9e('0x4c')](_0x8cea96['message'],JSON[_0x0a9e('0x76')](_0x8cea96[_0x0a9e('0x63')][_0x0a9e('0x77')]))},client9002);return _0x8cea96;}return null;})[_0x0a9e('0x1d')](respondWithResult(_0x3736e0,null))[_0x0a9e('0x28')](handleError(_0x3736e0,null));};
\ No newline at end of file
+var _0xa9e0=['interaction','[CHATMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','user','role','null','AcceptMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','ContactId','sequelize','contact','email','internal','manual','interface','SIP/%s','channel','event','EventManager','acceptmessage','parse','formData','chat-interactions','chat','ChatInteraction','RejectMessage','rejectMessage','Sequelize','QueryTypes','SELECT','fullname','rejectmessage','eml-format','rimraf','zip-dir','moment','mustache','util','path','sox','to-csv','fs-extra','lodash','squel','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/license/util','../../mysqldb','redis','defaults','localhost','./chatMessage.socket','register','jayson/promise','client','http','then','info','ChatMessage,\x20%s,\x20%s','request\x20sent','debug','ChatMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','sendStatus','end','status','json','offset','undefined','count','limit','set','Content-Range','reject','save','update','destroy','stack','name','send','map','ChatMessage','fieldName','type','keys','query','filters','intersection','attributes','fields','length','model','hasOwnProperty','nolimit','sort','where','pick','filter','merge','VIRTUAL','includeAll','include','findAll','rows','show','params','body','find','describe','../../config/logger','accept','read','readAt','YYYY-MM-DD\x20HH:mm:ss','UserId','agent','get','ChatInteractionId','isNil','read1stAt','format'];(function(_0x39ae83,_0x39164a){var _0x28d251=function(_0x55e6fe){while(--_0x55e6fe){_0x39ae83['push'](_0x39ae83['shift']());}};_0x28d251(++_0x39164a);}(_0xa9e0,0x123));var _0x0a9e=function(_0x2d8fc2,_0x1c461d){_0x2d8fc2=_0x2d8fc2-0x0;var _0x3a9e53=_0xa9e0[_0x2d8fc2];return _0x3a9e53;};'use strict';var emlformat=require(_0x0a9e('0x0'));var rimraf=require(_0x0a9e('0x1'));var zipdir=require(_0x0a9e('0x2'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x0a9e('0x3'));var BPromise=require('bluebird');var Mustache=require(_0x0a9e('0x4'));var util=require(_0x0a9e('0x5'));var path=require(_0x0a9e('0x6'));var sox=require(_0x0a9e('0x7'));var csv=require(_0x0a9e('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x0a9e('0x9'));var _=require(_0x0a9e('0xa'));var squel=require(_0x0a9e('0xb'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x0a9e('0xc'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x0a9e('0xd'));var Redis=require(_0x0a9e('0xe'));var authService=require(_0x0a9e('0xf'));var qs=require(_0x0a9e('0x10'));var as=require(_0x0a9e('0x11'));var hardwareService=require(_0x0a9e('0x12'));var logger=require('../../config/logger')('api');var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0x0a9e('0x13'));var db=require(_0x0a9e('0x14'))['db'];config[_0x0a9e('0x15')]=_[_0x0a9e('0x16')](config[_0x0a9e('0x15')],{'host':_0x0a9e('0x17'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x0a9e('0x15')]));require(_0x0a9e('0x18'))[_0x0a9e('0x19')](socket);var jayson=require(_0x0a9e('0x1a'));var client=jayson[_0x0a9e('0x1b')][_0x0a9e('0x1c')]({'port':0x232c});var client9002=jayson['client'][_0x0a9e('0x1c')]({'port':0x232a});function respondWithRpcPromise(_0x5d0880,_0x1985b6,_0x519dfd,_0x16033c){return new BPromise(function(_0x12066b,_0x48f32d){var _0x225616=_0x16033c||client;return _0x225616['request'](_0x5d0880,_0x519dfd)[_0x0a9e('0x1d')](function(_0x478723){logger[_0x0a9e('0x1e')](_0x0a9e('0x1f'),_0x1985b6,_0x0a9e('0x20'));logger[_0x0a9e('0x21')](_0x0a9e('0x22'),_0x1985b6,_0x0a9e('0x20'),JSON[_0x0a9e('0x23')](_0x478723));if(_0x478723[_0x0a9e('0x24')]){if(_0x478723[_0x0a9e('0x24')][_0x0a9e('0x25')]===0x1f4){logger['error'](_0x0a9e('0x1f'),_0x1985b6,_0x478723[_0x0a9e('0x24')]['message']);return _0x48f32d(_0x478723[_0x0a9e('0x24')]['message']);}logger['error'](_0x0a9e('0x1f'),_0x1985b6,_0x478723[_0x0a9e('0x24')][_0x0a9e('0x26')]);return _0x12066b(_0x478723[_0x0a9e('0x24')]['message']);}else{logger[_0x0a9e('0x1e')](_0x0a9e('0x1f'),_0x1985b6,_0x0a9e('0x20'));_0x12066b(_0x478723[_0x0a9e('0x27')][_0x0a9e('0x26')]);}})[_0x0a9e('0x28')](function(_0x16b1ca){logger['error']('ChatMessage,\x20%s,\x20%s',_0x1985b6,_0x16b1ca);_0x48f32d(_0x16b1ca);});});}function respondWithStatusCode(_0x197ec0,_0x3a8e58){_0x3a8e58=_0x3a8e58||0xcc;return function(_0x40c424){if(_0x40c424){return _0x197ec0[_0x0a9e('0x29')](_0x3a8e58);}return _0x197ec0['status'](_0x3a8e58)[_0x0a9e('0x2a')]();};}function respondWithResult(_0x479bc4,_0x45a1e7){_0x45a1e7=_0x45a1e7||0xc8;return function(_0x5bfb33){if(_0x5bfb33){return _0x479bc4[_0x0a9e('0x2b')](_0x45a1e7)[_0x0a9e('0x2c')](_0x5bfb33);}};}function respondWithFilteredResult(_0x25fba9,_0x14433c){return function(_0x140511){if(_0x140511){var _0x1538a4=typeof _0x14433c[_0x0a9e('0x2d')]===_0x0a9e('0x2e')&&typeof _0x14433c['limit']===_0x0a9e('0x2e');var _0x468813=_0x140511[_0x0a9e('0x2f')];var _0x2ec755=_0x1538a4?0x0:_0x14433c['offset'];var _0x15b200=_0x1538a4?_0x140511[_0x0a9e('0x2f')]:_0x14433c[_0x0a9e('0x2d')]+_0x14433c[_0x0a9e('0x30')];var _0x58b06f;if(_0x15b200>=_0x468813){_0x15b200=_0x468813;_0x58b06f=0xc8;}else{_0x58b06f=0xce;}_0x25fba9[_0x0a9e('0x2b')](_0x58b06f);return _0x25fba9[_0x0a9e('0x31')](_0x0a9e('0x32'),_0x2ec755+'-'+_0x15b200+'/'+_0x468813)[_0x0a9e('0x2c')](_0x140511);}return null;};}function patchUpdates(_0x540530){return function(_0x426950){try{jsonpatch['apply'](_0x426950,_0x540530,!![]);}catch(_0x2407f9){return BPromise[_0x0a9e('0x33')](_0x2407f9);}return _0x426950[_0x0a9e('0x34')]();};}function saveUpdates(_0x33bdb7,_0x25ce3a){return function(_0x5180f1){if(_0x5180f1){return _0x5180f1[_0x0a9e('0x35')](_0x33bdb7)[_0x0a9e('0x1d')](function(_0x40cb85){return _0x40cb85;});}return null;};}function removeEntity(_0x2da5c0,_0x2b45ea){return function(_0x409319){if(_0x409319){return _0x409319[_0x0a9e('0x36')]()[_0x0a9e('0x1d')](function(){_0x2da5c0['status'](0xcc)[_0x0a9e('0x2a')]();});}};}function handleEntityNotFound(_0x5e7238,_0x2cc7a0){return function(_0x14b13f){if(!_0x14b13f){_0x5e7238[_0x0a9e('0x29')](0x194);}return _0x14b13f;};}function handleError(_0x3f3d41,_0x567193){_0x567193=_0x567193||0x1f4;return function(_0x191e91){logger[_0x0a9e('0x24')](_0x191e91[_0x0a9e('0x37')]);if(_0x191e91[_0x0a9e('0x38')]){delete _0x191e91['name'];}_0x3f3d41['status'](_0x567193)[_0x0a9e('0x39')](_0x191e91);};}exports['index']=function(_0x24936a,_0x3d9717){var _0x381c37={},_0x1ef87a={},_0x4f41ae={'count':0x0,'rows':[]};var _0x31916f=_[_0x0a9e('0x3a')](db[_0x0a9e('0x3b')]['rawAttributes'],function(_0x1dbf74){return{'name':_0x1dbf74[_0x0a9e('0x3c')],'type':_0x1dbf74[_0x0a9e('0x3d')]['key']};});_0x1ef87a['model']=_[_0x0a9e('0x3a')](_0x31916f,_0x0a9e('0x38'));_0x1ef87a['query']=_[_0x0a9e('0x3e')](_0x24936a[_0x0a9e('0x3f')]);_0x1ef87a[_0x0a9e('0x40')]=_[_0x0a9e('0x41')](_0x1ef87a['model'],_0x1ef87a['query']);_0x381c37[_0x0a9e('0x42')]=_[_0x0a9e('0x41')](_0x1ef87a['model'],qs[_0x0a9e('0x43')](_0x24936a[_0x0a9e('0x3f')][_0x0a9e('0x43')]));_0x381c37['attributes']=_0x381c37[_0x0a9e('0x42')][_0x0a9e('0x44')]?_0x381c37[_0x0a9e('0x42')]:_0x1ef87a[_0x0a9e('0x45')];if(!_0x24936a[_0x0a9e('0x3f')][_0x0a9e('0x46')](_0x0a9e('0x47'))){_0x381c37[_0x0a9e('0x30')]=qs[_0x0a9e('0x30')](_0x24936a[_0x0a9e('0x3f')][_0x0a9e('0x30')]);_0x381c37[_0x0a9e('0x2d')]=qs[_0x0a9e('0x2d')](_0x24936a[_0x0a9e('0x3f')][_0x0a9e('0x2d')]);}_0x381c37['order']=qs['sort'](_0x24936a[_0x0a9e('0x3f')][_0x0a9e('0x48')]);_0x381c37[_0x0a9e('0x49')]=qs[_0x0a9e('0x40')](_[_0x0a9e('0x4a')](_0x24936a[_0x0a9e('0x3f')],_0x1ef87a[_0x0a9e('0x40')]),_0x31916f);if(_0x24936a[_0x0a9e('0x3f')][_0x0a9e('0x4b')]){_0x381c37[_0x0a9e('0x49')]=_[_0x0a9e('0x4c')](_0x381c37[_0x0a9e('0x49')],{'$or':_['map'](_0x31916f,function(_0x117c99){if(_0x117c99[_0x0a9e('0x3d')]!==_0x0a9e('0x4d')){var _0xfbd5ad={};_0xfbd5ad[_0x117c99[_0x0a9e('0x38')]]={'$like':'%'+_0x24936a[_0x0a9e('0x3f')][_0x0a9e('0x4b')]+'%'};return _0xfbd5ad;}})});}_0x381c37=_[_0x0a9e('0x4c')]({},_0x381c37,_0x24936a['options']);var _0x2e9d90={'where':_0x381c37['where']};return db[_0x0a9e('0x3b')][_0x0a9e('0x2f')](_0x2e9d90)[_0x0a9e('0x1d')](function(_0x562fb4){_0x4f41ae[_0x0a9e('0x2f')]=_0x562fb4;if(_0x24936a[_0x0a9e('0x3f')][_0x0a9e('0x4e')]){_0x381c37[_0x0a9e('0x4f')]=[{'all':!![]}];}return db[_0x0a9e('0x3b')][_0x0a9e('0x50')](_0x381c37);})[_0x0a9e('0x1d')](function(_0x5bbcde){_0x4f41ae[_0x0a9e('0x51')]=_0x5bbcde;return _0x4f41ae;})[_0x0a9e('0x1d')](respondWithFilteredResult(_0x3d9717,_0x381c37))[_0x0a9e('0x28')](handleError(_0x3d9717,null));};exports[_0x0a9e('0x52')]=function(_0x409789,_0x992c77){var _0x6054ee={'raw':!![],'where':{'id':_0x409789[_0x0a9e('0x53')]['id']}},_0x19383e={};_0x19383e['model']=_[_0x0a9e('0x3e')](db[_0x0a9e('0x3b')]['rawAttributes']);_0x19383e['query']=_['keys'](_0x409789[_0x0a9e('0x3f')]);_0x19383e[_0x0a9e('0x40')]=_[_0x0a9e('0x41')](_0x19383e[_0x0a9e('0x45')],_0x19383e[_0x0a9e('0x3f')]);_0x6054ee[_0x0a9e('0x42')]=_[_0x0a9e('0x41')](_0x19383e[_0x0a9e('0x45')],qs['fields'](_0x409789['query']['fields']));_0x6054ee[_0x0a9e('0x42')]=_0x6054ee[_0x0a9e('0x42')][_0x0a9e('0x44')]?_0x6054ee['attributes']:_0x19383e[_0x0a9e('0x45')];if(_0x409789[_0x0a9e('0x3f')]['includeAll']){_0x6054ee['include']=[{'all':!![]}];}_0x6054ee=_[_0x0a9e('0x4c')]({},_0x6054ee,_0x409789['options']);return db[_0x0a9e('0x3b')]['find'](_0x6054ee)[_0x0a9e('0x1d')](handleEntityNotFound(_0x992c77,null))[_0x0a9e('0x1d')](respondWithResult(_0x992c77,null))[_0x0a9e('0x28')](handleError(_0x992c77,null));};exports['create']=function(_0x2f82da,_0x1bf38a){return db['ChatMessage']['create'](_0x2f82da[_0x0a9e('0x54')],{})[_0x0a9e('0x1d')](respondWithResult(_0x1bf38a,0xc9))['catch'](handleError(_0x1bf38a,null));};exports[_0x0a9e('0x35')]=function(_0x5ce9ac,_0x211ef9){if(_0x5ce9ac['body']['id']){delete _0x5ce9ac[_0x0a9e('0x54')]['id'];}return db['ChatMessage']['find']({'where':{'id':_0x5ce9ac['params']['id']}})[_0x0a9e('0x1d')](handleEntityNotFound(_0x211ef9,null))['then'](saveUpdates(_0x5ce9ac[_0x0a9e('0x54')],null))[_0x0a9e('0x1d')](respondWithResult(_0x211ef9,null))[_0x0a9e('0x28')](handleError(_0x211ef9,null));};exports[_0x0a9e('0x36')]=function(_0x232830,_0x272738){return db[_0x0a9e('0x3b')][_0x0a9e('0x55')]({'where':{'id':_0x232830['params']['id']}})[_0x0a9e('0x1d')](handleEntityNotFound(_0x272738,null))[_0x0a9e('0x1d')](removeEntity(_0x272738,null))[_0x0a9e('0x28')](handleError(_0x272738,null));};exports[_0x0a9e('0x56')]=function(_0xb83dfd,_0x156662){return db['ChatMessage'][_0x0a9e('0x56')]()[_0x0a9e('0x1d')](respondWithResult(_0x156662,null))['catch'](handleError(_0x156662,null));};var interaction_log=require(_0x0a9e('0x57'))('chat-interactions');exports[_0x0a9e('0x58')]=function(_0x5ba1f9,_0x4b3c1a,_0x5674ee){var _0x273cb5={'agent':{},'channel':'chat'};if(_0x5ba1f9[_0x0a9e('0x54')]['id']){delete _0x5ba1f9[_0x0a9e('0x54')]['id'];}_0x5ba1f9[_0x0a9e('0x54')][_0x0a9e('0x59')]=!![];_0x5ba1f9[_0x0a9e('0x54')][_0x0a9e('0x5a')]=moment()['format'](_0x0a9e('0x5b'));_0x5ba1f9['body'][_0x0a9e('0x5c')]=_0x5ba1f9[_0x0a9e('0x54')][_0x0a9e('0x5c')]||_0x5ba1f9['user']['id'];_0x273cb5[_0x0a9e('0x5d')]['id']=_0x5ba1f9[_0x0a9e('0x54')][_0x0a9e('0x5c')];return db[_0x0a9e('0x3b')]['find']({'where':{'id':_0x5ba1f9[_0x0a9e('0x53')]['id'],'UserId':null}})[_0x0a9e('0x1d')](handleEntityNotFound(_0x4b3c1a,null))['then'](saveUpdates(_0x5ba1f9[_0x0a9e('0x54')],null))[_0x0a9e('0x1d')](function(_0x88dcbf){if(_0x88dcbf){_0x273cb5[_0x0a9e('0x26')]=_0x88dcbf[_0x0a9e('0x5e')]({'plain':!![]});return db['ChatInteraction'][_0x0a9e('0x55')]({'where':{'id':_0x88dcbf[_0x0a9e('0x5f')]}});}return null;})[_0x0a9e('0x1d')](handleEntityNotFound(_0x4b3c1a,null))['then'](function(_0x3528b7){if(_0x3528b7){return _0x3528b7['update']({'UserId':_0x5ba1f9['body'][_0x0a9e('0x5c')],'read1stAt':_[_0x0a9e('0x60')](_0x3528b7[_0x0a9e('0x61')])?moment()[_0x0a9e('0x62')](_0x0a9e('0x5b')):undefined});}return null;})[_0x0a9e('0x1d')](function(_0x387489){if(_0x387489){_0x273cb5[_0x0a9e('0x63')]=_0x387489[_0x0a9e('0x5e')]({'plain':!![]});interaction_log[_0x0a9e('0x1e')](_0x0a9e('0x64'),_0x5ba1f9[_0x0a9e('0x65')]['id'],_0x5ba1f9[_0x0a9e('0x65')][_0x0a9e('0x38')],_0x5ba1f9[_0x0a9e('0x65')][_0x0a9e('0x66')],_0x273cb5[_0x0a9e('0x63')]['id'],_0x5ba1f9[_0x0a9e('0x54')]?JSON['stringify'](_0x5ba1f9[_0x0a9e('0x54')]):_0x0a9e('0x67'));return respondWithRpcPromise(_0x0a9e('0x68'),'acceptMessage',_0x273cb5);}return null;})[_0x0a9e('0x1d')](function(_0x30944e){var _0x4b341d=_0x0a9e('0x69')+_0x30944e[_0x0a9e('0x26')][_0x0a9e('0x6a')];return db[_0x0a9e('0x6b')][_0x0a9e('0x3f')](_0x4b341d,{'type':db['Sequelize']['QueryTypes']['SELECT'],'raw':!![]})[_0x0a9e('0x1d')](function(_0x18bf5d){return _0x18bf5d;});})[_0x0a9e('0x1d')](function(_0x23a7d3){if(_0x23a7d3){_0x273cb5[_0x0a9e('0x26')][_0x0a9e('0x6c')]=_0x23a7d3[0x0];if(!_0x5ba1f9[_0x0a9e('0x54')][_0x0a9e('0x5c')])return;return db['User'][_0x0a9e('0x55')]({'where':{'id':_0x5ba1f9[_0x0a9e('0x54')][_0x0a9e('0x5c')],'role':'agent'},'attributes':['id',_0x0a9e('0x38'),'fullname',_0x0a9e('0x6d'),_0x0a9e('0x6e')],'raw':!![]});}return null;})['then'](function(_0x2ed01e){if(!_0x2ed01e)return null;_0x273cb5[_0x0a9e('0x26')][_0x0a9e('0x5d')]=_0x2ed01e;return _0x273cb5;})[_0x0a9e('0x1d')](function(_0x542ece){if(_0x542ece){if(_0x5ba1f9[_0x0a9e('0x54')][_0x0a9e('0x6f')]){_0x273cb5[_0x0a9e('0x26')][_0x0a9e('0x70')]=util['format'](_0x0a9e('0x71'),_0x5ba1f9[_0x0a9e('0x65')][_0x0a9e('0x38')]);_0x273cb5[_0x0a9e('0x26')]['channel']=_0x273cb5[_0x0a9e('0x72')];_0x273cb5[_0x0a9e('0x26')][_0x0a9e('0x73')]=_0x0a9e('0x58');return respondWithRpcPromise(_0x0a9e('0x74'),_0x0a9e('0x74'),{'event':_0x0a9e('0x75'),'message':_[_0x0a9e('0x4c')](_0x273cb5[_0x0a9e('0x26')],JSON[_0x0a9e('0x76')](_0x273cb5[_0x0a9e('0x63')][_0x0a9e('0x77')]))},client9002)[_0x0a9e('0x1d')](function(){return _0x273cb5;});}return _0x273cb5;}return null;})[_0x0a9e('0x1d')](respondWithResult(_0x4b3c1a,null))['catch'](handleError(_0x4b3c1a,null));};var interaction_log=require(_0x0a9e('0x57'))(_0x0a9e('0x78'));exports[_0x0a9e('0x33')]=function(_0x563627,_0x3736e0,_0x33dda0){var _0x8cea96={'agent':{},'channel':_0x0a9e('0x79')};if(_0x563627['body']['id']){delete _0x563627['body']['id'];}_0x563627[_0x0a9e('0x54')][_0x0a9e('0x5c')]=_0x563627['body'][_0x0a9e('0x5c')]||_0x563627['user']['id'];_0x8cea96[_0x0a9e('0x5d')]['id']=_0x563627[_0x0a9e('0x54')]['UserId'];return db[_0x0a9e('0x3b')][_0x0a9e('0x55')]({'where':{'id':_0x563627[_0x0a9e('0x53')]['id'],'UserId':null}})[_0x0a9e('0x1d')](handleEntityNotFound(_0x3736e0,null))[_0x0a9e('0x1d')](function(_0x1f42a0){if(_0x1f42a0){_0x8cea96[_0x0a9e('0x26')]=_0x1f42a0['get']({'plain':!![]});return db[_0x0a9e('0x7a')][_0x0a9e('0x55')]({'where':{'id':_0x1f42a0[_0x0a9e('0x5f')]}});}return null;})[_0x0a9e('0x1d')](handleEntityNotFound(_0x3736e0,null))['then'](function(_0xf51744){if(_0xf51744){_0x8cea96[_0x0a9e('0x63')]=_0xf51744['get']({'plain':!![]});interaction_log[_0x0a9e('0x1e')]('[CHATMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s',_0x563627[_0x0a9e('0x65')]['id'],_0x563627[_0x0a9e('0x65')][_0x0a9e('0x38')],_0x563627[_0x0a9e('0x65')]['role'],_0x8cea96['interaction']['id'],_0x563627[_0x0a9e('0x54')]?JSON[_0x0a9e('0x23')](_0x563627[_0x0a9e('0x54')]):'null');return respondWithRpcPromise(_0x0a9e('0x7b'),_0x0a9e('0x7c'),_0x8cea96);}return null;})['then'](function(_0x4e46b2){var _0xf0a802='SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20'+_0x4e46b2['message']['ContactId'];return db[_0x0a9e('0x6b')][_0x0a9e('0x3f')](_0xf0a802,{'type':db[_0x0a9e('0x7d')][_0x0a9e('0x7e')][_0x0a9e('0x7f')],'raw':!![]})[_0x0a9e('0x1d')](function(_0x5a8854){return _0x5a8854;});})[_0x0a9e('0x1d')](function(_0x5955f1){if(_0x5955f1){_0x8cea96[_0x0a9e('0x26')][_0x0a9e('0x6c')]=_0x5955f1[0x0];if(!_0x563627[_0x0a9e('0x54')][_0x0a9e('0x5c')])return;return db['User'][_0x0a9e('0x55')]({'where':{'id':_0x563627[_0x0a9e('0x54')][_0x0a9e('0x5c')],'role':'agent'},'attributes':['id',_0x0a9e('0x38'),_0x0a9e('0x80'),_0x0a9e('0x6d'),_0x0a9e('0x6e')],'raw':!![]});}return null;})[_0x0a9e('0x1d')](function(_0x1910bf){if(!_0x1910bf)return null;_0x8cea96[_0x0a9e('0x26')][_0x0a9e('0x5d')]=_0x1910bf;return _0x8cea96;})['then'](function(_0x2645d6){if(_0x2645d6){_0x2645d6[_0x0a9e('0x26')]['interface']=util[_0x0a9e('0x62')](_0x0a9e('0x71'),_0x563627[_0x0a9e('0x65')]['name']);_0x2645d6[_0x0a9e('0x26')]['channel']=_0x8cea96[_0x0a9e('0x72')];_0x2645d6[_0x0a9e('0x26')][_0x0a9e('0x73')]=_0x0a9e('0x33');respondWithRpcPromise(_0x0a9e('0x74'),_0x0a9e('0x74'),{'event':_0x0a9e('0x81'),'message':_[_0x0a9e('0x4c')](_0x8cea96['message'],JSON[_0x0a9e('0x76')](_0x8cea96[_0x0a9e('0x63')][_0x0a9e('0x77')]))},client9002);return _0x8cea96;}return null;})[_0x0a9e('0x1d')](respondWithResult(_0x3736e0,null))[_0x0a9e('0x28')](handleError(_0x3736e0,null));};
\ No newline at end of file
diff --git a/server/api/chatMessage/chatMessage.events.js b/server/api/chatMessage/chatMessage.events.js
index 6ad28d0..50aad4b 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 _0xa5dc=['../../mysqldb','setMaxListeners','save','emit','hook','exports'];(function(_0x1ef452,_0x2c342b){var _0x3f3570=function(_0x1bca85){while(--_0x1bca85){_0x1ef452['push'](_0x1ef452['shift']());}};_0x3f3570(++_0x2c342b);}(_0xa5dc,0x96));var _0xca5d=function(_0x4996dd,_0x1613fc){_0x4996dd=_0x4996dd-0x0;var _0x98b206=_0xa5dc[_0x4996dd];return _0x98b206;};'use strict';var EventEmitter=require('events');var ChatMessage=require(_0xca5d('0x0'))['db']['ChatMessage'];var ChatMessageEvents=new EventEmitter();ChatMessageEvents[_0xca5d('0x1')](0x0);var events={'afterCreate':_0xca5d('0x2'),'afterUpdate':'update','afterDestroy':'remove'};function emitEvent(_0x5613be){return function(_0x5d18f7,_0x910e0c,_0x2abef7){ChatMessageEvents[_0xca5d('0x3')](_0x5613be+':'+_0x5d18f7['id'],_0x5d18f7);ChatMessageEvents[_0xca5d('0x3')](_0x5613be,_0x5d18f7);_0x2abef7(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];ChatMessage[_0xca5d('0x4')](e,emitEvent(event));}}module[_0xca5d('0x5')]=ChatMessageEvents;
\ No newline at end of file
+var _0x7ca1=['hook','exports','events','ChatMessage','save','update','remove','emit','hasOwnProperty'];(function(_0x44c11f,_0x4d12f9){var _0x23796c=function(_0x1dad07){while(--_0x1dad07){_0x44c11f['push'](_0x44c11f['shift']());}};_0x23796c(++_0x4d12f9);}(_0x7ca1,0xe3));var _0x17ca=function(_0x1514e0,_0x1a31a5){_0x1514e0=_0x1514e0-0x0;var _0x1e055d=_0x7ca1[_0x1514e0];return _0x1e055d;};'use strict';var EventEmitter=require(_0x17ca('0x0'));var ChatMessage=require('../../mysqldb')['db'][_0x17ca('0x1')];var ChatMessageEvents=new EventEmitter();ChatMessageEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x17ca('0x2'),'afterUpdate':_0x17ca('0x3'),'afterDestroy':_0x17ca('0x4')};function emitEvent(_0x2cf34f){return function(_0x5465af,_0x3130c4,_0xde6396){ChatMessageEvents['emit'](_0x2cf34f+':'+_0x5465af['id'],_0x5465af);ChatMessageEvents[_0x17ca('0x5')](_0x2cf34f,_0x5465af);_0xde6396(null);};}for(var e in events){if(events[_0x17ca('0x6')](e)){var event=events[e];ChatMessage[_0x17ca('0x7')](e,emitEvent(event));}}module[_0x17ca('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 6118176..90a6191 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 _0x91f4=['error','utf8mb4','utf8mb4_unicode_ci','util','bluebird','path','exports','define','chat_messages','fti_chat_messages','body','FULLTEXT','direction','toLowerCase','secret','isNil','ChatInteraction','findOne','then','update','createdAt','catch'];(function(_0x5f4c61,_0x42e0cf){var _0x16309d=function(_0x5e6127){while(--_0x5e6127){_0x5f4c61['push'](_0x5f4c61['shift']());}};_0x16309d(++_0x42e0cf);}(_0x91f4,0xc9));var _0x491f=function(_0x247449,_0x479b74){_0x247449=_0x247449-0x0;var _0x33471e=_0x91f4[_0x247449];return _0x33471e;};'use strict';var _=require('lodash');var util=require(_0x491f('0x0'));var logger=require('../../config/logger')('api');var moment=require('moment');var BPromise=require(_0x491f('0x1'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x491f('0x2'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require('./chatMessage.attributes');module[_0x491f('0x3')]=function(_0x54d45c,_0x37df6a){return _0x54d45c[_0x491f('0x4')]('ChatMessage',attributes,{'tableName':_0x491f('0x5'),'paranoid':![],'indexes':[{'name':_0x491f('0x6'),'fields':[_0x491f('0x7')],'type':_0x491f('0x8')}],'timestamps':!![],'hooks':{'afterCreate':function(_0x568a46,_0x3d853d,_0x1db77d){var _0x231c33=_0x54d45c['models'];var _0x598ad4=_0x568a46['get']({'plain':!![]});if(_0x598ad4[_0x491f('0x9')][_0x491f('0xa')]()==='in'||_0x598ad4[_0x491f('0x9')]['toLowerCase']()==='out'&&!_0x598ad4[_0x491f('0xb')]&&!_[_0x491f('0xc')](_0x598ad4['UserId'])){_0x231c33[_0x491f('0xd')][_0x491f('0xe')]({'where':{'id':_0x598ad4['ChatInteractionId']}})[_0x491f('0xf')](function(_0x3b4c33){if(_0x3b4c33){_0x3b4c33[_0x491f('0x10')]({'lastMsgAt':_0x598ad4[_0x491f('0x11')],'lastMsgDirection':_0x598ad4[_0x491f('0x9')]['toLowerCase']()});}})[_0x491f('0x12')](function(_0x5be319){console[_0x491f('0x13')](_0x5be319);});}_0x1db77d();}},'charset':_0x491f('0x14'),'collate':_0x491f('0x15')});};
\ No newline at end of file
+var _0x9fcf=['fti_chat_messages','body','FULLTEXT','models','direction','toLowerCase','out','isNil','UserId','findOne','ChatInteractionId','then','utf8mb4','utf8mb4_unicode_ci','lodash','util','../../config/logger','moment','request-promise','rimraf','../../config/environment','exports','chat_messages'];(function(_0x402885,_0x58cee4){var _0x3e2800=function(_0x431243){while(--_0x431243){_0x402885['push'](_0x402885['shift']());}};_0x3e2800(++_0x58cee4);}(_0x9fcf,0x1da));var _0xf9fc=function(_0x173441,_0x26b0d9){_0x173441=_0x173441-0x0;var _0x2423a8=_0x9fcf[_0x173441];return _0x2423a8;};'use strict';var _=require(_0xf9fc('0x0'));var util=require(_0xf9fc('0x1'));var logger=require(_0xf9fc('0x2'))('api');var moment=require(_0xf9fc('0x3'));var BPromise=require('bluebird');var rp=require(_0xf9fc('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0xf9fc('0x5'));var config=require(_0xf9fc('0x6'));var attributes=require('./chatMessage.attributes');module[_0xf9fc('0x7')]=function(_0x579f7c,_0x5a17fc){return _0x579f7c['define']('ChatMessage',attributes,{'tableName':_0xf9fc('0x8'),'paranoid':![],'indexes':[{'name':_0xf9fc('0x9'),'fields':[_0xf9fc('0xa')],'type':_0xf9fc('0xb')}],'timestamps':!![],'hooks':{'afterCreate':function(_0x34e40a,_0x3c5680,_0xe3402){var _0x16182c=_0x579f7c[_0xf9fc('0xc')];var _0x242689=_0x34e40a['get']({'plain':!![]});if(_0x242689[_0xf9fc('0xd')][_0xf9fc('0xe')]()==='in'||_0x242689[_0xf9fc('0xd')]['toLowerCase']()===_0xf9fc('0xf')&&!_0x242689['secret']&&!_[_0xf9fc('0x10')](_0x242689[_0xf9fc('0x11')])){_0x16182c['ChatInteraction'][_0xf9fc('0x12')]({'where':{'id':_0x242689[_0xf9fc('0x13')]}})[_0xf9fc('0x14')](function(_0x3523f9){if(_0x3523f9){_0x3523f9['update']({'lastMsgAt':_0x242689['createdAt'],'lastMsgDirection':_0x242689[_0xf9fc('0xd')][_0xf9fc('0xe')]()});}})['catch'](function(_0x34b6a0){console['error'](_0x34b6a0);});}_0xe3402();}},'charset':_0xf9fc('0x15'),'collate':_0xf9fc('0x16')});};
\ No newline at end of file
diff --git a/server/api/chatMessage/chatMessage.rpc.js b/server/api/chatMessage/chatMessage.rpc.js
index 73bc093..e0401ca 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 _0x4725=['http','defaults','socket.io-emitter','./chatMessage.socket','register','then','info','ChatMessage,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','catch','create','raw','CreateChatMessage','lodash','util','bluebird','randomstring','../../config/logger','rpc','../../config/environment','jayson/promise'];(function(_0x5ea8c4,_0x123360){var _0x2a3fdf=function(_0x1bd294){while(--_0x1bd294){_0x5ea8c4['push'](_0x5ea8c4['shift']());}};_0x2a3fdf(++_0x123360);}(_0x4725,0x14a));var _0x5472=function(_0x23c7a5,_0x5396f5){_0x23c7a5=_0x23c7a5-0x0;var _0x528a79=_0x4725[_0x23c7a5];return _0x528a79;};'use strict';var _=require(_0x5472('0x0'));var util=require(_0x5472('0x1'));var moment=require('moment');var BPromise=require(_0x5472('0x2'));var rs=require(_0x5472('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x5472('0x4'))(_0x5472('0x5'));var config=require(_0x5472('0x6'));var jayson=require(_0x5472('0x7'));var client=jayson['client'][_0x5472('0x8')]({'port':0x232a});config['redis']=_[_0x5472('0x9')](config['redis'],{'host':'localhost','port':0x18eb});var socket=require(_0x5472('0xa'))(new Redis(config['redis']));require(_0x5472('0xb'))[_0x5472('0xc')](socket);function respondWithRpcPromise(_0x12d306,_0x54afc0,_0x4080a0){return new BPromise(function(_0x18b542,_0xb200dd){return client['request'](_0x12d306,_0x4080a0)[_0x5472('0xd')](function(_0x339742){logger[_0x5472('0xe')](_0x5472('0xf'),_0x54afc0,_0x5472('0x10'));logger[_0x5472('0x11')]('ChatMessage,\x20%s,\x20%s,\x20%s',_0x54afc0,_0x5472('0x10'),JSON[_0x5472('0x12')](_0x339742));if(_0x339742[_0x5472('0x13')]){if(_0x339742[_0x5472('0x13')][_0x5472('0x14')]===0x1f4){logger[_0x5472('0x13')]('ChatMessage,\x20%s,\x20%s',_0x54afc0,_0x339742[_0x5472('0x13')][_0x5472('0x15')]);return _0xb200dd(_0x339742[_0x5472('0x13')][_0x5472('0x15')]);}logger[_0x5472('0x13')](_0x5472('0xf'),_0x54afc0,_0x339742['error']['message']);return _0x18b542(_0x339742[_0x5472('0x13')][_0x5472('0x15')]);}else{logger[_0x5472('0xe')](_0x5472('0xf'),_0x54afc0,_0x5472('0x10'));_0x18b542(_0x339742['result'][_0x5472('0x15')]);}})[_0x5472('0x16')](function(_0x3cf8cd){logger[_0x5472('0x13')]('ChatMessage,\x20%s,\x20%s',_0x54afc0,_0x3cf8cd);_0xb200dd(_0x3cf8cd);});});}exports['CreateChatMessage']=function(_0x331f96){var _0xbbcb2d=this;return new Promise(function(_0x3202c1,_0x2ff801){return db['ChatMessage'][_0x5472('0x17')](_0x331f96['body'],{'raw':_0x331f96['options']?_0x331f96['options'][_0x5472('0x18')]===undefined?!![]:![]:!![]})[_0x5472('0xd')](function(_0x3661c4){logger['info']('CreateChatMessage',_0x331f96);logger[_0x5472('0x11')](_0x5472('0x19'),_0x331f96,JSON[_0x5472('0x12')](_0x3661c4));_0x3202c1(_0x3661c4);})[_0x5472('0x16')](function(_0x41c76d){logger[_0x5472('0x13')](_0x5472('0x19'),_0x41c76d[_0x5472('0x15')],_0x331f96);_0x2ff801(_0xbbcb2d[_0x5472('0x13')](0x1f4,_0x41c76d['message']));});});};
\ No newline at end of file
+var _0x613e=['./chatMessage.socket','request','then','ChatMessage,\x20%s,\x20%s','request\x20sent','debug','ChatMessage,\x20%s,\x20%s,\x20%s','stringify','code','error','message','catch','ChatMessage','body','options','raw','CreateChatMessage','lodash','util','randomstring','../../mysqldb','rpc','../../config/environment','jayson/promise','http','redis','defaults','localhost','socket.io-emitter'];(function(_0x5bdb15,_0x4eaf32){var _0x1293f2=function(_0x403f89){while(--_0x403f89){_0x5bdb15['push'](_0x5bdb15['shift']());}};_0x1293f2(++_0x4eaf32);}(_0x613e,0x1e1));var _0xe613=function(_0x47c0c0,_0x15f492){_0x47c0c0=_0x47c0c0-0x0;var _0x3200fd=_0x613e[_0x47c0c0];return _0x3200fd;};'use strict';var _=require(_0xe613('0x0'));var util=require(_0xe613('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0xe613('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xe613('0x3'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0xe613('0x4'));var config=require(_0xe613('0x5'));var jayson=require(_0xe613('0x6'));var client=jayson['client'][_0xe613('0x7')]({'port':0x232a});config[_0xe613('0x8')]=_[_0xe613('0x9')](config[_0xe613('0x8')],{'host':_0xe613('0xa'),'port':0x18eb});var socket=require(_0xe613('0xb'))(new Redis(config[_0xe613('0x8')]));require(_0xe613('0xc'))['register'](socket);function respondWithRpcPromise(_0x34fdf9,_0x307532,_0x1b6a15){return new BPromise(function(_0x4dea7a,_0x533cf3){return client[_0xe613('0xd')](_0x34fdf9,_0x1b6a15)[_0xe613('0xe')](function(_0x58087b){logger['info'](_0xe613('0xf'),_0x307532,_0xe613('0x10'));logger[_0xe613('0x11')](_0xe613('0x12'),_0x307532,_0xe613('0x10'),JSON[_0xe613('0x13')](_0x58087b));if(_0x58087b['error']){if(_0x58087b['error'][_0xe613('0x14')]===0x1f4){logger[_0xe613('0x15')](_0xe613('0xf'),_0x307532,_0x58087b[_0xe613('0x15')][_0xe613('0x16')]);return _0x533cf3(_0x58087b[_0xe613('0x15')][_0xe613('0x16')]);}logger['error']('ChatMessage,\x20%s,\x20%s',_0x307532,_0x58087b[_0xe613('0x15')]['message']);return _0x4dea7a(_0x58087b[_0xe613('0x15')][_0xe613('0x16')]);}else{logger['info'](_0xe613('0xf'),_0x307532,_0xe613('0x10'));_0x4dea7a(_0x58087b['result'][_0xe613('0x16')]);}})[_0xe613('0x17')](function(_0x7f9bb8){logger['error'](_0xe613('0xf'),_0x307532,_0x7f9bb8);_0x533cf3(_0x7f9bb8);});});}exports['CreateChatMessage']=function(_0x45a8c2){var _0x554e97=this;return new Promise(function(_0x472fa2,_0x5104c0){return db[_0xe613('0x18')]['create'](_0x45a8c2[_0xe613('0x19')],{'raw':_0x45a8c2['options']?_0x45a8c2[_0xe613('0x1a')][_0xe613('0x1b')]===undefined?!![]:![]:!![]})['then'](function(_0xdc0601){logger['info'](_0xe613('0x1c'),_0x45a8c2);logger[_0xe613('0x11')](_0xe613('0x1c'),_0x45a8c2,JSON[_0xe613('0x13')](_0xdc0601));_0x472fa2(_0xdc0601);})['catch'](function(_0x2931e2){logger[_0xe613('0x15')](_0xe613('0x1c'),_0x2931e2['message'],_0x45a8c2);_0x5104c0(_0x554e97[_0xe613('0x15')](0x1f4,_0x2931e2[_0xe613('0x16')]));});});};
\ No newline at end of file
diff --git a/server/api/chatMessage/chatMessage.socket.js b/server/api/chatMessage/chatMessage.socket.js
index a8520f8..960b0e9 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 _0x21d1=['chatMessage:','./chatMessage.events','save','remove','update','removeListener','register','length'];(function(_0x2de0a7,_0x38d3e7){var _0x429437=function(_0x23c148){while(--_0x23c148){_0x2de0a7['push'](_0x2de0a7['shift']());}};_0x429437(++_0x38d3e7);}(_0x21d1,0x1c9));var _0x121d=function(_0x1028f5,_0x55fb38){_0x1028f5=_0x1028f5-0x0;var _0x1333c6=_0x21d1[_0x1028f5];return _0x1333c6;};'use strict';var ChatMessageEvents=require(_0x121d('0x0'));var events=[_0x121d('0x1'),_0x121d('0x2'),_0x121d('0x3')];function createListener(_0x438b9b,_0x14fd65){return function(_0x550ab5){_0x14fd65['emit'](_0x438b9b,_0x550ab5);};}function removeListener(_0x20b991,_0x19c637){return function(){ChatMessageEvents[_0x121d('0x4')](_0x20b991,_0x19c637);};}exports[_0x121d('0x5')]=function(_0x2f3987){for(var _0x4c47ee=0x0,_0x226625=events[_0x121d('0x6')];_0x4c47ee<_0x226625;_0x4c47ee++){var _0x47b50b=events[_0x4c47ee];var _0x2d4d7e=createListener(_0x121d('0x7')+_0x47b50b,_0x2f3987);ChatMessageEvents['on'](_0x47b50b,_0x2d4d7e);}};
\ No newline at end of file
+var _0x1c9a=['register','length','chatMessage:','./chatMessage.events','save','update','emit'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x1c9a,0x1a7));var _0xa1c9=function(_0x4afa49,_0x95abec){_0x4afa49=_0x4afa49-0x0;var _0x3248bf=_0x1c9a[_0x4afa49];return _0x3248bf;};'use strict';var ChatMessageEvents=require(_0xa1c9('0x0'));var events=[_0xa1c9('0x1'),'remove',_0xa1c9('0x2')];function createListener(_0x867bbb,_0x38c48f){return function(_0x408418){_0x38c48f[_0xa1c9('0x3')](_0x867bbb,_0x408418);};}function removeListener(_0x4a0d3d,_0x2f883c){return function(){ChatMessageEvents['removeListener'](_0x4a0d3d,_0x2f883c);};}exports[_0xa1c9('0x4')]=function(_0xdd22bf){for(var _0x237862=0x0,_0x2b0c89=events[_0xa1c9('0x5')];_0x237862<_0x2b0c89;_0x237862++){var _0x46b19a=events[_0x237862];var _0x3b1a2c=createListener(_0xa1c9('0x6')+_0x46b19a,_0xdd22bf);ChatMessageEvents['on'](_0x46b19a,_0x3b1a2c);}};
\ No newline at end of file
diff --git a/server/api/chatMessage/index.js b/server/api/chatMessage/index.js
index 2fafb87..1391642 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 _0x6b28=['get','isAuthenticated','index','/describe','describe','/:id','show','chatmessage:create','create','update','/:id/accept','accept','put','/:id/reject','reject','delete','destroy','exports','multer','path','connect-timeout','express','Router','../../components/auth/service','../../config/environment'];(function(_0xee18e4,_0x1835eb){var _0x5993a8=function(_0x1af87c){while(--_0x1af87c){_0xee18e4['push'](_0xee18e4['shift']());}};_0x5993a8(++_0x1835eb);}(_0x6b28,0x13e));var _0x86b2=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x6b28[_0x3dd15e];return _0x231fd0;};'use strict';var multer=require(_0x86b2('0x0'));var util=require('util');var path=require(_0x86b2('0x1'));var timeout=require(_0x86b2('0x2'));var express=require(_0x86b2('0x3'));var router=express[_0x86b2('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x86b2('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x86b2('0x6'));var controller=require('./chatMessage.controller');router[_0x86b2('0x7')]('/',auth[_0x86b2('0x8')](),controller[_0x86b2('0x9')]);router['get'](_0x86b2('0xa'),auth['isAuthenticated'](),controller[_0x86b2('0xb')]);router[_0x86b2('0x7')](_0x86b2('0xc'),auth['isAuthenticated'](),controller[_0x86b2('0xd')]);router['post']('/',auth[_0x86b2('0x8')](),interaction['tracked']('chat',_0x86b2('0xe')),controller[_0x86b2('0xf')]);router['put'](_0x86b2('0xc'),controller[_0x86b2('0x10')]);router['put'](_0x86b2('0x11'),auth[_0x86b2('0x8')](),controller[_0x86b2('0x12')]);router[_0x86b2('0x13')](_0x86b2('0x14'),auth[_0x86b2('0x8')](),controller[_0x86b2('0x15')]);router[_0x86b2('0x16')]('/:id',auth[_0x86b2('0x8')](),controller[_0x86b2('0x17')]);module[_0x86b2('0x18')]=router;
\ No newline at end of file
+var _0xb832=['multer','path','express','Router','../../components/auth/service','./chatMessage.controller','get','isAuthenticated','index','/:id','show','post','tracked','chat','chatmessage:create','update','put','/:id/accept','accept','/:id/reject','reject','destroy','exports'];(function(_0x29d915,_0x54a040){var _0x160f86=function(_0x237dfa){while(--_0x237dfa){_0x29d915['push'](_0x29d915['shift']());}};_0x160f86(++_0x54a040);}(_0xb832,0x1b5));var _0x2b83=function(_0x472d2c,_0x246328){_0x472d2c=_0x472d2c-0x0;var _0x3384ea=_0xb832[_0x472d2c];return _0x3384ea;};'use strict';var multer=require(_0x2b83('0x0'));var util=require('util');var path=require(_0x2b83('0x1'));var timeout=require('connect-timeout');var express=require(_0x2b83('0x2'));var router=express[_0x2b83('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x2b83('0x4'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x2b83('0x5'));router[_0x2b83('0x6')]('/',auth[_0x2b83('0x7')](),controller[_0x2b83('0x8')]);router[_0x2b83('0x6')]('/describe',auth['isAuthenticated'](),controller['describe']);router[_0x2b83('0x6')](_0x2b83('0x9'),auth[_0x2b83('0x7')](),controller[_0x2b83('0xa')]);router[_0x2b83('0xb')]('/',auth['isAuthenticated'](),interaction[_0x2b83('0xc')](_0x2b83('0xd'),_0x2b83('0xe')),controller['create']);router['put']('/:id',controller[_0x2b83('0xf')]);router[_0x2b83('0x10')](_0x2b83('0x11'),auth[_0x2b83('0x7')](),controller[_0x2b83('0x12')]);router[_0x2b83('0x10')](_0x2b83('0x13'),auth[_0x2b83('0x7')](),controller[_0x2b83('0x14')]);router['delete'](_0x2b83('0x9'),auth[_0x2b83('0x7')](),controller[_0x2b83('0x15')]);module[_0x2b83('0x16')]=router;
\ No newline at end of file
diff --git a/server/api/chatOfflineMessage/chatOfflineMessage.attributes.js b/server/api/chatOfflineMessage/chatOfflineMessage.attributes.js
index 0df9d78..72658a2 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 _0x7bb6=['exports','TEXT','medium','sequelize'];(function(_0x12fc8d,_0x19ee33){var _0x3f9d04=function(_0x52e51c){while(--_0x52e51c){_0x12fc8d['push'](_0x12fc8d['shift']());}};_0x3f9d04(++_0x19ee33);}(_0x7bb6,0x1bb));var _0x67bb=function(_0x5e6f02,_0x19927e){_0x5e6f02=_0x5e6f02-0x0;var _0x4efbfc=_0x7bb6[_0x5e6f02];return _0x4efbfc;};'use strict';var Sequelize=require(_0x67bb('0x0'));module[_0x67bb('0x1')]={'body':{'type':Sequelize[_0x67bb('0x2')](_0x67bb('0x3')),'allowNull':![]}};
\ No newline at end of file
+var _0xf2ea=['medium','sequelize','exports','TEXT'];(function(_0x18a79d,_0x57bd2c){var _0x4f8848=function(_0x28af80){while(--_0x28af80){_0x18a79d['push'](_0x18a79d['shift']());}};_0x4f8848(++_0x57bd2c);}(_0xf2ea,0x121));var _0xaf2e=function(_0x36ed48,_0x1ee0d4){_0x36ed48=_0x36ed48-0x0;var _0x51c63a=_0xf2ea[_0x36ed48];return _0x51c63a;};'use strict';var Sequelize=require(_0xaf2e('0x0'));module[_0xaf2e('0x1')]={'body':{'type':Sequelize[_0xaf2e('0x2')](_0xaf2e('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 251ad73..f59032a 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(_0x20f799,_0x51ff5d){var _0x2c4a51=function(_0xf8c95c){while(--_0xf8c95c){_0x20f799['push'](_0x20f799['shift']());}};_0x2c4a51(++_0x51ff5d);}(_0x9957,0x93));var _0x7995=function(_0x2f5ac5,_0x1ee939){_0x2f5ac5=_0x2f5ac5-0x0;var _0x37c9a8=_0x9957[_0x2f5ac5];return _0x37c9a8;};'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 _0x7a54=['filter','VIRTUAL','includeAll','include','findAll','rows','show','params','length','merge','options','find','catch','body','Attachment','join','server','attachments','offline-chat','basename','remove','describe','eml-format','rimraf','zip-dir','request-promise','moment','mustache','util','path','sox','to-csv','fs-extra','squel','crypto','desk.js','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','count','limit','set','Content-Range','reject','save','update','then','destroy','error','stack','name','send','index','ChatOfflineMessage','fieldName','type','model','map','query','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','where','pick'];(function(_0x2555d0,_0x4150a6){var _0x3bb486=function(_0x1eb89f){while(--_0x1eb89f){_0x2555d0['push'](_0x2555d0['shift']());}};_0x3bb486(++_0x4150a6);}(_0x7a54,0x106));var _0x47a5=function(_0x1eb8a8,_0x32e91d){_0x1eb8a8=_0x1eb8a8-0x0;var _0x3c9f55=_0x7a54[_0x1eb8a8];return _0x3c9f55;};'use strict';var emlformat=require(_0x47a5('0x0'));var rimraf=require(_0x47a5('0x1'));var zipdir=require(_0x47a5('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x47a5('0x3'));var moment=require(_0x47a5('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x47a5('0x5'));var util=require(_0x47a5('0x6'));var path=require(_0x47a5('0x7'));var sox=require(_0x47a5('0x8'));var csv=require(_0x47a5('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x47a5('0xa'));var _=require('lodash');var squel=require(_0x47a5('0xb'));var crypto=require(_0x47a5('0xc'));var jsforce=require('jsforce');var deskjs=require(_0x47a5('0xd'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x47a5('0xe'));var authService=require(_0x47a5('0xf'));var qs=require('../../components/parsers/qs');var as=require(_0x47a5('0x10'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x47a5('0x11'));var utils=require(_0x47a5('0x12'));var config=require(_0x47a5('0x13'));var licenseUtil=require(_0x47a5('0x14'));var db=require(_0x47a5('0x15'))['db'];function respondWithStatusCode(_0xd308b8,_0x1eae59){_0x1eae59=_0x1eae59||0xcc;return function(_0x5beb89){if(_0x5beb89){return _0xd308b8[_0x47a5('0x16')](_0x1eae59);}return _0xd308b8[_0x47a5('0x17')](_0x1eae59)[_0x47a5('0x18')]();};}function respondWithResult(_0x711793,_0x139f25){_0x139f25=_0x139f25||0xc8;return function(_0x620ee9){if(_0x620ee9){return _0x711793[_0x47a5('0x17')](_0x139f25)[_0x47a5('0x19')](_0x620ee9);}};}function respondWithFilteredResult(_0x4e99a8,_0x362359){return function(_0x11faf5){if(_0x11faf5){var _0x3b001e=typeof _0x362359[_0x47a5('0x1a')]===_0x47a5('0x1b')&&typeof _0x362359['limit']==='undefined';var _0x138bc0=_0x11faf5['count'];var _0x5247fd=_0x3b001e?0x0:_0x362359[_0x47a5('0x1a')];var _0xaf70a6=_0x3b001e?_0x11faf5[_0x47a5('0x1c')]:_0x362359[_0x47a5('0x1a')]+_0x362359[_0x47a5('0x1d')];var _0x12b98e;if(_0xaf70a6>=_0x138bc0){_0xaf70a6=_0x138bc0;_0x12b98e=0xc8;}else{_0x12b98e=0xce;}_0x4e99a8[_0x47a5('0x17')](_0x12b98e);return _0x4e99a8[_0x47a5('0x1e')](_0x47a5('0x1f'),_0x5247fd+'-'+_0xaf70a6+'/'+_0x138bc0)['json'](_0x11faf5);}return null;};}function patchUpdates(_0x1570bc){return function(_0xf160ba){try{jsonpatch['apply'](_0xf160ba,_0x1570bc,!![]);}catch(_0x2b0360){return BPromise[_0x47a5('0x20')](_0x2b0360);}return _0xf160ba[_0x47a5('0x21')]();};}function saveUpdates(_0x4c5910,_0xb8ae6c){return function(_0x2f142b){if(_0x2f142b){return _0x2f142b[_0x47a5('0x22')](_0x4c5910)[_0x47a5('0x23')](function(_0x5ef1b1){return _0x5ef1b1;});}return null;};}function removeEntity(_0xe2dea9,_0x385687){return function(_0x513981){if(_0x513981){return _0x513981[_0x47a5('0x24')]()[_0x47a5('0x23')](function(){_0xe2dea9[_0x47a5('0x17')](0xcc)[_0x47a5('0x18')]();});}};}function handleEntityNotFound(_0x3abd6a,_0x50bf17){return function(_0x53078a){if(!_0x53078a){_0x3abd6a[_0x47a5('0x16')](0x194);}return _0x53078a;};}function handleError(_0x5686db,_0x1ea9c8){_0x1ea9c8=_0x1ea9c8||0x1f4;return function(_0x5b6c4e){logger[_0x47a5('0x25')](_0x5b6c4e[_0x47a5('0x26')]);if(_0x5b6c4e[_0x47a5('0x27')]){delete _0x5b6c4e[_0x47a5('0x27')];}_0x5686db[_0x47a5('0x17')](_0x1ea9c8)[_0x47a5('0x28')](_0x5b6c4e);};}exports[_0x47a5('0x29')]=function(_0x136b14,_0x16631f){var _0x361bfa={},_0x1127f8={},_0x11a4fa={'count':0x0,'rows':[]};var _0x3ad507=_['map'](db[_0x47a5('0x2a')]['rawAttributes'],function(_0x2ef875){return{'name':_0x2ef875[_0x47a5('0x2b')],'type':_0x2ef875[_0x47a5('0x2c')]['key']};});_0x1127f8[_0x47a5('0x2d')]=_[_0x47a5('0x2e')](_0x3ad507,_0x47a5('0x27'));_0x1127f8[_0x47a5('0x2f')]=_['keys'](_0x136b14['query']);_0x1127f8[_0x47a5('0x30')]=_[_0x47a5('0x31')](_0x1127f8['model'],_0x1127f8['query']);_0x361bfa[_0x47a5('0x32')]=_[_0x47a5('0x31')](_0x1127f8['model'],qs[_0x47a5('0x33')](_0x136b14['query'][_0x47a5('0x33')]));_0x361bfa[_0x47a5('0x32')]=_0x361bfa['attributes']['length']?_0x361bfa[_0x47a5('0x32')]:_0x1127f8['model'];if(!_0x136b14[_0x47a5('0x2f')][_0x47a5('0x34')](_0x47a5('0x35'))){_0x361bfa['limit']=qs[_0x47a5('0x1d')](_0x136b14['query']['limit']);_0x361bfa[_0x47a5('0x1a')]=qs['offset'](_0x136b14[_0x47a5('0x2f')]['offset']);}_0x361bfa[_0x47a5('0x36')]=qs[_0x47a5('0x37')](_0x136b14[_0x47a5('0x2f')][_0x47a5('0x37')]);_0x361bfa[_0x47a5('0x38')]=qs[_0x47a5('0x30')](_[_0x47a5('0x39')](_0x136b14[_0x47a5('0x2f')],_0x1127f8[_0x47a5('0x30')]),_0x3ad507);if(_0x136b14['query'][_0x47a5('0x3a')]){_0x361bfa[_0x47a5('0x38')]=_['merge'](_0x361bfa[_0x47a5('0x38')],{'$or':_[_0x47a5('0x2e')](_0x3ad507,function(_0x1d4348){if(_0x1d4348['type']!==_0x47a5('0x3b')){var _0x10f660={};_0x10f660[_0x1d4348['name']]={'$like':'%'+_0x136b14[_0x47a5('0x2f')][_0x47a5('0x3a')]+'%'};return _0x10f660;}})});}_0x361bfa=_['merge']({},_0x361bfa,_0x136b14['options']);var _0x5ebd8c={'where':_0x361bfa[_0x47a5('0x38')]};return db['ChatOfflineMessage'][_0x47a5('0x1c')](_0x5ebd8c)[_0x47a5('0x23')](function(_0x301a85){_0x11a4fa[_0x47a5('0x1c')]=_0x301a85;if(_0x136b14[_0x47a5('0x2f')][_0x47a5('0x3c')]){_0x361bfa[_0x47a5('0x3d')]=[{'all':!![]}];}return db[_0x47a5('0x2a')][_0x47a5('0x3e')](_0x361bfa);})[_0x47a5('0x23')](function(_0x280500){_0x11a4fa[_0x47a5('0x3f')]=_0x280500;return _0x11a4fa;})[_0x47a5('0x23')](respondWithFilteredResult(_0x16631f,_0x361bfa))['catch'](handleError(_0x16631f,null));};exports[_0x47a5('0x40')]=function(_0x1c36fa,_0x331474){var _0x23bd8d={'raw':!![],'where':{'id':_0x1c36fa[_0x47a5('0x41')]['id']}},_0x586f4f={};_0x586f4f['model']=_['keys'](db['ChatOfflineMessage']['rawAttributes']);_0x586f4f[_0x47a5('0x2f')]=_['keys'](_0x1c36fa[_0x47a5('0x2f')]);_0x586f4f[_0x47a5('0x30')]=_[_0x47a5('0x31')](_0x586f4f['model'],_0x586f4f[_0x47a5('0x2f')]);_0x23bd8d[_0x47a5('0x32')]=_['intersection'](_0x586f4f['model'],qs[_0x47a5('0x33')](_0x1c36fa['query'][_0x47a5('0x33')]));_0x23bd8d[_0x47a5('0x32')]=_0x23bd8d[_0x47a5('0x32')][_0x47a5('0x42')]?_0x23bd8d[_0x47a5('0x32')]:_0x586f4f[_0x47a5('0x2d')];if(_0x1c36fa[_0x47a5('0x2f')][_0x47a5('0x3c')]){_0x23bd8d[_0x47a5('0x3d')]=[{'all':!![]}];}_0x23bd8d=_[_0x47a5('0x43')]({},_0x23bd8d,_0x1c36fa[_0x47a5('0x44')]);return db[_0x47a5('0x2a')][_0x47a5('0x45')](_0x23bd8d)[_0x47a5('0x23')](handleEntityNotFound(_0x331474,null))[_0x47a5('0x23')](respondWithResult(_0x331474,null))[_0x47a5('0x46')](handleError(_0x331474,null));};exports['create']=function(_0x2d38de,_0x23bb04){return db['ChatOfflineMessage']['create'](_0x2d38de[_0x47a5('0x47')],{})['then'](respondWithResult(_0x23bb04,0xc9))[_0x47a5('0x46')](handleError(_0x23bb04,null));};exports[_0x47a5('0x22')]=function(_0x54c35f,_0x4f62d3){if(_0x54c35f[_0x47a5('0x47')]['id']){delete _0x54c35f['body']['id'];}return db[_0x47a5('0x2a')][_0x47a5('0x45')]({'where':{'id':_0x54c35f[_0x47a5('0x41')]['id']}})[_0x47a5('0x23')](handleEntityNotFound(_0x4f62d3,null))[_0x47a5('0x23')](saveUpdates(_0x54c35f[_0x47a5('0x47')],null))[_0x47a5('0x23')](respondWithResult(_0x4f62d3,null))['catch'](handleError(_0x4f62d3,null));};exports['destroy']=function(_0x2dd1db,_0x411230){return db[_0x47a5('0x48')][_0x47a5('0x3e')]({'where':{'ChatOfflineMessageId':_0x2dd1db[_0x47a5('0x41')]['id']},'raw':!![]})[_0x47a5('0x23')](function(_0x249de5){_0x249de5['forEach'](function(_0x45cca5){var _0x1c9a62=path[_0x47a5('0x49')](config['root'],_0x47a5('0x4a'),'files',_0x47a5('0x4b'),_0x47a5('0x4c'),_0x45cca5[_0x47a5('0x4d')]);var _0xf03bd5=fs['existsSync'](_0x1c9a62);if(_0xf03bd5)fs_extra[_0x47a5('0x4e')](_0x1c9a62);});})[_0x47a5('0x23')](function(){return db[_0x47a5('0x2a')][_0x47a5('0x45')]({'where':{'id':_0x2dd1db[_0x47a5('0x41')]['id']},'individualHooks':!![]});})[_0x47a5('0x23')](handleEntityNotFound(_0x411230,null))[_0x47a5('0x23')](removeEntity(_0x411230,null))['catch'](handleError(_0x411230,null));};exports[_0x47a5('0x4f')]=function(_0x43721b,_0x187d7e){return db[_0x47a5('0x2a')][_0x47a5('0x4f')]()[_0x47a5('0x23')](respondWithResult(_0x187d7e,null))['catch'](handleError(_0x187d7e,null));};
\ No newline at end of file
diff --git a/server/api/chatOfflineMessage/chatOfflineMessage.model.js b/server/api/chatOfflineMessage/chatOfflineMessage.model.js
index 1be4318..2d5a005 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 _0xda6e=['moment','bluebird','request-promise','utf8mb4','utf8mb4_unicode_ci','lodash','util','../../config/logger'];(function(_0x42af3a,_0x2aafb9){var _0x14d099=function(_0x14a06d){while(--_0x14a06d){_0x42af3a['push'](_0x42af3a['shift']());}};_0x14d099(++_0x2aafb9);}(_0xda6e,0xe5));var _0xeda6=function(_0x188d60,_0x5582b8){_0x188d60=_0x188d60-0x0;var _0x3819e0=_0xda6e[_0x188d60];return _0x3819e0;};'use strict';var _=require(_0xeda6('0x0'));var util=require(_0xeda6('0x1'));var logger=require(_0xeda6('0x2'))('api');var moment=require(_0xeda6('0x3'));var BPromise=require(_0xeda6('0x4'));var rp=require(_0xeda6('0x5'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require('./chatOfflineMessage.attributes');module['exports']=function(_0x1390e8,_0x51dd18){return _0x1390e8['define']('ChatOfflineMessage',attributes,{'tableName':'chat_offline_messages','paranoid':![],'indexes':[],'timestamps':!![],'charset':_0xeda6('0x6'),'collate':_0xeda6('0x7')});};
\ No newline at end of file
+var _0xcc05=['ChatOfflineMessage','chat_offline_messages','lodash','util','../../config/logger','api','request-promise','path','rimraf','../../config/environment','./chatOfflineMessage.attributes','exports'];(function(_0x5847b1,_0x579628){var _0xacd877=function(_0x182eaf){while(--_0x182eaf){_0x5847b1['push'](_0x5847b1['shift']());}};_0xacd877(++_0x579628);}(_0xcc05,0x1d6));var _0x5cc0=function(_0x4a2666,_0x1a5433){_0x4a2666=_0x4a2666-0x0;var _0x14f962=_0xcc05[_0x4a2666];return _0x14f962;};'use strict';var _=require(_0x5cc0('0x0'));var util=require(_0x5cc0('0x1'));var logger=require(_0x5cc0('0x2'))(_0x5cc0('0x3'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x5cc0('0x4'));var fs=require('fs');var path=require(_0x5cc0('0x5'));var rimraf=require(_0x5cc0('0x6'));var config=require(_0x5cc0('0x7'));var attributes=require(_0x5cc0('0x8'));module[_0x5cc0('0x9')]=function(_0x10b8b1,_0x3281fa){return _0x10b8b1['define'](_0x5cc0('0xa'),attributes,{'tableName':_0x5cc0('0xb'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':'utf8mb4','collate':'utf8mb4_unicode_ci'});};
\ No newline at end of file
diff --git a/server/api/chatOfflineMessage/chatOfflineMessage.rpc.js b/server/api/chatOfflineMessage/chatOfflineMessage.rpc.js
index bc3d576..819763a 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 _0xe562=['rpc','../../config/environment','http','then','info','ChatOfflineMessage,\x20%s,\x20%s','request\x20sent','debug','ChatOfflineMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','lodash','moment','bluebird','ioredis','../../mysqldb','../../config/utils'];(function(_0x7f0422,_0x2274a0){var _0x4412de=function(_0x27b341){while(--_0x27b341){_0x7f0422['push'](_0x7f0422['shift']());}};_0x4412de(++_0x2274a0);}(_0xe562,0x72));var _0x2e56=function(_0x1f24c0,_0x489f4c){_0x1f24c0=_0x1f24c0-0x0;var _0x5899f4=_0xe562[_0x1f24c0];return _0x5899f4;};'use strict';var _=require(_0x2e56('0x0'));var util=require('util');var moment=require(_0x2e56('0x1'));var BPromise=require(_0x2e56('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x2e56('0x3'));var db=require(_0x2e56('0x4'))['db'];var utils=require(_0x2e56('0x5'));var logger=require('../../config/logger')(_0x2e56('0x6'));var config=require(_0x2e56('0x7'));var jayson=require('jayson/promise');var client=jayson['client'][_0x2e56('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x3d762e,_0x85d962,_0x11c9bd){return new BPromise(function(_0x50c3d1,_0x1d42af){return client['request'](_0x3d762e,_0x11c9bd)[_0x2e56('0x9')](function(_0x19a475){logger[_0x2e56('0xa')](_0x2e56('0xb'),_0x85d962,_0x2e56('0xc'));logger[_0x2e56('0xd')](_0x2e56('0xe'),_0x85d962,_0x2e56('0xc'),JSON[_0x2e56('0xf')](_0x19a475));if(_0x19a475[_0x2e56('0x10')]){if(_0x19a475['error'][_0x2e56('0x11')]===0x1f4){logger[_0x2e56('0x10')](_0x2e56('0xb'),_0x85d962,_0x19a475[_0x2e56('0x10')][_0x2e56('0x12')]);return _0x1d42af(_0x19a475['error'][_0x2e56('0x12')]);}logger[_0x2e56('0x10')](_0x2e56('0xb'),_0x85d962,_0x19a475[_0x2e56('0x10')][_0x2e56('0x12')]);return _0x50c3d1(_0x19a475[_0x2e56('0x10')][_0x2e56('0x12')]);}else{logger[_0x2e56('0xa')]('ChatOfflineMessage,\x20%s,\x20%s',_0x85d962,'request\x20sent');_0x50c3d1(_0x19a475['result'][_0x2e56('0x12')]);}})[_0x2e56('0x13')](function(_0x42c588){logger[_0x2e56('0x10')]('ChatOfflineMessage,\x20%s,\x20%s',_0x85d962,_0x42c588);_0x1d42af(_0x42c588);});});}
\ No newline at end of file
+var _0xfe11=['request\x20sent','debug','ChatOfflineMessage,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','lodash','util','moment','bluebird','randomstring','../../config/utils','../../config/logger','http','request','then','info','ChatOfflineMessage,\x20%s,\x20%s'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0xfe11,0x94));var _0x1fe1=function(_0x44d6b8,_0xe7e065){_0x44d6b8=_0x44d6b8-0x0;var _0x18cbfa=_0xfe11[_0x44d6b8];return _0x18cbfa;};'use strict';var _=require(_0x1fe1('0x0'));var util=require(_0x1fe1('0x1'));var moment=require(_0x1fe1('0x2'));var BPromise=require(_0x1fe1('0x3'));var rs=require(_0x1fe1('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x1fe1('0x5'));var logger=require(_0x1fe1('0x6'))('rpc');var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson['client'][_0x1fe1('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x340c29,_0x11477c,_0x2f08ce){return new BPromise(function(_0x49b66c,_0x392209){return client[_0x1fe1('0x8')](_0x340c29,_0x2f08ce)[_0x1fe1('0x9')](function(_0x3a1784){logger[_0x1fe1('0xa')](_0x1fe1('0xb'),_0x11477c,_0x1fe1('0xc'));logger[_0x1fe1('0xd')](_0x1fe1('0xe'),_0x11477c,_0x1fe1('0xc'),JSON['stringify'](_0x3a1784));if(_0x3a1784[_0x1fe1('0xf')]){if(_0x3a1784[_0x1fe1('0xf')][_0x1fe1('0x10')]===0x1f4){logger['error']('ChatOfflineMessage,\x20%s,\x20%s',_0x11477c,_0x3a1784[_0x1fe1('0xf')][_0x1fe1('0x11')]);return _0x392209(_0x3a1784[_0x1fe1('0xf')][_0x1fe1('0x11')]);}logger[_0x1fe1('0xf')](_0x1fe1('0xb'),_0x11477c,_0x3a1784[_0x1fe1('0xf')][_0x1fe1('0x11')]);return _0x49b66c(_0x3a1784[_0x1fe1('0xf')][_0x1fe1('0x11')]);}else{logger[_0x1fe1('0xa')](_0x1fe1('0xb'),_0x11477c,'request\x20sent');_0x49b66c(_0x3a1784[_0x1fe1('0x12')][_0x1fe1('0x11')]);}})[_0x1fe1('0x13')](function(_0x3afc84){logger[_0x1fe1('0xf')](_0x1fe1('0xb'),_0x11477c,_0x3afc84);_0x392209(_0x3afc84);});});}
\ No newline at end of file
diff --git a/server/api/chatOfflineMessage/index.js b/server/api/chatOfflineMessage/index.js
index a573170..b11c583 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 _0x503d=['show','post','create','put','delete','destroy','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment','./chatOfflineMessage.controller','get','isAuthenticated','index','/describe','describe','/:id'];(function(_0x5d4418,_0x5408cb){var _0x192224=function(_0x37fd65){while(--_0x37fd65){_0x5d4418['push'](_0x5d4418['shift']());}};_0x192224(++_0x5408cb);}(_0x503d,0x8a));var _0xd503=function(_0x30182f,_0x30ce41){_0x30182f=_0x30182f-0x0;var _0x5207db=_0x503d[_0x30182f];return _0x5207db;};'use strict';var multer=require(_0xd503('0x0'));var util=require(_0xd503('0x1'));var path=require(_0xd503('0x2'));var timeout=require(_0xd503('0x3'));var express=require(_0xd503('0x4'));var router=express[_0xd503('0x5')]();var fs_extra=require(_0xd503('0x6'));var auth=require(_0xd503('0x7'));var interaction=require('../../components/interaction/service');var config=require(_0xd503('0x8'));var controller=require(_0xd503('0x9'));router[_0xd503('0xa')]('/',auth[_0xd503('0xb')](),controller[_0xd503('0xc')]);router[_0xd503('0xa')](_0xd503('0xd'),auth[_0xd503('0xb')](),controller[_0xd503('0xe')]);router[_0xd503('0xa')](_0xd503('0xf'),auth[_0xd503('0xb')](),controller[_0xd503('0x10')]);router[_0xd503('0x11')]('/',auth['isAuthenticated'](),controller[_0xd503('0x12')]);router[_0xd503('0x13')]('/:id',auth[_0xd503('0xb')](),controller['update']);router[_0xd503('0x14')](_0xd503('0xf'),auth[_0xd503('0xb')](),controller[_0xd503('0x15')]);module['exports']=router;
\ No newline at end of file
+var _0xb110=['/:id','put','update','destroy','exports','multer','util','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatOfflineMessage.controller','isAuthenticated','index','/describe','get'];(function(_0xe51964,_0x433b90){var _0x2c2366=function(_0x1bc95c){while(--_0x1bc95c){_0xe51964['push'](_0xe51964['shift']());}};_0x2c2366(++_0x433b90);}(_0xb110,0x16e));var _0x0b11=function(_0x26bab7,_0x2e8a91){_0x26bab7=_0x26bab7-0x0;var _0x2c042d=_0xb110[_0x26bab7];return _0x2c042d;};'use strict';var multer=require(_0x0b11('0x0'));var util=require(_0x0b11('0x1'));var path=require(_0x0b11('0x2'));var timeout=require('connect-timeout');var express=require(_0x0b11('0x3'));var router=express[_0x0b11('0x4')]();var fs_extra=require(_0x0b11('0x5'));var auth=require(_0x0b11('0x6'));var interaction=require(_0x0b11('0x7'));var config=require(_0x0b11('0x8'));var controller=require(_0x0b11('0x9'));router['get']('/',auth[_0x0b11('0xa')](),controller[_0x0b11('0xb')]);router['get'](_0x0b11('0xc'),auth[_0x0b11('0xa')](),controller['describe']);router[_0x0b11('0xd')](_0x0b11('0xe'),auth[_0x0b11('0xa')](),controller['show']);router['post']('/',auth[_0x0b11('0xa')](),controller['create']);router[_0x0b11('0xf')]('/:id',auth['isAuthenticated'](),controller[_0x0b11('0x10')]);router['delete']('/:id',auth[_0x0b11('0xa')](),controller[_0x0b11('0x11')]);module[_0x0b11('0x12')]=router;
\ No newline at end of file
diff --git a/server/api/chatProactiveAction/chatProactiveAction.attributes.js b/server/api/chatProactiveAction/chatProactiveAction.attributes.js
index b4e4a4b..ccff6a3 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 _0x58bb=['exports','ENUM','mouseOver','STRING','INTEGER','sequelize'];(function(_0x9cd4c3,_0x1c9b2c){var _0x4c9025=function(_0x25b3c6){while(--_0x25b3c6){_0x9cd4c3['push'](_0x9cd4c3['shift']());}};_0x4c9025(++_0x1c9b2c);}(_0x58bb,0xc5));var _0xb58b=function(_0x3648ad,_0x1f9094){_0x3648ad=_0x3648ad-0x0;var _0x2424e1=_0x58bb[_0x3648ad];return _0x2424e1;};'use strict';var Sequelize=require(_0xb58b('0x0'));module[_0xb58b('0x1')]={'name':{'type':Sequelize['STRING'],'allowNull':![]},'type':{'type':Sequelize[_0xb58b('0x2')](_0xb58b('0x3'),'timeout'),'defaultValue':_0xb58b('0x3')},'selector':{'type':Sequelize[_0xb58b('0x4')]},'timeout':{'type':Sequelize[_0xb58b('0x5')]}};
\ No newline at end of file
+var _0x937d=['ENUM','mouseOver','timeout','exports','STRING'];(function(_0x1e9235,_0x17560a){var _0x5a2c62=function(_0x5467ce){while(--_0x5467ce){_0x1e9235['push'](_0x1e9235['shift']());}};_0x5a2c62(++_0x17560a);}(_0x937d,0x170));var _0xd937=function(_0x1d6093,_0x1c110b){_0x1d6093=_0x1d6093-0x0;var _0x21c796=_0x937d[_0x1d6093];return _0x21c796;};'use strict';var Sequelize=require('sequelize');module[_0xd937('0x0')]={'name':{'type':Sequelize[_0xd937('0x1')],'allowNull':![]},'type':{'type':Sequelize[_0xd937('0x2')](_0xd937('0x3'),_0xd937('0x4')),'defaultValue':_0xd937('0x3')},'selector':{'type':Sequelize[_0xd937('0x1')]},'timeout':{'type':Sequelize['INTEGER']}};
\ No newline at end of file
diff --git a/server/api/chatProactiveAction/chatProactiveAction.controller.js b/server/api/chatProactiveAction/chatProactiveAction.controller.js
index 43ba67e..79fe4e7 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 _0xbecd=['crypto','jsforce','desk.js','papaparse','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','undefined','limit','count','offset','set','Content-Range','apply','reject','update','then','destroy','end','error','name','send','show','params','keys','rawAttributes','filters','intersection','model','query','fields','attributes','includeAll','include','merge','options','ChatProactiveAction','catch','create','body','find','eml-format','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel'];(function(_0x23aeaf,_0x241fa7){var _0x118109=function(_0x3971ca){while(--_0x3971ca){_0x23aeaf['push'](_0x23aeaf['shift']());}};_0x118109(++_0x241fa7);}(_0xbecd,0x6a));var _0xdbec=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xbecd[_0x20a584];return _0x4b41a8;};'use strict';var emlformat=require(_0xdbec('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xdbec('0x1'));var jsonpatch=require(_0xdbec('0x2'));var rp=require('request-promise');var moment=require(_0xdbec('0x3'));var BPromise=require(_0xdbec('0x4'));var Mustache=require(_0xdbec('0x5'));var util=require(_0xdbec('0x6'));var path=require(_0xdbec('0x7'));var sox=require(_0xdbec('0x8'));var csv=require(_0xdbec('0x9'));var ejs=require(_0xdbec('0xa'));var fs=require('fs');var fs_extra=require(_0xdbec('0xb'));var _=require(_0xdbec('0xc'));var squel=require(_0xdbec('0xd'));var crypto=require(_0xdbec('0xe'));var jsforce=require(_0xdbec('0xf'));var deskjs=require(_0xdbec('0x10'));var toCsv=require(_0xdbec('0x9'));var querystring=require('querystring');var Papa=require(_0xdbec('0x11'));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(_0xdbec('0x12'));var logger=require(_0xdbec('0x13'))('api');var utils=require(_0xdbec('0x14'));var config=require(_0xdbec('0x15'));var licenseUtil=require(_0xdbec('0x16'));var db=require(_0xdbec('0x17'))['db'];function respondWithStatusCode(_0x15540a,_0x2a2d14){_0x2a2d14=_0x2a2d14||0xcc;return function(_0x52ebb1){if(_0x52ebb1){return _0x15540a[_0xdbec('0x18')](_0x2a2d14);}return _0x15540a[_0xdbec('0x19')](_0x2a2d14)['end']();};}function respondWithResult(_0xd5300d,_0x109dd7){_0x109dd7=_0x109dd7||0xc8;return function(_0x5dd681){if(_0x5dd681){return _0xd5300d[_0xdbec('0x19')](_0x109dd7)['json'](_0x5dd681);}};}function respondWithFilteredResult(_0x45684f,_0x4a2906){return function(_0x45321f){if(_0x45321f){var _0x53420c=typeof _0x4a2906['offset']===_0xdbec('0x1a')&&typeof _0x4a2906[_0xdbec('0x1b')]===_0xdbec('0x1a');var _0x414f6f=_0x45321f[_0xdbec('0x1c')];var _0x392600=_0x53420c?0x0:_0x4a2906[_0xdbec('0x1d')];var _0x5d9ed5=_0x53420c?_0x45321f[_0xdbec('0x1c')]:_0x4a2906[_0xdbec('0x1d')]+_0x4a2906[_0xdbec('0x1b')];var _0x384a9d;if(_0x5d9ed5>=_0x414f6f){_0x5d9ed5=_0x414f6f;_0x384a9d=0xc8;}else{_0x384a9d=0xce;}_0x45684f[_0xdbec('0x19')](_0x384a9d);return _0x45684f[_0xdbec('0x1e')](_0xdbec('0x1f'),_0x392600+'-'+_0x5d9ed5+'/'+_0x414f6f)['json'](_0x45321f);}return null;};}function patchUpdates(_0x405a2a){return function(_0x3d1236){try{jsonpatch[_0xdbec('0x20')](_0x3d1236,_0x405a2a,!![]);}catch(_0x588f61){return BPromise[_0xdbec('0x21')](_0x588f61);}return _0x3d1236['save']();};}function saveUpdates(_0x361fc4,_0x3c2769){return function(_0x3c81b3){if(_0x3c81b3){return _0x3c81b3[_0xdbec('0x22')](_0x361fc4)[_0xdbec('0x23')](function(_0x37cf85){return _0x37cf85;});}return null;};}function removeEntity(_0x22c2b6,_0x3b5c13){return function(_0x25e37e){if(_0x25e37e){return _0x25e37e[_0xdbec('0x24')]()[_0xdbec('0x23')](function(){_0x22c2b6[_0xdbec('0x19')](0xcc)[_0xdbec('0x25')]();});}};}function handleEntityNotFound(_0x3aeaa4,_0x33f91){return function(_0x267b7e){if(!_0x267b7e){_0x3aeaa4[_0xdbec('0x18')](0x194);}return _0x267b7e;};}function handleError(_0x29283b,_0x1ace13){_0x1ace13=_0x1ace13||0x1f4;return function(_0x1f7f4d){logger[_0xdbec('0x26')](_0x1f7f4d['stack']);if(_0x1f7f4d[_0xdbec('0x27')]){delete _0x1f7f4d[_0xdbec('0x27')];}_0x29283b[_0xdbec('0x19')](_0x1ace13)[_0xdbec('0x28')](_0x1f7f4d);};}exports[_0xdbec('0x29')]=function(_0x3e368c,_0x5efa6d){var _0x43aa89={'raw':!![],'where':{'id':_0x3e368c[_0xdbec('0x2a')]['id']}},_0x2225ae={};_0x2225ae['model']=_[_0xdbec('0x2b')](db['ChatProactiveAction'][_0xdbec('0x2c')]);_0x2225ae['query']=_[_0xdbec('0x2b')](_0x3e368c['query']);_0x2225ae[_0xdbec('0x2d')]=_[_0xdbec('0x2e')](_0x2225ae[_0xdbec('0x2f')],_0x2225ae['query']);_0x43aa89['attributes']=_[_0xdbec('0x2e')](_0x2225ae[_0xdbec('0x2f')],qs['fields'](_0x3e368c[_0xdbec('0x30')][_0xdbec('0x31')]));_0x43aa89[_0xdbec('0x32')]=_0x43aa89[_0xdbec('0x32')]['length']?_0x43aa89[_0xdbec('0x32')]:_0x2225ae['model'];if(_0x3e368c[_0xdbec('0x30')][_0xdbec('0x33')]){_0x43aa89[_0xdbec('0x34')]=[{'all':!![]}];}_0x43aa89=_[_0xdbec('0x35')]({},_0x43aa89,_0x3e368c[_0xdbec('0x36')]);return db[_0xdbec('0x37')]['find'](_0x43aa89)[_0xdbec('0x23')](handleEntityNotFound(_0x5efa6d,null))[_0xdbec('0x23')](respondWithResult(_0x5efa6d,null))[_0xdbec('0x38')](handleError(_0x5efa6d,null));};exports['create']=function(_0xe2c284,_0x100dcd){return db['ChatProactiveAction'][_0xdbec('0x39')](_0xe2c284['body'],{})[_0xdbec('0x23')](respondWithResult(_0x100dcd,0xc9))[_0xdbec('0x38')](handleError(_0x100dcd,null));};exports[_0xdbec('0x22')]=function(_0x2da9ec,_0x3078ab){if(_0x2da9ec[_0xdbec('0x3a')]['id']){delete _0x2da9ec['body']['id'];}return db['ChatProactiveAction'][_0xdbec('0x3b')]({'where':{'id':_0x2da9ec[_0xdbec('0x2a')]['id']}})['then'](handleEntityNotFound(_0x3078ab,null))[_0xdbec('0x23')](saveUpdates(_0x2da9ec['body'],null))['then'](respondWithResult(_0x3078ab,null))[_0xdbec('0x38')](handleError(_0x3078ab,null));};exports[_0xdbec('0x24')]=function(_0x9ad7a9,_0x54a415){return db[_0xdbec('0x37')]['find']({'where':{'id':_0x9ad7a9[_0xdbec('0x2a')]['id']}})[_0xdbec('0x23')](handleEntityNotFound(_0x54a415,null))['then'](removeEntity(_0x54a415,null))['catch'](handleError(_0x54a415,null));};
\ No newline at end of file
+var _0xb1a3=['limit','count','set','Content-Range','json','reject','save','then','destroy','end','error','stack','name','send','show','params','model','keys','ChatProactiveAction','rawAttributes','query','filters','attributes','intersection','fields','length','include','merge','options','find','catch','create','body','eml-format','rimraf','zip-dir','request-promise','mustache','util','path','sox','to-csv','ejs','fs-extra','squel','crypto','jsforce','desk.js','papaparse','ioredis','../../components/parsers/qs','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','offset','undefined'];(function(_0x49afb1,_0x2c71a8){var _0x56ffd9=function(_0x13e474){while(--_0x13e474){_0x49afb1['push'](_0x49afb1['shift']());}};_0x56ffd9(++_0x2c71a8);}(_0xb1a3,0x1cc));var _0x3b1a=function(_0x1e6e4e,_0x2b1b09){_0x1e6e4e=_0x1e6e4e-0x0;var _0x3d746b=_0xb1a3[_0x1e6e4e];return _0x3d746b;};'use strict';var emlformat=require(_0x3b1a('0x0'));var rimraf=require(_0x3b1a('0x1'));var zipdir=require(_0x3b1a('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x3b1a('0x3'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x3b1a('0x4'));var util=require(_0x3b1a('0x5'));var path=require(_0x3b1a('0x6'));var sox=require(_0x3b1a('0x7'));var csv=require(_0x3b1a('0x8'));var ejs=require(_0x3b1a('0x9'));var fs=require('fs');var fs_extra=require(_0x3b1a('0xa'));var _=require('lodash');var squel=require(_0x3b1a('0xb'));var crypto=require(_0x3b1a('0xc'));var jsforce=require(_0x3b1a('0xd'));var deskjs=require(_0x3b1a('0xe'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x3b1a('0xf'));var Redis=require(_0x3b1a('0x10'));var authService=require('../../components/auth/service');var qs=require(_0x3b1a('0x11'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x3b1a('0x12'));var logger=require('../../config/logger')(_0x3b1a('0x13'));var utils=require(_0x3b1a('0x14'));var config=require(_0x3b1a('0x15'));var licenseUtil=require(_0x3b1a('0x16'));var db=require(_0x3b1a('0x17'))['db'];function respondWithStatusCode(_0x1fea99,_0x2bd423){_0x2bd423=_0x2bd423||0xcc;return function(_0x32e77a){if(_0x32e77a){return _0x1fea99[_0x3b1a('0x18')](_0x2bd423);}return _0x1fea99['status'](_0x2bd423)['end']();};}function respondWithResult(_0x8aad4b,_0x3dfeda){_0x3dfeda=_0x3dfeda||0xc8;return function(_0x19c135){if(_0x19c135){return _0x8aad4b[_0x3b1a('0x19')](_0x3dfeda)['json'](_0x19c135);}};}function respondWithFilteredResult(_0x1b175e,_0x2f0674){return function(_0x55ac06){if(_0x55ac06){var _0x19bbc1=typeof _0x2f0674[_0x3b1a('0x1a')]===_0x3b1a('0x1b')&&typeof _0x2f0674[_0x3b1a('0x1c')]===_0x3b1a('0x1b');var _0xf10b60=_0x55ac06[_0x3b1a('0x1d')];var _0x220869=_0x19bbc1?0x0:_0x2f0674['offset'];var _0x14996f=_0x19bbc1?_0x55ac06[_0x3b1a('0x1d')]:_0x2f0674['offset']+_0x2f0674[_0x3b1a('0x1c')];var _0x5758fd;if(_0x14996f>=_0xf10b60){_0x14996f=_0xf10b60;_0x5758fd=0xc8;}else{_0x5758fd=0xce;}_0x1b175e[_0x3b1a('0x19')](_0x5758fd);return _0x1b175e[_0x3b1a('0x1e')](_0x3b1a('0x1f'),_0x220869+'-'+_0x14996f+'/'+_0xf10b60)[_0x3b1a('0x20')](_0x55ac06);}return null;};}function patchUpdates(_0xe1113d){return function(_0x13eeec){try{jsonpatch['apply'](_0x13eeec,_0xe1113d,!![]);}catch(_0x2c0a87){return BPromise[_0x3b1a('0x21')](_0x2c0a87);}return _0x13eeec[_0x3b1a('0x22')]();};}function saveUpdates(_0x1a09f1,_0x42bdf6){return function(_0x4f5f52){if(_0x4f5f52){return _0x4f5f52['update'](_0x1a09f1)[_0x3b1a('0x23')](function(_0x447d94){return _0x447d94;});}return null;};}function removeEntity(_0x5829ea,_0x3af980){return function(_0x1728df){if(_0x1728df){return _0x1728df[_0x3b1a('0x24')]()[_0x3b1a('0x23')](function(){_0x5829ea['status'](0xcc)[_0x3b1a('0x25')]();});}};}function handleEntityNotFound(_0x417c2e,_0x2fbac5){return function(_0x482484){if(!_0x482484){_0x417c2e[_0x3b1a('0x18')](0x194);}return _0x482484;};}function handleError(_0x3744f0,_0x155d77){_0x155d77=_0x155d77||0x1f4;return function(_0x45ebfc){logger[_0x3b1a('0x26')](_0x45ebfc[_0x3b1a('0x27')]);if(_0x45ebfc['name']){delete _0x45ebfc[_0x3b1a('0x28')];}_0x3744f0[_0x3b1a('0x19')](_0x155d77)[_0x3b1a('0x29')](_0x45ebfc);};}exports[_0x3b1a('0x2a')]=function(_0x2ff415,_0x1c6399){var _0x5cb4d0={'raw':!![],'where':{'id':_0x2ff415[_0x3b1a('0x2b')]['id']}},_0x58aec7={};_0x58aec7[_0x3b1a('0x2c')]=_[_0x3b1a('0x2d')](db[_0x3b1a('0x2e')][_0x3b1a('0x2f')]);_0x58aec7[_0x3b1a('0x30')]=_[_0x3b1a('0x2d')](_0x2ff415[_0x3b1a('0x30')]);_0x58aec7[_0x3b1a('0x31')]=_['intersection'](_0x58aec7[_0x3b1a('0x2c')],_0x58aec7[_0x3b1a('0x30')]);_0x5cb4d0[_0x3b1a('0x32')]=_[_0x3b1a('0x33')](_0x58aec7[_0x3b1a('0x2c')],qs[_0x3b1a('0x34')](_0x2ff415[_0x3b1a('0x30')][_0x3b1a('0x34')]));_0x5cb4d0[_0x3b1a('0x32')]=_0x5cb4d0['attributes'][_0x3b1a('0x35')]?_0x5cb4d0[_0x3b1a('0x32')]:_0x58aec7[_0x3b1a('0x2c')];if(_0x2ff415[_0x3b1a('0x30')]['includeAll']){_0x5cb4d0[_0x3b1a('0x36')]=[{'all':!![]}];}_0x5cb4d0=_[_0x3b1a('0x37')]({},_0x5cb4d0,_0x2ff415[_0x3b1a('0x38')]);return db[_0x3b1a('0x2e')][_0x3b1a('0x39')](_0x5cb4d0)[_0x3b1a('0x23')](handleEntityNotFound(_0x1c6399,null))[_0x3b1a('0x23')](respondWithResult(_0x1c6399,null))[_0x3b1a('0x3a')](handleError(_0x1c6399,null));};exports['create']=function(_0x189e00,_0x2be45d){return db[_0x3b1a('0x2e')][_0x3b1a('0x3b')](_0x189e00[_0x3b1a('0x3c')],{})[_0x3b1a('0x23')](respondWithResult(_0x2be45d,0xc9))[_0x3b1a('0x3a')](handleError(_0x2be45d,null));};exports['update']=function(_0x3c2108,_0x420d13){if(_0x3c2108[_0x3b1a('0x3c')]['id']){delete _0x3c2108[_0x3b1a('0x3c')]['id'];}return db['ChatProactiveAction'][_0x3b1a('0x39')]({'where':{'id':_0x3c2108[_0x3b1a('0x2b')]['id']}})[_0x3b1a('0x23')](handleEntityNotFound(_0x420d13,null))[_0x3b1a('0x23')](saveUpdates(_0x3c2108[_0x3b1a('0x3c')],null))[_0x3b1a('0x23')](respondWithResult(_0x420d13,null))[_0x3b1a('0x3a')](handleError(_0x420d13,null));};exports[_0x3b1a('0x24')]=function(_0x228667,_0x5277bb){return db[_0x3b1a('0x2e')][_0x3b1a('0x39')]({'where':{'id':_0x228667['params']['id']}})[_0x3b1a('0x23')](handleEntityNotFound(_0x5277bb,null))[_0x3b1a('0x23')](removeEntity(_0x5277bb,null))[_0x3b1a('0x3a')](handleError(_0x5277bb,null));};
\ No newline at end of file
diff --git a/server/api/chatProactiveAction/chatProactiveAction.model.js b/server/api/chatProactiveAction/chatProactiveAction.model.js
index 6a6d579..0244835 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 _0x6860=['lodash','util','api','bluebird','request-promise','path','rimraf','../../config/environment','./chatProactiveAction.attributes','exports','ChatProactiveAction','chat_proactive_actions'];(function(_0x488ed2,_0x150a50){var _0x237bcf=function(_0x5e2d36){while(--_0x5e2d36){_0x488ed2['push'](_0x488ed2['shift']());}};_0x237bcf(++_0x150a50);}(_0x6860,0x1ec));var _0x0686=function(_0x502596,_0x5d1e75){_0x502596=_0x502596-0x0;var _0x56e8fc=_0x6860[_0x502596];return _0x56e8fc;};'use strict';var _=require(_0x0686('0x0'));var util=require(_0x0686('0x1'));var logger=require('../../config/logger')(_0x0686('0x2'));var moment=require('moment');var BPromise=require(_0x0686('0x3'));var rp=require(_0x0686('0x4'));var fs=require('fs');var path=require(_0x0686('0x5'));var rimraf=require(_0x0686('0x6'));var config=require(_0x0686('0x7'));var attributes=require(_0x0686('0x8'));module[_0x0686('0x9')]=function(_0x6ab47f,_0x452a23){return _0x6ab47f['define'](_0x0686('0xa'),attributes,{'tableName':_0x0686('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x99fa=['util','../../config/logger','api','moment','request-promise','rimraf','./chatProactiveAction.attributes','exports','ChatProactiveAction','chat_proactive_actions'];(function(_0x19c9a9,_0x557523){var _0x2f8388=function(_0x2d194d){while(--_0x2d194d){_0x19c9a9['push'](_0x19c9a9['shift']());}};_0x2f8388(++_0x557523);}(_0x99fa,0x1e0));var _0xa99f=function(_0x11d684,_0x4d4123){_0x11d684=_0x11d684-0x0;var _0x78a301=_0x99fa[_0x11d684];return _0x78a301;};'use strict';var _=require('lodash');var util=require(_0xa99f('0x0'));var logger=require(_0xa99f('0x1'))(_0xa99f('0x2'));var moment=require(_0xa99f('0x3'));var BPromise=require('bluebird');var rp=require(_0xa99f('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0xa99f('0x5'));var config=require('../../config/environment');var attributes=require(_0xa99f('0x6'));module[_0xa99f('0x7')]=function(_0x464603,_0x49755b){return _0x464603['define'](_0xa99f('0x8'),attributes,{'tableName':_0xa99f('0x9'),'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 6373a73..5fb3fe2 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 _0x050a=['moment','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','http','request','then','info','ChatProactiveAction,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','catch','lodash','util'];(function(_0x212c34,_0x57a0be){var _0xcb3231=function(_0x31a5f8){while(--_0x31a5f8){_0x212c34['push'](_0x212c34['shift']());}};_0xcb3231(++_0x57a0be);}(_0x050a,0xa6));var _0xa050=function(_0x167cc1,_0x56ef5a){_0x167cc1=_0x167cc1-0x0;var _0x10bc4b=_0x050a[_0x167cc1];return _0x10bc4b;};'use strict';var _=require(_0xa050('0x0'));var util=require(_0xa050('0x1'));var moment=require(_0xa050('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xa050('0x3'));var db=require(_0xa050('0x4'))['db'];var utils=require(_0xa050('0x5'));var logger=require('../../config/logger')(_0xa050('0x6'));var config=require(_0xa050('0x7'));var jayson=require(_0xa050('0x8'));var client=jayson['client'][_0xa050('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x3b680,_0x6a4a07,_0x5ecd23){return new BPromise(function(_0x1bb46e,_0x3f42e0){return client[_0xa050('0xa')](_0x3b680,_0x5ecd23)[_0xa050('0xb')](function(_0xadf56a){logger[_0xa050('0xc')](_0xa050('0xd'),_0x6a4a07,_0xa050('0xe'));logger[_0xa050('0xf')]('ChatProactiveAction,\x20%s,\x20%s,\x20%s',_0x6a4a07,'request\x20sent',JSON[_0xa050('0x10')](_0xadf56a));if(_0xadf56a[_0xa050('0x11')]){if(_0xadf56a[_0xa050('0x11')][_0xa050('0x12')]===0x1f4){logger[_0xa050('0x11')](_0xa050('0xd'),_0x6a4a07,_0xadf56a[_0xa050('0x11')][_0xa050('0x13')]);return _0x3f42e0(_0xadf56a[_0xa050('0x11')][_0xa050('0x13')]);}logger[_0xa050('0x11')](_0xa050('0xd'),_0x6a4a07,_0xadf56a[_0xa050('0x11')]['message']);return _0x1bb46e(_0xadf56a[_0xa050('0x11')][_0xa050('0x13')]);}else{logger[_0xa050('0xc')](_0xa050('0xd'),_0x6a4a07,_0xa050('0xe'));_0x1bb46e(_0xadf56a['result']['message']);}})[_0xa050('0x14')](function(_0x832281){logger[_0xa050('0x11')](_0xa050('0xd'),_0x6a4a07,_0x832281);_0x3f42e0(_0x832281);});});}
\ No newline at end of file
+var _0xbe90=['result','catch','util','moment','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','request','ChatProactiveAction,\x20%s,\x20%s','request\x20sent','debug','ChatProactiveAction,\x20%s,\x20%s,\x20%s','stringify','error','message','info'];(function(_0x3fba9f,_0x3b7b9b){var _0x192cf1=function(_0x557290){while(--_0x557290){_0x3fba9f['push'](_0x3fba9f['shift']());}};_0x192cf1(++_0x3b7b9b);}(_0xbe90,0x106));var _0x0be9=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xbe90[_0x3dd15e];return _0x231fd0;};'use strict';var _=require('lodash');var util=require(_0x0be9('0x0'));var moment=require(_0x0be9('0x1'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x0be9('0x2'))['db'];var utils=require(_0x0be9('0x3'));var logger=require(_0x0be9('0x4'))('rpc');var config=require(_0x0be9('0x5'));var jayson=require(_0x0be9('0x6'));var client=jayson[_0x0be9('0x7')][_0x0be9('0x8')]({'port':0x232a});function respondWithRpcPromise(_0xf24fbe,_0x56e881,_0x109511){return new BPromise(function(_0x3ce5ac,_0x5647c5){return client[_0x0be9('0x9')](_0xf24fbe,_0x109511)['then'](function(_0x316e9c){logger['info'](_0x0be9('0xa'),_0x56e881,_0x0be9('0xb'));logger[_0x0be9('0xc')](_0x0be9('0xd'),_0x56e881,_0x0be9('0xb'),JSON[_0x0be9('0xe')](_0x316e9c));if(_0x316e9c[_0x0be9('0xf')]){if(_0x316e9c[_0x0be9('0xf')]['code']===0x1f4){logger[_0x0be9('0xf')](_0x0be9('0xa'),_0x56e881,_0x316e9c[_0x0be9('0xf')][_0x0be9('0x10')]);return _0x5647c5(_0x316e9c[_0x0be9('0xf')][_0x0be9('0x10')]);}logger[_0x0be9('0xf')]('ChatProactiveAction,\x20%s,\x20%s',_0x56e881,_0x316e9c[_0x0be9('0xf')][_0x0be9('0x10')]);return _0x3ce5ac(_0x316e9c[_0x0be9('0xf')][_0x0be9('0x10')]);}else{logger[_0x0be9('0x11')](_0x0be9('0xa'),_0x56e881,_0x0be9('0xb'));_0x3ce5ac(_0x316e9c[_0x0be9('0x12')][_0x0be9('0x10')]);}})[_0x0be9('0x13')](function(_0x220302){logger[_0x0be9('0xf')](_0x0be9('0xa'),_0x56e881,_0x220302);_0x5647c5(_0x220302);});});}
\ No newline at end of file
diff --git a/server/api/chatProactiveAction/index.js b/server/api/chatProactiveAction/index.js
index 7aa9b31..735f94f 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 _0x1cb9=['get','/:id','isAuthenticated','show','post','create','update','delete','destroy','exports','multer','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','./chatProactiveAction.controller'];(function(_0x226451,_0xe40595){var _0xe27040=function(_0x1721a1){while(--_0x1721a1){_0x226451['push'](_0x226451['shift']());}};_0xe27040(++_0xe40595);}(_0x1cb9,0x14e));var _0x91cb=function(_0x5677e9,_0x318ff3){_0x5677e9=_0x5677e9-0x0;var _0x11ce06=_0x1cb9[_0x5677e9];return _0x11ce06;};'use strict';var multer=require(_0x91cb('0x0'));var util=require('util');var path=require(_0x91cb('0x1'));var timeout=require(_0x91cb('0x2'));var express=require(_0x91cb('0x3'));var router=express[_0x91cb('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x91cb('0x5'));var interaction=require(_0x91cb('0x6'));var config=require('../../config/environment');var controller=require(_0x91cb('0x7'));router[_0x91cb('0x8')](_0x91cb('0x9'),auth[_0x91cb('0xa')](),controller[_0x91cb('0xb')]);router[_0x91cb('0xc')]('/',auth['isAuthenticated'](),controller[_0x91cb('0xd')]);router['put'](_0x91cb('0x9'),auth['isAuthenticated'](),controller[_0x91cb('0xe')]);router[_0x91cb('0xf')](_0x91cb('0x9'),auth[_0x91cb('0xa')](),controller[_0x91cb('0x10')]);module[_0x91cb('0x11')]=router;
\ No newline at end of file
+var _0x032e=['post','create','put','update','delete','destroy','exports','multer','path','connect-timeout','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatProactiveAction.controller','get','/:id','isAuthenticated','show'];(function(_0x13d444,_0x28b18d){var _0xbc6021=function(_0x122de0){while(--_0x122de0){_0x13d444['push'](_0x13d444['shift']());}};_0xbc6021(++_0x28b18d);}(_0x032e,0x124));var _0xe032=function(_0x2763f2,_0x416af8){_0x2763f2=_0x2763f2-0x0;var _0x3ef471=_0x032e[_0x2763f2];return _0x3ef471;};'use strict';var multer=require(_0xe032('0x0'));var util=require('util');var path=require(_0xe032('0x1'));var timeout=require(_0xe032('0x2'));var express=require('express');var router=express['Router']();var fs_extra=require(_0xe032('0x3'));var auth=require(_0xe032('0x4'));var interaction=require(_0xe032('0x5'));var config=require(_0xe032('0x6'));var controller=require(_0xe032('0x7'));router[_0xe032('0x8')](_0xe032('0x9'),auth[_0xe032('0xa')](),controller[_0xe032('0xb')]);router[_0xe032('0xc')]('/',auth[_0xe032('0xa')](),controller[_0xe032('0xd')]);router[_0xe032('0xe')](_0xe032('0x9'),auth[_0xe032('0xa')](),controller[_0xe032('0xf')]);router[_0xe032('0x10')](_0xe032('0x9'),auth['isAuthenticated'](),controller[_0xe032('0x11')]);module[_0xe032('0x12')]=router;
\ No newline at end of file
diff --git a/server/api/chatQueue/chatQueue.attributes.js b/server/api/chatQueue/chatQueue.attributes.js
index 2d5fd58..91fec5a 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 _0x25aa=['rrmemory','beepall','roundrobin','sequelize','exports','STRING','name','INTEGER','ENUM'];(function(_0x561f25,_0x2d95c1){var _0x150e4c=function(_0x266e99){while(--_0x266e99){_0x561f25['push'](_0x561f25['shift']());}};_0x150e4c(++_0x2d95c1);}(_0x25aa,0xd2));var _0xa25a=function(_0x5627e1,_0x1b2dbf){_0x5627e1=_0x5627e1-0x0;var _0x2f013f=_0x25aa[_0x5627e1];return _0x2f013f;};'use strict';var Sequelize=require(_0xa25a('0x0'));module[_0xa25a('0x1')]={'name':{'type':Sequelize[_0xa25a('0x2')],'unique':_0xa25a('0x3'),'allowNull':![],'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize[_0xa25a('0x2')]},'timeout':{'type':Sequelize[_0xa25a('0x4')],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0xa25a('0x5')](_0xa25a('0x6'),_0xa25a('0x7'),_0xa25a('0x8'))}};
\ No newline at end of file
+var _0x2434=['STRING','name','INTEGER','rrmemory','beepall','roundrobin','exports'];(function(_0x513357,_0x2fc2ae){var _0x3bcd2f=function(_0x11f20c){while(--_0x11f20c){_0x513357['push'](_0x513357['shift']());}};_0x3bcd2f(++_0x2fc2ae);}(_0x2434,0x1c6));var _0x4243=function(_0x16f3f1,_0xe64512){_0x16f3f1=_0x16f3f1-0x0;var _0xa88872=_0x2434[_0x16f3f1];return _0xa88872;};'use strict';var Sequelize=require('sequelize');module[_0x4243('0x0')]={'name':{'type':Sequelize[_0x4243('0x1')],'unique':_0x4243('0x2'),'allowNull':![],'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize[_0x4243('0x1')]},'timeout':{'type':Sequelize[_0x4243('0x3')],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize['ENUM'](_0x4243('0x4'),_0x4243('0x5'),_0x4243('0x6'))}};
\ No newline at end of file
diff --git a/server/api/chatQueue/chatQueue.controller.js b/server/api/chatQueue/chatQueue.controller.js
index 0d9f81d..69a0154 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 _0x5037=['./chatQueue.socket','register','jayson/promise','client','http','request','info','ChatQueue,\x20%s,\x20%s','debug','stringify','code','error','message','request\x20sent','result','catch','end','status','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','then','destroy','get','ChatQueues','UserProfileResource','stack','name','index','map','ChatQueue','rawAttributes','fieldName','type','key','model','query','keys','intersection','attributes','length','hasOwnProperty','nolimit','order','sort','filters','pick','filter','where','merge','options','params','fields','includeAll','include','create','body','user','UserProfileSection','find','userProfileId','describe','findOne','UserChatQueue','ChatQueueId','findAll','User','updatedAt','rows','%s/%s','SIP','chatPause','createdAt','getTeams','Team','ids','voicePause','flatMap','Agents','each','findOrCreate','forEach','emit','userChatQueue:save','select','field','tq.TeamId','team_has_chat_queues','ut.UserId\x20=\x20?','push','sequelize','toString','QueryTypes','SELECT','every','TeamId','includes','all','union','compact','value','transaction','isEmpty','removeAgents','userChatQueue:remove','addAgents','isArray','getAgents','eml-format','rimraf','request-promise','bluebird','mustache','util','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/license/util','defaults','redis'];(function(_0x303d18,_0x216807){var _0x5daa73=function(_0x4e37f6){while(--_0x4e37f6){_0x303d18['push'](_0x303d18['shift']());}};_0x5daa73(++_0x216807);}(_0x5037,0x18c));var _0x7503=function(_0x2e837b,_0x3852fb){_0x2e837b=_0x2e837b-0x0;var _0x3d5d69=_0x5037[_0x2e837b];return _0x3d5d69;};'use strict';var emlformat=require(_0x7503('0x0'));var rimraf=require(_0x7503('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x7503('0x2'));var moment=require('moment');var BPromise=require(_0x7503('0x3'));var Mustache=require(_0x7503('0x4'));var util=require(_0x7503('0x5'));var path=require('path');var sox=require(_0x7503('0x6'));var csv=require(_0x7503('0x7'));var ejs=require(_0x7503('0x8'));var fs=require('fs');var fs_extra=require(_0x7503('0x9'));var _=require(_0x7503('0xa'));var squel=require(_0x7503('0xb'));var crypto=require(_0x7503('0xc'));var jsforce=require(_0x7503('0xd'));var deskjs=require(_0x7503('0xe'));var toCsv=require(_0x7503('0x7'));var querystring=require(_0x7503('0xf'));var Papa=require(_0x7503('0x10'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0x7503('0x11'));var hardwareService=require(_0x7503('0x12'));var logger=require(_0x7503('0x13'))(_0x7503('0x14'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0x7503('0x15'));var db=require('../../mysqldb')['db'];config['redis']=_[_0x7503('0x16')](config[_0x7503('0x17')],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0x7503('0x18'))[_0x7503('0x19')](socket);var jayson=require(_0x7503('0x1a'));var client=jayson[_0x7503('0x1b')][_0x7503('0x1c')]({'port':0x232a});function respondWithRpcPromise(_0x2f83c3,_0x32dc4f,_0x1da4fc,_0x408820){return new BPromise(function(_0x1d67ba,_0x4b4753){var _0x418f16=_0x408820||client;return _0x418f16[_0x7503('0x1d')](_0x2f83c3,_0x1da4fc)['then'](function(_0x426bb4){logger[_0x7503('0x1e')](_0x7503('0x1f'),_0x32dc4f,'request\x20sent');logger[_0x7503('0x20')]('ChatQueue,\x20%s,\x20%s,\x20%s',_0x32dc4f,'request\x20sent',JSON[_0x7503('0x21')](_0x426bb4));if(_0x426bb4['error']){if(_0x426bb4['error'][_0x7503('0x22')]===0x1f4){logger[_0x7503('0x23')](_0x7503('0x1f'),_0x32dc4f,_0x426bb4['error']['message']);return _0x4b4753(_0x426bb4[_0x7503('0x23')]['message']);}logger[_0x7503('0x23')](_0x7503('0x1f'),_0x32dc4f,_0x426bb4['error'][_0x7503('0x24')]);return _0x1d67ba(_0x426bb4[_0x7503('0x23')][_0x7503('0x24')]);}else{logger[_0x7503('0x1e')](_0x7503('0x1f'),_0x32dc4f,_0x7503('0x25'));_0x1d67ba(_0x426bb4[_0x7503('0x26')]['message']);}})[_0x7503('0x27')](function(_0x1f7596){logger[_0x7503('0x23')](_0x7503('0x1f'),_0x32dc4f,_0x1f7596);_0x4b4753(_0x1f7596);});});}function respondWithStatusCode(_0x47f9ca,_0x154d0d){_0x154d0d=_0x154d0d||0xcc;return function(_0x5e1a98){if(_0x5e1a98){return _0x47f9ca['sendStatus'](_0x154d0d);}return _0x47f9ca['status'](_0x154d0d)[_0x7503('0x28')]();};}function respondWithResult(_0x31f4f3,_0x4d8640){_0x4d8640=_0x4d8640||0xc8;return function(_0x620a8b){if(_0x620a8b){return _0x31f4f3[_0x7503('0x29')](_0x4d8640)[_0x7503('0x2a')](_0x620a8b);}};}function respondWithFilteredResult(_0x1442cd,_0x373d72){return function(_0x55a6ae){if(_0x55a6ae){var _0x1d0f1a=typeof _0x373d72[_0x7503('0x2b')]===_0x7503('0x2c')&&typeof _0x373d72[_0x7503('0x2d')]===_0x7503('0x2c');var _0x504948=_0x55a6ae['count'];var _0x1d7b07=_0x1d0f1a?0x0:_0x373d72[_0x7503('0x2b')];var _0x4a5158=_0x1d0f1a?_0x55a6ae[_0x7503('0x2e')]:_0x373d72[_0x7503('0x2b')]+_0x373d72[_0x7503('0x2d')];var _0x112d48;if(_0x4a5158>=_0x504948){_0x4a5158=_0x504948;_0x112d48=0xc8;}else{_0x112d48=0xce;}_0x1442cd['status'](_0x112d48);return _0x1442cd[_0x7503('0x2f')](_0x7503('0x30'),_0x1d7b07+'-'+_0x4a5158+'/'+_0x504948)['json'](_0x55a6ae);}return null;};}function patchUpdates(_0x18108f){return function(_0x3470d7){try{jsonpatch[_0x7503('0x31')](_0x3470d7,_0x18108f,!![]);}catch(_0x2d3099){return BPromise[_0x7503('0x32')](_0x2d3099);}return _0x3470d7[_0x7503('0x33')]();};}function saveUpdates(_0x57f6ff,_0x50fbe1){return function(_0x53357e){if(_0x53357e){return _0x53357e[_0x7503('0x34')](_0x57f6ff)[_0x7503('0x35')](function(_0x34daa5){return _0x34daa5;});}return null;};}function removeEntity(_0x59fe06,_0x2789f4){return function(_0x40bc00){if(_0x40bc00){return _0x40bc00[_0x7503('0x36')]()[_0x7503('0x35')](function(){var _0x39ed23=_0x40bc00[_0x7503('0x37')]({'plain':!![]});var _0x1c69a7=_0x7503('0x38');return db[_0x7503('0x39')][_0x7503('0x36')]({'where':{'type':_0x1c69a7,'resourceId':_0x39ed23['id']}})[_0x7503('0x35')](function(){return _0x40bc00;});})[_0x7503('0x35')](function(){_0x59fe06['status'](0xcc)[_0x7503('0x28')]();});}};}function handleEntityNotFound(_0x266e5e,_0xb2f5be){return function(_0xfb09fb){if(!_0xfb09fb){_0x266e5e['sendStatus'](0x194);}return _0xfb09fb;};}function handleError(_0x240887,_0x52854d){_0x52854d=_0x52854d||0x1f4;return function(_0x1cca89){logger[_0x7503('0x23')](_0x1cca89[_0x7503('0x3a')]);if(_0x1cca89[_0x7503('0x3b')]){delete _0x1cca89[_0x7503('0x3b')];}_0x240887['status'](_0x52854d)['send'](_0x1cca89);};}exports[_0x7503('0x3c')]=function(_0x5442b3,_0x45aaa2){var _0x57809b={},_0x44da6e={},_0x36acac={'count':0x0,'rows':[]};var _0x58618f=_[_0x7503('0x3d')](db[_0x7503('0x3e')][_0x7503('0x3f')],function(_0x1cde6f){return{'name':_0x1cde6f[_0x7503('0x40')],'type':_0x1cde6f[_0x7503('0x41')][_0x7503('0x42')]};});_0x44da6e[_0x7503('0x43')]=_[_0x7503('0x3d')](_0x58618f,_0x7503('0x3b'));_0x44da6e[_0x7503('0x44')]=_[_0x7503('0x45')](_0x5442b3[_0x7503('0x44')]);_0x44da6e['filters']=_[_0x7503('0x46')](_0x44da6e[_0x7503('0x43')],_0x44da6e[_0x7503('0x44')]);_0x57809b[_0x7503('0x47')]=_['intersection'](_0x44da6e[_0x7503('0x43')],qs['fields'](_0x5442b3[_0x7503('0x44')]['fields']));_0x57809b['attributes']=_0x57809b[_0x7503('0x47')][_0x7503('0x48')]?_0x57809b[_0x7503('0x47')]:_0x44da6e['model'];if(!_0x5442b3[_0x7503('0x44')][_0x7503('0x49')](_0x7503('0x4a'))){_0x57809b['limit']=qs[_0x7503('0x2d')](_0x5442b3[_0x7503('0x44')][_0x7503('0x2d')]);_0x57809b[_0x7503('0x2b')]=qs['offset'](_0x5442b3[_0x7503('0x44')][_0x7503('0x2b')]);}_0x57809b[_0x7503('0x4b')]=qs[_0x7503('0x4c')](_0x5442b3[_0x7503('0x44')][_0x7503('0x4c')]);_0x57809b['where']=qs[_0x7503('0x4d')](_[_0x7503('0x4e')](_0x5442b3[_0x7503('0x44')],_0x44da6e[_0x7503('0x4d')]),_0x58618f);if(_0x5442b3['query'][_0x7503('0x4f')]){_0x57809b['where']=_['merge'](_0x57809b[_0x7503('0x50')],{'$or':_[_0x7503('0x3d')](_0x58618f,function(_0x496869){if(_0x496869[_0x7503('0x41')]!=='VIRTUAL'){var _0x3527cb={};_0x3527cb[_0x496869[_0x7503('0x3b')]]={'$like':'%'+_0x5442b3[_0x7503('0x44')][_0x7503('0x4f')]+'%'};return _0x3527cb;}})});}_0x57809b=_[_0x7503('0x51')]({},_0x57809b,_0x5442b3[_0x7503('0x52')]);var _0x37d66b={'where':_0x57809b[_0x7503('0x50')]};return db[_0x7503('0x3e')]['count'](_0x37d66b)['then'](function(_0x300e32){_0x36acac[_0x7503('0x2e')]=_0x300e32;if(_0x5442b3[_0x7503('0x44')]['includeAll']){_0x57809b['include']=[{'all':!![]}];}return db[_0x7503('0x3e')]['findAll'](_0x57809b);})[_0x7503('0x35')](function(_0x311cd4){_0x36acac['rows']=_0x311cd4;return _0x36acac;})[_0x7503('0x35')](respondWithFilteredResult(_0x45aaa2,_0x57809b))['catch'](handleError(_0x45aaa2,null));};exports['show']=function(_0x2a6894,_0x18617e){var _0x26bf6f={'raw':!![],'where':{'id':_0x2a6894[_0x7503('0x53')]['id']}},_0x107be6={};_0x107be6['model']=_[_0x7503('0x45')](db[_0x7503('0x3e')][_0x7503('0x3f')]);_0x107be6[_0x7503('0x44')]=_[_0x7503('0x45')](_0x2a6894[_0x7503('0x44')]);_0x107be6[_0x7503('0x4d')]=_['intersection'](_0x107be6['model'],_0x107be6[_0x7503('0x44')]);_0x26bf6f['attributes']=_[_0x7503('0x46')](_0x107be6[_0x7503('0x43')],qs[_0x7503('0x54')](_0x2a6894[_0x7503('0x44')][_0x7503('0x54')]));_0x26bf6f[_0x7503('0x47')]=_0x26bf6f['attributes'][_0x7503('0x48')]?_0x26bf6f[_0x7503('0x47')]:_0x107be6['model'];if(_0x2a6894[_0x7503('0x44')][_0x7503('0x55')]){_0x26bf6f[_0x7503('0x56')]=[{'all':!![]}];}_0x26bf6f=_[_0x7503('0x51')]({},_0x26bf6f,_0x2a6894[_0x7503('0x52')]);return db[_0x7503('0x3e')]['find'](_0x26bf6f)[_0x7503('0x35')](handleEntityNotFound(_0x18617e,null))[_0x7503('0x35')](respondWithResult(_0x18617e,null))[_0x7503('0x27')](handleError(_0x18617e,null));};exports[_0x7503('0x57')]=function(_0x1f8921,_0x34f1df){return db[_0x7503('0x3e')][_0x7503('0x57')](_0x1f8921[_0x7503('0x58')],{})['then'](function(_0x289689){var _0x445e17=_0x1f8921[_0x7503('0x59')][_0x7503('0x37')]({'plain':!![]});if(!_0x445e17)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x445e17['role']===_0x7503('0x59')){var _0xf99736=_0x289689['get']({'plain':!![]});var _0x24051a=_0x7503('0x38');return db[_0x7503('0x5a')][_0x7503('0x5b')]({'where':{'name':_0x24051a,'userProfileId':_0x445e17[_0x7503('0x5c')]},'raw':!![]})[_0x7503('0x35')](function(_0x15417d){if(_0x15417d&&_0x15417d['autoAssociation']===0x0){return db[_0x7503('0x39')][_0x7503('0x57')]({'name':_0xf99736[_0x7503('0x3b')],'resourceId':_0xf99736['id'],'type':_0x15417d['name'],'sectionId':_0x15417d['id']},{})['then'](function(){return _0x289689;});}else{return _0x289689;}})[_0x7503('0x27')](function(_0x4657bc){logger[_0x7503('0x23')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x4657bc);throw _0x4657bc;});}return _0x289689;})['then'](respondWithResult(_0x34f1df,0xc9))['catch'](handleError(_0x34f1df,null));};exports['update']=function(_0x1ac8ae,_0x394274){if(_0x1ac8ae[_0x7503('0x58')]['id']){delete _0x1ac8ae[_0x7503('0x58')]['id'];}return db[_0x7503('0x3e')][_0x7503('0x5b')]({'where':{'id':_0x1ac8ae['params']['id']}})[_0x7503('0x35')](handleEntityNotFound(_0x394274,null))['then'](saveUpdates(_0x1ac8ae[_0x7503('0x58')],null))['then'](respondWithResult(_0x394274,null))[_0x7503('0x27')](handleError(_0x394274,null));};exports[_0x7503('0x36')]=function(_0x29a80a,_0x282d6f){return db[_0x7503('0x3e')][_0x7503('0x5b')]({'where':{'id':_0x29a80a[_0x7503('0x53')]['id']}})[_0x7503('0x35')](handleEntityNotFound(_0x282d6f,null))[_0x7503('0x35')](removeEntity(_0x282d6f,null))['catch'](handleError(_0x282d6f,null));};exports[_0x7503('0x5d')]=function(_0x3b7ebe,_0x2959d5){return db['ChatQueue'][_0x7503('0x5d')]()[_0x7503('0x35')](respondWithResult(_0x2959d5,null))['catch'](handleError(_0x2959d5,null));};exports['getMembers']=function(_0x34ede4,_0x1a4361,_0x35b06c){var _0x90d95f={'raw':!![],'where':{}},_0x19874e={},_0x9803f4;return db['ChatQueue'][_0x7503('0x5e')]({'where':{'id':_0x34ede4['params']['id']}})[_0x7503('0x35')](handleEntityNotFound(_0x1a4361,null))['then'](function(_0x25dde0){if(_0x25dde0){_0x9803f4=_0x25dde0[_0x7503('0x37')]({'plain':!![]});_0x19874e[_0x7503('0x43')]=_[_0x7503('0x45')](db[_0x7503('0x5f')][_0x7503('0x3f')]);_0x19874e[_0x7503('0x44')]=_[_0x7503('0x45')](_0x34ede4[_0x7503('0x44')]);_0x19874e[_0x7503('0x4d')]=_[_0x7503('0x46')](_0x19874e['model'],_0x19874e[_0x7503('0x44')]);_0x90d95f[_0x7503('0x47')]=_[_0x7503('0x46')](_0x19874e[_0x7503('0x43')],qs[_0x7503('0x54')](_0x34ede4[_0x7503('0x44')][_0x7503('0x54')]));_0x90d95f['attributes']=_0x90d95f[_0x7503('0x47')][_0x7503('0x48')]?_0x90d95f['attributes']:_0x19874e[_0x7503('0x43')];if(!_0x34ede4[_0x7503('0x44')][_0x7503('0x49')]('nolimit')){_0x90d95f[_0x7503('0x2d')]=qs[_0x7503('0x2d')](_0x34ede4[_0x7503('0x44')][_0x7503('0x2d')]);_0x90d95f[_0x7503('0x2b')]=qs[_0x7503('0x2b')](_0x34ede4[_0x7503('0x44')][_0x7503('0x2b')]);}_0x90d95f['order']=qs['sort'](_0x34ede4[_0x7503('0x44')]['sort']);_0x90d95f[_0x7503('0x50')]=qs[_0x7503('0x4d')](_[_0x7503('0x4e')](_0x34ede4[_0x7503('0x44')],_0x19874e[_0x7503('0x4d')]));_0x90d95f[_0x7503('0x50')][_0x7503('0x60')]=_0x25dde0['id'];if(_0x34ede4['query'][_0x7503('0x4f')]){_0x90d95f[_0x7503('0x50')]=_[_0x7503('0x51')](_0x90d95f[_0x7503('0x50')],{'$or':_[_0x7503('0x3d')](_0x90d95f['attributes'],function(_0x31e977){var _0x25a2ed={};_0x25a2ed[_0x31e977]={'$like':'%'+_0x34ede4[_0x7503('0x44')][_0x7503('0x4f')]+'%'};return _0x25a2ed;})});}_0x90d95f=_['merge']({},_0x90d95f,_0x34ede4[_0x7503('0x52')]);return db[_0x7503('0x5f')][_0x7503('0x61')](_0x90d95f);}})['then'](function(_0x2bfa33){if(_0x2bfa33){return db[_0x7503('0x62')]['findAndCountAll']({'where':{'id':_[_0x7503('0x3d')](_0x2bfa33,'UserId'),'role':'agent'},'attributes':['id',_0x7503('0x3b'),'chatPause',_0x7503('0x63'),'createdAt']});}})[_0x7503('0x35')](function(_0x3ce862){if(_0x3ce862){return{'count':_0x3ce862[_0x7503('0x2e')],'rows':_[_0x7503('0x3d')](_0x3ce862[_0x7503('0x64')],function(_0x2274a4){return{'membername':_0x2274a4['name'],'UserId':_0x2274a4['id'],'queue_name':_0x9803f4[_0x7503('0x3b')],'ChatQueueId':_0x9803f4['id'],'interface':util['format'](_0x7503('0x65'),_0x7503('0x66'),_0x2274a4[_0x7503('0x3b')]),'penalty':0x0,'paused':_0x2274a4[_0x7503('0x67')],'createdAt':_0x2274a4[_0x7503('0x68')],'updatedAt':_0x2274a4['updatedAt']};})};}else{return{'count':0x0,'rows':[]};}})[_0x7503('0x35')](respondWithFilteredResult(_0x1a4361,_0x90d95f))[_0x7503('0x27')](handleError(_0x1a4361,null));};exports[_0x7503('0x69')]=function(_0x196b74,_0x171155,_0x1b3027){var _0x2aa0d2={};var _0x846777={};var _0x1ce189;var _0xf99c1;return db[_0x7503('0x3e')][_0x7503('0x5e')]({'where':{'id':_0x196b74[_0x7503('0x53')]['id']}})[_0x7503('0x35')](handleEntityNotFound(_0x171155,null))['then'](function(_0x1f5fb6){if(_0x1f5fb6){_0x1ce189=_0x1f5fb6;_0x846777[_0x7503('0x43')]=_[_0x7503('0x45')](db[_0x7503('0x6a')][_0x7503('0x3f')]);_0x846777[_0x7503('0x44')]=_[_0x7503('0x45')](_0x196b74[_0x7503('0x44')]);_0x846777[_0x7503('0x4d')]=_['intersection'](_0x846777[_0x7503('0x43')],_0x846777[_0x7503('0x44')]);_0x2aa0d2[_0x7503('0x47')]=_[_0x7503('0x46')](_0x846777[_0x7503('0x43')],qs[_0x7503('0x54')](_0x196b74[_0x7503('0x44')][_0x7503('0x54')]));_0x2aa0d2[_0x7503('0x47')]=_0x2aa0d2[_0x7503('0x47')][_0x7503('0x48')]?_0x2aa0d2['attributes']:_0x846777[_0x7503('0x43')];_0x2aa0d2['order']=qs[_0x7503('0x4c')](_0x196b74[_0x7503('0x44')]['sort']);_0x2aa0d2[_0x7503('0x50')]=qs[_0x7503('0x4d')](_['pick'](_0x196b74[_0x7503('0x44')],_0x846777[_0x7503('0x4d')]));if(_0x196b74['query'][_0x7503('0x4f')]){_0x2aa0d2[_0x7503('0x50')]=_[_0x7503('0x51')](_0x2aa0d2[_0x7503('0x50')],{'$or':_[_0x7503('0x3d')](_0x2aa0d2[_0x7503('0x47')],function(_0x2511cb){var _0x283692={};_0x283692[_0x2511cb]={'$like':'%'+_0x196b74[_0x7503('0x44')][_0x7503('0x4f')]+'%'};return _0x283692;})});}_0x2aa0d2=_[_0x7503('0x51')]({},_0x2aa0d2,_0x196b74['options']);return _0x1ce189['getTeams'](_0x2aa0d2);}})['then'](function(_0x5c32bf){if(_0x5c32bf){_0xf99c1=_0x5c32bf[_0x7503('0x48')];if(!_0x196b74[_0x7503('0x44')][_0x7503('0x49')](_0x7503('0x4a'))){_0x2aa0d2[_0x7503('0x2d')]=qs[_0x7503('0x2d')](_0x196b74['query'][_0x7503('0x2d')]);_0x2aa0d2[_0x7503('0x2b')]=qs['offset'](_0x196b74[_0x7503('0x44')][_0x7503('0x2b')]);}return _0x1ce189[_0x7503('0x69')](_0x2aa0d2);}})[_0x7503('0x35')](function(_0x1c1bd3){if(_0x1c1bd3){return _0x1c1bd3?{'count':_0xf99c1,'rows':_0x1c1bd3}:null;}})[_0x7503('0x35')](respondWithResult(_0x171155,null))[_0x7503('0x27')](handleError(_0x171155,null));};exports['addTeams']=function(_0x3c8aca,_0xa37bc8,_0x4568a5){var _0x2e3de3=_0x3c8aca[_0x7503('0x58')][_0x7503('0x6b')];return db[_0x7503('0x6a')]['findAll']({'where':{'id':_0x2e3de3},'attributes':['id'],'include':[{'model':db['User'],'as':'Agents','attributes':['id',_0x7503('0x3b'),'online',_0x7503('0x6c'),'interface'],'raw':!![]}]})[_0x7503('0x35')](function(_0xfa03a4){if(_0xfa03a4){var _0x48cdbe=_[_0x7503('0x6d')](_0xfa03a4,function(_0x39658b){var _0x1abd55=_0x39658b[_0x7503('0x37')]({'plain':!![]});return _0x1abd55[_0x7503('0x6e')];});return db['ChatQueue'][_0x7503('0x5b')]({'where':{'id':_0x3c8aca[_0x7503('0x53')]['id']}})[_0x7503('0x35')](function(_0x464444){return db['sequelize']['transaction'](function(_0x266deb){return _0x464444['addTeams'](_0x2e3de3,{'transaction':_0x266deb})[_0x7503('0x35')](function(){return BPromise[_0x7503('0x6f')](_0x48cdbe,function(_0x1ded32){return db[_0x7503('0x5f')][_0x7503('0x70')]({'where':{'UserId':_0x1ded32['id'],'ChatQueueId':_0x3c8aca[_0x7503('0x53')]['id']},'transaction':_0x266deb});});})[_0x7503('0x35')](function(){_0x48cdbe[_0x7503('0x71')](function(_0x37c8ff){socket[_0x7503('0x72')](_0x7503('0x73'),{'UserId':_0x37c8ff['id'],'ChatQueueId':_0x464444['id']});});});});});}})[_0x7503('0x35')](respondWithStatusCode(_0xa37bc8,null))[_0x7503('0x27')](handleError(_0xa37bc8,null));};exports['removeTeams']=function(_0x1111b9,_0x39aedb,_0x444a46){return db[_0x7503('0x6a')]['findAll']({'where':{'id':_0x1111b9[_0x7503('0x44')][_0x7503('0x6b')]},'attributes':['id'],'include':[{'model':db['User'],'as':_0x7503('0x6e'),'attributes':['id'],'raw':!![]}]})['then'](handleEntityNotFound(_0x39aedb,null))[_0x7503('0x35')](function(_0x823c20){var _0x336f20=_[_0x7503('0x3d')](_0x823c20,'id');var _0x5eb737=[];var _0x56eee3=[];var _0x20b01b=squel[_0x7503('0x74')]();_0x20b01b[_0x7503('0x75')](_0x7503('0x76'))['from'](_0x7503('0x77'),'tq')['join']('user_has_teams','ut','ut.TeamId\x20=\x20tq.TeamId')['where']('ChatQueueId\x20=\x20?',_0x1111b9[_0x7503('0x53')]['id']);for(var _0x2f37ad=0x0;_0x2f37ad<_0x823c20[_0x7503('0x48')];_0x2f37ad+=0x1){let _0x20d211=_0x823c20[_0x2f37ad];for(var _0x39e2fd=0x0;_0x39e2fd<_0x20d211['Agents']['length'];_0x39e2fd+=0x1){let _0x354e1c=_0x20d211[_0x7503('0x6e')][_0x39e2fd];var _0x1d6c3c=_0x20b01b['clone']();_0x1d6c3c['where'](_0x7503('0x78'),_0x354e1c['id']);_0x56eee3[_0x7503('0x79')](db[_0x7503('0x7a')]['query'](_0x1d6c3c[_0x7503('0x7b')](),{'type':db[_0x7503('0x7a')][_0x7503('0x7c')][_0x7503('0x7d')]})[_0x7503('0x35')](function(_0x17dc4a){if(_0x17dc4a['length']===0x1){return _0x354e1c['id'];}else{var _0x3f9dd4=_[_0x7503('0x7e')](_[_0x7503('0x3d')](_0x17dc4a,_0x7503('0x7f')),function(_0x1c3c3b){return _[_0x7503('0x80')](_0x336f20,_0x1c3c3b);});if(_0x3f9dd4){return _0x354e1c['id'];}}}));}}return BPromise[_0x7503('0x81')](_0x56eee3)[_0x7503('0x35')](function(_0x35d601){_0x5eb737=_(_0x5eb737)[_0x7503('0x82')](_0x35d601)[_0x7503('0x83')]()[_0x7503('0x84')]();return db[_0x7503('0x3e')][_0x7503('0x5b')]({'where':{'id':_0x1111b9[_0x7503('0x53')]['id']}})[_0x7503('0x35')](function(_0x1bf1b6){return db['sequelize'][_0x7503('0x85')](function(_0x7a34f8){return _0x1bf1b6['removeTeams'](_0x1111b9[_0x7503('0x44')][_0x7503('0x6b')],{'transaction':_0x7a34f8})[_0x7503('0x35')](function(){if(!_[_0x7503('0x86')](_0x5eb737)){return _0x1bf1b6[_0x7503('0x87')](_0x5eb737,{'transaction':_0x7a34f8});}})[_0x7503('0x35')](function(){_0x5eb737[_0x7503('0x71')](function(_0x3f6318){socket[_0x7503('0x72')](_0x7503('0x88'),{'UserId':_0x3f6318,'ChatQueueId':_0x1bf1b6['id']});});});});});});})[_0x7503('0x35')](respondWithStatusCode(_0x39aedb,null))[_0x7503('0x27')](handleError(_0x39aedb,null));};exports[_0x7503('0x89')]=function(_0x522530,_0x5bd8b2,_0x9ac4af){return db['ChatQueue'][_0x7503('0x5b')]({'where':{'id':_0x522530[_0x7503('0x53')]['id']}})['then'](handleEntityNotFound(_0x5bd8b2,null))[_0x7503('0x35')](function(_0x572d7f){if(_0x572d7f){return _0x572d7f['addAgents'](_0x522530[_0x7503('0x58')]['ids'],_['omit'](_0x522530['body'],['ids','id'])||{})['spread'](function(_0x4b7ef5){for(var _0x19abbb=0x0;_0x19abbb<_0x522530[_0x7503('0x58')][_0x7503('0x6b')][_0x7503('0x48')];_0x19abbb+=0x1){socket[_0x7503('0x72')](_0x7503('0x73'),{'UserId':Number(_0x522530[_0x7503('0x58')][_0x7503('0x6b')][_0x19abbb]),'ChatQueueId':Number(_0x522530['params']['id'])});}return _0x4b7ef5;});}})[_0x7503('0x35')](respondWithResult(_0x5bd8b2,null))[_0x7503('0x27')](handleError(_0x5bd8b2,null));};exports[_0x7503('0x87')]=function(_0x4ea58b,_0x21440b,_0x1fb2bc){return db[_0x7503('0x3e')][_0x7503('0x5b')]({'where':{'id':_0x4ea58b[_0x7503('0x53')]['id']}})[_0x7503('0x35')](handleEntityNotFound(_0x21440b,null))[_0x7503('0x35')](function(_0xcf0b){if(_0xcf0b){return _0xcf0b[_0x7503('0x87')](_0x4ea58b[_0x7503('0x44')][_0x7503('0x6b')])[_0x7503('0x35')](function(){if(_[_0x7503('0x8a')](_0x4ea58b[_0x7503('0x44')][_0x7503('0x6b')])){for(var _0x9b33=0x0;_0x9b33<_0x4ea58b[_0x7503('0x44')]['ids'][_0x7503('0x48')];_0x9b33+=0x1){socket[_0x7503('0x72')](_0x7503('0x88'),{'UserId':Number(_0x4ea58b[_0x7503('0x44')][_0x7503('0x6b')][_0x9b33]),'ChatQueueId':Number(_0x4ea58b['params']['id'])});}}else{socket[_0x7503('0x72')](_0x7503('0x88'),{'UserId':Number(_0x4ea58b[_0x7503('0x44')]['ids']),'ChatQueueId':Number(_0x4ea58b[_0x7503('0x53')]['id'])});}});}})[_0x7503('0x35')](respondWithStatusCode(_0x21440b,null))[_0x7503('0x27')](handleError(_0x21440b,null));};exports[_0x7503('0x8b')]=function(_0x197e02,_0x18a66f,_0x2134ba){var _0x12df8b={};var _0x4f788b={};var _0xe668f6;var _0x27d412;return db[_0x7503('0x3e')][_0x7503('0x5e')]({'where':{'id':_0x197e02[_0x7503('0x53')]['id']}})[_0x7503('0x35')](handleEntityNotFound(_0x18a66f,null))['then'](function(_0x34d0b9){if(_0x34d0b9){_0xe668f6=_0x34d0b9;_0x4f788b[_0x7503('0x43')]=_[_0x7503('0x45')](db['User']['rawAttributes']);_0x4f788b['query']=_[_0x7503('0x45')](_0x197e02[_0x7503('0x44')]);_0x4f788b[_0x7503('0x4d')]=_[_0x7503('0x46')](_0x4f788b[_0x7503('0x43')],_0x4f788b[_0x7503('0x44')]);_0x12df8b[_0x7503('0x47')]=_[_0x7503('0x46')](_0x4f788b[_0x7503('0x43')],qs[_0x7503('0x54')](_0x197e02[_0x7503('0x44')][_0x7503('0x54')]));_0x12df8b[_0x7503('0x47')]=_0x12df8b[_0x7503('0x47')]['length']?_0x12df8b[_0x7503('0x47')]:_0x4f788b[_0x7503('0x43')];_0x12df8b[_0x7503('0x4b')]=qs[_0x7503('0x4c')](_0x197e02['query'][_0x7503('0x4c')]);_0x12df8b['where']=qs[_0x7503('0x4d')](_[_0x7503('0x4e')](_0x197e02[_0x7503('0x44')],_0x4f788b[_0x7503('0x4d')]));if(_0x197e02[_0x7503('0x44')][_0x7503('0x4f')]){_0x12df8b[_0x7503('0x50')]=_[_0x7503('0x51')](_0x12df8b[_0x7503('0x50')],{'$or':_[_0x7503('0x3d')](_0x12df8b[_0x7503('0x47')],function(_0x5ba604){var _0x539dc8={};_0x539dc8[_0x5ba604]={'$like':'%'+_0x197e02[_0x7503('0x44')]['filter']+'%'};return _0x539dc8;})});}_0x12df8b=_[_0x7503('0x51')]({},_0x12df8b,_0x197e02[_0x7503('0x52')]);return _0xe668f6[_0x7503('0x8b')](_0x12df8b);}})[_0x7503('0x35')](function(_0x41e5d5){if(_0x41e5d5){_0x27d412=_0x41e5d5[_0x7503('0x48')];if(!_0x197e02[_0x7503('0x44')][_0x7503('0x49')](_0x7503('0x4a'))){_0x12df8b[_0x7503('0x2d')]=qs['limit'](_0x197e02[_0x7503('0x44')][_0x7503('0x2d')]);_0x12df8b[_0x7503('0x2b')]=qs[_0x7503('0x2b')](_0x197e02[_0x7503('0x44')]['offset']);}return _0xe668f6[_0x7503('0x8b')](_0x12df8b);}})[_0x7503('0x35')](function(_0x4bcb5b){if(_0x4bcb5b){return _0x4bcb5b?{'count':_0x27d412,'rows':_0x4bcb5b}:null;}})[_0x7503('0x35')](respondWithResult(_0x18a66f,null))['catch'](handleError(_0x18a66f,null));};
\ No newline at end of file
+var _0xb274=['removeAgents','userChatQueue:remove','addAgents','isArray','getAgents','findOne','eml-format','rimraf','zip-dir','moment','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','squel','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','redis','localhost','socket.io-emitter','./chatQueue.socket','register','jayson/promise','client','http','request','then','info','ChatQueue,\x20%s,\x20%s','request\x20sent','debug','ChatQueue,\x20%s,\x20%s,\x20%s','code','error','message','result','catch','sendStatus','status','undefined','limit','count','offset','set','Content-Range','json','apply','update','destroy','ChatQueues','UserProfileResource','name','index','ChatQueue','rawAttributes','type','key','model','keys','query','filters','intersection','fields','attributes','hasOwnProperty','nolimit','order','sort','pick','filter','merge','where','map','options','includeAll','include','findAll','rows','show','params','length','create','body','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','find','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','describe','getMembers','UserChatQueue','ChatQueueId','findAndCountAll','agent','chatPause','updatedAt','createdAt','%s/%s','SIP','Team','getTeams','addTeams','ids','User','online','voicePause','interface','Agents','sequelize','transaction','each','findOrCreate','forEach','emit','userChatQueue:save','select','field','tq.TeamId','team_has_chat_queues','join','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','ChatQueueId\x20=\x20?','clone','ut.UserId\x20=\x20?','push','QueryTypes','SELECT','every','TeamId','all','union','compact','value','removeTeams','isEmpty'];(function(_0x777641,_0x19607d){var _0x54a378=function(_0x501b92){while(--_0x501b92){_0x777641['push'](_0x777641['shift']());}};_0x54a378(++_0x19607d);}(_0xb274,0x9d));var _0x4b27=function(_0x145eae,_0x2fc6a5){_0x145eae=_0x145eae-0x0;var _0x4c6a1f=_0xb274[_0x145eae];return _0x4c6a1f;};'use strict';var emlformat=require(_0x4b27('0x0'));var rimraf=require(_0x4b27('0x1'));var zipdir=require(_0x4b27('0x2'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x4b27('0x3'));var BPromise=require(_0x4b27('0x4'));var Mustache=require(_0x4b27('0x5'));var util=require(_0x4b27('0x6'));var path=require(_0x4b27('0x7'));var sox=require(_0x4b27('0x8'));var csv=require(_0x4b27('0x9'));var ejs=require(_0x4b27('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x4b27('0xb'));var squel=require(_0x4b27('0xc'));var crypto=require('crypto');var jsforce=require(_0x4b27('0xd'));var deskjs=require(_0x4b27('0xe'));var toCsv=require('to-csv');var querystring=require(_0x4b27('0xf'));var Papa=require('papaparse');var Redis=require(_0x4b27('0x10'));var authService=require(_0x4b27('0x11'));var qs=require(_0x4b27('0x12'));var as=require(_0x4b27('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x4b27('0x14'))(_0x4b27('0x15'));var utils=require(_0x4b27('0x16'));var config=require(_0x4b27('0x17'));var licenseUtil=require(_0x4b27('0x18'));var db=require('../../mysqldb')['db'];config[_0x4b27('0x19')]=_['defaults'](config[_0x4b27('0x19')],{'host':_0x4b27('0x1a'),'port':0x18eb});var socket=require(_0x4b27('0x1b'))(new Redis(config['redis']));require(_0x4b27('0x1c'))[_0x4b27('0x1d')](socket);var jayson=require(_0x4b27('0x1e'));var client=jayson[_0x4b27('0x1f')][_0x4b27('0x20')]({'port':0x232a});function respondWithRpcPromise(_0x79d848,_0x552c38,_0x19d309,_0x3dc444){return new BPromise(function(_0x45ad67,_0x4a70ef){var _0x2e4fb1=_0x3dc444||client;return _0x2e4fb1[_0x4b27('0x21')](_0x79d848,_0x19d309)[_0x4b27('0x22')](function(_0x510757){logger[_0x4b27('0x23')](_0x4b27('0x24'),_0x552c38,_0x4b27('0x25'));logger[_0x4b27('0x26')](_0x4b27('0x27'),_0x552c38,_0x4b27('0x25'),JSON['stringify'](_0x510757));if(_0x510757['error']){if(_0x510757['error'][_0x4b27('0x28')]===0x1f4){logger['error'](_0x4b27('0x24'),_0x552c38,_0x510757[_0x4b27('0x29')]['message']);return _0x4a70ef(_0x510757['error']['message']);}logger[_0x4b27('0x29')](_0x4b27('0x24'),_0x552c38,_0x510757[_0x4b27('0x29')][_0x4b27('0x2a')]);return _0x45ad67(_0x510757[_0x4b27('0x29')][_0x4b27('0x2a')]);}else{logger[_0x4b27('0x23')](_0x4b27('0x24'),_0x552c38,'request\x20sent');_0x45ad67(_0x510757[_0x4b27('0x2b')][_0x4b27('0x2a')]);}})[_0x4b27('0x2c')](function(_0x388198){logger[_0x4b27('0x29')](_0x4b27('0x24'),_0x552c38,_0x388198);_0x4a70ef(_0x388198);});});}function respondWithStatusCode(_0x48edfe,_0x4dfb41){_0x4dfb41=_0x4dfb41||0xcc;return function(_0x2ee56d){if(_0x2ee56d){return _0x48edfe[_0x4b27('0x2d')](_0x4dfb41);}return _0x48edfe[_0x4b27('0x2e')](_0x4dfb41)['end']();};}function respondWithResult(_0x4e6cf1,_0x7ab4e2){_0x7ab4e2=_0x7ab4e2||0xc8;return function(_0x584528){if(_0x584528){return _0x4e6cf1[_0x4b27('0x2e')](_0x7ab4e2)['json'](_0x584528);}};}function respondWithFilteredResult(_0x3088e4,_0x1cf07d){return function(_0x1f490e){if(_0x1f490e){var _0x4af30b=typeof _0x1cf07d['offset']===_0x4b27('0x2f')&&typeof _0x1cf07d[_0x4b27('0x30')]===_0x4b27('0x2f');var _0x19de47=_0x1f490e[_0x4b27('0x31')];var _0x4591b9=_0x4af30b?0x0:_0x1cf07d[_0x4b27('0x32')];var _0x1612d1=_0x4af30b?_0x1f490e[_0x4b27('0x31')]:_0x1cf07d[_0x4b27('0x32')]+_0x1cf07d[_0x4b27('0x30')];var _0x5e5b4d;if(_0x1612d1>=_0x19de47){_0x1612d1=_0x19de47;_0x5e5b4d=0xc8;}else{_0x5e5b4d=0xce;}_0x3088e4[_0x4b27('0x2e')](_0x5e5b4d);return _0x3088e4[_0x4b27('0x33')](_0x4b27('0x34'),_0x4591b9+'-'+_0x1612d1+'/'+_0x19de47)[_0x4b27('0x35')](_0x1f490e);}return null;};}function patchUpdates(_0x275011){return function(_0x2e4214){try{jsonpatch[_0x4b27('0x36')](_0x2e4214,_0x275011,!![]);}catch(_0x177cb4){return BPromise['reject'](_0x177cb4);}return _0x2e4214['save']();};}function saveUpdates(_0x4a13b0,_0x5c9f4f){return function(_0x1a707c){if(_0x1a707c){return _0x1a707c[_0x4b27('0x37')](_0x4a13b0)[_0x4b27('0x22')](function(_0x4f8d74){return _0x4f8d74;});}return null;};}function removeEntity(_0x364462,_0x3f98e4){return function(_0x130481){if(_0x130481){return _0x130481[_0x4b27('0x38')]()[_0x4b27('0x22')](function(){var _0x4752c4=_0x130481['get']({'plain':!![]});var _0x50d757=_0x4b27('0x39');return db[_0x4b27('0x3a')][_0x4b27('0x38')]({'where':{'type':_0x50d757,'resourceId':_0x4752c4['id']}})['then'](function(){return _0x130481;});})['then'](function(){_0x364462[_0x4b27('0x2e')](0xcc)['end']();});}};}function handleEntityNotFound(_0x91e4ed,_0x2b01ec){return function(_0x40df82){if(!_0x40df82){_0x91e4ed[_0x4b27('0x2d')](0x194);}return _0x40df82;};}function handleError(_0xe2c7d0,_0x21434f){_0x21434f=_0x21434f||0x1f4;return function(_0x27d8c7){logger[_0x4b27('0x29')](_0x27d8c7['stack']);if(_0x27d8c7[_0x4b27('0x3b')]){delete _0x27d8c7[_0x4b27('0x3b')];}_0xe2c7d0[_0x4b27('0x2e')](_0x21434f)['send'](_0x27d8c7);};}exports[_0x4b27('0x3c')]=function(_0x2c9ead,_0x584e3f){var _0xf5a218={},_0x4f4307={},_0x416e50={'count':0x0,'rows':[]};var _0x361e43=_['map'](db[_0x4b27('0x3d')][_0x4b27('0x3e')],function(_0x266a45){return{'name':_0x266a45['fieldName'],'type':_0x266a45[_0x4b27('0x3f')][_0x4b27('0x40')]};});_0x4f4307[_0x4b27('0x41')]=_['map'](_0x361e43,'name');_0x4f4307['query']=_[_0x4b27('0x42')](_0x2c9ead[_0x4b27('0x43')]);_0x4f4307[_0x4b27('0x44')]=_[_0x4b27('0x45')](_0x4f4307[_0x4b27('0x41')],_0x4f4307[_0x4b27('0x43')]);_0xf5a218['attributes']=_[_0x4b27('0x45')](_0x4f4307[_0x4b27('0x41')],qs[_0x4b27('0x46')](_0x2c9ead['query'][_0x4b27('0x46')]));_0xf5a218['attributes']=_0xf5a218[_0x4b27('0x47')]['length']?_0xf5a218['attributes']:_0x4f4307[_0x4b27('0x41')];if(!_0x2c9ead[_0x4b27('0x43')][_0x4b27('0x48')](_0x4b27('0x49'))){_0xf5a218[_0x4b27('0x30')]=qs['limit'](_0x2c9ead[_0x4b27('0x43')][_0x4b27('0x30')]);_0xf5a218[_0x4b27('0x32')]=qs[_0x4b27('0x32')](_0x2c9ead['query'][_0x4b27('0x32')]);}_0xf5a218[_0x4b27('0x4a')]=qs[_0x4b27('0x4b')](_0x2c9ead[_0x4b27('0x43')]['sort']);_0xf5a218['where']=qs[_0x4b27('0x44')](_[_0x4b27('0x4c')](_0x2c9ead[_0x4b27('0x43')],_0x4f4307[_0x4b27('0x44')]),_0x361e43);if(_0x2c9ead['query'][_0x4b27('0x4d')]){_0xf5a218['where']=_[_0x4b27('0x4e')](_0xf5a218[_0x4b27('0x4f')],{'$or':_[_0x4b27('0x50')](_0x361e43,function(_0xb9ef8b){if(_0xb9ef8b[_0x4b27('0x3f')]!=='VIRTUAL'){var _0x564fed={};_0x564fed[_0xb9ef8b[_0x4b27('0x3b')]]={'$like':'%'+_0x2c9ead[_0x4b27('0x43')][_0x4b27('0x4d')]+'%'};return _0x564fed;}})});}_0xf5a218=_[_0x4b27('0x4e')]({},_0xf5a218,_0x2c9ead[_0x4b27('0x51')]);var _0x2175b3={'where':_0xf5a218[_0x4b27('0x4f')]};return db[_0x4b27('0x3d')]['count'](_0x2175b3)[_0x4b27('0x22')](function(_0x355f6a){_0x416e50[_0x4b27('0x31')]=_0x355f6a;if(_0x2c9ead[_0x4b27('0x43')][_0x4b27('0x52')]){_0xf5a218[_0x4b27('0x53')]=[{'all':!![]}];}return db[_0x4b27('0x3d')][_0x4b27('0x54')](_0xf5a218);})['then'](function(_0x1cde07){_0x416e50[_0x4b27('0x55')]=_0x1cde07;return _0x416e50;})['then'](respondWithFilteredResult(_0x584e3f,_0xf5a218))[_0x4b27('0x2c')](handleError(_0x584e3f,null));};exports[_0x4b27('0x56')]=function(_0x50ef43,_0x3eb9a1){var _0x51f4af={'raw':!![],'where':{'id':_0x50ef43[_0x4b27('0x57')]['id']}},_0x2d135c={};_0x2d135c['model']=_['keys'](db[_0x4b27('0x3d')][_0x4b27('0x3e')]);_0x2d135c[_0x4b27('0x43')]=_['keys'](_0x50ef43[_0x4b27('0x43')]);_0x2d135c[_0x4b27('0x44')]=_[_0x4b27('0x45')](_0x2d135c[_0x4b27('0x41')],_0x2d135c[_0x4b27('0x43')]);_0x51f4af[_0x4b27('0x47')]=_['intersection'](_0x2d135c[_0x4b27('0x41')],qs[_0x4b27('0x46')](_0x50ef43[_0x4b27('0x43')][_0x4b27('0x46')]));_0x51f4af['attributes']=_0x51f4af[_0x4b27('0x47')][_0x4b27('0x58')]?_0x51f4af[_0x4b27('0x47')]:_0x2d135c[_0x4b27('0x41')];if(_0x50ef43[_0x4b27('0x43')][_0x4b27('0x52')]){_0x51f4af[_0x4b27('0x53')]=[{'all':!![]}];}_0x51f4af=_['merge']({},_0x51f4af,_0x50ef43[_0x4b27('0x51')]);return db[_0x4b27('0x3d')]['find'](_0x51f4af)[_0x4b27('0x22')](handleEntityNotFound(_0x3eb9a1,null))[_0x4b27('0x22')](respondWithResult(_0x3eb9a1,null))[_0x4b27('0x2c')](handleError(_0x3eb9a1,null));};exports['create']=function(_0x3a5f3d,_0xfc4c2c){return db['ChatQueue'][_0x4b27('0x59')](_0x3a5f3d[_0x4b27('0x5a')],{})[_0x4b27('0x22')](function(_0x4b53aa){var _0x5b9674=_0x3a5f3d[_0x4b27('0x5b')][_0x4b27('0x5c')]({'plain':!![]});if(!_0x5b9674)throw new Error(_0x4b27('0x5d'));if(_0x5b9674['role']==='user'){var _0x369751=_0x4b53aa[_0x4b27('0x5c')]({'plain':!![]});var _0x6151a9=_0x4b27('0x39');return db[_0x4b27('0x5e')][_0x4b27('0x5f')]({'where':{'name':_0x6151a9,'userProfileId':_0x5b9674['userProfileId']},'raw':!![]})['then'](function(_0x5dd3b4){if(_0x5dd3b4&&_0x5dd3b4['autoAssociation']===0x0){return db[_0x4b27('0x3a')]['create']({'name':_0x369751['name'],'resourceId':_0x369751['id'],'type':_0x5dd3b4['name'],'sectionId':_0x5dd3b4['id']},{})[_0x4b27('0x22')](function(){return _0x4b53aa;});}else{return _0x4b53aa;}})[_0x4b27('0x2c')](function(_0x2351e4){logger['error'](_0x4b27('0x60'),_0x2351e4);throw _0x2351e4;});}return _0x4b53aa;})[_0x4b27('0x22')](respondWithResult(_0xfc4c2c,0xc9))[_0x4b27('0x2c')](handleError(_0xfc4c2c,null));};exports[_0x4b27('0x37')]=function(_0x485fb7,_0x3544da){if(_0x485fb7[_0x4b27('0x5a')]['id']){delete _0x485fb7[_0x4b27('0x5a')]['id'];}return db[_0x4b27('0x3d')][_0x4b27('0x5f')]({'where':{'id':_0x485fb7[_0x4b27('0x57')]['id']}})['then'](handleEntityNotFound(_0x3544da,null))[_0x4b27('0x22')](saveUpdates(_0x485fb7[_0x4b27('0x5a')],null))[_0x4b27('0x22')](respondWithResult(_0x3544da,null))[_0x4b27('0x2c')](handleError(_0x3544da,null));};exports[_0x4b27('0x38')]=function(_0x14822e,_0x48ee48){return db[_0x4b27('0x3d')][_0x4b27('0x5f')]({'where':{'id':_0x14822e['params']['id']}})[_0x4b27('0x22')](handleEntityNotFound(_0x48ee48,null))[_0x4b27('0x22')](removeEntity(_0x48ee48,null))['catch'](handleError(_0x48ee48,null));};exports[_0x4b27('0x61')]=function(_0x34201d,_0x2a5edc){return db[_0x4b27('0x3d')][_0x4b27('0x61')]()[_0x4b27('0x22')](respondWithResult(_0x2a5edc,null))[_0x4b27('0x2c')](handleError(_0x2a5edc,null));};exports[_0x4b27('0x62')]=function(_0x5e4e32,_0x5f123e,_0x51a22f){var _0x275028={'raw':!![],'where':{}},_0x6d2edd={},_0x4f9c2a;return db[_0x4b27('0x3d')]['findOne']({'where':{'id':_0x5e4e32[_0x4b27('0x57')]['id']}})[_0x4b27('0x22')](handleEntityNotFound(_0x5f123e,null))['then'](function(_0x36c3a1){if(_0x36c3a1){_0x4f9c2a=_0x36c3a1[_0x4b27('0x5c')]({'plain':!![]});_0x6d2edd[_0x4b27('0x41')]=_[_0x4b27('0x42')](db[_0x4b27('0x63')][_0x4b27('0x3e')]);_0x6d2edd[_0x4b27('0x43')]=_[_0x4b27('0x42')](_0x5e4e32[_0x4b27('0x43')]);_0x6d2edd[_0x4b27('0x44')]=_[_0x4b27('0x45')](_0x6d2edd[_0x4b27('0x41')],_0x6d2edd[_0x4b27('0x43')]);_0x275028[_0x4b27('0x47')]=_[_0x4b27('0x45')](_0x6d2edd[_0x4b27('0x41')],qs[_0x4b27('0x46')](_0x5e4e32[_0x4b27('0x43')]['fields']));_0x275028[_0x4b27('0x47')]=_0x275028[_0x4b27('0x47')]['length']?_0x275028[_0x4b27('0x47')]:_0x6d2edd[_0x4b27('0x41')];if(!_0x5e4e32[_0x4b27('0x43')][_0x4b27('0x48')](_0x4b27('0x49'))){_0x275028[_0x4b27('0x30')]=qs[_0x4b27('0x30')](_0x5e4e32[_0x4b27('0x43')][_0x4b27('0x30')]);_0x275028[_0x4b27('0x32')]=qs[_0x4b27('0x32')](_0x5e4e32[_0x4b27('0x43')][_0x4b27('0x32')]);}_0x275028[_0x4b27('0x4a')]=qs[_0x4b27('0x4b')](_0x5e4e32[_0x4b27('0x43')][_0x4b27('0x4b')]);_0x275028[_0x4b27('0x4f')]=qs['filters'](_[_0x4b27('0x4c')](_0x5e4e32[_0x4b27('0x43')],_0x6d2edd[_0x4b27('0x44')]));_0x275028['where'][_0x4b27('0x64')]=_0x36c3a1['id'];if(_0x5e4e32[_0x4b27('0x43')][_0x4b27('0x4d')]){_0x275028[_0x4b27('0x4f')]=_[_0x4b27('0x4e')](_0x275028['where'],{'$or':_[_0x4b27('0x50')](_0x275028[_0x4b27('0x47')],function(_0x25372c){var _0x1855dd={};_0x1855dd[_0x25372c]={'$like':'%'+_0x5e4e32[_0x4b27('0x43')][_0x4b27('0x4d')]+'%'};return _0x1855dd;})});}_0x275028=_['merge']({},_0x275028,_0x5e4e32[_0x4b27('0x51')]);return db['UserChatQueue'][_0x4b27('0x54')](_0x275028);}})[_0x4b27('0x22')](function(_0x47a4df){if(_0x47a4df){return db['User'][_0x4b27('0x65')]({'where':{'id':_['map'](_0x47a4df,'UserId'),'role':_0x4b27('0x66')},'attributes':['id',_0x4b27('0x3b'),_0x4b27('0x67'),_0x4b27('0x68'),_0x4b27('0x69')]});}})[_0x4b27('0x22')](function(_0x477b2f){if(_0x477b2f){return{'count':_0x477b2f[_0x4b27('0x31')],'rows':_[_0x4b27('0x50')](_0x477b2f[_0x4b27('0x55')],function(_0xa7277c){return{'membername':_0xa7277c[_0x4b27('0x3b')],'UserId':_0xa7277c['id'],'queue_name':_0x4f9c2a['name'],'ChatQueueId':_0x4f9c2a['id'],'interface':util['format'](_0x4b27('0x6a'),_0x4b27('0x6b'),_0xa7277c[_0x4b27('0x3b')]),'penalty':0x0,'paused':_0xa7277c['chatPause'],'createdAt':_0xa7277c[_0x4b27('0x69')],'updatedAt':_0xa7277c[_0x4b27('0x68')]};})};}else{return{'count':0x0,'rows':[]};}})[_0x4b27('0x22')](respondWithFilteredResult(_0x5f123e,_0x275028))[_0x4b27('0x2c')](handleError(_0x5f123e,null));};exports['getTeams']=function(_0xa57146,_0x535c86,_0x597566){var _0x1cfa24={};var _0x18d340={};var _0x26ad0d;var _0x3b1542;return db[_0x4b27('0x3d')]['findOne']({'where':{'id':_0xa57146[_0x4b27('0x57')]['id']}})[_0x4b27('0x22')](handleEntityNotFound(_0x535c86,null))[_0x4b27('0x22')](function(_0x10c088){if(_0x10c088){_0x26ad0d=_0x10c088;_0x18d340[_0x4b27('0x41')]=_[_0x4b27('0x42')](db[_0x4b27('0x6c')][_0x4b27('0x3e')]);_0x18d340['query']=_[_0x4b27('0x42')](_0xa57146[_0x4b27('0x43')]);_0x18d340['filters']=_['intersection'](_0x18d340['model'],_0x18d340[_0x4b27('0x43')]);_0x1cfa24['attributes']=_[_0x4b27('0x45')](_0x18d340['model'],qs['fields'](_0xa57146[_0x4b27('0x43')][_0x4b27('0x46')]));_0x1cfa24['attributes']=_0x1cfa24['attributes'][_0x4b27('0x58')]?_0x1cfa24['attributes']:_0x18d340[_0x4b27('0x41')];_0x1cfa24['order']=qs[_0x4b27('0x4b')](_0xa57146[_0x4b27('0x43')][_0x4b27('0x4b')]);_0x1cfa24[_0x4b27('0x4f')]=qs[_0x4b27('0x44')](_['pick'](_0xa57146['query'],_0x18d340[_0x4b27('0x44')]));if(_0xa57146[_0x4b27('0x43')][_0x4b27('0x4d')]){_0x1cfa24['where']=_['merge'](_0x1cfa24['where'],{'$or':_[_0x4b27('0x50')](_0x1cfa24['attributes'],function(_0x116ef8){var _0x8e9080={};_0x8e9080[_0x116ef8]={'$like':'%'+_0xa57146[_0x4b27('0x43')][_0x4b27('0x4d')]+'%'};return _0x8e9080;})});}_0x1cfa24=_[_0x4b27('0x4e')]({},_0x1cfa24,_0xa57146[_0x4b27('0x51')]);return _0x26ad0d[_0x4b27('0x6d')](_0x1cfa24);}})[_0x4b27('0x22')](function(_0x19ff02){if(_0x19ff02){_0x3b1542=_0x19ff02[_0x4b27('0x58')];if(!_0xa57146[_0x4b27('0x43')][_0x4b27('0x48')](_0x4b27('0x49'))){_0x1cfa24[_0x4b27('0x30')]=qs[_0x4b27('0x30')](_0xa57146[_0x4b27('0x43')][_0x4b27('0x30')]);_0x1cfa24[_0x4b27('0x32')]=qs['offset'](_0xa57146[_0x4b27('0x43')][_0x4b27('0x32')]);}return _0x26ad0d[_0x4b27('0x6d')](_0x1cfa24);}})['then'](function(_0x26afa2){if(_0x26afa2){return _0x26afa2?{'count':_0x3b1542,'rows':_0x26afa2}:null;}})[_0x4b27('0x22')](respondWithResult(_0x535c86,null))['catch'](handleError(_0x535c86,null));};exports[_0x4b27('0x6e')]=function(_0x2850d4,_0x114330,_0xadad31){var _0x3b94d9=_0x2850d4['body'][_0x4b27('0x6f')];return db[_0x4b27('0x6c')][_0x4b27('0x54')]({'where':{'id':_0x3b94d9},'attributes':['id'],'include':[{'model':db[_0x4b27('0x70')],'as':'Agents','attributes':['id','name',_0x4b27('0x71'),_0x4b27('0x72'),_0x4b27('0x73')],'raw':!![]}]})[_0x4b27('0x22')](function(_0x5275d3){if(_0x5275d3){var _0x51c1d1=_['flatMap'](_0x5275d3,function(_0xcda109){var _0x189c31=_0xcda109[_0x4b27('0x5c')]({'plain':!![]});return _0x189c31[_0x4b27('0x74')];});return db[_0x4b27('0x3d')]['find']({'where':{'id':_0x2850d4['params']['id']}})[_0x4b27('0x22')](function(_0x337124){return db[_0x4b27('0x75')][_0x4b27('0x76')](function(_0xfb0142){return _0x337124[_0x4b27('0x6e')](_0x3b94d9,{'transaction':_0xfb0142})[_0x4b27('0x22')](function(){return BPromise[_0x4b27('0x77')](_0x51c1d1,function(_0x326521){return db[_0x4b27('0x63')][_0x4b27('0x78')]({'where':{'UserId':_0x326521['id'],'ChatQueueId':_0x2850d4[_0x4b27('0x57')]['id']},'transaction':_0xfb0142});});})[_0x4b27('0x22')](function(){_0x51c1d1[_0x4b27('0x79')](function(_0x4e2835){socket[_0x4b27('0x7a')](_0x4b27('0x7b'),{'UserId':_0x4e2835['id'],'ChatQueueId':_0x337124['id']});});});});});}})[_0x4b27('0x22')](respondWithStatusCode(_0x114330,null))[_0x4b27('0x2c')](handleError(_0x114330,null));};exports['removeTeams']=function(_0x409d55,_0x38d382,_0x1415e7){return db[_0x4b27('0x6c')][_0x4b27('0x54')]({'where':{'id':_0x409d55[_0x4b27('0x43')]['ids']},'attributes':['id'],'include':[{'model':db['User'],'as':_0x4b27('0x74'),'attributes':['id'],'raw':!![]}]})[_0x4b27('0x22')](handleEntityNotFound(_0x38d382,null))['then'](function(_0x2db0a7){var _0x3cbde5=_[_0x4b27('0x50')](_0x2db0a7,'id');var _0x104bb1=[];var _0xbf144e=[];var _0x5268a5=squel[_0x4b27('0x7c')]();_0x5268a5[_0x4b27('0x7d')](_0x4b27('0x7e'))['from'](_0x4b27('0x7f'),'tq')[_0x4b27('0x80')](_0x4b27('0x81'),'ut',_0x4b27('0x82'))[_0x4b27('0x4f')](_0x4b27('0x83'),_0x409d55[_0x4b27('0x57')]['id']);for(var _0x441ec6=0x0;_0x441ec6<_0x2db0a7['length'];_0x441ec6+=0x1){let _0x1e11d0=_0x2db0a7[_0x441ec6];for(var _0x522bbf=0x0;_0x522bbf<_0x1e11d0[_0x4b27('0x74')][_0x4b27('0x58')];_0x522bbf+=0x1){let _0x38c820=_0x1e11d0[_0x4b27('0x74')][_0x522bbf];var _0x21deb6=_0x5268a5[_0x4b27('0x84')]();_0x21deb6[_0x4b27('0x4f')](_0x4b27('0x85'),_0x38c820['id']);_0xbf144e[_0x4b27('0x86')](db['sequelize'][_0x4b27('0x43')](_0x21deb6['toString'](),{'type':db['sequelize'][_0x4b27('0x87')][_0x4b27('0x88')]})[_0x4b27('0x22')](function(_0x4fa7ee){if(_0x4fa7ee[_0x4b27('0x58')]===0x1){return _0x38c820['id'];}else{var _0x1eceff=_[_0x4b27('0x89')](_[_0x4b27('0x50')](_0x4fa7ee,_0x4b27('0x8a')),function(_0x980f5b){return _['includes'](_0x3cbde5,_0x980f5b);});if(_0x1eceff){return _0x38c820['id'];}}}));}}return BPromise[_0x4b27('0x8b')](_0xbf144e)['then'](function(_0x59c13){_0x104bb1=_(_0x104bb1)[_0x4b27('0x8c')](_0x59c13)[_0x4b27('0x8d')]()[_0x4b27('0x8e')]();return db[_0x4b27('0x3d')][_0x4b27('0x5f')]({'where':{'id':_0x409d55[_0x4b27('0x57')]['id']}})[_0x4b27('0x22')](function(_0x2cddde){return db['sequelize']['transaction'](function(_0x22e8db){return _0x2cddde[_0x4b27('0x8f')](_0x409d55[_0x4b27('0x43')]['ids'],{'transaction':_0x22e8db})[_0x4b27('0x22')](function(){if(!_[_0x4b27('0x90')](_0x104bb1)){return _0x2cddde[_0x4b27('0x91')](_0x104bb1,{'transaction':_0x22e8db});}})[_0x4b27('0x22')](function(){_0x104bb1[_0x4b27('0x79')](function(_0x417b95){socket[_0x4b27('0x7a')](_0x4b27('0x92'),{'UserId':_0x417b95,'ChatQueueId':_0x2cddde['id']});});});});});});})['then'](respondWithStatusCode(_0x38d382,null))['catch'](handleError(_0x38d382,null));};exports[_0x4b27('0x93')]=function(_0x109b2e,_0x19830c,_0x3b0885){return db[_0x4b27('0x3d')][_0x4b27('0x5f')]({'where':{'id':_0x109b2e[_0x4b27('0x57')]['id']}})[_0x4b27('0x22')](handleEntityNotFound(_0x19830c,null))[_0x4b27('0x22')](function(_0xbdca09){if(_0xbdca09){return _0xbdca09[_0x4b27('0x93')](_0x109b2e[_0x4b27('0x5a')][_0x4b27('0x6f')],_['omit'](_0x109b2e[_0x4b27('0x5a')],[_0x4b27('0x6f'),'id'])||{})['spread'](function(_0x3509b7){for(var _0x5d1785=0x0;_0x5d1785<_0x109b2e['body'][_0x4b27('0x6f')][_0x4b27('0x58')];_0x5d1785+=0x1){socket[_0x4b27('0x7a')](_0x4b27('0x7b'),{'UserId':Number(_0x109b2e[_0x4b27('0x5a')][_0x4b27('0x6f')][_0x5d1785]),'ChatQueueId':Number(_0x109b2e[_0x4b27('0x57')]['id'])});}return _0x3509b7;});}})[_0x4b27('0x22')](respondWithResult(_0x19830c,null))['catch'](handleError(_0x19830c,null));};exports['removeAgents']=function(_0x1500af,_0x1412f3,_0x16e3bc){return db['ChatQueue'][_0x4b27('0x5f')]({'where':{'id':_0x1500af['params']['id']}})[_0x4b27('0x22')](handleEntityNotFound(_0x1412f3,null))['then'](function(_0x18e66f){if(_0x18e66f){return _0x18e66f['removeAgents'](_0x1500af[_0x4b27('0x43')]['ids'])[_0x4b27('0x22')](function(){if(_[_0x4b27('0x94')](_0x1500af[_0x4b27('0x43')][_0x4b27('0x6f')])){for(var _0xbb39be=0x0;_0xbb39be<_0x1500af['query'][_0x4b27('0x6f')][_0x4b27('0x58')];_0xbb39be+=0x1){socket['emit'](_0x4b27('0x92'),{'UserId':Number(_0x1500af[_0x4b27('0x43')][_0x4b27('0x6f')][_0xbb39be]),'ChatQueueId':Number(_0x1500af[_0x4b27('0x57')]['id'])});}}else{socket['emit'](_0x4b27('0x92'),{'UserId':Number(_0x1500af['query'][_0x4b27('0x6f')]),'ChatQueueId':Number(_0x1500af['params']['id'])});}});}})['then'](respondWithStatusCode(_0x1412f3,null))[_0x4b27('0x2c')](handleError(_0x1412f3,null));};exports[_0x4b27('0x95')]=function(_0x73f345,_0x53894a,_0x286ed1){var _0x3873bc={};var _0x49482d={};var _0x3aeb38;var _0x56b338;return db['ChatQueue'][_0x4b27('0x96')]({'where':{'id':_0x73f345[_0x4b27('0x57')]['id']}})[_0x4b27('0x22')](handleEntityNotFound(_0x53894a,null))[_0x4b27('0x22')](function(_0x5bba2a){if(_0x5bba2a){_0x3aeb38=_0x5bba2a;_0x49482d[_0x4b27('0x41')]=_['keys'](db['User']['rawAttributes']);_0x49482d[_0x4b27('0x43')]=_[_0x4b27('0x42')](_0x73f345['query']);_0x49482d[_0x4b27('0x44')]=_[_0x4b27('0x45')](_0x49482d[_0x4b27('0x41')],_0x49482d[_0x4b27('0x43')]);_0x3873bc[_0x4b27('0x47')]=_[_0x4b27('0x45')](_0x49482d[_0x4b27('0x41')],qs[_0x4b27('0x46')](_0x73f345[_0x4b27('0x43')]['fields']));_0x3873bc[_0x4b27('0x47')]=_0x3873bc[_0x4b27('0x47')][_0x4b27('0x58')]?_0x3873bc[_0x4b27('0x47')]:_0x49482d[_0x4b27('0x41')];_0x3873bc['order']=qs[_0x4b27('0x4b')](_0x73f345[_0x4b27('0x43')]['sort']);_0x3873bc[_0x4b27('0x4f')]=qs[_0x4b27('0x44')](_['pick'](_0x73f345[_0x4b27('0x43')],_0x49482d[_0x4b27('0x44')]));if(_0x73f345[_0x4b27('0x43')][_0x4b27('0x4d')]){_0x3873bc[_0x4b27('0x4f')]=_[_0x4b27('0x4e')](_0x3873bc['where'],{'$or':_['map'](_0x3873bc[_0x4b27('0x47')],function(_0x59b317){var _0x5b8aef={};_0x5b8aef[_0x59b317]={'$like':'%'+_0x73f345[_0x4b27('0x43')]['filter']+'%'};return _0x5b8aef;})});}_0x3873bc=_[_0x4b27('0x4e')]({},_0x3873bc,_0x73f345['options']);return _0x3aeb38[_0x4b27('0x95')](_0x3873bc);}})[_0x4b27('0x22')](function(_0xa6dbaf){if(_0xa6dbaf){_0x56b338=_0xa6dbaf[_0x4b27('0x58')];if(!_0x73f345[_0x4b27('0x43')][_0x4b27('0x48')](_0x4b27('0x49'))){_0x3873bc['limit']=qs['limit'](_0x73f345[_0x4b27('0x43')]['limit']);_0x3873bc['offset']=qs[_0x4b27('0x32')](_0x73f345[_0x4b27('0x43')][_0x4b27('0x32')]);}return _0x3aeb38['getAgents'](_0x3873bc);}})['then'](function(_0x2c2ac5){if(_0x2c2ac5){return _0x2c2ac5?{'count':_0x56b338,'rows':_0x2c2ac5}:null;}})[_0x4b27('0x22')](respondWithResult(_0x53894a,null))[_0x4b27('0x2c')](handleError(_0x53894a,null));};
\ No newline at end of file
diff --git a/server/api/chatQueue/chatQueue.events.js b/server/api/chatQueue/chatQueue.events.js
index 1a9418a..27c57b5 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 _0xeca7=['hook','exports','events','../../mysqldb','ChatQueue','save','update','emit'];(function(_0x39d89b,_0x413243){var _0x477b21=function(_0x5ea8bf){while(--_0x5ea8bf){_0x39d89b['push'](_0x39d89b['shift']());}};_0x477b21(++_0x413243);}(_0xeca7,0xba));var _0x7eca=function(_0x45bfbc,_0x1ff15e){_0x45bfbc=_0x45bfbc-0x0;var _0x407018=_0xeca7[_0x45bfbc];return _0x407018;};'use strict';var EventEmitter=require(_0x7eca('0x0'));var ChatQueue=require(_0x7eca('0x1'))['db'][_0x7eca('0x2')];var ChatQueueEvents=new EventEmitter();ChatQueueEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x7eca('0x3'),'afterUpdate':_0x7eca('0x4'),'afterDestroy':'remove'};function emitEvent(_0x2b5721){return function(_0x52a1bc,_0x519867,_0x29cb7b){ChatQueueEvents[_0x7eca('0x5')](_0x2b5721+':'+_0x52a1bc['id'],_0x52a1bc);ChatQueueEvents[_0x7eca('0x5')](_0x2b5721,_0x52a1bc);_0x29cb7b(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];ChatQueue[_0x7eca('0x6')](e,emitEvent(event));}}module[_0x7eca('0x7')]=ChatQueueEvents;
\ No newline at end of file
+var _0xc716=['emit','hasOwnProperty','hook','exports','events','ChatQueue','setMaxListeners','save','update','remove'];(function(_0x54dd4a,_0x597472){var _0x1edeb6=function(_0xd7664a){while(--_0xd7664a){_0x54dd4a['push'](_0x54dd4a['shift']());}};_0x1edeb6(++_0x597472);}(_0xc716,0x16c));var _0x6c71=function(_0x2501aa,_0x226981){_0x2501aa=_0x2501aa-0x0;var _0x3ce23f=_0xc716[_0x2501aa];return _0x3ce23f;};'use strict';var EventEmitter=require(_0x6c71('0x0'));var ChatQueue=require('../../mysqldb')['db'][_0x6c71('0x1')];var ChatQueueEvents=new EventEmitter();ChatQueueEvents[_0x6c71('0x2')](0x0);var events={'afterCreate':_0x6c71('0x3'),'afterUpdate':_0x6c71('0x4'),'afterDestroy':_0x6c71('0x5')};function emitEvent(_0x5ac1b3){return function(_0x25c7a2,_0x58da58,_0x1a1ca1){ChatQueueEvents[_0x6c71('0x6')](_0x5ac1b3+':'+_0x25c7a2['id'],_0x25c7a2);ChatQueueEvents[_0x6c71('0x6')](_0x5ac1b3,_0x25c7a2);_0x1a1ca1(null);};}for(var e in events){if(events[_0x6c71('0x7')](e)){var event=events[e];ChatQueue[_0x6c71('0x8')](e,emitEvent(event));}}module[_0x6c71('0x9')]=ChatQueueEvents;
\ No newline at end of file
diff --git a/server/api/chatQueue/chatQueue.model.js b/server/api/chatQueue/chatQueue.model.js
index 95349aa..5ea4727 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 _0x215b=['./chatQueue.attributes','ChatQueue','chat_queues','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment'];(function(_0x5371a3,_0x1f65d3){var _0xf3ee50=function(_0x557111){while(--_0x557111){_0x5371a3['push'](_0x5371a3['shift']());}};_0xf3ee50(++_0x1f65d3);}(_0x215b,0x16e));var _0xb215=function(_0x5c0f90,_0xcbe32d){_0x5c0f90=_0x5c0f90-0x0;var _0x5375bf=_0x215b[_0x5c0f90];return _0x5375bf;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0xb215('0x0'))(_0xb215('0x1'));var moment=require(_0xb215('0x2'));var BPromise=require(_0xb215('0x3'));var rp=require(_0xb215('0x4'));var fs=require('fs');var path=require(_0xb215('0x5'));var rimraf=require(_0xb215('0x6'));var config=require(_0xb215('0x7'));var attributes=require(_0xb215('0x8'));module['exports']=function(_0x2164f1,_0xde81fd){return _0x2164f1['define'](_0xb215('0x9'),attributes,{'tableName':_0xb215('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xc360=['lodash','util','../../config/logger','api','rimraf','../../config/environment','./chatQueue.attributes','exports','define','ChatQueue','chat_queues'];(function(_0x341efa,_0x1caf78){var _0x4b983d=function(_0x2746ff){while(--_0x2746ff){_0x341efa['push'](_0x341efa['shift']());}};_0x4b983d(++_0x1caf78);}(_0xc360,0x84));var _0x0c36=function(_0x3c803d,_0x4ac193){_0x3c803d=_0x3c803d-0x0;var _0x3c6e80=_0xc360[_0x3c803d];return _0x3c6e80;};'use strict';var _=require(_0x0c36('0x0'));var util=require(_0x0c36('0x1'));var logger=require(_0x0c36('0x2'))(_0x0c36('0x3'));var moment=require('moment');var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x0c36('0x4'));var config=require(_0x0c36('0x5'));var attributes=require(_0x0c36('0x6'));module[_0x0c36('0x7')]=function(_0x8b83ba,_0x5aed25){return _0x8b83ba[_0x0c36('0x8')](_0x0c36('0x9'),attributes,{'tableName':_0x0c36('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
diff --git a/server/api/chatQueue/chatQueue.rpc.js b/server/api/chatQueue/chatQueue.rpc.js
index c443250..421e4fc 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 _0x9176=['model','debug','ShowChatQueue','find','where','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/environment','jayson/promise','client','http','redis','socket.io-emitter','./chatQueue.socket','register','request','then','info','stringify','error','message','ChatQueue,\x20%s,\x20%s','request\x20sent','catch','GetChatQueue','ChatQueue','findAll','raw','options','attributes','limit','include','map'];(function(_0x1b7c98,_0xcfaa51){var _0x22a87e=function(_0x4a662d){while(--_0x4a662d){_0x1b7c98['push'](_0x1b7c98['shift']());}};_0x22a87e(++_0xcfaa51);}(_0x9176,0x164));var _0x6917=function(_0x11c3ca,_0x18c151){_0x11c3ca=_0x11c3ca-0x0;var _0x8133bc=_0x9176[_0x11c3ca];return _0x8133bc;};'use strict';var _=require(_0x6917('0x0'));var util=require(_0x6917('0x1'));var moment=require(_0x6917('0x2'));var BPromise=require(_0x6917('0x3'));var rs=require(_0x6917('0x4'));var fs=require('fs');var Redis=require(_0x6917('0x5'));var db=require(_0x6917('0x6'))['db'];var utils=require(_0x6917('0x7'));var logger=require('../../config/logger')('rpc');var config=require(_0x6917('0x8'));var jayson=require(_0x6917('0x9'));var client=jayson[_0x6917('0xa')][_0x6917('0xb')]({'port':0x232a});config[_0x6917('0xc')]=_['defaults'](config[_0x6917('0xc')],{'host':'localhost','port':0x18eb});var socket=require(_0x6917('0xd'))(new Redis(config['redis']));require(_0x6917('0xe'))[_0x6917('0xf')](socket);function respondWithRpcPromise(_0x24d878,_0x56a4f6,_0x11fc8b){return new BPromise(function(_0x53a1de,_0x4610d4){return client[_0x6917('0x10')](_0x24d878,_0x11fc8b)[_0x6917('0x11')](function(_0xbf96a7){logger[_0x6917('0x12')]('ChatQueue,\x20%s,\x20%s',_0x56a4f6,'request\x20sent');logger['debug']('ChatQueue,\x20%s,\x20%s,\x20%s',_0x56a4f6,'request\x20sent',JSON[_0x6917('0x13')](_0xbf96a7));if(_0xbf96a7[_0x6917('0x14')]){if(_0xbf96a7[_0x6917('0x14')]['code']===0x1f4){logger[_0x6917('0x14')]('ChatQueue,\x20%s,\x20%s',_0x56a4f6,_0xbf96a7[_0x6917('0x14')]['message']);return _0x4610d4(_0xbf96a7[_0x6917('0x14')][_0x6917('0x15')]);}logger['error'](_0x6917('0x16'),_0x56a4f6,_0xbf96a7['error']['message']);return _0x53a1de(_0xbf96a7[_0x6917('0x14')][_0x6917('0x15')]);}else{logger[_0x6917('0x12')]('ChatQueue,\x20%s,\x20%s',_0x56a4f6,_0x6917('0x17'));_0x53a1de(_0xbf96a7['result'][_0x6917('0x15')]);}})[_0x6917('0x18')](function(_0x1d8b8b){logger[_0x6917('0x14')]('ChatQueue,\x20%s,\x20%s',_0x56a4f6,_0x1d8b8b);_0x4610d4(_0x1d8b8b);});});}exports[_0x6917('0x19')]=function(_0x39eeb9){var _0x39fd85=this;return new Promise(function(_0x1728f4,_0x334629){return db[_0x6917('0x1a')][_0x6917('0x1b')]({'raw':_0x39eeb9['options']?_0x39eeb9['options'][_0x6917('0x1c')]===undefined?!![]:![]:!![],'where':_0x39eeb9[_0x6917('0x1d')]?_0x39eeb9[_0x6917('0x1d')]['where']||null:null,'attributes':_0x39eeb9['options']?_0x39eeb9['options'][_0x6917('0x1e')]||null:null,'limit':_0x39eeb9[_0x6917('0x1d')]?_0x39eeb9[_0x6917('0x1d')][_0x6917('0x1f')]||null:null,'include':_0x39eeb9[_0x6917('0x1d')]?_0x39eeb9[_0x6917('0x1d')][_0x6917('0x20')]?_[_0x6917('0x21')](_0x39eeb9['options'][_0x6917('0x20')],function(_0x3f18c5){return{'model':db[_0x3f18c5[_0x6917('0x22')]],'as':_0x3f18c5['as'],'attributes':_0x3f18c5[_0x6917('0x1e')],'include':_0x3f18c5[_0x6917('0x20')]?_[_0x6917('0x21')](_0x3f18c5[_0x6917('0x20')],function(_0x4b9c77){return{'model':db[_0x4b9c77[_0x6917('0x22')]],'as':_0x4b9c77['as'],'attributes':_0x4b9c77[_0x6917('0x1e')],'include':_0x4b9c77[_0x6917('0x20')]?_[_0x6917('0x21')](_0x4b9c77['include'],function(_0x410679){return{'model':db[_0x410679[_0x6917('0x22')]],'as':_0x410679['as'],'attributes':_0x410679[_0x6917('0x1e')]};}):[]};}):[]};}):[]:[]})[_0x6917('0x11')](function(_0x255737){logger[_0x6917('0x12')](_0x6917('0x19'),_0x39eeb9);logger[_0x6917('0x23')](_0x6917('0x19'),_0x39eeb9,JSON[_0x6917('0x13')](_0x255737));_0x1728f4(_0x255737);})['catch'](function(_0x3a876a){logger['error'](_0x6917('0x19'),_0x3a876a['message'],_0x39eeb9);_0x334629(_0x39fd85['error'](0x1f4,_0x3a876a[_0x6917('0x15')]));});});};exports[_0x6917('0x24')]=function(_0x4419f3){var _0x471a1e=this;return new Promise(function(_0xf08b9,_0x17e7ad){return db['ChatQueue'][_0x6917('0x25')]({'raw':_0x4419f3[_0x6917('0x1d')]?_0x4419f3[_0x6917('0x1d')][_0x6917('0x1c')]===undefined?!![]:![]:!![],'where':_0x4419f3[_0x6917('0x1d')]?_0x4419f3[_0x6917('0x1d')][_0x6917('0x26')]||null:null,'attributes':_0x4419f3[_0x6917('0x1d')]?_0x4419f3[_0x6917('0x1d')][_0x6917('0x1e')]||null:null,'include':_0x4419f3[_0x6917('0x1d')]?_0x4419f3[_0x6917('0x1d')][_0x6917('0x20')]?_[_0x6917('0x21')](_0x4419f3[_0x6917('0x1d')][_0x6917('0x20')],function(_0x57cc70){return{'model':db[_0x57cc70[_0x6917('0x22')]],'as':_0x57cc70['as'],'attributes':_0x57cc70[_0x6917('0x1e')],'include':_0x57cc70[_0x6917('0x20')]?_[_0x6917('0x21')](_0x57cc70[_0x6917('0x20')],function(_0x244838){return{'model':db[_0x244838[_0x6917('0x22')]],'as':_0x244838['as'],'attributes':_0x244838['attributes'],'include':_0x244838[_0x6917('0x20')]?_['map'](_0x244838[_0x6917('0x20')],function(_0x270992){return{'model':db[_0x270992[_0x6917('0x22')]],'as':_0x270992['as'],'attributes':_0x270992[_0x6917('0x1e')]};}):[]};}):[]};}):[]:[]})[_0x6917('0x11')](function(_0x4f5e36){logger[_0x6917('0x12')](_0x6917('0x24'),_0x4419f3);logger[_0x6917('0x23')]('ShowChatQueue',_0x4419f3,JSON[_0x6917('0x13')](_0x4f5e36));_0xf08b9(_0x4f5e36);})[_0x6917('0x18')](function(_0x21847b){logger[_0x6917('0x14')](_0x6917('0x24'),_0x21847b[_0x6917('0x15')],_0x4419f3);_0x17e7ad(_0x471a1e['error'](0x1f4,_0x21847b[_0x6917('0x15')]));});});};
\ No newline at end of file
+var _0x84ae=['message','result','catch','ChatQueue','findAll','options','raw','where','attributes','limit','map','include','model','GetChatQueue','ShowChatQueue','find','stringify','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','client','redis','defaults','localhost','./chatQueue.socket','register','request','then','info','ChatQueue,\x20%s,\x20%s','request\x20sent','debug','ChatQueue,\x20%s,\x20%s,\x20%s','error'];(function(_0x318816,_0x4b705a){var _0x1671cf=function(_0x144ccb){while(--_0x144ccb){_0x318816['push'](_0x318816['shift']());}};_0x1671cf(++_0x4b705a);}(_0x84ae,0x101));var _0xe84a=function(_0x497391,_0x471b68){_0x497391=_0x497391-0x0;var _0x1f88dc=_0x84ae[_0x497391];return _0x1f88dc;};'use strict';var _=require(_0xe84a('0x0'));var util=require(_0xe84a('0x1'));var moment=require(_0xe84a('0x2'));var BPromise=require(_0xe84a('0x3'));var rs=require(_0xe84a('0x4'));var fs=require('fs');var Redis=require(_0xe84a('0x5'));var db=require(_0xe84a('0x6'))['db'];var utils=require(_0xe84a('0x7'));var logger=require(_0xe84a('0x8'))('rpc');var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0xe84a('0x9')]['http']({'port':0x232a});config[_0xe84a('0xa')]=_[_0xe84a('0xb')](config[_0xe84a('0xa')],{'host':_0xe84a('0xc'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xe84a('0xa')]));require(_0xe84a('0xd'))[_0xe84a('0xe')](socket);function respondWithRpcPromise(_0x5c47f9,_0x2a7d97,_0x17f161){return new BPromise(function(_0x368c9f,_0xbfda9c){return client[_0xe84a('0xf')](_0x5c47f9,_0x17f161)[_0xe84a('0x10')](function(_0x57ed4e){logger[_0xe84a('0x11')](_0xe84a('0x12'),_0x2a7d97,_0xe84a('0x13'));logger[_0xe84a('0x14')](_0xe84a('0x15'),_0x2a7d97,'request\x20sent',JSON['stringify'](_0x57ed4e));if(_0x57ed4e['error']){if(_0x57ed4e[_0xe84a('0x16')]['code']===0x1f4){logger['error']('ChatQueue,\x20%s,\x20%s',_0x2a7d97,_0x57ed4e[_0xe84a('0x16')][_0xe84a('0x17')]);return _0xbfda9c(_0x57ed4e[_0xe84a('0x16')][_0xe84a('0x17')]);}logger[_0xe84a('0x16')](_0xe84a('0x12'),_0x2a7d97,_0x57ed4e[_0xe84a('0x16')][_0xe84a('0x17')]);return _0x368c9f(_0x57ed4e['error'][_0xe84a('0x17')]);}else{logger[_0xe84a('0x11')](_0xe84a('0x12'),_0x2a7d97,_0xe84a('0x13'));_0x368c9f(_0x57ed4e[_0xe84a('0x18')][_0xe84a('0x17')]);}})[_0xe84a('0x19')](function(_0x1ed66a){logger[_0xe84a('0x16')](_0xe84a('0x12'),_0x2a7d97,_0x1ed66a);_0xbfda9c(_0x1ed66a);});});}exports['GetChatQueue']=function(_0x5cdde7){var _0x38a40a=this;return new Promise(function(_0x5c0177,_0x5aad8a){return db[_0xe84a('0x1a')][_0xe84a('0x1b')]({'raw':_0x5cdde7[_0xe84a('0x1c')]?_0x5cdde7[_0xe84a('0x1c')][_0xe84a('0x1d')]===undefined?!![]:![]:!![],'where':_0x5cdde7['options']?_0x5cdde7[_0xe84a('0x1c')][_0xe84a('0x1e')]||null:null,'attributes':_0x5cdde7[_0xe84a('0x1c')]?_0x5cdde7[_0xe84a('0x1c')][_0xe84a('0x1f')]||null:null,'limit':_0x5cdde7[_0xe84a('0x1c')]?_0x5cdde7[_0xe84a('0x1c')][_0xe84a('0x20')]||null:null,'include':_0x5cdde7['options']?_0x5cdde7['options']['include']?_[_0xe84a('0x21')](_0x5cdde7[_0xe84a('0x1c')][_0xe84a('0x22')],function(_0x594fdd){return{'model':db[_0x594fdd[_0xe84a('0x23')]],'as':_0x594fdd['as'],'attributes':_0x594fdd[_0xe84a('0x1f')],'include':_0x594fdd[_0xe84a('0x22')]?_[_0xe84a('0x21')](_0x594fdd[_0xe84a('0x22')],function(_0x30a53c){return{'model':db[_0x30a53c[_0xe84a('0x23')]],'as':_0x30a53c['as'],'attributes':_0x30a53c['attributes'],'include':_0x30a53c[_0xe84a('0x22')]?_['map'](_0x30a53c[_0xe84a('0x22')],function(_0x2a9bf){return{'model':db[_0x2a9bf[_0xe84a('0x23')]],'as':_0x2a9bf['as'],'attributes':_0x2a9bf[_0xe84a('0x1f')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x5da546){logger[_0xe84a('0x11')](_0xe84a('0x24'),_0x5cdde7);logger[_0xe84a('0x14')](_0xe84a('0x24'),_0x5cdde7,JSON['stringify'](_0x5da546));_0x5c0177(_0x5da546);})[_0xe84a('0x19')](function(_0x569ef4){logger['error'](_0xe84a('0x24'),_0x569ef4['message'],_0x5cdde7);_0x5aad8a(_0x38a40a[_0xe84a('0x16')](0x1f4,_0x569ef4[_0xe84a('0x17')]));});});};exports[_0xe84a('0x25')]=function(_0x2ce18e){var _0x440c64=this;return new Promise(function(_0x536896,_0x35b677){return db['ChatQueue'][_0xe84a('0x26')]({'raw':_0x2ce18e[_0xe84a('0x1c')]?_0x2ce18e[_0xe84a('0x1c')]['raw']===undefined?!![]:![]:!![],'where':_0x2ce18e[_0xe84a('0x1c')]?_0x2ce18e[_0xe84a('0x1c')][_0xe84a('0x1e')]||null:null,'attributes':_0x2ce18e[_0xe84a('0x1c')]?_0x2ce18e[_0xe84a('0x1c')]['attributes']||null:null,'include':_0x2ce18e[_0xe84a('0x1c')]?_0x2ce18e['options'][_0xe84a('0x22')]?_['map'](_0x2ce18e['options'][_0xe84a('0x22')],function(_0x4e62dc){return{'model':db[_0x4e62dc[_0xe84a('0x23')]],'as':_0x4e62dc['as'],'attributes':_0x4e62dc[_0xe84a('0x1f')],'include':_0x4e62dc[_0xe84a('0x22')]?_[_0xe84a('0x21')](_0x4e62dc[_0xe84a('0x22')],function(_0xe750c5){return{'model':db[_0xe750c5[_0xe84a('0x23')]],'as':_0xe750c5['as'],'attributes':_0xe750c5[_0xe84a('0x1f')],'include':_0xe750c5[_0xe84a('0x22')]?_[_0xe84a('0x21')](_0xe750c5['include'],function(_0x4bea08){return{'model':db[_0x4bea08[_0xe84a('0x23')]],'as':_0x4bea08['as'],'attributes':_0x4bea08[_0xe84a('0x1f')]};}):[]};}):[]};}):[]:[]})[_0xe84a('0x10')](function(_0x5ad492){logger['info'](_0xe84a('0x25'),_0x2ce18e);logger['debug'](_0xe84a('0x25'),_0x2ce18e,JSON[_0xe84a('0x27')](_0x5ad492));_0x536896(_0x5ad492);})[_0xe84a('0x19')](function(_0x43e172){logger[_0xe84a('0x16')](_0xe84a('0x25'),_0x43e172['message'],_0x2ce18e);_0x35b677(_0x440c64[_0xe84a('0x16')](0x1f4,_0x43e172['message']));});});};
\ No newline at end of file
diff --git a/server/api/chatQueue/chatQueue.socket.js b/server/api/chatQueue/chatQueue.socket.js
index 65e13f4..f317812 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 _0x2bc6=['length','./chatQueue.events','save','remove','emit','removeListener'];(function(_0x3c601b,_0x4e839f){var _0x24f02f=function(_0x6a5086){while(--_0x6a5086){_0x3c601b['push'](_0x3c601b['shift']());}};_0x24f02f(++_0x4e839f);}(_0x2bc6,0x163));var _0x62bc=function(_0x4a0e5b,_0x864f50){_0x4a0e5b=_0x4a0e5b-0x0;var _0x4f6b11=_0x2bc6[_0x4a0e5b];return _0x4f6b11;};'use strict';var ChatQueueEvents=require(_0x62bc('0x0'));var events=[_0x62bc('0x1'),_0x62bc('0x2'),'update'];function createListener(_0x4b4e73,_0x5a2676){return function(_0x5c5a2a){_0x5a2676[_0x62bc('0x3')](_0x4b4e73,_0x5c5a2a);};}function removeListener(_0x576608,_0x2a1959){return function(){ChatQueueEvents[_0x62bc('0x4')](_0x576608,_0x2a1959);};}exports['register']=function(_0x3cce26){for(var _0x450cb6=0x0,_0x40af10=events[_0x62bc('0x5')];_0x450cb6<_0x40af10;_0x450cb6++){var _0x3ed6ad=events[_0x450cb6];var _0x3f625c=createListener('chatQueue:'+_0x3ed6ad,_0x3cce26);ChatQueueEvents['on'](_0x3ed6ad,_0x3f625c);}};
\ No newline at end of file
+var _0x6f0d=['update','emit','removeListener','length','save','remove'];(function(_0x4daaa1,_0x4a1bbd){var _0x37a1fd=function(_0xa5d8c1){while(--_0xa5d8c1){_0x4daaa1['push'](_0x4daaa1['shift']());}};_0x37a1fd(++_0x4a1bbd);}(_0x6f0d,0x16c));var _0xd6f0=function(_0x14f4a6,_0x337bb2){_0x14f4a6=_0x14f4a6-0x0;var _0x5c8eca=_0x6f0d[_0x14f4a6];return _0x5c8eca;};'use strict';var ChatQueueEvents=require('./chatQueue.events');var events=[_0xd6f0('0x0'),_0xd6f0('0x1'),_0xd6f0('0x2')];function createListener(_0x107a8c,_0x573473){return function(_0x275230){_0x573473[_0xd6f0('0x3')](_0x107a8c,_0x275230);};}function removeListener(_0x2f78fb,_0x25344b){return function(){ChatQueueEvents[_0xd6f0('0x4')](_0x2f78fb,_0x25344b);};}exports['register']=function(_0x2d2ce6){for(var _0x4a8b0c=0x0,_0xe21ac4=events[_0xd6f0('0x5')];_0x4a8b0c<_0xe21ac4;_0x4a8b0c++){var _0x8b89a9=events[_0x4a8b0c];var _0x1a48a0=createListener('chatQueue:'+_0x8b89a9,_0x2d2ce6);ChatQueueEvents['on'](_0x8b89a9,_0x1a48a0);}};
\ No newline at end of file
diff --git a/server/api/chatQueue/index.js b/server/api/chatQueue/index.js
index 74af25a..9538648 100644
--- a/server/api/chatQueue/index.js
+++ b/server/api/chatQueue/index.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x008c=['../../config/environment','./chatQueue.controller','get','isAuthenticated','index','show','/:id/teams','getTeams','/:id/users','getAgents','post','addTeams','addAgents','update','delete','/:id','removeTeams','multer','util','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service'];(function(_0x5a137d,_0x103598){var _0x331056=function(_0x3213dd){while(--_0x3213dd){_0x5a137d['push'](_0x5a137d['shift']());}};_0x331056(++_0x103598);}(_0x008c,0x188));var _0xc008=function(_0x5e4d4d,_0x5a5aa6){_0x5e4d4d=_0x5e4d4d-0x0;var _0x40cbd6=_0x008c[_0x5e4d4d];return _0x40cbd6;};'use strict';var multer=require(_0xc008('0x0'));var util=require(_0xc008('0x1'));var path=require(_0xc008('0x2'));var timeout=require(_0xc008('0x3'));var express=require(_0xc008('0x4'));var router=express['Router']();var fs_extra=require(_0xc008('0x5'));var auth=require(_0xc008('0x6'));var interaction=require(_0xc008('0x7'));var config=require(_0xc008('0x8'));var controller=require(_0xc008('0x9'));router[_0xc008('0xa')]('/',auth[_0xc008('0xb')](),controller[_0xc008('0xc')]);router[_0xc008('0xa')]('/describe',auth[_0xc008('0xb')](),controller['describe']);router[_0xc008('0xa')]('/:id',auth['isAuthenticated'](),controller[_0xc008('0xd')]);router[_0xc008('0xa')]('/:id/members',auth['isAuthenticated'](),controller['getMembers']);router[_0xc008('0xa')](_0xc008('0xe'),auth['isAuthenticated'](),controller[_0xc008('0xf')]);router[_0xc008('0xa')](_0xc008('0x10'),auth[_0xc008('0xb')](),controller[_0xc008('0x11')]);router[_0xc008('0x12')]('/',auth[_0xc008('0xb')](),controller['create']);router['post'](_0xc008('0xe'),auth['isAuthenticated'](),controller[_0xc008('0x13')]);router[_0xc008('0x12')](_0xc008('0x10'),auth[_0xc008('0xb')](),controller[_0xc008('0x14')]);router['put']('/:id',auth['isAuthenticated'](),controller[_0xc008('0x15')]);router[_0xc008('0x16')](_0xc008('0x17'),auth[_0xc008('0xb')](),controller['destroy']);router['delete']('/:id/teams',auth['isAuthenticated'](),controller[_0xc008('0x18')]);router[_0xc008('0x16')]('/:id/users',auth[_0xc008('0xb')](),controller['removeAgents']);module['exports']=router;
\ No newline at end of file
+var _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(_0x2e3727,_0x2670ae){var _0x2cc413=function(_0x4821a7){while(--_0x4821a7){_0x2e3727['push'](_0x2e3727['shift']());}};_0x2cc413(++_0x2670ae);}(_0x7217,0x19e));var _0x7721=function(_0x5ddb1c,_0x5ea4df){_0x5ddb1c=_0x5ddb1c-0x0;var _0x354adc=_0x7217[_0x5ddb1c];return _0x354adc;};'use strict';var multer=require(_0x7721('0x0'));var util=require('util');var path=require(_0x7721('0x1'));var timeout=require(_0x7721('0x2'));var express=require(_0x7721('0x3'));var router=express[_0x7721('0x4')]();var fs_extra=require(_0x7721('0x5'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x7721('0x6'));var controller=require(_0x7721('0x7'));router[_0x7721('0x8')]('/',auth[_0x7721('0x9')](),controller[_0x7721('0xa')]);router[_0x7721('0x8')](_0x7721('0xb'),auth[_0x7721('0x9')](),controller[_0x7721('0xc')]);router[_0x7721('0x8')](_0x7721('0xd'),auth[_0x7721('0x9')](),controller[_0x7721('0xe')]);router[_0x7721('0x8')](_0x7721('0xf'),auth['isAuthenticated'](),controller[_0x7721('0x10')]);router[_0x7721('0x8')](_0x7721('0x11'),auth[_0x7721('0x9')](),controller[_0x7721('0x12')]);router[_0x7721('0x8')](_0x7721('0x13'),auth[_0x7721('0x9')](),controller['getAgents']);router[_0x7721('0x14')]('/',auth[_0x7721('0x9')](),controller['create']);router[_0x7721('0x14')](_0x7721('0x11'),auth[_0x7721('0x9')](),controller[_0x7721('0x15')]);router['post'](_0x7721('0x13'),auth[_0x7721('0x9')](),controller['addAgents']);router['put']('/:id',auth[_0x7721('0x9')](),controller[_0x7721('0x16')]);router[_0x7721('0x17')](_0x7721('0xd'),auth['isAuthenticated'](),controller[_0x7721('0x18')]);router['delete'](_0x7721('0x11'),auth['isAuthenticated'](),controller[_0x7721('0x19')]);router[_0x7721('0x17')](_0x7721('0x13'),auth[_0x7721('0x9')](),controller[_0x7721('0x1a')]);module[_0x7721('0x1b')]=router;
\ No newline at end of file
diff --git a/server/api/chatQueueReport/chatQueueReport.attributes.js b/server/api/chatQueueReport/chatQueueReport.attributes.js
index 20dccba..8a8a983 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 _0xc77d=['STRING','DATE','moment','sequelize','exports'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xc77d,0x156));var _0xdc77=function(_0x32a254,_0x14e1d0){_0x32a254=_0x32a254-0x0;var _0x799afb=_0xc77d[_0x32a254];return _0x799afb;};'use strict';var moment=require(_0xdc77('0x0'));var Sequelize=require(_0xdc77('0x1'));module[_0xdc77('0x2')]={'uniqueid':{'type':Sequelize[_0xdc77('0x3')],'allowNull':![]},'from':{'type':Sequelize[_0xdc77('0x3')]},'joinAt':{'type':Sequelize['DATE']},'leaveAt':{'type':Sequelize[_0xdc77('0x4')]},'acceptAt':{'type':Sequelize[_0xdc77('0x4')]},'exitAt':{'type':Sequelize[_0xdc77('0x4')]},'reason':{'type':Sequelize['STRING']}};
\ No newline at end of file
+var _0xebab=['STRING','DATE','moment','sequelize','exports'];(function(_0x5b36bd,_0x4dfb36){var _0x1614fe=function(_0x559b7c){while(--_0x559b7c){_0x5b36bd['push'](_0x5b36bd['shift']());}};_0x1614fe(++_0x4dfb36);}(_0xebab,0x124));var _0xbeba=function(_0x92ea13,_0x285a20){_0x92ea13=_0x92ea13-0x0;var _0x565fcd=_0xebab[_0x92ea13];return _0x565fcd;};'use strict';var moment=require(_0xbeba('0x0'));var Sequelize=require(_0xbeba('0x1'));module[_0xbeba('0x2')]={'uniqueid':{'type':Sequelize['STRING'],'allowNull':![]},'from':{'type':Sequelize[_0xbeba('0x3')]},'joinAt':{'type':Sequelize[_0xbeba('0x4')]},'leaveAt':{'type':Sequelize['DATE']},'acceptAt':{'type':Sequelize[_0xbeba('0x4')]},'exitAt':{'type':Sequelize['DATE']},'reason':{'type':Sequelize[_0xbeba('0x3')]}};
\ No newline at end of file
diff --git a/server/api/chatQueueReport/chatQueueReport.controller.js b/server/api/chatQueueReport/chatQueueReport.controller.js
index b8ccc6a..044f7d4 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 _0xe55d=['mustache','util','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','papaparse','ioredis','../../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','reject','update','then','error','stack','name','index','map','rawAttributes','fieldName','model','query','keys','intersection','fields','attributes','nolimit','order','sort','where','filters','pick','filter','merge','type','VIRTUAL','options','ChatQueueReport','includeAll','include','findAll','rows','show','params','length','find','body','catch','destroy','describe','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird'];(function(_0x46d704,_0x352056){var _0x4ce393=function(_0x5d74ed){while(--_0x5d74ed){_0x46d704['push'](_0x46d704['shift']());}};_0x4ce393(++_0x352056);}(_0xe55d,0x126));var _0xde55=function(_0x338ea3,_0x511825){_0x338ea3=_0x338ea3-0x0;var _0x311b7d=_0xe55d[_0x338ea3];return _0x311b7d;};'use strict';var emlformat=require(_0xde55('0x0'));var rimraf=require(_0xde55('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xde55('0x2'));var rp=require(_0xde55('0x3'));var moment=require(_0xde55('0x4'));var BPromise=require(_0xde55('0x5'));var Mustache=require(_0xde55('0x6'));var util=require(_0xde55('0x7'));var path=require('path');var sox=require(_0xde55('0x8'));var csv=require(_0xde55('0x9'));var ejs=require(_0xde55('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xde55('0xb'));var squel=require(_0xde55('0xc'));var crypto=require(_0xde55('0xd'));var jsforce=require(_0xde55('0xe'));var deskjs=require(_0xde55('0xf'));var toCsv=require(_0xde55('0x9'));var querystring=require('querystring');var Papa=require(_0xde55('0x10'));var Redis=require(_0xde55('0x11'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0xde55('0x12'));var hardwareService=require(_0xde55('0x13'));var logger=require('../../config/logger')(_0xde55('0x14'));var utils=require(_0xde55('0x15'));var config=require('../../config/environment');var licenseUtil=require(_0xde55('0x16'));var db=require(_0xde55('0x17'))['db'];function respondWithStatusCode(_0xd83620,_0x571b2a){_0x571b2a=_0x571b2a||0xcc;return function(_0x277d51){if(_0x277d51){return _0xd83620[_0xde55('0x18')](_0x571b2a);}return _0xd83620[_0xde55('0x19')](_0x571b2a)[_0xde55('0x1a')]();};}function respondWithResult(_0x81ea0f,_0x3663d5){_0x3663d5=_0x3663d5||0xc8;return function(_0x5844c9){if(_0x5844c9){return _0x81ea0f['status'](_0x3663d5)[_0xde55('0x1b')](_0x5844c9);}};}function respondWithFilteredResult(_0x37c61a,_0x4b4b84){return function(_0x1238c5){if(_0x1238c5){var _0x3dbdcb=typeof _0x4b4b84[_0xde55('0x1c')]===_0xde55('0x1d')&&typeof _0x4b4b84[_0xde55('0x1e')]===_0xde55('0x1d');var _0x2411a4=_0x1238c5[_0xde55('0x1f')];var _0x4a97e2=_0x3dbdcb?0x0:_0x4b4b84[_0xde55('0x1c')];var _0x42b6e4=_0x3dbdcb?_0x1238c5[_0xde55('0x1f')]:_0x4b4b84[_0xde55('0x1c')]+_0x4b4b84['limit'];var _0x4113f4;if(_0x42b6e4>=_0x2411a4){_0x42b6e4=_0x2411a4;_0x4113f4=0xc8;}else{_0x4113f4=0xce;}_0x37c61a['status'](_0x4113f4);return _0x37c61a[_0xde55('0x20')](_0xde55('0x21'),_0x4a97e2+'-'+_0x42b6e4+'/'+_0x2411a4)['json'](_0x1238c5);}return null;};}function patchUpdates(_0x2dc9b9){return function(_0x5c2991){try{jsonpatch[_0xde55('0x22')](_0x5c2991,_0x2dc9b9,!![]);}catch(_0x5597a4){return BPromise[_0xde55('0x23')](_0x5597a4);}return _0x5c2991['save']();};}function saveUpdates(_0x175106,_0x38e6f8){return function(_0x415463){if(_0x415463){return _0x415463[_0xde55('0x24')](_0x175106)[_0xde55('0x25')](function(_0x29e69c){return _0x29e69c;});}return null;};}function removeEntity(_0xbafeab,_0x2e7607){return function(_0x2e5595){if(_0x2e5595){return _0x2e5595['destroy']()['then'](function(){_0xbafeab[_0xde55('0x19')](0xcc)[_0xde55('0x1a')]();});}};}function handleEntityNotFound(_0x15a04b,_0x36488b){return function(_0x2ece31){if(!_0x2ece31){_0x15a04b[_0xde55('0x18')](0x194);}return _0x2ece31;};}function handleError(_0x330ccc,_0x443b12){_0x443b12=_0x443b12||0x1f4;return function(_0x35f246){logger[_0xde55('0x26')](_0x35f246[_0xde55('0x27')]);if(_0x35f246[_0xde55('0x28')]){delete _0x35f246[_0xde55('0x28')];}_0x330ccc['status'](_0x443b12)['send'](_0x35f246);};}exports[_0xde55('0x29')]=function(_0x51334d,_0x2bf2ae){var _0x1cfde7={},_0x2c42a2={},_0x5592e7={'count':0x0,'rows':[]};var _0x408165=_[_0xde55('0x2a')](db['ChatQueueReport'][_0xde55('0x2b')],function(_0x43c38b){return{'name':_0x43c38b[_0xde55('0x2c')],'type':_0x43c38b['type']['key']};});_0x2c42a2[_0xde55('0x2d')]=_[_0xde55('0x2a')](_0x408165,_0xde55('0x28'));_0x2c42a2[_0xde55('0x2e')]=_[_0xde55('0x2f')](_0x51334d[_0xde55('0x2e')]);_0x2c42a2['filters']=_[_0xde55('0x30')](_0x2c42a2[_0xde55('0x2d')],_0x2c42a2[_0xde55('0x2e')]);_0x1cfde7['attributes']=_[_0xde55('0x30')](_0x2c42a2[_0xde55('0x2d')],qs[_0xde55('0x31')](_0x51334d[_0xde55('0x2e')][_0xde55('0x31')]));_0x1cfde7[_0xde55('0x32')]=_0x1cfde7[_0xde55('0x32')]['length']?_0x1cfde7[_0xde55('0x32')]:_0x2c42a2[_0xde55('0x2d')];if(!_0x51334d[_0xde55('0x2e')]['hasOwnProperty'](_0xde55('0x33'))){_0x1cfde7['limit']=qs[_0xde55('0x1e')](_0x51334d['query'][_0xde55('0x1e')]);_0x1cfde7[_0xde55('0x1c')]=qs['offset'](_0x51334d['query']['offset']);}_0x1cfde7[_0xde55('0x34')]=qs[_0xde55('0x35')](_0x51334d[_0xde55('0x2e')][_0xde55('0x35')]);_0x1cfde7[_0xde55('0x36')]=qs[_0xde55('0x37')](_[_0xde55('0x38')](_0x51334d[_0xde55('0x2e')],_0x2c42a2['filters']),_0x408165);if(_0x51334d['query'][_0xde55('0x39')]){_0x1cfde7[_0xde55('0x36')]=_[_0xde55('0x3a')](_0x1cfde7[_0xde55('0x36')],{'$or':_[_0xde55('0x2a')](_0x408165,function(_0x3b751f){if(_0x3b751f[_0xde55('0x3b')]!==_0xde55('0x3c')){var _0x6debf1={};_0x6debf1[_0x3b751f[_0xde55('0x28')]]={'$like':'%'+_0x51334d[_0xde55('0x2e')][_0xde55('0x39')]+'%'};return _0x6debf1;}})});}_0x1cfde7=_[_0xde55('0x3a')]({},_0x1cfde7,_0x51334d[_0xde55('0x3d')]);var _0x436552={'where':_0x1cfde7[_0xde55('0x36')]};return db[_0xde55('0x3e')][_0xde55('0x1f')](_0x436552)[_0xde55('0x25')](function(_0x586078){_0x5592e7[_0xde55('0x1f')]=_0x586078;if(_0x51334d['query'][_0xde55('0x3f')]){_0x1cfde7[_0xde55('0x40')]=[{'all':!![]}];}return db[_0xde55('0x3e')][_0xde55('0x41')](_0x1cfde7);})[_0xde55('0x25')](function(_0xb754d7){_0x5592e7[_0xde55('0x42')]=_0xb754d7;return _0x5592e7;})[_0xde55('0x25')](respondWithFilteredResult(_0x2bf2ae,_0x1cfde7))['catch'](handleError(_0x2bf2ae,null));};exports[_0xde55('0x43')]=function(_0x419741,_0x157b7c){var _0x5509a2={'raw':!![],'where':{'id':_0x419741[_0xde55('0x44')]['id']}},_0x40abd1={};_0x40abd1['model']=_[_0xde55('0x2f')](db['ChatQueueReport'][_0xde55('0x2b')]);_0x40abd1[_0xde55('0x2e')]=_[_0xde55('0x2f')](_0x419741[_0xde55('0x2e')]);_0x40abd1[_0xde55('0x37')]=_[_0xde55('0x30')](_0x40abd1[_0xde55('0x2d')],_0x40abd1[_0xde55('0x2e')]);_0x5509a2[_0xde55('0x32')]=_[_0xde55('0x30')](_0x40abd1['model'],qs[_0xde55('0x31')](_0x419741['query'][_0xde55('0x31')]));_0x5509a2[_0xde55('0x32')]=_0x5509a2['attributes'][_0xde55('0x45')]?_0x5509a2[_0xde55('0x32')]:_0x40abd1[_0xde55('0x2d')];if(_0x419741[_0xde55('0x2e')]['includeAll']){_0x5509a2['include']=[{'all':!![]}];}_0x5509a2=_['merge']({},_0x5509a2,_0x419741['options']);return db[_0xde55('0x3e')][_0xde55('0x46')](_0x5509a2)['then'](handleEntityNotFound(_0x157b7c,null))[_0xde55('0x25')](respondWithResult(_0x157b7c,null))['catch'](handleError(_0x157b7c,null));};exports['create']=function(_0x4a4945,_0x1a14e0){return db['ChatQueueReport']['create'](_0x4a4945[_0xde55('0x47')],{})[_0xde55('0x25')](respondWithResult(_0x1a14e0,0xc9))[_0xde55('0x48')](handleError(_0x1a14e0,null));};exports[_0xde55('0x24')]=function(_0x443690,_0x1c6b42){if(_0x443690[_0xde55('0x47')]['id']){delete _0x443690['body']['id'];}return db[_0xde55('0x3e')][_0xde55('0x46')]({'where':{'id':_0x443690['params']['id']}})[_0xde55('0x25')](handleEntityNotFound(_0x1c6b42,null))[_0xde55('0x25')](saveUpdates(_0x443690[_0xde55('0x47')],null))[_0xde55('0x25')](respondWithResult(_0x1c6b42,null))[_0xde55('0x48')](handleError(_0x1c6b42,null));};exports[_0xde55('0x49')]=function(_0x712684,_0x477d30){return db[_0xde55('0x3e')][_0xde55('0x46')]({'where':{'id':_0x712684[_0xde55('0x44')]['id']}})[_0xde55('0x25')](handleEntityNotFound(_0x477d30,null))[_0xde55('0x25')](removeEntity(_0x477d30,null))[_0xde55('0x48')](handleError(_0x477d30,null));};exports[_0xde55('0x4a')]=function(_0x326f2,_0x53838e){return db['ChatQueueReport']['describe']()[_0xde55('0x25')](respondWithResult(_0x53838e,null))['catch'](handleError(_0x53838e,null));};
\ No newline at end of file
+var _0xea4e=['eml-format','request-promise','bluebird','mustache','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../mysqldb','sendStatus','status','end','offset','undefined','limit','count','Content-Range','save','update','then','error','name','send','map','rawAttributes','model','query','keys','filters','attributes','fields','length','order','sort','where','filter','merge','type','VIRTUAL','options','includeAll','include','rows','show','params','ChatQueueReport','intersection','find','catch','create','body','destroy','describe'];(function(_0x2a586f,_0x21e596){var _0x18c65a=function(_0x4003a5){while(--_0x4003a5){_0x2a586f['push'](_0x2a586f['shift']());}};_0x18c65a(++_0x21e596);}(_0xea4e,0x10c));var _0xeea4=function(_0xe6beba,_0x3f15d1){_0xe6beba=_0xe6beba-0x0;var _0x2f1c08=_0xea4e[_0xe6beba];return _0x2f1c08;};'use strict';var emlformat=require(_0xeea4('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0xeea4('0x1'));var moment=require('moment');var BPromise=require(_0xeea4('0x2'));var Mustache=require(_0xeea4('0x3'));var util=require('util');var path=require(_0xeea4('0x4'));var sox=require(_0xeea4('0x5'));var csv=require(_0xeea4('0x6'));var ejs=require(_0xeea4('0x7'));var fs=require('fs');var fs_extra=require(_0xeea4('0x8'));var _=require(_0xeea4('0x9'));var squel=require(_0xeea4('0xa'));var crypto=require(_0xeea4('0xb'));var jsforce=require(_0xeea4('0xc'));var deskjs=require('desk.js');var toCsv=require(_0xeea4('0x6'));var querystring=require('querystring');var Papa=require(_0xeea4('0xd'));var Redis=require(_0xeea4('0xe'));var authService=require(_0xeea4('0xf'));var qs=require(_0xeea4('0x10'));var as=require(_0xeea4('0x11'));var hardwareService=require(_0xeea4('0x12'));var logger=require(_0xeea4('0x13'))(_0xeea4('0x14'));var utils=require('../../config/utils');var config=require(_0xeea4('0x15'));var licenseUtil=require('../../config/license/util');var db=require(_0xeea4('0x16'))['db'];function respondWithStatusCode(_0x216785,_0x3c18ed){_0x3c18ed=_0x3c18ed||0xcc;return function(_0x3dbf8c){if(_0x3dbf8c){return _0x216785[_0xeea4('0x17')](_0x3c18ed);}return _0x216785[_0xeea4('0x18')](_0x3c18ed)[_0xeea4('0x19')]();};}function respondWithResult(_0x9d04aa,_0x4d6605){_0x4d6605=_0x4d6605||0xc8;return function(_0x169fc5){if(_0x169fc5){return _0x9d04aa[_0xeea4('0x18')](_0x4d6605)['json'](_0x169fc5);}};}function respondWithFilteredResult(_0x44f13a,_0x4d47b0){return function(_0x2d5a6c){if(_0x2d5a6c){var _0x44f573=typeof _0x4d47b0[_0xeea4('0x1a')]===_0xeea4('0x1b')&&typeof _0x4d47b0[_0xeea4('0x1c')]===_0xeea4('0x1b');var _0x37cd8e=_0x2d5a6c[_0xeea4('0x1d')];var _0x26d8f4=_0x44f573?0x0:_0x4d47b0[_0xeea4('0x1a')];var _0x4ae372=_0x44f573?_0x2d5a6c[_0xeea4('0x1d')]:_0x4d47b0[_0xeea4('0x1a')]+_0x4d47b0['limit'];var _0x36a9b3;if(_0x4ae372>=_0x37cd8e){_0x4ae372=_0x37cd8e;_0x36a9b3=0xc8;}else{_0x36a9b3=0xce;}_0x44f13a[_0xeea4('0x18')](_0x36a9b3);return _0x44f13a['set'](_0xeea4('0x1e'),_0x26d8f4+'-'+_0x4ae372+'/'+_0x37cd8e)['json'](_0x2d5a6c);}return null;};}function patchUpdates(_0x3f7316){return function(_0x54cf4d){try{jsonpatch['apply'](_0x54cf4d,_0x3f7316,!![]);}catch(_0x3756ad){return BPromise['reject'](_0x3756ad);}return _0x54cf4d[_0xeea4('0x1f')]();};}function saveUpdates(_0x12ba5b,_0x3e162c){return function(_0x19b2a8){if(_0x19b2a8){return _0x19b2a8[_0xeea4('0x20')](_0x12ba5b)['then'](function(_0x3f2cd2){return _0x3f2cd2;});}return null;};}function removeEntity(_0x88ab4f,_0x290983){return function(_0x31dab){if(_0x31dab){return _0x31dab['destroy']()[_0xeea4('0x21')](function(){_0x88ab4f[_0xeea4('0x18')](0xcc)[_0xeea4('0x19')]();});}};}function handleEntityNotFound(_0x433825,_0x565da5){return function(_0x594258){if(!_0x594258){_0x433825[_0xeea4('0x17')](0x194);}return _0x594258;};}function handleError(_0x28d8f9,_0x3207a9){_0x3207a9=_0x3207a9||0x1f4;return function(_0x197573){logger[_0xeea4('0x22')](_0x197573['stack']);if(_0x197573[_0xeea4('0x23')]){delete _0x197573[_0xeea4('0x23')];}_0x28d8f9['status'](_0x3207a9)[_0xeea4('0x24')](_0x197573);};}exports['index']=function(_0x4a3a7e,_0xb2acc2){var _0x2eb38c={},_0x134f24={},_0x1217b4={'count':0x0,'rows':[]};var _0x5b651f=_[_0xeea4('0x25')](db['ChatQueueReport'][_0xeea4('0x26')],function(_0x4d68d8){return{'name':_0x4d68d8['fieldName'],'type':_0x4d68d8['type']['key']};});_0x134f24[_0xeea4('0x27')]=_['map'](_0x5b651f,_0xeea4('0x23'));_0x134f24[_0xeea4('0x28')]=_[_0xeea4('0x29')](_0x4a3a7e[_0xeea4('0x28')]);_0x134f24[_0xeea4('0x2a')]=_['intersection'](_0x134f24[_0xeea4('0x27')],_0x134f24[_0xeea4('0x28')]);_0x2eb38c[_0xeea4('0x2b')]=_['intersection'](_0x134f24[_0xeea4('0x27')],qs[_0xeea4('0x2c')](_0x4a3a7e[_0xeea4('0x28')][_0xeea4('0x2c')]));_0x2eb38c[_0xeea4('0x2b')]=_0x2eb38c[_0xeea4('0x2b')][_0xeea4('0x2d')]?_0x2eb38c[_0xeea4('0x2b')]:_0x134f24[_0xeea4('0x27')];if(!_0x4a3a7e[_0xeea4('0x28')]['hasOwnProperty']('nolimit')){_0x2eb38c[_0xeea4('0x1c')]=qs[_0xeea4('0x1c')](_0x4a3a7e[_0xeea4('0x28')][_0xeea4('0x1c')]);_0x2eb38c[_0xeea4('0x1a')]=qs[_0xeea4('0x1a')](_0x4a3a7e[_0xeea4('0x28')]['offset']);}_0x2eb38c[_0xeea4('0x2e')]=qs[_0xeea4('0x2f')](_0x4a3a7e[_0xeea4('0x28')]['sort']);_0x2eb38c[_0xeea4('0x30')]=qs[_0xeea4('0x2a')](_['pick'](_0x4a3a7e[_0xeea4('0x28')],_0x134f24[_0xeea4('0x2a')]),_0x5b651f);if(_0x4a3a7e[_0xeea4('0x28')][_0xeea4('0x31')]){_0x2eb38c[_0xeea4('0x30')]=_[_0xeea4('0x32')](_0x2eb38c[_0xeea4('0x30')],{'$or':_[_0xeea4('0x25')](_0x5b651f,function(_0x52a32d){if(_0x52a32d[_0xeea4('0x33')]!==_0xeea4('0x34')){var _0x47f7a2={};_0x47f7a2[_0x52a32d[_0xeea4('0x23')]]={'$like':'%'+_0x4a3a7e[_0xeea4('0x28')][_0xeea4('0x31')]+'%'};return _0x47f7a2;}})});}_0x2eb38c=_[_0xeea4('0x32')]({},_0x2eb38c,_0x4a3a7e[_0xeea4('0x35')]);var _0x3981fd={'where':_0x2eb38c[_0xeea4('0x30')]};return db['ChatQueueReport'][_0xeea4('0x1d')](_0x3981fd)[_0xeea4('0x21')](function(_0x5d6323){_0x1217b4[_0xeea4('0x1d')]=_0x5d6323;if(_0x4a3a7e['query'][_0xeea4('0x36')]){_0x2eb38c[_0xeea4('0x37')]=[{'all':!![]}];}return db['ChatQueueReport']['findAll'](_0x2eb38c);})[_0xeea4('0x21')](function(_0x4d1512){_0x1217b4[_0xeea4('0x38')]=_0x4d1512;return _0x1217b4;})[_0xeea4('0x21')](respondWithFilteredResult(_0xb2acc2,_0x2eb38c))['catch'](handleError(_0xb2acc2,null));};exports[_0xeea4('0x39')]=function(_0x410a1c,_0x55d136){var _0xb56e01={'raw':!![],'where':{'id':_0x410a1c[_0xeea4('0x3a')]['id']}},_0x13a30c={};_0x13a30c[_0xeea4('0x27')]=_[_0xeea4('0x29')](db[_0xeea4('0x3b')][_0xeea4('0x26')]);_0x13a30c['query']=_[_0xeea4('0x29')](_0x410a1c[_0xeea4('0x28')]);_0x13a30c[_0xeea4('0x2a')]=_[_0xeea4('0x3c')](_0x13a30c['model'],_0x13a30c[_0xeea4('0x28')]);_0xb56e01[_0xeea4('0x2b')]=_[_0xeea4('0x3c')](_0x13a30c['model'],qs['fields'](_0x410a1c[_0xeea4('0x28')][_0xeea4('0x2c')]));_0xb56e01['attributes']=_0xb56e01['attributes'][_0xeea4('0x2d')]?_0xb56e01[_0xeea4('0x2b')]:_0x13a30c[_0xeea4('0x27')];if(_0x410a1c[_0xeea4('0x28')][_0xeea4('0x36')]){_0xb56e01['include']=[{'all':!![]}];}_0xb56e01=_[_0xeea4('0x32')]({},_0xb56e01,_0x410a1c['options']);return db[_0xeea4('0x3b')][_0xeea4('0x3d')](_0xb56e01)[_0xeea4('0x21')](handleEntityNotFound(_0x55d136,null))['then'](respondWithResult(_0x55d136,null))[_0xeea4('0x3e')](handleError(_0x55d136,null));};exports['create']=function(_0x4e525b,_0x11aa5f){return db[_0xeea4('0x3b')][_0xeea4('0x3f')](_0x4e525b[_0xeea4('0x40')],{})['then'](respondWithResult(_0x11aa5f,0xc9))['catch'](handleError(_0x11aa5f,null));};exports[_0xeea4('0x20')]=function(_0x18bb53,_0x208282){if(_0x18bb53['body']['id']){delete _0x18bb53[_0xeea4('0x40')]['id'];}return db[_0xeea4('0x3b')]['find']({'where':{'id':_0x18bb53['params']['id']}})['then'](handleEntityNotFound(_0x208282,null))[_0xeea4('0x21')](saveUpdates(_0x18bb53[_0xeea4('0x40')],null))[_0xeea4('0x21')](respondWithResult(_0x208282,null))[_0xeea4('0x3e')](handleError(_0x208282,null));};exports[_0xeea4('0x41')]=function(_0x2bc6e6,_0x37c205){return db[_0xeea4('0x3b')]['find']({'where':{'id':_0x2bc6e6['params']['id']}})[_0xeea4('0x21')](handleEntityNotFound(_0x37c205,null))['then'](removeEntity(_0x37c205,null))[_0xeea4('0x3e')](handleError(_0x37c205,null));};exports['describe']=function(_0x92788c,_0xfb11fd){return db['ChatQueueReport'][_0xeea4('0x42')]()[_0xeea4('0x21')](respondWithResult(_0xfb11fd,null))[_0xeea4('0x3e')](handleError(_0xfb11fd,null));};
\ No newline at end of file
diff --git a/server/api/chatQueueReport/chatQueueReport.model.js b/server/api/chatQueueReport/chatQueueReport.model.js
index cee04dc..035de23 100644
--- a/server/api/chatQueueReport/chatQueueReport.model.js
+++ b/server/api/chatQueueReport/chatQueueReport.model.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x757a=['report_chat_queue','uniqueid','util','../../config/logger','request-promise','path','rimraf','../../config/environment','./chatQueueReport.attributes','exports','define'];(function(_0x2b858d,_0x303fc1){var _0xbd4855=function(_0x1c1334){while(--_0x1c1334){_0x2b858d['push'](_0x2b858d['shift']());}};_0xbd4855(++_0x303fc1);}(_0x757a,0xde));var _0xa757=function(_0x365ab5,_0x23c621){_0x365ab5=_0x365ab5-0x0;var _0x50d0a7=_0x757a[_0x365ab5];return _0x50d0a7;};'use strict';var _=require('lodash');var util=require(_0xa757('0x0'));var logger=require(_0xa757('0x1'))('api');var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0xa757('0x2'));var fs=require('fs');var path=require(_0xa757('0x3'));var rimraf=require(_0xa757('0x4'));var config=require(_0xa757('0x5'));var attributes=require(_0xa757('0x6'));module[_0xa757('0x7')]=function(_0x5edca8,_0xae0e7c){return _0x5edca8[_0xa757('0x8')]('ChatQueueReport',attributes,{'tableName':_0xa757('0x9'),'paranoid':![],'indexes':[{'name':_0xa757('0xa'),'fields':[_0xa757('0xa')]}],'timestamps':!![]});};
\ No newline at end of file
+var _0xbaf0=['define','ChatQueueReport','report_chat_queue','uniqueid','util','../../config/logger','api','moment','bluebird','request-promise','rimraf','../../config/environment','./chatQueueReport.attributes','exports'];(function(_0x17c7fc,_0x160896){var _0xc24f7e=function(_0xead648){while(--_0xead648){_0x17c7fc['push'](_0x17c7fc['shift']());}};_0xc24f7e(++_0x160896);}(_0xbaf0,0x12a));var _0x0baf=function(_0x6c993a,_0x5ea3ab){_0x6c993a=_0x6c993a-0x0;var _0x27f547=_0xbaf0[_0x6c993a];return _0x27f547;};'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 fbea442..23c8e80 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 _0x8a99=['rpc','../../config/environment','jayson/promise','client','http','request','then','info','request\x20sent','debug','ChatQueueReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','ChatQueueReport,\x20%s,\x20%s','result','catch','CreateChatQueueReport','ChatQueueReport','create','body','options','raw','update','attributes','limit','UpdateChatQueueReport','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger'];(function(_0x7a048a,_0x244252){var _0x3ff163=function(_0x38b9c7){while(--_0x38b9c7){_0x7a048a['push'](_0x7a048a['shift']());}};_0x3ff163(++_0x244252);}(_0x8a99,0x184));var _0x98a9=function(_0x46698a,_0x8de1e4){_0x46698a=_0x46698a-0x0;var _0x356db0=_0x8a99[_0x46698a];return _0x356db0;};'use strict';var _=require(_0x98a9('0x0'));var util=require('util');var moment=require(_0x98a9('0x1'));var BPromise=require(_0x98a9('0x2'));var rs=require(_0x98a9('0x3'));var fs=require('fs');var Redis=require(_0x98a9('0x4'));var db=require(_0x98a9('0x5'))['db'];var utils=require(_0x98a9('0x6'));var logger=require(_0x98a9('0x7'))(_0x98a9('0x8'));var config=require(_0x98a9('0x9'));var jayson=require(_0x98a9('0xa'));var client=jayson[_0x98a9('0xb')][_0x98a9('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x417235,_0x13f674,_0x1bedc7){return new BPromise(function(_0x2640fb,_0x2e26df){return client[_0x98a9('0xd')](_0x417235,_0x1bedc7)[_0x98a9('0xe')](function(_0x44499f){logger[_0x98a9('0xf')]('ChatQueueReport,\x20%s,\x20%s',_0x13f674,_0x98a9('0x10'));logger[_0x98a9('0x11')](_0x98a9('0x12'),_0x13f674,_0x98a9('0x10'),JSON[_0x98a9('0x13')](_0x44499f));if(_0x44499f['error']){if(_0x44499f[_0x98a9('0x14')][_0x98a9('0x15')]===0x1f4){logger['error']('ChatQueueReport,\x20%s,\x20%s',_0x13f674,_0x44499f[_0x98a9('0x14')][_0x98a9('0x16')]);return _0x2e26df(_0x44499f['error'][_0x98a9('0x16')]);}logger['error'](_0x98a9('0x17'),_0x13f674,_0x44499f[_0x98a9('0x14')][_0x98a9('0x16')]);return _0x2640fb(_0x44499f['error'][_0x98a9('0x16')]);}else{logger[_0x98a9('0xf')](_0x98a9('0x17'),_0x13f674,_0x98a9('0x10'));_0x2640fb(_0x44499f[_0x98a9('0x18')][_0x98a9('0x16')]);}})[_0x98a9('0x19')](function(_0x2a2a9e){logger[_0x98a9('0x14')]('ChatQueueReport,\x20%s,\x20%s',_0x13f674,_0x2a2a9e);_0x2e26df(_0x2a2a9e);});});}exports[_0x98a9('0x1a')]=function(_0x24e966){var _0x50f1ef=this;return new Promise(function(_0xe52860,_0x54e787){return db[_0x98a9('0x1b')][_0x98a9('0x1c')](_0x24e966[_0x98a9('0x1d')],{'raw':_0x24e966['options']?_0x24e966[_0x98a9('0x1e')][_0x98a9('0x1f')]===undefined?!![]:![]:!![]})['then'](function(_0x25f997){logger['info'](_0x98a9('0x1a'),_0x24e966);logger[_0x98a9('0x11')](_0x98a9('0x1a'),_0x24e966,JSON['stringify'](_0x25f997));_0xe52860(_0x25f997);})[_0x98a9('0x19')](function(_0xfe92ab){logger['error'](_0x98a9('0x1a'),_0xfe92ab[_0x98a9('0x16')],_0x24e966);_0x54e787(_0x50f1ef['error'](0x1f4,_0xfe92ab[_0x98a9('0x16')]));});});};exports['UpdateChatQueueReport']=function(_0x17bc52){var _0x326259=this;return new Promise(function(_0x46b78e,_0x54d9bd){return db[_0x98a9('0x1b')][_0x98a9('0x20')](_0x17bc52['body'],{'raw':_0x17bc52['options']?_0x17bc52['options'][_0x98a9('0x1f')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x17bc52[_0x98a9('0x1e')]?_0x17bc52[_0x98a9('0x1e')]['where']||null:null,'attributes':_0x17bc52[_0x98a9('0x1e')]?_0x17bc52[_0x98a9('0x1e')][_0x98a9('0x21')]||null:null,'limit':_0x17bc52['options']?_0x17bc52[_0x98a9('0x1e')][_0x98a9('0x22')]||null:null})[_0x98a9('0xe')](function(_0xe675d7){logger[_0x98a9('0xf')](_0x98a9('0x23'),_0x17bc52);logger['debug']('UpdateChatQueueReport',_0x17bc52,JSON['stringify'](_0xe675d7));_0x46b78e(_0xe675d7);})[_0x98a9('0x19')](function(_0xdc1c1a){logger['error'](_0x98a9('0x23'),_0xdc1c1a['message'],_0x17bc52);_0x54d9bd(_0x326259[_0x98a9('0x14')](0x1f4,_0xdc1c1a[_0x98a9('0x16')]));});});};
\ No newline at end of file
+var _0xbc10=['randomstring','ioredis','../../mysqldb','../../config/logger','../../config/environment','jayson/promise','client','request','then','info','ChatQueueReport,\x20%s,\x20%s','request\x20sent','debug','ChatQueueReport,\x20%s,\x20%s,\x20%s','error','message','result','CreateChatQueueReport','create','body','options','raw','stringify','catch','UpdateChatQueueReport','ChatQueueReport','update','where','attributes','limit','lodash','moment','bluebird'];(function(_0x320f2e,_0x45f4e9){var _0x1c8bc1=function(_0x2e1d46){while(--_0x2e1d46){_0x320f2e['push'](_0x320f2e['shift']());}};_0x1c8bc1(++_0x45f4e9);}(_0xbc10,0xa2));var _0x0bc1=function(_0x3de8a4,_0x289a5c){_0x3de8a4=_0x3de8a4-0x0;var _0x4635cf=_0xbc10[_0x3de8a4];return _0x4635cf;};'use strict';var _=require(_0x0bc1('0x0'));var util=require('util');var moment=require(_0x0bc1('0x1'));var BPromise=require(_0x0bc1('0x2'));var rs=require(_0x0bc1('0x3'));var fs=require('fs');var Redis=require(_0x0bc1('0x4'));var db=require(_0x0bc1('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x0bc1('0x6'))('rpc');var config=require(_0x0bc1('0x7'));var jayson=require(_0x0bc1('0x8'));var client=jayson[_0x0bc1('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x4428f6,_0x3ea04d,_0x127333){return new BPromise(function(_0x18c600,_0x201e66){return client[_0x0bc1('0xa')](_0x4428f6,_0x127333)[_0x0bc1('0xb')](function(_0x4572d8){logger[_0x0bc1('0xc')](_0x0bc1('0xd'),_0x3ea04d,_0x0bc1('0xe'));logger[_0x0bc1('0xf')](_0x0bc1('0x10'),_0x3ea04d,_0x0bc1('0xe'),JSON['stringify'](_0x4572d8));if(_0x4572d8[_0x0bc1('0x11')]){if(_0x4572d8[_0x0bc1('0x11')]['code']===0x1f4){logger[_0x0bc1('0x11')](_0x0bc1('0xd'),_0x3ea04d,_0x4572d8[_0x0bc1('0x11')][_0x0bc1('0x12')]);return _0x201e66(_0x4572d8[_0x0bc1('0x11')]['message']);}logger[_0x0bc1('0x11')]('ChatQueueReport,\x20%s,\x20%s',_0x3ea04d,_0x4572d8[_0x0bc1('0x11')][_0x0bc1('0x12')]);return _0x18c600(_0x4572d8['error'][_0x0bc1('0x12')]);}else{logger[_0x0bc1('0xc')](_0x0bc1('0xd'),_0x3ea04d,'request\x20sent');_0x18c600(_0x4572d8[_0x0bc1('0x13')][_0x0bc1('0x12')]);}})['catch'](function(_0x31c5d5){logger[_0x0bc1('0x11')](_0x0bc1('0xd'),_0x3ea04d,_0x31c5d5);_0x201e66(_0x31c5d5);});});}exports[_0x0bc1('0x14')]=function(_0x3c0312){var _0x1420bb=this;return new Promise(function(_0x2eee1c,_0x4f96f0){return db['ChatQueueReport'][_0x0bc1('0x15')](_0x3c0312[_0x0bc1('0x16')],{'raw':_0x3c0312[_0x0bc1('0x17')]?_0x3c0312[_0x0bc1('0x17')][_0x0bc1('0x18')]===undefined?!![]:![]:!![]})[_0x0bc1('0xb')](function(_0x2d7cab){logger[_0x0bc1('0xc')](_0x0bc1('0x14'),_0x3c0312);logger[_0x0bc1('0xf')](_0x0bc1('0x14'),_0x3c0312,JSON[_0x0bc1('0x19')](_0x2d7cab));_0x2eee1c(_0x2d7cab);})[_0x0bc1('0x1a')](function(_0x1f2219){logger[_0x0bc1('0x11')]('CreateChatQueueReport',_0x1f2219[_0x0bc1('0x12')],_0x3c0312);_0x4f96f0(_0x1420bb['error'](0x1f4,_0x1f2219[_0x0bc1('0x12')]));});});};exports[_0x0bc1('0x1b')]=function(_0x1d545b){var _0x83690f=this;return new Promise(function(_0x5e1a24,_0x158dca){return db[_0x0bc1('0x1c')][_0x0bc1('0x1d')](_0x1d545b[_0x0bc1('0x16')],{'raw':_0x1d545b[_0x0bc1('0x17')]?_0x1d545b[_0x0bc1('0x17')][_0x0bc1('0x18')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x1d545b[_0x0bc1('0x17')]?_0x1d545b[_0x0bc1('0x17')][_0x0bc1('0x1e')]||null:null,'attributes':_0x1d545b[_0x0bc1('0x17')]?_0x1d545b[_0x0bc1('0x17')][_0x0bc1('0x1f')]||null:null,'limit':_0x1d545b[_0x0bc1('0x17')]?_0x1d545b[_0x0bc1('0x17')][_0x0bc1('0x20')]||null:null})[_0x0bc1('0xb')](function(_0x2e7c46){logger[_0x0bc1('0xc')]('UpdateChatQueueReport',_0x1d545b);logger[_0x0bc1('0xf')](_0x0bc1('0x1b'),_0x1d545b,JSON[_0x0bc1('0x19')](_0x2e7c46));_0x5e1a24(_0x2e7c46);})[_0x0bc1('0x1a')](function(_0x37976d){logger[_0x0bc1('0x11')](_0x0bc1('0x1b'),_0x37976d[_0x0bc1('0x12')],_0x1d545b);_0x158dca(_0x83690f['error'](0x1f4,_0x37976d[_0x0bc1('0x12')]));});});};
\ No newline at end of file
diff --git a/server/api/chatQueueReport/index.js b/server/api/chatQueueReport/index.js
index e234b3a..0fd1d0a 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 _0xfe14=['path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','./chatQueueReport.controller','isAuthenticated','get','/describe','describe','show','post','create','put','delete','destroy','exports','multer','util'];(function(_0x486f4a,_0x478dc7){var _0x135d99=function(_0x434008){while(--_0x434008){_0x486f4a['push'](_0x486f4a['shift']());}};_0x135d99(++_0x478dc7);}(_0xfe14,0xda));var _0x4fe1=function(_0x1e08fa,_0x2177b8){_0x1e08fa=_0x1e08fa-0x0;var _0x48a80f=_0xfe14[_0x1e08fa];return _0x48a80f;};'use strict';var multer=require(_0x4fe1('0x0'));var util=require(_0x4fe1('0x1'));var path=require(_0x4fe1('0x2'));var timeout=require(_0x4fe1('0x3'));var express=require(_0x4fe1('0x4'));var router=express['Router']();var fs_extra=require(_0x4fe1('0x5'));var auth=require(_0x4fe1('0x6'));var interaction=require(_0x4fe1('0x7'));var config=require('../../config/environment');var controller=require(_0x4fe1('0x8'));router['get']('/',auth[_0x4fe1('0x9')](),controller['index']);router[_0x4fe1('0xa')](_0x4fe1('0xb'),auth[_0x4fe1('0x9')](),controller[_0x4fe1('0xc')]);router['get']('/:id',auth[_0x4fe1('0x9')](),controller[_0x4fe1('0xd')]);router[_0x4fe1('0xe')]('/',auth[_0x4fe1('0x9')](),controller[_0x4fe1('0xf')]);router[_0x4fe1('0x10')]('/:id',auth['isAuthenticated'](),controller['update']);router[_0x4fe1('0x11')]('/:id',auth['isAuthenticated'](),controller[_0x4fe1('0x12')]);module[_0x4fe1('0x13')]=router;
\ No newline at end of file
+var _0x416e=['describe','/:id','show','post','create','put','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatQueueReport.controller','get','isAuthenticated','index','/describe'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x416e,0x102));var _0xe416=function(_0x12da0f,_0x32ae44){_0x12da0f=_0x12da0f-0x0;var _0x4adae=_0x416e[_0x12da0f];return _0x4adae;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0xe416('0x0'));var timeout=require('connect-timeout');var express=require(_0xe416('0x1'));var router=express[_0xe416('0x2')]();var fs_extra=require(_0xe416('0x3'));var auth=require(_0xe416('0x4'));var interaction=require(_0xe416('0x5'));var config=require(_0xe416('0x6'));var controller=require(_0xe416('0x7'));router[_0xe416('0x8')]('/',auth[_0xe416('0x9')](),controller[_0xe416('0xa')]);router[_0xe416('0x8')](_0xe416('0xb'),auth[_0xe416('0x9')](),controller[_0xe416('0xc')]);router[_0xe416('0x8')](_0xe416('0xd'),auth['isAuthenticated'](),controller[_0xe416('0xe')]);router[_0xe416('0xf')]('/',auth[_0xe416('0x9')](),controller[_0xe416('0x10')]);router[_0xe416('0x11')]('/:id',auth[_0xe416('0x9')](),controller['update']);router['delete']('/:id',auth['isAuthenticated'](),controller['destroy']);module['exports']=router;
\ No newline at end of file
diff --git a/server/api/chatTransferReport/chatTransferReport.attributes.js b/server/api/chatTransferReport/chatTransferReport.attributes.js
index c10f693..da4c67f 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 _0x9bde=['NOW','sequelize','STRING','account','agent','queue','DATE'];(function(_0xc0d9bc,_0x2bd6be){var _0x32ff73=function(_0x28c592){while(--_0x28c592){_0xc0d9bc['push'](_0xc0d9bc['shift']());}};_0x32ff73(++_0x2bd6be);}(_0x9bde,0xe1));var _0xe9bd=function(_0x4f5769,_0x10f092){_0x4f5769=_0x4f5769-0x0;var _0x1a89f3=_0x9bde[_0x4f5769];return _0x1a89f3;};'use strict';var moment=require('moment');var Sequelize=require(_0xe9bd('0x0'));module['exports']={'uniqueid':{'type':Sequelize[_0xe9bd('0x1')],'allowNull':![]},'type':{'type':Sequelize['ENUM'](_0xe9bd('0x2'),_0xe9bd('0x3'),_0xe9bd('0x4')),'allowNull':![],'defaultValue':_0xe9bd('0x4')},'transferredAt':{'type':Sequelize[_0xe9bd('0x5')],'allowNull':![],'defaultValue':Sequelize[_0xe9bd('0x6')]}};
\ No newline at end of file
+var _0xb43b=['DATE','NOW','moment','sequelize','STRING','ENUM','account','queue'];(function(_0x3dc68d,_0x1c1951){var _0xdf7f94=function(_0x339428){while(--_0x339428){_0x3dc68d['push'](_0x3dc68d['shift']());}};_0xdf7f94(++_0x1c1951);}(_0xb43b,0x1b2));var _0xbb43=function(_0xce9bf2,_0x2b3479){_0xce9bf2=_0xce9bf2-0x0;var _0x209960=_0xb43b[_0xce9bf2];return _0x209960;};'use strict';var moment=require(_0xbb43('0x0'));var Sequelize=require(_0xbb43('0x1'));module['exports']={'uniqueid':{'type':Sequelize[_0xbb43('0x2')],'allowNull':![]},'type':{'type':Sequelize[_0xbb43('0x3')](_0xbb43('0x4'),'agent',_0xbb43('0x5')),'allowNull':![],'defaultValue':_0xbb43('0x5')},'transferredAt':{'type':Sequelize[_0xbb43('0x6')],'allowNull':![],'defaultValue':Sequelize[_0xbb43('0x7')]}};
\ No newline at end of file
diff --git a/server/api/chatTransferReport/chatTransferReport.controller.js b/server/api/chatTransferReport/chatTransferReport.controller.js
index 7b18ea8..cd90d4b 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 _0x4fe3=['Content-Range','apply','reject','update','then','destroy','name','send','index','map','ChatTransferReport','rawAttributes','fieldName','type','key','model','keys','filters','query','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','merge','filter','include','findAll','rows','catch','show','params','includeAll','find','create','body','describe','eml-format','rimraf','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/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','status','json','offset','limit','undefined','count','set'];(function(_0x7ecc0,_0x3c5cc5){var _0x5d016b=function(_0x4229ad){while(--_0x4229ad){_0x7ecc0['push'](_0x7ecc0['shift']());}};_0x5d016b(++_0x3c5cc5);}(_0x4fe3,0x117));var _0x34fe=function(_0x44af8f,_0x46730e){_0x44af8f=_0x44af8f-0x0;var _0x4e96ab=_0x4fe3[_0x44af8f];return _0x4e96ab;};'use strict';var emlformat=require(_0x34fe('0x0'));var rimraf=require(_0x34fe('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x34fe('0x2'));var rp=require(_0x34fe('0x3'));var moment=require(_0x34fe('0x4'));var BPromise=require(_0x34fe('0x5'));var Mustache=require(_0x34fe('0x6'));var util=require(_0x34fe('0x7'));var path=require(_0x34fe('0x8'));var sox=require(_0x34fe('0x9'));var csv=require(_0x34fe('0xa'));var ejs=require(_0x34fe('0xb'));var fs=require('fs');var fs_extra=require(_0x34fe('0xc'));var _=require(_0x34fe('0xd'));var squel=require(_0x34fe('0xe'));var crypto=require(_0x34fe('0xf'));var jsforce=require(_0x34fe('0x10'));var deskjs=require(_0x34fe('0x11'));var toCsv=require(_0x34fe('0xa'));var querystring=require(_0x34fe('0x12'));var Papa=require('papaparse');var Redis=require(_0x34fe('0x13'));var authService=require('../../components/auth/service');var qs=require(_0x34fe('0x14'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x34fe('0x15'));var logger=require(_0x34fe('0x16'))(_0x34fe('0x17'));var utils=require(_0x34fe('0x18'));var config=require(_0x34fe('0x19'));var licenseUtil=require(_0x34fe('0x1a'));var db=require(_0x34fe('0x1b'))['db'];function respondWithStatusCode(_0x13d8c6,_0x2d6eed){_0x2d6eed=_0x2d6eed||0xcc;return function(_0x1430f0){if(_0x1430f0){return _0x13d8c6[_0x34fe('0x1c')](_0x2d6eed);}return _0x13d8c6['status'](_0x2d6eed)[_0x34fe('0x1d')]();};}function respondWithResult(_0x51ad75,_0x524e7b){_0x524e7b=_0x524e7b||0xc8;return function(_0x5b33ad){if(_0x5b33ad){return _0x51ad75[_0x34fe('0x1e')](_0x524e7b)[_0x34fe('0x1f')](_0x5b33ad);}};}function respondWithFilteredResult(_0x1254c6,_0x5863fb){return function(_0x1e30a0){if(_0x1e30a0){var _0x40ad0a=typeof _0x5863fb[_0x34fe('0x20')]==='undefined'&&typeof _0x5863fb[_0x34fe('0x21')]===_0x34fe('0x22');var _0x34f7a3=_0x1e30a0['count'];var _0xbd62cb=_0x40ad0a?0x0:_0x5863fb[_0x34fe('0x20')];var _0x29413f=_0x40ad0a?_0x1e30a0[_0x34fe('0x23')]:_0x5863fb['offset']+_0x5863fb[_0x34fe('0x21')];var _0x59a217;if(_0x29413f>=_0x34f7a3){_0x29413f=_0x34f7a3;_0x59a217=0xc8;}else{_0x59a217=0xce;}_0x1254c6[_0x34fe('0x1e')](_0x59a217);return _0x1254c6[_0x34fe('0x24')](_0x34fe('0x25'),_0xbd62cb+'-'+_0x29413f+'/'+_0x34f7a3)[_0x34fe('0x1f')](_0x1e30a0);}return null;};}function patchUpdates(_0x5c8c82){return function(_0xeca00f){try{jsonpatch[_0x34fe('0x26')](_0xeca00f,_0x5c8c82,!![]);}catch(_0x493531){return BPromise[_0x34fe('0x27')](_0x493531);}return _0xeca00f['save']();};}function saveUpdates(_0x492870,_0x3da1b2){return function(_0x484db2){if(_0x484db2){return _0x484db2[_0x34fe('0x28')](_0x492870)[_0x34fe('0x29')](function(_0x163fec){return _0x163fec;});}return null;};}function removeEntity(_0x115610,_0xcf6067){return function(_0x40806b){if(_0x40806b){return _0x40806b[_0x34fe('0x2a')]()['then'](function(){_0x115610[_0x34fe('0x1e')](0xcc)[_0x34fe('0x1d')]();});}};}function handleEntityNotFound(_0x180670,_0x25737f){return function(_0x11f49d){if(!_0x11f49d){_0x180670[_0x34fe('0x1c')](0x194);}return _0x11f49d;};}function handleError(_0xfc0c26,_0x1b0300){_0x1b0300=_0x1b0300||0x1f4;return function(_0x4249ce){logger['error'](_0x4249ce['stack']);if(_0x4249ce[_0x34fe('0x2b')]){delete _0x4249ce[_0x34fe('0x2b')];}_0xfc0c26[_0x34fe('0x1e')](_0x1b0300)[_0x34fe('0x2c')](_0x4249ce);};}exports[_0x34fe('0x2d')]=function(_0x26a353,_0x52baff){var _0x2a9df8={},_0x13d4f1={},_0x5ac6d6={'count':0x0,'rows':[]};var _0x1ff7a1=_[_0x34fe('0x2e')](db[_0x34fe('0x2f')][_0x34fe('0x30')],function(_0x47700f){return{'name':_0x47700f[_0x34fe('0x31')],'type':_0x47700f[_0x34fe('0x32')][_0x34fe('0x33')]};});_0x13d4f1[_0x34fe('0x34')]=_[_0x34fe('0x2e')](_0x1ff7a1,_0x34fe('0x2b'));_0x13d4f1['query']=_[_0x34fe('0x35')](_0x26a353['query']);_0x13d4f1[_0x34fe('0x36')]=_['intersection'](_0x13d4f1[_0x34fe('0x34')],_0x13d4f1[_0x34fe('0x37')]);_0x2a9df8[_0x34fe('0x38')]=_[_0x34fe('0x39')](_0x13d4f1[_0x34fe('0x34')],qs[_0x34fe('0x3a')](_0x26a353[_0x34fe('0x37')][_0x34fe('0x3a')]));_0x2a9df8['attributes']=_0x2a9df8[_0x34fe('0x38')][_0x34fe('0x3b')]?_0x2a9df8['attributes']:_0x13d4f1[_0x34fe('0x34')];if(!_0x26a353[_0x34fe('0x37')][_0x34fe('0x3c')](_0x34fe('0x3d'))){_0x2a9df8[_0x34fe('0x21')]=qs[_0x34fe('0x21')](_0x26a353[_0x34fe('0x37')][_0x34fe('0x21')]);_0x2a9df8[_0x34fe('0x20')]=qs[_0x34fe('0x20')](_0x26a353[_0x34fe('0x37')][_0x34fe('0x20')]);}_0x2a9df8[_0x34fe('0x3e')]=qs[_0x34fe('0x3f')](_0x26a353[_0x34fe('0x37')][_0x34fe('0x3f')]);_0x2a9df8[_0x34fe('0x40')]=qs[_0x34fe('0x36')](_[_0x34fe('0x41')](_0x26a353[_0x34fe('0x37')],_0x13d4f1[_0x34fe('0x36')]),_0x1ff7a1);if(_0x26a353[_0x34fe('0x37')]['filter']){_0x2a9df8[_0x34fe('0x40')]=_[_0x34fe('0x42')](_0x2a9df8[_0x34fe('0x40')],{'$or':_[_0x34fe('0x2e')](_0x1ff7a1,function(_0x10810c){if(_0x10810c[_0x34fe('0x32')]!=='VIRTUAL'){var _0x173721={};_0x173721[_0x10810c['name']]={'$like':'%'+_0x26a353[_0x34fe('0x37')][_0x34fe('0x43')]+'%'};return _0x173721;}})});}_0x2a9df8=_[_0x34fe('0x42')]({},_0x2a9df8,_0x26a353['options']);var _0x3d396e={'where':_0x2a9df8[_0x34fe('0x40')]};return db[_0x34fe('0x2f')][_0x34fe('0x23')](_0x3d396e)[_0x34fe('0x29')](function(_0x38405b){_0x5ac6d6['count']=_0x38405b;if(_0x26a353[_0x34fe('0x37')]['includeAll']){_0x2a9df8[_0x34fe('0x44')]=[{'all':!![]}];}return db[_0x34fe('0x2f')][_0x34fe('0x45')](_0x2a9df8);})[_0x34fe('0x29')](function(_0x487b64){_0x5ac6d6[_0x34fe('0x46')]=_0x487b64;return _0x5ac6d6;})[_0x34fe('0x29')](respondWithFilteredResult(_0x52baff,_0x2a9df8))[_0x34fe('0x47')](handleError(_0x52baff,null));};exports[_0x34fe('0x48')]=function(_0x26cdd,_0x21483f){var _0x3cd47f={'raw':!![],'where':{'id':_0x26cdd[_0x34fe('0x49')]['id']}},_0x1c7c63={};_0x1c7c63[_0x34fe('0x34')]=_['keys'](db[_0x34fe('0x2f')][_0x34fe('0x30')]);_0x1c7c63['query']=_[_0x34fe('0x35')](_0x26cdd[_0x34fe('0x37')]);_0x1c7c63[_0x34fe('0x36')]=_[_0x34fe('0x39')](_0x1c7c63['model'],_0x1c7c63['query']);_0x3cd47f['attributes']=_[_0x34fe('0x39')](_0x1c7c63[_0x34fe('0x34')],qs['fields'](_0x26cdd[_0x34fe('0x37')][_0x34fe('0x3a')]));_0x3cd47f[_0x34fe('0x38')]=_0x3cd47f[_0x34fe('0x38')]['length']?_0x3cd47f[_0x34fe('0x38')]:_0x1c7c63['model'];if(_0x26cdd[_0x34fe('0x37')][_0x34fe('0x4a')]){_0x3cd47f[_0x34fe('0x44')]=[{'all':!![]}];}_0x3cd47f=_['merge']({},_0x3cd47f,_0x26cdd['options']);return db['ChatTransferReport'][_0x34fe('0x4b')](_0x3cd47f)['then'](handleEntityNotFound(_0x21483f,null))['then'](respondWithResult(_0x21483f,null))[_0x34fe('0x47')](handleError(_0x21483f,null));};exports['create']=function(_0x17ee0b,_0xfba0){return db['ChatTransferReport'][_0x34fe('0x4c')](_0x17ee0b[_0x34fe('0x4d')],{})[_0x34fe('0x29')](respondWithResult(_0xfba0,0xc9))[_0x34fe('0x47')](handleError(_0xfba0,null));};exports[_0x34fe('0x28')]=function(_0x59a002,_0x3435ec){if(_0x59a002[_0x34fe('0x4d')]['id']){delete _0x59a002[_0x34fe('0x4d')]['id'];}return db['ChatTransferReport'][_0x34fe('0x4b')]({'where':{'id':_0x59a002[_0x34fe('0x49')]['id']}})['then'](handleEntityNotFound(_0x3435ec,null))[_0x34fe('0x29')](saveUpdates(_0x59a002['body'],null))[_0x34fe('0x29')](respondWithResult(_0x3435ec,null))['catch'](handleError(_0x3435ec,null));};exports[_0x34fe('0x2a')]=function(_0x2a67e5,_0x522ac0){return db['ChatTransferReport'][_0x34fe('0x4b')]({'where':{'id':_0x2a67e5[_0x34fe('0x49')]['id']}})[_0x34fe('0x29')](handleEntityNotFound(_0x522ac0,null))[_0x34fe('0x29')](removeEntity(_0x522ac0,null))['catch'](handleError(_0x522ac0,null));};exports['describe']=function(_0x327c72,_0x163508){return db[_0x34fe('0x2f')][_0x34fe('0x4e')]()['then'](respondWithResult(_0x163508,null))['catch'](handleError(_0x163508,null));};
\ No newline at end of file
+var _0x403c=['querystring','papaparse','ioredis','../../components/parsers/qs','api','../../config/utils','../../config/environment','../../mysqldb','status','json','undefined','limit','count','offset','set','save','update','then','destroy','end','sendStatus','error','name','send','ChatTransferReport','fieldName','type','key','map','query','keys','intersection','model','fields','attributes','length','hasOwnProperty','order','sort','where','filters','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','params','rawAttributes','create','body','describe','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','ejs','lodash','squel','jsforce','desk.js','to-csv'];(function(_0x422368,_0x3389f4){var _0x485915=function(_0x3be74e){while(--_0x3be74e){_0x422368['push'](_0x422368['shift']());}};_0x485915(++_0x3389f4);}(_0x403c,0x154));var _0xc403=function(_0x35db81,_0x1d47a7){_0x35db81=_0x35db81-0x0;var _0x1e4bfc=_0x403c[_0x35db81];return _0x1e4bfc;};'use strict';var emlformat=require(_0xc403('0x0'));var rimraf=require(_0xc403('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xc403('0x2'));var rp=require(_0xc403('0x3'));var moment=require(_0xc403('0x4'));var BPromise=require(_0xc403('0x5'));var Mustache=require(_0xc403('0x6'));var util=require('util');var path=require(_0xc403('0x7'));var sox=require(_0xc403('0x8'));var csv=require('to-csv');var ejs=require(_0xc403('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xc403('0xa'));var squel=require(_0xc403('0xb'));var crypto=require('crypto');var jsforce=require(_0xc403('0xc'));var deskjs=require(_0xc403('0xd'));var toCsv=require(_0xc403('0xe'));var querystring=require(_0xc403('0xf'));var Papa=require(_0xc403('0x10'));var Redis=require(_0xc403('0x11'));var authService=require('../../components/auth/service');var qs=require(_0xc403('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0xc403('0x13'));var utils=require(_0xc403('0x14'));var config=require(_0xc403('0x15'));var licenseUtil=require('../../config/license/util');var db=require(_0xc403('0x16'))['db'];function respondWithStatusCode(_0x4b6346,_0x44c502){_0x44c502=_0x44c502||0xcc;return function(_0x2f22cc){if(_0x2f22cc){return _0x4b6346['sendStatus'](_0x44c502);}return _0x4b6346[_0xc403('0x17')](_0x44c502)['end']();};}function respondWithResult(_0x47b964,_0x5ec669){_0x5ec669=_0x5ec669||0xc8;return function(_0x23d5c5){if(_0x23d5c5){return _0x47b964[_0xc403('0x17')](_0x5ec669)[_0xc403('0x18')](_0x23d5c5);}};}function respondWithFilteredResult(_0xcdb565,_0x17c838){return function(_0x1300b5){if(_0x1300b5){var _0x16396b=typeof _0x17c838['offset']===_0xc403('0x19')&&typeof _0x17c838[_0xc403('0x1a')]===_0xc403('0x19');var _0x2c8014=_0x1300b5[_0xc403('0x1b')];var _0x63bf1=_0x16396b?0x0:_0x17c838[_0xc403('0x1c')];var _0x4daac7=_0x16396b?_0x1300b5[_0xc403('0x1b')]:_0x17c838['offset']+_0x17c838[_0xc403('0x1a')];var _0x52e4a9;if(_0x4daac7>=_0x2c8014){_0x4daac7=_0x2c8014;_0x52e4a9=0xc8;}else{_0x52e4a9=0xce;}_0xcdb565[_0xc403('0x17')](_0x52e4a9);return _0xcdb565[_0xc403('0x1d')]('Content-Range',_0x63bf1+'-'+_0x4daac7+'/'+_0x2c8014)[_0xc403('0x18')](_0x1300b5);}return null;};}function patchUpdates(_0x2b6d31){return function(_0x3760ab){try{jsonpatch['apply'](_0x3760ab,_0x2b6d31,!![]);}catch(_0x54aa6f){return BPromise['reject'](_0x54aa6f);}return _0x3760ab[_0xc403('0x1e')]();};}function saveUpdates(_0xba171f,_0x1f2f9b){return function(_0x8be992){if(_0x8be992){return _0x8be992[_0xc403('0x1f')](_0xba171f)[_0xc403('0x20')](function(_0xdcde55){return _0xdcde55;});}return null;};}function removeEntity(_0x2fa4d5,_0x210112){return function(_0x2cb2ed){if(_0x2cb2ed){return _0x2cb2ed[_0xc403('0x21')]()[_0xc403('0x20')](function(){_0x2fa4d5[_0xc403('0x17')](0xcc)[_0xc403('0x22')]();});}};}function handleEntityNotFound(_0x2193d3,_0x4dc51b){return function(_0x3feb62){if(!_0x3feb62){_0x2193d3[_0xc403('0x23')](0x194);}return _0x3feb62;};}function handleError(_0x1c531d,_0x2f6ab3){_0x2f6ab3=_0x2f6ab3||0x1f4;return function(_0x3eb0f4){logger[_0xc403('0x24')](_0x3eb0f4['stack']);if(_0x3eb0f4[_0xc403('0x25')]){delete _0x3eb0f4[_0xc403('0x25')];}_0x1c531d[_0xc403('0x17')](_0x2f6ab3)[_0xc403('0x26')](_0x3eb0f4);};}exports['index']=function(_0x266b21,_0x59c875){var _0x5e31c1={},_0x4e76d3={},_0x1b8bf0={'count':0x0,'rows':[]};var _0x2ef882=_['map'](db[_0xc403('0x27')]['rawAttributes'],function(_0x103739){return{'name':_0x103739[_0xc403('0x28')],'type':_0x103739[_0xc403('0x29')][_0xc403('0x2a')]};});_0x4e76d3['model']=_[_0xc403('0x2b')](_0x2ef882,_0xc403('0x25'));_0x4e76d3[_0xc403('0x2c')]=_[_0xc403('0x2d')](_0x266b21[_0xc403('0x2c')]);_0x4e76d3['filters']=_[_0xc403('0x2e')](_0x4e76d3['model'],_0x4e76d3[_0xc403('0x2c')]);_0x5e31c1['attributes']=_['intersection'](_0x4e76d3[_0xc403('0x2f')],qs['fields'](_0x266b21[_0xc403('0x2c')][_0xc403('0x30')]));_0x5e31c1[_0xc403('0x31')]=_0x5e31c1[_0xc403('0x31')][_0xc403('0x32')]?_0x5e31c1[_0xc403('0x31')]:_0x4e76d3[_0xc403('0x2f')];if(!_0x266b21['query'][_0xc403('0x33')]('nolimit')){_0x5e31c1['limit']=qs[_0xc403('0x1a')](_0x266b21['query'][_0xc403('0x1a')]);_0x5e31c1[_0xc403('0x1c')]=qs[_0xc403('0x1c')](_0x266b21['query'][_0xc403('0x1c')]);}_0x5e31c1[_0xc403('0x34')]=qs[_0xc403('0x35')](_0x266b21[_0xc403('0x2c')][_0xc403('0x35')]);_0x5e31c1[_0xc403('0x36')]=qs[_0xc403('0x37')](_['pick'](_0x266b21[_0xc403('0x2c')],_0x4e76d3[_0xc403('0x37')]),_0x2ef882);if(_0x266b21['query'][_0xc403('0x38')]){_0x5e31c1[_0xc403('0x36')]=_[_0xc403('0x39')](_0x5e31c1[_0xc403('0x36')],{'$or':_[_0xc403('0x2b')](_0x2ef882,function(_0xd46381){if(_0xd46381[_0xc403('0x29')]!==_0xc403('0x3a')){var _0x3d2694={};_0x3d2694[_0xd46381[_0xc403('0x25')]]={'$like':'%'+_0x266b21[_0xc403('0x2c')][_0xc403('0x38')]+'%'};return _0x3d2694;}})});}_0x5e31c1=_[_0xc403('0x39')]({},_0x5e31c1,_0x266b21[_0xc403('0x3b')]);var _0x4300ba={'where':_0x5e31c1[_0xc403('0x36')]};return db['ChatTransferReport'][_0xc403('0x1b')](_0x4300ba)[_0xc403('0x20')](function(_0x495a65){_0x1b8bf0[_0xc403('0x1b')]=_0x495a65;if(_0x266b21[_0xc403('0x2c')][_0xc403('0x3c')]){_0x5e31c1[_0xc403('0x3d')]=[{'all':!![]}];}return db[_0xc403('0x27')][_0xc403('0x3e')](_0x5e31c1);})[_0xc403('0x20')](function(_0x46e831){_0x1b8bf0[_0xc403('0x3f')]=_0x46e831;return _0x1b8bf0;})[_0xc403('0x20')](respondWithFilteredResult(_0x59c875,_0x5e31c1))[_0xc403('0x40')](handleError(_0x59c875,null));};exports[_0xc403('0x41')]=function(_0x396a15,_0x520ebb){var _0x112f56={'raw':!![],'where':{'id':_0x396a15[_0xc403('0x42')]['id']}},_0x107d58={};_0x107d58[_0xc403('0x2f')]=_[_0xc403('0x2d')](db[_0xc403('0x27')][_0xc403('0x43')]);_0x107d58['query']=_[_0xc403('0x2d')](_0x396a15['query']);_0x107d58[_0xc403('0x37')]=_['intersection'](_0x107d58['model'],_0x107d58[_0xc403('0x2c')]);_0x112f56[_0xc403('0x31')]=_[_0xc403('0x2e')](_0x107d58[_0xc403('0x2f')],qs[_0xc403('0x30')](_0x396a15['query'][_0xc403('0x30')]));_0x112f56['attributes']=_0x112f56[_0xc403('0x31')][_0xc403('0x32')]?_0x112f56[_0xc403('0x31')]:_0x107d58[_0xc403('0x2f')];if(_0x396a15[_0xc403('0x2c')][_0xc403('0x3c')]){_0x112f56['include']=[{'all':!![]}];}_0x112f56=_[_0xc403('0x39')]({},_0x112f56,_0x396a15[_0xc403('0x3b')]);return db[_0xc403('0x27')]['find'](_0x112f56)[_0xc403('0x20')](handleEntityNotFound(_0x520ebb,null))[_0xc403('0x20')](respondWithResult(_0x520ebb,null))['catch'](handleError(_0x520ebb,null));};exports['create']=function(_0x2da9b2,_0x54f0df){return db['ChatTransferReport'][_0xc403('0x44')](_0x2da9b2[_0xc403('0x45')],{})[_0xc403('0x20')](respondWithResult(_0x54f0df,0xc9))['catch'](handleError(_0x54f0df,null));};exports[_0xc403('0x1f')]=function(_0x29f9f8,_0x377b2c){if(_0x29f9f8[_0xc403('0x45')]['id']){delete _0x29f9f8['body']['id'];}return db[_0xc403('0x27')]['find']({'where':{'id':_0x29f9f8[_0xc403('0x42')]['id']}})['then'](handleEntityNotFound(_0x377b2c,null))[_0xc403('0x20')](saveUpdates(_0x29f9f8[_0xc403('0x45')],null))[_0xc403('0x20')](respondWithResult(_0x377b2c,null))['catch'](handleError(_0x377b2c,null));};exports[_0xc403('0x21')]=function(_0x21002a,_0x27863d){return db[_0xc403('0x27')]['find']({'where':{'id':_0x21002a[_0xc403('0x42')]['id']}})[_0xc403('0x20')](handleEntityNotFound(_0x27863d,null))['then'](removeEntity(_0x27863d,null))[_0xc403('0x40')](handleError(_0x27863d,null));};exports[_0xc403('0x46')]=function(_0x123b12,_0x4fec0e){return db[_0xc403('0x27')][_0xc403('0x46')]()[_0xc403('0x20')](respondWithResult(_0x4fec0e,null))['catch'](handleError(_0x4fec0e,null));};
\ No newline at end of file
diff --git a/server/api/chatTransferReport/chatTransferReport.model.js b/server/api/chatTransferReport/chatTransferReport.model.js
index 8f78afa..e9b6877 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 _0xdfd4=['util','../../config/logger','moment','bluebird','request-promise','path','rimraf','../../config/environment','./chatTransferReport.attributes','exports','ChatTransferReport','report_chat_transfer','lodash'];(function(_0x1b5e0b,_0x5076dc){var _0x5bff09=function(_0x33532e){while(--_0x33532e){_0x1b5e0b['push'](_0x1b5e0b['shift']());}};_0x5bff09(++_0x5076dc);}(_0xdfd4,0x1c6));var _0x4dfd=function(_0x2c972c,_0x2e7314){_0x2c972c=_0x2c972c-0x0;var _0x14e1b2=_0xdfd4[_0x2c972c];return _0x14e1b2;};'use strict';var _=require(_0x4dfd('0x0'));var util=require(_0x4dfd('0x1'));var logger=require(_0x4dfd('0x2'))('api');var moment=require(_0x4dfd('0x3'));var BPromise=require(_0x4dfd('0x4'));var rp=require(_0x4dfd('0x5'));var fs=require('fs');var path=require(_0x4dfd('0x6'));var rimraf=require(_0x4dfd('0x7'));var config=require(_0x4dfd('0x8'));var attributes=require(_0x4dfd('0x9'));module[_0x4dfd('0xa')]=function(_0x566144,_0x3abe0d){return _0x566144['define'](_0x4dfd('0xb'),attributes,{'tableName':_0x4dfd('0xc'),'paranoid':![],'indexes':[{'name':'uniqueid','fields':['uniqueid']}],'timestamps':!![]});};
\ No newline at end of file
+var _0x8cd0=['ChatTransferReport','report_chat_transfer','uniqueid','lodash','util','../../config/logger','api','moment','bluebird','request-promise','rimraf','../../config/environment','./chatTransferReport.attributes','exports','define'];(function(_0x29c896,_0x1084c3){var _0x2c654c=function(_0x54023e){while(--_0x54023e){_0x29c896['push'](_0x29c896['shift']());}};_0x2c654c(++_0x1084c3);}(_0x8cd0,0x8a));var _0x08cd=function(_0x4983c6,_0x4de316){_0x4983c6=_0x4983c6-0x0;var _0x526182=_0x8cd0[_0x4983c6];return _0x526182;};'use strict';var _=require(_0x08cd('0x0'));var util=require(_0x08cd('0x1'));var logger=require(_0x08cd('0x2'))(_0x08cd('0x3'));var moment=require(_0x08cd('0x4'));var BPromise=require(_0x08cd('0x5'));var rp=require(_0x08cd('0x6'));var fs=require('fs');var path=require('path');var rimraf=require(_0x08cd('0x7'));var config=require(_0x08cd('0x8'));var attributes=require(_0x08cd('0x9'));module[_0x08cd('0xa')]=function(_0x44c49a,_0x263125){return _0x44c49a[_0x08cd('0xb')](_0x08cd('0xc'),attributes,{'tableName':_0x08cd('0xd'),'paranoid':![],'indexes':[{'name':_0x08cd('0xe'),'fields':[_0x08cd('0xe')]}],'timestamps':!![]});};
\ No newline at end of file
diff --git a/server/api/chatTransferReport/chatTransferReport.rpc.js b/server/api/chatTransferReport/chatTransferReport.rpc.js
index dcc13a2..df571ba 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 _0xdd9e=['ChatTransferReport,\x20%s,\x20%s','message','catch','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','debug','request\x20sent','stringify','error'];(function(_0x12b683,_0x124186){var _0xfb150b=function(_0x565ce7){while(--_0x565ce7){_0x12b683['push'](_0x12b683['shift']());}};_0xfb150b(++_0x124186);}(_0xdd9e,0xd2));var _0xedd9=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0xdd9e[_0x321bb2];return _0x9c12ed;};'use strict';var _=require('lodash');var util=require(_0xedd9('0x0'));var moment=require(_0xedd9('0x1'));var BPromise=require(_0xedd9('0x2'));var rs=require(_0xedd9('0x3'));var fs=require('fs');var Redis=require(_0xedd9('0x4'));var db=require(_0xedd9('0x5'))['db'];var utils=require(_0xedd9('0x6'));var logger=require(_0xedd9('0x7'))(_0xedd9('0x8'));var config=require(_0xedd9('0x9'));var jayson=require(_0xedd9('0xa'));var client=jayson[_0xedd9('0xb')][_0xedd9('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x3601ed,_0xbf0ffa,_0x18ad2e){return new BPromise(function(_0x245122,_0x293a1e){return client[_0xedd9('0xd')](_0x3601ed,_0x18ad2e)[_0xedd9('0xe')](function(_0x33b07a){logger[_0xedd9('0xf')]('ChatTransferReport,\x20%s,\x20%s',_0xbf0ffa,'request\x20sent');logger[_0xedd9('0x10')]('ChatTransferReport,\x20%s,\x20%s,\x20%s',_0xbf0ffa,_0xedd9('0x11'),JSON[_0xedd9('0x12')](_0x33b07a));if(_0x33b07a[_0xedd9('0x13')]){if(_0x33b07a[_0xedd9('0x13')]['code']===0x1f4){logger[_0xedd9('0x13')](_0xedd9('0x14'),_0xbf0ffa,_0x33b07a[_0xedd9('0x13')]['message']);return _0x293a1e(_0x33b07a[_0xedd9('0x13')]['message']);}logger[_0xedd9('0x13')](_0xedd9('0x14'),_0xbf0ffa,_0x33b07a['error'][_0xedd9('0x15')]);return _0x245122(_0x33b07a['error']['message']);}else{logger[_0xedd9('0xf')]('ChatTransferReport,\x20%s,\x20%s',_0xbf0ffa,_0xedd9('0x11'));_0x245122(_0x33b07a['result']['message']);}})[_0xedd9('0x16')](function(_0x8eae34){logger[_0xedd9('0x13')](_0xedd9('0x14'),_0xbf0ffa,_0x8eae34);_0x293a1e(_0x8eae34);});});}
\ No newline at end of file
+var _0x0d01=['util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/environment','jayson/promise','http','request','info','ChatTransferReport,\x20%s,\x20%s','request\x20sent','ChatTransferReport,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','lodash'];(function(_0x806894,_0x1a62d7){var _0x5db622=function(_0x1ba7ac){while(--_0x1ba7ac){_0x806894['push'](_0x806894['shift']());}};_0x5db622(++_0x1a62d7);}(_0x0d01,0x9f));var _0x10d0=function(_0x2f4feb,_0x5e7224){_0x2f4feb=_0x2f4feb-0x0;var _0x2e4253=_0x0d01[_0x2f4feb];return _0x2e4253;};'use strict';var _=require(_0x10d0('0x0'));var util=require(_0x10d0('0x1'));var moment=require(_0x10d0('0x2'));var BPromise=require(_0x10d0('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x10d0('0x4'));var db=require(_0x10d0('0x5'))['db'];var utils=require(_0x10d0('0x6'));var logger=require('../../config/logger')('rpc');var config=require(_0x10d0('0x7'));var jayson=require(_0x10d0('0x8'));var client=jayson['client'][_0x10d0('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x3c6343,_0x3ac141,_0x8bed1){return new BPromise(function(_0x303b53,_0x4b9dbb){return client[_0x10d0('0xa')](_0x3c6343,_0x8bed1)['then'](function(_0x9f6b65){logger[_0x10d0('0xb')](_0x10d0('0xc'),_0x3ac141,_0x10d0('0xd'));logger['debug'](_0x10d0('0xe'),_0x3ac141,_0x10d0('0xd'),JSON['stringify'](_0x9f6b65));if(_0x9f6b65[_0x10d0('0xf')]){if(_0x9f6b65['error'][_0x10d0('0x10')]===0x1f4){logger[_0x10d0('0xf')](_0x10d0('0xc'),_0x3ac141,_0x9f6b65[_0x10d0('0xf')][_0x10d0('0x11')]);return _0x4b9dbb(_0x9f6b65['error'][_0x10d0('0x11')]);}logger['error'](_0x10d0('0xc'),_0x3ac141,_0x9f6b65[_0x10d0('0xf')][_0x10d0('0x11')]);return _0x303b53(_0x9f6b65[_0x10d0('0xf')][_0x10d0('0x11')]);}else{logger[_0x10d0('0xb')](_0x10d0('0xc'),_0x3ac141,_0x10d0('0xd'));_0x303b53(_0x9f6b65[_0x10d0('0x12')]['message']);}})[_0x10d0('0x13')](function(_0x287b33){logger[_0x10d0('0xf')](_0x10d0('0xc'),_0x3ac141,_0x287b33);_0x4b9dbb(_0x287b33);});});}
\ No newline at end of file
diff --git a/server/api/chatTransferReport/index.js b/server/api/chatTransferReport/index.js
index 41acbe9..972b4de 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 _0x4c86=['isAuthenticated','show','post','put','update','destroy','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatTransferReport.controller','get','/describe','/:id'];(function(_0x49b207,_0x408ade){var _0x2dc8fa=function(_0x150975){while(--_0x150975){_0x49b207['push'](_0x49b207['shift']());}};_0x2dc8fa(++_0x408ade);}(_0x4c86,0x1f4));var _0x64c8=function(_0x200c3e,_0x51daa3){_0x200c3e=_0x200c3e-0x0;var _0x2e2024=_0x4c86[_0x200c3e];return _0x2e2024;};'use strict';var multer=require('multer');var util=require(_0x64c8('0x0'));var path=require(_0x64c8('0x1'));var timeout=require(_0x64c8('0x2'));var express=require(_0x64c8('0x3'));var router=express[_0x64c8('0x4')]();var fs_extra=require(_0x64c8('0x5'));var auth=require(_0x64c8('0x6'));var interaction=require(_0x64c8('0x7'));var config=require(_0x64c8('0x8'));var controller=require(_0x64c8('0x9'));router[_0x64c8('0xa')]('/',auth['isAuthenticated'](),controller['index']);router[_0x64c8('0xa')](_0x64c8('0xb'),auth['isAuthenticated'](),controller['describe']);router['get'](_0x64c8('0xc'),auth[_0x64c8('0xd')](),controller[_0x64c8('0xe')]);router[_0x64c8('0xf')]('/',auth[_0x64c8('0xd')](),controller['create']);router[_0x64c8('0x10')]('/:id',auth[_0x64c8('0xd')](),controller[_0x64c8('0x11')]);router['delete'](_0x64c8('0xc'),auth['isAuthenticated'](),controller[_0x64c8('0x12')]);module['exports']=router;
\ No newline at end of file
+var _0xbba0=['exports','multer','util','path','connect-timeout','express','Router','../../components/interaction/service','./chatTransferReport.controller','isAuthenticated','index','get','/describe','/:id','show','create','put','update','delete','destroy'];(function(_0x564e8c,_0x43d143){var _0x3e7ac0=function(_0x2ceb53){while(--_0x2ceb53){_0x564e8c['push'](_0x564e8c['shift']());}};_0x3e7ac0(++_0x43d143);}(_0xbba0,0x1b9));var _0x0bba=function(_0x36eaaa,_0x326732){_0x36eaaa=_0x36eaaa-0x0;var _0x461349=_0xbba0[_0x36eaaa];return _0x461349;};'use strict';var multer=require(_0x0bba('0x0'));var util=require(_0x0bba('0x1'));var path=require(_0x0bba('0x2'));var timeout=require(_0x0bba('0x3'));var express=require(_0x0bba('0x4'));var router=express[_0x0bba('0x5')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0x0bba('0x6'));var config=require('../../config/environment');var controller=require(_0x0bba('0x7'));router['get']('/',auth[_0x0bba('0x8')](),controller[_0x0bba('0x9')]);router[_0x0bba('0xa')](_0x0bba('0xb'),auth[_0x0bba('0x8')](),controller['describe']);router[_0x0bba('0xa')](_0x0bba('0xc'),auth[_0x0bba('0x8')](),controller[_0x0bba('0xd')]);router['post']('/',auth[_0x0bba('0x8')](),controller[_0x0bba('0xe')]);router[_0x0bba('0xf')](_0x0bba('0xc'),auth['isAuthenticated'](),controller[_0x0bba('0x10')]);router[_0x0bba('0x11')](_0x0bba('0xc'),auth[_0x0bba('0x8')](),controller[_0x0bba('0x12')]);module[_0x0bba('0x13')]=router;
\ No newline at end of file
diff --git a/server/api/chatWebsite/chatWebsite.attributes.js b/server/api/chatWebsite/chatWebsite.attributes.js
index 789be21..e1619b1 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 _0x13d5=['Thanks\x20you\x20for\x20your\x20time!','Skip','Feedback','star','thumb','stringify','name','text','input','getDataValue','onlineForm','setDataValue','textarea','Comments','Leave\x20your\x20comments','offlineForm','generate','All\x20of\x20our\x20agents\x20are\x20busy\x20at\x20this\x20time.\x20Your\x20chat\x20is\x20very\x20important\x20to\x20us.','Please\x20hold\x20and\x20we\x20will\x20answer\x20your\x20request\x20as\x20soon\x20as\x20possible.','New\x20offline\x20message\x20from\x20websiteName','You\x20received\x20a\x20new\x20offline\x20message\x20from\x20websiteName.\x20Here\x20you\x20can\x20find\x20the\x20details\x20of\x20the\x20request:','bottom_right','alternate','System','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','mandatoryDispositionPauseId','mandatoryDisposition','Generated\x20by\x20XCALLY\x20Motion','randomstring','STRING','email','Agent','#011F6A','#ffffff','INTEGER','BOOLEAN','ENUM','rounded','We\x20are\x20here!','Chat','Send','Contact\x20us','Powered\x20by\x20xCALLY','TEXT','Form\x20properly\x20submitted','Form\x20submission\x20error','Note','Type\x20a\x20message'];(function(_0x5a8eee,_0x839e0f){var _0x55f00a=function(_0x198fdd){while(--_0x198fdd){_0x5a8eee['push'](_0x5a8eee['shift']());}};_0x55f00a(++_0x839e0f);}(_0x13d5,0x19c));var _0x513d=function(_0x5184ce,_0x2e4489){_0x5184ce=_0x5184ce-0x0;var _0x4e253a=_0x13d5[_0x5184ce];return _0x4e253a;};'use strict';var Sequelize=require('sequelize');var rs=require(_0x513d('0x0'));module['exports']={'name':{'type':Sequelize[_0x513d('0x1')],'allowNull':![]},'address':{'type':Sequelize[_0x513d('0x1')],'allowNull':![],'unique':'address'},'description':{'type':Sequelize[_0x513d('0x1')]},'mapKey':{'type':Sequelize['STRING'],'defaultValue':_0x513d('0x2')},'mapKeyOffline':{'type':Sequelize['STRING'],'defaultValue':_0x513d('0x2')},'key':{'type':Sequelize['STRING'],'allowNull':![]},'agentAlias':{'type':Sequelize[_0x513d('0x1')],'defaultValue':_0x513d('0x3')},'customerAlias':{'type':Sequelize[_0x513d('0x1')],'defaultValue':'Me'},'color':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0x513d('0x4'),'validate':{'notEmpty':!![]}},'color_button':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0x513d('0x4'),'validate':{'notEmpty':!![]}},'textColor':{'type':Sequelize[_0x513d('0x1')],'allowNull':![],'defaultValue':_0x513d('0x5'),'validate':{'notEmpty':!![]}},'fontSize':{'type':Sequelize[_0x513d('0x6')],'defaultValue':0xf},'remote':{'type':Sequelize[_0x513d('0x1')]},'animation':{'type':Sequelize[_0x513d('0x7')],'defaultValue':!![]},'header_shape':{'type':Sequelize[_0x513d('0x8')](_0x513d('0x9'),'squared'),'defaultValue':_0x513d('0x9')},'header_online':{'type':Sequelize[_0x513d('0x1')],'defaultValue':_0x513d('0xa')},'start_chat_button':{'type':Sequelize[_0x513d('0x1')],'defaultValue':_0x513d('0xb')},'offline_chat_button':{'type':Sequelize[_0x513d('0x1')],'defaultValue':_0x513d('0xc')},'header_offline':{'type':Sequelize[_0x513d('0x1')],'defaultValue':_0x513d('0xd')},'download_transcript':{'type':Sequelize[_0x513d('0x7')],'defaultValue':!![]},'timeout':{'type':Sequelize[_0x513d('0x6')],'defaultValue':0x0},'whiteLabel':{'type':Sequelize['STRING'],'defaultValue':_0x513d('0xe')},'defaultWhiteLabel':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'sitepic':{'type':Sequelize[_0x513d('0xf')]},'closingQuestion':{'type':Sequelize[_0x513d('0x1')],'defaultValue':'Do\x20you\x20want\x20to\x20close\x20the\x20interaction?'},'formSubmitSuccessMessage':{'type':Sequelize['STRING'],'defaultValue':_0x513d('0x10')},'formSubmitFailureMessage':{'type':Sequelize[_0x513d('0x1')],'defaultValue':_0x513d('0x11')},'noteTitle':{'type':Sequelize[_0x513d('0x1')],'defaultValue':_0x513d('0x12')},'placeholderMessage':{'type':Sequelize[_0x513d('0x1')],'defaultValue':_0x513d('0x13')},'closingMessage':{'type':Sequelize[_0x513d('0x1')],'defaultValue':_0x513d('0x14')},'closingMessageButton':{'type':Sequelize['STRING'],'defaultValue':'Send'},'skipMessageButton':{'type':Sequelize[_0x513d('0x1')],'defaultValue':_0x513d('0x15')},'conditionAgreement':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'enableRating':{'type':Sequelize[_0x513d('0x7')],'defaultValue':![]},'enableFeedback':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'enableSendButton':{'type':Sequelize[_0x513d('0x7')],'defaultValue':![]},'feedbackTitle':{'type':Sequelize['STRING'],'defaultValue':_0x513d('0x16')},'ratingType':{'type':Sequelize[_0x513d('0x8')](_0x513d('0x17'),_0x513d('0x18')),'defaultValue':_0x513d('0x17')},'ratingStarsNumber':{'type':Sequelize['INTEGER'],'defaultValue':0x5},'onlineForm':{'type':Sequelize[_0x513d('0xf')],'defaultValue':function(){return JSON[_0x513d('0x19')]({'items':[{'type':'input','variable':null,'config':{'placeholder':_0x513d('0x1a'),'type':_0x513d('0x1b'),'required':!![]},'props':{'title':_0x513d('0x1a'),'helpText':''}},{'type':_0x513d('0x1c'),'props':{'title':_0x513d('0x2'),'helpText':''},'config':{'required':!![],'placeholder':_0x513d('0x2'),'type':_0x513d('0x2')},'variable':null}],'fromKey':0x1});},'get':function(){return this[_0x513d('0x1d')](_0x513d('0x1e'))?JSON['parse'](this[_0x513d('0x1d')](_0x513d('0x1e'))):{};},'set':function(_0x1b7f2a){return this[_0x513d('0x1f')](_0x513d('0x1e'),JSON[_0x513d('0x19')](_0x1b7f2a));}},'offlineForm':{'type':Sequelize[_0x513d('0xf')],'defaultValue':function(){return JSON[_0x513d('0x19')]({'items':[{'type':_0x513d('0x1c'),'props':{'title':'email','helpText':''},'config':{'required':!![],'placeholder':_0x513d('0x2'),'type':_0x513d('0x2')},'variable':null},{'type':_0x513d('0x20'),'config':{'placeholder':_0x513d('0x21')},'props':{'title':_0x513d('0x21'),'helpText':_0x513d('0x22')}}],'fromKey':0x0});},'get':function(){return this[_0x513d('0x1d')]('offlineForm')?JSON['parse'](this[_0x513d('0x1d')](_0x513d('0x23'))):{};},'set':function(_0x340785){return this[_0x513d('0x1f')]('offlineForm',JSON[_0x513d('0x19')](_0x340785));}},'token':{'type':Sequelize['STRING'],'defaultValue':function(){return rs[_0x513d('0x24')]();}},'autoclose':{'type':Sequelize[_0x513d('0x7')],'defaultValue':!![]},'enableCustomerWriting':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'forwardTranscript':{'type':Sequelize[_0x513d('0x7')],'defaultValue':![]},'forwardTranscriptMessage':{'type':Sequelize[_0x513d('0x1')]},'forwardOffline':{'type':Sequelize[_0x513d('0x7')],'defaultValue':![]},'forwardOfflineAddress':{'type':Sequelize[_0x513d('0x1')]},'waitingTitle':{'type':Sequelize[_0x513d('0x1')],'defaultValue':_0x513d('0x25')},'waitingMessage':{'type':Sequelize[_0x513d('0x1')],'defaultValue':_0x513d('0x26')},'offlineMessageSubject':{'type':Sequelize[_0x513d('0x1')],'defaultValue':_0x513d('0x27')},'offlineMessageBody':{'type':Sequelize[_0x513d('0x1')],'defaultValue':_0x513d('0x28')},'enableUnmanagedNote':{'type':Sequelize[_0x513d('0x7')],'defaultValue':!![]},'unmanagedMessage':{'type':Sequelize[_0x513d('0x1')],'defaultValue':'Your\x20request\x20has\x20not\x20been\x20processed.'},'skipUnmanaged':{'type':Sequelize[_0x513d('0x1')],'defaultValue':'Skip'},'sendUnmanaged':{'type':Sequelize[_0x513d('0x1')],'defaultValue':_0x513d('0xc')},'enableCustomerAttachment':{'type':Sequelize[_0x513d('0x7')],'defaultValue':![]},'enableCustomerCheckmarks':{'type':Sequelize[_0x513d('0x7')],'defaultValue':![]},'agentAvatar':{'type':Sequelize['TEXT']},'showAgentAvatar':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'timezone':{'type':Sequelize[_0x513d('0x1')]},'notificationTemplate':{'type':Sequelize[_0x513d('0xf')],'defaultValue':function(){return'Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}';}},'notificationSound':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'notificationShake':{'type':Sequelize[_0x513d('0x7')],'defaultValue':![]},'hideWhenOffline':{'type':Sequelize[_0x513d('0x7')],'defaultValue':![]},'agentIdentifier':{'type':Sequelize[_0x513d('0x1')],'defaultValue':'website_alias'},'waitForTheAssignedAgent':{'type':Sequelize[_0x513d('0x6')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'alignment':{'type':Sequelize[_0x513d('0x1')],'defaultValue':_0x513d('0x29')},'verticalAlignment':{'type':Sequelize[_0x513d('0x6')],'defaultValue':0x1e},'messagesAlignment':{'type':Sequelize[_0x513d('0x1')],'defaultValue':_0x513d('0x2a')},'defaultTitle':{'type':Sequelize[_0x513d('0x1')]},'customerAvatar':{'type':Sequelize[_0x513d('0xf')]},'showCustomerAvatar':{'type':Sequelize[_0x513d('0x7')],'defaultValue':![]},'messageFontSize':{'type':Sequelize[_0x513d('0x6')],'defaultValue':0xc},'backgroundColor':{'type':Sequelize[_0x513d('0x1')],'allowNull':![],'defaultValue':'#fafafa','validate':{'notEmpty':!![]}},'queueTransfer':{'type':Sequelize[_0x513d('0x7')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0x513d('0x6')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0x513d('0x7')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0x513d('0x6')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'systemAlias':{'type':Sequelize[_0x513d('0x1')],'defaultValue':_0x513d('0x2b')},'systemAvatar':{'type':Sequelize[_0x513d('0xf')]},'mandatoryDispositionPauseId':{'type':Sequelize[_0x513d('0x6')],'comment':_0x513d('0x2c')},'mandatoryDisposition':{'type':Sequelize[_0x513d('0x7')],'defaultValue':![],'comment':'Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','set':function(_0x230d96){if(!_0x230d96)this[_0x513d('0x1f')](_0x513d('0x2d'),null);this[_0x513d('0x1f')](_0x513d('0x2e'),_0x230d96);}},'vidaooEscalation':{'type':Sequelize[_0x513d('0x7')],'defaultValue':![]},'vidaooApiKey':{'type':Sequelize['STRING']},'vidaooTopic':{'type':Sequelize[_0x513d('0x1')],'allowNull':![],'defaultValue':_0x513d('0x2f')},'vidaooNote':{'type':Sequelize[_0x513d('0x1')],'defaultValue':function(){return'Meeting\x20generated\x20for\x20interaction\x20#{{interaction.id}}\x20by\x20{{agent.name}}';}},'vidaooMetadata':{'type':Sequelize['TEXT'],'defaultValue':null},'openNewInteraction':{'type':Sequelize[_0x513d('0x7')],'defaultValue':![],'allowNull':!![]},'subjectOffline':{'type':Sequelize['TEXT']}};
\ No newline at end of file
+var _0xecf3=['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','Your\x20request\x20has\x20not\x20been\x20processed.','Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}','website_alias','bottom_right','alternate','#fafafa','System','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','mandatoryDisposition','Meeting\x20generated\x20for\x20interaction\x20#{{interaction.id}}\x20by\x20{{agent.name}}','sequelize','randomstring','exports','STRING','address','email','#011F6A','#ffffff','INTEGER','BOOLEAN','ENUM','rounded','We\x20are\x20here!','Chat','Send','Contact\x20us','Powered\x20by\x20xCALLY','TEXT','Form\x20properly\x20submitted','Form\x20submission\x20error','Note','Type\x20a\x20message','Thanks\x20you\x20for\x20your\x20time!','Skip','Feedback','star','thumb','stringify','input','text','getDataValue','onlineForm','setDataValue','textarea','Comments','offlineForm'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xecf3,0x6f));var _0x3ecf=function(_0x2604d8,_0x445628){_0x2604d8=_0x2604d8-0x0;var _0x54e7c8=_0xecf3[_0x2604d8];return _0x54e7c8;};'use strict';var Sequelize=require(_0x3ecf('0x0'));var rs=require(_0x3ecf('0x1'));module[_0x3ecf('0x2')]={'name':{'type':Sequelize[_0x3ecf('0x3')],'allowNull':![]},'address':{'type':Sequelize['STRING'],'allowNull':![],'unique':_0x3ecf('0x4')},'description':{'type':Sequelize['STRING']},'mapKey':{'type':Sequelize[_0x3ecf('0x3')],'defaultValue':_0x3ecf('0x5')},'mapKeyOffline':{'type':Sequelize['STRING'],'defaultValue':_0x3ecf('0x5')},'key':{'type':Sequelize[_0x3ecf('0x3')],'allowNull':![]},'agentAlias':{'type':Sequelize[_0x3ecf('0x3')],'defaultValue':'Agent'},'customerAlias':{'type':Sequelize['STRING'],'defaultValue':'Me'},'color':{'type':Sequelize[_0x3ecf('0x3')],'allowNull':![],'defaultValue':_0x3ecf('0x6'),'validate':{'notEmpty':!![]}},'color_button':{'type':Sequelize[_0x3ecf('0x3')],'allowNull':![],'defaultValue':_0x3ecf('0x6'),'validate':{'notEmpty':!![]}},'textColor':{'type':Sequelize[_0x3ecf('0x3')],'allowNull':![],'defaultValue':_0x3ecf('0x7'),'validate':{'notEmpty':!![]}},'fontSize':{'type':Sequelize[_0x3ecf('0x8')],'defaultValue':0xf},'remote':{'type':Sequelize[_0x3ecf('0x3')]},'animation':{'type':Sequelize[_0x3ecf('0x9')],'defaultValue':!![]},'header_shape':{'type':Sequelize[_0x3ecf('0xa')]('rounded','squared'),'defaultValue':_0x3ecf('0xb')},'header_online':{'type':Sequelize['STRING'],'defaultValue':_0x3ecf('0xc')},'start_chat_button':{'type':Sequelize[_0x3ecf('0x3')],'defaultValue':_0x3ecf('0xd')},'offline_chat_button':{'type':Sequelize[_0x3ecf('0x3')],'defaultValue':_0x3ecf('0xe')},'header_offline':{'type':Sequelize['STRING'],'defaultValue':_0x3ecf('0xf')},'download_transcript':{'type':Sequelize[_0x3ecf('0x9')],'defaultValue':!![]},'timeout':{'type':Sequelize[_0x3ecf('0x8')],'defaultValue':0x0},'whiteLabel':{'type':Sequelize[_0x3ecf('0x3')],'defaultValue':_0x3ecf('0x10')},'defaultWhiteLabel':{'type':Sequelize[_0x3ecf('0x9')],'defaultValue':!![]},'sitepic':{'type':Sequelize[_0x3ecf('0x11')]},'closingQuestion':{'type':Sequelize['STRING'],'defaultValue':'Do\x20you\x20want\x20to\x20close\x20the\x20interaction?'},'formSubmitSuccessMessage':{'type':Sequelize[_0x3ecf('0x3')],'defaultValue':_0x3ecf('0x12')},'formSubmitFailureMessage':{'type':Sequelize['STRING'],'defaultValue':_0x3ecf('0x13')},'noteTitle':{'type':Sequelize['STRING'],'defaultValue':_0x3ecf('0x14')},'placeholderMessage':{'type':Sequelize[_0x3ecf('0x3')],'defaultValue':_0x3ecf('0x15')},'closingMessage':{'type':Sequelize[_0x3ecf('0x3')],'defaultValue':_0x3ecf('0x16')},'closingMessageButton':{'type':Sequelize[_0x3ecf('0x3')],'defaultValue':_0x3ecf('0xe')},'skipMessageButton':{'type':Sequelize[_0x3ecf('0x3')],'defaultValue':_0x3ecf('0x17')},'conditionAgreement':{'type':Sequelize[_0x3ecf('0x9')],'defaultValue':![]},'enableRating':{'type':Sequelize[_0x3ecf('0x9')],'defaultValue':![]},'enableFeedback':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'enableSendButton':{'type':Sequelize[_0x3ecf('0x9')],'defaultValue':![]},'feedbackTitle':{'type':Sequelize[_0x3ecf('0x3')],'defaultValue':_0x3ecf('0x18')},'ratingType':{'type':Sequelize[_0x3ecf('0xa')](_0x3ecf('0x19'),_0x3ecf('0x1a')),'defaultValue':_0x3ecf('0x19')},'ratingStarsNumber':{'type':Sequelize[_0x3ecf('0x8')],'defaultValue':0x5},'onlineForm':{'type':Sequelize[_0x3ecf('0x11')],'defaultValue':function(){return JSON[_0x3ecf('0x1b')]({'items':[{'type':_0x3ecf('0x1c'),'variable':null,'config':{'placeholder':'name','type':_0x3ecf('0x1d'),'required':!![]},'props':{'title':'name','helpText':''}},{'type':_0x3ecf('0x1c'),'props':{'title':_0x3ecf('0x5'),'helpText':''},'config':{'required':!![],'placeholder':_0x3ecf('0x5'),'type':_0x3ecf('0x5')},'variable':null}],'fromKey':0x1});},'get':function(){return this[_0x3ecf('0x1e')](_0x3ecf('0x1f'))?JSON['parse'](this['getDataValue']('onlineForm')):{};},'set':function(_0x43826c){return this[_0x3ecf('0x20')]('onlineForm',JSON[_0x3ecf('0x1b')](_0x43826c));}},'offlineForm':{'type':Sequelize['TEXT'],'defaultValue':function(){return JSON[_0x3ecf('0x1b')]({'items':[{'type':_0x3ecf('0x1c'),'props':{'title':_0x3ecf('0x5'),'helpText':''},'config':{'required':!![],'placeholder':'email','type':_0x3ecf('0x5')},'variable':null},{'type':_0x3ecf('0x21'),'config':{'placeholder':_0x3ecf('0x22')},'props':{'title':_0x3ecf('0x22'),'helpText':'Leave\x20your\x20comments'}}],'fromKey':0x0});},'get':function(){return this[_0x3ecf('0x1e')](_0x3ecf('0x23'))?JSON['parse'](this[_0x3ecf('0x1e')](_0x3ecf('0x23'))):{};},'set':function(_0x466813){return this[_0x3ecf('0x20')](_0x3ecf('0x23'),JSON[_0x3ecf('0x1b')](_0x466813));}},'token':{'type':Sequelize[_0x3ecf('0x3')],'defaultValue':function(){return rs['generate']();}},'autoclose':{'type':Sequelize[_0x3ecf('0x9')],'defaultValue':!![]},'enableCustomerWriting':{'type':Sequelize[_0x3ecf('0x9')],'defaultValue':![]},'forwardTranscript':{'type':Sequelize[_0x3ecf('0x9')],'defaultValue':![]},'forwardTranscriptMessage':{'type':Sequelize[_0x3ecf('0x3')]},'forwardOffline':{'type':Sequelize[_0x3ecf('0x9')],'defaultValue':![]},'forwardOfflineAddress':{'type':Sequelize[_0x3ecf('0x3')]},'waitingTitle':{'type':Sequelize['STRING'],'defaultValue':_0x3ecf('0x24')},'waitingMessage':{'type':Sequelize[_0x3ecf('0x3')],'defaultValue':_0x3ecf('0x25')},'offlineMessageSubject':{'type':Sequelize['STRING'],'defaultValue':_0x3ecf('0x26')},'offlineMessageBody':{'type':Sequelize[_0x3ecf('0x3')],'defaultValue':'You\x20received\x20a\x20new\x20offline\x20message\x20from\x20websiteName.\x20Here\x20you\x20can\x20find\x20the\x20details\x20of\x20the\x20request:'},'enableUnmanagedNote':{'type':Sequelize[_0x3ecf('0x9')],'defaultValue':!![]},'unmanagedMessage':{'type':Sequelize[_0x3ecf('0x3')],'defaultValue':_0x3ecf('0x27')},'skipUnmanaged':{'type':Sequelize['STRING'],'defaultValue':_0x3ecf('0x17')},'sendUnmanaged':{'type':Sequelize[_0x3ecf('0x3')],'defaultValue':_0x3ecf('0xe')},'enableCustomerAttachment':{'type':Sequelize[_0x3ecf('0x9')],'defaultValue':![]},'enableCustomerCheckmarks':{'type':Sequelize[_0x3ecf('0x9')],'defaultValue':![]},'agentAvatar':{'type':Sequelize[_0x3ecf('0x11')]},'showAgentAvatar':{'type':Sequelize[_0x3ecf('0x9')],'defaultValue':![]},'timezone':{'type':Sequelize['STRING']},'notificationTemplate':{'type':Sequelize[_0x3ecf('0x11')],'defaultValue':function(){return _0x3ecf('0x28');}},'notificationSound':{'type':Sequelize[_0x3ecf('0x9')],'defaultValue':!![]},'notificationShake':{'type':Sequelize[_0x3ecf('0x9')],'defaultValue':![]},'hideWhenOffline':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'agentIdentifier':{'type':Sequelize[_0x3ecf('0x3')],'defaultValue':_0x3ecf('0x29')},'waitForTheAssignedAgent':{'type':Sequelize[_0x3ecf('0x8')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'alignment':{'type':Sequelize[_0x3ecf('0x3')],'defaultValue':_0x3ecf('0x2a')},'verticalAlignment':{'type':Sequelize[_0x3ecf('0x8')],'defaultValue':0x1e},'messagesAlignment':{'type':Sequelize[_0x3ecf('0x3')],'defaultValue':_0x3ecf('0x2b')},'defaultTitle':{'type':Sequelize[_0x3ecf('0x3')]},'customerAvatar':{'type':Sequelize[_0x3ecf('0x11')]},'showCustomerAvatar':{'type':Sequelize[_0x3ecf('0x9')],'defaultValue':![]},'messageFontSize':{'type':Sequelize[_0x3ecf('0x8')],'defaultValue':0xc},'backgroundColor':{'type':Sequelize[_0x3ecf('0x3')],'allowNull':![],'defaultValue':_0x3ecf('0x2c'),'validate':{'notEmpty':!![]}},'queueTransfer':{'type':Sequelize[_0x3ecf('0x9')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0x3ecf('0x8')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0x3ecf('0x9')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0x3ecf('0x8')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'systemAlias':{'type':Sequelize[_0x3ecf('0x3')],'defaultValue':_0x3ecf('0x2d')},'systemAvatar':{'type':Sequelize[_0x3ecf('0x11')]},'mandatoryDispositionPauseId':{'type':Sequelize[_0x3ecf('0x8')],'comment':_0x3ecf('0x2e')},'mandatoryDisposition':{'type':Sequelize['BOOLEAN'],'defaultValue':![],'comment':'Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','set':function(_0x29287f){if(!_0x29287f)this[_0x3ecf('0x20')]('mandatoryDispositionPauseId',null);this[_0x3ecf('0x20')](_0x3ecf('0x2f'),_0x29287f);}},'vidaooEscalation':{'type':Sequelize[_0x3ecf('0x9')],'defaultValue':![]},'vidaooApiKey':{'type':Sequelize[_0x3ecf('0x3')]},'vidaooTopic':{'type':Sequelize[_0x3ecf('0x3')],'allowNull':![],'defaultValue':'Generated\x20by\x20XCALLY\x20Motion'},'vidaooNote':{'type':Sequelize['STRING'],'defaultValue':function(){return _0x3ecf('0x30');}},'vidaooMetadata':{'type':Sequelize[_0x3ecf('0x11')],'defaultValue':null},'openNewInteraction':{'type':Sequelize[_0x3ecf('0x9')],'defaultValue':![],'allowNull':!![]},'subjectOffline':{'type':Sequelize[_0x3ecf('0x11')]}};
\ No newline at end of file
diff --git a/server/api/chatWebsite/chatWebsite.controller.js b/server/api/chatWebsite/chatWebsite.controller.js
index 5676162..5b33bbd 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 _0x29a0=['user-agent','getResult','chat','CmContact','Sequelize','no\x20available\x20attributes','difference','createdAt','updatedAt','CompanyId','ListId','ValidationError','body\x20is\x20mandatory\x20and\x20not\x20empty','includes','mapKey','mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','List','Contacts','DESC','ChatApplication','Applications','account','list','applications','priority','asc','from','contact','customerIp','x-forwarded-for','first','firstName','lastName','x-real-port','referer','browser','version','format','unknown','%s\x20%s','device','vendor','%s\x20%s\x20%s','threadId','ContactId','interaction','ChatInteraction','spread','messageId','created','autoclose','push','close','unmanaged','ChatMessage','UserId','User','unshift','agent','waitForTheAssignedAgent','forcedOwnership','Start','startRouting','EventManager','files','mapKeyOffline\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','mapKeyOffline','mapKeyOffline\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','CmList','MailAccount','findOrCreate','readFileSync','server/files/templates/chatOfflineMessage.ejs','utf8','toPairs','offlineMessageBody','ChatOfflineMessage','originalname','server','attachments','basename','sequelize','Attachment','MailServerOut','Smtp','forwardOffline','forwardOfflineAddress','service','host','port','secure','authentication','pass','sendMail','\x22%s\x22\x20<%s>','email','openNewInteraction','MailAccountId','mimetype','subjectOffline','toPairsIn','offlineMessageSubject','offline-chat','addInteraction','omit','getInteractions','nolimit','fullname','internal','Tag','color','tag','Command','getSnippet','timezone','iftime\x20%s,%s','interval','iftime\x20%s','true','[%s][INTERVAL][%s]\x20%s\x20%s\x20(%s)','OFFLINE','No\x20timezone','inspect','Interval','Intervals','virtual','custom','License','increment','all','some','remote','x-real-ip','remoteAddress','replace','render','alignment','textColor','color_button','backgroundColor','addApplications','transaction','getApplications','getProactiveActions','ChatProactiveAction','false','offlineForm','items','fromKey','Attachments','addAgents','emit','userChatWebsite:save','removeAgents','isArray','userChatWebsite:remove','getAgents','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','to-csv','ejs','lodash','squel','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','defaults','redis','socket.io-emitter','./chatWebsite.socket','register','jayson/promise','client','http','request','ChatWebsite,\x20%s,\x20%s','request\x20sent','debug','ChatWebsite,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','catch','status','undefined','limit','count','offset','Content-Range','json','reject','save','update','destroy','then','get','ChatWebsites','end','sendStatus','name','send','map','ChatWebsite','rawAttributes','type','key','model','query','filters','intersection','attributes','length','order','pick','filter','where','merge','VIRTUAL','options','includeAll','include','findAll','rows','show','Pause','mandatoryDispositionPause','keys','fields','create','user','role','UserProfileSection','find','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','params','describe','addDisposition','ChatWebsiteId','Disposition','hasOwnProperty','sort','removeDispositions','ids','addAnswer','CannedAnswer','findOne','removeAnswers','addLogo','filename','addAvatar','agentAvatar','file','customerAvatar','addSystemAvatar','systemAvatar','join','root','server/files/images/logos/default_logo.svg','sitepic','getLicense','existsSync','server/files/images/logos/','download','getAvatar','server/files/images/avatars/default_avatar.png','isNil','server/files/images/avatars/','getCustomerAvatar','server/files/images/avatars/customer_avatar.png','showCustomerAvatar','getSystemAvatar','server/files/images/avatars/system_avatar.png','notify','user-agent-parser','setUA','headers'];(function(_0x2bd1ac,_0x113d5f){var _0x216cf2=function(_0x5395fc){while(--_0x5395fc){_0x2bd1ac['push'](_0x2bd1ac['shift']());}};_0x216cf2(++_0x113d5f);}(_0x29a0,0x9d));var _0x029a=function(_0x9b2115,_0x193abf){_0x9b2115=_0x9b2115-0x0;var _0x28d5bf=_0x29a0[_0x9b2115];return _0x28d5bf;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x029a('0x0'));var jsonpatch=require(_0x029a('0x1'));var rp=require(_0x029a('0x2'));var moment=require(_0x029a('0x3'));var BPromise=require(_0x029a('0x4'));var Mustache=require(_0x029a('0x5'));var util=require(_0x029a('0x6'));var path=require('path');var sox=require('sox');var csv=require(_0x029a('0x7'));var ejs=require(_0x029a('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x029a('0x9'));var squel=require(_0x029a('0xa'));var crypto=require('crypto');var jsforce=require(_0x029a('0xb'));var deskjs=require('desk.js');var toCsv=require(_0x029a('0x7'));var querystring=require(_0x029a('0xc'));var Papa=require(_0x029a('0xd'));var Redis=require(_0x029a('0xe'));var authService=require(_0x029a('0xf'));var qs=require(_0x029a('0x10'));var as=require(_0x029a('0x11'));var hardwareService=require(_0x029a('0x12'));var logger=require(_0x029a('0x13'))('api');var utils=require(_0x029a('0x14'));var config=require(_0x029a('0x15'));var licenseUtil=require(_0x029a('0x16'));var db=require(_0x029a('0x17'))['db'];config['redis']=_[_0x029a('0x18')](config[_0x029a('0x19')],{'host':'localhost','port':0x18eb});var socket=require(_0x029a('0x1a'))(new Redis(config[_0x029a('0x19')]));require(_0x029a('0x1b'))[_0x029a('0x1c')](socket);var jayson=require(_0x029a('0x1d'));var client=jayson[_0x029a('0x1e')][_0x029a('0x1f')]({'port':0x232c});var client9002=jayson[_0x029a('0x1e')][_0x029a('0x1f')]({'port':0x232a});var client9003=jayson[_0x029a('0x1e')][_0x029a('0x1f')]({'port':0x232b});var client9001=jayson[_0x029a('0x1e')][_0x029a('0x1f')]({'port':0x2329});function respondWithRpcPromise(_0x1a0ca7,_0x1cb2f9,_0x31f76e,_0x127b97){return new BPromise(function(_0x294195,_0x3434ee){var _0x48053f=_0x127b97||client;return _0x48053f[_0x029a('0x20')](_0x1a0ca7,_0x31f76e)['then'](function(_0x35ded7){logger['info'](_0x029a('0x21'),_0x1cb2f9,_0x029a('0x22'));logger[_0x029a('0x23')](_0x029a('0x24'),_0x1cb2f9,'request\x20sent',JSON[_0x029a('0x25')](_0x35ded7));if(_0x35ded7[_0x029a('0x26')]){if(_0x35ded7[_0x029a('0x26')][_0x029a('0x27')]===0x1f4){logger[_0x029a('0x26')](_0x029a('0x21'),_0x1cb2f9,_0x35ded7[_0x029a('0x26')][_0x029a('0x28')]);return _0x3434ee(_0x35ded7['error'][_0x029a('0x28')]);}logger[_0x029a('0x26')](_0x029a('0x21'),_0x1cb2f9,_0x35ded7['error'][_0x029a('0x28')]);return _0x294195(_0x35ded7[_0x029a('0x26')][_0x029a('0x28')]);}else{logger[_0x029a('0x29')](_0x029a('0x21'),_0x1cb2f9,_0x029a('0x22'));_0x294195(_0x35ded7[_0x029a('0x2a')][_0x029a('0x28')]);}})[_0x029a('0x2b')](function(_0x617b95){logger['error']('ChatWebsite,\x20%s,\x20%s',_0x1cb2f9,_0x617b95);_0x3434ee(_0x617b95);});});}function respondWithStatusCode(_0x42599f,_0x13c187){_0x13c187=_0x13c187||0xcc;return function(_0x256444){if(_0x256444){return _0x42599f['sendStatus'](_0x13c187);}return _0x42599f[_0x029a('0x2c')](_0x13c187)['end']();};}function respondWithResult(_0x480fbb,_0x35fa57){_0x35fa57=_0x35fa57||0xc8;return function(_0x55a64c){if(_0x55a64c){return _0x480fbb[_0x029a('0x2c')](_0x35fa57)['json'](_0x55a64c);}};}function respondWithFilteredResult(_0x248a52,_0x296593){return function(_0x2cfbe5){if(_0x2cfbe5){var _0x9055ea=typeof _0x296593['offset']===_0x029a('0x2d')&&typeof _0x296593[_0x029a('0x2e')]===_0x029a('0x2d');var _0x2a45f9=_0x2cfbe5[_0x029a('0x2f')];var _0x1ca9d4=_0x9055ea?0x0:_0x296593[_0x029a('0x30')];var _0x178b2c=_0x9055ea?_0x2cfbe5[_0x029a('0x2f')]:_0x296593[_0x029a('0x30')]+_0x296593[_0x029a('0x2e')];var _0x9d6150;if(_0x178b2c>=_0x2a45f9){_0x178b2c=_0x2a45f9;_0x9d6150=0xc8;}else{_0x9d6150=0xce;}_0x248a52[_0x029a('0x2c')](_0x9d6150);return _0x248a52['set'](_0x029a('0x31'),_0x1ca9d4+'-'+_0x178b2c+'/'+_0x2a45f9)[_0x029a('0x32')](_0x2cfbe5);}return null;};}function patchUpdates(_0x1dec33){return function(_0x40b42d){try{jsonpatch['apply'](_0x40b42d,_0x1dec33,!![]);}catch(_0x562a59){return BPromise[_0x029a('0x33')](_0x562a59);}return _0x40b42d[_0x029a('0x34')]();};}function saveUpdates(_0x1858be,_0x44ba5d){return function(_0xe48509){if(_0xe48509){return _0xe48509[_0x029a('0x35')](_0x1858be)['then'](function(_0x323bb9){return _0x323bb9;});}return null;};}function removeEntity(_0x161ec0,_0x2c2059){return function(_0x5106d3){if(_0x5106d3){return _0x5106d3[_0x029a('0x36')]()[_0x029a('0x37')](function(){var _0x1eeca7=_0x5106d3[_0x029a('0x38')]({'plain':!![]});var _0x3068f5=_0x029a('0x39');return db['UserProfileResource'][_0x029a('0x36')]({'where':{'type':_0x3068f5,'resourceId':_0x1eeca7['id']}})[_0x029a('0x37')](function(){return _0x5106d3;});})[_0x029a('0x37')](function(){_0x161ec0['status'](0xcc)[_0x029a('0x3a')]();});}};}function handleEntityNotFound(_0x77d9af,_0x4dae5b){return function(_0x12afda){if(!_0x12afda){_0x77d9af[_0x029a('0x3b')](0x194);}return _0x12afda;};}function handleError(_0x23b167,_0x4a5a49){_0x4a5a49=_0x4a5a49||0x1f4;return function(_0x596727){logger[_0x029a('0x26')](_0x596727['stack']);if(_0x596727[_0x029a('0x3c')]){delete _0x596727['name'];}_0x23b167[_0x029a('0x2c')](_0x4a5a49)[_0x029a('0x3d')](_0x596727);};}exports['index']=function(_0x2a71c9,_0x5ca675){var _0x4d5b17={'include':[{'model':db['Pause'],'as':'mandatoryDispositionPause'}]},_0x5b4430={},_0x2637ab={'count':0x0,'rows':[]};var _0x27736c=_[_0x029a('0x3e')](db[_0x029a('0x3f')][_0x029a('0x40')],function(_0x146f0c){return{'name':_0x146f0c['fieldName'],'type':_0x146f0c[_0x029a('0x41')][_0x029a('0x42')]};});_0x5b4430[_0x029a('0x43')]=_[_0x029a('0x3e')](_0x27736c,_0x029a('0x3c'));_0x5b4430[_0x029a('0x44')]=_['keys'](_0x2a71c9['query']);_0x5b4430[_0x029a('0x45')]=_[_0x029a('0x46')](_0x5b4430['model'],_0x5b4430[_0x029a('0x44')]);_0x4d5b17['attributes']=_[_0x029a('0x46')](_0x5b4430['model'],qs['fields'](_0x2a71c9[_0x029a('0x44')]['fields']));_0x4d5b17[_0x029a('0x47')]=_0x4d5b17[_0x029a('0x47')][_0x029a('0x48')]?_0x4d5b17[_0x029a('0x47')]:_0x5b4430[_0x029a('0x43')];if(!_0x2a71c9['query']['hasOwnProperty']('nolimit')){_0x4d5b17['limit']=qs[_0x029a('0x2e')](_0x2a71c9['query']['limit']);_0x4d5b17['offset']=qs['offset'](_0x2a71c9[_0x029a('0x44')][_0x029a('0x30')]);}_0x4d5b17[_0x029a('0x49')]=qs['sort'](_0x2a71c9[_0x029a('0x44')]['sort']);_0x4d5b17['where']=qs[_0x029a('0x45')](_[_0x029a('0x4a')](_0x2a71c9['query'],_0x5b4430[_0x029a('0x45')]),_0x27736c);if(_0x2a71c9[_0x029a('0x44')][_0x029a('0x4b')]){_0x4d5b17[_0x029a('0x4c')]=_[_0x029a('0x4d')](_0x4d5b17[_0x029a('0x4c')],{'$or':_[_0x029a('0x3e')](_0x27736c,function(_0x8ebfd5){if(_0x8ebfd5['type']!==_0x029a('0x4e')){var _0x2f3af1={};_0x2f3af1[_0x8ebfd5[_0x029a('0x3c')]]={'$like':'%'+_0x2a71c9[_0x029a('0x44')][_0x029a('0x4b')]+'%'};return _0x2f3af1;}})});}_0x4d5b17=_['merge']({},_0x4d5b17,_0x2a71c9[_0x029a('0x4f')]);var _0xd64332={'where':_0x4d5b17[_0x029a('0x4c')]};return db[_0x029a('0x3f')][_0x029a('0x2f')](_0xd64332)[_0x029a('0x37')](function(_0x29a883){_0x2637ab['count']=_0x29a883;if(_0x2a71c9['query'][_0x029a('0x50')]){_0x4d5b17[_0x029a('0x51')]=[{'all':!![]}];}return db[_0x029a('0x3f')][_0x029a('0x52')](_0x4d5b17);})[_0x029a('0x37')](function(_0x56c001){_0x2637ab[_0x029a('0x53')]=_0x56c001;return _0x2637ab;})[_0x029a('0x37')](respondWithFilteredResult(_0x5ca675,_0x4d5b17))[_0x029a('0x2b')](handleError(_0x5ca675,null));};exports[_0x029a('0x54')]=function(_0x58f982,_0x14f53c){var _0x385d39={'raw':![],'where':{'id':_0x58f982['params']['id']},'include':[{'model':db[_0x029a('0x55')],'as':_0x029a('0x56')}]},_0x16a50c={};_0x16a50c[_0x029a('0x43')]=_['keys'](db[_0x029a('0x3f')][_0x029a('0x40')]);_0x16a50c[_0x029a('0x44')]=_[_0x029a('0x57')](_0x58f982['query']);_0x16a50c[_0x029a('0x45')]=_[_0x029a('0x46')](_0x16a50c[_0x029a('0x43')],_0x16a50c[_0x029a('0x44')]);_0x385d39[_0x029a('0x47')]=_[_0x029a('0x46')](_0x16a50c['model'],qs[_0x029a('0x58')](_0x58f982[_0x029a('0x44')][_0x029a('0x58')]));_0x385d39[_0x029a('0x47')]=_0x385d39[_0x029a('0x47')][_0x029a('0x48')]?_0x385d39['attributes']:_0x16a50c[_0x029a('0x43')];if(_0x58f982[_0x029a('0x44')][_0x029a('0x50')]){_0x385d39[_0x029a('0x51')]=[{'all':!![]}];}_0x385d39=_['merge']({},_0x385d39,_0x58f982[_0x029a('0x4f')]);return db[_0x029a('0x3f')]['find'](_0x385d39)[_0x029a('0x37')](handleEntityNotFound(_0x14f53c,null))['then'](respondWithResult(_0x14f53c,null))[_0x029a('0x2b')](handleError(_0x14f53c,null));};exports[_0x029a('0x59')]=function(_0x1679e2,_0xba4937){return db[_0x029a('0x3f')][_0x029a('0x59')](_0x1679e2['body'],{})[_0x029a('0x37')](function(_0x3160a4){var _0x2addde=_0x1679e2[_0x029a('0x5a')][_0x029a('0x38')]({'plain':!![]});if(!_0x2addde)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x2addde[_0x029a('0x5b')]===_0x029a('0x5a')){var _0x10c218=_0x3160a4[_0x029a('0x38')]({'plain':!![]});var _0x30242b=_0x029a('0x39');return db[_0x029a('0x5c')][_0x029a('0x5d')]({'where':{'name':_0x30242b,'userProfileId':_0x2addde[_0x029a('0x5e')]},'raw':!![]})[_0x029a('0x37')](function(_0x14b378){if(_0x14b378&&_0x14b378[_0x029a('0x5f')]===0x0){return db['UserProfileResource']['create']({'name':_0x10c218['name'],'resourceId':_0x10c218['id'],'type':_0x14b378[_0x029a('0x3c')],'sectionId':_0x14b378['id']},{})[_0x029a('0x37')](function(){return _0x3160a4;});}else{return _0x3160a4;}})[_0x029a('0x2b')](function(_0x10f906){logger[_0x029a('0x26')](_0x029a('0x60'),_0x10f906);throw _0x10f906;});}return _0x3160a4;})['then'](respondWithResult(_0xba4937,0xc9))[_0x029a('0x2b')](handleError(_0xba4937,null));};exports[_0x029a('0x35')]=function(_0x5dabab,_0x15e003){if(_0x5dabab[_0x029a('0x61')]['id']){delete _0x5dabab['body']['id'];}return db['ChatWebsite'][_0x029a('0x5d')]({'where':{'id':_0x5dabab['params']['id']},'include':[{'model':db[_0x029a('0x55')],'as':_0x029a('0x56')}]})[_0x029a('0x37')](handleEntityNotFound(_0x15e003,null))[_0x029a('0x37')](saveUpdates(_0x5dabab[_0x029a('0x61')],null))[_0x029a('0x37')](respondWithResult(_0x15e003,null))['catch'](handleError(_0x15e003,null));};exports[_0x029a('0x36')]=function(_0x2eeba0,_0x57586c){return db[_0x029a('0x3f')][_0x029a('0x5d')]({'where':{'id':_0x2eeba0[_0x029a('0x62')]['id']}})[_0x029a('0x37')](handleEntityNotFound(_0x57586c,null))['then'](removeEntity(_0x57586c,null))[_0x029a('0x2b')](handleError(_0x57586c,null));};exports[_0x029a('0x63')]=function(_0xba56f,_0x41f8fa){return db[_0x029a('0x3f')]['describe']()[_0x029a('0x37')](respondWithResult(_0x41f8fa,null))['catch'](handleError(_0x41f8fa,null));};exports[_0x029a('0x64')]=function(_0x135a26,_0x24c909,_0x867ab){if(_0x135a26[_0x029a('0x61')]['id']){delete _0x135a26['body']['id'];}return db[_0x029a('0x3f')][_0x029a('0x5d')]({'where':{'id':_0x135a26[_0x029a('0x62')]['id']}})['then'](handleEntityNotFound(_0x24c909,null))[_0x029a('0x37')](function(_0x2c45a8){if(_0x2c45a8){_0x135a26['body'][_0x029a('0x65')]=_0x2c45a8['id'];return db[_0x029a('0x66')][_0x029a('0x59')](_0x135a26[_0x029a('0x61')]);}})[_0x029a('0x37')](respondWithResult(_0x24c909,null))[_0x029a('0x2b')](handleError(_0x24c909,null));};exports['getDispositions']=function(_0x20419b,_0x2efb94,_0x9730d0){var _0x2fc280={'raw':![],'where':{}};var _0x451fa8={};var _0x4e4252={'count':0x0,'rows':[]};return db[_0x029a('0x3f')]['findOne']({'where':{'id':_0x20419b[_0x029a('0x62')]['id']}})['then'](handleEntityNotFound(_0x2efb94,null))['then'](function(_0x4c4da3){if(_0x4c4da3){_0x451fa8[_0x029a('0x43')]=_['keys'](db[_0x029a('0x66')][_0x029a('0x40')]);_0x451fa8[_0x029a('0x44')]=_[_0x029a('0x57')](_0x20419b['query']);_0x451fa8[_0x029a('0x45')]=_[_0x029a('0x46')](_0x451fa8[_0x029a('0x43')],_0x451fa8[_0x029a('0x44')]);_0x2fc280[_0x029a('0x47')]=_[_0x029a('0x46')](_0x451fa8[_0x029a('0x43')],qs['fields'](_0x20419b['query']['fields']));_0x2fc280[_0x029a('0x47')]=_0x2fc280[_0x029a('0x47')][_0x029a('0x48')]?_0x2fc280['attributes']:_0x451fa8[_0x029a('0x43')];if(!_0x20419b[_0x029a('0x44')][_0x029a('0x67')]('nolimit')){_0x2fc280[_0x029a('0x2e')]=qs[_0x029a('0x2e')](_0x20419b[_0x029a('0x44')][_0x029a('0x2e')]);_0x2fc280[_0x029a('0x30')]=qs[_0x029a('0x30')](_0x20419b[_0x029a('0x44')][_0x029a('0x30')]);}_0x2fc280['order']=qs[_0x029a('0x68')](_0x20419b['query'][_0x029a('0x68')]);_0x2fc280['where']=qs[_0x029a('0x45')](_['pick'](_0x20419b[_0x029a('0x44')],_0x451fa8[_0x029a('0x45')]));_0x2fc280['where'][_0x029a('0x65')]=_0x4c4da3['id'];if(_0x20419b[_0x029a('0x44')][_0x029a('0x4b')]){_0x2fc280['where']=_[_0x029a('0x4d')](_0x2fc280[_0x029a('0x4c')],{'$or':_[_0x029a('0x3e')](_0x2fc280[_0x029a('0x47')],function(_0x5e00d0){var _0x432b96={};_0x432b96[_0x5e00d0]={'$like':'%'+_0x20419b[_0x029a('0x44')][_0x029a('0x4b')]+'%'};return _0x432b96;})});}_0x2fc280=_[_0x029a('0x4d')]({},_0x2fc280,_0x20419b[_0x029a('0x4f')]);return db[_0x029a('0x66')][_0x029a('0x2f')]({'where':_0x2fc280['where']})[_0x029a('0x37')](function(_0x39e639){_0x4e4252['count']=_0x39e639;if(_0x20419b[_0x029a('0x44')][_0x029a('0x50')]){_0x2fc280[_0x029a('0x51')]=[{'all':!![]}];}return db[_0x029a('0x66')]['findAll'](_0x2fc280);})['then'](function(_0x2ad1b0){_0x4e4252[_0x029a('0x53')]=_0x2ad1b0;return _0x4e4252;});}})[_0x029a('0x37')](respondWithFilteredResult(_0x2efb94,_0x2fc280))['catch'](handleError(_0x2efb94,null));};exports[_0x029a('0x69')]=function(_0x23dafc,_0x46f5cb,_0x48d9ab){return db['ChatWebsite'][_0x029a('0x5d')]({'where':{'id':_0x23dafc[_0x029a('0x62')]['id']}})['then'](handleEntityNotFound(_0x46f5cb,null))[_0x029a('0x37')](function(_0x5c5ca8){if(_0x5c5ca8){return _0x5c5ca8[_0x029a('0x69')](_0x23dafc[_0x029a('0x44')][_0x029a('0x6a')]);}})[_0x029a('0x37')](respondWithStatusCode(_0x46f5cb,null))[_0x029a('0x2b')](handleError(_0x46f5cb,null));};exports[_0x029a('0x6b')]=function(_0x311bed,_0x16a3da,_0x4cc78f){if(_0x311bed[_0x029a('0x61')]['id']){delete _0x311bed[_0x029a('0x61')]['id'];}return db[_0x029a('0x3f')][_0x029a('0x5d')]({'where':{'id':_0x311bed['params']['id']}})['then'](handleEntityNotFound(_0x16a3da,null))[_0x029a('0x37')](function(_0x33661f){if(_0x33661f){_0x311bed[_0x029a('0x61')][_0x029a('0x65')]=_0x33661f['id'];return db[_0x029a('0x6c')][_0x029a('0x59')](_0x311bed[_0x029a('0x61')]);}})[_0x029a('0x37')](respondWithResult(_0x16a3da,null))[_0x029a('0x2b')](handleError(_0x16a3da,null));};exports['getAnswers']=function(_0x1049f2,_0x262bba,_0x3608a0){var _0x28bb72={'raw':![],'where':{}};var _0x56c765={};var _0x535b50={'count':0x0,'rows':[]};return db[_0x029a('0x3f')][_0x029a('0x6d')]({'where':{'id':_0x1049f2[_0x029a('0x62')]['id']}})[_0x029a('0x37')](handleEntityNotFound(_0x262bba,null))[_0x029a('0x37')](function(_0x269627){if(_0x269627){_0x56c765['model']=_['keys'](db['CannedAnswer'][_0x029a('0x40')]);_0x56c765[_0x029a('0x44')]=_[_0x029a('0x57')](_0x1049f2[_0x029a('0x44')]);_0x56c765[_0x029a('0x45')]=_[_0x029a('0x46')](_0x56c765[_0x029a('0x43')],_0x56c765[_0x029a('0x44')]);_0x28bb72[_0x029a('0x47')]=_[_0x029a('0x46')](_0x56c765[_0x029a('0x43')],qs[_0x029a('0x58')](_0x1049f2['query'][_0x029a('0x58')]));_0x28bb72[_0x029a('0x47')]=_0x28bb72[_0x029a('0x47')][_0x029a('0x48')]?_0x28bb72[_0x029a('0x47')]:_0x56c765[_0x029a('0x43')];if(!_0x1049f2[_0x029a('0x44')]['hasOwnProperty']('nolimit')){_0x28bb72[_0x029a('0x2e')]=qs[_0x029a('0x2e')](_0x1049f2[_0x029a('0x44')][_0x029a('0x2e')]);_0x28bb72['offset']=qs[_0x029a('0x30')](_0x1049f2[_0x029a('0x44')][_0x029a('0x30')]);}_0x28bb72[_0x029a('0x49')]=qs[_0x029a('0x68')](_0x1049f2[_0x029a('0x44')]['sort']);_0x28bb72[_0x029a('0x4c')]=qs[_0x029a('0x45')](_['pick'](_0x1049f2[_0x029a('0x44')],_0x56c765['filters']));_0x28bb72[_0x029a('0x4c')][_0x029a('0x65')]=_0x269627['id'];if(_0x1049f2[_0x029a('0x44')][_0x029a('0x4b')]){_0x28bb72[_0x029a('0x4c')]=_['merge'](_0x28bb72[_0x029a('0x4c')],{'$or':_[_0x029a('0x3e')](_0x28bb72[_0x029a('0x47')],function(_0x6c6ab1){var _0x21e01a={};_0x21e01a[_0x6c6ab1]={'$like':'%'+_0x1049f2['query'][_0x029a('0x4b')]+'%'};return _0x21e01a;})});}_0x28bb72=_[_0x029a('0x4d')]({},_0x28bb72,_0x1049f2[_0x029a('0x4f')]);return db[_0x029a('0x6c')]['count']({'where':_0x28bb72['where']})[_0x029a('0x37')](function(_0xc4ec1b){_0x535b50['count']=_0xc4ec1b;if(_0x1049f2['query'][_0x029a('0x50')]){_0x28bb72['include']=[{'all':!![]}];}return db[_0x029a('0x6c')][_0x029a('0x52')](_0x28bb72);})[_0x029a('0x37')](function(_0x1d1c50){_0x535b50[_0x029a('0x53')]=_0x1d1c50;return _0x535b50;});}})['then'](respondWithFilteredResult(_0x262bba,_0x28bb72))[_0x029a('0x2b')](handleError(_0x262bba,null));};exports[_0x029a('0x6e')]=function(_0x3eb4f5,_0x1ef619,_0x4bf7fe){return db[_0x029a('0x3f')][_0x029a('0x5d')]({'where':{'id':_0x3eb4f5[_0x029a('0x62')]['id']}})[_0x029a('0x37')](handleEntityNotFound(_0x1ef619,null))[_0x029a('0x37')](function(_0x2ebf7){if(_0x2ebf7){return _0x2ebf7[_0x029a('0x6e')](_0x3eb4f5[_0x029a('0x44')][_0x029a('0x6a')]);}})[_0x029a('0x37')](respondWithStatusCode(_0x1ef619,null))[_0x029a('0x2b')](handleError(_0x1ef619,null));};exports[_0x029a('0x6f')]=function(_0x29f000,_0x50c3e2,_0x1c2372){_0x29f000[_0x029a('0x61')]['sitepic']=_0x29f000['file'][_0x029a('0x70')];return db[_0x029a('0x3f')]['find']({'where':{'id':_0x29f000[_0x029a('0x62')]['id']}})['then'](handleEntityNotFound(_0x50c3e2,null))['then'](saveUpdates(_0x29f000[_0x029a('0x61')],null))['then'](respondWithResult(_0x50c3e2,null))[_0x029a('0x2b')](handleError(_0x50c3e2,null));};exports[_0x029a('0x71')]=function(_0x44a052,_0x1a7926,_0x116a02){_0x44a052['body'][_0x029a('0x72')]=_0x44a052[_0x029a('0x73')][_0x029a('0x70')];return db[_0x029a('0x3f')][_0x029a('0x5d')]({'where':{'id':_0x44a052[_0x029a('0x62')]['id']}})[_0x029a('0x37')](handleEntityNotFound(_0x1a7926,null))[_0x029a('0x37')](saveUpdates(_0x44a052[_0x029a('0x61')],null))[_0x029a('0x37')](respondWithResult(_0x1a7926,null))[_0x029a('0x2b')](handleError(_0x1a7926,null));};exports['addCustomerAvatar']=function(_0x5487b2,_0x3e542b,_0x201e0f){_0x5487b2[_0x029a('0x61')][_0x029a('0x74')]=_0x5487b2[_0x029a('0x73')][_0x029a('0x70')];return db['ChatWebsite'][_0x029a('0x5d')]({'where':{'id':_0x5487b2[_0x029a('0x62')]['id']}})[_0x029a('0x37')](handleEntityNotFound(_0x3e542b,null))[_0x029a('0x37')](saveUpdates(_0x5487b2[_0x029a('0x61')],null))[_0x029a('0x37')](respondWithResult(_0x3e542b,null))['catch'](handleError(_0x3e542b,null));};exports[_0x029a('0x75')]=function(_0x584ffc,_0x23eb9b,_0x3a4415){_0x584ffc[_0x029a('0x61')][_0x029a('0x76')]=_0x584ffc['file'][_0x029a('0x70')];return db[_0x029a('0x3f')][_0x029a('0x5d')]({'where':{'id':_0x584ffc[_0x029a('0x62')]['id']}})[_0x029a('0x37')](handleEntityNotFound(_0x23eb9b,null))[_0x029a('0x37')](saveUpdates(_0x584ffc[_0x029a('0x61')],null))['then'](respondWithResult(_0x23eb9b,null))['catch'](handleError(_0x23eb9b,null));};exports['getLogo']=function(_0x394d7e,_0x31cc87,_0x56cf96){var _0x3db0c6=path[_0x029a('0x77')](config[_0x029a('0x78')],_0x029a('0x79'));var _0x5b1620={'where':{'id':_0x394d7e[_0x029a('0x62')]['id']},'attributes':['id',_0x029a('0x7a')],'raw':!![]};var _0x495507=![];return require(_0x029a('0x16'))[_0x029a('0x7b')]()[_0x029a('0x37')](function(_0x426e30){if(_0x426e30){_0x495507=_0x426e30['custom'];}})[_0x029a('0x37')](function(){return db['ChatWebsite'][_0x029a('0x5d')](_0x5b1620);})['then'](handleEntityNotFound(_0x31cc87,null))[_0x029a('0x37')](function(_0x4e706f){if(_0x4e706f){if(!_['isNil'](_0x4e706f[_0x029a('0x7a')])){if(fs[_0x029a('0x7c')](path[_0x029a('0x77')](config[_0x029a('0x78')],_0x029a('0x7d'),_0x4e706f[_0x029a('0x7a')]))&&_0x495507){_0x3db0c6=path['join'](config['root'],'server/files/images/logos/',_0x4e706f[_0x029a('0x7a')]);}}return _0x31cc87[_0x029a('0x7e')](_0x3db0c6);}})[_0x029a('0x2b')](handleError(_0x31cc87,null));};exports[_0x029a('0x7f')]=function(_0x573515,_0x3f8f52,_0x50e4c8){var _0x5cf508=path[_0x029a('0x77')](config[_0x029a('0x78')],_0x029a('0x80'));var _0x8fb4bd={'where':{'id':_0x573515[_0x029a('0x62')]['id']},'attributes':['id',_0x029a('0x72')],'raw':!![]};return db[_0x029a('0x3f')][_0x029a('0x5d')](_0x8fb4bd)[_0x029a('0x37')](handleEntityNotFound(_0x3f8f52,null))['then'](function(_0x333f57){if(_0x333f57){if(!_[_0x029a('0x81')](_0x333f57['agentAvatar'])){if(fs[_0x029a('0x7c')](path['join'](config[_0x029a('0x78')],_0x029a('0x82'),_0x333f57[_0x029a('0x72')]))){_0x5cf508=path[_0x029a('0x77')](config[_0x029a('0x78')],_0x029a('0x82'),_0x333f57['agentAvatar']);}}return _0x3f8f52['download'](_0x5cf508);}})[_0x029a('0x2b')](handleError(_0x3f8f52,null));};exports[_0x029a('0x83')]=function(_0xd67a82,_0x1cc27a,_0x16e0b9){var _0x3a45ca=path[_0x029a('0x77')](config[_0x029a('0x78')],_0x029a('0x84'));var _0x2a2b60={'where':{'id':_0xd67a82[_0x029a('0x62')]['id']},'attributes':['id','customerAvatar',_0x029a('0x85')],'raw':!![]};return db[_0x029a('0x3f')][_0x029a('0x5d')](_0x2a2b60)[_0x029a('0x37')](handleEntityNotFound(_0x1cc27a,null))[_0x029a('0x37')](function(_0x81b4f4){if(_0x81b4f4){if(!_['isNil'](_0x81b4f4[_0x029a('0x74')])){if(fs[_0x029a('0x7c')](path[_0x029a('0x77')](config['root'],_0x029a('0x82'),_0x81b4f4[_0x029a('0x74')]))&&_0x81b4f4[_0x029a('0x85')]){_0x3a45ca=path[_0x029a('0x77')](config[_0x029a('0x78')],'server/files/images/avatars/',_0x81b4f4['customerAvatar']);}}return _0x1cc27a['download'](_0x3a45ca);}})[_0x029a('0x2b')](handleError(_0x1cc27a,null));};exports[_0x029a('0x86')]=function(_0x12e510,_0xdde4c3,_0xfd4fb0){var _0x24d348=path[_0x029a('0x77')](config[_0x029a('0x78')],_0x029a('0x87'));var _0x43bd29={'where':{'id':_0x12e510['params']['id']},'attributes':['id',_0x029a('0x76')],'raw':!![]};return db[_0x029a('0x3f')]['find'](_0x43bd29)[_0x029a('0x37')](handleEntityNotFound(_0xdde4c3,null))['then'](function(_0x1176ed){if(_0x1176ed){if(!_[_0x029a('0x81')](_0x1176ed[_0x029a('0x76')])){if(fs[_0x029a('0x7c')](path['join'](config[_0x029a('0x78')],'server/files/images/avatars/',_0x1176ed[_0x029a('0x76')]))){_0x24d348=path[_0x029a('0x77')](config[_0x029a('0x78')],'server/files/images/avatars/',_0x1176ed['systemAvatar']);}}return _0xdde4c3[_0x029a('0x7e')](_0x24d348);}})[_0x029a('0x2b')](handleError(_0xdde4c3,null));};exports[_0x029a('0x88')]=function(_0x869337,_0x38f727,_0x264f18){var _0xa74a93=require(_0x029a('0x89'));var _0x52e8c3=new _0xa74a93();var _0x84df5d=_0x52e8c3[_0x029a('0x8a')](_0x869337[_0x029a('0x8b')][_0x029a('0x8c')])[_0x029a('0x8d')]();var _0x4f4677={'body':_0x869337[_0x029a('0x61')],'channel':_0x029a('0x8e')};var _0x406ca6=[];var _0x289689=[];var _0x5a196e={};var _0x228427=![];return db[_0x029a('0x8f')][_0x029a('0x63')]()[_0x029a('0x37')](function(_0x463c9f){if(!_0x463c9f){throw new db[(_0x029a('0x90'))]['ValidationError'](_0x029a('0x91'));}_0x406ca6=_[_0x029a('0x92')](_[_0x029a('0x57')](_0x463c9f),[_0x029a('0x93'),_0x029a('0x94')]);_0x289689=_['difference'](_['keys'](_0x463c9f),[_0x029a('0x93'),_0x029a('0x94'),_0x029a('0x95'),_0x029a('0x96')]);if(_0x869337[_0x029a('0x61')]['id']){delete _0x869337[_0x029a('0x61')]['id'];}if(_[_0x029a('0x81')](_0x869337['body']['from'])){throw new db['Sequelize']['ValidationError']('from\x20is\x20mandatory');}if(_[_0x029a('0x81')](_0x869337['body']['body'])||_0x869337[_0x029a('0x61')]['body']===''){throw new db[(_0x029a('0x90'))][(_0x029a('0x97'))](_0x029a('0x98'));}if(_[_0x029a('0x81')](_0x869337[_0x029a('0x61')]['mapKey'])){throw new db['Sequelize'][(_0x029a('0x97'))]('mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20'+_0x289689);}if(!_[_0x029a('0x99')](_0x289689,_0x869337[_0x029a('0x61')][_0x029a('0x9a')])){throw new db['Sequelize'][(_0x029a('0x97'))](_0x029a('0x9b')+_0x289689);}_0x5a196e[_0x869337[_0x029a('0x61')]['mapKey']]=_0x869337[_0x029a('0x61')]['from'];})['then'](function(){return db[_0x029a('0x3f')][_0x029a('0x5d')]({'where':{'id':_0x869337[_0x029a('0x62')]['id']},'include':[{'model':db['CmList'],'as':_0x029a('0x9c'),'include':[{'model':db[_0x029a('0x8f')],'as':_0x029a('0x9d'),'where':_0x5a196e,'limit':0x1,'order':[[_0x029a('0x94'),_0x029a('0x9e')]]}]},{'model':db[_0x029a('0x9f')],'as':_0x029a('0xa0')}]});})[_0x029a('0x37')](handleEntityNotFound(_0x38f727,null))['then'](function(_0x3a35a7){if(_0x3a35a7&&_0x3a35a7[_0x029a('0x9c')]){_0x4f4677[_0x029a('0xa1')]=_0x3a35a7;_0x4f4677['applications']=_0x3a35a7[_0x029a('0xa0')];_0x4f4677[_0x029a('0xa2')]=_0x3a35a7[_0x029a('0x9c')];_0x4f4677[_0x029a('0xa3')]=_['orderBy'](_0x4f4677[_0x029a('0xa3')],[_0x029a('0xa4')],[_0x029a('0xa5')]);if(_0x4f4677[_0x029a('0xa1')]['Applications']){delete _0x4f4677[_0x029a('0xa1')][_0x029a('0xa0')];}if(_0x4f4677['account'][_0x029a('0x9c')]&&_0x4f4677[_0x029a('0xa1')][_0x029a('0x9c')][_0x029a('0x9d')]['length']){return _0x4f4677[_0x029a('0xa1')][_0x029a('0x9c')]['Contacts'][0x0];}var _0xf2f0f6=_[_0x029a('0x18')](_0x869337[_0x029a('0x61')],{'firstName':_0x869337[_0x029a('0x61')][_0x029a('0xa6')],'ListId':_0x3a35a7['ListId']});_0xf2f0f6[_0x869337[_0x029a('0x61')][_0x029a('0x9a')]]=_0x869337[_0x029a('0x61')]['from'];return db[_0x029a('0x8f')][_0x029a('0x59')](_0xf2f0f6,{'fields':_0x406ca6,'raw':!![]});}})[_0x029a('0x37')](handleEntityNotFound(_0x38f727,null))[_0x029a('0x37')](function(_0x1e66d6){_0x4f4677[_0x029a('0xa7')]=_0x1e66d6;var _0x1aabed=_0x869337['body'][_0x029a('0xa8')];if(_0x869337['headers']['cf-connecting-ip']){_0x1aabed=_0x869337[_0x029a('0x8b')]['cf-connecting-ip'];}else if(_0x869337[_0x029a('0x8b')][_0x029a('0xa9')]){_0x1aabed=_[_0x029a('0xaa')](_0x869337[_0x029a('0x8b')][_0x029a('0xa9')]['split'](','));}if(_0x1e66d6){var _0x13f49f={'ContactId':_0x1e66d6['id'],'ChatWebsiteId':_0x869337[_0x029a('0x62')]['id'],'from':(_0x1e66d6[_0x029a('0xab')]||'')+'\x20'+(_0x1e66d6[_0x029a('0xac')]||''),'customerIp':_0x1aabed,'customerPort':_0x869337[_0x029a('0x8b')][_0x029a('0xad')]?_0x869337[_0x029a('0x8b')]['x-real-port']:null,'referer':_0x869337[_0x029a('0x61')][_0x029a('0xae')],'browserName':_0x84df5d[_0x029a('0xaf')][_0x029a('0x3c')]&&_0x84df5d[_0x029a('0xaf')][_0x029a('0xb0')]?util[_0x029a('0xb1')]('%s\x20%s',_0x84df5d[_0x029a('0xaf')][_0x029a('0x3c')],_0x84df5d[_0x029a('0xaf')][_0x029a('0xb0')]):_0x029a('0xb2'),'browserVersion':_0x84df5d[_0x029a('0xaf')][_0x029a('0xb0')]||_0x029a('0xb2'),'osName':util[_0x029a('0xb1')](_0x029a('0xb3'),_0x84df5d['os'][_0x029a('0x3c')],_0x84df5d['os'][_0x029a('0xb0')]),'osVersion':_0x84df5d['os'][_0x029a('0xb0')],'deviceModel':_0x84df5d[_0x029a('0xb4')][_0x029a('0x43')]&&_0x84df5d['device'][_0x029a('0xb5')]?util[_0x029a('0xb1')](_0x029a('0xb6'),_0x84df5d[_0x029a('0xb4')]['model'],_0x84df5d[_0x029a('0xb4')][_0x029a('0xb5')],_0x84df5d[_0x029a('0xb4')][_0x029a('0x41')]):null,'deviceVendor':_0x84df5d[_0x029a('0xb4')][_0x029a('0xb5')],'deviceType':_0x84df5d[_0x029a('0xb4')][_0x029a('0x41')],'formData':JSON['stringify'](_0x869337[_0x029a('0x61')])};var _0x43ebf5={'ChatWebsiteId':_0x869337[_0x029a('0x62')]['id'],'closed':![]};if(_0x869337['body']['threadId']){_0x43ebf5[_0x029a('0xb7')]=_0x869337[_0x029a('0x61')]['threadId'];return db['ChatInteraction'][_0x029a('0x5d')]({'where':_0x43ebf5})[_0x029a('0x37')](function(_0x4ffd60){if(_0x4ffd60){return[_0x4ffd60,![]];}_0x13f49f['threadId']=_0x869337['body'][_0x029a('0xb7')];_0x13f49f['externalUrl']=_0x869337['body']['externalUrl'];return db['ChatInteraction']['create'](_0x13f49f)[_0x029a('0x37')](function(_0x3b9b4a){return[_0x3b9b4a,!![]];});});}_0x43ebf5[_0x029a('0xb8')]=_0x1e66d6['id'];if(_0x869337[_0x029a('0x61')][_0x029a('0xb9')]&&_0x869337['body'][_0x029a('0xb9')]['id']){_0x43ebf5['id']=_0x869337[_0x029a('0x61')][_0x029a('0xb9')]['id'];return db[_0x029a('0xba')][_0x029a('0x5d')]({'where':_0x43ebf5})['then'](function(_0x1f48da){if(_0x1f48da){return[_0x1f48da,![]];}return db[_0x029a('0xba')]['create'](_0x13f49f)['then'](function(_0x2b6b92){return[_0x2b6b92,!![]];});});}return db[_0x029a('0xba')][_0x029a('0x59')](_0x13f49f)['then'](function(_0x1160b4){return[_0x1160b4,!![]];});}})[_0x029a('0xbb')](function(_0x45a504,_0x2cc87d){if(_0x45a504){_0x228427=_0x2cc87d;if(!_0x2cc87d){var _0x5a32c7={'from':(_0x4f4677[_0x029a('0xa7')][_0x029a('0xab')]||'')+'\x20'+(_0x4f4677[_0x029a('0xa7')]['lastName']||'')};if(_0x869337[_0x029a('0x61')][_0x029a('0xb7')]&&_0x869337['body']['messageId']&&_0x869337[_0x029a('0x61')][_0x029a('0xb7')]!=_0x869337[_0x029a('0x61')][_0x029a('0xbc')]){_0x5a32c7[_0x029a('0xb7')]=_0x869337[_0x029a('0x61')][_0x029a('0xbc')];}return _0x45a504[_0x029a('0x35')](_0x5a32c7);}else{return _0x45a504;}}})[_0x029a('0x37')](function(_0x59ed06){_0x4f4677[_0x029a('0xb9')]=_0x59ed06[_0x029a('0x38')]({'plain':!![]});_0x4f4677[_0x029a('0xb9')]['created']=_0x228427;if(_0x4f4677['interaction'][_0x029a('0xbd')]){if(_0x4f4677['account'][_0x029a('0xbe')]){_0x4f4677[_0x029a('0xa3')][_0x029a('0xbf')]({'id':0x0,'priority':_0x4f4677[_0x029a('0xa3')][_0x029a('0x48')]+0x1,'app':_0x029a('0xc0'),'appdata':_0x029a('0xc1'),'interval':'*,*,*,*'});}}return db[_0x029a('0xc2')]['create']({'body':_0x869337[_0x029a('0x61')][_0x029a('0x61')],'ChatWebsiteId':_0x869337['params']['id'],'ChatInteractionId':_0x59ed06['id'],'direction':'in','ContactId':_0x4f4677[_0x029a('0xa7')]['id'],'AttachmentId':_0x869337[_0x029a('0x61')]['AttachmentId']});})['then'](function(_0x2145aa){_0x4f4677[_0x029a('0x28')]=_0x2145aa;if(_0x4f4677[_0x029a('0xb9')][_0x029a('0xc3')]){return db[_0x029a('0xc4')][_0x029a('0x5d')]({'attributes':['id',_0x029a('0x3c')],'where':{'id':_0x4f4677['interaction'][_0x029a('0xc3')]}})['then'](function(_0x4220d8){if(_0x4220d8){_0x4f4677['applications'][_0x029a('0xc5')]({'id':0x0,'priority':0x0,'app':_0x029a('0xc6'),'appdata':_0x4220d8['name']+','+(_0x4f4677[_0x029a('0xa1')][_0x029a('0xc7')]||0xa),'interval':'*,*,*,*'});_0x4f4677[_0x029a('0xc8')]=!![];}return respondWithRpcPromise(_0x029a('0xc9'),_0x029a('0xca'),_0x4f4677);});}return respondWithRpcPromise(_0x029a('0xc9'),_0x029a('0xca'),_0x4f4677);})['then'](function(_0x235d31){respondWithRpcPromise(_0x029a('0xcb'),_0x029a('0xcb'),{'event':_0x029a('0x88'),'message':_0x235d31},client9002);return _0x235d31;})[_0x029a('0x37')](respondWithResult(_0x38f727,null))[_0x029a('0x2b')](handleError(_0x38f727,null));};exports['offline']=function(_0x13c7fd,_0x2c3980,_0x31efed){var _0x3e06a9,_0x13b581,_0x1e9209;var _0x4dc9e5=[];var _0x257be4=[];var _0x454609={};var _0x90ddcd=_0x13c7fd[_0x029a('0xcc')]||[];var _0x10ad4f=[];var _0x4f4a2b;return db[_0x029a('0x8f')][_0x029a('0x63')]()['then'](function(_0x3d6e73){if(!_0x3d6e73){throw new db[(_0x029a('0x90'))]['ValidationError']('no\x20available\x20attributes');}_0x257be4=_[_0x029a('0x92')](_[_0x029a('0x57')](_0x3d6e73),[_0x029a('0x93'),_0x029a('0x94')]);_0x4dc9e5=_[_0x029a('0x92')](_[_0x029a('0x57')](_0x3d6e73),[_0x029a('0x93'),_0x029a('0x94'),_0x029a('0x95'),_0x029a('0x96')]);if(_0x13c7fd[_0x029a('0x61')]['id']){delete _0x13c7fd['body']['id'];}if(_[_0x029a('0x81')](_0x13c7fd['body'][_0x029a('0xa6')])){throw _0x2c3980[_0x029a('0x2c')](0x1f4)[_0x029a('0x3d')](new db[(_0x029a('0x90'))]['ValidationError']('from\x20is\x20mandatory'));}if(_[_0x029a('0x81')](_0x13c7fd[_0x029a('0x61')][_0x029a('0x61')])||_0x13c7fd['body'][_0x029a('0x61')]===''){throw _0x2c3980['status'](0x1f4)[_0x029a('0x3d')](new db[(_0x029a('0x90'))]['ValidationError'](_0x029a('0x98')));}if(_[_0x029a('0x81')](_0x13c7fd[_0x029a('0x61')]['mapKeyOffline'])){throw _0x2c3980[_0x029a('0x2c')](0x1f4)[_0x029a('0x3d')](new db[(_0x029a('0x90'))][(_0x029a('0x97'))](_0x029a('0xcd')+_0x4dc9e5));}if(!_[_0x029a('0x99')](_0x4dc9e5,_0x13c7fd[_0x029a('0x61')][_0x029a('0xce')])){throw _0x2c3980['status'](0x1f4)[_0x029a('0x3d')](new db['Sequelize'][(_0x029a('0x97'))](_0x029a('0xcf')+_0x4dc9e5));}_0x454609[_0x13c7fd[_0x029a('0x61')][_0x029a('0xce')]]=_0x13c7fd[_0x029a('0x61')]['from'];})['then'](function(){return db[_0x029a('0x3f')][_0x029a('0x5d')]({'where':{'id':_0x13c7fd[_0x029a('0x62')]['id']},'include':[{'model':db[_0x029a('0xd0')],'as':_0x029a('0x9c')},{'model':db[_0x029a('0xd1')],'as':_0x029a('0xd1')}]});})['then'](handleEntityNotFound(_0x2c3980,null))[_0x029a('0x37')](function(_0x25d4be){if(_0x25d4be&&_0x25d4be[_0x029a('0x9c')]){_0x13b581=_0x25d4be;var _0x448042=_[_0x029a('0x18')](_0x13c7fd[_0x029a('0x61')],{'firstName':_0x13c7fd[_0x029a('0x61')][_0x029a('0xa6')],'phone':_0x13c7fd[_0x029a('0x61')]['from'],'ListId':_0x25d4be[_0x029a('0x96')]});_0x448042[_0x13c7fd[_0x029a('0x61')][_0x029a('0xce')]]=_0x13c7fd[_0x029a('0x61')][_0x029a('0xa6')];return db[_0x029a('0x8f')][_0x029a('0xd2')]({'where':_0x454609,'defaults':_0x448042});}})[_0x029a('0xbb')](function(_0x1b86a4){if(_0x1b86a4){_0x1e9209=_0x1b86a4;var _0x4db4a0=fs[_0x029a('0xd3')](path[_0x029a('0x77')](config['root'],_0x029a('0xd4')),_0x029a('0xd5'));var _0x4f6df1=ejs['render'](_0x4db4a0,{'body':_[_0x029a('0xd6')](_0x13c7fd[_0x029a('0x61')][_0x029a('0x61')]),'bodyTitle':_0x13b581[_0x029a('0xd7')]});return db[_0x029a('0xd8')]['create']({'body':_0x4f6df1,'ContactId':_0x1b86a4['id'],'ChatWebsiteId':_0x13b581['id']});}})['then'](function(_0x3e4892){_0x4f4a2b=_0x3e4892;if(_0x90ddcd[_0x029a('0x48')]){var _0xe51488=_0x90ddcd[_0x029a('0x3e')](function(_0xe7daf2){return{'name':_0xe7daf2[_0x029a('0xd9')],'basename':_0xe7daf2[_0x029a('0x70')],'type':_0xe7daf2['mimetype'],'ChatOfflineMessageId':_0x3e4892['id']};});_0x10ad4f=_0xe51488[_0x029a('0x3e')](_0x3800ba=>{var _0x3823a8={'filename':_0x3800ba['name'],'path':path[_0x029a('0x77')](config[_0x029a('0x78')],_0x029a('0xda'),_0x029a('0xcc'),_0x029a('0xdb'),'offline-chat',_0x3800ba[_0x029a('0xdc')])};return _0x3823a8;});if(!_0x13b581['openNewInteraction']){return db[_0x029a('0xdd')]['transaction'](function(_0x18077c){return db[_0x029a('0xde')]['bulkCreate'](_0xe51488,{'transaction':_0x18077c});});}}})[_0x029a('0x37')](function(){if(_0x4f4a2b){_0x3e06a9=_0x4f4a2b;return db[_0x029a('0xd1')]['findOne']({'where':{'active':!![]},'include':[{'model':db[_0x029a('0xdf')],'as':_0x029a('0xe0'),'raw':!![]}]});}})[_0x029a('0x37')](function(_0x3f68fd){if(_0x3f68fd&&_0x3f68fd['Smtp']&&_0x13b581[_0x029a('0xe1')]&&_0x13b581[_0x029a('0xe2')]){var _0xbb6152={'tls':{'rejectUnauthorized':![]}};if(_0x3f68fd[_0x029a('0xe0')][_0x029a('0xe3')]){_0xbb6152[_0x029a('0xe3')]=_0x3f68fd['Smtp'][_0x029a('0xe3')];}else{_0xbb6152[_0x029a('0xe4')]=_0x3f68fd[_0x029a('0xe0')][_0x029a('0xe4')];_0xbb6152['port']=_0x3f68fd['Smtp'][_0x029a('0xe5')];_0xbb6152['secure']=_0x3f68fd[_0x029a('0xe0')][_0x029a('0xe6')];}if(_0x3f68fd[_0x029a('0xe0')][_0x029a('0xe7')]){_0xbb6152['auth']={'user':_0x3f68fd[_0x029a('0xe0')]['user'],'pass':_0x3f68fd[_0x029a('0xe0')][_0x029a('0xe8')]};}return respondWithRpcPromise('SendMail',_0x029a('0xe9'),{'account':_0xbb6152,'message':{'from':util['format'](_0x029a('0xea'),_0x3f68fd[_0x029a('0x3c')],_0x3f68fd[_0x029a('0xeb')]||_0x3f68fd[_0x029a('0xe0')][_0x029a('0x5a')]),'to':_0x13b581['forwardOfflineAddress'],'subject':_0x13b581['offlineMessageSubject'],'html':_0x3e06a9[_0x029a('0x61')],'attachments':_0x10ad4f}},client9003)['then'](function(){return _0x3e06a9;})['catch'](function(_0x5c5686){console[_0x029a('0x26')](_0x5c5686);});}})[_0x029a('0x37')](function(){if(_0x13b581&&_0x13b581[_0x029a('0xec')]&&_0x13b581[_0x029a('0xed')]){var _0x236f75=[];if(_0x90ddcd[_0x029a('0x48')]){_0x236f75=_0x90ddcd['map'](function(_0x338895){return{'name':_0x338895['originalname'],'basename':_0x338895[_0x029a('0x70')],'type':_0x338895[_0x029a('0xee')],'ChatOfflineMessageId':_0x4f4a2b['id']};});}var _0x5117ec;if(!_[_0x029a('0x81')](_0x13b581[_0x029a('0xef')])){var _0x34edab=_[_0x029a('0x3e')](_0x13c7fd[_0x029a('0x61')],function(_0x458877){return _0x458877;});var _0x3cac01=_[_0x029a('0xf0')](_0x34edab)[0x0];var _0x24025a=_['mapValues'](_0x3cac01,function(_0x434cea){return _0x434cea;});_0x5117ec=_0x24025a[0x1][_0x13b581[_0x029a('0xef')]];}var _0x4de7a5={'from':_0x1e9209[_0x029a('0xeb')],'firstName':_0x1e9209[_0x029a('0xab')],'lastName':_0x1e9209[_0x029a('0xac')],'mapKey':_0x029a('0xeb'),'message':{'from':_0x1e9209[_0x029a('0xeb')],'to':_0x13b581[_0x029a('0xd1')][_0x029a('0xeb')],'cc':'','subject':_[_0x029a('0x81')](_0x5117ec)?_0x13b581[_0x029a('0xf1')]:_0x5117ec,'messageId':'','sentAt':new Date(),'attach':_0x236f75['length'],'attachments':_0x236f75,'originChannel':'Chat','ChatWebsiteId':_0x13b581['id'],'ChatOfflineMessageId':_0x3e06a9['id'],'originTo':_0x13b581[_0x029a('0xd1')][_0x029a('0xeb')]},'body':_0x3e06a9[_0x029a('0x61')]};var _0x468568={'account':{'id':_0x13b581[_0x029a('0xed')]},'body':_0x4de7a5,'log':'NotifyMailAccount'};return respondWithRpcPromise('NotifyMailAccount','notifyMail',_0x468568,client9001)['then'](function(){return _0x3e06a9;})[_0x029a('0x2b')](function(_0x2e4817){console[_0x029a('0x26')](_0x2e4817);});}return;})['then'](function(){if(_0x3e06a9){return _0x3e06a9;}})['then'](respondWithResult(_0x2c3980,null))['catch'](function(_0x22c565){console[_0x029a('0x26')](_0x029a('0x2b'),_0x22c565);for(var _0x308701 of _0x90ddcd){var _0x17e5c0=path[_0x029a('0x77')](config['root'],_0x029a('0xda'),_0x029a('0xcc'),_0x029a('0xdb'),_0x029a('0xf2'),_0x308701['filename']);fs_extra['remove'](_0x17e5c0)['catch'](function(_0x54573e){console[_0x029a('0x26')]('Could\x20not\x20remove\x20attachment\x20file',_0x17e5c0,_0x54573e);});}});};exports[_0x029a('0xf3')]=function(_0x2bebad,_0x1d0097,_0x500553){return db[_0x029a('0xba')][_0x029a('0x5d')]({'where':{'id':_0x2bebad['params']['id']}})['then'](handleEntityNotFound(_0x1d0097,null))[_0x029a('0x37')](function(_0x13edb7){if(_0x13edb7){return _0x13edb7[_0x029a('0xf3')](_0x2bebad[_0x029a('0x61')][_0x029a('0x6a')],_[_0x029a('0xf4')](_0x2bebad[_0x029a('0x61')],[_0x029a('0x6a'),'id'])||{});}})[_0x029a('0x37')](respondWithResult(_0x1d0097,null))[_0x029a('0x2b')](handleError(_0x1d0097,null));};exports[_0x029a('0xf5')]=function(_0x5ec98f,_0x3ea336,_0x138e87){var _0x4058e6={'raw':![],'where':{}};var _0x2b9154={};var _0x222dd8={'count':0x0,'rows':[]};return db[_0x029a('0x3f')]['findOne']({'where':{'id':_0x5ec98f[_0x029a('0x62')]['id']}})[_0x029a('0x37')](handleEntityNotFound(_0x3ea336,null))[_0x029a('0x37')](function(_0x1c8e86){if(_0x1c8e86){_0x2b9154['model']=_[_0x029a('0x57')](db[_0x029a('0xba')]['rawAttributes']);_0x2b9154[_0x029a('0x44')]=_['keys'](_0x5ec98f[_0x029a('0x44')]);_0x2b9154[_0x029a('0x45')]=_[_0x029a('0x46')](_0x2b9154[_0x029a('0x43')],_0x2b9154['query']);_0x4058e6['attributes']=_[_0x029a('0x46')](_0x2b9154[_0x029a('0x43')],qs[_0x029a('0x58')](_0x5ec98f[_0x029a('0x44')][_0x029a('0x58')]));_0x4058e6[_0x029a('0x47')]=_0x4058e6[_0x029a('0x47')]['length']?_0x4058e6[_0x029a('0x47')]:_0x2b9154['model'];if(!_0x5ec98f[_0x029a('0x44')]['hasOwnProperty'](_0x029a('0xf6'))){_0x4058e6[_0x029a('0x2e')]=qs['limit'](_0x5ec98f[_0x029a('0x44')][_0x029a('0x2e')]);_0x4058e6['offset']=qs[_0x029a('0x30')](_0x5ec98f['query'][_0x029a('0x30')]);}_0x4058e6['order']=qs[_0x029a('0x68')](_0x5ec98f['query']['sort']);_0x4058e6[_0x029a('0x4c')]=qs['filters'](_[_0x029a('0x4a')](_0x5ec98f['query'],_0x2b9154['filters']));_0x4058e6[_0x029a('0x4c')][_0x029a('0x65')]=_0x1c8e86['id'];if(_0x5ec98f[_0x029a('0x44')][_0x029a('0x4b')]){_0x4058e6[_0x029a('0x4c')]=_[_0x029a('0x4d')](_0x4058e6[_0x029a('0x4c')],{'$or':_[_0x029a('0x3e')](_0x4058e6[_0x029a('0x47')],function(_0x4dcaa5){var _0x347648={};_0x347648[_0x4dcaa5]={'$like':'%'+_0x5ec98f['query'][_0x029a('0x4b')]+'%'};return _0x347648;})});}_0x4058e6=_[_0x029a('0x4d')]({},_0x4058e6,_0x5ec98f[_0x029a('0x4f')]);return db[_0x029a('0xba')][_0x029a('0x2f')]({'where':_0x4058e6['where']})[_0x029a('0x37')](function(_0x369ba5){_0x222dd8[_0x029a('0x2f')]=_0x369ba5;if(_0x5ec98f['query'][_0x029a('0x50')]){_0x4058e6[_0x029a('0x51')]=[{'model':db[_0x029a('0x8f')],'as':'Contact','required':![]},{'model':db[_0x029a('0xc4')],'as':'Owner','attributes':[_0x029a('0x3c'),_0x029a('0xf7'),_0x029a('0xf8')],'required':![]},{'model':db[_0x029a('0xf9')],'as':'Tags','attributes':['id','name',_0x029a('0xfa')],'where':_0x5ec98f[_0x029a('0x44')][_0x029a('0xfb')]?{'id':_0x5ec98f[_0x029a('0x44')]['tag']}:undefined,'required':_0x5ec98f[_0x029a('0x44')][_0x029a('0xfb')]?!![]:![]}];}return db['ChatInteraction'][_0x029a('0x52')](_0x4058e6);})['then'](function(_0xd5f7fd){_0x222dd8[_0x029a('0x53')]=_0xd5f7fd;return _0x222dd8;});}})[_0x029a('0x37')](respondWithFilteredResult(_0x3ea336,_0x4058e6))[_0x029a('0x2b')](handleError(_0x3ea336,null));};function iftimePromise(_0x524b02,_0x1b35e0){return respondWithRpcPromise(_0x029a('0xfc'),_0x029a('0xfd'),{'command':_0x1b35e0[_0x029a('0xfe')]?util[_0x029a('0xb1')](_0x029a('0xff'),_0x524b02[_0x029a('0x100')],_0x1b35e0[_0x029a('0xfe')]):util['format'](_0x029a('0x101'),_0x524b02[_0x029a('0x100')])},client9002)['then'](function(_0xc21097){var _0x91c95a=_0xc21097&&_0xc21097['indexOf'](_0x029a('0x102'))>=0x0?!![]:![];logger[_0x029a('0x29')](_0x029a('0x103'),_0x1b35e0['id'],_0x524b02['id'],_0x524b02[_0x029a('0x100')],_0x91c95a?'ONLINE':_0x029a('0x104'),_0x1b35e0[_0x029a('0xfe')]?_0x1b35e0[_0x029a('0xfe')]:_0x029a('0x105'));return _0x91c95a;})['catch'](function(_0x2e07a4){logger[_0x029a('0x26')](_0x029a('0x103'),_0x1b35e0['id'],_0x524b02['id'],_0x524b02[_0x029a('0x100')],util[_0x029a('0x106')](_0x2e07a4,{'showHidden':![],'depth':null}),_0x1b35e0['timezone']?_0x1b35e0['timezone']:_0x029a('0x105'));return![];});}exports[_0x029a('0xfd')]=function(_0x36fc52,_0x5e75a5,_0x5bc14a){var _0x388d2f=0x0;var _0x7fad6b=0x0;var _0x2b445a=![];var _0xfa2456;var _0x5b4b7d;return db['ChatWebsite'][_0x029a('0x5d')]({'where':{'id':_0x36fc52[_0x029a('0x62')]['id']},'include':[{'model':db[_0x029a('0x107')],'as':_0x029a('0x107'),'include':[{'model':db[_0x029a('0x107')],'as':_0x029a('0x108'),'attributes':['id',_0x029a('0x100')],'raw':!![]}]}]})['then'](handleEntityNotFound(_0x5e75a5,null))[_0x029a('0x37')](function(_0x47a76e){if(_0x47a76e){_0xfa2456=_0x47a76e;return _0x47a76e['getProactiveActions']({'raw':!![]});}})['then'](function(_0xaed838){if(_0xfa2456){if(_0xaed838){_0x5b4b7d=_0xaed838;}}return require(_0x029a('0x16'))['getLicense']();})[_0x029a('0x37')](function(_0x12c50c){if(_0x12c50c){_0x7fad6b=_0x12c50c[_0x029a('0x109')];_0x2b445a=_0x12c50c[_0x029a('0x10a')];}})['then'](function(){return db[_0x029a('0xba')][_0x029a('0x2f')]({'where':{'closed':![]}});})[_0x029a('0x37')](function(_0x12d0d4){_0x388d2f=_0x12d0d4;if(_0x7fad6b&&_0x12d0d4>_0x7fad6b){return db[_0x029a('0x10b')][_0x029a('0x6d')]({'where':{'id':0x1}})['then'](function(_0x4478f0){if(_0x4478f0){_0x4478f0[_0x029a('0x10c')]('chatLicenseExceeded');}});}})[_0x029a('0x37')](function(){if(_0xfa2456[_0x029a('0x107')]&&_0xfa2456[_0x029a('0x107')]['Intervals']){var _0xc16b15=[];for(var _0x44c484=0x0;_0x44c484<_0xfa2456[_0x029a('0x107')][_0x029a('0x108')][_0x029a('0x48')];_0x44c484++){var _0x84edae=_0xfa2456[_0x029a('0x107')][_0x029a('0x108')][_0x44c484][_0x029a('0x38')]({'plain':!![]});_0xc16b15[_0x029a('0xbf')](iftimePromise(_0x84edae,_0xfa2456));}return BPromise[_0x029a('0x10d')](_0xc16b15)['then'](function(_0x44dff9){return _[_0x029a('0x10e')](_0x44dff9);});}else{return!![];}})['then'](function(_0x6afebb){var _0x3d52a3=fs[_0x029a('0xd3')](path[_0x029a('0x77')](config[_0x029a('0x78')],'server/files/chat/iframe.ejs'),_0x029a('0xd5'));var _0x3526fd={'remote':_0xfa2456[_0x029a('0x10f')],'query':querystring[_0x029a('0x25')](_[_0x029a('0x4d')](_0xfa2456['get']({'plain':!![]}),{'customerIp':_0x36fc52[_0x029a('0x8b')]['x-forwarded-for']||_0x36fc52['headers'][_0x029a('0x110')]||_0x36fc52['connection'][_0x029a('0x111')]||_0x36fc52['ip'],'referer':_0x36fc52[_0x029a('0x8b')]['referer'],'openedInteractions':_0x388d2f,'maxInteractions':_0x7fad6b,'virtual':_0x2b445a[_0x029a('0x109')],'online':_0x6afebb,'custom':_0x2b445a}))[_0x029a('0x112')](/'/g,'\x5c\x27')};_0x5e75a5['send'](ejs[_0x029a('0x113')](Mustache[_0x029a('0x113')](_0x3d52a3,_0x3526fd),{'proactiveActions':_0x5b4b7d,'alignment':_0xfa2456[_0x029a('0x114')],'verticalAlignment':_0xfa2456['verticalAlignment'],'div_color':_0xfa2456[_0x029a('0xfa')],'text_color':_0xfa2456[_0x029a('0x115')],'button_color':_0xfa2456[_0x029a('0x116')],'background_color':_0xfa2456[_0x029a('0x117')]}));})[_0x029a('0x2b')](handleError(_0x5e75a5,null));};exports[_0x029a('0x118')]=function(_0x2904e7,_0x2c4473,_0x27bc8e){return db[_0x029a('0x3f')][_0x029a('0x6d')]({'where':{'id':_0x2904e7[_0x029a('0x62')]['id']}})[_0x029a('0x37')](handleEntityNotFound(_0x2c4473,null))['then'](function(_0x422d2b){if(_0x422d2b){return db[_0x029a('0xdd')][_0x029a('0x119')](function(_0x4c580a){return db[_0x029a('0x9f')][_0x029a('0x36')]({'where':{'ChatWebsiteId':_0x2904e7[_0x029a('0x62')]['id']},'transaction':_0x4c580a})[_0x029a('0x37')](function(_0xbe5a0b){var _0x44159f=_[_0x029a('0x3e')](_0x2904e7[_0x029a('0x61')],function(_0x54ac1e){_0x54ac1e['ChatWebsiteId']=_0x2904e7[_0x029a('0x62')]['id'];return _0x54ac1e;});return db[_0x029a('0x9f')]['bulkCreate'](_0x44159f,{'transaction':_0x4c580a});});})['then'](function(){return db[_0x029a('0x9f')]['findAndCountAll']({'where':{'ChatWebsiteId':_0x2904e7[_0x029a('0x62')]['id']},'order':_0x029a('0xa4')});});}})[_0x029a('0x37')](respondWithResult(_0x2c4473,null))[_0x029a('0x2b')](handleError(_0x2c4473,null));};exports[_0x029a('0x11a')]=function(_0x5c7f85,_0x3bf2cd,_0x5384b4){var _0x4e9407={};var _0xc207b={};var _0x597c04;var _0x4c5ecb;return db[_0x029a('0x3f')][_0x029a('0x6d')]({'where':{'id':_0x5c7f85[_0x029a('0x62')]['id']}})[_0x029a('0x37')](handleEntityNotFound(_0x3bf2cd,null))[_0x029a('0x37')](function(_0x17b0fd){if(_0x17b0fd){_0x597c04=_0x17b0fd;_0xc207b[_0x029a('0x43')]=_[_0x029a('0x57')](db[_0x029a('0x9f')][_0x029a('0x40')]);_0xc207b[_0x029a('0x44')]=_[_0x029a('0x57')](_0x5c7f85[_0x029a('0x44')]);_0xc207b[_0x029a('0x45')]=_[_0x029a('0x46')](_0xc207b[_0x029a('0x43')],_0xc207b['query']);_0x4e9407[_0x029a('0x47')]=_[_0x029a('0x46')](_0xc207b[_0x029a('0x43')],qs[_0x029a('0x58')](_0x5c7f85['query']['fields']));_0x4e9407['attributes']=_0x4e9407[_0x029a('0x47')][_0x029a('0x48')]?_0x4e9407[_0x029a('0x47')]:_0xc207b[_0x029a('0x43')];_0x4e9407[_0x029a('0x49')]=qs['sort'](_0x5c7f85[_0x029a('0x44')][_0x029a('0x68')]);_0x4e9407['where']=qs['filters'](_[_0x029a('0x4a')](_0x5c7f85[_0x029a('0x44')],_0xc207b[_0x029a('0x45')]));if(_0x5c7f85[_0x029a('0x44')][_0x029a('0x4b')]){_0x4e9407[_0x029a('0x4c')]=_[_0x029a('0x4d')](_0x4e9407['where'],{'$or':_['map'](_0x4e9407['attributes'],function(_0x255334){var _0x5334a9={};_0x5334a9[_0x255334]={'$like':'%'+_0x5c7f85['query']['filter']+'%'};return _0x5334a9;})});}_0x4e9407=_['merge']({},_0x4e9407,_0x5c7f85[_0x029a('0x4f')]);return _0x597c04[_0x029a('0x11a')](_0x4e9407);}})[_0x029a('0x37')](function(_0x247835){if(_0x247835){_0x4c5ecb=_0x247835[_0x029a('0x48')];if(!_0x5c7f85[_0x029a('0x44')][_0x029a('0x67')](_0x029a('0xf6'))){_0x4e9407[_0x029a('0x2e')]=qs[_0x029a('0x2e')](_0x5c7f85[_0x029a('0x44')][_0x029a('0x2e')]);_0x4e9407[_0x029a('0x30')]=qs[_0x029a('0x30')](_0x5c7f85[_0x029a('0x44')][_0x029a('0x30')]);}return _0x597c04[_0x029a('0x11a')](_0x4e9407);}})[_0x029a('0x37')](function(_0x2b102b){if(_0x2b102b){return _0x2b102b?{'count':_0x4c5ecb,'rows':_0x2b102b}:null;}})[_0x029a('0x37')](respondWithResult(_0x3bf2cd,null))[_0x029a('0x2b')](handleError(_0x3bf2cd,null));};exports['addProactiveActions']=function(_0x1f8609,_0x5b2a63,_0x2907b6){return db['chatProactiveAction'][_0x029a('0x5d')]({'where':{'id':_0x1f8609[_0x029a('0x62')]['id']}})['then'](handleEntityNotFound(_0x5b2a63,null))[_0x029a('0x37')](function(_0x170a02){if(_0x170a02){return _0x170a02['addProactiveActions'](_0x1f8609[_0x029a('0x61')]['ids'],_[_0x029a('0xf4')](_0x1f8609['body'],[_0x029a('0x6a'),'id'])||{});}})[_0x029a('0x37')](respondWithResult(_0x5b2a63,null))['catch'](handleError(_0x5b2a63,null));};exports[_0x029a('0x11b')]=function(_0x58c3a5,_0x3e0a02,_0x212de7){var _0x2cfd81={};var _0x2e90c6={};var _0x249245;var _0x3e00c6;return db[_0x029a('0x3f')][_0x029a('0x6d')]({'where':{'id':_0x58c3a5[_0x029a('0x62')]['id']}})['then'](handleEntityNotFound(_0x3e0a02,null))['then'](function(_0x176a8f){if(_0x176a8f){_0x249245=_0x176a8f;_0x2e90c6[_0x029a('0x43')]=_['keys'](db[_0x029a('0x11c')][_0x029a('0x40')]);_0x2e90c6['query']=_[_0x029a('0x57')](_0x58c3a5[_0x029a('0x44')]);_0x2e90c6[_0x029a('0x45')]=_[_0x029a('0x46')](_0x2e90c6[_0x029a('0x43')],_0x2e90c6[_0x029a('0x44')]);_0x2cfd81['attributes']=_[_0x029a('0x46')](_0x2e90c6['model'],qs[_0x029a('0x58')](_0x58c3a5[_0x029a('0x44')][_0x029a('0x58')]));_0x2cfd81[_0x029a('0x47')]=_0x2cfd81[_0x029a('0x47')][_0x029a('0x48')]?_0x2cfd81['attributes']:_0x2e90c6['model'];_0x2cfd81[_0x029a('0x49')]=qs[_0x029a('0x68')](_0x58c3a5[_0x029a('0x44')][_0x029a('0x68')]);_0x2cfd81[_0x029a('0x4c')]=qs['filters'](_['pick'](_0x58c3a5[_0x029a('0x44')],_0x2e90c6[_0x029a('0x45')]));if(_0x58c3a5['query'][_0x029a('0x4b')]){_0x2cfd81[_0x029a('0x4c')]=_[_0x029a('0x4d')](_0x2cfd81[_0x029a('0x4c')],{'$or':_['map'](_0x2cfd81[_0x029a('0x47')],function(_0x161a26){var _0x57e3e6={};_0x57e3e6[_0x161a26]={'$like':'%'+_0x58c3a5['query'][_0x029a('0x4b')]+'%'};return _0x57e3e6;})});}_0x2cfd81=_['merge']({},_0x2cfd81,_0x58c3a5[_0x029a('0x4f')]);return _0x249245['getProactiveActions'](_0x2cfd81);}})[_0x029a('0x37')](function(_0x323cd7){if(_0x323cd7){_0x3e00c6=_0x323cd7[_0x029a('0x48')];if(!_0x58c3a5[_0x029a('0x44')]['hasOwnProperty'](_0x029a('0xf6'))){_0x2cfd81[_0x029a('0x2e')]=qs[_0x029a('0x2e')](_0x58c3a5['query']['limit']);_0x2cfd81['offset']=qs[_0x029a('0x30')](_0x58c3a5[_0x029a('0x44')][_0x029a('0x30')]);}return _0x249245[_0x029a('0x11b')](_0x2cfd81);}})[_0x029a('0x37')](function(_0x39a734){if(_0x39a734){return _0x39a734?{'count':_0x3e00c6,'rows':_0x39a734}:null;}})[_0x029a('0x37')](respondWithResult(_0x3e0a02,null))[_0x029a('0x2b')](handleError(_0x3e0a02,null));};exports['getFields']=function(_0x5dba35,_0x5cc3d6,_0x59f473){var _0x5f1383=_0x5dba35[_0x029a('0x44')]['online']===_0x029a('0x11d')?_0x029a('0x11e'):'onlineForm';return db[_0x029a('0x3f')][_0x029a('0x5d')]({'attributes':['id',_0x5f1383],'where':{'id':_0x5dba35[_0x029a('0x62')]['id']}})[_0x029a('0x37')](handleEntityNotFound(_0x5cc3d6,null))[_0x029a('0x37')](function(_0x2a0b08){if(_0x2a0b08){var _0x533799=_0x2a0b08[_0x5f1383];var _0x3e068f=_0x533799&&_0x533799[_0x029a('0x11f')]?_0x533799[_0x029a('0x11f')]:[];_0x5cc3d6[_0x029a('0x3d')]({'fromKey':_[_0x029a('0x81')](_0x533799[_0x029a('0x120')])?undefined:_0x533799[_0x029a('0x120')],'count':_0x3e068f['length'],'rows':_0x3e068f});}})[_0x029a('0x2b')](handleError(_0x5cc3d6,null));};exports['getOfflineMessages']=function(_0x4764fe,_0x39e5d1,_0x10f25e){var _0x35b3ba={'raw':![],'where':{}};var _0x56b93b={};var _0x4228c8={'count':0x0,'rows':[]};return db['ChatWebsite'][_0x029a('0x6d')]({'where':{'id':_0x4764fe[_0x029a('0x62')]['id']}})[_0x029a('0x37')](handleEntityNotFound(_0x39e5d1,null))['then'](function(_0x4fb4fe){if(_0x4fb4fe){_0x56b93b[_0x029a('0x43')]=_[_0x029a('0x57')](db[_0x029a('0xd8')][_0x029a('0x40')]);_0x56b93b[_0x029a('0x44')]=_[_0x029a('0x57')](_0x4764fe[_0x029a('0x44')]);_0x56b93b[_0x029a('0x45')]=_['intersection'](_0x56b93b[_0x029a('0x43')],_0x56b93b[_0x029a('0x44')]);_0x35b3ba[_0x029a('0x47')]=_[_0x029a('0x46')](_0x56b93b[_0x029a('0x43')],qs['fields'](_0x4764fe[_0x029a('0x44')][_0x029a('0x58')]));_0x35b3ba[_0x029a('0x47')]=_0x35b3ba[_0x029a('0x47')]['length']?_0x35b3ba[_0x029a('0x47')]:_0x56b93b['model'];if(!_0x4764fe['query'][_0x029a('0x67')](_0x029a('0xf6'))){_0x35b3ba[_0x029a('0x2e')]=qs[_0x029a('0x2e')](_0x4764fe[_0x029a('0x44')]['limit']);_0x35b3ba[_0x029a('0x30')]=qs[_0x029a('0x30')](_0x4764fe[_0x029a('0x44')][_0x029a('0x30')]);}_0x35b3ba['order']=qs[_0x029a('0x68')](_0x4764fe['query'][_0x029a('0x68')]);_0x35b3ba[_0x029a('0x4c')]=qs[_0x029a('0x45')](_[_0x029a('0x4a')](_0x4764fe[_0x029a('0x44')],_0x56b93b[_0x029a('0x45')]));_0x35b3ba[_0x029a('0x4c')][_0x029a('0x65')]=_0x4fb4fe['id'];if(_0x4764fe['query'][_0x029a('0x4b')]){_0x35b3ba[_0x029a('0x4c')]=_[_0x029a('0x4d')](_0x35b3ba[_0x029a('0x4c')],{'$or':_[_0x029a('0x3e')](_0x35b3ba[_0x029a('0x47')],function(_0x4fbb63){var _0x3ea2b2={};_0x3ea2b2[_0x4fbb63]={'$like':'%'+_0x4764fe[_0x029a('0x44')][_0x029a('0x4b')]+'%'};return _0x3ea2b2;})});}_0x35b3ba=_[_0x029a('0x4d')]({},_0x35b3ba,_0x4764fe[_0x029a('0x4f')]);return db[_0x029a('0xd8')]['count']({'where':_0x35b3ba[_0x029a('0x4c')]})[_0x029a('0x37')](function(_0x151258){_0x4228c8[_0x029a('0x2f')]=_0x151258;if(_0x4764fe[_0x029a('0x44')]['includeAll']){_0x35b3ba['include']=[{'all':!![]}];}else{_0x35b3ba[_0x029a('0x51')]=[{'model':db['CmContact'],'as':'Contact','required':![]},{'model':db[_0x029a('0xde')],'as':_0x029a('0x121'),'required':![]}];}return db[_0x029a('0xd8')][_0x029a('0x52')](_0x35b3ba);})[_0x029a('0x37')](function(_0x42e4ee){_0x4228c8[_0x029a('0x53')]=_0x42e4ee;return _0x4228c8;});}})[_0x029a('0x37')](respondWithFilteredResult(_0x39e5d1,_0x35b3ba))[_0x029a('0x2b')](handleError(_0x39e5d1,null));};exports[_0x029a('0x122')]=function(_0x39a43d,_0x39b457,_0x473495){return db[_0x029a('0x3f')][_0x029a('0x5d')]({'where':{'id':_0x39a43d[_0x029a('0x62')]['id']}})[_0x029a('0x37')](handleEntityNotFound(_0x39b457,null))[_0x029a('0x37')](function(_0x482211){if(_0x482211){return _0x482211[_0x029a('0x122')](_0x39a43d[_0x029a('0x61')]['ids'],_[_0x029a('0xf4')](_0x39a43d['body'],[_0x029a('0x6a'),'id'])||{})['spread'](function(_0x3f5449){for(var _0x3acf27=0x0;_0x3acf27<_0x39a43d[_0x029a('0x61')][_0x029a('0x6a')][_0x029a('0x48')];_0x3acf27+=0x1){socket[_0x029a('0x123')](_0x029a('0x124'),{'UserId':Number(_0x39a43d[_0x029a('0x61')][_0x029a('0x6a')][_0x3acf27]),'ChatWebsiteId':Number(_0x39a43d['params']['id'])});}return _0x3f5449;});}})['then'](respondWithResult(_0x39b457,null))[_0x029a('0x2b')](handleError(_0x39b457,null));};exports[_0x029a('0x125')]=function(_0x95c850,_0x2751f1,_0x5bcd2a){return db[_0x029a('0x3f')][_0x029a('0x5d')]({'where':{'id':_0x95c850['params']['id']}})[_0x029a('0x37')](handleEntityNotFound(_0x2751f1,null))[_0x029a('0x37')](function(_0x215b1e){if(_0x215b1e){return _0x215b1e['removeAgents'](_0x95c850[_0x029a('0x44')][_0x029a('0x6a')])[_0x029a('0x37')](function(){if(_[_0x029a('0x126')](_0x95c850[_0x029a('0x44')][_0x029a('0x6a')])){for(var _0x213d20=0x0;_0x213d20<_0x95c850[_0x029a('0x44')]['ids'][_0x029a('0x48')];_0x213d20+=0x1){socket[_0x029a('0x123')](_0x029a('0x127'),{'UserId':Number(_0x95c850['query'][_0x029a('0x6a')][_0x213d20]),'ChatWebsiteId':Number(_0x95c850[_0x029a('0x62')]['id'])});}}else{socket[_0x029a('0x123')](_0x029a('0x127'),{'UserId':Number(_0x95c850[_0x029a('0x44')][_0x029a('0x6a')]),'ChatWebsiteId':Number(_0x95c850[_0x029a('0x62')]['id'])});}});}})[_0x029a('0x37')](respondWithStatusCode(_0x2751f1,null))[_0x029a('0x2b')](handleError(_0x2751f1,null));};exports[_0x029a('0x128')]=function(_0x3a29b8,_0x56a38a,_0x302c1f){var _0x269427={};var _0x1eb0f6={};var _0x47c7fa;var _0x5f403b;return db[_0x029a('0x3f')]['findOne']({'where':{'id':_0x3a29b8[_0x029a('0x62')]['id']}})[_0x029a('0x37')](handleEntityNotFound(_0x56a38a,null))['then'](function(_0xa72199){if(_0xa72199){_0x47c7fa=_0xa72199;_0x1eb0f6[_0x029a('0x43')]=_[_0x029a('0x57')](db['User'][_0x029a('0x40')]);_0x1eb0f6[_0x029a('0x44')]=_[_0x029a('0x57')](_0x3a29b8[_0x029a('0x44')]);_0x1eb0f6['filters']=_[_0x029a('0x46')](_0x1eb0f6[_0x029a('0x43')],_0x1eb0f6[_0x029a('0x44')]);_0x269427[_0x029a('0x47')]=_['intersection'](_0x1eb0f6[_0x029a('0x43')],qs[_0x029a('0x58')](_0x3a29b8['query'][_0x029a('0x58')]));_0x269427[_0x029a('0x47')]=_0x269427[_0x029a('0x47')]['length']?_0x269427['attributes']:_0x1eb0f6[_0x029a('0x43')];_0x269427[_0x029a('0x49')]=qs['sort'](_0x3a29b8[_0x029a('0x44')]['sort']);_0x269427[_0x029a('0x4c')]=qs[_0x029a('0x45')](_[_0x029a('0x4a')](_0x3a29b8[_0x029a('0x44')],_0x1eb0f6[_0x029a('0x45')]));if(_0x3a29b8['query'][_0x029a('0x4b')]){_0x269427['where']=_[_0x029a('0x4d')](_0x269427[_0x029a('0x4c')],{'$or':_[_0x029a('0x3e')](_0x269427['attributes'],function(_0x4ba434){var _0x28c1dd={};_0x28c1dd[_0x4ba434]={'$like':'%'+_0x3a29b8[_0x029a('0x44')][_0x029a('0x4b')]+'%'};return _0x28c1dd;})});}_0x269427=_[_0x029a('0x4d')]({},_0x269427,_0x3a29b8[_0x029a('0x4f')]);return _0x47c7fa[_0x029a('0x128')](_0x269427);}})[_0x029a('0x37')](function(_0x21f19a){if(_0x21f19a){_0x5f403b=_0x21f19a[_0x029a('0x48')];if(!_0x3a29b8['query'][_0x029a('0x67')](_0x029a('0xf6'))){_0x269427[_0x029a('0x2e')]=qs[_0x029a('0x2e')](_0x3a29b8['query'][_0x029a('0x2e')]);_0x269427[_0x029a('0x30')]=qs[_0x029a('0x30')](_0x3a29b8[_0x029a('0x44')][_0x029a('0x30')]);}return _0x47c7fa['getAgents'](_0x269427);}})[_0x029a('0x37')](function(_0x29e3ae){if(_0x29e3ae){return _0x29e3ae?{'count':_0x5f403b,'rows':_0x29e3ae}:null;}})['then'](respondWithResult(_0x56a38a,null))[_0x029a('0x2b')](handleError(_0x56a38a,null));};
\ No newline at end of file
+var _0x001c=['mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','CmList','List','Contacts','updatedAt','Applications','applications','list','orderBy','priority','asc','account','cf-connecting-ip','headers','first','x-forwarded-for','split','firstName','lastName','x-real-port','referer','browser','version','format','%s\x20%s','unknown','device','vendor','%s\x20%s\x20%s','threadId','ChatInteraction','externalUrl','ContactId','interaction','spread','contact','messageId','created','autoclose','push','close','*,*,*,*','ChatMessage','AttachmentId','User','UserId','unshift','agent','waitForTheAssignedAgent','forcedOwnership','Start','startRouting','EventManager','files','CompanyId','mapKeyOffline','includes','mapKeyOffline\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','MailAccount','readFileSync','server/files/templates/chatOfflineMessage.ejs','utf8','offlineMessageBody','ChatOfflineMessage','originalname','server','attachments','basename','openNewInteraction','sequelize','transaction','Attachment','bulkCreate','MailServerOut','Smtp','forwardOffline','service','host','port','secure','authentication','auth','pass','SendMail','sendMail','email','offlineMessageSubject','MailAccountId','mimetype','subjectOffline','toPairsIn','Chat','NotifyMailAccount','notifyMail','Could\x20not\x20remove\x20attachment\x20file','addInteraction','getInteractions','Contact','fullname','Tag','color','tag','getSnippet','timezone','iftime\x20%s,%s','interval','iftime\x20%s','indexOf','true','[%s][INTERVAL][%s]\x20%s\x20%s\x20(%s)','ONLINE','No\x20timezone','inspect','Interval','Intervals','getProactiveActions','getLicense','virtual','License','all','some','remote','x-real-ip','connection','remoteAddress','replace','render','alignment','verticalAlignment','textColor','backgroundColor','ChatApplication','findAndCountAll','getApplications','chatProactiveAction','addProactiveActions','ChatProactiveAction','getFields','online','false','items','Attachments','addAgents','omit','emit','userChatWebsite:save','removeAgents','isArray','userChatWebsite:remove','getAgents','rimraf','fast-json-patch','request-promise','path','to-csv','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../config/utils','../../config/environment','../../mysqldb','redis','defaults','socket.io-emitter','./chatWebsite.socket','register','jayson/promise','client','http','info','ChatWebsite,\x20%s,\x20%s','request\x20sent','debug','ChatWebsite,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','sendStatus','status','json','offset','undefined','count','limit','set','Content-Range','apply','reject','save','destroy','then','get','ChatWebsites','UserProfileResource','end','send','Pause','mandatoryDispositionPause','map','ChatWebsite','rawAttributes','fieldName','type','model','name','query','keys','filters','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','show','params','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','find','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','describe','addDisposition','ChatWebsiteId','Disposition','getDispositions','findOne','removeDispositions','ids','CannedAnswer','getAnswers','removeAnswers','file','addAvatar','agentAvatar','filename','addCustomerAvatar','customerAvatar','addSystemAvatar','systemAvatar','join','server/files/images/logos/default_logo.svg','sitepic','../../config/license/util','custom','isNil','existsSync','root','server/files/images/logos/','download','server/files/images/avatars/default_avatar.png','server/files/images/avatars/','getCustomerAvatar','server/files/images/avatars/customer_avatar.png','showCustomerAvatar','getSystemAvatar','server/files/images/avatars/system_avatar.png','notify','user-agent-parser','setUA','user-agent','getResult','chat','CmContact','Sequelize','ValidationError','no\x20available\x20attributes','difference','createdAt','ListId','from','from\x20is\x20mandatory','body\x20is\x20mandatory\x20and\x20not\x20empty','mapKey'];(function(_0x6ce469,_0x30fa03){var _0x1bc184=function(_0x7a2465){while(--_0x7a2465){_0x6ce469['push'](_0x6ce469['shift']());}};_0x1bc184(++_0x30fa03);}(_0x001c,0x97));var _0xc001=function(_0x138298,_0x416266){_0x138298=_0x138298-0x0;var _0x1048db=_0x001c[_0x138298];return _0x1048db;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xc001('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0xc001('0x1'));var rp=require(_0xc001('0x2'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require('mustache');var util=require('util');var path=require(_0xc001('0x3'));var sox=require('sox');var csv=require(_0xc001('0x4'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xc001('0x5'));var _=require(_0xc001('0x6'));var squel=require(_0xc001('0x7'));var crypto=require(_0xc001('0x8'));var jsforce=require(_0xc001('0x9'));var deskjs=require(_0xc001('0xa'));var toCsv=require(_0xc001('0x4'));var querystring=require(_0xc001('0xb'));var Papa=require(_0xc001('0xc'));var Redis=require('ioredis');var authService=require(_0xc001('0xd'));var qs=require(_0xc001('0xe'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')('api');var utils=require(_0xc001('0xf'));var config=require(_0xc001('0x10'));var licenseUtil=require('../../config/license/util');var db=require(_0xc001('0x11'))['db'];config[_0xc001('0x12')]=_[_0xc001('0x13')](config[_0xc001('0x12')],{'host':'localhost','port':0x18eb});var socket=require(_0xc001('0x14'))(new Redis(config[_0xc001('0x12')]));require(_0xc001('0x15'))[_0xc001('0x16')](socket);var jayson=require(_0xc001('0x17'));var client=jayson[_0xc001('0x18')][_0xc001('0x19')]({'port':0x232c});var client9002=jayson[_0xc001('0x18')][_0xc001('0x19')]({'port':0x232a});var client9003=jayson['client'][_0xc001('0x19')]({'port':0x232b});var client9001=jayson['client'][_0xc001('0x19')]({'port':0x2329});function respondWithRpcPromise(_0x32bfe4,_0x5dc6b6,_0x47208c,_0x41c0f2){return new BPromise(function(_0x474292,_0x26072e){var _0x53d018=_0x41c0f2||client;return _0x53d018['request'](_0x32bfe4,_0x47208c)['then'](function(_0x326077){logger[_0xc001('0x1a')](_0xc001('0x1b'),_0x5dc6b6,_0xc001('0x1c'));logger[_0xc001('0x1d')](_0xc001('0x1e'),_0x5dc6b6,'request\x20sent',JSON[_0xc001('0x1f')](_0x326077));if(_0x326077['error']){if(_0x326077[_0xc001('0x20')][_0xc001('0x21')]===0x1f4){logger[_0xc001('0x20')](_0xc001('0x1b'),_0x5dc6b6,_0x326077['error'][_0xc001('0x22')]);return _0x26072e(_0x326077[_0xc001('0x20')][_0xc001('0x22')]);}logger[_0xc001('0x20')](_0xc001('0x1b'),_0x5dc6b6,_0x326077[_0xc001('0x20')][_0xc001('0x22')]);return _0x474292(_0x326077[_0xc001('0x20')][_0xc001('0x22')]);}else{logger['info']('ChatWebsite,\x20%s,\x20%s',_0x5dc6b6,_0xc001('0x1c'));_0x474292(_0x326077['result'][_0xc001('0x22')]);}})[_0xc001('0x23')](function(_0x44991f){logger['error'](_0xc001('0x1b'),_0x5dc6b6,_0x44991f);_0x26072e(_0x44991f);});});}function respondWithStatusCode(_0x127e25,_0x2b15ed){_0x2b15ed=_0x2b15ed||0xcc;return function(_0x1101c6){if(_0x1101c6){return _0x127e25[_0xc001('0x24')](_0x2b15ed);}return _0x127e25[_0xc001('0x25')](_0x2b15ed)['end']();};}function respondWithResult(_0x36b3c9,_0x4644e4){_0x4644e4=_0x4644e4||0xc8;return function(_0x363312){if(_0x363312){return _0x36b3c9['status'](_0x4644e4)[_0xc001('0x26')](_0x363312);}};}function respondWithFilteredResult(_0x2cb0c5,_0xb6ae39){return function(_0x1b3efe){if(_0x1b3efe){var _0x4a302a=typeof _0xb6ae39[_0xc001('0x27')]==='undefined'&&typeof _0xb6ae39['limit']===_0xc001('0x28');var _0x49f5a1=_0x1b3efe[_0xc001('0x29')];var _0x5c9367=_0x4a302a?0x0:_0xb6ae39[_0xc001('0x27')];var _0x74671c=_0x4a302a?_0x1b3efe[_0xc001('0x29')]:_0xb6ae39[_0xc001('0x27')]+_0xb6ae39[_0xc001('0x2a')];var _0x113acf;if(_0x74671c>=_0x49f5a1){_0x74671c=_0x49f5a1;_0x113acf=0xc8;}else{_0x113acf=0xce;}_0x2cb0c5[_0xc001('0x25')](_0x113acf);return _0x2cb0c5[_0xc001('0x2b')](_0xc001('0x2c'),_0x5c9367+'-'+_0x74671c+'/'+_0x49f5a1)['json'](_0x1b3efe);}return null;};}function patchUpdates(_0x16988a){return function(_0x494aad){try{jsonpatch[_0xc001('0x2d')](_0x494aad,_0x16988a,!![]);}catch(_0x2837a7){return BPromise[_0xc001('0x2e')](_0x2837a7);}return _0x494aad[_0xc001('0x2f')]();};}function saveUpdates(_0x2cc29d,_0x47921b){return function(_0x5f7b73){if(_0x5f7b73){return _0x5f7b73['update'](_0x2cc29d)['then'](function(_0x5e831e){return _0x5e831e;});}return null;};}function removeEntity(_0x548579,_0x560d4d){return function(_0xbdef8b){if(_0xbdef8b){return _0xbdef8b[_0xc001('0x30')]()[_0xc001('0x31')](function(){var _0x495a69=_0xbdef8b[_0xc001('0x32')]({'plain':!![]});var _0x593111=_0xc001('0x33');return db[_0xc001('0x34')]['destroy']({'where':{'type':_0x593111,'resourceId':_0x495a69['id']}})[_0xc001('0x31')](function(){return _0xbdef8b;});})[_0xc001('0x31')](function(){_0x548579[_0xc001('0x25')](0xcc)[_0xc001('0x35')]();});}};}function handleEntityNotFound(_0x5f3564,_0x186a38){return function(_0x56459a){if(!_0x56459a){_0x5f3564['sendStatus'](0x194);}return _0x56459a;};}function handleError(_0x2f9b69,_0x1943a4){_0x1943a4=_0x1943a4||0x1f4;return function(_0xefa360){logger[_0xc001('0x20')](_0xefa360['stack']);if(_0xefa360['name']){delete _0xefa360['name'];}_0x2f9b69[_0xc001('0x25')](_0x1943a4)[_0xc001('0x36')](_0xefa360);};}exports['index']=function(_0x50d49f,_0x295dac){var _0xd564f6={'include':[{'model':db[_0xc001('0x37')],'as':_0xc001('0x38')}]},_0x3c58f8={},_0x15b966={'count':0x0,'rows':[]};var _0x2ef905=_[_0xc001('0x39')](db[_0xc001('0x3a')][_0xc001('0x3b')],function(_0x7ea924){return{'name':_0x7ea924[_0xc001('0x3c')],'type':_0x7ea924[_0xc001('0x3d')]['key']};});_0x3c58f8[_0xc001('0x3e')]=_[_0xc001('0x39')](_0x2ef905,_0xc001('0x3f'));_0x3c58f8[_0xc001('0x40')]=_[_0xc001('0x41')](_0x50d49f['query']);_0x3c58f8[_0xc001('0x42')]=_['intersection'](_0x3c58f8['model'],_0x3c58f8['query']);_0xd564f6[_0xc001('0x43')]=_[_0xc001('0x44')](_0x3c58f8['model'],qs[_0xc001('0x45')](_0x50d49f[_0xc001('0x40')][_0xc001('0x45')]));_0xd564f6[_0xc001('0x43')]=_0xd564f6[_0xc001('0x43')][_0xc001('0x46')]?_0xd564f6[_0xc001('0x43')]:_0x3c58f8[_0xc001('0x3e')];if(!_0x50d49f[_0xc001('0x40')][_0xc001('0x47')](_0xc001('0x48'))){_0xd564f6[_0xc001('0x2a')]=qs['limit'](_0x50d49f[_0xc001('0x40')][_0xc001('0x2a')]);_0xd564f6[_0xc001('0x27')]=qs[_0xc001('0x27')](_0x50d49f['query'][_0xc001('0x27')]);}_0xd564f6[_0xc001('0x49')]=qs[_0xc001('0x4a')](_0x50d49f[_0xc001('0x40')][_0xc001('0x4a')]);_0xd564f6[_0xc001('0x4b')]=qs[_0xc001('0x42')](_[_0xc001('0x4c')](_0x50d49f[_0xc001('0x40')],_0x3c58f8[_0xc001('0x42')]),_0x2ef905);if(_0x50d49f[_0xc001('0x40')][_0xc001('0x4d')]){_0xd564f6[_0xc001('0x4b')]=_[_0xc001('0x4e')](_0xd564f6['where'],{'$or':_['map'](_0x2ef905,function(_0x3b4c36){if(_0x3b4c36[_0xc001('0x3d')]!==_0xc001('0x4f')){var _0xe405ce={};_0xe405ce[_0x3b4c36[_0xc001('0x3f')]]={'$like':'%'+_0x50d49f[_0xc001('0x40')][_0xc001('0x4d')]+'%'};return _0xe405ce;}})});}_0xd564f6=_['merge']({},_0xd564f6,_0x50d49f[_0xc001('0x50')]);var _0x1eef37={'where':_0xd564f6[_0xc001('0x4b')]};return db[_0xc001('0x3a')][_0xc001('0x29')](_0x1eef37)['then'](function(_0x204ebe){_0x15b966['count']=_0x204ebe;if(_0x50d49f['query'][_0xc001('0x51')]){_0xd564f6[_0xc001('0x52')]=[{'all':!![]}];}return db[_0xc001('0x3a')][_0xc001('0x53')](_0xd564f6);})[_0xc001('0x31')](function(_0x43e2e1){_0x15b966[_0xc001('0x54')]=_0x43e2e1;return _0x15b966;})['then'](respondWithFilteredResult(_0x295dac,_0xd564f6))[_0xc001('0x23')](handleError(_0x295dac,null));};exports[_0xc001('0x55')]=function(_0x3b5d8c,_0x497b56){var _0x1cd7da={'raw':![],'where':{'id':_0x3b5d8c[_0xc001('0x56')]['id']},'include':[{'model':db[_0xc001('0x37')],'as':_0xc001('0x38')}]},_0xa89d1d={};_0xa89d1d[_0xc001('0x3e')]=_[_0xc001('0x41')](db[_0xc001('0x3a')][_0xc001('0x3b')]);_0xa89d1d['query']=_[_0xc001('0x41')](_0x3b5d8c['query']);_0xa89d1d[_0xc001('0x42')]=_[_0xc001('0x44')](_0xa89d1d[_0xc001('0x3e')],_0xa89d1d[_0xc001('0x40')]);_0x1cd7da[_0xc001('0x43')]=_['intersection'](_0xa89d1d['model'],qs[_0xc001('0x45')](_0x3b5d8c[_0xc001('0x40')][_0xc001('0x45')]));_0x1cd7da[_0xc001('0x43')]=_0x1cd7da[_0xc001('0x43')]['length']?_0x1cd7da['attributes']:_0xa89d1d[_0xc001('0x3e')];if(_0x3b5d8c[_0xc001('0x40')][_0xc001('0x51')]){_0x1cd7da[_0xc001('0x52')]=[{'all':!![]}];}_0x1cd7da=_[_0xc001('0x4e')]({},_0x1cd7da,_0x3b5d8c[_0xc001('0x50')]);return db['ChatWebsite']['find'](_0x1cd7da)['then'](handleEntityNotFound(_0x497b56,null))['then'](respondWithResult(_0x497b56,null))[_0xc001('0x23')](handleError(_0x497b56,null));};exports['create']=function(_0x531d2c,_0x2b4ed1){return db[_0xc001('0x3a')][_0xc001('0x57')](_0x531d2c[_0xc001('0x58')],{})['then'](function(_0x79162){var _0x1605e6=_0x531d2c[_0xc001('0x59')][_0xc001('0x32')]({'plain':!![]});if(!_0x1605e6)throw new Error(_0xc001('0x5a'));if(_0x1605e6[_0xc001('0x5b')]===_0xc001('0x59')){var _0x28100b=_0x79162[_0xc001('0x32')]({'plain':!![]});var _0x29e594='ChatWebsites';return db['UserProfileSection'][_0xc001('0x5c')]({'where':{'name':_0x29e594,'userProfileId':_0x1605e6[_0xc001('0x5d')]},'raw':!![]})[_0xc001('0x31')](function(_0x4f3c97){if(_0x4f3c97&&_0x4f3c97[_0xc001('0x5e')]===0x0){return db['UserProfileResource'][_0xc001('0x57')]({'name':_0x28100b[_0xc001('0x3f')],'resourceId':_0x28100b['id'],'type':_0x4f3c97[_0xc001('0x3f')],'sectionId':_0x4f3c97['id']},{})[_0xc001('0x31')](function(){return _0x79162;});}else{return _0x79162;}})[_0xc001('0x23')](function(_0x2d6fe9){logger[_0xc001('0x20')](_0xc001('0x5f'),_0x2d6fe9);throw _0x2d6fe9;});}return _0x79162;})[_0xc001('0x31')](respondWithResult(_0x2b4ed1,0xc9))[_0xc001('0x23')](handleError(_0x2b4ed1,null));};exports[_0xc001('0x60')]=function(_0x53a96f,_0x499b93){if(_0x53a96f['body']['id']){delete _0x53a96f[_0xc001('0x58')]['id'];}return db[_0xc001('0x3a')][_0xc001('0x5c')]({'where':{'id':_0x53a96f[_0xc001('0x56')]['id']},'include':[{'model':db['Pause'],'as':_0xc001('0x38')}]})[_0xc001('0x31')](handleEntityNotFound(_0x499b93,null))[_0xc001('0x31')](saveUpdates(_0x53a96f[_0xc001('0x58')],null))[_0xc001('0x31')](respondWithResult(_0x499b93,null))[_0xc001('0x23')](handleError(_0x499b93,null));};exports[_0xc001('0x30')]=function(_0x4fead5,_0x10b7dc){return db[_0xc001('0x3a')][_0xc001('0x5c')]({'where':{'id':_0x4fead5[_0xc001('0x56')]['id']}})['then'](handleEntityNotFound(_0x10b7dc,null))[_0xc001('0x31')](removeEntity(_0x10b7dc,null))[_0xc001('0x23')](handleError(_0x10b7dc,null));};exports[_0xc001('0x61')]=function(_0x5d4dcc,_0x7ea385){return db[_0xc001('0x3a')][_0xc001('0x61')]()[_0xc001('0x31')](respondWithResult(_0x7ea385,null))['catch'](handleError(_0x7ea385,null));};exports[_0xc001('0x62')]=function(_0x58cc9e,_0x1ad75d,_0x2d61d4){if(_0x58cc9e[_0xc001('0x58')]['id']){delete _0x58cc9e[_0xc001('0x58')]['id'];}return db[_0xc001('0x3a')][_0xc001('0x5c')]({'where':{'id':_0x58cc9e[_0xc001('0x56')]['id']}})['then'](handleEntityNotFound(_0x1ad75d,null))[_0xc001('0x31')](function(_0x392467){if(_0x392467){_0x58cc9e[_0xc001('0x58')][_0xc001('0x63')]=_0x392467['id'];return db[_0xc001('0x64')]['create'](_0x58cc9e[_0xc001('0x58')]);}})[_0xc001('0x31')](respondWithResult(_0x1ad75d,null))[_0xc001('0x23')](handleError(_0x1ad75d,null));};exports[_0xc001('0x65')]=function(_0x410b9f,_0x2664a5,_0x13936b){var _0x49d97a={'raw':![],'where':{}};var _0x542ac5={};var _0x5d1d08={'count':0x0,'rows':[]};return db['ChatWebsite'][_0xc001('0x66')]({'where':{'id':_0x410b9f['params']['id']}})['then'](handleEntityNotFound(_0x2664a5,null))[_0xc001('0x31')](function(_0x5663ee){if(_0x5663ee){_0x542ac5[_0xc001('0x3e')]=_[_0xc001('0x41')](db[_0xc001('0x64')][_0xc001('0x3b')]);_0x542ac5['query']=_['keys'](_0x410b9f[_0xc001('0x40')]);_0x542ac5['filters']=_[_0xc001('0x44')](_0x542ac5[_0xc001('0x3e')],_0x542ac5[_0xc001('0x40')]);_0x49d97a[_0xc001('0x43')]=_['intersection'](_0x542ac5[_0xc001('0x3e')],qs[_0xc001('0x45')](_0x410b9f['query']['fields']));_0x49d97a[_0xc001('0x43')]=_0x49d97a[_0xc001('0x43')][_0xc001('0x46')]?_0x49d97a[_0xc001('0x43')]:_0x542ac5[_0xc001('0x3e')];if(!_0x410b9f['query']['hasOwnProperty']('nolimit')){_0x49d97a[_0xc001('0x2a')]=qs['limit'](_0x410b9f['query']['limit']);_0x49d97a['offset']=qs[_0xc001('0x27')](_0x410b9f[_0xc001('0x40')][_0xc001('0x27')]);}_0x49d97a['order']=qs[_0xc001('0x4a')](_0x410b9f[_0xc001('0x40')][_0xc001('0x4a')]);_0x49d97a[_0xc001('0x4b')]=qs['filters'](_[_0xc001('0x4c')](_0x410b9f[_0xc001('0x40')],_0x542ac5['filters']));_0x49d97a[_0xc001('0x4b')]['ChatWebsiteId']=_0x5663ee['id'];if(_0x410b9f[_0xc001('0x40')]['filter']){_0x49d97a['where']=_[_0xc001('0x4e')](_0x49d97a['where'],{'$or':_['map'](_0x49d97a['attributes'],function(_0x260b6){var _0x54d07d={};_0x54d07d[_0x260b6]={'$like':'%'+_0x410b9f[_0xc001('0x40')][_0xc001('0x4d')]+'%'};return _0x54d07d;})});}_0x49d97a=_[_0xc001('0x4e')]({},_0x49d97a,_0x410b9f['options']);return db[_0xc001('0x64')][_0xc001('0x29')]({'where':_0x49d97a['where']})['then'](function(_0x10ddb7){_0x5d1d08[_0xc001('0x29')]=_0x10ddb7;if(_0x410b9f[_0xc001('0x40')][_0xc001('0x51')]){_0x49d97a[_0xc001('0x52')]=[{'all':!![]}];}return db[_0xc001('0x64')][_0xc001('0x53')](_0x49d97a);})[_0xc001('0x31')](function(_0x39660c){_0x5d1d08[_0xc001('0x54')]=_0x39660c;return _0x5d1d08;});}})['then'](respondWithFilteredResult(_0x2664a5,_0x49d97a))[_0xc001('0x23')](handleError(_0x2664a5,null));};exports[_0xc001('0x67')]=function(_0x28feba,_0x1f0cea,_0x5306f2){return db[_0xc001('0x3a')]['find']({'where':{'id':_0x28feba[_0xc001('0x56')]['id']}})[_0xc001('0x31')](handleEntityNotFound(_0x1f0cea,null))['then'](function(_0x230872){if(_0x230872){return _0x230872[_0xc001('0x67')](_0x28feba[_0xc001('0x40')][_0xc001('0x68')]);}})[_0xc001('0x31')](respondWithStatusCode(_0x1f0cea,null))[_0xc001('0x23')](handleError(_0x1f0cea,null));};exports['addAnswer']=function(_0x3a78e9,_0x40c22e,_0x5b33b9){if(_0x3a78e9[_0xc001('0x58')]['id']){delete _0x3a78e9[_0xc001('0x58')]['id'];}return db['ChatWebsite'][_0xc001('0x5c')]({'where':{'id':_0x3a78e9[_0xc001('0x56')]['id']}})[_0xc001('0x31')](handleEntityNotFound(_0x40c22e,null))['then'](function(_0x30dff3){if(_0x30dff3){_0x3a78e9['body'][_0xc001('0x63')]=_0x30dff3['id'];return db[_0xc001('0x69')]['create'](_0x3a78e9[_0xc001('0x58')]);}})[_0xc001('0x31')](respondWithResult(_0x40c22e,null))[_0xc001('0x23')](handleError(_0x40c22e,null));};exports[_0xc001('0x6a')]=function(_0x46a5f7,_0x508684,_0x181ea4){var _0x33d5c6={'raw':![],'where':{}};var _0x4e2481={};var _0xcecdb0={'count':0x0,'rows':[]};return db[_0xc001('0x3a')]['findOne']({'where':{'id':_0x46a5f7[_0xc001('0x56')]['id']}})['then'](handleEntityNotFound(_0x508684,null))[_0xc001('0x31')](function(_0x5e46ee){if(_0x5e46ee){_0x4e2481[_0xc001('0x3e')]=_['keys'](db[_0xc001('0x69')][_0xc001('0x3b')]);_0x4e2481[_0xc001('0x40')]=_[_0xc001('0x41')](_0x46a5f7[_0xc001('0x40')]);_0x4e2481[_0xc001('0x42')]=_[_0xc001('0x44')](_0x4e2481['model'],_0x4e2481[_0xc001('0x40')]);_0x33d5c6['attributes']=_[_0xc001('0x44')](_0x4e2481[_0xc001('0x3e')],qs[_0xc001('0x45')](_0x46a5f7[_0xc001('0x40')][_0xc001('0x45')]));_0x33d5c6['attributes']=_0x33d5c6[_0xc001('0x43')][_0xc001('0x46')]?_0x33d5c6[_0xc001('0x43')]:_0x4e2481['model'];if(!_0x46a5f7[_0xc001('0x40')][_0xc001('0x47')](_0xc001('0x48'))){_0x33d5c6[_0xc001('0x2a')]=qs[_0xc001('0x2a')](_0x46a5f7['query']['limit']);_0x33d5c6[_0xc001('0x27')]=qs[_0xc001('0x27')](_0x46a5f7[_0xc001('0x40')][_0xc001('0x27')]);}_0x33d5c6[_0xc001('0x49')]=qs['sort'](_0x46a5f7[_0xc001('0x40')]['sort']);_0x33d5c6[_0xc001('0x4b')]=qs[_0xc001('0x42')](_[_0xc001('0x4c')](_0x46a5f7[_0xc001('0x40')],_0x4e2481['filters']));_0x33d5c6[_0xc001('0x4b')][_0xc001('0x63')]=_0x5e46ee['id'];if(_0x46a5f7[_0xc001('0x40')][_0xc001('0x4d')]){_0x33d5c6['where']=_[_0xc001('0x4e')](_0x33d5c6['where'],{'$or':_['map'](_0x33d5c6[_0xc001('0x43')],function(_0x5cce2c){var _0x3684c0={};_0x3684c0[_0x5cce2c]={'$like':'%'+_0x46a5f7[_0xc001('0x40')][_0xc001('0x4d')]+'%'};return _0x3684c0;})});}_0x33d5c6=_['merge']({},_0x33d5c6,_0x46a5f7[_0xc001('0x50')]);return db['CannedAnswer'][_0xc001('0x29')]({'where':_0x33d5c6[_0xc001('0x4b')]})[_0xc001('0x31')](function(_0x13a195){_0xcecdb0['count']=_0x13a195;if(_0x46a5f7[_0xc001('0x40')][_0xc001('0x51')]){_0x33d5c6['include']=[{'all':!![]}];}return db[_0xc001('0x69')][_0xc001('0x53')](_0x33d5c6);})['then'](function(_0x4210d2){_0xcecdb0['rows']=_0x4210d2;return _0xcecdb0;});}})['then'](respondWithFilteredResult(_0x508684,_0x33d5c6))[_0xc001('0x23')](handleError(_0x508684,null));};exports[_0xc001('0x6b')]=function(_0x51ad23,_0x4d2bd4,_0x311cdc){return db[_0xc001('0x3a')]['find']({'where':{'id':_0x51ad23[_0xc001('0x56')]['id']}})['then'](handleEntityNotFound(_0x4d2bd4,null))[_0xc001('0x31')](function(_0x1218e3){if(_0x1218e3){return _0x1218e3[_0xc001('0x6b')](_0x51ad23[_0xc001('0x40')][_0xc001('0x68')]);}})[_0xc001('0x31')](respondWithStatusCode(_0x4d2bd4,null))[_0xc001('0x23')](handleError(_0x4d2bd4,null));};exports['addLogo']=function(_0x1c20fe,_0x1508d2,_0x12ba1e){_0x1c20fe[_0xc001('0x58')]['sitepic']=_0x1c20fe[_0xc001('0x6c')]['filename'];return db[_0xc001('0x3a')][_0xc001('0x5c')]({'where':{'id':_0x1c20fe[_0xc001('0x56')]['id']}})[_0xc001('0x31')](handleEntityNotFound(_0x1508d2,null))[_0xc001('0x31')](saveUpdates(_0x1c20fe[_0xc001('0x58')],null))['then'](respondWithResult(_0x1508d2,null))[_0xc001('0x23')](handleError(_0x1508d2,null));};exports[_0xc001('0x6d')]=function(_0x28fb0f,_0x4cac9f,_0x5924f0){_0x28fb0f[_0xc001('0x58')][_0xc001('0x6e')]=_0x28fb0f[_0xc001('0x6c')][_0xc001('0x6f')];return db[_0xc001('0x3a')][_0xc001('0x5c')]({'where':{'id':_0x28fb0f['params']['id']}})[_0xc001('0x31')](handleEntityNotFound(_0x4cac9f,null))[_0xc001('0x31')](saveUpdates(_0x28fb0f[_0xc001('0x58')],null))[_0xc001('0x31')](respondWithResult(_0x4cac9f,null))[_0xc001('0x23')](handleError(_0x4cac9f,null));};exports[_0xc001('0x70')]=function(_0x227967,_0x22cad9,_0x236c78){_0x227967[_0xc001('0x58')][_0xc001('0x71')]=_0x227967[_0xc001('0x6c')]['filename'];return db['ChatWebsite'][_0xc001('0x5c')]({'where':{'id':_0x227967[_0xc001('0x56')]['id']}})[_0xc001('0x31')](handleEntityNotFound(_0x22cad9,null))[_0xc001('0x31')](saveUpdates(_0x227967['body'],null))[_0xc001('0x31')](respondWithResult(_0x22cad9,null))[_0xc001('0x23')](handleError(_0x22cad9,null));};exports[_0xc001('0x72')]=function(_0x2092f4,_0x4b8743,_0x291fe8){_0x2092f4[_0xc001('0x58')][_0xc001('0x73')]=_0x2092f4[_0xc001('0x6c')][_0xc001('0x6f')];return db[_0xc001('0x3a')]['find']({'where':{'id':_0x2092f4[_0xc001('0x56')]['id']}})[_0xc001('0x31')](handleEntityNotFound(_0x4b8743,null))[_0xc001('0x31')](saveUpdates(_0x2092f4[_0xc001('0x58')],null))[_0xc001('0x31')](respondWithResult(_0x4b8743,null))[_0xc001('0x23')](handleError(_0x4b8743,null));};exports['getLogo']=function(_0x4a4318,_0x5daf51,_0x1ee1dd){var _0x3e6ac9=path[_0xc001('0x74')](config['root'],_0xc001('0x75'));var _0x50e3a5={'where':{'id':_0x4a4318[_0xc001('0x56')]['id']},'attributes':['id',_0xc001('0x76')],'raw':!![]};var _0x311ac9=![];return require(_0xc001('0x77'))['getLicense']()[_0xc001('0x31')](function(_0x507788){if(_0x507788){_0x311ac9=_0x507788[_0xc001('0x78')];}})['then'](function(){return db[_0xc001('0x3a')][_0xc001('0x5c')](_0x50e3a5);})[_0xc001('0x31')](handleEntityNotFound(_0x5daf51,null))['then'](function(_0x454440){if(_0x454440){if(!_[_0xc001('0x79')](_0x454440['sitepic'])){if(fs[_0xc001('0x7a')](path[_0xc001('0x74')](config[_0xc001('0x7b')],_0xc001('0x7c'),_0x454440['sitepic']))&&_0x311ac9){_0x3e6ac9=path[_0xc001('0x74')](config[_0xc001('0x7b')],_0xc001('0x7c'),_0x454440[_0xc001('0x76')]);}}return _0x5daf51[_0xc001('0x7d')](_0x3e6ac9);}})['catch'](handleError(_0x5daf51,null));};exports['getAvatar']=function(_0xff3e5e,_0x493d60,_0x1e2a89){var _0x5ac7fb=path[_0xc001('0x74')](config[_0xc001('0x7b')],_0xc001('0x7e'));var _0x194fd4={'where':{'id':_0xff3e5e[_0xc001('0x56')]['id']},'attributes':['id',_0xc001('0x6e')],'raw':!![]};return db[_0xc001('0x3a')][_0xc001('0x5c')](_0x194fd4)[_0xc001('0x31')](handleEntityNotFound(_0x493d60,null))[_0xc001('0x31')](function(_0x384589){if(_0x384589){if(!_[_0xc001('0x79')](_0x384589['agentAvatar'])){if(fs[_0xc001('0x7a')](path[_0xc001('0x74')](config[_0xc001('0x7b')],_0xc001('0x7f'),_0x384589['agentAvatar']))){_0x5ac7fb=path[_0xc001('0x74')](config[_0xc001('0x7b')],'server/files/images/avatars/',_0x384589[_0xc001('0x6e')]);}}return _0x493d60[_0xc001('0x7d')](_0x5ac7fb);}})[_0xc001('0x23')](handleError(_0x493d60,null));};exports[_0xc001('0x80')]=function(_0xc152ca,_0x36c01d,_0x388e9f){var _0x5b857e=path[_0xc001('0x74')](config[_0xc001('0x7b')],_0xc001('0x81'));var _0x370fce={'where':{'id':_0xc152ca[_0xc001('0x56')]['id']},'attributes':['id','customerAvatar',_0xc001('0x82')],'raw':!![]};return db[_0xc001('0x3a')][_0xc001('0x5c')](_0x370fce)[_0xc001('0x31')](handleEntityNotFound(_0x36c01d,null))[_0xc001('0x31')](function(_0x2328e1){if(_0x2328e1){if(!_[_0xc001('0x79')](_0x2328e1['customerAvatar'])){if(fs[_0xc001('0x7a')](path[_0xc001('0x74')](config[_0xc001('0x7b')],_0xc001('0x7f'),_0x2328e1[_0xc001('0x71')]))&&_0x2328e1[_0xc001('0x82')]){_0x5b857e=path[_0xc001('0x74')](config['root'],_0xc001('0x7f'),_0x2328e1[_0xc001('0x71')]);}}return _0x36c01d[_0xc001('0x7d')](_0x5b857e);}})[_0xc001('0x23')](handleError(_0x36c01d,null));};exports[_0xc001('0x83')]=function(_0x1cf6cd,_0x5d42b5,_0x842f3){var _0x14e35a=path[_0xc001('0x74')](config[_0xc001('0x7b')],_0xc001('0x84'));var _0x3382f9={'where':{'id':_0x1cf6cd['params']['id']},'attributes':['id','systemAvatar'],'raw':!![]};return db[_0xc001('0x3a')][_0xc001('0x5c')](_0x3382f9)[_0xc001('0x31')](handleEntityNotFound(_0x5d42b5,null))[_0xc001('0x31')](function(_0x31931d){if(_0x31931d){if(!_[_0xc001('0x79')](_0x31931d[_0xc001('0x73')])){if(fs[_0xc001('0x7a')](path['join'](config['root'],'server/files/images/avatars/',_0x31931d['systemAvatar']))){_0x14e35a=path[_0xc001('0x74')](config[_0xc001('0x7b')],_0xc001('0x7f'),_0x31931d['systemAvatar']);}}return _0x5d42b5['download'](_0x14e35a);}})[_0xc001('0x23')](handleError(_0x5d42b5,null));};exports[_0xc001('0x85')]=function(_0x32fe20,_0x83d385,_0x1fe43b){var _0x5c69b5=require(_0xc001('0x86'));var _0xc7acae=new _0x5c69b5();var _0x154168=_0xc7acae[_0xc001('0x87')](_0x32fe20['headers'][_0xc001('0x88')])[_0xc001('0x89')]();var _0xac97e3={'body':_0x32fe20[_0xc001('0x58')],'channel':_0xc001('0x8a')};var _0x426771=[];var _0x1fcf73=[];var _0x164eae={};var _0x1c1399=![];return db[_0xc001('0x8b')][_0xc001('0x61')]()[_0xc001('0x31')](function(_0x347464){if(!_0x347464){throw new db[(_0xc001('0x8c'))][(_0xc001('0x8d'))](_0xc001('0x8e'));}_0x426771=_[_0xc001('0x8f')](_[_0xc001('0x41')](_0x347464),[_0xc001('0x90'),'updatedAt']);_0x1fcf73=_[_0xc001('0x8f')](_['keys'](_0x347464),['createdAt','updatedAt','CompanyId',_0xc001('0x91')]);if(_0x32fe20[_0xc001('0x58')]['id']){delete _0x32fe20[_0xc001('0x58')]['id'];}if(_[_0xc001('0x79')](_0x32fe20[_0xc001('0x58')][_0xc001('0x92')])){throw new db[(_0xc001('0x8c'))]['ValidationError'](_0xc001('0x93'));}if(_['isNil'](_0x32fe20[_0xc001('0x58')][_0xc001('0x58')])||_0x32fe20[_0xc001('0x58')][_0xc001('0x58')]===''){throw new db[(_0xc001('0x8c'))][(_0xc001('0x8d'))](_0xc001('0x94'));}if(_[_0xc001('0x79')](_0x32fe20[_0xc001('0x58')][_0xc001('0x95')])){throw new db['Sequelize']['ValidationError'](_0xc001('0x96')+_0x1fcf73);}if(!_['includes'](_0x1fcf73,_0x32fe20[_0xc001('0x58')]['mapKey'])){throw new db[(_0xc001('0x8c'))]['ValidationError'](_0xc001('0x97')+_0x1fcf73);}_0x164eae[_0x32fe20[_0xc001('0x58')][_0xc001('0x95')]]=_0x32fe20[_0xc001('0x58')][_0xc001('0x92')];})[_0xc001('0x31')](function(){return db['ChatWebsite'][_0xc001('0x5c')]({'where':{'id':_0x32fe20[_0xc001('0x56')]['id']},'include':[{'model':db[_0xc001('0x98')],'as':_0xc001('0x99'),'include':[{'model':db[_0xc001('0x8b')],'as':_0xc001('0x9a'),'where':_0x164eae,'limit':0x1,'order':[[_0xc001('0x9b'),'DESC']]}]},{'model':db['ChatApplication'],'as':_0xc001('0x9c')}]});})['then'](handleEntityNotFound(_0x83d385,null))[_0xc001('0x31')](function(_0x1fda25){if(_0x1fda25&&_0x1fda25['List']){_0xac97e3['account']=_0x1fda25;_0xac97e3[_0xc001('0x9d')]=_0x1fda25[_0xc001('0x9c')];_0xac97e3[_0xc001('0x9e')]=_0x1fda25[_0xc001('0x99')];_0xac97e3[_0xc001('0x9d')]=_[_0xc001('0x9f')](_0xac97e3[_0xc001('0x9d')],[_0xc001('0xa0')],[_0xc001('0xa1')]);if(_0xac97e3[_0xc001('0xa2')][_0xc001('0x9c')]){delete _0xac97e3[_0xc001('0xa2')][_0xc001('0x9c')];}if(_0xac97e3['account'][_0xc001('0x99')]&&_0xac97e3[_0xc001('0xa2')][_0xc001('0x99')]['Contacts']['length']){return _0xac97e3[_0xc001('0xa2')][_0xc001('0x99')][_0xc001('0x9a')][0x0];}var _0x4cb65a=_[_0xc001('0x13')](_0x32fe20[_0xc001('0x58')],{'firstName':_0x32fe20[_0xc001('0x58')][_0xc001('0x92')],'ListId':_0x1fda25[_0xc001('0x91')]});_0x4cb65a[_0x32fe20[_0xc001('0x58')][_0xc001('0x95')]]=_0x32fe20[_0xc001('0x58')][_0xc001('0x92')];return db[_0xc001('0x8b')][_0xc001('0x57')](_0x4cb65a,{'fields':_0x426771,'raw':!![]});}})[_0xc001('0x31')](handleEntityNotFound(_0x83d385,null))['then'](function(_0x2711f2){_0xac97e3['contact']=_0x2711f2;var _0xf957a8=_0x32fe20[_0xc001('0x58')]['customerIp'];if(_0x32fe20['headers'][_0xc001('0xa3')]){_0xf957a8=_0x32fe20[_0xc001('0xa4')][_0xc001('0xa3')];}else if(_0x32fe20[_0xc001('0xa4')]['x-forwarded-for']){_0xf957a8=_[_0xc001('0xa5')](_0x32fe20[_0xc001('0xa4')][_0xc001('0xa6')][_0xc001('0xa7')](','));}if(_0x2711f2){var _0x38dbf9={'ContactId':_0x2711f2['id'],'ChatWebsiteId':_0x32fe20[_0xc001('0x56')]['id'],'from':(_0x2711f2[_0xc001('0xa8')]||'')+'\x20'+(_0x2711f2[_0xc001('0xa9')]||''),'customerIp':_0xf957a8,'customerPort':_0x32fe20[_0xc001('0xa4')][_0xc001('0xaa')]?_0x32fe20[_0xc001('0xa4')][_0xc001('0xaa')]:null,'referer':_0x32fe20[_0xc001('0x58')][_0xc001('0xab')],'browserName':_0x154168[_0xc001('0xac')][_0xc001('0x3f')]&&_0x154168['browser'][_0xc001('0xad')]?util[_0xc001('0xae')](_0xc001('0xaf'),_0x154168[_0xc001('0xac')][_0xc001('0x3f')],_0x154168[_0xc001('0xac')]['version']):_0xc001('0xb0'),'browserVersion':_0x154168[_0xc001('0xac')][_0xc001('0xad')]||'unknown','osName':util[_0xc001('0xae')](_0xc001('0xaf'),_0x154168['os'][_0xc001('0x3f')],_0x154168['os']['version']),'osVersion':_0x154168['os']['version'],'deviceModel':_0x154168[_0xc001('0xb1')][_0xc001('0x3e')]&&_0x154168[_0xc001('0xb1')][_0xc001('0xb2')]?util[_0xc001('0xae')](_0xc001('0xb3'),_0x154168[_0xc001('0xb1')][_0xc001('0x3e')],_0x154168[_0xc001('0xb1')]['vendor'],_0x154168['device'][_0xc001('0x3d')]):null,'deviceVendor':_0x154168['device']['vendor'],'deviceType':_0x154168['device']['type'],'formData':JSON[_0xc001('0x1f')](_0x32fe20[_0xc001('0x58')])};var _0x353377={'ChatWebsiteId':_0x32fe20['params']['id'],'closed':![]};if(_0x32fe20['body']['threadId']){_0x353377[_0xc001('0xb4')]=_0x32fe20[_0xc001('0x58')][_0xc001('0xb4')];return db[_0xc001('0xb5')][_0xc001('0x5c')]({'where':_0x353377})[_0xc001('0x31')](function(_0x33032f){if(_0x33032f){return[_0x33032f,![]];}_0x38dbf9[_0xc001('0xb4')]=_0x32fe20['body'][_0xc001('0xb4')];_0x38dbf9[_0xc001('0xb6')]=_0x32fe20[_0xc001('0x58')][_0xc001('0xb6')];return db[_0xc001('0xb5')]['create'](_0x38dbf9)[_0xc001('0x31')](function(_0x4c1d90){return[_0x4c1d90,!![]];});});}_0x353377[_0xc001('0xb7')]=_0x2711f2['id'];if(_0x32fe20[_0xc001('0x58')][_0xc001('0xb8')]&&_0x32fe20[_0xc001('0x58')][_0xc001('0xb8')]['id']){_0x353377['id']=_0x32fe20[_0xc001('0x58')][_0xc001('0xb8')]['id'];return db['ChatInteraction'][_0xc001('0x5c')]({'where':_0x353377})['then'](function(_0xa48c45){if(_0xa48c45){return[_0xa48c45,![]];}return db[_0xc001('0xb5')][_0xc001('0x57')](_0x38dbf9)[_0xc001('0x31')](function(_0x6d802b){return[_0x6d802b,!![]];});});}return db['ChatInteraction'][_0xc001('0x57')](_0x38dbf9)[_0xc001('0x31')](function(_0x204271){return[_0x204271,!![]];});}})[_0xc001('0xb9')](function(_0x269d4f,_0x34f730){if(_0x269d4f){_0x1c1399=_0x34f730;if(!_0x34f730){var _0x9bf407={'from':(_0xac97e3[_0xc001('0xba')][_0xc001('0xa8')]||'')+'\x20'+(_0xac97e3[_0xc001('0xba')][_0xc001('0xa9')]||'')};if(_0x32fe20[_0xc001('0x58')][_0xc001('0xb4')]&&_0x32fe20[_0xc001('0x58')][_0xc001('0xbb')]&&_0x32fe20['body'][_0xc001('0xb4')]!=_0x32fe20[_0xc001('0x58')]['messageId']){_0x9bf407['threadId']=_0x32fe20[_0xc001('0x58')][_0xc001('0xbb')];}return _0x269d4f[_0xc001('0x60')](_0x9bf407);}else{return _0x269d4f;}}})[_0xc001('0x31')](function(_0x21f3c7){_0xac97e3[_0xc001('0xb8')]=_0x21f3c7[_0xc001('0x32')]({'plain':!![]});_0xac97e3[_0xc001('0xb8')][_0xc001('0xbc')]=_0x1c1399;if(_0xac97e3['interaction'][_0xc001('0xbc')]){if(_0xac97e3[_0xc001('0xa2')][_0xc001('0xbd')]){_0xac97e3[_0xc001('0x9d')][_0xc001('0xbe')]({'id':0x0,'priority':_0xac97e3[_0xc001('0x9d')][_0xc001('0x46')]+0x1,'app':_0xc001('0xbf'),'appdata':'unmanaged','interval':_0xc001('0xc0')});}}return db[_0xc001('0xc1')]['create']({'body':_0x32fe20['body']['body'],'ChatWebsiteId':_0x32fe20[_0xc001('0x56')]['id'],'ChatInteractionId':_0x21f3c7['id'],'direction':'in','ContactId':_0xac97e3[_0xc001('0xba')]['id'],'AttachmentId':_0x32fe20[_0xc001('0x58')][_0xc001('0xc2')]});})['then'](function(_0x438001){_0xac97e3['message']=_0x438001;if(_0xac97e3[_0xc001('0xb8')]['UserId']){return db[_0xc001('0xc3')]['find']({'attributes':['id','name'],'where':{'id':_0xac97e3['interaction'][_0xc001('0xc4')]}})[_0xc001('0x31')](function(_0x4f1390){if(_0x4f1390){_0xac97e3['applications'][_0xc001('0xc5')]({'id':0x0,'priority':0x0,'app':_0xc001('0xc6'),'appdata':_0x4f1390[_0xc001('0x3f')]+','+(_0xac97e3[_0xc001('0xa2')][_0xc001('0xc7')]||0xa),'interval':'*,*,*,*'});_0xac97e3[_0xc001('0xc8')]=!![];}return respondWithRpcPromise(_0xc001('0xc9'),_0xc001('0xca'),_0xac97e3);});}return respondWithRpcPromise('Start',_0xc001('0xca'),_0xac97e3);})[_0xc001('0x31')](function(_0x4d172c){respondWithRpcPromise(_0xc001('0xcb'),_0xc001('0xcb'),{'event':_0xc001('0x85'),'message':_0x4d172c},client9002);return _0x4d172c;})[_0xc001('0x31')](respondWithResult(_0x83d385,null))[_0xc001('0x23')](handleError(_0x83d385,null));};exports['offline']=function(_0x17c45f,_0x1b070a,_0x7b07f3){var _0x479650,_0x27d895,_0x1a23e0;var _0x1c7e3f=[];var _0x10ff2c=[];var _0xd6c016={};var _0x5ca51c=_0x17c45f[_0xc001('0xcc')]||[];var _0x427284=[];var _0x8f0b2e;return db[_0xc001('0x8b')][_0xc001('0x61')]()[_0xc001('0x31')](function(_0x44614d){if(!_0x44614d){throw new db['Sequelize'][(_0xc001('0x8d'))](_0xc001('0x8e'));}_0x10ff2c=_[_0xc001('0x8f')](_[_0xc001('0x41')](_0x44614d),[_0xc001('0x90'),'updatedAt']);_0x1c7e3f=_[_0xc001('0x8f')](_[_0xc001('0x41')](_0x44614d),[_0xc001('0x90'),_0xc001('0x9b'),_0xc001('0xcd'),_0xc001('0x91')]);if(_0x17c45f[_0xc001('0x58')]['id']){delete _0x17c45f[_0xc001('0x58')]['id'];}if(_[_0xc001('0x79')](_0x17c45f['body'][_0xc001('0x92')])){throw _0x1b070a[_0xc001('0x25')](0x1f4)[_0xc001('0x36')](new db[(_0xc001('0x8c'))][(_0xc001('0x8d'))](_0xc001('0x93')));}if(_[_0xc001('0x79')](_0x17c45f[_0xc001('0x58')][_0xc001('0x58')])||_0x17c45f['body'][_0xc001('0x58')]===''){throw _0x1b070a[_0xc001('0x25')](0x1f4)[_0xc001('0x36')](new db['Sequelize'][(_0xc001('0x8d'))](_0xc001('0x94')));}if(_[_0xc001('0x79')](_0x17c45f['body'][_0xc001('0xce')])){throw _0x1b070a['status'](0x1f4)[_0xc001('0x36')](new db['Sequelize'][(_0xc001('0x8d'))]('mapKeyOffline\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20'+_0x1c7e3f));}if(!_[_0xc001('0xcf')](_0x1c7e3f,_0x17c45f['body']['mapKeyOffline'])){throw _0x1b070a[_0xc001('0x25')](0x1f4)[_0xc001('0x36')](new db['Sequelize']['ValidationError'](_0xc001('0xd0')+_0x1c7e3f));}_0xd6c016[_0x17c45f['body'][_0xc001('0xce')]]=_0x17c45f[_0xc001('0x58')][_0xc001('0x92')];})[_0xc001('0x31')](function(){return db[_0xc001('0x3a')][_0xc001('0x5c')]({'where':{'id':_0x17c45f[_0xc001('0x56')]['id']},'include':[{'model':db[_0xc001('0x98')],'as':_0xc001('0x99')},{'model':db[_0xc001('0xd1')],'as':_0xc001('0xd1')}]});})[_0xc001('0x31')](handleEntityNotFound(_0x1b070a,null))[_0xc001('0x31')](function(_0x248915){if(_0x248915&&_0x248915[_0xc001('0x99')]){_0x27d895=_0x248915;var _0x36b1bc=_[_0xc001('0x13')](_0x17c45f[_0xc001('0x58')],{'firstName':_0x17c45f[_0xc001('0x58')][_0xc001('0x92')],'phone':_0x17c45f[_0xc001('0x58')]['from'],'ListId':_0x248915[_0xc001('0x91')]});_0x36b1bc[_0x17c45f['body'][_0xc001('0xce')]]=_0x17c45f[_0xc001('0x58')][_0xc001('0x92')];return db[_0xc001('0x8b')]['findOrCreate']({'where':_0xd6c016,'defaults':_0x36b1bc});}})['spread'](function(_0x29f0a3){if(_0x29f0a3){_0x1a23e0=_0x29f0a3;var _0x4a4ab2=fs[_0xc001('0xd2')](path[_0xc001('0x74')](config[_0xc001('0x7b')],_0xc001('0xd3')),_0xc001('0xd4'));var _0x58549c=ejs['render'](_0x4a4ab2,{'body':_['toPairs'](_0x17c45f[_0xc001('0x58')][_0xc001('0x58')]),'bodyTitle':_0x27d895[_0xc001('0xd5')]});return db[_0xc001('0xd6')]['create']({'body':_0x58549c,'ContactId':_0x29f0a3['id'],'ChatWebsiteId':_0x27d895['id']});}})[_0xc001('0x31')](function(_0x37c3df){_0x8f0b2e=_0x37c3df;if(_0x5ca51c[_0xc001('0x46')]){var _0xf94de9=_0x5ca51c[_0xc001('0x39')](function(_0x43bd36){return{'name':_0x43bd36[_0xc001('0xd7')],'basename':_0x43bd36[_0xc001('0x6f')],'type':_0x43bd36['mimetype'],'ChatOfflineMessageId':_0x37c3df['id']};});_0x427284=_0xf94de9['map'](_0x406464=>{var _0x46e166={'filename':_0x406464[_0xc001('0x3f')],'path':path[_0xc001('0x74')](config['root'],_0xc001('0xd8'),_0xc001('0xcc'),_0xc001('0xd9'),'offline-chat',_0x406464[_0xc001('0xda')])};return _0x46e166;});if(!_0x27d895[_0xc001('0xdb')]){return db[_0xc001('0xdc')][_0xc001('0xdd')](function(_0x4e2d8f){return db[_0xc001('0xde')][_0xc001('0xdf')](_0xf94de9,{'transaction':_0x4e2d8f});});}}})[_0xc001('0x31')](function(){if(_0x8f0b2e){_0x479650=_0x8f0b2e;return db[_0xc001('0xd1')][_0xc001('0x66')]({'where':{'active':!![]},'include':[{'model':db[_0xc001('0xe0')],'as':_0xc001('0xe1'),'raw':!![]}]});}})['then'](function(_0x5ea77c){if(_0x5ea77c&&_0x5ea77c['Smtp']&&_0x27d895[_0xc001('0xe2')]&&_0x27d895['forwardOfflineAddress']){var _0x44e2a8={'tls':{'rejectUnauthorized':![]}};if(_0x5ea77c['Smtp'][_0xc001('0xe3')]){_0x44e2a8[_0xc001('0xe3')]=_0x5ea77c[_0xc001('0xe1')][_0xc001('0xe3')];}else{_0x44e2a8[_0xc001('0xe4')]=_0x5ea77c[_0xc001('0xe1')][_0xc001('0xe4')];_0x44e2a8[_0xc001('0xe5')]=_0x5ea77c[_0xc001('0xe1')][_0xc001('0xe5')];_0x44e2a8[_0xc001('0xe6')]=_0x5ea77c['Smtp'][_0xc001('0xe6')];}if(_0x5ea77c[_0xc001('0xe1')][_0xc001('0xe7')]){_0x44e2a8[_0xc001('0xe8')]={'user':_0x5ea77c[_0xc001('0xe1')][_0xc001('0x59')],'pass':_0x5ea77c[_0xc001('0xe1')][_0xc001('0xe9')]};}return respondWithRpcPromise(_0xc001('0xea'),_0xc001('0xeb'),{'account':_0x44e2a8,'message':{'from':util[_0xc001('0xae')]('\x22%s\x22\x20<%s>',_0x5ea77c[_0xc001('0x3f')],_0x5ea77c[_0xc001('0xec')]||_0x5ea77c[_0xc001('0xe1')]['user']),'to':_0x27d895['forwardOfflineAddress'],'subject':_0x27d895[_0xc001('0xed')],'html':_0x479650[_0xc001('0x58')],'attachments':_0x427284}},client9003)['then'](function(){return _0x479650;})['catch'](function(_0x3a9ac4){console[_0xc001('0x20')](_0x3a9ac4);});}})[_0xc001('0x31')](function(){if(_0x27d895&&_0x27d895[_0xc001('0xdb')]&&_0x27d895[_0xc001('0xee')]){var _0x57b89d=[];if(_0x5ca51c[_0xc001('0x46')]){_0x57b89d=_0x5ca51c[_0xc001('0x39')](function(_0x5e523b){return{'name':_0x5e523b[_0xc001('0xd7')],'basename':_0x5e523b[_0xc001('0x6f')],'type':_0x5e523b[_0xc001('0xef')],'ChatOfflineMessageId':_0x8f0b2e['id']};});}var _0x384428;if(!_[_0xc001('0x79')](_0x27d895[_0xc001('0xf0')])){var _0x2525e5=_[_0xc001('0x39')](_0x17c45f[_0xc001('0x58')],function(_0x5eb22b){return _0x5eb22b;});var _0xb6517c=_[_0xc001('0xf1')](_0x2525e5)[0x0];var _0x2270f5=_['mapValues'](_0xb6517c,function(_0x214239){return _0x214239;});_0x384428=_0x2270f5[0x1][_0x27d895[_0xc001('0xf0')]];}var _0x1393b4={'from':_0x1a23e0[_0xc001('0xec')],'firstName':_0x1a23e0[_0xc001('0xa8')],'lastName':_0x1a23e0[_0xc001('0xa9')],'mapKey':'email','message':{'from':_0x1a23e0[_0xc001('0xec')],'to':_0x27d895[_0xc001('0xd1')][_0xc001('0xec')],'cc':'','subject':_['isNil'](_0x384428)?_0x27d895[_0xc001('0xed')]:_0x384428,'messageId':'','sentAt':new Date(),'attach':_0x57b89d[_0xc001('0x46')],'attachments':_0x57b89d,'originChannel':_0xc001('0xf2'),'ChatWebsiteId':_0x27d895['id'],'ChatOfflineMessageId':_0x479650['id'],'originTo':_0x27d895[_0xc001('0xd1')][_0xc001('0xec')]},'body':_0x479650[_0xc001('0x58')]};var _0x3e6485={'account':{'id':_0x27d895['MailAccountId']},'body':_0x1393b4,'log':_0xc001('0xf3')};return respondWithRpcPromise(_0xc001('0xf3'),_0xc001('0xf4'),_0x3e6485,client9001)[_0xc001('0x31')](function(){return _0x479650;})['catch'](function(_0x48bed7){console[_0xc001('0x20')](_0x48bed7);});}return;})[_0xc001('0x31')](function(){if(_0x479650){return _0x479650;}})[_0xc001('0x31')](respondWithResult(_0x1b070a,null))[_0xc001('0x23')](function(_0x450d45){console[_0xc001('0x20')](_0xc001('0x23'),_0x450d45);for(var _0x397cf5 of _0x5ca51c){var _0x99e03d=path['join'](config[_0xc001('0x7b')],_0xc001('0xd8'),_0xc001('0xcc'),_0xc001('0xd9'),'offline-chat',_0x397cf5[_0xc001('0x6f')]);fs_extra['remove'](_0x99e03d)[_0xc001('0x23')](function(_0x2279de){console[_0xc001('0x20')](_0xc001('0xf5'),_0x99e03d,_0x2279de);});}});};exports[_0xc001('0xf6')]=function(_0x342ec6,_0x5ac781,_0x423f82){return db[_0xc001('0xb5')]['find']({'where':{'id':_0x342ec6['params']['id']}})[_0xc001('0x31')](handleEntityNotFound(_0x5ac781,null))[_0xc001('0x31')](function(_0x2b0c2){if(_0x2b0c2){return _0x2b0c2[_0xc001('0xf6')](_0x342ec6[_0xc001('0x58')][_0xc001('0x68')],_['omit'](_0x342ec6[_0xc001('0x58')],[_0xc001('0x68'),'id'])||{});}})['then'](respondWithResult(_0x5ac781,null))['catch'](handleError(_0x5ac781,null));};exports[_0xc001('0xf7')]=function(_0x1121e9,_0x1a9b6d,_0x39c01a){var _0x340f00={'raw':![],'where':{}};var _0x27690c={};var _0x5b1f59={'count':0x0,'rows':[]};return db[_0xc001('0x3a')]['findOne']({'where':{'id':_0x1121e9['params']['id']}})[_0xc001('0x31')](handleEntityNotFound(_0x1a9b6d,null))['then'](function(_0x130bf4){if(_0x130bf4){_0x27690c[_0xc001('0x3e')]=_[_0xc001('0x41')](db[_0xc001('0xb5')]['rawAttributes']);_0x27690c[_0xc001('0x40')]=_[_0xc001('0x41')](_0x1121e9['query']);_0x27690c[_0xc001('0x42')]=_[_0xc001('0x44')](_0x27690c[_0xc001('0x3e')],_0x27690c[_0xc001('0x40')]);_0x340f00[_0xc001('0x43')]=_[_0xc001('0x44')](_0x27690c[_0xc001('0x3e')],qs[_0xc001('0x45')](_0x1121e9[_0xc001('0x40')][_0xc001('0x45')]));_0x340f00[_0xc001('0x43')]=_0x340f00[_0xc001('0x43')]['length']?_0x340f00[_0xc001('0x43')]:_0x27690c[_0xc001('0x3e')];if(!_0x1121e9[_0xc001('0x40')][_0xc001('0x47')]('nolimit')){_0x340f00['limit']=qs['limit'](_0x1121e9['query'][_0xc001('0x2a')]);_0x340f00[_0xc001('0x27')]=qs[_0xc001('0x27')](_0x1121e9['query'][_0xc001('0x27')]);}_0x340f00[_0xc001('0x49')]=qs[_0xc001('0x4a')](_0x1121e9[_0xc001('0x40')][_0xc001('0x4a')]);_0x340f00[_0xc001('0x4b')]=qs[_0xc001('0x42')](_[_0xc001('0x4c')](_0x1121e9[_0xc001('0x40')],_0x27690c[_0xc001('0x42')]));_0x340f00[_0xc001('0x4b')][_0xc001('0x63')]=_0x130bf4['id'];if(_0x1121e9[_0xc001('0x40')][_0xc001('0x4d')]){_0x340f00[_0xc001('0x4b')]=_[_0xc001('0x4e')](_0x340f00[_0xc001('0x4b')],{'$or':_[_0xc001('0x39')](_0x340f00[_0xc001('0x43')],function(_0x3c5720){var _0x1ca806={};_0x1ca806[_0x3c5720]={'$like':'%'+_0x1121e9['query'][_0xc001('0x4d')]+'%'};return _0x1ca806;})});}_0x340f00=_['merge']({},_0x340f00,_0x1121e9[_0xc001('0x50')]);return db[_0xc001('0xb5')]['count']({'where':_0x340f00[_0xc001('0x4b')]})[_0xc001('0x31')](function(_0x1d3d52){_0x5b1f59['count']=_0x1d3d52;if(_0x1121e9[_0xc001('0x40')][_0xc001('0x51')]){_0x340f00[_0xc001('0x52')]=[{'model':db[_0xc001('0x8b')],'as':_0xc001('0xf8'),'required':![]},{'model':db[_0xc001('0xc3')],'as':'Owner','attributes':[_0xc001('0x3f'),_0xc001('0xf9'),'internal'],'required':![]},{'model':db[_0xc001('0xfa')],'as':'Tags','attributes':['id',_0xc001('0x3f'),_0xc001('0xfb')],'where':_0x1121e9[_0xc001('0x40')][_0xc001('0xfc')]?{'id':_0x1121e9['query']['tag']}:undefined,'required':_0x1121e9[_0xc001('0x40')]['tag']?!![]:![]}];}return db[_0xc001('0xb5')][_0xc001('0x53')](_0x340f00);})[_0xc001('0x31')](function(_0x459ac3){_0x5b1f59[_0xc001('0x54')]=_0x459ac3;return _0x5b1f59;});}})[_0xc001('0x31')](respondWithFilteredResult(_0x1a9b6d,_0x340f00))['catch'](handleError(_0x1a9b6d,null));};function iftimePromise(_0x45272e,_0xfc5be2){return respondWithRpcPromise('Command',_0xc001('0xfd'),{'command':_0xfc5be2[_0xc001('0xfe')]?util['format'](_0xc001('0xff'),_0x45272e[_0xc001('0x100')],_0xfc5be2[_0xc001('0xfe')]):util[_0xc001('0xae')](_0xc001('0x101'),_0x45272e[_0xc001('0x100')])},client9002)[_0xc001('0x31')](function(_0x5c2858){var _0x599f44=_0x5c2858&&_0x5c2858[_0xc001('0x102')](_0xc001('0x103'))>=0x0?!![]:![];logger[_0xc001('0x1a')](_0xc001('0x104'),_0xfc5be2['id'],_0x45272e['id'],_0x45272e[_0xc001('0x100')],_0x599f44?_0xc001('0x105'):'OFFLINE',_0xfc5be2[_0xc001('0xfe')]?_0xfc5be2[_0xc001('0xfe')]:_0xc001('0x106'));return _0x599f44;})[_0xc001('0x23')](function(_0x5e6ab3){logger[_0xc001('0x20')](_0xc001('0x104'),_0xfc5be2['id'],_0x45272e['id'],_0x45272e[_0xc001('0x100')],util[_0xc001('0x107')](_0x5e6ab3,{'showHidden':![],'depth':null}),_0xfc5be2['timezone']?_0xfc5be2[_0xc001('0xfe')]:_0xc001('0x106'));return![];});}exports[_0xc001('0xfd')]=function(_0x122d2d,_0x3eda23,_0x38594e){var _0x2bfe07=0x0;var _0x45f2e9=0x0;var _0x149992=![];var _0x2a1e6c;var _0x54c5eb;return db['ChatWebsite'][_0xc001('0x5c')]({'where':{'id':_0x122d2d[_0xc001('0x56')]['id']},'include':[{'model':db[_0xc001('0x108')],'as':_0xc001('0x108'),'include':[{'model':db[_0xc001('0x108')],'as':_0xc001('0x109'),'attributes':['id',_0xc001('0x100')],'raw':!![]}]}]})['then'](handleEntityNotFound(_0x3eda23,null))[_0xc001('0x31')](function(_0x5e93cc){if(_0x5e93cc){_0x2a1e6c=_0x5e93cc;return _0x5e93cc[_0xc001('0x10a')]({'raw':!![]});}})[_0xc001('0x31')](function(_0xb215f0){if(_0x2a1e6c){if(_0xb215f0){_0x54c5eb=_0xb215f0;}}return require(_0xc001('0x77'))[_0xc001('0x10b')]();})['then'](function(_0x39bc13){if(_0x39bc13){_0x45f2e9=_0x39bc13[_0xc001('0x10c')];_0x149992=_0x39bc13[_0xc001('0x78')];}})[_0xc001('0x31')](function(){return db['ChatInteraction'][_0xc001('0x29')]({'where':{'closed':![]}});})[_0xc001('0x31')](function(_0x5d1990){_0x2bfe07=_0x5d1990;if(_0x45f2e9&&_0x5d1990>_0x45f2e9){return db[_0xc001('0x10d')]['findOne']({'where':{'id':0x1}})['then'](function(_0x452b38){if(_0x452b38){_0x452b38['increment']('chatLicenseExceeded');}});}})['then'](function(){if(_0x2a1e6c[_0xc001('0x108')]&&_0x2a1e6c['Interval'][_0xc001('0x109')]){var _0x5dc5e0=[];for(var _0x158f4b=0x0;_0x158f4b<_0x2a1e6c[_0xc001('0x108')][_0xc001('0x109')][_0xc001('0x46')];_0x158f4b++){var _0x561257=_0x2a1e6c[_0xc001('0x108')][_0xc001('0x109')][_0x158f4b][_0xc001('0x32')]({'plain':!![]});_0x5dc5e0['push'](iftimePromise(_0x561257,_0x2a1e6c));}return BPromise[_0xc001('0x10e')](_0x5dc5e0)[_0xc001('0x31')](function(_0x10578b){return _[_0xc001('0x10f')](_0x10578b);});}else{return!![];}})[_0xc001('0x31')](function(_0x2c66ca){var _0x23ec26=fs[_0xc001('0xd2')](path[_0xc001('0x74')](config['root'],'server/files/chat/iframe.ejs'),_0xc001('0xd4'));var _0xfe5e5b={'remote':_0x2a1e6c[_0xc001('0x110')],'query':querystring[_0xc001('0x1f')](_[_0xc001('0x4e')](_0x2a1e6c[_0xc001('0x32')]({'plain':!![]}),{'customerIp':_0x122d2d[_0xc001('0xa4')][_0xc001('0xa6')]||_0x122d2d[_0xc001('0xa4')][_0xc001('0x111')]||_0x122d2d[_0xc001('0x112')][_0xc001('0x113')]||_0x122d2d['ip'],'referer':_0x122d2d[_0xc001('0xa4')]['referer'],'openedInteractions':_0x2bfe07,'maxInteractions':_0x45f2e9,'virtual':_0x149992['virtual'],'online':_0x2c66ca,'custom':_0x149992}))[_0xc001('0x114')](/'/g,'\x5c\x27')};_0x3eda23[_0xc001('0x36')](ejs[_0xc001('0x115')](Mustache[_0xc001('0x115')](_0x23ec26,_0xfe5e5b),{'proactiveActions':_0x54c5eb,'alignment':_0x2a1e6c[_0xc001('0x116')],'verticalAlignment':_0x2a1e6c[_0xc001('0x117')],'div_color':_0x2a1e6c['color'],'text_color':_0x2a1e6c[_0xc001('0x118')],'button_color':_0x2a1e6c['color_button'],'background_color':_0x2a1e6c[_0xc001('0x119')]}));})[_0xc001('0x23')](handleError(_0x3eda23,null));};exports['addApplications']=function(_0x29b5f2,_0x57a737,_0x29681d){return db[_0xc001('0x3a')][_0xc001('0x66')]({'where':{'id':_0x29b5f2[_0xc001('0x56')]['id']}})[_0xc001('0x31')](handleEntityNotFound(_0x57a737,null))['then'](function(_0x302ab2){if(_0x302ab2){return db[_0xc001('0xdc')]['transaction'](function(_0x201d6d){return db[_0xc001('0x11a')][_0xc001('0x30')]({'where':{'ChatWebsiteId':_0x29b5f2['params']['id']},'transaction':_0x201d6d})[_0xc001('0x31')](function(_0x3c4bc5){var _0x1b7598=_[_0xc001('0x39')](_0x29b5f2[_0xc001('0x58')],function(_0x1f350b){_0x1f350b[_0xc001('0x63')]=_0x29b5f2['params']['id'];return _0x1f350b;});return db[_0xc001('0x11a')][_0xc001('0xdf')](_0x1b7598,{'transaction':_0x201d6d});});})['then'](function(){return db['ChatApplication'][_0xc001('0x11b')]({'where':{'ChatWebsiteId':_0x29b5f2[_0xc001('0x56')]['id']},'order':_0xc001('0xa0')});});}})[_0xc001('0x31')](respondWithResult(_0x57a737,null))[_0xc001('0x23')](handleError(_0x57a737,null));};exports[_0xc001('0x11c')]=function(_0x1d553d,_0x17c61e,_0x3f076b){var _0x10e0ec={};var _0x5300b1={};var _0x3df920;var _0x2d4ae9;return db['ChatWebsite'][_0xc001('0x66')]({'where':{'id':_0x1d553d[_0xc001('0x56')]['id']}})[_0xc001('0x31')](handleEntityNotFound(_0x17c61e,null))[_0xc001('0x31')](function(_0x272631){if(_0x272631){_0x3df920=_0x272631;_0x5300b1['model']=_[_0xc001('0x41')](db['ChatApplication'][_0xc001('0x3b')]);_0x5300b1[_0xc001('0x40')]=_[_0xc001('0x41')](_0x1d553d[_0xc001('0x40')]);_0x5300b1[_0xc001('0x42')]=_[_0xc001('0x44')](_0x5300b1[_0xc001('0x3e')],_0x5300b1[_0xc001('0x40')]);_0x10e0ec[_0xc001('0x43')]=_[_0xc001('0x44')](_0x5300b1[_0xc001('0x3e')],qs[_0xc001('0x45')](_0x1d553d[_0xc001('0x40')]['fields']));_0x10e0ec[_0xc001('0x43')]=_0x10e0ec['attributes'][_0xc001('0x46')]?_0x10e0ec[_0xc001('0x43')]:_0x5300b1[_0xc001('0x3e')];_0x10e0ec[_0xc001('0x49')]=qs[_0xc001('0x4a')](_0x1d553d['query'][_0xc001('0x4a')]);_0x10e0ec[_0xc001('0x4b')]=qs[_0xc001('0x42')](_[_0xc001('0x4c')](_0x1d553d['query'],_0x5300b1['filters']));if(_0x1d553d[_0xc001('0x40')][_0xc001('0x4d')]){_0x10e0ec[_0xc001('0x4b')]=_[_0xc001('0x4e')](_0x10e0ec['where'],{'$or':_[_0xc001('0x39')](_0x10e0ec[_0xc001('0x43')],function(_0x237f50){var _0x42d897={};_0x42d897[_0x237f50]={'$like':'%'+_0x1d553d[_0xc001('0x40')][_0xc001('0x4d')]+'%'};return _0x42d897;})});}_0x10e0ec=_[_0xc001('0x4e')]({},_0x10e0ec,_0x1d553d['options']);return _0x3df920[_0xc001('0x11c')](_0x10e0ec);}})[_0xc001('0x31')](function(_0x3ea93e){if(_0x3ea93e){_0x2d4ae9=_0x3ea93e['length'];if(!_0x1d553d[_0xc001('0x40')][_0xc001('0x47')](_0xc001('0x48'))){_0x10e0ec[_0xc001('0x2a')]=qs['limit'](_0x1d553d['query'][_0xc001('0x2a')]);_0x10e0ec[_0xc001('0x27')]=qs['offset'](_0x1d553d['query'][_0xc001('0x27')]);}return _0x3df920[_0xc001('0x11c')](_0x10e0ec);}})[_0xc001('0x31')](function(_0x5a3036){if(_0x5a3036){return _0x5a3036?{'count':_0x2d4ae9,'rows':_0x5a3036}:null;}})[_0xc001('0x31')](respondWithResult(_0x17c61e,null))[_0xc001('0x23')](handleError(_0x17c61e,null));};exports['addProactiveActions']=function(_0x1cd48e,_0x110c8a,_0x309750){return db[_0xc001('0x11d')]['find']({'where':{'id':_0x1cd48e[_0xc001('0x56')]['id']}})[_0xc001('0x31')](handleEntityNotFound(_0x110c8a,null))['then'](function(_0x2bb52d){if(_0x2bb52d){return _0x2bb52d[_0xc001('0x11e')](_0x1cd48e['body'][_0xc001('0x68')],_['omit'](_0x1cd48e[_0xc001('0x58')],[_0xc001('0x68'),'id'])||{});}})[_0xc001('0x31')](respondWithResult(_0x110c8a,null))[_0xc001('0x23')](handleError(_0x110c8a,null));};exports[_0xc001('0x10a')]=function(_0x5245e7,_0x51ce3a,_0xa48c56){var _0x58ef5a={};var _0x4218ca={};var _0x4a9af3;var _0x4ba1ef;return db[_0xc001('0x3a')][_0xc001('0x66')]({'where':{'id':_0x5245e7[_0xc001('0x56')]['id']}})[_0xc001('0x31')](handleEntityNotFound(_0x51ce3a,null))[_0xc001('0x31')](function(_0x5451bd){if(_0x5451bd){_0x4a9af3=_0x5451bd;_0x4218ca[_0xc001('0x3e')]=_[_0xc001('0x41')](db[_0xc001('0x11f')][_0xc001('0x3b')]);_0x4218ca[_0xc001('0x40')]=_['keys'](_0x5245e7[_0xc001('0x40')]);_0x4218ca[_0xc001('0x42')]=_[_0xc001('0x44')](_0x4218ca[_0xc001('0x3e')],_0x4218ca[_0xc001('0x40')]);_0x58ef5a[_0xc001('0x43')]=_[_0xc001('0x44')](_0x4218ca[_0xc001('0x3e')],qs[_0xc001('0x45')](_0x5245e7[_0xc001('0x40')][_0xc001('0x45')]));_0x58ef5a[_0xc001('0x43')]=_0x58ef5a[_0xc001('0x43')][_0xc001('0x46')]?_0x58ef5a[_0xc001('0x43')]:_0x4218ca[_0xc001('0x3e')];_0x58ef5a[_0xc001('0x49')]=qs['sort'](_0x5245e7[_0xc001('0x40')]['sort']);_0x58ef5a['where']=qs['filters'](_[_0xc001('0x4c')](_0x5245e7[_0xc001('0x40')],_0x4218ca[_0xc001('0x42')]));if(_0x5245e7[_0xc001('0x40')]['filter']){_0x58ef5a[_0xc001('0x4b')]=_[_0xc001('0x4e')](_0x58ef5a[_0xc001('0x4b')],{'$or':_[_0xc001('0x39')](_0x58ef5a[_0xc001('0x43')],function(_0x555f60){var _0x562545={};_0x562545[_0x555f60]={'$like':'%'+_0x5245e7[_0xc001('0x40')]['filter']+'%'};return _0x562545;})});}_0x58ef5a=_[_0xc001('0x4e')]({},_0x58ef5a,_0x5245e7[_0xc001('0x50')]);return _0x4a9af3[_0xc001('0x10a')](_0x58ef5a);}})[_0xc001('0x31')](function(_0x3c7b8d){if(_0x3c7b8d){_0x4ba1ef=_0x3c7b8d[_0xc001('0x46')];if(!_0x5245e7['query'][_0xc001('0x47')]('nolimit')){_0x58ef5a[_0xc001('0x2a')]=qs[_0xc001('0x2a')](_0x5245e7['query'][_0xc001('0x2a')]);_0x58ef5a[_0xc001('0x27')]=qs[_0xc001('0x27')](_0x5245e7[_0xc001('0x40')]['offset']);}return _0x4a9af3[_0xc001('0x10a')](_0x58ef5a);}})[_0xc001('0x31')](function(_0x96f668){if(_0x96f668){return _0x96f668?{'count':_0x4ba1ef,'rows':_0x96f668}:null;}})[_0xc001('0x31')](respondWithResult(_0x51ce3a,null))[_0xc001('0x23')](handleError(_0x51ce3a,null));};exports[_0xc001('0x120')]=function(_0x4ab21d,_0x4dc407,_0x3fabd4){var _0x4b933e=_0x4ab21d[_0xc001('0x40')][_0xc001('0x121')]===_0xc001('0x122')?'offlineForm':'onlineForm';return db[_0xc001('0x3a')][_0xc001('0x5c')]({'attributes':['id',_0x4b933e],'where':{'id':_0x4ab21d[_0xc001('0x56')]['id']}})[_0xc001('0x31')](handleEntityNotFound(_0x4dc407,null))[_0xc001('0x31')](function(_0x4daa4f){if(_0x4daa4f){var _0x1b4232=_0x4daa4f[_0x4b933e];var _0x3d069e=_0x1b4232&&_0x1b4232[_0xc001('0x123')]?_0x1b4232[_0xc001('0x123')]:[];_0x4dc407[_0xc001('0x36')]({'fromKey':_[_0xc001('0x79')](_0x1b4232['fromKey'])?undefined:_0x1b4232['fromKey'],'count':_0x3d069e[_0xc001('0x46')],'rows':_0x3d069e});}})[_0xc001('0x23')](handleError(_0x4dc407,null));};exports['getOfflineMessages']=function(_0x28b07b,_0x3f0838,_0x5abf17){var _0x3515ff={'raw':![],'where':{}};var _0x48a54c={};var _0x15ed75={'count':0x0,'rows':[]};return db[_0xc001('0x3a')]['findOne']({'where':{'id':_0x28b07b[_0xc001('0x56')]['id']}})['then'](handleEntityNotFound(_0x3f0838,null))[_0xc001('0x31')](function(_0x3b9ae9){if(_0x3b9ae9){_0x48a54c[_0xc001('0x3e')]=_['keys'](db[_0xc001('0xd6')][_0xc001('0x3b')]);_0x48a54c[_0xc001('0x40')]=_[_0xc001('0x41')](_0x28b07b[_0xc001('0x40')]);_0x48a54c['filters']=_[_0xc001('0x44')](_0x48a54c[_0xc001('0x3e')],_0x48a54c[_0xc001('0x40')]);_0x3515ff[_0xc001('0x43')]=_['intersection'](_0x48a54c[_0xc001('0x3e')],qs[_0xc001('0x45')](_0x28b07b[_0xc001('0x40')]['fields']));_0x3515ff[_0xc001('0x43')]=_0x3515ff['attributes'][_0xc001('0x46')]?_0x3515ff[_0xc001('0x43')]:_0x48a54c[_0xc001('0x3e')];if(!_0x28b07b[_0xc001('0x40')][_0xc001('0x47')]('nolimit')){_0x3515ff[_0xc001('0x2a')]=qs[_0xc001('0x2a')](_0x28b07b[_0xc001('0x40')][_0xc001('0x2a')]);_0x3515ff['offset']=qs['offset'](_0x28b07b[_0xc001('0x40')][_0xc001('0x27')]);}_0x3515ff['order']=qs[_0xc001('0x4a')](_0x28b07b[_0xc001('0x40')][_0xc001('0x4a')]);_0x3515ff[_0xc001('0x4b')]=qs['filters'](_['pick'](_0x28b07b[_0xc001('0x40')],_0x48a54c[_0xc001('0x42')]));_0x3515ff[_0xc001('0x4b')][_0xc001('0x63')]=_0x3b9ae9['id'];if(_0x28b07b[_0xc001('0x40')][_0xc001('0x4d')]){_0x3515ff[_0xc001('0x4b')]=_[_0xc001('0x4e')](_0x3515ff[_0xc001('0x4b')],{'$or':_[_0xc001('0x39')](_0x3515ff[_0xc001('0x43')],function(_0x5de9d0){var _0x248f1b={};_0x248f1b[_0x5de9d0]={'$like':'%'+_0x28b07b['query'][_0xc001('0x4d')]+'%'};return _0x248f1b;})});}_0x3515ff=_['merge']({},_0x3515ff,_0x28b07b[_0xc001('0x50')]);return db[_0xc001('0xd6')][_0xc001('0x29')]({'where':_0x3515ff[_0xc001('0x4b')]})[_0xc001('0x31')](function(_0x1c6a6e){_0x15ed75[_0xc001('0x29')]=_0x1c6a6e;if(_0x28b07b[_0xc001('0x40')][_0xc001('0x51')]){_0x3515ff['include']=[{'all':!![]}];}else{_0x3515ff[_0xc001('0x52')]=[{'model':db[_0xc001('0x8b')],'as':_0xc001('0xf8'),'required':![]},{'model':db[_0xc001('0xde')],'as':_0xc001('0x124'),'required':![]}];}return db[_0xc001('0xd6')][_0xc001('0x53')](_0x3515ff);})['then'](function(_0x218151){_0x15ed75['rows']=_0x218151;return _0x15ed75;});}})[_0xc001('0x31')](respondWithFilteredResult(_0x3f0838,_0x3515ff))[_0xc001('0x23')](handleError(_0x3f0838,null));};exports[_0xc001('0x125')]=function(_0xe540e1,_0x4534c0,_0x248129){return db[_0xc001('0x3a')][_0xc001('0x5c')]({'where':{'id':_0xe540e1[_0xc001('0x56')]['id']}})[_0xc001('0x31')](handleEntityNotFound(_0x4534c0,null))[_0xc001('0x31')](function(_0x47e27e){if(_0x47e27e){return _0x47e27e[_0xc001('0x125')](_0xe540e1[_0xc001('0x58')][_0xc001('0x68')],_[_0xc001('0x126')](_0xe540e1['body'],[_0xc001('0x68'),'id'])||{})[_0xc001('0xb9')](function(_0xe4cead){for(var _0x65958a=0x0;_0x65958a<_0xe540e1[_0xc001('0x58')][_0xc001('0x68')][_0xc001('0x46')];_0x65958a+=0x1){socket[_0xc001('0x127')](_0xc001('0x128'),{'UserId':Number(_0xe540e1['body'][_0xc001('0x68')][_0x65958a]),'ChatWebsiteId':Number(_0xe540e1[_0xc001('0x56')]['id'])});}return _0xe4cead;});}})['then'](respondWithResult(_0x4534c0,null))[_0xc001('0x23')](handleError(_0x4534c0,null));};exports[_0xc001('0x129')]=function(_0x22902a,_0x1648c5,_0x404fbb){return db[_0xc001('0x3a')][_0xc001('0x5c')]({'where':{'id':_0x22902a[_0xc001('0x56')]['id']}})['then'](handleEntityNotFound(_0x1648c5,null))[_0xc001('0x31')](function(_0x35b119){if(_0x35b119){return _0x35b119[_0xc001('0x129')](_0x22902a[_0xc001('0x40')][_0xc001('0x68')])[_0xc001('0x31')](function(){if(_[_0xc001('0x12a')](_0x22902a[_0xc001('0x40')][_0xc001('0x68')])){for(var _0xc99078=0x0;_0xc99078<_0x22902a[_0xc001('0x40')][_0xc001('0x68')][_0xc001('0x46')];_0xc99078+=0x1){socket['emit'](_0xc001('0x12b'),{'UserId':Number(_0x22902a[_0xc001('0x40')][_0xc001('0x68')][_0xc99078]),'ChatWebsiteId':Number(_0x22902a['params']['id'])});}}else{socket[_0xc001('0x127')]('userChatWebsite:remove',{'UserId':Number(_0x22902a[_0xc001('0x40')][_0xc001('0x68')]),'ChatWebsiteId':Number(_0x22902a[_0xc001('0x56')]['id'])});}});}})[_0xc001('0x31')](respondWithStatusCode(_0x1648c5,null))[_0xc001('0x23')](handleError(_0x1648c5,null));};exports[_0xc001('0x12c')]=function(_0xccca24,_0x4bb4d0,_0xabbadb){var _0x1afafa={};var _0x49e370={};var _0x38db8b;var _0xfda35e;return db[_0xc001('0x3a')][_0xc001('0x66')]({'where':{'id':_0xccca24['params']['id']}})[_0xc001('0x31')](handleEntityNotFound(_0x4bb4d0,null))[_0xc001('0x31')](function(_0x169850){if(_0x169850){_0x38db8b=_0x169850;_0x49e370[_0xc001('0x3e')]=_[_0xc001('0x41')](db[_0xc001('0xc3')][_0xc001('0x3b')]);_0x49e370[_0xc001('0x40')]=_[_0xc001('0x41')](_0xccca24[_0xc001('0x40')]);_0x49e370[_0xc001('0x42')]=_[_0xc001('0x44')](_0x49e370[_0xc001('0x3e')],_0x49e370['query']);_0x1afafa['attributes']=_[_0xc001('0x44')](_0x49e370['model'],qs['fields'](_0xccca24[_0xc001('0x40')][_0xc001('0x45')]));_0x1afafa[_0xc001('0x43')]=_0x1afafa[_0xc001('0x43')]['length']?_0x1afafa['attributes']:_0x49e370[_0xc001('0x3e')];_0x1afafa[_0xc001('0x49')]=qs[_0xc001('0x4a')](_0xccca24[_0xc001('0x40')][_0xc001('0x4a')]);_0x1afafa['where']=qs[_0xc001('0x42')](_[_0xc001('0x4c')](_0xccca24[_0xc001('0x40')],_0x49e370[_0xc001('0x42')]));if(_0xccca24['query'][_0xc001('0x4d')]){_0x1afafa[_0xc001('0x4b')]=_[_0xc001('0x4e')](_0x1afafa[_0xc001('0x4b')],{'$or':_[_0xc001('0x39')](_0x1afafa[_0xc001('0x43')],function(_0x475bc9){var _0x351043={};_0x351043[_0x475bc9]={'$like':'%'+_0xccca24[_0xc001('0x40')][_0xc001('0x4d')]+'%'};return _0x351043;})});}_0x1afafa=_['merge']({},_0x1afafa,_0xccca24[_0xc001('0x50')]);return _0x38db8b[_0xc001('0x12c')](_0x1afafa);}})['then'](function(_0x3419e2){if(_0x3419e2){_0xfda35e=_0x3419e2[_0xc001('0x46')];if(!_0xccca24[_0xc001('0x40')][_0xc001('0x47')](_0xc001('0x48'))){_0x1afafa['limit']=qs[_0xc001('0x2a')](_0xccca24[_0xc001('0x40')][_0xc001('0x2a')]);_0x1afafa[_0xc001('0x27')]=qs['offset'](_0xccca24[_0xc001('0x40')]['offset']);}return _0x38db8b['getAgents'](_0x1afafa);}})[_0xc001('0x31')](function(_0x21bd8b){if(_0x21bd8b){return _0x21bd8b?{'count':_0xfda35e,'rows':_0x21bd8b}:null;}})['then'](respondWithResult(_0x4bb4d0,null))[_0xc001('0x23')](handleError(_0x4bb4d0,null));};
\ No newline at end of file
diff --git a/server/api/chatWebsite/chatWebsite.events.js b/server/api/chatWebsite/chatWebsite.events.js
index 98e9c6a..7adc411 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 _0x12c9=['ChatWebsite','setMaxListeners','save','remove','hasOwnProperty','hook','exports','events','../../mysqldb'];(function(_0x28c89b,_0x2510b3){var _0x176500=function(_0x3dfee2){while(--_0x3dfee2){_0x28c89b['push'](_0x28c89b['shift']());}};_0x176500(++_0x2510b3);}(_0x12c9,0x1c9));var _0x912c=function(_0x9fac4a,_0x9c6951){_0x9fac4a=_0x9fac4a-0x0;var _0x55851f=_0x12c9[_0x9fac4a];return _0x55851f;};'use strict';var EventEmitter=require(_0x912c('0x0'));var ChatWebsite=require(_0x912c('0x1'))['db'][_0x912c('0x2')];var ChatWebsiteEvents=new EventEmitter();ChatWebsiteEvents[_0x912c('0x3')](0x0);var events={'afterCreate':_0x912c('0x4'),'afterUpdate':'update','afterDestroy':_0x912c('0x5')};function emitEvent(_0xcb7adc){return function(_0x2c8059,_0x298dcc,_0x1732a0){ChatWebsiteEvents['emit'](_0xcb7adc+':'+_0x2c8059['id'],_0x2c8059);ChatWebsiteEvents['emit'](_0xcb7adc,_0x2c8059);_0x1732a0(null);};}for(var e in events){if(events[_0x912c('0x6')](e)){var event=events[e];ChatWebsite[_0x912c('0x7')](e,emitEvent(event));}}module[_0x912c('0x8')]=ChatWebsiteEvents;
\ No newline at end of file
+var _0x92bc=['remove','emit','exports','events','../../mysqldb','ChatWebsite','update'];(function(_0x1c546c,_0x5c57cb){var _0x2cc384=function(_0x4dee11){while(--_0x4dee11){_0x1c546c['push'](_0x1c546c['shift']());}};_0x2cc384(++_0x5c57cb);}(_0x92bc,0x106));var _0xc92b=function(_0x933b37,_0x188075){_0x933b37=_0x933b37-0x0;var _0x51cad0=_0x92bc[_0x933b37];return _0x51cad0;};'use strict';var EventEmitter=require(_0xc92b('0x0'));var ChatWebsite=require(_0xc92b('0x1'))['db'][_0xc92b('0x2')];var ChatWebsiteEvents=new EventEmitter();ChatWebsiteEvents['setMaxListeners'](0x0);var events={'afterCreate':'save','afterUpdate':_0xc92b('0x3'),'afterDestroy':_0xc92b('0x4')};function emitEvent(_0x35903f){return function(_0x1d7812,_0x56c979,_0x2dcfaa){ChatWebsiteEvents[_0xc92b('0x5')](_0x35903f+':'+_0x1d7812['id'],_0x1d7812);ChatWebsiteEvents[_0xc92b('0x5')](_0x35903f,_0x1d7812);_0x2dcfaa(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];ChatWebsite['hook'](e,emitEvent(event));}}module[_0xc92b('0x6')]=ChatWebsiteEvents;
\ No newline at end of file
diff --git a/server/api/chatWebsite/chatWebsite.model.js b/server/api/chatWebsite/chatWebsite.model.js
index c3392e7..7393a36 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 _0x5390=['rimraf','../../config/environment','./chatWebsite.attributes','exports','define','ChatWebsite','chat_websites','lodash','../../config/logger','api','moment','bluebird','request-promise','path'];(function(_0x23be51,_0xc02a1b){var _0x47a26d=function(_0xa92395){while(--_0xa92395){_0x23be51['push'](_0x23be51['shift']());}};_0x47a26d(++_0xc02a1b);}(_0x5390,0xbd));var _0x0539=function(_0x5f077e,_0xb33587){_0x5f077e=_0x5f077e-0x0;var _0x3a8800=_0x5390[_0x5f077e];return _0x3a8800;};'use strict';var _=require(_0x0539('0x0'));var util=require('util');var logger=require(_0x0539('0x1'))(_0x0539('0x2'));var moment=require(_0x0539('0x3'));var BPromise=require(_0x0539('0x4'));var rp=require(_0x0539('0x5'));var fs=require('fs');var path=require(_0x0539('0x6'));var rimraf=require(_0x0539('0x7'));var config=require(_0x0539('0x8'));var attributes=require(_0x0539('0x9'));module[_0x0539('0xa')]=function(_0x4a5e15,_0x232461){return _0x4a5e15[_0x0539('0xb')](_0x0539('0xc'),attributes,{'tableName':_0x0539('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x075e=['request-promise','path','../../config/environment','./chatWebsite.attributes','exports','define','ChatWebsite','lodash','util','../../config/logger','moment','bluebird'];(function(_0x19950b,_0x53d0d7){var _0x3c6b41=function(_0x3924ad){while(--_0x3924ad){_0x19950b['push'](_0x19950b['shift']());}};_0x3c6b41(++_0x53d0d7);}(_0x075e,0xbb));var _0xe075=function(_0x17fd9d,_0x2238f6){_0x17fd9d=_0x17fd9d-0x0;var _0x155279=_0x075e[_0x17fd9d];return _0x155279;};'use strict';var _=require(_0xe075('0x0'));var util=require(_0xe075('0x1'));var logger=require(_0xe075('0x2'))('api');var moment=require(_0xe075('0x3'));var BPromise=require(_0xe075('0x4'));var rp=require(_0xe075('0x5'));var fs=require('fs');var path=require(_0xe075('0x6'));var rimraf=require('rimraf');var config=require(_0xe075('0x7'));var attributes=require(_0xe075('0x8'));module[_0xe075('0x9')]=function(_0x445bff,_0xf79fd7){return _0x445bff[_0xe075('0xa')](_0xe075('0xb'),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 09981f2..39d9e22 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 _0x2e54=['http','redis','localhost','socket.io-emitter','./chatWebsite.socket','request','then','info','ChatWebsite,\x20%s,\x20%s','ChatWebsite,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','code','error','message','catch','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client'];(function(_0x34a10c,_0x7ce96a){var _0x3015ab=function(_0x159266){while(--_0x159266){_0x34a10c['push'](_0x34a10c['shift']());}};_0x3015ab(++_0x7ce96a);}(_0x2e54,0xf0));var _0x42e5=function(_0xf9a23f,_0x326c20){_0xf9a23f=_0xf9a23f-0x0;var _0x2c5f99=_0x2e54[_0xf9a23f];return _0x2c5f99;};'use strict';var _=require(_0x42e5('0x0'));var util=require(_0x42e5('0x1'));var moment=require('moment');var BPromise=require(_0x42e5('0x2'));var rs=require(_0x42e5('0x3'));var fs=require('fs');var Redis=require(_0x42e5('0x4'));var db=require(_0x42e5('0x5'))['db'];var utils=require(_0x42e5('0x6'));var logger=require(_0x42e5('0x7'))(_0x42e5('0x8'));var config=require(_0x42e5('0x9'));var jayson=require(_0x42e5('0xa'));var client=jayson[_0x42e5('0xb')][_0x42e5('0xc')]({'port':0x232a});config[_0x42e5('0xd')]=_['defaults'](config[_0x42e5('0xd')],{'host':_0x42e5('0xe'),'port':0x18eb});var socket=require(_0x42e5('0xf'))(new Redis(config[_0x42e5('0xd')]));require(_0x42e5('0x10'))['register'](socket);function respondWithRpcPromise(_0x606e56,_0x41d508,_0xa1d995){return new BPromise(function(_0x519e10,_0x431b43){return client[_0x42e5('0x11')](_0x606e56,_0xa1d995)[_0x42e5('0x12')](function(_0x1c2408){logger[_0x42e5('0x13')](_0x42e5('0x14'),_0x41d508,'request\x20sent');logger['debug'](_0x42e5('0x15'),_0x41d508,_0x42e5('0x16'),JSON[_0x42e5('0x17')](_0x1c2408));if(_0x1c2408['error']){if(_0x1c2408['error'][_0x42e5('0x18')]===0x1f4){logger[_0x42e5('0x19')](_0x42e5('0x14'),_0x41d508,_0x1c2408[_0x42e5('0x19')]['message']);return _0x431b43(_0x1c2408[_0x42e5('0x19')]['message']);}logger[_0x42e5('0x19')](_0x42e5('0x14'),_0x41d508,_0x1c2408[_0x42e5('0x19')]['message']);return _0x519e10(_0x1c2408[_0x42e5('0x19')]['message']);}else{logger[_0x42e5('0x13')]('ChatWebsite,\x20%s,\x20%s',_0x41d508,_0x42e5('0x16'));_0x519e10(_0x1c2408['result'][_0x42e5('0x1a')]);}})[_0x42e5('0x1b')](function(_0x2b5967){logger[_0x42e5('0x19')](_0x42e5('0x14'),_0x41d508,_0x2b5967);_0x431b43(_0x2b5967);});});}
\ No newline at end of file
+var _0x413d=['request\x20sent','debug','ChatWebsite,\x20%s,\x20%s,\x20%s','stringify','error','ChatWebsite,\x20%s,\x20%s','message','result','util','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','socket.io-emitter','./chatWebsite.socket','request','then','info'];(function(_0x46905f,_0x15043b){var _0x27e8da=function(_0x2235e4){while(--_0x2235e4){_0x46905f['push'](_0x46905f['shift']());}};_0x27e8da(++_0x15043b);}(_0x413d,0x15a));var _0xd413=function(_0x4d8ed9,_0x2ae284){_0x4d8ed9=_0x4d8ed9-0x0;var _0x1e2140=_0x413d[_0x4d8ed9];return _0x1e2140;};'use strict';var _=require('lodash');var util=require(_0xd413('0x0'));var moment=require('moment');var BPromise=require(_0xd413('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xd413('0x2'));var db=require(_0xd413('0x3'))['db'];var utils=require(_0xd413('0x4'));var logger=require(_0xd413('0x5'))(_0xd413('0x6'));var config=require(_0xd413('0x7'));var jayson=require(_0xd413('0x8'));var client=jayson[_0xd413('0x9')][_0xd413('0xa')]({'port':0x232a});config[_0xd413('0xb')]=_[_0xd413('0xc')](config[_0xd413('0xb')],{'host':'localhost','port':0x18eb});var socket=require(_0xd413('0xd'))(new Redis(config[_0xd413('0xb')]));require(_0xd413('0xe'))['register'](socket);function respondWithRpcPromise(_0x193ee7,_0x4e6981,_0x4fcaf8){return new BPromise(function(_0x2a8ddb,_0x34b04e){return client[_0xd413('0xf')](_0x193ee7,_0x4fcaf8)[_0xd413('0x10')](function(_0x269015){logger[_0xd413('0x11')]('ChatWebsite,\x20%s,\x20%s',_0x4e6981,_0xd413('0x12'));logger[_0xd413('0x13')](_0xd413('0x14'),_0x4e6981,_0xd413('0x12'),JSON[_0xd413('0x15')](_0x269015));if(_0x269015['error']){if(_0x269015[_0xd413('0x16')]['code']===0x1f4){logger['error'](_0xd413('0x17'),_0x4e6981,_0x269015[_0xd413('0x16')][_0xd413('0x18')]);return _0x34b04e(_0x269015[_0xd413('0x16')][_0xd413('0x18')]);}logger[_0xd413('0x16')](_0xd413('0x17'),_0x4e6981,_0x269015['error'][_0xd413('0x18')]);return _0x2a8ddb(_0x269015[_0xd413('0x16')][_0xd413('0x18')]);}else{logger[_0xd413('0x11')](_0xd413('0x17'),_0x4e6981,_0xd413('0x12'));_0x2a8ddb(_0x269015[_0xd413('0x19')][_0xd413('0x18')]);}})['catch'](function(_0x1cf6fb){logger['error'](_0xd413('0x17'),_0x4e6981,_0x1cf6fb);_0x34b04e(_0x1cf6fb);});});}
\ No newline at end of file
diff --git a/server/api/chatWebsite/chatWebsite.socket.js b/server/api/chatWebsite/chatWebsite.socket.js
index 3bb3806..14cafd9 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 _0xd16b=['length','chatWebsite:','./chatWebsite.events','save','update','emit','removeListener','register'];(function(_0x18371d,_0xf7d926){var _0x48fedb=function(_0x165472){while(--_0x165472){_0x18371d['push'](_0x18371d['shift']());}};_0x48fedb(++_0xf7d926);}(_0xd16b,0x1aa));var _0xbd16=function(_0x3b2db6,_0x51249c){_0x3b2db6=_0x3b2db6-0x0;var _0x18a9a5=_0xd16b[_0x3b2db6];return _0x18a9a5;};'use strict';var ChatWebsiteEvents=require(_0xbd16('0x0'));var events=[_0xbd16('0x1'),'remove',_0xbd16('0x2')];function createListener(_0x48483f,_0x1baae0){return function(_0x27c61e){_0x1baae0[_0xbd16('0x3')](_0x48483f,_0x27c61e);};}function removeListener(_0x54364d,_0x2d089e){return function(){ChatWebsiteEvents[_0xbd16('0x4')](_0x54364d,_0x2d089e);};}exports[_0xbd16('0x5')]=function(_0x34d800){for(var _0x193dcf=0x0,_0x47d123=events[_0xbd16('0x6')];_0x193dcf<_0x47d123;_0x193dcf++){var _0x1593cf=events[_0x193dcf];var _0x55d6a9=createListener(_0xbd16('0x7')+_0x1593cf,_0x34d800);ChatWebsiteEvents['on'](_0x1593cf,_0x55d6a9);}};
\ No newline at end of file
+var _0x99c8=['emit','register','save','update'];(function(_0x2442f7,_0x4a55f7){var _0xb8f055=function(_0x5b55d9){while(--_0x5b55d9){_0x2442f7['push'](_0x2442f7['shift']());}};_0xb8f055(++_0x4a55f7);}(_0x99c8,0x17e));var _0x899c=function(_0x36e041,_0x72b33a){_0x36e041=_0x36e041-0x0;var _0x1255e4=_0x99c8[_0x36e041];return _0x1255e4;};'use strict';var ChatWebsiteEvents=require('./chatWebsite.events');var events=[_0x899c('0x0'),'remove',_0x899c('0x1')];function createListener(_0x44f35f,_0xeea406){return function(_0x2e62b1){_0xeea406[_0x899c('0x2')](_0x44f35f,_0x2e62b1);};}function removeListener(_0x5946b8,_0x395ef0){return function(){ChatWebsiteEvents['removeListener'](_0x5946b8,_0x395ef0);};}exports[_0x899c('0x3')]=function(_0x272ad4){for(var _0x44cdd1=0x0,_0x482350=events['length'];_0x44cdd1<_0x482350;_0x44cdd1++){var _0x2505a9=events[_0x44cdd1];var _0x2e8730=createListener('chatWebsite:'+_0x2505a9,_0x272ad4);ChatWebsiteEvents['on'](_0x2505a9,_0x2e8730);}};
\ No newline at end of file
diff --git a/server/api/chatWebsite/index.js b/server/api/chatWebsite/index.js
index 938dd21..11f8413 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 _0x8877=['getFields','/:id/offline_messages','getOfflineMessages','/:id/users','getAgents','create','post','addDisposition','addAnswer','diskStorage','root','server/files/images/logos/','%s-%s','originalname','single','file','addLogo','join','now','/:id/avatar','addAvatar','server/files/images/avatars/','/:id/customer_avatar','addCustomerAvatar','addSystemAvatar','/:id/notify','notify','server/files','attachments','ensureDir','replace','extname','any','offline','addInteraction','addApplications','addProactiveActions','addAgents','update','delete','removeDispositions','removeAnswers','removeAgents','multer','util','path','connect-timeout','express','fs-extra','../../components/interaction/service','../../config/environment','get','index','/describe','isAuthenticated','show','/:id/dispositions','getDispositions','/:id/canned_answers','getAnswers','/:id/logo','getLogo','getAvatar','/:id/system_avatar','/:id/interactions','getInteractions','/:id/applications','getApplications','/:id/proactive_actions','getProactiveActions','/:id/fields'];(function(_0x3a3150,_0x11cf18){var _0x52957b=function(_0x3e3932){while(--_0x3e3932){_0x3a3150['push'](_0x3a3150['shift']());}};_0x52957b(++_0x11cf18);}(_0x8877,0xb9));var _0x7887=function(_0x268da5,_0x1842b4){_0x268da5=_0x268da5-0x0;var _0x67d6ca=_0x8877[_0x268da5];return _0x67d6ca;};'use strict';var multer=require(_0x7887('0x0'));var util=require(_0x7887('0x1'));var path=require(_0x7887('0x2'));var timeout=require(_0x7887('0x3'));var express=require(_0x7887('0x4'));var router=express['Router']();var fs_extra=require(_0x7887('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0x7887('0x6'));var config=require(_0x7887('0x7'));var controller=require('./chatWebsite.controller');router[_0x7887('0x8')]('/',auth['isAuthenticated'](),controller[_0x7887('0x9')]);router[_0x7887('0x8')](_0x7887('0xa'),auth[_0x7887('0xb')](),controller['describe']);router[_0x7887('0x8')]('/:id',auth['isAuthenticated'](),controller[_0x7887('0xc')]);router[_0x7887('0x8')](_0x7887('0xd'),auth[_0x7887('0xb')](),controller[_0x7887('0xe')]);router[_0x7887('0x8')](_0x7887('0xf'),auth[_0x7887('0xb')](),controller[_0x7887('0x10')]);router[_0x7887('0x8')](_0x7887('0x11'),controller[_0x7887('0x12')]);router[_0x7887('0x8')]('/:id/avatar',controller[_0x7887('0x13')]);router[_0x7887('0x8')]('/:id/customer_avatar',controller['getCustomerAvatar']);router[_0x7887('0x8')](_0x7887('0x14'),controller['getSystemAvatar']);router[_0x7887('0x8')](_0x7887('0x15'),auth[_0x7887('0xb')](),controller[_0x7887('0x16')]);router[_0x7887('0x8')]('/:id/snippet',controller['getSnippet']);router[_0x7887('0x8')](_0x7887('0x17'),auth[_0x7887('0xb')](),controller[_0x7887('0x18')]);router[_0x7887('0x8')](_0x7887('0x19'),auth[_0x7887('0xb')](),controller[_0x7887('0x1a')]);router[_0x7887('0x8')](_0x7887('0x1b'),controller[_0x7887('0x1c')]);router[_0x7887('0x8')](_0x7887('0x1d'),auth['isAuthenticated'](),controller[_0x7887('0x1e')]);router[_0x7887('0x8')](_0x7887('0x1f'),auth['isAuthenticated'](),controller[_0x7887('0x20')]);router['post']('/',auth[_0x7887('0xb')](),controller[_0x7887('0x21')]);router[_0x7887('0x22')]('/:id/dispositions',auth[_0x7887('0xb')](),controller[_0x7887('0x23')]);router[_0x7887('0x22')](_0x7887('0xf'),auth[_0x7887('0xb')](),controller[_0x7887('0x24')]);var upload=multer({'storage':multer[_0x7887('0x25')]({'destination':function(_0x2e72f2,_0x55c878,_0x4f9725){_0x4f9725(null,path['join'](config[_0x7887('0x26')],_0x7887('0x27')));},'filename':function(_0x43494f,_0x51373f,_0x42b50d){_0x42b50d(null,util['format'](_0x7887('0x28'),Date['now'](),_0x51373f[_0x7887('0x29')]));}})});router[_0x7887('0x22')](_0x7887('0x11'),upload[_0x7887('0x2a')](_0x7887('0x2b')),controller[_0x7887('0x2c')]);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x2e7d07,_0x5bc6a7,_0x1f4569){_0x1f4569(null,path[_0x7887('0x2d')](config[_0x7887('0x26')],'server/files/images/avatars/'));},'filename':function(_0x151567,_0x50d5f7,_0x558884){_0x558884(null,util['format'](_0x7887('0x28'),Date[_0x7887('0x2e')](),_0x50d5f7[_0x7887('0x29')]));}})});router['post'](_0x7887('0x2f'),upload[_0x7887('0x2a')](_0x7887('0x2b')),controller[_0x7887('0x30')]);var upload=multer({'storage':multer[_0x7887('0x25')]({'destination':function(_0x43c35a,_0x18cb95,_0xf456a0){_0xf456a0(null,path[_0x7887('0x2d')](config[_0x7887('0x26')],_0x7887('0x31')));},'filename':function(_0x534fd1,_0x42b45e,_0x5b6256){_0x5b6256(null,util['format'](_0x7887('0x28'),Date[_0x7887('0x2e')](),_0x42b45e['originalname']));}})});router['post'](_0x7887('0x32'),upload[_0x7887('0x2a')](_0x7887('0x2b')),controller[_0x7887('0x33')]);var upload=multer({'storage':multer[_0x7887('0x25')]({'destination':function(_0x134d65,_0x4f2e95,_0x18254d){_0x18254d(null,path['join'](config['root'],_0x7887('0x31')));},'filename':function(_0x9774c5,_0x565410,_0x1f103d){_0x1f103d(null,util['format'](_0x7887('0x28'),Date[_0x7887('0x2e')](),_0x565410['originalname']));}})});router[_0x7887('0x22')](_0x7887('0x14'),upload[_0x7887('0x2a')](_0x7887('0x2b')),controller[_0x7887('0x34')]);router[_0x7887('0x22')](_0x7887('0x35'),controller[_0x7887('0x36')]);const offlineUploadMulter=multer({'storage':multer['diskStorage']({'destination':function(_0x5d3b98,_0x317ccf,_0x1ee381){const _0x38b78b=path['join'](config[_0x7887('0x26')],_0x7887('0x37'),_0x7887('0x38'),'offline-chat');fs_extra[_0x7887('0x39')](_0x38b78b,function(){_0x1ee381(null,_0x38b78b);});},'filename':function(_0x3d6bc0,_0x40b967,_0x3c98c5){const _0x128e8b=_0x40b967['originalname'][_0x7887('0x3a')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');const _0x5dfad7=path[_0x7887('0x3b')](_0x128e8b);const _0x42801b=Date[_0x7887('0x2e')]()+'-'+_0x128e8b[_0x7887('0x3a')](_0x5dfad7,'')+_0x5dfad7;_0x3c98c5(null,_0x42801b);}})});router[_0x7887('0x22')]('/:id/offline',offlineUploadMulter[_0x7887('0x3c')](),controller[_0x7887('0x3d')]);router[_0x7887('0x22')](_0x7887('0x15'),auth[_0x7887('0xb')](),controller[_0x7887('0x3e')]);router[_0x7887('0x22')](_0x7887('0x17'),auth[_0x7887('0xb')](),controller[_0x7887('0x3f')]);router[_0x7887('0x22')](_0x7887('0x19'),auth[_0x7887('0xb')](),controller[_0x7887('0x40')]);router[_0x7887('0x22')](_0x7887('0x1f'),auth['isAuthenticated'](),controller[_0x7887('0x41')]);router['put']('/:id',auth[_0x7887('0xb')](),controller[_0x7887('0x42')]);router[_0x7887('0x43')]('/:id',auth['isAuthenticated'](),controller['destroy']);router[_0x7887('0x43')](_0x7887('0xd'),auth[_0x7887('0xb')](),controller[_0x7887('0x44')]);router[_0x7887('0x43')](_0x7887('0xf'),auth['isAuthenticated'](),controller[_0x7887('0x45')]);router[_0x7887('0x43')](_0x7887('0x1f'),auth[_0x7887('0xb')](),controller[_0x7887('0x46')]);module['exports']=router;
\ No newline at end of file
+var _0x57f0=['single','addCustomerAvatar','/:id/notify','notify','server/files','attachments','ensureDir','replace','extname','/:id/offline','offline','/:id/applications','addApplications','addProactiveActions','put','delete','destroy','removeAnswers','/:id/users','removeAgents','exports','util','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','./chatWebsite.controller','get','isAuthenticated','index','/describe','describe','/:id','show','/:id/dispositions','getDispositions','getAnswers','/:id/logo','getLogo','/:id/avatar','getAvatar','/:id/customer_avatar','getCustomerAvatar','/:id/system_avatar','getSystemAvatar','/:id/interactions','getInteractions','getApplications','/:id/proactive_actions','getFields','getOfflineMessages','getAgents','post','create','addDisposition','/:id/canned_answers','addAnswer','diskStorage','join','root','format','%s-%s','originalname','file','addLogo','server/files/images/avatars/','now'];(function(_0x4abc62,_0x3d206f){var _0x4f06dd=function(_0x104c6a){while(--_0x104c6a){_0x4abc62['push'](_0x4abc62['shift']());}};_0x4f06dd(++_0x3d206f);}(_0x57f0,0x9f));var _0x057f=function(_0x467dee,_0x6b22b0){_0x467dee=_0x467dee-0x0;var _0x4406c7=_0x57f0[_0x467dee];return _0x4406c7;};'use strict';var multer=require('multer');var util=require(_0x057f('0x0'));var path=require(_0x057f('0x1'));var timeout=require(_0x057f('0x2'));var express=require(_0x057f('0x3'));var router=express['Router']();var fs_extra=require(_0x057f('0x4'));var auth=require(_0x057f('0x5'));var interaction=require(_0x057f('0x6'));var config=require('../../config/environment');var controller=require(_0x057f('0x7'));router[_0x057f('0x8')]('/',auth[_0x057f('0x9')](),controller[_0x057f('0xa')]);router['get'](_0x057f('0xb'),auth[_0x057f('0x9')](),controller[_0x057f('0xc')]);router[_0x057f('0x8')](_0x057f('0xd'),auth[_0x057f('0x9')](),controller[_0x057f('0xe')]);router[_0x057f('0x8')](_0x057f('0xf'),auth[_0x057f('0x9')](),controller[_0x057f('0x10')]);router[_0x057f('0x8')]('/:id/canned_answers',auth[_0x057f('0x9')](),controller[_0x057f('0x11')]);router[_0x057f('0x8')](_0x057f('0x12'),controller[_0x057f('0x13')]);router[_0x057f('0x8')](_0x057f('0x14'),controller[_0x057f('0x15')]);router['get'](_0x057f('0x16'),controller[_0x057f('0x17')]);router[_0x057f('0x8')](_0x057f('0x18'),controller[_0x057f('0x19')]);router[_0x057f('0x8')](_0x057f('0x1a'),auth[_0x057f('0x9')](),controller[_0x057f('0x1b')]);router[_0x057f('0x8')]('/:id/snippet',controller['getSnippet']);router['get']('/:id/applications',auth['isAuthenticated'](),controller[_0x057f('0x1c')]);router[_0x057f('0x8')](_0x057f('0x1d'),auth['isAuthenticated'](),controller['getProactiveActions']);router[_0x057f('0x8')]('/:id/fields',controller[_0x057f('0x1e')]);router['get']('/:id/offline_messages',auth[_0x057f('0x9')](),controller[_0x057f('0x1f')]);router[_0x057f('0x8')]('/:id/users',auth['isAuthenticated'](),controller[_0x057f('0x20')]);router[_0x057f('0x21')]('/',auth[_0x057f('0x9')](),controller[_0x057f('0x22')]);router[_0x057f('0x21')]('/:id/dispositions',auth[_0x057f('0x9')](),controller[_0x057f('0x23')]);router[_0x057f('0x21')](_0x057f('0x24'),auth[_0x057f('0x9')](),controller[_0x057f('0x25')]);var upload=multer({'storage':multer[_0x057f('0x26')]({'destination':function(_0x512b77,_0x1d8201,_0x38b608){_0x38b608(null,path[_0x057f('0x27')](config[_0x057f('0x28')],'server/files/images/logos/'));},'filename':function(_0x5c65af,_0x3bce81,_0x2b4d79){_0x2b4d79(null,util[_0x057f('0x29')](_0x057f('0x2a'),Date['now'](),_0x3bce81[_0x057f('0x2b')]));}})});router[_0x057f('0x21')](_0x057f('0x12'),upload['single'](_0x057f('0x2c')),controller[_0x057f('0x2d')]);var upload=multer({'storage':multer[_0x057f('0x26')]({'destination':function(_0x4bb6e6,_0x504f40,_0x4a57d0){_0x4a57d0(null,path[_0x057f('0x27')](config[_0x057f('0x28')],_0x057f('0x2e')));},'filename':function(_0x4f387d,_0x4bfaad,_0x5452d2){_0x5452d2(null,util[_0x057f('0x29')](_0x057f('0x2a'),Date[_0x057f('0x2f')](),_0x4bfaad['originalname']));}})});router['post'](_0x057f('0x14'),upload[_0x057f('0x30')](_0x057f('0x2c')),controller['addAvatar']);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x42f6c7,_0x89f5de,_0x73a9f2){_0x73a9f2(null,path[_0x057f('0x27')](config[_0x057f('0x28')],_0x057f('0x2e')));},'filename':function(_0xe7b1cb,_0x5811b9,_0x404177){_0x404177(null,util['format']('%s-%s',Date['now'](),_0x5811b9[_0x057f('0x2b')]));}})});router[_0x057f('0x21')](_0x057f('0x16'),upload[_0x057f('0x30')](_0x057f('0x2c')),controller[_0x057f('0x31')]);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0xa0cb39,_0x4d048d,_0x2d3677){_0x2d3677(null,path[_0x057f('0x27')](config[_0x057f('0x28')],_0x057f('0x2e')));},'filename':function(_0xa60adb,_0x561130,_0x2b5332){_0x2b5332(null,util[_0x057f('0x29')](_0x057f('0x2a'),Date[_0x057f('0x2f')](),_0x561130[_0x057f('0x2b')]));}})});router[_0x057f('0x21')]('/:id/system_avatar',upload[_0x057f('0x30')](_0x057f('0x2c')),controller['addSystemAvatar']);router[_0x057f('0x21')](_0x057f('0x32'),controller[_0x057f('0x33')]);const offlineUploadMulter=multer({'storage':multer['diskStorage']({'destination':function(_0x51755e,_0xca1878,_0xce1c81){const _0x360535=path['join'](config[_0x057f('0x28')],_0x057f('0x34'),_0x057f('0x35'),'offline-chat');fs_extra[_0x057f('0x36')](_0x360535,function(){_0xce1c81(null,_0x360535);});},'filename':function(_0xbbe1bc,_0x523461,_0x46157f){const _0x6b5706=_0x523461[_0x057f('0x2b')][_0x057f('0x37')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');const _0x3650f3=path[_0x057f('0x38')](_0x6b5706);const _0x2d1530=Date[_0x057f('0x2f')]()+'-'+_0x6b5706[_0x057f('0x37')](_0x3650f3,'')+_0x3650f3;_0x46157f(null,_0x2d1530);}})});router[_0x057f('0x21')](_0x057f('0x39'),offlineUploadMulter['any'](),controller[_0x057f('0x3a')]);router[_0x057f('0x21')](_0x057f('0x1a'),auth[_0x057f('0x9')](),controller['addInteraction']);router[_0x057f('0x21')](_0x057f('0x3b'),auth[_0x057f('0x9')](),controller[_0x057f('0x3c')]);router[_0x057f('0x21')](_0x057f('0x1d'),auth[_0x057f('0x9')](),controller[_0x057f('0x3d')]);router['post']('/:id/users',auth[_0x057f('0x9')](),controller['addAgents']);router[_0x057f('0x3e')](_0x057f('0xd'),auth[_0x057f('0x9')](),controller['update']);router[_0x057f('0x3f')](_0x057f('0xd'),auth[_0x057f('0x9')](),controller[_0x057f('0x40')]);router[_0x057f('0x3f')](_0x057f('0xf'),auth['isAuthenticated'](),controller['removeDispositions']);router[_0x057f('0x3f')]('/:id/canned_answers',auth[_0x057f('0x9')](),controller[_0x057f('0x41')]);router[_0x057f('0x3f')](_0x057f('0x42'),auth[_0x057f('0x9')](),controller[_0x057f('0x43')]);module[_0x057f('0x44')]=router;
\ No newline at end of file
diff --git a/server/api/cloudProvider/cloudProvider.attributes.js b/server/api/cloudProvider/cloudProvider.attributes.js
index 5a23174..75a0037 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 _0x5031=['exports','STRING','ENUM','AmazonAWS','sequelize'];(function(_0xf4933b,_0x57cd3b){var _0x2b69af=function(_0x531bd8){while(--_0x531bd8){_0xf4933b['push'](_0xf4933b['shift']());}};_0x2b69af(++_0x57cd3b);}(_0x5031,0x144));var _0x1503=function(_0x57532b,_0x4c9341){_0x57532b=_0x57532b-0x0;var _0xe5df67=_0x5031[_0x57532b];return _0xe5df67;};'use strict';var Sequelize=require(_0x1503('0x0'));module[_0x1503('0x1')]={'name':{'type':Sequelize[_0x1503('0x2')],'allowNull':![],'validate':{'notEmpty':!![]}},'service':{'type':Sequelize[_0x1503('0x3')](_0x1503('0x4'),'Google'),'allowNull':![],'validate':{'notEmpty':!![]}},'data1':{'type':Sequelize['STRING']},'data2':{'type':Sequelize[_0x1503('0x2')]}};
\ No newline at end of file
+var _0x2cd0=['Google','sequelize','exports','STRING','ENUM','AmazonAWS'];(function(_0xa464c9,_0x7c86d8){var _0x3d73c4=function(_0x5c2056){while(--_0x5c2056){_0xa464c9['push'](_0xa464c9['shift']());}};_0x3d73c4(++_0x7c86d8);}(_0x2cd0,0x10f));var _0x02cd=function(_0x5984cf,_0x58aaff){_0x5984cf=_0x5984cf-0x0;var _0x558fcf=_0x2cd0[_0x5984cf];return _0x558fcf;};'use strict';var Sequelize=require(_0x02cd('0x0'));module[_0x02cd('0x1')]={'name':{'type':Sequelize[_0x02cd('0x2')],'allowNull':![],'validate':{'notEmpty':!![]}},'service':{'type':Sequelize[_0x02cd('0x3')](_0x02cd('0x4'),_0x02cd('0x5')),'allowNull':![],'validate':{'notEmpty':!![]}},'data1':{'type':Sequelize[_0x02cd('0x2')]},'data2':{'type':Sequelize[_0x02cd('0x2')]}};
\ No newline at end of file
diff --git a/server/api/cloudProvider/cloudProvider.controller.js b/server/api/cloudProvider/cloudProvider.controller.js
index c9158bb..e0ccf27 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 _0x5f2f=['end','status','offset','undefined','limit','count','set','Content-Range','apply','reject','save','then','stack','name','send','index','CloudProvider','rawAttributes','fieldName','type','map','query','filters','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','sort','filter','merge','where','options','includeAll','include','findAll','rows','catch','keys','find','body','params','destroy','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus'];(function(_0xefd519,_0xc62635){var _0x4bb882=function(_0x37e0a1){while(--_0x37e0a1){_0xefd519['push'](_0xefd519['shift']());}};_0x4bb882(++_0xc62635);}(_0x5f2f,0x73));var _0xf5f2=function(_0x243358,_0x2aef4b){_0x243358=_0x243358-0x0;var _0x30bb7e=_0x5f2f[_0x243358];return _0x30bb7e;};'use strict';var emlformat=require(_0xf5f2('0x0'));var rimraf=require(_0xf5f2('0x1'));var zipdir=require(_0xf5f2('0x2'));var jsonpatch=require(_0xf5f2('0x3'));var rp=require(_0xf5f2('0x4'));var moment=require(_0xf5f2('0x5'));var BPromise=require(_0xf5f2('0x6'));var Mustache=require(_0xf5f2('0x7'));var util=require('util');var path=require('path');var sox=require(_0xf5f2('0x8'));var csv=require(_0xf5f2('0x9'));var ejs=require(_0xf5f2('0xa'));var fs=require('fs');var fs_extra=require(_0xf5f2('0xb'));var _=require(_0xf5f2('0xc'));var squel=require(_0xf5f2('0xd'));var crypto=require('crypto');var jsforce=require(_0xf5f2('0xe'));var deskjs=require(_0xf5f2('0xf'));var toCsv=require(_0xf5f2('0x9'));var querystring=require('querystring');var Papa=require(_0xf5f2('0x10'));var Redis=require(_0xf5f2('0x11'));var authService=require(_0xf5f2('0x12'));var qs=require('../../components/parsers/qs');var as=require(_0xf5f2('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0xf5f2('0x14'));var utils=require(_0xf5f2('0x15'));var config=require('../../config/environment');var licenseUtil=require(_0xf5f2('0x16'));var db=require(_0xf5f2('0x17'))['db'];function respondWithStatusCode(_0x331482,_0x3f2997){_0x3f2997=_0x3f2997||0xcc;return function(_0x59bb6c){if(_0x59bb6c){return _0x331482[_0xf5f2('0x18')](_0x3f2997);}return _0x331482['status'](_0x3f2997)[_0xf5f2('0x19')]();};}function respondWithResult(_0xea612c,_0x269909){_0x269909=_0x269909||0xc8;return function(_0x1c1a5c){if(_0x1c1a5c){return _0xea612c[_0xf5f2('0x1a')](_0x269909)['json'](_0x1c1a5c);}};}function respondWithFilteredResult(_0xafe430,_0x286197){return function(_0x17d656){if(_0x17d656){var _0x1b6dd2=typeof _0x286197[_0xf5f2('0x1b')]===_0xf5f2('0x1c')&&typeof _0x286197[_0xf5f2('0x1d')]===_0xf5f2('0x1c');var _0x11f702=_0x17d656[_0xf5f2('0x1e')];var _0x20fccd=_0x1b6dd2?0x0:_0x286197[_0xf5f2('0x1b')];var _0x4ff59b=_0x1b6dd2?_0x17d656[_0xf5f2('0x1e')]:_0x286197[_0xf5f2('0x1b')]+_0x286197[_0xf5f2('0x1d')];var _0x1bf655;if(_0x4ff59b>=_0x11f702){_0x4ff59b=_0x11f702;_0x1bf655=0xc8;}else{_0x1bf655=0xce;}_0xafe430['status'](_0x1bf655);return _0xafe430[_0xf5f2('0x1f')](_0xf5f2('0x20'),_0x20fccd+'-'+_0x4ff59b+'/'+_0x11f702)['json'](_0x17d656);}return null;};}function patchUpdates(_0x47acfc){return function(_0x2d2805){try{jsonpatch[_0xf5f2('0x21')](_0x2d2805,_0x47acfc,!![]);}catch(_0x4ae323){return BPromise[_0xf5f2('0x22')](_0x4ae323);}return _0x2d2805[_0xf5f2('0x23')]();};}function saveUpdates(_0x39e44a,_0x39c024){return function(_0x36f1cb){if(_0x36f1cb){return _0x36f1cb['update'](_0x39e44a)[_0xf5f2('0x24')](function(_0x4669a6){return _0x4669a6;});}return null;};}function removeEntity(_0x4e8bda,_0x2833fe){return function(_0x287ad5){if(_0x287ad5){return _0x287ad5['destroy']()['then'](function(){_0x4e8bda[_0xf5f2('0x1a')](0xcc)[_0xf5f2('0x19')]();});}};}function handleEntityNotFound(_0x13da6f,_0x1a5bb3){return function(_0xf6c58d){if(!_0xf6c58d){_0x13da6f[_0xf5f2('0x18')](0x194);}return _0xf6c58d;};}function handleError(_0x13a3be,_0x281ec8){_0x281ec8=_0x281ec8||0x1f4;return function(_0x294414){logger['error'](_0x294414[_0xf5f2('0x25')]);if(_0x294414[_0xf5f2('0x26')]){delete _0x294414[_0xf5f2('0x26')];}_0x13a3be[_0xf5f2('0x1a')](_0x281ec8)[_0xf5f2('0x27')](_0x294414);};}exports[_0xf5f2('0x28')]=function(_0x5b6672,_0x53cb96){var _0x22c826={},_0x14c829={},_0x11c771={'count':0x0,'rows':[]};var _0x5027ab=_['map'](db[_0xf5f2('0x29')][_0xf5f2('0x2a')],function(_0x17394a){return{'name':_0x17394a[_0xf5f2('0x2b')],'type':_0x17394a[_0xf5f2('0x2c')]['key']};});_0x14c829['model']=_[_0xf5f2('0x2d')](_0x5027ab,'name');_0x14c829[_0xf5f2('0x2e')]=_['keys'](_0x5b6672[_0xf5f2('0x2e')]);_0x14c829[_0xf5f2('0x2f')]=_[_0xf5f2('0x30')](_0x14c829[_0xf5f2('0x31')],_0x14c829[_0xf5f2('0x2e')]);_0x22c826[_0xf5f2('0x32')]=_[_0xf5f2('0x30')](_0x14c829[_0xf5f2('0x31')],qs['fields'](_0x5b6672[_0xf5f2('0x2e')][_0xf5f2('0x33')]));_0x22c826[_0xf5f2('0x32')]=_0x22c826[_0xf5f2('0x32')][_0xf5f2('0x34')]?_0x22c826[_0xf5f2('0x32')]:_0x14c829[_0xf5f2('0x31')];if(!_0x5b6672['query'][_0xf5f2('0x35')](_0xf5f2('0x36'))){_0x22c826['limit']=qs[_0xf5f2('0x1d')](_0x5b6672['query'][_0xf5f2('0x1d')]);_0x22c826[_0xf5f2('0x1b')]=qs[_0xf5f2('0x1b')](_0x5b6672[_0xf5f2('0x2e')]['offset']);}_0x22c826['order']=qs[_0xf5f2('0x37')](_0x5b6672[_0xf5f2('0x2e')][_0xf5f2('0x37')]);_0x22c826['where']=qs[_0xf5f2('0x2f')](_['pick'](_0x5b6672[_0xf5f2('0x2e')],_0x14c829['filters']),_0x5027ab);if(_0x5b6672[_0xf5f2('0x2e')][_0xf5f2('0x38')]){_0x22c826['where']=_[_0xf5f2('0x39')](_0x22c826[_0xf5f2('0x3a')],{'$or':_[_0xf5f2('0x2d')](_0x5027ab,function(_0x35f738){if(_0x35f738['type']!=='VIRTUAL'){var _0x3d328f={};_0x3d328f[_0x35f738[_0xf5f2('0x26')]]={'$like':'%'+_0x5b6672[_0xf5f2('0x2e')][_0xf5f2('0x38')]+'%'};return _0x3d328f;}})});}_0x22c826=_[_0xf5f2('0x39')]({},_0x22c826,_0x5b6672[_0xf5f2('0x3b')]);var _0x2bc20e={'where':_0x22c826['where']};return db[_0xf5f2('0x29')][_0xf5f2('0x1e')](_0x2bc20e)['then'](function(_0xc6a1ae){_0x11c771[_0xf5f2('0x1e')]=_0xc6a1ae;if(_0x5b6672[_0xf5f2('0x2e')][_0xf5f2('0x3c')]){_0x22c826[_0xf5f2('0x3d')]=[{'all':!![]}];}return db[_0xf5f2('0x29')][_0xf5f2('0x3e')](_0x22c826);})[_0xf5f2('0x24')](function(_0x574f24){_0x11c771[_0xf5f2('0x3f')]=_0x574f24;return _0x11c771;})[_0xf5f2('0x24')](respondWithFilteredResult(_0x53cb96,_0x22c826))[_0xf5f2('0x40')](handleError(_0x53cb96,null));};exports['show']=function(_0x509dbc,_0x59eb00){var _0x76d21b={'raw':!![],'where':{'id':_0x509dbc['params']['id']}},_0x2ad13c={};_0x2ad13c[_0xf5f2('0x31')]=_[_0xf5f2('0x41')](db[_0xf5f2('0x29')][_0xf5f2('0x2a')]);_0x2ad13c[_0xf5f2('0x2e')]=_[_0xf5f2('0x41')](_0x509dbc[_0xf5f2('0x2e')]);_0x2ad13c[_0xf5f2('0x2f')]=_[_0xf5f2('0x30')](_0x2ad13c[_0xf5f2('0x31')],_0x2ad13c[_0xf5f2('0x2e')]);_0x76d21b[_0xf5f2('0x32')]=_[_0xf5f2('0x30')](_0x2ad13c[_0xf5f2('0x31')],qs['fields'](_0x509dbc[_0xf5f2('0x2e')]['fields']));_0x76d21b[_0xf5f2('0x32')]=_0x76d21b[_0xf5f2('0x32')][_0xf5f2('0x34')]?_0x76d21b[_0xf5f2('0x32')]:_0x2ad13c[_0xf5f2('0x31')];if(_0x509dbc[_0xf5f2('0x2e')]['includeAll']){_0x76d21b[_0xf5f2('0x3d')]=[{'all':!![]}];}_0x76d21b=_[_0xf5f2('0x39')]({},_0x76d21b,_0x509dbc[_0xf5f2('0x3b')]);return db[_0xf5f2('0x29')][_0xf5f2('0x42')](_0x76d21b)[_0xf5f2('0x24')](handleEntityNotFound(_0x59eb00,null))[_0xf5f2('0x24')](respondWithResult(_0x59eb00,null))[_0xf5f2('0x40')](handleError(_0x59eb00,null));};exports['create']=function(_0x35dece,_0x33ec29){return db[_0xf5f2('0x29')]['create'](_0x35dece[_0xf5f2('0x43')],{})[_0xf5f2('0x24')](respondWithResult(_0x33ec29,0xc9))[_0xf5f2('0x40')](handleError(_0x33ec29,null));};exports['update']=function(_0x57a7cb,_0x7bb942){if(_0x57a7cb[_0xf5f2('0x43')]['id']){delete _0x57a7cb['body']['id'];}return db[_0xf5f2('0x29')]['find']({'where':{'id':_0x57a7cb[_0xf5f2('0x44')]['id']}})['then'](handleEntityNotFound(_0x7bb942,null))[_0xf5f2('0x24')](saveUpdates(_0x57a7cb['body'],null))[_0xf5f2('0x24')](respondWithResult(_0x7bb942,null))[_0xf5f2('0x40')](handleError(_0x7bb942,null));};exports[_0xf5f2('0x45')]=function(_0x11a083,_0x4fa738){return db[_0xf5f2('0x29')][_0xf5f2('0x42')]({'where':{'id':_0x11a083['params']['id']}})['then'](handleEntityNotFound(_0x4fa738,null))[_0xf5f2('0x24')](removeEntity(_0x4fa738,null))[_0xf5f2('0x40')](handleError(_0x4fa738,null));};
\ No newline at end of file
+var _0x5f66=['update','catch','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','path','to-csv','ejs','squel','crypto','jsforce','desk.js','querystring','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/license/util','sendStatus','status','end','json','undefined','limit','count','offset','Content-Range','apply','reject','save','destroy','then','error','name','send','index','map','CloudProvider','rawAttributes','fieldName','model','keys','query','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','filter','merge','type','VIRTUAL','includeAll','include','findAll','rows','show','params','find','create','body'];(function(_0x38c4a3,_0x5337eb){var _0x2e1a05=function(_0x5c5fa0){while(--_0x5c5fa0){_0x38c4a3['push'](_0x38c4a3['shift']());}};_0x2e1a05(++_0x5337eb);}(_0x5f66,0x1a0));var _0x65f6=function(_0x5d4607,_0x6b5e7b){_0x5d4607=_0x5d4607-0x0;var _0x5e4a86=_0x5f66[_0x5d4607];return _0x5e4a86;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x65f6('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0x65f6('0x1'));var rp=require(_0x65f6('0x2'));var moment=require(_0x65f6('0x3'));var BPromise=require(_0x65f6('0x4'));var Mustache=require(_0x65f6('0x5'));var util=require('util');var path=require(_0x65f6('0x6'));var sox=require('sox');var csv=require(_0x65f6('0x7'));var ejs=require(_0x65f6('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0x65f6('0x9'));var crypto=require(_0x65f6('0xa'));var jsforce=require(_0x65f6('0xb'));var deskjs=require(_0x65f6('0xc'));var toCsv=require(_0x65f6('0x7'));var querystring=require(_0x65f6('0xd'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x65f6('0xe'));var qs=require(_0x65f6('0xf'));var as=require(_0x65f6('0x10'));var hardwareService=require(_0x65f6('0x11'));var logger=require('../../config/logger')(_0x65f6('0x12'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0x65f6('0x13'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x419819,_0x4862a5){_0x4862a5=_0x4862a5||0xcc;return function(_0x2f964a){if(_0x2f964a){return _0x419819[_0x65f6('0x14')](_0x4862a5);}return _0x419819[_0x65f6('0x15')](_0x4862a5)[_0x65f6('0x16')]();};}function respondWithResult(_0x369f96,_0x1d29fd){_0x1d29fd=_0x1d29fd||0xc8;return function(_0x44144b){if(_0x44144b){return _0x369f96[_0x65f6('0x15')](_0x1d29fd)[_0x65f6('0x17')](_0x44144b);}};}function respondWithFilteredResult(_0x3440af,_0x59154e){return function(_0x19b9ff){if(_0x19b9ff){var _0x49a913=typeof _0x59154e['offset']===_0x65f6('0x18')&&typeof _0x59154e[_0x65f6('0x19')]===_0x65f6('0x18');var _0x1c955c=_0x19b9ff[_0x65f6('0x1a')];var _0x1f974c=_0x49a913?0x0:_0x59154e[_0x65f6('0x1b')];var _0x18380e=_0x49a913?_0x19b9ff['count']:_0x59154e['offset']+_0x59154e[_0x65f6('0x19')];var _0x5b4055;if(_0x18380e>=_0x1c955c){_0x18380e=_0x1c955c;_0x5b4055=0xc8;}else{_0x5b4055=0xce;}_0x3440af['status'](_0x5b4055);return _0x3440af['set'](_0x65f6('0x1c'),_0x1f974c+'-'+_0x18380e+'/'+_0x1c955c)[_0x65f6('0x17')](_0x19b9ff);}return null;};}function patchUpdates(_0x5114a4){return function(_0x39e19f){try{jsonpatch[_0x65f6('0x1d')](_0x39e19f,_0x5114a4,!![]);}catch(_0xbee6a4){return BPromise[_0x65f6('0x1e')](_0xbee6a4);}return _0x39e19f[_0x65f6('0x1f')]();};}function saveUpdates(_0xc139c2,_0x581374){return function(_0x197a49){if(_0x197a49){return _0x197a49['update'](_0xc139c2)['then'](function(_0x212247){return _0x212247;});}return null;};}function removeEntity(_0xd173f4,_0x524e42){return function(_0x1eeaaa){if(_0x1eeaaa){return _0x1eeaaa[_0x65f6('0x20')]()[_0x65f6('0x21')](function(){_0xd173f4[_0x65f6('0x15')](0xcc)['end']();});}};}function handleEntityNotFound(_0x9d7bb0,_0x59ea32){return function(_0x20a161){if(!_0x20a161){_0x9d7bb0['sendStatus'](0x194);}return _0x20a161;};}function handleError(_0x5cb131,_0x4fde2f){_0x4fde2f=_0x4fde2f||0x1f4;return function(_0x29abdb){logger[_0x65f6('0x22')](_0x29abdb['stack']);if(_0x29abdb[_0x65f6('0x23')]){delete _0x29abdb[_0x65f6('0x23')];}_0x5cb131['status'](_0x4fde2f)[_0x65f6('0x24')](_0x29abdb);};}exports[_0x65f6('0x25')]=function(_0x28d0df,_0x559330){var _0x4ac04b={},_0x488d36={},_0x266cfe={'count':0x0,'rows':[]};var _0x3c032f=_[_0x65f6('0x26')](db[_0x65f6('0x27')][_0x65f6('0x28')],function(_0x14a387){return{'name':_0x14a387[_0x65f6('0x29')],'type':_0x14a387['type']['key']};});_0x488d36[_0x65f6('0x2a')]=_[_0x65f6('0x26')](_0x3c032f,'name');_0x488d36['query']=_[_0x65f6('0x2b')](_0x28d0df[_0x65f6('0x2c')]);_0x488d36[_0x65f6('0x2d')]=_[_0x65f6('0x2e')](_0x488d36[_0x65f6('0x2a')],_0x488d36[_0x65f6('0x2c')]);_0x4ac04b['attributes']=_[_0x65f6('0x2e')](_0x488d36[_0x65f6('0x2a')],qs[_0x65f6('0x2f')](_0x28d0df['query'][_0x65f6('0x2f')]));_0x4ac04b[_0x65f6('0x30')]=_0x4ac04b[_0x65f6('0x30')][_0x65f6('0x31')]?_0x4ac04b[_0x65f6('0x30')]:_0x488d36[_0x65f6('0x2a')];if(!_0x28d0df['query'][_0x65f6('0x32')](_0x65f6('0x33'))){_0x4ac04b['limit']=qs[_0x65f6('0x19')](_0x28d0df['query'][_0x65f6('0x19')]);_0x4ac04b['offset']=qs[_0x65f6('0x1b')](_0x28d0df[_0x65f6('0x2c')]['offset']);}_0x4ac04b[_0x65f6('0x34')]=qs[_0x65f6('0x35')](_0x28d0df[_0x65f6('0x2c')]['sort']);_0x4ac04b['where']=qs[_0x65f6('0x2d')](_['pick'](_0x28d0df[_0x65f6('0x2c')],_0x488d36['filters']),_0x3c032f);if(_0x28d0df[_0x65f6('0x2c')][_0x65f6('0x36')]){_0x4ac04b['where']=_[_0x65f6('0x37')](_0x4ac04b['where'],{'$or':_['map'](_0x3c032f,function(_0x71b16b){if(_0x71b16b[_0x65f6('0x38')]!==_0x65f6('0x39')){var _0x313be5={};_0x313be5[_0x71b16b[_0x65f6('0x23')]]={'$like':'%'+_0x28d0df[_0x65f6('0x2c')][_0x65f6('0x36')]+'%'};return _0x313be5;}})});}_0x4ac04b=_[_0x65f6('0x37')]({},_0x4ac04b,_0x28d0df['options']);var _0x3aa254={'where':_0x4ac04b['where']};return db[_0x65f6('0x27')][_0x65f6('0x1a')](_0x3aa254)[_0x65f6('0x21')](function(_0x2ea7f7){_0x266cfe['count']=_0x2ea7f7;if(_0x28d0df[_0x65f6('0x2c')][_0x65f6('0x3a')]){_0x4ac04b[_0x65f6('0x3b')]=[{'all':!![]}];}return db[_0x65f6('0x27')][_0x65f6('0x3c')](_0x4ac04b);})[_0x65f6('0x21')](function(_0xed4c96){_0x266cfe[_0x65f6('0x3d')]=_0xed4c96;return _0x266cfe;})[_0x65f6('0x21')](respondWithFilteredResult(_0x559330,_0x4ac04b))['catch'](handleError(_0x559330,null));};exports[_0x65f6('0x3e')]=function(_0x400ed2,_0x377ae5){var _0x181798={'raw':!![],'where':{'id':_0x400ed2[_0x65f6('0x3f')]['id']}},_0x83e2d9={};_0x83e2d9[_0x65f6('0x2a')]=_[_0x65f6('0x2b')](db[_0x65f6('0x27')][_0x65f6('0x28')]);_0x83e2d9[_0x65f6('0x2c')]=_[_0x65f6('0x2b')](_0x400ed2[_0x65f6('0x2c')]);_0x83e2d9[_0x65f6('0x2d')]=_[_0x65f6('0x2e')](_0x83e2d9[_0x65f6('0x2a')],_0x83e2d9['query']);_0x181798[_0x65f6('0x30')]=_[_0x65f6('0x2e')](_0x83e2d9[_0x65f6('0x2a')],qs[_0x65f6('0x2f')](_0x400ed2['query'][_0x65f6('0x2f')]));_0x181798[_0x65f6('0x30')]=_0x181798[_0x65f6('0x30')]['length']?_0x181798[_0x65f6('0x30')]:_0x83e2d9[_0x65f6('0x2a')];if(_0x400ed2[_0x65f6('0x2c')][_0x65f6('0x3a')]){_0x181798['include']=[{'all':!![]}];}_0x181798=_[_0x65f6('0x37')]({},_0x181798,_0x400ed2['options']);return db[_0x65f6('0x27')][_0x65f6('0x40')](_0x181798)['then'](handleEntityNotFound(_0x377ae5,null))[_0x65f6('0x21')](respondWithResult(_0x377ae5,null))['catch'](handleError(_0x377ae5,null));};exports[_0x65f6('0x41')]=function(_0x4d9b76,_0x2d1706){return db[_0x65f6('0x27')][_0x65f6('0x41')](_0x4d9b76[_0x65f6('0x42')],{})['then'](respondWithResult(_0x2d1706,0xc9))['catch'](handleError(_0x2d1706,null));};exports[_0x65f6('0x43')]=function(_0x15d3ba,_0x3b647a){if(_0x15d3ba[_0x65f6('0x42')]['id']){delete _0x15d3ba[_0x65f6('0x42')]['id'];}return db[_0x65f6('0x27')][_0x65f6('0x40')]({'where':{'id':_0x15d3ba[_0x65f6('0x3f')]['id']}})[_0x65f6('0x21')](handleEntityNotFound(_0x3b647a,null))['then'](saveUpdates(_0x15d3ba[_0x65f6('0x42')],null))[_0x65f6('0x21')](respondWithResult(_0x3b647a,null))[_0x65f6('0x44')](handleError(_0x3b647a,null));};exports['destroy']=function(_0x47e749,_0x42d453){return db['CloudProvider'][_0x65f6('0x40')]({'where':{'id':_0x47e749[_0x65f6('0x3f')]['id']}})['then'](handleEntityNotFound(_0x42d453,null))[_0x65f6('0x21')](removeEntity(_0x42d453,null))['catch'](handleError(_0x42d453,null));};
\ No newline at end of file
diff --git a/server/api/cloudProvider/cloudProvider.model.js b/server/api/cloudProvider/cloudProvider.model.js
index 0a358fa..af74e4d 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 _0x8d60=['api','moment','bluebird','path','rimraf','../../config/environment','define','CloudProvider','lodash','../../config/logger'];(function(_0x4ad223,_0x3a7789){var _0x19daea=function(_0xc447ad){while(--_0xc447ad){_0x4ad223['push'](_0x4ad223['shift']());}};_0x19daea(++_0x3a7789);}(_0x8d60,0x120));var _0x08d6=function(_0x45e586,_0x16c8d2){_0x45e586=_0x45e586-0x0;var _0x569b74=_0x8d60[_0x45e586];return _0x569b74;};'use strict';var _=require(_0x08d6('0x0'));var util=require('util');var logger=require(_0x08d6('0x1'))(_0x08d6('0x2'));var moment=require(_0x08d6('0x3'));var BPromise=require(_0x08d6('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x08d6('0x5'));var rimraf=require(_0x08d6('0x6'));var config=require(_0x08d6('0x7'));var attributes=require('./cloudProvider.attributes');module['exports']=function(_0x113f4e,_0x54cf23){return _0x113f4e[_0x08d6('0x8')](_0x08d6('0x9'),attributes,{'tableName':'cloud_providers','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x9355=['moment','bluebird','request-promise','path','rimraf','../../config/environment','./cloudProvider.attributes','exports','define','CloudProvider','cloud_providers','lodash','util','../../config/logger','api'];(function(_0x5730df,_0x218269){var _0x3b9e22=function(_0x30dfa3){while(--_0x30dfa3){_0x5730df['push'](_0x5730df['shift']());}};_0x3b9e22(++_0x218269);}(_0x9355,0xdd));var _0x5935=function(_0x14d30a,_0x3c3188){_0x14d30a=_0x14d30a-0x0;var _0x5577ad=_0x9355[_0x14d30a];return _0x5577ad;};'use strict';var _=require(_0x5935('0x0'));var util=require(_0x5935('0x1'));var logger=require(_0x5935('0x2'))(_0x5935('0x3'));var moment=require(_0x5935('0x4'));var BPromise=require(_0x5935('0x5'));var rp=require(_0x5935('0x6'));var fs=require('fs');var path=require(_0x5935('0x7'));var rimraf=require(_0x5935('0x8'));var config=require(_0x5935('0x9'));var attributes=require(_0x5935('0xa'));module[_0x5935('0xb')]=function(_0x512f92,_0x52c564){return _0x512f92[_0x5935('0xc')](_0x5935('0xd'),attributes,{'tableName':_0x5935('0xe'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
diff --git a/server/api/cloudProvider/cloudProvider.rpc.js b/server/api/cloudProvider/cloudProvider.rpc.js
index 8280fcc..682a833 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 _0xbc36=['info','request\x20sent','debug','CloudProvider,\x20%s,\x20%s,\x20%s','stringify','error','code','CloudProvider,\x20%s,\x20%s','message','result','catch','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','request','then'];(function(_0x2fdbfd,_0xe80e03){var _0x308446=function(_0x4d0fcd){while(--_0x4d0fcd){_0x2fdbfd['push'](_0x2fdbfd['shift']());}};_0x308446(++_0xe80e03);}(_0xbc36,0x169));var _0x6bc3=function(_0x3675ea,_0x4b4497){_0x3675ea=_0x3675ea-0x0;var _0x3f6447=_0xbc36[_0x3675ea];return _0x3f6447;};'use strict';var _=require(_0x6bc3('0x0'));var util=require('util');var moment=require(_0x6bc3('0x1'));var BPromise=require(_0x6bc3('0x2'));var rs=require(_0x6bc3('0x3'));var fs=require('fs');var Redis=require(_0x6bc3('0x4'));var db=require(_0x6bc3('0x5'))['db'];var utils=require(_0x6bc3('0x6'));var logger=require(_0x6bc3('0x7'))(_0x6bc3('0x8'));var config=require(_0x6bc3('0x9'));var jayson=require('jayson/promise');var client=jayson[_0x6bc3('0xa')][_0x6bc3('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x5584a5,_0x33e11c,_0x1f894a){return new BPromise(function(_0xf07594,_0x4de32d){return client[_0x6bc3('0xc')](_0x5584a5,_0x1f894a)[_0x6bc3('0xd')](function(_0x33e8e0){logger[_0x6bc3('0xe')]('CloudProvider,\x20%s,\x20%s',_0x33e11c,_0x6bc3('0xf'));logger[_0x6bc3('0x10')](_0x6bc3('0x11'),_0x33e11c,_0x6bc3('0xf'),JSON[_0x6bc3('0x12')](_0x33e8e0));if(_0x33e8e0[_0x6bc3('0x13')]){if(_0x33e8e0[_0x6bc3('0x13')][_0x6bc3('0x14')]===0x1f4){logger[_0x6bc3('0x13')]('CloudProvider,\x20%s,\x20%s',_0x33e11c,_0x33e8e0[_0x6bc3('0x13')]['message']);return _0x4de32d(_0x33e8e0[_0x6bc3('0x13')]['message']);}logger[_0x6bc3('0x13')](_0x6bc3('0x15'),_0x33e11c,_0x33e8e0['error'][_0x6bc3('0x16')]);return _0xf07594(_0x33e8e0['error']['message']);}else{logger[_0x6bc3('0xe')](_0x6bc3('0x15'),_0x33e11c,_0x6bc3('0xf'));_0xf07594(_0x33e8e0[_0x6bc3('0x17')][_0x6bc3('0x16')]);}})[_0x6bc3('0x18')](function(_0xa1782){logger['error'](_0x6bc3('0x15'),_0x33e11c,_0xa1782);_0x4de32d(_0xa1782);});});}
\ No newline at end of file
+var _0x753c=['util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','CloudProvider,\x20%s,\x20%s','request\x20sent','debug','CloudProvider,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch'];(function(_0xddb860,_0x344918){var _0x255df9=function(_0x102c1c){while(--_0x102c1c){_0xddb860['push'](_0xddb860['shift']());}};_0x255df9(++_0x344918);}(_0x753c,0x96));var _0xc753=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x753c[_0x14add3];return _0x4a174f;};'use strict';var _=require('lodash');var util=require(_0xc753('0x0'));var moment=require('moment');var BPromise=require(_0xc753('0x1'));var rs=require(_0xc753('0x2'));var fs=require('fs');var Redis=require(_0xc753('0x3'));var db=require(_0xc753('0x4'))['db'];var utils=require(_0xc753('0x5'));var logger=require(_0xc753('0x6'))(_0xc753('0x7'));var config=require(_0xc753('0x8'));var jayson=require(_0xc753('0x9'));var client=jayson[_0xc753('0xa')][_0xc753('0xb')]({'port':0x232a});function respondWithRpcPromise(_0xf96e73,_0xd7ee43,_0x44e544){return new BPromise(function(_0xb80bea,_0x3866e8){return client[_0xc753('0xc')](_0xf96e73,_0x44e544)[_0xc753('0xd')](function(_0x128610){logger[_0xc753('0xe')](_0xc753('0xf'),_0xd7ee43,_0xc753('0x10'));logger[_0xc753('0x11')](_0xc753('0x12'),_0xd7ee43,'request\x20sent',JSON[_0xc753('0x13')](_0x128610));if(_0x128610[_0xc753('0x14')]){if(_0x128610['error'][_0xc753('0x15')]===0x1f4){logger['error'](_0xc753('0xf'),_0xd7ee43,_0x128610[_0xc753('0x14')][_0xc753('0x16')]);return _0x3866e8(_0x128610['error'][_0xc753('0x16')]);}logger['error'](_0xc753('0xf'),_0xd7ee43,_0x128610['error'][_0xc753('0x16')]);return _0xb80bea(_0x128610[_0xc753('0x14')][_0xc753('0x16')]);}else{logger[_0xc753('0xe')](_0xc753('0xf'),_0xd7ee43,'request\x20sent');_0xb80bea(_0x128610[_0xc753('0x17')][_0xc753('0x16')]);}})[_0xc753('0x18')](function(_0x2e056c){logger[_0xc753('0x14')](_0xc753('0xf'),_0xd7ee43,_0x2e056c);_0x3866e8(_0x2e056c);});});}
\ No newline at end of file
diff --git a/server/api/cloudProvider/index.js b/server/api/cloudProvider/index.js
index 5a02aa8..ecc45ab 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 _0xaebd=['Router','fs-extra','../../components/interaction/service','../../config/environment','./cloudProvider.controller','get','isAuthenticated','/:id','post','create','update','destroy','exports','multer','path','connect-timeout','express'];(function(_0x327904,_0x5649e4){var _0x333837=function(_0x14b825){while(--_0x14b825){_0x327904['push'](_0x327904['shift']());}};_0x333837(++_0x5649e4);}(_0xaebd,0x1e9));var _0xdaeb=function(_0x17cdae,_0xf2cea7){_0x17cdae=_0x17cdae-0x0;var _0x309af0=_0xaebd[_0x17cdae];return _0x309af0;};'use strict';var multer=require(_0xdaeb('0x0'));var util=require('util');var path=require(_0xdaeb('0x1'));var timeout=require(_0xdaeb('0x2'));var express=require(_0xdaeb('0x3'));var router=express[_0xdaeb('0x4')]();var fs_extra=require(_0xdaeb('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0xdaeb('0x6'));var config=require(_0xdaeb('0x7'));var controller=require(_0xdaeb('0x8'));router[_0xdaeb('0x9')]('/',auth[_0xdaeb('0xa')](),controller['index']);router[_0xdaeb('0x9')](_0xdaeb('0xb'),auth['isAuthenticated'](),controller['show']);router[_0xdaeb('0xc')]('/',auth[_0xdaeb('0xa')](),controller[_0xdaeb('0xd')]);router['put'](_0xdaeb('0xb'),auth['isAuthenticated'](),controller[_0xdaeb('0xe')]);router['delete'](_0xdaeb('0xb'),auth['isAuthenticated'](),controller[_0xdaeb('0xf')]);module[_0xdaeb('0x10')]=router;
\ No newline at end of file
+var _0x2ca2=['../../components/auth/service','../../config/environment','./cloudProvider.controller','get','isAuthenticated','post','create','put','update','delete','/:id','destroy','multer','util','path','connect-timeout','express'];(function(_0x20c7ef,_0x5dcef5){var _0x3bb19e=function(_0x630d6d){while(--_0x630d6d){_0x20c7ef['push'](_0x20c7ef['shift']());}};_0x3bb19e(++_0x5dcef5);}(_0x2ca2,0x11c));var _0x22ca=function(_0x27af93,_0x14b723){_0x27af93=_0x27af93-0x0;var _0x1a0e96=_0x2ca2[_0x27af93];return _0x1a0e96;};'use strict';var multer=require(_0x22ca('0x0'));var util=require(_0x22ca('0x1'));var path=require(_0x22ca('0x2'));var timeout=require(_0x22ca('0x3'));var express=require(_0x22ca('0x4'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0x22ca('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x22ca('0x6'));var controller=require(_0x22ca('0x7'));router[_0x22ca('0x8')]('/',auth[_0x22ca('0x9')](),controller['index']);router[_0x22ca('0x8')]('/:id',auth[_0x22ca('0x9')](),controller['show']);router[_0x22ca('0xa')]('/',auth[_0x22ca('0x9')](),controller[_0x22ca('0xb')]);router[_0x22ca('0xc')]('/:id',auth[_0x22ca('0x9')](),controller[_0x22ca('0xd')]);router[_0x22ca('0xe')](_0x22ca('0xf'),auth[_0x22ca('0x9')](),controller[_0x22ca('0x10')]);module['exports']=router;
\ No newline at end of file
diff --git a/server/api/cmCompany/cmCompany.attributes.js b/server/api/cmCompany/cmCompany.attributes.js
index 63d5b88..46eeb84 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 _0xb99b=['name','STRING','sequelize','exports'];(function(_0xa05ab1,_0x395497){var _0xdd2b80=function(_0x1a61a1){while(--_0x1a61a1){_0xa05ab1['push'](_0xa05ab1['shift']());}};_0xdd2b80(++_0x395497);}(_0xb99b,0x13a));var _0xbb99=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xb99b[_0x20a584];return _0x4b41a8;};'use strict';var Sequelize=require(_0xbb99('0x0'));module[_0xbb99('0x1')]={'name':{'type':Sequelize['STRING'],'unique':_0xbb99('0x2'),'allowNull':![],'validate':{'notEmpty':!![]}},'vat':{'type':Sequelize['STRING']},'companyId':{'type':Sequelize[_0xbb99('0x3')]},'website':{'type':Sequelize['STRING']},'phone':{'type':Sequelize[_0xbb99('0x3')]},'fax':{'type':Sequelize['STRING']},'type':{'type':Sequelize[_0xbb99('0x3')]},'street':{'type':Sequelize[_0xbb99('0x3')]},'postalCode':{'type':Sequelize[_0xbb99('0x3')]},'city':{'type':Sequelize['STRING']},'country':{'type':Sequelize[_0xbb99('0x3')]},'email':{'type':Sequelize[_0xbb99('0x3')],'validate':{'isEmail':!![]}},'emailDomain':{'type':Sequelize[_0xbb99('0x3')]},'sStreet':{'type':Sequelize[_0xbb99('0x3')]},'sPostalCode':{'type':Sequelize['STRING']},'sCity':{'type':Sequelize[_0xbb99('0x3')]},'sCountry':{'type':Sequelize[_0xbb99('0x3')]},'description':{'type':Sequelize[_0xbb99('0x3')]}};
\ No newline at end of file
+var _0x84fd=['exports','name','STRING','sequelize'];(function(_0x4cad3b,_0x4053af){var _0x1ebcd8=function(_0x722257){while(--_0x722257){_0x4cad3b['push'](_0x4cad3b['shift']());}};_0x1ebcd8(++_0x4053af);}(_0x84fd,0xeb));var _0xd84f=function(_0x3b279c,_0x25b2ef){_0x3b279c=_0x3b279c-0x0;var _0x56291b=_0x84fd[_0x3b279c];return _0x56291b;};'use strict';var Sequelize=require(_0xd84f('0x0'));module[_0xd84f('0x1')]={'name':{'type':Sequelize['STRING'],'unique':_0xd84f('0x2'),'allowNull':![],'validate':{'notEmpty':!![]}},'vat':{'type':Sequelize['STRING']},'companyId':{'type':Sequelize[_0xd84f('0x3')]},'website':{'type':Sequelize[_0xd84f('0x3')]},'phone':{'type':Sequelize[_0xd84f('0x3')]},'fax':{'type':Sequelize['STRING']},'type':{'type':Sequelize[_0xd84f('0x3')]},'street':{'type':Sequelize[_0xd84f('0x3')]},'postalCode':{'type':Sequelize[_0xd84f('0x3')]},'city':{'type':Sequelize[_0xd84f('0x3')]},'country':{'type':Sequelize[_0xd84f('0x3')]},'email':{'type':Sequelize[_0xd84f('0x3')],'validate':{'isEmail':!![]}},'emailDomain':{'type':Sequelize['STRING']},'sStreet':{'type':Sequelize[_0xd84f('0x3')]},'sPostalCode':{'type':Sequelize[_0xd84f('0x3')]},'sCity':{'type':Sequelize[_0xd84f('0x3')]},'sCountry':{'type':Sequelize[_0xd84f('0x3')]},'description':{'type':Sequelize['STRING']}};
\ No newline at end of file
diff --git a/server/api/cmCompany/cmCompany.controller.js b/server/api/cmCompany/cmCompany.controller.js
index de02611..6b2b941 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 _0x489f=['to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','../../config/license/hardware','../../config/logger','sendStatus','status','end','json','undefined','limit','count','offset','set','Content-Range','apply','reject','save','update','then','destroy','get','Companies','error','stack','name','send','CmCompany','describe','model','keys','query','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','filters','filter','merge','map','options','includeAll','findAll','catch','show','params','include','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','CmContact','omit','ids','getContacts','findOne','rawAttributes','pick','eml-format','rimraf','request-promise','moment','bluebird','mustache','util','path','sox'];(function(_0x346645,_0x3e9d9c){var _0x32f590=function(_0x5b1bb5){while(--_0x5b1bb5){_0x346645['push'](_0x346645['shift']());}};_0x32f590(++_0x3e9d9c);}(_0x489f,0x147));var _0xf489=function(_0x1bcb50,_0x361843){_0x1bcb50=_0x1bcb50-0x0;var _0x352102=_0x489f[_0x1bcb50];return _0x352102;};'use strict';var emlformat=require(_0xf489('0x0'));var rimraf=require(_0xf489('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0xf489('0x2'));var moment=require(_0xf489('0x3'));var BPromise=require(_0xf489('0x4'));var Mustache=require(_0xf489('0x5'));var util=require(_0xf489('0x6'));var path=require(_0xf489('0x7'));var sox=require(_0xf489('0x8'));var csv=require(_0xf489('0x9'));var ejs=require(_0xf489('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xf489('0xb'));var squel=require(_0xf489('0xc'));var crypto=require(_0xf489('0xd'));var jsforce=require(_0xf489('0xe'));var deskjs=require(_0xf489('0xf'));var toCsv=require('to-csv');var querystring=require(_0xf489('0x10'));var Papa=require(_0xf489('0x11'));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(_0xf489('0x12'));var logger=require(_0xf489('0x13'))('api');var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x47e6f4,_0x2455c8){_0x2455c8=_0x2455c8||0xcc;return function(_0x13ea7e){if(_0x13ea7e){return _0x47e6f4[_0xf489('0x14')](_0x2455c8);}return _0x47e6f4[_0xf489('0x15')](_0x2455c8)[_0xf489('0x16')]();};}function respondWithResult(_0x30057b,_0x2bedaf){_0x2bedaf=_0x2bedaf||0xc8;return function(_0x24d141){if(_0x24d141){return _0x30057b[_0xf489('0x15')](_0x2bedaf)[_0xf489('0x17')](_0x24d141);}};}function respondWithFilteredResult(_0x3518ab,_0x2a3087){return function(_0x59eb26){if(_0x59eb26){var _0x2f1664=typeof _0x2a3087['offset']===_0xf489('0x18')&&typeof _0x2a3087[_0xf489('0x19')]==='undefined';var _0x5259be=_0x59eb26[_0xf489('0x1a')];var _0x563db3=_0x2f1664?0x0:_0x2a3087[_0xf489('0x1b')];var _0x3b769c=_0x2f1664?_0x59eb26[_0xf489('0x1a')]:_0x2a3087['offset']+_0x2a3087[_0xf489('0x19')];var _0x3cc553;if(_0x3b769c>=_0x5259be){_0x3b769c=_0x5259be;_0x3cc553=0xc8;}else{_0x3cc553=0xce;}_0x3518ab['status'](_0x3cc553);return _0x3518ab[_0xf489('0x1c')](_0xf489('0x1d'),_0x563db3+'-'+_0x3b769c+'/'+_0x5259be)[_0xf489('0x17')](_0x59eb26);}return null;};}function patchUpdates(_0x199527){return function(_0x53a69c){try{jsonpatch[_0xf489('0x1e')](_0x53a69c,_0x199527,!![]);}catch(_0x10cdfc){return BPromise[_0xf489('0x1f')](_0x10cdfc);}return _0x53a69c[_0xf489('0x20')]();};}function saveUpdates(_0x50bc2a,_0x50f009){return function(_0x3da750){if(_0x3da750){return _0x3da750[_0xf489('0x21')](_0x50bc2a)[_0xf489('0x22')](function(_0x4e52a3){return _0x4e52a3;});}return null;};}function removeEntity(_0x5080f5,_0x35f0d3){return function(_0x7cbf0f){if(_0x7cbf0f){return _0x7cbf0f[_0xf489('0x23')]()[_0xf489('0x22')](function(){var _0x51cff9=_0x7cbf0f[_0xf489('0x24')]({'plain':!![]});var _0x1eb6b0=_0xf489('0x25');return db['UserProfileResource'][_0xf489('0x23')]({'where':{'type':_0x1eb6b0,'resourceId':_0x51cff9['id']}})[_0xf489('0x22')](function(){return _0x7cbf0f;});})[_0xf489('0x22')](function(){_0x5080f5[_0xf489('0x15')](0xcc)[_0xf489('0x16')]();});}};}function handleEntityNotFound(_0x4525a3,_0x52e09d){return function(_0x56ad91){if(!_0x56ad91){_0x4525a3['sendStatus'](0x194);}return _0x56ad91;};}function handleError(_0x3034ac,_0x1d7a93){_0x1d7a93=_0x1d7a93||0x1f4;return function(_0x5c11ca){logger[_0xf489('0x26')](_0x5c11ca[_0xf489('0x27')]);if(_0x5c11ca[_0xf489('0x28')]){delete _0x5c11ca[_0xf489('0x28')];}_0x3034ac['status'](_0x1d7a93)[_0xf489('0x29')](_0x5c11ca);};}exports['index']=function(_0x3c0904,_0x153236){var _0x255100={},_0xe27c09={},_0x342a96={'count':0x0,'rows':[]};return db[_0xf489('0x2a')][_0xf489('0x2b')]()[_0xf489('0x22')](function(_0x267c0f){_0xe27c09[_0xf489('0x2c')]=_[_0xf489('0x2d')](_0x267c0f);_0xe27c09[_0xf489('0x2e')]=_['keys'](_0x3c0904[_0xf489('0x2e')]);_0xe27c09['filters']=_[_0xf489('0x2f')](_0xe27c09[_0xf489('0x2c')],_0xe27c09[_0xf489('0x2e')]);_0x255100['attributes']=_[_0xf489('0x2f')](_0xe27c09['model'],qs[_0xf489('0x30')](_0x3c0904[_0xf489('0x2e')][_0xf489('0x30')]));_0x255100[_0xf489('0x31')]=_0x255100[_0xf489('0x31')][_0xf489('0x32')]?_0x255100[_0xf489('0x31')]:_0xe27c09[_0xf489('0x2c')];if(!_0x3c0904[_0xf489('0x2e')][_0xf489('0x33')](_0xf489('0x34'))){_0x255100[_0xf489('0x19')]=qs[_0xf489('0x19')](_0x3c0904['query'][_0xf489('0x19')]);_0x255100[_0xf489('0x1b')]=qs[_0xf489('0x1b')](_0x3c0904[_0xf489('0x2e')][_0xf489('0x1b')]);}_0x255100[_0xf489('0x35')]=qs['sort'](_0x3c0904[_0xf489('0x2e')][_0xf489('0x36')]);_0x255100[_0xf489('0x37')]=qs[_0xf489('0x38')](_['pick'](_0x3c0904[_0xf489('0x2e')],_0xe27c09['filters']),_0x267c0f);if(_0x3c0904[_0xf489('0x2e')][_0xf489('0x39')]){_0x255100['where']=_[_0xf489('0x3a')](_0x255100[_0xf489('0x37')],{'$or':_[_0xf489('0x3b')](_0x255100['attributes'],function(_0x1934ba){var _0x4b22ad={};_0x4b22ad[_0x1934ba]={'$like':'%'+_0x3c0904[_0xf489('0x2e')][_0xf489('0x39')]+'%'};return _0x4b22ad;})});}_0x255100=_['merge']({},_0x255100,_0x3c0904[_0xf489('0x3c')]);var _0x1a8c85={'where':_0x255100[_0xf489('0x37')]};return db['CmCompany'][_0xf489('0x1a')](_0x1a8c85)[_0xf489('0x22')](function(_0x733a1){_0x342a96[_0xf489('0x1a')]=_0x733a1;if(_0x3c0904['query'][_0xf489('0x3d')]){_0x255100['include']=[{'all':!![]}];}return db[_0xf489('0x2a')][_0xf489('0x3e')](_0x255100);})['then'](function(_0x28611b){_0x342a96['rows']=_0x28611b;return _0x342a96;})[_0xf489('0x22')](respondWithFilteredResult(_0x153236,_0x255100))['catch'](handleError(_0x153236,null));})[_0xf489('0x3f')](handleError(_0x153236,null));};exports[_0xf489('0x40')]=function(_0x2e5f7c,_0x30c7d8){var _0x5d48b3={'raw':![],'where':{'id':_0x2e5f7c[_0xf489('0x41')]['id']}},_0x3c8436={};_0x3c8436['model']=_[_0xf489('0x2d')](db[_0xf489('0x2a')]['rawAttributes']);_0x3c8436[_0xf489('0x2e')]=_[_0xf489('0x2d')](_0x2e5f7c[_0xf489('0x2e')]);_0x3c8436['filters']=_[_0xf489('0x2f')](_0x3c8436[_0xf489('0x2c')],_0x3c8436[_0xf489('0x2e')]);_0x5d48b3[_0xf489('0x31')]=_['intersection'](_0x3c8436[_0xf489('0x2c')],qs[_0xf489('0x30')](_0x2e5f7c[_0xf489('0x2e')][_0xf489('0x30')]));_0x5d48b3[_0xf489('0x31')]=_0x5d48b3[_0xf489('0x31')]['length']?_0x5d48b3[_0xf489('0x31')]:_0x3c8436[_0xf489('0x2c')];if(_0x2e5f7c[_0xf489('0x2e')][_0xf489('0x3d')]){_0x5d48b3[_0xf489('0x42')]=[{'all':!![]}];}_0x5d48b3=_[_0xf489('0x3a')]({},_0x5d48b3,_0x2e5f7c[_0xf489('0x3c')]);return db[_0xf489('0x2a')][_0xf489('0x43')](_0x5d48b3)['then'](handleEntityNotFound(_0x30c7d8,null))[_0xf489('0x22')](respondWithResult(_0x30c7d8,null))[_0xf489('0x3f')](handleError(_0x30c7d8,null));};exports[_0xf489('0x44')]=function(_0x123672,_0x346d16){return db[_0xf489('0x2a')][_0xf489('0x44')](_0x123672[_0xf489('0x45')],{})['then'](function(_0x29e47e){var _0x119b4d=_0x123672[_0xf489('0x46')]['get']({'plain':!![]});if(!_0x119b4d)throw new Error(_0xf489('0x47'));if(_0x119b4d[_0xf489('0x48')]===_0xf489('0x46')){var _0x10ccd8=_0x29e47e[_0xf489('0x24')]({'plain':!![]});var _0xa3cb9a=_0xf489('0x25');return db[_0xf489('0x49')]['find']({'where':{'name':_0xa3cb9a,'userProfileId':_0x119b4d['userProfileId']},'raw':!![]})[_0xf489('0x22')](function(_0x5b23b6){if(_0x5b23b6&&_0x5b23b6[_0xf489('0x4a')]===0x0){return db[_0xf489('0x4b')][_0xf489('0x44')]({'name':_0x10ccd8[_0xf489('0x28')],'resourceId':_0x10ccd8['id'],'type':_0x5b23b6[_0xf489('0x28')],'sectionId':_0x5b23b6['id']},{})[_0xf489('0x22')](function(){return _0x29e47e;});}else{return _0x29e47e;}})['catch'](function(_0x35808f){logger[_0xf489('0x26')](_0xf489('0x4c'),_0x35808f);throw _0x35808f;});}return _0x29e47e;})[_0xf489('0x22')](respondWithResult(_0x346d16,0xc9))[_0xf489('0x3f')](handleError(_0x346d16,null));};exports[_0xf489('0x21')]=function(_0x413dff,_0x248299){if(_0x413dff[_0xf489('0x45')]['id']){delete _0x413dff['body']['id'];}return db[_0xf489('0x2a')]['find']({'where':{'id':_0x413dff[_0xf489('0x41')]['id']}})[_0xf489('0x22')](handleEntityNotFound(_0x248299,null))[_0xf489('0x22')](saveUpdates(_0x413dff['body'],null))[_0xf489('0x22')](respondWithResult(_0x248299,null))[_0xf489('0x3f')](handleError(_0x248299,null));};exports[_0xf489('0x23')]=function(_0x56c5bf,_0x24a331){return db[_0xf489('0x2a')][_0xf489('0x43')]({'where':{'id':_0x56c5bf['params']['id']}})['then'](handleEntityNotFound(_0x24a331,null))[_0xf489('0x22')](removeEntity(_0x24a331,null))[_0xf489('0x3f')](handleError(_0x24a331,null));};exports[_0xf489('0x2b')]=function(_0x3f0466,_0x374598){return db['CmCompany'][_0xf489('0x2b')]()['then'](respondWithResult(_0x374598,null))[_0xf489('0x3f')](handleError(_0x374598,null));};exports['addContacts']=function(_0x572fd1,_0x1eacbf,_0x13a9ba){return db[_0xf489('0x4d')]['find']({'where':{'id':_0x572fd1[_0xf489('0x41')]['id']}})[_0xf489('0x22')](handleEntityNotFound(_0x1eacbf,null))[_0xf489('0x22')](function(_0x4b7a73){if(_0x4b7a73){return _0x4b7a73['addContacts'](_0x572fd1['body']['ids'],_[_0xf489('0x4e')](_0x572fd1[_0xf489('0x45')],[_0xf489('0x4f'),'id'])||{});}})[_0xf489('0x22')](respondWithResult(_0x1eacbf,null))[_0xf489('0x3f')](handleError(_0x1eacbf,null));};exports[_0xf489('0x50')]=function(_0xf409db,_0x4800f7,_0xdbd5b1){var _0x86b291={};var _0xca2ae3={};var _0x1eb976;var _0x8843e4;return db[_0xf489('0x2a')][_0xf489('0x51')]({'where':{'id':_0xf409db[_0xf489('0x41')]['id']}})[_0xf489('0x22')](handleEntityNotFound(_0x4800f7,null))[_0xf489('0x22')](function(_0x4f53da){if(_0x4f53da){_0x1eb976=_0x4f53da;_0xca2ae3[_0xf489('0x2c')]=_['keys'](db['CmContact'][_0xf489('0x52')]);_0xca2ae3['query']=_['keys'](_0xf409db[_0xf489('0x2e')]);_0xca2ae3['filters']=_[_0xf489('0x2f')](_0xca2ae3[_0xf489('0x2c')],_0xca2ae3['query']);_0x86b291['attributes']=_['intersection'](_0xca2ae3[_0xf489('0x2c')],qs[_0xf489('0x30')](_0xf409db[_0xf489('0x2e')][_0xf489('0x30')]));_0x86b291[_0xf489('0x31')]=_0x86b291['attributes'][_0xf489('0x32')]?_0x86b291[_0xf489('0x31')]:_0xca2ae3[_0xf489('0x2c')];_0x86b291[_0xf489('0x35')]=qs['sort'](_0xf409db['query']['sort']);_0x86b291[_0xf489('0x37')]=qs[_0xf489('0x38')](_[_0xf489('0x53')](_0xf409db['query'],_0xca2ae3[_0xf489('0x38')]));if(_0xf409db['query']['filter']){_0x86b291[_0xf489('0x37')]=_['merge'](_0x86b291[_0xf489('0x37')],{'$or':_['map'](_0x86b291['attributes'],function(_0x3925d1){var _0x4331a9={};_0x4331a9[_0x3925d1]={'$like':'%'+_0xf409db[_0xf489('0x2e')]['filter']+'%'};return _0x4331a9;})});}_0x86b291=_[_0xf489('0x3a')]({},_0x86b291,_0xf409db[_0xf489('0x3c')]);return _0x1eb976[_0xf489('0x50')](_0x86b291);}})['then'](function(_0x1940b1){if(_0x1940b1){_0x8843e4=_0x1940b1[_0xf489('0x32')];if(!_0xf409db['query']['hasOwnProperty'](_0xf489('0x34'))){_0x86b291[_0xf489('0x19')]=qs[_0xf489('0x19')](_0xf409db[_0xf489('0x2e')]['limit']);_0x86b291[_0xf489('0x1b')]=qs['offset'](_0xf409db['query'][_0xf489('0x1b')]);}return _0x1eb976[_0xf489('0x50')](_0x86b291);}})[_0xf489('0x22')](function(_0x295e58){if(_0x295e58){return _0x295e58?{'count':_0x8843e4,'rows':_0x295e58}:null;}})[_0xf489('0x22')](respondWithResult(_0x4800f7,null))['catch'](handleError(_0x4800f7,null));};
\ No newline at end of file
+var _0x68d9=['Companies','UserProfileResource','end','error','stack','name','send','CmCompany','model','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','pick','filter','where','merge','map','options','includeAll','include','rows','catch','show','rawAttributes','find','create','body','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','params','describe','addContacts','ids','omit','findOne','CmContact','order','getContacts','eml-format','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','sox','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','json','offset','undefined','limit','count','set','Content-Range','reject','save','update','then','destroy'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x68d9,0x89));var _0x968d=function(_0x477586,_0x49e433){_0x477586=_0x477586-0x0;var _0x22db50=_0x68d9[_0x477586];return _0x22db50;};'use strict';var emlformat=require(_0x968d('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x968d('0x1'));var jsonpatch=require(_0x968d('0x2'));var rp=require(_0x968d('0x3'));var moment=require('moment');var BPromise=require(_0x968d('0x4'));var Mustache=require(_0x968d('0x5'));var util=require(_0x968d('0x6'));var path=require('path');var sox=require(_0x968d('0x7'));var csv=require('to-csv');var ejs=require(_0x968d('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x968d('0x9'));var squel=require(_0x968d('0xa'));var crypto=require(_0x968d('0xb'));var jsforce=require(_0x968d('0xc'));var deskjs=require(_0x968d('0xd'));var toCsv=require('to-csv');var querystring=require(_0x968d('0xe'));var Papa=require(_0x968d('0xf'));var Redis=require(_0x968d('0x10'));var authService=require(_0x968d('0x11'));var qs=require('../../components/parsers/qs');var as=require(_0x968d('0x12'));var hardwareService=require(_0x968d('0x13'));var logger=require(_0x968d('0x14'))('api');var utils=require(_0x968d('0x15'));var config=require(_0x968d('0x16'));var licenseUtil=require(_0x968d('0x17'));var db=require(_0x968d('0x18'))['db'];function respondWithStatusCode(_0x433f40,_0x5bca8d){_0x5bca8d=_0x5bca8d||0xcc;return function(_0x289e48){if(_0x289e48){return _0x433f40[_0x968d('0x19')](_0x5bca8d);}return _0x433f40[_0x968d('0x1a')](_0x5bca8d)['end']();};}function respondWithResult(_0x3e0361,_0x4bedbe){_0x4bedbe=_0x4bedbe||0xc8;return function(_0x564616){if(_0x564616){return _0x3e0361[_0x968d('0x1a')](_0x4bedbe)[_0x968d('0x1b')](_0x564616);}};}function respondWithFilteredResult(_0x3b139a,_0x18ff39){return function(_0x584415){if(_0x584415){var _0x4c5b5e=typeof _0x18ff39[_0x968d('0x1c')]===_0x968d('0x1d')&&typeof _0x18ff39[_0x968d('0x1e')]==='undefined';var _0x1f6790=_0x584415[_0x968d('0x1f')];var _0x2d196b=_0x4c5b5e?0x0:_0x18ff39[_0x968d('0x1c')];var _0x41e106=_0x4c5b5e?_0x584415['count']:_0x18ff39['offset']+_0x18ff39[_0x968d('0x1e')];var _0x4aad0f;if(_0x41e106>=_0x1f6790){_0x41e106=_0x1f6790;_0x4aad0f=0xc8;}else{_0x4aad0f=0xce;}_0x3b139a[_0x968d('0x1a')](_0x4aad0f);return _0x3b139a[_0x968d('0x20')](_0x968d('0x21'),_0x2d196b+'-'+_0x41e106+'/'+_0x1f6790)[_0x968d('0x1b')](_0x584415);}return null;};}function patchUpdates(_0x14d919){return function(_0x55e247){try{jsonpatch['apply'](_0x55e247,_0x14d919,!![]);}catch(_0x1b0ac6){return BPromise[_0x968d('0x22')](_0x1b0ac6);}return _0x55e247[_0x968d('0x23')]();};}function saveUpdates(_0x3d0df4,_0x1f2b1b){return function(_0x15d460){if(_0x15d460){return _0x15d460[_0x968d('0x24')](_0x3d0df4)[_0x968d('0x25')](function(_0x3e1363){return _0x3e1363;});}return null;};}function removeEntity(_0x5a32c2,_0x10f064){return function(_0x3e3a27){if(_0x3e3a27){return _0x3e3a27[_0x968d('0x26')]()[_0x968d('0x25')](function(){var _0x3fb2db=_0x3e3a27['get']({'plain':!![]});var _0x31003a=_0x968d('0x27');return db[_0x968d('0x28')]['destroy']({'where':{'type':_0x31003a,'resourceId':_0x3fb2db['id']}})['then'](function(){return _0x3e3a27;});})[_0x968d('0x25')](function(){_0x5a32c2[_0x968d('0x1a')](0xcc)[_0x968d('0x29')]();});}};}function handleEntityNotFound(_0x256bb3,_0x5a54ea){return function(_0x30e763){if(!_0x30e763){_0x256bb3[_0x968d('0x19')](0x194);}return _0x30e763;};}function handleError(_0x150e57,_0x5e27c3){_0x5e27c3=_0x5e27c3||0x1f4;return function(_0x233b6b){logger[_0x968d('0x2a')](_0x233b6b[_0x968d('0x2b')]);if(_0x233b6b[_0x968d('0x2c')]){delete _0x233b6b['name'];}_0x150e57['status'](_0x5e27c3)[_0x968d('0x2d')](_0x233b6b);};}exports['index']=function(_0x2b0398,_0x306bbb){var _0x26c824={},_0x342615={},_0xfa21b4={'count':0x0,'rows':[]};return db[_0x968d('0x2e')]['describe']()[_0x968d('0x25')](function(_0x2c9dea){_0x342615[_0x968d('0x2f')]=_[_0x968d('0x30')](_0x2c9dea);_0x342615['query']=_[_0x968d('0x30')](_0x2b0398[_0x968d('0x31')]);_0x342615[_0x968d('0x32')]=_[_0x968d('0x33')](_0x342615[_0x968d('0x2f')],_0x342615[_0x968d('0x31')]);_0x26c824[_0x968d('0x34')]=_['intersection'](_0x342615[_0x968d('0x2f')],qs[_0x968d('0x35')](_0x2b0398[_0x968d('0x31')][_0x968d('0x35')]));_0x26c824[_0x968d('0x34')]=_0x26c824[_0x968d('0x34')][_0x968d('0x36')]?_0x26c824[_0x968d('0x34')]:_0x342615[_0x968d('0x2f')];if(!_0x2b0398['query'][_0x968d('0x37')](_0x968d('0x38'))){_0x26c824[_0x968d('0x1e')]=qs[_0x968d('0x1e')](_0x2b0398[_0x968d('0x31')][_0x968d('0x1e')]);_0x26c824[_0x968d('0x1c')]=qs[_0x968d('0x1c')](_0x2b0398[_0x968d('0x31')][_0x968d('0x1c')]);}_0x26c824['order']=qs['sort'](_0x2b0398[_0x968d('0x31')][_0x968d('0x39')]);_0x26c824['where']=qs[_0x968d('0x32')](_[_0x968d('0x3a')](_0x2b0398[_0x968d('0x31')],_0x342615['filters']),_0x2c9dea);if(_0x2b0398[_0x968d('0x31')][_0x968d('0x3b')]){_0x26c824[_0x968d('0x3c')]=_[_0x968d('0x3d')](_0x26c824['where'],{'$or':_[_0x968d('0x3e')](_0x26c824[_0x968d('0x34')],function(_0x386a38){var _0x465f28={};_0x465f28[_0x386a38]={'$like':'%'+_0x2b0398[_0x968d('0x31')]['filter']+'%'};return _0x465f28;})});}_0x26c824=_[_0x968d('0x3d')]({},_0x26c824,_0x2b0398[_0x968d('0x3f')]);var _0x5e1726={'where':_0x26c824['where']};return db[_0x968d('0x2e')][_0x968d('0x1f')](_0x5e1726)[_0x968d('0x25')](function(_0x52c908){_0xfa21b4[_0x968d('0x1f')]=_0x52c908;if(_0x2b0398['query'][_0x968d('0x40')]){_0x26c824[_0x968d('0x41')]=[{'all':!![]}];}return db[_0x968d('0x2e')]['findAll'](_0x26c824);})[_0x968d('0x25')](function(_0xc7fd2b){_0xfa21b4[_0x968d('0x42')]=_0xc7fd2b;return _0xfa21b4;})[_0x968d('0x25')](respondWithFilteredResult(_0x306bbb,_0x26c824))[_0x968d('0x43')](handleError(_0x306bbb,null));})[_0x968d('0x43')](handleError(_0x306bbb,null));};exports[_0x968d('0x44')]=function(_0x342b61,_0x1d47f5){var _0xb27e42={'raw':![],'where':{'id':_0x342b61['params']['id']}},_0x1627fa={};_0x1627fa['model']=_[_0x968d('0x30')](db['CmCompany'][_0x968d('0x45')]);_0x1627fa['query']=_['keys'](_0x342b61['query']);_0x1627fa[_0x968d('0x32')]=_['intersection'](_0x1627fa['model'],_0x1627fa[_0x968d('0x31')]);_0xb27e42[_0x968d('0x34')]=_[_0x968d('0x33')](_0x1627fa['model'],qs[_0x968d('0x35')](_0x342b61[_0x968d('0x31')][_0x968d('0x35')]));_0xb27e42[_0x968d('0x34')]=_0xb27e42['attributes'][_0x968d('0x36')]?_0xb27e42[_0x968d('0x34')]:_0x1627fa[_0x968d('0x2f')];if(_0x342b61[_0x968d('0x31')][_0x968d('0x40')]){_0xb27e42[_0x968d('0x41')]=[{'all':!![]}];}_0xb27e42=_['merge']({},_0xb27e42,_0x342b61[_0x968d('0x3f')]);return db[_0x968d('0x2e')][_0x968d('0x46')](_0xb27e42)[_0x968d('0x25')](handleEntityNotFound(_0x1d47f5,null))['then'](respondWithResult(_0x1d47f5,null))[_0x968d('0x43')](handleError(_0x1d47f5,null));};exports[_0x968d('0x47')]=function(_0x390147,_0x543989){return db['CmCompany'][_0x968d('0x47')](_0x390147[_0x968d('0x48')],{})['then'](function(_0x1e9f52){var _0x5c6945=_0x390147[_0x968d('0x49')][_0x968d('0x4a')]({'plain':!![]});if(!_0x5c6945)throw new Error(_0x968d('0x4b'));if(_0x5c6945['role']===_0x968d('0x49')){var _0x5de4e7=_0x1e9f52[_0x968d('0x4a')]({'plain':!![]});var _0x1343d0=_0x968d('0x27');return db['UserProfileSection'][_0x968d('0x46')]({'where':{'name':_0x1343d0,'userProfileId':_0x5c6945[_0x968d('0x4c')]},'raw':!![]})[_0x968d('0x25')](function(_0x417758){if(_0x417758&&_0x417758[_0x968d('0x4d')]===0x0){return db[_0x968d('0x28')][_0x968d('0x47')]({'name':_0x5de4e7[_0x968d('0x2c')],'resourceId':_0x5de4e7['id'],'type':_0x417758[_0x968d('0x2c')],'sectionId':_0x417758['id']},{})[_0x968d('0x25')](function(){return _0x1e9f52;});}else{return _0x1e9f52;}})[_0x968d('0x43')](function(_0x4956ef){logger[_0x968d('0x2a')](_0x968d('0x4e'),_0x4956ef);throw _0x4956ef;});}return _0x1e9f52;})[_0x968d('0x25')](respondWithResult(_0x543989,0xc9))[_0x968d('0x43')](handleError(_0x543989,null));};exports[_0x968d('0x24')]=function(_0x39ef93,_0x36f565){if(_0x39ef93[_0x968d('0x48')]['id']){delete _0x39ef93['body']['id'];}return db[_0x968d('0x2e')][_0x968d('0x46')]({'where':{'id':_0x39ef93['params']['id']}})[_0x968d('0x25')](handleEntityNotFound(_0x36f565,null))[_0x968d('0x25')](saveUpdates(_0x39ef93['body'],null))[_0x968d('0x25')](respondWithResult(_0x36f565,null))['catch'](handleError(_0x36f565,null));};exports['destroy']=function(_0x147ed3,_0x2e0690){return db[_0x968d('0x2e')][_0x968d('0x46')]({'where':{'id':_0x147ed3[_0x968d('0x4f')]['id']}})[_0x968d('0x25')](handleEntityNotFound(_0x2e0690,null))[_0x968d('0x25')](removeEntity(_0x2e0690,null))[_0x968d('0x43')](handleError(_0x2e0690,null));};exports['describe']=function(_0x351072,_0x358ce6){return db['CmCompany'][_0x968d('0x50')]()[_0x968d('0x25')](respondWithResult(_0x358ce6,null))[_0x968d('0x43')](handleError(_0x358ce6,null));};exports[_0x968d('0x51')]=function(_0x41fe07,_0x1332d2,_0xead60e){return db['CmContact'][_0x968d('0x46')]({'where':{'id':_0x41fe07[_0x968d('0x4f')]['id']}})['then'](handleEntityNotFound(_0x1332d2,null))['then'](function(_0x1b6dcb){if(_0x1b6dcb){return _0x1b6dcb[_0x968d('0x51')](_0x41fe07[_0x968d('0x48')][_0x968d('0x52')],_[_0x968d('0x53')](_0x41fe07[_0x968d('0x48')],['ids','id'])||{});}})[_0x968d('0x25')](respondWithResult(_0x1332d2,null))[_0x968d('0x43')](handleError(_0x1332d2,null));};exports['getContacts']=function(_0x359e6f,_0x3fde7f,_0x170e14){var _0x3e76b3={};var _0x2a1917={};var _0x2163a2;var _0x46bd66;return db['CmCompany'][_0x968d('0x54')]({'where':{'id':_0x359e6f[_0x968d('0x4f')]['id']}})['then'](handleEntityNotFound(_0x3fde7f,null))[_0x968d('0x25')](function(_0x1b5674){if(_0x1b5674){_0x2163a2=_0x1b5674;_0x2a1917['model']=_[_0x968d('0x30')](db[_0x968d('0x55')][_0x968d('0x45')]);_0x2a1917[_0x968d('0x31')]=_['keys'](_0x359e6f[_0x968d('0x31')]);_0x2a1917['filters']=_[_0x968d('0x33')](_0x2a1917['model'],_0x2a1917[_0x968d('0x31')]);_0x3e76b3[_0x968d('0x34')]=_[_0x968d('0x33')](_0x2a1917['model'],qs[_0x968d('0x35')](_0x359e6f['query'][_0x968d('0x35')]));_0x3e76b3[_0x968d('0x34')]=_0x3e76b3[_0x968d('0x34')][_0x968d('0x36')]?_0x3e76b3[_0x968d('0x34')]:_0x2a1917[_0x968d('0x2f')];_0x3e76b3[_0x968d('0x56')]=qs[_0x968d('0x39')](_0x359e6f[_0x968d('0x31')]['sort']);_0x3e76b3[_0x968d('0x3c')]=qs[_0x968d('0x32')](_[_0x968d('0x3a')](_0x359e6f[_0x968d('0x31')],_0x2a1917[_0x968d('0x32')]));if(_0x359e6f[_0x968d('0x31')][_0x968d('0x3b')]){_0x3e76b3[_0x968d('0x3c')]=_[_0x968d('0x3d')](_0x3e76b3[_0x968d('0x3c')],{'$or':_[_0x968d('0x3e')](_0x3e76b3[_0x968d('0x34')],function(_0x429cf3){var _0x3cf0d8={};_0x3cf0d8[_0x429cf3]={'$like':'%'+_0x359e6f['query'][_0x968d('0x3b')]+'%'};return _0x3cf0d8;})});}_0x3e76b3=_['merge']({},_0x3e76b3,_0x359e6f[_0x968d('0x3f')]);return _0x2163a2['getContacts'](_0x3e76b3);}})[_0x968d('0x25')](function(_0x5b2ecd){if(_0x5b2ecd){_0x46bd66=_0x5b2ecd['length'];if(!_0x359e6f[_0x968d('0x31')]['hasOwnProperty']('nolimit')){_0x3e76b3[_0x968d('0x1e')]=qs['limit'](_0x359e6f['query'][_0x968d('0x1e')]);_0x3e76b3[_0x968d('0x1c')]=qs[_0x968d('0x1c')](_0x359e6f['query'][_0x968d('0x1c')]);}return _0x2163a2[_0x968d('0x57')](_0x3e76b3);}})[_0x968d('0x25')](function(_0x2aeb1b){if(_0x2aeb1b){return _0x2aeb1b?{'count':_0x46bd66,'rows':_0x2aeb1b}:null;}})[_0x968d('0x25')](respondWithResult(_0x3fde7f,null))[_0x968d('0x43')](handleError(_0x3fde7f,null));};
\ No newline at end of file
diff --git a/server/api/cmCompany/cmCompany.model.js b/server/api/cmCompany/cmCompany.model.js
index 7d5fc61..6bee010 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 _0x784b=['api','moment','bluebird','request-promise','path','../../config/environment','./cmCompany.attributes','exports','define','CmCompany','cm_companies','util','../../config/logger'];(function(_0xf79bae,_0x263b2a){var _0x5d2cb7=function(_0x27c86b){while(--_0x27c86b){_0xf79bae['push'](_0xf79bae['shift']());}};_0x5d2cb7(++_0x263b2a);}(_0x784b,0x73));var _0xb784=function(_0x5809db,_0x40bc95){_0x5809db=_0x5809db-0x0;var _0x3399bc=_0x784b[_0x5809db];return _0x3399bc;};'use strict';var _=require('lodash');var util=require(_0xb784('0x0'));var logger=require(_0xb784('0x1'))(_0xb784('0x2'));var moment=require(_0xb784('0x3'));var BPromise=require(_0xb784('0x4'));var rp=require(_0xb784('0x5'));var fs=require('fs');var path=require(_0xb784('0x6'));var rimraf=require('rimraf');var config=require(_0xb784('0x7'));var attributes=require(_0xb784('0x8'));module[_0xb784('0x9')]=function(_0x72d27,_0x5adb9c){return _0x72d27[_0xb784('0xa')](_0xb784('0xb'),attributes,{'tableName':_0xb784('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xdc9c=['moment','bluebird','request-promise','path','rimraf','../../config/environment','./cmCompany.attributes','exports','define','lodash','../../config/logger'];(function(_0x32e13c,_0x4ec0fd){var _0x2969d5=function(_0x2df4a5){while(--_0x2df4a5){_0x32e13c['push'](_0x32e13c['shift']());}};_0x2969d5(++_0x4ec0fd);}(_0xdc9c,0x1d7));var _0xcdc9=function(_0x2cda18,_0x1272f2){_0x2cda18=_0x2cda18-0x0;var _0x396b2e=_0xdc9c[_0x2cda18];return _0x396b2e;};'use strict';var _=require(_0xcdc9('0x0'));var util=require('util');var logger=require(_0xcdc9('0x1'))('api');var moment=require(_0xcdc9('0x2'));var BPromise=require(_0xcdc9('0x3'));var rp=require(_0xcdc9('0x4'));var fs=require('fs');var path=require(_0xcdc9('0x5'));var rimraf=require(_0xcdc9('0x6'));var config=require(_0xcdc9('0x7'));var attributes=require(_0xcdc9('0x8'));module[_0xcdc9('0x9')]=function(_0x3fca8f,_0x5ed753){return _0x3fca8f[_0xcdc9('0xa')]('CmCompany',attributes,{'tableName':'cm_companies','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 ef71c6a..1cecb18 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 _0x7a3e=['error','message','catch','lodash','util','ioredis','../../config/environment','jayson/promise','client','then','info','CmCompany,\x20%s,\x20%s','debug','CmCompany,\x20%s,\x20%s,\x20%s','request\x20sent','stringify'];(function(_0x4c336c,_0x3a0b51){var _0xcdd801=function(_0x5d355b){while(--_0x5d355b){_0x4c336c['push'](_0x4c336c['shift']());}};_0xcdd801(++_0x3a0b51);}(_0x7a3e,0xb3));var _0xe7a3=function(_0x411e4e,_0x14c369){_0x411e4e=_0x411e4e-0x0;var _0x48d4c3=_0x7a3e[_0x411e4e];return _0x48d4c3;};'use strict';var _=require(_0xe7a3('0x0'));var util=require(_0xe7a3('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xe7a3('0x2'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')('rpc');var config=require(_0xe7a3('0x3'));var jayson=require(_0xe7a3('0x4'));var client=jayson[_0xe7a3('0x5')]['http']({'port':0x232a});function respondWithRpcPromise(_0x249f96,_0x3849c0,_0x504037){return new BPromise(function(_0x2baaf2,_0x477812){return client['request'](_0x249f96,_0x504037)[_0xe7a3('0x6')](function(_0x3e76cd){logger[_0xe7a3('0x7')](_0xe7a3('0x8'),_0x3849c0,'request\x20sent');logger[_0xe7a3('0x9')](_0xe7a3('0xa'),_0x3849c0,_0xe7a3('0xb'),JSON[_0xe7a3('0xc')](_0x3e76cd));if(_0x3e76cd[_0xe7a3('0xd')]){if(_0x3e76cd['error']['code']===0x1f4){logger[_0xe7a3('0xd')]('CmCompany,\x20%s,\x20%s',_0x3849c0,_0x3e76cd[_0xe7a3('0xd')][_0xe7a3('0xe')]);return _0x477812(_0x3e76cd[_0xe7a3('0xd')][_0xe7a3('0xe')]);}logger[_0xe7a3('0xd')](_0xe7a3('0x8'),_0x3849c0,_0x3e76cd[_0xe7a3('0xd')]['message']);return _0x2baaf2(_0x3e76cd['error'][_0xe7a3('0xe')]);}else{logger[_0xe7a3('0x7')](_0xe7a3('0x8'),_0x3849c0,'request\x20sent');_0x2baaf2(_0x3e76cd['result']['message']);}})[_0xe7a3('0xf')](function(_0x1c3bb1){logger['error'](_0xe7a3('0x8'),_0x3849c0,_0x1c3bb1);_0x477812(_0x1c3bb1);});});}
\ No newline at end of file
+var _0xdccb=['error','CmCompany,\x20%s,\x20%s','message','result','lodash','util','randomstring','ioredis','../../mysqldb','../../config/logger','jayson/promise','client','http','request','then','info','request\x20sent','debug','CmCompany,\x20%s,\x20%s,\x20%s'];(function(_0x355bb1,_0x3ea27c){var _0x42f907=function(_0x3f2181){while(--_0x3f2181){_0x355bb1['push'](_0x355bb1['shift']());}};_0x42f907(++_0x3ea27c);}(_0xdccb,0x193));var _0xbdcc=function(_0x5de17e,_0x556efd){_0x5de17e=_0x5de17e-0x0;var _0x9db192=_0xdccb[_0x5de17e];return _0x9db192;};'use strict';var _=require(_0xbdcc('0x0'));var util=require(_0xbdcc('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0xbdcc('0x2'));var fs=require('fs');var Redis=require(_0xbdcc('0x3'));var db=require(_0xbdcc('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0xbdcc('0x5'))('rpc');var config=require('../../config/environment');var jayson=require(_0xbdcc('0x6'));var client=jayson[_0xbdcc('0x7')][_0xbdcc('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x3cf510,_0x3f7def,_0xb86feb){return new BPromise(function(_0x4ed386,_0x4f6553){return client[_0xbdcc('0x9')](_0x3cf510,_0xb86feb)[_0xbdcc('0xa')](function(_0x72f665){logger[_0xbdcc('0xb')]('CmCompany,\x20%s,\x20%s',_0x3f7def,_0xbdcc('0xc'));logger[_0xbdcc('0xd')](_0xbdcc('0xe'),_0x3f7def,_0xbdcc('0xc'),JSON['stringify'](_0x72f665));if(_0x72f665[_0xbdcc('0xf')]){if(_0x72f665[_0xbdcc('0xf')]['code']===0x1f4){logger['error'](_0xbdcc('0x10'),_0x3f7def,_0x72f665[_0xbdcc('0xf')]['message']);return _0x4f6553(_0x72f665[_0xbdcc('0xf')][_0xbdcc('0x11')]);}logger[_0xbdcc('0xf')](_0xbdcc('0x10'),_0x3f7def,_0x72f665[_0xbdcc('0xf')][_0xbdcc('0x11')]);return _0x4ed386(_0x72f665[_0xbdcc('0xf')][_0xbdcc('0x11')]);}else{logger[_0xbdcc('0xb')](_0xbdcc('0x10'),_0x3f7def,_0xbdcc('0xc'));_0x4ed386(_0x72f665[_0xbdcc('0x12')][_0xbdcc('0x11')]);}})['catch'](function(_0x532c91){logger[_0xbdcc('0xf')](_0xbdcc('0x10'),_0x3f7def,_0x532c91);_0x4f6553(_0x532c91);});});}
\ No newline at end of file
diff --git a/server/api/cmCompany/index.js b/server/api/cmCompany/index.js
index 0d4d291..4d2881d 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 _0x1740=['../../components/auth/service','../../components/interaction/service','get','isAuthenticated','/describe','describe','/:id','getContacts','post','create','addContacts','put','delete','destroy','multer','util','path','connect-timeout','express','Router'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x1740,0x1c6));var _0x0174=function(_0x4afa1e,_0xf635f4){_0x4afa1e=_0x4afa1e-0x0;var _0x35eeed=_0x1740[_0x4afa1e];return _0x35eeed;};'use strict';var multer=require(_0x0174('0x0'));var util=require(_0x0174('0x1'));var path=require(_0x0174('0x2'));var timeout=require(_0x0174('0x3'));var express=require(_0x0174('0x4'));var router=express[_0x0174('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0x0174('0x6'));var interaction=require(_0x0174('0x7'));var config=require('../../config/environment');var controller=require('./cmCompany.controller');router[_0x0174('0x8')]('/',auth[_0x0174('0x9')](),controller['index']);router[_0x0174('0x8')](_0x0174('0xa'),auth['isAuthenticated'](),controller[_0x0174('0xb')]);router[_0x0174('0x8')](_0x0174('0xc'),auth[_0x0174('0x9')](),controller['show']);router[_0x0174('0x8')]('/:id/contacts',auth[_0x0174('0x9')](),controller[_0x0174('0xd')]);router[_0x0174('0xe')]('/',auth[_0x0174('0x9')](),controller[_0x0174('0xf')]);router['post']('/:id/contacts',auth[_0x0174('0x9')](),controller[_0x0174('0x10')]);router[_0x0174('0x11')](_0x0174('0xc'),auth['isAuthenticated'](),controller['update']);router[_0x0174('0x12')](_0x0174('0xc'),auth[_0x0174('0x9')](),controller[_0x0174('0x13')]);module['exports']=router;
\ No newline at end of file
+var _0xdccf=['fs-extra','../../components/interaction/service','../../config/environment','./cmCompany.controller','get','isAuthenticated','index','/:id','show','/:id/contacts','post','create','addContacts','put','update','delete','destroy','multer','util','connect-timeout','express','Router'];(function(_0x294095,_0x29e946){var _0xd5f54=function(_0x8e8630){while(--_0x8e8630){_0x294095['push'](_0x294095['shift']());}};_0xd5f54(++_0x29e946);}(_0xdccf,0x95));var _0xfdcc=function(_0x4aa7f5,_0x2a747f){_0x4aa7f5=_0x4aa7f5-0x0;var _0xab2c07=_0xdccf[_0x4aa7f5];return _0xab2c07;};'use strict';var multer=require(_0xfdcc('0x0'));var util=require(_0xfdcc('0x1'));var path=require('path');var timeout=require(_0xfdcc('0x2'));var express=require(_0xfdcc('0x3'));var router=express[_0xfdcc('0x4')]();var fs_extra=require(_0xfdcc('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0xfdcc('0x6'));var config=require(_0xfdcc('0x7'));var controller=require(_0xfdcc('0x8'));router[_0xfdcc('0x9')]('/',auth[_0xfdcc('0xa')](),controller[_0xfdcc('0xb')]);router['get']('/describe',auth[_0xfdcc('0xa')](),controller['describe']);router[_0xfdcc('0x9')](_0xfdcc('0xc'),auth[_0xfdcc('0xa')](),controller[_0xfdcc('0xd')]);router['get'](_0xfdcc('0xe'),auth['isAuthenticated'](),controller['getContacts']);router[_0xfdcc('0xf')]('/',auth['isAuthenticated'](),controller[_0xfdcc('0x10')]);router[_0xfdcc('0xf')](_0xfdcc('0xe'),auth[_0xfdcc('0xa')](),controller[_0xfdcc('0x11')]);router[_0xfdcc('0x12')](_0xfdcc('0xc'),auth[_0xfdcc('0xa')](),controller[_0xfdcc('0x13')]);router[_0xfdcc('0x14')](_0xfdcc('0xc'),auth[_0xfdcc('0xa')](),controller[_0xfdcc('0x15')]);module['exports']=router;
\ No newline at end of file
diff --git a/server/api/cmContact/cmContact.attributes.js b/server/api/cmContact/cmContact.attributes.js
index 2320960..5bed109 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 _0x6533=['DATE','NOW','lodash','sequelize','exports','STRING','TEXT','INTEGER','UNSIGNED'];(function(_0x2e58c7,_0x23d092){var _0x26eb00=function(_0x343124){while(--_0x343124){_0x2e58c7['push'](_0x2e58c7['shift']());}};_0x26eb00(++_0x23d092);}(_0x6533,0x1e8));var _0x3653=function(_0x16ccb5,_0x2305c3){_0x16ccb5=_0x16ccb5-0x0;var _0x284954=_0x6533[_0x16ccb5];return _0x284954;};'use strict';var _=require(_0x3653('0x0'));var Sequelize=require(_0x3653('0x1'));module[_0x3653('0x2')]={'firstName':{'type':Sequelize[_0x3653('0x3')],'allowNull':![]},'lastName':{'type':Sequelize[_0x3653('0x3')]},'street':{'type':Sequelize[_0x3653('0x3')]},'postalCode':{'type':Sequelize[_0x3653('0x3')]},'city':{'type':Sequelize[_0x3653('0x3')]},'country':{'type':Sequelize[_0x3653('0x3')]},'dateOfBirth':{'type':Sequelize[_0x3653('0x3')]},'description':{'type':Sequelize[_0x3653('0x4')]},'phone':{'type':Sequelize[_0x3653('0x3')]},'mobile':{'type':Sequelize[_0x3653('0x3')]},'fax':{'type':Sequelize[_0x3653('0x3')]},'email':{'type':Sequelize[_0x3653('0x3')]},'url':{'type':Sequelize[_0x3653('0x3')]},'facebook':{'type':Sequelize[_0x3653('0x3')]},'fb_data':{'type':Sequelize[_0x3653('0x3')]},'twitter':{'type':Sequelize[_0x3653('0x3')]},'skype':{'type':Sequelize[_0x3653('0x3')]},'teams':{'type':Sequelize['STRING']},'viber':{'type':Sequelize[_0x3653('0x3')]},'line':{'type':Sequelize[_0x3653('0x3')]},'wechat':{'type':Sequelize[_0x3653('0x3')]},'telegram':{'type':Sequelize[_0x3653('0x3')]},'UserId':{'type':Sequelize['INTEGER']},'priority':{'type':Sequelize[_0x3653('0x5')](0x2)[_0x3653('0x6')],'defaultValue':0x2,'validate':{'min':0x0,'max':0x4}},'scheduledat':{'type':Sequelize[_0x3653('0x7')],'defaultValue':Sequelize[_0x3653('0x8')]}};
\ No newline at end of file
+var _0xc405=['UNSIGNED','NOW','lodash','sequelize','exports','STRING','TEXT','INTEGER'];(function(_0x12ce51,_0x4cf3e9){var _0xeb0aa4=function(_0x11d692){while(--_0x11d692){_0x12ce51['push'](_0x12ce51['shift']());}};_0xeb0aa4(++_0x4cf3e9);}(_0xc405,0x19a));var _0x5c40=function(_0x13c4f8,_0x433521){_0x13c4f8=_0x13c4f8-0x0;var _0x5a8f4b=_0xc405[_0x13c4f8];return _0x5a8f4b;};'use strict';var _=require(_0x5c40('0x0'));var Sequelize=require(_0x5c40('0x1'));module[_0x5c40('0x2')]={'firstName':{'type':Sequelize[_0x5c40('0x3')],'allowNull':![]},'lastName':{'type':Sequelize[_0x5c40('0x3')]},'street':{'type':Sequelize['STRING']},'postalCode':{'type':Sequelize[_0x5c40('0x3')]},'city':{'type':Sequelize[_0x5c40('0x3')]},'country':{'type':Sequelize[_0x5c40('0x3')]},'dateOfBirth':{'type':Sequelize[_0x5c40('0x3')]},'description':{'type':Sequelize[_0x5c40('0x4')]},'phone':{'type':Sequelize['STRING']},'mobile':{'type':Sequelize['STRING']},'fax':{'type':Sequelize[_0x5c40('0x3')]},'email':{'type':Sequelize[_0x5c40('0x3')]},'url':{'type':Sequelize[_0x5c40('0x3')]},'facebook':{'type':Sequelize[_0x5c40('0x3')]},'fb_data':{'type':Sequelize['STRING']},'twitter':{'type':Sequelize[_0x5c40('0x3')]},'skype':{'type':Sequelize[_0x5c40('0x3')]},'teams':{'type':Sequelize[_0x5c40('0x3')]},'viber':{'type':Sequelize['STRING']},'line':{'type':Sequelize[_0x5c40('0x3')]},'wechat':{'type':Sequelize['STRING']},'telegram':{'type':Sequelize[_0x5c40('0x3')]},'UserId':{'type':Sequelize[_0x5c40('0x5')]},'priority':{'type':Sequelize[_0x5c40('0x5')](0x2)[_0x5c40('0x6')],'defaultValue':0x2,'validate':{'min':0x0,'max':0x4}},'scheduledat':{'type':Sequelize['DATE'],'defaultValue':Sequelize[_0x5c40('0x7')]}};
\ No newline at end of file
diff --git a/server/api/cmContact/cmContact.controller.js b/server/api/cmContact/cmContact.controller.js
index 7cc7d10..7a19ecb 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 _0x45da=['undefined','count','Content-Range','apply','update','then','end','error','stack','name','send','index','describe','keys','length','startsWith','cf_','push','CmCustomField','findOne','trimStart','all','model','query','filters','intersection','fields','attributes','hasOwnProperty','nolimit','limit','order','sort','where','pick','select','field','color','from','tools_tags','left_join','cm_user_has_contacts','uc.CmContactId\x20=\x20c.id','t.id\x20=\x20ct.TagId','c.deletedAt\x20IS\x20NULL','expr','search','parseSearch','sqlOperator','conditions','find','Tag','value','split','map','forEach','User','and','uc.UserId\x20=\x20?','fieldType','datetime','type','start','isNil','Contact','isEmpty','ListId','c.ListId\x20IN\x20?','concat','\x20=\x20?','tag','isArray','filter','replace','MATCH\x20(c.firstName,\x20c.lastName,\x20c.phone,\x20c.mobile,\x20c.fax,\x20c.email)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','isNumeric','c.id\x20LIKE\x20?','c.phone\x20LIKE\x20?','c.mobile\x20LIKE\x20?','isEmail','c.firstName\x20LIKE\x20?','QueryTypes','SELECT','clone','c.id','DESC','resolve','user','role','getLists','c.ListId\x20IS\x20NULL','agent','sequelize','toString','keyBy','merge','CmContact','c.firstName','c.lastName','c.phone','c.mobile','c.fax','c.ListId','c.createdAt','c.deletedAt','c.CompanyId','TagIds','Tags','rows','catch','destroy','params','displayName','findAll','columnName','alias','custom','values','body','get','mergeWith','tags','join','info','[CmContact][merge]\x20to\x20%s\x20from\x20%s','CmHopper','CmHopperBlack','[CmContact][merge][destroy][CmHopperBlack],\x20%s','create','ChatInteraction','ChatMessage','MailInteraction','MailMessage','SmsInteraction','SmsMessage','FaxInteraction','FaxMessage','OpenchannelInteraction','OpenchannelMessage','CmHopperFinal','CmHopperHistory','VoiceCallReport','ChatQueueReport','FaxQueueReport','MailQueueReport','OpenchannelQueueReport','SmsQueueReport','JscriptySessionReport','WhatsappInteraction','WhatsappMessage','bulkCreate','each','duplicates','$or','findOrCreate','spread','show','omit','format','cf_%d','pickBy','table','cm_contacts','id\x20=\x20?','text','phone','getTags','options','setTags','getHoppers','rawAttributes','ContactId','includeAll','include','getHopperHistories','getHopperFinals','uploadCsv','binding_keys','No\x20association\x20keys\x20specified!','binding_values','No\x20association\x20values\x20specified!','socket_timestamp','Unable\x20to\x20synchronize\x20socket,\x20no\x20timestamp\x20passed','Incorrect\x20binding\x20parameters\x20passed!','zipObject','No\x20phone\x20column\x20specified','firstName','No\x20firstName\x20column\x20specified','root','server/files/tmp','file','filename','chmodSync','child_process','CompanyId','pid','upload','createReadStream','json','meta','import','No\x20ListId\x20specified','binding','fork','../../components/import/cm/csv2','stringify','exit','getJourney','mail','sms','openchannel','fax','whatsapp','voice','includes','channel','toLowerCase','Invalid\x20channel','parse','range','Invalid\x20date\x20for\x20range\x20from\x20filter','isValid','Invalid\x20date\x20for\x20range\x20to\x20filter','Invalid\x20createdAt\x20filter','source','destination','starttime','endtime','duration','createdAt','userDisposition','userSecondDisposition','UserId','findAndCountAll','fullname','startCase','Website','Account','closed','closedAt','note','disposition','secondDisposition','thirdDisposition','chat','browserName','customerIp','customerPort','deviceModel','osName','ratingMessage','ratingType','ratingValue','referer','subject','substatus','threadId','Interaction','Owner','flatten','sortBy','reverse','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','to-csv','fs-extra','lodash','squel','crypto','jsforce','desk.js','ioredis','../../components/auth/service','../../config/license/hardware','../../config/logger','../../config/utils','../../config/license/util','redis','defaults','localhost','socket.io-emitter','./cmContact.socket','register','sendStatus','status','offset'];(function(_0x538670,_0xad1080){var _0x291c33=function(_0x510b28){while(--_0x510b28){_0x538670['push'](_0x538670['shift']());}};_0x291c33(++_0xad1080);}(_0x45da,0x106));var _0xa45d=function(_0x1012a7,_0x34b347){_0x1012a7=_0x1012a7-0x0;var _0x34f1d6=_0x45da[_0x1012a7];return _0x34f1d6;};'use strict';var emlformat=require(_0xa45d('0x0'));var rimraf=require(_0xa45d('0x1'));var zipdir=require(_0xa45d('0x2'));var jsonpatch=require(_0xa45d('0x3'));var rp=require(_0xa45d('0x4'));var moment=require(_0xa45d('0x5'));var BPromise=require(_0xa45d('0x6'));var Mustache=require(_0xa45d('0x7'));var util=require(_0xa45d('0x8'));var path=require(_0xa45d('0x9'));var sox=require('sox');var csv=require(_0xa45d('0xa'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xa45d('0xb'));var _=require(_0xa45d('0xc'));var squel=require(_0xa45d('0xd'));var crypto=require(_0xa45d('0xe'));var jsforce=require(_0xa45d('0xf'));var deskjs=require(_0xa45d('0x10'));var toCsv=require(_0xa45d('0xa'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0xa45d('0x11'));var authService=require(_0xa45d('0x12'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xa45d('0x13'));var logger=require(_0xa45d('0x14'))('api');var utils=require(_0xa45d('0x15'));var config=require('../../config/environment');var licenseUtil=require(_0xa45d('0x16'));var db=require('../../mysqldb')['db'];config[_0xa45d('0x17')]=_[_0xa45d('0x18')](config[_0xa45d('0x17')],{'host':_0xa45d('0x19'),'port':0x18eb});var socket=require(_0xa45d('0x1a'))(new Redis(config[_0xa45d('0x17')]));require(_0xa45d('0x1b'))[_0xa45d('0x1c')](socket);function respondWithStatusCode(_0x4a081f,_0xd0dd1b){_0xd0dd1b=_0xd0dd1b||0xcc;return function(_0x434efc){if(_0x434efc){return _0x4a081f[_0xa45d('0x1d')](_0xd0dd1b);}return _0x4a081f['status'](_0xd0dd1b)['end']();};}function respondWithResult(_0x1cc47a,_0x4dba31){_0x4dba31=_0x4dba31||0xc8;return function(_0xae3912){if(_0xae3912){return _0x1cc47a[_0xa45d('0x1e')](_0x4dba31)['json'](_0xae3912);}};}function respondWithFilteredResult(_0x540709,_0x1484f7){return function(_0x2f6456){if(_0x2f6456){var _0x56f144=typeof _0x1484f7[_0xa45d('0x1f')]===_0xa45d('0x20')&&typeof _0x1484f7['limit']==='undefined';var _0x134a35=_0x2f6456[_0xa45d('0x21')];var _0x5d5b41=_0x56f144?0x0:_0x1484f7[_0xa45d('0x1f')];var _0x5cbd35=_0x56f144?_0x2f6456[_0xa45d('0x21')]:_0x1484f7[_0xa45d('0x1f')]+_0x1484f7['limit'];var _0x49c045;if(_0x5cbd35>=_0x134a35){_0x5cbd35=_0x134a35;_0x49c045=0xc8;}else{_0x49c045=0xce;}_0x540709['status'](_0x49c045);return _0x540709['set'](_0xa45d('0x22'),_0x5d5b41+'-'+_0x5cbd35+'/'+_0x134a35)['json'](_0x2f6456);}return null;};}function patchUpdates(_0x3f202f){return function(_0xf306dd){try{jsonpatch[_0xa45d('0x23')](_0xf306dd,_0x3f202f,!![]);}catch(_0x4ef664){return BPromise['reject'](_0x4ef664);}return _0xf306dd['save']();};}function saveUpdates(_0x5a5cdc,_0xd349b6){return function(_0x5524ed){if(_0x5524ed){return _0x5524ed[_0xa45d('0x24')](_0x5a5cdc)[_0xa45d('0x25')](function(_0x7445ab){return _0x7445ab;});}return null;};}function removeEntity(_0x1e5b3b,_0x213bdd){return function(_0x38dc4){if(_0x38dc4){return _0x38dc4['destroy']()[_0xa45d('0x25')](function(){_0x1e5b3b['status'](0xcc)[_0xa45d('0x26')]();});}};}function handleEntityNotFound(_0x16aac2,_0x158878){return function(_0x36e8e3){if(!_0x36e8e3){_0x16aac2[_0xa45d('0x1d')](0x194);}return _0x36e8e3;};}function handleError(_0x4d2262,_0x304e75){_0x304e75=_0x304e75||0x1f4;return function(_0x3cd8cb){logger[_0xa45d('0x27')](_0x3cd8cb[_0xa45d('0x28')]);if(_0x3cd8cb[_0xa45d('0x29')]){delete _0x3cd8cb['name'];}_0x4d2262[_0xa45d('0x1e')](_0x304e75)[_0xa45d('0x2a')](_0x3cd8cb);};}exports[_0xa45d('0x2b')]=function(_0x31aeb3,_0x25b514){var _0x490b45={},_0x131fc4={},_0x59e828={'count':0x0,'rows':[]};return db['CmContact'][_0xa45d('0x2c')]()['then'](function(_0x558cb8){var _0x14a8cc=[];for(var _0x5488ba=0x0;_0x5488ba
','Attachments','Title','Data','getHost','gmail','imap.gmail.com','imap.mail.yahoo.com','imap-mail.outlook.com','outlook365'];(function(_0xcc4ab5,_0x415248){var _0x545144=function(_0xc9741e){while(--_0xc9741e){_0xcc4ab5['push'](_0xcc4ab5['shift']());}};_0x545144(++_0x415248);}(_0x5f66,0x1a0));var _0x65f6=function(_0x36eaaa,_0x326732){_0x36eaaa=_0x36eaaa-0x0;var _0x461349=_0x5f66[_0x36eaaa];return _0x461349;};'use strict';var _=require('lodash');var moment=require(_0x65f6('0x0'));var random=require('randomstring');var fs=require('fs');var path=require(_0x65f6('0x1'));var util=require(_0x65f6('0x2'));var tnef=require(_0x65f6('0x3'));var logger=require(_0x65f6('0x4'))(_0x65f6('0x5'));var config=require('../../../config/environment');function getAddress(_0x3c5029){var _0x5150c8=_[_0x65f6('0x6')](_0x3c5029[_0x65f6('0x7')]);return _0x5150c8&&_0x5150c8['address']?_0x5150c8['address']:_0x65f6('0x8')+random[_0x65f6('0x9')](0x6)+_0x65f6('0xa');}function getFirstName(_0x8f6451){var _0xc44c70=_[_0x65f6('0x6')](_0x8f6451['value']);if(_0xc44c70&&_0xc44c70['name']){var _0x18fea1=_0xc44c70[_0x65f6('0xb')][_0x65f6('0xc')](/\s+/);return _0x18fea1[_0x65f6('0xd')]?_0x18fea1['slice'](0x0,-0x1)[_0x65f6('0xe')]('\x20'):_0xc44c70['name'];}return'Anonymous';}function getLastName(_0x2d2dfa){var _0x576875=_[_0x65f6('0x6')](_0x2d2dfa['value']);if(_0x576875&&_0x576875[_0x65f6('0xb')]){var _0x186a6a=_0x576875[_0x65f6('0xb')][_0x65f6('0xc')](/\s+/);return _0x186a6a[_0x65f6('0xd')]>0x1?_0x186a6a[_0x65f6('0xf')]():'';}return'';}function getMails(_0x44144b,_0xb1d40a){var _0x46dbc6='';for(var _0x3440af=0x0;_0x3440af<_0xb1d40a['value'][_0x65f6('0xd')];_0x3440af+=0x1){if(_0xb1d40a['value'][_0x3440af]['address']!==_0x44144b){if(!_[_0x65f6('0x10')](_0x46dbc6)){_0x46dbc6+=',';}_0x46dbc6+=_0xb1d40a[_0x65f6('0x7')][_0x3440af][_0x65f6('0xb')]||_0xb1d40a[_0x65f6('0x7')][_0x3440af][_0x65f6('0x11')]||'';_0x46dbc6+='\x20<';_0x46dbc6+=_0xb1d40a[_0x65f6('0x7')][_0x3440af][_0x65f6('0x11')]?_0xb1d40a[_0x65f6('0x7')][_0x3440af]['address']:'anonymous'+random[_0x65f6('0x9')](0x6)+'@xcally.com';_0x46dbc6+='>';}}return _0x46dbc6;}function parseEmail(_0x4c81f3,_0x5c5b91,_0x365159){if(_0x5c5b91[_0x65f6('0x12')]){var _0x5114a4=/