From a4c5238f32604e77f88c9860ed6d9eff8756488a Mon Sep 17 00:00:00 2001
From: Andrea Amorese
Date: Tue, 9 Nov 2021 11:08:24 +0100
Subject: [PATCH] Built motion from commit 529ebfd3.|2.5.37
---
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.events.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/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 +-
.../teamVoicePrefix/teamVoicePrefix.attributes.js | 2 +-
.../api/teamVoicePrefix/teamVoicePrefix.model.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 +-
.../userVoicePrefix/userVoicePrefix.attributes.js | 2 +-
.../api/userVoicePrefix/userVoicePrefix.model.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/safe-template.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/tvox.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 +-
1154 files changed, 1154 insertions(+), 1154 deletions(-)
diff --git a/apidoc/api_project.js b/apidoc/api_project.js
index fcec2f3..2a03b58 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-11-09T09:24:34.676Z",
+ "time": "2021-11-09T09:50:24.084Z",
"url": "http://apidocjs.com",
"version": "0.24.0"
}
diff --git a/apidoc/api_project.json b/apidoc/api_project.json
index e26f67f..0009905 100644
--- a/apidoc/api_project.json
+++ b/apidoc/api_project.json
@@ -17,7 +17,7 @@
"apidoc": "0.3.0",
"generator": {
"name": "apidoc",
- "time": "2021-11-09T09:24:34.676Z",
+ "time": "2021-11-09T09:50:24.084Z",
"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 b807415..364deb5 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 _0x52a6=['urlForward[headers],\x20browser[wsindowHeight]','urlForward[body]','sequelize','exports','getDataValue','action','contactManager','motionbar','urlForward','script','Allowed\x20values:\x20contactManager,\x20integration,\x20motionbar,\x20jscripty,\x20urlForward,\x20browser,\x20bot,\x20script','STRING','browser[location(0=NewTab,1=NewWindow,2=MotionTab)],\x20contactManager[autoCreateField]','urlForward[timeout],\x20browser[windowWidth],\x20contactManager[ignoreDialerContactId]'];(function(_0x35035e,_0x26bc1d){var _0x3a042f=function(_0x38d4e3){while(--_0x38d4e3){_0x35035e['push'](_0x35035e['shift']());}};_0x3a042f(++_0x26bc1d);}(_0x52a6,0x16e));var _0x652a=function(_0x50237b,_0x4ca696){_0x50237b=_0x50237b-0x0;var _0xd7ae74=_0x52a6[_0x50237b];return _0xd7ae74;};'use strict';var Sequelize=require(_0x652a('0x0'));module[_0x652a('0x1')]={'name':{'type':Sequelize['VIRTUAL'],'get':function(_0x2f6465){return this[_0x652a('0x2')](_0x652a('0x3'));}},'action':{'type':Sequelize['STRING'],'allowNull':![],'validate':{'isIn':{'args':[[_0x652a('0x4'),'integration',_0x652a('0x5'),'jscripty',_0x652a('0x6'),'browser','bot',_0x652a('0x7')]],'msg':_0x652a('0x8')}},'comment':_0x652a('0x8')},'data1':{'type':Sequelize[_0x652a('0x9')](0x1000),'comment':'jscripty[ProjectId],\x20browser[type(0=Popup,1=CTI\x20URL)],\x20contactManager[ListId],\x20urlForward[type(GET,POST,PUT,DELETE)],\x20script[info],\x20integration[intName(desk,dynamics365,freshdesk,freshsales,salesforce,sugarcrm,vtiger,zendesk,zoho)],\x20motionbar[type(0=Popup,1=CTI\x20URL,2=WinApp)]'},'data2':{'type':Sequelize[_0x652a('0x9')](0x1000),'comment':'contactManager[autoCreate(0=No,1=Yes)],\x20urlForward[URL],\x20script[type],\x20integration[AccountId],\x20motionbar[TemplateId,URL,WinAppPath],\x20browser[TemplateId,URL]'},'data3':{'type':Sequelize['STRING'](0x1000),'comment':'contactManager[searchFields],\x20script[script],\x20integration[ConfigurationId],\x20motionbar[NULL,eventVariables(0=No,1=Yes),WinAppArguments],\x20browser[NULL,eventVariables(0=No,1=Yes)]'},'data4':{'type':Sequelize['STRING'](0x1000),'comments':_0x652a('0xa')},'data5':{'type':Sequelize['STRING'](0x1000),'comments':_0x652a('0xb')},'data6':{'type':Sequelize[_0x652a('0x9')],'comments':_0x652a('0xc')},'data7':{'type':Sequelize['TEXT'],'comments':_0x652a('0xd')}};
\ No newline at end of file
+var _0x598d=['urlForward[timeout],\x20browser[windowWidth],\x20contactManager[ignoreDialerContactId]','urlForward[headers],\x20browser[wsindowHeight]','TEXT','urlForward[body]','sequelize','exports','VIRTUAL','getDataValue','contactManager','motionbar','urlForward','bot','script','Allowed\x20values:\x20contactManager,\x20integration,\x20motionbar,\x20jscripty,\x20urlForward,\x20browser,\x20bot,\x20script','STRING','jscripty[ProjectId],\x20browser[type(0=Popup,1=CTI\x20URL)],\x20contactManager[ListId],\x20urlForward[type(GET,POST,PUT,DELETE)],\x20script[info],\x20integration[intName(desk,dynamics365,freshdesk,freshsales,salesforce,sugarcrm,vtiger,zendesk,zoho)],\x20motionbar[type(0=Popup,1=CTI\x20URL,2=WinApp)]','contactManager[autoCreate(0=No,1=Yes)],\x20urlForward[URL],\x20script[type],\x20integration[AccountId],\x20motionbar[TemplateId,URL,WinAppPath],\x20browser[TemplateId,URL]','browser[location(0=NewTab,1=NewWindow,2=MotionTab)],\x20contactManager[autoCreateField]'];(function(_0x87d4df,_0xa67ee3){var _0x2cea8d=function(_0x5be174){while(--_0x5be174){_0x87d4df['push'](_0x87d4df['shift']());}};_0x2cea8d(++_0xa67ee3);}(_0x598d,0x190));var _0xd598=function(_0x14b622,_0xbf2f5){_0x14b622=_0x14b622-0x0;var _0x17b23b=_0x598d[_0x14b622];return _0x17b23b;};'use strict';var Sequelize=require(_0xd598('0x0'));module[_0xd598('0x1')]={'name':{'type':Sequelize[_0xd598('0x2')],'get':function(_0x58f591){return this[_0xd598('0x3')]('action');}},'action':{'type':Sequelize['STRING'],'allowNull':![],'validate':{'isIn':{'args':[[_0xd598('0x4'),'integration',_0xd598('0x5'),'jscripty',_0xd598('0x6'),'browser',_0xd598('0x7'),_0xd598('0x8')]],'msg':'Allowed\x20values:\x20contactManager,\x20integration,\x20motionbar,\x20jscripty,\x20urlForward,\x20browser,\x20bot,\x20script'}},'comment':_0xd598('0x9')},'data1':{'type':Sequelize[_0xd598('0xa')](0x1000),'comment':_0xd598('0xb')},'data2':{'type':Sequelize[_0xd598('0xa')](0x1000),'comment':_0xd598('0xc')},'data3':{'type':Sequelize[_0xd598('0xa')](0x1000),'comment':'contactManager[searchFields],\x20script[script],\x20integration[ConfigurationId],\x20motionbar[NULL,eventVariables(0=No,1=Yes),WinAppArguments],\x20browser[NULL,eventVariables(0=No,1=Yes)]'},'data4':{'type':Sequelize[_0xd598('0xa')](0x1000),'comments':_0xd598('0xd')},'data5':{'type':Sequelize[_0xd598('0xa')](0x1000),'comments':_0xd598('0xe')},'data6':{'type':Sequelize[_0xd598('0xa')],'comments':_0xd598('0xf')},'data7':{'type':Sequelize[_0xd598('0x10')],'comments':_0xd598('0x11')}};
\ No newline at end of file
diff --git a/server/api/action/action.controller.js b/server/api/action/action.controller.js
index a8ae00c..b0d4193 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 _0x33cb=['end','json','offset','limit','undefined','count','set','Content-Range','apply','reject','update','then','error','stack','name','send','body','Action','params','catch','destroy','find','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/advancedSearch','../../config/environment','../../config/license/util','../../mysqldb','status'];(function(_0x4a310d,_0x33322d){var _0x5eaf36=function(_0x233014){while(--_0x233014){_0x4a310d['push'](_0x4a310d['shift']());}};_0x5eaf36(++_0x33322d);}(_0x33cb,0x72));var _0xb33c=function(_0x1b3533,_0x4b056e){_0x1b3533=_0x1b3533-0x0;var _0x268c8b=_0x33cb[_0x1b3533];return _0x268c8b;};'use strict';var emlformat=require(_0xb33c('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xb33c('0x1'));var jsonpatch=require(_0xb33c('0x2'));var rp=require(_0xb33c('0x3'));var moment=require(_0xb33c('0x4'));var BPromise=require(_0xb33c('0x5'));var Mustache=require(_0xb33c('0x6'));var util=require(_0xb33c('0x7'));var path=require(_0xb33c('0x8'));var sox=require(_0xb33c('0x9'));var csv=require(_0xb33c('0xa'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xb33c('0xb'));var squel=require(_0xb33c('0xc'));var crypto=require(_0xb33c('0xd'));var jsforce=require(_0xb33c('0xe'));var deskjs=require(_0xb33c('0xf'));var toCsv=require(_0xb33c('0xa'));var querystring=require(_0xb33c('0x10'));var Papa=require(_0xb33c('0x11'));var Redis=require('ioredis');var authService=require(_0xb33c('0x12'));var qs=require('../../components/parsers/qs');var as=require(_0xb33c('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')('api');var utils=require('../../config/utils');var config=require(_0xb33c('0x14'));var licenseUtil=require(_0xb33c('0x15'));var db=require(_0xb33c('0x16'))['db'];function respondWithStatusCode(_0x466087,_0x180680){_0x180680=_0x180680||0xcc;return function(_0x580c92){if(_0x580c92){return _0x466087['sendStatus'](_0x180680);}return _0x466087[_0xb33c('0x17')](_0x180680)[_0xb33c('0x18')]();};}function respondWithResult(_0x5696c3,_0x560c48){_0x560c48=_0x560c48||0xc8;return function(_0x260ba8){if(_0x260ba8){return _0x5696c3[_0xb33c('0x17')](_0x560c48)[_0xb33c('0x19')](_0x260ba8);}};}function respondWithFilteredResult(_0xa626f8,_0x19a71f){return function(_0x5ec22a){if(_0x5ec22a){var _0x4ea774=typeof _0x19a71f[_0xb33c('0x1a')]==='undefined'&&typeof _0x19a71f[_0xb33c('0x1b')]===_0xb33c('0x1c');var _0x47f213=_0x5ec22a[_0xb33c('0x1d')];var _0x5689c4=_0x4ea774?0x0:_0x19a71f[_0xb33c('0x1a')];var _0x3d5bd2=_0x4ea774?_0x5ec22a[_0xb33c('0x1d')]:_0x19a71f[_0xb33c('0x1a')]+_0x19a71f[_0xb33c('0x1b')];var _0x465073;if(_0x3d5bd2>=_0x47f213){_0x3d5bd2=_0x47f213;_0x465073=0xc8;}else{_0x465073=0xce;}_0xa626f8['status'](_0x465073);return _0xa626f8[_0xb33c('0x1e')](_0xb33c('0x1f'),_0x5689c4+'-'+_0x3d5bd2+'/'+_0x47f213)[_0xb33c('0x19')](_0x5ec22a);}return null;};}function patchUpdates(_0x3507b9){return function(_0x2980a4){try{jsonpatch[_0xb33c('0x20')](_0x2980a4,_0x3507b9,!![]);}catch(_0x4dc92b){return BPromise[_0xb33c('0x21')](_0x4dc92b);}return _0x2980a4['save']();};}function saveUpdates(_0x284f41,_0x14c5c3){return function(_0x300854){if(_0x300854){return _0x300854[_0xb33c('0x22')](_0x284f41)[_0xb33c('0x23')](function(_0x5f091b){return _0x5f091b;});}return null;};}function removeEntity(_0x53ab98,_0x2a6332){return function(_0x3a77e1){if(_0x3a77e1){return _0x3a77e1['destroy']()[_0xb33c('0x23')](function(){_0x53ab98[_0xb33c('0x17')](0xcc)[_0xb33c('0x18')]();});}};}function handleEntityNotFound(_0x34bdae,_0x4f51a8){return function(_0x45e1af){if(!_0x45e1af){_0x34bdae['sendStatus'](0x194);}return _0x45e1af;};}function handleError(_0x539161,_0x5f298f){_0x5f298f=_0x5f298f||0x1f4;return function(_0x32d86e){logger[_0xb33c('0x24')](_0x32d86e[_0xb33c('0x25')]);if(_0x32d86e['name']){delete _0x32d86e[_0xb33c('0x26')];}_0x539161[_0xb33c('0x17')](_0x5f298f)[_0xb33c('0x27')](_0x32d86e);};}exports[_0xb33c('0x22')]=function(_0x192ee9,_0x263617){if(_0x192ee9[_0xb33c('0x28')]['id']){delete _0x192ee9[_0xb33c('0x28')]['id'];}return db[_0xb33c('0x29')]['find']({'where':{'id':_0x192ee9[_0xb33c('0x2a')]['id']}})[_0xb33c('0x23')](handleEntityNotFound(_0x263617,null))[_0xb33c('0x23')](saveUpdates(_0x192ee9[_0xb33c('0x28')],null))[_0xb33c('0x23')](respondWithResult(_0x263617,null))[_0xb33c('0x2b')](handleError(_0x263617,null));};exports[_0xb33c('0x2c')]=function(_0x3a7189,_0x145ac4){return db['Action'][_0xb33c('0x2d')]({'where':{'id':_0x3a7189[_0xb33c('0x2a')]['id']}})[_0xb33c('0x23')](handleEntityNotFound(_0x145ac4,null))[_0xb33c('0x23')](removeEntity(_0x145ac4,null))[_0xb33c('0x2b')](handleError(_0x145ac4,null));};
\ No newline at end of file
+var _0x5860=['save','update','destroy','then','stack','name','send','body','Action','find','catch','params','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/license/util','../../mysqldb','sendStatus','status','end','offset','undefined','limit','set','Content-Range','reject'];(function(_0xd9dd5e,_0x45b072){var _0x1e4351=function(_0x46e230){while(--_0x46e230){_0xd9dd5e['push'](_0xd9dd5e['shift']());}};_0x1e4351(++_0x45b072);}(_0x5860,0x155));var _0x0586=function(_0x4243a3,_0x447337){_0x4243a3=_0x4243a3-0x0;var _0x1b2a33=_0x5860[_0x4243a3];return _0x1b2a33;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x0586('0x0'));var jsonpatch=require(_0x0586('0x1'));var rp=require(_0x0586('0x2'));var moment=require(_0x0586('0x3'));var BPromise=require(_0x0586('0x4'));var Mustache=require(_0x0586('0x5'));var util=require(_0x0586('0x6'));var path=require(_0x0586('0x7'));var sox=require(_0x0586('0x8'));var csv=require(_0x0586('0x9'));var ejs=require(_0x0586('0xa'));var fs=require('fs');var fs_extra=require(_0x0586('0xb'));var _=require('lodash');var squel=require(_0x0586('0xc'));var crypto=require(_0x0586('0xd'));var jsforce=require(_0x0586('0xe'));var deskjs=require(_0x0586('0xf'));var toCsv=require('to-csv');var querystring=require(_0x0586('0x10'));var Papa=require(_0x0586('0x11'));var Redis=require(_0x0586('0x12'));var authService=require(_0x0586('0x13'));var qs=require(_0x0586('0x14'));var as=require(_0x0586('0x15'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x0586('0x16'))(_0x0586('0x17'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0x0586('0x18'));var db=require(_0x0586('0x19'))['db'];function respondWithStatusCode(_0x3e27ce,_0x572479){_0x572479=_0x572479||0xcc;return function(_0x5d10fd){if(_0x5d10fd){return _0x3e27ce[_0x0586('0x1a')](_0x572479);}return _0x3e27ce[_0x0586('0x1b')](_0x572479)[_0x0586('0x1c')]();};}function respondWithResult(_0x459690,_0x518100){_0x518100=_0x518100||0xc8;return function(_0x5eb87e){if(_0x5eb87e){return _0x459690['status'](_0x518100)['json'](_0x5eb87e);}};}function respondWithFilteredResult(_0x2c2403,_0x24cba9){return function(_0x190584){if(_0x190584){var _0x21e4df=typeof _0x24cba9[_0x0586('0x1d')]===_0x0586('0x1e')&&typeof _0x24cba9[_0x0586('0x1f')]==='undefined';var _0x2a3866=_0x190584['count'];var _0x24274d=_0x21e4df?0x0:_0x24cba9['offset'];var _0x4ee561=_0x21e4df?_0x190584['count']:_0x24cba9[_0x0586('0x1d')]+_0x24cba9[_0x0586('0x1f')];var _0x1604a7;if(_0x4ee561>=_0x2a3866){_0x4ee561=_0x2a3866;_0x1604a7=0xc8;}else{_0x1604a7=0xce;}_0x2c2403[_0x0586('0x1b')](_0x1604a7);return _0x2c2403[_0x0586('0x20')](_0x0586('0x21'),_0x24274d+'-'+_0x4ee561+'/'+_0x2a3866)['json'](_0x190584);}return null;};}function patchUpdates(_0x4bc04b){return function(_0x436279){try{jsonpatch['apply'](_0x436279,_0x4bc04b,!![]);}catch(_0x253acd){return BPromise[_0x0586('0x22')](_0x253acd);}return _0x436279[_0x0586('0x23')]();};}function saveUpdates(_0xf70706,_0x3f64b8){return function(_0x48b227){if(_0x48b227){return _0x48b227[_0x0586('0x24')](_0xf70706)['then'](function(_0x415108){return _0x415108;});}return null;};}function removeEntity(_0x41746e,_0x3560cd){return function(_0x89caaa){if(_0x89caaa){return _0x89caaa[_0x0586('0x25')]()[_0x0586('0x26')](function(){_0x41746e[_0x0586('0x1b')](0xcc)[_0x0586('0x1c')]();});}};}function handleEntityNotFound(_0x40cc7d,_0x5305a5){return function(_0x421ed5){if(!_0x421ed5){_0x40cc7d[_0x0586('0x1a')](0x194);}return _0x421ed5;};}function handleError(_0x27c51b,_0x350af0){_0x350af0=_0x350af0||0x1f4;return function(_0x3e7fe7){logger['error'](_0x3e7fe7[_0x0586('0x27')]);if(_0x3e7fe7[_0x0586('0x28')]){delete _0x3e7fe7[_0x0586('0x28')];}_0x27c51b[_0x0586('0x1b')](_0x350af0)[_0x0586('0x29')](_0x3e7fe7);};}exports[_0x0586('0x24')]=function(_0x42d61e,_0x42dc96){if(_0x42d61e['body']['id']){delete _0x42d61e[_0x0586('0x2a')]['id'];}return db[_0x0586('0x2b')][_0x0586('0x2c')]({'where':{'id':_0x42d61e['params']['id']}})[_0x0586('0x26')](handleEntityNotFound(_0x42dc96,null))[_0x0586('0x26')](saveUpdates(_0x42d61e[_0x0586('0x2a')],null))[_0x0586('0x26')](respondWithResult(_0x42dc96,null))[_0x0586('0x2d')](handleError(_0x42dc96,null));};exports[_0x0586('0x25')]=function(_0x197994,_0x69029c){return db[_0x0586('0x2b')][_0x0586('0x2c')]({'where':{'id':_0x197994[_0x0586('0x2e')]['id']}})[_0x0586('0x26')](handleEntityNotFound(_0x69029c,null))['then'](removeEntity(_0x69029c,null))[_0x0586('0x2d')](handleError(_0x69029c,null));};
\ No newline at end of file
diff --git a/server/api/action/action.model.js b/server/api/action/action.model.js
index 1112a93..cc31554 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 _0xc648=['../../config/logger','api','moment','bluebird','request-promise','path','exports','define','tools_actions','util'];(function(_0x3b5582,_0x378b12){var _0x1ffbfa=function(_0x1037bc){while(--_0x1037bc){_0x3b5582['push'](_0x3b5582['shift']());}};_0x1ffbfa(++_0x378b12);}(_0xc648,0x171));var _0x8c64=function(_0x32c8a1,_0x1bc3ef){_0x32c8a1=_0x32c8a1-0x0;var _0x6f2460=_0xc648[_0x32c8a1];return _0x6f2460;};'use strict';var _=require('lodash');var util=require(_0x8c64('0x0'));var logger=require(_0x8c64('0x1'))(_0x8c64('0x2'));var moment=require(_0x8c64('0x3'));var BPromise=require(_0x8c64('0x4'));var rp=require(_0x8c64('0x5'));var fs=require('fs');var path=require(_0x8c64('0x6'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require('./action.attributes');module[_0x8c64('0x7')]=function(_0x449786,_0xb31493){return _0x449786[_0x8c64('0x8')]('Action',attributes,{'tableName':_0x8c64('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x41d0=['../../config/environment','./action.attributes','exports','Action','tools_actions','lodash','util','../../config/logger','moment','path','rimraf'];(function(_0x18ab2a,_0x4debcd){var _0x16dcee=function(_0x10107a){while(--_0x10107a){_0x18ab2a['push'](_0x18ab2a['shift']());}};_0x16dcee(++_0x4debcd);}(_0x41d0,0x191));var _0x041d=function(_0x2158a8,_0x335f85){_0x2158a8=_0x2158a8-0x0;var _0x4b1071=_0x41d0[_0x2158a8];return _0x4b1071;};'use strict';var _=require(_0x041d('0x0'));var util=require(_0x041d('0x1'));var logger=require(_0x041d('0x2'))('api');var moment=require(_0x041d('0x3'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x041d('0x4'));var rimraf=require(_0x041d('0x5'));var config=require(_0x041d('0x6'));var attributes=require(_0x041d('0x7'));module[_0x041d('0x8')]=function(_0x16ce18,_0x566423){return _0x16ce18['define'](_0x041d('0x9'),attributes,{'tableName':_0x041d('0xa'),'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 02063e8..4f01f96 100644
--- a/server/api/action/action.rpc.js
+++ b/server/api/action/action.rpc.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x5fc3=['../../config/environment','jayson/promise','request','then','info','request\x20sent','debug','stringify','error','code','message','Action,\x20%s,\x20%s','result','catch','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc'];(function(_0x5bde9c,_0x4fe416){var _0x1943ba=function(_0x4954d2){while(--_0x4954d2){_0x5bde9c['push'](_0x5bde9c['shift']());}};_0x1943ba(++_0x4fe416);}(_0x5fc3,0xa8));var _0x35fc=function(_0x15c421,_0x6366f7){_0x15c421=_0x15c421-0x0;var _0x5e5ed5=_0x5fc3[_0x15c421];return _0x5e5ed5;};'use strict';var _=require(_0x35fc('0x0'));var util=require(_0x35fc('0x1'));var moment=require('moment');var BPromise=require(_0x35fc('0x2'));var rs=require(_0x35fc('0x3'));var fs=require('fs');var Redis=require(_0x35fc('0x4'));var db=require(_0x35fc('0x5'))['db'];var utils=require(_0x35fc('0x6'));var logger=require('../../config/logger')(_0x35fc('0x7'));var config=require(_0x35fc('0x8'));var jayson=require(_0x35fc('0x9'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x19a0d1,_0x508b32,_0x16e153){return new BPromise(function(_0x27524f,_0xc72d93){return client[_0x35fc('0xa')](_0x19a0d1,_0x16e153)[_0x35fc('0xb')](function(_0xf9d3a6){logger[_0x35fc('0xc')]('Action,\x20%s,\x20%s',_0x508b32,_0x35fc('0xd'));logger[_0x35fc('0xe')]('Action,\x20%s,\x20%s,\x20%s',_0x508b32,_0x35fc('0xd'),JSON[_0x35fc('0xf')](_0xf9d3a6));if(_0xf9d3a6['error']){if(_0xf9d3a6[_0x35fc('0x10')][_0x35fc('0x11')]===0x1f4){logger['error']('Action,\x20%s,\x20%s',_0x508b32,_0xf9d3a6[_0x35fc('0x10')]['message']);return _0xc72d93(_0xf9d3a6[_0x35fc('0x10')][_0x35fc('0x12')]);}logger[_0x35fc('0x10')](_0x35fc('0x13'),_0x508b32,_0xf9d3a6[_0x35fc('0x10')]['message']);return _0x27524f(_0xf9d3a6['error']['message']);}else{logger['info'](_0x35fc('0x13'),_0x508b32,_0x35fc('0xd'));_0x27524f(_0xf9d3a6[_0x35fc('0x14')][_0x35fc('0x12')]);}})[_0x35fc('0x15')](function(_0x1121fa){logger['error'](_0x35fc('0x13'),_0x508b32,_0x1121fa);_0xc72d93(_0x1121fa);});});}
\ No newline at end of file
+var _0x326f=['info','Action,\x20%s,\x20%s','request\x20sent','debug','error','code','message','result','catch','lodash','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client'];(function(_0x35753d,_0x5588a6){var _0x762e5c=function(_0x5648b6){while(--_0x5648b6){_0x35753d['push'](_0x35753d['shift']());}};_0x762e5c(++_0x5588a6);}(_0x326f,0xd1));var _0xf326=function(_0x376e68,_0x100437){_0x376e68=_0x376e68-0x0;var _0x37709b=_0x326f[_0x376e68];return _0x37709b;};'use strict';var _=require(_0xf326('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0xf326('0x1'));var rs=require(_0xf326('0x2'));var fs=require('fs');var Redis=require(_0xf326('0x3'));var db=require(_0xf326('0x4'))['db'];var utils=require(_0xf326('0x5'));var logger=require(_0xf326('0x6'))(_0xf326('0x7'));var config=require(_0xf326('0x8'));var jayson=require(_0xf326('0x9'));var client=jayson[_0xf326('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x3c254d,_0x3851eb,_0x165f95){return new BPromise(function(_0x1e7b8a,_0x515bfa){return client['request'](_0x3c254d,_0x165f95)['then'](function(_0x3bacf2){logger[_0xf326('0xb')](_0xf326('0xc'),_0x3851eb,_0xf326('0xd'));logger[_0xf326('0xe')]('Action,\x20%s,\x20%s,\x20%s',_0x3851eb,_0xf326('0xd'),JSON['stringify'](_0x3bacf2));if(_0x3bacf2[_0xf326('0xf')]){if(_0x3bacf2['error'][_0xf326('0x10')]===0x1f4){logger['error'](_0xf326('0xc'),_0x3851eb,_0x3bacf2[_0xf326('0xf')]['message']);return _0x515bfa(_0x3bacf2[_0xf326('0xf')][_0xf326('0x11')]);}logger[_0xf326('0xf')](_0xf326('0xc'),_0x3851eb,_0x3bacf2['error'][_0xf326('0x11')]);return _0x1e7b8a(_0x3bacf2['error']['message']);}else{logger[_0xf326('0xb')](_0xf326('0xc'),_0x3851eb,_0xf326('0xd'));_0x1e7b8a(_0x3bacf2[_0xf326('0x12')][_0xf326('0x11')]);}})[_0xf326('0x13')](function(_0x34128e){logger[_0xf326('0xf')]('Action,\x20%s,\x20%s',_0x3851eb,_0x34128e);_0x515bfa(_0x34128e);});});}
\ No newline at end of file
diff --git a/server/api/action/index.js b/server/api/action/index.js
index 1d7c0a8..6987b1c 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 _0xe775=['connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./action.controller','put','/:id','isAuthenticated','destroy','multer','path'];(function(_0x4c3ece,_0x57053e){var _0x409c1d=function(_0x411a3b){while(--_0x411a3b){_0x4c3ece['push'](_0x4c3ece['shift']());}};_0x409c1d(++_0x57053e);}(_0xe775,0x124));var _0x5e77=function(_0x30f5bb,_0x4db4bd){_0x30f5bb=_0x30f5bb-0x0;var _0x1cfc00=_0xe775[_0x30f5bb];return _0x1cfc00;};'use strict';var multer=require(_0x5e77('0x0'));var util=require('util');var path=require(_0x5e77('0x1'));var timeout=require(_0x5e77('0x2'));var express=require(_0x5e77('0x3'));var router=express[_0x5e77('0x4')]();var fs_extra=require(_0x5e77('0x5'));var auth=require(_0x5e77('0x6'));var interaction=require(_0x5e77('0x7'));var config=require(_0x5e77('0x8'));var controller=require(_0x5e77('0x9'));router[_0x5e77('0xa')](_0x5e77('0xb'),auth[_0x5e77('0xc')](),controller['update']);router['delete']('/:id',auth[_0x5e77('0xc')](),controller[_0x5e77('0xd')]);module['exports']=router;
\ No newline at end of file
+var _0xbd9e=['../../config/environment','put','isAuthenticated','update','delete','destroy','multer','util','path','connect-timeout','express','Router','../../components/interaction/service'];(function(_0x1ed735,_0x427bc1){var _0x465b2d=function(_0xf24129){while(--_0xf24129){_0x1ed735['push'](_0x1ed735['shift']());}};_0x465b2d(++_0x427bc1);}(_0xbd9e,0x165));var _0xebd9=function(_0x33032e,_0x31411a){_0x33032e=_0x33032e-0x0;var _0x13316b=_0xbd9e[_0x33032e];return _0x13316b;};'use strict';var multer=require(_0xebd9('0x0'));var util=require(_0xebd9('0x1'));var path=require(_0xebd9('0x2'));var timeout=require(_0xebd9('0x3'));var express=require(_0xebd9('0x4'));var router=express[_0xebd9('0x5')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0xebd9('0x6'));var config=require(_0xebd9('0x7'));var controller=require('./action.controller');router[_0xebd9('0x8')]('/:id',auth[_0xebd9('0x9')](),controller[_0xebd9('0xa')]);router[_0xebd9('0xb')]('/:id',auth[_0xebd9('0x9')](),controller[_0xebd9('0xc')]);module['exports']=router;
\ No newline at end of file
diff --git a/server/api/analyticCustomReport/analyticCustomReport.attributes.js b/server/api/analyticCustomReport/analyticCustomReport.attributes.js
index c55cd9a..748551b 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 _0x814b=['STRING','TEXT','sequelize','exports'];(function(_0x241af1,_0xf80087){var _0x5bdfee=function(_0x280f5e){while(--_0x280f5e){_0x241af1['push'](_0x241af1['shift']());}};_0x5bdfee(++_0xf80087);}(_0x814b,0x1a2));var _0xb814=function(_0x5d6e35,_0x4d1ac0){_0x5d6e35=_0x5d6e35-0x0;var _0x5d7ada=_0x814b[_0x5d6e35];return _0x5d7ada;};'use strict';var Sequelize=require(_0xb814('0x0'));module[_0xb814('0x1')]={'name':{'type':Sequelize[_0xb814('0x2')],'allowNull':![]},'description':{'type':Sequelize[_0xb814('0x2')]},'parent':{'type':Sequelize[_0xb814('0x2')]},'table':{'type':Sequelize[_0xb814('0x2')]},'conditions':{'type':Sequelize['TEXT']},'joins':{'type':Sequelize[_0xb814('0x3')]}};
\ No newline at end of file
+var _0x3eea=['STRING','TEXT','sequelize'];(function(_0x43a9d2,_0x293d10){var _0x2b443e=function(_0xa5426f){while(--_0xa5426f){_0x43a9d2['push'](_0x43a9d2['shift']());}};_0x2b443e(++_0x293d10);}(_0x3eea,0x1ca));var _0xa3ee=function(_0x4451da,_0x5ead4e){_0x4451da=_0x4451da-0x0;var _0x39d1ed=_0x3eea[_0x4451da];return _0x39d1ed;};'use strict';var Sequelize=require(_0xa3ee('0x0'));module['exports']={'name':{'type':Sequelize[_0xa3ee('0x1')],'allowNull':![]},'description':{'type':Sequelize[_0xa3ee('0x1')]},'parent':{'type':Sequelize[_0xa3ee('0x1')]},'table':{'type':Sequelize[_0xa3ee('0x1')]},'conditions':{'type':Sequelize[_0xa3ee('0x2')]},'joins':{'type':Sequelize[_0xa3ee('0x2')]}};
\ No newline at end of file
diff --git a/server/api/analyticCustomReport/analyticCustomReport.controller.js b/server/api/analyticCustomReport/analyticCustomReport.controller.js
index 32f80bf..0d6eb75 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 _0xece1=['count','offset','Content-Range','apply','save','update','then','destroy','get','CustomReports','error','stack','name','send','index','map','AnalyticCustomReport','fieldName','type','key','model','query','keys','intersection','attributes','fields','hasOwnProperty','nolimit','where','filters','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','rawAttributes','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','Reports','UserProfileSection','userProfileId','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','params','preview','join','right_join','cross_join','SUM(%s)','COUNT(%s)','MIN(%s)','AVG(%s)','GROUP_CONCAT(%s)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)','SEC_TO_TIME(%s)','ROUND(%s)','UNIX_TIMESTAMP(%s)','includes','IS\x20NOT\x20NULL','IS\x20NOT\x20EMPTY','rules','length','field','condition','value','Sequelize','Please\x20insert\x20at\x20least\x20one\x20field','AnalyticMetric','keyBy','from','table','MetricId','metric','function','replace','format','orderBy','order','DESC','alias','joins','parse','parentKey','foreignTable','foreignKey','%s.%s\x20=\x20%s.%s','conditions','group','debug','Limited\x20Query:','sequelize','toString','SELECT','left_join','COUNT(DISTINCT\x20%s)','MAX(%s)','DATE(%s)','HOUR(%s)','IS\x20NULL','IS\x20EMPTY','getFields','ValidationErrorItem','select','clone','web','%s-%s.%s','randomstring','generate','output','AnalyticExtractedReport','cdr','.calldate\x20BETWEEN\x20?\x20AND\x20?','startDate','.createdAt\x20BETWEEN\x20?\x20AND\x20?','endDate','info','Run\x20Query:','child_process','fork','../../components/export/','savename','COUNT(*)','QueryTypes','runReport','operator','groupBy','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','ejs','fs-extra','desk.js','to-csv','querystring','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/license/util','dbH','sendStatus','status','end','json','undefined','limit'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xece1,0x89));var _0x1ece=function(_0x3874e2,_0x41d10b){_0x3874e2=_0x3874e2-0x0;var _0x4f3893=_0xece1[_0x3874e2];return _0x4f3893;};'use strict';var emlformat=require(_0x1ece('0x0'));var rimraf=require(_0x1ece('0x1'));var zipdir=require(_0x1ece('0x2'));var jsonpatch=require(_0x1ece('0x3'));var rp=require(_0x1ece('0x4'));var moment=require(_0x1ece('0x5'));var BPromise=require(_0x1ece('0x6'));var Mustache=require(_0x1ece('0x7'));var util=require(_0x1ece('0x8'));var path=require(_0x1ece('0x9'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x1ece('0xa'));var fs=require('fs');var fs_extra=require(_0x1ece('0xb'));var _=require('lodash');var squel=require('squel');var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x1ece('0xc'));var toCsv=require(_0x1ece('0xd'));var querystring=require(_0x1ece('0xe'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x1ece('0xf'));var qs=require(_0x1ece('0x10'));var as=require(_0x1ece('0x11'));var hardwareService=require(_0x1ece('0x12'));var logger=require(_0x1ece('0x13'))('api');var utils=require(_0x1ece('0x14'));var config=require('../../config/environment');var licenseUtil=require(_0x1ece('0x15'));var db=require('../../mysqldb')['db'];var dbH=require('../../mysqldb')[_0x1ece('0x16')];function respondWithStatusCode(_0x20bce5,_0x53b755){_0x53b755=_0x53b755||0xcc;return function(_0x33133b){if(_0x33133b){return _0x20bce5[_0x1ece('0x17')](_0x53b755);}return _0x20bce5[_0x1ece('0x18')](_0x53b755)[_0x1ece('0x19')]();};}function respondWithResult(_0x2beca4,_0x461bae){_0x461bae=_0x461bae||0xc8;return function(_0x398a99){if(_0x398a99){return _0x2beca4[_0x1ece('0x18')](_0x461bae)[_0x1ece('0x1a')](_0x398a99);}};}function respondWithFilteredResult(_0x1d9a70,_0x13fea3){return function(_0x38b65a){if(_0x38b65a){var _0xbb1d21=typeof _0x13fea3['offset']===_0x1ece('0x1b')&&typeof _0x13fea3[_0x1ece('0x1c')]===_0x1ece('0x1b');var _0x1e37c2=_0x38b65a[_0x1ece('0x1d')];var _0x5e6797=_0xbb1d21?0x0:_0x13fea3[_0x1ece('0x1e')];var _0xab18ba=_0xbb1d21?_0x38b65a[_0x1ece('0x1d')]:_0x13fea3[_0x1ece('0x1e')]+_0x13fea3[_0x1ece('0x1c')];var _0x5152f2;if(_0xab18ba>=_0x1e37c2){_0xab18ba=_0x1e37c2;_0x5152f2=0xc8;}else{_0x5152f2=0xce;}_0x1d9a70[_0x1ece('0x18')](_0x5152f2);return _0x1d9a70['set'](_0x1ece('0x1f'),_0x5e6797+'-'+_0xab18ba+'/'+_0x1e37c2)[_0x1ece('0x1a')](_0x38b65a);}return null;};}function patchUpdates(_0x31eff8){return function(_0x175097){try{jsonpatch[_0x1ece('0x20')](_0x175097,_0x31eff8,!![]);}catch(_0x2cd0ec){return BPromise['reject'](_0x2cd0ec);}return _0x175097[_0x1ece('0x21')]();};}function saveUpdates(_0x47b491,_0x53baaf){return function(_0x7ad145){if(_0x7ad145){return _0x7ad145[_0x1ece('0x22')](_0x47b491)[_0x1ece('0x23')](function(_0x27d728){return _0x27d728;});}return null;};}function removeEntity(_0x2dd313,_0x622071){return function(_0x5d0763){if(_0x5d0763){return _0x5d0763[_0x1ece('0x24')]()[_0x1ece('0x23')](function(){var _0x3092aa=_0x5d0763[_0x1ece('0x25')]({'plain':!![]});var _0x1a2a4b=_0x1ece('0x26');return db['UserProfileResource'][_0x1ece('0x24')]({'where':{'type':_0x1a2a4b,'resourceId':_0x3092aa['id']}})[_0x1ece('0x23')](function(){return _0x5d0763;});})[_0x1ece('0x23')](function(){_0x2dd313['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0xfcd37d,_0x3998c8){return function(_0x53bc13){if(!_0x53bc13){_0xfcd37d['sendStatus'](0x194);}return _0x53bc13;};}function handleError(_0x19b355,_0xef7598){_0xef7598=_0xef7598||0x1f4;return function(_0x2b95e3){logger[_0x1ece('0x27')](_0x2b95e3[_0x1ece('0x28')]);if(_0x2b95e3[_0x1ece('0x29')]){delete _0x2b95e3[_0x1ece('0x29')];}_0x19b355[_0x1ece('0x18')](_0xef7598)[_0x1ece('0x2a')](_0x2b95e3);};}exports[_0x1ece('0x2b')]=function(_0x90dd81,_0x490acc){var _0x579b7b={},_0x597037={},_0x777c81={'count':0x0,'rows':[]};var _0x382511=_[_0x1ece('0x2c')](db[_0x1ece('0x2d')]['rawAttributes'],function(_0x31ff00){return{'name':_0x31ff00[_0x1ece('0x2e')],'type':_0x31ff00[_0x1ece('0x2f')][_0x1ece('0x30')]};});_0x597037[_0x1ece('0x31')]=_['map'](_0x382511,_0x1ece('0x29'));_0x597037[_0x1ece('0x32')]=_[_0x1ece('0x33')](_0x90dd81[_0x1ece('0x32')]);_0x597037['filters']=_[_0x1ece('0x34')](_0x597037[_0x1ece('0x31')],_0x597037[_0x1ece('0x32')]);_0x579b7b[_0x1ece('0x35')]=_[_0x1ece('0x34')](_0x597037[_0x1ece('0x31')],qs[_0x1ece('0x36')](_0x90dd81[_0x1ece('0x32')]['fields']));_0x579b7b['attributes']=_0x579b7b[_0x1ece('0x35')]['length']?_0x579b7b[_0x1ece('0x35')]:_0x597037['model'];if(!_0x90dd81[_0x1ece('0x32')][_0x1ece('0x37')](_0x1ece('0x38'))){_0x579b7b[_0x1ece('0x1c')]=qs[_0x1ece('0x1c')](_0x90dd81[_0x1ece('0x32')][_0x1ece('0x1c')]);_0x579b7b[_0x1ece('0x1e')]=qs[_0x1ece('0x1e')](_0x90dd81[_0x1ece('0x32')][_0x1ece('0x1e')]);}_0x579b7b['order']=qs['sort'](_0x90dd81['query']['sort']);_0x579b7b[_0x1ece('0x39')]=qs[_0x1ece('0x3a')](_[_0x1ece('0x3b')](_0x90dd81[_0x1ece('0x32')],_0x597037[_0x1ece('0x3a')]),_0x382511);if(_0x90dd81['query'][_0x1ece('0x3c')]){_0x579b7b[_0x1ece('0x39')]=_[_0x1ece('0x3d')](_0x579b7b[_0x1ece('0x39')],{'$or':_['map'](_0x382511,function(_0x398f9a){if(_0x398f9a[_0x1ece('0x2f')]!==_0x1ece('0x3e')){var _0x2ac9e3={};_0x2ac9e3[_0x398f9a[_0x1ece('0x29')]]={'$like':'%'+_0x90dd81['query']['filter']+'%'};return _0x2ac9e3;}})});}_0x579b7b=_[_0x1ece('0x3d')]({},_0x579b7b,_0x90dd81[_0x1ece('0x3f')]);var _0x308065={'where':_0x579b7b[_0x1ece('0x39')]};return db['AnalyticCustomReport'][_0x1ece('0x1d')](_0x308065)[_0x1ece('0x23')](function(_0x233005){_0x777c81[_0x1ece('0x1d')]=_0x233005;if(_0x90dd81[_0x1ece('0x32')][_0x1ece('0x40')]){_0x579b7b[_0x1ece('0x41')]=[{'all':!![]}];}return db[_0x1ece('0x2d')][_0x1ece('0x42')](_0x579b7b);})[_0x1ece('0x23')](function(_0x4f34a8){_0x777c81[_0x1ece('0x43')]=_0x4f34a8;return _0x777c81;})[_0x1ece('0x23')](respondWithFilteredResult(_0x490acc,_0x579b7b))[_0x1ece('0x44')](handleError(_0x490acc,null));};exports[_0x1ece('0x45')]=function(_0x2d5a12,_0x179ff6){var _0xe42606={'raw':![],'where':{'id':_0x2d5a12['params']['id']}},_0x5b8cbe={};_0x5b8cbe[_0x1ece('0x31')]=_[_0x1ece('0x33')](db[_0x1ece('0x2d')][_0x1ece('0x46')]);_0x5b8cbe[_0x1ece('0x32')]=_['keys'](_0x2d5a12[_0x1ece('0x32')]);_0x5b8cbe[_0x1ece('0x3a')]=_[_0x1ece('0x34')](_0x5b8cbe['model'],_0x5b8cbe['query']);_0xe42606['attributes']=_[_0x1ece('0x34')](_0x5b8cbe[_0x1ece('0x31')],qs[_0x1ece('0x36')](_0x2d5a12[_0x1ece('0x32')][_0x1ece('0x36')]));_0xe42606[_0x1ece('0x35')]=_0xe42606['attributes']['length']?_0xe42606[_0x1ece('0x35')]:_0x5b8cbe['model'];if(_0x2d5a12[_0x1ece('0x32')][_0x1ece('0x40')]){_0xe42606[_0x1ece('0x41')]=[{'all':!![]}];}_0xe42606=_[_0x1ece('0x3d')]({},_0xe42606,_0x2d5a12['options']);return db['AnalyticCustomReport'][_0x1ece('0x47')](_0xe42606)['then'](handleEntityNotFound(_0x179ff6,null))[_0x1ece('0x23')](respondWithResult(_0x179ff6,null))[_0x1ece('0x44')](handleError(_0x179ff6,null));};exports[_0x1ece('0x48')]=function(_0x3b0cfd,_0x4ac792){return db[_0x1ece('0x2d')]['create'](_0x3b0cfd[_0x1ece('0x49')],{})['then'](function(_0x4803e8){var _0x21981a=_0x3b0cfd[_0x1ece('0x4a')][_0x1ece('0x25')]({'plain':!![]});if(!_0x21981a)throw new Error(_0x1ece('0x4b'));if(_0x21981a['role']==='user'){var _0x385bf9=_0x4803e8[_0x1ece('0x25')]({'plain':!![]});var _0x359fef=_0x1ece('0x4c');return db[_0x1ece('0x4d')][_0x1ece('0x47')]({'where':{'name':_0x359fef,'userProfileId':_0x21981a[_0x1ece('0x4e')]},'raw':!![]})[_0x1ece('0x23')](function(_0x493287){if(_0x493287&&_0x493287[_0x1ece('0x4f')]===0x0){return db[_0x1ece('0x50')][_0x1ece('0x48')]({'name':_0x385bf9[_0x1ece('0x29')],'resourceId':_0x385bf9['id'],'type':'CustomReports','sectionId':_0x493287['id']},{})['then'](function(){return _0x4803e8;});}else{return _0x4803e8;}})['catch'](function(_0x4bb239){logger[_0x1ece('0x27')](_0x1ece('0x51'),_0x4bb239);throw _0x4bb239;});}return _0x4803e8;})[_0x1ece('0x23')](respondWithResult(_0x4ac792,0xc9))[_0x1ece('0x44')](handleError(_0x4ac792,null));};exports[_0x1ece('0x22')]=function(_0x433326,_0x5e0a6f){if(_0x433326[_0x1ece('0x49')]['id']){delete _0x433326[_0x1ece('0x49')]['id'];}return db[_0x1ece('0x2d')]['find']({'where':{'id':_0x433326['params']['id']}})[_0x1ece('0x23')](handleEntityNotFound(_0x5e0a6f,null))[_0x1ece('0x23')](saveUpdates(_0x433326['body'],null))['then'](respondWithResult(_0x5e0a6f,null))[_0x1ece('0x44')](handleError(_0x5e0a6f,null));};exports[_0x1ece('0x24')]=function(_0x5cf170,_0x11f402){return db[_0x1ece('0x2d')][_0x1ece('0x47')]({'where':{'id':_0x5cf170[_0x1ece('0x52')]['id']}})[_0x1ece('0x23')](handleEntityNotFound(_0x11f402,null))[_0x1ece('0x23')](removeEntity(_0x11f402,null))['catch'](handleError(_0x11f402,null));};exports[_0x1ece('0x53')]=function(_0x291808,_0x53d8e2){var _0x5ad8de=0xa;var _0xf0a71b=[_0x1ece('0x54'),'left_join',_0x1ece('0x55'),_0x1ece('0x56')];var _0x235fb2={'SUM':_0x1ece('0x57'),'COUNT':_0x1ece('0x58'),'COUNT DISTINCT':'COUNT(DISTINCT\x20%s)','MAX':'MAX(%s)','MIN':_0x1ece('0x59'),'AVG':_0x1ece('0x5a'),'GROUP_CONCAT':_0x1ece('0x5b'),'GROUP_CONCAT ASC':_0x1ece('0x5c'),'GROUP_CONCAT DESC':_0x1ece('0x5d')};var _0x306557={'SEC_TO_TIME':_0x1ece('0x5e'),'DATE':'DATE(%s)','HOUR':'HOUR(%s)','ROUND':_0x1ece('0x5f'),'UNIX_TIMESTAMP':_0x1ece('0x60')};var _0x314404=function(_0x5a542a){return!_[_0x1ece('0x61')](['IS\x20NULL',_0x1ece('0x62'),'IS\x20EMPTY',_0x1ece('0x63')],_0x5a542a);};var _0x4ddcf7=function(_0x3d32b8){if(!_0x3d32b8||!_0x3d32b8['rules']['length']){return'';}for(var _0x2a8b91='(',_0x4cbb72=0x0;_0x4cbb72<_0x3d32b8[_0x1ece('0x64')][_0x1ece('0x65')];_0x4cbb72+=0x1){_0x4cbb72>0x0&&(_0x2a8b91+='\x20'+_0x3d32b8['operator']+'\x20');_0x2a8b91+=_0x3d32b8[_0x1ece('0x64')][_0x4cbb72]['group']?_0x4ddcf7(_0x3d32b8[_0x1ece('0x64')][_0x4cbb72]['group']):_0x3d32b8['rules'][_0x4cbb72][_0x1ece('0x66')]+'\x20'+_0x3d32b8[_0x1ece('0x64')][_0x4cbb72][_0x1ece('0x67')]+(_0x314404(_0x3d32b8[_0x1ece('0x64')][_0x4cbb72][_0x1ece('0x67')])?'\x20'+_0x3d32b8[_0x1ece('0x64')][_0x4cbb72][_0x1ece('0x68')]:'');}return _0x2a8b91+')';};var _0x2e8b80={'where':{'id':_0x291808[_0x1ece('0x52')]['id']}},_0x5ef8af,_0x4ca3b4,_0x59daff,_0x4ae34d,_0x396dbb;_0x2e8b80=_[_0x1ece('0x3d')]({},_0x2e8b80,_0x291808[_0x1ece('0x3f')]);return db[_0x1ece('0x2d')][_0x1ece('0x47')](_0x2e8b80)['then'](function(_0x300b6e){if(_0x300b6e){_0x5ef8af=_0x300b6e;return _0x300b6e['getFields']();}return null;})['then'](function(_0x66b5b4){if(_0x66b5b4){if(!_0x66b5b4[_0x1ece('0x65')]){throw new db[(_0x1ece('0x69'))]['ValidationErrorItem'](_0x1ece('0x6a'),0x193);}_0x4ca3b4=_0x66b5b4;return db[_0x1ece('0x6b')][_0x1ece('0x42')]({'raw':!![]});}return null;})[_0x1ece('0x23')](function(_0x800de8){if(_0x800de8){_0x59daff=_[_0x1ece('0x6c')](_0x800de8,'id');var _0x8c80ce;var _0x34f1e0=squel['select']();_0x34f1e0[_0x1ece('0x6d')](_0x5ef8af[_0x1ece('0x6e')]);for(var _0x2a360d=0x0;_0x2a360d<_0x4ca3b4[_0x1ece('0x65')];_0x2a360d+=0x1){_0x8c80ce=_0x4ca3b4[_0x2a360d]['MetricId']?_0x59daff[_0x4ca3b4[_0x2a360d][_0x1ece('0x6f')]][_0x1ece('0x70')]:_0x4ca3b4[_0x2a360d][_0x1ece('0x66')];_0x8c80ce=_0x4ca3b4[_0x2a360d][_0x1ece('0x71')]?_[_0x1ece('0x72')](_0x235fb2[_0x4ca3b4[_0x2a360d][_0x1ece('0x71')]],'%s',_0x8c80ce):_0x8c80ce;_0x8c80ce=_0x4ca3b4[_0x2a360d][_0x1ece('0x73')]?_[_0x1ece('0x72')](_0x306557[_0x4ca3b4[_0x2a360d]['format']],'%s',_0x8c80ce):_0x8c80ce;if(_0x4ca3b4[_0x2a360d]['groupBy']){_0x34f1e0['group'](_0x8c80ce);}_0x4ca3b4[_0x2a360d][_0x1ece('0x74')]&&_0x34f1e0[_0x1ece('0x75')](_0x8c80ce,_0x4ca3b4[_0x2a360d][_0x1ece('0x74')]===_0x1ece('0x76')?![]:!![]);_0x34f1e0[_0x1ece('0x66')](_0x8c80ce,_0x4ca3b4[_0x2a360d][_0x1ece('0x77')]||_0x8c80ce);}if(_0x5ef8af[_0x1ece('0x78')]){_0x5ef8af[_0x1ece('0x78')]=JSON[_0x1ece('0x79')](_0x5ef8af[_0x1ece('0x78')]);for(var _0x4e0aef=0x0;_0x4e0aef<_0x5ef8af[_0x1ece('0x78')]['length'];_0x4e0aef+=0x1){if(_0x5ef8af[_0x1ece('0x78')][_0x4e0aef][_0x1ece('0x2f')]&&_[_0x1ece('0x61')](_0xf0a71b,_0x5ef8af[_0x1ece('0x78')][_0x4e0aef]['type'])&&_0x5ef8af[_0x1ece('0x78')][_0x4e0aef][_0x1ece('0x7a')]&&_0x5ef8af[_0x1ece('0x78')][_0x4e0aef][_0x1ece('0x7b')]&&_0x5ef8af['joins'][_0x4e0aef][_0x1ece('0x7c')]){_0x34f1e0[_0x5ef8af[_0x1ece('0x78')][_0x4e0aef]['type']](_0x5ef8af[_0x1ece('0x78')][_0x4e0aef]['foreignTable'],null,util[_0x1ece('0x73')](_0x1ece('0x7d'),_0x5ef8af[_0x1ece('0x6e')],_0x5ef8af[_0x1ece('0x78')][_0x4e0aef][_0x1ece('0x7a')],_0x5ef8af['joins'][_0x4e0aef][_0x1ece('0x7b')],_0x5ef8af[_0x1ece('0x78')][_0x4e0aef][_0x1ece('0x7c')]));}}}if(_0x5ef8af['conditions']){_0x5ef8af[_0x1ece('0x7e')]=JSON[_0x1ece('0x79')](_0x5ef8af['conditions']);_0x34f1e0['where'](_0x4ddcf7(_0x5ef8af[_0x1ece('0x7e')][_0x1ece('0x7f')]));}_0x396dbb=_0x34f1e0['clone']();_0x34f1e0[_0x1ece('0x1c')](_0x5ad8de);_0x34f1e0[_0x1ece('0x1e')](0x0);logger[_0x1ece('0x80')](_0x1ece('0x81'),_0x34f1e0['toString']());return dbH[_0x1ece('0x82')][_0x1ece('0x32')](_0x34f1e0[_0x1ece('0x83')](),{'type':dbH[_0x1ece('0x82')]['QueryTypes'][_0x1ece('0x84')]});}})['then'](respondWithResult(_0x53d8e2,null))['catch'](handleError(_0x53d8e2,null));};function runReport(_0x301e5c,_0x3e2881,_0x3e4bcf){var _0x10c179=_0x3e2881[_0x1ece('0x29')];var _0x5df8f5=0xa;var _0x5d97d7=[_0x1ece('0x54'),_0x1ece('0x85'),_0x1ece('0x55'),_0x1ece('0x56')];var _0x1476cd={'SUM':_0x1ece('0x57'),'COUNT':_0x1ece('0x58'),'COUNT DISTINCT':_0x1ece('0x86'),'MAX':_0x1ece('0x87'),'MIN':'MIN(%s)','AVG':_0x1ece('0x5a'),'GROUP_CONCAT':_0x1ece('0x5b'),'GROUP_CONCAT ASC':_0x1ece('0x5c'),'GROUP_CONCAT DESC':_0x1ece('0x5d')};var _0x3cbf47={'SEC_TO_TIME':_0x1ece('0x5e'),'DATE':_0x1ece('0x88'),'HOUR':_0x1ece('0x89'),'ROUND':_0x1ece('0x5f'),'UNIX_TIMESTAMP':_0x1ece('0x60')};var _0x1496ef=function(_0x7b34f9){return!_['includes']([_0x1ece('0x8a'),'IS\x20NOT\x20NULL',_0x1ece('0x8b'),_0x1ece('0x63')],_0x7b34f9);};var _0x3d300a=function(_0x6b0923){if(!_0x6b0923||!_0x6b0923[_0x1ece('0x64')][_0x1ece('0x65')]){return'';}for(var _0x49b61a='(',_0x15b5dd=0x0;_0x15b5dd<_0x6b0923[_0x1ece('0x64')]['length'];_0x15b5dd+=0x1){_0x15b5dd>0x0&&(_0x49b61a+='\x20'+_0x6b0923['operator']+'\x20');_0x49b61a+=_0x6b0923[_0x1ece('0x64')][_0x15b5dd]['group']?_0x3d300a(_0x6b0923['rules'][_0x15b5dd][_0x1ece('0x7f')]):_0x6b0923[_0x1ece('0x64')][_0x15b5dd][_0x1ece('0x66')]+'\x20'+_0x6b0923[_0x1ece('0x64')][_0x15b5dd]['condition']+(_0x1496ef(_0x6b0923['rules'][_0x15b5dd][_0x1ece('0x67')])?'\x20'+_0x6b0923[_0x1ece('0x64')][_0x15b5dd][_0x1ece('0x68')]:'');}return _0x49b61a+')';};var _0x2364f7={'where':{'id':_0x301e5c['id']}},_0x5e8915,_0x5d9c2a,_0x231476,_0x55ae3b,_0x19c692;_0x2364f7=_[_0x1ece('0x3d')]({},_0x2364f7,_0x3e4bcf);return db[_0x1ece('0x2d')][_0x1ece('0x47')](_0x2364f7)['then'](function(_0x516ca6){if(_0x516ca6){_0x5e8915=_0x516ca6;return _0x516ca6[_0x1ece('0x8c')]();}return null;})[_0x1ece('0x23')](function(_0x2c2f6b){if(_0x2c2f6b){if(!_0x2c2f6b[_0x1ece('0x65')]){throw new db[(_0x1ece('0x69'))][(_0x1ece('0x8d'))]('Please\x20insert\x20at\x20least\x20one\x20field',0x193);}_0x5d9c2a=_0x2c2f6b;return db[_0x1ece('0x6b')][_0x1ece('0x42')]({'raw':!![]});}return null;})[_0x1ece('0x23')](function(_0x4cde6a){if(_0x4cde6a){_0x231476=_[_0x1ece('0x6c')](_0x4cde6a,'id');var _0x521e63;var _0x1ebb6c=squel[_0x1ece('0x8e')]();_0x1ebb6c[_0x1ece('0x6d')](_0x5e8915['table']);for(var _0x2b0956=0x0;_0x2b0956<_0x5d9c2a[_0x1ece('0x65')];_0x2b0956+=0x1){_0x521e63=_0x5d9c2a[_0x2b0956]['MetricId']?_0x231476[_0x5d9c2a[_0x2b0956][_0x1ece('0x6f')]][_0x1ece('0x70')]:_0x5d9c2a[_0x2b0956]['field'];_0x521e63=_0x5d9c2a[_0x2b0956]['function']?_[_0x1ece('0x72')](_0x1476cd[_0x5d9c2a[_0x2b0956]['function']],'%s',_0x521e63):_0x521e63;_0x521e63=_0x5d9c2a[_0x2b0956]['format']?_[_0x1ece('0x72')](_0x3cbf47[_0x5d9c2a[_0x2b0956][_0x1ece('0x73')]],'%s',_0x521e63):_0x521e63;if(_0x5d9c2a[_0x2b0956]['groupBy']){_0x1ebb6c[_0x1ece('0x7f')](_0x521e63);}_0x5d9c2a[_0x2b0956][_0x1ece('0x74')]&&_0x1ebb6c[_0x1ece('0x75')](_0x521e63,_0x5d9c2a[_0x2b0956]['orderBy']===_0x1ece('0x76')?![]:!![]);_0x1ebb6c['field'](_0x521e63,_0x5d9c2a[_0x2b0956][_0x1ece('0x77')]||_0x521e63);}if(_0x5e8915[_0x1ece('0x78')]){_0x5e8915[_0x1ece('0x78')]=JSON[_0x1ece('0x79')](_0x5e8915[_0x1ece('0x78')]);for(var _0x4c3fd8=0x0;_0x4c3fd8<_0x5e8915[_0x1ece('0x78')][_0x1ece('0x65')];_0x4c3fd8+=0x1){if(_0x5e8915[_0x1ece('0x78')][_0x4c3fd8]['type']&&_[_0x1ece('0x61')](_0x5d97d7,_0x5e8915[_0x1ece('0x78')][_0x4c3fd8][_0x1ece('0x2f')])&&_0x5e8915[_0x1ece('0x78')][_0x4c3fd8][_0x1ece('0x7a')]&&_0x5e8915[_0x1ece('0x78')][_0x4c3fd8][_0x1ece('0x7b')]&&_0x5e8915[_0x1ece('0x78')][_0x4c3fd8][_0x1ece('0x7c')]){_0x1ebb6c[_0x5e8915[_0x1ece('0x78')][_0x4c3fd8]['type']](_0x5e8915[_0x1ece('0x78')][_0x4c3fd8][_0x1ece('0x7b')],null,util['format'](_0x1ece('0x7d'),_0x5e8915[_0x1ece('0x6e')],_0x5e8915[_0x1ece('0x78')][_0x4c3fd8][_0x1ece('0x7a')],_0x5e8915['joins'][_0x4c3fd8][_0x1ece('0x7b')],_0x5e8915[_0x1ece('0x78')][_0x4c3fd8]['foreignKey']));}}}if(_0x5e8915[_0x1ece('0x7e')]){_0x5e8915[_0x1ece('0x7e')]=JSON[_0x1ece('0x79')](_0x5e8915['conditions']);_0x1ebb6c['where'](_0x3d300a(_0x5e8915[_0x1ece('0x7e')]['group']));}_0x19c692=_0x1ebb6c[_0x1ece('0x8f')]();_0x1ebb6c['limit'](_0x5df8f5);_0x1ebb6c[_0x1ece('0x1e')](0x0);return;}})[_0x1ece('0x23')](function(){if(_0x3e2881['output']===_0x1ece('0x90')){return null;}var _0x335869=_['merge'](_0x3e2881,{'name':_0x3e2881['fullPath']||_0x3e2881['name']||_0x5e8915[_0x1ece('0x29')],'basename':_0x10c179,'savename':util[_0x1ece('0x73')](_0x1ece('0x91'),_0x3e2881[_0x1ece('0x29')]||_0x5e8915[_0x1ece('0x29')],require(_0x1ece('0x92'))[_0x1ece('0x93')](0x4),_0x3e2881[_0x1ece('0x94')]||'csv'),'reportId':_0x5e8915['id'],'reportType':'custom'});return db[_0x1ece('0x95')][_0x1ece('0x48')](_0x335869,{'raw':!![]});})[_0x1ece('0x23')](function(_0x4da232){if(_0x5e8915[_0x1ece('0x6e')]===_0x1ece('0x96')){_0x19c692[_0x1ece('0x39')](_0x5e8915['table']+_0x1ece('0x97'),_0x3e2881[_0x1ece('0x98')],_0x3e2881['endDate']);}else{_0x19c692[_0x1ece('0x39')](_0x5e8915['table']+_0x1ece('0x99'),_0x3e2881[_0x1ece('0x98')],_0x3e2881[_0x1ece('0x9a')]);}if(_0x4da232){logger[_0x1ece('0x9b')](_0x1ece('0x9c'),_0x19c692[_0x1ece('0x83')]());require(_0x1ece('0x9d'))[_0x1ece('0x9e')](path[_0x1ece('0x54')](__dirname,_0x1ece('0x9f'),_0x4da232[_0x1ece('0x94')]),[_0x4da232['id'],_0x19c692[_0x1ece('0x83')](),path['join'](__dirname,'../../files/reports',_0x4da232[_0x1ece('0xa0')]),_0x10c179]);return _0x4da232;}else{var _0x3b5189=squel['select']();_0x3b5189['from']('('+_0x19c692['toString']()+')','countTable');_0x3b5189['field'](_0x1ece('0xa1'),_0x1ece('0x1d'));_0x19c692[_0x1ece('0x1c')](_0x3e2881[_0x1ece('0x1c')]||_0x5df8f5);_0x19c692['offset'](_0x3e2881[_0x1ece('0x1e')]||0x0);return dbH[_0x1ece('0x82')]['query'](_0x3b5189[_0x1ece('0x83')](),{'type':dbH[_0x1ece('0x82')][_0x1ece('0xa2')][_0x1ece('0x84')]})[_0x1ece('0x23')](function(_0x21f716){if(!_0x21f716[_0x1ece('0x65')]){_0x55ae3b=0x0;}else{_0x55ae3b=_0x21f716[0x0]['count']||0x0;}return dbH['sequelize'][_0x1ece('0x32')](_0x19c692[_0x1ece('0x83')](),{'type':dbH[_0x1ece('0x82')]['QueryTypes'][_0x1ece('0x84')]});})[_0x1ece('0x23')](function(_0x7ecf27){return{'rows':_0x7ecf27||[],'count':_0x55ae3b};});}});}exports['run']=function(_0x65b08f,_0x4744d6){return runReport(_0x65b08f[_0x1ece('0x52')],_0x65b08f[_0x1ece('0x32')],_0x65b08f[_0x1ece('0x3f')])[_0x1ece('0x23')](respondWithResult(_0x4744d6,null))[_0x1ece('0x44')](handleError(_0x4744d6,null));};exports[_0x1ece('0xa3')]=runReport;exports['query']=function(_0x23356e,_0x1277bd){var _0x2af1a9=0xa;var _0x205085=['join',_0x1ece('0x85'),_0x1ece('0x55'),'cross_join'];var _0x4319ae={'SUM':_0x1ece('0x57'),'COUNT':'COUNT(%s)','COUNT DISTINCT':'COUNT(DISTINCT\x20%s)','MAX':_0x1ece('0x87'),'MIN':'MIN(%s)','AVG':_0x1ece('0x5a'),'GROUP_CONCAT':'GROUP_CONCAT(%s)','GROUP_CONCAT ASC':_0x1ece('0x5c'),'GROUP_CONCAT DESC':_0x1ece('0x5d')};var _0x26d046={'SEC_TO_TIME':_0x1ece('0x5e'),'DATE':_0x1ece('0x88'),'HOUR':_0x1ece('0x89'),'ROUND':_0x1ece('0x5f'),'UNIX_TIMESTAMP':_0x1ece('0x60')};var _0x3c3f7b=function(_0x4ac058){return!_[_0x1ece('0x61')]([_0x1ece('0x8a'),_0x1ece('0x62'),_0x1ece('0x8b'),'IS\x20NOT\x20EMPTY'],_0x4ac058);};var _0x5a0970=function(_0x71db6e){if(!_0x71db6e||!_0x71db6e['rules']['length']){return'';}for(var _0x555ead='(',_0x2baa69=0x0;_0x2baa69<_0x71db6e[_0x1ece('0x64')][_0x1ece('0x65')];_0x2baa69+=0x1){_0x2baa69>0x0&&(_0x555ead+='\x20'+_0x71db6e[_0x1ece('0xa4')]+'\x20');_0x555ead+=_0x71db6e[_0x1ece('0x64')][_0x2baa69][_0x1ece('0x7f')]?_0x5a0970(_0x71db6e['rules'][_0x2baa69][_0x1ece('0x7f')]):_0x71db6e[_0x1ece('0x64')][_0x2baa69][_0x1ece('0x66')]+'\x20'+_0x71db6e[_0x1ece('0x64')][_0x2baa69][_0x1ece('0x67')]+(_0x3c3f7b(_0x71db6e[_0x1ece('0x64')][_0x2baa69][_0x1ece('0x67')])?'\x20'+_0x71db6e[_0x1ece('0x64')][_0x2baa69][_0x1ece('0x68')]:'');}return _0x555ead+')';};var _0x377832={'where':{'id':_0x23356e[_0x1ece('0x52')]['id']}},_0x3edef6,_0x3370b1,_0x2d9027,_0x58e374,_0x341788;_0x377832=_[_0x1ece('0x3d')]({},_0x377832,_0x23356e['options']);return db[_0x1ece('0x2d')][_0x1ece('0x47')](_0x377832)['then'](function(_0x51ac9e){if(_0x51ac9e){_0x3edef6=_0x51ac9e;return _0x51ac9e[_0x1ece('0x8c')]();}return null;})[_0x1ece('0x23')](function(_0xb1c432){if(_0xb1c432){if(!_0xb1c432['length']){throw new db['Sequelize'][(_0x1ece('0x8d'))](_0x1ece('0x6a'),0x193);}_0x3370b1=_0xb1c432;return db['AnalyticMetric'][_0x1ece('0x42')]({'raw':!![]});}return null;})[_0x1ece('0x23')](function(_0x1d86e5){if(_0x1d86e5){_0x2d9027=_[_0x1ece('0x6c')](_0x1d86e5,'id');var _0x335310;var _0xe6ea76=squel[_0x1ece('0x8e')]();_0xe6ea76[_0x1ece('0x6d')](_0x3edef6[_0x1ece('0x6e')]);for(var _0x1e4706=0x0;_0x1e4706<_0x3370b1[_0x1ece('0x65')];_0x1e4706+=0x1){_0x335310=_0x3370b1[_0x1e4706]['MetricId']?_0x2d9027[_0x3370b1[_0x1e4706]['MetricId']][_0x1ece('0x70')]:_0x3370b1[_0x1e4706]['field'];_0x335310=_0x3370b1[_0x1e4706][_0x1ece('0x71')]?_['replace'](_0x4319ae[_0x3370b1[_0x1e4706]['function']],'%s',_0x335310):_0x335310;_0x335310=_0x3370b1[_0x1e4706][_0x1ece('0x73')]?_[_0x1ece('0x72')](_0x26d046[_0x3370b1[_0x1e4706]['format']],'%s',_0x335310):_0x335310;if(_0x3370b1[_0x1e4706][_0x1ece('0xa5')]){_0xe6ea76[_0x1ece('0x7f')](_0x335310);}_0x3370b1[_0x1e4706][_0x1ece('0x74')]&&_0xe6ea76[_0x1ece('0x75')](_0x335310,_0x3370b1[_0x1e4706]['orderBy']==='DESC'?![]:!![]);_0xe6ea76[_0x1ece('0x66')](_0x335310,_0x3370b1[_0x1e4706][_0x1ece('0x77')]||_0x335310);}if(_0x3edef6['joins']){_0x3edef6[_0x1ece('0x78')]=JSON[_0x1ece('0x79')](_0x3edef6[_0x1ece('0x78')]);for(var _0x16b534=0x0;_0x16b534<_0x3edef6['joins'][_0x1ece('0x65')];_0x16b534+=0x1){if(_0x3edef6[_0x1ece('0x78')][_0x16b534]['type']&&_['includes'](_0x205085,_0x3edef6[_0x1ece('0x78')][_0x16b534][_0x1ece('0x2f')])&&_0x3edef6[_0x1ece('0x78')][_0x16b534][_0x1ece('0x7a')]&&_0x3edef6[_0x1ece('0x78')][_0x16b534][_0x1ece('0x7b')]&&_0x3edef6['joins'][_0x16b534][_0x1ece('0x7c')]){_0xe6ea76[_0x3edef6[_0x1ece('0x78')][_0x16b534][_0x1ece('0x2f')]](_0x3edef6[_0x1ece('0x78')][_0x16b534][_0x1ece('0x7b')],null,util['format'](_0x1ece('0x7d'),_0x3edef6['table'],_0x3edef6[_0x1ece('0x78')][_0x16b534][_0x1ece('0x7a')],_0x3edef6[_0x1ece('0x78')][_0x16b534][_0x1ece('0x7b')],_0x3edef6['joins'][_0x16b534][_0x1ece('0x7c')]));}}}if(_0x3edef6[_0x1ece('0x7e')]){_0x3edef6[_0x1ece('0x7e')]=JSON[_0x1ece('0x79')](_0x3edef6[_0x1ece('0x7e')]);_0xe6ea76[_0x1ece('0x39')](_0x5a0970(_0x3edef6[_0x1ece('0x7e')][_0x1ece('0x7f')]));}_0x341788=_0xe6ea76[_0x1ece('0x8f')]();_0xe6ea76['limit'](_0x2af1a9);_0xe6ea76[_0x1ece('0x1e')](0x0);logger[_0x1ece('0x80')]('Limited\x20Query:',_0xe6ea76[_0x1ece('0x83')]());return dbH[_0x1ece('0x82')][_0x1ece('0x32')](_0xe6ea76[_0x1ece('0x83')](),{'type':dbH['sequelize'][_0x1ece('0xa2')][_0x1ece('0x84')]});}})[_0x1ece('0x23')](function(){return{'sql':_0x341788[_0x1ece('0x83')]()};})[_0x1ece('0x23')](respondWithResult(_0x1277bd,null))[_0x1ece('0x44')](handleError(_0x1277bd,null));};
\ No newline at end of file
+var _0xe137=['info','Run\x20Query:','child_process','fork','../../components/export/','../../files/reports','savename','countTable','run','runReport','COUNT(DISTINCT\x20%s)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)','alias','debug','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','mustache','path','fs-extra','lodash','squel','crypto','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/license/util','../../mysqldb','dbH','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','reject','destroy','then','CustomReports','UserProfileResource','name','send','index','rawAttributes','fieldName','type','key','map','query','keys','filters','intersection','model','attributes','fields','length','hasOwnProperty','order','sort','pick','filter','where','merge','options','include','catch','show','AnalyticCustomReport','includeAll','find','create','body','user','get','role','Reports','UserProfileSection','userProfileId','autoAssociation','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','params','preview','left_join','SUM(%s)','COUNT(%s)','MIN(%s)','AVG(%s)','GROUP_CONCAT(%s)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','SEC_TO_TIME(%s)','HOUR(%s)','UNIX_TIMESTAMP(%s)','includes','IS\x20NULL','IS\x20NOT\x20NULL','IS\x20NOT\x20EMPTY','rules','operator','group','field','condition','value','getFields','Sequelize','ValidationErrorItem','Please\x20insert\x20at\x20least\x20one\x20field','AnalyticMetric','findAll','keyBy','select','from','MetricId','metric','function','replace','groupBy','orderBy','DESC','joins','foreignTable','foreignKey','format','%s.%s\x20=\x20%s.%s','table','parentKey','conditions','parse','clone','Limited\x20Query:','sequelize','toString','QueryTypes','SELECT','join','right_join','cross_join','MAX(%s)','DATE(%s)','ROUND(%s)','IS\x20EMPTY','output','web','fullPath','%s-%s.%s','randomstring','generate','custom','.calldate\x20BETWEEN\x20?\x20AND\x20?','startDate','.createdAt\x20BETWEEN\x20?\x20AND\x20?','endDate'];(function(_0x4b75b9,_0x4cbbb9){var _0xd88b6=function(_0x4b4352){while(--_0x4b4352){_0x4b75b9['push'](_0x4b75b9['shift']());}};_0xd88b6(++_0x4cbbb9);}(_0xe137,0xb3));var _0x7e13=function(_0x4a3898,_0x4c9853){_0x4a3898=_0x4a3898-0x0;var _0x25ceb0=_0xe137[_0x4a3898];return _0x25ceb0;};'use strict';var emlformat=require(_0x7e13('0x0'));var rimraf=require(_0x7e13('0x1'));var zipdir=require(_0x7e13('0x2'));var jsonpatch=require(_0x7e13('0x3'));var rp=require(_0x7e13('0x4'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x7e13('0x5'));var util=require('util');var path=require(_0x7e13('0x6'));var sox=require('sox');var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x7e13('0x7'));var _=require(_0x7e13('0x8'));var squel=require(_0x7e13('0x9'));var crypto=require(_0x7e13('0xa'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x7e13('0xb'));var querystring=require(_0x7e13('0xc'));var Papa=require(_0x7e13('0xd'));var Redis=require(_0x7e13('0xe'));var authService=require(_0x7e13('0xf'));var qs=require(_0x7e13('0x10'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x7e13('0x11'));var logger=require(_0x7e13('0x12'))(_0x7e13('0x13'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0x7e13('0x14'));var db=require('../../mysqldb')['db'];var dbH=require(_0x7e13('0x15'))[_0x7e13('0x16')];function respondWithStatusCode(_0x214395,_0x3800c8){_0x3800c8=_0x3800c8||0xcc;return function(_0x6bcbe0){if(_0x6bcbe0){return _0x214395[_0x7e13('0x17')](_0x3800c8);}return _0x214395[_0x7e13('0x18')](_0x3800c8)[_0x7e13('0x19')]();};}function respondWithResult(_0x1d2c07,_0x4853d7){_0x4853d7=_0x4853d7||0xc8;return function(_0x2bc3d1){if(_0x2bc3d1){return _0x1d2c07[_0x7e13('0x18')](_0x4853d7)[_0x7e13('0x1a')](_0x2bc3d1);}};}function respondWithFilteredResult(_0x266a5b,_0x51447a){return function(_0x419dbf){if(_0x419dbf){var _0x5e8896=typeof _0x51447a[_0x7e13('0x1b')]===_0x7e13('0x1c')&&typeof _0x51447a[_0x7e13('0x1d')]===_0x7e13('0x1c');var _0x483c3b=_0x419dbf[_0x7e13('0x1e')];var _0x3ea219=_0x5e8896?0x0:_0x51447a['offset'];var _0x283a5a=_0x5e8896?_0x419dbf[_0x7e13('0x1e')]:_0x51447a[_0x7e13('0x1b')]+_0x51447a[_0x7e13('0x1d')];var _0x1a6641;if(_0x283a5a>=_0x483c3b){_0x283a5a=_0x483c3b;_0x1a6641=0xc8;}else{_0x1a6641=0xce;}_0x266a5b[_0x7e13('0x18')](_0x1a6641);return _0x266a5b[_0x7e13('0x1f')](_0x7e13('0x20'),_0x3ea219+'-'+_0x283a5a+'/'+_0x483c3b)[_0x7e13('0x1a')](_0x419dbf);}return null;};}function patchUpdates(_0x76c2bd){return function(_0x20d8e4){try{jsonpatch['apply'](_0x20d8e4,_0x76c2bd,!![]);}catch(_0x1be9a8){return BPromise[_0x7e13('0x21')](_0x1be9a8);}return _0x20d8e4['save']();};}function saveUpdates(_0x58df4d,_0x2a1921){return function(_0x760bcc){if(_0x760bcc){return _0x760bcc['update'](_0x58df4d)['then'](function(_0x5835c8){return _0x5835c8;});}return null;};}function removeEntity(_0x580745,_0x432ab0){return function(_0x156e4c){if(_0x156e4c){return _0x156e4c[_0x7e13('0x22')]()[_0x7e13('0x23')](function(){var _0x1f56e9=_0x156e4c['get']({'plain':!![]});var _0xa54815=_0x7e13('0x24');return db[_0x7e13('0x25')]['destroy']({'where':{'type':_0xa54815,'resourceId':_0x1f56e9['id']}})['then'](function(){return _0x156e4c;});})[_0x7e13('0x23')](function(){_0x580745['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x3f3769,_0x2357b8){return function(_0x312af8){if(!_0x312af8){_0x3f3769[_0x7e13('0x17')](0x194);}return _0x312af8;};}function handleError(_0x19925a,_0x434bed){_0x434bed=_0x434bed||0x1f4;return function(_0x5d939c){logger['error'](_0x5d939c['stack']);if(_0x5d939c['name']){delete _0x5d939c[_0x7e13('0x26')];}_0x19925a['status'](_0x434bed)[_0x7e13('0x27')](_0x5d939c);};}exports[_0x7e13('0x28')]=function(_0x46c73d,_0x2e31b4){var _0x59c660={},_0x4366e1={},_0x30b68f={'count':0x0,'rows':[]};var _0x1be521=_['map'](db['AnalyticCustomReport'][_0x7e13('0x29')],function(_0xeb8809){return{'name':_0xeb8809[_0x7e13('0x2a')],'type':_0xeb8809[_0x7e13('0x2b')][_0x7e13('0x2c')]};});_0x4366e1['model']=_[_0x7e13('0x2d')](_0x1be521,_0x7e13('0x26'));_0x4366e1[_0x7e13('0x2e')]=_[_0x7e13('0x2f')](_0x46c73d['query']);_0x4366e1[_0x7e13('0x30')]=_[_0x7e13('0x31')](_0x4366e1[_0x7e13('0x32')],_0x4366e1['query']);_0x59c660[_0x7e13('0x33')]=_[_0x7e13('0x31')](_0x4366e1['model'],qs[_0x7e13('0x34')](_0x46c73d[_0x7e13('0x2e')]['fields']));_0x59c660['attributes']=_0x59c660[_0x7e13('0x33')][_0x7e13('0x35')]?_0x59c660['attributes']:_0x4366e1[_0x7e13('0x32')];if(!_0x46c73d[_0x7e13('0x2e')][_0x7e13('0x36')]('nolimit')){_0x59c660['limit']=qs[_0x7e13('0x1d')](_0x46c73d['query'][_0x7e13('0x1d')]);_0x59c660[_0x7e13('0x1b')]=qs[_0x7e13('0x1b')](_0x46c73d[_0x7e13('0x2e')][_0x7e13('0x1b')]);}_0x59c660[_0x7e13('0x37')]=qs['sort'](_0x46c73d[_0x7e13('0x2e')][_0x7e13('0x38')]);_0x59c660['where']=qs[_0x7e13('0x30')](_[_0x7e13('0x39')](_0x46c73d[_0x7e13('0x2e')],_0x4366e1[_0x7e13('0x30')]),_0x1be521);if(_0x46c73d['query'][_0x7e13('0x3a')]){_0x59c660[_0x7e13('0x3b')]=_[_0x7e13('0x3c')](_0x59c660['where'],{'$or':_[_0x7e13('0x2d')](_0x1be521,function(_0x2d70db){if(_0x2d70db['type']!=='VIRTUAL'){var _0x20bf3f={};_0x20bf3f[_0x2d70db[_0x7e13('0x26')]]={'$like':'%'+_0x46c73d['query']['filter']+'%'};return _0x20bf3f;}})});}_0x59c660=_['merge']({},_0x59c660,_0x46c73d[_0x7e13('0x3d')]);var _0x5a363f={'where':_0x59c660[_0x7e13('0x3b')]};return db['AnalyticCustomReport'][_0x7e13('0x1e')](_0x5a363f)[_0x7e13('0x23')](function(_0x147f7a){_0x30b68f['count']=_0x147f7a;if(_0x46c73d[_0x7e13('0x2e')]['includeAll']){_0x59c660[_0x7e13('0x3e')]=[{'all':!![]}];}return db['AnalyticCustomReport']['findAll'](_0x59c660);})['then'](function(_0x14ea52){_0x30b68f['rows']=_0x14ea52;return _0x30b68f;})[_0x7e13('0x23')](respondWithFilteredResult(_0x2e31b4,_0x59c660))[_0x7e13('0x3f')](handleError(_0x2e31b4,null));};exports[_0x7e13('0x40')]=function(_0x331475,_0x4c1b2f){var _0x588ab1={'raw':![],'where':{'id':_0x331475['params']['id']}},_0xa68fb0={};_0xa68fb0[_0x7e13('0x32')]=_[_0x7e13('0x2f')](db[_0x7e13('0x41')][_0x7e13('0x29')]);_0xa68fb0[_0x7e13('0x2e')]=_[_0x7e13('0x2f')](_0x331475['query']);_0xa68fb0[_0x7e13('0x30')]=_['intersection'](_0xa68fb0[_0x7e13('0x32')],_0xa68fb0[_0x7e13('0x2e')]);_0x588ab1[_0x7e13('0x33')]=_['intersection'](_0xa68fb0[_0x7e13('0x32')],qs[_0x7e13('0x34')](_0x331475[_0x7e13('0x2e')][_0x7e13('0x34')]));_0x588ab1[_0x7e13('0x33')]=_0x588ab1[_0x7e13('0x33')][_0x7e13('0x35')]?_0x588ab1[_0x7e13('0x33')]:_0xa68fb0[_0x7e13('0x32')];if(_0x331475[_0x7e13('0x2e')][_0x7e13('0x42')]){_0x588ab1[_0x7e13('0x3e')]=[{'all':!![]}];}_0x588ab1=_[_0x7e13('0x3c')]({},_0x588ab1,_0x331475[_0x7e13('0x3d')]);return db[_0x7e13('0x41')][_0x7e13('0x43')](_0x588ab1)['then'](handleEntityNotFound(_0x4c1b2f,null))[_0x7e13('0x23')](respondWithResult(_0x4c1b2f,null))[_0x7e13('0x3f')](handleError(_0x4c1b2f,null));};exports[_0x7e13('0x44')]=function(_0x469af3,_0x4ffd3a){return db[_0x7e13('0x41')][_0x7e13('0x44')](_0x469af3[_0x7e13('0x45')],{})[_0x7e13('0x23')](function(_0xe5ef2e){var _0xb4ad27=_0x469af3[_0x7e13('0x46')][_0x7e13('0x47')]({'plain':!![]});if(!_0xb4ad27)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0xb4ad27[_0x7e13('0x48')]===_0x7e13('0x46')){var _0xa75a18=_0xe5ef2e[_0x7e13('0x47')]({'plain':!![]});var _0x1fdbcb=_0x7e13('0x49');return db[_0x7e13('0x4a')][_0x7e13('0x43')]({'where':{'name':_0x1fdbcb,'userProfileId':_0xb4ad27[_0x7e13('0x4b')]},'raw':!![]})['then'](function(_0x1a143b){if(_0x1a143b&&_0x1a143b[_0x7e13('0x4c')]===0x0){return db[_0x7e13('0x25')][_0x7e13('0x44')]({'name':_0xa75a18[_0x7e13('0x26')],'resourceId':_0xa75a18['id'],'type':_0x7e13('0x24'),'sectionId':_0x1a143b['id']},{})[_0x7e13('0x23')](function(){return _0xe5ef2e;});}else{return _0xe5ef2e;}})[_0x7e13('0x3f')](function(_0x379501){logger[_0x7e13('0x4d')](_0x7e13('0x4e'),_0x379501);throw _0x379501;});}return _0xe5ef2e;})[_0x7e13('0x23')](respondWithResult(_0x4ffd3a,0xc9))[_0x7e13('0x3f')](handleError(_0x4ffd3a,null));};exports[_0x7e13('0x4f')]=function(_0x5569ef,_0x2dd377){if(_0x5569ef[_0x7e13('0x45')]['id']){delete _0x5569ef['body']['id'];}return db[_0x7e13('0x41')][_0x7e13('0x43')]({'where':{'id':_0x5569ef[_0x7e13('0x50')]['id']}})[_0x7e13('0x23')](handleEntityNotFound(_0x2dd377,null))[_0x7e13('0x23')](saveUpdates(_0x5569ef[_0x7e13('0x45')],null))['then'](respondWithResult(_0x2dd377,null))[_0x7e13('0x3f')](handleError(_0x2dd377,null));};exports[_0x7e13('0x22')]=function(_0x37dca5,_0x326b68){return db['AnalyticCustomReport'][_0x7e13('0x43')]({'where':{'id':_0x37dca5['params']['id']}})[_0x7e13('0x23')](handleEntityNotFound(_0x326b68,null))[_0x7e13('0x23')](removeEntity(_0x326b68,null))['catch'](handleError(_0x326b68,null));};exports[_0x7e13('0x51')]=function(_0x3dea33,_0x483fb6){var _0x436bb4=0xa;var _0x40aca1=['join',_0x7e13('0x52'),'right_join','cross_join'];var _0x54f9ea={'SUM':_0x7e13('0x53'),'COUNT':_0x7e13('0x54'),'COUNT DISTINCT':'COUNT(DISTINCT\x20%s)','MAX':'MAX(%s)','MIN':_0x7e13('0x55'),'AVG':_0x7e13('0x56'),'GROUP_CONCAT':_0x7e13('0x57'),'GROUP_CONCAT ASC':_0x7e13('0x58'),'GROUP_CONCAT DESC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)'};var _0x56e310={'SEC_TO_TIME':_0x7e13('0x59'),'DATE':'DATE(%s)','HOUR':_0x7e13('0x5a'),'ROUND':'ROUND(%s)','UNIX_TIMESTAMP':_0x7e13('0x5b')};var _0x2b72ed=function(_0x42fcf7){return!_[_0x7e13('0x5c')]([_0x7e13('0x5d'),_0x7e13('0x5e'),'IS\x20EMPTY',_0x7e13('0x5f')],_0x42fcf7);};var _0x564f1d=function(_0x56dfbc){if(!_0x56dfbc||!_0x56dfbc['rules']['length']){return'';}for(var _0x3eed26='(',_0x194b43=0x0;_0x194b43<_0x56dfbc[_0x7e13('0x60')][_0x7e13('0x35')];_0x194b43+=0x1){_0x194b43>0x0&&(_0x3eed26+='\x20'+_0x56dfbc[_0x7e13('0x61')]+'\x20');_0x3eed26+=_0x56dfbc[_0x7e13('0x60')][_0x194b43][_0x7e13('0x62')]?_0x564f1d(_0x56dfbc['rules'][_0x194b43]['group']):_0x56dfbc[_0x7e13('0x60')][_0x194b43][_0x7e13('0x63')]+'\x20'+_0x56dfbc[_0x7e13('0x60')][_0x194b43][_0x7e13('0x64')]+(_0x2b72ed(_0x56dfbc[_0x7e13('0x60')][_0x194b43][_0x7e13('0x64')])?'\x20'+_0x56dfbc[_0x7e13('0x60')][_0x194b43][_0x7e13('0x65')]:'');}return _0x3eed26+')';};var _0x2b4766={'where':{'id':_0x3dea33['params']['id']}},_0x689851,_0x553474,_0x4f1a31,_0x5333f8,_0x5737ad;_0x2b4766=_[_0x7e13('0x3c')]({},_0x2b4766,_0x3dea33[_0x7e13('0x3d')]);return db[_0x7e13('0x41')][_0x7e13('0x43')](_0x2b4766)[_0x7e13('0x23')](function(_0xfad94b){if(_0xfad94b){_0x689851=_0xfad94b;return _0xfad94b[_0x7e13('0x66')]();}return null;})[_0x7e13('0x23')](function(_0x3e782c){if(_0x3e782c){if(!_0x3e782c['length']){throw new db[(_0x7e13('0x67'))][(_0x7e13('0x68'))](_0x7e13('0x69'),0x193);}_0x553474=_0x3e782c;return db[_0x7e13('0x6a')][_0x7e13('0x6b')]({'raw':!![]});}return null;})[_0x7e13('0x23')](function(_0x2187cf){if(_0x2187cf){_0x4f1a31=_[_0x7e13('0x6c')](_0x2187cf,'id');var _0x4dbb07;var _0x5b9a40=squel[_0x7e13('0x6d')]();_0x5b9a40[_0x7e13('0x6e')](_0x689851['table']);for(var _0x539434=0x0;_0x539434<_0x553474[_0x7e13('0x35')];_0x539434+=0x1){_0x4dbb07=_0x553474[_0x539434][_0x7e13('0x6f')]?_0x4f1a31[_0x553474[_0x539434]['MetricId']][_0x7e13('0x70')]:_0x553474[_0x539434]['field'];_0x4dbb07=_0x553474[_0x539434][_0x7e13('0x71')]?_[_0x7e13('0x72')](_0x54f9ea[_0x553474[_0x539434][_0x7e13('0x71')]],'%s',_0x4dbb07):_0x4dbb07;_0x4dbb07=_0x553474[_0x539434]['format']?_['replace'](_0x56e310[_0x553474[_0x539434]['format']],'%s',_0x4dbb07):_0x4dbb07;if(_0x553474[_0x539434][_0x7e13('0x73')]){_0x5b9a40[_0x7e13('0x62')](_0x4dbb07);}_0x553474[_0x539434][_0x7e13('0x74')]&&_0x5b9a40[_0x7e13('0x37')](_0x4dbb07,_0x553474[_0x539434][_0x7e13('0x74')]===_0x7e13('0x75')?![]:!![]);_0x5b9a40[_0x7e13('0x63')](_0x4dbb07,_0x553474[_0x539434]['alias']||_0x4dbb07);}if(_0x689851['joins']){_0x689851['joins']=JSON['parse'](_0x689851[_0x7e13('0x76')]);for(var _0x2f447d=0x0;_0x2f447d<_0x689851['joins'][_0x7e13('0x35')];_0x2f447d+=0x1){if(_0x689851[_0x7e13('0x76')][_0x2f447d][_0x7e13('0x2b')]&&_[_0x7e13('0x5c')](_0x40aca1,_0x689851[_0x7e13('0x76')][_0x2f447d][_0x7e13('0x2b')])&&_0x689851[_0x7e13('0x76')][_0x2f447d]['parentKey']&&_0x689851[_0x7e13('0x76')][_0x2f447d][_0x7e13('0x77')]&&_0x689851[_0x7e13('0x76')][_0x2f447d][_0x7e13('0x78')]){_0x5b9a40[_0x689851[_0x7e13('0x76')][_0x2f447d]['type']](_0x689851['joins'][_0x2f447d][_0x7e13('0x77')],null,util[_0x7e13('0x79')](_0x7e13('0x7a'),_0x689851[_0x7e13('0x7b')],_0x689851[_0x7e13('0x76')][_0x2f447d][_0x7e13('0x7c')],_0x689851['joins'][_0x2f447d][_0x7e13('0x77')],_0x689851[_0x7e13('0x76')][_0x2f447d][_0x7e13('0x78')]));}}}if(_0x689851[_0x7e13('0x7d')]){_0x689851['conditions']=JSON[_0x7e13('0x7e')](_0x689851[_0x7e13('0x7d')]);_0x5b9a40[_0x7e13('0x3b')](_0x564f1d(_0x689851[_0x7e13('0x7d')]['group']));}_0x5737ad=_0x5b9a40[_0x7e13('0x7f')]();_0x5b9a40[_0x7e13('0x1d')](_0x436bb4);_0x5b9a40['offset'](0x0);logger['debug'](_0x7e13('0x80'),_0x5b9a40['toString']());return dbH[_0x7e13('0x81')][_0x7e13('0x2e')](_0x5b9a40[_0x7e13('0x82')](),{'type':dbH[_0x7e13('0x81')][_0x7e13('0x83')][_0x7e13('0x84')]});}})[_0x7e13('0x23')](respondWithResult(_0x483fb6,null))[_0x7e13('0x3f')](handleError(_0x483fb6,null));};function runReport(_0x3dd0e0,_0x5d04b1,_0x2c729a){var _0x2f8b3b=_0x5d04b1[_0x7e13('0x26')];var _0x506924=0xa;var _0x5e5d9d=[_0x7e13('0x85'),'left_join',_0x7e13('0x86'),_0x7e13('0x87')];var _0x1b1f25={'SUM':_0x7e13('0x53'),'COUNT':'COUNT(%s)','COUNT DISTINCT':'COUNT(DISTINCT\x20%s)','MAX':_0x7e13('0x88'),'MIN':_0x7e13('0x55'),'AVG':_0x7e13('0x56'),'GROUP_CONCAT':'GROUP_CONCAT(%s)','GROUP_CONCAT ASC':_0x7e13('0x58'),'GROUP_CONCAT DESC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)'};var _0x56b846={'SEC_TO_TIME':_0x7e13('0x59'),'DATE':_0x7e13('0x89'),'HOUR':_0x7e13('0x5a'),'ROUND':_0x7e13('0x8a'),'UNIX_TIMESTAMP':_0x7e13('0x5b')};var _0x411872=function(_0x41c38d){return!_['includes']([_0x7e13('0x5d'),'IS\x20NOT\x20NULL',_0x7e13('0x8b'),_0x7e13('0x5f')],_0x41c38d);};var _0x37dda8=function(_0x508018){if(!_0x508018||!_0x508018[_0x7e13('0x60')]['length']){return'';}for(var _0x36e35c='(',_0x496d7e=0x0;_0x496d7e<_0x508018[_0x7e13('0x60')][_0x7e13('0x35')];_0x496d7e+=0x1){_0x496d7e>0x0&&(_0x36e35c+='\x20'+_0x508018[_0x7e13('0x61')]+'\x20');_0x36e35c+=_0x508018['rules'][_0x496d7e][_0x7e13('0x62')]?_0x37dda8(_0x508018[_0x7e13('0x60')][_0x496d7e][_0x7e13('0x62')]):_0x508018[_0x7e13('0x60')][_0x496d7e][_0x7e13('0x63')]+'\x20'+_0x508018[_0x7e13('0x60')][_0x496d7e][_0x7e13('0x64')]+(_0x411872(_0x508018[_0x7e13('0x60')][_0x496d7e][_0x7e13('0x64')])?'\x20'+_0x508018[_0x7e13('0x60')][_0x496d7e][_0x7e13('0x65')]:'');}return _0x36e35c+')';};var _0x596ade={'where':{'id':_0x3dd0e0['id']}},_0x33f460,_0x1951dd,_0x52df71,_0x4a3c53,_0x40dcd1;_0x596ade=_[_0x7e13('0x3c')]({},_0x596ade,_0x2c729a);return db[_0x7e13('0x41')]['find'](_0x596ade)['then'](function(_0x103842){if(_0x103842){_0x33f460=_0x103842;return _0x103842[_0x7e13('0x66')]();}return null;})[_0x7e13('0x23')](function(_0x4dd897){if(_0x4dd897){if(!_0x4dd897[_0x7e13('0x35')]){throw new db['Sequelize'][(_0x7e13('0x68'))](_0x7e13('0x69'),0x193);}_0x1951dd=_0x4dd897;return db[_0x7e13('0x6a')][_0x7e13('0x6b')]({'raw':!![]});}return null;})[_0x7e13('0x23')](function(_0x514c1c){if(_0x514c1c){_0x52df71=_['keyBy'](_0x514c1c,'id');var _0x3779c0;var _0x2546ff=squel[_0x7e13('0x6d')]();_0x2546ff[_0x7e13('0x6e')](_0x33f460[_0x7e13('0x7b')]);for(var _0x1f3d4d=0x0;_0x1f3d4d<_0x1951dd[_0x7e13('0x35')];_0x1f3d4d+=0x1){_0x3779c0=_0x1951dd[_0x1f3d4d][_0x7e13('0x6f')]?_0x52df71[_0x1951dd[_0x1f3d4d][_0x7e13('0x6f')]][_0x7e13('0x70')]:_0x1951dd[_0x1f3d4d][_0x7e13('0x63')];_0x3779c0=_0x1951dd[_0x1f3d4d][_0x7e13('0x71')]?_[_0x7e13('0x72')](_0x1b1f25[_0x1951dd[_0x1f3d4d]['function']],'%s',_0x3779c0):_0x3779c0;_0x3779c0=_0x1951dd[_0x1f3d4d][_0x7e13('0x79')]?_[_0x7e13('0x72')](_0x56b846[_0x1951dd[_0x1f3d4d]['format']],'%s',_0x3779c0):_0x3779c0;if(_0x1951dd[_0x1f3d4d][_0x7e13('0x73')]){_0x2546ff[_0x7e13('0x62')](_0x3779c0);}_0x1951dd[_0x1f3d4d][_0x7e13('0x74')]&&_0x2546ff['order'](_0x3779c0,_0x1951dd[_0x1f3d4d]['orderBy']===_0x7e13('0x75')?![]:!![]);_0x2546ff[_0x7e13('0x63')](_0x3779c0,_0x1951dd[_0x1f3d4d]['alias']||_0x3779c0);}if(_0x33f460[_0x7e13('0x76')]){_0x33f460[_0x7e13('0x76')]=JSON[_0x7e13('0x7e')](_0x33f460[_0x7e13('0x76')]);for(var _0x51d9be=0x0;_0x51d9be<_0x33f460[_0x7e13('0x76')][_0x7e13('0x35')];_0x51d9be+=0x1){if(_0x33f460[_0x7e13('0x76')][_0x51d9be][_0x7e13('0x2b')]&&_['includes'](_0x5e5d9d,_0x33f460[_0x7e13('0x76')][_0x51d9be][_0x7e13('0x2b')])&&_0x33f460[_0x7e13('0x76')][_0x51d9be]['parentKey']&&_0x33f460[_0x7e13('0x76')][_0x51d9be][_0x7e13('0x77')]&&_0x33f460[_0x7e13('0x76')][_0x51d9be][_0x7e13('0x78')]){_0x2546ff[_0x33f460['joins'][_0x51d9be][_0x7e13('0x2b')]](_0x33f460[_0x7e13('0x76')][_0x51d9be]['foreignTable'],null,util['format'](_0x7e13('0x7a'),_0x33f460['table'],_0x33f460['joins'][_0x51d9be][_0x7e13('0x7c')],_0x33f460['joins'][_0x51d9be][_0x7e13('0x77')],_0x33f460[_0x7e13('0x76')][_0x51d9be]['foreignKey']));}}}if(_0x33f460[_0x7e13('0x7d')]){_0x33f460[_0x7e13('0x7d')]=JSON[_0x7e13('0x7e')](_0x33f460[_0x7e13('0x7d')]);_0x2546ff[_0x7e13('0x3b')](_0x37dda8(_0x33f460[_0x7e13('0x7d')][_0x7e13('0x62')]));}_0x40dcd1=_0x2546ff[_0x7e13('0x7f')]();_0x2546ff[_0x7e13('0x1d')](_0x506924);_0x2546ff[_0x7e13('0x1b')](0x0);return;}})[_0x7e13('0x23')](function(){if(_0x5d04b1[_0x7e13('0x8c')]===_0x7e13('0x8d')){return null;}var _0x4511c4=_[_0x7e13('0x3c')](_0x5d04b1,{'name':_0x5d04b1[_0x7e13('0x8e')]||_0x5d04b1['name']||_0x33f460[_0x7e13('0x26')],'basename':_0x2f8b3b,'savename':util[_0x7e13('0x79')](_0x7e13('0x8f'),_0x5d04b1[_0x7e13('0x26')]||_0x33f460['name'],require(_0x7e13('0x90'))[_0x7e13('0x91')](0x4),_0x5d04b1['output']||'csv'),'reportId':_0x33f460['id'],'reportType':_0x7e13('0x92')});return db['AnalyticExtractedReport'][_0x7e13('0x44')](_0x4511c4,{'raw':!![]});})['then'](function(_0x12e510){if(_0x33f460[_0x7e13('0x7b')]==='cdr'){_0x40dcd1['where'](_0x33f460['table']+_0x7e13('0x93'),_0x5d04b1[_0x7e13('0x94')],_0x5d04b1['endDate']);}else{_0x40dcd1['where'](_0x33f460[_0x7e13('0x7b')]+_0x7e13('0x95'),_0x5d04b1['startDate'],_0x5d04b1[_0x7e13('0x96')]);}if(_0x12e510){logger[_0x7e13('0x97')](_0x7e13('0x98'),_0x40dcd1[_0x7e13('0x82')]());require(_0x7e13('0x99'))[_0x7e13('0x9a')](path[_0x7e13('0x85')](__dirname,_0x7e13('0x9b'),_0x12e510[_0x7e13('0x8c')]),[_0x12e510['id'],_0x40dcd1[_0x7e13('0x82')](),path['join'](__dirname,_0x7e13('0x9c'),_0x12e510[_0x7e13('0x9d')]),_0x2f8b3b]);return _0x12e510;}else{var _0xd93f33=squel[_0x7e13('0x6d')]();_0xd93f33[_0x7e13('0x6e')]('('+_0x40dcd1[_0x7e13('0x82')]()+')',_0x7e13('0x9e'));_0xd93f33[_0x7e13('0x63')]('COUNT(*)','count');_0x40dcd1[_0x7e13('0x1d')](_0x5d04b1[_0x7e13('0x1d')]||_0x506924);_0x40dcd1['offset'](_0x5d04b1[_0x7e13('0x1b')]||0x0);return dbH[_0x7e13('0x81')][_0x7e13('0x2e')](_0xd93f33['toString'](),{'type':dbH['sequelize'][_0x7e13('0x83')][_0x7e13('0x84')]})[_0x7e13('0x23')](function(_0x4ffb0f){if(!_0x4ffb0f[_0x7e13('0x35')]){_0x4a3c53=0x0;}else{_0x4a3c53=_0x4ffb0f[0x0][_0x7e13('0x1e')]||0x0;}return dbH[_0x7e13('0x81')]['query'](_0x40dcd1[_0x7e13('0x82')](),{'type':dbH[_0x7e13('0x81')]['QueryTypes'][_0x7e13('0x84')]});})['then'](function(_0x43254c){return{'rows':_0x43254c||[],'count':_0x4a3c53};});}});}exports[_0x7e13('0x9f')]=function(_0x40d3dc,_0x366b11){return runReport(_0x40d3dc[_0x7e13('0x50')],_0x40d3dc[_0x7e13('0x2e')],_0x40d3dc[_0x7e13('0x3d')])[_0x7e13('0x23')](respondWithResult(_0x366b11,null))['catch'](handleError(_0x366b11,null));};exports[_0x7e13('0xa0')]=runReport;exports[_0x7e13('0x2e')]=function(_0x759c7f,_0x2e78a2){var _0x5e0562=0xa;var _0x3befe7=[_0x7e13('0x85'),_0x7e13('0x52'),_0x7e13('0x86'),_0x7e13('0x87')];var _0x497ebb={'SUM':_0x7e13('0x53'),'COUNT':_0x7e13('0x54'),'COUNT DISTINCT':_0x7e13('0xa1'),'MAX':_0x7e13('0x88'),'MIN':'MIN(%s)','AVG':_0x7e13('0x56'),'GROUP_CONCAT':'GROUP_CONCAT(%s)','GROUP_CONCAT ASC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT DESC':_0x7e13('0xa2')};var _0x3ca270={'SEC_TO_TIME':_0x7e13('0x59'),'DATE':_0x7e13('0x89'),'HOUR':_0x7e13('0x5a'),'ROUND':_0x7e13('0x8a'),'UNIX_TIMESTAMP':_0x7e13('0x5b')};var _0x3881b0=function(_0x53dacd){return!_['includes']([_0x7e13('0x5d'),_0x7e13('0x5e'),_0x7e13('0x8b'),_0x7e13('0x5f')],_0x53dacd);};var _0x206e99=function(_0x505435){if(!_0x505435||!_0x505435[_0x7e13('0x60')][_0x7e13('0x35')]){return'';}for(var _0x2fdd8c='(',_0x3e9170=0x0;_0x3e9170<_0x505435[_0x7e13('0x60')][_0x7e13('0x35')];_0x3e9170+=0x1){_0x3e9170>0x0&&(_0x2fdd8c+='\x20'+_0x505435['operator']+'\x20');_0x2fdd8c+=_0x505435[_0x7e13('0x60')][_0x3e9170][_0x7e13('0x62')]?_0x206e99(_0x505435[_0x7e13('0x60')][_0x3e9170][_0x7e13('0x62')]):_0x505435[_0x7e13('0x60')][_0x3e9170][_0x7e13('0x63')]+'\x20'+_0x505435[_0x7e13('0x60')][_0x3e9170]['condition']+(_0x3881b0(_0x505435[_0x7e13('0x60')][_0x3e9170][_0x7e13('0x64')])?'\x20'+_0x505435[_0x7e13('0x60')][_0x3e9170]['value']:'');}return _0x2fdd8c+')';};var _0x17d543={'where':{'id':_0x759c7f[_0x7e13('0x50')]['id']}},_0x490d8e,_0x4d560c,_0x2c3e27,_0x4bb07c,_0x3294e8;_0x17d543=_[_0x7e13('0x3c')]({},_0x17d543,_0x759c7f[_0x7e13('0x3d')]);return db['AnalyticCustomReport'][_0x7e13('0x43')](_0x17d543)[_0x7e13('0x23')](function(_0xee1c3d){if(_0xee1c3d){_0x490d8e=_0xee1c3d;return _0xee1c3d[_0x7e13('0x66')]();}return null;})['then'](function(_0x394cad){if(_0x394cad){if(!_0x394cad['length']){throw new db['Sequelize'][(_0x7e13('0x68'))](_0x7e13('0x69'),0x193);}_0x4d560c=_0x394cad;return db['AnalyticMetric'][_0x7e13('0x6b')]({'raw':!![]});}return null;})[_0x7e13('0x23')](function(_0xe88572){if(_0xe88572){_0x2c3e27=_['keyBy'](_0xe88572,'id');var _0x4eb17d;var _0x50d51f=squel['select']();_0x50d51f[_0x7e13('0x6e')](_0x490d8e[_0x7e13('0x7b')]);for(var _0x142652=0x0;_0x142652<_0x4d560c[_0x7e13('0x35')];_0x142652+=0x1){_0x4eb17d=_0x4d560c[_0x142652]['MetricId']?_0x2c3e27[_0x4d560c[_0x142652][_0x7e13('0x6f')]]['metric']:_0x4d560c[_0x142652][_0x7e13('0x63')];_0x4eb17d=_0x4d560c[_0x142652][_0x7e13('0x71')]?_[_0x7e13('0x72')](_0x497ebb[_0x4d560c[_0x142652][_0x7e13('0x71')]],'%s',_0x4eb17d):_0x4eb17d;_0x4eb17d=_0x4d560c[_0x142652][_0x7e13('0x79')]?_['replace'](_0x3ca270[_0x4d560c[_0x142652]['format']],'%s',_0x4eb17d):_0x4eb17d;if(_0x4d560c[_0x142652][_0x7e13('0x73')]){_0x50d51f[_0x7e13('0x62')](_0x4eb17d);}_0x4d560c[_0x142652][_0x7e13('0x74')]&&_0x50d51f[_0x7e13('0x37')](_0x4eb17d,_0x4d560c[_0x142652]['orderBy']==='DESC'?![]:!![]);_0x50d51f[_0x7e13('0x63')](_0x4eb17d,_0x4d560c[_0x142652][_0x7e13('0xa3')]||_0x4eb17d);}if(_0x490d8e['joins']){_0x490d8e[_0x7e13('0x76')]=JSON[_0x7e13('0x7e')](_0x490d8e['joins']);for(var _0x5ceba9=0x0;_0x5ceba9<_0x490d8e[_0x7e13('0x76')]['length'];_0x5ceba9+=0x1){if(_0x490d8e[_0x7e13('0x76')][_0x5ceba9][_0x7e13('0x2b')]&&_['includes'](_0x3befe7,_0x490d8e['joins'][_0x5ceba9][_0x7e13('0x2b')])&&_0x490d8e[_0x7e13('0x76')][_0x5ceba9][_0x7e13('0x7c')]&&_0x490d8e[_0x7e13('0x76')][_0x5ceba9][_0x7e13('0x77')]&&_0x490d8e[_0x7e13('0x76')][_0x5ceba9][_0x7e13('0x78')]){_0x50d51f[_0x490d8e[_0x7e13('0x76')][_0x5ceba9][_0x7e13('0x2b')]](_0x490d8e[_0x7e13('0x76')][_0x5ceba9][_0x7e13('0x77')],null,util[_0x7e13('0x79')]('%s.%s\x20=\x20%s.%s',_0x490d8e[_0x7e13('0x7b')],_0x490d8e[_0x7e13('0x76')][_0x5ceba9]['parentKey'],_0x490d8e['joins'][_0x5ceba9][_0x7e13('0x77')],_0x490d8e[_0x7e13('0x76')][_0x5ceba9]['foreignKey']));}}}if(_0x490d8e[_0x7e13('0x7d')]){_0x490d8e[_0x7e13('0x7d')]=JSON[_0x7e13('0x7e')](_0x490d8e[_0x7e13('0x7d')]);_0x50d51f[_0x7e13('0x3b')](_0x206e99(_0x490d8e[_0x7e13('0x7d')][_0x7e13('0x62')]));}_0x3294e8=_0x50d51f[_0x7e13('0x7f')]();_0x50d51f[_0x7e13('0x1d')](_0x5e0562);_0x50d51f[_0x7e13('0x1b')](0x0);logger[_0x7e13('0xa4')](_0x7e13('0x80'),_0x50d51f[_0x7e13('0x82')]());return dbH[_0x7e13('0x81')][_0x7e13('0x2e')](_0x50d51f[_0x7e13('0x82')](),{'type':dbH[_0x7e13('0x81')][_0x7e13('0x83')][_0x7e13('0x84')]});}})[_0x7e13('0x23')](function(){return{'sql':_0x3294e8[_0x7e13('0x82')]()};})[_0x7e13('0x23')](respondWithResult(_0x2e78a2,null))['catch'](handleError(_0x2e78a2,null));};
\ No newline at end of file
diff --git a/server/api/analyticCustomReport/analyticCustomReport.model.js b/server/api/analyticCustomReport/analyticCustomReport.model.js
index 8aea977..a9d7061 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 _0x8883=['AnalyticCustomReport','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./analyticCustomReport.attributes','define'];(function(_0x2c6ba4,_0x5b2f52){var _0x5036ad=function(_0x422e2a){while(--_0x422e2a){_0x2c6ba4['push'](_0x2c6ba4['shift']());}};_0x5036ad(++_0x5b2f52);}(_0x8883,0xde));var _0x3888=function(_0x4cf69c,_0x5129c6){_0x4cf69c=_0x4cf69c-0x0;var _0x3cb05b=_0x8883[_0x4cf69c];return _0x3cb05b;};'use strict';var _=require(_0x3888('0x0'));var util=require(_0x3888('0x1'));var logger=require(_0x3888('0x2'))(_0x3888('0x3'));var moment=require(_0x3888('0x4'));var BPromise=require(_0x3888('0x5'));var rp=require(_0x3888('0x6'));var fs=require('fs');var path=require(_0x3888('0x7'));var rimraf=require(_0x3888('0x8'));var config=require(_0x3888('0x9'));var attributes=require(_0x3888('0xa'));module['exports']=function(_0x4dc7eb,_0x767e92){return _0x4dc7eb[_0x3888('0xb')](_0x3888('0xc'),attributes,{'tableName':'analytics_custom_reports','paranoid':!![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xf31b=['analytics_custom_reports','lodash','util','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','exports','define'];(function(_0x5c5c52,_0x36d085){var _0x4229ff=function(_0x3806df){while(--_0x3806df){_0x5c5c52['push'](_0x5c5c52['shift']());}};_0x4229ff(++_0x36d085);}(_0xf31b,0xa9));var _0xbf31=function(_0x5ccb7d,_0x546ead){_0x5ccb7d=_0x5ccb7d-0x0;var _0x53e62d=_0xf31b[_0x5ccb7d];return _0x53e62d;};'use strict';var _=require(_0xbf31('0x0'));var util=require(_0xbf31('0x1'));var logger=require('../../config/logger')(_0xbf31('0x2'));var moment=require(_0xbf31('0x3'));var BPromise=require(_0xbf31('0x4'));var rp=require(_0xbf31('0x5'));var fs=require('fs');var path=require(_0xbf31('0x6'));var rimraf=require(_0xbf31('0x7'));var config=require(_0xbf31('0x8'));var attributes=require('./analyticCustomReport.attributes');module[_0xbf31('0x9')]=function(_0x571c16,_0x40b9e9){return _0x571c16[_0xbf31('0xa')]('AnalyticCustomReport',attributes,{'tableName':_0xbf31('0xb'),'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 601e363..4633058 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 _0x66c7=['ioredis','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','AnalyticCustomReport,\x20%s,\x20%s','request\x20sent','debug','AnalyticCustomReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','catch','lodash','util','moment','randomstring'];(function(_0x30b3ab,_0x5b5995){var _0x4f454d=function(_0x3a069e){while(--_0x3a069e){_0x30b3ab['push'](_0x30b3ab['shift']());}};_0x4f454d(++_0x5b5995);}(_0x66c7,0x161));var _0x766c=function(_0xd341da,_0x24be3f){_0xd341da=_0xd341da-0x0;var _0x35a42b=_0x66c7[_0xd341da];return _0x35a42b;};'use strict';var _=require(_0x766c('0x0'));var util=require(_0x766c('0x1'));var moment=require(_0x766c('0x2'));var BPromise=require('bluebird');var rs=require(_0x766c('0x3'));var fs=require('fs');var Redis=require(_0x766c('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x766c('0x5'));var logger=require(_0x766c('0x6'))('rpc');var config=require(_0x766c('0x7'));var jayson=require(_0x766c('0x8'));var client=jayson[_0x766c('0x9')][_0x766c('0xa')]({'port':0x232a});function respondWithRpcPromise(_0xce13b2,_0x45c180,_0x1484c9){return new BPromise(function(_0x525af9,_0x4d8cea){return client['request'](_0xce13b2,_0x1484c9)['then'](function(_0x4cc7cb){logger['info'](_0x766c('0xb'),_0x45c180,_0x766c('0xc'));logger[_0x766c('0xd')](_0x766c('0xe'),_0x45c180,_0x766c('0xc'),JSON[_0x766c('0xf')](_0x4cc7cb));if(_0x4cc7cb[_0x766c('0x10')]){if(_0x4cc7cb[_0x766c('0x10')][_0x766c('0x11')]===0x1f4){logger[_0x766c('0x10')]('AnalyticCustomReport,\x20%s,\x20%s',_0x45c180,_0x4cc7cb['error'][_0x766c('0x12')]);return _0x4d8cea(_0x4cc7cb[_0x766c('0x10')][_0x766c('0x12')]);}logger[_0x766c('0x10')](_0x766c('0xb'),_0x45c180,_0x4cc7cb[_0x766c('0x10')][_0x766c('0x12')]);return _0x525af9(_0x4cc7cb[_0x766c('0x10')]['message']);}else{logger[_0x766c('0x13')](_0x766c('0xb'),_0x45c180,_0x766c('0xc'));_0x525af9(_0x4cc7cb['result'][_0x766c('0x12')]);}})[_0x766c('0x14')](function(_0x3e3e87){logger[_0x766c('0x10')]('AnalyticCustomReport,\x20%s,\x20%s',_0x45c180,_0x3e3e87);_0x4d8cea(_0x3e3e87);});});}
\ No newline at end of file
+var _0x4105=['bluebird','randomstring','../../mysqldb','../../config/environment','jayson/promise','http','info','AnalyticCustomReport,\x20%s,\x20%s','request\x20sent','AnalyticCustomReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','lodash','util','moment'];(function(_0x2d7f0e,_0x3e6fbd){var _0x110b07=function(_0x557b00){while(--_0x557b00){_0x2d7f0e['push'](_0x2d7f0e['shift']());}};_0x110b07(++_0x3e6fbd);}(_0x4105,0x1d1));var _0x5410=function(_0x4e2b67,_0xf1e740){_0x4e2b67=_0x4e2b67-0x0;var _0x1cd340=_0x4105[_0x4e2b67];return _0x1cd340;};'use strict';var _=require(_0x5410('0x0'));var util=require(_0x5410('0x1'));var moment=require(_0x5410('0x2'));var BPromise=require(_0x5410('0x3'));var rs=require(_0x5410('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x5410('0x5'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')('rpc');var config=require(_0x5410('0x6'));var jayson=require(_0x5410('0x7'));var client=jayson['client'][_0x5410('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x58ac56,_0x536eb2,_0xb5abed){return new BPromise(function(_0x3095e9,_0x2814e5){return client['request'](_0x58ac56,_0xb5abed)['then'](function(_0x2032a3){logger[_0x5410('0x9')](_0x5410('0xa'),_0x536eb2,_0x5410('0xb'));logger['debug'](_0x5410('0xc'),_0x536eb2,_0x5410('0xb'),JSON[_0x5410('0xd')](_0x2032a3));if(_0x2032a3['error']){if(_0x2032a3[_0x5410('0xe')][_0x5410('0xf')]===0x1f4){logger[_0x5410('0xe')](_0x5410('0xa'),_0x536eb2,_0x2032a3[_0x5410('0xe')][_0x5410('0x10')]);return _0x2814e5(_0x2032a3[_0x5410('0xe')][_0x5410('0x10')]);}logger[_0x5410('0xe')](_0x5410('0xa'),_0x536eb2,_0x2032a3['error']['message']);return _0x3095e9(_0x2032a3[_0x5410('0xe')][_0x5410('0x10')]);}else{logger[_0x5410('0x9')](_0x5410('0xa'),_0x536eb2,_0x5410('0xb'));_0x3095e9(_0x2032a3['result'][_0x5410('0x10')]);}})[_0x5410('0x11')](function(_0x5bd1e1){logger[_0x5410('0xe')]('AnalyticCustomReport,\x20%s,\x20%s',_0x536eb2,_0x5bd1e1);_0x2814e5(_0x5bd1e1);});});}
\ No newline at end of file
diff --git a/server/api/analyticCustomReport/index.js b/server/api/analyticCustomReport/index.js
index b7c57bd..aebfe2a 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 _0xf76c=['delete','destroy','exports','multer','util','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/:id','show','/:id/preview','/:id/run','/:id/query','query','post','create'];(function(_0x581b73,_0x4fa43c){var _0x3ea0ec=function(_0x2bf299){while(--_0x2bf299){_0x581b73['push'](_0x581b73['shift']());}};_0x3ea0ec(++_0x4fa43c);}(_0xf76c,0x137));var _0xcf76=function(_0x32179c,_0x32fb68){_0x32179c=_0x32179c-0x0;var _0xad3766=_0xf76c[_0x32179c];return _0xad3766;};'use strict';var multer=require(_0xcf76('0x0'));var util=require(_0xcf76('0x1'));var path=require('path');var timeout=require(_0xcf76('0x2'));var express=require(_0xcf76('0x3'));var router=express[_0xcf76('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0xcf76('0x5'));var interaction=require(_0xcf76('0x6'));var config=require(_0xcf76('0x7'));var controller=require('./analyticCustomReport.controller');router[_0xcf76('0x8')]('/',auth[_0xcf76('0x9')](),controller[_0xcf76('0xa')]);router['get'](_0xcf76('0xb'),auth[_0xcf76('0x9')](),controller[_0xcf76('0xc')]);router['get'](_0xcf76('0xd'),auth[_0xcf76('0x9')](),controller['preview']);router['get'](_0xcf76('0xe'),auth[_0xcf76('0x9')](),controller['run']);router[_0xcf76('0x8')](_0xcf76('0xf'),auth[_0xcf76('0x9')](),controller[_0xcf76('0x10')]);router[_0xcf76('0x11')]('/',auth[_0xcf76('0x9')](),controller[_0xcf76('0x12')]);router['put']('/:id',auth[_0xcf76('0x9')](),controller['update']);router[_0xcf76('0x13')](_0xcf76('0xb'),auth[_0xcf76('0x9')](),controller[_0xcf76('0x14')]);module[_0xcf76('0x15')]=router;
\ No newline at end of file
+var _0xf900=['run','query','put','/:id','update','delete','destroy','exports','multer','util','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./analyticCustomReport.controller','isAuthenticated','index','get','/:id/preview','preview','/:id/run'];(function(_0x267bb1,_0x5c29db){var _0x101caa=function(_0x2f061c){while(--_0x2f061c){_0x267bb1['push'](_0x267bb1['shift']());}};_0x101caa(++_0x5c29db);}(_0xf900,0x140));var _0x0f90=function(_0x53ccf2,_0x13cb67){_0x53ccf2=_0x53ccf2-0x0;var _0x5a2964=_0xf900[_0x53ccf2];return _0x5a2964;};'use strict';var multer=require(_0x0f90('0x0'));var util=require(_0x0f90('0x1'));var path=require('path');var timeout=require(_0x0f90('0x2'));var express=require(_0x0f90('0x3'));var router=express[_0x0f90('0x4')]();var fs_extra=require(_0x0f90('0x5'));var auth=require(_0x0f90('0x6'));var interaction=require(_0x0f90('0x7'));var config=require(_0x0f90('0x8'));var controller=require(_0x0f90('0x9'));router['get']('/',auth[_0x0f90('0xa')](),controller[_0x0f90('0xb')]);router[_0x0f90('0xc')]('/:id',auth[_0x0f90('0xa')](),controller['show']);router['get'](_0x0f90('0xd'),auth[_0x0f90('0xa')](),controller[_0x0f90('0xe')]);router[_0x0f90('0xc')](_0x0f90('0xf'),auth[_0x0f90('0xa')](),controller[_0x0f90('0x10')]);router[_0x0f90('0xc')]('/:id/query',auth[_0x0f90('0xa')](),controller[_0x0f90('0x11')]);router['post']('/',auth[_0x0f90('0xa')](),controller['create']);router[_0x0f90('0x12')](_0x0f90('0x13'),auth[_0x0f90('0xa')](),controller[_0x0f90('0x14')]);router[_0x0f90('0x15')]('/:id',auth[_0x0f90('0xa')](),controller[_0x0f90('0x16')]);module[_0x0f90('0x17')]=router;
\ No newline at end of file
diff --git a/server/api/analyticDefaultReport/analyticDefaultReport.attributes.js b/server/api/analyticDefaultReport/analyticDefaultReport.attributes.js
index 7b3695c..f08fbc9 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 _0x33c5=['STRING','TEXT','exports'];(function(_0x8eb530,_0xb4b40f){var _0x2673ab=function(_0x15651f){while(--_0x15651f){_0x8eb530['push'](_0x8eb530['shift']());}};_0x2673ab(++_0xb4b40f);}(_0x33c5,0xe6));var _0x533c=function(_0x582d0b,_0x28f609){_0x582d0b=_0x582d0b-0x0;var _0x2e93e1=_0x33c5[_0x582d0b];return _0x2e93e1;};'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
+var _0x5fd1=['STRING','TEXT','sequelize'];(function(_0x301c34,_0x15701e){var _0x1a8c5a=function(_0x297b4f){while(--_0x297b4f){_0x301c34['push'](_0x301c34['shift']());}};_0x1a8c5a(++_0x15701e);}(_0x5fd1,0x155));var _0x15fd=function(_0x4e9160,_0x24cfe9){_0x4e9160=_0x4e9160-0x0;var _0x168a15=_0x5fd1[_0x4e9160];return _0x168a15;};'use strict';var Sequelize=require(_0x15fd('0x0'));module['exports']={'name':{'type':Sequelize[_0x15fd('0x1')],'allowNull':![]},'description':{'type':Sequelize[_0x15fd('0x1')]},'parent':{'type':Sequelize[_0x15fd('0x1')]},'table':{'type':Sequelize['STRING']},'conditions':{'type':Sequelize['TEXT']},'joins':{'type':Sequelize[_0x15fd('0x2')]}};
\ No newline at end of file
diff --git a/server/api/analyticDefaultReport/analyticDefaultReport.controller.js b/server/api/analyticDefaultReport/analyticDefaultReport.controller.js
index ed1a53d..b822af1 100644
--- a/server/api/analyticDefaultReport/analyticDefaultReport.controller.js
+++ b/server/api/analyticDefaultReport/analyticDefaultReport.controller.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x1261=['rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','fs-extra','lodash','crypto','jsforce','desk.js','to-csv','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/utils','../../config/license/util','../../mysqldb','dbH','sendStatus','status','offset','limit','undefined','set','json','apply','reject','save','then','destroy','get','DefaultReports','UserProfileResource','error','name','index','AnalyticDefaultReport','rawAttributes','fieldName','type','key','model','query','keys','filters','attributes','intersection','fields','nolimit','sort','where','pick','filter','merge','map','VIRTUAL','count','include','findAll','rows','show','length','includeAll','options','find','catch','create','body','user','role','UserProfileSection','userProfileId','autoAssociation','params','preview','join','right_join','cross_join','SUM(%s)','COUNT(%s)','COUNT(DISTINCT\x20%s)','MAX(%s)','MIN(%s)','GROUP_CONCAT(%s)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)','SEC_TO_TIME(%s)','HOUR(%s)','ROUND(%s)','includes','IS\x20NULL','IS\x20EMPTY','IS\x20NOT\x20EMPTY','rules','operator','group','field','condition','getFields','ValidationErrorItem','Please\x20insert\x20at\x20least\x20one\x20field','AnalyticMetric','from','table','MetricId','metric','function','replace','format','groupBy','orderBy','DESC','alias','joins','parentKey','foreignTable','foreignKey','conditions','parse','Limited\x20Query:','toString','sequelize','QueryTypes','SELECT','left_join','AVG(%s)','DATE(%s)','value','keyBy','select','order','%s.%s\x20=\x20%s.%s','clone','web','fullPath','randomstring','generate','output','csv','default','AnalyticExtractedReport','cdr','.calldate\x20BETWEEN\x20?\x20AND\x20?','startDate','endDate','Run\x20Query:','../../components/export/','savename','COUNT(*)','run','runReport','UNIX_TIMESTAMP(%s)','IS\x20NOT\x20NULL','Sequelize','debug'];(function(_0x22a585,_0x17b18a){var _0x235bb9=function(_0x574d2b){while(--_0x574d2b){_0x22a585['push'](_0x22a585['shift']());}};_0x235bb9(++_0x17b18a);}(_0x1261,0x144));var _0x1126=function(_0x1385f0,_0x5550bb){_0x1385f0=_0x1385f0-0x0;var _0x36ca00=_0x1261[_0x1385f0];return _0x36ca00;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x1126('0x0'));var zipdir=require(_0x1126('0x1'));var jsonpatch=require(_0x1126('0x2'));var rp=require(_0x1126('0x3'));var moment=require(_0x1126('0x4'));var BPromise=require(_0x1126('0x5'));var Mustache=require(_0x1126('0x6'));var util=require(_0x1126('0x7'));var path=require(_0x1126('0x8'));var sox=require(_0x1126('0x9'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x1126('0xa'));var _=require(_0x1126('0xb'));var squel=require('squel');var crypto=require(_0x1126('0xc'));var jsforce=require(_0x1126('0xd'));var deskjs=require(_0x1126('0xe'));var toCsv=require(_0x1126('0xf'));var querystring=require(_0x1126('0x10'));var Papa=require('papaparse');var Redis=require(_0x1126('0x11'));var authService=require(_0x1126('0x12'));var qs=require(_0x1126('0x13'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x1126('0x14'));var logger=require('../../config/logger')('api');var utils=require(_0x1126('0x15'));var config=require('../../config/environment');var licenseUtil=require(_0x1126('0x16'));var db=require(_0x1126('0x17'))['db'];var dbH=require(_0x1126('0x17'))[_0x1126('0x18')];function respondWithStatusCode(_0xca0355,_0x3f10e9){_0x3f10e9=_0x3f10e9||0xcc;return function(_0xd8ca42){if(_0xd8ca42){return _0xca0355[_0x1126('0x19')](_0x3f10e9);}return _0xca0355[_0x1126('0x1a')](_0x3f10e9)['end']();};}function respondWithResult(_0x5de9a7,_0x1af673){_0x1af673=_0x1af673||0xc8;return function(_0x154e20){if(_0x154e20){return _0x5de9a7[_0x1126('0x1a')](_0x1af673)['json'](_0x154e20);}};}function respondWithFilteredResult(_0x45149c,_0x4794a7){return function(_0x35fe9f){if(_0x35fe9f){var _0x42f379=typeof _0x4794a7[_0x1126('0x1b')]==='undefined'&&typeof _0x4794a7[_0x1126('0x1c')]===_0x1126('0x1d');var _0x4a7b49=_0x35fe9f['count'];var _0x22ae0b=_0x42f379?0x0:_0x4794a7[_0x1126('0x1b')];var _0x58d11a=_0x42f379?_0x35fe9f['count']:_0x4794a7[_0x1126('0x1b')]+_0x4794a7['limit'];var _0x22ed37;if(_0x58d11a>=_0x4a7b49){_0x58d11a=_0x4a7b49;_0x22ed37=0xc8;}else{_0x22ed37=0xce;}_0x45149c[_0x1126('0x1a')](_0x22ed37);return _0x45149c[_0x1126('0x1e')]('Content-Range',_0x22ae0b+'-'+_0x58d11a+'/'+_0x4a7b49)[_0x1126('0x1f')](_0x35fe9f);}return null;};}function patchUpdates(_0x49d209){return function(_0x56efeb){try{jsonpatch[_0x1126('0x20')](_0x56efeb,_0x49d209,!![]);}catch(_0x3a9bed){return BPromise[_0x1126('0x21')](_0x3a9bed);}return _0x56efeb[_0x1126('0x22')]();};}function saveUpdates(_0x526ca1,_0x29ab60){return function(_0x477e6a){if(_0x477e6a){return _0x477e6a['update'](_0x526ca1)[_0x1126('0x23')](function(_0x59cd8e){return _0x59cd8e;});}return null;};}function removeEntity(_0x529dd9,_0x4b57ab){return function(_0x2199d9){if(_0x2199d9){return _0x2199d9[_0x1126('0x24')]()[_0x1126('0x23')](function(){var _0x34bcf1=_0x2199d9[_0x1126('0x25')]({'plain':!![]});var _0x1b07a7=_0x1126('0x26');return db[_0x1126('0x27')]['destroy']({'where':{'type':_0x1b07a7,'resourceId':_0x34bcf1['id']}})[_0x1126('0x23')](function(){return _0x2199d9;});})[_0x1126('0x23')](function(){_0x529dd9[_0x1126('0x1a')](0xcc)['end']();});}};}function handleEntityNotFound(_0x541bc9,_0xeb7d89){return function(_0x39bf0e){if(!_0x39bf0e){_0x541bc9['sendStatus'](0x194);}return _0x39bf0e;};}function handleError(_0x2fb797,_0x23d2bc){_0x23d2bc=_0x23d2bc||0x1f4;return function(_0x4a334a){logger[_0x1126('0x28')](_0x4a334a['stack']);if(_0x4a334a[_0x1126('0x29')]){delete _0x4a334a['name'];}_0x2fb797[_0x1126('0x1a')](_0x23d2bc)['send'](_0x4a334a);};}exports[_0x1126('0x2a')]=function(_0x5f2611,_0x5252e0){var _0x4a53ab={},_0x17646e={},_0xa8906d={'count':0x0,'rows':[]};var _0x1cef48=_['map'](db[_0x1126('0x2b')][_0x1126('0x2c')],function(_0x56f7f8){return{'name':_0x56f7f8[_0x1126('0x2d')],'type':_0x56f7f8[_0x1126('0x2e')][_0x1126('0x2f')]};});_0x17646e[_0x1126('0x30')]=_['map'](_0x1cef48,'name');_0x17646e[_0x1126('0x31')]=_[_0x1126('0x32')](_0x5f2611[_0x1126('0x31')]);_0x17646e[_0x1126('0x33')]=_['intersection'](_0x17646e[_0x1126('0x30')],_0x17646e[_0x1126('0x31')]);_0x4a53ab[_0x1126('0x34')]=_[_0x1126('0x35')](_0x17646e[_0x1126('0x30')],qs['fields'](_0x5f2611[_0x1126('0x31')][_0x1126('0x36')]));_0x4a53ab[_0x1126('0x34')]=_0x4a53ab[_0x1126('0x34')]['length']?_0x4a53ab['attributes']:_0x17646e[_0x1126('0x30')];if(!_0x5f2611[_0x1126('0x31')]['hasOwnProperty'](_0x1126('0x37'))){_0x4a53ab[_0x1126('0x1c')]=qs[_0x1126('0x1c')](_0x5f2611['query']['limit']);_0x4a53ab[_0x1126('0x1b')]=qs[_0x1126('0x1b')](_0x5f2611[_0x1126('0x31')][_0x1126('0x1b')]);}_0x4a53ab['order']=qs[_0x1126('0x38')](_0x5f2611['query'][_0x1126('0x38')]);_0x4a53ab[_0x1126('0x39')]=qs[_0x1126('0x33')](_[_0x1126('0x3a')](_0x5f2611[_0x1126('0x31')],_0x17646e['filters']),_0x1cef48);if(_0x5f2611[_0x1126('0x31')][_0x1126('0x3b')]){_0x4a53ab[_0x1126('0x39')]=_[_0x1126('0x3c')](_0x4a53ab[_0x1126('0x39')],{'$or':_[_0x1126('0x3d')](_0x1cef48,function(_0x3052f9){if(_0x3052f9['type']!==_0x1126('0x3e')){var _0x154c28={};_0x154c28[_0x3052f9[_0x1126('0x29')]]={'$like':'%'+_0x5f2611[_0x1126('0x31')][_0x1126('0x3b')]+'%'};return _0x154c28;}})});}_0x4a53ab=_['merge']({},_0x4a53ab,_0x5f2611['options']);var _0x1c4f06={'where':_0x4a53ab[_0x1126('0x39')]};return db[_0x1126('0x2b')][_0x1126('0x3f')](_0x1c4f06)[_0x1126('0x23')](function(_0x276fd5){_0xa8906d['count']=_0x276fd5;if(_0x5f2611['query']['includeAll']){_0x4a53ab[_0x1126('0x40')]=[{'all':!![]}];}return db['AnalyticDefaultReport'][_0x1126('0x41')](_0x4a53ab);})[_0x1126('0x23')](function(_0x3584a3){_0xa8906d[_0x1126('0x42')]=_0x3584a3;return _0xa8906d;})['then'](respondWithFilteredResult(_0x5252e0,_0x4a53ab))['catch'](handleError(_0x5252e0,null));};exports[_0x1126('0x43')]=function(_0xa93167,_0x1d63b9){var _0x5f5d3a={'raw':!![],'where':{'id':_0xa93167['params']['id']}},_0x2f8551={};_0x2f8551[_0x1126('0x30')]=_['keys'](db[_0x1126('0x2b')][_0x1126('0x2c')]);_0x2f8551[_0x1126('0x31')]=_['keys'](_0xa93167[_0x1126('0x31')]);_0x2f8551[_0x1126('0x33')]=_[_0x1126('0x35')](_0x2f8551['model'],_0x2f8551['query']);_0x5f5d3a['attributes']=_[_0x1126('0x35')](_0x2f8551['model'],qs[_0x1126('0x36')](_0xa93167['query'][_0x1126('0x36')]));_0x5f5d3a[_0x1126('0x34')]=_0x5f5d3a[_0x1126('0x34')][_0x1126('0x44')]?_0x5f5d3a[_0x1126('0x34')]:_0x2f8551['model'];if(_0xa93167[_0x1126('0x31')][_0x1126('0x45')]){_0x5f5d3a['include']=[{'all':!![]}];}_0x5f5d3a=_[_0x1126('0x3c')]({},_0x5f5d3a,_0xa93167[_0x1126('0x46')]);return db['AnalyticDefaultReport'][_0x1126('0x47')](_0x5f5d3a)[_0x1126('0x23')](handleEntityNotFound(_0x1d63b9,null))['then'](respondWithResult(_0x1d63b9,null))[_0x1126('0x48')](handleError(_0x1d63b9,null));};exports[_0x1126('0x49')]=function(_0x213a76,_0x59656d){return db[_0x1126('0x2b')][_0x1126('0x49')](_0x213a76[_0x1126('0x4a')],{})[_0x1126('0x23')](function(_0x224456){var _0x2081f2=_0x213a76[_0x1126('0x4b')][_0x1126('0x25')]({'plain':!![]});if(!_0x2081f2)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x2081f2[_0x1126('0x4c')]==='user'){var _0x40168e=_0x224456[_0x1126('0x25')]({'plain':!![]});var _0x4a1831='Reports';return db[_0x1126('0x4d')][_0x1126('0x47')]({'where':{'name':_0x4a1831,'userProfileId':_0x2081f2[_0x1126('0x4e')]},'raw':!![]})['then'](function(_0x3cb44c){if(_0x3cb44c&&_0x3cb44c[_0x1126('0x4f')]===0x0){return db[_0x1126('0x27')][_0x1126('0x49')]({'name':_0x40168e['name'],'resourceId':_0x40168e['id'],'type':_0x1126('0x26'),'sectionId':_0x3cb44c['id']},{})[_0x1126('0x23')](function(){return _0x224456;});}else{return _0x224456;}})['catch'](function(_0x4bcc08){logger['error']('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x4bcc08);throw _0x4bcc08;});}return _0x224456;})[_0x1126('0x23')](respondWithResult(_0x59656d,0xc9))[_0x1126('0x48')](handleError(_0x59656d,null));};exports['update']=function(_0x16552b,_0x1c7a2b){if(_0x16552b[_0x1126('0x4a')]['id']){delete _0x16552b[_0x1126('0x4a')]['id'];}return db[_0x1126('0x2b')]['find']({'where':{'id':_0x16552b[_0x1126('0x50')]['id']}})[_0x1126('0x23')](handleEntityNotFound(_0x1c7a2b,null))['then'](saveUpdates(_0x16552b[_0x1126('0x4a')],null))[_0x1126('0x23')](respondWithResult(_0x1c7a2b,null))[_0x1126('0x48')](handleError(_0x1c7a2b,null));};exports[_0x1126('0x24')]=function(_0xc8a0f,_0x59c3d0){return db[_0x1126('0x2b')]['find']({'where':{'id':_0xc8a0f[_0x1126('0x50')]['id']}})[_0x1126('0x23')](handleEntityNotFound(_0x59c3d0,null))[_0x1126('0x23')](removeEntity(_0x59c3d0,null))['catch'](handleError(_0x59c3d0,null));};exports[_0x1126('0x51')]=function(_0x2340f8,_0x5763b4){var _0x30812d=0xa;var _0x25038f=[_0x1126('0x52'),'left_join',_0x1126('0x53'),_0x1126('0x54')];var _0x22ab18={'SUM':_0x1126('0x55'),'COUNT':_0x1126('0x56'),'COUNT DISTINCT':_0x1126('0x57'),'MAX':_0x1126('0x58'),'MIN':_0x1126('0x59'),'AVG':'AVG(%s)','GROUP_CONCAT':_0x1126('0x5a'),'GROUP_CONCAT ASC':_0x1126('0x5b'),'GROUP_CONCAT DESC':_0x1126('0x5c')};var _0x2a5422={'SEC_TO_TIME':_0x1126('0x5d'),'DATE':'DATE(%s)','HOUR':_0x1126('0x5e'),'ROUND':_0x1126('0x5f'),'UNIX_TIMESTAMP':'UNIX_TIMESTAMP(%s)'};var _0x3767e4=function(_0x5246aa){return!_[_0x1126('0x60')]([_0x1126('0x61'),'IS\x20NOT\x20NULL',_0x1126('0x62'),_0x1126('0x63')],_0x5246aa);};var _0x375b76=function(_0x592960){if(!_0x592960||!_0x592960[_0x1126('0x64')]['length']){return'';}for(var _0x558b6e='(',_0xbdc58=0x0;_0xbdc58<_0x592960[_0x1126('0x64')][_0x1126('0x44')];_0xbdc58+=0x1){_0xbdc58>0x0&&(_0x558b6e+='\x20'+_0x592960[_0x1126('0x65')]+'\x20');_0x558b6e+=_0x592960[_0x1126('0x64')][_0xbdc58][_0x1126('0x66')]?_0x375b76(_0x592960[_0x1126('0x64')][_0xbdc58]['group']):_0x592960[_0x1126('0x64')][_0xbdc58][_0x1126('0x67')]+'\x20'+_0x592960[_0x1126('0x64')][_0xbdc58][_0x1126('0x68')]+(_0x3767e4(_0x592960[_0x1126('0x64')][_0xbdc58][_0x1126('0x68')])?'\x20'+_0x592960['rules'][_0xbdc58]['value']:'');}return _0x558b6e+')';};var _0x16a343={'where':{'id':_0x2340f8[_0x1126('0x50')]['id']}},_0x3921c2,_0x4bf2b3,_0x5ee130,_0x5e9260,_0x51a28d;_0x16a343=_[_0x1126('0x3c')]({},_0x16a343,_0x2340f8[_0x1126('0x46')]);return db['AnalyticDefaultReport'][_0x1126('0x47')](_0x16a343)[_0x1126('0x23')](function(_0x170bf0){if(_0x170bf0){_0x3921c2=_0x170bf0;return _0x170bf0[_0x1126('0x69')]();}return null;})[_0x1126('0x23')](function(_0x3f007b){if(_0x3f007b){if(!_0x3f007b[_0x1126('0x44')]){throw new db['Sequelize'][(_0x1126('0x6a'))](_0x1126('0x6b'),0x193);}_0x4bf2b3=_0x3f007b;return db[_0x1126('0x6c')][_0x1126('0x41')]({'raw':!![]});}return null;})[_0x1126('0x23')](function(_0x56c003){if(_0x56c003){_0x5ee130=_['keyBy'](_0x56c003,'id');var _0x15cf3d;var _0x2643d7=squel['select']();_0x2643d7[_0x1126('0x6d')](_0x3921c2[_0x1126('0x6e')]);for(var _0x366675=0x0;_0x366675<_0x4bf2b3[_0x1126('0x44')];_0x366675+=0x1){_0x15cf3d=_0x4bf2b3[_0x366675][_0x1126('0x6f')]?_0x5ee130[_0x4bf2b3[_0x366675][_0x1126('0x6f')]][_0x1126('0x70')]:_0x4bf2b3[_0x366675][_0x1126('0x67')];_0x15cf3d=_0x4bf2b3[_0x366675][_0x1126('0x71')]?_[_0x1126('0x72')](_0x22ab18[_0x4bf2b3[_0x366675][_0x1126('0x71')]],'%s',_0x15cf3d):_0x15cf3d;_0x15cf3d=_0x4bf2b3[_0x366675][_0x1126('0x73')]?_[_0x1126('0x72')](_0x2a5422[_0x4bf2b3[_0x366675]['format']],'%s',_0x15cf3d):_0x15cf3d;if(_0x4bf2b3[_0x366675][_0x1126('0x74')]){_0x2643d7[_0x1126('0x66')](_0x15cf3d);}_0x4bf2b3[_0x366675][_0x1126('0x75')]&&_0x2643d7['order'](_0x15cf3d,_0x4bf2b3[_0x366675]['orderBy']===_0x1126('0x76')?![]:!![]);_0x2643d7[_0x1126('0x67')](_0x15cf3d,_0x4bf2b3[_0x366675][_0x1126('0x77')]||_0x15cf3d);}if(_0x3921c2[_0x1126('0x78')]){_0x3921c2['joins']=JSON['parse'](_0x3921c2['joins']);for(var _0x79afca=0x0;_0x79afca<_0x3921c2[_0x1126('0x78')][_0x1126('0x44')];_0x79afca+=0x1){if(_0x3921c2[_0x1126('0x78')][_0x79afca]['type']&&_[_0x1126('0x60')](_0x25038f,_0x3921c2['joins'][_0x79afca][_0x1126('0x2e')])&&_0x3921c2[_0x1126('0x78')][_0x79afca][_0x1126('0x79')]&&_0x3921c2[_0x1126('0x78')][_0x79afca][_0x1126('0x7a')]&&_0x3921c2[_0x1126('0x78')][_0x79afca][_0x1126('0x7b')]){_0x2643d7[_0x3921c2['joins'][_0x79afca][_0x1126('0x2e')]](_0x3921c2['joins'][_0x79afca][_0x1126('0x7a')],null,util[_0x1126('0x73')]('%s.%s\x20=\x20%s.%s',_0x3921c2[_0x1126('0x6e')],_0x3921c2[_0x1126('0x78')][_0x79afca]['parentKey'],_0x3921c2[_0x1126('0x78')][_0x79afca][_0x1126('0x7a')],_0x3921c2['joins'][_0x79afca]['foreignKey']));}}}if(_0x3921c2[_0x1126('0x7c')]){_0x3921c2[_0x1126('0x7c')]=JSON[_0x1126('0x7d')](_0x3921c2['conditions']);_0x2643d7['where'](_0x375b76(_0x3921c2['conditions'][_0x1126('0x66')]));}_0x51a28d=_0x2643d7['clone']();_0x2643d7['limit'](_0x30812d);_0x2643d7[_0x1126('0x1b')](0x0);logger['debug'](_0x1126('0x7e'),_0x2643d7[_0x1126('0x7f')]());return dbH['sequelize'][_0x1126('0x31')](_0x2643d7[_0x1126('0x7f')](),{'type':dbH[_0x1126('0x80')][_0x1126('0x81')][_0x1126('0x82')]});}})['then'](respondWithResult(_0x5763b4,null))[_0x1126('0x48')](handleError(_0x5763b4,null));};function runReport(_0x426faa,_0x5679ec,_0xd182b1){var _0x2d6fcf=_0x5679ec[_0x1126('0x29')];var _0x2af2d0=0xa;var _0x2598a7=[_0x1126('0x52'),_0x1126('0x83'),_0x1126('0x53'),_0x1126('0x54')];var _0x9a2af0={'SUM':_0x1126('0x55'),'COUNT':_0x1126('0x56'),'COUNT DISTINCT':_0x1126('0x57'),'MAX':_0x1126('0x58'),'MIN':_0x1126('0x59'),'AVG':_0x1126('0x84'),'GROUP_CONCAT':'GROUP_CONCAT(%s)','GROUP_CONCAT ASC':_0x1126('0x5b'),'GROUP_CONCAT DESC':_0x1126('0x5c')};var _0x33cccf={'SEC_TO_TIME':_0x1126('0x5d'),'DATE':_0x1126('0x85'),'HOUR':'HOUR(%s)','ROUND':_0x1126('0x5f'),'UNIX_TIMESTAMP':'UNIX_TIMESTAMP(%s)'};var _0x5bdb30=function(_0xb1199b){return!_[_0x1126('0x60')](['IS\x20NULL','IS\x20NOT\x20NULL',_0x1126('0x62'),_0x1126('0x63')],_0xb1199b);};var _0x228552=function(_0x1ee970){if(!_0x1ee970||!_0x1ee970[_0x1126('0x64')][_0x1126('0x44')]){return'';}for(var _0x2d7150='(',_0x35a9a4=0x0;_0x35a9a4<_0x1ee970[_0x1126('0x64')]['length'];_0x35a9a4+=0x1){_0x35a9a4>0x0&&(_0x2d7150+='\x20'+_0x1ee970[_0x1126('0x65')]+'\x20');_0x2d7150+=_0x1ee970[_0x1126('0x64')][_0x35a9a4][_0x1126('0x66')]?_0x228552(_0x1ee970[_0x1126('0x64')][_0x35a9a4][_0x1126('0x66')]):_0x1ee970[_0x1126('0x64')][_0x35a9a4]['field']+'\x20'+_0x1ee970[_0x1126('0x64')][_0x35a9a4][_0x1126('0x68')]+(_0x5bdb30(_0x1ee970[_0x1126('0x64')][_0x35a9a4][_0x1126('0x68')])?'\x20'+_0x1ee970[_0x1126('0x64')][_0x35a9a4][_0x1126('0x86')]:'');}return _0x2d7150+')';};var _0x2418ca={'where':{'id':_0x426faa['id']}},_0x2d2dfc,_0x38eac6,_0xc3503b,_0x5d6edb,_0x50238d;_0x2418ca=_[_0x1126('0x3c')]({},_0x2418ca,_0xd182b1);return db['AnalyticDefaultReport'][_0x1126('0x47')](_0x2418ca)['then'](function(_0x4461ae){if(_0x4461ae){_0x2d2dfc=_0x4461ae;return _0x4461ae['getFields']();}return null;})[_0x1126('0x23')](function(_0x4fbd44){if(_0x4fbd44){if(!_0x4fbd44['length']){throw new db['Sequelize'][(_0x1126('0x6a'))](_0x1126('0x6b'),0x193);}_0x38eac6=_0x4fbd44;return db['AnalyticMetric']['findAll']({'raw':!![]});}return null;})[_0x1126('0x23')](function(_0xe2f82d){if(_0xe2f82d){_0xc3503b=_[_0x1126('0x87')](_0xe2f82d,'id');var _0x5dfb8f;var _0x48f914=squel[_0x1126('0x88')]();_0x48f914['from'](_0x2d2dfc[_0x1126('0x6e')]);for(var _0x39d9a0=0x0;_0x39d9a0<_0x38eac6[_0x1126('0x44')];_0x39d9a0+=0x1){_0x5dfb8f=_0x38eac6[_0x39d9a0][_0x1126('0x6f')]?_0xc3503b[_0x38eac6[_0x39d9a0][_0x1126('0x6f')]]['metric']:_0x38eac6[_0x39d9a0]['field'];_0x5dfb8f=_0x38eac6[_0x39d9a0][_0x1126('0x71')]?_[_0x1126('0x72')](_0x9a2af0[_0x38eac6[_0x39d9a0][_0x1126('0x71')]],'%s',_0x5dfb8f):_0x5dfb8f;_0x5dfb8f=_0x38eac6[_0x39d9a0][_0x1126('0x73')]?_[_0x1126('0x72')](_0x33cccf[_0x38eac6[_0x39d9a0][_0x1126('0x73')]],'%s',_0x5dfb8f):_0x5dfb8f;if(_0x38eac6[_0x39d9a0][_0x1126('0x74')]){_0x48f914[_0x1126('0x66')](_0x5dfb8f);}_0x38eac6[_0x39d9a0][_0x1126('0x75')]&&_0x48f914[_0x1126('0x89')](_0x5dfb8f,_0x38eac6[_0x39d9a0][_0x1126('0x75')]==='DESC'?![]:!![]);_0x48f914[_0x1126('0x67')](_0x5dfb8f,_0x38eac6[_0x39d9a0]['alias']||_0x5dfb8f);}if(_0x2d2dfc[_0x1126('0x78')]){_0x2d2dfc['joins']=JSON[_0x1126('0x7d')](_0x2d2dfc[_0x1126('0x78')]);for(var _0x215d4d=0x0;_0x215d4d<_0x2d2dfc[_0x1126('0x78')]['length'];_0x215d4d+=0x1){if(_0x2d2dfc[_0x1126('0x78')][_0x215d4d][_0x1126('0x2e')]&&_['includes'](_0x2598a7,_0x2d2dfc['joins'][_0x215d4d][_0x1126('0x2e')])&&_0x2d2dfc[_0x1126('0x78')][_0x215d4d][_0x1126('0x79')]&&_0x2d2dfc['joins'][_0x215d4d][_0x1126('0x7a')]&&_0x2d2dfc['joins'][_0x215d4d][_0x1126('0x7b')]){_0x48f914[_0x2d2dfc[_0x1126('0x78')][_0x215d4d]['type']](_0x2d2dfc[_0x1126('0x78')][_0x215d4d][_0x1126('0x7a')],null,util[_0x1126('0x73')](_0x1126('0x8a'),_0x2d2dfc[_0x1126('0x6e')],_0x2d2dfc['joins'][_0x215d4d][_0x1126('0x79')],_0x2d2dfc[_0x1126('0x78')][_0x215d4d][_0x1126('0x7a')],_0x2d2dfc['joins'][_0x215d4d]['foreignKey']));}}}if(_0x2d2dfc['conditions']){_0x2d2dfc[_0x1126('0x7c')]=JSON[_0x1126('0x7d')](_0x2d2dfc[_0x1126('0x7c')]);_0x48f914[_0x1126('0x39')](_0x228552(_0x2d2dfc['conditions'][_0x1126('0x66')]));}_0x50238d=_0x48f914[_0x1126('0x8b')]();_0x48f914[_0x1126('0x1c')](_0x2af2d0);_0x48f914[_0x1126('0x1b')](0x0);return;}})[_0x1126('0x23')](function(){if(_0x5679ec['output']===_0x1126('0x8c')){return null;}var _0x21c487=_['merge'](_0x5679ec,{'name':_0x5679ec[_0x1126('0x8d')]||_0x5679ec['name']||_0x2d2dfc['name'],'basename':_0x2d6fcf,'savename':util[_0x1126('0x73')]('%s-%s.%s',_0x5679ec[_0x1126('0x29')]||_0x2d2dfc[_0x1126('0x29')],require(_0x1126('0x8e'))[_0x1126('0x8f')](0x4),_0x5679ec[_0x1126('0x90')]||_0x1126('0x91')),'reportId':_0x2d2dfc['id'],'reportType':_0x1126('0x92')});return db[_0x1126('0x93')][_0x1126('0x49')](_0x21c487,{'raw':!![]});})['then'](function(_0x2577f5){if(_0x2d2dfc[_0x1126('0x6e')]===_0x1126('0x94')){_0x50238d[_0x1126('0x39')](_0x2d2dfc['table']+_0x1126('0x95'),_0x5679ec[_0x1126('0x96')],_0x5679ec[_0x1126('0x97')]);}else{_0x50238d[_0x1126('0x39')](_0x2d2dfc['table']+'.createdAt\x20BETWEEN\x20?\x20AND\x20?',_0x5679ec['startDate'],_0x5679ec[_0x1126('0x97')]);}if(_0x2577f5){logger['info'](_0x1126('0x98'),_0x50238d[_0x1126('0x7f')]());require('child_process')['fork'](path[_0x1126('0x52')](__dirname,_0x1126('0x99'),_0x2577f5['output']),[_0x2577f5['id'],_0x50238d[_0x1126('0x7f')](),path[_0x1126('0x52')](__dirname,'../../files/reports',_0x2577f5[_0x1126('0x9a')]),_0x2d6fcf]);return _0x2577f5;}else{var _0x4a9941=squel[_0x1126('0x88')]();_0x4a9941[_0x1126('0x6d')]('('+_0x50238d[_0x1126('0x7f')]()+')','countTable');_0x4a9941[_0x1126('0x67')](_0x1126('0x9b'),_0x1126('0x3f'));_0x50238d[_0x1126('0x1c')](_0x5679ec[_0x1126('0x1c')]||_0x2af2d0);_0x50238d[_0x1126('0x1b')](_0x5679ec[_0x1126('0x1b')]||0x0);return dbH[_0x1126('0x80')][_0x1126('0x31')](_0x4a9941[_0x1126('0x7f')](),{'type':dbH[_0x1126('0x80')][_0x1126('0x81')][_0x1126('0x82')]})[_0x1126('0x23')](function(_0x12ffa5){if(!_0x12ffa5[_0x1126('0x44')]){_0x5d6edb=0x0;}else{_0x5d6edb=_0x12ffa5[0x0][_0x1126('0x3f')]||0x0;}return dbH['sequelize'][_0x1126('0x31')](_0x50238d[_0x1126('0x7f')](),{'type':dbH['sequelize']['QueryTypes'][_0x1126('0x82')]});})[_0x1126('0x23')](function(_0x35065c){return{'rows':_0x35065c||[],'count':_0x5d6edb};});}});}exports[_0x1126('0x9c')]=function(_0x5c0215,_0x444f94){return runReport(_0x5c0215[_0x1126('0x50')],_0x5c0215['query'],_0x5c0215[_0x1126('0x46')])['then'](respondWithResult(_0x444f94,null))[_0x1126('0x48')](handleError(_0x444f94,null));};exports[_0x1126('0x9d')]=runReport;exports['query']=function(_0x4d43ad,_0xa02d9e){var _0x548f9e=0xa;var _0x5edb83=[_0x1126('0x52'),_0x1126('0x83'),_0x1126('0x53'),_0x1126('0x54')];var _0x4f29ce={'SUM':'SUM(%s)','COUNT':'COUNT(%s)','COUNT DISTINCT':_0x1126('0x57'),'MAX':_0x1126('0x58'),'MIN':'MIN(%s)','AVG':_0x1126('0x84'),'GROUP_CONCAT':_0x1126('0x5a'),'GROUP_CONCAT ASC':_0x1126('0x5b'),'GROUP_CONCAT DESC':_0x1126('0x5c')};var _0x17b25d={'SEC_TO_TIME':_0x1126('0x5d'),'DATE':_0x1126('0x85'),'HOUR':_0x1126('0x5e'),'ROUND':_0x1126('0x5f'),'UNIX_TIMESTAMP':_0x1126('0x9e')};var _0x3a4a91=function(_0x55145f){return!_[_0x1126('0x60')](['IS\x20NULL',_0x1126('0x9f'),_0x1126('0x62'),_0x1126('0x63')],_0x55145f);};var _0x4c7dc7=function(_0x33a27b){if(!_0x33a27b||!_0x33a27b[_0x1126('0x64')][_0x1126('0x44')]){return'';}for(var _0x578c1b='(',_0x1562b2=0x0;_0x1562b2<_0x33a27b[_0x1126('0x64')][_0x1126('0x44')];_0x1562b2+=0x1){_0x1562b2>0x0&&(_0x578c1b+='\x20'+_0x33a27b[_0x1126('0x65')]+'\x20');_0x578c1b+=_0x33a27b[_0x1126('0x64')][_0x1562b2]['group']?_0x4c7dc7(_0x33a27b['rules'][_0x1562b2][_0x1126('0x66')]):_0x33a27b[_0x1126('0x64')][_0x1562b2][_0x1126('0x67')]+'\x20'+_0x33a27b[_0x1126('0x64')][_0x1562b2][_0x1126('0x68')]+(_0x3a4a91(_0x33a27b[_0x1126('0x64')][_0x1562b2][_0x1126('0x68')])?'\x20'+_0x33a27b[_0x1126('0x64')][_0x1562b2][_0x1126('0x86')]:'');}return _0x578c1b+')';};var _0x2fb228={'where':{'id':_0x4d43ad[_0x1126('0x50')]['id']}},_0x2c95b6,_0x4a4b43,_0x588f4f,_0x5ac4d6,_0x1168a5;_0x2fb228=_['merge']({},_0x2fb228,_0x4d43ad['options']);return db[_0x1126('0x2b')][_0x1126('0x47')](_0x2fb228)[_0x1126('0x23')](function(_0x48b088){if(_0x48b088){_0x2c95b6=_0x48b088;return _0x48b088[_0x1126('0x69')]();}return null;})[_0x1126('0x23')](function(_0x5a28f9){if(_0x5a28f9){if(!_0x5a28f9[_0x1126('0x44')]){throw new db[(_0x1126('0xa0'))][(_0x1126('0x6a'))](_0x1126('0x6b'),0x193);}_0x4a4b43=_0x5a28f9;return db[_0x1126('0x6c')]['findAll']({'raw':!![]});}return null;})[_0x1126('0x23')](function(_0x1140ec){if(_0x1140ec){_0x588f4f=_['keyBy'](_0x1140ec,'id');var _0x578f5c;var _0x559dae=squel[_0x1126('0x88')]();_0x559dae[_0x1126('0x6d')](_0x2c95b6[_0x1126('0x6e')]);for(var _0x9d7819=0x0;_0x9d7819<_0x4a4b43[_0x1126('0x44')];_0x9d7819+=0x1){_0x578f5c=_0x4a4b43[_0x9d7819]['MetricId']?_0x588f4f[_0x4a4b43[_0x9d7819][_0x1126('0x6f')]]['metric']:_0x4a4b43[_0x9d7819][_0x1126('0x67')];_0x578f5c=_0x4a4b43[_0x9d7819][_0x1126('0x71')]?_['replace'](_0x4f29ce[_0x4a4b43[_0x9d7819]['function']],'%s',_0x578f5c):_0x578f5c;_0x578f5c=_0x4a4b43[_0x9d7819][_0x1126('0x73')]?_[_0x1126('0x72')](_0x17b25d[_0x4a4b43[_0x9d7819]['format']],'%s',_0x578f5c):_0x578f5c;if(_0x4a4b43[_0x9d7819]['groupBy']){_0x559dae[_0x1126('0x66')](_0x578f5c);}_0x4a4b43[_0x9d7819][_0x1126('0x75')]&&_0x559dae[_0x1126('0x89')](_0x578f5c,_0x4a4b43[_0x9d7819][_0x1126('0x75')]===_0x1126('0x76')?![]:!![]);_0x559dae[_0x1126('0x67')](_0x578f5c,_0x4a4b43[_0x9d7819][_0x1126('0x77')]||_0x578f5c);}if(_0x2c95b6[_0x1126('0x78')]){_0x2c95b6[_0x1126('0x78')]=JSON[_0x1126('0x7d')](_0x2c95b6['joins']);for(var _0x4d6528=0x0;_0x4d6528<_0x2c95b6[_0x1126('0x78')][_0x1126('0x44')];_0x4d6528+=0x1){if(_0x2c95b6[_0x1126('0x78')][_0x4d6528][_0x1126('0x2e')]&&_[_0x1126('0x60')](_0x5edb83,_0x2c95b6[_0x1126('0x78')][_0x4d6528]['type'])&&_0x2c95b6['joins'][_0x4d6528][_0x1126('0x79')]&&_0x2c95b6['joins'][_0x4d6528]['foreignTable']&&_0x2c95b6[_0x1126('0x78')][_0x4d6528][_0x1126('0x7b')]){_0x559dae[_0x2c95b6['joins'][_0x4d6528][_0x1126('0x2e')]](_0x2c95b6[_0x1126('0x78')][_0x4d6528][_0x1126('0x7a')],null,util[_0x1126('0x73')]('%s.%s\x20=\x20%s.%s',_0x2c95b6[_0x1126('0x6e')],_0x2c95b6[_0x1126('0x78')][_0x4d6528][_0x1126('0x79')],_0x2c95b6[_0x1126('0x78')][_0x4d6528][_0x1126('0x7a')],_0x2c95b6[_0x1126('0x78')][_0x4d6528][_0x1126('0x7b')]));}}}if(_0x2c95b6['conditions']){_0x2c95b6[_0x1126('0x7c')]=JSON[_0x1126('0x7d')](_0x2c95b6[_0x1126('0x7c')]);_0x559dae[_0x1126('0x39')](_0x4c7dc7(_0x2c95b6['conditions'][_0x1126('0x66')]));}_0x1168a5=_0x559dae[_0x1126('0x8b')]();_0x559dae['limit'](_0x548f9e);_0x559dae[_0x1126('0x1b')](0x0);logger[_0x1126('0xa1')](_0x1126('0x7e'),_0x559dae['toString']());return dbH[_0x1126('0x80')][_0x1126('0x31')](_0x559dae[_0x1126('0x7f')](),{'type':dbH[_0x1126('0x80')][_0x1126('0x81')][_0x1126('0x82')]});}})['then'](function(){return{'sql':_0x1168a5[_0x1126('0x7f')]()};})[_0x1126('0x23')](respondWithResult(_0xa02d9e,null))['catch'](handleError(_0xa02d9e,null));};
\ No newline at end of file
+var _0x53ec=['IS\x20NULL','IS\x20NOT\x20NULL','IS\x20EMPTY','IS\x20NOT\x20EMPTY','rules','operator','group','field','value','getFields','Please\x20insert\x20at\x20least\x20one\x20field','AnalyticMetric','findAll','keyBy','select','from','table','MetricId','metric','function','format','replace','orderBy','DESC','alias','joins','parentKey','foreignTable','%s.%s\x20=\x20%s.%s','conditions','parse','clone','debug','Limited\x20Query:','sequelize','toString','QueryTypes','right_join','SUM(%s)','COUNT(DISTINCT\x20%s)','GROUP_CONCAT(%s)','HOUR(%s)','ROUND(%s)','condition','Sequelize','groupBy','foreignKey','output','fullPath','%s-%s.%s','randomstring','generate','csv','default','AnalyticExtractedReport','cdr','endDate','.createdAt\x20BETWEEN\x20?\x20AND\x20?','info','Run\x20Query:','child_process','fork','../../files/reports','savename','countTable','COUNT(*)','SELECT','runReport','cross_join','COUNT(%s)','MIN(%s)','ValidationErrorItem','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','path','sox','ejs','lodash','squel','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','api','../../config/license/util','../../mysqldb','dbH','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','update','then','destroy','get','DefaultReports','UserProfileResource','error','stack','name','send','index','map','rawAttributes','key','model','query','keys','filters','attributes','intersection','fields','length','nolimit','order','sort','where','filter','merge','type','include','AnalyticDefaultReport','params','includeAll','options','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','catch','preview','join','left_join','MAX(%s)','AVG(%s)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)','SEC_TO_TIME(%s)','DATE(%s)','UNIX_TIMESTAMP(%s)','includes'];(function(_0x2de0ee,_0x575448){var _0x4bbb06=function(_0xa162ab){while(--_0xa162ab){_0x2de0ee['push'](_0x2de0ee['shift']());}};_0x4bbb06(++_0x575448);}(_0x53ec,0x192));var _0xc53e=function(_0x35ccde,_0xbe027){_0x35ccde=_0x35ccde-0x0;var _0xbd6110=_0x53ec[_0x35ccde];return _0xbd6110;};'use strict';var emlformat=require(_0xc53e('0x0'));var rimraf=require(_0xc53e('0x1'));var zipdir=require(_0xc53e('0x2'));var jsonpatch=require(_0xc53e('0x3'));var rp=require(_0xc53e('0x4'));var moment=require(_0xc53e('0x5'));var BPromise=require('bluebird');var Mustache=require(_0xc53e('0x6'));var util=require('util');var path=require(_0xc53e('0x7'));var sox=require(_0xc53e('0x8'));var csv=require('to-csv');var ejs=require(_0xc53e('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xc53e('0xa'));var squel=require(_0xc53e('0xb'));var crypto=require('crypto');var jsforce=require(_0xc53e('0xc'));var deskjs=require(_0xc53e('0xd'));var toCsv=require(_0xc53e('0xe'));var querystring=require(_0xc53e('0xf'));var Papa=require(_0xc53e('0x10'));var Redis=require(_0xc53e('0x11'));var authService=require(_0xc53e('0x12'));var qs=require(_0xc53e('0x13'));var as=require(_0xc53e('0x14'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0xc53e('0x15'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0xc53e('0x16'));var db=require(_0xc53e('0x17'))['db'];var dbH=require(_0xc53e('0x17'))[_0xc53e('0x18')];function respondWithStatusCode(_0x56f0e5,_0x4e74c9){_0x4e74c9=_0x4e74c9||0xcc;return function(_0x1c06cd){if(_0x1c06cd){return _0x56f0e5[_0xc53e('0x19')](_0x4e74c9);}return _0x56f0e5[_0xc53e('0x1a')](_0x4e74c9)[_0xc53e('0x1b')]();};}function respondWithResult(_0x358ef3,_0x382e87){_0x382e87=_0x382e87||0xc8;return function(_0x3dc2fa){if(_0x3dc2fa){return _0x358ef3[_0xc53e('0x1a')](_0x382e87)[_0xc53e('0x1c')](_0x3dc2fa);}};}function respondWithFilteredResult(_0x2ad6eb,_0x5b0a88){return function(_0x8a522e){if(_0x8a522e){var _0x191567=typeof _0x5b0a88[_0xc53e('0x1d')]===_0xc53e('0x1e')&&typeof _0x5b0a88[_0xc53e('0x1f')]===_0xc53e('0x1e');var _0x164016=_0x8a522e[_0xc53e('0x20')];var _0x3b550e=_0x191567?0x0:_0x5b0a88['offset'];var _0x546fab=_0x191567?_0x8a522e[_0xc53e('0x20')]:_0x5b0a88[_0xc53e('0x1d')]+_0x5b0a88[_0xc53e('0x1f')];var _0x2e85df;if(_0x546fab>=_0x164016){_0x546fab=_0x164016;_0x2e85df=0xc8;}else{_0x2e85df=0xce;}_0x2ad6eb[_0xc53e('0x1a')](_0x2e85df);return _0x2ad6eb[_0xc53e('0x21')](_0xc53e('0x22'),_0x3b550e+'-'+_0x546fab+'/'+_0x164016)[_0xc53e('0x1c')](_0x8a522e);}return null;};}function patchUpdates(_0x364c80){return function(_0x401af6){try{jsonpatch[_0xc53e('0x23')](_0x401af6,_0x364c80,!![]);}catch(_0x44fd93){return BPromise[_0xc53e('0x24')](_0x44fd93);}return _0x401af6['save']();};}function saveUpdates(_0x47cfdd,_0x531ede){return function(_0x4f4304){if(_0x4f4304){return _0x4f4304[_0xc53e('0x25')](_0x47cfdd)[_0xc53e('0x26')](function(_0x4015c8){return _0x4015c8;});}return null;};}function removeEntity(_0x180811,_0x5009e1){return function(_0x5e5377){if(_0x5e5377){return _0x5e5377[_0xc53e('0x27')]()['then'](function(){var _0x1ae55e=_0x5e5377[_0xc53e('0x28')]({'plain':!![]});var _0x443179=_0xc53e('0x29');return db[_0xc53e('0x2a')]['destroy']({'where':{'type':_0x443179,'resourceId':_0x1ae55e['id']}})[_0xc53e('0x26')](function(){return _0x5e5377;});})['then'](function(){_0x180811['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x3c5056,_0x57a1f5){return function(_0x28240a){if(!_0x28240a){_0x3c5056['sendStatus'](0x194);}return _0x28240a;};}function handleError(_0x24a77e,_0x5112d2){_0x5112d2=_0x5112d2||0x1f4;return function(_0x5ce216){logger[_0xc53e('0x2b')](_0x5ce216[_0xc53e('0x2c')]);if(_0x5ce216[_0xc53e('0x2d')]){delete _0x5ce216[_0xc53e('0x2d')];}_0x24a77e[_0xc53e('0x1a')](_0x5112d2)[_0xc53e('0x2e')](_0x5ce216);};}exports[_0xc53e('0x2f')]=function(_0x2a2ca9,_0x4ace0b){var _0x437893={},_0x311835={},_0x2d36c0={'count':0x0,'rows':[]};var _0x56206b=_[_0xc53e('0x30')](db['AnalyticDefaultReport'][_0xc53e('0x31')],function(_0x2467f4){return{'name':_0x2467f4['fieldName'],'type':_0x2467f4['type'][_0xc53e('0x32')]};});_0x311835[_0xc53e('0x33')]=_[_0xc53e('0x30')](_0x56206b,_0xc53e('0x2d'));_0x311835[_0xc53e('0x34')]=_[_0xc53e('0x35')](_0x2a2ca9[_0xc53e('0x34')]);_0x311835[_0xc53e('0x36')]=_['intersection'](_0x311835[_0xc53e('0x33')],_0x311835[_0xc53e('0x34')]);_0x437893[_0xc53e('0x37')]=_[_0xc53e('0x38')](_0x311835[_0xc53e('0x33')],qs[_0xc53e('0x39')](_0x2a2ca9[_0xc53e('0x34')][_0xc53e('0x39')]));_0x437893[_0xc53e('0x37')]=_0x437893['attributes'][_0xc53e('0x3a')]?_0x437893['attributes']:_0x311835[_0xc53e('0x33')];if(!_0x2a2ca9[_0xc53e('0x34')]['hasOwnProperty'](_0xc53e('0x3b'))){_0x437893[_0xc53e('0x1f')]=qs[_0xc53e('0x1f')](_0x2a2ca9['query'][_0xc53e('0x1f')]);_0x437893[_0xc53e('0x1d')]=qs[_0xc53e('0x1d')](_0x2a2ca9[_0xc53e('0x34')][_0xc53e('0x1d')]);}_0x437893[_0xc53e('0x3c')]=qs[_0xc53e('0x3d')](_0x2a2ca9['query'][_0xc53e('0x3d')]);_0x437893[_0xc53e('0x3e')]=qs[_0xc53e('0x36')](_['pick'](_0x2a2ca9[_0xc53e('0x34')],_0x311835['filters']),_0x56206b);if(_0x2a2ca9[_0xc53e('0x34')][_0xc53e('0x3f')]){_0x437893[_0xc53e('0x3e')]=_[_0xc53e('0x40')](_0x437893[_0xc53e('0x3e')],{'$or':_['map'](_0x56206b,function(_0x3dda55){if(_0x3dda55[_0xc53e('0x41')]!=='VIRTUAL'){var _0x5b7354={};_0x5b7354[_0x3dda55['name']]={'$like':'%'+_0x2a2ca9['query'][_0xc53e('0x3f')]+'%'};return _0x5b7354;}})});}_0x437893=_[_0xc53e('0x40')]({},_0x437893,_0x2a2ca9['options']);var _0x460ee6={'where':_0x437893['where']};return db['AnalyticDefaultReport']['count'](_0x460ee6)[_0xc53e('0x26')](function(_0x4ba96f){_0x2d36c0['count']=_0x4ba96f;if(_0x2a2ca9[_0xc53e('0x34')]['includeAll']){_0x437893[_0xc53e('0x42')]=[{'all':!![]}];}return db[_0xc53e('0x43')]['findAll'](_0x437893);})[_0xc53e('0x26')](function(_0x3a4ebc){_0x2d36c0['rows']=_0x3a4ebc;return _0x2d36c0;})[_0xc53e('0x26')](respondWithFilteredResult(_0x4ace0b,_0x437893))['catch'](handleError(_0x4ace0b,null));};exports['show']=function(_0x481e6d,_0x4efee5){var _0x887d78={'raw':!![],'where':{'id':_0x481e6d[_0xc53e('0x44')]['id']}},_0x17b586={};_0x17b586['model']=_[_0xc53e('0x35')](db[_0xc53e('0x43')]['rawAttributes']);_0x17b586['query']=_[_0xc53e('0x35')](_0x481e6d[_0xc53e('0x34')]);_0x17b586[_0xc53e('0x36')]=_['intersection'](_0x17b586[_0xc53e('0x33')],_0x17b586[_0xc53e('0x34')]);_0x887d78[_0xc53e('0x37')]=_[_0xc53e('0x38')](_0x17b586[_0xc53e('0x33')],qs[_0xc53e('0x39')](_0x481e6d[_0xc53e('0x34')]['fields']));_0x887d78[_0xc53e('0x37')]=_0x887d78[_0xc53e('0x37')][_0xc53e('0x3a')]?_0x887d78['attributes']:_0x17b586[_0xc53e('0x33')];if(_0x481e6d[_0xc53e('0x34')][_0xc53e('0x45')]){_0x887d78[_0xc53e('0x42')]=[{'all':!![]}];}_0x887d78=_[_0xc53e('0x40')]({},_0x887d78,_0x481e6d[_0xc53e('0x46')]);return db['AnalyticDefaultReport'][_0xc53e('0x47')](_0x887d78)[_0xc53e('0x26')](handleEntityNotFound(_0x4efee5,null))[_0xc53e('0x26')](respondWithResult(_0x4efee5,null))['catch'](handleError(_0x4efee5,null));};exports[_0xc53e('0x48')]=function(_0x1d2491,_0x1eeb65){return db[_0xc53e('0x43')][_0xc53e('0x48')](_0x1d2491[_0xc53e('0x49')],{})[_0xc53e('0x26')](function(_0x2ba2b4){var _0x34de2d=_0x1d2491[_0xc53e('0x4a')]['get']({'plain':!![]});if(!_0x34de2d)throw new Error(_0xc53e('0x4b'));if(_0x34de2d[_0xc53e('0x4c')]===_0xc53e('0x4a')){var _0x3d74ac=_0x2ba2b4[_0xc53e('0x28')]({'plain':!![]});var _0x52dac7='Reports';return db[_0xc53e('0x4d')]['find']({'where':{'name':_0x52dac7,'userProfileId':_0x34de2d[_0xc53e('0x4e')]},'raw':!![]})['then'](function(_0x3a49a4){if(_0x3a49a4&&_0x3a49a4[_0xc53e('0x4f')]===0x0){return db[_0xc53e('0x2a')]['create']({'name':_0x3d74ac[_0xc53e('0x2d')],'resourceId':_0x3d74ac['id'],'type':_0xc53e('0x29'),'sectionId':_0x3a49a4['id']},{})[_0xc53e('0x26')](function(){return _0x2ba2b4;});}else{return _0x2ba2b4;}})['catch'](function(_0x2f7df2){logger['error'](_0xc53e('0x50'),_0x2f7df2);throw _0x2f7df2;});}return _0x2ba2b4;})[_0xc53e('0x26')](respondWithResult(_0x1eeb65,0xc9))['catch'](handleError(_0x1eeb65,null));};exports[_0xc53e('0x25')]=function(_0x1515ea,_0x5bba72){if(_0x1515ea[_0xc53e('0x49')]['id']){delete _0x1515ea[_0xc53e('0x49')]['id'];}return db[_0xc53e('0x43')][_0xc53e('0x47')]({'where':{'id':_0x1515ea[_0xc53e('0x44')]['id']}})[_0xc53e('0x26')](handleEntityNotFound(_0x5bba72,null))[_0xc53e('0x26')](saveUpdates(_0x1515ea[_0xc53e('0x49')],null))[_0xc53e('0x26')](respondWithResult(_0x5bba72,null))[_0xc53e('0x51')](handleError(_0x5bba72,null));};exports[_0xc53e('0x27')]=function(_0x47dd5a,_0x8364f6){return db['AnalyticDefaultReport'][_0xc53e('0x47')]({'where':{'id':_0x47dd5a['params']['id']}})[_0xc53e('0x26')](handleEntityNotFound(_0x8364f6,null))[_0xc53e('0x26')](removeEntity(_0x8364f6,null))['catch'](handleError(_0x8364f6,null));};exports[_0xc53e('0x52')]=function(_0x7f0bc0,_0x9c0112){var _0x432a91=0xa;var _0x53083b=[_0xc53e('0x53'),_0xc53e('0x54'),'right_join','cross_join'];var _0x3c0aa1={'SUM':'SUM(%s)','COUNT':'COUNT(%s)','COUNT DISTINCT':'COUNT(DISTINCT\x20%s)','MAX':_0xc53e('0x55'),'MIN':'MIN(%s)','AVG':_0xc53e('0x56'),'GROUP_CONCAT':'GROUP_CONCAT(%s)','GROUP_CONCAT ASC':_0xc53e('0x57'),'GROUP_CONCAT DESC':_0xc53e('0x58')};var _0x5fcd58={'SEC_TO_TIME':_0xc53e('0x59'),'DATE':_0xc53e('0x5a'),'HOUR':'HOUR(%s)','ROUND':'ROUND(%s)','UNIX_TIMESTAMP':_0xc53e('0x5b')};var _0x37b091=function(_0x31e22b){return!_[_0xc53e('0x5c')]([_0xc53e('0x5d'),_0xc53e('0x5e'),_0xc53e('0x5f'),_0xc53e('0x60')],_0x31e22b);};var _0x13bf71=function(_0x16d8a1){if(!_0x16d8a1||!_0x16d8a1[_0xc53e('0x61')][_0xc53e('0x3a')]){return'';}for(var _0xdc0e49='(',_0x520738=0x0;_0x520738<_0x16d8a1[_0xc53e('0x61')]['length'];_0x520738+=0x1){_0x520738>0x0&&(_0xdc0e49+='\x20'+_0x16d8a1[_0xc53e('0x62')]+'\x20');_0xdc0e49+=_0x16d8a1[_0xc53e('0x61')][_0x520738][_0xc53e('0x63')]?_0x13bf71(_0x16d8a1[_0xc53e('0x61')][_0x520738][_0xc53e('0x63')]):_0x16d8a1[_0xc53e('0x61')][_0x520738][_0xc53e('0x64')]+'\x20'+_0x16d8a1[_0xc53e('0x61')][_0x520738]['condition']+(_0x37b091(_0x16d8a1['rules'][_0x520738]['condition'])?'\x20'+_0x16d8a1[_0xc53e('0x61')][_0x520738][_0xc53e('0x65')]:'');}return _0xdc0e49+')';};var _0x37ac78={'where':{'id':_0x7f0bc0['params']['id']}},_0x25e4b6,_0x247d99,_0x160ca3,_0x3581ab,_0x5a9596;_0x37ac78=_['merge']({},_0x37ac78,_0x7f0bc0[_0xc53e('0x46')]);return db[_0xc53e('0x43')]['find'](_0x37ac78)[_0xc53e('0x26')](function(_0x235a6b){if(_0x235a6b){_0x25e4b6=_0x235a6b;return _0x235a6b[_0xc53e('0x66')]();}return null;})[_0xc53e('0x26')](function(_0x22829b){if(_0x22829b){if(!_0x22829b[_0xc53e('0x3a')]){throw new db['Sequelize']['ValidationErrorItem'](_0xc53e('0x67'),0x193);}_0x247d99=_0x22829b;return db[_0xc53e('0x68')][_0xc53e('0x69')]({'raw':!![]});}return null;})[_0xc53e('0x26')](function(_0x29ee08){if(_0x29ee08){_0x160ca3=_[_0xc53e('0x6a')](_0x29ee08,'id');var _0x5a1a4b;var _0x2b6734=squel[_0xc53e('0x6b')]();_0x2b6734[_0xc53e('0x6c')](_0x25e4b6[_0xc53e('0x6d')]);for(var _0x4d2609=0x0;_0x4d2609<_0x247d99[_0xc53e('0x3a')];_0x4d2609+=0x1){_0x5a1a4b=_0x247d99[_0x4d2609][_0xc53e('0x6e')]?_0x160ca3[_0x247d99[_0x4d2609][_0xc53e('0x6e')]][_0xc53e('0x6f')]:_0x247d99[_0x4d2609][_0xc53e('0x64')];_0x5a1a4b=_0x247d99[_0x4d2609][_0xc53e('0x70')]?_['replace'](_0x3c0aa1[_0x247d99[_0x4d2609][_0xc53e('0x70')]],'%s',_0x5a1a4b):_0x5a1a4b;_0x5a1a4b=_0x247d99[_0x4d2609][_0xc53e('0x71')]?_[_0xc53e('0x72')](_0x5fcd58[_0x247d99[_0x4d2609][_0xc53e('0x71')]],'%s',_0x5a1a4b):_0x5a1a4b;if(_0x247d99[_0x4d2609]['groupBy']){_0x2b6734['group'](_0x5a1a4b);}_0x247d99[_0x4d2609][_0xc53e('0x73')]&&_0x2b6734[_0xc53e('0x3c')](_0x5a1a4b,_0x247d99[_0x4d2609][_0xc53e('0x73')]===_0xc53e('0x74')?![]:!![]);_0x2b6734['field'](_0x5a1a4b,_0x247d99[_0x4d2609][_0xc53e('0x75')]||_0x5a1a4b);}if(_0x25e4b6['joins']){_0x25e4b6[_0xc53e('0x76')]=JSON['parse'](_0x25e4b6[_0xc53e('0x76')]);for(var _0x4e128a=0x0;_0x4e128a<_0x25e4b6[_0xc53e('0x76')][_0xc53e('0x3a')];_0x4e128a+=0x1){if(_0x25e4b6['joins'][_0x4e128a][_0xc53e('0x41')]&&_[_0xc53e('0x5c')](_0x53083b,_0x25e4b6['joins'][_0x4e128a]['type'])&&_0x25e4b6[_0xc53e('0x76')][_0x4e128a][_0xc53e('0x77')]&&_0x25e4b6['joins'][_0x4e128a]['foreignTable']&&_0x25e4b6[_0xc53e('0x76')][_0x4e128a]['foreignKey']){_0x2b6734[_0x25e4b6[_0xc53e('0x76')][_0x4e128a]['type']](_0x25e4b6[_0xc53e('0x76')][_0x4e128a][_0xc53e('0x78')],null,util[_0xc53e('0x71')](_0xc53e('0x79'),_0x25e4b6[_0xc53e('0x6d')],_0x25e4b6[_0xc53e('0x76')][_0x4e128a][_0xc53e('0x77')],_0x25e4b6[_0xc53e('0x76')][_0x4e128a][_0xc53e('0x78')],_0x25e4b6[_0xc53e('0x76')][_0x4e128a]['foreignKey']));}}}if(_0x25e4b6[_0xc53e('0x7a')]){_0x25e4b6['conditions']=JSON[_0xc53e('0x7b')](_0x25e4b6[_0xc53e('0x7a')]);_0x2b6734[_0xc53e('0x3e')](_0x13bf71(_0x25e4b6[_0xc53e('0x7a')][_0xc53e('0x63')]));}_0x5a9596=_0x2b6734[_0xc53e('0x7c')]();_0x2b6734[_0xc53e('0x1f')](_0x432a91);_0x2b6734[_0xc53e('0x1d')](0x0);logger[_0xc53e('0x7d')](_0xc53e('0x7e'),_0x2b6734['toString']());return dbH[_0xc53e('0x7f')]['query'](_0x2b6734[_0xc53e('0x80')](),{'type':dbH[_0xc53e('0x7f')][_0xc53e('0x81')]['SELECT']});}})[_0xc53e('0x26')](respondWithResult(_0x9c0112,null))[_0xc53e('0x51')](handleError(_0x9c0112,null));};function runReport(_0x381652,_0xec3738,_0x3a84a2){var _0x508671=_0xec3738[_0xc53e('0x2d')];var _0x48e337=0xa;var _0x56c66f=[_0xc53e('0x53'),_0xc53e('0x54'),_0xc53e('0x82'),'cross_join'];var _0x35b6dc={'SUM':_0xc53e('0x83'),'COUNT':'COUNT(%s)','COUNT DISTINCT':_0xc53e('0x84'),'MAX':_0xc53e('0x55'),'MIN':'MIN(%s)','AVG':'AVG(%s)','GROUP_CONCAT':_0xc53e('0x85'),'GROUP_CONCAT ASC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT DESC':_0xc53e('0x58')};var _0x3d2636={'SEC_TO_TIME':_0xc53e('0x59'),'DATE':'DATE(%s)','HOUR':_0xc53e('0x86'),'ROUND':_0xc53e('0x87'),'UNIX_TIMESTAMP':_0xc53e('0x5b')};var _0x4c8112=function(_0x1a8ae4){return!_[_0xc53e('0x5c')]([_0xc53e('0x5d'),_0xc53e('0x5e'),_0xc53e('0x5f'),'IS\x20NOT\x20EMPTY'],_0x1a8ae4);};var _0x3dac82=function(_0x325287){if(!_0x325287||!_0x325287[_0xc53e('0x61')][_0xc53e('0x3a')]){return'';}for(var _0xe6a976='(',_0x4102bc=0x0;_0x4102bc<_0x325287[_0xc53e('0x61')][_0xc53e('0x3a')];_0x4102bc+=0x1){_0x4102bc>0x0&&(_0xe6a976+='\x20'+_0x325287[_0xc53e('0x62')]+'\x20');_0xe6a976+=_0x325287['rules'][_0x4102bc][_0xc53e('0x63')]?_0x3dac82(_0x325287[_0xc53e('0x61')][_0x4102bc][_0xc53e('0x63')]):_0x325287[_0xc53e('0x61')][_0x4102bc][_0xc53e('0x64')]+'\x20'+_0x325287[_0xc53e('0x61')][_0x4102bc][_0xc53e('0x88')]+(_0x4c8112(_0x325287[_0xc53e('0x61')][_0x4102bc][_0xc53e('0x88')])?'\x20'+_0x325287['rules'][_0x4102bc][_0xc53e('0x65')]:'');}return _0xe6a976+')';};var _0x190509={'where':{'id':_0x381652['id']}},_0x110e32,_0x2135d4,_0x4bbf8a,_0x31b06d,_0x21fc8d;_0x190509=_[_0xc53e('0x40')]({},_0x190509,_0x3a84a2);return db[_0xc53e('0x43')]['find'](_0x190509)[_0xc53e('0x26')](function(_0x138870){if(_0x138870){_0x110e32=_0x138870;return _0x138870[_0xc53e('0x66')]();}return null;})[_0xc53e('0x26')](function(_0x621e78){if(_0x621e78){if(!_0x621e78[_0xc53e('0x3a')]){throw new db[(_0xc53e('0x89'))]['ValidationErrorItem'](_0xc53e('0x67'),0x193);}_0x2135d4=_0x621e78;return db['AnalyticMetric'][_0xc53e('0x69')]({'raw':!![]});}return null;})[_0xc53e('0x26')](function(_0x3fe278){if(_0x3fe278){_0x4bbf8a=_['keyBy'](_0x3fe278,'id');var _0x7c56eb;var _0x36dffe=squel[_0xc53e('0x6b')]();_0x36dffe['from'](_0x110e32[_0xc53e('0x6d')]);for(var _0xedb93a=0x0;_0xedb93a<_0x2135d4[_0xc53e('0x3a')];_0xedb93a+=0x1){_0x7c56eb=_0x2135d4[_0xedb93a]['MetricId']?_0x4bbf8a[_0x2135d4[_0xedb93a][_0xc53e('0x6e')]][_0xc53e('0x6f')]:_0x2135d4[_0xedb93a][_0xc53e('0x64')];_0x7c56eb=_0x2135d4[_0xedb93a][_0xc53e('0x70')]?_[_0xc53e('0x72')](_0x35b6dc[_0x2135d4[_0xedb93a]['function']],'%s',_0x7c56eb):_0x7c56eb;_0x7c56eb=_0x2135d4[_0xedb93a]['format']?_['replace'](_0x3d2636[_0x2135d4[_0xedb93a][_0xc53e('0x71')]],'%s',_0x7c56eb):_0x7c56eb;if(_0x2135d4[_0xedb93a][_0xc53e('0x8a')]){_0x36dffe[_0xc53e('0x63')](_0x7c56eb);}_0x2135d4[_0xedb93a][_0xc53e('0x73')]&&_0x36dffe['order'](_0x7c56eb,_0x2135d4[_0xedb93a][_0xc53e('0x73')]==='DESC'?![]:!![]);_0x36dffe[_0xc53e('0x64')](_0x7c56eb,_0x2135d4[_0xedb93a][_0xc53e('0x75')]||_0x7c56eb);}if(_0x110e32[_0xc53e('0x76')]){_0x110e32[_0xc53e('0x76')]=JSON['parse'](_0x110e32[_0xc53e('0x76')]);for(var _0xc23eef=0x0;_0xc23eef<_0x110e32[_0xc53e('0x76')][_0xc53e('0x3a')];_0xc23eef+=0x1){if(_0x110e32[_0xc53e('0x76')][_0xc23eef][_0xc53e('0x41')]&&_[_0xc53e('0x5c')](_0x56c66f,_0x110e32[_0xc53e('0x76')][_0xc23eef][_0xc53e('0x41')])&&_0x110e32[_0xc53e('0x76')][_0xc23eef][_0xc53e('0x77')]&&_0x110e32[_0xc53e('0x76')][_0xc23eef][_0xc53e('0x78')]&&_0x110e32[_0xc53e('0x76')][_0xc23eef][_0xc53e('0x8b')]){_0x36dffe[_0x110e32[_0xc53e('0x76')][_0xc23eef][_0xc53e('0x41')]](_0x110e32[_0xc53e('0x76')][_0xc23eef][_0xc53e('0x78')],null,util[_0xc53e('0x71')](_0xc53e('0x79'),_0x110e32[_0xc53e('0x6d')],_0x110e32[_0xc53e('0x76')][_0xc23eef][_0xc53e('0x77')],_0x110e32[_0xc53e('0x76')][_0xc23eef]['foreignTable'],_0x110e32[_0xc53e('0x76')][_0xc23eef]['foreignKey']));}}}if(_0x110e32[_0xc53e('0x7a')]){_0x110e32[_0xc53e('0x7a')]=JSON['parse'](_0x110e32[_0xc53e('0x7a')]);_0x36dffe[_0xc53e('0x3e')](_0x3dac82(_0x110e32[_0xc53e('0x7a')][_0xc53e('0x63')]));}_0x21fc8d=_0x36dffe[_0xc53e('0x7c')]();_0x36dffe[_0xc53e('0x1f')](_0x48e337);_0x36dffe[_0xc53e('0x1d')](0x0);return;}})[_0xc53e('0x26')](function(){if(_0xec3738[_0xc53e('0x8c')]==='web'){return null;}var _0x37c8e6=_['merge'](_0xec3738,{'name':_0xec3738[_0xc53e('0x8d')]||_0xec3738[_0xc53e('0x2d')]||_0x110e32[_0xc53e('0x2d')],'basename':_0x508671,'savename':util[_0xc53e('0x71')](_0xc53e('0x8e'),_0xec3738[_0xc53e('0x2d')]||_0x110e32[_0xc53e('0x2d')],require(_0xc53e('0x8f'))[_0xc53e('0x90')](0x4),_0xec3738[_0xc53e('0x8c')]||_0xc53e('0x91')),'reportId':_0x110e32['id'],'reportType':_0xc53e('0x92')});return db[_0xc53e('0x93')]['create'](_0x37c8e6,{'raw':!![]});})[_0xc53e('0x26')](function(_0x575ef5){if(_0x110e32[_0xc53e('0x6d')]===_0xc53e('0x94')){_0x21fc8d[_0xc53e('0x3e')](_0x110e32[_0xc53e('0x6d')]+'.calldate\x20BETWEEN\x20?\x20AND\x20?',_0xec3738['startDate'],_0xec3738[_0xc53e('0x95')]);}else{_0x21fc8d[_0xc53e('0x3e')](_0x110e32[_0xc53e('0x6d')]+_0xc53e('0x96'),_0xec3738['startDate'],_0xec3738['endDate']);}if(_0x575ef5){logger[_0xc53e('0x97')](_0xc53e('0x98'),_0x21fc8d[_0xc53e('0x80')]());require(_0xc53e('0x99'))[_0xc53e('0x9a')](path[_0xc53e('0x53')](__dirname,'../../components/export/',_0x575ef5[_0xc53e('0x8c')]),[_0x575ef5['id'],_0x21fc8d[_0xc53e('0x80')](),path[_0xc53e('0x53')](__dirname,_0xc53e('0x9b'),_0x575ef5[_0xc53e('0x9c')]),_0x508671]);return _0x575ef5;}else{var _0x4f527e=squel[_0xc53e('0x6b')]();_0x4f527e[_0xc53e('0x6c')]('('+_0x21fc8d[_0xc53e('0x80')]()+')',_0xc53e('0x9d'));_0x4f527e[_0xc53e('0x64')](_0xc53e('0x9e'),_0xc53e('0x20'));_0x21fc8d[_0xc53e('0x1f')](_0xec3738[_0xc53e('0x1f')]||_0x48e337);_0x21fc8d[_0xc53e('0x1d')](_0xec3738[_0xc53e('0x1d')]||0x0);return dbH[_0xc53e('0x7f')][_0xc53e('0x34')](_0x4f527e['toString'](),{'type':dbH[_0xc53e('0x7f')][_0xc53e('0x81')]['SELECT']})[_0xc53e('0x26')](function(_0x4ee56b){if(!_0x4ee56b['length']){_0x31b06d=0x0;}else{_0x31b06d=_0x4ee56b[0x0][_0xc53e('0x20')]||0x0;}return dbH['sequelize'][_0xc53e('0x34')](_0x21fc8d['toString'](),{'type':dbH[_0xc53e('0x7f')]['QueryTypes'][_0xc53e('0x9f')]});})[_0xc53e('0x26')](function(_0x10ad32){return{'rows':_0x10ad32||[],'count':_0x31b06d};});}});}exports['run']=function(_0xf3f34a,_0x5dd87e){return runReport(_0xf3f34a[_0xc53e('0x44')],_0xf3f34a[_0xc53e('0x34')],_0xf3f34a[_0xc53e('0x46')])[_0xc53e('0x26')](respondWithResult(_0x5dd87e,null))[_0xc53e('0x51')](handleError(_0x5dd87e,null));};exports[_0xc53e('0xa0')]=runReport;exports[_0xc53e('0x34')]=function(_0x265292,_0x2c776c){var _0x383f22=0xa;var _0x51f2a4=['join',_0xc53e('0x54'),'right_join',_0xc53e('0xa1')];var _0xbc960={'SUM':_0xc53e('0x83'),'COUNT':_0xc53e('0xa2'),'COUNT DISTINCT':_0xc53e('0x84'),'MAX':_0xc53e('0x55'),'MIN':_0xc53e('0xa3'),'AVG':_0xc53e('0x56'),'GROUP_CONCAT':'GROUP_CONCAT(%s)','GROUP_CONCAT ASC':_0xc53e('0x57'),'GROUP_CONCAT DESC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)'};var _0x34cb12={'SEC_TO_TIME':_0xc53e('0x59'),'DATE':_0xc53e('0x5a'),'HOUR':_0xc53e('0x86'),'ROUND':_0xc53e('0x87'),'UNIX_TIMESTAMP':_0xc53e('0x5b')};var _0x227e0c=function(_0x4c0802){return!_[_0xc53e('0x5c')]([_0xc53e('0x5d'),_0xc53e('0x5e'),_0xc53e('0x5f'),_0xc53e('0x60')],_0x4c0802);};var _0x590fb6=function(_0x15d269){if(!_0x15d269||!_0x15d269[_0xc53e('0x61')]['length']){return'';}for(var _0x5253b1='(',_0x208c17=0x0;_0x208c17<_0x15d269['rules'][_0xc53e('0x3a')];_0x208c17+=0x1){_0x208c17>0x0&&(_0x5253b1+='\x20'+_0x15d269[_0xc53e('0x62')]+'\x20');_0x5253b1+=_0x15d269['rules'][_0x208c17]['group']?_0x590fb6(_0x15d269[_0xc53e('0x61')][_0x208c17]['group']):_0x15d269[_0xc53e('0x61')][_0x208c17]['field']+'\x20'+_0x15d269[_0xc53e('0x61')][_0x208c17][_0xc53e('0x88')]+(_0x227e0c(_0x15d269[_0xc53e('0x61')][_0x208c17][_0xc53e('0x88')])?'\x20'+_0x15d269[_0xc53e('0x61')][_0x208c17]['value']:'');}return _0x5253b1+')';};var _0x2f5d22={'where':{'id':_0x265292[_0xc53e('0x44')]['id']}},_0x478e57,_0x5e427a,_0x3e666b,_0x365a98,_0x375d8b;_0x2f5d22=_[_0xc53e('0x40')]({},_0x2f5d22,_0x265292[_0xc53e('0x46')]);return db[_0xc53e('0x43')][_0xc53e('0x47')](_0x2f5d22)[_0xc53e('0x26')](function(_0x3b778b){if(_0x3b778b){_0x478e57=_0x3b778b;return _0x3b778b[_0xc53e('0x66')]();}return null;})[_0xc53e('0x26')](function(_0x55581a){if(_0x55581a){if(!_0x55581a[_0xc53e('0x3a')]){throw new db[(_0xc53e('0x89'))][(_0xc53e('0xa4'))](_0xc53e('0x67'),0x193);}_0x5e427a=_0x55581a;return db[_0xc53e('0x68')]['findAll']({'raw':!![]});}return null;})['then'](function(_0x34c717){if(_0x34c717){_0x3e666b=_[_0xc53e('0x6a')](_0x34c717,'id');var _0x2718fe;var _0x15014e=squel[_0xc53e('0x6b')]();_0x15014e[_0xc53e('0x6c')](_0x478e57[_0xc53e('0x6d')]);for(var _0x2d80f5=0x0;_0x2d80f5<_0x5e427a[_0xc53e('0x3a')];_0x2d80f5+=0x1){_0x2718fe=_0x5e427a[_0x2d80f5][_0xc53e('0x6e')]?_0x3e666b[_0x5e427a[_0x2d80f5][_0xc53e('0x6e')]][_0xc53e('0x6f')]:_0x5e427a[_0x2d80f5][_0xc53e('0x64')];_0x2718fe=_0x5e427a[_0x2d80f5]['function']?_[_0xc53e('0x72')](_0xbc960[_0x5e427a[_0x2d80f5][_0xc53e('0x70')]],'%s',_0x2718fe):_0x2718fe;_0x2718fe=_0x5e427a[_0x2d80f5]['format']?_[_0xc53e('0x72')](_0x34cb12[_0x5e427a[_0x2d80f5][_0xc53e('0x71')]],'%s',_0x2718fe):_0x2718fe;if(_0x5e427a[_0x2d80f5][_0xc53e('0x8a')]){_0x15014e['group'](_0x2718fe);}_0x5e427a[_0x2d80f5]['orderBy']&&_0x15014e[_0xc53e('0x3c')](_0x2718fe,_0x5e427a[_0x2d80f5][_0xc53e('0x73')]===_0xc53e('0x74')?![]:!![]);_0x15014e[_0xc53e('0x64')](_0x2718fe,_0x5e427a[_0x2d80f5]['alias']||_0x2718fe);}if(_0x478e57[_0xc53e('0x76')]){_0x478e57[_0xc53e('0x76')]=JSON[_0xc53e('0x7b')](_0x478e57['joins']);for(var _0x48d301=0x0;_0x48d301<_0x478e57[_0xc53e('0x76')][_0xc53e('0x3a')];_0x48d301+=0x1){if(_0x478e57[_0xc53e('0x76')][_0x48d301]['type']&&_[_0xc53e('0x5c')](_0x51f2a4,_0x478e57[_0xc53e('0x76')][_0x48d301]['type'])&&_0x478e57[_0xc53e('0x76')][_0x48d301][_0xc53e('0x77')]&&_0x478e57[_0xc53e('0x76')][_0x48d301][_0xc53e('0x78')]&&_0x478e57[_0xc53e('0x76')][_0x48d301]['foreignKey']){_0x15014e[_0x478e57[_0xc53e('0x76')][_0x48d301][_0xc53e('0x41')]](_0x478e57[_0xc53e('0x76')][_0x48d301]['foreignTable'],null,util['format'](_0xc53e('0x79'),_0x478e57[_0xc53e('0x6d')],_0x478e57[_0xc53e('0x76')][_0x48d301][_0xc53e('0x77')],_0x478e57[_0xc53e('0x76')][_0x48d301]['foreignTable'],_0x478e57[_0xc53e('0x76')][_0x48d301]['foreignKey']));}}}if(_0x478e57[_0xc53e('0x7a')]){_0x478e57[_0xc53e('0x7a')]=JSON[_0xc53e('0x7b')](_0x478e57[_0xc53e('0x7a')]);_0x15014e[_0xc53e('0x3e')](_0x590fb6(_0x478e57[_0xc53e('0x7a')][_0xc53e('0x63')]));}_0x375d8b=_0x15014e[_0xc53e('0x7c')]();_0x15014e[_0xc53e('0x1f')](_0x383f22);_0x15014e['offset'](0x0);logger[_0xc53e('0x7d')](_0xc53e('0x7e'),_0x15014e[_0xc53e('0x80')]());return dbH[_0xc53e('0x7f')][_0xc53e('0x34')](_0x15014e[_0xc53e('0x80')](),{'type':dbH['sequelize'][_0xc53e('0x81')][_0xc53e('0x9f')]});}})[_0xc53e('0x26')](function(){return{'sql':_0x375d8b[_0xc53e('0x80')]()};})[_0xc53e('0x26')](respondWithResult(_0x2c776c,null))[_0xc53e('0x51')](handleError(_0x2c776c,null));};
\ No newline at end of file
diff --git a/server/api/analyticDefaultReport/analyticDefaultReport.model.js b/server/api/analyticDefaultReport/analyticDefaultReport.model.js
index dc4ca81..f530c7c 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 _0x1c35=['path','rimraf','exports','define','analytics_default_reports','util','api','request-promise'];(function(_0x13b442,_0x448c33){var _0x49d09c=function(_0x477277){while(--_0x477277){_0x13b442['push'](_0x13b442['shift']());}};_0x49d09c(++_0x448c33);}(_0x1c35,0xad));var _0x51c3=function(_0xadc093,_0x1684e1){_0xadc093=_0xadc093-0x0;var _0x1c0871=_0x1c35[_0xadc093];return _0x1c0871;};'use strict';var _=require('lodash');var util=require(_0x51c3('0x0'));var logger=require('../../config/logger')(_0x51c3('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x51c3('0x2'));var fs=require('fs');var path=require(_0x51c3('0x3'));var rimraf=require(_0x51c3('0x4'));var config=require('../../config/environment');var attributes=require('./analyticDefaultReport.attributes');module[_0x51c3('0x5')]=function(_0x2b31f7,_0xb63923){return _0x2b31f7[_0x51c3('0x6')]('AnalyticDefaultReport',attributes,{'tableName':_0x51c3('0x7'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xb46e=['define','analytics_default_reports','lodash','util','moment','bluebird','request-promise','path','../../config/environment'];(function(_0x335f5c,_0xce622c){var _0x27458c=function(_0x108b7f){while(--_0x108b7f){_0x335f5c['push'](_0x335f5c['shift']());}};_0x27458c(++_0xce622c);}(_0xb46e,0x1d6));var _0xeb46=function(_0xd7138d,_0xc3196c){_0xd7138d=_0xd7138d-0x0;var _0x1768d4=_0xb46e[_0xd7138d];return _0x1768d4;};'use strict';var _=require(_0xeb46('0x0'));var util=require(_0xeb46('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0xeb46('0x2'));var BPromise=require(_0xeb46('0x3'));var rp=require(_0xeb46('0x4'));var fs=require('fs');var path=require(_0xeb46('0x5'));var rimraf=require('rimraf');var config=require(_0xeb46('0x6'));var attributes=require('./analyticDefaultReport.attributes');module['exports']=function(_0x2b1089,_0x4b2c59){return _0x2b1089[_0xeb46('0x7')]('AnalyticDefaultReport',attributes,{'tableName':_0xeb46('0x8'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
diff --git a/server/api/analyticDefaultReport/analyticDefaultReport.rpc.js b/server/api/analyticDefaultReport/analyticDefaultReport.rpc.js
index b0ce863..5bdb70d 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 _0xe13d=['../../config/logger','rpc','jayson/promise','client','http','request','info','AnalyticDefaultReport,\x20%s,\x20%s','request\x20sent','debug','error','code','message','result','util','moment','bluebird','randomstring','../../mysqldb'];(function(_0x275708,_0x2b9ece){var _0x134b23=function(_0x1ba5f7){while(--_0x1ba5f7){_0x275708['push'](_0x275708['shift']());}};_0x134b23(++_0x2b9ece);}(_0xe13d,0x6d));var _0xde13=function(_0x13ea00,_0x12f610){_0x13ea00=_0x13ea00-0x0;var _0x1f7347=_0xe13d[_0x13ea00];return _0x1f7347;};'use strict';var _=require('lodash');var util=require(_0xde13('0x0'));var moment=require(_0xde13('0x1'));var BPromise=require(_0xde13('0x2'));var rs=require(_0xde13('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xde13('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0xde13('0x5'))(_0xde13('0x6'));var config=require('../../config/environment');var jayson=require(_0xde13('0x7'));var client=jayson[_0xde13('0x8')][_0xde13('0x9')]({'port':0x232a});function respondWithRpcPromise(_0xf3acc1,_0x1a1278,_0x2c30d9){return new BPromise(function(_0x5c8f81,_0x3e1063){return client[_0xde13('0xa')](_0xf3acc1,_0x2c30d9)['then'](function(_0x16b868){logger[_0xde13('0xb')](_0xde13('0xc'),_0x1a1278,_0xde13('0xd'));logger[_0xde13('0xe')]('AnalyticDefaultReport,\x20%s,\x20%s,\x20%s',_0x1a1278,_0xde13('0xd'),JSON['stringify'](_0x16b868));if(_0x16b868[_0xde13('0xf')]){if(_0x16b868['error'][_0xde13('0x10')]===0x1f4){logger[_0xde13('0xf')](_0xde13('0xc'),_0x1a1278,_0x16b868['error'][_0xde13('0x11')]);return _0x3e1063(_0x16b868[_0xde13('0xf')]['message']);}logger[_0xde13('0xf')](_0xde13('0xc'),_0x1a1278,_0x16b868['error']['message']);return _0x5c8f81(_0x16b868[_0xde13('0xf')]['message']);}else{logger[_0xde13('0xb')](_0xde13('0xc'),_0x1a1278,'request\x20sent');_0x5c8f81(_0x16b868[_0xde13('0x12')][_0xde13('0x11')]);}})['catch'](function(_0x5ef43b){logger[_0xde13('0xf')]('AnalyticDefaultReport,\x20%s,\x20%s',_0x1a1278,_0x5ef43b);_0x3e1063(_0x5ef43b);});});}
\ No newline at end of file
+var _0x69b9=['http','then','info','AnalyticDefaultReport,\x20%s,\x20%s','request\x20sent','AnalyticDefaultReport,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','jayson/promise','client'];(function(_0x4978d9,_0x203c70){var _0x540543=function(_0x2e2427){while(--_0x2e2427){_0x4978d9['push'](_0x4978d9['shift']());}};_0x540543(++_0x203c70);}(_0x69b9,0x113));var _0x969b=function(_0x2acbd5,_0x253ae1){_0x2acbd5=_0x2acbd5-0x0;var _0x251954=_0x69b9[_0x2acbd5];return _0x251954;};'use strict';var _=require(_0x969b('0x0'));var util=require(_0x969b('0x1'));var moment=require(_0x969b('0x2'));var BPromise=require(_0x969b('0x3'));var rs=require(_0x969b('0x4'));var fs=require('fs');var Redis=require(_0x969b('0x5'));var db=require(_0x969b('0x6'))['db'];var utils=require(_0x969b('0x7'));var logger=require('../../config/logger')(_0x969b('0x8'));var config=require('../../config/environment');var jayson=require(_0x969b('0x9'));var client=jayson[_0x969b('0xa')][_0x969b('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x495f5a,_0x5a071f,_0x133add){return new BPromise(function(_0x1e3715,_0x264e83){return client['request'](_0x495f5a,_0x133add)[_0x969b('0xc')](function(_0x3a4733){logger[_0x969b('0xd')](_0x969b('0xe'),_0x5a071f,_0x969b('0xf'));logger['debug'](_0x969b('0x10'),_0x5a071f,_0x969b('0xf'),JSON['stringify'](_0x3a4733));if(_0x3a4733['error']){if(_0x3a4733[_0x969b('0x11')][_0x969b('0x12')]===0x1f4){logger[_0x969b('0x11')]('AnalyticDefaultReport,\x20%s,\x20%s',_0x5a071f,_0x3a4733['error'][_0x969b('0x13')]);return _0x264e83(_0x3a4733['error'][_0x969b('0x13')]);}logger[_0x969b('0x11')](_0x969b('0xe'),_0x5a071f,_0x3a4733['error'][_0x969b('0x13')]);return _0x1e3715(_0x3a4733[_0x969b('0x11')][_0x969b('0x13')]);}else{logger[_0x969b('0xd')](_0x969b('0xe'),_0x5a071f,_0x969b('0xf'));_0x1e3715(_0x3a4733[_0x969b('0x14')][_0x969b('0x13')]);}})[_0x969b('0x15')](function(_0x1d2067){logger[_0x969b('0x11')](_0x969b('0xe'),_0x5a071f,_0x1d2067);_0x264e83(_0x1d2067);});});}
\ No newline at end of file
diff --git a/server/api/analyticDefaultReport/index.js b/server/api/analyticDefaultReport/index.js
index f744690..786680e 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 _0x60b0=['../../components/interaction/service','get','isAuthenticated','index','/:id','show','/:id/preview','preview','/:id/run','run','/:id/query','query','post','create','put','update','delete','destroy','exports','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service'];(function(_0x2b358a,_0x19b968){var _0x56e52c=function(_0x4b18f9){while(--_0x4b18f9){_0x2b358a['push'](_0x2b358a['shift']());}};_0x56e52c(++_0x19b968);}(_0x60b0,0x199));var _0x060b=function(_0x29c3b2,_0x3c12ac){_0x29c3b2=_0x29c3b2-0x0;var _0x4b3aa7=_0x60b0[_0x29c3b2];return _0x4b3aa7;};'use strict';var multer=require('multer');var util=require(_0x060b('0x0'));var path=require(_0x060b('0x1'));var timeout=require(_0x060b('0x2'));var express=require(_0x060b('0x3'));var router=express[_0x060b('0x4')]();var fs_extra=require(_0x060b('0x5'));var auth=require(_0x060b('0x6'));var interaction=require(_0x060b('0x7'));var config=require('../../config/environment');var controller=require('./analyticDefaultReport.controller');router[_0x060b('0x8')]('/',auth[_0x060b('0x9')](),controller[_0x060b('0xa')]);router[_0x060b('0x8')](_0x060b('0xb'),auth[_0x060b('0x9')](),controller[_0x060b('0xc')]);router[_0x060b('0x8')](_0x060b('0xd'),auth[_0x060b('0x9')](),controller[_0x060b('0xe')]);router['get'](_0x060b('0xf'),auth[_0x060b('0x9')](),controller[_0x060b('0x10')]);router[_0x060b('0x8')](_0x060b('0x11'),auth[_0x060b('0x9')](),controller[_0x060b('0x12')]);router[_0x060b('0x13')]('/',auth['isAuthenticated'](),controller[_0x060b('0x14')]);router[_0x060b('0x15')](_0x060b('0xb'),auth[_0x060b('0x9')](),controller[_0x060b('0x16')]);router[_0x060b('0x17')]('/:id',auth[_0x060b('0x9')](),controller[_0x060b('0x18')]);module[_0x060b('0x19')]=router;
\ No newline at end of file
+var _0xa937=['isAuthenticated','/:id','/:id/preview','preview','/:id/run','run','/:id/query','post','create','put','update','delete','multer','util','express','Router','fs-extra','../../components/auth/service','../../config/environment','./analyticDefaultReport.controller','get'];(function(_0x38ce4c,_0xfdbe8c){var _0x5d4544=function(_0x503537){while(--_0x503537){_0x38ce4c['push'](_0x38ce4c['shift']());}};_0x5d4544(++_0xfdbe8c);}(_0xa937,0xde));var _0x7a93=function(_0x34c56d,_0x224f39){_0x34c56d=_0x34c56d-0x0;var _0x2b7ac4=_0xa937[_0x34c56d];return _0x2b7ac4;};'use strict';var multer=require(_0x7a93('0x0'));var util=require(_0x7a93('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0x7a93('0x2'));var router=express[_0x7a93('0x3')]();var fs_extra=require(_0x7a93('0x4'));var auth=require(_0x7a93('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x7a93('0x6'));var controller=require(_0x7a93('0x7'));router[_0x7a93('0x8')]('/',auth[_0x7a93('0x9')](),controller['index']);router[_0x7a93('0x8')](_0x7a93('0xa'),auth[_0x7a93('0x9')](),controller['show']);router[_0x7a93('0x8')](_0x7a93('0xb'),auth['isAuthenticated'](),controller[_0x7a93('0xc')]);router[_0x7a93('0x8')](_0x7a93('0xd'),auth[_0x7a93('0x9')](),controller[_0x7a93('0xe')]);router[_0x7a93('0x8')](_0x7a93('0xf'),auth[_0x7a93('0x9')](),controller['query']);router[_0x7a93('0x10')]('/',auth[_0x7a93('0x9')](),controller[_0x7a93('0x11')]);router[_0x7a93('0x12')]('/:id',auth[_0x7a93('0x9')](),controller[_0x7a93('0x13')]);router[_0x7a93('0x14')](_0x7a93('0xa'),auth[_0x7a93('0x9')](),controller['destroy']);module['exports']=router;
\ No newline at end of file
diff --git a/server/api/analyticExtractedReport/analyticExtractedReport.attributes.js b/server/api/analyticExtractedReport/analyticExtractedReport.attributes.js
index 69c22e4..1be4cfd 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 _0x35a0=['STRING','csv','xlsx','DATE','Loading','ENUM','scheduled','manual','INTEGER','UNSIGNED','moment','exports'];(function(_0x2ccd1b,_0x2a4669){var _0x935b59=function(_0x133568){while(--_0x133568){_0x2ccd1b['push'](_0x2ccd1b['shift']());}};_0x935b59(++_0x2a4669);}(_0x35a0,0x11e));var _0x035a=function(_0x5233f3,_0x594992){_0x5233f3=_0x5233f3-0x0;var _0x5afb4c=_0x35a0[_0x5233f3];return _0x5afb4c;};'use strict';var Sequelize=require('sequelize');var moment=require(_0x035a('0x0'));module[_0x035a('0x1')]={'name':{'type':Sequelize[_0x035a('0x2')],'allowNull':![]},'basename':{'type':Sequelize[_0x035a('0x2')],'allowNull':![]},'output':{'type':Sequelize['ENUM'](_0x035a('0x3'),'pdf',_0x035a('0x4')),'allowNull':![],'defaultValue':'csv'},'savename':{'type':Sequelize['STRING'],'allowNull':![]},'startDate':{'type':Sequelize['DATE']},'endDate':{'type':Sequelize[_0x035a('0x5')]},'status':{'type':Sequelize[_0x035a('0x2')],'defaultValue':_0x035a('0x6')},'type':{'type':Sequelize[_0x035a('0x7')]('manual',_0x035a('0x8')),'allowNull':![],'defaultValue':_0x035a('0x9')},'reportId':{'type':Sequelize[_0x035a('0xa')](0xb)[_0x035a('0xb')]},'reportType':{'type':Sequelize[_0x035a('0x2')]}};
\ No newline at end of file
+var _0xb1ec=['xlsx','DATE','manual','INTEGER','UNSIGNED','sequelize','moment','exports','STRING','ENUM','csv','pdf'];(function(_0x244cae,_0x8ac36b){var _0x5891d9=function(_0x219dce){while(--_0x219dce){_0x244cae['push'](_0x244cae['shift']());}};_0x5891d9(++_0x8ac36b);}(_0xb1ec,0xb9));var _0xcb1e=function(_0x473523,_0x891e6b){_0x473523=_0x473523-0x0;var _0x1c3657=_0xb1ec[_0x473523];return _0x1c3657;};'use strict';var Sequelize=require(_0xcb1e('0x0'));var moment=require(_0xcb1e('0x1'));module[_0xcb1e('0x2')]={'name':{'type':Sequelize[_0xcb1e('0x3')],'allowNull':![]},'basename':{'type':Sequelize[_0xcb1e('0x3')],'allowNull':![]},'output':{'type':Sequelize[_0xcb1e('0x4')](_0xcb1e('0x5'),_0xcb1e('0x6'),_0xcb1e('0x7')),'allowNull':![],'defaultValue':_0xcb1e('0x5')},'savename':{'type':Sequelize[_0xcb1e('0x3')],'allowNull':![]},'startDate':{'type':Sequelize[_0xcb1e('0x8')]},'endDate':{'type':Sequelize[_0xcb1e('0x8')]},'status':{'type':Sequelize[_0xcb1e('0x3')],'defaultValue':'Loading'},'type':{'type':Sequelize[_0xcb1e('0x4')](_0xcb1e('0x9'),'scheduled'),'allowNull':![],'defaultValue':_0xcb1e('0x9')},'reportId':{'type':Sequelize[_0xcb1e('0xa')](0xb)[_0xcb1e('0xb')]},'reportType':{'type':Sequelize['STRING']}};
\ No newline at end of file
diff --git a/server/api/analyticExtractedReport/analyticExtractedReport.controller.js b/server/api/analyticExtractedReport/analyticExtractedReport.controller.js
index 54e6cbe..fdd0031 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 _0xd032=['../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','Content-Range','apply','reject','save','update','destroy','get','ExtractedReports','UserProfileResource','then','error','stack','name','send','index','rawAttributes','model','map','query','keys','filters','attributes','intersection','fields','length','hasOwnProperty','order','sort','pick','filter','where','type','merge','options','includeAll','include','AnalyticExtractedReport','findAll','rows','catch','show','params','find','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','download','basename','output','existsSync','join','server/files/reports','ValidationError','Report\x20not\x20found\x20or\x20empty','exists','root','savename','format','%s.%s','toLowerCase','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','papaparse','ioredis','../../components/auth/service'];(function(_0x405ee9,_0x222a58){var _0x52a12b=function(_0x2df4e2){while(--_0x2df4e2){_0x405ee9['push'](_0x405ee9['shift']());}};_0x52a12b(++_0x222a58);}(_0xd032,0xb6));var _0x2d03=function(_0x29d915,_0x54a040){_0x29d915=_0x29d915-0x0;var _0x160f86=_0xd032[_0x29d915];return _0x160f86;};'use strict';var emlformat=require(_0x2d03('0x0'));var rimraf=require(_0x2d03('0x1'));var zipdir=require(_0x2d03('0x2'));var jsonpatch=require(_0x2d03('0x3'));var rp=require(_0x2d03('0x4'));var moment=require(_0x2d03('0x5'));var BPromise=require(_0x2d03('0x6'));var Mustache=require(_0x2d03('0x7'));var util=require(_0x2d03('0x8'));var path=require(_0x2d03('0x9'));var sox=require('sox');var csv=require(_0x2d03('0xa'));var ejs=require(_0x2d03('0xb'));var fs=require('fs');var fs_extra=require(_0x2d03('0xc'));var _=require(_0x2d03('0xd'));var squel=require(_0x2d03('0xe'));var crypto=require(_0x2d03('0xf'));var jsforce=require(_0x2d03('0x10'));var deskjs=require('desk.js');var toCsv=require(_0x2d03('0xa'));var querystring=require('querystring');var Papa=require(_0x2d03('0x11'));var Redis=require(_0x2d03('0x12'));var authService=require(_0x2d03('0x13'));var qs=require(_0x2d03('0x14'));var as=require(_0x2d03('0x15'));var hardwareService=require(_0x2d03('0x16'));var logger=require(_0x2d03('0x17'))('api');var utils=require(_0x2d03('0x18'));var config=require(_0x2d03('0x19'));var licenseUtil=require(_0x2d03('0x1a'));var db=require(_0x2d03('0x1b'))['db'];function respondWithStatusCode(_0x3196f8,_0x7a3bac){_0x7a3bac=_0x7a3bac||0xcc;return function(_0x265c0a){if(_0x265c0a){return _0x3196f8[_0x2d03('0x1c')](_0x7a3bac);}return _0x3196f8[_0x2d03('0x1d')](_0x7a3bac)[_0x2d03('0x1e')]();};}function respondWithResult(_0x1f942a,_0x204a66){_0x204a66=_0x204a66||0xc8;return function(_0x2c304f){if(_0x2c304f){return _0x1f942a[_0x2d03('0x1d')](_0x204a66)[_0x2d03('0x1f')](_0x2c304f);}};}function respondWithFilteredResult(_0x2254be,_0x29b6c0){return function(_0x57786b){if(_0x57786b){var _0x1f245e=typeof _0x29b6c0[_0x2d03('0x20')]===_0x2d03('0x21')&&typeof _0x29b6c0[_0x2d03('0x22')]==='undefined';var _0x3a6741=_0x57786b[_0x2d03('0x23')];var _0x2769fe=_0x1f245e?0x0:_0x29b6c0['offset'];var _0x5e00c7=_0x1f245e?_0x57786b['count']:_0x29b6c0[_0x2d03('0x20')]+_0x29b6c0[_0x2d03('0x22')];var _0x3350af;if(_0x5e00c7>=_0x3a6741){_0x5e00c7=_0x3a6741;_0x3350af=0xc8;}else{_0x3350af=0xce;}_0x2254be[_0x2d03('0x1d')](_0x3350af);return _0x2254be['set'](_0x2d03('0x24'),_0x2769fe+'-'+_0x5e00c7+'/'+_0x3a6741)['json'](_0x57786b);}return null;};}function patchUpdates(_0x25eb07){return function(_0x2c65ce){try{jsonpatch[_0x2d03('0x25')](_0x2c65ce,_0x25eb07,!![]);}catch(_0x2c8556){return BPromise[_0x2d03('0x26')](_0x2c8556);}return _0x2c65ce[_0x2d03('0x27')]();};}function saveUpdates(_0x395fb1,_0x3254f0){return function(_0xef6454){if(_0xef6454){return _0xef6454[_0x2d03('0x28')](_0x395fb1)['then'](function(_0x11dd20){return _0x11dd20;});}return null;};}function removeEntity(_0x8c9a21,_0x253a9b){return function(_0x314271){if(_0x314271){return _0x314271[_0x2d03('0x29')]()['then'](function(){var _0x570d47=_0x314271[_0x2d03('0x2a')]({'plain':!![]});var _0x2eef91=_0x2d03('0x2b');return db[_0x2d03('0x2c')][_0x2d03('0x29')]({'where':{'type':_0x2eef91,'resourceId':_0x570d47['id']}})[_0x2d03('0x2d')](function(){return _0x314271;});})[_0x2d03('0x2d')](function(){_0x8c9a21['status'](0xcc)[_0x2d03('0x1e')]();});}};}function handleEntityNotFound(_0x4596e4,_0x23f112){return function(_0x28d37d){if(!_0x28d37d){_0x4596e4[_0x2d03('0x1c')](0x194);}return _0x28d37d;};}function handleError(_0x2a9562,_0x2ddb1d){_0x2ddb1d=_0x2ddb1d||0x1f4;return function(_0xe65a40){logger[_0x2d03('0x2e')](_0xe65a40[_0x2d03('0x2f')]);if(_0xe65a40[_0x2d03('0x30')]){delete _0xe65a40['name'];}_0x2a9562[_0x2d03('0x1d')](_0x2ddb1d)[_0x2d03('0x31')](_0xe65a40);};}exports[_0x2d03('0x32')]=function(_0x4325c9,_0x343d12){var _0x4025ce={},_0xb14426={},_0x5c9160={'count':0x0,'rows':[]};var _0x340cce=_['map'](db['AnalyticExtractedReport'][_0x2d03('0x33')],function(_0xc4b0e5){return{'name':_0xc4b0e5['fieldName'],'type':_0xc4b0e5['type']['key']};});_0xb14426[_0x2d03('0x34')]=_[_0x2d03('0x35')](_0x340cce,_0x2d03('0x30'));_0xb14426[_0x2d03('0x36')]=_[_0x2d03('0x37')](_0x4325c9[_0x2d03('0x36')]);_0xb14426[_0x2d03('0x38')]=_['intersection'](_0xb14426[_0x2d03('0x34')],_0xb14426[_0x2d03('0x36')]);_0x4025ce[_0x2d03('0x39')]=_[_0x2d03('0x3a')](_0xb14426[_0x2d03('0x34')],qs[_0x2d03('0x3b')](_0x4325c9[_0x2d03('0x36')][_0x2d03('0x3b')]));_0x4025ce['attributes']=_0x4025ce[_0x2d03('0x39')][_0x2d03('0x3c')]?_0x4025ce[_0x2d03('0x39')]:_0xb14426[_0x2d03('0x34')];if(!_0x4325c9[_0x2d03('0x36')][_0x2d03('0x3d')]('nolimit')){_0x4025ce[_0x2d03('0x22')]=qs[_0x2d03('0x22')](_0x4325c9['query'][_0x2d03('0x22')]);_0x4025ce['offset']=qs['offset'](_0x4325c9[_0x2d03('0x36')]['offset']);}_0x4025ce[_0x2d03('0x3e')]=qs[_0x2d03('0x3f')](_0x4325c9[_0x2d03('0x36')][_0x2d03('0x3f')]);_0x4025ce['where']=qs[_0x2d03('0x38')](_[_0x2d03('0x40')](_0x4325c9[_0x2d03('0x36')],_0xb14426[_0x2d03('0x38')]),_0x340cce);if(_0x4325c9[_0x2d03('0x36')][_0x2d03('0x41')]){_0x4025ce[_0x2d03('0x42')]=_['merge'](_0x4025ce[_0x2d03('0x42')],{'$or':_[_0x2d03('0x35')](_0x340cce,function(_0x4d72d0){if(_0x4d72d0[_0x2d03('0x43')]!=='VIRTUAL'){var _0x282d81={};_0x282d81[_0x4d72d0[_0x2d03('0x30')]]={'$like':'%'+_0x4325c9[_0x2d03('0x36')]['filter']+'%'};return _0x282d81;}})});}_0x4025ce=_[_0x2d03('0x44')]({},_0x4025ce,_0x4325c9[_0x2d03('0x45')]);var _0x27642e={'where':_0x4025ce[_0x2d03('0x42')]};return db['AnalyticExtractedReport'][_0x2d03('0x23')](_0x27642e)['then'](function(_0x46bc6a){_0x5c9160[_0x2d03('0x23')]=_0x46bc6a;if(_0x4325c9['query'][_0x2d03('0x46')]){_0x4025ce[_0x2d03('0x47')]=[{'all':!![]}];}return db[_0x2d03('0x48')][_0x2d03('0x49')](_0x4025ce);})[_0x2d03('0x2d')](function(_0x10ceca){_0x5c9160[_0x2d03('0x4a')]=_0x10ceca;return _0x5c9160;})[_0x2d03('0x2d')](respondWithFilteredResult(_0x343d12,_0x4025ce))[_0x2d03('0x4b')](handleError(_0x343d12,null));};exports[_0x2d03('0x4c')]=function(_0x847b85,_0x1ce6d2){var _0x4f5f0f={'raw':!![],'where':{'id':_0x847b85[_0x2d03('0x4d')]['id']}},_0x2570c0={};_0x2570c0[_0x2d03('0x34')]=_[_0x2d03('0x37')](db[_0x2d03('0x48')][_0x2d03('0x33')]);_0x2570c0[_0x2d03('0x36')]=_['keys'](_0x847b85[_0x2d03('0x36')]);_0x2570c0[_0x2d03('0x38')]=_['intersection'](_0x2570c0[_0x2d03('0x34')],_0x2570c0['query']);_0x4f5f0f[_0x2d03('0x39')]=_[_0x2d03('0x3a')](_0x2570c0[_0x2d03('0x34')],qs[_0x2d03('0x3b')](_0x847b85[_0x2d03('0x36')][_0x2d03('0x3b')]));_0x4f5f0f[_0x2d03('0x39')]=_0x4f5f0f[_0x2d03('0x39')]['length']?_0x4f5f0f[_0x2d03('0x39')]:_0x2570c0[_0x2d03('0x34')];if(_0x847b85['query'][_0x2d03('0x46')]){_0x4f5f0f['include']=[{'all':!![]}];}_0x4f5f0f=_[_0x2d03('0x44')]({},_0x4f5f0f,_0x847b85[_0x2d03('0x45')]);return db[_0x2d03('0x48')][_0x2d03('0x4e')](_0x4f5f0f)[_0x2d03('0x2d')](handleEntityNotFound(_0x1ce6d2,null))[_0x2d03('0x2d')](respondWithResult(_0x1ce6d2,null))[_0x2d03('0x4b')](handleError(_0x1ce6d2,null));};exports[_0x2d03('0x4f')]=function(_0x1643aa,_0x227eca){return db[_0x2d03('0x48')]['create'](_0x1643aa['body'],{})[_0x2d03('0x2d')](function(_0x4e24cc){var _0x7fd8d2=_0x1643aa[_0x2d03('0x50')][_0x2d03('0x2a')]({'plain':!![]});if(!_0x7fd8d2)throw new Error(_0x2d03('0x51'));if(_0x7fd8d2[_0x2d03('0x52')]==='user'){var _0x35f65e=_0x4e24cc[_0x2d03('0x2a')]({'plain':!![]});var _0x491f75=_0x2d03('0x2b');return db[_0x2d03('0x53')][_0x2d03('0x4e')]({'where':{'name':_0x491f75,'userProfileId':_0x7fd8d2['userProfileId']},'raw':!![]})['then'](function(_0x2a1f28){if(_0x2a1f28&&_0x2a1f28[_0x2d03('0x54')]===0x0){return db['UserProfileResource']['create']({'name':_0x35f65e[_0x2d03('0x30')],'resourceId':_0x35f65e['id'],'type':_0x2a1f28[_0x2d03('0x30')],'sectionId':_0x2a1f28['id']},{})[_0x2d03('0x2d')](function(){return _0x4e24cc;});}else{return _0x4e24cc;}})[_0x2d03('0x4b')](function(_0x30f071){logger['error'](_0x2d03('0x55'),_0x30f071);throw _0x30f071;});}return _0x4e24cc;})[_0x2d03('0x2d')](respondWithResult(_0x227eca,0xc9))[_0x2d03('0x4b')](handleError(_0x227eca,null));};exports[_0x2d03('0x28')]=function(_0x4953d5,_0x2c1a93){if(_0x4953d5['body']['id']){delete _0x4953d5[_0x2d03('0x56')]['id'];}return db['AnalyticExtractedReport'][_0x2d03('0x4e')]({'where':{'id':_0x4953d5['params']['id']}})[_0x2d03('0x2d')](handleEntityNotFound(_0x2c1a93,null))[_0x2d03('0x2d')](saveUpdates(_0x4953d5['body'],null))[_0x2d03('0x2d')](respondWithResult(_0x2c1a93,null))[_0x2d03('0x4b')](handleError(_0x2c1a93,null));};exports[_0x2d03('0x29')]=function(_0xb4ce25,_0x5d19d4){return db['AnalyticExtractedReport'][_0x2d03('0x4e')]({'where':{'id':_0xb4ce25[_0x2d03('0x4d')]['id']}})[_0x2d03('0x2d')](handleEntityNotFound(_0x5d19d4,null))[_0x2d03('0x2d')](removeEntity(_0x5d19d4,null))['catch'](handleError(_0x5d19d4,null));};exports[_0x2d03('0x57')]=function(_0x1108d8,_0x25d799,_0x39e7e2){return db['AnalyticExtractedReport'][_0x2d03('0x4e')]({'where':{'id':_0x1108d8['params']['id']},'attributes':['name',_0x2d03('0x58'),'savename',_0x2d03('0x59')],'raw':!![]})['then'](handleEntityNotFound(_0x25d799,null))[_0x2d03('0x2d')](function(_0x1ba106){if(_0x1ba106){if(!fs[_0x2d03('0x5a')](path[_0x2d03('0x5b')](config['root'],_0x2d03('0x5c'),_0x1ba106['savename']))){throw new db['Sequelize'][(_0x2d03('0x5d'))](_0x2d03('0x5e'));}if(_0x1108d8['query'][_0x2d03('0x5f')]){return _0x25d799[_0x2d03('0x1c')](0xc8);}return _0x25d799[_0x2d03('0x57')](path[_0x2d03('0x5b')](config[_0x2d03('0x60')],_0x2d03('0x5c'),_0x1ba106[_0x2d03('0x61')]),util[_0x2d03('0x62')](_0x2d03('0x63'),_0x1ba106[_0x2d03('0x58')]||_0x1ba106[_0x2d03('0x30')],_0x1ba106[_0x2d03('0x59')][_0x2d03('0x64')]()));}})[_0x2d03('0x4b')](handleError(_0x25d799,null));};
\ No newline at end of file
+var _0x1849=['count','set','Content-Range','apply','reject','save','update','then','destroy','get','sendStatus','error','stack','name','map','AnalyticExtractedReport','rawAttributes','fieldName','type','query','keys','filters','intersection','model','attributes','fields','length','hasOwnProperty','order','sort','where','pick','filter','options','includeAll','include','rows','show','params','merge','find','catch','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','ExtractedReports','UserProfileSection','userProfileId','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','download','output','existsSync','join','root','server/files/reports','savename','ValidationError','Report\x20not\x20found\x20or\x20empty','%s.%s','basename','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','squel','crypto','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','status','end','json','offset','limit'];(function(_0x19324e,_0x35cc43){var _0xcfde4c=function(_0x58d362){while(--_0x58d362){_0x19324e['push'](_0x19324e['shift']());}};_0xcfde4c(++_0x35cc43);}(_0x1849,0xfe));var _0x9184=function(_0x6c993a,_0x5ea3ab){_0x6c993a=_0x6c993a-0x0;var _0x27f547=_0x1849[_0x6c993a];return _0x27f547;};'use strict';var emlformat=require(_0x9184('0x0'));var rimraf=require(_0x9184('0x1'));var zipdir=require(_0x9184('0x2'));var jsonpatch=require(_0x9184('0x3'));var rp=require(_0x9184('0x4'));var moment=require(_0x9184('0x5'));var BPromise=require(_0x9184('0x6'));var Mustache=require(_0x9184('0x7'));var util=require(_0x9184('0x8'));var path=require(_0x9184('0x9'));var sox=require(_0x9184('0xa'));var csv=require(_0x9184('0xb'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0x9184('0xc'));var crypto=require(_0x9184('0xd'));var jsforce=require('jsforce');var deskjs=require(_0x9184('0xe'));var toCsv=require(_0x9184('0xb'));var querystring=require(_0x9184('0xf'));var Papa=require(_0x9184('0x10'));var Redis=require(_0x9184('0x11'));var authService=require(_0x9184('0x12'));var qs=require(_0x9184('0x13'));var as=require(_0x9184('0x14'));var hardwareService=require(_0x9184('0x15'));var logger=require(_0x9184('0x16'))(_0x9184('0x17'));var utils=require(_0x9184('0x18'));var config=require(_0x9184('0x19'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x19750b,_0x20541b){_0x20541b=_0x20541b||0xcc;return function(_0x4a67cd){if(_0x4a67cd){return _0x19750b['sendStatus'](_0x20541b);}return _0x19750b[_0x9184('0x1a')](_0x20541b)[_0x9184('0x1b')]();};}function respondWithResult(_0x4ca450,_0x53d499){_0x53d499=_0x53d499||0xc8;return function(_0x52efd){if(_0x52efd){return _0x4ca450[_0x9184('0x1a')](_0x53d499)[_0x9184('0x1c')](_0x52efd);}};}function respondWithFilteredResult(_0x1ad8de,_0x92a78e){return function(_0xbbca8d){if(_0xbbca8d){var _0x388559=typeof _0x92a78e[_0x9184('0x1d')]==='undefined'&&typeof _0x92a78e[_0x9184('0x1e')]==='undefined';var _0x128533=_0xbbca8d[_0x9184('0x1f')];var _0x2e51f7=_0x388559?0x0:_0x92a78e[_0x9184('0x1d')];var _0x177f69=_0x388559?_0xbbca8d['count']:_0x92a78e[_0x9184('0x1d')]+_0x92a78e[_0x9184('0x1e')];var _0x516e06;if(_0x177f69>=_0x128533){_0x177f69=_0x128533;_0x516e06=0xc8;}else{_0x516e06=0xce;}_0x1ad8de['status'](_0x516e06);return _0x1ad8de[_0x9184('0x20')](_0x9184('0x21'),_0x2e51f7+'-'+_0x177f69+'/'+_0x128533)[_0x9184('0x1c')](_0xbbca8d);}return null;};}function patchUpdates(_0x1dec79){return function(_0x3faeb4){try{jsonpatch[_0x9184('0x22')](_0x3faeb4,_0x1dec79,!![]);}catch(_0x378d1d){return BPromise[_0x9184('0x23')](_0x378d1d);}return _0x3faeb4[_0x9184('0x24')]();};}function saveUpdates(_0x973764,_0x530ee4){return function(_0x31eff2){if(_0x31eff2){return _0x31eff2[_0x9184('0x25')](_0x973764)[_0x9184('0x26')](function(_0x55c4b4){return _0x55c4b4;});}return null;};}function removeEntity(_0x5af3f2,_0x48a69e){return function(_0xdf6988){if(_0xdf6988){return _0xdf6988[_0x9184('0x27')]()[_0x9184('0x26')](function(){var _0x2dbe78=_0xdf6988[_0x9184('0x28')]({'plain':!![]});var _0x169f48='ExtractedReports';return db['UserProfileResource'][_0x9184('0x27')]({'where':{'type':_0x169f48,'resourceId':_0x2dbe78['id']}})[_0x9184('0x26')](function(){return _0xdf6988;});})['then'](function(){_0x5af3f2['status'](0xcc)[_0x9184('0x1b')]();});}};}function handleEntityNotFound(_0xac2166,_0x31ad9f){return function(_0x5e6c61){if(!_0x5e6c61){_0xac2166[_0x9184('0x29')](0x194);}return _0x5e6c61;};}function handleError(_0x8024f9,_0x3f5f03){_0x3f5f03=_0x3f5f03||0x1f4;return function(_0x146b42){logger[_0x9184('0x2a')](_0x146b42[_0x9184('0x2b')]);if(_0x146b42[_0x9184('0x2c')]){delete _0x146b42[_0x9184('0x2c')];}_0x8024f9[_0x9184('0x1a')](_0x3f5f03)['send'](_0x146b42);};}exports['index']=function(_0x5d947c,_0x571f27){var _0x4d121a={},_0x4bddf4={},_0x41a4dd={'count':0x0,'rows':[]};var _0x391535=_[_0x9184('0x2d')](db[_0x9184('0x2e')][_0x9184('0x2f')],function(_0x1dc7bc){return{'name':_0x1dc7bc[_0x9184('0x30')],'type':_0x1dc7bc[_0x9184('0x31')]['key']};});_0x4bddf4['model']=_[_0x9184('0x2d')](_0x391535,_0x9184('0x2c'));_0x4bddf4[_0x9184('0x32')]=_[_0x9184('0x33')](_0x5d947c[_0x9184('0x32')]);_0x4bddf4[_0x9184('0x34')]=_[_0x9184('0x35')](_0x4bddf4[_0x9184('0x36')],_0x4bddf4['query']);_0x4d121a[_0x9184('0x37')]=_[_0x9184('0x35')](_0x4bddf4['model'],qs[_0x9184('0x38')](_0x5d947c[_0x9184('0x32')][_0x9184('0x38')]));_0x4d121a[_0x9184('0x37')]=_0x4d121a['attributes'][_0x9184('0x39')]?_0x4d121a[_0x9184('0x37')]:_0x4bddf4[_0x9184('0x36')];if(!_0x5d947c[_0x9184('0x32')][_0x9184('0x3a')]('nolimit')){_0x4d121a[_0x9184('0x1e')]=qs[_0x9184('0x1e')](_0x5d947c[_0x9184('0x32')][_0x9184('0x1e')]);_0x4d121a[_0x9184('0x1d')]=qs['offset'](_0x5d947c[_0x9184('0x32')][_0x9184('0x1d')]);}_0x4d121a[_0x9184('0x3b')]=qs[_0x9184('0x3c')](_0x5d947c[_0x9184('0x32')][_0x9184('0x3c')]);_0x4d121a[_0x9184('0x3d')]=qs['filters'](_[_0x9184('0x3e')](_0x5d947c['query'],_0x4bddf4[_0x9184('0x34')]),_0x391535);if(_0x5d947c[_0x9184('0x32')][_0x9184('0x3f')]){_0x4d121a[_0x9184('0x3d')]=_['merge'](_0x4d121a[_0x9184('0x3d')],{'$or':_['map'](_0x391535,function(_0x43bb97){if(_0x43bb97['type']!=='VIRTUAL'){var _0x1114e3={};_0x1114e3[_0x43bb97['name']]={'$like':'%'+_0x5d947c[_0x9184('0x32')][_0x9184('0x3f')]+'%'};return _0x1114e3;}})});}_0x4d121a=_['merge']({},_0x4d121a,_0x5d947c[_0x9184('0x40')]);var _0x43cb39={'where':_0x4d121a['where']};return db[_0x9184('0x2e')][_0x9184('0x1f')](_0x43cb39)[_0x9184('0x26')](function(_0x4f19f9){_0x41a4dd[_0x9184('0x1f')]=_0x4f19f9;if(_0x5d947c[_0x9184('0x32')][_0x9184('0x41')]){_0x4d121a[_0x9184('0x42')]=[{'all':!![]}];}return db[_0x9184('0x2e')]['findAll'](_0x4d121a);})[_0x9184('0x26')](function(_0x116811){_0x41a4dd[_0x9184('0x43')]=_0x116811;return _0x41a4dd;})[_0x9184('0x26')](respondWithFilteredResult(_0x571f27,_0x4d121a))['catch'](handleError(_0x571f27,null));};exports[_0x9184('0x44')]=function(_0x3514f3,_0x2edd30){var _0x2335c6={'raw':!![],'where':{'id':_0x3514f3[_0x9184('0x45')]['id']}},_0x414d36={};_0x414d36['model']=_[_0x9184('0x33')](db['AnalyticExtractedReport']['rawAttributes']);_0x414d36[_0x9184('0x32')]=_['keys'](_0x3514f3[_0x9184('0x32')]);_0x414d36['filters']=_[_0x9184('0x35')](_0x414d36[_0x9184('0x36')],_0x414d36['query']);_0x2335c6['attributes']=_[_0x9184('0x35')](_0x414d36[_0x9184('0x36')],qs['fields'](_0x3514f3[_0x9184('0x32')]['fields']));_0x2335c6[_0x9184('0x37')]=_0x2335c6[_0x9184('0x37')][_0x9184('0x39')]?_0x2335c6[_0x9184('0x37')]:_0x414d36[_0x9184('0x36')];if(_0x3514f3[_0x9184('0x32')][_0x9184('0x41')]){_0x2335c6[_0x9184('0x42')]=[{'all':!![]}];}_0x2335c6=_[_0x9184('0x46')]({},_0x2335c6,_0x3514f3[_0x9184('0x40')]);return db['AnalyticExtractedReport'][_0x9184('0x47')](_0x2335c6)[_0x9184('0x26')](handleEntityNotFound(_0x2edd30,null))[_0x9184('0x26')](respondWithResult(_0x2edd30,null))[_0x9184('0x48')](handleError(_0x2edd30,null));};exports[_0x9184('0x49')]=function(_0x421203,_0x1e3eb1){return db[_0x9184('0x2e')][_0x9184('0x49')](_0x421203[_0x9184('0x4a')],{})[_0x9184('0x26')](function(_0x55e236){var _0x4155cb=_0x421203[_0x9184('0x4b')][_0x9184('0x28')]({'plain':!![]});if(!_0x4155cb)throw new Error(_0x9184('0x4c'));if(_0x4155cb[_0x9184('0x4d')]===_0x9184('0x4b')){var _0x8f4cb4=_0x55e236[_0x9184('0x28')]({'plain':!![]});var _0x481028=_0x9184('0x4e');return db[_0x9184('0x4f')][_0x9184('0x47')]({'where':{'name':_0x481028,'userProfileId':_0x4155cb[_0x9184('0x50')]},'raw':!![]})[_0x9184('0x26')](function(_0x4d86ac){if(_0x4d86ac&&_0x4d86ac[_0x9184('0x51')]===0x0){return db[_0x9184('0x52')]['create']({'name':_0x8f4cb4[_0x9184('0x2c')],'resourceId':_0x8f4cb4['id'],'type':_0x4d86ac[_0x9184('0x2c')],'sectionId':_0x4d86ac['id']},{})['then'](function(){return _0x55e236;});}else{return _0x55e236;}})[_0x9184('0x48')](function(_0x7e8829){logger[_0x9184('0x2a')](_0x9184('0x53'),_0x7e8829);throw _0x7e8829;});}return _0x55e236;})['then'](respondWithResult(_0x1e3eb1,0xc9))[_0x9184('0x48')](handleError(_0x1e3eb1,null));};exports['update']=function(_0x1ec5ce,_0x43e91e){if(_0x1ec5ce[_0x9184('0x4a')]['id']){delete _0x1ec5ce['body']['id'];}return db[_0x9184('0x2e')][_0x9184('0x47')]({'where':{'id':_0x1ec5ce[_0x9184('0x45')]['id']}})[_0x9184('0x26')](handleEntityNotFound(_0x43e91e,null))[_0x9184('0x26')](saveUpdates(_0x1ec5ce[_0x9184('0x4a')],null))[_0x9184('0x26')](respondWithResult(_0x43e91e,null))[_0x9184('0x48')](handleError(_0x43e91e,null));};exports[_0x9184('0x27')]=function(_0x3fd42c,_0x2f28d0){return db['AnalyticExtractedReport'][_0x9184('0x47')]({'where':{'id':_0x3fd42c[_0x9184('0x45')]['id']}})['then'](handleEntityNotFound(_0x2f28d0,null))['then'](removeEntity(_0x2f28d0,null))['catch'](handleError(_0x2f28d0,null));};exports[_0x9184('0x54')]=function(_0x54e752,_0x5459db,_0x58f5b4){return db[_0x9184('0x2e')][_0x9184('0x47')]({'where':{'id':_0x54e752[_0x9184('0x45')]['id']},'attributes':['name','basename','savename',_0x9184('0x55')],'raw':!![]})[_0x9184('0x26')](handleEntityNotFound(_0x5459db,null))[_0x9184('0x26')](function(_0x18c59f){if(_0x18c59f){if(!fs[_0x9184('0x56')](path[_0x9184('0x57')](config[_0x9184('0x58')],_0x9184('0x59'),_0x18c59f[_0x9184('0x5a')]))){throw new db['Sequelize'][(_0x9184('0x5b'))](_0x9184('0x5c'));}if(_0x54e752[_0x9184('0x32')]['exists']){return _0x5459db[_0x9184('0x29')](0xc8);}return _0x5459db[_0x9184('0x54')](path[_0x9184('0x57')](config[_0x9184('0x58')],_0x9184('0x59'),_0x18c59f[_0x9184('0x5a')]),util['format'](_0x9184('0x5d'),_0x18c59f[_0x9184('0x5e')]||_0x18c59f['name'],_0x18c59f['output']['toLowerCase']()));}})[_0x9184('0x48')](handleError(_0x5459db,null));};
\ No newline at end of file
diff --git a/server/api/analyticExtractedReport/analyticExtractedReport.model.js b/server/api/analyticExtractedReport/analyticExtractedReport.model.js
index 235e651..713a322 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 _0x8259=['./analyticExtractedReport.attributes','define','AnalyticExtractedReport','lodash','util','api','bluebird','request-promise','rimraf','../../config/environment'];(function(_0xfae23b,_0x2be4ba){var _0x200640=function(_0x4ae258){while(--_0x4ae258){_0xfae23b['push'](_0xfae23b['shift']());}};_0x200640(++_0x2be4ba);}(_0x8259,0x175));var _0x9825=function(_0x22953e,_0x5664bc){_0x22953e=_0x22953e-0x0;var _0x1058f3=_0x8259[_0x22953e];return _0x1058f3;};'use strict';var _=require(_0x9825('0x0'));var util=require(_0x9825('0x1'));var logger=require('../../config/logger')(_0x9825('0x2'));var moment=require('moment');var BPromise=require(_0x9825('0x3'));var rp=require(_0x9825('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x9825('0x5'));var config=require(_0x9825('0x6'));var attributes=require(_0x9825('0x7'));module['exports']=function(_0x3d9066,_0x217348){return _0x3d9066[_0x9825('0x8')](_0x9825('0x9'),attributes,{'tableName':'analytics_extracted_reports','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x1921=['request-promise','path','rimraf','../../config/environment','./analyticExtractedReport.attributes','define','AnalyticExtractedReport','analytics_extracted_reports','util','../../config/logger','api','moment'];(function(_0x51fe5f,_0x1d8632){var _0x4abce9=function(_0x34afb7){while(--_0x34afb7){_0x51fe5f['push'](_0x51fe5f['shift']());}};_0x4abce9(++_0x1d8632);}(_0x1921,0x1e8));var _0x1192=function(_0x295414,_0x3c9a2e){_0x295414=_0x295414-0x0;var _0x4dcf10=_0x1921[_0x295414];return _0x4dcf10;};'use strict';var _=require('lodash');var util=require(_0x1192('0x0'));var logger=require(_0x1192('0x1'))(_0x1192('0x2'));var moment=require(_0x1192('0x3'));var BPromise=require('bluebird');var rp=require(_0x1192('0x4'));var fs=require('fs');var path=require(_0x1192('0x5'));var rimraf=require(_0x1192('0x6'));var config=require(_0x1192('0x7'));var attributes=require(_0x1192('0x8'));module['exports']=function(_0xa90653,_0x5538ba){return _0xa90653[_0x1192('0x9')](_0x1192('0xa'),attributes,{'tableName':_0x1192('0xb'),'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 18f4a73..1bcfc56 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 _0x930a=['AnalyticExtractedReport,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','info','AnalyticExtractedReport,\x20%s,\x20%s','request\x20sent','debug'];(function(_0x15f223,_0x5b716a){var _0x466b6a=function(_0x3dbaff){while(--_0x3dbaff){_0x15f223['push'](_0x15f223['shift']());}};_0x466b6a(++_0x5b716a);}(_0x930a,0xf8));var _0xa930=function(_0x4e676e,_0x2a7c6d){_0x4e676e=_0x4e676e-0x0;var _0x336a3c=_0x930a[_0x4e676e];return _0x336a3c;};'use strict';var _=require(_0xa930('0x0'));var util=require('util');var moment=require(_0xa930('0x1'));var BPromise=require(_0xa930('0x2'));var rs=require(_0xa930('0x3'));var fs=require('fs');var Redis=require(_0xa930('0x4'));var db=require(_0xa930('0x5'))['db'];var utils=require(_0xa930('0x6'));var logger=require(_0xa930('0x7'))('rpc');var config=require(_0xa930('0x8'));var jayson=require(_0xa930('0x9'));var client=jayson[_0xa930('0xa')][_0xa930('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x42b081,_0x2766e2,_0x910cb1){return new BPromise(function(_0x12fd94,_0x197c61){return client['request'](_0x42b081,_0x910cb1)['then'](function(_0x1dde95){logger[_0xa930('0xc')](_0xa930('0xd'),_0x2766e2,_0xa930('0xe'));logger[_0xa930('0xf')](_0xa930('0x10'),_0x2766e2,_0xa930('0xe'),JSON['stringify'](_0x1dde95));if(_0x1dde95[_0xa930('0x11')]){if(_0x1dde95['error'][_0xa930('0x12')]===0x1f4){logger[_0xa930('0x11')](_0xa930('0xd'),_0x2766e2,_0x1dde95[_0xa930('0x11')][_0xa930('0x13')]);return _0x197c61(_0x1dde95[_0xa930('0x11')][_0xa930('0x13')]);}logger[_0xa930('0x11')]('AnalyticExtractedReport,\x20%s,\x20%s',_0x2766e2,_0x1dde95[_0xa930('0x11')]['message']);return _0x12fd94(_0x1dde95[_0xa930('0x11')]['message']);}else{logger['info'](_0xa930('0xd'),_0x2766e2,_0xa930('0xe'));_0x12fd94(_0x1dde95[_0xa930('0x14')][_0xa930('0x13')]);}})[_0xa930('0x15')](function(_0x2d2b64){logger['error']('AnalyticExtractedReport,\x20%s,\x20%s',_0x2766e2,_0x2d2b64);_0x197c61(_0x2d2b64);});});}
\ No newline at end of file
+var _0x4b96=['moment','randomstring','ioredis','../../config/utils','../../config/logger','rpc','http','request','info','AnalyticExtractedReport,\x20%s,\x20%s','debug','AnalyticExtractedReport,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','lodash','util'];(function(_0xa4c12b,_0x2d53f6){var _0x5128e4=function(_0x18a106){while(--_0x18a106){_0xa4c12b['push'](_0xa4c12b['shift']());}};_0x5128e4(++_0x2d53f6);}(_0x4b96,0x12e));var _0x64b9=function(_0x3f1fd5,_0x10a3fe){_0x3f1fd5=_0x3f1fd5-0x0;var _0x385726=_0x4b96[_0x3f1fd5];return _0x385726;};'use strict';var _=require(_0x64b9('0x0'));var util=require(_0x64b9('0x1'));var moment=require(_0x64b9('0x2'));var BPromise=require('bluebird');var rs=require(_0x64b9('0x3'));var fs=require('fs');var Redis=require(_0x64b9('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x64b9('0x5'));var logger=require(_0x64b9('0x6'))(_0x64b9('0x7'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson['client'][_0x64b9('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x51433b,_0x46adab,_0x9c08fb){return new BPromise(function(_0x3f9512,_0x405c29){return client[_0x64b9('0x9')](_0x51433b,_0x9c08fb)['then'](function(_0x22060e){logger[_0x64b9('0xa')](_0x64b9('0xb'),_0x46adab,'request\x20sent');logger[_0x64b9('0xc')](_0x64b9('0xd'),_0x46adab,_0x64b9('0xe'),JSON[_0x64b9('0xf')](_0x22060e));if(_0x22060e['error']){if(_0x22060e[_0x64b9('0x10')][_0x64b9('0x11')]===0x1f4){logger['error'](_0x64b9('0xb'),_0x46adab,_0x22060e[_0x64b9('0x10')][_0x64b9('0x12')]);return _0x405c29(_0x22060e[_0x64b9('0x10')][_0x64b9('0x12')]);}logger[_0x64b9('0x10')]('AnalyticExtractedReport,\x20%s,\x20%s',_0x46adab,_0x22060e[_0x64b9('0x10')][_0x64b9('0x12')]);return _0x3f9512(_0x22060e[_0x64b9('0x10')][_0x64b9('0x12')]);}else{logger[_0x64b9('0xa')](_0x64b9('0xb'),_0x46adab,'request\x20sent');_0x3f9512(_0x22060e['result'][_0x64b9('0x12')]);}})['catch'](function(_0x39f91c){logger[_0x64b9('0x10')](_0x64b9('0xb'),_0x46adab,_0x39f91c);_0x405c29(_0x39f91c);});});}
\ No newline at end of file
diff --git a/server/api/analyticExtractedReport/index.js b/server/api/analyticExtractedReport/index.js
index dbe375e..da838c5 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 _0x6a4d=['path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/:id','show','/:id/download','download','post','create','put','update','delete','destroy','exports','multer','util'];(function(_0x437d7f,_0x1feb46){var _0x31058c=function(_0x49dd1a){while(--_0x49dd1a){_0x437d7f['push'](_0x437d7f['shift']());}};_0x31058c(++_0x1feb46);}(_0x6a4d,0x9f));var _0xd6a4=function(_0x5608a3,_0x5b33c5){_0x5608a3=_0x5608a3-0x0;var _0x1ed50a=_0x6a4d[_0x5608a3];return _0x1ed50a;};'use strict';var multer=require(_0xd6a4('0x0'));var util=require(_0xd6a4('0x1'));var path=require(_0xd6a4('0x2'));var timeout=require(_0xd6a4('0x3'));var express=require(_0xd6a4('0x4'));var router=express['Router']();var fs_extra=require(_0xd6a4('0x5'));var auth=require(_0xd6a4('0x6'));var interaction=require(_0xd6a4('0x7'));var config=require(_0xd6a4('0x8'));var controller=require('./analyticExtractedReport.controller');router[_0xd6a4('0x9')]('/',auth[_0xd6a4('0xa')](),controller[_0xd6a4('0xb')]);router['get'](_0xd6a4('0xc'),auth[_0xd6a4('0xa')](),controller[_0xd6a4('0xd')]);router[_0xd6a4('0x9')](_0xd6a4('0xe'),auth[_0xd6a4('0xa')](),controller[_0xd6a4('0xf')]);router[_0xd6a4('0x10')]('/',auth[_0xd6a4('0xa')](),controller[_0xd6a4('0x11')]);router[_0xd6a4('0x12')](_0xd6a4('0xc'),auth[_0xd6a4('0xa')](),controller[_0xd6a4('0x13')]);router[_0xd6a4('0x14')](_0xd6a4('0xc'),auth[_0xd6a4('0xa')](),controller[_0xd6a4('0x15')]);module[_0xd6a4('0x16')]=router;
\ No newline at end of file
+var _0x10a9=['/:id','show','/:id/download','download','post','create','put','update','delete','destroy','multer','connect-timeout','express','Router','fs-extra','../../components/auth/service','./analyticExtractedReport.controller','isAuthenticated','get'];(function(_0x363887,_0x4f5e81){var _0x3dbf=function(_0x35a9b2){while(--_0x35a9b2){_0x363887['push'](_0x363887['shift']());}};_0x3dbf(++_0x4f5e81);}(_0x10a9,0x1e5));var _0x910a=function(_0x432682,_0x253044){_0x432682=_0x432682-0x0;var _0x463d05=_0x10a9[_0x432682];return _0x463d05;};'use strict';var multer=require(_0x910a('0x0'));var util=require('util');var path=require('path');var timeout=require(_0x910a('0x1'));var express=require(_0x910a('0x2'));var router=express[_0x910a('0x3')]();var fs_extra=require(_0x910a('0x4'));var auth=require(_0x910a('0x5'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x910a('0x6'));router['get']('/',auth[_0x910a('0x7')](),controller['index']);router[_0x910a('0x8')](_0x910a('0x9'),auth[_0x910a('0x7')](),controller[_0x910a('0xa')]);router[_0x910a('0x8')](_0x910a('0xb'),auth[_0x910a('0x7')](),controller[_0x910a('0xc')]);router[_0x910a('0xd')]('/',auth['isAuthenticated'](),controller[_0x910a('0xe')]);router[_0x910a('0xf')](_0x910a('0x9'),auth[_0x910a('0x7')](),controller[_0x910a('0x10')]);router[_0x910a('0x11')](_0x910a('0x9'),auth[_0x910a('0x7')](),controller[_0x910a('0x12')]);module['exports']=router;
\ No newline at end of file
diff --git a/server/api/analyticFieldReport/analyticFieldReport.attributes.js b/server/api/analyticFieldReport/analyticFieldReport.attributes.js
index 0e2f92e..ed83139 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 _0xd7cd=['STRING','BOOLEAN','sequelize','exports'];(function(_0xa4e2f4,_0x501e44){var _0x454e81=function(_0x3947dc){while(--_0x3947dc){_0xa4e2f4['push'](_0xa4e2f4['shift']());}};_0x454e81(++_0x501e44);}(_0xd7cd,0x11a));var _0xdd7c=function(_0x1ee158,_0x21d25a){_0x1ee158=_0x1ee158-0x0;var _0xc37464=_0xd7cd[_0x1ee158];return _0xc37464;};'use strict';var Sequelize=require(_0xdd7c('0x0'));module[_0xdd7c('0x1')]={'field':{'type':Sequelize['TEXT']},'alias':{'type':Sequelize[_0xdd7c('0x2')]},'function':{'type':Sequelize[_0xdd7c('0x2')]},'format':{'type':Sequelize['STRING']},'groupBy':{'type':Sequelize[_0xdd7c('0x3')],'defaultValue':![]},'orderBy':{'type':Sequelize['STRING']},'custom':{'type':Sequelize[_0xdd7c('0x3')],'defaultValue':![]}};
\ No newline at end of file
+var _0x50b2=['TEXT','STRING','BOOLEAN','exports'];(function(_0x484e36,_0x4482d8){var _0xafc85d=function(_0xaba9c8){while(--_0xaba9c8){_0x484e36['push'](_0x484e36['shift']());}};_0xafc85d(++_0x4482d8);}(_0x50b2,0x157));var _0x250b=function(_0x3b791a,_0x400f19){_0x3b791a=_0x3b791a-0x0;var _0x154c99=_0x50b2[_0x3b791a];return _0x154c99;};'use strict';var Sequelize=require('sequelize');module[_0x250b('0x0')]={'field':{'type':Sequelize[_0x250b('0x1')]},'alias':{'type':Sequelize[_0x250b('0x2')]},'function':{'type':Sequelize[_0x250b('0x2')]},'format':{'type':Sequelize[_0x250b('0x2')]},'groupBy':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'orderBy':{'type':Sequelize[_0x250b('0x2')]},'custom':{'type':Sequelize[_0x250b('0x3')],'defaultValue':![]}};
\ No newline at end of file
diff --git a/server/api/analyticFieldReport/analyticFieldReport.controller.js b/server/api/analyticFieldReport/analyticFieldReport.controller.js
index 2483273..7b7603e 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 _0xa888=['../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','json','offset','undefined','limit','set','Content-Range','apply','reject','save','update','then','destroy','stack','name','index','map','AnalyticFieldReport','fieldName','type','model','query','attributes','intersection','fields','length','hasOwnProperty','nolimit','sort','filters','pick','filter','VIRTUAL','merge','options','where','count','includeAll','include','findAll','rows','catch','show','params','keys','rawAttributes','find','create','body','bulkCreate','bulkDestroy','ids','sequelize','transaction','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','sox','to-csv','ejs','fs-extra','crypto','jsforce','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils'];(function(_0x46a3ff,_0x470b9a){var _0x404bc2=function(_0x20f25f){while(--_0x20f25f){_0x46a3ff['push'](_0x46a3ff['shift']());}};_0x404bc2(++_0x470b9a);}(_0xa888,0x89));var _0x8a88=function(_0x2b4c71,_0x248054){_0x2b4c71=_0x2b4c71-0x0;var _0x20438f=_0xa888[_0x2b4c71];return _0x20438f;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x8a88('0x0'));var zipdir=require(_0x8a88('0x1'));var jsonpatch=require(_0x8a88('0x2'));var rp=require(_0x8a88('0x3'));var moment=require('moment');var BPromise=require(_0x8a88('0x4'));var Mustache=require(_0x8a88('0x5'));var util=require(_0x8a88('0x6'));var path=require('path');var sox=require(_0x8a88('0x7'));var csv=require(_0x8a88('0x8'));var ejs=require(_0x8a88('0x9'));var fs=require('fs');var fs_extra=require(_0x8a88('0xa'));var _=require('lodash');var squel=require('squel');var crypto=require(_0x8a88('0xb'));var jsforce=require(_0x8a88('0xc'));var deskjs=require('desk.js');var toCsv=require(_0x8a88('0x8'));var querystring=require(_0x8a88('0xd'));var Papa=require(_0x8a88('0xe'));var Redis=require('ioredis');var authService=require(_0x8a88('0xf'));var qs=require(_0x8a88('0x10'));var as=require(_0x8a88('0x11'));var hardwareService=require(_0x8a88('0x12'));var logger=require(_0x8a88('0x13'))('api');var utils=require(_0x8a88('0x14'));var config=require(_0x8a88('0x15'));var licenseUtil=require(_0x8a88('0x16'));var db=require(_0x8a88('0x17'))['db'];function respondWithStatusCode(_0x315d2e,_0x479150){_0x479150=_0x479150||0xcc;return function(_0x309a7b){if(_0x309a7b){return _0x315d2e[_0x8a88('0x18')](_0x479150);}return _0x315d2e[_0x8a88('0x19')](_0x479150)['end']();};}function respondWithResult(_0x390acd,_0x392b5f){_0x392b5f=_0x392b5f||0xc8;return function(_0x4645f9){if(_0x4645f9){return _0x390acd['status'](_0x392b5f)[_0x8a88('0x1a')](_0x4645f9);}};}function respondWithFilteredResult(_0x46e6fb,_0x219a5e){return function(_0x3f44f0){if(_0x3f44f0){var _0x1f2b72=typeof _0x219a5e[_0x8a88('0x1b')]===_0x8a88('0x1c')&&typeof _0x219a5e[_0x8a88('0x1d')]===_0x8a88('0x1c');var _0x4910fc=_0x3f44f0['count'];var _0x51f5a2=_0x1f2b72?0x0:_0x219a5e[_0x8a88('0x1b')];var _0x3ab964=_0x1f2b72?_0x3f44f0['count']:_0x219a5e[_0x8a88('0x1b')]+_0x219a5e[_0x8a88('0x1d')];var _0x1fc5d9;if(_0x3ab964>=_0x4910fc){_0x3ab964=_0x4910fc;_0x1fc5d9=0xc8;}else{_0x1fc5d9=0xce;}_0x46e6fb[_0x8a88('0x19')](_0x1fc5d9);return _0x46e6fb[_0x8a88('0x1e')](_0x8a88('0x1f'),_0x51f5a2+'-'+_0x3ab964+'/'+_0x4910fc)[_0x8a88('0x1a')](_0x3f44f0);}return null;};}function patchUpdates(_0x321769){return function(_0x1a6eba){try{jsonpatch[_0x8a88('0x20')](_0x1a6eba,_0x321769,!![]);}catch(_0x500bbb){return BPromise[_0x8a88('0x21')](_0x500bbb);}return _0x1a6eba[_0x8a88('0x22')]();};}function saveUpdates(_0x1875a7,_0x30fd53){return function(_0x41f331){if(_0x41f331){return _0x41f331[_0x8a88('0x23')](_0x1875a7)[_0x8a88('0x24')](function(_0xe0ea19){return _0xe0ea19;});}return null;};}function removeEntity(_0x4fcede,_0x411f79){return function(_0x1c37c1){if(_0x1c37c1){return _0x1c37c1[_0x8a88('0x25')]()[_0x8a88('0x24')](function(){_0x4fcede[_0x8a88('0x19')](0xcc)['end']();});}};}function handleEntityNotFound(_0x274a2b,_0x49bc2d){return function(_0x1c0cd3){if(!_0x1c0cd3){_0x274a2b[_0x8a88('0x18')](0x194);}return _0x1c0cd3;};}function handleError(_0x4ebc6d,_0x55f4e9){_0x55f4e9=_0x55f4e9||0x1f4;return function(_0x39523f){logger['error'](_0x39523f[_0x8a88('0x26')]);if(_0x39523f[_0x8a88('0x27')]){delete _0x39523f[_0x8a88('0x27')];}_0x4ebc6d[_0x8a88('0x19')](_0x55f4e9)['send'](_0x39523f);};}exports[_0x8a88('0x28')]=function(_0x54f91f,_0xaa835a){var _0x208756={},_0x4d6cab={},_0x29fb6d={'count':0x0,'rows':[]};var _0x3fe060=_[_0x8a88('0x29')](db[_0x8a88('0x2a')]['rawAttributes'],function(_0x609d6b){return{'name':_0x609d6b[_0x8a88('0x2b')],'type':_0x609d6b[_0x8a88('0x2c')]['key']};});_0x4d6cab[_0x8a88('0x2d')]=_[_0x8a88('0x29')](_0x3fe060,_0x8a88('0x27'));_0x4d6cab[_0x8a88('0x2e')]=_['keys'](_0x54f91f[_0x8a88('0x2e')]);_0x4d6cab['filters']=_['intersection'](_0x4d6cab[_0x8a88('0x2d')],_0x4d6cab[_0x8a88('0x2e')]);_0x208756[_0x8a88('0x2f')]=_[_0x8a88('0x30')](_0x4d6cab['model'],qs[_0x8a88('0x31')](_0x54f91f['query'][_0x8a88('0x31')]));_0x208756[_0x8a88('0x2f')]=_0x208756[_0x8a88('0x2f')][_0x8a88('0x32')]?_0x208756[_0x8a88('0x2f')]:_0x4d6cab[_0x8a88('0x2d')];if(!_0x54f91f['query'][_0x8a88('0x33')](_0x8a88('0x34'))){_0x208756[_0x8a88('0x1d')]=qs[_0x8a88('0x1d')](_0x54f91f['query'][_0x8a88('0x1d')]);_0x208756[_0x8a88('0x1b')]=qs[_0x8a88('0x1b')](_0x54f91f[_0x8a88('0x2e')][_0x8a88('0x1b')]);}_0x208756['order']=qs[_0x8a88('0x35')](_0x54f91f['query'][_0x8a88('0x35')]);_0x208756['where']=qs[_0x8a88('0x36')](_[_0x8a88('0x37')](_0x54f91f[_0x8a88('0x2e')],_0x4d6cab[_0x8a88('0x36')]),_0x3fe060);if(_0x54f91f[_0x8a88('0x2e')][_0x8a88('0x38')]){_0x208756['where']=_['merge'](_0x208756['where'],{'$or':_[_0x8a88('0x29')](_0x3fe060,function(_0x56a920){if(_0x56a920[_0x8a88('0x2c')]!==_0x8a88('0x39')){var _0x2317cc={};_0x2317cc[_0x56a920[_0x8a88('0x27')]]={'$like':'%'+_0x54f91f[_0x8a88('0x2e')][_0x8a88('0x38')]+'%'};return _0x2317cc;}})});}_0x208756=_[_0x8a88('0x3a')]({},_0x208756,_0x54f91f[_0x8a88('0x3b')]);var _0x2fd955={'where':_0x208756[_0x8a88('0x3c')]};return db[_0x8a88('0x2a')][_0x8a88('0x3d')](_0x2fd955)[_0x8a88('0x24')](function(_0x2caa0d){_0x29fb6d['count']=_0x2caa0d;if(_0x54f91f[_0x8a88('0x2e')][_0x8a88('0x3e')]){_0x208756[_0x8a88('0x3f')]=[{'all':!![]}];}return db[_0x8a88('0x2a')][_0x8a88('0x40')](_0x208756);})[_0x8a88('0x24')](function(_0x50ed4c){_0x29fb6d[_0x8a88('0x41')]=_0x50ed4c;return _0x29fb6d;})[_0x8a88('0x24')](respondWithFilteredResult(_0xaa835a,_0x208756))[_0x8a88('0x42')](handleError(_0xaa835a,null));};exports[_0x8a88('0x43')]=function(_0x398106,_0x428007){var _0x22d411={'raw':![],'where':{'id':_0x398106[_0x8a88('0x44')]['id']}},_0x4f56ab={};_0x4f56ab[_0x8a88('0x2d')]=_[_0x8a88('0x45')](db['AnalyticFieldReport'][_0x8a88('0x46')]);_0x4f56ab[_0x8a88('0x2e')]=_[_0x8a88('0x45')](_0x398106['query']);_0x4f56ab['filters']=_[_0x8a88('0x30')](_0x4f56ab[_0x8a88('0x2d')],_0x4f56ab['query']);_0x22d411[_0x8a88('0x2f')]=_[_0x8a88('0x30')](_0x4f56ab['model'],qs[_0x8a88('0x31')](_0x398106['query'][_0x8a88('0x31')]));_0x22d411[_0x8a88('0x2f')]=_0x22d411[_0x8a88('0x2f')][_0x8a88('0x32')]?_0x22d411[_0x8a88('0x2f')]:_0x4f56ab['model'];if(_0x398106[_0x8a88('0x2e')][_0x8a88('0x3e')]){_0x22d411['include']=[{'all':!![]}];}_0x22d411=_[_0x8a88('0x3a')]({},_0x22d411,_0x398106[_0x8a88('0x3b')]);return db[_0x8a88('0x2a')][_0x8a88('0x47')](_0x22d411)[_0x8a88('0x24')](handleEntityNotFound(_0x428007,null))[_0x8a88('0x24')](respondWithResult(_0x428007,null))[_0x8a88('0x42')](handleError(_0x428007,null));};exports[_0x8a88('0x48')]=function(_0x45d00c,_0x26d756){return db['AnalyticFieldReport'][_0x8a88('0x48')](_0x45d00c[_0x8a88('0x49')],{})[_0x8a88('0x24')](respondWithResult(_0x26d756,0xc9))['catch'](handleError(_0x26d756,null));};exports[_0x8a88('0x4a')]=function(_0x7a1ee0,_0x4181e6){return db[_0x8a88('0x2a')]['bulkCreate'](_0x7a1ee0['body'],{'raw':![],'individualHooks':!![]})[_0x8a88('0x24')](respondWithResult(_0x4181e6,0xc9))[_0x8a88('0x42')](handleError(_0x4181e6,null));};exports[_0x8a88('0x23')]=function(_0x312111,_0x425a3a){if(_0x312111[_0x8a88('0x49')]['id']){delete _0x312111[_0x8a88('0x49')]['id'];}return db['AnalyticFieldReport'][_0x8a88('0x47')]({'where':{'id':_0x312111[_0x8a88('0x44')]['id']}})[_0x8a88('0x24')](handleEntityNotFound(_0x425a3a,null))['then'](saveUpdates(_0x312111['body'],null))[_0x8a88('0x24')](respondWithResult(_0x425a3a,null))[_0x8a88('0x42')](handleError(_0x425a3a,null));};exports[_0x8a88('0x25')]=function(_0x3c2427,_0x391f2f){return db[_0x8a88('0x2a')][_0x8a88('0x47')]({'where':{'id':_0x3c2427[_0x8a88('0x44')]['id']}})[_0x8a88('0x24')](handleEntityNotFound(_0x391f2f,null))[_0x8a88('0x24')](removeEntity(_0x391f2f,null))[_0x8a88('0x42')](handleError(_0x391f2f,null));};exports[_0x8a88('0x4b')]=function(_0x197a30,_0x1109a1){return db[_0x8a88('0x2a')]['destroy']({'where':{'id':_0x197a30['query'][_0x8a88('0x4c')]||[]},'raw':![],'individualHooks':!![]})[_0x8a88('0x24')](respondWithResult(_0x1109a1,0xcc))[_0x8a88('0x42')](handleError(_0x1109a1,null));};exports['addFields']=function(_0x4a1e22,_0x13a2c8,_0x2a34c6){return db['AnalyticCustomReport']['findOne']({'where':{'id':_0x4a1e22[_0x8a88('0x44')]['id']}})[_0x8a88('0x24')](handleEntityNotFound(_0x13a2c8,null))[_0x8a88('0x24')](function(_0x4603ff){if(_0x4603ff){return db[_0x8a88('0x4d')][_0x8a88('0x4e')](function(_0x433193){return db[_0x8a88('0x2a')][_0x8a88('0x25')]({'where':{'CustomReportId':_0x4a1e22['params']['id']},'transaction':_0x433193})[_0x8a88('0x24')](function(_0x7ef518){var _0x14be9e=_[_0x8a88('0x29')](_0x4a1e22['body'],function(_0x44dcde){delete _0x44dcde['id'];_0x44dcde['CustomReportId']=_0x4a1e22['params']['id'];return _0x44dcde;});return db[_0x8a88('0x2a')]['bulkCreate'](_0x14be9e,{'transaction':_0x433193});});})[_0x8a88('0x24')](function(){return db['AnalyticFieldReport'][_0x8a88('0x40')]({'where':{'CustomReportId':_0x4a1e22['params']['id']}});});}})[_0x8a88('0x24')](respondWithResult(_0x13a2c8,null))[_0x8a88('0x42')](handleError(_0x13a2c8,null));};
\ No newline at end of file
+var _0xe8d6=['hasOwnProperty','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','rows','catch','show','params','length','find','create','bulkCreate','body','destroy','bulkDestroy','addFields','AnalyticCustomReport','sequelize','transaction','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','ioredis','../../config/license/hardware','../../config/logger','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','undefined','limit','count','offset','json','apply','reject','save','update','then','error','stack','name','send','index','AnalyticFieldReport','rawAttributes','fieldName','type','key','map','query','keys','filters','intersection','model','attributes','fields'];(function(_0x5cc118,_0x479136){var _0x87ff2b=function(_0x2e3aa7){while(--_0x2e3aa7){_0x5cc118['push'](_0x5cc118['shift']());}};_0x87ff2b(++_0x479136);}(_0xe8d6,0x107));var _0x6e8d=function(_0x48f511,_0x41ce70){_0x48f511=_0x48f511-0x0;var _0x15766a=_0xe8d6[_0x48f511];return _0x15766a;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x6e8d('0x0'));var zipdir=require(_0x6e8d('0x1'));var jsonpatch=require(_0x6e8d('0x2'));var rp=require('request-promise');var moment=require(_0x6e8d('0x3'));var BPromise=require(_0x6e8d('0x4'));var Mustache=require(_0x6e8d('0x5'));var util=require('util');var path=require(_0x6e8d('0x6'));var sox=require(_0x6e8d('0x7'));var csv=require(_0x6e8d('0x8'));var ejs=require(_0x6e8d('0x9'));var fs=require('fs');var fs_extra=require(_0x6e8d('0xa'));var _=require(_0x6e8d('0xb'));var squel=require(_0x6e8d('0xc'));var crypto=require(_0x6e8d('0xd'));var jsforce=require(_0x6e8d('0xe'));var deskjs=require(_0x6e8d('0xf'));var toCsv=require(_0x6e8d('0x8'));var querystring=require(_0x6e8d('0x10'));var Papa=require('papaparse');var Redis=require(_0x6e8d('0x11'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x6e8d('0x12'));var logger=require(_0x6e8d('0x13'))('api');var utils=require('../../config/utils');var config=require(_0x6e8d('0x14'));var licenseUtil=require(_0x6e8d('0x15'));var db=require(_0x6e8d('0x16'))['db'];function respondWithStatusCode(_0x5c3170,_0x19f571){_0x19f571=_0x19f571||0xcc;return function(_0x13b15f){if(_0x13b15f){return _0x5c3170[_0x6e8d('0x17')](_0x19f571);}return _0x5c3170[_0x6e8d('0x18')](_0x19f571)['end']();};}function respondWithResult(_0x2e2fbc,_0x4f6c79){_0x4f6c79=_0x4f6c79||0xc8;return function(_0x2a725f){if(_0x2a725f){return _0x2e2fbc['status'](_0x4f6c79)['json'](_0x2a725f);}};}function respondWithFilteredResult(_0x4bbeef,_0x3a3aa9){return function(_0x396a56){if(_0x396a56){var _0x4c763a=typeof _0x3a3aa9['offset']===_0x6e8d('0x19')&&typeof _0x3a3aa9[_0x6e8d('0x1a')]===_0x6e8d('0x19');var _0x2390a9=_0x396a56[_0x6e8d('0x1b')];var _0x342815=_0x4c763a?0x0:_0x3a3aa9[_0x6e8d('0x1c')];var _0x133831=_0x4c763a?_0x396a56[_0x6e8d('0x1b')]:_0x3a3aa9[_0x6e8d('0x1c')]+_0x3a3aa9[_0x6e8d('0x1a')];var _0x1fb90b;if(_0x133831>=_0x2390a9){_0x133831=_0x2390a9;_0x1fb90b=0xc8;}else{_0x1fb90b=0xce;}_0x4bbeef[_0x6e8d('0x18')](_0x1fb90b);return _0x4bbeef['set']('Content-Range',_0x342815+'-'+_0x133831+'/'+_0x2390a9)[_0x6e8d('0x1d')](_0x396a56);}return null;};}function patchUpdates(_0x494898){return function(_0xa6a6c3){try{jsonpatch[_0x6e8d('0x1e')](_0xa6a6c3,_0x494898,!![]);}catch(_0x32d65f){return BPromise[_0x6e8d('0x1f')](_0x32d65f);}return _0xa6a6c3[_0x6e8d('0x20')]();};}function saveUpdates(_0x443a83,_0x20836e){return function(_0x5a6476){if(_0x5a6476){return _0x5a6476[_0x6e8d('0x21')](_0x443a83)[_0x6e8d('0x22')](function(_0x46edbd){return _0x46edbd;});}return null;};}function removeEntity(_0x10c508,_0x1d68ce){return function(_0x3ea954){if(_0x3ea954){return _0x3ea954['destroy']()[_0x6e8d('0x22')](function(){_0x10c508['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x5b7872,_0x3b324){return function(_0x1ad602){if(!_0x1ad602){_0x5b7872['sendStatus'](0x194);}return _0x1ad602;};}function handleError(_0x49c468,_0x2b9094){_0x2b9094=_0x2b9094||0x1f4;return function(_0x43d443){logger[_0x6e8d('0x23')](_0x43d443[_0x6e8d('0x24')]);if(_0x43d443['name']){delete _0x43d443[_0x6e8d('0x25')];}_0x49c468[_0x6e8d('0x18')](_0x2b9094)[_0x6e8d('0x26')](_0x43d443);};}exports[_0x6e8d('0x27')]=function(_0x657e7d,_0x419f9a){var _0xd0a6b7={},_0x5383b3={},_0xfe2b17={'count':0x0,'rows':[]};var _0x3f4a50=_['map'](db[_0x6e8d('0x28')][_0x6e8d('0x29')],function(_0x4a6116){return{'name':_0x4a6116[_0x6e8d('0x2a')],'type':_0x4a6116[_0x6e8d('0x2b')][_0x6e8d('0x2c')]};});_0x5383b3['model']=_[_0x6e8d('0x2d')](_0x3f4a50,_0x6e8d('0x25'));_0x5383b3[_0x6e8d('0x2e')]=_[_0x6e8d('0x2f')](_0x657e7d[_0x6e8d('0x2e')]);_0x5383b3[_0x6e8d('0x30')]=_[_0x6e8d('0x31')](_0x5383b3[_0x6e8d('0x32')],_0x5383b3[_0x6e8d('0x2e')]);_0xd0a6b7[_0x6e8d('0x33')]=_[_0x6e8d('0x31')](_0x5383b3[_0x6e8d('0x32')],qs['fields'](_0x657e7d['query'][_0x6e8d('0x34')]));_0xd0a6b7[_0x6e8d('0x33')]=_0xd0a6b7['attributes']['length']?_0xd0a6b7[_0x6e8d('0x33')]:_0x5383b3['model'];if(!_0x657e7d[_0x6e8d('0x2e')][_0x6e8d('0x35')]('nolimit')){_0xd0a6b7['limit']=qs[_0x6e8d('0x1a')](_0x657e7d[_0x6e8d('0x2e')]['limit']);_0xd0a6b7[_0x6e8d('0x1c')]=qs[_0x6e8d('0x1c')](_0x657e7d['query']['offset']);}_0xd0a6b7[_0x6e8d('0x36')]=qs[_0x6e8d('0x37')](_0x657e7d[_0x6e8d('0x2e')][_0x6e8d('0x37')]);_0xd0a6b7[_0x6e8d('0x38')]=qs[_0x6e8d('0x30')](_[_0x6e8d('0x39')](_0x657e7d[_0x6e8d('0x2e')],_0x5383b3['filters']),_0x3f4a50);if(_0x657e7d[_0x6e8d('0x2e')][_0x6e8d('0x3a')]){_0xd0a6b7[_0x6e8d('0x38')]=_[_0x6e8d('0x3b')](_0xd0a6b7['where'],{'$or':_[_0x6e8d('0x2d')](_0x3f4a50,function(_0x2ad437){if(_0x2ad437['type']!==_0x6e8d('0x3c')){var _0x24fd41={};_0x24fd41[_0x2ad437[_0x6e8d('0x25')]]={'$like':'%'+_0x657e7d['query'][_0x6e8d('0x3a')]+'%'};return _0x24fd41;}})});}_0xd0a6b7=_[_0x6e8d('0x3b')]({},_0xd0a6b7,_0x657e7d[_0x6e8d('0x3d')]);var _0x4cce69={'where':_0xd0a6b7[_0x6e8d('0x38')]};return db[_0x6e8d('0x28')]['count'](_0x4cce69)[_0x6e8d('0x22')](function(_0xefa446){_0xfe2b17[_0x6e8d('0x1b')]=_0xefa446;if(_0x657e7d['query'][_0x6e8d('0x3e')]){_0xd0a6b7[_0x6e8d('0x3f')]=[{'all':!![]}];}return db['AnalyticFieldReport']['findAll'](_0xd0a6b7);})[_0x6e8d('0x22')](function(_0x1c97e7){_0xfe2b17[_0x6e8d('0x40')]=_0x1c97e7;return _0xfe2b17;})[_0x6e8d('0x22')](respondWithFilteredResult(_0x419f9a,_0xd0a6b7))[_0x6e8d('0x41')](handleError(_0x419f9a,null));};exports[_0x6e8d('0x42')]=function(_0x2f4775,_0x11649a){var _0xb73100={'raw':![],'where':{'id':_0x2f4775[_0x6e8d('0x43')]['id']}},_0x31f738={};_0x31f738[_0x6e8d('0x32')]=_['keys'](db[_0x6e8d('0x28')]['rawAttributes']);_0x31f738[_0x6e8d('0x2e')]=_[_0x6e8d('0x2f')](_0x2f4775[_0x6e8d('0x2e')]);_0x31f738[_0x6e8d('0x30')]=_['intersection'](_0x31f738['model'],_0x31f738[_0x6e8d('0x2e')]);_0xb73100[_0x6e8d('0x33')]=_['intersection'](_0x31f738['model'],qs['fields'](_0x2f4775[_0x6e8d('0x2e')]['fields']));_0xb73100[_0x6e8d('0x33')]=_0xb73100[_0x6e8d('0x33')][_0x6e8d('0x44')]?_0xb73100[_0x6e8d('0x33')]:_0x31f738[_0x6e8d('0x32')];if(_0x2f4775['query'][_0x6e8d('0x3e')]){_0xb73100[_0x6e8d('0x3f')]=[{'all':!![]}];}_0xb73100=_['merge']({},_0xb73100,_0x2f4775['options']);return db[_0x6e8d('0x28')][_0x6e8d('0x45')](_0xb73100)[_0x6e8d('0x22')](handleEntityNotFound(_0x11649a,null))[_0x6e8d('0x22')](respondWithResult(_0x11649a,null))['catch'](handleError(_0x11649a,null));};exports[_0x6e8d('0x46')]=function(_0x29599a,_0x400a9){return db[_0x6e8d('0x28')][_0x6e8d('0x46')](_0x29599a['body'],{})[_0x6e8d('0x22')](respondWithResult(_0x400a9,0xc9))[_0x6e8d('0x41')](handleError(_0x400a9,null));};exports[_0x6e8d('0x47')]=function(_0x4e50b0,_0x5ecfc0){return db[_0x6e8d('0x28')][_0x6e8d('0x47')](_0x4e50b0[_0x6e8d('0x48')],{'raw':![],'individualHooks':!![]})[_0x6e8d('0x22')](respondWithResult(_0x5ecfc0,0xc9))[_0x6e8d('0x41')](handleError(_0x5ecfc0,null));};exports[_0x6e8d('0x21')]=function(_0x382cce,_0x298694){if(_0x382cce[_0x6e8d('0x48')]['id']){delete _0x382cce[_0x6e8d('0x48')]['id'];}return db[_0x6e8d('0x28')][_0x6e8d('0x45')]({'where':{'id':_0x382cce['params']['id']}})[_0x6e8d('0x22')](handleEntityNotFound(_0x298694,null))['then'](saveUpdates(_0x382cce['body'],null))[_0x6e8d('0x22')](respondWithResult(_0x298694,null))[_0x6e8d('0x41')](handleError(_0x298694,null));};exports[_0x6e8d('0x49')]=function(_0x1bf12b,_0x154b0f){return db[_0x6e8d('0x28')][_0x6e8d('0x45')]({'where':{'id':_0x1bf12b['params']['id']}})[_0x6e8d('0x22')](handleEntityNotFound(_0x154b0f,null))[_0x6e8d('0x22')](removeEntity(_0x154b0f,null))[_0x6e8d('0x41')](handleError(_0x154b0f,null));};exports[_0x6e8d('0x4a')]=function(_0x270585,_0xc1f84e){return db['AnalyticFieldReport']['destroy']({'where':{'id':_0x270585[_0x6e8d('0x2e')]['ids']||[]},'raw':![],'individualHooks':!![]})[_0x6e8d('0x22')](respondWithResult(_0xc1f84e,0xcc))[_0x6e8d('0x41')](handleError(_0xc1f84e,null));};exports[_0x6e8d('0x4b')]=function(_0x2ca493,_0x486cec,_0x2265a9){return db[_0x6e8d('0x4c')]['findOne']({'where':{'id':_0x2ca493[_0x6e8d('0x43')]['id']}})[_0x6e8d('0x22')](handleEntityNotFound(_0x486cec,null))[_0x6e8d('0x22')](function(_0x343cf2){if(_0x343cf2){return db[_0x6e8d('0x4d')][_0x6e8d('0x4e')](function(_0x194bc4){return db[_0x6e8d('0x28')][_0x6e8d('0x49')]({'where':{'CustomReportId':_0x2ca493[_0x6e8d('0x43')]['id']},'transaction':_0x194bc4})[_0x6e8d('0x22')](function(_0x585457){var _0x98cca4=_[_0x6e8d('0x2d')](_0x2ca493['body'],function(_0x51650b){delete _0x51650b['id'];_0x51650b['CustomReportId']=_0x2ca493[_0x6e8d('0x43')]['id'];return _0x51650b;});return db[_0x6e8d('0x28')]['bulkCreate'](_0x98cca4,{'transaction':_0x194bc4});});})[_0x6e8d('0x22')](function(){return db[_0x6e8d('0x28')]['findAll']({'where':{'CustomReportId':_0x2ca493[_0x6e8d('0x43')]['id']}});});}})['then'](respondWithResult(_0x486cec,null))[_0x6e8d('0x41')](handleError(_0x486cec,null));};
\ No newline at end of file
diff --git a/server/api/analyticFieldReport/analyticFieldReport.model.js b/server/api/analyticFieldReport/analyticFieldReport.model.js
index 2bad302..191c81e 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 _0xefcd=['path','rimraf','../../config/environment','./analyticFieldReport.attributes','exports','AnalyticFieldReport','analytics_report_fields','util','../../config/logger','moment','bluebird','request-promise'];(function(_0x3306ce,_0xcda6ce){var _0x21af4a=function(_0x24b574){while(--_0x24b574){_0x3306ce['push'](_0x3306ce['shift']());}};_0x21af4a(++_0xcda6ce);}(_0xefcd,0x1f3));var _0xdefc=function(_0x4b369d,_0x265eb8){_0x4b369d=_0x4b369d-0x0;var _0x571a98=_0xefcd[_0x4b369d];return _0x571a98;};'use strict';var _=require('lodash');var util=require(_0xdefc('0x0'));var logger=require(_0xdefc('0x1'))('api');var moment=require(_0xdefc('0x2'));var BPromise=require(_0xdefc('0x3'));var rp=require(_0xdefc('0x4'));var fs=require('fs');var path=require(_0xdefc('0x5'));var rimraf=require(_0xdefc('0x6'));var config=require(_0xdefc('0x7'));var attributes=require(_0xdefc('0x8'));module[_0xdefc('0x9')]=function(_0x1484f5,_0x492af3){return _0x1484f5['define'](_0xdefc('0xa'),attributes,{'tableName':_0xdefc('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x340e=['rimraf','../../config/environment','./analyticFieldReport.attributes','exports','define','analytics_report_fields','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path'];(function(_0x3c8654,_0x3e23ac){var _0x50f0b8=function(_0xd90314){while(--_0xd90314){_0x3c8654['push'](_0x3c8654['shift']());}};_0x50f0b8(++_0x3e23ac);}(_0x340e,0x102));var _0xe340=function(_0x150f60,_0x59ace3){_0x150f60=_0x150f60-0x0;var _0x241c02=_0x340e[_0x150f60];return _0x241c02;};'use strict';var _=require(_0xe340('0x0'));var util=require(_0xe340('0x1'));var logger=require(_0xe340('0x2'))(_0xe340('0x3'));var moment=require(_0xe340('0x4'));var BPromise=require(_0xe340('0x5'));var rp=require(_0xe340('0x6'));var fs=require('fs');var path=require(_0xe340('0x7'));var rimraf=require(_0xe340('0x8'));var config=require(_0xe340('0x9'));var attributes=require(_0xe340('0xa'));module[_0xe340('0xb')]=function(_0x1b0efa,_0x22abda){return _0x1b0efa[_0xe340('0xc')]('AnalyticFieldReport',attributes,{'tableName':_0xe340('0xd'),'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 849c6a4..4c9dbea 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 _0xf8e4=['request','info','AnalyticFieldReport,\x20%s,\x20%s','request\x20sent','debug','AnalyticFieldReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','lodash','util','moment','randomstring','ioredis','../../mysqldb','rpc','../../config/environment','jayson/promise','client'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xf8e4,0xf2));var _0x4f8e=function(_0x4179e2,_0xf2dbb){_0x4179e2=_0x4179e2-0x0;var _0x24cb50=_0xf8e4[_0x4179e2];return _0x24cb50;};'use strict';var _=require(_0x4f8e('0x0'));var util=require(_0x4f8e('0x1'));var moment=require(_0x4f8e('0x2'));var BPromise=require('bluebird');var rs=require(_0x4f8e('0x3'));var fs=require('fs');var Redis=require(_0x4f8e('0x4'));var db=require(_0x4f8e('0x5'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x4f8e('0x6'));var config=require(_0x4f8e('0x7'));var jayson=require(_0x4f8e('0x8'));var client=jayson[_0x4f8e('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x56e274,_0x41f881,_0x3b7803){return new BPromise(function(_0x4dc0ae,_0x20afaf){return client[_0x4f8e('0xa')](_0x56e274,_0x3b7803)['then'](function(_0x3c6cc5){logger[_0x4f8e('0xb')](_0x4f8e('0xc'),_0x41f881,_0x4f8e('0xd'));logger[_0x4f8e('0xe')](_0x4f8e('0xf'),_0x41f881,_0x4f8e('0xd'),JSON[_0x4f8e('0x10')](_0x3c6cc5));if(_0x3c6cc5['error']){if(_0x3c6cc5[_0x4f8e('0x11')][_0x4f8e('0x12')]===0x1f4){logger['error'](_0x4f8e('0xc'),_0x41f881,_0x3c6cc5[_0x4f8e('0x11')][_0x4f8e('0x13')]);return _0x20afaf(_0x3c6cc5[_0x4f8e('0x11')][_0x4f8e('0x13')]);}logger[_0x4f8e('0x11')]('AnalyticFieldReport,\x20%s,\x20%s',_0x41f881,_0x3c6cc5['error']['message']);return _0x4dc0ae(_0x3c6cc5[_0x4f8e('0x11')][_0x4f8e('0x13')]);}else{logger['info'](_0x4f8e('0xc'),_0x41f881,_0x4f8e('0xd'));_0x4dc0ae(_0x3c6cc5[_0x4f8e('0x14')][_0x4f8e('0x13')]);}})['catch'](function(_0x1c00f7){logger[_0x4f8e('0x11')]('AnalyticFieldReport,\x20%s,\x20%s',_0x41f881,_0x1c00f7);_0x20afaf(_0x1c00f7);});});}
\ No newline at end of file
+var _0x4eb8=['../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','AnalyticFieldReport,\x20%s,\x20%s','debug','AnalyticFieldReport,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','lodash','util','moment','bluebird','ioredis'];(function(_0x2ec26a,_0x70bd9d){var _0x204b56=function(_0x58e3ef){while(--_0x58e3ef){_0x2ec26a['push'](_0x2ec26a['shift']());}};_0x204b56(++_0x70bd9d);}(_0x4eb8,0x1b5));var _0x84eb=function(_0x3eb713,_0x437874){_0x3eb713=_0x3eb713-0x0;var _0x1d7128=_0x4eb8[_0x3eb713];return _0x1d7128;};'use strict';var _=require(_0x84eb('0x0'));var util=require(_0x84eb('0x1'));var moment=require(_0x84eb('0x2'));var BPromise=require(_0x84eb('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x84eb('0x4'));var db=require(_0x84eb('0x5'))['db'];var utils=require(_0x84eb('0x6'));var logger=require(_0x84eb('0x7'))(_0x84eb('0x8'));var config=require(_0x84eb('0x9'));var jayson=require(_0x84eb('0xa'));var client=jayson[_0x84eb('0xb')][_0x84eb('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x594e38,_0x131076,_0x37d9e6){return new BPromise(function(_0x12b996,_0xb3d36c){return client[_0x84eb('0xd')](_0x594e38,_0x37d9e6)[_0x84eb('0xe')](function(_0xf85549){logger[_0x84eb('0xf')](_0x84eb('0x10'),_0x131076,'request\x20sent');logger[_0x84eb('0x11')](_0x84eb('0x12'),_0x131076,_0x84eb('0x13'),JSON[_0x84eb('0x14')](_0xf85549));if(_0xf85549['error']){if(_0xf85549[_0x84eb('0x15')][_0x84eb('0x16')]===0x1f4){logger[_0x84eb('0x15')](_0x84eb('0x10'),_0x131076,_0xf85549[_0x84eb('0x15')]['message']);return _0xb3d36c(_0xf85549[_0x84eb('0x15')][_0x84eb('0x17')]);}logger[_0x84eb('0x15')](_0x84eb('0x10'),_0x131076,_0xf85549[_0x84eb('0x15')][_0x84eb('0x17')]);return _0x12b996(_0xf85549[_0x84eb('0x15')][_0x84eb('0x17')]);}else{logger[_0x84eb('0xf')](_0x84eb('0x10'),_0x131076,_0x84eb('0x13'));_0x12b996(_0xf85549[_0x84eb('0x18')]['message']);}})[_0x84eb('0x19')](function(_0x1dcafc){logger[_0x84eb('0x15')](_0x84eb('0x10'),_0x131076,_0x1dcafc);_0xb3d36c(_0x1dcafc);});});}
\ No newline at end of file
diff --git a/server/api/analyticFieldReport/index.js b/server/api/analyticFieldReport/index.js
index 569ab58..a62107c 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(_0x46eed5,_0x607464){var _0x914677=function(_0x811732){while(--_0x811732){_0x46eed5['push'](_0x46eed5['shift']());}};_0x914677(++_0x607464);}(_0xa9e0,0x123));var _0x0a9e=function(_0x5e3b04,_0xbb6795){_0x5e3b04=_0x5e3b04-0x0;var _0x1fc44d=_0xa9e0[_0x5e3b04];return _0x1fc44d;};'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(_0x4eb2b8,_0x1e93f2){var _0x5da0ff=function(_0x433a22){while(--_0x433a22){_0x4eb2b8['push'](_0x4eb2b8['shift']());}};_0x5da0ff(++_0x1e93f2);}(_0xa9e0,0x123));var _0x0a9e=function(_0xbe200f,_0x4b50eb){_0xbe200f=_0xbe200f-0x0;var _0x192597=_0xa9e0[_0xbe200f];return _0x192597;};'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 fdbfba4..0af6127 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 _0x153f=['name','TEXT','sequelize','exports','STRING'];(function(_0x15a190,_0x388b0e){var _0x4d0e8f=function(_0x463477){while(--_0x463477){_0x15a190['push'](_0x15a190['shift']());}};_0x4d0e8f(++_0x388b0e);}(_0x153f,0x15b));var _0xf153=function(_0x4fc3e7,_0x2f9b1e){_0x4fc3e7=_0x4fc3e7-0x0;var _0x1c6a9d=_0x153f[_0x4fc3e7];return _0x1c6a9d;};'use strict';var Sequelize=require(_0xf153('0x0'));module[_0xf153('0x1')]={'name':{'type':Sequelize[_0xf153('0x2')],'allowNull':![],'unique':_0xf153('0x3')},'table':{'type':Sequelize[_0xf153('0x2')]},'metric':{'type':Sequelize[_0xf153('0x4')]},'description':{'type':Sequelize[_0xf153('0x2')]}};
\ No newline at end of file
+var _0x205d=['STRING','TEXT','sequelize','exports'];(function(_0x2fe611,_0x259389){var _0x1d26fd=function(_0x48fa34){while(--_0x48fa34){_0x2fe611['push'](_0x2fe611['shift']());}};_0x1d26fd(++_0x259389);}(_0x205d,0xf6));var _0xd205=function(_0x206adf,_0x2ba1a3){_0x206adf=_0x206adf-0x0;var _0x171caa=_0x205d[_0x206adf];return _0x171caa;};'use strict';var Sequelize=require(_0xd205('0x0'));module[_0xd205('0x1')]={'name':{'type':Sequelize[_0xd205('0x2')],'allowNull':![],'unique':'name'},'table':{'type':Sequelize['STRING']},'metric':{'type':Sequelize[_0xd205('0x3')]},'description':{'type':Sequelize[_0xd205('0x2')]}};
\ No newline at end of file
diff --git a/server/api/analyticMetric/analyticMetric.controller.js b/server/api/analyticMetric/analyticMetric.controller.js
index 509d825..235bfab 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 _0xe5b3=['undefined','limit','count','offset','set','Content-Range','apply','reject','save','update','then','Metrics','UserProfileResource','destroy','error','stack','name','send','index','map','AnalyticMetric','rawAttributes','type','keys','query','filters','intersection','model','attributes','fields','length','nolimit','sort','where','pick','VIRTUAL','filter','merge','options','includeAll','include','findAll','params','find','catch','create','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','fs-extra','lodash','crypto','jsforce','desk.js','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','status','json'];(function(_0x3d06,_0xafae0d){var _0xa8a51=function(_0x54c83b){while(--_0x54c83b){_0x3d06['push'](_0x3d06['shift']());}};_0xa8a51(++_0xafae0d);}(_0xe5b3,0x133));var _0x3e5b=function(_0x52f4d2,_0x2b0805){_0x52f4d2=_0x52f4d2-0x0;var _0x57cce5=_0xe5b3[_0x52f4d2];return _0x57cce5;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x3e5b('0x0'));var zipdir=require(_0x3e5b('0x1'));var jsonpatch=require(_0x3e5b('0x2'));var rp=require(_0x3e5b('0x3'));var moment=require(_0x3e5b('0x4'));var BPromise=require(_0x3e5b('0x5'));var Mustache=require(_0x3e5b('0x6'));var util=require(_0x3e5b('0x7'));var path=require(_0x3e5b('0x8'));var sox=require(_0x3e5b('0x9'));var csv=require(_0x3e5b('0xa'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x3e5b('0xb'));var _=require(_0x3e5b('0xc'));var squel=require('squel');var crypto=require(_0x3e5b('0xd'));var jsforce=require(_0x3e5b('0xe'));var deskjs=require(_0x3e5b('0xf'));var toCsv=require(_0x3e5b('0xa'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x3e5b('0x10'));var authService=require(_0x3e5b('0x11'));var qs=require(_0x3e5b('0x12'));var as=require(_0x3e5b('0x13'));var hardwareService=require(_0x3e5b('0x14'));var logger=require('../../config/logger')(_0x3e5b('0x15'));var utils=require('../../config/utils');var config=require(_0x3e5b('0x16'));var licenseUtil=require(_0x3e5b('0x17'));var db=require(_0x3e5b('0x18'))['db'];function respondWithStatusCode(_0x374068,_0x20b97b){_0x20b97b=_0x20b97b||0xcc;return function(_0x3c4eb1){if(_0x3c4eb1){return _0x374068[_0x3e5b('0x19')](_0x20b97b);}return _0x374068['status'](_0x20b97b)[_0x3e5b('0x1a')]();};}function respondWithResult(_0x5f2f9c,_0x51a188){_0x51a188=_0x51a188||0xc8;return function(_0x4d71a3){if(_0x4d71a3){return _0x5f2f9c[_0x3e5b('0x1b')](_0x51a188)[_0x3e5b('0x1c')](_0x4d71a3);}};}function respondWithFilteredResult(_0x17aaa3,_0x4fb471){return function(_0x1f81a7){if(_0x1f81a7){var _0x59ddc0=typeof _0x4fb471['offset']===_0x3e5b('0x1d')&&typeof _0x4fb471[_0x3e5b('0x1e')]==='undefined';var _0x3d58a4=_0x1f81a7[_0x3e5b('0x1f')];var _0x555002=_0x59ddc0?0x0:_0x4fb471[_0x3e5b('0x20')];var _0x3365dd=_0x59ddc0?_0x1f81a7['count']:_0x4fb471['offset']+_0x4fb471[_0x3e5b('0x1e')];var _0x20806a;if(_0x3365dd>=_0x3d58a4){_0x3365dd=_0x3d58a4;_0x20806a=0xc8;}else{_0x20806a=0xce;}_0x17aaa3[_0x3e5b('0x1b')](_0x20806a);return _0x17aaa3[_0x3e5b('0x21')](_0x3e5b('0x22'),_0x555002+'-'+_0x3365dd+'/'+_0x3d58a4)[_0x3e5b('0x1c')](_0x1f81a7);}return null;};}function patchUpdates(_0x447d36){return function(_0x21fc32){try{jsonpatch[_0x3e5b('0x23')](_0x21fc32,_0x447d36,!![]);}catch(_0x3d95f3){return BPromise[_0x3e5b('0x24')](_0x3d95f3);}return _0x21fc32[_0x3e5b('0x25')]();};}function saveUpdates(_0x2d77cc,_0x402873){return function(_0x5b46d4){if(_0x5b46d4){return _0x5b46d4[_0x3e5b('0x26')](_0x2d77cc)[_0x3e5b('0x27')](function(_0x2146d4){return _0x2146d4;});}return null;};}function removeEntity(_0x150674,_0x50039b){return function(_0x1eb80f){if(_0x1eb80f){return _0x1eb80f['destroy']()[_0x3e5b('0x27')](function(){var _0x36d960=_0x1eb80f['get']({'plain':!![]});var _0x41b684=_0x3e5b('0x28');return db[_0x3e5b('0x29')][_0x3e5b('0x2a')]({'where':{'type':_0x41b684,'resourceId':_0x36d960['id']}})[_0x3e5b('0x27')](function(){return _0x1eb80f;});})[_0x3e5b('0x27')](function(){_0x150674[_0x3e5b('0x1b')](0xcc)[_0x3e5b('0x1a')]();});}};}function handleEntityNotFound(_0x4c4b89,_0x1c7278){return function(_0x505f40){if(!_0x505f40){_0x4c4b89[_0x3e5b('0x19')](0x194);}return _0x505f40;};}function handleError(_0x4fd64b,_0x101653){_0x101653=_0x101653||0x1f4;return function(_0x1f6473){logger[_0x3e5b('0x2b')](_0x1f6473[_0x3e5b('0x2c')]);if(_0x1f6473[_0x3e5b('0x2d')]){delete _0x1f6473[_0x3e5b('0x2d')];}_0x4fd64b[_0x3e5b('0x1b')](_0x101653)[_0x3e5b('0x2e')](_0x1f6473);};}exports[_0x3e5b('0x2f')]=function(_0x112dc0,_0x1e1565){var _0x489221={},_0x21bc10={},_0x1882aa={'count':0x0,'rows':[]};var _0xa8760b=_[_0x3e5b('0x30')](db[_0x3e5b('0x31')][_0x3e5b('0x32')],function(_0x345927){return{'name':_0x345927['fieldName'],'type':_0x345927[_0x3e5b('0x33')]['key']};});_0x21bc10['model']=_[_0x3e5b('0x30')](_0xa8760b,_0x3e5b('0x2d'));_0x21bc10['query']=_[_0x3e5b('0x34')](_0x112dc0[_0x3e5b('0x35')]);_0x21bc10[_0x3e5b('0x36')]=_[_0x3e5b('0x37')](_0x21bc10[_0x3e5b('0x38')],_0x21bc10[_0x3e5b('0x35')]);_0x489221[_0x3e5b('0x39')]=_[_0x3e5b('0x37')](_0x21bc10[_0x3e5b('0x38')],qs[_0x3e5b('0x3a')](_0x112dc0[_0x3e5b('0x35')][_0x3e5b('0x3a')]));_0x489221['attributes']=_0x489221[_0x3e5b('0x39')][_0x3e5b('0x3b')]?_0x489221['attributes']:_0x21bc10['model'];if(!_0x112dc0[_0x3e5b('0x35')]['hasOwnProperty'](_0x3e5b('0x3c'))){_0x489221[_0x3e5b('0x1e')]=qs[_0x3e5b('0x1e')](_0x112dc0[_0x3e5b('0x35')]['limit']);_0x489221[_0x3e5b('0x20')]=qs['offset'](_0x112dc0[_0x3e5b('0x35')]['offset']);}_0x489221['order']=qs['sort'](_0x112dc0[_0x3e5b('0x35')][_0x3e5b('0x3d')]);_0x489221[_0x3e5b('0x3e')]=qs[_0x3e5b('0x36')](_[_0x3e5b('0x3f')](_0x112dc0[_0x3e5b('0x35')],_0x21bc10['filters']),_0xa8760b);if(_0x112dc0['query']['filter']){_0x489221['where']=_['merge'](_0x489221['where'],{'$or':_['map'](_0xa8760b,function(_0x182bc4){if(_0x182bc4[_0x3e5b('0x33')]!==_0x3e5b('0x40')){var _0x1aafd5={};_0x1aafd5[_0x182bc4[_0x3e5b('0x2d')]]={'$like':'%'+_0x112dc0[_0x3e5b('0x35')][_0x3e5b('0x41')]+'%'};return _0x1aafd5;}})});}_0x489221=_[_0x3e5b('0x42')]({},_0x489221,_0x112dc0[_0x3e5b('0x43')]);var _0xbbc6b={'where':_0x489221[_0x3e5b('0x3e')]};return db['AnalyticMetric'][_0x3e5b('0x1f')](_0xbbc6b)[_0x3e5b('0x27')](function(_0x1e8075){_0x1882aa[_0x3e5b('0x1f')]=_0x1e8075;if(_0x112dc0[_0x3e5b('0x35')][_0x3e5b('0x44')]){_0x489221[_0x3e5b('0x45')]=[{'all':!![]}];}return db[_0x3e5b('0x31')][_0x3e5b('0x46')](_0x489221);})[_0x3e5b('0x27')](function(_0x13c8d5){_0x1882aa['rows']=_0x13c8d5;return _0x1882aa;})['then'](respondWithFilteredResult(_0x1e1565,_0x489221))['catch'](handleError(_0x1e1565,null));};exports['show']=function(_0xa99d75,_0x21ee8a){var _0x9fc025={'raw':!![],'where':{'id':_0xa99d75[_0x3e5b('0x47')]['id']}},_0x24c416={};_0x24c416[_0x3e5b('0x38')]=_[_0x3e5b('0x34')](db[_0x3e5b('0x31')][_0x3e5b('0x32')]);_0x24c416[_0x3e5b('0x35')]=_['keys'](_0xa99d75[_0x3e5b('0x35')]);_0x24c416[_0x3e5b('0x36')]=_[_0x3e5b('0x37')](_0x24c416[_0x3e5b('0x38')],_0x24c416[_0x3e5b('0x35')]);_0x9fc025['attributes']=_['intersection'](_0x24c416['model'],qs[_0x3e5b('0x3a')](_0xa99d75[_0x3e5b('0x35')][_0x3e5b('0x3a')]));_0x9fc025['attributes']=_0x9fc025['attributes'][_0x3e5b('0x3b')]?_0x9fc025[_0x3e5b('0x39')]:_0x24c416[_0x3e5b('0x38')];if(_0xa99d75['query']['includeAll']){_0x9fc025[_0x3e5b('0x45')]=[{'all':!![]}];}_0x9fc025=_['merge']({},_0x9fc025,_0xa99d75[_0x3e5b('0x43')]);return db[_0x3e5b('0x31')][_0x3e5b('0x48')](_0x9fc025)[_0x3e5b('0x27')](handleEntityNotFound(_0x21ee8a,null))[_0x3e5b('0x27')](respondWithResult(_0x21ee8a,null))[_0x3e5b('0x49')](handleError(_0x21ee8a,null));};exports[_0x3e5b('0x4a')]=function(_0x3ea5aa,_0x339852){return db['AnalyticMetric'][_0x3e5b('0x4a')](_0x3ea5aa['body'],{})[_0x3e5b('0x27')](function(_0x2e7047){var _0x26e11e=_0x3ea5aa[_0x3e5b('0x4b')][_0x3e5b('0x4c')]({'plain':!![]});if(!_0x26e11e)throw new Error(_0x3e5b('0x4d'));if(_0x26e11e[_0x3e5b('0x4e')]===_0x3e5b('0x4b')){var _0x2b5d3d=_0x2e7047[_0x3e5b('0x4c')]({'plain':!![]});var _0xf6ca5b=_0x3e5b('0x28');return db[_0x3e5b('0x4f')]['find']({'where':{'name':_0xf6ca5b,'userProfileId':_0x26e11e[_0x3e5b('0x50')]},'raw':!![]})[_0x3e5b('0x27')](function(_0x2ca33b){if(_0x2ca33b&&_0x2ca33b[_0x3e5b('0x51')]===0x0){return db[_0x3e5b('0x29')][_0x3e5b('0x4a')]({'name':_0x2b5d3d['name'],'resourceId':_0x2b5d3d['id'],'type':_0x2ca33b[_0x3e5b('0x2d')],'sectionId':_0x2ca33b['id']},{})[_0x3e5b('0x27')](function(){return _0x2e7047;});}else{return _0x2e7047;}})[_0x3e5b('0x49')](function(_0x314d42){logger[_0x3e5b('0x2b')](_0x3e5b('0x52'),_0x314d42);throw _0x314d42;});}return _0x2e7047;})[_0x3e5b('0x27')](respondWithResult(_0x339852,0xc9))[_0x3e5b('0x49')](handleError(_0x339852,null));};exports['update']=function(_0x1e6403,_0x5e702f){if(_0x1e6403['body']['id']){delete _0x1e6403[_0x3e5b('0x53')]['id'];}return db['AnalyticMetric'][_0x3e5b('0x48')]({'where':{'id':_0x1e6403[_0x3e5b('0x47')]['id']}})[_0x3e5b('0x27')](handleEntityNotFound(_0x5e702f,null))[_0x3e5b('0x27')](saveUpdates(_0x1e6403['body'],null))['then'](respondWithResult(_0x5e702f,null))['catch'](handleError(_0x5e702f,null));};exports['destroy']=function(_0x2ab5f3,_0x999518){return db[_0x3e5b('0x31')][_0x3e5b('0x48')]({'where':{'id':_0x2ab5f3[_0x3e5b('0x47')]['id']}})['then'](handleEntityNotFound(_0x999518,null))['then'](removeEntity(_0x999518,null))[_0x3e5b('0x49')](handleError(_0x999518,null));};
\ No newline at end of file
+var _0x5fc3=['user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','find','userProfileId','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','to-csv','lodash','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/environment','../../config/license/util','sendStatus','status','end','offset','undefined','limit','count','Content-Range','json','apply','reject','save','update','then','destroy','get','Metrics','error','stack','name','send','index','map','AnalyticMetric','rawAttributes','fieldName','type','key','model','keys','filters','intersection','query','attributes','fields','length','hasOwnProperty','sort','pick','filter','where','VIRTUAL','options','includeAll','include','findAll','catch','show','params','merge','create','body'];(function(_0x338122,_0x17322e){var _0x4e3846=function(_0x2c70b9){while(--_0x2c70b9){_0x338122['push'](_0x338122['shift']());}};_0x4e3846(++_0x17322e);}(_0x5fc3,0xa8));var _0x35fc=function(_0x1db831,_0x42b7b5){_0x1db831=_0x1db831-0x0;var _0x39ba56=_0x5fc3[_0x1db831];return _0x39ba56;};'use strict';var emlformat=require(_0x35fc('0x0'));var rimraf=require(_0x35fc('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x35fc('0x2'));var rp=require(_0x35fc('0x3'));var moment=require(_0x35fc('0x4'));var BPromise=require(_0x35fc('0x5'));var Mustache=require(_0x35fc('0x6'));var util=require('util');var path=require(_0x35fc('0x7'));var sox=require(_0x35fc('0x8'));var csv=require(_0x35fc('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x35fc('0xa'));var squel=require('squel');var crypto=require(_0x35fc('0xb'));var jsforce=require(_0x35fc('0xc'));var deskjs=require(_0x35fc('0xd'));var toCsv=require(_0x35fc('0x9'));var querystring=require(_0x35fc('0xe'));var Papa=require(_0x35fc('0xf'));var Redis=require(_0x35fc('0x10'));var authService=require('../../components/auth/service');var qs=require(_0x35fc('0x11'));var as=require(_0x35fc('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x35fc('0x13'))(_0x35fc('0x14'));var utils=require('../../config/utils');var config=require(_0x35fc('0x15'));var licenseUtil=require(_0x35fc('0x16'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x4cbe74,_0x409357){_0x409357=_0x409357||0xcc;return function(_0x5d462a){if(_0x5d462a){return _0x4cbe74[_0x35fc('0x17')](_0x409357);}return _0x4cbe74[_0x35fc('0x18')](_0x409357)[_0x35fc('0x19')]();};}function respondWithResult(_0x29730f,_0x38d9f2){_0x38d9f2=_0x38d9f2||0xc8;return function(_0x5cfe94){if(_0x5cfe94){return _0x29730f['status'](_0x38d9f2)['json'](_0x5cfe94);}};}function respondWithFilteredResult(_0x558364,_0x398b67){return function(_0x229d56){if(_0x229d56){var _0x53b898=typeof _0x398b67[_0x35fc('0x1a')]===_0x35fc('0x1b')&&typeof _0x398b67[_0x35fc('0x1c')]==='undefined';var _0x26ba54=_0x229d56[_0x35fc('0x1d')];var _0x553677=_0x53b898?0x0:_0x398b67[_0x35fc('0x1a')];var _0x363e47=_0x53b898?_0x229d56[_0x35fc('0x1d')]:_0x398b67['offset']+_0x398b67[_0x35fc('0x1c')];var _0x3c58ea;if(_0x363e47>=_0x26ba54){_0x363e47=_0x26ba54;_0x3c58ea=0xc8;}else{_0x3c58ea=0xce;}_0x558364[_0x35fc('0x18')](_0x3c58ea);return _0x558364['set'](_0x35fc('0x1e'),_0x553677+'-'+_0x363e47+'/'+_0x26ba54)[_0x35fc('0x1f')](_0x229d56);}return null;};}function patchUpdates(_0x3229d1){return function(_0x251a1f){try{jsonpatch[_0x35fc('0x20')](_0x251a1f,_0x3229d1,!![]);}catch(_0x21f1a9){return BPromise[_0x35fc('0x21')](_0x21f1a9);}return _0x251a1f[_0x35fc('0x22')]();};}function saveUpdates(_0x2405e8,_0x427eae){return function(_0x5bd2b8){if(_0x5bd2b8){return _0x5bd2b8[_0x35fc('0x23')](_0x2405e8)[_0x35fc('0x24')](function(_0x257719){return _0x257719;});}return null;};}function removeEntity(_0x2d8183,_0x3b4743){return function(_0x55e9e7){if(_0x55e9e7){return _0x55e9e7[_0x35fc('0x25')]()[_0x35fc('0x24')](function(){var _0x561bf8=_0x55e9e7[_0x35fc('0x26')]({'plain':!![]});var _0x5a93df=_0x35fc('0x27');return db['UserProfileResource'][_0x35fc('0x25')]({'where':{'type':_0x5a93df,'resourceId':_0x561bf8['id']}})['then'](function(){return _0x55e9e7;});})[_0x35fc('0x24')](function(){_0x2d8183[_0x35fc('0x18')](0xcc)['end']();});}};}function handleEntityNotFound(_0x519264,_0x47774c){return function(_0x58edb6){if(!_0x58edb6){_0x519264[_0x35fc('0x17')](0x194);}return _0x58edb6;};}function handleError(_0x1a5d92,_0x57001c){_0x57001c=_0x57001c||0x1f4;return function(_0x26b7cb){logger[_0x35fc('0x28')](_0x26b7cb[_0x35fc('0x29')]);if(_0x26b7cb[_0x35fc('0x2a')]){delete _0x26b7cb[_0x35fc('0x2a')];}_0x1a5d92[_0x35fc('0x18')](_0x57001c)[_0x35fc('0x2b')](_0x26b7cb);};}exports[_0x35fc('0x2c')]=function(_0x54aedc,_0x1cd1ae){var _0x220931={},_0x22af18={},_0x52acc5={'count':0x0,'rows':[]};var _0xe79f52=_[_0x35fc('0x2d')](db[_0x35fc('0x2e')][_0x35fc('0x2f')],function(_0xd8a4ca){return{'name':_0xd8a4ca[_0x35fc('0x30')],'type':_0xd8a4ca[_0x35fc('0x31')][_0x35fc('0x32')]};});_0x22af18[_0x35fc('0x33')]=_[_0x35fc('0x2d')](_0xe79f52,'name');_0x22af18['query']=_[_0x35fc('0x34')](_0x54aedc['query']);_0x22af18[_0x35fc('0x35')]=_[_0x35fc('0x36')](_0x22af18[_0x35fc('0x33')],_0x22af18[_0x35fc('0x37')]);_0x220931[_0x35fc('0x38')]=_[_0x35fc('0x36')](_0x22af18['model'],qs[_0x35fc('0x39')](_0x54aedc[_0x35fc('0x37')][_0x35fc('0x39')]));_0x220931[_0x35fc('0x38')]=_0x220931[_0x35fc('0x38')][_0x35fc('0x3a')]?_0x220931['attributes']:_0x22af18[_0x35fc('0x33')];if(!_0x54aedc[_0x35fc('0x37')][_0x35fc('0x3b')]('nolimit')){_0x220931[_0x35fc('0x1c')]=qs['limit'](_0x54aedc[_0x35fc('0x37')][_0x35fc('0x1c')]);_0x220931[_0x35fc('0x1a')]=qs[_0x35fc('0x1a')](_0x54aedc['query']['offset']);}_0x220931['order']=qs[_0x35fc('0x3c')](_0x54aedc['query'][_0x35fc('0x3c')]);_0x220931['where']=qs[_0x35fc('0x35')](_[_0x35fc('0x3d')](_0x54aedc[_0x35fc('0x37')],_0x22af18[_0x35fc('0x35')]),_0xe79f52);if(_0x54aedc[_0x35fc('0x37')][_0x35fc('0x3e')]){_0x220931[_0x35fc('0x3f')]=_['merge'](_0x220931[_0x35fc('0x3f')],{'$or':_[_0x35fc('0x2d')](_0xe79f52,function(_0x4e0ce3){if(_0x4e0ce3[_0x35fc('0x31')]!==_0x35fc('0x40')){var _0x1aac67={};_0x1aac67[_0x4e0ce3[_0x35fc('0x2a')]]={'$like':'%'+_0x54aedc[_0x35fc('0x37')][_0x35fc('0x3e')]+'%'};return _0x1aac67;}})});}_0x220931=_['merge']({},_0x220931,_0x54aedc[_0x35fc('0x41')]);var _0x267858={'where':_0x220931[_0x35fc('0x3f')]};return db['AnalyticMetric'][_0x35fc('0x1d')](_0x267858)[_0x35fc('0x24')](function(_0x596919){_0x52acc5[_0x35fc('0x1d')]=_0x596919;if(_0x54aedc[_0x35fc('0x37')][_0x35fc('0x42')]){_0x220931[_0x35fc('0x43')]=[{'all':!![]}];}return db[_0x35fc('0x2e')][_0x35fc('0x44')](_0x220931);})[_0x35fc('0x24')](function(_0x3ec51f){_0x52acc5['rows']=_0x3ec51f;return _0x52acc5;})['then'](respondWithFilteredResult(_0x1cd1ae,_0x220931))[_0x35fc('0x45')](handleError(_0x1cd1ae,null));};exports[_0x35fc('0x46')]=function(_0x4fdc6d,_0x5c2e5c){var _0x4ff202={'raw':!![],'where':{'id':_0x4fdc6d[_0x35fc('0x47')]['id']}},_0x79677d={};_0x79677d['model']=_[_0x35fc('0x34')](db[_0x35fc('0x2e')][_0x35fc('0x2f')]);_0x79677d[_0x35fc('0x37')]=_['keys'](_0x4fdc6d['query']);_0x79677d['filters']=_['intersection'](_0x79677d['model'],_0x79677d[_0x35fc('0x37')]);_0x4ff202[_0x35fc('0x38')]=_['intersection'](_0x79677d[_0x35fc('0x33')],qs['fields'](_0x4fdc6d[_0x35fc('0x37')][_0x35fc('0x39')]));_0x4ff202[_0x35fc('0x38')]=_0x4ff202[_0x35fc('0x38')][_0x35fc('0x3a')]?_0x4ff202['attributes']:_0x79677d[_0x35fc('0x33')];if(_0x4fdc6d[_0x35fc('0x37')]['includeAll']){_0x4ff202[_0x35fc('0x43')]=[{'all':!![]}];}_0x4ff202=_[_0x35fc('0x48')]({},_0x4ff202,_0x4fdc6d[_0x35fc('0x41')]);return db[_0x35fc('0x2e')]['find'](_0x4ff202)[_0x35fc('0x24')](handleEntityNotFound(_0x5c2e5c,null))['then'](respondWithResult(_0x5c2e5c,null))['catch'](handleError(_0x5c2e5c,null));};exports[_0x35fc('0x49')]=function(_0x9db7e8,_0x18dc78){return db[_0x35fc('0x2e')][_0x35fc('0x49')](_0x9db7e8[_0x35fc('0x4a')],{})[_0x35fc('0x24')](function(_0x16afa6){var _0x4f555f=_0x9db7e8[_0x35fc('0x4b')][_0x35fc('0x26')]({'plain':!![]});if(!_0x4f555f)throw new Error(_0x35fc('0x4c'));if(_0x4f555f[_0x35fc('0x4d')]===_0x35fc('0x4b')){var _0x1e3221=_0x16afa6[_0x35fc('0x26')]({'plain':!![]});var _0x347a4a=_0x35fc('0x27');return db[_0x35fc('0x4e')][_0x35fc('0x4f')]({'where':{'name':_0x347a4a,'userProfileId':_0x4f555f[_0x35fc('0x50')]},'raw':!![]})[_0x35fc('0x24')](function(_0x3146e2){if(_0x3146e2&&_0x3146e2['autoAssociation']===0x0){return db['UserProfileResource'][_0x35fc('0x49')]({'name':_0x1e3221[_0x35fc('0x2a')],'resourceId':_0x1e3221['id'],'type':_0x3146e2[_0x35fc('0x2a')],'sectionId':_0x3146e2['id']},{})[_0x35fc('0x24')](function(){return _0x16afa6;});}else{return _0x16afa6;}})[_0x35fc('0x45')](function(_0x3e6494){logger['error']('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x3e6494);throw _0x3e6494;});}return _0x16afa6;})[_0x35fc('0x24')](respondWithResult(_0x18dc78,0xc9))[_0x35fc('0x45')](handleError(_0x18dc78,null));};exports[_0x35fc('0x23')]=function(_0x38bc78,_0x5b2595){if(_0x38bc78[_0x35fc('0x4a')]['id']){delete _0x38bc78[_0x35fc('0x4a')]['id'];}return db['AnalyticMetric'][_0x35fc('0x4f')]({'where':{'id':_0x38bc78[_0x35fc('0x47')]['id']}})['then'](handleEntityNotFound(_0x5b2595,null))[_0x35fc('0x24')](saveUpdates(_0x38bc78[_0x35fc('0x4a')],null))[_0x35fc('0x24')](respondWithResult(_0x5b2595,null))[_0x35fc('0x45')](handleError(_0x5b2595,null));};exports['destroy']=function(_0x4de34b,_0x502a15){return db[_0x35fc('0x2e')][_0x35fc('0x4f')]({'where':{'id':_0x4de34b['params']['id']}})[_0x35fc('0x24')](handleEntityNotFound(_0x502a15,null))[_0x35fc('0x24')](removeEntity(_0x502a15,null))[_0x35fc('0x45')](handleError(_0x502a15,null));};
\ No newline at end of file
diff --git a/server/api/analyticMetric/analyticMetric.model.js b/server/api/analyticMetric/analyticMetric.model.js
index b6c32c5..b7064a5 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 _0xf96b=['bluebird','request-promise','path','rimraf','../../config/environment','./analyticMetric.attributes','exports','define','AnalyticMetric','analytics_metrics','lodash','util','../../config/logger','api','moment'];(function(_0x26b622,_0x237e9e){var _0x58a028=function(_0xde1652){while(--_0xde1652){_0x26b622['push'](_0x26b622['shift']());}};_0x58a028(++_0x237e9e);}(_0xf96b,0x109));var _0xbf96=function(_0x5513dc,_0x2a03c0){_0x5513dc=_0x5513dc-0x0;var _0x3a4031=_0xf96b[_0x5513dc];return _0x3a4031;};'use strict';var _=require(_0xbf96('0x0'));var util=require(_0xbf96('0x1'));var logger=require(_0xbf96('0x2'))(_0xbf96('0x3'));var moment=require(_0xbf96('0x4'));var BPromise=require(_0xbf96('0x5'));var rp=require(_0xbf96('0x6'));var fs=require('fs');var path=require(_0xbf96('0x7'));var rimraf=require(_0xbf96('0x8'));var config=require(_0xbf96('0x9'));var attributes=require(_0xbf96('0xa'));module[_0xbf96('0xb')]=function(_0x162c19,_0x4de1c3){return _0x162c19[_0xbf96('0xc')](_0xbf96('0xd'),attributes,{'tableName':_0xbf96('0xe'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x7c1f=['moment','request-promise','path','rimraf','./analyticMetric.attributes','exports','AnalyticMetric','analytics_metrics','lodash','util','../../config/logger','api'];(function(_0xa60623,_0x2d4e4f){var _0x4a6487=function(_0xba6cbe){while(--_0xba6cbe){_0xa60623['push'](_0xa60623['shift']());}};_0x4a6487(++_0x2d4e4f);}(_0x7c1f,0x194));var _0xf7c1=function(_0x578b77,_0x433209){_0x578b77=_0x578b77-0x0;var _0x4e57e1=_0x7c1f[_0x578b77];return _0x4e57e1;};'use strict';var _=require(_0xf7c1('0x0'));var util=require(_0xf7c1('0x1'));var logger=require(_0xf7c1('0x2'))(_0xf7c1('0x3'));var moment=require(_0xf7c1('0x4'));var BPromise=require('bluebird');var rp=require(_0xf7c1('0x5'));var fs=require('fs');var path=require(_0xf7c1('0x6'));var rimraf=require(_0xf7c1('0x7'));var config=require('../../config/environment');var attributes=require(_0xf7c1('0x8'));module[_0xf7c1('0x9')]=function(_0x3c21cf,_0x136e1e){return _0x3c21cf['define'](_0xf7c1('0xa'),attributes,{'tableName':_0xf7c1('0xb'),'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 ba2324a..b6dde66 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 _0x18a2=['request','AnalyticMetric,\x20%s,\x20%s','request\x20sent','debug','AnalyticMetric,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http'];(function(_0x51fd51,_0x3dc0f9){var _0x39d240=function(_0x34ccc4){while(--_0x34ccc4){_0x51fd51['push'](_0x51fd51['shift']());}};_0x39d240(++_0x3dc0f9);}(_0x18a2,0x154));var _0x218a=function(_0x4f45c9,_0x39db3c){_0x4f45c9=_0x4f45c9-0x0;var _0xb33bb8=_0x18a2[_0x4f45c9];return _0xb33bb8;};'use strict';var _=require(_0x218a('0x0'));var util=require(_0x218a('0x1'));var moment=require(_0x218a('0x2'));var BPromise=require(_0x218a('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x218a('0x4'));var db=require(_0x218a('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x218a('0x6'))(_0x218a('0x7'));var config=require(_0x218a('0x8'));var jayson=require(_0x218a('0x9'));var client=jayson[_0x218a('0xa')][_0x218a('0xb')]({'port':0x232a});function respondWithRpcPromise(_0xc86d60,_0x5ae485,_0x4ba7ee){return new BPromise(function(_0x48a512,_0x397ab2){return client[_0x218a('0xc')](_0xc86d60,_0x4ba7ee)['then'](function(_0x18ed1c){logger['info'](_0x218a('0xd'),_0x5ae485,_0x218a('0xe'));logger[_0x218a('0xf')](_0x218a('0x10'),_0x5ae485,_0x218a('0xe'),JSON[_0x218a('0x11')](_0x18ed1c));if(_0x18ed1c[_0x218a('0x12')]){if(_0x18ed1c[_0x218a('0x12')][_0x218a('0x13')]===0x1f4){logger['error'](_0x218a('0xd'),_0x5ae485,_0x18ed1c[_0x218a('0x12')][_0x218a('0x14')]);return _0x397ab2(_0x18ed1c['error']['message']);}logger[_0x218a('0x12')]('AnalyticMetric,\x20%s,\x20%s',_0x5ae485,_0x18ed1c[_0x218a('0x12')]['message']);return _0x48a512(_0x18ed1c[_0x218a('0x12')][_0x218a('0x14')]);}else{logger['info'](_0x218a('0xd'),_0x5ae485,'request\x20sent');_0x48a512(_0x18ed1c['result'][_0x218a('0x14')]);}})[_0x218a('0x15')](function(_0x358cad){logger[_0x218a('0x12')]('AnalyticMetric,\x20%s,\x20%s',_0x5ae485,_0x358cad);_0x397ab2(_0x358cad);});});}
\ No newline at end of file
+var _0x4c14=['AnalyticMetric,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','then','info','AnalyticMetric,\x20%s,\x20%s','request\x20sent','debug'];(function(_0x59440b,_0x1453ec){var _0x1fd85e=function(_0x5ddca0){while(--_0x5ddca0){_0x59440b['push'](_0x59440b['shift']());}};_0x1fd85e(++_0x1453ec);}(_0x4c14,0x176));var _0x44c1=function(_0x3108b1,_0x4aa28a){_0x3108b1=_0x3108b1-0x0;var _0x4d6307=_0x4c14[_0x3108b1];return _0x4d6307;};'use strict';var _=require(_0x44c1('0x0'));var util=require('util');var moment=require(_0x44c1('0x1'));var BPromise=require(_0x44c1('0x2'));var rs=require(_0x44c1('0x3'));var fs=require('fs');var Redis=require(_0x44c1('0x4'));var db=require(_0x44c1('0x5'))['db'];var utils=require(_0x44c1('0x6'));var logger=require('../../config/logger')(_0x44c1('0x7'));var config=require(_0x44c1('0x8'));var jayson=require(_0x44c1('0x9'));var client=jayson[_0x44c1('0xa')][_0x44c1('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x44c138,_0x12517c,_0x38ac91){return new BPromise(function(_0x34004d,_0x299eba){return client['request'](_0x44c138,_0x38ac91)[_0x44c1('0xc')](function(_0x58ea58){logger[_0x44c1('0xd')](_0x44c1('0xe'),_0x12517c,_0x44c1('0xf'));logger[_0x44c1('0x10')](_0x44c1('0x11'),_0x12517c,_0x44c1('0xf'),JSON[_0x44c1('0x12')](_0x58ea58));if(_0x58ea58[_0x44c1('0x13')]){if(_0x58ea58[_0x44c1('0x13')]['code']===0x1f4){logger[_0x44c1('0x13')]('AnalyticMetric,\x20%s,\x20%s',_0x12517c,_0x58ea58[_0x44c1('0x13')]['message']);return _0x299eba(_0x58ea58[_0x44c1('0x13')][_0x44c1('0x14')]);}logger[_0x44c1('0x13')](_0x44c1('0xe'),_0x12517c,_0x58ea58['error']['message']);return _0x34004d(_0x58ea58['error'][_0x44c1('0x14')]);}else{logger[_0x44c1('0xd')](_0x44c1('0xe'),_0x12517c,'request\x20sent');_0x34004d(_0x58ea58[_0x44c1('0x15')][_0x44c1('0x14')]);}})[_0x44c1('0x16')](function(_0x4d93bb){logger['error']('AnalyticMetric,\x20%s,\x20%s',_0x12517c,_0x4d93bb);_0x299eba(_0x4d93bb);});});}
\ No newline at end of file
diff --git a/server/api/analyticMetric/index.js b/server/api/analyticMetric/index.js
index ba7e48d..c524841 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 _0x1a28=['put','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','../../components/interaction/service','../../config/environment','./analyticMetric.controller','isAuthenticated','index','/:id','show','post','create'];(function(_0x4360f7,_0x232cca){var _0xf7bd35=function(_0x3c6656){while(--_0x3c6656){_0x4360f7['push'](_0x4360f7['shift']());}};_0xf7bd35(++_0x232cca);}(_0x1a28,0x10e));var _0x81a2=function(_0x4d21ff,_0x19d202){_0x4d21ff=_0x4d21ff-0x0;var _0x22b554=_0x1a28[_0x4d21ff];return _0x22b554;};'use strict';var multer=require(_0x81a2('0x0'));var util=require(_0x81a2('0x1'));var path=require(_0x81a2('0x2'));var timeout=require(_0x81a2('0x3'));var express=require(_0x81a2('0x4'));var router=express[_0x81a2('0x5')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0x81a2('0x6'));var config=require(_0x81a2('0x7'));var controller=require(_0x81a2('0x8'));router['get']('/',auth[_0x81a2('0x9')](),controller[_0x81a2('0xa')]);router['get'](_0x81a2('0xb'),auth[_0x81a2('0x9')](),controller[_0x81a2('0xc')]);router[_0x81a2('0xd')]('/',auth[_0x81a2('0x9')](),controller[_0x81a2('0xe')]);router[_0x81a2('0xf')](_0x81a2('0xb'),auth[_0x81a2('0x9')](),controller['update']);router[_0x81a2('0x10')](_0x81a2('0xb'),auth[_0x81a2('0x9')](),controller[_0x81a2('0x11')]);module[_0x81a2('0x12')]=router;
\ No newline at end of file
+var _0x41d9=['../../components/interaction/service','../../config/environment','get','isAuthenticated','show','post','create','/:id','update','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra'];(function(_0x448b0d,_0x167d71){var _0x4b582c=function(_0x5771b6){while(--_0x5771b6){_0x448b0d['push'](_0x448b0d['shift']());}};_0x4b582c(++_0x167d71);}(_0x41d9,0x13c));var _0x941d=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x41d9[_0x3dd15e];return _0x231fd0;};'use strict';var multer=require(_0x941d('0x0'));var util=require(_0x941d('0x1'));var path=require(_0x941d('0x2'));var timeout=require(_0x941d('0x3'));var express=require(_0x941d('0x4'));var router=express[_0x941d('0x5')]();var fs_extra=require(_0x941d('0x6'));var auth=require('../../components/auth/service');var interaction=require(_0x941d('0x7'));var config=require(_0x941d('0x8'));var controller=require('./analyticMetric.controller');router[_0x941d('0x9')]('/',auth[_0x941d('0xa')](),controller['index']);router[_0x941d('0x9')]('/:id',auth[_0x941d('0xa')](),controller[_0x941d('0xb')]);router[_0x941d('0xc')]('/',auth[_0x941d('0xa')](),controller[_0x941d('0xd')]);router['put'](_0x941d('0xe'),auth[_0x941d('0xa')](),controller[_0x941d('0xf')]);router[_0x941d('0x10')]('/:id',auth[_0x941d('0xa')](),controller[_0x941d('0x11')]);module[_0x941d('0x12')]=router;
\ No newline at end of file
diff --git a/server/api/analyticTreeReport/analyticTreeReport.attributes.js b/server/api/analyticTreeReport/analyticTreeReport.attributes.js
index cc8d4d1..350dd5e 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 _0x7baf=['TEXT','sequelize'];(function(_0xa2cd28,_0x4a6fab){var _0x45d776=function(_0x3df3c7){while(--_0x3df3c7){_0xa2cd28['push'](_0xa2cd28['shift']());}};_0x45d776(++_0x4a6fab);}(_0x7baf,0x1cf));var _0xf7ba=function(_0x54b662,_0x1738b6){_0x54b662=_0x54b662-0x0;var _0x1b74da=_0x7baf[_0x54b662];return _0x1b74da;};'use strict';var Sequelize=require(_0xf7ba('0x0'));module['exports']={'tree':{'type':Sequelize[_0xf7ba('0x1')],'allowNull':![]}};
\ No newline at end of file
+var _0x35a4=['sequelize','exports','TEXT'];(function(_0x562219,_0x538e13){var _0x208fa5=function(_0x5cd2fb){while(--_0x5cd2fb){_0x562219['push'](_0x562219['shift']());}};_0x208fa5(++_0x538e13);}(_0x35a4,0xab));var _0x435a=function(_0x3718b7,_0x2da677){_0x3718b7=_0x3718b7-0x0;var _0xf8c91e=_0x35a4[_0x3718b7];return _0xf8c91e;};'use strict';var Sequelize=require(_0x435a('0x0'));module[_0x435a('0x1')]={'tree':{'type':Sequelize[_0x435a('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 b524de2..401a42c 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 _0x632e=['jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','offset','limit','count','set','Content-Range','json','apply','reject','update','then','destroy','error','stack','index','map','rawAttributes','model','name','keys','filters','intersection','query','attributes','fields','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','type','VIRTUAL','options','AnalyticTreeReport','includeAll','include','findAll','rows','catch','show','params','find','create','body','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','sox','to-csv','ejs','fs-extra','lodash','squel'];(function(_0x4c6d6f,_0x291557){var _0x2d4478=function(_0x106946){while(--_0x106946){_0x4c6d6f['push'](_0x4c6d6f['shift']());}};_0x2d4478(++_0x291557);}(_0x632e,0x1b5));var _0xe632=function(_0x2fa1c6,_0x4a5b8d){_0x2fa1c6=_0x2fa1c6-0x0;var _0x5f3257=_0x632e[_0x2fa1c6];return _0x5f3257;};'use strict';var emlformat=require(_0xe632('0x0'));var rimraf=require(_0xe632('0x1'));var zipdir=require(_0xe632('0x2'));var jsonpatch=require(_0xe632('0x3'));var rp=require('request-promise');var moment=require(_0xe632('0x4'));var BPromise=require(_0xe632('0x5'));var Mustache=require(_0xe632('0x6'));var util=require('util');var path=require('path');var sox=require(_0xe632('0x7'));var csv=require(_0xe632('0x8'));var ejs=require(_0xe632('0x9'));var fs=require('fs');var fs_extra=require(_0xe632('0xa'));var _=require(_0xe632('0xb'));var squel=require(_0xe632('0xc'));var crypto=require('crypto');var jsforce=require(_0xe632('0xd'));var deskjs=require(_0xe632('0xe'));var toCsv=require(_0xe632('0x8'));var querystring=require(_0xe632('0xf'));var Papa=require(_0xe632('0x10'));var Redis=require(_0xe632('0x11'));var authService=require('../../components/auth/service');var qs=require(_0xe632('0x12'));var as=require(_0xe632('0x13'));var hardwareService=require(_0xe632('0x14'));var logger=require('../../config/logger')(_0xe632('0x15'));var utils=require(_0xe632('0x16'));var config=require(_0xe632('0x17'));var licenseUtil=require(_0xe632('0x18'));var db=require(_0xe632('0x19'))['db'];function respondWithStatusCode(_0x1c321c,_0x43b45b){_0x43b45b=_0x43b45b||0xcc;return function(_0x337728){if(_0x337728){return _0x1c321c[_0xe632('0x1a')](_0x43b45b);}return _0x1c321c[_0xe632('0x1b')](_0x43b45b)[_0xe632('0x1c')]();};}function respondWithResult(_0x4a2d2b,_0x556627){_0x556627=_0x556627||0xc8;return function(_0x21ef18){if(_0x21ef18){return _0x4a2d2b[_0xe632('0x1b')](_0x556627)['json'](_0x21ef18);}};}function respondWithFilteredResult(_0xe5088d,_0x3290ad){return function(_0x4b04f0){if(_0x4b04f0){var _0x5e6682=typeof _0x3290ad[_0xe632('0x1d')]==='undefined'&&typeof _0x3290ad[_0xe632('0x1e')]==='undefined';var _0x2f2068=_0x4b04f0[_0xe632('0x1f')];var _0x1c13f8=_0x5e6682?0x0:_0x3290ad[_0xe632('0x1d')];var _0x57c5e5=_0x5e6682?_0x4b04f0[_0xe632('0x1f')]:_0x3290ad['offset']+_0x3290ad[_0xe632('0x1e')];var _0x32172;if(_0x57c5e5>=_0x2f2068){_0x57c5e5=_0x2f2068;_0x32172=0xc8;}else{_0x32172=0xce;}_0xe5088d[_0xe632('0x1b')](_0x32172);return _0xe5088d[_0xe632('0x20')](_0xe632('0x21'),_0x1c13f8+'-'+_0x57c5e5+'/'+_0x2f2068)[_0xe632('0x22')](_0x4b04f0);}return null;};}function patchUpdates(_0x4b341d){return function(_0xee2031){try{jsonpatch[_0xe632('0x23')](_0xee2031,_0x4b341d,!![]);}catch(_0x25b012){return BPromise[_0xe632('0x24')](_0x25b012);}return _0xee2031['save']();};}function saveUpdates(_0xda1c17,_0x4789fe){return function(_0x379fa6){if(_0x379fa6){return _0x379fa6[_0xe632('0x25')](_0xda1c17)[_0xe632('0x26')](function(_0x595f4d){return _0x595f4d;});}return null;};}function removeEntity(_0x278a47,_0x3e4220){return function(_0x5cdc0d){if(_0x5cdc0d){return _0x5cdc0d[_0xe632('0x27')]()[_0xe632('0x26')](function(){_0x278a47[_0xe632('0x1b')](0xcc)[_0xe632('0x1c')]();});}};}function handleEntityNotFound(_0xe1dc0b,_0x30d005){return function(_0x3db997){if(!_0x3db997){_0xe1dc0b[_0xe632('0x1a')](0x194);}return _0x3db997;};}function handleError(_0x5bb153,_0x1862aa){_0x1862aa=_0x1862aa||0x1f4;return function(_0x29618f){logger[_0xe632('0x28')](_0x29618f[_0xe632('0x29')]);if(_0x29618f['name']){delete _0x29618f['name'];}_0x5bb153[_0xe632('0x1b')](_0x1862aa)['send'](_0x29618f);};}exports[_0xe632('0x2a')]=function(_0xfb3df6,_0x3d9dc0){var _0x439a9f={},_0x26cbc9={},_0x167d08={'count':0x0,'rows':[]};var _0x29dd95=_[_0xe632('0x2b')](db['AnalyticTreeReport'][_0xe632('0x2c')],function(_0x11f133){return{'name':_0x11f133['fieldName'],'type':_0x11f133['type']['key']};});_0x26cbc9[_0xe632('0x2d')]=_[_0xe632('0x2b')](_0x29dd95,_0xe632('0x2e'));_0x26cbc9['query']=_[_0xe632('0x2f')](_0xfb3df6['query']);_0x26cbc9[_0xe632('0x30')]=_[_0xe632('0x31')](_0x26cbc9['model'],_0x26cbc9[_0xe632('0x32')]);_0x439a9f[_0xe632('0x33')]=_[_0xe632('0x31')](_0x26cbc9[_0xe632('0x2d')],qs[_0xe632('0x34')](_0xfb3df6['query'][_0xe632('0x34')]));_0x439a9f[_0xe632('0x33')]=_0x439a9f[_0xe632('0x33')]['length']?_0x439a9f[_0xe632('0x33')]:_0x26cbc9[_0xe632('0x2d')];if(!_0xfb3df6[_0xe632('0x32')][_0xe632('0x35')](_0xe632('0x36'))){_0x439a9f['limit']=qs[_0xe632('0x1e')](_0xfb3df6[_0xe632('0x32')][_0xe632('0x1e')]);_0x439a9f['offset']=qs[_0xe632('0x1d')](_0xfb3df6['query'][_0xe632('0x1d')]);}_0x439a9f[_0xe632('0x37')]=qs[_0xe632('0x38')](_0xfb3df6[_0xe632('0x32')][_0xe632('0x38')]);_0x439a9f[_0xe632('0x39')]=qs[_0xe632('0x30')](_[_0xe632('0x3a')](_0xfb3df6['query'],_0x26cbc9[_0xe632('0x30')]),_0x29dd95);if(_0xfb3df6['query'][_0xe632('0x3b')]){_0x439a9f[_0xe632('0x39')]=_[_0xe632('0x3c')](_0x439a9f[_0xe632('0x39')],{'$or':_[_0xe632('0x2b')](_0x29dd95,function(_0x2c97e5){if(_0x2c97e5[_0xe632('0x3d')]!==_0xe632('0x3e')){var _0x445b08={};_0x445b08[_0x2c97e5[_0xe632('0x2e')]]={'$like':'%'+_0xfb3df6['query'][_0xe632('0x3b')]+'%'};return _0x445b08;}})});}_0x439a9f=_['merge']({},_0x439a9f,_0xfb3df6[_0xe632('0x3f')]);var _0x1e217e={'where':_0x439a9f['where']};return db[_0xe632('0x40')][_0xe632('0x1f')](_0x1e217e)['then'](function(_0x315d0a){_0x167d08['count']=_0x315d0a;if(_0xfb3df6[_0xe632('0x32')][_0xe632('0x41')]){_0x439a9f[_0xe632('0x42')]=[{'all':!![]}];}return db['AnalyticTreeReport'][_0xe632('0x43')](_0x439a9f);})['then'](function(_0x2cafa4){_0x167d08[_0xe632('0x44')]=_0x2cafa4;return _0x167d08;})[_0xe632('0x26')](respondWithFilteredResult(_0x3d9dc0,_0x439a9f))[_0xe632('0x45')](handleError(_0x3d9dc0,null));};exports[_0xe632('0x46')]=function(_0xefaa0c,_0x4d383b){var _0x34ffc7={'raw':!![],'where':{'id':_0xefaa0c[_0xe632('0x47')]['id']}},_0x285fe7={};_0x285fe7[_0xe632('0x2d')]=_[_0xe632('0x2f')](db['AnalyticTreeReport']['rawAttributes']);_0x285fe7['query']=_[_0xe632('0x2f')](_0xefaa0c['query']);_0x285fe7[_0xe632('0x30')]=_[_0xe632('0x31')](_0x285fe7['model'],_0x285fe7[_0xe632('0x32')]);_0x34ffc7[_0xe632('0x33')]=_[_0xe632('0x31')](_0x285fe7[_0xe632('0x2d')],qs[_0xe632('0x34')](_0xefaa0c['query'][_0xe632('0x34')]));_0x34ffc7[_0xe632('0x33')]=_0x34ffc7[_0xe632('0x33')]['length']?_0x34ffc7[_0xe632('0x33')]:_0x285fe7[_0xe632('0x2d')];if(_0xefaa0c[_0xe632('0x32')][_0xe632('0x41')]){_0x34ffc7['include']=[{'all':!![]}];}_0x34ffc7=_[_0xe632('0x3c')]({},_0x34ffc7,_0xefaa0c[_0xe632('0x3f')]);return db['AnalyticTreeReport'][_0xe632('0x48')](_0x34ffc7)[_0xe632('0x26')](handleEntityNotFound(_0x4d383b,null))[_0xe632('0x26')](respondWithResult(_0x4d383b,null))['catch'](handleError(_0x4d383b,null));};exports[_0xe632('0x49')]=function(_0x4736e3,_0x1d93f5){return db[_0xe632('0x40')]['create'](_0x4736e3[_0xe632('0x4a')],{})[_0xe632('0x26')](respondWithResult(_0x1d93f5,0xc9))[_0xe632('0x45')](handleError(_0x1d93f5,null));};exports[_0xe632('0x25')]=function(_0x2a974b,_0x51e3a9){if(_0x2a974b[_0xe632('0x4a')]['id']){delete _0x2a974b['body']['id'];}return db['AnalyticTreeReport'][_0xe632('0x48')]({'where':{'id':_0x2a974b['params']['id']}})[_0xe632('0x26')](handleEntityNotFound(_0x51e3a9,null))[_0xe632('0x26')](saveUpdates(_0x2a974b[_0xe632('0x4a')],null))[_0xe632('0x26')](respondWithResult(_0x51e3a9,null))[_0xe632('0x45')](handleError(_0x51e3a9,null));};exports['destroy']=function(_0x4a4182,_0x590e88){return db[_0xe632('0x40')][_0xe632('0x48')]({'where':{'id':_0x4a4182[_0xe632('0x47')]['id']}})[_0xe632('0x26')](handleEntityNotFound(_0x590e88,null))[_0xe632('0x26')](removeEntity(_0x590e88,null))[_0xe632('0x45')](handleError(_0x590e88,null));};
\ No newline at end of file
+var _0xa782=['options','include','findAll','rows','catch','params','length','includeAll','find','create','body','destroy','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','mustache','util','path','sox','ejs','fs-extra','lodash','squel','crypto','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../mysqldb','sendStatus','end','status','json','offset','undefined','limit','count','Content-Range','apply','reject','save','update','then','error','stack','name','send','index','map','AnalyticTreeReport','rawAttributes','fieldName','type','key','model','query','keys','intersection','fields','attributes','hasOwnProperty','nolimit','sort','filters','pick','filter','where','merge','VIRTUAL'];(function(_0x2abfb7,_0x1f6a6b){var _0x3cfb4e=function(_0x319f7b){while(--_0x319f7b){_0x2abfb7['push'](_0x2abfb7['shift']());}};_0x3cfb4e(++_0x1f6a6b);}(_0xa782,0xa4));var _0x2a78=function(_0x40a045,_0x516f0e){_0x40a045=_0x40a045-0x0;var _0x1a687c=_0xa782[_0x40a045];return _0x1a687c;};'use strict';var emlformat=require(_0x2a78('0x0'));var rimraf=require(_0x2a78('0x1'));var zipdir=require(_0x2a78('0x2'));var jsonpatch=require(_0x2a78('0x3'));var rp=require(_0x2a78('0x4'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x2a78('0x5'));var util=require(_0x2a78('0x6'));var path=require(_0x2a78('0x7'));var sox=require(_0x2a78('0x8'));var csv=require('to-csv');var ejs=require(_0x2a78('0x9'));var fs=require('fs');var fs_extra=require(_0x2a78('0xa'));var _=require(_0x2a78('0xb'));var squel=require(_0x2a78('0xc'));var crypto=require(_0x2a78('0xd'));var jsforce=require('jsforce');var deskjs=require(_0x2a78('0xe'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x2a78('0xf'));var Redis=require(_0x2a78('0x10'));var authService=require(_0x2a78('0x11'));var qs=require('../../components/parsers/qs');var as=require(_0x2a78('0x12'));var hardwareService=require(_0x2a78('0x13'));var logger=require(_0x2a78('0x14'))(_0x2a78('0x15'));var utils=require('../../config/utils');var config=require(_0x2a78('0x16'));var licenseUtil=require('../../config/license/util');var db=require(_0x2a78('0x17'))['db'];function respondWithStatusCode(_0x3adbce,_0x4a9dd5){_0x4a9dd5=_0x4a9dd5||0xcc;return function(_0xdbee74){if(_0xdbee74){return _0x3adbce[_0x2a78('0x18')](_0x4a9dd5);}return _0x3adbce['status'](_0x4a9dd5)[_0x2a78('0x19')]();};}function respondWithResult(_0x5d94b5,_0x5cc5cb){_0x5cc5cb=_0x5cc5cb||0xc8;return function(_0xc12427){if(_0xc12427){return _0x5d94b5[_0x2a78('0x1a')](_0x5cc5cb)[_0x2a78('0x1b')](_0xc12427);}};}function respondWithFilteredResult(_0x24dee1,_0x24dbdd){return function(_0x545fde){if(_0x545fde){var _0x251a83=typeof _0x24dbdd[_0x2a78('0x1c')]===_0x2a78('0x1d')&&typeof _0x24dbdd[_0x2a78('0x1e')]==='undefined';var _0x190ebc=_0x545fde[_0x2a78('0x1f')];var _0x105979=_0x251a83?0x0:_0x24dbdd[_0x2a78('0x1c')];var _0xef5094=_0x251a83?_0x545fde[_0x2a78('0x1f')]:_0x24dbdd[_0x2a78('0x1c')]+_0x24dbdd[_0x2a78('0x1e')];var _0x119f12;if(_0xef5094>=_0x190ebc){_0xef5094=_0x190ebc;_0x119f12=0xc8;}else{_0x119f12=0xce;}_0x24dee1['status'](_0x119f12);return _0x24dee1['set'](_0x2a78('0x20'),_0x105979+'-'+_0xef5094+'/'+_0x190ebc)[_0x2a78('0x1b')](_0x545fde);}return null;};}function patchUpdates(_0x258dde){return function(_0x1f45b3){try{jsonpatch[_0x2a78('0x21')](_0x1f45b3,_0x258dde,!![]);}catch(_0x3fa351){return BPromise[_0x2a78('0x22')](_0x3fa351);}return _0x1f45b3[_0x2a78('0x23')]();};}function saveUpdates(_0x2e48db,_0x33dc7c){return function(_0x45d292){if(_0x45d292){return _0x45d292[_0x2a78('0x24')](_0x2e48db)['then'](function(_0x5e0064){return _0x5e0064;});}return null;};}function removeEntity(_0x4623c3,_0x5c3d9c){return function(_0x15f2eb){if(_0x15f2eb){return _0x15f2eb['destroy']()[_0x2a78('0x25')](function(){_0x4623c3[_0x2a78('0x1a')](0xcc)[_0x2a78('0x19')]();});}};}function handleEntityNotFound(_0x182500,_0x43d380){return function(_0x53c77f){if(!_0x53c77f){_0x182500[_0x2a78('0x18')](0x194);}return _0x53c77f;};}function handleError(_0xcdbe51,_0x14d6fe){_0x14d6fe=_0x14d6fe||0x1f4;return function(_0x56706d){logger[_0x2a78('0x26')](_0x56706d[_0x2a78('0x27')]);if(_0x56706d[_0x2a78('0x28')]){delete _0x56706d[_0x2a78('0x28')];}_0xcdbe51[_0x2a78('0x1a')](_0x14d6fe)[_0x2a78('0x29')](_0x56706d);};}exports[_0x2a78('0x2a')]=function(_0x3579d9,_0x481bcf){var _0x1065a4={},_0x40ea84={},_0x7fc2b6={'count':0x0,'rows':[]};var _0x14504f=_[_0x2a78('0x2b')](db[_0x2a78('0x2c')][_0x2a78('0x2d')],function(_0x52690e){return{'name':_0x52690e[_0x2a78('0x2e')],'type':_0x52690e[_0x2a78('0x2f')][_0x2a78('0x30')]};});_0x40ea84[_0x2a78('0x31')]=_['map'](_0x14504f,_0x2a78('0x28'));_0x40ea84[_0x2a78('0x32')]=_[_0x2a78('0x33')](_0x3579d9['query']);_0x40ea84['filters']=_[_0x2a78('0x34')](_0x40ea84[_0x2a78('0x31')],_0x40ea84[_0x2a78('0x32')]);_0x1065a4['attributes']=_[_0x2a78('0x34')](_0x40ea84[_0x2a78('0x31')],qs['fields'](_0x3579d9[_0x2a78('0x32')][_0x2a78('0x35')]));_0x1065a4[_0x2a78('0x36')]=_0x1065a4['attributes']['length']?_0x1065a4[_0x2a78('0x36')]:_0x40ea84[_0x2a78('0x31')];if(!_0x3579d9['query'][_0x2a78('0x37')](_0x2a78('0x38'))){_0x1065a4[_0x2a78('0x1e')]=qs[_0x2a78('0x1e')](_0x3579d9[_0x2a78('0x32')]['limit']);_0x1065a4['offset']=qs[_0x2a78('0x1c')](_0x3579d9[_0x2a78('0x32')][_0x2a78('0x1c')]);}_0x1065a4['order']=qs[_0x2a78('0x39')](_0x3579d9[_0x2a78('0x32')][_0x2a78('0x39')]);_0x1065a4['where']=qs[_0x2a78('0x3a')](_[_0x2a78('0x3b')](_0x3579d9['query'],_0x40ea84[_0x2a78('0x3a')]),_0x14504f);if(_0x3579d9['query'][_0x2a78('0x3c')]){_0x1065a4[_0x2a78('0x3d')]=_[_0x2a78('0x3e')](_0x1065a4['where'],{'$or':_[_0x2a78('0x2b')](_0x14504f,function(_0x293a25){if(_0x293a25[_0x2a78('0x2f')]!==_0x2a78('0x3f')){var _0x1df5ac={};_0x1df5ac[_0x293a25[_0x2a78('0x28')]]={'$like':'%'+_0x3579d9['query']['filter']+'%'};return _0x1df5ac;}})});}_0x1065a4=_['merge']({},_0x1065a4,_0x3579d9[_0x2a78('0x40')]);var _0x1869bf={'where':_0x1065a4[_0x2a78('0x3d')]};return db['AnalyticTreeReport']['count'](_0x1869bf)[_0x2a78('0x25')](function(_0x366d07){_0x7fc2b6[_0x2a78('0x1f')]=_0x366d07;if(_0x3579d9[_0x2a78('0x32')]['includeAll']){_0x1065a4[_0x2a78('0x41')]=[{'all':!![]}];}return db['AnalyticTreeReport'][_0x2a78('0x42')](_0x1065a4);})[_0x2a78('0x25')](function(_0x1bbd9a){_0x7fc2b6[_0x2a78('0x43')]=_0x1bbd9a;return _0x7fc2b6;})[_0x2a78('0x25')](respondWithFilteredResult(_0x481bcf,_0x1065a4))[_0x2a78('0x44')](handleError(_0x481bcf,null));};exports['show']=function(_0x533f75,_0xa70eca){var _0x18e65c={'raw':!![],'where':{'id':_0x533f75[_0x2a78('0x45')]['id']}},_0x33d0c2={};_0x33d0c2[_0x2a78('0x31')]=_[_0x2a78('0x33')](db['AnalyticTreeReport'][_0x2a78('0x2d')]);_0x33d0c2[_0x2a78('0x32')]=_[_0x2a78('0x33')](_0x533f75[_0x2a78('0x32')]);_0x33d0c2[_0x2a78('0x3a')]=_['intersection'](_0x33d0c2['model'],_0x33d0c2[_0x2a78('0x32')]);_0x18e65c[_0x2a78('0x36')]=_[_0x2a78('0x34')](_0x33d0c2[_0x2a78('0x31')],qs[_0x2a78('0x35')](_0x533f75['query'][_0x2a78('0x35')]));_0x18e65c[_0x2a78('0x36')]=_0x18e65c['attributes'][_0x2a78('0x46')]?_0x18e65c['attributes']:_0x33d0c2[_0x2a78('0x31')];if(_0x533f75[_0x2a78('0x32')][_0x2a78('0x47')]){_0x18e65c[_0x2a78('0x41')]=[{'all':!![]}];}_0x18e65c=_[_0x2a78('0x3e')]({},_0x18e65c,_0x533f75[_0x2a78('0x40')]);return db[_0x2a78('0x2c')][_0x2a78('0x48')](_0x18e65c)[_0x2a78('0x25')](handleEntityNotFound(_0xa70eca,null))[_0x2a78('0x25')](respondWithResult(_0xa70eca,null))['catch'](handleError(_0xa70eca,null));};exports[_0x2a78('0x49')]=function(_0x54fb2f,_0x4c9674){return db[_0x2a78('0x2c')]['create'](_0x54fb2f[_0x2a78('0x4a')],{})[_0x2a78('0x25')](respondWithResult(_0x4c9674,0xc9))['catch'](handleError(_0x4c9674,null));};exports[_0x2a78('0x24')]=function(_0x1d5bfe,_0x5f5193){if(_0x1d5bfe[_0x2a78('0x4a')]['id']){delete _0x1d5bfe[_0x2a78('0x4a')]['id'];}return db[_0x2a78('0x2c')][_0x2a78('0x48')]({'where':{'id':_0x1d5bfe[_0x2a78('0x45')]['id']}})[_0x2a78('0x25')](handleEntityNotFound(_0x5f5193,null))[_0x2a78('0x25')](saveUpdates(_0x1d5bfe[_0x2a78('0x4a')],null))[_0x2a78('0x25')](respondWithResult(_0x5f5193,null))['catch'](handleError(_0x5f5193,null));};exports[_0x2a78('0x4b')]=function(_0x4e9eda,_0x1919ac){return db[_0x2a78('0x2c')]['find']({'where':{'id':_0x4e9eda[_0x2a78('0x45')]['id']}})[_0x2a78('0x25')](handleEntityNotFound(_0x1919ac,null))[_0x2a78('0x25')](removeEntity(_0x1919ac,null))[_0x2a78('0x44')](handleError(_0x1919ac,null));};
\ No newline at end of file
diff --git a/server/api/analyticTreeReport/analyticTreeReport.model.js b/server/api/analyticTreeReport/analyticTreeReport.model.js
index fb2b47f..8b6a3ea 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 _0xbe38=['path','rimraf','../../config/environment','exports','define','analytics_report_trees','lodash','util','../../config/logger','api','moment','request-promise'];(function(_0x32320a,_0x5b9b6f){var _0x505d3e=function(_0x4efb9c){while(--_0x4efb9c){_0x32320a['push'](_0x32320a['shift']());}};_0x505d3e(++_0x5b9b6f);}(_0xbe38,0x17a));var _0x8be3=function(_0x100dcb,_0x2cfcdf){_0x100dcb=_0x100dcb-0x0;var _0x690bf=_0xbe38[_0x100dcb];return _0x690bf;};'use strict';var _=require(_0x8be3('0x0'));var util=require(_0x8be3('0x1'));var logger=require(_0x8be3('0x2'))(_0x8be3('0x3'));var moment=require(_0x8be3('0x4'));var BPromise=require('bluebird');var rp=require(_0x8be3('0x5'));var fs=require('fs');var path=require(_0x8be3('0x6'));var rimraf=require(_0x8be3('0x7'));var config=require(_0x8be3('0x8'));var attributes=require('./analyticTreeReport.attributes');module[_0x8be3('0x9')]=function(_0x192142,_0xf7c04e){return _0x192142[_0x8be3('0xa')]('AnalyticTreeReport',attributes,{'tableName':_0x8be3('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x7a1a=['request-promise','../../config/environment','./analyticTreeReport.attributes','exports','define','AnalyticTreeReport','util','../../config/logger','api','moment','bluebird'];(function(_0x2f42f7,_0x3729a9){var _0x2dfc2f=function(_0x2c6aa4){while(--_0x2c6aa4){_0x2f42f7['push'](_0x2f42f7['shift']());}};_0x2dfc2f(++_0x3729a9);}(_0x7a1a,0x187));var _0xa7a1=function(_0x324aa5,_0x126018){_0x324aa5=_0x324aa5-0x0;var _0x3cfee8=_0x7a1a[_0x324aa5];return _0x3cfee8;};'use strict';var _=require('lodash');var util=require(_0xa7a1('0x0'));var logger=require(_0xa7a1('0x1'))(_0xa7a1('0x2'));var moment=require(_0xa7a1('0x3'));var BPromise=require(_0xa7a1('0x4'));var rp=require(_0xa7a1('0x5'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0xa7a1('0x6'));var attributes=require(_0xa7a1('0x7'));module[_0xa7a1('0x8')]=function(_0x58dbf4,_0x2d368f){return _0x58dbf4[_0xa7a1('0x9')](_0xa7a1('0xa'),attributes,{'tableName':'analytics_report_trees','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
diff --git a/server/api/analyticTreeReport/analyticTreeReport.rpc.js b/server/api/analyticTreeReport/analyticTreeReport.rpc.js
index f27d1bc..dc08c85 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 _0x2ef3=['bluebird','randomstring','ioredis','../../config/utils','../../config/logger','../../config/environment','jayson/promise','request','then','info','AnalyticTreeReport,\x20%s,\x20%s','AnalyticTreeReport,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','catch','lodash','util','moment'];(function(_0x11dc88,_0x2416fe){var _0x5c8870=function(_0x2b8ffe){while(--_0x2b8ffe){_0x11dc88['push'](_0x11dc88['shift']());}};_0x5c8870(++_0x2416fe);}(_0x2ef3,0xba));var _0x32ef=function(_0x315aa0,_0x2e3d8a){_0x315aa0=_0x315aa0-0x0;var _0xdc38c4=_0x2ef3[_0x315aa0];return _0xdc38c4;};'use strict';var _=require(_0x32ef('0x0'));var util=require(_0x32ef('0x1'));var moment=require(_0x32ef('0x2'));var BPromise=require(_0x32ef('0x3'));var rs=require(_0x32ef('0x4'));var fs=require('fs');var Redis=require(_0x32ef('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0x32ef('0x6'));var logger=require(_0x32ef('0x7'))('rpc');var config=require(_0x32ef('0x8'));var jayson=require(_0x32ef('0x9'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x2c0089,_0x4bfcf8,_0x367c39){return new BPromise(function(_0x2fb8eb,_0x234863){return client[_0x32ef('0xa')](_0x2c0089,_0x367c39)[_0x32ef('0xb')](function(_0x2bbb50){logger[_0x32ef('0xc')](_0x32ef('0xd'),_0x4bfcf8,'request\x20sent');logger['debug'](_0x32ef('0xe'),_0x4bfcf8,_0x32ef('0xf'),JSON[_0x32ef('0x10')](_0x2bbb50));if(_0x2bbb50[_0x32ef('0x11')]){if(_0x2bbb50['error'][_0x32ef('0x12')]===0x1f4){logger['error'](_0x32ef('0xd'),_0x4bfcf8,_0x2bbb50['error'][_0x32ef('0x13')]);return _0x234863(_0x2bbb50[_0x32ef('0x11')]['message']);}logger['error'](_0x32ef('0xd'),_0x4bfcf8,_0x2bbb50['error'][_0x32ef('0x13')]);return _0x2fb8eb(_0x2bbb50[_0x32ef('0x11')][_0x32ef('0x13')]);}else{logger[_0x32ef('0xc')]('AnalyticTreeReport,\x20%s,\x20%s',_0x4bfcf8,'request\x20sent');_0x2fb8eb(_0x2bbb50['result'][_0x32ef('0x13')]);}})[_0x32ef('0x14')](function(_0xb5aed2){logger['error']('AnalyticTreeReport,\x20%s,\x20%s',_0x4bfcf8,_0xb5aed2);_0x234863(_0xb5aed2);});});}
\ No newline at end of file
+var _0x2ef3=['bluebird','randomstring','ioredis','../../config/utils','../../config/logger','../../config/environment','jayson/promise','request','then','info','AnalyticTreeReport,\x20%s,\x20%s','AnalyticTreeReport,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','catch','lodash','util','moment'];(function(_0x545d36,_0x45c4b1){var _0x53b683=function(_0x211f84){while(--_0x211f84){_0x545d36['push'](_0x545d36['shift']());}};_0x53b683(++_0x45c4b1);}(_0x2ef3,0xba));var _0x32ef=function(_0xcd16a,_0x27f049){_0xcd16a=_0xcd16a-0x0;var _0x217268=_0x2ef3[_0xcd16a];return _0x217268;};'use strict';var _=require(_0x32ef('0x0'));var util=require(_0x32ef('0x1'));var moment=require(_0x32ef('0x2'));var BPromise=require(_0x32ef('0x3'));var rs=require(_0x32ef('0x4'));var fs=require('fs');var Redis=require(_0x32ef('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0x32ef('0x6'));var logger=require(_0x32ef('0x7'))('rpc');var config=require(_0x32ef('0x8'));var jayson=require(_0x32ef('0x9'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x2c0089,_0x4bfcf8,_0x367c39){return new BPromise(function(_0x2fb8eb,_0x234863){return client[_0x32ef('0xa')](_0x2c0089,_0x367c39)[_0x32ef('0xb')](function(_0x2bbb50){logger[_0x32ef('0xc')](_0x32ef('0xd'),_0x4bfcf8,'request\x20sent');logger['debug'](_0x32ef('0xe'),_0x4bfcf8,_0x32ef('0xf'),JSON[_0x32ef('0x10')](_0x2bbb50));if(_0x2bbb50[_0x32ef('0x11')]){if(_0x2bbb50['error'][_0x32ef('0x12')]===0x1f4){logger['error'](_0x32ef('0xd'),_0x4bfcf8,_0x2bbb50['error'][_0x32ef('0x13')]);return _0x234863(_0x2bbb50[_0x32ef('0x11')]['message']);}logger['error'](_0x32ef('0xd'),_0x4bfcf8,_0x2bbb50['error'][_0x32ef('0x13')]);return _0x2fb8eb(_0x2bbb50[_0x32ef('0x11')][_0x32ef('0x13')]);}else{logger[_0x32ef('0xc')]('AnalyticTreeReport,\x20%s,\x20%s',_0x4bfcf8,'request\x20sent');_0x2fb8eb(_0x2bbb50['result'][_0x32ef('0x13')]);}})[_0x32ef('0x14')](function(_0xb5aed2){logger['error']('AnalyticTreeReport,\x20%s,\x20%s',_0x4bfcf8,_0xb5aed2);_0x234863(_0xb5aed2);});});}
\ No newline at end of file
diff --git a/server/api/analyticTreeReport/index.js b/server/api/analyticTreeReport/index.js
index 8d95a4d..f23dce9 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 _0x18b3=['show','post','create','put','delete','exports','multer','util','path','Router','fs-extra','../../config/environment','get','index','/:id','isAuthenticated'];(function(_0x1e7597,_0x3376bb){var _0x3ab22c=function(_0x315e2d){while(--_0x315e2d){_0x1e7597['push'](_0x1e7597['shift']());}};_0x3ab22c(++_0x3376bb);}(_0x18b3,0x106));var _0x318b=function(_0xdb04ac,_0x6c97fb){_0xdb04ac=_0xdb04ac-0x0;var _0x4cbbca=_0x18b3[_0xdb04ac];return _0x4cbbca;};'use strict';var multer=require(_0x318b('0x0'));var util=require(_0x318b('0x1'));var path=require(_0x318b('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x318b('0x3')]();var fs_extra=require(_0x318b('0x4'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x318b('0x5'));var controller=require('./analyticTreeReport.controller');router[_0x318b('0x6')]('/',auth['isAuthenticated'](),controller[_0x318b('0x7')]);router[_0x318b('0x6')](_0x318b('0x8'),auth[_0x318b('0x9')](),controller[_0x318b('0xa')]);router[_0x318b('0xb')]('/',auth['isAuthenticated'](),controller[_0x318b('0xc')]);router[_0x318b('0xd')]('/:id',auth[_0x318b('0x9')](),controller['update']);router[_0x318b('0xe')]('/:id',auth[_0x318b('0x9')](),controller['destroy']);module[_0x318b('0xf')]=router;
\ No newline at end of file
+var _0x6ccf=['update','delete','destroy','exports','multer','util','path','connect-timeout','express','fs-extra','../../components/auth/service','../../config/environment','./analyticTreeReport.controller','get','index','/:id','isAuthenticated','post','create','put'];(function(_0x569d04,_0x40fbf7){var _0x505cf2=function(_0x54453f){while(--_0x54453f){_0x569d04['push'](_0x569d04['shift']());}};_0x505cf2(++_0x40fbf7);}(_0x6ccf,0x158));var _0xf6cc=function(_0x5d30b4,_0x199248){_0x5d30b4=_0x5d30b4-0x0;var _0x1acfb8=_0x6ccf[_0x5d30b4];return _0x1acfb8;};'use strict';var multer=require(_0xf6cc('0x0'));var util=require(_0xf6cc('0x1'));var path=require(_0xf6cc('0x2'));var timeout=require(_0xf6cc('0x3'));var express=require(_0xf6cc('0x4'));var router=express['Router']();var fs_extra=require(_0xf6cc('0x5'));var auth=require(_0xf6cc('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0xf6cc('0x7'));var controller=require(_0xf6cc('0x8'));router[_0xf6cc('0x9')]('/',auth['isAuthenticated'](),controller[_0xf6cc('0xa')]);router[_0xf6cc('0x9')](_0xf6cc('0xb'),auth[_0xf6cc('0xc')](),controller['show']);router[_0xf6cc('0xd')]('/',auth[_0xf6cc('0xc')](),controller[_0xf6cc('0xe')]);router[_0xf6cc('0xf')](_0xf6cc('0xb'),auth[_0xf6cc('0xc')](),controller[_0xf6cc('0x10')]);router[_0xf6cc('0x11')](_0xf6cc('0xb'),auth[_0xf6cc('0xc')](),controller[_0xf6cc('0x12')]);module[_0xf6cc('0x13')]=router;
\ No newline at end of file
diff --git a/server/api/attachment/attachment.attributes.js b/server/api/attachment/attachment.attributes.js
index f0ebc4f..7ff96a0 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 _0x33a4=['exports','STRING'];(function(_0x1cf870,_0x5f172d){var _0x439018=function(_0x4e0f93){while(--_0x4e0f93){_0x1cf870['push'](_0x1cf870['shift']());}};_0x439018(++_0x5f172d);}(_0x33a4,0x88));var _0x433a=function(_0x12e174,_0x5bfe94){_0x12e174=_0x12e174-0x0;var _0x3db336=_0x33a4[_0x12e174];return _0x3db336;};'use strict';var Sequelize=require('sequelize');module[_0x433a('0x0')]={'name':{'type':Sequelize['STRING']},'basename':{'type':Sequelize[_0x433a('0x1')]},'type':{'type':Sequelize[_0x433a('0x1')]}};
\ No newline at end of file
+var _0xa588=['STRING','exports'];(function(_0xfa417e,_0x5b8199){var _0x536ae1=function(_0x5d1cf5){while(--_0x5d1cf5){_0xfa417e['push'](_0xfa417e['shift']());}};_0x536ae1(++_0x5b8199);}(_0xa588,0xe1));var _0x8a58=function(_0x2f1787,_0x321733){_0x2f1787=_0x2f1787-0x0;var _0x50c4c2=_0xa588[_0x2f1787];return _0x50c4c2;};'use strict';var Sequelize=require('sequelize');module[_0x8a58('0x0')]={'name':{'type':Sequelize[_0x8a58('0x1')]},'basename':{'type':Sequelize[_0x8a58('0x1')]},'type':{'type':Sequelize[_0x8a58('0x1')]}};
\ No newline at end of file
diff --git a/server/api/attachment/attachment.controller.js b/server/api/attachment/attachment.controller.js
index 5114ebe..89cee12 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 _0x8458=['sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','rows','params','rawAttributes','find','catch','omit','updatedAt','body','createdAt','create','file','basename','filename','download','findOne','ChatOfflineMessageId','root','join','offline-chat/','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','util','path','sox','ejs','fs-extra','lodash','squel','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','end','json','undefined','limit','count','offset','Content-Range','apply','reject','save','update','then','destroy','error','stack','name','index','map','Attachment','fieldName','type','key','model','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order'];(function(_0x53a21d,_0x500c6b){var _0x3adc74=function(_0x26d656){while(--_0x26d656){_0x53a21d['push'](_0x53a21d['shift']());}};_0x3adc74(++_0x500c6b);}(_0x8458,0x180));var _0x8845=function(_0x59ecd6,_0x4f3243){_0x59ecd6=_0x59ecd6-0x0;var _0x2277dd=_0x8458[_0x59ecd6];return _0x2277dd;};'use strict';var emlformat=require(_0x8845('0x0'));var rimraf=require(_0x8845('0x1'));var zipdir=require(_0x8845('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x8845('0x3'));var moment=require(_0x8845('0x4'));var BPromise=require(_0x8845('0x5'));var Mustache=require('mustache');var util=require(_0x8845('0x6'));var path=require(_0x8845('0x7'));var sox=require(_0x8845('0x8'));var csv=require('to-csv');var ejs=require(_0x8845('0x9'));var fs=require('fs');var fs_extra=require(_0x8845('0xa'));var _=require(_0x8845('0xb'));var squel=require(_0x8845('0xc'));var crypto=require('crypto');var jsforce=require(_0x8845('0xd'));var deskjs=require(_0x8845('0xe'));var toCsv=require(_0x8845('0xf'));var querystring=require(_0x8845('0x10'));var Papa=require(_0x8845('0x11'));var Redis=require(_0x8845('0x12'));var authService=require('../../components/auth/service');var qs=require(_0x8845('0x13'));var as=require(_0x8845('0x14'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x8845('0x15'))(_0x8845('0x16'));var utils=require(_0x8845('0x17'));var config=require(_0x8845('0x18'));var licenseUtil=require(_0x8845('0x19'));var db=require(_0x8845('0x1a'))['db'];function respondWithStatusCode(_0x3d50cb,_0x397894){_0x397894=_0x397894||0xcc;return function(_0x22290d){if(_0x22290d){return _0x3d50cb['sendStatus'](_0x397894);}return _0x3d50cb[_0x8845('0x1b')](_0x397894)[_0x8845('0x1c')]();};}function respondWithResult(_0x1e77ca,_0x528ab2){_0x528ab2=_0x528ab2||0xc8;return function(_0x288215){if(_0x288215){return _0x1e77ca[_0x8845('0x1b')](_0x528ab2)[_0x8845('0x1d')](_0x288215);}};}function respondWithFilteredResult(_0x349548,_0x2d6948){return function(_0x2d5a0d){if(_0x2d5a0d){var _0x5c9273=typeof _0x2d6948['offset']===_0x8845('0x1e')&&typeof _0x2d6948[_0x8845('0x1f')]===_0x8845('0x1e');var _0x23d861=_0x2d5a0d['count'];var _0x57d141=_0x5c9273?0x0:_0x2d6948['offset'];var _0x4723c3=_0x5c9273?_0x2d5a0d[_0x8845('0x20')]:_0x2d6948[_0x8845('0x21')]+_0x2d6948[_0x8845('0x1f')];var _0x42cf1b;if(_0x4723c3>=_0x23d861){_0x4723c3=_0x23d861;_0x42cf1b=0xc8;}else{_0x42cf1b=0xce;}_0x349548[_0x8845('0x1b')](_0x42cf1b);return _0x349548['set'](_0x8845('0x22'),_0x57d141+'-'+_0x4723c3+'/'+_0x23d861)[_0x8845('0x1d')](_0x2d5a0d);}return null;};}function patchUpdates(_0x4fc581){return function(_0x2e2ec9){try{jsonpatch[_0x8845('0x23')](_0x2e2ec9,_0x4fc581,!![]);}catch(_0x337e16){return BPromise[_0x8845('0x24')](_0x337e16);}return _0x2e2ec9[_0x8845('0x25')]();};}function saveUpdates(_0x8b01c7,_0x54dfba){return function(_0x13e71c){if(_0x13e71c){return _0x13e71c[_0x8845('0x26')](_0x8b01c7)[_0x8845('0x27')](function(_0x4cc8d1){return _0x4cc8d1;});}return null;};}function removeEntity(_0x5877a6,_0x43d38f){return function(_0x4fd508){if(_0x4fd508){return _0x4fd508[_0x8845('0x28')]()['then'](function(){_0x5877a6[_0x8845('0x1b')](0xcc)[_0x8845('0x1c')]();});}};}function handleEntityNotFound(_0x5a0a5b,_0x54f27a){return function(_0x1914ad){if(!_0x1914ad){_0x5a0a5b['sendStatus'](0x194);}return _0x1914ad;};}function handleError(_0x90fb65,_0x104ef1){_0x104ef1=_0x104ef1||0x1f4;return function(_0x64c1fe){logger[_0x8845('0x29')](_0x64c1fe[_0x8845('0x2a')]);if(_0x64c1fe[_0x8845('0x2b')]){delete _0x64c1fe[_0x8845('0x2b')];}_0x90fb65[_0x8845('0x1b')](_0x104ef1)['send'](_0x64c1fe);};}exports[_0x8845('0x2c')]=function(_0x12d31a,_0x9e7ea4){var _0x16930b={},_0x978bfc={},_0x51919c={'count':0x0,'rows':[]};var _0x3f5cb0=_[_0x8845('0x2d')](db[_0x8845('0x2e')]['rawAttributes'],function(_0x25ac9c){return{'name':_0x25ac9c[_0x8845('0x2f')],'type':_0x25ac9c[_0x8845('0x30')][_0x8845('0x31')]};});_0x978bfc[_0x8845('0x32')]=_[_0x8845('0x2d')](_0x3f5cb0,_0x8845('0x2b'));_0x978bfc[_0x8845('0x33')]=_[_0x8845('0x34')](_0x12d31a[_0x8845('0x33')]);_0x978bfc[_0x8845('0x35')]=_[_0x8845('0x36')](_0x978bfc[_0x8845('0x32')],_0x978bfc['query']);_0x16930b['attributes']=_[_0x8845('0x36')](_0x978bfc[_0x8845('0x32')],qs['fields'](_0x12d31a[_0x8845('0x33')][_0x8845('0x37')]));_0x16930b[_0x8845('0x38')]=_0x16930b[_0x8845('0x38')][_0x8845('0x39')]?_0x16930b[_0x8845('0x38')]:_0x978bfc[_0x8845('0x32')];if(!_0x12d31a[_0x8845('0x33')][_0x8845('0x3a')](_0x8845('0x3b'))){_0x16930b['limit']=qs[_0x8845('0x1f')](_0x12d31a[_0x8845('0x33')][_0x8845('0x1f')]);_0x16930b[_0x8845('0x21')]=qs['offset'](_0x12d31a[_0x8845('0x33')][_0x8845('0x21')]);}_0x16930b[_0x8845('0x3c')]=qs[_0x8845('0x3d')](_0x12d31a[_0x8845('0x33')][_0x8845('0x3d')]);_0x16930b[_0x8845('0x3e')]=qs['filters'](_[_0x8845('0x3f')](_0x12d31a[_0x8845('0x33')],_0x978bfc[_0x8845('0x35')]),_0x3f5cb0);if(_0x12d31a[_0x8845('0x33')][_0x8845('0x40')]){_0x16930b['where']=_[_0x8845('0x41')](_0x16930b[_0x8845('0x3e')],{'$or':_['map'](_0x3f5cb0,function(_0x3750f8){if(_0x3750f8[_0x8845('0x30')]!==_0x8845('0x42')){var _0x564830={};_0x564830[_0x3750f8[_0x8845('0x2b')]]={'$like':'%'+_0x12d31a[_0x8845('0x33')][_0x8845('0x40')]+'%'};return _0x564830;}})});}_0x16930b=_[_0x8845('0x41')]({},_0x16930b,_0x12d31a[_0x8845('0x43')]);var _0x1c9924={'where':_0x16930b[_0x8845('0x3e')]};return db[_0x8845('0x2e')]['count'](_0x1c9924)[_0x8845('0x27')](function(_0x4590d5){_0x51919c['count']=_0x4590d5;if(_0x12d31a[_0x8845('0x33')][_0x8845('0x44')]){_0x16930b[_0x8845('0x45')]=[{'all':!![]}];}return db[_0x8845('0x2e')]['findAll'](_0x16930b);})['then'](function(_0x2fe11d){_0x51919c[_0x8845('0x46')]=_0x2fe11d;return _0x51919c;})[_0x8845('0x27')](respondWithFilteredResult(_0x9e7ea4,_0x16930b))['catch'](handleError(_0x9e7ea4,null));};exports['show']=function(_0x5c7687,_0x54447e){var _0x18ec83={'raw':!![],'where':{'id':_0x5c7687[_0x8845('0x47')]['id']}},_0x19d5ac={};_0x19d5ac[_0x8845('0x32')]=_[_0x8845('0x34')](db[_0x8845('0x2e')][_0x8845('0x48')]);_0x19d5ac[_0x8845('0x33')]=_[_0x8845('0x34')](_0x5c7687[_0x8845('0x33')]);_0x19d5ac[_0x8845('0x35')]=_[_0x8845('0x36')](_0x19d5ac[_0x8845('0x32')],_0x19d5ac[_0x8845('0x33')]);_0x18ec83[_0x8845('0x38')]=_['intersection'](_0x19d5ac['model'],qs['fields'](_0x5c7687['query'][_0x8845('0x37')]));_0x18ec83[_0x8845('0x38')]=_0x18ec83[_0x8845('0x38')]['length']?_0x18ec83['attributes']:_0x19d5ac['model'];if(_0x5c7687[_0x8845('0x33')]['includeAll']){_0x18ec83[_0x8845('0x45')]=[{'all':!![]}];}_0x18ec83=_[_0x8845('0x41')]({},_0x18ec83,_0x5c7687[_0x8845('0x43')]);return db['Attachment'][_0x8845('0x49')](_0x18ec83)[_0x8845('0x27')](handleEntityNotFound(_0x54447e,null))[_0x8845('0x27')](respondWithResult(_0x54447e,null))[_0x8845('0x4a')](handleError(_0x54447e,null));};exports['clone']=function(_0x4aba3d,_0x4df1c9){var _0x41d3ae={'where':{'id':_0x4aba3d[_0x8845('0x47')]['id']}},_0x29ac7d={};_0x29ac7d[_0x8845('0x32')]=_[_0x8845('0x34')](db[_0x8845('0x2e')]['rawAttributes']);_0x41d3ae[_0x8845('0x38')]=_[_0x8845('0x36')](_0x29ac7d[_0x8845('0x32')],qs['fields'](_0x4aba3d[_0x8845('0x33')]['fields']));_0x41d3ae['attributes']=_0x41d3ae[_0x8845('0x38')][_0x8845('0x39')]?_0x41d3ae[_0x8845('0x38')]:_0x29ac7d['model'];if(_0x4aba3d[_0x8845('0x33')][_0x8845('0x44')]){_0x41d3ae[_0x8845('0x45')]=[{'all':!![]}];}_0x41d3ae=_['merge']({},_0x41d3ae,_0x4aba3d[_0x8845('0x43')]);return db[_0x8845('0x2e')]['find'](_0x41d3ae)[_0x8845('0x27')](handleEntityNotFound(_0x4df1c9,null))[_0x8845('0x27')](function(_0x4e393f){if(_0x4e393f){var _0x339721=_0x4e393f['get']({'plain':!![]});_0x339721=qs[_0x8845('0x4b')](_0x339721,['id','createdAt',_0x8845('0x4c')]);_0x4aba3d[_0x8845('0x4d')]=_['omit'](_0x4aba3d['body'],['id',_0x8845('0x4e'),_0x8845('0x4c')]);return db[_0x8845('0x2e')][_0x8845('0x4f')](_['merge'](_0x339721,_0x4aba3d[_0x8845('0x4d')]),{'include':_0x4aba3d['query']['includeAll']?[{'all':!![]}]:undefined});}})[_0x8845('0x27')](respondWithResult(_0x4df1c9,0xc9))[_0x8845('0x4a')](handleError(_0x4df1c9,null));};exports[_0x8845('0x26')]=function(_0x5ad5fd,_0x45f53a){if(_0x5ad5fd[_0x8845('0x4d')]['id']){delete _0x5ad5fd['body']['id'];}return db[_0x8845('0x2e')]['find']({'where':{'id':_0x5ad5fd[_0x8845('0x47')]['id']}})[_0x8845('0x27')](handleEntityNotFound(_0x45f53a,null))[_0x8845('0x27')](saveUpdates(_0x5ad5fd['body'],null))[_0x8845('0x27')](respondWithResult(_0x45f53a,null))['catch'](handleError(_0x45f53a,null));};exports['destroy']=function(_0x2af383,_0x1fef82){return db[_0x8845('0x2e')][_0x8845('0x49')]({'where':{'id':_0x2af383['params']['id']}})['then'](handleEntityNotFound(_0x1fef82,null))[_0x8845('0x27')](removeEntity(_0x1fef82,null))[_0x8845('0x4a')](handleError(_0x1fef82,null));};exports[_0x8845('0x4f')]=function(_0x2d42ac,_0x28e45c,_0x24c742){_0x2d42ac[_0x8845('0x4d')][_0x8845('0x2b')]=_0x2d42ac[_0x8845('0x50')]['originalname'];_0x2d42ac[_0x8845('0x4d')][_0x8845('0x51')]=_0x2d42ac[_0x8845('0x50')][_0x8845('0x52')];_0x2d42ac['body'][_0x8845('0x30')]=_0x2d42ac[_0x8845('0x50')]['mimetype'];return db['Attachment'][_0x8845('0x4f')](_0x2d42ac['body'])[_0x8845('0x27')](respondWithResult(_0x28e45c,0xc9))[_0x8845('0x4a')](handleError(_0x28e45c,null));};exports[_0x8845('0x53')]=function(_0x34f776,_0x21e12d,_0x4cf8b1){return db['Attachment'][_0x8845('0x54')]({'where':{'id':_0x34f776[_0x8845('0x47')]['id']},'raw':!![]})[_0x8845('0x27')](handleEntityNotFound(_0x21e12d,null))[_0x8845('0x27')](function(_0x35838b){if(_0x35838b){var _0x17d16e=_0x35838b[_0x8845('0x55')]!==null;var _0x17cb49=path['join'](config[_0x8845('0x56')],'server/files/attachments/');if(_0x17d16e){_0x17cb49=path[_0x8845('0x57')](_0x17cb49,_0x8845('0x58'));}var _0x7063bf=path[_0x8845('0x57')](_0x17cb49,_0x35838b[_0x8845('0x51')]);return _0x21e12d[_0x8845('0x53')](_0x7063bf);}})[_0x8845('0x4a')](handleError(_0x21e12d,null));};
\ No newline at end of file
+var _0x0a4b=['merge','VIRTUAL','options','Attachment','rows','catch','includeAll','include','find','clone','params','get','createdAt','updatedAt','body','omit','create','file','originalname','basename','filename','mimetype','ChatOfflineMessageId','root','server/files/attachments/','join','download','eml-format','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../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','count','limit','Content-Range','apply','reject','save','update','then','destroy','error','stack','name','send','index','rawAttributes','fieldName','type','model','map','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','sort','where','pick','filter'];(function(_0xa5e793,_0x4ab9b3){var _0x3e9490=function(_0x183c7b){while(--_0x183c7b){_0xa5e793['push'](_0xa5e793['shift']());}};_0x3e9490(++_0x4ab9b3);}(_0x0a4b,0x129));var _0xb0a4=function(_0x2e26fb,_0x31bf41){_0x2e26fb=_0x2e26fb-0x0;var _0x19978d=_0x0a4b[_0x2e26fb];return _0x19978d;};'use strict';var emlformat=require(_0xb0a4('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0xb0a4('0x1'));var rp=require(_0xb0a4('0x2'));var moment=require(_0xb0a4('0x3'));var BPromise=require(_0xb0a4('0x4'));var Mustache=require(_0xb0a4('0x5'));var util=require(_0xb0a4('0x6'));var path=require(_0xb0a4('0x7'));var sox=require('sox');var csv=require(_0xb0a4('0x8'));var ejs=require(_0xb0a4('0x9'));var fs=require('fs');var fs_extra=require(_0xb0a4('0xa'));var _=require(_0xb0a4('0xb'));var squel=require(_0xb0a4('0xc'));var crypto=require('crypto');var jsforce=require(_0xb0a4('0xd'));var deskjs=require(_0xb0a4('0xe'));var toCsv=require('to-csv');var querystring=require(_0xb0a4('0xf'));var Papa=require(_0xb0a4('0x10'));var Redis=require(_0xb0a4('0x11'));var authService=require('../../components/auth/service');var qs=require(_0xb0a4('0x12'));var as=require(_0xb0a4('0x13'));var hardwareService=require(_0xb0a4('0x14'));var logger=require(_0xb0a4('0x15'))(_0xb0a4('0x16'));var utils=require(_0xb0a4('0x17'));var config=require(_0xb0a4('0x18'));var licenseUtil=require(_0xb0a4('0x19'));var db=require(_0xb0a4('0x1a'))['db'];function respondWithStatusCode(_0x5a605e,_0xdf3368){_0xdf3368=_0xdf3368||0xcc;return function(_0x54a648){if(_0x54a648){return _0x5a605e[_0xb0a4('0x1b')](_0xdf3368);}return _0x5a605e[_0xb0a4('0x1c')](_0xdf3368)[_0xb0a4('0x1d')]();};}function respondWithResult(_0x40932e,_0x522f3d){_0x522f3d=_0x522f3d||0xc8;return function(_0x33f1b9){if(_0x33f1b9){return _0x40932e['status'](_0x522f3d)[_0xb0a4('0x1e')](_0x33f1b9);}};}function respondWithFilteredResult(_0x4a183a,_0x2aa9c9){return function(_0x385fe5){if(_0x385fe5){var _0x15ceee=typeof _0x2aa9c9[_0xb0a4('0x1f')]==='undefined'&&typeof _0x2aa9c9['limit']==='undefined';var _0x50147e=_0x385fe5[_0xb0a4('0x20')];var _0x46bd79=_0x15ceee?0x0:_0x2aa9c9[_0xb0a4('0x1f')];var _0x1b0cb7=_0x15ceee?_0x385fe5[_0xb0a4('0x20')]:_0x2aa9c9['offset']+_0x2aa9c9[_0xb0a4('0x21')];var _0x1dac36;if(_0x1b0cb7>=_0x50147e){_0x1b0cb7=_0x50147e;_0x1dac36=0xc8;}else{_0x1dac36=0xce;}_0x4a183a['status'](_0x1dac36);return _0x4a183a['set'](_0xb0a4('0x22'),_0x46bd79+'-'+_0x1b0cb7+'/'+_0x50147e)['json'](_0x385fe5);}return null;};}function patchUpdates(_0x1b2620){return function(_0x2fb12d){try{jsonpatch[_0xb0a4('0x23')](_0x2fb12d,_0x1b2620,!![]);}catch(_0x589099){return BPromise[_0xb0a4('0x24')](_0x589099);}return _0x2fb12d[_0xb0a4('0x25')]();};}function saveUpdates(_0x87f3b8,_0x2e30aa){return function(_0xdef65a){if(_0xdef65a){return _0xdef65a[_0xb0a4('0x26')](_0x87f3b8)[_0xb0a4('0x27')](function(_0x309fcd){return _0x309fcd;});}return null;};}function removeEntity(_0x36f6b8,_0x3d90f1){return function(_0x85291c){if(_0x85291c){return _0x85291c[_0xb0a4('0x28')]()[_0xb0a4('0x27')](function(){_0x36f6b8[_0xb0a4('0x1c')](0xcc)[_0xb0a4('0x1d')]();});}};}function handleEntityNotFound(_0x1d5b7f,_0x1675b2){return function(_0x4d0afe){if(!_0x4d0afe){_0x1d5b7f[_0xb0a4('0x1b')](0x194);}return _0x4d0afe;};}function handleError(_0x577d2b,_0x381eac){_0x381eac=_0x381eac||0x1f4;return function(_0x11f178){logger[_0xb0a4('0x29')](_0x11f178[_0xb0a4('0x2a')]);if(_0x11f178[_0xb0a4('0x2b')]){delete _0x11f178[_0xb0a4('0x2b')];}_0x577d2b[_0xb0a4('0x1c')](_0x381eac)[_0xb0a4('0x2c')](_0x11f178);};}exports[_0xb0a4('0x2d')]=function(_0x425347,_0x112a05){var _0x178511={},_0x80e3b7={},_0x4b8b36={'count':0x0,'rows':[]};var _0x4634ba=_['map'](db['Attachment'][_0xb0a4('0x2e')],function(_0x388e4d){return{'name':_0x388e4d[_0xb0a4('0x2f')],'type':_0x388e4d[_0xb0a4('0x30')]['key']};});_0x80e3b7[_0xb0a4('0x31')]=_[_0xb0a4('0x32')](_0x4634ba,_0xb0a4('0x2b'));_0x80e3b7['query']=_[_0xb0a4('0x33')](_0x425347[_0xb0a4('0x34')]);_0x80e3b7[_0xb0a4('0x35')]=_[_0xb0a4('0x36')](_0x80e3b7[_0xb0a4('0x31')],_0x80e3b7[_0xb0a4('0x34')]);_0x178511[_0xb0a4('0x37')]=_['intersection'](_0x80e3b7[_0xb0a4('0x31')],qs[_0xb0a4('0x38')](_0x425347[_0xb0a4('0x34')][_0xb0a4('0x38')]));_0x178511['attributes']=_0x178511[_0xb0a4('0x37')][_0xb0a4('0x39')]?_0x178511[_0xb0a4('0x37')]:_0x80e3b7[_0xb0a4('0x31')];if(!_0x425347['query'][_0xb0a4('0x3a')]('nolimit')){_0x178511[_0xb0a4('0x21')]=qs[_0xb0a4('0x21')](_0x425347[_0xb0a4('0x34')][_0xb0a4('0x21')]);_0x178511[_0xb0a4('0x1f')]=qs['offset'](_0x425347['query'][_0xb0a4('0x1f')]);}_0x178511['order']=qs[_0xb0a4('0x3b')](_0x425347['query'][_0xb0a4('0x3b')]);_0x178511[_0xb0a4('0x3c')]=qs[_0xb0a4('0x35')](_[_0xb0a4('0x3d')](_0x425347[_0xb0a4('0x34')],_0x80e3b7[_0xb0a4('0x35')]),_0x4634ba);if(_0x425347['query'][_0xb0a4('0x3e')]){_0x178511[_0xb0a4('0x3c')]=_[_0xb0a4('0x3f')](_0x178511[_0xb0a4('0x3c')],{'$or':_['map'](_0x4634ba,function(_0x4bd2bf){if(_0x4bd2bf[_0xb0a4('0x30')]!==_0xb0a4('0x40')){var _0x51c0da={};_0x51c0da[_0x4bd2bf[_0xb0a4('0x2b')]]={'$like':'%'+_0x425347[_0xb0a4('0x34')][_0xb0a4('0x3e')]+'%'};return _0x51c0da;}})});}_0x178511=_['merge']({},_0x178511,_0x425347[_0xb0a4('0x41')]);var _0x1545d7={'where':_0x178511[_0xb0a4('0x3c')]};return db[_0xb0a4('0x42')][_0xb0a4('0x20')](_0x1545d7)[_0xb0a4('0x27')](function(_0x9c1fbe){_0x4b8b36[_0xb0a4('0x20')]=_0x9c1fbe;if(_0x425347['query']['includeAll']){_0x178511['include']=[{'all':!![]}];}return db[_0xb0a4('0x42')]['findAll'](_0x178511);})['then'](function(_0x512d82){_0x4b8b36[_0xb0a4('0x43')]=_0x512d82;return _0x4b8b36;})['then'](respondWithFilteredResult(_0x112a05,_0x178511))[_0xb0a4('0x44')](handleError(_0x112a05,null));};exports['show']=function(_0x2c3e93,_0x356f7f){var _0x308a26={'raw':!![],'where':{'id':_0x2c3e93['params']['id']}},_0x22b88a={};_0x22b88a['model']=_['keys'](db[_0xb0a4('0x42')][_0xb0a4('0x2e')]);_0x22b88a[_0xb0a4('0x34')]=_[_0xb0a4('0x33')](_0x2c3e93[_0xb0a4('0x34')]);_0x22b88a['filters']=_[_0xb0a4('0x36')](_0x22b88a[_0xb0a4('0x31')],_0x22b88a[_0xb0a4('0x34')]);_0x308a26[_0xb0a4('0x37')]=_[_0xb0a4('0x36')](_0x22b88a[_0xb0a4('0x31')],qs[_0xb0a4('0x38')](_0x2c3e93[_0xb0a4('0x34')][_0xb0a4('0x38')]));_0x308a26[_0xb0a4('0x37')]=_0x308a26[_0xb0a4('0x37')][_0xb0a4('0x39')]?_0x308a26[_0xb0a4('0x37')]:_0x22b88a[_0xb0a4('0x31')];if(_0x2c3e93[_0xb0a4('0x34')][_0xb0a4('0x45')]){_0x308a26[_0xb0a4('0x46')]=[{'all':!![]}];}_0x308a26=_[_0xb0a4('0x3f')]({},_0x308a26,_0x2c3e93[_0xb0a4('0x41')]);return db['Attachment'][_0xb0a4('0x47')](_0x308a26)[_0xb0a4('0x27')](handleEntityNotFound(_0x356f7f,null))[_0xb0a4('0x27')](respondWithResult(_0x356f7f,null))[_0xb0a4('0x44')](handleError(_0x356f7f,null));};exports[_0xb0a4('0x48')]=function(_0x1212f4,_0x2112d8){var _0x14357e={'where':{'id':_0x1212f4[_0xb0a4('0x49')]['id']}},_0x668623={};_0x668623[_0xb0a4('0x31')]=_[_0xb0a4('0x33')](db[_0xb0a4('0x42')][_0xb0a4('0x2e')]);_0x14357e[_0xb0a4('0x37')]=_[_0xb0a4('0x36')](_0x668623[_0xb0a4('0x31')],qs['fields'](_0x1212f4[_0xb0a4('0x34')][_0xb0a4('0x38')]));_0x14357e[_0xb0a4('0x37')]=_0x14357e['attributes'][_0xb0a4('0x39')]?_0x14357e[_0xb0a4('0x37')]:_0x668623[_0xb0a4('0x31')];if(_0x1212f4[_0xb0a4('0x34')]['includeAll']){_0x14357e['include']=[{'all':!![]}];}_0x14357e=_[_0xb0a4('0x3f')]({},_0x14357e,_0x1212f4['options']);return db['Attachment'][_0xb0a4('0x47')](_0x14357e)[_0xb0a4('0x27')](handleEntityNotFound(_0x2112d8,null))[_0xb0a4('0x27')](function(_0x36939e){if(_0x36939e){var _0x3c7b78=_0x36939e[_0xb0a4('0x4a')]({'plain':!![]});_0x3c7b78=qs['omit'](_0x3c7b78,['id',_0xb0a4('0x4b'),_0xb0a4('0x4c')]);_0x1212f4[_0xb0a4('0x4d')]=_[_0xb0a4('0x4e')](_0x1212f4[_0xb0a4('0x4d')],['id','createdAt',_0xb0a4('0x4c')]);return db[_0xb0a4('0x42')][_0xb0a4('0x4f')](_[_0xb0a4('0x3f')](_0x3c7b78,_0x1212f4[_0xb0a4('0x4d')]),{'include':_0x1212f4[_0xb0a4('0x34')][_0xb0a4('0x45')]?[{'all':!![]}]:undefined});}})[_0xb0a4('0x27')](respondWithResult(_0x2112d8,0xc9))[_0xb0a4('0x44')](handleError(_0x2112d8,null));};exports[_0xb0a4('0x26')]=function(_0x44e0be,_0x39dd14){if(_0x44e0be[_0xb0a4('0x4d')]['id']){delete _0x44e0be[_0xb0a4('0x4d')]['id'];}return db[_0xb0a4('0x42')]['find']({'where':{'id':_0x44e0be[_0xb0a4('0x49')]['id']}})[_0xb0a4('0x27')](handleEntityNotFound(_0x39dd14,null))[_0xb0a4('0x27')](saveUpdates(_0x44e0be[_0xb0a4('0x4d')],null))[_0xb0a4('0x27')](respondWithResult(_0x39dd14,null))[_0xb0a4('0x44')](handleError(_0x39dd14,null));};exports['destroy']=function(_0x3f5a55,_0x419543){return db[_0xb0a4('0x42')][_0xb0a4('0x47')]({'where':{'id':_0x3f5a55['params']['id']}})[_0xb0a4('0x27')](handleEntityNotFound(_0x419543,null))[_0xb0a4('0x27')](removeEntity(_0x419543,null))[_0xb0a4('0x44')](handleError(_0x419543,null));};exports['create']=function(_0x20c137,_0x42a52d,_0x5d8cb4){_0x20c137[_0xb0a4('0x4d')][_0xb0a4('0x2b')]=_0x20c137[_0xb0a4('0x50')][_0xb0a4('0x51')];_0x20c137[_0xb0a4('0x4d')][_0xb0a4('0x52')]=_0x20c137[_0xb0a4('0x50')][_0xb0a4('0x53')];_0x20c137[_0xb0a4('0x4d')][_0xb0a4('0x30')]=_0x20c137[_0xb0a4('0x50')][_0xb0a4('0x54')];return db[_0xb0a4('0x42')][_0xb0a4('0x4f')](_0x20c137['body'])[_0xb0a4('0x27')](respondWithResult(_0x42a52d,0xc9))[_0xb0a4('0x44')](handleError(_0x42a52d,null));};exports['download']=function(_0x55d7c8,_0x5d2081,_0x41146d){return db[_0xb0a4('0x42')]['findOne']({'where':{'id':_0x55d7c8['params']['id']},'raw':!![]})['then'](handleEntityNotFound(_0x5d2081,null))[_0xb0a4('0x27')](function(_0x279c65){if(_0x279c65){var _0x412be6=_0x279c65[_0xb0a4('0x55')]!==null;var _0x354cbf=path['join'](config[_0xb0a4('0x56')],_0xb0a4('0x57'));if(_0x412be6){_0x354cbf=path[_0xb0a4('0x58')](_0x354cbf,'offline-chat/');}var _0x4b9def=path[_0xb0a4('0x58')](_0x354cbf,_0x279c65[_0xb0a4('0x52')]);return _0x5d2081[_0xb0a4('0x59')](_0x4b9def);}})['catch'](handleError(_0x5d2081,null));};
\ No newline at end of file
diff --git a/server/api/attachment/attachment.model.js b/server/api/attachment/attachment.model.js
index 6cd9d47..3725a93 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 _0x3bcd=['attachments','lodash','moment','request-promise','path','rimraf','../../config/environment','exports','define'];(function(_0x418347,_0x309966){var _0x5d17e6=function(_0x57064c){while(--_0x57064c){_0x418347['push'](_0x418347['shift']());}};_0x5d17e6(++_0x309966);}(_0x3bcd,0x118));var _0xd3bc=function(_0x2acbb3,_0x29e1b4){_0x2acbb3=_0x2acbb3-0x0;var _0x5c0cc7=_0x3bcd[_0x2acbb3];return _0x5c0cc7;};'use strict';var _=require(_0xd3bc('0x0'));var util=require('util');var logger=require('../../config/logger')('api');var moment=require(_0xd3bc('0x1'));var BPromise=require('bluebird');var rp=require(_0xd3bc('0x2'));var fs=require('fs');var path=require(_0xd3bc('0x3'));var rimraf=require(_0xd3bc('0x4'));var config=require(_0xd3bc('0x5'));var attributes=require('./attachment.attributes');module[_0xd3bc('0x6')]=function(_0x3ef738,_0x5aba9d){return _0x3ef738[_0xd3bc('0x7')]('Attachment',attributes,{'tableName':_0xd3bc('0x8'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xb72b=['./attachment.attributes','exports','attachments','util','../../config/logger','api','request-promise','path','../../config/environment'];(function(_0x288867,_0x5c48a8){var _0x1a6b2e=function(_0x546727){while(--_0x546727){_0x288867['push'](_0x288867['shift']());}};_0x1a6b2e(++_0x5c48a8);}(_0xb72b,0x1a1));var _0xbb72=function(_0x559209,_0x2b2ecf){_0x559209=_0x559209-0x0;var _0x234e76=_0xb72b[_0x559209];return _0x234e76;};'use strict';var _=require('lodash');var util=require(_0xbb72('0x0'));var logger=require(_0xbb72('0x1'))(_0xbb72('0x2'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0xbb72('0x3'));var fs=require('fs');var path=require(_0xbb72('0x4'));var rimraf=require('rimraf');var config=require(_0xbb72('0x5'));var attributes=require(_0xbb72('0x6'));module[_0xbb72('0x7')]=function(_0x5808d3,_0x528024){return _0x5808d3['define']('Attachment',attributes,{'tableName':_0xbb72('0x8'),'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 6ac86ed..5c991fc 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 _0x0e9f=['info','request\x20sent','debug','Attachment,\x20%s,\x20%s,\x20%s','stringify','error','code','Attachment,\x20%s,\x20%s','message','catch','CreateAttachment','create','body','options','lodash','util','randomstring','../../config/utils','../../config/environment','jayson/promise','http','then'];(function(_0x10c9d1,_0x456b1b){var _0x517fad=function(_0x58a7de){while(--_0x58a7de){_0x10c9d1['push'](_0x10c9d1['shift']());}};_0x517fad(++_0x456b1b);}(_0x0e9f,0x116));var _0xf0e9=function(_0x25dcea,_0x4b9d89){_0x25dcea=_0x25dcea-0x0;var _0x5cb527=_0x0e9f[_0x25dcea];return _0x5cb527;};'use strict';var _=require(_0xf0e9('0x0'));var util=require(_0xf0e9('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0xf0e9('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0xf0e9('0x3'));var logger=require('../../config/logger')('rpc');var config=require(_0xf0e9('0x4'));var jayson=require(_0xf0e9('0x5'));var client=jayson['client'][_0xf0e9('0x6')]({'port':0x232a});function respondWithRpcPromise(_0x4a35a3,_0x3f9792,_0x2fa08f){return new BPromise(function(_0x106ba0,_0x58edfe){return client['request'](_0x4a35a3,_0x2fa08f)[_0xf0e9('0x7')](function(_0x7b3146){logger[_0xf0e9('0x8')]('Attachment,\x20%s,\x20%s',_0x3f9792,_0xf0e9('0x9'));logger[_0xf0e9('0xa')](_0xf0e9('0xb'),_0x3f9792,'request\x20sent',JSON[_0xf0e9('0xc')](_0x7b3146));if(_0x7b3146[_0xf0e9('0xd')]){if(_0x7b3146[_0xf0e9('0xd')][_0xf0e9('0xe')]===0x1f4){logger['error'](_0xf0e9('0xf'),_0x3f9792,_0x7b3146['error'][_0xf0e9('0x10')]);return _0x58edfe(_0x7b3146[_0xf0e9('0xd')]['message']);}logger[_0xf0e9('0xd')](_0xf0e9('0xf'),_0x3f9792,_0x7b3146[_0xf0e9('0xd')][_0xf0e9('0x10')]);return _0x106ba0(_0x7b3146[_0xf0e9('0xd')][_0xf0e9('0x10')]);}else{logger['info'](_0xf0e9('0xf'),_0x3f9792,_0xf0e9('0x9'));_0x106ba0(_0x7b3146['result'][_0xf0e9('0x10')]);}})[_0xf0e9('0x11')](function(_0x3d0b4d){logger[_0xf0e9('0xd')]('Attachment,\x20%s,\x20%s',_0x3f9792,_0x3d0b4d);_0x58edfe(_0x3d0b4d);});});}exports[_0xf0e9('0x12')]=function(_0x2f4ee3){var _0x232115=this;return new Promise(function(_0x2987a1,_0x5444bc){return db['Attachment'][_0xf0e9('0x13')](_0x2f4ee3[_0xf0e9('0x14')],{'raw':_0x2f4ee3[_0xf0e9('0x15')]?_0x2f4ee3['options']['raw']===undefined?!![]:![]:!![]})[_0xf0e9('0x7')](function(_0x1ac91f){logger['info'](_0xf0e9('0x12'),_0x2f4ee3);logger['debug'](_0xf0e9('0x12'),_0x2f4ee3,JSON[_0xf0e9('0xc')](_0x1ac91f));_0x2987a1(_0x1ac91f);})['catch'](function(_0x5dd652){logger[_0xf0e9('0xd')](_0xf0e9('0x12'),_0x5dd652['message'],_0x2f4ee3);_0x5444bc(_0x232115[_0xf0e9('0xd')](0x1f4,_0x5dd652[_0xf0e9('0x10')]));});});};
\ No newline at end of file
+var _0xcabc=['error','code','message','result','catch','CreateAttachment','Attachment','create','body','raw','then','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','request','info','Attachment,\x20%s,\x20%s','request\x20sent','debug','stringify'];(function(_0x3f1041,_0x3c9c76){var _0xb29e0f=function(_0x60db72){while(--_0x60db72){_0x3f1041['push'](_0x3f1041['shift']());}};_0xb29e0f(++_0x3c9c76);}(_0xcabc,0x16a));var _0xccab=function(_0x19950b,_0x53d0d7){_0x19950b=_0x19950b-0x0;var _0x3c6b41=_0xcabc[_0x19950b];return _0x3c6b41;};'use strict';var _=require('lodash');var util=require(_0xccab('0x0'));var moment=require(_0xccab('0x1'));var BPromise=require(_0xccab('0x2'));var rs=require(_0xccab('0x3'));var fs=require('fs');var Redis=require(_0xccab('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0xccab('0x5'));var logger=require(_0xccab('0x6'))('rpc');var config=require(_0xccab('0x7'));var jayson=require(_0xccab('0x8'));var client=jayson[_0xccab('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x112ab8,_0x29f877,_0x24b95c){return new BPromise(function(_0x4a6f3c,_0x2c43fa){return client[_0xccab('0xa')](_0x112ab8,_0x24b95c)['then'](function(_0x401b85){logger[_0xccab('0xb')](_0xccab('0xc'),_0x29f877,_0xccab('0xd'));logger[_0xccab('0xe')]('Attachment,\x20%s,\x20%s,\x20%s',_0x29f877,'request\x20sent',JSON[_0xccab('0xf')](_0x401b85));if(_0x401b85[_0xccab('0x10')]){if(_0x401b85[_0xccab('0x10')][_0xccab('0x11')]===0x1f4){logger[_0xccab('0x10')](_0xccab('0xc'),_0x29f877,_0x401b85[_0xccab('0x10')]['message']);return _0x2c43fa(_0x401b85[_0xccab('0x10')][_0xccab('0x12')]);}logger['error'](_0xccab('0xc'),_0x29f877,_0x401b85['error']['message']);return _0x4a6f3c(_0x401b85[_0xccab('0x10')][_0xccab('0x12')]);}else{logger[_0xccab('0xb')]('Attachment,\x20%s,\x20%s',_0x29f877,_0xccab('0xd'));_0x4a6f3c(_0x401b85[_0xccab('0x13')]['message']);}})[_0xccab('0x14')](function(_0x333142){logger[_0xccab('0x10')](_0xccab('0xc'),_0x29f877,_0x333142);_0x2c43fa(_0x333142);});});}exports[_0xccab('0x15')]=function(_0x5157c6){var _0x4ba1c2=this;return new Promise(function(_0x1960e7,_0x5e1eeb){return db[_0xccab('0x16')][_0xccab('0x17')](_0x5157c6[_0xccab('0x18')],{'raw':_0x5157c6['options']?_0x5157c6['options'][_0xccab('0x19')]===undefined?!![]:![]:!![]})[_0xccab('0x1a')](function(_0x459090){logger['info'](_0xccab('0x15'),_0x5157c6);logger['debug'](_0xccab('0x15'),_0x5157c6,JSON[_0xccab('0xf')](_0x459090));_0x1960e7(_0x459090);})['catch'](function(_0x32c852){logger[_0xccab('0x10')](_0xccab('0x15'),_0x32c852[_0xccab('0x12')],_0x5157c6);_0x5e1eeb(_0x4ba1c2[_0xccab('0x10')](0x1f4,_0x32c852[_0xccab('0x12')]));});});};
\ No newline at end of file
diff --git a/server/api/attachment/index.js b/server/api/attachment/index.js
index 6b58d80..3b9a467 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 _0x0b0e=['/:id/clone','clone','diskStorage','join','server/files/attachments/','format','now','originalname','replace','single','create','/:id','delete','destroy','multer','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./attachment.controller','get','isAuthenticated','index','show','/:id/download','post'];(function(_0x2555d0,_0x4150a6){var _0x3bb486=function(_0x1eb89f){while(--_0x1eb89f){_0x2555d0['push'](_0x2555d0['shift']());}};_0x3bb486(++_0x4150a6);}(_0x0b0e,0x187));var _0xe0b0=function(_0x4bdf64,_0x3022b2){_0x4bdf64=_0x4bdf64-0x0;var _0x9a1a19=_0x0b0e[_0x4bdf64];return _0x9a1a19;};'use strict';var multer=require(_0xe0b0('0x0'));var util=require('util');var path=require(_0xe0b0('0x1'));var timeout=require('connect-timeout');var express=require(_0xe0b0('0x2'));var router=express[_0xe0b0('0x3')]();var fs_extra=require(_0xe0b0('0x4'));var auth=require(_0xe0b0('0x5'));var interaction=require(_0xe0b0('0x6'));var config=require(_0xe0b0('0x7'));var controller=require(_0xe0b0('0x8'));router[_0xe0b0('0x9')]('/',auth[_0xe0b0('0xa')](),controller[_0xe0b0('0xb')]);router[_0xe0b0('0x9')]('/:id',auth['isAuthenticated'](),controller[_0xe0b0('0xc')]);router[_0xe0b0('0x9')](_0xe0b0('0xd'),auth[_0xe0b0('0xa')](),controller['download']);router[_0xe0b0('0xe')](_0xe0b0('0xf'),auth['isAuthenticated'](),controller[_0xe0b0('0x10')]);var upload=multer({'storage':multer[_0xe0b0('0x11')]({'destination':function(_0x574d96,_0x399320,_0x2cdad2){_0x2cdad2(null,path[_0xe0b0('0x12')](config['root'],_0xe0b0('0x13')));},'filename':function(_0x1c358a,_0x3cc19a,_0x45f914){_0x45f914(null,util[_0xe0b0('0x14')]('%s-%s',Date[_0xe0b0('0x15')](),_0x3cc19a[_0xe0b0('0x16')][_0xe0b0('0x17')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-')));}})});router[_0xe0b0('0xe')]('/',upload[_0xe0b0('0x18')]('file'),controller[_0xe0b0('0x19')]);router['put'](_0xe0b0('0x1a'),auth[_0xe0b0('0xa')](),controller['update']);router[_0xe0b0('0x1b')]('/:id',auth[_0xe0b0('0xa')](),controller[_0xe0b0('0x1c')]);module['exports']=router;
\ No newline at end of file
+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(_0x2103a3,_0x588bd6){var _0x2f7915=function(_0x44bab4){while(--_0x44bab4){_0x2103a3['push'](_0x2103a3['shift']());}};_0x2f7915(++_0x588bd6);}(_0xb10b,0x12a));var _0xbb10=function(_0x430524,_0x23b611){_0x430524=_0x430524-0x0;var _0x3a726d=_0xb10b[_0x430524];return _0x3a726d;};'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
diff --git a/server/api/authGoogle/authGoogle.controller.js b/server/api/authGoogle/authGoogle.controller.js
index eb7aa5b..f23085a 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 _0x0ee7=['agent','blocked','minutes','Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.','clearBlockUser','getLicense','lodash','passport','moment','../../config/environment','../../components/auth/service','signToken','login','authenticate','google','/login','email','callback','use','clientID','secret','callbackURL','Setting','allowedLoginAttempts','blockDuration','then','User','find','map','emails','user'];(function(_0xa464c9,_0x7c86d8){var _0x3d73c4=function(_0x5c2056){while(--_0x5c2056){_0xa464c9['push'](_0xa464c9['shift']());}};_0x3d73c4(++_0x7c86d8);}(_0x0ee7,0x82));var _0x70ee=function(_0x14ed05,_0x5c55c4){_0x14ed05=_0x14ed05-0x0;var _0x2ea7c6=_0x0ee7[_0x14ed05];return _0x2ea7c6;};'use strict';var _=require(_0x70ee('0x0'));var passport=require(_0x70ee('0x1'));var GoogleStrategy=require('passport-google-oauth20')['Strategy'];var moment=require(_0x70ee('0x2'));var db=require('../../mysqldb')['db'];var config=require(_0x70ee('0x3'));var signToken=require(_0x70ee('0x4'))[_0x70ee('0x5')];var utils=require('../../config/utils');exports[_0x70ee('0x6')]=passport[_0x70ee('0x7')](_0x70ee('0x8'),{'failureRedirect':_0x70ee('0x9'),'scope':['profile',_0x70ee('0xa')],'session':![]});exports[_0x70ee('0xb')]=passport[_0x70ee('0x7')](_0x70ee('0x8'),{'failureRedirect':_0x70ee('0x9'),'session':![]});passport[_0x70ee('0xc')](new GoogleStrategy({'clientID':config[_0x70ee('0x8')]?config[_0x70ee('0x8')][_0x70ee('0xd')]:'id','clientSecret':config['google']?config[_0x70ee('0x8')]['clientSecret']:_0x70ee('0xe'),'callbackURL':config[_0x70ee('0x8')]?config['google'][_0x70ee('0xf')]:''},function(_0x560b3e,_0x5eda1d,_0xbc488c,_0x1070e1){var _0x432738,_0x3d8b5d;return db[_0x70ee('0x10')]['findOne']({'where':{'id':0x1},'attributes':[_0x70ee('0x11'),_0x70ee('0x12')],'raw':!![]})[_0x70ee('0x13')](function(_0x4e2b4b){_0x432738=_0x4e2b4b;return db[_0x70ee('0x14')][_0x70ee('0x15')]({'where':{'email':_[_0x70ee('0x16')](_0xbc488c[_0x70ee('0x17')],'value'),'role':{'$or':['admin',_0x70ee('0x18'),_0x70ee('0x19')]}}});})[_0x70ee('0x13')](function(_0x199c04){_0x3d8b5d=_0x199c04;if(_0x3d8b5d){if(_0x3d8b5d['disabled']){return _0x1070e1('Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.');}else if(_0x432738[_0x70ee('0x12')]>0x0){if(_0x3d8b5d[_0x70ee('0x1a')]){if(moment(_0x3d8b5d['blockedAt'])['add'](_0x432738[_0x70ee('0x12')],_0x70ee('0x1b'))>moment()){return _0x1070e1(_0x70ee('0x1c'));}else{return utils[_0x70ee('0x1d')](_0x3d8b5d,0x0,![],null)[_0x70ee('0x13')](function(){return utils[_0x70ee('0x1e')](_0x3d8b5d);})[_0x70ee('0x13')](function(){return _0x1070e1(null,_0x3d8b5d);});}}else{return utils['getLicense'](_0x3d8b5d)['then'](function(){return _0x1070e1(null,_0x3d8b5d);});}}else{return utils[_0x70ee('0x1e')](_0x3d8b5d)[_0x70ee('0x13')](function(){return _0x1070e1(null,_0x3d8b5d);});}}return _0x1070e1(_0x70ee('0x1c'));})['catch'](function(_0x5bb12e){_0x1070e1(_0x5bb12e);});}));
\ No newline at end of file
+var _0xfc46=['Strategy','moment','../../mysqldb','../../config/environment','signToken','../../config/utils','login','authenticate','google','profile','email','/login','use','clientID','clientSecret','secret','callbackURL','findOne','allowedLoginAttempts','blockDuration','then','User','find','map','value','admin','user','agent','Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.','blocked','add','minutes','clearBlockUser','getLicense','lodash','passport-google-oauth20'];(function(_0x1e4b5a,_0x3e8dcc){var _0x2abfce=function(_0x5a667e){while(--_0x5a667e){_0x1e4b5a['push'](_0x1e4b5a['shift']());}};_0x2abfce(++_0x3e8dcc);}(_0xfc46,0x18a));var _0x6fc4=function(_0x1b4c04,_0x8d961d){_0x1b4c04=_0x1b4c04-0x0;var _0x374f5d=_0xfc46[_0x1b4c04];return _0x374f5d;};'use strict';var _=require(_0x6fc4('0x0'));var passport=require('passport');var GoogleStrategy=require(_0x6fc4('0x1'))[_0x6fc4('0x2')];var moment=require(_0x6fc4('0x3'));var db=require(_0x6fc4('0x4'))['db'];var config=require(_0x6fc4('0x5'));var signToken=require('../../components/auth/service')[_0x6fc4('0x6')];var utils=require(_0x6fc4('0x7'));exports[_0x6fc4('0x8')]=passport[_0x6fc4('0x9')](_0x6fc4('0xa'),{'failureRedirect':'/login','scope':[_0x6fc4('0xb'),_0x6fc4('0xc')],'session':![]});exports['callback']=passport[_0x6fc4('0x9')](_0x6fc4('0xa'),{'failureRedirect':_0x6fc4('0xd'),'session':![]});passport[_0x6fc4('0xe')](new GoogleStrategy({'clientID':config['google']?config[_0x6fc4('0xa')][_0x6fc4('0xf')]:'id','clientSecret':config['google']?config[_0x6fc4('0xa')][_0x6fc4('0x10')]:_0x6fc4('0x11'),'callbackURL':config[_0x6fc4('0xa')]?config['google'][_0x6fc4('0x12')]:''},function(_0x559173,_0x2840e7,_0x48bba9,_0x333eb9){var _0x3e022b,_0x4d5cc5;return db['Setting'][_0x6fc4('0x13')]({'where':{'id':0x1},'attributes':[_0x6fc4('0x14'),_0x6fc4('0x15')],'raw':!![]})[_0x6fc4('0x16')](function(_0x163a8){_0x3e022b=_0x163a8;return db[_0x6fc4('0x17')][_0x6fc4('0x18')]({'where':{'email':_[_0x6fc4('0x19')](_0x48bba9['emails'],_0x6fc4('0x1a')),'role':{'$or':[_0x6fc4('0x1b'),_0x6fc4('0x1c'),_0x6fc4('0x1d')]}}});})[_0x6fc4('0x16')](function(_0x32302a){_0x4d5cc5=_0x32302a;if(_0x4d5cc5){if(_0x4d5cc5['disabled']){return _0x333eb9(_0x6fc4('0x1e'));}else if(_0x3e022b['blockDuration']>0x0){if(_0x4d5cc5[_0x6fc4('0x1f')]){if(moment(_0x4d5cc5['blockedAt'])[_0x6fc4('0x20')](_0x3e022b[_0x6fc4('0x15')],_0x6fc4('0x21'))>moment()){return _0x333eb9(_0x6fc4('0x1e'));}else{return utils[_0x6fc4('0x22')](_0x4d5cc5,0x0,![],null)[_0x6fc4('0x16')](function(){return utils['getLicense'](_0x4d5cc5);})[_0x6fc4('0x16')](function(){return _0x333eb9(null,_0x4d5cc5);});}}else{return utils[_0x6fc4('0x23')](_0x4d5cc5)['then'](function(){return _0x333eb9(null,_0x4d5cc5);});}}else{return utils[_0x6fc4('0x23')](_0x4d5cc5)[_0x6fc4('0x16')](function(){return _0x333eb9(null,_0x4d5cc5);});}}return _0x333eb9(_0x6fc4('0x1e'));})['catch'](function(_0x3dfdc5){_0x333eb9(_0x3dfdc5);});}));
\ No newline at end of file
diff --git a/server/api/authGoogle/index.js b/server/api/authGoogle/index.js
index 47ed3a5..a2e391e 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 _0x08bb=['login','setTokenCookie','exports','express','passport','./authGoogle.controller','../user/user.controller.js','../../components/auth/service','get','/callback','callback','isMiddleware'];(function(_0x7bc63a,_0x26422a){var _0xed898e=function(_0x4a222a){while(--_0x4a222a){_0x7bc63a['push'](_0x7bc63a['shift']());}};_0xed898e(++_0x26422a);}(_0x08bb,0x177));var _0xb08b=function(_0x13e741,_0x5d3c24){_0x13e741=_0x13e741-0x0;var _0x3f8bb3=_0x08bb[_0x13e741];return _0x3f8bb3;};'use strict';var express=require(_0xb08b('0x0'));var passport=require(_0xb08b('0x1'));var router=express['Router']();var controller=require(_0xb08b('0x2'));var userController=require(_0xb08b('0x3'));var authService=require(_0xb08b('0x4'));router[_0xb08b('0x5')]('/',controller['login']);router[_0xb08b('0x5')](_0xb08b('0x6'),controller[_0xb08b('0x7')],authService[_0xb08b('0x8')],userController[_0xb08b('0x9')],authService[_0xb08b('0xa')]);module[_0xb08b('0xb')]=router;
\ No newline at end of file
+var _0xba07=['isMiddleware','setTokenCookie','exports','express','passport','Router','./authGoogle.controller','../user/user.controller.js','../../components/auth/service','get','login','/callback','callback'];(function(_0x43bb39,_0x19e9dd){var _0x52cdba=function(_0x4f071d){while(--_0x4f071d){_0x43bb39['push'](_0x43bb39['shift']());}};_0x52cdba(++_0x19e9dd);}(_0xba07,0xc6));var _0x7ba0=function(_0x2932d9,_0x431abd){_0x2932d9=_0x2932d9-0x0;var _0x2cc783=_0xba07[_0x2932d9];return _0x2cc783;};'use strict';var express=require(_0x7ba0('0x0'));var passport=require(_0x7ba0('0x1'));var router=express[_0x7ba0('0x2')]();var controller=require(_0x7ba0('0x3'));var userController=require(_0x7ba0('0x4'));var authService=require(_0x7ba0('0x5'));router[_0x7ba0('0x6')]('/',controller[_0x7ba0('0x7')]);router[_0x7ba0('0x6')](_0x7ba0('0x8'),controller[_0x7ba0('0x9')],authService[_0x7ba0('0xa')],userController['login'],authService[_0x7ba0('0xb')]);module[_0x7ba0('0xc')]=router;
\ No newline at end of file
diff --git a/server/api/authLocal/authLocal.controller.js b/server/api/authLocal/authLocal.controller.js
index 7c312ad..12e7378 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 _0x6489=['secure','user','pass','\x22%s\x22\x20<%s>','SendMail','error','SendMail\x20error:\x20%s.\x20Please\x20contact\x20your\x20Administrator!','message','stringify','status','login','local','Something\x20went\x20wrong,\x20please\x20try\x20again.','role','signToken','online','forgot','body','generate','trim','toLowerCase','User','find','This\x20email\x20is\x20not\x20registered.','The\x20user\x20is\x20disabled.\x20Please\x20contact\x20the\x20administrator.','The\x20user\x20is\x20blocked.\x20Please\x20contact\x20the\x20administrator.','resetPasswordToken','resetPasswordExpires','save','You\x20are\x20receiving\x20this\x20because\x20you\x20(or\x20someone\x20else)\x20have\x20requested\x20the\x20reset\x20of\x20the\x20password\x20for\x20your\x20account.\x0a\x0a','headers','host','/reset/','If\x20you\x20did\x20not\x20request\x20this,\x20please\x20ignore\x20this\x20email\x20and\x20your\x20password\x20will\x20remain\x20unchanged.\x0a','send','reset','params','token','now','Password\x20reset\x20token\x20is\x20invalid\x20or\x20has\x20expired.','securePassword','enforcePasswordHistory','validatePasswordPattern','password','Password\x20reset!','use','util','passport-local','Strategy','jayson/promise','lodash','randomstring','moment','../../mysqldb','../../components/auth/service','../../config/utils','http','Setting','findOne','allowedLoginAttempts','then','name','salt','blocked','blockedAt','loginAttempts','Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.','authenticate','disabled','blockDuration','minutes','clearBlockUser','add','getLicense','catch','MailAccount','email','MailServerOut','Unable\x20to\x20find\x20a\x20configured\x20SMTP\x20service!','Smtp','service','port'];(function(_0x3af00b,_0x4aeeaa){var _0x48df81=function(_0x3d0cc7){while(--_0x3d0cc7){_0x3af00b['push'](_0x3af00b['shift']());}};_0x48df81(++_0x4aeeaa);}(_0x6489,0x124));var _0x9648=function(_0x20d579,_0x3f72ea){_0x20d579=_0x20d579-0x0;var _0x5e46a9=_0x6489[_0x20d579];return _0x5e46a9;};'use strict';var util=require(_0x9648('0x0'));var passport=require('passport');var LocalStrategy=require(_0x9648('0x1'))[_0x9648('0x2')];var jayson=require(_0x9648('0x3'));var _=require(_0x9648('0x4'));var rs=require(_0x9648('0x5'));var moment=require(_0x9648('0x6'));var db=require(_0x9648('0x7'))['db'];var authService=require(_0x9648('0x8'));var utils=require(_0x9648('0x9'));var client=jayson['client'][_0x9648('0xa')]({'port':0x232b});function localAuthenticate(_0x311100,_0x5b4d0a,_0x1bc58b,_0x30fb87){var _0x32fa7b,_0xd9e838;return db[_0x9648('0xb')][_0x9648('0xc')]({'where':{'id':0x1},'attributes':[_0x9648('0xd'),'blockDuration'],'raw':!![]})[_0x9648('0xe')](function(_0x3fb805){_0x32fa7b=_0x3fb805;return _0x311100[_0x9648('0xc')]({'attributes':['id',_0x9648('0xf'),'password',_0x9648('0x10'),'role','disabled',_0x9648('0x11'),_0x9648('0x12'),_0x9648('0x13')],'where':{'name':_0x5b4d0a,'role':{'$or':['admin','user','agent']}}});})['then'](function(_0x2ef816){if(!_0x2ef816||_0x2ef816&&_0x2ef816[_0x9648('0xf')]!==_0x5b4d0a){throw new Error(_0x9648('0x14'));}else{_0xd9e838=_0x2ef816;return _0xd9e838;}})[_0x9648('0xe')](function(){_0xd9e838[_0x9648('0x15')](_0x1bc58b,function(_0x233785,_0x37f2c8){var _0x28f84f=_0xd9e838[_0x9648('0x13')]+0x1;if(_0x233785){return _0x30fb87(_0x233785);}else if(!_0x37f2c8){if(_0xd9e838[_0x9648('0x16')]){return _0x30fb87(null,![],{'message':_0x9648('0x14')});}else if(_0x32fa7b[_0x9648('0xd')]>0x0){if(_0xd9e838[_0x9648('0x11')]){if(_0x32fa7b[_0x9648('0x17')]>0x0){if(moment(_0xd9e838[_0x9648('0x12')])['add'](_0x32fa7b[_0x9648('0x17')],_0x9648('0x18'))>moment()){return _0x30fb87(null,![],{'message':_0x9648('0x14')});}else{return utils['clearBlockUser'](_0xd9e838,_0x28f84f,![],null)['then'](function(){return _0x30fb87(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});});}}else{return _0x30fb87(null,![],{'message':_0x9648('0x14')});}}else{if(_0x28f84f>=_0x32fa7b[_0x9648('0xd')]){return utils[_0x9648('0x19')](_0xd9e838,0x0,!![],moment())['then'](function(){return _0x30fb87(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});});}else{return utils['clearBlockUser'](_0xd9e838,_0x28f84f,![],null)[_0x9648('0xe')](function(){return _0x30fb87(null,![],{'message':_0x9648('0x14')});});}}}else{return _0x30fb87(null,![],{'message':_0x9648('0x14')});}}else{if(_0xd9e838[_0x9648('0x16')]){return _0x30fb87(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});}else if(_0x32fa7b['allowedLoginAttempts']>0x0){if(_0xd9e838[_0x9648('0x11')]){if(_0x32fa7b['blockDuration']>0x0){if(moment(_0xd9e838[_0x9648('0x12')])[_0x9648('0x1a')](_0x32fa7b[_0x9648('0x17')],_0x9648('0x18'))>moment()){return _0x30fb87(null,![],{'message':_0x9648('0x14')});}else{return utils[_0x9648('0x19')](_0xd9e838,0x0,![],null)[_0x9648('0xe')](function(){return utils[_0x9648('0x1b')](_0xd9e838);})[_0x9648('0xe')](function(){return _0x30fb87(null,_0xd9e838);});}}else{return _0x30fb87(null,![],{'message':_0x9648('0x14')});}}else{return utils[_0x9648('0x19')](_0xd9e838,0x0,![],null)['then'](function(){return utils[_0x9648('0x1b')](_0xd9e838);})[_0x9648('0xe')](function(){return _0x30fb87(null,_0xd9e838);})[_0x9648('0x1c')](function(_0x39463b){return _0x30fb87(null,![],_0x39463b);});}}else{if(_0xd9e838[_0x9648('0x11')]){return _0x30fb87(null,![],{'message':_0x9648('0x14')});}else{return utils[_0x9648('0x1b')](_0xd9e838)[_0x9648('0xe')](function(){return _0x30fb87(null,_0xd9e838);});}}}});})[_0x9648('0x1c')](function(_0x3e6840){return _0x30fb87(null,![],_0x3e6840);});}function sendServiceMail(_0x11c5d5){return db[_0x9648('0x1d')]['find']({'where':{'service':!![]},'attributes':['id',_0x9648('0xf'),_0x9648('0x1e')],'include':[{'model':db[_0x9648('0x1f')],'as':'Smtp'}]})[_0x9648('0xe')](function(_0x20d2df){if(!_0x20d2df){throw new Error(_0x9648('0x20'));}var _0xea458b={'tls':{'rejectUnauthorized':![]}};if(_0x20d2df[_0x9648('0x21')]['service']){_0xea458b[_0x9648('0x22')]=_0x20d2df[_0x9648('0x21')][_0x9648('0x22')];}else{_0xea458b['host']=_0x20d2df['Smtp']['host'];_0xea458b['port']=_0x20d2df[_0x9648('0x21')][_0x9648('0x23')];_0xea458b[_0x9648('0x24')]=_0x20d2df[_0x9648('0x21')][_0x9648('0x24')];}if(_0x20d2df['Smtp']['authentication']){_0xea458b['auth']={'user':_0x20d2df[_0x9648('0x21')][_0x9648('0x25')],'pass':_0x20d2df[_0x9648('0x21')][_0x9648('0x26')]};}var _0x370694={'account':_0xea458b,'message':_['merge']({'from':util['format'](_0x9648('0x27'),_0x20d2df['name'],_0x20d2df[_0x9648('0x1e')]||_0x20d2df['Smtp'][_0x9648('0x25')])},_0x11c5d5)};return client['request'](_0x9648('0x28'),_0x370694);})[_0x9648('0xe')](function(_0x14b44b){if(_0x14b44b[_0x9648('0x29')]){throw new Error(util['format'](_0x9648('0x2a'),_0x14b44b['error'][_0x9648('0x2b')]||JSON[_0x9648('0x2c')](_0x14b44b[_0x9648('0x29')])));}return!![];});}function handleError(_0x49c068,_0x367606,_0x30ff05){return _0x49c068[_0x9648('0x2d')](_0x367606||0x1f4)['send']({'message':_0x30ff05?_0x30ff05[_0x9648('0x2b')]||_0x30ff05:''});}exports[_0x9648('0x2e')]=function(_0x3a4f14,_0x551ce7,_0x1c41ee){passport[_0x9648('0x15')](_0x9648('0x2f'),function(_0x16b1fa,_0x5300bc,_0x2cefd5){var _0x417389=_0x16b1fa||_0x2cefd5;if(_0x417389){return handleError(_0x551ce7,0x191,_0x417389);}if(!_0x5300bc){return handleError(_0x551ce7,0x194,{'message':_0x9648('0x30')});}else{var _0x4d3f32={'payload':{'id':_0x5300bc['id'],'role':_0x5300bc[_0x9648('0x31')]},'options':{'expiresIn':0x15180}};return authService[_0x9648('0x32')](_0x4d3f32)['then'](function(_0xad2988){_0x551ce7['json']({'id':_0x5300bc['id'],'token':_0xad2988,'statusCall':'','isAlreadyLogged':_0x5300bc[_0x9648('0x33')]});});}})(_0x3a4f14,_0x551ce7,_0x1c41ee);};exports[_0x9648('0x34')]=function(_0x4d0bd0,_0x474702,_0x337cf8){if(!_0x4d0bd0[_0x9648('0x35')][_0x9648('0x1e')]){return handleError(_0x474702,0x1f4,{'message':'Email\x20parameter\x20is\x20missing'});}var _0x483bd6=rs[_0x9648('0x36')]();_0x4d0bd0['body'][_0x9648('0x1e')]=_0x4d0bd0[_0x9648('0x35')][_0x9648('0x1e')][_0x9648('0x37')]()[_0x9648('0x38')]();var _0x5a98f9;return db[_0x9648('0xb')]['findOne']({'where':{'id':0x1},'attributes':[_0x9648('0xd'),_0x9648('0x17')],'raw':!![]})[_0x9648('0xe')](function(_0x1fda9a){_0x5a98f9=_0x1fda9a;return db[_0x9648('0x39')][_0x9648('0x3a')]({'where':{'email':_0x4d0bd0[_0x9648('0x35')][_0x9648('0x1e')]}});})[_0x9648('0xe')](function(_0xc556dd){if(!_0xc556dd){throw new Error(_0x9648('0x3b'));}if(_0xc556dd['disabled']){throw new Error(_0x9648('0x3c'));}if(_0xc556dd[_0x9648('0x11')]){if(moment(_0xc556dd['blockedAt'])[_0x9648('0x1a')](_0x5a98f9[_0x9648('0x17')],_0x9648('0x18'))>moment()){throw new Error(_0x9648('0x3d'));}else{_0xc556dd['blocked']=![];_0xc556dd['blockedAt']=null;}}_0xc556dd[_0x9648('0x3e')]=_0x483bd6;_0xc556dd[_0x9648('0x3f')]=Date['now']()+0x36ee80;return _0xc556dd[_0x9648('0x40')]();})['then'](function(){return sendServiceMail({'to':_0x4d0bd0[_0x9648('0x35')][_0x9648('0x1e')],'subject':'xCally\x20Motion\x20Password\x20Reset','text':_0x9648('0x41')+'Please\x20click\x20on\x20the\x20following\x20link,\x20or\x20paste\x20this\x20into\x20your\x20browser\x20to\x20complete\x20the\x20process:\x0a\x0a'+'https://'+_0x4d0bd0[_0x9648('0x42')][_0x9648('0x43')]+_0x9648('0x44')+_0x483bd6+'\x0a\x0a'+_0x9648('0x45')});})[_0x9648('0xe')](function(){_0x474702[_0x9648('0x2d')](0xc8)[_0x9648('0x46')]({'message':'Reset\x20Email\x20sent!'});})[_0x9648('0x1c')](function(_0x4205ac){return handleError(_0x474702,0x1f4,_0x4205ac);});};exports[_0x9648('0x47')]=function(_0x8c9fde,_0x598a9a,_0x2f3976){return db['User'][_0x9648('0x3a')]({'where':{'resetPasswordToken':_0x8c9fde[_0x9648('0x48')][_0x9648('0x49')],'resetPasswordExpires':{'$gt':Date[_0x9648('0x4a')]()}}})[_0x9648('0xe')](function(_0x33e932){if(!_0x33e932){throw new Error(_0x9648('0x4b'));}return db[_0x9648('0xb')][_0x9648('0xc')]({'attributes':['id',_0x9648('0x4c'),_0x9648('0x4d'),'passwordHistoryLimit']})[_0x9648('0xe')](function(_0x41cc1d){if(_0x41cc1d[_0x9648('0x4c')])authService[_0x9648('0x4e')](_0x8c9fde['body']['password']);if(!_0x41cc1d['enforcePasswordHistory']||!_0x33e932['previousPasswords'])return _0x33e932;authService['validatePasswordHistory'](_0x8c9fde[_0x9648('0x35')][_0x9648('0x4f')],_0x33e932['previousPasswords'],_0x41cc1d['passwordHistoryLimit']);return _0x33e932;})[_0x9648('0xe')](function(){_0x33e932[_0x9648('0x4f')]=_0x8c9fde[_0x9648('0x35')]['password'];_0x33e932['resetPasswordToken']=null;_0x33e932[_0x9648('0x3f')]=null;return _0x33e932['save']();});})[_0x9648('0xe')](function(){_0x598a9a[_0x9648('0x2d')](0xc8)['send']({'message':_0x9648('0x50')});})[_0x9648('0x1c')](function(_0x4916fa){return handleError(_0x598a9a,0x1f4,_0x4916fa);});};passport[_0x9648('0x51')](new LocalStrategy({'usernameField':_0x9648('0xf'),'passwordField':'password'},function(_0x41f98a,_0x379190,_0x1c47e1){return localAuthenticate(db[_0x9648('0x39')],_0x41f98a,_0x379190,_0x1c47e1);}));
\ No newline at end of file
+var _0x5615=['jayson/promise','lodash','randomstring','../../mysqldb','../../components/auth/service','../../config/utils','http','Setting','allowedLoginAttempts','blockDuration','then','name','salt','disabled','blocked','blockedAt','loginAttempts','admin','user','agent','authenticate','Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.','add','minutes','clearBlockUser','getLicense','catch','MailAccount','find','email','Smtp','Unable\x20to\x20find\x20a\x20configured\x20SMTP\x20service!','service','host','port','secure','authentication','auth','merge','format','message','error','status','send','login','Something\x20went\x20wrong,\x20please\x20try\x20again.','role','json','forgot','body','Email\x20parameter\x20is\x20missing','trim','findOne','User','This\x20email\x20is\x20not\x20registered.','The\x20user\x20is\x20disabled.\x20Please\x20contact\x20the\x20administrator.','now','save','xCally\x20Motion\x20Password\x20Reset','You\x20are\x20receiving\x20this\x20because\x20you\x20(or\x20someone\x20else)\x20have\x20requested\x20the\x20reset\x20of\x20the\x20password\x20for\x20your\x20account.\x0a\x0a','Please\x20click\x20on\x20the\x20following\x20link,\x20or\x20paste\x20this\x20into\x20your\x20browser\x20to\x20complete\x20the\x20process:\x0a\x0a','headers','/reset/','If\x20you\x20did\x20not\x20request\x20this,\x20please\x20ignore\x20this\x20email\x20and\x20your\x20password\x20will\x20remain\x20unchanged.\x0a','Reset\x20Email\x20sent!','reset','params','token','Password\x20reset\x20token\x20is\x20invalid\x20or\x20has\x20expired.','securePassword','passwordHistoryLimit','password','enforcePasswordHistory','previousPasswords','validatePasswordHistory','resetPasswordToken','resetPasswordExpires','Password\x20reset!','use','util','passport'];(function(_0x57b54c,_0x54ce0d){var _0x59cc19=function(_0xa33bc6){while(--_0xa33bc6){_0x57b54c['push'](_0x57b54c['shift']());}};_0x59cc19(++_0x54ce0d);}(_0x5615,0xa0));var _0x5561=function(_0x5b36a3,_0x1c2b4d){_0x5b36a3=_0x5b36a3-0x0;var _0x1f3838=_0x5615[_0x5b36a3];return _0x1f3838;};'use strict';var util=require(_0x5561('0x0'));var passport=require(_0x5561('0x1'));var LocalStrategy=require('passport-local')['Strategy'];var jayson=require(_0x5561('0x2'));var _=require(_0x5561('0x3'));var rs=require(_0x5561('0x4'));var moment=require('moment');var db=require(_0x5561('0x5'))['db'];var authService=require(_0x5561('0x6'));var utils=require(_0x5561('0x7'));var client=jayson['client'][_0x5561('0x8')]({'port':0x232b});function localAuthenticate(_0x1ef83c,_0xf685a2,_0x87bae,_0x4c03f0){var _0x7bdaa,_0x5756d1;return db[_0x5561('0x9')]['findOne']({'where':{'id':0x1},'attributes':[_0x5561('0xa'),_0x5561('0xb')],'raw':!![]})[_0x5561('0xc')](function(_0x30bac3){_0x7bdaa=_0x30bac3;return _0x1ef83c['findOne']({'attributes':['id',_0x5561('0xd'),'password',_0x5561('0xe'),'role',_0x5561('0xf'),_0x5561('0x10'),_0x5561('0x11'),_0x5561('0x12')],'where':{'name':_0xf685a2,'role':{'$or':[_0x5561('0x13'),_0x5561('0x14'),_0x5561('0x15')]}}});})[_0x5561('0xc')](function(_0x45cfef){if(!_0x45cfef||_0x45cfef&&_0x45cfef[_0x5561('0xd')]!==_0xf685a2){throw new Error('Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.');}else{_0x5756d1=_0x45cfef;return _0x5756d1;}})[_0x5561('0xc')](function(){_0x5756d1[_0x5561('0x16')](_0x87bae,function(_0xa8f217,_0x284403){var _0x4e08e7=_0x5756d1[_0x5561('0x12')]+0x1;if(_0xa8f217){return _0x4c03f0(_0xa8f217);}else if(!_0x284403){if(_0x5756d1[_0x5561('0xf')]){return _0x4c03f0(null,![],{'message':_0x5561('0x17')});}else if(_0x7bdaa['allowedLoginAttempts']>0x0){if(_0x5756d1['blocked']){if(_0x7bdaa[_0x5561('0xb')]>0x0){if(moment(_0x5756d1[_0x5561('0x11')])[_0x5561('0x18')](_0x7bdaa[_0x5561('0xb')],_0x5561('0x19'))>moment()){return _0x4c03f0(null,![],{'message':_0x5561('0x17')});}else{return utils['clearBlockUser'](_0x5756d1,_0x4e08e7,![],null)[_0x5561('0xc')](function(){return _0x4c03f0(null,![],{'message':_0x5561('0x17')});});}}else{return _0x4c03f0(null,![],{'message':_0x5561('0x17')});}}else{if(_0x4e08e7>=_0x7bdaa[_0x5561('0xa')]){return utils[_0x5561('0x1a')](_0x5756d1,0x0,!![],moment())[_0x5561('0xc')](function(){return _0x4c03f0(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});});}else{return utils['clearBlockUser'](_0x5756d1,_0x4e08e7,![],null)[_0x5561('0xc')](function(){return _0x4c03f0(null,![],{'message':_0x5561('0x17')});});}}}else{return _0x4c03f0(null,![],{'message':_0x5561('0x17')});}}else{if(_0x5756d1[_0x5561('0xf')]){return _0x4c03f0(null,![],{'message':_0x5561('0x17')});}else if(_0x7bdaa[_0x5561('0xa')]>0x0){if(_0x5756d1['blocked']){if(_0x7bdaa[_0x5561('0xb')]>0x0){if(moment(_0x5756d1[_0x5561('0x11')])[_0x5561('0x18')](_0x7bdaa[_0x5561('0xb')],_0x5561('0x19'))>moment()){return _0x4c03f0(null,![],{'message':_0x5561('0x17')});}else{return utils['clearBlockUser'](_0x5756d1,0x0,![],null)[_0x5561('0xc')](function(){return utils[_0x5561('0x1b')](_0x5756d1);})[_0x5561('0xc')](function(){return _0x4c03f0(null,_0x5756d1);});}}else{return _0x4c03f0(null,![],{'message':_0x5561('0x17')});}}else{return utils[_0x5561('0x1a')](_0x5756d1,0x0,![],null)[_0x5561('0xc')](function(){return utils['getLicense'](_0x5756d1);})['then'](function(){return _0x4c03f0(null,_0x5756d1);})[_0x5561('0x1c')](function(_0x42e156){return _0x4c03f0(null,![],_0x42e156);});}}else{if(_0x5756d1['blocked']){return _0x4c03f0(null,![],{'message':_0x5561('0x17')});}else{return utils[_0x5561('0x1b')](_0x5756d1)[_0x5561('0xc')](function(){return _0x4c03f0(null,_0x5756d1);});}}}});})['catch'](function(_0x18c6c1){return _0x4c03f0(null,![],_0x18c6c1);});}function sendServiceMail(_0x103c27){return db[_0x5561('0x1d')][_0x5561('0x1e')]({'where':{'service':!![]},'attributes':['id',_0x5561('0xd'),_0x5561('0x1f')],'include':[{'model':db['MailServerOut'],'as':_0x5561('0x20')}]})[_0x5561('0xc')](function(_0x57ec55){if(!_0x57ec55){throw new Error(_0x5561('0x21'));}var _0x41e876={'tls':{'rejectUnauthorized':![]}};if(_0x57ec55['Smtp'][_0x5561('0x22')]){_0x41e876[_0x5561('0x22')]=_0x57ec55[_0x5561('0x20')][_0x5561('0x22')];}else{_0x41e876['host']=_0x57ec55['Smtp'][_0x5561('0x23')];_0x41e876['port']=_0x57ec55[_0x5561('0x20')][_0x5561('0x24')];_0x41e876[_0x5561('0x25')]=_0x57ec55[_0x5561('0x20')][_0x5561('0x25')];}if(_0x57ec55[_0x5561('0x20')][_0x5561('0x26')]){_0x41e876[_0x5561('0x27')]={'user':_0x57ec55[_0x5561('0x20')][_0x5561('0x14')],'pass':_0x57ec55[_0x5561('0x20')]['pass']};}var _0x172d96={'account':_0x41e876,'message':_[_0x5561('0x28')]({'from':util[_0x5561('0x29')]('\x22%s\x22\x20<%s>',_0x57ec55[_0x5561('0xd')],_0x57ec55[_0x5561('0x1f')]||_0x57ec55['Smtp'][_0x5561('0x14')])},_0x103c27)};return client['request']('SendMail',_0x172d96);})[_0x5561('0xc')](function(_0x302c56){if(_0x302c56['error']){throw new Error(util['format']('SendMail\x20error:\x20%s.\x20Please\x20contact\x20your\x20Administrator!',_0x302c56['error'][_0x5561('0x2a')]||JSON['stringify'](_0x302c56[_0x5561('0x2b')])));}return!![];});}function handleError(_0x108cc5,_0x3953af,_0x358175){return _0x108cc5[_0x5561('0x2c')](_0x3953af||0x1f4)[_0x5561('0x2d')]({'message':_0x358175?_0x358175[_0x5561('0x2a')]||_0x358175:''});}exports[_0x5561('0x2e')]=function(_0x2f5952,_0x5eaa88,_0x1d8dfc){passport[_0x5561('0x16')]('local',function(_0x2c4449,_0x36d9a4,_0x4926ea){var _0x360806=_0x2c4449||_0x4926ea;if(_0x360806){return handleError(_0x5eaa88,0x191,_0x360806);}if(!_0x36d9a4){return handleError(_0x5eaa88,0x194,{'message':_0x5561('0x2f')});}else{var _0x5c070b={'payload':{'id':_0x36d9a4['id'],'role':_0x36d9a4[_0x5561('0x30')]},'options':{'expiresIn':0x15180}};return authService['signToken'](_0x5c070b)[_0x5561('0xc')](function(_0x51652c){_0x5eaa88[_0x5561('0x31')]({'id':_0x36d9a4['id'],'token':_0x51652c,'statusCall':'','isAlreadyLogged':_0x36d9a4['online']});});}})(_0x2f5952,_0x5eaa88,_0x1d8dfc);};exports[_0x5561('0x32')]=function(_0x29c957,_0x5c6fdb,_0x57f430){if(!_0x29c957[_0x5561('0x33')][_0x5561('0x1f')]){return handleError(_0x5c6fdb,0x1f4,{'message':_0x5561('0x34')});}var _0x25d8af=rs['generate']();_0x29c957[_0x5561('0x33')][_0x5561('0x1f')]=_0x29c957[_0x5561('0x33')][_0x5561('0x1f')][_0x5561('0x35')]()['toLowerCase']();var _0x274ef2;return db[_0x5561('0x9')][_0x5561('0x36')]({'where':{'id':0x1},'attributes':['allowedLoginAttempts',_0x5561('0xb')],'raw':!![]})[_0x5561('0xc')](function(_0x504925){_0x274ef2=_0x504925;return db[_0x5561('0x37')][_0x5561('0x1e')]({'where':{'email':_0x29c957[_0x5561('0x33')]['email']}});})[_0x5561('0xc')](function(_0x234f2c){if(!_0x234f2c){throw new Error(_0x5561('0x38'));}if(_0x234f2c['disabled']){throw new Error(_0x5561('0x39'));}if(_0x234f2c[_0x5561('0x10')]){if(moment(_0x234f2c[_0x5561('0x11')])['add'](_0x274ef2[_0x5561('0xb')],_0x5561('0x19'))>moment()){throw new Error('The\x20user\x20is\x20blocked.\x20Please\x20contact\x20the\x20administrator.');}else{_0x234f2c['blocked']=![];_0x234f2c[_0x5561('0x11')]=null;}}_0x234f2c['resetPasswordToken']=_0x25d8af;_0x234f2c['resetPasswordExpires']=Date[_0x5561('0x3a')]()+0x36ee80;return _0x234f2c[_0x5561('0x3b')]();})['then'](function(){return sendServiceMail({'to':_0x29c957['body'][_0x5561('0x1f')],'subject':_0x5561('0x3c'),'text':_0x5561('0x3d')+_0x5561('0x3e')+'https://'+_0x29c957[_0x5561('0x3f')][_0x5561('0x23')]+_0x5561('0x40')+_0x25d8af+'\x0a\x0a'+_0x5561('0x41')});})[_0x5561('0xc')](function(){_0x5c6fdb[_0x5561('0x2c')](0xc8)[_0x5561('0x2d')]({'message':_0x5561('0x42')});})[_0x5561('0x1c')](function(_0x3fb4da){return handleError(_0x5c6fdb,0x1f4,_0x3fb4da);});};exports[_0x5561('0x43')]=function(_0x4a5dde,_0x29a70e,_0x525640){return db[_0x5561('0x37')][_0x5561('0x1e')]({'where':{'resetPasswordToken':_0x4a5dde[_0x5561('0x44')][_0x5561('0x45')],'resetPasswordExpires':{'$gt':Date['now']()}}})['then'](function(_0x57dc57){if(!_0x57dc57){throw new Error(_0x5561('0x46'));}return db['Setting']['findOne']({'attributes':['id',_0x5561('0x47'),'enforcePasswordHistory',_0x5561('0x48')]})[_0x5561('0xc')](function(_0x310dbd){if(_0x310dbd[_0x5561('0x47')])authService['validatePasswordPattern'](_0x4a5dde['body'][_0x5561('0x49')]);if(!_0x310dbd[_0x5561('0x4a')]||!_0x57dc57[_0x5561('0x4b')])return _0x57dc57;authService[_0x5561('0x4c')](_0x4a5dde[_0x5561('0x33')]['password'],_0x57dc57[_0x5561('0x4b')],_0x310dbd['passwordHistoryLimit']);return _0x57dc57;})[_0x5561('0xc')](function(){_0x57dc57[_0x5561('0x49')]=_0x4a5dde[_0x5561('0x33')]['password'];_0x57dc57[_0x5561('0x4d')]=null;_0x57dc57[_0x5561('0x4e')]=null;return _0x57dc57[_0x5561('0x3b')]();});})['then'](function(){_0x29a70e['status'](0xc8)[_0x5561('0x2d')]({'message':_0x5561('0x4f')});})['catch'](function(_0x277140){return handleError(_0x29a70e,0x1f4,_0x277140);});};passport[_0x5561('0x50')](new LocalStrategy({'usernameField':_0x5561('0xd'),'passwordField':_0x5561('0x49')},function(_0x9c3f50,_0x2a97ed,_0x3ee911){return localAuthenticate(db['User'],_0x9c3f50,_0x2a97ed,_0x3ee911);}));
\ No newline at end of file
diff --git a/server/api/authLocal/index.js b/server/api/authLocal/index.js
index 3e5ed3e..01075dc 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 _0x780e=['exports','express','Router','./authLocal.controller','post','login','/forgot','forgot','/reset/:token'];(function(_0x42e10b,_0x3b4cbb){var _0x39b5ac=function(_0x1e69f1){while(--_0x1e69f1){_0x42e10b['push'](_0x42e10b['shift']());}};_0x39b5ac(++_0x3b4cbb);}(_0x780e,0x157));var _0xe780=function(_0x2641f9,_0x26715f){_0x2641f9=_0x2641f9-0x0;var _0x585741=_0x780e[_0x2641f9];return _0x585741;};'use strict';var express=require(_0xe780('0x0'));var router=express[_0xe780('0x1')]();var controller=require(_0xe780('0x2'));router[_0xe780('0x3')]('/',controller[_0xe780('0x4')]);router[_0xe780('0x3')](_0xe780('0x5'),controller[_0xe780('0x6')]);router[_0xe780('0x3')](_0xe780('0x7'),controller['reset']);module[_0xe780('0x8')]=router;
\ No newline at end of file
+var _0x56e4=['login','forgot','reset','exports','Router','post'];(function(_0x163157,_0x5408a9){var _0x1eb3ae=function(_0x22f4de){while(--_0x22f4de){_0x163157['push'](_0x163157['shift']());}};_0x1eb3ae(++_0x5408a9);}(_0x56e4,0x166));var _0x456e=function(_0x1827b4,_0x48e579){_0x1827b4=_0x1827b4-0x0;var _0x46ad8f=_0x56e4[_0x1827b4];return _0x46ad8f;};'use strict';var express=require('express');var router=express[_0x456e('0x0')]();var controller=require('./authLocal.controller');router[_0x456e('0x1')]('/',controller[_0x456e('0x2')]);router[_0x456e('0x1')]('/forgot',controller[_0x456e('0x3')]);router[_0x456e('0x1')]('/reset/:token',controller[_0x456e('0x4')]);module[_0x456e('0x5')]=router;
\ No newline at end of file
diff --git a/server/api/automation/automation.attributes.js b/server/api/automation/automation.attributes.js
index 9626bf7..5a82834 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 _0x36e5=['STRING','sequelize','exports'];(function(_0x37f9a0,_0x3d268b){var _0x4f25b5=function(_0x38881a){while(--_0x38881a){_0x37f9a0['push'](_0x37f9a0['shift']());}};_0x4f25b5(++_0x3d268b);}(_0x36e5,0x196));var _0x536e=function(_0x22a8c4,_0x51c09a){_0x22a8c4=_0x22a8c4-0x0;var _0x104c6d=_0x36e5[_0x22a8c4];return _0x104c6d;};'use strict';var Sequelize=require(_0x536e('0x0'));module[_0x536e('0x1')]={'name':{'type':Sequelize[_0x536e('0x2')],'allowNull':![]},'channel':{'type':Sequelize[_0x536e('0x2')]},'description':{'type':Sequelize[_0x536e('0x2')]},'status':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'timeout':{'type':Sequelize['INTEGER'],'defaultValue':0xa}};
\ No newline at end of file
+var _0xbc62=['exports','STRING','INTEGER','sequelize'];(function(_0x38459f,_0x1ac4e4){var _0x5f331c=function(_0x541ed0){while(--_0x541ed0){_0x38459f['push'](_0x38459f['shift']());}};_0x5f331c(++_0x1ac4e4);}(_0xbc62,0x107));var _0x2bc6=function(_0x4244f0,_0x2bb152){_0x4244f0=_0x4244f0-0x0;var _0xec0499=_0xbc62[_0x4244f0];return _0xec0499;};'use strict';var Sequelize=require(_0x2bc6('0x0'));module[_0x2bc6('0x1')]={'name':{'type':Sequelize[_0x2bc6('0x2')],'allowNull':![]},'channel':{'type':Sequelize[_0x2bc6('0x2')]},'description':{'type':Sequelize['STRING']},'status':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'timeout':{'type':Sequelize[_0x2bc6('0x3')],'defaultValue':0xa}};
\ No newline at end of file
diff --git a/server/api/automation/automation.controller.js b/server/api/automation/automation.controller.js
index b0c6652..e0c6245 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 _0x18e5=['body','destroy','addConditions','Condition','find','omit','getConditions','sort','where','addActions','ids','getActions','findOne','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','squel','crypto','desk.js','to-csv','querystring','papaparse','ioredis','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','undefined','limit','count','offset','set','Content-Range','reject','save','update','then','stack','name','send','index','map','Automation','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','pick','merge','VIRTUAL','filter','options','includeAll','include','findAll','rows','catch','show','params','length','create'];(function(_0x5d5b96,_0x2ada70){var _0x177fb5=function(_0x2cdaf8){while(--_0x2cdaf8){_0x5d5b96['push'](_0x5d5b96['shift']());}};_0x177fb5(++_0x2ada70);}(_0x18e5,0x15d));var _0x518e=function(_0x5b644e,_0x2e5e07){_0x5b644e=_0x5b644e-0x0;var _0x49c6bf=_0x18e5[_0x5b644e];return _0x49c6bf;};'use strict';var emlformat=require(_0x518e('0x0'));var rimraf=require(_0x518e('0x1'));var zipdir=require(_0x518e('0x2'));var jsonpatch=require(_0x518e('0x3'));var rp=require(_0x518e('0x4'));var moment=require(_0x518e('0x5'));var BPromise=require(_0x518e('0x6'));var Mustache=require(_0x518e('0x7'));var util=require(_0x518e('0x8'));var path=require(_0x518e('0x9'));var sox=require(_0x518e('0xa'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0x518e('0xb'));var crypto=require(_0x518e('0xc'));var jsforce=require('jsforce');var deskjs=require(_0x518e('0xd'));var toCsv=require(_0x518e('0xe'));var querystring=require(_0x518e('0xf'));var Papa=require(_0x518e('0x10'));var Redis=require(_0x518e('0x11'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x518e('0x12'));var logger=require('../../config/logger')(_0x518e('0x13'));var utils=require(_0x518e('0x14'));var config=require(_0x518e('0x15'));var licenseUtil=require(_0x518e('0x16'));var db=require(_0x518e('0x17'))['db'];function respondWithStatusCode(_0x356840,_0x4843ac){_0x4843ac=_0x4843ac||0xcc;return function(_0x3838ba){if(_0x3838ba){return _0x356840[_0x518e('0x18')](_0x4843ac);}return _0x356840[_0x518e('0x19')](_0x4843ac)[_0x518e('0x1a')]();};}function respondWithResult(_0x2a73c8,_0x5b233f){_0x5b233f=_0x5b233f||0xc8;return function(_0x45fba4){if(_0x45fba4){return _0x2a73c8[_0x518e('0x19')](_0x5b233f)['json'](_0x45fba4);}};}function respondWithFilteredResult(_0x400ed5,_0xcf7a51){return function(_0x5beb2a){if(_0x5beb2a){var _0x80572b=typeof _0xcf7a51['offset']===_0x518e('0x1b')&&typeof _0xcf7a51[_0x518e('0x1c')]===_0x518e('0x1b');var _0x435cbc=_0x5beb2a[_0x518e('0x1d')];var _0x52dfae=_0x80572b?0x0:_0xcf7a51['offset'];var _0x5174e8=_0x80572b?_0x5beb2a[_0x518e('0x1d')]:_0xcf7a51[_0x518e('0x1e')]+_0xcf7a51[_0x518e('0x1c')];var _0x3d8489;if(_0x5174e8>=_0x435cbc){_0x5174e8=_0x435cbc;_0x3d8489=0xc8;}else{_0x3d8489=0xce;}_0x400ed5[_0x518e('0x19')](_0x3d8489);return _0x400ed5[_0x518e('0x1f')](_0x518e('0x20'),_0x52dfae+'-'+_0x5174e8+'/'+_0x435cbc)['json'](_0x5beb2a);}return null;};}function patchUpdates(_0x63f2a8){return function(_0xc91c6a){try{jsonpatch['apply'](_0xc91c6a,_0x63f2a8,!![]);}catch(_0xbdd433){return BPromise[_0x518e('0x21')](_0xbdd433);}return _0xc91c6a[_0x518e('0x22')]();};}function saveUpdates(_0x3fb5d7,_0x247705){return function(_0x2e4e00){if(_0x2e4e00){return _0x2e4e00[_0x518e('0x23')](_0x3fb5d7)[_0x518e('0x24')](function(_0x50ea8b){return _0x50ea8b;});}return null;};}function removeEntity(_0x41c283,_0x91cb61){return function(_0x564f46){if(_0x564f46){return _0x564f46['destroy']()['then'](function(){_0x41c283[_0x518e('0x19')](0xcc)['end']();});}};}function handleEntityNotFound(_0x375c1f,_0xfd1682){return function(_0x33c4b9){if(!_0x33c4b9){_0x375c1f[_0x518e('0x18')](0x194);}return _0x33c4b9;};}function handleError(_0x3f7101,_0x436661){_0x436661=_0x436661||0x1f4;return function(_0x162acb){logger['error'](_0x162acb[_0x518e('0x25')]);if(_0x162acb[_0x518e('0x26')]){delete _0x162acb[_0x518e('0x26')];}_0x3f7101['status'](_0x436661)[_0x518e('0x27')](_0x162acb);};}exports[_0x518e('0x28')]=function(_0x44c7e8,_0x455d29){var _0x531cc3={},_0x4a91b6={},_0x2f295f={'count':0x0,'rows':[]};var _0x479045=_[_0x518e('0x29')](db[_0x518e('0x2a')][_0x518e('0x2b')],function(_0x48672b){return{'name':_0x48672b[_0x518e('0x2c')],'type':_0x48672b[_0x518e('0x2d')][_0x518e('0x2e')]};});_0x4a91b6[_0x518e('0x2f')]=_['map'](_0x479045,_0x518e('0x26'));_0x4a91b6[_0x518e('0x30')]=_[_0x518e('0x31')](_0x44c7e8['query']);_0x4a91b6[_0x518e('0x32')]=_[_0x518e('0x33')](_0x4a91b6['model'],_0x4a91b6['query']);_0x531cc3[_0x518e('0x34')]=_[_0x518e('0x33')](_0x4a91b6[_0x518e('0x2f')],qs[_0x518e('0x35')](_0x44c7e8[_0x518e('0x30')][_0x518e('0x35')]));_0x531cc3[_0x518e('0x34')]=_0x531cc3['attributes']['length']?_0x531cc3['attributes']:_0x4a91b6[_0x518e('0x2f')];if(!_0x44c7e8['query'][_0x518e('0x36')](_0x518e('0x37'))){_0x531cc3['limit']=qs[_0x518e('0x1c')](_0x44c7e8['query'][_0x518e('0x1c')]);_0x531cc3[_0x518e('0x1e')]=qs['offset'](_0x44c7e8[_0x518e('0x30')][_0x518e('0x1e')]);}_0x531cc3[_0x518e('0x38')]=qs['sort'](_0x44c7e8[_0x518e('0x30')]['sort']);_0x531cc3['where']=qs[_0x518e('0x32')](_[_0x518e('0x39')](_0x44c7e8[_0x518e('0x30')],_0x4a91b6[_0x518e('0x32')]),_0x479045);if(_0x44c7e8[_0x518e('0x30')]['filter']){_0x531cc3['where']=_[_0x518e('0x3a')](_0x531cc3['where'],{'$or':_[_0x518e('0x29')](_0x479045,function(_0x125195){if(_0x125195['type']!==_0x518e('0x3b')){var _0xdeb55d={};_0xdeb55d[_0x125195[_0x518e('0x26')]]={'$like':'%'+_0x44c7e8['query'][_0x518e('0x3c')]+'%'};return _0xdeb55d;}})});}_0x531cc3=_[_0x518e('0x3a')]({},_0x531cc3,_0x44c7e8[_0x518e('0x3d')]);var _0x2db1c7={'where':_0x531cc3['where']};return db[_0x518e('0x2a')][_0x518e('0x1d')](_0x2db1c7)[_0x518e('0x24')](function(_0xb66644){_0x2f295f[_0x518e('0x1d')]=_0xb66644;if(_0x44c7e8[_0x518e('0x30')][_0x518e('0x3e')]){_0x531cc3[_0x518e('0x3f')]=[{'all':!![]}];}return db[_0x518e('0x2a')][_0x518e('0x40')](_0x531cc3);})['then'](function(_0x492ea8){_0x2f295f[_0x518e('0x41')]=_0x492ea8;return _0x2f295f;})[_0x518e('0x24')](respondWithFilteredResult(_0x455d29,_0x531cc3))[_0x518e('0x42')](handleError(_0x455d29,null));};exports[_0x518e('0x43')]=function(_0x448ec5,_0x3a4bea){var _0x1da45c={'raw':![],'where':{'id':_0x448ec5[_0x518e('0x44')]['id']}},_0x2a3267={};_0x2a3267[_0x518e('0x2f')]=_[_0x518e('0x31')](db[_0x518e('0x2a')][_0x518e('0x2b')]);_0x2a3267[_0x518e('0x30')]=_['keys'](_0x448ec5[_0x518e('0x30')]);_0x2a3267[_0x518e('0x32')]=_[_0x518e('0x33')](_0x2a3267[_0x518e('0x2f')],_0x2a3267[_0x518e('0x30')]);_0x1da45c['attributes']=_[_0x518e('0x33')](_0x2a3267['model'],qs[_0x518e('0x35')](_0x448ec5[_0x518e('0x30')][_0x518e('0x35')]));_0x1da45c[_0x518e('0x34')]=_0x1da45c[_0x518e('0x34')][_0x518e('0x45')]?_0x1da45c[_0x518e('0x34')]:_0x2a3267['model'];if(_0x448ec5[_0x518e('0x30')][_0x518e('0x3e')]){_0x1da45c[_0x518e('0x3f')]=[{'all':!![]}];}_0x1da45c=_['merge']({},_0x1da45c,_0x448ec5['options']);return db[_0x518e('0x2a')]['find'](_0x1da45c)[_0x518e('0x24')](handleEntityNotFound(_0x3a4bea,null))['then'](respondWithResult(_0x3a4bea,null))[_0x518e('0x42')](handleError(_0x3a4bea,null));};exports[_0x518e('0x46')]=function(_0x40f2ef,_0x5c0b33){return db[_0x518e('0x2a')][_0x518e('0x46')](_0x40f2ef['body'],{})[_0x518e('0x24')](respondWithResult(_0x5c0b33,0xc9))['catch'](handleError(_0x5c0b33,null));};exports[_0x518e('0x23')]=function(_0x7e759e,_0x1a6304){if(_0x7e759e[_0x518e('0x47')]['id']){delete _0x7e759e[_0x518e('0x47')]['id'];}return db['Automation']['find']({'where':{'id':_0x7e759e['params']['id']}})[_0x518e('0x24')](handleEntityNotFound(_0x1a6304,null))['then'](saveUpdates(_0x7e759e['body'],null))[_0x518e('0x24')](respondWithResult(_0x1a6304,null))['catch'](handleError(_0x1a6304,null));};exports[_0x518e('0x48')]=function(_0x5b5cdc,_0x445649){return db['Automation']['find']({'where':{'id':_0x5b5cdc['params']['id']}})['then'](handleEntityNotFound(_0x445649,null))[_0x518e('0x24')](removeEntity(_0x445649,null))[_0x518e('0x42')](handleError(_0x445649,null));};exports[_0x518e('0x49')]=function(_0x5b342e,_0x48e6eb,_0x31f9ab){return db[_0x518e('0x4a')][_0x518e('0x4b')]({'where':{'id':_0x5b342e[_0x518e('0x44')]['id']}})[_0x518e('0x24')](handleEntityNotFound(_0x48e6eb,null))[_0x518e('0x24')](function(_0x5cee06){if(_0x5cee06){return _0x5cee06[_0x518e('0x49')](_0x5b342e[_0x518e('0x47')]['ids'],_[_0x518e('0x4c')](_0x5b342e[_0x518e('0x47')],['ids','id'])||{});}})[_0x518e('0x24')](respondWithResult(_0x48e6eb,null))[_0x518e('0x42')](handleError(_0x48e6eb,null));};exports[_0x518e('0x4d')]=function(_0x437c6a,_0x29ce5f,_0x35e641){var _0x105e11={};var _0x5b9b31={};var _0x4d4d19;var _0x43b5d7;return db['Automation']['findOne']({'where':{'id':_0x437c6a[_0x518e('0x44')]['id']}})[_0x518e('0x24')](handleEntityNotFound(_0x29ce5f,null))[_0x518e('0x24')](function(_0x402149){if(_0x402149){_0x4d4d19=_0x402149;_0x5b9b31['model']=_[_0x518e('0x31')](db[_0x518e('0x4a')][_0x518e('0x2b')]);_0x5b9b31['query']=_['keys'](_0x437c6a['query']);_0x5b9b31[_0x518e('0x32')]=_['intersection'](_0x5b9b31[_0x518e('0x2f')],_0x5b9b31[_0x518e('0x30')]);_0x105e11[_0x518e('0x34')]=_[_0x518e('0x33')](_0x5b9b31[_0x518e('0x2f')],qs[_0x518e('0x35')](_0x437c6a[_0x518e('0x30')][_0x518e('0x35')]));_0x105e11[_0x518e('0x34')]=_0x105e11[_0x518e('0x34')][_0x518e('0x45')]?_0x105e11[_0x518e('0x34')]:_0x5b9b31[_0x518e('0x2f')];_0x105e11[_0x518e('0x38')]=qs[_0x518e('0x4e')](_0x437c6a['query'][_0x518e('0x4e')]);_0x105e11[_0x518e('0x4f')]=qs[_0x518e('0x32')](_[_0x518e('0x39')](_0x437c6a['query'],_0x5b9b31[_0x518e('0x32')]));if(_0x437c6a[_0x518e('0x30')][_0x518e('0x3c')]){_0x105e11[_0x518e('0x4f')]=_[_0x518e('0x3a')](_0x105e11[_0x518e('0x4f')],{'$or':_[_0x518e('0x29')](_0x105e11['attributes'],function(_0x1dbfc8){var _0x10cd29={};_0x10cd29[_0x1dbfc8]={'$like':'%'+_0x437c6a['query'][_0x518e('0x3c')]+'%'};return _0x10cd29;})});}_0x105e11=_[_0x518e('0x3a')]({},_0x105e11,_0x437c6a[_0x518e('0x3d')]);return _0x4d4d19['getConditions'](_0x105e11);}})[_0x518e('0x24')](function(_0x1d6126){if(_0x1d6126){_0x43b5d7=_0x1d6126[_0x518e('0x45')];if(!_0x437c6a[_0x518e('0x30')]['hasOwnProperty']('nolimit')){_0x105e11[_0x518e('0x1c')]=qs[_0x518e('0x1c')](_0x437c6a['query'][_0x518e('0x1c')]);_0x105e11[_0x518e('0x1e')]=qs['offset'](_0x437c6a[_0x518e('0x30')][_0x518e('0x1e')]);}return _0x4d4d19[_0x518e('0x4d')](_0x105e11);}})[_0x518e('0x24')](function(_0x48762f){if(_0x48762f){return _0x48762f?{'count':_0x43b5d7,'rows':_0x48762f}:null;}})['then'](respondWithResult(_0x29ce5f,null))[_0x518e('0x42')](handleError(_0x29ce5f,null));};exports[_0x518e('0x50')]=function(_0x251a07,_0x33f2ab,_0x3131ec){return db['Action'][_0x518e('0x4b')]({'where':{'id':_0x251a07[_0x518e('0x44')]['id']}})[_0x518e('0x24')](handleEntityNotFound(_0x33f2ab,null))['then'](function(_0x22131e){if(_0x22131e){return _0x22131e['addActions'](_0x251a07['body'][_0x518e('0x51')],_[_0x518e('0x4c')](_0x251a07['body'],[_0x518e('0x51'),'id'])||{});}})[_0x518e('0x24')](respondWithResult(_0x33f2ab,null))[_0x518e('0x42')](handleError(_0x33f2ab,null));};exports[_0x518e('0x52')]=function(_0x254bef,_0x41f57d,_0x71b7a2){var _0x54e851={};var _0x450331={};var _0x5a7d58;var _0x3ba8d5;return db[_0x518e('0x2a')][_0x518e('0x53')]({'where':{'id':_0x254bef['params']['id']}})[_0x518e('0x24')](handleEntityNotFound(_0x41f57d,null))['then'](function(_0x5525c4){if(_0x5525c4){_0x5a7d58=_0x5525c4;_0x450331[_0x518e('0x2f')]=_[_0x518e('0x31')](db['Action'][_0x518e('0x2b')]);_0x450331[_0x518e('0x30')]=_[_0x518e('0x31')](_0x254bef[_0x518e('0x30')]);_0x450331[_0x518e('0x32')]=_['intersection'](_0x450331[_0x518e('0x2f')],_0x450331[_0x518e('0x30')]);_0x54e851[_0x518e('0x34')]=_[_0x518e('0x33')](_0x450331[_0x518e('0x2f')],qs[_0x518e('0x35')](_0x254bef['query'][_0x518e('0x35')]));_0x54e851[_0x518e('0x34')]=_0x54e851[_0x518e('0x34')]['length']?_0x54e851[_0x518e('0x34')]:_0x450331['model'];_0x54e851[_0x518e('0x38')]=qs[_0x518e('0x4e')](_0x254bef[_0x518e('0x30')][_0x518e('0x4e')]);_0x54e851[_0x518e('0x4f')]=qs['filters'](_[_0x518e('0x39')](_0x254bef['query'],_0x450331[_0x518e('0x32')]));if(_0x254bef[_0x518e('0x30')]['filter']){_0x54e851['where']=_[_0x518e('0x3a')](_0x54e851['where'],{'$or':_['map'](_0x54e851[_0x518e('0x34')],function(_0x997419){var _0x41f574={};_0x41f574[_0x997419]={'$like':'%'+_0x254bef[_0x518e('0x30')]['filter']+'%'};return _0x41f574;})});}_0x54e851=_[_0x518e('0x3a')]({},_0x54e851,_0x254bef[_0x518e('0x3d')]);return _0x5a7d58[_0x518e('0x52')](_0x54e851);}})[_0x518e('0x24')](function(_0x4ea054){if(_0x4ea054){_0x3ba8d5=_0x4ea054['length'];if(!_0x254bef[_0x518e('0x30')][_0x518e('0x36')]('nolimit')){_0x54e851[_0x518e('0x1c')]=qs['limit'](_0x254bef[_0x518e('0x30')][_0x518e('0x1c')]);_0x54e851[_0x518e('0x1e')]=qs[_0x518e('0x1e')](_0x254bef[_0x518e('0x30')][_0x518e('0x1e')]);}return _0x5a7d58[_0x518e('0x52')](_0x54e851);}})[_0x518e('0x24')](function(_0x5c4b9e){if(_0x5c4b9e){return _0x5c4b9e?{'count':_0x3ba8d5,'rows':_0x5c4b9e}:null;}})[_0x518e('0x24')](respondWithResult(_0x41f57d,null))[_0x518e('0x42')](handleError(_0x41f57d,null));};
\ No newline at end of file
+var _0x68d1=['filter','options','Automation','includeAll','include','findAll','catch','show','params','rawAttributes','length','find','create','body','addConditions','ids','omit','getConditions','addActions','Action','findOne','eml-format','rimraf','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','fs-extra','lodash','squel','crypto','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','json','undefined','limit','count','offset','set','reject','update','then','end','error','stack','name','map','fieldName','type','key','query','keys','filters','intersection','attributes','model','fields','hasOwnProperty','nolimit','order','sort','where','pick','merge','VIRTUAL'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x68d1,0xbb));var _0x168d=function(_0xac011,_0x56395){_0xac011=_0xac011-0x0;var _0x215727=_0x68d1[_0xac011];return _0x215727;};'use strict';var emlformat=require(_0x168d('0x0'));var rimraf=require(_0x168d('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x168d('0x2'));var rp=require(_0x168d('0x3'));var moment=require('moment');var BPromise=require(_0x168d('0x4'));var Mustache=require(_0x168d('0x5'));var util=require(_0x168d('0x6'));var path=require(_0x168d('0x7'));var sox=require(_0x168d('0x8'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x168d('0x9'));var _=require(_0x168d('0xa'));var squel=require(_0x168d('0xb'));var crypto=require(_0x168d('0xc'));var jsforce=require(_0x168d('0xd'));var deskjs=require(_0x168d('0xe'));var toCsv=require(_0x168d('0xf'));var querystring=require(_0x168d('0x10'));var Papa=require(_0x168d('0x11'));var Redis=require(_0x168d('0x12'));var authService=require(_0x168d('0x13'));var qs=require(_0x168d('0x14'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x168d('0x15'));var logger=require(_0x168d('0x16'))(_0x168d('0x17'));var utils=require(_0x168d('0x18'));var config=require(_0x168d('0x19'));var licenseUtil=require(_0x168d('0x1a'));var db=require(_0x168d('0x1b'))['db'];function respondWithStatusCode(_0xfeae91,_0x5b3a7d){_0x5b3a7d=_0x5b3a7d||0xcc;return function(_0x1cb17e){if(_0x1cb17e){return _0xfeae91[_0x168d('0x1c')](_0x5b3a7d);}return _0xfeae91[_0x168d('0x1d')](_0x5b3a7d)['end']();};}function respondWithResult(_0x143eee,_0x5218b8){_0x5218b8=_0x5218b8||0xc8;return function(_0x2ad133){if(_0x2ad133){return _0x143eee[_0x168d('0x1d')](_0x5218b8)[_0x168d('0x1e')](_0x2ad133);}};}function respondWithFilteredResult(_0x31c777,_0x41e55c){return function(_0x193cae){if(_0x193cae){var _0x41989e=typeof _0x41e55c['offset']===_0x168d('0x1f')&&typeof _0x41e55c[_0x168d('0x20')]===_0x168d('0x1f');var _0x517a22=_0x193cae[_0x168d('0x21')];var _0x8b8ede=_0x41989e?0x0:_0x41e55c[_0x168d('0x22')];var _0x8af2c=_0x41989e?_0x193cae[_0x168d('0x21')]:_0x41e55c['offset']+_0x41e55c[_0x168d('0x20')];var _0x31d91a;if(_0x8af2c>=_0x517a22){_0x8af2c=_0x517a22;_0x31d91a=0xc8;}else{_0x31d91a=0xce;}_0x31c777[_0x168d('0x1d')](_0x31d91a);return _0x31c777[_0x168d('0x23')]('Content-Range',_0x8b8ede+'-'+_0x8af2c+'/'+_0x517a22)[_0x168d('0x1e')](_0x193cae);}return null;};}function patchUpdates(_0x94265c){return function(_0x5b9f78){try{jsonpatch['apply'](_0x5b9f78,_0x94265c,!![]);}catch(_0x482cbb){return BPromise[_0x168d('0x24')](_0x482cbb);}return _0x5b9f78['save']();};}function saveUpdates(_0x4ea0a9,_0x5665a8){return function(_0x54b7eb){if(_0x54b7eb){return _0x54b7eb[_0x168d('0x25')](_0x4ea0a9)[_0x168d('0x26')](function(_0x5c4339){return _0x5c4339;});}return null;};}function removeEntity(_0xc6f2ba,_0x4ace38){return function(_0x1b7297){if(_0x1b7297){return _0x1b7297['destroy']()[_0x168d('0x26')](function(){_0xc6f2ba[_0x168d('0x1d')](0xcc)[_0x168d('0x27')]();});}};}function handleEntityNotFound(_0x2aa12c,_0x2ed25c){return function(_0x1ce4ca){if(!_0x1ce4ca){_0x2aa12c[_0x168d('0x1c')](0x194);}return _0x1ce4ca;};}function handleError(_0x1a9687,_0x558883){_0x558883=_0x558883||0x1f4;return function(_0x2886c5){logger[_0x168d('0x28')](_0x2886c5[_0x168d('0x29')]);if(_0x2886c5['name']){delete _0x2886c5[_0x168d('0x2a')];}_0x1a9687[_0x168d('0x1d')](_0x558883)['send'](_0x2886c5);};}exports['index']=function(_0x555b54,_0x5f41fe){var _0x300c9c={},_0x332f32={},_0x1deb18={'count':0x0,'rows':[]};var _0x47be10=_[_0x168d('0x2b')](db['Automation']['rawAttributes'],function(_0x5e2c3b){return{'name':_0x5e2c3b[_0x168d('0x2c')],'type':_0x5e2c3b[_0x168d('0x2d')][_0x168d('0x2e')]};});_0x332f32['model']=_['map'](_0x47be10,_0x168d('0x2a'));_0x332f32[_0x168d('0x2f')]=_[_0x168d('0x30')](_0x555b54['query']);_0x332f32[_0x168d('0x31')]=_[_0x168d('0x32')](_0x332f32['model'],_0x332f32[_0x168d('0x2f')]);_0x300c9c[_0x168d('0x33')]=_[_0x168d('0x32')](_0x332f32[_0x168d('0x34')],qs[_0x168d('0x35')](_0x555b54[_0x168d('0x2f')]['fields']));_0x300c9c[_0x168d('0x33')]=_0x300c9c[_0x168d('0x33')]['length']?_0x300c9c[_0x168d('0x33')]:_0x332f32[_0x168d('0x34')];if(!_0x555b54[_0x168d('0x2f')][_0x168d('0x36')](_0x168d('0x37'))){_0x300c9c[_0x168d('0x20')]=qs['limit'](_0x555b54[_0x168d('0x2f')][_0x168d('0x20')]);_0x300c9c[_0x168d('0x22')]=qs[_0x168d('0x22')](_0x555b54[_0x168d('0x2f')][_0x168d('0x22')]);}_0x300c9c[_0x168d('0x38')]=qs[_0x168d('0x39')](_0x555b54[_0x168d('0x2f')]['sort']);_0x300c9c[_0x168d('0x3a')]=qs[_0x168d('0x31')](_[_0x168d('0x3b')](_0x555b54[_0x168d('0x2f')],_0x332f32[_0x168d('0x31')]),_0x47be10);if(_0x555b54[_0x168d('0x2f')]['filter']){_0x300c9c['where']=_[_0x168d('0x3c')](_0x300c9c[_0x168d('0x3a')],{'$or':_[_0x168d('0x2b')](_0x47be10,function(_0x1b8d2f){if(_0x1b8d2f[_0x168d('0x2d')]!==_0x168d('0x3d')){var _0x5e473e={};_0x5e473e[_0x1b8d2f['name']]={'$like':'%'+_0x555b54[_0x168d('0x2f')][_0x168d('0x3e')]+'%'};return _0x5e473e;}})});}_0x300c9c=_[_0x168d('0x3c')]({},_0x300c9c,_0x555b54[_0x168d('0x3f')]);var _0x21e7b8={'where':_0x300c9c[_0x168d('0x3a')]};return db[_0x168d('0x40')]['count'](_0x21e7b8)[_0x168d('0x26')](function(_0x4b85ee){_0x1deb18[_0x168d('0x21')]=_0x4b85ee;if(_0x555b54[_0x168d('0x2f')][_0x168d('0x41')]){_0x300c9c[_0x168d('0x42')]=[{'all':!![]}];}return db[_0x168d('0x40')][_0x168d('0x43')](_0x300c9c);})[_0x168d('0x26')](function(_0x52d7ff){_0x1deb18['rows']=_0x52d7ff;return _0x1deb18;})[_0x168d('0x26')](respondWithFilteredResult(_0x5f41fe,_0x300c9c))[_0x168d('0x44')](handleError(_0x5f41fe,null));};exports[_0x168d('0x45')]=function(_0x429a87,_0x48a2ad){var _0x4af370={'raw':![],'where':{'id':_0x429a87[_0x168d('0x46')]['id']}},_0x3ef855={};_0x3ef855[_0x168d('0x34')]=_['keys'](db[_0x168d('0x40')][_0x168d('0x47')]);_0x3ef855['query']=_[_0x168d('0x30')](_0x429a87['query']);_0x3ef855[_0x168d('0x31')]=_['intersection'](_0x3ef855[_0x168d('0x34')],_0x3ef855['query']);_0x4af370[_0x168d('0x33')]=_['intersection'](_0x3ef855[_0x168d('0x34')],qs['fields'](_0x429a87['query'][_0x168d('0x35')]));_0x4af370[_0x168d('0x33')]=_0x4af370[_0x168d('0x33')][_0x168d('0x48')]?_0x4af370[_0x168d('0x33')]:_0x3ef855['model'];if(_0x429a87['query']['includeAll']){_0x4af370[_0x168d('0x42')]=[{'all':!![]}];}_0x4af370=_['merge']({},_0x4af370,_0x429a87[_0x168d('0x3f')]);return db[_0x168d('0x40')][_0x168d('0x49')](_0x4af370)[_0x168d('0x26')](handleEntityNotFound(_0x48a2ad,null))[_0x168d('0x26')](respondWithResult(_0x48a2ad,null))['catch'](handleError(_0x48a2ad,null));};exports[_0x168d('0x4a')]=function(_0x1692c0,_0x45de80){return db[_0x168d('0x40')][_0x168d('0x4a')](_0x1692c0[_0x168d('0x4b')],{})['then'](respondWithResult(_0x45de80,0xc9))[_0x168d('0x44')](handleError(_0x45de80,null));};exports[_0x168d('0x25')]=function(_0x3ae847,_0x12fd31){if(_0x3ae847['body']['id']){delete _0x3ae847[_0x168d('0x4b')]['id'];}return db[_0x168d('0x40')][_0x168d('0x49')]({'where':{'id':_0x3ae847[_0x168d('0x46')]['id']}})['then'](handleEntityNotFound(_0x12fd31,null))[_0x168d('0x26')](saveUpdates(_0x3ae847[_0x168d('0x4b')],null))[_0x168d('0x26')](respondWithResult(_0x12fd31,null))[_0x168d('0x44')](handleError(_0x12fd31,null));};exports['destroy']=function(_0x209511,_0x11b2d3){return db[_0x168d('0x40')][_0x168d('0x49')]({'where':{'id':_0x209511['params']['id']}})[_0x168d('0x26')](handleEntityNotFound(_0x11b2d3,null))['then'](removeEntity(_0x11b2d3,null))[_0x168d('0x44')](handleError(_0x11b2d3,null));};exports['addConditions']=function(_0x4152d3,_0x395494,_0x5a93d5){return db['Condition'][_0x168d('0x49')]({'where':{'id':_0x4152d3[_0x168d('0x46')]['id']}})[_0x168d('0x26')](handleEntityNotFound(_0x395494,null))[_0x168d('0x26')](function(_0x287322){if(_0x287322){return _0x287322[_0x168d('0x4c')](_0x4152d3[_0x168d('0x4b')][_0x168d('0x4d')],_[_0x168d('0x4e')](_0x4152d3[_0x168d('0x4b')],[_0x168d('0x4d'),'id'])||{});}})[_0x168d('0x26')](respondWithResult(_0x395494,null))[_0x168d('0x44')](handleError(_0x395494,null));};exports[_0x168d('0x4f')]=function(_0x53073e,_0x311ca7,_0x48fc55){var _0xd77ee7={};var _0x473c7a={};var _0x282337;var _0x3f3f08;return db[_0x168d('0x40')]['findOne']({'where':{'id':_0x53073e[_0x168d('0x46')]['id']}})[_0x168d('0x26')](handleEntityNotFound(_0x311ca7,null))[_0x168d('0x26')](function(_0x50fffa){if(_0x50fffa){_0x282337=_0x50fffa;_0x473c7a[_0x168d('0x34')]=_[_0x168d('0x30')](db['Condition'][_0x168d('0x47')]);_0x473c7a[_0x168d('0x2f')]=_[_0x168d('0x30')](_0x53073e['query']);_0x473c7a[_0x168d('0x31')]=_['intersection'](_0x473c7a[_0x168d('0x34')],_0x473c7a[_0x168d('0x2f')]);_0xd77ee7[_0x168d('0x33')]=_[_0x168d('0x32')](_0x473c7a[_0x168d('0x34')],qs[_0x168d('0x35')](_0x53073e[_0x168d('0x2f')][_0x168d('0x35')]));_0xd77ee7['attributes']=_0xd77ee7[_0x168d('0x33')]['length']?_0xd77ee7[_0x168d('0x33')]:_0x473c7a[_0x168d('0x34')];_0xd77ee7['order']=qs['sort'](_0x53073e[_0x168d('0x2f')][_0x168d('0x39')]);_0xd77ee7['where']=qs[_0x168d('0x31')](_[_0x168d('0x3b')](_0x53073e[_0x168d('0x2f')],_0x473c7a[_0x168d('0x31')]));if(_0x53073e['query'][_0x168d('0x3e')]){_0xd77ee7[_0x168d('0x3a')]=_[_0x168d('0x3c')](_0xd77ee7[_0x168d('0x3a')],{'$or':_[_0x168d('0x2b')](_0xd77ee7['attributes'],function(_0x23c8d6){var _0x3bdf0c={};_0x3bdf0c[_0x23c8d6]={'$like':'%'+_0x53073e[_0x168d('0x2f')]['filter']+'%'};return _0x3bdf0c;})});}_0xd77ee7=_[_0x168d('0x3c')]({},_0xd77ee7,_0x53073e[_0x168d('0x3f')]);return _0x282337['getConditions'](_0xd77ee7);}})['then'](function(_0x236ee7){if(_0x236ee7){_0x3f3f08=_0x236ee7[_0x168d('0x48')];if(!_0x53073e[_0x168d('0x2f')]['hasOwnProperty'](_0x168d('0x37'))){_0xd77ee7['limit']=qs[_0x168d('0x20')](_0x53073e[_0x168d('0x2f')][_0x168d('0x20')]);_0xd77ee7['offset']=qs[_0x168d('0x22')](_0x53073e[_0x168d('0x2f')]['offset']);}return _0x282337[_0x168d('0x4f')](_0xd77ee7);}})[_0x168d('0x26')](function(_0x5cd846){if(_0x5cd846){return _0x5cd846?{'count':_0x3f3f08,'rows':_0x5cd846}:null;}})[_0x168d('0x26')](respondWithResult(_0x311ca7,null))[_0x168d('0x44')](handleError(_0x311ca7,null));};exports[_0x168d('0x50')]=function(_0x476874,_0xf8f927,_0x5e2c15){return db[_0x168d('0x51')][_0x168d('0x49')]({'where':{'id':_0x476874[_0x168d('0x46')]['id']}})['then'](handleEntityNotFound(_0xf8f927,null))[_0x168d('0x26')](function(_0x20074a){if(_0x20074a){return _0x20074a[_0x168d('0x50')](_0x476874[_0x168d('0x4b')][_0x168d('0x4d')],_[_0x168d('0x4e')](_0x476874[_0x168d('0x4b')],[_0x168d('0x4d'),'id'])||{});}})['then'](respondWithResult(_0xf8f927,null))[_0x168d('0x44')](handleError(_0xf8f927,null));};exports['getActions']=function(_0x144c7f,_0x194dd6,_0x3d8c39){var _0x376408={};var _0x1711fe={};var _0x55da5d;var _0x430e2b;return db[_0x168d('0x40')][_0x168d('0x52')]({'where':{'id':_0x144c7f['params']['id']}})['then'](handleEntityNotFound(_0x194dd6,null))[_0x168d('0x26')](function(_0x35e15c){if(_0x35e15c){_0x55da5d=_0x35e15c;_0x1711fe[_0x168d('0x34')]=_[_0x168d('0x30')](db[_0x168d('0x51')][_0x168d('0x47')]);_0x1711fe[_0x168d('0x2f')]=_[_0x168d('0x30')](_0x144c7f[_0x168d('0x2f')]);_0x1711fe[_0x168d('0x31')]=_[_0x168d('0x32')](_0x1711fe[_0x168d('0x34')],_0x1711fe[_0x168d('0x2f')]);_0x376408[_0x168d('0x33')]=_[_0x168d('0x32')](_0x1711fe[_0x168d('0x34')],qs['fields'](_0x144c7f[_0x168d('0x2f')][_0x168d('0x35')]));_0x376408['attributes']=_0x376408[_0x168d('0x33')][_0x168d('0x48')]?_0x376408['attributes']:_0x1711fe['model'];_0x376408['order']=qs[_0x168d('0x39')](_0x144c7f[_0x168d('0x2f')]['sort']);_0x376408[_0x168d('0x3a')]=qs[_0x168d('0x31')](_[_0x168d('0x3b')](_0x144c7f[_0x168d('0x2f')],_0x1711fe[_0x168d('0x31')]));if(_0x144c7f['query'][_0x168d('0x3e')]){_0x376408['where']=_[_0x168d('0x3c')](_0x376408[_0x168d('0x3a')],{'$or':_[_0x168d('0x2b')](_0x376408[_0x168d('0x33')],function(_0x4631d1){var _0x743aea={};_0x743aea[_0x4631d1]={'$like':'%'+_0x144c7f[_0x168d('0x2f')]['filter']+'%'};return _0x743aea;})});}_0x376408=_[_0x168d('0x3c')]({},_0x376408,_0x144c7f[_0x168d('0x3f')]);return _0x55da5d['getActions'](_0x376408);}})['then'](function(_0x516c15){if(_0x516c15){_0x430e2b=_0x516c15[_0x168d('0x48')];if(!_0x144c7f['query'][_0x168d('0x36')](_0x168d('0x37'))){_0x376408['limit']=qs[_0x168d('0x20')](_0x144c7f[_0x168d('0x2f')][_0x168d('0x20')]);_0x376408[_0x168d('0x22')]=qs[_0x168d('0x22')](_0x144c7f[_0x168d('0x2f')]['offset']);}return _0x55da5d['getActions'](_0x376408);}})[_0x168d('0x26')](function(_0x4244c1){if(_0x4244c1){return _0x4244c1?{'count':_0x430e2b,'rows':_0x4244c1}:null;}})[_0x168d('0x26')](respondWithResult(_0x194dd6,null))[_0x168d('0x44')](handleError(_0x194dd6,null));};
\ No newline at end of file
diff --git a/server/api/automation/automation.model.js b/server/api/automation/automation.model.js
index df7e54e..0b0bb66 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 _0xf158=['rimraf','../../config/environment','Automation','tools_automations','lodash','api','moment','bluebird','request-promise','path'];(function(_0x20d7c1,_0x26f0ab){var _0x40e03b=function(_0x2fea0c){while(--_0x2fea0c){_0x20d7c1['push'](_0x20d7c1['shift']());}};_0x40e03b(++_0x26f0ab);}(_0xf158,0x1d0));var _0x8f15=function(_0x22bf73,_0x328246){_0x22bf73=_0x22bf73-0x0;var _0x1354d5=_0xf158[_0x22bf73];return _0x1354d5;};'use strict';var _=require(_0x8f15('0x0'));var util=require('util');var logger=require('../../config/logger')(_0x8f15('0x1'));var moment=require(_0x8f15('0x2'));var BPromise=require(_0x8f15('0x3'));var rp=require(_0x8f15('0x4'));var fs=require('fs');var path=require(_0x8f15('0x5'));var rimraf=require(_0x8f15('0x6'));var config=require(_0x8f15('0x7'));var attributes=require('./automation.attributes');module['exports']=function(_0x13f0c4,_0x5905d3){return _0x13f0c4['define'](_0x8f15('0x8'),attributes,{'tableName':_0x8f15('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x7426=['../../config/environment','./automation.attributes','exports','define','Automation','tools_automations','lodash','util','../../config/logger','api','moment','rimraf'];(function(_0x94312,_0x512ea1){var _0x1a34eb=function(_0x1ea10c){while(--_0x1ea10c){_0x94312['push'](_0x94312['shift']());}};_0x1a34eb(++_0x512ea1);}(_0x7426,0xa2));var _0x6742=function(_0x3c9c45,_0x1fc52a){_0x3c9c45=_0x3c9c45-0x0;var _0x544045=_0x7426[_0x3c9c45];return _0x544045;};'use strict';var _=require(_0x6742('0x0'));var util=require(_0x6742('0x1'));var logger=require(_0x6742('0x2'))(_0x6742('0x3'));var moment=require(_0x6742('0x4'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x6742('0x5'));var config=require(_0x6742('0x6'));var attributes=require(_0x6742('0x7'));module[_0x6742('0x8')]=function(_0x5e2503,_0x28afe4){return _0x5e2503[_0x6742('0x9')](_0x6742('0xa'),attributes,{'tableName':_0x6742('0xb'),'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 c71f300..dcbbbef 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 _0x2deb=['Automation,\x20%s,\x20%s','request\x20sent','debug','Automation,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','lodash','util','moment','bluebird','../../mysqldb','../../config/utils','../../config/logger','rpc','client','http','request','then'];(function(_0x15bc81,_0x4d4f77){var _0x59440e=function(_0x1b60f2){while(--_0x1b60f2){_0x15bc81['push'](_0x15bc81['shift']());}};_0x59440e(++_0x4d4f77);}(_0x2deb,0xdb));var _0xb2de=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x2deb[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0xb2de('0x0'));var util=require(_0xb2de('0x1'));var moment=require(_0xb2de('0x2'));var BPromise=require(_0xb2de('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0xb2de('0x4'))['db'];var utils=require(_0xb2de('0x5'));var logger=require(_0xb2de('0x6'))(_0xb2de('0x7'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0xb2de('0x8')][_0xb2de('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x191004,_0x49307b,_0x253d0b){return new BPromise(function(_0x1a4c44,_0x53ab0e){return client[_0xb2de('0xa')](_0x191004,_0x253d0b)[_0xb2de('0xb')](function(_0x1d40ec){logger['info'](_0xb2de('0xc'),_0x49307b,_0xb2de('0xd'));logger[_0xb2de('0xe')](_0xb2de('0xf'),_0x49307b,'request\x20sent',JSON['stringify'](_0x1d40ec));if(_0x1d40ec[_0xb2de('0x10')]){if(_0x1d40ec[_0xb2de('0x10')][_0xb2de('0x11')]===0x1f4){logger['error'](_0xb2de('0xc'),_0x49307b,_0x1d40ec[_0xb2de('0x10')][_0xb2de('0x12')]);return _0x53ab0e(_0x1d40ec['error'][_0xb2de('0x12')]);}logger['error'](_0xb2de('0xc'),_0x49307b,_0x1d40ec['error'][_0xb2de('0x12')]);return _0x1a4c44(_0x1d40ec[_0xb2de('0x10')][_0xb2de('0x12')]);}else{logger['info'](_0xb2de('0xc'),_0x49307b,_0xb2de('0xd'));_0x1a4c44(_0x1d40ec[_0xb2de('0x13')][_0xb2de('0x12')]);}})[_0xb2de('0x14')](function(_0x2dc15c){logger[_0xb2de('0x10')](_0xb2de('0xc'),_0x49307b,_0x2dc15c);_0x53ab0e(_0x2dc15c);});});}
\ No newline at end of file
+var _0x00ea=['rpc','jayson/promise','client','http','request','then','info','Automation,\x20%s,\x20%s','request\x20sent','Automation,\x20%s,\x20%s,\x20%s','error','code','message','catch','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger'];(function(_0x3b5abb,_0x11a93c){var _0x17f5be=function(_0x22e1fa){while(--_0x22e1fa){_0x3b5abb['push'](_0x3b5abb['shift']());}};_0x17f5be(++_0x11a93c);}(_0x00ea,0x19d));var _0xa00e=function(_0x1ae96d,_0x2d857b){_0x1ae96d=_0x1ae96d-0x0;var _0x220aca=_0x00ea[_0x1ae96d];return _0x220aca;};'use strict';var _=require('lodash');var util=require(_0xa00e('0x0'));var moment=require(_0xa00e('0x1'));var BPromise=require('bluebird');var rs=require(_0xa00e('0x2'));var fs=require('fs');var Redis=require(_0xa00e('0x3'));var db=require(_0xa00e('0x4'))['db'];var utils=require(_0xa00e('0x5'));var logger=require(_0xa00e('0x6'))(_0xa00e('0x7'));var config=require('../../config/environment');var jayson=require(_0xa00e('0x8'));var client=jayson[_0xa00e('0x9')][_0xa00e('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x2aab60,_0x5b09ef,_0x46f5fa){return new BPromise(function(_0x7f530c,_0x48dba0){return client[_0xa00e('0xb')](_0x2aab60,_0x46f5fa)[_0xa00e('0xc')](function(_0x48760e){logger[_0xa00e('0xd')](_0xa00e('0xe'),_0x5b09ef,_0xa00e('0xf'));logger['debug'](_0xa00e('0x10'),_0x5b09ef,_0xa00e('0xf'),JSON['stringify'](_0x48760e));if(_0x48760e[_0xa00e('0x11')]){if(_0x48760e['error'][_0xa00e('0x12')]===0x1f4){logger[_0xa00e('0x11')](_0xa00e('0xe'),_0x5b09ef,_0x48760e[_0xa00e('0x11')]['message']);return _0x48dba0(_0x48760e[_0xa00e('0x11')][_0xa00e('0x13')]);}logger['error'](_0xa00e('0xe'),_0x5b09ef,_0x48760e['error'][_0xa00e('0x13')]);return _0x7f530c(_0x48760e[_0xa00e('0x11')][_0xa00e('0x13')]);}else{logger['info']('Automation,\x20%s,\x20%s',_0x5b09ef,_0xa00e('0xf'));_0x7f530c(_0x48760e['result'][_0xa00e('0x13')]);}})[_0xa00e('0x14')](function(_0x1d0095){logger[_0xa00e('0x11')](_0xa00e('0xe'),_0x5b09ef,_0x1d0095);_0x48dba0(_0x1d0095);});});}
\ No newline at end of file
diff --git a/server/api/automation/index.js b/server/api/automation/index.js
index 508199e..4ec8e1a 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 _0x18d6=['addConditions','/:id/actions','addActions','update','delete','/:id','destroy','exports','multer','util','connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment','get','index','isAuthenticated','show','/:id/conditions','getConditions','getActions','create','post'];(function(_0x3fa903,_0x29a8b8){var _0x324764=function(_0x37c28d){while(--_0x37c28d){_0x3fa903['push'](_0x3fa903['shift']());}};_0x324764(++_0x29a8b8);}(_0x18d6,0x166));var _0x618d=function(_0x18141b,_0x45c769){_0x18141b=_0x18141b-0x0;var _0x474c30=_0x18d6[_0x18141b];return _0x474c30;};'use strict';var multer=require(_0x618d('0x0'));var util=require(_0x618d('0x1'));var path=require('path');var timeout=require(_0x618d('0x2'));var express=require(_0x618d('0x3'));var router=express[_0x618d('0x4')]();var fs_extra=require(_0x618d('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0x618d('0x6'));var config=require(_0x618d('0x7'));var controller=require('./automation.controller');router[_0x618d('0x8')]('/',auth['isAuthenticated'](),controller[_0x618d('0x9')]);router[_0x618d('0x8')]('/:id',auth[_0x618d('0xa')](),controller[_0x618d('0xb')]);router[_0x618d('0x8')](_0x618d('0xc'),auth[_0x618d('0xa')](),controller[_0x618d('0xd')]);router[_0x618d('0x8')]('/:id/actions',auth[_0x618d('0xa')](),controller[_0x618d('0xe')]);router['post']('/',auth[_0x618d('0xa')](),controller[_0x618d('0xf')]);router[_0x618d('0x10')](_0x618d('0xc'),auth[_0x618d('0xa')](),controller[_0x618d('0x11')]);router[_0x618d('0x10')](_0x618d('0x12'),auth[_0x618d('0xa')](),controller[_0x618d('0x13')]);router['put']('/:id',auth[_0x618d('0xa')](),controller[_0x618d('0x14')]);router[_0x618d('0x15')](_0x618d('0x16'),auth[_0x618d('0xa')](),controller[_0x618d('0x17')]);module[_0x618d('0x18')]=router;
\ No newline at end of file
+var _0x7aa7=['path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./automation.controller','get','isAuthenticated','index','/:id','show','/:id/conditions','getConditions','/:id/actions','post','create','addConditions','put','delete','destroy','exports'];(function(_0x3b4adb,_0x18f96c){var _0x22cce9=function(_0x2e85d7){while(--_0x2e85d7){_0x3b4adb['push'](_0x3b4adb['shift']());}};_0x22cce9(++_0x18f96c);}(_0x7aa7,0xfd));var _0x77aa=function(_0x3524ec,_0x24fb73){_0x3524ec=_0x3524ec-0x0;var _0x273ddc=_0x7aa7[_0x3524ec];return _0x273ddc;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x77aa('0x0'));var timeout=require(_0x77aa('0x1'));var express=require(_0x77aa('0x2'));var router=express['Router']();var fs_extra=require(_0x77aa('0x3'));var auth=require(_0x77aa('0x4'));var interaction=require(_0x77aa('0x5'));var config=require(_0x77aa('0x6'));var controller=require(_0x77aa('0x7'));router[_0x77aa('0x8')]('/',auth[_0x77aa('0x9')](),controller[_0x77aa('0xa')]);router['get'](_0x77aa('0xb'),auth[_0x77aa('0x9')](),controller[_0x77aa('0xc')]);router[_0x77aa('0x8')](_0x77aa('0xd'),auth[_0x77aa('0x9')](),controller[_0x77aa('0xe')]);router['get'](_0x77aa('0xf'),auth['isAuthenticated'](),controller['getActions']);router[_0x77aa('0x10')]('/',auth[_0x77aa('0x9')](),controller[_0x77aa('0x11')]);router[_0x77aa('0x10')](_0x77aa('0xd'),auth['isAuthenticated'](),controller[_0x77aa('0x12')]);router[_0x77aa('0x10')](_0x77aa('0xf'),auth[_0x77aa('0x9')](),controller['addActions']);router[_0x77aa('0x13')](_0x77aa('0xb'),auth[_0x77aa('0x9')](),controller['update']);router[_0x77aa('0x14')]('/:id',auth[_0x77aa('0x9')](),controller[_0x77aa('0x15')]);module[_0x77aa('0x16')]=router;
\ No newline at end of file
diff --git a/server/api/campaign/campaign.attributes.js b/server/api/campaign/campaign.attributes.js
index 5bbdd0b..932c2cc 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 _0x0d24=['always','never','onlyIfOpen','Active/Disactive\x20AMD','#AMD\x20Initial\x20Silence','#AMD\x20After\x20Greeting\x20Silence','#AMD\x20Total\x20Analysis\x20Time','#AMD\x20Min\x20Word\x20Length','#AMD\x20Between\x20Words\x20Silence','#AMD\x20Silence\x20Threshold\x20(min:0,\x20max:32767)','ASC','Cut\x20Digit\x20(min:1,\x20max:15)','#NoSuchNumber\x20Retry\x20(min:1,\x20max:999)','NoSuchNumber\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','Drop\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Abandoned\x20Retry\x20(min:1,\x20max:999)','Abandoned\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Machine\x20Retry\x20(min:1,\x20max:999)','AgentReject\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','sequelize','STRING','name','ivr','BOOLEAN','INTEGER','UNSIGNED','Max\x20200\x20calls.','Originate\x20Timeout\x20Seconds\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,*,*,*','ENUM'];(function(_0x156929,_0x44fa01){var _0x23a62d=function(_0x3d1217){while(--_0x3d1217){_0x156929['push'](_0x156929['shift']());}};_0x23a62d(++_0x44fa01);}(_0x0d24,0xeb));var _0x40d2=function(_0x3df276,_0x5912e7){_0x3df276=_0x3df276-0x0;var _0x3d4c1b=_0x0d24[_0x3df276];return _0x3d4c1b;};'use strict';var Sequelize=require(_0x40d2('0x0'));module['exports']={'name':{'type':Sequelize[_0x40d2('0x1')],'unique':_0x40d2('0x2'),'allowNull':![],'validate':{'is':/[A-Za-z0-9._\\+*!-]+/,'notEmpty':!![]}},'type':{'type':Sequelize['ENUM'](_0x40d2('0x3')),'allowNull':![],'defaultValue':'ivr'},'description':{'type':Sequelize['STRING']},'active':{'type':Sequelize[_0x40d2('0x4')],'defaultValue':0x0,'comment':'Active/Disactive\x20Campaign'},'limitCalls':{'type':Sequelize[_0x40d2('0x5')](0x4)[_0x40d2('0x6')],'defaultValue':0x1e,'validate':{'min':0x1,'max':0xc8},'comment':_0x40d2('0x7')},'dialOriginateCallerIdName':{'type':Sequelize[_0x40d2('0x1')]},'dialOriginateCallerIdNumber':{'type':Sequelize[_0x40d2('0x1')]},'dialOriginateTimeout':{'type':Sequelize[_0x40d2('0x5')](0x3)[_0x40d2('0x6')],'defaultValue':0x1e,'validate':{'min':0x1,'max':0x3e7},'comment':_0x40d2('0x8')},'dialCongestionMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0x40d2('0x6')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#Congestion\x20Retry\x20(min:1,\x20max:999)'},'dialCongestionRetryFrequency':{'type':Sequelize[_0x40d2('0x5')](0x5)[_0x40d2('0x6')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x40d2('0x9')},'dialBusyMaxRetry':{'type':Sequelize[_0x40d2('0x5')](0x3)[_0x40d2('0x6')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x40d2('0xa')},'dialBusyRetryFrequency':{'type':Sequelize['INTEGER'](0x5)[_0x40d2('0x6')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x40d2('0xb')},'dialNoAnswerMaxRetry':{'type':Sequelize[_0x40d2('0x5')](0x3)[_0x40d2('0x6')],'defaultValue':0x3,'comment':_0x40d2('0xc')},'dialNoAnswerRetryFrequency':{'type':Sequelize[_0x40d2('0x5')](0x5)[_0x40d2('0x6')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x40d2('0xd')},'dialGlobalMaxRetry':{'type':Sequelize[_0x40d2('0x5')](0x3)[_0x40d2('0x6')],'validate':{'min':0x1,'max':0x3e7},'defaultValue':0x4,'comment':_0x40d2('0xe')},'dialTimezone':{'type':Sequelize[_0x40d2('0x1')],'defaultValue':null},'dialGlobalInterval':{'type':Sequelize['STRING'],'defaultValue':_0x40d2('0xf')},'dialCheckDuplicateType':{'type':Sequelize[_0x40d2('0x10')](_0x40d2('0x11'),_0x40d2('0x12'),_0x40d2('0x13')),'defaultValue':_0x40d2('0x11')},'dialAMDActive':{'type':Sequelize[_0x40d2('0x4')],'defaultValue':0x0,'comment':_0x40d2('0x14')},'dialAMDInitialSilence':{'type':Sequelize['INTEGER'](0x9)[_0x40d2('0x6')],'defaultValue':0x9c4,'validate':{'min':0x0},'comment':_0x40d2('0x15')},'dialAMDGreeting':{'type':Sequelize[_0x40d2('0x5')](0x9)['UNSIGNED'],'defaultValue':0x5dc,'validate':{'min':0x0},'comment':'#AMD\x20Greeting'},'dialAMDAfterGreetingSilence':{'type':Sequelize[_0x40d2('0x5')](0x9)[_0x40d2('0x6')],'defaultValue':0x320,'validate':{'min':0x0},'comment':_0x40d2('0x16')},'dialAMDTotalAnalysisTime':{'type':Sequelize[_0x40d2('0x5')](0x9)[_0x40d2('0x6')],'defaultValue':0x1388,'validate':{'min':0x0},'comment':_0x40d2('0x17')},'dialAMDMinWordLength':{'type':Sequelize['INTEGER'](0x9)[_0x40d2('0x6')],'defaultValue':0x64,'validate':{'min':0x0},'comment':_0x40d2('0x18')},'dialAMDBetweenWordsSilence':{'type':Sequelize['INTEGER'](0x9)[_0x40d2('0x6')],'defaultValue':0x32,'validate':{'min':0x0},'comment':_0x40d2('0x19')},'dialAMDMaximumNumberOfWords':{'type':Sequelize[_0x40d2('0x5')](0x9)[_0x40d2('0x6')],'defaultValue':0x3,'validate':{'min':0x0},'comment':'#AMD\x20Maximum\x20Number\x20Of\x20Words'},'dialAMDSilenceThreshold':{'type':Sequelize['INTEGER'](0x5)[_0x40d2('0x6')],'validate':{'min':0x0,'max':0x7fff},'defaultValue':0x100,'comment':_0x40d2('0x1a')},'dialAMDMaximumWordLength':{'type':Sequelize[_0x40d2('0x5')](0x9)[_0x40d2('0x6')],'defaultValue':0x1388,'validate':{'min':0x0},'comment':'#AMD\x20Maximum\x20Word\x20Length'},'dialOrderByScheduledAt':{'type':Sequelize['ENUM']('DESC',_0x40d2('0x1b')),'defaultValue':'DESC'},'dialPrefix':{'type':Sequelize[_0x40d2('0x1')],'defaultValue':null},'dialRandomLastDigitCallerIdNumber':{'type':Sequelize[_0x40d2('0x5')](0x3)[_0x40d2('0x6')],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':'Random\x20Last\x20Digit\x20(min:1,\x20max:15)'},'dialCutDigit':{'type':Sequelize[_0x40d2('0x5')](0x3)[_0x40d2('0x6')],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':_0x40d2('0x1c')},'dialNoSuchNumberMaxRetry':{'type':Sequelize[_0x40d2('0x5')](0x3)[_0x40d2('0x6')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x40d2('0x1d')},'dialNoSuchNumberRetryFrequency':{'type':Sequelize[_0x40d2('0x5')](0x5)[_0x40d2('0x6')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x40d2('0x1e')},'dialDropMaxRetry':{'type':Sequelize[_0x40d2('0x5')](0x3)[_0x40d2('0x6')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#Drop\x20Retry\x20(min:1,\x20max:999)'},'dialDropRetryFrequency':{'type':Sequelize[_0x40d2('0x5')](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x40d2('0x1f')},'dialAbandonedMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0x40d2('0x6')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x40d2('0x20')},'dialAbandonedRetryFrequency':{'type':Sequelize[_0x40d2('0x5')](0x5)[_0x40d2('0x6')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x40d2('0x21')},'dialMachineMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0x40d2('0x6')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x40d2('0x22')},'dialMachineRetryFrequency':{'type':Sequelize[_0x40d2('0x5')](0x5)[_0x40d2('0x6')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'Machine\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialAgentRejectMaxRetry':{'type':Sequelize[_0x40d2('0x5')](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#AgentReject\x20Retry\x20(min:1,\x20max:999)'},'dialAgentRejectRetryFrequency':{'type':Sequelize['INTEGER'](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x40d2('0x23')}};
\ No newline at end of file
+var _0x7508=['INTEGER','#Congestion\x20Retry\x20(min:1,\x20max:999)','Congestion\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Busy\x20Retry\x20(min:1,\x20max:999)','Busy\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#NoAnswer\x20Retry\x20(min:1,\x20max:999)','NoAnswer\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Global\x20Max\x20Retry\x20(min:1,\x20max:999)','always','Active/Disactive\x20AMD','#AMD\x20Initial\x20Silence','#AMD\x20Greeting','#AMD\x20After\x20Greeting\x20Silence','#AMD\x20Total\x20Analysis\x20Time','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)','Drop\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Abandoned\x20Retry\x20(min:1,\x20max:999)','Abandoned\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','Machine\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','AgentReject\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','sequelize','STRING','ENUM','ivr','BOOLEAN','Active/Disactive\x20Campaign','UNSIGNED','Max\x20200\x20calls.','Originate\x20Timeout\x20Seconds\x20(min:1,\x20max:999)'];(function(_0xdca4a6,_0x4965f6){var _0x5c5b95=function(_0x2c8fe7){while(--_0x2c8fe7){_0xdca4a6['push'](_0xdca4a6['shift']());}};_0x5c5b95(++_0x4965f6);}(_0x7508,0xc3));var _0x8750=function(_0x92f1b,_0x57f2d6){_0x92f1b=_0x92f1b-0x0;var _0x874d22=_0x7508[_0x92f1b];return _0x874d22;};'use strict';var Sequelize=require(_0x8750('0x0'));module['exports']={'name':{'type':Sequelize[_0x8750('0x1')],'unique':'name','allowNull':![],'validate':{'is':/[A-Za-z0-9._\\+*!-]+/,'notEmpty':!![]}},'type':{'type':Sequelize[_0x8750('0x2')]('ivr'),'allowNull':![],'defaultValue':_0x8750('0x3')},'description':{'type':Sequelize['STRING']},'active':{'type':Sequelize[_0x8750('0x4')],'defaultValue':0x0,'comment':_0x8750('0x5')},'limitCalls':{'type':Sequelize['INTEGER'](0x4)[_0x8750('0x6')],'defaultValue':0x1e,'validate':{'min':0x1,'max':0xc8},'comment':_0x8750('0x7')},'dialOriginateCallerIdName':{'type':Sequelize[_0x8750('0x1')]},'dialOriginateCallerIdNumber':{'type':Sequelize['STRING']},'dialOriginateTimeout':{'type':Sequelize['INTEGER'](0x3)['UNSIGNED'],'defaultValue':0x1e,'validate':{'min':0x1,'max':0x3e7},'comment':_0x8750('0x8')},'dialCongestionMaxRetry':{'type':Sequelize[_0x8750('0x9')](0x3)[_0x8750('0x6')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x8750('0xa')},'dialCongestionRetryFrequency':{'type':Sequelize[_0x8750('0x9')](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x8750('0xb')},'dialBusyMaxRetry':{'type':Sequelize[_0x8750('0x9')](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x8750('0xc')},'dialBusyRetryFrequency':{'type':Sequelize['INTEGER'](0x5)[_0x8750('0x6')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x8750('0xd')},'dialNoAnswerMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0x8750('0x6')],'defaultValue':0x3,'comment':_0x8750('0xe')},'dialNoAnswerRetryFrequency':{'type':Sequelize[_0x8750('0x9')](0x5)[_0x8750('0x6')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x8750('0xf')},'dialGlobalMaxRetry':{'type':Sequelize['INTEGER'](0x3)['UNSIGNED'],'validate':{'min':0x1,'max':0x3e7},'defaultValue':0x4,'comment':_0x8750('0x10')},'dialTimezone':{'type':Sequelize[_0x8750('0x1')],'defaultValue':null},'dialGlobalInterval':{'type':Sequelize[_0x8750('0x1')],'defaultValue':'07:00-22:00,*,*,*'},'dialCheckDuplicateType':{'type':Sequelize[_0x8750('0x2')](_0x8750('0x11'),'never','onlyIfOpen'),'defaultValue':_0x8750('0x11')},'dialAMDActive':{'type':Sequelize[_0x8750('0x4')],'defaultValue':0x0,'comment':_0x8750('0x12')},'dialAMDInitialSilence':{'type':Sequelize['INTEGER'](0x9)[_0x8750('0x6')],'defaultValue':0x9c4,'validate':{'min':0x0},'comment':_0x8750('0x13')},'dialAMDGreeting':{'type':Sequelize[_0x8750('0x9')](0x9)['UNSIGNED'],'defaultValue':0x5dc,'validate':{'min':0x0},'comment':_0x8750('0x14')},'dialAMDAfterGreetingSilence':{'type':Sequelize[_0x8750('0x9')](0x9)['UNSIGNED'],'defaultValue':0x320,'validate':{'min':0x0},'comment':_0x8750('0x15')},'dialAMDTotalAnalysisTime':{'type':Sequelize[_0x8750('0x9')](0x9)[_0x8750('0x6')],'defaultValue':0x1388,'validate':{'min':0x0},'comment':_0x8750('0x16')},'dialAMDMinWordLength':{'type':Sequelize[_0x8750('0x9')](0x9)[_0x8750('0x6')],'defaultValue':0x64,'validate':{'min':0x0},'comment':'#AMD\x20Min\x20Word\x20Length'},'dialAMDBetweenWordsSilence':{'type':Sequelize[_0x8750('0x9')](0x9)[_0x8750('0x6')],'defaultValue':0x32,'validate':{'min':0x0},'comment':'#AMD\x20Between\x20Words\x20Silence'},'dialAMDMaximumNumberOfWords':{'type':Sequelize[_0x8750('0x9')](0x9)[_0x8750('0x6')],'defaultValue':0x3,'validate':{'min':0x0},'comment':'#AMD\x20Maximum\x20Number\x20Of\x20Words'},'dialAMDSilenceThreshold':{'type':Sequelize[_0x8750('0x9')](0x5)['UNSIGNED'],'validate':{'min':0x0,'max':0x7fff},'defaultValue':0x100,'comment':'#AMD\x20Silence\x20Threshold\x20(min:0,\x20max:32767)'},'dialAMDMaximumWordLength':{'type':Sequelize[_0x8750('0x9')](0x9)[_0x8750('0x6')],'defaultValue':0x1388,'validate':{'min':0x0},'comment':'#AMD\x20Maximum\x20Word\x20Length'},'dialOrderByScheduledAt':{'type':Sequelize[_0x8750('0x2')](_0x8750('0x17'),_0x8750('0x18')),'defaultValue':_0x8750('0x17')},'dialPrefix':{'type':Sequelize[_0x8750('0x1')],'defaultValue':null},'dialRandomLastDigitCallerIdNumber':{'type':Sequelize['INTEGER'](0x3)[_0x8750('0x6')],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':_0x8750('0x19')},'dialCutDigit':{'type':Sequelize[_0x8750('0x9')](0x3)['UNSIGNED'],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':_0x8750('0x1a')},'dialNoSuchNumberMaxRetry':{'type':Sequelize[_0x8750('0x9')](0x3)[_0x8750('0x6')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#NoSuchNumber\x20Retry\x20(min:1,\x20max:999)'},'dialNoSuchNumberRetryFrequency':{'type':Sequelize[_0x8750('0x9')](0x5)[_0x8750('0x6')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x8750('0x1b')},'dialDropMaxRetry':{'type':Sequelize[_0x8750('0x9')](0x3)[_0x8750('0x6')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x8750('0x1c')},'dialDropRetryFrequency':{'type':Sequelize[_0x8750('0x9')](0x5)[_0x8750('0x6')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x8750('0x1d')},'dialAbandonedMaxRetry':{'type':Sequelize['INTEGER'](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x8750('0x1e')},'dialAbandonedRetryFrequency':{'type':Sequelize[_0x8750('0x9')](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x8750('0x1f')},'dialMachineMaxRetry':{'type':Sequelize[_0x8750('0x9')](0x3)[_0x8750('0x6')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#Machine\x20Retry\x20(min:1,\x20max:999)'},'dialMachineRetryFrequency':{'type':Sequelize[_0x8750('0x9')](0x5)[_0x8750('0x6')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x8750('0x20')},'dialAgentRejectMaxRetry':{'type':Sequelize[_0x8750('0x9')](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#AgentReject\x20Retry\x20(min:1,\x20max:999)'},'dialAgentRejectRetryFrequency':{'type':Sequelize[_0x8750('0x9')](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x8750('0x21')}};
\ No newline at end of file
diff --git a/server/api/campaign/campaign.controller.js b/server/api/campaign/campaign.controller.js
index de9902e..17c25b9 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 _0x124a=['insert','into','fromQuery','phone','scheduledAt','ContactId','ListId','select','field','NOW()','CmListId','toString','cm_contacts','ListId\x20=\x20?','phone\x20IS\x20NOT\x20NULL','from','cm_hopper_final','CampaignId\x20=\x20?','phone\x20NOT\x20IN\x20(?)','cm_hopper','onlyIfOpen','deletedAt\x20IS\x20NULL','COALESCE(phone,\x27\x27)','push','sequelize','all','removeLists','getBlackLists','addBlackLists','removeBlackLists','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','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/logger','../../config/license/util','../../mysqldb','sendStatus','status','offset','undefined','limit','count','Content-Range','json','apply','reject','save','update','destroy','then','get','UserProfileResource','error','stack','name','index','map','Campaign','rawAttributes','fieldName','type','key','model','query','keys','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','filters','pick','filter','where','merge','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','params','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','IvrCampaigns','find','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','length','omit','createdAt','updatedAt','role','UserProfileSection','getHoppers','findOne','CampaignId','CmHopper','getHopperHistories','CmHopperHistory','getHopperFinals','CmHopperFinal','getHopperBlacks','CmHopperBlack','getLists','CmList','addLists','ids','spread','dialCheckDuplicateType'];(function(_0xa464c9,_0x7c86d8){var _0x3d73c4=function(_0x5c2056){while(--_0x5c2056){_0xa464c9['push'](_0xa464c9['shift']());}};_0x3d73c4(++_0x7c86d8);}(_0x124a,0x1b6));var _0xa124=function(_0x15f724,_0x2794ef){_0x15f724=_0x15f724-0x0;var _0x49b152=_0x124a[_0x15f724];return _0x49b152;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xa124('0x0'));var zipdir=require(_0xa124('0x1'));var jsonpatch=require(_0xa124('0x2'));var rp=require(_0xa124('0x3'));var moment=require(_0xa124('0x4'));var BPromise=require(_0xa124('0x5'));var Mustache=require(_0xa124('0x6'));var util=require('util');var path=require(_0xa124('0x7'));var sox=require(_0xa124('0x8'));var csv=require(_0xa124('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xa124('0xa'));var _=require(_0xa124('0xb'));var squel=require(_0xa124('0xc'));var crypto=require(_0xa124('0xd'));var jsforce=require(_0xa124('0xe'));var deskjs=require(_0xa124('0xf'));var toCsv=require(_0xa124('0x9'));var querystring=require('querystring');var Papa=require(_0xa124('0x10'));var Redis=require(_0xa124('0x11'));var authService=require(_0xa124('0x12'));var qs=require(_0xa124('0x13'));var as=require(_0xa124('0x14'));var hardwareService=require(_0xa124('0x15'));var logger=require(_0xa124('0x16'))('api');var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0xa124('0x17'));var db=require(_0xa124('0x18'))['db'];function respondWithStatusCode(_0x2c4de1,_0xbbd946){_0xbbd946=_0xbbd946||0xcc;return function(_0x57e8ae){if(_0x57e8ae){return _0x2c4de1[_0xa124('0x19')](_0xbbd946);}return _0x2c4de1[_0xa124('0x1a')](_0xbbd946)['end']();};}function respondWithResult(_0x330150,_0x53276f){_0x53276f=_0x53276f||0xc8;return function(_0x34d8a4){if(_0x34d8a4){return _0x330150[_0xa124('0x1a')](_0x53276f)['json'](_0x34d8a4);}};}function respondWithFilteredResult(_0x4fecee,_0x2785fe){return function(_0x52988a){if(_0x52988a){var _0x478790=typeof _0x2785fe[_0xa124('0x1b')]===_0xa124('0x1c')&&typeof _0x2785fe[_0xa124('0x1d')]==='undefined';var _0x1c6ee9=_0x52988a[_0xa124('0x1e')];var _0x418887=_0x478790?0x0:_0x2785fe[_0xa124('0x1b')];var _0x44543a=_0x478790?_0x52988a[_0xa124('0x1e')]:_0x2785fe[_0xa124('0x1b')]+_0x2785fe[_0xa124('0x1d')];var _0x207bc5;if(_0x44543a>=_0x1c6ee9){_0x44543a=_0x1c6ee9;_0x207bc5=0xc8;}else{_0x207bc5=0xce;}_0x4fecee[_0xa124('0x1a')](_0x207bc5);return _0x4fecee['set'](_0xa124('0x1f'),_0x418887+'-'+_0x44543a+'/'+_0x1c6ee9)[_0xa124('0x20')](_0x52988a);}return null;};}function patchUpdates(_0x3ce151){return function(_0x2eb05d){try{jsonpatch[_0xa124('0x21')](_0x2eb05d,_0x3ce151,!![]);}catch(_0x3865d9){return BPromise[_0xa124('0x22')](_0x3865d9);}return _0x2eb05d[_0xa124('0x23')]();};}function saveUpdates(_0xe61286,_0x1a7ccc){return function(_0x1e43d8){if(_0x1e43d8){return _0x1e43d8[_0xa124('0x24')](_0xe61286)['then'](function(_0xc5ec34){return _0xc5ec34;});}return null;};}function removeEntity(_0x5698ba,_0x3a5e9e){return function(_0x294145){if(_0x294145){return _0x294145[_0xa124('0x25')]()[_0xa124('0x26')](function(){var _0x46145c=_0x294145[_0xa124('0x27')]({'plain':!![]});var _0x226495='IvrCampaigns';return db[_0xa124('0x28')][_0xa124('0x25')]({'where':{'type':_0x226495,'resourceId':_0x46145c['id']}})[_0xa124('0x26')](function(){return _0x294145;});})[_0xa124('0x26')](function(){_0x5698ba[_0xa124('0x1a')](0xcc)['end']();});}};}function handleEntityNotFound(_0x625ada,_0x495003){return function(_0xc072aa){if(!_0xc072aa){_0x625ada[_0xa124('0x19')](0x194);}return _0xc072aa;};}function handleError(_0x2a6c96,_0x10cc6c){_0x10cc6c=_0x10cc6c||0x1f4;return function(_0x19455c){logger[_0xa124('0x29')](_0x19455c[_0xa124('0x2a')]);if(_0x19455c[_0xa124('0x2b')]){delete _0x19455c[_0xa124('0x2b')];}_0x2a6c96[_0xa124('0x1a')](_0x10cc6c)['send'](_0x19455c);};}exports[_0xa124('0x2c')]=function(_0x173a19,_0x584b36){var _0x2c8b39={},_0x10111d={},_0x323eeb={'count':0x0,'rows':[]};var _0x16d6c5=_[_0xa124('0x2d')](db[_0xa124('0x2e')][_0xa124('0x2f')],function(_0x535181){return{'name':_0x535181[_0xa124('0x30')],'type':_0x535181[_0xa124('0x31')][_0xa124('0x32')]};});_0x10111d[_0xa124('0x33')]=_['map'](_0x16d6c5,'name');_0x10111d[_0xa124('0x34')]=_[_0xa124('0x35')](_0x173a19['query']);_0x10111d['filters']=_[_0xa124('0x36')](_0x10111d[_0xa124('0x33')],_0x10111d[_0xa124('0x34')]);_0x2c8b39[_0xa124('0x37')]=_[_0xa124('0x36')](_0x10111d[_0xa124('0x33')],qs['fields'](_0x173a19[_0xa124('0x34')][_0xa124('0x38')]));_0x2c8b39[_0xa124('0x37')]=_0x2c8b39[_0xa124('0x37')]['length']?_0x2c8b39['attributes']:_0x10111d[_0xa124('0x33')];if(!_0x173a19['query'][_0xa124('0x39')](_0xa124('0x3a'))){_0x2c8b39[_0xa124('0x1d')]=qs[_0xa124('0x1d')](_0x173a19['query'][_0xa124('0x1d')]);_0x2c8b39['offset']=qs[_0xa124('0x1b')](_0x173a19[_0xa124('0x34')][_0xa124('0x1b')]);}_0x2c8b39[_0xa124('0x3b')]=qs[_0xa124('0x3c')](_0x173a19[_0xa124('0x34')][_0xa124('0x3c')]);_0x2c8b39['where']=qs[_0xa124('0x3d')](_[_0xa124('0x3e')](_0x173a19['query'],_0x10111d[_0xa124('0x3d')]),_0x16d6c5);if(_0x173a19[_0xa124('0x34')][_0xa124('0x3f')]){_0x2c8b39[_0xa124('0x40')]=_[_0xa124('0x41')](_0x2c8b39['where'],{'$or':_[_0xa124('0x2d')](_0x16d6c5,function(_0x4c0d4d){if(_0x4c0d4d[_0xa124('0x31')]!==_0xa124('0x42')){var _0x5ed138={};_0x5ed138[_0x4c0d4d[_0xa124('0x2b')]]={'$like':'%'+_0x173a19[_0xa124('0x34')]['filter']+'%'};return _0x5ed138;}})});}_0x2c8b39=_[_0xa124('0x41')]({},_0x2c8b39,_0x173a19[_0xa124('0x43')]);var _0x7409e7={'where':_0x2c8b39[_0xa124('0x40')]};return db[_0xa124('0x2e')][_0xa124('0x1e')](_0x7409e7)[_0xa124('0x26')](function(_0x3b626f){_0x323eeb[_0xa124('0x1e')]=_0x3b626f;if(_0x173a19[_0xa124('0x34')][_0xa124('0x44')]){_0x2c8b39[_0xa124('0x45')]=[{'all':!![]}];}return db[_0xa124('0x2e')][_0xa124('0x46')](_0x2c8b39);})[_0xa124('0x26')](function(_0x50efa0){_0x323eeb[_0xa124('0x47')]=_0x50efa0;return _0x323eeb;})[_0xa124('0x26')](respondWithFilteredResult(_0x584b36,_0x2c8b39))[_0xa124('0x48')](handleError(_0x584b36,null));};exports[_0xa124('0x49')]=function(_0x5ae955,_0x58dc59){var _0x57fd83={'raw':![],'where':{'id':_0x5ae955[_0xa124('0x4a')]['id']}},_0x37b5a5={};_0x37b5a5[_0xa124('0x33')]=_['keys'](db[_0xa124('0x2e')][_0xa124('0x2f')]);_0x37b5a5[_0xa124('0x34')]=_[_0xa124('0x35')](_0x5ae955['query']);_0x37b5a5[_0xa124('0x3d')]=_['intersection'](_0x37b5a5['model'],_0x37b5a5['query']);_0x57fd83[_0xa124('0x37')]=_[_0xa124('0x36')](_0x37b5a5[_0xa124('0x33')],qs[_0xa124('0x38')](_0x5ae955[_0xa124('0x34')][_0xa124('0x38')]));_0x57fd83[_0xa124('0x37')]=_0x57fd83[_0xa124('0x37')]['length']?_0x57fd83['attributes']:_0x37b5a5['model'];if(_0x5ae955['query'][_0xa124('0x44')]){_0x57fd83[_0xa124('0x45')]=[{'all':!![]}];}_0x57fd83=_[_0xa124('0x41')]({},_0x57fd83,_0x5ae955['options']);return db[_0xa124('0x2e')]['find'](_0x57fd83)[_0xa124('0x26')](handleEntityNotFound(_0x58dc59,null))['then'](respondWithResult(_0x58dc59,null))[_0xa124('0x48')](handleError(_0x58dc59,null));};exports[_0xa124('0x4b')]=function(_0x18ffce,_0x1e85b7){return db['Campaign']['create'](_0x18ffce[_0xa124('0x4c')],{})[_0xa124('0x26')](function(_0x4e2d6c){var _0x5c0466=_0x18ffce[_0xa124('0x4d')][_0xa124('0x27')]({'plain':!![]});if(!_0x5c0466)throw new Error(_0xa124('0x4e'));if(_0x5c0466['role']===_0xa124('0x4d')){var _0x2e3555=_0x4e2d6c[_0xa124('0x27')]({'plain':!![]});var _0x2b6598=_0xa124('0x4f');return db['UserProfileSection'][_0xa124('0x50')]({'where':{'name':_0x2b6598,'userProfileId':_0x5c0466[_0xa124('0x51')]},'raw':!![]})[_0xa124('0x26')](function(_0x3b4722){if(_0x3b4722&&_0x3b4722[_0xa124('0x52')]===0x0){return db['UserProfileResource'][_0xa124('0x4b')]({'name':_0x2e3555[_0xa124('0x2b')],'resourceId':_0x2e3555['id'],'type':_0x3b4722['name'],'sectionId':_0x3b4722['id']},{})['then'](function(){return _0x4e2d6c;});}else{return _0x4e2d6c;}})['catch'](function(_0x329609){logger[_0xa124('0x29')](_0xa124('0x53'),_0x329609);throw _0x329609;});}return _0x4e2d6c;})['then'](respondWithResult(_0x1e85b7,0xc9))[_0xa124('0x48')](handleError(_0x1e85b7,null));};exports['clone']=function(_0x53b894,_0x330db0){var _0x107b13={'where':{'id':_0x53b894[_0xa124('0x4a')]['id']}},_0x136e4c={};_0x136e4c[_0xa124('0x33')]=_[_0xa124('0x35')](db[_0xa124('0x2e')]['rawAttributes']);_0x107b13[_0xa124('0x37')]=_[_0xa124('0x36')](_0x136e4c[_0xa124('0x33')],qs[_0xa124('0x38')](_0x53b894['query'][_0xa124('0x38')]));_0x107b13[_0xa124('0x37')]=_0x107b13[_0xa124('0x37')][_0xa124('0x54')]?_0x107b13[_0xa124('0x37')]:_0x136e4c[_0xa124('0x33')];if(_0x53b894[_0xa124('0x34')]['includeAll']){_0x107b13['include']=[{'all':!![]}];}_0x107b13=_[_0xa124('0x41')]({},_0x107b13,_0x53b894[_0xa124('0x43')]);return db[_0xa124('0x2e')][_0xa124('0x50')](_0x107b13)['then'](handleEntityNotFound(_0x330db0,null))[_0xa124('0x26')](function(_0x3d7185){if(_0x3d7185){var _0x187e8c=_0x3d7185[_0xa124('0x27')]({'plain':!![]});_0x187e8c=qs[_0xa124('0x55')](_0x187e8c,['id',_0xa124('0x56'),_0xa124('0x57')]);_0x53b894['body']=_[_0xa124('0x55')](_0x53b894['body'],['id',_0xa124('0x56'),_0xa124('0x57')]);return db[_0xa124('0x2e')][_0xa124('0x4b')](_[_0xa124('0x41')](_0x187e8c,_0x53b894[_0xa124('0x4c')]),{'include':_0x53b894[_0xa124('0x34')][_0xa124('0x44')]?[{'all':!![]}]:undefined})[_0xa124('0x26')](function(_0x1d1f02){var _0x1bf077=_0x53b894[_0xa124('0x4d')][_0xa124('0x27')]({'plain':!![]});if(!_0x1bf077)throw new Error(_0xa124('0x4e'));if(_0x1bf077[_0xa124('0x58')]===_0xa124('0x4d')){var _0x4164e4=_0x1d1f02['get']({'plain':!![]});var _0x1c038a=_0xa124('0x4f');return db[_0xa124('0x59')][_0xa124('0x50')]({'where':{'name':_0x1c038a,'userProfileId':_0x1bf077['userProfileId']},'raw':!![]})[_0xa124('0x26')](function(_0x32ba3a){if(_0x32ba3a&&_0x32ba3a[_0xa124('0x52')]===0x0){return db['UserProfileResource'][_0xa124('0x4b')]({'name':_0x4164e4[_0xa124('0x2b')],'resourceId':_0x4164e4['id'],'type':_0x32ba3a[_0xa124('0x2b')],'sectionId':_0x32ba3a['id']},{})['then'](function(){return _0x1d1f02;});}else{return _0x1d1f02;}})['catch'](function(_0x31f38d){logger[_0xa124('0x29')](_0xa124('0x53'),_0x31f38d);throw _0x31f38d;});}return _0x1d1f02;});}})[_0xa124('0x26')](respondWithResult(_0x330db0,0xc9))['catch'](handleError(_0x330db0,null));};exports['update']=function(_0xae32bb,_0x48d7a8){if(_0xae32bb[_0xa124('0x4c')]['id']){delete _0xae32bb['body']['id'];}return db[_0xa124('0x2e')][_0xa124('0x50')]({'where':{'id':_0xae32bb[_0xa124('0x4a')]['id']}})[_0xa124('0x26')](handleEntityNotFound(_0x48d7a8,null))[_0xa124('0x26')](saveUpdates(_0xae32bb[_0xa124('0x4c')],null))[_0xa124('0x26')](respondWithResult(_0x48d7a8,null))[_0xa124('0x48')](handleError(_0x48d7a8,null));};exports['destroy']=function(_0x3613f1,_0x4da1ff){return db[_0xa124('0x2e')][_0xa124('0x50')]({'where':{'id':_0x3613f1[_0xa124('0x4a')]['id']}})[_0xa124('0x26')](handleEntityNotFound(_0x4da1ff,null))[_0xa124('0x26')](removeEntity(_0x4da1ff,null))[_0xa124('0x48')](handleError(_0x4da1ff,null));};exports[_0xa124('0x5a')]=function(_0x5db2f6,_0x370d86,_0x22c834){var _0x5cbd17={'raw':!![],'where':{}};var _0x5e70c6={};var _0x26e572={'count':0x0,'rows':[]};return db['Campaign'][_0xa124('0x5b')]({'where':{'id':_0x5db2f6[_0xa124('0x4a')]['id']}})[_0xa124('0x26')](handleEntityNotFound(_0x370d86,null))[_0xa124('0x26')](function(_0x7ec1a2){if(_0x7ec1a2){_0x5e70c6[_0xa124('0x33')]=_[_0xa124('0x35')](db['CmHopper'][_0xa124('0x2f')]);_0x5e70c6[_0xa124('0x34')]=_['keys'](_0x5db2f6[_0xa124('0x34')]);_0x5e70c6[_0xa124('0x3d')]=_[_0xa124('0x36')](_0x5e70c6['model'],_0x5e70c6['query']);_0x5cbd17[_0xa124('0x37')]=_[_0xa124('0x36')](_0x5e70c6[_0xa124('0x33')],qs['fields'](_0x5db2f6[_0xa124('0x34')][_0xa124('0x38')]));_0x5cbd17[_0xa124('0x37')]=_0x5cbd17[_0xa124('0x37')][_0xa124('0x54')]?_0x5cbd17['attributes']:_0x5e70c6['model'];if(!_0x5db2f6[_0xa124('0x34')][_0xa124('0x39')](_0xa124('0x3a'))){_0x5cbd17['limit']=qs['limit'](_0x5db2f6['query'][_0xa124('0x1d')]);_0x5cbd17[_0xa124('0x1b')]=qs[_0xa124('0x1b')](_0x5db2f6[_0xa124('0x34')]['offset']);}_0x5cbd17[_0xa124('0x3b')]=qs[_0xa124('0x3c')](_0x5db2f6['query'][_0xa124('0x3c')]);_0x5cbd17[_0xa124('0x40')]=qs[_0xa124('0x3d')](_[_0xa124('0x3e')](_0x5db2f6['query'],_0x5e70c6[_0xa124('0x3d')]));_0x5cbd17[_0xa124('0x40')][_0xa124('0x5c')]=_0x7ec1a2['id'];if(_0x5db2f6[_0xa124('0x34')]['filter']){_0x5cbd17[_0xa124('0x40')]=_[_0xa124('0x41')](_0x5cbd17[_0xa124('0x40')],{'$or':_['map'](_0x5cbd17[_0xa124('0x37')],function(_0x291fbc){var _0x494d41={};_0x494d41[_0x291fbc]={'$like':'%'+_0x5db2f6[_0xa124('0x34')][_0xa124('0x3f')]+'%'};return _0x494d41;})});}_0x5cbd17=_[_0xa124('0x41')]({},_0x5cbd17,_0x5db2f6[_0xa124('0x43')]);return db[_0xa124('0x5d')][_0xa124('0x1e')]({'where':_0x5cbd17['where']})['then'](function(_0x4f025c){_0x26e572[_0xa124('0x1e')]=_0x4f025c;if(_0x5db2f6[_0xa124('0x34')]['includeAll']){_0x5cbd17[_0xa124('0x45')]=[{'all':!![]}];}return db['CmHopper'][_0xa124('0x46')](_0x5cbd17);})[_0xa124('0x26')](function(_0x24ada7){_0x26e572[_0xa124('0x47')]=_0x24ada7;return _0x26e572;});}})['then'](respondWithFilteredResult(_0x370d86,_0x5cbd17))[_0xa124('0x48')](handleError(_0x370d86,null));};exports[_0xa124('0x5e')]=function(_0x326bb2,_0x42fa4c,_0x318b62){var _0x13a5a2={'raw':!![],'where':{}};var _0x687642={};var _0x1787f5={'count':0x0,'rows':[]};return db[_0xa124('0x2e')]['findOne']({'where':{'id':_0x326bb2[_0xa124('0x4a')]['id']}})[_0xa124('0x26')](handleEntityNotFound(_0x42fa4c,null))['then'](function(_0x2aaff0){if(_0x2aaff0){_0x687642[_0xa124('0x33')]=_['keys'](db[_0xa124('0x5f')][_0xa124('0x2f')]);_0x687642['query']=_['keys'](_0x326bb2[_0xa124('0x34')]);_0x687642['filters']=_[_0xa124('0x36')](_0x687642[_0xa124('0x33')],_0x687642[_0xa124('0x34')]);_0x13a5a2[_0xa124('0x37')]=_[_0xa124('0x36')](_0x687642[_0xa124('0x33')],qs[_0xa124('0x38')](_0x326bb2[_0xa124('0x34')]['fields']));_0x13a5a2[_0xa124('0x37')]=_0x13a5a2[_0xa124('0x37')][_0xa124('0x54')]?_0x13a5a2[_0xa124('0x37')]:_0x687642[_0xa124('0x33')];if(!_0x326bb2[_0xa124('0x34')]['hasOwnProperty'](_0xa124('0x3a'))){_0x13a5a2['limit']=qs['limit'](_0x326bb2[_0xa124('0x34')]['limit']);_0x13a5a2[_0xa124('0x1b')]=qs[_0xa124('0x1b')](_0x326bb2['query'][_0xa124('0x1b')]);}_0x13a5a2[_0xa124('0x3b')]=qs[_0xa124('0x3c')](_0x326bb2[_0xa124('0x34')][_0xa124('0x3c')]);_0x13a5a2[_0xa124('0x40')]=qs[_0xa124('0x3d')](_[_0xa124('0x3e')](_0x326bb2[_0xa124('0x34')],_0x687642[_0xa124('0x3d')]));_0x13a5a2['where'][_0xa124('0x5c')]=_0x2aaff0['id'];if(_0x326bb2[_0xa124('0x34')][_0xa124('0x3f')]){_0x13a5a2[_0xa124('0x40')]=_[_0xa124('0x41')](_0x13a5a2[_0xa124('0x40')],{'$or':_[_0xa124('0x2d')](_0x13a5a2[_0xa124('0x37')],function(_0x44261f){var _0x350eb5={};_0x350eb5[_0x44261f]={'$like':'%'+_0x326bb2['query'][_0xa124('0x3f')]+'%'};return _0x350eb5;})});}_0x13a5a2=_['merge']({},_0x13a5a2,_0x326bb2[_0xa124('0x43')]);return db[_0xa124('0x5f')]['count']({'where':_0x13a5a2[_0xa124('0x40')]})[_0xa124('0x26')](function(_0x23d2dd){_0x1787f5[_0xa124('0x1e')]=_0x23d2dd;if(_0x326bb2[_0xa124('0x34')][_0xa124('0x44')]){_0x13a5a2[_0xa124('0x45')]=[{'all':!![]}];}return db[_0xa124('0x5f')]['findAll'](_0x13a5a2);})['then'](function(_0x1635e2){_0x1787f5[_0xa124('0x47')]=_0x1635e2;return _0x1787f5;});}})['then'](respondWithFilteredResult(_0x42fa4c,_0x13a5a2))[_0xa124('0x48')](handleError(_0x42fa4c,null));};exports[_0xa124('0x60')]=function(_0x703784,_0x50809d,_0x202c2a){var _0x8aba73={'raw':!![],'where':{}};var _0x5b3961={};var _0x24baa9={'count':0x0,'rows':[]};return db[_0xa124('0x2e')]['findOne']({'where':{'id':_0x703784[_0xa124('0x4a')]['id']}})[_0xa124('0x26')](handleEntityNotFound(_0x50809d,null))[_0xa124('0x26')](function(_0x2f756a){if(_0x2f756a){_0x5b3961['model']=_[_0xa124('0x35')](db[_0xa124('0x61')][_0xa124('0x2f')]);_0x5b3961[_0xa124('0x34')]=_['keys'](_0x703784[_0xa124('0x34')]);_0x5b3961['filters']=_[_0xa124('0x36')](_0x5b3961['model'],_0x5b3961[_0xa124('0x34')]);_0x8aba73[_0xa124('0x37')]=_[_0xa124('0x36')](_0x5b3961[_0xa124('0x33')],qs[_0xa124('0x38')](_0x703784['query'][_0xa124('0x38')]));_0x8aba73['attributes']=_0x8aba73[_0xa124('0x37')][_0xa124('0x54')]?_0x8aba73[_0xa124('0x37')]:_0x5b3961['model'];if(!_0x703784[_0xa124('0x34')][_0xa124('0x39')](_0xa124('0x3a'))){_0x8aba73['limit']=qs[_0xa124('0x1d')](_0x703784[_0xa124('0x34')][_0xa124('0x1d')]);_0x8aba73[_0xa124('0x1b')]=qs[_0xa124('0x1b')](_0x703784[_0xa124('0x34')][_0xa124('0x1b')]);}_0x8aba73['order']=qs[_0xa124('0x3c')](_0x703784[_0xa124('0x34')][_0xa124('0x3c')]);_0x8aba73[_0xa124('0x40')]=qs[_0xa124('0x3d')](_[_0xa124('0x3e')](_0x703784[_0xa124('0x34')],_0x5b3961['filters']));_0x8aba73[_0xa124('0x40')][_0xa124('0x5c')]=_0x2f756a['id'];if(_0x703784[_0xa124('0x34')][_0xa124('0x3f')]){_0x8aba73[_0xa124('0x40')]=_[_0xa124('0x41')](_0x8aba73[_0xa124('0x40')],{'$or':_[_0xa124('0x2d')](_0x8aba73[_0xa124('0x37')],function(_0x10e505){var _0x83d94c={};_0x83d94c[_0x10e505]={'$like':'%'+_0x703784[_0xa124('0x34')][_0xa124('0x3f')]+'%'};return _0x83d94c;})});}_0x8aba73=_['merge']({},_0x8aba73,_0x703784['options']);return db[_0xa124('0x61')][_0xa124('0x1e')]({'where':_0x8aba73[_0xa124('0x40')]})[_0xa124('0x26')](function(_0x50b182){_0x24baa9['count']=_0x50b182;if(_0x703784[_0xa124('0x34')]['includeAll']){_0x8aba73[_0xa124('0x45')]=[{'all':!![]}];}return db[_0xa124('0x61')][_0xa124('0x46')](_0x8aba73);})[_0xa124('0x26')](function(_0x12616b){_0x24baa9['rows']=_0x12616b;return _0x24baa9;});}})[_0xa124('0x26')](respondWithFilteredResult(_0x50809d,_0x8aba73))[_0xa124('0x48')](handleError(_0x50809d,null));};exports[_0xa124('0x62')]=function(_0x3fabc9,_0x4abd2c,_0x368b6d){var _0x432839={'raw':!![],'where':{}};var _0x4f21bd={};var _0x191511={'count':0x0,'rows':[]};return db['Campaign'][_0xa124('0x5b')]({'where':{'id':_0x3fabc9[_0xa124('0x4a')]['id']}})[_0xa124('0x26')](handleEntityNotFound(_0x4abd2c,null))[_0xa124('0x26')](function(_0xc40475){if(_0xc40475){_0x4f21bd['model']=_[_0xa124('0x35')](db[_0xa124('0x63')][_0xa124('0x2f')]);_0x4f21bd['query']=_[_0xa124('0x35')](_0x3fabc9['query']);_0x4f21bd[_0xa124('0x3d')]=_[_0xa124('0x36')](_0x4f21bd[_0xa124('0x33')],_0x4f21bd['query']);_0x432839[_0xa124('0x37')]=_[_0xa124('0x36')](_0x4f21bd[_0xa124('0x33')],qs[_0xa124('0x38')](_0x3fabc9[_0xa124('0x34')][_0xa124('0x38')]));_0x432839[_0xa124('0x37')]=_0x432839[_0xa124('0x37')][_0xa124('0x54')]?_0x432839[_0xa124('0x37')]:_0x4f21bd['model'];if(!_0x3fabc9[_0xa124('0x34')]['hasOwnProperty']('nolimit')){_0x432839[_0xa124('0x1d')]=qs[_0xa124('0x1d')](_0x3fabc9[_0xa124('0x34')][_0xa124('0x1d')]);_0x432839[_0xa124('0x1b')]=qs[_0xa124('0x1b')](_0x3fabc9[_0xa124('0x34')][_0xa124('0x1b')]);}_0x432839['order']=qs[_0xa124('0x3c')](_0x3fabc9[_0xa124('0x34')][_0xa124('0x3c')]);_0x432839['where']=qs[_0xa124('0x3d')](_[_0xa124('0x3e')](_0x3fabc9[_0xa124('0x34')],_0x4f21bd[_0xa124('0x3d')]));_0x432839[_0xa124('0x40')][_0xa124('0x5c')]=_0xc40475['id'];if(_0x3fabc9[_0xa124('0x34')]['filter']){_0x432839['where']=_['merge'](_0x432839['where'],{'$or':_[_0xa124('0x2d')](_0x432839[_0xa124('0x37')],function(_0x499684){var _0x491c36={};_0x491c36[_0x499684]={'$like':'%'+_0x3fabc9[_0xa124('0x34')][_0xa124('0x3f')]+'%'};return _0x491c36;})});}_0x432839=_[_0xa124('0x41')]({},_0x432839,_0x3fabc9[_0xa124('0x43')]);return db['CmHopperBlack'][_0xa124('0x1e')]({'where':_0x432839['where']})[_0xa124('0x26')](function(_0x94c3b4){_0x191511[_0xa124('0x1e')]=_0x94c3b4;if(_0x3fabc9['query'][_0xa124('0x44')]){_0x432839[_0xa124('0x45')]=[{'all':!![]}];}return db['CmHopperBlack'][_0xa124('0x46')](_0x432839);})['then'](function(_0xe18a50){_0x191511[_0xa124('0x47')]=_0xe18a50;return _0x191511;});}})[_0xa124('0x26')](respondWithFilteredResult(_0x4abd2c,_0x432839))['catch'](handleError(_0x4abd2c,null));};exports[_0xa124('0x64')]=function(_0x2907c3,_0xa22fe2,_0x229b0e){var _0x4f551f={};var _0x556abd={};var _0x4c6140;var _0x5eecb6;return db[_0xa124('0x2e')][_0xa124('0x5b')]({'where':{'id':_0x2907c3['params']['id']}})[_0xa124('0x26')](handleEntityNotFound(_0xa22fe2,null))['then'](function(_0x4ac930){if(_0x4ac930){_0x4c6140=_0x4ac930;_0x556abd[_0xa124('0x33')]=_[_0xa124('0x35')](db[_0xa124('0x65')]['rawAttributes']);_0x556abd[_0xa124('0x34')]=_[_0xa124('0x35')](_0x2907c3[_0xa124('0x34')]);_0x556abd[_0xa124('0x3d')]=_[_0xa124('0x36')](_0x556abd[_0xa124('0x33')],_0x556abd[_0xa124('0x34')]);_0x4f551f[_0xa124('0x37')]=_['intersection'](_0x556abd[_0xa124('0x33')],qs[_0xa124('0x38')](_0x2907c3[_0xa124('0x34')][_0xa124('0x38')]));_0x4f551f[_0xa124('0x37')]=_0x4f551f[_0xa124('0x37')][_0xa124('0x54')]?_0x4f551f['attributes']:_0x556abd[_0xa124('0x33')];_0x4f551f[_0xa124('0x3b')]=qs[_0xa124('0x3c')](_0x2907c3[_0xa124('0x34')][_0xa124('0x3c')]);_0x4f551f[_0xa124('0x40')]=qs['filters'](_['pick'](_0x2907c3[_0xa124('0x34')],_0x556abd[_0xa124('0x3d')]));if(_0x2907c3['query'][_0xa124('0x3f')]){_0x4f551f[_0xa124('0x40')]=_[_0xa124('0x41')](_0x4f551f['where'],{'$or':_[_0xa124('0x2d')](_0x4f551f['attributes'],function(_0x469496){var _0xf5b698={};_0xf5b698[_0x469496]={'$like':'%'+_0x2907c3[_0xa124('0x34')][_0xa124('0x3f')]+'%'};return _0xf5b698;})});}_0x4f551f=_[_0xa124('0x41')]({},_0x4f551f,_0x2907c3[_0xa124('0x43')]);return _0x4c6140[_0xa124('0x64')](_0x4f551f);}})[_0xa124('0x26')](function(_0x3d69df){if(_0x3d69df){_0x5eecb6=_0x3d69df[_0xa124('0x54')];if(!_0x2907c3[_0xa124('0x34')][_0xa124('0x39')](_0xa124('0x3a'))){_0x4f551f['limit']=qs[_0xa124('0x1d')](_0x2907c3[_0xa124('0x34')][_0xa124('0x1d')]);_0x4f551f[_0xa124('0x1b')]=qs[_0xa124('0x1b')](_0x2907c3[_0xa124('0x34')][_0xa124('0x1b')]);}return _0x4c6140[_0xa124('0x64')](_0x4f551f);}})[_0xa124('0x26')](function(_0x1f9960){if(_0x1f9960){return _0x1f9960?{'count':_0x5eecb6,'rows':_0x1f9960}:null;}})['then'](respondWithResult(_0xa22fe2,null))[_0xa124('0x48')](handleError(_0xa22fe2,null));};exports[_0xa124('0x66')]=function(_0x59941f,_0x5b3be5,_0x198381){var _0x255508,_0x39977a;return db[_0xa124('0x2e')][_0xa124('0x50')]({'where':{'id':_0x59941f['params']['id']}})['then'](handleEntityNotFound(_0x5b3be5,null))['then'](function(_0xdafb23){if(_0xdafb23){_0x39977a=_0xdafb23;return _0xdafb23[_0xa124('0x66')](_0x59941f['body'][_0xa124('0x67')],_[_0xa124('0x55')](_0x59941f[_0xa124('0x4c')],[_0xa124('0x67'),'id'])||{});}return null;})[_0xa124('0x68')](function(_0x3296dd){var _0x2682e4;_0x255508=_0x3296dd||[];var _0x4c732b=[];if(_0x3296dd){for(var _0x5d6ff9=0x0;_0x5d6ff9<_0x3296dd['length'];_0x5d6ff9+=0x1){var _0x27a1fd=_0x3296dd[_0x5d6ff9]['get']({'plain':!![]});_0x39977a[_0xa124('0x69')]=_0x59941f[_0xa124('0x4c')][_0xa124('0x69')]?_0x59941f[_0xa124('0x4c')][_0xa124('0x69')]:_0x39977a[_0xa124('0x69')];switch(_0x39977a[_0xa124('0x69')]){case'always':_0x2682e4=squel[_0xa124('0x6a')]()[_0xa124('0x6b')]('cm_hopper')[_0xa124('0x6c')]([_0xa124('0x6d'),_0xa124('0x6e'),_0xa124('0x6f'),_0xa124('0x70'),_0xa124('0x5c'),_0xa124('0x56'),_0xa124('0x57')],squel[_0xa124('0x71')]()[_0xa124('0x72')](_0xa124('0x6d'),_0xa124('0x6d'))[_0xa124('0x72')](_0xa124('0x73'),_0xa124('0x6e'))['field']('id','ContactId')[_0xa124('0x72')](_0x27a1fd[_0xa124('0x74')][_0xa124('0x75')](),_0xa124('0x70'))[_0xa124('0x72')](_0x59941f[_0xa124('0x4a')]['id'][_0xa124('0x75')](),_0xa124('0x5c'))['field'](_0xa124('0x73'),_0xa124('0x56'))[_0xa124('0x72')]('NOW()',_0xa124('0x57'))['from'](_0xa124('0x76'))['where']('deletedAt\x20IS\x20NULL')[_0xa124('0x40')](_0xa124('0x77'),_0x27a1fd[_0xa124('0x74')]['toString']())[_0xa124('0x40')](_0xa124('0x78'))['where']('phone\x20NOT\x20IN\x20(?)',squel[_0xa124('0x71')]()[_0xa124('0x72')]('COALESCE(calleridnum,\x27\x27)')[_0xa124('0x79')](_0xa124('0x7a'))['where'](_0xa124('0x7b'),_0x59941f[_0xa124('0x4a')]['id']['toString']()))[_0xa124('0x40')](_0xa124('0x7c'),squel[_0xa124('0x71')]()[_0xa124('0x72')]('COALESCE(phone,\x27\x27)')[_0xa124('0x79')](_0xa124('0x7d'))[_0xa124('0x40')]('CampaignId\x20=\x20?',_0x59941f[_0xa124('0x4a')]['id'][_0xa124('0x75')]())))[_0xa124('0x75')]();break;case _0xa124('0x7e'):_0x2682e4=squel[_0xa124('0x6a')]()[_0xa124('0x6b')](_0xa124('0x7d'))[_0xa124('0x6c')]([_0xa124('0x6d'),_0xa124('0x6e'),'ContactId',_0xa124('0x70'),_0xa124('0x5c'),_0xa124('0x56'),_0xa124('0x57')],squel[_0xa124('0x71')]()[_0xa124('0x72')](_0xa124('0x6d'),_0xa124('0x6d'))[_0xa124('0x72')]('NOW()','scheduledAt')[_0xa124('0x72')]('id',_0xa124('0x6f'))[_0xa124('0x72')](_0x27a1fd[_0xa124('0x74')][_0xa124('0x75')](),_0xa124('0x70'))[_0xa124('0x72')](_0x59941f[_0xa124('0x4a')]['id'][_0xa124('0x75')](),_0xa124('0x5c'))[_0xa124('0x72')](_0xa124('0x73'),_0xa124('0x56'))['field'](_0xa124('0x73'),_0xa124('0x57'))[_0xa124('0x79')](_0xa124('0x76'))[_0xa124('0x40')](_0xa124('0x7f'))[_0xa124('0x40')](_0xa124('0x77'),_0x27a1fd[_0xa124('0x74')][_0xa124('0x75')]())[_0xa124('0x40')]('phone\x20IS\x20NOT\x20NULL')['where'](_0xa124('0x7c'),squel[_0xa124('0x71')]()[_0xa124('0x72')](_0xa124('0x80'))[_0xa124('0x79')](_0xa124('0x7d'))['where']('CampaignId\x20=\x20?',_0x59941f['params']['id'][_0xa124('0x75')]())))[_0xa124('0x75')]();break;default:_0x2682e4=squel['insert']()['into']('cm_hopper')[_0xa124('0x6c')]([_0xa124('0x6d'),_0xa124('0x6e'),_0xa124('0x6f'),_0xa124('0x70'),_0xa124('0x5c'),'createdAt',_0xa124('0x57')],squel[_0xa124('0x71')]()['field']('phone',_0xa124('0x6d'))[_0xa124('0x72')]('NOW()',_0xa124('0x6e'))[_0xa124('0x72')]('id','ContactId')[_0xa124('0x72')](_0x27a1fd[_0xa124('0x74')][_0xa124('0x75')](),_0xa124('0x70'))[_0xa124('0x72')](_0x59941f['params']['id']['toString'](),'CampaignId')['field'](_0xa124('0x73'),_0xa124('0x56'))['field']('NOW()',_0xa124('0x57'))[_0xa124('0x79')](_0xa124('0x76'))['where']('deletedAt\x20IS\x20NULL')[_0xa124('0x40')](_0xa124('0x77'),_0x27a1fd[_0xa124('0x74')][_0xa124('0x75')]())['where'](_0xa124('0x78')))[_0xa124('0x75')]();}_0x4c732b[_0xa124('0x81')](db[_0xa124('0x82')][_0xa124('0x34')](_0x2682e4));}return BPromise[_0xa124('0x83')](_0x4c732b);}})[_0xa124('0x26')](function(){return _0x255508;})[_0xa124('0x26')](respondWithResult(_0x5b3be5,null))[_0xa124('0x48')](handleError(_0x5b3be5,null));};exports[_0xa124('0x84')]=function(_0x64df38,_0x51bdee,_0x300200){return db[_0xa124('0x2e')][_0xa124('0x50')]({'where':{'id':_0x64df38[_0xa124('0x4a')]['id']}})[_0xa124('0x26')](handleEntityNotFound(_0x51bdee,null))[_0xa124('0x26')](function(_0x50c552){if(_0x50c552){return _0x50c552[_0xa124('0x84')](_0x64df38['query'][_0xa124('0x67')]);}})[_0xa124('0x26')](function(_0x3d8383){if(_0x3d8383){return db[_0xa124('0x5d')][_0xa124('0x25')]({'where':{'ListId':_0x64df38[_0xa124('0x34')][_0xa124('0x67')],'CampaignId':_0x64df38[_0xa124('0x4a')]['id']}})[_0xa124('0x26')](function(){return _0x3d8383;});}})[_0xa124('0x26')](respondWithStatusCode(_0x51bdee,null))[_0xa124('0x48')](handleError(_0x51bdee,null));};exports['getBlackLists']=function(_0x39d3ef,_0x16353d,_0x10780e){var _0xb7649c={};var _0x38a74a={};var _0x42b9f6;var _0x1e3d88;return db[_0xa124('0x2e')]['findOne']({'where':{'id':_0x39d3ef['params']['id']}})[_0xa124('0x26')](handleEntityNotFound(_0x16353d,null))['then'](function(_0x2556c9){if(_0x2556c9){_0x42b9f6=_0x2556c9;_0x38a74a[_0xa124('0x33')]=_[_0xa124('0x35')](db[_0xa124('0x65')]['rawAttributes']);_0x38a74a['query']=_[_0xa124('0x35')](_0x39d3ef[_0xa124('0x34')]);_0x38a74a['filters']=_['intersection'](_0x38a74a[_0xa124('0x33')],_0x38a74a[_0xa124('0x34')]);_0xb7649c[_0xa124('0x37')]=_['intersection'](_0x38a74a['model'],qs['fields'](_0x39d3ef['query'][_0xa124('0x38')]));_0xb7649c[_0xa124('0x37')]=_0xb7649c['attributes']['length']?_0xb7649c[_0xa124('0x37')]:_0x38a74a['model'];_0xb7649c[_0xa124('0x3b')]=qs[_0xa124('0x3c')](_0x39d3ef[_0xa124('0x34')][_0xa124('0x3c')]);_0xb7649c['where']=qs[_0xa124('0x3d')](_[_0xa124('0x3e')](_0x39d3ef['query'],_0x38a74a[_0xa124('0x3d')]));if(_0x39d3ef[_0xa124('0x34')]['filter']){_0xb7649c[_0xa124('0x40')]=_[_0xa124('0x41')](_0xb7649c[_0xa124('0x40')],{'$or':_[_0xa124('0x2d')](_0xb7649c['attributes'],function(_0x2cb1c2){var _0x5489de={};_0x5489de[_0x2cb1c2]={'$like':'%'+_0x39d3ef[_0xa124('0x34')]['filter']+'%'};return _0x5489de;})});}_0xb7649c=_[_0xa124('0x41')]({},_0xb7649c,_0x39d3ef[_0xa124('0x43')]);return _0x42b9f6[_0xa124('0x85')](_0xb7649c);}})[_0xa124('0x26')](function(_0x186d04){if(_0x186d04){_0x1e3d88=_0x186d04[_0xa124('0x54')];if(!_0x39d3ef[_0xa124('0x34')][_0xa124('0x39')]('nolimit')){_0xb7649c[_0xa124('0x1d')]=qs[_0xa124('0x1d')](_0x39d3ef[_0xa124('0x34')][_0xa124('0x1d')]);_0xb7649c[_0xa124('0x1b')]=qs[_0xa124('0x1b')](_0x39d3ef[_0xa124('0x34')][_0xa124('0x1b')]);}return _0x42b9f6[_0xa124('0x85')](_0xb7649c);}})[_0xa124('0x26')](function(_0x201e8a){if(_0x201e8a){return _0x201e8a?{'count':_0x1e3d88,'rows':_0x201e8a}:null;}})[_0xa124('0x26')](respondWithResult(_0x16353d,null))[_0xa124('0x48')](handleError(_0x16353d,null));};exports[_0xa124('0x86')]=function(_0x2c3854,_0x156080,_0x59afcd){var _0x1b3290,_0xd41530;return db[_0xa124('0x2e')][_0xa124('0x50')]({'where':{'id':_0x2c3854[_0xa124('0x4a')]['id']}})[_0xa124('0x26')](handleEntityNotFound(_0x156080,null))['then'](function(_0x1e3214){if(_0x1e3214){_0xd41530=_0x1e3214;return _0x1e3214['addBlackLists'](_0x2c3854['body']['ids'],_[_0xa124('0x55')](_0x2c3854['body'],[_0xa124('0x67'),'id'])||{});}return null;})[_0xa124('0x68')](function(_0x2e4cf7){var _0x11b265;_0x1b3290=_0x2e4cf7||[];var _0x180a06=[];if(_0x2e4cf7){for(var _0x1ff806=0x0;_0x1ff806<_0x2e4cf7['length'];_0x1ff806+=0x1){var _0x4f49ea=_0x2e4cf7[_0x1ff806][_0xa124('0x27')]({'plain':!![]});_0x11b265=squel[_0xa124('0x6a')]()[_0xa124('0x6b')]('cm_hopper_black')[_0xa124('0x6c')](['phone',_0xa124('0x6f'),'ListId',_0xa124('0x5c'),'createdAt',_0xa124('0x57')],squel['select']()[_0xa124('0x72')](_0xa124('0x6d'),'phone')['field']('id',_0xa124('0x6f'))[_0xa124('0x72')](_0x4f49ea['CmListId']['toString'](),_0xa124('0x70'))[_0xa124('0x72')](_0x2c3854[_0xa124('0x4a')]['id'][_0xa124('0x75')](),_0xa124('0x5c'))[_0xa124('0x72')](_0xa124('0x73'),_0xa124('0x56'))[_0xa124('0x72')](_0xa124('0x73'),_0xa124('0x57'))[_0xa124('0x79')](_0xa124('0x76'))[_0xa124('0x40')](_0xa124('0x7f'))['where'](_0xa124('0x77'),_0x4f49ea[_0xa124('0x74')][_0xa124('0x75')]())[_0xa124('0x40')]('phone\x20IS\x20NOT\x20NULL'))[_0xa124('0x75')]();_0x180a06[_0xa124('0x81')](db[_0xa124('0x82')][_0xa124('0x34')](_0x11b265));}return BPromise[_0xa124('0x83')](_0x180a06);}})['then'](function(){return _0x1b3290;})[_0xa124('0x26')](respondWithResult(_0x156080,null))[_0xa124('0x48')](handleError(_0x156080,null));};exports[_0xa124('0x87')]=function(_0x2489d4,_0x401c1c,_0x3fb2ae){return db['Campaign'][_0xa124('0x50')]({'where':{'id':_0x2489d4[_0xa124('0x4a')]['id']}})[_0xa124('0x26')](handleEntityNotFound(_0x401c1c,null))[_0xa124('0x26')](function(_0x5e492d){if(_0x5e492d){return _0x5e492d[_0xa124('0x87')](_0x2489d4[_0xa124('0x34')]['ids']);}})['then'](function(_0x101cc8){if(_0x101cc8){return db[_0xa124('0x63')][_0xa124('0x25')]({'where':{'ListId':_0x2489d4[_0xa124('0x34')][_0xa124('0x67')],'CampaignId':_0x2489d4[_0xa124('0x4a')]['id']}})[_0xa124('0x26')](function(){return _0x101cc8;});}})[_0xa124('0x26')](respondWithStatusCode(_0x401c1c,null))[_0xa124('0x48')](handleError(_0x401c1c,null));};
\ No newline at end of file
+var _0x90c5=['CampaignId','CmHopper','findAll','findOne','CmHopperHistory','getHopperFinals','CmHopperFinal','CmHopperBlack','getLists','CmList','addLists','ids','dialCheckDuplicateType','always','insert','into','fromQuery','phone','scheduledAt','select','field','ContactId','toString','NOW()','deletedAt\x20IS\x20NULL','ListId\x20=\x20?','CmListId','phone\x20NOT\x20IN\x20(?)','COALESCE(calleridnum,\x27\x27)','from','CampaignId\x20=\x20?','COALESCE(phone,\x27\x27)','cm_hopper','onlyIfOpen','cm_contacts','ListId','phone\x20IS\x20NOT\x20NULL','sequelize','all','removeLists','getBlackLists','addBlackLists','spread','cm_hopper_black','push','removeBlackLists','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','ejs','fs-extra','lodash','squel','crypto','desk.js','to-csv','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','sendStatus','status','end','offset','undefined','count','limit','reject','save','destroy','then','get','IvrCampaigns','UserProfileResource','error','stack','name','send','map','Campaign','rawAttributes','fieldName','type','model','query','keys','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filters','filter','merge','VIRTUAL','options','includeAll','include','rows','catch','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','clone','omit','createdAt','updatedAt','update','getHoppers'];(function(_0x4b8dfd,_0x3efad5){var _0x55b94a=function(_0x443de7){while(--_0x443de7){_0x4b8dfd['push'](_0x4b8dfd['shift']());}};_0x55b94a(++_0x3efad5);}(_0x90c5,0xb4));var _0x590c=function(_0x3c0488,_0x5c74fb){_0x3c0488=_0x3c0488-0x0;var _0x4c0f26=_0x90c5[_0x3c0488];return _0x4c0f26;};'use strict';var emlformat=require(_0x590c('0x0'));var rimraf=require(_0x590c('0x1'));var zipdir=require(_0x590c('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x590c('0x3'));var moment=require(_0x590c('0x4'));var BPromise=require(_0x590c('0x5'));var Mustache=require(_0x590c('0x6'));var util=require(_0x590c('0x7'));var path=require('path');var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x590c('0x8'));var fs=require('fs');var fs_extra=require(_0x590c('0x9'));var _=require(_0x590c('0xa'));var squel=require(_0x590c('0xb'));var crypto=require(_0x590c('0xc'));var jsforce=require('jsforce');var deskjs=require(_0x590c('0xd'));var toCsv=require(_0x590c('0xe'));var querystring=require('querystring');var Papa=require(_0x590c('0xf'));var Redis=require(_0x590c('0x10'));var authService=require(_0x590c('0x11'));var qs=require(_0x590c('0x12'));var as=require(_0x590c('0x13'));var hardwareService=require(_0x590c('0x14'));var logger=require(_0x590c('0x15'))(_0x590c('0x16'));var utils=require(_0x590c('0x17'));var config=require(_0x590c('0x18'));var licenseUtil=require(_0x590c('0x19'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x2e54f6,_0x4e310c){_0x4e310c=_0x4e310c||0xcc;return function(_0x3f617b){if(_0x3f617b){return _0x2e54f6[_0x590c('0x1a')](_0x4e310c);}return _0x2e54f6[_0x590c('0x1b')](_0x4e310c)[_0x590c('0x1c')]();};}function respondWithResult(_0x4862eb,_0x3f4fcf){_0x3f4fcf=_0x3f4fcf||0xc8;return function(_0x32d4e8){if(_0x32d4e8){return _0x4862eb['status'](_0x3f4fcf)['json'](_0x32d4e8);}};}function respondWithFilteredResult(_0x332dd1,_0x908ec0){return function(_0x503922){if(_0x503922){var _0x4c0214=typeof _0x908ec0[_0x590c('0x1d')]==='undefined'&&typeof _0x908ec0['limit']===_0x590c('0x1e');var _0x560e60=_0x503922['count'];var _0x2e2332=_0x4c0214?0x0:_0x908ec0[_0x590c('0x1d')];var _0x22aac8=_0x4c0214?_0x503922[_0x590c('0x1f')]:_0x908ec0['offset']+_0x908ec0[_0x590c('0x20')];var _0x1be593;if(_0x22aac8>=_0x560e60){_0x22aac8=_0x560e60;_0x1be593=0xc8;}else{_0x1be593=0xce;}_0x332dd1[_0x590c('0x1b')](_0x1be593);return _0x332dd1['set']('Content-Range',_0x2e2332+'-'+_0x22aac8+'/'+_0x560e60)['json'](_0x503922);}return null;};}function patchUpdates(_0x4e39ba){return function(_0x207094){try{jsonpatch['apply'](_0x207094,_0x4e39ba,!![]);}catch(_0x51c5a4){return BPromise[_0x590c('0x21')](_0x51c5a4);}return _0x207094[_0x590c('0x22')]();};}function saveUpdates(_0x3d0416,_0x18371a){return function(_0x1f329f){if(_0x1f329f){return _0x1f329f['update'](_0x3d0416)['then'](function(_0x205d29){return _0x205d29;});}return null;};}function removeEntity(_0x15fe93,_0x408e90){return function(_0x3c1b20){if(_0x3c1b20){return _0x3c1b20[_0x590c('0x23')]()[_0x590c('0x24')](function(){var _0x189380=_0x3c1b20[_0x590c('0x25')]({'plain':!![]});var _0xae88dd=_0x590c('0x26');return db[_0x590c('0x27')][_0x590c('0x23')]({'where':{'type':_0xae88dd,'resourceId':_0x189380['id']}})[_0x590c('0x24')](function(){return _0x3c1b20;});})['then'](function(){_0x15fe93[_0x590c('0x1b')](0xcc)[_0x590c('0x1c')]();});}};}function handleEntityNotFound(_0x1516db,_0x30fb7e){return function(_0x17520f){if(!_0x17520f){_0x1516db[_0x590c('0x1a')](0x194);}return _0x17520f;};}function handleError(_0x1ec69d,_0xf65ed4){_0xf65ed4=_0xf65ed4||0x1f4;return function(_0x475717){logger[_0x590c('0x28')](_0x475717[_0x590c('0x29')]);if(_0x475717[_0x590c('0x2a')]){delete _0x475717[_0x590c('0x2a')];}_0x1ec69d['status'](_0xf65ed4)[_0x590c('0x2b')](_0x475717);};}exports['index']=function(_0x544961,_0x1b2250){var _0x3ff1dd={},_0x3dfdb8={},_0x407e43={'count':0x0,'rows':[]};var _0x38927d=_[_0x590c('0x2c')](db[_0x590c('0x2d')][_0x590c('0x2e')],function(_0x326832){return{'name':_0x326832[_0x590c('0x2f')],'type':_0x326832[_0x590c('0x30')]['key']};});_0x3dfdb8[_0x590c('0x31')]=_[_0x590c('0x2c')](_0x38927d,_0x590c('0x2a'));_0x3dfdb8[_0x590c('0x32')]=_[_0x590c('0x33')](_0x544961[_0x590c('0x32')]);_0x3dfdb8['filters']=_[_0x590c('0x34')](_0x3dfdb8[_0x590c('0x31')],_0x3dfdb8['query']);_0x3ff1dd[_0x590c('0x35')]=_['intersection'](_0x3dfdb8[_0x590c('0x31')],qs[_0x590c('0x36')](_0x544961['query']['fields']));_0x3ff1dd['attributes']=_0x3ff1dd['attributes'][_0x590c('0x37')]?_0x3ff1dd[_0x590c('0x35')]:_0x3dfdb8['model'];if(!_0x544961[_0x590c('0x32')][_0x590c('0x38')](_0x590c('0x39'))){_0x3ff1dd['limit']=qs[_0x590c('0x20')](_0x544961[_0x590c('0x32')][_0x590c('0x20')]);_0x3ff1dd[_0x590c('0x1d')]=qs[_0x590c('0x1d')](_0x544961[_0x590c('0x32')][_0x590c('0x1d')]);}_0x3ff1dd[_0x590c('0x3a')]=qs['sort'](_0x544961[_0x590c('0x32')][_0x590c('0x3b')]);_0x3ff1dd[_0x590c('0x3c')]=qs['filters'](_[_0x590c('0x3d')](_0x544961[_0x590c('0x32')],_0x3dfdb8[_0x590c('0x3e')]),_0x38927d);if(_0x544961[_0x590c('0x32')][_0x590c('0x3f')]){_0x3ff1dd[_0x590c('0x3c')]=_[_0x590c('0x40')](_0x3ff1dd[_0x590c('0x3c')],{'$or':_[_0x590c('0x2c')](_0x38927d,function(_0x1712eb){if(_0x1712eb['type']!==_0x590c('0x41')){var _0xb95c5d={};_0xb95c5d[_0x1712eb[_0x590c('0x2a')]]={'$like':'%'+_0x544961[_0x590c('0x32')][_0x590c('0x3f')]+'%'};return _0xb95c5d;}})});}_0x3ff1dd=_[_0x590c('0x40')]({},_0x3ff1dd,_0x544961[_0x590c('0x42')]);var _0x3253fb={'where':_0x3ff1dd[_0x590c('0x3c')]};return db[_0x590c('0x2d')][_0x590c('0x1f')](_0x3253fb)[_0x590c('0x24')](function(_0x562183){_0x407e43[_0x590c('0x1f')]=_0x562183;if(_0x544961[_0x590c('0x32')][_0x590c('0x43')]){_0x3ff1dd[_0x590c('0x44')]=[{'all':!![]}];}return db[_0x590c('0x2d')]['findAll'](_0x3ff1dd);})[_0x590c('0x24')](function(_0x576cd9){_0x407e43[_0x590c('0x45')]=_0x576cd9;return _0x407e43;})[_0x590c('0x24')](respondWithFilteredResult(_0x1b2250,_0x3ff1dd))[_0x590c('0x46')](handleError(_0x1b2250,null));};exports['show']=function(_0x366eda,_0x415391){var _0x4aa2b8={'raw':![],'where':{'id':_0x366eda[_0x590c('0x47')]['id']}},_0x15fc96={};_0x15fc96[_0x590c('0x31')]=_[_0x590c('0x33')](db['Campaign'][_0x590c('0x2e')]);_0x15fc96[_0x590c('0x32')]=_[_0x590c('0x33')](_0x366eda[_0x590c('0x32')]);_0x15fc96[_0x590c('0x3e')]=_['intersection'](_0x15fc96[_0x590c('0x31')],_0x15fc96['query']);_0x4aa2b8[_0x590c('0x35')]=_['intersection'](_0x15fc96['model'],qs[_0x590c('0x36')](_0x366eda[_0x590c('0x32')]['fields']));_0x4aa2b8['attributes']=_0x4aa2b8['attributes'][_0x590c('0x37')]?_0x4aa2b8[_0x590c('0x35')]:_0x15fc96[_0x590c('0x31')];if(_0x366eda[_0x590c('0x32')][_0x590c('0x43')]){_0x4aa2b8[_0x590c('0x44')]=[{'all':!![]}];}_0x4aa2b8=_['merge']({},_0x4aa2b8,_0x366eda['options']);return db['Campaign'][_0x590c('0x48')](_0x4aa2b8)[_0x590c('0x24')](handleEntityNotFound(_0x415391,null))[_0x590c('0x24')](respondWithResult(_0x415391,null))[_0x590c('0x46')](handleError(_0x415391,null));};exports['create']=function(_0x2e60f2,_0x144678){return db[_0x590c('0x2d')][_0x590c('0x49')](_0x2e60f2[_0x590c('0x4a')],{})[_0x590c('0x24')](function(_0x588372){var _0x28a4b2=_0x2e60f2[_0x590c('0x4b')][_0x590c('0x25')]({'plain':!![]});if(!_0x28a4b2)throw new Error(_0x590c('0x4c'));if(_0x28a4b2[_0x590c('0x4d')]===_0x590c('0x4b')){var _0x5435b5=_0x588372[_0x590c('0x25')]({'plain':!![]});var _0x29d835='IvrCampaigns';return db[_0x590c('0x4e')][_0x590c('0x48')]({'where':{'name':_0x29d835,'userProfileId':_0x28a4b2[_0x590c('0x4f')]},'raw':!![]})[_0x590c('0x24')](function(_0x481a86){if(_0x481a86&&_0x481a86[_0x590c('0x50')]===0x0){return db[_0x590c('0x27')][_0x590c('0x49')]({'name':_0x5435b5['name'],'resourceId':_0x5435b5['id'],'type':_0x481a86[_0x590c('0x2a')],'sectionId':_0x481a86['id']},{})['then'](function(){return _0x588372;});}else{return _0x588372;}})[_0x590c('0x46')](function(_0x4119a3){logger[_0x590c('0x28')](_0x590c('0x51'),_0x4119a3);throw _0x4119a3;});}return _0x588372;})[_0x590c('0x24')](respondWithResult(_0x144678,0xc9))[_0x590c('0x46')](handleError(_0x144678,null));};exports[_0x590c('0x52')]=function(_0x18322e,_0x4eb5f0){var _0x1ed5f8={'where':{'id':_0x18322e[_0x590c('0x47')]['id']}},_0x8dee3={};_0x8dee3[_0x590c('0x31')]=_[_0x590c('0x33')](db['Campaign'][_0x590c('0x2e')]);_0x1ed5f8['attributes']=_['intersection'](_0x8dee3[_0x590c('0x31')],qs[_0x590c('0x36')](_0x18322e['query'][_0x590c('0x36')]));_0x1ed5f8[_0x590c('0x35')]=_0x1ed5f8[_0x590c('0x35')][_0x590c('0x37')]?_0x1ed5f8[_0x590c('0x35')]:_0x8dee3['model'];if(_0x18322e[_0x590c('0x32')][_0x590c('0x43')]){_0x1ed5f8[_0x590c('0x44')]=[{'all':!![]}];}_0x1ed5f8=_[_0x590c('0x40')]({},_0x1ed5f8,_0x18322e['options']);return db['Campaign'][_0x590c('0x48')](_0x1ed5f8)['then'](handleEntityNotFound(_0x4eb5f0,null))[_0x590c('0x24')](function(_0x6bd12b){if(_0x6bd12b){var _0x353938=_0x6bd12b[_0x590c('0x25')]({'plain':!![]});_0x353938=qs[_0x590c('0x53')](_0x353938,['id',_0x590c('0x54'),_0x590c('0x55')]);_0x18322e['body']=_[_0x590c('0x53')](_0x18322e[_0x590c('0x4a')],['id',_0x590c('0x54'),_0x590c('0x55')]);return db['Campaign'][_0x590c('0x49')](_[_0x590c('0x40')](_0x353938,_0x18322e[_0x590c('0x4a')]),{'include':_0x18322e[_0x590c('0x32')][_0x590c('0x43')]?[{'all':!![]}]:undefined})[_0x590c('0x24')](function(_0x50c32b){var _0x275993=_0x18322e['user'][_0x590c('0x25')]({'plain':!![]});if(!_0x275993)throw new Error(_0x590c('0x4c'));if(_0x275993[_0x590c('0x4d')]===_0x590c('0x4b')){var _0x450431=_0x50c32b['get']({'plain':!![]});var _0x30c3d8=_0x590c('0x26');return db[_0x590c('0x4e')][_0x590c('0x48')]({'where':{'name':_0x30c3d8,'userProfileId':_0x275993['userProfileId']},'raw':!![]})[_0x590c('0x24')](function(_0x410c0b){if(_0x410c0b&&_0x410c0b[_0x590c('0x50')]===0x0){return db[_0x590c('0x27')]['create']({'name':_0x450431['name'],'resourceId':_0x450431['id'],'type':_0x410c0b['name'],'sectionId':_0x410c0b['id']},{})[_0x590c('0x24')](function(){return _0x50c32b;});}else{return _0x50c32b;}})[_0x590c('0x46')](function(_0x5301ea){logger[_0x590c('0x28')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x5301ea);throw _0x5301ea;});}return _0x50c32b;});}})['then'](respondWithResult(_0x4eb5f0,0xc9))['catch'](handleError(_0x4eb5f0,null));};exports[_0x590c('0x56')]=function(_0x359910,_0x1efd98){if(_0x359910[_0x590c('0x4a')]['id']){delete _0x359910[_0x590c('0x4a')]['id'];}return db['Campaign'][_0x590c('0x48')]({'where':{'id':_0x359910['params']['id']}})[_0x590c('0x24')](handleEntityNotFound(_0x1efd98,null))['then'](saveUpdates(_0x359910[_0x590c('0x4a')],null))[_0x590c('0x24')](respondWithResult(_0x1efd98,null))['catch'](handleError(_0x1efd98,null));};exports[_0x590c('0x23')]=function(_0x2abe34,_0x50f6a6){return db[_0x590c('0x2d')][_0x590c('0x48')]({'where':{'id':_0x2abe34[_0x590c('0x47')]['id']}})[_0x590c('0x24')](handleEntityNotFound(_0x50f6a6,null))[_0x590c('0x24')](removeEntity(_0x50f6a6,null))[_0x590c('0x46')](handleError(_0x50f6a6,null));};exports[_0x590c('0x57')]=function(_0x4ccca8,_0x118dd1,_0x42ea48){var _0x147540={'raw':!![],'where':{}};var _0x2643c0={};var _0x9871e6={'count':0x0,'rows':[]};return db[_0x590c('0x2d')]['findOne']({'where':{'id':_0x4ccca8[_0x590c('0x47')]['id']}})[_0x590c('0x24')](handleEntityNotFound(_0x118dd1,null))['then'](function(_0x263e73){if(_0x263e73){_0x2643c0['model']=_[_0x590c('0x33')](db['CmHopper'][_0x590c('0x2e')]);_0x2643c0[_0x590c('0x32')]=_['keys'](_0x4ccca8[_0x590c('0x32')]);_0x2643c0[_0x590c('0x3e')]=_[_0x590c('0x34')](_0x2643c0[_0x590c('0x31')],_0x2643c0[_0x590c('0x32')]);_0x147540[_0x590c('0x35')]=_[_0x590c('0x34')](_0x2643c0[_0x590c('0x31')],qs[_0x590c('0x36')](_0x4ccca8[_0x590c('0x32')][_0x590c('0x36')]));_0x147540['attributes']=_0x147540[_0x590c('0x35')]['length']?_0x147540[_0x590c('0x35')]:_0x2643c0[_0x590c('0x31')];if(!_0x4ccca8[_0x590c('0x32')][_0x590c('0x38')]('nolimit')){_0x147540['limit']=qs[_0x590c('0x20')](_0x4ccca8[_0x590c('0x32')][_0x590c('0x20')]);_0x147540[_0x590c('0x1d')]=qs[_0x590c('0x1d')](_0x4ccca8[_0x590c('0x32')]['offset']);}_0x147540[_0x590c('0x3a')]=qs['sort'](_0x4ccca8[_0x590c('0x32')][_0x590c('0x3b')]);_0x147540[_0x590c('0x3c')]=qs[_0x590c('0x3e')](_['pick'](_0x4ccca8['query'],_0x2643c0[_0x590c('0x3e')]));_0x147540['where'][_0x590c('0x58')]=_0x263e73['id'];if(_0x4ccca8[_0x590c('0x32')][_0x590c('0x3f')]){_0x147540[_0x590c('0x3c')]=_[_0x590c('0x40')](_0x147540['where'],{'$or':_[_0x590c('0x2c')](_0x147540[_0x590c('0x35')],function(_0x3f76b9){var _0x4336fd={};_0x4336fd[_0x3f76b9]={'$like':'%'+_0x4ccca8['query']['filter']+'%'};return _0x4336fd;})});}_0x147540=_[_0x590c('0x40')]({},_0x147540,_0x4ccca8[_0x590c('0x42')]);return db['CmHopper'][_0x590c('0x1f')]({'where':_0x147540[_0x590c('0x3c')]})[_0x590c('0x24')](function(_0x2eba1f){_0x9871e6[_0x590c('0x1f')]=_0x2eba1f;if(_0x4ccca8['query'][_0x590c('0x43')]){_0x147540[_0x590c('0x44')]=[{'all':!![]}];}return db[_0x590c('0x59')][_0x590c('0x5a')](_0x147540);})[_0x590c('0x24')](function(_0x21b0d6){_0x9871e6[_0x590c('0x45')]=_0x21b0d6;return _0x9871e6;});}})[_0x590c('0x24')](respondWithFilteredResult(_0x118dd1,_0x147540))[_0x590c('0x46')](handleError(_0x118dd1,null));};exports['getHopperHistories']=function(_0x14fa86,_0x559b2e,_0x3b28e6){var _0x132de1={'raw':!![],'where':{}};var _0x52a1ab={};var _0xa72792={'count':0x0,'rows':[]};return db[_0x590c('0x2d')][_0x590c('0x5b')]({'where':{'id':_0x14fa86[_0x590c('0x47')]['id']}})[_0x590c('0x24')](handleEntityNotFound(_0x559b2e,null))['then'](function(_0x5a8f6d){if(_0x5a8f6d){_0x52a1ab[_0x590c('0x31')]=_[_0x590c('0x33')](db[_0x590c('0x5c')][_0x590c('0x2e')]);_0x52a1ab[_0x590c('0x32')]=_[_0x590c('0x33')](_0x14fa86[_0x590c('0x32')]);_0x52a1ab[_0x590c('0x3e')]=_['intersection'](_0x52a1ab[_0x590c('0x31')],_0x52a1ab[_0x590c('0x32')]);_0x132de1[_0x590c('0x35')]=_[_0x590c('0x34')](_0x52a1ab['model'],qs['fields'](_0x14fa86['query'][_0x590c('0x36')]));_0x132de1[_0x590c('0x35')]=_0x132de1[_0x590c('0x35')]['length']?_0x132de1['attributes']:_0x52a1ab[_0x590c('0x31')];if(!_0x14fa86[_0x590c('0x32')][_0x590c('0x38')](_0x590c('0x39'))){_0x132de1[_0x590c('0x20')]=qs[_0x590c('0x20')](_0x14fa86[_0x590c('0x32')][_0x590c('0x20')]);_0x132de1[_0x590c('0x1d')]=qs['offset'](_0x14fa86[_0x590c('0x32')][_0x590c('0x1d')]);}_0x132de1[_0x590c('0x3a')]=qs['sort'](_0x14fa86[_0x590c('0x32')][_0x590c('0x3b')]);_0x132de1[_0x590c('0x3c')]=qs[_0x590c('0x3e')](_[_0x590c('0x3d')](_0x14fa86[_0x590c('0x32')],_0x52a1ab[_0x590c('0x3e')]));_0x132de1['where'][_0x590c('0x58')]=_0x5a8f6d['id'];if(_0x14fa86['query'][_0x590c('0x3f')]){_0x132de1[_0x590c('0x3c')]=_[_0x590c('0x40')](_0x132de1[_0x590c('0x3c')],{'$or':_['map'](_0x132de1[_0x590c('0x35')],function(_0x50acd3){var _0x340ae7={};_0x340ae7[_0x50acd3]={'$like':'%'+_0x14fa86[_0x590c('0x32')][_0x590c('0x3f')]+'%'};return _0x340ae7;})});}_0x132de1=_[_0x590c('0x40')]({},_0x132de1,_0x14fa86[_0x590c('0x42')]);return db[_0x590c('0x5c')]['count']({'where':_0x132de1[_0x590c('0x3c')]})['then'](function(_0x4702a1){_0xa72792[_0x590c('0x1f')]=_0x4702a1;if(_0x14fa86[_0x590c('0x32')][_0x590c('0x43')]){_0x132de1[_0x590c('0x44')]=[{'all':!![]}];}return db['CmHopperHistory']['findAll'](_0x132de1);})[_0x590c('0x24')](function(_0x27895a){_0xa72792[_0x590c('0x45')]=_0x27895a;return _0xa72792;});}})[_0x590c('0x24')](respondWithFilteredResult(_0x559b2e,_0x132de1))[_0x590c('0x46')](handleError(_0x559b2e,null));};exports[_0x590c('0x5d')]=function(_0x56fdb1,_0x45ed12,_0x3646fe){var _0x356437={'raw':!![],'where':{}};var _0x3b2789={};var _0x111e49={'count':0x0,'rows':[]};return db[_0x590c('0x2d')][_0x590c('0x5b')]({'where':{'id':_0x56fdb1['params']['id']}})['then'](handleEntityNotFound(_0x45ed12,null))['then'](function(_0x3358c8){if(_0x3358c8){_0x3b2789[_0x590c('0x31')]=_[_0x590c('0x33')](db['CmHopperFinal'][_0x590c('0x2e')]);_0x3b2789['query']=_[_0x590c('0x33')](_0x56fdb1['query']);_0x3b2789['filters']=_[_0x590c('0x34')](_0x3b2789['model'],_0x3b2789['query']);_0x356437['attributes']=_['intersection'](_0x3b2789[_0x590c('0x31')],qs[_0x590c('0x36')](_0x56fdb1[_0x590c('0x32')][_0x590c('0x36')]));_0x356437[_0x590c('0x35')]=_0x356437[_0x590c('0x35')][_0x590c('0x37')]?_0x356437[_0x590c('0x35')]:_0x3b2789[_0x590c('0x31')];if(!_0x56fdb1[_0x590c('0x32')][_0x590c('0x38')]('nolimit')){_0x356437[_0x590c('0x20')]=qs['limit'](_0x56fdb1[_0x590c('0x32')][_0x590c('0x20')]);_0x356437[_0x590c('0x1d')]=qs['offset'](_0x56fdb1[_0x590c('0x32')][_0x590c('0x1d')]);}_0x356437[_0x590c('0x3a')]=qs[_0x590c('0x3b')](_0x56fdb1[_0x590c('0x32')]['sort']);_0x356437['where']=qs['filters'](_['pick'](_0x56fdb1[_0x590c('0x32')],_0x3b2789['filters']));_0x356437[_0x590c('0x3c')][_0x590c('0x58')]=_0x3358c8['id'];if(_0x56fdb1['query'][_0x590c('0x3f')]){_0x356437[_0x590c('0x3c')]=_[_0x590c('0x40')](_0x356437[_0x590c('0x3c')],{'$or':_['map'](_0x356437[_0x590c('0x35')],function(_0x4b09f2){var _0x133dd6={};_0x133dd6[_0x4b09f2]={'$like':'%'+_0x56fdb1['query']['filter']+'%'};return _0x133dd6;})});}_0x356437=_[_0x590c('0x40')]({},_0x356437,_0x56fdb1[_0x590c('0x42')]);return db['CmHopperFinal']['count']({'where':_0x356437[_0x590c('0x3c')]})['then'](function(_0x2f291c){_0x111e49['count']=_0x2f291c;if(_0x56fdb1[_0x590c('0x32')][_0x590c('0x43')]){_0x356437[_0x590c('0x44')]=[{'all':!![]}];}return db[_0x590c('0x5e')][_0x590c('0x5a')](_0x356437);})[_0x590c('0x24')](function(_0xbf1baa){_0x111e49['rows']=_0xbf1baa;return _0x111e49;});}})[_0x590c('0x24')](respondWithFilteredResult(_0x45ed12,_0x356437))['catch'](handleError(_0x45ed12,null));};exports['getHopperBlacks']=function(_0x467018,_0x15f738,_0x4d8b72){var _0xed9f2d={'raw':!![],'where':{}};var _0x1faaec={};var _0x474074={'count':0x0,'rows':[]};return db[_0x590c('0x2d')]['findOne']({'where':{'id':_0x467018['params']['id']}})[_0x590c('0x24')](handleEntityNotFound(_0x15f738,null))['then'](function(_0x182c32){if(_0x182c32){_0x1faaec[_0x590c('0x31')]=_[_0x590c('0x33')](db['CmHopperBlack']['rawAttributes']);_0x1faaec['query']=_[_0x590c('0x33')](_0x467018['query']);_0x1faaec[_0x590c('0x3e')]=_[_0x590c('0x34')](_0x1faaec[_0x590c('0x31')],_0x1faaec[_0x590c('0x32')]);_0xed9f2d[_0x590c('0x35')]=_[_0x590c('0x34')](_0x1faaec[_0x590c('0x31')],qs[_0x590c('0x36')](_0x467018[_0x590c('0x32')]['fields']));_0xed9f2d[_0x590c('0x35')]=_0xed9f2d[_0x590c('0x35')][_0x590c('0x37')]?_0xed9f2d[_0x590c('0x35')]:_0x1faaec['model'];if(!_0x467018[_0x590c('0x32')][_0x590c('0x38')](_0x590c('0x39'))){_0xed9f2d[_0x590c('0x20')]=qs['limit'](_0x467018[_0x590c('0x32')][_0x590c('0x20')]);_0xed9f2d[_0x590c('0x1d')]=qs[_0x590c('0x1d')](_0x467018[_0x590c('0x32')][_0x590c('0x1d')]);}_0xed9f2d[_0x590c('0x3a')]=qs['sort'](_0x467018[_0x590c('0x32')][_0x590c('0x3b')]);_0xed9f2d['where']=qs[_0x590c('0x3e')](_[_0x590c('0x3d')](_0x467018[_0x590c('0x32')],_0x1faaec[_0x590c('0x3e')]));_0xed9f2d[_0x590c('0x3c')][_0x590c('0x58')]=_0x182c32['id'];if(_0x467018[_0x590c('0x32')]['filter']){_0xed9f2d[_0x590c('0x3c')]=_[_0x590c('0x40')](_0xed9f2d['where'],{'$or':_['map'](_0xed9f2d[_0x590c('0x35')],function(_0xa6da0b){var _0x33b0be={};_0x33b0be[_0xa6da0b]={'$like':'%'+_0x467018[_0x590c('0x32')][_0x590c('0x3f')]+'%'};return _0x33b0be;})});}_0xed9f2d=_[_0x590c('0x40')]({},_0xed9f2d,_0x467018[_0x590c('0x42')]);return db[_0x590c('0x5f')][_0x590c('0x1f')]({'where':_0xed9f2d[_0x590c('0x3c')]})[_0x590c('0x24')](function(_0x4ed8d7){_0x474074['count']=_0x4ed8d7;if(_0x467018[_0x590c('0x32')][_0x590c('0x43')]){_0xed9f2d[_0x590c('0x44')]=[{'all':!![]}];}return db[_0x590c('0x5f')][_0x590c('0x5a')](_0xed9f2d);})[_0x590c('0x24')](function(_0x13ba07){_0x474074[_0x590c('0x45')]=_0x13ba07;return _0x474074;});}})[_0x590c('0x24')](respondWithFilteredResult(_0x15f738,_0xed9f2d))[_0x590c('0x46')](handleError(_0x15f738,null));};exports[_0x590c('0x60')]=function(_0x50f1f9,_0x5dc0d2,_0x13f85e){var _0x2ed354={};var _0x37fc8a={};var _0x2c92a5;var _0x75e5bc;return db[_0x590c('0x2d')][_0x590c('0x5b')]({'where':{'id':_0x50f1f9[_0x590c('0x47')]['id']}})[_0x590c('0x24')](handleEntityNotFound(_0x5dc0d2,null))['then'](function(_0x13c433){if(_0x13c433){_0x2c92a5=_0x13c433;_0x37fc8a[_0x590c('0x31')]=_[_0x590c('0x33')](db[_0x590c('0x61')]['rawAttributes']);_0x37fc8a[_0x590c('0x32')]=_[_0x590c('0x33')](_0x50f1f9[_0x590c('0x32')]);_0x37fc8a['filters']=_[_0x590c('0x34')](_0x37fc8a['model'],_0x37fc8a[_0x590c('0x32')]);_0x2ed354[_0x590c('0x35')]=_[_0x590c('0x34')](_0x37fc8a[_0x590c('0x31')],qs['fields'](_0x50f1f9[_0x590c('0x32')]['fields']));_0x2ed354['attributes']=_0x2ed354[_0x590c('0x35')][_0x590c('0x37')]?_0x2ed354['attributes']:_0x37fc8a[_0x590c('0x31')];_0x2ed354['order']=qs['sort'](_0x50f1f9['query'][_0x590c('0x3b')]);_0x2ed354[_0x590c('0x3c')]=qs[_0x590c('0x3e')](_[_0x590c('0x3d')](_0x50f1f9[_0x590c('0x32')],_0x37fc8a['filters']));if(_0x50f1f9['query']['filter']){_0x2ed354[_0x590c('0x3c')]=_[_0x590c('0x40')](_0x2ed354[_0x590c('0x3c')],{'$or':_[_0x590c('0x2c')](_0x2ed354['attributes'],function(_0x2e655d){var _0x41aaf0={};_0x41aaf0[_0x2e655d]={'$like':'%'+_0x50f1f9['query'][_0x590c('0x3f')]+'%'};return _0x41aaf0;})});}_0x2ed354=_[_0x590c('0x40')]({},_0x2ed354,_0x50f1f9[_0x590c('0x42')]);return _0x2c92a5['getLists'](_0x2ed354);}})['then'](function(_0x4ff91e){if(_0x4ff91e){_0x75e5bc=_0x4ff91e['length'];if(!_0x50f1f9[_0x590c('0x32')][_0x590c('0x38')](_0x590c('0x39'))){_0x2ed354['limit']=qs[_0x590c('0x20')](_0x50f1f9['query'][_0x590c('0x20')]);_0x2ed354[_0x590c('0x1d')]=qs['offset'](_0x50f1f9[_0x590c('0x32')][_0x590c('0x1d')]);}return _0x2c92a5['getLists'](_0x2ed354);}})[_0x590c('0x24')](function(_0x2b1299){if(_0x2b1299){return _0x2b1299?{'count':_0x75e5bc,'rows':_0x2b1299}:null;}})[_0x590c('0x24')](respondWithResult(_0x5dc0d2,null))[_0x590c('0x46')](handleError(_0x5dc0d2,null));};exports['addLists']=function(_0x23a44f,_0x37ddd9,_0x3d14fe){var _0x4c9250,_0x26895e;return db[_0x590c('0x2d')][_0x590c('0x48')]({'where':{'id':_0x23a44f[_0x590c('0x47')]['id']}})[_0x590c('0x24')](handleEntityNotFound(_0x37ddd9,null))[_0x590c('0x24')](function(_0x10d5dd){if(_0x10d5dd){_0x26895e=_0x10d5dd;return _0x10d5dd[_0x590c('0x62')](_0x23a44f[_0x590c('0x4a')][_0x590c('0x63')],_[_0x590c('0x53')](_0x23a44f['body'],['ids','id'])||{});}return null;})['spread'](function(_0x524143){var _0x5ae2f5;_0x4c9250=_0x524143||[];var _0x139316=[];if(_0x524143){for(var _0x48820e=0x0;_0x48820e<_0x524143[_0x590c('0x37')];_0x48820e+=0x1){var _0x3c9f77=_0x524143[_0x48820e][_0x590c('0x25')]({'plain':!![]});_0x26895e[_0x590c('0x64')]=_0x23a44f['body'][_0x590c('0x64')]?_0x23a44f[_0x590c('0x4a')]['dialCheckDuplicateType']:_0x26895e[_0x590c('0x64')];switch(_0x26895e['dialCheckDuplicateType']){case _0x590c('0x65'):_0x5ae2f5=squel[_0x590c('0x66')]()[_0x590c('0x67')]('cm_hopper')[_0x590c('0x68')]([_0x590c('0x69'),_0x590c('0x6a'),'ContactId','ListId',_0x590c('0x58'),_0x590c('0x54'),_0x590c('0x55')],squel[_0x590c('0x6b')]()[_0x590c('0x6c')](_0x590c('0x69'),'phone')[_0x590c('0x6c')]('NOW()',_0x590c('0x6a'))[_0x590c('0x6c')]('id',_0x590c('0x6d'))[_0x590c('0x6c')](_0x3c9f77['CmListId'][_0x590c('0x6e')](),'ListId')[_0x590c('0x6c')](_0x23a44f[_0x590c('0x47')]['id'][_0x590c('0x6e')](),_0x590c('0x58'))[_0x590c('0x6c')](_0x590c('0x6f'),'createdAt')[_0x590c('0x6c')](_0x590c('0x6f'),_0x590c('0x55'))['from']('cm_contacts')['where'](_0x590c('0x70'))[_0x590c('0x3c')](_0x590c('0x71'),_0x3c9f77[_0x590c('0x72')][_0x590c('0x6e')]())[_0x590c('0x3c')]('phone\x20IS\x20NOT\x20NULL')[_0x590c('0x3c')](_0x590c('0x73'),squel[_0x590c('0x6b')]()['field'](_0x590c('0x74'))[_0x590c('0x75')]('cm_hopper_final')[_0x590c('0x3c')](_0x590c('0x76'),_0x23a44f['params']['id']['toString']()))['where'](_0x590c('0x73'),squel[_0x590c('0x6b')]()[_0x590c('0x6c')](_0x590c('0x77'))[_0x590c('0x75')](_0x590c('0x78'))[_0x590c('0x3c')]('CampaignId\x20=\x20?',_0x23a44f[_0x590c('0x47')]['id'][_0x590c('0x6e')]())))[_0x590c('0x6e')]();break;case _0x590c('0x79'):_0x5ae2f5=squel[_0x590c('0x66')]()[_0x590c('0x67')](_0x590c('0x78'))['fromQuery']([_0x590c('0x69'),_0x590c('0x6a'),_0x590c('0x6d'),'ListId',_0x590c('0x58'),_0x590c('0x54'),_0x590c('0x55')],squel[_0x590c('0x6b')]()[_0x590c('0x6c')](_0x590c('0x69'),_0x590c('0x69'))[_0x590c('0x6c')](_0x590c('0x6f'),_0x590c('0x6a'))['field']('id','ContactId')[_0x590c('0x6c')](_0x3c9f77[_0x590c('0x72')][_0x590c('0x6e')](),'ListId')[_0x590c('0x6c')](_0x23a44f[_0x590c('0x47')]['id']['toString'](),_0x590c('0x58'))[_0x590c('0x6c')](_0x590c('0x6f'),'createdAt')[_0x590c('0x6c')]('NOW()',_0x590c('0x55'))[_0x590c('0x75')](_0x590c('0x7a'))['where'](_0x590c('0x70'))[_0x590c('0x3c')](_0x590c('0x71'),_0x3c9f77[_0x590c('0x72')][_0x590c('0x6e')]())[_0x590c('0x3c')]('phone\x20IS\x20NOT\x20NULL')[_0x590c('0x3c')]('phone\x20NOT\x20IN\x20(?)',squel[_0x590c('0x6b')]()[_0x590c('0x6c')](_0x590c('0x77'))[_0x590c('0x75')](_0x590c('0x78'))['where']('CampaignId\x20=\x20?',_0x23a44f[_0x590c('0x47')]['id'][_0x590c('0x6e')]())))[_0x590c('0x6e')]();break;default:_0x5ae2f5=squel[_0x590c('0x66')]()['into'](_0x590c('0x78'))[_0x590c('0x68')]([_0x590c('0x69'),_0x590c('0x6a'),'ContactId',_0x590c('0x7b'),_0x590c('0x58'),_0x590c('0x54'),_0x590c('0x55')],squel[_0x590c('0x6b')]()[_0x590c('0x6c')](_0x590c('0x69'),_0x590c('0x69'))[_0x590c('0x6c')]('NOW()',_0x590c('0x6a'))['field']('id',_0x590c('0x6d'))[_0x590c('0x6c')](_0x3c9f77[_0x590c('0x72')][_0x590c('0x6e')](),_0x590c('0x7b'))[_0x590c('0x6c')](_0x23a44f[_0x590c('0x47')]['id'][_0x590c('0x6e')](),_0x590c('0x58'))[_0x590c('0x6c')](_0x590c('0x6f'),'createdAt')['field'](_0x590c('0x6f'),'updatedAt')[_0x590c('0x75')]('cm_contacts')['where'](_0x590c('0x70'))[_0x590c('0x3c')](_0x590c('0x71'),_0x3c9f77[_0x590c('0x72')][_0x590c('0x6e')]())[_0x590c('0x3c')](_0x590c('0x7c')))['toString']();}_0x139316['push'](db[_0x590c('0x7d')][_0x590c('0x32')](_0x5ae2f5));}return BPromise[_0x590c('0x7e')](_0x139316);}})['then'](function(){return _0x4c9250;})[_0x590c('0x24')](respondWithResult(_0x37ddd9,null))[_0x590c('0x46')](handleError(_0x37ddd9,null));};exports[_0x590c('0x7f')]=function(_0xc54b20,_0x1a6f3e,_0x1a7fc9){return db[_0x590c('0x2d')][_0x590c('0x48')]({'where':{'id':_0xc54b20[_0x590c('0x47')]['id']}})[_0x590c('0x24')](handleEntityNotFound(_0x1a6f3e,null))[_0x590c('0x24')](function(_0x249aca){if(_0x249aca){return _0x249aca[_0x590c('0x7f')](_0xc54b20[_0x590c('0x32')][_0x590c('0x63')]);}})[_0x590c('0x24')](function(_0x223995){if(_0x223995){return db[_0x590c('0x59')]['destroy']({'where':{'ListId':_0xc54b20[_0x590c('0x32')]['ids'],'CampaignId':_0xc54b20[_0x590c('0x47')]['id']}})[_0x590c('0x24')](function(){return _0x223995;});}})['then'](respondWithStatusCode(_0x1a6f3e,null))['catch'](handleError(_0x1a6f3e,null));};exports['getBlackLists']=function(_0x4cc720,_0x4b33c3,_0x167993){var _0x3fb909={};var _0x214354={};var _0x4a5585;var _0x7bc81c;return db[_0x590c('0x2d')][_0x590c('0x5b')]({'where':{'id':_0x4cc720[_0x590c('0x47')]['id']}})[_0x590c('0x24')](handleEntityNotFound(_0x4b33c3,null))[_0x590c('0x24')](function(_0xef6030){if(_0xef6030){_0x4a5585=_0xef6030;_0x214354[_0x590c('0x31')]=_[_0x590c('0x33')](db[_0x590c('0x61')]['rawAttributes']);_0x214354[_0x590c('0x32')]=_[_0x590c('0x33')](_0x4cc720[_0x590c('0x32')]);_0x214354[_0x590c('0x3e')]=_[_0x590c('0x34')](_0x214354[_0x590c('0x31')],_0x214354[_0x590c('0x32')]);_0x3fb909['attributes']=_['intersection'](_0x214354[_0x590c('0x31')],qs['fields'](_0x4cc720[_0x590c('0x32')][_0x590c('0x36')]));_0x3fb909[_0x590c('0x35')]=_0x3fb909['attributes'][_0x590c('0x37')]?_0x3fb909[_0x590c('0x35')]:_0x214354[_0x590c('0x31')];_0x3fb909[_0x590c('0x3a')]=qs[_0x590c('0x3b')](_0x4cc720[_0x590c('0x32')][_0x590c('0x3b')]);_0x3fb909['where']=qs['filters'](_['pick'](_0x4cc720[_0x590c('0x32')],_0x214354[_0x590c('0x3e')]));if(_0x4cc720['query'][_0x590c('0x3f')]){_0x3fb909['where']=_[_0x590c('0x40')](_0x3fb909[_0x590c('0x3c')],{'$or':_[_0x590c('0x2c')](_0x3fb909['attributes'],function(_0x406578){var _0x277f68={};_0x277f68[_0x406578]={'$like':'%'+_0x4cc720[_0x590c('0x32')][_0x590c('0x3f')]+'%'};return _0x277f68;})});}_0x3fb909=_[_0x590c('0x40')]({},_0x3fb909,_0x4cc720[_0x590c('0x42')]);return _0x4a5585[_0x590c('0x80')](_0x3fb909);}})[_0x590c('0x24')](function(_0x204c27){if(_0x204c27){_0x7bc81c=_0x204c27['length'];if(!_0x4cc720[_0x590c('0x32')][_0x590c('0x38')]('nolimit')){_0x3fb909['limit']=qs[_0x590c('0x20')](_0x4cc720['query'][_0x590c('0x20')]);_0x3fb909[_0x590c('0x1d')]=qs['offset'](_0x4cc720['query']['offset']);}return _0x4a5585[_0x590c('0x80')](_0x3fb909);}})['then'](function(_0x4a7550){if(_0x4a7550){return _0x4a7550?{'count':_0x7bc81c,'rows':_0x4a7550}:null;}})[_0x590c('0x24')](respondWithResult(_0x4b33c3,null))[_0x590c('0x46')](handleError(_0x4b33c3,null));};exports[_0x590c('0x81')]=function(_0x54c85a,_0x529c88,_0x22cbb5){var _0x176fb5,_0x2a5885;return db[_0x590c('0x2d')][_0x590c('0x48')]({'where':{'id':_0x54c85a[_0x590c('0x47')]['id']}})[_0x590c('0x24')](handleEntityNotFound(_0x529c88,null))[_0x590c('0x24')](function(_0x5f2d33){if(_0x5f2d33){_0x2a5885=_0x5f2d33;return _0x5f2d33['addBlackLists'](_0x54c85a[_0x590c('0x4a')]['ids'],_[_0x590c('0x53')](_0x54c85a['body'],[_0x590c('0x63'),'id'])||{});}return null;})[_0x590c('0x82')](function(_0x5b413c){var _0x163bc9;_0x176fb5=_0x5b413c||[];var _0x48048e=[];if(_0x5b413c){for(var _0x1642d1=0x0;_0x1642d1<_0x5b413c[_0x590c('0x37')];_0x1642d1+=0x1){var _0x3fc5c3=_0x5b413c[_0x1642d1][_0x590c('0x25')]({'plain':!![]});_0x163bc9=squel[_0x590c('0x66')]()[_0x590c('0x67')](_0x590c('0x83'))['fromQuery']([_0x590c('0x69'),_0x590c('0x6d'),_0x590c('0x7b'),'CampaignId',_0x590c('0x54'),_0x590c('0x55')],squel[_0x590c('0x6b')]()[_0x590c('0x6c')](_0x590c('0x69'),_0x590c('0x69'))[_0x590c('0x6c')]('id',_0x590c('0x6d'))[_0x590c('0x6c')](_0x3fc5c3[_0x590c('0x72')][_0x590c('0x6e')](),'ListId')[_0x590c('0x6c')](_0x54c85a[_0x590c('0x47')]['id'][_0x590c('0x6e')](),_0x590c('0x58'))[_0x590c('0x6c')]('NOW()',_0x590c('0x54'))[_0x590c('0x6c')](_0x590c('0x6f'),_0x590c('0x55'))['from'](_0x590c('0x7a'))[_0x590c('0x3c')](_0x590c('0x70'))[_0x590c('0x3c')](_0x590c('0x71'),_0x3fc5c3[_0x590c('0x72')][_0x590c('0x6e')]())[_0x590c('0x3c')](_0x590c('0x7c')))[_0x590c('0x6e')]();_0x48048e[_0x590c('0x84')](db['sequelize'][_0x590c('0x32')](_0x163bc9));}return BPromise['all'](_0x48048e);}})[_0x590c('0x24')](function(){return _0x176fb5;})[_0x590c('0x24')](respondWithResult(_0x529c88,null))[_0x590c('0x46')](handleError(_0x529c88,null));};exports['removeBlackLists']=function(_0x596097,_0x4c38c1,_0x2b8acd){return db[_0x590c('0x2d')][_0x590c('0x48')]({'where':{'id':_0x596097[_0x590c('0x47')]['id']}})[_0x590c('0x24')](handleEntityNotFound(_0x4c38c1,null))[_0x590c('0x24')](function(_0x31dffc){if(_0x31dffc){return _0x31dffc[_0x590c('0x85')](_0x596097[_0x590c('0x32')][_0x590c('0x63')]);}})[_0x590c('0x24')](function(_0x1a4ae5){if(_0x1a4ae5){return db[_0x590c('0x5f')][_0x590c('0x23')]({'where':{'ListId':_0x596097['query']['ids'],'CampaignId':_0x596097[_0x590c('0x47')]['id']}})[_0x590c('0x24')](function(){return _0x1a4ae5;});}})[_0x590c('0x24')](respondWithStatusCode(_0x4c38c1,null))[_0x590c('0x46')](handleError(_0x4c38c1,null));};
\ No newline at end of file
diff --git a/server/api/campaign/campaign.model.js b/server/api/campaign/campaign.model.js
index 6fbc2ad..6791c22 100644
--- a/server/api/campaign/campaign.model.js
+++ b/server/api/campaign/campaign.model.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x9957=['exports','define','Campaign','lodash','util','../../config/logger','api','bluebird','request-promise','path','rimraf','./campaign.attributes'];(function(_0x176329,_0x568c84){var _0x31997c=function(_0x3d64df){while(--_0x3d64df){_0x176329['push'](_0x176329['shift']());}};_0x31997c(++_0x568c84);}(_0x9957,0x93));var _0x7995=function(_0x2dafbe,_0x5d04de){_0x2dafbe=_0x2dafbe-0x0;var _0x58a45a=_0x9957[_0x2dafbe];return _0x58a45a;};'use strict';var _=require(_0x7995('0x0'));var util=require(_0x7995('0x1'));var logger=require(_0x7995('0x2'))(_0x7995('0x3'));var moment=require('moment');var BPromise=require(_0x7995('0x4'));var rp=require(_0x7995('0x5'));var fs=require('fs');var path=require(_0x7995('0x6'));var rimraf=require(_0x7995('0x7'));var config=require('../../config/environment');var attributes=require(_0x7995('0x8'));module[_0x7995('0x9')]=function(_0x137b6b,_0x219534){return _0x137b6b[_0x7995('0xa')](_0x7995('0xb'),attributes,{'tableName':'campaigns','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x7a54=['../../config/logger','moment','bluebird','path','rimraf','../../config/environment','./campaign.attributes','exports','Campaign','campaigns','lodash','util'];(function(_0x186591,_0x41385c){var _0x54d42d=function(_0x50e4f9){while(--_0x50e4f9){_0x186591['push'](_0x186591['shift']());}};_0x54d42d(++_0x41385c);}(_0x7a54,0x106));var _0x47a5=function(_0x52b73a,_0x16cab9){_0x52b73a=_0x52b73a-0x0;var _0x3ae8a4=_0x7a54[_0x52b73a];return _0x3ae8a4;};'use strict';var _=require(_0x47a5('0x0'));var util=require(_0x47a5('0x1'));var logger=require(_0x47a5('0x2'))('api');var moment=require(_0x47a5('0x3'));var BPromise=require(_0x47a5('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x47a5('0x5'));var rimraf=require(_0x47a5('0x6'));var config=require(_0x47a5('0x7'));var attributes=require(_0x47a5('0x8'));module[_0x47a5('0x9')]=function(_0x545a97,_0x3d5629){return _0x545a97['define'](_0x47a5('0xa'),attributes,{'tableName':_0x47a5('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
diff --git a/server/api/campaign/campaign.rpc.js b/server/api/campaign/campaign.rpc.js
index a01156b..1dd9699 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 _0x4853=['where','attributes','map','include','model','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','client','http','then','info','Campaign,\x20%s,\x20%s','request\x20sent','debug','Campaign,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','GetCampaign','options','raw'];(function(_0x43f881,_0xd6e5a2){var _0x365c14=function(_0x50d386){while(--_0x50d386){_0x43f881['push'](_0x43f881['shift']());}};_0x365c14(++_0xd6e5a2);}(_0x4853,0x11d));var _0x3485=function(_0xa464c9,_0x7c86d8){_0xa464c9=_0xa464c9-0x0;var _0x3d73c4=_0x4853[_0xa464c9];return _0x3d73c4;};'use strict';var _=require('lodash');var util=require(_0x3485('0x0'));var moment=require('moment');var BPromise=require(_0x3485('0x1'));var rs=require(_0x3485('0x2'));var fs=require('fs');var Redis=require(_0x3485('0x3'));var db=require(_0x3485('0x4'))['db'];var utils=require(_0x3485('0x5'));var logger=require(_0x3485('0x6'))('rpc');var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x3485('0x7')][_0x3485('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x2442dd,_0x10ec4b,_0x41a183){return new BPromise(function(_0x29502b,_0x29db7b){return client['request'](_0x2442dd,_0x41a183)[_0x3485('0x9')](function(_0x302f8c){logger[_0x3485('0xa')](_0x3485('0xb'),_0x10ec4b,_0x3485('0xc'));logger[_0x3485('0xd')](_0x3485('0xe'),_0x10ec4b,_0x3485('0xc'),JSON[_0x3485('0xf')](_0x302f8c));if(_0x302f8c['error']){if(_0x302f8c[_0x3485('0x10')][_0x3485('0x11')]===0x1f4){logger['error']('Campaign,\x20%s,\x20%s',_0x10ec4b,_0x302f8c[_0x3485('0x10')][_0x3485('0x12')]);return _0x29db7b(_0x302f8c[_0x3485('0x10')]['message']);}logger['error']('Campaign,\x20%s,\x20%s',_0x10ec4b,_0x302f8c['error']['message']);return _0x29502b(_0x302f8c[_0x3485('0x10')][_0x3485('0x12')]);}else{logger[_0x3485('0xa')]('Campaign,\x20%s,\x20%s',_0x10ec4b,_0x3485('0xc'));_0x29502b(_0x302f8c['result']['message']);}})[_0x3485('0x13')](function(_0x50b06b){logger[_0x3485('0x10')](_0x3485('0xb'),_0x10ec4b,_0x50b06b);_0x29db7b(_0x50b06b);});});}exports[_0x3485('0x14')]=function(_0x444c00){var _0x5c151f=this;return new Promise(function(_0x585f8a,_0x5c36e4){return db['Campaign']['findAll']({'raw':_0x444c00[_0x3485('0x15')]?_0x444c00[_0x3485('0x15')][_0x3485('0x16')]===undefined?!![]:![]:!![],'where':_0x444c00[_0x3485('0x15')]?_0x444c00[_0x3485('0x15')][_0x3485('0x17')]||null:null,'attributes':_0x444c00[_0x3485('0x15')]?_0x444c00[_0x3485('0x15')][_0x3485('0x18')]||null:null,'limit':_0x444c00[_0x3485('0x15')]?_0x444c00[_0x3485('0x15')]['limit']||null:null,'include':_0x444c00['options']?_0x444c00[_0x3485('0x15')]['include']?_[_0x3485('0x19')](_0x444c00[_0x3485('0x15')][_0x3485('0x1a')],function(_0x2c846d){return{'model':db[_0x2c846d[_0x3485('0x1b')]],'as':_0x2c846d['as'],'attributes':_0x2c846d[_0x3485('0x18')],'include':_0x2c846d[_0x3485('0x1a')]?_[_0x3485('0x19')](_0x2c846d['include'],function(_0xba1190){return{'model':db[_0xba1190[_0x3485('0x1b')]],'as':_0xba1190['as'],'attributes':_0xba1190[_0x3485('0x18')],'include':_0xba1190[_0x3485('0x1a')]?_[_0x3485('0x19')](_0xba1190[_0x3485('0x1a')],function(_0x495402){return{'model':db[_0x495402[_0x3485('0x1b')]],'as':_0x495402['as'],'attributes':_0x495402[_0x3485('0x18')]};}):[]};}):[]};}):[]:[]})[_0x3485('0x9')](function(_0x40912e){logger[_0x3485('0xa')](_0x3485('0x14'),_0x444c00);logger['debug'](_0x3485('0x14'),_0x444c00,JSON[_0x3485('0xf')](_0x40912e));_0x585f8a(_0x40912e);})[_0x3485('0x13')](function(_0x1d77d4){logger[_0x3485('0x10')]('GetCampaign',_0x1d77d4[_0x3485('0x12')],_0x444c00);_0x5c36e4(_0x5c151f['error'](0x1f4,_0x1d77d4[_0x3485('0x12')]));});});};
\ No newline at end of file
+var _0xa477=['Campaign,\x20%s,\x20%s','request\x20sent','debug','Campaign,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','GetCampaign','Campaign','findAll','options','raw','where','attributes','limit','include','map','model','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','request','then','info'];(function(_0x2d11c4,_0x31b483){var _0x2406de=function(_0x1eda5b){while(--_0x1eda5b){_0x2d11c4['push'](_0x2d11c4['shift']());}};_0x2406de(++_0x31b483);}(_0xa477,0xe6));var _0x7a47=function(_0x2b4411,_0x2625ed){_0x2b4411=_0x2b4411-0x0;var _0x8e41ef=_0xa477[_0x2b4411];return _0x8e41ef;};'use strict';var _=require(_0x7a47('0x0'));var util=require(_0x7a47('0x1'));var moment=require('moment');var BPromise=require(_0x7a47('0x2'));var rs=require(_0x7a47('0x3'));var fs=require('fs');var Redis=require(_0x7a47('0x4'));var db=require(_0x7a47('0x5'))['db'];var utils=require(_0x7a47('0x6'));var logger=require(_0x7a47('0x7'))(_0x7a47('0x8'));var config=require('../../config/environment');var jayson=require(_0x7a47('0x9'));var client=jayson[_0x7a47('0xa')][_0x7a47('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x4c6e0e,_0x54e9aa,_0x47f594){return new BPromise(function(_0x4276ed,_0x49db4c){return client[_0x7a47('0xc')](_0x4c6e0e,_0x47f594)[_0x7a47('0xd')](function(_0x52eb49){logger[_0x7a47('0xe')](_0x7a47('0xf'),_0x54e9aa,_0x7a47('0x10'));logger[_0x7a47('0x11')](_0x7a47('0x12'),_0x54e9aa,'request\x20sent',JSON[_0x7a47('0x13')](_0x52eb49));if(_0x52eb49[_0x7a47('0x14')]){if(_0x52eb49[_0x7a47('0x14')][_0x7a47('0x15')]===0x1f4){logger['error'](_0x7a47('0xf'),_0x54e9aa,_0x52eb49[_0x7a47('0x14')][_0x7a47('0x16')]);return _0x49db4c(_0x52eb49[_0x7a47('0x14')][_0x7a47('0x16')]);}logger[_0x7a47('0x14')](_0x7a47('0xf'),_0x54e9aa,_0x52eb49[_0x7a47('0x14')]['message']);return _0x4276ed(_0x52eb49[_0x7a47('0x14')][_0x7a47('0x16')]);}else{logger[_0x7a47('0xe')](_0x7a47('0xf'),_0x54e9aa,'request\x20sent');_0x4276ed(_0x52eb49[_0x7a47('0x17')][_0x7a47('0x16')]);}})['catch'](function(_0x4a81fb){logger[_0x7a47('0x14')](_0x7a47('0xf'),_0x54e9aa,_0x4a81fb);_0x49db4c(_0x4a81fb);});});}exports[_0x7a47('0x18')]=function(_0x5a4e79){var _0x444c48=this;return new Promise(function(_0x4a24b6,_0x203ab4){return db[_0x7a47('0x19')][_0x7a47('0x1a')]({'raw':_0x5a4e79[_0x7a47('0x1b')]?_0x5a4e79[_0x7a47('0x1b')][_0x7a47('0x1c')]===undefined?!![]:![]:!![],'where':_0x5a4e79[_0x7a47('0x1b')]?_0x5a4e79[_0x7a47('0x1b')][_0x7a47('0x1d')]||null:null,'attributes':_0x5a4e79['options']?_0x5a4e79[_0x7a47('0x1b')][_0x7a47('0x1e')]||null:null,'limit':_0x5a4e79[_0x7a47('0x1b')]?_0x5a4e79[_0x7a47('0x1b')][_0x7a47('0x1f')]||null:null,'include':_0x5a4e79[_0x7a47('0x1b')]?_0x5a4e79[_0x7a47('0x1b')][_0x7a47('0x20')]?_[_0x7a47('0x21')](_0x5a4e79[_0x7a47('0x1b')][_0x7a47('0x20')],function(_0xe9bb12){return{'model':db[_0xe9bb12['model']],'as':_0xe9bb12['as'],'attributes':_0xe9bb12['attributes'],'include':_0xe9bb12[_0x7a47('0x20')]?_[_0x7a47('0x21')](_0xe9bb12[_0x7a47('0x20')],function(_0x3e598b){return{'model':db[_0x3e598b['model']],'as':_0x3e598b['as'],'attributes':_0x3e598b[_0x7a47('0x1e')],'include':_0x3e598b[_0x7a47('0x20')]?_['map'](_0x3e598b[_0x7a47('0x20')],function(_0x324a85){return{'model':db[_0x324a85[_0x7a47('0x22')]],'as':_0x324a85['as'],'attributes':_0x324a85[_0x7a47('0x1e')]};}):[]};}):[]};}):[]:[]})[_0x7a47('0xd')](function(_0x5b2a0c){logger[_0x7a47('0xe')](_0x7a47('0x18'),_0x5a4e79);logger[_0x7a47('0x11')](_0x7a47('0x18'),_0x5a4e79,JSON['stringify'](_0x5b2a0c));_0x4a24b6(_0x5b2a0c);})['catch'](function(_0x5d4b9c){logger[_0x7a47('0x14')](_0x7a47('0x18'),_0x5d4b9c[_0x7a47('0x16')],_0x5a4e79);_0x203ab4(_0x444c48[_0x7a47('0x14')](0x1f4,_0x5d4b9c[_0x7a47('0x16')]));});});};
\ No newline at end of file
diff --git a/server/api/campaign/index.js b/server/api/campaign/index.js
index c05147b..67323aa 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 _0x3172=['./campaign.controller','get','isAuthenticated','show','/:id/hoppers','getHoppers','/:id/hopper_histories','getHopperHistories','getHopperFinals','/:id/hopper_black','getHopperBlacks','getLists','/:id/blacklists','getBlackLists','post','addLists','/:id','delete','destroy','removeLists','removeBlackLists','exports','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service'];(function(_0x2704be,_0x2555d4){var _0x21d7b5=function(_0x5f2a1b){while(--_0x5f2a1b){_0x2704be['push'](_0x2704be['shift']());}};_0x21d7b5(++_0x2555d4);}(_0x3172,0x106));var _0x2317=function(_0x5bd426,_0x4878e5){_0x5bd426=_0x5bd426-0x0;var _0x23a7eb=_0x3172[_0x5bd426];return _0x23a7eb;};'use strict';var multer=require(_0x2317('0x0'));var util=require(_0x2317('0x1'));var path=require(_0x2317('0x2'));var timeout=require(_0x2317('0x3'));var express=require(_0x2317('0x4'));var router=express[_0x2317('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0x2317('0x6'));var interaction=require(_0x2317('0x7'));var config=require('../../config/environment');var controller=require(_0x2317('0x8'));router[_0x2317('0x9')]('/',auth[_0x2317('0xa')](),controller['index']);router[_0x2317('0x9')]('/:id',auth[_0x2317('0xa')](),controller[_0x2317('0xb')]);router[_0x2317('0x9')](_0x2317('0xc'),auth['isAuthenticated'](),controller[_0x2317('0xd')]);router[_0x2317('0x9')](_0x2317('0xe'),auth[_0x2317('0xa')](),controller[_0x2317('0xf')]);router[_0x2317('0x9')]('/:id/hopper_finals',auth[_0x2317('0xa')](),controller[_0x2317('0x10')]);router[_0x2317('0x9')](_0x2317('0x11'),auth[_0x2317('0xa')](),controller[_0x2317('0x12')]);router[_0x2317('0x9')]('/:id/lists',auth[_0x2317('0xa')](),controller[_0x2317('0x13')]);router['get'](_0x2317('0x14'),auth[_0x2317('0xa')](),controller[_0x2317('0x15')]);router['post']('/',auth['isAuthenticated'](),controller['create']);router[_0x2317('0x16')]('/:id/clone',auth['isAuthenticated'](),controller['clone']);router[_0x2317('0x16')]('/:id/lists',auth[_0x2317('0xa')](),controller[_0x2317('0x17')]);router[_0x2317('0x16')]('/:id/blacklists',auth['isAuthenticated'](),controller['addBlackLists']);router['put'](_0x2317('0x18'),auth[_0x2317('0xa')](),controller['update']);router[_0x2317('0x19')](_0x2317('0x18'),auth[_0x2317('0xa')](),controller[_0x2317('0x1a')]);router[_0x2317('0x19')]('/:id/lists',auth[_0x2317('0xa')](),controller[_0x2317('0x1b')]);router[_0x2317('0x19')](_0x2317('0x14'),auth['isAuthenticated'](),controller[_0x2317('0x1c')]);module[_0x2317('0x1d')]=router;
\ No newline at end of file
+var _0x7188=['get','index','isAuthenticated','show','getHoppers','getHopperFinals','/:id/hopper_black','getHopperBlacks','/:id/lists','getLists','/:id/blacklists','post','create','addLists','put','/:id','delete','removeLists','removeBlackLists','util','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./campaign.controller'];(function(_0xbff16e,_0x4d9923){var _0xcb701d=function(_0x5464b4){while(--_0x5464b4){_0xbff16e['push'](_0xbff16e['shift']());}};_0xcb701d(++_0x4d9923);}(_0x7188,0x172));var _0x8718=function(_0x3c10b7,_0x10fb4a){_0x3c10b7=_0x3c10b7-0x0;var _0xbd891b=_0x7188[_0x3c10b7];return _0xbd891b;};'use strict';var multer=require('multer');var util=require(_0x8718('0x0'));var path=require('path');var timeout=require(_0x8718('0x1'));var express=require(_0x8718('0x2'));var router=express[_0x8718('0x3')]();var fs_extra=require(_0x8718('0x4'));var auth=require(_0x8718('0x5'));var interaction=require(_0x8718('0x6'));var config=require('../../config/environment');var controller=require(_0x8718('0x7'));router[_0x8718('0x8')]('/',auth['isAuthenticated'](),controller[_0x8718('0x9')]);router[_0x8718('0x8')]('/:id',auth[_0x8718('0xa')](),controller[_0x8718('0xb')]);router[_0x8718('0x8')]('/:id/hoppers',auth['isAuthenticated'](),controller[_0x8718('0xc')]);router[_0x8718('0x8')]('/:id/hopper_histories',auth[_0x8718('0xa')](),controller['getHopperHistories']);router['get']('/:id/hopper_finals',auth['isAuthenticated'](),controller[_0x8718('0xd')]);router[_0x8718('0x8')](_0x8718('0xe'),auth[_0x8718('0xa')](),controller[_0x8718('0xf')]);router[_0x8718('0x8')](_0x8718('0x10'),auth['isAuthenticated'](),controller[_0x8718('0x11')]);router['get'](_0x8718('0x12'),auth[_0x8718('0xa')](),controller['getBlackLists']);router[_0x8718('0x13')]('/',auth[_0x8718('0xa')](),controller[_0x8718('0x14')]);router[_0x8718('0x13')]('/:id/clone',auth[_0x8718('0xa')](),controller['clone']);router[_0x8718('0x13')](_0x8718('0x10'),auth[_0x8718('0xa')](),controller[_0x8718('0x15')]);router['post'](_0x8718('0x12'),auth[_0x8718('0xa')](),controller['addBlackLists']);router[_0x8718('0x16')](_0x8718('0x17'),auth[_0x8718('0xa')](),controller['update']);router[_0x8718('0x18')](_0x8718('0x17'),auth[_0x8718('0xa')](),controller['destroy']);router['delete'](_0x8718('0x10'),auth['isAuthenticated'](),controller[_0x8718('0x19')]);router[_0x8718('0x18')]('/:id/blacklists',auth['isAuthenticated'](),controller[_0x8718('0x1a')]);module['exports']=router;
\ No newline at end of file
diff --git a/server/api/cannedAnswer/cannedAnswer.attributes.js b/server/api/cannedAnswer/cannedAnswer.attributes.js
index 15a3164..f50185f 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 _0x5b26=['TEXT','getDataValue','key','sequelize','STRING'];(function(_0x46f1a6,_0xc7a582){var _0x38429a=function(_0x31adae){while(--_0x31adae){_0x46f1a6['push'](_0x46f1a6['shift']());}};_0x38429a(++_0xc7a582);}(_0x5b26,0xb7));var _0x65b2=function(_0x42cae2,_0x284ef8){_0x42cae2=_0x42cae2-0x0;var _0x5f256f=_0x5b26[_0x42cae2];return _0x5f256f;};'use strict';var Sequelize=require(_0x65b2('0x0'));module['exports']={'key':{'type':Sequelize[_0x65b2('0x1')],'allowNull':![]},'value':{'type':Sequelize[_0x65b2('0x2')],'allowNull':![]},'description':{'type':Sequelize['STRING']},'name':{'type':Sequelize['VIRTUAL'],'get':function(){return this[_0x65b2('0x3')](_0x65b2('0x4'));}}};
\ No newline at end of file
+var _0xa4d7=['exports','TEXT','VIRTUAL','getDataValue','key','sequelize'];(function(_0x36ed48,_0x1ee0d4){var _0x51c63a=function(_0x2d0a40){while(--_0x2d0a40){_0x36ed48['push'](_0x36ed48['shift']());}};_0x51c63a(++_0x1ee0d4);}(_0xa4d7,0x1c7));var _0x7a4d=function(_0x25e01f,_0x159194){_0x25e01f=_0x25e01f-0x0;var _0x51b4f9=_0xa4d7[_0x25e01f];return _0x51b4f9;};'use strict';var Sequelize=require(_0x7a4d('0x0'));module[_0x7a4d('0x1')]={'key':{'type':Sequelize['STRING'],'allowNull':![]},'value':{'type':Sequelize[_0x7a4d('0x2')],'allowNull':![]},'description':{'type':Sequelize['STRING']},'name':{'type':Sequelize[_0x7a4d('0x3')],'get':function(){return this[_0x7a4d('0x4')](_0x7a4d('0x5'));}}};
\ No newline at end of file
diff --git a/server/api/cannedAnswer/cannedAnswer.controller.js b/server/api/cannedAnswer/cannedAnswer.controller.js
index 6a58a56..0221eda 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 _0xdcdc=['Content-Range','apply','reject','save','then','get','CannedAnswers','UserProfileResource','error','stack','name','send','index','map','rawAttributes','fieldName','type','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','where','filter','merge','CannedAnswer','includeAll','include','findAll','rows','catch','show','params','options','find','update','body','destroy','create','key','MailAccountId','SmsAccountId','OpenchannelAccountId','ChatWebsiteId','Sequelize','The\x20inserted\x20key\x20already\x20exists.','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','userProfileId','autoAssociation','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','squel','jsforce','desk.js','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','sendStatus','status','end','offset','undefined','limit','count','set'];(function(_0x2ca95e,_0x2b143b){var _0x239aa8=function(_0x102077){while(--_0x102077){_0x2ca95e['push'](_0x2ca95e['shift']());}};_0x239aa8(++_0x2b143b);}(_0xdcdc,0xea));var _0xcdcd=function(_0x502c7d,_0x2f1285){_0x502c7d=_0x502c7d-0x0;var _0x30b7ed=_0xdcdc[_0x502c7d];return _0x30b7ed;};'use strict';var emlformat=require(_0xcdcd('0x0'));var rimraf=require(_0xcdcd('0x1'));var zipdir=require(_0xcdcd('0x2'));var jsonpatch=require(_0xcdcd('0x3'));var rp=require(_0xcdcd('0x4'));var moment=require(_0xcdcd('0x5'));var BPromise=require(_0xcdcd('0x6'));var Mustache=require(_0xcdcd('0x7'));var util=require(_0xcdcd('0x8'));var path=require(_0xcdcd('0x9'));var sox=require(_0xcdcd('0xa'));var csv=require(_0xcdcd('0xb'));var ejs=require(_0xcdcd('0xc'));var fs=require('fs');var fs_extra=require(_0xcdcd('0xd'));var _=require('lodash');var squel=require(_0xcdcd('0xe'));var crypto=require('crypto');var jsforce=require(_0xcdcd('0xf'));var deskjs=require(_0xcdcd('0x10'));var toCsv=require(_0xcdcd('0xb'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0xcdcd('0x11'));var authService=require(_0xcdcd('0x12'));var qs=require('../../components/parsers/qs');var as=require(_0xcdcd('0x13'));var hardwareService=require(_0xcdcd('0x14'));var logger=require(_0xcdcd('0x15'))(_0xcdcd('0x16'));var utils=require('../../config/utils');var config=require(_0xcdcd('0x17'));var licenseUtil=require(_0xcdcd('0x18'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x447384,_0x77eb35){_0x77eb35=_0x77eb35||0xcc;return function(_0x5eb2be){if(_0x5eb2be){return _0x447384[_0xcdcd('0x19')](_0x77eb35);}return _0x447384[_0xcdcd('0x1a')](_0x77eb35)[_0xcdcd('0x1b')]();};}function respondWithResult(_0x4babaf,_0xda91d6){_0xda91d6=_0xda91d6||0xc8;return function(_0x5598f9){if(_0x5598f9){return _0x4babaf[_0xcdcd('0x1a')](_0xda91d6)['json'](_0x5598f9);}};}function respondWithFilteredResult(_0x41f829,_0x3cfcf9){return function(_0x281acd){if(_0x281acd){var _0xc3c99b=typeof _0x3cfcf9[_0xcdcd('0x1c')]===_0xcdcd('0x1d')&&typeof _0x3cfcf9[_0xcdcd('0x1e')]==='undefined';var _0x18ddea=_0x281acd[_0xcdcd('0x1f')];var _0x45e106=_0xc3c99b?0x0:_0x3cfcf9['offset'];var _0x482d35=_0xc3c99b?_0x281acd[_0xcdcd('0x1f')]:_0x3cfcf9[_0xcdcd('0x1c')]+_0x3cfcf9[_0xcdcd('0x1e')];var _0x21d3d5;if(_0x482d35>=_0x18ddea){_0x482d35=_0x18ddea;_0x21d3d5=0xc8;}else{_0x21d3d5=0xce;}_0x41f829[_0xcdcd('0x1a')](_0x21d3d5);return _0x41f829[_0xcdcd('0x20')](_0xcdcd('0x21'),_0x45e106+'-'+_0x482d35+'/'+_0x18ddea)['json'](_0x281acd);}return null;};}function patchUpdates(_0x44e04a){return function(_0x3a6ac6){try{jsonpatch[_0xcdcd('0x22')](_0x3a6ac6,_0x44e04a,!![]);}catch(_0x206de1){return BPromise[_0xcdcd('0x23')](_0x206de1);}return _0x3a6ac6[_0xcdcd('0x24')]();};}function saveUpdates(_0x45d418,_0x28bd95){return function(_0x26d68c){if(_0x26d68c){return _0x26d68c['update'](_0x45d418)[_0xcdcd('0x25')](function(_0x36c91a){return _0x36c91a;});}return null;};}function removeEntity(_0x45a54b,_0x1559b7){return function(_0x16a303){if(_0x16a303){return _0x16a303['destroy']()[_0xcdcd('0x25')](function(){var _0x90475=_0x16a303[_0xcdcd('0x26')]({'plain':!![]});var _0x630f84=_0xcdcd('0x27');return db[_0xcdcd('0x28')]['destroy']({'where':{'type':_0x630f84,'resourceId':_0x90475['id']}})[_0xcdcd('0x25')](function(){return _0x16a303;});})[_0xcdcd('0x25')](function(){_0x45a54b[_0xcdcd('0x1a')](0xcc)[_0xcdcd('0x1b')]();});}};}function handleEntityNotFound(_0xfd64be,_0x3d7612){return function(_0x507879){if(!_0x507879){_0xfd64be[_0xcdcd('0x19')](0x194);}return _0x507879;};}function handleError(_0x587efe,_0x154ddf){_0x154ddf=_0x154ddf||0x1f4;return function(_0x29dd88){logger[_0xcdcd('0x29')](_0x29dd88[_0xcdcd('0x2a')]);if(_0x29dd88[_0xcdcd('0x2b')]){delete _0x29dd88['name'];}_0x587efe['status'](_0x154ddf)[_0xcdcd('0x2c')](_0x29dd88);};}exports[_0xcdcd('0x2d')]=function(_0x4793bb,_0x30323b){var _0x79cfe6={},_0x2b5566={},_0x53db65={'count':0x0,'rows':[]};var _0x494690=_[_0xcdcd('0x2e')](db['CannedAnswer'][_0xcdcd('0x2f')],function(_0x593813){return{'name':_0x593813[_0xcdcd('0x30')],'type':_0x593813[_0xcdcd('0x31')]['key']};});_0x2b5566[_0xcdcd('0x32')]=_[_0xcdcd('0x2e')](_0x494690,'name');_0x2b5566[_0xcdcd('0x33')]=_[_0xcdcd('0x34')](_0x4793bb[_0xcdcd('0x33')]);_0x2b5566[_0xcdcd('0x35')]=_[_0xcdcd('0x36')](_0x2b5566[_0xcdcd('0x32')],_0x2b5566['query']);_0x79cfe6[_0xcdcd('0x37')]=_[_0xcdcd('0x36')](_0x2b5566[_0xcdcd('0x32')],qs[_0xcdcd('0x38')](_0x4793bb[_0xcdcd('0x33')][_0xcdcd('0x38')]));_0x79cfe6[_0xcdcd('0x37')]=_0x79cfe6[_0xcdcd('0x37')][_0xcdcd('0x39')]?_0x79cfe6['attributes']:_0x2b5566[_0xcdcd('0x32')];if(!_0x4793bb['query'][_0xcdcd('0x3a')](_0xcdcd('0x3b'))){_0x79cfe6['limit']=qs[_0xcdcd('0x1e')](_0x4793bb[_0xcdcd('0x33')]['limit']);_0x79cfe6[_0xcdcd('0x1c')]=qs['offset'](_0x4793bb[_0xcdcd('0x33')][_0xcdcd('0x1c')]);}_0x79cfe6['order']=qs[_0xcdcd('0x3c')](_0x4793bb['query'][_0xcdcd('0x3c')]);_0x79cfe6[_0xcdcd('0x3d')]=qs[_0xcdcd('0x35')](_['pick'](_0x4793bb[_0xcdcd('0x33')],_0x2b5566['filters']),_0x494690);if(_0x4793bb[_0xcdcd('0x33')][_0xcdcd('0x3e')]){_0x79cfe6['where']=_[_0xcdcd('0x3f')](_0x79cfe6[_0xcdcd('0x3d')],{'$or':[{'key':{'$like':'%'+_0x4793bb['query'][_0xcdcd('0x3e')]+'%'}},{'value':{'$like':'%'+_0x4793bb[_0xcdcd('0x33')][_0xcdcd('0x3e')]+'%'}}]});}_0x79cfe6=_['merge']({},_0x79cfe6,_0x4793bb['options']);var _0x285af8={'where':_0x79cfe6[_0xcdcd('0x3d')]};return db[_0xcdcd('0x40')]['count'](_0x285af8)[_0xcdcd('0x25')](function(_0x396438){_0x53db65[_0xcdcd('0x1f')]=_0x396438;if(_0x4793bb[_0xcdcd('0x33')][_0xcdcd('0x41')]){_0x79cfe6[_0xcdcd('0x42')]=[{'all':!![]}];}return db[_0xcdcd('0x40')][_0xcdcd('0x43')](_0x79cfe6);})[_0xcdcd('0x25')](function(_0x1f0794){_0x53db65[_0xcdcd('0x44')]=_0x1f0794;return _0x53db65;})[_0xcdcd('0x25')](respondWithFilteredResult(_0x30323b,_0x79cfe6))[_0xcdcd('0x45')](handleError(_0x30323b,null));};exports[_0xcdcd('0x46')]=function(_0x33e7dd,_0x5e29da){var _0x522a62={'raw':!![],'where':{'id':_0x33e7dd[_0xcdcd('0x47')]['id']}},_0x5250a1={};_0x5250a1[_0xcdcd('0x32')]=_[_0xcdcd('0x34')](db[_0xcdcd('0x40')]['rawAttributes']);_0x5250a1[_0xcdcd('0x33')]=_[_0xcdcd('0x34')](_0x33e7dd['query']);_0x5250a1[_0xcdcd('0x35')]=_[_0xcdcd('0x36')](_0x5250a1[_0xcdcd('0x32')],_0x5250a1[_0xcdcd('0x33')]);_0x522a62[_0xcdcd('0x37')]=_['intersection'](_0x5250a1[_0xcdcd('0x32')],qs[_0xcdcd('0x38')](_0x33e7dd[_0xcdcd('0x33')]['fields']));_0x522a62[_0xcdcd('0x37')]=_0x522a62['attributes']['length']?_0x522a62[_0xcdcd('0x37')]:_0x5250a1['model'];if(_0x33e7dd[_0xcdcd('0x33')][_0xcdcd('0x41')]){_0x522a62[_0xcdcd('0x42')]=[{'all':!![]}];}_0x522a62=_[_0xcdcd('0x3f')]({},_0x522a62,_0x33e7dd[_0xcdcd('0x48')]);return db[_0xcdcd('0x40')][_0xcdcd('0x49')](_0x522a62)['then'](handleEntityNotFound(_0x5e29da,null))[_0xcdcd('0x25')](respondWithResult(_0x5e29da,null))[_0xcdcd('0x45')](handleError(_0x5e29da,null));};exports[_0xcdcd('0x4a')]=function(_0x4292ec,_0xb8ca68){if(_0x4292ec[_0xcdcd('0x4b')]['id']){delete _0x4292ec['body']['id'];}return db[_0xcdcd('0x40')]['find']({'where':{'id':_0x4292ec[_0xcdcd('0x47')]['id']}})[_0xcdcd('0x25')](handleEntityNotFound(_0xb8ca68,null))[_0xcdcd('0x25')](saveUpdates(_0x4292ec[_0xcdcd('0x4b')],null))[_0xcdcd('0x25')](respondWithResult(_0xb8ca68,null))[_0xcdcd('0x45')](handleError(_0xb8ca68,null));};exports[_0xcdcd('0x4c')]=function(_0x1cce78,_0x287c91){return db[_0xcdcd('0x40')][_0xcdcd('0x49')]({'where':{'id':_0x1cce78[_0xcdcd('0x47')]['id']}})[_0xcdcd('0x25')](handleEntityNotFound(_0x287c91,null))[_0xcdcd('0x25')](removeEntity(_0x287c91,null))[_0xcdcd('0x45')](handleError(_0x287c91,null));};exports[_0xcdcd('0x4d')]=function(_0x2bba6c,_0x22afd4){var _0x37891e={'key':_0x2bba6c[_0xcdcd('0x4b')][_0xcdcd('0x4e')]};if(_0x2bba6c[_0xcdcd('0x4b')][_0xcdcd('0x4f')]){_0x37891e[_0xcdcd('0x4f')]=_0x2bba6c[_0xcdcd('0x4b')][_0xcdcd('0x4f')];}else if(_0x2bba6c['body'][_0xcdcd('0x50')]){_0x37891e['SmsAccountId']=_0x2bba6c[_0xcdcd('0x4b')][_0xcdcd('0x50')];}else if(_0x2bba6c['body']['OpenchannelAccountId']){_0x37891e[_0xcdcd('0x51')]=_0x2bba6c[_0xcdcd('0x4b')][_0xcdcd('0x51')];}else if(_0x2bba6c['body'][_0xcdcd('0x52')]){_0x37891e['ChatWebsiteId']=_0x2bba6c[_0xcdcd('0x4b')]['ChatWebsiteId'];}return db[_0xcdcd('0x40')][_0xcdcd('0x49')]({'where':_0x37891e})['then'](function(_0x53d116){if(_0x53d116){throw new db[(_0xcdcd('0x53'))]['ValidationError'](_0xcdcd('0x54'));}return db[_0xcdcd('0x40')]['create'](_0x2bba6c[_0xcdcd('0x4b')]);})[_0xcdcd('0x25')](function(_0x2f4d5e){var _0x82228a=_0x2bba6c[_0xcdcd('0x55')][_0xcdcd('0x26')]({'plain':!![]});if(!_0x82228a)throw new Error(_0xcdcd('0x56'));if(_0x82228a['role']===_0xcdcd('0x55')){var _0x3f25e6=_0x2f4d5e[_0xcdcd('0x26')]({'plain':!![]});return db['UserProfileSection'][_0xcdcd('0x49')]({'where':{'name':_0xcdcd('0x27'),'userProfileId':_0x82228a[_0xcdcd('0x57')]},'raw':!![]})[_0xcdcd('0x25')](function(_0x12e3a4){if(_0x12e3a4&&_0x12e3a4[_0xcdcd('0x58')]===0x0){return db['UserProfileResource'][_0xcdcd('0x4d')]({'name':_0x3f25e6[_0xcdcd('0x2b')],'resourceId':_0x3f25e6['id'],'type':_0x12e3a4[_0xcdcd('0x2b')],'sectionId':_0x12e3a4['id']},{})['then'](function(){return _0x2f4d5e;});}else{return _0x2f4d5e;}})[_0xcdcd('0x45')](function(_0x5c0168){logger[_0xcdcd('0x29')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x5c0168);throw _0x5c0168;});}return _0x2f4d5e;})['then'](respondWithResult(_0x22afd4,0xc9))[_0xcdcd('0x45')](handleError(_0x22afd4,null));};
\ No newline at end of file
+var _0x9a59=['Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','UserProfileSection','userProfileId','rimraf','request-promise','moment','util','path','sox','to-csv','ejs','fs-extra','squel','crypto','jsforce','desk.js','papaparse','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','json','offset','undefined','count','limit','Content-Range','apply','reject','save','update','destroy','get','CannedAnswers','UserProfileResource','then','end','error','stack','name','index','map','rawAttributes','key','model','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','pick','filter','where','merge','options','CannedAnswer','includeAll','include','findAll','catch','show','params','find','create','body','MailAccountId','SmsAccountId','OpenchannelAccountId','ChatWebsiteId','Sequelize','ValidationError','The\x20inserted\x20key\x20already\x20exists.'];(function(_0x1983ab,_0x9efe34){var _0xf03bfc=function(_0x4a50c2){while(--_0x4a50c2){_0x1983ab['push'](_0x1983ab['shift']());}};_0xf03bfc(++_0x9efe34);}(_0x9a59,0x107));var _0x99a5=function(_0x5bb82b,_0x51a145){_0x5bb82b=_0x5bb82b-0x0;var _0x9feec9=_0x9a59[_0x5bb82b];return _0x9feec9;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x99a5('0x0'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x99a5('0x1'));var moment=require(_0x99a5('0x2'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x99a5('0x3'));var path=require(_0x99a5('0x4'));var sox=require(_0x99a5('0x5'));var csv=require(_0x99a5('0x6'));var ejs=require(_0x99a5('0x7'));var fs=require('fs');var fs_extra=require(_0x99a5('0x8'));var _=require('lodash');var squel=require(_0x99a5('0x9'));var crypto=require(_0x99a5('0xa'));var jsforce=require(_0x99a5('0xb'));var deskjs=require(_0x99a5('0xc'));var toCsv=require(_0x99a5('0x6'));var querystring=require('querystring');var Papa=require(_0x99a5('0xd'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x99a5('0xe'));var as=require(_0x99a5('0xf'));var hardwareService=require(_0x99a5('0x10'));var logger=require(_0x99a5('0x11'))(_0x99a5('0x12'));var utils=require(_0x99a5('0x13'));var config=require('../../config/environment');var licenseUtil=require(_0x99a5('0x14'));var db=require(_0x99a5('0x15'))['db'];function respondWithStatusCode(_0x42988b,_0x55ffa2){_0x55ffa2=_0x55ffa2||0xcc;return function(_0x33def2){if(_0x33def2){return _0x42988b[_0x99a5('0x16')](_0x55ffa2);}return _0x42988b[_0x99a5('0x17')](_0x55ffa2)['end']();};}function respondWithResult(_0x53039d,_0x209e43){_0x209e43=_0x209e43||0xc8;return function(_0x1c714c){if(_0x1c714c){return _0x53039d['status'](_0x209e43)[_0x99a5('0x18')](_0x1c714c);}};}function respondWithFilteredResult(_0xbcdaf1,_0x4f8283){return function(_0x249105){if(_0x249105){var _0x150519=typeof _0x4f8283[_0x99a5('0x19')]==='undefined'&&typeof _0x4f8283['limit']===_0x99a5('0x1a');var _0x504bbb=_0x249105[_0x99a5('0x1b')];var _0x4d9c44=_0x150519?0x0:_0x4f8283[_0x99a5('0x19')];var _0x2088f2=_0x150519?_0x249105[_0x99a5('0x1b')]:_0x4f8283[_0x99a5('0x19')]+_0x4f8283[_0x99a5('0x1c')];var _0x48510b;if(_0x2088f2>=_0x504bbb){_0x2088f2=_0x504bbb;_0x48510b=0xc8;}else{_0x48510b=0xce;}_0xbcdaf1[_0x99a5('0x17')](_0x48510b);return _0xbcdaf1['set'](_0x99a5('0x1d'),_0x4d9c44+'-'+_0x2088f2+'/'+_0x504bbb)[_0x99a5('0x18')](_0x249105);}return null;};}function patchUpdates(_0x27b2ed){return function(_0x4a8a7f){try{jsonpatch[_0x99a5('0x1e')](_0x4a8a7f,_0x27b2ed,!![]);}catch(_0x2450d4){return BPromise[_0x99a5('0x1f')](_0x2450d4);}return _0x4a8a7f[_0x99a5('0x20')]();};}function saveUpdates(_0x4af509,_0x288ac7){return function(_0x1b2ebd){if(_0x1b2ebd){return _0x1b2ebd[_0x99a5('0x21')](_0x4af509)['then'](function(_0x2276e1){return _0x2276e1;});}return null;};}function removeEntity(_0x10c789,_0x1c5e40){return function(_0x3322e9){if(_0x3322e9){return _0x3322e9[_0x99a5('0x22')]()['then'](function(){var _0x368e6c=_0x3322e9[_0x99a5('0x23')]({'plain':!![]});var _0x9a39ae=_0x99a5('0x24');return db[_0x99a5('0x25')][_0x99a5('0x22')]({'where':{'type':_0x9a39ae,'resourceId':_0x368e6c['id']}})[_0x99a5('0x26')](function(){return _0x3322e9;});})[_0x99a5('0x26')](function(){_0x10c789['status'](0xcc)[_0x99a5('0x27')]();});}};}function handleEntityNotFound(_0x471c20,_0x517b5f){return function(_0x411748){if(!_0x411748){_0x471c20['sendStatus'](0x194);}return _0x411748;};}function handleError(_0x1a197c,_0x29b020){_0x29b020=_0x29b020||0x1f4;return function(_0x51b7da){logger[_0x99a5('0x28')](_0x51b7da[_0x99a5('0x29')]);if(_0x51b7da[_0x99a5('0x2a')]){delete _0x51b7da['name'];}_0x1a197c['status'](_0x29b020)['send'](_0x51b7da);};}exports[_0x99a5('0x2b')]=function(_0xe6bafd,_0x159313){var _0x12e761={},_0x38c2b7={},_0x18e12e={'count':0x0,'rows':[]};var _0x17ff69=_[_0x99a5('0x2c')](db['CannedAnswer'][_0x99a5('0x2d')],function(_0x414ba2){return{'name':_0x414ba2['fieldName'],'type':_0x414ba2['type'][_0x99a5('0x2e')]};});_0x38c2b7[_0x99a5('0x2f')]=_[_0x99a5('0x2c')](_0x17ff69,_0x99a5('0x2a'));_0x38c2b7[_0x99a5('0x30')]=_[_0x99a5('0x31')](_0xe6bafd[_0x99a5('0x30')]);_0x38c2b7[_0x99a5('0x32')]=_[_0x99a5('0x33')](_0x38c2b7[_0x99a5('0x2f')],_0x38c2b7['query']);_0x12e761['attributes']=_[_0x99a5('0x33')](_0x38c2b7['model'],qs['fields'](_0xe6bafd[_0x99a5('0x30')][_0x99a5('0x34')]));_0x12e761['attributes']=_0x12e761[_0x99a5('0x35')][_0x99a5('0x36')]?_0x12e761[_0x99a5('0x35')]:_0x38c2b7['model'];if(!_0xe6bafd[_0x99a5('0x30')][_0x99a5('0x37')](_0x99a5('0x38'))){_0x12e761[_0x99a5('0x1c')]=qs[_0x99a5('0x1c')](_0xe6bafd['query'][_0x99a5('0x1c')]);_0x12e761['offset']=qs[_0x99a5('0x19')](_0xe6bafd[_0x99a5('0x30')][_0x99a5('0x19')]);}_0x12e761[_0x99a5('0x39')]=qs[_0x99a5('0x3a')](_0xe6bafd['query']['sort']);_0x12e761['where']=qs[_0x99a5('0x32')](_[_0x99a5('0x3b')](_0xe6bafd[_0x99a5('0x30')],_0x38c2b7[_0x99a5('0x32')]),_0x17ff69);if(_0xe6bafd[_0x99a5('0x30')][_0x99a5('0x3c')]){_0x12e761[_0x99a5('0x3d')]=_[_0x99a5('0x3e')](_0x12e761[_0x99a5('0x3d')],{'$or':[{'key':{'$like':'%'+_0xe6bafd[_0x99a5('0x30')][_0x99a5('0x3c')]+'%'}},{'value':{'$like':'%'+_0xe6bafd[_0x99a5('0x30')]['filter']+'%'}}]});}_0x12e761=_['merge']({},_0x12e761,_0xe6bafd[_0x99a5('0x3f')]);var _0x436c6b={'where':_0x12e761['where']};return db[_0x99a5('0x40')]['count'](_0x436c6b)[_0x99a5('0x26')](function(_0x1519b1){_0x18e12e[_0x99a5('0x1b')]=_0x1519b1;if(_0xe6bafd['query'][_0x99a5('0x41')]){_0x12e761[_0x99a5('0x42')]=[{'all':!![]}];}return db[_0x99a5('0x40')][_0x99a5('0x43')](_0x12e761);})[_0x99a5('0x26')](function(_0x140513){_0x18e12e['rows']=_0x140513;return _0x18e12e;})['then'](respondWithFilteredResult(_0x159313,_0x12e761))[_0x99a5('0x44')](handleError(_0x159313,null));};exports[_0x99a5('0x45')]=function(_0x287ebc,_0x4fb1d6){var _0x30abd3={'raw':!![],'where':{'id':_0x287ebc[_0x99a5('0x46')]['id']}},_0xf218e5={};_0xf218e5[_0x99a5('0x2f')]=_[_0x99a5('0x31')](db[_0x99a5('0x40')][_0x99a5('0x2d')]);_0xf218e5[_0x99a5('0x30')]=_[_0x99a5('0x31')](_0x287ebc[_0x99a5('0x30')]);_0xf218e5[_0x99a5('0x32')]=_[_0x99a5('0x33')](_0xf218e5['model'],_0xf218e5[_0x99a5('0x30')]);_0x30abd3[_0x99a5('0x35')]=_[_0x99a5('0x33')](_0xf218e5[_0x99a5('0x2f')],qs[_0x99a5('0x34')](_0x287ebc['query']['fields']));_0x30abd3[_0x99a5('0x35')]=_0x30abd3[_0x99a5('0x35')][_0x99a5('0x36')]?_0x30abd3[_0x99a5('0x35')]:_0xf218e5[_0x99a5('0x2f')];if(_0x287ebc[_0x99a5('0x30')][_0x99a5('0x41')]){_0x30abd3[_0x99a5('0x42')]=[{'all':!![]}];}_0x30abd3=_[_0x99a5('0x3e')]({},_0x30abd3,_0x287ebc['options']);return db['CannedAnswer'][_0x99a5('0x47')](_0x30abd3)[_0x99a5('0x26')](handleEntityNotFound(_0x4fb1d6,null))[_0x99a5('0x26')](respondWithResult(_0x4fb1d6,null))[_0x99a5('0x44')](handleError(_0x4fb1d6,null));};exports[_0x99a5('0x21')]=function(_0x5a644a,_0x31290b){if(_0x5a644a['body']['id']){delete _0x5a644a['body']['id'];}return db[_0x99a5('0x40')][_0x99a5('0x47')]({'where':{'id':_0x5a644a['params']['id']}})['then'](handleEntityNotFound(_0x31290b,null))[_0x99a5('0x26')](saveUpdates(_0x5a644a['body'],null))[_0x99a5('0x26')](respondWithResult(_0x31290b,null))[_0x99a5('0x44')](handleError(_0x31290b,null));};exports[_0x99a5('0x22')]=function(_0x256e85,_0x328a40){return db[_0x99a5('0x40')][_0x99a5('0x47')]({'where':{'id':_0x256e85[_0x99a5('0x46')]['id']}})[_0x99a5('0x26')](handleEntityNotFound(_0x328a40,null))[_0x99a5('0x26')](removeEntity(_0x328a40,null))[_0x99a5('0x44')](handleError(_0x328a40,null));};exports[_0x99a5('0x48')]=function(_0x2f29b3,_0x6bf379){var _0x15b30f={'key':_0x2f29b3['body'][_0x99a5('0x2e')]};if(_0x2f29b3[_0x99a5('0x49')][_0x99a5('0x4a')]){_0x15b30f[_0x99a5('0x4a')]=_0x2f29b3[_0x99a5('0x49')][_0x99a5('0x4a')];}else if(_0x2f29b3[_0x99a5('0x49')]['SmsAccountId']){_0x15b30f[_0x99a5('0x4b')]=_0x2f29b3[_0x99a5('0x49')]['SmsAccountId'];}else if(_0x2f29b3[_0x99a5('0x49')][_0x99a5('0x4c')]){_0x15b30f[_0x99a5('0x4c')]=_0x2f29b3[_0x99a5('0x49')][_0x99a5('0x4c')];}else if(_0x2f29b3[_0x99a5('0x49')]['ChatWebsiteId']){_0x15b30f[_0x99a5('0x4d')]=_0x2f29b3[_0x99a5('0x49')][_0x99a5('0x4d')];}return db['CannedAnswer'][_0x99a5('0x47')]({'where':_0x15b30f})[_0x99a5('0x26')](function(_0x57290e){if(_0x57290e){throw new db[(_0x99a5('0x4e'))][(_0x99a5('0x4f'))](_0x99a5('0x50'));}return db['CannedAnswer']['create'](_0x2f29b3[_0x99a5('0x49')]);})[_0x99a5('0x26')](function(_0x121e72){var _0xe9261f=_0x2f29b3['user'][_0x99a5('0x23')]({'plain':!![]});if(!_0xe9261f)throw new Error(_0x99a5('0x51'));if(_0xe9261f[_0x99a5('0x52')]===_0x99a5('0x53')){var _0x54b1ec=_0x121e72[_0x99a5('0x23')]({'plain':!![]});return db[_0x99a5('0x54')][_0x99a5('0x47')]({'where':{'name':_0x99a5('0x24'),'userProfileId':_0xe9261f[_0x99a5('0x55')]},'raw':!![]})[_0x99a5('0x26')](function(_0x1fc827){if(_0x1fc827&&_0x1fc827['autoAssociation']===0x0){return db['UserProfileResource'][_0x99a5('0x48')]({'name':_0x54b1ec[_0x99a5('0x2a')],'resourceId':_0x54b1ec['id'],'type':_0x1fc827[_0x99a5('0x2a')],'sectionId':_0x1fc827['id']},{})['then'](function(){return _0x121e72;});}else{return _0x121e72;}})[_0x99a5('0x44')](function(_0x723510){logger[_0x99a5('0x28')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x723510);throw _0x723510;});}return _0x121e72;})[_0x99a5('0x26')](respondWithResult(_0x6bf379,0xc9))[_0x99a5('0x44')](handleError(_0x6bf379,null));};
\ No newline at end of file
diff --git a/server/api/cannedAnswer/cannedAnswer.model.js b/server/api/cannedAnswer/cannedAnswer.model.js
index 25d0dcf..0a2effe 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 _0xebff=['path','../../config/environment','./cannedAnswer.attributes','define','tools_canned_answers','utf8mb4','lodash','../../config/logger','moment','bluebird','request-promise'];(function(_0x4147fd,_0x1e2bf6){var _0x2fd539=function(_0x54b35e){while(--_0x54b35e){_0x4147fd['push'](_0x4147fd['shift']());}};_0x2fd539(++_0x1e2bf6);}(_0xebff,0xf8));var _0xfebf=function(_0x122ef9,_0x451d2a){_0x122ef9=_0x122ef9-0x0;var _0x42fba0=_0xebff[_0x122ef9];return _0x42fba0;};'use strict';var _=require(_0xfebf('0x0'));var util=require('util');var logger=require(_0xfebf('0x1'))('api');var moment=require(_0xfebf('0x2'));var BPromise=require(_0xfebf('0x3'));var rp=require(_0xfebf('0x4'));var fs=require('fs');var path=require(_0xfebf('0x5'));var rimraf=require('rimraf');var config=require(_0xfebf('0x6'));var attributes=require(_0xfebf('0x7'));module['exports']=function(_0x4a98a9,_0x4c5f06){return _0x4a98a9[_0xfebf('0x8')]('CannedAnswer',attributes,{'tableName':_0xfebf('0x9'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0xfebf('0xa'),'collate':'utf8mb4_unicode_ci'});};
\ No newline at end of file
+var _0xa095=['exports','define','utf8mb4_unicode_ci','lodash','util','api','bluebird','request-promise','path','rimraf','./cannedAnswer.attributes'];(function(_0x54a687,_0x4ce189){var _0x4b5083=function(_0x4e9dc7){while(--_0x4e9dc7){_0x54a687['push'](_0x54a687['shift']());}};_0x4b5083(++_0x4ce189);}(_0xa095,0x7c));var _0x5a09=function(_0x2a99e2,_0x1803e4){_0x2a99e2=_0x2a99e2-0x0;var _0x23fb5f=_0xa095[_0x2a99e2];return _0x23fb5f;};'use strict';var _=require(_0x5a09('0x0'));var util=require(_0x5a09('0x1'));var logger=require('../../config/logger')(_0x5a09('0x2'));var moment=require('moment');var BPromise=require(_0x5a09('0x3'));var rp=require(_0x5a09('0x4'));var fs=require('fs');var path=require(_0x5a09('0x5'));var rimraf=require(_0x5a09('0x6'));var config=require('../../config/environment');var attributes=require(_0x5a09('0x7'));module[_0x5a09('0x8')]=function(_0x25edc3,_0x327fe6){return _0x25edc3[_0x5a09('0x9')]('CannedAnswer',attributes,{'tableName':'tools_canned_answers','paranoid':![],'indexes':[],'timestamps':!![],'charset':'utf8mb4','collate':_0x5a09('0xa')});};
\ No newline at end of file
diff --git a/server/api/cannedAnswer/cannedAnswer.rpc.js b/server/api/cannedAnswer/cannedAnswer.rpc.js
index d17459a..cc04376 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(_0x4777a6,_0x5458a3){var _0x45c05f=function(_0x2beadd){while(--_0x2beadd){_0x4777a6['push'](_0x4777a6['shift']());}};_0x45c05f(++_0x5458a3);}(_0xa9e0,0x123));var _0x0a9e=function(_0x2f3848,_0x48564d){_0x2f3848=_0x2f3848-0x0;var _0x102668=_0xa9e0[_0x2f3848];return _0x102668;};'use strict';var _=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var moment=require(_0x0a9e('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x0a9e('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x0a9e('0x4'));var logger=require(_0x0a9e('0x5'))(_0x0a9e('0x6'));var config=require(_0x0a9e('0x7'));var jayson=require(_0x0a9e('0x8'));var client=jayson['client'][_0x0a9e('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x441e3a,_0x2cc193,_0x5f41ea){return new BPromise(function(_0x503809,_0xe42b77){return client['request'](_0x441e3a,_0x5f41ea)['then'](function(_0x39753a){logger[_0x0a9e('0xa')](_0x0a9e('0xb'),_0x2cc193,_0x0a9e('0xc'));logger[_0x0a9e('0xd')](_0x0a9e('0xe'),_0x2cc193,'request\x20sent',JSON['stringify'](_0x39753a));if(_0x39753a['error']){if(_0x39753a['error'][_0x0a9e('0xf')]===0x1f4){logger[_0x0a9e('0x10')](_0x0a9e('0xb'),_0x2cc193,_0x39753a[_0x0a9e('0x10')][_0x0a9e('0x11')]);return _0xe42b77(_0x39753a[_0x0a9e('0x10')]['message']);}logger[_0x0a9e('0x10')](_0x0a9e('0xb'),_0x2cc193,_0x39753a[_0x0a9e('0x10')][_0x0a9e('0x11')]);return _0x503809(_0x39753a[_0x0a9e('0x10')][_0x0a9e('0x11')]);}else{logger['info'](_0x0a9e('0xb'),_0x2cc193,'request\x20sent');_0x503809(_0x39753a[_0x0a9e('0x12')]['message']);}})[_0x0a9e('0x13')](function(_0x12066b){logger['error'](_0x0a9e('0xb'),_0x2cc193,_0x12066b);_0xe42b77(_0x12066b);});});}
\ No newline at end of file
+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(_0x154a66,_0x3ff7b0){var _0xf954a3=function(_0xd6876b){while(--_0xd6876b){_0x154a66['push'](_0x154a66['shift']());}};_0xf954a3(++_0x3ff7b0);}(_0xa9e0,0x123));var _0x0a9e=function(_0x187ee1,_0x3fd1e6){_0x187ee1=_0x187ee1-0x0;var _0x388160=_0xa9e0[_0x187ee1];return _0x388160;};'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 68fd11b..e03e6d7 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 _0x72e9=['exports','multer','util','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./cannedAnswer.controller','isAuthenticated','index','/:id','show','put','update','delete'];(function(_0x3607f3,_0x5559d9){var _0xa9a016=function(_0x372e70){while(--_0x372e70){_0x3607f3['push'](_0x3607f3['shift']());}};_0xa9a016(++_0x5559d9);}(_0x72e9,0xb5));var _0x972e=function(_0x523648,_0x13412b){_0x523648=_0x523648-0x0;var _0x20d18b=_0x72e9[_0x523648];return _0x20d18b;};'use strict';var multer=require(_0x972e('0x0'));var util=require(_0x972e('0x1'));var path=require(_0x972e('0x2'));var timeout=require(_0x972e('0x3'));var express=require(_0x972e('0x4'));var router=express['Router']();var fs_extra=require(_0x972e('0x5'));var auth=require(_0x972e('0x6'));var interaction=require(_0x972e('0x7'));var config=require(_0x972e('0x8'));var controller=require(_0x972e('0x9'));router['get']('/',auth[_0x972e('0xa')](),controller[_0x972e('0xb')]);router['get'](_0x972e('0xc'),auth[_0x972e('0xa')](),controller[_0x972e('0xd')]);router['post']('/',auth[_0x972e('0xa')](),controller['create']);router[_0x972e('0xe')](_0x972e('0xc'),auth['isAuthenticated'](),controller[_0x972e('0xf')]);router[_0x972e('0x10')]('/:id',auth[_0x972e('0xa')](),controller['destroy']);module[_0x972e('0x11')]=router;
\ No newline at end of file
+var _0xd9b4=['Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./cannedAnswer.controller','get','isAuthenticated','index','/:id','post','create','put','update','delete','destroy','multer','util','path','connect-timeout','express'];(function(_0x397e5f,_0x454c8f){var _0x5302b8=function(_0x1a29ef){while(--_0x1a29ef){_0x397e5f['push'](_0x397e5f['shift']());}};_0x5302b8(++_0x454c8f);}(_0xd9b4,0x1de));var _0x4d9b=function(_0x436570,_0x29789b){_0x436570=_0x436570-0x0;var _0x2c45f7=_0xd9b4[_0x436570];return _0x2c45f7;};'use strict';var multer=require(_0x4d9b('0x0'));var util=require(_0x4d9b('0x1'));var path=require(_0x4d9b('0x2'));var timeout=require(_0x4d9b('0x3'));var express=require(_0x4d9b('0x4'));var router=express[_0x4d9b('0x5')]();var fs_extra=require(_0x4d9b('0x6'));var auth=require(_0x4d9b('0x7'));var interaction=require(_0x4d9b('0x8'));var config=require(_0x4d9b('0x9'));var controller=require(_0x4d9b('0xa'));router[_0x4d9b('0xb')]('/',auth[_0x4d9b('0xc')](),controller[_0x4d9b('0xd')]);router[_0x4d9b('0xb')](_0x4d9b('0xe'),auth[_0x4d9b('0xc')](),controller['show']);router[_0x4d9b('0xf')]('/',auth['isAuthenticated'](),controller[_0x4d9b('0x10')]);router[_0x4d9b('0x11')](_0x4d9b('0xe'),auth[_0x4d9b('0xc')](),controller[_0x4d9b('0x12')]);router[_0x4d9b('0x13')](_0x4d9b('0xe'),auth[_0x4d9b('0xc')](),controller[_0x4d9b('0x14')]);module['exports']=router;
\ No newline at end of file
diff --git a/server/api/cdr/cdr.attributes.js b/server/api/cdr/cdr.attributes.js
index b95f969..ed57b23 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 _0xb5cd=['STRING','INTEGER','sequelize','exports','DATE','1970-01-01\x2000:00:01'];(function(_0x554292,_0x82948a){var _0x3dd555=function(_0xab7590){while(--_0xab7590){_0x554292['push'](_0x554292['shift']());}};_0x3dd555(++_0x82948a);}(_0xb5cd,0x134));var _0xdb5c=function(_0x2beba9,_0x304957){_0x2beba9=_0x2beba9-0x0;var _0xfb6f7e=_0xb5cd[_0x2beba9];return _0xfb6f7e;};'use strict';var Sequelize=require(_0xdb5c('0x0'));module[_0xdb5c('0x1')]={'calldate':{'type':Sequelize[_0xdb5c('0x2')],'allowNull':![],'defaultValue':_0xdb5c('0x3')},'clid':{'type':Sequelize[_0xdb5c('0x4')]},'src':{'type':Sequelize['STRING']},'dst':{'type':Sequelize[_0xdb5c('0x4')]},'dcontext':{'type':Sequelize[_0xdb5c('0x4')]},'channel':{'type':Sequelize[_0xdb5c('0x4')]},'dstchannel':{'type':Sequelize[_0xdb5c('0x4')]},'lastapp':{'type':Sequelize[_0xdb5c('0x4')]},'lastdata':{'type':Sequelize[_0xdb5c('0x4')]},'duration':{'type':Sequelize['INTEGER'],'allowNull':![],'defaultValue':0x0},'billsec':{'type':Sequelize[_0xdb5c('0x5')],'allowNull':![],'defaultValue':0x0},'disposition':{'type':Sequelize[_0xdb5c('0x4')]},'amaflags':{'type':Sequelize[_0xdb5c('0x5')],'allowNull':![],'defaultValue':0x0},'accountcode':{'type':Sequelize['STRING']},'userfield':{'type':Sequelize['STRING']},'uniqueid':{'type':Sequelize[_0xdb5c('0x4')]},'linkedid':{'type':Sequelize[_0xdb5c('0x4')]},'sequence':{'type':Sequelize[_0xdb5c('0x4')]},'peeraccount':{'type':Sequelize['STRING']},'type':{'type':Sequelize[_0xdb5c('0x4')]},'tag':{'type':Sequelize['STRING']}};
\ No newline at end of file
+var _0x7314=['INTEGER','sequelize','exports','1970-01-01\x2000:00:01','STRING'];(function(_0x48a6d0,_0x327e64){var _0x33501d=function(_0x102a47){while(--_0x102a47){_0x48a6d0['push'](_0x48a6d0['shift']());}};_0x33501d(++_0x327e64);}(_0x7314,0x100));var _0x4731=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x7314[_0x3dd15e];return _0x231fd0;};'use strict';var Sequelize=require(_0x4731('0x0'));module[_0x4731('0x1')]={'calldate':{'type':Sequelize['DATE'],'allowNull':![],'defaultValue':_0x4731('0x2')},'clid':{'type':Sequelize[_0x4731('0x3')]},'src':{'type':Sequelize[_0x4731('0x3')]},'dst':{'type':Sequelize['STRING']},'dcontext':{'type':Sequelize[_0x4731('0x3')]},'channel':{'type':Sequelize[_0x4731('0x3')]},'dstchannel':{'type':Sequelize[_0x4731('0x3')]},'lastapp':{'type':Sequelize['STRING']},'lastdata':{'type':Sequelize[_0x4731('0x3')]},'duration':{'type':Sequelize[_0x4731('0x4')],'allowNull':![],'defaultValue':0x0},'billsec':{'type':Sequelize['INTEGER'],'allowNull':![],'defaultValue':0x0},'disposition':{'type':Sequelize[_0x4731('0x3')]},'amaflags':{'type':Sequelize[_0x4731('0x4')],'allowNull':![],'defaultValue':0x0},'accountcode':{'type':Sequelize[_0x4731('0x3')]},'userfield':{'type':Sequelize[_0x4731('0x3')]},'uniqueid':{'type':Sequelize['STRING']},'linkedid':{'type':Sequelize[_0x4731('0x3')]},'sequence':{'type':Sequelize['STRING']},'peeraccount':{'type':Sequelize[_0x4731('0x3')]},'type':{'type':Sequelize[_0x4731('0x3')]},'tag':{'type':Sequelize[_0x4731('0x3')]}};
\ No newline at end of file
diff --git a/server/api/cdr/cdr.controller.js b/server/api/cdr/cdr.controller.js
index f5d9773..b257e22 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 _0x9b67=['where','pick','filter','VIRTUAL','merge','options','includeAll','include','findAll','rows','catch','show','params','length','find','create','body','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','apply','save','update','then','destroy','error','name','send','map','Cdr','rawAttributes','fieldName','type','key','model','keys','query','filters','attributes','intersection','fields','hasOwnProperty','order','sort'];(function(_0x2823fd,_0x5dfcc1){var _0x2f100e=function(_0x125039){while(--_0x125039){_0x2823fd['push'](_0x2823fd['shift']());}};_0x2f100e(++_0x5dfcc1);}(_0x9b67,0xf6));var _0x79b6=function(_0x486da7,_0x2a3b90){_0x486da7=_0x486da7-0x0;var _0x161f36=_0x9b67[_0x486da7];return _0x161f36;};'use strict';var emlformat=require(_0x79b6('0x0'));var rimraf=require(_0x79b6('0x1'));var zipdir=require(_0x79b6('0x2'));var jsonpatch=require(_0x79b6('0x3'));var rp=require(_0x79b6('0x4'));var moment=require('moment');var BPromise=require(_0x79b6('0x5'));var Mustache=require(_0x79b6('0x6'));var util=require('util');var path=require('path');var sox=require(_0x79b6('0x7'));var csv=require(_0x79b6('0x8'));var ejs=require(_0x79b6('0x9'));var fs=require('fs');var fs_extra=require(_0x79b6('0xa'));var _=require(_0x79b6('0xb'));var squel=require(_0x79b6('0xc'));var crypto=require(_0x79b6('0xd'));var jsforce=require('jsforce');var deskjs=require(_0x79b6('0xe'));var toCsv=require(_0x79b6('0x8'));var querystring=require(_0x79b6('0xf'));var Papa=require(_0x79b6('0x10'));var Redis=require(_0x79b6('0x11'));var authService=require('../../components/auth/service');var qs=require(_0x79b6('0x12'));var as=require(_0x79b6('0x13'));var hardwareService=require(_0x79b6('0x14'));var logger=require(_0x79b6('0x15'))('api');var utils=require('../../config/utils');var config=require(_0x79b6('0x16'));var licenseUtil=require(_0x79b6('0x17'));var db=require(_0x79b6('0x18'))['db'];function respondWithStatusCode(_0x526727,_0xc05a77){_0xc05a77=_0xc05a77||0xcc;return function(_0x2df08d){if(_0x2df08d){return _0x526727[_0x79b6('0x19')](_0xc05a77);}return _0x526727[_0x79b6('0x1a')](_0xc05a77)[_0x79b6('0x1b')]();};}function respondWithResult(_0x40478d,_0x19d5b2){_0x19d5b2=_0x19d5b2||0xc8;return function(_0x3ef1fa){if(_0x3ef1fa){return _0x40478d[_0x79b6('0x1a')](_0x19d5b2)[_0x79b6('0x1c')](_0x3ef1fa);}};}function respondWithFilteredResult(_0x2ac966,_0x3563cc){return function(_0x1e8bf1){if(_0x1e8bf1){var _0x4cf491=typeof _0x3563cc[_0x79b6('0x1d')]===_0x79b6('0x1e')&&typeof _0x3563cc[_0x79b6('0x1f')]===_0x79b6('0x1e');var _0x2a8788=_0x1e8bf1[_0x79b6('0x20')];var _0x131bc5=_0x4cf491?0x0:_0x3563cc[_0x79b6('0x1d')];var _0x3ff583=_0x4cf491?_0x1e8bf1[_0x79b6('0x20')]:_0x3563cc[_0x79b6('0x1d')]+_0x3563cc[_0x79b6('0x1f')];var _0x1361f6;if(_0x3ff583>=_0x2a8788){_0x3ff583=_0x2a8788;_0x1361f6=0xc8;}else{_0x1361f6=0xce;}_0x2ac966['status'](_0x1361f6);return _0x2ac966[_0x79b6('0x21')]('Content-Range',_0x131bc5+'-'+_0x3ff583+'/'+_0x2a8788)[_0x79b6('0x1c')](_0x1e8bf1);}return null;};}function patchUpdates(_0x532e65){return function(_0x28b9c2){try{jsonpatch[_0x79b6('0x22')](_0x28b9c2,_0x532e65,!![]);}catch(_0x299bed){return BPromise['reject'](_0x299bed);}return _0x28b9c2[_0x79b6('0x23')]();};}function saveUpdates(_0x30dc0b,_0x53208a){return function(_0x565f86){if(_0x565f86){return _0x565f86[_0x79b6('0x24')](_0x30dc0b)[_0x79b6('0x25')](function(_0x9bd2cc){return _0x9bd2cc;});}return null;};}function removeEntity(_0x268826,_0x3b2a2a){return function(_0x488102){if(_0x488102){return _0x488102[_0x79b6('0x26')]()[_0x79b6('0x25')](function(){_0x268826[_0x79b6('0x1a')](0xcc)[_0x79b6('0x1b')]();});}};}function handleEntityNotFound(_0x4c275d,_0x53c03c){return function(_0x40ef76){if(!_0x40ef76){_0x4c275d[_0x79b6('0x19')](0x194);}return _0x40ef76;};}function handleError(_0x37b01b,_0xc25c99){_0xc25c99=_0xc25c99||0x1f4;return function(_0x4adf15){logger[_0x79b6('0x27')](_0x4adf15['stack']);if(_0x4adf15[_0x79b6('0x28')]){delete _0x4adf15[_0x79b6('0x28')];}_0x37b01b[_0x79b6('0x1a')](_0xc25c99)[_0x79b6('0x29')](_0x4adf15);};}exports['index']=function(_0x1484e5,_0x310832){var _0x53b463={},_0x158221={},_0x2d219c={'count':0x0,'rows':[]};var _0x1b1f2b=_[_0x79b6('0x2a')](db[_0x79b6('0x2b')][_0x79b6('0x2c')],function(_0x53b2f5){return{'name':_0x53b2f5[_0x79b6('0x2d')],'type':_0x53b2f5[_0x79b6('0x2e')][_0x79b6('0x2f')]};});_0x158221[_0x79b6('0x30')]=_[_0x79b6('0x2a')](_0x1b1f2b,_0x79b6('0x28'));_0x158221['query']=_[_0x79b6('0x31')](_0x1484e5[_0x79b6('0x32')]);_0x158221[_0x79b6('0x33')]=_['intersection'](_0x158221['model'],_0x158221[_0x79b6('0x32')]);_0x53b463[_0x79b6('0x34')]=_[_0x79b6('0x35')](_0x158221[_0x79b6('0x30')],qs[_0x79b6('0x36')](_0x1484e5[_0x79b6('0x32')]['fields']));_0x53b463['attributes']=_0x53b463[_0x79b6('0x34')]['length']?_0x53b463[_0x79b6('0x34')]:_0x158221['model'];if(!_0x1484e5[_0x79b6('0x32')][_0x79b6('0x37')]('nolimit')){_0x53b463[_0x79b6('0x1f')]=qs[_0x79b6('0x1f')](_0x1484e5['query'][_0x79b6('0x1f')]);_0x53b463['offset']=qs[_0x79b6('0x1d')](_0x1484e5[_0x79b6('0x32')][_0x79b6('0x1d')]);}_0x53b463[_0x79b6('0x38')]=qs[_0x79b6('0x39')](_0x1484e5[_0x79b6('0x32')][_0x79b6('0x39')]);_0x53b463[_0x79b6('0x3a')]=qs[_0x79b6('0x33')](_[_0x79b6('0x3b')](_0x1484e5['query'],_0x158221['filters']),_0x1b1f2b);if(_0x1484e5['query'][_0x79b6('0x3c')]){_0x53b463[_0x79b6('0x3a')]=_['merge'](_0x53b463[_0x79b6('0x3a')],{'$or':_['map'](_0x1b1f2b,function(_0x179a98){if(_0x179a98[_0x79b6('0x2e')]!==_0x79b6('0x3d')){var _0x53db1d={};_0x53db1d[_0x179a98[_0x79b6('0x28')]]={'$like':'%'+_0x1484e5['query'][_0x79b6('0x3c')]+'%'};return _0x53db1d;}})});}_0x53b463=_[_0x79b6('0x3e')]({},_0x53b463,_0x1484e5[_0x79b6('0x3f')]);var _0x2feeeb={'where':_0x53b463[_0x79b6('0x3a')]};return db['Cdr']['count'](_0x2feeeb)[_0x79b6('0x25')](function(_0x48ae49){_0x2d219c[_0x79b6('0x20')]=_0x48ae49;if(_0x1484e5[_0x79b6('0x32')][_0x79b6('0x40')]){_0x53b463[_0x79b6('0x41')]=[{'all':!![]}];}return db[_0x79b6('0x2b')][_0x79b6('0x42')](_0x53b463);})[_0x79b6('0x25')](function(_0x4a7f90){_0x2d219c[_0x79b6('0x43')]=_0x4a7f90;return _0x2d219c;})[_0x79b6('0x25')](respondWithFilteredResult(_0x310832,_0x53b463))[_0x79b6('0x44')](handleError(_0x310832,null));};exports[_0x79b6('0x45')]=function(_0x568f6b,_0x12ea22){var _0x4f803c={'raw':!![],'where':{'id':_0x568f6b[_0x79b6('0x46')]['id']}},_0x4ba212={};_0x4ba212[_0x79b6('0x30')]=_[_0x79b6('0x31')](db[_0x79b6('0x2b')][_0x79b6('0x2c')]);_0x4ba212[_0x79b6('0x32')]=_[_0x79b6('0x31')](_0x568f6b[_0x79b6('0x32')]);_0x4ba212['filters']=_[_0x79b6('0x35')](_0x4ba212['model'],_0x4ba212['query']);_0x4f803c[_0x79b6('0x34')]=_[_0x79b6('0x35')](_0x4ba212[_0x79b6('0x30')],qs[_0x79b6('0x36')](_0x568f6b[_0x79b6('0x32')][_0x79b6('0x36')]));_0x4f803c[_0x79b6('0x34')]=_0x4f803c[_0x79b6('0x34')][_0x79b6('0x47')]?_0x4f803c['attributes']:_0x4ba212[_0x79b6('0x30')];if(_0x568f6b[_0x79b6('0x32')][_0x79b6('0x40')]){_0x4f803c[_0x79b6('0x41')]=[{'all':!![]}];}_0x4f803c=_[_0x79b6('0x3e')]({},_0x4f803c,_0x568f6b['options']);return db[_0x79b6('0x2b')][_0x79b6('0x48')](_0x4f803c)['then'](handleEntityNotFound(_0x12ea22,null))['then'](respondWithResult(_0x12ea22,null))[_0x79b6('0x44')](handleError(_0x12ea22,null));};exports[_0x79b6('0x49')]=function(_0x247c79,_0xa0c396){return db[_0x79b6('0x2b')][_0x79b6('0x49')](_0x247c79[_0x79b6('0x4a')],{})[_0x79b6('0x25')](respondWithResult(_0xa0c396,0xc9))[_0x79b6('0x44')](handleError(_0xa0c396,null));};exports[_0x79b6('0x24')]=function(_0x15c795,_0x39972b){if(_0x15c795[_0x79b6('0x4a')]['id']){delete _0x15c795[_0x79b6('0x4a')]['id'];}return db[_0x79b6('0x2b')][_0x79b6('0x48')]({'where':{'id':_0x15c795[_0x79b6('0x46')]['id']}})[_0x79b6('0x25')](handleEntityNotFound(_0x39972b,null))[_0x79b6('0x25')](saveUpdates(_0x15c795['body'],null))['then'](respondWithResult(_0x39972b,null))['catch'](handleError(_0x39972b,null));};exports['destroy']=function(_0x56deb2,_0x412c1e){return db[_0x79b6('0x2b')][_0x79b6('0x48')]({'where':{'id':_0x56deb2[_0x79b6('0x46')]['id']}})[_0x79b6('0x25')](handleEntityNotFound(_0x412c1e,null))[_0x79b6('0x25')](removeEntity(_0x412c1e,null))['catch'](handleError(_0x412c1e,null));};exports[_0x79b6('0x4b')]=function(_0xa2ba0e,_0x58232b){return db[_0x79b6('0x2b')]['describe']()[_0x79b6('0x25')](respondWithResult(_0x58232b,null))['catch'](handleError(_0x58232b,null));};
\ No newline at end of file
+var _0x6f47=['undefined','limit','count','status','set','Content-Range','reject','save','update','then','destroy','error','stack','name','send','Cdr','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','map','VIRTUAL','options','include','findAll','rows','catch','show','rawAttributes','length','find','create','body','params','describe','rimraf','zip-dir','request-promise','bluebird','util','path','sox','to-csv','fs-extra','lodash','squel','jsforce','desk.js','querystring','papaparse','../../components/parsers/qs','../../components/parsers/advancedSearch','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','json','offset'];(function(_0x151502,_0x3f0f5a){var _0x4db056=function(_0x4cc051){while(--_0x4cc051){_0x151502['push'](_0x151502['shift']());}};_0x4db056(++_0x3f0f5a);}(_0x6f47,0xc7));var _0x76f4=function(_0x2be8c2,_0x14a4b5){_0x2be8c2=_0x2be8c2-0x0;var _0x97f531=_0x6f47[_0x2be8c2];return _0x97f531;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x76f4('0x0'));var zipdir=require(_0x76f4('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0x76f4('0x2'));var moment=require('moment');var BPromise=require(_0x76f4('0x3'));var Mustache=require('mustache');var util=require(_0x76f4('0x4'));var path=require(_0x76f4('0x5'));var sox=require(_0x76f4('0x6'));var csv=require(_0x76f4('0x7'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x76f4('0x8'));var _=require(_0x76f4('0x9'));var squel=require(_0x76f4('0xa'));var crypto=require('crypto');var jsforce=require(_0x76f4('0xb'));var deskjs=require(_0x76f4('0xc'));var toCsv=require(_0x76f4('0x7'));var querystring=require(_0x76f4('0xd'));var Papa=require(_0x76f4('0xe'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x76f4('0xf'));var as=require(_0x76f4('0x10'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x76f4('0x11'));var utils=require(_0x76f4('0x12'));var config=require(_0x76f4('0x13'));var licenseUtil=require(_0x76f4('0x14'));var db=require(_0x76f4('0x15'))['db'];function respondWithStatusCode(_0xafd21e,_0xf7e347){_0xf7e347=_0xf7e347||0xcc;return function(_0x3ec740){if(_0x3ec740){return _0xafd21e[_0x76f4('0x16')](_0xf7e347);}return _0xafd21e['status'](_0xf7e347)[_0x76f4('0x17')]();};}function respondWithResult(_0x30dabf,_0x5da1ff){_0x5da1ff=_0x5da1ff||0xc8;return function(_0x4b6021){if(_0x4b6021){return _0x30dabf['status'](_0x5da1ff)[_0x76f4('0x18')](_0x4b6021);}};}function respondWithFilteredResult(_0x3dd240,_0x979946){return function(_0x40252d){if(_0x40252d){var _0x3d8f5a=typeof _0x979946[_0x76f4('0x19')]===_0x76f4('0x1a')&&typeof _0x979946[_0x76f4('0x1b')]===_0x76f4('0x1a');var _0xb159a9=_0x40252d[_0x76f4('0x1c')];var _0x2d4bd1=_0x3d8f5a?0x0:_0x979946[_0x76f4('0x19')];var _0x38450e=_0x3d8f5a?_0x40252d[_0x76f4('0x1c')]:_0x979946[_0x76f4('0x19')]+_0x979946[_0x76f4('0x1b')];var _0x3e809f;if(_0x38450e>=_0xb159a9){_0x38450e=_0xb159a9;_0x3e809f=0xc8;}else{_0x3e809f=0xce;}_0x3dd240[_0x76f4('0x1d')](_0x3e809f);return _0x3dd240[_0x76f4('0x1e')](_0x76f4('0x1f'),_0x2d4bd1+'-'+_0x38450e+'/'+_0xb159a9)[_0x76f4('0x18')](_0x40252d);}return null;};}function patchUpdates(_0x5bf3d5){return function(_0x262937){try{jsonpatch['apply'](_0x262937,_0x5bf3d5,!![]);}catch(_0x13f3b1){return BPromise[_0x76f4('0x20')](_0x13f3b1);}return _0x262937[_0x76f4('0x21')]();};}function saveUpdates(_0x517c00,_0x567f2a){return function(_0x52da65){if(_0x52da65){return _0x52da65[_0x76f4('0x22')](_0x517c00)[_0x76f4('0x23')](function(_0x14bfe5){return _0x14bfe5;});}return null;};}function removeEntity(_0x2b6d51,_0x42ef70){return function(_0x4786c9){if(_0x4786c9){return _0x4786c9[_0x76f4('0x24')]()['then'](function(){_0x2b6d51['status'](0xcc)[_0x76f4('0x17')]();});}};}function handleEntityNotFound(_0x497913,_0x288365){return function(_0x5355bd){if(!_0x5355bd){_0x497913['sendStatus'](0x194);}return _0x5355bd;};}function handleError(_0x4f6087,_0x470242){_0x470242=_0x470242||0x1f4;return function(_0x38300d){logger[_0x76f4('0x25')](_0x38300d[_0x76f4('0x26')]);if(_0x38300d[_0x76f4('0x27')]){delete _0x38300d[_0x76f4('0x27')];}_0x4f6087['status'](_0x470242)[_0x76f4('0x28')](_0x38300d);};}exports['index']=function(_0x5346be,_0x5b3f07){var _0x10ddb4={},_0x30f02e={},_0x41dea4={'count':0x0,'rows':[]};var _0x1dea0e=_['map'](db[_0x76f4('0x29')]['rawAttributes'],function(_0x259c26){return{'name':_0x259c26[_0x76f4('0x2a')],'type':_0x259c26[_0x76f4('0x2b')][_0x76f4('0x2c')]};});_0x30f02e[_0x76f4('0x2d')]=_['map'](_0x1dea0e,'name');_0x30f02e[_0x76f4('0x2e')]=_[_0x76f4('0x2f')](_0x5346be[_0x76f4('0x2e')]);_0x30f02e[_0x76f4('0x30')]=_[_0x76f4('0x31')](_0x30f02e[_0x76f4('0x2d')],_0x30f02e[_0x76f4('0x2e')]);_0x10ddb4[_0x76f4('0x32')]=_[_0x76f4('0x31')](_0x30f02e[_0x76f4('0x2d')],qs[_0x76f4('0x33')](_0x5346be[_0x76f4('0x2e')]['fields']));_0x10ddb4['attributes']=_0x10ddb4['attributes']['length']?_0x10ddb4[_0x76f4('0x32')]:_0x30f02e[_0x76f4('0x2d')];if(!_0x5346be[_0x76f4('0x2e')][_0x76f4('0x34')](_0x76f4('0x35'))){_0x10ddb4['limit']=qs[_0x76f4('0x1b')](_0x5346be[_0x76f4('0x2e')][_0x76f4('0x1b')]);_0x10ddb4[_0x76f4('0x19')]=qs[_0x76f4('0x19')](_0x5346be[_0x76f4('0x2e')][_0x76f4('0x19')]);}_0x10ddb4[_0x76f4('0x36')]=qs[_0x76f4('0x37')](_0x5346be[_0x76f4('0x2e')][_0x76f4('0x37')]);_0x10ddb4[_0x76f4('0x38')]=qs[_0x76f4('0x30')](_[_0x76f4('0x39')](_0x5346be[_0x76f4('0x2e')],_0x30f02e[_0x76f4('0x30')]),_0x1dea0e);if(_0x5346be[_0x76f4('0x2e')][_0x76f4('0x3a')]){_0x10ddb4['where']=_[_0x76f4('0x3b')](_0x10ddb4[_0x76f4('0x38')],{'$or':_[_0x76f4('0x3c')](_0x1dea0e,function(_0x589637){if(_0x589637['type']!==_0x76f4('0x3d')){var _0x487926={};_0x487926[_0x589637[_0x76f4('0x27')]]={'$like':'%'+_0x5346be['query'][_0x76f4('0x3a')]+'%'};return _0x487926;}})});}_0x10ddb4=_[_0x76f4('0x3b')]({},_0x10ddb4,_0x5346be[_0x76f4('0x3e')]);var _0x378675={'where':_0x10ddb4[_0x76f4('0x38')]};return db[_0x76f4('0x29')][_0x76f4('0x1c')](_0x378675)[_0x76f4('0x23')](function(_0x16779e){_0x41dea4[_0x76f4('0x1c')]=_0x16779e;if(_0x5346be['query']['includeAll']){_0x10ddb4[_0x76f4('0x3f')]=[{'all':!![]}];}return db[_0x76f4('0x29')][_0x76f4('0x40')](_0x10ddb4);})[_0x76f4('0x23')](function(_0x2b7dc8){_0x41dea4[_0x76f4('0x41')]=_0x2b7dc8;return _0x41dea4;})[_0x76f4('0x23')](respondWithFilteredResult(_0x5b3f07,_0x10ddb4))[_0x76f4('0x42')](handleError(_0x5b3f07,null));};exports[_0x76f4('0x43')]=function(_0x5b667b,_0xbc3d7e){var _0xe744af={'raw':!![],'where':{'id':_0x5b667b['params']['id']}},_0x4f0d1a={};_0x4f0d1a[_0x76f4('0x2d')]=_[_0x76f4('0x2f')](db[_0x76f4('0x29')][_0x76f4('0x44')]);_0x4f0d1a[_0x76f4('0x2e')]=_['keys'](_0x5b667b[_0x76f4('0x2e')]);_0x4f0d1a[_0x76f4('0x30')]=_[_0x76f4('0x31')](_0x4f0d1a[_0x76f4('0x2d')],_0x4f0d1a[_0x76f4('0x2e')]);_0xe744af[_0x76f4('0x32')]=_['intersection'](_0x4f0d1a[_0x76f4('0x2d')],qs[_0x76f4('0x33')](_0x5b667b[_0x76f4('0x2e')]['fields']));_0xe744af['attributes']=_0xe744af[_0x76f4('0x32')][_0x76f4('0x45')]?_0xe744af[_0x76f4('0x32')]:_0x4f0d1a[_0x76f4('0x2d')];if(_0x5b667b[_0x76f4('0x2e')]['includeAll']){_0xe744af['include']=[{'all':!![]}];}_0xe744af=_[_0x76f4('0x3b')]({},_0xe744af,_0x5b667b['options']);return db[_0x76f4('0x29')][_0x76f4('0x46')](_0xe744af)['then'](handleEntityNotFound(_0xbc3d7e,null))['then'](respondWithResult(_0xbc3d7e,null))[_0x76f4('0x42')](handleError(_0xbc3d7e,null));};exports[_0x76f4('0x47')]=function(_0x3f35ce,_0x217d3a){return db['Cdr'][_0x76f4('0x47')](_0x3f35ce[_0x76f4('0x48')],{})[_0x76f4('0x23')](respondWithResult(_0x217d3a,0xc9))['catch'](handleError(_0x217d3a,null));};exports[_0x76f4('0x22')]=function(_0x6bbcf2,_0x535eca){if(_0x6bbcf2['body']['id']){delete _0x6bbcf2[_0x76f4('0x48')]['id'];}return db[_0x76f4('0x29')][_0x76f4('0x46')]({'where':{'id':_0x6bbcf2[_0x76f4('0x49')]['id']}})[_0x76f4('0x23')](handleEntityNotFound(_0x535eca,null))['then'](saveUpdates(_0x6bbcf2[_0x76f4('0x48')],null))['then'](respondWithResult(_0x535eca,null))[_0x76f4('0x42')](handleError(_0x535eca,null));};exports[_0x76f4('0x24')]=function(_0x270baf,_0x5e9a45){return db[_0x76f4('0x29')][_0x76f4('0x46')]({'where':{'id':_0x270baf['params']['id']}})[_0x76f4('0x23')](handleEntityNotFound(_0x5e9a45,null))[_0x76f4('0x23')](removeEntity(_0x5e9a45,null))[_0x76f4('0x42')](handleError(_0x5e9a45,null));};exports[_0x76f4('0x4a')]=function(_0x40ff20,_0x479c4b){return db[_0x76f4('0x29')]['describe']()[_0x76f4('0x23')](respondWithResult(_0x479c4b,null))[_0x76f4('0x42')](handleError(_0x479c4b,null));};
\ No newline at end of file
diff --git a/server/api/cdr/cdr.model.js b/server/api/cdr/cdr.model.js
index b4163e7..2ab7de5 100644
--- a/server/api/cdr/cdr.model.js
+++ b/server/api/cdr/cdr.model.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x9957=['dst','src','uniqueid','lodash','util','../../config/logger','api','bluebird','request-promise','path','rimraf','./cdr.attributes','exports','define','Cdr','accountcode','calldate','disposition'];(function(_0x1eae27,_0x1e2e4a){var _0x2d7462=function(_0x23d100){while(--_0x23d100){_0x1eae27['push'](_0x1eae27['shift']());}};_0x2d7462(++_0x1e2e4a);}(_0x9957,0x93));var _0x7995=function(_0x5b644e,_0x2e5e07){_0x5b644e=_0x5b644e-0x0;var _0x49c6bf=_0x9957[_0x5b644e];return _0x49c6bf;};'use strict';var _=require(_0x7995('0x0'));var util=require(_0x7995('0x1'));var logger=require(_0x7995('0x2'))(_0x7995('0x3'));var moment=require('moment');var BPromise=require(_0x7995('0x4'));var rp=require(_0x7995('0x5'));var fs=require('fs');var path=require(_0x7995('0x6'));var rimraf=require(_0x7995('0x7'));var config=require('../../config/environment');var attributes=require(_0x7995('0x8'));module[_0x7995('0x9')]=function(_0x137b6b,_0x219534){return _0x137b6b[_0x7995('0xa')](_0x7995('0xb'),attributes,{'tableName':'cdr','paranoid':![],'indexes':[{'name':_0x7995('0xc'),'fields':[_0x7995('0xc')]},{'name':'calldate','fields':[_0x7995('0xd')]},{'name':_0x7995('0xe'),'fields':[_0x7995('0xe')]},{'name':_0x7995('0xf'),'fields':[_0x7995('0xf')]},{'name':_0x7995('0x10'),'fields':[_0x7995('0x10')]},{'name':'uniqueid','fields':[_0x7995('0x11')]}],'timestamps':![]});};
\ No newline at end of file
+var _0x9957=['dst','src','uniqueid','lodash','util','../../config/logger','api','bluebird','request-promise','path','rimraf','./cdr.attributes','exports','define','Cdr','accountcode','calldate','disposition'];(function(_0x306b9b,_0x5842b1){var _0x4bcca5=function(_0x29f5fe){while(--_0x29f5fe){_0x306b9b['push'](_0x306b9b['shift']());}};_0x4bcca5(++_0x5842b1);}(_0x9957,0x93));var _0x7995=function(_0x5b644e,_0x2e5e07){_0x5b644e=_0x5b644e-0x0;var _0x49c6bf=_0x9957[_0x5b644e];return _0x49c6bf;};'use strict';var _=require(_0x7995('0x0'));var util=require(_0x7995('0x1'));var logger=require(_0x7995('0x2'))(_0x7995('0x3'));var moment=require('moment');var BPromise=require(_0x7995('0x4'));var rp=require(_0x7995('0x5'));var fs=require('fs');var path=require(_0x7995('0x6'));var rimraf=require(_0x7995('0x7'));var config=require('../../config/environment');var attributes=require(_0x7995('0x8'));module[_0x7995('0x9')]=function(_0x137b6b,_0x219534){return _0x137b6b[_0x7995('0xa')](_0x7995('0xb'),attributes,{'tableName':'cdr','paranoid':![],'indexes':[{'name':_0x7995('0xc'),'fields':[_0x7995('0xc')]},{'name':'calldate','fields':[_0x7995('0xd')]},{'name':_0x7995('0xe'),'fields':[_0x7995('0xe')]},{'name':_0x7995('0xf'),'fields':[_0x7995('0xf')]},{'name':_0x7995('0x10'),'fields':[_0x7995('0x10')]},{'name':'uniqueid','fields':[_0x7995('0x11')]}],'timestamps':![]});};
\ No newline at end of file
diff --git a/server/api/cdr/cdr.rpc.js b/server/api/cdr/cdr.rpc.js
index b734578..efcba02 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 _0x8998=['client','http','info','Cdr,\x20%s,\x20%s','request\x20sent','debug','Cdr,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise'];(function(_0x3f965f,_0x9c2930){var _0x2895ca=function(_0x10e935){while(--_0x10e935){_0x3f965f['push'](_0x3f965f['shift']());}};_0x2895ca(++_0x9c2930);}(_0x8998,0xd2));var _0x8899=function(_0x242c44,_0x250f08){_0x242c44=_0x242c44-0x0;var _0x5869ad=_0x8998[_0x242c44];return _0x5869ad;};'use strict';var _=require(_0x8899('0x0'));var util=require('util');var moment=require(_0x8899('0x1'));var BPromise=require(_0x8899('0x2'));var rs=require(_0x8899('0x3'));var fs=require('fs');var Redis=require(_0x8899('0x4'));var db=require(_0x8899('0x5'))['db'];var utils=require(_0x8899('0x6'));var logger=require('../../config/logger')(_0x8899('0x7'));var config=require(_0x8899('0x8'));var jayson=require(_0x8899('0x9'));var client=jayson[_0x8899('0xa')][_0x8899('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x52c003,_0x344a09,_0x51fb5e){return new BPromise(function(_0xf5bb6e,_0xdcadc7){return client['request'](_0x52c003,_0x51fb5e)['then'](function(_0x5b746b){logger[_0x8899('0xc')](_0x8899('0xd'),_0x344a09,_0x8899('0xe'));logger[_0x8899('0xf')](_0x8899('0x10'),_0x344a09,_0x8899('0xe'),JSON[_0x8899('0x11')](_0x5b746b));if(_0x5b746b[_0x8899('0x12')]){if(_0x5b746b['error'][_0x8899('0x13')]===0x1f4){logger['error'](_0x8899('0xd'),_0x344a09,_0x5b746b[_0x8899('0x12')][_0x8899('0x14')]);return _0xdcadc7(_0x5b746b[_0x8899('0x12')][_0x8899('0x14')]);}logger[_0x8899('0x12')](_0x8899('0xd'),_0x344a09,_0x5b746b['error'][_0x8899('0x14')]);return _0xf5bb6e(_0x5b746b[_0x8899('0x12')]['message']);}else{logger[_0x8899('0xc')](_0x8899('0xd'),_0x344a09,_0x8899('0xe'));_0xf5bb6e(_0x5b746b['result'][_0x8899('0x14')]);}})[_0x8899('0x15')](function(_0x9c0182){logger[_0x8899('0x12')]('Cdr,\x20%s,\x20%s',_0x344a09,_0x9c0182);_0xdcadc7(_0x9c0182);});});}
\ No newline at end of file
+var _0xed6c=['info','Cdr,\x20%s,\x20%s','request\x20sent','debug','Cdr,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','request'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0xed6c,0xb2));var _0xced6=function(_0xd0a847,_0x72562b){_0xd0a847=_0xd0a847-0x0;var _0x2536ec=_0xed6c[_0xd0a847];return _0x2536ec;};'use strict';var _=require(_0xced6('0x0'));var util=require(_0xced6('0x1'));var moment=require(_0xced6('0x2'));var BPromise=require(_0xced6('0x3'));var rs=require(_0xced6('0x4'));var fs=require('fs');var Redis=require(_0xced6('0x5'));var db=require(_0xced6('0x6'))['db'];var utils=require(_0xced6('0x7'));var logger=require(_0xced6('0x8'))(_0xced6('0x9'));var config=require('../../config/environment');var jayson=require(_0xced6('0xa'));var client=jayson[_0xced6('0xb')][_0xced6('0xc')]({'port':0x232a});function respondWithRpcPromise(_0xec8fb1,_0xae90a5,_0x159d06){return new BPromise(function(_0x1994f5,_0x59d7ce){return client[_0xced6('0xd')](_0xec8fb1,_0x159d06)['then'](function(_0x230ba7){logger[_0xced6('0xe')](_0xced6('0xf'),_0xae90a5,_0xced6('0x10'));logger[_0xced6('0x11')](_0xced6('0x12'),_0xae90a5,_0xced6('0x10'),JSON[_0xced6('0x13')](_0x230ba7));if(_0x230ba7[_0xced6('0x14')]){if(_0x230ba7[_0xced6('0x14')][_0xced6('0x15')]===0x1f4){logger[_0xced6('0x14')](_0xced6('0xf'),_0xae90a5,_0x230ba7[_0xced6('0x14')]['message']);return _0x59d7ce(_0x230ba7[_0xced6('0x14')]['message']);}logger[_0xced6('0x14')]('Cdr,\x20%s,\x20%s',_0xae90a5,_0x230ba7['error'][_0xced6('0x16')]);return _0x1994f5(_0x230ba7['error']['message']);}else{logger[_0xced6('0xe')](_0xced6('0xf'),_0xae90a5,_0xced6('0x10'));_0x1994f5(_0x230ba7[_0xced6('0x17')][_0xced6('0x16')]);}})['catch'](function(_0x12e1d7){logger[_0xced6('0x14')]('Cdr,\x20%s,\x20%s',_0xae90a5,_0x12e1d7);_0x59d7ce(_0x12e1d7);});});}
\ No newline at end of file
diff --git a/server/api/cdr/index.js b/server/api/cdr/index.js
index d06890b..9860c72 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(_0x171fdc,_0x16ae91){var _0x3782ea=function(_0x58b691){while(--_0x58b691){_0x171fdc['push'](_0x171fdc['shift']());}};_0x3782ea(++_0x16ae91);}(_0xa9e0,0x123));var _0x0a9e=function(_0x2d8fc2,_0x1c461d){_0x2d8fc2=_0x2d8fc2-0x0;var _0x3a9e53=_0xa9e0[_0x2d8fc2];return _0x3a9e53;};'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(_0x2576d7,_0x167624){var _0x16a08c=function(_0x19de1e){while(--_0x19de1e){_0x2576d7['push'](_0x2576d7['shift']());}};_0x16a08c(++_0x167624);}(_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 493c55e..bea0add 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 _0x2a00=['exports','INTEGER','STRING','TEXT','sequelize'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x2a00,0x180));var _0x02a0=function(_0x5efb9e,_0x47e288){_0x5efb9e=_0x5efb9e-0x0;var _0x571f58=_0x2a00[_0x5efb9e];return _0x571f58;};'use strict';var Sequelize=require(_0x02a0('0x0'));module[_0x02a0('0x1')]={'priority':{'type':Sequelize[_0x02a0('0x2')],'allowNull':![]},'app':{'type':Sequelize[_0x02a0('0x3')],'allowNull':![],'defaultValue':'noop'},'appdata':{'type':Sequelize[_0x02a0('0x4')]()},'description':{'type':Sequelize[_0x02a0('0x3')]},'interval':{'type':Sequelize[_0x02a0('0x3')],'defaultValue':'*,*,*,*'}};
\ No newline at end of file
+var _0xaca9=['STRING','noop','TEXT','*,*,*,*','sequelize','INTEGER'];(function(_0x265aa2,_0x220072){var _0x447a3a=function(_0x1512cc){while(--_0x1512cc){_0x265aa2['push'](_0x265aa2['shift']());}};_0x447a3a(++_0x220072);}(_0xaca9,0x88));var _0x9aca=function(_0x68c979,_0x431cff){_0x68c979=_0x68c979-0x0;var _0x4f0001=_0xaca9[_0x68c979];return _0x4f0001;};'use strict';var Sequelize=require(_0x9aca('0x0'));module['exports']={'priority':{'type':Sequelize[_0x9aca('0x1')],'allowNull':![]},'app':{'type':Sequelize[_0x9aca('0x2')],'allowNull':![],'defaultValue':_0x9aca('0x3')},'appdata':{'type':Sequelize[_0x9aca('0x4')]()},'description':{'type':Sequelize[_0x9aca('0x2')]},'interval':{'type':Sequelize['STRING'],'defaultValue':_0x9aca('0x5')}};
\ No newline at end of file
diff --git a/server/api/chatApplication/chatApplication.controller.js b/server/api/chatApplication/chatApplication.controller.js
index f0bca6f..c9735fc 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 _0x7341=['zip-dir','request-promise','moment','mustache','util','path','sox','to-csv','ejs','fs-extra','squel','crypto','jsforce','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','sendStatus','status','end','json','offset','undefined','limit','count','Content-Range','save','update','then','destroy','error','stack','name','send','show','params','keys','ChatApplication','query','filters','model','fields','attributes','length','includeAll','include','merge','options','find','catch','body'];(function(_0xfb53a4,_0x477204){var _0x4c77b1=function(_0x1cdfdf){while(--_0x1cdfdf){_0xfb53a4['push'](_0xfb53a4['shift']());}};_0x4c77b1(++_0x477204);}(_0x7341,0xe4));var _0x1734=function(_0x21d9f4,_0x4b7d83){_0x21d9f4=_0x21d9f4-0x0;var _0x66f13=_0x7341[_0x21d9f4];return _0x66f13;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x1734('0x0'));var jsonpatch=require('fast-json-patch');var rp=require(_0x1734('0x1'));var moment=require(_0x1734('0x2'));var BPromise=require('bluebird');var Mustache=require(_0x1734('0x3'));var util=require(_0x1734('0x4'));var path=require(_0x1734('0x5'));var sox=require(_0x1734('0x6'));var csv=require(_0x1734('0x7'));var ejs=require(_0x1734('0x8'));var fs=require('fs');var fs_extra=require(_0x1734('0x9'));var _=require('lodash');var squel=require(_0x1734('0xa'));var crypto=require(_0x1734('0xb'));var jsforce=require(_0x1734('0xc'));var deskjs=require('desk.js');var toCsv=require(_0x1734('0x7'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x1734('0xd'));var authService=require(_0x1734('0xe'));var qs=require(_0x1734('0xf'));var as=require(_0x1734('0x10'));var hardwareService=require(_0x1734('0x11'));var logger=require(_0x1734('0x12'))(_0x1734('0x13'));var utils=require(_0x1734('0x14'));var config=require(_0x1734('0x15'));var licenseUtil=require(_0x1734('0x16'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x4391a1,_0x449ab1){_0x449ab1=_0x449ab1||0xcc;return function(_0x44de07){if(_0x44de07){return _0x4391a1[_0x1734('0x17')](_0x449ab1);}return _0x4391a1[_0x1734('0x18')](_0x449ab1)[_0x1734('0x19')]();};}function respondWithResult(_0x9e7cf5,_0xd2f288){_0xd2f288=_0xd2f288||0xc8;return function(_0xb90c22){if(_0xb90c22){return _0x9e7cf5[_0x1734('0x18')](_0xd2f288)[_0x1734('0x1a')](_0xb90c22);}};}function respondWithFilteredResult(_0x27679e,_0x2162c9){return function(_0x2dd53c){if(_0x2dd53c){var _0x3989a6=typeof _0x2162c9[_0x1734('0x1b')]===_0x1734('0x1c')&&typeof _0x2162c9[_0x1734('0x1d')]===_0x1734('0x1c');var _0x56756c=_0x2dd53c['count'];var _0x1fa9c0=_0x3989a6?0x0:_0x2162c9[_0x1734('0x1b')];var _0x4a86d1=_0x3989a6?_0x2dd53c[_0x1734('0x1e')]:_0x2162c9['offset']+_0x2162c9['limit'];var _0x5b2789;if(_0x4a86d1>=_0x56756c){_0x4a86d1=_0x56756c;_0x5b2789=0xc8;}else{_0x5b2789=0xce;}_0x27679e[_0x1734('0x18')](_0x5b2789);return _0x27679e['set'](_0x1734('0x1f'),_0x1fa9c0+'-'+_0x4a86d1+'/'+_0x56756c)[_0x1734('0x1a')](_0x2dd53c);}return null;};}function patchUpdates(_0x4fc4ed){return function(_0x54b1bd){try{jsonpatch['apply'](_0x54b1bd,_0x4fc4ed,!![]);}catch(_0x1e7401){return BPromise['reject'](_0x1e7401);}return _0x54b1bd[_0x1734('0x20')]();};}function saveUpdates(_0x5ad801,_0x215ae4){return function(_0x42485f){if(_0x42485f){return _0x42485f[_0x1734('0x21')](_0x5ad801)[_0x1734('0x22')](function(_0x29bb2c){return _0x29bb2c;});}return null;};}function removeEntity(_0x45593e,_0x4285ee){return function(_0x44e420){if(_0x44e420){return _0x44e420[_0x1734('0x23')]()['then'](function(){_0x45593e[_0x1734('0x18')](0xcc)['end']();});}};}function handleEntityNotFound(_0x5e0023,_0x7478fd){return function(_0x46b2fa){if(!_0x46b2fa){_0x5e0023[_0x1734('0x17')](0x194);}return _0x46b2fa;};}function handleError(_0x157e35,_0x4435ac){_0x4435ac=_0x4435ac||0x1f4;return function(_0x2a95e3){logger[_0x1734('0x24')](_0x2a95e3[_0x1734('0x25')]);if(_0x2a95e3['name']){delete _0x2a95e3[_0x1734('0x26')];}_0x157e35['status'](_0x4435ac)[_0x1734('0x27')](_0x2a95e3);};}exports[_0x1734('0x28')]=function(_0xfca2ad,_0x52411b){var _0x3eb31b={'raw':!![],'where':{'id':_0xfca2ad[_0x1734('0x29')]['id']}},_0x3f9abe={};_0x3f9abe['model']=_[_0x1734('0x2a')](db[_0x1734('0x2b')]['rawAttributes']);_0x3f9abe[_0x1734('0x2c')]=_[_0x1734('0x2a')](_0xfca2ad[_0x1734('0x2c')]);_0x3f9abe[_0x1734('0x2d')]=_['intersection'](_0x3f9abe[_0x1734('0x2e')],_0x3f9abe[_0x1734('0x2c')]);_0x3eb31b['attributes']=_['intersection'](_0x3f9abe[_0x1734('0x2e')],qs[_0x1734('0x2f')](_0xfca2ad[_0x1734('0x2c')][_0x1734('0x2f')]));_0x3eb31b[_0x1734('0x30')]=_0x3eb31b[_0x1734('0x30')][_0x1734('0x31')]?_0x3eb31b[_0x1734('0x30')]:_0x3f9abe[_0x1734('0x2e')];if(_0xfca2ad[_0x1734('0x2c')][_0x1734('0x32')]){_0x3eb31b[_0x1734('0x33')]=[{'all':!![]}];}_0x3eb31b=_[_0x1734('0x34')]({},_0x3eb31b,_0xfca2ad[_0x1734('0x35')]);return db[_0x1734('0x2b')][_0x1734('0x36')](_0x3eb31b)[_0x1734('0x22')](handleEntityNotFound(_0x52411b,null))['then'](respondWithResult(_0x52411b,null))[_0x1734('0x37')](handleError(_0x52411b,null));};exports['update']=function(_0xc618e5,_0x462373){if(_0xc618e5[_0x1734('0x38')]['id']){delete _0xc618e5[_0x1734('0x38')]['id'];}return db[_0x1734('0x2b')][_0x1734('0x36')]({'where':{'id':_0xc618e5[_0x1734('0x29')]['id']}})[_0x1734('0x22')](handleEntityNotFound(_0x462373,null))['then'](saveUpdates(_0xc618e5[_0x1734('0x38')],null))[_0x1734('0x22')](respondWithResult(_0x462373,null))[_0x1734('0x37')](handleError(_0x462373,null));};exports[_0x1734('0x23')]=function(_0x30817d,_0x1b7caa){return db[_0x1734('0x2b')]['find']({'where':{'id':_0x30817d[_0x1734('0x29')]['id']}})[_0x1734('0x22')](handleEntityNotFound(_0x1b7caa,null))[_0x1734('0x22')](removeEntity(_0x1b7caa,null))[_0x1734('0x37')](handleError(_0x1b7caa,null));};
\ No newline at end of file
+var _0x6d4a=['../../components/parsers/qs','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','sendStatus','end','status','json','offset','undefined','count','set','Content-Range','apply','update','then','destroy','error','name','send','show','params','keys','ChatApplication','rawAttributes','query','intersection','model','attributes','fields','length','includeAll','include','merge','catch','body','find','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service'];(function(_0x2ce733,_0x1a2ea2){var _0x31dc08=function(_0x15fbee){while(--_0x15fbee){_0x2ce733['push'](_0x2ce733['shift']());}};_0x31dc08(++_0x1a2ea2);}(_0x6d4a,0x117));var _0xa6d4=function(_0x1b8c8f,_0x3230d7){_0x1b8c8f=_0x1b8c8f-0x0;var _0xf51725=_0x6d4a[_0x1b8c8f];return _0xf51725;};'use strict';var emlformat=require(_0xa6d4('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xa6d4('0x1'));var jsonpatch=require(_0xa6d4('0x2'));var rp=require(_0xa6d4('0x3'));var moment=require(_0xa6d4('0x4'));var BPromise=require(_0xa6d4('0x5'));var Mustache=require(_0xa6d4('0x6'));var util=require(_0xa6d4('0x7'));var path=require(_0xa6d4('0x8'));var sox=require(_0xa6d4('0x9'));var csv=require(_0xa6d4('0xa'));var ejs=require(_0xa6d4('0xb'));var fs=require('fs');var fs_extra=require(_0xa6d4('0xc'));var _=require(_0xa6d4('0xd'));var squel=require(_0xa6d4('0xe'));var crypto=require('crypto');var jsforce=require(_0xa6d4('0xf'));var deskjs=require(_0xa6d4('0x10'));var toCsv=require('to-csv');var querystring=require(_0xa6d4('0x11'));var Papa=require(_0xa6d4('0x12'));var Redis=require(_0xa6d4('0x13'));var authService=require(_0xa6d4('0x14'));var qs=require(_0xa6d4('0x15'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xa6d4('0x16'));var logger=require(_0xa6d4('0x17'))('api');var utils=require(_0xa6d4('0x18'));var config=require(_0xa6d4('0x19'));var licenseUtil=require(_0xa6d4('0x1a'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x31ac95,_0x53b1c1){_0x53b1c1=_0x53b1c1||0xcc;return function(_0x23830f){if(_0x23830f){return _0x31ac95[_0xa6d4('0x1b')](_0x53b1c1);}return _0x31ac95['status'](_0x53b1c1)[_0xa6d4('0x1c')]();};}function respondWithResult(_0x101f40,_0x3a0d34){_0x3a0d34=_0x3a0d34||0xc8;return function(_0x9631de){if(_0x9631de){return _0x101f40[_0xa6d4('0x1d')](_0x3a0d34)[_0xa6d4('0x1e')](_0x9631de);}};}function respondWithFilteredResult(_0x2110d1,_0x3e714f){return function(_0x7420d8){if(_0x7420d8){var _0x17a926=typeof _0x3e714f[_0xa6d4('0x1f')]===_0xa6d4('0x20')&&typeof _0x3e714f['limit']===_0xa6d4('0x20');var _0x493077=_0x7420d8[_0xa6d4('0x21')];var _0x474b62=_0x17a926?0x0:_0x3e714f[_0xa6d4('0x1f')];var _0x4a7af1=_0x17a926?_0x7420d8[_0xa6d4('0x21')]:_0x3e714f[_0xa6d4('0x1f')]+_0x3e714f['limit'];var _0x3fa155;if(_0x4a7af1>=_0x493077){_0x4a7af1=_0x493077;_0x3fa155=0xc8;}else{_0x3fa155=0xce;}_0x2110d1[_0xa6d4('0x1d')](_0x3fa155);return _0x2110d1[_0xa6d4('0x22')](_0xa6d4('0x23'),_0x474b62+'-'+_0x4a7af1+'/'+_0x493077)[_0xa6d4('0x1e')](_0x7420d8);}return null;};}function patchUpdates(_0x5c40f5){return function(_0x3e0ae2){try{jsonpatch[_0xa6d4('0x24')](_0x3e0ae2,_0x5c40f5,!![]);}catch(_0xb7fbf9){return BPromise['reject'](_0xb7fbf9);}return _0x3e0ae2['save']();};}function saveUpdates(_0x3d98c2,_0x32bea3){return function(_0x46d32f){if(_0x46d32f){return _0x46d32f[_0xa6d4('0x25')](_0x3d98c2)[_0xa6d4('0x26')](function(_0x83abb5){return _0x83abb5;});}return null;};}function removeEntity(_0x4a744e,_0x1bf8cb){return function(_0xd4a69e){if(_0xd4a69e){return _0xd4a69e[_0xa6d4('0x27')]()[_0xa6d4('0x26')](function(){_0x4a744e[_0xa6d4('0x1d')](0xcc)[_0xa6d4('0x1c')]();});}};}function handleEntityNotFound(_0x4dca66,_0x3a3ed8){return function(_0x5589c5){if(!_0x5589c5){_0x4dca66[_0xa6d4('0x1b')](0x194);}return _0x5589c5;};}function handleError(_0x5928c9,_0x272759){_0x272759=_0x272759||0x1f4;return function(_0xf2f536){logger[_0xa6d4('0x28')](_0xf2f536['stack']);if(_0xf2f536[_0xa6d4('0x29')]){delete _0xf2f536[_0xa6d4('0x29')];}_0x5928c9['status'](_0x272759)[_0xa6d4('0x2a')](_0xf2f536);};}exports[_0xa6d4('0x2b')]=function(_0x501bd1,_0x581bae){var _0x44b967={'raw':!![],'where':{'id':_0x501bd1[_0xa6d4('0x2c')]['id']}},_0x378bf6={};_0x378bf6['model']=_[_0xa6d4('0x2d')](db[_0xa6d4('0x2e')][_0xa6d4('0x2f')]);_0x378bf6[_0xa6d4('0x30')]=_['keys'](_0x501bd1['query']);_0x378bf6['filters']=_[_0xa6d4('0x31')](_0x378bf6[_0xa6d4('0x32')],_0x378bf6[_0xa6d4('0x30')]);_0x44b967[_0xa6d4('0x33')]=_[_0xa6d4('0x31')](_0x378bf6[_0xa6d4('0x32')],qs[_0xa6d4('0x34')](_0x501bd1['query']['fields']));_0x44b967[_0xa6d4('0x33')]=_0x44b967[_0xa6d4('0x33')][_0xa6d4('0x35')]?_0x44b967[_0xa6d4('0x33')]:_0x378bf6[_0xa6d4('0x32')];if(_0x501bd1[_0xa6d4('0x30')][_0xa6d4('0x36')]){_0x44b967[_0xa6d4('0x37')]=[{'all':!![]}];}_0x44b967=_[_0xa6d4('0x38')]({},_0x44b967,_0x501bd1['options']);return db[_0xa6d4('0x2e')]['find'](_0x44b967)[_0xa6d4('0x26')](handleEntityNotFound(_0x581bae,null))[_0xa6d4('0x26')](respondWithResult(_0x581bae,null))[_0xa6d4('0x39')](handleError(_0x581bae,null));};exports[_0xa6d4('0x25')]=function(_0x3c9819,_0x3f3742){if(_0x3c9819[_0xa6d4('0x3a')]['id']){delete _0x3c9819['body']['id'];}return db['ChatApplication'][_0xa6d4('0x3b')]({'where':{'id':_0x3c9819[_0xa6d4('0x2c')]['id']}})['then'](handleEntityNotFound(_0x3f3742,null))[_0xa6d4('0x26')](saveUpdates(_0x3c9819['body'],null))[_0xa6d4('0x26')](respondWithResult(_0x3f3742,null))[_0xa6d4('0x39')](handleError(_0x3f3742,null));};exports['destroy']=function(_0x5f0f00,_0x350ec4){return db[_0xa6d4('0x2e')]['find']({'where':{'id':_0x5f0f00[_0xa6d4('0x2c')]['id']}})[_0xa6d4('0x26')](handleEntityNotFound(_0x350ec4,null))[_0xa6d4('0x26')](removeEntity(_0x350ec4,null))[_0xa6d4('0x39')](handleError(_0x350ec4,null));};
\ No newline at end of file
diff --git a/server/api/chatApplication/chatApplication.model.js b/server/api/chatApplication/chatApplication.model.js
index ad18aee..f748353 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 _0xfabe=['utf8mb4_unicode_ci','lodash','api','moment','bluebird','request-promise','path','rimraf','exports','chat_applications','utf8mb4'];(function(_0x149cbc,_0x379c2b){var _0x570ef6=function(_0x25380f){while(--_0x25380f){_0x149cbc['push'](_0x149cbc['shift']());}};_0x570ef6(++_0x379c2b);}(_0xfabe,0x9b));var _0xefab=function(_0x38cd08,_0x271db8){_0x38cd08=_0x38cd08-0x0;var _0xaab638=_0xfabe[_0x38cd08];return _0xaab638;};'use strict';var _=require(_0xefab('0x0'));var util=require('util');var logger=require('../../config/logger')(_0xefab('0x1'));var moment=require(_0xefab('0x2'));var BPromise=require(_0xefab('0x3'));var rp=require(_0xefab('0x4'));var fs=require('fs');var path=require(_0xefab('0x5'));var rimraf=require(_0xefab('0x6'));var config=require('../../config/environment');var attributes=require('./chatApplication.attributes');module[_0xefab('0x7')]=function(_0x2cf433,_0x260585){return _0x2cf433['define']('ChatApplication',attributes,{'tableName':_0xefab('0x8'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0xefab('0x9'),'collate':_0xefab('0xa')});};
\ No newline at end of file
+var _0xdd0c=['./chatApplication.attributes','exports','define','ChatApplication','chat_applications','utf8mb4','util','../../config/logger','api','bluebird','path','rimraf','../../config/environment'];(function(_0x23e363,_0x4a8453){var _0x192e82=function(_0x4e2c3c){while(--_0x4e2c3c){_0x23e363['push'](_0x23e363['shift']());}};_0x192e82(++_0x4a8453);}(_0xdd0c,0x165));var _0xcdd0=function(_0x46e468,_0x15976d){_0x46e468=_0x46e468-0x0;var _0x5a393c=_0xdd0c[_0x46e468];return _0x5a393c;};'use strict';var _=require('lodash');var util=require(_0xcdd0('0x0'));var logger=require(_0xcdd0('0x1'))(_0xcdd0('0x2'));var moment=require('moment');var BPromise=require(_0xcdd0('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xcdd0('0x4'));var rimraf=require(_0xcdd0('0x5'));var config=require(_0xcdd0('0x6'));var attributes=require(_0xcdd0('0x7'));module[_0xcdd0('0x8')]=function(_0x5ae472,_0x2b33fc){return _0x5ae472[_0xcdd0('0x9')](_0xcdd0('0xa'),attributes,{'tableName':_0xcdd0('0xb'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0xcdd0('0xc'),'collate':'utf8mb4_unicode_ci'});};
\ No newline at end of file
diff --git a/server/api/chatApplication/chatApplication.rpc.js b/server/api/chatApplication/chatApplication.rpc.js
index e59376b..0062cf2 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 _0x9fee=['rpc','../../config/environment','jayson/promise','client','http','info','ChatApplication,\x20%s,\x20%s','debug','ChatApplication,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils'];(function(_0x23e95c,_0x322a59){var _0x54da36=function(_0x3582e9){while(--_0x3582e9){_0x23e95c['push'](_0x23e95c['shift']());}};_0x54da36(++_0x322a59);}(_0x9fee,0x67));var _0xe9fe=function(_0x993b20,_0x23f483){_0x993b20=_0x993b20-0x0;var _0x4b86f9=_0x9fee[_0x993b20];return _0x4b86f9;};'use strict';var _=require(_0xe9fe('0x0'));var util=require('util');var moment=require(_0xe9fe('0x1'));var BPromise=require(_0xe9fe('0x2'));var rs=require(_0xe9fe('0x3'));var fs=require('fs');var Redis=require(_0xe9fe('0x4'));var db=require(_0xe9fe('0x5'))['db'];var utils=require(_0xe9fe('0x6'));var logger=require('../../config/logger')(_0xe9fe('0x7'));var config=require(_0xe9fe('0x8'));var jayson=require(_0xe9fe('0x9'));var client=jayson[_0xe9fe('0xa')][_0xe9fe('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x17cd3e,_0x9f7ac1,_0x1b3f95){return new BPromise(function(_0x36925b,_0x10904d){return client['request'](_0x17cd3e,_0x1b3f95)['then'](function(_0x233fbc){logger[_0xe9fe('0xc')](_0xe9fe('0xd'),_0x9f7ac1,'request\x20sent');logger[_0xe9fe('0xe')](_0xe9fe('0xf'),_0x9f7ac1,_0xe9fe('0x10'),JSON[_0xe9fe('0x11')](_0x233fbc));if(_0x233fbc['error']){if(_0x233fbc[_0xe9fe('0x12')][_0xe9fe('0x13')]===0x1f4){logger[_0xe9fe('0x12')](_0xe9fe('0xd'),_0x9f7ac1,_0x233fbc[_0xe9fe('0x12')][_0xe9fe('0x14')]);return _0x10904d(_0x233fbc[_0xe9fe('0x12')][_0xe9fe('0x14')]);}logger[_0xe9fe('0x12')](_0xe9fe('0xd'),_0x9f7ac1,_0x233fbc[_0xe9fe('0x12')][_0xe9fe('0x14')]);return _0x36925b(_0x233fbc[_0xe9fe('0x12')]['message']);}else{logger['info']('ChatApplication,\x20%s,\x20%s',_0x9f7ac1,_0xe9fe('0x10'));_0x36925b(_0x233fbc[_0xe9fe('0x15')]['message']);}})['catch'](function(_0x455629){logger[_0xe9fe('0x12')]('ChatApplication,\x20%s,\x20%s',_0x9f7ac1,_0x455629);_0x10904d(_0x455629);});});}
\ No newline at end of file
+var _0xc3c2=['moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','request','then','info','ChatApplication,\x20%s,\x20%s','request\x20sent','debug','ChatApplication,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','util'];(function(_0x3bc8ab,_0x4f4594){var _0x1c2e1b=function(_0x3d6f92){while(--_0x3d6f92){_0x3bc8ab['push'](_0x3bc8ab['shift']());}};_0x1c2e1b(++_0x4f4594);}(_0xc3c2,0x16f));var _0x2c3c=function(_0x552b43,_0x2dcc68){_0x552b43=_0x552b43-0x0;var _0x3e01b9=_0xc3c2[_0x552b43];return _0x3e01b9;};'use strict';var _=require('lodash');var util=require(_0x2c3c('0x0'));var moment=require(_0x2c3c('0x1'));var BPromise=require(_0x2c3c('0x2'));var rs=require(_0x2c3c('0x3'));var fs=require('fs');var Redis=require(_0x2c3c('0x4'));var db=require(_0x2c3c('0x5'))['db'];var utils=require(_0x2c3c('0x6'));var logger=require('../../config/logger')(_0x2c3c('0x7'));var config=require(_0x2c3c('0x8'));var jayson=require(_0x2c3c('0x9'));var client=jayson[_0x2c3c('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x45f690,_0x4f7c40,_0x573055){return new BPromise(function(_0x279942,_0x4278fb){return client[_0x2c3c('0xb')](_0x45f690,_0x573055)[_0x2c3c('0xc')](function(_0x6379f9){logger[_0x2c3c('0xd')](_0x2c3c('0xe'),_0x4f7c40,_0x2c3c('0xf'));logger[_0x2c3c('0x10')](_0x2c3c('0x11'),_0x4f7c40,_0x2c3c('0xf'),JSON[_0x2c3c('0x12')](_0x6379f9));if(_0x6379f9[_0x2c3c('0x13')]){if(_0x6379f9[_0x2c3c('0x13')][_0x2c3c('0x14')]===0x1f4){logger['error'](_0x2c3c('0xe'),_0x4f7c40,_0x6379f9['error'][_0x2c3c('0x15')]);return _0x4278fb(_0x6379f9[_0x2c3c('0x13')][_0x2c3c('0x15')]);}logger[_0x2c3c('0x13')](_0x2c3c('0xe'),_0x4f7c40,_0x6379f9['error'][_0x2c3c('0x15')]);return _0x279942(_0x6379f9['error'][_0x2c3c('0x15')]);}else{logger[_0x2c3c('0xd')]('ChatApplication,\x20%s,\x20%s',_0x4f7c40,_0x2c3c('0xf'));_0x279942(_0x6379f9['result'][_0x2c3c('0x15')]);}})[_0x2c3c('0x16')](function(_0x8fed63){logger[_0x2c3c('0x13')]('ChatApplication,\x20%s,\x20%s',_0x4f7c40,_0x8fed63);_0x4278fb(_0x8fed63);});});}
\ No newline at end of file
diff --git a/server/api/chatApplication/index.js b/server/api/chatApplication/index.js
index 546b5ff..453d19b 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 _0x9618=['connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatApplication.controller','get','/:id','isAuthenticated','show','delete','destroy','multer','util','path'];(function(_0x130fc0,_0x5a6067){var _0x4b04f0=function(_0x24b888){while(--_0x24b888){_0x130fc0['push'](_0x130fc0['shift']());}};_0x4b04f0(++_0x5a6067);}(_0x9618,0x16d));var _0x8961=function(_0x1c6bba,_0x4c8625){_0x1c6bba=_0x1c6bba-0x0;var _0x6f8acb=_0x9618[_0x1c6bba];return _0x6f8acb;};'use strict';var multer=require(_0x8961('0x0'));var util=require(_0x8961('0x1'));var path=require(_0x8961('0x2'));var timeout=require(_0x8961('0x3'));var express=require(_0x8961('0x4'));var router=express[_0x8961('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0x8961('0x6'));var interaction=require(_0x8961('0x7'));var config=require(_0x8961('0x8'));var controller=require(_0x8961('0x9'));router[_0x8961('0xa')](_0x8961('0xb'),auth[_0x8961('0xc')](),controller[_0x8961('0xd')]);router['put']('/:id',auth[_0x8961('0xc')](),controller['update']);router[_0x8961('0xe')](_0x8961('0xb'),auth[_0x8961('0xc')](),controller[_0x8961('0xf')]);module['exports']=router;
\ No newline at end of file
+var _0x9f05=['util','path','../../components/interaction/service','../../config/environment','./chatApplication.controller','get','/:id','isAuthenticated','show','put','update','delete','destroy','exports','multer'];(function(_0xce06e8,_0x149121){var _0x1ba240=function(_0x37d35d){while(--_0x37d35d){_0xce06e8['push'](_0xce06e8['shift']());}};_0x1ba240(++_0x149121);}(_0x9f05,0x1c1));var _0x59f0=function(_0x2d3382,_0x35e70b){_0x2d3382=_0x2d3382-0x0;var _0x9f09bf=_0x9f05[_0x2d3382];return _0x9f09bf;};'use strict';var multer=require(_0x59f0('0x0'));var util=require(_0x59f0('0x1'));var path=require(_0x59f0('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express['Router']();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0x59f0('0x3'));var config=require(_0x59f0('0x4'));var controller=require(_0x59f0('0x5'));router[_0x59f0('0x6')](_0x59f0('0x7'),auth[_0x59f0('0x8')](),controller[_0x59f0('0x9')]);router[_0x59f0('0xa')](_0x59f0('0x7'),auth['isAuthenticated'](),controller[_0x59f0('0xb')]);router[_0x59f0('0xc')](_0x59f0('0x7'),auth[_0x59f0('0x8')](),controller[_0x59f0('0xd')]);module[_0x59f0('0xe')]=router;
\ No newline at end of file
diff --git a/server/api/chatGroup/chatGroup.attributes.js b/server/api/chatGroup/chatGroup.attributes.js
index d32433d..0aae94b 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 _0x0182=['STRING','BOOLEAN','sequelize','exports'];(function(_0x1d1967,_0x52b368){var _0x5d6ce0=function(_0x41f793){while(--_0x41f793){_0x1d1967['push'](_0x1d1967['shift']());}};_0x5d6ce0(++_0x52b368);}(_0x0182,0x18a));var _0x2018=function(_0x3f670b,_0x10f414){_0x3f670b=_0x3f670b-0x0;var _0x1c0978=_0x0182[_0x3f670b];return _0x1c0978;};'use strict';var Sequelize=require(_0x2018('0x0'));module[_0x2018('0x1')]={'name':{'type':Sequelize[_0x2018('0x2')],'allowNull':![]},'description':{'type':Sequelize[_0x2018('0x2')]},'write':{'type':Sequelize[_0x2018('0x3')],'defaultValue':!![]}};
\ No newline at end of file
+var _0x3843=['sequelize','exports','STRING'];(function(_0x3db91a,_0x425740){var _0x54c81c=function(_0x4ccf10){while(--_0x4ccf10){_0x3db91a['push'](_0x3db91a['shift']());}};_0x54c81c(++_0x425740);}(_0x3843,0x144));var _0x3384=function(_0x554fb4,_0x1db667){_0x554fb4=_0x554fb4-0x0;var _0x494205=_0x3843[_0x554fb4];return _0x494205;};'use strict';var Sequelize=require(_0x3384('0x0'));module[_0x3384('0x1')]={'name':{'type':Sequelize[_0x3384('0x2')],'allowNull':![]},'description':{'type':Sequelize['STRING']},'write':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]}};
\ No newline at end of file
diff --git a/server/api/chatGroup/chatGroup.controller.js b/server/api/chatGroup/chatGroup.controller.js
index 3ec9290..78d56bc 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 _0x06fd=['user','toInteger','ids','omit','getMembers','findOne','User','pick','removeMembers','addMessage','ChatGroupId','getMessages','rawAttributes','$gte','split','format','YYYY-MM-DD\x20HH:mm:ss','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','redis','defaults','localhost','socket.io-emitter','./chatGroup.socket','status','end','undefined','limit','count','offset','set','Content-Range','reject','save','update','destroy','sendStatus','error','stack','send','index','map','type','model','name','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filter','merge','VIRTUAL','options','ChatGroup','then','includeAll','include','findAll','show','params','find','catch','create','body','describe','getUnread','ChatInternalMessage'];(function(_0x1c11f1,_0x15765b){var _0x1e7e6f=function(_0x29abb5){while(--_0x29abb5){_0x1c11f1['push'](_0x1c11f1['shift']());}};_0x1e7e6f(++_0x15765b);}(_0x06fd,0x13d));var _0xd06f=function(_0x3598bb,_0x24befa){_0x3598bb=_0x3598bb-0x0;var _0x13c837=_0x06fd[_0x3598bb];return _0x13c837;};'use strict';var emlformat=require(_0xd06f('0x0'));var rimraf=require(_0xd06f('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xd06f('0x2'));var rp=require(_0xd06f('0x3'));var moment=require(_0xd06f('0x4'));var BPromise=require(_0xd06f('0x5'));var Mustache=require(_0xd06f('0x6'));var util=require(_0xd06f('0x7'));var path=require(_0xd06f('0x8'));var sox=require(_0xd06f('0x9'));var csv=require(_0xd06f('0xa'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xd06f('0xb'));var _=require(_0xd06f('0xc'));var squel=require(_0xd06f('0xd'));var crypto=require(_0xd06f('0xe'));var jsforce=require(_0xd06f('0xf'));var deskjs=require(_0xd06f('0x10'));var toCsv=require(_0xd06f('0xa'));var querystring=require(_0xd06f('0x11'));var Papa=require(_0xd06f('0x12'));var Redis=require(_0xd06f('0x13'));var authService=require(_0xd06f('0x14'));var qs=require('../../components/parsers/qs');var as=require(_0xd06f('0x15'));var hardwareService=require(_0xd06f('0x16'));var logger=require(_0xd06f('0x17'))(_0xd06f('0x18'));var utils=require(_0xd06f('0x19'));var config=require('../../config/environment');var licenseUtil=require(_0xd06f('0x1a'));var db=require('../../mysqldb')['db'];config[_0xd06f('0x1b')]=_[_0xd06f('0x1c')](config[_0xd06f('0x1b')],{'host':_0xd06f('0x1d'),'port':0x18eb});var socket=require(_0xd06f('0x1e'))(new Redis(config[_0xd06f('0x1b')]));require(_0xd06f('0x1f'))['register'](socket);function respondWithStatusCode(_0x2be112,_0x20bd3d){_0x20bd3d=_0x20bd3d||0xcc;return function(_0x2d80f8){if(_0x2d80f8){return _0x2be112['sendStatus'](_0x20bd3d);}return _0x2be112[_0xd06f('0x20')](_0x20bd3d)[_0xd06f('0x21')]();};}function respondWithResult(_0x5d5160,_0xf4f3a3){_0xf4f3a3=_0xf4f3a3||0xc8;return function(_0xdf19fa){if(_0xdf19fa){return _0x5d5160[_0xd06f('0x20')](_0xf4f3a3)['json'](_0xdf19fa);}};}function respondWithFilteredResult(_0x19d036,_0x1b4a0e){return function(_0x30ffa5){if(_0x30ffa5){var _0x42ca60=typeof _0x1b4a0e['offset']===_0xd06f('0x22')&&typeof _0x1b4a0e[_0xd06f('0x23')]==='undefined';var _0x1a7f0f=_0x30ffa5[_0xd06f('0x24')];var _0x40ebd4=_0x42ca60?0x0:_0x1b4a0e[_0xd06f('0x25')];var _0x13f733=_0x42ca60?_0x30ffa5['count']:_0x1b4a0e[_0xd06f('0x25')]+_0x1b4a0e['limit'];var _0x202f97;if(_0x13f733>=_0x1a7f0f){_0x13f733=_0x1a7f0f;_0x202f97=0xc8;}else{_0x202f97=0xce;}_0x19d036[_0xd06f('0x20')](_0x202f97);return _0x19d036[_0xd06f('0x26')](_0xd06f('0x27'),_0x40ebd4+'-'+_0x13f733+'/'+_0x1a7f0f)['json'](_0x30ffa5);}return null;};}function patchUpdates(_0x2b28fd){return function(_0x1ac42d){try{jsonpatch['apply'](_0x1ac42d,_0x2b28fd,!![]);}catch(_0x7dee4b){return BPromise[_0xd06f('0x28')](_0x7dee4b);}return _0x1ac42d[_0xd06f('0x29')]();};}function saveUpdates(_0x387539,_0x297e07){return function(_0x10e90b){if(_0x10e90b){return _0x10e90b[_0xd06f('0x2a')](_0x387539)['then'](function(_0x3f2952){return _0x3f2952;});}return null;};}function removeEntity(_0x4cde78,_0xd81680){return function(_0x89e2b3){if(_0x89e2b3){return _0x89e2b3[_0xd06f('0x2b')]()['then'](function(){_0x4cde78['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x21abd9,_0x101e80){return function(_0x513512){if(!_0x513512){_0x21abd9[_0xd06f('0x2c')](0x194);}return _0x513512;};}function handleError(_0x6b953c,_0x4d90d3){_0x4d90d3=_0x4d90d3||0x1f4;return function(_0x4c848e){logger[_0xd06f('0x2d')](_0x4c848e[_0xd06f('0x2e')]);if(_0x4c848e['name']){delete _0x4c848e['name'];}_0x6b953c[_0xd06f('0x20')](_0x4d90d3)[_0xd06f('0x2f')](_0x4c848e);};}exports[_0xd06f('0x30')]=function(_0x1d4310,_0x5a4c63){var _0x51dc99={},_0x3e0013={},_0x15f2c4={'count':0x0,'rows':[]};var _0x3a8ff4=_[_0xd06f('0x31')](db['ChatGroup']['rawAttributes'],function(_0x12c5d9){return{'name':_0x12c5d9['fieldName'],'type':_0x12c5d9[_0xd06f('0x32')]['key']};});_0x3e0013[_0xd06f('0x33')]=_[_0xd06f('0x31')](_0x3a8ff4,_0xd06f('0x34'));_0x3e0013[_0xd06f('0x35')]=_[_0xd06f('0x36')](_0x1d4310[_0xd06f('0x35')]);_0x3e0013[_0xd06f('0x37')]=_[_0xd06f('0x38')](_0x3e0013[_0xd06f('0x33')],_0x3e0013[_0xd06f('0x35')]);_0x51dc99[_0xd06f('0x39')]=_[_0xd06f('0x38')](_0x3e0013[_0xd06f('0x33')],qs['fields'](_0x1d4310[_0xd06f('0x35')][_0xd06f('0x3a')]));_0x51dc99[_0xd06f('0x39')]=_0x51dc99[_0xd06f('0x39')][_0xd06f('0x3b')]?_0x51dc99[_0xd06f('0x39')]:_0x3e0013['model'];if(!_0x1d4310[_0xd06f('0x35')][_0xd06f('0x3c')](_0xd06f('0x3d'))){_0x51dc99[_0xd06f('0x23')]=qs['limit'](_0x1d4310[_0xd06f('0x35')][_0xd06f('0x23')]);_0x51dc99[_0xd06f('0x25')]=qs[_0xd06f('0x25')](_0x1d4310[_0xd06f('0x35')]['offset']);}_0x51dc99[_0xd06f('0x3e')]=qs['sort'](_0x1d4310['query'][_0xd06f('0x3f')]);_0x51dc99[_0xd06f('0x40')]=qs['filters'](_['pick'](_0x1d4310[_0xd06f('0x35')],_0x3e0013[_0xd06f('0x37')]),_0x3a8ff4);if(_0x1d4310[_0xd06f('0x35')][_0xd06f('0x41')]){_0x51dc99[_0xd06f('0x40')]=_[_0xd06f('0x42')](_0x51dc99[_0xd06f('0x40')],{'$or':_[_0xd06f('0x31')](_0x3a8ff4,function(_0x1c5beb){if(_0x1c5beb[_0xd06f('0x32')]!==_0xd06f('0x43')){var _0x26829e={};_0x26829e[_0x1c5beb['name']]={'$like':'%'+_0x1d4310[_0xd06f('0x35')][_0xd06f('0x41')]+'%'};return _0x26829e;}})});}_0x51dc99=_[_0xd06f('0x42')]({},_0x51dc99,_0x1d4310[_0xd06f('0x44')]);var _0x49136b={'where':_0x51dc99['where']};return db[_0xd06f('0x45')][_0xd06f('0x24')](_0x49136b)[_0xd06f('0x46')](function(_0x438e86){_0x15f2c4[_0xd06f('0x24')]=_0x438e86;if(_0x1d4310[_0xd06f('0x35')][_0xd06f('0x47')]){_0x51dc99[_0xd06f('0x48')]=[{'all':!![]}];}return db[_0xd06f('0x45')][_0xd06f('0x49')](_0x51dc99);})[_0xd06f('0x46')](function(_0x390e97){_0x15f2c4['rows']=_0x390e97;return _0x15f2c4;})[_0xd06f('0x46')](respondWithFilteredResult(_0x5a4c63,_0x51dc99))['catch'](handleError(_0x5a4c63,null));};exports[_0xd06f('0x4a')]=function(_0x1762c5,_0x3ba735){var _0xf3f179={'raw':!![],'where':{'id':_0x1762c5[_0xd06f('0x4b')]['id']}},_0x4979a9={};_0x4979a9[_0xd06f('0x33')]=_[_0xd06f('0x36')](db['ChatGroup']['rawAttributes']);_0x4979a9['query']=_[_0xd06f('0x36')](_0x1762c5[_0xd06f('0x35')]);_0x4979a9['filters']=_['intersection'](_0x4979a9[_0xd06f('0x33')],_0x4979a9[_0xd06f('0x35')]);_0xf3f179[_0xd06f('0x39')]=_['intersection'](_0x4979a9[_0xd06f('0x33')],qs[_0xd06f('0x3a')](_0x1762c5[_0xd06f('0x35')][_0xd06f('0x3a')]));_0xf3f179[_0xd06f('0x39')]=_0xf3f179[_0xd06f('0x39')][_0xd06f('0x3b')]?_0xf3f179['attributes']:_0x4979a9['model'];if(_0x1762c5[_0xd06f('0x35')]['includeAll']){_0xf3f179[_0xd06f('0x48')]=[{'all':!![]}];}_0xf3f179=_[_0xd06f('0x42')]({},_0xf3f179,_0x1762c5[_0xd06f('0x44')]);return db[_0xd06f('0x45')][_0xd06f('0x4c')](_0xf3f179)['then'](handleEntityNotFound(_0x3ba735,null))[_0xd06f('0x46')](respondWithResult(_0x3ba735,null))[_0xd06f('0x4d')](handleError(_0x3ba735,null));};exports[_0xd06f('0x4e')]=function(_0x1fd6e0,_0x21fd7a){return db[_0xd06f('0x45')][_0xd06f('0x4e')](_0x1fd6e0[_0xd06f('0x4f')],{})['then'](respondWithResult(_0x21fd7a,0xc9))[_0xd06f('0x4d')](handleError(_0x21fd7a,null));};exports[_0xd06f('0x2a')]=function(_0x1aee86,_0x54d85a){if(_0x1aee86[_0xd06f('0x4f')]['id']){delete _0x1aee86['body']['id'];}return db[_0xd06f('0x45')][_0xd06f('0x4c')]({'where':{'id':_0x1aee86[_0xd06f('0x4b')]['id']}})[_0xd06f('0x46')](handleEntityNotFound(_0x54d85a,null))[_0xd06f('0x46')](saveUpdates(_0x1aee86[_0xd06f('0x4f')],null))[_0xd06f('0x46')](respondWithResult(_0x54d85a,null))[_0xd06f('0x4d')](handleError(_0x54d85a,null));};exports['destroy']=function(_0x299b46,_0x23d72d){return db[_0xd06f('0x45')][_0xd06f('0x4c')]({'where':{'id':_0x299b46[_0xd06f('0x4b')]['id']}})[_0xd06f('0x46')](handleEntityNotFound(_0x23d72d,null))['then'](removeEntity(_0x23d72d,null))['catch'](handleError(_0x23d72d,null));};exports[_0xd06f('0x50')]=function(_0x42bae2,_0x20f18b){return db[_0xd06f('0x45')]['describe']()['then'](respondWithResult(_0x20f18b,null))[_0xd06f('0x4d')](handleError(_0x20f18b,null));};exports[_0xd06f('0x51')]=function(_0x24cfbc,_0x229fd7,_0x3ed282){return db[_0xd06f('0x52')][_0xd06f('0x24')]({'where':{'ChatGroupId':_0x24cfbc['params']['id'],'ToId':_0x24cfbc[_0xd06f('0x53')]['id'],'read':![]}})[_0xd06f('0x46')](function(_0x2fc4bf){return{'id':_[_0xd06f('0x54')](_0x24cfbc['params']['id']),'count':_0x2fc4bf};})[_0xd06f('0x46')](respondWithResult(_0x229fd7,null))[_0xd06f('0x4d')](handleError(_0x229fd7,null));};exports['addMembers']=function(_0x5b1144,_0x594987,_0x3bd816){return db[_0xd06f('0x45')][_0xd06f('0x4c')]({'where':{'id':_0x5b1144[_0xd06f('0x4b')]['id']}})[_0xd06f('0x46')](handleEntityNotFound(_0x594987,null))['then'](function(_0x139ff2){if(_0x139ff2){return _0x139ff2['addMembers'](_0x5b1144[_0xd06f('0x4f')][_0xd06f('0x55')],_[_0xd06f('0x56')](_0x5b1144[_0xd06f('0x4f')],[_0xd06f('0x55'),'id'])||{});}})[_0xd06f('0x46')](respondWithResult(_0x594987,null))['catch'](handleError(_0x594987,null));};exports[_0xd06f('0x57')]=function(_0x5defe1,_0x351baf,_0x7c787f){var _0x2f0a0e={};var _0x4627c6={};var _0x1d038b;var _0x4a3ee6;return db['ChatGroup'][_0xd06f('0x58')]({'where':{'id':_0x5defe1[_0xd06f('0x4b')]['id']}})[_0xd06f('0x46')](handleEntityNotFound(_0x351baf,null))[_0xd06f('0x46')](function(_0x140062){if(_0x140062){_0x1d038b=_0x140062;_0x4627c6[_0xd06f('0x33')]=_[_0xd06f('0x36')](db[_0xd06f('0x59')]['rawAttributes']);_0x4627c6[_0xd06f('0x35')]=_[_0xd06f('0x36')](_0x5defe1['query']);_0x4627c6[_0xd06f('0x37')]=_[_0xd06f('0x38')](_0x4627c6[_0xd06f('0x33')],_0x4627c6[_0xd06f('0x35')]);_0x2f0a0e[_0xd06f('0x39')]=_[_0xd06f('0x38')](_0x4627c6[_0xd06f('0x33')],qs[_0xd06f('0x3a')](_0x5defe1[_0xd06f('0x35')][_0xd06f('0x3a')]));_0x2f0a0e['attributes']=_0x2f0a0e[_0xd06f('0x39')][_0xd06f('0x3b')]?_0x2f0a0e[_0xd06f('0x39')]:_0x4627c6[_0xd06f('0x33')];_0x2f0a0e[_0xd06f('0x3e')]=qs['sort'](_0x5defe1[_0xd06f('0x35')][_0xd06f('0x3f')]);_0x2f0a0e[_0xd06f('0x40')]=qs[_0xd06f('0x37')](_[_0xd06f('0x5a')](_0x5defe1[_0xd06f('0x35')],_0x4627c6[_0xd06f('0x37')]));if(_0x5defe1[_0xd06f('0x35')][_0xd06f('0x41')]){_0x2f0a0e[_0xd06f('0x40')]=_[_0xd06f('0x42')](_0x2f0a0e['where'],{'$or':_[_0xd06f('0x31')](_0x2f0a0e[_0xd06f('0x39')],function(_0x4cae70){var _0x502b0d={};_0x502b0d[_0x4cae70]={'$like':'%'+_0x5defe1['query'][_0xd06f('0x41')]+'%'};return _0x502b0d;})});}_0x2f0a0e=_[_0xd06f('0x42')]({},_0x2f0a0e,_0x5defe1[_0xd06f('0x44')]);return _0x1d038b['getMembers'](_0x2f0a0e);}})[_0xd06f('0x46')](function(_0x296ec5){if(_0x296ec5){_0x4a3ee6=_0x296ec5[_0xd06f('0x3b')];if(!_0x5defe1['query']['hasOwnProperty'](_0xd06f('0x3d'))){_0x2f0a0e['limit']=qs[_0xd06f('0x23')](_0x5defe1[_0xd06f('0x35')][_0xd06f('0x23')]);_0x2f0a0e['offset']=qs[_0xd06f('0x25')](_0x5defe1[_0xd06f('0x35')][_0xd06f('0x25')]);}return _0x1d038b[_0xd06f('0x57')](_0x2f0a0e);}})[_0xd06f('0x46')](function(_0x1771b3){if(_0x1771b3){return _0x1771b3?{'count':_0x4a3ee6,'rows':_0x1771b3}:null;}})[_0xd06f('0x46')](respondWithResult(_0x351baf,null))[_0xd06f('0x4d')](handleError(_0x351baf,null));};exports[_0xd06f('0x5b')]=function(_0x4e2a17,_0x72c0a1,_0x5f0e02){return db['ChatGroup'][_0xd06f('0x4c')]({'where':{'id':_0x4e2a17[_0xd06f('0x4b')]['id']}})[_0xd06f('0x46')](handleEntityNotFound(_0x72c0a1,null))[_0xd06f('0x46')](function(_0x45ffba){if(_0x45ffba){return _0x45ffba['removeMembers'](_0x4e2a17[_0xd06f('0x35')][_0xd06f('0x55')]);}})['then'](respondWithStatusCode(_0x72c0a1,null))['catch'](handleError(_0x72c0a1,null));};exports[_0xd06f('0x5c')]=function(_0x5bb0f8,_0x460a7c,_0x9bfd6f){if(_0x5bb0f8[_0xd06f('0x4f')]['id']){delete _0x5bb0f8[_0xd06f('0x4f')]['id'];}return db['ChatGroup']['find']({'where':{'id':_0x5bb0f8[_0xd06f('0x4b')]['id']}})[_0xd06f('0x46')](handleEntityNotFound(_0x460a7c,null))[_0xd06f('0x46')](function(_0x2a88d1){if(_0x2a88d1){_0x5bb0f8[_0xd06f('0x4f')][_0xd06f('0x5d')]=_0x2a88d1['id'];return db[_0xd06f('0x52')]['create'](_0x5bb0f8[_0xd06f('0x4f')]);}})['then'](respondWithResult(_0x460a7c,null))[_0xd06f('0x4d')](handleError(_0x460a7c,null));};exports[_0xd06f('0x5e')]=function(_0x39945e,_0x92f227,_0xa44cfb){var _0x5e6467={};var _0x506cff={};var _0x374faf;var _0x5733eb;return db['ChatGroup'][_0xd06f('0x58')]({'where':{'id':_0x39945e[_0xd06f('0x4b')]['id']}})['then'](handleEntityNotFound(_0x92f227,null))[_0xd06f('0x46')](function(_0x310bec){if(_0x310bec){_0x374faf=_0x310bec;_0x506cff[_0xd06f('0x33')]=_[_0xd06f('0x36')](db[_0xd06f('0x52')][_0xd06f('0x5f')]);_0x506cff[_0xd06f('0x35')]=_['keys'](_0x39945e['query']);_0x506cff[_0xd06f('0x37')]=_[_0xd06f('0x38')](_0x506cff['model'],_0x506cff[_0xd06f('0x35')]);_0x5e6467[_0xd06f('0x39')]=_[_0xd06f('0x38')](_0x506cff[_0xd06f('0x33')],qs[_0xd06f('0x3a')](_0x39945e[_0xd06f('0x35')][_0xd06f('0x3a')]));_0x5e6467[_0xd06f('0x39')]=_0x5e6467[_0xd06f('0x39')][_0xd06f('0x3b')]?_0x5e6467[_0xd06f('0x39')]:_0x506cff[_0xd06f('0x33')];_0x5e6467[_0xd06f('0x3e')]=qs[_0xd06f('0x3f')](_0x39945e[_0xd06f('0x35')][_0xd06f('0x3f')]);_0x5e6467[_0xd06f('0x40')]=qs[_0xd06f('0x37')](_['pick'](_0x39945e[_0xd06f('0x35')],_0x506cff[_0xd06f('0x37')]));if(_0x39945e[_0xd06f('0x35')][_0xd06f('0x41')]){_0x5e6467[_0xd06f('0x40')]=_[_0xd06f('0x42')](_0x5e6467[_0xd06f('0x40')],{'$or':_[_0xd06f('0x31')](_0x5e6467[_0xd06f('0x39')],function(_0x3cddc5){var _0x464bc2={};_0x464bc2[_0x3cddc5]={'$like':'%'+_0x39945e['query'][_0xd06f('0x41')]+'%'};return _0x464bc2;})});}if(_0x39945e[_0xd06f('0x35')]['$gte']){var _0x33a500=_0x39945e[_0xd06f('0x35')][_0xd06f('0x60')][_0xd06f('0x61')](',');var _0x226104={};_0x226104[_0x33a500[0x0]]={'$gte':moment(_0x33a500[0x1])[_0xd06f('0x62')](_0xd06f('0x63'))};_0x5e6467['where']=_[_0xd06f('0x42')](_0x5e6467[_0xd06f('0x40')],_0x226104);}_0x5e6467=_[_0xd06f('0x42')]({},_0x5e6467,_0x39945e['options']);return _0x374faf[_0xd06f('0x5e')](_0x5e6467);}})[_0xd06f('0x46')](function(_0x28c203){if(_0x28c203){_0x5733eb=_0x28c203[_0xd06f('0x3b')];if(!_0x39945e['query'][_0xd06f('0x3c')]('nolimit')){_0x5e6467[_0xd06f('0x23')]=qs[_0xd06f('0x23')](_0x39945e['query'][_0xd06f('0x23')]);_0x5e6467[_0xd06f('0x25')]=qs[_0xd06f('0x25')](_0x39945e[_0xd06f('0x35')][_0xd06f('0x25')]);}return _0x374faf['getMessages'](_0x5e6467);}})[_0xd06f('0x46')](function(_0x51dad9){if(_0x51dad9){return _0x51dad9?{'count':_0x5733eb,'rows':_0x51dad9}:null;}})[_0xd06f('0x46')](respondWithResult(_0x92f227,null))[_0xd06f('0x4d')](handleError(_0x92f227,null));};
\ No newline at end of file
+var _0x5587=['getMembers','findOne','User','rawAttributes','removeMembers','addMessage','ChatGroupId','getMessages','$gte','split','format','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path','to-csv','squel','crypto','jsforce','desk.js','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','defaults','redis','localhost','socket.io-emitter','./chatGroup.socket','register','sendStatus','status','json','offset','limit','undefined','set','Content-Range','apply','reject','update','then','destroy','end','error','stack','name','send','index','map','key','query','keys','filters','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','ChatGroup','count','includeAll','include','findAll','rows','show','params','find','create','body','catch','describe','ChatInternalMessage','user','toInteger','addMembers','ids','omit'];(function(_0xd73884,_0x2ca96d){var _0x16b79c=function(_0x1521bc){while(--_0x1521bc){_0xd73884['push'](_0xd73884['shift']());}};_0x16b79c(++_0x2ca96d);}(_0x5587,0x6e));var _0x7558=function(_0x5d6c6e,_0x6d7dd0){_0x5d6c6e=_0x5d6c6e-0x0;var _0x1afcb0=_0x5587[_0x5d6c6e];return _0x1afcb0;};'use strict';var emlformat=require(_0x7558('0x0'));var rimraf=require(_0x7558('0x1'));var zipdir=require(_0x7558('0x2'));var jsonpatch=require(_0x7558('0x3'));var rp=require(_0x7558('0x4'));var moment=require(_0x7558('0x5'));var BPromise=require(_0x7558('0x6'));var Mustache=require(_0x7558('0x7'));var util=require('util');var path=require(_0x7558('0x8'));var sox=require('sox');var csv=require(_0x7558('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0x7558('0xa'));var crypto=require(_0x7558('0xb'));var jsforce=require(_0x7558('0xc'));var deskjs=require(_0x7558('0xd'));var toCsv=require(_0x7558('0x9'));var querystring=require('querystring');var Papa=require(_0x7558('0xe'));var Redis=require('ioredis');var authService=require(_0x7558('0xf'));var qs=require(_0x7558('0x10'));var as=require(_0x7558('0x11'));var hardwareService=require(_0x7558('0x12'));var logger=require(_0x7558('0x13'))(_0x7558('0x14'));var utils=require(_0x7558('0x15'));var config=require(_0x7558('0x16'));var licenseUtil=require('../../config/license/util');var db=require(_0x7558('0x17'))['db'];config['redis']=_[_0x7558('0x18')](config[_0x7558('0x19')],{'host':_0x7558('0x1a'),'port':0x18eb});var socket=require(_0x7558('0x1b'))(new Redis(config[_0x7558('0x19')]));require(_0x7558('0x1c'))[_0x7558('0x1d')](socket);function respondWithStatusCode(_0x5a616c,_0x3ced8f){_0x3ced8f=_0x3ced8f||0xcc;return function(_0x4f4463){if(_0x4f4463){return _0x5a616c[_0x7558('0x1e')](_0x3ced8f);}return _0x5a616c[_0x7558('0x1f')](_0x3ced8f)['end']();};}function respondWithResult(_0x505eb6,_0x5b4e49){_0x5b4e49=_0x5b4e49||0xc8;return function(_0x43fee8){if(_0x43fee8){return _0x505eb6[_0x7558('0x1f')](_0x5b4e49)[_0x7558('0x20')](_0x43fee8);}};}function respondWithFilteredResult(_0x5a02fe,_0x208ee5){return function(_0x2f00e5){if(_0x2f00e5){var _0x39df8b=typeof _0x208ee5[_0x7558('0x21')]==='undefined'&&typeof _0x208ee5[_0x7558('0x22')]===_0x7558('0x23');var _0x4a2ba7=_0x2f00e5['count'];var _0x44a64d=_0x39df8b?0x0:_0x208ee5['offset'];var _0x225fc4=_0x39df8b?_0x2f00e5['count']:_0x208ee5[_0x7558('0x21')]+_0x208ee5[_0x7558('0x22')];var _0x1999f7;if(_0x225fc4>=_0x4a2ba7){_0x225fc4=_0x4a2ba7;_0x1999f7=0xc8;}else{_0x1999f7=0xce;}_0x5a02fe[_0x7558('0x1f')](_0x1999f7);return _0x5a02fe[_0x7558('0x24')](_0x7558('0x25'),_0x44a64d+'-'+_0x225fc4+'/'+_0x4a2ba7)['json'](_0x2f00e5);}return null;};}function patchUpdates(_0x6677f5){return function(_0x2e41bb){try{jsonpatch[_0x7558('0x26')](_0x2e41bb,_0x6677f5,!![]);}catch(_0x30c60a){return BPromise[_0x7558('0x27')](_0x30c60a);}return _0x2e41bb['save']();};}function saveUpdates(_0x928046,_0x558234){return function(_0x595919){if(_0x595919){return _0x595919[_0x7558('0x28')](_0x928046)[_0x7558('0x29')](function(_0x29fece){return _0x29fece;});}return null;};}function removeEntity(_0x8478bb,_0x3f9f7d){return function(_0x4ef423){if(_0x4ef423){return _0x4ef423[_0x7558('0x2a')]()[_0x7558('0x29')](function(){_0x8478bb['status'](0xcc)[_0x7558('0x2b')]();});}};}function handleEntityNotFound(_0x419842,_0xb60f25){return function(_0x4b7549){if(!_0x4b7549){_0x419842[_0x7558('0x1e')](0x194);}return _0x4b7549;};}function handleError(_0x1861ce,_0x2cfee6){_0x2cfee6=_0x2cfee6||0x1f4;return function(_0x115c4){logger[_0x7558('0x2c')](_0x115c4[_0x7558('0x2d')]);if(_0x115c4[_0x7558('0x2e')]){delete _0x115c4[_0x7558('0x2e')];}_0x1861ce['status'](_0x2cfee6)[_0x7558('0x2f')](_0x115c4);};}exports[_0x7558('0x30')]=function(_0x558940,_0x52c48b){var _0x6f8523={},_0x596351={},_0x588bf4={'count':0x0,'rows':[]};var _0xeb1b87=_[_0x7558('0x31')](db['ChatGroup']['rawAttributes'],function(_0x1a4bcc){return{'name':_0x1a4bcc['fieldName'],'type':_0x1a4bcc['type'][_0x7558('0x32')]};});_0x596351['model']=_[_0x7558('0x31')](_0xeb1b87,_0x7558('0x2e'));_0x596351[_0x7558('0x33')]=_[_0x7558('0x34')](_0x558940[_0x7558('0x33')]);_0x596351[_0x7558('0x35')]=_[_0x7558('0x36')](_0x596351[_0x7558('0x37')],_0x596351[_0x7558('0x33')]);_0x6f8523[_0x7558('0x38')]=_['intersection'](_0x596351['model'],qs[_0x7558('0x39')](_0x558940['query'][_0x7558('0x39')]));_0x6f8523[_0x7558('0x38')]=_0x6f8523[_0x7558('0x38')][_0x7558('0x3a')]?_0x6f8523['attributes']:_0x596351[_0x7558('0x37')];if(!_0x558940[_0x7558('0x33')][_0x7558('0x3b')](_0x7558('0x3c'))){_0x6f8523[_0x7558('0x22')]=qs['limit'](_0x558940[_0x7558('0x33')][_0x7558('0x22')]);_0x6f8523[_0x7558('0x21')]=qs[_0x7558('0x21')](_0x558940[_0x7558('0x33')][_0x7558('0x21')]);}_0x6f8523[_0x7558('0x3d')]=qs[_0x7558('0x3e')](_0x558940[_0x7558('0x33')]['sort']);_0x6f8523[_0x7558('0x3f')]=qs['filters'](_[_0x7558('0x40')](_0x558940['query'],_0x596351['filters']),_0xeb1b87);if(_0x558940[_0x7558('0x33')][_0x7558('0x41')]){_0x6f8523[_0x7558('0x3f')]=_[_0x7558('0x42')](_0x6f8523[_0x7558('0x3f')],{'$or':_['map'](_0xeb1b87,function(_0x2ef4d7){if(_0x2ef4d7['type']!==_0x7558('0x43')){var _0x26fde0={};_0x26fde0[_0x2ef4d7['name']]={'$like':'%'+_0x558940[_0x7558('0x33')][_0x7558('0x41')]+'%'};return _0x26fde0;}})});}_0x6f8523=_[_0x7558('0x42')]({},_0x6f8523,_0x558940[_0x7558('0x44')]);var _0x4b27a8={'where':_0x6f8523[_0x7558('0x3f')]};return db[_0x7558('0x45')][_0x7558('0x46')](_0x4b27a8)['then'](function(_0x11f4d0){_0x588bf4['count']=_0x11f4d0;if(_0x558940[_0x7558('0x33')][_0x7558('0x47')]){_0x6f8523[_0x7558('0x48')]=[{'all':!![]}];}return db['ChatGroup'][_0x7558('0x49')](_0x6f8523);})['then'](function(_0x26570d){_0x588bf4[_0x7558('0x4a')]=_0x26570d;return _0x588bf4;})[_0x7558('0x29')](respondWithFilteredResult(_0x52c48b,_0x6f8523))['catch'](handleError(_0x52c48b,null));};exports[_0x7558('0x4b')]=function(_0x89e2,_0x244862){var _0x1f6ba9={'raw':!![],'where':{'id':_0x89e2[_0x7558('0x4c')]['id']}},_0x2bbc89={};_0x2bbc89[_0x7558('0x37')]=_[_0x7558('0x34')](db[_0x7558('0x45')]['rawAttributes']);_0x2bbc89[_0x7558('0x33')]=_[_0x7558('0x34')](_0x89e2[_0x7558('0x33')]);_0x2bbc89['filters']=_['intersection'](_0x2bbc89[_0x7558('0x37')],_0x2bbc89[_0x7558('0x33')]);_0x1f6ba9['attributes']=_['intersection'](_0x2bbc89[_0x7558('0x37')],qs[_0x7558('0x39')](_0x89e2[_0x7558('0x33')]['fields']));_0x1f6ba9['attributes']=_0x1f6ba9[_0x7558('0x38')][_0x7558('0x3a')]?_0x1f6ba9[_0x7558('0x38')]:_0x2bbc89['model'];if(_0x89e2['query']['includeAll']){_0x1f6ba9[_0x7558('0x48')]=[{'all':!![]}];}_0x1f6ba9=_['merge']({},_0x1f6ba9,_0x89e2['options']);return db[_0x7558('0x45')][_0x7558('0x4d')](_0x1f6ba9)[_0x7558('0x29')](handleEntityNotFound(_0x244862,null))[_0x7558('0x29')](respondWithResult(_0x244862,null))['catch'](handleError(_0x244862,null));};exports[_0x7558('0x4e')]=function(_0x248306,_0x129a7e){return db[_0x7558('0x45')][_0x7558('0x4e')](_0x248306[_0x7558('0x4f')],{})[_0x7558('0x29')](respondWithResult(_0x129a7e,0xc9))[_0x7558('0x50')](handleError(_0x129a7e,null));};exports[_0x7558('0x28')]=function(_0x1504d6,_0x30851c){if(_0x1504d6[_0x7558('0x4f')]['id']){delete _0x1504d6[_0x7558('0x4f')]['id'];}return db[_0x7558('0x45')][_0x7558('0x4d')]({'where':{'id':_0x1504d6[_0x7558('0x4c')]['id']}})[_0x7558('0x29')](handleEntityNotFound(_0x30851c,null))[_0x7558('0x29')](saveUpdates(_0x1504d6['body'],null))[_0x7558('0x29')](respondWithResult(_0x30851c,null))[_0x7558('0x50')](handleError(_0x30851c,null));};exports[_0x7558('0x2a')]=function(_0x44043d,_0x5827f4){return db[_0x7558('0x45')][_0x7558('0x4d')]({'where':{'id':_0x44043d[_0x7558('0x4c')]['id']}})[_0x7558('0x29')](handleEntityNotFound(_0x5827f4,null))[_0x7558('0x29')](removeEntity(_0x5827f4,null))[_0x7558('0x50')](handleError(_0x5827f4,null));};exports[_0x7558('0x51')]=function(_0x2c4511,_0x42ca74){return db[_0x7558('0x45')][_0x7558('0x51')]()[_0x7558('0x29')](respondWithResult(_0x42ca74,null))[_0x7558('0x50')](handleError(_0x42ca74,null));};exports['getUnread']=function(_0x355249,_0x45700b,_0x14551c){return db[_0x7558('0x52')]['count']({'where':{'ChatGroupId':_0x355249[_0x7558('0x4c')]['id'],'ToId':_0x355249[_0x7558('0x53')]['id'],'read':![]}})[_0x7558('0x29')](function(_0x5ef917){return{'id':_[_0x7558('0x54')](_0x355249[_0x7558('0x4c')]['id']),'count':_0x5ef917};})[_0x7558('0x29')](respondWithResult(_0x45700b,null))[_0x7558('0x50')](handleError(_0x45700b,null));};exports['addMembers']=function(_0x32c7a5,_0x18f934,_0x5e8275){return db[_0x7558('0x45')]['find']({'where':{'id':_0x32c7a5[_0x7558('0x4c')]['id']}})[_0x7558('0x29')](handleEntityNotFound(_0x18f934,null))[_0x7558('0x29')](function(_0x5481e9){if(_0x5481e9){return _0x5481e9[_0x7558('0x55')](_0x32c7a5[_0x7558('0x4f')][_0x7558('0x56')],_[_0x7558('0x57')](_0x32c7a5[_0x7558('0x4f')],[_0x7558('0x56'),'id'])||{});}})[_0x7558('0x29')](respondWithResult(_0x18f934,null))['catch'](handleError(_0x18f934,null));};exports[_0x7558('0x58')]=function(_0x2e540a,_0x325737,_0x3c3381){var _0x243bc1={};var _0x53444a={};var _0xf5a3ba;var _0x309fae;return db['ChatGroup'][_0x7558('0x59')]({'where':{'id':_0x2e540a[_0x7558('0x4c')]['id']}})[_0x7558('0x29')](handleEntityNotFound(_0x325737,null))[_0x7558('0x29')](function(_0x3571f2){if(_0x3571f2){_0xf5a3ba=_0x3571f2;_0x53444a[_0x7558('0x37')]=_['keys'](db[_0x7558('0x5a')][_0x7558('0x5b')]);_0x53444a['query']=_['keys'](_0x2e540a[_0x7558('0x33')]);_0x53444a[_0x7558('0x35')]=_['intersection'](_0x53444a[_0x7558('0x37')],_0x53444a['query']);_0x243bc1[_0x7558('0x38')]=_['intersection'](_0x53444a[_0x7558('0x37')],qs['fields'](_0x2e540a[_0x7558('0x33')]['fields']));_0x243bc1[_0x7558('0x38')]=_0x243bc1['attributes'][_0x7558('0x3a')]?_0x243bc1[_0x7558('0x38')]:_0x53444a[_0x7558('0x37')];_0x243bc1[_0x7558('0x3d')]=qs['sort'](_0x2e540a[_0x7558('0x33')][_0x7558('0x3e')]);_0x243bc1[_0x7558('0x3f')]=qs['filters'](_[_0x7558('0x40')](_0x2e540a[_0x7558('0x33')],_0x53444a[_0x7558('0x35')]));if(_0x2e540a[_0x7558('0x33')][_0x7558('0x41')]){_0x243bc1['where']=_[_0x7558('0x42')](_0x243bc1['where'],{'$or':_['map'](_0x243bc1[_0x7558('0x38')],function(_0x26288c){var _0x4a454b={};_0x4a454b[_0x26288c]={'$like':'%'+_0x2e540a[_0x7558('0x33')][_0x7558('0x41')]+'%'};return _0x4a454b;})});}_0x243bc1=_[_0x7558('0x42')]({},_0x243bc1,_0x2e540a['options']);return _0xf5a3ba[_0x7558('0x58')](_0x243bc1);}})[_0x7558('0x29')](function(_0x5660c7){if(_0x5660c7){_0x309fae=_0x5660c7[_0x7558('0x3a')];if(!_0x2e540a[_0x7558('0x33')][_0x7558('0x3b')](_0x7558('0x3c'))){_0x243bc1[_0x7558('0x22')]=qs[_0x7558('0x22')](_0x2e540a[_0x7558('0x33')][_0x7558('0x22')]);_0x243bc1[_0x7558('0x21')]=qs['offset'](_0x2e540a[_0x7558('0x33')][_0x7558('0x21')]);}return _0xf5a3ba[_0x7558('0x58')](_0x243bc1);}})[_0x7558('0x29')](function(_0xf268cb){if(_0xf268cb){return _0xf268cb?{'count':_0x309fae,'rows':_0xf268cb}:null;}})[_0x7558('0x29')](respondWithResult(_0x325737,null))[_0x7558('0x50')](handleError(_0x325737,null));};exports[_0x7558('0x5c')]=function(_0x19dec0,_0x5989d4,_0xc08830){return db[_0x7558('0x45')][_0x7558('0x4d')]({'where':{'id':_0x19dec0[_0x7558('0x4c')]['id']}})[_0x7558('0x29')](handleEntityNotFound(_0x5989d4,null))[_0x7558('0x29')](function(_0x12fedc){if(_0x12fedc){return _0x12fedc['removeMembers'](_0x19dec0[_0x7558('0x33')]['ids']);}})[_0x7558('0x29')](respondWithStatusCode(_0x5989d4,null))[_0x7558('0x50')](handleError(_0x5989d4,null));};exports[_0x7558('0x5d')]=function(_0x2e3f41,_0x425227,_0x200469){if(_0x2e3f41[_0x7558('0x4f')]['id']){delete _0x2e3f41['body']['id'];}return db[_0x7558('0x45')][_0x7558('0x4d')]({'where':{'id':_0x2e3f41[_0x7558('0x4c')]['id']}})[_0x7558('0x29')](handleEntityNotFound(_0x425227,null))['then'](function(_0x457626){if(_0x457626){_0x2e3f41[_0x7558('0x4f')][_0x7558('0x5e')]=_0x457626['id'];return db[_0x7558('0x52')][_0x7558('0x4e')](_0x2e3f41[_0x7558('0x4f')]);}})[_0x7558('0x29')](respondWithResult(_0x425227,null))[_0x7558('0x50')](handleError(_0x425227,null));};exports[_0x7558('0x5f')]=function(_0x549417,_0x11c7b2,_0x4412db){var _0x4a458c={};var _0x68aabf={};var _0x11192a;var _0x660182;return db[_0x7558('0x45')][_0x7558('0x59')]({'where':{'id':_0x549417[_0x7558('0x4c')]['id']}})[_0x7558('0x29')](handleEntityNotFound(_0x11c7b2,null))[_0x7558('0x29')](function(_0x5566f9){if(_0x5566f9){_0x11192a=_0x5566f9;_0x68aabf[_0x7558('0x37')]=_[_0x7558('0x34')](db[_0x7558('0x52')]['rawAttributes']);_0x68aabf['query']=_[_0x7558('0x34')](_0x549417[_0x7558('0x33')]);_0x68aabf[_0x7558('0x35')]=_['intersection'](_0x68aabf[_0x7558('0x37')],_0x68aabf[_0x7558('0x33')]);_0x4a458c[_0x7558('0x38')]=_['intersection'](_0x68aabf[_0x7558('0x37')],qs[_0x7558('0x39')](_0x549417[_0x7558('0x33')][_0x7558('0x39')]));_0x4a458c['attributes']=_0x4a458c[_0x7558('0x38')][_0x7558('0x3a')]?_0x4a458c['attributes']:_0x68aabf[_0x7558('0x37')];_0x4a458c['order']=qs[_0x7558('0x3e')](_0x549417['query'][_0x7558('0x3e')]);_0x4a458c[_0x7558('0x3f')]=qs[_0x7558('0x35')](_[_0x7558('0x40')](_0x549417[_0x7558('0x33')],_0x68aabf[_0x7558('0x35')]));if(_0x549417[_0x7558('0x33')][_0x7558('0x41')]){_0x4a458c[_0x7558('0x3f')]=_[_0x7558('0x42')](_0x4a458c[_0x7558('0x3f')],{'$or':_[_0x7558('0x31')](_0x4a458c['attributes'],function(_0x5eec25){var _0x278f8e={};_0x278f8e[_0x5eec25]={'$like':'%'+_0x549417[_0x7558('0x33')][_0x7558('0x41')]+'%'};return _0x278f8e;})});}if(_0x549417[_0x7558('0x33')][_0x7558('0x60')]){var _0x387179=_0x549417[_0x7558('0x33')][_0x7558('0x60')][_0x7558('0x61')](',');var _0x2413b0={};_0x2413b0[_0x387179[0x0]]={'$gte':moment(_0x387179[0x1])[_0x7558('0x62')]('YYYY-MM-DD\x20HH:mm:ss')};_0x4a458c['where']=_[_0x7558('0x42')](_0x4a458c['where'],_0x2413b0);}_0x4a458c=_[_0x7558('0x42')]({},_0x4a458c,_0x549417[_0x7558('0x44')]);return _0x11192a[_0x7558('0x5f')](_0x4a458c);}})[_0x7558('0x29')](function(_0x3d3d33){if(_0x3d3d33){_0x660182=_0x3d3d33[_0x7558('0x3a')];if(!_0x549417[_0x7558('0x33')][_0x7558('0x3b')]('nolimit')){_0x4a458c[_0x7558('0x22')]=qs[_0x7558('0x22')](_0x549417['query'][_0x7558('0x22')]);_0x4a458c['offset']=qs[_0x7558('0x21')](_0x549417[_0x7558('0x33')][_0x7558('0x21')]);}return _0x11192a[_0x7558('0x5f')](_0x4a458c);}})[_0x7558('0x29')](function(_0x12cb2e){if(_0x12cb2e){return _0x12cb2e?{'count':_0x660182,'rows':_0x12cb2e}:null;}})['then'](respondWithResult(_0x11c7b2,null))[_0x7558('0x50')](handleError(_0x11c7b2,null));};
\ No newline at end of file
diff --git a/server/api/chatGroup/chatGroup.events.js b/server/api/chatGroup/chatGroup.events.js
index c61304d..11d5443 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 _0x7d8d=['hook','exports','events','../../mysqldb','ChatGroup','save','remove','emit','hasOwnProperty'];(function(_0x38c102,_0x48cd17){var _0x14ad4a=function(_0x399e29){while(--_0x399e29){_0x38c102['push'](_0x38c102['shift']());}};_0x14ad4a(++_0x48cd17);}(_0x7d8d,0x134));var _0xd7d8=function(_0x34736e,_0x37b8ae){_0x34736e=_0x34736e-0x0;var _0x4df4e7=_0x7d8d[_0x34736e];return _0x4df4e7;};'use strict';var EventEmitter=require(_0xd7d8('0x0'));var ChatGroup=require(_0xd7d8('0x1'))['db'][_0xd7d8('0x2')];var ChatGroupEvents=new EventEmitter();ChatGroupEvents['setMaxListeners'](0x0);var events={'afterCreate':_0xd7d8('0x3'),'afterUpdate':'update','afterDestroy':_0xd7d8('0x4')};function emitEvent(_0x12de2f){return function(_0xb37a2b,_0x443200,_0x4a2da3){ChatGroupEvents[_0xd7d8('0x5')](_0x12de2f+':'+_0xb37a2b['id'],_0xb37a2b);ChatGroupEvents[_0xd7d8('0x5')](_0x12de2f,_0xb37a2b);_0x4a2da3(null);};}for(var e in events){if(events[_0xd7d8('0x6')](e)){var event=events[e];ChatGroup[_0xd7d8('0x7')](e,emitEvent(event));}}module[_0xd7d8('0x8')]=ChatGroupEvents;
\ No newline at end of file
+var _0xf23e=['emit','hasOwnProperty','hook','events','../../mysqldb','setMaxListeners','save','update','remove'];(function(_0x17b2ab,_0x43a8dd){var _0x242a20=function(_0x3f0fe1){while(--_0x3f0fe1){_0x17b2ab['push'](_0x17b2ab['shift']());}};_0x242a20(++_0x43a8dd);}(_0xf23e,0xd2));var _0xef23=function(_0x1a72f3,_0x217011){_0x1a72f3=_0x1a72f3-0x0;var _0x57ef47=_0xf23e[_0x1a72f3];return _0x57ef47;};'use strict';var EventEmitter=require(_0xef23('0x0'));var ChatGroup=require(_0xef23('0x1'))['db']['ChatGroup'];var ChatGroupEvents=new EventEmitter();ChatGroupEvents[_0xef23('0x2')](0x0);var events={'afterCreate':_0xef23('0x3'),'afterUpdate':_0xef23('0x4'),'afterDestroy':_0xef23('0x5')};function emitEvent(_0x48a4e6){return function(_0x4a747a,_0x3a8cb1,_0x36c0c5){ChatGroupEvents[_0xef23('0x6')](_0x48a4e6+':'+_0x4a747a['id'],_0x4a747a);ChatGroupEvents[_0xef23('0x6')](_0x48a4e6,_0x4a747a);_0x36c0c5(null);};}for(var e in events){if(events[_0xef23('0x7')](e)){var event=events[e];ChatGroup[_0xef23('0x8')](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 d44c8d6..990f075 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 _0x4a10=['lodash','../../config/logger','api','moment','bluebird','path','./chatGroup.attributes','exports','define','chat_groups'];(function(_0x3f1f0f,_0x1e5798){var _0x4e467a=function(_0x219446){while(--_0x219446){_0x3f1f0f['push'](_0x3f1f0f['shift']());}};_0x4e467a(++_0x1e5798);}(_0x4a10,0xc8));var _0x04a1=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0x4a10[_0x321bb2];return _0x9c12ed;};'use strict';var _=require(_0x04a1('0x0'));var util=require('util');var logger=require(_0x04a1('0x1'))(_0x04a1('0x2'));var moment=require(_0x04a1('0x3'));var BPromise=require(_0x04a1('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x04a1('0x5'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x04a1('0x6'));module[_0x04a1('0x7')]=function(_0x108f55,_0x329991){return _0x108f55[_0x04a1('0x8')]('ChatGroup',attributes,{'tableName':_0x04a1('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xcc95=['bluebird','request-promise','path','rimraf','../../config/environment','exports','define','ChatGroup','chat_groups','util','../../config/logger','api','moment'];(function(_0x59ed8c,_0x497c0f){var _0x2ae760=function(_0x5e0c08){while(--_0x5e0c08){_0x59ed8c['push'](_0x59ed8c['shift']());}};_0x2ae760(++_0x497c0f);}(_0xcc95,0x10d));var _0x5cc9=function(_0x4b174a,_0x33a017){_0x4b174a=_0x4b174a-0x0;var _0x3cd7bf=_0xcc95[_0x4b174a];return _0x3cd7bf;};'use strict';var _=require('lodash');var util=require(_0x5cc9('0x0'));var logger=require(_0x5cc9('0x1'))(_0x5cc9('0x2'));var moment=require(_0x5cc9('0x3'));var BPromise=require(_0x5cc9('0x4'));var rp=require(_0x5cc9('0x5'));var fs=require('fs');var path=require(_0x5cc9('0x6'));var rimraf=require(_0x5cc9('0x7'));var config=require(_0x5cc9('0x8'));var attributes=require('./chatGroup.attributes');module[_0x5cc9('0x9')]=function(_0x3a5e73,_0x34068b){return _0x3a5e73[_0x5cc9('0xa')](_0x5cc9('0xb'),attributes,{'tableName':_0x5cc9('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 f5c42bd..1e1f043 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 _0x6737=['info','ChatGroup,\x20%s,\x20%s','request\x20sent','debug','ChatGroup,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','client','http','socket.io-emitter','./chatGroup.socket','register','then'];(function(_0x34986e,_0x12f718){var _0x115ef9=function(_0x519bd6){while(--_0x519bd6){_0x34986e['push'](_0x34986e['shift']());}};_0x115ef9(++_0x12f718);}(_0x6737,0xe2));var _0x7673=function(_0xc866fc,_0x203d1b){_0xc866fc=_0xc866fc-0x0;var _0x55bfbe=_0x6737[_0xc866fc];return _0x55bfbe;};'use strict';var _=require('lodash');var util=require(_0x7673('0x0'));var moment=require(_0x7673('0x1'));var BPromise=require('bluebird');var rs=require(_0x7673('0x2'));var fs=require('fs');var Redis=require(_0x7673('0x3'));var db=require(_0x7673('0x4'))['db'];var utils=require(_0x7673('0x5'));var logger=require('../../config/logger')(_0x7673('0x6'));var config=require(_0x7673('0x7'));var jayson=require('jayson/promise');var client=jayson[_0x7673('0x8')][_0x7673('0x9')]({'port':0x232a});config['redis']=_['defaults'](config['redis'],{'host':'localhost','port':0x18eb});var socket=require(_0x7673('0xa'))(new Redis(config['redis']));require(_0x7673('0xb'))[_0x7673('0xc')](socket);function respondWithRpcPromise(_0x5bfae2,_0x29fdbc,_0x331f57){return new BPromise(function(_0x35c1b3,_0x4d40ce){return client['request'](_0x5bfae2,_0x331f57)[_0x7673('0xd')](function(_0x571b87){logger[_0x7673('0xe')](_0x7673('0xf'),_0x29fdbc,_0x7673('0x10'));logger[_0x7673('0x11')](_0x7673('0x12'),_0x29fdbc,_0x7673('0x10'),JSON[_0x7673('0x13')](_0x571b87));if(_0x571b87[_0x7673('0x14')]){if(_0x571b87[_0x7673('0x14')][_0x7673('0x15')]===0x1f4){logger['error'](_0x7673('0xf'),_0x29fdbc,_0x571b87[_0x7673('0x14')][_0x7673('0x16')]);return _0x4d40ce(_0x571b87[_0x7673('0x14')][_0x7673('0x16')]);}logger[_0x7673('0x14')](_0x7673('0xf'),_0x29fdbc,_0x571b87['error']['message']);return _0x35c1b3(_0x571b87[_0x7673('0x14')][_0x7673('0x16')]);}else{logger['info'](_0x7673('0xf'),_0x29fdbc,_0x7673('0x10'));_0x35c1b3(_0x571b87['result'][_0x7673('0x16')]);}})[_0x7673('0x17')](function(_0x1015ba){logger['error']('ChatGroup,\x20%s,\x20%s',_0x29fdbc,_0x1015ba);_0x4d40ce(_0x1015ba);});});}
\ No newline at end of file
+var _0xaa19=['ioredis','../../config/utils','rpc','../../config/environment','jayson/promise','http','redis','defaults','localhost','./chatGroup.socket','register','then','request\x20sent','debug','stringify','error','message','ChatGroup,\x20%s,\x20%s','info','result','catch','lodash','util','moment','bluebird'];(function(_0x243b2f,_0x30aa15){var _0xcb3c2d=function(_0x213bb2){while(--_0x213bb2){_0x243b2f['push'](_0x243b2f['shift']());}};_0xcb3c2d(++_0x30aa15);}(_0xaa19,0x79));var _0x9aa1=function(_0x2ed115,_0x5877d6){_0x2ed115=_0x2ed115-0x0;var _0x73d26f=_0xaa19[_0x2ed115];return _0x73d26f;};'use strict';var _=require(_0x9aa1('0x0'));var util=require(_0x9aa1('0x1'));var moment=require(_0x9aa1('0x2'));var BPromise=require(_0x9aa1('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x9aa1('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x9aa1('0x5'));var logger=require('../../config/logger')(_0x9aa1('0x6'));var config=require(_0x9aa1('0x7'));var jayson=require(_0x9aa1('0x8'));var client=jayson['client'][_0x9aa1('0x9')]({'port':0x232a});config[_0x9aa1('0xa')]=_[_0x9aa1('0xb')](config['redis'],{'host':_0x9aa1('0xc'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0x9aa1('0xd'))[_0x9aa1('0xe')](socket);function respondWithRpcPromise(_0x458c96,_0x3cd39b,_0x48448b){return new BPromise(function(_0x5e76cc,_0x1c31c3){return client['request'](_0x458c96,_0x48448b)[_0x9aa1('0xf')](function(_0x4b3352){logger['info']('ChatGroup,\x20%s,\x20%s',_0x3cd39b,_0x9aa1('0x10'));logger[_0x9aa1('0x11')]('ChatGroup,\x20%s,\x20%s,\x20%s',_0x3cd39b,_0x9aa1('0x10'),JSON[_0x9aa1('0x12')](_0x4b3352));if(_0x4b3352[_0x9aa1('0x13')]){if(_0x4b3352['error']['code']===0x1f4){logger[_0x9aa1('0x13')]('ChatGroup,\x20%s,\x20%s',_0x3cd39b,_0x4b3352[_0x9aa1('0x13')]['message']);return _0x1c31c3(_0x4b3352[_0x9aa1('0x13')][_0x9aa1('0x14')]);}logger[_0x9aa1('0x13')](_0x9aa1('0x15'),_0x3cd39b,_0x4b3352['error']['message']);return _0x5e76cc(_0x4b3352[_0x9aa1('0x13')][_0x9aa1('0x14')]);}else{logger[_0x9aa1('0x16')](_0x9aa1('0x15'),_0x3cd39b,_0x9aa1('0x10'));_0x5e76cc(_0x4b3352[_0x9aa1('0x17')][_0x9aa1('0x14')]);}})[_0x9aa1('0x18')](function(_0x356201){logger[_0x9aa1('0x13')](_0x9aa1('0x15'),_0x3cd39b,_0x356201);_0x1c31c3(_0x356201);});});}
\ No newline at end of file
diff --git a/server/api/chatGroup/chatGroup.socket.js b/server/api/chatGroup/chatGroup.socket.js
index cfccaa1..cd357b1 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 _0x148a=['length','./chatGroup.events','removeListener','register'];(function(_0x28dbf0,_0x99c79b){var _0x45bc21=function(_0x1def22){while(--_0x1def22){_0x28dbf0['push'](_0x28dbf0['shift']());}};_0x45bc21(++_0x99c79b);}(_0x148a,0x91));var _0xa148=function(_0x2aaf51,_0x2dbb49){_0x2aaf51=_0x2aaf51-0x0;var _0xbafd19=_0x148a[_0x2aaf51];return _0xbafd19;};'use strict';var ChatGroupEvents=require(_0xa148('0x0'));var events=['save','remove','update'];function createListener(_0xd3b940,_0x5af152){return function(_0x40667d){_0x5af152['emit'](_0xd3b940,_0x40667d);};}function removeListener(_0x2031b2,_0x2ab467){return function(){ChatGroupEvents[_0xa148('0x1')](_0x2031b2,_0x2ab467);};}exports[_0xa148('0x2')]=function(_0x590567){for(var _0x55cc93=0x0,_0xd6431a=events[_0xa148('0x3')];_0x55cc93<_0xd6431a;_0x55cc93++){var _0x5ea3d2=events[_0x55cc93];var _0x106997=createListener('chatGroup:'+_0x5ea3d2,_0x590567);ChatGroupEvents['on'](_0x5ea3d2,_0x106997);}};
\ No newline at end of file
+var _0x2422=['chatGroup:','./chatGroup.events','save','remove','update','emit'];(function(_0x47e7cb,_0x4c1b8d){var _0x2a8874=function(_0x36498f){while(--_0x36498f){_0x47e7cb['push'](_0x47e7cb['shift']());}};_0x2a8874(++_0x4c1b8d);}(_0x2422,0x18d));var _0x2242=function(_0x3b2044,_0x10a5a6){_0x3b2044=_0x3b2044-0x0;var _0x484ab8=_0x2422[_0x3b2044];return _0x484ab8;};'use strict';var ChatGroupEvents=require(_0x2242('0x0'));var events=[_0x2242('0x1'),_0x2242('0x2'),_0x2242('0x3')];function createListener(_0x18e70b,_0x4108e5){return function(_0x232623){_0x4108e5[_0x2242('0x4')](_0x18e70b,_0x232623);};}function removeListener(_0x2e29be,_0x1362d5){return function(){ChatGroupEvents['removeListener'](_0x2e29be,_0x1362d5);};}exports['register']=function(_0x23779f){for(var _0x3ac895=0x0,_0x452000=events['length'];_0x3ac895<_0x452000;_0x3ac895++){var _0xef89e6=events[_0x3ac895];var _0x4954d6=createListener(_0x2242('0x5')+_0xef89e6,_0x23779f);ChatGroupEvents['on'](_0xef89e6,_0x4954d6);}};
\ No newline at end of file
diff --git a/server/api/chatGroup/index.js b/server/api/chatGroup/index.js
index 7a27ac6..122e7dc 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 _0xd94d=['/:id/members','getMembers','/:id/messages','post','addMessage','put','/:id','update','delete','destroy','removeMembers','exports','util','path','express','../../components/interaction/service','../../config/environment','./chatGroup.controller','get','isAuthenticated','index','/describe','describe','/:id/unread','getUnread'];(function(_0x1a3cc7,_0x2900e3){var _0x338438=function(_0x5a4872){while(--_0x5a4872){_0x1a3cc7['push'](_0x1a3cc7['shift']());}};_0x338438(++_0x2900e3);}(_0xd94d,0x151));var _0xdd94=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xd94d[_0x3dd15e];return _0x231fd0;};'use strict';var multer=require('multer');var util=require(_0xdd94('0x0'));var path=require(_0xdd94('0x1'));var timeout=require('connect-timeout');var express=require(_0xdd94('0x2'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0xdd94('0x3'));var config=require(_0xdd94('0x4'));var controller=require(_0xdd94('0x5'));router[_0xdd94('0x6')]('/',auth[_0xdd94('0x7')](),controller[_0xdd94('0x8')]);router[_0xdd94('0x6')](_0xdd94('0x9'),auth[_0xdd94('0x7')](),controller[_0xdd94('0xa')]);router['get']('/:id',auth[_0xdd94('0x7')](),controller['show']);router['get'](_0xdd94('0xb'),auth[_0xdd94('0x7')](),controller[_0xdd94('0xc')]);router[_0xdd94('0x6')](_0xdd94('0xd'),auth[_0xdd94('0x7')](),controller[_0xdd94('0xe')]);router[_0xdd94('0x6')](_0xdd94('0xf'),auth[_0xdd94('0x7')](),controller['getMessages']);router['post']('/',auth['isAuthenticated'](),controller['create']);router[_0xdd94('0x10')](_0xdd94('0xd'),auth[_0xdd94('0x7')](),controller['addMembers']);router[_0xdd94('0x10')]('/:id/messages',auth['isAuthenticated'](),controller[_0xdd94('0x11')]);router[_0xdd94('0x12')](_0xdd94('0x13'),auth[_0xdd94('0x7')](),controller[_0xdd94('0x14')]);router[_0xdd94('0x15')](_0xdd94('0x13'),auth[_0xdd94('0x7')](),controller[_0xdd94('0x16')]);router[_0xdd94('0x15')](_0xdd94('0xd'),auth[_0xdd94('0x7')](),controller[_0xdd94('0x17')]);module[_0xdd94('0x18')]=router;
\ No newline at end of file
+var _0x08eb=['get','isAuthenticated','describe','/:id','show','getUnread','/:id/members','getMembers','/:id/messages','getMessages','post','create','addMembers','put','update','destroy','delete','removeMembers','multer','util','path','connect-timeout','Router','../../components/interaction/service','./chatGroup.controller'];(function(_0x11f541,_0x287622){var _0xc9be7d=function(_0x4a54b9){while(--_0x4a54b9){_0x11f541['push'](_0x11f541['shift']());}};_0xc9be7d(++_0x287622);}(_0x08eb,0x8f));var _0xb08e=function(_0x2f0224,_0x1ee67d){_0x2f0224=_0x2f0224-0x0;var _0x1ec93d=_0x08eb[_0x2f0224];return _0x1ec93d;};'use strict';var multer=require(_0xb08e('0x0'));var util=require(_0xb08e('0x1'));var path=require(_0xb08e('0x2'));var timeout=require(_0xb08e('0x3'));var express=require('express');var router=express[_0xb08e('0x4')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0xb08e('0x5'));var config=require('../../config/environment');var controller=require(_0xb08e('0x6'));router[_0xb08e('0x7')]('/',auth[_0xb08e('0x8')](),controller['index']);router[_0xb08e('0x7')]('/describe',auth[_0xb08e('0x8')](),controller[_0xb08e('0x9')]);router[_0xb08e('0x7')](_0xb08e('0xa'),auth[_0xb08e('0x8')](),controller[_0xb08e('0xb')]);router['get']('/:id/unread',auth[_0xb08e('0x8')](),controller[_0xb08e('0xc')]);router[_0xb08e('0x7')](_0xb08e('0xd'),auth[_0xb08e('0x8')](),controller[_0xb08e('0xe')]);router[_0xb08e('0x7')](_0xb08e('0xf'),auth[_0xb08e('0x8')](),controller[_0xb08e('0x10')]);router[_0xb08e('0x11')]('/',auth['isAuthenticated'](),controller[_0xb08e('0x12')]);router[_0xb08e('0x11')](_0xb08e('0xd'),auth[_0xb08e('0x8')](),controller[_0xb08e('0x13')]);router[_0xb08e('0x11')](_0xb08e('0xf'),auth[_0xb08e('0x8')](),controller['addMessage']);router[_0xb08e('0x14')](_0xb08e('0xa'),auth[_0xb08e('0x8')](),controller[_0xb08e('0x15')]);router['delete'](_0xb08e('0xa'),auth[_0xb08e('0x8')](),controller[_0xb08e('0x16')]);router[_0xb08e('0x17')](_0xb08e('0xd'),auth[_0xb08e('0x8')](),controller[_0xb08e('0x18')]);module['exports']=router;
\ No newline at end of file
diff --git a/server/api/chatInteraction/chatInteraction.attributes.js b/server/api/chatInteraction/chatInteraction.attributes.js
index fc516ab..c5e59e1 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 _0x3ee7=['exports','ENUM','thumb','star','TEXT','STRING','DATE','long'];(function(_0x1672a9,_0x19b36a){var _0x36ebaf=function(_0x711273){while(--_0x711273){_0x1672a9['push'](_0x1672a9['shift']());}};_0x36ebaf(++_0x19b36a);}(_0x3ee7,0x98));var _0x73ee=function(_0x2db65c,_0x5bfc65){_0x2db65c=_0x2db65c-0x0;var _0x57ebb2=_0x3ee7[_0x2db65c];return _0x57ebb2;};'use strict';var Sequelize=require('sequelize');module[_0x73ee('0x0')]={'closed':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'ratingValue':{'type':Sequelize['INTEGER']},'ratingType':{'type':Sequelize[_0x73ee('0x1')]('star',_0x73ee('0x2')),'defaultValue':_0x73ee('0x3')},'ratingMessage':{'type':Sequelize[_0x73ee('0x4')]},'pathTranscript':{'type':Sequelize[_0x73ee('0x4')]},'mailTranscript':{'type':Sequelize[_0x73ee('0x5')],'validate':{'isEmail':!![]}},'closedAt':{'type':Sequelize[_0x73ee('0x6')]},'disposition':{'type':Sequelize[_0x73ee('0x5')]},'secondDisposition':{'type':Sequelize[_0x73ee('0x5')]},'thirdDisposition':{'type':Sequelize['STRING']},'note':{'type':Sequelize[_0x73ee('0x5')]},'browserName':{'type':Sequelize[_0x73ee('0x5')]},'browserVersion':{'type':Sequelize['STRING']},'osName':{'type':Sequelize[_0x73ee('0x5')]},'osVersion':{'type':Sequelize['STRING']},'deviceModel':{'type':Sequelize[_0x73ee('0x5')]},'deviceVendor':{'type':Sequelize[_0x73ee('0x5')]},'deviceType':{'type':Sequelize[_0x73ee('0x5')]},'referer':{'type':Sequelize[_0x73ee('0x4')]},'customerIp':{'type':Sequelize[_0x73ee('0x5')]},'formData':{'type':Sequelize['TEXT'](_0x73ee('0x7'))},'read1stAt':{'type':Sequelize['DATE']},'lastMsgAt':{'type':Sequelize['DATE']},'lastMsgDirection':{'type':Sequelize[_0x73ee('0x1')]('in','out'),'defaultValue':'in','allowNull':![]},'closeReason':{'type':Sequelize[_0x73ee('0x5')]},'customerPort':{'type':Sequelize[_0x73ee('0x5')]},'vidaooSessionId':{'type':Sequelize['TEXT']},'autoreplyExecuted':{'type':Sequelize['BOOLEAN'],'defaultValue':![]}};
\ No newline at end of file
+var _0xbc87=['sequelize','INTEGER','ENUM','star','TEXT','STRING','DATE','long','out'];(function(_0x20574e,_0x39ddd2){var _0x4b06f1=function(_0x3a348b){while(--_0x3a348b){_0x20574e['push'](_0x20574e['shift']());}};_0x4b06f1(++_0x39ddd2);}(_0xbc87,0x144));var _0x7bc8=function(_0x3db622,_0x32953f){_0x3db622=_0x3db622-0x0;var _0xf6f42d=_0xbc87[_0x3db622];return _0xf6f42d;};'use strict';var Sequelize=require(_0x7bc8('0x0'));module['exports']={'closed':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'ratingValue':{'type':Sequelize[_0x7bc8('0x1')]},'ratingType':{'type':Sequelize[_0x7bc8('0x2')](_0x7bc8('0x3'),'thumb'),'defaultValue':'star'},'ratingMessage':{'type':Sequelize[_0x7bc8('0x4')]},'pathTranscript':{'type':Sequelize[_0x7bc8('0x4')]},'mailTranscript':{'type':Sequelize[_0x7bc8('0x5')],'validate':{'isEmail':!![]}},'closedAt':{'type':Sequelize[_0x7bc8('0x6')]},'disposition':{'type':Sequelize[_0x7bc8('0x5')]},'secondDisposition':{'type':Sequelize[_0x7bc8('0x5')]},'thirdDisposition':{'type':Sequelize[_0x7bc8('0x5')]},'note':{'type':Sequelize[_0x7bc8('0x5')]},'browserName':{'type':Sequelize[_0x7bc8('0x5')]},'browserVersion':{'type':Sequelize[_0x7bc8('0x5')]},'osName':{'type':Sequelize[_0x7bc8('0x5')]},'osVersion':{'type':Sequelize[_0x7bc8('0x5')]},'deviceModel':{'type':Sequelize[_0x7bc8('0x5')]},'deviceVendor':{'type':Sequelize[_0x7bc8('0x5')]},'deviceType':{'type':Sequelize[_0x7bc8('0x5')]},'referer':{'type':Sequelize[_0x7bc8('0x4')]},'customerIp':{'type':Sequelize[_0x7bc8('0x5')]},'formData':{'type':Sequelize['TEXT'](_0x7bc8('0x7'))},'read1stAt':{'type':Sequelize['DATE']},'lastMsgAt':{'type':Sequelize[_0x7bc8('0x6')]},'lastMsgDirection':{'type':Sequelize[_0x7bc8('0x2')]('in',_0x7bc8('0x8')),'defaultValue':'in','allowNull':![]},'closeReason':{'type':Sequelize[_0x7bc8('0x5')]},'customerPort':{'type':Sequelize[_0x7bc8('0x5')]},'vidaooSessionId':{'type':Sequelize[_0x7bc8('0x4')]},'autoreplyExecuted':{'type':Sequelize['BOOLEAN'],'defaultValue':![]}};
\ No newline at end of file
diff --git a/server/api/chatInteraction/chatInteraction.controller.js b/server/api/chatInteraction/chatInteraction.controller.js
index 9d87b44..c0662d2 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 _0xda2d=['update','destroy','name','send','render','merge','agent','interaction','account','Users','map','Tags','split','forEach','TagIds','index','ChatInteraction','rawAttributes','fieldName','type','key','model','keys','query','intersection','fields','attributes','nolimit','order','sort','filters','pick','field','color','tools_tags','select','u.id','u.fullname','from','user_has_chat_interactions','left_join','u.id\x20=\x20ui.UserId','cm_contacts','c.id\x20=\x20i.ContactId\x20AND\x20c.deletedAt\x20IS\x20NULL','users','a.id\x20=\x20i.ChatWebsiteId','me.ChatInteractionId\x20=\x20i.id','chat_interaction_has_tags','t.id\x20=\x20it.TagId','expr','search','sqlOperator','conditions','length','find','unreadMessages','value','having','`\x20=\x200','`\x20>\x200','Contact','operator','$substring','MATCH\x20(c.firstName,\x20c.lastName,\x20c.phone,\x20c.mobile,\x20c.fax,\x20c.email)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','getFullTextValue','c.firstName\x20LIKE\x20?\x20OR\x20c.lastName\x20LIKE\x20?\x20OR\x20c.email\x20LIKE\x20?','ContactId','buildExpression','Tag','CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','union','User','start','body','some','compact','where','i.ChatWebsiteId\x20IN\x20?','concat','createdAt','parse','$gte','$lte','null','\x20IS\x20NULL','read','`unreadMessages`\x20=\x200','`unreadMessages`\x20>\x200','tag','isArray','filter','replace','isNumeric','i.id\x20LIKE\x20?','MATCH\x20(me.body)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','CONCAT(c.firstName,\x20\x27\x20\x27,\x20c.lastName)\x20LIKE\x20?','group','i.id','Sequelize','SELECT','SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)','contactName','DESC','isEmpty','t.id\x20IN\x20?','i.ChatWebsiteId\x20IS\x20NOT\x20NULL','user','role','getChatWebsites','i.ChatWebsiteId\x20IS\x20NULL','toString','sequelize','keyBy','a.key','Account.key','Account.mandatoryDisposition','CASE\x20WHEN\x20(c.firstName\x20IS\x20NOT\x20NULL\x20AND\x20c.firstName\x20<>\x20\x27\x27)\x20OR\x20(c.lastName\x20IS\x20NOT\x20NULL\x20AND\x20c.lastName\x20<>\x20\x27\x27)\x20THEN\x20CONCAT(IFNULL(c.firstName,\x20\x27\x27),\x20\x27\x20\x27,\x20IFNULL(c.lastName,\x20\x27\x27))\x20ELSE\x20\x27Unknown\x27\x20END','i.*','c.firstName','c.lastName','Contact.lastName','c.email','Contact.email','Contact.phone','c.mobile','Contact.mobile','c.fax','Contact.fax','o.fullname','Owner.internal','GROUP_CONCAT(DISTINCT\x20t.id)','groupBy','ChatInteractionId','push','show','params','include','options','create','describe','findOne','ChatWebsiteId','vidaooEscalation','vidaooTopic','vidaooApiKey','fullname','email','contact','POST','https://api-vidaoo.xcally.com/api/v1/meetings','isNull','vidaooNote','follow','vidaooMetadata','metadata','ValidationError','Error\x20in\x20conversion\x20vidaooMetadata','Error\x20in\x20Vidaoo\x20configuration','join_url','out','ChatMessage','Unable\x20to\x20create\x20Vidaoo\x20session','CmContact','abandon','Interaction\x20already\x20assigned','disposition','attachmentUpload','file','filename','mimetype','attachmentDownload','closed','Unauthorized','attachId','ChatOfflineMessageId','join','offline-chat/','basename','download','close','mailTranscript','root','server/files/chat/upload/','transcript-%s.txt','now','pathTranscript','Messages','ChatWebsite','format','%s%d','agentAlias','customer','Visitor','website_alias','UserId','System','agent_alias','alias','agent_fullname','MM/DD/YYYY\x20HH:mm:ss','direction','appendFileSync','MailAccount','MailServerOut','Smtp','service','host','port','secure','authentication','auth','pass','SendMail','sendMail','Mail\x20Transcript','Hi\x20%s,\x20attached\x20you\x20can\x20find\x20your\x20transcript\x20file.\x20\x0a\x0aRegards.\x20\x0a\x0a','addMessage','ids','omit','getMessages','hasOwnProperty','YYYY-MM-DD\x20HH:mm:ss','includeAll','rows','getMyMessages','addTags','setTags','findAll','chatInteractionTags:save','removeTags','unix','server','tmp','files','attachments','firstName','lastName','Attachment','Account','Owner','get','Chat','N.A.','browserName','osName','referer','customerIp','customerPort','tail','existsSync','createReadStream','renderFile','views','downloadInteraction.ejs','.pdf','createPdfFromHTML','err','unlinkSync','rimraf','zip-dir','fast-json-patch','request-promise','moment','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../components/export/pdf','../../config/license/hardware','../../config/logger','api','../../config/utils','redis','defaults','localhost','socket.io-emitter','./chatInteraction.socket','jayson/promise','http','client','request','then','info','ChatInteraction,\x20%s,\x20%s','request\x20sent','debug','ChatInteraction,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','sendStatus','end','status','json','offset','undefined','limit','count','set','reject','save'];(function(_0xf9431c,_0x4754b5){var _0x53fc33=function(_0x50ac6c){while(--_0x50ac6c){_0xf9431c['push'](_0xf9431c['shift']());}};_0x53fc33(++_0x4754b5);}(_0xda2d,0x102));var _0xdda2=function(_0x13bb01,_0x35c93f){_0x13bb01=_0x13bb01-0x0;var _0x12677f=_0xda2d[_0x13bb01];return _0x12677f;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xdda2('0x0'));var zipdir=require(_0xdda2('0x1'));var jsonpatch=require(_0xdda2('0x2'));var rp=require(_0xdda2('0x3'));var moment=require(_0xdda2('0x4'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require('util');var path=require(_0xdda2('0x5'));var sox=require(_0xdda2('0x6'));var csv=require(_0xdda2('0x7'));var ejs=require(_0xdda2('0x8'));var fs=require('fs');var fs_extra=require(_0xdda2('0x9'));var _=require(_0xdda2('0xa'));var squel=require(_0xdda2('0xb'));var crypto=require(_0xdda2('0xc'));var jsforce=require(_0xdda2('0xd'));var deskjs=require(_0xdda2('0xe'));var toCsv=require('to-csv');var querystring=require(_0xdda2('0xf'));var Papa=require(_0xdda2('0x10'));var Redis=require('ioredis');var authService=require(_0xdda2('0x11'));var qs=require(_0xdda2('0x12'));var as=require(_0xdda2('0x13'));var pdf=require(_0xdda2('0x14'));var hardwareService=require(_0xdda2('0x15'));var logger=require(_0xdda2('0x16'))(_0xdda2('0x17'));var utils=require(_0xdda2('0x18'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];config[_0xdda2('0x19')]=_[_0xdda2('0x1a')](config[_0xdda2('0x19')],{'host':_0xdda2('0x1b'),'port':0x18eb});var socket=require(_0xdda2('0x1c'))(new Redis(config[_0xdda2('0x19')]));require(_0xdda2('0x1d'))['register'](socket);var jayson=require(_0xdda2('0x1e'));var client=jayson['client'][_0xdda2('0x1f')]({'port':0x232b});var client9004=jayson[_0xdda2('0x20')][_0xdda2('0x1f')]({'port':0x232c});function respondWithRpcPromise(_0x457764,_0x1922b1,_0x5d8a83,_0x55d674){return new BPromise(function(_0x43f67b,_0x518c6d){var _0x1a5192=_0x55d674||client;return _0x1a5192[_0xdda2('0x21')](_0x457764,_0x5d8a83)[_0xdda2('0x22')](function(_0x2b6ee8){logger[_0xdda2('0x23')](_0xdda2('0x24'),_0x1922b1,_0xdda2('0x25'));logger[_0xdda2('0x26')](_0xdda2('0x27'),_0x1922b1,_0xdda2('0x25'),JSON[_0xdda2('0x28')](_0x2b6ee8));if(_0x2b6ee8[_0xdda2('0x29')]){if(_0x2b6ee8['error'][_0xdda2('0x2a')]===0x1f4){logger['error'](_0xdda2('0x24'),_0x1922b1,_0x2b6ee8[_0xdda2('0x29')][_0xdda2('0x2b')]);return _0x518c6d(_0x2b6ee8['error'][_0xdda2('0x2b')]);}logger['error'](_0xdda2('0x24'),_0x1922b1,_0x2b6ee8[_0xdda2('0x29')]['message']);return _0x43f67b(_0x2b6ee8[_0xdda2('0x29')][_0xdda2('0x2b')]);}else{logger[_0xdda2('0x23')](_0xdda2('0x24'),_0x1922b1,_0xdda2('0x25'));_0x43f67b(_0x2b6ee8['result'][_0xdda2('0x2b')]);}})[_0xdda2('0x2c')](function(_0x2391a5){logger[_0xdda2('0x29')]('ChatInteraction,\x20%s,\x20%s',_0x1922b1,_0x2391a5);_0x518c6d(_0x2391a5);});});}function respondWithStatusCode(_0x4e97dc,_0x28da54){_0x28da54=_0x28da54||0xcc;return function(_0x4567e7){if(_0x4567e7){return _0x4e97dc[_0xdda2('0x2d')](_0x28da54);}return _0x4e97dc['status'](_0x28da54)[_0xdda2('0x2e')]();};}function respondWithResult(_0x5d26ae,_0x2e755b){_0x2e755b=_0x2e755b||0xc8;return function(_0xe53dee){if(_0xe53dee){return _0x5d26ae[_0xdda2('0x2f')](_0x2e755b)[_0xdda2('0x30')](_0xe53dee);}};}function respondWithFilteredResult(_0x4bb8a4,_0x24c37d){return function(_0x255bbc){if(_0x255bbc){var _0x53acb5=typeof _0x24c37d[_0xdda2('0x31')]===_0xdda2('0x32')&&typeof _0x24c37d[_0xdda2('0x33')]===_0xdda2('0x32');var _0x5540e5=_0x255bbc[_0xdda2('0x34')];var _0x5e107f=_0x53acb5?0x0:_0x24c37d['offset'];var _0x1ca9f3=_0x53acb5?_0x255bbc['count']:_0x24c37d[_0xdda2('0x31')]+_0x24c37d['limit'];var _0x53ff76;if(_0x1ca9f3>=_0x5540e5){_0x1ca9f3=_0x5540e5;_0x53ff76=0xc8;}else{_0x53ff76=0xce;}_0x4bb8a4['status'](_0x53ff76);return _0x4bb8a4[_0xdda2('0x35')]('Content-Range',_0x5e107f+'-'+_0x1ca9f3+'/'+_0x5540e5)[_0xdda2('0x30')](_0x255bbc);}return null;};}function patchUpdates(_0x508664){return function(_0x5cba58){try{jsonpatch['apply'](_0x5cba58,_0x508664,!![]);}catch(_0x4637c1){return BPromise[_0xdda2('0x36')](_0x4637c1);}return _0x5cba58[_0xdda2('0x37')]();};}function saveUpdates(_0x2fd592,_0x12e96d){return function(_0x644a24){if(_0x644a24){return _0x644a24[_0xdda2('0x38')](_0x2fd592)[_0xdda2('0x22')](function(_0x3cddbd){return _0x3cddbd;});}return null;};}function removeEntity(_0x2bcf47,_0x4a32ea){return function(_0x461621){if(_0x461621){return _0x461621[_0xdda2('0x39')]()[_0xdda2('0x22')](function(){_0x2bcf47[_0xdda2('0x2f')](0xcc)[_0xdda2('0x2e')]();});}};}function handleEntityNotFound(_0x33c4b0,_0x45d3ad){return function(_0x5835cd){if(!_0x5835cd){_0x33c4b0['sendStatus'](0x194);}return _0x5835cd;};}function handleError(_0xa03f5,_0x1cf553){_0x1cf553=_0x1cf553||0x1f4;return function(_0x40eb19){logger['error'](_0x40eb19['stack']);if(_0x40eb19[_0xdda2('0x3a')]){delete _0x40eb19[_0xdda2('0x3a')];}_0xa03f5[_0xdda2('0x2f')](_0x1cf553)[_0xdda2('0x3b')](_0x40eb19);};}function getMustacheRender(_0x246001,_0x5ab419){return Mustache[_0xdda2('0x3c')](_0x246001,_[_0xdda2('0x3d')](_0x5ab419['body'],{'contact':_0x5ab419['contact'],'message':_0x5ab419[_0xdda2('0x2b')],'agent':_0x5ab419[_0xdda2('0x3e')],'interaction':_0x5ab419[_0xdda2('0x3f')],'account':_0x5ab419[_0xdda2('0x40')]}))||'';}function getInteractionUsers(_0x20969d,_0x585eba){return new BPromise(function(_0x2e7847,_0x226de2){try{if(_0x585eba[_0x20969d['id']]){_0x20969d[_0xdda2('0x41')]=_[_0xdda2('0x42')](_0x585eba[_0x20969d['id']],function(_0x50c4ae){return{'id':_0x50c4ae['id'],'fullname':_0x50c4ae['fullname']};});}}catch(_0x203972){_0x226de2(_0x203972);}_0x2e7847(_0x20969d);});}function getInteractionTags(_0x2e0524,_0x7a25fe){return new BPromise(function(_0x5a92e9,_0x1bb2a7){try{if(_0x2e0524['TagIds']){_0x2e0524[_0xdda2('0x43')]=[];_0x2e0524['TagIds'][_0xdda2('0x44')](',')[_0xdda2('0x45')](function(_0x1db762){_0x2e0524[_0xdda2('0x43')]['push'](_0x7a25fe[_0x1db762]);});}delete _0x2e0524[_0xdda2('0x46')];}catch(_0x574f8f){_0x1bb2a7(_0x574f8f);}_0x5a92e9(_0x2e0524);});}function updateChatInteraction(_0x392f70,_0x4d3b78,_0x1d1678){return new BPromise(function(_0x12589b,_0x153acf){return getInteractionUsers(_0x392f70,_0x1d1678)[_0xdda2('0x22')](function(_0x38dc03){return getInteractionTags(_0x38dc03,_0x4d3b78);})['then'](function(_0x1e29dc){_0x12589b(_0x1e29dc);})[_0xdda2('0x2c')](function(_0x54735b){_0x153acf(_0x54735b);});});}exports[_0xdda2('0x47')]=function(_0x546847,_0x292e70){var _0x45c802={},_0x1741a0={},_0x355b6a={'count':0x0,'rows':[]};var _0x3f1f9b=_[_0xdda2('0x42')](db[_0xdda2('0x48')][_0xdda2('0x49')],function(_0xff55){return{'name':_0xff55[_0xdda2('0x4a')],'type':_0xff55[_0xdda2('0x4b')][_0xdda2('0x4c')]};});_0x1741a0[_0xdda2('0x4d')]=_['map'](_0x3f1f9b,'name');_0x1741a0['query']=_[_0xdda2('0x4e')](_0x546847[_0xdda2('0x4f')]);_0x1741a0['filters']=_[_0xdda2('0x50')](_0x1741a0[_0xdda2('0x4d')],_0x1741a0[_0xdda2('0x4f')]);_0x45c802['attributes']=_[_0xdda2('0x50')](_0x1741a0[_0xdda2('0x4d')],qs['fields'](_0x546847['query'][_0xdda2('0x51')]));_0x45c802['attributes']=_0x45c802[_0xdda2('0x52')]['length']?_0x45c802[_0xdda2('0x52')]:_0x1741a0[_0xdda2('0x4d')];if(!_0x546847['query']['hasOwnProperty'](_0xdda2('0x53'))){_0x45c802[_0xdda2('0x33')]=qs[_0xdda2('0x33')](_0x546847[_0xdda2('0x4f')]['limit']);_0x45c802[_0xdda2('0x31')]=qs[_0xdda2('0x31')](_0x546847[_0xdda2('0x4f')][_0xdda2('0x31')]);}_0x45c802[_0xdda2('0x54')]=qs['sort'](_0x546847[_0xdda2('0x4f')][_0xdda2('0x55')]);_0x45c802['where']=qs[_0xdda2('0x56')](_[_0xdda2('0x57')](_0x546847[_0xdda2('0x4f')],_0x1741a0[_0xdda2('0x56')]),_0x3f1f9b);var _0x161d7b=[];var _0x265169=squel['select']()[_0xdda2('0x58')]('id')['field'](_0xdda2('0x3a'))['field'](_0xdda2('0x59'))['from'](_0xdda2('0x5a'));var _0x11c8b1=squel[_0xdda2('0x5b')]()[_0xdda2('0x58')](_0xdda2('0x5c'))[_0xdda2('0x58')](_0xdda2('0x5d'))[_0xdda2('0x58')]('ui.ChatInteractionId')[_0xdda2('0x5e')](_0xdda2('0x5f'),'ui')[_0xdda2('0x60')]('users','u',_0xdda2('0x61'));var _0x1c2d24=squel['select']()[_0xdda2('0x5e')]('chat_interactions','i')[_0xdda2('0x60')](_0xdda2('0x62'),'c',_0xdda2('0x63'))[_0xdda2('0x60')](_0xdda2('0x64'),'o','o.id\x20=\x20i.UserId')['left_join']('chat_websites','a',_0xdda2('0x65'))[_0xdda2('0x60')]('chat_messages','me',_0xdda2('0x66'))[_0xdda2('0x60')](_0xdda2('0x67'),'it','it.ChatInteractionId\x20=\x20i.id')[_0xdda2('0x60')](_0xdda2('0x5a'),'t',_0xdda2('0x68'));var _0x58ae15=squel[_0xdda2('0x69')]();var _0x4495e5=[];var _0x7eb83f=squel[_0xdda2('0x69')]();var _0x5d8602;if(_0x546847[_0xdda2('0x4f')]['search']){_0x5d8602=as['parseSearch'](_0x546847['query'][_0xdda2('0x6a')]);var _0x35b38a=_0x5d8602[_0xdda2('0x6b')];for(var _0x433cb0=0x0;_0x433cb0<_0x5d8602[_0xdda2('0x6c')][_0xdda2('0x6d')];_0x433cb0++){var _0x29a739=_0x5d8602[_0xdda2('0x6c')][_0x433cb0];var _0x269ad1='i';var _0x138c2f=_[_0xdda2('0x6e')](_0x3f1f9b,['name',_0x29a739[_0xdda2('0x58')]]);if(!_0x138c2f){switch(_0x29a739[_0xdda2('0x58')]){case _0xdda2('0x6f'):if(_0x29a739[_0xdda2('0x70')]==0x1){_0x1c2d24[_0xdda2('0x71')]('`'+_0x29a739[_0xdda2('0x58')]+_0xdda2('0x72'));}else{_0x1c2d24['having']('`'+_0x29a739[_0xdda2('0x58')]+_0xdda2('0x73'));}break;case _0xdda2('0x74'):if(_0x29a739[_0xdda2('0x75')]===_0xdda2('0x76')){if(_0x29a739['value'][_0xdda2('0x44')]('\x20')[_0xdda2('0x6d')]>0x1){_0x58ae15[_0x35b38a](_0xdda2('0x77'),qs[_0xdda2('0x78')](_0x29a739[_0xdda2('0x70')]),null);}else{var _0x4a6f28='%'+_0x29a739[_0xdda2('0x70')]+'%';_0x58ae15[_0x35b38a](_0xdda2('0x79'),_0x4a6f28,_0x4a6f28,_0x4a6f28);}}else{_0x138c2f=_[_0xdda2('0x6e')](_0x3f1f9b,[_0xdda2('0x3a'),_0xdda2('0x7a')]);_0x29a739['field']=_0xdda2('0x7a');_0x27780e=as[_0xdda2('0x7b')](_0x269ad1,_0x138c2f[_0xdda2('0x4b')],_0x29a739);_0x58ae15[_0x35b38a](_0x27780e['text'],_0x27780e[_0xdda2('0x70')]['start'],_0x27780e[_0xdda2('0x70')][_0xdda2('0x2e')]);}break;case _0xdda2('0x7c'):var _0x5c351c=_0x29a739[_0xdda2('0x70')][_0xdda2('0x44')](',')['map'](function(_0x13c0d9){return Number(_0x13c0d9);});_0x5c351c['forEach'](function(_0x3d645b){_0x7eb83f['or'](_0xdda2('0x7d'),'%,'+_0x3d645b+',%');});_0x4495e5=_[_0xdda2('0x7e')](_0x4495e5,_0x5c351c);break;case _0xdda2('0x7f'):if(_0x29a739[_0xdda2('0x75')]==='$substring'){_0x58ae15[_0x35b38a]('CONCAT_WS(\x27\x20\x27,\x20o.name,\x20o.fullname)\x20LIKE\x20?','%'+_0x29a739[_0xdda2('0x70')]+'%',null);}else{_0x138c2f=_[_0xdda2('0x6e')](_0x3f1f9b,['name','UserId']);_0x29a739[_0xdda2('0x58')]='UserId';_0x27780e=as[_0xdda2('0x7b')](_0x269ad1,_0x138c2f[_0xdda2('0x4b')],_0x29a739);_0x58ae15[_0x35b38a](_0x27780e['text'],_0x27780e[_0xdda2('0x70')][_0xdda2('0x80')],_0x27780e[_0xdda2('0x70')][_0xdda2('0x2e')]);}break;case _0xdda2('0x81'):_0x27780e=as[_0xdda2('0x7b')]('me',null,_0x29a739);_0x58ae15[_0x35b38a](_0x27780e['text'],_0x27780e[_0xdda2('0x70')][_0xdda2('0x80')],_0x27780e[_0xdda2('0x70')]['end']);break;}}else{var _0x27780e=as[_0xdda2('0x7b')](_0x269ad1,_0x138c2f['type'],_0x29a739);_0x58ae15[_0x35b38a](_0x27780e['text'],_0x27780e[_0xdda2('0x70')][_0xdda2('0x80')],_0x27780e[_0xdda2('0x70')]['end']);}}}else{var _0x585a72=_(_0x546847[_0xdda2('0x4f')])['keys']()[_0xdda2('0x42')](function(_0x150dcd){return _[_0xdda2('0x82')](_0x3f1f9b,[_0xdda2('0x3a'),_0x150dcd])?_0x150dcd:undefined;})[_0xdda2('0x83')]()[_0xdda2('0x70')]();if(!_['isEmpty'](_0x585a72)){_0x585a72['forEach'](function(_0x218b96){if(_0x218b96==='ChatWebsiteId'){_0x1c2d24[_0xdda2('0x84')](_0xdda2('0x85'),[][_0xdda2('0x86')](_0x546847[_0xdda2('0x4f')][_0x218b96]));}else if(_0x218b96===_0xdda2('0x87')){var _0x104024=JSON[_0xdda2('0x88')](_0x546847[_0xdda2('0x4f')][_0x218b96])[_0xdda2('0x89')];var _0x495a28=JSON[_0xdda2('0x88')](_0x546847[_0xdda2('0x4f')][_0x218b96])[_0xdda2('0x8a')];_0x1c2d24[_0xdda2('0x84')]('i.createdAt\x20BETWEEN\x20?\x20AND\x20?',_0x104024,_0x495a28);}else{if(_0x546847[_0xdda2('0x4f')][_0x218b96]===_0xdda2('0x8b')){_0x1c2d24[_0xdda2('0x84')]('i.'+_0x218b96+_0xdda2('0x8c'));}else{_0x1c2d24['where']('i.'+_0x218b96+'\x20=\x20?',_0x546847[_0xdda2('0x4f')][_0x218b96]);}}});}if(_0x546847[_0xdda2('0x4f')][_0xdda2('0x8d')]){if(_0x546847[_0xdda2('0x4f')]['read']==0x1){_0x1c2d24[_0xdda2('0x71')](_0xdda2('0x8e'));}else{_0x1c2d24[_0xdda2('0x71')](_0xdda2('0x8f'));}}if(_0x546847[_0xdda2('0x4f')][_0xdda2('0x90')]){_0x4495e5=_[_0xdda2('0x91')](_0x546847[_0xdda2('0x4f')][_0xdda2('0x90')])?_0x546847[_0xdda2('0x4f')][_0xdda2('0x90')]:new Array(_0x546847[_0xdda2('0x4f')][_0xdda2('0x90')]);_0x4495e5[_0xdda2('0x45')](function(_0x2411e8){_0x7eb83f['or']('CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','%,'+_0x2411e8+',%');});}if(_0x546847[_0xdda2('0x4f')][_0xdda2('0x92')]){var _0x58fcea=_0x546847['query'][_0xdda2('0x92')][_0xdda2('0x93')]('\x5c','\x5c\x5c')[_0xdda2('0x93')](/'/g,'\x27\x27');if(qs[_0xdda2('0x94')](_0x58fcea)){_0x58ae15['or'](_0xdda2('0x95'),_0x58fcea+'%');}else{_0x58ae15['or'](_0xdda2('0x96'),qs['getFullTextValue'](_0x58fcea))['or'](_0xdda2('0x97'),_0x58fcea+'%');}}}_0x1c2d24[_0xdda2('0x84')](_0x58ae15);_0x1c2d24[_0xdda2('0x98')](_0xdda2('0x99'));var _0x563be8={'type':db[_0xdda2('0x9a')]['QueryTypes'][_0xdda2('0x9b')],'raw':!![]};var _0x6b6dad=_0x1c2d24['clone']();_0x6b6dad[_0xdda2('0x58')](_0xdda2('0x99'));_0x6b6dad[_0xdda2('0x58')](_0xdda2('0x9c'),_0xdda2('0x6f'));if(_0x45c802[_0xdda2('0x54')]){_0x45c802[_0xdda2('0x54')][_0xdda2('0x45')](function(_0x3a375d){var _0x3e82bb=_0x3a375d[0x0]===_0xdda2('0x9d')?_0x3a375d[0x0]:'i.'+_0x3a375d[0x0];_0x1c2d24['order'](_0x3e82bb,_0x3a375d[0x1]===_0xdda2('0x9e')?![]:!![]);});}if(!_[_0xdda2('0x9f')](_0x4495e5)){_0x1c2d24[_0xdda2('0x71')](_0x7eb83f);_0x6b6dad[_0xdda2('0x84')](_0xdda2('0xa0'),_0x4495e5);}BPromise['resolve']()[_0xdda2('0x22')](function(){if(!_0x5d8602){if(_0x546847[_0xdda2('0x4f')]['ChatWebsiteId'])return;_0x6b6dad[_0xdda2('0x84')](_0xdda2('0xa1'));_0x1c2d24['where']('i.ChatWebsiteId\x20IS\x20NOT\x20NULL');return;}if(_0x546847[_0xdda2('0xa2')][_0xdda2('0xa3')]!==_0xdda2('0x3e'))return;return _0x546847[_0xdda2('0xa2')][_0xdda2('0xa4')]({'attributes':['id'],'raw':!![]})[_0xdda2('0x22')](function(_0x525e93){if(_[_0xdda2('0x9f')](_0x525e93)){_0x6b6dad[_0xdda2('0x84')]('i.ChatWebsiteId\x20IS\x20NULL');_0x1c2d24[_0xdda2('0x84')](_0xdda2('0xa5'));}else{_0x6b6dad['where'](_0xdda2('0x85'),_[_0xdda2('0x42')](_0x525e93,'id'));_0x1c2d24[_0xdda2('0x84')]('i.ChatWebsiteId\x20IN\x20?',_[_0xdda2('0x42')](_0x525e93,'id'));}});})['then'](function(){if(_0x546847[_0xdda2('0xa2')][_0xdda2('0xa3')]===_0xdda2('0x3e')&&!_0x5d8602&&!_0x546847[_0xdda2('0x4f')]['ChatWebsiteId'])return[];return db['sequelize'][_0xdda2('0x4f')](_0x6b6dad[_0xdda2('0xa6')](),_0x563be8);})['then'](function(_0x468e32){_0x355b6a[_0xdda2('0x34')]=_0x468e32[_0xdda2('0x6d')];if(_0x355b6a[_0xdda2('0x34')]===0x0)return[];return db[_0xdda2('0xa7')][_0xdda2('0x4f')](_0x265169[_0xdda2('0xa6')](),_0x563be8)[_0xdda2('0x22')](function(_0x3046c1){_0x161d7b=_[_0xdda2('0xa8')](_0x3046c1,'id');_0x563be8=_[_0xdda2('0x3d')](_0x563be8,{'model':db[_0xdda2('0x48')],'mapToModel':!![],'raw':!![],'nest':!![]});if(_0x546847['query']['fields']){_0x45c802['attributes'][_0xdda2('0x45')](function(_0x4edf20){_0x1c2d24[_0xdda2('0x58')]('i.'+_0x4edf20);});}else{_0x1c2d24[_0xdda2('0x58')](_0xdda2('0x9c'),_0xdda2('0x6f'));_0x1c2d24['field'](_0xdda2('0xa9'),_0xdda2('0xaa'));_0x1c2d24[_0xdda2('0x58')]('a.mandatoryDisposition',_0xdda2('0xab'));_0x1c2d24[_0xdda2('0x58')](_0xdda2('0xac'),'contactName');_0x1c2d24['field'](_0xdda2('0xad'));_0x1c2d24[_0xdda2('0x58')](_0xdda2('0xae'),'Contact.firstName');_0x1c2d24[_0xdda2('0x58')](_0xdda2('0xaf'),_0xdda2('0xb0'));_0x1c2d24[_0xdda2('0x58')](_0xdda2('0xb1'),_0xdda2('0xb2'));_0x1c2d24[_0xdda2('0x58')]('c.phone',_0xdda2('0xb3'));_0x1c2d24[_0xdda2('0x58')](_0xdda2('0xb4'),_0xdda2('0xb5'));_0x1c2d24['field'](_0xdda2('0xb6'),_0xdda2('0xb7'));_0x1c2d24[_0xdda2('0x58')](_0xdda2('0xb8'),'Owner.fullname');_0x1c2d24['field']('o.internal',_0xdda2('0xb9'));_0x1c2d24[_0xdda2('0x58')](_0xdda2('0xba'),_0xdda2('0x46'));}if(_0x45c802[_0xdda2('0x33')])_0x1c2d24[_0xdda2('0x33')](_0x45c802['limit']);if(_0x45c802[_0xdda2('0x31')])_0x1c2d24[_0xdda2('0x31')](_0x45c802[_0xdda2('0x31')]);return db[_0xdda2('0xa7')][_0xdda2('0x4f')](_0x1c2d24[_0xdda2('0xa6')](),_0x563be8);})[_0xdda2('0x22')](function(_0xbfd011){if(_0xbfd011['length']>0x0)_0x11c8b1[_0xdda2('0x84')]('ui.ChatInteractionId\x20IN\x20?',_[_0xdda2('0x42')](_0xbfd011,'id'));return db['sequelize'][_0xdda2('0x4f')](_0x11c8b1['toString'](),_0x563be8)[_0xdda2('0x22')](function(_0x31e555){var _0x329d18=_[_0xdda2('0xbb')](_0x31e555,_0xdda2('0xbc'));var _0x18a102=[];_0xbfd011[_0xdda2('0x45')](function(_0x28ba40){_0x18a102[_0xdda2('0xbd')](updateChatInteraction(_0x28ba40,_0x161d7b,_0x329d18));});return BPromise['all'](_0x18a102);});});})[_0xdda2('0x22')](function(_0x434d79){_0x355b6a['rows']=_0x434d79;return _0x355b6a;})[_0xdda2('0x22')](respondWithFilteredResult(_0x292e70,_0x45c802))[_0xdda2('0x2c')](handleError(_0x292e70,null));};exports[_0xdda2('0xbe')]=function(_0x5600da,_0x1702ae){var _0x21ade3={'raw':![],'where':{'id':_0x5600da[_0xdda2('0xbf')]['id']}},_0x251408={};_0x251408[_0xdda2('0x4d')]=_[_0xdda2('0x4e')](db[_0xdda2('0x48')][_0xdda2('0x49')]);_0x251408[_0xdda2('0x4f')]=_[_0xdda2('0x4e')](_0x5600da['query']);_0x251408[_0xdda2('0x56')]=_[_0xdda2('0x50')](_0x251408[_0xdda2('0x4d')],_0x251408[_0xdda2('0x4f')]);_0x21ade3[_0xdda2('0x52')]=_['intersection'](_0x251408[_0xdda2('0x4d')],qs[_0xdda2('0x51')](_0x5600da[_0xdda2('0x4f')]['fields']));_0x21ade3[_0xdda2('0x52')]=_0x21ade3[_0xdda2('0x52')][_0xdda2('0x6d')]?_0x21ade3['attributes']:_0x251408[_0xdda2('0x4d')];if(_0x5600da['query']['includeAll']){_0x21ade3[_0xdda2('0xc0')]=[{'all':!![]}];}_0x21ade3=_[_0xdda2('0x3d')]({},_0x21ade3,_0x5600da[_0xdda2('0xc1')]);return db[_0xdda2('0x48')][_0xdda2('0x6e')](_0x21ade3)[_0xdda2('0x22')](handleEntityNotFound(_0x1702ae,null))[_0xdda2('0x22')](respondWithResult(_0x1702ae,null))['catch'](handleError(_0x1702ae,null));};exports['create']=function(_0x3aab39,_0x1c1cf6){return db[_0xdda2('0x48')][_0xdda2('0xc2')](_0x3aab39[_0xdda2('0x81')],{})['then'](respondWithResult(_0x1c1cf6,0xc9))[_0xdda2('0x2c')](handleError(_0x1c1cf6,null));};exports[_0xdda2('0x38')]=function(_0x489cda,_0x233494){if(_0x489cda[_0xdda2('0x81')]['id']){delete _0x489cda[_0xdda2('0x81')]['id'];}return db[_0xdda2('0x48')][_0xdda2('0x6e')]({'where':{'id':_0x489cda[_0xdda2('0xbf')]['id']}})[_0xdda2('0x22')](handleEntityNotFound(_0x233494,null))[_0xdda2('0x22')](saveUpdates(_0x489cda[_0xdda2('0x81')],null))[_0xdda2('0x22')](respondWithResult(_0x233494,null))[_0xdda2('0x2c')](handleError(_0x233494,null));};exports[_0xdda2('0x39')]=function(_0x416993,_0x47b7a5){return db[_0xdda2('0x48')]['find']({'where':{'id':_0x416993[_0xdda2('0xbf')]['id']}})[_0xdda2('0x22')](handleEntityNotFound(_0x47b7a5,null))[_0xdda2('0x22')](removeEntity(_0x47b7a5,null))['catch'](handleError(_0x47b7a5,null));};exports[_0xdda2('0xc3')]=function(_0xb93d3b,_0x3d59cb){return db['ChatInteraction'][_0xdda2('0xc3')]()[_0xdda2('0x22')](respondWithResult(_0x3d59cb,null))[_0xdda2('0x2c')](handleError(_0x3d59cb,null));};exports['createVidaooSession']=function(_0x5916cb,_0x123065){var _0x5611a0=_0x5916cb[_0xdda2('0xbf')]['id'];var _0x174eb9;var _0x23b9bd;var _0x182570;return db['ChatInteraction'][_0xdda2('0xc4')]({'where':{'id':_0x5611a0}})['then'](function(_0x5a1e60){_0x174eb9=_0x5a1e60;return db['ChatWebsite']['findOne']({'where':{'id':_0x5a1e60[_0xdda2('0xc5')]},'attributes':['id','vidaooApiKey',_0xdda2('0xc6'),_0xdda2('0xc7'),'vidaooNote','vidaooMetadata'],'raw':!![]});})[_0xdda2('0x22')](function(_0x255853){if(_0x255853&&_0x255853[_0xdda2('0xc8')]&&_0x255853[_0xdda2('0xc6')]){_0x23b9bd=_0x255853;var _0x55d25d={'interaction':{'id':_0x5611a0},'agent':{'id':_0x5916cb['user']['id'],'name':_0x5916cb[_0xdda2('0xa2')][_0xdda2('0x3a')],'fullname':_0x5916cb[_0xdda2('0xa2')][_0xdda2('0xc9')],'email':_0x5916cb['user'][_0xdda2('0xca')]},'contact':_0x5916cb[_0xdda2('0x81')][_0xdda2('0xcb')],'account':_0x5916cb[_0xdda2('0x81')][_0xdda2('0x40')]};var _0x1fdc68={'rejectUnauthorized':![],'method':_0xdda2('0xcc'),'url':_0xdda2('0xcd'),'headers':{'X-APIKEY':_0x255853[_0xdda2('0xc8')]},'body':{'duration':null,'scheduledAt':null,'participants':[_0x5916cb[_0xdda2('0xa2')][_0xdda2('0xca')]],'buttons':null,'topic':_0x23b9bd[_0xdda2('0xc7')],'note':_[_0xdda2('0xce')](_0x23b9bd[_0xdda2('0xcf')])?null:getMustacheRender(_0x23b9bd[_0xdda2('0xcf')],_0x55d25d),'metadata':null},'redirect':_0xdda2('0xd0'),'json':!![]};try{if(!_['isNull'](_0x23b9bd[_0xdda2('0xd1')])){var _0x1e5460=getMustacheRender(_0x23b9bd[_0xdda2('0xd1')],_0x55d25d);var _0xa386d1=JSON[_0xdda2('0x88')](_0x1e5460);_0x1fdc68[_0xdda2('0x81')][_0xdda2('0xd2')]=_0xa386d1;}}catch(_0x1945bc){throw new db[(_0xdda2('0x9a'))][(_0xdda2('0xd3'))](_0xdda2('0xd4'));}return rp(_0x1fdc68);}else{throw new db[(_0xdda2('0x9a'))][(_0xdda2('0xd3'))](_0xdda2('0xd5'));}})[_0xdda2('0x22')](function(_0x5308f1){_0x182570=_0x5308f1;if(_0x182570['id']){var _0x17c084={'body':_0x182570[_0xdda2('0xd6')],'ChatWebsiteId':_0x23b9bd['id'],'ChatInteractionId':_0x174eb9['id'],'direction':_0xdda2('0xd7'),'UserId':_0x5916cb[_0xdda2('0xa2')]['id']};return db[_0xdda2('0xd8')][_0xdda2('0xc2')](_0x17c084,{});}else{throw new db[(_0xdda2('0x9a'))][(_0xdda2('0xd3'))](_0xdda2('0xd9'));}})[_0xdda2('0x22')](function(){return _0x174eb9['updateAttributes']({'vidaooSessionId':_0x182570['id']});})[_0xdda2('0x22')](respondWithResult(_0x123065,null))['catch'](handleError(_0x123065,null));};exports['customUpdate']=function(_0xfd249a,_0x142e6a){if(_0xfd249a[_0xdda2('0x81')]['id']){delete _0xfd249a[_0xdda2('0x81')]['id'];}return db[_0xdda2('0x48')]['find']({'where':{'id':_0xfd249a[_0xdda2('0xbf')]['id']},'include':[{'model':db[_0xdda2('0xda')],'as':_0xdda2('0x74')}]})[_0xdda2('0x22')](handleEntityNotFound(_0x142e6a,null))[_0xdda2('0x22')](saveUpdates(_0xfd249a[_0xdda2('0x81')],null))[_0xdda2('0x22')](respondWithResult(_0x142e6a,null))[_0xdda2('0x2c')](handleError(_0x142e6a,null));};exports['abandon']=function(_0x5738f9,_0x3795b2,_0x38902f){if(_0x5738f9[_0xdda2('0x81')]['id']){delete _0x5738f9['body']['id'];}return db['ChatInteraction']['find']({'where':{'id':_0x5738f9[_0xdda2('0xbf')]['id']}})[_0xdda2('0x22')](function(_0x253ca6){if(!_0x253ca6){logger[_0xdda2('0x29')]('abandonInteraction,\x20%s,\x20%s,\x20%s',_0xdda2('0xdb'),0x194,'entity\x20not\x20found');_0x3795b2[_0xdda2('0x2d')](0x194);}else{if(_0x253ca6['UserId']){throw new db[(_0xdda2('0x9a'))][(_0xdda2('0xd3'))](_0xdda2('0xdc'));}}return _0x253ca6;})['then'](function(_0x335dc1){if(_0x335dc1){return _0x335dc1[_0xdda2('0x38')]({'closed':_0x5738f9[_0xdda2('0x81')]['closed'],'disposition':_0x5738f9[_0xdda2('0x81')][_0xdda2('0xdd')]})['then'](function(_0x1ec330){return _0x1ec330;});}})[_0xdda2('0x22')](function(_0x48e6e6){return respondWithRpcPromise('AbandonInteraction','abandon',_0x5738f9[_0xdda2('0x81')],client9004);})['then'](respondWithResult(_0x3795b2,null))['catch'](handleError(_0x3795b2,null));};exports[_0xdda2('0xde')]=function(_0x4444b4,_0x2279f8,_0x40e6a9){_0x4444b4[_0xdda2('0x81')][_0xdda2('0x3a')]=_0x4444b4['file']['originalname'];_0x4444b4[_0xdda2('0x81')]['basename']=_0x4444b4[_0xdda2('0xdf')][_0xdda2('0xe0')];_0x4444b4[_0xdda2('0x81')][_0xdda2('0x4b')]=_0x4444b4[_0xdda2('0xdf')][_0xdda2('0xe1')];return db['Attachment'][_0xdda2('0xc2')](_0x4444b4['body'])[_0xdda2('0x22')](respondWithResult(_0x2279f8,0xc9))[_0xdda2('0x2c')](handleError(_0x2279f8,null));};exports[_0xdda2('0xe2')]=function(_0x245ab5,_0x1001ce,_0x343795){return db[_0xdda2('0x48')][_0xdda2('0xc4')]({'where':{'id':_0x245ab5[_0xdda2('0xbf')]['id']},'raw':!![]})[_0xdda2('0x22')](handleEntityNotFound(_0x1001ce,null))[_0xdda2('0x22')](function(_0x3fb6a2){if(_0x3fb6a2){if(_0x3fb6a2[_0xdda2('0xe3')]){return _0x1001ce[_0xdda2('0x2f')](0x193)[_0xdda2('0x30')]({'status':0x193,'message':_0xdda2('0xe4')});}return db['Attachment'][_0xdda2('0xc4')]({'where':{'id':_0x245ab5[_0xdda2('0x4f')][_0xdda2('0xe5')]},'raw':!![]})[_0xdda2('0x22')](handleEntityNotFound(_0x1001ce,null));}})[_0xdda2('0x22')](function(_0xb42ead){if(_0xb42ead){var _0x29aa4e=_0xb42ead[_0xdda2('0xe6')]!==null;var _0xb38883=path[_0xdda2('0xe7')](config['root'],'server/files/attachments/');if(_0x29aa4e){_0xb38883=path['join'](_0xb38883,_0xdda2('0xe8'));}var _0x447793=path['join'](_0xb38883,_0xb42ead[_0xdda2('0xe9')]);return _0x1001ce[_0xdda2('0xea')](_0x447793);}})[_0xdda2('0x2c')](handleError(_0x1001ce,null));};exports[_0xdda2('0xeb')]=function(_0x105176,_0x1b4d6c){var _0x4aecf6=null;var _0x11d373=null;var _0x5898cf=null;var _0x319929=null;if(_0x105176[_0xdda2('0x81')]['id']){delete _0x105176[_0xdda2('0x81')]['id'];}if(_0x105176['body'][_0xdda2('0xec')]){_0x319929=path[_0xdda2('0xe7')](config[_0xdda2('0xed')],_0xdda2('0xee'),util['format'](_0xdda2('0xef'),Date[_0xdda2('0xf0')]()));_0x105176[_0xdda2('0x81')][_0xdda2('0xf1')]=_0x319929;}return db[_0xdda2('0x48')]['find']({'where':{'id':_0x105176[_0xdda2('0xbf')]['id']},'include':[{'model':db['ChatMessage'],'as':_0xdda2('0xf2'),'include':[{'model':db[_0xdda2('0x7f')],'as':_0xdda2('0x7f')}]}]})['then'](handleEntityNotFound(_0x1b4d6c,null))[_0xdda2('0x22')](saveUpdates(_0x105176[_0xdda2('0x81')],null))[_0xdda2('0x22')](function(_0x1894fc){if(_0x1894fc){_0x4aecf6=_0x1894fc;return db[_0xdda2('0xf3')][_0xdda2('0x6e')]({'where':{'id':_0x4aecf6[_0xdda2('0xc5')]}});}})[_0xdda2('0x22')](function(_0x469635){if(_0x469635){_0x5898cf=_0x469635;return db[_0xdda2('0xda')][_0xdda2('0x6e')]({'where':{'id':_0x4aecf6[_0xdda2('0x7a')]}});}})[_0xdda2('0x22')](function(_0x1d2039){if(_0x1d2039){_0x11d373=_0x1d2039;if(_0x319929){var _0xee0164=null;for(var _0x58fa2a=0x1;_0x58fa2a<_0x4aecf6[_0xdda2('0xf2')]['length'];++_0x58fa2a){_0xee0164=_0x4aecf6[_0xdda2('0xf2')][_0x58fa2a];var _0xbe4ca=_0xee0164['UserId']?util[_0xdda2('0xf4')](_0xdda2('0xf5'),_0x5898cf[_0xdda2('0xf6')],_0xee0164['UserId']):'System';var _0x5c88b4=_0x105176[_0xdda2('0x81')][_0xdda2('0xf7')]||util[_0xdda2('0xf4')]('%s%d',_0xdda2('0xf8'),_0xee0164[_0xdda2('0x7a')]);switch(_0x5898cf['agentIdentifier']){case _0xdda2('0xf9'):_0xbe4ca=_0xee0164[_0xdda2('0xfa')]?util[_0xdda2('0xf4')]('%s%d',_0x5898cf[_0xdda2('0xf6')],_0xee0164[_0xdda2('0xfa')]):_0xdda2('0xfb');break;case _0xdda2('0xfc'):_0xbe4ca=_0xee0164[_0xdda2('0xfa')]?_0xee0164['User'][_0xdda2('0xfd')]||_0xee0164['User'][_0xdda2('0xc9')]:_0xdda2('0xfb');break;case _0xdda2('0xfe'):_0xbe4ca=_0xee0164['UserId']?_0xee0164['User'][_0xdda2('0xc9')]:_0xdda2('0xfb');break;default:_0xbe4ca=_0xee0164[_0xdda2('0xfa')]?util[_0xdda2('0xf4')](_0xdda2('0xf5'),_0x5898cf[_0xdda2('0xf6')],_0xee0164[_0xdda2('0xfa')]):'System';}var _0x2506bb=util[_0xdda2('0xf4')]('[%s]\x20%s:\x20%s\x0a',moment(_0xee0164[_0xdda2('0x87')])[_0xdda2('0xf4')](_0xdda2('0xff')),_0xee0164[_0xdda2('0x100')]==='in'?_0x5c88b4:_0xbe4ca,_0xee0164[_0xdda2('0x81')]);if(!_0xee0164['secret']){fs[_0xdda2('0x101')](_0x319929,_0x2506bb);}}return db[_0xdda2('0x102')][_0xdda2('0xc4')]({'where':{'service':!![]},'include':[{'model':db[_0xdda2('0x103')],'as':_0xdda2('0x104'),'raw':!![]}]});}}})['then'](function(_0x4dcc77){if(_0x4dcc77&&_0x4dcc77[_0xdda2('0x104')]&&_0x105176[_0xdda2('0x81')]){var _0xbcc6b9={'tls':{'rejectUnauthorized':![]}};if(_0x4dcc77[_0xdda2('0x104')]['service']){_0xbcc6b9['service']=_0x4dcc77[_0xdda2('0x104')][_0xdda2('0x105')];}else{_0xbcc6b9[_0xdda2('0x106')]=_0x4dcc77[_0xdda2('0x104')][_0xdda2('0x106')];_0xbcc6b9[_0xdda2('0x107')]=_0x4dcc77[_0xdda2('0x104')]['port'];_0xbcc6b9['secure']=_0x4dcc77[_0xdda2('0x104')][_0xdda2('0x108')];}if(_0x4dcc77['Smtp'][_0xdda2('0x109')]){_0xbcc6b9[_0xdda2('0x10a')]={'user':_0x4dcc77[_0xdda2('0x104')][_0xdda2('0xa2')],'pass':_0x4dcc77['Smtp'][_0xdda2('0x10b')]};}return respondWithRpcPromise(_0xdda2('0x10c'),_0xdda2('0x10d'),{'account':_0xbcc6b9,'message':{'from':util[_0xdda2('0xf4')]('\x22%s\x22\x20<%s>',_0x4dcc77[_0xdda2('0x3a')],_0x4dcc77['email']||_0x4dcc77['Smtp']['user']),'to':_0x105176[_0xdda2('0x81')][_0xdda2('0xec')],'subject':_0xdda2('0x10e'),'text':util[_0xdda2('0xf4')](_0xdda2('0x10f'),_0x105176['body'][_0xdda2('0xec')]),'attachments':[{'path':_0x319929}]}})[_0xdda2('0x22')](function(){return _0x4aecf6;})['catch'](function(_0x202a23){console[_0xdda2('0x29')](_0x202a23);});}else{return _0x4aecf6;}})[_0xdda2('0x22')](respondWithStatusCode(_0x1b4d6c,0xc8))[_0xdda2('0x2c')](handleError(_0x1b4d6c,null));};exports[_0xdda2('0x110')]=function(_0x12a7f4,_0x62b26e,_0x642b33){return db['ChatMessage']['find']({'where':{'id':_0x12a7f4[_0xdda2('0xbf')]['id']}})[_0xdda2('0x22')](handleEntityNotFound(_0x62b26e,null))[_0xdda2('0x22')](function(_0x2139ff){if(_0x2139ff){return _0x2139ff[_0xdda2('0x110')](_0x12a7f4[_0xdda2('0x81')][_0xdda2('0x111')],_[_0xdda2('0x112')](_0x12a7f4[_0xdda2('0x81')],[_0xdda2('0x111'),'id'])||{});}})[_0xdda2('0x22')](respondWithResult(_0x62b26e,null))['catch'](handleError(_0x62b26e,null));};exports[_0xdda2('0x113')]=function(_0x3da9e4,_0x5fa59e,_0x6280b0){var _0x228f40={'raw':![],'where':{}};var _0x27ff5d={};var _0x325be9={'count':0x0,'rows':[]};return db['ChatInteraction'][_0xdda2('0xc4')]({'where':{'id':_0x3da9e4[_0xdda2('0xbf')]['id']}})[_0xdda2('0x22')](handleEntityNotFound(_0x5fa59e,null))[_0xdda2('0x22')](function(_0x11db0f){if(_0x11db0f){_0x27ff5d['model']=_[_0xdda2('0x4e')](db[_0xdda2('0xd8')][_0xdda2('0x49')]);_0x27ff5d[_0xdda2('0x4f')]=_[_0xdda2('0x4e')](_0x3da9e4['query']);_0x27ff5d[_0xdda2('0x56')]=_['intersection'](_0x27ff5d['model'],_0x27ff5d[_0xdda2('0x4f')]);_0x228f40['attributes']=_[_0xdda2('0x50')](_0x27ff5d[_0xdda2('0x4d')],qs[_0xdda2('0x51')](_0x3da9e4[_0xdda2('0x4f')][_0xdda2('0x51')]));_0x228f40[_0xdda2('0x52')]=_0x228f40[_0xdda2('0x52')][_0xdda2('0x6d')]?_0x228f40[_0xdda2('0x52')]:_0x27ff5d[_0xdda2('0x4d')];if(!_0x3da9e4[_0xdda2('0x4f')][_0xdda2('0x114')](_0xdda2('0x53'))){_0x228f40[_0xdda2('0x33')]=qs[_0xdda2('0x33')](_0x3da9e4[_0xdda2('0x4f')]['limit']);_0x228f40['offset']=qs[_0xdda2('0x31')](_0x3da9e4[_0xdda2('0x4f')]['offset']);}_0x228f40[_0xdda2('0x54')]=qs[_0xdda2('0x55')](_0x3da9e4[_0xdda2('0x4f')]['sort']);_0x228f40['where']=qs[_0xdda2('0x56')](_[_0xdda2('0x57')](_0x3da9e4['query'],_0x27ff5d[_0xdda2('0x56')]));_0x228f40[_0xdda2('0x84')][_0xdda2('0xbc')]=_0x11db0f['id'];if(_0x3da9e4[_0xdda2('0x4f')][_0xdda2('0x92')]){_0x228f40[_0xdda2('0x84')]=_[_0xdda2('0x3d')](_0x228f40[_0xdda2('0x84')],{'$or':_[_0xdda2('0x42')](_0x228f40[_0xdda2('0x52')],function(_0x39a334){var _0xeedb00={};_0xeedb00[_0x39a334]={'$like':'%'+_0x3da9e4['query'][_0xdda2('0x92')]+'%'};return _0xeedb00;})});}if(_0x3da9e4['query']['$gte']){var _0x27765b=_0x3da9e4[_0xdda2('0x4f')][_0xdda2('0x89')][_0xdda2('0x44')](',');var _0x4d288d={};_0x4d288d[_0x27765b[0x0]]={'$gte':moment(_0x27765b[0x1])[_0xdda2('0xf4')](_0xdda2('0x115'))};_0x228f40[_0xdda2('0x84')]=_[_0xdda2('0x3d')](_0x228f40['where'],_0x4d288d);}_0x228f40=_['merge']({},_0x228f40,_0x3da9e4[_0xdda2('0xc1')]);return db[_0xdda2('0xd8')][_0xdda2('0x34')]({'where':_0x228f40[_0xdda2('0x84')]})[_0xdda2('0x22')](function(_0x1f8f48){_0x325be9[_0xdda2('0x34')]=_0x1f8f48;if(_0x3da9e4[_0xdda2('0x4f')][_0xdda2('0x116')]){_0x228f40[_0xdda2('0xc0')]=[{'all':!![]}];}return db[_0xdda2('0xd8')]['findAll'](_0x228f40);})[_0xdda2('0x22')](function(_0x4dbada){_0x325be9[_0xdda2('0x117')]=_0x4dbada;return _0x325be9;});}})['then'](respondWithFilteredResult(_0x5fa59e,_0x228f40))[_0xdda2('0x2c')](handleError(_0x5fa59e,null));};exports[_0xdda2('0x118')]=function(_0x25650a,_0x3410ec,_0x59441d){var _0x4948ae={'where':{}},_0x472860={},_0x32564c={'count':0x0,'rows':[]};return db[_0xdda2('0x48')][_0xdda2('0xc4')]({'where':{'id':_0x25650a['params']['id']}})[_0xdda2('0x22')](handleEntityNotFound(_0x3410ec,null))[_0xdda2('0x22')](function(_0x316316){if(_0x316316){_0x472860[_0xdda2('0x4d')]=_[_0xdda2('0x4e')](db[_0xdda2('0xd8')][_0xdda2('0x49')]);_0x472860[_0xdda2('0x4f')]=_[_0xdda2('0x4e')](_0x25650a[_0xdda2('0x4f')]);_0x472860[_0xdda2('0x56')]=_[_0xdda2('0x50')](_0x472860[_0xdda2('0x4d')],_0x472860[_0xdda2('0x4f')]);_0x4948ae['attributes']=_[_0xdda2('0x50')](_0x472860[_0xdda2('0x4d')],qs['fields'](_0x25650a[_0xdda2('0x4f')][_0xdda2('0x51')]));_0x4948ae[_0xdda2('0x52')]=_0x4948ae[_0xdda2('0x52')][_0xdda2('0x6d')]?_0x4948ae[_0xdda2('0x52')]:_0x472860['model'];if(!_0x25650a[_0xdda2('0x4f')][_0xdda2('0x114')](_0xdda2('0x53'))){_0x4948ae['limit']=qs[_0xdda2('0x33')](_0x25650a[_0xdda2('0x4f')][_0xdda2('0x33')]);_0x4948ae[_0xdda2('0x31')]=qs['offset'](_0x25650a['query']['offset']);}_0x4948ae[_0xdda2('0x54')]=qs[_0xdda2('0x55')](_0x25650a[_0xdda2('0x4f')][_0xdda2('0x55')]);_0x4948ae['where']=qs[_0xdda2('0x56')](_[_0xdda2('0x57')](_0x25650a['query'],_0x472860[_0xdda2('0x56')]));_0x4948ae[_0xdda2('0x84')]['ChatInteractionId']=_0x316316['id'];if(_0x25650a[_0xdda2('0x4f')]['filter']){_0x4948ae[_0xdda2('0x84')]=_[_0xdda2('0x3d')](_0x4948ae['where'],{'$or':_[_0xdda2('0x42')](_0x4948ae[_0xdda2('0x52')],function(_0x57cf2b){var _0x30e01c={};_0x30e01c[_0x57cf2b]={'$like':'%'+_0x25650a[_0xdda2('0x4f')]['filter']+'%'};return _0x30e01c;})});}_0x4948ae[_0xdda2('0x84')]['secret']=![];if(_0x25650a[_0xdda2('0x4f')]['id']){_0x4948ae[_0xdda2('0x84')]['id']={'$gt':_0x25650a[_0xdda2('0x4f')]['id']};}_0x4948ae=_[_0xdda2('0x3d')]({},_0x4948ae,_0x25650a[_0xdda2('0xc1')]);return db[_0xdda2('0xd8')][_0xdda2('0x34')]({'where':_0x4948ae[_0xdda2('0x84')]})['then'](function(_0x5343eb){_0x32564c[_0xdda2('0x34')]=_0x5343eb;_0x4948ae['include']=[];if(_0x25650a[_0xdda2('0x4f')]['includeAgent']){_0x4948ae['include'][_0xdda2('0xbd')]({'model':db[_0xdda2('0x7f')],'as':_0xdda2('0x7f'),'attributes':['id',_0xdda2('0xc9'),_0xdda2('0xfd')]});}if(_0x25650a[_0xdda2('0x4f')][_0xdda2('0x116')]){_0x4948ae[_0xdda2('0xc0')]=[{'all':!![]}];}return db['ChatMessage']['findAll'](_0x4948ae);})[_0xdda2('0x22')](function(_0x1eb2df){_0x32564c[_0xdda2('0x117')]=_0x1eb2df;return _0x32564c;});}})[_0xdda2('0x22')](respondWithFilteredResult(_0x3410ec,_0x4948ae))[_0xdda2('0x2c')](handleError(_0x3410ec,null));};exports[_0xdda2('0x119')]=function(_0x198e16,_0x12d2a9,_0xc6dbe4){return db[_0xdda2('0x48')][_0xdda2('0x6e')]({'where':{'id':_0x198e16[_0xdda2('0xbf')]['id']}})[_0xdda2('0x22')](handleEntityNotFound(_0x12d2a9,null))['then'](function(_0xaabf31){if(_0xaabf31){return _0xaabf31[_0xdda2('0x11a')](_0x198e16[_0xdda2('0x81')][_0xdda2('0x111')],_[_0xdda2('0x112')](_0x198e16[_0xdda2('0x81')],[_0xdda2('0x111'),'id'])||{})['spread'](function(){return db[_0xdda2('0x7c')][_0xdda2('0x11b')]({'attributes':['id',_0xdda2('0x3a'),_0xdda2('0x59')],'where':{'id':_0x198e16[_0xdda2('0x81')][_0xdda2('0x111')]}});})[_0xdda2('0x22')](function(_0x39b18f){socket['emit'](_0xdda2('0x11c'),{'id':Number(_0x198e16['params']['id']),'tags':_0x39b18f||[]});return{'id':Number(_0x198e16['params']['id']),'tags':_0x39b18f||[]};});}})[_0xdda2('0x22')](respondWithResult(_0x12d2a9,null))[_0xdda2('0x2c')](handleError(_0x12d2a9,null));};exports[_0xdda2('0x11d')]=function(_0xa13c22,_0x3b8dca,_0x1bbd6e){return db[_0xdda2('0x48')][_0xdda2('0x6e')]({'where':{'id':_0xa13c22['params']['id']}})[_0xdda2('0x22')](handleEntityNotFound(_0x3b8dca,null))['then'](function(_0x4e85b0){if(_0x4e85b0){return _0x4e85b0[_0xdda2('0x11d')](_0xa13c22[_0xdda2('0x4f')][_0xdda2('0x111')]);}})[_0xdda2('0x22')](respondWithStatusCode(_0x3b8dca,null))[_0xdda2('0x2c')](handleError(_0x3b8dca,null));};exports['download']=function(_0x18d90c,_0xeae3c3){var _0x47a929=moment()[_0xdda2('0x11e')]()[_0xdda2('0xa6')]();var _0x1ebdd0=path[_0xdda2('0xe7')](config[_0xdda2('0xed')],_0xdda2('0x11f'),'files',_0xdda2('0x120'));var _0x5496df=path[_0xdda2('0xe7')](config[_0xdda2('0xed')],'server',_0xdda2('0x121'),_0xdda2('0x122'));var _0x5671bf=path['join'](_0x1ebdd0,_0x47a929);var _0x35cdcd=util['format']('transcript-%d-%s.zip',_0x18d90c['params']['id'],_0x47a929);var _0xc13cd3=path[_0xdda2('0xe7')](_0x1ebdd0,_0x35cdcd);var _0x20f56f=[];_0x20f56f[_0xdda2('0xbd')]({'model':db[_0xdda2('0x7f')],'as':'User','attributes':['id',_0xdda2('0xc9')],'raw':!![]});_0x20f56f[_0xdda2('0xbd')]({'model':db[_0xdda2('0xda')],'as':_0xdda2('0x74'),'attributes':['id',_0xdda2('0x123'),_0xdda2('0x124')],'raw':!![]});if(_0x18d90c[_0xdda2('0x4f')]['attachments']){_0x20f56f['push']({'model':db[_0xdda2('0x125')],'as':_0xdda2('0x125'),'raw':!![]});}var _0x749b15=[{'model':db[_0xdda2('0xd8')],'as':_0xdda2('0xf2'),'attributes':['id',_0xdda2('0x81'),_0xdda2('0x87'),_0xdda2('0x100'),'secret','read'],'include':_0x20f56f}];_0x749b15['push']({'model':db[_0xdda2('0xf3')],'as':_0xdda2('0x126'),'attributes':['id',_0xdda2('0x3a')]});_0x749b15[_0xdda2('0xbd')]({'model':db[_0xdda2('0x7f')],'as':_0xdda2('0x127'),'attributes':['id','fullname']});return db[_0xdda2('0x48')][_0xdda2('0x6e')]({'where':{'id':_0x18d90c['params']['id']},'include':_0x749b15})[_0xdda2('0x22')](handleEntityNotFound(_0xeae3c3,null))[_0xdda2('0x22')](function(_0x50b325){if(_0x50b325){var _0x35ea7f=_0x50b325[_0xdda2('0x128')]({'plain':!![]});fs['mkdirSync'](_0x5671bf);var _0x10719d={'channel':_0xdda2('0x129'),'account':_0x35ea7f[_0xdda2('0x126')]['name'],'agent':_0x35ea7f[_0xdda2('0x127')]?_0x35ea7f[_0xdda2('0x127')][_0xdda2('0xc9')]:_0xdda2('0x12a'),'createdAt':moment(_0x35ea7f[_0xdda2('0x87')])[_0xdda2('0xf4')]('YYYY-MM-DD\x20HH:mm:ss')[_0xdda2('0xa6')](),'closedAt':_0x35ea7f[_0xdda2('0xe3')]?moment(_0x35ea7f['closedAt'])[_0xdda2('0xf4')](_0xdda2('0x115'))['toString']():'','disposition':_0x35ea7f[_0xdda2('0xdd')],'chatInfo':{'browser':_0x35ea7f[_0xdda2('0x12b')],'os':_0x35ea7f[_0xdda2('0x12c')],'referer':_0x35ea7f[_0xdda2('0x12d')],'customerIp':_0x35ea7f[_0xdda2('0x12e')],'customerPort':_0x35ea7f[_0xdda2('0x12f')]?_0x35ea7f[_0xdda2('0x12f')]:_0xdda2('0x12a')},'messages':_(_0x35ea7f[_0xdda2('0xf2')])[_0xdda2('0x130')]()[_0xdda2('0x92')]({'secret':![]})[_0xdda2('0x42')](function(_0x57f1ad){if(_0x57f1ad[_0xdda2('0x125')]){var _0x8fa72e=path[_0xdda2('0xe7')](_0x5496df,_0x57f1ad['Attachment']['basename']);if(fs[_0xdda2('0x131')](_0x8fa72e)){fs[_0xdda2('0x132')](_0x8fa72e)['pipe'](fs['createWriteStream'](path[_0xdda2('0xe7')](_0x5671bf,_0x57f1ad['Attachment'][_0xdda2('0xe9')])));}}return{'date':moment(_0x57f1ad[_0xdda2('0x87')])['format'](_0xdda2('0x115'))[_0xdda2('0xa6')](),'sender':_0x57f1ad[_0xdda2('0x100')]===_0xdda2('0xd7')?_0x57f1ad[_0xdda2('0x7f')]?_0x57f1ad[_0xdda2('0x7f')]['fullname']:'System':_0x57f1ad[_0xdda2('0x74')][_0xdda2('0x123')]+(_0x57f1ad[_0xdda2('0x74')][_0xdda2('0x124')]?'\x20'+_0x57f1ad[_0xdda2('0x74')][_0xdda2('0x124')]:''),'body':_0x57f1ad[_0xdda2('0x125')]?_0x57f1ad[_0xdda2('0x125')][_0xdda2('0xe9')]:_0x57f1ad[_0xdda2('0x81')],'direction':_0x57f1ad[_0xdda2('0x100')]===_0xdda2('0xd7')?'A':'C','secret':_0x57f1ad['secret'],'read':_0x57f1ad[_0xdda2('0x8d')],'attachment':_0x57f1ad[_0xdda2('0x125')]};})['value']()};return ejs[_0xdda2('0x133')](path['join'](config[_0xdda2('0xed')],_0xdda2('0x11f'),_0xdda2('0x134'),_0xdda2('0x135')),{'interaction':_0x10719d})[_0xdda2('0x22')](function(_0x3d8f28){var _0x1826a9=path['join'](_0x5671bf,'transcript-'+_0x35ea7f['id']+'-'+_0x47a929+_0xdda2('0x136'));var _0x20b702={'path':_0x1826a9,'channel':_0xdda2('0x129'),'interactionId':_0x35ea7f['id']};return pdf[_0xdda2('0x137')](_0x3d8f28,_0x20b702);})[_0xdda2('0x22')](function(){return new BPromise(function(_0xf9ca6e,_0x3eb4b7){zipdir(_0x5671bf,{'saveTo':_0xc13cd3},function(_0x5eb398,_0x315585){if(_0x5eb398)return _0x3eb4b7(_0x5eb398);return _0xf9ca6e(_0x315585);});})['then'](function(){return new BPromise(function(_0x4f20d3,_0x1685e4){rimraf(_0x5671bf,function(_0x5dbd5d){if(_0x5dbd5d)_0x1685e4(_0x5dbd5d);return _0x4f20d3();});});})['then'](function(){return _0xeae3c3['download'](_0xc13cd3,_0x35cdcd,function(_0x43c68a){if(_0x43c68a){console['log'](_0xdda2('0x138'),_0x43c68a);}else{fs[_0xdda2('0x139')](_0xc13cd3);}});});});}else{return _0xeae3c3['sendStatus'](0xc8);}})[_0xdda2('0x2c')](handleError(_0xeae3c3,null));};
\ No newline at end of file
+var _0x087b=['jayson/promise','client','http','request','then','info','request\x20sent','debug','ChatInteraction,\x20%s,\x20%s,\x20%s','error','ChatInteraction,\x20%s,\x20%s','message','result','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','destroy','name','render','body','contact','agent','interaction','Users','map','fullname','TagIds','Tags','split','forEach','index','ChatInteraction','fieldName','type','key','model','query','intersection','attributes','fields','length','hasOwnProperty','order','sort','pick','filters','select','field','color','from','u.id','u.fullname','ui.ChatInteractionId','user_has_chat_interactions','left_join','users','u.id\x20=\x20ui.UserId','c.id\x20=\x20i.ContactId\x20AND\x20c.deletedAt\x20IS\x20NULL','o.id\x20=\x20i.UserId','chat_websites','a.id\x20=\x20i.ChatWebsiteId','chat_messages','me.ChatInteractionId\x20=\x20i.id','chat_interaction_has_tags','it.ChatInteractionId\x20=\x20i.id','tools_tags','t.id\x20=\x20it.TagId','expr','search','parseSearch','sqlOperator','conditions','find','unreadMessages','value','`\x20=\x200','having','`\x20>\x200','$substring','getFullTextValue','c.firstName\x20LIKE\x20?\x20OR\x20c.lastName\x20LIKE\x20?\x20OR\x20c.email\x20LIKE\x20?','ContactId','text','start','union','User','operator','CONCAT_WS(\x27\x20\x27,\x20o.name,\x20o.fullname)\x20LIKE\x20?','UserId','buildExpression','keys','compact','isEmpty','ChatWebsiteId','concat','createdAt','parse','$gte','null','where','\x20IS\x20NULL','\x20=\x20?','read','`unreadMessages`\x20=\x200','tag','isArray','CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','replace','isNumeric','i.id\x20LIKE\x20?','MATCH\x20(me.body)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','group','i.id','Sequelize','QueryTypes','SELECT','clone','SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)','contactName','t.id\x20IN\x20?','resolve','i.ChatWebsiteId\x20IS\x20NOT\x20NULL','user','role','getChatWebsites','i.ChatWebsiteId\x20IS\x20NULL','i.ChatWebsiteId\x20IN\x20?','sequelize','toString','keyBy','merge','a.key','Account.key','a.mandatoryDisposition','Account.mandatoryDisposition','i.*','Contact.firstName','c.lastName','c.email','Contact.email','Contact.phone','Contact.fax','o.fullname','Owner.fullname','o.internal','Owner.internal','GROUP_CONCAT(DISTINCT\x20t.id)','ui.ChatInteractionId\x20IN\x20?','groupBy','ChatInteractionId','push','all','show','params','rawAttributes','include','options','catch','create','describe','ChatWebsite','findOne','vidaooEscalation','vidaooTopic','vidaooNote','vidaooMetadata','vidaooApiKey','email','POST','https://api-vidaoo.xcally.com/api/v1/meetings','isNull','metadata','ValidationError','Error\x20in\x20conversion\x20vidaooMetadata','Error\x20in\x20Vidaoo\x20configuration','join_url','ChatMessage','updateAttributes','CmContact','Contact','abandonInteraction,\x20%s,\x20%s,\x20%s','abandon','entity\x20not\x20found','disposition','file','filename','attachmentDownload','closed','Unauthorized','Attachment','attachId','ChatOfflineMessageId','join','root','offline-chat/','basename','download','close','mailTranscript','server/files/chat/upload/','format','transcript-%s.txt','now','pathTranscript','Messages','%s%d','agentAlias','System','customer','Visitor','website_alias','agent_alias','alias','agent_fullname','[%s]\x20%s:\x20%s\x0a','MM/DD/YYYY\x20HH:mm:ss','direction','secret','MailAccount','MailServerOut','Smtp','service','host','port','secure','authentication','auth','SendMail','sendMail','\x22%s\x22\x20<%s>','Mail\x20Transcript','Hi\x20%s,\x20attached\x20you\x20can\x20find\x20your\x20transcript\x20file.\x20\x0a\x0aRegards.\x20\x0a\x0a','addMessage','omit','ids','getMessages','nolimit','filter','findAll','rows','getMyMessages','includeAll','addTags','setTags','chatInteractionTags:save','removeTags','unix','files','server','attachments','transcript-%d-%s.zip','firstName','Account','Owner','YYYY-MM-DD\x20HH:mm:ss','referer','customerIp','customerPort','N.A.','tail','existsSync','pipe','createWriteStream','out','lastName','downloadInteraction.ejs','transcript-','.pdf','log','err','unlinkSync','eml-format','rimraf','request-promise','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../components/export/pdf','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','redis','localhost','socket.io-emitter','./chatInteraction.socket','register'];(function(_0x4feb9c,_0x19a66b){var _0x341ce3=function(_0x32aba6){while(--_0x32aba6){_0x4feb9c['push'](_0x4feb9c['shift']());}};_0x341ce3(++_0x19a66b);}(_0x087b,0x11a));var _0xb087=function(_0x4ed520,_0x21be63){_0x4ed520=_0x4ed520-0x0;var _0x4415a6=_0x087b[_0x4ed520];return _0x4415a6;};'use strict';var emlformat=require(_0xb087('0x0'));var rimraf=require(_0xb087('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0xb087('0x2'));var moment=require('moment');var BPromise=require(_0xb087('0x3'));var Mustache=require(_0xb087('0x4'));var util=require(_0xb087('0x5'));var path=require(_0xb087('0x6'));var sox=require(_0xb087('0x7'));var csv=require(_0xb087('0x8'));var ejs=require(_0xb087('0x9'));var fs=require('fs');var fs_extra=require(_0xb087('0xa'));var _=require(_0xb087('0xb'));var squel=require(_0xb087('0xc'));var crypto=require(_0xb087('0xd'));var jsforce=require(_0xb087('0xe'));var deskjs=require(_0xb087('0xf'));var toCsv=require(_0xb087('0x8'));var querystring=require(_0xb087('0x10'));var Papa=require(_0xb087('0x11'));var Redis=require(_0xb087('0x12'));var authService=require('../../components/auth/service');var qs=require(_0xb087('0x13'));var as=require(_0xb087('0x14'));var pdf=require(_0xb087('0x15'));var hardwareService=require(_0xb087('0x16'));var logger=require(_0xb087('0x17'))(_0xb087('0x18'));var utils=require(_0xb087('0x19'));var config=require('../../config/environment');var licenseUtil=require(_0xb087('0x1a'));var db=require(_0xb087('0x1b'))['db'];config[_0xb087('0x1c')]=_['defaults'](config[_0xb087('0x1c')],{'host':_0xb087('0x1d'),'port':0x18eb});var socket=require(_0xb087('0x1e'))(new Redis(config[_0xb087('0x1c')]));require(_0xb087('0x1f'))[_0xb087('0x20')](socket);var jayson=require(_0xb087('0x21'));var client=jayson[_0xb087('0x22')][_0xb087('0x23')]({'port':0x232b});var client9004=jayson[_0xb087('0x22')]['http']({'port':0x232c});function respondWithRpcPromise(_0x43e576,_0x412b48,_0x597478,_0xcc4426){return new BPromise(function(_0x2b83b7,_0x2e9e74){var _0x5bb80b=_0xcc4426||client;return _0x5bb80b[_0xb087('0x24')](_0x43e576,_0x597478)[_0xb087('0x25')](function(_0x17200d){logger[_0xb087('0x26')]('ChatInteraction,\x20%s,\x20%s',_0x412b48,_0xb087('0x27'));logger[_0xb087('0x28')](_0xb087('0x29'),_0x412b48,_0xb087('0x27'),JSON['stringify'](_0x17200d));if(_0x17200d['error']){if(_0x17200d['error']['code']===0x1f4){logger[_0xb087('0x2a')](_0xb087('0x2b'),_0x412b48,_0x17200d[_0xb087('0x2a')][_0xb087('0x2c')]);return _0x2e9e74(_0x17200d[_0xb087('0x2a')][_0xb087('0x2c')]);}logger[_0xb087('0x2a')]('ChatInteraction,\x20%s,\x20%s',_0x412b48,_0x17200d[_0xb087('0x2a')][_0xb087('0x2c')]);return _0x2b83b7(_0x17200d[_0xb087('0x2a')][_0xb087('0x2c')]);}else{logger[_0xb087('0x26')]('ChatInteraction,\x20%s,\x20%s',_0x412b48,_0xb087('0x27'));_0x2b83b7(_0x17200d[_0xb087('0x2d')]['message']);}})['catch'](function(_0x50745a){logger['error']('ChatInteraction,\x20%s,\x20%s',_0x412b48,_0x50745a);_0x2e9e74(_0x50745a);});});}function respondWithStatusCode(_0x304840,_0x45685d){_0x45685d=_0x45685d||0xcc;return function(_0x1d124f){if(_0x1d124f){return _0x304840[_0xb087('0x2e')](_0x45685d);}return _0x304840[_0xb087('0x2f')](_0x45685d)[_0xb087('0x30')]();};}function respondWithResult(_0xf3f41f,_0x35a52c){_0x35a52c=_0x35a52c||0xc8;return function(_0x6cfb22){if(_0x6cfb22){return _0xf3f41f[_0xb087('0x2f')](_0x35a52c)[_0xb087('0x31')](_0x6cfb22);}};}function respondWithFilteredResult(_0x31e3e6,_0xb0baf6){return function(_0x263259){if(_0x263259){var _0x593b78=typeof _0xb0baf6[_0xb087('0x32')]===_0xb087('0x33')&&typeof _0xb0baf6[_0xb087('0x34')]===_0xb087('0x33');var _0x22d441=_0x263259[_0xb087('0x35')];var _0x2e1c57=_0x593b78?0x0:_0xb0baf6[_0xb087('0x32')];var _0x53a535=_0x593b78?_0x263259['count']:_0xb0baf6[_0xb087('0x32')]+_0xb0baf6[_0xb087('0x34')];var _0x4cb5a8;if(_0x53a535>=_0x22d441){_0x53a535=_0x22d441;_0x4cb5a8=0xc8;}else{_0x4cb5a8=0xce;}_0x31e3e6[_0xb087('0x2f')](_0x4cb5a8);return _0x31e3e6[_0xb087('0x36')](_0xb087('0x37'),_0x2e1c57+'-'+_0x53a535+'/'+_0x22d441)[_0xb087('0x31')](_0x263259);}return null;};}function patchUpdates(_0x3c61c4){return function(_0x427905){try{jsonpatch[_0xb087('0x38')](_0x427905,_0x3c61c4,!![]);}catch(_0x3b7ace){return BPromise[_0xb087('0x39')](_0x3b7ace);}return _0x427905[_0xb087('0x3a')]();};}function saveUpdates(_0x442a5e,_0x3069b5){return function(_0x57ae94){if(_0x57ae94){return _0x57ae94[_0xb087('0x3b')](_0x442a5e)['then'](function(_0x906987){return _0x906987;});}return null;};}function removeEntity(_0x296e9b,_0x738e68){return function(_0xd0659e){if(_0xd0659e){return _0xd0659e[_0xb087('0x3c')]()[_0xb087('0x25')](function(){_0x296e9b[_0xb087('0x2f')](0xcc)[_0xb087('0x30')]();});}};}function handleEntityNotFound(_0x8a4c3c,_0x521c3f){return function(_0x5814c2){if(!_0x5814c2){_0x8a4c3c[_0xb087('0x2e')](0x194);}return _0x5814c2;};}function handleError(_0x3c4f33,_0x1ce1ef){_0x1ce1ef=_0x1ce1ef||0x1f4;return function(_0x2d2902){logger[_0xb087('0x2a')](_0x2d2902['stack']);if(_0x2d2902[_0xb087('0x3d')]){delete _0x2d2902[_0xb087('0x3d')];}_0x3c4f33['status'](_0x1ce1ef)['send'](_0x2d2902);};}function getMustacheRender(_0x1726c2,_0x1c7d90){return Mustache[_0xb087('0x3e')](_0x1726c2,_['merge'](_0x1c7d90[_0xb087('0x3f')],{'contact':_0x1c7d90[_0xb087('0x40')],'message':_0x1c7d90[_0xb087('0x2c')],'agent':_0x1c7d90[_0xb087('0x41')],'interaction':_0x1c7d90[_0xb087('0x42')],'account':_0x1c7d90['account']}))||'';}function getInteractionUsers(_0x7e1315,_0x5bb6bc){return new BPromise(function(_0x18e23f,_0x5a582d){try{if(_0x5bb6bc[_0x7e1315['id']]){_0x7e1315[_0xb087('0x43')]=_[_0xb087('0x44')](_0x5bb6bc[_0x7e1315['id']],function(_0x513332){return{'id':_0x513332['id'],'fullname':_0x513332[_0xb087('0x45')]};});}}catch(_0x5aa11d){_0x5a582d(_0x5aa11d);}_0x18e23f(_0x7e1315);});}function getInteractionTags(_0x46d12a,_0x4a360c){return new BPromise(function(_0x2d2c74,_0x326934){try{if(_0x46d12a[_0xb087('0x46')]){_0x46d12a[_0xb087('0x47')]=[];_0x46d12a[_0xb087('0x46')][_0xb087('0x48')](',')[_0xb087('0x49')](function(_0x5e7690){_0x46d12a[_0xb087('0x47')]['push'](_0x4a360c[_0x5e7690]);});}delete _0x46d12a[_0xb087('0x46')];}catch(_0x2d71c2){_0x326934(_0x2d71c2);}_0x2d2c74(_0x46d12a);});}function updateChatInteraction(_0x5b6924,_0xb662bf,_0x45dc6f){return new BPromise(function(_0x7650c5,_0x4c33cc){return getInteractionUsers(_0x5b6924,_0x45dc6f)[_0xb087('0x25')](function(_0x4a9ccb){return getInteractionTags(_0x4a9ccb,_0xb662bf);})[_0xb087('0x25')](function(_0x32b9d3){_0x7650c5(_0x32b9d3);})['catch'](function(_0x38cb9d){_0x4c33cc(_0x38cb9d);});});}exports[_0xb087('0x4a')]=function(_0x4addbd,_0x2b969a){var _0x171778={},_0x54eb11={},_0x93ada7={'count':0x0,'rows':[]};var _0x46c713=_[_0xb087('0x44')](db[_0xb087('0x4b')]['rawAttributes'],function(_0x47902e){return{'name':_0x47902e[_0xb087('0x4c')],'type':_0x47902e[_0xb087('0x4d')][_0xb087('0x4e')]};});_0x54eb11[_0xb087('0x4f')]=_[_0xb087('0x44')](_0x46c713,_0xb087('0x3d'));_0x54eb11['query']=_['keys'](_0x4addbd[_0xb087('0x50')]);_0x54eb11['filters']=_[_0xb087('0x51')](_0x54eb11[_0xb087('0x4f')],_0x54eb11[_0xb087('0x50')]);_0x171778[_0xb087('0x52')]=_['intersection'](_0x54eb11[_0xb087('0x4f')],qs['fields'](_0x4addbd[_0xb087('0x50')][_0xb087('0x53')]));_0x171778[_0xb087('0x52')]=_0x171778[_0xb087('0x52')][_0xb087('0x54')]?_0x171778['attributes']:_0x54eb11[_0xb087('0x4f')];if(!_0x4addbd[_0xb087('0x50')][_0xb087('0x55')]('nolimit')){_0x171778[_0xb087('0x34')]=qs['limit'](_0x4addbd['query'][_0xb087('0x34')]);_0x171778[_0xb087('0x32')]=qs['offset'](_0x4addbd[_0xb087('0x50')][_0xb087('0x32')]);}_0x171778[_0xb087('0x56')]=qs['sort'](_0x4addbd['query'][_0xb087('0x57')]);_0x171778['where']=qs['filters'](_[_0xb087('0x58')](_0x4addbd[_0xb087('0x50')],_0x54eb11[_0xb087('0x59')]),_0x46c713);var _0x4067cf=[];var _0x2bf92f=squel[_0xb087('0x5a')]()[_0xb087('0x5b')]('id')[_0xb087('0x5b')](_0xb087('0x3d'))[_0xb087('0x5b')](_0xb087('0x5c'))[_0xb087('0x5d')]('tools_tags');var _0x46d570=squel[_0xb087('0x5a')]()['field'](_0xb087('0x5e'))[_0xb087('0x5b')](_0xb087('0x5f'))[_0xb087('0x5b')](_0xb087('0x60'))[_0xb087('0x5d')](_0xb087('0x61'),'ui')[_0xb087('0x62')](_0xb087('0x63'),'u',_0xb087('0x64'));var _0x17c6d0=squel['select']()[_0xb087('0x5d')]('chat_interactions','i')[_0xb087('0x62')]('cm_contacts','c',_0xb087('0x65'))[_0xb087('0x62')](_0xb087('0x63'),'o',_0xb087('0x66'))[_0xb087('0x62')](_0xb087('0x67'),'a',_0xb087('0x68'))[_0xb087('0x62')](_0xb087('0x69'),'me',_0xb087('0x6a'))[_0xb087('0x62')](_0xb087('0x6b'),'it',_0xb087('0x6c'))[_0xb087('0x62')](_0xb087('0x6d'),'t',_0xb087('0x6e'));var _0x217f26=squel[_0xb087('0x6f')]();var _0x40ff74=[];var _0xe3cb2=squel[_0xb087('0x6f')]();var _0x459c5b;if(_0x4addbd['query'][_0xb087('0x70')]){_0x459c5b=as[_0xb087('0x71')](_0x4addbd[_0xb087('0x50')]['search']);var _0x4099cc=_0x459c5b[_0xb087('0x72')];for(var _0x5685b1=0x0;_0x5685b1<_0x459c5b[_0xb087('0x73')][_0xb087('0x54')];_0x5685b1++){var _0x2e3a14=_0x459c5b['conditions'][_0x5685b1];var _0x133c58='i';var _0x257894=_[_0xb087('0x74')](_0x46c713,[_0xb087('0x3d'),_0x2e3a14[_0xb087('0x5b')]]);if(!_0x257894){switch(_0x2e3a14[_0xb087('0x5b')]){case _0xb087('0x75'):if(_0x2e3a14[_0xb087('0x76')]==0x1){_0x17c6d0['having']('`'+_0x2e3a14[_0xb087('0x5b')]+_0xb087('0x77'));}else{_0x17c6d0[_0xb087('0x78')]('`'+_0x2e3a14['field']+_0xb087('0x79'));}break;case'Contact':if(_0x2e3a14['operator']===_0xb087('0x7a')){if(_0x2e3a14[_0xb087('0x76')]['split']('\x20')[_0xb087('0x54')]>0x1){_0x217f26[_0x4099cc]('MATCH\x20(c.firstName,\x20c.lastName,\x20c.phone,\x20c.mobile,\x20c.fax,\x20c.email)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)',qs[_0xb087('0x7b')](_0x2e3a14[_0xb087('0x76')]),null);}else{var _0x5938ad='%'+_0x2e3a14['value']+'%';_0x217f26[_0x4099cc](_0xb087('0x7c'),_0x5938ad,_0x5938ad,_0x5938ad);}}else{_0x257894=_['find'](_0x46c713,['name',_0xb087('0x7d')]);_0x2e3a14['field']=_0xb087('0x7d');_0x390309=as['buildExpression'](_0x133c58,_0x257894[_0xb087('0x4d')],_0x2e3a14);_0x217f26[_0x4099cc](_0x390309[_0xb087('0x7e')],_0x390309[_0xb087('0x76')][_0xb087('0x7f')],_0x390309[_0xb087('0x76')][_0xb087('0x30')]);}break;case'Tag':var _0x200869=_0x2e3a14['value'][_0xb087('0x48')](',')[_0xb087('0x44')](function(_0x1060e1){return Number(_0x1060e1);});_0x200869['forEach'](function(_0x298bbb){_0xe3cb2['or']('CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','%,'+_0x298bbb+',%');});_0x40ff74=_[_0xb087('0x80')](_0x40ff74,_0x200869);break;case _0xb087('0x81'):if(_0x2e3a14[_0xb087('0x82')]===_0xb087('0x7a')){_0x217f26[_0x4099cc](_0xb087('0x83'),'%'+_0x2e3a14[_0xb087('0x76')]+'%',null);}else{_0x257894=_['find'](_0x46c713,[_0xb087('0x3d'),_0xb087('0x84')]);_0x2e3a14['field']=_0xb087('0x84');_0x390309=as['buildExpression'](_0x133c58,_0x257894[_0xb087('0x4d')],_0x2e3a14);_0x217f26[_0x4099cc](_0x390309[_0xb087('0x7e')],_0x390309[_0xb087('0x76')][_0xb087('0x7f')],_0x390309[_0xb087('0x76')][_0xb087('0x30')]);}break;case _0xb087('0x3f'):_0x390309=as[_0xb087('0x85')]('me',null,_0x2e3a14);_0x217f26[_0x4099cc](_0x390309['text'],_0x390309['value']['start'],_0x390309[_0xb087('0x76')]['end']);break;}}else{var _0x390309=as['buildExpression'](_0x133c58,_0x257894[_0xb087('0x4d')],_0x2e3a14);_0x217f26[_0x4099cc](_0x390309[_0xb087('0x7e')],_0x390309[_0xb087('0x76')][_0xb087('0x7f')],_0x390309['value'][_0xb087('0x30')]);}}}else{var _0x53f04a=_(_0x4addbd[_0xb087('0x50')])[_0xb087('0x86')]()[_0xb087('0x44')](function(_0x42f4a3){return _['some'](_0x46c713,['name',_0x42f4a3])?_0x42f4a3:undefined;})[_0xb087('0x87')]()['value']();if(!_[_0xb087('0x88')](_0x53f04a)){_0x53f04a[_0xb087('0x49')](function(_0x2ca987){if(_0x2ca987===_0xb087('0x89')){_0x17c6d0['where']('i.ChatWebsiteId\x20IN\x20?',[][_0xb087('0x8a')](_0x4addbd['query'][_0x2ca987]));}else if(_0x2ca987===_0xb087('0x8b')){var _0x1c7cd7=JSON[_0xb087('0x8c')](_0x4addbd[_0xb087('0x50')][_0x2ca987])[_0xb087('0x8d')];var _0x581ad4=JSON[_0xb087('0x8c')](_0x4addbd[_0xb087('0x50')][_0x2ca987])['$lte'];_0x17c6d0['where']('i.createdAt\x20BETWEEN\x20?\x20AND\x20?',_0x1c7cd7,_0x581ad4);}else{if(_0x4addbd[_0xb087('0x50')][_0x2ca987]===_0xb087('0x8e')){_0x17c6d0[_0xb087('0x8f')]('i.'+_0x2ca987+_0xb087('0x90'));}else{_0x17c6d0[_0xb087('0x8f')]('i.'+_0x2ca987+_0xb087('0x91'),_0x4addbd['query'][_0x2ca987]);}}});}if(_0x4addbd[_0xb087('0x50')][_0xb087('0x92')]){if(_0x4addbd[_0xb087('0x50')][_0xb087('0x92')]==0x1){_0x17c6d0[_0xb087('0x78')](_0xb087('0x93'));}else{_0x17c6d0[_0xb087('0x78')]('`unreadMessages`\x20>\x200');}}if(_0x4addbd[_0xb087('0x50')][_0xb087('0x94')]){_0x40ff74=_[_0xb087('0x95')](_0x4addbd['query'][_0xb087('0x94')])?_0x4addbd['query'][_0xb087('0x94')]:new Array(_0x4addbd[_0xb087('0x50')][_0xb087('0x94')]);_0x40ff74[_0xb087('0x49')](function(_0x463791){_0xe3cb2['or'](_0xb087('0x96'),'%,'+_0x463791+',%');});}if(_0x4addbd['query']['filter']){var _0x1e7a22=_0x4addbd[_0xb087('0x50')]['filter'][_0xb087('0x97')]('\x5c','\x5c\x5c')[_0xb087('0x97')](/'/g,'\x27\x27');if(qs[_0xb087('0x98')](_0x1e7a22)){_0x217f26['or'](_0xb087('0x99'),_0x1e7a22+'%');}else{_0x217f26['or'](_0xb087('0x9a'),qs[_0xb087('0x7b')](_0x1e7a22))['or']('CONCAT(c.firstName,\x20\x27\x20\x27,\x20c.lastName)\x20LIKE\x20?',_0x1e7a22+'%');}}}_0x17c6d0[_0xb087('0x8f')](_0x217f26);_0x17c6d0[_0xb087('0x9b')](_0xb087('0x9c'));var _0x3114ce={'type':db[_0xb087('0x9d')][_0xb087('0x9e')][_0xb087('0x9f')],'raw':!![]};var _0x1fc613=_0x17c6d0[_0xb087('0xa0')]();_0x1fc613['field'](_0xb087('0x9c'));_0x1fc613['field'](_0xb087('0xa1'),_0xb087('0x75'));if(_0x171778['order']){_0x171778[_0xb087('0x56')][_0xb087('0x49')](function(_0x8b1a5b){var _0x2a076b=_0x8b1a5b[0x0]===_0xb087('0xa2')?_0x8b1a5b[0x0]:'i.'+_0x8b1a5b[0x0];_0x17c6d0[_0xb087('0x56')](_0x2a076b,_0x8b1a5b[0x1]==='DESC'?![]:!![]);});}if(!_[_0xb087('0x88')](_0x40ff74)){_0x17c6d0[_0xb087('0x78')](_0xe3cb2);_0x1fc613[_0xb087('0x8f')](_0xb087('0xa3'),_0x40ff74);}BPromise[_0xb087('0xa4')]()['then'](function(){if(!_0x459c5b){if(_0x4addbd[_0xb087('0x50')][_0xb087('0x89')])return;_0x1fc613[_0xb087('0x8f')](_0xb087('0xa5'));_0x17c6d0[_0xb087('0x8f')](_0xb087('0xa5'));return;}if(_0x4addbd[_0xb087('0xa6')][_0xb087('0xa7')]!==_0xb087('0x41'))return;return _0x4addbd[_0xb087('0xa6')][_0xb087('0xa8')]({'attributes':['id'],'raw':!![]})['then'](function(_0x59121a){if(_[_0xb087('0x88')](_0x59121a)){_0x1fc613[_0xb087('0x8f')](_0xb087('0xa9'));_0x17c6d0[_0xb087('0x8f')](_0xb087('0xa9'));}else{_0x1fc613['where'](_0xb087('0xaa'),_[_0xb087('0x44')](_0x59121a,'id'));_0x17c6d0[_0xb087('0x8f')](_0xb087('0xaa'),_[_0xb087('0x44')](_0x59121a,'id'));}});})[_0xb087('0x25')](function(){if(_0x4addbd['user'][_0xb087('0xa7')]==='agent'&&!_0x459c5b&&!_0x4addbd['query'][_0xb087('0x89')])return[];return db[_0xb087('0xab')][_0xb087('0x50')](_0x1fc613[_0xb087('0xac')](),_0x3114ce);})['then'](function(_0x313c9b){_0x93ada7[_0xb087('0x35')]=_0x313c9b['length'];if(_0x93ada7[_0xb087('0x35')]===0x0)return[];return db['sequelize']['query'](_0x2bf92f[_0xb087('0xac')](),_0x3114ce)[_0xb087('0x25')](function(_0x414cb4){_0x4067cf=_[_0xb087('0xad')](_0x414cb4,'id');_0x3114ce=_[_0xb087('0xae')](_0x3114ce,{'model':db['ChatInteraction'],'mapToModel':!![],'raw':!![],'nest':!![]});if(_0x4addbd[_0xb087('0x50')][_0xb087('0x53')]){_0x171778[_0xb087('0x52')][_0xb087('0x49')](function(_0x48e2c6){_0x17c6d0['field']('i.'+_0x48e2c6);});}else{_0x17c6d0['field']('SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)',_0xb087('0x75'));_0x17c6d0[_0xb087('0x5b')](_0xb087('0xaf'),_0xb087('0xb0'));_0x17c6d0[_0xb087('0x5b')](_0xb087('0xb1'),_0xb087('0xb2'));_0x17c6d0['field']('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',_0xb087('0xa2'));_0x17c6d0[_0xb087('0x5b')](_0xb087('0xb3'));_0x17c6d0[_0xb087('0x5b')]('c.firstName',_0xb087('0xb4'));_0x17c6d0['field'](_0xb087('0xb5'),'Contact.lastName');_0x17c6d0[_0xb087('0x5b')](_0xb087('0xb6'),_0xb087('0xb7'));_0x17c6d0[_0xb087('0x5b')]('c.phone',_0xb087('0xb8'));_0x17c6d0['field']('c.mobile','Contact.mobile');_0x17c6d0[_0xb087('0x5b')]('c.fax',_0xb087('0xb9'));_0x17c6d0[_0xb087('0x5b')](_0xb087('0xba'),_0xb087('0xbb'));_0x17c6d0[_0xb087('0x5b')](_0xb087('0xbc'),_0xb087('0xbd'));_0x17c6d0[_0xb087('0x5b')](_0xb087('0xbe'),_0xb087('0x46'));}if(_0x171778[_0xb087('0x34')])_0x17c6d0[_0xb087('0x34')](_0x171778[_0xb087('0x34')]);if(_0x171778[_0xb087('0x32')])_0x17c6d0[_0xb087('0x32')](_0x171778[_0xb087('0x32')]);return db[_0xb087('0xab')][_0xb087('0x50')](_0x17c6d0['toString'](),_0x3114ce);})[_0xb087('0x25')](function(_0x5c2a14){if(_0x5c2a14[_0xb087('0x54')]>0x0)_0x46d570[_0xb087('0x8f')](_0xb087('0xbf'),_[_0xb087('0x44')](_0x5c2a14,'id'));return db[_0xb087('0xab')][_0xb087('0x50')](_0x46d570[_0xb087('0xac')](),_0x3114ce)['then'](function(_0x5103ab){var _0x5194f2=_[_0xb087('0xc0')](_0x5103ab,_0xb087('0xc1'));var _0x3a403f=[];_0x5c2a14[_0xb087('0x49')](function(_0x18b90b){_0x3a403f[_0xb087('0xc2')](updateChatInteraction(_0x18b90b,_0x4067cf,_0x5194f2));});return BPromise[_0xb087('0xc3')](_0x3a403f);});});})[_0xb087('0x25')](function(_0x181c56){_0x93ada7['rows']=_0x181c56;return _0x93ada7;})[_0xb087('0x25')](respondWithFilteredResult(_0x2b969a,_0x171778))['catch'](handleError(_0x2b969a,null));};exports[_0xb087('0xc4')]=function(_0x25910a,_0x597d80){var _0x4c3aef={'raw':![],'where':{'id':_0x25910a[_0xb087('0xc5')]['id']}},_0x2f2597={};_0x2f2597[_0xb087('0x4f')]=_[_0xb087('0x86')](db['ChatInteraction'][_0xb087('0xc6')]);_0x2f2597[_0xb087('0x50')]=_['keys'](_0x25910a['query']);_0x2f2597[_0xb087('0x59')]=_['intersection'](_0x2f2597['model'],_0x2f2597[_0xb087('0x50')]);_0x4c3aef['attributes']=_[_0xb087('0x51')](_0x2f2597[_0xb087('0x4f')],qs[_0xb087('0x53')](_0x25910a[_0xb087('0x50')][_0xb087('0x53')]));_0x4c3aef[_0xb087('0x52')]=_0x4c3aef[_0xb087('0x52')][_0xb087('0x54')]?_0x4c3aef['attributes']:_0x2f2597[_0xb087('0x4f')];if(_0x25910a['query']['includeAll']){_0x4c3aef[_0xb087('0xc7')]=[{'all':!![]}];}_0x4c3aef=_[_0xb087('0xae')]({},_0x4c3aef,_0x25910a[_0xb087('0xc8')]);return db['ChatInteraction'][_0xb087('0x74')](_0x4c3aef)[_0xb087('0x25')](handleEntityNotFound(_0x597d80,null))[_0xb087('0x25')](respondWithResult(_0x597d80,null))[_0xb087('0xc9')](handleError(_0x597d80,null));};exports['create']=function(_0x1f3ecb,_0x3e865d){return db[_0xb087('0x4b')][_0xb087('0xca')](_0x1f3ecb[_0xb087('0x3f')],{})[_0xb087('0x25')](respondWithResult(_0x3e865d,0xc9))[_0xb087('0xc9')](handleError(_0x3e865d,null));};exports['update']=function(_0x1de68b,_0xfc3490){if(_0x1de68b[_0xb087('0x3f')]['id']){delete _0x1de68b[_0xb087('0x3f')]['id'];}return db[_0xb087('0x4b')][_0xb087('0x74')]({'where':{'id':_0x1de68b['params']['id']}})[_0xb087('0x25')](handleEntityNotFound(_0xfc3490,null))[_0xb087('0x25')](saveUpdates(_0x1de68b[_0xb087('0x3f')],null))['then'](respondWithResult(_0xfc3490,null))['catch'](handleError(_0xfc3490,null));};exports[_0xb087('0x3c')]=function(_0x12c676,_0xee09f5){return db[_0xb087('0x4b')][_0xb087('0x74')]({'where':{'id':_0x12c676[_0xb087('0xc5')]['id']}})[_0xb087('0x25')](handleEntityNotFound(_0xee09f5,null))[_0xb087('0x25')](removeEntity(_0xee09f5,null))[_0xb087('0xc9')](handleError(_0xee09f5,null));};exports[_0xb087('0xcb')]=function(_0x5ef263,_0x1a7486){return db[_0xb087('0x4b')][_0xb087('0xcb')]()[_0xb087('0x25')](respondWithResult(_0x1a7486,null))[_0xb087('0xc9')](handleError(_0x1a7486,null));};exports['createVidaooSession']=function(_0x33756c,_0x2e8eb1){var _0x189e0a=_0x33756c[_0xb087('0xc5')]['id'];var _0x52268a;var _0x259ac0;var _0x547968;return db[_0xb087('0x4b')]['findOne']({'where':{'id':_0x189e0a}})['then'](function(_0x321da9){_0x52268a=_0x321da9;return db[_0xb087('0xcc')][_0xb087('0xcd')]({'where':{'id':_0x321da9['ChatWebsiteId']},'attributes':['id','vidaooApiKey',_0xb087('0xce'),_0xb087('0xcf'),_0xb087('0xd0'),_0xb087('0xd1')],'raw':!![]});})[_0xb087('0x25')](function(_0x48a94f){if(_0x48a94f&&_0x48a94f[_0xb087('0xd2')]&&_0x48a94f[_0xb087('0xce')]){_0x259ac0=_0x48a94f;var _0x290338={'interaction':{'id':_0x189e0a},'agent':{'id':_0x33756c[_0xb087('0xa6')]['id'],'name':_0x33756c[_0xb087('0xa6')][_0xb087('0x3d')],'fullname':_0x33756c['user']['fullname'],'email':_0x33756c[_0xb087('0xa6')][_0xb087('0xd3')]},'contact':_0x33756c['body'][_0xb087('0x40')],'account':_0x33756c['body']['account']};var _0x471c54={'rejectUnauthorized':![],'method':_0xb087('0xd4'),'url':_0xb087('0xd5'),'headers':{'X-APIKEY':_0x48a94f[_0xb087('0xd2')]},'body':{'duration':null,'scheduledAt':null,'participants':[_0x33756c[_0xb087('0xa6')][_0xb087('0xd3')]],'buttons':null,'topic':_0x259ac0[_0xb087('0xcf')],'note':_[_0xb087('0xd6')](_0x259ac0[_0xb087('0xd0')])?null:getMustacheRender(_0x259ac0[_0xb087('0xd0')],_0x290338),'metadata':null},'redirect':'follow','json':!![]};try{if(!_['isNull'](_0x259ac0['vidaooMetadata'])){var _0x2ebe58=getMustacheRender(_0x259ac0['vidaooMetadata'],_0x290338);var _0x173a1b=JSON['parse'](_0x2ebe58);_0x471c54['body'][_0xb087('0xd7')]=_0x173a1b;}}catch(_0x2e3036){throw new db[(_0xb087('0x9d'))][(_0xb087('0xd8'))](_0xb087('0xd9'));}return rp(_0x471c54);}else{throw new db[(_0xb087('0x9d'))][(_0xb087('0xd8'))](_0xb087('0xda'));}})[_0xb087('0x25')](function(_0x2fdcee){_0x547968=_0x2fdcee;if(_0x547968['id']){var _0x5ae13d={'body':_0x547968[_0xb087('0xdb')],'ChatWebsiteId':_0x259ac0['id'],'ChatInteractionId':_0x52268a['id'],'direction':'out','UserId':_0x33756c[_0xb087('0xa6')]['id']};return db[_0xb087('0xdc')]['create'](_0x5ae13d,{});}else{throw new db[(_0xb087('0x9d'))][(_0xb087('0xd8'))]('Unable\x20to\x20create\x20Vidaoo\x20session');}})['then'](function(){return _0x52268a[_0xb087('0xdd')]({'vidaooSessionId':_0x547968['id']});})['then'](respondWithResult(_0x2e8eb1,null))[_0xb087('0xc9')](handleError(_0x2e8eb1,null));};exports['customUpdate']=function(_0x1e04ff,_0x1a99a3){if(_0x1e04ff[_0xb087('0x3f')]['id']){delete _0x1e04ff['body']['id'];}return db[_0xb087('0x4b')][_0xb087('0x74')]({'where':{'id':_0x1e04ff[_0xb087('0xc5')]['id']},'include':[{'model':db[_0xb087('0xde')],'as':_0xb087('0xdf')}]})[_0xb087('0x25')](handleEntityNotFound(_0x1a99a3,null))[_0xb087('0x25')](saveUpdates(_0x1e04ff[_0xb087('0x3f')],null))[_0xb087('0x25')](respondWithResult(_0x1a99a3,null))[_0xb087('0xc9')](handleError(_0x1a99a3,null));};exports['abandon']=function(_0x3a5432,_0x520aa9,_0x31d03d){if(_0x3a5432[_0xb087('0x3f')]['id']){delete _0x3a5432[_0xb087('0x3f')]['id'];}return db['ChatInteraction']['find']({'where':{'id':_0x3a5432['params']['id']}})[_0xb087('0x25')](function(_0xfaa17f){if(!_0xfaa17f){logger[_0xb087('0x2a')](_0xb087('0xe0'),_0xb087('0xe1'),0x194,_0xb087('0xe2'));_0x520aa9[_0xb087('0x2e')](0x194);}else{if(_0xfaa17f['UserId']){throw new db[(_0xb087('0x9d'))]['ValidationError']('Interaction\x20already\x20assigned');}}return _0xfaa17f;})['then'](function(_0x4cde01){if(_0x4cde01){return _0x4cde01[_0xb087('0x3b')]({'closed':_0x3a5432[_0xb087('0x3f')]['closed'],'disposition':_0x3a5432[_0xb087('0x3f')][_0xb087('0xe3')]})[_0xb087('0x25')](function(_0x500a2b){return _0x500a2b;});}})[_0xb087('0x25')](function(_0x11a1a5){return respondWithRpcPromise('AbandonInteraction',_0xb087('0xe1'),_0x3a5432[_0xb087('0x3f')],client9004);})[_0xb087('0x25')](respondWithResult(_0x520aa9,null))[_0xb087('0xc9')](handleError(_0x520aa9,null));};exports['attachmentUpload']=function(_0x270e65,_0x10c680,_0x164371){_0x270e65[_0xb087('0x3f')][_0xb087('0x3d')]=_0x270e65[_0xb087('0xe4')]['originalname'];_0x270e65[_0xb087('0x3f')]['basename']=_0x270e65[_0xb087('0xe4')][_0xb087('0xe5')];_0x270e65['body'][_0xb087('0x4d')]=_0x270e65['file']['mimetype'];return db['Attachment'][_0xb087('0xca')](_0x270e65[_0xb087('0x3f')])[_0xb087('0x25')](respondWithResult(_0x10c680,0xc9))[_0xb087('0xc9')](handleError(_0x10c680,null));};exports[_0xb087('0xe6')]=function(_0x1e0751,_0x2831b4,_0x218fe3){return db['ChatInteraction'][_0xb087('0xcd')]({'where':{'id':_0x1e0751['params']['id']},'raw':!![]})['then'](handleEntityNotFound(_0x2831b4,null))[_0xb087('0x25')](function(_0x1babd3){if(_0x1babd3){if(_0x1babd3[_0xb087('0xe7')]){return _0x2831b4['status'](0x193)['json']({'status':0x193,'message':_0xb087('0xe8')});}return db[_0xb087('0xe9')][_0xb087('0xcd')]({'where':{'id':_0x1e0751[_0xb087('0x50')][_0xb087('0xea')]},'raw':!![]})[_0xb087('0x25')](handleEntityNotFound(_0x2831b4,null));}})['then'](function(_0x52341e){if(_0x52341e){var _0x54eed6=_0x52341e[_0xb087('0xeb')]!==null;var _0x12d277=path[_0xb087('0xec')](config[_0xb087('0xed')],'server/files/attachments/');if(_0x54eed6){_0x12d277=path[_0xb087('0xec')](_0x12d277,_0xb087('0xee'));}var _0x1b5422=path[_0xb087('0xec')](_0x12d277,_0x52341e[_0xb087('0xef')]);return _0x2831b4[_0xb087('0xf0')](_0x1b5422);}})[_0xb087('0xc9')](handleError(_0x2831b4,null));};exports[_0xb087('0xf1')]=function(_0x120012,_0x385065){var _0x56e768=null;var _0x5a2142=null;var _0x24171a=null;var _0x39577d=null;if(_0x120012[_0xb087('0x3f')]['id']){delete _0x120012[_0xb087('0x3f')]['id'];}if(_0x120012[_0xb087('0x3f')][_0xb087('0xf2')]){_0x39577d=path[_0xb087('0xec')](config[_0xb087('0xed')],_0xb087('0xf3'),util[_0xb087('0xf4')](_0xb087('0xf5'),Date[_0xb087('0xf6')]()));_0x120012[_0xb087('0x3f')][_0xb087('0xf7')]=_0x39577d;}return db[_0xb087('0x4b')][_0xb087('0x74')]({'where':{'id':_0x120012[_0xb087('0xc5')]['id']},'include':[{'model':db[_0xb087('0xdc')],'as':_0xb087('0xf8'),'include':[{'model':db[_0xb087('0x81')],'as':_0xb087('0x81')}]}]})[_0xb087('0x25')](handleEntityNotFound(_0x385065,null))[_0xb087('0x25')](saveUpdates(_0x120012[_0xb087('0x3f')],null))[_0xb087('0x25')](function(_0x365d41){if(_0x365d41){_0x56e768=_0x365d41;return db[_0xb087('0xcc')][_0xb087('0x74')]({'where':{'id':_0x56e768[_0xb087('0x89')]}});}})[_0xb087('0x25')](function(_0x159082){if(_0x159082){_0x24171a=_0x159082;return db[_0xb087('0xde')][_0xb087('0x74')]({'where':{'id':_0x56e768[_0xb087('0x7d')]}});}})[_0xb087('0x25')](function(_0x2d8c34){if(_0x2d8c34){_0x5a2142=_0x2d8c34;if(_0x39577d){var _0x5a50a1=null;for(var _0x57186a=0x1;_0x57186a<_0x56e768['Messages'][_0xb087('0x54')];++_0x57186a){_0x5a50a1=_0x56e768[_0xb087('0xf8')][_0x57186a];var _0x4cbc90=_0x5a50a1[_0xb087('0x84')]?util['format'](_0xb087('0xf9'),_0x24171a[_0xb087('0xfa')],_0x5a50a1[_0xb087('0x84')]):_0xb087('0xfb');var _0x39f701=_0x120012[_0xb087('0x3f')][_0xb087('0xfc')]||util[_0xb087('0xf4')](_0xb087('0xf9'),_0xb087('0xfd'),_0x5a50a1[_0xb087('0x7d')]);switch(_0x24171a['agentIdentifier']){case _0xb087('0xfe'):_0x4cbc90=_0x5a50a1[_0xb087('0x84')]?util[_0xb087('0xf4')](_0xb087('0xf9'),_0x24171a['agentAlias'],_0x5a50a1[_0xb087('0x84')]):_0xb087('0xfb');break;case _0xb087('0xff'):_0x4cbc90=_0x5a50a1[_0xb087('0x84')]?_0x5a50a1[_0xb087('0x81')][_0xb087('0x100')]||_0x5a50a1[_0xb087('0x81')][_0xb087('0x45')]:_0xb087('0xfb');break;case _0xb087('0x101'):_0x4cbc90=_0x5a50a1[_0xb087('0x84')]?_0x5a50a1[_0xb087('0x81')][_0xb087('0x45')]:_0xb087('0xfb');break;default:_0x4cbc90=_0x5a50a1[_0xb087('0x84')]?util[_0xb087('0xf4')](_0xb087('0xf9'),_0x24171a[_0xb087('0xfa')],_0x5a50a1['UserId']):_0xb087('0xfb');}var _0x2c85ed=util[_0xb087('0xf4')](_0xb087('0x102'),moment(_0x5a50a1['createdAt'])[_0xb087('0xf4')](_0xb087('0x103')),_0x5a50a1[_0xb087('0x104')]==='in'?_0x39f701:_0x4cbc90,_0x5a50a1[_0xb087('0x3f')]);if(!_0x5a50a1[_0xb087('0x105')]){fs['appendFileSync'](_0x39577d,_0x2c85ed);}}return db[_0xb087('0x106')][_0xb087('0xcd')]({'where':{'service':!![]},'include':[{'model':db[_0xb087('0x107')],'as':_0xb087('0x108'),'raw':!![]}]});}}})[_0xb087('0x25')](function(_0x17ad89){if(_0x17ad89&&_0x17ad89[_0xb087('0x108')]&&_0x120012[_0xb087('0x3f')]){var _0x58a76b={'tls':{'rejectUnauthorized':![]}};if(_0x17ad89[_0xb087('0x108')][_0xb087('0x109')]){_0x58a76b['service']=_0x17ad89[_0xb087('0x108')][_0xb087('0x109')];}else{_0x58a76b['host']=_0x17ad89[_0xb087('0x108')][_0xb087('0x10a')];_0x58a76b[_0xb087('0x10b')]=_0x17ad89[_0xb087('0x108')][_0xb087('0x10b')];_0x58a76b[_0xb087('0x10c')]=_0x17ad89[_0xb087('0x108')]['secure'];}if(_0x17ad89[_0xb087('0x108')][_0xb087('0x10d')]){_0x58a76b[_0xb087('0x10e')]={'user':_0x17ad89[_0xb087('0x108')][_0xb087('0xa6')],'pass':_0x17ad89[_0xb087('0x108')]['pass']};}return respondWithRpcPromise(_0xb087('0x10f'),_0xb087('0x110'),{'account':_0x58a76b,'message':{'from':util[_0xb087('0xf4')](_0xb087('0x111'),_0x17ad89[_0xb087('0x3d')],_0x17ad89['email']||_0x17ad89[_0xb087('0x108')][_0xb087('0xa6')]),'to':_0x120012[_0xb087('0x3f')]['mailTranscript'],'subject':_0xb087('0x112'),'text':util['format'](_0xb087('0x113'),_0x120012['body'][_0xb087('0xf2')]),'attachments':[{'path':_0x39577d}]}})['then'](function(){return _0x56e768;})[_0xb087('0xc9')](function(_0x3d916e){console['error'](_0x3d916e);});}else{return _0x56e768;}})[_0xb087('0x25')](respondWithStatusCode(_0x385065,0xc8))['catch'](handleError(_0x385065,null));};exports['addMessage']=function(_0x5180ad,_0x396660,_0x4b2169){return db[_0xb087('0xdc')]['find']({'where':{'id':_0x5180ad['params']['id']}})[_0xb087('0x25')](handleEntityNotFound(_0x396660,null))[_0xb087('0x25')](function(_0x371655){if(_0x371655){return _0x371655[_0xb087('0x114')](_0x5180ad[_0xb087('0x3f')]['ids'],_[_0xb087('0x115')](_0x5180ad[_0xb087('0x3f')],[_0xb087('0x116'),'id'])||{});}})[_0xb087('0x25')](respondWithResult(_0x396660,null))[_0xb087('0xc9')](handleError(_0x396660,null));};exports[_0xb087('0x117')]=function(_0x1ca818,_0x2ec638,_0x57d42a){var _0x451c8a={'raw':![],'where':{}};var _0x3768db={};var _0x1db8ba={'count':0x0,'rows':[]};return db['ChatInteraction'][_0xb087('0xcd')]({'where':{'id':_0x1ca818[_0xb087('0xc5')]['id']}})[_0xb087('0x25')](handleEntityNotFound(_0x2ec638,null))['then'](function(_0x4904ea){if(_0x4904ea){_0x3768db[_0xb087('0x4f')]=_[_0xb087('0x86')](db[_0xb087('0xdc')][_0xb087('0xc6')]);_0x3768db['query']=_[_0xb087('0x86')](_0x1ca818[_0xb087('0x50')]);_0x3768db[_0xb087('0x59')]=_[_0xb087('0x51')](_0x3768db[_0xb087('0x4f')],_0x3768db['query']);_0x451c8a['attributes']=_[_0xb087('0x51')](_0x3768db[_0xb087('0x4f')],qs['fields'](_0x1ca818[_0xb087('0x50')][_0xb087('0x53')]));_0x451c8a[_0xb087('0x52')]=_0x451c8a[_0xb087('0x52')][_0xb087('0x54')]?_0x451c8a[_0xb087('0x52')]:_0x3768db[_0xb087('0x4f')];if(!_0x1ca818['query'][_0xb087('0x55')](_0xb087('0x118'))){_0x451c8a[_0xb087('0x34')]=qs['limit'](_0x1ca818['query'][_0xb087('0x34')]);_0x451c8a[_0xb087('0x32')]=qs[_0xb087('0x32')](_0x1ca818[_0xb087('0x50')]['offset']);}_0x451c8a[_0xb087('0x56')]=qs[_0xb087('0x57')](_0x1ca818[_0xb087('0x50')]['sort']);_0x451c8a['where']=qs[_0xb087('0x59')](_['pick'](_0x1ca818[_0xb087('0x50')],_0x3768db[_0xb087('0x59')]));_0x451c8a['where']['ChatInteractionId']=_0x4904ea['id'];if(_0x1ca818[_0xb087('0x50')][_0xb087('0x119')]){_0x451c8a[_0xb087('0x8f')]=_[_0xb087('0xae')](_0x451c8a['where'],{'$or':_[_0xb087('0x44')](_0x451c8a['attributes'],function(_0x52cc1a){var _0x117552={};_0x117552[_0x52cc1a]={'$like':'%'+_0x1ca818[_0xb087('0x50')][_0xb087('0x119')]+'%'};return _0x117552;})});}if(_0x1ca818[_0xb087('0x50')][_0xb087('0x8d')]){var _0x484bb5=_0x1ca818[_0xb087('0x50')]['$gte']['split'](',');var _0x46f8cf={};_0x46f8cf[_0x484bb5[0x0]]={'$gte':moment(_0x484bb5[0x1])[_0xb087('0xf4')]('YYYY-MM-DD\x20HH:mm:ss')};_0x451c8a[_0xb087('0x8f')]=_[_0xb087('0xae')](_0x451c8a[_0xb087('0x8f')],_0x46f8cf);}_0x451c8a=_[_0xb087('0xae')]({},_0x451c8a,_0x1ca818['options']);return db[_0xb087('0xdc')][_0xb087('0x35')]({'where':_0x451c8a[_0xb087('0x8f')]})[_0xb087('0x25')](function(_0x2c3d1b){_0x1db8ba['count']=_0x2c3d1b;if(_0x1ca818['query']['includeAll']){_0x451c8a[_0xb087('0xc7')]=[{'all':!![]}];}return db['ChatMessage'][_0xb087('0x11a')](_0x451c8a);})[_0xb087('0x25')](function(_0x4c1577){_0x1db8ba[_0xb087('0x11b')]=_0x4c1577;return _0x1db8ba;});}})[_0xb087('0x25')](respondWithFilteredResult(_0x2ec638,_0x451c8a))[_0xb087('0xc9')](handleError(_0x2ec638,null));};exports[_0xb087('0x11c')]=function(_0xad3eae,_0xb6682a,_0x1dbeb1){var _0x2caa79={'where':{}},_0x521e0c={},_0x1ffbd9={'count':0x0,'rows':[]};return db[_0xb087('0x4b')][_0xb087('0xcd')]({'where':{'id':_0xad3eae['params']['id']}})[_0xb087('0x25')](handleEntityNotFound(_0xb6682a,null))[_0xb087('0x25')](function(_0x3fd51b){if(_0x3fd51b){_0x521e0c[_0xb087('0x4f')]=_['keys'](db['ChatMessage'][_0xb087('0xc6')]);_0x521e0c[_0xb087('0x50')]=_[_0xb087('0x86')](_0xad3eae[_0xb087('0x50')]);_0x521e0c[_0xb087('0x59')]=_[_0xb087('0x51')](_0x521e0c['model'],_0x521e0c['query']);_0x2caa79[_0xb087('0x52')]=_[_0xb087('0x51')](_0x521e0c[_0xb087('0x4f')],qs[_0xb087('0x53')](_0xad3eae['query'][_0xb087('0x53')]));_0x2caa79[_0xb087('0x52')]=_0x2caa79[_0xb087('0x52')][_0xb087('0x54')]?_0x2caa79[_0xb087('0x52')]:_0x521e0c[_0xb087('0x4f')];if(!_0xad3eae[_0xb087('0x50')][_0xb087('0x55')](_0xb087('0x118'))){_0x2caa79[_0xb087('0x34')]=qs[_0xb087('0x34')](_0xad3eae[_0xb087('0x50')][_0xb087('0x34')]);_0x2caa79[_0xb087('0x32')]=qs[_0xb087('0x32')](_0xad3eae[_0xb087('0x50')][_0xb087('0x32')]);}_0x2caa79[_0xb087('0x56')]=qs[_0xb087('0x57')](_0xad3eae[_0xb087('0x50')]['sort']);_0x2caa79[_0xb087('0x8f')]=qs[_0xb087('0x59')](_['pick'](_0xad3eae[_0xb087('0x50')],_0x521e0c[_0xb087('0x59')]));_0x2caa79[_0xb087('0x8f')]['ChatInteractionId']=_0x3fd51b['id'];if(_0xad3eae[_0xb087('0x50')]['filter']){_0x2caa79['where']=_[_0xb087('0xae')](_0x2caa79[_0xb087('0x8f')],{'$or':_[_0xb087('0x44')](_0x2caa79[_0xb087('0x52')],function(_0x4a1749){var _0x300e08={};_0x300e08[_0x4a1749]={'$like':'%'+_0xad3eae['query'][_0xb087('0x119')]+'%'};return _0x300e08;})});}_0x2caa79[_0xb087('0x8f')][_0xb087('0x105')]=![];if(_0xad3eae['query']['id']){_0x2caa79['where']['id']={'$gt':_0xad3eae[_0xb087('0x50')]['id']};}_0x2caa79=_['merge']({},_0x2caa79,_0xad3eae['options']);return db[_0xb087('0xdc')][_0xb087('0x35')]({'where':_0x2caa79['where']})[_0xb087('0x25')](function(_0x241c68){_0x1ffbd9[_0xb087('0x35')]=_0x241c68;_0x2caa79[_0xb087('0xc7')]=[];if(_0xad3eae['query']['includeAgent']){_0x2caa79[_0xb087('0xc7')][_0xb087('0xc2')]({'model':db[_0xb087('0x81')],'as':_0xb087('0x81'),'attributes':['id','fullname',_0xb087('0x100')]});}if(_0xad3eae[_0xb087('0x50')][_0xb087('0x11d')]){_0x2caa79[_0xb087('0xc7')]=[{'all':!![]}];}return db[_0xb087('0xdc')][_0xb087('0x11a')](_0x2caa79);})[_0xb087('0x25')](function(_0x3b5740){_0x1ffbd9['rows']=_0x3b5740;return _0x1ffbd9;});}})[_0xb087('0x25')](respondWithFilteredResult(_0xb6682a,_0x2caa79))[_0xb087('0xc9')](handleError(_0xb6682a,null));};exports[_0xb087('0x11e')]=function(_0x594ddc,_0x30521e,_0x13acd8){return db[_0xb087('0x4b')][_0xb087('0x74')]({'where':{'id':_0x594ddc[_0xb087('0xc5')]['id']}})[_0xb087('0x25')](handleEntityNotFound(_0x30521e,null))['then'](function(_0x528edd){if(_0x528edd){return _0x528edd[_0xb087('0x11f')](_0x594ddc[_0xb087('0x3f')][_0xb087('0x116')],_[_0xb087('0x115')](_0x594ddc[_0xb087('0x3f')],[_0xb087('0x116'),'id'])||{})['spread'](function(){return db['Tag'][_0xb087('0x11a')]({'attributes':['id',_0xb087('0x3d'),'color'],'where':{'id':_0x594ddc['body'][_0xb087('0x116')]}});})[_0xb087('0x25')](function(_0x24ae87){socket['emit'](_0xb087('0x120'),{'id':Number(_0x594ddc[_0xb087('0xc5')]['id']),'tags':_0x24ae87||[]});return{'id':Number(_0x594ddc['params']['id']),'tags':_0x24ae87||[]};});}})[_0xb087('0x25')](respondWithResult(_0x30521e,null))['catch'](handleError(_0x30521e,null));};exports['removeTags']=function(_0x592d18,_0x5cbda4,_0x5a182e){return db[_0xb087('0x4b')]['find']({'where':{'id':_0x592d18[_0xb087('0xc5')]['id']}})[_0xb087('0x25')](handleEntityNotFound(_0x5cbda4,null))['then'](function(_0x12f2b2){if(_0x12f2b2){return _0x12f2b2[_0xb087('0x121')](_0x592d18[_0xb087('0x50')][_0xb087('0x116')]);}})['then'](respondWithStatusCode(_0x5cbda4,null))[_0xb087('0xc9')](handleError(_0x5cbda4,null));};exports[_0xb087('0xf0')]=function(_0x17d60b,_0x5df18d){var _0x538812=moment()[_0xb087('0x122')]()[_0xb087('0xac')]();var _0x39732b=path[_0xb087('0xec')](config[_0xb087('0xed')],'server',_0xb087('0x123'),'tmp');var _0x1d8582=path[_0xb087('0xec')](config['root'],_0xb087('0x124'),'files',_0xb087('0x125'));var _0x3f2e19=path[_0xb087('0xec')](_0x39732b,_0x538812);var _0x2d500c=util[_0xb087('0xf4')](_0xb087('0x126'),_0x17d60b[_0xb087('0xc5')]['id'],_0x538812);var _0x407837=path['join'](_0x39732b,_0x2d500c);var _0x220896=[];_0x220896[_0xb087('0xc2')]({'model':db[_0xb087('0x81')],'as':_0xb087('0x81'),'attributes':['id',_0xb087('0x45')],'raw':!![]});_0x220896[_0xb087('0xc2')]({'model':db[_0xb087('0xde')],'as':_0xb087('0xdf'),'attributes':['id',_0xb087('0x127'),'lastName'],'raw':!![]});if(_0x17d60b[_0xb087('0x50')][_0xb087('0x125')]){_0x220896[_0xb087('0xc2')]({'model':db[_0xb087('0xe9')],'as':_0xb087('0xe9'),'raw':!![]});}var _0x6fa760=[{'model':db['ChatMessage'],'as':_0xb087('0xf8'),'attributes':['id',_0xb087('0x3f'),_0xb087('0x8b'),'direction',_0xb087('0x105'),_0xb087('0x92')],'include':_0x220896}];_0x6fa760[_0xb087('0xc2')]({'model':db['ChatWebsite'],'as':_0xb087('0x128'),'attributes':['id',_0xb087('0x3d')]});_0x6fa760['push']({'model':db[_0xb087('0x81')],'as':_0xb087('0x129'),'attributes':['id',_0xb087('0x45')]});return db[_0xb087('0x4b')][_0xb087('0x74')]({'where':{'id':_0x17d60b['params']['id']},'include':_0x6fa760})[_0xb087('0x25')](handleEntityNotFound(_0x5df18d,null))[_0xb087('0x25')](function(_0x196111){if(_0x196111){var _0x2711ed=_0x196111['get']({'plain':!![]});fs['mkdirSync'](_0x3f2e19);var _0x2aa136={'channel':'Chat','account':_0x2711ed[_0xb087('0x128')][_0xb087('0x3d')],'agent':_0x2711ed['Owner']?_0x2711ed[_0xb087('0x129')][_0xb087('0x45')]:'N.A.','createdAt':moment(_0x2711ed['createdAt'])[_0xb087('0xf4')](_0xb087('0x12a'))[_0xb087('0xac')](),'closedAt':_0x2711ed['closed']?moment(_0x2711ed['closedAt'])['format'](_0xb087('0x12a'))[_0xb087('0xac')]():'','disposition':_0x2711ed[_0xb087('0xe3')],'chatInfo':{'browser':_0x2711ed['browserName'],'os':_0x2711ed['osName'],'referer':_0x2711ed[_0xb087('0x12b')],'customerIp':_0x2711ed[_0xb087('0x12c')],'customerPort':_0x2711ed[_0xb087('0x12d')]?_0x2711ed[_0xb087('0x12d')]:_0xb087('0x12e')},'messages':_(_0x2711ed[_0xb087('0xf8')])[_0xb087('0x12f')]()[_0xb087('0x119')]({'secret':![]})[_0xb087('0x44')](function(_0x4392f7){if(_0x4392f7[_0xb087('0xe9')]){var _0x2ce41b=path[_0xb087('0xec')](_0x1d8582,_0x4392f7[_0xb087('0xe9')][_0xb087('0xef')]);if(fs[_0xb087('0x130')](_0x2ce41b)){fs['createReadStream'](_0x2ce41b)[_0xb087('0x131')](fs[_0xb087('0x132')](path['join'](_0x3f2e19,_0x4392f7['Attachment'][_0xb087('0xef')])));}}return{'date':moment(_0x4392f7[_0xb087('0x8b')])[_0xb087('0xf4')](_0xb087('0x12a'))['toString'](),'sender':_0x4392f7[_0xb087('0x104')]===_0xb087('0x133')?_0x4392f7['User']?_0x4392f7['User'][_0xb087('0x45')]:_0xb087('0xfb'):_0x4392f7[_0xb087('0xdf')]['firstName']+(_0x4392f7[_0xb087('0xdf')][_0xb087('0x134')]?'\x20'+_0x4392f7[_0xb087('0xdf')][_0xb087('0x134')]:''),'body':_0x4392f7[_0xb087('0xe9')]?_0x4392f7[_0xb087('0xe9')][_0xb087('0xef')]:_0x4392f7['body'],'direction':_0x4392f7[_0xb087('0x104')]===_0xb087('0x133')?'A':'C','secret':_0x4392f7[_0xb087('0x105')],'read':_0x4392f7[_0xb087('0x92')],'attachment':_0x4392f7[_0xb087('0xe9')]};})['value']()};return ejs['renderFile'](path[_0xb087('0xec')](config[_0xb087('0xed')],_0xb087('0x124'),'views',_0xb087('0x135')),{'interaction':_0x2aa136})[_0xb087('0x25')](function(_0x3e4bec){var _0x52b038=path[_0xb087('0xec')](_0x3f2e19,_0xb087('0x136')+_0x2711ed['id']+'-'+_0x538812+_0xb087('0x137'));var _0x4e6b9f={'path':_0x52b038,'channel':'Chat','interactionId':_0x2711ed['id']};return pdf['createPdfFromHTML'](_0x3e4bec,_0x4e6b9f);})[_0xb087('0x25')](function(){return new BPromise(function(_0x22dea9,_0x1c9337){zipdir(_0x3f2e19,{'saveTo':_0x407837},function(_0x3d0278,_0x1c8982){if(_0x3d0278)return _0x1c9337(_0x3d0278);return _0x22dea9(_0x1c8982);});})[_0xb087('0x25')](function(){return new BPromise(function(_0x31b3e7,_0x6b8337){rimraf(_0x3f2e19,function(_0x348c92){if(_0x348c92)_0x6b8337(_0x348c92);return _0x31b3e7();});});})[_0xb087('0x25')](function(){return _0x5df18d[_0xb087('0xf0')](_0x407837,_0x2d500c,function(_0x218e1c){if(_0x218e1c){console[_0xb087('0x138')](_0xb087('0x139'),_0x218e1c);}else{fs[_0xb087('0x13a')](_0x407837);}});});});}else{return _0x5df18d[_0xb087('0x2e')](0xc8);}})[_0xb087('0xc9')](handleError(_0x5df18d,null));};
\ No newline at end of file
diff --git a/server/api/chatInteraction/chatInteraction.events.js b/server/api/chatInteraction/chatInteraction.events.js
index d1098d3..de52a2d 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 _0x0dcc=['ChatInteraction','setMaxListeners','getUsers','setDataValue','Users','map','findAll','then','unreadMessages','length','emit','catch','hasOwnProperty','hook','exports','events','../../mysqldb'];(function(_0x16dd98,_0x11d346){var _0xfc7fb3=function(_0x40d7d8){while(--_0x40d7d8){_0x16dd98['push'](_0x16dd98['shift']());}};_0xfc7fb3(++_0x11d346);}(_0x0dcc,0x174));var _0xc0dc=function(_0x3aa654,_0x314823){_0x3aa654=_0x3aa654-0x0;var _0x4d826f=_0x0dcc[_0x3aa654];return _0x4d826f;};'use strict';var EventEmitter=require(_0xc0dc('0x0'));var ChatInteraction=require(_0xc0dc('0x1'))['db'][_0xc0dc('0x2')];var ChatMessage=require(_0xc0dc('0x1'))['db']['ChatMessage'];var ChatInteractionEvents=new EventEmitter();ChatInteractionEvents[_0xc0dc('0x3')](0x0);var events={'afterCreate':'save','afterUpdate':'update','afterDestroy':'remove'};function emitEvent(_0x4b56ad){return function(_0x21f498,_0x3ee96e,_0x58d830){_0x21f498[_0xc0dc('0x4')]({'attributes':['id'],'raw':!![]})['then'](function(_0x292515){_0x21f498[_0xc0dc('0x5')](_0xc0dc('0x6'),_0x292515[_0xc0dc('0x7')](function(_0xe0ed65){return{'id':_0xe0ed65['id']};}));return ChatMessage[_0xc0dc('0x8')]({'where':{'ChatInteractionId':_0x21f498['id'],'direction':'in','read':![]},'raw':!![]});})[_0xc0dc('0x9')](function(_0x3fa4c5){_0x21f498[_0xc0dc('0x5')](_0xc0dc('0xa'),_0x3fa4c5[_0xc0dc('0xb')]);ChatInteractionEvents[_0xc0dc('0xc')](_0x4b56ad+':'+_0x21f498['id'],_0x21f498);ChatInteractionEvents[_0xc0dc('0xc')](_0x4b56ad,_0x21f498);_0x58d830(null);})[_0xc0dc('0xd')](_0x58d830(null));};}for(var e in events){if(events[_0xc0dc('0xe')](e)){var event=events[e];ChatInteraction[_0xc0dc('0xf')](e,emitEvent(event));}}module[_0xc0dc('0x10')]=ChatInteractionEvents;
\ No newline at end of file
+var _0xd7c7=['setDataValue','Users','unreadMessages','length','emit','catch','exports','events','../../mysqldb','ChatInteraction','ChatMessage','save','update','remove'];(function(_0x4e1d03,_0x786f3a){var _0x362d4b=function(_0x1924d2){while(--_0x1924d2){_0x4e1d03['push'](_0x4e1d03['shift']());}};_0x362d4b(++_0x786f3a);}(_0xd7c7,0x173));var _0x7d7c=function(_0x4994cb,_0x22cdd3){_0x4994cb=_0x4994cb-0x0;var _0x3324d0=_0xd7c7[_0x4994cb];return _0x3324d0;};'use strict';var EventEmitter=require(_0x7d7c('0x0'));var ChatInteraction=require(_0x7d7c('0x1'))['db'][_0x7d7c('0x2')];var ChatMessage=require('../../mysqldb')['db'][_0x7d7c('0x3')];var ChatInteractionEvents=new EventEmitter();ChatInteractionEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x7d7c('0x4'),'afterUpdate':_0x7d7c('0x5'),'afterDestroy':_0x7d7c('0x6')};function emitEvent(_0x4e0814){return function(_0x101771,_0xe2cf4c,_0x1fd274){_0x101771['getUsers']({'attributes':['id'],'raw':!![]})['then'](function(_0x11b9b7){_0x101771[_0x7d7c('0x7')](_0x7d7c('0x8'),_0x11b9b7['map'](function(_0x5c5581){return{'id':_0x5c5581['id']};}));return ChatMessage['findAll']({'where':{'ChatInteractionId':_0x101771['id'],'direction':'in','read':![]},'raw':!![]});})['then'](function(_0x1bb75f){_0x101771[_0x7d7c('0x7')](_0x7d7c('0x9'),_0x1bb75f[_0x7d7c('0xa')]);ChatInteractionEvents[_0x7d7c('0xb')](_0x4e0814+':'+_0x101771['id'],_0x101771);ChatInteractionEvents[_0x7d7c('0xb')](_0x4e0814,_0x101771);_0x1fd274(null);})[_0x7d7c('0xc')](_0x1fd274(null));};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];ChatInteraction['hook'](e,emitEvent(event));}}module[_0x7d7c('0xd')]=ChatInteractionEvents;
\ No newline at end of file
diff --git a/server/api/chatInteraction/chatInteraction.model.js b/server/api/chatInteraction/chatInteraction.model.js
index 8383690..1dcdce6 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 _0x08a0=['define','ChatInteraction','chat_interactions','closedAt','format','utf8mb4','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','./chatInteraction.attributes'];(function(_0x6c993a,_0x5ea3ab){var _0x27f547=function(_0x22df20){while(--_0x22df20){_0x6c993a['push'](_0x6c993a['shift']());}};_0x27f547(++_0x5ea3ab);}(_0x08a0,0x66));var _0x008a=function(_0x4697fa,_0x21c841){_0x4697fa=_0x4697fa-0x0;var _0x390950=_0x08a0[_0x4697fa];return _0x390950;};'use strict';var _=require(_0x008a('0x0'));var util=require(_0x008a('0x1'));var logger=require(_0x008a('0x2'))(_0x008a('0x3'));var moment=require(_0x008a('0x4'));var BPromise=require(_0x008a('0x5'));var rp=require(_0x008a('0x6'));var fs=require('fs');var path=require(_0x008a('0x7'));var rimraf=require(_0x008a('0x8'));var config=require('../../config/environment');var attributes=require(_0x008a('0x9'));module['exports']=function(_0x409843,_0x2feb7f){return _0x409843[_0x008a('0xa')](_0x008a('0xb'),attributes,{'tableName':_0x008a('0xc'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x30858c,_0x5a05e0,_0x372eae){if(_0x30858c['changed']('closed')){_0x30858c[_0x008a('0xd')]=moment()[_0x008a('0xe')]('YYYY-MM-DD\x20HH:mm:ss');}_0x372eae(null,_0x30858c);}},'charset':_0x008a('0xf'),'collate':'utf8mb4_unicode_ci'});};
\ No newline at end of file
+var _0x7c80=['ChatInteraction','closed','closedAt','format','YYYY-MM-DD\x20HH:mm:ss','utf8mb4','utf8mb4_unicode_ci','util','../../config/logger','moment','bluebird','request-promise','path','rimraf','../../config/environment','exports','define'];(function(_0x4810b8,_0x549a3c){var _0x505e94=function(_0x81186c){while(--_0x81186c){_0x4810b8['push'](_0x4810b8['shift']());}};_0x505e94(++_0x549a3c);}(_0x7c80,0x7e));var _0x07c8=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x7c80[_0x3dd15e];return _0x231fd0;};'use strict';var _=require('lodash');var util=require(_0x07c8('0x0'));var logger=require(_0x07c8('0x1'))('api');var moment=require(_0x07c8('0x2'));var BPromise=require(_0x07c8('0x3'));var rp=require(_0x07c8('0x4'));var fs=require('fs');var path=require(_0x07c8('0x5'));var rimraf=require(_0x07c8('0x6'));var config=require(_0x07c8('0x7'));var attributes=require('./chatInteraction.attributes');module[_0x07c8('0x8')]=function(_0x376e35,_0x16696f){return _0x376e35[_0x07c8('0x9')](_0x07c8('0xa'),attributes,{'tableName':'chat_interactions','paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x32960c,_0x2a6b16,_0x4c33c0){if(_0x32960c['changed'](_0x07c8('0xb'))){_0x32960c[_0x07c8('0xc')]=moment()[_0x07c8('0xd')](_0x07c8('0xe'));}_0x4c33c0(null,_0x32960c);}},'charset':_0x07c8('0xf'),'collate':_0x07c8('0x10')});};
\ No newline at end of file
diff --git a/server/api/chatInteraction/chatInteraction.rpc.js b/server/api/chatInteraction/chatInteraction.rpc.js
index dfc653b..20b2ecc 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 _0x1a0e=['UpdateChatInteraction','find','addTags','ids','omit','spread','AddTags','lodash','util','moment','randomstring','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','./chatInteraction.socket','register','request','request\x20sent','debug','ChatInteraction,\x20%s,\x20%s,\x20%s','stringify','error','message','ChatInteraction,\x20%s,\x20%s','result','catch','ChatInteraction','update','body','options','raw','where','attributes','limit','then','info'];(function(_0xf8df6c,_0x4e2c4a){var _0xde757f=function(_0x66e1c0){while(--_0x66e1c0){_0xf8df6c['push'](_0xf8df6c['shift']());}};_0xde757f(++_0x4e2c4a);}(_0x1a0e,0x167));var _0xe1a0=function(_0x5c88c8,_0x2c04cf){_0x5c88c8=_0x5c88c8-0x0;var _0x7b15d5=_0x1a0e[_0x5c88c8];return _0x7b15d5;};'use strict';var _=require(_0xe1a0('0x0'));var util=require(_0xe1a0('0x1'));var moment=require(_0xe1a0('0x2'));var BPromise=require('bluebird');var rs=require(_0xe1a0('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0xe1a0('0x4'));var logger=require(_0xe1a0('0x5'))(_0xe1a0('0x6'));var config=require(_0xe1a0('0x7'));var jayson=require(_0xe1a0('0x8'));var client=jayson[_0xe1a0('0x9')][_0xe1a0('0xa')]({'port':0x232a});config[_0xe1a0('0xb')]=_[_0xe1a0('0xc')](config[_0xe1a0('0xb')],{'host':_0xe1a0('0xd'),'port':0x18eb});var socket=require(_0xe1a0('0xe'))(new Redis(config[_0xe1a0('0xb')]));require(_0xe1a0('0xf'))[_0xe1a0('0x10')](socket);function respondWithRpcPromise(_0x4400ee,_0x4e60ed,_0x50f36f){return new BPromise(function(_0x160679,_0x65ac46){return client[_0xe1a0('0x11')](_0x4400ee,_0x50f36f)['then'](function(_0x1f8186){logger['info']('ChatInteraction,\x20%s,\x20%s',_0x4e60ed,_0xe1a0('0x12'));logger[_0xe1a0('0x13')](_0xe1a0('0x14'),_0x4e60ed,'request\x20sent',JSON[_0xe1a0('0x15')](_0x1f8186));if(_0x1f8186[_0xe1a0('0x16')]){if(_0x1f8186[_0xe1a0('0x16')]['code']===0x1f4){logger[_0xe1a0('0x16')]('ChatInteraction,\x20%s,\x20%s',_0x4e60ed,_0x1f8186[_0xe1a0('0x16')][_0xe1a0('0x17')]);return _0x65ac46(_0x1f8186[_0xe1a0('0x16')][_0xe1a0('0x17')]);}logger[_0xe1a0('0x16')]('ChatInteraction,\x20%s,\x20%s',_0x4e60ed,_0x1f8186[_0xe1a0('0x16')][_0xe1a0('0x17')]);return _0x160679(_0x1f8186[_0xe1a0('0x16')][_0xe1a0('0x17')]);}else{logger['info'](_0xe1a0('0x18'),_0x4e60ed,_0xe1a0('0x12'));_0x160679(_0x1f8186[_0xe1a0('0x19')][_0xe1a0('0x17')]);}})[_0xe1a0('0x1a')](function(_0x2e50e4){logger[_0xe1a0('0x16')](_0xe1a0('0x18'),_0x4e60ed,_0x2e50e4);_0x65ac46(_0x2e50e4);});});}exports['UpdateChatInteraction']=function(_0x54d723){var _0x21c63d=this;return new Promise(function(_0x415401,_0x1d8ddc){return db[_0xe1a0('0x1b')][_0xe1a0('0x1c')](_0x54d723[_0xe1a0('0x1d')],{'raw':_0x54d723[_0xe1a0('0x1e')]?_0x54d723[_0xe1a0('0x1e')][_0xe1a0('0x1f')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x54d723[_0xe1a0('0x1e')]?_0x54d723[_0xe1a0('0x1e')][_0xe1a0('0x20')]||null:null,'attributes':_0x54d723[_0xe1a0('0x1e')]?_0x54d723[_0xe1a0('0x1e')][_0xe1a0('0x21')]||null:null,'limit':_0x54d723['options']?_0x54d723[_0xe1a0('0x1e')][_0xe1a0('0x22')]||null:null})[_0xe1a0('0x23')](function(_0x5c1e9e){logger[_0xe1a0('0x24')](_0xe1a0('0x25'),_0x54d723);logger[_0xe1a0('0x13')](_0xe1a0('0x25'),_0x54d723,JSON['stringify'](_0x5c1e9e));_0x415401(_0x5c1e9e);})[_0xe1a0('0x1a')](function(_0x16c398){logger['error'](_0xe1a0('0x25'),_0x16c398[_0xe1a0('0x17')],_0x54d723);_0x1d8ddc(_0x21c63d['error'](0x1f4,_0x16c398[_0xe1a0('0x17')]));});});};exports['AddTagsToChatInteraction']=function(_0xe528a6){return new Promise(function(_0x2363b1,_0x18cddc){return db[_0xe1a0('0x1b')][_0xe1a0('0x26')]({'where':_0xe528a6['options']?_0xe528a6[_0xe1a0('0x1e')][_0xe1a0('0x20')]||null:null})[_0xe1a0('0x23')](function(_0x4dd7c4){if(_0x4dd7c4){return _0x4dd7c4[_0xe1a0('0x27')](_0xe528a6['body'][_0xe1a0('0x28')],_[_0xe1a0('0x29')](_0xe528a6[_0xe1a0('0x1d')],[_0xe1a0('0x28'),'id'])||{});}})[_0xe1a0('0x2a')](function(_0x46a4fd){logger[_0xe1a0('0x24')](_0xe1a0('0x2b'),_0xe528a6);logger['debug'](_0xe1a0('0x2b'),_0xe528a6,JSON['stringify'](_0x46a4fd));_0x2363b1(_0x46a4fd);})[_0xe1a0('0x1a')](function(_0x134ebf){logger[_0xe1a0('0x16')](_0xe1a0('0x2b'),_0x134ebf['message'],_0xe528a6);_0x18cddc(_this[_0xe1a0('0x16')](0x1f4,_0x134ebf['message']));});});};
\ No newline at end of file
+var _0xaf87=['../../config/environment','jayson/promise','client','redis','localhost','register','request','info','ChatInteraction,\x20%s,\x20%s','request\x20sent','debug','ChatInteraction,\x20%s,\x20%s,\x20%s','stringify','error','message','result','UpdateChatInteraction','ChatInteraction','update','options','attributes','catch','addTags','ids','omit','body','spread','AddTags','lodash','util','randomstring','ioredis','../../mysqldb','../../config/utils'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xaf87,0x1b4));var _0x7af8=function(_0x1077a9,_0x2f4705){_0x1077a9=_0x1077a9-0x0;var _0x273e1c=_0xaf87[_0x1077a9];return _0x273e1c;};'use strict';var _=require(_0x7af8('0x0'));var util=require(_0x7af8('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x7af8('0x2'));var fs=require('fs');var Redis=require(_0x7af8('0x3'));var db=require(_0x7af8('0x4'))['db'];var utils=require(_0x7af8('0x5'));var logger=require('../../config/logger')('rpc');var config=require(_0x7af8('0x6'));var jayson=require(_0x7af8('0x7'));var client=jayson[_0x7af8('0x8')]['http']({'port':0x232a});config[_0x7af8('0x9')]=_['defaults'](config[_0x7af8('0x9')],{'host':_0x7af8('0xa'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x7af8('0x9')]));require('./chatInteraction.socket')[_0x7af8('0xb')](socket);function respondWithRpcPromise(_0x7e4330,_0x232925,_0x15cd0a){return new BPromise(function(_0x5582b1,_0x5d55e6){return client[_0x7af8('0xc')](_0x7e4330,_0x15cd0a)['then'](function(_0x585403){logger[_0x7af8('0xd')](_0x7af8('0xe'),_0x232925,_0x7af8('0xf'));logger[_0x7af8('0x10')](_0x7af8('0x11'),_0x232925,'request\x20sent',JSON[_0x7af8('0x12')](_0x585403));if(_0x585403[_0x7af8('0x13')]){if(_0x585403[_0x7af8('0x13')]['code']===0x1f4){logger[_0x7af8('0x13')](_0x7af8('0xe'),_0x232925,_0x585403['error'][_0x7af8('0x14')]);return _0x5d55e6(_0x585403[_0x7af8('0x13')][_0x7af8('0x14')]);}logger[_0x7af8('0x13')](_0x7af8('0xe'),_0x232925,_0x585403[_0x7af8('0x13')][_0x7af8('0x14')]);return _0x5582b1(_0x585403['error'][_0x7af8('0x14')]);}else{logger[_0x7af8('0xd')](_0x7af8('0xe'),_0x232925,_0x7af8('0xf'));_0x5582b1(_0x585403[_0x7af8('0x15')]['message']);}})['catch'](function(_0x3e89bd){logger[_0x7af8('0x13')](_0x7af8('0xe'),_0x232925,_0x3e89bd);_0x5d55e6(_0x3e89bd);});});}exports[_0x7af8('0x16')]=function(_0x153eaf){var _0x33e7dc=this;return new Promise(function(_0x556fb8,_0x30713c){return db[_0x7af8('0x17')][_0x7af8('0x18')](_0x153eaf['body'],{'raw':_0x153eaf['options']?_0x153eaf[_0x7af8('0x19')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x153eaf[_0x7af8('0x19')]?_0x153eaf[_0x7af8('0x19')]['where']||null:null,'attributes':_0x153eaf['options']?_0x153eaf[_0x7af8('0x19')][_0x7af8('0x1a')]||null:null,'limit':_0x153eaf['options']?_0x153eaf[_0x7af8('0x19')]['limit']||null:null})['then'](function(_0x476989){logger[_0x7af8('0xd')](_0x7af8('0x16'),_0x153eaf);logger[_0x7af8('0x10')](_0x7af8('0x16'),_0x153eaf,JSON[_0x7af8('0x12')](_0x476989));_0x556fb8(_0x476989);})[_0x7af8('0x1b')](function(_0x3b389c){logger['error'](_0x7af8('0x16'),_0x3b389c[_0x7af8('0x14')],_0x153eaf);_0x30713c(_0x33e7dc[_0x7af8('0x13')](0x1f4,_0x3b389c['message']));});});};exports['AddTagsToChatInteraction']=function(_0x5ae03c){return new Promise(function(_0x20c614,_0x2c8205){return db[_0x7af8('0x17')]['find']({'where':_0x5ae03c[_0x7af8('0x19')]?_0x5ae03c[_0x7af8('0x19')]['where']||null:null})['then'](function(_0x2f5018){if(_0x2f5018){return _0x2f5018[_0x7af8('0x1c')](_0x5ae03c['body'][_0x7af8('0x1d')],_[_0x7af8('0x1e')](_0x5ae03c[_0x7af8('0x1f')],['ids','id'])||{});}})[_0x7af8('0x20')](function(_0x540c69){logger[_0x7af8('0xd')](_0x7af8('0x21'),_0x5ae03c);logger[_0x7af8('0x10')](_0x7af8('0x21'),_0x5ae03c,JSON[_0x7af8('0x12')](_0x540c69));_0x20c614(_0x540c69);})[_0x7af8('0x1b')](function(_0x3040f8){logger[_0x7af8('0x13')]('AddTags',_0x3040f8[_0x7af8('0x14')],_0x5ae03c);_0x2c8205(_this[_0x7af8('0x13')](0x1f4,_0x3040f8[_0x7af8('0x14')]));});});};
\ No newline at end of file
diff --git a/server/api/chatInteraction/chatInteraction.socket.js b/server/api/chatInteraction/chatInteraction.socket.js
index 6805db9..bf85c74 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 _0xec12=['save','update','emit','register','length','chatInteraction:','./chatInteraction.events'];(function(_0x243b2f,_0x30aa15){var _0xcb3c2d=function(_0x213bb2){while(--_0x213bb2){_0x243b2f['push'](_0x243b2f['shift']());}};_0xcb3c2d(++_0x30aa15);}(_0xec12,0x1bf));var _0x2ec1=function(_0x55912c,_0xfe0245){_0x55912c=_0x55912c-0x0;var _0x2a5ca5=_0xec12[_0x55912c];return _0x2a5ca5;};'use strict';var ChatInteractionEvents=require(_0x2ec1('0x0'));var events=[_0x2ec1('0x1'),'remove',_0x2ec1('0x2')];function createListener(_0xb7d773,_0x341518){return function(_0x158287){_0x341518[_0x2ec1('0x3')](_0xb7d773,_0x158287);};}function removeListener(_0x2ddf1a,_0x3f612a){return function(){ChatInteractionEvents['removeListener'](_0x2ddf1a,_0x3f612a);};}exports[_0x2ec1('0x4')]=function(_0x334af7){for(var _0x249e61=0x0,_0x390d99=events[_0x2ec1('0x5')];_0x249e61<_0x390d99;_0x249e61++){var _0x46d3e6=events[_0x249e61];var _0x63aa1b=createListener(_0x2ec1('0x6')+_0x46d3e6,_0x334af7);ChatInteractionEvents['on'](_0x46d3e6,_0x63aa1b);}};
\ No newline at end of file
+var _0xe01b=['emit','length','chatInteraction:','./chatInteraction.events','save','remove','update'];(function(_0x39ded1,_0xaee436){var _0x2e248e=function(_0x193df3){while(--_0x193df3){_0x39ded1['push'](_0x39ded1['shift']());}};_0x2e248e(++_0xaee436);}(_0xe01b,0x7a));var _0xbe01=function(_0x256b72,_0x340985){_0x256b72=_0x256b72-0x0;var _0x2183e3=_0xe01b[_0x256b72];return _0x2183e3;};'use strict';var ChatInteractionEvents=require(_0xbe01('0x0'));var events=[_0xbe01('0x1'),_0xbe01('0x2'),_0xbe01('0x3')];function createListener(_0x4c5001,_0x1ac197){return function(_0x353a07){_0x1ac197[_0xbe01('0x4')](_0x4c5001,_0x353a07);};}function removeListener(_0x30091f,_0x54b073){return function(){ChatInteractionEvents['removeListener'](_0x30091f,_0x54b073);};}exports['register']=function(_0x1d6b7f){for(var _0x2a70dd=0x0,_0x47bc30=events[_0xbe01('0x5')];_0x2a70dd<_0x47bc30;_0x2a70dd++){var _0x233497=events[_0x2a70dd];var _0x90f4=createListener(_0xbe01('0x6')+_0x233497,_0x1d6b7f);ChatInteractionEvents['on'](_0x233497,_0x90f4);}};
\ No newline at end of file
diff --git a/server/api/chatInteraction/index.js b/server/api/chatInteraction/index.js
index 98203fb..0e03a3e 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 _0x317a=['originalname','/:id/attachment_upload','single','file','attachmentUpload','addMessage','/:id/tags','tracked','chat','addTags','put','/:id','chatinteraction:update','update','/:id/custom_update','customUpdate','abandon','chatinteraction:destroy','destroy','removeTags','exports','multer','util','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatInteraction.controller','isAuthenticated','index','get','/describe','isChatInteractionAuthorized','show','/:id/attachment_download','attachmentDownload','/:id/messages','getMessages','getMyMessages','/:id/download','download','post','createVidaooSession','diskStorage','server/files/attachments/','format','%s-%s','now'];(function(_0x2de0ec,_0x38812f){var _0x13aa7b=function(_0x340176){while(--_0x340176){_0x2de0ec['push'](_0x2de0ec['shift']());}};_0x13aa7b(++_0x38812f);}(_0x317a,0xae));var _0xa317=function(_0x46ec32,_0x1e842f){_0x46ec32=_0x46ec32-0x0;var _0x338f60=_0x317a[_0x46ec32];return _0x338f60;};'use strict';var multer=require(_0xa317('0x0'));var util=require(_0xa317('0x1'));var path=require(_0xa317('0x2'));var timeout=require('connect-timeout');var express=require(_0xa317('0x3'));var router=express[_0xa317('0x4')]();var fs_extra=require(_0xa317('0x5'));var auth=require(_0xa317('0x6'));var interaction=require(_0xa317('0x7'));var config=require(_0xa317('0x8'));var controller=require(_0xa317('0x9'));router['get']('/',auth[_0xa317('0xa')](),controller[_0xa317('0xb')]);router[_0xa317('0xc')](_0xa317('0xd'),auth[_0xa317('0xa')](),controller['describe']);router[_0xa317('0xc')]('/:id',auth[_0xa317('0xe')](),controller[_0xa317('0xf')]);router[_0xa317('0xc')](_0xa317('0x10'),auth[_0xa317('0xe')](),controller[_0xa317('0x11')]);router['get'](_0xa317('0x12'),auth['isAuthenticated'](),controller[_0xa317('0x13')]);router[_0xa317('0xc')]('/:id/my_messages',auth[_0xa317('0xe')](),controller[_0xa317('0x14')]);router['get'](_0xa317('0x15'),auth[_0xa317('0xa')](),controller[_0xa317('0x16')]);router[_0xa317('0x17')]('/',auth[_0xa317('0xa')](),controller['create']);router[_0xa317('0x17')]('/:id/vidaoo',auth[_0xa317('0xa')](),controller[_0xa317('0x18')]);var upload=multer({'storage':multer[_0xa317('0x19')]({'destination':function(_0x24d77a,_0x28be0f,_0x155a77){_0x155a77(null,path['join'](config['root'],_0xa317('0x1a')));},'filename':function(_0x26367e,_0x4eb517,_0x1355c8){_0x1355c8(null,util[_0xa317('0x1b')](_0xa317('0x1c'),Date[_0xa317('0x1d')](),_0x4eb517[_0xa317('0x1e')]['replace'](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-')));}})});router[_0xa317('0x17')](_0xa317('0x1f'),upload[_0xa317('0x20')](_0xa317('0x21')),controller[_0xa317('0x22')]);router[_0xa317('0x17')]('/:id/messages',auth[_0xa317('0xe')](),controller[_0xa317('0x23')]);router[_0xa317('0x17')](_0xa317('0x24'),auth[_0xa317('0xa')](),interaction[_0xa317('0x25')](_0xa317('0x26'),'chatinteraction:addtags'),controller[_0xa317('0x27')]);router[_0xa317('0x28')](_0xa317('0x29'),auth['isAuthenticated'](),interaction['tracked'](_0xa317('0x26'),_0xa317('0x2a')),controller[_0xa317('0x2b')]);router['put'](_0xa317('0x2c'),controller[_0xa317('0x2d')]);router[_0xa317('0x28')]('/:id/abandon',auth['isChatInteractionAuthorized'](),controller[_0xa317('0x2e')]);router[_0xa317('0x28')]('/:id/close',controller['close']);router['delete'](_0xa317('0x29'),auth[_0xa317('0xa')](),interaction[_0xa317('0x25')]('chat',_0xa317('0x2f')),controller[_0xa317('0x30')]);router['delete'](_0xa317('0x24'),auth[_0xa317('0xa')](),controller[_0xa317('0x31')]);module[_0xa317('0x32')]=router;
\ No newline at end of file
+var _0xa9f4=['attachmentDownload','/:id/messages','/:id/my_messages','getMyMessages','download','post','/:id/vidaoo','diskStorage','root','server/files/attachments/','format','%s-%s','now','originalname','/:id/attachment_upload','single','file','attachmentUpload','addMessage','/:id/tags','chat','addTags','put','tracked','chatinteraction:update','update','customUpdate','/:id/abandon','abandon','/:id/close','close','delete','destroy','removeTags','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatInteraction.controller','get','isAuthenticated','index','/describe','describe','/:id','isChatInteractionAuthorized'];(function(_0x15c421,_0x6366f7){var _0x5e5ed5=function(_0x206e66){while(--_0x206e66){_0x15c421['push'](_0x15c421['shift']());}};_0x5e5ed5(++_0x6366f7);}(_0xa9f4,0xbe));var _0x4a9f=function(_0xb3192b,_0x7d4ca8){_0xb3192b=_0xb3192b-0x0;var _0x55c461=_0xa9f4[_0xb3192b];return _0x55c461;};'use strict';var multer=require(_0x4a9f('0x0'));var util=require(_0x4a9f('0x1'));var path=require(_0x4a9f('0x2'));var timeout=require(_0x4a9f('0x3'));var express=require(_0x4a9f('0x4'));var router=express[_0x4a9f('0x5')]();var fs_extra=require(_0x4a9f('0x6'));var auth=require(_0x4a9f('0x7'));var interaction=require(_0x4a9f('0x8'));var config=require(_0x4a9f('0x9'));var controller=require(_0x4a9f('0xa'));router[_0x4a9f('0xb')]('/',auth[_0x4a9f('0xc')](),controller[_0x4a9f('0xd')]);router[_0x4a9f('0xb')](_0x4a9f('0xe'),auth['isAuthenticated'](),controller[_0x4a9f('0xf')]);router[_0x4a9f('0xb')](_0x4a9f('0x10'),auth[_0x4a9f('0x11')](),controller['show']);router[_0x4a9f('0xb')]('/:id/attachment_download',auth[_0x4a9f('0x11')](),controller[_0x4a9f('0x12')]);router['get'](_0x4a9f('0x13'),auth[_0x4a9f('0xc')](),controller['getMessages']);router['get'](_0x4a9f('0x14'),auth['isChatInteractionAuthorized'](),controller[_0x4a9f('0x15')]);router[_0x4a9f('0xb')]('/:id/download',auth[_0x4a9f('0xc')](),controller[_0x4a9f('0x16')]);router[_0x4a9f('0x17')]('/',auth[_0x4a9f('0xc')](),controller['create']);router['post'](_0x4a9f('0x18'),auth[_0x4a9f('0xc')](),controller['createVidaooSession']);var upload=multer({'storage':multer[_0x4a9f('0x19')]({'destination':function(_0x9c193a,_0x4be61b,_0x568fc1){_0x568fc1(null,path['join'](config[_0x4a9f('0x1a')],_0x4a9f('0x1b')));},'filename':function(_0x5064cf,_0x571148,_0x469197){_0x469197(null,util[_0x4a9f('0x1c')](_0x4a9f('0x1d'),Date[_0x4a9f('0x1e')](),_0x571148[_0x4a9f('0x1f')]['replace'](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-')));}})});router[_0x4a9f('0x17')](_0x4a9f('0x20'),upload[_0x4a9f('0x21')](_0x4a9f('0x22')),controller[_0x4a9f('0x23')]);router['post'](_0x4a9f('0x13'),auth[_0x4a9f('0x11')](),controller[_0x4a9f('0x24')]);router[_0x4a9f('0x17')](_0x4a9f('0x25'),auth[_0x4a9f('0xc')](),interaction['tracked'](_0x4a9f('0x26'),'chatinteraction:addtags'),controller[_0x4a9f('0x27')]);router[_0x4a9f('0x28')](_0x4a9f('0x10'),auth[_0x4a9f('0xc')](),interaction[_0x4a9f('0x29')](_0x4a9f('0x26'),_0x4a9f('0x2a')),controller[_0x4a9f('0x2b')]);router[_0x4a9f('0x28')]('/:id/custom_update',controller[_0x4a9f('0x2c')]);router[_0x4a9f('0x28')](_0x4a9f('0x2d'),auth['isChatInteractionAuthorized'](),controller[_0x4a9f('0x2e')]);router[_0x4a9f('0x28')](_0x4a9f('0x2f'),controller[_0x4a9f('0x30')]);router[_0x4a9f('0x31')](_0x4a9f('0x10'),auth[_0x4a9f('0xc')](),interaction[_0x4a9f('0x29')]('chat','chatinteraction:destroy'),controller[_0x4a9f('0x32')]);router[_0x4a9f('0x31')](_0x4a9f('0x25'),auth[_0x4a9f('0xc')](),controller[_0x4a9f('0x33')]);module['exports']=router;
\ No newline at end of file
diff --git a/server/api/chatInternalMessage/chatInternalMessage.attributes.js b/server/api/chatInternalMessage/chatInternalMessage.attributes.js
index 7177c51..8e6b99f 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 _0x0eab=['TEXT','medium','BOOLEAN','INTEGER','exports'];(function(_0x29dacb,_0x1e6ae4){var _0x52c9b8=function(_0x525e82){while(--_0x525e82){_0x29dacb['push'](_0x29dacb['shift']());}};_0x52c9b8(++_0x1e6ae4);}(_0x0eab,0x11c));var _0xb0ea=function(_0x394983,_0x1bc2ff){_0x394983=_0x394983-0x0;var _0x294f16=_0x0eab[_0x394983];return _0x294f16;};'use strict';var Sequelize=require('sequelize');module[_0xb0ea('0x0')]={'body':{'type':Sequelize[_0xb0ea('0x1')](_0xb0ea('0x2')),'allowNull':![]},'read':{'type':Sequelize[_0xb0ea('0x3')],'defaultValue':![]},'ChatInternalMessageId':{'type':Sequelize[_0xb0ea('0x4')]}};
\ No newline at end of file
+var _0x57f5=['TEXT','INTEGER','exports'];(function(_0x4642b0,_0x541c72){var _0x5e52d3=function(_0x50b0ed){while(--_0x50b0ed){_0x4642b0['push'](_0x4642b0['shift']());}};_0x5e52d3(++_0x541c72);}(_0x57f5,0xfb));var _0x557f=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x57f5[_0x3dd15e];return _0x231fd0;};'use strict';var Sequelize=require('sequelize');module[_0x557f('0x0')]={'body':{'type':Sequelize[_0x557f('0x1')]('medium'),'allowNull':![]},'read':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'ChatInternalMessageId':{'type':Sequelize[_0x557f('0x2')]}};
\ No newline at end of file
diff --git a/server/api/chatInternalMessage/chatInternalMessage.controller.js b/server/api/chatInternalMessage/chatInternalMessage.controller.js
index abef509..ed54cff 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 _0xdc6d=['mustache','util','path','sox','ejs','lodash','squel','crypto','jsforce','desk.js','to-csv','querystring','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./chatInternalMessage.socket','register','sendStatus','status','json','offset','limit','undefined','count','Content-Range','apply','reject','update','then','destroy','end','error','stack','name','send','index','map','rawAttributes','type','key','model','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','filter','where','merge','VIRTUAL','options','ChatInternalMessage','includeAll','include','catch','show','params','find','create','body','describe','get','messages','lastMessageAt','createdAt','lastMessage','YYYY-MM-DD\x20HH:mm:ss','findAll','agent','admin','user','fullname','role','internal','online','allowmessenger','-online','VoiceQueue','Agents','userProfileId','autoAssociation','isEmpty','push','read','-createdAt','all','eml-format','rimraf','zip-dir','request-promise'];(function(_0xe23713,_0x419a1b){var _0x1ac7ce=function(_0x2f51c2){while(--_0x2f51c2){_0xe23713['push'](_0xe23713['shift']());}};_0x1ac7ce(++_0x419a1b);}(_0xdc6d,0x13a));var _0xddc6=function(_0x7588a,_0x1329c9){_0x7588a=_0x7588a-0x0;var _0x4a67ef=_0xdc6d[_0x7588a];return _0x4a67ef;};'use strict';var emlformat=require(_0xddc6('0x0'));var rimraf=require(_0xddc6('0x1'));var zipdir=require(_0xddc6('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xddc6('0x3'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0xddc6('0x4'));var util=require(_0xddc6('0x5'));var path=require(_0xddc6('0x6'));var sox=require(_0xddc6('0x7'));var csv=require('to-csv');var ejs=require(_0xddc6('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xddc6('0x9'));var squel=require(_0xddc6('0xa'));var crypto=require(_0xddc6('0xb'));var jsforce=require(_0xddc6('0xc'));var deskjs=require(_0xddc6('0xd'));var toCsv=require(_0xddc6('0xe'));var querystring=require(_0xddc6('0xf'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0xddc6('0x10'));var qs=require(_0xddc6('0x11'));var as=require(_0xddc6('0x12'));var hardwareService=require(_0xddc6('0x13'));var logger=require(_0xddc6('0x14'))('api');var utils=require(_0xddc6('0x15'));var config=require(_0xddc6('0x16'));var licenseUtil=require(_0xddc6('0x17'));var db=require(_0xddc6('0x18'))['db'];config[_0xddc6('0x19')]=_[_0xddc6('0x1a')](config[_0xddc6('0x19')],{'host':_0xddc6('0x1b'),'port':0x18eb});var socket=require(_0xddc6('0x1c'))(new Redis(config['redis']));require(_0xddc6('0x1d'))[_0xddc6('0x1e')](socket);function respondWithStatusCode(_0x1298f9,_0x31e1b2){_0x31e1b2=_0x31e1b2||0xcc;return function(_0x156d8b){if(_0x156d8b){return _0x1298f9[_0xddc6('0x1f')](_0x31e1b2);}return _0x1298f9[_0xddc6('0x20')](_0x31e1b2)['end']();};}function respondWithResult(_0x42c112,_0x191cac){_0x191cac=_0x191cac||0xc8;return function(_0x53c483){if(_0x53c483){return _0x42c112[_0xddc6('0x20')](_0x191cac)[_0xddc6('0x21')](_0x53c483);}};}function respondWithFilteredResult(_0x54925d,_0x57212a){return function(_0x31be5d){if(_0x31be5d){var _0x5d9823=typeof _0x57212a[_0xddc6('0x22')]==='undefined'&&typeof _0x57212a[_0xddc6('0x23')]===_0xddc6('0x24');var _0x3813ef=_0x31be5d['count'];var _0x5cf52f=_0x5d9823?0x0:_0x57212a[_0xddc6('0x22')];var _0x41dc43=_0x5d9823?_0x31be5d[_0xddc6('0x25')]:_0x57212a[_0xddc6('0x22')]+_0x57212a[_0xddc6('0x23')];var _0x370f9f;if(_0x41dc43>=_0x3813ef){_0x41dc43=_0x3813ef;_0x370f9f=0xc8;}else{_0x370f9f=0xce;}_0x54925d[_0xddc6('0x20')](_0x370f9f);return _0x54925d['set'](_0xddc6('0x26'),_0x5cf52f+'-'+_0x41dc43+'/'+_0x3813ef)[_0xddc6('0x21')](_0x31be5d);}return null;};}function patchUpdates(_0x4d5f7b){return function(_0x2bdc07){try{jsonpatch[_0xddc6('0x27')](_0x2bdc07,_0x4d5f7b,!![]);}catch(_0x2f066a){return BPromise[_0xddc6('0x28')](_0x2f066a);}return _0x2bdc07['save']();};}function saveUpdates(_0x429f58,_0x2b2a04){return function(_0x309827){if(_0x309827){return _0x309827[_0xddc6('0x29')](_0x429f58)[_0xddc6('0x2a')](function(_0x285574){return _0x285574;});}return null;};}function removeEntity(_0x6638c5,_0x1b3e45){return function(_0x4106e0){if(_0x4106e0){return _0x4106e0[_0xddc6('0x2b')]()[_0xddc6('0x2a')](function(){_0x6638c5['status'](0xcc)[_0xddc6('0x2c')]();});}};}function handleEntityNotFound(_0x3811df,_0x2d6602){return function(_0x93ed9f){if(!_0x93ed9f){_0x3811df[_0xddc6('0x1f')](0x194);}return _0x93ed9f;};}function handleError(_0x432b92,_0x51b3ab){_0x51b3ab=_0x51b3ab||0x1f4;return function(_0x2e89b4){logger[_0xddc6('0x2d')](_0x2e89b4[_0xddc6('0x2e')]);if(_0x2e89b4['name']){delete _0x2e89b4[_0xddc6('0x2f')];}_0x432b92['status'](_0x51b3ab)[_0xddc6('0x30')](_0x2e89b4);};}exports[_0xddc6('0x31')]=function(_0x329305,_0x91af83){var _0x2376bb={},_0x47232f={},_0x3def83={'count':0x0,'rows':[]};var _0x2875c2=_[_0xddc6('0x32')](db['ChatInternalMessage'][_0xddc6('0x33')],function(_0x42b2d9){return{'name':_0x42b2d9['fieldName'],'type':_0x42b2d9[_0xddc6('0x34')][_0xddc6('0x35')]};});_0x47232f[_0xddc6('0x36')]=_[_0xddc6('0x32')](_0x2875c2,'name');_0x47232f[_0xddc6('0x37')]=_[_0xddc6('0x38')](_0x329305[_0xddc6('0x37')]);_0x47232f[_0xddc6('0x39')]=_[_0xddc6('0x3a')](_0x47232f[_0xddc6('0x36')],_0x47232f[_0xddc6('0x37')]);_0x2376bb['attributes']=_[_0xddc6('0x3a')](_0x47232f[_0xddc6('0x36')],qs[_0xddc6('0x3b')](_0x329305['query']['fields']));_0x2376bb[_0xddc6('0x3c')]=_0x2376bb['attributes'][_0xddc6('0x3d')]?_0x2376bb[_0xddc6('0x3c')]:_0x47232f['model'];if(!_0x329305['query'][_0xddc6('0x3e')](_0xddc6('0x3f'))){_0x2376bb[_0xddc6('0x23')]=qs['limit'](_0x329305[_0xddc6('0x37')][_0xddc6('0x23')]);_0x2376bb['offset']=qs['offset'](_0x329305[_0xddc6('0x37')][_0xddc6('0x22')]);}_0x2376bb[_0xddc6('0x40')]=qs[_0xddc6('0x41')](_0x329305[_0xddc6('0x37')]['sort']);_0x2376bb['where']=qs['filters'](_['pick'](_0x329305[_0xddc6('0x37')],_0x47232f[_0xddc6('0x39')]),_0x2875c2);if(_0x329305[_0xddc6('0x37')][_0xddc6('0x42')]){_0x2376bb[_0xddc6('0x43')]=_[_0xddc6('0x44')](_0x2376bb[_0xddc6('0x43')],{'$or':_[_0xddc6('0x32')](_0x2875c2,function(_0x172108){if(_0x172108[_0xddc6('0x34')]!==_0xddc6('0x45')){var _0x29b6b4={};_0x29b6b4[_0x172108['name']]={'$like':'%'+_0x329305[_0xddc6('0x37')][_0xddc6('0x42')]+'%'};return _0x29b6b4;}})});}_0x2376bb=_[_0xddc6('0x44')]({},_0x2376bb,_0x329305[_0xddc6('0x46')]);var _0x731da2={'where':_0x2376bb[_0xddc6('0x43')]};return db[_0xddc6('0x47')][_0xddc6('0x25')](_0x731da2)[_0xddc6('0x2a')](function(_0x5ba0c8){_0x3def83[_0xddc6('0x25')]=_0x5ba0c8;if(_0x329305[_0xddc6('0x37')][_0xddc6('0x48')]){_0x2376bb[_0xddc6('0x49')]=[{'all':!![]}];}return db[_0xddc6('0x47')]['findAll'](_0x2376bb);})[_0xddc6('0x2a')](function(_0x184c70){_0x3def83['rows']=_0x184c70;return _0x3def83;})['then'](respondWithFilteredResult(_0x91af83,_0x2376bb))[_0xddc6('0x4a')](handleError(_0x91af83,null));};exports[_0xddc6('0x4b')]=function(_0x4d6842,_0x39bf04){var _0x188622={'raw':!![],'where':{'id':_0x4d6842[_0xddc6('0x4c')]['id']}},_0x1004ed={};_0x1004ed[_0xddc6('0x36')]=_[_0xddc6('0x38')](db[_0xddc6('0x47')][_0xddc6('0x33')]);_0x1004ed['query']=_[_0xddc6('0x38')](_0x4d6842['query']);_0x1004ed['filters']=_['intersection'](_0x1004ed[_0xddc6('0x36')],_0x1004ed[_0xddc6('0x37')]);_0x188622[_0xddc6('0x3c')]=_['intersection'](_0x1004ed[_0xddc6('0x36')],qs[_0xddc6('0x3b')](_0x4d6842[_0xddc6('0x37')][_0xddc6('0x3b')]));_0x188622['attributes']=_0x188622['attributes'][_0xddc6('0x3d')]?_0x188622[_0xddc6('0x3c')]:_0x1004ed[_0xddc6('0x36')];if(_0x4d6842[_0xddc6('0x37')][_0xddc6('0x48')]){_0x188622[_0xddc6('0x49')]=[{'all':!![]}];}_0x188622=_['merge']({},_0x188622,_0x4d6842['options']);return db[_0xddc6('0x47')][_0xddc6('0x4d')](_0x188622)[_0xddc6('0x2a')](handleEntityNotFound(_0x39bf04,null))['then'](respondWithResult(_0x39bf04,null))[_0xddc6('0x4a')](handleError(_0x39bf04,null));};exports['create']=function(_0x1895b4,_0x15247c){return db['ChatInternalMessage'][_0xddc6('0x4e')](_0x1895b4['body'],{})['then'](respondWithResult(_0x15247c,0xc9))[_0xddc6('0x4a')](handleError(_0x15247c,null));};exports[_0xddc6('0x29')]=function(_0x266b57,_0x35299b){if(_0x266b57[_0xddc6('0x4f')]['id']){delete _0x266b57[_0xddc6('0x4f')]['id'];}return db[_0xddc6('0x47')][_0xddc6('0x4d')]({'where':{'id':_0x266b57['params']['id']}})['then'](handleEntityNotFound(_0x35299b,null))[_0xddc6('0x2a')](saveUpdates(_0x266b57[_0xddc6('0x4f')],null))[_0xddc6('0x2a')](respondWithResult(_0x35299b,null))[_0xddc6('0x4a')](handleError(_0x35299b,null));};exports[_0xddc6('0x2b')]=function(_0xf626bf,_0x43789){return db[_0xddc6('0x47')][_0xddc6('0x4d')]({'where':{'id':_0xf626bf[_0xddc6('0x4c')]['id']}})['then'](handleEntityNotFound(_0x43789,null))['then'](removeEntity(_0x43789,null))['catch'](handleError(_0x43789,null));};exports[_0xddc6('0x50')]=function(_0x1d1658,_0x264965){return db[_0xddc6('0x47')]['describe']()[_0xddc6('0x2a')](respondWithResult(_0x264965,null))[_0xddc6('0x4a')](handleError(_0x264965,null));};function wrapUser(_0x9c1fa){return function(_0x39a2e1){var _0x5a5d88=_0x9c1fa[_0xddc6('0x51')]({'plain':!![]});_0x5a5d88[_0xddc6('0x52')]=[];if(_0x39a2e1){_0x5a5d88[_0xddc6('0x53')]=_0x39a2e1[_0xddc6('0x54')];_0x5a5d88[_0xddc6('0x55')]=_0x39a2e1;}else{_0x5a5d88['lastMessageAt']=moment(0x0)['format'](_0xddc6('0x56'));_0x5a5d88[_0xddc6('0x55')]={};}return _0x5a5d88;};}exports['getUsers']=function(_0x5eeca9,_0x5e7963,_0x5a9fef){var _0x3796a5=[];return db['User'][_0xddc6('0x57')]({'where':{'role':[_0xddc6('0x58'),_0xddc6('0x59'),_0xddc6('0x5a')]},'attributes':['id',_0xddc6('0x5b'),_0xddc6('0x2f'),_0xddc6('0x5c'),'userpic',_0xddc6('0x5d'),_0xddc6('0x5e'),'lastLoginAt',_0xddc6('0x5f'),'showWebBar'],'order':qs[_0xddc6('0x41')](_0xddc6('0x60')),'include':[{'model':db[_0xddc6('0x61')],'as':'VoiceQueues','attributes':['id',_0xddc6('0x2f'),'type'],'through':{'attributes':[]}}]})[_0xddc6('0x2a')](function(_0x2c205b){if(_0x2c205b){var _0x49ee4b=_0x5eeca9[_0xddc6('0x5a')][_0xddc6('0x51')]({'plain':!![]});if(!_0x49ee4b)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x49ee4b[_0xddc6('0x5c')]===_0xddc6('0x5a')){return db['UserProfileSection'][_0xddc6('0x4d')]({'where':{'name':_0xddc6('0x62'),'userProfileId':_0x49ee4b[_0xddc6('0x63')]},'raw':!![]})[_0xddc6('0x2a')](function(_0x20db95){if(_0x20db95){if(_0x20db95[_0xddc6('0x64')]===0x0){return db['UserProfileResource'][_0xddc6('0x57')]({'where':{'sectionId':_0x20db95['id']},'raw':!![]})['then'](function(_0x8a53c1){var _0x4c534f=[];if(_[_0xddc6('0x65')](_0x8a53c1)){_0x4c534f=_['filter'](_0x2c205b,function(_0x29351a){if(_0x29351a[_0xddc6('0x5c')]!==_0xddc6('0x58')){return _0x29351a;}});return _0x4c534f;}else{for(var _0xa58a66=0x0;_0xa58a66<_0x2c205b['length'];_0xa58a66++){var _0x1e5d80=_0x2c205b[_0xa58a66];if(_0x1e5d80[_0xddc6('0x5c')]===_0xddc6('0x58')){var _0x1a79a3=_[_0xddc6('0x4d')](_0x8a53c1,function(_0x3f4e09){return _0x3f4e09['resourceId']===_0x1e5d80['id'];});if(_0x1a79a3)_0x4c534f[_0xddc6('0x66')](_0x1e5d80);}else{_0x4c534f[_0xddc6('0x66')](_0x1e5d80);}}return _0x4c534f;}});}else{return _0x2c205b;}}else{var _0x4f0885=_[_0xddc6('0x42')](_0x2c205b,function(_0x5cade6){if(_0x5cade6[_0xddc6('0x5c')]!==_0xddc6('0x58')){return _0x5cade6;}});return _0x4f0885;}});}else{return _0x2c205b;}}})[_0xddc6('0x2a')](function(_0x405129){var _0x595c42=[];if(_0x405129){_0x3796a5=_0x405129;for(var _0x2386a9=0x0;_0x2386a9<_0x405129['length'];_0x2386a9+=0x1){_0x3796a5[_0x2386a9][_0xddc6('0x52')]=[];_0x595c42['push'](db[_0xddc6('0x47')][_0xddc6('0x4d')]({'where':{'FromId':[_0x5eeca9[_0xddc6('0x5a')]['id'],_0x405129[_0x2386a9]['id']],'ToId':[_0x5eeca9['user']['id'],_0x405129[_0x2386a9]['id']],'ChatGroupId':null},'attributes':['id','createdAt','FromId','ToId',_0xddc6('0x67'),_0xddc6('0x4f')],'order':qs[_0xddc6('0x41')](_0xddc6('0x68')),'limit':0x1,'offset':0x0,'raw':!![]})[_0xddc6('0x2a')](wrapUser(_0x405129[_0x2386a9])));}return BPromise[_0xddc6('0x69')](_0x595c42);}return[];})[_0xddc6('0x2a')](function(_0x324ef4){return{'rows':_0x324ef4,'count':_0x324ef4[_0xddc6('0x3d')]};})[_0xddc6('0x2a')](respondWithResult(_0x5e7963,null))[_0xddc6('0x4a')](handleError(_0x5e7963,null));};
\ No newline at end of file
+var _0xb8cb=['stack','name','send','index','map','rawAttributes','fieldName','keys','query','filters','intersection','model','fields','attributes','hasOwnProperty','nolimit','order','sort','pick','filter','where','type','VIRTUAL','merge','ChatInternalMessage','includeAll','include','findAll','catch','length','options','find','create','body','params','describe','get','messages','lastMessageAt','format','YYYY-MM-DD\x20HH:mm:ss','lastMessage','getUsers','User','agent','admin','user','role','userpic','internal','lastLoginAt','allowmessenger','showWebBar','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','Agents','userProfileId','autoAssociation','UserProfileResource','push','createdAt','FromId','ToId','read','all','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path','to-csv','fs-extra','squel','crypto','jsforce','papaparse','ioredis','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./chatInternalMessage.socket','register','sendStatus','status','offset','limit','count','set','Content-Range','json','apply','save','update','then','destroy','end','error'];(function(_0x4a2acb,_0x263021){var _0x3ec7fa=function(_0x218fbf){while(--_0x218fbf){_0x4a2acb['push'](_0x4a2acb['shift']());}};_0x3ec7fa(++_0x263021);}(_0xb8cb,0x188));var _0xbb8c=function(_0x2cf4f1,_0x81dac6){_0x2cf4f1=_0x2cf4f1-0x0;var _0x574a66=_0xb8cb[_0x2cf4f1];return _0x574a66;};'use strict';var emlformat=require(_0xbb8c('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xbb8c('0x1'));var jsonpatch=require(_0xbb8c('0x2'));var rp=require(_0xbb8c('0x3'));var moment=require(_0xbb8c('0x4'));var BPromise=require(_0xbb8c('0x5'));var Mustache=require(_0xbb8c('0x6'));var util=require('util');var path=require(_0xbb8c('0x7'));var sox=require('sox');var csv=require(_0xbb8c('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xbb8c('0x9'));var _=require('lodash');var squel=require(_0xbb8c('0xa'));var crypto=require(_0xbb8c('0xb'));var jsforce=require(_0xbb8c('0xc'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0xbb8c('0xd'));var Redis=require(_0xbb8c('0xe'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0xbb8c('0xf'));var hardwareService=require(_0xbb8c('0x10'));var logger=require(_0xbb8c('0x11'))(_0xbb8c('0x12'));var utils=require(_0xbb8c('0x13'));var config=require(_0xbb8c('0x14'));var licenseUtil=require(_0xbb8c('0x15'));var db=require(_0xbb8c('0x16'))['db'];config[_0xbb8c('0x17')]=_[_0xbb8c('0x18')](config['redis'],{'host':_0xbb8c('0x19'),'port':0x18eb});var socket=require(_0xbb8c('0x1a'))(new Redis(config['redis']));require(_0xbb8c('0x1b'))[_0xbb8c('0x1c')](socket);function respondWithStatusCode(_0x19380b,_0x52bb2b){_0x52bb2b=_0x52bb2b||0xcc;return function(_0x349904){if(_0x349904){return _0x19380b[_0xbb8c('0x1d')](_0x52bb2b);}return _0x19380b[_0xbb8c('0x1e')](_0x52bb2b)['end']();};}function respondWithResult(_0x4b35c7,_0x61482a){_0x61482a=_0x61482a||0xc8;return function(_0x5a7a11){if(_0x5a7a11){return _0x4b35c7['status'](_0x61482a)['json'](_0x5a7a11);}};}function respondWithFilteredResult(_0x531d54,_0x1042e5){return function(_0x32d077){if(_0x32d077){var _0x28789b=typeof _0x1042e5[_0xbb8c('0x1f')]==='undefined'&&typeof _0x1042e5[_0xbb8c('0x20')]==='undefined';var _0x967293=_0x32d077[_0xbb8c('0x21')];var _0x3096b3=_0x28789b?0x0:_0x1042e5[_0xbb8c('0x1f')];var _0x5162b1=_0x28789b?_0x32d077['count']:_0x1042e5[_0xbb8c('0x1f')]+_0x1042e5[_0xbb8c('0x20')];var _0x5845ee;if(_0x5162b1>=_0x967293){_0x5162b1=_0x967293;_0x5845ee=0xc8;}else{_0x5845ee=0xce;}_0x531d54['status'](_0x5845ee);return _0x531d54[_0xbb8c('0x22')](_0xbb8c('0x23'),_0x3096b3+'-'+_0x5162b1+'/'+_0x967293)[_0xbb8c('0x24')](_0x32d077);}return null;};}function patchUpdates(_0x648b55){return function(_0x5ecc08){try{jsonpatch[_0xbb8c('0x25')](_0x5ecc08,_0x648b55,!![]);}catch(_0x5307b1){return BPromise['reject'](_0x5307b1);}return _0x5ecc08[_0xbb8c('0x26')]();};}function saveUpdates(_0x177581,_0x2d572f){return function(_0x124c6e){if(_0x124c6e){return _0x124c6e[_0xbb8c('0x27')](_0x177581)[_0xbb8c('0x28')](function(_0x212529){return _0x212529;});}return null;};}function removeEntity(_0x3c158a,_0x365723){return function(_0x2303f8){if(_0x2303f8){return _0x2303f8[_0xbb8c('0x29')]()[_0xbb8c('0x28')](function(){_0x3c158a[_0xbb8c('0x1e')](0xcc)[_0xbb8c('0x2a')]();});}};}function handleEntityNotFound(_0xe69607,_0x446238){return function(_0xfd53a6){if(!_0xfd53a6){_0xe69607[_0xbb8c('0x1d')](0x194);}return _0xfd53a6;};}function handleError(_0x18713a,_0x4cc480){_0x4cc480=_0x4cc480||0x1f4;return function(_0x554030){logger[_0xbb8c('0x2b')](_0x554030[_0xbb8c('0x2c')]);if(_0x554030[_0xbb8c('0x2d')]){delete _0x554030[_0xbb8c('0x2d')];}_0x18713a[_0xbb8c('0x1e')](_0x4cc480)[_0xbb8c('0x2e')](_0x554030);};}exports[_0xbb8c('0x2f')]=function(_0x5461b0,_0x504951){var _0x5ba687={},_0x439d66={},_0xd51612={'count':0x0,'rows':[]};var _0x58a85f=_[_0xbb8c('0x30')](db['ChatInternalMessage'][_0xbb8c('0x31')],function(_0x1d58d4){return{'name':_0x1d58d4[_0xbb8c('0x32')],'type':_0x1d58d4['type']['key']};});_0x439d66['model']=_[_0xbb8c('0x30')](_0x58a85f,_0xbb8c('0x2d'));_0x439d66['query']=_[_0xbb8c('0x33')](_0x5461b0[_0xbb8c('0x34')]);_0x439d66[_0xbb8c('0x35')]=_[_0xbb8c('0x36')](_0x439d66['model'],_0x439d66['query']);_0x5ba687['attributes']=_[_0xbb8c('0x36')](_0x439d66[_0xbb8c('0x37')],qs[_0xbb8c('0x38')](_0x5461b0['query'][_0xbb8c('0x38')]));_0x5ba687[_0xbb8c('0x39')]=_0x5ba687[_0xbb8c('0x39')]['length']?_0x5ba687[_0xbb8c('0x39')]:_0x439d66[_0xbb8c('0x37')];if(!_0x5461b0[_0xbb8c('0x34')][_0xbb8c('0x3a')](_0xbb8c('0x3b'))){_0x5ba687[_0xbb8c('0x20')]=qs['limit'](_0x5461b0[_0xbb8c('0x34')][_0xbb8c('0x20')]);_0x5ba687[_0xbb8c('0x1f')]=qs[_0xbb8c('0x1f')](_0x5461b0[_0xbb8c('0x34')][_0xbb8c('0x1f')]);}_0x5ba687[_0xbb8c('0x3c')]=qs[_0xbb8c('0x3d')](_0x5461b0[_0xbb8c('0x34')]['sort']);_0x5ba687['where']=qs[_0xbb8c('0x35')](_[_0xbb8c('0x3e')](_0x5461b0[_0xbb8c('0x34')],_0x439d66[_0xbb8c('0x35')]),_0x58a85f);if(_0x5461b0['query'][_0xbb8c('0x3f')]){_0x5ba687[_0xbb8c('0x40')]=_['merge'](_0x5ba687['where'],{'$or':_[_0xbb8c('0x30')](_0x58a85f,function(_0xae6228){if(_0xae6228[_0xbb8c('0x41')]!==_0xbb8c('0x42')){var _0x1e82f7={};_0x1e82f7[_0xae6228[_0xbb8c('0x2d')]]={'$like':'%'+_0x5461b0[_0xbb8c('0x34')][_0xbb8c('0x3f')]+'%'};return _0x1e82f7;}})});}_0x5ba687=_[_0xbb8c('0x43')]({},_0x5ba687,_0x5461b0['options']);var _0x3984a4={'where':_0x5ba687[_0xbb8c('0x40')]};return db[_0xbb8c('0x44')]['count'](_0x3984a4)[_0xbb8c('0x28')](function(_0x3df52d){_0xd51612[_0xbb8c('0x21')]=_0x3df52d;if(_0x5461b0[_0xbb8c('0x34')][_0xbb8c('0x45')]){_0x5ba687[_0xbb8c('0x46')]=[{'all':!![]}];}return db[_0xbb8c('0x44')][_0xbb8c('0x47')](_0x5ba687);})['then'](function(_0xe5acfa){_0xd51612['rows']=_0xe5acfa;return _0xd51612;})['then'](respondWithFilteredResult(_0x504951,_0x5ba687))[_0xbb8c('0x48')](handleError(_0x504951,null));};exports['show']=function(_0x1e3513,_0x3079e7){var _0x1fff72={'raw':!![],'where':{'id':_0x1e3513['params']['id']}},_0x56af41={};_0x56af41[_0xbb8c('0x37')]=_[_0xbb8c('0x33')](db[_0xbb8c('0x44')][_0xbb8c('0x31')]);_0x56af41[_0xbb8c('0x34')]=_['keys'](_0x1e3513[_0xbb8c('0x34')]);_0x56af41[_0xbb8c('0x35')]=_['intersection'](_0x56af41['model'],_0x56af41[_0xbb8c('0x34')]);_0x1fff72[_0xbb8c('0x39')]=_[_0xbb8c('0x36')](_0x56af41[_0xbb8c('0x37')],qs[_0xbb8c('0x38')](_0x1e3513['query'][_0xbb8c('0x38')]));_0x1fff72[_0xbb8c('0x39')]=_0x1fff72[_0xbb8c('0x39')][_0xbb8c('0x49')]?_0x1fff72[_0xbb8c('0x39')]:_0x56af41[_0xbb8c('0x37')];if(_0x1e3513[_0xbb8c('0x34')][_0xbb8c('0x45')]){_0x1fff72[_0xbb8c('0x46')]=[{'all':!![]}];}_0x1fff72=_['merge']({},_0x1fff72,_0x1e3513[_0xbb8c('0x4a')]);return db[_0xbb8c('0x44')][_0xbb8c('0x4b')](_0x1fff72)[_0xbb8c('0x28')](handleEntityNotFound(_0x3079e7,null))[_0xbb8c('0x28')](respondWithResult(_0x3079e7,null))[_0xbb8c('0x48')](handleError(_0x3079e7,null));};exports[_0xbb8c('0x4c')]=function(_0x5666ff,_0x4cf050){return db[_0xbb8c('0x44')][_0xbb8c('0x4c')](_0x5666ff[_0xbb8c('0x4d')],{})[_0xbb8c('0x28')](respondWithResult(_0x4cf050,0xc9))['catch'](handleError(_0x4cf050,null));};exports[_0xbb8c('0x27')]=function(_0x4253ee,_0x1b1e0e){if(_0x4253ee[_0xbb8c('0x4d')]['id']){delete _0x4253ee[_0xbb8c('0x4d')]['id'];}return db[_0xbb8c('0x44')][_0xbb8c('0x4b')]({'where':{'id':_0x4253ee[_0xbb8c('0x4e')]['id']}})['then'](handleEntityNotFound(_0x1b1e0e,null))[_0xbb8c('0x28')](saveUpdates(_0x4253ee[_0xbb8c('0x4d')],null))[_0xbb8c('0x28')](respondWithResult(_0x1b1e0e,null))[_0xbb8c('0x48')](handleError(_0x1b1e0e,null));};exports[_0xbb8c('0x29')]=function(_0x5a40fa,_0x25627c){return db[_0xbb8c('0x44')][_0xbb8c('0x4b')]({'where':{'id':_0x5a40fa['params']['id']}})[_0xbb8c('0x28')](handleEntityNotFound(_0x25627c,null))[_0xbb8c('0x28')](removeEntity(_0x25627c,null))[_0xbb8c('0x48')](handleError(_0x25627c,null));};exports[_0xbb8c('0x4f')]=function(_0x497234,_0x234ef9){return db[_0xbb8c('0x44')]['describe']()[_0xbb8c('0x28')](respondWithResult(_0x234ef9,null))['catch'](handleError(_0x234ef9,null));};function wrapUser(_0x1554b8){return function(_0x4d4f1e){var _0x2cd664=_0x1554b8[_0xbb8c('0x50')]({'plain':!![]});_0x2cd664[_0xbb8c('0x51')]=[];if(_0x4d4f1e){_0x2cd664[_0xbb8c('0x52')]=_0x4d4f1e['createdAt'];_0x2cd664['lastMessage']=_0x4d4f1e;}else{_0x2cd664[_0xbb8c('0x52')]=moment(0x0)[_0xbb8c('0x53')](_0xbb8c('0x54'));_0x2cd664[_0xbb8c('0x55')]={};}return _0x2cd664;};}exports[_0xbb8c('0x56')]=function(_0x420230,_0x5e1414,_0x2a92ab){var _0x30318d=[];return db[_0xbb8c('0x57')][_0xbb8c('0x47')]({'where':{'role':[_0xbb8c('0x58'),_0xbb8c('0x59'),_0xbb8c('0x5a')]},'attributes':['id','fullname',_0xbb8c('0x2d'),_0xbb8c('0x5b'),_0xbb8c('0x5c'),_0xbb8c('0x5d'),'online',_0xbb8c('0x5e'),_0xbb8c('0x5f'),_0xbb8c('0x60')],'order':qs['sort']('-online'),'include':[{'model':db['VoiceQueue'],'as':'VoiceQueues','attributes':['id',_0xbb8c('0x2d'),_0xbb8c('0x41')],'through':{'attributes':[]}}]})[_0xbb8c('0x28')](function(_0x3e2734){if(_0x3e2734){var _0x266a40=_0x420230[_0xbb8c('0x5a')][_0xbb8c('0x50')]({'plain':!![]});if(!_0x266a40)throw new Error(_0xbb8c('0x61'));if(_0x266a40[_0xbb8c('0x5b')]==='user'){return db[_0xbb8c('0x62')][_0xbb8c('0x4b')]({'where':{'name':_0xbb8c('0x63'),'userProfileId':_0x266a40[_0xbb8c('0x64')]},'raw':!![]})[_0xbb8c('0x28')](function(_0x4326a5){if(_0x4326a5){if(_0x4326a5[_0xbb8c('0x65')]===0x0){return db[_0xbb8c('0x66')][_0xbb8c('0x47')]({'where':{'sectionId':_0x4326a5['id']},'raw':!![]})[_0xbb8c('0x28')](function(_0x2d0d15){var _0x2ff6de=[];if(_['isEmpty'](_0x2d0d15)){_0x2ff6de=_[_0xbb8c('0x3f')](_0x3e2734,function(_0x4d869c){if(_0x4d869c[_0xbb8c('0x5b')]!==_0xbb8c('0x58')){return _0x4d869c;}});return _0x2ff6de;}else{for(var _0x4e2f59=0x0;_0x4e2f59<_0x3e2734[_0xbb8c('0x49')];_0x4e2f59++){var _0x308f9a=_0x3e2734[_0x4e2f59];if(_0x308f9a['role']===_0xbb8c('0x58')){var _0x1f77b2=_[_0xbb8c('0x4b')](_0x2d0d15,function(_0x24a4df){return _0x24a4df['resourceId']===_0x308f9a['id'];});if(_0x1f77b2)_0x2ff6de[_0xbb8c('0x67')](_0x308f9a);}else{_0x2ff6de[_0xbb8c('0x67')](_0x308f9a);}}return _0x2ff6de;}});}else{return _0x3e2734;}}else{var _0x18ae02=_[_0xbb8c('0x3f')](_0x3e2734,function(_0x3d5dc2){if(_0x3d5dc2['role']!==_0xbb8c('0x58')){return _0x3d5dc2;}});return _0x18ae02;}});}else{return _0x3e2734;}}})['then'](function(_0x884903){var _0x45a512=[];if(_0x884903){_0x30318d=_0x884903;for(var _0x40de9c=0x0;_0x40de9c<_0x884903[_0xbb8c('0x49')];_0x40de9c+=0x1){_0x30318d[_0x40de9c][_0xbb8c('0x51')]=[];_0x45a512[_0xbb8c('0x67')](db[_0xbb8c('0x44')][_0xbb8c('0x4b')]({'where':{'FromId':[_0x420230['user']['id'],_0x884903[_0x40de9c]['id']],'ToId':[_0x420230[_0xbb8c('0x5a')]['id'],_0x884903[_0x40de9c]['id']],'ChatGroupId':null},'attributes':['id',_0xbb8c('0x68'),_0xbb8c('0x69'),_0xbb8c('0x6a'),_0xbb8c('0x6b'),_0xbb8c('0x4d')],'order':qs[_0xbb8c('0x3d')]('-createdAt'),'limit':0x1,'offset':0x0,'raw':!![]})[_0xbb8c('0x28')](wrapUser(_0x884903[_0x40de9c])));}return BPromise[_0xbb8c('0x6c')](_0x45a512);}return[];})[_0xbb8c('0x28')](function(_0x3e8728){return{'rows':_0x3e8728,'count':_0x3e8728['length']};})['then'](respondWithResult(_0x5e1414,null))[_0xbb8c('0x48')](handleError(_0x5e1414,null));};
\ No newline at end of file
diff --git a/server/api/chatInternalMessage/chatInternalMessage.events.js b/server/api/chatInternalMessage/chatInternalMessage.events.js
index e0ef6a5..a30b89e 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 _0x889c=['update','emit','hasOwnProperty','exports','events','setMaxListeners','save'];(function(_0x18b191,_0x4e0684){var _0x43e146=function(_0x4b464e){while(--_0x4b464e){_0x18b191['push'](_0x18b191['shift']());}};_0x43e146(++_0x4e0684);}(_0x889c,0x12a));var _0xc889=function(_0x15d0b7,_0x46205a){_0x15d0b7=_0x15d0b7-0x0;var _0x18ed18=_0x889c[_0x15d0b7];return _0x18ed18;};'use strict';var EventEmitter=require(_0xc889('0x0'));var ChatInternalMessage=require('../../mysqldb')['db']['ChatInternalMessage'];var ChatInternalMessageEvents=new EventEmitter();ChatInternalMessageEvents[_0xc889('0x1')](0x0);var events={'afterCreate':_0xc889('0x2'),'afterUpdate':_0xc889('0x3'),'afterDestroy':'remove'};function emitEvent(_0x33e1fa){return function(_0x4202c6,_0x353e5f,_0x32131d){ChatInternalMessageEvents[_0xc889('0x4')](_0x33e1fa+':'+_0x4202c6['id'],_0x4202c6);ChatInternalMessageEvents[_0xc889('0x4')](_0x33e1fa,_0x4202c6);_0x32131d(null);};}for(var e in events){if(events[_0xc889('0x5')](e)){var event=events[e];ChatInternalMessage['hook'](e,emitEvent(event));}}module[_0xc889('0x6')]=ChatInternalMessageEvents;
\ No newline at end of file
+var _0x707b=['exports','events','../../mysqldb','ChatInternalMessage','save','emit'];(function(_0x4b2b03,_0xbf34ee){var _0x1bf0ed=function(_0x562785){while(--_0x562785){_0x4b2b03['push'](_0x4b2b03['shift']());}};_0x1bf0ed(++_0xbf34ee);}(_0x707b,0xdf));var _0xb707=function(_0x309e57,_0xe1c277){_0x309e57=_0x309e57-0x0;var _0x313c98=_0x707b[_0x309e57];return _0x313c98;};'use strict';var EventEmitter=require(_0xb707('0x0'));var ChatInternalMessage=require(_0xb707('0x1'))['db'][_0xb707('0x2')];var ChatInternalMessageEvents=new EventEmitter();ChatInternalMessageEvents['setMaxListeners'](0x0);var events={'afterCreate':_0xb707('0x3'),'afterUpdate':'update','afterDestroy':'remove'};function emitEvent(_0xe4c060){return function(_0x5db6ce,_0x39cd37,_0x157b23){ChatInternalMessageEvents[_0xb707('0x4')](_0xe4c060+':'+_0x5db6ce['id'],_0x5db6ce);ChatInternalMessageEvents['emit'](_0xe4c060,_0x5db6ce);_0x157b23(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];ChatInternalMessage['hook'](e,emitEvent(event));}}module[_0xb707('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 18b1679..cdf6ab3 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 _0x5c37=['lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','./chatInternalMessage.attributes','exports','define','utf8mb4'];(function(_0x53de6d,_0x244850){var _0x386bf2=function(_0x104136){while(--_0x104136){_0x53de6d['push'](_0x53de6d['shift']());}};_0x386bf2(++_0x244850);}(_0x5c37,0xd8));var _0x75c3=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0x5c37[_0x321bb2];return _0x9c12ed;};'use strict';var _=require(_0x75c3('0x0'));var util=require(_0x75c3('0x1'));var logger=require(_0x75c3('0x2'))(_0x75c3('0x3'));var moment=require(_0x75c3('0x4'));var BPromise=require(_0x75c3('0x5'));var rp=require(_0x75c3('0x6'));var fs=require('fs');var path=require(_0x75c3('0x7'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x75c3('0x8'));module[_0x75c3('0x9')]=function(_0x556ba1,_0x3d6e71){return _0x556ba1[_0x75c3('0xa')]('ChatInternalMessage',attributes,{'tableName':'chat_internal_messages','paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x75c3('0xb'),'collate':'utf8mb4_unicode_ci'});};
\ No newline at end of file
+var _0xc2e0=['util','bluebird','request-promise','rimraf','exports','ChatInternalMessage','chat_internal_messages','utf8mb4_unicode_ci','lodash'];(function(_0x474bc0,_0x26989c){var _0x4b24cf=function(_0x4be866){while(--_0x4be866){_0x474bc0['push'](_0x474bc0['shift']());}};_0x4b24cf(++_0x26989c);}(_0xc2e0,0xfb));var _0x0c2e=function(_0x52d881,_0x3a47c9){_0x52d881=_0x52d881-0x0;var _0x41d8af=_0xc2e0[_0x52d881];return _0x41d8af;};'use strict';var _=require(_0x0c2e('0x0'));var util=require(_0x0c2e('0x1'));var logger=require('../../config/logger')('api');var moment=require('moment');var BPromise=require(_0x0c2e('0x2'));var rp=require(_0x0c2e('0x3'));var fs=require('fs');var path=require('path');var rimraf=require(_0x0c2e('0x4'));var config=require('../../config/environment');var attributes=require('./chatInternalMessage.attributes');module[_0x0c2e('0x5')]=function(_0x563b1a,_0x514d89){return _0x563b1a['define'](_0x0c2e('0x6'),attributes,{'tableName':_0x0c2e('0x7'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':'utf8mb4','collate':_0x0c2e('0x8')});};
\ No newline at end of file
diff --git a/server/api/chatInternalMessage/chatInternalMessage.rpc.js b/server/api/chatInternalMessage/chatInternalMessage.rpc.js
index e7ddd34..1ac5404 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 _0xdc39=['randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','redis','localhost','socket.io-emitter','./chatInternalMessage.socket','request','then','info','ChatInternalMessage,\x20%s,\x20%s','request\x20sent','debug','ChatInternalMessage,\x20%s,\x20%s,\x20%s','stringify','error','message','result','util','moment','bluebird'];(function(_0x3669b6,_0x45083a){var _0xc34609=function(_0x47ee49){while(--_0x47ee49){_0x3669b6['push'](_0x3669b6['shift']());}};_0xc34609(++_0x45083a);}(_0xdc39,0x169));var _0x9dc3=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xdc39[_0x3dd15e];return _0x231fd0;};'use strict';var _=require('lodash');var util=require(_0x9dc3('0x0'));var moment=require(_0x9dc3('0x1'));var BPromise=require(_0x9dc3('0x2'));var rs=require(_0x9dc3('0x3'));var fs=require('fs');var Redis=require(_0x9dc3('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x9dc3('0x5'));var logger=require(_0x9dc3('0x6'))(_0x9dc3('0x7'));var config=require(_0x9dc3('0x8'));var jayson=require('jayson/promise');var client=jayson[_0x9dc3('0x9')][_0x9dc3('0xa')]({'port':0x232a});config[_0x9dc3('0xb')]=_['defaults'](config['redis'],{'host':_0x9dc3('0xc'),'port':0x18eb});var socket=require(_0x9dc3('0xd'))(new Redis(config[_0x9dc3('0xb')]));require(_0x9dc3('0xe'))['register'](socket);function respondWithRpcPromise(_0x4c1ca6,_0x28d064,_0x43ed46){return new BPromise(function(_0x36bdb7,_0x53f37b){return client[_0x9dc3('0xf')](_0x4c1ca6,_0x43ed46)[_0x9dc3('0x10')](function(_0x29ba7c){logger[_0x9dc3('0x11')](_0x9dc3('0x12'),_0x28d064,_0x9dc3('0x13'));logger[_0x9dc3('0x14')](_0x9dc3('0x15'),_0x28d064,_0x9dc3('0x13'),JSON[_0x9dc3('0x16')](_0x29ba7c));if(_0x29ba7c[_0x9dc3('0x17')]){if(_0x29ba7c['error']['code']===0x1f4){logger[_0x9dc3('0x17')](_0x9dc3('0x12'),_0x28d064,_0x29ba7c[_0x9dc3('0x17')][_0x9dc3('0x18')]);return _0x53f37b(_0x29ba7c[_0x9dc3('0x17')][_0x9dc3('0x18')]);}logger[_0x9dc3('0x17')]('ChatInternalMessage,\x20%s,\x20%s',_0x28d064,_0x29ba7c[_0x9dc3('0x17')][_0x9dc3('0x18')]);return _0x36bdb7(_0x29ba7c['error'][_0x9dc3('0x18')]);}else{logger[_0x9dc3('0x11')](_0x9dc3('0x12'),_0x28d064,_0x9dc3('0x13'));_0x36bdb7(_0x29ba7c[_0x9dc3('0x19')][_0x9dc3('0x18')]);}})['catch'](function(_0x5a3ff4){logger[_0x9dc3('0x17')](_0x9dc3('0x12'),_0x28d064,_0x5a3ff4);_0x53f37b(_0x5a3ff4);});});}
\ No newline at end of file
+var _0xeae4=['../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','./chatInternalMessage.socket','register','then','info','ChatInternalMessage,\x20%s,\x20%s','request\x20sent','stringify','error','message','catch','lodash','util','bluebird','randomstring','ioredis'];(function(_0x1c2a31,_0x5ab97a){var _0xaabd37=function(_0x509d64){while(--_0x509d64){_0x1c2a31['push'](_0x1c2a31['shift']());}};_0xaabd37(++_0x5ab97a);}(_0xeae4,0x78));var _0x4eae=function(_0x2fb6e3,_0x1282d2){_0x2fb6e3=_0x2fb6e3-0x0;var _0xe2db47=_0xeae4[_0x2fb6e3];return _0xe2db47;};'use strict';var _=require(_0x4eae('0x0'));var util=require(_0x4eae('0x1'));var moment=require('moment');var BPromise=require(_0x4eae('0x2'));var rs=require(_0x4eae('0x3'));var fs=require('fs');var Redis=require(_0x4eae('0x4'));var db=require(_0x4eae('0x5'))['db'];var utils=require(_0x4eae('0x6'));var logger=require('../../config/logger')(_0x4eae('0x7'));var config=require(_0x4eae('0x8'));var jayson=require(_0x4eae('0x9'));var client=jayson[_0x4eae('0xa')][_0x4eae('0xb')]({'port':0x232a});config[_0x4eae('0xc')]=_[_0x4eae('0xd')](config[_0x4eae('0xc')],{'host':_0x4eae('0xe'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x4eae('0xc')]));require(_0x4eae('0xf'))[_0x4eae('0x10')](socket);function respondWithRpcPromise(_0x48da8a,_0x8f9aab,_0x4b9d93){return new BPromise(function(_0x171bdc,_0x5e309a){return client['request'](_0x48da8a,_0x4b9d93)[_0x4eae('0x11')](function(_0x117e54){logger[_0x4eae('0x12')](_0x4eae('0x13'),_0x8f9aab,_0x4eae('0x14'));logger['debug']('ChatInternalMessage,\x20%s,\x20%s,\x20%s',_0x8f9aab,_0x4eae('0x14'),JSON[_0x4eae('0x15')](_0x117e54));if(_0x117e54[_0x4eae('0x16')]){if(_0x117e54[_0x4eae('0x16')]['code']===0x1f4){logger[_0x4eae('0x16')](_0x4eae('0x13'),_0x8f9aab,_0x117e54['error'][_0x4eae('0x17')]);return _0x5e309a(_0x117e54[_0x4eae('0x16')][_0x4eae('0x17')]);}logger['error'](_0x4eae('0x13'),_0x8f9aab,_0x117e54[_0x4eae('0x16')][_0x4eae('0x17')]);return _0x171bdc(_0x117e54['error']['message']);}else{logger[_0x4eae('0x12')]('ChatInternalMessage,\x20%s,\x20%s',_0x8f9aab,'request\x20sent');_0x171bdc(_0x117e54['result'][_0x4eae('0x17')]);}})[_0x4eae('0x18')](function(_0x25e2f6){logger[_0x4eae('0x16')](_0x4eae('0x13'),_0x8f9aab,_0x25e2f6);_0x5e309a(_0x25e2f6);});});}
\ No newline at end of file
diff --git a/server/api/chatInternalMessage/chatInternalMessage.socket.js b/server/api/chatInternalMessage/chatInternalMessage.socket.js
index c6620b5..8dcdcda 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 _0x83a5=['./chatInternalMessage.events','save','remove','update','emit','length','chatInternalMessage:'];(function(_0x502c7d,_0x2f1285){var _0x30b7ed=function(_0x2d92f3){while(--_0x2d92f3){_0x502c7d['push'](_0x502c7d['shift']());}};_0x30b7ed(++_0x2f1285);}(_0x83a5,0x111));var _0x583a=function(_0x2bd72b,_0x4fd8ed){_0x2bd72b=_0x2bd72b-0x0;var _0x279f43=_0x83a5[_0x2bd72b];return _0x279f43;};'use strict';var ChatInternalMessageEvents=require(_0x583a('0x0'));var events=[_0x583a('0x1'),_0x583a('0x2'),_0x583a('0x3')];function createListener(_0x93d1fd,_0x54633b){return function(_0x51bf25){_0x54633b[_0x583a('0x4')](_0x93d1fd,_0x51bf25);};}function removeListener(_0x3b46db,_0x5831fc){return function(){ChatInternalMessageEvents['removeListener'](_0x3b46db,_0x5831fc);};}exports['register']=function(_0x24ebb4){for(var _0x1cc13e=0x0,_0x10c9f1=events[_0x583a('0x5')];_0x1cc13e<_0x10c9f1;_0x1cc13e++){var _0x42e431=events[_0x1cc13e];var _0x263fc3=createListener(_0x583a('0x6')+_0x42e431,_0x24ebb4);ChatInternalMessageEvents['on'](_0x42e431,_0x263fc3);}};
\ No newline at end of file
+var _0xce8d=['remove','update','emit','removeListener','length','./chatInternalMessage.events'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xce8d,0x11f));var _0xdce8=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xce8d[_0x3dd15e];return _0x231fd0;};'use strict';var ChatInternalMessageEvents=require(_0xdce8('0x0'));var events=['save',_0xdce8('0x1'),_0xdce8('0x2')];function createListener(_0x4ae4cf,_0x91eaa6){return function(_0x5d5b9a){_0x91eaa6[_0xdce8('0x3')](_0x4ae4cf,_0x5d5b9a);};}function removeListener(_0x57eeb1,_0x3429a1){return function(){ChatInternalMessageEvents[_0xdce8('0x4')](_0x57eeb1,_0x3429a1);};}exports['register']=function(_0x4675d1){for(var _0x4f1144=0x0,_0x218524=events[_0xdce8('0x5')];_0x4f1144<_0x218524;_0x4f1144++){var _0x222ab4=events[_0x4f1144];var _0x36788a=createListener('chatInternalMessage:'+_0x222ab4,_0x4675d1);ChatInternalMessageEvents['on'](_0x222ab4,_0x36788a);}};
\ No newline at end of file
diff --git a/server/api/chatInternalMessage/index.js b/server/api/chatInternalMessage/index.js
index 0144f3f..ac67b04 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 _0xc7ad=['delete','destroy','exports','multer','util','connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment','./chatInternalMessage.controller','isAuthenticated','index','get','/describe','/users','/:id','show','post','create','update'];(function(_0x5ecdcd,_0x443ae3){var _0x27d6ab=function(_0x3e86cd){while(--_0x3e86cd){_0x5ecdcd['push'](_0x5ecdcd['shift']());}};_0x27d6ab(++_0x443ae3);}(_0xc7ad,0x163));var _0xdc7a=function(_0xc36673,_0x3abdf4){_0xc36673=_0xc36673-0x0;var _0x54eb69=_0xc7ad[_0xc36673];return _0x54eb69;};'use strict';var multer=require(_0xdc7a('0x0'));var util=require(_0xdc7a('0x1'));var path=require('path');var timeout=require(_0xdc7a('0x2'));var express=require(_0xdc7a('0x3'));var router=express[_0xdc7a('0x4')]();var fs_extra=require(_0xdc7a('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0xdc7a('0x6'));var config=require(_0xdc7a('0x7'));var controller=require(_0xdc7a('0x8'));router['get']('/',auth[_0xdc7a('0x9')](),controller[_0xdc7a('0xa')]);router[_0xdc7a('0xb')](_0xdc7a('0xc'),auth['isAuthenticated'](),controller['describe']);router[_0xdc7a('0xb')](_0xdc7a('0xd'),auth[_0xdc7a('0x9')](),controller['getUsers']);router[_0xdc7a('0xb')](_0xdc7a('0xe'),auth[_0xdc7a('0x9')](),controller[_0xdc7a('0xf')]);router[_0xdc7a('0x10')]('/',auth['isAuthenticated'](),controller[_0xdc7a('0x11')]);router['put']('/:id',controller[_0xdc7a('0x12')]);router[_0xdc7a('0x13')]('/:id',auth[_0xdc7a('0x9')](),controller[_0xdc7a('0x14')]);module[_0xdc7a('0x15')]=router;
\ No newline at end of file
+var _0x207e=['show','post','create','put','update','destroy','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../config/environment','./chatInternalMessage.controller','get','isAuthenticated','index','describe','/users','getUsers','/:id'];(function(_0x54aaf0,_0x39bd60){var _0xd8fa4d=function(_0x1b0849){while(--_0x1b0849){_0x54aaf0['push'](_0x54aaf0['shift']());}};_0xd8fa4d(++_0x39bd60);}(_0x207e,0x8a));var _0xe207=function(_0x4eee57,_0x34ccc0){_0x4eee57=_0x4eee57-0x0;var _0x3a5259=_0x207e[_0x4eee57];return _0x3a5259;};'use strict';var multer=require(_0xe207('0x0'));var util=require(_0xe207('0x1'));var path=require(_0xe207('0x2'));var timeout=require(_0xe207('0x3'));var express=require(_0xe207('0x4'));var router=express[_0xe207('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0xe207('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0xe207('0x7'));var controller=require(_0xe207('0x8'));router[_0xe207('0x9')]('/',auth[_0xe207('0xa')](),controller[_0xe207('0xb')]);router[_0xe207('0x9')]('/describe',auth['isAuthenticated'](),controller[_0xe207('0xc')]);router['get'](_0xe207('0xd'),auth[_0xe207('0xa')](),controller[_0xe207('0xe')]);router[_0xe207('0x9')](_0xe207('0xf'),auth[_0xe207('0xa')](),controller[_0xe207('0x10')]);router[_0xe207('0x11')]('/',auth[_0xe207('0xa')](),controller[_0xe207('0x12')]);router[_0xe207('0x13')](_0xe207('0xf'),controller[_0xe207('0x14')]);router['delete']('/:id',auth['isAuthenticated'](),controller[_0xe207('0x15')]);module['exports']=router;
\ No newline at end of file
diff --git a/server/api/chatMessage/chatMessage.attributes.js b/server/api/chatMessage/chatMessage.attributes.js
index abdd498..707eb7a 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 _0x4a1d=['DATE','STRING','sequelize','exports','TEXT','medium','BOOLEAN','ENUM','out'];(function(_0x468331,_0x292b65){var _0x20e335=function(_0x510d08){while(--_0x510d08){_0x468331['push'](_0x468331['shift']());}};_0x20e335(++_0x292b65);}(_0x4a1d,0x77));var _0xd4a1=function(_0x31e29a,_0x349c9b){_0x31e29a=_0x31e29a-0x0;var _0x32d892=_0x4a1d[_0x31e29a];return _0x32d892;};'use strict';var Sequelize=require(_0xd4a1('0x0'));module[_0xd4a1('0x1')]={'body':{'type':Sequelize[_0xd4a1('0x2')](_0xd4a1('0x3')),'allowNull':![]},'read':{'type':Sequelize[_0xd4a1('0x4')],'defaultValue':![]},'secret':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'direction':{'type':Sequelize[_0xd4a1('0x5')]('in',_0xd4a1('0x6')),'defaultValue':_0xd4a1('0x6'),'allowNull':![]},'readAt':{'type':Sequelize[_0xd4a1('0x7')]},'providerName':{'type':Sequelize[_0xd4a1('0x8')]},'providerResponse':{'type':Sequelize[_0xd4a1('0x2')]}};
\ No newline at end of file
+var _0x7916=['out','STRING','sequelize','TEXT','medium','BOOLEAN','ENUM'];(function(_0x53b8e0,_0x55d46e){var _0x10630c=function(_0x3189aa){while(--_0x3189aa){_0x53b8e0['push'](_0x53b8e0['shift']());}};_0x10630c(++_0x55d46e);}(_0x7916,0x128));var _0x6791=function(_0x204ef6,_0x14dc9b){_0x204ef6=_0x204ef6-0x0;var _0x5e3a4b=_0x7916[_0x204ef6];return _0x5e3a4b;};'use strict';var Sequelize=require(_0x6791('0x0'));module['exports']={'body':{'type':Sequelize[_0x6791('0x1')](_0x6791('0x2')),'allowNull':![]},'read':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'secret':{'type':Sequelize[_0x6791('0x3')],'defaultValue':![]},'direction':{'type':Sequelize[_0x6791('0x4')]('in',_0x6791('0x5')),'defaultValue':_0x6791('0x5'),'allowNull':![]},'readAt':{'type':Sequelize['DATE']},'providerName':{'type':Sequelize[_0x6791('0x6')]},'providerResponse':{'type':Sequelize['TEXT']}};
\ No newline at end of file
diff --git a/server/api/chatMessage/chatMessage.controller.js b/server/api/chatMessage/chatMessage.controller.js
index ac5b1b1..b131e90 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 _0x0283=['EventManager','rejectmessage','eml-format','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','fs-extra','lodash','squel','crypto','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','redis','localhost','socket.io-emitter','./chatMessage.socket','client','http','info','ChatMessage,\x20%s,\x20%s','request\x20sent','ChatMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','save','update','then','stack','name','send','index','map','ChatMessage','rawAttributes','fieldName','type','model','keys','query','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','where','filter','merge','VIRTUAL','options','include','findAll','rows','show','params','length','includeAll','find','create','body','destroy','describe','accept','chat','readAt','UserId','user','agent','get','ChatInteraction','ChatInteractionId','read1stAt','YYYY-MM-DD\x20HH:mm:ss','interaction','[CHATMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','role','null','AcceptMessage','acceptMessage','ContactId','sequelize','Sequelize','QueryTypes','User','fullname','email','internal','manual','interface','SIP/%s','channel','motionChannel','event','parse','formData','reject','[CHATMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','RejectMessage','rejectMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','SELECT','contact','format'];(function(_0x3f8c5b,_0x17ba5f){var _0x18122d=function(_0x56efa0){while(--_0x56efa0){_0x3f8c5b['push'](_0x3f8c5b['shift']());}};_0x18122d(++_0x17ba5f);}(_0x0283,0x88));var _0x3028=function(_0x49a57c,_0x2eb02c){_0x49a57c=_0x49a57c-0x0;var _0x4e0316=_0x0283[_0x49a57c];return _0x4e0316;};'use strict';var emlformat=require(_0x3028('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0x3028('0x1'));var rp=require(_0x3028('0x2'));var moment=require(_0x3028('0x3'));var BPromise=require(_0x3028('0x4'));var Mustache=require(_0x3028('0x5'));var util=require(_0x3028('0x6'));var path=require(_0x3028('0x7'));var sox=require(_0x3028('0x8'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x3028('0x9'));var _=require(_0x3028('0xa'));var squel=require(_0x3028('0xb'));var crypto=require(_0x3028('0xc'));var jsforce=require(_0x3028('0xd'));var deskjs=require(_0x3028('0xe'));var toCsv=require(_0x3028('0xf'));var querystring=require(_0x3028('0x10'));var Papa=require(_0x3028('0x11'));var Redis=require(_0x3028('0x12'));var authService=require('../../components/auth/service');var qs=require(_0x3028('0x13'));var as=require(_0x3028('0x14'));var hardwareService=require(_0x3028('0x15'));var logger=require(_0x3028('0x16'))(_0x3028('0x17'));var utils=require(_0x3028('0x18'));var config=require('../../config/environment');var licenseUtil=require(_0x3028('0x19'));var db=require('../../mysqldb')['db'];config[_0x3028('0x1a')]=_['defaults'](config[_0x3028('0x1a')],{'host':_0x3028('0x1b'),'port':0x18eb});var socket=require(_0x3028('0x1c'))(new Redis(config[_0x3028('0x1a')]));require(_0x3028('0x1d'))['register'](socket);var jayson=require('jayson/promise');var client=jayson[_0x3028('0x1e')][_0x3028('0x1f')]({'port':0x232c});var client9002=jayson['client'][_0x3028('0x1f')]({'port':0x232a});function respondWithRpcPromise(_0x14e845,_0x932421,_0x4e498b,_0x217961){return new BPromise(function(_0x1a0364,_0x36d43e){var _0x411d0e=_0x217961||client;return _0x411d0e['request'](_0x14e845,_0x4e498b)['then'](function(_0x335626){logger[_0x3028('0x20')](_0x3028('0x21'),_0x932421,_0x3028('0x22'));logger['debug'](_0x3028('0x23'),_0x932421,_0x3028('0x22'),JSON[_0x3028('0x24')](_0x335626));if(_0x335626[_0x3028('0x25')]){if(_0x335626[_0x3028('0x25')][_0x3028('0x26')]===0x1f4){logger[_0x3028('0x25')](_0x3028('0x21'),_0x932421,_0x335626[_0x3028('0x25')][_0x3028('0x27')]);return _0x36d43e(_0x335626[_0x3028('0x25')]['message']);}logger[_0x3028('0x25')]('ChatMessage,\x20%s,\x20%s',_0x932421,_0x335626[_0x3028('0x25')][_0x3028('0x27')]);return _0x1a0364(_0x335626[_0x3028('0x25')][_0x3028('0x27')]);}else{logger[_0x3028('0x20')]('ChatMessage,\x20%s,\x20%s',_0x932421,'request\x20sent');_0x1a0364(_0x335626['result']['message']);}})[_0x3028('0x28')](function(_0xa853f5){logger[_0x3028('0x25')]('ChatMessage,\x20%s,\x20%s',_0x932421,_0xa853f5);_0x36d43e(_0xa853f5);});});}function respondWithStatusCode(_0x44a34f,_0x2ea29b){_0x2ea29b=_0x2ea29b||0xcc;return function(_0x128957){if(_0x128957){return _0x44a34f[_0x3028('0x29')](_0x2ea29b);}return _0x44a34f[_0x3028('0x2a')](_0x2ea29b)[_0x3028('0x2b')]();};}function respondWithResult(_0x26fcdd,_0x54e5ae){_0x54e5ae=_0x54e5ae||0xc8;return function(_0x24bad8){if(_0x24bad8){return _0x26fcdd['status'](_0x54e5ae)[_0x3028('0x2c')](_0x24bad8);}};}function respondWithFilteredResult(_0x34a0eb,_0x2e4c83){return function(_0x20465d){if(_0x20465d){var _0x4ea575=typeof _0x2e4c83[_0x3028('0x2d')]===_0x3028('0x2e')&&typeof _0x2e4c83[_0x3028('0x2f')]===_0x3028('0x2e');var _0x25da4c=_0x20465d['count'];var _0x3d6b62=_0x4ea575?0x0:_0x2e4c83[_0x3028('0x2d')];var _0x31d5e9=_0x4ea575?_0x20465d[_0x3028('0x30')]:_0x2e4c83[_0x3028('0x2d')]+_0x2e4c83[_0x3028('0x2f')];var _0x3627d9;if(_0x31d5e9>=_0x25da4c){_0x31d5e9=_0x25da4c;_0x3627d9=0xc8;}else{_0x3627d9=0xce;}_0x34a0eb['status'](_0x3627d9);return _0x34a0eb[_0x3028('0x31')](_0x3028('0x32'),_0x3d6b62+'-'+_0x31d5e9+'/'+_0x25da4c)[_0x3028('0x2c')](_0x20465d);}return null;};}function patchUpdates(_0x8695bb){return function(_0x1586d2){try{jsonpatch['apply'](_0x1586d2,_0x8695bb,!![]);}catch(_0x47a57e){return BPromise['reject'](_0x47a57e);}return _0x1586d2[_0x3028('0x33')]();};}function saveUpdates(_0x59945e,_0xb8cb71){return function(_0x464529){if(_0x464529){return _0x464529[_0x3028('0x34')](_0x59945e)[_0x3028('0x35')](function(_0x3ce6a5){return _0x3ce6a5;});}return null;};}function removeEntity(_0x132acc,_0x2c0210){return function(_0x8ae1e4){if(_0x8ae1e4){return _0x8ae1e4['destroy']()['then'](function(){_0x132acc['status'](0xcc)[_0x3028('0x2b')]();});}};}function handleEntityNotFound(_0x333c1e,_0x231bef){return function(_0x484eac){if(!_0x484eac){_0x333c1e['sendStatus'](0x194);}return _0x484eac;};}function handleError(_0x461cb2,_0x4d2c52){_0x4d2c52=_0x4d2c52||0x1f4;return function(_0x50d016){logger[_0x3028('0x25')](_0x50d016[_0x3028('0x36')]);if(_0x50d016['name']){delete _0x50d016[_0x3028('0x37')];}_0x461cb2[_0x3028('0x2a')](_0x4d2c52)[_0x3028('0x38')](_0x50d016);};}exports[_0x3028('0x39')]=function(_0x119506,_0x38c5b1){var _0x5c789c={},_0x51c3b7={},_0x26d53d={'count':0x0,'rows':[]};var _0x1c1ae2=_[_0x3028('0x3a')](db[_0x3028('0x3b')][_0x3028('0x3c')],function(_0x191712){return{'name':_0x191712[_0x3028('0x3d')],'type':_0x191712[_0x3028('0x3e')]['key']};});_0x51c3b7[_0x3028('0x3f')]=_[_0x3028('0x3a')](_0x1c1ae2,_0x3028('0x37'));_0x51c3b7['query']=_[_0x3028('0x40')](_0x119506[_0x3028('0x41')]);_0x51c3b7[_0x3028('0x42')]=_[_0x3028('0x43')](_0x51c3b7[_0x3028('0x3f')],_0x51c3b7['query']);_0x5c789c[_0x3028('0x44')]=_[_0x3028('0x43')](_0x51c3b7[_0x3028('0x3f')],qs[_0x3028('0x45')](_0x119506[_0x3028('0x41')][_0x3028('0x45')]));_0x5c789c[_0x3028('0x44')]=_0x5c789c['attributes']['length']?_0x5c789c[_0x3028('0x44')]:_0x51c3b7['model'];if(!_0x119506[_0x3028('0x41')][_0x3028('0x46')](_0x3028('0x47'))){_0x5c789c[_0x3028('0x2f')]=qs['limit'](_0x119506[_0x3028('0x41')]['limit']);_0x5c789c['offset']=qs['offset'](_0x119506['query']['offset']);}_0x5c789c[_0x3028('0x48')]=qs['sort'](_0x119506[_0x3028('0x41')][_0x3028('0x49')]);_0x5c789c[_0x3028('0x4a')]=qs[_0x3028('0x42')](_['pick'](_0x119506[_0x3028('0x41')],_0x51c3b7[_0x3028('0x42')]),_0x1c1ae2);if(_0x119506[_0x3028('0x41')][_0x3028('0x4b')]){_0x5c789c['where']=_[_0x3028('0x4c')](_0x5c789c[_0x3028('0x4a')],{'$or':_[_0x3028('0x3a')](_0x1c1ae2,function(_0x5c1e7c){if(_0x5c1e7c['type']!==_0x3028('0x4d')){var _0x3d1244={};_0x3d1244[_0x5c1e7c[_0x3028('0x37')]]={'$like':'%'+_0x119506[_0x3028('0x41')][_0x3028('0x4b')]+'%'};return _0x3d1244;}})});}_0x5c789c=_[_0x3028('0x4c')]({},_0x5c789c,_0x119506[_0x3028('0x4e')]);var _0x3cc533={'where':_0x5c789c[_0x3028('0x4a')]};return db['ChatMessage'][_0x3028('0x30')](_0x3cc533)[_0x3028('0x35')](function(_0x1c3a29){_0x26d53d[_0x3028('0x30')]=_0x1c3a29;if(_0x119506[_0x3028('0x41')]['includeAll']){_0x5c789c[_0x3028('0x4f')]=[{'all':!![]}];}return db[_0x3028('0x3b')][_0x3028('0x50')](_0x5c789c);})[_0x3028('0x35')](function(_0x26ca6d){_0x26d53d[_0x3028('0x51')]=_0x26ca6d;return _0x26d53d;})[_0x3028('0x35')](respondWithFilteredResult(_0x38c5b1,_0x5c789c))[_0x3028('0x28')](handleError(_0x38c5b1,null));};exports[_0x3028('0x52')]=function(_0x43175f,_0x556ee2){var _0x3f1d5d={'raw':!![],'where':{'id':_0x43175f[_0x3028('0x53')]['id']}},_0x4613d5={};_0x4613d5[_0x3028('0x3f')]=_['keys'](db['ChatMessage']['rawAttributes']);_0x4613d5['query']=_[_0x3028('0x40')](_0x43175f[_0x3028('0x41')]);_0x4613d5['filters']=_[_0x3028('0x43')](_0x4613d5[_0x3028('0x3f')],_0x4613d5['query']);_0x3f1d5d[_0x3028('0x44')]=_[_0x3028('0x43')](_0x4613d5['model'],qs[_0x3028('0x45')](_0x43175f[_0x3028('0x41')][_0x3028('0x45')]));_0x3f1d5d[_0x3028('0x44')]=_0x3f1d5d[_0x3028('0x44')][_0x3028('0x54')]?_0x3f1d5d['attributes']:_0x4613d5[_0x3028('0x3f')];if(_0x43175f[_0x3028('0x41')][_0x3028('0x55')]){_0x3f1d5d[_0x3028('0x4f')]=[{'all':!![]}];}_0x3f1d5d=_[_0x3028('0x4c')]({},_0x3f1d5d,_0x43175f[_0x3028('0x4e')]);return db[_0x3028('0x3b')][_0x3028('0x56')](_0x3f1d5d)[_0x3028('0x35')](handleEntityNotFound(_0x556ee2,null))[_0x3028('0x35')](respondWithResult(_0x556ee2,null))[_0x3028('0x28')](handleError(_0x556ee2,null));};exports[_0x3028('0x57')]=function(_0x4ae249,_0x423056){return db[_0x3028('0x3b')]['create'](_0x4ae249[_0x3028('0x58')],{})[_0x3028('0x35')](respondWithResult(_0x423056,0xc9))['catch'](handleError(_0x423056,null));};exports[_0x3028('0x34')]=function(_0x7447b2,_0x5a1ce4){if(_0x7447b2[_0x3028('0x58')]['id']){delete _0x7447b2[_0x3028('0x58')]['id'];}return db[_0x3028('0x3b')]['find']({'where':{'id':_0x7447b2[_0x3028('0x53')]['id']}})[_0x3028('0x35')](handleEntityNotFound(_0x5a1ce4,null))[_0x3028('0x35')](saveUpdates(_0x7447b2['body'],null))[_0x3028('0x35')](respondWithResult(_0x5a1ce4,null))['catch'](handleError(_0x5a1ce4,null));};exports[_0x3028('0x59')]=function(_0x1488aa,_0x3b45e3){return db[_0x3028('0x3b')][_0x3028('0x56')]({'where':{'id':_0x1488aa[_0x3028('0x53')]['id']}})[_0x3028('0x35')](handleEntityNotFound(_0x3b45e3,null))[_0x3028('0x35')](removeEntity(_0x3b45e3,null))[_0x3028('0x28')](handleError(_0x3b45e3,null));};exports[_0x3028('0x5a')]=function(_0xd8ced5,_0x2638e){return db['ChatMessage'][_0x3028('0x5a')]()[_0x3028('0x35')](respondWithResult(_0x2638e,null))['catch'](handleError(_0x2638e,null));};var interaction_log=require(_0x3028('0x16'))('chat-interactions');exports[_0x3028('0x5b')]=function(_0x265f16,_0x315166,_0x1f1fff){var _0x23f759={'agent':{},'channel':_0x3028('0x5c')};if(_0x265f16[_0x3028('0x58')]['id']){delete _0x265f16[_0x3028('0x58')]['id'];}_0x265f16['body']['read']=!![];_0x265f16[_0x3028('0x58')][_0x3028('0x5d')]=moment()['format']('YYYY-MM-DD\x20HH:mm:ss');_0x265f16[_0x3028('0x58')][_0x3028('0x5e')]=_0x265f16[_0x3028('0x58')]['UserId']||_0x265f16[_0x3028('0x5f')]['id'];_0x23f759[_0x3028('0x60')]['id']=_0x265f16[_0x3028('0x58')]['UserId'];return db['ChatMessage'][_0x3028('0x56')]({'where':{'id':_0x265f16[_0x3028('0x53')]['id'],'UserId':null}})[_0x3028('0x35')](handleEntityNotFound(_0x315166,null))['then'](saveUpdates(_0x265f16[_0x3028('0x58')],null))[_0x3028('0x35')](function(_0x8de80f){if(_0x8de80f){_0x23f759['message']=_0x8de80f[_0x3028('0x61')]({'plain':!![]});return db[_0x3028('0x62')][_0x3028('0x56')]({'where':{'id':_0x8de80f[_0x3028('0x63')]}});}return null;})['then'](handleEntityNotFound(_0x315166,null))[_0x3028('0x35')](function(_0x1eca6a){if(_0x1eca6a){return _0x1eca6a['update']({'UserId':_0x265f16['body']['UserId'],'read1stAt':_['isNil'](_0x1eca6a[_0x3028('0x64')])?moment()['format'](_0x3028('0x65')):undefined});}return null;})[_0x3028('0x35')](function(_0x3341ee){if(_0x3341ee){_0x23f759[_0x3028('0x66')]=_0x3341ee[_0x3028('0x61')]({'plain':!![]});interaction_log['info'](_0x3028('0x67'),_0x265f16[_0x3028('0x5f')]['id'],_0x265f16[_0x3028('0x5f')][_0x3028('0x37')],_0x265f16[_0x3028('0x5f')][_0x3028('0x68')],_0x23f759['interaction']['id'],_0x265f16[_0x3028('0x58')]?JSON[_0x3028('0x24')](_0x265f16['body']):_0x3028('0x69'));return respondWithRpcPromise(_0x3028('0x6a'),_0x3028('0x6b'),_0x23f759);}return null;})[_0x3028('0x35')](function(_0x2cb649){var _0x523039='SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20'+_0x2cb649[_0x3028('0x27')][_0x3028('0x6c')];return db[_0x3028('0x6d')][_0x3028('0x41')](_0x523039,{'type':db[_0x3028('0x6e')][_0x3028('0x6f')]['SELECT'],'raw':!![]})[_0x3028('0x35')](function(_0x27a071){return _0x27a071;});})[_0x3028('0x35')](function(_0x4f7d6d){if(_0x4f7d6d){_0x23f759[_0x3028('0x27')]['contact']=_0x4f7d6d[0x0];if(!_0x265f16['body']['UserId'])return;return db[_0x3028('0x70')][_0x3028('0x56')]({'where':{'id':_0x265f16['body']['UserId'],'role':'agent'},'attributes':['id',_0x3028('0x37'),_0x3028('0x71'),_0x3028('0x72'),_0x3028('0x73')],'raw':!![]});}return null;})[_0x3028('0x35')](function(_0x105d20){if(!_0x105d20)return null;_0x23f759[_0x3028('0x27')]['agent']=_0x105d20;return _0x23f759;})[_0x3028('0x35')](function(_0x56252a){if(_0x56252a){if(_0x265f16[_0x3028('0x58')][_0x3028('0x74')]){_0x23f759[_0x3028('0x27')][_0x3028('0x75')]=util['format'](_0x3028('0x76'),_0x265f16[_0x3028('0x5f')][_0x3028('0x37')]);_0x23f759[_0x3028('0x27')][_0x3028('0x77')]=_0x23f759[_0x3028('0x77')];_0x23f759[_0x3028('0x27')][_0x3028('0x78')]=_0x23f759[_0x3028('0x77')];_0x23f759[_0x3028('0x27')][_0x3028('0x79')]='accept';return respondWithRpcPromise('EventManager','EventManager',{'event':'acceptmessage','message':_['merge'](_0x23f759[_0x3028('0x27')],JSON[_0x3028('0x7a')](_0x23f759['interaction'][_0x3028('0x7b')]))},client9002)[_0x3028('0x35')](function(){return _0x23f759;});}return _0x23f759;}return null;})[_0x3028('0x35')](respondWithResult(_0x315166,null))[_0x3028('0x28')](handleError(_0x315166,null));};var interaction_log=require(_0x3028('0x16'))('chat-interactions');exports[_0x3028('0x7c')]=function(_0x1775af,_0x85f41c,_0x36360f){var _0x5ede8a={'agent':{},'channel':_0x3028('0x5c')};if(_0x1775af[_0x3028('0x58')]['id']){delete _0x1775af[_0x3028('0x58')]['id'];}_0x1775af[_0x3028('0x58')]['UserId']=_0x1775af['body'][_0x3028('0x5e')]||_0x1775af['user']['id'];_0x5ede8a[_0x3028('0x60')]['id']=_0x1775af[_0x3028('0x58')][_0x3028('0x5e')];return db[_0x3028('0x3b')][_0x3028('0x56')]({'where':{'id':_0x1775af[_0x3028('0x53')]['id'],'UserId':null}})['then'](handleEntityNotFound(_0x85f41c,null))[_0x3028('0x35')](function(_0x156492){if(_0x156492){_0x5ede8a[_0x3028('0x27')]=_0x156492['get']({'plain':!![]});return db[_0x3028('0x62')][_0x3028('0x56')]({'where':{'id':_0x156492['ChatInteractionId']}});}return null;})[_0x3028('0x35')](handleEntityNotFound(_0x85f41c,null))[_0x3028('0x35')](function(_0x3ae354){if(_0x3ae354){_0x5ede8a[_0x3028('0x66')]=_0x3ae354[_0x3028('0x61')]({'plain':!![]});interaction_log[_0x3028('0x20')](_0x3028('0x7d'),_0x1775af['user']['id'],_0x1775af[_0x3028('0x5f')][_0x3028('0x37')],_0x1775af['user'][_0x3028('0x68')],_0x5ede8a[_0x3028('0x66')]['id'],_0x1775af[_0x3028('0x58')]?JSON[_0x3028('0x24')](_0x1775af['body']):_0x3028('0x69'));return respondWithRpcPromise(_0x3028('0x7e'),_0x3028('0x7f'),_0x5ede8a);}return null;})['then'](function(_0x44f793){var _0x3d6f94=_0x3028('0x80')+_0x44f793[_0x3028('0x27')][_0x3028('0x6c')];return db[_0x3028('0x6d')][_0x3028('0x41')](_0x3d6f94,{'type':db[_0x3028('0x6e')][_0x3028('0x6f')][_0x3028('0x81')],'raw':!![]})[_0x3028('0x35')](function(_0x416a22){return _0x416a22;});})['then'](function(_0x26a272){if(_0x26a272){_0x5ede8a[_0x3028('0x27')][_0x3028('0x82')]=_0x26a272[0x0];if(!_0x1775af[_0x3028('0x58')][_0x3028('0x5e')])return;return db[_0x3028('0x70')]['find']({'where':{'id':_0x1775af[_0x3028('0x58')][_0x3028('0x5e')],'role':'agent'},'attributes':['id',_0x3028('0x37'),_0x3028('0x71'),_0x3028('0x72'),'internal'],'raw':!![]});}return null;})[_0x3028('0x35')](function(_0x96add7){if(!_0x96add7)return null;_0x5ede8a['message'][_0x3028('0x60')]=_0x96add7;return _0x5ede8a;})[_0x3028('0x35')](function(_0x2dfc7e){if(_0x2dfc7e){_0x2dfc7e['message'][_0x3028('0x75')]=util[_0x3028('0x83')]('SIP/%s',_0x1775af[_0x3028('0x5f')][_0x3028('0x37')]);_0x2dfc7e[_0x3028('0x27')][_0x3028('0x77')]=_0x5ede8a['channel'];_0x2dfc7e[_0x3028('0x27')]['motionChannel']=_0x5ede8a[_0x3028('0x77')];_0x2dfc7e[_0x3028('0x27')][_0x3028('0x79')]='reject';respondWithRpcPromise(_0x3028('0x84'),_0x3028('0x84'),{'event':_0x3028('0x85'),'message':_['merge'](_0x5ede8a['message'],JSON[_0x3028('0x7a')](_0x5ede8a[_0x3028('0x66')][_0x3028('0x7b')]))},client9002);return _0x5ede8a;}return null;})['then'](respondWithResult(_0x85f41c,null))['catch'](handleError(_0x85f41c,null));};
\ No newline at end of file
+var _0x0dfc=['squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./chatMessage.socket','register','client','http','request','info','ChatMessage,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','catch','sendStatus','end','undefined','limit','count','offset','status','Content-Range','json','apply','then','destroy','stack','name','send','map','rawAttributes','fieldName','key','query','keys','filters','intersection','model','attributes','fields','length','nolimit','order','sort','where','pick','merge','type','VIRTUAL','filter','ChatMessage','includeAll','include','rows','show','params','options','find','create','body','describe','accept','chat','read','format','agent','get','ChatInteractionId','UserId','read1stAt','YYYY-MM-DD\x20HH:mm:ss','interaction','[CHATMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','user','role','null','acceptMessage','ContactId','Sequelize','QueryTypes','SELECT','contact','User','fullname','email','internal','manual','interface','motionChannel','channel','event','EventManager','acceptmessage','parse','formData','chat-interactions','[CHATMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','rejectMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','sequelize','reject','rejectmessage','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','sox','to-csv','ejs','fs-extra'];(function(_0x3d2a39,_0x4e0506){var _0x452043=function(_0x25d797){while(--_0x25d797){_0x3d2a39['push'](_0x3d2a39['shift']());}};_0x452043(++_0x4e0506);}(_0x0dfc,0x7a));var _0xc0df=function(_0x351b52,_0x171378){_0x351b52=_0x351b52-0x0;var _0x2a58ed=_0x0dfc[_0x351b52];return _0x2a58ed;};'use strict';var emlformat=require(_0xc0df('0x0'));var rimraf=require(_0xc0df('0x1'));var zipdir=require(_0xc0df('0x2'));var jsonpatch=require(_0xc0df('0x3'));var rp=require(_0xc0df('0x4'));var moment=require(_0xc0df('0x5'));var BPromise=require(_0xc0df('0x6'));var Mustache=require('mustache');var util=require(_0xc0df('0x7'));var path=require(_0xc0df('0x8'));var sox=require(_0xc0df('0x9'));var csv=require(_0xc0df('0xa'));var ejs=require(_0xc0df('0xb'));var fs=require('fs');var fs_extra=require(_0xc0df('0xc'));var _=require('lodash');var squel=require(_0xc0df('0xd'));var crypto=require(_0xc0df('0xe'));var jsforce=require(_0xc0df('0xf'));var deskjs=require(_0xc0df('0x10'));var toCsv=require('to-csv');var querystring=require(_0xc0df('0x11'));var Papa=require(_0xc0df('0x12'));var Redis=require(_0xc0df('0x13'));var authService=require(_0xc0df('0x14'));var qs=require(_0xc0df('0x15'));var as=require(_0xc0df('0x16'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xc0df('0x17'))('api');var utils=require(_0xc0df('0x18'));var config=require(_0xc0df('0x19'));var licenseUtil=require(_0xc0df('0x1a'));var db=require(_0xc0df('0x1b'))['db'];config[_0xc0df('0x1c')]=_[_0xc0df('0x1d')](config['redis'],{'host':_0xc0df('0x1e'),'port':0x18eb});var socket=require(_0xc0df('0x1f'))(new Redis(config[_0xc0df('0x1c')]));require(_0xc0df('0x20'))[_0xc0df('0x21')](socket);var jayson=require('jayson/promise');var client=jayson[_0xc0df('0x22')][_0xc0df('0x23')]({'port':0x232c});var client9002=jayson[_0xc0df('0x22')][_0xc0df('0x23')]({'port':0x232a});function respondWithRpcPromise(_0x2e4730,_0x20428b,_0x4659f6,_0x393a5c){return new BPromise(function(_0x44e66e,_0x271bd5){var _0x53b673=_0x393a5c||client;return _0x53b673[_0xc0df('0x24')](_0x2e4730,_0x4659f6)['then'](function(_0x1268dc){logger[_0xc0df('0x25')](_0xc0df('0x26'),_0x20428b,_0xc0df('0x27'));logger[_0xc0df('0x28')]('ChatMessage,\x20%s,\x20%s,\x20%s',_0x20428b,'request\x20sent',JSON[_0xc0df('0x29')](_0x1268dc));if(_0x1268dc[_0xc0df('0x2a')]){if(_0x1268dc[_0xc0df('0x2a')][_0xc0df('0x2b')]===0x1f4){logger[_0xc0df('0x2a')]('ChatMessage,\x20%s,\x20%s',_0x20428b,_0x1268dc[_0xc0df('0x2a')][_0xc0df('0x2c')]);return _0x271bd5(_0x1268dc[_0xc0df('0x2a')][_0xc0df('0x2c')]);}logger[_0xc0df('0x2a')]('ChatMessage,\x20%s,\x20%s',_0x20428b,_0x1268dc[_0xc0df('0x2a')][_0xc0df('0x2c')]);return _0x44e66e(_0x1268dc['error'][_0xc0df('0x2c')]);}else{logger['info'](_0xc0df('0x26'),_0x20428b,_0xc0df('0x27'));_0x44e66e(_0x1268dc[_0xc0df('0x2d')][_0xc0df('0x2c')]);}})[_0xc0df('0x2e')](function(_0x452a28){logger['error'](_0xc0df('0x26'),_0x20428b,_0x452a28);_0x271bd5(_0x452a28);});});}function respondWithStatusCode(_0x3aa8b2,_0x4f8f66){_0x4f8f66=_0x4f8f66||0xcc;return function(_0x1a4d15){if(_0x1a4d15){return _0x3aa8b2[_0xc0df('0x2f')](_0x4f8f66);}return _0x3aa8b2['status'](_0x4f8f66)[_0xc0df('0x30')]();};}function respondWithResult(_0x5d3b8d,_0x524f24){_0x524f24=_0x524f24||0xc8;return function(_0x44161c){if(_0x44161c){return _0x5d3b8d['status'](_0x524f24)['json'](_0x44161c);}};}function respondWithFilteredResult(_0x4b4d52,_0x125ff8){return function(_0x1ad2b4){if(_0x1ad2b4){var _0x5b1d90=typeof _0x125ff8['offset']===_0xc0df('0x31')&&typeof _0x125ff8[_0xc0df('0x32')]===_0xc0df('0x31');var _0x4a2c0d=_0x1ad2b4[_0xc0df('0x33')];var _0x40fdb6=_0x5b1d90?0x0:_0x125ff8[_0xc0df('0x34')];var _0x58f6e1=_0x5b1d90?_0x1ad2b4[_0xc0df('0x33')]:_0x125ff8['offset']+_0x125ff8[_0xc0df('0x32')];var _0x5d669f;if(_0x58f6e1>=_0x4a2c0d){_0x58f6e1=_0x4a2c0d;_0x5d669f=0xc8;}else{_0x5d669f=0xce;}_0x4b4d52[_0xc0df('0x35')](_0x5d669f);return _0x4b4d52['set'](_0xc0df('0x36'),_0x40fdb6+'-'+_0x58f6e1+'/'+_0x4a2c0d)[_0xc0df('0x37')](_0x1ad2b4);}return null;};}function patchUpdates(_0xc2555){return function(_0x59b67a){try{jsonpatch[_0xc0df('0x38')](_0x59b67a,_0xc2555,!![]);}catch(_0x2a73ae){return BPromise['reject'](_0x2a73ae);}return _0x59b67a['save']();};}function saveUpdates(_0x377061,_0x5ef525){return function(_0x3f654c){if(_0x3f654c){return _0x3f654c['update'](_0x377061)[_0xc0df('0x39')](function(_0x2f3b26){return _0x2f3b26;});}return null;};}function removeEntity(_0x4d683e,_0x48a2df){return function(_0x2cf122){if(_0x2cf122){return _0x2cf122[_0xc0df('0x3a')]()[_0xc0df('0x39')](function(){_0x4d683e[_0xc0df('0x35')](0xcc)[_0xc0df('0x30')]();});}};}function handleEntityNotFound(_0x264af6,_0x47c4ce){return function(_0x1319c7){if(!_0x1319c7){_0x264af6[_0xc0df('0x2f')](0x194);}return _0x1319c7;};}function handleError(_0x10ebe2,_0x412cd9){_0x412cd9=_0x412cd9||0x1f4;return function(_0x59ab04){logger[_0xc0df('0x2a')](_0x59ab04[_0xc0df('0x3b')]);if(_0x59ab04[_0xc0df('0x3c')]){delete _0x59ab04[_0xc0df('0x3c')];}_0x10ebe2['status'](_0x412cd9)[_0xc0df('0x3d')](_0x59ab04);};}exports['index']=function(_0x29312f,_0x49914e){var _0x1bbecb={},_0x182623={},_0x26721c={'count':0x0,'rows':[]};var _0x79e0a7=_[_0xc0df('0x3e')](db['ChatMessage'][_0xc0df('0x3f')],function(_0x439cf2){return{'name':_0x439cf2[_0xc0df('0x40')],'type':_0x439cf2['type'][_0xc0df('0x41')]};});_0x182623['model']=_[_0xc0df('0x3e')](_0x79e0a7,'name');_0x182623[_0xc0df('0x42')]=_[_0xc0df('0x43')](_0x29312f[_0xc0df('0x42')]);_0x182623[_0xc0df('0x44')]=_[_0xc0df('0x45')](_0x182623[_0xc0df('0x46')],_0x182623[_0xc0df('0x42')]);_0x1bbecb[_0xc0df('0x47')]=_[_0xc0df('0x45')](_0x182623['model'],qs['fields'](_0x29312f[_0xc0df('0x42')][_0xc0df('0x48')]));_0x1bbecb[_0xc0df('0x47')]=_0x1bbecb[_0xc0df('0x47')][_0xc0df('0x49')]?_0x1bbecb[_0xc0df('0x47')]:_0x182623[_0xc0df('0x46')];if(!_0x29312f[_0xc0df('0x42')]['hasOwnProperty'](_0xc0df('0x4a'))){_0x1bbecb[_0xc0df('0x32')]=qs['limit'](_0x29312f[_0xc0df('0x42')]['limit']);_0x1bbecb['offset']=qs[_0xc0df('0x34')](_0x29312f['query'][_0xc0df('0x34')]);}_0x1bbecb[_0xc0df('0x4b')]=qs[_0xc0df('0x4c')](_0x29312f[_0xc0df('0x42')][_0xc0df('0x4c')]);_0x1bbecb[_0xc0df('0x4d')]=qs[_0xc0df('0x44')](_[_0xc0df('0x4e')](_0x29312f[_0xc0df('0x42')],_0x182623[_0xc0df('0x44')]),_0x79e0a7);if(_0x29312f[_0xc0df('0x42')]['filter']){_0x1bbecb[_0xc0df('0x4d')]=_[_0xc0df('0x4f')](_0x1bbecb[_0xc0df('0x4d')],{'$or':_['map'](_0x79e0a7,function(_0x2c342d){if(_0x2c342d[_0xc0df('0x50')]!==_0xc0df('0x51')){var _0x1cc447={};_0x1cc447[_0x2c342d[_0xc0df('0x3c')]]={'$like':'%'+_0x29312f[_0xc0df('0x42')][_0xc0df('0x52')]+'%'};return _0x1cc447;}})});}_0x1bbecb=_[_0xc0df('0x4f')]({},_0x1bbecb,_0x29312f['options']);var _0x2fb88b={'where':_0x1bbecb[_0xc0df('0x4d')]};return db[_0xc0df('0x53')][_0xc0df('0x33')](_0x2fb88b)[_0xc0df('0x39')](function(_0x8c9fd3){_0x26721c[_0xc0df('0x33')]=_0x8c9fd3;if(_0x29312f[_0xc0df('0x42')][_0xc0df('0x54')]){_0x1bbecb[_0xc0df('0x55')]=[{'all':!![]}];}return db[_0xc0df('0x53')]['findAll'](_0x1bbecb);})['then'](function(_0xfd56f0){_0x26721c[_0xc0df('0x56')]=_0xfd56f0;return _0x26721c;})[_0xc0df('0x39')](respondWithFilteredResult(_0x49914e,_0x1bbecb))[_0xc0df('0x2e')](handleError(_0x49914e,null));};exports[_0xc0df('0x57')]=function(_0x430a7e,_0x2a44b7){var _0x5ea576={'raw':!![],'where':{'id':_0x430a7e[_0xc0df('0x58')]['id']}},_0x38a04b={};_0x38a04b['model']=_[_0xc0df('0x43')](db[_0xc0df('0x53')]['rawAttributes']);_0x38a04b[_0xc0df('0x42')]=_[_0xc0df('0x43')](_0x430a7e['query']);_0x38a04b[_0xc0df('0x44')]=_[_0xc0df('0x45')](_0x38a04b[_0xc0df('0x46')],_0x38a04b['query']);_0x5ea576['attributes']=_[_0xc0df('0x45')](_0x38a04b[_0xc0df('0x46')],qs[_0xc0df('0x48')](_0x430a7e['query'][_0xc0df('0x48')]));_0x5ea576[_0xc0df('0x47')]=_0x5ea576['attributes']['length']?_0x5ea576[_0xc0df('0x47')]:_0x38a04b[_0xc0df('0x46')];if(_0x430a7e[_0xc0df('0x42')][_0xc0df('0x54')]){_0x5ea576['include']=[{'all':!![]}];}_0x5ea576=_['merge']({},_0x5ea576,_0x430a7e[_0xc0df('0x59')]);return db['ChatMessage'][_0xc0df('0x5a')](_0x5ea576)[_0xc0df('0x39')](handleEntityNotFound(_0x2a44b7,null))[_0xc0df('0x39')](respondWithResult(_0x2a44b7,null))[_0xc0df('0x2e')](handleError(_0x2a44b7,null));};exports[_0xc0df('0x5b')]=function(_0x1a79cd,_0x590073){return db[_0xc0df('0x53')][_0xc0df('0x5b')](_0x1a79cd[_0xc0df('0x5c')],{})[_0xc0df('0x39')](respondWithResult(_0x590073,0xc9))['catch'](handleError(_0x590073,null));};exports['update']=function(_0x4f576d,_0x16b149){if(_0x4f576d[_0xc0df('0x5c')]['id']){delete _0x4f576d['body']['id'];}return db[_0xc0df('0x53')][_0xc0df('0x5a')]({'where':{'id':_0x4f576d[_0xc0df('0x58')]['id']}})[_0xc0df('0x39')](handleEntityNotFound(_0x16b149,null))[_0xc0df('0x39')](saveUpdates(_0x4f576d[_0xc0df('0x5c')],null))['then'](respondWithResult(_0x16b149,null))[_0xc0df('0x2e')](handleError(_0x16b149,null));};exports['destroy']=function(_0x53707c,_0x1057d1){return db['ChatMessage'][_0xc0df('0x5a')]({'where':{'id':_0x53707c['params']['id']}})[_0xc0df('0x39')](handleEntityNotFound(_0x1057d1,null))[_0xc0df('0x39')](removeEntity(_0x1057d1,null))[_0xc0df('0x2e')](handleError(_0x1057d1,null));};exports[_0xc0df('0x5d')]=function(_0x1c53be,_0x24ad23){return db['ChatMessage'][_0xc0df('0x5d')]()[_0xc0df('0x39')](respondWithResult(_0x24ad23,null))[_0xc0df('0x2e')](handleError(_0x24ad23,null));};var interaction_log=require(_0xc0df('0x17'))('chat-interactions');exports[_0xc0df('0x5e')]=function(_0xe19d0b,_0x2103d9,_0x247f2b){var _0x514d72={'agent':{},'channel':_0xc0df('0x5f')};if(_0xe19d0b[_0xc0df('0x5c')]['id']){delete _0xe19d0b[_0xc0df('0x5c')]['id'];}_0xe19d0b['body'][_0xc0df('0x60')]=!![];_0xe19d0b[_0xc0df('0x5c')]['readAt']=moment()[_0xc0df('0x61')]('YYYY-MM-DD\x20HH:mm:ss');_0xe19d0b['body']['UserId']=_0xe19d0b['body']['UserId']||_0xe19d0b['user']['id'];_0x514d72[_0xc0df('0x62')]['id']=_0xe19d0b[_0xc0df('0x5c')]['UserId'];return db[_0xc0df('0x53')][_0xc0df('0x5a')]({'where':{'id':_0xe19d0b[_0xc0df('0x58')]['id'],'UserId':null}})[_0xc0df('0x39')](handleEntityNotFound(_0x2103d9,null))[_0xc0df('0x39')](saveUpdates(_0xe19d0b[_0xc0df('0x5c')],null))['then'](function(_0xd60bb0){if(_0xd60bb0){_0x514d72[_0xc0df('0x2c')]=_0xd60bb0[_0xc0df('0x63')]({'plain':!![]});return db['ChatInteraction'][_0xc0df('0x5a')]({'where':{'id':_0xd60bb0[_0xc0df('0x64')]}});}return null;})['then'](handleEntityNotFound(_0x2103d9,null))['then'](function(_0x561f65){if(_0x561f65){return _0x561f65['update']({'UserId':_0xe19d0b[_0xc0df('0x5c')][_0xc0df('0x65')],'read1stAt':_['isNil'](_0x561f65[_0xc0df('0x66')])?moment()[_0xc0df('0x61')](_0xc0df('0x67')):undefined});}return null;})[_0xc0df('0x39')](function(_0x12177f){if(_0x12177f){_0x514d72[_0xc0df('0x68')]=_0x12177f[_0xc0df('0x63')]({'plain':!![]});interaction_log['info'](_0xc0df('0x69'),_0xe19d0b['user']['id'],_0xe19d0b[_0xc0df('0x6a')][_0xc0df('0x3c')],_0xe19d0b[_0xc0df('0x6a')][_0xc0df('0x6b')],_0x514d72[_0xc0df('0x68')]['id'],_0xe19d0b[_0xc0df('0x5c')]?JSON[_0xc0df('0x29')](_0xe19d0b[_0xc0df('0x5c')]):_0xc0df('0x6c'));return respondWithRpcPromise('AcceptMessage',_0xc0df('0x6d'),_0x514d72);}return null;})[_0xc0df('0x39')](function(_0x409be1){var _0x301751='SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20'+_0x409be1[_0xc0df('0x2c')][_0xc0df('0x6e')];return db['sequelize']['query'](_0x301751,{'type':db[_0xc0df('0x6f')][_0xc0df('0x70')][_0xc0df('0x71')],'raw':!![]})[_0xc0df('0x39')](function(_0x4d1689){return _0x4d1689;});})[_0xc0df('0x39')](function(_0x3428dc){if(_0x3428dc){_0x514d72['message'][_0xc0df('0x72')]=_0x3428dc[0x0];if(!_0xe19d0b[_0xc0df('0x5c')]['UserId'])return;return db[_0xc0df('0x73')][_0xc0df('0x5a')]({'where':{'id':_0xe19d0b['body'][_0xc0df('0x65')],'role':'agent'},'attributes':['id','name',_0xc0df('0x74'),_0xc0df('0x75'),_0xc0df('0x76')],'raw':!![]});}return null;})[_0xc0df('0x39')](function(_0x133160){if(!_0x133160)return null;_0x514d72['message'][_0xc0df('0x62')]=_0x133160;return _0x514d72;})['then'](function(_0x1c2cb0){if(_0x1c2cb0){if(_0xe19d0b[_0xc0df('0x5c')][_0xc0df('0x77')]){_0x514d72[_0xc0df('0x2c')][_0xc0df('0x78')]=util[_0xc0df('0x61')]('SIP/%s',_0xe19d0b[_0xc0df('0x6a')][_0xc0df('0x3c')]);_0x514d72['message']['channel']=_0x514d72['channel'];_0x514d72[_0xc0df('0x2c')][_0xc0df('0x79')]=_0x514d72[_0xc0df('0x7a')];_0x514d72[_0xc0df('0x2c')][_0xc0df('0x7b')]=_0xc0df('0x5e');return respondWithRpcPromise('EventManager',_0xc0df('0x7c'),{'event':_0xc0df('0x7d'),'message':_[_0xc0df('0x4f')](_0x514d72['message'],JSON[_0xc0df('0x7e')](_0x514d72[_0xc0df('0x68')][_0xc0df('0x7f')]))},client9002)['then'](function(){return _0x514d72;});}return _0x514d72;}return null;})[_0xc0df('0x39')](respondWithResult(_0x2103d9,null))[_0xc0df('0x2e')](handleError(_0x2103d9,null));};var interaction_log=require(_0xc0df('0x17'))(_0xc0df('0x80'));exports['reject']=function(_0x2d24f1,_0x4fdf75,_0x21a7cb){var _0x1a5150={'agent':{},'channel':_0xc0df('0x5f')};if(_0x2d24f1[_0xc0df('0x5c')]['id']){delete _0x2d24f1['body']['id'];}_0x2d24f1[_0xc0df('0x5c')][_0xc0df('0x65')]=_0x2d24f1[_0xc0df('0x5c')][_0xc0df('0x65')]||_0x2d24f1[_0xc0df('0x6a')]['id'];_0x1a5150[_0xc0df('0x62')]['id']=_0x2d24f1[_0xc0df('0x5c')][_0xc0df('0x65')];return db[_0xc0df('0x53')][_0xc0df('0x5a')]({'where':{'id':_0x2d24f1[_0xc0df('0x58')]['id'],'UserId':null}})[_0xc0df('0x39')](handleEntityNotFound(_0x4fdf75,null))[_0xc0df('0x39')](function(_0x1ca290){if(_0x1ca290){_0x1a5150['message']=_0x1ca290[_0xc0df('0x63')]({'plain':!![]});return db['ChatInteraction'][_0xc0df('0x5a')]({'where':{'id':_0x1ca290['ChatInteractionId']}});}return null;})[_0xc0df('0x39')](handleEntityNotFound(_0x4fdf75,null))[_0xc0df('0x39')](function(_0x35a633){if(_0x35a633){_0x1a5150[_0xc0df('0x68')]=_0x35a633['get']({'plain':!![]});interaction_log['info'](_0xc0df('0x81'),_0x2d24f1['user']['id'],_0x2d24f1['user']['name'],_0x2d24f1['user']['role'],_0x1a5150['interaction']['id'],_0x2d24f1[_0xc0df('0x5c')]?JSON[_0xc0df('0x29')](_0x2d24f1[_0xc0df('0x5c')]):'null');return respondWithRpcPromise('RejectMessage',_0xc0df('0x82'),_0x1a5150);}return null;})[_0xc0df('0x39')](function(_0xebc513){var _0x1530d3=_0xc0df('0x83')+_0xebc513['message'][_0xc0df('0x6e')];return db[_0xc0df('0x84')]['query'](_0x1530d3,{'type':db[_0xc0df('0x6f')][_0xc0df('0x70')][_0xc0df('0x71')],'raw':!![]})[_0xc0df('0x39')](function(_0x2d11d5){return _0x2d11d5;});})['then'](function(_0x21d0b3){if(_0x21d0b3){_0x1a5150[_0xc0df('0x2c')]['contact']=_0x21d0b3[0x0];if(!_0x2d24f1[_0xc0df('0x5c')][_0xc0df('0x65')])return;return db[_0xc0df('0x73')][_0xc0df('0x5a')]({'where':{'id':_0x2d24f1[_0xc0df('0x5c')][_0xc0df('0x65')],'role':_0xc0df('0x62')},'attributes':['id',_0xc0df('0x3c'),_0xc0df('0x74'),_0xc0df('0x75'),_0xc0df('0x76')],'raw':!![]});}return null;})[_0xc0df('0x39')](function(_0x3625b1){if(!_0x3625b1)return null;_0x1a5150[_0xc0df('0x2c')][_0xc0df('0x62')]=_0x3625b1;return _0x1a5150;})[_0xc0df('0x39')](function(_0x76f039){if(_0x76f039){_0x76f039[_0xc0df('0x2c')][_0xc0df('0x78')]=util[_0xc0df('0x61')]('SIP/%s',_0x2d24f1['user'][_0xc0df('0x3c')]);_0x76f039[_0xc0df('0x2c')]['channel']=_0x1a5150[_0xc0df('0x7a')];_0x76f039[_0xc0df('0x2c')]['motionChannel']=_0x1a5150[_0xc0df('0x7a')];_0x76f039['message']['event']=_0xc0df('0x85');respondWithRpcPromise(_0xc0df('0x7c'),_0xc0df('0x7c'),{'event':_0xc0df('0x86'),'message':_[_0xc0df('0x4f')](_0x1a5150['message'],JSON[_0xc0df('0x7e')](_0x1a5150[_0xc0df('0x68')][_0xc0df('0x7f')]))},client9002);return _0x1a5150;}return null;})['then'](respondWithResult(_0x4fdf75,null))[_0xc0df('0x2e')](handleError(_0x4fdf75,null));};
\ No newline at end of file
diff --git a/server/api/chatMessage/chatMessage.events.js b/server/api/chatMessage/chatMessage.events.js
index 9ab3198..9e9fa47 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 _0x65ae=['remove','emit','hasOwnProperty','hook','exports','events','setMaxListeners','save'];(function(_0x1ec65c,_0x354923){var _0x5249c2=function(_0x451341){while(--_0x451341){_0x1ec65c['push'](_0x1ec65c['shift']());}};_0x5249c2(++_0x354923);}(_0x65ae,0x1ed));var _0xe65a=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x65ae[_0x14add3];return _0x4a174f;};'use strict';var EventEmitter=require(_0xe65a('0x0'));var ChatMessage=require('../../mysqldb')['db']['ChatMessage'];var ChatMessageEvents=new EventEmitter();ChatMessageEvents[_0xe65a('0x1')](0x0);var events={'afterCreate':_0xe65a('0x2'),'afterUpdate':'update','afterDestroy':_0xe65a('0x3')};function emitEvent(_0x47c0f3){return function(_0x587cc8,_0x55230e,_0x1101dc){ChatMessageEvents[_0xe65a('0x4')](_0x47c0f3+':'+_0x587cc8['id'],_0x587cc8);ChatMessageEvents['emit'](_0x47c0f3,_0x587cc8);_0x1101dc(null);};}for(var e in events){if(events[_0xe65a('0x5')](e)){var event=events[e];ChatMessage[_0xe65a('0x6')](e,emitEvent(event));}}module[_0xe65a('0x7')]=ChatMessageEvents;
\ No newline at end of file
+var _0xedc9=['setMaxListeners','save','emit','hasOwnProperty','hook','exports','events','../../mysqldb','ChatMessage'];(function(_0xab4d08,_0x4de007){var _0x29f61a=function(_0x1492fe){while(--_0x1492fe){_0xab4d08['push'](_0xab4d08['shift']());}};_0x29f61a(++_0x4de007);}(_0xedc9,0x102));var _0x9edc=function(_0x317d4e,_0x3de942){_0x317d4e=_0x317d4e-0x0;var _0x56ce3d=_0xedc9[_0x317d4e];return _0x56ce3d;};'use strict';var EventEmitter=require(_0x9edc('0x0'));var ChatMessage=require(_0x9edc('0x1'))['db'][_0x9edc('0x2')];var ChatMessageEvents=new EventEmitter();ChatMessageEvents[_0x9edc('0x3')](0x0);var events={'afterCreate':_0x9edc('0x4'),'afterUpdate':'update','afterDestroy':'remove'};function emitEvent(_0x34bca7){return function(_0x176f24,_0x13bc05,_0x2ee059){ChatMessageEvents[_0x9edc('0x5')](_0x34bca7+':'+_0x176f24['id'],_0x176f24);ChatMessageEvents[_0x9edc('0x5')](_0x34bca7,_0x176f24);_0x2ee059(null);};}for(var e in events){if(events[_0x9edc('0x6')](e)){var event=events[e];ChatMessage[_0x9edc('0x7')](e,emitEvent(event));}}module[_0x9edc('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 e7c6cef..c54ccbb 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 _0x7140=['../../config/logger','api','moment','bluebird','path','rimraf','../../config/environment','./chatMessage.attributes','exports','define','chat_messages','fti_chat_messages','body','FULLTEXT','get','direction','toLowerCase','out','UserId','ChatInteraction','findOne','update','catch','error','utf8mb4_unicode_ci','lodash','util'];(function(_0x846a4e,_0x3c09df){var _0x5ea714=function(_0x27020b){while(--_0x27020b){_0x846a4e['push'](_0x846a4e['shift']());}};_0x5ea714(++_0x3c09df);}(_0x7140,0xbb));var _0x0714=function(_0x4ea6af,_0x4aa32e){_0x4ea6af=_0x4ea6af-0x0;var _0x4cb1e6=_0x7140[_0x4ea6af];return _0x4cb1e6;};'use strict';var _=require(_0x0714('0x0'));var util=require(_0x0714('0x1'));var logger=require(_0x0714('0x2'))(_0x0714('0x3'));var moment=require(_0x0714('0x4'));var BPromise=require(_0x0714('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x0714('0x6'));var rimraf=require(_0x0714('0x7'));var config=require(_0x0714('0x8'));var attributes=require(_0x0714('0x9'));module[_0x0714('0xa')]=function(_0x322d89,_0x4faa0c){return _0x322d89[_0x0714('0xb')]('ChatMessage',attributes,{'tableName':_0x0714('0xc'),'paranoid':![],'indexes':[{'name':_0x0714('0xd'),'fields':[_0x0714('0xe')],'type':_0x0714('0xf')}],'timestamps':!![],'hooks':{'afterCreate':function(_0xeab8fb,_0x4092d3,_0x15b59f){var _0x144504=_0x322d89['models'];var _0x47f1ac=_0xeab8fb[_0x0714('0x10')]({'plain':!![]});if(_0x47f1ac[_0x0714('0x11')][_0x0714('0x12')]()==='in'||_0x47f1ac[_0x0714('0x11')][_0x0714('0x12')]()===_0x0714('0x13')&&!_0x47f1ac['secret']&&!_['isNil'](_0x47f1ac[_0x0714('0x14')])){_0x144504[_0x0714('0x15')][_0x0714('0x16')]({'where':{'id':_0x47f1ac['ChatInteractionId']}})['then'](function(_0x34b268){if(_0x34b268){_0x34b268[_0x0714('0x17')]({'lastMsgAt':_0x47f1ac['createdAt'],'lastMsgDirection':_0x47f1ac['direction'][_0x0714('0x12')]()});}})[_0x0714('0x18')](function(_0x76178e){console[_0x0714('0x19')](_0x76178e);});}_0x15b59f();}},'charset':'utf8mb4','collate':_0x0714('0x1a')});};
\ No newline at end of file
+var _0xcefe=['api','moment','request-promise','path','rimraf','../../config/environment','./chatMessage.attributes','define','chat_messages','fti_chat_messages','body','FULLTEXT','models','get','direction','toLowerCase','out','secret','UserId','ChatInteraction','findOne','then','update','createdAt','catch','error','utf8mb4_unicode_ci','lodash','../../config/logger'];(function(_0x10f2b0,_0x37c84c){var _0xa4cf05=function(_0x2a3435){while(--_0x2a3435){_0x10f2b0['push'](_0x10f2b0['shift']());}};_0xa4cf05(++_0x37c84c);}(_0xcefe,0x15a));var _0xecef=function(_0x446267,_0x42e31){_0x446267=_0x446267-0x0;var _0x57caae=_0xcefe[_0x446267];return _0x57caae;};'use strict';var _=require(_0xecef('0x0'));var util=require('util');var logger=require(_0xecef('0x1'))(_0xecef('0x2'));var moment=require(_0xecef('0x3'));var BPromise=require('bluebird');var rp=require(_0xecef('0x4'));var fs=require('fs');var path=require(_0xecef('0x5'));var rimraf=require(_0xecef('0x6'));var config=require(_0xecef('0x7'));var attributes=require(_0xecef('0x8'));module['exports']=function(_0x5bc733,_0x147289){return _0x5bc733[_0xecef('0x9')]('ChatMessage',attributes,{'tableName':_0xecef('0xa'),'paranoid':![],'indexes':[{'name':_0xecef('0xb'),'fields':[_0xecef('0xc')],'type':_0xecef('0xd')}],'timestamps':!![],'hooks':{'afterCreate':function(_0x41bb3f,_0x361e61,_0x36cc1b){var _0x316a26=_0x5bc733[_0xecef('0xe')];var _0x43e0c0=_0x41bb3f[_0xecef('0xf')]({'plain':!![]});if(_0x43e0c0[_0xecef('0x10')][_0xecef('0x11')]()==='in'||_0x43e0c0[_0xecef('0x10')][_0xecef('0x11')]()===_0xecef('0x12')&&!_0x43e0c0[_0xecef('0x13')]&&!_['isNil'](_0x43e0c0[_0xecef('0x14')])){_0x316a26[_0xecef('0x15')][_0xecef('0x16')]({'where':{'id':_0x43e0c0['ChatInteractionId']}})[_0xecef('0x17')](function(_0x29e515){if(_0x29e515){_0x29e515[_0xecef('0x18')]({'lastMsgAt':_0x43e0c0[_0xecef('0x19')],'lastMsgDirection':_0x43e0c0[_0xecef('0x10')][_0xecef('0x11')]()});}})[_0xecef('0x1a')](function(_0x29e69b){console[_0xecef('0x1b')](_0x29e69b);});}_0x36cc1b();}},'charset':'utf8mb4','collate':_0xecef('0x1c')});};
\ No newline at end of file
diff --git a/server/api/chatMessage/chatMessage.rpc.js b/server/api/chatMessage/chatMessage.rpc.js
index f4f1902..92b8980 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 _0x7a40=['result','catch','CreateChatMessage','ChatMessage','body','options','debug','stringify','lodash','util','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','./chatMessage.socket','register','request','then','ChatMessage,\x20%s,\x20%s','request\x20sent','error','code','message','info'];(function(_0x1da04e,_0x31024b){var _0xdd8c41=function(_0x2036f9){while(--_0x2036f9){_0x1da04e['push'](_0x1da04e['shift']());}};_0xdd8c41(++_0x31024b);}(_0x7a40,0x19b));var _0x07a4=function(_0x5c0e35,_0x40e697){_0x5c0e35=_0x5c0e35-0x0;var _0x3380fd=_0x7a40[_0x5c0e35];return _0x3380fd;};'use strict';var _=require(_0x07a4('0x0'));var util=require(_0x07a4('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x07a4('0x2'));var db=require(_0x07a4('0x3'))['db'];var utils=require(_0x07a4('0x4'));var logger=require('../../config/logger')(_0x07a4('0x5'));var config=require(_0x07a4('0x6'));var jayson=require(_0x07a4('0x7'));var client=jayson[_0x07a4('0x8')][_0x07a4('0x9')]({'port':0x232a});config[_0x07a4('0xa')]=_[_0x07a4('0xb')](config[_0x07a4('0xa')],{'host':_0x07a4('0xc'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x07a4('0xa')]));require(_0x07a4('0xd'))[_0x07a4('0xe')](socket);function respondWithRpcPromise(_0x3edc3a,_0x4a3995,_0x3744e2){return new BPromise(function(_0x745e6f,_0x1713d2){return client[_0x07a4('0xf')](_0x3edc3a,_0x3744e2)[_0x07a4('0x10')](function(_0x283994){logger['info'](_0x07a4('0x11'),_0x4a3995,_0x07a4('0x12'));logger['debug']('ChatMessage,\x20%s,\x20%s,\x20%s',_0x4a3995,_0x07a4('0x12'),JSON['stringify'](_0x283994));if(_0x283994[_0x07a4('0x13')]){if(_0x283994[_0x07a4('0x13')][_0x07a4('0x14')]===0x1f4){logger['error']('ChatMessage,\x20%s,\x20%s',_0x4a3995,_0x283994[_0x07a4('0x13')][_0x07a4('0x15')]);return _0x1713d2(_0x283994[_0x07a4('0x13')][_0x07a4('0x15')]);}logger[_0x07a4('0x13')](_0x07a4('0x11'),_0x4a3995,_0x283994[_0x07a4('0x13')][_0x07a4('0x15')]);return _0x745e6f(_0x283994['error'][_0x07a4('0x15')]);}else{logger[_0x07a4('0x16')](_0x07a4('0x11'),_0x4a3995,'request\x20sent');_0x745e6f(_0x283994[_0x07a4('0x17')][_0x07a4('0x15')]);}})[_0x07a4('0x18')](function(_0x2eeb04){logger[_0x07a4('0x13')](_0x07a4('0x11'),_0x4a3995,_0x2eeb04);_0x1713d2(_0x2eeb04);});});}exports[_0x07a4('0x19')]=function(_0x143c3e){var _0x2f5478=this;return new Promise(function(_0x17cfe3,_0x4bbdc6){return db[_0x07a4('0x1a')]['create'](_0x143c3e[_0x07a4('0x1b')],{'raw':_0x143c3e[_0x07a4('0x1c')]?_0x143c3e[_0x07a4('0x1c')]['raw']===undefined?!![]:![]:!![]})[_0x07a4('0x10')](function(_0x43a81d){logger[_0x07a4('0x16')](_0x07a4('0x19'),_0x143c3e);logger[_0x07a4('0x1d')](_0x07a4('0x19'),_0x143c3e,JSON[_0x07a4('0x1e')](_0x43a81d));_0x17cfe3(_0x43a81d);})[_0x07a4('0x18')](function(_0x1f624d){logger['error'](_0x07a4('0x19'),_0x1f624d[_0x07a4('0x15')],_0x143c3e);_0x4bbdc6(_0x2f5478[_0x07a4('0x13')](0x1f4,_0x1f624d[_0x07a4('0x15')]));});});};
\ No newline at end of file
+var _0x27e9=['CreateChatMessage','ChatMessage','create','body','options','raw','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','redis','defaults','localhost','socket.io-emitter','register','request','then','info','ChatMessage,\x20%s,\x20%s','request\x20sent','ChatMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch'];(function(_0x17406e,_0x1049fd){var _0x2bfc5a=function(_0x2aae05){while(--_0x2aae05){_0x17406e['push'](_0x17406e['shift']());}};_0x2bfc5a(++_0x1049fd);}(_0x27e9,0x116));var _0x927e=function(_0x2faa64,_0x6f5fe0){_0x2faa64=_0x2faa64-0x0;var _0x29f12f=_0x27e9[_0x2faa64];return _0x29f12f;};'use strict';var _=require(_0x927e('0x0'));var util=require(_0x927e('0x1'));var moment=require('moment');var BPromise=require(_0x927e('0x2'));var rs=require(_0x927e('0x3'));var fs=require('fs');var Redis=require(_0x927e('0x4'));var db=require(_0x927e('0x5'))['db'];var utils=require(_0x927e('0x6'));var logger=require(_0x927e('0x7'))('rpc');var config=require(_0x927e('0x8'));var jayson=require(_0x927e('0x9'));var client=jayson[_0x927e('0xa')]['http']({'port':0x232a});config[_0x927e('0xb')]=_[_0x927e('0xc')](config[_0x927e('0xb')],{'host':_0x927e('0xd'),'port':0x18eb});var socket=require(_0x927e('0xe'))(new Redis(config[_0x927e('0xb')]));require('./chatMessage.socket')[_0x927e('0xf')](socket);function respondWithRpcPromise(_0x359338,_0x5d1336,_0x26242e){return new BPromise(function(_0x2ecbfa,_0x8f9fd1){return client[_0x927e('0x10')](_0x359338,_0x26242e)[_0x927e('0x11')](function(_0x225a25){logger[_0x927e('0x12')](_0x927e('0x13'),_0x5d1336,_0x927e('0x14'));logger['debug'](_0x927e('0x15'),_0x5d1336,_0x927e('0x14'),JSON[_0x927e('0x16')](_0x225a25));if(_0x225a25[_0x927e('0x17')]){if(_0x225a25['error'][_0x927e('0x18')]===0x1f4){logger['error'](_0x927e('0x13'),_0x5d1336,_0x225a25['error'][_0x927e('0x19')]);return _0x8f9fd1(_0x225a25['error'][_0x927e('0x19')]);}logger[_0x927e('0x17')](_0x927e('0x13'),_0x5d1336,_0x225a25[_0x927e('0x17')]['message']);return _0x2ecbfa(_0x225a25[_0x927e('0x17')][_0x927e('0x19')]);}else{logger['info'](_0x927e('0x13'),_0x5d1336,_0x927e('0x14'));_0x2ecbfa(_0x225a25[_0x927e('0x1a')][_0x927e('0x19')]);}})[_0x927e('0x1b')](function(_0x43ee4a){logger[_0x927e('0x17')](_0x927e('0x13'),_0x5d1336,_0x43ee4a);_0x8f9fd1(_0x43ee4a);});});}exports[_0x927e('0x1c')]=function(_0x23afc4){var _0x30892c=this;return new Promise(function(_0x58c2f7,_0x3f20e6){return db[_0x927e('0x1d')][_0x927e('0x1e')](_0x23afc4[_0x927e('0x1f')],{'raw':_0x23afc4[_0x927e('0x20')]?_0x23afc4[_0x927e('0x20')][_0x927e('0x21')]===undefined?!![]:![]:!![]})['then'](function(_0x40d8ce){logger[_0x927e('0x12')]('CreateChatMessage',_0x23afc4);logger['debug'](_0x927e('0x1c'),_0x23afc4,JSON['stringify'](_0x40d8ce));_0x58c2f7(_0x40d8ce);})[_0x927e('0x1b')](function(_0x59413c){logger[_0x927e('0x17')](_0x927e('0x1c'),_0x59413c[_0x927e('0x19')],_0x23afc4);_0x3f20e6(_0x30892c[_0x927e('0x17')](0x1f4,_0x59413c[_0x927e('0x19')]));});});};
\ No newline at end of file
diff --git a/server/api/chatMessage/chatMessage.socket.js b/server/api/chatMessage/chatMessage.socket.js
index 71f0db6..2dac4fa 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 _0x1ef3=['chatMessage:','./chatMessage.events','save','update','emit','removeListener','register','length'];(function(_0x5ce99f,_0x648dd1){var _0x187558=function(_0x302bb8){while(--_0x302bb8){_0x5ce99f['push'](_0x5ce99f['shift']());}};_0x187558(++_0x648dd1);}(_0x1ef3,0x69));var _0x31ef=function(_0x53cbc5,_0xdfb0ac){_0x53cbc5=_0x53cbc5-0x0;var _0x10cc2e=_0x1ef3[_0x53cbc5];return _0x10cc2e;};'use strict';var ChatMessageEvents=require(_0x31ef('0x0'));var events=[_0x31ef('0x1'),'remove',_0x31ef('0x2')];function createListener(_0x24447b,_0x30dbd7){return function(_0x4df75f){_0x30dbd7[_0x31ef('0x3')](_0x24447b,_0x4df75f);};}function removeListener(_0x58388a,_0x49ce87){return function(){ChatMessageEvents[_0x31ef('0x4')](_0x58388a,_0x49ce87);};}exports[_0x31ef('0x5')]=function(_0x81db4){for(var _0x454b60=0x0,_0x185f8c=events[_0x31ef('0x6')];_0x454b60<_0x185f8c;_0x454b60++){var _0x554347=events[_0x454b60];var _0xf94594=createListener(_0x31ef('0x7')+_0x554347,_0x81db4);ChatMessageEvents['on'](_0x554347,_0xf94594);}};
\ No newline at end of file
+var _0x8ca9=['length','chatMessage:','./chatMessage.events','save','remove','update','register'];(function(_0x3779cf,_0x4f316a){var _0x264263=function(_0x2163de){while(--_0x2163de){_0x3779cf['push'](_0x3779cf['shift']());}};_0x264263(++_0x4f316a);}(_0x8ca9,0x9c));var _0x98ca=function(_0xb6298b,_0x2631cc){_0xb6298b=_0xb6298b-0x0;var _0x3239d9=_0x8ca9[_0xb6298b];return _0x3239d9;};'use strict';var ChatMessageEvents=require(_0x98ca('0x0'));var events=[_0x98ca('0x1'),_0x98ca('0x2'),_0x98ca('0x3')];function createListener(_0x3d9153,_0x22047f){return function(_0xe479d6){_0x22047f['emit'](_0x3d9153,_0xe479d6);};}function removeListener(_0x4c230f,_0x142793){return function(){ChatMessageEvents['removeListener'](_0x4c230f,_0x142793);};}exports[_0x98ca('0x4')]=function(_0x48415d){for(var _0x219619=0x0,_0xca4097=events[_0x98ca('0x5')];_0x219619<_0xca4097;_0x219619++){var _0x2852a0=events[_0x219619];var _0x323c95=createListener(_0x98ca('0x6')+_0x2852a0,_0x48415d);ChatMessageEvents['on'](_0x2852a0,_0x323c95);}};
\ No newline at end of file
diff --git a/server/api/chatMessage/index.js b/server/api/chatMessage/index.js
index ab79fae..07733c9 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 _0x673f=['index','/describe','describe','/:id','show','tracked','chatmessage:create','create','put','update','/:id/accept','reject','delete','destroy','exports','multer','util','connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment','get','isAuthenticated'];(function(_0x2ed8f3,_0x4aa12f){var _0x525a55=function(_0x4cfb58){while(--_0x4cfb58){_0x2ed8f3['push'](_0x2ed8f3['shift']());}};_0x525a55(++_0x4aa12f);}(_0x673f,0x73));var _0xf673=function(_0x730669,_0x6302a9){_0x730669=_0x730669-0x0;var _0x58a406=_0x673f[_0x730669];return _0x58a406;};'use strict';var multer=require(_0xf673('0x0'));var util=require(_0xf673('0x1'));var path=require('path');var timeout=require(_0xf673('0x2'));var express=require(_0xf673('0x3'));var router=express[_0xf673('0x4')]();var fs_extra=require(_0xf673('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0xf673('0x6'));var config=require(_0xf673('0x7'));var controller=require('./chatMessage.controller');router[_0xf673('0x8')]('/',auth[_0xf673('0x9')](),controller[_0xf673('0xa')]);router[_0xf673('0x8')](_0xf673('0xb'),auth['isAuthenticated'](),controller[_0xf673('0xc')]);router[_0xf673('0x8')](_0xf673('0xd'),auth['isAuthenticated'](),controller[_0xf673('0xe')]);router['post']('/',auth[_0xf673('0x9')](),interaction[_0xf673('0xf')]('chat',_0xf673('0x10')),controller[_0xf673('0x11')]);router[_0xf673('0x12')](_0xf673('0xd'),controller[_0xf673('0x13')]);router['put'](_0xf673('0x14'),auth[_0xf673('0x9')](),controller['accept']);router['put']('/:id/reject',auth[_0xf673('0x9')](),controller[_0xf673('0x15')]);router[_0xf673('0x16')]('/:id',auth[_0xf673('0x9')](),controller[_0xf673('0x17')]);module[_0xf673('0x18')]=router;
\ No newline at end of file
+var _0x3eaf=['../../components/interaction/service','../../config/environment','./chatMessage.controller','get','isAuthenticated','describe','/:id','show','post','tracked','chat','chatmessage:create','create','put','/:id/accept','accept','reject','delete','destroy','exports','multer','util','path','express','Router','../../components/auth/service'];(function(_0x616290,_0x280b7f){var _0x453879=function(_0x27bda7){while(--_0x27bda7){_0x616290['push'](_0x616290['shift']());}};_0x453879(++_0x280b7f);}(_0x3eaf,0x180));var _0xf3ea=function(_0x2e9626,_0x22c5a1){_0x2e9626=_0x2e9626-0x0;var _0x292f9c=_0x3eaf[_0x2e9626];return _0x292f9c;};'use strict';var multer=require(_0xf3ea('0x0'));var util=require(_0xf3ea('0x1'));var path=require(_0xf3ea('0x2'));var timeout=require('connect-timeout');var express=require(_0xf3ea('0x3'));var router=express[_0xf3ea('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0xf3ea('0x5'));var interaction=require(_0xf3ea('0x6'));var config=require(_0xf3ea('0x7'));var controller=require(_0xf3ea('0x8'));router[_0xf3ea('0x9')]('/',auth['isAuthenticated'](),controller['index']);router[_0xf3ea('0x9')]('/describe',auth[_0xf3ea('0xa')](),controller[_0xf3ea('0xb')]);router['get'](_0xf3ea('0xc'),auth[_0xf3ea('0xa')](),controller[_0xf3ea('0xd')]);router[_0xf3ea('0xe')]('/',auth[_0xf3ea('0xa')](),interaction[_0xf3ea('0xf')](_0xf3ea('0x10'),_0xf3ea('0x11')),controller[_0xf3ea('0x12')]);router[_0xf3ea('0x13')](_0xf3ea('0xc'),controller['update']);router[_0xf3ea('0x13')](_0xf3ea('0x14'),auth['isAuthenticated'](),controller[_0xf3ea('0x15')]);router[_0xf3ea('0x13')]('/:id/reject',auth[_0xf3ea('0xa')](),controller[_0xf3ea('0x16')]);router[_0xf3ea('0x17')](_0xf3ea('0xc'),auth[_0xf3ea('0xa')](),controller[_0xf3ea('0x18')]);module[_0xf3ea('0x19')]=router;
\ No newline at end of file
diff --git a/server/api/chatOfflineMessage/chatOfflineMessage.attributes.js b/server/api/chatOfflineMessage/chatOfflineMessage.attributes.js
index e61b81c..8704df4 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 _0xc83b=['medium','TEXT'];(function(_0x9c765f,_0x452200){var _0xcf23b1=function(_0x1198dd){while(--_0x1198dd){_0x9c765f['push'](_0x9c765f['shift']());}};_0xcf23b1(++_0x452200);}(_0xc83b,0x149));var _0xbc83=function(_0x5c280d,_0xd67fa0){_0x5c280d=_0x5c280d-0x0;var _0x460137=_0xc83b[_0x5c280d];return _0x460137;};'use strict';var Sequelize=require('sequelize');module['exports']={'body':{'type':Sequelize[_0xbc83('0x0')](_0xbc83('0x1')),'allowNull':![]}};
\ No newline at end of file
+var _0x15f4=['TEXT','medium','sequelize'];(function(_0x5b7788,_0x309ae5){var _0x573871=function(_0x5c79fd){while(--_0x5c79fd){_0x5b7788['push'](_0x5b7788['shift']());}};_0x573871(++_0x309ae5);}(_0x15f4,0x167));var _0x415f=function(_0x4275af,_0x54d474){_0x4275af=_0x4275af-0x0;var _0x317cb6=_0x15f4[_0x4275af];return _0x317cb6;};'use strict';var Sequelize=require(_0x415f('0x0'));module['exports']={'body':{'type':Sequelize[_0x415f('0x1')](_0x415f('0x2')),'allowNull':![]}};
\ No newline at end of file
diff --git a/server/api/chatOfflineMessage/chatOfflineMessage.controller.js b/server/api/chatOfflineMessage/chatOfflineMessage.controller.js
index 6c425f3..3212d82 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(_0x2af254,_0x4ee33f){var _0x574281=function(_0x448964){while(--_0x448964){_0x2af254['push'](_0x2af254['shift']());}};_0x574281(++_0x4ee33f);}(_0x9957,0x93));var _0x7995=function(_0x618414,_0x1a7a60){_0x618414=_0x618414-0x0;var _0x21c19a=_0x9957[_0x618414];return _0x21c19a;};'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(_0x1ddedd,_0x485606){var _0xa3e1ac=function(_0x580444){while(--_0x580444){_0x1ddedd['push'](_0x1ddedd['shift']());}};_0xa3e1ac(++_0x485606);}(_0x7a54,0x106));var _0x47a5=function(_0x579a37,_0x255448){_0x579a37=_0x579a37-0x0;var _0x12e8dc=_0x7a54[_0x579a37];return _0x12e8dc;};'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 3fdab1d..fb88e2b 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 _0x69e5=['define','ChatOfflineMessage','chat_offline_messages','utf8mb4_unicode_ci','lodash','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./chatOfflineMessage.attributes','exports'];(function(_0x1cf4de,_0x144315){var _0x2987fd=function(_0xba7fd2){while(--_0xba7fd2){_0x1cf4de['push'](_0x1cf4de['shift']());}};_0x2987fd(++_0x144315);}(_0x69e5,0xf4));var _0x569e=function(_0x3fad5a,_0x2d3b02){_0x3fad5a=_0x3fad5a-0x0;var _0x4ca713=_0x69e5[_0x3fad5a];return _0x4ca713;};'use strict';var _=require(_0x569e('0x0'));var util=require('util');var logger=require(_0x569e('0x1'))(_0x569e('0x2'));var moment=require(_0x569e('0x3'));var BPromise=require(_0x569e('0x4'));var rp=require(_0x569e('0x5'));var fs=require('fs');var path=require(_0x569e('0x6'));var rimraf=require(_0x569e('0x7'));var config=require(_0x569e('0x8'));var attributes=require(_0x569e('0x9'));module[_0x569e('0xa')]=function(_0x408a99,_0x1d5531){return _0x408a99[_0x569e('0xb')](_0x569e('0xc'),attributes,{'tableName':_0x569e('0xd'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':'utf8mb4','collate':_0x569e('0xe')});};
\ No newline at end of file
+var _0xb00a=['bluebird','path','rimraf','../../config/environment','exports','define','ChatOfflineMessage','utf8mb4','utf8mb4_unicode_ci','util','../../config/logger'];(function(_0x38df12,_0x40fbea){var _0x4cbe9=function(_0x3bfd91){while(--_0x3bfd91){_0x38df12['push'](_0x38df12['shift']());}};_0x4cbe9(++_0x40fbea);}(_0xb00a,0xa3));var _0xab00=function(_0x3cbdab,_0x3b2a8c){_0x3cbdab=_0x3cbdab-0x0;var _0x312b74=_0xb00a[_0x3cbdab];return _0x312b74;};'use strict';var _=require('lodash');var util=require(_0xab00('0x0'));var logger=require(_0xab00('0x1'))('api');var moment=require('moment');var BPromise=require(_0xab00('0x2'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xab00('0x3'));var rimraf=require(_0xab00('0x4'));var config=require(_0xab00('0x5'));var attributes=require('./chatOfflineMessage.attributes');module[_0xab00('0x6')]=function(_0x470e2f,_0x3b47ae){return _0x470e2f[_0xab00('0x7')](_0xab00('0x8'),attributes,{'tableName':'chat_offline_messages','paranoid':![],'indexes':[],'timestamps':!![],'charset':_0xab00('0x9'),'collate':_0xab00('0xa')});};
\ No newline at end of file
diff --git a/server/api/chatOfflineMessage/chatOfflineMessage.rpc.js b/server/api/chatOfflineMessage/chatOfflineMessage.rpc.js
index 6120d2f..1c83fa9 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 _0x51d0=['ChatOfflineMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','rpc','../../config/environment','request','then','info','ChatOfflineMessage,\x20%s,\x20%s','request\x20sent','debug'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x51d0,0xcd));var _0x051d=function(_0x1cd47d,_0x55bc75){_0x1cd47d=_0x1cd47d-0x0;var _0x29d52f=_0x51d0[_0x1cd47d];return _0x29d52f;};'use strict';var _=require(_0x051d('0x0'));var util=require(_0x051d('0x1'));var moment=require(_0x051d('0x2'));var BPromise=require(_0x051d('0x3'));var rs=require(_0x051d('0x4'));var fs=require('fs');var Redis=require(_0x051d('0x5'));var db=require(_0x051d('0x6'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x051d('0x7'));var config=require(_0x051d('0x8'));var jayson=require('jayson/promise');var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x1849c6,_0x374f48,_0x388fcd){return new BPromise(function(_0x3e3273,_0x322098){return client[_0x051d('0x9')](_0x1849c6,_0x388fcd)[_0x051d('0xa')](function(_0x43cf43){logger[_0x051d('0xb')](_0x051d('0xc'),_0x374f48,_0x051d('0xd'));logger[_0x051d('0xe')](_0x051d('0xf'),_0x374f48,_0x051d('0xd'),JSON[_0x051d('0x10')](_0x43cf43));if(_0x43cf43[_0x051d('0x11')]){if(_0x43cf43[_0x051d('0x11')][_0x051d('0x12')]===0x1f4){logger['error']('ChatOfflineMessage,\x20%s,\x20%s',_0x374f48,_0x43cf43[_0x051d('0x11')][_0x051d('0x13')]);return _0x322098(_0x43cf43[_0x051d('0x11')]['message']);}logger['error'](_0x051d('0xc'),_0x374f48,_0x43cf43[_0x051d('0x11')]['message']);return _0x3e3273(_0x43cf43[_0x051d('0x11')][_0x051d('0x13')]);}else{logger['info'](_0x051d('0xc'),_0x374f48,_0x051d('0xd'));_0x3e3273(_0x43cf43[_0x051d('0x14')][_0x051d('0x13')]);}})[_0x051d('0x15')](function(_0x12b9b0){logger['error'](_0x051d('0xc'),_0x374f48,_0x12b9b0);_0x322098(_0x12b9b0);});});}
\ No newline at end of file
+var _0xadc5=['debug','ChatOfflineMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','moment','bluebird','randomstring','ioredis','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','ChatOfflineMessage,\x20%s,\x20%s','request\x20sent'];(function(_0x47d12e,_0x2d0ada){var _0x1250dc=function(_0x21a5e8){while(--_0x21a5e8){_0x47d12e['push'](_0x47d12e['shift']());}};_0x1250dc(++_0x2d0ada);}(_0xadc5,0x1bd));var _0x5adc=function(_0x4f5185,_0x3f5e83){_0x4f5185=_0x4f5185-0x0;var _0x4f70d8=_0xadc5[_0x4f5185];return _0x4f70d8;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x5adc('0x0'));var BPromise=require(_0x5adc('0x1'));var rs=require(_0x5adc('0x2'));var fs=require('fs');var Redis=require(_0x5adc('0x3'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x5adc('0x4'))(_0x5adc('0x5'));var config=require(_0x5adc('0x6'));var jayson=require(_0x5adc('0x7'));var client=jayson[_0x5adc('0x8')][_0x5adc('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x2d8bf0,_0x44182d,_0x467654){return new BPromise(function(_0xc27950,_0x19b10e){return client[_0x5adc('0xa')](_0x2d8bf0,_0x467654)[_0x5adc('0xb')](function(_0x1c86dc){logger[_0x5adc('0xc')](_0x5adc('0xd'),_0x44182d,_0x5adc('0xe'));logger[_0x5adc('0xf')](_0x5adc('0x10'),_0x44182d,_0x5adc('0xe'),JSON[_0x5adc('0x11')](_0x1c86dc));if(_0x1c86dc[_0x5adc('0x12')]){if(_0x1c86dc[_0x5adc('0x12')][_0x5adc('0x13')]===0x1f4){logger[_0x5adc('0x12')]('ChatOfflineMessage,\x20%s,\x20%s',_0x44182d,_0x1c86dc[_0x5adc('0x12')][_0x5adc('0x14')]);return _0x19b10e(_0x1c86dc[_0x5adc('0x12')][_0x5adc('0x14')]);}logger[_0x5adc('0x12')]('ChatOfflineMessage,\x20%s,\x20%s',_0x44182d,_0x1c86dc[_0x5adc('0x12')][_0x5adc('0x14')]);return _0xc27950(_0x1c86dc['error'][_0x5adc('0x14')]);}else{logger[_0x5adc('0xc')](_0x5adc('0xd'),_0x44182d,_0x5adc('0xe'));_0xc27950(_0x1c86dc[_0x5adc('0x15')][_0x5adc('0x14')]);}})[_0x5adc('0x16')](function(_0x4412d9){logger[_0x5adc('0x12')](_0x5adc('0xd'),_0x44182d,_0x4412d9);_0x19b10e(_0x4412d9);});});}
\ No newline at end of file
diff --git a/server/api/chatOfflineMessage/index.js b/server/api/chatOfflineMessage/index.js
index 2d3d584..3e0906f 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 _0x3b5a=['express','Router','../../config/environment','get','/describe','isAuthenticated','describe','/:id','show','put','delete','destroy','multer','util','path','connect-timeout'];(function(_0x4f90af,_0x14b70c){var _0x5e62c0=function(_0x4aa5b6){while(--_0x4aa5b6){_0x4f90af['push'](_0x4f90af['shift']());}};_0x5e62c0(++_0x14b70c);}(_0x3b5a,0x19c));var _0xa3b5=function(_0xcbfa6d,_0x3fd46d){_0xcbfa6d=_0xcbfa6d-0x0;var _0x156e91=_0x3b5a[_0xcbfa6d];return _0x156e91;};'use strict';var multer=require(_0xa3b5('0x0'));var util=require(_0xa3b5('0x1'));var path=require(_0xa3b5('0x2'));var timeout=require(_0xa3b5('0x3'));var express=require(_0xa3b5('0x4'));var router=express[_0xa3b5('0x5')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0xa3b5('0x6'));var controller=require('./chatOfflineMessage.controller');router[_0xa3b5('0x7')]('/',auth['isAuthenticated'](),controller['index']);router[_0xa3b5('0x7')](_0xa3b5('0x8'),auth[_0xa3b5('0x9')](),controller[_0xa3b5('0xa')]);router[_0xa3b5('0x7')](_0xa3b5('0xb'),auth[_0xa3b5('0x9')](),controller[_0xa3b5('0xc')]);router['post']('/',auth[_0xa3b5('0x9')](),controller['create']);router[_0xa3b5('0xd')](_0xa3b5('0xb'),auth[_0xa3b5('0x9')](),controller['update']);router[_0xa3b5('0xe')]('/:id',auth['isAuthenticated'](),controller[_0xa3b5('0xf')]);module['exports']=router;
\ No newline at end of file
+var _0x2979=['../../config/environment','./chatOfflineMessage.controller','get','isAuthenticated','index','/:id','show','put','update','delete','exports','connect-timeout','express','Router','fs-extra'];(function(_0x52c71f,_0x5aa1e9){var _0x4063a1=function(_0xca8971){while(--_0xca8971){_0x52c71f['push'](_0x52c71f['shift']());}};_0x4063a1(++_0x5aa1e9);}(_0x2979,0x74));var _0x9297=function(_0x51ee74,_0x18e42e){_0x51ee74=_0x51ee74-0x0;var _0x1971dd=_0x2979[_0x51ee74];return _0x1971dd;};'use strict';var multer=require('multer');var util=require('util');var path=require('path');var timeout=require(_0x9297('0x0'));var express=require(_0x9297('0x1'));var router=express[_0x9297('0x2')]();var fs_extra=require(_0x9297('0x3'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x9297('0x4'));var controller=require(_0x9297('0x5'));router[_0x9297('0x6')]('/',auth[_0x9297('0x7')](),controller[_0x9297('0x8')]);router[_0x9297('0x6')]('/describe',auth['isAuthenticated'](),controller['describe']);router['get'](_0x9297('0x9'),auth[_0x9297('0x7')](),controller[_0x9297('0xa')]);router['post']('/',auth[_0x9297('0x7')](),controller['create']);router[_0x9297('0xb')](_0x9297('0x9'),auth['isAuthenticated'](),controller[_0x9297('0xc')]);router[_0x9297('0xd')](_0x9297('0x9'),auth[_0x9297('0x7')](),controller['destroy']);module[_0x9297('0xe')]=router;
\ No newline at end of file
diff --git a/server/api/chatProactiveAction/chatProactiveAction.attributes.js b/server/api/chatProactiveAction/chatProactiveAction.attributes.js
index e1afbca..88afb91 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 _0x6066=['ENUM','mouseOver','timeout','STRING','INTEGER','sequelize'];(function(_0x3062da,_0x352b8f){var _0x1c95ba=function(_0x203c3e){while(--_0x203c3e){_0x3062da['push'](_0x3062da['shift']());}};_0x1c95ba(++_0x352b8f);}(_0x6066,0xa7));var _0x6606=function(_0xfd495c,_0x4a3c1a){_0xfd495c=_0xfd495c-0x0;var _0x561dd8=_0x6066[_0xfd495c];return _0x561dd8;};'use strict';var Sequelize=require(_0x6606('0x0'));module['exports']={'name':{'type':Sequelize['STRING'],'allowNull':![]},'type':{'type':Sequelize[_0x6606('0x1')](_0x6606('0x2'),_0x6606('0x3')),'defaultValue':'mouseOver'},'selector':{'type':Sequelize[_0x6606('0x4')]},'timeout':{'type':Sequelize[_0x6606('0x5')]}};
\ No newline at end of file
+var _0x8109=['mouseOver','INTEGER','sequelize','exports','STRING'];(function(_0x474bc7,_0x2b7561){var _0x17566c=function(_0x1b1220){while(--_0x1b1220){_0x474bc7['push'](_0x474bc7['shift']());}};_0x17566c(++_0x2b7561);}(_0x8109,0x1ce));var _0x9810=function(_0x53146b,_0x599c6e){_0x53146b=_0x53146b-0x0;var _0x25b2b3=_0x8109[_0x53146b];return _0x25b2b3;};'use strict';var Sequelize=require(_0x9810('0x0'));module[_0x9810('0x1')]={'name':{'type':Sequelize[_0x9810('0x2')],'allowNull':![]},'type':{'type':Sequelize['ENUM'](_0x9810('0x3'),'timeout'),'defaultValue':_0x9810('0x3')},'selector':{'type':Sequelize[_0x9810('0x2')]},'timeout':{'type':Sequelize[_0x9810('0x4')]}};
\ No newline at end of file
diff --git a/server/api/chatProactiveAction/chatProactiveAction.controller.js b/server/api/chatProactiveAction/chatProactiveAction.controller.js
index addd9cf..ab27b29 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 _0x4016=['then','destroy','error','stack','send','show','params','model','keys','ChatProactiveAction','rawAttributes','query','filters','intersection','attributes','fields','length','includeAll','include','merge','options','find','catch','create','body','rimraf','zip-dir','bluebird','util','path','ejs','fs-extra','squel','jsforce','to-csv','querystring','papaparse','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','save','update'];(function(_0x5447fd,_0x52a6b5){var _0x15b28a=function(_0x370d4f){while(--_0x370d4f){_0x5447fd['push'](_0x5447fd['shift']());}};_0x15b28a(++_0x52a6b5);}(_0x4016,0x131));var _0x6401=function(_0x502c7d,_0x2f1285){_0x502c7d=_0x502c7d-0x0;var _0x30b7ed=_0x4016[_0x502c7d];return _0x30b7ed;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x6401('0x0'));var zipdir=require(_0x6401('0x1'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x6401('0x2'));var Mustache=require('mustache');var util=require(_0x6401('0x3'));var path=require(_0x6401('0x4'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x6401('0x5'));var fs=require('fs');var fs_extra=require(_0x6401('0x6'));var _=require('lodash');var squel=require(_0x6401('0x7'));var crypto=require('crypto');var jsforce=require(_0x6401('0x8'));var deskjs=require('desk.js');var toCsv=require(_0x6401('0x9'));var querystring=require(_0x6401('0xa'));var Papa=require(_0x6401('0xb'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x6401('0xc'));var as=require(_0x6401('0xd'));var hardwareService=require(_0x6401('0xe'));var logger=require('../../config/logger')(_0x6401('0xf'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0x6401('0x10'));var db=require(_0x6401('0x11'))['db'];function respondWithStatusCode(_0x26ec93,_0x45e88a){_0x45e88a=_0x45e88a||0xcc;return function(_0xf7fc5){if(_0xf7fc5){return _0x26ec93[_0x6401('0x12')](_0x45e88a);}return _0x26ec93[_0x6401('0x13')](_0x45e88a)[_0x6401('0x14')]();};}function respondWithResult(_0x381c17,_0x1f6edf){_0x1f6edf=_0x1f6edf||0xc8;return function(_0x45fcea){if(_0x45fcea){return _0x381c17[_0x6401('0x13')](_0x1f6edf)[_0x6401('0x15')](_0x45fcea);}};}function respondWithFilteredResult(_0x29fedc,_0x4c740a){return function(_0x1b510e){if(_0x1b510e){var _0x1fd3b8=typeof _0x4c740a[_0x6401('0x16')]===_0x6401('0x17')&&typeof _0x4c740a[_0x6401('0x18')]===_0x6401('0x17');var _0x4521b6=_0x1b510e['count'];var _0x55ca87=_0x1fd3b8?0x0:_0x4c740a[_0x6401('0x16')];var _0x50eda7=_0x1fd3b8?_0x1b510e[_0x6401('0x19')]:_0x4c740a[_0x6401('0x16')]+_0x4c740a[_0x6401('0x18')];var _0x3c3a6c;if(_0x50eda7>=_0x4521b6){_0x50eda7=_0x4521b6;_0x3c3a6c=0xc8;}else{_0x3c3a6c=0xce;}_0x29fedc[_0x6401('0x13')](_0x3c3a6c);return _0x29fedc[_0x6401('0x1a')](_0x6401('0x1b'),_0x55ca87+'-'+_0x50eda7+'/'+_0x4521b6)['json'](_0x1b510e);}return null;};}function patchUpdates(_0x10fd3c){return function(_0x44525b){try{jsonpatch[_0x6401('0x1c')](_0x44525b,_0x10fd3c,!![]);}catch(_0x1757ab){return BPromise['reject'](_0x1757ab);}return _0x44525b[_0x6401('0x1d')]();};}function saveUpdates(_0x343d25,_0x4ed76d){return function(_0x20b445){if(_0x20b445){return _0x20b445[_0x6401('0x1e')](_0x343d25)[_0x6401('0x1f')](function(_0xdea921){return _0xdea921;});}return null;};}function removeEntity(_0x19d6a0,_0x39bca3){return function(_0xed5d29){if(_0xed5d29){return _0xed5d29[_0x6401('0x20')]()[_0x6401('0x1f')](function(){_0x19d6a0['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x55818a,_0xee5737){return function(_0x12f19a){if(!_0x12f19a){_0x55818a[_0x6401('0x12')](0x194);}return _0x12f19a;};}function handleError(_0x4e6d9f,_0x3b1d99){_0x3b1d99=_0x3b1d99||0x1f4;return function(_0x102f69){logger[_0x6401('0x21')](_0x102f69[_0x6401('0x22')]);if(_0x102f69['name']){delete _0x102f69['name'];}_0x4e6d9f[_0x6401('0x13')](_0x3b1d99)[_0x6401('0x23')](_0x102f69);};}exports[_0x6401('0x24')]=function(_0x466a35,_0x549b8c){var _0x7f6e88={'raw':!![],'where':{'id':_0x466a35[_0x6401('0x25')]['id']}},_0x43e089={};_0x43e089[_0x6401('0x26')]=_[_0x6401('0x27')](db[_0x6401('0x28')][_0x6401('0x29')]);_0x43e089[_0x6401('0x2a')]=_['keys'](_0x466a35[_0x6401('0x2a')]);_0x43e089[_0x6401('0x2b')]=_[_0x6401('0x2c')](_0x43e089[_0x6401('0x26')],_0x43e089['query']);_0x7f6e88[_0x6401('0x2d')]=_[_0x6401('0x2c')](_0x43e089[_0x6401('0x26')],qs['fields'](_0x466a35['query'][_0x6401('0x2e')]));_0x7f6e88['attributes']=_0x7f6e88[_0x6401('0x2d')][_0x6401('0x2f')]?_0x7f6e88[_0x6401('0x2d')]:_0x43e089[_0x6401('0x26')];if(_0x466a35[_0x6401('0x2a')][_0x6401('0x30')]){_0x7f6e88[_0x6401('0x31')]=[{'all':!![]}];}_0x7f6e88=_[_0x6401('0x32')]({},_0x7f6e88,_0x466a35[_0x6401('0x33')]);return db['ChatProactiveAction'][_0x6401('0x34')](_0x7f6e88)[_0x6401('0x1f')](handleEntityNotFound(_0x549b8c,null))[_0x6401('0x1f')](respondWithResult(_0x549b8c,null))[_0x6401('0x35')](handleError(_0x549b8c,null));};exports[_0x6401('0x36')]=function(_0x556354,_0xd7a00f){return db[_0x6401('0x28')]['create'](_0x556354[_0x6401('0x37')],{})['then'](respondWithResult(_0xd7a00f,0xc9))[_0x6401('0x35')](handleError(_0xd7a00f,null));};exports[_0x6401('0x1e')]=function(_0x5317f8,_0x444339){if(_0x5317f8[_0x6401('0x37')]['id']){delete _0x5317f8[_0x6401('0x37')]['id'];}return db[_0x6401('0x28')]['find']({'where':{'id':_0x5317f8[_0x6401('0x25')]['id']}})[_0x6401('0x1f')](handleEntityNotFound(_0x444339,null))[_0x6401('0x1f')](saveUpdates(_0x5317f8['body'],null))[_0x6401('0x1f')](respondWithResult(_0x444339,null))[_0x6401('0x35')](handleError(_0x444339,null));};exports['destroy']=function(_0x79d73f,_0x337d1c){return db[_0x6401('0x28')][_0x6401('0x34')]({'where':{'id':_0x79d73f[_0x6401('0x25')]['id']}})[_0x6401('0x1f')](handleEntityNotFound(_0x337d1c,null))[_0x6401('0x1f')](removeEntity(_0x337d1c,null))[_0x6401('0x35')](handleError(_0x337d1c,null));};
\ No newline at end of file
+var _0xc090=['papaparse','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../mysqldb','status','end','json','offset','undefined','limit','count','set','apply','reject','save','then','destroy','sendStatus','error','name','send','show','params','model','rawAttributes','query','filters','intersection','attributes','fields','includeAll','include','merge','options','find','catch','body','update','ChatProactiveAction','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','to-csv','lodash','crypto','jsforce','desk.js','querystring'];(function(_0x52dfa5,_0x49ac28){var _0x49970d=function(_0x3e0e9e){while(--_0x3e0e9e){_0x52dfa5['push'](_0x52dfa5['shift']());}};_0x49970d(++_0x49ac28);}(_0xc090,0x112));var _0x0c09=function(_0x36f104,_0xfae805){_0x36f104=_0x36f104-0x0;var _0x985b3d=_0xc090[_0x36f104];return _0x985b3d;};'use strict';var emlformat=require(_0x0c09('0x0'));var rimraf=require(_0x0c09('0x1'));var zipdir=require(_0x0c09('0x2'));var jsonpatch=require(_0x0c09('0x3'));var rp=require(_0x0c09('0x4'));var moment=require(_0x0c09('0x5'));var BPromise=require(_0x0c09('0x6'));var Mustache=require(_0x0c09('0x7'));var util=require(_0x0c09('0x8'));var path=require('path');var sox=require(_0x0c09('0x9'));var csv=require(_0x0c09('0xa'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x0c09('0xb'));var squel=require('squel');var crypto=require(_0x0c09('0xc'));var jsforce=require(_0x0c09('0xd'));var deskjs=require(_0x0c09('0xe'));var toCsv=require('to-csv');var querystring=require(_0x0c09('0xf'));var Papa=require(_0x0c09('0x10'));var Redis=require('ioredis');var authService=require(_0x0c09('0x11'));var qs=require('../../components/parsers/qs');var as=require(_0x0c09('0x12'));var hardwareService=require(_0x0c09('0x13'));var logger=require(_0x0c09('0x14'))(_0x0c09('0x15'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0x0c09('0x16'))['db'];function respondWithStatusCode(_0x5d1d77,_0x59df8b){_0x59df8b=_0x59df8b||0xcc;return function(_0xbe8522){if(_0xbe8522){return _0x5d1d77['sendStatus'](_0x59df8b);}return _0x5d1d77[_0x0c09('0x17')](_0x59df8b)[_0x0c09('0x18')]();};}function respondWithResult(_0x21c45b,_0xeb18fb){_0xeb18fb=_0xeb18fb||0xc8;return function(_0x388b2e){if(_0x388b2e){return _0x21c45b[_0x0c09('0x17')](_0xeb18fb)[_0x0c09('0x19')](_0x388b2e);}};}function respondWithFilteredResult(_0x2dcdae,_0x367c86){return function(_0x264d21){if(_0x264d21){var _0x482dc1=typeof _0x367c86[_0x0c09('0x1a')]===_0x0c09('0x1b')&&typeof _0x367c86[_0x0c09('0x1c')]===_0x0c09('0x1b');var _0x20ad8a=_0x264d21[_0x0c09('0x1d')];var _0x2d610d=_0x482dc1?0x0:_0x367c86[_0x0c09('0x1a')];var _0xffc47=_0x482dc1?_0x264d21[_0x0c09('0x1d')]:_0x367c86[_0x0c09('0x1a')]+_0x367c86[_0x0c09('0x1c')];var _0x519eea;if(_0xffc47>=_0x20ad8a){_0xffc47=_0x20ad8a;_0x519eea=0xc8;}else{_0x519eea=0xce;}_0x2dcdae[_0x0c09('0x17')](_0x519eea);return _0x2dcdae[_0x0c09('0x1e')]('Content-Range',_0x2d610d+'-'+_0xffc47+'/'+_0x20ad8a)['json'](_0x264d21);}return null;};}function patchUpdates(_0x2af860){return function(_0x205962){try{jsonpatch[_0x0c09('0x1f')](_0x205962,_0x2af860,!![]);}catch(_0x48c124){return BPromise[_0x0c09('0x20')](_0x48c124);}return _0x205962[_0x0c09('0x21')]();};}function saveUpdates(_0x3206b5,_0x5488ac){return function(_0x301938){if(_0x301938){return _0x301938['update'](_0x3206b5)[_0x0c09('0x22')](function(_0x39452e){return _0x39452e;});}return null;};}function removeEntity(_0x3aaabf,_0x1dc995){return function(_0xad7cf9){if(_0xad7cf9){return _0xad7cf9[_0x0c09('0x23')]()[_0x0c09('0x22')](function(){_0x3aaabf[_0x0c09('0x17')](0xcc)['end']();});}};}function handleEntityNotFound(_0x544ac4,_0xcf0257){return function(_0x1b7731){if(!_0x1b7731){_0x544ac4[_0x0c09('0x24')](0x194);}return _0x1b7731;};}function handleError(_0x63bd83,_0x36e0c0){_0x36e0c0=_0x36e0c0||0x1f4;return function(_0x449262){logger[_0x0c09('0x25')](_0x449262['stack']);if(_0x449262['name']){delete _0x449262[_0x0c09('0x26')];}_0x63bd83[_0x0c09('0x17')](_0x36e0c0)[_0x0c09('0x27')](_0x449262);};}exports[_0x0c09('0x28')]=function(_0x2ce4e9,_0x61a907){var _0x1dee90={'raw':!![],'where':{'id':_0x2ce4e9[_0x0c09('0x29')]['id']}},_0x376742={};_0x376742[_0x0c09('0x2a')]=_['keys'](db['ChatProactiveAction'][_0x0c09('0x2b')]);_0x376742[_0x0c09('0x2c')]=_['keys'](_0x2ce4e9[_0x0c09('0x2c')]);_0x376742[_0x0c09('0x2d')]=_[_0x0c09('0x2e')](_0x376742[_0x0c09('0x2a')],_0x376742[_0x0c09('0x2c')]);_0x1dee90[_0x0c09('0x2f')]=_['intersection'](_0x376742[_0x0c09('0x2a')],qs[_0x0c09('0x30')](_0x2ce4e9[_0x0c09('0x2c')]['fields']));_0x1dee90[_0x0c09('0x2f')]=_0x1dee90['attributes']['length']?_0x1dee90['attributes']:_0x376742[_0x0c09('0x2a')];if(_0x2ce4e9[_0x0c09('0x2c')][_0x0c09('0x31')]){_0x1dee90[_0x0c09('0x32')]=[{'all':!![]}];}_0x1dee90=_[_0x0c09('0x33')]({},_0x1dee90,_0x2ce4e9[_0x0c09('0x34')]);return db['ChatProactiveAction'][_0x0c09('0x35')](_0x1dee90)[_0x0c09('0x22')](handleEntityNotFound(_0x61a907,null))['then'](respondWithResult(_0x61a907,null))[_0x0c09('0x36')](handleError(_0x61a907,null));};exports['create']=function(_0x5728f2,_0x3dde4a){return db['ChatProactiveAction']['create'](_0x5728f2[_0x0c09('0x37')],{})[_0x0c09('0x22')](respondWithResult(_0x3dde4a,0xc9))[_0x0c09('0x36')](handleError(_0x3dde4a,null));};exports[_0x0c09('0x38')]=function(_0x39cd87,_0x1b602c){if(_0x39cd87[_0x0c09('0x37')]['id']){delete _0x39cd87['body']['id'];}return db[_0x0c09('0x39')][_0x0c09('0x35')]({'where':{'id':_0x39cd87[_0x0c09('0x29')]['id']}})[_0x0c09('0x22')](handleEntityNotFound(_0x1b602c,null))[_0x0c09('0x22')](saveUpdates(_0x39cd87[_0x0c09('0x37')],null))[_0x0c09('0x22')](respondWithResult(_0x1b602c,null))[_0x0c09('0x36')](handleError(_0x1b602c,null));};exports[_0x0c09('0x23')]=function(_0x56ac67,_0x25be9c){return db[_0x0c09('0x39')][_0x0c09('0x35')]({'where':{'id':_0x56ac67[_0x0c09('0x29')]['id']}})[_0x0c09('0x22')](handleEntityNotFound(_0x25be9c,null))[_0x0c09('0x22')](removeEntity(_0x25be9c,null))[_0x0c09('0x36')](handleError(_0x25be9c,null));};
\ No newline at end of file
diff --git a/server/api/chatProactiveAction/chatProactiveAction.model.js b/server/api/chatProactiveAction/chatProactiveAction.model.js
index ff84384..2d0e571 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 _0x729a=['ChatProactiveAction','chat_proactive_actions','util','api','moment','request-promise','path','rimraf','./chatProactiveAction.attributes','exports','define'];(function(_0x2d7c70,_0x56305c){var _0x45d604=function(_0x2b6142){while(--_0x2b6142){_0x2d7c70['push'](_0x2d7c70['shift']());}};_0x45d604(++_0x56305c);}(_0x729a,0x1c5));var _0xa729=function(_0x5efe28,_0x410eb8){_0x5efe28=_0x5efe28-0x0;var _0x260c7a=_0x729a[_0x5efe28];return _0x260c7a;};'use strict';var _=require('lodash');var util=require(_0xa729('0x0'));var logger=require('../../config/logger')(_0xa729('0x1'));var moment=require(_0xa729('0x2'));var BPromise=require('bluebird');var rp=require(_0xa729('0x3'));var fs=require('fs');var path=require(_0xa729('0x4'));var rimraf=require(_0xa729('0x5'));var config=require('../../config/environment');var attributes=require(_0xa729('0x6'));module[_0xa729('0x7')]=function(_0x99c33f,_0x3ee917){return _0x99c33f[_0xa729('0x8')](_0xa729('0x9'),attributes,{'tableName':_0xa729('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x349b=['./chatProactiveAction.attributes','exports','ChatProactiveAction','lodash','api','moment','bluebird','request-promise','path','rimraf'];(function(_0x1ea2b4,_0x2235e2){var _0x3cab45=function(_0x4ce8cc){while(--_0x4ce8cc){_0x1ea2b4['push'](_0x1ea2b4['shift']());}};_0x3cab45(++_0x2235e2);}(_0x349b,0x16b));var _0xb349=function(_0x30d9be,_0x4259e5){_0x30d9be=_0x30d9be-0x0;var _0xce6de5=_0x349b[_0x30d9be];return _0xce6de5;};'use strict';var _=require(_0xb349('0x0'));var util=require('util');var logger=require('../../config/logger')(_0xb349('0x1'));var moment=require(_0xb349('0x2'));var BPromise=require(_0xb349('0x3'));var rp=require(_0xb349('0x4'));var fs=require('fs');var path=require(_0xb349('0x5'));var rimraf=require(_0xb349('0x6'));var config=require('../../config/environment');var attributes=require(_0xb349('0x7'));module[_0xb349('0x8')]=function(_0x3ac5c5,_0x199be8){return _0x3ac5c5['define'](_0xb349('0x9'),attributes,{'tableName':'chat_proactive_actions','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
diff --git a/server/api/chatProactiveAction/chatProactiveAction.rpc.js b/server/api/chatProactiveAction/chatProactiveAction.rpc.js
index 44fbf89..4fe9ee4 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 _0xb266=['../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','then','info','request\x20sent','debug','ChatProactiveAction,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','bluebird','randomstring','../../mysqldb'];(function(_0x13ab4c,_0x4c09fe){var _0x4c1e4f=function(_0x508fbc){while(--_0x508fbc){_0x13ab4c['push'](_0x13ab4c['shift']());}};_0x4c1e4f(++_0x4c09fe);}(_0xb266,0x18b));var _0x6b26=function(_0x19950b,_0x53d0d7){_0x19950b=_0x19950b-0x0;var _0x3c6b41=_0xb266[_0x19950b];return _0x3c6b41;};'use strict';var _=require(_0x6b26('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0x6b26('0x1'));var rs=require(_0x6b26('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x6b26('0x3'))['db'];var utils=require(_0x6b26('0x4'));var logger=require(_0x6b26('0x5'))(_0x6b26('0x6'));var config=require(_0x6b26('0x7'));var jayson=require(_0x6b26('0x8'));var client=jayson[_0x6b26('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x516e58,_0x19c952,_0x51a134){return new BPromise(function(_0x32509e,_0x2ba722){return client['request'](_0x516e58,_0x51a134)[_0x6b26('0xa')](function(_0x28456f){logger[_0x6b26('0xb')]('ChatProactiveAction,\x20%s,\x20%s',_0x19c952,_0x6b26('0xc'));logger[_0x6b26('0xd')](_0x6b26('0xe'),_0x19c952,_0x6b26('0xc'),JSON[_0x6b26('0xf')](_0x28456f));if(_0x28456f['error']){if(_0x28456f[_0x6b26('0x10')][_0x6b26('0x11')]===0x1f4){logger['error']('ChatProactiveAction,\x20%s,\x20%s',_0x19c952,_0x28456f[_0x6b26('0x10')]['message']);return _0x2ba722(_0x28456f[_0x6b26('0x10')][_0x6b26('0x12')]);}logger[_0x6b26('0x10')]('ChatProactiveAction,\x20%s,\x20%s',_0x19c952,_0x28456f[_0x6b26('0x10')][_0x6b26('0x12')]);return _0x32509e(_0x28456f[_0x6b26('0x10')][_0x6b26('0x12')]);}else{logger[_0x6b26('0xb')]('ChatProactiveAction,\x20%s,\x20%s',_0x19c952,_0x6b26('0xc'));_0x32509e(_0x28456f[_0x6b26('0x13')][_0x6b26('0x12')]);}})[_0x6b26('0x14')](function(_0x49061a){logger[_0x6b26('0x10')]('ChatProactiveAction,\x20%s,\x20%s',_0x19c952,_0x49061a);_0x2ba722(_0x49061a);});});}
\ No newline at end of file
+var _0xb8b2=['bluebird','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','request','then','info','ChatProactiveAction,\x20%s,\x20%s','debug','ChatProactiveAction,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','message','lodash','util','moment'];(function(_0x297f87,_0x529eec){var _0x1f33a1=function(_0x431bf1){while(--_0x431bf1){_0x297f87['push'](_0x297f87['shift']());}};_0x1f33a1(++_0x529eec);}(_0xb8b2,0x11a));var _0x2b8b=function(_0x43776a,_0x4eb74c){_0x43776a=_0x43776a-0x0;var _0x18eb8f=_0xb8b2[_0x43776a];return _0x18eb8f;};'use strict';var _=require(_0x2b8b('0x0'));var util=require(_0x2b8b('0x1'));var moment=require(_0x2b8b('0x2'));var BPromise=require(_0x2b8b('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x2b8b('0x4'));var db=require(_0x2b8b('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x2b8b('0x6'))(_0x2b8b('0x7'));var config=require(_0x2b8b('0x8'));var jayson=require('jayson/promise');var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x182dc8,_0x44fd59,_0x4e749d){return new BPromise(function(_0x807766,_0x32bcbe){return client[_0x2b8b('0x9')](_0x182dc8,_0x4e749d)[_0x2b8b('0xa')](function(_0x2bacd5){logger[_0x2b8b('0xb')](_0x2b8b('0xc'),_0x44fd59,'request\x20sent');logger[_0x2b8b('0xd')](_0x2b8b('0xe'),_0x44fd59,_0x2b8b('0xf'),JSON[_0x2b8b('0x10')](_0x2bacd5));if(_0x2bacd5['error']){if(_0x2bacd5['error']['code']===0x1f4){logger['error'](_0x2b8b('0xc'),_0x44fd59,_0x2bacd5['error']['message']);return _0x32bcbe(_0x2bacd5['error']['message']);}logger[_0x2b8b('0x11')](_0x2b8b('0xc'),_0x44fd59,_0x2bacd5[_0x2b8b('0x11')][_0x2b8b('0x12')]);return _0x807766(_0x2bacd5[_0x2b8b('0x11')]['message']);}else{logger['info']('ChatProactiveAction,\x20%s,\x20%s',_0x44fd59,_0x2b8b('0xf'));_0x807766(_0x2bacd5['result']['message']);}})['catch'](function(_0x7cbecc){logger[_0x2b8b('0x11')](_0x2b8b('0xc'),_0x44fd59,_0x7cbecc);_0x32bcbe(_0x7cbecc);});});}
\ No newline at end of file
diff --git a/server/api/chatProactiveAction/index.js b/server/api/chatProactiveAction/index.js
index dee0d3e..788c754 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 _0x55ca=['multer','util','Router','fs-extra','../../components/interaction/service','../../config/environment','./chatProactiveAction.controller','get','/:id','isAuthenticated','show','create','destroy','exports'];(function(_0x29bb31,_0x689236){var _0x22cced=function(_0x46b58c){while(--_0x46b58c){_0x29bb31['push'](_0x29bb31['shift']());}};_0x22cced(++_0x689236);}(_0x55ca,0x126));var _0xa55c=function(_0x3dc587,_0x2ebc6c){_0x3dc587=_0x3dc587-0x0;var _0x29f93a=_0x55ca[_0x3dc587];return _0x29f93a;};'use strict';var multer=require(_0xa55c('0x0'));var util=require(_0xa55c('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require('express');var router=express[_0xa55c('0x2')]();var fs_extra=require(_0xa55c('0x3'));var auth=require('../../components/auth/service');var interaction=require(_0xa55c('0x4'));var config=require(_0xa55c('0x5'));var controller=require(_0xa55c('0x6'));router[_0xa55c('0x7')](_0xa55c('0x8'),auth[_0xa55c('0x9')](),controller[_0xa55c('0xa')]);router['post']('/',auth[_0xa55c('0x9')](),controller[_0xa55c('0xb')]);router['put'](_0xa55c('0x8'),auth[_0xa55c('0x9')](),controller['update']);router['delete'](_0xa55c('0x8'),auth[_0xa55c('0x9')](),controller[_0xa55c('0xc')]);module[_0xa55c('0xd')]=router;
\ No newline at end of file
+var _0x038b=['isAuthenticated','/:id','exports','util','path','connect-timeout','Router','../../components/auth/service','../../components/interaction/service','./chatProactiveAction.controller','get','show','post'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x038b,0x114));var _0xb038=function(_0x27f865,_0x25b6c5){_0x27f865=_0x27f865-0x0;var _0x121c3c=_0x038b[_0x27f865];return _0x121c3c;};'use strict';var multer=require('multer');var util=require(_0xb038('0x0'));var path=require(_0xb038('0x1'));var timeout=require(_0xb038('0x2'));var express=require('express');var router=express[_0xb038('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0xb038('0x4'));var interaction=require(_0xb038('0x5'));var config=require('../../config/environment');var controller=require(_0xb038('0x6'));router[_0xb038('0x7')]('/:id',auth['isAuthenticated'](),controller[_0xb038('0x8')]);router[_0xb038('0x9')]('/',auth[_0xb038('0xa')](),controller['create']);router['put'](_0xb038('0xb'),auth[_0xb038('0xa')](),controller['update']);router['delete'](_0xb038('0xb'),auth[_0xb038('0xa')](),controller['destroy']);module[_0xb038('0xc')]=router;
\ No newline at end of file
diff --git a/server/api/chatQueue/chatQueue.attributes.js b/server/api/chatQueue/chatQueue.attributes.js
index 42a0ad6..33d4aa2 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 _0x3c4f=['ENUM','rrmemory','beepall','roundrobin','sequelize','exports','STRING','INTEGER'];(function(_0x2ed7b0,_0x3ef860){var _0x2f138a=function(_0x14cbb4){while(--_0x14cbb4){_0x2ed7b0['push'](_0x2ed7b0['shift']());}};_0x2f138a(++_0x3ef860);}(_0x3c4f,0x18c));var _0xf3c4=function(_0x43404c,_0x589709){_0x43404c=_0x43404c-0x0;var _0x28ce07=_0x3c4f[_0x43404c];return _0x28ce07;};'use strict';var Sequelize=require(_0xf3c4('0x0'));module[_0xf3c4('0x1')]={'name':{'type':Sequelize['STRING'],'unique':'name','allowNull':![],'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize[_0xf3c4('0x2')]},'timeout':{'type':Sequelize[_0xf3c4('0x3')],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0xf3c4('0x4')](_0xf3c4('0x5'),_0xf3c4('0x6'),_0xf3c4('0x7'))}};
\ No newline at end of file
+var _0xa9d3=['INTEGER','beepall','roundrobin','exports','STRING'];(function(_0x2adbeb,_0x5581be){var _0x5e18a6=function(_0x84e42b){while(--_0x84e42b){_0x2adbeb['push'](_0x2adbeb['shift']());}};_0x5e18a6(++_0x5581be);}(_0xa9d3,0x9e));var _0x3a9d=function(_0x154148,_0x429c05){_0x154148=_0x154148-0x0;var _0x44f5a2=_0xa9d3[_0x154148];return _0x44f5a2;};'use strict';var Sequelize=require('sequelize');module[_0x3a9d('0x0')]={'name':{'type':Sequelize[_0x3a9d('0x1')],'unique':'name','allowNull':![],'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize['STRING']},'timeout':{'type':Sequelize[_0x3a9d('0x2')],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize['ENUM']('rrmemory',_0x3a9d('0x3'),_0x3a9d('0x4'))}};
\ No newline at end of file
diff --git a/server/api/chatQueue/chatQueue.controller.js b/server/api/chatQueue/chatQueue.controller.js
index 9159fd7..de584aa 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 _0x339d=['voicePause','interface','flatMap','sequelize','transaction','addTeams','each','findOrCreate','emit','removeTeams','select','from','team_has_chat_queues','join','user_has_teams','ut.UserId\x20=\x20?','push','QueryTypes','every','includes','all','union','compact','value','removeAgents','forEach','addAgents','omit','userChatQueue:save','isArray','userChatQueue:remove','getAgents','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','localhost','socket.io-emitter','redis','./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','error','code','message','catch','sendStatus','status','end','json','count','offset','set','save','update','UserProfileResource','destroy','stack','name','send','index','map','ChatQueue','rawAttributes','fieldName','type','key','model','query','intersection','attributes','fields','length','nolimit','limit','sort','pick','filters','filter','where','merge','VIRTUAL','include','rows','show','keys','options','find','create','body','user','role','get','ChatQueues','userProfileId','autoAssociation','params','getMembers','findOne','UserChatQueue','hasOwnProperty','order','ChatQueueId','findAll','User','UserId','agent','chatPause','updatedAt','createdAt','format','%s/%s','SIP','getTeams','Team','ids','Agents','online'];(function(_0x234e45,_0xbd8fe){var _0x411856=function(_0x2da5be){while(--_0x2da5be){_0x234e45['push'](_0x234e45['shift']());}};_0x411856(++_0xbd8fe);}(_0x339d,0x14c));var _0xd339=function(_0x47fd36,_0x41535d){_0x47fd36=_0x47fd36-0x0;var _0x21a0fc=_0x339d[_0x47fd36];return _0x21a0fc;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xd339('0x0'));var zipdir=require(_0xd339('0x1'));var jsonpatch=require(_0xd339('0x2'));var rp=require(_0xd339('0x3'));var moment=require('moment');var BPromise=require(_0xd339('0x4'));var Mustache=require(_0xd339('0x5'));var util=require(_0xd339('0x6'));var path=require(_0xd339('0x7'));var sox=require(_0xd339('0x8'));var csv=require(_0xd339('0x9'));var ejs=require(_0xd339('0xa'));var fs=require('fs');var fs_extra=require(_0xd339('0xb'));var _=require(_0xd339('0xc'));var squel=require(_0xd339('0xd'));var crypto=require(_0xd339('0xe'));var jsforce=require(_0xd339('0xf'));var deskjs=require(_0xd339('0x10'));var toCsv=require(_0xd339('0x9'));var querystring=require('querystring');var Papa=require(_0xd339('0x11'));var Redis=require(_0xd339('0x12'));var authService=require(_0xd339('0x13'));var qs=require('../../components/parsers/qs');var as=require(_0xd339('0x14'));var hardwareService=require(_0xd339('0x15'));var logger=require(_0xd339('0x16'))(_0xd339('0x17'));var utils=require(_0xd339('0x18'));var config=require(_0xd339('0x19'));var licenseUtil=require('../../config/license/util');var db=require(_0xd339('0x1a'))['db'];config['redis']=_['defaults'](config['redis'],{'host':_0xd339('0x1b'),'port':0x18eb});var socket=require(_0xd339('0x1c'))(new Redis(config[_0xd339('0x1d')]));require(_0xd339('0x1e'))[_0xd339('0x1f')](socket);var jayson=require(_0xd339('0x20'));var client=jayson[_0xd339('0x21')][_0xd339('0x22')]({'port':0x232a});function respondWithRpcPromise(_0x242c05,_0x2f86e5,_0x11292d,_0x50e4ad){return new BPromise(function(_0x1a222e,_0x5ab49f){var _0x6031c1=_0x50e4ad||client;return _0x6031c1[_0xd339('0x23')](_0x242c05,_0x11292d)[_0xd339('0x24')](function(_0x5ded79){logger[_0xd339('0x25')](_0xd339('0x26'),_0x2f86e5,_0xd339('0x27'));logger[_0xd339('0x28')](_0xd339('0x29'),_0x2f86e5,'request\x20sent',JSON['stringify'](_0x5ded79));if(_0x5ded79[_0xd339('0x2a')]){if(_0x5ded79[_0xd339('0x2a')][_0xd339('0x2b')]===0x1f4){logger['error'](_0xd339('0x26'),_0x2f86e5,_0x5ded79[_0xd339('0x2a')]['message']);return _0x5ab49f(_0x5ded79[_0xd339('0x2a')]['message']);}logger[_0xd339('0x2a')]('ChatQueue,\x20%s,\x20%s',_0x2f86e5,_0x5ded79[_0xd339('0x2a')][_0xd339('0x2c')]);return _0x1a222e(_0x5ded79[_0xd339('0x2a')]['message']);}else{logger[_0xd339('0x25')](_0xd339('0x26'),_0x2f86e5,_0xd339('0x27'));_0x1a222e(_0x5ded79['result'][_0xd339('0x2c')]);}})[_0xd339('0x2d')](function(_0x2585ba){logger['error'](_0xd339('0x26'),_0x2f86e5,_0x2585ba);_0x5ab49f(_0x2585ba);});});}function respondWithStatusCode(_0x5bb781,_0x565442){_0x565442=_0x565442||0xcc;return function(_0x55109a){if(_0x55109a){return _0x5bb781[_0xd339('0x2e')](_0x565442);}return _0x5bb781[_0xd339('0x2f')](_0x565442)[_0xd339('0x30')]();};}function respondWithResult(_0x2d7b26,_0x438ec8){_0x438ec8=_0x438ec8||0xc8;return function(_0xd58b22){if(_0xd58b22){return _0x2d7b26[_0xd339('0x2f')](_0x438ec8)[_0xd339('0x31')](_0xd58b22);}};}function respondWithFilteredResult(_0x30c701,_0xc070b7){return function(_0x3a6d8b){if(_0x3a6d8b){var _0x9c6198=typeof _0xc070b7['offset']==='undefined'&&typeof _0xc070b7['limit']==='undefined';var _0x329833=_0x3a6d8b[_0xd339('0x32')];var _0x59524d=_0x9c6198?0x0:_0xc070b7[_0xd339('0x33')];var _0x122263=_0x9c6198?_0x3a6d8b[_0xd339('0x32')]:_0xc070b7[_0xd339('0x33')]+_0xc070b7['limit'];var _0x58ee90;if(_0x122263>=_0x329833){_0x122263=_0x329833;_0x58ee90=0xc8;}else{_0x58ee90=0xce;}_0x30c701[_0xd339('0x2f')](_0x58ee90);return _0x30c701[_0xd339('0x34')]('Content-Range',_0x59524d+'-'+_0x122263+'/'+_0x329833)[_0xd339('0x31')](_0x3a6d8b);}return null;};}function patchUpdates(_0x2b2a29){return function(_0x5cb3e2){try{jsonpatch['apply'](_0x5cb3e2,_0x2b2a29,!![]);}catch(_0x59b137){return BPromise['reject'](_0x59b137);}return _0x5cb3e2[_0xd339('0x35')]();};}function saveUpdates(_0x4c2ba6,_0x2de9c6){return function(_0x1595b4){if(_0x1595b4){return _0x1595b4[_0xd339('0x36')](_0x4c2ba6)['then'](function(_0x56e65c){return _0x56e65c;});}return null;};}function removeEntity(_0x4f34d4,_0x4cc9c2){return function(_0x2a0e3c){if(_0x2a0e3c){return _0x2a0e3c['destroy']()[_0xd339('0x24')](function(){var _0x38cdee=_0x2a0e3c['get']({'plain':!![]});var _0x3a9a5d='ChatQueues';return db[_0xd339('0x37')][_0xd339('0x38')]({'where':{'type':_0x3a9a5d,'resourceId':_0x38cdee['id']}})['then'](function(){return _0x2a0e3c;});})[_0xd339('0x24')](function(){_0x4f34d4[_0xd339('0x2f')](0xcc)[_0xd339('0x30')]();});}};}function handleEntityNotFound(_0xc151ac,_0x48fb47){return function(_0x27a985){if(!_0x27a985){_0xc151ac[_0xd339('0x2e')](0x194);}return _0x27a985;};}function handleError(_0x200924,_0x1472c7){_0x1472c7=_0x1472c7||0x1f4;return function(_0x3a31b6){logger[_0xd339('0x2a')](_0x3a31b6[_0xd339('0x39')]);if(_0x3a31b6['name']){delete _0x3a31b6[_0xd339('0x3a')];}_0x200924[_0xd339('0x2f')](_0x1472c7)[_0xd339('0x3b')](_0x3a31b6);};}exports[_0xd339('0x3c')]=function(_0x35b7d1,_0x2d9b9a){var _0x5590f8={},_0xa879a0={},_0x3decb9={'count':0x0,'rows':[]};var _0x1da689=_[_0xd339('0x3d')](db[_0xd339('0x3e')][_0xd339('0x3f')],function(_0x3da856){return{'name':_0x3da856[_0xd339('0x40')],'type':_0x3da856[_0xd339('0x41')][_0xd339('0x42')]};});_0xa879a0[_0xd339('0x43')]=_[_0xd339('0x3d')](_0x1da689,_0xd339('0x3a'));_0xa879a0[_0xd339('0x44')]=_['keys'](_0x35b7d1['query']);_0xa879a0['filters']=_[_0xd339('0x45')](_0xa879a0[_0xd339('0x43')],_0xa879a0['query']);_0x5590f8[_0xd339('0x46')]=_['intersection'](_0xa879a0[_0xd339('0x43')],qs[_0xd339('0x47')](_0x35b7d1[_0xd339('0x44')][_0xd339('0x47')]));_0x5590f8[_0xd339('0x46')]=_0x5590f8['attributes'][_0xd339('0x48')]?_0x5590f8[_0xd339('0x46')]:_0xa879a0[_0xd339('0x43')];if(!_0x35b7d1['query']['hasOwnProperty'](_0xd339('0x49'))){_0x5590f8[_0xd339('0x4a')]=qs[_0xd339('0x4a')](_0x35b7d1[_0xd339('0x44')]['limit']);_0x5590f8['offset']=qs[_0xd339('0x33')](_0x35b7d1['query']['offset']);}_0x5590f8['order']=qs[_0xd339('0x4b')](_0x35b7d1[_0xd339('0x44')][_0xd339('0x4b')]);_0x5590f8['where']=qs['filters'](_[_0xd339('0x4c')](_0x35b7d1['query'],_0xa879a0[_0xd339('0x4d')]),_0x1da689);if(_0x35b7d1[_0xd339('0x44')][_0xd339('0x4e')]){_0x5590f8[_0xd339('0x4f')]=_[_0xd339('0x50')](_0x5590f8[_0xd339('0x4f')],{'$or':_[_0xd339('0x3d')](_0x1da689,function(_0x1bd133){if(_0x1bd133[_0xd339('0x41')]!==_0xd339('0x51')){var _0x46e21b={};_0x46e21b[_0x1bd133[_0xd339('0x3a')]]={'$like':'%'+_0x35b7d1['query'][_0xd339('0x4e')]+'%'};return _0x46e21b;}})});}_0x5590f8=_['merge']({},_0x5590f8,_0x35b7d1['options']);var _0x501da4={'where':_0x5590f8[_0xd339('0x4f')]};return db[_0xd339('0x3e')][_0xd339('0x32')](_0x501da4)[_0xd339('0x24')](function(_0x39dcda){_0x3decb9[_0xd339('0x32')]=_0x39dcda;if(_0x35b7d1[_0xd339('0x44')]['includeAll']){_0x5590f8[_0xd339('0x52')]=[{'all':!![]}];}return db[_0xd339('0x3e')]['findAll'](_0x5590f8);})['then'](function(_0x32690a){_0x3decb9[_0xd339('0x53')]=_0x32690a;return _0x3decb9;})[_0xd339('0x24')](respondWithFilteredResult(_0x2d9b9a,_0x5590f8))[_0xd339('0x2d')](handleError(_0x2d9b9a,null));};exports[_0xd339('0x54')]=function(_0x360716,_0x4ff5b8){var _0x211eba={'raw':!![],'where':{'id':_0x360716['params']['id']}},_0x4691f6={};_0x4691f6[_0xd339('0x43')]=_[_0xd339('0x55')](db[_0xd339('0x3e')]['rawAttributes']);_0x4691f6[_0xd339('0x44')]=_[_0xd339('0x55')](_0x360716['query']);_0x4691f6[_0xd339('0x4d')]=_[_0xd339('0x45')](_0x4691f6[_0xd339('0x43')],_0x4691f6[_0xd339('0x44')]);_0x211eba[_0xd339('0x46')]=_[_0xd339('0x45')](_0x4691f6[_0xd339('0x43')],qs['fields'](_0x360716[_0xd339('0x44')]['fields']));_0x211eba[_0xd339('0x46')]=_0x211eba[_0xd339('0x46')]['length']?_0x211eba['attributes']:_0x4691f6['model'];if(_0x360716['query']['includeAll']){_0x211eba[_0xd339('0x52')]=[{'all':!![]}];}_0x211eba=_['merge']({},_0x211eba,_0x360716[_0xd339('0x56')]);return db[_0xd339('0x3e')][_0xd339('0x57')](_0x211eba)[_0xd339('0x24')](handleEntityNotFound(_0x4ff5b8,null))[_0xd339('0x24')](respondWithResult(_0x4ff5b8,null))[_0xd339('0x2d')](handleError(_0x4ff5b8,null));};exports[_0xd339('0x58')]=function(_0xecb299,_0x5864c2){return db['ChatQueue']['create'](_0xecb299[_0xd339('0x59')],{})['then'](function(_0x44f694){var _0x26ba04=_0xecb299[_0xd339('0x5a')]['get']({'plain':!![]});if(!_0x26ba04)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x26ba04[_0xd339('0x5b')]==='user'){var _0x5e3302=_0x44f694[_0xd339('0x5c')]({'plain':!![]});var _0x4ff9fa=_0xd339('0x5d');return db['UserProfileSection'][_0xd339('0x57')]({'where':{'name':_0x4ff9fa,'userProfileId':_0x26ba04[_0xd339('0x5e')]},'raw':!![]})[_0xd339('0x24')](function(_0x29ee84){if(_0x29ee84&&_0x29ee84[_0xd339('0x5f')]===0x0){return db[_0xd339('0x37')][_0xd339('0x58')]({'name':_0x5e3302[_0xd339('0x3a')],'resourceId':_0x5e3302['id'],'type':_0x29ee84[_0xd339('0x3a')],'sectionId':_0x29ee84['id']},{})[_0xd339('0x24')](function(){return _0x44f694;});}else{return _0x44f694;}})[_0xd339('0x2d')](function(_0x53e76a){logger[_0xd339('0x2a')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x53e76a);throw _0x53e76a;});}return _0x44f694;})[_0xd339('0x24')](respondWithResult(_0x5864c2,0xc9))[_0xd339('0x2d')](handleError(_0x5864c2,null));};exports[_0xd339('0x36')]=function(_0x47a37d,_0x226e03){if(_0x47a37d[_0xd339('0x59')]['id']){delete _0x47a37d['body']['id'];}return db[_0xd339('0x3e')][_0xd339('0x57')]({'where':{'id':_0x47a37d[_0xd339('0x60')]['id']}})[_0xd339('0x24')](handleEntityNotFound(_0x226e03,null))[_0xd339('0x24')](saveUpdates(_0x47a37d['body'],null))[_0xd339('0x24')](respondWithResult(_0x226e03,null))['catch'](handleError(_0x226e03,null));};exports[_0xd339('0x38')]=function(_0x49e69c,_0xb9c93a){return db[_0xd339('0x3e')][_0xd339('0x57')]({'where':{'id':_0x49e69c['params']['id']}})[_0xd339('0x24')](handleEntityNotFound(_0xb9c93a,null))['then'](removeEntity(_0xb9c93a,null))[_0xd339('0x2d')](handleError(_0xb9c93a,null));};exports['describe']=function(_0x3b0480,_0x22de48){return db[_0xd339('0x3e')]['describe']()[_0xd339('0x24')](respondWithResult(_0x22de48,null))[_0xd339('0x2d')](handleError(_0x22de48,null));};exports[_0xd339('0x61')]=function(_0x5ca8dc,_0x174916,_0x49fa3a){var _0x722aea={'raw':!![],'where':{}},_0x2d0965={},_0x911510;return db[_0xd339('0x3e')][_0xd339('0x62')]({'where':{'id':_0x5ca8dc['params']['id']}})[_0xd339('0x24')](handleEntityNotFound(_0x174916,null))['then'](function(_0x3e90f7){if(_0x3e90f7){_0x911510=_0x3e90f7[_0xd339('0x5c')]({'plain':!![]});_0x2d0965['model']=_[_0xd339('0x55')](db[_0xd339('0x63')][_0xd339('0x3f')]);_0x2d0965[_0xd339('0x44')]=_[_0xd339('0x55')](_0x5ca8dc[_0xd339('0x44')]);_0x2d0965[_0xd339('0x4d')]=_[_0xd339('0x45')](_0x2d0965[_0xd339('0x43')],_0x2d0965['query']);_0x722aea[_0xd339('0x46')]=_['intersection'](_0x2d0965[_0xd339('0x43')],qs[_0xd339('0x47')](_0x5ca8dc[_0xd339('0x44')][_0xd339('0x47')]));_0x722aea[_0xd339('0x46')]=_0x722aea[_0xd339('0x46')][_0xd339('0x48')]?_0x722aea[_0xd339('0x46')]:_0x2d0965['model'];if(!_0x5ca8dc[_0xd339('0x44')][_0xd339('0x64')](_0xd339('0x49'))){_0x722aea[_0xd339('0x4a')]=qs['limit'](_0x5ca8dc[_0xd339('0x44')][_0xd339('0x4a')]);_0x722aea[_0xd339('0x33')]=qs[_0xd339('0x33')](_0x5ca8dc['query'][_0xd339('0x33')]);}_0x722aea[_0xd339('0x65')]=qs[_0xd339('0x4b')](_0x5ca8dc[_0xd339('0x44')]['sort']);_0x722aea[_0xd339('0x4f')]=qs[_0xd339('0x4d')](_[_0xd339('0x4c')](_0x5ca8dc['query'],_0x2d0965[_0xd339('0x4d')]));_0x722aea['where'][_0xd339('0x66')]=_0x3e90f7['id'];if(_0x5ca8dc['query'][_0xd339('0x4e')]){_0x722aea[_0xd339('0x4f')]=_['merge'](_0x722aea['where'],{'$or':_[_0xd339('0x3d')](_0x722aea['attributes'],function(_0x5a6a2d){var _0x384c43={};_0x384c43[_0x5a6a2d]={'$like':'%'+_0x5ca8dc[_0xd339('0x44')]['filter']+'%'};return _0x384c43;})});}_0x722aea=_[_0xd339('0x50')]({},_0x722aea,_0x5ca8dc['options']);return db[_0xd339('0x63')][_0xd339('0x67')](_0x722aea);}})[_0xd339('0x24')](function(_0x2440c8){if(_0x2440c8){return db[_0xd339('0x68')]['findAndCountAll']({'where':{'id':_[_0xd339('0x3d')](_0x2440c8,_0xd339('0x69')),'role':_0xd339('0x6a')},'attributes':['id',_0xd339('0x3a'),_0xd339('0x6b'),_0xd339('0x6c'),_0xd339('0x6d')]});}})[_0xd339('0x24')](function(_0x53d2a0){if(_0x53d2a0){return{'count':_0x53d2a0[_0xd339('0x32')],'rows':_[_0xd339('0x3d')](_0x53d2a0[_0xd339('0x53')],function(_0x49791f){return{'membername':_0x49791f['name'],'UserId':_0x49791f['id'],'queue_name':_0x911510['name'],'ChatQueueId':_0x911510['id'],'interface':util[_0xd339('0x6e')](_0xd339('0x6f'),_0xd339('0x70'),_0x49791f['name']),'penalty':0x0,'paused':_0x49791f[_0xd339('0x6b')],'createdAt':_0x49791f[_0xd339('0x6d')],'updatedAt':_0x49791f[_0xd339('0x6c')]};})};}else{return{'count':0x0,'rows':[]};}})['then'](respondWithFilteredResult(_0x174916,_0x722aea))[_0xd339('0x2d')](handleError(_0x174916,null));};exports[_0xd339('0x71')]=function(_0x1da7b2,_0x17e1a0,_0x543197){var _0x30ed28={};var _0x5754b1={};var _0x480738;var _0x399064;return db[_0xd339('0x3e')][_0xd339('0x62')]({'where':{'id':_0x1da7b2[_0xd339('0x60')]['id']}})[_0xd339('0x24')](handleEntityNotFound(_0x17e1a0,null))['then'](function(_0x3791b1){if(_0x3791b1){_0x480738=_0x3791b1;_0x5754b1[_0xd339('0x43')]=_['keys'](db[_0xd339('0x72')]['rawAttributes']);_0x5754b1[_0xd339('0x44')]=_['keys'](_0x1da7b2[_0xd339('0x44')]);_0x5754b1[_0xd339('0x4d')]=_[_0xd339('0x45')](_0x5754b1['model'],_0x5754b1[_0xd339('0x44')]);_0x30ed28[_0xd339('0x46')]=_[_0xd339('0x45')](_0x5754b1[_0xd339('0x43')],qs['fields'](_0x1da7b2[_0xd339('0x44')][_0xd339('0x47')]));_0x30ed28[_0xd339('0x46')]=_0x30ed28[_0xd339('0x46')]['length']?_0x30ed28[_0xd339('0x46')]:_0x5754b1[_0xd339('0x43')];_0x30ed28['order']=qs[_0xd339('0x4b')](_0x1da7b2[_0xd339('0x44')][_0xd339('0x4b')]);_0x30ed28[_0xd339('0x4f')]=qs[_0xd339('0x4d')](_[_0xd339('0x4c')](_0x1da7b2[_0xd339('0x44')],_0x5754b1[_0xd339('0x4d')]));if(_0x1da7b2[_0xd339('0x44')][_0xd339('0x4e')]){_0x30ed28[_0xd339('0x4f')]=_['merge'](_0x30ed28[_0xd339('0x4f')],{'$or':_[_0xd339('0x3d')](_0x30ed28[_0xd339('0x46')],function(_0x327b2f){var _0x457cc1={};_0x457cc1[_0x327b2f]={'$like':'%'+_0x1da7b2[_0xd339('0x44')][_0xd339('0x4e')]+'%'};return _0x457cc1;})});}_0x30ed28=_['merge']({},_0x30ed28,_0x1da7b2[_0xd339('0x56')]);return _0x480738[_0xd339('0x71')](_0x30ed28);}})[_0xd339('0x24')](function(_0x2ea8d5){if(_0x2ea8d5){_0x399064=_0x2ea8d5['length'];if(!_0x1da7b2[_0xd339('0x44')][_0xd339('0x64')](_0xd339('0x49'))){_0x30ed28[_0xd339('0x4a')]=qs[_0xd339('0x4a')](_0x1da7b2['query'][_0xd339('0x4a')]);_0x30ed28[_0xd339('0x33')]=qs[_0xd339('0x33')](_0x1da7b2[_0xd339('0x44')][_0xd339('0x33')]);}return _0x480738[_0xd339('0x71')](_0x30ed28);}})[_0xd339('0x24')](function(_0xa5f632){if(_0xa5f632){return _0xa5f632?{'count':_0x399064,'rows':_0xa5f632}:null;}})[_0xd339('0x24')](respondWithResult(_0x17e1a0,null))[_0xd339('0x2d')](handleError(_0x17e1a0,null));};exports['addTeams']=function(_0x26ec34,_0x540b15,_0x4fb112){var _0x654f0b=_0x26ec34[_0xd339('0x59')][_0xd339('0x73')];return db[_0xd339('0x72')][_0xd339('0x67')]({'where':{'id':_0x654f0b},'attributes':['id'],'include':[{'model':db[_0xd339('0x68')],'as':_0xd339('0x74'),'attributes':['id',_0xd339('0x3a'),_0xd339('0x75'),_0xd339('0x76'),_0xd339('0x77')],'raw':!![]}]})['then'](function(_0x3ddcaf){if(_0x3ddcaf){var _0x49ce21=_[_0xd339('0x78')](_0x3ddcaf,function(_0x53e284){var _0x54075a=_0x53e284[_0xd339('0x5c')]({'plain':!![]});return _0x54075a[_0xd339('0x74')];});return db[_0xd339('0x3e')]['find']({'where':{'id':_0x26ec34['params']['id']}})[_0xd339('0x24')](function(_0x309dda){return db[_0xd339('0x79')][_0xd339('0x7a')](function(_0x228bd1){return _0x309dda[_0xd339('0x7b')](_0x654f0b,{'transaction':_0x228bd1})[_0xd339('0x24')](function(){return BPromise[_0xd339('0x7c')](_0x49ce21,function(_0x4a5f8e){return db['UserChatQueue'][_0xd339('0x7d')]({'where':{'UserId':_0x4a5f8e['id'],'ChatQueueId':_0x26ec34['params']['id']},'transaction':_0x228bd1});});})['then'](function(){_0x49ce21['forEach'](function(_0x310550){socket[_0xd339('0x7e')]('userChatQueue:save',{'UserId':_0x310550['id'],'ChatQueueId':_0x309dda['id']});});});});});}})[_0xd339('0x24')](respondWithStatusCode(_0x540b15,null))[_0xd339('0x2d')](handleError(_0x540b15,null));};exports[_0xd339('0x7f')]=function(_0x280bce,_0x12a0d6,_0x3c4798){return db[_0xd339('0x72')][_0xd339('0x67')]({'where':{'id':_0x280bce['query']['ids']},'attributes':['id'],'include':[{'model':db['User'],'as':'Agents','attributes':['id'],'raw':!![]}]})[_0xd339('0x24')](handleEntityNotFound(_0x12a0d6,null))[_0xd339('0x24')](function(_0x34c4e1){var _0x5766b6=_[_0xd339('0x3d')](_0x34c4e1,'id');var _0x25b950=[];var _0x298403=[];var _0x218aea=squel[_0xd339('0x80')]();_0x218aea['field']('tq.TeamId')[_0xd339('0x81')](_0xd339('0x82'),'tq')[_0xd339('0x83')](_0xd339('0x84'),'ut','ut.TeamId\x20=\x20tq.TeamId')['where']('ChatQueueId\x20=\x20?',_0x280bce['params']['id']);for(var _0x34a4d3=0x0;_0x34a4d3<_0x34c4e1[_0xd339('0x48')];_0x34a4d3+=0x1){let _0x14f2f5=_0x34c4e1[_0x34a4d3];for(var _0xc60975=0x0;_0xc60975<_0x14f2f5[_0xd339('0x74')][_0xd339('0x48')];_0xc60975+=0x1){let _0x4525d1=_0x14f2f5[_0xd339('0x74')][_0xc60975];var _0x511741=_0x218aea['clone']();_0x511741[_0xd339('0x4f')](_0xd339('0x85'),_0x4525d1['id']);_0x298403[_0xd339('0x86')](db[_0xd339('0x79')][_0xd339('0x44')](_0x511741['toString'](),{'type':db[_0xd339('0x79')][_0xd339('0x87')]['SELECT']})[_0xd339('0x24')](function(_0x4e40d3){if(_0x4e40d3[_0xd339('0x48')]===0x1){return _0x4525d1['id'];}else{var _0x3287c8=_[_0xd339('0x88')](_['map'](_0x4e40d3,'TeamId'),function(_0x2af64e){return _[_0xd339('0x89')](_0x5766b6,_0x2af64e);});if(_0x3287c8){return _0x4525d1['id'];}}}));}}return BPromise[_0xd339('0x8a')](_0x298403)[_0xd339('0x24')](function(_0x233d81){_0x25b950=_(_0x25b950)[_0xd339('0x8b')](_0x233d81)[_0xd339('0x8c')]()[_0xd339('0x8d')]();return db[_0xd339('0x3e')][_0xd339('0x57')]({'where':{'id':_0x280bce['params']['id']}})[_0xd339('0x24')](function(_0x3947d1){return db['sequelize'][_0xd339('0x7a')](function(_0x240be8){return _0x3947d1[_0xd339('0x7f')](_0x280bce[_0xd339('0x44')]['ids'],{'transaction':_0x240be8})[_0xd339('0x24')](function(){if(!_['isEmpty'](_0x25b950)){return _0x3947d1[_0xd339('0x8e')](_0x25b950,{'transaction':_0x240be8});}})['then'](function(){_0x25b950[_0xd339('0x8f')](function(_0x4e7d7d){socket[_0xd339('0x7e')]('userChatQueue:remove',{'UserId':_0x4e7d7d,'ChatQueueId':_0x3947d1['id']});});});});});});})[_0xd339('0x24')](respondWithStatusCode(_0x12a0d6,null))[_0xd339('0x2d')](handleError(_0x12a0d6,null));};exports['addAgents']=function(_0xa926c2,_0x133a65,_0x414ba0){return db[_0xd339('0x3e')][_0xd339('0x57')]({'where':{'id':_0xa926c2[_0xd339('0x60')]['id']}})[_0xd339('0x24')](handleEntityNotFound(_0x133a65,null))[_0xd339('0x24')](function(_0x43940c){if(_0x43940c){return _0x43940c[_0xd339('0x90')](_0xa926c2[_0xd339('0x59')][_0xd339('0x73')],_[_0xd339('0x91')](_0xa926c2['body'],[_0xd339('0x73'),'id'])||{})['spread'](function(_0x54ab3a){for(var _0x279872=0x0;_0x279872<_0xa926c2['body'][_0xd339('0x73')][_0xd339('0x48')];_0x279872+=0x1){socket[_0xd339('0x7e')](_0xd339('0x92'),{'UserId':Number(_0xa926c2['body'][_0xd339('0x73')][_0x279872]),'ChatQueueId':Number(_0xa926c2['params']['id'])});}return _0x54ab3a;});}})[_0xd339('0x24')](respondWithResult(_0x133a65,null))[_0xd339('0x2d')](handleError(_0x133a65,null));};exports[_0xd339('0x8e')]=function(_0x47c6f1,_0x561d4b,_0x220927){return db[_0xd339('0x3e')]['find']({'where':{'id':_0x47c6f1[_0xd339('0x60')]['id']}})[_0xd339('0x24')](handleEntityNotFound(_0x561d4b,null))[_0xd339('0x24')](function(_0x5de296){if(_0x5de296){return _0x5de296['removeAgents'](_0x47c6f1[_0xd339('0x44')][_0xd339('0x73')])[_0xd339('0x24')](function(){if(_[_0xd339('0x93')](_0x47c6f1[_0xd339('0x44')][_0xd339('0x73')])){for(var _0x4e4a67=0x0;_0x4e4a67<_0x47c6f1['query']['ids'][_0xd339('0x48')];_0x4e4a67+=0x1){socket['emit'](_0xd339('0x94'),{'UserId':Number(_0x47c6f1[_0xd339('0x44')][_0xd339('0x73')][_0x4e4a67]),'ChatQueueId':Number(_0x47c6f1[_0xd339('0x60')]['id'])});}}else{socket['emit'](_0xd339('0x94'),{'UserId':Number(_0x47c6f1[_0xd339('0x44')][_0xd339('0x73')]),'ChatQueueId':Number(_0x47c6f1[_0xd339('0x60')]['id'])});}});}})[_0xd339('0x24')](respondWithStatusCode(_0x561d4b,null))['catch'](handleError(_0x561d4b,null));};exports[_0xd339('0x95')]=function(_0x267149,_0x421ee6,_0x579f10){var _0x184c42={};var _0xc1dd0a={};var _0x156f57;var _0x1ef422;return db[_0xd339('0x3e')]['findOne']({'where':{'id':_0x267149[_0xd339('0x60')]['id']}})[_0xd339('0x24')](handleEntityNotFound(_0x421ee6,null))[_0xd339('0x24')](function(_0x321f0b){if(_0x321f0b){_0x156f57=_0x321f0b;_0xc1dd0a['model']=_[_0xd339('0x55')](db['User'][_0xd339('0x3f')]);_0xc1dd0a['query']=_[_0xd339('0x55')](_0x267149[_0xd339('0x44')]);_0xc1dd0a['filters']=_['intersection'](_0xc1dd0a['model'],_0xc1dd0a[_0xd339('0x44')]);_0x184c42[_0xd339('0x46')]=_['intersection'](_0xc1dd0a['model'],qs[_0xd339('0x47')](_0x267149[_0xd339('0x44')]['fields']));_0x184c42[_0xd339('0x46')]=_0x184c42[_0xd339('0x46')][_0xd339('0x48')]?_0x184c42['attributes']:_0xc1dd0a[_0xd339('0x43')];_0x184c42[_0xd339('0x65')]=qs['sort'](_0x267149[_0xd339('0x44')][_0xd339('0x4b')]);_0x184c42[_0xd339('0x4f')]=qs[_0xd339('0x4d')](_[_0xd339('0x4c')](_0x267149[_0xd339('0x44')],_0xc1dd0a[_0xd339('0x4d')]));if(_0x267149[_0xd339('0x44')][_0xd339('0x4e')]){_0x184c42[_0xd339('0x4f')]=_[_0xd339('0x50')](_0x184c42[_0xd339('0x4f')],{'$or':_[_0xd339('0x3d')](_0x184c42[_0xd339('0x46')],function(_0x5f49d6){var _0x35f8ea={};_0x35f8ea[_0x5f49d6]={'$like':'%'+_0x267149[_0xd339('0x44')]['filter']+'%'};return _0x35f8ea;})});}_0x184c42=_['merge']({},_0x184c42,_0x267149[_0xd339('0x56')]);return _0x156f57['getAgents'](_0x184c42);}})['then'](function(_0x955771){if(_0x955771){_0x1ef422=_0x955771[_0xd339('0x48')];if(!_0x267149[_0xd339('0x44')][_0xd339('0x64')](_0xd339('0x49'))){_0x184c42[_0xd339('0x4a')]=qs[_0xd339('0x4a')](_0x267149[_0xd339('0x44')][_0xd339('0x4a')]);_0x184c42['offset']=qs[_0xd339('0x33')](_0x267149[_0xd339('0x44')]['offset']);}return _0x156f57[_0xd339('0x95')](_0x184c42);}})[_0xd339('0x24')](function(_0x2a14e0){if(_0x2a14e0){return _0x2a14e0?{'count':_0x1ef422,'rows':_0x2a14e0}:null;}})['then'](respondWithResult(_0x421ee6,null))[_0xd339('0x2d')](handleError(_0x421ee6,null));};
\ No newline at end of file
+var _0xcdc4=['field','tq.TeamId','from','team_has_chat_queues','join','user_has_teams','ChatQueueId\x20=\x20?','Agents','clone','ut.UserId\x20=\x20?','push','toString','QueryTypes','SELECT','TeamId','includes','all','union','compact','value','isEmpty','removeAgents','emit','userChatQueue:remove','addAgents','omit','spread','getAgents','pick','eml-format','rimraf','request-promise','moment','mustache','util','path','sox','to-csv','lodash','squel','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/environment','../../config/license/util','../../mysqldb','redis','localhost','socket.io-emitter','register','jayson/promise','http','request','then','info','request\x20sent','debug','ChatQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','ChatQueue,\x20%s,\x20%s','message','result','status','end','json','offset','undefined','count','limit','set','Content-Range','apply','reject','save','update','destroy','ChatQueues','sendStatus','stack','name','index','map','ChatQueue','type','key','model','query','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','where','filter','merge','VIRTUAL','options','include','findAll','rows','catch','show','params','keys','rawAttributes','includeAll','create','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','find','userProfileId','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','describe','getMembers','UserChatQueue','length','ChatQueueId','findAndCountAll','updatedAt','createdAt','format','%s/%s','SIP','getTeams','findOne','Team','User','online','voicePause','interface','flatMap','sequelize','transaction','addTeams','forEach','userChatQueue:save','removeTeams','ids'];(function(_0x4f203d,_0x485658){var _0x512282=function(_0x409d79){while(--_0x409d79){_0x4f203d['push'](_0x4f203d['shift']());}};_0x512282(++_0x485658);}(_0xcdc4,0x151));var _0x4cdc=function(_0x18313b,_0x5c914f){_0x18313b=_0x18313b-0x0;var _0x2ba97d=_0xcdc4[_0x18313b];return _0x2ba97d;};'use strict';var emlformat=require(_0x4cdc('0x0'));var rimraf=require(_0x4cdc('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x4cdc('0x2'));var moment=require(_0x4cdc('0x3'));var BPromise=require('bluebird');var Mustache=require(_0x4cdc('0x4'));var util=require(_0x4cdc('0x5'));var path=require(_0x4cdc('0x6'));var sox=require(_0x4cdc('0x7'));var csv=require(_0x4cdc('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x4cdc('0x9'));var squel=require(_0x4cdc('0xa'));var crypto=require('crypto');var jsforce=require(_0x4cdc('0xb'));var deskjs=require(_0x4cdc('0xc'));var toCsv=require(_0x4cdc('0x8'));var querystring=require('querystring');var Papa=require(_0x4cdc('0xd'));var Redis=require(_0x4cdc('0xe'));var authService=require(_0x4cdc('0xf'));var qs=require('../../components/parsers/qs');var as=require(_0x4cdc('0x10'));var hardwareService=require(_0x4cdc('0x11'));var logger=require(_0x4cdc('0x12'))('api');var utils=require('../../config/utils');var config=require(_0x4cdc('0x13'));var licenseUtil=require(_0x4cdc('0x14'));var db=require(_0x4cdc('0x15'))['db'];config['redis']=_['defaults'](config[_0x4cdc('0x16')],{'host':_0x4cdc('0x17'),'port':0x18eb});var socket=require(_0x4cdc('0x18'))(new Redis(config[_0x4cdc('0x16')]));require('./chatQueue.socket')[_0x4cdc('0x19')](socket);var jayson=require(_0x4cdc('0x1a'));var client=jayson['client'][_0x4cdc('0x1b')]({'port':0x232a});function respondWithRpcPromise(_0x4b2c67,_0xfd77c2,_0x3b4758,_0x1dc43d){return new BPromise(function(_0x5608b0,_0x394bd2){var _0x5a860d=_0x1dc43d||client;return _0x5a860d[_0x4cdc('0x1c')](_0x4b2c67,_0x3b4758)[_0x4cdc('0x1d')](function(_0x4d7ad0){logger[_0x4cdc('0x1e')]('ChatQueue,\x20%s,\x20%s',_0xfd77c2,_0x4cdc('0x1f'));logger[_0x4cdc('0x20')](_0x4cdc('0x21'),_0xfd77c2,_0x4cdc('0x1f'),JSON[_0x4cdc('0x22')](_0x4d7ad0));if(_0x4d7ad0[_0x4cdc('0x23')]){if(_0x4d7ad0['error'][_0x4cdc('0x24')]===0x1f4){logger[_0x4cdc('0x23')](_0x4cdc('0x25'),_0xfd77c2,_0x4d7ad0[_0x4cdc('0x23')][_0x4cdc('0x26')]);return _0x394bd2(_0x4d7ad0[_0x4cdc('0x23')][_0x4cdc('0x26')]);}logger[_0x4cdc('0x23')](_0x4cdc('0x25'),_0xfd77c2,_0x4d7ad0[_0x4cdc('0x23')][_0x4cdc('0x26')]);return _0x5608b0(_0x4d7ad0[_0x4cdc('0x23')][_0x4cdc('0x26')]);}else{logger[_0x4cdc('0x1e')]('ChatQueue,\x20%s,\x20%s',_0xfd77c2,_0x4cdc('0x1f'));_0x5608b0(_0x4d7ad0[_0x4cdc('0x27')]['message']);}})['catch'](function(_0x5dc2a8){logger['error'](_0x4cdc('0x25'),_0xfd77c2,_0x5dc2a8);_0x394bd2(_0x5dc2a8);});});}function respondWithStatusCode(_0x4bcb66,_0x16786e){_0x16786e=_0x16786e||0xcc;return function(_0x1ae64e){if(_0x1ae64e){return _0x4bcb66['sendStatus'](_0x16786e);}return _0x4bcb66[_0x4cdc('0x28')](_0x16786e)[_0x4cdc('0x29')]();};}function respondWithResult(_0x4ad6ed,_0x40fa07){_0x40fa07=_0x40fa07||0xc8;return function(_0x47c280){if(_0x47c280){return _0x4ad6ed['status'](_0x40fa07)[_0x4cdc('0x2a')](_0x47c280);}};}function respondWithFilteredResult(_0x215a1e,_0x385985){return function(_0x49670f){if(_0x49670f){var _0x5177b5=typeof _0x385985[_0x4cdc('0x2b')]===_0x4cdc('0x2c')&&typeof _0x385985['limit']===_0x4cdc('0x2c');var _0x2073c8=_0x49670f[_0x4cdc('0x2d')];var _0x484ee5=_0x5177b5?0x0:_0x385985[_0x4cdc('0x2b')];var _0x435034=_0x5177b5?_0x49670f['count']:_0x385985[_0x4cdc('0x2b')]+_0x385985[_0x4cdc('0x2e')];var _0x577273;if(_0x435034>=_0x2073c8){_0x435034=_0x2073c8;_0x577273=0xc8;}else{_0x577273=0xce;}_0x215a1e[_0x4cdc('0x28')](_0x577273);return _0x215a1e[_0x4cdc('0x2f')](_0x4cdc('0x30'),_0x484ee5+'-'+_0x435034+'/'+_0x2073c8)[_0x4cdc('0x2a')](_0x49670f);}return null;};}function patchUpdates(_0x8e9be9){return function(_0xdf4356){try{jsonpatch[_0x4cdc('0x31')](_0xdf4356,_0x8e9be9,!![]);}catch(_0x385f12){return BPromise[_0x4cdc('0x32')](_0x385f12);}return _0xdf4356[_0x4cdc('0x33')]();};}function saveUpdates(_0xca1641,_0x2c17dd){return function(_0x34ce13){if(_0x34ce13){return _0x34ce13[_0x4cdc('0x34')](_0xca1641)[_0x4cdc('0x1d')](function(_0x496647){return _0x496647;});}return null;};}function removeEntity(_0x1ce63d,_0x55f0e9){return function(_0x16d841){if(_0x16d841){return _0x16d841[_0x4cdc('0x35')]()[_0x4cdc('0x1d')](function(){var _0x760d7f=_0x16d841['get']({'plain':!![]});var _0x3b6017=_0x4cdc('0x36');return db['UserProfileResource'][_0x4cdc('0x35')]({'where':{'type':_0x3b6017,'resourceId':_0x760d7f['id']}})[_0x4cdc('0x1d')](function(){return _0x16d841;});})[_0x4cdc('0x1d')](function(){_0x1ce63d[_0x4cdc('0x28')](0xcc)[_0x4cdc('0x29')]();});}};}function handleEntityNotFound(_0x3c08e5,_0x4b3bd7){return function(_0x15c506){if(!_0x15c506){_0x3c08e5[_0x4cdc('0x37')](0x194);}return _0x15c506;};}function handleError(_0x59d2b7,_0x4f3acb){_0x4f3acb=_0x4f3acb||0x1f4;return function(_0x3f9512){logger[_0x4cdc('0x23')](_0x3f9512[_0x4cdc('0x38')]);if(_0x3f9512['name']){delete _0x3f9512[_0x4cdc('0x39')];}_0x59d2b7['status'](_0x4f3acb)['send'](_0x3f9512);};}exports[_0x4cdc('0x3a')]=function(_0x27377d,_0x19eb6a){var _0x177099={},_0x344265={},_0x4213d3={'count':0x0,'rows':[]};var _0x214677=_[_0x4cdc('0x3b')](db[_0x4cdc('0x3c')]['rawAttributes'],function(_0x1c9f2b){return{'name':_0x1c9f2b['fieldName'],'type':_0x1c9f2b[_0x4cdc('0x3d')][_0x4cdc('0x3e')]};});_0x344265[_0x4cdc('0x3f')]=_['map'](_0x214677,'name');_0x344265[_0x4cdc('0x40')]=_['keys'](_0x27377d[_0x4cdc('0x40')]);_0x344265[_0x4cdc('0x41')]=_[_0x4cdc('0x42')](_0x344265[_0x4cdc('0x3f')],_0x344265[_0x4cdc('0x40')]);_0x177099[_0x4cdc('0x43')]=_[_0x4cdc('0x42')](_0x344265[_0x4cdc('0x3f')],qs[_0x4cdc('0x44')](_0x27377d[_0x4cdc('0x40')][_0x4cdc('0x44')]));_0x177099[_0x4cdc('0x43')]=_0x177099[_0x4cdc('0x43')]['length']?_0x177099['attributes']:_0x344265[_0x4cdc('0x3f')];if(!_0x27377d[_0x4cdc('0x40')][_0x4cdc('0x45')](_0x4cdc('0x46'))){_0x177099[_0x4cdc('0x2e')]=qs[_0x4cdc('0x2e')](_0x27377d[_0x4cdc('0x40')]['limit']);_0x177099['offset']=qs[_0x4cdc('0x2b')](_0x27377d[_0x4cdc('0x40')][_0x4cdc('0x2b')]);}_0x177099[_0x4cdc('0x47')]=qs[_0x4cdc('0x48')](_0x27377d[_0x4cdc('0x40')][_0x4cdc('0x48')]);_0x177099[_0x4cdc('0x49')]=qs[_0x4cdc('0x41')](_['pick'](_0x27377d[_0x4cdc('0x40')],_0x344265[_0x4cdc('0x41')]),_0x214677);if(_0x27377d[_0x4cdc('0x40')][_0x4cdc('0x4a')]){_0x177099['where']=_[_0x4cdc('0x4b')](_0x177099['where'],{'$or':_[_0x4cdc('0x3b')](_0x214677,function(_0x3106a4){if(_0x3106a4[_0x4cdc('0x3d')]!==_0x4cdc('0x4c')){var _0x4caaf3={};_0x4caaf3[_0x3106a4[_0x4cdc('0x39')]]={'$like':'%'+_0x27377d[_0x4cdc('0x40')][_0x4cdc('0x4a')]+'%'};return _0x4caaf3;}})});}_0x177099=_[_0x4cdc('0x4b')]({},_0x177099,_0x27377d[_0x4cdc('0x4d')]);var _0x5de949={'where':_0x177099[_0x4cdc('0x49')]};return db[_0x4cdc('0x3c')][_0x4cdc('0x2d')](_0x5de949)[_0x4cdc('0x1d')](function(_0x24e44c){_0x4213d3[_0x4cdc('0x2d')]=_0x24e44c;if(_0x27377d['query']['includeAll']){_0x177099[_0x4cdc('0x4e')]=[{'all':!![]}];}return db[_0x4cdc('0x3c')][_0x4cdc('0x4f')](_0x177099);})[_0x4cdc('0x1d')](function(_0x2b0ff5){_0x4213d3[_0x4cdc('0x50')]=_0x2b0ff5;return _0x4213d3;})[_0x4cdc('0x1d')](respondWithFilteredResult(_0x19eb6a,_0x177099))[_0x4cdc('0x51')](handleError(_0x19eb6a,null));};exports[_0x4cdc('0x52')]=function(_0x1e3b3f,_0x3762dc){var _0x48689f={'raw':!![],'where':{'id':_0x1e3b3f[_0x4cdc('0x53')]['id']}},_0x51ab6d={};_0x51ab6d['model']=_[_0x4cdc('0x54')](db[_0x4cdc('0x3c')][_0x4cdc('0x55')]);_0x51ab6d[_0x4cdc('0x40')]=_[_0x4cdc('0x54')](_0x1e3b3f[_0x4cdc('0x40')]);_0x51ab6d[_0x4cdc('0x41')]=_[_0x4cdc('0x42')](_0x51ab6d['model'],_0x51ab6d[_0x4cdc('0x40')]);_0x48689f[_0x4cdc('0x43')]=_[_0x4cdc('0x42')](_0x51ab6d[_0x4cdc('0x3f')],qs[_0x4cdc('0x44')](_0x1e3b3f[_0x4cdc('0x40')]['fields']));_0x48689f[_0x4cdc('0x43')]=_0x48689f['attributes']['length']?_0x48689f['attributes']:_0x51ab6d[_0x4cdc('0x3f')];if(_0x1e3b3f[_0x4cdc('0x40')][_0x4cdc('0x56')]){_0x48689f['include']=[{'all':!![]}];}_0x48689f=_[_0x4cdc('0x4b')]({},_0x48689f,_0x1e3b3f[_0x4cdc('0x4d')]);return db[_0x4cdc('0x3c')]['find'](_0x48689f)[_0x4cdc('0x1d')](handleEntityNotFound(_0x3762dc,null))[_0x4cdc('0x1d')](respondWithResult(_0x3762dc,null))[_0x4cdc('0x51')](handleError(_0x3762dc,null));};exports['create']=function(_0x1becf0,_0x5e3cab){return db[_0x4cdc('0x3c')][_0x4cdc('0x57')](_0x1becf0['body'],{})[_0x4cdc('0x1d')](function(_0x1db7f7){var _0x3f78d2=_0x1becf0[_0x4cdc('0x58')][_0x4cdc('0x59')]({'plain':!![]});if(!_0x3f78d2)throw new Error(_0x4cdc('0x5a'));if(_0x3f78d2[_0x4cdc('0x5b')]===_0x4cdc('0x58')){var _0x2c15e1=_0x1db7f7[_0x4cdc('0x59')]({'plain':!![]});var _0x3ad6bd=_0x4cdc('0x36');return db[_0x4cdc('0x5c')][_0x4cdc('0x5d')]({'where':{'name':_0x3ad6bd,'userProfileId':_0x3f78d2[_0x4cdc('0x5e')]},'raw':!![]})[_0x4cdc('0x1d')](function(_0x26587a){if(_0x26587a&&_0x26587a[_0x4cdc('0x5f')]===0x0){return db[_0x4cdc('0x60')][_0x4cdc('0x57')]({'name':_0x2c15e1[_0x4cdc('0x39')],'resourceId':_0x2c15e1['id'],'type':_0x26587a['name'],'sectionId':_0x26587a['id']},{})[_0x4cdc('0x1d')](function(){return _0x1db7f7;});}else{return _0x1db7f7;}})[_0x4cdc('0x51')](function(_0x4419ad){logger[_0x4cdc('0x23')](_0x4cdc('0x61'),_0x4419ad);throw _0x4419ad;});}return _0x1db7f7;})[_0x4cdc('0x1d')](respondWithResult(_0x5e3cab,0xc9))[_0x4cdc('0x51')](handleError(_0x5e3cab,null));};exports[_0x4cdc('0x34')]=function(_0x4eff1a,_0x230e9e){if(_0x4eff1a[_0x4cdc('0x62')]['id']){delete _0x4eff1a[_0x4cdc('0x62')]['id'];}return db[_0x4cdc('0x3c')][_0x4cdc('0x5d')]({'where':{'id':_0x4eff1a['params']['id']}})[_0x4cdc('0x1d')](handleEntityNotFound(_0x230e9e,null))[_0x4cdc('0x1d')](saveUpdates(_0x4eff1a[_0x4cdc('0x62')],null))[_0x4cdc('0x1d')](respondWithResult(_0x230e9e,null))[_0x4cdc('0x51')](handleError(_0x230e9e,null));};exports[_0x4cdc('0x35')]=function(_0x38656b,_0x374252){return db[_0x4cdc('0x3c')][_0x4cdc('0x5d')]({'where':{'id':_0x38656b[_0x4cdc('0x53')]['id']}})['then'](handleEntityNotFound(_0x374252,null))[_0x4cdc('0x1d')](removeEntity(_0x374252,null))[_0x4cdc('0x51')](handleError(_0x374252,null));};exports[_0x4cdc('0x63')]=function(_0x21c811,_0x35ff5b){return db[_0x4cdc('0x3c')][_0x4cdc('0x63')]()[_0x4cdc('0x1d')](respondWithResult(_0x35ff5b,null))[_0x4cdc('0x51')](handleError(_0x35ff5b,null));};exports[_0x4cdc('0x64')]=function(_0x3b7bea,_0xef68cf,_0x270439){var _0x306363={'raw':!![],'where':{}},_0x3d445a={},_0x39b5b3;return db['ChatQueue']['findOne']({'where':{'id':_0x3b7bea[_0x4cdc('0x53')]['id']}})['then'](handleEntityNotFound(_0xef68cf,null))[_0x4cdc('0x1d')](function(_0x941e80){if(_0x941e80){_0x39b5b3=_0x941e80[_0x4cdc('0x59')]({'plain':!![]});_0x3d445a['model']=_[_0x4cdc('0x54')](db[_0x4cdc('0x65')][_0x4cdc('0x55')]);_0x3d445a[_0x4cdc('0x40')]=_[_0x4cdc('0x54')](_0x3b7bea[_0x4cdc('0x40')]);_0x3d445a[_0x4cdc('0x41')]=_['intersection'](_0x3d445a[_0x4cdc('0x3f')],_0x3d445a['query']);_0x306363[_0x4cdc('0x43')]=_['intersection'](_0x3d445a[_0x4cdc('0x3f')],qs[_0x4cdc('0x44')](_0x3b7bea[_0x4cdc('0x40')][_0x4cdc('0x44')]));_0x306363['attributes']=_0x306363[_0x4cdc('0x43')][_0x4cdc('0x66')]?_0x306363[_0x4cdc('0x43')]:_0x3d445a['model'];if(!_0x3b7bea[_0x4cdc('0x40')][_0x4cdc('0x45')](_0x4cdc('0x46'))){_0x306363[_0x4cdc('0x2e')]=qs[_0x4cdc('0x2e')](_0x3b7bea[_0x4cdc('0x40')][_0x4cdc('0x2e')]);_0x306363[_0x4cdc('0x2b')]=qs[_0x4cdc('0x2b')](_0x3b7bea[_0x4cdc('0x40')][_0x4cdc('0x2b')]);}_0x306363[_0x4cdc('0x47')]=qs['sort'](_0x3b7bea['query'][_0x4cdc('0x48')]);_0x306363[_0x4cdc('0x49')]=qs['filters'](_['pick'](_0x3b7bea['query'],_0x3d445a[_0x4cdc('0x41')]));_0x306363[_0x4cdc('0x49')][_0x4cdc('0x67')]=_0x941e80['id'];if(_0x3b7bea[_0x4cdc('0x40')][_0x4cdc('0x4a')]){_0x306363[_0x4cdc('0x49')]=_[_0x4cdc('0x4b')](_0x306363['where'],{'$or':_[_0x4cdc('0x3b')](_0x306363['attributes'],function(_0x6fd36e){var _0x1bad9c={};_0x1bad9c[_0x6fd36e]={'$like':'%'+_0x3b7bea[_0x4cdc('0x40')][_0x4cdc('0x4a')]+'%'};return _0x1bad9c;})});}_0x306363=_[_0x4cdc('0x4b')]({},_0x306363,_0x3b7bea[_0x4cdc('0x4d')]);return db[_0x4cdc('0x65')][_0x4cdc('0x4f')](_0x306363);}})[_0x4cdc('0x1d')](function(_0xbd2a04){if(_0xbd2a04){return db['User'][_0x4cdc('0x68')]({'where':{'id':_[_0x4cdc('0x3b')](_0xbd2a04,'UserId'),'role':'agent'},'attributes':['id','name','chatPause',_0x4cdc('0x69'),_0x4cdc('0x6a')]});}})[_0x4cdc('0x1d')](function(_0x2e8563){if(_0x2e8563){return{'count':_0x2e8563[_0x4cdc('0x2d')],'rows':_[_0x4cdc('0x3b')](_0x2e8563[_0x4cdc('0x50')],function(_0x7eb24e){return{'membername':_0x7eb24e[_0x4cdc('0x39')],'UserId':_0x7eb24e['id'],'queue_name':_0x39b5b3['name'],'ChatQueueId':_0x39b5b3['id'],'interface':util[_0x4cdc('0x6b')](_0x4cdc('0x6c'),_0x4cdc('0x6d'),_0x7eb24e[_0x4cdc('0x39')]),'penalty':0x0,'paused':_0x7eb24e['chatPause'],'createdAt':_0x7eb24e[_0x4cdc('0x6a')],'updatedAt':_0x7eb24e[_0x4cdc('0x69')]};})};}else{return{'count':0x0,'rows':[]};}})[_0x4cdc('0x1d')](respondWithFilteredResult(_0xef68cf,_0x306363))[_0x4cdc('0x51')](handleError(_0xef68cf,null));};exports[_0x4cdc('0x6e')]=function(_0x4dba35,_0x34e948,_0x4fb29b){var _0x1a3f7a={};var _0x49c459={};var _0x5cf3ae;var _0x3cf1d9;return db[_0x4cdc('0x3c')][_0x4cdc('0x6f')]({'where':{'id':_0x4dba35[_0x4cdc('0x53')]['id']}})['then'](handleEntityNotFound(_0x34e948,null))[_0x4cdc('0x1d')](function(_0x1ba230){if(_0x1ba230){_0x5cf3ae=_0x1ba230;_0x49c459['model']=_[_0x4cdc('0x54')](db[_0x4cdc('0x70')][_0x4cdc('0x55')]);_0x49c459[_0x4cdc('0x40')]=_[_0x4cdc('0x54')](_0x4dba35[_0x4cdc('0x40')]);_0x49c459['filters']=_[_0x4cdc('0x42')](_0x49c459['model'],_0x49c459[_0x4cdc('0x40')]);_0x1a3f7a[_0x4cdc('0x43')]=_[_0x4cdc('0x42')](_0x49c459[_0x4cdc('0x3f')],qs['fields'](_0x4dba35[_0x4cdc('0x40')][_0x4cdc('0x44')]));_0x1a3f7a[_0x4cdc('0x43')]=_0x1a3f7a['attributes'][_0x4cdc('0x66')]?_0x1a3f7a['attributes']:_0x49c459['model'];_0x1a3f7a[_0x4cdc('0x47')]=qs[_0x4cdc('0x48')](_0x4dba35['query'][_0x4cdc('0x48')]);_0x1a3f7a[_0x4cdc('0x49')]=qs['filters'](_['pick'](_0x4dba35[_0x4cdc('0x40')],_0x49c459[_0x4cdc('0x41')]));if(_0x4dba35[_0x4cdc('0x40')][_0x4cdc('0x4a')]){_0x1a3f7a['where']=_[_0x4cdc('0x4b')](_0x1a3f7a['where'],{'$or':_[_0x4cdc('0x3b')](_0x1a3f7a[_0x4cdc('0x43')],function(_0x47c584){var _0x3faa95={};_0x3faa95[_0x47c584]={'$like':'%'+_0x4dba35[_0x4cdc('0x40')][_0x4cdc('0x4a')]+'%'};return _0x3faa95;})});}_0x1a3f7a=_[_0x4cdc('0x4b')]({},_0x1a3f7a,_0x4dba35['options']);return _0x5cf3ae['getTeams'](_0x1a3f7a);}})[_0x4cdc('0x1d')](function(_0x3e87c4){if(_0x3e87c4){_0x3cf1d9=_0x3e87c4[_0x4cdc('0x66')];if(!_0x4dba35[_0x4cdc('0x40')][_0x4cdc('0x45')]('nolimit')){_0x1a3f7a[_0x4cdc('0x2e')]=qs[_0x4cdc('0x2e')](_0x4dba35[_0x4cdc('0x40')][_0x4cdc('0x2e')]);_0x1a3f7a[_0x4cdc('0x2b')]=qs[_0x4cdc('0x2b')](_0x4dba35[_0x4cdc('0x40')]['offset']);}return _0x5cf3ae[_0x4cdc('0x6e')](_0x1a3f7a);}})[_0x4cdc('0x1d')](function(_0x1e155b){if(_0x1e155b){return _0x1e155b?{'count':_0x3cf1d9,'rows':_0x1e155b}:null;}})[_0x4cdc('0x1d')](respondWithResult(_0x34e948,null))[_0x4cdc('0x51')](handleError(_0x34e948,null));};exports['addTeams']=function(_0x564108,_0x118d42,_0xf5edb9){var _0x5dd120=_0x564108[_0x4cdc('0x62')]['ids'];return db[_0x4cdc('0x70')][_0x4cdc('0x4f')]({'where':{'id':_0x5dd120},'attributes':['id'],'include':[{'model':db[_0x4cdc('0x71')],'as':'Agents','attributes':['id',_0x4cdc('0x39'),_0x4cdc('0x72'),_0x4cdc('0x73'),_0x4cdc('0x74')],'raw':!![]}]})[_0x4cdc('0x1d')](function(_0x5d7582){if(_0x5d7582){var _0x68e70c=_[_0x4cdc('0x75')](_0x5d7582,function(_0x20bfc7){var _0x4e63cb=_0x20bfc7['get']({'plain':!![]});return _0x4e63cb['Agents'];});return db[_0x4cdc('0x3c')][_0x4cdc('0x5d')]({'where':{'id':_0x564108[_0x4cdc('0x53')]['id']}})[_0x4cdc('0x1d')](function(_0x29efab){return db[_0x4cdc('0x76')][_0x4cdc('0x77')](function(_0x2bd381){return _0x29efab[_0x4cdc('0x78')](_0x5dd120,{'transaction':_0x2bd381})[_0x4cdc('0x1d')](function(){return BPromise['each'](_0x68e70c,function(_0x35a3d7){return db['UserChatQueue']['findOrCreate']({'where':{'UserId':_0x35a3d7['id'],'ChatQueueId':_0x564108[_0x4cdc('0x53')]['id']},'transaction':_0x2bd381});});})[_0x4cdc('0x1d')](function(){_0x68e70c[_0x4cdc('0x79')](function(_0x1b1095){socket['emit'](_0x4cdc('0x7a'),{'UserId':_0x1b1095['id'],'ChatQueueId':_0x29efab['id']});});});});});}})[_0x4cdc('0x1d')](respondWithStatusCode(_0x118d42,null))[_0x4cdc('0x51')](handleError(_0x118d42,null));};exports[_0x4cdc('0x7b')]=function(_0x2ef483,_0x1aee2d,_0x35585d){return db['Team'][_0x4cdc('0x4f')]({'where':{'id':_0x2ef483[_0x4cdc('0x40')][_0x4cdc('0x7c')]},'attributes':['id'],'include':[{'model':db[_0x4cdc('0x71')],'as':'Agents','attributes':['id'],'raw':!![]}]})[_0x4cdc('0x1d')](handleEntityNotFound(_0x1aee2d,null))[_0x4cdc('0x1d')](function(_0x30eb22){var _0x3634c2=_['map'](_0x30eb22,'id');var _0x16a417=[];var _0x5ce506=[];var _0x51c9c2=squel['select']();_0x51c9c2[_0x4cdc('0x7d')](_0x4cdc('0x7e'))[_0x4cdc('0x7f')](_0x4cdc('0x80'),'tq')[_0x4cdc('0x81')](_0x4cdc('0x82'),'ut','ut.TeamId\x20=\x20tq.TeamId')['where'](_0x4cdc('0x83'),_0x2ef483[_0x4cdc('0x53')]['id']);for(var _0x238e17=0x0;_0x238e17<_0x30eb22['length'];_0x238e17+=0x1){let _0x140d52=_0x30eb22[_0x238e17];for(var _0x439c3a=0x0;_0x439c3a<_0x140d52[_0x4cdc('0x84')]['length'];_0x439c3a+=0x1){let _0x2f8c87=_0x140d52[_0x4cdc('0x84')][_0x439c3a];var _0x4bb33f=_0x51c9c2[_0x4cdc('0x85')]();_0x4bb33f['where'](_0x4cdc('0x86'),_0x2f8c87['id']);_0x5ce506[_0x4cdc('0x87')](db[_0x4cdc('0x76')]['query'](_0x4bb33f[_0x4cdc('0x88')](),{'type':db[_0x4cdc('0x76')][_0x4cdc('0x89')][_0x4cdc('0x8a')]})['then'](function(_0x25ed56){if(_0x25ed56[_0x4cdc('0x66')]===0x1){return _0x2f8c87['id'];}else{var _0x344a0e=_['every'](_[_0x4cdc('0x3b')](_0x25ed56,_0x4cdc('0x8b')),function(_0x1e17b3){return _[_0x4cdc('0x8c')](_0x3634c2,_0x1e17b3);});if(_0x344a0e){return _0x2f8c87['id'];}}}));}}return BPromise[_0x4cdc('0x8d')](_0x5ce506)['then'](function(_0x2b1a35){_0x16a417=_(_0x16a417)[_0x4cdc('0x8e')](_0x2b1a35)[_0x4cdc('0x8f')]()[_0x4cdc('0x90')]();return db[_0x4cdc('0x3c')][_0x4cdc('0x5d')]({'where':{'id':_0x2ef483['params']['id']}})[_0x4cdc('0x1d')](function(_0x4e0ffd){return db[_0x4cdc('0x76')]['transaction'](function(_0xd395ea){return _0x4e0ffd[_0x4cdc('0x7b')](_0x2ef483[_0x4cdc('0x40')][_0x4cdc('0x7c')],{'transaction':_0xd395ea})[_0x4cdc('0x1d')](function(){if(!_[_0x4cdc('0x91')](_0x16a417)){return _0x4e0ffd[_0x4cdc('0x92')](_0x16a417,{'transaction':_0xd395ea});}})['then'](function(){_0x16a417['forEach'](function(_0x5ddc93){socket[_0x4cdc('0x93')](_0x4cdc('0x94'),{'UserId':_0x5ddc93,'ChatQueueId':_0x4e0ffd['id']});});});});});});})[_0x4cdc('0x1d')](respondWithStatusCode(_0x1aee2d,null))[_0x4cdc('0x51')](handleError(_0x1aee2d,null));};exports[_0x4cdc('0x95')]=function(_0x647cf1,_0x27e4de,_0x123e17){return db[_0x4cdc('0x3c')][_0x4cdc('0x5d')]({'where':{'id':_0x647cf1[_0x4cdc('0x53')]['id']}})['then'](handleEntityNotFound(_0x27e4de,null))[_0x4cdc('0x1d')](function(_0x28c06f){if(_0x28c06f){return _0x28c06f[_0x4cdc('0x95')](_0x647cf1[_0x4cdc('0x62')][_0x4cdc('0x7c')],_[_0x4cdc('0x96')](_0x647cf1['body'],[_0x4cdc('0x7c'),'id'])||{})[_0x4cdc('0x97')](function(_0x52e95f){for(var _0x1af842=0x0;_0x1af842<_0x647cf1[_0x4cdc('0x62')][_0x4cdc('0x7c')][_0x4cdc('0x66')];_0x1af842+=0x1){socket['emit'](_0x4cdc('0x7a'),{'UserId':Number(_0x647cf1[_0x4cdc('0x62')][_0x4cdc('0x7c')][_0x1af842]),'ChatQueueId':Number(_0x647cf1[_0x4cdc('0x53')]['id'])});}return _0x52e95f;});}})[_0x4cdc('0x1d')](respondWithResult(_0x27e4de,null))[_0x4cdc('0x51')](handleError(_0x27e4de,null));};exports[_0x4cdc('0x92')]=function(_0x413179,_0x593e1e,_0xfbcce5){return db[_0x4cdc('0x3c')][_0x4cdc('0x5d')]({'where':{'id':_0x413179[_0x4cdc('0x53')]['id']}})['then'](handleEntityNotFound(_0x593e1e,null))['then'](function(_0x3b5b6f){if(_0x3b5b6f){return _0x3b5b6f[_0x4cdc('0x92')](_0x413179[_0x4cdc('0x40')][_0x4cdc('0x7c')])[_0x4cdc('0x1d')](function(){if(_['isArray'](_0x413179[_0x4cdc('0x40')]['ids'])){for(var _0x2a916f=0x0;_0x2a916f<_0x413179['query']['ids'][_0x4cdc('0x66')];_0x2a916f+=0x1){socket[_0x4cdc('0x93')](_0x4cdc('0x94'),{'UserId':Number(_0x413179[_0x4cdc('0x40')][_0x4cdc('0x7c')][_0x2a916f]),'ChatQueueId':Number(_0x413179['params']['id'])});}}else{socket['emit'](_0x4cdc('0x94'),{'UserId':Number(_0x413179[_0x4cdc('0x40')][_0x4cdc('0x7c')]),'ChatQueueId':Number(_0x413179['params']['id'])});}});}})[_0x4cdc('0x1d')](respondWithStatusCode(_0x593e1e,null))[_0x4cdc('0x51')](handleError(_0x593e1e,null));};exports[_0x4cdc('0x98')]=function(_0x47f0c0,_0x2cae64,_0x363a0b){var _0x160d51={};var _0x394ff4={};var _0x4d4403;var _0x3f431a;return db[_0x4cdc('0x3c')]['findOne']({'where':{'id':_0x47f0c0[_0x4cdc('0x53')]['id']}})[_0x4cdc('0x1d')](handleEntityNotFound(_0x2cae64,null))[_0x4cdc('0x1d')](function(_0x181032){if(_0x181032){_0x4d4403=_0x181032;_0x394ff4[_0x4cdc('0x3f')]=_[_0x4cdc('0x54')](db[_0x4cdc('0x71')][_0x4cdc('0x55')]);_0x394ff4[_0x4cdc('0x40')]=_[_0x4cdc('0x54')](_0x47f0c0[_0x4cdc('0x40')]);_0x394ff4[_0x4cdc('0x41')]=_['intersection'](_0x394ff4['model'],_0x394ff4[_0x4cdc('0x40')]);_0x160d51['attributes']=_[_0x4cdc('0x42')](_0x394ff4[_0x4cdc('0x3f')],qs[_0x4cdc('0x44')](_0x47f0c0[_0x4cdc('0x40')][_0x4cdc('0x44')]));_0x160d51['attributes']=_0x160d51[_0x4cdc('0x43')]['length']?_0x160d51[_0x4cdc('0x43')]:_0x394ff4['model'];_0x160d51[_0x4cdc('0x47')]=qs[_0x4cdc('0x48')](_0x47f0c0['query'][_0x4cdc('0x48')]);_0x160d51[_0x4cdc('0x49')]=qs[_0x4cdc('0x41')](_[_0x4cdc('0x99')](_0x47f0c0[_0x4cdc('0x40')],_0x394ff4[_0x4cdc('0x41')]));if(_0x47f0c0[_0x4cdc('0x40')][_0x4cdc('0x4a')]){_0x160d51[_0x4cdc('0x49')]=_['merge'](_0x160d51['where'],{'$or':_[_0x4cdc('0x3b')](_0x160d51[_0x4cdc('0x43')],function(_0x812d77){var _0x428031={};_0x428031[_0x812d77]={'$like':'%'+_0x47f0c0[_0x4cdc('0x40')]['filter']+'%'};return _0x428031;})});}_0x160d51=_[_0x4cdc('0x4b')]({},_0x160d51,_0x47f0c0['options']);return _0x4d4403['getAgents'](_0x160d51);}})[_0x4cdc('0x1d')](function(_0x166d40){if(_0x166d40){_0x3f431a=_0x166d40['length'];if(!_0x47f0c0['query'][_0x4cdc('0x45')]('nolimit')){_0x160d51['limit']=qs['limit'](_0x47f0c0[_0x4cdc('0x40')][_0x4cdc('0x2e')]);_0x160d51[_0x4cdc('0x2b')]=qs[_0x4cdc('0x2b')](_0x47f0c0[_0x4cdc('0x40')][_0x4cdc('0x2b')]);}return _0x4d4403[_0x4cdc('0x98')](_0x160d51);}})['then'](function(_0x4ae80a){if(_0x4ae80a){return _0x4ae80a?{'count':_0x3f431a,'rows':_0x4ae80a}:null;}})[_0x4cdc('0x1d')](respondWithResult(_0x2cae64,null))[_0x4cdc('0x51')](handleError(_0x2cae64,null));};
\ No newline at end of file
diff --git a/server/api/chatQueue/chatQueue.events.js b/server/api/chatQueue/chatQueue.events.js
index 8b90a8d..576db9e 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 _0xdf71=['setMaxListeners','save','update','remove','emit','hook','exports','events','ChatQueue'];(function(_0x19950b,_0x53d0d7){var _0x3c6b41=function(_0x3924ad){while(--_0x3924ad){_0x19950b['push'](_0x19950b['shift']());}};_0x3c6b41(++_0x53d0d7);}(_0xdf71,0x1d2));var _0x1df7=function(_0x5bbb39,_0x26dddd){_0x5bbb39=_0x5bbb39-0x0;var _0x4b7eb0=_0xdf71[_0x5bbb39];return _0x4b7eb0;};'use strict';var EventEmitter=require(_0x1df7('0x0'));var ChatQueue=require('../../mysqldb')['db'][_0x1df7('0x1')];var ChatQueueEvents=new EventEmitter();ChatQueueEvents[_0x1df7('0x2')](0x0);var events={'afterCreate':_0x1df7('0x3'),'afterUpdate':_0x1df7('0x4'),'afterDestroy':_0x1df7('0x5')};function emitEvent(_0x43490d){return function(_0x436544,_0x570cbd,_0xc9e362){ChatQueueEvents[_0x1df7('0x6')](_0x43490d+':'+_0x436544['id'],_0x436544);ChatQueueEvents['emit'](_0x43490d,_0x436544);_0xc9e362(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];ChatQueue[_0x1df7('0x7')](e,emitEvent(event));}}module[_0x1df7('0x8')]=ChatQueueEvents;
\ No newline at end of file
+var _0x20da=['remove','emit','exports','events','../../mysqldb','ChatQueue','setMaxListeners','update'];(function(_0x65656f,_0x23d7fd){var _0x5824c9=function(_0x369f7f){while(--_0x369f7f){_0x65656f['push'](_0x65656f['shift']());}};_0x5824c9(++_0x23d7fd);}(_0x20da,0xcb));var _0xa20d=function(_0x32ab21,_0x26ca1b){_0x32ab21=_0x32ab21-0x0;var _0x3c9408=_0x20da[_0x32ab21];return _0x3c9408;};'use strict';var EventEmitter=require(_0xa20d('0x0'));var ChatQueue=require(_0xa20d('0x1'))['db'][_0xa20d('0x2')];var ChatQueueEvents=new EventEmitter();ChatQueueEvents[_0xa20d('0x3')](0x0);var events={'afterCreate':'save','afterUpdate':_0xa20d('0x4'),'afterDestroy':_0xa20d('0x5')};function emitEvent(_0x16e90a){return function(_0x3ae6ba,_0x416aeb,_0x17b952){ChatQueueEvents[_0xa20d('0x6')](_0x16e90a+':'+_0x3ae6ba['id'],_0x3ae6ba);ChatQueueEvents[_0xa20d('0x6')](_0x16e90a,_0x3ae6ba);_0x17b952(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];ChatQueue['hook'](e,emitEvent(event));}}module[_0xa20d('0x7')]=ChatQueueEvents;
\ No newline at end of file
diff --git a/server/api/chatQueue/chatQueue.model.js b/server/api/chatQueue/chatQueue.model.js
index aad9b84..14c79d0 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 _0x2cbd=['api','request-promise','path','../../config/environment','./chatQueue.attributes','exports','define','chat_queues','lodash','util','../../config/logger'];(function(_0x3f0b30,_0x159bc8){var _0x2748a5=function(_0x3b42cc){while(--_0x3b42cc){_0x3f0b30['push'](_0x3f0b30['shift']());}};_0x2748a5(++_0x159bc8);}(_0x2cbd,0x8c));var _0xd2cb=function(_0x53e3fa,_0x50c5f2){_0x53e3fa=_0x53e3fa-0x0;var _0xe8584a=_0x2cbd[_0x53e3fa];return _0xe8584a;};'use strict';var _=require(_0xd2cb('0x0'));var util=require(_0xd2cb('0x1'));var logger=require(_0xd2cb('0x2'))(_0xd2cb('0x3'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0xd2cb('0x4'));var fs=require('fs');var path=require(_0xd2cb('0x5'));var rimraf=require('rimraf');var config=require(_0xd2cb('0x6'));var attributes=require(_0xd2cb('0x7'));module[_0xd2cb('0x8')]=function(_0x5adffa,_0x48f40e){return _0x5adffa[_0xd2cb('0x9')]('ChatQueue',attributes,{'tableName':_0xd2cb('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xb2db=['path','../../config/environment','./chatQueue.attributes','exports','define','ChatQueue','chat_queues','util','../../config/logger','api','moment','bluebird','request-promise'];(function(_0x374785,_0x4f71b8){var _0x572c40=function(_0x1cf7b0){while(--_0x1cf7b0){_0x374785['push'](_0x374785['shift']());}};_0x572c40(++_0x4f71b8);}(_0xb2db,0xca));var _0xbb2d=function(_0x19d0bb,_0x1fcc68){_0x19d0bb=_0x19d0bb-0x0;var _0x1bc556=_0xb2db[_0x19d0bb];return _0x1bc556;};'use strict';var _=require('lodash');var util=require(_0xbb2d('0x0'));var logger=require(_0xbb2d('0x1'))(_0xbb2d('0x2'));var moment=require(_0xbb2d('0x3'));var BPromise=require(_0xbb2d('0x4'));var rp=require(_0xbb2d('0x5'));var fs=require('fs');var path=require(_0xbb2d('0x6'));var rimraf=require('rimraf');var config=require(_0xbb2d('0x7'));var attributes=require(_0xbb2d('0x8'));module[_0xbb2d('0x9')]=function(_0x4768d3,_0x798452){return _0x4768d3[_0xbb2d('0xa')](_0xbb2d('0xb'),attributes,{'tableName':_0xbb2d('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
diff --git a/server/api/chatQueue/chatQueue.rpc.js b/server/api/chatQueue/chatQueue.rpc.js
index 94fa47d..73deaa9 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 _0x173d=['map','model','ShowChatQueue','ChatQueue','find','util','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','redis','socket.io-emitter','register','request','then','info','ChatQueue,\x20%s,\x20%s','request\x20sent','debug','ChatQueue,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','GetChatQueue','findAll','options','raw','where','attributes','limit','include'];(function(_0x3f2fdb,_0x1f311c){var _0x4bbcb2=function(_0x2eeec8){while(--_0x2eeec8){_0x3f2fdb['push'](_0x3f2fdb['shift']());}};_0x4bbcb2(++_0x1f311c);}(_0x173d,0x108));var _0xd173=function(_0x2db063,_0x1b2e29){_0x2db063=_0x2db063-0x0;var _0xa933be=_0x173d[_0x2db063];return _0xa933be;};'use strict';var _=require('lodash');var util=require(_0xd173('0x0'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0xd173('0x1'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xd173('0x2'))['db'];var utils=require(_0xd173('0x3'));var logger=require(_0xd173('0x4'))(_0xd173('0x5'));var config=require(_0xd173('0x6'));var jayson=require('jayson/promise');var client=jayson[_0xd173('0x7')][_0xd173('0x8')]({'port':0x232a});config[_0xd173('0x9')]=_['defaults'](config[_0xd173('0x9')],{'host':'localhost','port':0x18eb});var socket=require(_0xd173('0xa'))(new Redis(config['redis']));require('./chatQueue.socket')[_0xd173('0xb')](socket);function respondWithRpcPromise(_0x40aece,_0x4f37ea,_0x2ac519){return new BPromise(function(_0x1e1bd5,_0x4b0ac9){return client[_0xd173('0xc')](_0x40aece,_0x2ac519)[_0xd173('0xd')](function(_0x1b4bd1){logger[_0xd173('0xe')](_0xd173('0xf'),_0x4f37ea,_0xd173('0x10'));logger[_0xd173('0x11')](_0xd173('0x12'),_0x4f37ea,_0xd173('0x10'),JSON[_0xd173('0x13')](_0x1b4bd1));if(_0x1b4bd1[_0xd173('0x14')]){if(_0x1b4bd1[_0xd173('0x14')]['code']===0x1f4){logger[_0xd173('0x14')]('ChatQueue,\x20%s,\x20%s',_0x4f37ea,_0x1b4bd1[_0xd173('0x14')][_0xd173('0x15')]);return _0x4b0ac9(_0x1b4bd1['error'][_0xd173('0x15')]);}logger[_0xd173('0x14')](_0xd173('0xf'),_0x4f37ea,_0x1b4bd1[_0xd173('0x14')]['message']);return _0x1e1bd5(_0x1b4bd1['error'][_0xd173('0x15')]);}else{logger[_0xd173('0xe')](_0xd173('0xf'),_0x4f37ea,'request\x20sent');_0x1e1bd5(_0x1b4bd1[_0xd173('0x16')][_0xd173('0x15')]);}})[_0xd173('0x17')](function(_0x262eac){logger['error']('ChatQueue,\x20%s,\x20%s',_0x4f37ea,_0x262eac);_0x4b0ac9(_0x262eac);});});}exports[_0xd173('0x18')]=function(_0xec34f9){var _0x38be1d=this;return new Promise(function(_0x35c2d8,_0x58e9ff){return db['ChatQueue'][_0xd173('0x19')]({'raw':_0xec34f9[_0xd173('0x1a')]?_0xec34f9['options'][_0xd173('0x1b')]===undefined?!![]:![]:!![],'where':_0xec34f9[_0xd173('0x1a')]?_0xec34f9['options'][_0xd173('0x1c')]||null:null,'attributes':_0xec34f9[_0xd173('0x1a')]?_0xec34f9['options'][_0xd173('0x1d')]||null:null,'limit':_0xec34f9[_0xd173('0x1a')]?_0xec34f9['options'][_0xd173('0x1e')]||null:null,'include':_0xec34f9[_0xd173('0x1a')]?_0xec34f9[_0xd173('0x1a')][_0xd173('0x1f')]?_[_0xd173('0x20')](_0xec34f9[_0xd173('0x1a')]['include'],function(_0x57f971){return{'model':db[_0x57f971[_0xd173('0x21')]],'as':_0x57f971['as'],'attributes':_0x57f971[_0xd173('0x1d')],'include':_0x57f971[_0xd173('0x1f')]?_[_0xd173('0x20')](_0x57f971[_0xd173('0x1f')],function(_0x378a07){return{'model':db[_0x378a07[_0xd173('0x21')]],'as':_0x378a07['as'],'attributes':_0x378a07[_0xd173('0x1d')],'include':_0x378a07['include']?_['map'](_0x378a07[_0xd173('0x1f')],function(_0x15035c){return{'model':db[_0x15035c['model']],'as':_0x15035c['as'],'attributes':_0x15035c['attributes']};}):[]};}):[]};}):[]:[]})[_0xd173('0xd')](function(_0x38a389){logger[_0xd173('0xe')](_0xd173('0x18'),_0xec34f9);logger[_0xd173('0x11')](_0xd173('0x18'),_0xec34f9,JSON['stringify'](_0x38a389));_0x35c2d8(_0x38a389);})['catch'](function(_0x142273){logger[_0xd173('0x14')]('GetChatQueue',_0x142273[_0xd173('0x15')],_0xec34f9);_0x58e9ff(_0x38be1d[_0xd173('0x14')](0x1f4,_0x142273[_0xd173('0x15')]));});});};exports[_0xd173('0x22')]=function(_0x1def05){var _0x4dfcd8=this;return new Promise(function(_0x4957d4,_0x5f4ea4){return db[_0xd173('0x23')][_0xd173('0x24')]({'raw':_0x1def05['options']?_0x1def05[_0xd173('0x1a')][_0xd173('0x1b')]===undefined?!![]:![]:!![],'where':_0x1def05[_0xd173('0x1a')]?_0x1def05[_0xd173('0x1a')][_0xd173('0x1c')]||null:null,'attributes':_0x1def05['options']?_0x1def05[_0xd173('0x1a')][_0xd173('0x1d')]||null:null,'include':_0x1def05[_0xd173('0x1a')]?_0x1def05[_0xd173('0x1a')][_0xd173('0x1f')]?_[_0xd173('0x20')](_0x1def05['options'][_0xd173('0x1f')],function(_0x3b0855){return{'model':db[_0x3b0855[_0xd173('0x21')]],'as':_0x3b0855['as'],'attributes':_0x3b0855['attributes'],'include':_0x3b0855['include']?_[_0xd173('0x20')](_0x3b0855[_0xd173('0x1f')],function(_0x37ef2d){return{'model':db[_0x37ef2d['model']],'as':_0x37ef2d['as'],'attributes':_0x37ef2d[_0xd173('0x1d')],'include':_0x37ef2d[_0xd173('0x1f')]?_[_0xd173('0x20')](_0x37ef2d[_0xd173('0x1f')],function(_0x2ceec8){return{'model':db[_0x2ceec8['model']],'as':_0x2ceec8['as'],'attributes':_0x2ceec8[_0xd173('0x1d')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x19a966){logger[_0xd173('0xe')](_0xd173('0x22'),_0x1def05);logger['debug']('ShowChatQueue',_0x1def05,JSON[_0xd173('0x13')](_0x19a966));_0x4957d4(_0x19a966);})['catch'](function(_0x22808d){logger[_0xd173('0x14')]('ShowChatQueue',_0x22808d['message'],_0x1def05);_0x5f4ea4(_0x4dfcd8[_0xd173('0x14')](0x1f4,_0x22808d[_0xd173('0x15')]));});});};
\ No newline at end of file
+var _0x7ae6=['localhost','socket.io-emitter','./chatQueue.socket','register','request','then','info','ChatQueue,\x20%s,\x20%s','request\x20sent','debug','ChatQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','message','ChatQueue','findAll','options','raw','attributes','limit','map','include','model','ShowChatQueue','find','where','catch','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','redis'];(function(_0x5c08cb,_0x456960){var _0x147907=function(_0x1da1be){while(--_0x1da1be){_0x5c08cb['push'](_0x5c08cb['shift']());}};_0x147907(++_0x456960);}(_0x7ae6,0x94));var _0x67ae=function(_0x4219dc,_0x45af02){_0x4219dc=_0x4219dc-0x0;var _0xfe8ac6=_0x7ae6[_0x4219dc];return _0xfe8ac6;};'use strict';var _=require('lodash');var util=require(_0x67ae('0x0'));var moment=require('moment');var BPromise=require(_0x67ae('0x1'));var rs=require(_0x67ae('0x2'));var fs=require('fs');var Redis=require(_0x67ae('0x3'));var db=require(_0x67ae('0x4'))['db'];var utils=require(_0x67ae('0x5'));var logger=require(_0x67ae('0x6'))('rpc');var config=require(_0x67ae('0x7'));var jayson=require(_0x67ae('0x8'));var client=jayson[_0x67ae('0x9')][_0x67ae('0xa')]({'port':0x232a});config[_0x67ae('0xb')]=_['defaults'](config[_0x67ae('0xb')],{'host':_0x67ae('0xc'),'port':0x18eb});var socket=require(_0x67ae('0xd'))(new Redis(config[_0x67ae('0xb')]));require(_0x67ae('0xe'))[_0x67ae('0xf')](socket);function respondWithRpcPromise(_0x46140e,_0x417111,_0x4d278b){return new BPromise(function(_0x28d20a,_0x3143cb){return client[_0x67ae('0x10')](_0x46140e,_0x4d278b)[_0x67ae('0x11')](function(_0xf3f46b){logger[_0x67ae('0x12')](_0x67ae('0x13'),_0x417111,_0x67ae('0x14'));logger[_0x67ae('0x15')](_0x67ae('0x16'),_0x417111,_0x67ae('0x14'),JSON[_0x67ae('0x17')](_0xf3f46b));if(_0xf3f46b[_0x67ae('0x18')]){if(_0xf3f46b[_0x67ae('0x18')][_0x67ae('0x19')]===0x1f4){logger['error'](_0x67ae('0x13'),_0x417111,_0xf3f46b[_0x67ae('0x18')][_0x67ae('0x1a')]);return _0x3143cb(_0xf3f46b['error']['message']);}logger[_0x67ae('0x18')]('ChatQueue,\x20%s,\x20%s',_0x417111,_0xf3f46b['error'][_0x67ae('0x1a')]);return _0x28d20a(_0xf3f46b[_0x67ae('0x18')]['message']);}else{logger['info']('ChatQueue,\x20%s,\x20%s',_0x417111,_0x67ae('0x14'));_0x28d20a(_0xf3f46b['result'][_0x67ae('0x1a')]);}})['catch'](function(_0x3654fd){logger[_0x67ae('0x18')](_0x67ae('0x13'),_0x417111,_0x3654fd);_0x3143cb(_0x3654fd);});});}exports['GetChatQueue']=function(_0x30606a){var _0x18876d=this;return new Promise(function(_0x23ca2c,_0xbe6112){return db[_0x67ae('0x1b')][_0x67ae('0x1c')]({'raw':_0x30606a[_0x67ae('0x1d')]?_0x30606a['options'][_0x67ae('0x1e')]===undefined?!![]:![]:!![],'where':_0x30606a[_0x67ae('0x1d')]?_0x30606a['options']['where']||null:null,'attributes':_0x30606a['options']?_0x30606a[_0x67ae('0x1d')][_0x67ae('0x1f')]||null:null,'limit':_0x30606a[_0x67ae('0x1d')]?_0x30606a['options'][_0x67ae('0x20')]||null:null,'include':_0x30606a[_0x67ae('0x1d')]?_0x30606a['options']['include']?_[_0x67ae('0x21')](_0x30606a[_0x67ae('0x1d')][_0x67ae('0x22')],function(_0x219d03){return{'model':db[_0x219d03[_0x67ae('0x23')]],'as':_0x219d03['as'],'attributes':_0x219d03[_0x67ae('0x1f')],'include':_0x219d03[_0x67ae('0x22')]?_[_0x67ae('0x21')](_0x219d03[_0x67ae('0x22')],function(_0x479b8a){return{'model':db[_0x479b8a[_0x67ae('0x23')]],'as':_0x479b8a['as'],'attributes':_0x479b8a['attributes'],'include':_0x479b8a[_0x67ae('0x22')]?_[_0x67ae('0x21')](_0x479b8a[_0x67ae('0x22')],function(_0x266d26){return{'model':db[_0x266d26[_0x67ae('0x23')]],'as':_0x266d26['as'],'attributes':_0x266d26[_0x67ae('0x1f')]};}):[]};}):[]};}):[]:[]})[_0x67ae('0x11')](function(_0x361f98){logger['info']('GetChatQueue',_0x30606a);logger['debug']('GetChatQueue',_0x30606a,JSON[_0x67ae('0x17')](_0x361f98));_0x23ca2c(_0x361f98);})['catch'](function(_0x5c3020){logger[_0x67ae('0x18')]('GetChatQueue',_0x5c3020[_0x67ae('0x1a')],_0x30606a);_0xbe6112(_0x18876d['error'](0x1f4,_0x5c3020['message']));});});};exports[_0x67ae('0x24')]=function(_0x2d2eb6){var _0x5696db=this;return new Promise(function(_0x503cc5,_0x416e23){return db['ChatQueue'][_0x67ae('0x25')]({'raw':_0x2d2eb6[_0x67ae('0x1d')]?_0x2d2eb6[_0x67ae('0x1d')][_0x67ae('0x1e')]===undefined?!![]:![]:!![],'where':_0x2d2eb6[_0x67ae('0x1d')]?_0x2d2eb6['options'][_0x67ae('0x26')]||null:null,'attributes':_0x2d2eb6[_0x67ae('0x1d')]?_0x2d2eb6[_0x67ae('0x1d')][_0x67ae('0x1f')]||null:null,'include':_0x2d2eb6[_0x67ae('0x1d')]?_0x2d2eb6[_0x67ae('0x1d')]['include']?_[_0x67ae('0x21')](_0x2d2eb6['options'][_0x67ae('0x22')],function(_0x1b655d){return{'model':db[_0x1b655d[_0x67ae('0x23')]],'as':_0x1b655d['as'],'attributes':_0x1b655d['attributes'],'include':_0x1b655d[_0x67ae('0x22')]?_[_0x67ae('0x21')](_0x1b655d[_0x67ae('0x22')],function(_0x23e758){return{'model':db[_0x23e758[_0x67ae('0x23')]],'as':_0x23e758['as'],'attributes':_0x23e758[_0x67ae('0x1f')],'include':_0x23e758[_0x67ae('0x22')]?_[_0x67ae('0x21')](_0x23e758['include'],function(_0x42ef2b){return{'model':db[_0x42ef2b['model']],'as':_0x42ef2b['as'],'attributes':_0x42ef2b[_0x67ae('0x1f')]};}):[]};}):[]};}):[]:[]})[_0x67ae('0x11')](function(_0x82ba8c){logger[_0x67ae('0x12')]('ShowChatQueue',_0x2d2eb6);logger['debug']('ShowChatQueue',_0x2d2eb6,JSON[_0x67ae('0x17')](_0x82ba8c));_0x503cc5(_0x82ba8c);})[_0x67ae('0x27')](function(_0x5f60c7){logger['error']('ShowChatQueue',_0x5f60c7[_0x67ae('0x1a')],_0x2d2eb6);_0x416e23(_0x5696db[_0x67ae('0x18')](0x1f4,_0x5f60c7[_0x67ae('0x1a')]));});});};
\ No newline at end of file
diff --git a/server/api/chatQueue/chatQueue.socket.js b/server/api/chatQueue/chatQueue.socket.js
index bde2cd4..0810613 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 _0xb332=['emit','register','./chatQueue.events','remove','update'];(function(_0x38eb23,_0x196e8b){var _0x48506a=function(_0x36edb0){while(--_0x36edb0){_0x38eb23['push'](_0x38eb23['shift']());}};_0x48506a(++_0x196e8b);}(_0xb332,0xd9));var _0x2b33=function(_0xfc406a,_0x4479e1){_0xfc406a=_0xfc406a-0x0;var _0x395473=_0xb332[_0xfc406a];return _0x395473;};'use strict';var ChatQueueEvents=require(_0x2b33('0x0'));var events=['save',_0x2b33('0x1'),_0x2b33('0x2')];function createListener(_0x5ee720,_0xf8c6a7){return function(_0x548a70){_0xf8c6a7[_0x2b33('0x3')](_0x5ee720,_0x548a70);};}function removeListener(_0x4c6634,_0x34b111){return function(){ChatQueueEvents['removeListener'](_0x4c6634,_0x34b111);};}exports[_0x2b33('0x4')]=function(_0x22d66){for(var _0x478214=0x0,_0x461d44=events['length'];_0x478214<_0x461d44;_0x478214++){var _0x5ccf2d=events[_0x478214];var _0x4302b7=createListener('chatQueue:'+_0x5ccf2d,_0x22d66);ChatQueueEvents['on'](_0x5ccf2d,_0x4302b7);}};
\ No newline at end of file
+var _0x0faf=['update','emit','removeListener','length','chatQueue:','./chatQueue.events','remove'];(function(_0x2288e9,_0x15e163){var _0x24bec9=function(_0xf4dd47){while(--_0xf4dd47){_0x2288e9['push'](_0x2288e9['shift']());}};_0x24bec9(++_0x15e163);}(_0x0faf,0x132));var _0xf0fa=function(_0x4ccf7f,_0x161ffd){_0x4ccf7f=_0x4ccf7f-0x0;var _0x1953f0=_0x0faf[_0x4ccf7f];return _0x1953f0;};'use strict';var ChatQueueEvents=require(_0xf0fa('0x0'));var events=['save',_0xf0fa('0x1'),_0xf0fa('0x2')];function createListener(_0x2c6207,_0x35a260){return function(_0xccb93e){_0x35a260[_0xf0fa('0x3')](_0x2c6207,_0xccb93e);};}function removeListener(_0x515b12,_0xc83253){return function(){ChatQueueEvents[_0xf0fa('0x4')](_0x515b12,_0xc83253);};}exports['register']=function(_0x3637a3){for(var _0x44ffa0=0x0,_0x25b5c4=events[_0xf0fa('0x5')];_0x44ffa0<_0x25b5c4;_0x44ffa0++){var _0x2db1d9=events[_0x44ffa0];var _0x587865=createListener(_0xf0fa('0x6')+_0x2db1d9,_0x3637a3);ChatQueueEvents['on'](_0x2db1d9,_0x587865);}};
\ No newline at end of file
diff --git a/server/api/chatQueue/index.js b/server/api/chatQueue/index.js
index eb8ebdf..93cf5f5 100644
--- a/server/api/chatQueue/index.js
+++ b/server/api/chatQueue/index.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x3e74=['../../config/environment','./chatQueue.controller','get','isAuthenticated','index','/describe','describe','/:id','show','getMembers','/:id/teams','getTeams','getAgents','post','addTeams','addAgents','put','delete','removeTeams','/:id/users','removeAgents','exports','multer','path','connect-timeout','express','../../components/auth/service'];(function(_0x2c91e9,_0x2fb965){var _0x13f0ff=function(_0xb39edf){while(--_0xb39edf){_0x2c91e9['push'](_0x2c91e9['shift']());}};_0x13f0ff(++_0x2fb965);}(_0x3e74,0x175));var _0x43e7=function(_0x514185,_0x43fdae){_0x514185=_0x514185-0x0;var _0x1dc129=_0x3e74[_0x514185];return _0x1dc129;};'use strict';var multer=require(_0x43e7('0x0'));var util=require('util');var path=require(_0x43e7('0x1'));var timeout=require(_0x43e7('0x2'));var express=require(_0x43e7('0x3'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0x43e7('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0x43e7('0x5'));var controller=require(_0x43e7('0x6'));router[_0x43e7('0x7')]('/',auth[_0x43e7('0x8')](),controller[_0x43e7('0x9')]);router['get'](_0x43e7('0xa'),auth[_0x43e7('0x8')](),controller[_0x43e7('0xb')]);router[_0x43e7('0x7')](_0x43e7('0xc'),auth['isAuthenticated'](),controller[_0x43e7('0xd')]);router['get']('/:id/members',auth[_0x43e7('0x8')](),controller[_0x43e7('0xe')]);router['get'](_0x43e7('0xf'),auth['isAuthenticated'](),controller[_0x43e7('0x10')]);router[_0x43e7('0x7')]('/:id/users',auth[_0x43e7('0x8')](),controller[_0x43e7('0x11')]);router[_0x43e7('0x12')]('/',auth[_0x43e7('0x8')](),controller['create']);router['post'](_0x43e7('0xf'),auth[_0x43e7('0x8')](),controller[_0x43e7('0x13')]);router['post']('/:id/users',auth[_0x43e7('0x8')](),controller[_0x43e7('0x14')]);router[_0x43e7('0x15')](_0x43e7('0xc'),auth['isAuthenticated'](),controller['update']);router[_0x43e7('0x16')](_0x43e7('0xc'),auth[_0x43e7('0x8')](),controller['destroy']);router['delete'](_0x43e7('0xf'),auth[_0x43e7('0x8')](),controller[_0x43e7('0x17')]);router[_0x43e7('0x16')](_0x43e7('0x18'),auth[_0x43e7('0x8')](),controller[_0x43e7('0x19')]);module[_0x43e7('0x1a')]=router;
\ No newline at end of file
+var _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(_0x12457c,_0x27e0d5){var _0x426147=function(_0x2bdda3){while(--_0x2bdda3){_0x12457c['push'](_0x12457c['shift']());}};_0x426147(++_0x27e0d5);}(_0x008c,0x188));var _0xc008=function(_0x44f315,_0x5a799f){_0x44f315=_0x44f315-0x0;var _0x20478e=_0x008c[_0x44f315];return _0x20478e;};'use strict';var multer=require(_0xc008('0x0'));var util=require(_0xc008('0x1'));var path=require(_0xc008('0x2'));var timeout=require(_0xc008('0x3'));var express=require(_0xc008('0x4'));var router=express['Router']();var fs_extra=require(_0xc008('0x5'));var auth=require(_0xc008('0x6'));var interaction=require(_0xc008('0x7'));var config=require(_0xc008('0x8'));var controller=require(_0xc008('0x9'));router[_0xc008('0xa')]('/',auth[_0xc008('0xb')](),controller[_0xc008('0xc')]);router[_0xc008('0xa')]('/describe',auth[_0xc008('0xb')](),controller['describe']);router[_0xc008('0xa')]('/:id',auth['isAuthenticated'](),controller[_0xc008('0xd')]);router[_0xc008('0xa')]('/:id/members',auth['isAuthenticated'](),controller['getMembers']);router[_0xc008('0xa')](_0xc008('0xe'),auth['isAuthenticated'](),controller[_0xc008('0xf')]);router[_0xc008('0xa')](_0xc008('0x10'),auth[_0xc008('0xb')](),controller[_0xc008('0x11')]);router[_0xc008('0x12')]('/',auth[_0xc008('0xb')](),controller['create']);router['post'](_0xc008('0xe'),auth['isAuthenticated'](),controller[_0xc008('0x13')]);router[_0xc008('0x12')](_0xc008('0x10'),auth[_0xc008('0xb')](),controller[_0xc008('0x14')]);router['put']('/:id',auth['isAuthenticated'](),controller[_0xc008('0x15')]);router[_0xc008('0x16')](_0xc008('0x17'),auth[_0xc008('0xb')](),controller['destroy']);router['delete']('/:id/teams',auth['isAuthenticated'](),controller[_0xc008('0x18')]);router[_0xc008('0x16')]('/:id/users',auth[_0xc008('0xb')](),controller['removeAgents']);module['exports']=router;
\ No newline at end of file
diff --git a/server/api/chatQueueReport/chatQueueReport.attributes.js b/server/api/chatQueueReport/chatQueueReport.attributes.js
index cc25ba6..0749344 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 _0xbb0d=['DATE','moment','sequelize','STRING'];(function(_0x20bc03,_0x209513){var _0x397bbe=function(_0x5dcfb3){while(--_0x5dcfb3){_0x20bc03['push'](_0x20bc03['shift']());}};_0x397bbe(++_0x209513);}(_0xbb0d,0x1ad));var _0xdbb0=function(_0x2dafa9,_0x5d5061){_0x2dafa9=_0x2dafa9-0x0;var _0x1b61ca=_0xbb0d[_0x2dafa9];return _0x1b61ca;};'use strict';var moment=require(_0xdbb0('0x0'));var Sequelize=require(_0xdbb0('0x1'));module['exports']={'uniqueid':{'type':Sequelize[_0xdbb0('0x2')],'allowNull':![]},'from':{'type':Sequelize[_0xdbb0('0x2')]},'joinAt':{'type':Sequelize[_0xdbb0('0x3')]},'leaveAt':{'type':Sequelize[_0xdbb0('0x3')]},'acceptAt':{'type':Sequelize[_0xdbb0('0x3')]},'exitAt':{'type':Sequelize[_0xdbb0('0x3')]},'reason':{'type':Sequelize[_0xdbb0('0x2')]}};
\ No newline at end of file
+var _0xb416=['sequelize','STRING','DATE','moment'];(function(_0x727b91,_0x56d897){var _0x423ea1=function(_0x223ba0){while(--_0x223ba0){_0x727b91['push'](_0x727b91['shift']());}};_0x423ea1(++_0x56d897);}(_0xb416,0x173));var _0x6b41=function(_0x422c48,_0x1f722e){_0x422c48=_0x422c48-0x0;var _0x51a366=_0xb416[_0x422c48];return _0x51a366;};'use strict';var moment=require(_0x6b41('0x0'));var Sequelize=require(_0x6b41('0x1'));module['exports']={'uniqueid':{'type':Sequelize[_0x6b41('0x2')],'allowNull':![]},'from':{'type':Sequelize[_0x6b41('0x2')]},'joinAt':{'type':Sequelize[_0x6b41('0x3')]},'leaveAt':{'type':Sequelize[_0x6b41('0x3')]},'acceptAt':{'type':Sequelize['DATE']},'exitAt':{'type':Sequelize[_0x6b41('0x3')]},'reason':{'type':Sequelize[_0x6b41('0x2')]}};
\ No newline at end of file
diff --git a/server/api/chatQueueReport/chatQueueReport.controller.js b/server/api/chatQueueReport/chatQueueReport.controller.js
index 2858ef3..511bd6c 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 _0x3595=['map','ChatQueueReport','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','nolimit','order','sort','pick','filter','where','merge','options','includeAll','include','findAll','rows','catch','params','create','body','describe','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','path','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','to-csv','querystring','papaparse','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','limit','undefined','count','offset','Content-Range','reject','update','then','destroy','error','stack','name','index'];(function(_0x143f31,_0x3f6c02){var _0x351ae4=function(_0x5698db){while(--_0x5698db){_0x143f31['push'](_0x143f31['shift']());}};_0x351ae4(++_0x3f6c02);}(_0x3595,0x147));var _0x5359=function(_0xb3279c,_0x5e67c5){_0xb3279c=_0xb3279c-0x0;var _0x1a5843=_0x3595[_0xb3279c];return _0x1a5843;};'use strict';var emlformat=require(_0x5359('0x0'));var rimraf=require(_0x5359('0x1'));var zipdir=require(_0x5359('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x5359('0x3'));var moment=require(_0x5359('0x4'));var BPromise=require(_0x5359('0x5'));var Mustache=require(_0x5359('0x6'));var util=require(_0x5359('0x7'));var path=require(_0x5359('0x8'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x5359('0x9'));var fs=require('fs');var fs_extra=require(_0x5359('0xa'));var _=require(_0x5359('0xb'));var squel=require(_0x5359('0xc'));var crypto=require(_0x5359('0xd'));var jsforce=require(_0x5359('0xe'));var deskjs=require(_0x5359('0xf'));var toCsv=require(_0x5359('0x10'));var querystring=require(_0x5359('0x11'));var Papa=require(_0x5359('0x12'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x5359('0x13'));var logger=require(_0x5359('0x14'))(_0x5359('0x15'));var utils=require(_0x5359('0x16'));var config=require(_0x5359('0x17'));var licenseUtil=require(_0x5359('0x18'));var db=require(_0x5359('0x19'))['db'];function respondWithStatusCode(_0x343282,_0xcf081){_0xcf081=_0xcf081||0xcc;return function(_0x2a42b1){if(_0x2a42b1){return _0x343282[_0x5359('0x1a')](_0xcf081);}return _0x343282[_0x5359('0x1b')](_0xcf081)[_0x5359('0x1c')]();};}function respondWithResult(_0xb1a895,_0x48099c){_0x48099c=_0x48099c||0xc8;return function(_0x51b3b7){if(_0x51b3b7){return _0xb1a895[_0x5359('0x1b')](_0x48099c)[_0x5359('0x1d')](_0x51b3b7);}};}function respondWithFilteredResult(_0x11d494,_0xa146f5){return function(_0xcdc03e){if(_0xcdc03e){var _0x44c489=typeof _0xa146f5['offset']==='undefined'&&typeof _0xa146f5[_0x5359('0x1e')]===_0x5359('0x1f');var _0x4de994=_0xcdc03e[_0x5359('0x20')];var _0x21184f=_0x44c489?0x0:_0xa146f5[_0x5359('0x21')];var _0x2d0962=_0x44c489?_0xcdc03e['count']:_0xa146f5['offset']+_0xa146f5['limit'];var _0x3f9d7b;if(_0x2d0962>=_0x4de994){_0x2d0962=_0x4de994;_0x3f9d7b=0xc8;}else{_0x3f9d7b=0xce;}_0x11d494[_0x5359('0x1b')](_0x3f9d7b);return _0x11d494['set'](_0x5359('0x22'),_0x21184f+'-'+_0x2d0962+'/'+_0x4de994)[_0x5359('0x1d')](_0xcdc03e);}return null;};}function patchUpdates(_0x45bf1c){return function(_0x41ab92){try{jsonpatch['apply'](_0x41ab92,_0x45bf1c,!![]);}catch(_0x5ad9fc){return BPromise[_0x5359('0x23')](_0x5ad9fc);}return _0x41ab92['save']();};}function saveUpdates(_0x21abeb,_0x27749e){return function(_0x3d3c0c){if(_0x3d3c0c){return _0x3d3c0c[_0x5359('0x24')](_0x21abeb)[_0x5359('0x25')](function(_0x51fc69){return _0x51fc69;});}return null;};}function removeEntity(_0x4a4667,_0x280392){return function(_0xc2eb10){if(_0xc2eb10){return _0xc2eb10[_0x5359('0x26')]()[_0x5359('0x25')](function(){_0x4a4667[_0x5359('0x1b')](0xcc)[_0x5359('0x1c')]();});}};}function handleEntityNotFound(_0x3b0d2f,_0x2771ea){return function(_0x3fea11){if(!_0x3fea11){_0x3b0d2f['sendStatus'](0x194);}return _0x3fea11;};}function handleError(_0x12052a,_0xbb59f4){_0xbb59f4=_0xbb59f4||0x1f4;return function(_0x23f192){logger[_0x5359('0x27')](_0x23f192[_0x5359('0x28')]);if(_0x23f192[_0x5359('0x29')]){delete _0x23f192['name'];}_0x12052a[_0x5359('0x1b')](_0xbb59f4)['send'](_0x23f192);};}exports[_0x5359('0x2a')]=function(_0x4b130a,_0x1d6810){var _0xdc839b={},_0x47cac5={},_0x9fc4a={'count':0x0,'rows':[]};var _0x5766e3=_[_0x5359('0x2b')](db[_0x5359('0x2c')][_0x5359('0x2d')],function(_0x10ae78){return{'name':_0x10ae78[_0x5359('0x2e')],'type':_0x10ae78[_0x5359('0x2f')][_0x5359('0x30')]};});_0x47cac5[_0x5359('0x31')]=_[_0x5359('0x2b')](_0x5766e3,_0x5359('0x29'));_0x47cac5[_0x5359('0x32')]=_[_0x5359('0x33')](_0x4b130a[_0x5359('0x32')]);_0x47cac5[_0x5359('0x34')]=_[_0x5359('0x35')](_0x47cac5[_0x5359('0x31')],_0x47cac5[_0x5359('0x32')]);_0xdc839b[_0x5359('0x36')]=_['intersection'](_0x47cac5[_0x5359('0x31')],qs[_0x5359('0x37')](_0x4b130a['query']['fields']));_0xdc839b[_0x5359('0x36')]=_0xdc839b[_0x5359('0x36')][_0x5359('0x38')]?_0xdc839b[_0x5359('0x36')]:_0x47cac5['model'];if(!_0x4b130a[_0x5359('0x32')]['hasOwnProperty'](_0x5359('0x39'))){_0xdc839b[_0x5359('0x1e')]=qs[_0x5359('0x1e')](_0x4b130a[_0x5359('0x32')][_0x5359('0x1e')]);_0xdc839b[_0x5359('0x21')]=qs[_0x5359('0x21')](_0x4b130a[_0x5359('0x32')][_0x5359('0x21')]);}_0xdc839b[_0x5359('0x3a')]=qs[_0x5359('0x3b')](_0x4b130a[_0x5359('0x32')]['sort']);_0xdc839b['where']=qs['filters'](_[_0x5359('0x3c')](_0x4b130a[_0x5359('0x32')],_0x47cac5['filters']),_0x5766e3);if(_0x4b130a['query'][_0x5359('0x3d')]){_0xdc839b[_0x5359('0x3e')]=_[_0x5359('0x3f')](_0xdc839b[_0x5359('0x3e')],{'$or':_[_0x5359('0x2b')](_0x5766e3,function(_0x19fd15){if(_0x19fd15['type']!=='VIRTUAL'){var _0x29f233={};_0x29f233[_0x19fd15[_0x5359('0x29')]]={'$like':'%'+_0x4b130a[_0x5359('0x32')][_0x5359('0x3d')]+'%'};return _0x29f233;}})});}_0xdc839b=_[_0x5359('0x3f')]({},_0xdc839b,_0x4b130a[_0x5359('0x40')]);var _0x1d6e43={'where':_0xdc839b[_0x5359('0x3e')]};return db['ChatQueueReport'][_0x5359('0x20')](_0x1d6e43)['then'](function(_0x48250b){_0x9fc4a[_0x5359('0x20')]=_0x48250b;if(_0x4b130a[_0x5359('0x32')][_0x5359('0x41')]){_0xdc839b[_0x5359('0x42')]=[{'all':!![]}];}return db[_0x5359('0x2c')][_0x5359('0x43')](_0xdc839b);})['then'](function(_0x2fbab1){_0x9fc4a[_0x5359('0x44')]=_0x2fbab1;return _0x9fc4a;})[_0x5359('0x25')](respondWithFilteredResult(_0x1d6810,_0xdc839b))[_0x5359('0x45')](handleError(_0x1d6810,null));};exports['show']=function(_0x1ea447,_0x514178){var _0x23dc72={'raw':!![],'where':{'id':_0x1ea447[_0x5359('0x46')]['id']}},_0x204cab={};_0x204cab[_0x5359('0x31')]=_[_0x5359('0x33')](db[_0x5359('0x2c')][_0x5359('0x2d')]);_0x204cab[_0x5359('0x32')]=_[_0x5359('0x33')](_0x1ea447[_0x5359('0x32')]);_0x204cab[_0x5359('0x34')]=_[_0x5359('0x35')](_0x204cab['model'],_0x204cab[_0x5359('0x32')]);_0x23dc72[_0x5359('0x36')]=_[_0x5359('0x35')](_0x204cab[_0x5359('0x31')],qs[_0x5359('0x37')](_0x1ea447[_0x5359('0x32')][_0x5359('0x37')]));_0x23dc72['attributes']=_0x23dc72[_0x5359('0x36')]['length']?_0x23dc72[_0x5359('0x36')]:_0x204cab[_0x5359('0x31')];if(_0x1ea447[_0x5359('0x32')][_0x5359('0x41')]){_0x23dc72[_0x5359('0x42')]=[{'all':!![]}];}_0x23dc72=_['merge']({},_0x23dc72,_0x1ea447[_0x5359('0x40')]);return db[_0x5359('0x2c')]['find'](_0x23dc72)[_0x5359('0x25')](handleEntityNotFound(_0x514178,null))[_0x5359('0x25')](respondWithResult(_0x514178,null))[_0x5359('0x45')](handleError(_0x514178,null));};exports[_0x5359('0x47')]=function(_0x488d17,_0x3fcb9f){return db[_0x5359('0x2c')][_0x5359('0x47')](_0x488d17[_0x5359('0x48')],{})[_0x5359('0x25')](respondWithResult(_0x3fcb9f,0xc9))[_0x5359('0x45')](handleError(_0x3fcb9f,null));};exports[_0x5359('0x24')]=function(_0x2a043e,_0x4a023c){if(_0x2a043e[_0x5359('0x48')]['id']){delete _0x2a043e[_0x5359('0x48')]['id'];}return db[_0x5359('0x2c')]['find']({'where':{'id':_0x2a043e[_0x5359('0x46')]['id']}})[_0x5359('0x25')](handleEntityNotFound(_0x4a023c,null))['then'](saveUpdates(_0x2a043e[_0x5359('0x48')],null))[_0x5359('0x25')](respondWithResult(_0x4a023c,null))[_0x5359('0x45')](handleError(_0x4a023c,null));};exports[_0x5359('0x26')]=function(_0x53aa10,_0x5803bd){return db[_0x5359('0x2c')]['find']({'where':{'id':_0x53aa10['params']['id']}})['then'](handleEntityNotFound(_0x5803bd,null))[_0x5359('0x25')](removeEntity(_0x5803bd,null))[_0x5359('0x45')](handleError(_0x5803bd,null));};exports[_0x5359('0x49')]=function(_0xdc7882,_0x213456){return db[_0x5359('0x2c')]['describe']()[_0x5359('0x25')](respondWithResult(_0x213456,null))['catch'](handleError(_0x213456,null));};
\ No newline at end of file
+var _0x02ca=['update','find','describe','eml-format','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','querystring','papaparse','ioredis','../../components/auth/service','api','../../config/utils','../../config/environment','../../config/license/util','sendStatus','end','status','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','then','destroy','error','stack','name','send','index','map','rawAttributes','fieldName','model','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','where','pick','filter','merge','type','options','include','ChatQueueReport','findAll','rows','catch','params','includeAll','create','body'];(function(_0x22b252,_0x2fa785){var _0x72a312=function(_0x399974){while(--_0x399974){_0x22b252['push'](_0x22b252['shift']());}};_0x72a312(++_0x2fa785);}(_0x02ca,0x97));var _0xa02c=function(_0x1537f6,_0x1cfcd2){_0x1537f6=_0x1537f6-0x0;var _0x4fcfb3=_0x02ca[_0x1537f6];return _0x4fcfb3;};'use strict';var emlformat=require(_0xa02c('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xa02c('0x1'));var jsonpatch=require(_0xa02c('0x2'));var rp=require(_0xa02c('0x3'));var moment=require(_0xa02c('0x4'));var BPromise=require('bluebird');var Mustache=require(_0xa02c('0x5'));var util=require(_0xa02c('0x6'));var path=require(_0xa02c('0x7'));var sox=require(_0xa02c('0x8'));var csv=require(_0xa02c('0x9'));var ejs=require(_0xa02c('0xa'));var fs=require('fs');var fs_extra=require(_0xa02c('0xb'));var _=require(_0xa02c('0xc'));var squel=require(_0xa02c('0xd'));var crypto=require(_0xa02c('0xe'));var jsforce=require(_0xa02c('0xf'));var deskjs=require('desk.js');var toCsv=require(_0xa02c('0x9'));var querystring=require(_0xa02c('0x10'));var Papa=require(_0xa02c('0x11'));var Redis=require(_0xa02c('0x12'));var authService=require(_0xa02c('0x13'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0xa02c('0x14'));var utils=require(_0xa02c('0x15'));var config=require(_0xa02c('0x16'));var licenseUtil=require(_0xa02c('0x17'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x456fd5,_0x3719d4){_0x3719d4=_0x3719d4||0xcc;return function(_0x9cb7ba){if(_0x9cb7ba){return _0x456fd5[_0xa02c('0x18')](_0x3719d4);}return _0x456fd5['status'](_0x3719d4)[_0xa02c('0x19')]();};}function respondWithResult(_0xefaee9,_0x3b24e5){_0x3b24e5=_0x3b24e5||0xc8;return function(_0x546729){if(_0x546729){return _0xefaee9[_0xa02c('0x1a')](_0x3b24e5)[_0xa02c('0x1b')](_0x546729);}};}function respondWithFilteredResult(_0x5eeece,_0x35f533){return function(_0x2a3604){if(_0x2a3604){var _0x4bc36d=typeof _0x35f533[_0xa02c('0x1c')]===_0xa02c('0x1d')&&typeof _0x35f533[_0xa02c('0x1e')]==='undefined';var _0x3c1bba=_0x2a3604['count'];var _0x4d7cb5=_0x4bc36d?0x0:_0x35f533['offset'];var _0x3fcc66=_0x4bc36d?_0x2a3604[_0xa02c('0x1f')]:_0x35f533[_0xa02c('0x1c')]+_0x35f533['limit'];var _0x12688a;if(_0x3fcc66>=_0x3c1bba){_0x3fcc66=_0x3c1bba;_0x12688a=0xc8;}else{_0x12688a=0xce;}_0x5eeece['status'](_0x12688a);return _0x5eeece[_0xa02c('0x20')](_0xa02c('0x21'),_0x4d7cb5+'-'+_0x3fcc66+'/'+_0x3c1bba)[_0xa02c('0x1b')](_0x2a3604);}return null;};}function patchUpdates(_0x476777){return function(_0x56406d){try{jsonpatch[_0xa02c('0x22')](_0x56406d,_0x476777,!![]);}catch(_0x4fb1db){return BPromise[_0xa02c('0x23')](_0x4fb1db);}return _0x56406d[_0xa02c('0x24')]();};}function saveUpdates(_0x45f7b0,_0x5b10b4){return function(_0x4787c7){if(_0x4787c7){return _0x4787c7['update'](_0x45f7b0)[_0xa02c('0x25')](function(_0x2ee242){return _0x2ee242;});}return null;};}function removeEntity(_0x2e4e9d,_0x514ef1){return function(_0x4ba050){if(_0x4ba050){return _0x4ba050[_0xa02c('0x26')]()[_0xa02c('0x25')](function(){_0x2e4e9d[_0xa02c('0x1a')](0xcc)[_0xa02c('0x19')]();});}};}function handleEntityNotFound(_0x437308,_0x58496c){return function(_0x4de358){if(!_0x4de358){_0x437308[_0xa02c('0x18')](0x194);}return _0x4de358;};}function handleError(_0x2277d2,_0x320a8d){_0x320a8d=_0x320a8d||0x1f4;return function(_0x39124e){logger[_0xa02c('0x27')](_0x39124e[_0xa02c('0x28')]);if(_0x39124e[_0xa02c('0x29')]){delete _0x39124e[_0xa02c('0x29')];}_0x2277d2['status'](_0x320a8d)[_0xa02c('0x2a')](_0x39124e);};}exports[_0xa02c('0x2b')]=function(_0x31b520,_0x67d524){var _0x267ab4={},_0x402f72={},_0x19f1c9={'count':0x0,'rows':[]};var _0x1dfc2c=_[_0xa02c('0x2c')](db['ChatQueueReport'][_0xa02c('0x2d')],function(_0xb9f91){return{'name':_0xb9f91[_0xa02c('0x2e')],'type':_0xb9f91['type']['key']};});_0x402f72[_0xa02c('0x2f')]=_[_0xa02c('0x2c')](_0x1dfc2c,_0xa02c('0x29'));_0x402f72[_0xa02c('0x30')]=_[_0xa02c('0x31')](_0x31b520[_0xa02c('0x30')]);_0x402f72[_0xa02c('0x32')]=_[_0xa02c('0x33')](_0x402f72[_0xa02c('0x2f')],_0x402f72[_0xa02c('0x30')]);_0x267ab4['attributes']=_['intersection'](_0x402f72[_0xa02c('0x2f')],qs[_0xa02c('0x34')](_0x31b520[_0xa02c('0x30')][_0xa02c('0x34')]));_0x267ab4[_0xa02c('0x35')]=_0x267ab4[_0xa02c('0x35')][_0xa02c('0x36')]?_0x267ab4[_0xa02c('0x35')]:_0x402f72[_0xa02c('0x2f')];if(!_0x31b520[_0xa02c('0x30')][_0xa02c('0x37')]('nolimit')){_0x267ab4[_0xa02c('0x1e')]=qs[_0xa02c('0x1e')](_0x31b520[_0xa02c('0x30')][_0xa02c('0x1e')]);_0x267ab4['offset']=qs['offset'](_0x31b520[_0xa02c('0x30')][_0xa02c('0x1c')]);}_0x267ab4['order']=qs['sort'](_0x31b520['query']['sort']);_0x267ab4[_0xa02c('0x38')]=qs[_0xa02c('0x32')](_[_0xa02c('0x39')](_0x31b520[_0xa02c('0x30')],_0x402f72['filters']),_0x1dfc2c);if(_0x31b520[_0xa02c('0x30')][_0xa02c('0x3a')]){_0x267ab4[_0xa02c('0x38')]=_[_0xa02c('0x3b')](_0x267ab4[_0xa02c('0x38')],{'$or':_[_0xa02c('0x2c')](_0x1dfc2c,function(_0x2ab794){if(_0x2ab794[_0xa02c('0x3c')]!=='VIRTUAL'){var _0x5b957b={};_0x5b957b[_0x2ab794[_0xa02c('0x29')]]={'$like':'%'+_0x31b520[_0xa02c('0x30')][_0xa02c('0x3a')]+'%'};return _0x5b957b;}})});}_0x267ab4=_[_0xa02c('0x3b')]({},_0x267ab4,_0x31b520[_0xa02c('0x3d')]);var _0x2a491b={'where':_0x267ab4[_0xa02c('0x38')]};return db['ChatQueueReport'][_0xa02c('0x1f')](_0x2a491b)[_0xa02c('0x25')](function(_0x33a9a3){_0x19f1c9[_0xa02c('0x1f')]=_0x33a9a3;if(_0x31b520['query']['includeAll']){_0x267ab4[_0xa02c('0x3e')]=[{'all':!![]}];}return db[_0xa02c('0x3f')][_0xa02c('0x40')](_0x267ab4);})['then'](function(_0x5d2ca0){_0x19f1c9[_0xa02c('0x41')]=_0x5d2ca0;return _0x19f1c9;})['then'](respondWithFilteredResult(_0x67d524,_0x267ab4))[_0xa02c('0x42')](handleError(_0x67d524,null));};exports['show']=function(_0x43b52a,_0x48996d){var _0x5ab62c={'raw':!![],'where':{'id':_0x43b52a[_0xa02c('0x43')]['id']}},_0x4a84c4={};_0x4a84c4['model']=_['keys'](db['ChatQueueReport'][_0xa02c('0x2d')]);_0x4a84c4['query']=_['keys'](_0x43b52a[_0xa02c('0x30')]);_0x4a84c4[_0xa02c('0x32')]=_[_0xa02c('0x33')](_0x4a84c4[_0xa02c('0x2f')],_0x4a84c4[_0xa02c('0x30')]);_0x5ab62c['attributes']=_[_0xa02c('0x33')](_0x4a84c4[_0xa02c('0x2f')],qs[_0xa02c('0x34')](_0x43b52a[_0xa02c('0x30')]['fields']));_0x5ab62c[_0xa02c('0x35')]=_0x5ab62c[_0xa02c('0x35')][_0xa02c('0x36')]?_0x5ab62c[_0xa02c('0x35')]:_0x4a84c4['model'];if(_0x43b52a[_0xa02c('0x30')][_0xa02c('0x44')]){_0x5ab62c['include']=[{'all':!![]}];}_0x5ab62c=_[_0xa02c('0x3b')]({},_0x5ab62c,_0x43b52a[_0xa02c('0x3d')]);return db[_0xa02c('0x3f')]['find'](_0x5ab62c)[_0xa02c('0x25')](handleEntityNotFound(_0x48996d,null))[_0xa02c('0x25')](respondWithResult(_0x48996d,null))[_0xa02c('0x42')](handleError(_0x48996d,null));};exports[_0xa02c('0x45')]=function(_0x282f1e,_0x4f11b2){return db['ChatQueueReport'][_0xa02c('0x45')](_0x282f1e[_0xa02c('0x46')],{})[_0xa02c('0x25')](respondWithResult(_0x4f11b2,0xc9))[_0xa02c('0x42')](handleError(_0x4f11b2,null));};exports[_0xa02c('0x47')]=function(_0x128a87,_0x538df7){if(_0x128a87[_0xa02c('0x46')]['id']){delete _0x128a87[_0xa02c('0x46')]['id'];}return db[_0xa02c('0x3f')][_0xa02c('0x48')]({'where':{'id':_0x128a87[_0xa02c('0x43')]['id']}})[_0xa02c('0x25')](handleEntityNotFound(_0x538df7,null))['then'](saveUpdates(_0x128a87['body'],null))['then'](respondWithResult(_0x538df7,null))[_0xa02c('0x42')](handleError(_0x538df7,null));};exports['destroy']=function(_0x115c9f,_0x1cae2a){return db[_0xa02c('0x3f')][_0xa02c('0x48')]({'where':{'id':_0x115c9f[_0xa02c('0x43')]['id']}})[_0xa02c('0x25')](handleEntityNotFound(_0x1cae2a,null))[_0xa02c('0x25')](removeEntity(_0x1cae2a,null))['catch'](handleError(_0x1cae2a,null));};exports[_0xa02c('0x49')]=function(_0x59d77f,_0x57a1a0){return db['ChatQueueReport'][_0xa02c('0x49')]()['then'](respondWithResult(_0x57a1a0,null))[_0xa02c('0x42')](handleError(_0x57a1a0,null));};
\ No newline at end of file
diff --git a/server/api/chatQueueReport/chatQueueReport.model.js b/server/api/chatQueueReport/chatQueueReport.model.js
index 90abe7c..d9f2809 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(_0x2d48dc,_0xaea7f7){var _0x4a9f1c=function(_0x5c6679){while(--_0x5c6679){_0x2d48dc['push'](_0x2d48dc['shift']());}};_0x4a9f1c(++_0xaea7f7);}(_0x757a,0xde));var _0xa757=function(_0x19ebf1,_0xe31b48){_0x19ebf1=_0x19ebf1-0x0;var _0x4091d1=_0x757a[_0x19ebf1];return _0x4091d1;};'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 _0x0713=['../../config/logger','api','moment','bluebird','request-promise','rimraf','../../config/environment','./chatQueueReport.attributes','exports','define','ChatQueueReport','report_chat_queue','uniqueid'];(function(_0x5c883f,_0x38f092){var _0x4210cc=function(_0x51be71){while(--_0x51be71){_0x5c883f['push'](_0x5c883f['shift']());}};_0x4210cc(++_0x38f092);}(_0x0713,0x1ba));var _0x3071=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x0713[_0x3dd15e];return _0x231fd0;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x3071('0x0'))(_0x3071('0x1'));var moment=require(_0x3071('0x2'));var BPromise=require(_0x3071('0x3'));var rp=require(_0x3071('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x3071('0x5'));var config=require(_0x3071('0x6'));var attributes=require(_0x3071('0x7'));module[_0x3071('0x8')]=function(_0xabd7b6,_0x41cf76){return _0xabd7b6[_0x3071('0x9')](_0x3071('0xa'),attributes,{'tableName':_0x3071('0xb'),'paranoid':![],'indexes':[{'name':_0x3071('0xc'),'fields':[_0x3071('0xc')]}],'timestamps':!![]});};
\ No newline at end of file
diff --git a/server/api/chatQueueReport/chatQueueReport.rpc.js b/server/api/chatQueueReport/chatQueueReport.rpc.js
index b8608b2..069b43d 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 _0x6867=['where','attributes','limit','UpdateChatQueueReport','catch','util','moment','ioredis','../../mysqldb','../../config/environment','then','info','ChatQueueReport,\x20%s,\x20%s','ChatQueueReport,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','CreateChatQueueReport','create','body','options','debug','ChatQueueReport','raw'];(function(_0x15d096,_0x3ef81c){var _0x491ec1=function(_0x52d031){while(--_0x52d031){_0x15d096['push'](_0x15d096['shift']());}};_0x491ec1(++_0x3ef81c);}(_0x6867,0x1b5));var _0x7686=function(_0x58ba62,_0x252d9f){_0x58ba62=_0x58ba62-0x0;var _0x57628f=_0x6867[_0x58ba62];return _0x57628f;};'use strict';var _=require('lodash');var util=require(_0x7686('0x0'));var moment=require(_0x7686('0x1'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x7686('0x2'));var db=require(_0x7686('0x3'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')('rpc');var config=require(_0x7686('0x4'));var jayson=require('jayson/promise');var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x5154a5,_0x59cfd2,_0x384635){return new BPromise(function(_0xda8e36,_0x44ccf3){return client['request'](_0x5154a5,_0x384635)[_0x7686('0x5')](function(_0x1232fc){logger[_0x7686('0x6')](_0x7686('0x7'),_0x59cfd2,'request\x20sent');logger['debug'](_0x7686('0x8'),_0x59cfd2,_0x7686('0x9'),JSON[_0x7686('0xa')](_0x1232fc));if(_0x1232fc[_0x7686('0xb')]){if(_0x1232fc[_0x7686('0xb')][_0x7686('0xc')]===0x1f4){logger[_0x7686('0xb')](_0x7686('0x7'),_0x59cfd2,_0x1232fc[_0x7686('0xb')][_0x7686('0xd')]);return _0x44ccf3(_0x1232fc[_0x7686('0xb')][_0x7686('0xd')]);}logger['error'](_0x7686('0x7'),_0x59cfd2,_0x1232fc[_0x7686('0xb')][_0x7686('0xd')]);return _0xda8e36(_0x1232fc[_0x7686('0xb')][_0x7686('0xd')]);}else{logger['info'](_0x7686('0x7'),_0x59cfd2,_0x7686('0x9'));_0xda8e36(_0x1232fc[_0x7686('0xe')]['message']);}})['catch'](function(_0x43e73e){logger['error'](_0x7686('0x7'),_0x59cfd2,_0x43e73e);_0x44ccf3(_0x43e73e);});});}exports[_0x7686('0xf')]=function(_0x9bfe17){var _0x4dac0e=this;return new Promise(function(_0x99fc16,_0x3545b6){return db['ChatQueueReport'][_0x7686('0x10')](_0x9bfe17[_0x7686('0x11')],{'raw':_0x9bfe17[_0x7686('0x12')]?_0x9bfe17[_0x7686('0x12')]['raw']===undefined?!![]:![]:!![]})[_0x7686('0x5')](function(_0xd095a6){logger[_0x7686('0x6')](_0x7686('0xf'),_0x9bfe17);logger[_0x7686('0x13')](_0x7686('0xf'),_0x9bfe17,JSON[_0x7686('0xa')](_0xd095a6));_0x99fc16(_0xd095a6);})['catch'](function(_0x22c796){logger[_0x7686('0xb')](_0x7686('0xf'),_0x22c796[_0x7686('0xd')],_0x9bfe17);_0x3545b6(_0x4dac0e[_0x7686('0xb')](0x1f4,_0x22c796[_0x7686('0xd')]));});});};exports['UpdateChatQueueReport']=function(_0x2eb790){var _0x2eb7eb=this;return new Promise(function(_0x4fb463,_0x20b036){return db[_0x7686('0x14')]['update'](_0x2eb790[_0x7686('0x11')],{'raw':_0x2eb790[_0x7686('0x12')]?_0x2eb790['options'][_0x7686('0x15')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x2eb790[_0x7686('0x12')]?_0x2eb790['options'][_0x7686('0x16')]||null:null,'attributes':_0x2eb790['options']?_0x2eb790[_0x7686('0x12')][_0x7686('0x17')]||null:null,'limit':_0x2eb790[_0x7686('0x12')]?_0x2eb790[_0x7686('0x12')][_0x7686('0x18')]||null:null})[_0x7686('0x5')](function(_0xbd948a){logger[_0x7686('0x6')]('UpdateChatQueueReport',_0x2eb790);logger[_0x7686('0x13')](_0x7686('0x19'),_0x2eb790,JSON['stringify'](_0xbd948a));_0x4fb463(_0xbd948a);})[_0x7686('0x1a')](function(_0x24320c){logger[_0x7686('0xb')](_0x7686('0x19'),_0x24320c['message'],_0x2eb790);_0x20b036(_0x2eb7eb[_0x7686('0xb')](0x1f4,_0x24320c['message']));});});};
\ No newline at end of file
+var _0x467a=['raw','where','attributes','limit','lodash','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/environment','client','request','info','debug','ChatQueueReport,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','ChatQueueReport,\x20%s,\x20%s','message','result','catch','ChatQueueReport','create','body','options','then','CreateChatQueueReport','UpdateChatQueueReport','update'];(function(_0x21dd3e,_0x31afc5){var _0x281451=function(_0x55707e){while(--_0x55707e){_0x21dd3e['push'](_0x21dd3e['shift']());}};_0x281451(++_0x31afc5);}(_0x467a,0x124));var _0xa467=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x467a[_0x14add3];return _0x4a174f;};'use strict';var _=require(_0xa467('0x0'));var util=require('util');var moment=require(_0xa467('0x1'));var BPromise=require(_0xa467('0x2'));var rs=require(_0xa467('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xa467('0x4'))['db'];var utils=require(_0xa467('0x5'));var logger=require('../../config/logger')('rpc');var config=require(_0xa467('0x6'));var jayson=require('jayson/promise');var client=jayson[_0xa467('0x7')]['http']({'port':0x232a});function respondWithRpcPromise(_0x2258bf,_0x52c0ad,_0xca8d9){return new BPromise(function(_0x34dc84,_0x19964f){return client[_0xa467('0x8')](_0x2258bf,_0xca8d9)['then'](function(_0x4bc5ef){logger[_0xa467('0x9')]('ChatQueueReport,\x20%s,\x20%s',_0x52c0ad,'request\x20sent');logger[_0xa467('0xa')](_0xa467('0xb'),_0x52c0ad,_0xa467('0xc'),JSON[_0xa467('0xd')](_0x4bc5ef));if(_0x4bc5ef[_0xa467('0xe')]){if(_0x4bc5ef['error'][_0xa467('0xf')]===0x1f4){logger[_0xa467('0xe')](_0xa467('0x10'),_0x52c0ad,_0x4bc5ef[_0xa467('0xe')]['message']);return _0x19964f(_0x4bc5ef[_0xa467('0xe')][_0xa467('0x11')]);}logger[_0xa467('0xe')](_0xa467('0x10'),_0x52c0ad,_0x4bc5ef[_0xa467('0xe')]['message']);return _0x34dc84(_0x4bc5ef[_0xa467('0xe')][_0xa467('0x11')]);}else{logger[_0xa467('0x9')]('ChatQueueReport,\x20%s,\x20%s',_0x52c0ad,_0xa467('0xc'));_0x34dc84(_0x4bc5ef[_0xa467('0x12')]['message']);}})[_0xa467('0x13')](function(_0x48599b){logger[_0xa467('0xe')](_0xa467('0x10'),_0x52c0ad,_0x48599b);_0x19964f(_0x48599b);});});}exports['CreateChatQueueReport']=function(_0x44965e){var _0x15730b=this;return new Promise(function(_0x49db82,_0x141344){return db[_0xa467('0x14')][_0xa467('0x15')](_0x44965e[_0xa467('0x16')],{'raw':_0x44965e['options']?_0x44965e[_0xa467('0x17')]['raw']===undefined?!![]:![]:!![]})[_0xa467('0x18')](function(_0x2c0f26){logger[_0xa467('0x9')](_0xa467('0x19'),_0x44965e);logger[_0xa467('0xa')](_0xa467('0x19'),_0x44965e,JSON[_0xa467('0xd')](_0x2c0f26));_0x49db82(_0x2c0f26);})[_0xa467('0x13')](function(_0x309889){logger[_0xa467('0xe')](_0xa467('0x19'),_0x309889[_0xa467('0x11')],_0x44965e);_0x141344(_0x15730b['error'](0x1f4,_0x309889[_0xa467('0x11')]));});});};exports[_0xa467('0x1a')]=function(_0x2c1804){var _0x1e00d0=this;return new Promise(function(_0x364f7f,_0x20a9c9){return db[_0xa467('0x14')][_0xa467('0x1b')](_0x2c1804[_0xa467('0x16')],{'raw':_0x2c1804['options']?_0x2c1804['options'][_0xa467('0x1c')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x2c1804['options']?_0x2c1804[_0xa467('0x17')][_0xa467('0x1d')]||null:null,'attributes':_0x2c1804['options']?_0x2c1804[_0xa467('0x17')][_0xa467('0x1e')]||null:null,'limit':_0x2c1804[_0xa467('0x17')]?_0x2c1804[_0xa467('0x17')][_0xa467('0x1f')]||null:null})[_0xa467('0x18')](function(_0xe2301e){logger['info'](_0xa467('0x1a'),_0x2c1804);logger[_0xa467('0xa')](_0xa467('0x1a'),_0x2c1804,JSON[_0xa467('0xd')](_0xe2301e));_0x364f7f(_0xe2301e);})[_0xa467('0x13')](function(_0x20872d){logger[_0xa467('0xe')](_0xa467('0x1a'),_0x20872d[_0xa467('0x11')],_0x2c1804);_0x20a9c9(_0x1e00d0[_0xa467('0xe')](0x1f4,_0x20872d['message']));});});};
\ No newline at end of file
diff --git a/server/api/chatQueueReport/index.js b/server/api/chatQueueReport/index.js
index 83a8066..7ffdf9c 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 _0x8b72=['destroy','exports','multer','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/describe','describe','/:id','show','create','put','delete'];(function(_0x2f6950,_0x317c38){var _0x57728c=function(_0x2a9672){while(--_0x2a9672){_0x2f6950['push'](_0x2f6950['shift']());}};_0x57728c(++_0x317c38);}(_0x8b72,0x1a6));var _0x28b7=function(_0x1ef9ed,_0x5d0e59){_0x1ef9ed=_0x1ef9ed-0x0;var _0x2eec97=_0x8b72[_0x1ef9ed];return _0x2eec97;};'use strict';var multer=require(_0x28b7('0x0'));var util=require(_0x28b7('0x1'));var path=require(_0x28b7('0x2'));var timeout=require(_0x28b7('0x3'));var express=require('express');var router=express[_0x28b7('0x4')]();var fs_extra=require(_0x28b7('0x5'));var auth=require(_0x28b7('0x6'));var interaction=require(_0x28b7('0x7'));var config=require(_0x28b7('0x8'));var controller=require('./chatQueueReport.controller');router[_0x28b7('0x9')]('/',auth[_0x28b7('0xa')](),controller[_0x28b7('0xb')]);router[_0x28b7('0x9')](_0x28b7('0xc'),auth[_0x28b7('0xa')](),controller[_0x28b7('0xd')]);router[_0x28b7('0x9')](_0x28b7('0xe'),auth[_0x28b7('0xa')](),controller[_0x28b7('0xf')]);router['post']('/',auth[_0x28b7('0xa')](),controller[_0x28b7('0x10')]);router[_0x28b7('0x11')](_0x28b7('0xe'),auth[_0x28b7('0xa')](),controller['update']);router[_0x28b7('0x12')](_0x28b7('0xe'),auth[_0x28b7('0xa')](),controller[_0x28b7('0x13')]);module[_0x28b7('0x14')]=router;
\ No newline at end of file
+var _0xf882=['update','delete','destroy','exports','util','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatQueueReport.controller','get','isAuthenticated','index','/describe','describe','post','create','put','/:id'];(function(_0x4a1883,_0x437f8e){var _0x32e815=function(_0x5e33a3){while(--_0x5e33a3){_0x4a1883['push'](_0x4a1883['shift']());}};_0x32e815(++_0x437f8e);}(_0xf882,0x138));var _0x2f88=function(_0x41df00,_0x2125b7){_0x41df00=_0x41df00-0x0;var _0x4e6378=_0xf882[_0x41df00];return _0x4e6378;};'use strict';var multer=require('multer');var util=require(_0x2f88('0x0'));var path=require('path');var timeout=require(_0x2f88('0x1'));var express=require(_0x2f88('0x2'));var router=express[_0x2f88('0x3')]();var fs_extra=require(_0x2f88('0x4'));var auth=require(_0x2f88('0x5'));var interaction=require(_0x2f88('0x6'));var config=require(_0x2f88('0x7'));var controller=require(_0x2f88('0x8'));router[_0x2f88('0x9')]('/',auth[_0x2f88('0xa')](),controller[_0x2f88('0xb')]);router[_0x2f88('0x9')](_0x2f88('0xc'),auth[_0x2f88('0xa')](),controller[_0x2f88('0xd')]);router[_0x2f88('0x9')]('/:id',auth[_0x2f88('0xa')](),controller['show']);router[_0x2f88('0xe')]('/',auth[_0x2f88('0xa')](),controller[_0x2f88('0xf')]);router[_0x2f88('0x10')](_0x2f88('0x11'),auth['isAuthenticated'](),controller[_0x2f88('0x12')]);router[_0x2f88('0x13')](_0x2f88('0x11'),auth[_0x2f88('0xa')](),controller[_0x2f88('0x14')]);module[_0x2f88('0x15')]=router;
\ No newline at end of file
diff --git a/server/api/chatTransferReport/chatTransferReport.attributes.js b/server/api/chatTransferReport/chatTransferReport.attributes.js
index 3d85f2f..1cac293 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 _0x008c=['ENUM','agent','queue','DATE','NOW','moment','sequelize','exports','STRING'];(function(_0x5b93f8,_0xffefcd){var _0x1430ec=function(_0xee6cc1){while(--_0xee6cc1){_0x5b93f8['push'](_0x5b93f8['shift']());}};_0x1430ec(++_0xffefcd);}(_0x008c,0x188));var _0xc008=function(_0x3df822,_0x299495){_0x3df822=_0x3df822-0x0;var _0x4e457d=_0x008c[_0x3df822];return _0x4e457d;};'use strict';var moment=require(_0xc008('0x0'));var Sequelize=require(_0xc008('0x1'));module[_0xc008('0x2')]={'uniqueid':{'type':Sequelize[_0xc008('0x3')],'allowNull':![]},'type':{'type':Sequelize[_0xc008('0x4')]('account',_0xc008('0x5'),_0xc008('0x6')),'allowNull':![],'defaultValue':_0xc008('0x6')},'transferredAt':{'type':Sequelize[_0xc008('0x7')],'allowNull':![],'defaultValue':Sequelize[_0xc008('0x8')]}};
\ No newline at end of file
+var _0xf4eb=['NOW','moment','account','queue','DATE'];(function(_0x284fd3,_0x21eb0d){var _0x3ad39b=function(_0xcb1752){while(--_0xcb1752){_0x284fd3['push'](_0x284fd3['shift']());}};_0x3ad39b(++_0x21eb0d);}(_0xf4eb,0xec));var _0xbf4e=function(_0x586867,_0x20cdbd){_0x586867=_0x586867-0x0;var _0x1c2237=_0xf4eb[_0x586867];return _0x1c2237;};'use strict';var moment=require(_0xbf4e('0x0'));var Sequelize=require('sequelize');module['exports']={'uniqueid':{'type':Sequelize['STRING'],'allowNull':![]},'type':{'type':Sequelize['ENUM'](_0xbf4e('0x1'),'agent','queue'),'allowNull':![],'defaultValue':_0xbf4e('0x2')},'transferredAt':{'type':Sequelize[_0xbf4e('0x3')],'allowNull':![],'defaultValue':Sequelize[_0xbf4e('0x4')]}};
\ No newline at end of file
diff --git a/server/api/chatTransferReport/chatTransferReport.controller.js b/server/api/chatTransferReport/chatTransferReport.controller.js
index d8df5cf..7f660de 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 _0x758b=['api','../../config/utils','../../config/environment','../../config/license/util','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','then','destroy','error','name','send','map','ChatTransferReport','rawAttributes','fieldName','type','key','model','keys','query','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','pick','filter','where','merge','VIRTUAL','findAll','rows','catch','params','length','includeAll','include','options','find','create','body','update','describe','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger'];(function(_0xfaf19d,_0x57304b){var _0x14a9d9=function(_0x5337fc){while(--_0x5337fc){_0xfaf19d['push'](_0xfaf19d['shift']());}};_0x14a9d9(++_0x57304b);}(_0x758b,0x1c4));var _0xb758=function(_0x36bfe3,_0x358938){_0x36bfe3=_0x36bfe3-0x0;var _0x9b0436=_0x758b[_0x36bfe3];return _0x9b0436;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xb758('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0xb758('0x1'));var rp=require(_0xb758('0x2'));var moment=require(_0xb758('0x3'));var BPromise=require(_0xb758('0x4'));var Mustache=require(_0xb758('0x5'));var util=require(_0xb758('0x6'));var path=require(_0xb758('0x7'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0xb758('0x8'));var fs=require('fs');var fs_extra=require(_0xb758('0x9'));var _=require(_0xb758('0xa'));var squel=require(_0xb758('0xb'));var crypto=require(_0xb758('0xc'));var jsforce=require(_0xb758('0xd'));var deskjs=require(_0xb758('0xe'));var toCsv=require(_0xb758('0xf'));var querystring=require(_0xb758('0x10'));var Papa=require(_0xb758('0x11'));var Redis=require(_0xb758('0x12'));var authService=require('../../components/auth/service');var qs=require(_0xb758('0x13'));var as=require(_0xb758('0x14'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xb758('0x15'))(_0xb758('0x16'));var utils=require(_0xb758('0x17'));var config=require(_0xb758('0x18'));var licenseUtil=require(_0xb758('0x19'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x28c8e7,_0x144f6d){_0x144f6d=_0x144f6d||0xcc;return function(_0x513751){if(_0x513751){return _0x28c8e7[_0xb758('0x1a')](_0x144f6d);}return _0x28c8e7[_0xb758('0x1b')](_0x144f6d)[_0xb758('0x1c')]();};}function respondWithResult(_0x3ac008,_0x4f326a){_0x4f326a=_0x4f326a||0xc8;return function(_0x62a8dd){if(_0x62a8dd){return _0x3ac008[_0xb758('0x1b')](_0x4f326a)[_0xb758('0x1d')](_0x62a8dd);}};}function respondWithFilteredResult(_0xfc25b8,_0x72f92e){return function(_0x4db7e2){if(_0x4db7e2){var _0x2414bf=typeof _0x72f92e[_0xb758('0x1e')]===_0xb758('0x1f')&&typeof _0x72f92e[_0xb758('0x20')]===_0xb758('0x1f');var _0x4272ba=_0x4db7e2[_0xb758('0x21')];var _0x3fa3e4=_0x2414bf?0x0:_0x72f92e[_0xb758('0x1e')];var _0x3d2e61=_0x2414bf?_0x4db7e2[_0xb758('0x21')]:_0x72f92e[_0xb758('0x1e')]+_0x72f92e['limit'];var _0x428bd7;if(_0x3d2e61>=_0x4272ba){_0x3d2e61=_0x4272ba;_0x428bd7=0xc8;}else{_0x428bd7=0xce;}_0xfc25b8[_0xb758('0x1b')](_0x428bd7);return _0xfc25b8[_0xb758('0x22')](_0xb758('0x23'),_0x3fa3e4+'-'+_0x3d2e61+'/'+_0x4272ba)[_0xb758('0x1d')](_0x4db7e2);}return null;};}function patchUpdates(_0xb55f36){return function(_0x33bf4f){try{jsonpatch[_0xb758('0x24')](_0x33bf4f,_0xb55f36,!![]);}catch(_0x492fe9){return BPromise[_0xb758('0x25')](_0x492fe9);}return _0x33bf4f[_0xb758('0x26')]();};}function saveUpdates(_0x3bc521,_0x28b178){return function(_0x19c2e5){if(_0x19c2e5){return _0x19c2e5['update'](_0x3bc521)[_0xb758('0x27')](function(_0x504a0b){return _0x504a0b;});}return null;};}function removeEntity(_0x42b4e6,_0x28f00d){return function(_0x4e01d3){if(_0x4e01d3){return _0x4e01d3[_0xb758('0x28')]()[_0xb758('0x27')](function(){_0x42b4e6[_0xb758('0x1b')](0xcc)[_0xb758('0x1c')]();});}};}function handleEntityNotFound(_0x216df3,_0x339512){return function(_0x4c4e6b){if(!_0x4c4e6b){_0x216df3['sendStatus'](0x194);}return _0x4c4e6b;};}function handleError(_0x33f1e5,_0x4f1903){_0x4f1903=_0x4f1903||0x1f4;return function(_0x102919){logger[_0xb758('0x29')](_0x102919['stack']);if(_0x102919[_0xb758('0x2a')]){delete _0x102919[_0xb758('0x2a')];}_0x33f1e5[_0xb758('0x1b')](_0x4f1903)[_0xb758('0x2b')](_0x102919);};}exports['index']=function(_0x32cc04,_0x42f3b6){var _0x1c1683={},_0x168dd2={},_0x3f4e67={'count':0x0,'rows':[]};var _0x30b11a=_[_0xb758('0x2c')](db[_0xb758('0x2d')][_0xb758('0x2e')],function(_0x5673c9){return{'name':_0x5673c9[_0xb758('0x2f')],'type':_0x5673c9[_0xb758('0x30')][_0xb758('0x31')]};});_0x168dd2[_0xb758('0x32')]=_[_0xb758('0x2c')](_0x30b11a,_0xb758('0x2a'));_0x168dd2['query']=_[_0xb758('0x33')](_0x32cc04[_0xb758('0x34')]);_0x168dd2[_0xb758('0x35')]=_[_0xb758('0x36')](_0x168dd2[_0xb758('0x32')],_0x168dd2[_0xb758('0x34')]);_0x1c1683[_0xb758('0x37')]=_[_0xb758('0x36')](_0x168dd2[_0xb758('0x32')],qs['fields'](_0x32cc04[_0xb758('0x34')][_0xb758('0x38')]));_0x1c1683[_0xb758('0x37')]=_0x1c1683[_0xb758('0x37')]['length']?_0x1c1683[_0xb758('0x37')]:_0x168dd2[_0xb758('0x32')];if(!_0x32cc04[_0xb758('0x34')][_0xb758('0x39')](_0xb758('0x3a'))){_0x1c1683[_0xb758('0x20')]=qs['limit'](_0x32cc04[_0xb758('0x34')][_0xb758('0x20')]);_0x1c1683[_0xb758('0x1e')]=qs[_0xb758('0x1e')](_0x32cc04[_0xb758('0x34')][_0xb758('0x1e')]);}_0x1c1683[_0xb758('0x3b')]=qs[_0xb758('0x3c')](_0x32cc04[_0xb758('0x34')][_0xb758('0x3c')]);_0x1c1683['where']=qs[_0xb758('0x35')](_[_0xb758('0x3d')](_0x32cc04['query'],_0x168dd2[_0xb758('0x35')]),_0x30b11a);if(_0x32cc04[_0xb758('0x34')][_0xb758('0x3e')]){_0x1c1683[_0xb758('0x3f')]=_[_0xb758('0x40')](_0x1c1683[_0xb758('0x3f')],{'$or':_['map'](_0x30b11a,function(_0x5d2eae){if(_0x5d2eae[_0xb758('0x30')]!==_0xb758('0x41')){var _0x2a4adc={};_0x2a4adc[_0x5d2eae[_0xb758('0x2a')]]={'$like':'%'+_0x32cc04[_0xb758('0x34')][_0xb758('0x3e')]+'%'};return _0x2a4adc;}})});}_0x1c1683=_[_0xb758('0x40')]({},_0x1c1683,_0x32cc04['options']);var _0xe7b598={'where':_0x1c1683['where']};return db[_0xb758('0x2d')][_0xb758('0x21')](_0xe7b598)[_0xb758('0x27')](function(_0x3f1da2){_0x3f4e67[_0xb758('0x21')]=_0x3f1da2;if(_0x32cc04[_0xb758('0x34')]['includeAll']){_0x1c1683['include']=[{'all':!![]}];}return db['ChatTransferReport'][_0xb758('0x42')](_0x1c1683);})[_0xb758('0x27')](function(_0x542913){_0x3f4e67[_0xb758('0x43')]=_0x542913;return _0x3f4e67;})[_0xb758('0x27')](respondWithFilteredResult(_0x42f3b6,_0x1c1683))[_0xb758('0x44')](handleError(_0x42f3b6,null));};exports['show']=function(_0x39e324,_0x28ce7){var _0x43509c={'raw':!![],'where':{'id':_0x39e324[_0xb758('0x45')]['id']}},_0x326516={};_0x326516['model']=_['keys'](db[_0xb758('0x2d')][_0xb758('0x2e')]);_0x326516[_0xb758('0x34')]=_[_0xb758('0x33')](_0x39e324[_0xb758('0x34')]);_0x326516['filters']=_[_0xb758('0x36')](_0x326516[_0xb758('0x32')],_0x326516[_0xb758('0x34')]);_0x43509c[_0xb758('0x37')]=_[_0xb758('0x36')](_0x326516[_0xb758('0x32')],qs[_0xb758('0x38')](_0x39e324[_0xb758('0x34')]['fields']));_0x43509c['attributes']=_0x43509c[_0xb758('0x37')][_0xb758('0x46')]?_0x43509c[_0xb758('0x37')]:_0x326516[_0xb758('0x32')];if(_0x39e324['query'][_0xb758('0x47')]){_0x43509c[_0xb758('0x48')]=[{'all':!![]}];}_0x43509c=_[_0xb758('0x40')]({},_0x43509c,_0x39e324[_0xb758('0x49')]);return db['ChatTransferReport'][_0xb758('0x4a')](_0x43509c)[_0xb758('0x27')](handleEntityNotFound(_0x28ce7,null))[_0xb758('0x27')](respondWithResult(_0x28ce7,null))['catch'](handleError(_0x28ce7,null));};exports[_0xb758('0x4b')]=function(_0x2287d4,_0x5d8a72){return db[_0xb758('0x2d')]['create'](_0x2287d4[_0xb758('0x4c')],{})['then'](respondWithResult(_0x5d8a72,0xc9))['catch'](handleError(_0x5d8a72,null));};exports[_0xb758('0x4d')]=function(_0x5ba37d,_0x3dcce1){if(_0x5ba37d[_0xb758('0x4c')]['id']){delete _0x5ba37d['body']['id'];}return db[_0xb758('0x2d')][_0xb758('0x4a')]({'where':{'id':_0x5ba37d[_0xb758('0x45')]['id']}})[_0xb758('0x27')](handleEntityNotFound(_0x3dcce1,null))[_0xb758('0x27')](saveUpdates(_0x5ba37d['body'],null))[_0xb758('0x27')](respondWithResult(_0x3dcce1,null))[_0xb758('0x44')](handleError(_0x3dcce1,null));};exports[_0xb758('0x28')]=function(_0x4f27dc,_0x15b894){return db[_0xb758('0x2d')]['find']({'where':{'id':_0x4f27dc[_0xb758('0x45')]['id']}})['then'](handleEntityNotFound(_0x15b894,null))[_0xb758('0x27')](removeEntity(_0x15b894,null))['catch'](handleError(_0x15b894,null));};exports[_0xb758('0x4e')]=function(_0x588276,_0x552e68){return db[_0xb758('0x2d')]['describe']()[_0xb758('0x27')](respondWithResult(_0x552e68,null))[_0xb758('0x44')](handleError(_0x552e68,null));};
\ No newline at end of file
+var _0xc808=['bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','crypto','desk.js','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','end','json','undefined','limit','offset','count','status','set','Content-Range','reject','save','then','destroy','error','stack','name','index','ChatTransferReport','rawAttributes','fieldName','key','model','map','query','filters','attributes','intersection','fields','nolimit','order','sort','where','merge','type','VIRTUAL','filter','options','includeAll','include','rows','catch','show','keys','length','find','create','body','update','params','describe','eml-format','rimraf','zip-dir','request-promise','moment'];(function(_0x10bf5d,_0x10a3a9){var _0x27f511=function(_0x209cf3){while(--_0x209cf3){_0x10bf5d['push'](_0x10bf5d['shift']());}};_0x27f511(++_0x10a3a9);}(_0xc808,0x97));var _0x8c80=function(_0x219cc1,_0x3d03b5){_0x219cc1=_0x219cc1-0x0;var _0x177034=_0xc808[_0x219cc1];return _0x177034;};'use strict';var emlformat=require(_0x8c80('0x0'));var rimraf=require(_0x8c80('0x1'));var zipdir=require(_0x8c80('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x8c80('0x3'));var moment=require(_0x8c80('0x4'));var BPromise=require(_0x8c80('0x5'));var Mustache=require(_0x8c80('0x6'));var util=require(_0x8c80('0x7'));var path=require(_0x8c80('0x8'));var sox=require(_0x8c80('0x9'));var csv=require(_0x8c80('0xa'));var ejs=require(_0x8c80('0xb'));var fs=require('fs');var fs_extra=require(_0x8c80('0xc'));var _=require('lodash');var squel=require('squel');var crypto=require(_0x8c80('0xd'));var jsforce=require('jsforce');var deskjs=require(_0x8c80('0xe'));var toCsv=require(_0x8c80('0xa'));var querystring=require('querystring');var Papa=require(_0x8c80('0xf'));var Redis=require(_0x8c80('0x10'));var authService=require(_0x8c80('0x11'));var qs=require(_0x8c80('0x12'));var as=require(_0x8c80('0x13'));var hardwareService=require(_0x8c80('0x14'));var logger=require(_0x8c80('0x15'))(_0x8c80('0x16'));var utils=require(_0x8c80('0x17'));var config=require(_0x8c80('0x18'));var licenseUtil=require(_0x8c80('0x19'));var db=require(_0x8c80('0x1a'))['db'];function respondWithStatusCode(_0x1aa841,_0x2432d8){_0x2432d8=_0x2432d8||0xcc;return function(_0x4ed424){if(_0x4ed424){return _0x1aa841[_0x8c80('0x1b')](_0x2432d8);}return _0x1aa841['status'](_0x2432d8)[_0x8c80('0x1c')]();};}function respondWithResult(_0x328a87,_0x46da68){_0x46da68=_0x46da68||0xc8;return function(_0x5a4881){if(_0x5a4881){return _0x328a87['status'](_0x46da68)[_0x8c80('0x1d')](_0x5a4881);}};}function respondWithFilteredResult(_0x374c48,_0xc38cfc){return function(_0x2c01a8){if(_0x2c01a8){var _0x314570=typeof _0xc38cfc['offset']===_0x8c80('0x1e')&&typeof _0xc38cfc[_0x8c80('0x1f')]==='undefined';var _0x401070=_0x2c01a8['count'];var _0x384023=_0x314570?0x0:_0xc38cfc[_0x8c80('0x20')];var _0xe60216=_0x314570?_0x2c01a8[_0x8c80('0x21')]:_0xc38cfc[_0x8c80('0x20')]+_0xc38cfc['limit'];var _0x42f5be;if(_0xe60216>=_0x401070){_0xe60216=_0x401070;_0x42f5be=0xc8;}else{_0x42f5be=0xce;}_0x374c48[_0x8c80('0x22')](_0x42f5be);return _0x374c48[_0x8c80('0x23')](_0x8c80('0x24'),_0x384023+'-'+_0xe60216+'/'+_0x401070)[_0x8c80('0x1d')](_0x2c01a8);}return null;};}function patchUpdates(_0x39bdcb){return function(_0x2d1771){try{jsonpatch['apply'](_0x2d1771,_0x39bdcb,!![]);}catch(_0x56fbb5){return BPromise[_0x8c80('0x25')](_0x56fbb5);}return _0x2d1771[_0x8c80('0x26')]();};}function saveUpdates(_0x103bf7,_0x7bc10){return function(_0x53f225){if(_0x53f225){return _0x53f225['update'](_0x103bf7)[_0x8c80('0x27')](function(_0x355438){return _0x355438;});}return null;};}function removeEntity(_0x5d5d11,_0x48a404){return function(_0x2de3df){if(_0x2de3df){return _0x2de3df[_0x8c80('0x28')]()[_0x8c80('0x27')](function(){_0x5d5d11[_0x8c80('0x22')](0xcc)[_0x8c80('0x1c')]();});}};}function handleEntityNotFound(_0x157bb5,_0x2d8b55){return function(_0xce1986){if(!_0xce1986){_0x157bb5[_0x8c80('0x1b')](0x194);}return _0xce1986;};}function handleError(_0x2005b6,_0x587635){_0x587635=_0x587635||0x1f4;return function(_0x11a075){logger[_0x8c80('0x29')](_0x11a075[_0x8c80('0x2a')]);if(_0x11a075[_0x8c80('0x2b')]){delete _0x11a075['name'];}_0x2005b6[_0x8c80('0x22')](_0x587635)['send'](_0x11a075);};}exports[_0x8c80('0x2c')]=function(_0xa5293b,_0x5d1d4c){var _0x5f297c={},_0x4c267c={},_0x4a4303={'count':0x0,'rows':[]};var _0x48f24c=_['map'](db[_0x8c80('0x2d')][_0x8c80('0x2e')],function(_0x44ca9a){return{'name':_0x44ca9a[_0x8c80('0x2f')],'type':_0x44ca9a['type'][_0x8c80('0x30')]};});_0x4c267c[_0x8c80('0x31')]=_[_0x8c80('0x32')](_0x48f24c,'name');_0x4c267c[_0x8c80('0x33')]=_['keys'](_0xa5293b[_0x8c80('0x33')]);_0x4c267c[_0x8c80('0x34')]=_['intersection'](_0x4c267c[_0x8c80('0x31')],_0x4c267c[_0x8c80('0x33')]);_0x5f297c[_0x8c80('0x35')]=_[_0x8c80('0x36')](_0x4c267c[_0x8c80('0x31')],qs['fields'](_0xa5293b[_0x8c80('0x33')][_0x8c80('0x37')]));_0x5f297c['attributes']=_0x5f297c[_0x8c80('0x35')]['length']?_0x5f297c['attributes']:_0x4c267c[_0x8c80('0x31')];if(!_0xa5293b[_0x8c80('0x33')]['hasOwnProperty'](_0x8c80('0x38'))){_0x5f297c[_0x8c80('0x1f')]=qs['limit'](_0xa5293b['query'][_0x8c80('0x1f')]);_0x5f297c[_0x8c80('0x20')]=qs['offset'](_0xa5293b['query'][_0x8c80('0x20')]);}_0x5f297c[_0x8c80('0x39')]=qs[_0x8c80('0x3a')](_0xa5293b['query'][_0x8c80('0x3a')]);_0x5f297c[_0x8c80('0x3b')]=qs[_0x8c80('0x34')](_['pick'](_0xa5293b[_0x8c80('0x33')],_0x4c267c['filters']),_0x48f24c);if(_0xa5293b[_0x8c80('0x33')]['filter']){_0x5f297c[_0x8c80('0x3b')]=_[_0x8c80('0x3c')](_0x5f297c[_0x8c80('0x3b')],{'$or':_[_0x8c80('0x32')](_0x48f24c,function(_0x4dbb4a){if(_0x4dbb4a[_0x8c80('0x3d')]!==_0x8c80('0x3e')){var _0x4e576c={};_0x4e576c[_0x4dbb4a[_0x8c80('0x2b')]]={'$like':'%'+_0xa5293b[_0x8c80('0x33')][_0x8c80('0x3f')]+'%'};return _0x4e576c;}})});}_0x5f297c=_[_0x8c80('0x3c')]({},_0x5f297c,_0xa5293b[_0x8c80('0x40')]);var _0xa2cb92={'where':_0x5f297c[_0x8c80('0x3b')]};return db[_0x8c80('0x2d')][_0x8c80('0x21')](_0xa2cb92)[_0x8c80('0x27')](function(_0x55a084){_0x4a4303[_0x8c80('0x21')]=_0x55a084;if(_0xa5293b[_0x8c80('0x33')][_0x8c80('0x41')]){_0x5f297c[_0x8c80('0x42')]=[{'all':!![]}];}return db[_0x8c80('0x2d')]['findAll'](_0x5f297c);})[_0x8c80('0x27')](function(_0x1d531b){_0x4a4303[_0x8c80('0x43')]=_0x1d531b;return _0x4a4303;})[_0x8c80('0x27')](respondWithFilteredResult(_0x5d1d4c,_0x5f297c))[_0x8c80('0x44')](handleError(_0x5d1d4c,null));};exports[_0x8c80('0x45')]=function(_0x2662cd,_0x2f0768){var _0x3b99eb={'raw':!![],'where':{'id':_0x2662cd['params']['id']}},_0x2786fd={};_0x2786fd[_0x8c80('0x31')]=_[_0x8c80('0x46')](db[_0x8c80('0x2d')][_0x8c80('0x2e')]);_0x2786fd[_0x8c80('0x33')]=_[_0x8c80('0x46')](_0x2662cd[_0x8c80('0x33')]);_0x2786fd['filters']=_[_0x8c80('0x36')](_0x2786fd[_0x8c80('0x31')],_0x2786fd[_0x8c80('0x33')]);_0x3b99eb['attributes']=_[_0x8c80('0x36')](_0x2786fd[_0x8c80('0x31')],qs[_0x8c80('0x37')](_0x2662cd[_0x8c80('0x33')]['fields']));_0x3b99eb[_0x8c80('0x35')]=_0x3b99eb[_0x8c80('0x35')][_0x8c80('0x47')]?_0x3b99eb['attributes']:_0x2786fd[_0x8c80('0x31')];if(_0x2662cd[_0x8c80('0x33')][_0x8c80('0x41')]){_0x3b99eb[_0x8c80('0x42')]=[{'all':!![]}];}_0x3b99eb=_[_0x8c80('0x3c')]({},_0x3b99eb,_0x2662cd[_0x8c80('0x40')]);return db[_0x8c80('0x2d')][_0x8c80('0x48')](_0x3b99eb)['then'](handleEntityNotFound(_0x2f0768,null))[_0x8c80('0x27')](respondWithResult(_0x2f0768,null))[_0x8c80('0x44')](handleError(_0x2f0768,null));};exports[_0x8c80('0x49')]=function(_0x3d6c7d,_0x457509){return db[_0x8c80('0x2d')][_0x8c80('0x49')](_0x3d6c7d[_0x8c80('0x4a')],{})[_0x8c80('0x27')](respondWithResult(_0x457509,0xc9))[_0x8c80('0x44')](handleError(_0x457509,null));};exports[_0x8c80('0x4b')]=function(_0x4cda3c,_0x387905){if(_0x4cda3c[_0x8c80('0x4a')]['id']){delete _0x4cda3c[_0x8c80('0x4a')]['id'];}return db['ChatTransferReport'][_0x8c80('0x48')]({'where':{'id':_0x4cda3c['params']['id']}})['then'](handleEntityNotFound(_0x387905,null))[_0x8c80('0x27')](saveUpdates(_0x4cda3c[_0x8c80('0x4a')],null))[_0x8c80('0x27')](respondWithResult(_0x387905,null))[_0x8c80('0x44')](handleError(_0x387905,null));};exports[_0x8c80('0x28')]=function(_0x24dc95,_0x44adea){return db[_0x8c80('0x2d')][_0x8c80('0x48')]({'where':{'id':_0x24dc95[_0x8c80('0x4c')]['id']}})[_0x8c80('0x27')](handleEntityNotFound(_0x44adea,null))[_0x8c80('0x27')](removeEntity(_0x44adea,null))[_0x8c80('0x44')](handleError(_0x44adea,null));};exports[_0x8c80('0x4d')]=function(_0x162f36,_0x3e1c8d){return db[_0x8c80('0x2d')][_0x8c80('0x4d')]()['then'](respondWithResult(_0x3e1c8d,null))[_0x8c80('0x44')](handleError(_0x3e1c8d,null));};
\ No newline at end of file
diff --git a/server/api/chatTransferReport/chatTransferReport.model.js b/server/api/chatTransferReport/chatTransferReport.model.js
index cde8049..8291c9f 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 _0x69e0=['uniqueid','lodash','util','../../config/logger','moment','bluebird','path','../../config/environment','exports','define','ChatTransferReport'];(function(_0x164488,_0x2ffead){var _0x13539f=function(_0x4976c2){while(--_0x4976c2){_0x164488['push'](_0x164488['shift']());}};_0x13539f(++_0x2ffead);}(_0x69e0,0xfe));var _0x069e=function(_0xa1e7a3,_0x2b127c){_0xa1e7a3=_0xa1e7a3-0x0;var _0x1a53f5=_0x69e0[_0xa1e7a3];return _0x1a53f5;};'use strict';var _=require(_0x069e('0x0'));var util=require(_0x069e('0x1'));var logger=require(_0x069e('0x2'))('api');var moment=require(_0x069e('0x3'));var BPromise=require(_0x069e('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x069e('0x5'));var rimraf=require('rimraf');var config=require(_0x069e('0x6'));var attributes=require('./chatTransferReport.attributes');module[_0x069e('0x7')]=function(_0x5d3bbc,_0x5e56aa){return _0x5d3bbc[_0x069e('0x8')](_0x069e('0x9'),attributes,{'tableName':'report_chat_transfer','paranoid':![],'indexes':[{'name':'uniqueid','fields':[_0x069e('0xa')]}],'timestamps':!![]});};
\ No newline at end of file
+var _0xf6b4=['define','ChatTransferReport','uniqueid','lodash','moment','bluebird','request-promise','path','rimraf','../../config/environment','./chatTransferReport.attributes'];(function(_0xf3f0cc,_0x5a6ff3){var _0x30935a=function(_0x180114){while(--_0x180114){_0xf3f0cc['push'](_0xf3f0cc['shift']());}};_0x30935a(++_0x5a6ff3);}(_0xf6b4,0xc9));var _0x4f6b=function(_0x178ca4,_0x5aaa16){_0x178ca4=_0x178ca4-0x0;var _0x57f6a8=_0xf6b4[_0x178ca4];return _0x57f6a8;};'use strict';var _=require(_0x4f6b('0x0'));var util=require('util');var logger=require('../../config/logger')('api');var moment=require(_0x4f6b('0x1'));var BPromise=require(_0x4f6b('0x2'));var rp=require(_0x4f6b('0x3'));var fs=require('fs');var path=require(_0x4f6b('0x4'));var rimraf=require(_0x4f6b('0x5'));var config=require(_0x4f6b('0x6'));var attributes=require(_0x4f6b('0x7'));module['exports']=function(_0x442265,_0x313c59){return _0x442265[_0x4f6b('0x8')](_0x4f6b('0x9'),attributes,{'tableName':'report_chat_transfer','paranoid':![],'indexes':[{'name':'uniqueid','fields':[_0x4f6b('0xa')]}],'timestamps':!![]});};
\ No newline at end of file
diff --git a/server/api/chatTransferReport/chatTransferReport.rpc.js b/server/api/chatTransferReport/chatTransferReport.rpc.js
index 7ce40ba..fac8a62 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 _0x2d84=['message','ChatTransferReport,\x20%s,\x20%s','result','catch','lodash','util','bluebird','../../mysqldb','../../config/logger','rpc','../../config/environment','client','http','request','info','request\x20sent','debug','ChatTransferReport,\x20%s,\x20%s,\x20%s','error','code'];(function(_0x22392c,_0x3d66c2){var _0xafef9f=function(_0x470dac){while(--_0x470dac){_0x22392c['push'](_0x22392c['shift']());}};_0xafef9f(++_0x3d66c2);}(_0x2d84,0xa4));var _0x42d8=function(_0x4d0adf,_0x3c627c){_0x4d0adf=_0x4d0adf-0x0;var _0x3d53e8=_0x2d84[_0x4d0adf];return _0x3d53e8;};'use strict';var _=require(_0x42d8('0x0'));var util=require(_0x42d8('0x1'));var moment=require('moment');var BPromise=require(_0x42d8('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x42d8('0x3'))['db'];var utils=require('../../config/utils');var logger=require(_0x42d8('0x4'))(_0x42d8('0x5'));var config=require(_0x42d8('0x6'));var jayson=require('jayson/promise');var client=jayson[_0x42d8('0x7')][_0x42d8('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x5be28f,_0x52c474,_0x214306){return new BPromise(function(_0x44f0b5,_0x27338f){return client[_0x42d8('0x9')](_0x5be28f,_0x214306)['then'](function(_0x4db990){logger[_0x42d8('0xa')]('ChatTransferReport,\x20%s,\x20%s',_0x52c474,_0x42d8('0xb'));logger[_0x42d8('0xc')](_0x42d8('0xd'),_0x52c474,_0x42d8('0xb'),JSON['stringify'](_0x4db990));if(_0x4db990[_0x42d8('0xe')]){if(_0x4db990[_0x42d8('0xe')][_0x42d8('0xf')]===0x1f4){logger[_0x42d8('0xe')]('ChatTransferReport,\x20%s,\x20%s',_0x52c474,_0x4db990[_0x42d8('0xe')]['message']);return _0x27338f(_0x4db990[_0x42d8('0xe')][_0x42d8('0x10')]);}logger[_0x42d8('0xe')](_0x42d8('0x11'),_0x52c474,_0x4db990[_0x42d8('0xe')]['message']);return _0x44f0b5(_0x4db990[_0x42d8('0xe')][_0x42d8('0x10')]);}else{logger[_0x42d8('0xa')](_0x42d8('0x11'),_0x52c474,_0x42d8('0xb'));_0x44f0b5(_0x4db990[_0x42d8('0x12')][_0x42d8('0x10')]);}})[_0x42d8('0x13')](function(_0xd874af){logger[_0x42d8('0xe')]('ChatTransferReport,\x20%s,\x20%s',_0x52c474,_0xd874af);_0x27338f(_0xd874af);});});}
\ No newline at end of file
+var _0xc2fe=['util','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','request','then','ChatTransferReport,\x20%s,\x20%s','request\x20sent','debug','ChatTransferReport,\x20%s,\x20%s,\x20%s','stringify','error','message','info','result','catch','lodash'];(function(_0x5f3f88,_0x562baf){var _0xd08119=function(_0x42dbf7){while(--_0x42dbf7){_0x5f3f88['push'](_0x5f3f88['shift']());}};_0xd08119(++_0x562baf);}(_0xc2fe,0x149));var _0xec2f=function(_0x3f8261,_0x2a51ec){_0x3f8261=_0x3f8261-0x0;var _0x17a540=_0xc2fe[_0x3f8261];return _0x17a540;};'use strict';var _=require(_0xec2f('0x0'));var util=require(_0xec2f('0x1'));var moment=require('moment');var BPromise=require(_0xec2f('0x2'));var rs=require(_0xec2f('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xec2f('0x4'))['db'];var utils=require(_0xec2f('0x5'));var logger=require(_0xec2f('0x6'))(_0xec2f('0x7'));var config=require(_0xec2f('0x8'));var jayson=require('jayson/promise');var client=jayson[_0xec2f('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x353971,_0x3ec63b,_0x44b804){return new BPromise(function(_0x5150c1,_0x5e6e4c){return client[_0xec2f('0xa')](_0x353971,_0x44b804)[_0xec2f('0xb')](function(_0x53bfd9){logger['info'](_0xec2f('0xc'),_0x3ec63b,_0xec2f('0xd'));logger[_0xec2f('0xe')](_0xec2f('0xf'),_0x3ec63b,'request\x20sent',JSON[_0xec2f('0x10')](_0x53bfd9));if(_0x53bfd9[_0xec2f('0x11')]){if(_0x53bfd9[_0xec2f('0x11')]['code']===0x1f4){logger[_0xec2f('0x11')](_0xec2f('0xc'),_0x3ec63b,_0x53bfd9['error'][_0xec2f('0x12')]);return _0x5e6e4c(_0x53bfd9[_0xec2f('0x11')][_0xec2f('0x12')]);}logger[_0xec2f('0x11')](_0xec2f('0xc'),_0x3ec63b,_0x53bfd9[_0xec2f('0x11')][_0xec2f('0x12')]);return _0x5150c1(_0x53bfd9[_0xec2f('0x11')]['message']);}else{logger[_0xec2f('0x13')](_0xec2f('0xc'),_0x3ec63b,_0xec2f('0xd'));_0x5150c1(_0x53bfd9[_0xec2f('0x14')][_0xec2f('0x12')]);}})[_0xec2f('0x15')](function(_0x405839){logger[_0xec2f('0x11')](_0xec2f('0xc'),_0x3ec63b,_0x405839);_0x5e6e4c(_0x405839);});});}
\ No newline at end of file
diff --git a/server/api/chatTransferReport/index.js b/server/api/chatTransferReport/index.js
index 08708a0..2097353 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 _0xa948=['fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/describe','/:id','show','post','create','put','update','delete','exports','multer','path','express','Router'];(function(_0x3c28c0,_0x1cb29d){var _0x12cc9f=function(_0x33d0f7){while(--_0x33d0f7){_0x3c28c0['push'](_0x3c28c0['shift']());}};_0x12cc9f(++_0x1cb29d);}(_0xa948,0x178));var _0x8a94=function(_0x4cd685,_0x472697){_0x4cd685=_0x4cd685-0x0;var _0x37743e=_0xa948[_0x4cd685];return _0x37743e;};'use strict';var multer=require(_0x8a94('0x0'));var util=require('util');var path=require(_0x8a94('0x1'));var timeout=require('connect-timeout');var express=require(_0x8a94('0x2'));var router=express[_0x8a94('0x3')]();var fs_extra=require(_0x8a94('0x4'));var auth=require(_0x8a94('0x5'));var interaction=require(_0x8a94('0x6'));var config=require(_0x8a94('0x7'));var controller=require('./chatTransferReport.controller');router[_0x8a94('0x8')]('/',auth[_0x8a94('0x9')](),controller[_0x8a94('0xa')]);router[_0x8a94('0x8')](_0x8a94('0xb'),auth[_0x8a94('0x9')](),controller['describe']);router[_0x8a94('0x8')](_0x8a94('0xc'),auth['isAuthenticated'](),controller[_0x8a94('0xd')]);router[_0x8a94('0xe')]('/',auth['isAuthenticated'](),controller[_0x8a94('0xf')]);router[_0x8a94('0x10')](_0x8a94('0xc'),auth[_0x8a94('0x9')](),controller[_0x8a94('0x11')]);router[_0x8a94('0x12')](_0x8a94('0xc'),auth[_0x8a94('0x9')](),controller['destroy']);module[_0x8a94('0x13')]=router;
\ No newline at end of file
+var _0x4daa=['show','post','put','/:id','update','delete','exports','multer','path','connect-timeout','Router','fs-extra','../../components/auth/service','./chatTransferReport.controller','get','isAuthenticated','index','/describe'];(function(_0x271e46,_0x2626ef){var _0x5951df=function(_0x4ce493){while(--_0x4ce493){_0x271e46['push'](_0x271e46['shift']());}};_0x5951df(++_0x2626ef);}(_0x4daa,0x14b));var _0xa4da=function(_0x213f3d,_0x31c31f){_0x213f3d=_0x213f3d-0x0;var _0x238251=_0x4daa[_0x213f3d];return _0x238251;};'use strict';var multer=require(_0xa4da('0x0'));var util=require('util');var path=require(_0xa4da('0x1'));var timeout=require(_0xa4da('0x2'));var express=require('express');var router=express[_0xa4da('0x3')]();var fs_extra=require(_0xa4da('0x4'));var auth=require(_0xa4da('0x5'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0xa4da('0x6'));router[_0xa4da('0x7')]('/',auth[_0xa4da('0x8')](),controller[_0xa4da('0x9')]);router[_0xa4da('0x7')](_0xa4da('0xa'),auth[_0xa4da('0x8')](),controller['describe']);router[_0xa4da('0x7')]('/:id',auth[_0xa4da('0x8')](),controller[_0xa4da('0xb')]);router[_0xa4da('0xc')]('/',auth[_0xa4da('0x8')](),controller['create']);router[_0xa4da('0xd')](_0xa4da('0xe'),auth[_0xa4da('0x8')](),controller[_0xa4da('0xf')]);router[_0xa4da('0x10')](_0xa4da('0xe'),auth[_0xa4da('0x8')](),controller['destroy']);module[_0xa4da('0x11')]=router;
\ No newline at end of file
diff --git a/server/api/chatWebsite/chatWebsite.attributes.js b/server/api/chatWebsite/chatWebsite.attributes.js
index 24c100f..3cf46eb 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 _0x9a93=['website_alias','bottom_right','alternate','System','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','mandatoryDispositionPauseId','mandatoryDisposition','Generated\x20by\x20XCALLY\x20Motion','Meeting\x20generated\x20for\x20interaction\x20#{{interaction.id}}\x20by\x20{{agent.name}}','sequelize','randomstring','STRING','address','email','#011F6A','#ffffff','BOOLEAN','rounded','squared','Send','INTEGER','TEXT','Do\x20you\x20want\x20to\x20close\x20the\x20interaction?','Form\x20properly\x20submitted','Form\x20submission\x20error','Note','Type\x20a\x20message','Thanks\x20you\x20for\x20your\x20time!','Skip','Feedback','ENUM','star','stringify','input','name','text','getDataValue','onlineForm','parse','setDataValue','Comments','Leave\x20your\x20comments','offlineForm','generate','Please\x20hold\x20and\x20we\x20will\x20answer\x20your\x20request\x20as\x20soon\x20as\x20possible.','New\x20offline\x20message\x20from\x20websiteName','You\x20received\x20a\x20new\x20offline\x20message\x20from\x20websiteName.\x20Here\x20you\x20can\x20find\x20the\x20details\x20of\x20the\x20request:','Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}'];(function(_0x3947c9,_0x4d6c97){var _0x2e7871=function(_0x1236cc){while(--_0x1236cc){_0x3947c9['push'](_0x3947c9['shift']());}};_0x2e7871(++_0x4d6c97);}(_0x9a93,0x192));var _0x39a9=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x9a93[_0x3dd15e];return _0x231fd0;};'use strict';var Sequelize=require(_0x39a9('0x0'));var rs=require(_0x39a9('0x1'));module['exports']={'name':{'type':Sequelize[_0x39a9('0x2')],'allowNull':![]},'address':{'type':Sequelize[_0x39a9('0x2')],'allowNull':![],'unique':_0x39a9('0x3')},'description':{'type':Sequelize['STRING']},'mapKey':{'type':Sequelize[_0x39a9('0x2')],'defaultValue':_0x39a9('0x4')},'mapKeyOffline':{'type':Sequelize['STRING'],'defaultValue':'email'},'key':{'type':Sequelize[_0x39a9('0x2')],'allowNull':![]},'agentAlias':{'type':Sequelize['STRING'],'defaultValue':'Agent'},'customerAlias':{'type':Sequelize['STRING'],'defaultValue':'Me'},'color':{'type':Sequelize[_0x39a9('0x2')],'allowNull':![],'defaultValue':'#011F6A','validate':{'notEmpty':!![]}},'color_button':{'type':Sequelize[_0x39a9('0x2')],'allowNull':![],'defaultValue':_0x39a9('0x5'),'validate':{'notEmpty':!![]}},'textColor':{'type':Sequelize[_0x39a9('0x2')],'allowNull':![],'defaultValue':_0x39a9('0x6'),'validate':{'notEmpty':!![]}},'fontSize':{'type':Sequelize['INTEGER'],'defaultValue':0xf},'remote':{'type':Sequelize[_0x39a9('0x2')]},'animation':{'type':Sequelize[_0x39a9('0x7')],'defaultValue':!![]},'header_shape':{'type':Sequelize['ENUM'](_0x39a9('0x8'),_0x39a9('0x9')),'defaultValue':_0x39a9('0x8')},'header_online':{'type':Sequelize[_0x39a9('0x2')],'defaultValue':'We\x20are\x20here!'},'start_chat_button':{'type':Sequelize['STRING'],'defaultValue':'Chat'},'offline_chat_button':{'type':Sequelize[_0x39a9('0x2')],'defaultValue':_0x39a9('0xa')},'header_offline':{'type':Sequelize[_0x39a9('0x2')],'defaultValue':'Contact\x20us'},'download_transcript':{'type':Sequelize[_0x39a9('0x7')],'defaultValue':!![]},'timeout':{'type':Sequelize[_0x39a9('0xb')],'defaultValue':0x0},'whiteLabel':{'type':Sequelize[_0x39a9('0x2')],'defaultValue':'Powered\x20by\x20xCALLY'},'defaultWhiteLabel':{'type':Sequelize[_0x39a9('0x7')],'defaultValue':!![]},'sitepic':{'type':Sequelize[_0x39a9('0xc')]},'closingQuestion':{'type':Sequelize[_0x39a9('0x2')],'defaultValue':_0x39a9('0xd')},'formSubmitSuccessMessage':{'type':Sequelize[_0x39a9('0x2')],'defaultValue':_0x39a9('0xe')},'formSubmitFailureMessage':{'type':Sequelize[_0x39a9('0x2')],'defaultValue':_0x39a9('0xf')},'noteTitle':{'type':Sequelize['STRING'],'defaultValue':_0x39a9('0x10')},'placeholderMessage':{'type':Sequelize[_0x39a9('0x2')],'defaultValue':_0x39a9('0x11')},'closingMessage':{'type':Sequelize[_0x39a9('0x2')],'defaultValue':_0x39a9('0x12')},'closingMessageButton':{'type':Sequelize[_0x39a9('0x2')],'defaultValue':_0x39a9('0xa')},'skipMessageButton':{'type':Sequelize[_0x39a9('0x2')],'defaultValue':_0x39a9('0x13')},'conditionAgreement':{'type':Sequelize[_0x39a9('0x7')],'defaultValue':![]},'enableRating':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'enableFeedback':{'type':Sequelize[_0x39a9('0x7')],'defaultValue':![]},'enableSendButton':{'type':Sequelize[_0x39a9('0x7')],'defaultValue':![]},'feedbackTitle':{'type':Sequelize['STRING'],'defaultValue':_0x39a9('0x14')},'ratingType':{'type':Sequelize[_0x39a9('0x15')]('star','thumb'),'defaultValue':_0x39a9('0x16')},'ratingStarsNumber':{'type':Sequelize['INTEGER'],'defaultValue':0x5},'onlineForm':{'type':Sequelize[_0x39a9('0xc')],'defaultValue':function(){return JSON[_0x39a9('0x17')]({'items':[{'type':_0x39a9('0x18'),'variable':null,'config':{'placeholder':_0x39a9('0x19'),'type':_0x39a9('0x1a'),'required':!![]},'props':{'title':_0x39a9('0x19'),'helpText':''}},{'type':_0x39a9('0x18'),'props':{'title':'email','helpText':''},'config':{'required':!![],'placeholder':_0x39a9('0x4'),'type':_0x39a9('0x4')},'variable':null}],'fromKey':0x1});},'get':function(){return this[_0x39a9('0x1b')](_0x39a9('0x1c'))?JSON[_0x39a9('0x1d')](this[_0x39a9('0x1b')](_0x39a9('0x1c'))):{};},'set':function(_0x4b31e5){return this[_0x39a9('0x1e')](_0x39a9('0x1c'),JSON['stringify'](_0x4b31e5));}},'offlineForm':{'type':Sequelize[_0x39a9('0xc')],'defaultValue':function(){return JSON[_0x39a9('0x17')]({'items':[{'type':_0x39a9('0x18'),'props':{'title':'email','helpText':''},'config':{'required':!![],'placeholder':_0x39a9('0x4'),'type':'email'},'variable':null},{'type':'textarea','config':{'placeholder':'Comments'},'props':{'title':_0x39a9('0x1f'),'helpText':_0x39a9('0x20')}}],'fromKey':0x0});},'get':function(){return this[_0x39a9('0x1b')]('offlineForm')?JSON['parse'](this[_0x39a9('0x1b')](_0x39a9('0x21'))):{};},'set':function(_0x570486){return this[_0x39a9('0x1e')]('offlineForm',JSON[_0x39a9('0x17')](_0x570486));}},'token':{'type':Sequelize[_0x39a9('0x2')],'defaultValue':function(){return rs[_0x39a9('0x22')]();}},'autoclose':{'type':Sequelize[_0x39a9('0x7')],'defaultValue':!![]},'enableCustomerWriting':{'type':Sequelize[_0x39a9('0x7')],'defaultValue':![]},'forwardTranscript':{'type':Sequelize[_0x39a9('0x7')],'defaultValue':![]},'forwardTranscriptMessage':{'type':Sequelize[_0x39a9('0x2')]},'forwardOffline':{'type':Sequelize[_0x39a9('0x7')],'defaultValue':![]},'forwardOfflineAddress':{'type':Sequelize[_0x39a9('0x2')]},'waitingTitle':{'type':Sequelize[_0x39a9('0x2')],'defaultValue':'All\x20of\x20our\x20agents\x20are\x20busy\x20at\x20this\x20time.\x20Your\x20chat\x20is\x20very\x20important\x20to\x20us.'},'waitingMessage':{'type':Sequelize[_0x39a9('0x2')],'defaultValue':_0x39a9('0x23')},'offlineMessageSubject':{'type':Sequelize[_0x39a9('0x2')],'defaultValue':_0x39a9('0x24')},'offlineMessageBody':{'type':Sequelize[_0x39a9('0x2')],'defaultValue':_0x39a9('0x25')},'enableUnmanagedNote':{'type':Sequelize[_0x39a9('0x7')],'defaultValue':!![]},'unmanagedMessage':{'type':Sequelize[_0x39a9('0x2')],'defaultValue':'Your\x20request\x20has\x20not\x20been\x20processed.'},'skipUnmanaged':{'type':Sequelize[_0x39a9('0x2')],'defaultValue':_0x39a9('0x13')},'sendUnmanaged':{'type':Sequelize['STRING'],'defaultValue':_0x39a9('0xa')},'enableCustomerAttachment':{'type':Sequelize[_0x39a9('0x7')],'defaultValue':![]},'enableCustomerCheckmarks':{'type':Sequelize[_0x39a9('0x7')],'defaultValue':![]},'agentAvatar':{'type':Sequelize[_0x39a9('0xc')]},'showAgentAvatar':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'timezone':{'type':Sequelize[_0x39a9('0x2')]},'notificationTemplate':{'type':Sequelize[_0x39a9('0xc')],'defaultValue':function(){return _0x39a9('0x26');}},'notificationSound':{'type':Sequelize[_0x39a9('0x7')],'defaultValue':!![]},'notificationShake':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'hideWhenOffline':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'agentIdentifier':{'type':Sequelize[_0x39a9('0x2')],'defaultValue':_0x39a9('0x27')},'waitForTheAssignedAgent':{'type':Sequelize[_0x39a9('0xb')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'alignment':{'type':Sequelize['STRING'],'defaultValue':_0x39a9('0x28')},'verticalAlignment':{'type':Sequelize[_0x39a9('0xb')],'defaultValue':0x1e},'messagesAlignment':{'type':Sequelize['STRING'],'defaultValue':_0x39a9('0x29')},'defaultTitle':{'type':Sequelize[_0x39a9('0x2')]},'customerAvatar':{'type':Sequelize[_0x39a9('0xc')]},'showCustomerAvatar':{'type':Sequelize[_0x39a9('0x7')],'defaultValue':![]},'messageFontSize':{'type':Sequelize[_0x39a9('0xb')],'defaultValue':0xc},'backgroundColor':{'type':Sequelize[_0x39a9('0x2')],'allowNull':![],'defaultValue':'#fafafa','validate':{'notEmpty':!![]}},'queueTransfer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0x39a9('0xb')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0x39a9('0x7')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'systemAlias':{'type':Sequelize['STRING'],'defaultValue':_0x39a9('0x2a')},'systemAvatar':{'type':Sequelize[_0x39a9('0xc')]},'mandatoryDispositionPauseId':{'type':Sequelize[_0x39a9('0xb')],'comment':_0x39a9('0x2b')},'mandatoryDisposition':{'type':Sequelize[_0x39a9('0x7')],'defaultValue':![],'comment':_0x39a9('0x2c'),'set':function(_0x5be09a){if(!_0x5be09a)this[_0x39a9('0x1e')](_0x39a9('0x2d'),null);this[_0x39a9('0x1e')](_0x39a9('0x2e'),_0x5be09a);}},'vidaooEscalation':{'type':Sequelize[_0x39a9('0x7')],'defaultValue':![]},'vidaooApiKey':{'type':Sequelize[_0x39a9('0x2')]},'vidaooTopic':{'type':Sequelize[_0x39a9('0x2')],'allowNull':![],'defaultValue':_0x39a9('0x2f')},'vidaooNote':{'type':Sequelize[_0x39a9('0x2')],'defaultValue':function(){return _0x39a9('0x30');}},'vidaooMetadata':{'type':Sequelize[_0x39a9('0xc')],'defaultValue':null},'openNewInteraction':{'type':Sequelize['BOOLEAN'],'defaultValue':![],'allowNull':!![]},'subjectOffline':{'type':Sequelize[_0x39a9('0xc')]}};
\ No newline at end of file
+var _0x5618=['Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','mandatoryDispositionPauseId','Generated\x20by\x20XCALLY\x20Motion','Meeting\x20generated\x20for\x20interaction\x20#{{interaction.id}}\x20by\x20{{agent.name}}','sequelize','exports','STRING','address','email','Agent','#011F6A','#ffffff','BOOLEAN','ENUM','squared','rounded','We\x20are\x20here!','Send','Contact\x20us','INTEGER','Powered\x20by\x20xCALLY','TEXT','Do\x20you\x20want\x20to\x20close\x20the\x20interaction?','Form\x20properly\x20submitted','Form\x20submission\x20error','Note','Type\x20a\x20message','Thanks\x20you\x20for\x20your\x20time!','Feedback','star','thumb','input','text','name','onlineForm','parse','setDataValue','stringify','textarea','Comments','getDataValue','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:','Skip','website_alias','bottom_right','alternate','#fafafa'];(function(_0x4975e3,_0xb81a29){var _0x2e8b32=function(_0x14fca6){while(--_0x14fca6){_0x4975e3['push'](_0x4975e3['shift']());}};_0x2e8b32(++_0xb81a29);}(_0x5618,0x143));var _0x8561=function(_0x968d62,_0x8ab40d){_0x968d62=_0x968d62-0x0;var _0x13ee25=_0x5618[_0x968d62];return _0x13ee25;};'use strict';var Sequelize=require(_0x8561('0x0'));var rs=require('randomstring');module[_0x8561('0x1')]={'name':{'type':Sequelize[_0x8561('0x2')],'allowNull':![]},'address':{'type':Sequelize[_0x8561('0x2')],'allowNull':![],'unique':_0x8561('0x3')},'description':{'type':Sequelize[_0x8561('0x2')]},'mapKey':{'type':Sequelize[_0x8561('0x2')],'defaultValue':'email'},'mapKeyOffline':{'type':Sequelize[_0x8561('0x2')],'defaultValue':_0x8561('0x4')},'key':{'type':Sequelize['STRING'],'allowNull':![]},'agentAlias':{'type':Sequelize[_0x8561('0x2')],'defaultValue':_0x8561('0x5')},'customerAlias':{'type':Sequelize[_0x8561('0x2')],'defaultValue':'Me'},'color':{'type':Sequelize[_0x8561('0x2')],'allowNull':![],'defaultValue':'#011F6A','validate':{'notEmpty':!![]}},'color_button':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0x8561('0x6'),'validate':{'notEmpty':!![]}},'textColor':{'type':Sequelize[_0x8561('0x2')],'allowNull':![],'defaultValue':_0x8561('0x7'),'validate':{'notEmpty':!![]}},'fontSize':{'type':Sequelize['INTEGER'],'defaultValue':0xf},'remote':{'type':Sequelize['STRING']},'animation':{'type':Sequelize[_0x8561('0x8')],'defaultValue':!![]},'header_shape':{'type':Sequelize[_0x8561('0x9')]('rounded',_0x8561('0xa')),'defaultValue':_0x8561('0xb')},'header_online':{'type':Sequelize['STRING'],'defaultValue':_0x8561('0xc')},'start_chat_button':{'type':Sequelize[_0x8561('0x2')],'defaultValue':'Chat'},'offline_chat_button':{'type':Sequelize['STRING'],'defaultValue':_0x8561('0xd')},'header_offline':{'type':Sequelize[_0x8561('0x2')],'defaultValue':_0x8561('0xe')},'download_transcript':{'type':Sequelize[_0x8561('0x8')],'defaultValue':!![]},'timeout':{'type':Sequelize[_0x8561('0xf')],'defaultValue':0x0},'whiteLabel':{'type':Sequelize[_0x8561('0x2')],'defaultValue':_0x8561('0x10')},'defaultWhiteLabel':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'sitepic':{'type':Sequelize[_0x8561('0x11')]},'closingQuestion':{'type':Sequelize['STRING'],'defaultValue':_0x8561('0x12')},'formSubmitSuccessMessage':{'type':Sequelize[_0x8561('0x2')],'defaultValue':_0x8561('0x13')},'formSubmitFailureMessage':{'type':Sequelize[_0x8561('0x2')],'defaultValue':_0x8561('0x14')},'noteTitle':{'type':Sequelize['STRING'],'defaultValue':_0x8561('0x15')},'placeholderMessage':{'type':Sequelize[_0x8561('0x2')],'defaultValue':_0x8561('0x16')},'closingMessage':{'type':Sequelize[_0x8561('0x2')],'defaultValue':_0x8561('0x17')},'closingMessageButton':{'type':Sequelize[_0x8561('0x2')],'defaultValue':'Send'},'skipMessageButton':{'type':Sequelize['STRING'],'defaultValue':'Skip'},'conditionAgreement':{'type':Sequelize[_0x8561('0x8')],'defaultValue':![]},'enableRating':{'type':Sequelize[_0x8561('0x8')],'defaultValue':![]},'enableFeedback':{'type':Sequelize[_0x8561('0x8')],'defaultValue':![]},'enableSendButton':{'type':Sequelize[_0x8561('0x8')],'defaultValue':![]},'feedbackTitle':{'type':Sequelize[_0x8561('0x2')],'defaultValue':_0x8561('0x18')},'ratingType':{'type':Sequelize['ENUM'](_0x8561('0x19'),_0x8561('0x1a')),'defaultValue':_0x8561('0x19')},'ratingStarsNumber':{'type':Sequelize[_0x8561('0xf')],'defaultValue':0x5},'onlineForm':{'type':Sequelize[_0x8561('0x11')],'defaultValue':function(){return JSON['stringify']({'items':[{'type':_0x8561('0x1b'),'variable':null,'config':{'placeholder':'name','type':_0x8561('0x1c'),'required':!![]},'props':{'title':_0x8561('0x1d'),'helpText':''}},{'type':'input','props':{'title':_0x8561('0x4'),'helpText':''},'config':{'required':!![],'placeholder':_0x8561('0x4'),'type':_0x8561('0x4')},'variable':null}],'fromKey':0x1});},'get':function(){return this['getDataValue'](_0x8561('0x1e'))?JSON[_0x8561('0x1f')](this['getDataValue'](_0x8561('0x1e'))):{};},'set':function(_0x6a4e03){return this[_0x8561('0x20')](_0x8561('0x1e'),JSON[_0x8561('0x21')](_0x6a4e03));}},'offlineForm':{'type':Sequelize['TEXT'],'defaultValue':function(){return JSON[_0x8561('0x21')]({'items':[{'type':_0x8561('0x1b'),'props':{'title':'email','helpText':''},'config':{'required':!![],'placeholder':_0x8561('0x4'),'type':'email'},'variable':null},{'type':_0x8561('0x22'),'config':{'placeholder':_0x8561('0x23')},'props':{'title':_0x8561('0x23'),'helpText':'Leave\x20your\x20comments'}}],'fromKey':0x0});},'get':function(){return this[_0x8561('0x24')](_0x8561('0x25'))?JSON[_0x8561('0x1f')](this[_0x8561('0x24')]('offlineForm')):{};},'set':function(_0x190986){return this[_0x8561('0x20')]('offlineForm',JSON[_0x8561('0x21')](_0x190986));}},'token':{'type':Sequelize['STRING'],'defaultValue':function(){return rs[_0x8561('0x26')]();}},'autoclose':{'type':Sequelize[_0x8561('0x8')],'defaultValue':!![]},'enableCustomerWriting':{'type':Sequelize[_0x8561('0x8')],'defaultValue':![]},'forwardTranscript':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'forwardTranscriptMessage':{'type':Sequelize[_0x8561('0x2')]},'forwardOffline':{'type':Sequelize[_0x8561('0x8')],'defaultValue':![]},'forwardOfflineAddress':{'type':Sequelize[_0x8561('0x2')]},'waitingTitle':{'type':Sequelize['STRING'],'defaultValue':_0x8561('0x27')},'waitingMessage':{'type':Sequelize[_0x8561('0x2')],'defaultValue':_0x8561('0x28')},'offlineMessageSubject':{'type':Sequelize[_0x8561('0x2')],'defaultValue':_0x8561('0x29')},'offlineMessageBody':{'type':Sequelize[_0x8561('0x2')],'defaultValue':_0x8561('0x2a')},'enableUnmanagedNote':{'type':Sequelize[_0x8561('0x8')],'defaultValue':!![]},'unmanagedMessage':{'type':Sequelize[_0x8561('0x2')],'defaultValue':'Your\x20request\x20has\x20not\x20been\x20processed.'},'skipUnmanaged':{'type':Sequelize[_0x8561('0x2')],'defaultValue':_0x8561('0x2b')},'sendUnmanaged':{'type':Sequelize[_0x8561('0x2')],'defaultValue':_0x8561('0xd')},'enableCustomerAttachment':{'type':Sequelize[_0x8561('0x8')],'defaultValue':![]},'enableCustomerCheckmarks':{'type':Sequelize[_0x8561('0x8')],'defaultValue':![]},'agentAvatar':{'type':Sequelize['TEXT']},'showAgentAvatar':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'timezone':{'type':Sequelize[_0x8561('0x2')]},'notificationTemplate':{'type':Sequelize[_0x8561('0x11')],'defaultValue':function(){return'Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}';}},'notificationSound':{'type':Sequelize[_0x8561('0x8')],'defaultValue':!![]},'notificationShake':{'type':Sequelize[_0x8561('0x8')],'defaultValue':![]},'hideWhenOffline':{'type':Sequelize[_0x8561('0x8')],'defaultValue':![]},'agentIdentifier':{'type':Sequelize[_0x8561('0x2')],'defaultValue':_0x8561('0x2c')},'waitForTheAssignedAgent':{'type':Sequelize[_0x8561('0xf')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'alignment':{'type':Sequelize['STRING'],'defaultValue':_0x8561('0x2d')},'verticalAlignment':{'type':Sequelize[_0x8561('0xf')],'defaultValue':0x1e},'messagesAlignment':{'type':Sequelize[_0x8561('0x2')],'defaultValue':_0x8561('0x2e')},'defaultTitle':{'type':Sequelize[_0x8561('0x2')]},'customerAvatar':{'type':Sequelize[_0x8561('0x11')]},'showCustomerAvatar':{'type':Sequelize[_0x8561('0x8')],'defaultValue':![]},'messageFontSize':{'type':Sequelize[_0x8561('0xf')],'defaultValue':0xc},'backgroundColor':{'type':Sequelize[_0x8561('0x2')],'allowNull':![],'defaultValue':_0x8561('0x2f'),'validate':{'notEmpty':!![]}},'queueTransfer':{'type':Sequelize[_0x8561('0x8')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0x8561('0x8')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'systemAlias':{'type':Sequelize[_0x8561('0x2')],'defaultValue':'System'},'systemAvatar':{'type':Sequelize[_0x8561('0x11')]},'mandatoryDispositionPauseId':{'type':Sequelize['INTEGER'],'comment':_0x8561('0x30')},'mandatoryDisposition':{'type':Sequelize[_0x8561('0x8')],'defaultValue':![],'comment':_0x8561('0x31'),'set':function(_0x58d7a0){if(!_0x58d7a0)this[_0x8561('0x20')](_0x8561('0x32'),null);this['setDataValue']('mandatoryDisposition',_0x58d7a0);}},'vidaooEscalation':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'vidaooApiKey':{'type':Sequelize[_0x8561('0x2')]},'vidaooTopic':{'type':Sequelize[_0x8561('0x2')],'allowNull':![],'defaultValue':_0x8561('0x33')},'vidaooNote':{'type':Sequelize['STRING'],'defaultValue':function(){return _0x8561('0x34');}},'vidaooMetadata':{'type':Sequelize[_0x8561('0x11')],'defaultValue':null},'openNewInteraction':{'type':Sequelize[_0x8561('0x8')],'defaultValue':![],'allowNull':!![]},'subjectOffline':{'type':Sequelize[_0x8561('0x11')]}};
\ No newline at end of file
diff --git a/server/api/chatWebsite/chatWebsite.controller.js b/server/api/chatWebsite/chatWebsite.controller.js
index 05328df..3e9834a 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 _0x309b=['headers','user-agent','getResult','chat','ValidationError','no\x20available\x20attributes','updatedAt','difference','CompanyId','ListId','from','from\x20is\x20mandatory','Sequelize','body\x20is\x20mandatory\x20and\x20not\x20empty','mapKey','mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','CmList','CmContact','Contacts','DESC','ChatApplication','Applications','List','applications','list','orderBy','asc','account','contact','customerIp','cf-connecting-ip','x-forwarded-for','first','x-real-port','browser','%s\x20%s','version','unknown','format','device','%s\x20%s\x20%s','vendor','threadId','ChatInteraction','externalUrl','interaction','lastName','messageId','autoclose','push','close','*,*,*,*','ChatMessage','UserId','User','unshift','agent','waitForTheAssignedAgent','forcedOwnership','startRouting','EventManager','offline','files','createdAt','mapKeyOffline\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','includes','mapKeyOffline','mapKeyOffline\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','MailAccount','findOrCreate','spread','readFileSync','server/files/templates/chatOfflineMessage.ejs','toPairs','ChatOfflineMessage','originalname','attachments','offline-chat','transaction','Attachment','bulkCreate','Smtp','forwardOffline','forwardOfflineAddress','service','host','port','secure','pass','SendMail','sendMail','\x22%s\x22\x20<%s>','email','openNewInteraction','MailAccountId','mimetype','subjectOffline','toPairsIn','mapValues','firstName','offlineMessageSubject','Chat','NotifyMailAccount','notifyMail','server','Could\x20not\x20remove\x20attachment\x20file','addInteraction','Contact','fullname','color','tag','Command','getSnippet','timezone','iftime\x20%s,%s','iftime\x20%s','interval','indexOf','true','[%s][INTERVAL][%s]\x20%s\x20%s\x20(%s)','ONLINE','OFFLINE','No\x20timezone','Interval','Intervals','getProactiveActions','virtual','increment','all','server/files/chat/iframe.ejs','x-real-ip','connection','referer','replace','render','alignment','verticalAlignment','color_button','backgroundColor','addApplications','sequelize','Transaction','READ_COMMITTED','findAndCountAll','priority','finally','json','getApplications','addProactiveActions','chatProactiveAction','ChatProactiveAction','getFields','online','offlineForm','onlineForm','items','getOfflineMessages','Attachments','addAgents','omit','emit','userChatWebsite:save','removeAgents','isArray','getAgents','bluebird','util','path','ejs','fs-extra','ioredis','../../config/logger','api','../../config/environment','redis','defaults','socket.io-emitter','./chatWebsite.socket','http','client','request','then','info','ChatWebsite,\x20%s,\x20%s','request\x20sent','debug','ChatWebsite,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','sendStatus','status','end','offset','undefined','count','limit','set','update','destroy','get','UserProfileResource','stack','name','send','Pause','mandatoryDispositionPause','map','rawAttributes','key','model','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','order','sort','where','pick','filter','merge','type','VIRTUAL','options','ChatWebsite','includeAll','include','findAll','rows','catch','params','find','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','ChatWebsites','UserProfileSection','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','describe','addDisposition','getDispositions','findOne','Disposition','nolimit','ChatWebsiteId','removeDispositions','addAnswer','CannedAnswer','getAnswers','removeAnswers','ids','addLogo','sitepic','addAvatar','agentAvatar','file','filename','addCustomerAvatar','customerAvatar','addSystemAvatar','systemAvatar','getLogo','root','../../config/license/util','getLicense','custom','isNil','join','server/files/images/logos/','download','server/files/images/avatars/default_avatar.png','existsSync','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'];(function(_0x36ed48,_0x1ee0d4){var _0x51c63a=function(_0x2d0a40){while(--_0x2d0a40){_0x36ed48['push'](_0x36ed48['shift']());}};_0x51c63a(++_0x1ee0d4);}(_0x309b,0x1c9));var _0xb309=function(_0x435e1c,_0x148724){_0x435e1c=_0x435e1c-0x0;var _0x551fe6=_0x309b[_0x435e1c];return _0x551fe6;};'use strict';var BPromise=require(_0xb309('0x0'));var Mustache=require('mustache');var util=require(_0xb309('0x1'));var path=require(_0xb309('0x2'));var ejs=require(_0xb309('0x3'));var fs=require('fs');var fs_extra=require(_0xb309('0x4'));var _=require('lodash');var querystring=require('querystring');var Redis=require(_0xb309('0x5'));var qs=require('../../components/parsers/qs');var logger=require(_0xb309('0x6'))(_0xb309('0x7'));var config=require(_0xb309('0x8'));var db=require('../../mysqldb')['db'];config[_0xb309('0x9')]=_[_0xb309('0xa')](config[_0xb309('0x9')],{'host':'localhost','port':0x18eb});var socket=require(_0xb309('0xb'))(new Redis(config[_0xb309('0x9')]));require(_0xb309('0xc'))['register'](socket);var jayson=require('jayson/promise');var client=jayson['client'][_0xb309('0xd')]({'port':0x232c});var client9002=jayson[_0xb309('0xe')][_0xb309('0xd')]({'port':0x232a});var client9003=jayson['client'][_0xb309('0xd')]({'port':0x232b});var client9001=jayson[_0xb309('0xe')][_0xb309('0xd')]({'port':0x2329});function respondWithRpcPromise(_0x41c7bb,_0x5f4be4,_0x46490e,_0x19cb3c){return new BPromise(function(_0x380b6f,_0x39e47c){var _0x2deba5=_0x19cb3c||client;return _0x2deba5[_0xb309('0xf')](_0x41c7bb,_0x46490e)[_0xb309('0x10')](function(_0x42abfb){logger[_0xb309('0x11')](_0xb309('0x12'),_0x5f4be4,_0xb309('0x13'));logger[_0xb309('0x14')](_0xb309('0x15'),_0x5f4be4,_0xb309('0x13'),JSON[_0xb309('0x16')](_0x42abfb));if(_0x42abfb[_0xb309('0x17')]){if(_0x42abfb[_0xb309('0x17')][_0xb309('0x18')]===0x1f4){logger[_0xb309('0x17')]('ChatWebsite,\x20%s,\x20%s',_0x5f4be4,_0x42abfb[_0xb309('0x17')]['message']);return _0x39e47c(_0x42abfb['error']['message']);}logger[_0xb309('0x17')]('ChatWebsite,\x20%s,\x20%s',_0x5f4be4,_0x42abfb[_0xb309('0x17')][_0xb309('0x19')]);return _0x380b6f(_0x42abfb['error']['message']);}else{logger[_0xb309('0x11')](_0xb309('0x12'),_0x5f4be4,_0xb309('0x13'));_0x380b6f(_0x42abfb[_0xb309('0x1a')][_0xb309('0x19')]);}})['catch'](function(_0x363f27){logger[_0xb309('0x17')](_0xb309('0x12'),_0x5f4be4,_0x363f27);_0x39e47c(_0x363f27);});});}function respondWithStatusCode(_0x17f83a,_0x203117){_0x203117=_0x203117||0xcc;return function(_0x3652cf){if(_0x3652cf){return _0x17f83a[_0xb309('0x1b')](_0x203117);}return _0x17f83a[_0xb309('0x1c')](_0x203117)[_0xb309('0x1d')]();};}function respondWithResult(_0x546597,_0x54e880){_0x54e880=_0x54e880||0xc8;return function(_0x3e032e){if(_0x3e032e){return _0x546597[_0xb309('0x1c')](_0x54e880)['json'](_0x3e032e);}};}function respondWithFilteredResult(_0x4df740,_0x509ec3){return function(_0x3b2005){if(_0x3b2005){var _0xc7a7af=typeof _0x509ec3[_0xb309('0x1e')]===_0xb309('0x1f')&&typeof _0x509ec3['limit']===_0xb309('0x1f');var _0x49574a=_0x3b2005[_0xb309('0x20')];var _0xf71cd9=_0xc7a7af?0x0:_0x509ec3['offset'];var _0x3784f4=_0xc7a7af?_0x3b2005[_0xb309('0x20')]:_0x509ec3['offset']+_0x509ec3[_0xb309('0x21')];var _0x1870eb;if(_0x3784f4>=_0x49574a){_0x3784f4=_0x49574a;_0x1870eb=0xc8;}else{_0x1870eb=0xce;}_0x4df740['status'](_0x1870eb);return _0x4df740[_0xb309('0x22')]('Content-Range',_0xf71cd9+'-'+_0x3784f4+'/'+_0x49574a)['json'](_0x3b2005);}return null;};}function saveUpdates(_0x26fdcf){return function(_0x544fb5){if(_0x544fb5){return _0x544fb5[_0xb309('0x23')](_0x26fdcf)['then'](function(_0x5dd946){return _0x5dd946;});}return null;};}function removeEntity(_0x340b28){return function(_0x5b46eb){if(_0x5b46eb){return _0x5b46eb[_0xb309('0x24')]()['then'](function(){var _0xdbdff8=_0x5b46eb[_0xb309('0x25')]({'plain':!![]});var _0x527b17='ChatWebsites';return db[_0xb309('0x26')][_0xb309('0x24')]({'where':{'type':_0x527b17,'resourceId':_0xdbdff8['id']}})[_0xb309('0x10')](function(){return _0x5b46eb;});})[_0xb309('0x10')](function(){_0x340b28[_0xb309('0x1c')](0xcc)['end']();});}};}function handleEntityNotFound(_0x3da124){return function(_0x30c0f9){if(!_0x30c0f9){_0x3da124[_0xb309('0x1b')](0x194);}return _0x30c0f9;};}function handleError(_0x29000d,_0x2c85c2){_0x2c85c2=_0x2c85c2||0x1f4;return function(_0x411ab4){logger[_0xb309('0x17')](_0x411ab4[_0xb309('0x27')]);if(_0x411ab4[_0xb309('0x28')]){delete _0x411ab4[_0xb309('0x28')];}_0x29000d[_0xb309('0x1c')](_0x2c85c2)[_0xb309('0x29')](_0x411ab4);};}exports['index']=function(_0x4a91c4,_0x2f62ee){var _0x461a9c={'include':[{'model':db[_0xb309('0x2a')],'as':_0xb309('0x2b')}]},_0x2162c2={},_0x516e8b={'count':0x0,'rows':[]};var _0x3cbeeb=_[_0xb309('0x2c')](db['ChatWebsite'][_0xb309('0x2d')],function(_0x233873){return{'name':_0x233873['fieldName'],'type':_0x233873['type'][_0xb309('0x2e')]};});_0x2162c2[_0xb309('0x2f')]=_['map'](_0x3cbeeb,_0xb309('0x28'));_0x2162c2['query']=_[_0xb309('0x30')](_0x4a91c4[_0xb309('0x31')]);_0x2162c2[_0xb309('0x32')]=_[_0xb309('0x33')](_0x2162c2[_0xb309('0x2f')],_0x2162c2[_0xb309('0x31')]);_0x461a9c[_0xb309('0x34')]=_[_0xb309('0x33')](_0x2162c2['model'],qs[_0xb309('0x35')](_0x4a91c4[_0xb309('0x31')][_0xb309('0x35')]));_0x461a9c[_0xb309('0x34')]=_0x461a9c[_0xb309('0x34')][_0xb309('0x36')]?_0x461a9c['attributes']:_0x2162c2['model'];if(!_0x4a91c4[_0xb309('0x31')][_0xb309('0x37')]('nolimit')){_0x461a9c[_0xb309('0x21')]=qs[_0xb309('0x21')](_0x4a91c4[_0xb309('0x31')][_0xb309('0x21')]);_0x461a9c['offset']=qs[_0xb309('0x1e')](_0x4a91c4[_0xb309('0x31')][_0xb309('0x1e')]);}_0x461a9c[_0xb309('0x38')]=qs[_0xb309('0x39')](_0x4a91c4['query']['sort']);_0x461a9c[_0xb309('0x3a')]=qs['filters'](_[_0xb309('0x3b')](_0x4a91c4[_0xb309('0x31')],_0x2162c2[_0xb309('0x32')]),_0x3cbeeb);if(_0x4a91c4[_0xb309('0x31')][_0xb309('0x3c')]){_0x461a9c['where']=_[_0xb309('0x3d')](_0x461a9c[_0xb309('0x3a')],{'$or':_[_0xb309('0x2c')](_0x3cbeeb,function(_0x539c61){if(_0x539c61[_0xb309('0x3e')]!==_0xb309('0x3f')){var _0x51f77c={};_0x51f77c[_0x539c61[_0xb309('0x28')]]={'$like':'%'+_0x4a91c4['query']['filter']+'%'};return _0x51f77c;}})});}_0x461a9c=_[_0xb309('0x3d')]({},_0x461a9c,_0x4a91c4[_0xb309('0x40')]);var _0x59d545={'where':_0x461a9c['where']};return db[_0xb309('0x41')][_0xb309('0x20')](_0x59d545)[_0xb309('0x10')](function(_0x2b71e9){_0x516e8b[_0xb309('0x20')]=_0x2b71e9;if(_0x4a91c4['query'][_0xb309('0x42')]){_0x461a9c[_0xb309('0x43')]=[{'all':!![]}];}return db[_0xb309('0x41')][_0xb309('0x44')](_0x461a9c);})['then'](function(_0x16142c){_0x516e8b[_0xb309('0x45')]=_0x16142c;return _0x516e8b;})[_0xb309('0x10')](respondWithFilteredResult(_0x2f62ee,_0x461a9c))[_0xb309('0x46')](handleError(_0x2f62ee,null));};exports['show']=function(_0x43bdec,_0x1b33d8){var _0x27a0bc={'raw':![],'where':{'id':_0x43bdec[_0xb309('0x47')]['id']},'include':[{'model':db[_0xb309('0x2a')],'as':'mandatoryDispositionPause'}]},_0x525e76={};_0x525e76[_0xb309('0x2f')]=_[_0xb309('0x30')](db[_0xb309('0x41')][_0xb309('0x2d')]);_0x525e76[_0xb309('0x31')]=_['keys'](_0x43bdec['query']);_0x525e76[_0xb309('0x32')]=_['intersection'](_0x525e76[_0xb309('0x2f')],_0x525e76[_0xb309('0x31')]);_0x27a0bc['attributes']=_['intersection'](_0x525e76[_0xb309('0x2f')],qs[_0xb309('0x35')](_0x43bdec[_0xb309('0x31')][_0xb309('0x35')]));_0x27a0bc[_0xb309('0x34')]=_0x27a0bc[_0xb309('0x34')][_0xb309('0x36')]?_0x27a0bc[_0xb309('0x34')]:_0x525e76[_0xb309('0x2f')];if(_0x43bdec[_0xb309('0x31')]['includeAll']){_0x27a0bc[_0xb309('0x43')]=[{'all':!![]}];}_0x27a0bc=_[_0xb309('0x3d')]({},_0x27a0bc,_0x43bdec[_0xb309('0x40')]);return db[_0xb309('0x41')][_0xb309('0x48')](_0x27a0bc)['then'](handleEntityNotFound(_0x1b33d8,null))[_0xb309('0x10')](respondWithResult(_0x1b33d8,null))[_0xb309('0x46')](handleError(_0x1b33d8,null));};exports[_0xb309('0x49')]=function(_0x2c95d0,_0x58f254){return db[_0xb309('0x41')][_0xb309('0x49')](_0x2c95d0['body'],{})[_0xb309('0x10')](function(_0xeae350){var _0x476ffe=_0x2c95d0[_0xb309('0x4a')][_0xb309('0x25')]({'plain':!![]});if(!_0x476ffe)throw new Error(_0xb309('0x4b'));if(_0x476ffe[_0xb309('0x4c')]===_0xb309('0x4a')){var _0x39731e=_0xeae350[_0xb309('0x25')]({'plain':!![]});var _0x108771=_0xb309('0x4d');return db[_0xb309('0x4e')][_0xb309('0x48')]({'where':{'name':_0x108771,'userProfileId':_0x476ffe['userProfileId']},'raw':!![]})[_0xb309('0x10')](function(_0x7704c9){if(_0x7704c9&&_0x7704c9[_0xb309('0x4f')]===0x0){return db[_0xb309('0x26')][_0xb309('0x49')]({'name':_0x39731e[_0xb309('0x28')],'resourceId':_0x39731e['id'],'type':_0x7704c9[_0xb309('0x28')],'sectionId':_0x7704c9['id']},{})[_0xb309('0x10')](function(){return _0xeae350;});}else{return _0xeae350;}})[_0xb309('0x46')](function(_0x87a542){logger[_0xb309('0x17')](_0xb309('0x50'),_0x87a542);throw _0x87a542;});}return _0xeae350;})['then'](respondWithResult(_0x58f254,0xc9))[_0xb309('0x46')](handleError(_0x58f254,null));};exports[_0xb309('0x23')]=function(_0x4367c4,_0x45fbb4){if(_0x4367c4[_0xb309('0x51')]['id']){delete _0x4367c4[_0xb309('0x51')]['id'];}return db[_0xb309('0x41')][_0xb309('0x48')]({'where':{'id':_0x4367c4[_0xb309('0x47')]['id']},'include':[{'model':db[_0xb309('0x2a')],'as':_0xb309('0x2b')}]})[_0xb309('0x10')](handleEntityNotFound(_0x45fbb4,null))[_0xb309('0x10')](saveUpdates(_0x4367c4[_0xb309('0x51')],null))[_0xb309('0x10')](respondWithResult(_0x45fbb4,null))[_0xb309('0x46')](handleError(_0x45fbb4,null));};exports['destroy']=function(_0x290712,_0x27d19f){return db[_0xb309('0x41')][_0xb309('0x48')]({'where':{'id':_0x290712[_0xb309('0x47')]['id']}})[_0xb309('0x10')](handleEntityNotFound(_0x27d19f,null))[_0xb309('0x10')](removeEntity(_0x27d19f,null))[_0xb309('0x46')](handleError(_0x27d19f,null));};exports[_0xb309('0x52')]=function(_0x255992,_0x209676){return db[_0xb309('0x41')]['describe']()[_0xb309('0x10')](respondWithResult(_0x209676,null))[_0xb309('0x46')](handleError(_0x209676,null));};exports[_0xb309('0x53')]=function(_0x29c8d1,_0x1165b8){if(_0x29c8d1[_0xb309('0x51')]['id']){delete _0x29c8d1['body']['id'];}return db[_0xb309('0x41')][_0xb309('0x48')]({'where':{'id':_0x29c8d1[_0xb309('0x47')]['id']}})[_0xb309('0x10')](handleEntityNotFound(_0x1165b8,null))['then'](function(_0xc91413){if(_0xc91413){_0x29c8d1[_0xb309('0x51')]['ChatWebsiteId']=_0xc91413['id'];return db['Disposition'][_0xb309('0x49')](_0x29c8d1['body']);}})[_0xb309('0x10')](respondWithResult(_0x1165b8,null))[_0xb309('0x46')](handleError(_0x1165b8,null));};exports[_0xb309('0x54')]=function(_0x5d30eb,_0x45e14f){var _0x20ae26={'raw':![],'where':{}};var _0x3a30eb={};var _0x10c6c4={'count':0x0,'rows':[]};return db[_0xb309('0x41')][_0xb309('0x55')]({'where':{'id':_0x5d30eb['params']['id']}})['then'](handleEntityNotFound(_0x45e14f,null))[_0xb309('0x10')](function(_0x328dcd){if(_0x328dcd){_0x3a30eb[_0xb309('0x2f')]=_[_0xb309('0x30')](db[_0xb309('0x56')][_0xb309('0x2d')]);_0x3a30eb['query']=_['keys'](_0x5d30eb[_0xb309('0x31')]);_0x3a30eb[_0xb309('0x32')]=_[_0xb309('0x33')](_0x3a30eb[_0xb309('0x2f')],_0x3a30eb['query']);_0x20ae26[_0xb309('0x34')]=_['intersection'](_0x3a30eb[_0xb309('0x2f')],qs[_0xb309('0x35')](_0x5d30eb[_0xb309('0x31')][_0xb309('0x35')]));_0x20ae26[_0xb309('0x34')]=_0x20ae26[_0xb309('0x34')][_0xb309('0x36')]?_0x20ae26[_0xb309('0x34')]:_0x3a30eb['model'];if(!_0x5d30eb[_0xb309('0x31')]['hasOwnProperty'](_0xb309('0x57'))){_0x20ae26[_0xb309('0x21')]=qs[_0xb309('0x21')](_0x5d30eb[_0xb309('0x31')][_0xb309('0x21')]);_0x20ae26[_0xb309('0x1e')]=qs[_0xb309('0x1e')](_0x5d30eb[_0xb309('0x31')][_0xb309('0x1e')]);}_0x20ae26[_0xb309('0x38')]=qs['sort'](_0x5d30eb[_0xb309('0x31')]['sort']);_0x20ae26[_0xb309('0x3a')]=qs[_0xb309('0x32')](_['pick'](_0x5d30eb[_0xb309('0x31')],_0x3a30eb[_0xb309('0x32')]));_0x20ae26[_0xb309('0x3a')][_0xb309('0x58')]=_0x328dcd['id'];if(_0x5d30eb['query'][_0xb309('0x3c')]){_0x20ae26[_0xb309('0x3a')]=_[_0xb309('0x3d')](_0x20ae26[_0xb309('0x3a')],{'$or':_[_0xb309('0x2c')](_0x20ae26[_0xb309('0x34')],function(_0xcf72aa){var _0x5295c3={};_0x5295c3[_0xcf72aa]={'$like':'%'+_0x5d30eb[_0xb309('0x31')]['filter']+'%'};return _0x5295c3;})});}_0x20ae26=_['merge']({},_0x20ae26,_0x5d30eb[_0xb309('0x40')]);return db[_0xb309('0x56')]['count']({'where':_0x20ae26[_0xb309('0x3a')]})[_0xb309('0x10')](function(_0x14681e){_0x10c6c4['count']=_0x14681e;if(_0x5d30eb[_0xb309('0x31')][_0xb309('0x42')]){_0x20ae26[_0xb309('0x43')]=[{'all':!![]}];}return db[_0xb309('0x56')][_0xb309('0x44')](_0x20ae26);})[_0xb309('0x10')](function(_0x19e40f){_0x10c6c4[_0xb309('0x45')]=_0x19e40f;return _0x10c6c4;});}})[_0xb309('0x10')](respondWithFilteredResult(_0x45e14f,_0x20ae26))['catch'](handleError(_0x45e14f,null));};exports[_0xb309('0x59')]=function(_0x5176f0,_0x351a1a){return db[_0xb309('0x41')][_0xb309('0x48')]({'where':{'id':_0x5176f0['params']['id']}})['then'](handleEntityNotFound(_0x351a1a,null))[_0xb309('0x10')](function(_0x524850){if(_0x524850){return _0x524850[_0xb309('0x59')](_0x5176f0[_0xb309('0x31')]['ids']);}})[_0xb309('0x10')](respondWithStatusCode(_0x351a1a,null))[_0xb309('0x46')](handleError(_0x351a1a,null));};exports[_0xb309('0x5a')]=function(_0x5705a4,_0x13c66e){if(_0x5705a4[_0xb309('0x51')]['id']){delete _0x5705a4[_0xb309('0x51')]['id'];}return db[_0xb309('0x41')][_0xb309('0x48')]({'where':{'id':_0x5705a4[_0xb309('0x47')]['id']}})[_0xb309('0x10')](handleEntityNotFound(_0x13c66e,null))[_0xb309('0x10')](function(_0x1eaddc){if(_0x1eaddc){_0x5705a4['body']['ChatWebsiteId']=_0x1eaddc['id'];return db[_0xb309('0x5b')]['create'](_0x5705a4[_0xb309('0x51')]);}})['then'](respondWithResult(_0x13c66e,null))[_0xb309('0x46')](handleError(_0x13c66e,null));};exports[_0xb309('0x5c')]=function(_0x551f58,_0x3522eb){var _0xfd9ef0={'raw':![],'where':{}};var _0x2bbdb5={};var _0x558858={'count':0x0,'rows':[]};return db[_0xb309('0x41')]['findOne']({'where':{'id':_0x551f58['params']['id']}})[_0xb309('0x10')](handleEntityNotFound(_0x3522eb,null))[_0xb309('0x10')](function(_0x52f3b2){if(_0x52f3b2){_0x2bbdb5[_0xb309('0x2f')]=_[_0xb309('0x30')](db[_0xb309('0x5b')]['rawAttributes']);_0x2bbdb5['query']=_[_0xb309('0x30')](_0x551f58[_0xb309('0x31')]);_0x2bbdb5[_0xb309('0x32')]=_['intersection'](_0x2bbdb5[_0xb309('0x2f')],_0x2bbdb5[_0xb309('0x31')]);_0xfd9ef0[_0xb309('0x34')]=_[_0xb309('0x33')](_0x2bbdb5[_0xb309('0x2f')],qs['fields'](_0x551f58['query'][_0xb309('0x35')]));_0xfd9ef0[_0xb309('0x34')]=_0xfd9ef0['attributes'][_0xb309('0x36')]?_0xfd9ef0[_0xb309('0x34')]:_0x2bbdb5[_0xb309('0x2f')];if(!_0x551f58[_0xb309('0x31')][_0xb309('0x37')](_0xb309('0x57'))){_0xfd9ef0[_0xb309('0x21')]=qs[_0xb309('0x21')](_0x551f58['query'][_0xb309('0x21')]);_0xfd9ef0[_0xb309('0x1e')]=qs[_0xb309('0x1e')](_0x551f58[_0xb309('0x31')]['offset']);}_0xfd9ef0[_0xb309('0x38')]=qs[_0xb309('0x39')](_0x551f58[_0xb309('0x31')][_0xb309('0x39')]);_0xfd9ef0['where']=qs['filters'](_['pick'](_0x551f58[_0xb309('0x31')],_0x2bbdb5['filters']));_0xfd9ef0[_0xb309('0x3a')][_0xb309('0x58')]=_0x52f3b2['id'];if(_0x551f58[_0xb309('0x31')][_0xb309('0x3c')]){_0xfd9ef0[_0xb309('0x3a')]=_[_0xb309('0x3d')](_0xfd9ef0[_0xb309('0x3a')],{'$or':_[_0xb309('0x2c')](_0xfd9ef0['attributes'],function(_0x5ee290){var _0x2739de={};_0x2739de[_0x5ee290]={'$like':'%'+_0x551f58[_0xb309('0x31')][_0xb309('0x3c')]+'%'};return _0x2739de;})});}_0xfd9ef0=_[_0xb309('0x3d')]({},_0xfd9ef0,_0x551f58[_0xb309('0x40')]);return db[_0xb309('0x5b')]['count']({'where':_0xfd9ef0[_0xb309('0x3a')]})[_0xb309('0x10')](function(_0x1e4d95){_0x558858[_0xb309('0x20')]=_0x1e4d95;if(_0x551f58[_0xb309('0x31')][_0xb309('0x42')]){_0xfd9ef0[_0xb309('0x43')]=[{'all':!![]}];}return db['CannedAnswer'][_0xb309('0x44')](_0xfd9ef0);})[_0xb309('0x10')](function(_0x49d406){_0x558858[_0xb309('0x45')]=_0x49d406;return _0x558858;});}})[_0xb309('0x10')](respondWithFilteredResult(_0x3522eb,_0xfd9ef0))[_0xb309('0x46')](handleError(_0x3522eb,null));};exports[_0xb309('0x5d')]=function(_0x53e5b5,_0x568d60){return db[_0xb309('0x41')][_0xb309('0x48')]({'where':{'id':_0x53e5b5[_0xb309('0x47')]['id']}})[_0xb309('0x10')](handleEntityNotFound(_0x568d60,null))[_0xb309('0x10')](function(_0x25a025){if(_0x25a025){return _0x25a025[_0xb309('0x5d')](_0x53e5b5['query'][_0xb309('0x5e')]);}})[_0xb309('0x10')](respondWithStatusCode(_0x568d60,null))[_0xb309('0x46')](handleError(_0x568d60,null));};exports[_0xb309('0x5f')]=function(_0x29a2fa,_0x3bcff0){_0x29a2fa[_0xb309('0x51')][_0xb309('0x60')]=_0x29a2fa['file']['filename'];return db['ChatWebsite'][_0xb309('0x48')]({'where':{'id':_0x29a2fa[_0xb309('0x47')]['id']}})[_0xb309('0x10')](handleEntityNotFound(_0x3bcff0,null))['then'](saveUpdates(_0x29a2fa['body'],null))[_0xb309('0x10')](respondWithResult(_0x3bcff0,null))[_0xb309('0x46')](handleError(_0x3bcff0,null));};exports[_0xb309('0x61')]=function(_0x1ce0ab,_0x3b81d8){_0x1ce0ab['body'][_0xb309('0x62')]=_0x1ce0ab[_0xb309('0x63')][_0xb309('0x64')];return db[_0xb309('0x41')][_0xb309('0x48')]({'where':{'id':_0x1ce0ab[_0xb309('0x47')]['id']}})['then'](handleEntityNotFound(_0x3b81d8,null))[_0xb309('0x10')](saveUpdates(_0x1ce0ab[_0xb309('0x51')],null))['then'](respondWithResult(_0x3b81d8,null))[_0xb309('0x46')](handleError(_0x3b81d8,null));};exports[_0xb309('0x65')]=function(_0x3db0a4,_0x3f94ed){_0x3db0a4[_0xb309('0x51')][_0xb309('0x66')]=_0x3db0a4['file'][_0xb309('0x64')];return db[_0xb309('0x41')][_0xb309('0x48')]({'where':{'id':_0x3db0a4['params']['id']}})[_0xb309('0x10')](handleEntityNotFound(_0x3f94ed,null))['then'](saveUpdates(_0x3db0a4[_0xb309('0x51')],null))[_0xb309('0x10')](respondWithResult(_0x3f94ed,null))[_0xb309('0x46')](handleError(_0x3f94ed,null));};exports[_0xb309('0x67')]=function(_0x19bbf6,_0xd37669){_0x19bbf6['body'][_0xb309('0x68')]=_0x19bbf6[_0xb309('0x63')][_0xb309('0x64')];return db[_0xb309('0x41')][_0xb309('0x48')]({'where':{'id':_0x19bbf6[_0xb309('0x47')]['id']}})['then'](handleEntityNotFound(_0xd37669,null))[_0xb309('0x10')](saveUpdates(_0x19bbf6[_0xb309('0x51')],null))[_0xb309('0x10')](respondWithResult(_0xd37669,null))['catch'](handleError(_0xd37669,null));};exports[_0xb309('0x69')]=function(_0x40585d,_0x854523){var _0x26bdb0=path['join'](config[_0xb309('0x6a')],'server/files/images/logos/default_logo.svg');var _0x301b73={'where':{'id':_0x40585d['params']['id']},'attributes':['id',_0xb309('0x60')],'raw':!![]};var _0x50784a=![];return require(_0xb309('0x6b'))[_0xb309('0x6c')]()[_0xb309('0x10')](function(_0xfdbcfe){if(_0xfdbcfe){_0x50784a=_0xfdbcfe[_0xb309('0x6d')];}})[_0xb309('0x10')](function(){return db['ChatWebsite']['find'](_0x301b73);})[_0xb309('0x10')](handleEntityNotFound(_0x854523,null))['then'](function(_0x3322ac){if(_0x3322ac){if(!_[_0xb309('0x6e')](_0x3322ac[_0xb309('0x60')])){if(fs['existsSync'](path[_0xb309('0x6f')](config['root'],_0xb309('0x70'),_0x3322ac[_0xb309('0x60')]))&&_0x50784a){_0x26bdb0=path[_0xb309('0x6f')](config['root'],_0xb309('0x70'),_0x3322ac[_0xb309('0x60')]);}}return _0x854523[_0xb309('0x71')](_0x26bdb0);}})['catch'](handleError(_0x854523,null));};exports['getAvatar']=function(_0x3123aa,_0x2300da){var _0x2254fb=path[_0xb309('0x6f')](config[_0xb309('0x6a')],_0xb309('0x72'));var _0x40c170={'where':{'id':_0x3123aa['params']['id']},'attributes':['id',_0xb309('0x62')],'raw':!![]};return db['ChatWebsite'][_0xb309('0x48')](_0x40c170)[_0xb309('0x10')](handleEntityNotFound(_0x2300da,null))[_0xb309('0x10')](function(_0x37c48f){if(_0x37c48f){if(!_['isNil'](_0x37c48f[_0xb309('0x62')])){if(fs[_0xb309('0x73')](path['join'](config[_0xb309('0x6a')],_0xb309('0x74'),_0x37c48f[_0xb309('0x62')]))){_0x2254fb=path[_0xb309('0x6f')](config[_0xb309('0x6a')],'server/files/images/avatars/',_0x37c48f[_0xb309('0x62')]);}}return _0x2300da[_0xb309('0x71')](_0x2254fb);}})[_0xb309('0x46')](handleError(_0x2300da,null));};exports[_0xb309('0x75')]=function(_0x585665,_0x374005){var _0xea384c=path[_0xb309('0x6f')](config[_0xb309('0x6a')],_0xb309('0x76'));var _0x599bdf={'where':{'id':_0x585665[_0xb309('0x47')]['id']},'attributes':['id',_0xb309('0x66'),_0xb309('0x77')],'raw':!![]};return db[_0xb309('0x41')][_0xb309('0x48')](_0x599bdf)[_0xb309('0x10')](handleEntityNotFound(_0x374005,null))[_0xb309('0x10')](function(_0x400687){if(_0x400687){if(!_['isNil'](_0x400687['customerAvatar'])){if(fs[_0xb309('0x73')](path['join'](config[_0xb309('0x6a')],_0xb309('0x74'),_0x400687[_0xb309('0x66')]))&&_0x400687[_0xb309('0x77')]){_0xea384c=path[_0xb309('0x6f')](config[_0xb309('0x6a')],_0xb309('0x74'),_0x400687[_0xb309('0x66')]);}}return _0x374005[_0xb309('0x71')](_0xea384c);}})[_0xb309('0x46')](handleError(_0x374005,null));};exports[_0xb309('0x78')]=function(_0x35a4e1,_0x2cce1c){var _0x3a61a7=path[_0xb309('0x6f')](config[_0xb309('0x6a')],_0xb309('0x79'));var _0x4914f6={'where':{'id':_0x35a4e1['params']['id']},'attributes':['id','systemAvatar'],'raw':!![]};return db[_0xb309('0x41')][_0xb309('0x48')](_0x4914f6)[_0xb309('0x10')](handleEntityNotFound(_0x2cce1c,null))['then'](function(_0x2bc649){if(_0x2bc649){if(!_[_0xb309('0x6e')](_0x2bc649[_0xb309('0x68')])){if(fs[_0xb309('0x73')](path[_0xb309('0x6f')](config[_0xb309('0x6a')],_0xb309('0x74'),_0x2bc649[_0xb309('0x68')]))){_0x3a61a7=path['join'](config[_0xb309('0x6a')],'server/files/images/avatars/',_0x2bc649['systemAvatar']);}}return _0x2cce1c['download'](_0x3a61a7);}})[_0xb309('0x46')](handleError(_0x2cce1c,null));};exports[_0xb309('0x7a')]=function(_0x181e04,_0x1082f8){var _0x4673c8=require(_0xb309('0x7b'));var _0x195fac=new _0x4673c8();var _0x36170f=_0x195fac[_0xb309('0x7c')](_0x181e04[_0xb309('0x7d')][_0xb309('0x7e')])[_0xb309('0x7f')]();var _0x35bcb5={'body':_0x181e04[_0xb309('0x51')],'channel':_0xb309('0x80')};var _0x33c047=[];var _0x5acbad=[];var _0x4bed99={};var _0x231ef8=![];return db['CmContact'][_0xb309('0x52')]()[_0xb309('0x10')](function(_0x44e63d){if(!_0x44e63d){throw new db['Sequelize'][(_0xb309('0x81'))](_0xb309('0x82'));}_0x33c047=_['difference'](_[_0xb309('0x30')](_0x44e63d),['createdAt',_0xb309('0x83')]);_0x5acbad=_[_0xb309('0x84')](_[_0xb309('0x30')](_0x44e63d),['createdAt',_0xb309('0x83'),_0xb309('0x85'),_0xb309('0x86')]);if(_0x181e04['body']['id']){delete _0x181e04[_0xb309('0x51')]['id'];}if(_[_0xb309('0x6e')](_0x181e04['body'][_0xb309('0x87')])){throw new db['Sequelize'][(_0xb309('0x81'))](_0xb309('0x88'));}if(_[_0xb309('0x6e')](_0x181e04[_0xb309('0x51')][_0xb309('0x51')])||_0x181e04[_0xb309('0x51')][_0xb309('0x51')]===''){throw new db[(_0xb309('0x89'))]['ValidationError'](_0xb309('0x8a'));}if(_[_0xb309('0x6e')](_0x181e04[_0xb309('0x51')][_0xb309('0x8b')])){throw new db[(_0xb309('0x89'))][(_0xb309('0x81'))](_0xb309('0x8c')+_0x5acbad);}if(!_['includes'](_0x5acbad,_0x181e04['body'][_0xb309('0x8b')])){throw new db[(_0xb309('0x89'))][(_0xb309('0x81'))](_0xb309('0x8d')+_0x5acbad);}_0x4bed99[_0x181e04[_0xb309('0x51')][_0xb309('0x8b')]]=_0x181e04[_0xb309('0x51')][_0xb309('0x87')];})[_0xb309('0x10')](function(){return db[_0xb309('0x41')][_0xb309('0x48')]({'where':{'id':_0x181e04[_0xb309('0x47')]['id']},'include':[{'model':db[_0xb309('0x8e')],'as':'List','include':[{'model':db[_0xb309('0x8f')],'as':_0xb309('0x90'),'where':_0x4bed99,'limit':0x1,'order':[[_0xb309('0x83'),_0xb309('0x91')]]}]},{'model':db[_0xb309('0x92')],'as':_0xb309('0x93')}]});})['then'](handleEntityNotFound(_0x1082f8,null))[_0xb309('0x10')](function(_0x2452ed){if(_0x2452ed&&_0x2452ed[_0xb309('0x94')]){_0x35bcb5['account']=_0x2452ed;_0x35bcb5[_0xb309('0x95')]=_0x2452ed[_0xb309('0x93')];_0x35bcb5[_0xb309('0x96')]=_0x2452ed[_0xb309('0x94')];_0x35bcb5['applications']=_[_0xb309('0x97')](_0x35bcb5[_0xb309('0x95')],['priority'],[_0xb309('0x98')]);if(_0x35bcb5['account'][_0xb309('0x93')]){delete _0x35bcb5['account'][_0xb309('0x93')];}if(_0x35bcb5['account'][_0xb309('0x94')]&&_0x35bcb5[_0xb309('0x99')][_0xb309('0x94')][_0xb309('0x90')][_0xb309('0x36')]){return _0x35bcb5['account'][_0xb309('0x94')][_0xb309('0x90')][0x0];}var _0xd88c6b=_[_0xb309('0xa')](_0x181e04[_0xb309('0x51')],{'firstName':_0x181e04[_0xb309('0x51')]['from'],'ListId':_0x2452ed[_0xb309('0x86')]});_0xd88c6b[_0x181e04[_0xb309('0x51')]['mapKey']]=_0x181e04[_0xb309('0x51')][_0xb309('0x87')];return db['CmContact'][_0xb309('0x49')](_0xd88c6b,{'fields':_0x33c047,'raw':!![]});}})['then'](handleEntityNotFound(_0x1082f8,null))[_0xb309('0x10')](function(_0x2b7cce){_0x35bcb5[_0xb309('0x9a')]=_0x2b7cce;var _0x137b0c=_0x181e04[_0xb309('0x51')][_0xb309('0x9b')];if(_0x181e04[_0xb309('0x7d')][_0xb309('0x9c')]){_0x137b0c=_0x181e04['headers'][_0xb309('0x9c')];}else if(_0x181e04[_0xb309('0x7d')][_0xb309('0x9d')]){_0x137b0c=_[_0xb309('0x9e')](_0x181e04[_0xb309('0x7d')][_0xb309('0x9d')]['split'](','));}if(_0x2b7cce){var _0x3ddd0d={'ContactId':_0x2b7cce['id'],'ChatWebsiteId':_0x181e04[_0xb309('0x47')]['id'],'from':(_0x2b7cce['firstName']||'')+'\x20'+(_0x2b7cce['lastName']||''),'customerIp':_0x137b0c,'customerPort':_0x181e04['headers'][_0xb309('0x9f')]?_0x181e04[_0xb309('0x7d')][_0xb309('0x9f')]:null,'referer':_0x181e04[_0xb309('0x51')]['referer'],'browserName':_0x36170f['browser']['name']&&_0x36170f[_0xb309('0xa0')]['version']?util['format'](_0xb309('0xa1'),_0x36170f['browser'][_0xb309('0x28')],_0x36170f['browser'][_0xb309('0xa2')]):_0xb309('0xa3'),'browserVersion':_0x36170f[_0xb309('0xa0')][_0xb309('0xa2')]||'unknown','osName':util[_0xb309('0xa4')](_0xb309('0xa1'),_0x36170f['os'][_0xb309('0x28')],_0x36170f['os']['version']),'osVersion':_0x36170f['os'][_0xb309('0xa2')],'deviceModel':_0x36170f[_0xb309('0xa5')][_0xb309('0x2f')]&&_0x36170f[_0xb309('0xa5')]['vendor']?util[_0xb309('0xa4')](_0xb309('0xa6'),_0x36170f[_0xb309('0xa5')][_0xb309('0x2f')],_0x36170f[_0xb309('0xa5')][_0xb309('0xa7')],_0x36170f[_0xb309('0xa5')]['type']):null,'deviceVendor':_0x36170f[_0xb309('0xa5')][_0xb309('0xa7')],'deviceType':_0x36170f[_0xb309('0xa5')][_0xb309('0x3e')],'formData':JSON[_0xb309('0x16')](_0x181e04[_0xb309('0x51')])};var _0x221017={'ChatWebsiteId':_0x181e04[_0xb309('0x47')]['id'],'closed':![]};if(_0x181e04['body'][_0xb309('0xa8')]){_0x221017['threadId']=_0x181e04[_0xb309('0x51')][_0xb309('0xa8')];return db[_0xb309('0xa9')][_0xb309('0x48')]({'where':_0x221017})[_0xb309('0x10')](function(_0x479081){if(_0x479081){return[_0x479081,![]];}_0x3ddd0d['threadId']=_0x181e04[_0xb309('0x51')][_0xb309('0xa8')];_0x3ddd0d[_0xb309('0xaa')]=_0x181e04[_0xb309('0x51')][_0xb309('0xaa')];return db['ChatInteraction']['create'](_0x3ddd0d)[_0xb309('0x10')](function(_0x24e5b0){return[_0x24e5b0,!![]];});});}_0x221017['ContactId']=_0x2b7cce['id'];if(_0x181e04[_0xb309('0x51')][_0xb309('0xab')]&&_0x181e04[_0xb309('0x51')][_0xb309('0xab')]['id']){_0x221017['id']=_0x181e04[_0xb309('0x51')][_0xb309('0xab')]['id'];return db[_0xb309('0xa9')][_0xb309('0x48')]({'where':_0x221017})[_0xb309('0x10')](function(_0x2a63ee){if(_0x2a63ee){return[_0x2a63ee,![]];}return db[_0xb309('0xa9')][_0xb309('0x49')](_0x3ddd0d)[_0xb309('0x10')](function(_0x585910){return[_0x585910,!![]];});});}return db[_0xb309('0xa9')][_0xb309('0x49')](_0x3ddd0d)[_0xb309('0x10')](function(_0x3c22ed){return[_0x3c22ed,!![]];});}})['spread'](function(_0x509caa,_0x3e63d2){if(_0x509caa){_0x231ef8=_0x3e63d2;if(!_0x3e63d2){var _0x1d13d0={'from':(_0x35bcb5['contact']['firstName']||'')+'\x20'+(_0x35bcb5[_0xb309('0x9a')][_0xb309('0xac')]||'')};if(_0x181e04['body'][_0xb309('0xa8')]&&_0x181e04['body'][_0xb309('0xad')]&&_0x181e04['body'][_0xb309('0xa8')]!=_0x181e04[_0xb309('0x51')][_0xb309('0xad')]){_0x1d13d0[_0xb309('0xa8')]=_0x181e04[_0xb309('0x51')]['messageId'];}return _0x509caa[_0xb309('0x23')](_0x1d13d0);}else{return _0x509caa;}}})[_0xb309('0x10')](function(_0x221f90){_0x35bcb5['interaction']=_0x221f90[_0xb309('0x25')]({'plain':!![]});_0x35bcb5['interaction']['created']=_0x231ef8;if(_0x35bcb5[_0xb309('0xab')]['created']){if(_0x35bcb5[_0xb309('0x99')][_0xb309('0xae')]){_0x35bcb5[_0xb309('0x95')][_0xb309('0xaf')]({'id':0x0,'priority':_0x35bcb5[_0xb309('0x95')][_0xb309('0x36')]+0x1,'app':_0xb309('0xb0'),'appdata':'unmanaged','interval':_0xb309('0xb1')});}}return db[_0xb309('0xb2')][_0xb309('0x49')]({'body':_0x181e04[_0xb309('0x51')][_0xb309('0x51')],'ChatWebsiteId':_0x181e04[_0xb309('0x47')]['id'],'ChatInteractionId':_0x221f90['id'],'direction':'in','ContactId':_0x35bcb5['contact']['id'],'AttachmentId':_0x181e04[_0xb309('0x51')]['AttachmentId']});})[_0xb309('0x10')](function(_0x448822){_0x35bcb5[_0xb309('0x19')]=_0x448822;if(_0x35bcb5[_0xb309('0xab')][_0xb309('0xb3')]){return db[_0xb309('0xb4')]['find']({'attributes':['id',_0xb309('0x28')],'where':{'id':_0x35bcb5[_0xb309('0xab')][_0xb309('0xb3')]}})['then'](function(_0x42c1e4){if(_0x42c1e4){_0x35bcb5[_0xb309('0x95')][_0xb309('0xb5')]({'id':0x0,'priority':0x0,'app':_0xb309('0xb6'),'appdata':_0x42c1e4['name']+','+(_0x35bcb5[_0xb309('0x99')][_0xb309('0xb7')]||0xa),'interval':_0xb309('0xb1')});_0x35bcb5[_0xb309('0xb8')]=!![];}return respondWithRpcPromise('Start',_0xb309('0xb9'),_0x35bcb5);});}return respondWithRpcPromise('Start',_0xb309('0xb9'),_0x35bcb5);})[_0xb309('0x10')](function(_0x479133){respondWithRpcPromise(_0xb309('0xba'),'EventManager',{'event':_0xb309('0x7a'),'message':_0x479133},client9002);return _0x479133;})['then'](respondWithResult(_0x1082f8,null))[_0xb309('0x46')](handleError(_0x1082f8,null));};exports[_0xb309('0xbb')]=function(_0x404c48,_0x5153de){var _0x1300c7,_0x1260d1,_0x3d94e3;var _0x2705f4=[];var _0xc990a={};var _0x5b141e=_0x404c48[_0xb309('0xbc')]||[];var _0x1daa24=[];var _0x420e35;return db['CmContact'][_0xb309('0x52')]()[_0xb309('0x10')](function(_0x551da6){if(!_0x551da6){throw new db[(_0xb309('0x89'))]['ValidationError']('no\x20available\x20attributes');}_0x2705f4=_[_0xb309('0x84')](_[_0xb309('0x30')](_0x551da6),[_0xb309('0xbd'),_0xb309('0x83'),'CompanyId',_0xb309('0x86')]);if(_0x404c48[_0xb309('0x51')]['id']){delete _0x404c48[_0xb309('0x51')]['id'];}if(_[_0xb309('0x6e')](_0x404c48[_0xb309('0x51')][_0xb309('0x87')])){throw _0x5153de[_0xb309('0x1c')](0x1f4)[_0xb309('0x29')](new db[(_0xb309('0x89'))]['ValidationError'](_0xb309('0x88')));}if(_[_0xb309('0x6e')](_0x404c48[_0xb309('0x51')][_0xb309('0x51')])||_0x404c48[_0xb309('0x51')][_0xb309('0x51')]===''){throw _0x5153de[_0xb309('0x1c')](0x1f4)[_0xb309('0x29')](new db['Sequelize'][(_0xb309('0x81'))](_0xb309('0x8a')));}if(_['isNil'](_0x404c48['body']['mapKeyOffline'])){throw _0x5153de['status'](0x1f4)['send'](new db['Sequelize'][(_0xb309('0x81'))](_0xb309('0xbe')+_0x2705f4));}if(!_[_0xb309('0xbf')](_0x2705f4,_0x404c48[_0xb309('0x51')][_0xb309('0xc0')])){throw _0x5153de[_0xb309('0x1c')](0x1f4)[_0xb309('0x29')](new db['Sequelize']['ValidationError'](_0xb309('0xc1')+_0x2705f4));}_0xc990a[_0x404c48[_0xb309('0x51')]['mapKeyOffline']]=_0x404c48[_0xb309('0x51')][_0xb309('0x87')];})[_0xb309('0x10')](function(){return db[_0xb309('0x41')][_0xb309('0x48')]({'where':{'id':_0x404c48['params']['id']},'include':[{'model':db[_0xb309('0x8e')],'as':_0xb309('0x94')},{'model':db[_0xb309('0xc2')],'as':_0xb309('0xc2')}]});})['then'](handleEntityNotFound(_0x5153de,null))[_0xb309('0x10')](function(_0x4e0636){if(_0x4e0636&&_0x4e0636[_0xb309('0x94')]){_0x1260d1=_0x4e0636;var _0x580e23=_[_0xb309('0xa')](_0x404c48['body'],{'firstName':_0x404c48[_0xb309('0x51')][_0xb309('0x87')],'phone':_0x404c48[_0xb309('0x51')][_0xb309('0x87')],'ListId':_0x4e0636[_0xb309('0x86')]});_0x580e23[_0x404c48[_0xb309('0x51')][_0xb309('0xc0')]]=_0x404c48[_0xb309('0x51')]['from'];return db[_0xb309('0x8f')][_0xb309('0xc3')]({'where':_0xc990a,'defaults':_0x580e23});}})[_0xb309('0xc4')](function(_0x2e7e01){if(_0x2e7e01){_0x3d94e3=_0x2e7e01;var _0x4931d8=fs[_0xb309('0xc5')](path['join'](config[_0xb309('0x6a')],_0xb309('0xc6')),'utf8');var _0x1989ab=ejs['render'](_0x4931d8,{'body':_[_0xb309('0xc7')](_0x404c48[_0xb309('0x51')][_0xb309('0x51')]),'bodyTitle':_0x1260d1['offlineMessageBody']});return db[_0xb309('0xc8')][_0xb309('0x49')]({'body':_0x1989ab,'ContactId':_0x2e7e01['id'],'ChatWebsiteId':_0x1260d1['id']});}})[_0xb309('0x10')](function(_0x48dde3){_0x420e35=_0x48dde3;if(_0x5b141e[_0xb309('0x36')]){var _0x318ddf=_0x5b141e[_0xb309('0x2c')](function(_0x331763){return{'name':_0x331763[_0xb309('0xc9')],'basename':_0x331763[_0xb309('0x64')],'type':_0x331763['mimetype'],'ChatOfflineMessageId':_0x48dde3['id']};});_0x1daa24=_0x318ddf[_0xb309('0x2c')](_0x90c9fc=>{var _0x321724={'filename':_0x90c9fc[_0xb309('0x28')],'path':path[_0xb309('0x6f')](config['root'],'server',_0xb309('0xbc'),_0xb309('0xca'),_0xb309('0xcb'),_0x90c9fc['basename'])};return _0x321724;});if(!_0x1260d1['openNewInteraction']){return db['sequelize'][_0xb309('0xcc')](function(_0x127415){return db[_0xb309('0xcd')][_0xb309('0xce')](_0x318ddf,{'transaction':_0x127415});});}}})[_0xb309('0x10')](function(){if(_0x420e35){_0x1300c7=_0x420e35;return db[_0xb309('0xc2')]['findOne']({'where':{'active':!![]},'include':[{'model':db['MailServerOut'],'as':_0xb309('0xcf'),'raw':!![]}]});}})[_0xb309('0x10')](function(_0x37027e){if(_0x37027e&&_0x37027e['Smtp']&&_0x1260d1[_0xb309('0xd0')]&&_0x1260d1[_0xb309('0xd1')]){var _0x583dc0={'tls':{'rejectUnauthorized':![]}};if(_0x37027e[_0xb309('0xcf')][_0xb309('0xd2')]){_0x583dc0[_0xb309('0xd2')]=_0x37027e['Smtp'][_0xb309('0xd2')];}else{_0x583dc0['host']=_0x37027e['Smtp'][_0xb309('0xd3')];_0x583dc0['port']=_0x37027e[_0xb309('0xcf')][_0xb309('0xd4')];_0x583dc0[_0xb309('0xd5')]=_0x37027e[_0xb309('0xcf')][_0xb309('0xd5')];}if(_0x37027e[_0xb309('0xcf')]['authentication']){_0x583dc0['auth']={'user':_0x37027e[_0xb309('0xcf')][_0xb309('0x4a')],'pass':_0x37027e[_0xb309('0xcf')][_0xb309('0xd6')]};}return respondWithRpcPromise(_0xb309('0xd7'),_0xb309('0xd8'),{'account':_0x583dc0,'message':{'from':util[_0xb309('0xa4')](_0xb309('0xd9'),_0x37027e[_0xb309('0x28')],_0x37027e[_0xb309('0xda')]||_0x37027e['Smtp'][_0xb309('0x4a')]),'to':_0x1260d1['forwardOfflineAddress'],'subject':_0x1260d1['offlineMessageSubject'],'html':_0x1300c7[_0xb309('0x51')],'attachments':_0x1daa24}},client9003)[_0xb309('0x10')](function(){return _0x1300c7;})[_0xb309('0x46')](function(_0x2b1341){console[_0xb309('0x17')](_0x2b1341);});}})[_0xb309('0x10')](function(){if(_0x1260d1&&_0x1260d1[_0xb309('0xdb')]&&_0x1260d1[_0xb309('0xdc')]){var _0x3e1f5d=[];if(_0x5b141e[_0xb309('0x36')]){_0x3e1f5d=_0x5b141e['map'](function(_0x5905b4){return{'name':_0x5905b4[_0xb309('0xc9')],'basename':_0x5905b4[_0xb309('0x64')],'type':_0x5905b4[_0xb309('0xdd')],'ChatOfflineMessageId':_0x420e35['id']};});}var _0x47ee67;if(!_[_0xb309('0x6e')](_0x1260d1[_0xb309('0xde')])){var _0x2286dc=_[_0xb309('0x2c')](_0x404c48[_0xb309('0x51')],function(_0x57bfa1){return _0x57bfa1;});var _0x1a1a58=_[_0xb309('0xdf')](_0x2286dc)[0x0];var _0x2addca=_[_0xb309('0xe0')](_0x1a1a58,function(_0x42ba7d){return _0x42ba7d;});_0x47ee67=_0x2addca[0x1][_0x1260d1[_0xb309('0xde')]];}var _0x41cc9c={'from':_0x3d94e3[_0xb309('0xda')],'firstName':_0x3d94e3[_0xb309('0xe1')],'lastName':_0x3d94e3[_0xb309('0xac')],'mapKey':_0xb309('0xda'),'message':{'from':_0x3d94e3['email'],'to':_0x1260d1[_0xb309('0xc2')][_0xb309('0xda')],'cc':'','subject':_[_0xb309('0x6e')](_0x47ee67)?_0x1260d1[_0xb309('0xe2')]:_0x47ee67,'messageId':'','sentAt':new Date(),'attach':_0x3e1f5d[_0xb309('0x36')],'attachments':_0x3e1f5d,'originChannel':_0xb309('0xe3'),'ChatWebsiteId':_0x1260d1['id'],'ChatOfflineMessageId':_0x1300c7['id'],'originTo':_0x1260d1['MailAccount']['email']},'body':_0x1300c7[_0xb309('0x51')]};var _0x3c6e65={'account':{'id':_0x1260d1[_0xb309('0xdc')]},'body':_0x41cc9c,'log':_0xb309('0xe4')};return respondWithRpcPromise('NotifyMailAccount',_0xb309('0xe5'),_0x3c6e65,client9001)[_0xb309('0x10')](function(){return _0x1300c7;})['catch'](function(_0x4ee0a2){console[_0xb309('0x17')](_0x4ee0a2);});}return;})['then'](function(){if(_0x1300c7){return _0x1300c7;}})[_0xb309('0x10')](respondWithResult(_0x5153de,null))[_0xb309('0x46')](function(_0xe28dc3){console['error']('catch',_0xe28dc3);for(var _0x1c5bfd of _0x5b141e){var _0x52a913=path[_0xb309('0x6f')](config[_0xb309('0x6a')],_0xb309('0xe6'),_0xb309('0xbc'),'attachments','offline-chat',_0x1c5bfd[_0xb309('0x64')]);fs_extra['remove'](_0x52a913)[_0xb309('0x46')](function(_0x521118){console[_0xb309('0x17')](_0xb309('0xe7'),_0x52a913,_0x521118);});}});};exports['addInteraction']=function(_0x1774ca,_0x4a7774){return db[_0xb309('0xa9')][_0xb309('0x48')]({'where':{'id':_0x1774ca[_0xb309('0x47')]['id']}})[_0xb309('0x10')](handleEntityNotFound(_0x4a7774,null))[_0xb309('0x10')](function(_0x1cada6){if(_0x1cada6){return _0x1cada6[_0xb309('0xe8')](_0x1774ca['body'][_0xb309('0x5e')],_['omit'](_0x1774ca['body'],['ids','id'])||{});}})[_0xb309('0x10')](respondWithResult(_0x4a7774,null))[_0xb309('0x46')](handleError(_0x4a7774,null));};exports['getInteractions']=function(_0x42ca7c,_0x1bb4c2){var _0x22db1e={'raw':![],'where':{}};var _0x59c597={};var _0x38663c={'count':0x0,'rows':[]};return db[_0xb309('0x41')][_0xb309('0x55')]({'where':{'id':_0x42ca7c[_0xb309('0x47')]['id']}})[_0xb309('0x10')](handleEntityNotFound(_0x1bb4c2,null))['then'](function(_0x3d2972){if(_0x3d2972){_0x59c597[_0xb309('0x2f')]=_[_0xb309('0x30')](db['ChatInteraction'][_0xb309('0x2d')]);_0x59c597[_0xb309('0x31')]=_[_0xb309('0x30')](_0x42ca7c[_0xb309('0x31')]);_0x59c597[_0xb309('0x32')]=_[_0xb309('0x33')](_0x59c597[_0xb309('0x2f')],_0x59c597[_0xb309('0x31')]);_0x22db1e['attributes']=_[_0xb309('0x33')](_0x59c597['model'],qs[_0xb309('0x35')](_0x42ca7c[_0xb309('0x31')][_0xb309('0x35')]));_0x22db1e['attributes']=_0x22db1e[_0xb309('0x34')][_0xb309('0x36')]?_0x22db1e[_0xb309('0x34')]:_0x59c597['model'];if(!_0x42ca7c[_0xb309('0x31')][_0xb309('0x37')](_0xb309('0x57'))){_0x22db1e[_0xb309('0x21')]=qs['limit'](_0x42ca7c[_0xb309('0x31')][_0xb309('0x21')]);_0x22db1e[_0xb309('0x1e')]=qs[_0xb309('0x1e')](_0x42ca7c[_0xb309('0x31')]['offset']);}_0x22db1e[_0xb309('0x38')]=qs[_0xb309('0x39')](_0x42ca7c[_0xb309('0x31')][_0xb309('0x39')]);_0x22db1e[_0xb309('0x3a')]=qs[_0xb309('0x32')](_[_0xb309('0x3b')](_0x42ca7c[_0xb309('0x31')],_0x59c597[_0xb309('0x32')]));_0x22db1e[_0xb309('0x3a')][_0xb309('0x58')]=_0x3d2972['id'];if(_0x42ca7c['query'][_0xb309('0x3c')]){_0x22db1e[_0xb309('0x3a')]=_[_0xb309('0x3d')](_0x22db1e[_0xb309('0x3a')],{'$or':_[_0xb309('0x2c')](_0x22db1e[_0xb309('0x34')],function(_0x51bae8){var _0x23dc44={};_0x23dc44[_0x51bae8]={'$like':'%'+_0x42ca7c['query'][_0xb309('0x3c')]+'%'};return _0x23dc44;})});}_0x22db1e=_['merge']({},_0x22db1e,_0x42ca7c['options']);return db[_0xb309('0xa9')][_0xb309('0x20')]({'where':_0x22db1e['where']})[_0xb309('0x10')](function(_0x4cc3c0){_0x38663c[_0xb309('0x20')]=_0x4cc3c0;if(_0x42ca7c[_0xb309('0x31')]['includeAll']){_0x22db1e[_0xb309('0x43')]=[{'model':db[_0xb309('0x8f')],'as':_0xb309('0xe9'),'required':![]},{'model':db[_0xb309('0xb4')],'as':'Owner','attributes':['name',_0xb309('0xea'),'internal'],'required':![]},{'model':db['Tag'],'as':'Tags','attributes':['id','name',_0xb309('0xeb')],'where':_0x42ca7c[_0xb309('0x31')][_0xb309('0xec')]?{'id':_0x42ca7c[_0xb309('0x31')][_0xb309('0xec')]}:undefined,'required':_0x42ca7c['query'][_0xb309('0xec')]?!![]:![]}];}return db['ChatInteraction'][_0xb309('0x44')](_0x22db1e);})['then'](function(_0x320282){_0x38663c[_0xb309('0x45')]=_0x320282;return _0x38663c;});}})['then'](respondWithFilteredResult(_0x1bb4c2,_0x22db1e))[_0xb309('0x46')](handleError(_0x1bb4c2,null));};function iftimePromise(_0xa0dd6e,_0x2887a4){return respondWithRpcPromise(_0xb309('0xed'),_0xb309('0xee'),{'command':_0x2887a4[_0xb309('0xef')]?util[_0xb309('0xa4')](_0xb309('0xf0'),_0xa0dd6e['interval'],_0x2887a4[_0xb309('0xef')]):util['format'](_0xb309('0xf1'),_0xa0dd6e[_0xb309('0xf2')])},client9002)[_0xb309('0x10')](function(_0x5ac511){var _0x1560f9=_0x5ac511&&_0x5ac511[_0xb309('0xf3')](_0xb309('0xf4'))>=0x0?!![]:![];logger[_0xb309('0x11')](_0xb309('0xf5'),_0x2887a4['id'],_0xa0dd6e['id'],_0xa0dd6e[_0xb309('0xf2')],_0x1560f9?_0xb309('0xf6'):_0xb309('0xf7'),_0x2887a4[_0xb309('0xef')]?_0x2887a4[_0xb309('0xef')]:_0xb309('0xf8'));return _0x1560f9;})[_0xb309('0x46')](function(_0x19fb29){logger[_0xb309('0x17')](_0xb309('0xf5'),_0x2887a4['id'],_0xa0dd6e['id'],_0xa0dd6e[_0xb309('0xf2')],util['inspect'](_0x19fb29,{'showHidden':![],'depth':null}),_0x2887a4[_0xb309('0xef')]?_0x2887a4[_0xb309('0xef')]:'No\x20timezone');return![];});}exports['getSnippet']=function(_0x59e0e4,_0x43d639){var _0x9e2b5f=0x0;var _0x478964=0x0;var _0x50be23=![];var _0x39c69f;var _0x3a2354;return db[_0xb309('0x41')][_0xb309('0x48')]({'where':{'id':_0x59e0e4[_0xb309('0x47')]['id']},'include':[{'model':db['Interval'],'as':'Interval','include':[{'model':db[_0xb309('0xf9')],'as':_0xb309('0xfa'),'attributes':['id','interval'],'raw':!![]}]}]})['then'](handleEntityNotFound(_0x43d639,null))[_0xb309('0x10')](function(_0x2e80ec){if(_0x2e80ec){_0x39c69f=_0x2e80ec;return _0x2e80ec[_0xb309('0xfb')]({'raw':!![]});}})[_0xb309('0x10')](function(_0x33a826){if(_0x39c69f){if(_0x33a826){_0x3a2354=_0x33a826;}}return require(_0xb309('0x6b'))['getLicense']();})[_0xb309('0x10')](function(_0x140230){if(_0x140230){_0x478964=_0x140230[_0xb309('0xfc')];_0x50be23=_0x140230[_0xb309('0x6d')];}})[_0xb309('0x10')](function(){return db['ChatInteraction'][_0xb309('0x20')]({'where':{'closed':![]}});})[_0xb309('0x10')](function(_0x4e1d89){_0x9e2b5f=_0x4e1d89;if(_0x478964&&_0x4e1d89>_0x478964){return db['License'][_0xb309('0x55')]({'where':{'id':0x1}})[_0xb309('0x10')](function(_0x11d092){if(_0x11d092){_0x11d092[_0xb309('0xfd')]('chatLicenseExceeded');}});}})[_0xb309('0x10')](function(){if(_0x39c69f[_0xb309('0xf9')]&&_0x39c69f[_0xb309('0xf9')][_0xb309('0xfa')]){var _0x1ef93d=[];for(var _0x467552=0x0;_0x467552<_0x39c69f[_0xb309('0xf9')][_0xb309('0xfa')][_0xb309('0x36')];_0x467552++){var _0x153d17=_0x39c69f[_0xb309('0xf9')][_0xb309('0xfa')][_0x467552][_0xb309('0x25')]({'plain':!![]});_0x1ef93d[_0xb309('0xaf')](iftimePromise(_0x153d17,_0x39c69f));}return BPromise[_0xb309('0xfe')](_0x1ef93d)[_0xb309('0x10')](function(_0x44e9b7){return _['some'](_0x44e9b7);});}else{return!![];}})['then'](function(_0x3ccd9c){var _0x5b98a0=fs[_0xb309('0xc5')](path[_0xb309('0x6f')](config['root'],_0xb309('0xff')),'utf8');var _0xb0e22b={'remote':_0x39c69f['remote'],'query':querystring[_0xb309('0x16')](_[_0xb309('0x3d')](_0x39c69f[_0xb309('0x25')]({'plain':!![]}),{'customerIp':_0x59e0e4['headers'][_0xb309('0x9d')]||_0x59e0e4[_0xb309('0x7d')][_0xb309('0x100')]||_0x59e0e4[_0xb309('0x101')]['remoteAddress']||_0x59e0e4['ip'],'referer':_0x59e0e4[_0xb309('0x7d')][_0xb309('0x102')],'openedInteractions':_0x9e2b5f,'maxInteractions':_0x478964,'virtual':_0x50be23[_0xb309('0xfc')],'online':_0x3ccd9c,'custom':_0x50be23}))[_0xb309('0x103')](/'/g,'\x5c\x27')};_0x43d639[_0xb309('0x29')](ejs['render'](Mustache[_0xb309('0x104')](_0x5b98a0,_0xb0e22b),{'proactiveActions':_0x3a2354,'alignment':_0x39c69f[_0xb309('0x105')],'verticalAlignment':_0x39c69f[_0xb309('0x106')],'div_color':_0x39c69f['color'],'text_color':_0x39c69f['textColor'],'button_color':_0x39c69f[_0xb309('0x107')],'background_color':_0x39c69f[_0xb309('0x108')]}));})[_0xb309('0x46')](handleError(_0x43d639,null));};exports[_0xb309('0x109')]=function(_0x5e66d6,_0x5f4372){var _0x5bb3eb=_0x5e66d6['params']['id'];var _0x347a47=_0x5e66d6['body'];var _0x213b49=0xc8;var _0x79803d=null;return db[_0xb309('0x10a')][_0xb309('0xcc')]({'isolationLevel':db[_0xb309('0x10a')][_0xb309('0x10b')]['ISOLATION_LEVELS'][_0xb309('0x10c')]},function(_0x231f2c){return db[_0xb309('0x41')][_0xb309('0x55')]({'where':{'id':_0x5bb3eb},'transaction':_0x231f2c})[_0xb309('0x10')](function(_0x4e474e){if(_0x4e474e){return db['ChatApplication'][_0xb309('0x24')]({'where':{'ChatWebsiteId':_0x5bb3eb},'transaction':_0x231f2c})[_0xb309('0x10')](function(){var _0x375b24=_[_0xb309('0x2c')](_0x347a47,function(_0x52c17b){_0x52c17b[_0xb309('0x58')]=_0x5bb3eb;return _0x52c17b;});return db[_0xb309('0x92')]['bulkCreate'](_0x375b24,{'transaction':_0x231f2c});});}else{_0x213b49=0x194;_0x79803d=[];}});})[_0xb309('0x10')](function(){if(_0x213b49!==0x194){return db[_0xb309('0x92')][_0xb309('0x10d')]({'where':{'ChatWebsiteId':_0x5bb3eb},'order':_0xb309('0x10e')})[_0xb309('0x10')](function(_0x1af97f){_0x79803d=_0x1af97f;});}})[_0xb309('0x46')](function(_0x10a331){_0x213b49=0x1f4;logger[_0xb309('0x17')](_0x10a331[_0xb309('0x27')]);if(_0x10a331[_0xb309('0x28')]){delete _0x10a331[_0xb309('0x28')];}_0x79803d=_0x10a331;})[_0xb309('0x10f')](function(){if(_0x79803d===null){_0x5f4372[_0xb309('0x1b')](_0x213b49);}else{if(_0x213b49===0x1f4){_0x5f4372[_0xb309('0x1c')](_0x213b49)['send'](_0x79803d);}else{_0x5f4372[_0xb309('0x1c')](_0x213b49)[_0xb309('0x110')](_0x79803d);}}});};exports[_0xb309('0x111')]=function(_0x1c98f5,_0x6d626e){var _0x209a0b={};var _0x36e41c={};var _0x944170;var _0x174026;return db[_0xb309('0x41')][_0xb309('0x55')]({'where':{'id':_0x1c98f5[_0xb309('0x47')]['id']}})[_0xb309('0x10')](handleEntityNotFound(_0x6d626e,null))[_0xb309('0x10')](function(_0x3163ba){if(_0x3163ba){_0x944170=_0x3163ba;_0x36e41c[_0xb309('0x2f')]=_[_0xb309('0x30')](db[_0xb309('0x92')][_0xb309('0x2d')]);_0x36e41c[_0xb309('0x31')]=_['keys'](_0x1c98f5[_0xb309('0x31')]);_0x36e41c[_0xb309('0x32')]=_[_0xb309('0x33')](_0x36e41c[_0xb309('0x2f')],_0x36e41c[_0xb309('0x31')]);_0x209a0b[_0xb309('0x34')]=_['intersection'](_0x36e41c[_0xb309('0x2f')],qs[_0xb309('0x35')](_0x1c98f5[_0xb309('0x31')]['fields']));_0x209a0b[_0xb309('0x34')]=_0x209a0b['attributes']['length']?_0x209a0b[_0xb309('0x34')]:_0x36e41c['model'];_0x209a0b[_0xb309('0x38')]=qs[_0xb309('0x39')](_0x1c98f5['query'][_0xb309('0x39')]);_0x209a0b[_0xb309('0x3a')]=qs[_0xb309('0x32')](_[_0xb309('0x3b')](_0x1c98f5[_0xb309('0x31')],_0x36e41c[_0xb309('0x32')]));if(_0x1c98f5[_0xb309('0x31')][_0xb309('0x3c')]){_0x209a0b[_0xb309('0x3a')]=_[_0xb309('0x3d')](_0x209a0b[_0xb309('0x3a')],{'$or':_[_0xb309('0x2c')](_0x209a0b[_0xb309('0x34')],function(_0x1f87b6){var _0x4968c9={};_0x4968c9[_0x1f87b6]={'$like':'%'+_0x1c98f5['query'][_0xb309('0x3c')]+'%'};return _0x4968c9;})});}_0x209a0b=_[_0xb309('0x3d')]({},_0x209a0b,_0x1c98f5[_0xb309('0x40')]);return _0x944170['getApplications'](_0x209a0b);}})[_0xb309('0x10')](function(_0x20f1e4){if(_0x20f1e4){_0x174026=_0x20f1e4[_0xb309('0x36')];if(!_0x1c98f5[_0xb309('0x31')]['hasOwnProperty'](_0xb309('0x57'))){_0x209a0b[_0xb309('0x21')]=qs[_0xb309('0x21')](_0x1c98f5['query'][_0xb309('0x21')]);_0x209a0b[_0xb309('0x1e')]=qs['offset'](_0x1c98f5[_0xb309('0x31')][_0xb309('0x1e')]);}return _0x944170[_0xb309('0x111')](_0x209a0b);}})[_0xb309('0x10')](function(_0x2d59af){if(_0x2d59af){return _0x2d59af?{'count':_0x174026,'rows':_0x2d59af}:null;}})[_0xb309('0x10')](respondWithResult(_0x6d626e,null))[_0xb309('0x46')](handleError(_0x6d626e,null));};exports[_0xb309('0x112')]=function(_0x1653c7,_0x209cb8){return db[_0xb309('0x113')][_0xb309('0x48')]({'where':{'id':_0x1653c7[_0xb309('0x47')]['id']}})[_0xb309('0x10')](handleEntityNotFound(_0x209cb8,null))[_0xb309('0x10')](function(_0x1267b9){if(_0x1267b9){return _0x1267b9[_0xb309('0x112')](_0x1653c7[_0xb309('0x51')][_0xb309('0x5e')],_['omit'](_0x1653c7[_0xb309('0x51')],['ids','id'])||{});}})[_0xb309('0x10')](respondWithResult(_0x209cb8,null))['catch'](handleError(_0x209cb8,null));};exports[_0xb309('0xfb')]=function(_0x23238a,_0x5efff4){var _0x39a3a5={};var _0x3af08f={};var _0x42862c;var _0x54670a;return db[_0xb309('0x41')]['findOne']({'where':{'id':_0x23238a['params']['id']}})[_0xb309('0x10')](handleEntityNotFound(_0x5efff4,null))['then'](function(_0x36da79){if(_0x36da79){_0x42862c=_0x36da79;_0x3af08f[_0xb309('0x2f')]=_[_0xb309('0x30')](db[_0xb309('0x114')][_0xb309('0x2d')]);_0x3af08f[_0xb309('0x31')]=_[_0xb309('0x30')](_0x23238a[_0xb309('0x31')]);_0x3af08f[_0xb309('0x32')]=_[_0xb309('0x33')](_0x3af08f[_0xb309('0x2f')],_0x3af08f[_0xb309('0x31')]);_0x39a3a5[_0xb309('0x34')]=_[_0xb309('0x33')](_0x3af08f[_0xb309('0x2f')],qs[_0xb309('0x35')](_0x23238a[_0xb309('0x31')][_0xb309('0x35')]));_0x39a3a5[_0xb309('0x34')]=_0x39a3a5['attributes'][_0xb309('0x36')]?_0x39a3a5[_0xb309('0x34')]:_0x3af08f[_0xb309('0x2f')];_0x39a3a5['order']=qs[_0xb309('0x39')](_0x23238a[_0xb309('0x31')][_0xb309('0x39')]);_0x39a3a5[_0xb309('0x3a')]=qs['filters'](_[_0xb309('0x3b')](_0x23238a[_0xb309('0x31')],_0x3af08f[_0xb309('0x32')]));if(_0x23238a[_0xb309('0x31')][_0xb309('0x3c')]){_0x39a3a5['where']=_['merge'](_0x39a3a5['where'],{'$or':_['map'](_0x39a3a5[_0xb309('0x34')],function(_0x5c36d5){var _0x2127f3={};_0x2127f3[_0x5c36d5]={'$like':'%'+_0x23238a[_0xb309('0x31')][_0xb309('0x3c')]+'%'};return _0x2127f3;})});}_0x39a3a5=_[_0xb309('0x3d')]({},_0x39a3a5,_0x23238a[_0xb309('0x40')]);return _0x42862c[_0xb309('0xfb')](_0x39a3a5);}})[_0xb309('0x10')](function(_0x5ecec6){if(_0x5ecec6){_0x54670a=_0x5ecec6['length'];if(!_0x23238a[_0xb309('0x31')][_0xb309('0x37')](_0xb309('0x57'))){_0x39a3a5['limit']=qs['limit'](_0x23238a[_0xb309('0x31')][_0xb309('0x21')]);_0x39a3a5[_0xb309('0x1e')]=qs['offset'](_0x23238a[_0xb309('0x31')][_0xb309('0x1e')]);}return _0x42862c[_0xb309('0xfb')](_0x39a3a5);}})[_0xb309('0x10')](function(_0x39f921){if(_0x39f921){return _0x39f921?{'count':_0x54670a,'rows':_0x39f921}:null;}})[_0xb309('0x10')](respondWithResult(_0x5efff4,null))['catch'](handleError(_0x5efff4,null));};exports[_0xb309('0x115')]=function(_0x55762a,_0x41f7d7){var _0x39d2c0=_0x55762a['query'][_0xb309('0x116')]==='false'?_0xb309('0x117'):_0xb309('0x118');return db[_0xb309('0x41')][_0xb309('0x48')]({'attributes':['id',_0x39d2c0],'where':{'id':_0x55762a[_0xb309('0x47')]['id']}})[_0xb309('0x10')](handleEntityNotFound(_0x41f7d7,null))[_0xb309('0x10')](function(_0x5bbb69){if(_0x5bbb69){var _0x5ae02d=_0x5bbb69[_0x39d2c0];var _0x14826f=_0x5ae02d&&_0x5ae02d[_0xb309('0x119')]?_0x5ae02d[_0xb309('0x119')]:[];_0x41f7d7['send']({'fromKey':_[_0xb309('0x6e')](_0x5ae02d['fromKey'])?undefined:_0x5ae02d['fromKey'],'count':_0x14826f[_0xb309('0x36')],'rows':_0x14826f});}})[_0xb309('0x46')](handleError(_0x41f7d7,null));};exports[_0xb309('0x11a')]=function(_0x26e005,_0x25ba2d){var _0x4b9f90={'raw':![],'where':{}};var _0x58a00f={};var _0x10f4c5={'count':0x0,'rows':[]};return db[_0xb309('0x41')]['findOne']({'where':{'id':_0x26e005[_0xb309('0x47')]['id']}})[_0xb309('0x10')](handleEntityNotFound(_0x25ba2d,null))[_0xb309('0x10')](function(_0x2fd04b){if(_0x2fd04b){_0x58a00f['model']=_[_0xb309('0x30')](db[_0xb309('0xc8')]['rawAttributes']);_0x58a00f[_0xb309('0x31')]=_['keys'](_0x26e005[_0xb309('0x31')]);_0x58a00f[_0xb309('0x32')]=_[_0xb309('0x33')](_0x58a00f[_0xb309('0x2f')],_0x58a00f['query']);_0x4b9f90[_0xb309('0x34')]=_[_0xb309('0x33')](_0x58a00f[_0xb309('0x2f')],qs[_0xb309('0x35')](_0x26e005[_0xb309('0x31')]['fields']));_0x4b9f90[_0xb309('0x34')]=_0x4b9f90[_0xb309('0x34')][_0xb309('0x36')]?_0x4b9f90[_0xb309('0x34')]:_0x58a00f['model'];if(!_0x26e005[_0xb309('0x31')][_0xb309('0x37')](_0xb309('0x57'))){_0x4b9f90['limit']=qs['limit'](_0x26e005[_0xb309('0x31')][_0xb309('0x21')]);_0x4b9f90[_0xb309('0x1e')]=qs[_0xb309('0x1e')](_0x26e005['query'][_0xb309('0x1e')]);}_0x4b9f90['order']=qs['sort'](_0x26e005[_0xb309('0x31')][_0xb309('0x39')]);_0x4b9f90[_0xb309('0x3a')]=qs[_0xb309('0x32')](_[_0xb309('0x3b')](_0x26e005[_0xb309('0x31')],_0x58a00f[_0xb309('0x32')]));_0x4b9f90[_0xb309('0x3a')][_0xb309('0x58')]=_0x2fd04b['id'];if(_0x26e005[_0xb309('0x31')][_0xb309('0x3c')]){_0x4b9f90['where']=_[_0xb309('0x3d')](_0x4b9f90[_0xb309('0x3a')],{'$or':_[_0xb309('0x2c')](_0x4b9f90[_0xb309('0x34')],function(_0x1a7788){var _0x46ee6a={};_0x46ee6a[_0x1a7788]={'$like':'%'+_0x26e005[_0xb309('0x31')][_0xb309('0x3c')]+'%'};return _0x46ee6a;})});}_0x4b9f90=_[_0xb309('0x3d')]({},_0x4b9f90,_0x26e005['options']);return db[_0xb309('0xc8')][_0xb309('0x20')]({'where':_0x4b9f90[_0xb309('0x3a')]})[_0xb309('0x10')](function(_0x3c577){_0x10f4c5[_0xb309('0x20')]=_0x3c577;if(_0x26e005[_0xb309('0x31')]['includeAll']){_0x4b9f90[_0xb309('0x43')]=[{'all':!![]}];}else{_0x4b9f90['include']=[{'model':db['CmContact'],'as':_0xb309('0xe9'),'required':![]},{'model':db[_0xb309('0xcd')],'as':_0xb309('0x11b'),'required':![]}];}return db[_0xb309('0xc8')][_0xb309('0x44')](_0x4b9f90);})['then'](function(_0x4576a3){_0x10f4c5[_0xb309('0x45')]=_0x4576a3;return _0x10f4c5;});}})[_0xb309('0x10')](respondWithFilteredResult(_0x25ba2d,_0x4b9f90))['catch'](handleError(_0x25ba2d,null));};exports[_0xb309('0x11c')]=function(_0x20ac85,_0x3ecea9){return db[_0xb309('0x41')][_0xb309('0x48')]({'where':{'id':_0x20ac85[_0xb309('0x47')]['id']}})[_0xb309('0x10')](handleEntityNotFound(_0x3ecea9,null))[_0xb309('0x10')](function(_0x357458){if(_0x357458){return _0x357458[_0xb309('0x11c')](_0x20ac85[_0xb309('0x51')]['ids'],_[_0xb309('0x11d')](_0x20ac85['body'],[_0xb309('0x5e'),'id'])||{})[_0xb309('0xc4')](function(_0x3dfc6c){for(var _0x304ea4=0x0;_0x304ea4<_0x20ac85[_0xb309('0x51')][_0xb309('0x5e')][_0xb309('0x36')];_0x304ea4+=0x1){socket[_0xb309('0x11e')](_0xb309('0x11f'),{'UserId':Number(_0x20ac85[_0xb309('0x51')][_0xb309('0x5e')][_0x304ea4]),'ChatWebsiteId':Number(_0x20ac85['params']['id'])});}return _0x3dfc6c;});}})[_0xb309('0x10')](respondWithResult(_0x3ecea9,null))[_0xb309('0x46')](handleError(_0x3ecea9,null));};exports[_0xb309('0x120')]=function(_0x2d7c85,_0x55eb07){return db['ChatWebsite'][_0xb309('0x48')]({'where':{'id':_0x2d7c85[_0xb309('0x47')]['id']}})['then'](handleEntityNotFound(_0x55eb07,null))[_0xb309('0x10')](function(_0x332e34){if(_0x332e34){return _0x332e34[_0xb309('0x120')](_0x2d7c85[_0xb309('0x31')][_0xb309('0x5e')])[_0xb309('0x10')](function(){if(_[_0xb309('0x121')](_0x2d7c85['query']['ids'])){for(var _0x257ae1=0x0;_0x257ae1<_0x2d7c85['query'][_0xb309('0x5e')]['length'];_0x257ae1+=0x1){socket[_0xb309('0x11e')]('userChatWebsite:remove',{'UserId':Number(_0x2d7c85[_0xb309('0x31')][_0xb309('0x5e')][_0x257ae1]),'ChatWebsiteId':Number(_0x2d7c85[_0xb309('0x47')]['id'])});}}else{socket[_0xb309('0x11e')]('userChatWebsite:remove',{'UserId':Number(_0x2d7c85[_0xb309('0x31')]['ids']),'ChatWebsiteId':Number(_0x2d7c85[_0xb309('0x47')]['id'])});}});}})[_0xb309('0x10')](respondWithStatusCode(_0x55eb07,null))[_0xb309('0x46')](handleError(_0x55eb07,null));};exports[_0xb309('0x122')]=function(_0x4c437f,_0x46cc18){var _0x4a0b9a={};var _0x155a9a={};var _0x5c600f;var _0x5013e1;return db[_0xb309('0x41')][_0xb309('0x55')]({'where':{'id':_0x4c437f[_0xb309('0x47')]['id']}})[_0xb309('0x10')](handleEntityNotFound(_0x46cc18,null))[_0xb309('0x10')](function(_0x43dc8c){if(_0x43dc8c){_0x5c600f=_0x43dc8c;_0x155a9a[_0xb309('0x2f')]=_[_0xb309('0x30')](db[_0xb309('0xb4')][_0xb309('0x2d')]);_0x155a9a[_0xb309('0x31')]=_[_0xb309('0x30')](_0x4c437f[_0xb309('0x31')]);_0x155a9a['filters']=_[_0xb309('0x33')](_0x155a9a[_0xb309('0x2f')],_0x155a9a[_0xb309('0x31')]);_0x4a0b9a[_0xb309('0x34')]=_['intersection'](_0x155a9a[_0xb309('0x2f')],qs[_0xb309('0x35')](_0x4c437f['query']['fields']));_0x4a0b9a['attributes']=_0x4a0b9a['attributes'][_0xb309('0x36')]?_0x4a0b9a['attributes']:_0x155a9a['model'];_0x4a0b9a[_0xb309('0x38')]=qs[_0xb309('0x39')](_0x4c437f['query'][_0xb309('0x39')]);_0x4a0b9a[_0xb309('0x3a')]=qs['filters'](_[_0xb309('0x3b')](_0x4c437f[_0xb309('0x31')],_0x155a9a[_0xb309('0x32')]));if(_0x4c437f[_0xb309('0x31')][_0xb309('0x3c')]){_0x4a0b9a[_0xb309('0x3a')]=_[_0xb309('0x3d')](_0x4a0b9a[_0xb309('0x3a')],{'$or':_['map'](_0x4a0b9a[_0xb309('0x34')],function(_0x148896){var _0x22bfca={};_0x22bfca[_0x148896]={'$like':'%'+_0x4c437f[_0xb309('0x31')][_0xb309('0x3c')]+'%'};return _0x22bfca;})});}_0x4a0b9a=_[_0xb309('0x3d')]({},_0x4a0b9a,_0x4c437f[_0xb309('0x40')]);return _0x5c600f[_0xb309('0x122')](_0x4a0b9a);}})[_0xb309('0x10')](function(_0x835b15){if(_0x835b15){_0x5013e1=_0x835b15['length'];if(!_0x4c437f[_0xb309('0x31')]['hasOwnProperty'](_0xb309('0x57'))){_0x4a0b9a[_0xb309('0x21')]=qs['limit'](_0x4c437f[_0xb309('0x31')][_0xb309('0x21')]);_0x4a0b9a[_0xb309('0x1e')]=qs['offset'](_0x4c437f['query'][_0xb309('0x1e')]);}return _0x5c600f['getAgents'](_0x4a0b9a);}})[_0xb309('0x10')](function(_0x3fa92e){if(_0x3fa92e){return _0x3fa92e?{'count':_0x5013e1,'rows':_0x3fa92e}:null;}})[_0xb309('0x10')](respondWithResult(_0x46cc18,null))[_0xb309('0x46')](handleError(_0x46cc18,null));};
\ No newline at end of file
+var _0xeced=['systemAvatar','getLogo','join','root','server/files/images/logos/default_logo.svg','../../config/license/util','getLicense','custom','isNil','existsSync','server/files/images/logos/','download','getAvatar','agentAvatar','server/files/images/avatars/','getCustomerAvatar','server/files/images/avatars/customer_avatar.png','showCustomerAvatar','headers','user-agent','getResult','chat','CmContact','ValidationError','no\x20available\x20attributes','updatedAt','difference','CompanyId','from','Sequelize','mapKey','mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','CmList','List','Contacts','DESC','Applications','account','applications','priority','asc','ListId','contact','customerIp','cf-connecting-ip','x-forwarded-for','split','firstName','lastName','x-real-port','version','format','%s\x20%s','browser','unknown','device','%s\x20%s\x20%s','threadId','ChatInteraction','externalUrl','ContactId','interaction','spread','messageId','created','autoclose','push','close','unmanaged','*,*,*,*','ChatMessage','AttachmentId','UserId','agent','waitForTheAssignedAgent','forcedOwnership','Start','startRouting','EventManager','notify','offline','files','send','from\x20is\x20mandatory','body\x20is\x20mandatory\x20and\x20not\x20empty','mapKeyOffline\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','includes','mapKeyOffline','MailAccount','findOrCreate','readFileSync','utf8','toPairs','offlineMessageBody','ChatOfflineMessage','originalname','mimetype','server','attachments','offline-chat','openNewInteraction','sequelize','transaction','Attachment','bulkCreate','MailServerOut','Smtp','forwardOffline','forwardOfflineAddress','service','host','port','authentication','auth','pass','SendMail','sendMail','\x22%s\x22\x20<%s>','email','MailAccountId','toPairsIn','mapValues','subjectOffline','offlineMessageSubject','Chat','NotifyMailAccount','Could\x20not\x20remove\x20attachment\x20file','addInteraction','omit','getInteractions','Owner','fullname','internal','Tags','color','tag','getSnippet','timezone','interval','iftime\x20%s','indexOf','true','[%s][INTERVAL][%s]\x20%s\x20%s\x20(%s)','inspect','Interval','Intervals','License','increment','all','some','server/files/chat/iframe.ejs','remote','x-real-ip','connection','remoteAddress','referer','virtual','replace','render','alignment','verticalAlignment','textColor','color_button','backgroundColor','addApplications','Transaction','ISOLATION_LEVELS','READ_COMMITTED','ChatApplication','findAndCountAll','finally','getApplications','chatProactiveAction','addProactiveActions','getProactiveActions','online','false','offlineForm','onlineForm','items','fromKey','getOfflineMessages','Contact','addAgents','emit','userChatWebsite:remove','getAgents','User','bluebird','mustache','util','lodash','querystring','../../components/parsers/qs','../../config/logger','api','../../config/environment','../../mysqldb','defaults','redis','socket.io-emitter','./chatWebsite.socket','register','client','http','info','debug','ChatWebsite,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','ChatWebsite,\x20%s,\x20%s','message','result','catch','sendStatus','status','end','offset','undefined','limit','count','set','Content-Range','json','update','destroy','then','get','ChatWebsites','UserProfileResource','stack','name','index','Pause','mandatoryDispositionPause','map','ChatWebsite','rawAttributes','fieldName','type','key','model','query','filters','attributes','intersection','hasOwnProperty','nolimit','order','sort','where','pick','merge','VIRTUAL','filter','options','include','findAll','params','keys','fields','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','find','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','describe','addDisposition','ChatWebsiteId','getDispositions','Disposition','length','rows','removeDispositions','ids','CannedAnswer','getAnswers','findOne','includeAll','addLogo','sitepic','filename','addAvatar','file','addCustomerAvatar','customerAvatar','addSystemAvatar'];(function(_0x50da13,_0x45915c){var _0x2b5999=function(_0x2b1f7f){while(--_0x2b1f7f){_0x50da13['push'](_0x50da13['shift']());}};_0x2b5999(++_0x45915c);}(_0xeced,0x1e2));var _0xdece=function(_0x3818e8,_0x127a59){_0x3818e8=_0x3818e8-0x0;var _0x4a6a9=_0xeced[_0x3818e8];return _0x4a6a9;};'use strict';var BPromise=require(_0xdece('0x0'));var Mustache=require(_0xdece('0x1'));var util=require(_0xdece('0x2'));var path=require('path');var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xdece('0x3'));var querystring=require(_0xdece('0x4'));var Redis=require('ioredis');var qs=require(_0xdece('0x5'));var logger=require(_0xdece('0x6'))(_0xdece('0x7'));var config=require(_0xdece('0x8'));var db=require(_0xdece('0x9'))['db'];config['redis']=_[_0xdece('0xa')](config[_0xdece('0xb')],{'host':'localhost','port':0x18eb});var socket=require(_0xdece('0xc'))(new Redis(config[_0xdece('0xb')]));require(_0xdece('0xd'))[_0xdece('0xe')](socket);var jayson=require('jayson/promise');var client=jayson[_0xdece('0xf')][_0xdece('0x10')]({'port':0x232c});var client9002=jayson[_0xdece('0xf')][_0xdece('0x10')]({'port':0x232a});var client9003=jayson['client']['http']({'port':0x232b});var client9001=jayson['client']['http']({'port':0x2329});function respondWithRpcPromise(_0x11681b,_0x8001f4,_0x241640,_0x23c623){return new BPromise(function(_0x3150cf,_0x27e1c){var _0x348448=_0x23c623||client;return _0x348448['request'](_0x11681b,_0x241640)['then'](function(_0x3b5660){logger[_0xdece('0x11')]('ChatWebsite,\x20%s,\x20%s',_0x8001f4,'request\x20sent');logger[_0xdece('0x12')](_0xdece('0x13'),_0x8001f4,_0xdece('0x14'),JSON[_0xdece('0x15')](_0x3b5660));if(_0x3b5660[_0xdece('0x16')]){if(_0x3b5660[_0xdece('0x16')]['code']===0x1f4){logger[_0xdece('0x16')](_0xdece('0x17'),_0x8001f4,_0x3b5660[_0xdece('0x16')][_0xdece('0x18')]);return _0x27e1c(_0x3b5660[_0xdece('0x16')]['message']);}logger['error']('ChatWebsite,\x20%s,\x20%s',_0x8001f4,_0x3b5660['error'][_0xdece('0x18')]);return _0x3150cf(_0x3b5660[_0xdece('0x16')]['message']);}else{logger[_0xdece('0x11')](_0xdece('0x17'),_0x8001f4,_0xdece('0x14'));_0x3150cf(_0x3b5660[_0xdece('0x19')][_0xdece('0x18')]);}})[_0xdece('0x1a')](function(_0x112a96){logger[_0xdece('0x16')]('ChatWebsite,\x20%s,\x20%s',_0x8001f4,_0x112a96);_0x27e1c(_0x112a96);});});}function respondWithStatusCode(_0x1fbbac,_0x5b4050){_0x5b4050=_0x5b4050||0xcc;return function(_0x4161b2){if(_0x4161b2){return _0x1fbbac[_0xdece('0x1b')](_0x5b4050);}return _0x1fbbac[_0xdece('0x1c')](_0x5b4050)[_0xdece('0x1d')]();};}function respondWithResult(_0x20e392,_0x3c2945){_0x3c2945=_0x3c2945||0xc8;return function(_0x3d41cc){if(_0x3d41cc){return _0x20e392['status'](_0x3c2945)['json'](_0x3d41cc);}};}function respondWithFilteredResult(_0x1364d9,_0x250da0){return function(_0x4a5ae9){if(_0x4a5ae9){var _0x20f2cf=typeof _0x250da0[_0xdece('0x1e')]===_0xdece('0x1f')&&typeof _0x250da0[_0xdece('0x20')]===_0xdece('0x1f');var _0x1c0ca9=_0x4a5ae9[_0xdece('0x21')];var _0x53c9e0=_0x20f2cf?0x0:_0x250da0['offset'];var _0x5da62a=_0x20f2cf?_0x4a5ae9[_0xdece('0x21')]:_0x250da0['offset']+_0x250da0[_0xdece('0x20')];var _0x359a4e;if(_0x5da62a>=_0x1c0ca9){_0x5da62a=_0x1c0ca9;_0x359a4e=0xc8;}else{_0x359a4e=0xce;}_0x1364d9['status'](_0x359a4e);return _0x1364d9[_0xdece('0x22')](_0xdece('0x23'),_0x53c9e0+'-'+_0x5da62a+'/'+_0x1c0ca9)[_0xdece('0x24')](_0x4a5ae9);}return null;};}function saveUpdates(_0x567424){return function(_0x10868a){if(_0x10868a){return _0x10868a[_0xdece('0x25')](_0x567424)['then'](function(_0x20d463){return _0x20d463;});}return null;};}function removeEntity(_0x4332c3){return function(_0xd5db4a){if(_0xd5db4a){return _0xd5db4a[_0xdece('0x26')]()[_0xdece('0x27')](function(){var _0x728843=_0xd5db4a[_0xdece('0x28')]({'plain':!![]});var _0x427e0f=_0xdece('0x29');return db[_0xdece('0x2a')][_0xdece('0x26')]({'where':{'type':_0x427e0f,'resourceId':_0x728843['id']}})[_0xdece('0x27')](function(){return _0xd5db4a;});})['then'](function(){_0x4332c3[_0xdece('0x1c')](0xcc)['end']();});}};}function handleEntityNotFound(_0x520486){return function(_0x2d6bcb){if(!_0x2d6bcb){_0x520486[_0xdece('0x1b')](0x194);}return _0x2d6bcb;};}function handleError(_0x5af92e,_0x48a438){_0x48a438=_0x48a438||0x1f4;return function(_0x3b893e){logger['error'](_0x3b893e[_0xdece('0x2b')]);if(_0x3b893e['name']){delete _0x3b893e[_0xdece('0x2c')];}_0x5af92e[_0xdece('0x1c')](_0x48a438)['send'](_0x3b893e);};}exports[_0xdece('0x2d')]=function(_0x3ab930,_0x250520){var _0x251162={'include':[{'model':db[_0xdece('0x2e')],'as':_0xdece('0x2f')}]},_0x11b2ae={},_0x166c6b={'count':0x0,'rows':[]};var _0x4d3ed2=_[_0xdece('0x30')](db[_0xdece('0x31')][_0xdece('0x32')],function(_0x5d4c43){return{'name':_0x5d4c43[_0xdece('0x33')],'type':_0x5d4c43[_0xdece('0x34')][_0xdece('0x35')]};});_0x11b2ae[_0xdece('0x36')]=_[_0xdece('0x30')](_0x4d3ed2,_0xdece('0x2c'));_0x11b2ae[_0xdece('0x37')]=_['keys'](_0x3ab930[_0xdece('0x37')]);_0x11b2ae[_0xdece('0x38')]=_['intersection'](_0x11b2ae[_0xdece('0x36')],_0x11b2ae[_0xdece('0x37')]);_0x251162[_0xdece('0x39')]=_[_0xdece('0x3a')](_0x11b2ae[_0xdece('0x36')],qs['fields'](_0x3ab930[_0xdece('0x37')]['fields']));_0x251162[_0xdece('0x39')]=_0x251162[_0xdece('0x39')]['length']?_0x251162[_0xdece('0x39')]:_0x11b2ae[_0xdece('0x36')];if(!_0x3ab930['query'][_0xdece('0x3b')](_0xdece('0x3c'))){_0x251162[_0xdece('0x20')]=qs[_0xdece('0x20')](_0x3ab930[_0xdece('0x37')][_0xdece('0x20')]);_0x251162[_0xdece('0x1e')]=qs[_0xdece('0x1e')](_0x3ab930[_0xdece('0x37')][_0xdece('0x1e')]);}_0x251162[_0xdece('0x3d')]=qs[_0xdece('0x3e')](_0x3ab930[_0xdece('0x37')][_0xdece('0x3e')]);_0x251162[_0xdece('0x3f')]=qs[_0xdece('0x38')](_[_0xdece('0x40')](_0x3ab930[_0xdece('0x37')],_0x11b2ae['filters']),_0x4d3ed2);if(_0x3ab930[_0xdece('0x37')]['filter']){_0x251162['where']=_[_0xdece('0x41')](_0x251162['where'],{'$or':_[_0xdece('0x30')](_0x4d3ed2,function(_0x12f2a0){if(_0x12f2a0[_0xdece('0x34')]!==_0xdece('0x42')){var _0x65b829={};_0x65b829[_0x12f2a0['name']]={'$like':'%'+_0x3ab930['query'][_0xdece('0x43')]+'%'};return _0x65b829;}})});}_0x251162=_[_0xdece('0x41')]({},_0x251162,_0x3ab930[_0xdece('0x44')]);var _0x2da674={'where':_0x251162[_0xdece('0x3f')]};return db[_0xdece('0x31')][_0xdece('0x21')](_0x2da674)[_0xdece('0x27')](function(_0x16b2a2){_0x166c6b[_0xdece('0x21')]=_0x16b2a2;if(_0x3ab930[_0xdece('0x37')]['includeAll']){_0x251162[_0xdece('0x45')]=[{'all':!![]}];}return db[_0xdece('0x31')][_0xdece('0x46')](_0x251162);})[_0xdece('0x27')](function(_0x1ec133){_0x166c6b['rows']=_0x1ec133;return _0x166c6b;})[_0xdece('0x27')](respondWithFilteredResult(_0x250520,_0x251162))['catch'](handleError(_0x250520,null));};exports['show']=function(_0x423396,_0x244bbb){var _0x2aff03={'raw':![],'where':{'id':_0x423396[_0xdece('0x47')]['id']},'include':[{'model':db[_0xdece('0x2e')],'as':_0xdece('0x2f')}]},_0x206f1e={};_0x206f1e[_0xdece('0x36')]=_['keys'](db[_0xdece('0x31')][_0xdece('0x32')]);_0x206f1e['query']=_[_0xdece('0x48')](_0x423396[_0xdece('0x37')]);_0x206f1e[_0xdece('0x38')]=_['intersection'](_0x206f1e[_0xdece('0x36')],_0x206f1e[_0xdece('0x37')]);_0x2aff03['attributes']=_['intersection'](_0x206f1e['model'],qs[_0xdece('0x49')](_0x423396[_0xdece('0x37')][_0xdece('0x49')]));_0x2aff03[_0xdece('0x39')]=_0x2aff03['attributes']['length']?_0x2aff03[_0xdece('0x39')]:_0x206f1e[_0xdece('0x36')];if(_0x423396['query']['includeAll']){_0x2aff03['include']=[{'all':!![]}];}_0x2aff03=_[_0xdece('0x41')]({},_0x2aff03,_0x423396[_0xdece('0x44')]);return db[_0xdece('0x31')]['find'](_0x2aff03)[_0xdece('0x27')](handleEntityNotFound(_0x244bbb,null))[_0xdece('0x27')](respondWithResult(_0x244bbb,null))[_0xdece('0x1a')](handleError(_0x244bbb,null));};exports[_0xdece('0x4a')]=function(_0x3d2b32,_0x3718e3){return db[_0xdece('0x31')][_0xdece('0x4a')](_0x3d2b32[_0xdece('0x4b')],{})[_0xdece('0x27')](function(_0x195bcf){var _0x2b1c5d=_0x3d2b32[_0xdece('0x4c')][_0xdece('0x28')]({'plain':!![]});if(!_0x2b1c5d)throw new Error(_0xdece('0x4d'));if(_0x2b1c5d[_0xdece('0x4e')]===_0xdece('0x4c')){var _0x23d4a7=_0x195bcf[_0xdece('0x28')]({'plain':!![]});var _0x3b4631=_0xdece('0x29');return db['UserProfileSection'][_0xdece('0x4f')]({'where':{'name':_0x3b4631,'userProfileId':_0x2b1c5d[_0xdece('0x50')]},'raw':!![]})[_0xdece('0x27')](function(_0x50a042){if(_0x50a042&&_0x50a042[_0xdece('0x51')]===0x0){return db['UserProfileResource']['create']({'name':_0x23d4a7['name'],'resourceId':_0x23d4a7['id'],'type':_0x50a042[_0xdece('0x2c')],'sectionId':_0x50a042['id']},{})[_0xdece('0x27')](function(){return _0x195bcf;});}else{return _0x195bcf;}})[_0xdece('0x1a')](function(_0x43402f){logger[_0xdece('0x16')](_0xdece('0x52'),_0x43402f);throw _0x43402f;});}return _0x195bcf;})[_0xdece('0x27')](respondWithResult(_0x3718e3,0xc9))[_0xdece('0x1a')](handleError(_0x3718e3,null));};exports['update']=function(_0x3f7a46,_0x2f555e){if(_0x3f7a46[_0xdece('0x4b')]['id']){delete _0x3f7a46[_0xdece('0x4b')]['id'];}return db[_0xdece('0x31')]['find']({'where':{'id':_0x3f7a46['params']['id']},'include':[{'model':db[_0xdece('0x2e')],'as':_0xdece('0x2f')}]})[_0xdece('0x27')](handleEntityNotFound(_0x2f555e,null))[_0xdece('0x27')](saveUpdates(_0x3f7a46['body'],null))[_0xdece('0x27')](respondWithResult(_0x2f555e,null))[_0xdece('0x1a')](handleError(_0x2f555e,null));};exports['destroy']=function(_0x4f0256,_0x4fbed4){return db['ChatWebsite'][_0xdece('0x4f')]({'where':{'id':_0x4f0256['params']['id']}})[_0xdece('0x27')](handleEntityNotFound(_0x4fbed4,null))[_0xdece('0x27')](removeEntity(_0x4fbed4,null))['catch'](handleError(_0x4fbed4,null));};exports[_0xdece('0x53')]=function(_0x2f9aff,_0x381209){return db[_0xdece('0x31')][_0xdece('0x53')]()['then'](respondWithResult(_0x381209,null))[_0xdece('0x1a')](handleError(_0x381209,null));};exports[_0xdece('0x54')]=function(_0x49d1ef,_0x50642b){if(_0x49d1ef[_0xdece('0x4b')]['id']){delete _0x49d1ef[_0xdece('0x4b')]['id'];}return db[_0xdece('0x31')][_0xdece('0x4f')]({'where':{'id':_0x49d1ef[_0xdece('0x47')]['id']}})[_0xdece('0x27')](handleEntityNotFound(_0x50642b,null))['then'](function(_0x339f41){if(_0x339f41){_0x49d1ef[_0xdece('0x4b')][_0xdece('0x55')]=_0x339f41['id'];return db['Disposition']['create'](_0x49d1ef['body']);}})[_0xdece('0x27')](respondWithResult(_0x50642b,null))[_0xdece('0x1a')](handleError(_0x50642b,null));};exports[_0xdece('0x56')]=function(_0x48f53c,_0x408ce3){var _0x38adb8={'raw':![],'where':{}};var _0x566f00={};var _0x3a7d5e={'count':0x0,'rows':[]};return db[_0xdece('0x31')]['findOne']({'where':{'id':_0x48f53c[_0xdece('0x47')]['id']}})[_0xdece('0x27')](handleEntityNotFound(_0x408ce3,null))[_0xdece('0x27')](function(_0x4d805c){if(_0x4d805c){_0x566f00[_0xdece('0x36')]=_['keys'](db[_0xdece('0x57')]['rawAttributes']);_0x566f00[_0xdece('0x37')]=_[_0xdece('0x48')](_0x48f53c[_0xdece('0x37')]);_0x566f00['filters']=_[_0xdece('0x3a')](_0x566f00[_0xdece('0x36')],_0x566f00[_0xdece('0x37')]);_0x38adb8[_0xdece('0x39')]=_['intersection'](_0x566f00[_0xdece('0x36')],qs['fields'](_0x48f53c[_0xdece('0x37')][_0xdece('0x49')]));_0x38adb8['attributes']=_0x38adb8[_0xdece('0x39')][_0xdece('0x58')]?_0x38adb8[_0xdece('0x39')]:_0x566f00[_0xdece('0x36')];if(!_0x48f53c[_0xdece('0x37')]['hasOwnProperty'](_0xdece('0x3c'))){_0x38adb8['limit']=qs[_0xdece('0x20')](_0x48f53c['query']['limit']);_0x38adb8[_0xdece('0x1e')]=qs[_0xdece('0x1e')](_0x48f53c[_0xdece('0x37')][_0xdece('0x1e')]);}_0x38adb8[_0xdece('0x3d')]=qs[_0xdece('0x3e')](_0x48f53c['query'][_0xdece('0x3e')]);_0x38adb8['where']=qs[_0xdece('0x38')](_['pick'](_0x48f53c['query'],_0x566f00[_0xdece('0x38')]));_0x38adb8[_0xdece('0x3f')][_0xdece('0x55')]=_0x4d805c['id'];if(_0x48f53c[_0xdece('0x37')][_0xdece('0x43')]){_0x38adb8['where']=_['merge'](_0x38adb8[_0xdece('0x3f')],{'$or':_[_0xdece('0x30')](_0x38adb8[_0xdece('0x39')],function(_0x1a5e08){var _0x4da96b={};_0x4da96b[_0x1a5e08]={'$like':'%'+_0x48f53c[_0xdece('0x37')][_0xdece('0x43')]+'%'};return _0x4da96b;})});}_0x38adb8=_['merge']({},_0x38adb8,_0x48f53c['options']);return db[_0xdece('0x57')]['count']({'where':_0x38adb8[_0xdece('0x3f')]})[_0xdece('0x27')](function(_0x221611){_0x3a7d5e['count']=_0x221611;if(_0x48f53c[_0xdece('0x37')]['includeAll']){_0x38adb8[_0xdece('0x45')]=[{'all':!![]}];}return db[_0xdece('0x57')][_0xdece('0x46')](_0x38adb8);})[_0xdece('0x27')](function(_0x1d919d){_0x3a7d5e[_0xdece('0x59')]=_0x1d919d;return _0x3a7d5e;});}})[_0xdece('0x27')](respondWithFilteredResult(_0x408ce3,_0x38adb8))[_0xdece('0x1a')](handleError(_0x408ce3,null));};exports[_0xdece('0x5a')]=function(_0x597581,_0x575e6e){return db[_0xdece('0x31')][_0xdece('0x4f')]({'where':{'id':_0x597581[_0xdece('0x47')]['id']}})[_0xdece('0x27')](handleEntityNotFound(_0x575e6e,null))[_0xdece('0x27')](function(_0x17ef37){if(_0x17ef37){return _0x17ef37[_0xdece('0x5a')](_0x597581[_0xdece('0x37')][_0xdece('0x5b')]);}})[_0xdece('0x27')](respondWithStatusCode(_0x575e6e,null))[_0xdece('0x1a')](handleError(_0x575e6e,null));};exports['addAnswer']=function(_0x50044d,_0xb9d6b7){if(_0x50044d[_0xdece('0x4b')]['id']){delete _0x50044d[_0xdece('0x4b')]['id'];}return db['ChatWebsite'][_0xdece('0x4f')]({'where':{'id':_0x50044d['params']['id']}})[_0xdece('0x27')](handleEntityNotFound(_0xb9d6b7,null))[_0xdece('0x27')](function(_0x253338){if(_0x253338){_0x50044d[_0xdece('0x4b')][_0xdece('0x55')]=_0x253338['id'];return db[_0xdece('0x5c')]['create'](_0x50044d[_0xdece('0x4b')]);}})['then'](respondWithResult(_0xb9d6b7,null))[_0xdece('0x1a')](handleError(_0xb9d6b7,null));};exports[_0xdece('0x5d')]=function(_0x45c875,_0x33f8fe){var _0x205ef4={'raw':![],'where':{}};var _0x9fd0fb={};var _0x269fd8={'count':0x0,'rows':[]};return db['ChatWebsite'][_0xdece('0x5e')]({'where':{'id':_0x45c875[_0xdece('0x47')]['id']}})[_0xdece('0x27')](handleEntityNotFound(_0x33f8fe,null))[_0xdece('0x27')](function(_0xb4ce56){if(_0xb4ce56){_0x9fd0fb['model']=_['keys'](db['CannedAnswer'][_0xdece('0x32')]);_0x9fd0fb[_0xdece('0x37')]=_[_0xdece('0x48')](_0x45c875[_0xdece('0x37')]);_0x9fd0fb[_0xdece('0x38')]=_[_0xdece('0x3a')](_0x9fd0fb[_0xdece('0x36')],_0x9fd0fb[_0xdece('0x37')]);_0x205ef4[_0xdece('0x39')]=_['intersection'](_0x9fd0fb[_0xdece('0x36')],qs[_0xdece('0x49')](_0x45c875[_0xdece('0x37')][_0xdece('0x49')]));_0x205ef4[_0xdece('0x39')]=_0x205ef4[_0xdece('0x39')][_0xdece('0x58')]?_0x205ef4[_0xdece('0x39')]:_0x9fd0fb[_0xdece('0x36')];if(!_0x45c875[_0xdece('0x37')]['hasOwnProperty'](_0xdece('0x3c'))){_0x205ef4[_0xdece('0x20')]=qs['limit'](_0x45c875['query'][_0xdece('0x20')]);_0x205ef4['offset']=qs[_0xdece('0x1e')](_0x45c875[_0xdece('0x37')][_0xdece('0x1e')]);}_0x205ef4[_0xdece('0x3d')]=qs[_0xdece('0x3e')](_0x45c875[_0xdece('0x37')][_0xdece('0x3e')]);_0x205ef4[_0xdece('0x3f')]=qs[_0xdece('0x38')](_[_0xdece('0x40')](_0x45c875[_0xdece('0x37')],_0x9fd0fb[_0xdece('0x38')]));_0x205ef4[_0xdece('0x3f')][_0xdece('0x55')]=_0xb4ce56['id'];if(_0x45c875[_0xdece('0x37')]['filter']){_0x205ef4[_0xdece('0x3f')]=_[_0xdece('0x41')](_0x205ef4[_0xdece('0x3f')],{'$or':_[_0xdece('0x30')](_0x205ef4[_0xdece('0x39')],function(_0x542f0c){var _0x1e9bc1={};_0x1e9bc1[_0x542f0c]={'$like':'%'+_0x45c875[_0xdece('0x37')][_0xdece('0x43')]+'%'};return _0x1e9bc1;})});}_0x205ef4=_[_0xdece('0x41')]({},_0x205ef4,_0x45c875['options']);return db['CannedAnswer'][_0xdece('0x21')]({'where':_0x205ef4[_0xdece('0x3f')]})[_0xdece('0x27')](function(_0x35ad45){_0x269fd8[_0xdece('0x21')]=_0x35ad45;if(_0x45c875['query'][_0xdece('0x5f')]){_0x205ef4[_0xdece('0x45')]=[{'all':!![]}];}return db['CannedAnswer']['findAll'](_0x205ef4);})[_0xdece('0x27')](function(_0x106ba2){_0x269fd8[_0xdece('0x59')]=_0x106ba2;return _0x269fd8;});}})[_0xdece('0x27')](respondWithFilteredResult(_0x33f8fe,_0x205ef4))['catch'](handleError(_0x33f8fe,null));};exports['removeAnswers']=function(_0x2021c3,_0x384a67){return db[_0xdece('0x31')]['find']({'where':{'id':_0x2021c3[_0xdece('0x47')]['id']}})[_0xdece('0x27')](handleEntityNotFound(_0x384a67,null))[_0xdece('0x27')](function(_0x20fa84){if(_0x20fa84){return _0x20fa84['removeAnswers'](_0x2021c3['query']['ids']);}})[_0xdece('0x27')](respondWithStatusCode(_0x384a67,null))['catch'](handleError(_0x384a67,null));};exports[_0xdece('0x60')]=function(_0x1e619f,_0x2128bf){_0x1e619f['body'][_0xdece('0x61')]=_0x1e619f['file'][_0xdece('0x62')];return db[_0xdece('0x31')][_0xdece('0x4f')]({'where':{'id':_0x1e619f[_0xdece('0x47')]['id']}})[_0xdece('0x27')](handleEntityNotFound(_0x2128bf,null))[_0xdece('0x27')](saveUpdates(_0x1e619f['body'],null))[_0xdece('0x27')](respondWithResult(_0x2128bf,null))[_0xdece('0x1a')](handleError(_0x2128bf,null));};exports[_0xdece('0x63')]=function(_0x31e56d,_0x5ee7ad){_0x31e56d[_0xdece('0x4b')]['agentAvatar']=_0x31e56d[_0xdece('0x64')][_0xdece('0x62')];return db[_0xdece('0x31')]['find']({'where':{'id':_0x31e56d['params']['id']}})[_0xdece('0x27')](handleEntityNotFound(_0x5ee7ad,null))[_0xdece('0x27')](saveUpdates(_0x31e56d['body'],null))[_0xdece('0x27')](respondWithResult(_0x5ee7ad,null))[_0xdece('0x1a')](handleError(_0x5ee7ad,null));};exports[_0xdece('0x65')]=function(_0x234a51,_0x2fdfaa){_0x234a51[_0xdece('0x4b')][_0xdece('0x66')]=_0x234a51[_0xdece('0x64')][_0xdece('0x62')];return db[_0xdece('0x31')][_0xdece('0x4f')]({'where':{'id':_0x234a51[_0xdece('0x47')]['id']}})[_0xdece('0x27')](handleEntityNotFound(_0x2fdfaa,null))[_0xdece('0x27')](saveUpdates(_0x234a51[_0xdece('0x4b')],null))[_0xdece('0x27')](respondWithResult(_0x2fdfaa,null))[_0xdece('0x1a')](handleError(_0x2fdfaa,null));};exports[_0xdece('0x67')]=function(_0x105ac4,_0x29a28e){_0x105ac4[_0xdece('0x4b')][_0xdece('0x68')]=_0x105ac4[_0xdece('0x64')][_0xdece('0x62')];return db[_0xdece('0x31')]['find']({'where':{'id':_0x105ac4[_0xdece('0x47')]['id']}})[_0xdece('0x27')](handleEntityNotFound(_0x29a28e,null))['then'](saveUpdates(_0x105ac4[_0xdece('0x4b')],null))[_0xdece('0x27')](respondWithResult(_0x29a28e,null))[_0xdece('0x1a')](handleError(_0x29a28e,null));};exports[_0xdece('0x69')]=function(_0x31b2f3,_0x40eab5){var _0xf73dfa=path[_0xdece('0x6a')](config[_0xdece('0x6b')],_0xdece('0x6c'));var _0x2623c9={'where':{'id':_0x31b2f3[_0xdece('0x47')]['id']},'attributes':['id',_0xdece('0x61')],'raw':!![]};var _0x2fc86e=![];return require(_0xdece('0x6d'))[_0xdece('0x6e')]()[_0xdece('0x27')](function(_0x544e3a){if(_0x544e3a){_0x2fc86e=_0x544e3a[_0xdece('0x6f')];}})[_0xdece('0x27')](function(){return db[_0xdece('0x31')][_0xdece('0x4f')](_0x2623c9);})[_0xdece('0x27')](handleEntityNotFound(_0x40eab5,null))[_0xdece('0x27')](function(_0x59aa56){if(_0x59aa56){if(!_[_0xdece('0x70')](_0x59aa56[_0xdece('0x61')])){if(fs[_0xdece('0x71')](path[_0xdece('0x6a')](config['root'],_0xdece('0x72'),_0x59aa56[_0xdece('0x61')]))&&_0x2fc86e){_0xf73dfa=path[_0xdece('0x6a')](config['root'],_0xdece('0x72'),_0x59aa56[_0xdece('0x61')]);}}return _0x40eab5[_0xdece('0x73')](_0xf73dfa);}})[_0xdece('0x1a')](handleError(_0x40eab5,null));};exports[_0xdece('0x74')]=function(_0x1c09c6,_0x463500){var _0x4bb690=path[_0xdece('0x6a')](config['root'],'server/files/images/avatars/default_avatar.png');var _0x4cd003={'where':{'id':_0x1c09c6['params']['id']},'attributes':['id',_0xdece('0x75')],'raw':!![]};return db['ChatWebsite'][_0xdece('0x4f')](_0x4cd003)['then'](handleEntityNotFound(_0x463500,null))[_0xdece('0x27')](function(_0x322f91){if(_0x322f91){if(!_[_0xdece('0x70')](_0x322f91['agentAvatar'])){if(fs[_0xdece('0x71')](path[_0xdece('0x6a')](config['root'],_0xdece('0x76'),_0x322f91[_0xdece('0x75')]))){_0x4bb690=path[_0xdece('0x6a')](config['root'],'server/files/images/avatars/',_0x322f91[_0xdece('0x75')]);}}return _0x463500[_0xdece('0x73')](_0x4bb690);}})[_0xdece('0x1a')](handleError(_0x463500,null));};exports[_0xdece('0x77')]=function(_0x4e61cf,_0xd178ec){var _0x5f15f5=path['join'](config[_0xdece('0x6b')],_0xdece('0x78'));var _0x37d86b={'where':{'id':_0x4e61cf[_0xdece('0x47')]['id']},'attributes':['id',_0xdece('0x66'),_0xdece('0x79')],'raw':!![]};return db[_0xdece('0x31')][_0xdece('0x4f')](_0x37d86b)['then'](handleEntityNotFound(_0xd178ec,null))[_0xdece('0x27')](function(_0x15f2d6){if(_0x15f2d6){if(!_['isNil'](_0x15f2d6[_0xdece('0x66')])){if(fs['existsSync'](path[_0xdece('0x6a')](config[_0xdece('0x6b')],_0xdece('0x76'),_0x15f2d6['customerAvatar']))&&_0x15f2d6[_0xdece('0x79')]){_0x5f15f5=path[_0xdece('0x6a')](config['root'],_0xdece('0x76'),_0x15f2d6[_0xdece('0x66')]);}}return _0xd178ec[_0xdece('0x73')](_0x5f15f5);}})['catch'](handleError(_0xd178ec,null));};exports['getSystemAvatar']=function(_0x2b2bf7,_0xfd14dd){var _0x261908=path[_0xdece('0x6a')](config[_0xdece('0x6b')],'server/files/images/avatars/system_avatar.png');var _0x396974={'where':{'id':_0x2b2bf7[_0xdece('0x47')]['id']},'attributes':['id',_0xdece('0x68')],'raw':!![]};return db[_0xdece('0x31')]['find'](_0x396974)[_0xdece('0x27')](handleEntityNotFound(_0xfd14dd,null))[_0xdece('0x27')](function(_0x196167){if(_0x196167){if(!_[_0xdece('0x70')](_0x196167[_0xdece('0x68')])){if(fs[_0xdece('0x71')](path[_0xdece('0x6a')](config[_0xdece('0x6b')],'server/files/images/avatars/',_0x196167[_0xdece('0x68')]))){_0x261908=path[_0xdece('0x6a')](config['root'],_0xdece('0x76'),_0x196167[_0xdece('0x68')]);}}return _0xfd14dd[_0xdece('0x73')](_0x261908);}})['catch'](handleError(_0xfd14dd,null));};exports['notify']=function(_0x534ad7,_0x4bba23){var _0x5ccf62=require('user-agent-parser');var _0x40d4f0=new _0x5ccf62();var _0xd1c76=_0x40d4f0['setUA'](_0x534ad7[_0xdece('0x7a')][_0xdece('0x7b')])[_0xdece('0x7c')]();var _0x485efa={'body':_0x534ad7['body'],'channel':_0xdece('0x7d')};var _0xe14b6e=[];var _0x2838e6=[];var _0x480db5={};var _0x38c3b9=![];return db[_0xdece('0x7e')][_0xdece('0x53')]()[_0xdece('0x27')](function(_0x4393ef){if(!_0x4393ef){throw new db['Sequelize'][(_0xdece('0x7f'))](_0xdece('0x80'));}_0xe14b6e=_['difference'](_[_0xdece('0x48')](_0x4393ef),['createdAt',_0xdece('0x81')]);_0x2838e6=_[_0xdece('0x82')](_['keys'](_0x4393ef),['createdAt','updatedAt',_0xdece('0x83'),'ListId']);if(_0x534ad7[_0xdece('0x4b')]['id']){delete _0x534ad7[_0xdece('0x4b')]['id'];}if(_[_0xdece('0x70')](_0x534ad7[_0xdece('0x4b')][_0xdece('0x84')])){throw new db[(_0xdece('0x85'))][(_0xdece('0x7f'))]('from\x20is\x20mandatory');}if(_[_0xdece('0x70')](_0x534ad7[_0xdece('0x4b')][_0xdece('0x4b')])||_0x534ad7[_0xdece('0x4b')][_0xdece('0x4b')]===''){throw new db[(_0xdece('0x85'))][(_0xdece('0x7f'))]('body\x20is\x20mandatory\x20and\x20not\x20empty');}if(_[_0xdece('0x70')](_0x534ad7['body'][_0xdece('0x86')])){throw new db[(_0xdece('0x85'))][(_0xdece('0x7f'))](_0xdece('0x87')+_0x2838e6);}if(!_['includes'](_0x2838e6,_0x534ad7[_0xdece('0x4b')]['mapKey'])){throw new db['Sequelize'][(_0xdece('0x7f'))](_0xdece('0x88')+_0x2838e6);}_0x480db5[_0x534ad7[_0xdece('0x4b')][_0xdece('0x86')]]=_0x534ad7[_0xdece('0x4b')][_0xdece('0x84')];})[_0xdece('0x27')](function(){return db['ChatWebsite'][_0xdece('0x4f')]({'where':{'id':_0x534ad7[_0xdece('0x47')]['id']},'include':[{'model':db[_0xdece('0x89')],'as':_0xdece('0x8a'),'include':[{'model':db['CmContact'],'as':_0xdece('0x8b'),'where':_0x480db5,'limit':0x1,'order':[['updatedAt',_0xdece('0x8c')]]}]},{'model':db['ChatApplication'],'as':_0xdece('0x8d')}]});})[_0xdece('0x27')](handleEntityNotFound(_0x4bba23,null))[_0xdece('0x27')](function(_0x9e438a){if(_0x9e438a&&_0x9e438a[_0xdece('0x8a')]){_0x485efa[_0xdece('0x8e')]=_0x9e438a;_0x485efa[_0xdece('0x8f')]=_0x9e438a['Applications'];_0x485efa['list']=_0x9e438a['List'];_0x485efa[_0xdece('0x8f')]=_['orderBy'](_0x485efa['applications'],[_0xdece('0x90')],[_0xdece('0x91')]);if(_0x485efa[_0xdece('0x8e')][_0xdece('0x8d')]){delete _0x485efa[_0xdece('0x8e')]['Applications'];}if(_0x485efa[_0xdece('0x8e')]['List']&&_0x485efa[_0xdece('0x8e')][_0xdece('0x8a')][_0xdece('0x8b')][_0xdece('0x58')]){return _0x485efa[_0xdece('0x8e')][_0xdece('0x8a')]['Contacts'][0x0];}var _0x48e46d=_[_0xdece('0xa')](_0x534ad7[_0xdece('0x4b')],{'firstName':_0x534ad7[_0xdece('0x4b')][_0xdece('0x84')],'ListId':_0x9e438a[_0xdece('0x92')]});_0x48e46d[_0x534ad7[_0xdece('0x4b')][_0xdece('0x86')]]=_0x534ad7['body']['from'];return db[_0xdece('0x7e')]['create'](_0x48e46d,{'fields':_0xe14b6e,'raw':!![]});}})[_0xdece('0x27')](handleEntityNotFound(_0x4bba23,null))[_0xdece('0x27')](function(_0x1958a6){_0x485efa[_0xdece('0x93')]=_0x1958a6;var _0x352318=_0x534ad7[_0xdece('0x4b')][_0xdece('0x94')];if(_0x534ad7[_0xdece('0x7a')][_0xdece('0x95')]){_0x352318=_0x534ad7[_0xdece('0x7a')][_0xdece('0x95')];}else if(_0x534ad7[_0xdece('0x7a')][_0xdece('0x96')]){_0x352318=_['first'](_0x534ad7[_0xdece('0x7a')][_0xdece('0x96')][_0xdece('0x97')](','));}if(_0x1958a6){var _0x41fdfc={'ContactId':_0x1958a6['id'],'ChatWebsiteId':_0x534ad7[_0xdece('0x47')]['id'],'from':(_0x1958a6[_0xdece('0x98')]||'')+'\x20'+(_0x1958a6[_0xdece('0x99')]||''),'customerIp':_0x352318,'customerPort':_0x534ad7[_0xdece('0x7a')][_0xdece('0x9a')]?_0x534ad7['headers'][_0xdece('0x9a')]:null,'referer':_0x534ad7[_0xdece('0x4b')]['referer'],'browserName':_0xd1c76['browser'][_0xdece('0x2c')]&&_0xd1c76['browser'][_0xdece('0x9b')]?util[_0xdece('0x9c')](_0xdece('0x9d'),_0xd1c76[_0xdece('0x9e')][_0xdece('0x2c')],_0xd1c76[_0xdece('0x9e')][_0xdece('0x9b')]):_0xdece('0x9f'),'browserVersion':_0xd1c76[_0xdece('0x9e')]['version']||'unknown','osName':util['format'](_0xdece('0x9d'),_0xd1c76['os']['name'],_0xd1c76['os']['version']),'osVersion':_0xd1c76['os']['version'],'deviceModel':_0xd1c76[_0xdece('0xa0')][_0xdece('0x36')]&&_0xd1c76[_0xdece('0xa0')]['vendor']?util[_0xdece('0x9c')](_0xdece('0xa1'),_0xd1c76['device']['model'],_0xd1c76[_0xdece('0xa0')]['vendor'],_0xd1c76[_0xdece('0xa0')][_0xdece('0x34')]):null,'deviceVendor':_0xd1c76[_0xdece('0xa0')]['vendor'],'deviceType':_0xd1c76[_0xdece('0xa0')]['type'],'formData':JSON[_0xdece('0x15')](_0x534ad7['body'])};var _0x106a41={'ChatWebsiteId':_0x534ad7[_0xdece('0x47')]['id'],'closed':![]};if(_0x534ad7['body'][_0xdece('0xa2')]){_0x106a41[_0xdece('0xa2')]=_0x534ad7['body'][_0xdece('0xa2')];return db[_0xdece('0xa3')]['find']({'where':_0x106a41})['then'](function(_0x487bd1){if(_0x487bd1){return[_0x487bd1,![]];}_0x41fdfc[_0xdece('0xa2')]=_0x534ad7[_0xdece('0x4b')][_0xdece('0xa2')];_0x41fdfc[_0xdece('0xa4')]=_0x534ad7['body'][_0xdece('0xa4')];return db[_0xdece('0xa3')][_0xdece('0x4a')](_0x41fdfc)['then'](function(_0x13458e){return[_0x13458e,!![]];});});}_0x106a41[_0xdece('0xa5')]=_0x1958a6['id'];if(_0x534ad7[_0xdece('0x4b')][_0xdece('0xa6')]&&_0x534ad7[_0xdece('0x4b')][_0xdece('0xa6')]['id']){_0x106a41['id']=_0x534ad7[_0xdece('0x4b')][_0xdece('0xa6')]['id'];return db[_0xdece('0xa3')][_0xdece('0x4f')]({'where':_0x106a41})[_0xdece('0x27')](function(_0x2a53f4){if(_0x2a53f4){return[_0x2a53f4,![]];}return db[_0xdece('0xa3')][_0xdece('0x4a')](_0x41fdfc)['then'](function(_0x1143a0){return[_0x1143a0,!![]];});});}return db[_0xdece('0xa3')][_0xdece('0x4a')](_0x41fdfc)[_0xdece('0x27')](function(_0x1aa00b){return[_0x1aa00b,!![]];});}})[_0xdece('0xa7')](function(_0x3a937d,_0x4276ad){if(_0x3a937d){_0x38c3b9=_0x4276ad;if(!_0x4276ad){var _0x58bc1e={'from':(_0x485efa[_0xdece('0x93')][_0xdece('0x98')]||'')+'\x20'+(_0x485efa[_0xdece('0x93')]['lastName']||'')};if(_0x534ad7['body'][_0xdece('0xa2')]&&_0x534ad7[_0xdece('0x4b')][_0xdece('0xa8')]&&_0x534ad7[_0xdece('0x4b')]['threadId']!=_0x534ad7[_0xdece('0x4b')][_0xdece('0xa8')]){_0x58bc1e['threadId']=_0x534ad7[_0xdece('0x4b')][_0xdece('0xa8')];}return _0x3a937d['update'](_0x58bc1e);}else{return _0x3a937d;}}})[_0xdece('0x27')](function(_0x1fe3bd){_0x485efa[_0xdece('0xa6')]=_0x1fe3bd[_0xdece('0x28')]({'plain':!![]});_0x485efa[_0xdece('0xa6')]['created']=_0x38c3b9;if(_0x485efa['interaction'][_0xdece('0xa9')]){if(_0x485efa[_0xdece('0x8e')][_0xdece('0xaa')]){_0x485efa[_0xdece('0x8f')][_0xdece('0xab')]({'id':0x0,'priority':_0x485efa[_0xdece('0x8f')][_0xdece('0x58')]+0x1,'app':_0xdece('0xac'),'appdata':_0xdece('0xad'),'interval':_0xdece('0xae')});}}return db[_0xdece('0xaf')][_0xdece('0x4a')]({'body':_0x534ad7[_0xdece('0x4b')][_0xdece('0x4b')],'ChatWebsiteId':_0x534ad7[_0xdece('0x47')]['id'],'ChatInteractionId':_0x1fe3bd['id'],'direction':'in','ContactId':_0x485efa[_0xdece('0x93')]['id'],'AttachmentId':_0x534ad7['body'][_0xdece('0xb0')]});})[_0xdece('0x27')](function(_0x3ae8d9){_0x485efa[_0xdece('0x18')]=_0x3ae8d9;if(_0x485efa[_0xdece('0xa6')][_0xdece('0xb1')]){return db['User']['find']({'attributes':['id',_0xdece('0x2c')],'where':{'id':_0x485efa[_0xdece('0xa6')]['UserId']}})[_0xdece('0x27')](function(_0x558d99){if(_0x558d99){_0x485efa[_0xdece('0x8f')]['unshift']({'id':0x0,'priority':0x0,'app':_0xdece('0xb2'),'appdata':_0x558d99['name']+','+(_0x485efa[_0xdece('0x8e')][_0xdece('0xb3')]||0xa),'interval':_0xdece('0xae')});_0x485efa[_0xdece('0xb4')]=!![];}return respondWithRpcPromise(_0xdece('0xb5'),_0xdece('0xb6'),_0x485efa);});}return respondWithRpcPromise(_0xdece('0xb5'),_0xdece('0xb6'),_0x485efa);})[_0xdece('0x27')](function(_0x472877){respondWithRpcPromise(_0xdece('0xb7'),_0xdece('0xb7'),{'event':_0xdece('0xb8'),'message':_0x472877},client9002);return _0x472877;})['then'](respondWithResult(_0x4bba23,null))[_0xdece('0x1a')](handleError(_0x4bba23,null));};exports[_0xdece('0xb9')]=function(_0x5065e1,_0x3d32b2){var _0x4efff4,_0x43c12a,_0x270883;var _0x2b80d2=[];var _0x324202={};var _0x45d1aa=_0x5065e1[_0xdece('0xba')]||[];var _0x173d5d=[];var _0x119fe0;return db[_0xdece('0x7e')]['describe']()[_0xdece('0x27')](function(_0x410a86){if(!_0x410a86){throw new db[(_0xdece('0x85'))]['ValidationError'](_0xdece('0x80'));}_0x2b80d2=_[_0xdece('0x82')](_[_0xdece('0x48')](_0x410a86),['createdAt',_0xdece('0x81'),_0xdece('0x83'),_0xdece('0x92')]);if(_0x5065e1['body']['id']){delete _0x5065e1['body']['id'];}if(_[_0xdece('0x70')](_0x5065e1[_0xdece('0x4b')][_0xdece('0x84')])){throw _0x3d32b2[_0xdece('0x1c')](0x1f4)[_0xdece('0xbb')](new db[(_0xdece('0x85'))][(_0xdece('0x7f'))](_0xdece('0xbc')));}if(_[_0xdece('0x70')](_0x5065e1[_0xdece('0x4b')][_0xdece('0x4b')])||_0x5065e1[_0xdece('0x4b')]['body']===''){throw _0x3d32b2[_0xdece('0x1c')](0x1f4)['send'](new db[(_0xdece('0x85'))]['ValidationError'](_0xdece('0xbd')));}if(_['isNil'](_0x5065e1['body']['mapKeyOffline'])){throw _0x3d32b2[_0xdece('0x1c')](0x1f4)[_0xdece('0xbb')](new db[(_0xdece('0x85'))][(_0xdece('0x7f'))](_0xdece('0xbe')+_0x2b80d2));}if(!_[_0xdece('0xbf')](_0x2b80d2,_0x5065e1[_0xdece('0x4b')][_0xdece('0xc0')])){throw _0x3d32b2[_0xdece('0x1c')](0x1f4)[_0xdece('0xbb')](new db[(_0xdece('0x85'))][(_0xdece('0x7f'))]('mapKeyOffline\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20'+_0x2b80d2));}_0x324202[_0x5065e1['body'][_0xdece('0xc0')]]=_0x5065e1[_0xdece('0x4b')][_0xdece('0x84')];})[_0xdece('0x27')](function(){return db['ChatWebsite'][_0xdece('0x4f')]({'where':{'id':_0x5065e1['params']['id']},'include':[{'model':db['CmList'],'as':_0xdece('0x8a')},{'model':db[_0xdece('0xc1')],'as':_0xdece('0xc1')}]});})['then'](handleEntityNotFound(_0x3d32b2,null))[_0xdece('0x27')](function(_0x506bce){if(_0x506bce&&_0x506bce[_0xdece('0x8a')]){_0x43c12a=_0x506bce;var _0x44dbe4=_[_0xdece('0xa')](_0x5065e1[_0xdece('0x4b')],{'firstName':_0x5065e1[_0xdece('0x4b')][_0xdece('0x84')],'phone':_0x5065e1[_0xdece('0x4b')][_0xdece('0x84')],'ListId':_0x506bce[_0xdece('0x92')]});_0x44dbe4[_0x5065e1[_0xdece('0x4b')][_0xdece('0xc0')]]=_0x5065e1[_0xdece('0x4b')][_0xdece('0x84')];return db[_0xdece('0x7e')][_0xdece('0xc2')]({'where':_0x324202,'defaults':_0x44dbe4});}})[_0xdece('0xa7')](function(_0x19b464){if(_0x19b464){_0x270883=_0x19b464;var _0x308616=fs[_0xdece('0xc3')](path[_0xdece('0x6a')](config[_0xdece('0x6b')],'server/files/templates/chatOfflineMessage.ejs'),_0xdece('0xc4'));var _0x2551e7=ejs['render'](_0x308616,{'body':_[_0xdece('0xc5')](_0x5065e1[_0xdece('0x4b')][_0xdece('0x4b')]),'bodyTitle':_0x43c12a[_0xdece('0xc6')]});return db[_0xdece('0xc7')][_0xdece('0x4a')]({'body':_0x2551e7,'ContactId':_0x19b464['id'],'ChatWebsiteId':_0x43c12a['id']});}})['then'](function(_0x4c3a70){_0x119fe0=_0x4c3a70;if(_0x45d1aa[_0xdece('0x58')]){var _0x58ffc2=_0x45d1aa[_0xdece('0x30')](function(_0x41efa7){return{'name':_0x41efa7[_0xdece('0xc8')],'basename':_0x41efa7[_0xdece('0x62')],'type':_0x41efa7[_0xdece('0xc9')],'ChatOfflineMessageId':_0x4c3a70['id']};});_0x173d5d=_0x58ffc2[_0xdece('0x30')](_0x3389d5=>{var _0x4746c5={'filename':_0x3389d5[_0xdece('0x2c')],'path':path[_0xdece('0x6a')](config[_0xdece('0x6b')],_0xdece('0xca'),_0xdece('0xba'),_0xdece('0xcb'),_0xdece('0xcc'),_0x3389d5['basename'])};return _0x4746c5;});if(!_0x43c12a[_0xdece('0xcd')]){return db[_0xdece('0xce')][_0xdece('0xcf')](function(_0x2b7aaf){return db[_0xdece('0xd0')][_0xdece('0xd1')](_0x58ffc2,{'transaction':_0x2b7aaf});});}}})[_0xdece('0x27')](function(){if(_0x119fe0){_0x4efff4=_0x119fe0;return db['MailAccount']['findOne']({'where':{'active':!![]},'include':[{'model':db[_0xdece('0xd2')],'as':'Smtp','raw':!![]}]});}})[_0xdece('0x27')](function(_0x4576a7){if(_0x4576a7&&_0x4576a7[_0xdece('0xd3')]&&_0x43c12a[_0xdece('0xd4')]&&_0x43c12a[_0xdece('0xd5')]){var _0x2ee9de={'tls':{'rejectUnauthorized':![]}};if(_0x4576a7[_0xdece('0xd3')][_0xdece('0xd6')]){_0x2ee9de[_0xdece('0xd6')]=_0x4576a7['Smtp'][_0xdece('0xd6')];}else{_0x2ee9de['host']=_0x4576a7['Smtp'][_0xdece('0xd7')];_0x2ee9de[_0xdece('0xd8')]=_0x4576a7[_0xdece('0xd3')][_0xdece('0xd8')];_0x2ee9de['secure']=_0x4576a7['Smtp']['secure'];}if(_0x4576a7['Smtp'][_0xdece('0xd9')]){_0x2ee9de[_0xdece('0xda')]={'user':_0x4576a7['Smtp']['user'],'pass':_0x4576a7[_0xdece('0xd3')][_0xdece('0xdb')]};}return respondWithRpcPromise(_0xdece('0xdc'),_0xdece('0xdd'),{'account':_0x2ee9de,'message':{'from':util['format'](_0xdece('0xde'),_0x4576a7[_0xdece('0x2c')],_0x4576a7[_0xdece('0xdf')]||_0x4576a7['Smtp']['user']),'to':_0x43c12a[_0xdece('0xd5')],'subject':_0x43c12a['offlineMessageSubject'],'html':_0x4efff4[_0xdece('0x4b')],'attachments':_0x173d5d}},client9003)[_0xdece('0x27')](function(){return _0x4efff4;})[_0xdece('0x1a')](function(_0x4e13ff){console[_0xdece('0x16')](_0x4e13ff);});}})[_0xdece('0x27')](function(){if(_0x43c12a&&_0x43c12a[_0xdece('0xcd')]&&_0x43c12a[_0xdece('0xe0')]){var _0x1a93de=[];if(_0x45d1aa[_0xdece('0x58')]){_0x1a93de=_0x45d1aa[_0xdece('0x30')](function(_0x1aa321){return{'name':_0x1aa321[_0xdece('0xc8')],'basename':_0x1aa321[_0xdece('0x62')],'type':_0x1aa321[_0xdece('0xc9')],'ChatOfflineMessageId':_0x119fe0['id']};});}var _0x5526d9;if(!_[_0xdece('0x70')](_0x43c12a['subjectOffline'])){var _0x312e66=_[_0xdece('0x30')](_0x5065e1[_0xdece('0x4b')],function(_0x11d4ba){return _0x11d4ba;});var _0x57bf15=_[_0xdece('0xe1')](_0x312e66)[0x0];var _0x305e9c=_[_0xdece('0xe2')](_0x57bf15,function(_0x5519e4){return _0x5519e4;});_0x5526d9=_0x305e9c[0x1][_0x43c12a[_0xdece('0xe3')]];}var _0x3d1984={'from':_0x270883[_0xdece('0xdf')],'firstName':_0x270883[_0xdece('0x98')],'lastName':_0x270883['lastName'],'mapKey':'email','message':{'from':_0x270883[_0xdece('0xdf')],'to':_0x43c12a[_0xdece('0xc1')][_0xdece('0xdf')],'cc':'','subject':_['isNil'](_0x5526d9)?_0x43c12a[_0xdece('0xe4')]:_0x5526d9,'messageId':'','sentAt':new Date(),'attach':_0x1a93de[_0xdece('0x58')],'attachments':_0x1a93de,'originChannel':_0xdece('0xe5'),'ChatWebsiteId':_0x43c12a['id'],'ChatOfflineMessageId':_0x4efff4['id'],'originTo':_0x43c12a[_0xdece('0xc1')][_0xdece('0xdf')]},'body':_0x4efff4[_0xdece('0x4b')]};var _0x3c7c19={'account':{'id':_0x43c12a[_0xdece('0xe0')]},'body':_0x3d1984,'log':'NotifyMailAccount'};return respondWithRpcPromise(_0xdece('0xe6'),'notifyMail',_0x3c7c19,client9001)['then'](function(){return _0x4efff4;})['catch'](function(_0xced384){console['error'](_0xced384);});}return;})[_0xdece('0x27')](function(){if(_0x4efff4){return _0x4efff4;}})[_0xdece('0x27')](respondWithResult(_0x3d32b2,null))[_0xdece('0x1a')](function(_0x955ddd){console[_0xdece('0x16')](_0xdece('0x1a'),_0x955ddd);for(var _0x144107 of _0x45d1aa){var _0x10c1f2=path[_0xdece('0x6a')](config[_0xdece('0x6b')],_0xdece('0xca'),_0xdece('0xba'),_0xdece('0xcb'),'offline-chat',_0x144107['filename']);fs_extra['remove'](_0x10c1f2)[_0xdece('0x1a')](function(_0xc78e7c){console[_0xdece('0x16')](_0xdece('0xe7'),_0x10c1f2,_0xc78e7c);});}});};exports[_0xdece('0xe8')]=function(_0x7e24ff,_0x2944ea){return db[_0xdece('0xa3')][_0xdece('0x4f')]({'where':{'id':_0x7e24ff['params']['id']}})[_0xdece('0x27')](handleEntityNotFound(_0x2944ea,null))[_0xdece('0x27')](function(_0x403d9b){if(_0x403d9b){return _0x403d9b[_0xdece('0xe8')](_0x7e24ff[_0xdece('0x4b')][_0xdece('0x5b')],_[_0xdece('0xe9')](_0x7e24ff['body'],[_0xdece('0x5b'),'id'])||{});}})[_0xdece('0x27')](respondWithResult(_0x2944ea,null))[_0xdece('0x1a')](handleError(_0x2944ea,null));};exports[_0xdece('0xea')]=function(_0x357f6b,_0x463f6f){var _0x485558={'raw':![],'where':{}};var _0x3bbb9f={};var _0x38d7b5={'count':0x0,'rows':[]};return db['ChatWebsite']['findOne']({'where':{'id':_0x357f6b[_0xdece('0x47')]['id']}})['then'](handleEntityNotFound(_0x463f6f,null))[_0xdece('0x27')](function(_0x45d9d3){if(_0x45d9d3){_0x3bbb9f[_0xdece('0x36')]=_['keys'](db[_0xdece('0xa3')]['rawAttributes']);_0x3bbb9f[_0xdece('0x37')]=_[_0xdece('0x48')](_0x357f6b[_0xdece('0x37')]);_0x3bbb9f[_0xdece('0x38')]=_[_0xdece('0x3a')](_0x3bbb9f[_0xdece('0x36')],_0x3bbb9f[_0xdece('0x37')]);_0x485558[_0xdece('0x39')]=_[_0xdece('0x3a')](_0x3bbb9f[_0xdece('0x36')],qs[_0xdece('0x49')](_0x357f6b[_0xdece('0x37')]['fields']));_0x485558[_0xdece('0x39')]=_0x485558['attributes']['length']?_0x485558[_0xdece('0x39')]:_0x3bbb9f[_0xdece('0x36')];if(!_0x357f6b[_0xdece('0x37')][_0xdece('0x3b')](_0xdece('0x3c'))){_0x485558[_0xdece('0x20')]=qs[_0xdece('0x20')](_0x357f6b[_0xdece('0x37')][_0xdece('0x20')]);_0x485558['offset']=qs[_0xdece('0x1e')](_0x357f6b[_0xdece('0x37')][_0xdece('0x1e')]);}_0x485558[_0xdece('0x3d')]=qs[_0xdece('0x3e')](_0x357f6b[_0xdece('0x37')][_0xdece('0x3e')]);_0x485558['where']=qs[_0xdece('0x38')](_[_0xdece('0x40')](_0x357f6b[_0xdece('0x37')],_0x3bbb9f['filters']));_0x485558[_0xdece('0x3f')][_0xdece('0x55')]=_0x45d9d3['id'];if(_0x357f6b[_0xdece('0x37')]['filter']){_0x485558[_0xdece('0x3f')]=_[_0xdece('0x41')](_0x485558[_0xdece('0x3f')],{'$or':_[_0xdece('0x30')](_0x485558[_0xdece('0x39')],function(_0x2c7145){var _0xf2deee={};_0xf2deee[_0x2c7145]={'$like':'%'+_0x357f6b[_0xdece('0x37')][_0xdece('0x43')]+'%'};return _0xf2deee;})});}_0x485558=_[_0xdece('0x41')]({},_0x485558,_0x357f6b[_0xdece('0x44')]);return db['ChatInteraction'][_0xdece('0x21')]({'where':_0x485558[_0xdece('0x3f')]})[_0xdece('0x27')](function(_0x2fcced){_0x38d7b5['count']=_0x2fcced;if(_0x357f6b['query']['includeAll']){_0x485558['include']=[{'model':db[_0xdece('0x7e')],'as':'Contact','required':![]},{'model':db['User'],'as':_0xdece('0xeb'),'attributes':[_0xdece('0x2c'),_0xdece('0xec'),_0xdece('0xed')],'required':![]},{'model':db['Tag'],'as':_0xdece('0xee'),'attributes':['id',_0xdece('0x2c'),_0xdece('0xef')],'where':_0x357f6b[_0xdece('0x37')][_0xdece('0xf0')]?{'id':_0x357f6b[_0xdece('0x37')][_0xdece('0xf0')]}:undefined,'required':_0x357f6b['query'][_0xdece('0xf0')]?!![]:![]}];}return db[_0xdece('0xa3')]['findAll'](_0x485558);})['then'](function(_0x402c52){_0x38d7b5[_0xdece('0x59')]=_0x402c52;return _0x38d7b5;});}})[_0xdece('0x27')](respondWithFilteredResult(_0x463f6f,_0x485558))[_0xdece('0x1a')](handleError(_0x463f6f,null));};function iftimePromise(_0x5a8292,_0x2bfc17){return respondWithRpcPromise('Command',_0xdece('0xf1'),{'command':_0x2bfc17[_0xdece('0xf2')]?util['format']('iftime\x20%s,%s',_0x5a8292[_0xdece('0xf3')],_0x2bfc17[_0xdece('0xf2')]):util[_0xdece('0x9c')](_0xdece('0xf4'),_0x5a8292[_0xdece('0xf3')])},client9002)[_0xdece('0x27')](function(_0x1aaab6){var _0x3513f0=_0x1aaab6&&_0x1aaab6[_0xdece('0xf5')](_0xdece('0xf6'))>=0x0?!![]:![];logger[_0xdece('0x11')](_0xdece('0xf7'),_0x2bfc17['id'],_0x5a8292['id'],_0x5a8292['interval'],_0x3513f0?'ONLINE':'OFFLINE',_0x2bfc17[_0xdece('0xf2')]?_0x2bfc17[_0xdece('0xf2')]:'No\x20timezone');return _0x3513f0;})[_0xdece('0x1a')](function(_0x2c2389){logger['error'](_0xdece('0xf7'),_0x2bfc17['id'],_0x5a8292['id'],_0x5a8292[_0xdece('0xf3')],util[_0xdece('0xf8')](_0x2c2389,{'showHidden':![],'depth':null}),_0x2bfc17[_0xdece('0xf2')]?_0x2bfc17[_0xdece('0xf2')]:'No\x20timezone');return![];});}exports[_0xdece('0xf1')]=function(_0x4a393a,_0x528be6){var _0x26a092=0x0;var _0x4d8d6b=0x0;var _0x34ec78=![];var _0x47c86f;var _0x54e94c;return db[_0xdece('0x31')]['find']({'where':{'id':_0x4a393a[_0xdece('0x47')]['id']},'include':[{'model':db[_0xdece('0xf9')],'as':_0xdece('0xf9'),'include':[{'model':db[_0xdece('0xf9')],'as':_0xdece('0xfa'),'attributes':['id',_0xdece('0xf3')],'raw':!![]}]}]})[_0xdece('0x27')](handleEntityNotFound(_0x528be6,null))[_0xdece('0x27')](function(_0x27821b){if(_0x27821b){_0x47c86f=_0x27821b;return _0x27821b['getProactiveActions']({'raw':!![]});}})[_0xdece('0x27')](function(_0x4bef23){if(_0x47c86f){if(_0x4bef23){_0x54e94c=_0x4bef23;}}return require(_0xdece('0x6d'))[_0xdece('0x6e')]();})[_0xdece('0x27')](function(_0x118c53){if(_0x118c53){_0x4d8d6b=_0x118c53['virtual'];_0x34ec78=_0x118c53[_0xdece('0x6f')];}})[_0xdece('0x27')](function(){return db[_0xdece('0xa3')][_0xdece('0x21')]({'where':{'closed':![]}});})[_0xdece('0x27')](function(_0x2402af){_0x26a092=_0x2402af;if(_0x4d8d6b&&_0x2402af>_0x4d8d6b){return db[_0xdece('0xfb')][_0xdece('0x5e')]({'where':{'id':0x1}})['then'](function(_0x53d05d){if(_0x53d05d){_0x53d05d[_0xdece('0xfc')]('chatLicenseExceeded');}});}})[_0xdece('0x27')](function(){if(_0x47c86f['Interval']&&_0x47c86f[_0xdece('0xf9')][_0xdece('0xfa')]){var _0x4c01e8=[];for(var _0x551104=0x0;_0x551104<_0x47c86f[_0xdece('0xf9')][_0xdece('0xfa')]['length'];_0x551104++){var _0x272bfc=_0x47c86f['Interval']['Intervals'][_0x551104][_0xdece('0x28')]({'plain':!![]});_0x4c01e8[_0xdece('0xab')](iftimePromise(_0x272bfc,_0x47c86f));}return BPromise[_0xdece('0xfd')](_0x4c01e8)[_0xdece('0x27')](function(_0x60e630){return _[_0xdece('0xfe')](_0x60e630);});}else{return!![];}})[_0xdece('0x27')](function(_0xa70643){var _0x2b6ccc=fs[_0xdece('0xc3')](path[_0xdece('0x6a')](config[_0xdece('0x6b')],_0xdece('0xff')),_0xdece('0xc4'));var _0x359f9b={'remote':_0x47c86f[_0xdece('0x100')],'query':querystring['stringify'](_[_0xdece('0x41')](_0x47c86f[_0xdece('0x28')]({'plain':!![]}),{'customerIp':_0x4a393a[_0xdece('0x7a')][_0xdece('0x96')]||_0x4a393a['headers'][_0xdece('0x101')]||_0x4a393a[_0xdece('0x102')][_0xdece('0x103')]||_0x4a393a['ip'],'referer':_0x4a393a[_0xdece('0x7a')][_0xdece('0x104')],'openedInteractions':_0x26a092,'maxInteractions':_0x4d8d6b,'virtual':_0x34ec78[_0xdece('0x105')],'online':_0xa70643,'custom':_0x34ec78}))[_0xdece('0x106')](/'/g,'\x5c\x27')};_0x528be6['send'](ejs[_0xdece('0x107')](Mustache[_0xdece('0x107')](_0x2b6ccc,_0x359f9b),{'proactiveActions':_0x54e94c,'alignment':_0x47c86f[_0xdece('0x108')],'verticalAlignment':_0x47c86f[_0xdece('0x109')],'div_color':_0x47c86f[_0xdece('0xef')],'text_color':_0x47c86f[_0xdece('0x10a')],'button_color':_0x47c86f[_0xdece('0x10b')],'background_color':_0x47c86f[_0xdece('0x10c')]}));})[_0xdece('0x1a')](handleError(_0x528be6,null));};exports[_0xdece('0x10d')]=function(_0x2042d8,_0x46f25d){var _0xba7e99=_0x2042d8[_0xdece('0x47')]['id'];var _0x756c75=_0x2042d8['body'];var _0x4fbcc2=0xc8;var _0x341279=null;return db[_0xdece('0xce')][_0xdece('0xcf')]({'isolationLevel':db[_0xdece('0xce')][_0xdece('0x10e')][_0xdece('0x10f')][_0xdece('0x110')]},function(_0x544153){return db[_0xdece('0x31')]['findOne']({'where':{'id':_0xba7e99},'transaction':_0x544153})[_0xdece('0x27')](function(_0xe3d0e6){if(_0xe3d0e6){return db[_0xdece('0x111')][_0xdece('0x26')]({'where':{'ChatWebsiteId':_0xba7e99},'transaction':_0x544153})['then'](function(){var _0x4c936f=_[_0xdece('0x30')](_0x756c75,function(_0x311e04){_0x311e04['ChatWebsiteId']=_0xba7e99;return _0x311e04;});return db['ChatApplication'][_0xdece('0xd1')](_0x4c936f,{'transaction':_0x544153});});}else{_0x4fbcc2=0x194;_0x341279=[];}});})[_0xdece('0x27')](function(){if(_0x4fbcc2!==0x194){return db[_0xdece('0x111')][_0xdece('0x112')]({'where':{'ChatWebsiteId':_0xba7e99},'order':_0xdece('0x90')})['then'](function(_0x160fa1){_0x341279=_0x160fa1;});}})[_0xdece('0x1a')](function(_0x2e0369){_0x4fbcc2=0x1f4;logger[_0xdece('0x16')](_0x2e0369[_0xdece('0x2b')]);if(_0x2e0369[_0xdece('0x2c')]){delete _0x2e0369[_0xdece('0x2c')];}_0x341279=_0x2e0369;})[_0xdece('0x113')](function(){if(_0x341279===null){_0x46f25d[_0xdece('0x1b')](_0x4fbcc2);}else{if(_0x4fbcc2===0x1f4){_0x46f25d[_0xdece('0x1c')](_0x4fbcc2)[_0xdece('0xbb')](_0x341279);}else{_0x46f25d[_0xdece('0x1c')](_0x4fbcc2)[_0xdece('0x24')](_0x341279);}}});};exports[_0xdece('0x114')]=function(_0x52c5e7,_0x2ccad1){var _0x523c22={};var _0x553171={};var _0x19020f;var _0x5c685c;return db['ChatWebsite'][_0xdece('0x5e')]({'where':{'id':_0x52c5e7['params']['id']}})[_0xdece('0x27')](handleEntityNotFound(_0x2ccad1,null))['then'](function(_0x5c386c){if(_0x5c386c){_0x19020f=_0x5c386c;_0x553171['model']=_[_0xdece('0x48')](db[_0xdece('0x111')][_0xdece('0x32')]);_0x553171[_0xdece('0x37')]=_[_0xdece('0x48')](_0x52c5e7['query']);_0x553171[_0xdece('0x38')]=_['intersection'](_0x553171[_0xdece('0x36')],_0x553171[_0xdece('0x37')]);_0x523c22[_0xdece('0x39')]=_['intersection'](_0x553171['model'],qs[_0xdece('0x49')](_0x52c5e7[_0xdece('0x37')][_0xdece('0x49')]));_0x523c22['attributes']=_0x523c22['attributes']['length']?_0x523c22[_0xdece('0x39')]:_0x553171[_0xdece('0x36')];_0x523c22[_0xdece('0x3d')]=qs['sort'](_0x52c5e7[_0xdece('0x37')]['sort']);_0x523c22[_0xdece('0x3f')]=qs[_0xdece('0x38')](_[_0xdece('0x40')](_0x52c5e7[_0xdece('0x37')],_0x553171[_0xdece('0x38')]));if(_0x52c5e7['query'][_0xdece('0x43')]){_0x523c22[_0xdece('0x3f')]=_['merge'](_0x523c22['where'],{'$or':_['map'](_0x523c22[_0xdece('0x39')],function(_0x117f48){var _0x43b00f={};_0x43b00f[_0x117f48]={'$like':'%'+_0x52c5e7[_0xdece('0x37')][_0xdece('0x43')]+'%'};return _0x43b00f;})});}_0x523c22=_['merge']({},_0x523c22,_0x52c5e7[_0xdece('0x44')]);return _0x19020f['getApplications'](_0x523c22);}})['then'](function(_0xef18ca){if(_0xef18ca){_0x5c685c=_0xef18ca[_0xdece('0x58')];if(!_0x52c5e7[_0xdece('0x37')]['hasOwnProperty'](_0xdece('0x3c'))){_0x523c22['limit']=qs[_0xdece('0x20')](_0x52c5e7[_0xdece('0x37')][_0xdece('0x20')]);_0x523c22[_0xdece('0x1e')]=qs[_0xdece('0x1e')](_0x52c5e7[_0xdece('0x37')][_0xdece('0x1e')]);}return _0x19020f['getApplications'](_0x523c22);}})[_0xdece('0x27')](function(_0x46e2ca){if(_0x46e2ca){return _0x46e2ca?{'count':_0x5c685c,'rows':_0x46e2ca}:null;}})[_0xdece('0x27')](respondWithResult(_0x2ccad1,null))['catch'](handleError(_0x2ccad1,null));};exports['addProactiveActions']=function(_0x4fec68,_0x44f635){return db[_0xdece('0x115')][_0xdece('0x4f')]({'where':{'id':_0x4fec68[_0xdece('0x47')]['id']}})[_0xdece('0x27')](handleEntityNotFound(_0x44f635,null))[_0xdece('0x27')](function(_0x46e204){if(_0x46e204){return _0x46e204[_0xdece('0x116')](_0x4fec68[_0xdece('0x4b')]['ids'],_[_0xdece('0xe9')](_0x4fec68[_0xdece('0x4b')],[_0xdece('0x5b'),'id'])||{});}})['then'](respondWithResult(_0x44f635,null))[_0xdece('0x1a')](handleError(_0x44f635,null));};exports[_0xdece('0x117')]=function(_0x3f58de,_0x3026c7){var _0x197af5={};var _0x29408b={};var _0xd1d731;var _0x5affce;return db[_0xdece('0x31')][_0xdece('0x5e')]({'where':{'id':_0x3f58de[_0xdece('0x47')]['id']}})[_0xdece('0x27')](handleEntityNotFound(_0x3026c7,null))[_0xdece('0x27')](function(_0x5d257e){if(_0x5d257e){_0xd1d731=_0x5d257e;_0x29408b[_0xdece('0x36')]=_[_0xdece('0x48')](db['ChatProactiveAction'][_0xdece('0x32')]);_0x29408b[_0xdece('0x37')]=_['keys'](_0x3f58de[_0xdece('0x37')]);_0x29408b[_0xdece('0x38')]=_['intersection'](_0x29408b[_0xdece('0x36')],_0x29408b[_0xdece('0x37')]);_0x197af5[_0xdece('0x39')]=_['intersection'](_0x29408b[_0xdece('0x36')],qs[_0xdece('0x49')](_0x3f58de[_0xdece('0x37')][_0xdece('0x49')]));_0x197af5[_0xdece('0x39')]=_0x197af5[_0xdece('0x39')][_0xdece('0x58')]?_0x197af5[_0xdece('0x39')]:_0x29408b[_0xdece('0x36')];_0x197af5[_0xdece('0x3d')]=qs[_0xdece('0x3e')](_0x3f58de[_0xdece('0x37')]['sort']);_0x197af5[_0xdece('0x3f')]=qs['filters'](_['pick'](_0x3f58de[_0xdece('0x37')],_0x29408b[_0xdece('0x38')]));if(_0x3f58de['query'][_0xdece('0x43')]){_0x197af5[_0xdece('0x3f')]=_[_0xdece('0x41')](_0x197af5['where'],{'$or':_[_0xdece('0x30')](_0x197af5[_0xdece('0x39')],function(_0x3b1246){var _0x5583bb={};_0x5583bb[_0x3b1246]={'$like':'%'+_0x3f58de[_0xdece('0x37')][_0xdece('0x43')]+'%'};return _0x5583bb;})});}_0x197af5=_[_0xdece('0x41')]({},_0x197af5,_0x3f58de[_0xdece('0x44')]);return _0xd1d731[_0xdece('0x117')](_0x197af5);}})[_0xdece('0x27')](function(_0x2a19f2){if(_0x2a19f2){_0x5affce=_0x2a19f2[_0xdece('0x58')];if(!_0x3f58de[_0xdece('0x37')][_0xdece('0x3b')](_0xdece('0x3c'))){_0x197af5[_0xdece('0x20')]=qs['limit'](_0x3f58de[_0xdece('0x37')]['limit']);_0x197af5[_0xdece('0x1e')]=qs[_0xdece('0x1e')](_0x3f58de['query'][_0xdece('0x1e')]);}return _0xd1d731['getProactiveActions'](_0x197af5);}})[_0xdece('0x27')](function(_0x4dfe21){if(_0x4dfe21){return _0x4dfe21?{'count':_0x5affce,'rows':_0x4dfe21}:null;}})[_0xdece('0x27')](respondWithResult(_0x3026c7,null))[_0xdece('0x1a')](handleError(_0x3026c7,null));};exports['getFields']=function(_0x5b4098,_0x1a5083){var _0x22349f=_0x5b4098[_0xdece('0x37')][_0xdece('0x118')]===_0xdece('0x119')?_0xdece('0x11a'):_0xdece('0x11b');return db['ChatWebsite']['find']({'attributes':['id',_0x22349f],'where':{'id':_0x5b4098[_0xdece('0x47')]['id']}})[_0xdece('0x27')](handleEntityNotFound(_0x1a5083,null))[_0xdece('0x27')](function(_0xdfaa4c){if(_0xdfaa4c){var _0x4411ad=_0xdfaa4c[_0x22349f];var _0x49352b=_0x4411ad&&_0x4411ad[_0xdece('0x11c')]?_0x4411ad[_0xdece('0x11c')]:[];_0x1a5083[_0xdece('0xbb')]({'fromKey':_['isNil'](_0x4411ad[_0xdece('0x11d')])?undefined:_0x4411ad[_0xdece('0x11d')],'count':_0x49352b['length'],'rows':_0x49352b});}})[_0xdece('0x1a')](handleError(_0x1a5083,null));};exports[_0xdece('0x11e')]=function(_0x3907fa,_0x3e9a8f){var _0xf07038={'raw':![],'where':{}};var _0x401a91={};var _0x1d53a3={'count':0x0,'rows':[]};return db['ChatWebsite']['findOne']({'where':{'id':_0x3907fa[_0xdece('0x47')]['id']}})[_0xdece('0x27')](handleEntityNotFound(_0x3e9a8f,null))[_0xdece('0x27')](function(_0x61912e){if(_0x61912e){_0x401a91[_0xdece('0x36')]=_['keys'](db[_0xdece('0xc7')][_0xdece('0x32')]);_0x401a91[_0xdece('0x37')]=_[_0xdece('0x48')](_0x3907fa['query']);_0x401a91[_0xdece('0x38')]=_[_0xdece('0x3a')](_0x401a91[_0xdece('0x36')],_0x401a91[_0xdece('0x37')]);_0xf07038['attributes']=_[_0xdece('0x3a')](_0x401a91['model'],qs[_0xdece('0x49')](_0x3907fa['query'][_0xdece('0x49')]));_0xf07038[_0xdece('0x39')]=_0xf07038[_0xdece('0x39')][_0xdece('0x58')]?_0xf07038[_0xdece('0x39')]:_0x401a91['model'];if(!_0x3907fa['query'][_0xdece('0x3b')](_0xdece('0x3c'))){_0xf07038['limit']=qs[_0xdece('0x20')](_0x3907fa[_0xdece('0x37')]['limit']);_0xf07038[_0xdece('0x1e')]=qs[_0xdece('0x1e')](_0x3907fa[_0xdece('0x37')][_0xdece('0x1e')]);}_0xf07038[_0xdece('0x3d')]=qs[_0xdece('0x3e')](_0x3907fa['query'][_0xdece('0x3e')]);_0xf07038[_0xdece('0x3f')]=qs[_0xdece('0x38')](_[_0xdece('0x40')](_0x3907fa['query'],_0x401a91[_0xdece('0x38')]));_0xf07038[_0xdece('0x3f')][_0xdece('0x55')]=_0x61912e['id'];if(_0x3907fa['query'][_0xdece('0x43')]){_0xf07038[_0xdece('0x3f')]=_['merge'](_0xf07038[_0xdece('0x3f')],{'$or':_[_0xdece('0x30')](_0xf07038['attributes'],function(_0x34416e){var _0x48ac0b={};_0x48ac0b[_0x34416e]={'$like':'%'+_0x3907fa[_0xdece('0x37')][_0xdece('0x43')]+'%'};return _0x48ac0b;})});}_0xf07038=_[_0xdece('0x41')]({},_0xf07038,_0x3907fa[_0xdece('0x44')]);return db[_0xdece('0xc7')][_0xdece('0x21')]({'where':_0xf07038['where']})[_0xdece('0x27')](function(_0x4f00de){_0x1d53a3[_0xdece('0x21')]=_0x4f00de;if(_0x3907fa[_0xdece('0x37')][_0xdece('0x5f')]){_0xf07038[_0xdece('0x45')]=[{'all':!![]}];}else{_0xf07038[_0xdece('0x45')]=[{'model':db[_0xdece('0x7e')],'as':_0xdece('0x11f'),'required':![]},{'model':db['Attachment'],'as':'Attachments','required':![]}];}return db[_0xdece('0xc7')][_0xdece('0x46')](_0xf07038);})[_0xdece('0x27')](function(_0x5afcc2){_0x1d53a3[_0xdece('0x59')]=_0x5afcc2;return _0x1d53a3;});}})[_0xdece('0x27')](respondWithFilteredResult(_0x3e9a8f,_0xf07038))[_0xdece('0x1a')](handleError(_0x3e9a8f,null));};exports[_0xdece('0x120')]=function(_0x1e8252,_0x438aff){return db['ChatWebsite']['find']({'where':{'id':_0x1e8252['params']['id']}})[_0xdece('0x27')](handleEntityNotFound(_0x438aff,null))[_0xdece('0x27')](function(_0x153a22){if(_0x153a22){return _0x153a22[_0xdece('0x120')](_0x1e8252[_0xdece('0x4b')][_0xdece('0x5b')],_[_0xdece('0xe9')](_0x1e8252['body'],['ids','id'])||{})[_0xdece('0xa7')](function(_0x304086){for(var _0x41555f=0x0;_0x41555f<_0x1e8252[_0xdece('0x4b')][_0xdece('0x5b')]['length'];_0x41555f+=0x1){socket[_0xdece('0x121')]('userChatWebsite:save',{'UserId':Number(_0x1e8252['body'][_0xdece('0x5b')][_0x41555f]),'ChatWebsiteId':Number(_0x1e8252[_0xdece('0x47')]['id'])});}return _0x304086;});}})[_0xdece('0x27')](respondWithResult(_0x438aff,null))[_0xdece('0x1a')](handleError(_0x438aff,null));};exports['removeAgents']=function(_0x1302cf,_0x52f736){return db[_0xdece('0x31')]['find']({'where':{'id':_0x1302cf['params']['id']}})[_0xdece('0x27')](handleEntityNotFound(_0x52f736,null))[_0xdece('0x27')](function(_0x1303b8){if(_0x1303b8){return _0x1303b8['removeAgents'](_0x1302cf[_0xdece('0x37')]['ids'])['then'](function(){if(_['isArray'](_0x1302cf['query'][_0xdece('0x5b')])){for(var _0x155e0c=0x0;_0x155e0c<_0x1302cf['query'][_0xdece('0x5b')]['length'];_0x155e0c+=0x1){socket[_0xdece('0x121')]('userChatWebsite:remove',{'UserId':Number(_0x1302cf[_0xdece('0x37')]['ids'][_0x155e0c]),'ChatWebsiteId':Number(_0x1302cf[_0xdece('0x47')]['id'])});}}else{socket['emit'](_0xdece('0x122'),{'UserId':Number(_0x1302cf[_0xdece('0x37')][_0xdece('0x5b')]),'ChatWebsiteId':Number(_0x1302cf[_0xdece('0x47')]['id'])});}});}})[_0xdece('0x27')](respondWithStatusCode(_0x52f736,null))[_0xdece('0x1a')](handleError(_0x52f736,null));};exports[_0xdece('0x123')]=function(_0x2a21b0,_0x48f8f9){var _0x5db2ac={};var _0x49f9d3={};var _0x591e69;var _0xcb6533;return db['ChatWebsite'][_0xdece('0x5e')]({'where':{'id':_0x2a21b0[_0xdece('0x47')]['id']}})[_0xdece('0x27')](handleEntityNotFound(_0x48f8f9,null))[_0xdece('0x27')](function(_0x50b636){if(_0x50b636){_0x591e69=_0x50b636;_0x49f9d3[_0xdece('0x36')]=_[_0xdece('0x48')](db[_0xdece('0x124')][_0xdece('0x32')]);_0x49f9d3['query']=_['keys'](_0x2a21b0[_0xdece('0x37')]);_0x49f9d3[_0xdece('0x38')]=_['intersection'](_0x49f9d3['model'],_0x49f9d3[_0xdece('0x37')]);_0x5db2ac[_0xdece('0x39')]=_[_0xdece('0x3a')](_0x49f9d3[_0xdece('0x36')],qs[_0xdece('0x49')](_0x2a21b0[_0xdece('0x37')]['fields']));_0x5db2ac[_0xdece('0x39')]=_0x5db2ac['attributes']['length']?_0x5db2ac['attributes']:_0x49f9d3[_0xdece('0x36')];_0x5db2ac[_0xdece('0x3d')]=qs[_0xdece('0x3e')](_0x2a21b0[_0xdece('0x37')][_0xdece('0x3e')]);_0x5db2ac[_0xdece('0x3f')]=qs['filters'](_[_0xdece('0x40')](_0x2a21b0[_0xdece('0x37')],_0x49f9d3[_0xdece('0x38')]));if(_0x2a21b0[_0xdece('0x37')][_0xdece('0x43')]){_0x5db2ac[_0xdece('0x3f')]=_['merge'](_0x5db2ac['where'],{'$or':_[_0xdece('0x30')](_0x5db2ac['attributes'],function(_0x5bc81b){var _0xacc150={};_0xacc150[_0x5bc81b]={'$like':'%'+_0x2a21b0[_0xdece('0x37')][_0xdece('0x43')]+'%'};return _0xacc150;})});}_0x5db2ac=_['merge']({},_0x5db2ac,_0x2a21b0[_0xdece('0x44')]);return _0x591e69[_0xdece('0x123')](_0x5db2ac);}})['then'](function(_0x310b6b){if(_0x310b6b){_0xcb6533=_0x310b6b[_0xdece('0x58')];if(!_0x2a21b0[_0xdece('0x37')][_0xdece('0x3b')]('nolimit')){_0x5db2ac[_0xdece('0x20')]=qs['limit'](_0x2a21b0['query']['limit']);_0x5db2ac['offset']=qs[_0xdece('0x1e')](_0x2a21b0[_0xdece('0x37')][_0xdece('0x1e')]);}return _0x591e69['getAgents'](_0x5db2ac);}})['then'](function(_0xfad6b6){if(_0xfad6b6){return _0xfad6b6?{'count':_0xcb6533,'rows':_0xfad6b6}:null;}})[_0xdece('0x27')](respondWithResult(_0x48f8f9,null))[_0xdece('0x1a')](handleError(_0x48f8f9,null));};
\ No newline at end of file
diff --git a/server/api/chatWebsite/chatWebsite.events.js b/server/api/chatWebsite/chatWebsite.events.js
index 188bb90..05fac65 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 _0x17c4=['remove','emit','hasOwnProperty','hook','exports','events','../../mysqldb','ChatWebsite','setMaxListeners','save','update'];(function(_0x5b013d,_0xc7691c){var _0x2b6eef=function(_0x3143ca){while(--_0x3143ca){_0x5b013d['push'](_0x5b013d['shift']());}};_0x2b6eef(++_0xc7691c);}(_0x17c4,0x102));var _0x417c=function(_0x2ea6f5,_0x4adfc4){_0x2ea6f5=_0x2ea6f5-0x0;var _0x2a88b5=_0x17c4[_0x2ea6f5];return _0x2a88b5;};'use strict';var EventEmitter=require(_0x417c('0x0'));var ChatWebsite=require(_0x417c('0x1'))['db'][_0x417c('0x2')];var ChatWebsiteEvents=new EventEmitter();ChatWebsiteEvents[_0x417c('0x3')](0x0);var events={'afterCreate':_0x417c('0x4'),'afterUpdate':_0x417c('0x5'),'afterDestroy':_0x417c('0x6')};function emitEvent(_0x74b351){return function(_0x212ac0,_0x413ee5,_0x33ae56){ChatWebsiteEvents['emit'](_0x74b351+':'+_0x212ac0['id'],_0x212ac0);ChatWebsiteEvents[_0x417c('0x7')](_0x74b351,_0x212ac0);_0x33ae56(null);};}for(var e in events){if(events[_0x417c('0x8')](e)){var event=events[e];ChatWebsite[_0x417c('0x9')](e,emitEvent(event));}}module[_0x417c('0xa')]=ChatWebsiteEvents;
\ No newline at end of file
+var _0x2830=['emit','hasOwnProperty','hook','exports','events','../../mysqldb','ChatWebsite','setMaxListeners','save','update','remove'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x2830,0x117));var _0x0283=function(_0x43d7f1,_0x11a1eb){_0x43d7f1=_0x43d7f1-0x0;var _0x470f7e=_0x2830[_0x43d7f1];return _0x470f7e;};'use strict';var EventEmitter=require(_0x0283('0x0'));var ChatWebsite=require(_0x0283('0x1'))['db'][_0x0283('0x2')];var ChatWebsiteEvents=new EventEmitter();ChatWebsiteEvents[_0x0283('0x3')](0x0);var events={'afterCreate':_0x0283('0x4'),'afterUpdate':_0x0283('0x5'),'afterDestroy':_0x0283('0x6')};function emitEvent(_0x56984a){return function(_0x414c89,_0x4aa050,_0x1a8998){ChatWebsiteEvents[_0x0283('0x7')](_0x56984a+':'+_0x414c89['id'],_0x414c89);ChatWebsiteEvents[_0x0283('0x7')](_0x56984a,_0x414c89);_0x1a8998(null);};}for(var e in events){if(events[_0x0283('0x8')](e)){var event=events[e];ChatWebsite[_0x0283('0x9')](e,emitEvent(event));}}module[_0x0283('0xa')]=ChatWebsiteEvents;
\ No newline at end of file
diff --git a/server/api/chatWebsite/chatWebsite.model.js b/server/api/chatWebsite/chatWebsite.model.js
index 4c41d40..ecf6f18 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 _0x0663=['ChatWebsite','chat_websites','util','../../config/logger','moment','bluebird','request-promise','../../config/environment','./chatWebsite.attributes'];(function(_0x1ccdf7,_0x215d5a){var _0x52a0ae=function(_0x40324a){while(--_0x40324a){_0x1ccdf7['push'](_0x1ccdf7['shift']());}};_0x52a0ae(++_0x215d5a);}(_0x0663,0x1cd));var _0x3066=function(_0x4e53d1,_0x6a8a56){_0x4e53d1=_0x4e53d1-0x0;var _0x4913cf=_0x0663[_0x4e53d1];return _0x4913cf;};'use strict';var _=require('lodash');var util=require(_0x3066('0x0'));var logger=require(_0x3066('0x1'))('api');var moment=require(_0x3066('0x2'));var BPromise=require(_0x3066('0x3'));var rp=require(_0x3066('0x4'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x3066('0x5'));var attributes=require(_0x3066('0x6'));module['exports']=function(_0x886505,_0x48908c){return _0x886505['define'](_0x3066('0x7'),attributes,{'tableName':_0x3066('0x8'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xf1a1=['define','ChatWebsite','chat_websites','../../config/logger','api','bluebird','../../config/environment','./chatWebsite.attributes','exports'];(function(_0x10ad76,_0x4fc94a){var _0x1ced1a=function(_0x45e5c7){while(--_0x45e5c7){_0x10ad76['push'](_0x10ad76['shift']());}};_0x1ced1a(++_0x4fc94a);}(_0xf1a1,0x66));var _0x1f1a=function(_0x1d3168,_0x43b8f9){_0x1d3168=_0x1d3168-0x0;var _0x497266=_0xf1a1[_0x1d3168];return _0x497266;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x1f1a('0x0'))(_0x1f1a('0x1'));var moment=require('moment');var BPromise=require(_0x1f1a('0x2'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x1f1a('0x3'));var attributes=require(_0x1f1a('0x4'));module[_0x1f1a('0x5')]=function(_0x4b848b,_0x53f7b9){return _0x4b848b[_0x1f1a('0x6')](_0x1f1a('0x7'),attributes,{'tableName':_0x1f1a('0x8'),'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 e13d83e..85b0ed8 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 _0x4fd8=['rpc','../../config/environment','client','http','redis','defaults','localhost','socket.io-emitter','./chatWebsite.socket','register','request','then','info','ChatWebsite,\x20%s,\x20%s','request\x20sent','debug','stringify','error','message','result','catch','lodash','moment','bluebird','randomstring','../../mysqldb','../../config/utils'];(function(_0xf72d1c,_0x2167c3){var _0x5d1a77=function(_0xfcc3ce){while(--_0xfcc3ce){_0xf72d1c['push'](_0xf72d1c['shift']());}};_0x5d1a77(++_0x2167c3);}(_0x4fd8,0xd2));var _0x84fd=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x4fd8[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0x84fd('0x0'));var util=require('util');var moment=require(_0x84fd('0x1'));var BPromise=require(_0x84fd('0x2'));var rs=require(_0x84fd('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x84fd('0x4'))['db'];var utils=require(_0x84fd('0x5'));var logger=require('../../config/logger')(_0x84fd('0x6'));var config=require(_0x84fd('0x7'));var jayson=require('jayson/promise');var client=jayson[_0x84fd('0x8')][_0x84fd('0x9')]({'port':0x232a});config[_0x84fd('0xa')]=_[_0x84fd('0xb')](config['redis'],{'host':_0x84fd('0xc'),'port':0x18eb});var socket=require(_0x84fd('0xd'))(new Redis(config[_0x84fd('0xa')]));require(_0x84fd('0xe'))[_0x84fd('0xf')](socket);function respondWithRpcPromise(_0x437420,_0x5813ec,_0x4180f5){return new BPromise(function(_0x186a6a,_0x4b11e9){return client[_0x84fd('0x10')](_0x437420,_0x4180f5)[_0x84fd('0x11')](function(_0xbcf14){logger[_0x84fd('0x12')](_0x84fd('0x13'),_0x5813ec,_0x84fd('0x14'));logger[_0x84fd('0x15')]('ChatWebsite,\x20%s,\x20%s,\x20%s',_0x5813ec,'request\x20sent',JSON[_0x84fd('0x16')](_0xbcf14));if(_0xbcf14[_0x84fd('0x17')]){if(_0xbcf14[_0x84fd('0x17')]['code']===0x1f4){logger[_0x84fd('0x17')](_0x84fd('0x13'),_0x5813ec,_0xbcf14[_0x84fd('0x17')][_0x84fd('0x18')]);return _0x4b11e9(_0xbcf14[_0x84fd('0x17')][_0x84fd('0x18')]);}logger[_0x84fd('0x17')](_0x84fd('0x13'),_0x5813ec,_0xbcf14[_0x84fd('0x17')][_0x84fd('0x18')]);return _0x186a6a(_0xbcf14[_0x84fd('0x17')]['message']);}else{logger['info']('ChatWebsite,\x20%s,\x20%s',_0x5813ec,_0x84fd('0x14'));_0x186a6a(_0xbcf14[_0x84fd('0x19')][_0x84fd('0x18')]);}})[_0x84fd('0x1a')](function(_0x5a628d){logger[_0x84fd('0x17')](_0x84fd('0x13'),_0x5813ec,_0x5a628d);_0x4b11e9(_0x5a628d);});});}
\ No newline at end of file
+var _0x5632=['request\x20sent','result','catch','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','redis','defaults','localhost','socket.io-emitter','./chatWebsite.socket','register','request','then','info','ChatWebsite,\x20%s,\x20%s','debug','stringify','error','message'];(function(_0x458ed6,_0x504646){var _0xa5dfd9=function(_0x504e7b){while(--_0x504e7b){_0x458ed6['push'](_0x458ed6['shift']());}};_0xa5dfd9(++_0x504646);}(_0x5632,0x1b3));var _0x2563=function(_0xfb0f99,_0x4048ad){_0xfb0f99=_0xfb0f99-0x0;var _0x3faf0b=_0x5632[_0xfb0f99];return _0x3faf0b;};'use strict';var _=require(_0x2563('0x0'));var util=require(_0x2563('0x1'));var moment=require(_0x2563('0x2'));var BPromise=require(_0x2563('0x3'));var rs=require(_0x2563('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x2563('0x5'))['db'];var utils=require(_0x2563('0x6'));var logger=require('../../config/logger')(_0x2563('0x7'));var config=require(_0x2563('0x8'));var jayson=require(_0x2563('0x9'));var client=jayson['client']['http']({'port':0x232a});config[_0x2563('0xa')]=_[_0x2563('0xb')](config['redis'],{'host':_0x2563('0xc'),'port':0x18eb});var socket=require(_0x2563('0xd'))(new Redis(config[_0x2563('0xa')]));require(_0x2563('0xe'))[_0x2563('0xf')](socket);function respondWithRpcPromise(_0x36a210,_0x50af74,_0x3a5a79){return new BPromise(function(_0x2304e7,_0x52697c){return client[_0x2563('0x10')](_0x36a210,_0x3a5a79)[_0x2563('0x11')](function(_0x482c75){logger[_0x2563('0x12')](_0x2563('0x13'),_0x50af74,'request\x20sent');logger[_0x2563('0x14')]('ChatWebsite,\x20%s,\x20%s,\x20%s',_0x50af74,'request\x20sent',JSON[_0x2563('0x15')](_0x482c75));if(_0x482c75[_0x2563('0x16')]){if(_0x482c75[_0x2563('0x16')]['code']===0x1f4){logger[_0x2563('0x16')](_0x2563('0x13'),_0x50af74,_0x482c75[_0x2563('0x16')][_0x2563('0x17')]);return _0x52697c(_0x482c75[_0x2563('0x16')][_0x2563('0x17')]);}logger[_0x2563('0x16')](_0x2563('0x13'),_0x50af74,_0x482c75[_0x2563('0x16')][_0x2563('0x17')]);return _0x2304e7(_0x482c75['error']['message']);}else{logger[_0x2563('0x12')](_0x2563('0x13'),_0x50af74,_0x2563('0x18'));_0x2304e7(_0x482c75[_0x2563('0x19')][_0x2563('0x17')]);}})[_0x2563('0x1a')](function(_0x54f0a4){logger['error'](_0x2563('0x13'),_0x50af74,_0x54f0a4);_0x52697c(_0x54f0a4);});});}
\ No newline at end of file
diff --git a/server/api/chatWebsite/chatWebsite.socket.js b/server/api/chatWebsite/chatWebsite.socket.js
index e13db75..9a0b0b6 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 _0xa6c3=['removeListener','./chatWebsite.events','save'];(function(_0x19e35c,_0x29cd1e){var _0x3e1fe8=function(_0x17258b){while(--_0x17258b){_0x19e35c['push'](_0x19e35c['shift']());}};_0x3e1fe8(++_0x29cd1e);}(_0xa6c3,0x193));var _0x3a6c=function(_0x999b85,_0x1edc2b){_0x999b85=_0x999b85-0x0;var _0x1d7124=_0xa6c3[_0x999b85];return _0x1d7124;};'use strict';var ChatWebsiteEvents=require(_0x3a6c('0x0'));var events=[_0x3a6c('0x1'),'remove','update'];function createListener(_0x3db869,_0x2a77cc){return function(_0x5d5515){_0x2a77cc['emit'](_0x3db869,_0x5d5515);};}function removeListener(_0x30fac8,_0x32fbe1){return function(){ChatWebsiteEvents[_0x3a6c('0x2')](_0x30fac8,_0x32fbe1);};}exports['register']=function(_0x19a4ad){for(var _0xb7f50d=0x0,_0x4fd75e=events['length'];_0xb7f50d<_0x4fd75e;_0xb7f50d++){var _0x200d0f=events[_0xb7f50d];var _0x10df07=createListener('chatWebsite:'+_0x200d0f,_0x19a4ad);ChatWebsiteEvents['on'](_0x200d0f,_0x10df07);}};
\ No newline at end of file
+var _0x1697=['register','length','save','remove','update','emit','removeListener'];(function(_0x31abee,_0x11ff0c){var _0x3c1761=function(_0x2b5062){while(--_0x2b5062){_0x31abee['push'](_0x31abee['shift']());}};_0x3c1761(++_0x11ff0c);}(_0x1697,0xfe));var _0x7169=function(_0x1035c1,_0x2d8583){_0x1035c1=_0x1035c1-0x0;var _0x308d67=_0x1697[_0x1035c1];return _0x308d67;};'use strict';var ChatWebsiteEvents=require('./chatWebsite.events');var events=[_0x7169('0x0'),_0x7169('0x1'),_0x7169('0x2')];function createListener(_0x1f7a39,_0x379de3){return function(_0x5bd18c){_0x379de3[_0x7169('0x3')](_0x1f7a39,_0x5bd18c);};}function removeListener(_0x5d362e,_0x1aaf25){return function(){ChatWebsiteEvents[_0x7169('0x4')](_0x5d362e,_0x1aaf25);};}exports[_0x7169('0x5')]=function(_0x294970){for(var _0xf012e2=0x0,_0x20b48e=events[_0x7169('0x6')];_0xf012e2<_0x20b48e;_0xf012e2++){var _0x4460f4=events[_0xf012e2];var _0x2845c5=createListener('chatWebsite:'+_0x4460f4,_0x294970);ChatWebsiteEvents['on'](_0x4460f4,_0x2845c5);}};
\ No newline at end of file
diff --git a/server/api/chatWebsite/index.js b/server/api/chatWebsite/index.js
index 25377a0..15660b0 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 _0xd24e=['removeDispositions','removeAnswers','removeAgents','exports','multer','express','Router','fs-extra','../../components/interaction/service','../../config/environment','./chatWebsite.controller','get','isAuthenticated','index','/describe','describe','show','/:id/dispositions','getDispositions','/:id/canned_answers','getAnswers','/:id/logo','/:id/avatar','getAvatar','/:id/customer_avatar','getCustomerAvatar','getSystemAvatar','/:id/interactions','/:id/snippet','/:id/applications','/:id/proactive_actions','getProactiveActions','/:id/fields','/:id/offline_messages','getOfflineMessages','/:id/users','getAgents','post','create','addDisposition','addAnswer','diskStorage','join','root','server/files/images/logos/','format','%s-%s','now','originalname','single','file','addLogo','server/files/images/avatars/','addAvatar','addCustomerAvatar','/:id/system_avatar','addSystemAvatar','server/files','offline-chat','ensureDir','replace','extname','any','addApplications','addAgents','put','/:id','update','delete','destroy'];(function(_0x187d29,_0x2dce45){var _0x21bbea=function(_0x27019a){while(--_0x27019a){_0x187d29['push'](_0x187d29['shift']());}};_0x21bbea(++_0x2dce45);}(_0xd24e,0xd6));var _0xed24=function(_0xfaf676,_0x3c6d39){_0xfaf676=_0xfaf676-0x0;var _0x3a0248=_0xd24e[_0xfaf676];return _0x3a0248;};'use strict';var multer=require(_0xed24('0x0'));var util=require('util');var path=require('path');var timeout=require('connect-timeout');var express=require(_0xed24('0x1'));var router=express[_0xed24('0x2')]();var fs_extra=require(_0xed24('0x3'));var auth=require('../../components/auth/service');var interaction=require(_0xed24('0x4'));var config=require(_0xed24('0x5'));var controller=require(_0xed24('0x6'));router[_0xed24('0x7')]('/',auth[_0xed24('0x8')](),controller[_0xed24('0x9')]);router[_0xed24('0x7')](_0xed24('0xa'),auth[_0xed24('0x8')](),controller[_0xed24('0xb')]);router[_0xed24('0x7')]('/:id',auth[_0xed24('0x8')](),controller[_0xed24('0xc')]);router['get'](_0xed24('0xd'),auth['isAuthenticated'](),controller[_0xed24('0xe')]);router[_0xed24('0x7')](_0xed24('0xf'),auth[_0xed24('0x8')](),controller[_0xed24('0x10')]);router[_0xed24('0x7')](_0xed24('0x11'),controller['getLogo']);router[_0xed24('0x7')](_0xed24('0x12'),controller[_0xed24('0x13')]);router['get'](_0xed24('0x14'),controller[_0xed24('0x15')]);router['get']('/:id/system_avatar',controller[_0xed24('0x16')]);router[_0xed24('0x7')](_0xed24('0x17'),auth[_0xed24('0x8')](),controller['getInteractions']);router['get'](_0xed24('0x18'),controller['getSnippet']);router[_0xed24('0x7')](_0xed24('0x19'),auth['isAuthenticated'](),controller['getApplications']);router[_0xed24('0x7')](_0xed24('0x1a'),auth['isAuthenticated'](),controller[_0xed24('0x1b')]);router[_0xed24('0x7')](_0xed24('0x1c'),controller['getFields']);router[_0xed24('0x7')](_0xed24('0x1d'),auth[_0xed24('0x8')](),controller[_0xed24('0x1e')]);router[_0xed24('0x7')](_0xed24('0x1f'),auth[_0xed24('0x8')](),controller[_0xed24('0x20')]);router[_0xed24('0x21')]('/',auth[_0xed24('0x8')](),controller[_0xed24('0x22')]);router[_0xed24('0x21')](_0xed24('0xd'),auth[_0xed24('0x8')](),controller[_0xed24('0x23')]);router[_0xed24('0x21')]('/:id/canned_answers',auth[_0xed24('0x8')](),controller[_0xed24('0x24')]);var upload=multer({'storage':multer[_0xed24('0x25')]({'destination':function(_0x17ccea,_0x4f4d0f,_0x12056d){_0x12056d(null,path[_0xed24('0x26')](config[_0xed24('0x27')],_0xed24('0x28')));},'filename':function(_0x48dbfe,_0x407f30,_0x88fcb0){_0x88fcb0(null,util[_0xed24('0x29')](_0xed24('0x2a'),Date[_0xed24('0x2b')](),_0x407f30[_0xed24('0x2c')]));}})});router[_0xed24('0x21')](_0xed24('0x11'),upload[_0xed24('0x2d')](_0xed24('0x2e')),controller[_0xed24('0x2f')]);var upload=multer({'storage':multer[_0xed24('0x25')]({'destination':function(_0x4a2bf7,_0x5b327c,_0x55aa22){_0x55aa22(null,path[_0xed24('0x26')](config[_0xed24('0x27')],_0xed24('0x30')));},'filename':function(_0x374f36,_0x350ff2,_0x3a3bb1){_0x3a3bb1(null,util[_0xed24('0x29')]('%s-%s',Date[_0xed24('0x2b')](),_0x350ff2[_0xed24('0x2c')]));}})});router[_0xed24('0x21')](_0xed24('0x12'),upload[_0xed24('0x2d')](_0xed24('0x2e')),controller[_0xed24('0x31')]);var upload=multer({'storage':multer[_0xed24('0x25')]({'destination':function(_0x1ac9f3,_0x4c0da9,_0x2874ed){_0x2874ed(null,path[_0xed24('0x26')](config[_0xed24('0x27')],_0xed24('0x30')));},'filename':function(_0x3f96d4,_0x419c86,_0x20f4c5){_0x20f4c5(null,util[_0xed24('0x29')](_0xed24('0x2a'),Date[_0xed24('0x2b')](),_0x419c86[_0xed24('0x2c')]));}})});router['post'](_0xed24('0x14'),upload['single'](_0xed24('0x2e')),controller[_0xed24('0x32')]);var upload=multer({'storage':multer[_0xed24('0x25')]({'destination':function(_0x8f9e5a,_0x1cb6d1,_0x189cb2){_0x189cb2(null,path[_0xed24('0x26')](config[_0xed24('0x27')],_0xed24('0x30')));},'filename':function(_0x37f1cb,_0x406525,_0x5d5ebb){_0x5d5ebb(null,util[_0xed24('0x29')](_0xed24('0x2a'),Date[_0xed24('0x2b')](),_0x406525['originalname']));}})});router[_0xed24('0x21')](_0xed24('0x33'),upload[_0xed24('0x2d')](_0xed24('0x2e')),controller[_0xed24('0x34')]);router[_0xed24('0x21')]('/:id/notify',controller['notify']);const offlineUploadMulter=multer({'storage':multer['diskStorage']({'destination':function(_0x5154aa,_0x2cd41d,_0x166b8c){const _0x13af2a=path['join'](config['root'],_0xed24('0x35'),'attachments',_0xed24('0x36'));fs_extra[_0xed24('0x37')](_0x13af2a,function(){_0x166b8c(null,_0x13af2a);});},'filename':function(_0x259e28,_0x251af3,_0x26b418){const _0xaf378c=_0x251af3[_0xed24('0x2c')][_0xed24('0x38')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');const _0x1d981e=path[_0xed24('0x39')](_0xaf378c);const _0x3ad613=Date[_0xed24('0x2b')]()+'-'+_0xaf378c[_0xed24('0x38')](_0x1d981e,'')+_0x1d981e;_0x26b418(null,_0x3ad613);}})});router[_0xed24('0x21')]('/:id/offline',offlineUploadMulter[_0xed24('0x3a')](),controller['offline']);router[_0xed24('0x21')](_0xed24('0x17'),auth['isAuthenticated'](),controller['addInteraction']);router[_0xed24('0x21')](_0xed24('0x19'),auth[_0xed24('0x8')](),controller[_0xed24('0x3b')]);router[_0xed24('0x21')](_0xed24('0x1a'),auth[_0xed24('0x8')](),controller['addProactiveActions']);router[_0xed24('0x21')]('/:id/users',auth[_0xed24('0x8')](),controller[_0xed24('0x3c')]);router[_0xed24('0x3d')](_0xed24('0x3e'),auth[_0xed24('0x8')](),controller[_0xed24('0x3f')]);router[_0xed24('0x40')]('/:id',auth[_0xed24('0x8')](),controller[_0xed24('0x41')]);router['delete'](_0xed24('0xd'),auth[_0xed24('0x8')](),controller[_0xed24('0x42')]);router[_0xed24('0x40')]('/:id/canned_answers',auth[_0xed24('0x8')](),controller[_0xed24('0x43')]);router['delete'](_0xed24('0x1f'),auth['isAuthenticated'](),controller[_0xed24('0x44')]);module[_0xed24('0x45')]=router;
\ No newline at end of file
+var _0x158e=['create','addDisposition','diskStorage','join','root','format','%s-%s','now','originalname','single','file','addLogo','server/files/images/avatars/','/:id/notify','notify','server/files','attachments','offline-chat','ensureDir','extname','/:id/offline','any','/:id/interactions','addInteraction','addApplications','put','update','delete','/:id/dispositions','removeAnswers','/:id/users','removeAgents','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatWebsite.controller','isAuthenticated','index','get','/:id','getDispositions','/:id/canned_answers','/:id/logo','getLogo','/:id/avatar','getAvatar','/:id/customer_avatar','getCustomerAvatar','/:id/system_avatar','getSystemAvatar','/:id/snippet','getSnippet','getApplications','/:id/proactive_actions','getProactiveActions','/:id/fields','getFields','/:id/offline_messages','getOfflineMessages','getAgents','post'];(function(_0x45d80c,_0x35c0ff){var _0x449a98=function(_0x1b5ab7){while(--_0x1b5ab7){_0x45d80c['push'](_0x45d80c['shift']());}};_0x449a98(++_0x35c0ff);}(_0x158e,0xab));var _0xe158=function(_0x105dd9,_0x1a3e6b){_0x105dd9=_0x105dd9-0x0;var _0x1acd3a=_0x158e[_0x105dd9];return _0x1acd3a;};'use strict';var multer=require(_0xe158('0x0'));var util=require(_0xe158('0x1'));var path=require(_0xe158('0x2'));var timeout=require(_0xe158('0x3'));var express=require(_0xe158('0x4'));var router=express[_0xe158('0x5')]();var fs_extra=require(_0xe158('0x6'));var auth=require(_0xe158('0x7'));var interaction=require(_0xe158('0x8'));var config=require(_0xe158('0x9'));var controller=require(_0xe158('0xa'));router['get']('/',auth[_0xe158('0xb')](),controller[_0xe158('0xc')]);router[_0xe158('0xd')]('/describe',auth[_0xe158('0xb')](),controller['describe']);router[_0xe158('0xd')](_0xe158('0xe'),auth[_0xe158('0xb')](),controller['show']);router[_0xe158('0xd')]('/:id/dispositions',auth['isAuthenticated'](),controller[_0xe158('0xf')]);router[_0xe158('0xd')](_0xe158('0x10'),auth['isAuthenticated'](),controller['getAnswers']);router[_0xe158('0xd')](_0xe158('0x11'),controller[_0xe158('0x12')]);router['get'](_0xe158('0x13'),controller[_0xe158('0x14')]);router['get'](_0xe158('0x15'),controller[_0xe158('0x16')]);router['get'](_0xe158('0x17'),controller[_0xe158('0x18')]);router[_0xe158('0xd')]('/:id/interactions',auth[_0xe158('0xb')](),controller['getInteractions']);router[_0xe158('0xd')](_0xe158('0x19'),controller[_0xe158('0x1a')]);router['get']('/:id/applications',auth[_0xe158('0xb')](),controller[_0xe158('0x1b')]);router[_0xe158('0xd')](_0xe158('0x1c'),auth[_0xe158('0xb')](),controller[_0xe158('0x1d')]);router[_0xe158('0xd')](_0xe158('0x1e'),controller[_0xe158('0x1f')]);router[_0xe158('0xd')](_0xe158('0x20'),auth[_0xe158('0xb')](),controller[_0xe158('0x21')]);router[_0xe158('0xd')]('/:id/users',auth[_0xe158('0xb')](),controller[_0xe158('0x22')]);router[_0xe158('0x23')]('/',auth['isAuthenticated'](),controller[_0xe158('0x24')]);router['post']('/:id/dispositions',auth[_0xe158('0xb')](),controller[_0xe158('0x25')]);router['post'](_0xe158('0x10'),auth[_0xe158('0xb')](),controller['addAnswer']);var upload=multer({'storage':multer[_0xe158('0x26')]({'destination':function(_0x57f260,_0x318883,_0x2665fd){_0x2665fd(null,path[_0xe158('0x27')](config[_0xe158('0x28')],'server/files/images/logos/'));},'filename':function(_0x3e4819,_0x41fe1d,_0x201714){_0x201714(null,util[_0xe158('0x29')](_0xe158('0x2a'),Date[_0xe158('0x2b')](),_0x41fe1d[_0xe158('0x2c')]));}})});router[_0xe158('0x23')](_0xe158('0x11'),upload[_0xe158('0x2d')](_0xe158('0x2e')),controller[_0xe158('0x2f')]);var upload=multer({'storage':multer[_0xe158('0x26')]({'destination':function(_0x2de55e,_0x48694f,_0x3cc405){_0x3cc405(null,path['join'](config[_0xe158('0x28')],_0xe158('0x30')));},'filename':function(_0x1a34d3,_0x1866c0,_0x53d2ae){_0x53d2ae(null,util['format']('%s-%s',Date['now'](),_0x1866c0['originalname']));}})});router[_0xe158('0x23')](_0xe158('0x13'),upload['single'](_0xe158('0x2e')),controller['addAvatar']);var upload=multer({'storage':multer[_0xe158('0x26')]({'destination':function(_0x37e586,_0x27b388,_0x1d55ae){_0x1d55ae(null,path[_0xe158('0x27')](config[_0xe158('0x28')],_0xe158('0x30')));},'filename':function(_0x420346,_0x3cd480,_0x444fd8){_0x444fd8(null,util['format'](_0xe158('0x2a'),Date['now'](),_0x3cd480[_0xe158('0x2c')]));}})});router[_0xe158('0x23')](_0xe158('0x15'),upload['single'](_0xe158('0x2e')),controller['addCustomerAvatar']);var upload=multer({'storage':multer[_0xe158('0x26')]({'destination':function(_0x1e52f1,_0x17c2d9,_0x1f0fcb){_0x1f0fcb(null,path['join'](config[_0xe158('0x28')],_0xe158('0x30')));},'filename':function(_0x2b4e30,_0x16cbb9,_0x4826b4){_0x4826b4(null,util[_0xe158('0x29')](_0xe158('0x2a'),Date[_0xe158('0x2b')](),_0x16cbb9['originalname']));}})});router[_0xe158('0x23')](_0xe158('0x17'),upload[_0xe158('0x2d')](_0xe158('0x2e')),controller['addSystemAvatar']);router[_0xe158('0x23')](_0xe158('0x31'),controller[_0xe158('0x32')]);const offlineUploadMulter=multer({'storage':multer['diskStorage']({'destination':function(_0x107c56,_0x399eeb,_0x43a109){const _0x9f6ad9=path[_0xe158('0x27')](config[_0xe158('0x28')],_0xe158('0x33'),_0xe158('0x34'),_0xe158('0x35'));fs_extra[_0xe158('0x36')](_0x9f6ad9,function(){_0x43a109(null,_0x9f6ad9);});},'filename':function(_0x463b53,_0x206d53,_0xad0700){const _0x149b89=_0x206d53['originalname']['replace'](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');const _0x4b7c7f=path[_0xe158('0x37')](_0x149b89);const _0x5bd481=Date[_0xe158('0x2b')]()+'-'+_0x149b89['replace'](_0x4b7c7f,'')+_0x4b7c7f;_0xad0700(null,_0x5bd481);}})});router[_0xe158('0x23')](_0xe158('0x38'),offlineUploadMulter[_0xe158('0x39')](),controller['offline']);router['post'](_0xe158('0x3a'),auth['isAuthenticated'](),controller[_0xe158('0x3b')]);router[_0xe158('0x23')]('/:id/applications',auth[_0xe158('0xb')](),controller[_0xe158('0x3c')]);router[_0xe158('0x23')](_0xe158('0x1c'),auth[_0xe158('0xb')](),controller['addProactiveActions']);router[_0xe158('0x23')]('/:id/users',auth[_0xe158('0xb')](),controller['addAgents']);router[_0xe158('0x3d')]('/:id',auth[_0xe158('0xb')](),controller[_0xe158('0x3e')]);router[_0xe158('0x3f')](_0xe158('0xe'),auth['isAuthenticated'](),controller['destroy']);router[_0xe158('0x3f')](_0xe158('0x40'),auth[_0xe158('0xb')](),controller['removeDispositions']);router[_0xe158('0x3f')](_0xe158('0x10'),auth['isAuthenticated'](),controller[_0xe158('0x41')]);router['delete'](_0xe158('0x42'),auth['isAuthenticated'](),controller[_0xe158('0x43')]);module[_0xe158('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 5ece2e9..977b8af 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 _0xc627=['ENUM','Google','exports','STRING'];(function(_0x5f09c5,_0x2bfca0){var _0x426ad9=function(_0x18fe5f){while(--_0x18fe5f){_0x5f09c5['push'](_0x5f09c5['shift']());}};_0x426ad9(++_0x2bfca0);}(_0xc627,0x14a));var _0x7c62=function(_0x30f7e0,_0x455121){_0x30f7e0=_0x30f7e0-0x0;var _0x2c82f3=_0xc627[_0x30f7e0];return _0x2c82f3;};'use strict';var Sequelize=require('sequelize');module[_0x7c62('0x0')]={'name':{'type':Sequelize[_0x7c62('0x1')],'allowNull':![],'validate':{'notEmpty':!![]}},'service':{'type':Sequelize[_0x7c62('0x2')]('AmazonAWS',_0x7c62('0x3')),'allowNull':![],'validate':{'notEmpty':!![]}},'data1':{'type':Sequelize[_0x7c62('0x1')]},'data2':{'type':Sequelize[_0x7c62('0x1')]}};
\ No newline at end of file
+var _0x9aac=['Google','sequelize','STRING','ENUM'];(function(_0x7df60e,_0x201b90){var _0x1554fb=function(_0xaaf762){while(--_0xaaf762){_0x7df60e['push'](_0x7df60e['shift']());}};_0x1554fb(++_0x201b90);}(_0x9aac,0x135));var _0xc9aa=function(_0x36cd7f,_0x396c9a){_0x36cd7f=_0x36cd7f-0x0;var _0x16d0ff=_0x9aac[_0x36cd7f];return _0x16d0ff;};'use strict';var Sequelize=require(_0xc9aa('0x0'));module['exports']={'name':{'type':Sequelize[_0xc9aa('0x1')],'allowNull':![],'validate':{'notEmpty':!![]}},'service':{'type':Sequelize[_0xc9aa('0x2')]('AmazonAWS',_0xc9aa('0x3')),'allowNull':![],'validate':{'notEmpty':!![]}},'data1':{'type':Sequelize['STRING']},'data2':{'type':Sequelize[_0xc9aa('0x1')]}};
\ No newline at end of file
diff --git a/server/api/cloudProvider/cloudProvider.controller.js b/server/api/cloudProvider/cloudProvider.controller.js
index d551186..ef58035 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 _0x0b0e=['hasOwnProperty','nolimit','order','sort','filters','filter','merge','where','VIRTUAL','options','count','includeAll','findAll','rows','catch','show','include','find','create','body','params','eml-format','zip-dir','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','end','status','undefined','offset','limit','set','json','apply','reject','save','then','destroy','error','stack','name','index','map','CloudProvider','rawAttributes','fieldName','type','query','keys','intersection','model','attributes','fields','length'];(function(_0x3cffb7,_0x4e48ec){var _0x568e0c=function(_0x495ace){while(--_0x495ace){_0x3cffb7['push'](_0x3cffb7['shift']());}};_0x568e0c(++_0x4e48ec);}(_0x0b0e,0x187));var _0xe0b0=function(_0x35468d,_0x2a7240){_0x35468d=_0x35468d-0x0;var _0x30da52=_0x0b0e[_0x35468d];return _0x30da52;};'use strict';var emlformat=require(_0xe0b0('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xe0b0('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0xe0b0('0x2'));var moment=require(_0xe0b0('0x3'));var BPromise=require(_0xe0b0('0x4'));var Mustache=require(_0xe0b0('0x5'));var util=require(_0xe0b0('0x6'));var path=require(_0xe0b0('0x7'));var sox=require(_0xe0b0('0x8'));var csv=require(_0xe0b0('0x9'));var ejs=require(_0xe0b0('0xa'));var fs=require('fs');var fs_extra=require(_0xe0b0('0xb'));var _=require(_0xe0b0('0xc'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0xe0b0('0xd'));var deskjs=require(_0xe0b0('0xe'));var toCsv=require(_0xe0b0('0x9'));var querystring=require(_0xe0b0('0xf'));var Papa=require('papaparse');var Redis=require(_0xe0b0('0x10'));var authService=require(_0xe0b0('0x11'));var qs=require('../../components/parsers/qs');var as=require(_0xe0b0('0x12'));var hardwareService=require(_0xe0b0('0x13'));var logger=require('../../config/logger')(_0xe0b0('0x14'));var utils=require(_0xe0b0('0x15'));var config=require(_0xe0b0('0x16'));var licenseUtil=require('../../config/license/util');var db=require(_0xe0b0('0x17'))['db'];function respondWithStatusCode(_0x1c358a,_0x3cc19a){_0x3cc19a=_0x3cc19a||0xcc;return function(_0x45f914){if(_0x45f914){return _0x1c358a[_0xe0b0('0x18')](_0x3cc19a);}return _0x1c358a['status'](_0x3cc19a)[_0xe0b0('0x19')]();};}function respondWithResult(_0x154de6,_0x743318){_0x743318=_0x743318||0xc8;return function(_0x24babd){if(_0x24babd){return _0x154de6[_0xe0b0('0x1a')](_0x743318)['json'](_0x24babd);}};}function respondWithFilteredResult(_0x41a7e2,_0x5adb01){return function(_0x35cb40){if(_0x35cb40){var _0xadee6e=typeof _0x5adb01['offset']===_0xe0b0('0x1b')&&typeof _0x5adb01['limit']===_0xe0b0('0x1b');var _0x100204=_0x35cb40['count'];var _0x54a3eb=_0xadee6e?0x0:_0x5adb01[_0xe0b0('0x1c')];var _0x50a441=_0xadee6e?_0x35cb40['count']:_0x5adb01['offset']+_0x5adb01[_0xe0b0('0x1d')];var _0x50fa4a;if(_0x50a441>=_0x100204){_0x50a441=_0x100204;_0x50fa4a=0xc8;}else{_0x50fa4a=0xce;}_0x41a7e2['status'](_0x50fa4a);return _0x41a7e2[_0xe0b0('0x1e')]('Content-Range',_0x54a3eb+'-'+_0x50a441+'/'+_0x100204)[_0xe0b0('0x1f')](_0x35cb40);}return null;};}function patchUpdates(_0x5dba2f){return function(_0x2c84cc){try{jsonpatch[_0xe0b0('0x20')](_0x2c84cc,_0x5dba2f,!![]);}catch(_0x3e10b3){return BPromise[_0xe0b0('0x21')](_0x3e10b3);}return _0x2c84cc[_0xe0b0('0x22')]();};}function saveUpdates(_0x58b804,_0x4cae54){return function(_0x2fa820){if(_0x2fa820){return _0x2fa820['update'](_0x58b804)[_0xe0b0('0x23')](function(_0x31b5f8){return _0x31b5f8;});}return null;};}function removeEntity(_0x513e63,_0x170ad8){return function(_0x503883){if(_0x503883){return _0x503883[_0xe0b0('0x24')]()['then'](function(){_0x513e63[_0xe0b0('0x1a')](0xcc)['end']();});}};}function handleEntityNotFound(_0x3e5c88,_0x4de537){return function(_0x4700cc){if(!_0x4700cc){_0x3e5c88['sendStatus'](0x194);}return _0x4700cc;};}function handleError(_0x3c221d,_0x5c5317){_0x5c5317=_0x5c5317||0x1f4;return function(_0x362aba){logger[_0xe0b0('0x25')](_0x362aba[_0xe0b0('0x26')]);if(_0x362aba[_0xe0b0('0x27')]){delete _0x362aba[_0xe0b0('0x27')];}_0x3c221d[_0xe0b0('0x1a')](_0x5c5317)['send'](_0x362aba);};}exports[_0xe0b0('0x28')]=function(_0x1b8aa8,_0x5b7a64){var _0x15e13b={},_0x419b1f={},_0x36d137={'count':0x0,'rows':[]};var _0x1d5759=_[_0xe0b0('0x29')](db[_0xe0b0('0x2a')][_0xe0b0('0x2b')],function(_0x4fb3b7){return{'name':_0x4fb3b7[_0xe0b0('0x2c')],'type':_0x4fb3b7[_0xe0b0('0x2d')]['key']};});_0x419b1f['model']=_[_0xe0b0('0x29')](_0x1d5759,_0xe0b0('0x27'));_0x419b1f[_0xe0b0('0x2e')]=_[_0xe0b0('0x2f')](_0x1b8aa8[_0xe0b0('0x2e')]);_0x419b1f['filters']=_[_0xe0b0('0x30')](_0x419b1f[_0xe0b0('0x31')],_0x419b1f[_0xe0b0('0x2e')]);_0x15e13b[_0xe0b0('0x32')]=_[_0xe0b0('0x30')](_0x419b1f['model'],qs[_0xe0b0('0x33')](_0x1b8aa8[_0xe0b0('0x2e')][_0xe0b0('0x33')]));_0x15e13b[_0xe0b0('0x32')]=_0x15e13b[_0xe0b0('0x32')][_0xe0b0('0x34')]?_0x15e13b[_0xe0b0('0x32')]:_0x419b1f[_0xe0b0('0x31')];if(!_0x1b8aa8[_0xe0b0('0x2e')][_0xe0b0('0x35')](_0xe0b0('0x36'))){_0x15e13b[_0xe0b0('0x1d')]=qs[_0xe0b0('0x1d')](_0x1b8aa8[_0xe0b0('0x2e')][_0xe0b0('0x1d')]);_0x15e13b['offset']=qs[_0xe0b0('0x1c')](_0x1b8aa8[_0xe0b0('0x2e')][_0xe0b0('0x1c')]);}_0x15e13b[_0xe0b0('0x37')]=qs[_0xe0b0('0x38')](_0x1b8aa8[_0xe0b0('0x2e')][_0xe0b0('0x38')]);_0x15e13b['where']=qs['filters'](_['pick'](_0x1b8aa8['query'],_0x419b1f[_0xe0b0('0x39')]),_0x1d5759);if(_0x1b8aa8[_0xe0b0('0x2e')][_0xe0b0('0x3a')]){_0x15e13b['where']=_[_0xe0b0('0x3b')](_0x15e13b[_0xe0b0('0x3c')],{'$or':_[_0xe0b0('0x29')](_0x1d5759,function(_0x297c64){if(_0x297c64['type']!==_0xe0b0('0x3d')){var _0xfbb61d={};_0xfbb61d[_0x297c64[_0xe0b0('0x27')]]={'$like':'%'+_0x1b8aa8[_0xe0b0('0x2e')][_0xe0b0('0x3a')]+'%'};return _0xfbb61d;}})});}_0x15e13b=_[_0xe0b0('0x3b')]({},_0x15e13b,_0x1b8aa8[_0xe0b0('0x3e')]);var _0x115a69={'where':_0x15e13b[_0xe0b0('0x3c')]};return db['CloudProvider'][_0xe0b0('0x3f')](_0x115a69)['then'](function(_0x34178d){_0x36d137[_0xe0b0('0x3f')]=_0x34178d;if(_0x1b8aa8[_0xe0b0('0x2e')][_0xe0b0('0x40')]){_0x15e13b['include']=[{'all':!![]}];}return db[_0xe0b0('0x2a')][_0xe0b0('0x41')](_0x15e13b);})[_0xe0b0('0x23')](function(_0x402a0e){_0x36d137[_0xe0b0('0x42')]=_0x402a0e;return _0x36d137;})[_0xe0b0('0x23')](respondWithFilteredResult(_0x5b7a64,_0x15e13b))[_0xe0b0('0x43')](handleError(_0x5b7a64,null));};exports[_0xe0b0('0x44')]=function(_0x52ffe4,_0x2aad80){var _0x309bbf={'raw':!![],'where':{'id':_0x52ffe4['params']['id']}},_0x528818={};_0x528818[_0xe0b0('0x31')]=_[_0xe0b0('0x2f')](db['CloudProvider'][_0xe0b0('0x2b')]);_0x528818[_0xe0b0('0x2e')]=_[_0xe0b0('0x2f')](_0x52ffe4[_0xe0b0('0x2e')]);_0x528818[_0xe0b0('0x39')]=_['intersection'](_0x528818['model'],_0x528818['query']);_0x309bbf[_0xe0b0('0x32')]=_[_0xe0b0('0x30')](_0x528818['model'],qs[_0xe0b0('0x33')](_0x52ffe4[_0xe0b0('0x2e')][_0xe0b0('0x33')]));_0x309bbf[_0xe0b0('0x32')]=_0x309bbf[_0xe0b0('0x32')]['length']?_0x309bbf['attributes']:_0x528818[_0xe0b0('0x31')];if(_0x52ffe4[_0xe0b0('0x2e')][_0xe0b0('0x40')]){_0x309bbf[_0xe0b0('0x45')]=[{'all':!![]}];}_0x309bbf=_[_0xe0b0('0x3b')]({},_0x309bbf,_0x52ffe4['options']);return db[_0xe0b0('0x2a')][_0xe0b0('0x46')](_0x309bbf)['then'](handleEntityNotFound(_0x2aad80,null))['then'](respondWithResult(_0x2aad80,null))['catch'](handleError(_0x2aad80,null));};exports[_0xe0b0('0x47')]=function(_0x2184d3,_0x2419ce){return db[_0xe0b0('0x2a')]['create'](_0x2184d3[_0xe0b0('0x48')],{})[_0xe0b0('0x23')](respondWithResult(_0x2419ce,0xc9))['catch'](handleError(_0x2419ce,null));};exports['update']=function(_0x2365be,_0x1bc6e0){if(_0x2365be['body']['id']){delete _0x2365be[_0xe0b0('0x48')]['id'];}return db[_0xe0b0('0x2a')]['find']({'where':{'id':_0x2365be['params']['id']}})[_0xe0b0('0x23')](handleEntityNotFound(_0x1bc6e0,null))['then'](saveUpdates(_0x2365be[_0xe0b0('0x48')],null))[_0xe0b0('0x23')](respondWithResult(_0x1bc6e0,null))[_0xe0b0('0x43')](handleError(_0x1bc6e0,null));};exports[_0xe0b0('0x24')]=function(_0x19ee71,_0xf9e694){return db['CloudProvider']['find']({'where':{'id':_0x19ee71[_0xe0b0('0x49')]['id']}})['then'](handleEntityNotFound(_0xf9e694,null))['then'](removeEntity(_0xf9e694,null))[_0xe0b0('0x43')](handleError(_0xf9e694,null));};
\ No newline at end of file
+var _0xdb28=['error','stack','name','send','index','CloudProvider','fieldName','type','key','map','query','keys','model','fields','attributes','length','nolimit','order','sort','filters','filter','where','VIRTUAL','merge','options','includeAll','findAll','rows','catch','show','params','rawAttributes','intersection','include','find','create','body','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','to-csv','ejs','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','status','end','json','offset','undefined','count','limit','set','apply','save','update','then','sendStatus'];(function(_0x32eebe,_0x39e1d9){var _0x320061=function(_0x2a5da5){while(--_0x2a5da5){_0x32eebe['push'](_0x32eebe['shift']());}};_0x320061(++_0x39e1d9);}(_0xdb28,0x106));var _0x8db2=function(_0x135aaa,_0x28f53e){_0x135aaa=_0x135aaa-0x0;var _0x1e9a05=_0xdb28[_0x135aaa];return _0x1e9a05;};'use strict';var emlformat=require(_0x8db2('0x0'));var rimraf=require(_0x8db2('0x1'));var zipdir=require(_0x8db2('0x2'));var jsonpatch=require(_0x8db2('0x3'));var rp=require('request-promise');var moment=require(_0x8db2('0x4'));var BPromise=require(_0x8db2('0x5'));var Mustache=require(_0x8db2('0x6'));var util=require(_0x8db2('0x7'));var path=require(_0x8db2('0x8'));var sox=require('sox');var csv=require(_0x8db2('0x9'));var ejs=require(_0x8db2('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0x8db2('0xb'));var crypto=require(_0x8db2('0xc'));var jsforce=require(_0x8db2('0xd'));var deskjs=require(_0x8db2('0xe'));var toCsv=require(_0x8db2('0x9'));var querystring=require(_0x8db2('0xf'));var Papa=require(_0x8db2('0x10'));var Redis=require('ioredis');var authService=require(_0x8db2('0x11'));var qs=require(_0x8db2('0x12'));var as=require(_0x8db2('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x8db2('0x14'))(_0x8db2('0x15'));var utils=require('../../config/utils');var config=require(_0x8db2('0x16'));var licenseUtil=require(_0x8db2('0x17'));var db=require(_0x8db2('0x18'))['db'];function respondWithStatusCode(_0x204f49,_0x37d017){_0x37d017=_0x37d017||0xcc;return function(_0x559fb1){if(_0x559fb1){return _0x204f49['sendStatus'](_0x37d017);}return _0x204f49[_0x8db2('0x19')](_0x37d017)[_0x8db2('0x1a')]();};}function respondWithResult(_0x350d61,_0x1d6a15){_0x1d6a15=_0x1d6a15||0xc8;return function(_0x227355){if(_0x227355){return _0x350d61[_0x8db2('0x19')](_0x1d6a15)[_0x8db2('0x1b')](_0x227355);}};}function respondWithFilteredResult(_0x3c96a7,_0x131252){return function(_0x16c8c2){if(_0x16c8c2){var _0x5489a9=typeof _0x131252[_0x8db2('0x1c')]===_0x8db2('0x1d')&&typeof _0x131252['limit']===_0x8db2('0x1d');var _0x44957d=_0x16c8c2[_0x8db2('0x1e')];var _0x3fddc2=_0x5489a9?0x0:_0x131252[_0x8db2('0x1c')];var _0x46ce14=_0x5489a9?_0x16c8c2['count']:_0x131252['offset']+_0x131252[_0x8db2('0x1f')];var _0x104e33;if(_0x46ce14>=_0x44957d){_0x46ce14=_0x44957d;_0x104e33=0xc8;}else{_0x104e33=0xce;}_0x3c96a7[_0x8db2('0x19')](_0x104e33);return _0x3c96a7[_0x8db2('0x20')]('Content-Range',_0x3fddc2+'-'+_0x46ce14+'/'+_0x44957d)[_0x8db2('0x1b')](_0x16c8c2);}return null;};}function patchUpdates(_0x36a9ff){return function(_0x260940){try{jsonpatch[_0x8db2('0x21')](_0x260940,_0x36a9ff,!![]);}catch(_0x3dbe8e){return BPromise['reject'](_0x3dbe8e);}return _0x260940[_0x8db2('0x22')]();};}function saveUpdates(_0x3e30e6,_0x18f69c){return function(_0x125be2){if(_0x125be2){return _0x125be2[_0x8db2('0x23')](_0x3e30e6)[_0x8db2('0x24')](function(_0x796ec1){return _0x796ec1;});}return null;};}function removeEntity(_0x5c6614,_0x256202){return function(_0x4f6516){if(_0x4f6516){return _0x4f6516['destroy']()['then'](function(){_0x5c6614['status'](0xcc)[_0x8db2('0x1a')]();});}};}function handleEntityNotFound(_0x29b5cd,_0x3be281){return function(_0x2baed0){if(!_0x2baed0){_0x29b5cd[_0x8db2('0x25')](0x194);}return _0x2baed0;};}function handleError(_0x8d4f54,_0x58cd9d){_0x58cd9d=_0x58cd9d||0x1f4;return function(_0x3544ba){logger[_0x8db2('0x26')](_0x3544ba[_0x8db2('0x27')]);if(_0x3544ba[_0x8db2('0x28')]){delete _0x3544ba['name'];}_0x8d4f54[_0x8db2('0x19')](_0x58cd9d)[_0x8db2('0x29')](_0x3544ba);};}exports[_0x8db2('0x2a')]=function(_0x1687ed,_0xbe5ece){var _0x21bae5={},_0xa54ea3={},_0x3124d5={'count':0x0,'rows':[]};var _0xbc5366=_['map'](db[_0x8db2('0x2b')]['rawAttributes'],function(_0x59cb77){return{'name':_0x59cb77[_0x8db2('0x2c')],'type':_0x59cb77[_0x8db2('0x2d')][_0x8db2('0x2e')]};});_0xa54ea3['model']=_[_0x8db2('0x2f')](_0xbc5366,'name');_0xa54ea3[_0x8db2('0x30')]=_[_0x8db2('0x31')](_0x1687ed[_0x8db2('0x30')]);_0xa54ea3['filters']=_['intersection'](_0xa54ea3[_0x8db2('0x32')],_0xa54ea3[_0x8db2('0x30')]);_0x21bae5['attributes']=_['intersection'](_0xa54ea3[_0x8db2('0x32')],qs[_0x8db2('0x33')](_0x1687ed[_0x8db2('0x30')][_0x8db2('0x33')]));_0x21bae5[_0x8db2('0x34')]=_0x21bae5[_0x8db2('0x34')][_0x8db2('0x35')]?_0x21bae5[_0x8db2('0x34')]:_0xa54ea3[_0x8db2('0x32')];if(!_0x1687ed[_0x8db2('0x30')]['hasOwnProperty'](_0x8db2('0x36'))){_0x21bae5[_0x8db2('0x1f')]=qs['limit'](_0x1687ed[_0x8db2('0x30')][_0x8db2('0x1f')]);_0x21bae5['offset']=qs['offset'](_0x1687ed[_0x8db2('0x30')]['offset']);}_0x21bae5[_0x8db2('0x37')]=qs[_0x8db2('0x38')](_0x1687ed[_0x8db2('0x30')][_0x8db2('0x38')]);_0x21bae5['where']=qs[_0x8db2('0x39')](_['pick'](_0x1687ed[_0x8db2('0x30')],_0xa54ea3[_0x8db2('0x39')]),_0xbc5366);if(_0x1687ed[_0x8db2('0x30')][_0x8db2('0x3a')]){_0x21bae5['where']=_['merge'](_0x21bae5[_0x8db2('0x3b')],{'$or':_[_0x8db2('0x2f')](_0xbc5366,function(_0x5dc2b4){if(_0x5dc2b4[_0x8db2('0x2d')]!==_0x8db2('0x3c')){var _0x656dd2={};_0x656dd2[_0x5dc2b4['name']]={'$like':'%'+_0x1687ed[_0x8db2('0x30')][_0x8db2('0x3a')]+'%'};return _0x656dd2;}})});}_0x21bae5=_[_0x8db2('0x3d')]({},_0x21bae5,_0x1687ed[_0x8db2('0x3e')]);var _0x2e6f0c={'where':_0x21bae5[_0x8db2('0x3b')]};return db[_0x8db2('0x2b')][_0x8db2('0x1e')](_0x2e6f0c)[_0x8db2('0x24')](function(_0x63c561){_0x3124d5[_0x8db2('0x1e')]=_0x63c561;if(_0x1687ed[_0x8db2('0x30')][_0x8db2('0x3f')]){_0x21bae5['include']=[{'all':!![]}];}return db[_0x8db2('0x2b')][_0x8db2('0x40')](_0x21bae5);})['then'](function(_0x49a7ae){_0x3124d5[_0x8db2('0x41')]=_0x49a7ae;return _0x3124d5;})['then'](respondWithFilteredResult(_0xbe5ece,_0x21bae5))[_0x8db2('0x42')](handleError(_0xbe5ece,null));};exports[_0x8db2('0x43')]=function(_0x313130,_0x307783){var _0xb4fe2c={'raw':!![],'where':{'id':_0x313130[_0x8db2('0x44')]['id']}},_0x30d606={};_0x30d606['model']=_[_0x8db2('0x31')](db[_0x8db2('0x2b')][_0x8db2('0x45')]);_0x30d606[_0x8db2('0x30')]=_['keys'](_0x313130[_0x8db2('0x30')]);_0x30d606[_0x8db2('0x39')]=_[_0x8db2('0x46')](_0x30d606[_0x8db2('0x32')],_0x30d606['query']);_0xb4fe2c[_0x8db2('0x34')]=_['intersection'](_0x30d606[_0x8db2('0x32')],qs[_0x8db2('0x33')](_0x313130[_0x8db2('0x30')]['fields']));_0xb4fe2c['attributes']=_0xb4fe2c[_0x8db2('0x34')]['length']?_0xb4fe2c[_0x8db2('0x34')]:_0x30d606[_0x8db2('0x32')];if(_0x313130[_0x8db2('0x30')][_0x8db2('0x3f')]){_0xb4fe2c[_0x8db2('0x47')]=[{'all':!![]}];}_0xb4fe2c=_[_0x8db2('0x3d')]({},_0xb4fe2c,_0x313130[_0x8db2('0x3e')]);return db[_0x8db2('0x2b')][_0x8db2('0x48')](_0xb4fe2c)[_0x8db2('0x24')](handleEntityNotFound(_0x307783,null))[_0x8db2('0x24')](respondWithResult(_0x307783,null))[_0x8db2('0x42')](handleError(_0x307783,null));};exports['create']=function(_0x449109,_0x2ada52){return db[_0x8db2('0x2b')][_0x8db2('0x49')](_0x449109['body'],{})['then'](respondWithResult(_0x2ada52,0xc9))[_0x8db2('0x42')](handleError(_0x2ada52,null));};exports[_0x8db2('0x23')]=function(_0x164020,_0x4c66e5){if(_0x164020['body']['id']){delete _0x164020['body']['id'];}return db[_0x8db2('0x2b')][_0x8db2('0x48')]({'where':{'id':_0x164020[_0x8db2('0x44')]['id']}})[_0x8db2('0x24')](handleEntityNotFound(_0x4c66e5,null))[_0x8db2('0x24')](saveUpdates(_0x164020[_0x8db2('0x4a')],null))[_0x8db2('0x24')](respondWithResult(_0x4c66e5,null))['catch'](handleError(_0x4c66e5,null));};exports['destroy']=function(_0x3d29bc,_0x18c6ef){return db[_0x8db2('0x2b')][_0x8db2('0x48')]({'where':{'id':_0x3d29bc[_0x8db2('0x44')]['id']}})[_0x8db2('0x24')](handleEntityNotFound(_0x18c6ef,null))[_0x8db2('0x24')](removeEntity(_0x18c6ef,null))[_0x8db2('0x42')](handleError(_0x18c6ef,null));};
\ No newline at end of file
diff --git a/server/api/cloudProvider/cloudProvider.model.js b/server/api/cloudProvider/cloudProvider.model.js
index a2b4199..b01c9de 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 _0x98ef=['cloud_providers','lodash','util','moment','bluebird','request-promise','path','rimraf','../../config/environment','./cloudProvider.attributes','exports','define','CloudProvider'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x98ef,0x17a));var _0xf98e=function(_0xb80db7,_0x4ff6b2){_0xb80db7=_0xb80db7-0x0;var _0x232a65=_0x98ef[_0xb80db7];return _0x232a65;};'use strict';var _=require(_0xf98e('0x0'));var util=require(_0xf98e('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0xf98e('0x2'));var BPromise=require(_0xf98e('0x3'));var rp=require(_0xf98e('0x4'));var fs=require('fs');var path=require(_0xf98e('0x5'));var rimraf=require(_0xf98e('0x6'));var config=require(_0xf98e('0x7'));var attributes=require(_0xf98e('0x8'));module[_0xf98e('0x9')]=function(_0x39c8e7,_0x1a1f74){return _0x39c8e7[_0xf98e('0xa')](_0xf98e('0xb'),attributes,{'tableName':_0xf98e('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xe1d3=['bluebird','request-promise','path','rimraf','../../config/environment','./cloudProvider.attributes','define','lodash','api','moment'];(function(_0x3e6980,_0x190736){var _0x5697dc=function(_0xb86ad8){while(--_0xb86ad8){_0x3e6980['push'](_0x3e6980['shift']());}};_0x5697dc(++_0x190736);}(_0xe1d3,0x1e7));var _0x3e1d=function(_0x2fab31,_0x581f28){_0x2fab31=_0x2fab31-0x0;var _0xfb15ee=_0xe1d3[_0x2fab31];return _0xfb15ee;};'use strict';var _=require(_0x3e1d('0x0'));var util=require('util');var logger=require('../../config/logger')(_0x3e1d('0x1'));var moment=require(_0x3e1d('0x2'));var BPromise=require(_0x3e1d('0x3'));var rp=require(_0x3e1d('0x4'));var fs=require('fs');var path=require(_0x3e1d('0x5'));var rimraf=require(_0x3e1d('0x6'));var config=require(_0x3e1d('0x7'));var attributes=require(_0x3e1d('0x8'));module['exports']=function(_0xb9a2ab,_0x2f3b05){return _0xb9a2ab[_0x3e1d('0x9')]('CloudProvider',attributes,{'tableName':'cloud_providers','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 1123a9a..abbd2d2 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 _0x17a7=['CloudProvider,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','../../config/environment','jayson/promise','http','then','info'];(function(_0xa0be1c,_0x152d5d){var _0x546eec=function(_0x371eae){while(--_0x371eae){_0xa0be1c['push'](_0xa0be1c['shift']());}};_0x546eec(++_0x152d5d);}(_0x17a7,0xc2));var _0x717a=function(_0xe347f2,_0x52e6ac){_0xe347f2=_0xe347f2-0x0;var _0x449aee=_0x17a7[_0xe347f2];return _0x449aee;};'use strict';var _=require('lodash');var util=require('util');var moment=require('moment');var BPromise=require(_0x717a('0x0'));var rs=require(_0x717a('0x1'));var fs=require('fs');var Redis=require(_0x717a('0x2'));var db=require(_0x717a('0x3'))['db'];var utils=require('../../config/utils');var logger=require(_0x717a('0x4'))('rpc');var config=require(_0x717a('0x5'));var jayson=require(_0x717a('0x6'));var client=jayson['client'][_0x717a('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x1ca7a6,_0xd7d2ce,_0x311738){return new BPromise(function(_0x536824,_0x1066d4){return client['request'](_0x1ca7a6,_0x311738)[_0x717a('0x8')](function(_0x567130){logger[_0x717a('0x9')](_0x717a('0xa'),_0xd7d2ce,_0x717a('0xb'));logger['debug']('CloudProvider,\x20%s,\x20%s,\x20%s',_0xd7d2ce,_0x717a('0xb'),JSON[_0x717a('0xc')](_0x567130));if(_0x567130[_0x717a('0xd')]){if(_0x567130[_0x717a('0xd')][_0x717a('0xe')]===0x1f4){logger['error'](_0x717a('0xa'),_0xd7d2ce,_0x567130['error'][_0x717a('0xf')]);return _0x1066d4(_0x567130['error']['message']);}logger['error']('CloudProvider,\x20%s,\x20%s',_0xd7d2ce,_0x567130[_0x717a('0xd')]['message']);return _0x536824(_0x567130[_0x717a('0xd')]['message']);}else{logger[_0x717a('0x9')]('CloudProvider,\x20%s,\x20%s',_0xd7d2ce,_0x717a('0xb'));_0x536824(_0x567130[_0x717a('0x10')][_0x717a('0xf')]);}})['catch'](function(_0x186b4d){logger['error'](_0x717a('0xa'),_0xd7d2ce,_0x186b4d);_0x1066d4(_0x186b4d);});});}
\ No newline at end of file
+var _0x3e22=['http','request','then','info','request\x20sent','debug','CloudProvider,\x20%s,\x20%s,\x20%s','stringify','code','error','CloudProvider,\x20%s,\x20%s','message','result','catch','util','bluebird','randomstring','ioredis','../../mysqldb','rpc','../../config/environment','client'];(function(_0x469ac7,_0x38e416){var _0x22f3b0=function(_0x1a1447){while(--_0x1a1447){_0x469ac7['push'](_0x469ac7['shift']());}};_0x22f3b0(++_0x38e416);}(_0x3e22,0xa8));var _0x23e2=function(_0x306d5d,_0x3293d5){_0x306d5d=_0x306d5d-0x0;var _0xb5cee4=_0x3e22[_0x306d5d];return _0xb5cee4;};'use strict';var _=require('lodash');var util=require(_0x23e2('0x0'));var moment=require('moment');var BPromise=require(_0x23e2('0x1'));var rs=require(_0x23e2('0x2'));var fs=require('fs');var Redis=require(_0x23e2('0x3'));var db=require(_0x23e2('0x4'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x23e2('0x5'));var config=require(_0x23e2('0x6'));var jayson=require('jayson/promise');var client=jayson[_0x23e2('0x7')][_0x23e2('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x3a8351,_0x927fbb,_0xb71434){return new BPromise(function(_0x4c13ae,_0x64c91b){return client[_0x23e2('0x9')](_0x3a8351,_0xb71434)[_0x23e2('0xa')](function(_0x75da0a){logger[_0x23e2('0xb')]('CloudProvider,\x20%s,\x20%s',_0x927fbb,_0x23e2('0xc'));logger[_0x23e2('0xd')](_0x23e2('0xe'),_0x927fbb,_0x23e2('0xc'),JSON[_0x23e2('0xf')](_0x75da0a));if(_0x75da0a['error']){if(_0x75da0a['error'][_0x23e2('0x10')]===0x1f4){logger[_0x23e2('0x11')](_0x23e2('0x12'),_0x927fbb,_0x75da0a[_0x23e2('0x11')][_0x23e2('0x13')]);return _0x64c91b(_0x75da0a[_0x23e2('0x11')][_0x23e2('0x13')]);}logger[_0x23e2('0x11')](_0x23e2('0x12'),_0x927fbb,_0x75da0a[_0x23e2('0x11')][_0x23e2('0x13')]);return _0x4c13ae(_0x75da0a[_0x23e2('0x11')][_0x23e2('0x13')]);}else{logger[_0x23e2('0xb')]('CloudProvider,\x20%s,\x20%s',_0x927fbb,_0x23e2('0xc'));_0x4c13ae(_0x75da0a[_0x23e2('0x14')][_0x23e2('0x13')]);}})[_0x23e2('0x15')](function(_0x276c2d){logger[_0x23e2('0x11')](_0x23e2('0x12'),_0x927fbb,_0x276c2d);_0x64c91b(_0x276c2d);});});}
\ No newline at end of file
diff --git a/server/api/cloudProvider/index.js b/server/api/cloudProvider/index.js
index 9858800..1770124 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 _0x745d=['express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./cloudProvider.controller','get','isAuthenticated','/:id','show','post','create','update','delete','destroy','exports','multer','util','path','connect-timeout'];(function(_0x38b777,_0x58b31e){var _0x41da2c=function(_0x1e929a){while(--_0x1e929a){_0x38b777['push'](_0x38b777['shift']());}};_0x41da2c(++_0x58b31e);}(_0x745d,0xec));var _0xd745=function(_0x383a25,_0x1c34c7){_0x383a25=_0x383a25-0x0;var _0x465e8e=_0x745d[_0x383a25];return _0x465e8e;};'use strict';var multer=require(_0xd745('0x0'));var util=require(_0xd745('0x1'));var path=require(_0xd745('0x2'));var timeout=require(_0xd745('0x3'));var express=require(_0xd745('0x4'));var router=express['Router']();var fs_extra=require(_0xd745('0x5'));var auth=require(_0xd745('0x6'));var interaction=require(_0xd745('0x7'));var config=require(_0xd745('0x8'));var controller=require(_0xd745('0x9'));router[_0xd745('0xa')]('/',auth[_0xd745('0xb')](),controller['index']);router[_0xd745('0xa')](_0xd745('0xc'),auth[_0xd745('0xb')](),controller[_0xd745('0xd')]);router[_0xd745('0xe')]('/',auth[_0xd745('0xb')](),controller[_0xd745('0xf')]);router['put']('/:id',auth[_0xd745('0xb')](),controller[_0xd745('0x10')]);router[_0xd745('0x11')](_0xd745('0xc'),auth[_0xd745('0xb')](),controller[_0xd745('0x12')]);module[_0xd745('0x13')]=router;
\ No newline at end of file
+var _0xc0e3=['update','delete','destroy','multer','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../config/environment','./cloudProvider.controller','get','isAuthenticated','index','show','post','create','put','/:id'];(function(_0x3b1b23,_0x21bccd){var _0x1efc85=function(_0x102a95){while(--_0x102a95){_0x3b1b23['push'](_0x3b1b23['shift']());}};_0x1efc85(++_0x21bccd);}(_0xc0e3,0x1a5));var _0x3c0e=function(_0x2d72ab,_0x5a97f5){_0x2d72ab=_0x2d72ab-0x0;var _0x256423=_0xc0e3[_0x2d72ab];return _0x256423;};'use strict';var multer=require(_0x3c0e('0x0'));var util=require('util');var path=require(_0x3c0e('0x1'));var timeout=require(_0x3c0e('0x2'));var express=require('express');var router=express[_0x3c0e('0x3')]();var fs_extra=require(_0x3c0e('0x4'));var auth=require(_0x3c0e('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x3c0e('0x6'));var controller=require(_0x3c0e('0x7'));router[_0x3c0e('0x8')]('/',auth[_0x3c0e('0x9')](),controller[_0x3c0e('0xa')]);router[_0x3c0e('0x8')]('/:id',auth[_0x3c0e('0x9')](),controller[_0x3c0e('0xb')]);router[_0x3c0e('0xc')]('/',auth[_0x3c0e('0x9')](),controller[_0x3c0e('0xd')]);router[_0x3c0e('0xe')](_0x3c0e('0xf'),auth['isAuthenticated'](),controller[_0x3c0e('0x10')]);router[_0x3c0e('0x11')](_0x3c0e('0xf'),auth['isAuthenticated'](),controller[_0x3c0e('0x12')]);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 4fff228..a316ca7 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 _0x46fb=['name','STRING','sequelize','exports'];(function(_0x5c351c,_0x2046d8){var _0x26f3b3=function(_0x47ac18){while(--_0x47ac18){_0x5c351c['push'](_0x5c351c['shift']());}};_0x26f3b3(++_0x2046d8);}(_0x46fb,0x1ce));var _0xb46f=function(_0x4c3f46,_0x41f5ce){_0x4c3f46=_0x4c3f46-0x0;var _0x3a094a=_0x46fb[_0x4c3f46];return _0x3a094a;};'use strict';var Sequelize=require(_0xb46f('0x0'));module[_0xb46f('0x1')]={'name':{'type':Sequelize['STRING'],'unique':_0xb46f('0x2'),'allowNull':![],'validate':{'notEmpty':!![]}},'vat':{'type':Sequelize[_0xb46f('0x3')]},'companyId':{'type':Sequelize[_0xb46f('0x3')]},'website':{'type':Sequelize['STRING']},'phone':{'type':Sequelize[_0xb46f('0x3')]},'fax':{'type':Sequelize[_0xb46f('0x3')]},'type':{'type':Sequelize[_0xb46f('0x3')]},'street':{'type':Sequelize[_0xb46f('0x3')]},'postalCode':{'type':Sequelize[_0xb46f('0x3')]},'city':{'type':Sequelize[_0xb46f('0x3')]},'country':{'type':Sequelize['STRING']},'email':{'type':Sequelize[_0xb46f('0x3')],'validate':{'isEmail':!![]}},'emailDomain':{'type':Sequelize[_0xb46f('0x3')]},'sStreet':{'type':Sequelize[_0xb46f('0x3')]},'sPostalCode':{'type':Sequelize[_0xb46f('0x3')]},'sCity':{'type':Sequelize[_0xb46f('0x3')]},'sCountry':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0xb46f('0x3')]}};
\ No newline at end of file
+var _0x4635=['sequelize','exports','STRING','name'];(function(_0x3b150c,_0x2f93f8){var _0x5cd414=function(_0x26305e){while(--_0x26305e){_0x3b150c['push'](_0x3b150c['shift']());}};_0x5cd414(++_0x2f93f8);}(_0x4635,0x80));var _0x5463=function(_0x5c638f,_0x176046){_0x5c638f=_0x5c638f-0x0;var _0x5b8b44=_0x4635[_0x5c638f];return _0x5b8b44;};'use strict';var Sequelize=require(_0x5463('0x0'));module[_0x5463('0x1')]={'name':{'type':Sequelize[_0x5463('0x2')],'unique':_0x5463('0x3'),'allowNull':![],'validate':{'notEmpty':!![]}},'vat':{'type':Sequelize[_0x5463('0x2')]},'companyId':{'type':Sequelize[_0x5463('0x2')]},'website':{'type':Sequelize[_0x5463('0x2')]},'phone':{'type':Sequelize[_0x5463('0x2')]},'fax':{'type':Sequelize[_0x5463('0x2')]},'type':{'type':Sequelize[_0x5463('0x2')]},'street':{'type':Sequelize[_0x5463('0x2')]},'postalCode':{'type':Sequelize[_0x5463('0x2')]},'city':{'type':Sequelize['STRING']},'country':{'type':Sequelize['STRING']},'email':{'type':Sequelize[_0x5463('0x2')],'validate':{'isEmail':!![]}},'emailDomain':{'type':Sequelize[_0x5463('0x2')]},'sStreet':{'type':Sequelize[_0x5463('0x2')]},'sPostalCode':{'type':Sequelize['STRING']},'sCity':{'type':Sequelize[_0x5463('0x2')]},'sCountry':{'type':Sequelize[_0x5463('0x2')]},'description':{'type':Sequelize['STRING']}};
\ No newline at end of file
diff --git a/server/api/cmCompany/cmCompany.controller.js b/server/api/cmCompany/cmCompany.controller.js
index 02c88a4..0adc231 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 _0x31f4=['ids','getContacts','findOne','fields','hasOwnProperty','eml-format','rimraf','zip-dir','fast-json-patch','bluebird','mustache','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','json','undefined','limit','count','offset','set','Content-Range','apply','reject','save','update','then','destroy','get','Companies','UserProfileResource','end','error','name','send','index','CmCompany','keys','query','filters','intersection','attributes','length','nolimit','order','sort','where','pick','filter','merge','map','options','include','findAll','rows','catch','params','model','rawAttributes','includeAll','find','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','describe','CmContact','addContacts'];(function(_0x4e6eac,_0x3f4365){var _0x79f963=function(_0x36fc3c){while(--_0x36fc3c){_0x4e6eac['push'](_0x4e6eac['shift']());}};_0x79f963(++_0x3f4365);}(_0x31f4,0xb9));var _0x431f=function(_0x207811,_0x3420a6){_0x207811=_0x207811-0x0;var _0x170d56=_0x31f4[_0x207811];return _0x170d56;};'use strict';var emlformat=require(_0x431f('0x0'));var rimraf=require(_0x431f('0x1'));var zipdir=require(_0x431f('0x2'));var jsonpatch=require(_0x431f('0x3'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x431f('0x4'));var Mustache=require(_0x431f('0x5'));var util=require('util');var path=require('path');var sox=require(_0x431f('0x6'));var csv=require(_0x431f('0x7'));var ejs=require(_0x431f('0x8'));var fs=require('fs');var fs_extra=require(_0x431f('0x9'));var _=require(_0x431f('0xa'));var squel=require(_0x431f('0xb'));var crypto=require(_0x431f('0xc'));var jsforce=require('jsforce');var deskjs=require(_0x431f('0xd'));var toCsv=require(_0x431f('0x7'));var querystring=require('querystring');var Papa=require(_0x431f('0xe'));var Redis=require(_0x431f('0xf'));var authService=require(_0x431f('0x10'));var qs=require(_0x431f('0x11'));var as=require(_0x431f('0x12'));var hardwareService=require(_0x431f('0x13'));var logger=require('../../config/logger')(_0x431f('0x14'));var utils=require(_0x431f('0x15'));var config=require(_0x431f('0x16'));var licenseUtil=require(_0x431f('0x17'));var db=require(_0x431f('0x18'))['db'];function respondWithStatusCode(_0xaa9172,_0x9aace6){_0x9aace6=_0x9aace6||0xcc;return function(_0x275d13){if(_0x275d13){return _0xaa9172[_0x431f('0x19')](_0x9aace6);}return _0xaa9172[_0x431f('0x1a')](_0x9aace6)['end']();};}function respondWithResult(_0x54d8dd,_0x5a4ba2){_0x5a4ba2=_0x5a4ba2||0xc8;return function(_0x4b8fb6){if(_0x4b8fb6){return _0x54d8dd['status'](_0x5a4ba2)[_0x431f('0x1b')](_0x4b8fb6);}};}function respondWithFilteredResult(_0x1cf455,_0x50b751){return function(_0x377333){if(_0x377333){var _0x2af4c7=typeof _0x50b751['offset']===_0x431f('0x1c')&&typeof _0x50b751[_0x431f('0x1d')]===_0x431f('0x1c');var _0xfa8889=_0x377333[_0x431f('0x1e')];var _0x3b29c8=_0x2af4c7?0x0:_0x50b751[_0x431f('0x1f')];var _0x4a5ed3=_0x2af4c7?_0x377333[_0x431f('0x1e')]:_0x50b751[_0x431f('0x1f')]+_0x50b751[_0x431f('0x1d')];var _0x4cff79;if(_0x4a5ed3>=_0xfa8889){_0x4a5ed3=_0xfa8889;_0x4cff79=0xc8;}else{_0x4cff79=0xce;}_0x1cf455[_0x431f('0x1a')](_0x4cff79);return _0x1cf455[_0x431f('0x20')](_0x431f('0x21'),_0x3b29c8+'-'+_0x4a5ed3+'/'+_0xfa8889)[_0x431f('0x1b')](_0x377333);}return null;};}function patchUpdates(_0x466ec4){return function(_0x1e142f){try{jsonpatch[_0x431f('0x22')](_0x1e142f,_0x466ec4,!![]);}catch(_0x32c963){return BPromise[_0x431f('0x23')](_0x32c963);}return _0x1e142f[_0x431f('0x24')]();};}function saveUpdates(_0x56b8e9,_0xd09961){return function(_0x1c515d){if(_0x1c515d){return _0x1c515d[_0x431f('0x25')](_0x56b8e9)[_0x431f('0x26')](function(_0xbc6245){return _0xbc6245;});}return null;};}function removeEntity(_0x5d4967,_0x1b4ce6){return function(_0x3a7b52){if(_0x3a7b52){return _0x3a7b52[_0x431f('0x27')]()[_0x431f('0x26')](function(){var _0x4c876b=_0x3a7b52[_0x431f('0x28')]({'plain':!![]});var _0x4be5e0=_0x431f('0x29');return db[_0x431f('0x2a')][_0x431f('0x27')]({'where':{'type':_0x4be5e0,'resourceId':_0x4c876b['id']}})[_0x431f('0x26')](function(){return _0x3a7b52;});})[_0x431f('0x26')](function(){_0x5d4967[_0x431f('0x1a')](0xcc)[_0x431f('0x2b')]();});}};}function handleEntityNotFound(_0x1b17d6,_0x24e49b){return function(_0x6052dc){if(!_0x6052dc){_0x1b17d6[_0x431f('0x19')](0x194);}return _0x6052dc;};}function handleError(_0x7c652a,_0x27d46b){_0x27d46b=_0x27d46b||0x1f4;return function(_0x30954a){logger[_0x431f('0x2c')](_0x30954a['stack']);if(_0x30954a[_0x431f('0x2d')]){delete _0x30954a['name'];}_0x7c652a['status'](_0x27d46b)[_0x431f('0x2e')](_0x30954a);};}exports[_0x431f('0x2f')]=function(_0x5bb2ea,_0x2fa309){var _0x20c0ea={},_0x5e6b97={},_0x30f274={'count':0x0,'rows':[]};return db[_0x431f('0x30')]['describe']()[_0x431f('0x26')](function(_0x15d657){_0x5e6b97['model']=_[_0x431f('0x31')](_0x15d657);_0x5e6b97[_0x431f('0x32')]=_['keys'](_0x5bb2ea[_0x431f('0x32')]);_0x5e6b97[_0x431f('0x33')]=_[_0x431f('0x34')](_0x5e6b97['model'],_0x5e6b97[_0x431f('0x32')]);_0x20c0ea[_0x431f('0x35')]=_[_0x431f('0x34')](_0x5e6b97['model'],qs['fields'](_0x5bb2ea[_0x431f('0x32')]['fields']));_0x20c0ea[_0x431f('0x35')]=_0x20c0ea[_0x431f('0x35')][_0x431f('0x36')]?_0x20c0ea['attributes']:_0x5e6b97['model'];if(!_0x5bb2ea[_0x431f('0x32')]['hasOwnProperty'](_0x431f('0x37'))){_0x20c0ea[_0x431f('0x1d')]=qs[_0x431f('0x1d')](_0x5bb2ea['query'][_0x431f('0x1d')]);_0x20c0ea[_0x431f('0x1f')]=qs[_0x431f('0x1f')](_0x5bb2ea[_0x431f('0x32')][_0x431f('0x1f')]);}_0x20c0ea[_0x431f('0x38')]=qs['sort'](_0x5bb2ea[_0x431f('0x32')][_0x431f('0x39')]);_0x20c0ea[_0x431f('0x3a')]=qs[_0x431f('0x33')](_[_0x431f('0x3b')](_0x5bb2ea['query'],_0x5e6b97[_0x431f('0x33')]),_0x15d657);if(_0x5bb2ea[_0x431f('0x32')][_0x431f('0x3c')]){_0x20c0ea[_0x431f('0x3a')]=_[_0x431f('0x3d')](_0x20c0ea[_0x431f('0x3a')],{'$or':_[_0x431f('0x3e')](_0x20c0ea['attributes'],function(_0x32165a){var _0x40105e={};_0x40105e[_0x32165a]={'$like':'%'+_0x5bb2ea[_0x431f('0x32')][_0x431f('0x3c')]+'%'};return _0x40105e;})});}_0x20c0ea=_['merge']({},_0x20c0ea,_0x5bb2ea[_0x431f('0x3f')]);var _0x80fe0={'where':_0x20c0ea['where']};return db[_0x431f('0x30')][_0x431f('0x1e')](_0x80fe0)[_0x431f('0x26')](function(_0x1ac8c5){_0x30f274[_0x431f('0x1e')]=_0x1ac8c5;if(_0x5bb2ea[_0x431f('0x32')]['includeAll']){_0x20c0ea[_0x431f('0x40')]=[{'all':!![]}];}return db[_0x431f('0x30')][_0x431f('0x41')](_0x20c0ea);})[_0x431f('0x26')](function(_0x410cde){_0x30f274[_0x431f('0x42')]=_0x410cde;return _0x30f274;})[_0x431f('0x26')](respondWithFilteredResult(_0x2fa309,_0x20c0ea))[_0x431f('0x43')](handleError(_0x2fa309,null));})[_0x431f('0x43')](handleError(_0x2fa309,null));};exports['show']=function(_0x3851bf,_0x582daa){var _0x5ae499={'raw':![],'where':{'id':_0x3851bf[_0x431f('0x44')]['id']}},_0x590c1e={};_0x590c1e[_0x431f('0x45')]=_[_0x431f('0x31')](db[_0x431f('0x30')][_0x431f('0x46')]);_0x590c1e[_0x431f('0x32')]=_[_0x431f('0x31')](_0x3851bf[_0x431f('0x32')]);_0x590c1e['filters']=_[_0x431f('0x34')](_0x590c1e[_0x431f('0x45')],_0x590c1e[_0x431f('0x32')]);_0x5ae499[_0x431f('0x35')]=_[_0x431f('0x34')](_0x590c1e[_0x431f('0x45')],qs['fields'](_0x3851bf['query']['fields']));_0x5ae499[_0x431f('0x35')]=_0x5ae499[_0x431f('0x35')][_0x431f('0x36')]?_0x5ae499[_0x431f('0x35')]:_0x590c1e['model'];if(_0x3851bf[_0x431f('0x32')][_0x431f('0x47')]){_0x5ae499[_0x431f('0x40')]=[{'all':!![]}];}_0x5ae499=_[_0x431f('0x3d')]({},_0x5ae499,_0x3851bf['options']);return db[_0x431f('0x30')][_0x431f('0x48')](_0x5ae499)[_0x431f('0x26')](handleEntityNotFound(_0x582daa,null))[_0x431f('0x26')](respondWithResult(_0x582daa,null))[_0x431f('0x43')](handleError(_0x582daa,null));};exports[_0x431f('0x49')]=function(_0x524e2d,_0x39f509){return db[_0x431f('0x30')][_0x431f('0x49')](_0x524e2d['body'],{})[_0x431f('0x26')](function(_0x1358f4){var _0x35c2f9=_0x524e2d[_0x431f('0x4a')][_0x431f('0x28')]({'plain':!![]});if(!_0x35c2f9)throw new Error(_0x431f('0x4b'));if(_0x35c2f9[_0x431f('0x4c')]==='user'){var _0x7f70c5=_0x1358f4[_0x431f('0x28')]({'plain':!![]});var _0x522c74=_0x431f('0x29');return db[_0x431f('0x4d')]['find']({'where':{'name':_0x522c74,'userProfileId':_0x35c2f9[_0x431f('0x4e')]},'raw':!![]})[_0x431f('0x26')](function(_0x1afb9c){if(_0x1afb9c&&_0x1afb9c[_0x431f('0x4f')]===0x0){return db['UserProfileResource'][_0x431f('0x49')]({'name':_0x7f70c5[_0x431f('0x2d')],'resourceId':_0x7f70c5['id'],'type':_0x1afb9c[_0x431f('0x2d')],'sectionId':_0x1afb9c['id']},{})['then'](function(){return _0x1358f4;});}else{return _0x1358f4;}})[_0x431f('0x43')](function(_0x5a7cea){logger['error'](_0x431f('0x50'),_0x5a7cea);throw _0x5a7cea;});}return _0x1358f4;})[_0x431f('0x26')](respondWithResult(_0x39f509,0xc9))[_0x431f('0x43')](handleError(_0x39f509,null));};exports[_0x431f('0x25')]=function(_0x5da53f,_0x39d627){if(_0x5da53f[_0x431f('0x51')]['id']){delete _0x5da53f['body']['id'];}return db['CmCompany']['find']({'where':{'id':_0x5da53f[_0x431f('0x44')]['id']}})[_0x431f('0x26')](handleEntityNotFound(_0x39d627,null))[_0x431f('0x26')](saveUpdates(_0x5da53f[_0x431f('0x51')],null))[_0x431f('0x26')](respondWithResult(_0x39d627,null))[_0x431f('0x43')](handleError(_0x39d627,null));};exports[_0x431f('0x27')]=function(_0x3f3b97,_0x305e5a){return db[_0x431f('0x30')][_0x431f('0x48')]({'where':{'id':_0x3f3b97['params']['id']}})[_0x431f('0x26')](handleEntityNotFound(_0x305e5a,null))['then'](removeEntity(_0x305e5a,null))['catch'](handleError(_0x305e5a,null));};exports[_0x431f('0x52')]=function(_0x10c2f4,_0x13c320){return db[_0x431f('0x30')][_0x431f('0x52')]()[_0x431f('0x26')](respondWithResult(_0x13c320,null))['catch'](handleError(_0x13c320,null));};exports['addContacts']=function(_0x1caeca,_0x34ce79,_0x32b0a1){return db[_0x431f('0x53')]['find']({'where':{'id':_0x1caeca['params']['id']}})[_0x431f('0x26')](handleEntityNotFound(_0x34ce79,null))['then'](function(_0x2d78e1){if(_0x2d78e1){return _0x2d78e1[_0x431f('0x54')](_0x1caeca[_0x431f('0x51')][_0x431f('0x55')],_['omit'](_0x1caeca[_0x431f('0x51')],[_0x431f('0x55'),'id'])||{});}})[_0x431f('0x26')](respondWithResult(_0x34ce79,null))[_0x431f('0x43')](handleError(_0x34ce79,null));};exports[_0x431f('0x56')]=function(_0x498083,_0x372639,_0x564864){var _0x29be72={};var _0x51fd7b={};var _0x318bd6;var _0x38867b;return db[_0x431f('0x30')][_0x431f('0x57')]({'where':{'id':_0x498083[_0x431f('0x44')]['id']}})[_0x431f('0x26')](handleEntityNotFound(_0x372639,null))[_0x431f('0x26')](function(_0xf5fcdc){if(_0xf5fcdc){_0x318bd6=_0xf5fcdc;_0x51fd7b['model']=_[_0x431f('0x31')](db[_0x431f('0x53')][_0x431f('0x46')]);_0x51fd7b[_0x431f('0x32')]=_[_0x431f('0x31')](_0x498083[_0x431f('0x32')]);_0x51fd7b[_0x431f('0x33')]=_['intersection'](_0x51fd7b[_0x431f('0x45')],_0x51fd7b['query']);_0x29be72[_0x431f('0x35')]=_['intersection'](_0x51fd7b['model'],qs[_0x431f('0x58')](_0x498083[_0x431f('0x32')][_0x431f('0x58')]));_0x29be72['attributes']=_0x29be72[_0x431f('0x35')][_0x431f('0x36')]?_0x29be72['attributes']:_0x51fd7b['model'];_0x29be72[_0x431f('0x38')]=qs[_0x431f('0x39')](_0x498083[_0x431f('0x32')]['sort']);_0x29be72['where']=qs['filters'](_['pick'](_0x498083[_0x431f('0x32')],_0x51fd7b[_0x431f('0x33')]));if(_0x498083[_0x431f('0x32')][_0x431f('0x3c')]){_0x29be72[_0x431f('0x3a')]=_[_0x431f('0x3d')](_0x29be72[_0x431f('0x3a')],{'$or':_['map'](_0x29be72['attributes'],function(_0x1c6402){var _0x6a4591={};_0x6a4591[_0x1c6402]={'$like':'%'+_0x498083[_0x431f('0x32')][_0x431f('0x3c')]+'%'};return _0x6a4591;})});}_0x29be72=_['merge']({},_0x29be72,_0x498083['options']);return _0x318bd6['getContacts'](_0x29be72);}})['then'](function(_0x11be15){if(_0x11be15){_0x38867b=_0x11be15[_0x431f('0x36')];if(!_0x498083['query'][_0x431f('0x59')]('nolimit')){_0x29be72['limit']=qs[_0x431f('0x1d')](_0x498083[_0x431f('0x32')][_0x431f('0x1d')]);_0x29be72[_0x431f('0x1f')]=qs[_0x431f('0x1f')](_0x498083[_0x431f('0x32')][_0x431f('0x1f')]);}return _0x318bd6['getContacts'](_0x29be72);}})[_0x431f('0x26')](function(_0x5a877b){if(_0x5a877b){return _0x5a877b?{'count':_0x38867b,'rows':_0x5a877b}:null;}})['then'](respondWithResult(_0x372639,null))[_0x431f('0x43')](handleError(_0x372639,null));};
\ No newline at end of file
+var _0x0be0=['eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','then','get','Companies','UserProfileResource','destroy','end','stack','name','send','index','describe','model','keys','filters','intersection','query','fields','attributes','length','order','sort','filter','where','merge','map','includeAll','include','CmCompany','findAll','rows','catch','show','params','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','CmContact','addContacts','ids','findOne','rawAttributes','pick','options','getContacts','hasOwnProperty','nolimit'];(function(_0x3aed29,_0x242a8a){var _0x5379ef=function(_0x9c19d5){while(--_0x9c19d5){_0x3aed29['push'](_0x3aed29['shift']());}};_0x5379ef(++_0x242a8a);}(_0x0be0,0x1e0));var _0x00be=function(_0x1035c1,_0x2d8583){_0x1035c1=_0x1035c1-0x0;var _0x308d67=_0x0be0[_0x1035c1];return _0x308d67;};'use strict';var emlformat=require(_0x00be('0x0'));var rimraf=require(_0x00be('0x1'));var zipdir=require(_0x00be('0x2'));var jsonpatch=require(_0x00be('0x3'));var rp=require('request-promise');var moment=require(_0x00be('0x4'));var BPromise=require(_0x00be('0x5'));var Mustache=require(_0x00be('0x6'));var util=require('util');var path=require(_0x00be('0x7'));var sox=require(_0x00be('0x8'));var csv=require(_0x00be('0x9'));var ejs=require(_0x00be('0xa'));var fs=require('fs');var fs_extra=require(_0x00be('0xb'));var _=require(_0x00be('0xc'));var squel=require(_0x00be('0xd'));var crypto=require(_0x00be('0xe'));var jsforce=require(_0x00be('0xf'));var deskjs=require(_0x00be('0x10'));var toCsv=require('to-csv');var querystring=require(_0x00be('0x11'));var Papa=require(_0x00be('0x12'));var Redis=require(_0x00be('0x13'));var authService=require('../../components/auth/service');var qs=require(_0x00be('0x14'));var as=require(_0x00be('0x15'));var hardwareService=require(_0x00be('0x16'));var logger=require(_0x00be('0x17'))(_0x00be('0x18'));var utils=require(_0x00be('0x19'));var config=require(_0x00be('0x1a'));var licenseUtil=require(_0x00be('0x1b'));var db=require(_0x00be('0x1c'))['db'];function respondWithStatusCode(_0x3a1e21,_0x1041e2){_0x1041e2=_0x1041e2||0xcc;return function(_0x493524){if(_0x493524){return _0x3a1e21[_0x00be('0x1d')](_0x1041e2);}return _0x3a1e21[_0x00be('0x1e')](_0x1041e2)['end']();};}function respondWithResult(_0x16718f,_0x592942){_0x592942=_0x592942||0xc8;return function(_0x307142){if(_0x307142){return _0x16718f[_0x00be('0x1e')](_0x592942)[_0x00be('0x1f')](_0x307142);}};}function respondWithFilteredResult(_0x58bdc8,_0x22557b){return function(_0x170535){if(_0x170535){var _0x3b8e5c=typeof _0x22557b[_0x00be('0x20')]===_0x00be('0x21')&&typeof _0x22557b[_0x00be('0x22')]===_0x00be('0x21');var _0x4a5da6=_0x170535[_0x00be('0x23')];var _0x407175=_0x3b8e5c?0x0:_0x22557b[_0x00be('0x20')];var _0x10c331=_0x3b8e5c?_0x170535['count']:_0x22557b[_0x00be('0x20')]+_0x22557b[_0x00be('0x22')];var _0x5c8bfa;if(_0x10c331>=_0x4a5da6){_0x10c331=_0x4a5da6;_0x5c8bfa=0xc8;}else{_0x5c8bfa=0xce;}_0x58bdc8[_0x00be('0x1e')](_0x5c8bfa);return _0x58bdc8[_0x00be('0x24')](_0x00be('0x25'),_0x407175+'-'+_0x10c331+'/'+_0x4a5da6)[_0x00be('0x1f')](_0x170535);}return null;};}function patchUpdates(_0x4f51e9){return function(_0x3d16c2){try{jsonpatch[_0x00be('0x26')](_0x3d16c2,_0x4f51e9,!![]);}catch(_0x126c8a){return BPromise[_0x00be('0x27')](_0x126c8a);}return _0x3d16c2[_0x00be('0x28')]();};}function saveUpdates(_0x5a4c2a,_0x44bd25){return function(_0x433bc4){if(_0x433bc4){return _0x433bc4[_0x00be('0x29')](_0x5a4c2a)[_0x00be('0x2a')](function(_0x290b48){return _0x290b48;});}return null;};}function removeEntity(_0xf7c974,_0x1327a6){return function(_0x326657){if(_0x326657){return _0x326657['destroy']()[_0x00be('0x2a')](function(){var _0x113cbc=_0x326657[_0x00be('0x2b')]({'plain':!![]});var _0x2a9086=_0x00be('0x2c');return db[_0x00be('0x2d')][_0x00be('0x2e')]({'where':{'type':_0x2a9086,'resourceId':_0x113cbc['id']}})[_0x00be('0x2a')](function(){return _0x326657;});})[_0x00be('0x2a')](function(){_0xf7c974[_0x00be('0x1e')](0xcc)[_0x00be('0x2f')]();});}};}function handleEntityNotFound(_0x4f7183,_0xe717ee){return function(_0x5b72e7){if(!_0x5b72e7){_0x4f7183[_0x00be('0x1d')](0x194);}return _0x5b72e7;};}function handleError(_0x4083b7,_0x361592){_0x361592=_0x361592||0x1f4;return function(_0x295f95){logger['error'](_0x295f95[_0x00be('0x30')]);if(_0x295f95[_0x00be('0x31')]){delete _0x295f95[_0x00be('0x31')];}_0x4083b7[_0x00be('0x1e')](_0x361592)[_0x00be('0x32')](_0x295f95);};}exports[_0x00be('0x33')]=function(_0x349391,_0x4aa99b){var _0x23f22b={},_0x1f5bdf={},_0x30f038={'count':0x0,'rows':[]};return db['CmCompany'][_0x00be('0x34')]()[_0x00be('0x2a')](function(_0x27c96f){_0x1f5bdf[_0x00be('0x35')]=_[_0x00be('0x36')](_0x27c96f);_0x1f5bdf['query']=_['keys'](_0x349391['query']);_0x1f5bdf[_0x00be('0x37')]=_[_0x00be('0x38')](_0x1f5bdf[_0x00be('0x35')],_0x1f5bdf[_0x00be('0x39')]);_0x23f22b['attributes']=_[_0x00be('0x38')](_0x1f5bdf[_0x00be('0x35')],qs[_0x00be('0x3a')](_0x349391[_0x00be('0x39')]['fields']));_0x23f22b[_0x00be('0x3b')]=_0x23f22b[_0x00be('0x3b')][_0x00be('0x3c')]?_0x23f22b[_0x00be('0x3b')]:_0x1f5bdf['model'];if(!_0x349391[_0x00be('0x39')]['hasOwnProperty']('nolimit')){_0x23f22b[_0x00be('0x22')]=qs['limit'](_0x349391[_0x00be('0x39')]['limit']);_0x23f22b[_0x00be('0x20')]=qs[_0x00be('0x20')](_0x349391['query']['offset']);}_0x23f22b[_0x00be('0x3d')]=qs[_0x00be('0x3e')](_0x349391[_0x00be('0x39')][_0x00be('0x3e')]);_0x23f22b['where']=qs[_0x00be('0x37')](_['pick'](_0x349391[_0x00be('0x39')],_0x1f5bdf[_0x00be('0x37')]),_0x27c96f);if(_0x349391[_0x00be('0x39')][_0x00be('0x3f')]){_0x23f22b[_0x00be('0x40')]=_[_0x00be('0x41')](_0x23f22b[_0x00be('0x40')],{'$or':_[_0x00be('0x42')](_0x23f22b[_0x00be('0x3b')],function(_0x38ad51){var _0x534ee9={};_0x534ee9[_0x38ad51]={'$like':'%'+_0x349391[_0x00be('0x39')]['filter']+'%'};return _0x534ee9;})});}_0x23f22b=_['merge']({},_0x23f22b,_0x349391['options']);var _0xd04ead={'where':_0x23f22b['where']};return db['CmCompany'][_0x00be('0x23')](_0xd04ead)[_0x00be('0x2a')](function(_0x594bab){_0x30f038[_0x00be('0x23')]=_0x594bab;if(_0x349391['query'][_0x00be('0x43')]){_0x23f22b[_0x00be('0x44')]=[{'all':!![]}];}return db[_0x00be('0x45')][_0x00be('0x46')](_0x23f22b);})[_0x00be('0x2a')](function(_0x41edd6){_0x30f038[_0x00be('0x47')]=_0x41edd6;return _0x30f038;})['then'](respondWithFilteredResult(_0x4aa99b,_0x23f22b))[_0x00be('0x48')](handleError(_0x4aa99b,null));})[_0x00be('0x48')](handleError(_0x4aa99b,null));};exports[_0x00be('0x49')]=function(_0x230418,_0x108ff6){var _0x468104={'raw':![],'where':{'id':_0x230418[_0x00be('0x4a')]['id']}},_0x1a7799={};_0x1a7799['model']=_['keys'](db[_0x00be('0x45')]['rawAttributes']);_0x1a7799[_0x00be('0x39')]=_[_0x00be('0x36')](_0x230418[_0x00be('0x39')]);_0x1a7799['filters']=_[_0x00be('0x38')](_0x1a7799['model'],_0x1a7799[_0x00be('0x39')]);_0x468104['attributes']=_[_0x00be('0x38')](_0x1a7799[_0x00be('0x35')],qs[_0x00be('0x3a')](_0x230418[_0x00be('0x39')]['fields']));_0x468104[_0x00be('0x3b')]=_0x468104['attributes'][_0x00be('0x3c')]?_0x468104[_0x00be('0x3b')]:_0x1a7799[_0x00be('0x35')];if(_0x230418[_0x00be('0x39')][_0x00be('0x43')]){_0x468104[_0x00be('0x44')]=[{'all':!![]}];}_0x468104=_[_0x00be('0x41')]({},_0x468104,_0x230418['options']);return db[_0x00be('0x45')][_0x00be('0x4b')](_0x468104)[_0x00be('0x2a')](handleEntityNotFound(_0x108ff6,null))['then'](respondWithResult(_0x108ff6,null))[_0x00be('0x48')](handleError(_0x108ff6,null));};exports[_0x00be('0x4c')]=function(_0x1261e1,_0x362e5c){return db['CmCompany'][_0x00be('0x4c')](_0x1261e1[_0x00be('0x4d')],{})[_0x00be('0x2a')](function(_0x40bbba){var _0x210445=_0x1261e1[_0x00be('0x4e')][_0x00be('0x2b')]({'plain':!![]});if(!_0x210445)throw new Error(_0x00be('0x4f'));if(_0x210445[_0x00be('0x50')]===_0x00be('0x4e')){var _0x11ea1e=_0x40bbba['get']({'plain':!![]});var _0x43e2e0='Companies';return db[_0x00be('0x51')][_0x00be('0x4b')]({'where':{'name':_0x43e2e0,'userProfileId':_0x210445[_0x00be('0x52')]},'raw':!![]})[_0x00be('0x2a')](function(_0x3d9faf){if(_0x3d9faf&&_0x3d9faf[_0x00be('0x53')]===0x0){return db[_0x00be('0x2d')]['create']({'name':_0x11ea1e['name'],'resourceId':_0x11ea1e['id'],'type':_0x3d9faf[_0x00be('0x31')],'sectionId':_0x3d9faf['id']},{})[_0x00be('0x2a')](function(){return _0x40bbba;});}else{return _0x40bbba;}})[_0x00be('0x48')](function(_0x31f59a){logger[_0x00be('0x54')](_0x00be('0x55'),_0x31f59a);throw _0x31f59a;});}return _0x40bbba;})[_0x00be('0x2a')](respondWithResult(_0x362e5c,0xc9))[_0x00be('0x48')](handleError(_0x362e5c,null));};exports[_0x00be('0x29')]=function(_0x4f042f,_0x164edd){if(_0x4f042f['body']['id']){delete _0x4f042f[_0x00be('0x4d')]['id'];}return db['CmCompany'][_0x00be('0x4b')]({'where':{'id':_0x4f042f[_0x00be('0x4a')]['id']}})['then'](handleEntityNotFound(_0x164edd,null))[_0x00be('0x2a')](saveUpdates(_0x4f042f['body'],null))[_0x00be('0x2a')](respondWithResult(_0x164edd,null))['catch'](handleError(_0x164edd,null));};exports[_0x00be('0x2e')]=function(_0xe32014,_0x2b3940){return db[_0x00be('0x45')][_0x00be('0x4b')]({'where':{'id':_0xe32014[_0x00be('0x4a')]['id']}})[_0x00be('0x2a')](handleEntityNotFound(_0x2b3940,null))[_0x00be('0x2a')](removeEntity(_0x2b3940,null))[_0x00be('0x48')](handleError(_0x2b3940,null));};exports[_0x00be('0x34')]=function(_0x12ca85,_0x495664){return db[_0x00be('0x45')]['describe']()[_0x00be('0x2a')](respondWithResult(_0x495664,null))['catch'](handleError(_0x495664,null));};exports['addContacts']=function(_0x25df21,_0x52509a,_0x118358){return db[_0x00be('0x56')][_0x00be('0x4b')]({'where':{'id':_0x25df21[_0x00be('0x4a')]['id']}})[_0x00be('0x2a')](handleEntityNotFound(_0x52509a,null))[_0x00be('0x2a')](function(_0x143758){if(_0x143758){return _0x143758[_0x00be('0x57')](_0x25df21[_0x00be('0x4d')][_0x00be('0x58')],_['omit'](_0x25df21[_0x00be('0x4d')],[_0x00be('0x58'),'id'])||{});}})[_0x00be('0x2a')](respondWithResult(_0x52509a,null))[_0x00be('0x48')](handleError(_0x52509a,null));};exports['getContacts']=function(_0x2586ed,_0x56fcb9,_0x5c631a){var _0x36371e={};var _0x3d00ae={};var _0x4dfb12;var _0x582f9f;return db[_0x00be('0x45')][_0x00be('0x59')]({'where':{'id':_0x2586ed['params']['id']}})[_0x00be('0x2a')](handleEntityNotFound(_0x56fcb9,null))[_0x00be('0x2a')](function(_0x214081){if(_0x214081){_0x4dfb12=_0x214081;_0x3d00ae[_0x00be('0x35')]=_['keys'](db[_0x00be('0x56')][_0x00be('0x5a')]);_0x3d00ae[_0x00be('0x39')]=_[_0x00be('0x36')](_0x2586ed['query']);_0x3d00ae[_0x00be('0x37')]=_[_0x00be('0x38')](_0x3d00ae[_0x00be('0x35')],_0x3d00ae[_0x00be('0x39')]);_0x36371e[_0x00be('0x3b')]=_['intersection'](_0x3d00ae[_0x00be('0x35')],qs[_0x00be('0x3a')](_0x2586ed[_0x00be('0x39')][_0x00be('0x3a')]));_0x36371e[_0x00be('0x3b')]=_0x36371e[_0x00be('0x3b')][_0x00be('0x3c')]?_0x36371e[_0x00be('0x3b')]:_0x3d00ae[_0x00be('0x35')];_0x36371e[_0x00be('0x3d')]=qs[_0x00be('0x3e')](_0x2586ed['query'][_0x00be('0x3e')]);_0x36371e['where']=qs[_0x00be('0x37')](_[_0x00be('0x5b')](_0x2586ed[_0x00be('0x39')],_0x3d00ae[_0x00be('0x37')]));if(_0x2586ed[_0x00be('0x39')]['filter']){_0x36371e[_0x00be('0x40')]=_[_0x00be('0x41')](_0x36371e[_0x00be('0x40')],{'$or':_['map'](_0x36371e[_0x00be('0x3b')],function(_0x36355e){var _0x31504a={};_0x31504a[_0x36355e]={'$like':'%'+_0x2586ed['query'][_0x00be('0x3f')]+'%'};return _0x31504a;})});}_0x36371e=_[_0x00be('0x41')]({},_0x36371e,_0x2586ed[_0x00be('0x5c')]);return _0x4dfb12[_0x00be('0x5d')](_0x36371e);}})[_0x00be('0x2a')](function(_0x378250){if(_0x378250){_0x582f9f=_0x378250[_0x00be('0x3c')];if(!_0x2586ed[_0x00be('0x39')][_0x00be('0x5e')](_0x00be('0x5f'))){_0x36371e[_0x00be('0x22')]=qs[_0x00be('0x22')](_0x2586ed[_0x00be('0x39')][_0x00be('0x22')]);_0x36371e[_0x00be('0x20')]=qs[_0x00be('0x20')](_0x2586ed[_0x00be('0x39')][_0x00be('0x20')]);}return _0x4dfb12[_0x00be('0x5d')](_0x36371e);}})[_0x00be('0x2a')](function(_0x1c76bf){if(_0x1c76bf){return _0x1c76bf?{'count':_0x582f9f,'rows':_0x1c76bf}:null;}})[_0x00be('0x2a')](respondWithResult(_0x56fcb9,null))['catch'](handleError(_0x56fcb9,null));};
\ No newline at end of file
diff --git a/server/api/cmCompany/cmCompany.model.js b/server/api/cmCompany/cmCompany.model.js
index 680c0de..7952608 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 _0x12cd=['../../config/environment','exports','define','CmCompany','lodash','../../config/logger','api','moment','request-promise','path','rimraf'];(function(_0x352950,_0x280e70){var _0x4dd15e=function(_0x284310){while(--_0x284310){_0x352950['push'](_0x352950['shift']());}};_0x4dd15e(++_0x280e70);}(_0x12cd,0x93));var _0xd12c=function(_0x127536,_0x1ec8e6){_0x127536=_0x127536-0x0;var _0x479510=_0x12cd[_0x127536];return _0x479510;};'use strict';var _=require(_0xd12c('0x0'));var util=require('util');var logger=require(_0xd12c('0x1'))(_0xd12c('0x2'));var moment=require(_0xd12c('0x3'));var BPromise=require('bluebird');var rp=require(_0xd12c('0x4'));var fs=require('fs');var path=require(_0xd12c('0x5'));var rimraf=require(_0xd12c('0x6'));var config=require(_0xd12c('0x7'));var attributes=require('./cmCompany.attributes');module[_0xd12c('0x8')]=function(_0x1ed858,_0x5bd5d5){return _0x1ed858[_0xd12c('0x9')](_0xd12c('0xa'),attributes,{'tableName':'cm_companies','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x2a44=['define','CmCompany','cm_companies','lodash','util','request-promise','path','rimraf','../../config/environment','./cmCompany.attributes','exports'];(function(_0x4cce60,_0x3321e0){var _0x82e062=function(_0x4cb5f8){while(--_0x4cb5f8){_0x4cce60['push'](_0x4cce60['shift']());}};_0x82e062(++_0x3321e0);}(_0x2a44,0x1c6));var _0x42a4=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x2a44[_0x14add3];return _0x4a174f;};'use strict';var _=require(_0x42a4('0x0'));var util=require(_0x42a4('0x1'));var logger=require('../../config/logger')('api');var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x42a4('0x2'));var fs=require('fs');var path=require(_0x42a4('0x3'));var rimraf=require(_0x42a4('0x4'));var config=require(_0x42a4('0x5'));var attributes=require(_0x42a4('0x6'));module[_0x42a4('0x7')]=function(_0x43f4dd,_0x55e3e0){return _0x43f4dd[_0x42a4('0x8')](_0x42a4('0x9'),attributes,{'tableName':_0x42a4('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
diff --git a/server/api/cmCompany/cmCompany.rpc.js b/server/api/cmCompany/cmCompany.rpc.js
index 809eb33..6578a92 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 _0xd45c=['info','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','request','then','CmCompany,\x20%s,\x20%s','request\x20sent','debug','CmCompany,\x20%s,\x20%s,\x20%s','stringify','error','code','message'];(function(_0x5f0089,_0x227e2c){var _0x193892=function(_0x24051f){while(--_0x24051f){_0x5f0089['push'](_0x5f0089['shift']());}};_0x193892(++_0x227e2c);}(_0xd45c,0x121));var _0xcd45=function(_0x59ee6f,_0x450239){_0x59ee6f=_0x59ee6f-0x0;var _0x4c0979=_0xd45c[_0x59ee6f];return _0x4c0979;};'use strict';var _=require(_0xcd45('0x0'));var util=require(_0xcd45('0x1'));var moment=require(_0xcd45('0x2'));var BPromise=require(_0xcd45('0x3'));var rs=require(_0xcd45('0x4'));var fs=require('fs');var Redis=require(_0xcd45('0x5'));var db=require(_0xcd45('0x6'))['db'];var utils=require(_0xcd45('0x7'));var logger=require(_0xcd45('0x8'))(_0xcd45('0x9'));var config=require('../../config/environment');var jayson=require(_0xcd45('0xa'));var client=jayson[_0xcd45('0xb')][_0xcd45('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x2cfd33,_0x5d4097,_0x55c535){return new BPromise(function(_0xb94c6d,_0x4629b1){return client[_0xcd45('0xd')](_0x2cfd33,_0x55c535)[_0xcd45('0xe')](function(_0x1a2602){logger['info'](_0xcd45('0xf'),_0x5d4097,_0xcd45('0x10'));logger[_0xcd45('0x11')](_0xcd45('0x12'),_0x5d4097,_0xcd45('0x10'),JSON[_0xcd45('0x13')](_0x1a2602));if(_0x1a2602[_0xcd45('0x14')]){if(_0x1a2602[_0xcd45('0x14')][_0xcd45('0x15')]===0x1f4){logger['error'](_0xcd45('0xf'),_0x5d4097,_0x1a2602[_0xcd45('0x14')][_0xcd45('0x16')]);return _0x4629b1(_0x1a2602['error'][_0xcd45('0x16')]);}logger['error']('CmCompany,\x20%s,\x20%s',_0x5d4097,_0x1a2602['error'][_0xcd45('0x16')]);return _0xb94c6d(_0x1a2602['error'][_0xcd45('0x16')]);}else{logger[_0xcd45('0x17')](_0xcd45('0xf'),_0x5d4097,'request\x20sent');_0xb94c6d(_0x1a2602[_0xcd45('0x18')]['message']);}})[_0xcd45('0x19')](function(_0x4f5f22){logger[_0xcd45('0x14')](_0xcd45('0xf'),_0x5d4097,_0x4f5f22);_0x4629b1(_0x4f5f22);});});}
\ No newline at end of file
+var _0x49ea=['message','info','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','jayson/promise','client','http','request','then','CmCompany,\x20%s,\x20%s','request\x20sent','debug','CmCompany,\x20%s,\x20%s,\x20%s','error'];(function(_0x3b584b,_0x39dc34){var _0x38559d=function(_0x2cbf9e){while(--_0x2cbf9e){_0x3b584b['push'](_0x3b584b['shift']());}};_0x38559d(++_0x39dc34);}(_0x49ea,0x17e));var _0xa49e=function(_0x2a6059,_0x10e31e){_0x2a6059=_0x2a6059-0x0;var _0x5a4182=_0x49ea[_0x2a6059];return _0x5a4182;};'use strict';var _=require('lodash');var util=require(_0xa49e('0x0'));var moment=require('moment');var BPromise=require(_0xa49e('0x1'));var rs=require(_0xa49e('0x2'));var fs=require('fs');var Redis=require(_0xa49e('0x3'));var db=require(_0xa49e('0x4'))['db'];var utils=require(_0xa49e('0x5'));var logger=require(_0xa49e('0x6'))('rpc');var config=require('../../config/environment');var jayson=require(_0xa49e('0x7'));var client=jayson[_0xa49e('0x8')][_0xa49e('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x147e4f,_0x3a8d3b,_0x217648){return new BPromise(function(_0x448db8,_0x5b4fcd){return client[_0xa49e('0xa')](_0x147e4f,_0x217648)[_0xa49e('0xb')](function(_0x51d3f4){logger['info'](_0xa49e('0xc'),_0x3a8d3b,_0xa49e('0xd'));logger[_0xa49e('0xe')](_0xa49e('0xf'),_0x3a8d3b,_0xa49e('0xd'),JSON['stringify'](_0x51d3f4));if(_0x51d3f4[_0xa49e('0x10')]){if(_0x51d3f4[_0xa49e('0x10')]['code']===0x1f4){logger[_0xa49e('0x10')](_0xa49e('0xc'),_0x3a8d3b,_0x51d3f4[_0xa49e('0x10')]['message']);return _0x5b4fcd(_0x51d3f4[_0xa49e('0x10')][_0xa49e('0x11')]);}logger[_0xa49e('0x10')](_0xa49e('0xc'),_0x3a8d3b,_0x51d3f4[_0xa49e('0x10')][_0xa49e('0x11')]);return _0x448db8(_0x51d3f4[_0xa49e('0x10')][_0xa49e('0x11')]);}else{logger[_0xa49e('0x12')](_0xa49e('0xc'),_0x3a8d3b,_0xa49e('0xd'));_0x448db8(_0x51d3f4['result'][_0xa49e('0x11')]);}})['catch'](function(_0x2e510c){logger[_0xa49e('0x10')]('CmCompany,\x20%s,\x20%s',_0x3a8d3b,_0x2e510c);_0x5b4fcd(_0x2e510c);});});}
\ No newline at end of file
diff --git a/server/api/cmCompany/index.js b/server/api/cmCompany/index.js
index c0e4946..0086f4e 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 _0x35a6=['fs-extra','../../components/auth/service','isAuthenticated','index','get','/describe','describe','/:id','show','/:id/contacts','post','create','addContacts','update','delete','destroy','exports','path','connect-timeout','express','Router'];(function(_0x42e289,_0x1698c6){var _0x4df318=function(_0x5e81f4){while(--_0x5e81f4){_0x42e289['push'](_0x42e289['shift']());}};_0x4df318(++_0x1698c6);}(_0x35a6,0x122));var _0x635a=function(_0x3cef2a,_0x48bc9d){_0x3cef2a=_0x3cef2a-0x0;var _0x4a303b=_0x35a6[_0x3cef2a];return _0x4a303b;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x635a('0x0'));var timeout=require(_0x635a('0x1'));var express=require(_0x635a('0x2'));var router=express[_0x635a('0x3')]();var fs_extra=require(_0x635a('0x4'));var auth=require(_0x635a('0x5'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require('./cmCompany.controller');router['get']('/',auth[_0x635a('0x6')](),controller[_0x635a('0x7')]);router[_0x635a('0x8')](_0x635a('0x9'),auth[_0x635a('0x6')](),controller[_0x635a('0xa')]);router[_0x635a('0x8')](_0x635a('0xb'),auth[_0x635a('0x6')](),controller[_0x635a('0xc')]);router[_0x635a('0x8')](_0x635a('0xd'),auth['isAuthenticated'](),controller['getContacts']);router[_0x635a('0xe')]('/',auth[_0x635a('0x6')](),controller[_0x635a('0xf')]);router['post'](_0x635a('0xd'),auth[_0x635a('0x6')](),controller[_0x635a('0x10')]);router['put']('/:id',auth[_0x635a('0x6')](),controller[_0x635a('0x11')]);router[_0x635a('0x12')](_0x635a('0xb'),auth['isAuthenticated'](),controller[_0x635a('0x13')]);module[_0x635a('0x14')]=router;
\ No newline at end of file
+var _0x9f0e=['/:id/contacts','getContacts','post','create','put','update','delete','destroy','exports','multer','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','get','isAuthenticated','/describe','describe','/:id','show'];(function(_0x55abd9,_0x1148af){var _0x3e5669=function(_0x6f2105){while(--_0x6f2105){_0x55abd9['push'](_0x55abd9['shift']());}};_0x3e5669(++_0x1148af);}(_0x9f0e,0x8d));var _0xe9f0=function(_0x4e9372,_0x1dd466){_0x4e9372=_0x4e9372-0x0;var _0x9e6ff=_0x9f0e[_0x4e9372];return _0x9e6ff;};'use strict';var multer=require(_0xe9f0('0x0'));var util=require('util');var path=require(_0xe9f0('0x1'));var timeout=require(_0xe9f0('0x2'));var express=require(_0xe9f0('0x3'));var router=express['Router']();var fs_extra=require(_0xe9f0('0x4'));var auth=require(_0xe9f0('0x5'));var interaction=require(_0xe9f0('0x6'));var config=require('../../config/environment');var controller=require('./cmCompany.controller');router[_0xe9f0('0x7')]('/',auth[_0xe9f0('0x8')](),controller['index']);router[_0xe9f0('0x7')](_0xe9f0('0x9'),auth[_0xe9f0('0x8')](),controller[_0xe9f0('0xa')]);router[_0xe9f0('0x7')](_0xe9f0('0xb'),auth[_0xe9f0('0x8')](),controller[_0xe9f0('0xc')]);router[_0xe9f0('0x7')](_0xe9f0('0xd'),auth['isAuthenticated'](),controller[_0xe9f0('0xe')]);router[_0xe9f0('0xf')]('/',auth[_0xe9f0('0x8')](),controller[_0xe9f0('0x10')]);router['post'](_0xe9f0('0xd'),auth[_0xe9f0('0x8')](),controller['addContacts']);router[_0xe9f0('0x11')](_0xe9f0('0xb'),auth[_0xe9f0('0x8')](),controller[_0xe9f0('0x12')]);router[_0xe9f0('0x13')](_0xe9f0('0xb'),auth[_0xe9f0('0x8')](),controller[_0xe9f0('0x14')]);module[_0xe9f0('0x15')]=router;
\ No newline at end of file
diff --git a/server/api/cmContact/cmContact.attributes.js b/server/api/cmContact/cmContact.attributes.js
index 56410e4..a73ca1b 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 _0x5f1e=['INTEGER','DATE','exports','STRING','TEXT'];(function(_0x212b8f,_0x1dc017){var _0x39c20f=function(_0x30d9c7){while(--_0x30d9c7){_0x212b8f['push'](_0x212b8f['shift']());}};_0x39c20f(++_0x1dc017);}(_0x5f1e,0x93));var _0xe5f1=function(_0x186021,_0x142635){_0x186021=_0x186021-0x0;var _0x233169=_0x5f1e[_0x186021];return _0x233169;};'use strict';var _=require('lodash');var Sequelize=require('sequelize');module[_0xe5f1('0x0')]={'firstName':{'type':Sequelize[_0xe5f1('0x1')],'allowNull':![]},'lastName':{'type':Sequelize['STRING']},'street':{'type':Sequelize[_0xe5f1('0x1')]},'postalCode':{'type':Sequelize[_0xe5f1('0x1')]},'city':{'type':Sequelize[_0xe5f1('0x1')]},'country':{'type':Sequelize[_0xe5f1('0x1')]},'dateOfBirth':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0xe5f1('0x2')]},'phone':{'type':Sequelize[_0xe5f1('0x1')]},'mobile':{'type':Sequelize[_0xe5f1('0x1')]},'fax':{'type':Sequelize[_0xe5f1('0x1')]},'email':{'type':Sequelize[_0xe5f1('0x1')]},'url':{'type':Sequelize[_0xe5f1('0x1')]},'facebook':{'type':Sequelize[_0xe5f1('0x1')]},'fb_data':{'type':Sequelize['STRING']},'twitter':{'type':Sequelize[_0xe5f1('0x1')]},'skype':{'type':Sequelize[_0xe5f1('0x1')]},'teams':{'type':Sequelize[_0xe5f1('0x1')]},'viber':{'type':Sequelize[_0xe5f1('0x1')]},'line':{'type':Sequelize[_0xe5f1('0x1')]},'wechat':{'type':Sequelize[_0xe5f1('0x1')]},'telegram':{'type':Sequelize[_0xe5f1('0x1')]},'UserId':{'type':Sequelize[_0xe5f1('0x3')]},'priority':{'type':Sequelize['INTEGER'](0x2)['UNSIGNED'],'defaultValue':0x2,'validate':{'min':0x0,'max':0x4}},'scheduledat':{'type':Sequelize[_0xe5f1('0x4')],'defaultValue':Sequelize['NOW']}};
\ No newline at end of file
+var _0x0e8e=['sequelize','exports','STRING','TEXT','INTEGER','NOW','lodash'];(function(_0x3c1ebf,_0x1aab00){var _0x4e2ce8=function(_0x3aa218){while(--_0x3aa218){_0x3c1ebf['push'](_0x3c1ebf['shift']());}};_0x4e2ce8(++_0x1aab00);}(_0x0e8e,0x1f0));var _0xe0e8=function(_0x5427bf,_0xb60e82){_0x5427bf=_0x5427bf-0x0;var _0x180b60=_0x0e8e[_0x5427bf];return _0x180b60;};'use strict';var _=require(_0xe0e8('0x0'));var Sequelize=require(_0xe0e8('0x1'));module[_0xe0e8('0x2')]={'firstName':{'type':Sequelize['STRING'],'allowNull':![]},'lastName':{'type':Sequelize[_0xe0e8('0x3')]},'street':{'type':Sequelize[_0xe0e8('0x3')]},'postalCode':{'type':Sequelize[_0xe0e8('0x3')]},'city':{'type':Sequelize['STRING']},'country':{'type':Sequelize[_0xe0e8('0x3')]},'dateOfBirth':{'type':Sequelize[_0xe0e8('0x3')]},'description':{'type':Sequelize[_0xe0e8('0x4')]},'phone':{'type':Sequelize[_0xe0e8('0x3')]},'mobile':{'type':Sequelize['STRING']},'fax':{'type':Sequelize[_0xe0e8('0x3')]},'email':{'type':Sequelize[_0xe0e8('0x3')]},'url':{'type':Sequelize[_0xe0e8('0x3')]},'facebook':{'type':Sequelize['STRING']},'fb_data':{'type':Sequelize['STRING']},'twitter':{'type':Sequelize[_0xe0e8('0x3')]},'skype':{'type':Sequelize[_0xe0e8('0x3')]},'teams':{'type':Sequelize[_0xe0e8('0x3')]},'viber':{'type':Sequelize[_0xe0e8('0x3')]},'line':{'type':Sequelize['STRING']},'wechat':{'type':Sequelize[_0xe0e8('0x3')]},'telegram':{'type':Sequelize[_0xe0e8('0x3')]},'UserId':{'type':Sequelize[_0xe0e8('0x5')]},'priority':{'type':Sequelize[_0xe0e8('0x5')](0x2)['UNSIGNED'],'defaultValue':0x2,'validate':{'min':0x0,'max':0x4}},'scheduledat':{'type':Sequelize['DATE'],'defaultValue':Sequelize[_0xe0e8('0x6')]}};
\ No newline at end of file
diff --git a/server/api/cmContact/cmContact.controller.js b/server/api/cmContact/cmContact.controller.js
index d1f2210..211d4bf 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 _0x2e2a=['c.firstName','c.lastName','c.phone','c.mobile','c.email','c.ListId','c.deletedAt','c.CompanyId','GROUP_CONCAT(DISTINCT\x20t.id)','TagIds','toString','Tags','rows','catch','params','describe','tags','analytics','CmCustomField','findAll','values','columnName','body','mergeWith','isArray','join','CmHopper','info','[CmContact][merge][destroy][CmHopper],\x20%s','CmHopperBlack','[CmContact][merge][destroy][CmHopperBlack],\x20%s','ChatInteraction','ChatOfflineMessage','MailInteraction','MailMessage','SmsInteraction','SmsMessage','FaxInteraction','FaxMessage','OpenchannelInteraction','OpenchannelMessage','CmHopperFinal','ReportAgentPreview','VoiceCallReport','MailQueueReport','OpenchannelQueueReport','SmsQueueReport','JscriptySessionReport','WhatsappInteraction','WhatsappMessage','create','bulkCreate','each','duplicates','$or','findOrCreate','spread','show','isNil','cf_%d','omit','pickBy','table','id\x20=\x20?','toParam','text','phone','getTags','rawAttributes','pick','options','ids','getHoppers','ContactId','includeAll','include','getHopperHistories','CmHopperHistory','getHopperFinals','getJscriptySessions','No\x20association\x20keys\x20specified!','No\x20association\x20values\x20specified!','socket_timestamp','Unable\x20to\x20synchronize\x20socket,\x20no\x20timestamp\x20passed','binding_keys','No\x20phone\x20column\x20specified','firstName','root','server/files/tmp','file','chmodSync','0777','child_process','fork','../../components/import/cm/csv','binding_values','CompanyId','File\x20uploaded\x20correctly!','pid','createReadStream','meta','import','User','No\x20ListId\x20specified','binding','../../components/import/cm/csv2','stringify','start\x20child\x20process\x20correctly!','exit','error\x20child\x20process','getJourney','mail','sms','openchannel','fax','whatsapp','voice','-createdAt','channel','includes','toLowerCase','Invalid\x20channel','range','isValid','Invalid\x20date\x20for\x20range\x20from\x20filter','Invalid\x20date\x20for\x20range\x20to\x20filter','Invalid\x20createdAt\x20filter','uniqueid','source','callerid','starttime','endtime','note','createdAt','userThirdDisposition','UserId','fullname','findAndCountAll','get','startCase','chat','Website','closed','thirdDisposition','Account','key','Owner','customerIp','customerPort','deviceModel','osName','ratingMessage','ratingValue','referer','subject','substatus','externalUrl','Interaction','flatten','sortBy','slice','bluebird','util','path','squel','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/environment','redis','defaults','localhost','socket.io-emitter','./cmContact.socket','status','json','offset','undefined','count','Content-Range','update','then','destroy','sendStatus','error','stack','name','send','index','CmContact','keys','length','startsWith','cf_','push','findOne','trimStart','all','fieldType','type','model','query','filters','intersection','fields','attributes','hasOwnProperty','nolimit','limit','order','sort','where','select','field','color','from','tools_tags','cm_contacts','left_join','cm_user_has_contacts','uc.CmContactId\x20=\x20c.id','cm_contact_has_tags','ct.CmContactId\x20=\x20c.id','t.id\x20=\x20ct.TagId','c.deletedAt\x20IS\x20NULL','expr','search','parseSearch','conditions','find','Tag','value','split','map','forEach','CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','and','uc.UserId\x20=\x20?','datetime','DATE','buildExpression','end','Contact','isEmpty','ListId','concat','CONCAT_WS(\x27\x20\x27,\x20c.firstName,\x20c.lastName,\x20c.email)\x20LIKE\x20?','tag','filter','getFullTextValue','isNumeric','c.phone\x20LIKE\x20?','c.mobile\x20LIKE\x20?','c.fax\x20LIKE\x20?','isEmail','c.lastName\x20LIKE\x20?','group','c.id','QueryTypes','SELECT','DESC','having','t.id\x20IN\x20?','resolve','user','role','agent','some','c.ListId\x20IS\x20NULL','sequelize','keyBy','merge'];(function(_0x49068e,_0x940512){var _0x3bd529=function(_0x33c5fa){while(--_0x33c5fa){_0x49068e['push'](_0x49068e['shift']());}};_0x3bd529(++_0x940512);}(_0x2e2a,0x1b3));var _0xa2e2=function(_0x49eb44,_0x724f7f){_0x49eb44=_0x49eb44-0x0;var _0x3ba34a=_0x2e2a[_0x49eb44];return _0x3ba34a;};'use strict';var moment=require('moment');var BPromise=require(_0xa2e2('0x0'));var util=require(_0xa2e2('0x1'));var path=require(_0xa2e2('0x2'));var fs=require('fs');var _=require('lodash');var squel=require(_0xa2e2('0x3'));var Papa=require('papaparse');var Redis=require(_0xa2e2('0x4'));var qs=require(_0xa2e2('0x5'));var as=require(_0xa2e2('0x6'));var logger=require(_0xa2e2('0x7'))(_0xa2e2('0x8'));var config=require(_0xa2e2('0x9'));var db=require('../../mysqldb')['db'];config[_0xa2e2('0xa')]=_[_0xa2e2('0xb')](config[_0xa2e2('0xa')],{'host':_0xa2e2('0xc'),'port':0x18eb});var socket=require(_0xa2e2('0xd'))(new Redis(config[_0xa2e2('0xa')]));require(_0xa2e2('0xe'))['register'](socket);function respondWithResult(_0x20052e,_0x598037){_0x598037=_0x598037||0xc8;return function(_0x201854){if(_0x201854){return _0x20052e[_0xa2e2('0xf')](_0x598037)[_0xa2e2('0x10')](_0x201854);}};}function respondWithFilteredResult(_0x2a1ad3,_0x576a0f){return function(_0x3fa8f7){if(_0x3fa8f7){var _0x36ca58=typeof _0x576a0f[_0xa2e2('0x11')]===_0xa2e2('0x12')&&typeof _0x576a0f['limit']==='undefined';var _0x3bedc9=_0x3fa8f7[_0xa2e2('0x13')];var _0x24a623=_0x36ca58?0x0:_0x576a0f[_0xa2e2('0x11')];var _0x19c13c=_0x36ca58?_0x3fa8f7[_0xa2e2('0x13')]:_0x576a0f[_0xa2e2('0x11')]+_0x576a0f['limit'];var _0x318751;if(_0x19c13c>=_0x3bedc9){_0x19c13c=_0x3bedc9;_0x318751=0xc8;}else{_0x318751=0xce;}_0x2a1ad3[_0xa2e2('0xf')](_0x318751);return _0x2a1ad3['set'](_0xa2e2('0x14'),_0x24a623+'-'+_0x19c13c+'/'+_0x3bedc9)[_0xa2e2('0x10')](_0x3fa8f7);}return null;};}function saveUpdates(_0x373387){return function(_0x26e51d){if(_0x26e51d){return _0x26e51d[_0xa2e2('0x15')](_0x373387)[_0xa2e2('0x16')](function(_0x5d7821){return _0x5d7821;});}return null;};}function removeEntity(_0x3d51fa){return function(_0x3fef3b){if(_0x3fef3b){return _0x3fef3b[_0xa2e2('0x17')]()[_0xa2e2('0x16')](function(){_0x3d51fa['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x4d318a){return function(_0x4e0e82){if(!_0x4e0e82){_0x4d318a[_0xa2e2('0x18')](0x194);}return _0x4e0e82;};}function handleError(_0x42f33a,_0x46a456){_0x46a456=_0x46a456||0x1f4;return function(_0x378cae){logger[_0xa2e2('0x19')](_0x378cae[_0xa2e2('0x1a')]);if(_0x378cae[_0xa2e2('0x1b')]){delete _0x378cae[_0xa2e2('0x1b')];}_0x42f33a[_0xa2e2('0xf')](_0x46a456)[_0xa2e2('0x1c')](_0x378cae);};}exports[_0xa2e2('0x1d')]=function(_0x226ab4,_0x51d7c4){var _0x2792ca={},_0x423a95={},_0x24084b={'count':0x0,'rows':[]};return db[_0xa2e2('0x1e')]['describe']()['then'](function(_0x9ec30f){var _0xf63fca=[];for(var _0x14c806=0x0;_0x14c806
','Attachments','gmail','imap.gmail.com','yahoo'];(function(_0x400454,_0x506bbe){var _0x2288cd=function(_0x410bc9){while(--_0x410bc9){_0x400454['push'](_0x400454['shift']());}};_0x2288cd(++_0x506bbe);}(_0x0c3a,0x171));var _0xa0c3=function(_0x1654cd,_0x47919c){_0x1654cd=_0x1654cd-0x0;var _0x40668e=_0x0c3a[_0x1654cd];return _0x40668e;};'use strict';var _=require(_0xa0c3('0x0'));var moment=require(_0xa0c3('0x1'));var random=require(_0xa0c3('0x2'));var fs=require('fs');var path=require(_0xa0c3('0x3'));var util=require(_0xa0c3('0x4'));var tnef=require(_0xa0c3('0x5'));var logger=require(_0xa0c3('0x6'))('email');var config=require(_0xa0c3('0x7'));function getAddress(_0x11e5d4){var _0x5d79bc=_[_0xa0c3('0x8')](_0x11e5d4[_0xa0c3('0x9')]);return _0x5d79bc&&_0x5d79bc['address']?_0x5d79bc[_0xa0c3('0xa')]:'anonymous'+random['generate'](0x6)+_0xa0c3('0xb');}function getFirstName(_0x109c9a){var _0x3b524a=_[_0xa0c3('0x8')](_0x109c9a['value']);if(_0x3b524a&&_0x3b524a[_0xa0c3('0xc')]){if(_0x3b524a[_0xa0c3('0xc')]==_0x3b524a['address']){return _0x3b524a['name'][_0xa0c3('0xd')](0x0,_0x3b524a[_0xa0c3('0xc')]['indexOf']('@'));}var _0x30522f=_0x3b524a[_0xa0c3('0xc')][_0xa0c3('0xe')](/\s+/);return _0x30522f['length']>0x1?_0x30522f[_0xa0c3('0xf')](0x0,-0x1)[_0xa0c3('0x10')]('\x20'):_0x3b524a['name'];}return'Anonymous';}function getLastName(_0x2de54f){var _0x2452d8=_[_0xa0c3('0x8')](_0x2de54f[_0xa0c3('0x9')]);if(_0x2452d8&&_0x2452d8[_0xa0c3('0xc')]){var _0x4bbfcf=_0x2452d8[_0xa0c3('0xc')]['split'](/\s+/);return _0x4bbfcf[_0xa0c3('0x11')]>0x1?_0x4bbfcf['pop']():'';}return'';}function getMails(_0x49983c,_0x4d5c8a){var _0xd70a2b='';for(var _0x474695=0x0;_0x474695<_0x4d5c8a[_0xa0c3('0x9')]['length'];_0x474695+=0x1){if(_0x4d5c8a[_0xa0c3('0x9')][_0x474695][_0xa0c3('0xa')]!==_0x49983c){if(!_[_0xa0c3('0x12')](_0xd70a2b)){_0xd70a2b+=',';}_0xd70a2b+=_0x4d5c8a[_0xa0c3('0x9')][_0x474695][_0xa0c3('0xc')]||_0x4d5c8a[_0xa0c3('0x9')][_0x474695][_0xa0c3('0xa')]||'';_0xd70a2b+='\x20<';_0xd70a2b+=_0x4d5c8a['value'][_0x474695][_0xa0c3('0xa')]?_0x4d5c8a['value'][_0x474695][_0xa0c3('0xa')]:_0xa0c3('0x13')+random[_0xa0c3('0x14')](0x6)+_0xa0c3('0xb');_0xd70a2b+='>';}}return _0xd70a2b;}function parseEmail(_0x53111d,_0x91fd9f,_0x2be9eb){if(_0x91fd9f[_0xa0c3('0x15')]){var _0x1a1c0b=/