From 1c8e6ebc0b9e5aa010c42108b0d10f14a5188c82 Mon Sep 17 00:00:00 2001
From: Andrea Bianco
Date: Sat, 28 Aug 2021 22:26:39 +0200
Subject: [PATCH] Built motion from commit 659b5db5.|2.5.34
---
apidoc/api_project.js | 2 +-
apidoc/api_project.json | 2 +-
server/api/action/action.attributes.js | 2 +-
server/api/action/action.controller.js | 2 +-
server/api/action/action.model.js | 2 +-
server/api/action/action.rpc.js | 2 +-
server/api/action/index.js | 2 +-
.../analyticCustomReport.attributes.js | 2 +-
.../analyticCustomReport.controller.js | 2 +-
.../analyticCustomReport.model.js | 2 +-
.../analyticCustomReport.rpc.js | 2 +-
server/api/analyticCustomReport/index.js | 2 +-
.../analyticDefaultReport.attributes.js | 2 +-
.../analyticDefaultReport.controller.js | 2 +-
.../analyticDefaultReport.model.js | 2 +-
.../analyticDefaultReport.rpc.js | 2 +-
server/api/analyticDefaultReport/index.js | 2 +-
.../analyticExtractedReport.attributes.js | 2 +-
.../analyticExtractedReport.controller.js | 2 +-
.../analyticExtractedReport.model.js | 2 +-
.../analyticExtractedReport.rpc.js | 2 +-
server/api/analyticExtractedReport/index.js | 2 +-
.../analyticFieldReport.attributes.js | 2 +-
.../analyticFieldReport.controller.js | 2 +-
.../analyticFieldReport.model.js | 2 +-
.../analyticFieldReport/analyticFieldReport.rpc.js | 2 +-
server/api/analyticFieldReport/index.js | 2 +-
.../analyticMetric/analyticMetric.attributes.js | 2 +-
.../analyticMetric/analyticMetric.controller.js | 2 +-
server/api/analyticMetric/analyticMetric.model.js | 2 +-
server/api/analyticMetric/analyticMetric.rpc.js | 2 +-
server/api/analyticMetric/index.js | 2 +-
.../analyticTreeReport.attributes.js | 2 +-
.../analyticTreeReport.controller.js | 2 +-
.../analyticTreeReport/analyticTreeReport.model.js | 2 +-
.../analyticTreeReport/analyticTreeReport.rpc.js | 2 +-
server/api/analyticTreeReport/index.js | 2 +-
server/api/attachment/attachment.attributes.js | 2 +-
server/api/attachment/attachment.controller.js | 2 +-
server/api/attachment/attachment.model.js | 2 +-
server/api/attachment/attachment.rpc.js | 2 +-
server/api/attachment/index.js | 2 +-
server/api/authGoogle/authGoogle.controller.js | 2 +-
server/api/authGoogle/index.js | 2 +-
server/api/authLocal/authLocal.controller.js | 2 +-
server/api/authLocal/index.js | 2 +-
server/api/automation/automation.attributes.js | 2 +-
server/api/automation/automation.controller.js | 2 +-
server/api/automation/automation.model.js | 2 +-
server/api/automation/automation.rpc.js | 2 +-
server/api/automation/index.js | 2 +-
server/api/campaign/campaign.attributes.js | 2 +-
server/api/campaign/campaign.controller.js | 2 +-
server/api/campaign/campaign.model.js | 2 +-
server/api/campaign/campaign.rpc.js | 2 +-
server/api/campaign/index.js | 2 +-
server/api/cannedAnswer/cannedAnswer.attributes.js | 2 +-
server/api/cannedAnswer/cannedAnswer.controller.js | 2 +-
server/api/cannedAnswer/cannedAnswer.model.js | 2 +-
server/api/cannedAnswer/cannedAnswer.rpc.js | 2 +-
server/api/cannedAnswer/index.js | 2 +-
server/api/cdr/cdr.attributes.js | 2 +-
server/api/cdr/cdr.controller.js | 2 +-
server/api/cdr/cdr.model.js | 2 +-
server/api/cdr/cdr.rpc.js | 2 +-
server/api/cdr/index.js | 2 +-
.../chatApplication/chatApplication.attributes.js | 2 +-
.../chatApplication/chatApplication.controller.js | 2 +-
.../api/chatApplication/chatApplication.model.js | 2 +-
server/api/chatApplication/chatApplication.rpc.js | 2 +-
server/api/chatApplication/index.js | 2 +-
server/api/chatGroup/chatGroup.attributes.js | 2 +-
server/api/chatGroup/chatGroup.controller.js | 2 +-
server/api/chatGroup/chatGroup.events.js | 2 +-
server/api/chatGroup/chatGroup.model.js | 2 +-
server/api/chatGroup/chatGroup.rpc.js | 2 +-
server/api/chatGroup/chatGroup.socket.js | 2 +-
server/api/chatGroup/index.js | 2 +-
.../chatInteraction/chatInteraction.attributes.js | 2 +-
.../chatInteraction/chatInteraction.controller.js | 2 +-
.../api/chatInteraction/chatInteraction.events.js | 2 +-
.../api/chatInteraction/chatInteraction.model.js | 2 +-
server/api/chatInteraction/chatInteraction.rpc.js | 2 +-
.../api/chatInteraction/chatInteraction.socket.js | 2 +-
server/api/chatInteraction/index.js | 2 +-
.../chatInternalMessage.attributes.js | 2 +-
.../chatInternalMessage.controller.js | 2 +-
.../chatInternalMessage.events.js | 2 +-
.../chatInternalMessage.model.js | 2 +-
.../chatInternalMessage/chatInternalMessage.rpc.js | 2 +-
.../chatInternalMessage.socket.js | 2 +-
server/api/chatInternalMessage/index.js | 2 +-
server/api/chatMessage/chatMessage.attributes.js | 2 +-
server/api/chatMessage/chatMessage.controller.js | 2 +-
server/api/chatMessage/chatMessage.events.js | 2 +-
server/api/chatMessage/chatMessage.model.js | 2 +-
server/api/chatMessage/chatMessage.rpc.js | 2 +-
server/api/chatMessage/chatMessage.socket.js | 2 +-
server/api/chatMessage/index.js | 2 +-
.../chatOfflineMessage.attributes.js | 2 +-
.../chatOfflineMessage.controller.js | 2 +-
.../chatOfflineMessage/chatOfflineMessage.model.js | 2 +-
.../chatOfflineMessage/chatOfflineMessage.rpc.js | 2 +-
server/api/chatOfflineMessage/index.js | 2 +-
.../chatProactiveAction.attributes.js | 2 +-
.../chatProactiveAction.controller.js | 2 +-
.../chatProactiveAction.model.js | 2 +-
.../chatProactiveAction/chatProactiveAction.rpc.js | 2 +-
server/api/chatProactiveAction/index.js | 2 +-
server/api/chatQueue/chatQueue.attributes.js | 2 +-
server/api/chatQueue/chatQueue.controller.js | 2 +-
server/api/chatQueue/chatQueue.events.js | 2 +-
server/api/chatQueue/chatQueue.model.js | 2 +-
server/api/chatQueue/chatQueue.rpc.js | 2 +-
server/api/chatQueue/chatQueue.socket.js | 2 +-
server/api/chatQueue/index.js | 2 +-
.../chatQueueReport/chatQueueReport.attributes.js | 2 +-
.../chatQueueReport/chatQueueReport.controller.js | 2 +-
.../api/chatQueueReport/chatQueueReport.model.js | 2 +-
server/api/chatQueueReport/chatQueueReport.rpc.js | 2 +-
server/api/chatQueueReport/index.js | 2 +-
.../chatTransferReport.attributes.js | 2 +-
.../chatTransferReport.controller.js | 2 +-
.../chatTransferReport/chatTransferReport.model.js | 2 +-
.../chatTransferReport/chatTransferReport.rpc.js | 2 +-
server/api/chatTransferReport/index.js | 2 +-
server/api/chatWebsite/chatWebsite.attributes.js | 2 +-
server/api/chatWebsite/chatWebsite.controller.js | 2 +-
server/api/chatWebsite/chatWebsite.events.js | 2 +-
server/api/chatWebsite/chatWebsite.model.js | 2 +-
server/api/chatWebsite/chatWebsite.rpc.js | 2 +-
server/api/chatWebsite/chatWebsite.socket.js | 2 +-
server/api/chatWebsite/index.js | 2 +-
.../api/cloudProvider/cloudProvider.attributes.js | 2 +-
.../api/cloudProvider/cloudProvider.controller.js | 2 +-
server/api/cloudProvider/cloudProvider.model.js | 2 +-
server/api/cloudProvider/cloudProvider.rpc.js | 2 +-
server/api/cloudProvider/index.js | 2 +-
server/api/cmCompany/cmCompany.attributes.js | 2 +-
server/api/cmCompany/cmCompany.controller.js | 2 +-
server/api/cmCompany/cmCompany.model.js | 2 +-
server/api/cmCompany/cmCompany.rpc.js | 2 +-
server/api/cmCompany/index.js | 2 +-
server/api/cmContact/cmContact.attributes.js | 2 +-
server/api/cmContact/cmContact.controller.js | 2 +-
server/api/cmContact/cmContact.events.js | 2 +-
server/api/cmContact/cmContact.model.js | 2 +-
server/api/cmContact/cmContact.rpc.js | 2 +-
server/api/cmContact/cmContact.socket.js | 2 +-
server/api/cmContact/index.js | 2 +-
.../api/cmCustomField/cmCustomField.attributes.js | 2 +-
.../api/cmCustomField/cmCustomField.controller.js | 2 +-
server/api/cmCustomField/cmCustomField.model.js | 2 +-
server/api/cmCustomField/cmCustomField.rpc.js | 2 +-
server/api/cmCustomField/index.js | 2 +-
server/api/cmHopper/cmHopper.attributes.js | 2 +-
server/api/cmHopper/cmHopper.controller.js | 2 +-
server/api/cmHopper/cmHopper.model.js | 2 +-
server/api/cmHopper/cmHopper.rpc.js | 2 +-
server/api/cmHopper/index.js | 2 +-
.../api/cmHopperBlack/cmHopperBlack.attributes.js | 2 +-
.../api/cmHopperBlack/cmHopperBlack.controller.js | 2 +-
server/api/cmHopperBlack/cmHopperBlack.model.js | 2 +-
server/api/cmHopperBlack/cmHopperBlack.rpc.js | 2 +-
server/api/cmHopperBlack/index.js | 2 +-
.../api/cmHopperFinal/cmHopperFinal.attributes.js | 2 +-
.../api/cmHopperFinal/cmHopperFinal.controller.js | 2 +-
server/api/cmHopperFinal/cmHopperFinal.model.js | 2 +-
server/api/cmHopperFinal/cmHopperFinal.rpc.js | 2 +-
server/api/cmHopperFinal/index.js | 2 +-
.../cmHopperHistory/cmHopperHistory.attributes.js | 2 +-
.../cmHopperHistory/cmHopperHistory.controller.js | 2 +-
.../api/cmHopperHistory/cmHopperHistory.model.js | 2 +-
server/api/cmHopperHistory/cmHopperHistory.rpc.js | 2 +-
server/api/cmHopperHistory/index.js | 2 +-
server/api/cmList/cmList.attributes.js | 2 +-
server/api/cmList/cmList.controller.js | 2 +-
server/api/cmList/cmList.events.js | 2 +-
server/api/cmList/cmList.model.js | 2 +-
server/api/cmList/cmList.rpc.js | 2 +-
server/api/cmList/cmList.socket.js | 2 +-
server/api/cmList/index.js | 2 +-
server/api/condition/condition.attributes.js | 2 +-
server/api/condition/condition.controller.js | 2 +-
server/api/condition/condition.model.js | 2 +-
server/api/condition/condition.rpc.js | 2 +-
server/api/condition/index.js | 2 +-
server/api/dashboard/dashboard.attributes.js | 2 +-
server/api/dashboard/dashboard.controller.js | 2 +-
server/api/dashboard/dashboard.events.js | 2 +-
server/api/dashboard/dashboard.model.js | 2 +-
server/api/dashboard/dashboard.rpc.js | 2 +-
server/api/dashboard/dashboard.socket.js | 2 +-
server/api/dashboard/index.js | 2 +-
.../api/dashboardItem/dashboardItem.attributes.js | 2 +-
.../api/dashboardItem/dashboardItem.controller.js | 2 +-
server/api/dashboardItem/dashboardItem.events.js | 2 +-
server/api/dashboardItem/dashboardItem.model.js | 2 +-
server/api/dashboardItem/dashboardItem.rpc.js | 2 +-
server/api/dashboardItem/dashboardItem.socket.js | 2 +-
server/api/dashboardItem/index.js | 2 +-
server/api/disposition/disposition.attributes.js | 2 +-
server/api/disposition/disposition.controller.js | 2 +-
server/api/disposition/disposition.model.js | 2 +-
server/api/disposition/disposition.rpc.js | 2 +-
server/api/disposition/index.js | 2 +-
server/api/faxAccount/faxAccount.attributes.js | 2 +-
server/api/faxAccount/faxAccount.controller.js | 2 +-
server/api/faxAccount/faxAccount.events.js | 2 +-
server/api/faxAccount/faxAccount.model.js | 2 +-
server/api/faxAccount/faxAccount.rpc.js | 2 +-
server/api/faxAccount/faxAccount.socket.js | 2 +-
server/api/faxAccount/index.js | 2 +-
.../faxApplication/faxApplication.attributes.js | 2 +-
.../faxApplication/faxApplication.controller.js | 2 +-
server/api/faxApplication/faxApplication.model.js | 2 +-
server/api/faxApplication/faxApplication.rpc.js | 2 +-
server/api/faxApplication/index.js | 2 +-
.../faxInteraction/faxInteraction.attributes.js | 2 +-
.../faxInteraction/faxInteraction.controller.js | 2 +-
server/api/faxInteraction/faxInteraction.events.js | 2 +-
server/api/faxInteraction/faxInteraction.model.js | 2 +-
server/api/faxInteraction/faxInteraction.rpc.js | 2 +-
server/api/faxInteraction/faxInteraction.socket.js | 2 +-
server/api/faxInteraction/index.js | 2 +-
server/api/faxMessage/faxMessage.attributes.js | 2 +-
server/api/faxMessage/faxMessage.controller.js | 2 +-
server/api/faxMessage/faxMessage.events.js | 2 +-
server/api/faxMessage/faxMessage.model.js | 2 +-
server/api/faxMessage/faxMessage.rpc.js | 2 +-
server/api/faxMessage/faxMessage.socket.js | 2 +-
server/api/faxMessage/index.js | 2 +-
server/api/faxQueue/faxQueue.attributes.js | 2 +-
server/api/faxQueue/faxQueue.controller.js | 2 +-
server/api/faxQueue/faxQueue.events.js | 2 +-
server/api/faxQueue/faxQueue.model.js | 2 +-
server/api/faxQueue/faxQueue.rpc.js | 2 +-
server/api/faxQueue/faxQueue.socket.js | 2 +-
server/api/faxQueue/index.js | 2 +-
.../faxQueueReport/faxQueueReport.attributes.js | 2 +-
.../faxQueueReport/faxQueueReport.controller.js | 2 +-
server/api/faxQueueReport/faxQueueReport.model.js | 2 +-
server/api/faxQueueReport/faxQueueReport.rpc.js | 2 +-
server/api/faxQueueReport/index.js | 2 +-
.../faxTransferReport.attributes.js | 2 +-
.../faxTransferReport.controller.js | 2 +-
.../faxTransferReport/faxTransferReport.model.js | 2 +-
.../api/faxTransferReport/faxTransferReport.rpc.js | 2 +-
server/api/faxTransferReport/index.js | 2 +-
server/api/intDeskAccount/index.js | 2 +-
.../intDeskAccount/intDeskAccount.attributes.js | 2 +-
.../intDeskAccount/intDeskAccount.controller.js | 2 +-
server/api/intDeskAccount/intDeskAccount.model.js | 2 +-
server/api/intDeskAccount/intDeskAccount.rpc.js | 2 +-
server/api/intDeskConfiguration/index.js | 2 +-
.../intDeskConfiguration.attributes.js | 2 +-
.../intDeskConfiguration.controller.js | 2 +-
.../intDeskConfiguration.model.js | 2 +-
.../intDeskConfiguration.rpc.js | 2 +-
server/api/intDeskField/index.js | 2 +-
server/api/intDeskField/intDeskField.attributes.js | 2 +-
server/api/intDeskField/intDeskField.controller.js | 2 +-
server/api/intDeskField/intDeskField.model.js | 2 +-
server/api/intDeskField/intDeskField.rpc.js | 2 +-
server/api/intDynamics365Account/index.js | 2 +-
.../intDynamics365Account.attributes.js | 2 +-
.../intDynamics365Account.controller.js | 2 +-
.../intDynamics365Account.model.js | 2 +-
.../intDynamics365Account.rpc.js | 2 +-
server/api/intDynamics365Configuration/index.js | 2 +-
.../intDynamics365Configuration.attributes.js | 2 +-
.../intDynamics365Configuration.controller.js | 2 +-
.../intDynamics365Configuration.model.js | 2 +-
.../intDynamics365Configuration.rpc.js | 2 +-
server/api/intDynamics365Field/index.js | 2 +-
.../intDynamics365Field.attributes.js | 2 +-
.../intDynamics365Field.controller.js | 2 +-
.../intDynamics365Field.model.js | 2 +-
.../intDynamics365Field/intDynamics365Field.rpc.js | 2 +-
server/api/intFreshdeskAccount/index.js | 2 +-
.../intFreshdeskAccount.attributes.js | 2 +-
.../intFreshdeskAccount.controller.js | 2 +-
.../intFreshdeskAccount.model.js | 2 +-
.../intFreshdeskAccount/intFreshdeskAccount.rpc.js | 2 +-
server/api/intFreshdeskConfiguration/index.js | 2 +-
.../intFreshdeskConfiguration.attributes.js | 2 +-
.../intFreshdeskConfiguration.controller.js | 2 +-
.../intFreshdeskConfiguration.model.js | 2 +-
.../intFreshdeskConfiguration.rpc.js | 2 +-
server/api/intFreshdeskField/index.js | 2 +-
.../intFreshdeskField.attributes.js | 2 +-
.../intFreshdeskField.controller.js | 2 +-
.../intFreshdeskField/intFreshdeskField.model.js | 2 +-
.../api/intFreshdeskField/intFreshdeskField.rpc.js | 2 +-
server/api/intFreshsalesAccount/index.js | 2 +-
.../intFreshsalesAccount.attributes.js | 2 +-
.../intFreshsalesAccount.controller.js | 2 +-
.../intFreshsalesAccount.model.js | 2 +-
.../intFreshsalesAccount.rpc.js | 2 +-
server/api/intFreshsalesConfiguration/index.js | 2 +-
.../intFreshsalesConfiguration.attributes.js | 2 +-
.../intFreshsalesConfiguration.controller.js | 2 +-
.../intFreshsalesConfiguration.model.js | 2 +-
.../intFreshsalesConfiguration.rpc.js | 2 +-
server/api/intFreshsalesField/index.js | 2 +-
.../intFreshsalesField.attributes.js | 2 +-
.../intFreshsalesField.controller.js | 2 +-
.../intFreshsalesField/intFreshsalesField.model.js | 2 +-
.../intFreshsalesField/intFreshsalesField.rpc.js | 2 +-
server/api/intSalesforceAccount/index.js | 2 +-
.../intSalesforceAccount.attributes.js | 2 +-
.../intSalesforceAccount.controller.js | 2 +-
.../intSalesforceAccount.model.js | 2 +-
.../intSalesforceAccount.rpc.js | 2 +-
server/api/intSalesforceConfiguration/index.js | 2 +-
.../intSalesforceConfiguration.attributes.js | 2 +-
.../intSalesforceConfiguration.controller.js | 2 +-
.../intSalesforceConfiguration.model.js | 2 +-
.../intSalesforceConfiguration.rpc.js | 2 +-
server/api/intSalesforceField/index.js | 2 +-
.../intSalesforceField.attributes.js | 2 +-
.../intSalesforceField.controller.js | 2 +-
.../intSalesforceField/intSalesforceField.model.js | 2 +-
.../intSalesforceField/intSalesforceField.rpc.js | 2 +-
server/api/intServicenowAccount/index.js | 2 +-
.../intServicenowAccount.attributes.js | 2 +-
.../intServicenowAccount.controller.js | 2 +-
.../intServicenowAccount.model.js | 2 +-
.../intServicenowAccount.rpc.js | 2 +-
server/api/intServicenowConfiguration/index.js | 2 +-
.../intServicenowConfiguration.attributes.js | 2 +-
.../intServicenowConfiguration.controller.js | 2 +-
.../intServicenowConfiguration.model.js | 2 +-
.../intServicenowConfiguration.rpc.js | 2 +-
server/api/intServicenowField/index.js | 2 +-
.../intServicenowField.attributes.js | 2 +-
.../intServicenowField.controller.js | 2 +-
.../intServicenowField/intServicenowField.model.js | 2 +-
.../intServicenowField/intServicenowField.rpc.js | 2 +-
server/api/intSugarcrmAccount/index.js | 2 +-
.../intSugarcrmAccount.attributes.js | 2 +-
.../intSugarcrmAccount.controller.js | 2 +-
.../intSugarcrmAccount/intSugarcrmAccount.model.js | 2 +-
.../intSugarcrmAccount/intSugarcrmAccount.rpc.js | 2 +-
server/api/intSugarcrmConfiguration/index.js | 2 +-
.../intSugarcrmConfiguration.attributes.js | 2 +-
.../intSugarcrmConfiguration.controller.js | 2 +-
.../intSugarcrmConfiguration.model.js | 2 +-
.../intSugarcrmConfiguration.rpc.js | 2 +-
server/api/intSugarcrmField/index.js | 2 +-
.../intSugarcrmField.attributes.js | 2 +-
.../intSugarcrmField.controller.js | 2 +-
.../api/intSugarcrmField/intSugarcrmField.model.js | 2 +-
.../api/intSugarcrmField/intSugarcrmField.rpc.js | 2 +-
server/api/intVtigerAccount/index.js | 2 +-
.../intVtigerAccount.attributes.js | 2 +-
.../intVtigerAccount.controller.js | 2 +-
.../api/intVtigerAccount/intVtigerAccount.model.js | 2 +-
.../api/intVtigerAccount/intVtigerAccount.rpc.js | 2 +-
server/api/intVtigerConfiguration/index.js | 2 +-
.../intVtigerConfiguration.attributes.js | 2 +-
.../intVtigerConfiguration.controller.js | 2 +-
.../intVtigerConfiguration.model.js | 2 +-
.../intVtigerConfiguration.rpc.js | 2 +-
server/api/intVtigerField/index.js | 2 +-
.../intVtigerField/intVtigerField.attributes.js | 2 +-
.../intVtigerField/intVtigerField.controller.js | 2 +-
server/api/intVtigerField/intVtigerField.model.js | 2 +-
server/api/intVtigerField/intVtigerField.rpc.js | 2 +-
server/api/intZendeskAccount/index.js | 2 +-
.../intZendeskAccount.attributes.js | 2 +-
.../intZendeskAccount.controller.js | 2 +-
.../intZendeskAccount/intZendeskAccount.model.js | 2 +-
.../api/intZendeskAccount/intZendeskAccount.rpc.js | 2 +-
server/api/intZendeskConfiguration/index.js | 2 +-
.../intZendeskConfiguration.attributes.js | 2 +-
.../intZendeskConfiguration.controller.js | 2 +-
.../intZendeskConfiguration.model.js | 2 +-
.../intZendeskConfiguration.rpc.js | 2 +-
server/api/intZendeskField/index.js | 2 +-
.../intZendeskField/intZendeskField.attributes.js | 2 +-
.../intZendeskField/intZendeskField.controller.js | 2 +-
.../api/intZendeskField/intZendeskField.model.js | 2 +-
server/api/intZendeskField/intZendeskField.rpc.js | 2 +-
server/api/intZohoAccount/index.js | 2 +-
.../intZohoAccount/intZohoAccount.attributes.js | 2 +-
.../intZohoAccount/intZohoAccount.controller.js | 2 +-
server/api/intZohoAccount/intZohoAccount.model.js | 2 +-
server/api/intZohoAccount/intZohoAccount.rpc.js | 2 +-
server/api/intZohoConfiguration/index.js | 2 +-
.../intZohoConfiguration.attributes.js | 2 +-
.../intZohoConfiguration.controller.js | 2 +-
.../intZohoConfiguration.model.js | 2 +-
.../intZohoConfiguration.rpc.js | 2 +-
server/api/intZohoField/index.js | 2 +-
server/api/intZohoField/intZohoField.attributes.js | 2 +-
server/api/intZohoField/intZohoField.controller.js | 2 +-
server/api/intZohoField/intZohoField.model.js | 2 +-
server/api/intZohoField/intZohoField.rpc.js | 2 +-
server/api/integration/index.js | 2 +-
server/api/integration/integration.attributes.js | 2 +-
server/api/integration/integration.controller.js | 2 +-
server/api/integration/integration.model.js | 2 +-
server/api/integration/integration.rpc.js | 2 +-
server/api/integrationReport/index.js | 2 +-
.../integrationReport.attributes.js | 2 +-
.../integrationReport.controller.js | 2 +-
.../integrationReport/integrationReport.model.js | 2 +-
.../api/integrationReport/integrationReport.rpc.js | 2 +-
server/api/interval/index.js | 2 +-
server/api/interval/interval.attributes.js | 2 +-
server/api/interval/interval.controller.js | 2 +-
server/api/interval/interval.model.js | 2 +-
server/api/interval/interval.rpc.js | 2 +-
server/api/jira/index.js | 2 +-
server/api/jira/jira.controller.js | 2 +-
server/api/jscriptyAnswerReport/index.js | 2 +-
.../jscriptyAnswerReport.attributes.js | 2 +-
.../jscriptyAnswerReport.controller.js | 2 +-
.../jscriptyAnswerReport.model.js | 2 +-
.../jscriptyAnswerReport.rpc.js | 2 +-
server/api/jscriptyProject/index.js | 2 +-
.../jscriptyProject/jscriptyProject.attributes.js | 2 +-
.../jscriptyProject/jscriptyProject.controller.js | 2 +-
.../api/jscriptyProject/jscriptyProject.model.js | 2 +-
server/api/jscriptyProject/jscriptyProject.rpc.js | 2 +-
server/api/jscriptyQuestionReport/index.js | 2 +-
.../jscriptyQuestionReport.attributes.js | 2 +-
.../jscriptyQuestionReport.controller.js | 2 +-
.../jscriptyQuestionReport.model.js | 2 +-
.../jscriptyQuestionReport.rpc.js | 2 +-
server/api/jscriptySessionReport/index.js | 2 +-
.../jscriptySessionReport.attributes.js | 2 +-
.../jscriptySessionReport.controller.js | 2 +-
.../jscriptySessionReport.model.js | 2 +-
.../jscriptySessionReport.rpc.js | 2 +-
server/api/license/index.js | 2 +-
server/api/license/license.attributes.js | 2 +-
server/api/license/license.controller.js | 2 +-
server/api/license/license.model.js | 2 +-
server/api/license/license.rpc.js | 2 +-
server/api/mailAccount/index.js | 2 +-
server/api/mailAccount/mailAccount.attributes.js | 2 +-
server/api/mailAccount/mailAccount.controller.js | 2 +-
server/api/mailAccount/mailAccount.events.js | 2 +-
server/api/mailAccount/mailAccount.model.js | 2 +-
server/api/mailAccount/mailAccount.rpc.js | 2 +-
server/api/mailAccount/mailAccount.socket.js | 2 +-
server/api/mailApplication/index.js | 2 +-
.../mailApplication/mailApplication.attributes.js | 2 +-
.../mailApplication/mailApplication.controller.js | 2 +-
.../api/mailApplication/mailApplication.model.js | 2 +-
server/api/mailApplication/mailApplication.rpc.js | 2 +-
server/api/mailInteraction/index.js | 2 +-
.../mailInteraction/mailInteraction.attributes.js | 2 +-
.../mailInteraction/mailInteraction.controller.js | 2 +-
.../api/mailInteraction/mailInteraction.events.js | 2 +-
.../api/mailInteraction/mailInteraction.model.js | 2 +-
server/api/mailInteraction/mailInteraction.rpc.js | 2 +-
.../api/mailInteraction/mailInteraction.socket.js | 2 +-
server/api/mailMessage/index.js | 2 +-
server/api/mailMessage/mailMessage.attributes.js | 2 +-
server/api/mailMessage/mailMessage.controller.js | 2 +-
server/api/mailMessage/mailMessage.events.js | 2 +-
server/api/mailMessage/mailMessage.model.js | 2 +-
server/api/mailMessage/mailMessage.rpc.js | 2 +-
server/api/mailMessage/mailMessage.socket.js | 2 +-
server/api/mailQueue/index.js | 2 +-
server/api/mailQueue/mailQueue.attributes.js | 2 +-
server/api/mailQueue/mailQueue.controller.js | 2 +-
server/api/mailQueue/mailQueue.events.js | 2 +-
server/api/mailQueue/mailQueue.model.js | 2 +-
server/api/mailQueue/mailQueue.rpc.js | 2 +-
server/api/mailQueue/mailQueue.socket.js | 2 +-
server/api/mailQueueReport/index.js | 2 +-
.../mailQueueReport/mailQueueReport.attributes.js | 2 +-
.../mailQueueReport/mailQueueReport.controller.js | 2 +-
.../api/mailQueueReport/mailQueueReport.model.js | 2 +-
server/api/mailQueueReport/mailQueueReport.rpc.js | 2 +-
server/api/mailServerIn/index.js | 2 +-
server/api/mailServerIn/mailServerIn.attributes.js | 2 +-
server/api/mailServerIn/mailServerIn.model.js | 2 +-
server/api/mailServerIn/mailServerIn.rpc.js | 2 +-
server/api/mailServerOut/index.js | 2 +-
.../api/mailServerOut/mailServerOut.attributes.js | 2 +-
.../api/mailServerOut/mailServerOut.controller.js | 2 +-
server/api/mailServerOut/mailServerOut.model.js | 2 +-
server/api/mailServerOut/mailServerOut.rpc.js | 2 +-
server/api/mailSubstatus/index.js | 2 +-
.../api/mailSubstatus/mailSubstatus.attributes.js | 2 +-
.../api/mailSubstatus/mailSubstatus.controller.js | 2 +-
server/api/mailSubstatus/mailSubstatus.model.js | 2 +-
server/api/mailSubstatus/mailSubstatus.rpc.js | 2 +-
server/api/mailTransferReport/index.js | 2 +-
.../mailTransferReport.attributes.js | 2 +-
.../mailTransferReport.controller.js | 2 +-
.../mailTransferReport/mailTransferReport.model.js | 2 +-
.../mailTransferReport/mailTransferReport.rpc.js | 2 +-
server/api/memberReport/index.js | 2 +-
server/api/memberReport/memberReport.attributes.js | 2 +-
server/api/memberReport/memberReport.controller.js | 2 +-
server/api/memberReport/memberReport.model.js | 2 +-
server/api/memberReport/memberReport.rpc.js | 2 +-
server/api/migration/index.js | 2 +-
server/api/migration/migration.attributes.js | 2 +-
server/api/migration/migration.controller.js | 2 +-
server/api/migration/migration.model.js | 2 +-
server/api/migration/migration.rpc.js | 2 +-
server/api/network/index.js | 2 +-
server/api/network/network.attributes.js | 2 +-
server/api/network/network.controller.js | 2 +-
server/api/network/network.model.js | 2 +-
server/api/network/network.rpc.js | 2 +-
server/api/openchannelAccount/index.js | 2 +-
.../openchannelAccount.attributes.js | 2 +-
.../openchannelAccount.controller.js | 2 +-
.../openchannelAccount.events.js | 2 +-
.../openchannelAccount/openchannelAccount.model.js | 2 +-
.../openchannelAccount/openchannelAccount.rpc.js | 2 +-
.../openchannelAccount.socket.js | 2 +-
server/api/openchannelApplication/index.js | 2 +-
.../openchannelApplication.attributes.js | 2 +-
.../openchannelApplication.controller.js | 2 +-
.../openchannelApplication.model.js | 2 +-
.../openchannelApplication.rpc.js | 2 +-
server/api/openchannelInteraction/index.js | 2 +-
.../openchannelInteraction.attributes.js | 2 +-
.../openchannelInteraction.controller.js | 2 +-
.../openchannelInteraction.events.js | 2 +-
.../openchannelInteraction.model.js | 2 +-
.../openchannelInteraction.rpc.js | 2 +-
.../openchannelInteraction.socket.js | 2 +-
server/api/openchannelMessage/index.js | 2 +-
.../openchannelMessage.attributes.js | 2 +-
.../openchannelMessage.controller.js | 2 +-
.../openchannelMessage.events.js | 2 +-
.../openchannelMessage/openchannelMessage.model.js | 2 +-
.../openchannelMessage/openchannelMessage.rpc.js | 2 +-
.../openchannelMessage.socket.js | 2 +-
server/api/openchannelQueue/index.js | 2 +-
.../openchannelQueue.attributes.js | 2 +-
.../openchannelQueue.controller.js | 2 +-
.../openchannelQueue/openchannelQueue.events.js | 2 +-
.../api/openchannelQueue/openchannelQueue.model.js | 2 +-
.../api/openchannelQueue/openchannelQueue.rpc.js | 2 +-
.../openchannelQueue/openchannelQueue.socket.js | 2 +-
server/api/openchannelQueueReport/index.js | 2 +-
.../openchannelQueueReport.attributes.js | 2 +-
.../openchannelQueueReport.controller.js | 2 +-
.../openchannelQueueReport.model.js | 2 +-
.../openchannelQueueReport.rpc.js | 2 +-
server/api/openchannelTransferReport/index.js | 2 +-
.../openchannelTransferReport.attributes.js | 2 +-
.../openchannelTransferReport.controller.js | 2 +-
.../openchannelTransferReport.model.js | 2 +-
.../openchannelTransferReport.rpc.js | 2 +-
server/api/pause/index.js | 2 +-
server/api/pause/pause.attributes.js | 2 +-
server/api/pause/pause.controller.js | 2 +-
server/api/pause/pause.model.js | 2 +-
server/api/pause/pause.rpc.js | 2 +-
server/api/plugin/index.js | 2 +-
server/api/plugin/plugin.attributes.js | 2 +-
server/api/plugin/plugin.controller.js | 2 +-
server/api/plugin/plugin.events.js | 2 +-
server/api/plugin/plugin.model.js | 2 +-
server/api/plugin/plugin.rpc.js | 2 +-
server/api/plugin/plugin.socket.js | 2 +-
server/api/pm2/index.js | 2 +-
server/api/pm2/pm2.controller.js | 2 +-
server/api/realtime/index.js | 2 +-
server/api/realtime/realtime.controller.js | 2 +-
server/api/reportAgentPreview/index.js | 2 +-
.../reportAgentPreview.attributes.js | 2 +-
.../reportAgentPreview/reportAgentPreview.model.js | 2 +-
.../reportAgentPreview/reportAgentPreview.rpc.js | 2 +-
server/api/rpc/index.js | 2 +-
server/api/rpc/rpc.controller.js | 2 +-
server/api/schedule/index.js | 2 +-
server/api/schedule/schedule.attributes.js | 2 +-
server/api/schedule/schedule.controller.js | 2 +-
server/api/schedule/schedule.model.js | 2 +-
server/api/schedule/schedule.rpc.js | 2 +-
server/api/screenRecording/index.js | 2 +-
.../screenRecording/screenRecording.attributes.js | 2 +-
.../screenRecording/screenRecording.controller.js | 2 +-
.../api/screenRecording/screenRecording.model.js | 2 +-
server/api/screenRecording/screenRecording.rpc.js | 2 +-
server/api/setting/index.js | 2 +-
server/api/setting/setting.attributes.js | 2 +-
server/api/setting/setting.controller.js | 2 +-
server/api/setting/setting.model.js | 2 +-
server/api/setting/setting.rpc.js | 2 +-
server/api/smsAccount/index.js | 2 +-
server/api/smsAccount/smsAccount.attributes.js | 2 +-
server/api/smsAccount/smsAccount.controller.js | 2 +-
server/api/smsAccount/smsAccount.events.js | 2 +-
server/api/smsAccount/smsAccount.model.js | 2 +-
server/api/smsAccount/smsAccount.rpc.js | 2 +-
server/api/smsAccount/smsAccount.socket.js | 2 +-
server/api/smsApplication/index.js | 2 +-
.../smsApplication/smsApplication.attributes.js | 2 +-
.../smsApplication/smsApplication.controller.js | 2 +-
server/api/smsApplication/smsApplication.model.js | 2 +-
server/api/smsApplication/smsApplication.rpc.js | 2 +-
server/api/smsInteraction/index.js | 2 +-
.../smsInteraction/smsInteraction.attributes.js | 2 +-
.../smsInteraction/smsInteraction.controller.js | 2 +-
server/api/smsInteraction/smsInteraction.events.js | 2 +-
server/api/smsInteraction/smsInteraction.model.js | 2 +-
server/api/smsInteraction/smsInteraction.rpc.js | 2 +-
server/api/smsInteraction/smsInteraction.socket.js | 2 +-
server/api/smsMessage/index.js | 2 +-
server/api/smsMessage/smsMessage.attributes.js | 2 +-
server/api/smsMessage/smsMessage.controller.js | 2 +-
server/api/smsMessage/smsMessage.events.js | 2 +-
server/api/smsMessage/smsMessage.model.js | 2 +-
server/api/smsMessage/smsMessage.rpc.js | 2 +-
server/api/smsMessage/smsMessage.socket.js | 2 +-
server/api/smsQueue/index.js | 2 +-
server/api/smsQueue/smsQueue.attributes.js | 2 +-
server/api/smsQueue/smsQueue.controller.js | 2 +-
server/api/smsQueue/smsQueue.events.js | 2 +-
server/api/smsQueue/smsQueue.model.js | 2 +-
server/api/smsQueue/smsQueue.rpc.js | 2 +-
server/api/smsQueue/smsQueue.socket.js | 2 +-
server/api/smsQueueReport/index.js | 2 +-
.../smsQueueReport/smsQueueReport.attributes.js | 2 +-
.../smsQueueReport/smsQueueReport.controller.js | 2 +-
server/api/smsQueueReport/smsQueueReport.model.js | 2 +-
server/api/smsQueueReport/smsQueueReport.rpc.js | 2 +-
server/api/smsTransferReport/index.js | 2 +-
.../smsTransferReport.attributes.js | 2 +-
.../smsTransferReport.controller.js | 2 +-
.../smsTransferReport/smsTransferReport.model.js | 2 +-
.../api/smsTransferReport/smsTransferReport.rpc.js | 2 +-
server/api/sound/index.js | 2 +-
server/api/sound/sound.attributes.js | 2 +-
server/api/sound/sound.controller.js | 2 +-
server/api/sound/sound.model.js | 2 +-
server/api/sound/sound.rpc.js | 2 +-
server/api/squareMessage/index.js | 2 +-
.../api/squareMessage/squareMessage.attributes.js | 2 +-
.../api/squareMessage/squareMessage.controller.js | 2 +-
server/api/squareMessage/squareMessage.model.js | 2 +-
server/api/squareMessage/squareMessage.rpc.js | 2 +-
server/api/squareOdbc/index.js | 2 +-
server/api/squareOdbc/squareOdbc.attributes.js | 2 +-
server/api/squareOdbc/squareOdbc.controller.js | 2 +-
server/api/squareOdbc/squareOdbc.model.js | 2 +-
server/api/squareOdbc/squareOdbc.rpc.js | 2 +-
server/api/squareProject/index.js | 2 +-
.../api/squareProject/squareProject.attributes.js | 2 +-
.../api/squareProject/squareProject.controller.js | 2 +-
server/api/squareProject/squareProject.events.js | 2 +-
server/api/squareProject/squareProject.model.js | 2 +-
server/api/squareProject/squareProject.rpc.js | 2 +-
server/api/squareProject/squareProject.socket.js | 2 +-
server/api/squareRecording/index.js | 2 +-
.../squareRecording/squareRecording.attributes.js | 2 +-
.../squareRecording/squareRecording.controller.js | 2 +-
.../api/squareRecording/squareRecording.model.js | 2 +-
server/api/squareRecording/squareRecording.rpc.js | 2 +-
server/api/squareReport/index.js | 2 +-
server/api/squareReport/squareReport.attributes.js | 2 +-
server/api/squareReport/squareReport.controller.js | 2 +-
server/api/squareReport/squareReport.model.js | 2 +-
server/api/squareReport/squareReport.rpc.js | 2 +-
server/api/squareReportDetail/index.js | 2 +-
.../squareReportDetail.attributes.js | 2 +-
.../squareReportDetail.controller.js | 2 +-
.../squareReportDetail/squareReportDetail.model.js | 2 +-
.../squareReportDetail/squareReportDetail.rpc.js | 2 +-
server/api/system/index.js | 2 +-
server/api/system/system.controller.js | 2 +-
server/api/tag/index.js | 2 +-
server/api/tag/tag.attributes.js | 2 +-
server/api/tag/tag.controller.js | 2 +-
server/api/tag/tag.model.js | 2 +-
server/api/tag/tag.rpc.js | 2 +-
server/api/team/index.js | 2 +-
server/api/team/team.attributes.js | 2 +-
server/api/team/team.controller.js | 2 +-
server/api/team/team.events.js | 2 +-
server/api/team/team.model.js | 2 +-
server/api/team/team.rpc.js | 2 +-
server/api/team/team.socket.js | 2 +-
server/api/teamVoiceQueue/index.js | 2 +-
.../teamVoiceQueue/teamVoiceQueue.attributes.js | 2 +-
server/api/teamVoiceQueue/teamVoiceQueue.model.js | 2 +-
server/api/teamVoiceQueue/teamVoiceQueue.rpc.js | 2 +-
server/api/template/index.js | 2 +-
server/api/template/template.attributes.js | 2 +-
server/api/template/template.controller.js | 2 +-
server/api/template/template.model.js | 2 +-
server/api/template/template.rpc.js | 2 +-
server/api/trigger/index.js | 2 +-
server/api/trigger/trigger.attributes.js | 2 +-
server/api/trigger/trigger.controller.js | 2 +-
server/api/trigger/trigger.model.js | 2 +-
server/api/trigger/trigger.rpc.js | 2 +-
server/api/trunk/index.js | 2 +-
server/api/trunk/trunk.attributes.js | 2 +-
server/api/trunk/trunk.controller.js | 2 +-
server/api/trunk/trunk.model.js | 2 +-
server/api/trunk/trunk.rpc.js | 2 +-
server/api/user/index.js | 2 +-
server/api/user/user.attributes.js | 2 +-
server/api/user/user.controller.js | 2 +-
server/api/user/user.events.js | 2 +-
server/api/user/user.model.js | 2 +-
server/api/user/user.rpc.js | 2 +-
server/api/user/user.socket.js | 2 +-
server/api/userChatQueue/index.js | 2 +-
.../api/userChatQueue/userChatQueue.attributes.js | 2 +-
server/api/userChatQueue/userChatQueue.model.js | 2 +-
server/api/userChatQueue/userChatQueue.rpc.js | 2 +-
server/api/userFaxQueue/index.js | 2 +-
server/api/userFaxQueue/userFaxQueue.attributes.js | 2 +-
server/api/userFaxQueue/userFaxQueue.model.js | 2 +-
server/api/userFaxQueue/userFaxQueue.rpc.js | 2 +-
server/api/userMailQueue/index.js | 2 +-
.../api/userMailQueue/userMailQueue.attributes.js | 2 +-
server/api/userMailQueue/userMailQueue.model.js | 2 +-
server/api/userMailQueue/userMailQueue.rpc.js | 2 +-
server/api/userNotification/index.js | 2 +-
.../userNotification.attributes.js | 2 +-
.../userNotification.controller.js | 2 +-
.../userNotification/userNotification.events.js | 2 +-
.../api/userNotification/userNotification.model.js | 2 +-
.../api/userNotification/userNotification.rpc.js | 2 +-
.../userNotification/userNotification.socket.js | 2 +-
server/api/userOpenchannelQueue/index.js | 2 +-
.../userOpenchannelQueue.attributes.js | 2 +-
.../userOpenchannelQueue.model.js | 2 +-
.../userOpenchannelQueue.rpc.js | 2 +-
server/api/userProfile/index.js | 2 +-
server/api/userProfile/userProfile.attributes.js | 2 +-
server/api/userProfile/userProfile.controller.js | 2 +-
server/api/userProfile/userProfile.events.js | 2 +-
server/api/userProfile/userProfile.model.js | 2 +-
server/api/userProfile/userProfile.rpc.js | 2 +-
server/api/userProfile/userProfile.socket.js | 2 +-
server/api/userProfileResource/index.js | 2 +-
.../userProfileResource.attributes.js | 2 +-
.../userProfileResource.controller.js | 2 +-
.../userProfileResource.model.js | 2 +-
.../userProfileResource/userProfileResource.rpc.js | 2 +-
server/api/userProfileSection/index.js | 2 +-
.../userProfileSection.attributes.js | 2 +-
.../userProfileSection.controller.js | 2 +-
.../userProfileSection/userProfileSection.model.js | 2 +-
.../userProfileSection/userProfileSection.rpc.js | 2 +-
server/api/userSmsQueue/index.js | 2 +-
server/api/userSmsQueue/userSmsQueue.attributes.js | 2 +-
server/api/userSmsQueue/userSmsQueue.model.js | 2 +-
server/api/userSmsQueue/userSmsQueue.rpc.js | 2 +-
server/api/userVoiceQueue/index.js | 2 +-
.../userVoiceQueue/userVoiceQueue.attributes.js | 2 +-
server/api/userVoiceQueue/userVoiceQueue.model.js | 2 +-
server/api/userVoiceQueue/userVoiceQueue.rpc.js | 2 +-
server/api/userVoiceQueueRt/index.js | 2 +-
.../userVoiceQueueRt.attributes.js | 2 +-
.../userVoiceQueueRt/userVoiceQueueRt.events.js | 2 +-
.../api/userVoiceQueueRt/userVoiceQueueRt.model.js | 2 +-
.../api/userVoiceQueueRt/userVoiceQueueRt.rpc.js | 2 +-
.../userVoiceQueueRt/userVoiceQueueRt.socket.js | 2 +-
server/api/userWhatsappQueue/index.js | 2 +-
.../userWhatsappQueue.attributes.js | 2 +-
.../userWhatsappQueue/userWhatsappQueue.model.js | 2 +-
.../api/userWhatsappQueue/userWhatsappQueue.rpc.js | 2 +-
server/api/variable/index.js | 2 +-
server/api/variable/variable.attributes.js | 2 +-
server/api/variable/variable.controller.js | 2 +-
server/api/variable/variable.model.js | 2 +-
server/api/variable/variable.rpc.js | 2 +-
server/api/version/index.js | 2 +-
server/api/version/version.controller.js | 2 +-
server/api/voiceAgentReport/index.js | 2 +-
.../voiceAgentReport.attributes.js | 2 +-
.../voiceAgentReport.controller.js | 2 +-
.../api/voiceAgentReport/voiceAgentReport.model.js | 2 +-
.../api/voiceAgentReport/voiceAgentReport.rpc.js | 2 +-
server/api/voiceCallReport/index.js | 2 +-
.../voiceCallReport/voiceCallReport.attributes.js | 2 +-
.../voiceCallReport/voiceCallReport.controller.js | 2 +-
.../api/voiceCallReport/voiceCallReport.model.js | 2 +-
server/api/voiceCallReport/voiceCallReport.rpc.js | 2 +-
server/api/voiceChanSpy/index.js | 2 +-
server/api/voiceChanSpy/voiceChanSpy.attributes.js | 2 +-
server/api/voiceChanSpy/voiceChanSpy.controller.js | 2 +-
server/api/voiceChanSpy/voiceChanSpy.model.js | 2 +-
server/api/voiceChanSpy/voiceChanSpy.rpc.js | 2 +-
server/api/voiceContext/index.js | 2 +-
server/api/voiceContext/voiceContext.attributes.js | 2 +-
server/api/voiceContext/voiceContext.controller.js | 2 +-
server/api/voiceContext/voiceContext.model.js | 2 +-
server/api/voiceContext/voiceContext.rpc.js | 2 +-
server/api/voiceDialReport/index.js | 2 +-
.../voiceDialReport/voiceDialReport.attributes.js | 2 +-
.../voiceDialReport/voiceDialReport.controller.js | 2 +-
.../api/voiceDialReport/voiceDialReport.model.js | 2 +-
server/api/voiceDialReport/voiceDialReport.rpc.js | 2 +-
server/api/voiceExtension/index.js | 2 +-
.../voiceExtension/voiceExtension.attributes.js | 2 +-
.../voiceExtension/voiceExtension.controller.js | 2 +-
server/api/voiceExtension/voiceExtension.events.js | 2 +-
server/api/voiceExtension/voiceExtension.model.js | 2 +-
server/api/voiceExtension/voiceExtension.rpc.js | 2 +-
server/api/voiceExtension/voiceExtension.socket.js | 2 +-
server/api/voiceMail/index.js | 2 +-
server/api/voiceMail/voiceMail.attributes.js | 2 +-
server/api/voiceMail/voiceMail.controller.js | 2 +-
server/api/voiceMail/voiceMail.model.js | 2 +-
server/api/voiceMail/voiceMail.rpc.js | 2 +-
server/api/voiceMailMessage/index.js | 2 +-
.../voiceMailMessage.attributes.js | 2 +-
.../voiceMailMessage.controller.js | 2 +-
.../api/voiceMailMessage/voiceMailMessage.model.js | 2 +-
.../api/voiceMailMessage/voiceMailMessage.rpc.js | 2 +-
server/api/voiceMusicOnHold/index.js | 2 +-
.../voiceMusicOnHold.attributes.js | 2 +-
.../voiceMusicOnHold.controller.js | 2 +-
.../api/voiceMusicOnHold/voiceMusicOnHold.model.js | 2 +-
.../api/voiceMusicOnHold/voiceMusicOnHold.rpc.js | 2 +-
server/api/voicePrefix/index.js | 2 +-
server/api/voicePrefix/voicePrefix.attributes.js | 2 +-
server/api/voicePrefix/voicePrefix.controller.js | 2 +-
server/api/voicePrefix/voicePrefix.events.js | 2 +-
server/api/voicePrefix/voicePrefix.model.js | 2 +-
server/api/voicePrefix/voicePrefix.rpc.js | 2 +-
server/api/voicePrefix/voicePrefix.socket.js | 2 +-
server/api/voiceQueue/index.js | 2 +-
server/api/voiceQueue/voiceQueue.attributes.js | 2 +-
server/api/voiceQueue/voiceQueue.controller.js | 2 +-
server/api/voiceQueue/voiceQueue.events.js | 2 +-
server/api/voiceQueue/voiceQueue.model.js | 2 +-
server/api/voiceQueue/voiceQueue.rpc.js | 2 +-
server/api/voiceQueue/voiceQueue.socket.js | 2 +-
server/api/voiceQueueReport/index.js | 2 +-
.../voiceQueueReport.attributes.js | 2 +-
.../voiceQueueReport.controller.js | 2 +-
.../voiceQueueReport/voiceQueueReport.events.js | 2 +-
.../api/voiceQueueReport/voiceQueueReport.model.js | 2 +-
.../api/voiceQueueReport/voiceQueueReport.rpc.js | 2 +-
.../voiceQueueReport/voiceQueueReport.socket.js | 2 +-
server/api/voiceQueuesLog/index.js | 2 +-
.../voiceQueuesLog/voiceQueuesLog.attributes.js | 2 +-
.../voiceQueuesLog/voiceQueuesLog.controller.js | 2 +-
server/api/voiceQueuesLog/voiceQueuesLog.model.js | 2 +-
server/api/voiceQueuesLog/voiceQueuesLog.rpc.js | 2 +-
server/api/voiceRecording/index.js | 2 +-
.../voiceRecording/voiceRecording.attributes.js | 2 +-
.../voiceRecording/voiceRecording.controller.js | 2 +-
server/api/voiceRecording/voiceRecording.model.js | 2 +-
server/api/voiceRecording/voiceRecording.rpc.js | 2 +-
server/api/voiceTransferReport/index.js | 2 +-
.../voiceTransferReport.attributes.js | 2 +-
.../voiceTransferReport.controller.js | 2 +-
.../voiceTransferReport.model.js | 2 +-
.../voiceTransferReport/voiceTransferReport.rpc.js | 2 +-
server/api/webbar/index.js | 2 +-
server/api/webbar/webbar.controller.js | 2 +-
server/api/whatsappAccount/index.js | 2 +-
.../whatsappAccount/whatsappAccount.attributes.js | 2 +-
.../whatsappAccount/whatsappAccount.controller.js | 2 +-
.../api/whatsappAccount/whatsappAccount.events.js | 2 +-
.../api/whatsappAccount/whatsappAccount.model.js | 2 +-
server/api/whatsappAccount/whatsappAccount.rpc.js | 2 +-
.../api/whatsappAccount/whatsappAccount.socket.js | 2 +-
server/api/whatsappApplication/index.js | 2 +-
.../whatsappApplication.attributes.js | 2 +-
.../whatsappApplication.controller.js | 2 +-
.../whatsappApplication.model.js | 2 +-
.../whatsappApplication/whatsappApplication.rpc.js | 2 +-
server/api/whatsappInteraction/index.js | 2 +-
.../whatsappInteraction.attributes.js | 2 +-
.../whatsappInteraction.controller.js | 2 +-
.../whatsappInteraction.events.js | 2 +-
.../whatsappInteraction.model.js | 2 +-
.../whatsappInteraction/whatsappInteraction.rpc.js | 2 +-
.../whatsappInteraction.socket.js | 2 +-
server/api/whatsappMessage/index.js | 2 +-
.../whatsappMessage/whatsappMessage.attributes.js | 2 +-
.../whatsappMessage/whatsappMessage.controller.js | 2 +-
.../api/whatsappMessage/whatsappMessage.events.js | 2 +-
.../api/whatsappMessage/whatsappMessage.model.js | 2 +-
server/api/whatsappMessage/whatsappMessage.rpc.js | 2 +-
.../api/whatsappMessage/whatsappMessage.socket.js | 2 +-
server/api/whatsappQueue/index.js | 2 +-
.../api/whatsappQueue/whatsappQueue.attributes.js | 2 +-
.../api/whatsappQueue/whatsappQueue.controller.js | 2 +-
server/api/whatsappQueue/whatsappQueue.events.js | 2 +-
server/api/whatsappQueue/whatsappQueue.model.js | 2 +-
server/api/whatsappQueue/whatsappQueue.rpc.js | 2 +-
server/api/whatsappQueue/whatsappQueue.socket.js | 2 +-
server/api/whatsappQueueReport/index.js | 2 +-
.../whatsappQueueReport.attributes.js | 2 +-
.../whatsappQueueReport.controller.js | 2 +-
.../whatsappQueueReport.model.js | 2 +-
.../whatsappQueueReport/whatsappQueueReport.rpc.js | 2 +-
server/api/whatsappTransferReport/index.js | 2 +-
.../whatsappTransferReport.attributes.js | 2 +-
.../whatsappTransferReport.controller.js | 2 +-
.../whatsappTransferReport.model.js | 2 +-
.../whatsappTransferReport.rpc.js | 2 +-
server/app.js | 2 +-
server/components/auth/service.js | 2 +-
server/components/encryptor/index.js | 2 +-
server/components/export/csv.js | 2 +-
server/components/export/pdf.js | 2 +-
server/components/export/xlsx.js | 2 +-
server/components/extensions/rewrite.js | 2 +-
server/components/import/cm/csv.js | 2 +-
server/components/import/cm/csv2.js | 2 +-
server/components/integrations/configuration.js | 2 +-
server/components/interaction/service.js | 2 +-
server/components/license/service.js | 2 +-
server/components/parsers/advancedSearch.js | 2 +-
server/components/parsers/qs.js | 2 +-
server/config/express.js | 2 +-
server/config/license/hardware.js | 2 +-
server/config/license/index.js | 2 +-
server/config/license/util.js | 2 +-
server/config/local.env.js | 2 +-
server/config/logger.js | 2 +-
server/config/pm2/config.js | 2 +-
server/config/pm2/index.js | 2 +-
server/config/schedule/chat.js | 2 +-
server/config/schedule/index.js | 2 +-
server/config/schedule/transcribe.js | 2 +-
server/config/schedule/whatsapp.js | 2 +-
server/config/seedContact.js | 2 +-
server/config/seedUsers.js | 2 +-
server/config/socketio.js | 2 +-
server/config/triggers/index.js | 2 +-
server/config/utils.js | 2 +-
server/errors/index.js | 2 +-
server/mysqldb/index.js | 2 +-
server/routes.js | 2 +-
server/rpc/index.js | 2 +-
server/services/agi/channel.js | 2 +-
server/services/agi/error.js | 2 +-
server/services/agi/graph/index.js | 2 +-
server/services/agi/index.js | 2 +-
server/services/agi/mailRpc/index.js | 2 +-
server/services/agi/reply.js | 2 +-
server/services/agi/rpc/index.js | 2 +-
server/services/agi/scripts/aws/index.js | 2 +-
server/services/agi/scripts/aws/lex/index.js | 2 +-
server/services/agi/scripts/aws/lex/lib/api.js | 2 +-
server/services/agi/scripts/aws/polly/index.js | 2 +-
server/services/agi/scripts/aws/polly/lib/api.js | 2 +-
server/services/agi/scripts/google/asr/index.js | 2 +-
server/services/agi/scripts/google/asr/lib/api.js | 2 +-
server/services/agi/scripts/google/index.js | 2 +-
server/services/agi/scripts/index.js | 2 +-
server/services/agi/scripts/sestek/index.js | 2 +-
server/services/agi/scripts/sestek/nda/index.js | 2 +-
server/services/agi/scripts/tilde/asr/index.js | 2 +-
server/services/agi/scripts/tilde/asr/lib/api.js | 2 +-
server/services/agi/scripts/tilde/index.js | 2 +-
server/services/agi/server.js | 2 +-
server/services/agi/vertices.js | 2 +-
server/services/ami/acw/index.js | 2 +-
server/services/ami/ami.js | 2 +-
server/services/ami/client.js | 2 +-
server/services/ami/dialer/action.js | 2 +-
server/services/ami/dialer/agentComplete.js | 2 +-
server/services/ami/dialer/final.js | 2 +-
server/services/ami/dialer/hangup.js | 2 +-
server/services/ami/dialer/history.js | 2 +-
server/services/ami/dialer/index.js | 2 +-
server/services/ami/dialer/queueCallerAbandon.js | 2 +-
server/services/ami/fax/action.js | 2 +-
server/services/ami/fax/index.js | 2 +-
server/services/ami/fax/rpcDb.js | 2 +-
server/services/ami/fax/util/gs.js | 2 +-
server/services/ami/fax/util/util.js | 2 +-
server/services/ami/index.js | 2 +-
server/services/ami/model/agent.js | 2 +-
server/services/ami/model/campaign.js | 2 +-
server/services/ami/model/channel.js | 2 +-
server/services/ami/model/deskAccount.js | 2 +-
server/services/ami/model/dynamics365Account.js | 2 +-
server/services/ami/model/faxAccount.js | 2 +-
server/services/ami/model/freshdeskAccount.js | 2 +-
server/services/ami/model/freshsalesAccount.js | 2 +-
server/services/ami/model/queueReport.js | 2 +-
server/services/ami/model/salesforceAccount.js | 2 +-
server/services/ami/model/servicenowAccount.js | 2 +-
server/services/ami/model/sugarcrmAccount.js | 2 +-
server/services/ami/model/telephone.js | 2 +-
server/services/ami/model/template.js | 2 +-
server/services/ami/model/trigger.js | 2 +-
server/services/ami/model/trunk.js | 2 +-
server/services/ami/model/voiceExtension.js | 2 +-
server/services/ami/model/voiceQueue.js | 2 +-
server/services/ami/model/vtigerAccount.js | 2 +-
server/services/ami/model/zendeskAccount.js | 2 +-
server/services/ami/model/zohoAccount.js | 2 +-
server/services/ami/preview/action.js | 2 +-
server/services/ami/preview/index.js | 2 +-
server/services/ami/preview/rpcDb.js | 2 +-
server/services/ami/preview/util/util.js | 2 +-
server/services/ami/properties.js | 2 +-
server/services/ami/realtime/index.js | 2 +-
server/services/ami/report/index.js | 2 +-
server/services/ami/report/userReport.js | 2 +-
server/services/ami/report/voiceAgentReport.js | 2 +-
server/services/ami/report/voiceCallReport.js | 2 +-
server/services/ami/report/voiceDialReport.js | 2 +-
server/services/ami/report/voiceQueueReport.js | 2 +-
server/services/ami/rpc/agentReportPreview.js | 2 +-
server/services/ami/rpc/attachment.js | 2 +-
server/services/ami/rpc/campaign.js | 2 +-
server/services/ami/rpc/cmContact.js | 2 +-
server/services/ami/rpc/cmHopper.js | 2 +-
server/services/ami/rpc/cmHopperBlack.js | 2 +-
server/services/ami/rpc/cmHopperFinal.js | 2 +-
server/services/ami/rpc/cmHopperHistory.js | 2 +-
server/services/ami/rpc/faxAccount.js | 2 +-
server/services/ami/rpc/faxMessage.js | 2 +-
server/services/ami/rpc/integrations/desk.js | 2 +-
.../services/ami/rpc/integrations/dynamics365.js | 2 +-
server/services/ami/rpc/integrations/freshdesk.js | 2 +-
server/services/ami/rpc/integrations/freshsales.js | 2 +-
server/services/ami/rpc/integrations/salesforce.js | 2 +-
server/services/ami/rpc/integrations/servicenow.js | 2 +-
server/services/ami/rpc/integrations/sugarcrm.js | 2 +-
server/services/ami/rpc/integrations/vtiger.js | 2 +-
server/services/ami/rpc/integrations/zendesk.js | 2 +-
server/services/ami/rpc/integrations/zoho.js | 2 +-
server/services/ami/rpc/memberReport.js | 2 +-
server/services/ami/rpc/setting.js | 2 +-
server/services/ami/rpc/template.js | 2 +-
server/services/ami/rpc/trigger.js | 2 +-
server/services/ami/rpc/trunk.js | 2 +-
server/services/ami/rpc/user.js | 2 +-
server/services/ami/rpc/voiceAgentReport.js | 2 +-
server/services/ami/rpc/voiceCallReport.js | 2 +-
server/services/ami/rpc/voiceDialReport.js | 2 +-
server/services/ami/rpc/voiceExtension.js | 2 +-
server/services/ami/rpc/voiceQueue.js | 2 +-
server/services/ami/rpc/voiceQueueReport.js | 2 +-
server/services/ami/rpc/voiceQueueRt.js | 2 +-
server/services/ami/rpc/voiceRecording.js | 2 +-
server/services/ami/rpc/voiceTransferReport.js | 2 +-
server/services/ami/server/index.js | 2 +-
server/services/ami/trigger/cmContact/index.js | 2 +-
server/services/ami/trigger/index.js | 2 +-
server/services/ami/trigger/integration/desk.js | 2 +-
.../ami/trigger/integration/dynamics365.js | 2 +-
.../services/ami/trigger/integration/freshdesk.js | 2 +-
.../services/ami/trigger/integration/freshsales.js | 2 +-
server/services/ami/trigger/integration/index.js | 2 +-
.../services/ami/trigger/integration/salesforce.js | 2 +-
.../services/ami/trigger/integration/servicenow.js | 2 +-
.../services/ami/trigger/integration/sugarcrm.js | 2 +-
server/services/ami/trigger/integration/util.js | 2 +-
server/services/ami/trigger/integration/vtiger.js | 2 +-
server/services/ami/trigger/integration/zendesk.js | 2 +-
server/services/ami/trigger/integration/zoho.js | 2 +-
server/services/ami/trigger/script/index.js | 2 +-
server/services/ami/trigger/urlforward/index.js | 2 +-
server/services/email/client.js | 2 +-
server/services/email/index.js | 2 +-
server/services/email/lib/email.js | 2 +-
server/services/email/lib/imap.js | 2 +-
server/services/email/lib/smtp.js | 2 +-
server/services/email/lib/utils.js | 2 +-
server/services/email/model/mailAccount.js | 2 +-
server/services/email/realtime/index.js | 2 +-
server/services/email/rpc/mailAccount.js | 2 +-
server/services/email/rpc/setting.js | 2 +-
server/services/email/server/index.js | 2 +-
server/services/express/index.js | 2 +-
server/services/routing/client.js | 2 +-
server/services/routing/index.js | 2 +-
server/services/routing/lib/rule-engine.js | 2 +-
server/services/routing/mailRpc/index.js | 2 +-
server/services/routing/model/agent.js | 2 +-
server/services/routing/model/chatQueue.js | 2 +-
server/services/routing/model/faxQueue.js | 2 +-
server/services/routing/model/interval.js | 2 +-
server/services/routing/model/mailQueue.js | 2 +-
server/services/routing/model/openchannelQueue.js | 2 +-
server/services/routing/model/smsQueue.js | 2 +-
server/services/routing/model/whatsappQueue.js | 2 +-
server/services/routing/realtime/index.js | 2 +-
server/services/routing/rpc/chatInteraction.js | 2 +-
server/services/routing/rpc/chatMessage.js | 2 +-
server/services/routing/rpc/chatQueue.js | 2 +-
server/services/routing/rpc/chatQueueReport.js | 2 +-
server/services/routing/rpc/faxInteraction.js | 2 +-
server/services/routing/rpc/faxMessage.js | 2 +-
server/services/routing/rpc/faxQueue.js | 2 +-
server/services/routing/rpc/faxQueueReport.js | 2 +-
server/services/routing/rpc/interval.js | 2 +-
server/services/routing/rpc/mailInteraction.js | 2 +-
server/services/routing/rpc/mailMessage.js | 2 +-
server/services/routing/rpc/mailQueue.js | 2 +-
server/services/routing/rpc/mailQueueReport.js | 2 +-
.../services/routing/rpc/openchannelInteraction.js | 2 +-
server/services/routing/rpc/openchannelMessage.js | 2 +-
server/services/routing/rpc/openchannelQueue.js | 2 +-
.../services/routing/rpc/openchannelQueueReport.js | 2 +-
server/services/routing/rpc/smsInteraction.js | 2 +-
server/services/routing/rpc/smsMessage.js | 2 +-
server/services/routing/rpc/smsQueue.js | 2 +-
server/services/routing/rpc/smsQueueReport.js | 2 +-
server/services/routing/rpc/user.js | 2 +-
server/services/routing/rpc/whatsappInteraction.js | 2 +-
server/services/routing/rpc/whatsappMessage.js | 2 +-
server/services/routing/rpc/whatsappQueue.js | 2 +-
server/services/routing/rpc/whatsappQueueReport.js | 2 +-
.../services/routing/server/applications/agent.js | 2 +-
.../routing/server/applications/amazonlex.js | 2 +-
.../routing/server/applications/autoreply.js | 2 +-
.../services/routing/server/applications/close.js | 2 +-
.../routing/server/applications/dialogflow.js | 2 +-
.../routing/server/applications/dialogflowV2.js | 2 +-
.../services/routing/server/applications/gotoif.js | 2 +-
.../services/routing/server/applications/gotop.js | 2 +-
.../routing/server/applications/message.js | 2 +-
.../services/routing/server/applications/noop.js | 2 +-
.../services/routing/server/applications/queue.js | 2 +-
.../routing/server/applications/strategy/agent.js | 2 +-
.../server/applications/strategy/beepall.js | 2 +-
.../routing/server/applications/strategy/index.js | 2 +-
.../server/applications/strategy/rrmemory.js | 2 +-
.../routing/server/applications/strategy/util.js | 2 +-
.../services/routing/server/applications/system.js | 2 +-
server/services/routing/server/applications/tag.js | 2 +-
.../services/routing/server/applications/utils.js | 2 +-
server/services/routing/server/index.js | 2 +-
server/services/routing/server/interval.js | 2 +-
server/services/xdr/agents.controller.js | 2 +-
server/services/xdr/calls.controller.js | 2 +-
server/services/xdr/core.controller.js | 2 +-
server/services/xdr/dials.controller.js | 2 +-
server/services/xdr/index.js | 2 +-
server/services/xdr/members.controller.js | 2 +-
server/services/xdr/queues.controller.js | 2 +-
server/services/xdr/recordings.controller.js | 2 +-
server/services/xdr/transfers.controller.js | 2 +-
server/services/xdr/utils.js | 2 +-
1147 files changed, 1147 insertions(+), 1147 deletions(-)
diff --git a/apidoc/api_project.js b/apidoc/api_project.js
index 8f28f1d..8423e89 100644
--- a/apidoc/api_project.js
+++ b/apidoc/api_project.js
@@ -17,7 +17,7 @@ define({
"apidoc": "0.3.0",
"generator": {
"name": "apidoc",
- "time": "2021-08-28T11:47:33.992Z",
+ "time": "2021-08-28T20:08:55.546Z",
"url": "http://apidocjs.com",
"version": "0.24.0"
}
diff --git a/apidoc/api_project.json b/apidoc/api_project.json
index 347c685..f774686 100644
--- a/apidoc/api_project.json
+++ b/apidoc/api_project.json
@@ -17,7 +17,7 @@
"apidoc": "0.3.0",
"generator": {
"name": "apidoc",
- "time": "2021-08-28T11:47:33.992Z",
+ "time": "2021-08-28T20:08:55.546Z",
"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 547e2d6..092e9f1 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 _0x235e=['exports','getDataValue','STRING','contactManager','integration','motionbar','jscripty','browser','bot','script','Allowed\x20values:\x20contactManager,\x20integration,\x20motionbar,\x20jscripty,\x20urlForward,\x20browser,\x20bot,\x20script','contactManager[ListId],\x20integration[intName(zendesk)],\x20motionbar[Popup(0),URL(1),WinApp(2)],\x20urlForward[GET,POST],\x20browser[TemplateId(0),URL(1)]','motionbar[NULL,NULL,WinAppArguments]','TEXT','sequelize'];(function(_0x32c274,_0x109c6a){var _0x57021d=function(_0x13627d){while(--_0x13627d){_0x32c274['push'](_0x32c274['shift']());}};_0x57021d(++_0x109c6a);}(_0x235e,0x68));var _0xe235=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x235e[_0x3dd15e];return _0x231fd0;};'use strict';var Sequelize=require(_0xe235('0x0'));module[_0xe235('0x1')]={'name':{'type':Sequelize['VIRTUAL'],'get':function(_0x5362fb){return this[_0xe235('0x2')]('action');}},'action':{'type':Sequelize[_0xe235('0x3')],'allowNull':![],'validate':{'isIn':{'args':[[_0xe235('0x4'),_0xe235('0x5'),_0xe235('0x6'),_0xe235('0x7'),'urlForward',_0xe235('0x8'),_0xe235('0x9'),_0xe235('0xa')]],'msg':'Allowed\x20values:\x20contactManager,\x20integration,\x20motionbar,\x20jscripty,\x20urlForward,\x20browser,\x20bot,\x20script'}},'comment':_0xe235('0xb')},'data1':{'type':Sequelize[_0xe235('0x3')](0x1000),'comment':_0xe235('0xc')},'data2':{'type':Sequelize[_0xe235('0x3')](0x1000),'comment':'integration[AccountId],\x20motionbar[TemplateId,URL,WinAppPath],\x20urlForward[URL]'},'data3':{'type':Sequelize[_0xe235('0x3')](0x1000),'comment':_0xe235('0xd')},'data4':{'type':Sequelize[_0xe235('0x3')](0x1000)},'data5':{'type':Sequelize[_0xe235('0x3')](0x1000)},'data6':{'type':Sequelize[_0xe235('0x3')]},'data7':{'type':Sequelize[_0xe235('0xe')]}};
\ No newline at end of file
+var _0x97d5=['browser','bot','script','Allowed\x20values:\x20contactManager,\x20integration,\x20motionbar,\x20jscripty,\x20urlForward,\x20browser,\x20bot,\x20script','contactManager[ListId],\x20integration[intName(zendesk)],\x20motionbar[Popup(0),URL(1),WinApp(2)],\x20urlForward[GET,POST],\x20browser[TemplateId(0),URL(1)]','motionbar[NULL,NULL,WinAppArguments]','TEXT','sequelize','VIRTUAL','getDataValue','action','STRING','contactManager','integration','motionbar','jscripty'];(function(_0x56825b,_0x172b8d){var _0x69ce77=function(_0x348a1c){while(--_0x348a1c){_0x56825b['push'](_0x56825b['shift']());}};_0x69ce77(++_0x172b8d);}(_0x97d5,0x67));var _0x597d=function(_0x5810cf,_0xcffeda){_0x5810cf=_0x5810cf-0x0;var _0x3b76dc=_0x97d5[_0x5810cf];return _0x3b76dc;};'use strict';var Sequelize=require(_0x597d('0x0'));module['exports']={'name':{'type':Sequelize[_0x597d('0x1')],'get':function(_0x397bf2){return this[_0x597d('0x2')](_0x597d('0x3'));}},'action':{'type':Sequelize[_0x597d('0x4')],'allowNull':![],'validate':{'isIn':{'args':[[_0x597d('0x5'),_0x597d('0x6'),_0x597d('0x7'),_0x597d('0x8'),'urlForward',_0x597d('0x9'),_0x597d('0xa'),_0x597d('0xb')]],'msg':_0x597d('0xc')}},'comment':'Allowed\x20values:\x20contactManager,\x20integration,\x20motionbar,\x20jscripty,\x20urlForward,\x20browser,\x20bot,\x20script'},'data1':{'type':Sequelize[_0x597d('0x4')](0x1000),'comment':_0x597d('0xd')},'data2':{'type':Sequelize['STRING'](0x1000),'comment':'integration[AccountId],\x20motionbar[TemplateId,URL,WinAppPath],\x20urlForward[URL]'},'data3':{'type':Sequelize[_0x597d('0x4')](0x1000),'comment':_0x597d('0xe')},'data4':{'type':Sequelize[_0x597d('0x4')](0x1000)},'data5':{'type':Sequelize[_0x597d('0x4')](0x1000)},'data6':{'type':Sequelize['STRING']},'data7':{'type':Sequelize[_0x597d('0xf')]}};
\ No newline at end of file
diff --git a/server/api/action/action.controller.js b/server/api/action/action.controller.js
index c688ebf..6e6ed71 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 _0xb90d=['desk.js','papaparse','ioredis','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','status','json','offset','undefined','count','limit','set','Content-Range','reject','save','update','then','destroy','end','sendStatus','error','stack','name','body','Action','find','params','catch','eml-format','zip-dir','fast-json-patch','request-promise','moment','mustache','path','sox','to-csv','ejs','fs-extra','squel','crypto','jsforce'];(function(_0x1c207b,_0x27c1d8){var _0x1f9acf=function(_0x3931c2){while(--_0x3931c2){_0x1c207b['push'](_0x1c207b['shift']());}};_0x1f9acf(++_0x27c1d8);}(_0xb90d,0xdd));var _0xdb90=function(_0x4f96b4,_0x22cc57){_0x4f96b4=_0x4f96b4-0x0;var _0x67821b=_0xb90d[_0x4f96b4];return _0x67821b;};'use strict';var emlformat=require(_0xdb90('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xdb90('0x1'));var jsonpatch=require(_0xdb90('0x2'));var rp=require(_0xdb90('0x3'));var moment=require(_0xdb90('0x4'));var BPromise=require('bluebird');var Mustache=require(_0xdb90('0x5'));var util=require('util');var path=require(_0xdb90('0x6'));var sox=require(_0xdb90('0x7'));var csv=require(_0xdb90('0x8'));var ejs=require(_0xdb90('0x9'));var fs=require('fs');var fs_extra=require(_0xdb90('0xa'));var _=require('lodash');var squel=require(_0xdb90('0xb'));var crypto=require(_0xdb90('0xc'));var jsforce=require(_0xdb90('0xd'));var deskjs=require(_0xdb90('0xe'));var toCsv=require(_0xdb90('0x8'));var querystring=require('querystring');var Papa=require(_0xdb90('0xf'));var Redis=require(_0xdb90('0x10'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0xdb90('0x11'));var hardwareService=require(_0xdb90('0x12'));var logger=require(_0xdb90('0x13'))(_0xdb90('0x14'));var utils=require(_0xdb90('0x15'));var config=require('../../config/environment');var licenseUtil=require(_0xdb90('0x16'));var db=require(_0xdb90('0x17'))['db'];function respondWithStatusCode(_0xe9da1c,_0xe5e957){_0xe5e957=_0xe5e957||0xcc;return function(_0x13c68c){if(_0x13c68c){return _0xe9da1c['sendStatus'](_0xe5e957);}return _0xe9da1c[_0xdb90('0x18')](_0xe5e957)['end']();};}function respondWithResult(_0x5187c1,_0x1f42e4){_0x1f42e4=_0x1f42e4||0xc8;return function(_0x3b6b4b){if(_0x3b6b4b){return _0x5187c1[_0xdb90('0x18')](_0x1f42e4)[_0xdb90('0x19')](_0x3b6b4b);}};}function respondWithFilteredResult(_0x547f3a,_0x5a48e4){return function(_0x175059){if(_0x175059){var _0x99875e=typeof _0x5a48e4[_0xdb90('0x1a')]===_0xdb90('0x1b')&&typeof _0x5a48e4['limit']==='undefined';var _0x31ddec=_0x175059[_0xdb90('0x1c')];var _0x53e8bc=_0x99875e?0x0:_0x5a48e4['offset'];var _0x1c5b05=_0x99875e?_0x175059['count']:_0x5a48e4['offset']+_0x5a48e4[_0xdb90('0x1d')];var _0x7a0e39;if(_0x1c5b05>=_0x31ddec){_0x1c5b05=_0x31ddec;_0x7a0e39=0xc8;}else{_0x7a0e39=0xce;}_0x547f3a[_0xdb90('0x18')](_0x7a0e39);return _0x547f3a[_0xdb90('0x1e')](_0xdb90('0x1f'),_0x53e8bc+'-'+_0x1c5b05+'/'+_0x31ddec)['json'](_0x175059);}return null;};}function patchUpdates(_0x21e7ef){return function(_0x589b78){try{jsonpatch['apply'](_0x589b78,_0x21e7ef,!![]);}catch(_0x1c4812){return BPromise[_0xdb90('0x20')](_0x1c4812);}return _0x589b78[_0xdb90('0x21')]();};}function saveUpdates(_0x24c402,_0x5c6e19){return function(_0x2eefd1){if(_0x2eefd1){return _0x2eefd1[_0xdb90('0x22')](_0x24c402)[_0xdb90('0x23')](function(_0x2ed361){return _0x2ed361;});}return null;};}function removeEntity(_0x4f11d0,_0x249a01){return function(_0x3adf18){if(_0x3adf18){return _0x3adf18[_0xdb90('0x24')]()[_0xdb90('0x23')](function(){_0x4f11d0[_0xdb90('0x18')](0xcc)[_0xdb90('0x25')]();});}};}function handleEntityNotFound(_0x4d5e9d,_0x5e4068){return function(_0x16e519){if(!_0x16e519){_0x4d5e9d[_0xdb90('0x26')](0x194);}return _0x16e519;};}function handleError(_0x200eb4,_0x376a1b){_0x376a1b=_0x376a1b||0x1f4;return function(_0x397824){logger[_0xdb90('0x27')](_0x397824[_0xdb90('0x28')]);if(_0x397824[_0xdb90('0x29')]){delete _0x397824[_0xdb90('0x29')];}_0x200eb4[_0xdb90('0x18')](_0x376a1b)['send'](_0x397824);};}exports[_0xdb90('0x22')]=function(_0x444ea3,_0x24b85d){if(_0x444ea3[_0xdb90('0x2a')]['id']){delete _0x444ea3[_0xdb90('0x2a')]['id'];}return db[_0xdb90('0x2b')][_0xdb90('0x2c')]({'where':{'id':_0x444ea3[_0xdb90('0x2d')]['id']}})[_0xdb90('0x23')](handleEntityNotFound(_0x24b85d,null))[_0xdb90('0x23')](saveUpdates(_0x444ea3[_0xdb90('0x2a')],null))[_0xdb90('0x23')](respondWithResult(_0x24b85d,null))[_0xdb90('0x2e')](handleError(_0x24b85d,null));};exports[_0xdb90('0x24')]=function(_0xf053b4,_0xabcc8b){return db[_0xdb90('0x2b')][_0xdb90('0x2c')]({'where':{'id':_0xf053b4[_0xdb90('0x2d')]['id']}})['then'](handleEntityNotFound(_0xabcc8b,null))[_0xdb90('0x23')](removeEntity(_0xabcc8b,null))['catch'](handleError(_0xabcc8b,null));};
\ No newline at end of file
+var _0x4e6e=['ioredis','../../components/parsers/qs','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','sendStatus','status','end','offset','undefined','limit','count','set','json','apply','reject','then','error','stack','name','send','update','body','Action','params','catch','destroy','find','eml-format','rimraf','fast-json-patch','bluebird','mustache','util','sox','to-csv','lodash','squel','crypto','desk.js','querystring','papaparse'];(function(_0xd55fa0,_0x4132ec){var _0xb428ea=function(_0x44ab55){while(--_0x44ab55){_0xd55fa0['push'](_0xd55fa0['shift']());}};_0xb428ea(++_0x4132ec);}(_0x4e6e,0x76));var _0xe4e6=function(_0x17d9e3,_0x1f969c){_0x17d9e3=_0x17d9e3-0x0;var _0x14192d=_0x4e6e[_0x17d9e3];return _0x14192d;};'use strict';var emlformat=require(_0xe4e6('0x0'));var rimraf=require(_0xe4e6('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xe4e6('0x2'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0xe4e6('0x3'));var Mustache=require(_0xe4e6('0x4'));var util=require(_0xe4e6('0x5'));var path=require('path');var sox=require(_0xe4e6('0x6'));var csv=require(_0xe4e6('0x7'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xe4e6('0x8'));var squel=require(_0xe4e6('0x9'));var crypto=require(_0xe4e6('0xa'));var jsforce=require('jsforce');var deskjs=require(_0xe4e6('0xb'));var toCsv=require(_0xe4e6('0x7'));var querystring=require(_0xe4e6('0xc'));var Papa=require(_0xe4e6('0xd'));var Redis=require(_0xe4e6('0xe'));var authService=require('../../components/auth/service');var qs=require(_0xe4e6('0xf'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xe4e6('0x10'));var logger=require(_0xe4e6('0x11'))('api');var utils=require(_0xe4e6('0x12'));var config=require(_0xe4e6('0x13'));var licenseUtil=require(_0xe4e6('0x14'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x61c38a,_0x5462fa){_0x5462fa=_0x5462fa||0xcc;return function(_0xf60862){if(_0xf60862){return _0x61c38a[_0xe4e6('0x15')](_0x5462fa);}return _0x61c38a[_0xe4e6('0x16')](_0x5462fa)[_0xe4e6('0x17')]();};}function respondWithResult(_0x272e76,_0x5b508c){_0x5b508c=_0x5b508c||0xc8;return function(_0x5de6ea){if(_0x5de6ea){return _0x272e76['status'](_0x5b508c)['json'](_0x5de6ea);}};}function respondWithFilteredResult(_0xb6e9eb,_0x1276ac){return function(_0x14c8fa){if(_0x14c8fa){var _0x24a963=typeof _0x1276ac[_0xe4e6('0x18')]===_0xe4e6('0x19')&&typeof _0x1276ac[_0xe4e6('0x1a')]===_0xe4e6('0x19');var _0x17550e=_0x14c8fa[_0xe4e6('0x1b')];var _0x47a03a=_0x24a963?0x0:_0x1276ac[_0xe4e6('0x18')];var _0x5546bd=_0x24a963?_0x14c8fa[_0xe4e6('0x1b')]:_0x1276ac[_0xe4e6('0x18')]+_0x1276ac['limit'];var _0x1e587e;if(_0x5546bd>=_0x17550e){_0x5546bd=_0x17550e;_0x1e587e=0xc8;}else{_0x1e587e=0xce;}_0xb6e9eb[_0xe4e6('0x16')](_0x1e587e);return _0xb6e9eb[_0xe4e6('0x1c')]('Content-Range',_0x47a03a+'-'+_0x5546bd+'/'+_0x17550e)[_0xe4e6('0x1d')](_0x14c8fa);}return null;};}function patchUpdates(_0x16c2cf){return function(_0x1d0032){try{jsonpatch[_0xe4e6('0x1e')](_0x1d0032,_0x16c2cf,!![]);}catch(_0x399db2){return BPromise[_0xe4e6('0x1f')](_0x399db2);}return _0x1d0032['save']();};}function saveUpdates(_0x43de2f,_0x244755){return function(_0x2a4ff5){if(_0x2a4ff5){return _0x2a4ff5['update'](_0x43de2f)[_0xe4e6('0x20')](function(_0x2c0c2d){return _0x2c0c2d;});}return null;};}function removeEntity(_0x5edb77,_0x245593){return function(_0x251623){if(_0x251623){return _0x251623['destroy']()[_0xe4e6('0x20')](function(){_0x5edb77[_0xe4e6('0x16')](0xcc)[_0xe4e6('0x17')]();});}};}function handleEntityNotFound(_0x3dcded,_0x2368aa){return function(_0xf2fd67){if(!_0xf2fd67){_0x3dcded[_0xe4e6('0x15')](0x194);}return _0xf2fd67;};}function handleError(_0x54fecd,_0x3a5fd0){_0x3a5fd0=_0x3a5fd0||0x1f4;return function(_0x2a19cc){logger[_0xe4e6('0x21')](_0x2a19cc[_0xe4e6('0x22')]);if(_0x2a19cc['name']){delete _0x2a19cc[_0xe4e6('0x23')];}_0x54fecd[_0xe4e6('0x16')](_0x3a5fd0)[_0xe4e6('0x24')](_0x2a19cc);};}exports[_0xe4e6('0x25')]=function(_0x2164c4,_0x1a45e4){if(_0x2164c4[_0xe4e6('0x26')]['id']){delete _0x2164c4[_0xe4e6('0x26')]['id'];}return db[_0xe4e6('0x27')]['find']({'where':{'id':_0x2164c4[_0xe4e6('0x28')]['id']}})[_0xe4e6('0x20')](handleEntityNotFound(_0x1a45e4,null))[_0xe4e6('0x20')](saveUpdates(_0x2164c4['body'],null))['then'](respondWithResult(_0x1a45e4,null))[_0xe4e6('0x29')](handleError(_0x1a45e4,null));};exports[_0xe4e6('0x2a')]=function(_0x2316e6,_0x16208a){return db[_0xe4e6('0x27')][_0xe4e6('0x2b')]({'where':{'id':_0x2316e6[_0xe4e6('0x28')]['id']}})[_0xe4e6('0x20')](handleEntityNotFound(_0x16208a,null))['then'](removeEntity(_0x16208a,null))[_0xe4e6('0x29')](handleError(_0x16208a,null));};
\ No newline at end of file
diff --git a/server/api/action/action.model.js b/server/api/action/action.model.js
index a3c9adc..3e047e7 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 _0x2700=['path','../../config/environment','define','Action','tools_actions','lodash','util','api','moment','bluebird','request-promise'];(function(_0x4a9fb1,_0x273043){var _0x348672=function(_0x142b69){while(--_0x142b69){_0x4a9fb1['push'](_0x4a9fb1['shift']());}};_0x348672(++_0x273043);}(_0x2700,0xc0));var _0x0270=function(_0x373b46,_0x3eebe1){_0x373b46=_0x373b46-0x0;var _0xe580cb=_0x2700[_0x373b46];return _0xe580cb;};'use strict';var _=require(_0x0270('0x0'));var util=require(_0x0270('0x1'));var logger=require('../../config/logger')(_0x0270('0x2'));var moment=require(_0x0270('0x3'));var BPromise=require(_0x0270('0x4'));var rp=require(_0x0270('0x5'));var fs=require('fs');var path=require(_0x0270('0x6'));var rimraf=require('rimraf');var config=require(_0x0270('0x7'));var attributes=require('./action.attributes');module['exports']=function(_0x4bbd1d,_0x3404cf){return _0x4bbd1d[_0x0270('0x8')](_0x0270('0x9'),attributes,{'tableName':_0x0270('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x4255=['tools_actions','lodash','../../config/logger','api','moment','bluebird','path','rimraf','../../config/environment','./action.attributes','exports','define','Action'];(function(_0x21f457,_0x236b16){var _0x179f47=function(_0xec2a19){while(--_0xec2a19){_0x21f457['push'](_0x21f457['shift']());}};_0x179f47(++_0x236b16);}(_0x4255,0x1bb));var _0x5425=function(_0x178856,_0x41f045){_0x178856=_0x178856-0x0;var _0x3c7fe7=_0x4255[_0x178856];return _0x3c7fe7;};'use strict';var _=require(_0x5425('0x0'));var util=require('util');var logger=require(_0x5425('0x1'))(_0x5425('0x2'));var moment=require(_0x5425('0x3'));var BPromise=require(_0x5425('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x5425('0x5'));var rimraf=require(_0x5425('0x6'));var config=require(_0x5425('0x7'));var attributes=require(_0x5425('0x8'));module[_0x5425('0x9')]=function(_0x439f1b,_0xb9e88c){return _0x439f1b[_0x5425('0xa')](_0x5425('0xb'),attributes,{'tableName':_0x5425('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
diff --git a/server/api/action/action.rpc.js b/server/api/action/action.rpc.js
index d844b6f..2b60d9d 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 _0xe14b=['../../config/environment','jayson/promise','client','http','then','info','Action,\x20%s,\x20%s','Action,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','message','result','catch','lodash','util','randomstring','ioredis','../../config/utils'];(function(_0x154ce0,_0x12ae3c){var _0x4e8570=function(_0xee5964){while(--_0xee5964){_0x154ce0['push'](_0x154ce0['shift']());}};_0x4e8570(++_0x12ae3c);}(_0xe14b,0x93));var _0xbe14=function(_0x5912c9,_0x3686ed){_0x5912c9=_0x5912c9-0x0;var _0x462017=_0xe14b[_0x5912c9];return _0x462017;};'use strict';var _=require(_0xbe14('0x0'));var util=require(_0xbe14('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0xbe14('0x2'));var fs=require('fs');var Redis=require(_0xbe14('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0xbe14('0x4'));var logger=require('../../config/logger')('rpc');var config=require(_0xbe14('0x5'));var jayson=require(_0xbe14('0x6'));var client=jayson[_0xbe14('0x7')][_0xbe14('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x1d9ade,_0x39387e,_0x196fca){return new BPromise(function(_0x566ae7,_0x50f909){return client['request'](_0x1d9ade,_0x196fca)[_0xbe14('0x9')](function(_0x6fceff){logger[_0xbe14('0xa')](_0xbe14('0xb'),_0x39387e,'request\x20sent');logger['debug'](_0xbe14('0xc'),_0x39387e,_0xbe14('0xd'),JSON['stringify'](_0x6fceff));if(_0x6fceff[_0xbe14('0xe')]){if(_0x6fceff[_0xbe14('0xe')][_0xbe14('0xf')]===0x1f4){logger[_0xbe14('0xe')](_0xbe14('0xb'),_0x39387e,_0x6fceff[_0xbe14('0xe')][_0xbe14('0x10')]);return _0x50f909(_0x6fceff[_0xbe14('0xe')][_0xbe14('0x10')]);}logger[_0xbe14('0xe')](_0xbe14('0xb'),_0x39387e,_0x6fceff[_0xbe14('0xe')][_0xbe14('0x10')]);return _0x566ae7(_0x6fceff['error']['message']);}else{logger[_0xbe14('0xa')](_0xbe14('0xb'),_0x39387e,_0xbe14('0xd'));_0x566ae7(_0x6fceff[_0xbe14('0x11')]['message']);}})[_0xbe14('0x12')](function(_0xe9c3ec){logger[_0xbe14('0xe')](_0xbe14('0xb'),_0x39387e,_0xe9c3ec);_0x50f909(_0xe9c3ec);});});}
\ No newline at end of file
+var _0x5fab=['../../config/environment','jayson/promise','client','request','then','request\x20sent','debug','Action,\x20%s,\x20%s,\x20%s','stringify','error','code','message','Action,\x20%s,\x20%s','result','catch','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc'];(function(_0x9faff7,_0x59a564){var _0x4f8043=function(_0x5f060d){while(--_0x5f060d){_0x9faff7['push'](_0x9faff7['shift']());}};_0x4f8043(++_0x59a564);}(_0x5fab,0x177));var _0xb5fa=function(_0x3ec333,_0x26bcbe){_0x3ec333=_0x3ec333-0x0;var _0x15ccb8=_0x5fab[_0x3ec333];return _0x15ccb8;};'use strict';var _=require(_0xb5fa('0x0'));var util=require(_0xb5fa('0x1'));var moment=require('moment');var BPromise=require(_0xb5fa('0x2'));var rs=require(_0xb5fa('0x3'));var fs=require('fs');var Redis=require(_0xb5fa('0x4'));var db=require(_0xb5fa('0x5'))['db'];var utils=require(_0xb5fa('0x6'));var logger=require(_0xb5fa('0x7'))(_0xb5fa('0x8'));var config=require(_0xb5fa('0x9'));var jayson=require(_0xb5fa('0xa'));var client=jayson[_0xb5fa('0xb')]['http']({'port':0x232a});function respondWithRpcPromise(_0x5d70f6,_0x2e3804,_0x1aec3e){return new BPromise(function(_0x9c7bce,_0x56d018){return client[_0xb5fa('0xc')](_0x5d70f6,_0x1aec3e)[_0xb5fa('0xd')](function(_0x2cf4a5){logger['info']('Action,\x20%s,\x20%s',_0x2e3804,_0xb5fa('0xe'));logger[_0xb5fa('0xf')](_0xb5fa('0x10'),_0x2e3804,_0xb5fa('0xe'),JSON[_0xb5fa('0x11')](_0x2cf4a5));if(_0x2cf4a5[_0xb5fa('0x12')]){if(_0x2cf4a5[_0xb5fa('0x12')][_0xb5fa('0x13')]===0x1f4){logger[_0xb5fa('0x12')]('Action,\x20%s,\x20%s',_0x2e3804,_0x2cf4a5[_0xb5fa('0x12')][_0xb5fa('0x14')]);return _0x56d018(_0x2cf4a5['error'][_0xb5fa('0x14')]);}logger['error'](_0xb5fa('0x15'),_0x2e3804,_0x2cf4a5[_0xb5fa('0x12')][_0xb5fa('0x14')]);return _0x9c7bce(_0x2cf4a5[_0xb5fa('0x12')][_0xb5fa('0x14')]);}else{logger['info']('Action,\x20%s,\x20%s',_0x2e3804,_0xb5fa('0xe'));_0x9c7bce(_0x2cf4a5[_0xb5fa('0x16')][_0xb5fa('0x14')]);}})[_0xb5fa('0x17')](function(_0x56fe10){logger['error'](_0xb5fa('0x15'),_0x2e3804,_0x56fe10);_0x56d018(_0x56fe10);});});}
\ No newline at end of file
diff --git a/server/api/action/index.js b/server/api/action/index.js
index 926399c..65d6918 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 _0x3075=['../../components/interaction/service','./action.controller','isAuthenticated','delete','/:id','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service'];(function(_0x1a6824,_0xd3d44){var _0x4ce73f=function(_0x4cb4c7){while(--_0x4cb4c7){_0x1a6824['push'](_0x1a6824['shift']());}};_0x4ce73f(++_0xd3d44);}(_0x3075,0x19c));var _0x5307=function(_0x505507,_0x43ef96){_0x505507=_0x505507-0x0;var _0x4cf336=_0x3075[_0x505507];return _0x4cf336;};'use strict';var multer=require(_0x5307('0x0'));var util=require(_0x5307('0x1'));var path=require(_0x5307('0x2'));var timeout=require(_0x5307('0x3'));var express=require(_0x5307('0x4'));var router=express[_0x5307('0x5')]();var fs_extra=require(_0x5307('0x6'));var auth=require(_0x5307('0x7'));var interaction=require(_0x5307('0x8'));var config=require('../../config/environment');var controller=require(_0x5307('0x9'));router['put']('/:id',auth[_0x5307('0xa')](),controller['update']);router[_0x5307('0xb')](_0x5307('0xc'),auth[_0x5307('0xa')](),controller['destroy']);module[_0x5307('0xd')]=router;
\ No newline at end of file
+var _0x6aec=['exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./action.controller','put','/:id','isAuthenticated','update','delete','destroy'];(function(_0x4d1d20,_0x2dead1){var _0x547c54=function(_0x510aae){while(--_0x510aae){_0x4d1d20['push'](_0x4d1d20['shift']());}};_0x547c54(++_0x2dead1);}(_0x6aec,0xb5));var _0xc6ae=function(_0x978525,_0x2aef01){_0x978525=_0x978525-0x0;var _0x31b2f3=_0x6aec[_0x978525];return _0x31b2f3;};'use strict';var multer=require(_0xc6ae('0x0'));var util=require(_0xc6ae('0x1'));var path=require(_0xc6ae('0x2'));var timeout=require(_0xc6ae('0x3'));var express=require(_0xc6ae('0x4'));var router=express[_0xc6ae('0x5')]();var fs_extra=require(_0xc6ae('0x6'));var auth=require(_0xc6ae('0x7'));var interaction=require(_0xc6ae('0x8'));var config=require(_0xc6ae('0x9'));var controller=require(_0xc6ae('0xa'));router[_0xc6ae('0xb')](_0xc6ae('0xc'),auth[_0xc6ae('0xd')](),controller[_0xc6ae('0xe')]);router[_0xc6ae('0xf')](_0xc6ae('0xc'),auth[_0xc6ae('0xd')](),controller[_0xc6ae('0x10')]);module[_0xc6ae('0x11')]=router;
\ No newline at end of file
diff --git a/server/api/analyticCustomReport/analyticCustomReport.attributes.js b/server/api/analyticCustomReport/analyticCustomReport.attributes.js
index 20d06a0..ec35872 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 _0xdc97=['exports','STRING','TEXT','sequelize'];(function(_0x8a969d,_0x339d9f){var _0x1d8dc7=function(_0x283ec0){while(--_0x283ec0){_0x8a969d['push'](_0x8a969d['shift']());}};_0x1d8dc7(++_0x339d9f);}(_0xdc97,0x13b));var _0x7dc9=function(_0x491afd,_0x48b3b3){_0x491afd=_0x491afd-0x0;var _0x167adb=_0xdc97[_0x491afd];return _0x167adb;};'use strict';var Sequelize=require(_0x7dc9('0x0'));module[_0x7dc9('0x1')]={'name':{'type':Sequelize[_0x7dc9('0x2')],'allowNull':![]},'description':{'type':Sequelize['STRING']},'parent':{'type':Sequelize[_0x7dc9('0x2')]},'table':{'type':Sequelize['STRING']},'conditions':{'type':Sequelize[_0x7dc9('0x3')]},'joins':{'type':Sequelize[_0x7dc9('0x3')]}};
\ No newline at end of file
+var _0x425d=['sequelize','STRING','TEXT'];(function(_0x23aa53,_0x3d1c09){var _0x45c8ec=function(_0xefa646){while(--_0xefa646){_0x23aa53['push'](_0x23aa53['shift']());}};_0x45c8ec(++_0x3d1c09);}(_0x425d,0x1e0));var _0xd425=function(_0x298374,_0x4d34c4){_0x298374=_0x298374-0x0;var _0x42ada1=_0x425d[_0x298374];return _0x42ada1;};'use strict';var Sequelize=require(_0xd425('0x0'));module['exports']={'name':{'type':Sequelize[_0xd425('0x1')],'allowNull':![]},'description':{'type':Sequelize[_0xd425('0x1')]},'parent':{'type':Sequelize[_0xd425('0x1')]},'table':{'type':Sequelize[_0xd425('0x1')]},'conditions':{'type':Sequelize[_0xd425('0x2')]},'joins':{'type':Sequelize[_0xd425('0x2')]}};
\ No newline at end of file
diff --git a/server/api/analyticCustomReport/analyticCustomReport.controller.js b/server/api/analyticCustomReport/analyticCustomReport.controller.js
index b7a23ce..fedfff4 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 _0xcc8f=['include','findAll','rows','params','intersection','create','user','role','Reports','UserProfileSection','find','userProfileId','autoAssociation','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','catch','body','preview','join','right_join','SUM(%s)','COUNT(%s)','COUNT(DISTINCT\x20%s)','MAX(%s)','MIN(%s)','GROUP_CONCAT(%s)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','SEC_TO_TIME(%s)','HOUR(%s)','ROUND(%s)','includes','IS\x20NULL','IS\x20NOT\x20NULL','IS\x20EMPTY','IS\x20NOT\x20EMPTY','rules','operator','group','condition','value','getFields','Sequelize','ValidationErrorItem','Please\x20insert\x20at\x20least\x20one\x20field','AnalyticMetric','select','from','MetricId','metric','field','function','format','replace','groupBy','orderBy','DESC','joins','parse','parentKey','foreignTable','foreignKey','%s.%s\x20=\x20%s.%s','table','conditions','Limited\x20Query:','toString','sequelize','QueryTypes','SELECT','left_join','cross_join','AVG(%s)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)','UNIX_TIMESTAMP(%s)','alias','clone','output','fullPath','%s-%s.%s','randomstring','generate','csv','custom','AnalyticExtractedReport','cdr','.calldate\x20BETWEEN\x20?\x20AND\x20?','startDate','.createdAt\x20BETWEEN\x20?\x20AND\x20?','endDate','Run\x20Query:','child_process','fork','../../components/export/','savename','countTable','run','runReport','DATE(%s)','keyBy','debug','eml-format','fast-json-patch','request-promise','bluebird','mustache','util','path','to-csv','ejs','fs-extra','lodash','desk.js','ioredis','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','dbH','status','json','offset','undefined','count','limit','set','Content-Range','apply','reject','save','update','then','destroy','get','CustomReports','UserProfileResource','end','sendStatus','stack','name','send','index','AnalyticCustomReport','rawAttributes','fieldName','type','key','model','query','keys','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','filters','filter','merge','map','VIRTUAL','options','includeAll'];(function(_0x31bfea,_0x4b97be){var _0xd9c985=function(_0x151684){while(--_0x151684){_0x31bfea['push'](_0x31bfea['shift']());}};_0xd9c985(++_0x4b97be);}(_0xcc8f,0x10d));var _0xfcc8=function(_0x2f3212,_0x41015f){_0x2f3212=_0x2f3212-0x0;var _0x907134=_0xcc8f[_0x2f3212];return _0x907134;};'use strict';var emlformat=require(_0xfcc8('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0xfcc8('0x1'));var rp=require(_0xfcc8('0x2'));var moment=require('moment');var BPromise=require(_0xfcc8('0x3'));var Mustache=require(_0xfcc8('0x4'));var util=require(_0xfcc8('0x5'));var path=require(_0xfcc8('0x6'));var sox=require('sox');var csv=require(_0xfcc8('0x7'));var ejs=require(_0xfcc8('0x8'));var fs=require('fs');var fs_extra=require(_0xfcc8('0x9'));var _=require(_0xfcc8('0xa'));var squel=require('squel');var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0xfcc8('0xb'));var toCsv=require(_0xfcc8('0x7'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0xfcc8('0xc'));var authService=require('../../components/auth/service');var qs=require(_0xfcc8('0xd'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xfcc8('0xe'));var logger=require(_0xfcc8('0xf'))(_0xfcc8('0x10'));var utils=require(_0xfcc8('0x11'));var config=require(_0xfcc8('0x12'));var licenseUtil=require(_0xfcc8('0x13'));var db=require(_0xfcc8('0x14'))['db'];var dbH=require('../../mysqldb')[_0xfcc8('0x15')];function respondWithStatusCode(_0x3996d7,_0xface16){_0xface16=_0xface16||0xcc;return function(_0x1b0ae2){if(_0x1b0ae2){return _0x3996d7['sendStatus'](_0xface16);}return _0x3996d7[_0xfcc8('0x16')](_0xface16)['end']();};}function respondWithResult(_0x302b18,_0x25f611){_0x25f611=_0x25f611||0xc8;return function(_0x1383b5){if(_0x1383b5){return _0x302b18[_0xfcc8('0x16')](_0x25f611)[_0xfcc8('0x17')](_0x1383b5);}};}function respondWithFilteredResult(_0x38d4f8,_0x202485){return function(_0x4de9bc){if(_0x4de9bc){var _0x2f7de4=typeof _0x202485[_0xfcc8('0x18')]===_0xfcc8('0x19')&&typeof _0x202485['limit']===_0xfcc8('0x19');var _0x171a28=_0x4de9bc[_0xfcc8('0x1a')];var _0x49d7d3=_0x2f7de4?0x0:_0x202485['offset'];var _0x2aeca6=_0x2f7de4?_0x4de9bc['count']:_0x202485[_0xfcc8('0x18')]+_0x202485[_0xfcc8('0x1b')];var _0x22cdc4;if(_0x2aeca6>=_0x171a28){_0x2aeca6=_0x171a28;_0x22cdc4=0xc8;}else{_0x22cdc4=0xce;}_0x38d4f8[_0xfcc8('0x16')](_0x22cdc4);return _0x38d4f8[_0xfcc8('0x1c')](_0xfcc8('0x1d'),_0x49d7d3+'-'+_0x2aeca6+'/'+_0x171a28)[_0xfcc8('0x17')](_0x4de9bc);}return null;};}function patchUpdates(_0xbf854a){return function(_0x54898e){try{jsonpatch[_0xfcc8('0x1e')](_0x54898e,_0xbf854a,!![]);}catch(_0x18536c){return BPromise[_0xfcc8('0x1f')](_0x18536c);}return _0x54898e[_0xfcc8('0x20')]();};}function saveUpdates(_0x14888f,_0x3c2f75){return function(_0x166e2e){if(_0x166e2e){return _0x166e2e[_0xfcc8('0x21')](_0x14888f)[_0xfcc8('0x22')](function(_0xe9ca5f){return _0xe9ca5f;});}return null;};}function removeEntity(_0xa9f222,_0x2e4505){return function(_0x546cac){if(_0x546cac){return _0x546cac[_0xfcc8('0x23')]()[_0xfcc8('0x22')](function(){var _0x23390f=_0x546cac[_0xfcc8('0x24')]({'plain':!![]});var _0x1458ba=_0xfcc8('0x25');return db[_0xfcc8('0x26')][_0xfcc8('0x23')]({'where':{'type':_0x1458ba,'resourceId':_0x23390f['id']}})[_0xfcc8('0x22')](function(){return _0x546cac;});})[_0xfcc8('0x22')](function(){_0xa9f222[_0xfcc8('0x16')](0xcc)[_0xfcc8('0x27')]();});}};}function handleEntityNotFound(_0x5141b2,_0x1b6340){return function(_0x2decd4){if(!_0x2decd4){_0x5141b2[_0xfcc8('0x28')](0x194);}return _0x2decd4;};}function handleError(_0x1c7430,_0x423353){_0x423353=_0x423353||0x1f4;return function(_0x74ab56){logger['error'](_0x74ab56[_0xfcc8('0x29')]);if(_0x74ab56[_0xfcc8('0x2a')]){delete _0x74ab56[_0xfcc8('0x2a')];}_0x1c7430[_0xfcc8('0x16')](_0x423353)[_0xfcc8('0x2b')](_0x74ab56);};}exports[_0xfcc8('0x2c')]=function(_0x3f752c,_0x13531d){var _0x1684e7={},_0x551cc6={},_0x5f3f15={'count':0x0,'rows':[]};var _0x2c041c=_['map'](db[_0xfcc8('0x2d')][_0xfcc8('0x2e')],function(_0xae163b){return{'name':_0xae163b[_0xfcc8('0x2f')],'type':_0xae163b[_0xfcc8('0x30')][_0xfcc8('0x31')]};});_0x551cc6[_0xfcc8('0x32')]=_['map'](_0x2c041c,_0xfcc8('0x2a'));_0x551cc6[_0xfcc8('0x33')]=_[_0xfcc8('0x34')](_0x3f752c['query']);_0x551cc6['filters']=_['intersection'](_0x551cc6['model'],_0x551cc6[_0xfcc8('0x33')]);_0x1684e7['attributes']=_['intersection'](_0x551cc6[_0xfcc8('0x32')],qs[_0xfcc8('0x35')](_0x3f752c['query'][_0xfcc8('0x35')]));_0x1684e7[_0xfcc8('0x36')]=_0x1684e7['attributes'][_0xfcc8('0x37')]?_0x1684e7[_0xfcc8('0x36')]:_0x551cc6['model'];if(!_0x3f752c[_0xfcc8('0x33')][_0xfcc8('0x38')](_0xfcc8('0x39'))){_0x1684e7['limit']=qs[_0xfcc8('0x1b')](_0x3f752c[_0xfcc8('0x33')]['limit']);_0x1684e7[_0xfcc8('0x18')]=qs['offset'](_0x3f752c[_0xfcc8('0x33')]['offset']);}_0x1684e7[_0xfcc8('0x3a')]=qs[_0xfcc8('0x3b')](_0x3f752c[_0xfcc8('0x33')]['sort']);_0x1684e7[_0xfcc8('0x3c')]=qs['filters'](_[_0xfcc8('0x3d')](_0x3f752c[_0xfcc8('0x33')],_0x551cc6[_0xfcc8('0x3e')]),_0x2c041c);if(_0x3f752c[_0xfcc8('0x33')][_0xfcc8('0x3f')]){_0x1684e7[_0xfcc8('0x3c')]=_[_0xfcc8('0x40')](_0x1684e7[_0xfcc8('0x3c')],{'$or':_[_0xfcc8('0x41')](_0x2c041c,function(_0x1e854a){if(_0x1e854a[_0xfcc8('0x30')]!==_0xfcc8('0x42')){var _0x1860bc={};_0x1860bc[_0x1e854a[_0xfcc8('0x2a')]]={'$like':'%'+_0x3f752c[_0xfcc8('0x33')][_0xfcc8('0x3f')]+'%'};return _0x1860bc;}})});}_0x1684e7=_['merge']({},_0x1684e7,_0x3f752c[_0xfcc8('0x43')]);var _0x42000f={'where':_0x1684e7[_0xfcc8('0x3c')]};return db['AnalyticCustomReport']['count'](_0x42000f)[_0xfcc8('0x22')](function(_0x4b7b97){_0x5f3f15['count']=_0x4b7b97;if(_0x3f752c[_0xfcc8('0x33')][_0xfcc8('0x44')]){_0x1684e7[_0xfcc8('0x45')]=[{'all':!![]}];}return db['AnalyticCustomReport'][_0xfcc8('0x46')](_0x1684e7);})[_0xfcc8('0x22')](function(_0x46e6cb){_0x5f3f15[_0xfcc8('0x47')]=_0x46e6cb;return _0x5f3f15;})[_0xfcc8('0x22')](respondWithFilteredResult(_0x13531d,_0x1684e7))['catch'](handleError(_0x13531d,null));};exports['show']=function(_0x33e504,_0x404289){var _0x46fa0f={'raw':![],'where':{'id':_0x33e504[_0xfcc8('0x48')]['id']}},_0x24b9d4={};_0x24b9d4[_0xfcc8('0x32')]=_['keys'](db['AnalyticCustomReport'][_0xfcc8('0x2e')]);_0x24b9d4[_0xfcc8('0x33')]=_[_0xfcc8('0x34')](_0x33e504[_0xfcc8('0x33')]);_0x24b9d4[_0xfcc8('0x3e')]=_[_0xfcc8('0x49')](_0x24b9d4['model'],_0x24b9d4[_0xfcc8('0x33')]);_0x46fa0f[_0xfcc8('0x36')]=_[_0xfcc8('0x49')](_0x24b9d4[_0xfcc8('0x32')],qs['fields'](_0x33e504[_0xfcc8('0x33')][_0xfcc8('0x35')]));_0x46fa0f[_0xfcc8('0x36')]=_0x46fa0f[_0xfcc8('0x36')][_0xfcc8('0x37')]?_0x46fa0f[_0xfcc8('0x36')]:_0x24b9d4[_0xfcc8('0x32')];if(_0x33e504[_0xfcc8('0x33')][_0xfcc8('0x44')]){_0x46fa0f['include']=[{'all':!![]}];}_0x46fa0f=_[_0xfcc8('0x40')]({},_0x46fa0f,_0x33e504['options']);return db[_0xfcc8('0x2d')]['find'](_0x46fa0f)[_0xfcc8('0x22')](handleEntityNotFound(_0x404289,null))['then'](respondWithResult(_0x404289,null))['catch'](handleError(_0x404289,null));};exports[_0xfcc8('0x4a')]=function(_0x2a9190,_0x103807){return db[_0xfcc8('0x2d')]['create'](_0x2a9190['body'],{})[_0xfcc8('0x22')](function(_0x1d09d8){var _0x3652d1=_0x2a9190[_0xfcc8('0x4b')][_0xfcc8('0x24')]({'plain':!![]});if(!_0x3652d1)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x3652d1[_0xfcc8('0x4c')]===_0xfcc8('0x4b')){var _0x217273=_0x1d09d8['get']({'plain':!![]});var _0x4ee65b=_0xfcc8('0x4d');return db[_0xfcc8('0x4e')][_0xfcc8('0x4f')]({'where':{'name':_0x4ee65b,'userProfileId':_0x3652d1[_0xfcc8('0x50')]},'raw':!![]})[_0xfcc8('0x22')](function(_0x11dde3){if(_0x11dde3&&_0x11dde3[_0xfcc8('0x51')]===0x0){return db[_0xfcc8('0x26')][_0xfcc8('0x4a')]({'name':_0x217273[_0xfcc8('0x2a')],'resourceId':_0x217273['id'],'type':'CustomReports','sectionId':_0x11dde3['id']},{})[_0xfcc8('0x22')](function(){return _0x1d09d8;});}else{return _0x1d09d8;}})['catch'](function(_0x10fce0){logger[_0xfcc8('0x52')](_0xfcc8('0x53'),_0x10fce0);throw _0x10fce0;});}return _0x1d09d8;})[_0xfcc8('0x22')](respondWithResult(_0x103807,0xc9))[_0xfcc8('0x54')](handleError(_0x103807,null));};exports[_0xfcc8('0x21')]=function(_0x30b963,_0x518b56){if(_0x30b963[_0xfcc8('0x55')]['id']){delete _0x30b963[_0xfcc8('0x55')]['id'];}return db[_0xfcc8('0x2d')][_0xfcc8('0x4f')]({'where':{'id':_0x30b963[_0xfcc8('0x48')]['id']}})[_0xfcc8('0x22')](handleEntityNotFound(_0x518b56,null))[_0xfcc8('0x22')](saveUpdates(_0x30b963['body'],null))[_0xfcc8('0x22')](respondWithResult(_0x518b56,null))[_0xfcc8('0x54')](handleError(_0x518b56,null));};exports[_0xfcc8('0x23')]=function(_0x226fa8,_0x4ce9cf){return db[_0xfcc8('0x2d')][_0xfcc8('0x4f')]({'where':{'id':_0x226fa8[_0xfcc8('0x48')]['id']}})[_0xfcc8('0x22')](handleEntityNotFound(_0x4ce9cf,null))['then'](removeEntity(_0x4ce9cf,null))[_0xfcc8('0x54')](handleError(_0x4ce9cf,null));};exports[_0xfcc8('0x56')]=function(_0x41794e,_0x335b0e){var _0x42bf06=0xa;var _0x4f8074=[_0xfcc8('0x57'),'left_join',_0xfcc8('0x58'),'cross_join'];var _0xcd6638={'SUM':_0xfcc8('0x59'),'COUNT':_0xfcc8('0x5a'),'COUNT DISTINCT':_0xfcc8('0x5b'),'MAX':_0xfcc8('0x5c'),'MIN':_0xfcc8('0x5d'),'AVG':'AVG(%s)','GROUP_CONCAT':_0xfcc8('0x5e'),'GROUP_CONCAT ASC':_0xfcc8('0x5f'),'GROUP_CONCAT DESC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)'};var _0x568e2c={'SEC_TO_TIME':_0xfcc8('0x60'),'DATE':'DATE(%s)','HOUR':_0xfcc8('0x61'),'ROUND':_0xfcc8('0x62'),'UNIX_TIMESTAMP':'UNIX_TIMESTAMP(%s)'};var _0x19f0f5=function(_0x343aa4){return!_[_0xfcc8('0x63')]([_0xfcc8('0x64'),_0xfcc8('0x65'),_0xfcc8('0x66'),_0xfcc8('0x67')],_0x343aa4);};var _0x34bee3=function(_0x128bea){if(!_0x128bea||!_0x128bea['rules']['length']){return'';}for(var _0x25656f='(',_0x12b4a6=0x0;_0x12b4a6<_0x128bea[_0xfcc8('0x68')][_0xfcc8('0x37')];_0x12b4a6+=0x1){_0x12b4a6>0x0&&(_0x25656f+='\x20'+_0x128bea[_0xfcc8('0x69')]+'\x20');_0x25656f+=_0x128bea['rules'][_0x12b4a6]['group']?_0x34bee3(_0x128bea[_0xfcc8('0x68')][_0x12b4a6][_0xfcc8('0x6a')]):_0x128bea[_0xfcc8('0x68')][_0x12b4a6]['field']+'\x20'+_0x128bea['rules'][_0x12b4a6][_0xfcc8('0x6b')]+(_0x19f0f5(_0x128bea[_0xfcc8('0x68')][_0x12b4a6][_0xfcc8('0x6b')])?'\x20'+_0x128bea[_0xfcc8('0x68')][_0x12b4a6][_0xfcc8('0x6c')]:'');}return _0x25656f+')';};var _0x18f89f={'where':{'id':_0x41794e[_0xfcc8('0x48')]['id']}},_0x48bcd0,_0x183d71,_0x26524a,_0x49ad46,_0x19ba19;_0x18f89f=_['merge']({},_0x18f89f,_0x41794e[_0xfcc8('0x43')]);return db['AnalyticCustomReport'][_0xfcc8('0x4f')](_0x18f89f)[_0xfcc8('0x22')](function(_0x368bcc){if(_0x368bcc){_0x48bcd0=_0x368bcc;return _0x368bcc[_0xfcc8('0x6d')]();}return null;})[_0xfcc8('0x22')](function(_0x53d2d2){if(_0x53d2d2){if(!_0x53d2d2[_0xfcc8('0x37')]){throw new db[(_0xfcc8('0x6e'))][(_0xfcc8('0x6f'))](_0xfcc8('0x70'),0x193);}_0x183d71=_0x53d2d2;return db[_0xfcc8('0x71')][_0xfcc8('0x46')]({'raw':!![]});}return null;})[_0xfcc8('0x22')](function(_0x532661){if(_0x532661){_0x26524a=_['keyBy'](_0x532661,'id');var _0x1fac4a;var _0x36185b=squel[_0xfcc8('0x72')]();_0x36185b[_0xfcc8('0x73')](_0x48bcd0['table']);for(var _0x4ce3f1=0x0;_0x4ce3f1<_0x183d71[_0xfcc8('0x37')];_0x4ce3f1+=0x1){_0x1fac4a=_0x183d71[_0x4ce3f1][_0xfcc8('0x74')]?_0x26524a[_0x183d71[_0x4ce3f1][_0xfcc8('0x74')]][_0xfcc8('0x75')]:_0x183d71[_0x4ce3f1][_0xfcc8('0x76')];_0x1fac4a=_0x183d71[_0x4ce3f1][_0xfcc8('0x77')]?_['replace'](_0xcd6638[_0x183d71[_0x4ce3f1]['function']],'%s',_0x1fac4a):_0x1fac4a;_0x1fac4a=_0x183d71[_0x4ce3f1][_0xfcc8('0x78')]?_[_0xfcc8('0x79')](_0x568e2c[_0x183d71[_0x4ce3f1]['format']],'%s',_0x1fac4a):_0x1fac4a;if(_0x183d71[_0x4ce3f1][_0xfcc8('0x7a')]){_0x36185b[_0xfcc8('0x6a')](_0x1fac4a);}_0x183d71[_0x4ce3f1][_0xfcc8('0x7b')]&&_0x36185b[_0xfcc8('0x3a')](_0x1fac4a,_0x183d71[_0x4ce3f1]['orderBy']===_0xfcc8('0x7c')?![]:!![]);_0x36185b['field'](_0x1fac4a,_0x183d71[_0x4ce3f1]['alias']||_0x1fac4a);}if(_0x48bcd0[_0xfcc8('0x7d')]){_0x48bcd0[_0xfcc8('0x7d')]=JSON[_0xfcc8('0x7e')](_0x48bcd0['joins']);for(var _0x4c3b18=0x0;_0x4c3b18<_0x48bcd0[_0xfcc8('0x7d')]['length'];_0x4c3b18+=0x1){if(_0x48bcd0[_0xfcc8('0x7d')][_0x4c3b18][_0xfcc8('0x30')]&&_[_0xfcc8('0x63')](_0x4f8074,_0x48bcd0[_0xfcc8('0x7d')][_0x4c3b18]['type'])&&_0x48bcd0[_0xfcc8('0x7d')][_0x4c3b18][_0xfcc8('0x7f')]&&_0x48bcd0[_0xfcc8('0x7d')][_0x4c3b18][_0xfcc8('0x80')]&&_0x48bcd0[_0xfcc8('0x7d')][_0x4c3b18][_0xfcc8('0x81')]){_0x36185b[_0x48bcd0[_0xfcc8('0x7d')][_0x4c3b18][_0xfcc8('0x30')]](_0x48bcd0[_0xfcc8('0x7d')][_0x4c3b18][_0xfcc8('0x80')],null,util['format'](_0xfcc8('0x82'),_0x48bcd0[_0xfcc8('0x83')],_0x48bcd0[_0xfcc8('0x7d')][_0x4c3b18][_0xfcc8('0x7f')],_0x48bcd0[_0xfcc8('0x7d')][_0x4c3b18][_0xfcc8('0x80')],_0x48bcd0[_0xfcc8('0x7d')][_0x4c3b18][_0xfcc8('0x81')]));}}}if(_0x48bcd0[_0xfcc8('0x84')]){_0x48bcd0[_0xfcc8('0x84')]=JSON[_0xfcc8('0x7e')](_0x48bcd0['conditions']);_0x36185b['where'](_0x34bee3(_0x48bcd0['conditions'][_0xfcc8('0x6a')]));}_0x19ba19=_0x36185b['clone']();_0x36185b[_0xfcc8('0x1b')](_0x42bf06);_0x36185b[_0xfcc8('0x18')](0x0);logger['debug'](_0xfcc8('0x85'),_0x36185b[_0xfcc8('0x86')]());return dbH['sequelize']['query'](_0x36185b[_0xfcc8('0x86')](),{'type':dbH[_0xfcc8('0x87')][_0xfcc8('0x88')][_0xfcc8('0x89')]});}})['then'](respondWithResult(_0x335b0e,null))[_0xfcc8('0x54')](handleError(_0x335b0e,null));};function runReport(_0x5267a6,_0x4ed833,_0x2d44d8){var _0x2e8b8f=_0x4ed833[_0xfcc8('0x2a')];var _0x45228d=0xa;var _0x22da97=['join',_0xfcc8('0x8a'),_0xfcc8('0x58'),_0xfcc8('0x8b')];var _0x5808d7={'SUM':'SUM(%s)','COUNT':'COUNT(%s)','COUNT DISTINCT':_0xfcc8('0x5b'),'MAX':_0xfcc8('0x5c'),'MIN':'MIN(%s)','AVG':_0xfcc8('0x8c'),'GROUP_CONCAT':_0xfcc8('0x5e'),'GROUP_CONCAT ASC':_0xfcc8('0x5f'),'GROUP_CONCAT DESC':_0xfcc8('0x8d')};var _0x2144e7={'SEC_TO_TIME':_0xfcc8('0x60'),'DATE':'DATE(%s)','HOUR':_0xfcc8('0x61'),'ROUND':'ROUND(%s)','UNIX_TIMESTAMP':_0xfcc8('0x8e')};var _0x28dd97=function(_0x2bae8b){return!_['includes']([_0xfcc8('0x64'),'IS\x20NOT\x20NULL',_0xfcc8('0x66'),'IS\x20NOT\x20EMPTY'],_0x2bae8b);};var _0x33cdf5=function(_0x3dc0bf){if(!_0x3dc0bf||!_0x3dc0bf['rules'][_0xfcc8('0x37')]){return'';}for(var _0x5d62fe='(',_0x3c4ece=0x0;_0x3c4ece<_0x3dc0bf[_0xfcc8('0x68')]['length'];_0x3c4ece+=0x1){_0x3c4ece>0x0&&(_0x5d62fe+='\x20'+_0x3dc0bf[_0xfcc8('0x69')]+'\x20');_0x5d62fe+=_0x3dc0bf[_0xfcc8('0x68')][_0x3c4ece][_0xfcc8('0x6a')]?_0x33cdf5(_0x3dc0bf[_0xfcc8('0x68')][_0x3c4ece][_0xfcc8('0x6a')]):_0x3dc0bf['rules'][_0x3c4ece][_0xfcc8('0x76')]+'\x20'+_0x3dc0bf[_0xfcc8('0x68')][_0x3c4ece][_0xfcc8('0x6b')]+(_0x28dd97(_0x3dc0bf[_0xfcc8('0x68')][_0x3c4ece][_0xfcc8('0x6b')])?'\x20'+_0x3dc0bf[_0xfcc8('0x68')][_0x3c4ece]['value']:'');}return _0x5d62fe+')';};var _0x10b06a={'where':{'id':_0x5267a6['id']}},_0x31a368,_0x1355e8,_0x483070,_0x1cd5c6,_0x398d11;_0x10b06a=_[_0xfcc8('0x40')]({},_0x10b06a,_0x2d44d8);return db[_0xfcc8('0x2d')][_0xfcc8('0x4f')](_0x10b06a)['then'](function(_0x29c6d8){if(_0x29c6d8){_0x31a368=_0x29c6d8;return _0x29c6d8[_0xfcc8('0x6d')]();}return null;})['then'](function(_0x37d3c0){if(_0x37d3c0){if(!_0x37d3c0[_0xfcc8('0x37')]){throw new db[(_0xfcc8('0x6e'))]['ValidationErrorItem']('Please\x20insert\x20at\x20least\x20one\x20field',0x193);}_0x1355e8=_0x37d3c0;return db['AnalyticMetric'][_0xfcc8('0x46')]({'raw':!![]});}return null;})[_0xfcc8('0x22')](function(_0x1052b7){if(_0x1052b7){_0x483070=_['keyBy'](_0x1052b7,'id');var _0x34dc06;var _0x3e54ee=squel[_0xfcc8('0x72')]();_0x3e54ee['from'](_0x31a368['table']);for(var _0x3d9dff=0x0;_0x3d9dff<_0x1355e8[_0xfcc8('0x37')];_0x3d9dff+=0x1){_0x34dc06=_0x1355e8[_0x3d9dff]['MetricId']?_0x483070[_0x1355e8[_0x3d9dff][_0xfcc8('0x74')]][_0xfcc8('0x75')]:_0x1355e8[_0x3d9dff][_0xfcc8('0x76')];_0x34dc06=_0x1355e8[_0x3d9dff][_0xfcc8('0x77')]?_[_0xfcc8('0x79')](_0x5808d7[_0x1355e8[_0x3d9dff][_0xfcc8('0x77')]],'%s',_0x34dc06):_0x34dc06;_0x34dc06=_0x1355e8[_0x3d9dff][_0xfcc8('0x78')]?_[_0xfcc8('0x79')](_0x2144e7[_0x1355e8[_0x3d9dff]['format']],'%s',_0x34dc06):_0x34dc06;if(_0x1355e8[_0x3d9dff][_0xfcc8('0x7a')]){_0x3e54ee[_0xfcc8('0x6a')](_0x34dc06);}_0x1355e8[_0x3d9dff][_0xfcc8('0x7b')]&&_0x3e54ee[_0xfcc8('0x3a')](_0x34dc06,_0x1355e8[_0x3d9dff][_0xfcc8('0x7b')]===_0xfcc8('0x7c')?![]:!![]);_0x3e54ee[_0xfcc8('0x76')](_0x34dc06,_0x1355e8[_0x3d9dff][_0xfcc8('0x8f')]||_0x34dc06);}if(_0x31a368[_0xfcc8('0x7d')]){_0x31a368[_0xfcc8('0x7d')]=JSON['parse'](_0x31a368[_0xfcc8('0x7d')]);for(var _0x53b6a2=0x0;_0x53b6a2<_0x31a368[_0xfcc8('0x7d')][_0xfcc8('0x37')];_0x53b6a2+=0x1){if(_0x31a368[_0xfcc8('0x7d')][_0x53b6a2][_0xfcc8('0x30')]&&_[_0xfcc8('0x63')](_0x22da97,_0x31a368[_0xfcc8('0x7d')][_0x53b6a2][_0xfcc8('0x30')])&&_0x31a368[_0xfcc8('0x7d')][_0x53b6a2][_0xfcc8('0x7f')]&&_0x31a368[_0xfcc8('0x7d')][_0x53b6a2][_0xfcc8('0x80')]&&_0x31a368[_0xfcc8('0x7d')][_0x53b6a2]['foreignKey']){_0x3e54ee[_0x31a368[_0xfcc8('0x7d')][_0x53b6a2][_0xfcc8('0x30')]](_0x31a368[_0xfcc8('0x7d')][_0x53b6a2][_0xfcc8('0x80')],null,util[_0xfcc8('0x78')]('%s.%s\x20=\x20%s.%s',_0x31a368[_0xfcc8('0x83')],_0x31a368['joins'][_0x53b6a2][_0xfcc8('0x7f')],_0x31a368[_0xfcc8('0x7d')][_0x53b6a2]['foreignTable'],_0x31a368[_0xfcc8('0x7d')][_0x53b6a2][_0xfcc8('0x81')]));}}}if(_0x31a368[_0xfcc8('0x84')]){_0x31a368[_0xfcc8('0x84')]=JSON[_0xfcc8('0x7e')](_0x31a368[_0xfcc8('0x84')]);_0x3e54ee['where'](_0x33cdf5(_0x31a368[_0xfcc8('0x84')][_0xfcc8('0x6a')]));}_0x398d11=_0x3e54ee[_0xfcc8('0x90')]();_0x3e54ee[_0xfcc8('0x1b')](_0x45228d);_0x3e54ee[_0xfcc8('0x18')](0x0);return;}})[_0xfcc8('0x22')](function(){if(_0x4ed833[_0xfcc8('0x91')]==='web'){return null;}var _0x5c75b3=_[_0xfcc8('0x40')](_0x4ed833,{'name':_0x4ed833[_0xfcc8('0x92')]||_0x4ed833[_0xfcc8('0x2a')]||_0x31a368['name'],'basename':_0x2e8b8f,'savename':util[_0xfcc8('0x78')](_0xfcc8('0x93'),_0x4ed833[_0xfcc8('0x2a')]||_0x31a368[_0xfcc8('0x2a')],require(_0xfcc8('0x94'))[_0xfcc8('0x95')](0x4),_0x4ed833['output']||_0xfcc8('0x96')),'reportId':_0x31a368['id'],'reportType':_0xfcc8('0x97')});return db[_0xfcc8('0x98')][_0xfcc8('0x4a')](_0x5c75b3,{'raw':!![]});})[_0xfcc8('0x22')](function(_0x4b2007){if(_0x31a368[_0xfcc8('0x83')]===_0xfcc8('0x99')){_0x398d11[_0xfcc8('0x3c')](_0x31a368['table']+_0xfcc8('0x9a'),_0x4ed833[_0xfcc8('0x9b')],_0x4ed833['endDate']);}else{_0x398d11[_0xfcc8('0x3c')](_0x31a368[_0xfcc8('0x83')]+_0xfcc8('0x9c'),_0x4ed833[_0xfcc8('0x9b')],_0x4ed833[_0xfcc8('0x9d')]);}if(_0x4b2007){logger['info'](_0xfcc8('0x9e'),_0x398d11[_0xfcc8('0x86')]());require(_0xfcc8('0x9f'))[_0xfcc8('0xa0')](path['join'](__dirname,_0xfcc8('0xa1'),_0x4b2007[_0xfcc8('0x91')]),[_0x4b2007['id'],_0x398d11[_0xfcc8('0x86')](),path[_0xfcc8('0x57')](__dirname,'../../files/reports',_0x4b2007[_0xfcc8('0xa2')]),_0x2e8b8f]);return _0x4b2007;}else{var _0x5c0a54=squel[_0xfcc8('0x72')]();_0x5c0a54[_0xfcc8('0x73')]('('+_0x398d11['toString']()+')',_0xfcc8('0xa3'));_0x5c0a54[_0xfcc8('0x76')]('COUNT(*)',_0xfcc8('0x1a'));_0x398d11[_0xfcc8('0x1b')](_0x4ed833['limit']||_0x45228d);_0x398d11[_0xfcc8('0x18')](_0x4ed833[_0xfcc8('0x18')]||0x0);return dbH[_0xfcc8('0x87')][_0xfcc8('0x33')](_0x5c0a54[_0xfcc8('0x86')](),{'type':dbH['sequelize'][_0xfcc8('0x88')]['SELECT']})[_0xfcc8('0x22')](function(_0x404bce){if(!_0x404bce['length']){_0x1cd5c6=0x0;}else{_0x1cd5c6=_0x404bce[0x0]['count']||0x0;}return dbH[_0xfcc8('0x87')][_0xfcc8('0x33')](_0x398d11[_0xfcc8('0x86')](),{'type':dbH[_0xfcc8('0x87')]['QueryTypes'][_0xfcc8('0x89')]});})[_0xfcc8('0x22')](function(_0x213c53){return{'rows':_0x213c53||[],'count':_0x1cd5c6};});}});}exports[_0xfcc8('0xa4')]=function(_0x50769e,_0x4f10c8){return runReport(_0x50769e[_0xfcc8('0x48')],_0x50769e[_0xfcc8('0x33')],_0x50769e[_0xfcc8('0x43')])[_0xfcc8('0x22')](respondWithResult(_0x4f10c8,null))['catch'](handleError(_0x4f10c8,null));};exports[_0xfcc8('0xa5')]=runReport;exports[_0xfcc8('0x33')]=function(_0x339b33,_0x4a66f8){var _0x42ea55=0xa;var _0x47a309=['join',_0xfcc8('0x8a'),_0xfcc8('0x58'),'cross_join'];var _0x1cab95={'SUM':'SUM(%s)','COUNT':_0xfcc8('0x5a'),'COUNT DISTINCT':_0xfcc8('0x5b'),'MAX':_0xfcc8('0x5c'),'MIN':_0xfcc8('0x5d'),'AVG':_0xfcc8('0x8c'),'GROUP_CONCAT':_0xfcc8('0x5e'),'GROUP_CONCAT ASC':_0xfcc8('0x5f'),'GROUP_CONCAT DESC':_0xfcc8('0x8d')};var _0x4576c1={'SEC_TO_TIME':_0xfcc8('0x60'),'DATE':_0xfcc8('0xa6'),'HOUR':_0xfcc8('0x61'),'ROUND':'ROUND(%s)','UNIX_TIMESTAMP':'UNIX_TIMESTAMP(%s)'};var _0x2a5b02=function(_0x27f4c3){return!_[_0xfcc8('0x63')]([_0xfcc8('0x64'),_0xfcc8('0x65'),_0xfcc8('0x66'),_0xfcc8('0x67')],_0x27f4c3);};var _0x5be0d4=function(_0x35a04e){if(!_0x35a04e||!_0x35a04e[_0xfcc8('0x68')]['length']){return'';}for(var _0x4d9bad='(',_0x5db970=0x0;_0x5db970<_0x35a04e[_0xfcc8('0x68')][_0xfcc8('0x37')];_0x5db970+=0x1){_0x5db970>0x0&&(_0x4d9bad+='\x20'+_0x35a04e[_0xfcc8('0x69')]+'\x20');_0x4d9bad+=_0x35a04e[_0xfcc8('0x68')][_0x5db970]['group']?_0x5be0d4(_0x35a04e['rules'][_0x5db970][_0xfcc8('0x6a')]):_0x35a04e[_0xfcc8('0x68')][_0x5db970][_0xfcc8('0x76')]+'\x20'+_0x35a04e[_0xfcc8('0x68')][_0x5db970][_0xfcc8('0x6b')]+(_0x2a5b02(_0x35a04e[_0xfcc8('0x68')][_0x5db970][_0xfcc8('0x6b')])?'\x20'+_0x35a04e[_0xfcc8('0x68')][_0x5db970][_0xfcc8('0x6c')]:'');}return _0x4d9bad+')';};var _0xbfbf5f={'where':{'id':_0x339b33[_0xfcc8('0x48')]['id']}},_0x323f79,_0xbba71d,_0x220545,_0x20eb64,_0x20d0c4;_0xbfbf5f=_[_0xfcc8('0x40')]({},_0xbfbf5f,_0x339b33[_0xfcc8('0x43')]);return db[_0xfcc8('0x2d')][_0xfcc8('0x4f')](_0xbfbf5f)[_0xfcc8('0x22')](function(_0xbbb84d){if(_0xbbb84d){_0x323f79=_0xbbb84d;return _0xbbb84d['getFields']();}return null;})[_0xfcc8('0x22')](function(_0x142f6a){if(_0x142f6a){if(!_0x142f6a['length']){throw new db['Sequelize'][(_0xfcc8('0x6f'))](_0xfcc8('0x70'),0x193);}_0xbba71d=_0x142f6a;return db[_0xfcc8('0x71')][_0xfcc8('0x46')]({'raw':!![]});}return null;})[_0xfcc8('0x22')](function(_0xa04524){if(_0xa04524){_0x220545=_[_0xfcc8('0xa7')](_0xa04524,'id');var _0xf1eb55;var _0x5b8dab=squel['select']();_0x5b8dab[_0xfcc8('0x73')](_0x323f79[_0xfcc8('0x83')]);for(var _0x236d4d=0x0;_0x236d4d<_0xbba71d[_0xfcc8('0x37')];_0x236d4d+=0x1){_0xf1eb55=_0xbba71d[_0x236d4d]['MetricId']?_0x220545[_0xbba71d[_0x236d4d][_0xfcc8('0x74')]][_0xfcc8('0x75')]:_0xbba71d[_0x236d4d][_0xfcc8('0x76')];_0xf1eb55=_0xbba71d[_0x236d4d][_0xfcc8('0x77')]?_['replace'](_0x1cab95[_0xbba71d[_0x236d4d][_0xfcc8('0x77')]],'%s',_0xf1eb55):_0xf1eb55;_0xf1eb55=_0xbba71d[_0x236d4d][_0xfcc8('0x78')]?_[_0xfcc8('0x79')](_0x4576c1[_0xbba71d[_0x236d4d]['format']],'%s',_0xf1eb55):_0xf1eb55;if(_0xbba71d[_0x236d4d][_0xfcc8('0x7a')]){_0x5b8dab[_0xfcc8('0x6a')](_0xf1eb55);}_0xbba71d[_0x236d4d][_0xfcc8('0x7b')]&&_0x5b8dab[_0xfcc8('0x3a')](_0xf1eb55,_0xbba71d[_0x236d4d][_0xfcc8('0x7b')]===_0xfcc8('0x7c')?![]:!![]);_0x5b8dab[_0xfcc8('0x76')](_0xf1eb55,_0xbba71d[_0x236d4d][_0xfcc8('0x8f')]||_0xf1eb55);}if(_0x323f79[_0xfcc8('0x7d')]){_0x323f79[_0xfcc8('0x7d')]=JSON[_0xfcc8('0x7e')](_0x323f79[_0xfcc8('0x7d')]);for(var _0x2546f3=0x0;_0x2546f3<_0x323f79[_0xfcc8('0x7d')][_0xfcc8('0x37')];_0x2546f3+=0x1){if(_0x323f79[_0xfcc8('0x7d')][_0x2546f3][_0xfcc8('0x30')]&&_[_0xfcc8('0x63')](_0x47a309,_0x323f79[_0xfcc8('0x7d')][_0x2546f3]['type'])&&_0x323f79['joins'][_0x2546f3]['parentKey']&&_0x323f79[_0xfcc8('0x7d')][_0x2546f3][_0xfcc8('0x80')]&&_0x323f79[_0xfcc8('0x7d')][_0x2546f3][_0xfcc8('0x81')]){_0x5b8dab[_0x323f79['joins'][_0x2546f3][_0xfcc8('0x30')]](_0x323f79[_0xfcc8('0x7d')][_0x2546f3][_0xfcc8('0x80')],null,util[_0xfcc8('0x78')](_0xfcc8('0x82'),_0x323f79[_0xfcc8('0x83')],_0x323f79[_0xfcc8('0x7d')][_0x2546f3][_0xfcc8('0x7f')],_0x323f79['joins'][_0x2546f3][_0xfcc8('0x80')],_0x323f79['joins'][_0x2546f3][_0xfcc8('0x81')]));}}}if(_0x323f79[_0xfcc8('0x84')]){_0x323f79[_0xfcc8('0x84')]=JSON[_0xfcc8('0x7e')](_0x323f79[_0xfcc8('0x84')]);_0x5b8dab[_0xfcc8('0x3c')](_0x5be0d4(_0x323f79['conditions'][_0xfcc8('0x6a')]));}_0x20d0c4=_0x5b8dab[_0xfcc8('0x90')]();_0x5b8dab[_0xfcc8('0x1b')](_0x42ea55);_0x5b8dab[_0xfcc8('0x18')](0x0);logger[_0xfcc8('0xa8')]('Limited\x20Query:',_0x5b8dab[_0xfcc8('0x86')]());return dbH[_0xfcc8('0x87')]['query'](_0x5b8dab[_0xfcc8('0x86')](),{'type':dbH['sequelize'][_0xfcc8('0x88')][_0xfcc8('0x89')]});}})[_0xfcc8('0x22')](function(){return{'sql':_0x20d0c4[_0xfcc8('0x86')]()};})['then'](respondWithResult(_0x4a66f8,null))[_0xfcc8('0x54')](handleError(_0x4a66f8,null));};
\ No newline at end of file
+var _0xf4ba=['groupBy','orderBy','DESC','alias','joins','parse','parentKey','foreignTable','foreignKey','%s.%s\x20=\x20%s.%s','conditions','clone','debug','Limited\x20Query:','toString','sequelize','QueryTypes','SELECT','COUNT(%s)','MAX(%s)','MIN(%s)','SEC_TO_TIME(%s)','HOUR(%s)','value','getFields','Please\x20insert\x20at\x20least\x20one\x20field','findAll','output','web','fullPath','%s-%s.%s','randomstring','generate','custom','cdr','.calldate\x20BETWEEN\x20?\x20AND\x20?','startDate','endDate','info','Run\x20Query:','child_process','fork','../../components/export/','../../files/reports','savename','countTable','COUNT(*)','run','runReport','IS\x20EMPTY','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/logger','api','../../config/environment','../../mysqldb','sendStatus','status','end','json','undefined','limit','count','set','Content-Range','reject','save','then','destroy','get','UserProfileResource','error','name','index','map','AnalyticCustomReport','rawAttributes','type','key','model','keys','query','intersection','attributes','fields','length','hasOwnProperty','nolimit','offset','order','sort','filters','pick','where','merge','filter','options','rows','show','include','catch','create','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','UserProfileSection','autoAssociation','CustomReports','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','find','params','preview','join','left_join','right_join','cross_join','SUM(%s)','COUNT(DISTINCT\x20%s)','AVG(%s)','GROUP_CONCAT(%s)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)','DATE(%s)','ROUND(%s)','UNIX_TIMESTAMP(%s)','includes','IS\x20NULL','IS\x20NOT\x20NULL','IS\x20NOT\x20EMPTY','rules','operator','group','field','condition','Sequelize','ValidationErrorItem','AnalyticMetric','keyBy','select','from','table','MetricId','metric','function','replace','format'];(function(_0x486f4a,_0x478dc7){var _0x135d99=function(_0x434008){while(--_0x434008){_0x486f4a['push'](_0x486f4a['shift']());}};_0x135d99(++_0x478dc7);}(_0xf4ba,0x17e));var _0xaf4b=function(_0x274ac7,_0xd3b201){_0x274ac7=_0x274ac7-0x0;var _0x1f9a15=_0xf4ba[_0x274ac7];return _0x1f9a15;};'use strict';var emlformat=require(_0xaf4b('0x0'));var rimraf=require(_0xaf4b('0x1'));var zipdir=require(_0xaf4b('0x2'));var jsonpatch=require(_0xaf4b('0x3'));var rp=require(_0xaf4b('0x4'));var moment=require(_0xaf4b('0x5'));var BPromise=require('bluebird');var Mustache=require(_0xaf4b('0x6'));var util=require(_0xaf4b('0x7'));var path=require('path');var sox=require(_0xaf4b('0x8'));var csv=require(_0xaf4b('0x9'));var ejs=require(_0xaf4b('0xa'));var fs=require('fs');var fs_extra=require(_0xaf4b('0xb'));var _=require(_0xaf4b('0xc'));var squel=require(_0xaf4b('0xd'));var crypto=require(_0xaf4b('0xe'));var jsforce=require(_0xaf4b('0xf'));var deskjs=require(_0xaf4b('0x10'));var toCsv=require(_0xaf4b('0x9'));var querystring=require(_0xaf4b('0x11'));var Papa=require('papaparse');var Redis=require(_0xaf4b('0x12'));var authService=require(_0xaf4b('0x13'));var qs=require('../../components/parsers/qs');var as=require(_0xaf4b('0x14'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xaf4b('0x15'))(_0xaf4b('0x16'));var utils=require('../../config/utils');var config=require(_0xaf4b('0x17'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];var dbH=require(_0xaf4b('0x18'))['dbH'];function respondWithStatusCode(_0x36afe5,_0x2a1ca5){_0x2a1ca5=_0x2a1ca5||0xcc;return function(_0x268a92){if(_0x268a92){return _0x36afe5[_0xaf4b('0x19')](_0x2a1ca5);}return _0x36afe5[_0xaf4b('0x1a')](_0x2a1ca5)[_0xaf4b('0x1b')]();};}function respondWithResult(_0x529fae,_0x566f3b){_0x566f3b=_0x566f3b||0xc8;return function(_0xb38b08){if(_0xb38b08){return _0x529fae[_0xaf4b('0x1a')](_0x566f3b)[_0xaf4b('0x1c')](_0xb38b08);}};}function respondWithFilteredResult(_0x2e1176,_0x5049dd){return function(_0xb49cba){if(_0xb49cba){var _0x5a4968=typeof _0x5049dd['offset']===_0xaf4b('0x1d')&&typeof _0x5049dd[_0xaf4b('0x1e')]===_0xaf4b('0x1d');var _0x5b03a9=_0xb49cba[_0xaf4b('0x1f')];var _0x474235=_0x5a4968?0x0:_0x5049dd['offset'];var _0x4d4fe6=_0x5a4968?_0xb49cba[_0xaf4b('0x1f')]:_0x5049dd['offset']+_0x5049dd['limit'];var _0x3046be;if(_0x4d4fe6>=_0x5b03a9){_0x4d4fe6=_0x5b03a9;_0x3046be=0xc8;}else{_0x3046be=0xce;}_0x2e1176[_0xaf4b('0x1a')](_0x3046be);return _0x2e1176[_0xaf4b('0x20')](_0xaf4b('0x21'),_0x474235+'-'+_0x4d4fe6+'/'+_0x5b03a9)[_0xaf4b('0x1c')](_0xb49cba);}return null;};}function patchUpdates(_0x53e347){return function(_0x1b40b3){try{jsonpatch['apply'](_0x1b40b3,_0x53e347,!![]);}catch(_0x2fe2b0){return BPromise[_0xaf4b('0x22')](_0x2fe2b0);}return _0x1b40b3[_0xaf4b('0x23')]();};}function saveUpdates(_0x50f0da,_0x1bf850){return function(_0x54e386){if(_0x54e386){return _0x54e386['update'](_0x50f0da)[_0xaf4b('0x24')](function(_0x549915){return _0x549915;});}return null;};}function removeEntity(_0x2f183c,_0x459dc5){return function(_0x24d860){if(_0x24d860){return _0x24d860[_0xaf4b('0x25')]()['then'](function(){var _0x598efd=_0x24d860[_0xaf4b('0x26')]({'plain':!![]});var _0x44c1bb='CustomReports';return db[_0xaf4b('0x27')][_0xaf4b('0x25')]({'where':{'type':_0x44c1bb,'resourceId':_0x598efd['id']}})['then'](function(){return _0x24d860;});})[_0xaf4b('0x24')](function(){_0x2f183c[_0xaf4b('0x1a')](0xcc)['end']();});}};}function handleEntityNotFound(_0x3a7600,_0x5fe575){return function(_0x12bffd){if(!_0x12bffd){_0x3a7600[_0xaf4b('0x19')](0x194);}return _0x12bffd;};}function handleError(_0xdf4093,_0x5556e2){_0x5556e2=_0x5556e2||0x1f4;return function(_0x35bbc1){logger[_0xaf4b('0x28')](_0x35bbc1['stack']);if(_0x35bbc1[_0xaf4b('0x29')]){delete _0x35bbc1[_0xaf4b('0x29')];}_0xdf4093['status'](_0x5556e2)['send'](_0x35bbc1);};}exports[_0xaf4b('0x2a')]=function(_0xc896d6,_0x21f140){var _0x12006b={},_0x5982e4={},_0x538ede={'count':0x0,'rows':[]};var _0x486faf=_[_0xaf4b('0x2b')](db[_0xaf4b('0x2c')][_0xaf4b('0x2d')],function(_0x5e04fa){return{'name':_0x5e04fa['fieldName'],'type':_0x5e04fa[_0xaf4b('0x2e')][_0xaf4b('0x2f')]};});_0x5982e4[_0xaf4b('0x30')]=_[_0xaf4b('0x2b')](_0x486faf,_0xaf4b('0x29'));_0x5982e4['query']=_[_0xaf4b('0x31')](_0xc896d6[_0xaf4b('0x32')]);_0x5982e4['filters']=_[_0xaf4b('0x33')](_0x5982e4[_0xaf4b('0x30')],_0x5982e4['query']);_0x12006b[_0xaf4b('0x34')]=_['intersection'](_0x5982e4[_0xaf4b('0x30')],qs[_0xaf4b('0x35')](_0xc896d6[_0xaf4b('0x32')][_0xaf4b('0x35')]));_0x12006b[_0xaf4b('0x34')]=_0x12006b[_0xaf4b('0x34')][_0xaf4b('0x36')]?_0x12006b['attributes']:_0x5982e4[_0xaf4b('0x30')];if(!_0xc896d6[_0xaf4b('0x32')][_0xaf4b('0x37')](_0xaf4b('0x38'))){_0x12006b[_0xaf4b('0x1e')]=qs[_0xaf4b('0x1e')](_0xc896d6[_0xaf4b('0x32')]['limit']);_0x12006b[_0xaf4b('0x39')]=qs[_0xaf4b('0x39')](_0xc896d6['query'][_0xaf4b('0x39')]);}_0x12006b[_0xaf4b('0x3a')]=qs[_0xaf4b('0x3b')](_0xc896d6[_0xaf4b('0x32')][_0xaf4b('0x3b')]);_0x12006b['where']=qs[_0xaf4b('0x3c')](_[_0xaf4b('0x3d')](_0xc896d6[_0xaf4b('0x32')],_0x5982e4['filters']),_0x486faf);if(_0xc896d6[_0xaf4b('0x32')]['filter']){_0x12006b[_0xaf4b('0x3e')]=_[_0xaf4b('0x3f')](_0x12006b['where'],{'$or':_[_0xaf4b('0x2b')](_0x486faf,function(_0x492359){if(_0x492359['type']!=='VIRTUAL'){var _0x40dcd8={};_0x40dcd8[_0x492359[_0xaf4b('0x29')]]={'$like':'%'+_0xc896d6[_0xaf4b('0x32')][_0xaf4b('0x40')]+'%'};return _0x40dcd8;}})});}_0x12006b=_[_0xaf4b('0x3f')]({},_0x12006b,_0xc896d6[_0xaf4b('0x41')]);var _0x2541b1={'where':_0x12006b[_0xaf4b('0x3e')]};return db[_0xaf4b('0x2c')]['count'](_0x2541b1)[_0xaf4b('0x24')](function(_0x52fb8e){_0x538ede[_0xaf4b('0x1f')]=_0x52fb8e;if(_0xc896d6[_0xaf4b('0x32')]['includeAll']){_0x12006b['include']=[{'all':!![]}];}return db['AnalyticCustomReport']['findAll'](_0x12006b);})[_0xaf4b('0x24')](function(_0x3a4a6f){_0x538ede[_0xaf4b('0x42')]=_0x3a4a6f;return _0x538ede;})[_0xaf4b('0x24')](respondWithFilteredResult(_0x21f140,_0x12006b))['catch'](handleError(_0x21f140,null));};exports[_0xaf4b('0x43')]=function(_0x58078b,_0xa01f60){var _0x2a059b={'raw':![],'where':{'id':_0x58078b['params']['id']}},_0x552753={};_0x552753[_0xaf4b('0x30')]=_[_0xaf4b('0x31')](db['AnalyticCustomReport'][_0xaf4b('0x2d')]);_0x552753[_0xaf4b('0x32')]=_[_0xaf4b('0x31')](_0x58078b[_0xaf4b('0x32')]);_0x552753[_0xaf4b('0x3c')]=_['intersection'](_0x552753[_0xaf4b('0x30')],_0x552753[_0xaf4b('0x32')]);_0x2a059b['attributes']=_['intersection'](_0x552753['model'],qs[_0xaf4b('0x35')](_0x58078b[_0xaf4b('0x32')][_0xaf4b('0x35')]));_0x2a059b[_0xaf4b('0x34')]=_0x2a059b['attributes'][_0xaf4b('0x36')]?_0x2a059b[_0xaf4b('0x34')]:_0x552753[_0xaf4b('0x30')];if(_0x58078b[_0xaf4b('0x32')]['includeAll']){_0x2a059b[_0xaf4b('0x44')]=[{'all':!![]}];}_0x2a059b=_['merge']({},_0x2a059b,_0x58078b[_0xaf4b('0x41')]);return db[_0xaf4b('0x2c')]['find'](_0x2a059b)[_0xaf4b('0x24')](handleEntityNotFound(_0xa01f60,null))[_0xaf4b('0x24')](respondWithResult(_0xa01f60,null))[_0xaf4b('0x45')](handleError(_0xa01f60,null));};exports[_0xaf4b('0x46')]=function(_0x56638a,_0x14213a){return db[_0xaf4b('0x2c')][_0xaf4b('0x46')](_0x56638a['body'],{})[_0xaf4b('0x24')](function(_0x544976){var _0x262883=_0x56638a['user'][_0xaf4b('0x26')]({'plain':!![]});if(!_0x262883)throw new Error(_0xaf4b('0x47'));if(_0x262883[_0xaf4b('0x48')]===_0xaf4b('0x49')){var _0x477517=_0x544976[_0xaf4b('0x26')]({'plain':!![]});var _0x57b648='Reports';return db[_0xaf4b('0x4a')]['find']({'where':{'name':_0x57b648,'userProfileId':_0x262883['userProfileId']},'raw':!![]})[_0xaf4b('0x24')](function(_0xfa2fde){if(_0xfa2fde&&_0xfa2fde[_0xaf4b('0x4b')]===0x0){return db[_0xaf4b('0x27')]['create']({'name':_0x477517[_0xaf4b('0x29')],'resourceId':_0x477517['id'],'type':_0xaf4b('0x4c'),'sectionId':_0xfa2fde['id']},{})[_0xaf4b('0x24')](function(){return _0x544976;});}else{return _0x544976;}})['catch'](function(_0x5221e1){logger[_0xaf4b('0x28')](_0xaf4b('0x4d'),_0x5221e1);throw _0x5221e1;});}return _0x544976;})[_0xaf4b('0x24')](respondWithResult(_0x14213a,0xc9))[_0xaf4b('0x45')](handleError(_0x14213a,null));};exports['update']=function(_0x52804c,_0x594956){if(_0x52804c[_0xaf4b('0x4e')]['id']){delete _0x52804c['body']['id'];}return db['AnalyticCustomReport'][_0xaf4b('0x4f')]({'where':{'id':_0x52804c[_0xaf4b('0x50')]['id']}})[_0xaf4b('0x24')](handleEntityNotFound(_0x594956,null))['then'](saveUpdates(_0x52804c['body'],null))[_0xaf4b('0x24')](respondWithResult(_0x594956,null))[_0xaf4b('0x45')](handleError(_0x594956,null));};exports[_0xaf4b('0x25')]=function(_0x1d49b8,_0x4fcbe1){return db[_0xaf4b('0x2c')][_0xaf4b('0x4f')]({'where':{'id':_0x1d49b8[_0xaf4b('0x50')]['id']}})[_0xaf4b('0x24')](handleEntityNotFound(_0x4fcbe1,null))[_0xaf4b('0x24')](removeEntity(_0x4fcbe1,null))['catch'](handleError(_0x4fcbe1,null));};exports[_0xaf4b('0x51')]=function(_0x40dd22,_0x1fee08){var _0x2284b5=0xa;var _0x3da460=[_0xaf4b('0x52'),_0xaf4b('0x53'),_0xaf4b('0x54'),_0xaf4b('0x55')];var _0x446ffe={'SUM':_0xaf4b('0x56'),'COUNT':'COUNT(%s)','COUNT DISTINCT':_0xaf4b('0x57'),'MAX':'MAX(%s)','MIN':'MIN(%s)','AVG':_0xaf4b('0x58'),'GROUP_CONCAT':_0xaf4b('0x59'),'GROUP_CONCAT ASC':_0xaf4b('0x5a'),'GROUP_CONCAT DESC':_0xaf4b('0x5b')};var _0x33573a={'SEC_TO_TIME':'SEC_TO_TIME(%s)','DATE':_0xaf4b('0x5c'),'HOUR':'HOUR(%s)','ROUND':_0xaf4b('0x5d'),'UNIX_TIMESTAMP':_0xaf4b('0x5e')};var _0x2dd756=function(_0x30c493){return!_[_0xaf4b('0x5f')]([_0xaf4b('0x60'),_0xaf4b('0x61'),'IS\x20EMPTY',_0xaf4b('0x62')],_0x30c493);};var _0x52498f=function(_0xa3c7bc){if(!_0xa3c7bc||!_0xa3c7bc[_0xaf4b('0x63')][_0xaf4b('0x36')]){return'';}for(var _0x35207e='(',_0x9d2c94=0x0;_0x9d2c94<_0xa3c7bc[_0xaf4b('0x63')]['length'];_0x9d2c94+=0x1){_0x9d2c94>0x0&&(_0x35207e+='\x20'+_0xa3c7bc[_0xaf4b('0x64')]+'\x20');_0x35207e+=_0xa3c7bc[_0xaf4b('0x63')][_0x9d2c94]['group']?_0x52498f(_0xa3c7bc['rules'][_0x9d2c94][_0xaf4b('0x65')]):_0xa3c7bc[_0xaf4b('0x63')][_0x9d2c94][_0xaf4b('0x66')]+'\x20'+_0xa3c7bc[_0xaf4b('0x63')][_0x9d2c94][_0xaf4b('0x67')]+(_0x2dd756(_0xa3c7bc[_0xaf4b('0x63')][_0x9d2c94][_0xaf4b('0x67')])?'\x20'+_0xa3c7bc[_0xaf4b('0x63')][_0x9d2c94]['value']:'');}return _0x35207e+')';};var _0x2ab791={'where':{'id':_0x40dd22[_0xaf4b('0x50')]['id']}},_0x4be5bd,_0x10556a,_0x5452ab,_0x2bb6c3,_0x80732c;_0x2ab791=_['merge']({},_0x2ab791,_0x40dd22[_0xaf4b('0x41')]);return db[_0xaf4b('0x2c')][_0xaf4b('0x4f')](_0x2ab791)[_0xaf4b('0x24')](function(_0x5488fc){if(_0x5488fc){_0x4be5bd=_0x5488fc;return _0x5488fc['getFields']();}return null;})['then'](function(_0x464556){if(_0x464556){if(!_0x464556[_0xaf4b('0x36')]){throw new db[(_0xaf4b('0x68'))][(_0xaf4b('0x69'))]('Please\x20insert\x20at\x20least\x20one\x20field',0x193);}_0x10556a=_0x464556;return db[_0xaf4b('0x6a')]['findAll']({'raw':!![]});}return null;})[_0xaf4b('0x24')](function(_0xc3daa9){if(_0xc3daa9){_0x5452ab=_[_0xaf4b('0x6b')](_0xc3daa9,'id');var _0x1f1938;var _0x452d54=squel[_0xaf4b('0x6c')]();_0x452d54[_0xaf4b('0x6d')](_0x4be5bd[_0xaf4b('0x6e')]);for(var _0x46d4e8=0x0;_0x46d4e8<_0x10556a[_0xaf4b('0x36')];_0x46d4e8+=0x1){_0x1f1938=_0x10556a[_0x46d4e8][_0xaf4b('0x6f')]?_0x5452ab[_0x10556a[_0x46d4e8][_0xaf4b('0x6f')]][_0xaf4b('0x70')]:_0x10556a[_0x46d4e8][_0xaf4b('0x66')];_0x1f1938=_0x10556a[_0x46d4e8][_0xaf4b('0x71')]?_[_0xaf4b('0x72')](_0x446ffe[_0x10556a[_0x46d4e8][_0xaf4b('0x71')]],'%s',_0x1f1938):_0x1f1938;_0x1f1938=_0x10556a[_0x46d4e8][_0xaf4b('0x73')]?_[_0xaf4b('0x72')](_0x33573a[_0x10556a[_0x46d4e8][_0xaf4b('0x73')]],'%s',_0x1f1938):_0x1f1938;if(_0x10556a[_0x46d4e8][_0xaf4b('0x74')]){_0x452d54[_0xaf4b('0x65')](_0x1f1938);}_0x10556a[_0x46d4e8][_0xaf4b('0x75')]&&_0x452d54[_0xaf4b('0x3a')](_0x1f1938,_0x10556a[_0x46d4e8]['orderBy']===_0xaf4b('0x76')?![]:!![]);_0x452d54['field'](_0x1f1938,_0x10556a[_0x46d4e8][_0xaf4b('0x77')]||_0x1f1938);}if(_0x4be5bd[_0xaf4b('0x78')]){_0x4be5bd[_0xaf4b('0x78')]=JSON[_0xaf4b('0x79')](_0x4be5bd[_0xaf4b('0x78')]);for(var _0x431c08=0x0;_0x431c08<_0x4be5bd[_0xaf4b('0x78')]['length'];_0x431c08+=0x1){if(_0x4be5bd['joins'][_0x431c08][_0xaf4b('0x2e')]&&_[_0xaf4b('0x5f')](_0x3da460,_0x4be5bd[_0xaf4b('0x78')][_0x431c08]['type'])&&_0x4be5bd[_0xaf4b('0x78')][_0x431c08][_0xaf4b('0x7a')]&&_0x4be5bd['joins'][_0x431c08][_0xaf4b('0x7b')]&&_0x4be5bd[_0xaf4b('0x78')][_0x431c08][_0xaf4b('0x7c')]){_0x452d54[_0x4be5bd[_0xaf4b('0x78')][_0x431c08]['type']](_0x4be5bd['joins'][_0x431c08]['foreignTable'],null,util['format'](_0xaf4b('0x7d'),_0x4be5bd['table'],_0x4be5bd[_0xaf4b('0x78')][_0x431c08][_0xaf4b('0x7a')],_0x4be5bd[_0xaf4b('0x78')][_0x431c08][_0xaf4b('0x7b')],_0x4be5bd['joins'][_0x431c08][_0xaf4b('0x7c')]));}}}if(_0x4be5bd[_0xaf4b('0x7e')]){_0x4be5bd[_0xaf4b('0x7e')]=JSON['parse'](_0x4be5bd[_0xaf4b('0x7e')]);_0x452d54[_0xaf4b('0x3e')](_0x52498f(_0x4be5bd[_0xaf4b('0x7e')][_0xaf4b('0x65')]));}_0x80732c=_0x452d54[_0xaf4b('0x7f')]();_0x452d54[_0xaf4b('0x1e')](_0x2284b5);_0x452d54[_0xaf4b('0x39')](0x0);logger[_0xaf4b('0x80')](_0xaf4b('0x81'),_0x452d54[_0xaf4b('0x82')]());return dbH[_0xaf4b('0x83')][_0xaf4b('0x32')](_0x452d54['toString'](),{'type':dbH[_0xaf4b('0x83')][_0xaf4b('0x84')][_0xaf4b('0x85')]});}})[_0xaf4b('0x24')](respondWithResult(_0x1fee08,null))[_0xaf4b('0x45')](handleError(_0x1fee08,null));};function runReport(_0x1c8638,_0x26e848,_0x105bb6){var _0x484e1f=_0x26e848[_0xaf4b('0x29')];var _0x13d6c1=0xa;var _0x93ca91=['join','left_join',_0xaf4b('0x54'),_0xaf4b('0x55')];var _0xa03660={'SUM':'SUM(%s)','COUNT':_0xaf4b('0x86'),'COUNT DISTINCT':_0xaf4b('0x57'),'MAX':_0xaf4b('0x87'),'MIN':_0xaf4b('0x88'),'AVG':_0xaf4b('0x58'),'GROUP_CONCAT':_0xaf4b('0x59'),'GROUP_CONCAT ASC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT DESC':_0xaf4b('0x5b')};var _0x421d31={'SEC_TO_TIME':_0xaf4b('0x89'),'DATE':'DATE(%s)','HOUR':_0xaf4b('0x8a'),'ROUND':_0xaf4b('0x5d'),'UNIX_TIMESTAMP':'UNIX_TIMESTAMP(%s)'};var _0x19cb2e=function(_0xd458){return!_[_0xaf4b('0x5f')]([_0xaf4b('0x60'),_0xaf4b('0x61'),'IS\x20EMPTY',_0xaf4b('0x62')],_0xd458);};var _0x39cf5f=function(_0x132100){if(!_0x132100||!_0x132100[_0xaf4b('0x63')][_0xaf4b('0x36')]){return'';}for(var _0x515cda='(',_0x4c2d8e=0x0;_0x4c2d8e<_0x132100[_0xaf4b('0x63')][_0xaf4b('0x36')];_0x4c2d8e+=0x1){_0x4c2d8e>0x0&&(_0x515cda+='\x20'+_0x132100['operator']+'\x20');_0x515cda+=_0x132100[_0xaf4b('0x63')][_0x4c2d8e]['group']?_0x39cf5f(_0x132100[_0xaf4b('0x63')][_0x4c2d8e]['group']):_0x132100[_0xaf4b('0x63')][_0x4c2d8e][_0xaf4b('0x66')]+'\x20'+_0x132100[_0xaf4b('0x63')][_0x4c2d8e][_0xaf4b('0x67')]+(_0x19cb2e(_0x132100[_0xaf4b('0x63')][_0x4c2d8e]['condition'])?'\x20'+_0x132100['rules'][_0x4c2d8e][_0xaf4b('0x8b')]:'');}return _0x515cda+')';};var _0x169c73={'where':{'id':_0x1c8638['id']}},_0x3acfd5,_0x283909,_0x4fb0b0,_0x26f070,_0x19fce9;_0x169c73=_[_0xaf4b('0x3f')]({},_0x169c73,_0x105bb6);return db['AnalyticCustomReport'][_0xaf4b('0x4f')](_0x169c73)[_0xaf4b('0x24')](function(_0x244452){if(_0x244452){_0x3acfd5=_0x244452;return _0x244452[_0xaf4b('0x8c')]();}return null;})[_0xaf4b('0x24')](function(_0x115289){if(_0x115289){if(!_0x115289[_0xaf4b('0x36')]){throw new db['Sequelize'][(_0xaf4b('0x69'))](_0xaf4b('0x8d'),0x193);}_0x283909=_0x115289;return db[_0xaf4b('0x6a')][_0xaf4b('0x8e')]({'raw':!![]});}return null;})[_0xaf4b('0x24')](function(_0x49ba71){if(_0x49ba71){_0x4fb0b0=_[_0xaf4b('0x6b')](_0x49ba71,'id');var _0x3774cb;var _0x47ff40=squel[_0xaf4b('0x6c')]();_0x47ff40[_0xaf4b('0x6d')](_0x3acfd5[_0xaf4b('0x6e')]);for(var _0x433d16=0x0;_0x433d16<_0x283909[_0xaf4b('0x36')];_0x433d16+=0x1){_0x3774cb=_0x283909[_0x433d16][_0xaf4b('0x6f')]?_0x4fb0b0[_0x283909[_0x433d16][_0xaf4b('0x6f')]]['metric']:_0x283909[_0x433d16][_0xaf4b('0x66')];_0x3774cb=_0x283909[_0x433d16][_0xaf4b('0x71')]?_[_0xaf4b('0x72')](_0xa03660[_0x283909[_0x433d16][_0xaf4b('0x71')]],'%s',_0x3774cb):_0x3774cb;_0x3774cb=_0x283909[_0x433d16]['format']?_[_0xaf4b('0x72')](_0x421d31[_0x283909[_0x433d16][_0xaf4b('0x73')]],'%s',_0x3774cb):_0x3774cb;if(_0x283909[_0x433d16][_0xaf4b('0x74')]){_0x47ff40[_0xaf4b('0x65')](_0x3774cb);}_0x283909[_0x433d16][_0xaf4b('0x75')]&&_0x47ff40[_0xaf4b('0x3a')](_0x3774cb,_0x283909[_0x433d16][_0xaf4b('0x75')]===_0xaf4b('0x76')?![]:!![]);_0x47ff40[_0xaf4b('0x66')](_0x3774cb,_0x283909[_0x433d16][_0xaf4b('0x77')]||_0x3774cb);}if(_0x3acfd5['joins']){_0x3acfd5[_0xaf4b('0x78')]=JSON['parse'](_0x3acfd5['joins']);for(var _0xc7bafd=0x0;_0xc7bafd<_0x3acfd5[_0xaf4b('0x78')][_0xaf4b('0x36')];_0xc7bafd+=0x1){if(_0x3acfd5[_0xaf4b('0x78')][_0xc7bafd][_0xaf4b('0x2e')]&&_[_0xaf4b('0x5f')](_0x93ca91,_0x3acfd5['joins'][_0xc7bafd][_0xaf4b('0x2e')])&&_0x3acfd5['joins'][_0xc7bafd]['parentKey']&&_0x3acfd5[_0xaf4b('0x78')][_0xc7bafd]['foreignTable']&&_0x3acfd5[_0xaf4b('0x78')][_0xc7bafd]['foreignKey']){_0x47ff40[_0x3acfd5[_0xaf4b('0x78')][_0xc7bafd]['type']](_0x3acfd5[_0xaf4b('0x78')][_0xc7bafd][_0xaf4b('0x7b')],null,util[_0xaf4b('0x73')](_0xaf4b('0x7d'),_0x3acfd5[_0xaf4b('0x6e')],_0x3acfd5[_0xaf4b('0x78')][_0xc7bafd][_0xaf4b('0x7a')],_0x3acfd5[_0xaf4b('0x78')][_0xc7bafd]['foreignTable'],_0x3acfd5[_0xaf4b('0x78')][_0xc7bafd][_0xaf4b('0x7c')]));}}}if(_0x3acfd5[_0xaf4b('0x7e')]){_0x3acfd5[_0xaf4b('0x7e')]=JSON[_0xaf4b('0x79')](_0x3acfd5['conditions']);_0x47ff40[_0xaf4b('0x3e')](_0x39cf5f(_0x3acfd5['conditions']['group']));}_0x19fce9=_0x47ff40[_0xaf4b('0x7f')]();_0x47ff40['limit'](_0x13d6c1);_0x47ff40[_0xaf4b('0x39')](0x0);return;}})[_0xaf4b('0x24')](function(){if(_0x26e848[_0xaf4b('0x8f')]===_0xaf4b('0x90')){return null;}var _0x187eb5=_[_0xaf4b('0x3f')](_0x26e848,{'name':_0x26e848[_0xaf4b('0x91')]||_0x26e848[_0xaf4b('0x29')]||_0x3acfd5[_0xaf4b('0x29')],'basename':_0x484e1f,'savename':util[_0xaf4b('0x73')](_0xaf4b('0x92'),_0x26e848[_0xaf4b('0x29')]||_0x3acfd5[_0xaf4b('0x29')],require(_0xaf4b('0x93'))[_0xaf4b('0x94')](0x4),_0x26e848[_0xaf4b('0x8f')]||'csv'),'reportId':_0x3acfd5['id'],'reportType':_0xaf4b('0x95')});return db['AnalyticExtractedReport'][_0xaf4b('0x46')](_0x187eb5,{'raw':!![]});})['then'](function(_0x2879bc){if(_0x3acfd5[_0xaf4b('0x6e')]===_0xaf4b('0x96')){_0x19fce9[_0xaf4b('0x3e')](_0x3acfd5[_0xaf4b('0x6e')]+_0xaf4b('0x97'),_0x26e848[_0xaf4b('0x98')],_0x26e848[_0xaf4b('0x99')]);}else{_0x19fce9[_0xaf4b('0x3e')](_0x3acfd5[_0xaf4b('0x6e')]+'.createdAt\x20BETWEEN\x20?\x20AND\x20?',_0x26e848[_0xaf4b('0x98')],_0x26e848[_0xaf4b('0x99')]);}if(_0x2879bc){logger[_0xaf4b('0x9a')](_0xaf4b('0x9b'),_0x19fce9[_0xaf4b('0x82')]());require(_0xaf4b('0x9c'))[_0xaf4b('0x9d')](path[_0xaf4b('0x52')](__dirname,_0xaf4b('0x9e'),_0x2879bc[_0xaf4b('0x8f')]),[_0x2879bc['id'],_0x19fce9[_0xaf4b('0x82')](),path['join'](__dirname,_0xaf4b('0x9f'),_0x2879bc[_0xaf4b('0xa0')]),_0x484e1f]);return _0x2879bc;}else{var _0x2db0e2=squel[_0xaf4b('0x6c')]();_0x2db0e2[_0xaf4b('0x6d')]('('+_0x19fce9[_0xaf4b('0x82')]()+')',_0xaf4b('0xa1'));_0x2db0e2['field'](_0xaf4b('0xa2'),'count');_0x19fce9[_0xaf4b('0x1e')](_0x26e848[_0xaf4b('0x1e')]||_0x13d6c1);_0x19fce9[_0xaf4b('0x39')](_0x26e848[_0xaf4b('0x39')]||0x0);return dbH['sequelize'][_0xaf4b('0x32')](_0x2db0e2['toString'](),{'type':dbH[_0xaf4b('0x83')][_0xaf4b('0x84')][_0xaf4b('0x85')]})[_0xaf4b('0x24')](function(_0x368490){if(!_0x368490[_0xaf4b('0x36')]){_0x26f070=0x0;}else{_0x26f070=_0x368490[0x0]['count']||0x0;}return dbH[_0xaf4b('0x83')][_0xaf4b('0x32')](_0x19fce9['toString'](),{'type':dbH['sequelize'][_0xaf4b('0x84')][_0xaf4b('0x85')]});})[_0xaf4b('0x24')](function(_0x3ec89a){return{'rows':_0x3ec89a||[],'count':_0x26f070};});}});}exports[_0xaf4b('0xa3')]=function(_0x403848,_0xc8a385){return runReport(_0x403848['params'],_0x403848[_0xaf4b('0x32')],_0x403848[_0xaf4b('0x41')])['then'](respondWithResult(_0xc8a385,null))[_0xaf4b('0x45')](handleError(_0xc8a385,null));};exports[_0xaf4b('0xa4')]=runReport;exports[_0xaf4b('0x32')]=function(_0x363b8e,_0x3a8739){var _0x37ebba=0xa;var _0x3214c4=[_0xaf4b('0x52'),'left_join',_0xaf4b('0x54'),'cross_join'];var _0x3b8fda={'SUM':_0xaf4b('0x56'),'COUNT':_0xaf4b('0x86'),'COUNT DISTINCT':_0xaf4b('0x57'),'MAX':_0xaf4b('0x87'),'MIN':'MIN(%s)','AVG':_0xaf4b('0x58'),'GROUP_CONCAT':_0xaf4b('0x59'),'GROUP_CONCAT ASC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT DESC':_0xaf4b('0x5b')};var _0x5e67db={'SEC_TO_TIME':_0xaf4b('0x89'),'DATE':'DATE(%s)','HOUR':'HOUR(%s)','ROUND':'ROUND(%s)','UNIX_TIMESTAMP':'UNIX_TIMESTAMP(%s)'};var _0x3eacb1=function(_0x288785){return!_['includes'](['IS\x20NULL',_0xaf4b('0x61'),_0xaf4b('0xa5'),_0xaf4b('0x62')],_0x288785);};var _0x3258b0=function(_0x3be63c){if(!_0x3be63c||!_0x3be63c[_0xaf4b('0x63')][_0xaf4b('0x36')]){return'';}for(var _0x446074='(',_0x233581=0x0;_0x233581<_0x3be63c[_0xaf4b('0x63')]['length'];_0x233581+=0x1){_0x233581>0x0&&(_0x446074+='\x20'+_0x3be63c['operator']+'\x20');_0x446074+=_0x3be63c[_0xaf4b('0x63')][_0x233581][_0xaf4b('0x65')]?_0x3258b0(_0x3be63c[_0xaf4b('0x63')][_0x233581]['group']):_0x3be63c[_0xaf4b('0x63')][_0x233581][_0xaf4b('0x66')]+'\x20'+_0x3be63c['rules'][_0x233581]['condition']+(_0x3eacb1(_0x3be63c['rules'][_0x233581][_0xaf4b('0x67')])?'\x20'+_0x3be63c[_0xaf4b('0x63')][_0x233581]['value']:'');}return _0x446074+')';};var _0x1e9ea9={'where':{'id':_0x363b8e[_0xaf4b('0x50')]['id']}},_0x456bf5,_0x1d3489,_0x45e72d,_0x56a520,_0xffcaca;_0x1e9ea9=_[_0xaf4b('0x3f')]({},_0x1e9ea9,_0x363b8e[_0xaf4b('0x41')]);return db['AnalyticCustomReport']['find'](_0x1e9ea9)[_0xaf4b('0x24')](function(_0x3eac34){if(_0x3eac34){_0x456bf5=_0x3eac34;return _0x3eac34['getFields']();}return null;})['then'](function(_0x289a40){if(_0x289a40){if(!_0x289a40[_0xaf4b('0x36')]){throw new db[(_0xaf4b('0x68'))][(_0xaf4b('0x69'))](_0xaf4b('0x8d'),0x193);}_0x1d3489=_0x289a40;return db[_0xaf4b('0x6a')][_0xaf4b('0x8e')]({'raw':!![]});}return null;})['then'](function(_0x17b8c1){if(_0x17b8c1){_0x45e72d=_[_0xaf4b('0x6b')](_0x17b8c1,'id');var _0x37ccc6;var _0xac6ffb=squel[_0xaf4b('0x6c')]();_0xac6ffb['from'](_0x456bf5['table']);for(var _0x29ec58=0x0;_0x29ec58<_0x1d3489[_0xaf4b('0x36')];_0x29ec58+=0x1){_0x37ccc6=_0x1d3489[_0x29ec58][_0xaf4b('0x6f')]?_0x45e72d[_0x1d3489[_0x29ec58][_0xaf4b('0x6f')]][_0xaf4b('0x70')]:_0x1d3489[_0x29ec58][_0xaf4b('0x66')];_0x37ccc6=_0x1d3489[_0x29ec58]['function']?_[_0xaf4b('0x72')](_0x3b8fda[_0x1d3489[_0x29ec58]['function']],'%s',_0x37ccc6):_0x37ccc6;_0x37ccc6=_0x1d3489[_0x29ec58]['format']?_['replace'](_0x5e67db[_0x1d3489[_0x29ec58]['format']],'%s',_0x37ccc6):_0x37ccc6;if(_0x1d3489[_0x29ec58][_0xaf4b('0x74')]){_0xac6ffb['group'](_0x37ccc6);}_0x1d3489[_0x29ec58]['orderBy']&&_0xac6ffb[_0xaf4b('0x3a')](_0x37ccc6,_0x1d3489[_0x29ec58]['orderBy']===_0xaf4b('0x76')?![]:!![]);_0xac6ffb['field'](_0x37ccc6,_0x1d3489[_0x29ec58][_0xaf4b('0x77')]||_0x37ccc6);}if(_0x456bf5['joins']){_0x456bf5[_0xaf4b('0x78')]=JSON['parse'](_0x456bf5[_0xaf4b('0x78')]);for(var _0x51b756=0x0;_0x51b756<_0x456bf5[_0xaf4b('0x78')][_0xaf4b('0x36')];_0x51b756+=0x1){if(_0x456bf5[_0xaf4b('0x78')][_0x51b756]['type']&&_['includes'](_0x3214c4,_0x456bf5[_0xaf4b('0x78')][_0x51b756][_0xaf4b('0x2e')])&&_0x456bf5[_0xaf4b('0x78')][_0x51b756][_0xaf4b('0x7a')]&&_0x456bf5[_0xaf4b('0x78')][_0x51b756][_0xaf4b('0x7b')]&&_0x456bf5[_0xaf4b('0x78')][_0x51b756][_0xaf4b('0x7c')]){_0xac6ffb[_0x456bf5[_0xaf4b('0x78')][_0x51b756][_0xaf4b('0x2e')]](_0x456bf5[_0xaf4b('0x78')][_0x51b756][_0xaf4b('0x7b')],null,util['format'](_0xaf4b('0x7d'),_0x456bf5[_0xaf4b('0x6e')],_0x456bf5[_0xaf4b('0x78')][_0x51b756][_0xaf4b('0x7a')],_0x456bf5[_0xaf4b('0x78')][_0x51b756][_0xaf4b('0x7b')],_0x456bf5['joins'][_0x51b756][_0xaf4b('0x7c')]));}}}if(_0x456bf5[_0xaf4b('0x7e')]){_0x456bf5['conditions']=JSON['parse'](_0x456bf5[_0xaf4b('0x7e')]);_0xac6ffb[_0xaf4b('0x3e')](_0x3258b0(_0x456bf5[_0xaf4b('0x7e')]['group']));}_0xffcaca=_0xac6ffb[_0xaf4b('0x7f')]();_0xac6ffb['limit'](_0x37ebba);_0xac6ffb['offset'](0x0);logger[_0xaf4b('0x80')](_0xaf4b('0x81'),_0xac6ffb[_0xaf4b('0x82')]());return dbH[_0xaf4b('0x83')][_0xaf4b('0x32')](_0xac6ffb['toString'](),{'type':dbH[_0xaf4b('0x83')][_0xaf4b('0x84')][_0xaf4b('0x85')]});}})[_0xaf4b('0x24')](function(){return{'sql':_0xffcaca[_0xaf4b('0x82')]()};})[_0xaf4b('0x24')](respondWithResult(_0x3a8739,null))[_0xaf4b('0x45')](handleError(_0x3a8739,null));};
\ No newline at end of file
diff --git a/server/api/analyticCustomReport/analyticCustomReport.model.js b/server/api/analyticCustomReport/analyticCustomReport.model.js
index d3dc2d7..e75ecec 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 _0x81db=['path','rimraf','../../config/environment','./analyticCustomReport.attributes','exports','AnalyticCustomReport','analytics_custom_reports','lodash','../../config/logger','api','moment','bluebird'];(function(_0x13850c,_0x300d33){var _0x13c86c=function(_0x1ae772){while(--_0x1ae772){_0x13850c['push'](_0x13850c['shift']());}};_0x13c86c(++_0x300d33);}(_0x81db,0x11b));var _0xb81d=function(_0x3994f9,_0x51edba){_0x3994f9=_0x3994f9-0x0;var _0x22da92=_0x81db[_0x3994f9];return _0x22da92;};'use strict';var _=require(_0xb81d('0x0'));var util=require('util');var logger=require(_0xb81d('0x1'))(_0xb81d('0x2'));var moment=require(_0xb81d('0x3'));var BPromise=require(_0xb81d('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xb81d('0x5'));var rimraf=require(_0xb81d('0x6'));var config=require(_0xb81d('0x7'));var attributes=require(_0xb81d('0x8'));module[_0xb81d('0x9')]=function(_0x24f6ac,_0x3f1805){return _0x24f6ac['define'](_0xb81d('0xa'),attributes,{'tableName':_0xb81d('0xb'),'paranoid':!![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xcfba=['util','api','request-promise','path','rimraf','../../config/environment','./analyticCustomReport.attributes','AnalyticCustomReport','analytics_custom_reports'];(function(_0x4dcc2d,_0x422839){var _0x1bbd79=function(_0x173341){while(--_0x173341){_0x4dcc2d['push'](_0x4dcc2d['shift']());}};_0x1bbd79(++_0x422839);}(_0xcfba,0x105));var _0xacfb=function(_0x49c060,_0x1d85a4){_0x49c060=_0x49c060-0x0;var _0x3973e2=_0xcfba[_0x49c060];return _0x3973e2;};'use strict';var _=require('lodash');var util=require(_0xacfb('0x0'));var logger=require('../../config/logger')(_0xacfb('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0xacfb('0x2'));var fs=require('fs');var path=require(_0xacfb('0x3'));var rimraf=require(_0xacfb('0x4'));var config=require(_0xacfb('0x5'));var attributes=require(_0xacfb('0x6'));module['exports']=function(_0x2a0885,_0x396189){return _0x2a0885['define'](_0xacfb('0x7'),attributes,{'tableName':_0xacfb('0x8'),'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 90f1339..415dce9 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 _0xaa99=['info','AnalyticCustomReport,\x20%s,\x20%s','debug','request\x20sent','error','code','message','result','catch','lodash','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','http','request','then'];(function(_0xde1e95,_0xa82993){var _0x4620e3=function(_0x216fd8){while(--_0x216fd8){_0xde1e95['push'](_0xde1e95['shift']());}};_0x4620e3(++_0xa82993);}(_0xaa99,0x159));var _0x9aa9=function(_0x1b15a8,_0x202962){_0x1b15a8=_0x1b15a8-0x0;var _0x87e23=_0xaa99[_0x1b15a8];return _0x87e23;};'use strict';var _=require(_0x9aa9('0x0'));var util=require('util');var moment=require(_0x9aa9('0x1'));var BPromise=require('bluebird');var rs=require(_0x9aa9('0x2'));var fs=require('fs');var Redis=require(_0x9aa9('0x3'));var db=require(_0x9aa9('0x4'))['db'];var utils=require(_0x9aa9('0x5'));var logger=require(_0x9aa9('0x6'))('rpc');var config=require(_0x9aa9('0x7'));var jayson=require(_0x9aa9('0x8'));var client=jayson['client'][_0x9aa9('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x420d6e,_0x3503ce,_0x3bc92e){return new BPromise(function(_0xa83ace,_0x3fd0ae){return client[_0x9aa9('0xa')](_0x420d6e,_0x3bc92e)[_0x9aa9('0xb')](function(_0x28faa8){logger[_0x9aa9('0xc')](_0x9aa9('0xd'),_0x3503ce,'request\x20sent');logger[_0x9aa9('0xe')]('AnalyticCustomReport,\x20%s,\x20%s,\x20%s',_0x3503ce,_0x9aa9('0xf'),JSON['stringify'](_0x28faa8));if(_0x28faa8[_0x9aa9('0x10')]){if(_0x28faa8['error'][_0x9aa9('0x11')]===0x1f4){logger[_0x9aa9('0x10')](_0x9aa9('0xd'),_0x3503ce,_0x28faa8[_0x9aa9('0x10')][_0x9aa9('0x12')]);return _0x3fd0ae(_0x28faa8[_0x9aa9('0x10')]['message']);}logger[_0x9aa9('0x10')](_0x9aa9('0xd'),_0x3503ce,_0x28faa8['error'][_0x9aa9('0x12')]);return _0xa83ace(_0x28faa8[_0x9aa9('0x10')][_0x9aa9('0x12')]);}else{logger['info']('AnalyticCustomReport,\x20%s,\x20%s',_0x3503ce,'request\x20sent');_0xa83ace(_0x28faa8[_0x9aa9('0x13')][_0x9aa9('0x12')]);}})[_0x9aa9('0x14')](function(_0x52f4ad){logger[_0x9aa9('0x10')](_0x9aa9('0xd'),_0x3503ce,_0x52f4ad);_0x3fd0ae(_0x52f4ad);});});}
\ No newline at end of file
+var _0xe463=['message','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','info','AnalyticCustomReport,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code'];(function(_0x3df31d,_0x5081ff){var _0x352dbc=function(_0x2ede7c){while(--_0x2ede7c){_0x3df31d['push'](_0x3df31d['shift']());}};_0x352dbc(++_0x5081ff);}(_0xe463,0x131));var _0x3e46=function(_0x57ba9f,_0x9a0921){_0x57ba9f=_0x57ba9f-0x0;var _0xa7731d=_0xe463[_0x57ba9f];return _0xa7731d;};'use strict';var _=require(_0x3e46('0x0'));var util=require(_0x3e46('0x1'));var moment=require(_0x3e46('0x2'));var BPromise=require('bluebird');var rs=require(_0x3e46('0x3'));var fs=require('fs');var Redis=require(_0x3e46('0x4'));var db=require(_0x3e46('0x5'))['db'];var utils=require(_0x3e46('0x6'));var logger=require(_0x3e46('0x7'))(_0x3e46('0x8'));var config=require('../../config/environment');var jayson=require(_0x3e46('0x9'));var client=jayson[_0x3e46('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x402488,_0x36b92f,_0x4292ab){return new BPromise(function(_0xa0a923,_0xd76b25){return client['request'](_0x402488,_0x4292ab)['then'](function(_0x34dd24){logger[_0x3e46('0xb')](_0x3e46('0xc'),_0x36b92f,_0x3e46('0xd'));logger[_0x3e46('0xe')]('AnalyticCustomReport,\x20%s,\x20%s,\x20%s',_0x36b92f,_0x3e46('0xd'),JSON[_0x3e46('0xf')](_0x34dd24));if(_0x34dd24[_0x3e46('0x10')]){if(_0x34dd24[_0x3e46('0x10')][_0x3e46('0x11')]===0x1f4){logger[_0x3e46('0x10')](_0x3e46('0xc'),_0x36b92f,_0x34dd24['error']['message']);return _0xd76b25(_0x34dd24[_0x3e46('0x10')]['message']);}logger['error'](_0x3e46('0xc'),_0x36b92f,_0x34dd24[_0x3e46('0x10')][_0x3e46('0x12')]);return _0xa0a923(_0x34dd24[_0x3e46('0x10')][_0x3e46('0x12')]);}else{logger[_0x3e46('0xb')](_0x3e46('0xc'),_0x36b92f,_0x3e46('0xd'));_0xa0a923(_0x34dd24['result'][_0x3e46('0x12')]);}})['catch'](function(_0x4e14c5){logger[_0x3e46('0x10')]('AnalyticCustomReport,\x20%s,\x20%s',_0x36b92f,_0x4e14c5);_0xd76b25(_0x4e14c5);});});}
\ No newline at end of file
diff --git a/server/api/analyticCustomReport/index.js b/server/api/analyticCustomReport/index.js
index 98c62cd..0482a66 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 _0xd16e=['./analyticCustomReport.controller','get','isAuthenticated','/:id','/:id/preview','/:id/run','run','query','post','create','put','update','destroy','exports','multer','util','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment'];(function(_0x5c6f74,_0x2347ff){var _0x6c24d8=function(_0x5dbe96){while(--_0x5dbe96){_0x5c6f74['push'](_0x5c6f74['shift']());}};_0x6c24d8(++_0x2347ff);}(_0xd16e,0xaf));var _0xed16=function(_0x2949f4,_0x534c6d){_0x2949f4=_0x2949f4-0x0;var _0xf9c8=_0xd16e[_0x2949f4];return _0xf9c8;};'use strict';var multer=require(_0xed16('0x0'));var util=require(_0xed16('0x1'));var path=require('path');var timeout=require(_0xed16('0x2'));var express=require(_0xed16('0x3'));var router=express[_0xed16('0x4')]();var fs_extra=require(_0xed16('0x5'));var auth=require(_0xed16('0x6'));var interaction=require(_0xed16('0x7'));var config=require(_0xed16('0x8'));var controller=require(_0xed16('0x9'));router[_0xed16('0xa')]('/',auth[_0xed16('0xb')](),controller['index']);router[_0xed16('0xa')](_0xed16('0xc'),auth[_0xed16('0xb')](),controller['show']);router[_0xed16('0xa')](_0xed16('0xd'),auth[_0xed16('0xb')](),controller['preview']);router[_0xed16('0xa')](_0xed16('0xe'),auth[_0xed16('0xb')](),controller[_0xed16('0xf')]);router[_0xed16('0xa')]('/:id/query',auth[_0xed16('0xb')](),controller[_0xed16('0x10')]);router[_0xed16('0x11')]('/',auth['isAuthenticated'](),controller[_0xed16('0x12')]);router[_0xed16('0x13')](_0xed16('0xc'),auth[_0xed16('0xb')](),controller[_0xed16('0x14')]);router['delete']('/:id',auth['isAuthenticated'](),controller[_0xed16('0x15')]);module[_0xed16('0x16')]=router;
\ No newline at end of file
+var _0x55ae=['fs-extra','../../components/auth/service','../../config/environment','get','isAuthenticated','/:id','/:id/preview','preview','/:id/run','/:id/query','query','post','create','put','delete','destroy','exports','util','path','connect-timeout','express'];(function(_0x3a5248,_0x34e201){var _0x4175a1=function(_0x5ad898){while(--_0x5ad898){_0x3a5248['push'](_0x3a5248['shift']());}};_0x4175a1(++_0x34e201);}(_0x55ae,0xf8));var _0xe55a=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x55ae[_0x20a584];return _0x4b41a8;};'use strict';var multer=require('multer');var util=require(_0xe55a('0x0'));var path=require(_0xe55a('0x1'));var timeout=require(_0xe55a('0x2'));var express=require(_0xe55a('0x3'));var router=express['Router']();var fs_extra=require(_0xe55a('0x4'));var auth=require(_0xe55a('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0xe55a('0x6'));var controller=require('./analyticCustomReport.controller');router[_0xe55a('0x7')]('/',auth[_0xe55a('0x8')](),controller['index']);router[_0xe55a('0x7')](_0xe55a('0x9'),auth['isAuthenticated'](),controller['show']);router[_0xe55a('0x7')](_0xe55a('0xa'),auth[_0xe55a('0x8')](),controller[_0xe55a('0xb')]);router['get'](_0xe55a('0xc'),auth[_0xe55a('0x8')](),controller['run']);router[_0xe55a('0x7')](_0xe55a('0xd'),auth[_0xe55a('0x8')](),controller[_0xe55a('0xe')]);router[_0xe55a('0xf')]('/',auth[_0xe55a('0x8')](),controller[_0xe55a('0x10')]);router[_0xe55a('0x11')](_0xe55a('0x9'),auth[_0xe55a('0x8')](),controller['update']);router[_0xe55a('0x12')](_0xe55a('0x9'),auth['isAuthenticated'](),controller[_0xe55a('0x13')]);module[_0xe55a('0x14')]=router;
\ No newline at end of file
diff --git a/server/api/analyticDefaultReport/analyticDefaultReport.attributes.js b/server/api/analyticDefaultReport/analyticDefaultReport.attributes.js
index eae5c6c..25a918c 100644
--- a/server/api/analyticDefaultReport/analyticDefaultReport.attributes.js
+++ b/server/api/analyticDefaultReport/analyticDefaultReport.attributes.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x5d58=['TEXT','STRING'];(function(_0x39a889,_0x33900b){var _0x459495=function(_0x4dfef8){while(--_0x4dfef8){_0x39a889['push'](_0x39a889['shift']());}};_0x459495(++_0x33900b);}(_0x5d58,0x187));var _0x85d5=function(_0xeb3a72,_0x29bfd7){_0xeb3a72=_0xeb3a72-0x0;var _0x2ffafd=_0x5d58[_0xeb3a72];return _0x2ffafd;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize['STRING'],'allowNull':![]},'description':{'type':Sequelize['STRING']},'parent':{'type':Sequelize['STRING']},'table':{'type':Sequelize[_0x85d5('0x0')]},'conditions':{'type':Sequelize[_0x85d5('0x1')]},'joins':{'type':Sequelize['TEXT']}};
\ No newline at end of file
+var _0x8958=['TEXT','exports'];(function(_0xed6f46,_0x1c9006){var _0x5b267c=function(_0x59f0d2){while(--_0x59f0d2){_0xed6f46['push'](_0xed6f46['shift']());}};_0x5b267c(++_0x1c9006);}(_0x8958,0x93));var _0x8895=function(_0x1bdc3d,_0x40d513){_0x1bdc3d=_0x1bdc3d-0x0;var _0x26561e=_0x8958[_0x1bdc3d];return _0x26561e;};'use strict';var Sequelize=require('sequelize');module[_0x8895('0x0')]={'name':{'type':Sequelize['STRING'],'allowNull':![]},'description':{'type':Sequelize['STRING']},'parent':{'type':Sequelize['STRING']},'table':{'type':Sequelize['STRING']},'conditions':{'type':Sequelize[_0x8895('0x1')]},'joins':{'type':Sequelize['TEXT']}};
\ No newline at end of file
diff --git a/server/api/analyticDefaultReport/analyticDefaultReport.controller.js b/server/api/analyticDefaultReport/analyticDefaultReport.controller.js
index d621aa0..b41ea03 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 _0x1cb9=['runReport','left_join','SEC_TO_TIME(%s)','IS\x20NULL','clone','debug','eml-format','zip-dir','fast-json-patch','request-promise','moment','mustache','util','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','json','offset','limit','undefined','count','status','set','apply','reject','then','destroy','get','UserProfileResource','stack','name','send','map','AnalyticDefaultReport','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','fields','length','attributes','hasOwnProperty','sort','where','filter','merge','VIRTUAL','options','includeAll','include','findAll','show','params','find','catch','body','user','role','autoAssociation','create','DefaultReports','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','preview','join','right_join','cross_join','SUM(%s)','COUNT(DISTINCT\x20%s)','MAX(%s)','MIN(%s)','AVG(%s)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)','DATE(%s)','ROUND(%s)','UNIX_TIMESTAMP(%s)','includes','IS\x20NOT\x20NULL','IS\x20EMPTY','IS\x20NOT\x20EMPTY','rules','operator','group','field','condition','getFields','Sequelize','ValidationErrorItem','Please\x20insert\x20at\x20least\x20one\x20field','AnalyticMetric','keyBy','select','from','table','MetricId','metric','function','replace','format','orderBy','order','DESC','joins','parentKey','foreignKey','foreignTable','%s.%s\x20=\x20%s.%s','conditions','parse','Limited\x20Query:','sequelize','toString','QueryTypes','SELECT','COUNT(%s)','GROUP_CONCAT(%s)','HOUR(%s)','value','groupBy','alias','output','fullPath','%s-%s.%s','randomstring','generate','csv','default','cdr','.calldate\x20BETWEEN\x20?\x20AND\x20?','startDate','endDate','.createdAt\x20BETWEEN\x20?\x20AND\x20?','info','Run\x20Query:','child_process','fork','../../components/export/','../../files/reports','savename','countTable','COUNT(*)'];(function(_0x29ebcc,_0x5989c3){var _0x1fb5a9=function(_0x12617e){while(--_0x12617e){_0x29ebcc['push'](_0x29ebcc['shift']());}};_0x1fb5a9(++_0x5989c3);}(_0x1cb9,0x14e));var _0x91cb=function(_0x373e7b,_0x333437){_0x373e7b=_0x373e7b-0x0;var _0x5e1f0b=_0x1cb9[_0x373e7b];return _0x5e1f0b;};'use strict';var emlformat=require(_0x91cb('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x91cb('0x1'));var jsonpatch=require(_0x91cb('0x2'));var rp=require(_0x91cb('0x3'));var moment=require(_0x91cb('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x91cb('0x5'));var util=require(_0x91cb('0x6'));var path=require('path');var sox=require(_0x91cb('0x7'));var csv=require(_0x91cb('0x8'));var ejs=require(_0x91cb('0x9'));var fs=require('fs');var fs_extra=require(_0x91cb('0xa'));var _=require(_0x91cb('0xb'));var squel=require(_0x91cb('0xc'));var crypto=require('crypto');var jsforce=require(_0x91cb('0xd'));var deskjs=require('desk.js');var toCsv=require(_0x91cb('0x8'));var querystring=require('querystring');var Papa=require(_0x91cb('0xe'));var Redis=require(_0x91cb('0xf'));var authService=require(_0x91cb('0x10'));var qs=require(_0x91cb('0x11'));var as=require(_0x91cb('0x12'));var hardwareService=require(_0x91cb('0x13'));var logger=require(_0x91cb('0x14'))(_0x91cb('0x15'));var utils=require(_0x91cb('0x16'));var config=require(_0x91cb('0x17'));var licenseUtil=require('../../config/license/util');var db=require(_0x91cb('0x18'))['db'];var dbH=require(_0x91cb('0x18'))['dbH'];function respondWithStatusCode(_0x20e6e0,_0x3ea707){_0x3ea707=_0x3ea707||0xcc;return function(_0x44f2e9){if(_0x44f2e9){return _0x20e6e0[_0x91cb('0x19')](_0x3ea707);}return _0x20e6e0['status'](_0x3ea707)['end']();};}function respondWithResult(_0x4aae25,_0x3d22b7){_0x3d22b7=_0x3d22b7||0xc8;return function(_0x585470){if(_0x585470){return _0x4aae25['status'](_0x3d22b7)[_0x91cb('0x1a')](_0x585470);}};}function respondWithFilteredResult(_0xc3629e,_0x347980){return function(_0x5ea796){if(_0x5ea796){var _0x238f11=typeof _0x347980[_0x91cb('0x1b')]==='undefined'&&typeof _0x347980[_0x91cb('0x1c')]===_0x91cb('0x1d');var _0x1cd34b=_0x5ea796[_0x91cb('0x1e')];var _0x5cc1c3=_0x238f11?0x0:_0x347980[_0x91cb('0x1b')];var _0x7dcf60=_0x238f11?_0x5ea796['count']:_0x347980[_0x91cb('0x1b')]+_0x347980['limit'];var _0x55042a;if(_0x7dcf60>=_0x1cd34b){_0x7dcf60=_0x1cd34b;_0x55042a=0xc8;}else{_0x55042a=0xce;}_0xc3629e[_0x91cb('0x1f')](_0x55042a);return _0xc3629e[_0x91cb('0x20')]('Content-Range',_0x5cc1c3+'-'+_0x7dcf60+'/'+_0x1cd34b)['json'](_0x5ea796);}return null;};}function patchUpdates(_0x5b385a){return function(_0x438162){try{jsonpatch[_0x91cb('0x21')](_0x438162,_0x5b385a,!![]);}catch(_0x20aff5){return BPromise[_0x91cb('0x22')](_0x20aff5);}return _0x438162['save']();};}function saveUpdates(_0x45c4b3,_0x43881c){return function(_0x1fa837){if(_0x1fa837){return _0x1fa837['update'](_0x45c4b3)[_0x91cb('0x23')](function(_0x1a7a54){return _0x1a7a54;});}return null;};}function removeEntity(_0x2447e7,_0x422d14){return function(_0x3ca500){if(_0x3ca500){return _0x3ca500[_0x91cb('0x24')]()[_0x91cb('0x23')](function(){var _0x423c4f=_0x3ca500[_0x91cb('0x25')]({'plain':!![]});var _0x4c8438='DefaultReports';return db[_0x91cb('0x26')]['destroy']({'where':{'type':_0x4c8438,'resourceId':_0x423c4f['id']}})[_0x91cb('0x23')](function(){return _0x3ca500;});})[_0x91cb('0x23')](function(){_0x2447e7[_0x91cb('0x1f')](0xcc)['end']();});}};}function handleEntityNotFound(_0x9b26a6,_0x4f5a7b){return function(_0x4572f6){if(!_0x4572f6){_0x9b26a6[_0x91cb('0x19')](0x194);}return _0x4572f6;};}function handleError(_0x3b3ee6,_0x2fb473){_0x2fb473=_0x2fb473||0x1f4;return function(_0x468908){logger['error'](_0x468908[_0x91cb('0x27')]);if(_0x468908['name']){delete _0x468908[_0x91cb('0x28')];}_0x3b3ee6[_0x91cb('0x1f')](_0x2fb473)[_0x91cb('0x29')](_0x468908);};}exports['index']=function(_0x775c25,_0x146e1f){var _0x25bbf9={},_0x361e4c={},_0xf296bc={'count':0x0,'rows':[]};var _0x3dab18=_[_0x91cb('0x2a')](db[_0x91cb('0x2b')][_0x91cb('0x2c')],function(_0x5e6ed3){return{'name':_0x5e6ed3[_0x91cb('0x2d')],'type':_0x5e6ed3[_0x91cb('0x2e')][_0x91cb('0x2f')]};});_0x361e4c[_0x91cb('0x30')]=_[_0x91cb('0x2a')](_0x3dab18,'name');_0x361e4c[_0x91cb('0x31')]=_[_0x91cb('0x32')](_0x775c25[_0x91cb('0x31')]);_0x361e4c[_0x91cb('0x33')]=_[_0x91cb('0x34')](_0x361e4c['model'],_0x361e4c[_0x91cb('0x31')]);_0x25bbf9['attributes']=_['intersection'](_0x361e4c['model'],qs[_0x91cb('0x35')](_0x775c25['query'][_0x91cb('0x35')]));_0x25bbf9['attributes']=_0x25bbf9['attributes'][_0x91cb('0x36')]?_0x25bbf9[_0x91cb('0x37')]:_0x361e4c[_0x91cb('0x30')];if(!_0x775c25[_0x91cb('0x31')][_0x91cb('0x38')]('nolimit')){_0x25bbf9[_0x91cb('0x1c')]=qs[_0x91cb('0x1c')](_0x775c25[_0x91cb('0x31')][_0x91cb('0x1c')]);_0x25bbf9['offset']=qs['offset'](_0x775c25[_0x91cb('0x31')][_0x91cb('0x1b')]);}_0x25bbf9['order']=qs[_0x91cb('0x39')](_0x775c25[_0x91cb('0x31')]['sort']);_0x25bbf9[_0x91cb('0x3a')]=qs[_0x91cb('0x33')](_['pick'](_0x775c25[_0x91cb('0x31')],_0x361e4c['filters']),_0x3dab18);if(_0x775c25[_0x91cb('0x31')][_0x91cb('0x3b')]){_0x25bbf9[_0x91cb('0x3a')]=_[_0x91cb('0x3c')](_0x25bbf9[_0x91cb('0x3a')],{'$or':_[_0x91cb('0x2a')](_0x3dab18,function(_0x5d0e37){if(_0x5d0e37[_0x91cb('0x2e')]!==_0x91cb('0x3d')){var _0x4e5b4b={};_0x4e5b4b[_0x5d0e37[_0x91cb('0x28')]]={'$like':'%'+_0x775c25['query'][_0x91cb('0x3b')]+'%'};return _0x4e5b4b;}})});}_0x25bbf9=_[_0x91cb('0x3c')]({},_0x25bbf9,_0x775c25[_0x91cb('0x3e')]);var _0x174794={'where':_0x25bbf9['where']};return db[_0x91cb('0x2b')][_0x91cb('0x1e')](_0x174794)[_0x91cb('0x23')](function(_0x37e777){_0xf296bc[_0x91cb('0x1e')]=_0x37e777;if(_0x775c25[_0x91cb('0x31')][_0x91cb('0x3f')]){_0x25bbf9[_0x91cb('0x40')]=[{'all':!![]}];}return db[_0x91cb('0x2b')][_0x91cb('0x41')](_0x25bbf9);})['then'](function(_0x16993f){_0xf296bc['rows']=_0x16993f;return _0xf296bc;})[_0x91cb('0x23')](respondWithFilteredResult(_0x146e1f,_0x25bbf9))['catch'](handleError(_0x146e1f,null));};exports[_0x91cb('0x42')]=function(_0x52e82c,_0x138f48){var _0x477131={'raw':!![],'where':{'id':_0x52e82c[_0x91cb('0x43')]['id']}},_0xba99ce={};_0xba99ce['model']=_[_0x91cb('0x32')](db[_0x91cb('0x2b')]['rawAttributes']);_0xba99ce[_0x91cb('0x31')]=_[_0x91cb('0x32')](_0x52e82c[_0x91cb('0x31')]);_0xba99ce[_0x91cb('0x33')]=_[_0x91cb('0x34')](_0xba99ce[_0x91cb('0x30')],_0xba99ce[_0x91cb('0x31')]);_0x477131[_0x91cb('0x37')]=_[_0x91cb('0x34')](_0xba99ce['model'],qs[_0x91cb('0x35')](_0x52e82c[_0x91cb('0x31')][_0x91cb('0x35')]));_0x477131[_0x91cb('0x37')]=_0x477131[_0x91cb('0x37')][_0x91cb('0x36')]?_0x477131[_0x91cb('0x37')]:_0xba99ce[_0x91cb('0x30')];if(_0x52e82c['query'][_0x91cb('0x3f')]){_0x477131[_0x91cb('0x40')]=[{'all':!![]}];}_0x477131=_[_0x91cb('0x3c')]({},_0x477131,_0x52e82c[_0x91cb('0x3e')]);return db['AnalyticDefaultReport'][_0x91cb('0x44')](_0x477131)[_0x91cb('0x23')](handleEntityNotFound(_0x138f48,null))['then'](respondWithResult(_0x138f48,null))[_0x91cb('0x45')](handleError(_0x138f48,null));};exports['create']=function(_0x2c419b,_0x4c0acd){return db['AnalyticDefaultReport']['create'](_0x2c419b[_0x91cb('0x46')],{})[_0x91cb('0x23')](function(_0x3d62c4){var _0x2f8384=_0x2c419b[_0x91cb('0x47')]['get']({'plain':!![]});if(!_0x2f8384)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x2f8384[_0x91cb('0x48')]===_0x91cb('0x47')){var _0x140994=_0x3d62c4[_0x91cb('0x25')]({'plain':!![]});var _0x57adff='Reports';return db['UserProfileSection'][_0x91cb('0x44')]({'where':{'name':_0x57adff,'userProfileId':_0x2f8384['userProfileId']},'raw':!![]})[_0x91cb('0x23')](function(_0x4aa670){if(_0x4aa670&&_0x4aa670[_0x91cb('0x49')]===0x0){return db[_0x91cb('0x26')][_0x91cb('0x4a')]({'name':_0x140994[_0x91cb('0x28')],'resourceId':_0x140994['id'],'type':_0x91cb('0x4b'),'sectionId':_0x4aa670['id']},{})[_0x91cb('0x23')](function(){return _0x3d62c4;});}else{return _0x3d62c4;}})[_0x91cb('0x45')](function(_0x30fd4e){logger[_0x91cb('0x4c')](_0x91cb('0x4d'),_0x30fd4e);throw _0x30fd4e;});}return _0x3d62c4;})[_0x91cb('0x23')](respondWithResult(_0x4c0acd,0xc9))['catch'](handleError(_0x4c0acd,null));};exports[_0x91cb('0x4e')]=function(_0x1fa45a,_0x4d7a34){if(_0x1fa45a[_0x91cb('0x46')]['id']){delete _0x1fa45a[_0x91cb('0x46')]['id'];}return db['AnalyticDefaultReport'][_0x91cb('0x44')]({'where':{'id':_0x1fa45a[_0x91cb('0x43')]['id']}})[_0x91cb('0x23')](handleEntityNotFound(_0x4d7a34,null))[_0x91cb('0x23')](saveUpdates(_0x1fa45a[_0x91cb('0x46')],null))[_0x91cb('0x23')](respondWithResult(_0x4d7a34,null))[_0x91cb('0x45')](handleError(_0x4d7a34,null));};exports[_0x91cb('0x24')]=function(_0x3320bd,_0x93ef52){return db[_0x91cb('0x2b')]['find']({'where':{'id':_0x3320bd[_0x91cb('0x43')]['id']}})['then'](handleEntityNotFound(_0x93ef52,null))[_0x91cb('0x23')](removeEntity(_0x93ef52,null))['catch'](handleError(_0x93ef52,null));};exports[_0x91cb('0x4f')]=function(_0x1b2fec,_0x1986d7){var _0x47a6cd=0xa;var _0xe49d42=[_0x91cb('0x50'),'left_join',_0x91cb('0x51'),_0x91cb('0x52')];var _0x365afd={'SUM':_0x91cb('0x53'),'COUNT':'COUNT(%s)','COUNT DISTINCT':_0x91cb('0x54'),'MAX':_0x91cb('0x55'),'MIN':_0x91cb('0x56'),'AVG':_0x91cb('0x57'),'GROUP_CONCAT':'GROUP_CONCAT(%s)','GROUP_CONCAT ASC':_0x91cb('0x58'),'GROUP_CONCAT DESC':_0x91cb('0x59')};var _0x5c2c01={'SEC_TO_TIME':'SEC_TO_TIME(%s)','DATE':_0x91cb('0x5a'),'HOUR':'HOUR(%s)','ROUND':_0x91cb('0x5b'),'UNIX_TIMESTAMP':_0x91cb('0x5c')};var _0x5ae0d2=function(_0x4f19c8){return!_[_0x91cb('0x5d')](['IS\x20NULL',_0x91cb('0x5e'),_0x91cb('0x5f'),_0x91cb('0x60')],_0x4f19c8);};var _0x551836=function(_0x22fea8){if(!_0x22fea8||!_0x22fea8['rules'][_0x91cb('0x36')]){return'';}for(var _0xe08233='(',_0xd7be15=0x0;_0xd7be15<_0x22fea8[_0x91cb('0x61')]['length'];_0xd7be15+=0x1){_0xd7be15>0x0&&(_0xe08233+='\x20'+_0x22fea8[_0x91cb('0x62')]+'\x20');_0xe08233+=_0x22fea8[_0x91cb('0x61')][_0xd7be15][_0x91cb('0x63')]?_0x551836(_0x22fea8[_0x91cb('0x61')][_0xd7be15][_0x91cb('0x63')]):_0x22fea8[_0x91cb('0x61')][_0xd7be15][_0x91cb('0x64')]+'\x20'+_0x22fea8[_0x91cb('0x61')][_0xd7be15][_0x91cb('0x65')]+(_0x5ae0d2(_0x22fea8[_0x91cb('0x61')][_0xd7be15][_0x91cb('0x65')])?'\x20'+_0x22fea8[_0x91cb('0x61')][_0xd7be15]['value']:'');}return _0xe08233+')';};var _0x2cf4d0={'where':{'id':_0x1b2fec[_0x91cb('0x43')]['id']}},_0x2e301a,_0x474682,_0x51ab8a,_0x21c890,_0xca33a2;_0x2cf4d0=_['merge']({},_0x2cf4d0,_0x1b2fec[_0x91cb('0x3e')]);return db['AnalyticDefaultReport'][_0x91cb('0x44')](_0x2cf4d0)[_0x91cb('0x23')](function(_0x80fcc6){if(_0x80fcc6){_0x2e301a=_0x80fcc6;return _0x80fcc6[_0x91cb('0x66')]();}return null;})['then'](function(_0x1c0b66){if(_0x1c0b66){if(!_0x1c0b66[_0x91cb('0x36')]){throw new db[(_0x91cb('0x67'))][(_0x91cb('0x68'))](_0x91cb('0x69'),0x193);}_0x474682=_0x1c0b66;return db[_0x91cb('0x6a')]['findAll']({'raw':!![]});}return null;})[_0x91cb('0x23')](function(_0x28bfe5){if(_0x28bfe5){_0x51ab8a=_[_0x91cb('0x6b')](_0x28bfe5,'id');var _0x1f0ba2;var _0x891569=squel[_0x91cb('0x6c')]();_0x891569[_0x91cb('0x6d')](_0x2e301a[_0x91cb('0x6e')]);for(var _0x43629b=0x0;_0x43629b<_0x474682[_0x91cb('0x36')];_0x43629b+=0x1){_0x1f0ba2=_0x474682[_0x43629b][_0x91cb('0x6f')]?_0x51ab8a[_0x474682[_0x43629b][_0x91cb('0x6f')]][_0x91cb('0x70')]:_0x474682[_0x43629b][_0x91cb('0x64')];_0x1f0ba2=_0x474682[_0x43629b][_0x91cb('0x71')]?_[_0x91cb('0x72')](_0x365afd[_0x474682[_0x43629b][_0x91cb('0x71')]],'%s',_0x1f0ba2):_0x1f0ba2;_0x1f0ba2=_0x474682[_0x43629b]['format']?_[_0x91cb('0x72')](_0x5c2c01[_0x474682[_0x43629b][_0x91cb('0x73')]],'%s',_0x1f0ba2):_0x1f0ba2;if(_0x474682[_0x43629b]['groupBy']){_0x891569[_0x91cb('0x63')](_0x1f0ba2);}_0x474682[_0x43629b][_0x91cb('0x74')]&&_0x891569[_0x91cb('0x75')](_0x1f0ba2,_0x474682[_0x43629b]['orderBy']===_0x91cb('0x76')?![]:!![]);_0x891569[_0x91cb('0x64')](_0x1f0ba2,_0x474682[_0x43629b]['alias']||_0x1f0ba2);}if(_0x2e301a['joins']){_0x2e301a[_0x91cb('0x77')]=JSON['parse'](_0x2e301a[_0x91cb('0x77')]);for(var _0x376f56=0x0;_0x376f56<_0x2e301a['joins'][_0x91cb('0x36')];_0x376f56+=0x1){if(_0x2e301a['joins'][_0x376f56][_0x91cb('0x2e')]&&_[_0x91cb('0x5d')](_0xe49d42,_0x2e301a['joins'][_0x376f56]['type'])&&_0x2e301a[_0x91cb('0x77')][_0x376f56][_0x91cb('0x78')]&&_0x2e301a[_0x91cb('0x77')][_0x376f56]['foreignTable']&&_0x2e301a[_0x91cb('0x77')][_0x376f56][_0x91cb('0x79')]){_0x891569[_0x2e301a[_0x91cb('0x77')][_0x376f56][_0x91cb('0x2e')]](_0x2e301a['joins'][_0x376f56][_0x91cb('0x7a')],null,util['format'](_0x91cb('0x7b'),_0x2e301a[_0x91cb('0x6e')],_0x2e301a[_0x91cb('0x77')][_0x376f56][_0x91cb('0x78')],_0x2e301a['joins'][_0x376f56]['foreignTable'],_0x2e301a[_0x91cb('0x77')][_0x376f56]['foreignKey']));}}}if(_0x2e301a[_0x91cb('0x7c')]){_0x2e301a[_0x91cb('0x7c')]=JSON[_0x91cb('0x7d')](_0x2e301a[_0x91cb('0x7c')]);_0x891569[_0x91cb('0x3a')](_0x551836(_0x2e301a[_0x91cb('0x7c')][_0x91cb('0x63')]));}_0xca33a2=_0x891569['clone']();_0x891569[_0x91cb('0x1c')](_0x47a6cd);_0x891569[_0x91cb('0x1b')](0x0);logger['debug'](_0x91cb('0x7e'),_0x891569['toString']());return dbH[_0x91cb('0x7f')][_0x91cb('0x31')](_0x891569[_0x91cb('0x80')](),{'type':dbH[_0x91cb('0x7f')][_0x91cb('0x81')][_0x91cb('0x82')]});}})[_0x91cb('0x23')](respondWithResult(_0x1986d7,null))[_0x91cb('0x45')](handleError(_0x1986d7,null));};function runReport(_0x23380a,_0x14cad8,_0x20a64f){var _0x11411d=_0x14cad8[_0x91cb('0x28')];var _0x14882d=0xa;var _0x22ba54=[_0x91cb('0x50'),'left_join',_0x91cb('0x51'),'cross_join'];var _0x1235c0={'SUM':_0x91cb('0x53'),'COUNT':_0x91cb('0x83'),'COUNT DISTINCT':_0x91cb('0x54'),'MAX':_0x91cb('0x55'),'MIN':_0x91cb('0x56'),'AVG':_0x91cb('0x57'),'GROUP_CONCAT':_0x91cb('0x84'),'GROUP_CONCAT ASC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT DESC':_0x91cb('0x59')};var _0xdee7f={'SEC_TO_TIME':'SEC_TO_TIME(%s)','DATE':'DATE(%s)','HOUR':_0x91cb('0x85'),'ROUND':'ROUND(%s)','UNIX_TIMESTAMP':'UNIX_TIMESTAMP(%s)'};var _0x95f2de=function(_0x4d777a){return!_[_0x91cb('0x5d')](['IS\x20NULL',_0x91cb('0x5e'),_0x91cb('0x5f'),_0x91cb('0x60')],_0x4d777a);};var _0x443c01=function(_0x4e899c){if(!_0x4e899c||!_0x4e899c[_0x91cb('0x61')][_0x91cb('0x36')]){return'';}for(var _0x42d07b='(',_0x427afd=0x0;_0x427afd<_0x4e899c[_0x91cb('0x61')][_0x91cb('0x36')];_0x427afd+=0x1){_0x427afd>0x0&&(_0x42d07b+='\x20'+_0x4e899c[_0x91cb('0x62')]+'\x20');_0x42d07b+=_0x4e899c[_0x91cb('0x61')][_0x427afd][_0x91cb('0x63')]?_0x443c01(_0x4e899c[_0x91cb('0x61')][_0x427afd][_0x91cb('0x63')]):_0x4e899c[_0x91cb('0x61')][_0x427afd][_0x91cb('0x64')]+'\x20'+_0x4e899c[_0x91cb('0x61')][_0x427afd][_0x91cb('0x65')]+(_0x95f2de(_0x4e899c[_0x91cb('0x61')][_0x427afd][_0x91cb('0x65')])?'\x20'+_0x4e899c[_0x91cb('0x61')][_0x427afd][_0x91cb('0x86')]:'');}return _0x42d07b+')';};var _0x39b5bd={'where':{'id':_0x23380a['id']}},_0x315518,_0x3d944d,_0x43b96c,_0xe4d946,_0x32d426;_0x39b5bd=_['merge']({},_0x39b5bd,_0x20a64f);return db[_0x91cb('0x2b')][_0x91cb('0x44')](_0x39b5bd)[_0x91cb('0x23')](function(_0x1a654b){if(_0x1a654b){_0x315518=_0x1a654b;return _0x1a654b[_0x91cb('0x66')]();}return null;})[_0x91cb('0x23')](function(_0x404457){if(_0x404457){if(!_0x404457[_0x91cb('0x36')]){throw new db[(_0x91cb('0x67'))][(_0x91cb('0x68'))](_0x91cb('0x69'),0x193);}_0x3d944d=_0x404457;return db['AnalyticMetric'][_0x91cb('0x41')]({'raw':!![]});}return null;})['then'](function(_0x5689ea){if(_0x5689ea){_0x43b96c=_[_0x91cb('0x6b')](_0x5689ea,'id');var _0x265ffb;var _0x4f66f=squel[_0x91cb('0x6c')]();_0x4f66f[_0x91cb('0x6d')](_0x315518[_0x91cb('0x6e')]);for(var _0x210b46=0x0;_0x210b46<_0x3d944d[_0x91cb('0x36')];_0x210b46+=0x1){_0x265ffb=_0x3d944d[_0x210b46][_0x91cb('0x6f')]?_0x43b96c[_0x3d944d[_0x210b46][_0x91cb('0x6f')]]['metric']:_0x3d944d[_0x210b46][_0x91cb('0x64')];_0x265ffb=_0x3d944d[_0x210b46][_0x91cb('0x71')]?_['replace'](_0x1235c0[_0x3d944d[_0x210b46][_0x91cb('0x71')]],'%s',_0x265ffb):_0x265ffb;_0x265ffb=_0x3d944d[_0x210b46][_0x91cb('0x73')]?_['replace'](_0xdee7f[_0x3d944d[_0x210b46][_0x91cb('0x73')]],'%s',_0x265ffb):_0x265ffb;if(_0x3d944d[_0x210b46][_0x91cb('0x87')]){_0x4f66f[_0x91cb('0x63')](_0x265ffb);}_0x3d944d[_0x210b46][_0x91cb('0x74')]&&_0x4f66f[_0x91cb('0x75')](_0x265ffb,_0x3d944d[_0x210b46][_0x91cb('0x74')]===_0x91cb('0x76')?![]:!![]);_0x4f66f[_0x91cb('0x64')](_0x265ffb,_0x3d944d[_0x210b46][_0x91cb('0x88')]||_0x265ffb);}if(_0x315518[_0x91cb('0x77')]){_0x315518[_0x91cb('0x77')]=JSON[_0x91cb('0x7d')](_0x315518['joins']);for(var _0x5c0725=0x0;_0x5c0725<_0x315518[_0x91cb('0x77')][_0x91cb('0x36')];_0x5c0725+=0x1){if(_0x315518[_0x91cb('0x77')][_0x5c0725][_0x91cb('0x2e')]&&_[_0x91cb('0x5d')](_0x22ba54,_0x315518[_0x91cb('0x77')][_0x5c0725][_0x91cb('0x2e')])&&_0x315518['joins'][_0x5c0725][_0x91cb('0x78')]&&_0x315518['joins'][_0x5c0725][_0x91cb('0x7a')]&&_0x315518[_0x91cb('0x77')][_0x5c0725][_0x91cb('0x79')]){_0x4f66f[_0x315518[_0x91cb('0x77')][_0x5c0725][_0x91cb('0x2e')]](_0x315518['joins'][_0x5c0725][_0x91cb('0x7a')],null,util[_0x91cb('0x73')](_0x91cb('0x7b'),_0x315518[_0x91cb('0x6e')],_0x315518[_0x91cb('0x77')][_0x5c0725]['parentKey'],_0x315518[_0x91cb('0x77')][_0x5c0725][_0x91cb('0x7a')],_0x315518[_0x91cb('0x77')][_0x5c0725][_0x91cb('0x79')]));}}}if(_0x315518['conditions']){_0x315518['conditions']=JSON['parse'](_0x315518[_0x91cb('0x7c')]);_0x4f66f[_0x91cb('0x3a')](_0x443c01(_0x315518[_0x91cb('0x7c')][_0x91cb('0x63')]));}_0x32d426=_0x4f66f['clone']();_0x4f66f[_0x91cb('0x1c')](_0x14882d);_0x4f66f[_0x91cb('0x1b')](0x0);return;}})[_0x91cb('0x23')](function(){if(_0x14cad8[_0x91cb('0x89')]==='web'){return null;}var _0x4bf7c7=_[_0x91cb('0x3c')](_0x14cad8,{'name':_0x14cad8[_0x91cb('0x8a')]||_0x14cad8[_0x91cb('0x28')]||_0x315518[_0x91cb('0x28')],'basename':_0x11411d,'savename':util[_0x91cb('0x73')](_0x91cb('0x8b'),_0x14cad8[_0x91cb('0x28')]||_0x315518[_0x91cb('0x28')],require(_0x91cb('0x8c'))[_0x91cb('0x8d')](0x4),_0x14cad8[_0x91cb('0x89')]||_0x91cb('0x8e')),'reportId':_0x315518['id'],'reportType':_0x91cb('0x8f')});return db['AnalyticExtractedReport']['create'](_0x4bf7c7,{'raw':!![]});})[_0x91cb('0x23')](function(_0x48a910){if(_0x315518[_0x91cb('0x6e')]===_0x91cb('0x90')){_0x32d426[_0x91cb('0x3a')](_0x315518[_0x91cb('0x6e')]+_0x91cb('0x91'),_0x14cad8[_0x91cb('0x92')],_0x14cad8[_0x91cb('0x93')]);}else{_0x32d426[_0x91cb('0x3a')](_0x315518['table']+_0x91cb('0x94'),_0x14cad8[_0x91cb('0x92')],_0x14cad8[_0x91cb('0x93')]);}if(_0x48a910){logger[_0x91cb('0x95')](_0x91cb('0x96'),_0x32d426['toString']());require(_0x91cb('0x97'))[_0x91cb('0x98')](path[_0x91cb('0x50')](__dirname,_0x91cb('0x99'),_0x48a910[_0x91cb('0x89')]),[_0x48a910['id'],_0x32d426['toString'](),path[_0x91cb('0x50')](__dirname,_0x91cb('0x9a'),_0x48a910[_0x91cb('0x9b')]),_0x11411d]);return _0x48a910;}else{var _0x22b6d3=squel[_0x91cb('0x6c')]();_0x22b6d3[_0x91cb('0x6d')]('('+_0x32d426[_0x91cb('0x80')]()+')',_0x91cb('0x9c'));_0x22b6d3[_0x91cb('0x64')](_0x91cb('0x9d'),_0x91cb('0x1e'));_0x32d426[_0x91cb('0x1c')](_0x14cad8[_0x91cb('0x1c')]||_0x14882d);_0x32d426[_0x91cb('0x1b')](_0x14cad8[_0x91cb('0x1b')]||0x0);return dbH[_0x91cb('0x7f')][_0x91cb('0x31')](_0x22b6d3[_0x91cb('0x80')](),{'type':dbH[_0x91cb('0x7f')][_0x91cb('0x81')][_0x91cb('0x82')]})[_0x91cb('0x23')](function(_0x275c80){if(!_0x275c80[_0x91cb('0x36')]){_0xe4d946=0x0;}else{_0xe4d946=_0x275c80[0x0][_0x91cb('0x1e')]||0x0;}return dbH[_0x91cb('0x7f')]['query'](_0x32d426[_0x91cb('0x80')](),{'type':dbH[_0x91cb('0x7f')][_0x91cb('0x81')][_0x91cb('0x82')]});})[_0x91cb('0x23')](function(_0x5ca377){return{'rows':_0x5ca377||[],'count':_0xe4d946};});}});}exports['run']=function(_0x552490,_0x5174ac){return runReport(_0x552490['params'],_0x552490[_0x91cb('0x31')],_0x552490[_0x91cb('0x3e')])[_0x91cb('0x23')](respondWithResult(_0x5174ac,null))[_0x91cb('0x45')](handleError(_0x5174ac,null));};exports[_0x91cb('0x9e')]=runReport;exports[_0x91cb('0x31')]=function(_0x3462c5,_0x146346){var _0xe3d97f=0xa;var _0x3b93c3=['join',_0x91cb('0x9f'),_0x91cb('0x51'),'cross_join'];var _0x154e6a={'SUM':_0x91cb('0x53'),'COUNT':_0x91cb('0x83'),'COUNT DISTINCT':_0x91cb('0x54'),'MAX':_0x91cb('0x55'),'MIN':_0x91cb('0x56'),'AVG':_0x91cb('0x57'),'GROUP_CONCAT':'GROUP_CONCAT(%s)','GROUP_CONCAT ASC':_0x91cb('0x58'),'GROUP_CONCAT DESC':_0x91cb('0x59')};var _0x2a05af={'SEC_TO_TIME':_0x91cb('0xa0'),'DATE':_0x91cb('0x5a'),'HOUR':_0x91cb('0x85'),'ROUND':_0x91cb('0x5b'),'UNIX_TIMESTAMP':'UNIX_TIMESTAMP(%s)'};var _0x34c1f2=function(_0x4d82b4){return!_[_0x91cb('0x5d')]([_0x91cb('0xa1'),_0x91cb('0x5e'),_0x91cb('0x5f'),_0x91cb('0x60')],_0x4d82b4);};var _0x432099=function(_0x344c95){if(!_0x344c95||!_0x344c95[_0x91cb('0x61')][_0x91cb('0x36')]){return'';}for(var _0x570cf0='(',_0xb3a6c4=0x0;_0xb3a6c4<_0x344c95[_0x91cb('0x61')][_0x91cb('0x36')];_0xb3a6c4+=0x1){_0xb3a6c4>0x0&&(_0x570cf0+='\x20'+_0x344c95[_0x91cb('0x62')]+'\x20');_0x570cf0+=_0x344c95[_0x91cb('0x61')][_0xb3a6c4][_0x91cb('0x63')]?_0x432099(_0x344c95[_0x91cb('0x61')][_0xb3a6c4][_0x91cb('0x63')]):_0x344c95[_0x91cb('0x61')][_0xb3a6c4][_0x91cb('0x64')]+'\x20'+_0x344c95[_0x91cb('0x61')][_0xb3a6c4][_0x91cb('0x65')]+(_0x34c1f2(_0x344c95[_0x91cb('0x61')][_0xb3a6c4]['condition'])?'\x20'+_0x344c95[_0x91cb('0x61')][_0xb3a6c4]['value']:'');}return _0x570cf0+')';};var _0x39ba62={'where':{'id':_0x3462c5[_0x91cb('0x43')]['id']}},_0x2ab5a3,_0x10a9f6,_0x43ad75,_0x1382ba,_0x12da14;_0x39ba62=_[_0x91cb('0x3c')]({},_0x39ba62,_0x3462c5['options']);return db[_0x91cb('0x2b')]['find'](_0x39ba62)[_0x91cb('0x23')](function(_0x2f7387){if(_0x2f7387){_0x2ab5a3=_0x2f7387;return _0x2f7387[_0x91cb('0x66')]();}return null;})['then'](function(_0x1f2ef8){if(_0x1f2ef8){if(!_0x1f2ef8[_0x91cb('0x36')]){throw new db[(_0x91cb('0x67'))]['ValidationErrorItem']('Please\x20insert\x20at\x20least\x20one\x20field',0x193);}_0x10a9f6=_0x1f2ef8;return db['AnalyticMetric'][_0x91cb('0x41')]({'raw':!![]});}return null;})[_0x91cb('0x23')](function(_0x3ac830){if(_0x3ac830){_0x43ad75=_['keyBy'](_0x3ac830,'id');var _0x469e62;var _0x1e9441=squel[_0x91cb('0x6c')]();_0x1e9441[_0x91cb('0x6d')](_0x2ab5a3[_0x91cb('0x6e')]);for(var _0x416390=0x0;_0x416390<_0x10a9f6[_0x91cb('0x36')];_0x416390+=0x1){_0x469e62=_0x10a9f6[_0x416390][_0x91cb('0x6f')]?_0x43ad75[_0x10a9f6[_0x416390]['MetricId']][_0x91cb('0x70')]:_0x10a9f6[_0x416390][_0x91cb('0x64')];_0x469e62=_0x10a9f6[_0x416390][_0x91cb('0x71')]?_[_0x91cb('0x72')](_0x154e6a[_0x10a9f6[_0x416390]['function']],'%s',_0x469e62):_0x469e62;_0x469e62=_0x10a9f6[_0x416390][_0x91cb('0x73')]?_['replace'](_0x2a05af[_0x10a9f6[_0x416390][_0x91cb('0x73')]],'%s',_0x469e62):_0x469e62;if(_0x10a9f6[_0x416390][_0x91cb('0x87')]){_0x1e9441[_0x91cb('0x63')](_0x469e62);}_0x10a9f6[_0x416390][_0x91cb('0x74')]&&_0x1e9441[_0x91cb('0x75')](_0x469e62,_0x10a9f6[_0x416390]['orderBy']===_0x91cb('0x76')?![]:!![]);_0x1e9441['field'](_0x469e62,_0x10a9f6[_0x416390]['alias']||_0x469e62);}if(_0x2ab5a3[_0x91cb('0x77')]){_0x2ab5a3[_0x91cb('0x77')]=JSON[_0x91cb('0x7d')](_0x2ab5a3[_0x91cb('0x77')]);for(var _0x286ed7=0x0;_0x286ed7<_0x2ab5a3[_0x91cb('0x77')][_0x91cb('0x36')];_0x286ed7+=0x1){if(_0x2ab5a3[_0x91cb('0x77')][_0x286ed7]['type']&&_[_0x91cb('0x5d')](_0x3b93c3,_0x2ab5a3[_0x91cb('0x77')][_0x286ed7][_0x91cb('0x2e')])&&_0x2ab5a3['joins'][_0x286ed7]['parentKey']&&_0x2ab5a3['joins'][_0x286ed7][_0x91cb('0x7a')]&&_0x2ab5a3[_0x91cb('0x77')][_0x286ed7][_0x91cb('0x79')]){_0x1e9441[_0x2ab5a3['joins'][_0x286ed7][_0x91cb('0x2e')]](_0x2ab5a3[_0x91cb('0x77')][_0x286ed7][_0x91cb('0x7a')],null,util[_0x91cb('0x73')]('%s.%s\x20=\x20%s.%s',_0x2ab5a3[_0x91cb('0x6e')],_0x2ab5a3[_0x91cb('0x77')][_0x286ed7][_0x91cb('0x78')],_0x2ab5a3[_0x91cb('0x77')][_0x286ed7][_0x91cb('0x7a')],_0x2ab5a3[_0x91cb('0x77')][_0x286ed7]['foreignKey']));}}}if(_0x2ab5a3[_0x91cb('0x7c')]){_0x2ab5a3[_0x91cb('0x7c')]=JSON[_0x91cb('0x7d')](_0x2ab5a3[_0x91cb('0x7c')]);_0x1e9441[_0x91cb('0x3a')](_0x432099(_0x2ab5a3['conditions'][_0x91cb('0x63')]));}_0x12da14=_0x1e9441[_0x91cb('0xa2')]();_0x1e9441[_0x91cb('0x1c')](_0xe3d97f);_0x1e9441[_0x91cb('0x1b')](0x0);logger[_0x91cb('0xa3')](_0x91cb('0x7e'),_0x1e9441['toString']());return dbH[_0x91cb('0x7f')][_0x91cb('0x31')](_0x1e9441[_0x91cb('0x80')](),{'type':dbH['sequelize'][_0x91cb('0x81')]['SELECT']});}})[_0x91cb('0x23')](function(){return{'sql':_0x12da14[_0x91cb('0x80')]()};})[_0x91cb('0x23')](respondWithResult(_0x146346,null))[_0x91cb('0x45')](handleError(_0x146346,null));};
\ No newline at end of file
+var _0xdc97=['startDate','toString','../../components/export/','savename','COUNT(*)','eml-format','rimraf','zip-dir','request-promise','bluebird','mustache','path','sox','to-csv','ejs','lodash','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','dbH','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','reject','save','then','destroy','DefaultReports','UserProfileResource','error','stack','name','map','AnalyticDefaultReport','rawAttributes','fieldName','query','keys','filters','intersection','model','attributes','fields','order','sort','where','pick','filter','merge','type','VIRTUAL','options','includeAll','include','findAll','rows','catch','params','find','create','body','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','preview','left_join','right_join','cross_join','COUNT(DISTINCT\x20%s)','MAX(%s)','MIN(%s)','AVG(%s)','GROUP_CONCAT(%s)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)','SEC_TO_TIME(%s)','DATE(%s)','HOUR(%s)','ROUND(%s)','UNIX_TIMESTAMP(%s)','includes','IS\x20NULL','IS\x20NOT\x20NULL','IS\x20EMPTY','IS\x20NOT\x20EMPTY','rules','length','operator','group','field','condition','Sequelize','ValidationErrorItem','keyBy','select','from','table','MetricId','metric','function','replace','format','groupBy','orderBy','DESC','alias','joins','parse','foreignTable','foreignKey','%s.%s\x20=\x20%s.%s','parentKey','conditions','debug','Limited\x20Query:','sequelize','QueryTypes','SELECT','join','SUM(%s)','COUNT(%s)','value','Please\x20insert\x20at\x20least\x20one\x20field','AnalyticMetric','clone','web','fullPath','%s-%s.%s','randomstring','generate','output','csv','default','.calldate\x20BETWEEN\x20?\x20AND\x20?','endDate'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xdc97,0x13b));var _0x7dc9=function(_0x466708,_0x401295){_0x466708=_0x466708-0x0;var _0x580b4a=_0xdc97[_0x466708];return _0x580b4a;};'use strict';var emlformat=require(_0x7dc9('0x0'));var rimraf=require(_0x7dc9('0x1'));var zipdir=require(_0x7dc9('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x7dc9('0x3'));var moment=require('moment');var BPromise=require(_0x7dc9('0x4'));var Mustache=require(_0x7dc9('0x5'));var util=require('util');var path=require(_0x7dc9('0x6'));var sox=require(_0x7dc9('0x7'));var csv=require(_0x7dc9('0x8'));var ejs=require(_0x7dc9('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x7dc9('0xa'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x7dc9('0xb'));var deskjs=require(_0x7dc9('0xc'));var toCsv=require(_0x7dc9('0x8'));var querystring=require(_0x7dc9('0xd'));var Papa=require(_0x7dc9('0xe'));var Redis=require('ioredis');var authService=require(_0x7dc9('0xf'));var qs=require(_0x7dc9('0x10'));var as=require(_0x7dc9('0x11'));var hardwareService=require(_0x7dc9('0x12'));var logger=require(_0x7dc9('0x13'))(_0x7dc9('0x14'));var utils=require(_0x7dc9('0x15'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];var dbH=require('../../mysqldb')[_0x7dc9('0x16')];function respondWithStatusCode(_0x14e5db,_0x5c6ca5){_0x5c6ca5=_0x5c6ca5||0xcc;return function(_0xbd06be){if(_0xbd06be){return _0x14e5db[_0x7dc9('0x17')](_0x5c6ca5);}return _0x14e5db[_0x7dc9('0x18')](_0x5c6ca5)[_0x7dc9('0x19')]();};}function respondWithResult(_0x31d43d,_0x11af93){_0x11af93=_0x11af93||0xc8;return function(_0x524d09){if(_0x524d09){return _0x31d43d[_0x7dc9('0x18')](_0x11af93)[_0x7dc9('0x1a')](_0x524d09);}};}function respondWithFilteredResult(_0x1b0aa1,_0x442819){return function(_0x11606f){if(_0x11606f){var _0xbe0437=typeof _0x442819[_0x7dc9('0x1b')]===_0x7dc9('0x1c')&&typeof _0x442819[_0x7dc9('0x1d')]==='undefined';var _0x22577e=_0x11606f['count'];var _0x1f5906=_0xbe0437?0x0:_0x442819[_0x7dc9('0x1b')];var _0x5d61d7=_0xbe0437?_0x11606f[_0x7dc9('0x1e')]:_0x442819[_0x7dc9('0x1b')]+_0x442819[_0x7dc9('0x1d')];var _0x4b2703;if(_0x5d61d7>=_0x22577e){_0x5d61d7=_0x22577e;_0x4b2703=0xc8;}else{_0x4b2703=0xce;}_0x1b0aa1[_0x7dc9('0x18')](_0x4b2703);return _0x1b0aa1[_0x7dc9('0x1f')](_0x7dc9('0x20'),_0x1f5906+'-'+_0x5d61d7+'/'+_0x22577e)[_0x7dc9('0x1a')](_0x11606f);}return null;};}function patchUpdates(_0x155cc4){return function(_0x2b38d6){try{jsonpatch['apply'](_0x2b38d6,_0x155cc4,!![]);}catch(_0x593e60){return BPromise[_0x7dc9('0x21')](_0x593e60);}return _0x2b38d6[_0x7dc9('0x22')]();};}function saveUpdates(_0x596e0f,_0x349001){return function(_0x27f7fa){if(_0x27f7fa){return _0x27f7fa['update'](_0x596e0f)[_0x7dc9('0x23')](function(_0x43d31f){return _0x43d31f;});}return null;};}function removeEntity(_0x41110a,_0x4906b1){return function(_0x424763){if(_0x424763){return _0x424763[_0x7dc9('0x24')]()[_0x7dc9('0x23')](function(){var _0x55a482=_0x424763['get']({'plain':!![]});var _0x4b9ba6=_0x7dc9('0x25');return db[_0x7dc9('0x26')]['destroy']({'where':{'type':_0x4b9ba6,'resourceId':_0x55a482['id']}})['then'](function(){return _0x424763;});})[_0x7dc9('0x23')](function(){_0x41110a['status'](0xcc)[_0x7dc9('0x19')]();});}};}function handleEntityNotFound(_0x1c690b,_0x3a74a0){return function(_0x3e4102){if(!_0x3e4102){_0x1c690b[_0x7dc9('0x17')](0x194);}return _0x3e4102;};}function handleError(_0x450124,_0x236d42){_0x236d42=_0x236d42||0x1f4;return function(_0x229f8e){logger[_0x7dc9('0x27')](_0x229f8e[_0x7dc9('0x28')]);if(_0x229f8e[_0x7dc9('0x29')]){delete _0x229f8e[_0x7dc9('0x29')];}_0x450124['status'](_0x236d42)['send'](_0x229f8e);};}exports['index']=function(_0x49a4a5,_0x4a68f0){var _0x553a03={},_0x58c4e8={},_0x59f5d8={'count':0x0,'rows':[]};var _0x4463dc=_[_0x7dc9('0x2a')](db[_0x7dc9('0x2b')][_0x7dc9('0x2c')],function(_0x3300ff){return{'name':_0x3300ff[_0x7dc9('0x2d')],'type':_0x3300ff['type']['key']};});_0x58c4e8['model']=_[_0x7dc9('0x2a')](_0x4463dc,'name');_0x58c4e8[_0x7dc9('0x2e')]=_[_0x7dc9('0x2f')](_0x49a4a5[_0x7dc9('0x2e')]);_0x58c4e8[_0x7dc9('0x30')]=_[_0x7dc9('0x31')](_0x58c4e8[_0x7dc9('0x32')],_0x58c4e8[_0x7dc9('0x2e')]);_0x553a03[_0x7dc9('0x33')]=_['intersection'](_0x58c4e8[_0x7dc9('0x32')],qs['fields'](_0x49a4a5[_0x7dc9('0x2e')][_0x7dc9('0x34')]));_0x553a03[_0x7dc9('0x33')]=_0x553a03[_0x7dc9('0x33')]['length']?_0x553a03[_0x7dc9('0x33')]:_0x58c4e8['model'];if(!_0x49a4a5[_0x7dc9('0x2e')]['hasOwnProperty']('nolimit')){_0x553a03[_0x7dc9('0x1d')]=qs[_0x7dc9('0x1d')](_0x49a4a5[_0x7dc9('0x2e')][_0x7dc9('0x1d')]);_0x553a03['offset']=qs[_0x7dc9('0x1b')](_0x49a4a5[_0x7dc9('0x2e')][_0x7dc9('0x1b')]);}_0x553a03[_0x7dc9('0x35')]=qs[_0x7dc9('0x36')](_0x49a4a5[_0x7dc9('0x2e')][_0x7dc9('0x36')]);_0x553a03[_0x7dc9('0x37')]=qs[_0x7dc9('0x30')](_[_0x7dc9('0x38')](_0x49a4a5[_0x7dc9('0x2e')],_0x58c4e8[_0x7dc9('0x30')]),_0x4463dc);if(_0x49a4a5['query'][_0x7dc9('0x39')]){_0x553a03[_0x7dc9('0x37')]=_[_0x7dc9('0x3a')](_0x553a03[_0x7dc9('0x37')],{'$or':_['map'](_0x4463dc,function(_0x3492e6){if(_0x3492e6[_0x7dc9('0x3b')]!==_0x7dc9('0x3c')){var _0x3876b6={};_0x3876b6[_0x3492e6[_0x7dc9('0x29')]]={'$like':'%'+_0x49a4a5[_0x7dc9('0x2e')]['filter']+'%'};return _0x3876b6;}})});}_0x553a03=_['merge']({},_0x553a03,_0x49a4a5[_0x7dc9('0x3d')]);var _0x36a965={'where':_0x553a03['where']};return db[_0x7dc9('0x2b')]['count'](_0x36a965)[_0x7dc9('0x23')](function(_0x2a91fe){_0x59f5d8[_0x7dc9('0x1e')]=_0x2a91fe;if(_0x49a4a5['query'][_0x7dc9('0x3e')]){_0x553a03[_0x7dc9('0x3f')]=[{'all':!![]}];}return db[_0x7dc9('0x2b')][_0x7dc9('0x40')](_0x553a03);})[_0x7dc9('0x23')](function(_0x23499a){_0x59f5d8[_0x7dc9('0x41')]=_0x23499a;return _0x59f5d8;})['then'](respondWithFilteredResult(_0x4a68f0,_0x553a03))[_0x7dc9('0x42')](handleError(_0x4a68f0,null));};exports['show']=function(_0x52d883,_0xcced6c){var _0x294276={'raw':!![],'where':{'id':_0x52d883[_0x7dc9('0x43')]['id']}},_0x18c8a1={};_0x18c8a1[_0x7dc9('0x32')]=_[_0x7dc9('0x2f')](db[_0x7dc9('0x2b')][_0x7dc9('0x2c')]);_0x18c8a1[_0x7dc9('0x2e')]=_['keys'](_0x52d883[_0x7dc9('0x2e')]);_0x18c8a1[_0x7dc9('0x30')]=_[_0x7dc9('0x31')](_0x18c8a1[_0x7dc9('0x32')],_0x18c8a1[_0x7dc9('0x2e')]);_0x294276[_0x7dc9('0x33')]=_['intersection'](_0x18c8a1[_0x7dc9('0x32')],qs[_0x7dc9('0x34')](_0x52d883['query'][_0x7dc9('0x34')]));_0x294276[_0x7dc9('0x33')]=_0x294276[_0x7dc9('0x33')]['length']?_0x294276[_0x7dc9('0x33')]:_0x18c8a1['model'];if(_0x52d883['query'][_0x7dc9('0x3e')]){_0x294276[_0x7dc9('0x3f')]=[{'all':!![]}];}_0x294276=_[_0x7dc9('0x3a')]({},_0x294276,_0x52d883['options']);return db['AnalyticDefaultReport'][_0x7dc9('0x44')](_0x294276)['then'](handleEntityNotFound(_0xcced6c,null))[_0x7dc9('0x23')](respondWithResult(_0xcced6c,null))[_0x7dc9('0x42')](handleError(_0xcced6c,null));};exports['create']=function(_0x24ccce,_0x1d6c0a){return db[_0x7dc9('0x2b')][_0x7dc9('0x45')](_0x24ccce[_0x7dc9('0x46')],{})[_0x7dc9('0x23')](function(_0x86739f){var _0x3a1102=_0x24ccce[_0x7dc9('0x47')][_0x7dc9('0x48')]({'plain':!![]});if(!_0x3a1102)throw new Error(_0x7dc9('0x49'));if(_0x3a1102[_0x7dc9('0x4a')]===_0x7dc9('0x47')){var _0x59be9b=_0x86739f[_0x7dc9('0x48')]({'plain':!![]});var _0x4fcfd5='Reports';return db[_0x7dc9('0x4b')][_0x7dc9('0x44')]({'where':{'name':_0x4fcfd5,'userProfileId':_0x3a1102[_0x7dc9('0x4c')]},'raw':!![]})[_0x7dc9('0x23')](function(_0x346d27){if(_0x346d27&&_0x346d27['autoAssociation']===0x0){return db[_0x7dc9('0x26')][_0x7dc9('0x45')]({'name':_0x59be9b[_0x7dc9('0x29')],'resourceId':_0x59be9b['id'],'type':'DefaultReports','sectionId':_0x346d27['id']},{})[_0x7dc9('0x23')](function(){return _0x86739f;});}else{return _0x86739f;}})[_0x7dc9('0x42')](function(_0x2cf133){logger[_0x7dc9('0x27')](_0x7dc9('0x4d'),_0x2cf133);throw _0x2cf133;});}return _0x86739f;})[_0x7dc9('0x23')](respondWithResult(_0x1d6c0a,0xc9))['catch'](handleError(_0x1d6c0a,null));};exports[_0x7dc9('0x4e')]=function(_0x2ecc80,_0x2b0941){if(_0x2ecc80[_0x7dc9('0x46')]['id']){delete _0x2ecc80[_0x7dc9('0x46')]['id'];}return db[_0x7dc9('0x2b')][_0x7dc9('0x44')]({'where':{'id':_0x2ecc80[_0x7dc9('0x43')]['id']}})[_0x7dc9('0x23')](handleEntityNotFound(_0x2b0941,null))[_0x7dc9('0x23')](saveUpdates(_0x2ecc80[_0x7dc9('0x46')],null))[_0x7dc9('0x23')](respondWithResult(_0x2b0941,null))['catch'](handleError(_0x2b0941,null));};exports[_0x7dc9('0x24')]=function(_0x39be46,_0x38df9a){return db[_0x7dc9('0x2b')][_0x7dc9('0x44')]({'where':{'id':_0x39be46['params']['id']}})[_0x7dc9('0x23')](handleEntityNotFound(_0x38df9a,null))[_0x7dc9('0x23')](removeEntity(_0x38df9a,null))[_0x7dc9('0x42')](handleError(_0x38df9a,null));};exports[_0x7dc9('0x4f')]=function(_0x2a1db8,_0x2f01a0){var _0x495a06=0xa;var _0x547caa=['join',_0x7dc9('0x50'),_0x7dc9('0x51'),_0x7dc9('0x52')];var _0x2afefc={'SUM':'SUM(%s)','COUNT':'COUNT(%s)','COUNT DISTINCT':_0x7dc9('0x53'),'MAX':_0x7dc9('0x54'),'MIN':_0x7dc9('0x55'),'AVG':_0x7dc9('0x56'),'GROUP_CONCAT':_0x7dc9('0x57'),'GROUP_CONCAT ASC':_0x7dc9('0x58'),'GROUP_CONCAT DESC':_0x7dc9('0x59')};var _0x4905f6={'SEC_TO_TIME':_0x7dc9('0x5a'),'DATE':_0x7dc9('0x5b'),'HOUR':_0x7dc9('0x5c'),'ROUND':_0x7dc9('0x5d'),'UNIX_TIMESTAMP':_0x7dc9('0x5e')};var _0x4bbf8b=function(_0x175858){return!_[_0x7dc9('0x5f')]([_0x7dc9('0x60'),_0x7dc9('0x61'),_0x7dc9('0x62'),_0x7dc9('0x63')],_0x175858);};var _0x286ac5=function(_0x2a02ed){if(!_0x2a02ed||!_0x2a02ed[_0x7dc9('0x64')][_0x7dc9('0x65')]){return'';}for(var _0x19c209='(',_0xf3ae59=0x0;_0xf3ae59<_0x2a02ed[_0x7dc9('0x64')]['length'];_0xf3ae59+=0x1){_0xf3ae59>0x0&&(_0x19c209+='\x20'+_0x2a02ed[_0x7dc9('0x66')]+'\x20');_0x19c209+=_0x2a02ed['rules'][_0xf3ae59][_0x7dc9('0x67')]?_0x286ac5(_0x2a02ed[_0x7dc9('0x64')][_0xf3ae59]['group']):_0x2a02ed[_0x7dc9('0x64')][_0xf3ae59][_0x7dc9('0x68')]+'\x20'+_0x2a02ed['rules'][_0xf3ae59][_0x7dc9('0x69')]+(_0x4bbf8b(_0x2a02ed[_0x7dc9('0x64')][_0xf3ae59][_0x7dc9('0x69')])?'\x20'+_0x2a02ed['rules'][_0xf3ae59]['value']:'');}return _0x19c209+')';};var _0x205d01={'where':{'id':_0x2a1db8[_0x7dc9('0x43')]['id']}},_0x366d4d,_0x4ed60e,_0x3aba59,_0x15d02f,_0x2bbf61;_0x205d01=_[_0x7dc9('0x3a')]({},_0x205d01,_0x2a1db8[_0x7dc9('0x3d')]);return db['AnalyticDefaultReport'][_0x7dc9('0x44')](_0x205d01)[_0x7dc9('0x23')](function(_0x3f81dd){if(_0x3f81dd){_0x366d4d=_0x3f81dd;return _0x3f81dd['getFields']();}return null;})['then'](function(_0x1b2369){if(_0x1b2369){if(!_0x1b2369[_0x7dc9('0x65')]){throw new db[(_0x7dc9('0x6a'))][(_0x7dc9('0x6b'))]('Please\x20insert\x20at\x20least\x20one\x20field',0x193);}_0x4ed60e=_0x1b2369;return db['AnalyticMetric'][_0x7dc9('0x40')]({'raw':!![]});}return null;})[_0x7dc9('0x23')](function(_0x25f8b3){if(_0x25f8b3){_0x3aba59=_[_0x7dc9('0x6c')](_0x25f8b3,'id');var _0x5d211b;var _0xea1728=squel[_0x7dc9('0x6d')]();_0xea1728[_0x7dc9('0x6e')](_0x366d4d[_0x7dc9('0x6f')]);for(var _0x19e0b1=0x0;_0x19e0b1<_0x4ed60e[_0x7dc9('0x65')];_0x19e0b1+=0x1){_0x5d211b=_0x4ed60e[_0x19e0b1][_0x7dc9('0x70')]?_0x3aba59[_0x4ed60e[_0x19e0b1]['MetricId']][_0x7dc9('0x71')]:_0x4ed60e[_0x19e0b1][_0x7dc9('0x68')];_0x5d211b=_0x4ed60e[_0x19e0b1]['function']?_['replace'](_0x2afefc[_0x4ed60e[_0x19e0b1][_0x7dc9('0x72')]],'%s',_0x5d211b):_0x5d211b;_0x5d211b=_0x4ed60e[_0x19e0b1]['format']?_[_0x7dc9('0x73')](_0x4905f6[_0x4ed60e[_0x19e0b1][_0x7dc9('0x74')]],'%s',_0x5d211b):_0x5d211b;if(_0x4ed60e[_0x19e0b1][_0x7dc9('0x75')]){_0xea1728[_0x7dc9('0x67')](_0x5d211b);}_0x4ed60e[_0x19e0b1][_0x7dc9('0x76')]&&_0xea1728[_0x7dc9('0x35')](_0x5d211b,_0x4ed60e[_0x19e0b1][_0x7dc9('0x76')]===_0x7dc9('0x77')?![]:!![]);_0xea1728[_0x7dc9('0x68')](_0x5d211b,_0x4ed60e[_0x19e0b1][_0x7dc9('0x78')]||_0x5d211b);}if(_0x366d4d['joins']){_0x366d4d[_0x7dc9('0x79')]=JSON[_0x7dc9('0x7a')](_0x366d4d[_0x7dc9('0x79')]);for(var _0x499393=0x0;_0x499393<_0x366d4d[_0x7dc9('0x79')]['length'];_0x499393+=0x1){if(_0x366d4d['joins'][_0x499393][_0x7dc9('0x3b')]&&_[_0x7dc9('0x5f')](_0x547caa,_0x366d4d['joins'][_0x499393][_0x7dc9('0x3b')])&&_0x366d4d['joins'][_0x499393]['parentKey']&&_0x366d4d[_0x7dc9('0x79')][_0x499393][_0x7dc9('0x7b')]&&_0x366d4d[_0x7dc9('0x79')][_0x499393][_0x7dc9('0x7c')]){_0xea1728[_0x366d4d['joins'][_0x499393][_0x7dc9('0x3b')]](_0x366d4d[_0x7dc9('0x79')][_0x499393][_0x7dc9('0x7b')],null,util[_0x7dc9('0x74')](_0x7dc9('0x7d'),_0x366d4d[_0x7dc9('0x6f')],_0x366d4d[_0x7dc9('0x79')][_0x499393][_0x7dc9('0x7e')],_0x366d4d['joins'][_0x499393]['foreignTable'],_0x366d4d[_0x7dc9('0x79')][_0x499393]['foreignKey']));}}}if(_0x366d4d[_0x7dc9('0x7f')]){_0x366d4d[_0x7dc9('0x7f')]=JSON[_0x7dc9('0x7a')](_0x366d4d[_0x7dc9('0x7f')]);_0xea1728['where'](_0x286ac5(_0x366d4d[_0x7dc9('0x7f')][_0x7dc9('0x67')]));}_0x2bbf61=_0xea1728['clone']();_0xea1728[_0x7dc9('0x1d')](_0x495a06);_0xea1728[_0x7dc9('0x1b')](0x0);logger[_0x7dc9('0x80')](_0x7dc9('0x81'),_0xea1728['toString']());return dbH[_0x7dc9('0x82')][_0x7dc9('0x2e')](_0xea1728['toString'](),{'type':dbH['sequelize'][_0x7dc9('0x83')][_0x7dc9('0x84')]});}})['then'](respondWithResult(_0x2f01a0,null))[_0x7dc9('0x42')](handleError(_0x2f01a0,null));};function runReport(_0x5f08f6,_0x2e7296,_0x1d0722){var _0x1acdba=_0x2e7296['name'];var _0x33d68c=0xa;var _0x3c7daf=[_0x7dc9('0x85'),'left_join',_0x7dc9('0x51'),'cross_join'];var _0x5761cb={'SUM':_0x7dc9('0x86'),'COUNT':_0x7dc9('0x87'),'COUNT DISTINCT':_0x7dc9('0x53'),'MAX':_0x7dc9('0x54'),'MIN':_0x7dc9('0x55'),'AVG':'AVG(%s)','GROUP_CONCAT':_0x7dc9('0x57'),'GROUP_CONCAT ASC':_0x7dc9('0x58'),'GROUP_CONCAT DESC':_0x7dc9('0x59')};var _0x2dc92e={'SEC_TO_TIME':_0x7dc9('0x5a'),'DATE':'DATE(%s)','HOUR':_0x7dc9('0x5c'),'ROUND':_0x7dc9('0x5d'),'UNIX_TIMESTAMP':_0x7dc9('0x5e')};var _0x200df7=function(_0x53c992){return!_[_0x7dc9('0x5f')](['IS\x20NULL','IS\x20NOT\x20NULL',_0x7dc9('0x62'),'IS\x20NOT\x20EMPTY'],_0x53c992);};var _0x21da79=function(_0x476a24){if(!_0x476a24||!_0x476a24[_0x7dc9('0x64')][_0x7dc9('0x65')]){return'';}for(var _0x38dccc='(',_0xc716c3=0x0;_0xc716c3<_0x476a24['rules'][_0x7dc9('0x65')];_0xc716c3+=0x1){_0xc716c3>0x0&&(_0x38dccc+='\x20'+_0x476a24[_0x7dc9('0x66')]+'\x20');_0x38dccc+=_0x476a24[_0x7dc9('0x64')][_0xc716c3][_0x7dc9('0x67')]?_0x21da79(_0x476a24[_0x7dc9('0x64')][_0xc716c3]['group']):_0x476a24[_0x7dc9('0x64')][_0xc716c3]['field']+'\x20'+_0x476a24[_0x7dc9('0x64')][_0xc716c3][_0x7dc9('0x69')]+(_0x200df7(_0x476a24[_0x7dc9('0x64')][_0xc716c3]['condition'])?'\x20'+_0x476a24[_0x7dc9('0x64')][_0xc716c3][_0x7dc9('0x88')]:'');}return _0x38dccc+')';};var _0x5e8806={'where':{'id':_0x5f08f6['id']}},_0x1a9c7e,_0x3f8839,_0xf74b6,_0x2b3d46,_0x5c466d;_0x5e8806=_[_0x7dc9('0x3a')]({},_0x5e8806,_0x1d0722);return db['AnalyticDefaultReport'][_0x7dc9('0x44')](_0x5e8806)[_0x7dc9('0x23')](function(_0x3e06b3){if(_0x3e06b3){_0x1a9c7e=_0x3e06b3;return _0x3e06b3['getFields']();}return null;})[_0x7dc9('0x23')](function(_0x4588a7){if(_0x4588a7){if(!_0x4588a7[_0x7dc9('0x65')]){throw new db['Sequelize']['ValidationErrorItem'](_0x7dc9('0x89'),0x193);}_0x3f8839=_0x4588a7;return db[_0x7dc9('0x8a')]['findAll']({'raw':!![]});}return null;})['then'](function(_0xb0c228){if(_0xb0c228){_0xf74b6=_[_0x7dc9('0x6c')](_0xb0c228,'id');var _0x5f3487;var _0x29c228=squel['select']();_0x29c228[_0x7dc9('0x6e')](_0x1a9c7e[_0x7dc9('0x6f')]);for(var _0x235473=0x0;_0x235473<_0x3f8839[_0x7dc9('0x65')];_0x235473+=0x1){_0x5f3487=_0x3f8839[_0x235473][_0x7dc9('0x70')]?_0xf74b6[_0x3f8839[_0x235473][_0x7dc9('0x70')]]['metric']:_0x3f8839[_0x235473][_0x7dc9('0x68')];_0x5f3487=_0x3f8839[_0x235473][_0x7dc9('0x72')]?_[_0x7dc9('0x73')](_0x5761cb[_0x3f8839[_0x235473][_0x7dc9('0x72')]],'%s',_0x5f3487):_0x5f3487;_0x5f3487=_0x3f8839[_0x235473][_0x7dc9('0x74')]?_['replace'](_0x2dc92e[_0x3f8839[_0x235473][_0x7dc9('0x74')]],'%s',_0x5f3487):_0x5f3487;if(_0x3f8839[_0x235473][_0x7dc9('0x75')]){_0x29c228[_0x7dc9('0x67')](_0x5f3487);}_0x3f8839[_0x235473][_0x7dc9('0x76')]&&_0x29c228['order'](_0x5f3487,_0x3f8839[_0x235473][_0x7dc9('0x76')]===_0x7dc9('0x77')?![]:!![]);_0x29c228['field'](_0x5f3487,_0x3f8839[_0x235473][_0x7dc9('0x78')]||_0x5f3487);}if(_0x1a9c7e['joins']){_0x1a9c7e[_0x7dc9('0x79')]=JSON[_0x7dc9('0x7a')](_0x1a9c7e[_0x7dc9('0x79')]);for(var _0x4173c2=0x0;_0x4173c2<_0x1a9c7e[_0x7dc9('0x79')][_0x7dc9('0x65')];_0x4173c2+=0x1){if(_0x1a9c7e[_0x7dc9('0x79')][_0x4173c2][_0x7dc9('0x3b')]&&_['includes'](_0x3c7daf,_0x1a9c7e[_0x7dc9('0x79')][_0x4173c2][_0x7dc9('0x3b')])&&_0x1a9c7e[_0x7dc9('0x79')][_0x4173c2][_0x7dc9('0x7e')]&&_0x1a9c7e[_0x7dc9('0x79')][_0x4173c2]['foreignTable']&&_0x1a9c7e[_0x7dc9('0x79')][_0x4173c2][_0x7dc9('0x7c')]){_0x29c228[_0x1a9c7e[_0x7dc9('0x79')][_0x4173c2][_0x7dc9('0x3b')]](_0x1a9c7e['joins'][_0x4173c2][_0x7dc9('0x7b')],null,util['format'](_0x7dc9('0x7d'),_0x1a9c7e['table'],_0x1a9c7e[_0x7dc9('0x79')][_0x4173c2][_0x7dc9('0x7e')],_0x1a9c7e[_0x7dc9('0x79')][_0x4173c2][_0x7dc9('0x7b')],_0x1a9c7e[_0x7dc9('0x79')][_0x4173c2][_0x7dc9('0x7c')]));}}}if(_0x1a9c7e[_0x7dc9('0x7f')]){_0x1a9c7e[_0x7dc9('0x7f')]=JSON[_0x7dc9('0x7a')](_0x1a9c7e[_0x7dc9('0x7f')]);_0x29c228[_0x7dc9('0x37')](_0x21da79(_0x1a9c7e[_0x7dc9('0x7f')]['group']));}_0x5c466d=_0x29c228[_0x7dc9('0x8b')]();_0x29c228[_0x7dc9('0x1d')](_0x33d68c);_0x29c228[_0x7dc9('0x1b')](0x0);return;}})[_0x7dc9('0x23')](function(){if(_0x2e7296['output']===_0x7dc9('0x8c')){return null;}var _0x35e061=_[_0x7dc9('0x3a')](_0x2e7296,{'name':_0x2e7296[_0x7dc9('0x8d')]||_0x2e7296['name']||_0x1a9c7e[_0x7dc9('0x29')],'basename':_0x1acdba,'savename':util[_0x7dc9('0x74')](_0x7dc9('0x8e'),_0x2e7296['name']||_0x1a9c7e['name'],require(_0x7dc9('0x8f'))[_0x7dc9('0x90')](0x4),_0x2e7296[_0x7dc9('0x91')]||_0x7dc9('0x92')),'reportId':_0x1a9c7e['id'],'reportType':_0x7dc9('0x93')});return db['AnalyticExtractedReport'][_0x7dc9('0x45')](_0x35e061,{'raw':!![]});})[_0x7dc9('0x23')](function(_0x648bf9){if(_0x1a9c7e[_0x7dc9('0x6f')]==='cdr'){_0x5c466d[_0x7dc9('0x37')](_0x1a9c7e['table']+_0x7dc9('0x94'),_0x2e7296['startDate'],_0x2e7296[_0x7dc9('0x95')]);}else{_0x5c466d[_0x7dc9('0x37')](_0x1a9c7e[_0x7dc9('0x6f')]+'.createdAt\x20BETWEEN\x20?\x20AND\x20?',_0x2e7296[_0x7dc9('0x96')],_0x2e7296[_0x7dc9('0x95')]);}if(_0x648bf9){logger['info']('Run\x20Query:',_0x5c466d[_0x7dc9('0x97')]());require('child_process')['fork'](path[_0x7dc9('0x85')](__dirname,_0x7dc9('0x98'),_0x648bf9[_0x7dc9('0x91')]),[_0x648bf9['id'],_0x5c466d['toString'](),path['join'](__dirname,'../../files/reports',_0x648bf9[_0x7dc9('0x99')]),_0x1acdba]);return _0x648bf9;}else{var _0xb825f3=squel[_0x7dc9('0x6d')]();_0xb825f3[_0x7dc9('0x6e')]('('+_0x5c466d['toString']()+')','countTable');_0xb825f3[_0x7dc9('0x68')](_0x7dc9('0x9a'),_0x7dc9('0x1e'));_0x5c466d['limit'](_0x2e7296['limit']||_0x33d68c);_0x5c466d[_0x7dc9('0x1b')](_0x2e7296['offset']||0x0);return dbH[_0x7dc9('0x82')][_0x7dc9('0x2e')](_0xb825f3['toString'](),{'type':dbH[_0x7dc9('0x82')][_0x7dc9('0x83')][_0x7dc9('0x84')]})[_0x7dc9('0x23')](function(_0x14cbd9){if(!_0x14cbd9[_0x7dc9('0x65')]){_0x2b3d46=0x0;}else{_0x2b3d46=_0x14cbd9[0x0][_0x7dc9('0x1e')]||0x0;}return dbH[_0x7dc9('0x82')]['query'](_0x5c466d[_0x7dc9('0x97')](),{'type':dbH['sequelize'][_0x7dc9('0x83')]['SELECT']});})[_0x7dc9('0x23')](function(_0x20f245){return{'rows':_0x20f245||[],'count':_0x2b3d46};});}});}exports['run']=function(_0x67d933,_0x1b2b88){return runReport(_0x67d933[_0x7dc9('0x43')],_0x67d933[_0x7dc9('0x2e')],_0x67d933[_0x7dc9('0x3d')])['then'](respondWithResult(_0x1b2b88,null))[_0x7dc9('0x42')](handleError(_0x1b2b88,null));};exports['runReport']=runReport;exports[_0x7dc9('0x2e')]=function(_0x313b41,_0x275675){var _0x299c23=0xa;var _0x4c1c43=[_0x7dc9('0x85'),_0x7dc9('0x50'),'right_join',_0x7dc9('0x52')];var _0x1fbaea={'SUM':_0x7dc9('0x86'),'COUNT':_0x7dc9('0x87'),'COUNT DISTINCT':'COUNT(DISTINCT\x20%s)','MAX':_0x7dc9('0x54'),'MIN':_0x7dc9('0x55'),'AVG':_0x7dc9('0x56'),'GROUP_CONCAT':_0x7dc9('0x57'),'GROUP_CONCAT ASC':_0x7dc9('0x58'),'GROUP_CONCAT DESC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)'};var _0x6c7fdc={'SEC_TO_TIME':_0x7dc9('0x5a'),'DATE':_0x7dc9('0x5b'),'HOUR':_0x7dc9('0x5c'),'ROUND':'ROUND(%s)','UNIX_TIMESTAMP':_0x7dc9('0x5e')};var _0x5c9d64=function(_0x59710c){return!_['includes']([_0x7dc9('0x60'),_0x7dc9('0x61'),_0x7dc9('0x62'),_0x7dc9('0x63')],_0x59710c);};var _0x24a1e2=function(_0x45bcf4){if(!_0x45bcf4||!_0x45bcf4[_0x7dc9('0x64')][_0x7dc9('0x65')]){return'';}for(var _0x4b18e1='(',_0x28e50e=0x0;_0x28e50e<_0x45bcf4[_0x7dc9('0x64')][_0x7dc9('0x65')];_0x28e50e+=0x1){_0x28e50e>0x0&&(_0x4b18e1+='\x20'+_0x45bcf4['operator']+'\x20');_0x4b18e1+=_0x45bcf4[_0x7dc9('0x64')][_0x28e50e][_0x7dc9('0x67')]?_0x24a1e2(_0x45bcf4[_0x7dc9('0x64')][_0x28e50e][_0x7dc9('0x67')]):_0x45bcf4[_0x7dc9('0x64')][_0x28e50e][_0x7dc9('0x68')]+'\x20'+_0x45bcf4[_0x7dc9('0x64')][_0x28e50e][_0x7dc9('0x69')]+(_0x5c9d64(_0x45bcf4[_0x7dc9('0x64')][_0x28e50e][_0x7dc9('0x69')])?'\x20'+_0x45bcf4[_0x7dc9('0x64')][_0x28e50e][_0x7dc9('0x88')]:'');}return _0x4b18e1+')';};var _0x1dc474={'where':{'id':_0x313b41[_0x7dc9('0x43')]['id']}},_0x31121a,_0x454b3a,_0x409a9f,_0x187f17,_0x809ae5;_0x1dc474=_[_0x7dc9('0x3a')]({},_0x1dc474,_0x313b41['options']);return db[_0x7dc9('0x2b')]['find'](_0x1dc474)[_0x7dc9('0x23')](function(_0x56e1ba){if(_0x56e1ba){_0x31121a=_0x56e1ba;return _0x56e1ba['getFields']();}return null;})[_0x7dc9('0x23')](function(_0x342b95){if(_0x342b95){if(!_0x342b95['length']){throw new db[(_0x7dc9('0x6a'))]['ValidationErrorItem'](_0x7dc9('0x89'),0x193);}_0x454b3a=_0x342b95;return db[_0x7dc9('0x8a')]['findAll']({'raw':!![]});}return null;})['then'](function(_0x338c78){if(_0x338c78){_0x409a9f=_[_0x7dc9('0x6c')](_0x338c78,'id');var _0x8ee4f4;var _0x8f887e=squel['select']();_0x8f887e[_0x7dc9('0x6e')](_0x31121a[_0x7dc9('0x6f')]);for(var _0x4e2edf=0x0;_0x4e2edf<_0x454b3a[_0x7dc9('0x65')];_0x4e2edf+=0x1){_0x8ee4f4=_0x454b3a[_0x4e2edf][_0x7dc9('0x70')]?_0x409a9f[_0x454b3a[_0x4e2edf]['MetricId']]['metric']:_0x454b3a[_0x4e2edf][_0x7dc9('0x68')];_0x8ee4f4=_0x454b3a[_0x4e2edf][_0x7dc9('0x72')]?_[_0x7dc9('0x73')](_0x1fbaea[_0x454b3a[_0x4e2edf][_0x7dc9('0x72')]],'%s',_0x8ee4f4):_0x8ee4f4;_0x8ee4f4=_0x454b3a[_0x4e2edf]['format']?_[_0x7dc9('0x73')](_0x6c7fdc[_0x454b3a[_0x4e2edf]['format']],'%s',_0x8ee4f4):_0x8ee4f4;if(_0x454b3a[_0x4e2edf]['groupBy']){_0x8f887e[_0x7dc9('0x67')](_0x8ee4f4);}_0x454b3a[_0x4e2edf][_0x7dc9('0x76')]&&_0x8f887e[_0x7dc9('0x35')](_0x8ee4f4,_0x454b3a[_0x4e2edf][_0x7dc9('0x76')]===_0x7dc9('0x77')?![]:!![]);_0x8f887e[_0x7dc9('0x68')](_0x8ee4f4,_0x454b3a[_0x4e2edf][_0x7dc9('0x78')]||_0x8ee4f4);}if(_0x31121a['joins']){_0x31121a[_0x7dc9('0x79')]=JSON[_0x7dc9('0x7a')](_0x31121a[_0x7dc9('0x79')]);for(var _0x283f96=0x0;_0x283f96<_0x31121a[_0x7dc9('0x79')][_0x7dc9('0x65')];_0x283f96+=0x1){if(_0x31121a[_0x7dc9('0x79')][_0x283f96]['type']&&_[_0x7dc9('0x5f')](_0x4c1c43,_0x31121a[_0x7dc9('0x79')][_0x283f96][_0x7dc9('0x3b')])&&_0x31121a[_0x7dc9('0x79')][_0x283f96][_0x7dc9('0x7e')]&&_0x31121a['joins'][_0x283f96][_0x7dc9('0x7b')]&&_0x31121a['joins'][_0x283f96][_0x7dc9('0x7c')]){_0x8f887e[_0x31121a[_0x7dc9('0x79')][_0x283f96]['type']](_0x31121a[_0x7dc9('0x79')][_0x283f96][_0x7dc9('0x7b')],null,util[_0x7dc9('0x74')](_0x7dc9('0x7d'),_0x31121a[_0x7dc9('0x6f')],_0x31121a[_0x7dc9('0x79')][_0x283f96]['parentKey'],_0x31121a[_0x7dc9('0x79')][_0x283f96][_0x7dc9('0x7b')],_0x31121a['joins'][_0x283f96][_0x7dc9('0x7c')]));}}}if(_0x31121a[_0x7dc9('0x7f')]){_0x31121a['conditions']=JSON['parse'](_0x31121a[_0x7dc9('0x7f')]);_0x8f887e[_0x7dc9('0x37')](_0x24a1e2(_0x31121a[_0x7dc9('0x7f')]['group']));}_0x809ae5=_0x8f887e[_0x7dc9('0x8b')]();_0x8f887e['limit'](_0x299c23);_0x8f887e[_0x7dc9('0x1b')](0x0);logger[_0x7dc9('0x80')](_0x7dc9('0x81'),_0x8f887e['toString']());return dbH[_0x7dc9('0x82')]['query'](_0x8f887e['toString'](),{'type':dbH[_0x7dc9('0x82')][_0x7dc9('0x83')][_0x7dc9('0x84')]});}})[_0x7dc9('0x23')](function(){return{'sql':_0x809ae5[_0x7dc9('0x97')]()};})['then'](respondWithResult(_0x275675,null))['catch'](handleError(_0x275675,null));};
\ No newline at end of file
diff --git a/server/api/analyticDefaultReport/analyticDefaultReport.model.js b/server/api/analyticDefaultReport/analyticDefaultReport.model.js
index d0c0c70..f9bd5ad 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 _0xac25=['define','analytics_default_reports','lodash','util','moment','bluebird','rimraf','../../config/environment','exports'];(function(_0x560620,_0x308b4d){var _0x4bc7c0=function(_0x5eec71){while(--_0x5eec71){_0x560620['push'](_0x560620['shift']());}};_0x4bc7c0(++_0x308b4d);}(_0xac25,0x92));var _0x5ac2=function(_0xbe200f,_0x4b50eb){_0xbe200f=_0xbe200f-0x0;var _0x192597=_0xac25[_0xbe200f];return _0x192597;};'use strict';var _=require(_0x5ac2('0x0'));var util=require(_0x5ac2('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0x5ac2('0x2'));var BPromise=require(_0x5ac2('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x5ac2('0x4'));var config=require(_0x5ac2('0x5'));var attributes=require('./analyticDefaultReport.attributes');module[_0x5ac2('0x6')]=function(_0x12e7fc,_0x4020c6){return _0x12e7fc[_0x5ac2('0x7')]('AnalyticDefaultReport',attributes,{'tableName':_0x5ac2('0x8'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x3add=['bluebird','path','rimraf','../../config/environment','exports','define','AnalyticDefaultReport','analytics_default_reports','lodash','util','../../config/logger','api','moment'];(function(_0x53c3e7,_0x454629){var _0x51ad5d=function(_0x24173d){while(--_0x24173d){_0x53c3e7['push'](_0x53c3e7['shift']());}};_0x51ad5d(++_0x454629);}(_0x3add,0x1b5));var _0xd3ad=function(_0x3511d3,_0x4107ae){_0x3511d3=_0x3511d3-0x0;var _0x5d6321=_0x3add[_0x3511d3];return _0x5d6321;};'use strict';var _=require(_0xd3ad('0x0'));var util=require(_0xd3ad('0x1'));var logger=require(_0xd3ad('0x2'))(_0xd3ad('0x3'));var moment=require(_0xd3ad('0x4'));var BPromise=require(_0xd3ad('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xd3ad('0x6'));var rimraf=require(_0xd3ad('0x7'));var config=require(_0xd3ad('0x8'));var attributes=require('./analyticDefaultReport.attributes');module[_0xd3ad('0x9')]=function(_0x347ea5,_0x2f2556){return _0x347ea5[_0xd3ad('0xa')](_0xd3ad('0xb'),attributes,{'tableName':_0xd3ad('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
diff --git a/server/api/analyticDefaultReport/analyticDefaultReport.rpc.js b/server/api/analyticDefaultReport/analyticDefaultReport.rpc.js
index 15ffebc..9b6129d 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 _0xa39b=['moment','bluebird','randomstring','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','request','then','AnalyticDefaultReport,\x20%s,\x20%s','request\x20sent','debug','AnalyticDefaultReport,\x20%s,\x20%s,\x20%s','stringify','code','error','message','info','result','catch','lodash'];(function(_0x21c73d,_0x44476e){var _0x43cffd=function(_0x48697e){while(--_0x48697e){_0x21c73d['push'](_0x21c73d['shift']());}};_0x43cffd(++_0x44476e);}(_0xa39b,0x1c7));var _0xba39=function(_0x4a9fb1,_0x273043){_0x4a9fb1=_0x4a9fb1-0x0;var _0x348672=_0xa39b[_0x4a9fb1];return _0x348672;};'use strict';var _=require(_0xba39('0x0'));var util=require('util');var moment=require(_0xba39('0x1'));var BPromise=require(_0xba39('0x2'));var rs=require(_0xba39('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xba39('0x4'))['db'];var utils=require(_0xba39('0x5'));var logger=require('../../config/logger')(_0xba39('0x6'));var config=require(_0xba39('0x7'));var jayson=require(_0xba39('0x8'));var client=jayson[_0xba39('0x9')][_0xba39('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x5e2d01,_0x1e2044,_0xa86108){return new BPromise(function(_0x628e00,_0x56ab24){return client[_0xba39('0xb')](_0x5e2d01,_0xa86108)[_0xba39('0xc')](function(_0x2fd27a){logger['info'](_0xba39('0xd'),_0x1e2044,_0xba39('0xe'));logger[_0xba39('0xf')](_0xba39('0x10'),_0x1e2044,_0xba39('0xe'),JSON[_0xba39('0x11')](_0x2fd27a));if(_0x2fd27a['error']){if(_0x2fd27a['error'][_0xba39('0x12')]===0x1f4){logger['error']('AnalyticDefaultReport,\x20%s,\x20%s',_0x1e2044,_0x2fd27a[_0xba39('0x13')]['message']);return _0x56ab24(_0x2fd27a[_0xba39('0x13')][_0xba39('0x14')]);}logger[_0xba39('0x13')]('AnalyticDefaultReport,\x20%s,\x20%s',_0x1e2044,_0x2fd27a[_0xba39('0x13')]['message']);return _0x628e00(_0x2fd27a[_0xba39('0x13')][_0xba39('0x14')]);}else{logger[_0xba39('0x15')]('AnalyticDefaultReport,\x20%s,\x20%s',_0x1e2044,_0xba39('0xe'));_0x628e00(_0x2fd27a[_0xba39('0x16')][_0xba39('0x14')]);}})[_0xba39('0x17')](function(_0xed0a90){logger['error'](_0xba39('0xd'),_0x1e2044,_0xed0a90);_0x56ab24(_0xed0a90);});});}
\ No newline at end of file
+var _0x9466=['debug','AnalyticDefaultReport,\x20%s,\x20%s,\x20%s','stringify','error','code','AnalyticDefaultReport,\x20%s,\x20%s','message','result','lodash','util','moment','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','request\x20sent'];(function(_0x2fd69d,_0xeb1037){var _0x5d5ef3=function(_0xa9ea9e){while(--_0xa9ea9e){_0x2fd69d['push'](_0x2fd69d['shift']());}};_0x5d5ef3(++_0xeb1037);}(_0x9466,0x110));var _0x6946=function(_0x36c5b0,_0x5001da){_0x36c5b0=_0x36c5b0-0x0;var _0xf19333=_0x9466[_0x36c5b0];return _0xf19333;};'use strict';var _=require(_0x6946('0x0'));var util=require(_0x6946('0x1'));var moment=require(_0x6946('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x6946('0x3'));var db=require(_0x6946('0x4'))['db'];var utils=require(_0x6946('0x5'));var logger=require(_0x6946('0x6'))(_0x6946('0x7'));var config=require(_0x6946('0x8'));var jayson=require(_0x6946('0x9'));var client=jayson[_0x6946('0xa')][_0x6946('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x4d17ed,_0xc51407,_0x35b30c){return new BPromise(function(_0x43b1a6,_0x405995){return client[_0x6946('0xc')](_0x4d17ed,_0x35b30c)[_0x6946('0xd')](function(_0x4de0fb){logger[_0x6946('0xe')]('AnalyticDefaultReport,\x20%s,\x20%s',_0xc51407,_0x6946('0xf'));logger[_0x6946('0x10')](_0x6946('0x11'),_0xc51407,'request\x20sent',JSON[_0x6946('0x12')](_0x4de0fb));if(_0x4de0fb[_0x6946('0x13')]){if(_0x4de0fb[_0x6946('0x13')][_0x6946('0x14')]===0x1f4){logger[_0x6946('0x13')](_0x6946('0x15'),_0xc51407,_0x4de0fb['error'][_0x6946('0x16')]);return _0x405995(_0x4de0fb[_0x6946('0x13')][_0x6946('0x16')]);}logger['error']('AnalyticDefaultReport,\x20%s,\x20%s',_0xc51407,_0x4de0fb['error'][_0x6946('0x16')]);return _0x43b1a6(_0x4de0fb['error'][_0x6946('0x16')]);}else{logger[_0x6946('0xe')](_0x6946('0x15'),_0xc51407,'request\x20sent');_0x43b1a6(_0x4de0fb[_0x6946('0x17')][_0x6946('0x16')]);}})['catch'](function(_0x52f083){logger[_0x6946('0x13')]('AnalyticDefaultReport,\x20%s,\x20%s',_0xc51407,_0x52f083);_0x405995(_0x52f083);});});}
\ No newline at end of file
diff --git a/server/api/analyticDefaultReport/index.js b/server/api/analyticDefaultReport/index.js
index e65dcb8..d93f96c 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 _0x4365=['/:id','show','/:id/preview','preview','run','/:id/query','query','post','create','delete','destroy','multer','util','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./analyticDefaultReport.controller','get','isAuthenticated','index'];(function(_0x47c452,_0x197227){var _0x8bcfe3=function(_0x3f1fb3){while(--_0x3f1fb3){_0x47c452['push'](_0x47c452['shift']());}};_0x8bcfe3(++_0x197227);}(_0x4365,0x143));var _0x5436=function(_0x205e6a,_0xfa8d0d){_0x205e6a=_0x205e6a-0x0;var _0x330d5c=_0x4365[_0x205e6a];return _0x330d5c;};'use strict';var multer=require(_0x5436('0x0'));var util=require(_0x5436('0x1'));var path=require('path');var timeout=require(_0x5436('0x2'));var express=require(_0x5436('0x3'));var router=express[_0x5436('0x4')]();var fs_extra=require(_0x5436('0x5'));var auth=require(_0x5436('0x6'));var interaction=require(_0x5436('0x7'));var config=require(_0x5436('0x8'));var controller=require(_0x5436('0x9'));router[_0x5436('0xa')]('/',auth[_0x5436('0xb')](),controller[_0x5436('0xc')]);router[_0x5436('0xa')](_0x5436('0xd'),auth['isAuthenticated'](),controller[_0x5436('0xe')]);router[_0x5436('0xa')](_0x5436('0xf'),auth[_0x5436('0xb')](),controller[_0x5436('0x10')]);router[_0x5436('0xa')]('/:id/run',auth['isAuthenticated'](),controller[_0x5436('0x11')]);router[_0x5436('0xa')](_0x5436('0x12'),auth[_0x5436('0xb')](),controller[_0x5436('0x13')]);router[_0x5436('0x14')]('/',auth[_0x5436('0xb')](),controller[_0x5436('0x15')]);router['put'](_0x5436('0xd'),auth[_0x5436('0xb')](),controller['update']);router[_0x5436('0x16')](_0x5436('0xd'),auth[_0x5436('0xb')](),controller[_0x5436('0x17')]);module['exports']=router;
\ No newline at end of file
+var _0x3958=['../../components/interaction/service','./analyticDefaultReport.controller','get','index','/:id','isAuthenticated','show','/:id/preview','preview','/:id/run','run','/:id/query','query','post','create','put','update','delete','exports','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service'];(function(_0x2544e1,_0x239612){var _0x33f958=function(_0x39ce75){while(--_0x39ce75){_0x2544e1['push'](_0x2544e1['shift']());}};_0x33f958(++_0x239612);}(_0x3958,0x7b));var _0x8395=function(_0x5a9527,_0x57a3d4){_0x5a9527=_0x5a9527-0x0;var _0x24c159=_0x3958[_0x5a9527];return _0x24c159;};'use strict';var multer=require('multer');var util=require(_0x8395('0x0'));var path=require(_0x8395('0x1'));var timeout=require(_0x8395('0x2'));var express=require(_0x8395('0x3'));var router=express[_0x8395('0x4')]();var fs_extra=require(_0x8395('0x5'));var auth=require(_0x8395('0x6'));var interaction=require(_0x8395('0x7'));var config=require('../../config/environment');var controller=require(_0x8395('0x8'));router[_0x8395('0x9')]('/',auth['isAuthenticated'](),controller[_0x8395('0xa')]);router['get'](_0x8395('0xb'),auth[_0x8395('0xc')](),controller[_0x8395('0xd')]);router['get'](_0x8395('0xe'),auth[_0x8395('0xc')](),controller[_0x8395('0xf')]);router['get'](_0x8395('0x10'),auth['isAuthenticated'](),controller[_0x8395('0x11')]);router[_0x8395('0x9')](_0x8395('0x12'),auth['isAuthenticated'](),controller[_0x8395('0x13')]);router[_0x8395('0x14')]('/',auth['isAuthenticated'](),controller[_0x8395('0x15')]);router[_0x8395('0x16')](_0x8395('0xb'),auth[_0x8395('0xc')](),controller[_0x8395('0x17')]);router[_0x8395('0x18')]('/:id',auth[_0x8395('0xc')](),controller['destroy']);module[_0x8395('0x19')]=router;
\ No newline at end of file
diff --git a/server/api/analyticExtractedReport/analyticExtractedReport.attributes.js b/server/api/analyticExtractedReport/analyticExtractedReport.attributes.js
index 58d3da7..d311f79 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 _0x3bc6=['xlsx','DATE','ENUM','manual','INTEGER','UNSIGNED','sequelize','exports','STRING','csv','pdf'];(function(_0x119d5a,_0x19b457){var _0x15bff4=function(_0x1b7c78){while(--_0x1b7c78){_0x119d5a['push'](_0x119d5a['shift']());}};_0x15bff4(++_0x19b457);}(_0x3bc6,0x10e));var _0x63bc=function(_0x516c22,_0x11bc59){_0x516c22=_0x516c22-0x0;var _0x52217f=_0x3bc6[_0x516c22];return _0x52217f;};'use strict';var Sequelize=require(_0x63bc('0x0'));var moment=require('moment');module[_0x63bc('0x1')]={'name':{'type':Sequelize[_0x63bc('0x2')],'allowNull':![]},'basename':{'type':Sequelize[_0x63bc('0x2')],'allowNull':![]},'output':{'type':Sequelize['ENUM'](_0x63bc('0x3'),_0x63bc('0x4'),_0x63bc('0x5')),'allowNull':![],'defaultValue':_0x63bc('0x3')},'savename':{'type':Sequelize['STRING'],'allowNull':![]},'startDate':{'type':Sequelize['DATE']},'endDate':{'type':Sequelize[_0x63bc('0x6')]},'status':{'type':Sequelize['STRING'],'defaultValue':'Loading'},'type':{'type':Sequelize[_0x63bc('0x7')](_0x63bc('0x8'),'scheduled'),'allowNull':![],'defaultValue':_0x63bc('0x8')},'reportId':{'type':Sequelize[_0x63bc('0x9')](0xb)[_0x63bc('0xa')]},'reportType':{'type':Sequelize[_0x63bc('0x2')]}};
\ No newline at end of file
+var _0xde82=['DATE','manual','scheduled','INTEGER','sequelize','moment','exports','STRING','csv','pdf'];(function(_0x4a881e,_0x534433){var _0x26929f=function(_0xe746c4){while(--_0xe746c4){_0x4a881e['push'](_0x4a881e['shift']());}};_0x26929f(++_0x534433);}(_0xde82,0x176));var _0x2de8=function(_0x396670,_0x23fed3){_0x396670=_0x396670-0x0;var _0x2a28f3=_0xde82[_0x396670];return _0x2a28f3;};'use strict';var Sequelize=require(_0x2de8('0x0'));var moment=require(_0x2de8('0x1'));module[_0x2de8('0x2')]={'name':{'type':Sequelize[_0x2de8('0x3')],'allowNull':![]},'basename':{'type':Sequelize[_0x2de8('0x3')],'allowNull':![]},'output':{'type':Sequelize['ENUM'](_0x2de8('0x4'),_0x2de8('0x5'),'xlsx'),'allowNull':![],'defaultValue':_0x2de8('0x4')},'savename':{'type':Sequelize[_0x2de8('0x3')],'allowNull':![]},'startDate':{'type':Sequelize[_0x2de8('0x6')]},'endDate':{'type':Sequelize[_0x2de8('0x6')]},'status':{'type':Sequelize[_0x2de8('0x3')],'defaultValue':'Loading'},'type':{'type':Sequelize['ENUM'](_0x2de8('0x7'),_0x2de8('0x8')),'allowNull':![],'defaultValue':'manual'},'reportId':{'type':Sequelize[_0x2de8('0x9')](0xb)['UNSIGNED']},'reportType':{'type':Sequelize[_0x2de8('0x3')]}};
\ No newline at end of file
diff --git a/server/api/analyticExtractedReport/analyticExtractedReport.controller.js b/server/api/analyticExtractedReport/analyticExtractedReport.controller.js
index d10e524..963265f 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 _0xe703=['output','join','root','server/files/reports','Sequelize','ValidationError','Report\x20not\x20found\x20or\x20empty','%s.%s','toLowerCase','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','fs-extra','lodash','squel','crypto','jsforce','desk.js','to-csv','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','then','destroy','get','UserProfileResource','error','stack','name','send','map','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','VIRTUAL','filter','options','AnalyticExtractedReport','includeAll','include','findAll','rows','catch','show','params','merge','find','create','body','user','role','ExtractedReports','UserProfileSection','autoAssociation','download','basename','savename'];(function(_0x1ac595,_0x5d2081){var _0x455fff=function(_0x3043ee){while(--_0x3043ee){_0x1ac595['push'](_0x1ac595['shift']());}};_0x455fff(++_0x5d2081);}(_0xe703,0x6c));var _0x3e70=function(_0x206ca8,_0x34739a){_0x206ca8=_0x206ca8-0x0;var _0x508d10=_0xe703[_0x206ca8];return _0x508d10;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x3e70('0x0'));var jsonpatch=require(_0x3e70('0x1'));var rp=require(_0x3e70('0x2'));var moment=require(_0x3e70('0x3'));var BPromise=require(_0x3e70('0x4'));var Mustache=require(_0x3e70('0x5'));var util=require(_0x3e70('0x6'));var path=require(_0x3e70('0x7'));var sox=require(_0x3e70('0x8'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x3e70('0x9'));var _=require(_0x3e70('0xa'));var squel=require(_0x3e70('0xb'));var crypto=require(_0x3e70('0xc'));var jsforce=require(_0x3e70('0xd'));var deskjs=require(_0x3e70('0xe'));var toCsv=require(_0x3e70('0xf'));var querystring=require(_0x3e70('0x10'));var Papa=require(_0x3e70('0x11'));var Redis=require('ioredis');var authService=require(_0x3e70('0x12'));var qs=require(_0x3e70('0x13'));var as=require(_0x3e70('0x14'));var hardwareService=require(_0x3e70('0x15'));var logger=require(_0x3e70('0x16'))(_0x3e70('0x17'));var utils=require('../../config/utils');var config=require(_0x3e70('0x18'));var licenseUtil=require(_0x3e70('0x19'));var db=require(_0x3e70('0x1a'))['db'];function respondWithStatusCode(_0x506b85,_0x403a1a){_0x403a1a=_0x403a1a||0xcc;return function(_0x329ec3){if(_0x329ec3){return _0x506b85[_0x3e70('0x1b')](_0x403a1a);}return _0x506b85[_0x3e70('0x1c')](_0x403a1a)[_0x3e70('0x1d')]();};}function respondWithResult(_0x5e350a,_0x156e46){_0x156e46=_0x156e46||0xc8;return function(_0x3adfbe){if(_0x3adfbe){return _0x5e350a[_0x3e70('0x1c')](_0x156e46)[_0x3e70('0x1e')](_0x3adfbe);}};}function respondWithFilteredResult(_0x544d9e,_0x1dd1c9){return function(_0x13f2d8){if(_0x13f2d8){var _0x3658a2=typeof _0x1dd1c9[_0x3e70('0x1f')]===_0x3e70('0x20')&&typeof _0x1dd1c9[_0x3e70('0x21')]==='undefined';var _0x11b081=_0x13f2d8[_0x3e70('0x22')];var _0x502b06=_0x3658a2?0x0:_0x1dd1c9[_0x3e70('0x1f')];var _0x198d19=_0x3658a2?_0x13f2d8[_0x3e70('0x22')]:_0x1dd1c9[_0x3e70('0x1f')]+_0x1dd1c9[_0x3e70('0x21')];var _0x39b191;if(_0x198d19>=_0x11b081){_0x198d19=_0x11b081;_0x39b191=0xc8;}else{_0x39b191=0xce;}_0x544d9e['status'](_0x39b191);return _0x544d9e[_0x3e70('0x23')](_0x3e70('0x24'),_0x502b06+'-'+_0x198d19+'/'+_0x11b081)[_0x3e70('0x1e')](_0x13f2d8);}return null;};}function patchUpdates(_0xdefaeb){return function(_0x35f662){try{jsonpatch[_0x3e70('0x25')](_0x35f662,_0xdefaeb,!![]);}catch(_0x4f2610){return BPromise[_0x3e70('0x26')](_0x4f2610);}return _0x35f662[_0x3e70('0x27')]();};}function saveUpdates(_0x337716,_0x42313f){return function(_0x528592){if(_0x528592){return _0x528592[_0x3e70('0x28')](_0x337716)[_0x3e70('0x29')](function(_0x20c073){return _0x20c073;});}return null;};}function removeEntity(_0x4a423b,_0x2ea56f){return function(_0xffab03){if(_0xffab03){return _0xffab03[_0x3e70('0x2a')]()[_0x3e70('0x29')](function(){var _0x224eb6=_0xffab03[_0x3e70('0x2b')]({'plain':!![]});var _0xc00145='ExtractedReports';return db[_0x3e70('0x2c')][_0x3e70('0x2a')]({'where':{'type':_0xc00145,'resourceId':_0x224eb6['id']}})['then'](function(){return _0xffab03;});})[_0x3e70('0x29')](function(){_0x4a423b[_0x3e70('0x1c')](0xcc)[_0x3e70('0x1d')]();});}};}function handleEntityNotFound(_0x34a183,_0x4195c7){return function(_0x275978){if(!_0x275978){_0x34a183[_0x3e70('0x1b')](0x194);}return _0x275978;};}function handleError(_0x469e21,_0x39a138){_0x39a138=_0x39a138||0x1f4;return function(_0x25df1b){logger[_0x3e70('0x2d')](_0x25df1b[_0x3e70('0x2e')]);if(_0x25df1b[_0x3e70('0x2f')]){delete _0x25df1b['name'];}_0x469e21[_0x3e70('0x1c')](_0x39a138)[_0x3e70('0x30')](_0x25df1b);};}exports['index']=function(_0x4383cc,_0x1810bf){var _0x347a8a={},_0xb9968e={},_0x2596a6={'count':0x0,'rows':[]};var _0x32de42=_[_0x3e70('0x31')](db['AnalyticExtractedReport'][_0x3e70('0x32')],function(_0x326d8f){return{'name':_0x326d8f[_0x3e70('0x33')],'type':_0x326d8f[_0x3e70('0x34')][_0x3e70('0x35')]};});_0xb9968e[_0x3e70('0x36')]=_[_0x3e70('0x31')](_0x32de42,_0x3e70('0x2f'));_0xb9968e[_0x3e70('0x37')]=_[_0x3e70('0x38')](_0x4383cc[_0x3e70('0x37')]);_0xb9968e[_0x3e70('0x39')]=_[_0x3e70('0x3a')](_0xb9968e['model'],_0xb9968e[_0x3e70('0x37')]);_0x347a8a[_0x3e70('0x3b')]=_[_0x3e70('0x3a')](_0xb9968e[_0x3e70('0x36')],qs[_0x3e70('0x3c')](_0x4383cc['query'][_0x3e70('0x3c')]));_0x347a8a['attributes']=_0x347a8a[_0x3e70('0x3b')][_0x3e70('0x3d')]?_0x347a8a['attributes']:_0xb9968e[_0x3e70('0x36')];if(!_0x4383cc['query'][_0x3e70('0x3e')](_0x3e70('0x3f'))){_0x347a8a[_0x3e70('0x21')]=qs[_0x3e70('0x21')](_0x4383cc['query']['limit']);_0x347a8a['offset']=qs[_0x3e70('0x1f')](_0x4383cc[_0x3e70('0x37')][_0x3e70('0x1f')]);}_0x347a8a[_0x3e70('0x40')]=qs[_0x3e70('0x41')](_0x4383cc[_0x3e70('0x37')][_0x3e70('0x41')]);_0x347a8a[_0x3e70('0x42')]=qs[_0x3e70('0x39')](_['pick'](_0x4383cc[_0x3e70('0x37')],_0xb9968e[_0x3e70('0x39')]),_0x32de42);if(_0x4383cc['query']['filter']){_0x347a8a[_0x3e70('0x42')]=_['merge'](_0x347a8a['where'],{'$or':_[_0x3e70('0x31')](_0x32de42,function(_0xc57ec){if(_0xc57ec[_0x3e70('0x34')]!==_0x3e70('0x43')){var _0x1a639d={};_0x1a639d[_0xc57ec[_0x3e70('0x2f')]]={'$like':'%'+_0x4383cc[_0x3e70('0x37')][_0x3e70('0x44')]+'%'};return _0x1a639d;}})});}_0x347a8a=_['merge']({},_0x347a8a,_0x4383cc[_0x3e70('0x45')]);var _0x585b53={'where':_0x347a8a[_0x3e70('0x42')]};return db[_0x3e70('0x46')][_0x3e70('0x22')](_0x585b53)[_0x3e70('0x29')](function(_0x8efe1e){_0x2596a6[_0x3e70('0x22')]=_0x8efe1e;if(_0x4383cc[_0x3e70('0x37')][_0x3e70('0x47')]){_0x347a8a[_0x3e70('0x48')]=[{'all':!![]}];}return db['AnalyticExtractedReport'][_0x3e70('0x49')](_0x347a8a);})[_0x3e70('0x29')](function(_0x26dbe6){_0x2596a6[_0x3e70('0x4a')]=_0x26dbe6;return _0x2596a6;})[_0x3e70('0x29')](respondWithFilteredResult(_0x1810bf,_0x347a8a))[_0x3e70('0x4b')](handleError(_0x1810bf,null));};exports[_0x3e70('0x4c')]=function(_0x5c2fa3,_0x3491a6){var _0x5247d4={'raw':!![],'where':{'id':_0x5c2fa3[_0x3e70('0x4d')]['id']}},_0xe8fde1={};_0xe8fde1[_0x3e70('0x36')]=_[_0x3e70('0x38')](db[_0x3e70('0x46')][_0x3e70('0x32')]);_0xe8fde1[_0x3e70('0x37')]=_[_0x3e70('0x38')](_0x5c2fa3[_0x3e70('0x37')]);_0xe8fde1[_0x3e70('0x39')]=_['intersection'](_0xe8fde1[_0x3e70('0x36')],_0xe8fde1[_0x3e70('0x37')]);_0x5247d4[_0x3e70('0x3b')]=_['intersection'](_0xe8fde1[_0x3e70('0x36')],qs[_0x3e70('0x3c')](_0x5c2fa3[_0x3e70('0x37')][_0x3e70('0x3c')]));_0x5247d4[_0x3e70('0x3b')]=_0x5247d4[_0x3e70('0x3b')][_0x3e70('0x3d')]?_0x5247d4[_0x3e70('0x3b')]:_0xe8fde1[_0x3e70('0x36')];if(_0x5c2fa3[_0x3e70('0x37')][_0x3e70('0x47')]){_0x5247d4[_0x3e70('0x48')]=[{'all':!![]}];}_0x5247d4=_[_0x3e70('0x4e')]({},_0x5247d4,_0x5c2fa3['options']);return db[_0x3e70('0x46')][_0x3e70('0x4f')](_0x5247d4)[_0x3e70('0x29')](handleEntityNotFound(_0x3491a6,null))['then'](respondWithResult(_0x3491a6,null))[_0x3e70('0x4b')](handleError(_0x3491a6,null));};exports['create']=function(_0x4e60fb,_0x5a5db7){return db[_0x3e70('0x46')][_0x3e70('0x50')](_0x4e60fb[_0x3e70('0x51')],{})[_0x3e70('0x29')](function(_0x2436f5){var _0x364843=_0x4e60fb[_0x3e70('0x52')][_0x3e70('0x2b')]({'plain':!![]});if(!_0x364843)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x364843[_0x3e70('0x53')]===_0x3e70('0x52')){var _0x13aa7b=_0x2436f5[_0x3e70('0x2b')]({'plain':!![]});var _0x36ae53=_0x3e70('0x54');return db[_0x3e70('0x55')][_0x3e70('0x4f')]({'where':{'name':_0x36ae53,'userProfileId':_0x364843['userProfileId']},'raw':!![]})[_0x3e70('0x29')](function(_0x435766){if(_0x435766&&_0x435766[_0x3e70('0x56')]===0x0){return db[_0x3e70('0x2c')][_0x3e70('0x50')]({'name':_0x13aa7b[_0x3e70('0x2f')],'resourceId':_0x13aa7b['id'],'type':_0x435766['name'],'sectionId':_0x435766['id']},{})[_0x3e70('0x29')](function(){return _0x2436f5;});}else{return _0x2436f5;}})[_0x3e70('0x4b')](function(_0x754bca){logger[_0x3e70('0x2d')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x754bca);throw _0x754bca;});}return _0x2436f5;})[_0x3e70('0x29')](respondWithResult(_0x5a5db7,0xc9))['catch'](handleError(_0x5a5db7,null));};exports['update']=function(_0x224d07,_0x5dd86c){if(_0x224d07[_0x3e70('0x51')]['id']){delete _0x224d07[_0x3e70('0x51')]['id'];}return db[_0x3e70('0x46')][_0x3e70('0x4f')]({'where':{'id':_0x224d07[_0x3e70('0x4d')]['id']}})[_0x3e70('0x29')](handleEntityNotFound(_0x5dd86c,null))[_0x3e70('0x29')](saveUpdates(_0x224d07[_0x3e70('0x51')],null))[_0x3e70('0x29')](respondWithResult(_0x5dd86c,null))[_0x3e70('0x4b')](handleError(_0x5dd86c,null));};exports[_0x3e70('0x2a')]=function(_0x258c1d,_0x1f80d2){return db[_0x3e70('0x46')][_0x3e70('0x4f')]({'where':{'id':_0x258c1d['params']['id']}})[_0x3e70('0x29')](handleEntityNotFound(_0x1f80d2,null))['then'](removeEntity(_0x1f80d2,null))[_0x3e70('0x4b')](handleError(_0x1f80d2,null));};exports[_0x3e70('0x57')]=function(_0x53aa38,_0x5bbbde,_0x3aedf0){return db['AnalyticExtractedReport']['find']({'where':{'id':_0x53aa38['params']['id']},'attributes':[_0x3e70('0x2f'),_0x3e70('0x58'),_0x3e70('0x59'),_0x3e70('0x5a')],'raw':!![]})[_0x3e70('0x29')](handleEntityNotFound(_0x5bbbde,null))[_0x3e70('0x29')](function(_0x3114d1){if(_0x3114d1){if(!fs['existsSync'](path[_0x3e70('0x5b')](config[_0x3e70('0x5c')],_0x3e70('0x5d'),_0x3114d1[_0x3e70('0x59')]))){throw new db[(_0x3e70('0x5e'))][(_0x3e70('0x5f'))](_0x3e70('0x60'));}if(_0x53aa38[_0x3e70('0x37')]['exists']){return _0x5bbbde[_0x3e70('0x1b')](0xc8);}return _0x5bbbde[_0x3e70('0x57')](path[_0x3e70('0x5b')](config['root'],_0x3e70('0x5d'),_0x3114d1[_0x3e70('0x59')]),util['format'](_0x3e70('0x61'),_0x3114d1['basename']||_0x3114d1[_0x3e70('0x2f')],_0x3114d1[_0x3e70('0x5a')][_0x3e70('0x62')]()));}})[_0x3e70('0x4b')](handleError(_0x5bbbde,null));};
\ No newline at end of file
+var _0xf61f=['../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','apply','reject','update','then','ExtractedReports','UserProfileResource','destroy','stack','name','send','index','map','AnalyticExtractedReport','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','order','sort','where','pick','filter','merge','includeAll','include','findAll','rows','catch','show','params','options','create','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','find','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','download','basename','savename','output','join','root','server/files/reports','Sequelize','ValidationError','Report\x20not\x20found\x20or\x20empty','format','toLowerCase','zip-dir','fast-json-patch','moment','bluebird','mustache','util','to-csv','ejs','fs-extra','crypto','jsforce','desk.js','querystring','../../components/auth/service'];(function(_0x2df821,_0x12c725){var _0x487ea1=function(_0x2bf649){while(--_0x2bf649){_0x2df821['push'](_0x2df821['shift']());}};_0x487ea1(++_0x12c725);}(_0xf61f,0x103));var _0xff61=function(_0x391df0,_0x51b2dc){_0x391df0=_0x391df0-0x0;var _0x30bec6=_0xf61f[_0x391df0];return _0x30bec6;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0xff61('0x0'));var jsonpatch=require(_0xff61('0x1'));var rp=require('request-promise');var moment=require(_0xff61('0x2'));var BPromise=require(_0xff61('0x3'));var Mustache=require(_0xff61('0x4'));var util=require(_0xff61('0x5'));var path=require('path');var sox=require('sox');var csv=require(_0xff61('0x6'));var ejs=require(_0xff61('0x7'));var fs=require('fs');var fs_extra=require(_0xff61('0x8'));var _=require('lodash');var squel=require('squel');var crypto=require(_0xff61('0x9'));var jsforce=require(_0xff61('0xa'));var deskjs=require(_0xff61('0xb'));var toCsv=require(_0xff61('0x6'));var querystring=require(_0xff61('0xc'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0xff61('0xd'));var qs=require(_0xff61('0xe'));var as=require(_0xff61('0xf'));var hardwareService=require(_0xff61('0x10'));var logger=require(_0xff61('0x11'))('api');var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0xff61('0x12'));var db=require(_0xff61('0x13'))['db'];function respondWithStatusCode(_0x3d2ade,_0x2e0db7){_0x2e0db7=_0x2e0db7||0xcc;return function(_0x59f565){if(_0x59f565){return _0x3d2ade[_0xff61('0x14')](_0x2e0db7);}return _0x3d2ade[_0xff61('0x15')](_0x2e0db7)[_0xff61('0x16')]();};}function respondWithResult(_0x250020,_0x423e47){_0x423e47=_0x423e47||0xc8;return function(_0x412724){if(_0x412724){return _0x250020['status'](_0x423e47)[_0xff61('0x17')](_0x412724);}};}function respondWithFilteredResult(_0x27f6f6,_0x3cab09){return function(_0x17c3de){if(_0x17c3de){var _0x213cb8=typeof _0x3cab09[_0xff61('0x18')]===_0xff61('0x19')&&typeof _0x3cab09[_0xff61('0x1a')]==='undefined';var _0x26362a=_0x17c3de[_0xff61('0x1b')];var _0x3dda91=_0x213cb8?0x0:_0x3cab09[_0xff61('0x18')];var _0x545f61=_0x213cb8?_0x17c3de[_0xff61('0x1b')]:_0x3cab09[_0xff61('0x18')]+_0x3cab09['limit'];var _0x17e8f0;if(_0x545f61>=_0x26362a){_0x545f61=_0x26362a;_0x17e8f0=0xc8;}else{_0x17e8f0=0xce;}_0x27f6f6[_0xff61('0x15')](_0x17e8f0);return _0x27f6f6[_0xff61('0x1c')]('Content-Range',_0x3dda91+'-'+_0x545f61+'/'+_0x26362a)[_0xff61('0x17')](_0x17c3de);}return null;};}function patchUpdates(_0x492480){return function(_0x386577){try{jsonpatch[_0xff61('0x1d')](_0x386577,_0x492480,!![]);}catch(_0x40175e){return BPromise[_0xff61('0x1e')](_0x40175e);}return _0x386577['save']();};}function saveUpdates(_0x28099b,_0x2c06a6){return function(_0x2f1ae5){if(_0x2f1ae5){return _0x2f1ae5[_0xff61('0x1f')](_0x28099b)[_0xff61('0x20')](function(_0x5b2704){return _0x5b2704;});}return null;};}function removeEntity(_0x3c2209,_0x3c9240){return function(_0x2ab736){if(_0x2ab736){return _0x2ab736['destroy']()[_0xff61('0x20')](function(){var _0x3605f2=_0x2ab736['get']({'plain':!![]});var _0x143a83=_0xff61('0x21');return db[_0xff61('0x22')][_0xff61('0x23')]({'where':{'type':_0x143a83,'resourceId':_0x3605f2['id']}})['then'](function(){return _0x2ab736;});})['then'](function(){_0x3c2209[_0xff61('0x15')](0xcc)[_0xff61('0x16')]();});}};}function handleEntityNotFound(_0x1fc581,_0xa6dba6){return function(_0x161eeb){if(!_0x161eeb){_0x1fc581[_0xff61('0x14')](0x194);}return _0x161eeb;};}function handleError(_0x2579ba,_0x1fd8af){_0x1fd8af=_0x1fd8af||0x1f4;return function(_0x2aed73){logger['error'](_0x2aed73[_0xff61('0x24')]);if(_0x2aed73[_0xff61('0x25')]){delete _0x2aed73['name'];}_0x2579ba[_0xff61('0x15')](_0x1fd8af)[_0xff61('0x26')](_0x2aed73);};}exports[_0xff61('0x27')]=function(_0x210961,_0x35b5da){var _0x4a75a2={},_0x5c35e0={},_0x206e4d={'count':0x0,'rows':[]};var _0x12ee4e=_[_0xff61('0x28')](db[_0xff61('0x29')][_0xff61('0x2a')],function(_0x196023){return{'name':_0x196023[_0xff61('0x2b')],'type':_0x196023[_0xff61('0x2c')][_0xff61('0x2d')]};});_0x5c35e0[_0xff61('0x2e')]=_[_0xff61('0x28')](_0x12ee4e,_0xff61('0x25'));_0x5c35e0[_0xff61('0x2f')]=_[_0xff61('0x30')](_0x210961[_0xff61('0x2f')]);_0x5c35e0[_0xff61('0x31')]=_[_0xff61('0x32')](_0x5c35e0[_0xff61('0x2e')],_0x5c35e0['query']);_0x4a75a2[_0xff61('0x33')]=_[_0xff61('0x32')](_0x5c35e0[_0xff61('0x2e')],qs['fields'](_0x210961[_0xff61('0x2f')][_0xff61('0x34')]));_0x4a75a2[_0xff61('0x33')]=_0x4a75a2['attributes'][_0xff61('0x35')]?_0x4a75a2[_0xff61('0x33')]:_0x5c35e0[_0xff61('0x2e')];if(!_0x210961[_0xff61('0x2f')][_0xff61('0x36')]('nolimit')){_0x4a75a2[_0xff61('0x1a')]=qs['limit'](_0x210961[_0xff61('0x2f')][_0xff61('0x1a')]);_0x4a75a2['offset']=qs[_0xff61('0x18')](_0x210961[_0xff61('0x2f')]['offset']);}_0x4a75a2[_0xff61('0x37')]=qs[_0xff61('0x38')](_0x210961[_0xff61('0x2f')][_0xff61('0x38')]);_0x4a75a2[_0xff61('0x39')]=qs[_0xff61('0x31')](_[_0xff61('0x3a')](_0x210961[_0xff61('0x2f')],_0x5c35e0['filters']),_0x12ee4e);if(_0x210961['query'][_0xff61('0x3b')]){_0x4a75a2[_0xff61('0x39')]=_[_0xff61('0x3c')](_0x4a75a2[_0xff61('0x39')],{'$or':_[_0xff61('0x28')](_0x12ee4e,function(_0xace7f0){if(_0xace7f0[_0xff61('0x2c')]!=='VIRTUAL'){var _0x383221={};_0x383221[_0xace7f0['name']]={'$like':'%'+_0x210961[_0xff61('0x2f')][_0xff61('0x3b')]+'%'};return _0x383221;}})});}_0x4a75a2=_[_0xff61('0x3c')]({},_0x4a75a2,_0x210961['options']);var _0x39bebd={'where':_0x4a75a2[_0xff61('0x39')]};return db[_0xff61('0x29')]['count'](_0x39bebd)['then'](function(_0x9a92be){_0x206e4d[_0xff61('0x1b')]=_0x9a92be;if(_0x210961[_0xff61('0x2f')][_0xff61('0x3d')]){_0x4a75a2[_0xff61('0x3e')]=[{'all':!![]}];}return db[_0xff61('0x29')][_0xff61('0x3f')](_0x4a75a2);})[_0xff61('0x20')](function(_0x4652b4){_0x206e4d[_0xff61('0x40')]=_0x4652b4;return _0x206e4d;})[_0xff61('0x20')](respondWithFilteredResult(_0x35b5da,_0x4a75a2))[_0xff61('0x41')](handleError(_0x35b5da,null));};exports[_0xff61('0x42')]=function(_0x35e2e9,_0xecc5ec){var _0x13ed72={'raw':!![],'where':{'id':_0x35e2e9[_0xff61('0x43')]['id']}},_0x2768f0={};_0x2768f0['model']=_['keys'](db[_0xff61('0x29')][_0xff61('0x2a')]);_0x2768f0['query']=_[_0xff61('0x30')](_0x35e2e9[_0xff61('0x2f')]);_0x2768f0[_0xff61('0x31')]=_[_0xff61('0x32')](_0x2768f0[_0xff61('0x2e')],_0x2768f0[_0xff61('0x2f')]);_0x13ed72['attributes']=_[_0xff61('0x32')](_0x2768f0[_0xff61('0x2e')],qs[_0xff61('0x34')](_0x35e2e9[_0xff61('0x2f')]['fields']));_0x13ed72['attributes']=_0x13ed72[_0xff61('0x33')][_0xff61('0x35')]?_0x13ed72['attributes']:_0x2768f0[_0xff61('0x2e')];if(_0x35e2e9[_0xff61('0x2f')][_0xff61('0x3d')]){_0x13ed72[_0xff61('0x3e')]=[{'all':!![]}];}_0x13ed72=_[_0xff61('0x3c')]({},_0x13ed72,_0x35e2e9[_0xff61('0x44')]);return db[_0xff61('0x29')]['find'](_0x13ed72)[_0xff61('0x20')](handleEntityNotFound(_0xecc5ec,null))['then'](respondWithResult(_0xecc5ec,null))['catch'](handleError(_0xecc5ec,null));};exports[_0xff61('0x45')]=function(_0x4058ab,_0x4c4d55){return db['AnalyticExtractedReport'][_0xff61('0x45')](_0x4058ab['body'],{})['then'](function(_0x43ce2e){var _0x5b4cc3=_0x4058ab[_0xff61('0x46')][_0xff61('0x47')]({'plain':!![]});if(!_0x5b4cc3)throw new Error(_0xff61('0x48'));if(_0x5b4cc3[_0xff61('0x49')]==='user'){var _0x2a1120=_0x43ce2e[_0xff61('0x47')]({'plain':!![]});var _0x42c430='ExtractedReports';return db[_0xff61('0x4a')][_0xff61('0x4b')]({'where':{'name':_0x42c430,'userProfileId':_0x5b4cc3['userProfileId']},'raw':!![]})[_0xff61('0x20')](function(_0x4e09fd){if(_0x4e09fd&&_0x4e09fd['autoAssociation']===0x0){return db[_0xff61('0x22')]['create']({'name':_0x2a1120[_0xff61('0x25')],'resourceId':_0x2a1120['id'],'type':_0x4e09fd[_0xff61('0x25')],'sectionId':_0x4e09fd['id']},{})[_0xff61('0x20')](function(){return _0x43ce2e;});}else{return _0x43ce2e;}})[_0xff61('0x41')](function(_0x453ef4){logger[_0xff61('0x4c')](_0xff61('0x4d'),_0x453ef4);throw _0x453ef4;});}return _0x43ce2e;})[_0xff61('0x20')](respondWithResult(_0x4c4d55,0xc9))[_0xff61('0x41')](handleError(_0x4c4d55,null));};exports[_0xff61('0x1f')]=function(_0x5f34e7,_0x1a9d48){if(_0x5f34e7[_0xff61('0x4e')]['id']){delete _0x5f34e7[_0xff61('0x4e')]['id'];}return db[_0xff61('0x29')]['find']({'where':{'id':_0x5f34e7[_0xff61('0x43')]['id']}})[_0xff61('0x20')](handleEntityNotFound(_0x1a9d48,null))[_0xff61('0x20')](saveUpdates(_0x5f34e7[_0xff61('0x4e')],null))[_0xff61('0x20')](respondWithResult(_0x1a9d48,null))[_0xff61('0x41')](handleError(_0x1a9d48,null));};exports[_0xff61('0x23')]=function(_0x4b7ef8,_0x1d99f4){return db['AnalyticExtractedReport']['find']({'where':{'id':_0x4b7ef8['params']['id']}})['then'](handleEntityNotFound(_0x1d99f4,null))[_0xff61('0x20')](removeEntity(_0x1d99f4,null))[_0xff61('0x41')](handleError(_0x1d99f4,null));};exports[_0xff61('0x4f')]=function(_0x1b5c53,_0x5cf4f6,_0x101752){return db[_0xff61('0x29')][_0xff61('0x4b')]({'where':{'id':_0x1b5c53[_0xff61('0x43')]['id']},'attributes':[_0xff61('0x25'),_0xff61('0x50'),_0xff61('0x51'),_0xff61('0x52')],'raw':!![]})[_0xff61('0x20')](handleEntityNotFound(_0x5cf4f6,null))[_0xff61('0x20')](function(_0x15d501){if(_0x15d501){if(!fs['existsSync'](path[_0xff61('0x53')](config[_0xff61('0x54')],_0xff61('0x55'),_0x15d501[_0xff61('0x51')]))){throw new db[(_0xff61('0x56'))][(_0xff61('0x57'))](_0xff61('0x58'));}if(_0x1b5c53[_0xff61('0x2f')]['exists']){return _0x5cf4f6[_0xff61('0x14')](0xc8);}return _0x5cf4f6[_0xff61('0x4f')](path[_0xff61('0x53')](config['root'],'server/files/reports',_0x15d501[_0xff61('0x51')]),util[_0xff61('0x59')]('%s.%s',_0x15d501[_0xff61('0x50')]||_0x15d501['name'],_0x15d501[_0xff61('0x52')][_0xff61('0x5a')]()));}})[_0xff61('0x41')](handleError(_0x5cf4f6,null));};
\ No newline at end of file
diff --git a/server/api/analyticExtractedReport/analyticExtractedReport.model.js b/server/api/analyticExtractedReport/analyticExtractedReport.model.js
index 9220f85..ce8e675 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 _0x78f1=['util','../../config/logger','api','request-promise','path','rimraf','../../config/environment','./analyticExtractedReport.attributes','exports','define','analytics_extracted_reports','lodash'];(function(_0xf2e71c,_0x265309){var _0xf0f8cc=function(_0x285ef5){while(--_0x285ef5){_0xf2e71c['push'](_0xf2e71c['shift']());}};_0xf0f8cc(++_0x265309);}(_0x78f1,0x17f));var _0x178f=function(_0x3e5086,_0x48f4a2){_0x3e5086=_0x3e5086-0x0;var _0xfeb102=_0x78f1[_0x3e5086];return _0xfeb102;};'use strict';var _=require(_0x178f('0x0'));var util=require(_0x178f('0x1'));var logger=require(_0x178f('0x2'))(_0x178f('0x3'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x178f('0x4'));var fs=require('fs');var path=require(_0x178f('0x5'));var rimraf=require(_0x178f('0x6'));var config=require(_0x178f('0x7'));var attributes=require(_0x178f('0x8'));module[_0x178f('0x9')]=function(_0x44f34f,_0x2f8563){return _0x44f34f[_0x178f('0xa')]('AnalyticExtractedReport',attributes,{'tableName':_0x178f('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xa763=['moment','bluebird','path','../../config/environment','./analyticExtractedReport.attributes','exports','define','analytics_extracted_reports','lodash','util','../../config/logger','api'];(function(_0x233f29,_0x34d890){var _0x5768ce=function(_0x2a116e){while(--_0x2a116e){_0x233f29['push'](_0x233f29['shift']());}};_0x5768ce(++_0x34d890);}(_0xa763,0x134));var _0x3a76=function(_0x15c421,_0x6366f7){_0x15c421=_0x15c421-0x0;var _0x5e5ed5=_0xa763[_0x15c421];return _0x5e5ed5;};'use strict';var _=require(_0x3a76('0x0'));var util=require(_0x3a76('0x1'));var logger=require(_0x3a76('0x2'))(_0x3a76('0x3'));var moment=require(_0x3a76('0x4'));var BPromise=require(_0x3a76('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x3a76('0x6'));var rimraf=require('rimraf');var config=require(_0x3a76('0x7'));var attributes=require(_0x3a76('0x8'));module[_0x3a76('0x9')]=function(_0x1dcff9,_0x5eb47d){return _0x1dcff9[_0x3a76('0xa')]('AnalyticExtractedReport',attributes,{'tableName':_0x3a76('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 af2d9d7..d273911 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 _0x390a=['../../config/logger','rpc','../../config/environment','jayson/promise','client','then','info','AnalyticExtractedReport,\x20%s,\x20%s','request\x20sent','AnalyticExtractedReport,\x20%s,\x20%s,\x20%s','error','code','message','result','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils'];(function(_0x487ab4,_0x1e24e8){var _0x3bef77=function(_0x5ce664){while(--_0x5ce664){_0x487ab4['push'](_0x487ab4['shift']());}};_0x3bef77(++_0x1e24e8);}(_0x390a,0xbe));var _0xa390=function(_0xcc708,_0x3673b5){_0xcc708=_0xcc708-0x0;var _0x1999bc=_0x390a[_0xcc708];return _0x1999bc;};'use strict';var _=require(_0xa390('0x0'));var util=require(_0xa390('0x1'));var moment=require(_0xa390('0x2'));var BPromise=require(_0xa390('0x3'));var rs=require(_0xa390('0x4'));var fs=require('fs');var Redis=require(_0xa390('0x5'));var db=require(_0xa390('0x6'))['db'];var utils=require(_0xa390('0x7'));var logger=require(_0xa390('0x8'))(_0xa390('0x9'));var config=require(_0xa390('0xa'));var jayson=require(_0xa390('0xb'));var client=jayson[_0xa390('0xc')]['http']({'port':0x232a});function respondWithRpcPromise(_0x212916,_0x940df7,_0x55a074){return new BPromise(function(_0x3783bf,_0x4d6ed7){return client['request'](_0x212916,_0x55a074)[_0xa390('0xd')](function(_0x21e05b){logger[_0xa390('0xe')](_0xa390('0xf'),_0x940df7,_0xa390('0x10'));logger['debug'](_0xa390('0x11'),_0x940df7,_0xa390('0x10'),JSON['stringify'](_0x21e05b));if(_0x21e05b[_0xa390('0x12')]){if(_0x21e05b[_0xa390('0x12')][_0xa390('0x13')]===0x1f4){logger[_0xa390('0x12')](_0xa390('0xf'),_0x940df7,_0x21e05b[_0xa390('0x12')]['message']);return _0x4d6ed7(_0x21e05b[_0xa390('0x12')][_0xa390('0x14')]);}logger[_0xa390('0x12')]('AnalyticExtractedReport,\x20%s,\x20%s',_0x940df7,_0x21e05b['error'][_0xa390('0x14')]);return _0x3783bf(_0x21e05b['error'][_0xa390('0x14')]);}else{logger[_0xa390('0xe')](_0xa390('0xf'),_0x940df7,_0xa390('0x10'));_0x3783bf(_0x21e05b[_0xa390('0x15')]['message']);}})['catch'](function(_0x5b1998){logger[_0xa390('0x12')](_0xa390('0xf'),_0x940df7,_0x5b1998);_0x4d6ed7(_0x5b1998);});});}
\ No newline at end of file
+var _0xebf5=['AnalyticExtractedReport,\x20%s,\x20%s','request\x20sent','AnalyticExtractedReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','util','moment','bluebird','../../mysqldb','../../config/utils','../../config/logger','jayson/promise','client','http','request','then','info'];(function(_0x1551ed,_0x5cc3ce){var _0x499928=function(_0x41b8d5){while(--_0x41b8d5){_0x1551ed['push'](_0x1551ed['shift']());}};_0x499928(++_0x5cc3ce);}(_0xebf5,0x1ab));var _0x5ebf=function(_0x4f4b55,_0x31cbd6){_0x4f4b55=_0x4f4b55-0x0;var _0x36fbf9=_0xebf5[_0x4f4b55];return _0x36fbf9;};'use strict';var _=require(_0x5ebf('0x0'));var util=require(_0x5ebf('0x1'));var moment=require(_0x5ebf('0x2'));var BPromise=require(_0x5ebf('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x5ebf('0x4'))['db'];var utils=require(_0x5ebf('0x5'));var logger=require(_0x5ebf('0x6'))('rpc');var config=require('../../config/environment');var jayson=require(_0x5ebf('0x7'));var client=jayson[_0x5ebf('0x8')][_0x5ebf('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x199a95,_0x19b334,_0x5b7dbd){return new BPromise(function(_0xc63519,_0x2b6691){return client[_0x5ebf('0xa')](_0x199a95,_0x5b7dbd)[_0x5ebf('0xb')](function(_0x1dbb55){logger[_0x5ebf('0xc')](_0x5ebf('0xd'),_0x19b334,_0x5ebf('0xe'));logger['debug'](_0x5ebf('0xf'),_0x19b334,'request\x20sent',JSON[_0x5ebf('0x10')](_0x1dbb55));if(_0x1dbb55[_0x5ebf('0x11')]){if(_0x1dbb55[_0x5ebf('0x11')][_0x5ebf('0x12')]===0x1f4){logger[_0x5ebf('0x11')]('AnalyticExtractedReport,\x20%s,\x20%s',_0x19b334,_0x1dbb55[_0x5ebf('0x11')][_0x5ebf('0x13')]);return _0x2b6691(_0x1dbb55['error']['message']);}logger[_0x5ebf('0x11')](_0x5ebf('0xd'),_0x19b334,_0x1dbb55['error'][_0x5ebf('0x13')]);return _0xc63519(_0x1dbb55[_0x5ebf('0x11')][_0x5ebf('0x13')]);}else{logger[_0x5ebf('0xc')](_0x5ebf('0xd'),_0x19b334,'request\x20sent');_0xc63519(_0x1dbb55[_0x5ebf('0x14')][_0x5ebf('0x13')]);}})[_0x5ebf('0x15')](function(_0x394a13){logger[_0x5ebf('0x11')](_0x5ebf('0xd'),_0x19b334,_0x394a13);_0x2b6691(_0x394a13);});});}
\ No newline at end of file
diff --git a/server/api/analyticExtractedReport/index.js b/server/api/analyticExtractedReport/index.js
index f7b52cb..b8e509c 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 _0xb0c6=['destroy','multer','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../config/environment','./analyticExtractedReport.controller','get','isAuthenticated','/:id','show','/:id/download','download','post','create','put','update'];(function(_0x3a02d4,_0x26435a){var _0x43df59=function(_0x1ec9d2){while(--_0x1ec9d2){_0x3a02d4['push'](_0x3a02d4['shift']());}};_0x43df59(++_0x26435a);}(_0xb0c6,0x1b9));var _0x6b0c=function(_0xac88a1,_0x186ed9){_0xac88a1=_0xac88a1-0x0;var _0xa4db68=_0xb0c6[_0xac88a1];return _0xa4db68;};'use strict';var multer=require(_0x6b0c('0x0'));var util=require(_0x6b0c('0x1'));var path=require(_0x6b0c('0x2'));var timeout=require(_0x6b0c('0x3'));var express=require('express');var router=express[_0x6b0c('0x4')]();var fs_extra=require(_0x6b0c('0x5'));var auth=require(_0x6b0c('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0x6b0c('0x7'));var controller=require(_0x6b0c('0x8'));router[_0x6b0c('0x9')]('/',auth[_0x6b0c('0xa')](),controller['index']);router[_0x6b0c('0x9')](_0x6b0c('0xb'),auth['isAuthenticated'](),controller[_0x6b0c('0xc')]);router[_0x6b0c('0x9')](_0x6b0c('0xd'),auth['isAuthenticated'](),controller[_0x6b0c('0xe')]);router[_0x6b0c('0xf')]('/',auth[_0x6b0c('0xa')](),controller[_0x6b0c('0x10')]);router[_0x6b0c('0x11')](_0x6b0c('0xb'),auth[_0x6b0c('0xa')](),controller[_0x6b0c('0x12')]);router['delete']('/:id',auth[_0x6b0c('0xa')](),controller[_0x6b0c('0x13')]);module['exports']=router;
\ No newline at end of file
+var _0x8f15=['util','path','../../components/auth/service','../../components/interaction/service','../../config/environment','./analyticExtractedReport.controller','get','isAuthenticated','index','/:id','show','/:id/download','create','put','update','delete','destroy','exports'];(function(_0x43daa8,_0x2b964e){var _0x42a182=function(_0x16a94b){while(--_0x16a94b){_0x43daa8['push'](_0x43daa8['shift']());}};_0x42a182(++_0x2b964e);}(_0x8f15,0x1c2));var _0x58f1=function(_0x42cdc8,_0x3be788){_0x42cdc8=_0x42cdc8-0x0;var _0x50310e=_0x8f15[_0x42cdc8];return _0x50310e;};'use strict';var multer=require('multer');var util=require(_0x58f1('0x0'));var path=require(_0x58f1('0x1'));var timeout=require('connect-timeout');var express=require('express');var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0x58f1('0x2'));var interaction=require(_0x58f1('0x3'));var config=require(_0x58f1('0x4'));var controller=require(_0x58f1('0x5'));router[_0x58f1('0x6')]('/',auth[_0x58f1('0x7')](),controller[_0x58f1('0x8')]);router[_0x58f1('0x6')](_0x58f1('0x9'),auth[_0x58f1('0x7')](),controller[_0x58f1('0xa')]);router[_0x58f1('0x6')](_0x58f1('0xb'),auth[_0x58f1('0x7')](),controller['download']);router['post']('/',auth[_0x58f1('0x7')](),controller[_0x58f1('0xc')]);router[_0x58f1('0xd')](_0x58f1('0x9'),auth[_0x58f1('0x7')](),controller[_0x58f1('0xe')]);router[_0x58f1('0xf')](_0x58f1('0x9'),auth[_0x58f1('0x7')](),controller[_0x58f1('0x10')]);module[_0x58f1('0x11')]=router;
\ No newline at end of file
diff --git a/server/api/analyticFieldReport/analyticFieldReport.attributes.js b/server/api/analyticFieldReport/analyticFieldReport.attributes.js
index 612aebd..087adda 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 _0x242b=['exports','TEXT','STRING','BOOLEAN','sequelize'];(function(_0x36dfbd,_0x5bfe2d){var _0x4ecad9=function(_0x5230da){while(--_0x5230da){_0x36dfbd['push'](_0x36dfbd['shift']());}};_0x4ecad9(++_0x5bfe2d);}(_0x242b,0x15d));var _0xb242=function(_0xefa2d1,_0x4d98ad){_0xefa2d1=_0xefa2d1-0x0;var _0x23cf7f=_0x242b[_0xefa2d1];return _0x23cf7f;};'use strict';var Sequelize=require(_0xb242('0x0'));module[_0xb242('0x1')]={'field':{'type':Sequelize[_0xb242('0x2')]},'alias':{'type':Sequelize[_0xb242('0x3')]},'function':{'type':Sequelize[_0xb242('0x3')]},'format':{'type':Sequelize[_0xb242('0x3')]},'groupBy':{'type':Sequelize[_0xb242('0x4')],'defaultValue':![]},'orderBy':{'type':Sequelize[_0xb242('0x3')]},'custom':{'type':Sequelize[_0xb242('0x4')],'defaultValue':![]}};
\ No newline at end of file
+var _0xb7bd=['exports','STRING','BOOLEAN','sequelize'];(function(_0x28d019,_0x55d2c5){var _0x25d7f1=function(_0x2e4fd4){while(--_0x2e4fd4){_0x28d019['push'](_0x28d019['shift']());}};_0x25d7f1(++_0x55d2c5);}(_0xb7bd,0x7f));var _0xdb7b=function(_0x2641f9,_0x26715f){_0x2641f9=_0x2641f9-0x0;var _0x585741=_0xb7bd[_0x2641f9];return _0x585741;};'use strict';var Sequelize=require(_0xdb7b('0x0'));module[_0xdb7b('0x1')]={'field':{'type':Sequelize['TEXT']},'alias':{'type':Sequelize[_0xdb7b('0x2')]},'function':{'type':Sequelize[_0xdb7b('0x2')]},'format':{'type':Sequelize['STRING']},'groupBy':{'type':Sequelize[_0xdb7b('0x3')],'defaultValue':![]},'orderBy':{'type':Sequelize['STRING']},'custom':{'type':Sequelize[_0xdb7b('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 6192ab9..0314cec 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 _0xa859=['index','AnalyticFieldReport','fieldName','type','key','map','query','keys','filters','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','order','sort','pick','filter','where','merge','VIRTUAL','includeAll','include','catch','show','params','rawAttributes','create','bulkCreate','body','find','ids','AnalyticCustomReport','sequelize','transaction','CustomReportId','findAll','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','util','path','sox','to-csv','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','end','status','json','undefined','limit','offset','count','set','Content-Range','reject','save','update','then','destroy','error','name'];(function(_0x2b78ea,_0x1d4fab){var _0x58b952=function(_0x19ad21){while(--_0x19ad21){_0x2b78ea['push'](_0x2b78ea['shift']());}};_0x58b952(++_0x1d4fab);}(_0xa859,0x77));var _0x9a85=function(_0x4e6afa,_0x1ca110){_0x4e6afa=_0x4e6afa-0x0;var _0x2f6837=_0xa859[_0x4e6afa];return _0x2f6837;};'use strict';var emlformat=require(_0x9a85('0x0'));var rimraf=require(_0x9a85('0x1'));var zipdir=require(_0x9a85('0x2'));var jsonpatch=require(_0x9a85('0x3'));var rp=require(_0x9a85('0x4'));var moment=require('moment');var BPromise=require(_0x9a85('0x5'));var Mustache=require('mustache');var util=require(_0x9a85('0x6'));var path=require(_0x9a85('0x7'));var sox=require(_0x9a85('0x8'));var csv=require(_0x9a85('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0x9a85('0xa'));var crypto=require('crypto');var jsforce=require(_0x9a85('0xb'));var deskjs=require(_0x9a85('0xc'));var toCsv=require('to-csv');var querystring=require(_0x9a85('0xd'));var Papa=require(_0x9a85('0xe'));var Redis=require(_0x9a85('0xf'));var authService=require(_0x9a85('0x10'));var qs=require(_0x9a85('0x11'));var as=require(_0x9a85('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x9a85('0x13'))(_0x9a85('0x14'));var utils=require(_0x9a85('0x15'));var config=require('../../config/environment');var licenseUtil=require(_0x9a85('0x16'));var db=require(_0x9a85('0x17'))['db'];function respondWithStatusCode(_0x48a7c2,_0x5dded1){_0x5dded1=_0x5dded1||0xcc;return function(_0x262b0b){if(_0x262b0b){return _0x48a7c2[_0x9a85('0x18')](_0x5dded1);}return _0x48a7c2['status'](_0x5dded1)[_0x9a85('0x19')]();};}function respondWithResult(_0x188880,_0x2f5251){_0x2f5251=_0x2f5251||0xc8;return function(_0x303051){if(_0x303051){return _0x188880[_0x9a85('0x1a')](_0x2f5251)[_0x9a85('0x1b')](_0x303051);}};}function respondWithFilteredResult(_0x17c1ce,_0x56f554){return function(_0x178628){if(_0x178628){var _0x594a36=typeof _0x56f554['offset']===_0x9a85('0x1c')&&typeof _0x56f554[_0x9a85('0x1d')]===_0x9a85('0x1c');var _0x5b4a46=_0x178628['count'];var _0x772fdc=_0x594a36?0x0:_0x56f554[_0x9a85('0x1e')];var _0x46bc1d=_0x594a36?_0x178628[_0x9a85('0x1f')]:_0x56f554['offset']+_0x56f554[_0x9a85('0x1d')];var _0x359e3a;if(_0x46bc1d>=_0x5b4a46){_0x46bc1d=_0x5b4a46;_0x359e3a=0xc8;}else{_0x359e3a=0xce;}_0x17c1ce[_0x9a85('0x1a')](_0x359e3a);return _0x17c1ce[_0x9a85('0x20')](_0x9a85('0x21'),_0x772fdc+'-'+_0x46bc1d+'/'+_0x5b4a46)[_0x9a85('0x1b')](_0x178628);}return null;};}function patchUpdates(_0x505b25){return function(_0x11d763){try{jsonpatch['apply'](_0x11d763,_0x505b25,!![]);}catch(_0x18e337){return BPromise[_0x9a85('0x22')](_0x18e337);}return _0x11d763[_0x9a85('0x23')]();};}function saveUpdates(_0x3cadd1,_0x4150ac){return function(_0x2c521f){if(_0x2c521f){return _0x2c521f[_0x9a85('0x24')](_0x3cadd1)[_0x9a85('0x25')](function(_0x33e08b){return _0x33e08b;});}return null;};}function removeEntity(_0x4b3a89,_0x1b7ba2){return function(_0x267ae5){if(_0x267ae5){return _0x267ae5[_0x9a85('0x26')]()[_0x9a85('0x25')](function(){_0x4b3a89['status'](0xcc)[_0x9a85('0x19')]();});}};}function handleEntityNotFound(_0x3c99f0,_0x43fe3){return function(_0x56e900){if(!_0x56e900){_0x3c99f0[_0x9a85('0x18')](0x194);}return _0x56e900;};}function handleError(_0x3596ad,_0x3fd83b){_0x3fd83b=_0x3fd83b||0x1f4;return function(_0x536997){logger[_0x9a85('0x27')](_0x536997['stack']);if(_0x536997[_0x9a85('0x28')]){delete _0x536997[_0x9a85('0x28')];}_0x3596ad[_0x9a85('0x1a')](_0x3fd83b)['send'](_0x536997);};}exports[_0x9a85('0x29')]=function(_0x55a581,_0x3dd876){var _0x5308fb={},_0x990da4={},_0x27a538={'count':0x0,'rows':[]};var _0x5ba6fe=_['map'](db[_0x9a85('0x2a')]['rawAttributes'],function(_0x572c35){return{'name':_0x572c35[_0x9a85('0x2b')],'type':_0x572c35[_0x9a85('0x2c')][_0x9a85('0x2d')]};});_0x990da4['model']=_[_0x9a85('0x2e')](_0x5ba6fe,_0x9a85('0x28'));_0x990da4[_0x9a85('0x2f')]=_[_0x9a85('0x30')](_0x55a581['query']);_0x990da4[_0x9a85('0x31')]=_[_0x9a85('0x32')](_0x990da4[_0x9a85('0x33')],_0x990da4['query']);_0x5308fb[_0x9a85('0x34')]=_[_0x9a85('0x32')](_0x990da4[_0x9a85('0x33')],qs[_0x9a85('0x35')](_0x55a581[_0x9a85('0x2f')]['fields']));_0x5308fb[_0x9a85('0x34')]=_0x5308fb[_0x9a85('0x34')][_0x9a85('0x36')]?_0x5308fb[_0x9a85('0x34')]:_0x990da4[_0x9a85('0x33')];if(!_0x55a581['query'][_0x9a85('0x37')](_0x9a85('0x38'))){_0x5308fb['limit']=qs[_0x9a85('0x1d')](_0x55a581['query']['limit']);_0x5308fb[_0x9a85('0x1e')]=qs[_0x9a85('0x1e')](_0x55a581[_0x9a85('0x2f')][_0x9a85('0x1e')]);}_0x5308fb[_0x9a85('0x39')]=qs[_0x9a85('0x3a')](_0x55a581[_0x9a85('0x2f')][_0x9a85('0x3a')]);_0x5308fb['where']=qs[_0x9a85('0x31')](_[_0x9a85('0x3b')](_0x55a581[_0x9a85('0x2f')],_0x990da4[_0x9a85('0x31')]),_0x5ba6fe);if(_0x55a581['query'][_0x9a85('0x3c')]){_0x5308fb[_0x9a85('0x3d')]=_[_0x9a85('0x3e')](_0x5308fb[_0x9a85('0x3d')],{'$or':_['map'](_0x5ba6fe,function(_0x3c1089){if(_0x3c1089[_0x9a85('0x2c')]!==_0x9a85('0x3f')){var _0x17db8d={};_0x17db8d[_0x3c1089[_0x9a85('0x28')]]={'$like':'%'+_0x55a581['query'][_0x9a85('0x3c')]+'%'};return _0x17db8d;}})});}_0x5308fb=_[_0x9a85('0x3e')]({},_0x5308fb,_0x55a581['options']);var _0x16012f={'where':_0x5308fb[_0x9a85('0x3d')]};return db[_0x9a85('0x2a')]['count'](_0x16012f)[_0x9a85('0x25')](function(_0x5e2478){_0x27a538['count']=_0x5e2478;if(_0x55a581[_0x9a85('0x2f')][_0x9a85('0x40')]){_0x5308fb[_0x9a85('0x41')]=[{'all':!![]}];}return db[_0x9a85('0x2a')]['findAll'](_0x5308fb);})[_0x9a85('0x25')](function(_0x4a0bd1){_0x27a538['rows']=_0x4a0bd1;return _0x27a538;})[_0x9a85('0x25')](respondWithFilteredResult(_0x3dd876,_0x5308fb))[_0x9a85('0x42')](handleError(_0x3dd876,null));};exports[_0x9a85('0x43')]=function(_0x176fa7,_0xe492a5){var _0x356502={'raw':![],'where':{'id':_0x176fa7[_0x9a85('0x44')]['id']}},_0x28aa32={};_0x28aa32[_0x9a85('0x33')]=_[_0x9a85('0x30')](db[_0x9a85('0x2a')][_0x9a85('0x45')]);_0x28aa32[_0x9a85('0x2f')]=_[_0x9a85('0x30')](_0x176fa7['query']);_0x28aa32[_0x9a85('0x31')]=_[_0x9a85('0x32')](_0x28aa32[_0x9a85('0x33')],_0x28aa32['query']);_0x356502['attributes']=_[_0x9a85('0x32')](_0x28aa32[_0x9a85('0x33')],qs[_0x9a85('0x35')](_0x176fa7['query'][_0x9a85('0x35')]));_0x356502[_0x9a85('0x34')]=_0x356502[_0x9a85('0x34')][_0x9a85('0x36')]?_0x356502[_0x9a85('0x34')]:_0x28aa32['model'];if(_0x176fa7[_0x9a85('0x2f')][_0x9a85('0x40')]){_0x356502[_0x9a85('0x41')]=[{'all':!![]}];}_0x356502=_['merge']({},_0x356502,_0x176fa7['options']);return db[_0x9a85('0x2a')]['find'](_0x356502)[_0x9a85('0x25')](handleEntityNotFound(_0xe492a5,null))[_0x9a85('0x25')](respondWithResult(_0xe492a5,null))[_0x9a85('0x42')](handleError(_0xe492a5,null));};exports[_0x9a85('0x46')]=function(_0x30a31c,_0x469e3f){return db['AnalyticFieldReport']['create'](_0x30a31c['body'],{})['then'](respondWithResult(_0x469e3f,0xc9))[_0x9a85('0x42')](handleError(_0x469e3f,null));};exports[_0x9a85('0x47')]=function(_0xdc72ba,_0x217032){return db[_0x9a85('0x2a')][_0x9a85('0x47')](_0xdc72ba[_0x9a85('0x48')],{'raw':![],'individualHooks':!![]})[_0x9a85('0x25')](respondWithResult(_0x217032,0xc9))[_0x9a85('0x42')](handleError(_0x217032,null));};exports[_0x9a85('0x24')]=function(_0xefeb87,_0x9c357f){if(_0xefeb87['body']['id']){delete _0xefeb87['body']['id'];}return db['AnalyticFieldReport']['find']({'where':{'id':_0xefeb87[_0x9a85('0x44')]['id']}})['then'](handleEntityNotFound(_0x9c357f,null))['then'](saveUpdates(_0xefeb87['body'],null))['then'](respondWithResult(_0x9c357f,null))[_0x9a85('0x42')](handleError(_0x9c357f,null));};exports['destroy']=function(_0x542e5d,_0x20a0b0){return db[_0x9a85('0x2a')][_0x9a85('0x49')]({'where':{'id':_0x542e5d[_0x9a85('0x44')]['id']}})['then'](handleEntityNotFound(_0x20a0b0,null))['then'](removeEntity(_0x20a0b0,null))[_0x9a85('0x42')](handleError(_0x20a0b0,null));};exports['bulkDestroy']=function(_0x3cdbfe,_0x33fbda){return db[_0x9a85('0x2a')][_0x9a85('0x26')]({'where':{'id':_0x3cdbfe[_0x9a85('0x2f')][_0x9a85('0x4a')]||[]},'raw':![],'individualHooks':!![]})['then'](respondWithResult(_0x33fbda,0xcc))[_0x9a85('0x42')](handleError(_0x33fbda,null));};exports['addFields']=function(_0x1fc01d,_0x5dd369,_0x5d3441){return db[_0x9a85('0x4b')]['findOne']({'where':{'id':_0x1fc01d['params']['id']}})['then'](handleEntityNotFound(_0x5dd369,null))[_0x9a85('0x25')](function(_0x3c5038){if(_0x3c5038){return db[_0x9a85('0x4c')][_0x9a85('0x4d')](function(_0x28358a){return db[_0x9a85('0x2a')][_0x9a85('0x26')]({'where':{'CustomReportId':_0x1fc01d[_0x9a85('0x44')]['id']},'transaction':_0x28358a})['then'](function(_0x1db3f3){var _0x53e809=_[_0x9a85('0x2e')](_0x1fc01d[_0x9a85('0x48')],function(_0x52dfca){delete _0x52dfca['id'];_0x52dfca[_0x9a85('0x4e')]=_0x1fc01d[_0x9a85('0x44')]['id'];return _0x52dfca;});return db[_0x9a85('0x2a')]['bulkCreate'](_0x53e809,{'transaction':_0x28358a});});})[_0x9a85('0x25')](function(){return db['AnalyticFieldReport'][_0x9a85('0x4f')]({'where':{'CustomReportId':_0x1fc01d[_0x9a85('0x44')]['id']}});});}})[_0x9a85('0x25')](respondWithResult(_0x5dd369,null))[_0x9a85('0x42')](handleError(_0x5dd369,null));};
\ No newline at end of file
+var _0x948c=['attributes','fields','length','hasOwnProperty','nolimit','limit','sort','pick','filters','where','filter','includeAll','include','findAll','rows','catch','params','rawAttributes','intersection','merge','find','create','bulkCreate','body','bulkDestroy','ids','addFields','AnalyticCustomReport','transaction','CustomReportId','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','sendStatus','status','end','json','undefined','count','offset','Content-Range','apply','save','update','destroy','then','error','name','index','map','AnalyticFieldReport','type','key','model','query','keys'];(function(_0x1629b5,_0x5737cd){var _0x1b1b66=function(_0x4962fd){while(--_0x4962fd){_0x1629b5['push'](_0x1629b5['shift']());}};_0x1b1b66(++_0x5737cd);}(_0x948c,0x1b3));var _0xc948=function(_0x1d38e0,_0x23dcaf){_0x1d38e0=_0x1d38e0-0x0;var _0x26e31b=_0x948c[_0x1d38e0];return _0x26e31b;};'use strict';var emlformat=require(_0xc948('0x0'));var rimraf=require(_0xc948('0x1'));var zipdir=require(_0xc948('0x2'));var jsonpatch=require(_0xc948('0x3'));var rp=require('request-promise');var moment=require(_0xc948('0x4'));var BPromise=require(_0xc948('0x5'));var Mustache=require('mustache');var util=require(_0xc948('0x6'));var path=require(_0xc948('0x7'));var sox=require(_0xc948('0x8'));var csv=require(_0xc948('0x9'));var ejs=require(_0xc948('0xa'));var fs=require('fs');var fs_extra=require(_0xc948('0xb'));var _=require(_0xc948('0xc'));var squel=require(_0xc948('0xd'));var crypto=require(_0xc948('0xe'));var jsforce=require(_0xc948('0xf'));var deskjs=require(_0xc948('0x10'));var toCsv=require(_0xc948('0x9'));var querystring=require(_0xc948('0x11'));var Papa=require(_0xc948('0x12'));var Redis=require(_0xc948('0x13'));var authService=require(_0xc948('0x14'));var qs=require(_0xc948('0x15'));var as=require(_0xc948('0x16'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xc948('0x17'))(_0xc948('0x18'));var utils=require(_0xc948('0x19'));var config=require(_0xc948('0x1a'));var licenseUtil=require(_0xc948('0x1b'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0xfc3aa6,_0x2335fb){_0x2335fb=_0x2335fb||0xcc;return function(_0x2c8b73){if(_0x2c8b73){return _0xfc3aa6[_0xc948('0x1c')](_0x2335fb);}return _0xfc3aa6[_0xc948('0x1d')](_0x2335fb)[_0xc948('0x1e')]();};}function respondWithResult(_0x480469,_0x3246de){_0x3246de=_0x3246de||0xc8;return function(_0x597264){if(_0x597264){return _0x480469['status'](_0x3246de)[_0xc948('0x1f')](_0x597264);}};}function respondWithFilteredResult(_0x923d3f,_0x3a2042){return function(_0x1efbe5){if(_0x1efbe5){var _0x4a1060=typeof _0x3a2042['offset']===_0xc948('0x20')&&typeof _0x3a2042['limit']===_0xc948('0x20');var _0xbd0e21=_0x1efbe5[_0xc948('0x21')];var _0x5c35fb=_0x4a1060?0x0:_0x3a2042[_0xc948('0x22')];var _0x327ddc=_0x4a1060?_0x1efbe5['count']:_0x3a2042[_0xc948('0x22')]+_0x3a2042['limit'];var _0x599524;if(_0x327ddc>=_0xbd0e21){_0x327ddc=_0xbd0e21;_0x599524=0xc8;}else{_0x599524=0xce;}_0x923d3f[_0xc948('0x1d')](_0x599524);return _0x923d3f['set'](_0xc948('0x23'),_0x5c35fb+'-'+_0x327ddc+'/'+_0xbd0e21)['json'](_0x1efbe5);}return null;};}function patchUpdates(_0x535ec2){return function(_0x1f462d){try{jsonpatch[_0xc948('0x24')](_0x1f462d,_0x535ec2,!![]);}catch(_0x5ce436){return BPromise['reject'](_0x5ce436);}return _0x1f462d[_0xc948('0x25')]();};}function saveUpdates(_0x3849f1,_0x392c79){return function(_0x1c19e4){if(_0x1c19e4){return _0x1c19e4[_0xc948('0x26')](_0x3849f1)['then'](function(_0x594908){return _0x594908;});}return null;};}function removeEntity(_0x57720f,_0x56a849){return function(_0x129a7f){if(_0x129a7f){return _0x129a7f[_0xc948('0x27')]()[_0xc948('0x28')](function(){_0x57720f[_0xc948('0x1d')](0xcc)[_0xc948('0x1e')]();});}};}function handleEntityNotFound(_0x24d798,_0x16d3cd){return function(_0x1f043f){if(!_0x1f043f){_0x24d798[_0xc948('0x1c')](0x194);}return _0x1f043f;};}function handleError(_0x2c4b34,_0x13147b){_0x13147b=_0x13147b||0x1f4;return function(_0x2b9371){logger[_0xc948('0x29')](_0x2b9371['stack']);if(_0x2b9371['name']){delete _0x2b9371[_0xc948('0x2a')];}_0x2c4b34[_0xc948('0x1d')](_0x13147b)['send'](_0x2b9371);};}exports[_0xc948('0x2b')]=function(_0x402b3a,_0x4861be){var _0x177046={},_0x1f095f={},_0x28721a={'count':0x0,'rows':[]};var _0x57b06c=_[_0xc948('0x2c')](db[_0xc948('0x2d')]['rawAttributes'],function(_0x46e31c){return{'name':_0x46e31c['fieldName'],'type':_0x46e31c[_0xc948('0x2e')][_0xc948('0x2f')]};});_0x1f095f[_0xc948('0x30')]=_['map'](_0x57b06c,_0xc948('0x2a'));_0x1f095f[_0xc948('0x31')]=_[_0xc948('0x32')](_0x402b3a[_0xc948('0x31')]);_0x1f095f['filters']=_['intersection'](_0x1f095f['model'],_0x1f095f[_0xc948('0x31')]);_0x177046[_0xc948('0x33')]=_['intersection'](_0x1f095f[_0xc948('0x30')],qs[_0xc948('0x34')](_0x402b3a['query'][_0xc948('0x34')]));_0x177046[_0xc948('0x33')]=_0x177046[_0xc948('0x33')][_0xc948('0x35')]?_0x177046[_0xc948('0x33')]:_0x1f095f[_0xc948('0x30')];if(!_0x402b3a[_0xc948('0x31')][_0xc948('0x36')](_0xc948('0x37'))){_0x177046[_0xc948('0x38')]=qs[_0xc948('0x38')](_0x402b3a[_0xc948('0x31')]['limit']);_0x177046[_0xc948('0x22')]=qs[_0xc948('0x22')](_0x402b3a[_0xc948('0x31')][_0xc948('0x22')]);}_0x177046['order']=qs[_0xc948('0x39')](_0x402b3a[_0xc948('0x31')]['sort']);_0x177046['where']=qs['filters'](_[_0xc948('0x3a')](_0x402b3a[_0xc948('0x31')],_0x1f095f[_0xc948('0x3b')]),_0x57b06c);if(_0x402b3a[_0xc948('0x31')]['filter']){_0x177046[_0xc948('0x3c')]=_['merge'](_0x177046[_0xc948('0x3c')],{'$or':_['map'](_0x57b06c,function(_0x1bdca1){if(_0x1bdca1[_0xc948('0x2e')]!=='VIRTUAL'){var _0x476630={};_0x476630[_0x1bdca1[_0xc948('0x2a')]]={'$like':'%'+_0x402b3a['query'][_0xc948('0x3d')]+'%'};return _0x476630;}})});}_0x177046=_['merge']({},_0x177046,_0x402b3a['options']);var _0x38c532={'where':_0x177046['where']};return db[_0xc948('0x2d')][_0xc948('0x21')](_0x38c532)[_0xc948('0x28')](function(_0x54f3bb){_0x28721a[_0xc948('0x21')]=_0x54f3bb;if(_0x402b3a[_0xc948('0x31')][_0xc948('0x3e')]){_0x177046[_0xc948('0x3f')]=[{'all':!![]}];}return db['AnalyticFieldReport'][_0xc948('0x40')](_0x177046);})[_0xc948('0x28')](function(_0x9f68d){_0x28721a[_0xc948('0x41')]=_0x9f68d;return _0x28721a;})['then'](respondWithFilteredResult(_0x4861be,_0x177046))[_0xc948('0x42')](handleError(_0x4861be,null));};exports['show']=function(_0x2954ac,_0x3641c2){var _0x3fedeb={'raw':![],'where':{'id':_0x2954ac[_0xc948('0x43')]['id']}},_0x269a09={};_0x269a09['model']=_['keys'](db[_0xc948('0x2d')][_0xc948('0x44')]);_0x269a09['query']=_[_0xc948('0x32')](_0x2954ac[_0xc948('0x31')]);_0x269a09[_0xc948('0x3b')]=_[_0xc948('0x45')](_0x269a09['model'],_0x269a09['query']);_0x3fedeb[_0xc948('0x33')]=_[_0xc948('0x45')](_0x269a09[_0xc948('0x30')],qs[_0xc948('0x34')](_0x2954ac['query']['fields']));_0x3fedeb[_0xc948('0x33')]=_0x3fedeb[_0xc948('0x33')][_0xc948('0x35')]?_0x3fedeb['attributes']:_0x269a09[_0xc948('0x30')];if(_0x2954ac[_0xc948('0x31')][_0xc948('0x3e')]){_0x3fedeb['include']=[{'all':!![]}];}_0x3fedeb=_[_0xc948('0x46')]({},_0x3fedeb,_0x2954ac['options']);return db[_0xc948('0x2d')][_0xc948('0x47')](_0x3fedeb)[_0xc948('0x28')](handleEntityNotFound(_0x3641c2,null))['then'](respondWithResult(_0x3641c2,null))[_0xc948('0x42')](handleError(_0x3641c2,null));};exports[_0xc948('0x48')]=function(_0x546066,_0x50ebd2){return db[_0xc948('0x2d')][_0xc948('0x48')](_0x546066['body'],{})[_0xc948('0x28')](respondWithResult(_0x50ebd2,0xc9))['catch'](handleError(_0x50ebd2,null));};exports[_0xc948('0x49')]=function(_0x1fc483,_0x2f8c8f){return db[_0xc948('0x2d')][_0xc948('0x49')](_0x1fc483[_0xc948('0x4a')],{'raw':![],'individualHooks':!![]})['then'](respondWithResult(_0x2f8c8f,0xc9))[_0xc948('0x42')](handleError(_0x2f8c8f,null));};exports[_0xc948('0x26')]=function(_0x50e45c,_0x291c89){if(_0x50e45c[_0xc948('0x4a')]['id']){delete _0x50e45c[_0xc948('0x4a')]['id'];}return db[_0xc948('0x2d')]['find']({'where':{'id':_0x50e45c[_0xc948('0x43')]['id']}})[_0xc948('0x28')](handleEntityNotFound(_0x291c89,null))[_0xc948('0x28')](saveUpdates(_0x50e45c[_0xc948('0x4a')],null))[_0xc948('0x28')](respondWithResult(_0x291c89,null))[_0xc948('0x42')](handleError(_0x291c89,null));};exports['destroy']=function(_0x279e8c,_0x5c8d81){return db['AnalyticFieldReport'][_0xc948('0x47')]({'where':{'id':_0x279e8c['params']['id']}})[_0xc948('0x28')](handleEntityNotFound(_0x5c8d81,null))[_0xc948('0x28')](removeEntity(_0x5c8d81,null))[_0xc948('0x42')](handleError(_0x5c8d81,null));};exports[_0xc948('0x4b')]=function(_0x4157f7,_0x12249e){return db[_0xc948('0x2d')][_0xc948('0x27')]({'where':{'id':_0x4157f7[_0xc948('0x31')][_0xc948('0x4c')]||[]},'raw':![],'individualHooks':!![]})[_0xc948('0x28')](respondWithResult(_0x12249e,0xcc))[_0xc948('0x42')](handleError(_0x12249e,null));};exports[_0xc948('0x4d')]=function(_0x22ee9d,_0x525be8,_0x4c12b3){return db[_0xc948('0x4e')]['findOne']({'where':{'id':_0x22ee9d[_0xc948('0x43')]['id']}})[_0xc948('0x28')](handleEntityNotFound(_0x525be8,null))[_0xc948('0x28')](function(_0x3ec21d){if(_0x3ec21d){return db['sequelize'][_0xc948('0x4f')](function(_0x15d7d7){return db[_0xc948('0x2d')][_0xc948('0x27')]({'where':{'CustomReportId':_0x22ee9d[_0xc948('0x43')]['id']},'transaction':_0x15d7d7})[_0xc948('0x28')](function(_0x40dd19){var _0x450bc0=_[_0xc948('0x2c')](_0x22ee9d[_0xc948('0x4a')],function(_0x4bfe41){delete _0x4bfe41['id'];_0x4bfe41[_0xc948('0x50')]=_0x22ee9d[_0xc948('0x43')]['id'];return _0x4bfe41;});return db[_0xc948('0x2d')][_0xc948('0x49')](_0x450bc0,{'transaction':_0x15d7d7});});})[_0xc948('0x28')](function(){return db[_0xc948('0x2d')][_0xc948('0x40')]({'where':{'CustomReportId':_0x22ee9d[_0xc948('0x43')]['id']}});});}})['then'](respondWithResult(_0x525be8,null))[_0xc948('0x42')](handleError(_0x525be8,null));};
\ No newline at end of file
diff --git a/server/api/analyticFieldReport/analyticFieldReport.model.js b/server/api/analyticFieldReport/analyticFieldReport.model.js
index 601363c..f7a02d6 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 _0x4a3f=['request-promise','rimraf','./analyticFieldReport.attributes','define','analytics_report_fields','util','../../config/logger','api','bluebird'];(function(_0x50e7e0,_0x5affce){var _0x1a0307=function(_0x32d343){while(--_0x32d343){_0x50e7e0['push'](_0x50e7e0['shift']());}};_0x1a0307(++_0x5affce);}(_0x4a3f,0xb9));var _0xf4a3=function(_0x324f55,_0x2e6ca4){_0x324f55=_0x324f55-0x0;var _0x284952=_0x4a3f[_0x324f55];return _0x284952;};'use strict';var _=require('lodash');var util=require(_0xf4a3('0x0'));var logger=require(_0xf4a3('0x1'))(_0xf4a3('0x2'));var moment=require('moment');var BPromise=require(_0xf4a3('0x3'));var rp=require(_0xf4a3('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0xf4a3('0x5'));var config=require('../../config/environment');var attributes=require(_0xf4a3('0x6'));module['exports']=function(_0x32f3ea,_0x5beba2){return _0x32f3ea[_0xf4a3('0x7')]('AnalyticFieldReport',attributes,{'tableName':_0xf4a3('0x8'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x27d2=['path','rimraf','../../config/environment','./analyticFieldReport.attributes','exports','define','analytics_report_fields','lodash','util','../../config/logger','api','moment','bluebird','request-promise'];(function(_0x1a50a6,_0x400207){var _0x9cd101=function(_0x4abe53){while(--_0x4abe53){_0x1a50a6['push'](_0x1a50a6['shift']());}};_0x9cd101(++_0x400207);}(_0x27d2,0x1f1));var _0x227d=function(_0x5a89ae,_0x5e0327){_0x5a89ae=_0x5a89ae-0x0;var _0x59b56e=_0x27d2[_0x5a89ae];return _0x59b56e;};'use strict';var _=require(_0x227d('0x0'));var util=require(_0x227d('0x1'));var logger=require(_0x227d('0x2'))(_0x227d('0x3'));var moment=require(_0x227d('0x4'));var BPromise=require(_0x227d('0x5'));var rp=require(_0x227d('0x6'));var fs=require('fs');var path=require(_0x227d('0x7'));var rimraf=require(_0x227d('0x8'));var config=require(_0x227d('0x9'));var attributes=require(_0x227d('0xa'));module[_0x227d('0xb')]=function(_0x1aa534,_0x2eb807){return _0x1aa534[_0x227d('0xc')]('AnalyticFieldReport',attributes,{'tableName':_0x227d('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 bb6637f..b72860b 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 _0xcd64=['debug','AnalyticFieldReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','lodash','util','moment','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','AnalyticFieldReport,\x20%s,\x20%s','request\x20sent'];(function(_0x22e47a,_0x4ea10c){var _0x15a12a=function(_0x4a097f){while(--_0x4a097f){_0x22e47a['push'](_0x22e47a['shift']());}};_0x15a12a(++_0x4ea10c);}(_0xcd64,0x1d5));var _0x4cd6=function(_0xd8437c,_0x19cbe7){_0xd8437c=_0xd8437c-0x0;var _0x4f6cf9=_0xcd64[_0xd8437c];return _0x4f6cf9;};'use strict';var _=require(_0x4cd6('0x0'));var util=require(_0x4cd6('0x1'));var moment=require(_0x4cd6('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x4cd6('0x3'));var logger=require(_0x4cd6('0x4'))(_0x4cd6('0x5'));var config=require(_0x4cd6('0x6'));var jayson=require(_0x4cd6('0x7'));var client=jayson[_0x4cd6('0x8')][_0x4cd6('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x1694ee,_0x1e8c5c,_0x3bc5a5){return new BPromise(function(_0x39670e,_0x26dd3b){return client[_0x4cd6('0xa')](_0x1694ee,_0x3bc5a5)[_0x4cd6('0xb')](function(_0x482175){logger[_0x4cd6('0xc')](_0x4cd6('0xd'),_0x1e8c5c,_0x4cd6('0xe'));logger[_0x4cd6('0xf')](_0x4cd6('0x10'),_0x1e8c5c,_0x4cd6('0xe'),JSON[_0x4cd6('0x11')](_0x482175));if(_0x482175[_0x4cd6('0x12')]){if(_0x482175['error'][_0x4cd6('0x13')]===0x1f4){logger[_0x4cd6('0x12')]('AnalyticFieldReport,\x20%s,\x20%s',_0x1e8c5c,_0x482175[_0x4cd6('0x12')][_0x4cd6('0x14')]);return _0x26dd3b(_0x482175[_0x4cd6('0x12')][_0x4cd6('0x14')]);}logger[_0x4cd6('0x12')](_0x4cd6('0xd'),_0x1e8c5c,_0x482175[_0x4cd6('0x12')][_0x4cd6('0x14')]);return _0x39670e(_0x482175[_0x4cd6('0x12')][_0x4cd6('0x14')]);}else{logger['info'](_0x4cd6('0xd'),_0x1e8c5c,_0x4cd6('0xe'));_0x39670e(_0x482175['result'][_0x4cd6('0x14')]);}})[_0x4cd6('0x15')](function(_0x1db9fb){logger[_0x4cd6('0x12')]('AnalyticFieldReport,\x20%s,\x20%s',_0x1e8c5c,_0x1db9fb);_0x26dd3b(_0x1db9fb);});});}
\ No newline at end of file
+var _0x0c2f=['catch','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','AnalyticFieldReport,\x20%s,\x20%s','request\x20sent','AnalyticFieldReport,\x20%s,\x20%s,\x20%s','stringify','error','message','result'];(function(_0x5bb113,_0x3d681b){var _0x2018b7=function(_0x33d10d){while(--_0x33d10d){_0x5bb113['push'](_0x5bb113['shift']());}};_0x2018b7(++_0x3d681b);}(_0x0c2f,0x74));var _0xf0c2=function(_0x4c315a,_0x187fc3){_0x4c315a=_0x4c315a-0x0;var _0x2310d8=_0x0c2f[_0x4c315a];return _0x2310d8;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0xf0c2('0x0'));var BPromise=require(_0xf0c2('0x1'));var rs=require(_0xf0c2('0x2'));var fs=require('fs');var Redis=require(_0xf0c2('0x3'));var db=require(_0xf0c2('0x4'))['db'];var utils=require(_0xf0c2('0x5'));var logger=require(_0xf0c2('0x6'))(_0xf0c2('0x7'));var config=require(_0xf0c2('0x8'));var jayson=require(_0xf0c2('0x9'));var client=jayson[_0xf0c2('0xa')][_0xf0c2('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x424f1e,_0x14e981,_0x4f8658){return new BPromise(function(_0x272269,_0x46f966){return client[_0xf0c2('0xc')](_0x424f1e,_0x4f8658)[_0xf0c2('0xd')](function(_0x5d36eb){logger[_0xf0c2('0xe')](_0xf0c2('0xf'),_0x14e981,_0xf0c2('0x10'));logger['debug'](_0xf0c2('0x11'),_0x14e981,_0xf0c2('0x10'),JSON[_0xf0c2('0x12')](_0x5d36eb));if(_0x5d36eb['error']){if(_0x5d36eb[_0xf0c2('0x13')]['code']===0x1f4){logger['error']('AnalyticFieldReport,\x20%s,\x20%s',_0x14e981,_0x5d36eb[_0xf0c2('0x13')][_0xf0c2('0x14')]);return _0x46f966(_0x5d36eb[_0xf0c2('0x13')][_0xf0c2('0x14')]);}logger[_0xf0c2('0x13')](_0xf0c2('0xf'),_0x14e981,_0x5d36eb[_0xf0c2('0x13')][_0xf0c2('0x14')]);return _0x272269(_0x5d36eb[_0xf0c2('0x13')]['message']);}else{logger[_0xf0c2('0xe')]('AnalyticFieldReport,\x20%s,\x20%s',_0x14e981,_0xf0c2('0x10'));_0x272269(_0x5d36eb[_0xf0c2('0x15')][_0xf0c2('0x14')]);}})[_0xf0c2('0x16')](function(_0x4f8e9b){logger[_0xf0c2('0x13')]('AnalyticFieldReport,\x20%s,\x20%s',_0x14e981,_0x4f8e9b);_0x46f966(_0x4f8e9b);});});}
\ No newline at end of file
diff --git a/server/api/analyticFieldReport/index.js b/server/api/analyticFieldReport/index.js
index 66aff1f..0bbcef9 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(_0x2031ad,_0x3d1279){var _0x372bea=function(_0x176038){while(--_0x176038){_0x2031ad['push'](_0x2031ad['shift']());}};_0x372bea(++_0x3d1279);}(_0xa9e0,0x123));var _0x0a9e=function(_0x2160a9,_0x3cbd9e){_0x2160a9=_0x2160a9-0x0;var _0xa88cf7=_0xa9e0[_0x2160a9];return _0xa88cf7;};'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(_0x48dc48,_0xc7cd6d){var _0x30238b=function(_0x5d9dda){while(--_0x5d9dda){_0x48dc48['push'](_0x48dc48['shift']());}};_0x30238b(++_0xc7cd6d);}(_0xa9e0,0x123));var _0x0a9e=function(_0x2cfb58,_0x3d9412){_0x2cfb58=_0x2cfb58-0x0;var _0xd99951=_0xa9e0[_0x2cfb58];return _0xd99951;};'use strict';var multer=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var path=require(_0x0a9e('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0a9e('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x0a9e('0x4'));var interaction=require(_0x0a9e('0x5'));var config=require(_0x0a9e('0x6'));var controller=require(_0x0a9e('0x7'));router[_0x0a9e('0x8')]('/',auth['isAuthenticated'](),controller[_0x0a9e('0x9')]);router[_0x0a9e('0x8')](_0x0a9e('0xa'),auth['isAuthenticated'](),controller['show']);router[_0x0a9e('0xb')]('/',auth['isAuthenticated'](),controller['create']);router[_0x0a9e('0xb')](_0x0a9e('0xc'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0xe')]);router[_0x0a9e('0xb')](_0x0a9e('0xf'),auth['isAuthenticated'](),controller['addFields']);router['put']('/:id',auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x10')]);router[_0x0a9e('0x11')](_0x0a9e('0x12'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x13')]);router['delete'](_0x0a9e('0xa'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x14')]);module[_0x0a9e('0x15')]=router;
\ No newline at end of file
diff --git a/server/api/analyticMetric/analyticMetric.attributes.js b/server/api/analyticMetric/analyticMetric.attributes.js
index 9904722..aa56205 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 _0xd957=['exports','name','STRING','sequelize'];(function(_0x1a137e,_0x2b6ef7){var _0x340dee=function(_0x242bb9){while(--_0x242bb9){_0x1a137e['push'](_0x1a137e['shift']());}};_0x340dee(++_0x2b6ef7);}(_0xd957,0x153));var _0x7d95=function(_0xa464c9,_0x7c86d8){_0xa464c9=_0xa464c9-0x0;var _0x3d73c4=_0xd957[_0xa464c9];return _0x3d73c4;};'use strict';var Sequelize=require(_0x7d95('0x0'));module[_0x7d95('0x1')]={'name':{'type':Sequelize['STRING'],'allowNull':![],'unique':_0x7d95('0x2')},'table':{'type':Sequelize[_0x7d95('0x3')]},'metric':{'type':Sequelize['TEXT']},'description':{'type':Sequelize[_0x7d95('0x3')]}};
\ No newline at end of file
+var _0xc584=['exports','STRING','TEXT'];(function(_0x2c91e9,_0x2fb965){var _0x13f0ff=function(_0xb39edf){while(--_0xb39edf){_0x2c91e9['push'](_0x2c91e9['shift']());}};_0x13f0ff(++_0x2fb965);}(_0xc584,0xa8));var _0x4c58=function(_0xee37f1,_0x189f43){_0xee37f1=_0xee37f1-0x0;var _0x37fd54=_0xc584[_0xee37f1];return _0x37fd54;};'use strict';var Sequelize=require('sequelize');module[_0x4c58('0x0')]={'name':{'type':Sequelize[_0x4c58('0x1')],'allowNull':![],'unique':'name'},'table':{'type':Sequelize['STRING']},'metric':{'type':Sequelize[_0x4c58('0x2')]},'description':{'type':Sequelize['STRING']}};
\ No newline at end of file
diff --git a/server/api/analyticMetric/analyticMetric.controller.js b/server/api/analyticMetric/analyticMetric.controller.js
index f52c103..699cb00 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 _0xabce=['includeAll','rows','show','params','intersection','length','include','find','catch','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','mustache','util','path','ejs','lodash','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','end','json','limit','count','offset','Content-Range','apply','reject','save','update','then','get','Metrics','UserProfileResource','destroy','error','stack','name','send','index','map','AnalyticMetric','rawAttributes','fieldName','type','model','keys','query','filters','attributes','fields','hasOwnProperty','nolimit','order','filter','merge','VIRTUAL','options'];(function(_0x53bdde,_0x1630a6){var _0x580e87=function(_0x23793e){while(--_0x23793e){_0x53bdde['push'](_0x53bdde['shift']());}};_0x580e87(++_0x1630a6);}(_0xabce,0x103));var _0xeabc=function(_0x2bf141,_0x31eac7){_0x2bf141=_0x2bf141-0x0;var _0x48277b=_0xabce[_0x2bf141];return _0x48277b;};'use strict';var emlformat=require(_0xeabc('0x0'));var rimraf=require(_0xeabc('0x1'));var zipdir=require(_0xeabc('0x2'));var jsonpatch=require(_0xeabc('0x3'));var rp=require(_0xeabc('0x4'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0xeabc('0x5'));var util=require(_0xeabc('0x6'));var path=require(_0xeabc('0x7'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0xeabc('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xeabc('0x9'));var squel=require('squel');var crypto=require(_0xeabc('0xa'));var jsforce=require(_0xeabc('0xb'));var deskjs=require(_0xeabc('0xc'));var toCsv=require('to-csv');var querystring=require(_0xeabc('0xd'));var Papa=require(_0xeabc('0xe'));var Redis=require(_0xeabc('0xf'));var authService=require(_0xeabc('0x10'));var qs=require(_0xeabc('0x11'));var as=require(_0xeabc('0x12'));var hardwareService=require(_0xeabc('0x13'));var logger=require(_0xeabc('0x14'))(_0xeabc('0x15'));var utils=require(_0xeabc('0x16'));var config=require(_0xeabc('0x17'));var licenseUtil=require(_0xeabc('0x18'));var db=require(_0xeabc('0x19'))['db'];function respondWithStatusCode(_0x3fd0b5,_0x36a92e){_0x36a92e=_0x36a92e||0xcc;return function(_0xcfbf06){if(_0xcfbf06){return _0x3fd0b5['sendStatus'](_0x36a92e);}return _0x3fd0b5[_0xeabc('0x1a')](_0x36a92e)[_0xeabc('0x1b')]();};}function respondWithResult(_0x3251c6,_0x55f0de){_0x55f0de=_0x55f0de||0xc8;return function(_0x5f4ee8){if(_0x5f4ee8){return _0x3251c6[_0xeabc('0x1a')](_0x55f0de)[_0xeabc('0x1c')](_0x5f4ee8);}};}function respondWithFilteredResult(_0x326bac,_0x53d5cb){return function(_0xf913d7){if(_0xf913d7){var _0x638976=typeof _0x53d5cb['offset']==='undefined'&&typeof _0x53d5cb[_0xeabc('0x1d')]==='undefined';var _0x3d0e21=_0xf913d7[_0xeabc('0x1e')];var _0x58a3c0=_0x638976?0x0:_0x53d5cb[_0xeabc('0x1f')];var _0x31dd53=_0x638976?_0xf913d7[_0xeabc('0x1e')]:_0x53d5cb[_0xeabc('0x1f')]+_0x53d5cb[_0xeabc('0x1d')];var _0x5d92e5;if(_0x31dd53>=_0x3d0e21){_0x31dd53=_0x3d0e21;_0x5d92e5=0xc8;}else{_0x5d92e5=0xce;}_0x326bac[_0xeabc('0x1a')](_0x5d92e5);return _0x326bac['set'](_0xeabc('0x20'),_0x58a3c0+'-'+_0x31dd53+'/'+_0x3d0e21)[_0xeabc('0x1c')](_0xf913d7);}return null;};}function patchUpdates(_0x502947){return function(_0x28063a){try{jsonpatch[_0xeabc('0x21')](_0x28063a,_0x502947,!![]);}catch(_0x254590){return BPromise[_0xeabc('0x22')](_0x254590);}return _0x28063a[_0xeabc('0x23')]();};}function saveUpdates(_0x4e99a4,_0xecdbf){return function(_0x10c675){if(_0x10c675){return _0x10c675[_0xeabc('0x24')](_0x4e99a4)['then'](function(_0x457f27){return _0x457f27;});}return null;};}function removeEntity(_0x3854d2,_0x214953){return function(_0x319119){if(_0x319119){return _0x319119['destroy']()[_0xeabc('0x25')](function(){var _0x480440=_0x319119[_0xeabc('0x26')]({'plain':!![]});var _0x4d4e29=_0xeabc('0x27');return db[_0xeabc('0x28')][_0xeabc('0x29')]({'where':{'type':_0x4d4e29,'resourceId':_0x480440['id']}})[_0xeabc('0x25')](function(){return _0x319119;});})[_0xeabc('0x25')](function(){_0x3854d2[_0xeabc('0x1a')](0xcc)[_0xeabc('0x1b')]();});}};}function handleEntityNotFound(_0x4c2693,_0x5b2934){return function(_0x459c8a){if(!_0x459c8a){_0x4c2693['sendStatus'](0x194);}return _0x459c8a;};}function handleError(_0x3c1b5b,_0x2b342c){_0x2b342c=_0x2b342c||0x1f4;return function(_0x48fb52){logger[_0xeabc('0x2a')](_0x48fb52[_0xeabc('0x2b')]);if(_0x48fb52[_0xeabc('0x2c')]){delete _0x48fb52[_0xeabc('0x2c')];}_0x3c1b5b[_0xeabc('0x1a')](_0x2b342c)[_0xeabc('0x2d')](_0x48fb52);};}exports[_0xeabc('0x2e')]=function(_0x38dc0a,_0x2915c1){var _0x5ebb86={},_0x5b34dd={},_0x5bb1f1={'count':0x0,'rows':[]};var _0x2f03e8=_[_0xeabc('0x2f')](db[_0xeabc('0x30')][_0xeabc('0x31')],function(_0x73c8d4){return{'name':_0x73c8d4[_0xeabc('0x32')],'type':_0x73c8d4[_0xeabc('0x33')]['key']};});_0x5b34dd[_0xeabc('0x34')]=_[_0xeabc('0x2f')](_0x2f03e8,_0xeabc('0x2c'));_0x5b34dd['query']=_[_0xeabc('0x35')](_0x38dc0a[_0xeabc('0x36')]);_0x5b34dd[_0xeabc('0x37')]=_['intersection'](_0x5b34dd[_0xeabc('0x34')],_0x5b34dd[_0xeabc('0x36')]);_0x5ebb86[_0xeabc('0x38')]=_['intersection'](_0x5b34dd[_0xeabc('0x34')],qs[_0xeabc('0x39')](_0x38dc0a['query']['fields']));_0x5ebb86[_0xeabc('0x38')]=_0x5ebb86[_0xeabc('0x38')]['length']?_0x5ebb86[_0xeabc('0x38')]:_0x5b34dd[_0xeabc('0x34')];if(!_0x38dc0a[_0xeabc('0x36')][_0xeabc('0x3a')](_0xeabc('0x3b'))){_0x5ebb86['limit']=qs[_0xeabc('0x1d')](_0x38dc0a['query'][_0xeabc('0x1d')]);_0x5ebb86[_0xeabc('0x1f')]=qs[_0xeabc('0x1f')](_0x38dc0a['query']['offset']);}_0x5ebb86[_0xeabc('0x3c')]=qs['sort'](_0x38dc0a[_0xeabc('0x36')]['sort']);_0x5ebb86['where']=qs['filters'](_['pick'](_0x38dc0a[_0xeabc('0x36')],_0x5b34dd['filters']),_0x2f03e8);if(_0x38dc0a[_0xeabc('0x36')][_0xeabc('0x3d')]){_0x5ebb86['where']=_[_0xeabc('0x3e')](_0x5ebb86['where'],{'$or':_[_0xeabc('0x2f')](_0x2f03e8,function(_0x58aafe){if(_0x58aafe[_0xeabc('0x33')]!==_0xeabc('0x3f')){var _0xeeef02={};_0xeeef02[_0x58aafe['name']]={'$like':'%'+_0x38dc0a['query']['filter']+'%'};return _0xeeef02;}})});}_0x5ebb86=_[_0xeabc('0x3e')]({},_0x5ebb86,_0x38dc0a[_0xeabc('0x40')]);var _0xafa59b={'where':_0x5ebb86['where']};return db['AnalyticMetric'][_0xeabc('0x1e')](_0xafa59b)[_0xeabc('0x25')](function(_0x5e9cb3){_0x5bb1f1[_0xeabc('0x1e')]=_0x5e9cb3;if(_0x38dc0a['query'][_0xeabc('0x41')]){_0x5ebb86['include']=[{'all':!![]}];}return db['AnalyticMetric']['findAll'](_0x5ebb86);})[_0xeabc('0x25')](function(_0x37c926){_0x5bb1f1[_0xeabc('0x42')]=_0x37c926;return _0x5bb1f1;})[_0xeabc('0x25')](respondWithFilteredResult(_0x2915c1,_0x5ebb86))['catch'](handleError(_0x2915c1,null));};exports[_0xeabc('0x43')]=function(_0x555d26,_0x7d5add){var _0x1a4bbe={'raw':!![],'where':{'id':_0x555d26[_0xeabc('0x44')]['id']}},_0x3a7807={};_0x3a7807[_0xeabc('0x34')]=_['keys'](db['AnalyticMetric'][_0xeabc('0x31')]);_0x3a7807['query']=_[_0xeabc('0x35')](_0x555d26[_0xeabc('0x36')]);_0x3a7807['filters']=_[_0xeabc('0x45')](_0x3a7807[_0xeabc('0x34')],_0x3a7807[_0xeabc('0x36')]);_0x1a4bbe[_0xeabc('0x38')]=_[_0xeabc('0x45')](_0x3a7807[_0xeabc('0x34')],qs[_0xeabc('0x39')](_0x555d26['query'][_0xeabc('0x39')]));_0x1a4bbe[_0xeabc('0x38')]=_0x1a4bbe[_0xeabc('0x38')][_0xeabc('0x46')]?_0x1a4bbe[_0xeabc('0x38')]:_0x3a7807[_0xeabc('0x34')];if(_0x555d26[_0xeabc('0x36')][_0xeabc('0x41')]){_0x1a4bbe[_0xeabc('0x47')]=[{'all':!![]}];}_0x1a4bbe=_[_0xeabc('0x3e')]({},_0x1a4bbe,_0x555d26['options']);return db[_0xeabc('0x30')][_0xeabc('0x48')](_0x1a4bbe)[_0xeabc('0x25')](handleEntityNotFound(_0x7d5add,null))[_0xeabc('0x25')](respondWithResult(_0x7d5add,null))[_0xeabc('0x49')](handleError(_0x7d5add,null));};exports[_0xeabc('0x4a')]=function(_0x268d95,_0x48df43){return db[_0xeabc('0x30')][_0xeabc('0x4a')](_0x268d95[_0xeabc('0x4b')],{})[_0xeabc('0x25')](function(_0x47440e){var _0x58e2c1=_0x268d95[_0xeabc('0x4c')][_0xeabc('0x26')]({'plain':!![]});if(!_0x58e2c1)throw new Error(_0xeabc('0x4d'));if(_0x58e2c1[_0xeabc('0x4e')]==='user'){var _0x400b82=_0x47440e[_0xeabc('0x26')]({'plain':!![]});var _0x568847=_0xeabc('0x27');return db['UserProfileSection'][_0xeabc('0x48')]({'where':{'name':_0x568847,'userProfileId':_0x58e2c1['userProfileId']},'raw':!![]})[_0xeabc('0x25')](function(_0x2ec94c){if(_0x2ec94c&&_0x2ec94c[_0xeabc('0x4f')]===0x0){return db[_0xeabc('0x28')][_0xeabc('0x4a')]({'name':_0x400b82[_0xeabc('0x2c')],'resourceId':_0x400b82['id'],'type':_0x2ec94c[_0xeabc('0x2c')],'sectionId':_0x2ec94c['id']},{})[_0xeabc('0x25')](function(){return _0x47440e;});}else{return _0x47440e;}})[_0xeabc('0x49')](function(_0x6423f3){logger['error'](_0xeabc('0x50'),_0x6423f3);throw _0x6423f3;});}return _0x47440e;})[_0xeabc('0x25')](respondWithResult(_0x48df43,0xc9))[_0xeabc('0x49')](handleError(_0x48df43,null));};exports[_0xeabc('0x24')]=function(_0x555d6b,_0x1cef45){if(_0x555d6b[_0xeabc('0x4b')]['id']){delete _0x555d6b[_0xeabc('0x4b')]['id'];}return db[_0xeabc('0x30')]['find']({'where':{'id':_0x555d6b[_0xeabc('0x44')]['id']}})[_0xeabc('0x25')](handleEntityNotFound(_0x1cef45,null))[_0xeabc('0x25')](saveUpdates(_0x555d6b[_0xeabc('0x4b')],null))[_0xeabc('0x25')](respondWithResult(_0x1cef45,null))[_0xeabc('0x49')](handleError(_0x1cef45,null));};exports[_0xeabc('0x29')]=function(_0x3ff38c,_0x17acf8){return db['AnalyticMetric'][_0xeabc('0x48')]({'where':{'id':_0x3ff38c['params']['id']}})['then'](handleEntityNotFound(_0x17acf8,null))['then'](removeEntity(_0x17acf8,null))[_0xeabc('0x49')](handleError(_0x17acf8,null));};
\ No newline at end of file
+var _0x98a8=['../../mysqldb','end','status','json','undefined','count','offset','apply','reject','save','update','then','destroy','get','UserProfileResource','sendStatus','name','send','index','map','AnalyticMetric','fieldName','type','key','model','query','keys','intersection','attributes','fields','nolimit','limit','order','sort','where','filters','merge','VIRTUAL','options','includeAll','include','findAll','rows','catch','params','length','find','create','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','Metrics','UserProfileSection','autoAssociation','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','sox','to-csv','ejs','lodash','crypto','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/environment'];(function(_0xccfade,_0x38a817){var _0x5f2832=function(_0x292639){while(--_0x292639){_0xccfade['push'](_0xccfade['shift']());}};_0x5f2832(++_0x38a817);}(_0x98a8,0x12c));var _0x898a=function(_0x47e206,_0x4fece5){_0x47e206=_0x47e206-0x0;var _0x277770=_0x98a8[_0x47e206];return _0x277770;};'use strict';var emlformat=require(_0x898a('0x0'));var rimraf=require(_0x898a('0x1'));var zipdir=require(_0x898a('0x2'));var jsonpatch=require(_0x898a('0x3'));var rp=require(_0x898a('0x4'));var moment=require(_0x898a('0x5'));var BPromise=require(_0x898a('0x6'));var Mustache=require('mustache');var util=require(_0x898a('0x7'));var path=require(_0x898a('0x8'));var sox=require(_0x898a('0x9'));var csv=require(_0x898a('0xa'));var ejs=require(_0x898a('0xb'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x898a('0xc'));var squel=require('squel');var crypto=require(_0x898a('0xd'));var jsforce=require('jsforce');var deskjs=require(_0x898a('0xe'));var toCsv=require(_0x898a('0xa'));var querystring=require(_0x898a('0xf'));var Papa=require(_0x898a('0x10'));var Redis=require(_0x898a('0x11'));var authService=require(_0x898a('0x12'));var qs=require(_0x898a('0x13'));var as=require(_0x898a('0x14'));var hardwareService=require(_0x898a('0x15'));var logger=require('../../config/logger')(_0x898a('0x16'));var utils=require('../../config/utils');var config=require(_0x898a('0x17'));var licenseUtil=require('../../config/license/util');var db=require(_0x898a('0x18'))['db'];function respondWithStatusCode(_0x2c76b7,_0x364a23){_0x364a23=_0x364a23||0xcc;return function(_0x5f5e06){if(_0x5f5e06){return _0x2c76b7['sendStatus'](_0x364a23);}return _0x2c76b7['status'](_0x364a23)[_0x898a('0x19')]();};}function respondWithResult(_0x1f5be4,_0xb24335){_0xb24335=_0xb24335||0xc8;return function(_0x116fbe){if(_0x116fbe){return _0x1f5be4[_0x898a('0x1a')](_0xb24335)[_0x898a('0x1b')](_0x116fbe);}};}function respondWithFilteredResult(_0x506023,_0x47033c){return function(_0x53a4b8){if(_0x53a4b8){var _0x3fec7a=typeof _0x47033c['offset']===_0x898a('0x1c')&&typeof _0x47033c['limit']===_0x898a('0x1c');var _0x56f8f9=_0x53a4b8[_0x898a('0x1d')];var _0x3197f7=_0x3fec7a?0x0:_0x47033c[_0x898a('0x1e')];var _0x4ddd4d=_0x3fec7a?_0x53a4b8[_0x898a('0x1d')]:_0x47033c['offset']+_0x47033c['limit'];var _0x3f8af4;if(_0x4ddd4d>=_0x56f8f9){_0x4ddd4d=_0x56f8f9;_0x3f8af4=0xc8;}else{_0x3f8af4=0xce;}_0x506023[_0x898a('0x1a')](_0x3f8af4);return _0x506023['set']('Content-Range',_0x3197f7+'-'+_0x4ddd4d+'/'+_0x56f8f9)[_0x898a('0x1b')](_0x53a4b8);}return null;};}function patchUpdates(_0x26449a){return function(_0x38a8f0){try{jsonpatch[_0x898a('0x1f')](_0x38a8f0,_0x26449a,!![]);}catch(_0x2da52d){return BPromise[_0x898a('0x20')](_0x2da52d);}return _0x38a8f0[_0x898a('0x21')]();};}function saveUpdates(_0x483212,_0x247cfc){return function(_0x50718e){if(_0x50718e){return _0x50718e[_0x898a('0x22')](_0x483212)[_0x898a('0x23')](function(_0x30495a){return _0x30495a;});}return null;};}function removeEntity(_0x310bfa,_0x4e254d){return function(_0x274cdf){if(_0x274cdf){return _0x274cdf[_0x898a('0x24')]()[_0x898a('0x23')](function(){var _0x32eca5=_0x274cdf[_0x898a('0x25')]({'plain':!![]});var _0x1426e3='Metrics';return db[_0x898a('0x26')]['destroy']({'where':{'type':_0x1426e3,'resourceId':_0x32eca5['id']}})['then'](function(){return _0x274cdf;});})['then'](function(){_0x310bfa[_0x898a('0x1a')](0xcc)[_0x898a('0x19')]();});}};}function handleEntityNotFound(_0x420b25,_0x40b3db){return function(_0x28ae6a){if(!_0x28ae6a){_0x420b25[_0x898a('0x27')](0x194);}return _0x28ae6a;};}function handleError(_0x398e98,_0xac1fc4){_0xac1fc4=_0xac1fc4||0x1f4;return function(_0xd31922){logger['error'](_0xd31922['stack']);if(_0xd31922['name']){delete _0xd31922[_0x898a('0x28')];}_0x398e98[_0x898a('0x1a')](_0xac1fc4)[_0x898a('0x29')](_0xd31922);};}exports[_0x898a('0x2a')]=function(_0x34f447,_0x560000){var _0xe3c983={},_0xf74645={},_0x18773a={'count':0x0,'rows':[]};var _0x4287da=_[_0x898a('0x2b')](db[_0x898a('0x2c')]['rawAttributes'],function(_0x7a1eb5){return{'name':_0x7a1eb5[_0x898a('0x2d')],'type':_0x7a1eb5[_0x898a('0x2e')][_0x898a('0x2f')]};});_0xf74645[_0x898a('0x30')]=_['map'](_0x4287da,'name');_0xf74645[_0x898a('0x31')]=_[_0x898a('0x32')](_0x34f447[_0x898a('0x31')]);_0xf74645['filters']=_[_0x898a('0x33')](_0xf74645[_0x898a('0x30')],_0xf74645[_0x898a('0x31')]);_0xe3c983[_0x898a('0x34')]=_[_0x898a('0x33')](_0xf74645[_0x898a('0x30')],qs[_0x898a('0x35')](_0x34f447[_0x898a('0x31')]['fields']));_0xe3c983[_0x898a('0x34')]=_0xe3c983['attributes']['length']?_0xe3c983[_0x898a('0x34')]:_0xf74645['model'];if(!_0x34f447[_0x898a('0x31')]['hasOwnProperty'](_0x898a('0x36'))){_0xe3c983['limit']=qs[_0x898a('0x37')](_0x34f447[_0x898a('0x31')][_0x898a('0x37')]);_0xe3c983['offset']=qs['offset'](_0x34f447['query'][_0x898a('0x1e')]);}_0xe3c983[_0x898a('0x38')]=qs['sort'](_0x34f447[_0x898a('0x31')][_0x898a('0x39')]);_0xe3c983[_0x898a('0x3a')]=qs[_0x898a('0x3b')](_['pick'](_0x34f447['query'],_0xf74645[_0x898a('0x3b')]),_0x4287da);if(_0x34f447[_0x898a('0x31')]['filter']){_0xe3c983['where']=_[_0x898a('0x3c')](_0xe3c983[_0x898a('0x3a')],{'$or':_[_0x898a('0x2b')](_0x4287da,function(_0xa45405){if(_0xa45405['type']!==_0x898a('0x3d')){var _0x369c02={};_0x369c02[_0xa45405['name']]={'$like':'%'+_0x34f447['query']['filter']+'%'};return _0x369c02;}})});}_0xe3c983=_[_0x898a('0x3c')]({},_0xe3c983,_0x34f447[_0x898a('0x3e')]);var _0x35d767={'where':_0xe3c983[_0x898a('0x3a')]};return db[_0x898a('0x2c')][_0x898a('0x1d')](_0x35d767)[_0x898a('0x23')](function(_0x1432ec){_0x18773a[_0x898a('0x1d')]=_0x1432ec;if(_0x34f447[_0x898a('0x31')][_0x898a('0x3f')]){_0xe3c983[_0x898a('0x40')]=[{'all':!![]}];}return db[_0x898a('0x2c')][_0x898a('0x41')](_0xe3c983);})[_0x898a('0x23')](function(_0x4c8628){_0x18773a[_0x898a('0x42')]=_0x4c8628;return _0x18773a;})[_0x898a('0x23')](respondWithFilteredResult(_0x560000,_0xe3c983))[_0x898a('0x43')](handleError(_0x560000,null));};exports['show']=function(_0x34029e,_0x2e5451){var _0x3a8663={'raw':!![],'where':{'id':_0x34029e[_0x898a('0x44')]['id']}},_0x6ab441={};_0x6ab441[_0x898a('0x30')]=_[_0x898a('0x32')](db[_0x898a('0x2c')]['rawAttributes']);_0x6ab441[_0x898a('0x31')]=_[_0x898a('0x32')](_0x34029e[_0x898a('0x31')]);_0x6ab441[_0x898a('0x3b')]=_['intersection'](_0x6ab441[_0x898a('0x30')],_0x6ab441[_0x898a('0x31')]);_0x3a8663['attributes']=_[_0x898a('0x33')](_0x6ab441['model'],qs[_0x898a('0x35')](_0x34029e['query']['fields']));_0x3a8663[_0x898a('0x34')]=_0x3a8663['attributes'][_0x898a('0x45')]?_0x3a8663[_0x898a('0x34')]:_0x6ab441['model'];if(_0x34029e[_0x898a('0x31')][_0x898a('0x3f')]){_0x3a8663['include']=[{'all':!![]}];}_0x3a8663=_[_0x898a('0x3c')]({},_0x3a8663,_0x34029e[_0x898a('0x3e')]);return db[_0x898a('0x2c')][_0x898a('0x46')](_0x3a8663)['then'](handleEntityNotFound(_0x2e5451,null))[_0x898a('0x23')](respondWithResult(_0x2e5451,null))[_0x898a('0x43')](handleError(_0x2e5451,null));};exports['create']=function(_0x25adcc,_0x1d8c16){return db['AnalyticMetric'][_0x898a('0x47')](_0x25adcc['body'],{})[_0x898a('0x23')](function(_0x41f291){var _0x32ccb9=_0x25adcc['user'][_0x898a('0x25')]({'plain':!![]});if(!_0x32ccb9)throw new Error(_0x898a('0x48'));if(_0x32ccb9[_0x898a('0x49')]===_0x898a('0x4a')){var _0x5a8a2c=_0x41f291[_0x898a('0x25')]({'plain':!![]});var _0x529d7c=_0x898a('0x4b');return db[_0x898a('0x4c')][_0x898a('0x46')]({'where':{'name':_0x529d7c,'userProfileId':_0x32ccb9['userProfileId']},'raw':!![]})[_0x898a('0x23')](function(_0x3c4db0){if(_0x3c4db0&&_0x3c4db0[_0x898a('0x4d')]===0x0){return db['UserProfileResource']['create']({'name':_0x5a8a2c[_0x898a('0x28')],'resourceId':_0x5a8a2c['id'],'type':_0x3c4db0[_0x898a('0x28')],'sectionId':_0x3c4db0['id']},{})[_0x898a('0x23')](function(){return _0x41f291;});}else{return _0x41f291;}})[_0x898a('0x43')](function(_0x28b8c9){logger[_0x898a('0x4e')](_0x898a('0x4f'),_0x28b8c9);throw _0x28b8c9;});}return _0x41f291;})[_0x898a('0x23')](respondWithResult(_0x1d8c16,0xc9))[_0x898a('0x43')](handleError(_0x1d8c16,null));};exports[_0x898a('0x22')]=function(_0x2382a9,_0x5e9329){if(_0x2382a9[_0x898a('0x50')]['id']){delete _0x2382a9[_0x898a('0x50')]['id'];}return db['AnalyticMetric'][_0x898a('0x46')]({'where':{'id':_0x2382a9['params']['id']}})['then'](handleEntityNotFound(_0x5e9329,null))[_0x898a('0x23')](saveUpdates(_0x2382a9[_0x898a('0x50')],null))[_0x898a('0x23')](respondWithResult(_0x5e9329,null))['catch'](handleError(_0x5e9329,null));};exports['destroy']=function(_0x11a07a,_0x1f5e4b){return db['AnalyticMetric'][_0x898a('0x46')]({'where':{'id':_0x11a07a[_0x898a('0x44')]['id']}})['then'](handleEntityNotFound(_0x1f5e4b,null))[_0x898a('0x23')](removeEntity(_0x1f5e4b,null))[_0x898a('0x43')](handleError(_0x1f5e4b,null));};
\ No newline at end of file
diff --git a/server/api/analyticMetric/analyticMetric.model.js b/server/api/analyticMetric/analyticMetric.model.js
index 6108939..dc8caae 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 _0x714c=['define','util','../../config/logger','api','moment','bluebird','path','rimraf','exports'];(function(_0x5d6456,_0x58ecc7){var _0x4d66c1=function(_0x4335e3){while(--_0x4335e3){_0x5d6456['push'](_0x5d6456['shift']());}};_0x4d66c1(++_0x58ecc7);}(_0x714c,0x18d));var _0xc714=function(_0x499210,_0x325b29){_0x499210=_0x499210-0x0;var _0x2e153d=_0x714c[_0x499210];return _0x2e153d;};'use strict';var _=require('lodash');var util=require(_0xc714('0x0'));var logger=require(_0xc714('0x1'))(_0xc714('0x2'));var moment=require(_0xc714('0x3'));var BPromise=require(_0xc714('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xc714('0x5'));var rimraf=require(_0xc714('0x6'));var config=require('../../config/environment');var attributes=require('./analyticMetric.attributes');module[_0xc714('0x7')]=function(_0xf624fc,_0x1c4a3b){return _0xf624fc[_0xc714('0x8')]('AnalyticMetric',attributes,{'tableName':'analytics_metrics','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x7c09=['rimraf','../../config/environment','./analyticMetric.attributes','define','AnalyticMetric','analytics_metrics','util','../../config/logger','moment','bluebird','request-promise','path'];(function(_0x9438cf,_0x19c958){var _0x3d8373=function(_0x17b7f0){while(--_0x17b7f0){_0x9438cf['push'](_0x9438cf['shift']());}};_0x3d8373(++_0x19c958);}(_0x7c09,0x102));var _0x97c0=function(_0x4df9f2,_0x20ee4e){_0x4df9f2=_0x4df9f2-0x0;var _0x5bb427=_0x7c09[_0x4df9f2];return _0x5bb427;};'use strict';var _=require('lodash');var util=require(_0x97c0('0x0'));var logger=require(_0x97c0('0x1'))('api');var moment=require(_0x97c0('0x2'));var BPromise=require(_0x97c0('0x3'));var rp=require(_0x97c0('0x4'));var fs=require('fs');var path=require(_0x97c0('0x5'));var rimraf=require(_0x97c0('0x6'));var config=require(_0x97c0('0x7'));var attributes=require(_0x97c0('0x8'));module['exports']=function(_0x4b2f81,_0x590368){return _0x4b2f81[_0x97c0('0x9')](_0x97c0('0xa'),attributes,{'tableName':_0x97c0('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 710de8b..1263483 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 _0x8573=['error','AnalyticMetric,\x20%s,\x20%s','message','result','catch','lodash','util','bluebird','randomstring','ioredis','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then','info','request\x20sent','debug','AnalyticMetric,\x20%s,\x20%s,\x20%s','stringify'];(function(_0x3160dd,_0x1a9d52){var _0x4f9783=function(_0x4a5781){while(--_0x4a5781){_0x3160dd['push'](_0x3160dd['shift']());}};_0x4f9783(++_0x1a9d52);}(_0x8573,0x9f));var _0x3857=function(_0x1592a4,_0x3608cc){_0x1592a4=_0x1592a4-0x0;var _0x3c2c13=_0x8573[_0x1592a4];return _0x3c2c13;};'use strict';var _=require(_0x3857('0x0'));var util=require(_0x3857('0x1'));var moment=require('moment');var BPromise=require(_0x3857('0x2'));var rs=require(_0x3857('0x3'));var fs=require('fs');var Redis=require(_0x3857('0x4'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x3857('0x5'))(_0x3857('0x6'));var config=require(_0x3857('0x7'));var jayson=require(_0x3857('0x8'));var client=jayson['client'][_0x3857('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x2b5e52,_0x6f220f,_0x25a10c){return new BPromise(function(_0x354dc2,_0x1d2e93){return client[_0x3857('0xa')](_0x2b5e52,_0x25a10c)[_0x3857('0xb')](function(_0x30e3fa){logger[_0x3857('0xc')]('AnalyticMetric,\x20%s,\x20%s',_0x6f220f,_0x3857('0xd'));logger[_0x3857('0xe')](_0x3857('0xf'),_0x6f220f,'request\x20sent',JSON[_0x3857('0x10')](_0x30e3fa));if(_0x30e3fa[_0x3857('0x11')]){if(_0x30e3fa[_0x3857('0x11')]['code']===0x1f4){logger[_0x3857('0x11')](_0x3857('0x12'),_0x6f220f,_0x30e3fa[_0x3857('0x11')]['message']);return _0x1d2e93(_0x30e3fa[_0x3857('0x11')]['message']);}logger['error'](_0x3857('0x12'),_0x6f220f,_0x30e3fa[_0x3857('0x11')][_0x3857('0x13')]);return _0x354dc2(_0x30e3fa[_0x3857('0x11')][_0x3857('0x13')]);}else{logger[_0x3857('0xc')]('AnalyticMetric,\x20%s,\x20%s',_0x6f220f,_0x3857('0xd'));_0x354dc2(_0x30e3fa[_0x3857('0x14')][_0x3857('0x13')]);}})[_0x3857('0x15')](function(_0x349a62){logger[_0x3857('0x11')](_0x3857('0x12'),_0x6f220f,_0x349a62);_0x1d2e93(_0x349a62);});});}
\ No newline at end of file
+var _0x84a1=['info','request\x20sent','debug','AnalyticMetric,\x20%s,\x20%s,\x20%s','stringify','error','code','AnalyticMetric,\x20%s,\x20%s','message','catch','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/environment','client','http','request','then'];(function(_0x14540b,_0x85d32d){var _0x394822=function(_0x2e9b0e){while(--_0x2e9b0e){_0x14540b['push'](_0x14540b['shift']());}};_0x394822(++_0x85d32d);}(_0x84a1,0x172));var _0x184a=function(_0x1606ff,_0x4e7eaa){_0x1606ff=_0x1606ff-0x0;var _0x1d82a8=_0x84a1[_0x1606ff];return _0x1d82a8;};'use strict';var _=require('lodash');var util=require(_0x184a('0x0'));var moment=require('moment');var BPromise=require(_0x184a('0x1'));var rs=require(_0x184a('0x2'));var fs=require('fs');var Redis=require(_0x184a('0x3'));var db=require(_0x184a('0x4'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')('rpc');var config=require(_0x184a('0x5'));var jayson=require('jayson/promise');var client=jayson[_0x184a('0x6')][_0x184a('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x2ae569,_0x3b770a,_0x4ff3fc){return new BPromise(function(_0x44b664,_0x52bcc2){return client[_0x184a('0x8')](_0x2ae569,_0x4ff3fc)[_0x184a('0x9')](function(_0x7b7f72){logger[_0x184a('0xa')]('AnalyticMetric,\x20%s,\x20%s',_0x3b770a,_0x184a('0xb'));logger[_0x184a('0xc')](_0x184a('0xd'),_0x3b770a,_0x184a('0xb'),JSON[_0x184a('0xe')](_0x7b7f72));if(_0x7b7f72[_0x184a('0xf')]){if(_0x7b7f72[_0x184a('0xf')][_0x184a('0x10')]===0x1f4){logger[_0x184a('0xf')]('AnalyticMetric,\x20%s,\x20%s',_0x3b770a,_0x7b7f72[_0x184a('0xf')]['message']);return _0x52bcc2(_0x7b7f72[_0x184a('0xf')]['message']);}logger['error']('AnalyticMetric,\x20%s,\x20%s',_0x3b770a,_0x7b7f72[_0x184a('0xf')]['message']);return _0x44b664(_0x7b7f72[_0x184a('0xf')]['message']);}else{logger['info'](_0x184a('0x11'),_0x3b770a,'request\x20sent');_0x44b664(_0x7b7f72['result'][_0x184a('0x12')]);}})[_0x184a('0x13')](function(_0x396e0f){logger[_0x184a('0xf')](_0x184a('0x11'),_0x3b770a,_0x396e0f);_0x52bcc2(_0x396e0f);});});}
\ No newline at end of file
diff --git a/server/api/analyticMetric/index.js b/server/api/analyticMetric/index.js
index 9004575..d25d1ab 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 _0x35d0=['update','destroy','multer','util','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./analyticMetric.controller','get','isAuthenticated','index','/:id','show','post','create','put'];(function(_0x52cdc1,_0x1bc117){var _0x16e9d9=function(_0x5b39ca){while(--_0x5b39ca){_0x52cdc1['push'](_0x52cdc1['shift']());}};_0x16e9d9(++_0x1bc117);}(_0x35d0,0xf9));var _0x035d=function(_0x52e363,_0x48062a){_0x52e363=_0x52e363-0x0;var _0x3fc2b5=_0x35d0[_0x52e363];return _0x3fc2b5;};'use strict';var multer=require(_0x035d('0x0'));var util=require(_0x035d('0x1'));var path=require('path');var timeout=require(_0x035d('0x2'));var express=require(_0x035d('0x3'));var router=express[_0x035d('0x4')]();var fs_extra=require(_0x035d('0x5'));var auth=require(_0x035d('0x6'));var interaction=require(_0x035d('0x7'));var config=require('../../config/environment');var controller=require(_0x035d('0x8'));router[_0x035d('0x9')]('/',auth[_0x035d('0xa')](),controller[_0x035d('0xb')]);router['get'](_0x035d('0xc'),auth[_0x035d('0xa')](),controller[_0x035d('0xd')]);router[_0x035d('0xe')]('/',auth[_0x035d('0xa')](),controller[_0x035d('0xf')]);router[_0x035d('0x10')](_0x035d('0xc'),auth[_0x035d('0xa')](),controller[_0x035d('0x11')]);router['delete'](_0x035d('0xc'),auth['isAuthenticated'](),controller[_0x035d('0x12')]);module['exports']=router;
\ No newline at end of file
+var _0x7c09=['create','destroy','exports','util','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./analyticMetric.controller','get','/:id','isAuthenticated','show','post'];(function(_0x4512a5,_0x471f20){var _0x540afa=function(_0x1fc82c){while(--_0x1fc82c){_0x4512a5['push'](_0x4512a5['shift']());}};_0x540afa(++_0x471f20);}(_0x7c09,0x102));var _0x97c0=function(_0x492ae5,_0xcd1348){_0x492ae5=_0x492ae5-0x0;var _0x11cbef=_0x7c09[_0x492ae5];return _0x11cbef;};'use strict';var multer=require('multer');var util=require(_0x97c0('0x0'));var path=require(_0x97c0('0x1'));var timeout=require('connect-timeout');var express=require(_0x97c0('0x2'));var router=express[_0x97c0('0x3')]();var fs_extra=require(_0x97c0('0x4'));var auth=require(_0x97c0('0x5'));var interaction=require(_0x97c0('0x6'));var config=require(_0x97c0('0x7'));var controller=require(_0x97c0('0x8'));router['get']('/',auth['isAuthenticated'](),controller['index']);router[_0x97c0('0x9')](_0x97c0('0xa'),auth[_0x97c0('0xb')](),controller[_0x97c0('0xc')]);router[_0x97c0('0xd')]('/',auth['isAuthenticated'](),controller[_0x97c0('0xe')]);router['put'](_0x97c0('0xa'),auth[_0x97c0('0xb')](),controller['update']);router['delete'](_0x97c0('0xa'),auth[_0x97c0('0xb')](),controller[_0x97c0('0xf')]);module[_0x97c0('0x10')]=router;
\ No newline at end of file
diff --git a/server/api/analyticTreeReport/analyticTreeReport.attributes.js b/server/api/analyticTreeReport/analyticTreeReport.attributes.js
index c756c7a..ec12f04 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 _0x55f2=['sequelize','exports','TEXT'];(function(_0x1e9f07,_0x495773){var _0x1145c5=function(_0x2168b6){while(--_0x2168b6){_0x1e9f07['push'](_0x1e9f07['shift']());}};_0x1145c5(++_0x495773);}(_0x55f2,0x117));var _0x255f=function(_0x19788e,_0x45353d){_0x19788e=_0x19788e-0x0;var _0x105204=_0x55f2[_0x19788e];return _0x105204;};'use strict';var Sequelize=require(_0x255f('0x0'));module[_0x255f('0x1')]={'tree':{'type':Sequelize[_0x255f('0x2')],'allowNull':![]}};
\ No newline at end of file
+var _0xa67c=['exports','TEXT','sequelize'];(function(_0x22663e,_0x25b0ce){var _0x38b63c=function(_0x3bd864){while(--_0x3bd864){_0x22663e['push'](_0x22663e['shift']());}};_0x38b63c(++_0x25b0ce);}(_0xa67c,0x179));var _0xca67=function(_0x2a4788,_0xbe2b0f){_0x2a4788=_0x2a4788-0x0;var _0x4d3f2f=_0xa67c[_0x2a4788];return _0x4d3f2f;};'use strict';var Sequelize=require(_0xca67('0x0'));module[_0xca67('0x1')]={'tree':{'type':Sequelize[_0xca67('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 710761d..efdf29e 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 _0x0383=['limit','count','set','Content-Range','json','apply','reject','save','update','then','destroy','end','name','send','index','AnalyticTreeReport','rawAttributes','model','map','query','keys','intersection','attributes','fields','length','nolimit','order','sort','pick','filters','filter','where','merge','type','options','includeAll','include','catch','show','find','create','body','params','eml-format','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','to-csv','ejs','fs-extra','squel','crypto','jsforce','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','offset','undefined'];(function(_0xcfd89f,_0x106e8f){var _0x59acd4=function(_0x2e187c){while(--_0x2e187c){_0xcfd89f['push'](_0xcfd89f['shift']());}};_0x59acd4(++_0x106e8f);}(_0x0383,0x103));var _0x3038=function(_0x3a0c9a,_0x1c423f){_0x3a0c9a=_0x3a0c9a-0x0;var _0x432ad6=_0x0383[_0x3a0c9a];return _0x432ad6;};'use strict';var emlformat=require(_0x3038('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x3038('0x1'));var jsonpatch=require(_0x3038('0x2'));var rp=require(_0x3038('0x3'));var moment=require(_0x3038('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x3038('0x5'));var util=require(_0x3038('0x6'));var path=require(_0x3038('0x7'));var sox=require('sox');var csv=require(_0x3038('0x8'));var ejs=require(_0x3038('0x9'));var fs=require('fs');var fs_extra=require(_0x3038('0xa'));var _=require('lodash');var squel=require(_0x3038('0xb'));var crypto=require(_0x3038('0xc'));var jsforce=require(_0x3038('0xd'));var deskjs=require('desk.js');var toCsv=require(_0x3038('0x8'));var querystring=require(_0x3038('0xe'));var Papa=require(_0x3038('0xf'));var Redis=require('ioredis');var authService=require(_0x3038('0x10'));var qs=require(_0x3038('0x11'));var as=require(_0x3038('0x12'));var hardwareService=require(_0x3038('0x13'));var logger=require(_0x3038('0x14'))(_0x3038('0x15'));var utils=require('../../config/utils');var config=require(_0x3038('0x16'));var licenseUtil=require(_0x3038('0x17'));var db=require(_0x3038('0x18'))['db'];function respondWithStatusCode(_0x5794e0,_0x52b87e){_0x52b87e=_0x52b87e||0xcc;return function(_0x5a27cc){if(_0x5a27cc){return _0x5794e0[_0x3038('0x19')](_0x52b87e);}return _0x5794e0[_0x3038('0x1a')](_0x52b87e)['end']();};}function respondWithResult(_0x4668b9,_0x20a3dd){_0x20a3dd=_0x20a3dd||0xc8;return function(_0x4f91b2){if(_0x4f91b2){return _0x4668b9[_0x3038('0x1a')](_0x20a3dd)['json'](_0x4f91b2);}};}function respondWithFilteredResult(_0x3da218,_0x391940){return function(_0x24caf8){if(_0x24caf8){var _0x337eeb=typeof _0x391940[_0x3038('0x1b')]===_0x3038('0x1c')&&typeof _0x391940[_0x3038('0x1d')]==='undefined';var _0x565b75=_0x24caf8[_0x3038('0x1e')];var _0x344e3f=_0x337eeb?0x0:_0x391940[_0x3038('0x1b')];var _0x2f3045=_0x337eeb?_0x24caf8['count']:_0x391940[_0x3038('0x1b')]+_0x391940[_0x3038('0x1d')];var _0x1e3e63;if(_0x2f3045>=_0x565b75){_0x2f3045=_0x565b75;_0x1e3e63=0xc8;}else{_0x1e3e63=0xce;}_0x3da218['status'](_0x1e3e63);return _0x3da218[_0x3038('0x1f')](_0x3038('0x20'),_0x344e3f+'-'+_0x2f3045+'/'+_0x565b75)[_0x3038('0x21')](_0x24caf8);}return null;};}function patchUpdates(_0x57bee4){return function(_0x4f12e4){try{jsonpatch[_0x3038('0x22')](_0x4f12e4,_0x57bee4,!![]);}catch(_0x15e619){return BPromise[_0x3038('0x23')](_0x15e619);}return _0x4f12e4[_0x3038('0x24')]();};}function saveUpdates(_0x453ba6,_0x1c351e){return function(_0x193b27){if(_0x193b27){return _0x193b27[_0x3038('0x25')](_0x453ba6)[_0x3038('0x26')](function(_0x431894){return _0x431894;});}return null;};}function removeEntity(_0x4f98be,_0x3cf143){return function(_0x1c9d42){if(_0x1c9d42){return _0x1c9d42[_0x3038('0x27')]()[_0x3038('0x26')](function(){_0x4f98be['status'](0xcc)[_0x3038('0x28')]();});}};}function handleEntityNotFound(_0x5c92d4,_0x1c499d){return function(_0x1e56f0){if(!_0x1e56f0){_0x5c92d4[_0x3038('0x19')](0x194);}return _0x1e56f0;};}function handleError(_0x59e4f2,_0x361a28){_0x361a28=_0x361a28||0x1f4;return function(_0x151ec6){logger['error'](_0x151ec6['stack']);if(_0x151ec6['name']){delete _0x151ec6[_0x3038('0x29')];}_0x59e4f2[_0x3038('0x1a')](_0x361a28)[_0x3038('0x2a')](_0x151ec6);};}exports[_0x3038('0x2b')]=function(_0x5a55d7,_0x1bed6d){var _0x2f256e={},_0x116701={},_0x30a20c={'count':0x0,'rows':[]};var _0x324d31=_['map'](db[_0x3038('0x2c')][_0x3038('0x2d')],function(_0x31ec3a){return{'name':_0x31ec3a['fieldName'],'type':_0x31ec3a['type']['key']};});_0x116701[_0x3038('0x2e')]=_[_0x3038('0x2f')](_0x324d31,_0x3038('0x29'));_0x116701[_0x3038('0x30')]=_[_0x3038('0x31')](_0x5a55d7[_0x3038('0x30')]);_0x116701['filters']=_[_0x3038('0x32')](_0x116701[_0x3038('0x2e')],_0x116701[_0x3038('0x30')]);_0x2f256e[_0x3038('0x33')]=_['intersection'](_0x116701[_0x3038('0x2e')],qs[_0x3038('0x34')](_0x5a55d7['query'][_0x3038('0x34')]));_0x2f256e['attributes']=_0x2f256e[_0x3038('0x33')][_0x3038('0x35')]?_0x2f256e[_0x3038('0x33')]:_0x116701['model'];if(!_0x5a55d7[_0x3038('0x30')]['hasOwnProperty'](_0x3038('0x36'))){_0x2f256e['limit']=qs[_0x3038('0x1d')](_0x5a55d7[_0x3038('0x30')][_0x3038('0x1d')]);_0x2f256e['offset']=qs[_0x3038('0x1b')](_0x5a55d7['query']['offset']);}_0x2f256e[_0x3038('0x37')]=qs[_0x3038('0x38')](_0x5a55d7[_0x3038('0x30')][_0x3038('0x38')]);_0x2f256e['where']=qs['filters'](_[_0x3038('0x39')](_0x5a55d7[_0x3038('0x30')],_0x116701[_0x3038('0x3a')]),_0x324d31);if(_0x5a55d7[_0x3038('0x30')][_0x3038('0x3b')]){_0x2f256e[_0x3038('0x3c')]=_[_0x3038('0x3d')](_0x2f256e[_0x3038('0x3c')],{'$or':_[_0x3038('0x2f')](_0x324d31,function(_0x5c6c3a){if(_0x5c6c3a[_0x3038('0x3e')]!=='VIRTUAL'){var _0x4ff855={};_0x4ff855[_0x5c6c3a[_0x3038('0x29')]]={'$like':'%'+_0x5a55d7['query'][_0x3038('0x3b')]+'%'};return _0x4ff855;}})});}_0x2f256e=_['merge']({},_0x2f256e,_0x5a55d7[_0x3038('0x3f')]);var _0x6c77c2={'where':_0x2f256e[_0x3038('0x3c')]};return db[_0x3038('0x2c')][_0x3038('0x1e')](_0x6c77c2)[_0x3038('0x26')](function(_0x19a7f2){_0x30a20c[_0x3038('0x1e')]=_0x19a7f2;if(_0x5a55d7[_0x3038('0x30')][_0x3038('0x40')]){_0x2f256e[_0x3038('0x41')]=[{'all':!![]}];}return db[_0x3038('0x2c')]['findAll'](_0x2f256e);})['then'](function(_0x188907){_0x30a20c['rows']=_0x188907;return _0x30a20c;})[_0x3038('0x26')](respondWithFilteredResult(_0x1bed6d,_0x2f256e))[_0x3038('0x42')](handleError(_0x1bed6d,null));};exports[_0x3038('0x43')]=function(_0x26624b,_0x1bc35f){var _0x40265f={'raw':!![],'where':{'id':_0x26624b['params']['id']}},_0x37c4e1={};_0x37c4e1[_0x3038('0x2e')]=_['keys'](db['AnalyticTreeReport'][_0x3038('0x2d')]);_0x37c4e1['query']=_[_0x3038('0x31')](_0x26624b[_0x3038('0x30')]);_0x37c4e1[_0x3038('0x3a')]=_['intersection'](_0x37c4e1[_0x3038('0x2e')],_0x37c4e1[_0x3038('0x30')]);_0x40265f['attributes']=_[_0x3038('0x32')](_0x37c4e1[_0x3038('0x2e')],qs[_0x3038('0x34')](_0x26624b[_0x3038('0x30')]['fields']));_0x40265f['attributes']=_0x40265f[_0x3038('0x33')][_0x3038('0x35')]?_0x40265f[_0x3038('0x33')]:_0x37c4e1[_0x3038('0x2e')];if(_0x26624b[_0x3038('0x30')][_0x3038('0x40')]){_0x40265f[_0x3038('0x41')]=[{'all':!![]}];}_0x40265f=_[_0x3038('0x3d')]({},_0x40265f,_0x26624b[_0x3038('0x3f')]);return db['AnalyticTreeReport'][_0x3038('0x44')](_0x40265f)[_0x3038('0x26')](handleEntityNotFound(_0x1bc35f,null))['then'](respondWithResult(_0x1bc35f,null))['catch'](handleError(_0x1bc35f,null));};exports[_0x3038('0x45')]=function(_0x285965,_0xc8a2cc){return db[_0x3038('0x2c')][_0x3038('0x45')](_0x285965[_0x3038('0x46')],{})[_0x3038('0x26')](respondWithResult(_0xc8a2cc,0xc9))[_0x3038('0x42')](handleError(_0xc8a2cc,null));};exports['update']=function(_0x38e0dd,_0x3a3993){if(_0x38e0dd[_0x3038('0x46')]['id']){delete _0x38e0dd[_0x3038('0x46')]['id'];}return db['AnalyticTreeReport']['find']({'where':{'id':_0x38e0dd['params']['id']}})['then'](handleEntityNotFound(_0x3a3993,null))['then'](saveUpdates(_0x38e0dd[_0x3038('0x46')],null))[_0x3038('0x26')](respondWithResult(_0x3a3993,null))[_0x3038('0x42')](handleError(_0x3a3993,null));};exports[_0x3038('0x27')]=function(_0x2f3bba,_0x49dc9b){return db['AnalyticTreeReport'][_0x3038('0x44')]({'where':{'id':_0x2f3bba[_0x3038('0x47')]['id']}})['then'](handleEntityNotFound(_0x49dc9b,null))[_0x3038('0x26')](removeEntity(_0x49dc9b,null))[_0x3038('0x42')](handleError(_0x49dc9b,null));};
\ No newline at end of file
+var _0xc71b=['model','map','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','order','sort','where','filter','merge','options','AnalyticTreeReport','then','include','findAll','rows','catch','show','params','includeAll','create','body','update','find','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','squel','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','json','offset','undefined','limit','count','set','Content-Range','save','destroy','end','error','stack','name','send','index','rawAttributes','fieldName','key'];(function(_0x33554b,_0x48162b){var _0x256954=function(_0x185f66){while(--_0x185f66){_0x33554b['push'](_0x33554b['shift']());}};_0x256954(++_0x48162b);}(_0xc71b,0x151));var _0xbc71=function(_0x479c00,_0x3b56f9){_0x479c00=_0x479c00-0x0;var _0xf7ff18=_0xc71b[_0x479c00];return _0xf7ff18;};'use strict';var emlformat=require(_0xbc71('0x0'));var rimraf=require(_0xbc71('0x1'));var zipdir=require(_0xbc71('0x2'));var jsonpatch=require(_0xbc71('0x3'));var rp=require(_0xbc71('0x4'));var moment=require('moment');var BPromise=require(_0xbc71('0x5'));var Mustache=require(_0xbc71('0x6'));var util=require(_0xbc71('0x7'));var path=require(_0xbc71('0x8'));var sox=require(_0xbc71('0x9'));var csv=require(_0xbc71('0xa'));var ejs=require(_0xbc71('0xb'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xbc71('0xc'));var squel=require(_0xbc71('0xd'));var crypto=require('crypto');var jsforce=require(_0xbc71('0xe'));var deskjs=require(_0xbc71('0xf'));var toCsv=require('to-csv');var querystring=require(_0xbc71('0x10'));var Papa=require(_0xbc71('0x11'));var Redis=require('ioredis');var authService=require(_0xbc71('0x12'));var qs=require(_0xbc71('0x13'));var as=require(_0xbc71('0x14'));var hardwareService=require(_0xbc71('0x15'));var logger=require(_0xbc71('0x16'))(_0xbc71('0x17'));var utils=require(_0xbc71('0x18'));var config=require(_0xbc71('0x19'));var licenseUtil=require(_0xbc71('0x1a'));var db=require(_0xbc71('0x1b'))['db'];function respondWithStatusCode(_0x3de868,_0x161f5e){_0x161f5e=_0x161f5e||0xcc;return function(_0x11d645){if(_0x11d645){return _0x3de868[_0xbc71('0x1c')](_0x161f5e);}return _0x3de868[_0xbc71('0x1d')](_0x161f5e)['end']();};}function respondWithResult(_0x196a0c,_0x345761){_0x345761=_0x345761||0xc8;return function(_0x5df17b){if(_0x5df17b){return _0x196a0c[_0xbc71('0x1d')](_0x345761)[_0xbc71('0x1e')](_0x5df17b);}};}function respondWithFilteredResult(_0x2c6602,_0x26a569){return function(_0x17b30f){if(_0x17b30f){var _0x37857f=typeof _0x26a569[_0xbc71('0x1f')]===_0xbc71('0x20')&&typeof _0x26a569[_0xbc71('0x21')]===_0xbc71('0x20');var _0x2c9ffe=_0x17b30f[_0xbc71('0x22')];var _0x2536c0=_0x37857f?0x0:_0x26a569[_0xbc71('0x1f')];var _0x27a52a=_0x37857f?_0x17b30f[_0xbc71('0x22')]:_0x26a569[_0xbc71('0x1f')]+_0x26a569[_0xbc71('0x21')];var _0x44e144;if(_0x27a52a>=_0x2c9ffe){_0x27a52a=_0x2c9ffe;_0x44e144=0xc8;}else{_0x44e144=0xce;}_0x2c6602[_0xbc71('0x1d')](_0x44e144);return _0x2c6602[_0xbc71('0x23')](_0xbc71('0x24'),_0x2536c0+'-'+_0x27a52a+'/'+_0x2c9ffe)[_0xbc71('0x1e')](_0x17b30f);}return null;};}function patchUpdates(_0x35eec1){return function(_0x162b2c){try{jsonpatch['apply'](_0x162b2c,_0x35eec1,!![]);}catch(_0x5ccfa5){return BPromise['reject'](_0x5ccfa5);}return _0x162b2c[_0xbc71('0x25')]();};}function saveUpdates(_0x2035fb,_0x26eeef){return function(_0x2cb236){if(_0x2cb236){return _0x2cb236['update'](_0x2035fb)['then'](function(_0x8ce8f3){return _0x8ce8f3;});}return null;};}function removeEntity(_0x39cf32,_0xc0d214){return function(_0x3f0373){if(_0x3f0373){return _0x3f0373[_0xbc71('0x26')]()['then'](function(){_0x39cf32[_0xbc71('0x1d')](0xcc)[_0xbc71('0x27')]();});}};}function handleEntityNotFound(_0x21adbb,_0x57aff2){return function(_0x33d56f){if(!_0x33d56f){_0x21adbb[_0xbc71('0x1c')](0x194);}return _0x33d56f;};}function handleError(_0x23b091,_0x56c7f9){_0x56c7f9=_0x56c7f9||0x1f4;return function(_0x4bf0ef){logger[_0xbc71('0x28')](_0x4bf0ef[_0xbc71('0x29')]);if(_0x4bf0ef[_0xbc71('0x2a')]){delete _0x4bf0ef[_0xbc71('0x2a')];}_0x23b091[_0xbc71('0x1d')](_0x56c7f9)[_0xbc71('0x2b')](_0x4bf0ef);};}exports[_0xbc71('0x2c')]=function(_0x1c6cda,_0x2ef3c6){var _0x488d9e={},_0x4fc2b1={},_0x5e4c80={'count':0x0,'rows':[]};var _0x2fa9c8=_['map'](db['AnalyticTreeReport'][_0xbc71('0x2d')],function(_0x3eb161){return{'name':_0x3eb161[_0xbc71('0x2e')],'type':_0x3eb161['type'][_0xbc71('0x2f')]};});_0x4fc2b1[_0xbc71('0x30')]=_[_0xbc71('0x31')](_0x2fa9c8,'name');_0x4fc2b1[_0xbc71('0x32')]=_[_0xbc71('0x33')](_0x1c6cda[_0xbc71('0x32')]);_0x4fc2b1[_0xbc71('0x34')]=_['intersection'](_0x4fc2b1['model'],_0x4fc2b1[_0xbc71('0x32')]);_0x488d9e['attributes']=_[_0xbc71('0x35')](_0x4fc2b1['model'],qs[_0xbc71('0x36')](_0x1c6cda[_0xbc71('0x32')][_0xbc71('0x36')]));_0x488d9e[_0xbc71('0x37')]=_0x488d9e['attributes'][_0xbc71('0x38')]?_0x488d9e[_0xbc71('0x37')]:_0x4fc2b1[_0xbc71('0x30')];if(!_0x1c6cda[_0xbc71('0x32')][_0xbc71('0x39')]('nolimit')){_0x488d9e['limit']=qs[_0xbc71('0x21')](_0x1c6cda[_0xbc71('0x32')][_0xbc71('0x21')]);_0x488d9e[_0xbc71('0x1f')]=qs[_0xbc71('0x1f')](_0x1c6cda['query'][_0xbc71('0x1f')]);}_0x488d9e[_0xbc71('0x3a')]=qs[_0xbc71('0x3b')](_0x1c6cda[_0xbc71('0x32')][_0xbc71('0x3b')]);_0x488d9e[_0xbc71('0x3c')]=qs['filters'](_['pick'](_0x1c6cda[_0xbc71('0x32')],_0x4fc2b1[_0xbc71('0x34')]),_0x2fa9c8);if(_0x1c6cda['query'][_0xbc71('0x3d')]){_0x488d9e[_0xbc71('0x3c')]=_[_0xbc71('0x3e')](_0x488d9e[_0xbc71('0x3c')],{'$or':_[_0xbc71('0x31')](_0x2fa9c8,function(_0xe84e8a){if(_0xe84e8a['type']!=='VIRTUAL'){var _0x16b3d4={};_0x16b3d4[_0xe84e8a['name']]={'$like':'%'+_0x1c6cda['query'][_0xbc71('0x3d')]+'%'};return _0x16b3d4;}})});}_0x488d9e=_[_0xbc71('0x3e')]({},_0x488d9e,_0x1c6cda[_0xbc71('0x3f')]);var _0x4c05ba={'where':_0x488d9e[_0xbc71('0x3c')]};return db[_0xbc71('0x40')][_0xbc71('0x22')](_0x4c05ba)[_0xbc71('0x41')](function(_0x21c805){_0x5e4c80['count']=_0x21c805;if(_0x1c6cda[_0xbc71('0x32')]['includeAll']){_0x488d9e[_0xbc71('0x42')]=[{'all':!![]}];}return db[_0xbc71('0x40')][_0xbc71('0x43')](_0x488d9e);})[_0xbc71('0x41')](function(_0x3fd921){_0x5e4c80[_0xbc71('0x44')]=_0x3fd921;return _0x5e4c80;})['then'](respondWithFilteredResult(_0x2ef3c6,_0x488d9e))[_0xbc71('0x45')](handleError(_0x2ef3c6,null));};exports[_0xbc71('0x46')]=function(_0x428385,_0x404869){var _0x262837={'raw':!![],'where':{'id':_0x428385[_0xbc71('0x47')]['id']}},_0x32762d={};_0x32762d[_0xbc71('0x30')]=_[_0xbc71('0x33')](db[_0xbc71('0x40')][_0xbc71('0x2d')]);_0x32762d[_0xbc71('0x32')]=_[_0xbc71('0x33')](_0x428385['query']);_0x32762d['filters']=_['intersection'](_0x32762d[_0xbc71('0x30')],_0x32762d[_0xbc71('0x32')]);_0x262837[_0xbc71('0x37')]=_[_0xbc71('0x35')](_0x32762d[_0xbc71('0x30')],qs[_0xbc71('0x36')](_0x428385[_0xbc71('0x32')][_0xbc71('0x36')]));_0x262837[_0xbc71('0x37')]=_0x262837[_0xbc71('0x37')]['length']?_0x262837['attributes']:_0x32762d[_0xbc71('0x30')];if(_0x428385[_0xbc71('0x32')][_0xbc71('0x48')]){_0x262837[_0xbc71('0x42')]=[{'all':!![]}];}_0x262837=_[_0xbc71('0x3e')]({},_0x262837,_0x428385[_0xbc71('0x3f')]);return db[_0xbc71('0x40')]['find'](_0x262837)['then'](handleEntityNotFound(_0x404869,null))[_0xbc71('0x41')](respondWithResult(_0x404869,null))[_0xbc71('0x45')](handleError(_0x404869,null));};exports[_0xbc71('0x49')]=function(_0x1a891c,_0x3d2d56){return db[_0xbc71('0x40')][_0xbc71('0x49')](_0x1a891c[_0xbc71('0x4a')],{})[_0xbc71('0x41')](respondWithResult(_0x3d2d56,0xc9))[_0xbc71('0x45')](handleError(_0x3d2d56,null));};exports[_0xbc71('0x4b')]=function(_0x1c3f82,_0x3849ad){if(_0x1c3f82[_0xbc71('0x4a')]['id']){delete _0x1c3f82[_0xbc71('0x4a')]['id'];}return db[_0xbc71('0x40')][_0xbc71('0x4c')]({'where':{'id':_0x1c3f82[_0xbc71('0x47')]['id']}})[_0xbc71('0x41')](handleEntityNotFound(_0x3849ad,null))[_0xbc71('0x41')](saveUpdates(_0x1c3f82[_0xbc71('0x4a')],null))[_0xbc71('0x41')](respondWithResult(_0x3849ad,null))[_0xbc71('0x45')](handleError(_0x3849ad,null));};exports[_0xbc71('0x26')]=function(_0xc30fcf,_0x46dd6c){return db[_0xbc71('0x40')]['find']({'where':{'id':_0xc30fcf[_0xbc71('0x47')]['id']}})['then'](handleEntityNotFound(_0x46dd6c,null))[_0xbc71('0x41')](removeEntity(_0x46dd6c,null))[_0xbc71('0x45')](handleError(_0x46dd6c,null));};
\ No newline at end of file
diff --git a/server/api/analyticTreeReport/analyticTreeReport.model.js b/server/api/analyticTreeReport/analyticTreeReport.model.js
index 29e403e..f0baab7 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 _0xbe2d=['AnalyticTreeReport','api','moment','bluebird','request-promise','path','rimraf','exports'];(function(_0x2f3292,_0x1438e8){var _0x1c9a5e=function(_0x3c9706){while(--_0x3c9706){_0x2f3292['push'](_0x2f3292['shift']());}};_0x1c9a5e(++_0x1438e8);}(_0xbe2d,0xb9));var _0xdbe2=function(_0x4679ea,_0x235e77){_0x4679ea=_0x4679ea-0x0;var _0x196235=_0xbe2d[_0x4679ea];return _0x196235;};'use strict';var _=require('lodash');var util=require('util');var logger=require('../../config/logger')(_0xdbe2('0x0'));var moment=require(_0xdbe2('0x1'));var BPromise=require(_0xdbe2('0x2'));var rp=require(_0xdbe2('0x3'));var fs=require('fs');var path=require(_0xdbe2('0x4'));var rimraf=require(_0xdbe2('0x5'));var config=require('../../config/environment');var attributes=require('./analyticTreeReport.attributes');module[_0xdbe2('0x6')]=function(_0xf6bbce,_0x3bc284){return _0xf6bbce['define'](_0xdbe2('0x7'),attributes,{'tableName':'analytics_report_trees','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x1646=['./analyticTreeReport.attributes','exports','define','analytics_report_trees','lodash','api','moment','path','rimraf'];(function(_0x59b889,_0x4b026c){var _0x470d3f=function(_0x52eeb2){while(--_0x52eeb2){_0x59b889['push'](_0x59b889['shift']());}};_0x470d3f(++_0x4b026c);}(_0x1646,0x124));var _0x6164=function(_0x175e89,_0x20835f){_0x175e89=_0x175e89-0x0;var _0x2ed996=_0x1646[_0x175e89];return _0x2ed996;};'use strict';var _=require(_0x6164('0x0'));var util=require('util');var logger=require('../../config/logger')(_0x6164('0x1'));var moment=require(_0x6164('0x2'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x6164('0x3'));var rimraf=require(_0x6164('0x4'));var config=require('../../config/environment');var attributes=require(_0x6164('0x5'));module[_0x6164('0x6')]=function(_0x130eb8,_0x49fdcd){return _0x130eb8[_0x6164('0x7')]('AnalyticTreeReport',attributes,{'tableName':_0x6164('0x8'),'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 7bb9930..a2b847c 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 _0xadb5=['error','code','message','result','catch','util','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','request','then','info','AnalyticTreeReport,\x20%s,\x20%s','request\x20sent','stringify'];(function(_0x794cdc,_0x59809d){var _0x4a65a6=function(_0x52358b){while(--_0x52358b){_0x794cdc['push'](_0x794cdc['shift']());}};_0x4a65a6(++_0x59809d);}(_0xadb5,0xad));var _0x5adb=function(_0x4343e5,_0xbe9be4){_0x4343e5=_0x4343e5-0x0;var _0x1a924b=_0xadb5[_0x4343e5];return _0x1a924b;};'use strict';var _=require('lodash');var util=require(_0x5adb('0x0'));var moment=require('moment');var BPromise=require(_0x5adb('0x1'));var rs=require(_0x5adb('0x2'));var fs=require('fs');var Redis=require(_0x5adb('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x5adb('0x4'));var logger=require(_0x5adb('0x5'))(_0x5adb('0x6'));var config=require('../../config/environment');var jayson=require(_0x5adb('0x7'));var client=jayson[_0x5adb('0x8')][_0x5adb('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x3213e8,_0xdf3776,_0x353885){return new BPromise(function(_0x47228a,_0x6d1b45){return client[_0x5adb('0xa')](_0x3213e8,_0x353885)[_0x5adb('0xb')](function(_0x34f59d){logger[_0x5adb('0xc')](_0x5adb('0xd'),_0xdf3776,_0x5adb('0xe'));logger['debug']('AnalyticTreeReport,\x20%s,\x20%s,\x20%s',_0xdf3776,_0x5adb('0xe'),JSON[_0x5adb('0xf')](_0x34f59d));if(_0x34f59d[_0x5adb('0x10')]){if(_0x34f59d['error'][_0x5adb('0x11')]===0x1f4){logger['error'](_0x5adb('0xd'),_0xdf3776,_0x34f59d['error'][_0x5adb('0x12')]);return _0x6d1b45(_0x34f59d[_0x5adb('0x10')][_0x5adb('0x12')]);}logger['error'](_0x5adb('0xd'),_0xdf3776,_0x34f59d[_0x5adb('0x10')][_0x5adb('0x12')]);return _0x47228a(_0x34f59d['error'][_0x5adb('0x12')]);}else{logger['info'](_0x5adb('0xd'),_0xdf3776,_0x5adb('0xe'));_0x47228a(_0x34f59d[_0x5adb('0x13')][_0x5adb('0x12')]);}})[_0x5adb('0x14')](function(_0x39d24d){logger[_0x5adb('0x10')](_0x5adb('0xd'),_0xdf3776,_0x39d24d);_0x6d1b45(_0x39d24d);});});}
\ No newline at end of file
+var _0x1261=['then','info','AnalyticTreeReport,\x20%s,\x20%s','request\x20sent','AnalyticTreeReport,\x20%s,\x20%s,\x20%s','error','code','message','catch','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','http','request'];(function(_0x12b8d4,_0x50bbfd){var _0x49f706=function(_0x4c455f){while(--_0x4c455f){_0x12b8d4['push'](_0x12b8d4['shift']());}};_0x49f706(++_0x50bbfd);}(_0x1261,0x144));var _0x1126=function(_0x439662,_0x5defdb){_0x439662=_0x439662-0x0;var _0x251ec4=_0x1261[_0x439662];return _0x251ec4;};'use strict';var _=require('lodash');var util=require(_0x1126('0x0'));var moment=require(_0x1126('0x1'));var BPromise=require(_0x1126('0x2'));var rs=require(_0x1126('0x3'));var fs=require('fs');var Redis=require(_0x1126('0x4'));var db=require(_0x1126('0x5'))['db'];var utils=require(_0x1126('0x6'));var logger=require(_0x1126('0x7'))(_0x1126('0x8'));var config=require(_0x1126('0x9'));var jayson=require('jayson/promise');var client=jayson['client'][_0x1126('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x907180,_0x4f239c,_0x17e5f0){return new BPromise(function(_0x28772d,_0x245be9){return client[_0x1126('0xb')](_0x907180,_0x17e5f0)[_0x1126('0xc')](function(_0x59cfa1){logger[_0x1126('0xd')](_0x1126('0xe'),_0x4f239c,_0x1126('0xf'));logger['debug'](_0x1126('0x10'),_0x4f239c,'request\x20sent',JSON['stringify'](_0x59cfa1));if(_0x59cfa1[_0x1126('0x11')]){if(_0x59cfa1['error'][_0x1126('0x12')]===0x1f4){logger[_0x1126('0x11')](_0x1126('0xe'),_0x4f239c,_0x59cfa1[_0x1126('0x11')][_0x1126('0x13')]);return _0x245be9(_0x59cfa1[_0x1126('0x11')][_0x1126('0x13')]);}logger[_0x1126('0x11')](_0x1126('0xe'),_0x4f239c,_0x59cfa1['error']['message']);return _0x28772d(_0x59cfa1[_0x1126('0x11')][_0x1126('0x13')]);}else{logger[_0x1126('0xd')]('AnalyticTreeReport,\x20%s,\x20%s',_0x4f239c,_0x1126('0xf'));_0x28772d(_0x59cfa1['result'][_0x1126('0x13')]);}})[_0x1126('0x14')](function(_0x257b5f){logger['error'](_0x1126('0xe'),_0x4f239c,_0x257b5f);_0x245be9(_0x257b5f);});});}
\ No newline at end of file
diff --git a/server/api/analyticTreeReport/index.js b/server/api/analyticTreeReport/index.js
index 831bdca..b0e13cc 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 _0xa632=['multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./analyticTreeReport.controller','index','get','/:id','isAuthenticated','post','create','put','update','delete','destroy','exports'];(function(_0x1b2e34,_0x8d3ab5){var _0x13c2b9=function(_0x1d4bb3){while(--_0x1d4bb3){_0x1b2e34['push'](_0x1b2e34['shift']());}};_0x13c2b9(++_0x8d3ab5);}(_0xa632,0x1a2));var _0x2a63=function(_0x31cb5f,_0x2df766){_0x31cb5f=_0x31cb5f-0x0;var _0x586042=_0xa632[_0x31cb5f];return _0x586042;};'use strict';var multer=require(_0x2a63('0x0'));var util=require(_0x2a63('0x1'));var path=require(_0x2a63('0x2'));var timeout=require(_0x2a63('0x3'));var express=require(_0x2a63('0x4'));var router=express[_0x2a63('0x5')]();var fs_extra=require(_0x2a63('0x6'));var auth=require(_0x2a63('0x7'));var interaction=require(_0x2a63('0x8'));var config=require(_0x2a63('0x9'));var controller=require(_0x2a63('0xa'));router['get']('/',auth['isAuthenticated'](),controller[_0x2a63('0xb')]);router[_0x2a63('0xc')](_0x2a63('0xd'),auth[_0x2a63('0xe')](),controller['show']);router[_0x2a63('0xf')]('/',auth[_0x2a63('0xe')](),controller[_0x2a63('0x10')]);router[_0x2a63('0x11')](_0x2a63('0xd'),auth[_0x2a63('0xe')](),controller[_0x2a63('0x12')]);router[_0x2a63('0x13')](_0x2a63('0xd'),auth[_0x2a63('0xe')](),controller[_0x2a63('0x14')]);module[_0x2a63('0x15')]=router;
\ No newline at end of file
+var _0xc484=['util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./analyticTreeReport.controller','index','get','/:id','isAuthenticated','show','create','update','delete','destroy','multer'];(function(_0x184412,_0x5cfdaf){var _0x4a0c3e=function(_0x325bf9){while(--_0x325bf9){_0x184412['push'](_0x184412['shift']());}};_0x4a0c3e(++_0x5cfdaf);}(_0xc484,0x155));var _0x4c48=function(_0x3b2f12,_0x1e7128){_0x3b2f12=_0x3b2f12-0x0;var _0x36a818=_0xc484[_0x3b2f12];return _0x36a818;};'use strict';var multer=require(_0x4c48('0x0'));var util=require(_0x4c48('0x1'));var path=require(_0x4c48('0x2'));var timeout=require(_0x4c48('0x3'));var express=require('express');var router=express[_0x4c48('0x4')]();var fs_extra=require(_0x4c48('0x5'));var auth=require(_0x4c48('0x6'));var interaction=require(_0x4c48('0x7'));var config=require(_0x4c48('0x8'));var controller=require(_0x4c48('0x9'));router['get']('/',auth['isAuthenticated'](),controller[_0x4c48('0xa')]);router[_0x4c48('0xb')](_0x4c48('0xc'),auth[_0x4c48('0xd')](),controller[_0x4c48('0xe')]);router['post']('/',auth[_0x4c48('0xd')](),controller[_0x4c48('0xf')]);router['put'](_0x4c48('0xc'),auth[_0x4c48('0xd')](),controller[_0x4c48('0x10')]);router[_0x4c48('0x11')](_0x4c48('0xc'),auth[_0x4c48('0xd')](),controller[_0x4c48('0x12')]);module['exports']=router;
\ No newline at end of file
diff --git a/server/api/attachment/attachment.attributes.js b/server/api/attachment/attachment.attributes.js
index 99fd94f..3b327f1 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 _0x3c6d=['STRING','sequelize','exports'];(function(_0x392e2e,_0x23c0a3){var _0x2b5769=function(_0xbe84fd){while(--_0xbe84fd){_0x392e2e['push'](_0x392e2e['shift']());}};_0x2b5769(++_0x23c0a3);}(_0x3c6d,0x199));var _0xd3c6=function(_0x2ce9ae,_0x5c955e){_0x2ce9ae=_0x2ce9ae-0x0;var _0x122a7a=_0x3c6d[_0x2ce9ae];return _0x122a7a;};'use strict';var Sequelize=require(_0xd3c6('0x0'));module[_0xd3c6('0x1')]={'name':{'type':Sequelize[_0xd3c6('0x2')]},'basename':{'type':Sequelize[_0xd3c6('0x2')]},'type':{'type':Sequelize['STRING']}};
\ No newline at end of file
+var _0x885e=['sequelize','exports','STRING'];(function(_0x3e5086,_0x48f4a2){var _0xfeb102=function(_0x5a945f){while(--_0x5a945f){_0x3e5086['push'](_0x3e5086['shift']());}};_0xfeb102(++_0x48f4a2);}(_0x885e,0xe4));var _0xe885=function(_0x34965b,_0xe64754){_0x34965b=_0x34965b-0x0;var _0x5d9c02=_0x885e[_0x34965b];return _0x5d9c02;};'use strict';var Sequelize=require(_0xe885('0x0'));module[_0xe885('0x1')]={'name':{'type':Sequelize['STRING']},'basename':{'type':Sequelize[_0xe885('0x2')]},'type':{'type':Sequelize[_0xe885('0x2')]}};
\ No newline at end of file
diff --git a/server/api/attachment/attachment.controller.js b/server/api/attachment/attachment.controller.js
index 046358c..ac8074a 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 _0x8bd6=['../../mysqldb','sendStatus','status','json','offset','undefined','count','limit','set','Content-Range','apply','reject','save','then','destroy','error','stack','name','index','map','Attachment','rawAttributes','fieldName','type','key','query','filters','intersection','attributes','fields','length','model','hasOwnProperty','nolimit','sort','where','pick','filter','VIRTUAL','merge','options','include','rows','show','params','keys','find','catch','clone','includeAll','get','omit','createdAt','updatedAt','body','create','update','file','basename','filename','mimetype','download','findOne','ChatOfflineMessageId','root','server/files/attachments/','join','offline-chat/','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','util','path','sox','to-csv','fs-extra','lodash','squel','crypto','jsforce','desk.js','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','api'];(function(_0x15d270,_0x52ccc9){var _0x20de46=function(_0x27d5d7){while(--_0x27d5d7){_0x15d270['push'](_0x15d270['shift']());}};_0x20de46(++_0x52ccc9);}(_0x8bd6,0x14f));var _0x68bd=function(_0x3de56a,_0x1adcad){_0x3de56a=_0x3de56a-0x0;var _0x575be5=_0x8bd6[_0x3de56a];return _0x575be5;};'use strict';var emlformat=require(_0x68bd('0x0'));var rimraf=require(_0x68bd('0x1'));var zipdir=require(_0x68bd('0x2'));var jsonpatch=require(_0x68bd('0x3'));var rp=require('request-promise');var moment=require(_0x68bd('0x4'));var BPromise=require(_0x68bd('0x5'));var Mustache=require('mustache');var util=require(_0x68bd('0x6'));var path=require(_0x68bd('0x7'));var sox=require(_0x68bd('0x8'));var csv=require(_0x68bd('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x68bd('0xa'));var _=require(_0x68bd('0xb'));var squel=require(_0x68bd('0xc'));var crypto=require(_0x68bd('0xd'));var jsforce=require(_0x68bd('0xe'));var deskjs=require(_0x68bd('0xf'));var toCsv=require(_0x68bd('0x9'));var querystring=require('querystring');var Papa=require(_0x68bd('0x10'));var Redis=require('ioredis');var authService=require(_0x68bd('0x11'));var qs=require(_0x68bd('0x12'));var as=require(_0x68bd('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x68bd('0x14'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0x68bd('0x15'))['db'];function respondWithStatusCode(_0x1ad858,_0x3aa32d){_0x3aa32d=_0x3aa32d||0xcc;return function(_0x4138c2){if(_0x4138c2){return _0x1ad858[_0x68bd('0x16')](_0x3aa32d);}return _0x1ad858[_0x68bd('0x17')](_0x3aa32d)['end']();};}function respondWithResult(_0x3b9507,_0x3d1737){_0x3d1737=_0x3d1737||0xc8;return function(_0x134e68){if(_0x134e68){return _0x3b9507[_0x68bd('0x17')](_0x3d1737)[_0x68bd('0x18')](_0x134e68);}};}function respondWithFilteredResult(_0x529617,_0x56e472){return function(_0xcfda6d){if(_0xcfda6d){var _0x80ae32=typeof _0x56e472[_0x68bd('0x19')]===_0x68bd('0x1a')&&typeof _0x56e472['limit']===_0x68bd('0x1a');var _0x36a9c1=_0xcfda6d[_0x68bd('0x1b')];var _0x22ab87=_0x80ae32?0x0:_0x56e472[_0x68bd('0x19')];var _0x1fb50a=_0x80ae32?_0xcfda6d[_0x68bd('0x1b')]:_0x56e472['offset']+_0x56e472[_0x68bd('0x1c')];var _0x4e59df;if(_0x1fb50a>=_0x36a9c1){_0x1fb50a=_0x36a9c1;_0x4e59df=0xc8;}else{_0x4e59df=0xce;}_0x529617['status'](_0x4e59df);return _0x529617[_0x68bd('0x1d')](_0x68bd('0x1e'),_0x22ab87+'-'+_0x1fb50a+'/'+_0x36a9c1)[_0x68bd('0x18')](_0xcfda6d);}return null;};}function patchUpdates(_0x54159b){return function(_0x3b4602){try{jsonpatch[_0x68bd('0x1f')](_0x3b4602,_0x54159b,!![]);}catch(_0x4bb8fe){return BPromise[_0x68bd('0x20')](_0x4bb8fe);}return _0x3b4602[_0x68bd('0x21')]();};}function saveUpdates(_0x47960f,_0x41cdcd){return function(_0x37ca3f){if(_0x37ca3f){return _0x37ca3f['update'](_0x47960f)[_0x68bd('0x22')](function(_0x48a6c1){return _0x48a6c1;});}return null;};}function removeEntity(_0x2f0b09,_0x5b521a){return function(_0x46d784){if(_0x46d784){return _0x46d784[_0x68bd('0x23')]()[_0x68bd('0x22')](function(){_0x2f0b09['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x308065,_0xb92f9b){return function(_0xe3a833){if(!_0xe3a833){_0x308065['sendStatus'](0x194);}return _0xe3a833;};}function handleError(_0x509015,_0x426b09){_0x426b09=_0x426b09||0x1f4;return function(_0x24093d){logger[_0x68bd('0x24')](_0x24093d[_0x68bd('0x25')]);if(_0x24093d['name']){delete _0x24093d[_0x68bd('0x26')];}_0x509015['status'](_0x426b09)['send'](_0x24093d);};}exports[_0x68bd('0x27')]=function(_0x52ccc5,_0x177064){var _0x566984={},_0x5306e8={},_0x1597de={'count':0x0,'rows':[]};var _0x2629ea=_[_0x68bd('0x28')](db[_0x68bd('0x29')][_0x68bd('0x2a')],function(_0x575319){return{'name':_0x575319[_0x68bd('0x2b')],'type':_0x575319[_0x68bd('0x2c')][_0x68bd('0x2d')]};});_0x5306e8['model']=_[_0x68bd('0x28')](_0x2629ea,'name');_0x5306e8[_0x68bd('0x2e')]=_['keys'](_0x52ccc5[_0x68bd('0x2e')]);_0x5306e8[_0x68bd('0x2f')]=_[_0x68bd('0x30')](_0x5306e8['model'],_0x5306e8['query']);_0x566984[_0x68bd('0x31')]=_[_0x68bd('0x30')](_0x5306e8['model'],qs[_0x68bd('0x32')](_0x52ccc5['query'][_0x68bd('0x32')]));_0x566984[_0x68bd('0x31')]=_0x566984[_0x68bd('0x31')][_0x68bd('0x33')]?_0x566984[_0x68bd('0x31')]:_0x5306e8[_0x68bd('0x34')];if(!_0x52ccc5[_0x68bd('0x2e')][_0x68bd('0x35')](_0x68bd('0x36'))){_0x566984[_0x68bd('0x1c')]=qs['limit'](_0x52ccc5['query']['limit']);_0x566984['offset']=qs['offset'](_0x52ccc5[_0x68bd('0x2e')][_0x68bd('0x19')]);}_0x566984['order']=qs[_0x68bd('0x37')](_0x52ccc5[_0x68bd('0x2e')][_0x68bd('0x37')]);_0x566984[_0x68bd('0x38')]=qs['filters'](_[_0x68bd('0x39')](_0x52ccc5['query'],_0x5306e8[_0x68bd('0x2f')]),_0x2629ea);if(_0x52ccc5[_0x68bd('0x2e')][_0x68bd('0x3a')]){_0x566984['where']=_['merge'](_0x566984['where'],{'$or':_[_0x68bd('0x28')](_0x2629ea,function(_0x368ac5){if(_0x368ac5[_0x68bd('0x2c')]!==_0x68bd('0x3b')){var _0x5817fb={};_0x5817fb[_0x368ac5['name']]={'$like':'%'+_0x52ccc5['query']['filter']+'%'};return _0x5817fb;}})});}_0x566984=_[_0x68bd('0x3c')]({},_0x566984,_0x52ccc5[_0x68bd('0x3d')]);var _0x4ab914={'where':_0x566984[_0x68bd('0x38')]};return db[_0x68bd('0x29')][_0x68bd('0x1b')](_0x4ab914)[_0x68bd('0x22')](function(_0x350841){_0x1597de[_0x68bd('0x1b')]=_0x350841;if(_0x52ccc5[_0x68bd('0x2e')]['includeAll']){_0x566984[_0x68bd('0x3e')]=[{'all':!![]}];}return db['Attachment']['findAll'](_0x566984);})[_0x68bd('0x22')](function(_0x8c1eb0){_0x1597de[_0x68bd('0x3f')]=_0x8c1eb0;return _0x1597de;})[_0x68bd('0x22')](respondWithFilteredResult(_0x177064,_0x566984))['catch'](handleError(_0x177064,null));};exports[_0x68bd('0x40')]=function(_0x2a330d,_0x16cedd){var _0x29449a={'raw':!![],'where':{'id':_0x2a330d[_0x68bd('0x41')]['id']}},_0x2de37e={};_0x2de37e[_0x68bd('0x34')]=_[_0x68bd('0x42')](db[_0x68bd('0x29')][_0x68bd('0x2a')]);_0x2de37e[_0x68bd('0x2e')]=_[_0x68bd('0x42')](_0x2a330d[_0x68bd('0x2e')]);_0x2de37e[_0x68bd('0x2f')]=_[_0x68bd('0x30')](_0x2de37e[_0x68bd('0x34')],_0x2de37e[_0x68bd('0x2e')]);_0x29449a[_0x68bd('0x31')]=_['intersection'](_0x2de37e[_0x68bd('0x34')],qs[_0x68bd('0x32')](_0x2a330d[_0x68bd('0x2e')]['fields']));_0x29449a[_0x68bd('0x31')]=_0x29449a[_0x68bd('0x31')][_0x68bd('0x33')]?_0x29449a[_0x68bd('0x31')]:_0x2de37e['model'];if(_0x2a330d[_0x68bd('0x2e')]['includeAll']){_0x29449a[_0x68bd('0x3e')]=[{'all':!![]}];}_0x29449a=_[_0x68bd('0x3c')]({},_0x29449a,_0x2a330d[_0x68bd('0x3d')]);return db[_0x68bd('0x29')][_0x68bd('0x43')](_0x29449a)['then'](handleEntityNotFound(_0x16cedd,null))[_0x68bd('0x22')](respondWithResult(_0x16cedd,null))[_0x68bd('0x44')](handleError(_0x16cedd,null));};exports[_0x68bd('0x45')]=function(_0x3e70da,_0x2f852a){var _0x14dcd0={'where':{'id':_0x3e70da[_0x68bd('0x41')]['id']}},_0x4ba707={};_0x4ba707[_0x68bd('0x34')]=_[_0x68bd('0x42')](db['Attachment'][_0x68bd('0x2a')]);_0x14dcd0[_0x68bd('0x31')]=_[_0x68bd('0x30')](_0x4ba707[_0x68bd('0x34')],qs[_0x68bd('0x32')](_0x3e70da['query'][_0x68bd('0x32')]));_0x14dcd0['attributes']=_0x14dcd0['attributes']['length']?_0x14dcd0[_0x68bd('0x31')]:_0x4ba707[_0x68bd('0x34')];if(_0x3e70da[_0x68bd('0x2e')][_0x68bd('0x46')]){_0x14dcd0['include']=[{'all':!![]}];}_0x14dcd0=_[_0x68bd('0x3c')]({},_0x14dcd0,_0x3e70da[_0x68bd('0x3d')]);return db['Attachment'][_0x68bd('0x43')](_0x14dcd0)[_0x68bd('0x22')](handleEntityNotFound(_0x2f852a,null))[_0x68bd('0x22')](function(_0x2b01ac){if(_0x2b01ac){var _0x54c882=_0x2b01ac[_0x68bd('0x47')]({'plain':!![]});_0x54c882=qs[_0x68bd('0x48')](_0x54c882,['id',_0x68bd('0x49'),_0x68bd('0x4a')]);_0x3e70da[_0x68bd('0x4b')]=_[_0x68bd('0x48')](_0x3e70da['body'],['id','createdAt',_0x68bd('0x4a')]);return db['Attachment'][_0x68bd('0x4c')](_[_0x68bd('0x3c')](_0x54c882,_0x3e70da[_0x68bd('0x4b')]),{'include':_0x3e70da['query']['includeAll']?[{'all':!![]}]:undefined});}})[_0x68bd('0x22')](respondWithResult(_0x2f852a,0xc9))[_0x68bd('0x44')](handleError(_0x2f852a,null));};exports[_0x68bd('0x4d')]=function(_0x3c59ea,_0x25e763){if(_0x3c59ea[_0x68bd('0x4b')]['id']){delete _0x3c59ea['body']['id'];}return db[_0x68bd('0x29')]['find']({'where':{'id':_0x3c59ea[_0x68bd('0x41')]['id']}})[_0x68bd('0x22')](handleEntityNotFound(_0x25e763,null))[_0x68bd('0x22')](saveUpdates(_0x3c59ea['body'],null))['then'](respondWithResult(_0x25e763,null))['catch'](handleError(_0x25e763,null));};exports[_0x68bd('0x23')]=function(_0x12ad40,_0x561edb){return db[_0x68bd('0x29')][_0x68bd('0x43')]({'where':{'id':_0x12ad40[_0x68bd('0x41')]['id']}})[_0x68bd('0x22')](handleEntityNotFound(_0x561edb,null))[_0x68bd('0x22')](removeEntity(_0x561edb,null))[_0x68bd('0x44')](handleError(_0x561edb,null));};exports['create']=function(_0x5a7ae6,_0x5dc011,_0x3073f1){_0x5a7ae6[_0x68bd('0x4b')][_0x68bd('0x26')]=_0x5a7ae6[_0x68bd('0x4e')]['originalname'];_0x5a7ae6[_0x68bd('0x4b')][_0x68bd('0x4f')]=_0x5a7ae6[_0x68bd('0x4e')][_0x68bd('0x50')];_0x5a7ae6[_0x68bd('0x4b')]['type']=_0x5a7ae6['file'][_0x68bd('0x51')];return db[_0x68bd('0x29')][_0x68bd('0x4c')](_0x5a7ae6['body'])['then'](respondWithResult(_0x5dc011,0xc9))['catch'](handleError(_0x5dc011,null));};exports[_0x68bd('0x52')]=function(_0x495282,_0xdad35,_0x201987){return db[_0x68bd('0x29')][_0x68bd('0x53')]({'where':{'id':_0x495282['params']['id']},'raw':!![]})['then'](handleEntityNotFound(_0xdad35,null))['then'](function(_0x4858e4){if(_0x4858e4){var _0x3327a2=_0x4858e4[_0x68bd('0x54')]!==null;var _0x520226=path['join'](config[_0x68bd('0x55')],_0x68bd('0x56'));if(_0x3327a2){_0x520226=path[_0x68bd('0x57')](_0x520226,_0x68bd('0x58'));}var _0x2416c8=path[_0x68bd('0x57')](_0x520226,_0x4858e4[_0x68bd('0x4f')]);return _0xdad35[_0x68bd('0x52')](_0x2416c8);}})[_0x68bd('0x44')](handleError(_0xdad35,null));};
\ No newline at end of file
+var _0x18a9=['util','path','sox','to-csv','ejs','fs-extra','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','then','destroy','error','stack','name','send','map','Attachment','rawAttributes','fieldName','type','query','filters','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filter','merge','VIRTUAL','options','include','rows','catch','show','keys','find','clone','params','includeAll','get','createdAt','updatedAt','body','create','file','originalname','basename','filename','findOne','ChatOfflineMessageId','join','root','offline-chat/','download','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache'];(function(_0x1bc954,_0x260393){var _0x740462=function(_0x45cca6){while(--_0x45cca6){_0x1bc954['push'](_0x1bc954['shift']());}};_0x740462(++_0x260393);}(_0x18a9,0x10a));var _0x918a=function(_0x3416c3,_0x314646){_0x3416c3=_0x3416c3-0x0;var _0x2934d1=_0x18a9[_0x3416c3];return _0x2934d1;};'use strict';var emlformat=require(_0x918a('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x918a('0x1'));var jsonpatch=require(_0x918a('0x2'));var rp=require(_0x918a('0x3'));var moment=require(_0x918a('0x4'));var BPromise=require(_0x918a('0x5'));var Mustache=require(_0x918a('0x6'));var util=require(_0x918a('0x7'));var path=require(_0x918a('0x8'));var sox=require(_0x918a('0x9'));var csv=require(_0x918a('0xa'));var ejs=require(_0x918a('0xb'));var fs=require('fs');var fs_extra=require(_0x918a('0xc'));var _=require('lodash');var squel=require(_0x918a('0xd'));var crypto=require(_0x918a('0xe'));var jsforce=require(_0x918a('0xf'));var deskjs=require(_0x918a('0x10'));var toCsv=require(_0x918a('0xa'));var querystring=require(_0x918a('0x11'));var Papa=require(_0x918a('0x12'));var Redis=require(_0x918a('0x13'));var authService=require('../../components/auth/service');var qs=require(_0x918a('0x14'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0x918a('0x15'))(_0x918a('0x16'));var utils=require(_0x918a('0x17'));var config=require(_0x918a('0x18'));var licenseUtil=require('../../config/license/util');var db=require(_0x918a('0x19'))['db'];function respondWithStatusCode(_0x2f4a5f,_0x5b70c0){_0x5b70c0=_0x5b70c0||0xcc;return function(_0x2fed95){if(_0x2fed95){return _0x2f4a5f[_0x918a('0x1a')](_0x5b70c0);}return _0x2f4a5f[_0x918a('0x1b')](_0x5b70c0)[_0x918a('0x1c')]();};}function respondWithResult(_0x24929b,_0x1526c3){_0x1526c3=_0x1526c3||0xc8;return function(_0x5b3b84){if(_0x5b3b84){return _0x24929b[_0x918a('0x1b')](_0x1526c3)[_0x918a('0x1d')](_0x5b3b84);}};}function respondWithFilteredResult(_0x168715,_0x2a8a81){return function(_0x577a98){if(_0x577a98){var _0x35d984=typeof _0x2a8a81[_0x918a('0x1e')]===_0x918a('0x1f')&&typeof _0x2a8a81[_0x918a('0x20')]===_0x918a('0x1f');var _0x946a30=_0x577a98[_0x918a('0x21')];var _0x983139=_0x35d984?0x0:_0x2a8a81['offset'];var _0x4811e8=_0x35d984?_0x577a98[_0x918a('0x21')]:_0x2a8a81[_0x918a('0x1e')]+_0x2a8a81[_0x918a('0x20')];var _0x18253b;if(_0x4811e8>=_0x946a30){_0x4811e8=_0x946a30;_0x18253b=0xc8;}else{_0x18253b=0xce;}_0x168715[_0x918a('0x1b')](_0x18253b);return _0x168715[_0x918a('0x22')](_0x918a('0x23'),_0x983139+'-'+_0x4811e8+'/'+_0x946a30)[_0x918a('0x1d')](_0x577a98);}return null;};}function patchUpdates(_0x452d1b){return function(_0x437718){try{jsonpatch[_0x918a('0x24')](_0x437718,_0x452d1b,!![]);}catch(_0x857384){return BPromise[_0x918a('0x25')](_0x857384);}return _0x437718[_0x918a('0x26')]();};}function saveUpdates(_0x4df845,_0x1f079a){return function(_0x3fbf4d){if(_0x3fbf4d){return _0x3fbf4d[_0x918a('0x27')](_0x4df845)[_0x918a('0x28')](function(_0x51741d){return _0x51741d;});}return null;};}function removeEntity(_0x2b896c,_0x86a7ba){return function(_0x261d83){if(_0x261d83){return _0x261d83[_0x918a('0x29')]()[_0x918a('0x28')](function(){_0x2b896c['status'](0xcc)[_0x918a('0x1c')]();});}};}function handleEntityNotFound(_0x218811,_0x1d0a70){return function(_0x3fd5ee){if(!_0x3fd5ee){_0x218811[_0x918a('0x1a')](0x194);}return _0x3fd5ee;};}function handleError(_0x5a2c0b,_0x2f0bd0){_0x2f0bd0=_0x2f0bd0||0x1f4;return function(_0x5a50b5){logger[_0x918a('0x2a')](_0x5a50b5[_0x918a('0x2b')]);if(_0x5a50b5[_0x918a('0x2c')]){delete _0x5a50b5['name'];}_0x5a2c0b[_0x918a('0x1b')](_0x2f0bd0)[_0x918a('0x2d')](_0x5a50b5);};}exports['index']=function(_0x1606fa,_0xc84ea0){var _0x5d4684={},_0x4a0328={},_0x92864e={'count':0x0,'rows':[]};var _0x4fa031=_[_0x918a('0x2e')](db[_0x918a('0x2f')][_0x918a('0x30')],function(_0x3d5f89){return{'name':_0x3d5f89[_0x918a('0x31')],'type':_0x3d5f89[_0x918a('0x32')]['key']};});_0x4a0328['model']=_[_0x918a('0x2e')](_0x4fa031,_0x918a('0x2c'));_0x4a0328[_0x918a('0x33')]=_['keys'](_0x1606fa['query']);_0x4a0328[_0x918a('0x34')]=_[_0x918a('0x35')](_0x4a0328[_0x918a('0x36')],_0x4a0328[_0x918a('0x33')]);_0x5d4684[_0x918a('0x37')]=_[_0x918a('0x35')](_0x4a0328[_0x918a('0x36')],qs[_0x918a('0x38')](_0x1606fa[_0x918a('0x33')][_0x918a('0x38')]));_0x5d4684['attributes']=_0x5d4684[_0x918a('0x37')][_0x918a('0x39')]?_0x5d4684['attributes']:_0x4a0328[_0x918a('0x36')];if(!_0x1606fa[_0x918a('0x33')][_0x918a('0x3a')](_0x918a('0x3b'))){_0x5d4684['limit']=qs['limit'](_0x1606fa['query'][_0x918a('0x20')]);_0x5d4684[_0x918a('0x1e')]=qs[_0x918a('0x1e')](_0x1606fa[_0x918a('0x33')][_0x918a('0x1e')]);}_0x5d4684[_0x918a('0x3c')]=qs[_0x918a('0x3d')](_0x1606fa[_0x918a('0x33')]['sort']);_0x5d4684[_0x918a('0x3e')]=qs[_0x918a('0x34')](_['pick'](_0x1606fa[_0x918a('0x33')],_0x4a0328[_0x918a('0x34')]),_0x4fa031);if(_0x1606fa[_0x918a('0x33')][_0x918a('0x3f')]){_0x5d4684[_0x918a('0x3e')]=_[_0x918a('0x40')](_0x5d4684[_0x918a('0x3e')],{'$or':_[_0x918a('0x2e')](_0x4fa031,function(_0x1aa709){if(_0x1aa709[_0x918a('0x32')]!==_0x918a('0x41')){var _0x966a34={};_0x966a34[_0x1aa709[_0x918a('0x2c')]]={'$like':'%'+_0x1606fa[_0x918a('0x33')][_0x918a('0x3f')]+'%'};return _0x966a34;}})});}_0x5d4684=_[_0x918a('0x40')]({},_0x5d4684,_0x1606fa[_0x918a('0x42')]);var _0x19524f={'where':_0x5d4684[_0x918a('0x3e')]};return db[_0x918a('0x2f')][_0x918a('0x21')](_0x19524f)['then'](function(_0xfab053){_0x92864e[_0x918a('0x21')]=_0xfab053;if(_0x1606fa['query']['includeAll']){_0x5d4684[_0x918a('0x43')]=[{'all':!![]}];}return db[_0x918a('0x2f')]['findAll'](_0x5d4684);})[_0x918a('0x28')](function(_0x18317e){_0x92864e[_0x918a('0x44')]=_0x18317e;return _0x92864e;})['then'](respondWithFilteredResult(_0xc84ea0,_0x5d4684))[_0x918a('0x45')](handleError(_0xc84ea0,null));};exports[_0x918a('0x46')]=function(_0x4b4369,_0x1789f7){var _0x5a8d12={'raw':!![],'where':{'id':_0x4b4369['params']['id']}},_0x29f885={};_0x29f885['model']=_[_0x918a('0x47')](db[_0x918a('0x2f')][_0x918a('0x30')]);_0x29f885['query']=_[_0x918a('0x47')](_0x4b4369[_0x918a('0x33')]);_0x29f885[_0x918a('0x34')]=_[_0x918a('0x35')](_0x29f885[_0x918a('0x36')],_0x29f885[_0x918a('0x33')]);_0x5a8d12['attributes']=_[_0x918a('0x35')](_0x29f885[_0x918a('0x36')],qs[_0x918a('0x38')](_0x4b4369[_0x918a('0x33')]['fields']));_0x5a8d12[_0x918a('0x37')]=_0x5a8d12[_0x918a('0x37')][_0x918a('0x39')]?_0x5a8d12[_0x918a('0x37')]:_0x29f885['model'];if(_0x4b4369[_0x918a('0x33')]['includeAll']){_0x5a8d12['include']=[{'all':!![]}];}_0x5a8d12=_[_0x918a('0x40')]({},_0x5a8d12,_0x4b4369[_0x918a('0x42')]);return db[_0x918a('0x2f')][_0x918a('0x48')](_0x5a8d12)[_0x918a('0x28')](handleEntityNotFound(_0x1789f7,null))[_0x918a('0x28')](respondWithResult(_0x1789f7,null))[_0x918a('0x45')](handleError(_0x1789f7,null));};exports[_0x918a('0x49')]=function(_0x4be11d,_0x4d3782){var _0x1b32cd={'where':{'id':_0x4be11d[_0x918a('0x4a')]['id']}},_0x4b429a={};_0x4b429a[_0x918a('0x36')]=_['keys'](db['Attachment'][_0x918a('0x30')]);_0x1b32cd[_0x918a('0x37')]=_[_0x918a('0x35')](_0x4b429a['model'],qs[_0x918a('0x38')](_0x4be11d[_0x918a('0x33')][_0x918a('0x38')]));_0x1b32cd['attributes']=_0x1b32cd[_0x918a('0x37')][_0x918a('0x39')]?_0x1b32cd[_0x918a('0x37')]:_0x4b429a[_0x918a('0x36')];if(_0x4be11d[_0x918a('0x33')][_0x918a('0x4b')]){_0x1b32cd[_0x918a('0x43')]=[{'all':!![]}];}_0x1b32cd=_[_0x918a('0x40')]({},_0x1b32cd,_0x4be11d[_0x918a('0x42')]);return db[_0x918a('0x2f')][_0x918a('0x48')](_0x1b32cd)['then'](handleEntityNotFound(_0x4d3782,null))[_0x918a('0x28')](function(_0x36c00b){if(_0x36c00b){var _0x9981a5=_0x36c00b[_0x918a('0x4c')]({'plain':!![]});_0x9981a5=qs['omit'](_0x9981a5,['id',_0x918a('0x4d'),_0x918a('0x4e')]);_0x4be11d['body']=_['omit'](_0x4be11d[_0x918a('0x4f')],['id',_0x918a('0x4d'),_0x918a('0x4e')]);return db[_0x918a('0x2f')][_0x918a('0x50')](_[_0x918a('0x40')](_0x9981a5,_0x4be11d['body']),{'include':_0x4be11d['query'][_0x918a('0x4b')]?[{'all':!![]}]:undefined});}})['then'](respondWithResult(_0x4d3782,0xc9))[_0x918a('0x45')](handleError(_0x4d3782,null));};exports[_0x918a('0x27')]=function(_0x39035e,_0x3ffa30){if(_0x39035e[_0x918a('0x4f')]['id']){delete _0x39035e[_0x918a('0x4f')]['id'];}return db[_0x918a('0x2f')][_0x918a('0x48')]({'where':{'id':_0x39035e['params']['id']}})[_0x918a('0x28')](handleEntityNotFound(_0x3ffa30,null))['then'](saveUpdates(_0x39035e[_0x918a('0x4f')],null))[_0x918a('0x28')](respondWithResult(_0x3ffa30,null))[_0x918a('0x45')](handleError(_0x3ffa30,null));};exports['destroy']=function(_0xe44659,_0x394e35){return db[_0x918a('0x2f')][_0x918a('0x48')]({'where':{'id':_0xe44659[_0x918a('0x4a')]['id']}})['then'](handleEntityNotFound(_0x394e35,null))['then'](removeEntity(_0x394e35,null))[_0x918a('0x45')](handleError(_0x394e35,null));};exports['create']=function(_0x21d759,_0x3f0d87,_0x18280a){_0x21d759[_0x918a('0x4f')][_0x918a('0x2c')]=_0x21d759[_0x918a('0x51')][_0x918a('0x52')];_0x21d759['body'][_0x918a('0x53')]=_0x21d759[_0x918a('0x51')][_0x918a('0x54')];_0x21d759[_0x918a('0x4f')][_0x918a('0x32')]=_0x21d759['file']['mimetype'];return db[_0x918a('0x2f')][_0x918a('0x50')](_0x21d759['body'])['then'](respondWithResult(_0x3f0d87,0xc9))[_0x918a('0x45')](handleError(_0x3f0d87,null));};exports['download']=function(_0x3c8ce2,_0x1f0705,_0x282f46){return db[_0x918a('0x2f')][_0x918a('0x55')]({'where':{'id':_0x3c8ce2[_0x918a('0x4a')]['id']},'raw':!![]})[_0x918a('0x28')](handleEntityNotFound(_0x1f0705,null))[_0x918a('0x28')](function(_0x240bdc){if(_0x240bdc){var _0x320a86=_0x240bdc[_0x918a('0x56')]!==null;var _0x40efa0=path[_0x918a('0x57')](config[_0x918a('0x58')],'server/files/attachments/');if(_0x320a86){_0x40efa0=path['join'](_0x40efa0,_0x918a('0x59'));}var _0x88259=path[_0x918a('0x57')](_0x40efa0,_0x240bdc[_0x918a('0x53')]);return _0x1f0705[_0x918a('0x5a')](_0x88259);}})[_0x918a('0x45')](handleError(_0x1f0705,null));};
\ No newline at end of file
diff --git a/server/api/attachment/attachment.model.js b/server/api/attachment/attachment.model.js
index 8e9bc9b..7252243 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 _0xb46a=['attachments','lodash','util','../../config/logger','moment','bluebird','path','rimraf','./attachment.attributes','exports','define','Attachment'];(function(_0x2d3a13,_0x19e6cc){var _0x135fa2=function(_0x2da2ac){while(--_0x2da2ac){_0x2d3a13['push'](_0x2d3a13['shift']());}};_0x135fa2(++_0x19e6cc);}(_0xb46a,0x1d5));var _0xab46=function(_0x5e5cb6,_0x2feed4){_0x5e5cb6=_0x5e5cb6-0x0;var _0x119d54=_0xb46a[_0x5e5cb6];return _0x119d54;};'use strict';var _=require(_0xab46('0x0'));var util=require(_0xab46('0x1'));var logger=require(_0xab46('0x2'))('api');var moment=require(_0xab46('0x3'));var BPromise=require(_0xab46('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xab46('0x5'));var rimraf=require(_0xab46('0x6'));var config=require('../../config/environment');var attributes=require(_0xab46('0x7'));module[_0xab46('0x8')]=function(_0x11aca4,_0x4510f8){return _0x11aca4[_0xab46('0x9')](_0xab46('0xa'),attributes,{'tableName':_0xab46('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x86f2=['exports','lodash','util','../../config/logger','api','moment','request-promise','path','../../config/environment','./attachment.attributes'];(function(_0x21e886,_0x20dcd2){var _0x5c5b67=function(_0x33cf7b){while(--_0x33cf7b){_0x21e886['push'](_0x21e886['shift']());}};_0x5c5b67(++_0x20dcd2);}(_0x86f2,0x1eb));var _0x286f=function(_0x3947c9,_0x4d6c97){_0x3947c9=_0x3947c9-0x0;var _0x2e7871=_0x86f2[_0x3947c9];return _0x2e7871;};'use strict';var _=require(_0x286f('0x0'));var util=require(_0x286f('0x1'));var logger=require(_0x286f('0x2'))(_0x286f('0x3'));var moment=require(_0x286f('0x4'));var BPromise=require('bluebird');var rp=require(_0x286f('0x5'));var fs=require('fs');var path=require(_0x286f('0x6'));var rimraf=require('rimraf');var config=require(_0x286f('0x7'));var attributes=require(_0x286f('0x8'));module[_0x286f('0x9')]=function(_0x48d05e,_0x52257d){return _0x48d05e['define']('Attachment',attributes,{'tableName':'attachments','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 4c28d5d..7d83eab 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 _0x136c=['message','catch','CreateAttachment','Attachment','body','options','raw','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','info','Attachment,\x20%s,\x20%s','request\x20sent','debug','Attachment,\x20%s,\x20%s,\x20%s','stringify','error'];(function(_0x35629e,_0x28e7f5){var _0x220fbf=function(_0x198761){while(--_0x198761){_0x35629e['push'](_0x35629e['shift']());}};_0x220fbf(++_0x28e7f5);}(_0x136c,0x1d2));var _0xc136=function(_0x30188f,_0x2bc726){_0x30188f=_0x30188f-0x0;var _0x14afa4=_0x136c[_0x30188f];return _0x14afa4;};'use strict';var _=require(_0xc136('0x0'));var util=require(_0xc136('0x1'));var moment=require('moment');var BPromise=require(_0xc136('0x2'));var rs=require(_0xc136('0x3'));var fs=require('fs');var Redis=require(_0xc136('0x4'));var db=require(_0xc136('0x5'))['db'];var utils=require(_0xc136('0x6'));var logger=require(_0xc136('0x7'))(_0xc136('0x8'));var config=require(_0xc136('0x9'));var jayson=require(_0xc136('0xa'));var client=jayson['client'][_0xc136('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x594112,_0x361a52,_0x3993f2){return new BPromise(function(_0x1804c1,_0x500376){return client[_0xc136('0xc')](_0x594112,_0x3993f2)['then'](function(_0x1ea07d){logger[_0xc136('0xd')](_0xc136('0xe'),_0x361a52,_0xc136('0xf'));logger[_0xc136('0x10')](_0xc136('0x11'),_0x361a52,_0xc136('0xf'),JSON[_0xc136('0x12')](_0x1ea07d));if(_0x1ea07d[_0xc136('0x13')]){if(_0x1ea07d['error']['code']===0x1f4){logger[_0xc136('0x13')]('Attachment,\x20%s,\x20%s',_0x361a52,_0x1ea07d[_0xc136('0x13')][_0xc136('0x14')]);return _0x500376(_0x1ea07d[_0xc136('0x13')]['message']);}logger['error'](_0xc136('0xe'),_0x361a52,_0x1ea07d[_0xc136('0x13')][_0xc136('0x14')]);return _0x1804c1(_0x1ea07d['error']['message']);}else{logger[_0xc136('0xd')](_0xc136('0xe'),_0x361a52,'request\x20sent');_0x1804c1(_0x1ea07d['result']['message']);}})[_0xc136('0x15')](function(_0x3daf55){logger[_0xc136('0x13')](_0xc136('0xe'),_0x361a52,_0x3daf55);_0x500376(_0x3daf55);});});}exports[_0xc136('0x16')]=function(_0x1ccf5f){var _0x59503b=this;return new Promise(function(_0x5df9b7,_0x4d56cb){return db[_0xc136('0x17')]['create'](_0x1ccf5f[_0xc136('0x18')],{'raw':_0x1ccf5f[_0xc136('0x19')]?_0x1ccf5f[_0xc136('0x19')][_0xc136('0x1a')]===undefined?!![]:![]:!![]})['then'](function(_0x2b8527){logger[_0xc136('0xd')]('CreateAttachment',_0x1ccf5f);logger[_0xc136('0x10')]('CreateAttachment',_0x1ccf5f,JSON['stringify'](_0x2b8527));_0x5df9b7(_0x2b8527);})[_0xc136('0x15')](function(_0x1a350a){logger['error'](_0xc136('0x16'),_0x1a350a[_0xc136('0x14')],_0x1ccf5f);_0x4d56cb(_0x59503b[_0xc136('0x13')](0x1f4,_0x1a350a[_0xc136('0x14')]));});});};
\ No newline at end of file
+var _0x2750=['ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then','Attachment,\x20%s,\x20%s','debug','Attachment,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','info','result','catch','Attachment','body','options','CreateAttachment','lodash','moment','bluebird','randomstring'];(function(_0x274de9,_0x2d40ef){var _0x442761=function(_0x3cd3d7){while(--_0x3cd3d7){_0x274de9['push'](_0x274de9['shift']());}};_0x442761(++_0x2d40ef);}(_0x2750,0x13b));var _0x0275=function(_0x5f08a8,_0x4b8709){_0x5f08a8=_0x5f08a8-0x0;var _0x1cbf0d=_0x2750[_0x5f08a8];return _0x1cbf0d;};'use strict';var _=require(_0x0275('0x0'));var util=require('util');var moment=require(_0x0275('0x1'));var BPromise=require(_0x0275('0x2'));var rs=require(_0x0275('0x3'));var fs=require('fs');var Redis=require(_0x0275('0x4'));var db=require(_0x0275('0x5'))['db'];var utils=require(_0x0275('0x6'));var logger=require(_0x0275('0x7'))(_0x0275('0x8'));var config=require(_0x0275('0x9'));var jayson=require(_0x0275('0xa'));var client=jayson['client'][_0x0275('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x2421fd,_0x2fa0eb,_0x2e4b5c){return new BPromise(function(_0x4dffd1,_0x1f7c4a){return client[_0x0275('0xc')](_0x2421fd,_0x2e4b5c)[_0x0275('0xd')](function(_0x5e0e4a){logger['info'](_0x0275('0xe'),_0x2fa0eb,'request\x20sent');logger[_0x0275('0xf')](_0x0275('0x10'),_0x2fa0eb,_0x0275('0x11'),JSON[_0x0275('0x12')](_0x5e0e4a));if(_0x5e0e4a[_0x0275('0x13')]){if(_0x5e0e4a['error'][_0x0275('0x14')]===0x1f4){logger[_0x0275('0x13')](_0x0275('0xe'),_0x2fa0eb,_0x5e0e4a['error']['message']);return _0x1f7c4a(_0x5e0e4a[_0x0275('0x13')][_0x0275('0x15')]);}logger[_0x0275('0x13')](_0x0275('0xe'),_0x2fa0eb,_0x5e0e4a[_0x0275('0x13')][_0x0275('0x15')]);return _0x4dffd1(_0x5e0e4a['error'][_0x0275('0x15')]);}else{logger[_0x0275('0x16')]('Attachment,\x20%s,\x20%s',_0x2fa0eb,_0x0275('0x11'));_0x4dffd1(_0x5e0e4a[_0x0275('0x17')]['message']);}})[_0x0275('0x18')](function(_0x31c76b){logger['error']('Attachment,\x20%s,\x20%s',_0x2fa0eb,_0x31c76b);_0x1f7c4a(_0x31c76b);});});}exports['CreateAttachment']=function(_0x591d27){var _0x5b8746=this;return new Promise(function(_0x566ad6,_0x44f7b0){return db[_0x0275('0x19')]['create'](_0x591d27[_0x0275('0x1a')],{'raw':_0x591d27[_0x0275('0x1b')]?_0x591d27[_0x0275('0x1b')]['raw']===undefined?!![]:![]:!![]})[_0x0275('0xd')](function(_0x402f0d){logger['info']('CreateAttachment',_0x591d27);logger[_0x0275('0xf')](_0x0275('0x1c'),_0x591d27,JSON[_0x0275('0x12')](_0x402f0d));_0x566ad6(_0x402f0d);})['catch'](function(_0xf3b68e){logger['error'](_0x0275('0x1c'),_0xf3b68e['message'],_0x591d27);_0x44f7b0(_0x5b8746[_0x0275('0x13')](0x1f4,_0xf3b68e[_0x0275('0x15')]));});});};
\ No newline at end of file
diff --git a/server/api/attachment/index.js b/server/api/attachment/index.js
index 5bf87db..5a568f9 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(_0xa464c9,_0x7c86d8){var _0x3d73c4=function(_0x5c2056){while(--_0x5c2056){_0xa464c9['push'](_0xa464c9['shift']());}};_0x3d73c4(++_0x7c86d8);}(_0x0b0e,0x187));var _0xe0b0=function(_0x2e0ffa,_0x451f12){_0x2e0ffa=_0x2e0ffa-0x0;var _0x24d627=_0x0b0e[_0x2e0ffa];return _0x24d627;};'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 _0x5f2f=['show','/:id/download','download','post','/:id/clone','clone','root','server/files/attachments/','format','now','originalname','replace','single','create','put','update','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','./attachment.controller','get','isAuthenticated','index','/:id'];(function(_0x5c5148,_0x49acc7){var _0x2ec4ed=function(_0x2144b1){while(--_0x2144b1){_0x5c5148['push'](_0x5c5148['shift']());}};_0x2ec4ed(++_0x49acc7);}(_0x5f2f,0x73));var _0xf5f2=function(_0x31f79b,_0xa6f57){_0x31f79b=_0x31f79b-0x0;var _0x521729=_0x5f2f[_0x31f79b];return _0x521729;};'use strict';var multer=require(_0xf5f2('0x0'));var util=require(_0xf5f2('0x1'));var path=require(_0xf5f2('0x2'));var timeout=require(_0xf5f2('0x3'));var express=require(_0xf5f2('0x4'));var router=express[_0xf5f2('0x5')]();var fs_extra=require(_0xf5f2('0x6'));var auth=require(_0xf5f2('0x7'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0xf5f2('0x8'));router[_0xf5f2('0x9')]('/',auth[_0xf5f2('0xa')](),controller[_0xf5f2('0xb')]);router[_0xf5f2('0x9')](_0xf5f2('0xc'),auth['isAuthenticated'](),controller[_0xf5f2('0xd')]);router[_0xf5f2('0x9')](_0xf5f2('0xe'),auth['isAuthenticated'](),controller[_0xf5f2('0xf')]);router[_0xf5f2('0x10')](_0xf5f2('0x11'),auth['isAuthenticated'](),controller[_0xf5f2('0x12')]);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x53fb33,_0xa7e1a6,_0x151aba){_0x151aba(null,path['join'](config[_0xf5f2('0x13')],_0xf5f2('0x14')));},'filename':function(_0x331482,_0x3f2997,_0x59bb6c){_0x59bb6c(null,util[_0xf5f2('0x15')]('%s-%s',Date[_0xf5f2('0x16')](),_0x3f2997[_0xf5f2('0x17')][_0xf5f2('0x18')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-')));}})});router[_0xf5f2('0x10')]('/',upload[_0xf5f2('0x19')]('file'),controller[_0xf5f2('0x1a')]);router[_0xf5f2('0x1b')](_0xf5f2('0xc'),auth[_0xf5f2('0xa')](),controller[_0xf5f2('0x1c')]);router[_0xf5f2('0x1d')](_0xf5f2('0xc'),auth[_0xf5f2('0xa')](),controller[_0xf5f2('0x1e')]);module[_0xf5f2('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 dea14e9..1add881 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 _0x3286=['profile','email','callback','/login','use','clientID','clientSecret','findOne','allowedLoginAttempts','blockDuration','then','User','find','map','emails','value','admin','agent','disabled','Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.','blocked','blockedAt','add','minutes','getLicense','catch','passport-google-oauth20','Strategy','../../config/environment','../../components/auth/service','signToken','../../config/utils','authenticate','google'];(function(_0x2d97ce,_0x23a807){var _0xcefa01=function(_0x232ede){while(--_0x232ede){_0x2d97ce['push'](_0x2d97ce['shift']());}};_0xcefa01(++_0x23a807);}(_0x3286,0xc4));var _0x6328=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x3286[_0x3dd15e];return _0x231fd0;};'use strict';var _=require('lodash');var passport=require('passport');var GoogleStrategy=require(_0x6328('0x0'))[_0x6328('0x1')];var moment=require('moment');var db=require('../../mysqldb')['db'];var config=require(_0x6328('0x2'));var signToken=require(_0x6328('0x3'))[_0x6328('0x4')];var utils=require(_0x6328('0x5'));exports['login']=passport[_0x6328('0x6')](_0x6328('0x7'),{'failureRedirect':'/login','scope':[_0x6328('0x8'),_0x6328('0x9')],'session':![]});exports[_0x6328('0xa')]=passport['authenticate'](_0x6328('0x7'),{'failureRedirect':_0x6328('0xb'),'session':![]});passport[_0x6328('0xc')](new GoogleStrategy({'clientID':config[_0x6328('0x7')]?config[_0x6328('0x7')][_0x6328('0xd')]:'id','clientSecret':config['google']?config['google'][_0x6328('0xe')]:'secret','callbackURL':config['google']?config['google']['callbackURL']:''},function(_0xc8caa1,_0x4c3694,_0x379071,_0x19c833){var _0x39e83f,_0x56cfc5;return db['Setting'][_0x6328('0xf')]({'where':{'id':0x1},'attributes':[_0x6328('0x10'),_0x6328('0x11')],'raw':!![]})[_0x6328('0x12')](function(_0x4dd61f){_0x39e83f=_0x4dd61f;return db[_0x6328('0x13')][_0x6328('0x14')]({'where':{'email':_[_0x6328('0x15')](_0x379071[_0x6328('0x16')],_0x6328('0x17')),'role':{'$or':[_0x6328('0x18'),'user',_0x6328('0x19')]}}});})[_0x6328('0x12')](function(_0x3c523f){_0x56cfc5=_0x3c523f;if(_0x56cfc5){if(_0x56cfc5[_0x6328('0x1a')]){return _0x19c833(_0x6328('0x1b'));}else if(_0x39e83f[_0x6328('0x11')]>0x0){if(_0x56cfc5[_0x6328('0x1c')]){if(moment(_0x56cfc5[_0x6328('0x1d')])[_0x6328('0x1e')](_0x39e83f[_0x6328('0x11')],_0x6328('0x1f'))>moment()){return _0x19c833(_0x6328('0x1b'));}else{return utils['clearBlockUser'](_0x56cfc5,0x0,![],null)['then'](function(){return utils[_0x6328('0x20')](_0x56cfc5);})['then'](function(){return _0x19c833(null,_0x56cfc5);});}}else{return utils[_0x6328('0x20')](_0x56cfc5)[_0x6328('0x12')](function(){return _0x19c833(null,_0x56cfc5);});}}else{return utils['getLicense'](_0x56cfc5)[_0x6328('0x12')](function(){return _0x19c833(null,_0x56cfc5);});}}return _0x19c833('Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.');})[_0x6328('0x21')](function(_0x396acd){_0x19c833(_0x396acd);});}));
\ No newline at end of file
+var _0xecca=['email','callback','clientID','clientSecret','callbackURL','Setting','findOne','allowedLoginAttempts','blockDuration','then','User','find','value','admin','user','agent','Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.','blocked','blockedAt','add','minutes','clearBlockUser','getLicense','catch','lodash','passport-google-oauth20','moment','../../mysqldb','../../config/environment','../../components/auth/service','signToken','../../config/utils','authenticate','google','/login','profile'];(function(_0x5de1bc,_0x434be1){var _0x19f4b8=function(_0x35f764){while(--_0x35f764){_0x5de1bc['push'](_0x5de1bc['shift']());}};_0x19f4b8(++_0x434be1);}(_0xecca,0x138));var _0xaecc=function(_0x243b2f,_0x30aa15){_0x243b2f=_0x243b2f-0x0;var _0xcb3c2d=_0xecca[_0x243b2f];return _0xcb3c2d;};'use strict';var _=require(_0xaecc('0x0'));var passport=require('passport');var GoogleStrategy=require(_0xaecc('0x1'))['Strategy'];var moment=require(_0xaecc('0x2'));var db=require(_0xaecc('0x3'))['db'];var config=require(_0xaecc('0x4'));var signToken=require(_0xaecc('0x5'))[_0xaecc('0x6')];var utils=require(_0xaecc('0x7'));exports['login']=passport[_0xaecc('0x8')](_0xaecc('0x9'),{'failureRedirect':_0xaecc('0xa'),'scope':[_0xaecc('0xb'),_0xaecc('0xc')],'session':![]});exports[_0xaecc('0xd')]=passport[_0xaecc('0x8')](_0xaecc('0x9'),{'failureRedirect':_0xaecc('0xa'),'session':![]});passport['use'](new GoogleStrategy({'clientID':config[_0xaecc('0x9')]?config['google'][_0xaecc('0xe')]:'id','clientSecret':config['google']?config['google'][_0xaecc('0xf')]:'secret','callbackURL':config[_0xaecc('0x9')]?config[_0xaecc('0x9')][_0xaecc('0x10')]:''},function(_0x260cde,_0x547230,_0x48bdf3,_0x2411e3){var _0x387684,_0x12b1af;return db[_0xaecc('0x11')][_0xaecc('0x12')]({'where':{'id':0x1},'attributes':[_0xaecc('0x13'),_0xaecc('0x14')],'raw':!![]})[_0xaecc('0x15')](function(_0xe07e16){_0x387684=_0xe07e16;return db[_0xaecc('0x16')][_0xaecc('0x17')]({'where':{'email':_['map'](_0x48bdf3['emails'],_0xaecc('0x18')),'role':{'$or':[_0xaecc('0x19'),_0xaecc('0x1a'),_0xaecc('0x1b')]}}});})[_0xaecc('0x15')](function(_0x2ac78f){_0x12b1af=_0x2ac78f;if(_0x12b1af){if(_0x12b1af['disabled']){return _0x2411e3(_0xaecc('0x1c'));}else if(_0x387684['blockDuration']>0x0){if(_0x12b1af[_0xaecc('0x1d')]){if(moment(_0x12b1af[_0xaecc('0x1e')])[_0xaecc('0x1f')](_0x387684[_0xaecc('0x14')],_0xaecc('0x20'))>moment()){return _0x2411e3(_0xaecc('0x1c'));}else{return utils[_0xaecc('0x21')](_0x12b1af,0x0,![],null)[_0xaecc('0x15')](function(){return utils[_0xaecc('0x22')](_0x12b1af);})[_0xaecc('0x15')](function(){return _0x2411e3(null,_0x12b1af);});}}else{return utils[_0xaecc('0x22')](_0x12b1af)[_0xaecc('0x15')](function(){return _0x2411e3(null,_0x12b1af);});}}else{return utils[_0xaecc('0x22')](_0x12b1af)[_0xaecc('0x15')](function(){return _0x2411e3(null,_0x12b1af);});}}return _0x2411e3('Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.');})[_0xaecc('0x23')](function(_0xddfca1){_0x2411e3(_0xddfca1);});}));
\ No newline at end of file
diff --git a/server/api/authGoogle/index.js b/server/api/authGoogle/index.js
index 6a685b2..751759d 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 _0xcb4d=['/callback','callback','isMiddleware','setTokenCookie','express','passport','Router','./authGoogle.controller','../../components/auth/service','get'];(function(_0x28abb4,_0x350833){var _0x5ed3da=function(_0x1d4357){while(--_0x1d4357){_0x28abb4['push'](_0x28abb4['shift']());}};_0x5ed3da(++_0x350833);}(_0xcb4d,0x68));var _0xdcb4=function(_0x20d2e9,_0x49664e){_0x20d2e9=_0x20d2e9-0x0;var _0x56d870=_0xcb4d[_0x20d2e9];return _0x56d870;};'use strict';var express=require(_0xdcb4('0x0'));var passport=require(_0xdcb4('0x1'));var router=express[_0xdcb4('0x2')]();var controller=require(_0xdcb4('0x3'));var userController=require('../user/user.controller.js');var authService=require(_0xdcb4('0x4'));router['get']('/',controller['login']);router[_0xdcb4('0x5')](_0xdcb4('0x6'),controller[_0xdcb4('0x7')],authService[_0xdcb4('0x8')],userController['login'],authService[_0xdcb4('0x9')]);module['exports']=router;
\ No newline at end of file
+var _0xf69b=['./authGoogle.controller','../user/user.controller.js','../../components/auth/service','get','/callback','isMiddleware','login','setTokenCookie','passport','Router'];(function(_0x5ee3d3,_0x537c30){var _0x4b272f=function(_0x3dc277){while(--_0x3dc277){_0x5ee3d3['push'](_0x5ee3d3['shift']());}};_0x4b272f(++_0x537c30);}(_0xf69b,0x1e8));var _0xbf69=function(_0x5417ba,_0x1f52df){_0x5417ba=_0x5417ba-0x0;var _0x42660f=_0xf69b[_0x5417ba];return _0x42660f;};'use strict';var express=require('express');var passport=require(_0xbf69('0x0'));var router=express[_0xbf69('0x1')]();var controller=require(_0xbf69('0x2'));var userController=require(_0xbf69('0x3'));var authService=require(_0xbf69('0x4'));router[_0xbf69('0x5')]('/',controller['login']);router[_0xbf69('0x5')](_0xbf69('0x6'),controller['callback'],authService[_0xbf69('0x7')],userController[_0xbf69('0x8')],authService[_0xbf69('0x9')]);module['exports']=router;
\ No newline at end of file
diff --git a/server/api/authLocal/authLocal.controller.js b/server/api/authLocal/authLocal.controller.js
index 446f461..e067190 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 _0x8318=['now','Password\x20reset\x20token\x20is\x20invalid\x20or\x20has\x20expired.','findOne','securePassword','enforcePasswordHistory','passwordHistoryLimit','validatePasswordPattern','password','validatePasswordHistory','previousPasswords','Password\x20reset!','use','util','passport','passport-local','Strategy','jayson/promise','lodash','randomstring','../../mysqldb','../../config/utils','client','http','Setting','blockDuration','then','name','salt','disabled','blocked','blockedAt','admin','user','agent','Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.','loginAttempts','allowedLoginAttempts','add','minutes','clearBlockUser','getLicense','catch','MailAccount','MailServerOut','Smtp','service','host','port','secure','authentication','auth','pass','merge','format','\x22%s\x22\x20<%s>','request','SendMail','error','SendMail\x20error:\x20%s.\x20Please\x20contact\x20your\x20Administrator!','message','stringify','send','login','authenticate','local','Something\x20went\x20wrong,\x20please\x20try\x20again.','role','signToken','json','online','forgot','email','Email\x20parameter\x20is\x20missing','generate','body','trim','toLowerCase','User','find','This\x20email\x20is\x20not\x20registered.','The\x20user\x20is\x20blocked.\x20Please\x20contact\x20the\x20administrator.','resetPasswordToken','resetPasswordExpires','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','https://','headers','If\x20you\x20did\x20not\x20request\x20this,\x20please\x20ignore\x20this\x20email\x20and\x20your\x20password\x20will\x20remain\x20unchanged.\x0a','status','reset','params','token'];(function(_0x1abeb2,_0x79f462){var _0x48da20=function(_0x42a90b){while(--_0x42a90b){_0x1abeb2['push'](_0x1abeb2['shift']());}};_0x48da20(++_0x79f462);}(_0x8318,0x6a));var _0x8831=function(_0x520ce8,_0x445e56){_0x520ce8=_0x520ce8-0x0;var _0x64369e=_0x8318[_0x520ce8];return _0x64369e;};'use strict';var util=require(_0x8831('0x0'));var passport=require(_0x8831('0x1'));var LocalStrategy=require(_0x8831('0x2'))[_0x8831('0x3')];var jayson=require(_0x8831('0x4'));var _=require(_0x8831('0x5'));var rs=require(_0x8831('0x6'));var moment=require('moment');var db=require(_0x8831('0x7'))['db'];var authService=require('../../components/auth/service');var utils=require(_0x8831('0x8'));var client=jayson[_0x8831('0x9')][_0x8831('0xa')]({'port':0x232b});function localAuthenticate(_0x1781d7,_0x28d1a3,_0x528526,_0xc6e9a){var _0x52054c,_0x13628f;return db[_0x8831('0xb')]['findOne']({'where':{'id':0x1},'attributes':['allowedLoginAttempts',_0x8831('0xc')],'raw':!![]})[_0x8831('0xd')](function(_0x22c096){_0x52054c=_0x22c096;return _0x1781d7['findOne']({'attributes':['id',_0x8831('0xe'),'password',_0x8831('0xf'),'role',_0x8831('0x10'),_0x8831('0x11'),_0x8831('0x12'),'loginAttempts'],'where':{'name':_0x28d1a3,'role':{'$or':[_0x8831('0x13'),_0x8831('0x14'),_0x8831('0x15')]}}});})[_0x8831('0xd')](function(_0x6bf66e){if(!_0x6bf66e||_0x6bf66e&&_0x6bf66e['name']!==_0x28d1a3){throw new Error(_0x8831('0x16'));}else{_0x13628f=_0x6bf66e;return _0x13628f;}})['then'](function(){_0x13628f['authenticate'](_0x528526,function(_0x3f3129,_0x55bdbe){var _0x1343bc=_0x13628f[_0x8831('0x17')]+0x1;if(_0x3f3129){return _0xc6e9a(_0x3f3129);}else if(!_0x55bdbe){if(_0x13628f['disabled']){return _0xc6e9a(null,![],{'message':_0x8831('0x16')});}else if(_0x52054c[_0x8831('0x18')]>0x0){if(_0x13628f[_0x8831('0x11')]){if(_0x52054c[_0x8831('0xc')]>0x0){if(moment(_0x13628f[_0x8831('0x12')])[_0x8831('0x19')](_0x52054c[_0x8831('0xc')],_0x8831('0x1a'))>moment()){return _0xc6e9a(null,![],{'message':_0x8831('0x16')});}else{return utils['clearBlockUser'](_0x13628f,_0x1343bc,![],null)['then'](function(){return _0xc6e9a(null,![],{'message':_0x8831('0x16')});});}}else{return _0xc6e9a(null,![],{'message':_0x8831('0x16')});}}else{if(_0x1343bc>=_0x52054c['allowedLoginAttempts']){return utils[_0x8831('0x1b')](_0x13628f,0x0,!![],moment())['then'](function(){return _0xc6e9a(null,![],{'message':_0x8831('0x16')});});}else{return utils[_0x8831('0x1b')](_0x13628f,_0x1343bc,![],null)[_0x8831('0xd')](function(){return _0xc6e9a(null,![],{'message':_0x8831('0x16')});});}}}else{return _0xc6e9a(null,![],{'message':_0x8831('0x16')});}}else{if(_0x13628f['disabled']){return _0xc6e9a(null,![],{'message':_0x8831('0x16')});}else if(_0x52054c[_0x8831('0x18')]>0x0){if(_0x13628f['blocked']){if(_0x52054c['blockDuration']>0x0){if(moment(_0x13628f[_0x8831('0x12')])[_0x8831('0x19')](_0x52054c['blockDuration'],_0x8831('0x1a'))>moment()){return _0xc6e9a(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});}else{return utils['clearBlockUser'](_0x13628f,0x0,![],null)[_0x8831('0xd')](function(){return utils[_0x8831('0x1c')](_0x13628f);})[_0x8831('0xd')](function(){return _0xc6e9a(null,_0x13628f);});}}else{return _0xc6e9a(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});}}else{return utils[_0x8831('0x1b')](_0x13628f,0x0,![],null)[_0x8831('0xd')](function(){return utils['getLicense'](_0x13628f);})['then'](function(){return _0xc6e9a(null,_0x13628f);})['catch'](function(_0x18d34e){return _0xc6e9a(null,![],_0x18d34e);});}}else{if(_0x13628f['blocked']){return _0xc6e9a(null,![],{'message':_0x8831('0x16')});}else{return utils['getLicense'](_0x13628f)['then'](function(){return _0xc6e9a(null,_0x13628f);});}}}});})[_0x8831('0x1d')](function(_0x193542){return _0xc6e9a(null,![],_0x193542);});}function sendServiceMail(_0x33d18a){return db[_0x8831('0x1e')]['find']({'where':{'service':!![]},'attributes':['id',_0x8831('0xe'),'email'],'include':[{'model':db[_0x8831('0x1f')],'as':'Smtp'}]})[_0x8831('0xd')](function(_0x39be90){if(!_0x39be90){throw new Error('Unable\x20to\x20find\x20a\x20configured\x20SMTP\x20service!');}var _0x5700ac={'tls':{'rejectUnauthorized':![]}};if(_0x39be90[_0x8831('0x20')][_0x8831('0x21')]){_0x5700ac['service']=_0x39be90[_0x8831('0x20')][_0x8831('0x21')];}else{_0x5700ac[_0x8831('0x22')]=_0x39be90['Smtp'][_0x8831('0x22')];_0x5700ac[_0x8831('0x23')]=_0x39be90[_0x8831('0x20')][_0x8831('0x23')];_0x5700ac[_0x8831('0x24')]=_0x39be90['Smtp'][_0x8831('0x24')];}if(_0x39be90[_0x8831('0x20')][_0x8831('0x25')]){_0x5700ac[_0x8831('0x26')]={'user':_0x39be90[_0x8831('0x20')][_0x8831('0x14')],'pass':_0x39be90['Smtp'][_0x8831('0x27')]};}var _0x152278={'account':_0x5700ac,'message':_[_0x8831('0x28')]({'from':util[_0x8831('0x29')](_0x8831('0x2a'),_0x39be90['name'],_0x39be90['email']||_0x39be90[_0x8831('0x20')][_0x8831('0x14')])},_0x33d18a)};return client[_0x8831('0x2b')](_0x8831('0x2c'),_0x152278);})[_0x8831('0xd')](function(_0x362ce2){if(_0x362ce2[_0x8831('0x2d')]){throw new Error(util['format'](_0x8831('0x2e'),_0x362ce2[_0x8831('0x2d')][_0x8831('0x2f')]||JSON[_0x8831('0x30')](_0x362ce2['error'])));}return!![];});}function handleError(_0x385748,_0x30341f,_0x4f7396){return _0x385748['status'](_0x30341f||0x1f4)[_0x8831('0x31')]({'message':_0x4f7396?_0x4f7396[_0x8831('0x2f')]||_0x4f7396:''});}exports[_0x8831('0x32')]=function(_0x3b4b8e,_0x1e5b6f,_0x417466){passport[_0x8831('0x33')](_0x8831('0x34'),function(_0xcf4d97,_0x59ccc2,_0x242a09){var _0x5d23fd=_0xcf4d97||_0x242a09;if(_0x5d23fd){return handleError(_0x1e5b6f,0x191,_0x5d23fd);}if(!_0x59ccc2){return handleError(_0x1e5b6f,0x194,{'message':_0x8831('0x35')});}else{var _0x422f19={'payload':{'id':_0x59ccc2['id'],'role':_0x59ccc2[_0x8831('0x36')]},'options':{'expiresIn':0x15180}};return authService[_0x8831('0x37')](_0x422f19)[_0x8831('0xd')](function(_0x1b36ec){_0x1e5b6f[_0x8831('0x38')]({'id':_0x59ccc2['id'],'token':_0x1b36ec,'statusCall':'','isAlreadyLogged':_0x59ccc2[_0x8831('0x39')]});});}})(_0x3b4b8e,_0x1e5b6f,_0x417466);};exports[_0x8831('0x3a')]=function(_0x8099a3,_0x4065a2,_0x103513){if(!_0x8099a3['body'][_0x8831('0x3b')]){return handleError(_0x4065a2,0x1f4,{'message':_0x8831('0x3c')});}var _0x275272=rs[_0x8831('0x3d')]();_0x8099a3[_0x8831('0x3e')][_0x8831('0x3b')]=_0x8099a3['body']['email'][_0x8831('0x3f')]()[_0x8831('0x40')]();var _0x4c9b51;return db[_0x8831('0xb')]['findOne']({'where':{'id':0x1},'attributes':['allowedLoginAttempts',_0x8831('0xc')],'raw':!![]})[_0x8831('0xd')](function(_0x4017a5){_0x4c9b51=_0x4017a5;return db[_0x8831('0x41')][_0x8831('0x42')]({'where':{'email':_0x8099a3[_0x8831('0x3e')]['email']}});})[_0x8831('0xd')](function(_0x398534){if(!_0x398534){throw new Error(_0x8831('0x43'));}if(_0x398534[_0x8831('0x10')]){throw new Error('The\x20user\x20is\x20disabled.\x20Please\x20contact\x20the\x20administrator.');}if(_0x398534['blocked']){if(moment(_0x398534[_0x8831('0x12')])['add'](_0x4c9b51[_0x8831('0xc')],'minutes')>moment()){throw new Error(_0x8831('0x44'));}else{_0x398534[_0x8831('0x11')]=![];_0x398534['blockedAt']=null;}}_0x398534[_0x8831('0x45')]=_0x275272;_0x398534[_0x8831('0x46')]=Date['now']()+0x36ee80;return _0x398534[_0x8831('0x47')]();})['then'](function(){return sendServiceMail({'to':_0x8099a3['body'][_0x8831('0x3b')],'subject':_0x8831('0x48'),'text':_0x8831('0x49')+_0x8831('0x4a')+_0x8831('0x4b')+_0x8099a3[_0x8831('0x4c')][_0x8831('0x22')]+'/reset/'+_0x275272+'\x0a\x0a'+_0x8831('0x4d')});})['then'](function(){_0x4065a2[_0x8831('0x4e')](0xc8)['send']({'message':'Reset\x20Email\x20sent!'});})[_0x8831('0x1d')](function(_0x1b1600){return handleError(_0x4065a2,0x1f4,_0x1b1600);});};exports[_0x8831('0x4f')]=function(_0x59620e,_0x4daadb,_0x12d905){return db['User'][_0x8831('0x42')]({'where':{'resetPasswordToken':_0x59620e[_0x8831('0x50')][_0x8831('0x51')],'resetPasswordExpires':{'$gt':Date[_0x8831('0x52')]()}}})[_0x8831('0xd')](function(_0x5688ce){if(!_0x5688ce){throw new Error(_0x8831('0x53'));}return db['Setting'][_0x8831('0x54')]({'attributes':['id',_0x8831('0x55'),_0x8831('0x56'),_0x8831('0x57')]})[_0x8831('0xd')](function(_0x48a536){if(_0x48a536[_0x8831('0x55')])authService[_0x8831('0x58')](_0x59620e[_0x8831('0x3e')][_0x8831('0x59')]);if(!_0x48a536[_0x8831('0x56')]||!_0x5688ce['previousPasswords'])return _0x5688ce;authService[_0x8831('0x5a')](_0x59620e[_0x8831('0x3e')][_0x8831('0x59')],_0x5688ce[_0x8831('0x5b')],_0x48a536['passwordHistoryLimit']);return _0x5688ce;})[_0x8831('0xd')](function(){_0x5688ce[_0x8831('0x59')]=_0x59620e[_0x8831('0x3e')][_0x8831('0x59')];_0x5688ce[_0x8831('0x45')]=null;_0x5688ce[_0x8831('0x46')]=null;return _0x5688ce[_0x8831('0x47')]();});})[_0x8831('0xd')](function(){_0x4daadb['status'](0xc8)['send']({'message':_0x8831('0x5c')});})['catch'](function(_0x2b7bb3){return handleError(_0x4daadb,0x1f4,_0x2b7bb3);});};passport[_0x8831('0x5d')](new LocalStrategy({'usernameField':_0x8831('0xe'),'passwordField':_0x8831('0x59')},function(_0x34be5a,_0x7adf19,_0x5d6d9c){return localAuthenticate(db['User'],_0x34be5a,_0x7adf19,_0x5d6d9c);}));
\ No newline at end of file
+var _0x2d4d=['Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.','authenticate','add','minutes','clearBlockUser','getLicense','catch','MailAccount','email','MailServerOut','Unable\x20to\x20find\x20a\x20configured\x20SMTP\x20service!','Smtp','service','host','port','secure','authentication','auth','pass','format','\x22%s\x22\x20<%s>','SendMail\x20error:\x20%s.\x20Please\x20contact\x20your\x20Administrator!','error','message','stringify','status','send','login','Something\x20went\x20wrong,\x20please\x20try\x20again.','online','forgot','body','generate','trim','toLowerCase','User','find','The\x20user\x20is\x20disabled.\x20Please\x20contact\x20the\x20administrator.','The\x20user\x20is\x20blocked.\x20Please\x20contact\x20the\x20administrator.','resetPasswordToken','save','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','https://','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','now','Password\x20reset\x20token\x20is\x20invalid\x20or\x20has\x20expired.','enforcePasswordHistory','passwordHistoryLimit','securePassword','validatePasswordPattern','previousPasswords','validatePasswordHistory','Password\x20reset!','use','util','jayson/promise','lodash','randomstring','moment','../../mysqldb','../../components/auth/service','../../config/utils','client','http','Setting','findOne','allowedLoginAttempts','blockDuration','then','name','password','salt','role','disabled','blocked','blockedAt','loginAttempts','admin','user','agent'];(function(_0x4fa66f,_0x4d618a){var _0x41b38c=function(_0x55a4c4){while(--_0x55a4c4){_0x4fa66f['push'](_0x4fa66f['shift']());}};_0x41b38c(++_0x4d618a);}(_0x2d4d,0x94));var _0xd2d4=function(_0x431275,_0xc22027){_0x431275=_0x431275-0x0;var _0x497f80=_0x2d4d[_0x431275];return _0x497f80;};'use strict';var util=require(_0xd2d4('0x0'));var passport=require('passport');var LocalStrategy=require('passport-local')['Strategy'];var jayson=require(_0xd2d4('0x1'));var _=require(_0xd2d4('0x2'));var rs=require(_0xd2d4('0x3'));var moment=require(_0xd2d4('0x4'));var db=require(_0xd2d4('0x5'))['db'];var authService=require(_0xd2d4('0x6'));var utils=require(_0xd2d4('0x7'));var client=jayson[_0xd2d4('0x8')][_0xd2d4('0x9')]({'port':0x232b});function localAuthenticate(_0x471003,_0x56d1e3,_0x23e700,_0x57bae4){var _0x45176e,_0x89452c;return db[_0xd2d4('0xa')][_0xd2d4('0xb')]({'where':{'id':0x1},'attributes':[_0xd2d4('0xc'),_0xd2d4('0xd')],'raw':!![]})[_0xd2d4('0xe')](function(_0x32fc91){_0x45176e=_0x32fc91;return _0x471003[_0xd2d4('0xb')]({'attributes':['id',_0xd2d4('0xf'),_0xd2d4('0x10'),_0xd2d4('0x11'),_0xd2d4('0x12'),_0xd2d4('0x13'),_0xd2d4('0x14'),_0xd2d4('0x15'),_0xd2d4('0x16')],'where':{'name':_0x56d1e3,'role':{'$or':[_0xd2d4('0x17'),_0xd2d4('0x18'),_0xd2d4('0x19')]}}});})[_0xd2d4('0xe')](function(_0x3dc00c){if(!_0x3dc00c||_0x3dc00c&&_0x3dc00c[_0xd2d4('0xf')]!==_0x56d1e3){throw new Error(_0xd2d4('0x1a'));}else{_0x89452c=_0x3dc00c;return _0x89452c;}})[_0xd2d4('0xe')](function(){_0x89452c[_0xd2d4('0x1b')](_0x23e700,function(_0x457c02,_0x390d55){var _0x295041=_0x89452c['loginAttempts']+0x1;if(_0x457c02){return _0x57bae4(_0x457c02);}else if(!_0x390d55){if(_0x89452c[_0xd2d4('0x13')]){return _0x57bae4(null,![],{'message':_0xd2d4('0x1a')});}else if(_0x45176e[_0xd2d4('0xc')]>0x0){if(_0x89452c[_0xd2d4('0x14')]){if(_0x45176e['blockDuration']>0x0){if(moment(_0x89452c[_0xd2d4('0x15')])[_0xd2d4('0x1c')](_0x45176e['blockDuration'],_0xd2d4('0x1d'))>moment()){return _0x57bae4(null,![],{'message':_0xd2d4('0x1a')});}else{return utils[_0xd2d4('0x1e')](_0x89452c,_0x295041,![],null)[_0xd2d4('0xe')](function(){return _0x57bae4(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});});}}else{return _0x57bae4(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});}}else{if(_0x295041>=_0x45176e[_0xd2d4('0xc')]){return utils[_0xd2d4('0x1e')](_0x89452c,0x0,!![],moment())[_0xd2d4('0xe')](function(){return _0x57bae4(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});});}else{return utils[_0xd2d4('0x1e')](_0x89452c,_0x295041,![],null)[_0xd2d4('0xe')](function(){return _0x57bae4(null,![],{'message':_0xd2d4('0x1a')});});}}}else{return _0x57bae4(null,![],{'message':_0xd2d4('0x1a')});}}else{if(_0x89452c[_0xd2d4('0x13')]){return _0x57bae4(null,![],{'message':_0xd2d4('0x1a')});}else if(_0x45176e['allowedLoginAttempts']>0x0){if(_0x89452c[_0xd2d4('0x14')]){if(_0x45176e[_0xd2d4('0xd')]>0x0){if(moment(_0x89452c[_0xd2d4('0x15')])[_0xd2d4('0x1c')](_0x45176e[_0xd2d4('0xd')],_0xd2d4('0x1d'))>moment()){return _0x57bae4(null,![],{'message':_0xd2d4('0x1a')});}else{return utils[_0xd2d4('0x1e')](_0x89452c,0x0,![],null)[_0xd2d4('0xe')](function(){return utils[_0xd2d4('0x1f')](_0x89452c);})[_0xd2d4('0xe')](function(){return _0x57bae4(null,_0x89452c);});}}else{return _0x57bae4(null,![],{'message':_0xd2d4('0x1a')});}}else{return utils['clearBlockUser'](_0x89452c,0x0,![],null)[_0xd2d4('0xe')](function(){return utils[_0xd2d4('0x1f')](_0x89452c);})['then'](function(){return _0x57bae4(null,_0x89452c);})[_0xd2d4('0x20')](function(_0x45ab5d){return _0x57bae4(null,![],_0x45ab5d);});}}else{if(_0x89452c['blocked']){return _0x57bae4(null,![],{'message':_0xd2d4('0x1a')});}else{return utils[_0xd2d4('0x1f')](_0x89452c)[_0xd2d4('0xe')](function(){return _0x57bae4(null,_0x89452c);});}}}});})['catch'](function(_0x292d16){return _0x57bae4(null,![],_0x292d16);});}function sendServiceMail(_0x3aeffe){return db[_0xd2d4('0x21')]['find']({'where':{'service':!![]},'attributes':['id',_0xd2d4('0xf'),_0xd2d4('0x22')],'include':[{'model':db[_0xd2d4('0x23')],'as':'Smtp'}]})['then'](function(_0x4bc51e){if(!_0x4bc51e){throw new Error(_0xd2d4('0x24'));}var _0x259dc6={'tls':{'rejectUnauthorized':![]}};if(_0x4bc51e[_0xd2d4('0x25')][_0xd2d4('0x26')]){_0x259dc6[_0xd2d4('0x26')]=_0x4bc51e[_0xd2d4('0x25')]['service'];}else{_0x259dc6['host']=_0x4bc51e[_0xd2d4('0x25')][_0xd2d4('0x27')];_0x259dc6['port']=_0x4bc51e[_0xd2d4('0x25')][_0xd2d4('0x28')];_0x259dc6['secure']=_0x4bc51e[_0xd2d4('0x25')][_0xd2d4('0x29')];}if(_0x4bc51e[_0xd2d4('0x25')][_0xd2d4('0x2a')]){_0x259dc6[_0xd2d4('0x2b')]={'user':_0x4bc51e[_0xd2d4('0x25')][_0xd2d4('0x18')],'pass':_0x4bc51e[_0xd2d4('0x25')][_0xd2d4('0x2c')]};}var _0x14ab8f={'account':_0x259dc6,'message':_['merge']({'from':util[_0xd2d4('0x2d')](_0xd2d4('0x2e'),_0x4bc51e[_0xd2d4('0xf')],_0x4bc51e['email']||_0x4bc51e[_0xd2d4('0x25')][_0xd2d4('0x18')])},_0x3aeffe)};return client['request']('SendMail',_0x14ab8f);})[_0xd2d4('0xe')](function(_0x530d7d){if(_0x530d7d['error']){throw new Error(util[_0xd2d4('0x2d')](_0xd2d4('0x2f'),_0x530d7d[_0xd2d4('0x30')][_0xd2d4('0x31')]||JSON[_0xd2d4('0x32')](_0x530d7d[_0xd2d4('0x30')])));}return!![];});}function handleError(_0x22bb30,_0xd88d68,_0x39af3d){return _0x22bb30[_0xd2d4('0x33')](_0xd88d68||0x1f4)[_0xd2d4('0x34')]({'message':_0x39af3d?_0x39af3d[_0xd2d4('0x31')]||_0x39af3d:''});}exports[_0xd2d4('0x35')]=function(_0x3dbe4c,_0x321cd6,_0x56278f){passport[_0xd2d4('0x1b')]('local',function(_0x34b204,_0x9a3410,_0x126e40){var _0x4d1ef7=_0x34b204||_0x126e40;if(_0x4d1ef7){return handleError(_0x321cd6,0x191,_0x4d1ef7);}if(!_0x9a3410){return handleError(_0x321cd6,0x194,{'message':_0xd2d4('0x36')});}else{var _0x19aa39={'payload':{'id':_0x9a3410['id'],'role':_0x9a3410['role']},'options':{'expiresIn':0x15180}};return authService['signToken'](_0x19aa39)[_0xd2d4('0xe')](function(_0x45544f){_0x321cd6['json']({'id':_0x9a3410['id'],'token':_0x45544f,'statusCall':'','isAlreadyLogged':_0x9a3410[_0xd2d4('0x37')]});});}})(_0x3dbe4c,_0x321cd6,_0x56278f);};exports[_0xd2d4('0x38')]=function(_0x5a7e0c,_0x3170d6,_0x10a882){if(!_0x5a7e0c[_0xd2d4('0x39')]['email']){return handleError(_0x3170d6,0x1f4,{'message':'Email\x20parameter\x20is\x20missing'});}var _0x10af94=rs[_0xd2d4('0x3a')]();_0x5a7e0c[_0xd2d4('0x39')][_0xd2d4('0x22')]=_0x5a7e0c[_0xd2d4('0x39')]['email'][_0xd2d4('0x3b')]()[_0xd2d4('0x3c')]();var _0x4cd61f;return db['Setting'][_0xd2d4('0xb')]({'where':{'id':0x1},'attributes':[_0xd2d4('0xc'),'blockDuration'],'raw':!![]})[_0xd2d4('0xe')](function(_0x332be1){_0x4cd61f=_0x332be1;return db[_0xd2d4('0x3d')][_0xd2d4('0x3e')]({'where':{'email':_0x5a7e0c[_0xd2d4('0x39')]['email']}});})[_0xd2d4('0xe')](function(_0xeca5d4){if(!_0xeca5d4){throw new Error('This\x20email\x20is\x20not\x20registered.');}if(_0xeca5d4[_0xd2d4('0x13')]){throw new Error(_0xd2d4('0x3f'));}if(_0xeca5d4['blocked']){if(moment(_0xeca5d4[_0xd2d4('0x15')])[_0xd2d4('0x1c')](_0x4cd61f[_0xd2d4('0xd')],_0xd2d4('0x1d'))>moment()){throw new Error(_0xd2d4('0x40'));}else{_0xeca5d4['blocked']=![];_0xeca5d4['blockedAt']=null;}}_0xeca5d4[_0xd2d4('0x41')]=_0x10af94;_0xeca5d4['resetPasswordExpires']=Date['now']()+0x36ee80;return _0xeca5d4[_0xd2d4('0x42')]();})['then'](function(){return sendServiceMail({'to':_0x5a7e0c['body'][_0xd2d4('0x22')],'subject':'xCally\x20Motion\x20Password\x20Reset','text':_0xd2d4('0x43')+_0xd2d4('0x44')+_0xd2d4('0x45')+_0x5a7e0c[_0xd2d4('0x46')][_0xd2d4('0x27')]+_0xd2d4('0x47')+_0x10af94+'\x0a\x0a'+_0xd2d4('0x48')});})[_0xd2d4('0xe')](function(){_0x3170d6[_0xd2d4('0x33')](0xc8)[_0xd2d4('0x34')]({'message':_0xd2d4('0x49')});})['catch'](function(_0x53bbe0){return handleError(_0x3170d6,0x1f4,_0x53bbe0);});};exports[_0xd2d4('0x4a')]=function(_0x19a558,_0x1e5b2c,_0x1cce3e){return db[_0xd2d4('0x3d')][_0xd2d4('0x3e')]({'where':{'resetPasswordToken':_0x19a558[_0xd2d4('0x4b')][_0xd2d4('0x4c')],'resetPasswordExpires':{'$gt':Date[_0xd2d4('0x4d')]()}}})[_0xd2d4('0xe')](function(_0x3f6570){if(!_0x3f6570){throw new Error(_0xd2d4('0x4e'));}return db[_0xd2d4('0xa')][_0xd2d4('0xb')]({'attributes':['id','securePassword',_0xd2d4('0x4f'),_0xd2d4('0x50')]})[_0xd2d4('0xe')](function(_0x562188){if(_0x562188[_0xd2d4('0x51')])authService[_0xd2d4('0x52')](_0x19a558[_0xd2d4('0x39')]['password']);if(!_0x562188[_0xd2d4('0x4f')]||!_0x3f6570[_0xd2d4('0x53')])return _0x3f6570;authService[_0xd2d4('0x54')](_0x19a558['body'][_0xd2d4('0x10')],_0x3f6570[_0xd2d4('0x53')],_0x562188['passwordHistoryLimit']);return _0x3f6570;})[_0xd2d4('0xe')](function(){_0x3f6570[_0xd2d4('0x10')]=_0x19a558[_0xd2d4('0x39')][_0xd2d4('0x10')];_0x3f6570[_0xd2d4('0x41')]=null;_0x3f6570['resetPasswordExpires']=null;return _0x3f6570['save']();});})[_0xd2d4('0xe')](function(){_0x1e5b2c[_0xd2d4('0x33')](0xc8)[_0xd2d4('0x34')]({'message':_0xd2d4('0x55')});})[_0xd2d4('0x20')](function(_0x579280){return handleError(_0x1e5b2c,0x1f4,_0x579280);});};passport[_0xd2d4('0x56')](new LocalStrategy({'usernameField':_0xd2d4('0xf'),'passwordField':_0xd2d4('0x10')},function(_0x31e192,_0x25355d,_0x3effc0){return localAuthenticate(db['User'],_0x31e192,_0x25355d,_0x3effc0);}));
\ No newline at end of file
diff --git a/server/api/authLocal/index.js b/server/api/authLocal/index.js
index 23582c7..1ba98bd 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 _0x5737=['./authLocal.controller','login','/forgot','forgot','post','/reset/:token','reset','exports','express','Router'];(function(_0x194717,_0x440304){var _0x4ae32c=function(_0x9b57be){while(--_0x9b57be){_0x194717['push'](_0x194717['shift']());}};_0x4ae32c(++_0x440304);}(_0x5737,0x1c0));var _0x7573=function(_0x4f3207,_0x264c78){_0x4f3207=_0x4f3207-0x0;var _0x87adb6=_0x5737[_0x4f3207];return _0x87adb6;};'use strict';var express=require(_0x7573('0x0'));var router=express[_0x7573('0x1')]();var controller=require(_0x7573('0x2'));router['post']('/',controller[_0x7573('0x3')]);router['post'](_0x7573('0x4'),controller[_0x7573('0x5')]);router[_0x7573('0x6')](_0x7573('0x7'),controller[_0x7573('0x8')]);module[_0x7573('0x9')]=router;
\ No newline at end of file
+var _0x368e=['express','Router','./authLocal.controller','post','login','/forgot','forgot','/reset/:token','reset','exports'];(function(_0x3ab4fa,_0xfb4d70){var _0x489ea3=function(_0x42dc4d){while(--_0x42dc4d){_0x3ab4fa['push'](_0x3ab4fa['shift']());}};_0x489ea3(++_0xfb4d70);}(_0x368e,0xfa));var _0xe368=function(_0x2093f0,_0x1f903c){_0x2093f0=_0x2093f0-0x0;var _0x37829f=_0x368e[_0x2093f0];return _0x37829f;};'use strict';var express=require(_0xe368('0x0'));var router=express[_0xe368('0x1')]();var controller=require(_0xe368('0x2'));router[_0xe368('0x3')]('/',controller[_0xe368('0x4')]);router[_0xe368('0x3')](_0xe368('0x5'),controller[_0xe368('0x6')]);router[_0xe368('0x3')](_0xe368('0x7'),controller[_0xe368('0x8')]);module[_0xe368('0x9')]=router;
\ No newline at end of file
diff --git a/server/api/automation/automation.attributes.js b/server/api/automation/automation.attributes.js
index ae20f33..8d7eac9 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 _0xbc73=['STRING','BOOLEAN','INTEGER','sequelize'];(function(_0x17f686,_0x5a06c0){var _0x42455a=function(_0x755a69){while(--_0x755a69){_0x17f686['push'](_0x17f686['shift']());}};_0x42455a(++_0x5a06c0);}(_0xbc73,0xe7));var _0x3bc7=function(_0x236c89,_0xd76ba9){_0x236c89=_0x236c89-0x0;var _0x3b2a15=_0xbc73[_0x236c89];return _0x3b2a15;};'use strict';var Sequelize=require(_0x3bc7('0x0'));module['exports']={'name':{'type':Sequelize['STRING'],'allowNull':![]},'channel':{'type':Sequelize[_0x3bc7('0x1')]},'description':{'type':Sequelize[_0x3bc7('0x1')]},'status':{'type':Sequelize[_0x3bc7('0x2')],'defaultValue':![]},'timeout':{'type':Sequelize[_0x3bc7('0x3')],'defaultValue':0xa}};
\ No newline at end of file
+var _0x5dc6=['exports','STRING','INTEGER','sequelize'];(function(_0x19e35c,_0x29cd1e){var _0x3e1fe8=function(_0x17258b){while(--_0x17258b){_0x19e35c['push'](_0x19e35c['shift']());}};_0x3e1fe8(++_0x29cd1e);}(_0x5dc6,0x157));var _0x65dc=function(_0x47ace1,_0x1e7b27){_0x47ace1=_0x47ace1-0x0;var _0xce8451=_0x5dc6[_0x47ace1];return _0xce8451;};'use strict';var Sequelize=require(_0x65dc('0x0'));module[_0x65dc('0x1')]={'name':{'type':Sequelize[_0x65dc('0x2')],'allowNull':![]},'channel':{'type':Sequelize[_0x65dc('0x2')]},'description':{'type':Sequelize[_0x65dc('0x2')]},'status':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'timeout':{'type':Sequelize[_0x65dc('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 30383d2..54936bb 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 _0x9fd2=['util','path','sox','to-csv','ejs','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','offset','undefined','limit','count','set','Content-Range','json','reject','save','update','then','destroy','error','stack','name','send','index','map','Automation','rawAttributes','type','key','model','query','keys','filters','intersection','attributes','fields','nolimit','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','params','find','create','body','addConditions','Condition','ids','getConditions','findOne','length','order','addActions','Action','omit','getActions','hasOwnProperty','eml-format','zip-dir','fast-json-patch','request-promise','bluebird','mustache'];(function(_0x21ab88,_0x505c6c){var _0xe178fa=function(_0x2a49eb){while(--_0x2a49eb){_0x21ab88['push'](_0x21ab88['shift']());}};_0xe178fa(++_0x505c6c);}(_0x9fd2,0xac));var _0x29fd=function(_0x2bee5d,_0x5ce342){_0x2bee5d=_0x2bee5d-0x0;var _0x2fba8c=_0x9fd2[_0x2bee5d];return _0x2fba8c;};'use strict';var emlformat=require(_0x29fd('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x29fd('0x1'));var jsonpatch=require(_0x29fd('0x2'));var rp=require(_0x29fd('0x3'));var moment=require('moment');var BPromise=require(_0x29fd('0x4'));var Mustache=require(_0x29fd('0x5'));var util=require(_0x29fd('0x6'));var path=require(_0x29fd('0x7'));var sox=require(_0x29fd('0x8'));var csv=require(_0x29fd('0x9'));var ejs=require(_0x29fd('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require('squel');var crypto=require(_0x29fd('0xb'));var jsforce=require(_0x29fd('0xc'));var deskjs=require(_0x29fd('0xd'));var toCsv=require('to-csv');var querystring=require(_0x29fd('0xe'));var Papa=require(_0x29fd('0xf'));var Redis=require(_0x29fd('0x10'));var authService=require(_0x29fd('0x11'));var qs=require(_0x29fd('0x12'));var as=require(_0x29fd('0x13'));var hardwareService=require(_0x29fd('0x14'));var logger=require(_0x29fd('0x15'))(_0x29fd('0x16'));var utils=require(_0x29fd('0x17'));var config=require(_0x29fd('0x18'));var licenseUtil=require(_0x29fd('0x19'));var db=require(_0x29fd('0x1a'))['db'];function respondWithStatusCode(_0x4c0c1c,_0xf06c90){_0xf06c90=_0xf06c90||0xcc;return function(_0x40194c){if(_0x40194c){return _0x4c0c1c[_0x29fd('0x1b')](_0xf06c90);}return _0x4c0c1c[_0x29fd('0x1c')](_0xf06c90)[_0x29fd('0x1d')]();};}function respondWithResult(_0x130cda,_0x1643e9){_0x1643e9=_0x1643e9||0xc8;return function(_0x57f344){if(_0x57f344){return _0x130cda[_0x29fd('0x1c')](_0x1643e9)['json'](_0x57f344);}};}function respondWithFilteredResult(_0x455981,_0xba5265){return function(_0x387bc1){if(_0x387bc1){var _0x1402e5=typeof _0xba5265[_0x29fd('0x1e')]===_0x29fd('0x1f')&&typeof _0xba5265[_0x29fd('0x20')]==='undefined';var _0x3c9759=_0x387bc1[_0x29fd('0x21')];var _0x515e99=_0x1402e5?0x0:_0xba5265['offset'];var _0xe589ff=_0x1402e5?_0x387bc1['count']:_0xba5265[_0x29fd('0x1e')]+_0xba5265[_0x29fd('0x20')];var _0x2a35b4;if(_0xe589ff>=_0x3c9759){_0xe589ff=_0x3c9759;_0x2a35b4=0xc8;}else{_0x2a35b4=0xce;}_0x455981[_0x29fd('0x1c')](_0x2a35b4);return _0x455981[_0x29fd('0x22')](_0x29fd('0x23'),_0x515e99+'-'+_0xe589ff+'/'+_0x3c9759)[_0x29fd('0x24')](_0x387bc1);}return null;};}function patchUpdates(_0x28b6c4){return function(_0x160ba5){try{jsonpatch['apply'](_0x160ba5,_0x28b6c4,!![]);}catch(_0x302d96){return BPromise[_0x29fd('0x25')](_0x302d96);}return _0x160ba5[_0x29fd('0x26')]();};}function saveUpdates(_0x425a10,_0x34f056){return function(_0x2bad9e){if(_0x2bad9e){return _0x2bad9e[_0x29fd('0x27')](_0x425a10)[_0x29fd('0x28')](function(_0x5c95ef){return _0x5c95ef;});}return null;};}function removeEntity(_0x548618,_0x456493){return function(_0x31660b){if(_0x31660b){return _0x31660b[_0x29fd('0x29')]()[_0x29fd('0x28')](function(){_0x548618['status'](0xcc)[_0x29fd('0x1d')]();});}};}function handleEntityNotFound(_0x552a96,_0x4c90e0){return function(_0x3776eb){if(!_0x3776eb){_0x552a96[_0x29fd('0x1b')](0x194);}return _0x3776eb;};}function handleError(_0x3fb16f,_0x14854b){_0x14854b=_0x14854b||0x1f4;return function(_0x3ff2d3){logger[_0x29fd('0x2a')](_0x3ff2d3[_0x29fd('0x2b')]);if(_0x3ff2d3[_0x29fd('0x2c')]){delete _0x3ff2d3[_0x29fd('0x2c')];}_0x3fb16f[_0x29fd('0x1c')](_0x14854b)[_0x29fd('0x2d')](_0x3ff2d3);};}exports[_0x29fd('0x2e')]=function(_0x13bb40,_0x338eea){var _0x2e6b5c={},_0x40f633={},_0x295df5={'count':0x0,'rows':[]};var _0x20abc3=_[_0x29fd('0x2f')](db[_0x29fd('0x30')][_0x29fd('0x31')],function(_0x5f3361){return{'name':_0x5f3361['fieldName'],'type':_0x5f3361[_0x29fd('0x32')][_0x29fd('0x33')]};});_0x40f633[_0x29fd('0x34')]=_['map'](_0x20abc3,'name');_0x40f633[_0x29fd('0x35')]=_[_0x29fd('0x36')](_0x13bb40['query']);_0x40f633[_0x29fd('0x37')]=_[_0x29fd('0x38')](_0x40f633[_0x29fd('0x34')],_0x40f633['query']);_0x2e6b5c[_0x29fd('0x39')]=_['intersection'](_0x40f633[_0x29fd('0x34')],qs[_0x29fd('0x3a')](_0x13bb40[_0x29fd('0x35')][_0x29fd('0x3a')]));_0x2e6b5c[_0x29fd('0x39')]=_0x2e6b5c[_0x29fd('0x39')]['length']?_0x2e6b5c[_0x29fd('0x39')]:_0x40f633['model'];if(!_0x13bb40['query']['hasOwnProperty'](_0x29fd('0x3b'))){_0x2e6b5c[_0x29fd('0x20')]=qs[_0x29fd('0x20')](_0x13bb40[_0x29fd('0x35')]['limit']);_0x2e6b5c['offset']=qs['offset'](_0x13bb40[_0x29fd('0x35')][_0x29fd('0x1e')]);}_0x2e6b5c['order']=qs[_0x29fd('0x3c')](_0x13bb40['query'][_0x29fd('0x3c')]);_0x2e6b5c[_0x29fd('0x3d')]=qs['filters'](_[_0x29fd('0x3e')](_0x13bb40['query'],_0x40f633[_0x29fd('0x37')]),_0x20abc3);if(_0x13bb40['query'][_0x29fd('0x3f')]){_0x2e6b5c['where']=_[_0x29fd('0x40')](_0x2e6b5c[_0x29fd('0x3d')],{'$or':_[_0x29fd('0x2f')](_0x20abc3,function(_0x3b307d){if(_0x3b307d[_0x29fd('0x32')]!==_0x29fd('0x41')){var _0x1dd00d={};_0x1dd00d[_0x3b307d[_0x29fd('0x2c')]]={'$like':'%'+_0x13bb40[_0x29fd('0x35')][_0x29fd('0x3f')]+'%'};return _0x1dd00d;}})});}_0x2e6b5c=_['merge']({},_0x2e6b5c,_0x13bb40[_0x29fd('0x42')]);var _0x2c91be={'where':_0x2e6b5c[_0x29fd('0x3d')]};return db[_0x29fd('0x30')][_0x29fd('0x21')](_0x2c91be)[_0x29fd('0x28')](function(_0x347098){_0x295df5[_0x29fd('0x21')]=_0x347098;if(_0x13bb40['query'][_0x29fd('0x43')]){_0x2e6b5c[_0x29fd('0x44')]=[{'all':!![]}];}return db[_0x29fd('0x30')][_0x29fd('0x45')](_0x2e6b5c);})['then'](function(_0x3a74f8){_0x295df5[_0x29fd('0x46')]=_0x3a74f8;return _0x295df5;})['then'](respondWithFilteredResult(_0x338eea,_0x2e6b5c))[_0x29fd('0x47')](handleError(_0x338eea,null));};exports[_0x29fd('0x48')]=function(_0x1be0be,_0x14ada4){var _0x250ebb={'raw':![],'where':{'id':_0x1be0be[_0x29fd('0x49')]['id']}},_0xab3b8d={};_0xab3b8d[_0x29fd('0x34')]=_[_0x29fd('0x36')](db['Automation'][_0x29fd('0x31')]);_0xab3b8d['query']=_[_0x29fd('0x36')](_0x1be0be[_0x29fd('0x35')]);_0xab3b8d[_0x29fd('0x37')]=_[_0x29fd('0x38')](_0xab3b8d[_0x29fd('0x34')],_0xab3b8d[_0x29fd('0x35')]);_0x250ebb['attributes']=_[_0x29fd('0x38')](_0xab3b8d[_0x29fd('0x34')],qs[_0x29fd('0x3a')](_0x1be0be['query'][_0x29fd('0x3a')]));_0x250ebb['attributes']=_0x250ebb[_0x29fd('0x39')]['length']?_0x250ebb[_0x29fd('0x39')]:_0xab3b8d[_0x29fd('0x34')];if(_0x1be0be['query'][_0x29fd('0x43')]){_0x250ebb[_0x29fd('0x44')]=[{'all':!![]}];}_0x250ebb=_[_0x29fd('0x40')]({},_0x250ebb,_0x1be0be[_0x29fd('0x42')]);return db['Automation'][_0x29fd('0x4a')](_0x250ebb)[_0x29fd('0x28')](handleEntityNotFound(_0x14ada4,null))[_0x29fd('0x28')](respondWithResult(_0x14ada4,null))['catch'](handleError(_0x14ada4,null));};exports[_0x29fd('0x4b')]=function(_0x37751e,_0x53c986){return db[_0x29fd('0x30')]['create'](_0x37751e[_0x29fd('0x4c')],{})[_0x29fd('0x28')](respondWithResult(_0x53c986,0xc9))[_0x29fd('0x47')](handleError(_0x53c986,null));};exports[_0x29fd('0x27')]=function(_0x211a49,_0x387be9){if(_0x211a49['body']['id']){delete _0x211a49[_0x29fd('0x4c')]['id'];}return db[_0x29fd('0x30')][_0x29fd('0x4a')]({'where':{'id':_0x211a49[_0x29fd('0x49')]['id']}})[_0x29fd('0x28')](handleEntityNotFound(_0x387be9,null))['then'](saveUpdates(_0x211a49[_0x29fd('0x4c')],null))[_0x29fd('0x28')](respondWithResult(_0x387be9,null))['catch'](handleError(_0x387be9,null));};exports[_0x29fd('0x29')]=function(_0xc4e9f6,_0x5df38c){return db[_0x29fd('0x30')]['find']({'where':{'id':_0xc4e9f6[_0x29fd('0x49')]['id']}})['then'](handleEntityNotFound(_0x5df38c,null))['then'](removeEntity(_0x5df38c,null))[_0x29fd('0x47')](handleError(_0x5df38c,null));};exports[_0x29fd('0x4d')]=function(_0x5c3be1,_0x3e9548,_0x2f2005){return db[_0x29fd('0x4e')][_0x29fd('0x4a')]({'where':{'id':_0x5c3be1[_0x29fd('0x49')]['id']}})[_0x29fd('0x28')](handleEntityNotFound(_0x3e9548,null))[_0x29fd('0x28')](function(_0x10ff00){if(_0x10ff00){return _0x10ff00['addConditions'](_0x5c3be1[_0x29fd('0x4c')][_0x29fd('0x4f')],_['omit'](_0x5c3be1['body'],[_0x29fd('0x4f'),'id'])||{});}})[_0x29fd('0x28')](respondWithResult(_0x3e9548,null))[_0x29fd('0x47')](handleError(_0x3e9548,null));};exports[_0x29fd('0x50')]=function(_0x4eb408,_0x15e22f,_0x13264e){var _0xa0695a={};var _0xbb4d3a={};var _0x58c025;var _0x143c3e;return db[_0x29fd('0x30')][_0x29fd('0x51')]({'where':{'id':_0x4eb408[_0x29fd('0x49')]['id']}})['then'](handleEntityNotFound(_0x15e22f,null))[_0x29fd('0x28')](function(_0x356e34){if(_0x356e34){_0x58c025=_0x356e34;_0xbb4d3a['model']=_[_0x29fd('0x36')](db[_0x29fd('0x4e')]['rawAttributes']);_0xbb4d3a[_0x29fd('0x35')]=_[_0x29fd('0x36')](_0x4eb408[_0x29fd('0x35')]);_0xbb4d3a[_0x29fd('0x37')]=_[_0x29fd('0x38')](_0xbb4d3a[_0x29fd('0x34')],_0xbb4d3a[_0x29fd('0x35')]);_0xa0695a[_0x29fd('0x39')]=_[_0x29fd('0x38')](_0xbb4d3a[_0x29fd('0x34')],qs[_0x29fd('0x3a')](_0x4eb408[_0x29fd('0x35')][_0x29fd('0x3a')]));_0xa0695a['attributes']=_0xa0695a[_0x29fd('0x39')][_0x29fd('0x52')]?_0xa0695a[_0x29fd('0x39')]:_0xbb4d3a[_0x29fd('0x34')];_0xa0695a[_0x29fd('0x53')]=qs[_0x29fd('0x3c')](_0x4eb408['query']['sort']);_0xa0695a['where']=qs[_0x29fd('0x37')](_[_0x29fd('0x3e')](_0x4eb408[_0x29fd('0x35')],_0xbb4d3a[_0x29fd('0x37')]));if(_0x4eb408[_0x29fd('0x35')][_0x29fd('0x3f')]){_0xa0695a[_0x29fd('0x3d')]=_[_0x29fd('0x40')](_0xa0695a[_0x29fd('0x3d')],{'$or':_[_0x29fd('0x2f')](_0xa0695a[_0x29fd('0x39')],function(_0x29013d){var _0x4e2a1d={};_0x4e2a1d[_0x29013d]={'$like':'%'+_0x4eb408[_0x29fd('0x35')][_0x29fd('0x3f')]+'%'};return _0x4e2a1d;})});}_0xa0695a=_['merge']({},_0xa0695a,_0x4eb408['options']);return _0x58c025['getConditions'](_0xa0695a);}})['then'](function(_0x5014f8){if(_0x5014f8){_0x143c3e=_0x5014f8[_0x29fd('0x52')];if(!_0x4eb408[_0x29fd('0x35')]['hasOwnProperty']('nolimit')){_0xa0695a[_0x29fd('0x20')]=qs[_0x29fd('0x20')](_0x4eb408['query'][_0x29fd('0x20')]);_0xa0695a[_0x29fd('0x1e')]=qs[_0x29fd('0x1e')](_0x4eb408[_0x29fd('0x35')][_0x29fd('0x1e')]);}return _0x58c025[_0x29fd('0x50')](_0xa0695a);}})[_0x29fd('0x28')](function(_0x36b113){if(_0x36b113){return _0x36b113?{'count':_0x143c3e,'rows':_0x36b113}:null;}})[_0x29fd('0x28')](respondWithResult(_0x15e22f,null))[_0x29fd('0x47')](handleError(_0x15e22f,null));};exports[_0x29fd('0x54')]=function(_0x51b512,_0x4c6a43,_0x1eaae2){return db[_0x29fd('0x55')]['find']({'where':{'id':_0x51b512[_0x29fd('0x49')]['id']}})[_0x29fd('0x28')](handleEntityNotFound(_0x4c6a43,null))[_0x29fd('0x28')](function(_0x244189){if(_0x244189){return _0x244189['addActions'](_0x51b512[_0x29fd('0x4c')][_0x29fd('0x4f')],_[_0x29fd('0x56')](_0x51b512[_0x29fd('0x4c')],[_0x29fd('0x4f'),'id'])||{});}})[_0x29fd('0x28')](respondWithResult(_0x4c6a43,null))[_0x29fd('0x47')](handleError(_0x4c6a43,null));};exports[_0x29fd('0x57')]=function(_0x5d87dd,_0x316cef,_0x53a483){var _0x27909a={};var _0x4cca7d={};var _0x518ea9;var _0x2e90dc;return db['Automation'][_0x29fd('0x51')]({'where':{'id':_0x5d87dd[_0x29fd('0x49')]['id']}})['then'](handleEntityNotFound(_0x316cef,null))[_0x29fd('0x28')](function(_0x2442ce){if(_0x2442ce){_0x518ea9=_0x2442ce;_0x4cca7d['model']=_[_0x29fd('0x36')](db[_0x29fd('0x55')][_0x29fd('0x31')]);_0x4cca7d[_0x29fd('0x35')]=_[_0x29fd('0x36')](_0x5d87dd['query']);_0x4cca7d[_0x29fd('0x37')]=_[_0x29fd('0x38')](_0x4cca7d[_0x29fd('0x34')],_0x4cca7d[_0x29fd('0x35')]);_0x27909a['attributes']=_[_0x29fd('0x38')](_0x4cca7d['model'],qs[_0x29fd('0x3a')](_0x5d87dd[_0x29fd('0x35')][_0x29fd('0x3a')]));_0x27909a[_0x29fd('0x39')]=_0x27909a['attributes']['length']?_0x27909a[_0x29fd('0x39')]:_0x4cca7d[_0x29fd('0x34')];_0x27909a[_0x29fd('0x53')]=qs[_0x29fd('0x3c')](_0x5d87dd['query']['sort']);_0x27909a[_0x29fd('0x3d')]=qs[_0x29fd('0x37')](_[_0x29fd('0x3e')](_0x5d87dd[_0x29fd('0x35')],_0x4cca7d['filters']));if(_0x5d87dd[_0x29fd('0x35')][_0x29fd('0x3f')]){_0x27909a[_0x29fd('0x3d')]=_['merge'](_0x27909a[_0x29fd('0x3d')],{'$or':_[_0x29fd('0x2f')](_0x27909a[_0x29fd('0x39')],function(_0x1d52eb){var _0x4690bb={};_0x4690bb[_0x1d52eb]={'$like':'%'+_0x5d87dd[_0x29fd('0x35')]['filter']+'%'};return _0x4690bb;})});}_0x27909a=_['merge']({},_0x27909a,_0x5d87dd['options']);return _0x518ea9['getActions'](_0x27909a);}})[_0x29fd('0x28')](function(_0x2d3e7b){if(_0x2d3e7b){_0x2e90dc=_0x2d3e7b[_0x29fd('0x52')];if(!_0x5d87dd['query'][_0x29fd('0x58')](_0x29fd('0x3b'))){_0x27909a['limit']=qs[_0x29fd('0x20')](_0x5d87dd[_0x29fd('0x35')][_0x29fd('0x20')]);_0x27909a[_0x29fd('0x1e')]=qs[_0x29fd('0x1e')](_0x5d87dd[_0x29fd('0x35')][_0x29fd('0x1e')]);}return _0x518ea9[_0x29fd('0x57')](_0x27909a);}})['then'](function(_0x34d80b){if(_0x34d80b){return _0x34d80b?{'count':_0x2e90dc,'rows':_0x34d80b}:null;}})[_0x29fd('0x28')](respondWithResult(_0x316cef,null))[_0x29fd('0x47')](handleError(_0x316cef,null));};
\ No newline at end of file
+var _0x6c19=['mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','querystring','ioredis','../../components/parsers/qs','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','count','limit','set','Content-Range','apply','reject','save','then','error','name','index','map','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','hasOwnProperty','order','sort','pick','filter','where','merge','options','Automation','includeAll','include','findAll','rows','catch','params','length','find','create','update','body','addConditions','omit','ids','getConditions','nolimit','Action','addActions','getActions','findOne','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird'];(function(_0x1917cd,_0x15a27f){var _0x423333=function(_0x55791e){while(--_0x55791e){_0x1917cd['push'](_0x1917cd['shift']());}};_0x423333(++_0x15a27f);}(_0x6c19,0xa0));var _0x96c1=function(_0x3a73bc,_0x550aef){_0x3a73bc=_0x3a73bc-0x0;var _0x32891b=_0x6c19[_0x3a73bc];return _0x32891b;};'use strict';var emlformat=require(_0x96c1('0x0'));var rimraf=require(_0x96c1('0x1'));var zipdir=require(_0x96c1('0x2'));var jsonpatch=require(_0x96c1('0x3'));var rp=require(_0x96c1('0x4'));var moment=require('moment');var BPromise=require(_0x96c1('0x5'));var Mustache=require(_0x96c1('0x6'));var util=require(_0x96c1('0x7'));var path=require(_0x96c1('0x8'));var sox=require(_0x96c1('0x9'));var csv=require(_0x96c1('0xa'));var ejs=require(_0x96c1('0xb'));var fs=require('fs');var fs_extra=require(_0x96c1('0xc'));var _=require(_0x96c1('0xd'));var squel=require(_0x96c1('0xe'));var crypto=require(_0x96c1('0xf'));var jsforce=require(_0x96c1('0x10'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x96c1('0x11'));var Papa=require('papaparse');var Redis=require(_0x96c1('0x12'));var authService=require('../../components/auth/service');var qs=require(_0x96c1('0x13'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x96c1('0x14'));var logger=require(_0x96c1('0x15'))('api');var utils=require(_0x96c1('0x16'));var config=require(_0x96c1('0x17'));var licenseUtil=require(_0x96c1('0x18'));var db=require(_0x96c1('0x19'))['db'];function respondWithStatusCode(_0x2bf790,_0x3f9c62){_0x3f9c62=_0x3f9c62||0xcc;return function(_0x265f98){if(_0x265f98){return _0x2bf790[_0x96c1('0x1a')](_0x3f9c62);}return _0x2bf790[_0x96c1('0x1b')](_0x3f9c62)[_0x96c1('0x1c')]();};}function respondWithResult(_0x536d05,_0x3cf014){_0x3cf014=_0x3cf014||0xc8;return function(_0x40d0d7){if(_0x40d0d7){return _0x536d05[_0x96c1('0x1b')](_0x3cf014)[_0x96c1('0x1d')](_0x40d0d7);}};}function respondWithFilteredResult(_0x154f0a,_0x3e8a57){return function(_0x173489){if(_0x173489){var _0x359d7f=typeof _0x3e8a57[_0x96c1('0x1e')]==='undefined'&&typeof _0x3e8a57['limit']==='undefined';var _0x48dd65=_0x173489[_0x96c1('0x1f')];var _0x549a2c=_0x359d7f?0x0:_0x3e8a57[_0x96c1('0x1e')];var _0x3b0d30=_0x359d7f?_0x173489['count']:_0x3e8a57[_0x96c1('0x1e')]+_0x3e8a57[_0x96c1('0x20')];var _0x422ede;if(_0x3b0d30>=_0x48dd65){_0x3b0d30=_0x48dd65;_0x422ede=0xc8;}else{_0x422ede=0xce;}_0x154f0a['status'](_0x422ede);return _0x154f0a[_0x96c1('0x21')](_0x96c1('0x22'),_0x549a2c+'-'+_0x3b0d30+'/'+_0x48dd65)[_0x96c1('0x1d')](_0x173489);}return null;};}function patchUpdates(_0x518917){return function(_0x53e36b){try{jsonpatch[_0x96c1('0x23')](_0x53e36b,_0x518917,!![]);}catch(_0x43a0b0){return BPromise[_0x96c1('0x24')](_0x43a0b0);}return _0x53e36b[_0x96c1('0x25')]();};}function saveUpdates(_0x28d302,_0x34337c){return function(_0x215462){if(_0x215462){return _0x215462['update'](_0x28d302)[_0x96c1('0x26')](function(_0x223c69){return _0x223c69;});}return null;};}function removeEntity(_0x1f336c,_0x101359){return function(_0x776c70){if(_0x776c70){return _0x776c70['destroy']()[_0x96c1('0x26')](function(){_0x1f336c[_0x96c1('0x1b')](0xcc)['end']();});}};}function handleEntityNotFound(_0x139f84,_0x47602d){return function(_0x16b69f){if(!_0x16b69f){_0x139f84[_0x96c1('0x1a')](0x194);}return _0x16b69f;};}function handleError(_0x165f72,_0x38d90c){_0x38d90c=_0x38d90c||0x1f4;return function(_0x4848e3){logger[_0x96c1('0x27')](_0x4848e3['stack']);if(_0x4848e3[_0x96c1('0x28')]){delete _0x4848e3[_0x96c1('0x28')];}_0x165f72['status'](_0x38d90c)['send'](_0x4848e3);};}exports[_0x96c1('0x29')]=function(_0x4a5855,_0x3be430){var _0x294d6a={},_0x1de30a={},_0x974fb3={'count':0x0,'rows':[]};var _0x2b99a5=_[_0x96c1('0x2a')](db['Automation'][_0x96c1('0x2b')],function(_0x58d7a2){return{'name':_0x58d7a2[_0x96c1('0x2c')],'type':_0x58d7a2[_0x96c1('0x2d')][_0x96c1('0x2e')]};});_0x1de30a[_0x96c1('0x2f')]=_['map'](_0x2b99a5,'name');_0x1de30a[_0x96c1('0x30')]=_[_0x96c1('0x31')](_0x4a5855['query']);_0x1de30a[_0x96c1('0x32')]=_[_0x96c1('0x33')](_0x1de30a[_0x96c1('0x2f')],_0x1de30a[_0x96c1('0x30')]);_0x294d6a[_0x96c1('0x34')]=_[_0x96c1('0x33')](_0x1de30a[_0x96c1('0x2f')],qs[_0x96c1('0x35')](_0x4a5855[_0x96c1('0x30')][_0x96c1('0x35')]));_0x294d6a[_0x96c1('0x34')]=_0x294d6a[_0x96c1('0x34')]['length']?_0x294d6a['attributes']:_0x1de30a[_0x96c1('0x2f')];if(!_0x4a5855[_0x96c1('0x30')][_0x96c1('0x36')]('nolimit')){_0x294d6a[_0x96c1('0x20')]=qs[_0x96c1('0x20')](_0x4a5855[_0x96c1('0x30')]['limit']);_0x294d6a[_0x96c1('0x1e')]=qs['offset'](_0x4a5855[_0x96c1('0x30')][_0x96c1('0x1e')]);}_0x294d6a[_0x96c1('0x37')]=qs['sort'](_0x4a5855['query'][_0x96c1('0x38')]);_0x294d6a['where']=qs['filters'](_[_0x96c1('0x39')](_0x4a5855['query'],_0x1de30a[_0x96c1('0x32')]),_0x2b99a5);if(_0x4a5855[_0x96c1('0x30')][_0x96c1('0x3a')]){_0x294d6a[_0x96c1('0x3b')]=_[_0x96c1('0x3c')](_0x294d6a[_0x96c1('0x3b')],{'$or':_[_0x96c1('0x2a')](_0x2b99a5,function(_0x3a534){if(_0x3a534[_0x96c1('0x2d')]!=='VIRTUAL'){var _0x53846a={};_0x53846a[_0x3a534[_0x96c1('0x28')]]={'$like':'%'+_0x4a5855[_0x96c1('0x30')][_0x96c1('0x3a')]+'%'};return _0x53846a;}})});}_0x294d6a=_[_0x96c1('0x3c')]({},_0x294d6a,_0x4a5855[_0x96c1('0x3d')]);var _0x47803b={'where':_0x294d6a[_0x96c1('0x3b')]};return db[_0x96c1('0x3e')][_0x96c1('0x1f')](_0x47803b)[_0x96c1('0x26')](function(_0x10625c){_0x974fb3['count']=_0x10625c;if(_0x4a5855[_0x96c1('0x30')][_0x96c1('0x3f')]){_0x294d6a[_0x96c1('0x40')]=[{'all':!![]}];}return db[_0x96c1('0x3e')][_0x96c1('0x41')](_0x294d6a);})[_0x96c1('0x26')](function(_0x505d3c){_0x974fb3[_0x96c1('0x42')]=_0x505d3c;return _0x974fb3;})['then'](respondWithFilteredResult(_0x3be430,_0x294d6a))[_0x96c1('0x43')](handleError(_0x3be430,null));};exports['show']=function(_0x2817c5,_0x70727d){var _0x4f9e86={'raw':![],'where':{'id':_0x2817c5[_0x96c1('0x44')]['id']}},_0x1f86f3={};_0x1f86f3[_0x96c1('0x2f')]=_[_0x96c1('0x31')](db[_0x96c1('0x3e')][_0x96c1('0x2b')]);_0x1f86f3[_0x96c1('0x30')]=_['keys'](_0x2817c5[_0x96c1('0x30')]);_0x1f86f3[_0x96c1('0x32')]=_['intersection'](_0x1f86f3['model'],_0x1f86f3[_0x96c1('0x30')]);_0x4f9e86[_0x96c1('0x34')]=_[_0x96c1('0x33')](_0x1f86f3['model'],qs['fields'](_0x2817c5['query'][_0x96c1('0x35')]));_0x4f9e86[_0x96c1('0x34')]=_0x4f9e86['attributes'][_0x96c1('0x45')]?_0x4f9e86[_0x96c1('0x34')]:_0x1f86f3[_0x96c1('0x2f')];if(_0x2817c5[_0x96c1('0x30')][_0x96c1('0x3f')]){_0x4f9e86[_0x96c1('0x40')]=[{'all':!![]}];}_0x4f9e86=_[_0x96c1('0x3c')]({},_0x4f9e86,_0x2817c5[_0x96c1('0x3d')]);return db[_0x96c1('0x3e')][_0x96c1('0x46')](_0x4f9e86)[_0x96c1('0x26')](handleEntityNotFound(_0x70727d,null))['then'](respondWithResult(_0x70727d,null))[_0x96c1('0x43')](handleError(_0x70727d,null));};exports['create']=function(_0x42803f,_0x5c99a1){return db[_0x96c1('0x3e')][_0x96c1('0x47')](_0x42803f['body'],{})[_0x96c1('0x26')](respondWithResult(_0x5c99a1,0xc9))[_0x96c1('0x43')](handleError(_0x5c99a1,null));};exports[_0x96c1('0x48')]=function(_0x33007a,_0x4b73eb){if(_0x33007a[_0x96c1('0x49')]['id']){delete _0x33007a['body']['id'];}return db[_0x96c1('0x3e')]['find']({'where':{'id':_0x33007a['params']['id']}})[_0x96c1('0x26')](handleEntityNotFound(_0x4b73eb,null))[_0x96c1('0x26')](saveUpdates(_0x33007a[_0x96c1('0x49')],null))[_0x96c1('0x26')](respondWithResult(_0x4b73eb,null))[_0x96c1('0x43')](handleError(_0x4b73eb,null));};exports['destroy']=function(_0x4fd64a,_0x180a8d){return db['Automation']['find']({'where':{'id':_0x4fd64a['params']['id']}})[_0x96c1('0x26')](handleEntityNotFound(_0x180a8d,null))['then'](removeEntity(_0x180a8d,null))['catch'](handleError(_0x180a8d,null));};exports[_0x96c1('0x4a')]=function(_0x4bf756,_0x50a53e,_0x574440){return db['Condition'][_0x96c1('0x46')]({'where':{'id':_0x4bf756[_0x96c1('0x44')]['id']}})['then'](handleEntityNotFound(_0x50a53e,null))['then'](function(_0x270b39){if(_0x270b39){return _0x270b39[_0x96c1('0x4a')](_0x4bf756[_0x96c1('0x49')]['ids'],_[_0x96c1('0x4b')](_0x4bf756[_0x96c1('0x49')],[_0x96c1('0x4c'),'id'])||{});}})['then'](respondWithResult(_0x50a53e,null))[_0x96c1('0x43')](handleError(_0x50a53e,null));};exports['getConditions']=function(_0x441dcc,_0x1ae8f1,_0x1ea1d6){var _0x2c8415={};var _0x36bc7d={};var _0x5345fb;var _0x8723b;return db[_0x96c1('0x3e')]['findOne']({'where':{'id':_0x441dcc[_0x96c1('0x44')]['id']}})[_0x96c1('0x26')](handleEntityNotFound(_0x1ae8f1,null))['then'](function(_0x93fa1){if(_0x93fa1){_0x5345fb=_0x93fa1;_0x36bc7d[_0x96c1('0x2f')]=_[_0x96c1('0x31')](db['Condition'][_0x96c1('0x2b')]);_0x36bc7d[_0x96c1('0x30')]=_['keys'](_0x441dcc[_0x96c1('0x30')]);_0x36bc7d[_0x96c1('0x32')]=_[_0x96c1('0x33')](_0x36bc7d[_0x96c1('0x2f')],_0x36bc7d[_0x96c1('0x30')]);_0x2c8415['attributes']=_[_0x96c1('0x33')](_0x36bc7d[_0x96c1('0x2f')],qs['fields'](_0x441dcc[_0x96c1('0x30')][_0x96c1('0x35')]));_0x2c8415[_0x96c1('0x34')]=_0x2c8415[_0x96c1('0x34')]['length']?_0x2c8415[_0x96c1('0x34')]:_0x36bc7d[_0x96c1('0x2f')];_0x2c8415[_0x96c1('0x37')]=qs[_0x96c1('0x38')](_0x441dcc[_0x96c1('0x30')][_0x96c1('0x38')]);_0x2c8415[_0x96c1('0x3b')]=qs[_0x96c1('0x32')](_[_0x96c1('0x39')](_0x441dcc[_0x96c1('0x30')],_0x36bc7d[_0x96c1('0x32')]));if(_0x441dcc[_0x96c1('0x30')][_0x96c1('0x3a')]){_0x2c8415[_0x96c1('0x3b')]=_['merge'](_0x2c8415['where'],{'$or':_['map'](_0x2c8415[_0x96c1('0x34')],function(_0x3ae174){var _0x5e2808={};_0x5e2808[_0x3ae174]={'$like':'%'+_0x441dcc['query']['filter']+'%'};return _0x5e2808;})});}_0x2c8415=_[_0x96c1('0x3c')]({},_0x2c8415,_0x441dcc[_0x96c1('0x3d')]);return _0x5345fb[_0x96c1('0x4d')](_0x2c8415);}})[_0x96c1('0x26')](function(_0x2f00a0){if(_0x2f00a0){_0x8723b=_0x2f00a0[_0x96c1('0x45')];if(!_0x441dcc[_0x96c1('0x30')][_0x96c1('0x36')](_0x96c1('0x4e'))){_0x2c8415[_0x96c1('0x20')]=qs['limit'](_0x441dcc[_0x96c1('0x30')][_0x96c1('0x20')]);_0x2c8415['offset']=qs['offset'](_0x441dcc[_0x96c1('0x30')]['offset']);}return _0x5345fb['getConditions'](_0x2c8415);}})[_0x96c1('0x26')](function(_0x22828d){if(_0x22828d){return _0x22828d?{'count':_0x8723b,'rows':_0x22828d}:null;}})[_0x96c1('0x26')](respondWithResult(_0x1ae8f1,null))[_0x96c1('0x43')](handleError(_0x1ae8f1,null));};exports['addActions']=function(_0x530be5,_0x3e104f,_0x16b755){return db[_0x96c1('0x4f')][_0x96c1('0x46')]({'where':{'id':_0x530be5[_0x96c1('0x44')]['id']}})[_0x96c1('0x26')](handleEntityNotFound(_0x3e104f,null))[_0x96c1('0x26')](function(_0x45577d){if(_0x45577d){return _0x45577d[_0x96c1('0x50')](_0x530be5[_0x96c1('0x49')]['ids'],_[_0x96c1('0x4b')](_0x530be5[_0x96c1('0x49')],[_0x96c1('0x4c'),'id'])||{});}})[_0x96c1('0x26')](respondWithResult(_0x3e104f,null))['catch'](handleError(_0x3e104f,null));};exports[_0x96c1('0x51')]=function(_0x1bc90a,_0x342e00,_0x1beec1){var _0x583f90={};var _0x5e5ea3={};var _0x4f6b66;var _0x821f1a;return db['Automation'][_0x96c1('0x52')]({'where':{'id':_0x1bc90a[_0x96c1('0x44')]['id']}})[_0x96c1('0x26')](handleEntityNotFound(_0x342e00,null))[_0x96c1('0x26')](function(_0x2bb636){if(_0x2bb636){_0x4f6b66=_0x2bb636;_0x5e5ea3[_0x96c1('0x2f')]=_[_0x96c1('0x31')](db[_0x96c1('0x4f')][_0x96c1('0x2b')]);_0x5e5ea3[_0x96c1('0x30')]=_[_0x96c1('0x31')](_0x1bc90a[_0x96c1('0x30')]);_0x5e5ea3['filters']=_['intersection'](_0x5e5ea3['model'],_0x5e5ea3[_0x96c1('0x30')]);_0x583f90[_0x96c1('0x34')]=_[_0x96c1('0x33')](_0x5e5ea3[_0x96c1('0x2f')],qs[_0x96c1('0x35')](_0x1bc90a[_0x96c1('0x30')]['fields']));_0x583f90['attributes']=_0x583f90[_0x96c1('0x34')][_0x96c1('0x45')]?_0x583f90[_0x96c1('0x34')]:_0x5e5ea3['model'];_0x583f90['order']=qs['sort'](_0x1bc90a['query'][_0x96c1('0x38')]);_0x583f90['where']=qs['filters'](_['pick'](_0x1bc90a['query'],_0x5e5ea3[_0x96c1('0x32')]));if(_0x1bc90a[_0x96c1('0x30')][_0x96c1('0x3a')]){_0x583f90[_0x96c1('0x3b')]=_['merge'](_0x583f90[_0x96c1('0x3b')],{'$or':_['map'](_0x583f90[_0x96c1('0x34')],function(_0x508776){var _0x52b6c9={};_0x52b6c9[_0x508776]={'$like':'%'+_0x1bc90a[_0x96c1('0x30')][_0x96c1('0x3a')]+'%'};return _0x52b6c9;})});}_0x583f90=_[_0x96c1('0x3c')]({},_0x583f90,_0x1bc90a[_0x96c1('0x3d')]);return _0x4f6b66[_0x96c1('0x51')](_0x583f90);}})[_0x96c1('0x26')](function(_0x2a7b78){if(_0x2a7b78){_0x821f1a=_0x2a7b78['length'];if(!_0x1bc90a[_0x96c1('0x30')]['hasOwnProperty']('nolimit')){_0x583f90['limit']=qs[_0x96c1('0x20')](_0x1bc90a[_0x96c1('0x30')][_0x96c1('0x20')]);_0x583f90[_0x96c1('0x1e')]=qs[_0x96c1('0x1e')](_0x1bc90a['query'][_0x96c1('0x1e')]);}return _0x4f6b66[_0x96c1('0x51')](_0x583f90);}})['then'](function(_0x12a455){if(_0x12a455){return _0x12a455?{'count':_0x821f1a,'rows':_0x12a455}:null;}})[_0x96c1('0x26')](respondWithResult(_0x342e00,null))[_0x96c1('0x43')](handleError(_0x342e00,null));};
\ No newline at end of file
diff --git a/server/api/automation/automation.model.js b/server/api/automation/automation.model.js
index 2cbd54b..16d16b5 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 _0xb729=['./automation.attributes','exports','tools_automations','util','../../config/logger','moment','bluebird','request-promise','rimraf','../../config/environment'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0xb729,0x71));var _0x9b72=function(_0x744178,_0x33cef5){_0x744178=_0x744178-0x0;var _0x30b7d2=_0xb729[_0x744178];return _0x30b7d2;};'use strict';var _=require('lodash');var util=require(_0x9b72('0x0'));var logger=require(_0x9b72('0x1'))('api');var moment=require(_0x9b72('0x2'));var BPromise=require(_0x9b72('0x3'));var rp=require(_0x9b72('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x9b72('0x5'));var config=require(_0x9b72('0x6'));var attributes=require(_0x9b72('0x7'));module[_0x9b72('0x8')]=function(_0x2690cd,_0x4ed9f3){return _0x2690cd['define']('Automation',attributes,{'tableName':_0x9b72('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xf021=['api','bluebird','request-promise','path','rimraf','../../config/environment','./automation.attributes','exports','define','Automation','tools_automations','lodash','util','../../config/logger'];(function(_0x384943,_0xd57919){var _0x5b0735=function(_0x4e493e){while(--_0x4e493e){_0x384943['push'](_0x384943['shift']());}};_0x5b0735(++_0xd57919);}(_0xf021,0x1cb));var _0x1f02=function(_0x137fdc,_0x350ef5){_0x137fdc=_0x137fdc-0x0;var _0x4594b8=_0xf021[_0x137fdc];return _0x4594b8;};'use strict';var _=require(_0x1f02('0x0'));var util=require(_0x1f02('0x1'));var logger=require(_0x1f02('0x2'))(_0x1f02('0x3'));var moment=require('moment');var BPromise=require(_0x1f02('0x4'));var rp=require(_0x1f02('0x5'));var fs=require('fs');var path=require(_0x1f02('0x6'));var rimraf=require(_0x1f02('0x7'));var config=require(_0x1f02('0x8'));var attributes=require(_0x1f02('0x9'));module[_0x1f02('0xa')]=function(_0x40cec8,_0x580664){return _0x40cec8[_0x1f02('0xb')](_0x1f02('0xc'),attributes,{'tableName':_0x1f02('0xd'),'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 a7c91d2..188b0f0 100644
--- a/server/api/automation/automation.rpc.js
+++ b/server/api/automation/automation.rpc.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xb7e2=['rpc','../../config/environment','jayson/promise','client','http','request','then','info','Automation,\x20%s,\x20%s','Automation,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','lodash','moment','randomstring','../../mysqldb','../../config/logger'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xb7e2,0x103));var _0x2b7e=function(_0x2827cc,_0x51f941){_0x2827cc=_0x2827cc-0x0;var _0x526a77=_0xb7e2[_0x2827cc];return _0x526a77;};'use strict';var _=require(_0x2b7e('0x0'));var util=require('util');var moment=require(_0x2b7e('0x1'));var BPromise=require('bluebird');var rs=require(_0x2b7e('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x2b7e('0x3'))['db'];var utils=require('../../config/utils');var logger=require(_0x2b7e('0x4'))(_0x2b7e('0x5'));var config=require(_0x2b7e('0x6'));var jayson=require(_0x2b7e('0x7'));var client=jayson[_0x2b7e('0x8')][_0x2b7e('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x4d7a0b,_0xc23ec4,_0x45dc9f){return new BPromise(function(_0x10a31d,_0x49491c){return client[_0x2b7e('0xa')](_0x4d7a0b,_0x45dc9f)[_0x2b7e('0xb')](function(_0x2f5991){logger[_0x2b7e('0xc')](_0x2b7e('0xd'),_0xc23ec4,'request\x20sent');logger['debug'](_0x2b7e('0xe'),_0xc23ec4,_0x2b7e('0xf'),JSON[_0x2b7e('0x10')](_0x2f5991));if(_0x2f5991[_0x2b7e('0x11')]){if(_0x2f5991[_0x2b7e('0x11')][_0x2b7e('0x12')]===0x1f4){logger[_0x2b7e('0x11')]('Automation,\x20%s,\x20%s',_0xc23ec4,_0x2f5991[_0x2b7e('0x11')][_0x2b7e('0x13')]);return _0x49491c(_0x2f5991[_0x2b7e('0x11')][_0x2b7e('0x13')]);}logger['error']('Automation,\x20%s,\x20%s',_0xc23ec4,_0x2f5991['error'][_0x2b7e('0x13')]);return _0x10a31d(_0x2f5991['error'][_0x2b7e('0x13')]);}else{logger['info'](_0x2b7e('0xd'),_0xc23ec4,'request\x20sent');_0x10a31d(_0x2f5991[_0x2b7e('0x14')][_0x2b7e('0x13')]);}})[_0x2b7e('0x15')](function(_0x4d85c3){logger[_0x2b7e('0x11')](_0x2b7e('0xd'),_0xc23ec4,_0x4d85c3);_0x49491c(_0x4d85c3);});});}
\ No newline at end of file
+var _0x70e3=['then','info','Automation,\x20%s,\x20%s','Automation,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','message','result','catch','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client'];(function(_0x1beaec,_0x47c1dd){var _0xb46d86=function(_0x1ee9c3){while(--_0x1ee9c3){_0x1beaec['push'](_0x1beaec['shift']());}};_0xb46d86(++_0x47c1dd);}(_0x70e3,0x9d));var _0x370e=function(_0x480bc8,_0x1fac40){_0x480bc8=_0x480bc8-0x0;var _0x28c245=_0x70e3[_0x480bc8];return _0x28c245;};'use strict';var _=require(_0x370e('0x0'));var util=require(_0x370e('0x1'));var moment=require(_0x370e('0x2'));var BPromise=require(_0x370e('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x370e('0x4'));var db=require(_0x370e('0x5'))['db'];var utils=require(_0x370e('0x6'));var logger=require('../../config/logger')(_0x370e('0x7'));var config=require(_0x370e('0x8'));var jayson=require(_0x370e('0x9'));var client=jayson[_0x370e('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x3a2aaf,_0x5f57ea,_0x4a6884){return new BPromise(function(_0x5e5c79,_0x4086c4){return client['request'](_0x3a2aaf,_0x4a6884)[_0x370e('0xb')](function(_0x52d611){logger[_0x370e('0xc')](_0x370e('0xd'),_0x5f57ea,'request\x20sent');logger['debug'](_0x370e('0xe'),_0x5f57ea,_0x370e('0xf'),JSON[_0x370e('0x10')](_0x52d611));if(_0x52d611[_0x370e('0x11')]){if(_0x52d611[_0x370e('0x11')]['code']===0x1f4){logger[_0x370e('0x11')](_0x370e('0xd'),_0x5f57ea,_0x52d611[_0x370e('0x11')][_0x370e('0x12')]);return _0x4086c4(_0x52d611[_0x370e('0x11')][_0x370e('0x12')]);}logger[_0x370e('0x11')](_0x370e('0xd'),_0x5f57ea,_0x52d611[_0x370e('0x11')][_0x370e('0x12')]);return _0x5e5c79(_0x52d611[_0x370e('0x11')]['message']);}else{logger['info']('Automation,\x20%s,\x20%s',_0x5f57ea,_0x370e('0xf'));_0x5e5c79(_0x52d611[_0x370e('0x13')][_0x370e('0x12')]);}})[_0x370e('0x14')](function(_0xb8381f){logger[_0x370e('0x11')]('Automation,\x20%s,\x20%s',_0x5f57ea,_0xb8381f);_0x4086c4(_0xb8381f);});});}
\ No newline at end of file
diff --git a/server/api/automation/index.js b/server/api/automation/index.js
index b4180c3..19834e0 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 _0xe011=['show','/:id/conditions','/:id/actions','getActions','addConditions','post','addActions','put','update','exports','multer','util','path','connect-timeout','express','fs-extra','../../components/interaction/service','../../config/environment','./automation.controller','get','isAuthenticated','index','/:id'];(function(_0x1d046a,_0x30db41){var _0x2c0b0c=function(_0x30a3c5){while(--_0x30a3c5){_0x1d046a['push'](_0x1d046a['shift']());}};_0x2c0b0c(++_0x30db41);}(_0xe011,0x14c));var _0x1e01=function(_0x561771,_0x554760){_0x561771=_0x561771-0x0;var _0x54d16e=_0xe011[_0x561771];return _0x54d16e;};'use strict';var multer=require(_0x1e01('0x0'));var util=require(_0x1e01('0x1'));var path=require(_0x1e01('0x2'));var timeout=require(_0x1e01('0x3'));var express=require(_0x1e01('0x4'));var router=express['Router']();var fs_extra=require(_0x1e01('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0x1e01('0x6'));var config=require(_0x1e01('0x7'));var controller=require(_0x1e01('0x8'));router[_0x1e01('0x9')]('/',auth[_0x1e01('0xa')](),controller[_0x1e01('0xb')]);router[_0x1e01('0x9')](_0x1e01('0xc'),auth[_0x1e01('0xa')](),controller[_0x1e01('0xd')]);router[_0x1e01('0x9')](_0x1e01('0xe'),auth[_0x1e01('0xa')](),controller['getConditions']);router[_0x1e01('0x9')](_0x1e01('0xf'),auth[_0x1e01('0xa')](),controller[_0x1e01('0x10')]);router['post']('/',auth['isAuthenticated'](),controller['create']);router['post'](_0x1e01('0xe'),auth[_0x1e01('0xa')](),controller[_0x1e01('0x11')]);router[_0x1e01('0x12')]('/:id/actions',auth[_0x1e01('0xa')](),controller[_0x1e01('0x13')]);router[_0x1e01('0x14')](_0x1e01('0xc'),auth['isAuthenticated'](),controller[_0x1e01('0x15')]);router['delete']('/:id',auth['isAuthenticated'](),controller['destroy']);module[_0x1e01('0x16')]=router;
\ No newline at end of file
+var _0x98d5=['exports','multer','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./automation.controller','isAuthenticated','get','show','getConditions','/:id/actions','getActions','create','post','/:id/conditions','addConditions','addActions','put','/:id','delete','destroy'];(function(_0x38e2eb,_0x215eaa){var _0x230647=function(_0x170de4){while(--_0x170de4){_0x38e2eb['push'](_0x38e2eb['shift']());}};_0x230647(++_0x215eaa);}(_0x98d5,0xfb));var _0x598d=function(_0x1fd086,_0x388ded){_0x1fd086=_0x1fd086-0x0;var _0x5a962d=_0x98d5[_0x1fd086];return _0x5a962d;};'use strict';var multer=require(_0x598d('0x0'));var util=require('util');var path=require('path');var timeout=require(_0x598d('0x1'));var express=require(_0x598d('0x2'));var router=express[_0x598d('0x3')]();var fs_extra=require(_0x598d('0x4'));var auth=require(_0x598d('0x5'));var interaction=require(_0x598d('0x6'));var config=require(_0x598d('0x7'));var controller=require(_0x598d('0x8'));router['get']('/',auth[_0x598d('0x9')](),controller['index']);router[_0x598d('0xa')]('/:id',auth['isAuthenticated'](),controller[_0x598d('0xb')]);router[_0x598d('0xa')]('/:id/conditions',auth[_0x598d('0x9')](),controller[_0x598d('0xc')]);router[_0x598d('0xa')](_0x598d('0xd'),auth[_0x598d('0x9')](),controller[_0x598d('0xe')]);router['post']('/',auth['isAuthenticated'](),controller[_0x598d('0xf')]);router[_0x598d('0x10')](_0x598d('0x11'),auth[_0x598d('0x9')](),controller[_0x598d('0x12')]);router[_0x598d('0x10')](_0x598d('0xd'),auth[_0x598d('0x9')](),controller[_0x598d('0x13')]);router[_0x598d('0x14')](_0x598d('0x15'),auth[_0x598d('0x9')](),controller['update']);router[_0x598d('0x16')]('/:id',auth[_0x598d('0x9')](),controller[_0x598d('0x17')]);module[_0x598d('0x18')]=router;
\ No newline at end of file
diff --git a/server/api/campaign/campaign.attributes.js b/server/api/campaign/campaign.attributes.js
index 9685fd0..87f8146 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 _0x73f2=['name','ivr','BOOLEAN','Active/Disactive\x20Campaign','INTEGER','UNSIGNED','Max\x20200\x20calls.','Originate\x20Timeout\x20Seconds\x20(min:1,\x20max:999)','#Congestion\x20Retry\x20(min:1,\x20max:999)','Congestion\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#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)','07:00-22:00,*,*,*','ENUM','always','Active/Disactive\x20AMD','#AMD\x20Greeting','#AMD\x20After\x20Greeting\x20Silence','#AMD\x20Total\x20Analysis\x20Time','#AMD\x20Min\x20Word\x20Length','#AMD\x20Between\x20Words\x20Silence','#AMD\x20Maximum\x20Number\x20Of\x20Words','#AMD\x20Silence\x20Threshold\x20(min:0,\x20max:32767)','#AMD\x20Maximum\x20Word\x20Length','DESC','ASC','Random\x20Last\x20Digit\x20(min:1,\x20max:15)','Cut\x20Digit\x20(min:1,\x20max:15)','#NoSuchNumber\x20Retry\x20(min:1,\x20max:999)','NoSuchNumber\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Drop\x20Retry\x20(min:1,\x20max:999)','#Abandoned\x20Retry\x20(min:1,\x20max:999)','#Machine\x20Retry\x20(min:1,\x20max:999)','#AgentReject\x20Retry\x20(min:1,\x20max:999)','AgentReject\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','sequelize','exports','STRING'];(function(_0x589aee,_0x140a03){var _0x2f5ed4=function(_0x3d224f){while(--_0x3d224f){_0x589aee['push'](_0x589aee['shift']());}};_0x2f5ed4(++_0x140a03);}(_0x73f2,0xc5));var _0x273f=function(_0x546a74,_0x413d8c){_0x546a74=_0x546a74-0x0;var _0x3a3430=_0x73f2[_0x546a74];return _0x3a3430;};'use strict';var Sequelize=require(_0x273f('0x0'));module[_0x273f('0x1')]={'name':{'type':Sequelize[_0x273f('0x2')],'unique':_0x273f('0x3'),'allowNull':![],'validate':{'is':/[A-Za-z0-9._\\+*!-]+/,'notEmpty':!![]}},'type':{'type':Sequelize['ENUM']('ivr'),'allowNull':![],'defaultValue':_0x273f('0x4')},'description':{'type':Sequelize[_0x273f('0x2')]},'active':{'type':Sequelize[_0x273f('0x5')],'defaultValue':0x0,'comment':_0x273f('0x6')},'limitCalls':{'type':Sequelize[_0x273f('0x7')](0x4)[_0x273f('0x8')],'defaultValue':0x1e,'validate':{'min':0x1,'max':0xc8},'comment':_0x273f('0x9')},'dialOriginateCallerIdName':{'type':Sequelize['STRING']},'dialOriginateCallerIdNumber':{'type':Sequelize[_0x273f('0x2')]},'dialOriginateTimeout':{'type':Sequelize[_0x273f('0x7')](0x3)[_0x273f('0x8')],'defaultValue':0x1e,'validate':{'min':0x1,'max':0x3e7},'comment':_0x273f('0xa')},'dialCongestionMaxRetry':{'type':Sequelize[_0x273f('0x7')](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x273f('0xb')},'dialCongestionRetryFrequency':{'type':Sequelize[_0x273f('0x7')](0x5)[_0x273f('0x8')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x273f('0xc')},'dialBusyMaxRetry':{'type':Sequelize[_0x273f('0x7')](0x3)[_0x273f('0x8')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x273f('0xd')},'dialBusyRetryFrequency':{'type':Sequelize[_0x273f('0x7')](0x5)[_0x273f('0x8')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x273f('0xe')},'dialNoAnswerMaxRetry':{'type':Sequelize[_0x273f('0x7')](0x3)[_0x273f('0x8')],'defaultValue':0x3,'comment':_0x273f('0xf')},'dialNoAnswerRetryFrequency':{'type':Sequelize['INTEGER'](0x5)[_0x273f('0x8')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x273f('0x10')},'dialGlobalMaxRetry':{'type':Sequelize[_0x273f('0x7')](0x3)[_0x273f('0x8')],'validate':{'min':0x1,'max':0x3e7},'defaultValue':0x4,'comment':'#Global\x20Max\x20Retry\x20(min:1,\x20max:999)'},'dialTimezone':{'type':Sequelize[_0x273f('0x2')],'defaultValue':null},'dialGlobalInterval':{'type':Sequelize[_0x273f('0x2')],'defaultValue':_0x273f('0x11')},'dialCheckDuplicateType':{'type':Sequelize[_0x273f('0x12')](_0x273f('0x13'),'never','onlyIfOpen'),'defaultValue':_0x273f('0x13')},'dialAMDActive':{'type':Sequelize[_0x273f('0x5')],'defaultValue':0x0,'comment':_0x273f('0x14')},'dialAMDInitialSilence':{'type':Sequelize[_0x273f('0x7')](0x9)[_0x273f('0x8')],'defaultValue':0x9c4,'validate':{'min':0x0},'comment':'#AMD\x20Initial\x20Silence'},'dialAMDGreeting':{'type':Sequelize[_0x273f('0x7')](0x9)[_0x273f('0x8')],'defaultValue':0x5dc,'validate':{'min':0x0},'comment':_0x273f('0x15')},'dialAMDAfterGreetingSilence':{'type':Sequelize[_0x273f('0x7')](0x9)['UNSIGNED'],'defaultValue':0x320,'validate':{'min':0x0},'comment':_0x273f('0x16')},'dialAMDTotalAnalysisTime':{'type':Sequelize[_0x273f('0x7')](0x9)[_0x273f('0x8')],'defaultValue':0x1388,'validate':{'min':0x0},'comment':_0x273f('0x17')},'dialAMDMinWordLength':{'type':Sequelize[_0x273f('0x7')](0x9)[_0x273f('0x8')],'defaultValue':0x64,'validate':{'min':0x0},'comment':_0x273f('0x18')},'dialAMDBetweenWordsSilence':{'type':Sequelize[_0x273f('0x7')](0x9)[_0x273f('0x8')],'defaultValue':0x32,'validate':{'min':0x0},'comment':_0x273f('0x19')},'dialAMDMaximumNumberOfWords':{'type':Sequelize[_0x273f('0x7')](0x9)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x0},'comment':_0x273f('0x1a')},'dialAMDSilenceThreshold':{'type':Sequelize['INTEGER'](0x5)['UNSIGNED'],'validate':{'min':0x0,'max':0x7fff},'defaultValue':0x100,'comment':_0x273f('0x1b')},'dialAMDMaximumWordLength':{'type':Sequelize[_0x273f('0x7')](0x9)[_0x273f('0x8')],'defaultValue':0x1388,'validate':{'min':0x0},'comment':_0x273f('0x1c')},'dialOrderByScheduledAt':{'type':Sequelize[_0x273f('0x12')](_0x273f('0x1d'),_0x273f('0x1e')),'defaultValue':'DESC'},'dialPrefix':{'type':Sequelize['STRING'],'defaultValue':null},'dialRandomLastDigitCallerIdNumber':{'type':Sequelize[_0x273f('0x7')](0x3)[_0x273f('0x8')],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':_0x273f('0x1f')},'dialCutDigit':{'type':Sequelize[_0x273f('0x7')](0x3)[_0x273f('0x8')],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':_0x273f('0x20')},'dialNoSuchNumberMaxRetry':{'type':Sequelize[_0x273f('0x7')](0x3)[_0x273f('0x8')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x273f('0x21')},'dialNoSuchNumberRetryFrequency':{'type':Sequelize[_0x273f('0x7')](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x273f('0x22')},'dialDropMaxRetry':{'type':Sequelize[_0x273f('0x7')](0x3)[_0x273f('0x8')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x273f('0x23')},'dialDropRetryFrequency':{'type':Sequelize[_0x273f('0x7')](0x5)[_0x273f('0x8')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'Drop\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialAbandonedMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0x273f('0x8')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x273f('0x24')},'dialAbandonedRetryFrequency':{'type':Sequelize[_0x273f('0x7')](0x5)[_0x273f('0x8')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'Abandoned\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialMachineMaxRetry':{'type':Sequelize['INTEGER'](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x273f('0x25')},'dialMachineRetryFrequency':{'type':Sequelize['INTEGER'](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'Machine\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialAgentRejectMaxRetry':{'type':Sequelize[_0x273f('0x7')](0x3)[_0x273f('0x8')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x273f('0x26')},'dialAgentRejectRetryFrequency':{'type':Sequelize['INTEGER'](0x5)[_0x273f('0x8')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x273f('0x27')}};
\ No newline at end of file
+var _0x6b5f=['#AMD\x20After\x20Greeting\x20Silence','#AMD\x20Total\x20Analysis\x20Time','#AMD\x20Min\x20Word\x20Length','#AMD\x20Silence\x20Threshold\x20(min:0,\x20max:32767)','DESC','Random\x20Last\x20Digit\x20(min:1,\x20max:15)','#NoSuchNumber\x20Retry\x20(min:1,\x20max:999)','NoSuchNumber\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Drop\x20Retry\x20(min:1,\x20max:999)','Drop\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Abandoned\x20Retry\x20(min:1,\x20max:999)','Abandoned\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Machine\x20Retry\x20(min:1,\x20max:999)','Machine\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#AgentReject\x20Retry\x20(min:1,\x20max:999)','sequelize','exports','name','ENUM','STRING','BOOLEAN','Active/Disactive\x20Campaign','INTEGER','Max\x20200\x20calls.','UNSIGNED','#Congestion\x20Retry\x20(min:1,\x20max:999)','Congestion\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Busy\x20Retry\x20(min:1,\x20max:999)','Busy\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#NoAnswer\x20Retry\x20(min:1,\x20max:999)','NoAnswer\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Global\x20Max\x20Retry\x20(min:1,\x20max:999)','07:00-22:00,*,*,*','never','onlyIfOpen','always','#AMD\x20Initial\x20Silence','#AMD\x20Greeting'];(function(_0x17dcff,_0x546d31){var _0x27618b=function(_0x17030e){while(--_0x17030e){_0x17dcff['push'](_0x17dcff['shift']());}};_0x27618b(++_0x546d31);}(_0x6b5f,0x119));var _0xf6b5=function(_0xedc9e1,_0x458222){_0xedc9e1=_0xedc9e1-0x0;var _0x2aed13=_0x6b5f[_0xedc9e1];return _0x2aed13;};'use strict';var Sequelize=require(_0xf6b5('0x0'));module[_0xf6b5('0x1')]={'name':{'type':Sequelize['STRING'],'unique':_0xf6b5('0x2'),'allowNull':![],'validate':{'is':/[A-Za-z0-9._\\+*!-]+/,'notEmpty':!![]}},'type':{'type':Sequelize[_0xf6b5('0x3')]('ivr'),'allowNull':![],'defaultValue':'ivr'},'description':{'type':Sequelize[_0xf6b5('0x4')]},'active':{'type':Sequelize[_0xf6b5('0x5')],'defaultValue':0x0,'comment':_0xf6b5('0x6')},'limitCalls':{'type':Sequelize[_0xf6b5('0x7')](0x4)['UNSIGNED'],'defaultValue':0x1e,'validate':{'min':0x1,'max':0xc8},'comment':_0xf6b5('0x8')},'dialOriginateCallerIdName':{'type':Sequelize[_0xf6b5('0x4')]},'dialOriginateCallerIdNumber':{'type':Sequelize[_0xf6b5('0x4')]},'dialOriginateTimeout':{'type':Sequelize['INTEGER'](0x3)[_0xf6b5('0x9')],'defaultValue':0x1e,'validate':{'min':0x1,'max':0x3e7},'comment':'Originate\x20Timeout\x20Seconds\x20(min:1,\x20max:999)'},'dialCongestionMaxRetry':{'type':Sequelize[_0xf6b5('0x7')](0x3)[_0xf6b5('0x9')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xf6b5('0xa')},'dialCongestionRetryFrequency':{'type':Sequelize[_0xf6b5('0x7')](0x5)[_0xf6b5('0x9')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xf6b5('0xb')},'dialBusyMaxRetry':{'type':Sequelize['INTEGER'](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xf6b5('0xc')},'dialBusyRetryFrequency':{'type':Sequelize[_0xf6b5('0x7')](0x5)[_0xf6b5('0x9')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xf6b5('0xd')},'dialNoAnswerMaxRetry':{'type':Sequelize['INTEGER'](0x3)['UNSIGNED'],'defaultValue':0x3,'comment':_0xf6b5('0xe')},'dialNoAnswerRetryFrequency':{'type':Sequelize['INTEGER'](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xf6b5('0xf')},'dialGlobalMaxRetry':{'type':Sequelize[_0xf6b5('0x7')](0x3)[_0xf6b5('0x9')],'validate':{'min':0x1,'max':0x3e7},'defaultValue':0x4,'comment':_0xf6b5('0x10')},'dialTimezone':{'type':Sequelize[_0xf6b5('0x4')],'defaultValue':null},'dialGlobalInterval':{'type':Sequelize[_0xf6b5('0x4')],'defaultValue':_0xf6b5('0x11')},'dialCheckDuplicateType':{'type':Sequelize[_0xf6b5('0x3')]('always',_0xf6b5('0x12'),_0xf6b5('0x13')),'defaultValue':_0xf6b5('0x14')},'dialAMDActive':{'type':Sequelize[_0xf6b5('0x5')],'defaultValue':0x0,'comment':'Active/Disactive\x20AMD'},'dialAMDInitialSilence':{'type':Sequelize['INTEGER'](0x9)[_0xf6b5('0x9')],'defaultValue':0x9c4,'validate':{'min':0x0},'comment':_0xf6b5('0x15')},'dialAMDGreeting':{'type':Sequelize[_0xf6b5('0x7')](0x9)[_0xf6b5('0x9')],'defaultValue':0x5dc,'validate':{'min':0x0},'comment':_0xf6b5('0x16')},'dialAMDAfterGreetingSilence':{'type':Sequelize[_0xf6b5('0x7')](0x9)['UNSIGNED'],'defaultValue':0x320,'validate':{'min':0x0},'comment':_0xf6b5('0x17')},'dialAMDTotalAnalysisTime':{'type':Sequelize[_0xf6b5('0x7')](0x9)[_0xf6b5('0x9')],'defaultValue':0x1388,'validate':{'min':0x0},'comment':_0xf6b5('0x18')},'dialAMDMinWordLength':{'type':Sequelize[_0xf6b5('0x7')](0x9)['UNSIGNED'],'defaultValue':0x64,'validate':{'min':0x0},'comment':_0xf6b5('0x19')},'dialAMDBetweenWordsSilence':{'type':Sequelize[_0xf6b5('0x7')](0x9)[_0xf6b5('0x9')],'defaultValue':0x32,'validate':{'min':0x0},'comment':'#AMD\x20Between\x20Words\x20Silence'},'dialAMDMaximumNumberOfWords':{'type':Sequelize[_0xf6b5('0x7')](0x9)[_0xf6b5('0x9')],'defaultValue':0x3,'validate':{'min':0x0},'comment':'#AMD\x20Maximum\x20Number\x20Of\x20Words'},'dialAMDSilenceThreshold':{'type':Sequelize[_0xf6b5('0x7')](0x5)[_0xf6b5('0x9')],'validate':{'min':0x0,'max':0x7fff},'defaultValue':0x100,'comment':_0xf6b5('0x1a')},'dialAMDMaximumWordLength':{'type':Sequelize['INTEGER'](0x9)[_0xf6b5('0x9')],'defaultValue':0x1388,'validate':{'min':0x0},'comment':'#AMD\x20Maximum\x20Word\x20Length'},'dialOrderByScheduledAt':{'type':Sequelize['ENUM']('DESC','ASC'),'defaultValue':_0xf6b5('0x1b')},'dialPrefix':{'type':Sequelize[_0xf6b5('0x4')],'defaultValue':null},'dialRandomLastDigitCallerIdNumber':{'type':Sequelize[_0xf6b5('0x7')](0x3)['UNSIGNED'],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':_0xf6b5('0x1c')},'dialCutDigit':{'type':Sequelize[_0xf6b5('0x7')](0x3)[_0xf6b5('0x9')],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':'Cut\x20Digit\x20(min:1,\x20max:15)'},'dialNoSuchNumberMaxRetry':{'type':Sequelize[_0xf6b5('0x7')](0x3)[_0xf6b5('0x9')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xf6b5('0x1d')},'dialNoSuchNumberRetryFrequency':{'type':Sequelize[_0xf6b5('0x7')](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xf6b5('0x1e')},'dialDropMaxRetry':{'type':Sequelize[_0xf6b5('0x7')](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xf6b5('0x1f')},'dialDropRetryFrequency':{'type':Sequelize[_0xf6b5('0x7')](0x5)[_0xf6b5('0x9')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xf6b5('0x20')},'dialAbandonedMaxRetry':{'type':Sequelize[_0xf6b5('0x7')](0x3)[_0xf6b5('0x9')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xf6b5('0x21')},'dialAbandonedRetryFrequency':{'type':Sequelize[_0xf6b5('0x7')](0x5)[_0xf6b5('0x9')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xf6b5('0x22')},'dialMachineMaxRetry':{'type':Sequelize['INTEGER'](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xf6b5('0x23')},'dialMachineRetryFrequency':{'type':Sequelize['INTEGER'](0x5)[_0xf6b5('0x9')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xf6b5('0x24')},'dialAgentRejectMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0xf6b5('0x9')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xf6b5('0x25')},'dialAgentRejectRetryFrequency':{'type':Sequelize[_0xf6b5('0x7')](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'AgentReject\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'}};
\ No newline at end of file
diff --git a/server/api/campaign/campaign.controller.js b/server/api/campaign/campaign.controller.js
index 89f1406..cb4f7d2 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 _0xd7e3=['merge','VIRTUAL','options','findAll','params','includeAll','include','find','catch','create','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','clone','omit','createdAt','updatedAt','body','user','IvrCampaigns','findOne','CmHopper','nolimit','order','getHopperHistories','CmHopperHistory','hasOwnProperty','CampaignId','getHopperFinals','CmHopperFinal','pick','getHopperBlacks','CmHopperBlack','rows','getLists','addLists','spread','dialCheckDuplicateType','always','insert','into','fromQuery','phone','scheduledAt','ContactId','ListId','select','field','NOW()','CmListId','toString','from','cm_contacts','ListId\x20=\x20?','phone\x20NOT\x20IN\x20(?)','COALESCE(calleridnum,\x27\x27)','cm_hopper_final','COALESCE(phone,\x27\x27)','cm_hopper','CampaignId\x20=\x20?','onlyIfOpen','deletedAt\x20IS\x20NULL','phone\x20IS\x20NOT\x20NULL','push','sequelize','all','removeLists','ids','CmList','getBlackLists','cm_hopper_black','removeBlackLists','eml-format','rimraf','fast-json-patch','bluebird','mustache','util','sox','to-csv','fs-extra','lodash','squel','crypto','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','sendStatus','status','offset','undefined','limit','count','json','apply','save','update','then','get','destroy','error','name','send','index','map','Campaign','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','sort','filter','where'];(function(_0x5d1722,_0x437c1b){var _0x446bc2=function(_0x5c5fa4){while(--_0x5c5fa4){_0x5d1722['push'](_0x5d1722['shift']());}};_0x446bc2(++_0x437c1b);}(_0xd7e3,0x1e1));var _0x3d7e=function(_0xd47873,_0x3c84c3){_0xd47873=_0xd47873-0x0;var _0x31b714=_0xd7e3[_0xd47873];return _0x31b714;};'use strict';var emlformat=require(_0x3d7e('0x0'));var rimraf=require(_0x3d7e('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x3d7e('0x2'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x3d7e('0x3'));var Mustache=require(_0x3d7e('0x4'));var util=require(_0x3d7e('0x5'));var path=require('path');var sox=require(_0x3d7e('0x6'));var csv=require(_0x3d7e('0x7'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x3d7e('0x8'));var _=require(_0x3d7e('0x9'));var squel=require(_0x3d7e('0xa'));var crypto=require(_0x3d7e('0xb'));var jsforce=require(_0x3d7e('0xc'));var deskjs=require('desk.js');var toCsv=require(_0x3d7e('0x7'));var querystring=require(_0x3d7e('0xd'));var Papa=require(_0x3d7e('0xe'));var Redis=require(_0x3d7e('0xf'));var authService=require(_0x3d7e('0x10'));var qs=require(_0x3d7e('0x11'));var as=require(_0x3d7e('0x12'));var hardwareService=require(_0x3d7e('0x13'));var logger=require(_0x3d7e('0x14'))(_0x3d7e('0x15'));var utils=require(_0x3d7e('0x16'));var config=require(_0x3d7e('0x17'));var licenseUtil=require(_0x3d7e('0x18'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x24cb63,_0x276c70){_0x276c70=_0x276c70||0xcc;return function(_0x49a55b){if(_0x49a55b){return _0x24cb63[_0x3d7e('0x19')](_0x276c70);}return _0x24cb63['status'](_0x276c70)['end']();};}function respondWithResult(_0x24664e,_0x1f81e4){_0x1f81e4=_0x1f81e4||0xc8;return function(_0x464dc6){if(_0x464dc6){return _0x24664e[_0x3d7e('0x1a')](_0x1f81e4)['json'](_0x464dc6);}};}function respondWithFilteredResult(_0x538e83,_0x4bc159){return function(_0x34c568){if(_0x34c568){var _0x1d2e70=typeof _0x4bc159[_0x3d7e('0x1b')]===_0x3d7e('0x1c')&&typeof _0x4bc159[_0x3d7e('0x1d')]==='undefined';var _0x2c19fa=_0x34c568[_0x3d7e('0x1e')];var _0x426f9b=_0x1d2e70?0x0:_0x4bc159[_0x3d7e('0x1b')];var _0xf9de45=_0x1d2e70?_0x34c568[_0x3d7e('0x1e')]:_0x4bc159[_0x3d7e('0x1b')]+_0x4bc159['limit'];var _0x52ef44;if(_0xf9de45>=_0x2c19fa){_0xf9de45=_0x2c19fa;_0x52ef44=0xc8;}else{_0x52ef44=0xce;}_0x538e83[_0x3d7e('0x1a')](_0x52ef44);return _0x538e83['set']('Content-Range',_0x426f9b+'-'+_0xf9de45+'/'+_0x2c19fa)[_0x3d7e('0x1f')](_0x34c568);}return null;};}function patchUpdates(_0x11f98a){return function(_0x197aeb){try{jsonpatch[_0x3d7e('0x20')](_0x197aeb,_0x11f98a,!![]);}catch(_0x98b429){return BPromise['reject'](_0x98b429);}return _0x197aeb[_0x3d7e('0x21')]();};}function saveUpdates(_0x51c50b,_0x102394){return function(_0x383c9a){if(_0x383c9a){return _0x383c9a[_0x3d7e('0x22')](_0x51c50b)[_0x3d7e('0x23')](function(_0x5942a2){return _0x5942a2;});}return null;};}function removeEntity(_0x11b90d,_0x3ace06){return function(_0x696f30){if(_0x696f30){return _0x696f30['destroy']()[_0x3d7e('0x23')](function(){var _0xaf316e=_0x696f30[_0x3d7e('0x24')]({'plain':!![]});var _0x5b54a5='IvrCampaigns';return db['UserProfileResource'][_0x3d7e('0x25')]({'where':{'type':_0x5b54a5,'resourceId':_0xaf316e['id']}})[_0x3d7e('0x23')](function(){return _0x696f30;});})[_0x3d7e('0x23')](function(){_0x11b90d[_0x3d7e('0x1a')](0xcc)['end']();});}};}function handleEntityNotFound(_0x314298,_0x2dac7f){return function(_0x5ce1f8){if(!_0x5ce1f8){_0x314298[_0x3d7e('0x19')](0x194);}return _0x5ce1f8;};}function handleError(_0x5cc56a,_0x25ad3b){_0x25ad3b=_0x25ad3b||0x1f4;return function(_0x2035e2){logger[_0x3d7e('0x26')](_0x2035e2['stack']);if(_0x2035e2[_0x3d7e('0x27')]){delete _0x2035e2['name'];}_0x5cc56a[_0x3d7e('0x1a')](_0x25ad3b)[_0x3d7e('0x28')](_0x2035e2);};}exports[_0x3d7e('0x29')]=function(_0x58ea44,_0x4763de){var _0x3bec2f={},_0x89ae48={},_0x46b4e4={'count':0x0,'rows':[]};var _0xa26b7f=_[_0x3d7e('0x2a')](db[_0x3d7e('0x2b')][_0x3d7e('0x2c')],function(_0x18722d){return{'name':_0x18722d[_0x3d7e('0x2d')],'type':_0x18722d[_0x3d7e('0x2e')][_0x3d7e('0x2f')]};});_0x89ae48[_0x3d7e('0x30')]=_[_0x3d7e('0x2a')](_0xa26b7f,_0x3d7e('0x27'));_0x89ae48[_0x3d7e('0x31')]=_[_0x3d7e('0x32')](_0x58ea44[_0x3d7e('0x31')]);_0x89ae48[_0x3d7e('0x33')]=_[_0x3d7e('0x34')](_0x89ae48[_0x3d7e('0x30')],_0x89ae48[_0x3d7e('0x31')]);_0x3bec2f[_0x3d7e('0x35')]=_[_0x3d7e('0x34')](_0x89ae48[_0x3d7e('0x30')],qs[_0x3d7e('0x36')](_0x58ea44[_0x3d7e('0x31')][_0x3d7e('0x36')]));_0x3bec2f['attributes']=_0x3bec2f['attributes'][_0x3d7e('0x37')]?_0x3bec2f['attributes']:_0x89ae48['model'];if(!_0x58ea44[_0x3d7e('0x31')]['hasOwnProperty']('nolimit')){_0x3bec2f[_0x3d7e('0x1d')]=qs['limit'](_0x58ea44[_0x3d7e('0x31')][_0x3d7e('0x1d')]);_0x3bec2f[_0x3d7e('0x1b')]=qs['offset'](_0x58ea44[_0x3d7e('0x31')][_0x3d7e('0x1b')]);}_0x3bec2f['order']=qs[_0x3d7e('0x38')](_0x58ea44['query'][_0x3d7e('0x38')]);_0x3bec2f['where']=qs['filters'](_['pick'](_0x58ea44['query'],_0x89ae48[_0x3d7e('0x33')]),_0xa26b7f);if(_0x58ea44[_0x3d7e('0x31')][_0x3d7e('0x39')]){_0x3bec2f[_0x3d7e('0x3a')]=_[_0x3d7e('0x3b')](_0x3bec2f['where'],{'$or':_[_0x3d7e('0x2a')](_0xa26b7f,function(_0x5ba565){if(_0x5ba565[_0x3d7e('0x2e')]!==_0x3d7e('0x3c')){var _0x9759a5={};_0x9759a5[_0x5ba565[_0x3d7e('0x27')]]={'$like':'%'+_0x58ea44[_0x3d7e('0x31')]['filter']+'%'};return _0x9759a5;}})});}_0x3bec2f=_['merge']({},_0x3bec2f,_0x58ea44[_0x3d7e('0x3d')]);var _0x51171c={'where':_0x3bec2f[_0x3d7e('0x3a')]};return db['Campaign'][_0x3d7e('0x1e')](_0x51171c)[_0x3d7e('0x23')](function(_0x398e20){_0x46b4e4[_0x3d7e('0x1e')]=_0x398e20;if(_0x58ea44['query']['includeAll']){_0x3bec2f['include']=[{'all':!![]}];}return db[_0x3d7e('0x2b')][_0x3d7e('0x3e')](_0x3bec2f);})[_0x3d7e('0x23')](function(_0x5b4516){_0x46b4e4['rows']=_0x5b4516;return _0x46b4e4;})[_0x3d7e('0x23')](respondWithFilteredResult(_0x4763de,_0x3bec2f))['catch'](handleError(_0x4763de,null));};exports['show']=function(_0x13bc5b,_0x473f45){var _0x515b6c={'raw':![],'where':{'id':_0x13bc5b[_0x3d7e('0x3f')]['id']}},_0x1ef1db={};_0x1ef1db[_0x3d7e('0x30')]=_[_0x3d7e('0x32')](db['Campaign'][_0x3d7e('0x2c')]);_0x1ef1db[_0x3d7e('0x31')]=_['keys'](_0x13bc5b['query']);_0x1ef1db[_0x3d7e('0x33')]=_[_0x3d7e('0x34')](_0x1ef1db[_0x3d7e('0x30')],_0x1ef1db[_0x3d7e('0x31')]);_0x515b6c[_0x3d7e('0x35')]=_[_0x3d7e('0x34')](_0x1ef1db[_0x3d7e('0x30')],qs[_0x3d7e('0x36')](_0x13bc5b[_0x3d7e('0x31')][_0x3d7e('0x36')]));_0x515b6c[_0x3d7e('0x35')]=_0x515b6c[_0x3d7e('0x35')]['length']?_0x515b6c[_0x3d7e('0x35')]:_0x1ef1db['model'];if(_0x13bc5b[_0x3d7e('0x31')][_0x3d7e('0x40')]){_0x515b6c[_0x3d7e('0x41')]=[{'all':!![]}];}_0x515b6c=_['merge']({},_0x515b6c,_0x13bc5b['options']);return db['Campaign'][_0x3d7e('0x42')](_0x515b6c)['then'](handleEntityNotFound(_0x473f45,null))['then'](respondWithResult(_0x473f45,null))[_0x3d7e('0x43')](handleError(_0x473f45,null));};exports[_0x3d7e('0x44')]=function(_0x165717,_0x5a532a){return db[_0x3d7e('0x2b')][_0x3d7e('0x44')](_0x165717['body'],{})[_0x3d7e('0x23')](function(_0x43877e){var _0x1c3cb9=_0x165717['user'][_0x3d7e('0x24')]({'plain':!![]});if(!_0x1c3cb9)throw new Error(_0x3d7e('0x45'));if(_0x1c3cb9[_0x3d7e('0x46')]==='user'){var _0x127912=_0x43877e[_0x3d7e('0x24')]({'plain':!![]});var _0x308a64='IvrCampaigns';return db[_0x3d7e('0x47')][_0x3d7e('0x42')]({'where':{'name':_0x308a64,'userProfileId':_0x1c3cb9[_0x3d7e('0x48')]},'raw':!![]})[_0x3d7e('0x23')](function(_0x426105){if(_0x426105&&_0x426105[_0x3d7e('0x49')]===0x0){return db[_0x3d7e('0x4a')]['create']({'name':_0x127912[_0x3d7e('0x27')],'resourceId':_0x127912['id'],'type':_0x426105[_0x3d7e('0x27')],'sectionId':_0x426105['id']},{})[_0x3d7e('0x23')](function(){return _0x43877e;});}else{return _0x43877e;}})[_0x3d7e('0x43')](function(_0x5afc5e){logger['error'](_0x3d7e('0x4b'),_0x5afc5e);throw _0x5afc5e;});}return _0x43877e;})['then'](respondWithResult(_0x5a532a,0xc9))[_0x3d7e('0x43')](handleError(_0x5a532a,null));};exports[_0x3d7e('0x4c')]=function(_0x5c4e65,_0x45bef1){var _0xdb15c8={'where':{'id':_0x5c4e65[_0x3d7e('0x3f')]['id']}},_0x534ad6={};_0x534ad6[_0x3d7e('0x30')]=_[_0x3d7e('0x32')](db[_0x3d7e('0x2b')][_0x3d7e('0x2c')]);_0xdb15c8[_0x3d7e('0x35')]=_['intersection'](_0x534ad6[_0x3d7e('0x30')],qs['fields'](_0x5c4e65[_0x3d7e('0x31')][_0x3d7e('0x36')]));_0xdb15c8[_0x3d7e('0x35')]=_0xdb15c8[_0x3d7e('0x35')]['length']?_0xdb15c8[_0x3d7e('0x35')]:_0x534ad6[_0x3d7e('0x30')];if(_0x5c4e65[_0x3d7e('0x31')][_0x3d7e('0x40')]){_0xdb15c8['include']=[{'all':!![]}];}_0xdb15c8=_[_0x3d7e('0x3b')]({},_0xdb15c8,_0x5c4e65[_0x3d7e('0x3d')]);return db['Campaign'][_0x3d7e('0x42')](_0xdb15c8)[_0x3d7e('0x23')](handleEntityNotFound(_0x45bef1,null))[_0x3d7e('0x23')](function(_0x1faace){if(_0x1faace){var _0xc6b3fa=_0x1faace[_0x3d7e('0x24')]({'plain':!![]});_0xc6b3fa=qs[_0x3d7e('0x4d')](_0xc6b3fa,['id',_0x3d7e('0x4e'),_0x3d7e('0x4f')]);_0x5c4e65[_0x3d7e('0x50')]=_[_0x3d7e('0x4d')](_0x5c4e65['body'],['id',_0x3d7e('0x4e'),_0x3d7e('0x4f')]);return db[_0x3d7e('0x2b')][_0x3d7e('0x44')](_['merge'](_0xc6b3fa,_0x5c4e65[_0x3d7e('0x50')]),{'include':_0x5c4e65['query'][_0x3d7e('0x40')]?[{'all':!![]}]:undefined})[_0x3d7e('0x23')](function(_0x31ab22){var _0x2c47b6=_0x5c4e65[_0x3d7e('0x51')][_0x3d7e('0x24')]({'plain':!![]});if(!_0x2c47b6)throw new Error(_0x3d7e('0x45'));if(_0x2c47b6[_0x3d7e('0x46')]===_0x3d7e('0x51')){var _0xd01b9a=_0x31ab22['get']({'plain':!![]});var _0x5921a0=_0x3d7e('0x52');return db['UserProfileSection'][_0x3d7e('0x42')]({'where':{'name':_0x5921a0,'userProfileId':_0x2c47b6[_0x3d7e('0x48')]},'raw':!![]})[_0x3d7e('0x23')](function(_0x1d65d0){if(_0x1d65d0&&_0x1d65d0[_0x3d7e('0x49')]===0x0){return db[_0x3d7e('0x4a')]['create']({'name':_0xd01b9a[_0x3d7e('0x27')],'resourceId':_0xd01b9a['id'],'type':_0x1d65d0[_0x3d7e('0x27')],'sectionId':_0x1d65d0['id']},{})['then'](function(){return _0x31ab22;});}else{return _0x31ab22;}})[_0x3d7e('0x43')](function(_0x19c1f2){logger[_0x3d7e('0x26')](_0x3d7e('0x4b'),_0x19c1f2);throw _0x19c1f2;});}return _0x31ab22;});}})[_0x3d7e('0x23')](respondWithResult(_0x45bef1,0xc9))[_0x3d7e('0x43')](handleError(_0x45bef1,null));};exports[_0x3d7e('0x22')]=function(_0x184311,_0x1036a7){if(_0x184311[_0x3d7e('0x50')]['id']){delete _0x184311[_0x3d7e('0x50')]['id'];}return db[_0x3d7e('0x2b')][_0x3d7e('0x42')]({'where':{'id':_0x184311[_0x3d7e('0x3f')]['id']}})[_0x3d7e('0x23')](handleEntityNotFound(_0x1036a7,null))[_0x3d7e('0x23')](saveUpdates(_0x184311['body'],null))[_0x3d7e('0x23')](respondWithResult(_0x1036a7,null))['catch'](handleError(_0x1036a7,null));};exports[_0x3d7e('0x25')]=function(_0xd75a81,_0x25fcbd){return db['Campaign']['find']({'where':{'id':_0xd75a81['params']['id']}})[_0x3d7e('0x23')](handleEntityNotFound(_0x25fcbd,null))[_0x3d7e('0x23')](removeEntity(_0x25fcbd,null))['catch'](handleError(_0x25fcbd,null));};exports['getHoppers']=function(_0xe56775,_0x28f16b,_0x558344){var _0x403e83={'raw':!![],'where':{}};var _0x4ab858={};var _0x11c059={'count':0x0,'rows':[]};return db['Campaign'][_0x3d7e('0x53')]({'where':{'id':_0xe56775['params']['id']}})[_0x3d7e('0x23')](handleEntityNotFound(_0x28f16b,null))['then'](function(_0x742910){if(_0x742910){_0x4ab858[_0x3d7e('0x30')]=_[_0x3d7e('0x32')](db[_0x3d7e('0x54')][_0x3d7e('0x2c')]);_0x4ab858[_0x3d7e('0x31')]=_[_0x3d7e('0x32')](_0xe56775[_0x3d7e('0x31')]);_0x4ab858['filters']=_['intersection'](_0x4ab858['model'],_0x4ab858[_0x3d7e('0x31')]);_0x403e83[_0x3d7e('0x35')]=_['intersection'](_0x4ab858[_0x3d7e('0x30')],qs[_0x3d7e('0x36')](_0xe56775[_0x3d7e('0x31')][_0x3d7e('0x36')]));_0x403e83[_0x3d7e('0x35')]=_0x403e83['attributes']['length']?_0x403e83[_0x3d7e('0x35')]:_0x4ab858['model'];if(!_0xe56775[_0x3d7e('0x31')]['hasOwnProperty'](_0x3d7e('0x55'))){_0x403e83[_0x3d7e('0x1d')]=qs['limit'](_0xe56775['query'][_0x3d7e('0x1d')]);_0x403e83['offset']=qs[_0x3d7e('0x1b')](_0xe56775[_0x3d7e('0x31')][_0x3d7e('0x1b')]);}_0x403e83[_0x3d7e('0x56')]=qs[_0x3d7e('0x38')](_0xe56775[_0x3d7e('0x31')][_0x3d7e('0x38')]);_0x403e83[_0x3d7e('0x3a')]=qs[_0x3d7e('0x33')](_['pick'](_0xe56775['query'],_0x4ab858['filters']));_0x403e83[_0x3d7e('0x3a')]['CampaignId']=_0x742910['id'];if(_0xe56775[_0x3d7e('0x31')][_0x3d7e('0x39')]){_0x403e83['where']=_[_0x3d7e('0x3b')](_0x403e83['where'],{'$or':_[_0x3d7e('0x2a')](_0x403e83['attributes'],function(_0x3118eb){var _0x4f33b2={};_0x4f33b2[_0x3118eb]={'$like':'%'+_0xe56775['query'][_0x3d7e('0x39')]+'%'};return _0x4f33b2;})});}_0x403e83=_['merge']({},_0x403e83,_0xe56775[_0x3d7e('0x3d')]);return db['CmHopper'][_0x3d7e('0x1e')]({'where':_0x403e83[_0x3d7e('0x3a')]})[_0x3d7e('0x23')](function(_0xa45d7d){_0x11c059[_0x3d7e('0x1e')]=_0xa45d7d;if(_0xe56775[_0x3d7e('0x31')][_0x3d7e('0x40')]){_0x403e83['include']=[{'all':!![]}];}return db['CmHopper']['findAll'](_0x403e83);})[_0x3d7e('0x23')](function(_0x34b61a){_0x11c059['rows']=_0x34b61a;return _0x11c059;});}})['then'](respondWithFilteredResult(_0x28f16b,_0x403e83))[_0x3d7e('0x43')](handleError(_0x28f16b,null));};exports[_0x3d7e('0x57')]=function(_0x2e0ea9,_0x46bdca,_0x21dacb){var _0x56541a={'raw':!![],'where':{}};var _0x291908={};var _0x36626d={'count':0x0,'rows':[]};return db[_0x3d7e('0x2b')][_0x3d7e('0x53')]({'where':{'id':_0x2e0ea9[_0x3d7e('0x3f')]['id']}})[_0x3d7e('0x23')](handleEntityNotFound(_0x46bdca,null))['then'](function(_0x309adf){if(_0x309adf){_0x291908[_0x3d7e('0x30')]=_['keys'](db[_0x3d7e('0x58')]['rawAttributes']);_0x291908[_0x3d7e('0x31')]=_[_0x3d7e('0x32')](_0x2e0ea9[_0x3d7e('0x31')]);_0x291908[_0x3d7e('0x33')]=_[_0x3d7e('0x34')](_0x291908[_0x3d7e('0x30')],_0x291908['query']);_0x56541a[_0x3d7e('0x35')]=_[_0x3d7e('0x34')](_0x291908[_0x3d7e('0x30')],qs[_0x3d7e('0x36')](_0x2e0ea9[_0x3d7e('0x31')][_0x3d7e('0x36')]));_0x56541a[_0x3d7e('0x35')]=_0x56541a[_0x3d7e('0x35')][_0x3d7e('0x37')]?_0x56541a[_0x3d7e('0x35')]:_0x291908[_0x3d7e('0x30')];if(!_0x2e0ea9[_0x3d7e('0x31')][_0x3d7e('0x59')](_0x3d7e('0x55'))){_0x56541a[_0x3d7e('0x1d')]=qs[_0x3d7e('0x1d')](_0x2e0ea9[_0x3d7e('0x31')][_0x3d7e('0x1d')]);_0x56541a['offset']=qs[_0x3d7e('0x1b')](_0x2e0ea9['query'][_0x3d7e('0x1b')]);}_0x56541a['order']=qs[_0x3d7e('0x38')](_0x2e0ea9[_0x3d7e('0x31')][_0x3d7e('0x38')]);_0x56541a['where']=qs[_0x3d7e('0x33')](_['pick'](_0x2e0ea9['query'],_0x291908[_0x3d7e('0x33')]));_0x56541a[_0x3d7e('0x3a')][_0x3d7e('0x5a')]=_0x309adf['id'];if(_0x2e0ea9[_0x3d7e('0x31')]['filter']){_0x56541a['where']=_[_0x3d7e('0x3b')](_0x56541a[_0x3d7e('0x3a')],{'$or':_[_0x3d7e('0x2a')](_0x56541a['attributes'],function(_0x2b41e9){var _0x28b233={};_0x28b233[_0x2b41e9]={'$like':'%'+_0x2e0ea9[_0x3d7e('0x31')][_0x3d7e('0x39')]+'%'};return _0x28b233;})});}_0x56541a=_['merge']({},_0x56541a,_0x2e0ea9[_0x3d7e('0x3d')]);return db[_0x3d7e('0x58')][_0x3d7e('0x1e')]({'where':_0x56541a['where']})[_0x3d7e('0x23')](function(_0xa0d38a){_0x36626d[_0x3d7e('0x1e')]=_0xa0d38a;if(_0x2e0ea9['query'][_0x3d7e('0x40')]){_0x56541a[_0x3d7e('0x41')]=[{'all':!![]}];}return db['CmHopperHistory'][_0x3d7e('0x3e')](_0x56541a);})[_0x3d7e('0x23')](function(_0x13f3e7){_0x36626d['rows']=_0x13f3e7;return _0x36626d;});}})[_0x3d7e('0x23')](respondWithFilteredResult(_0x46bdca,_0x56541a))[_0x3d7e('0x43')](handleError(_0x46bdca,null));};exports[_0x3d7e('0x5b')]=function(_0x47ff3e,_0x4b0cd3,_0xb688da){var _0x4b9a80={'raw':!![],'where':{}};var _0x3e7374={};var _0x29f5d2={'count':0x0,'rows':[]};return db[_0x3d7e('0x2b')]['findOne']({'where':{'id':_0x47ff3e[_0x3d7e('0x3f')]['id']}})[_0x3d7e('0x23')](handleEntityNotFound(_0x4b0cd3,null))[_0x3d7e('0x23')](function(_0x3469e1){if(_0x3469e1){_0x3e7374[_0x3d7e('0x30')]=_['keys'](db[_0x3d7e('0x5c')][_0x3d7e('0x2c')]);_0x3e7374['query']=_[_0x3d7e('0x32')](_0x47ff3e['query']);_0x3e7374[_0x3d7e('0x33')]=_[_0x3d7e('0x34')](_0x3e7374[_0x3d7e('0x30')],_0x3e7374[_0x3d7e('0x31')]);_0x4b9a80['attributes']=_[_0x3d7e('0x34')](_0x3e7374[_0x3d7e('0x30')],qs[_0x3d7e('0x36')](_0x47ff3e['query'][_0x3d7e('0x36')]));_0x4b9a80[_0x3d7e('0x35')]=_0x4b9a80['attributes'][_0x3d7e('0x37')]?_0x4b9a80[_0x3d7e('0x35')]:_0x3e7374[_0x3d7e('0x30')];if(!_0x47ff3e[_0x3d7e('0x31')][_0x3d7e('0x59')](_0x3d7e('0x55'))){_0x4b9a80[_0x3d7e('0x1d')]=qs[_0x3d7e('0x1d')](_0x47ff3e[_0x3d7e('0x31')][_0x3d7e('0x1d')]);_0x4b9a80[_0x3d7e('0x1b')]=qs[_0x3d7e('0x1b')](_0x47ff3e[_0x3d7e('0x31')]['offset']);}_0x4b9a80[_0x3d7e('0x56')]=qs[_0x3d7e('0x38')](_0x47ff3e[_0x3d7e('0x31')][_0x3d7e('0x38')]);_0x4b9a80[_0x3d7e('0x3a')]=qs[_0x3d7e('0x33')](_[_0x3d7e('0x5d')](_0x47ff3e[_0x3d7e('0x31')],_0x3e7374[_0x3d7e('0x33')]));_0x4b9a80[_0x3d7e('0x3a')][_0x3d7e('0x5a')]=_0x3469e1['id'];if(_0x47ff3e[_0x3d7e('0x31')][_0x3d7e('0x39')]){_0x4b9a80[_0x3d7e('0x3a')]=_[_0x3d7e('0x3b')](_0x4b9a80[_0x3d7e('0x3a')],{'$or':_[_0x3d7e('0x2a')](_0x4b9a80[_0x3d7e('0x35')],function(_0x3497ff){var _0x2ed049={};_0x2ed049[_0x3497ff]={'$like':'%'+_0x47ff3e[_0x3d7e('0x31')][_0x3d7e('0x39')]+'%'};return _0x2ed049;})});}_0x4b9a80=_[_0x3d7e('0x3b')]({},_0x4b9a80,_0x47ff3e[_0x3d7e('0x3d')]);return db[_0x3d7e('0x5c')][_0x3d7e('0x1e')]({'where':_0x4b9a80[_0x3d7e('0x3a')]})[_0x3d7e('0x23')](function(_0x18d346){_0x29f5d2[_0x3d7e('0x1e')]=_0x18d346;if(_0x47ff3e[_0x3d7e('0x31')][_0x3d7e('0x40')]){_0x4b9a80[_0x3d7e('0x41')]=[{'all':!![]}];}return db[_0x3d7e('0x5c')][_0x3d7e('0x3e')](_0x4b9a80);})['then'](function(_0x2692da){_0x29f5d2['rows']=_0x2692da;return _0x29f5d2;});}})[_0x3d7e('0x23')](respondWithFilteredResult(_0x4b0cd3,_0x4b9a80))[_0x3d7e('0x43')](handleError(_0x4b0cd3,null));};exports[_0x3d7e('0x5e')]=function(_0x45b8d7,_0x37f0f5,_0x23b7c9){var _0x555f13={'raw':!![],'where':{}};var _0x1eea80={};var _0x255712={'count':0x0,'rows':[]};return db[_0x3d7e('0x2b')][_0x3d7e('0x53')]({'where':{'id':_0x45b8d7[_0x3d7e('0x3f')]['id']}})[_0x3d7e('0x23')](handleEntityNotFound(_0x37f0f5,null))[_0x3d7e('0x23')](function(_0x505f59){if(_0x505f59){_0x1eea80[_0x3d7e('0x30')]=_[_0x3d7e('0x32')](db[_0x3d7e('0x5f')][_0x3d7e('0x2c')]);_0x1eea80['query']=_[_0x3d7e('0x32')](_0x45b8d7[_0x3d7e('0x31')]);_0x1eea80[_0x3d7e('0x33')]=_['intersection'](_0x1eea80[_0x3d7e('0x30')],_0x1eea80[_0x3d7e('0x31')]);_0x555f13[_0x3d7e('0x35')]=_['intersection'](_0x1eea80[_0x3d7e('0x30')],qs[_0x3d7e('0x36')](_0x45b8d7[_0x3d7e('0x31')][_0x3d7e('0x36')]));_0x555f13[_0x3d7e('0x35')]=_0x555f13[_0x3d7e('0x35')][_0x3d7e('0x37')]?_0x555f13[_0x3d7e('0x35')]:_0x1eea80[_0x3d7e('0x30')];if(!_0x45b8d7['query'][_0x3d7e('0x59')]('nolimit')){_0x555f13[_0x3d7e('0x1d')]=qs[_0x3d7e('0x1d')](_0x45b8d7[_0x3d7e('0x31')]['limit']);_0x555f13[_0x3d7e('0x1b')]=qs[_0x3d7e('0x1b')](_0x45b8d7['query'][_0x3d7e('0x1b')]);}_0x555f13[_0x3d7e('0x56')]=qs[_0x3d7e('0x38')](_0x45b8d7[_0x3d7e('0x31')][_0x3d7e('0x38')]);_0x555f13[_0x3d7e('0x3a')]=qs[_0x3d7e('0x33')](_[_0x3d7e('0x5d')](_0x45b8d7[_0x3d7e('0x31')],_0x1eea80['filters']));_0x555f13[_0x3d7e('0x3a')][_0x3d7e('0x5a')]=_0x505f59['id'];if(_0x45b8d7[_0x3d7e('0x31')][_0x3d7e('0x39')]){_0x555f13[_0x3d7e('0x3a')]=_[_0x3d7e('0x3b')](_0x555f13[_0x3d7e('0x3a')],{'$or':_[_0x3d7e('0x2a')](_0x555f13[_0x3d7e('0x35')],function(_0xcf1df7){var _0x1663f1={};_0x1663f1[_0xcf1df7]={'$like':'%'+_0x45b8d7['query'][_0x3d7e('0x39')]+'%'};return _0x1663f1;})});}_0x555f13=_[_0x3d7e('0x3b')]({},_0x555f13,_0x45b8d7['options']);return db[_0x3d7e('0x5f')]['count']({'where':_0x555f13[_0x3d7e('0x3a')]})[_0x3d7e('0x23')](function(_0x3027fa){_0x255712[_0x3d7e('0x1e')]=_0x3027fa;if(_0x45b8d7[_0x3d7e('0x31')][_0x3d7e('0x40')]){_0x555f13[_0x3d7e('0x41')]=[{'all':!![]}];}return db[_0x3d7e('0x5f')][_0x3d7e('0x3e')](_0x555f13);})['then'](function(_0x461df2){_0x255712[_0x3d7e('0x60')]=_0x461df2;return _0x255712;});}})[_0x3d7e('0x23')](respondWithFilteredResult(_0x37f0f5,_0x555f13))[_0x3d7e('0x43')](handleError(_0x37f0f5,null));};exports[_0x3d7e('0x61')]=function(_0x1e2745,_0x402e74,_0x57a5aa){var _0x251605={};var _0x3ae8ac={};var _0x263e0f;var _0x3f2b04;return db[_0x3d7e('0x2b')]['findOne']({'where':{'id':_0x1e2745['params']['id']}})['then'](handleEntityNotFound(_0x402e74,null))['then'](function(_0x56844d){if(_0x56844d){_0x263e0f=_0x56844d;_0x3ae8ac[_0x3d7e('0x30')]=_[_0x3d7e('0x32')](db['CmList'][_0x3d7e('0x2c')]);_0x3ae8ac[_0x3d7e('0x31')]=_[_0x3d7e('0x32')](_0x1e2745[_0x3d7e('0x31')]);_0x3ae8ac[_0x3d7e('0x33')]=_['intersection'](_0x3ae8ac[_0x3d7e('0x30')],_0x3ae8ac[_0x3d7e('0x31')]);_0x251605[_0x3d7e('0x35')]=_[_0x3d7e('0x34')](_0x3ae8ac[_0x3d7e('0x30')],qs['fields'](_0x1e2745[_0x3d7e('0x31')][_0x3d7e('0x36')]));_0x251605[_0x3d7e('0x35')]=_0x251605[_0x3d7e('0x35')][_0x3d7e('0x37')]?_0x251605['attributes']:_0x3ae8ac['model'];_0x251605[_0x3d7e('0x56')]=qs[_0x3d7e('0x38')](_0x1e2745[_0x3d7e('0x31')][_0x3d7e('0x38')]);_0x251605[_0x3d7e('0x3a')]=qs[_0x3d7e('0x33')](_[_0x3d7e('0x5d')](_0x1e2745[_0x3d7e('0x31')],_0x3ae8ac[_0x3d7e('0x33')]));if(_0x1e2745[_0x3d7e('0x31')][_0x3d7e('0x39')]){_0x251605[_0x3d7e('0x3a')]=_[_0x3d7e('0x3b')](_0x251605['where'],{'$or':_['map'](_0x251605[_0x3d7e('0x35')],function(_0xd2a9e0){var _0xd021f9={};_0xd021f9[_0xd2a9e0]={'$like':'%'+_0x1e2745[_0x3d7e('0x31')][_0x3d7e('0x39')]+'%'};return _0xd021f9;})});}_0x251605=_[_0x3d7e('0x3b')]({},_0x251605,_0x1e2745[_0x3d7e('0x3d')]);return _0x263e0f['getLists'](_0x251605);}})[_0x3d7e('0x23')](function(_0x42bb65){if(_0x42bb65){_0x3f2b04=_0x42bb65[_0x3d7e('0x37')];if(!_0x1e2745[_0x3d7e('0x31')]['hasOwnProperty'](_0x3d7e('0x55'))){_0x251605['limit']=qs[_0x3d7e('0x1d')](_0x1e2745['query'][_0x3d7e('0x1d')]);_0x251605[_0x3d7e('0x1b')]=qs[_0x3d7e('0x1b')](_0x1e2745['query'][_0x3d7e('0x1b')]);}return _0x263e0f[_0x3d7e('0x61')](_0x251605);}})[_0x3d7e('0x23')](function(_0x2078a5){if(_0x2078a5){return _0x2078a5?{'count':_0x3f2b04,'rows':_0x2078a5}:null;}})[_0x3d7e('0x23')](respondWithResult(_0x402e74,null))['catch'](handleError(_0x402e74,null));};exports[_0x3d7e('0x62')]=function(_0x5e7453,_0x3dc0b6,_0x3cba99){var _0x1a115d,_0x59c2a8;return db[_0x3d7e('0x2b')][_0x3d7e('0x42')]({'where':{'id':_0x5e7453[_0x3d7e('0x3f')]['id']}})[_0x3d7e('0x23')](handleEntityNotFound(_0x3dc0b6,null))[_0x3d7e('0x23')](function(_0x13df06){if(_0x13df06){_0x59c2a8=_0x13df06;return _0x13df06[_0x3d7e('0x62')](_0x5e7453[_0x3d7e('0x50')]['ids'],_[_0x3d7e('0x4d')](_0x5e7453[_0x3d7e('0x50')],['ids','id'])||{});}return null;})[_0x3d7e('0x63')](function(_0x3b40cf){var _0x38bd70;_0x1a115d=_0x3b40cf||[];var _0x733794=[];if(_0x3b40cf){for(var _0x2a8023=0x0;_0x2a8023<_0x3b40cf['length'];_0x2a8023+=0x1){var _0xc2727=_0x3b40cf[_0x2a8023][_0x3d7e('0x24')]({'plain':!![]});_0x59c2a8['dialCheckDuplicateType']=_0x5e7453[_0x3d7e('0x50')][_0x3d7e('0x64')]?_0x5e7453[_0x3d7e('0x50')]['dialCheckDuplicateType']:_0x59c2a8[_0x3d7e('0x64')];switch(_0x59c2a8['dialCheckDuplicateType']){case _0x3d7e('0x65'):_0x38bd70=squel[_0x3d7e('0x66')]()[_0x3d7e('0x67')]('cm_hopper')[_0x3d7e('0x68')]([_0x3d7e('0x69'),_0x3d7e('0x6a'),_0x3d7e('0x6b'),_0x3d7e('0x6c'),_0x3d7e('0x5a'),_0x3d7e('0x4e'),_0x3d7e('0x4f')],squel[_0x3d7e('0x6d')]()[_0x3d7e('0x6e')](_0x3d7e('0x69'),_0x3d7e('0x69'))['field'](_0x3d7e('0x6f'),_0x3d7e('0x6a'))['field']('id',_0x3d7e('0x6b'))[_0x3d7e('0x6e')](_0xc2727[_0x3d7e('0x70')][_0x3d7e('0x71')](),_0x3d7e('0x6c'))[_0x3d7e('0x6e')](_0x5e7453[_0x3d7e('0x3f')]['id'][_0x3d7e('0x71')](),_0x3d7e('0x5a'))[_0x3d7e('0x6e')](_0x3d7e('0x6f'),_0x3d7e('0x4e'))['field'](_0x3d7e('0x6f'),_0x3d7e('0x4f'))[_0x3d7e('0x72')](_0x3d7e('0x73'))['where']('deletedAt\x20IS\x20NULL')[_0x3d7e('0x3a')](_0x3d7e('0x74'),_0xc2727['CmListId']['toString']())['where']('phone\x20IS\x20NOT\x20NULL')[_0x3d7e('0x3a')](_0x3d7e('0x75'),squel['select']()[_0x3d7e('0x6e')](_0x3d7e('0x76'))[_0x3d7e('0x72')](_0x3d7e('0x77'))[_0x3d7e('0x3a')]('CampaignId\x20=\x20?',_0x5e7453[_0x3d7e('0x3f')]['id'][_0x3d7e('0x71')]()))[_0x3d7e('0x3a')](_0x3d7e('0x75'),squel[_0x3d7e('0x6d')]()[_0x3d7e('0x6e')](_0x3d7e('0x78'))[_0x3d7e('0x72')](_0x3d7e('0x79'))[_0x3d7e('0x3a')](_0x3d7e('0x7a'),_0x5e7453[_0x3d7e('0x3f')]['id'][_0x3d7e('0x71')]())))['toString']();break;case _0x3d7e('0x7b'):_0x38bd70=squel['insert']()[_0x3d7e('0x67')]('cm_hopper')[_0x3d7e('0x68')]([_0x3d7e('0x69'),'scheduledAt',_0x3d7e('0x6b'),_0x3d7e('0x6c'),_0x3d7e('0x5a'),_0x3d7e('0x4e'),_0x3d7e('0x4f')],squel['select']()[_0x3d7e('0x6e')]('phone',_0x3d7e('0x69'))[_0x3d7e('0x6e')](_0x3d7e('0x6f'),'scheduledAt')['field']('id','ContactId')[_0x3d7e('0x6e')](_0xc2727[_0x3d7e('0x70')]['toString'](),'ListId')[_0x3d7e('0x6e')](_0x5e7453[_0x3d7e('0x3f')]['id'][_0x3d7e('0x71')](),_0x3d7e('0x5a'))[_0x3d7e('0x6e')](_0x3d7e('0x6f'),'createdAt')[_0x3d7e('0x6e')]('NOW()',_0x3d7e('0x4f'))['from'](_0x3d7e('0x73'))[_0x3d7e('0x3a')](_0x3d7e('0x7c'))[_0x3d7e('0x3a')](_0x3d7e('0x74'),_0xc2727[_0x3d7e('0x70')][_0x3d7e('0x71')]())[_0x3d7e('0x3a')](_0x3d7e('0x7d'))[_0x3d7e('0x3a')]('phone\x20NOT\x20IN\x20(?)',squel[_0x3d7e('0x6d')]()[_0x3d7e('0x6e')](_0x3d7e('0x78'))[_0x3d7e('0x72')](_0x3d7e('0x79'))['where'](_0x3d7e('0x7a'),_0x5e7453['params']['id'][_0x3d7e('0x71')]())))['toString']();break;default:_0x38bd70=squel[_0x3d7e('0x66')]()['into']('cm_hopper')[_0x3d7e('0x68')]([_0x3d7e('0x69'),_0x3d7e('0x6a'),_0x3d7e('0x6b'),_0x3d7e('0x6c'),_0x3d7e('0x5a'),_0x3d7e('0x4e'),_0x3d7e('0x4f')],squel['select']()[_0x3d7e('0x6e')](_0x3d7e('0x69'),_0x3d7e('0x69'))[_0x3d7e('0x6e')](_0x3d7e('0x6f'),'scheduledAt')['field']('id',_0x3d7e('0x6b'))[_0x3d7e('0x6e')](_0xc2727['CmListId']['toString'](),_0x3d7e('0x6c'))[_0x3d7e('0x6e')](_0x5e7453[_0x3d7e('0x3f')]['id'][_0x3d7e('0x71')](),_0x3d7e('0x5a'))[_0x3d7e('0x6e')](_0x3d7e('0x6f'),_0x3d7e('0x4e'))[_0x3d7e('0x6e')]('NOW()',_0x3d7e('0x4f'))[_0x3d7e('0x72')](_0x3d7e('0x73'))['where'](_0x3d7e('0x7c'))[_0x3d7e('0x3a')]('ListId\x20=\x20?',_0xc2727[_0x3d7e('0x70')][_0x3d7e('0x71')]())['where']('phone\x20IS\x20NOT\x20NULL'))[_0x3d7e('0x71')]();}_0x733794[_0x3d7e('0x7e')](db[_0x3d7e('0x7f')][_0x3d7e('0x31')](_0x38bd70));}return BPromise[_0x3d7e('0x80')](_0x733794);}})[_0x3d7e('0x23')](function(){return _0x1a115d;})[_0x3d7e('0x23')](respondWithResult(_0x3dc0b6,null))[_0x3d7e('0x43')](handleError(_0x3dc0b6,null));};exports[_0x3d7e('0x81')]=function(_0x130371,_0x267021,_0x193b2d){return db[_0x3d7e('0x2b')][_0x3d7e('0x42')]({'where':{'id':_0x130371[_0x3d7e('0x3f')]['id']}})[_0x3d7e('0x23')](handleEntityNotFound(_0x267021,null))[_0x3d7e('0x23')](function(_0xc388c9){if(_0xc388c9){return _0xc388c9[_0x3d7e('0x81')](_0x130371[_0x3d7e('0x31')][_0x3d7e('0x82')]);}})['then'](function(_0x22df4f){if(_0x22df4f){return db[_0x3d7e('0x54')][_0x3d7e('0x25')]({'where':{'ListId':_0x130371['query']['ids'],'CampaignId':_0x130371[_0x3d7e('0x3f')]['id']}})[_0x3d7e('0x23')](function(){return _0x22df4f;});}})[_0x3d7e('0x23')](respondWithStatusCode(_0x267021,null))[_0x3d7e('0x43')](handleError(_0x267021,null));};exports['getBlackLists']=function(_0x46a5df,_0x4b8062,_0x44513f){var _0x104a2b={};var _0x3dc3d0={};var _0x49fd49;var _0x26e293;return db[_0x3d7e('0x2b')]['findOne']({'where':{'id':_0x46a5df[_0x3d7e('0x3f')]['id']}})[_0x3d7e('0x23')](handleEntityNotFound(_0x4b8062,null))['then'](function(_0x513805){if(_0x513805){_0x49fd49=_0x513805;_0x3dc3d0[_0x3d7e('0x30')]=_[_0x3d7e('0x32')](db[_0x3d7e('0x83')][_0x3d7e('0x2c')]);_0x3dc3d0['query']=_['keys'](_0x46a5df['query']);_0x3dc3d0[_0x3d7e('0x33')]=_[_0x3d7e('0x34')](_0x3dc3d0['model'],_0x3dc3d0[_0x3d7e('0x31')]);_0x104a2b[_0x3d7e('0x35')]=_[_0x3d7e('0x34')](_0x3dc3d0[_0x3d7e('0x30')],qs['fields'](_0x46a5df[_0x3d7e('0x31')][_0x3d7e('0x36')]));_0x104a2b['attributes']=_0x104a2b[_0x3d7e('0x35')][_0x3d7e('0x37')]?_0x104a2b[_0x3d7e('0x35')]:_0x3dc3d0[_0x3d7e('0x30')];_0x104a2b['order']=qs[_0x3d7e('0x38')](_0x46a5df['query']['sort']);_0x104a2b[_0x3d7e('0x3a')]=qs[_0x3d7e('0x33')](_['pick'](_0x46a5df[_0x3d7e('0x31')],_0x3dc3d0[_0x3d7e('0x33')]));if(_0x46a5df[_0x3d7e('0x31')][_0x3d7e('0x39')]){_0x104a2b['where']=_[_0x3d7e('0x3b')](_0x104a2b[_0x3d7e('0x3a')],{'$or':_[_0x3d7e('0x2a')](_0x104a2b['attributes'],function(_0x45340a){var _0x398d72={};_0x398d72[_0x45340a]={'$like':'%'+_0x46a5df['query'][_0x3d7e('0x39')]+'%'};return _0x398d72;})});}_0x104a2b=_['merge']({},_0x104a2b,_0x46a5df[_0x3d7e('0x3d')]);return _0x49fd49[_0x3d7e('0x84')](_0x104a2b);}})[_0x3d7e('0x23')](function(_0x1185e3){if(_0x1185e3){_0x26e293=_0x1185e3[_0x3d7e('0x37')];if(!_0x46a5df['query']['hasOwnProperty'](_0x3d7e('0x55'))){_0x104a2b['limit']=qs[_0x3d7e('0x1d')](_0x46a5df[_0x3d7e('0x31')][_0x3d7e('0x1d')]);_0x104a2b[_0x3d7e('0x1b')]=qs['offset'](_0x46a5df[_0x3d7e('0x31')][_0x3d7e('0x1b')]);}return _0x49fd49['getBlackLists'](_0x104a2b);}})[_0x3d7e('0x23')](function(_0x1f0614){if(_0x1f0614){return _0x1f0614?{'count':_0x26e293,'rows':_0x1f0614}:null;}})['then'](respondWithResult(_0x4b8062,null))[_0x3d7e('0x43')](handleError(_0x4b8062,null));};exports['addBlackLists']=function(_0x1a1ece,_0x4f5060,_0xc90fc0){var _0x100707,_0x36c9d9;return db[_0x3d7e('0x2b')][_0x3d7e('0x42')]({'where':{'id':_0x1a1ece[_0x3d7e('0x3f')]['id']}})[_0x3d7e('0x23')](handleEntityNotFound(_0x4f5060,null))[_0x3d7e('0x23')](function(_0x4b9e8c){if(_0x4b9e8c){_0x36c9d9=_0x4b9e8c;return _0x4b9e8c['addBlackLists'](_0x1a1ece[_0x3d7e('0x50')][_0x3d7e('0x82')],_[_0x3d7e('0x4d')](_0x1a1ece[_0x3d7e('0x50')],[_0x3d7e('0x82'),'id'])||{});}return null;})[_0x3d7e('0x63')](function(_0x6d8d82){var _0xf34c7c;_0x100707=_0x6d8d82||[];var _0xc9b2ab=[];if(_0x6d8d82){for(var _0x17bf0f=0x0;_0x17bf0f<_0x6d8d82[_0x3d7e('0x37')];_0x17bf0f+=0x1){var _0x479f7b=_0x6d8d82[_0x17bf0f][_0x3d7e('0x24')]({'plain':!![]});_0xf34c7c=squel[_0x3d7e('0x66')]()[_0x3d7e('0x67')](_0x3d7e('0x85'))['fromQuery']([_0x3d7e('0x69'),_0x3d7e('0x6b'),_0x3d7e('0x6c'),_0x3d7e('0x5a'),'createdAt',_0x3d7e('0x4f')],squel[_0x3d7e('0x6d')]()[_0x3d7e('0x6e')](_0x3d7e('0x69'),_0x3d7e('0x69'))[_0x3d7e('0x6e')]('id',_0x3d7e('0x6b'))[_0x3d7e('0x6e')](_0x479f7b[_0x3d7e('0x70')][_0x3d7e('0x71')](),'ListId')['field'](_0x1a1ece['params']['id'][_0x3d7e('0x71')](),_0x3d7e('0x5a'))['field'](_0x3d7e('0x6f'),_0x3d7e('0x4e'))[_0x3d7e('0x6e')]('NOW()',_0x3d7e('0x4f'))['from']('cm_contacts')[_0x3d7e('0x3a')]('deletedAt\x20IS\x20NULL')['where'](_0x3d7e('0x74'),_0x479f7b['CmListId']['toString']())[_0x3d7e('0x3a')](_0x3d7e('0x7d')))[_0x3d7e('0x71')]();_0xc9b2ab[_0x3d7e('0x7e')](db[_0x3d7e('0x7f')][_0x3d7e('0x31')](_0xf34c7c));}return BPromise[_0x3d7e('0x80')](_0xc9b2ab);}})[_0x3d7e('0x23')](function(){return _0x100707;})[_0x3d7e('0x23')](respondWithResult(_0x4f5060,null))['catch'](handleError(_0x4f5060,null));};exports[_0x3d7e('0x86')]=function(_0x4d0c81,_0x12cdb7,_0x5b1526){return db[_0x3d7e('0x2b')][_0x3d7e('0x42')]({'where':{'id':_0x4d0c81[_0x3d7e('0x3f')]['id']}})[_0x3d7e('0x23')](handleEntityNotFound(_0x12cdb7,null))[_0x3d7e('0x23')](function(_0x5aae34){if(_0x5aae34){return _0x5aae34[_0x3d7e('0x86')](_0x4d0c81[_0x3d7e('0x31')][_0x3d7e('0x82')]);}})[_0x3d7e('0x23')](function(_0x5375e0){if(_0x5375e0){return db[_0x3d7e('0x5f')][_0x3d7e('0x25')]({'where':{'ListId':_0x4d0c81[_0x3d7e('0x31')][_0x3d7e('0x82')],'CampaignId':_0x4d0c81['params']['id']}})['then'](function(){return _0x5375e0;});}})[_0x3d7e('0x23')](respondWithStatusCode(_0x12cdb7,null))[_0x3d7e('0x43')](handleError(_0x12cdb7,null));};
\ No newline at end of file
+var _0x85c2=['nolimit','order','sort','where','pick','filter','merge','map','VIRTUAL','options','include','findAll','catch','show','params','length','includeAll','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','clone','omit','updatedAt','createdAt','getHoppers','findOne','CmHopper','CampaignId','rows','getHopperHistories','CmHopperHistory','getHopperFinals','CmHopperFinal','CmHopperBlack','getLists','addLists','spread','dialCheckDuplicateType','always','insert','cm_hopper','fromQuery','phone','ListId','select','field','NOW()','scheduledAt','ContactId','CmListId','toString','from','cm_contacts','deletedAt\x20IS\x20NULL','ListId\x20=\x20?','phone\x20IS\x20NOT\x20NULL','phone\x20NOT\x20IN\x20(?)','COALESCE(calleridnum,\x27\x27)','cm_hopper_final','CampaignId\x20=\x20?','COALESCE(phone,\x27\x27)','onlyIfOpen','into','push','sequelize','all','removeLists','ids','CmList','getBlackLists','addBlackLists','cm_hopper_black','removeBlackLists','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','ejs','squel','crypto','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','status','end','offset','undefined','limit','count','Content-Range','json','apply','reject','save','update','then','get','IvrCampaigns','destroy','sendStatus','error','stack','name','send','index','Campaign','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','hasOwnProperty'];(function(_0x57b54c,_0x54ce0d){var _0x59cc19=function(_0xa33bc6){while(--_0xa33bc6){_0x57b54c['push'](_0x57b54c['shift']());}};_0x59cc19(++_0x54ce0d);}(_0x85c2,0xe2));var _0x285c=function(_0x58dc25,_0x49b9d5){_0x58dc25=_0x58dc25-0x0;var _0x21b0a7=_0x85c2[_0x58dc25];return _0x21b0a7;};'use strict';var emlformat=require(_0x285c('0x0'));var rimraf=require(_0x285c('0x1'));var zipdir=require(_0x285c('0x2'));var jsonpatch=require(_0x285c('0x3'));var rp=require(_0x285c('0x4'));var moment=require(_0x285c('0x5'));var BPromise=require(_0x285c('0x6'));var Mustache=require(_0x285c('0x7'));var util=require(_0x285c('0x8'));var path=require(_0x285c('0x9'));var sox=require(_0x285c('0xa'));var csv=require('to-csv');var ejs=require(_0x285c('0xb'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0x285c('0xc'));var crypto=require(_0x285c('0xd'));var jsforce=require(_0x285c('0xe'));var deskjs=require(_0x285c('0xf'));var toCsv=require(_0x285c('0x10'));var querystring=require(_0x285c('0x11'));var Papa=require(_0x285c('0x12'));var Redis=require(_0x285c('0x13'));var authService=require(_0x285c('0x14'));var qs=require(_0x285c('0x15'));var as=require(_0x285c('0x16'));var hardwareService=require(_0x285c('0x17'));var logger=require(_0x285c('0x18'))(_0x285c('0x19'));var utils=require(_0x285c('0x1a'));var config=require(_0x285c('0x1b'));var licenseUtil=require('../../config/license/util');var db=require(_0x285c('0x1c'))['db'];function respondWithStatusCode(_0x5f4663,_0x20956d){_0x20956d=_0x20956d||0xcc;return function(_0x1b9d25){if(_0x1b9d25){return _0x5f4663['sendStatus'](_0x20956d);}return _0x5f4663[_0x285c('0x1d')](_0x20956d)[_0x285c('0x1e')]();};}function respondWithResult(_0x118d9b,_0x2a70a7){_0x2a70a7=_0x2a70a7||0xc8;return function(_0x501b98){if(_0x501b98){return _0x118d9b[_0x285c('0x1d')](_0x2a70a7)['json'](_0x501b98);}};}function respondWithFilteredResult(_0x49b16e,_0x4e0c92){return function(_0xc60564){if(_0xc60564){var _0x432c2e=typeof _0x4e0c92[_0x285c('0x1f')]===_0x285c('0x20')&&typeof _0x4e0c92[_0x285c('0x21')]==='undefined';var _0x8d26b3=_0xc60564['count'];var _0x21e5fb=_0x432c2e?0x0:_0x4e0c92[_0x285c('0x1f')];var _0x360e9d=_0x432c2e?_0xc60564[_0x285c('0x22')]:_0x4e0c92['offset']+_0x4e0c92['limit'];var _0x437d18;if(_0x360e9d>=_0x8d26b3){_0x360e9d=_0x8d26b3;_0x437d18=0xc8;}else{_0x437d18=0xce;}_0x49b16e[_0x285c('0x1d')](_0x437d18);return _0x49b16e['set'](_0x285c('0x23'),_0x21e5fb+'-'+_0x360e9d+'/'+_0x8d26b3)[_0x285c('0x24')](_0xc60564);}return null;};}function patchUpdates(_0x3eba2c){return function(_0x41ef29){try{jsonpatch[_0x285c('0x25')](_0x41ef29,_0x3eba2c,!![]);}catch(_0x8097cc){return BPromise[_0x285c('0x26')](_0x8097cc);}return _0x41ef29[_0x285c('0x27')]();};}function saveUpdates(_0x3f579a,_0x5f10cd){return function(_0x47110e){if(_0x47110e){return _0x47110e[_0x285c('0x28')](_0x3f579a)[_0x285c('0x29')](function(_0x47dc02){return _0x47dc02;});}return null;};}function removeEntity(_0x4b35c7,_0x24b07d){return function(_0xc5d1d8){if(_0xc5d1d8){return _0xc5d1d8['destroy']()[_0x285c('0x29')](function(){var _0x333e0d=_0xc5d1d8[_0x285c('0x2a')]({'plain':!![]});var _0x36c44b=_0x285c('0x2b');return db['UserProfileResource'][_0x285c('0x2c')]({'where':{'type':_0x36c44b,'resourceId':_0x333e0d['id']}})[_0x285c('0x29')](function(){return _0xc5d1d8;});})[_0x285c('0x29')](function(){_0x4b35c7[_0x285c('0x1d')](0xcc)['end']();});}};}function handleEntityNotFound(_0x5d1dd0,_0x2619c7){return function(_0x35f1cc){if(!_0x35f1cc){_0x5d1dd0[_0x285c('0x2d')](0x194);}return _0x35f1cc;};}function handleError(_0x428d27,_0x2369d1){_0x2369d1=_0x2369d1||0x1f4;return function(_0x3fdd49){logger[_0x285c('0x2e')](_0x3fdd49[_0x285c('0x2f')]);if(_0x3fdd49[_0x285c('0x30')]){delete _0x3fdd49['name'];}_0x428d27[_0x285c('0x1d')](_0x2369d1)[_0x285c('0x31')](_0x3fdd49);};}exports[_0x285c('0x32')]=function(_0x13d356,_0x52a88a){var _0x400db1={},_0x169bb8={},_0x2c62c4={'count':0x0,'rows':[]};var _0x4d2b9e=_['map'](db[_0x285c('0x33')][_0x285c('0x34')],function(_0x25c2d2){return{'name':_0x25c2d2[_0x285c('0x35')],'type':_0x25c2d2[_0x285c('0x36')][_0x285c('0x37')]};});_0x169bb8[_0x285c('0x38')]=_['map'](_0x4d2b9e,_0x285c('0x30'));_0x169bb8[_0x285c('0x39')]=_[_0x285c('0x3a')](_0x13d356[_0x285c('0x39')]);_0x169bb8[_0x285c('0x3b')]=_[_0x285c('0x3c')](_0x169bb8[_0x285c('0x38')],_0x169bb8['query']);_0x400db1[_0x285c('0x3d')]=_['intersection'](_0x169bb8['model'],qs[_0x285c('0x3e')](_0x13d356[_0x285c('0x39')][_0x285c('0x3e')]));_0x400db1[_0x285c('0x3d')]=_0x400db1[_0x285c('0x3d')]['length']?_0x400db1['attributes']:_0x169bb8[_0x285c('0x38')];if(!_0x13d356[_0x285c('0x39')][_0x285c('0x3f')](_0x285c('0x40'))){_0x400db1[_0x285c('0x21')]=qs[_0x285c('0x21')](_0x13d356['query'][_0x285c('0x21')]);_0x400db1[_0x285c('0x1f')]=qs[_0x285c('0x1f')](_0x13d356[_0x285c('0x39')][_0x285c('0x1f')]);}_0x400db1[_0x285c('0x41')]=qs[_0x285c('0x42')](_0x13d356['query'][_0x285c('0x42')]);_0x400db1[_0x285c('0x43')]=qs[_0x285c('0x3b')](_[_0x285c('0x44')](_0x13d356[_0x285c('0x39')],_0x169bb8[_0x285c('0x3b')]),_0x4d2b9e);if(_0x13d356[_0x285c('0x39')][_0x285c('0x45')]){_0x400db1[_0x285c('0x43')]=_[_0x285c('0x46')](_0x400db1['where'],{'$or':_[_0x285c('0x47')](_0x4d2b9e,function(_0x93affb){if(_0x93affb[_0x285c('0x36')]!==_0x285c('0x48')){var _0x46d882={};_0x46d882[_0x93affb['name']]={'$like':'%'+_0x13d356[_0x285c('0x39')][_0x285c('0x45')]+'%'};return _0x46d882;}})});}_0x400db1=_[_0x285c('0x46')]({},_0x400db1,_0x13d356[_0x285c('0x49')]);var _0x367f77={'where':_0x400db1[_0x285c('0x43')]};return db['Campaign'][_0x285c('0x22')](_0x367f77)['then'](function(_0x56cac9){_0x2c62c4['count']=_0x56cac9;if(_0x13d356[_0x285c('0x39')]['includeAll']){_0x400db1[_0x285c('0x4a')]=[{'all':!![]}];}return db[_0x285c('0x33')][_0x285c('0x4b')](_0x400db1);})[_0x285c('0x29')](function(_0x5db789){_0x2c62c4['rows']=_0x5db789;return _0x2c62c4;})[_0x285c('0x29')](respondWithFilteredResult(_0x52a88a,_0x400db1))[_0x285c('0x4c')](handleError(_0x52a88a,null));};exports[_0x285c('0x4d')]=function(_0x3e9f0f,_0x3b93ce){var _0xfaf48e={'raw':![],'where':{'id':_0x3e9f0f[_0x285c('0x4e')]['id']}},_0x5eae9a={};_0x5eae9a['model']=_['keys'](db['Campaign'][_0x285c('0x34')]);_0x5eae9a[_0x285c('0x39')]=_[_0x285c('0x3a')](_0x3e9f0f['query']);_0x5eae9a[_0x285c('0x3b')]=_['intersection'](_0x5eae9a['model'],_0x5eae9a[_0x285c('0x39')]);_0xfaf48e[_0x285c('0x3d')]=_[_0x285c('0x3c')](_0x5eae9a[_0x285c('0x38')],qs['fields'](_0x3e9f0f[_0x285c('0x39')][_0x285c('0x3e')]));_0xfaf48e[_0x285c('0x3d')]=_0xfaf48e['attributes'][_0x285c('0x4f')]?_0xfaf48e[_0x285c('0x3d')]:_0x5eae9a[_0x285c('0x38')];if(_0x3e9f0f[_0x285c('0x39')][_0x285c('0x50')]){_0xfaf48e[_0x285c('0x4a')]=[{'all':!![]}];}_0xfaf48e=_[_0x285c('0x46')]({},_0xfaf48e,_0x3e9f0f[_0x285c('0x49')]);return db[_0x285c('0x33')][_0x285c('0x51')](_0xfaf48e)[_0x285c('0x29')](handleEntityNotFound(_0x3b93ce,null))['then'](respondWithResult(_0x3b93ce,null))[_0x285c('0x4c')](handleError(_0x3b93ce,null));};exports[_0x285c('0x52')]=function(_0x437d26,_0x4d9a47){return db[_0x285c('0x33')][_0x285c('0x52')](_0x437d26[_0x285c('0x53')],{})[_0x285c('0x29')](function(_0x2cbc52){var _0x2f4071=_0x437d26[_0x285c('0x54')][_0x285c('0x2a')]({'plain':!![]});if(!_0x2f4071)throw new Error(_0x285c('0x55'));if(_0x2f4071[_0x285c('0x56')]==='user'){var _0x2cb29b=_0x2cbc52[_0x285c('0x2a')]({'plain':!![]});var _0x1db5ea='IvrCampaigns';return db[_0x285c('0x57')]['find']({'where':{'name':_0x1db5ea,'userProfileId':_0x2f4071[_0x285c('0x58')]},'raw':!![]})[_0x285c('0x29')](function(_0x2e05b3){if(_0x2e05b3&&_0x2e05b3[_0x285c('0x59')]===0x0){return db[_0x285c('0x5a')][_0x285c('0x52')]({'name':_0x2cb29b[_0x285c('0x30')],'resourceId':_0x2cb29b['id'],'type':_0x2e05b3[_0x285c('0x30')],'sectionId':_0x2e05b3['id']},{})[_0x285c('0x29')](function(){return _0x2cbc52;});}else{return _0x2cbc52;}})[_0x285c('0x4c')](function(_0x1b71c9){logger['error'](_0x285c('0x5b'),_0x1b71c9);throw _0x1b71c9;});}return _0x2cbc52;})['then'](respondWithResult(_0x4d9a47,0xc9))[_0x285c('0x4c')](handleError(_0x4d9a47,null));};exports[_0x285c('0x5c')]=function(_0x4cfe14,_0x45f114){var _0x53b325={'where':{'id':_0x4cfe14['params']['id']}},_0x5b0e73={};_0x5b0e73[_0x285c('0x38')]=_[_0x285c('0x3a')](db[_0x285c('0x33')][_0x285c('0x34')]);_0x53b325[_0x285c('0x3d')]=_['intersection'](_0x5b0e73[_0x285c('0x38')],qs[_0x285c('0x3e')](_0x4cfe14[_0x285c('0x39')][_0x285c('0x3e')]));_0x53b325[_0x285c('0x3d')]=_0x53b325[_0x285c('0x3d')][_0x285c('0x4f')]?_0x53b325['attributes']:_0x5b0e73[_0x285c('0x38')];if(_0x4cfe14[_0x285c('0x39')][_0x285c('0x50')]){_0x53b325[_0x285c('0x4a')]=[{'all':!![]}];}_0x53b325=_[_0x285c('0x46')]({},_0x53b325,_0x4cfe14['options']);return db[_0x285c('0x33')]['find'](_0x53b325)['then'](handleEntityNotFound(_0x45f114,null))[_0x285c('0x29')](function(_0x8d96e8){if(_0x8d96e8){var _0x296ba9=_0x8d96e8[_0x285c('0x2a')]({'plain':!![]});_0x296ba9=qs[_0x285c('0x5d')](_0x296ba9,['id','createdAt',_0x285c('0x5e')]);_0x4cfe14['body']=_[_0x285c('0x5d')](_0x4cfe14['body'],['id',_0x285c('0x5f'),_0x285c('0x5e')]);return db[_0x285c('0x33')][_0x285c('0x52')](_[_0x285c('0x46')](_0x296ba9,_0x4cfe14[_0x285c('0x53')]),{'include':_0x4cfe14['query']['includeAll']?[{'all':!![]}]:undefined})[_0x285c('0x29')](function(_0x37b701){var _0x1a2cd2=_0x4cfe14['user']['get']({'plain':!![]});if(!_0x1a2cd2)throw new Error(_0x285c('0x55'));if(_0x1a2cd2[_0x285c('0x56')]===_0x285c('0x54')){var _0x2c50d0=_0x37b701[_0x285c('0x2a')]({'plain':!![]});var _0x4b5217='IvrCampaigns';return db[_0x285c('0x57')]['find']({'where':{'name':_0x4b5217,'userProfileId':_0x1a2cd2[_0x285c('0x58')]},'raw':!![]})[_0x285c('0x29')](function(_0x240bf8){if(_0x240bf8&&_0x240bf8[_0x285c('0x59')]===0x0){return db[_0x285c('0x5a')][_0x285c('0x52')]({'name':_0x2c50d0[_0x285c('0x30')],'resourceId':_0x2c50d0['id'],'type':_0x240bf8['name'],'sectionId':_0x240bf8['id']},{})['then'](function(){return _0x37b701;});}else{return _0x37b701;}})[_0x285c('0x4c')](function(_0x211ea6){logger['error'](_0x285c('0x5b'),_0x211ea6);throw _0x211ea6;});}return _0x37b701;});}})['then'](respondWithResult(_0x45f114,0xc9))[_0x285c('0x4c')](handleError(_0x45f114,null));};exports[_0x285c('0x28')]=function(_0x3853ae,_0x4415ae){if(_0x3853ae[_0x285c('0x53')]['id']){delete _0x3853ae[_0x285c('0x53')]['id'];}return db['Campaign']['find']({'where':{'id':_0x3853ae[_0x285c('0x4e')]['id']}})[_0x285c('0x29')](handleEntityNotFound(_0x4415ae,null))[_0x285c('0x29')](saveUpdates(_0x3853ae['body'],null))[_0x285c('0x29')](respondWithResult(_0x4415ae,null))[_0x285c('0x4c')](handleError(_0x4415ae,null));};exports[_0x285c('0x2c')]=function(_0xb8cb5a,_0x156bea){return db[_0x285c('0x33')]['find']({'where':{'id':_0xb8cb5a[_0x285c('0x4e')]['id']}})[_0x285c('0x29')](handleEntityNotFound(_0x156bea,null))['then'](removeEntity(_0x156bea,null))[_0x285c('0x4c')](handleError(_0x156bea,null));};exports[_0x285c('0x60')]=function(_0xff4837,_0x52a2db,_0x185359){var _0x563d7a={'raw':!![],'where':{}};var _0x28b0d0={};var _0x2c7fbf={'count':0x0,'rows':[]};return db[_0x285c('0x33')][_0x285c('0x61')]({'where':{'id':_0xff4837[_0x285c('0x4e')]['id']}})[_0x285c('0x29')](handleEntityNotFound(_0x52a2db,null))['then'](function(_0x4573e7){if(_0x4573e7){_0x28b0d0[_0x285c('0x38')]=_['keys'](db[_0x285c('0x62')][_0x285c('0x34')]);_0x28b0d0[_0x285c('0x39')]=_['keys'](_0xff4837[_0x285c('0x39')]);_0x28b0d0[_0x285c('0x3b')]=_[_0x285c('0x3c')](_0x28b0d0[_0x285c('0x38')],_0x28b0d0['query']);_0x563d7a[_0x285c('0x3d')]=_[_0x285c('0x3c')](_0x28b0d0[_0x285c('0x38')],qs[_0x285c('0x3e')](_0xff4837[_0x285c('0x39')]['fields']));_0x563d7a[_0x285c('0x3d')]=_0x563d7a[_0x285c('0x3d')][_0x285c('0x4f')]?_0x563d7a[_0x285c('0x3d')]:_0x28b0d0[_0x285c('0x38')];if(!_0xff4837['query'][_0x285c('0x3f')](_0x285c('0x40'))){_0x563d7a['limit']=qs[_0x285c('0x21')](_0xff4837[_0x285c('0x39')][_0x285c('0x21')]);_0x563d7a[_0x285c('0x1f')]=qs[_0x285c('0x1f')](_0xff4837[_0x285c('0x39')][_0x285c('0x1f')]);}_0x563d7a[_0x285c('0x41')]=qs[_0x285c('0x42')](_0xff4837[_0x285c('0x39')]['sort']);_0x563d7a['where']=qs[_0x285c('0x3b')](_[_0x285c('0x44')](_0xff4837[_0x285c('0x39')],_0x28b0d0['filters']));_0x563d7a['where'][_0x285c('0x63')]=_0x4573e7['id'];if(_0xff4837[_0x285c('0x39')][_0x285c('0x45')]){_0x563d7a[_0x285c('0x43')]=_[_0x285c('0x46')](_0x563d7a['where'],{'$or':_[_0x285c('0x47')](_0x563d7a[_0x285c('0x3d')],function(_0x3413ac){var _0x89aab6={};_0x89aab6[_0x3413ac]={'$like':'%'+_0xff4837[_0x285c('0x39')][_0x285c('0x45')]+'%'};return _0x89aab6;})});}_0x563d7a=_[_0x285c('0x46')]({},_0x563d7a,_0xff4837[_0x285c('0x49')]);return db[_0x285c('0x62')][_0x285c('0x22')]({'where':_0x563d7a[_0x285c('0x43')]})['then'](function(_0x40a879){_0x2c7fbf[_0x285c('0x22')]=_0x40a879;if(_0xff4837[_0x285c('0x39')][_0x285c('0x50')]){_0x563d7a[_0x285c('0x4a')]=[{'all':!![]}];}return db['CmHopper'][_0x285c('0x4b')](_0x563d7a);})['then'](function(_0x232a2d){_0x2c7fbf[_0x285c('0x64')]=_0x232a2d;return _0x2c7fbf;});}})[_0x285c('0x29')](respondWithFilteredResult(_0x52a2db,_0x563d7a))[_0x285c('0x4c')](handleError(_0x52a2db,null));};exports[_0x285c('0x65')]=function(_0x4fb177,_0x4b63cc,_0x27137b){var _0x16b78f={'raw':!![],'where':{}};var _0x58748f={};var _0x5b731c={'count':0x0,'rows':[]};return db['Campaign'][_0x285c('0x61')]({'where':{'id':_0x4fb177[_0x285c('0x4e')]['id']}})['then'](handleEntityNotFound(_0x4b63cc,null))['then'](function(_0x555583){if(_0x555583){_0x58748f[_0x285c('0x38')]=_[_0x285c('0x3a')](db[_0x285c('0x66')][_0x285c('0x34')]);_0x58748f[_0x285c('0x39')]=_[_0x285c('0x3a')](_0x4fb177['query']);_0x58748f[_0x285c('0x3b')]=_['intersection'](_0x58748f[_0x285c('0x38')],_0x58748f[_0x285c('0x39')]);_0x16b78f[_0x285c('0x3d')]=_['intersection'](_0x58748f[_0x285c('0x38')],qs['fields'](_0x4fb177[_0x285c('0x39')][_0x285c('0x3e')]));_0x16b78f['attributes']=_0x16b78f[_0x285c('0x3d')][_0x285c('0x4f')]?_0x16b78f[_0x285c('0x3d')]:_0x58748f[_0x285c('0x38')];if(!_0x4fb177[_0x285c('0x39')][_0x285c('0x3f')](_0x285c('0x40'))){_0x16b78f[_0x285c('0x21')]=qs['limit'](_0x4fb177[_0x285c('0x39')][_0x285c('0x21')]);_0x16b78f[_0x285c('0x1f')]=qs[_0x285c('0x1f')](_0x4fb177[_0x285c('0x39')]['offset']);}_0x16b78f[_0x285c('0x41')]=qs['sort'](_0x4fb177['query'][_0x285c('0x42')]);_0x16b78f[_0x285c('0x43')]=qs[_0x285c('0x3b')](_[_0x285c('0x44')](_0x4fb177['query'],_0x58748f[_0x285c('0x3b')]));_0x16b78f[_0x285c('0x43')][_0x285c('0x63')]=_0x555583['id'];if(_0x4fb177[_0x285c('0x39')][_0x285c('0x45')]){_0x16b78f[_0x285c('0x43')]=_[_0x285c('0x46')](_0x16b78f[_0x285c('0x43')],{'$or':_[_0x285c('0x47')](_0x16b78f['attributes'],function(_0x5209d0){var _0x21b953={};_0x21b953[_0x5209d0]={'$like':'%'+_0x4fb177[_0x285c('0x39')][_0x285c('0x45')]+'%'};return _0x21b953;})});}_0x16b78f=_[_0x285c('0x46')]({},_0x16b78f,_0x4fb177[_0x285c('0x49')]);return db['CmHopperHistory']['count']({'where':_0x16b78f[_0x285c('0x43')]})[_0x285c('0x29')](function(_0x48c932){_0x5b731c[_0x285c('0x22')]=_0x48c932;if(_0x4fb177[_0x285c('0x39')]['includeAll']){_0x16b78f[_0x285c('0x4a')]=[{'all':!![]}];}return db['CmHopperHistory'][_0x285c('0x4b')](_0x16b78f);})[_0x285c('0x29')](function(_0x38a5bc){_0x5b731c[_0x285c('0x64')]=_0x38a5bc;return _0x5b731c;});}})[_0x285c('0x29')](respondWithFilteredResult(_0x4b63cc,_0x16b78f))['catch'](handleError(_0x4b63cc,null));};exports[_0x285c('0x67')]=function(_0x56f154,_0x22923c,_0x417b0c){var _0x4bf953={'raw':!![],'where':{}};var _0x1e107f={};var _0x2bc05d={'count':0x0,'rows':[]};return db[_0x285c('0x33')][_0x285c('0x61')]({'where':{'id':_0x56f154[_0x285c('0x4e')]['id']}})[_0x285c('0x29')](handleEntityNotFound(_0x22923c,null))[_0x285c('0x29')](function(_0x21054a){if(_0x21054a){_0x1e107f[_0x285c('0x38')]=_[_0x285c('0x3a')](db[_0x285c('0x68')]['rawAttributes']);_0x1e107f[_0x285c('0x39')]=_[_0x285c('0x3a')](_0x56f154[_0x285c('0x39')]);_0x1e107f[_0x285c('0x3b')]=_[_0x285c('0x3c')](_0x1e107f['model'],_0x1e107f[_0x285c('0x39')]);_0x4bf953[_0x285c('0x3d')]=_[_0x285c('0x3c')](_0x1e107f[_0x285c('0x38')],qs[_0x285c('0x3e')](_0x56f154[_0x285c('0x39')]['fields']));_0x4bf953[_0x285c('0x3d')]=_0x4bf953[_0x285c('0x3d')][_0x285c('0x4f')]?_0x4bf953[_0x285c('0x3d')]:_0x1e107f[_0x285c('0x38')];if(!_0x56f154[_0x285c('0x39')][_0x285c('0x3f')]('nolimit')){_0x4bf953[_0x285c('0x21')]=qs[_0x285c('0x21')](_0x56f154[_0x285c('0x39')][_0x285c('0x21')]);_0x4bf953[_0x285c('0x1f')]=qs[_0x285c('0x1f')](_0x56f154[_0x285c('0x39')][_0x285c('0x1f')]);}_0x4bf953[_0x285c('0x41')]=qs[_0x285c('0x42')](_0x56f154[_0x285c('0x39')][_0x285c('0x42')]);_0x4bf953[_0x285c('0x43')]=qs[_0x285c('0x3b')](_[_0x285c('0x44')](_0x56f154[_0x285c('0x39')],_0x1e107f[_0x285c('0x3b')]));_0x4bf953[_0x285c('0x43')][_0x285c('0x63')]=_0x21054a['id'];if(_0x56f154[_0x285c('0x39')][_0x285c('0x45')]){_0x4bf953[_0x285c('0x43')]=_[_0x285c('0x46')](_0x4bf953[_0x285c('0x43')],{'$or':_['map'](_0x4bf953[_0x285c('0x3d')],function(_0xf32a0c){var _0x2a5c94={};_0x2a5c94[_0xf32a0c]={'$like':'%'+_0x56f154[_0x285c('0x39')][_0x285c('0x45')]+'%'};return _0x2a5c94;})});}_0x4bf953=_[_0x285c('0x46')]({},_0x4bf953,_0x56f154['options']);return db[_0x285c('0x68')][_0x285c('0x22')]({'where':_0x4bf953[_0x285c('0x43')]})[_0x285c('0x29')](function(_0x2c6ed6){_0x2bc05d[_0x285c('0x22')]=_0x2c6ed6;if(_0x56f154[_0x285c('0x39')][_0x285c('0x50')]){_0x4bf953['include']=[{'all':!![]}];}return db[_0x285c('0x68')][_0x285c('0x4b')](_0x4bf953);})[_0x285c('0x29')](function(_0x3f979d){_0x2bc05d[_0x285c('0x64')]=_0x3f979d;return _0x2bc05d;});}})[_0x285c('0x29')](respondWithFilteredResult(_0x22923c,_0x4bf953))[_0x285c('0x4c')](handleError(_0x22923c,null));};exports['getHopperBlacks']=function(_0x510c45,_0x304607,_0x213da9){var _0x3defd4={'raw':!![],'where':{}};var _0x1e9e9b={};var _0x2fc6d0={'count':0x0,'rows':[]};return db[_0x285c('0x33')][_0x285c('0x61')]({'where':{'id':_0x510c45[_0x285c('0x4e')]['id']}})[_0x285c('0x29')](handleEntityNotFound(_0x304607,null))[_0x285c('0x29')](function(_0x5c9015){if(_0x5c9015){_0x1e9e9b[_0x285c('0x38')]=_['keys'](db['CmHopperBlack'][_0x285c('0x34')]);_0x1e9e9b[_0x285c('0x39')]=_[_0x285c('0x3a')](_0x510c45[_0x285c('0x39')]);_0x1e9e9b[_0x285c('0x3b')]=_[_0x285c('0x3c')](_0x1e9e9b[_0x285c('0x38')],_0x1e9e9b[_0x285c('0x39')]);_0x3defd4[_0x285c('0x3d')]=_[_0x285c('0x3c')](_0x1e9e9b[_0x285c('0x38')],qs[_0x285c('0x3e')](_0x510c45['query'][_0x285c('0x3e')]));_0x3defd4[_0x285c('0x3d')]=_0x3defd4[_0x285c('0x3d')]['length']?_0x3defd4[_0x285c('0x3d')]:_0x1e9e9b[_0x285c('0x38')];if(!_0x510c45[_0x285c('0x39')]['hasOwnProperty'](_0x285c('0x40'))){_0x3defd4[_0x285c('0x21')]=qs[_0x285c('0x21')](_0x510c45[_0x285c('0x39')][_0x285c('0x21')]);_0x3defd4[_0x285c('0x1f')]=qs[_0x285c('0x1f')](_0x510c45['query']['offset']);}_0x3defd4['order']=qs[_0x285c('0x42')](_0x510c45[_0x285c('0x39')][_0x285c('0x42')]);_0x3defd4[_0x285c('0x43')]=qs[_0x285c('0x3b')](_[_0x285c('0x44')](_0x510c45['query'],_0x1e9e9b[_0x285c('0x3b')]));_0x3defd4[_0x285c('0x43')][_0x285c('0x63')]=_0x5c9015['id'];if(_0x510c45[_0x285c('0x39')][_0x285c('0x45')]){_0x3defd4[_0x285c('0x43')]=_['merge'](_0x3defd4['where'],{'$or':_[_0x285c('0x47')](_0x3defd4['attributes'],function(_0x54fda4){var _0x165d8b={};_0x165d8b[_0x54fda4]={'$like':'%'+_0x510c45[_0x285c('0x39')]['filter']+'%'};return _0x165d8b;})});}_0x3defd4=_[_0x285c('0x46')]({},_0x3defd4,_0x510c45[_0x285c('0x49')]);return db[_0x285c('0x69')]['count']({'where':_0x3defd4[_0x285c('0x43')]})['then'](function(_0x737cec){_0x2fc6d0['count']=_0x737cec;if(_0x510c45['query'][_0x285c('0x50')]){_0x3defd4['include']=[{'all':!![]}];}return db[_0x285c('0x69')][_0x285c('0x4b')](_0x3defd4);})[_0x285c('0x29')](function(_0x2396bb){_0x2fc6d0[_0x285c('0x64')]=_0x2396bb;return _0x2fc6d0;});}})[_0x285c('0x29')](respondWithFilteredResult(_0x304607,_0x3defd4))[_0x285c('0x4c')](handleError(_0x304607,null));};exports[_0x285c('0x6a')]=function(_0x2bd425,_0x7e35ef,_0x3919e1){var _0x5a8a14={};var _0x352186={};var _0x35be70;var _0x141f33;return db[_0x285c('0x33')]['findOne']({'where':{'id':_0x2bd425[_0x285c('0x4e')]['id']}})[_0x285c('0x29')](handleEntityNotFound(_0x7e35ef,null))[_0x285c('0x29')](function(_0x423b2d){if(_0x423b2d){_0x35be70=_0x423b2d;_0x352186['model']=_[_0x285c('0x3a')](db['CmList'][_0x285c('0x34')]);_0x352186[_0x285c('0x39')]=_[_0x285c('0x3a')](_0x2bd425['query']);_0x352186[_0x285c('0x3b')]=_[_0x285c('0x3c')](_0x352186[_0x285c('0x38')],_0x352186[_0x285c('0x39')]);_0x5a8a14['attributes']=_[_0x285c('0x3c')](_0x352186[_0x285c('0x38')],qs[_0x285c('0x3e')](_0x2bd425[_0x285c('0x39')][_0x285c('0x3e')]));_0x5a8a14[_0x285c('0x3d')]=_0x5a8a14[_0x285c('0x3d')][_0x285c('0x4f')]?_0x5a8a14['attributes']:_0x352186['model'];_0x5a8a14[_0x285c('0x41')]=qs[_0x285c('0x42')](_0x2bd425[_0x285c('0x39')][_0x285c('0x42')]);_0x5a8a14[_0x285c('0x43')]=qs[_0x285c('0x3b')](_[_0x285c('0x44')](_0x2bd425[_0x285c('0x39')],_0x352186[_0x285c('0x3b')]));if(_0x2bd425[_0x285c('0x39')][_0x285c('0x45')]){_0x5a8a14['where']=_[_0x285c('0x46')](_0x5a8a14['where'],{'$or':_[_0x285c('0x47')](_0x5a8a14[_0x285c('0x3d')],function(_0x18f0ff){var _0x848896={};_0x848896[_0x18f0ff]={'$like':'%'+_0x2bd425[_0x285c('0x39')][_0x285c('0x45')]+'%'};return _0x848896;})});}_0x5a8a14=_[_0x285c('0x46')]({},_0x5a8a14,_0x2bd425[_0x285c('0x49')]);return _0x35be70[_0x285c('0x6a')](_0x5a8a14);}})['then'](function(_0x447da5){if(_0x447da5){_0x141f33=_0x447da5[_0x285c('0x4f')];if(!_0x2bd425[_0x285c('0x39')][_0x285c('0x3f')](_0x285c('0x40'))){_0x5a8a14[_0x285c('0x21')]=qs[_0x285c('0x21')](_0x2bd425['query'][_0x285c('0x21')]);_0x5a8a14[_0x285c('0x1f')]=qs[_0x285c('0x1f')](_0x2bd425[_0x285c('0x39')]['offset']);}return _0x35be70['getLists'](_0x5a8a14);}})[_0x285c('0x29')](function(_0x568d0c){if(_0x568d0c){return _0x568d0c?{'count':_0x141f33,'rows':_0x568d0c}:null;}})[_0x285c('0x29')](respondWithResult(_0x7e35ef,null))[_0x285c('0x4c')](handleError(_0x7e35ef,null));};exports[_0x285c('0x6b')]=function(_0x3ed7bb,_0x540cd3,_0xec4a8d){var _0x29f013,_0x214f1f;return db[_0x285c('0x33')][_0x285c('0x51')]({'where':{'id':_0x3ed7bb[_0x285c('0x4e')]['id']}})[_0x285c('0x29')](handleEntityNotFound(_0x540cd3,null))['then'](function(_0x5e9e38){if(_0x5e9e38){_0x214f1f=_0x5e9e38;return _0x5e9e38[_0x285c('0x6b')](_0x3ed7bb['body']['ids'],_[_0x285c('0x5d')](_0x3ed7bb[_0x285c('0x53')],['ids','id'])||{});}return null;})[_0x285c('0x6c')](function(_0x3fb8e2){var _0x2ac706;_0x29f013=_0x3fb8e2||[];var _0x490e57=[];if(_0x3fb8e2){for(var _0x51768b=0x0;_0x51768b<_0x3fb8e2[_0x285c('0x4f')];_0x51768b+=0x1){var _0x1ced9d=_0x3fb8e2[_0x51768b][_0x285c('0x2a')]({'plain':!![]});_0x214f1f['dialCheckDuplicateType']=_0x3ed7bb[_0x285c('0x53')]['dialCheckDuplicateType']?_0x3ed7bb['body']['dialCheckDuplicateType']:_0x214f1f['dialCheckDuplicateType'];switch(_0x214f1f[_0x285c('0x6d')]){case _0x285c('0x6e'):_0x2ac706=squel[_0x285c('0x6f')]()['into'](_0x285c('0x70'))[_0x285c('0x71')]([_0x285c('0x72'),'scheduledAt','ContactId',_0x285c('0x73'),_0x285c('0x63'),_0x285c('0x5f'),_0x285c('0x5e')],squel[_0x285c('0x74')]()[_0x285c('0x75')](_0x285c('0x72'),_0x285c('0x72'))['field'](_0x285c('0x76'),_0x285c('0x77'))[_0x285c('0x75')]('id',_0x285c('0x78'))['field'](_0x1ced9d[_0x285c('0x79')][_0x285c('0x7a')](),_0x285c('0x73'))['field'](_0x3ed7bb[_0x285c('0x4e')]['id'][_0x285c('0x7a')](),_0x285c('0x63'))[_0x285c('0x75')](_0x285c('0x76'),_0x285c('0x5f'))[_0x285c('0x75')]('NOW()',_0x285c('0x5e'))[_0x285c('0x7b')](_0x285c('0x7c'))[_0x285c('0x43')](_0x285c('0x7d'))['where'](_0x285c('0x7e'),_0x1ced9d[_0x285c('0x79')][_0x285c('0x7a')]())[_0x285c('0x43')](_0x285c('0x7f'))[_0x285c('0x43')](_0x285c('0x80'),squel[_0x285c('0x74')]()[_0x285c('0x75')](_0x285c('0x81'))['from'](_0x285c('0x82'))[_0x285c('0x43')](_0x285c('0x83'),_0x3ed7bb[_0x285c('0x4e')]['id']['toString']()))[_0x285c('0x43')](_0x285c('0x80'),squel[_0x285c('0x74')]()[_0x285c('0x75')](_0x285c('0x84'))[_0x285c('0x7b')](_0x285c('0x70'))[_0x285c('0x43')](_0x285c('0x83'),_0x3ed7bb[_0x285c('0x4e')]['id'][_0x285c('0x7a')]())))[_0x285c('0x7a')]();break;case _0x285c('0x85'):_0x2ac706=squel[_0x285c('0x6f')]()[_0x285c('0x86')](_0x285c('0x70'))[_0x285c('0x71')]([_0x285c('0x72'),_0x285c('0x77'),_0x285c('0x78'),_0x285c('0x73'),_0x285c('0x63'),_0x285c('0x5f'),'updatedAt'],squel[_0x285c('0x74')]()[_0x285c('0x75')](_0x285c('0x72'),_0x285c('0x72'))['field'](_0x285c('0x76'),_0x285c('0x77'))['field']('id','ContactId')[_0x285c('0x75')](_0x1ced9d[_0x285c('0x79')][_0x285c('0x7a')](),_0x285c('0x73'))[_0x285c('0x75')](_0x3ed7bb[_0x285c('0x4e')]['id'][_0x285c('0x7a')](),_0x285c('0x63'))['field'](_0x285c('0x76'),_0x285c('0x5f'))[_0x285c('0x75')](_0x285c('0x76'),_0x285c('0x5e'))[_0x285c('0x7b')](_0x285c('0x7c'))[_0x285c('0x43')](_0x285c('0x7d'))[_0x285c('0x43')]('ListId\x20=\x20?',_0x1ced9d[_0x285c('0x79')][_0x285c('0x7a')]())[_0x285c('0x43')](_0x285c('0x7f'))[_0x285c('0x43')](_0x285c('0x80'),squel[_0x285c('0x74')]()[_0x285c('0x75')](_0x285c('0x84'))[_0x285c('0x7b')](_0x285c('0x70'))[_0x285c('0x43')](_0x285c('0x83'),_0x3ed7bb[_0x285c('0x4e')]['id']['toString']())))[_0x285c('0x7a')]();break;default:_0x2ac706=squel[_0x285c('0x6f')]()[_0x285c('0x86')](_0x285c('0x70'))[_0x285c('0x71')]([_0x285c('0x72'),_0x285c('0x77'),_0x285c('0x78'),_0x285c('0x73'),'CampaignId',_0x285c('0x5f'),_0x285c('0x5e')],squel[_0x285c('0x74')]()[_0x285c('0x75')]('phone',_0x285c('0x72'))[_0x285c('0x75')]('NOW()',_0x285c('0x77'))[_0x285c('0x75')]('id',_0x285c('0x78'))['field'](_0x1ced9d['CmListId'][_0x285c('0x7a')](),_0x285c('0x73'))['field'](_0x3ed7bb[_0x285c('0x4e')]['id'][_0x285c('0x7a')](),_0x285c('0x63'))[_0x285c('0x75')](_0x285c('0x76'),_0x285c('0x5f'))['field'](_0x285c('0x76'),_0x285c('0x5e'))[_0x285c('0x7b')]('cm_contacts')['where'](_0x285c('0x7d'))[_0x285c('0x43')](_0x285c('0x7e'),_0x1ced9d[_0x285c('0x79')][_0x285c('0x7a')]())[_0x285c('0x43')](_0x285c('0x7f')))[_0x285c('0x7a')]();}_0x490e57[_0x285c('0x87')](db[_0x285c('0x88')][_0x285c('0x39')](_0x2ac706));}return BPromise[_0x285c('0x89')](_0x490e57);}})[_0x285c('0x29')](function(){return _0x29f013;})['then'](respondWithResult(_0x540cd3,null))[_0x285c('0x4c')](handleError(_0x540cd3,null));};exports[_0x285c('0x8a')]=function(_0x551f7d,_0x495dc8,_0xb17d40){return db['Campaign'][_0x285c('0x51')]({'where':{'id':_0x551f7d['params']['id']}})[_0x285c('0x29')](handleEntityNotFound(_0x495dc8,null))[_0x285c('0x29')](function(_0x41c8df){if(_0x41c8df){return _0x41c8df[_0x285c('0x8a')](_0x551f7d['query'][_0x285c('0x8b')]);}})[_0x285c('0x29')](function(_0x3fcc98){if(_0x3fcc98){return db[_0x285c('0x62')][_0x285c('0x2c')]({'where':{'ListId':_0x551f7d[_0x285c('0x39')][_0x285c('0x8b')],'CampaignId':_0x551f7d[_0x285c('0x4e')]['id']}})[_0x285c('0x29')](function(){return _0x3fcc98;});}})['then'](respondWithStatusCode(_0x495dc8,null))[_0x285c('0x4c')](handleError(_0x495dc8,null));};exports['getBlackLists']=function(_0x10ea64,_0x4f5ee7,_0x3aa966){var _0x23f054={};var _0x5d0cd1={};var _0x536daa;var _0x528b16;return db[_0x285c('0x33')][_0x285c('0x61')]({'where':{'id':_0x10ea64[_0x285c('0x4e')]['id']}})['then'](handleEntityNotFound(_0x4f5ee7,null))[_0x285c('0x29')](function(_0x1034a4){if(_0x1034a4){_0x536daa=_0x1034a4;_0x5d0cd1['model']=_[_0x285c('0x3a')](db[_0x285c('0x8c')][_0x285c('0x34')]);_0x5d0cd1[_0x285c('0x39')]=_[_0x285c('0x3a')](_0x10ea64['query']);_0x5d0cd1[_0x285c('0x3b')]=_[_0x285c('0x3c')](_0x5d0cd1['model'],_0x5d0cd1[_0x285c('0x39')]);_0x23f054['attributes']=_['intersection'](_0x5d0cd1[_0x285c('0x38')],qs['fields'](_0x10ea64[_0x285c('0x39')]['fields']));_0x23f054[_0x285c('0x3d')]=_0x23f054['attributes'][_0x285c('0x4f')]?_0x23f054[_0x285c('0x3d')]:_0x5d0cd1[_0x285c('0x38')];_0x23f054['order']=qs[_0x285c('0x42')](_0x10ea64[_0x285c('0x39')][_0x285c('0x42')]);_0x23f054['where']=qs['filters'](_[_0x285c('0x44')](_0x10ea64[_0x285c('0x39')],_0x5d0cd1[_0x285c('0x3b')]));if(_0x10ea64['query']['filter']){_0x23f054[_0x285c('0x43')]=_[_0x285c('0x46')](_0x23f054[_0x285c('0x43')],{'$or':_[_0x285c('0x47')](_0x23f054[_0x285c('0x3d')],function(_0x2f4dae){var _0x3a76e0={};_0x3a76e0[_0x2f4dae]={'$like':'%'+_0x10ea64[_0x285c('0x39')][_0x285c('0x45')]+'%'};return _0x3a76e0;})});}_0x23f054=_[_0x285c('0x46')]({},_0x23f054,_0x10ea64[_0x285c('0x49')]);return _0x536daa[_0x285c('0x8d')](_0x23f054);}})['then'](function(_0x434516){if(_0x434516){_0x528b16=_0x434516[_0x285c('0x4f')];if(!_0x10ea64[_0x285c('0x39')][_0x285c('0x3f')](_0x285c('0x40'))){_0x23f054[_0x285c('0x21')]=qs[_0x285c('0x21')](_0x10ea64['query'][_0x285c('0x21')]);_0x23f054[_0x285c('0x1f')]=qs[_0x285c('0x1f')](_0x10ea64[_0x285c('0x39')]['offset']);}return _0x536daa[_0x285c('0x8d')](_0x23f054);}})[_0x285c('0x29')](function(_0x19845a){if(_0x19845a){return _0x19845a?{'count':_0x528b16,'rows':_0x19845a}:null;}})[_0x285c('0x29')](respondWithResult(_0x4f5ee7,null))['catch'](handleError(_0x4f5ee7,null));};exports[_0x285c('0x8e')]=function(_0x20c0ef,_0x4f633e,_0x271f4b){var _0xc084a6,_0x5b292a;return db[_0x285c('0x33')][_0x285c('0x51')]({'where':{'id':_0x20c0ef[_0x285c('0x4e')]['id']}})['then'](handleEntityNotFound(_0x4f633e,null))[_0x285c('0x29')](function(_0x11d527){if(_0x11d527){_0x5b292a=_0x11d527;return _0x11d527['addBlackLists'](_0x20c0ef[_0x285c('0x53')][_0x285c('0x8b')],_[_0x285c('0x5d')](_0x20c0ef['body'],['ids','id'])||{});}return null;})[_0x285c('0x6c')](function(_0x7304a2){var _0x216656;_0xc084a6=_0x7304a2||[];var _0x4f1f14=[];if(_0x7304a2){for(var _0x4629a0=0x0;_0x4629a0<_0x7304a2['length'];_0x4629a0+=0x1){var _0x585dc5=_0x7304a2[_0x4629a0][_0x285c('0x2a')]({'plain':!![]});_0x216656=squel[_0x285c('0x6f')]()[_0x285c('0x86')](_0x285c('0x8f'))[_0x285c('0x71')]([_0x285c('0x72'),_0x285c('0x78'),_0x285c('0x73'),_0x285c('0x63'),'createdAt','updatedAt'],squel['select']()[_0x285c('0x75')]('phone',_0x285c('0x72'))[_0x285c('0x75')]('id',_0x285c('0x78'))[_0x285c('0x75')](_0x585dc5[_0x285c('0x79')][_0x285c('0x7a')](),'ListId')[_0x285c('0x75')](_0x20c0ef['params']['id']['toString'](),_0x285c('0x63'))[_0x285c('0x75')](_0x285c('0x76'),'createdAt')['field'](_0x285c('0x76'),'updatedAt')['from'](_0x285c('0x7c'))[_0x285c('0x43')]('deletedAt\x20IS\x20NULL')[_0x285c('0x43')](_0x285c('0x7e'),_0x585dc5[_0x285c('0x79')][_0x285c('0x7a')]())[_0x285c('0x43')]('phone\x20IS\x20NOT\x20NULL'))['toString']();_0x4f1f14[_0x285c('0x87')](db['sequelize']['query'](_0x216656));}return BPromise[_0x285c('0x89')](_0x4f1f14);}})[_0x285c('0x29')](function(){return _0xc084a6;})[_0x285c('0x29')](respondWithResult(_0x4f633e,null))[_0x285c('0x4c')](handleError(_0x4f633e,null));};exports[_0x285c('0x90')]=function(_0xb90e95,_0x360e98,_0x1d34d2){return db[_0x285c('0x33')][_0x285c('0x51')]({'where':{'id':_0xb90e95['params']['id']}})[_0x285c('0x29')](handleEntityNotFound(_0x360e98,null))[_0x285c('0x29')](function(_0x23e822){if(_0x23e822){return _0x23e822['removeBlackLists'](_0xb90e95[_0x285c('0x39')][_0x285c('0x8b')]);}})[_0x285c('0x29')](function(_0x1fef68){if(_0x1fef68){return db['CmHopperBlack'][_0x285c('0x2c')]({'where':{'ListId':_0xb90e95[_0x285c('0x39')][_0x285c('0x8b')],'CampaignId':_0xb90e95[_0x285c('0x4e')]['id']}})[_0x285c('0x29')](function(){return _0x1fef68;});}})[_0x285c('0x29')](respondWithStatusCode(_0x360e98,null))[_0x285c('0x4c')](handleError(_0x360e98,null));};
\ No newline at end of file
diff --git a/server/api/campaign/campaign.model.js b/server/api/campaign/campaign.model.js
index 582446d..024fa1b 100644
--- a/server/api/campaign/campaign.model.js
+++ b/server/api/campaign/campaign.model.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x7a54=['../../config/logger','moment','bluebird','path','rimraf','../../config/environment','./campaign.attributes','exports','Campaign','campaigns','lodash','util'];(function(_0x13ffab,_0x449a1c){var _0x11cfda=function(_0x2cd296){while(--_0x2cd296){_0x13ffab['push'](_0x13ffab['shift']());}};_0x11cfda(++_0x449a1c);}(_0x7a54,0x106));var _0x47a5=function(_0xfe70b9,_0x35a9d9){_0xfe70b9=_0xfe70b9-0x0;var _0x3609c0=_0x7a54[_0xfe70b9];return _0x3609c0;};'use strict';var _=require(_0x47a5('0x0'));var util=require(_0x47a5('0x1'));var logger=require(_0x47a5('0x2'))('api');var moment=require(_0x47a5('0x3'));var BPromise=require(_0x47a5('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x47a5('0x5'));var rimraf=require(_0x47a5('0x6'));var config=require(_0x47a5('0x7'));var attributes=require(_0x47a5('0x8'));module[_0x47a5('0x9')]=function(_0x545a97,_0x3d5629){return _0x545a97['define'](_0x47a5('0xa'),attributes,{'tableName':_0x47a5('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x9957=['exports','define','Campaign','lodash','util','../../config/logger','api','bluebird','request-promise','path','rimraf','./campaign.attributes'];(function(_0x1e4360,_0x930b9b){var _0x31e6b4=function(_0x49dd8e){while(--_0x49dd8e){_0x1e4360['push'](_0x1e4360['shift']());}};_0x31e6b4(++_0x930b9b);}(_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
diff --git a/server/api/campaign/campaign.rpc.js b/server/api/campaign/campaign.rpc.js
index 5147b49..9b86cb8 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 _0xf874=['bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','request','then','info','Campaign,\x20%s,\x20%s','request\x20sent','debug','Campaign,\x20%s,\x20%s,\x20%s','stringify','code','error','message','result','catch','Campaign','findAll','options','raw','where','include','model','attributes','map','GetCampaign','moment'];(function(_0x11aa40,_0x26774d){var _0x3f24a5=function(_0x55ae10){while(--_0x55ae10){_0x11aa40['push'](_0x11aa40['shift']());}};_0x3f24a5(++_0x26774d);}(_0xf874,0xed));var _0x4f87=function(_0x42c6f2,_0x204756){_0x42c6f2=_0x42c6f2-0x0;var _0x5bcdff=_0xf874[_0x42c6f2];return _0x5bcdff;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x4f87('0x0'));var BPromise=require(_0x4f87('0x1'));var rs=require(_0x4f87('0x2'));var fs=require('fs');var Redis=require(_0x4f87('0x3'));var db=require(_0x4f87('0x4'))['db'];var utils=require(_0x4f87('0x5'));var logger=require('../../config/logger')(_0x4f87('0x6'));var config=require(_0x4f87('0x7'));var jayson=require(_0x4f87('0x8'));var client=jayson[_0x4f87('0x9')][_0x4f87('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x44fea6,_0x4a0662,_0x3a89e3){return new BPromise(function(_0x194853,_0x592008){return client[_0x4f87('0xb')](_0x44fea6,_0x3a89e3)[_0x4f87('0xc')](function(_0x4d8354){logger[_0x4f87('0xd')](_0x4f87('0xe'),_0x4a0662,_0x4f87('0xf'));logger[_0x4f87('0x10')](_0x4f87('0x11'),_0x4a0662,_0x4f87('0xf'),JSON[_0x4f87('0x12')](_0x4d8354));if(_0x4d8354['error']){if(_0x4d8354['error'][_0x4f87('0x13')]===0x1f4){logger[_0x4f87('0x14')](_0x4f87('0xe'),_0x4a0662,_0x4d8354['error']['message']);return _0x592008(_0x4d8354[_0x4f87('0x14')][_0x4f87('0x15')]);}logger[_0x4f87('0x14')]('Campaign,\x20%s,\x20%s',_0x4a0662,_0x4d8354[_0x4f87('0x14')]['message']);return _0x194853(_0x4d8354[_0x4f87('0x14')][_0x4f87('0x15')]);}else{logger['info'](_0x4f87('0xe'),_0x4a0662,_0x4f87('0xf'));_0x194853(_0x4d8354[_0x4f87('0x16')][_0x4f87('0x15')]);}})[_0x4f87('0x17')](function(_0x3bd90f){logger['error'](_0x4f87('0xe'),_0x4a0662,_0x3bd90f);_0x592008(_0x3bd90f);});});}exports['GetCampaign']=function(_0x10551e){var _0x6a3017=this;return new Promise(function(_0x46492d,_0x42c399){return db[_0x4f87('0x18')][_0x4f87('0x19')]({'raw':_0x10551e[_0x4f87('0x1a')]?_0x10551e[_0x4f87('0x1a')][_0x4f87('0x1b')]===undefined?!![]:![]:!![],'where':_0x10551e[_0x4f87('0x1a')]?_0x10551e[_0x4f87('0x1a')][_0x4f87('0x1c')]||null:null,'attributes':_0x10551e[_0x4f87('0x1a')]?_0x10551e['options']['attributes']||null:null,'limit':_0x10551e[_0x4f87('0x1a')]?_0x10551e[_0x4f87('0x1a')]['limit']||null:null,'include':_0x10551e['options']?_0x10551e[_0x4f87('0x1a')]['include']?_['map'](_0x10551e[_0x4f87('0x1a')][_0x4f87('0x1d')],function(_0x2a382c){return{'model':db[_0x2a382c[_0x4f87('0x1e')]],'as':_0x2a382c['as'],'attributes':_0x2a382c[_0x4f87('0x1f')],'include':_0x2a382c[_0x4f87('0x1d')]?_[_0x4f87('0x20')](_0x2a382c['include'],function(_0x234106){return{'model':db[_0x234106[_0x4f87('0x1e')]],'as':_0x234106['as'],'attributes':_0x234106[_0x4f87('0x1f')],'include':_0x234106['include']?_[_0x4f87('0x20')](_0x234106[_0x4f87('0x1d')],function(_0x51b8dd){return{'model':db[_0x51b8dd[_0x4f87('0x1e')]],'as':_0x51b8dd['as'],'attributes':_0x51b8dd[_0x4f87('0x1f')]};}):[]};}):[]};}):[]:[]})[_0x4f87('0xc')](function(_0x41e940){logger['info']('GetCampaign',_0x10551e);logger[_0x4f87('0x10')](_0x4f87('0x21'),_0x10551e,JSON[_0x4f87('0x12')](_0x41e940));_0x46492d(_0x41e940);})[_0x4f87('0x17')](function(_0x38e102){logger['error'](_0x4f87('0x21'),_0x38e102['message'],_0x10551e);_0x42c399(_0x6a3017[_0x4f87('0x14')](0x1f4,_0x38e102[_0x4f87('0x15')]));});});};
\ No newline at end of file
+var _0xee11=['../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','request','then','info','request\x20sent','Campaign,\x20%s,\x20%s,\x20%s','stringify','error','code','message','Campaign,\x20%s,\x20%s','result','GetCampaign','Campaign','options','where','limit','include','map','attributes','model','debug','catch','lodash','bluebird','randomstring','ioredis'];(function(_0x3cb882,_0x12f180){var _0x5d0bdb=function(_0x41780c){while(--_0x41780c){_0x3cb882['push'](_0x3cb882['shift']());}};_0x5d0bdb(++_0x12f180);}(_0xee11,0x146));var _0x1ee1=function(_0x269ee8,_0x477226){_0x269ee8=_0x269ee8-0x0;var _0x4d98bd=_0xee11[_0x269ee8];return _0x4d98bd;};'use strict';var _=require(_0x1ee1('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0x1ee1('0x1'));var rs=require(_0x1ee1('0x2'));var fs=require('fs');var Redis=require(_0x1ee1('0x3'));var db=require(_0x1ee1('0x4'))['db'];var utils=require(_0x1ee1('0x5'));var logger=require(_0x1ee1('0x6'))(_0x1ee1('0x7'));var config=require(_0x1ee1('0x8'));var jayson=require('jayson/promise');var client=jayson[_0x1ee1('0x9')][_0x1ee1('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x3fdb3b,_0x289d4c,_0x356919){return new BPromise(function(_0x47f984,_0x48af4c){return client[_0x1ee1('0xb')](_0x3fdb3b,_0x356919)[_0x1ee1('0xc')](function(_0x5899ca){logger[_0x1ee1('0xd')]('Campaign,\x20%s,\x20%s',_0x289d4c,_0x1ee1('0xe'));logger['debug'](_0x1ee1('0xf'),_0x289d4c,_0x1ee1('0xe'),JSON[_0x1ee1('0x10')](_0x5899ca));if(_0x5899ca[_0x1ee1('0x11')]){if(_0x5899ca['error'][_0x1ee1('0x12')]===0x1f4){logger[_0x1ee1('0x11')]('Campaign,\x20%s,\x20%s',_0x289d4c,_0x5899ca[_0x1ee1('0x11')][_0x1ee1('0x13')]);return _0x48af4c(_0x5899ca[_0x1ee1('0x11')][_0x1ee1('0x13')]);}logger[_0x1ee1('0x11')](_0x1ee1('0x14'),_0x289d4c,_0x5899ca[_0x1ee1('0x11')][_0x1ee1('0x13')]);return _0x47f984(_0x5899ca[_0x1ee1('0x11')][_0x1ee1('0x13')]);}else{logger[_0x1ee1('0xd')](_0x1ee1('0x14'),_0x289d4c,_0x1ee1('0xe'));_0x47f984(_0x5899ca[_0x1ee1('0x15')]['message']);}})['catch'](function(_0x7ff856){logger[_0x1ee1('0x11')](_0x1ee1('0x14'),_0x289d4c,_0x7ff856);_0x48af4c(_0x7ff856);});});}exports[_0x1ee1('0x16')]=function(_0x1e18b9){var _0xff3d76=this;return new Promise(function(_0x55abff,_0x39229e){return db[_0x1ee1('0x17')]['findAll']({'raw':_0x1e18b9[_0x1ee1('0x18')]?_0x1e18b9[_0x1ee1('0x18')]['raw']===undefined?!![]:![]:!![],'where':_0x1e18b9['options']?_0x1e18b9[_0x1ee1('0x18')][_0x1ee1('0x19')]||null:null,'attributes':_0x1e18b9[_0x1ee1('0x18')]?_0x1e18b9[_0x1ee1('0x18')]['attributes']||null:null,'limit':_0x1e18b9[_0x1ee1('0x18')]?_0x1e18b9[_0x1ee1('0x18')][_0x1ee1('0x1a')]||null:null,'include':_0x1e18b9['options']?_0x1e18b9[_0x1ee1('0x18')][_0x1ee1('0x1b')]?_[_0x1ee1('0x1c')](_0x1e18b9[_0x1ee1('0x18')][_0x1ee1('0x1b')],function(_0x353542){return{'model':db[_0x353542['model']],'as':_0x353542['as'],'attributes':_0x353542[_0x1ee1('0x1d')],'include':_0x353542['include']?_['map'](_0x353542[_0x1ee1('0x1b')],function(_0x306aac){return{'model':db[_0x306aac['model']],'as':_0x306aac['as'],'attributes':_0x306aac[_0x1ee1('0x1d')],'include':_0x306aac[_0x1ee1('0x1b')]?_[_0x1ee1('0x1c')](_0x306aac[_0x1ee1('0x1b')],function(_0x129232){return{'model':db[_0x129232[_0x1ee1('0x1e')]],'as':_0x129232['as'],'attributes':_0x129232['attributes']};}):[]};}):[]};}):[]:[]})[_0x1ee1('0xc')](function(_0x8a95d8){logger[_0x1ee1('0xd')](_0x1ee1('0x16'),_0x1e18b9);logger[_0x1ee1('0x1f')](_0x1ee1('0x16'),_0x1e18b9,JSON['stringify'](_0x8a95d8));_0x55abff(_0x8a95d8);})[_0x1ee1('0x20')](function(_0x576bf4){logger[_0x1ee1('0x11')](_0x1ee1('0x16'),_0x576bf4['message'],_0x1e18b9);_0x39229e(_0xff3d76['error'](0x1f4,_0x576bf4[_0x1ee1('0x13')]));});});};
\ No newline at end of file
diff --git a/server/api/campaign/index.js b/server/api/campaign/index.js
index 4d9caee..e0917ec 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 _0xed26=['getHopperHistories','/:id/hopper_finals','/:id/hopper_black','getHopperBlacks','/:id/lists','getLists','/:id/blacklists','getBlackLists','post','create','/:id/clone','clone','addLists','put','update','delete','/:id','destroy','removeLists','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./campaign.controller','get','isAuthenticated','index','show','/:id/hoppers','getHoppers','/:id/hopper_histories'];(function(_0x47fee3,_0x1d1878){var _0x1b8554=function(_0x5aeafb){while(--_0x5aeafb){_0x47fee3['push'](_0x47fee3['shift']());}};_0x1b8554(++_0x1d1878);}(_0xed26,0xf8));var _0x6ed2=function(_0x58214c,_0x24be4c){_0x58214c=_0x58214c-0x0;var _0x1ef67a=_0xed26[_0x58214c];return _0x1ef67a;};'use strict';var multer=require(_0x6ed2('0x0'));var util=require(_0x6ed2('0x1'));var path=require(_0x6ed2('0x2'));var timeout=require(_0x6ed2('0x3'));var express=require(_0x6ed2('0x4'));var router=express[_0x6ed2('0x5')]();var fs_extra=require(_0x6ed2('0x6'));var auth=require(_0x6ed2('0x7'));var interaction=require(_0x6ed2('0x8'));var config=require(_0x6ed2('0x9'));var controller=require(_0x6ed2('0xa'));router[_0x6ed2('0xb')]('/',auth[_0x6ed2('0xc')](),controller[_0x6ed2('0xd')]);router[_0x6ed2('0xb')]('/:id',auth[_0x6ed2('0xc')](),controller[_0x6ed2('0xe')]);router[_0x6ed2('0xb')](_0x6ed2('0xf'),auth['isAuthenticated'](),controller[_0x6ed2('0x10')]);router['get'](_0x6ed2('0x11'),auth[_0x6ed2('0xc')](),controller[_0x6ed2('0x12')]);router[_0x6ed2('0xb')](_0x6ed2('0x13'),auth[_0x6ed2('0xc')](),controller['getHopperFinals']);router[_0x6ed2('0xb')](_0x6ed2('0x14'),auth[_0x6ed2('0xc')](),controller[_0x6ed2('0x15')]);router[_0x6ed2('0xb')](_0x6ed2('0x16'),auth[_0x6ed2('0xc')](),controller[_0x6ed2('0x17')]);router[_0x6ed2('0xb')](_0x6ed2('0x18'),auth[_0x6ed2('0xc')](),controller[_0x6ed2('0x19')]);router[_0x6ed2('0x1a')]('/',auth[_0x6ed2('0xc')](),controller[_0x6ed2('0x1b')]);router[_0x6ed2('0x1a')](_0x6ed2('0x1c'),auth[_0x6ed2('0xc')](),controller[_0x6ed2('0x1d')]);router[_0x6ed2('0x1a')](_0x6ed2('0x16'),auth[_0x6ed2('0xc')](),controller[_0x6ed2('0x1e')]);router[_0x6ed2('0x1a')](_0x6ed2('0x18'),auth['isAuthenticated'](),controller['addBlackLists']);router[_0x6ed2('0x1f')]('/:id',auth['isAuthenticated'](),controller[_0x6ed2('0x20')]);router[_0x6ed2('0x21')](_0x6ed2('0x22'),auth[_0x6ed2('0xc')](),controller[_0x6ed2('0x23')]);router[_0x6ed2('0x21')](_0x6ed2('0x16'),auth[_0x6ed2('0xc')](),controller[_0x6ed2('0x24')]);router[_0x6ed2('0x21')]('/:id/blacklists',auth[_0x6ed2('0xc')](),controller['removeBlackLists']);module[_0x6ed2('0x25')]=router;
\ No newline at end of file
+var _0x0047=['multer','util','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','get','isAuthenticated','index','/:id','show','/:id/hoppers','getHoppers','/:id/hopper_histories','getHopperHistories','/:id/hopper_finals','getHopperFinals','/:id/hopper_black','getHopperBlacks','/:id/lists','getLists','/:id/blacklists','post','create','/:id/clone','clone','addLists','addBlackLists','put','delete','destroy','removeLists','removeBlackLists','exports'];(function(_0x5638f6,_0x6d4277){var _0x13ea4c=function(_0x5698b7){while(--_0x5698b7){_0x5638f6['push'](_0x5638f6['shift']());}};_0x13ea4c(++_0x6d4277);}(_0x0047,0x69));var _0x7004=function(_0x9dfc10,_0x19c2d5){_0x9dfc10=_0x9dfc10-0x0;var _0x4f938a=_0x0047[_0x9dfc10];return _0x4f938a;};'use strict';var multer=require(_0x7004('0x0'));var util=require(_0x7004('0x1'));var path=require('path');var timeout=require(_0x7004('0x2'));var express=require('express');var router=express[_0x7004('0x3')]();var fs_extra=require(_0x7004('0x4'));var auth=require(_0x7004('0x5'));var interaction=require(_0x7004('0x6'));var config=require('../../config/environment');var controller=require('./campaign.controller');router[_0x7004('0x7')]('/',auth[_0x7004('0x8')](),controller[_0x7004('0x9')]);router[_0x7004('0x7')](_0x7004('0xa'),auth[_0x7004('0x8')](),controller[_0x7004('0xb')]);router[_0x7004('0x7')](_0x7004('0xc'),auth[_0x7004('0x8')](),controller[_0x7004('0xd')]);router[_0x7004('0x7')](_0x7004('0xe'),auth[_0x7004('0x8')](),controller[_0x7004('0xf')]);router[_0x7004('0x7')](_0x7004('0x10'),auth[_0x7004('0x8')](),controller[_0x7004('0x11')]);router[_0x7004('0x7')](_0x7004('0x12'),auth['isAuthenticated'](),controller[_0x7004('0x13')]);router[_0x7004('0x7')](_0x7004('0x14'),auth[_0x7004('0x8')](),controller[_0x7004('0x15')]);router['get'](_0x7004('0x16'),auth[_0x7004('0x8')](),controller['getBlackLists']);router[_0x7004('0x17')]('/',auth[_0x7004('0x8')](),controller[_0x7004('0x18')]);router['post'](_0x7004('0x19'),auth['isAuthenticated'](),controller[_0x7004('0x1a')]);router[_0x7004('0x17')](_0x7004('0x14'),auth[_0x7004('0x8')](),controller[_0x7004('0x1b')]);router['post'](_0x7004('0x16'),auth[_0x7004('0x8')](),controller[_0x7004('0x1c')]);router[_0x7004('0x1d')](_0x7004('0xa'),auth[_0x7004('0x8')](),controller['update']);router[_0x7004('0x1e')](_0x7004('0xa'),auth[_0x7004('0x8')](),controller[_0x7004('0x1f')]);router[_0x7004('0x1e')](_0x7004('0x14'),auth[_0x7004('0x8')](),controller[_0x7004('0x20')]);router[_0x7004('0x1e')](_0x7004('0x16'),auth[_0x7004('0x8')](),controller[_0x7004('0x21')]);module[_0x7004('0x22')]=router;
\ No newline at end of file
diff --git a/server/api/cannedAnswer/cannedAnswer.attributes.js b/server/api/cannedAnswer/cannedAnswer.attributes.js
index f2e5fee..0ea522f 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 _0xdb55=['STRING','TEXT','VIRTUAL','getDataValue'];(function(_0x58b93f,_0x461181){var _0x4b38ab=function(_0x272e38){while(--_0x272e38){_0x58b93f['push'](_0x58b93f['shift']());}};_0x4b38ab(++_0x461181);}(_0xdb55,0x1b0));var _0x5db5=function(_0xa03e76,_0xaee3a6){_0xa03e76=_0xa03e76-0x0;var _0x4132be=_0xdb55[_0xa03e76];return _0x4132be;};'use strict';var Sequelize=require('sequelize');module['exports']={'key':{'type':Sequelize[_0x5db5('0x0')],'allowNull':![]},'value':{'type':Sequelize[_0x5db5('0x1')],'allowNull':![]},'description':{'type':Sequelize[_0x5db5('0x0')]},'name':{'type':Sequelize[_0x5db5('0x2')],'get':function(){return this[_0x5db5('0x3')]('key');}}};
\ No newline at end of file
+var _0x574c=['VIRTUAL','getDataValue','key','sequelize','exports','STRING'];(function(_0x4a850a,_0x43ed12){var _0x1126ec=function(_0x27a594){while(--_0x27a594){_0x4a850a['push'](_0x4a850a['shift']());}};_0x1126ec(++_0x43ed12);}(_0x574c,0xf3));var _0xc574=function(_0x519828,_0x51ff66){_0x519828=_0x519828-0x0;var _0x25857b=_0x574c[_0x519828];return _0x25857b;};'use strict';var Sequelize=require(_0xc574('0x0'));module[_0xc574('0x1')]={'key':{'type':Sequelize[_0xc574('0x2')],'allowNull':![]},'value':{'type':Sequelize['TEXT'],'allowNull':![]},'description':{'type':Sequelize[_0xc574('0x2')]},'name':{'type':Sequelize[_0xc574('0x3')],'get':function(){return this[_0xc574('0x4')](_0xc574('0x5'));}}};
\ No newline at end of file
diff --git a/server/api/cannedAnswer/cannedAnswer.controller.js b/server/api/cannedAnswer/cannedAnswer.controller.js
index 894b09a..5dec0f5 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 _0x86a8=['mustache','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','json','undefined','limit','count','offset','set','Content-Range','apply','save','update','then','destroy','get','CannedAnswers','UserProfileResource','end','error','name','send','index','map','rawAttributes','key','model','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','merge','filter','options','CannedAnswer','includeAll','include','findAll','rows','catch','show','params','find','body','MailAccountId','SmsAccountId','OpenchannelAccountId','ChatWebsiteId','Sequelize','ValidationError','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','userProfileId','eml-format','rimraf','zip-dir','request-promise','moment','bluebird'];(function(_0x1f902e,_0x3f0dff){var _0x781015=function(_0x2b2322){while(--_0x2b2322){_0x1f902e['push'](_0x1f902e['shift']());}};_0x781015(++_0x3f0dff);}(_0x86a8,0x15e));var _0x886a=function(_0x23e50d,_0x4a7c5c){_0x23e50d=_0x23e50d-0x0;var _0x1dd4a2=_0x86a8[_0x23e50d];return _0x1dd4a2;};'use strict';var emlformat=require(_0x886a('0x0'));var rimraf=require(_0x886a('0x1'));var zipdir=require(_0x886a('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x886a('0x3'));var moment=require(_0x886a('0x4'));var BPromise=require(_0x886a('0x5'));var Mustache=require(_0x886a('0x6'));var util=require('util');var path=require('path');var sox=require(_0x886a('0x7'));var csv=require(_0x886a('0x8'));var ejs=require(_0x886a('0x9'));var fs=require('fs');var fs_extra=require(_0x886a('0xa'));var _=require(_0x886a('0xb'));var squel=require(_0x886a('0xc'));var crypto=require(_0x886a('0xd'));var jsforce=require(_0x886a('0xe'));var deskjs=require(_0x886a('0xf'));var toCsv=require(_0x886a('0x8'));var querystring=require(_0x886a('0x10'));var Papa=require(_0x886a('0x11'));var Redis=require(_0x886a('0x12'));var authService=require('../../components/auth/service');var qs=require(_0x886a('0x13'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0x886a('0x14'))(_0x886a('0x15'));var utils=require(_0x886a('0x16'));var config=require(_0x886a('0x17'));var licenseUtil=require(_0x886a('0x18'));var db=require(_0x886a('0x19'))['db'];function respondWithStatusCode(_0x4d153e,_0x5b1101){_0x5b1101=_0x5b1101||0xcc;return function(_0x18a3e2){if(_0x18a3e2){return _0x4d153e[_0x886a('0x1a')](_0x5b1101);}return _0x4d153e[_0x886a('0x1b')](_0x5b1101)['end']();};}function respondWithResult(_0x3ed48d,_0x46601c){_0x46601c=_0x46601c||0xc8;return function(_0x4e08c3){if(_0x4e08c3){return _0x3ed48d[_0x886a('0x1b')](_0x46601c)[_0x886a('0x1c')](_0x4e08c3);}};}function respondWithFilteredResult(_0x214934,_0x1c46b5){return function(_0x9b853a){if(_0x9b853a){var _0x583236=typeof _0x1c46b5['offset']===_0x886a('0x1d')&&typeof _0x1c46b5[_0x886a('0x1e')]==='undefined';var _0x4e5d84=_0x9b853a[_0x886a('0x1f')];var _0x576aaa=_0x583236?0x0:_0x1c46b5[_0x886a('0x20')];var _0x2a98a7=_0x583236?_0x9b853a['count']:_0x1c46b5[_0x886a('0x20')]+_0x1c46b5[_0x886a('0x1e')];var _0x4dd934;if(_0x2a98a7>=_0x4e5d84){_0x2a98a7=_0x4e5d84;_0x4dd934=0xc8;}else{_0x4dd934=0xce;}_0x214934[_0x886a('0x1b')](_0x4dd934);return _0x214934[_0x886a('0x21')](_0x886a('0x22'),_0x576aaa+'-'+_0x2a98a7+'/'+_0x4e5d84)[_0x886a('0x1c')](_0x9b853a);}return null;};}function patchUpdates(_0x19924f){return function(_0x11f274){try{jsonpatch[_0x886a('0x23')](_0x11f274,_0x19924f,!![]);}catch(_0x2cd722){return BPromise['reject'](_0x2cd722);}return _0x11f274[_0x886a('0x24')]();};}function saveUpdates(_0x3093d8,_0x492f84){return function(_0x2184ad){if(_0x2184ad){return _0x2184ad[_0x886a('0x25')](_0x3093d8)[_0x886a('0x26')](function(_0x29b80f){return _0x29b80f;});}return null;};}function removeEntity(_0x43fbf8,_0x476d69){return function(_0x4a317e){if(_0x4a317e){return _0x4a317e[_0x886a('0x27')]()[_0x886a('0x26')](function(){var _0x45d2f0=_0x4a317e[_0x886a('0x28')]({'plain':!![]});var _0x474622=_0x886a('0x29');return db[_0x886a('0x2a')][_0x886a('0x27')]({'where':{'type':_0x474622,'resourceId':_0x45d2f0['id']}})[_0x886a('0x26')](function(){return _0x4a317e;});})[_0x886a('0x26')](function(){_0x43fbf8[_0x886a('0x1b')](0xcc)[_0x886a('0x2b')]();});}};}function handleEntityNotFound(_0x355a6b,_0x293190){return function(_0x17a93c){if(!_0x17a93c){_0x355a6b[_0x886a('0x1a')](0x194);}return _0x17a93c;};}function handleError(_0x1cbcbf,_0xa8107d){_0xa8107d=_0xa8107d||0x1f4;return function(_0x3f1c0f){logger[_0x886a('0x2c')](_0x3f1c0f['stack']);if(_0x3f1c0f['name']){delete _0x3f1c0f[_0x886a('0x2d')];}_0x1cbcbf[_0x886a('0x1b')](_0xa8107d)[_0x886a('0x2e')](_0x3f1c0f);};}exports[_0x886a('0x2f')]=function(_0x317bd5,_0x3fae08){var _0x38b3b8={},_0x2d2abb={},_0x2db8f0={'count':0x0,'rows':[]};var _0x31a8e0=_[_0x886a('0x30')](db['CannedAnswer'][_0x886a('0x31')],function(_0x91058b){return{'name':_0x91058b['fieldName'],'type':_0x91058b['type'][_0x886a('0x32')]};});_0x2d2abb[_0x886a('0x33')]=_[_0x886a('0x30')](_0x31a8e0,_0x886a('0x2d'));_0x2d2abb['query']=_[_0x886a('0x34')](_0x317bd5[_0x886a('0x35')]);_0x2d2abb[_0x886a('0x36')]=_[_0x886a('0x37')](_0x2d2abb[_0x886a('0x33')],_0x2d2abb['query']);_0x38b3b8[_0x886a('0x38')]=_['intersection'](_0x2d2abb[_0x886a('0x33')],qs[_0x886a('0x39')](_0x317bd5[_0x886a('0x35')][_0x886a('0x39')]));_0x38b3b8[_0x886a('0x38')]=_0x38b3b8['attributes'][_0x886a('0x3a')]?_0x38b3b8['attributes']:_0x2d2abb['model'];if(!_0x317bd5[_0x886a('0x35')][_0x886a('0x3b')](_0x886a('0x3c'))){_0x38b3b8[_0x886a('0x1e')]=qs[_0x886a('0x1e')](_0x317bd5[_0x886a('0x35')][_0x886a('0x1e')]);_0x38b3b8[_0x886a('0x20')]=qs[_0x886a('0x20')](_0x317bd5['query'][_0x886a('0x20')]);}_0x38b3b8[_0x886a('0x3d')]=qs[_0x886a('0x3e')](_0x317bd5[_0x886a('0x35')][_0x886a('0x3e')]);_0x38b3b8[_0x886a('0x3f')]=qs[_0x886a('0x36')](_[_0x886a('0x40')](_0x317bd5[_0x886a('0x35')],_0x2d2abb[_0x886a('0x36')]),_0x31a8e0);if(_0x317bd5[_0x886a('0x35')]['filter']){_0x38b3b8[_0x886a('0x3f')]=_[_0x886a('0x41')](_0x38b3b8[_0x886a('0x3f')],{'$or':[{'key':{'$like':'%'+_0x317bd5[_0x886a('0x35')][_0x886a('0x42')]+'%'}},{'value':{'$like':'%'+_0x317bd5[_0x886a('0x35')][_0x886a('0x42')]+'%'}}]});}_0x38b3b8=_[_0x886a('0x41')]({},_0x38b3b8,_0x317bd5[_0x886a('0x43')]);var _0x14bbca={'where':_0x38b3b8[_0x886a('0x3f')]};return db[_0x886a('0x44')][_0x886a('0x1f')](_0x14bbca)['then'](function(_0x5c7edc){_0x2db8f0['count']=_0x5c7edc;if(_0x317bd5[_0x886a('0x35')][_0x886a('0x45')]){_0x38b3b8[_0x886a('0x46')]=[{'all':!![]}];}return db[_0x886a('0x44')][_0x886a('0x47')](_0x38b3b8);})[_0x886a('0x26')](function(_0x2202f9){_0x2db8f0[_0x886a('0x48')]=_0x2202f9;return _0x2db8f0;})[_0x886a('0x26')](respondWithFilteredResult(_0x3fae08,_0x38b3b8))[_0x886a('0x49')](handleError(_0x3fae08,null));};exports[_0x886a('0x4a')]=function(_0x181de4,_0x45b6d2){var _0x4b7024={'raw':!![],'where':{'id':_0x181de4[_0x886a('0x4b')]['id']}},_0x21aa60={};_0x21aa60['model']=_[_0x886a('0x34')](db['CannedAnswer']['rawAttributes']);_0x21aa60[_0x886a('0x35')]=_[_0x886a('0x34')](_0x181de4[_0x886a('0x35')]);_0x21aa60[_0x886a('0x36')]=_['intersection'](_0x21aa60['model'],_0x21aa60[_0x886a('0x35')]);_0x4b7024[_0x886a('0x38')]=_[_0x886a('0x37')](_0x21aa60['model'],qs[_0x886a('0x39')](_0x181de4['query'][_0x886a('0x39')]));_0x4b7024[_0x886a('0x38')]=_0x4b7024[_0x886a('0x38')][_0x886a('0x3a')]?_0x4b7024[_0x886a('0x38')]:_0x21aa60[_0x886a('0x33')];if(_0x181de4['query'][_0x886a('0x45')]){_0x4b7024[_0x886a('0x46')]=[{'all':!![]}];}_0x4b7024=_[_0x886a('0x41')]({},_0x4b7024,_0x181de4[_0x886a('0x43')]);return db[_0x886a('0x44')][_0x886a('0x4c')](_0x4b7024)['then'](handleEntityNotFound(_0x45b6d2,null))[_0x886a('0x26')](respondWithResult(_0x45b6d2,null))['catch'](handleError(_0x45b6d2,null));};exports[_0x886a('0x25')]=function(_0x4654a9,_0x1634ef){if(_0x4654a9[_0x886a('0x4d')]['id']){delete _0x4654a9[_0x886a('0x4d')]['id'];}return db[_0x886a('0x44')]['find']({'where':{'id':_0x4654a9[_0x886a('0x4b')]['id']}})[_0x886a('0x26')](handleEntityNotFound(_0x1634ef,null))[_0x886a('0x26')](saveUpdates(_0x4654a9['body'],null))[_0x886a('0x26')](respondWithResult(_0x1634ef,null))[_0x886a('0x49')](handleError(_0x1634ef,null));};exports[_0x886a('0x27')]=function(_0x2da45a,_0x2286b1){return db[_0x886a('0x44')]['find']({'where':{'id':_0x2da45a[_0x886a('0x4b')]['id']}})[_0x886a('0x26')](handleEntityNotFound(_0x2286b1,null))[_0x886a('0x26')](removeEntity(_0x2286b1,null))[_0x886a('0x49')](handleError(_0x2286b1,null));};exports['create']=function(_0x4dc22a,_0x2c1884){var _0x61c0dc={'key':_0x4dc22a[_0x886a('0x4d')][_0x886a('0x32')]};if(_0x4dc22a[_0x886a('0x4d')]['MailAccountId']){_0x61c0dc[_0x886a('0x4e')]=_0x4dc22a[_0x886a('0x4d')][_0x886a('0x4e')];}else if(_0x4dc22a[_0x886a('0x4d')][_0x886a('0x4f')]){_0x61c0dc[_0x886a('0x4f')]=_0x4dc22a[_0x886a('0x4d')][_0x886a('0x4f')];}else if(_0x4dc22a[_0x886a('0x4d')][_0x886a('0x50')]){_0x61c0dc['OpenchannelAccountId']=_0x4dc22a[_0x886a('0x4d')]['OpenchannelAccountId'];}else if(_0x4dc22a[_0x886a('0x4d')][_0x886a('0x51')]){_0x61c0dc['ChatWebsiteId']=_0x4dc22a['body']['ChatWebsiteId'];}return db[_0x886a('0x44')]['find']({'where':_0x61c0dc})[_0x886a('0x26')](function(_0x43a1dd){if(_0x43a1dd){throw new db[(_0x886a('0x52'))][(_0x886a('0x53'))]('The\x20inserted\x20key\x20already\x20exists.');}return db[_0x886a('0x44')][_0x886a('0x54')](_0x4dc22a[_0x886a('0x4d')]);})[_0x886a('0x26')](function(_0x4b3f1c){var _0xb050ce=_0x4dc22a[_0x886a('0x55')]['get']({'plain':!![]});if(!_0xb050ce)throw new Error(_0x886a('0x56'));if(_0xb050ce['role']==='user'){var _0x387a32=_0x4b3f1c[_0x886a('0x28')]({'plain':!![]});return db[_0x886a('0x57')][_0x886a('0x4c')]({'where':{'name':_0x886a('0x29'),'userProfileId':_0xb050ce[_0x886a('0x58')]},'raw':!![]})['then'](function(_0x4da8cc){if(_0x4da8cc&&_0x4da8cc['autoAssociation']===0x0){return db[_0x886a('0x2a')][_0x886a('0x54')]({'name':_0x387a32[_0x886a('0x2d')],'resourceId':_0x387a32['id'],'type':_0x4da8cc['name'],'sectionId':_0x4da8cc['id']},{})['then'](function(){return _0x4b3f1c;});}else{return _0x4b3f1c;}})['catch'](function(_0x46dd24){logger[_0x886a('0x2c')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x46dd24);throw _0x46dd24;});}return _0x4b3f1c;})['then'](respondWithResult(_0x2c1884,0xc9))['catch'](handleError(_0x2c1884,null));};
\ No newline at end of file
+var _0xef9f=['create','MailAccountId','SmsAccountId','OpenchannelAccountId','ChatWebsiteId','Sequelize','ValidationError','The\x20inserted\x20key\x20already\x20exists.','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','zip-dir','request-promise','moment','bluebird','mustache','util','path','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','offset','undefined','count','Content-Range','json','apply','reject','update','then','destroy','get','CannedAnswers','UserProfileResource','end','error','stack','name','send','index','map','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','limit','order','sort','where','pick','filter','merge','options','CannedAnswer','includeAll','include','findAll','rows','show','params','catch','body','find'];(function(_0x1facfa,_0x1acf7d){var _0x9ec701=function(_0x115e37){while(--_0x115e37){_0x1facfa['push'](_0x1facfa['shift']());}};_0x9ec701(++_0x1acf7d);}(_0xef9f,0x122));var _0xfef9=function(_0x3893cd,_0x5b133e){_0x3893cd=_0x3893cd-0x0;var _0x818ea5=_0xef9f[_0x3893cd];return _0x818ea5;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0xfef9('0x0'));var jsonpatch=require('fast-json-patch');var rp=require(_0xfef9('0x1'));var moment=require(_0xfef9('0x2'));var BPromise=require(_0xfef9('0x3'));var Mustache=require(_0xfef9('0x4'));var util=require(_0xfef9('0x5'));var path=require(_0xfef9('0x6'));var sox=require('sox');var csv=require(_0xfef9('0x7'));var ejs=require(_0xfef9('0x8'));var fs=require('fs');var fs_extra=require(_0xfef9('0x9'));var _=require(_0xfef9('0xa'));var squel=require(_0xfef9('0xb'));var crypto=require(_0xfef9('0xc'));var jsforce=require(_0xfef9('0xd'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0xfef9('0xe'));var Papa=require(_0xfef9('0xf'));var Redis=require(_0xfef9('0x10'));var authService=require(_0xfef9('0x11'));var qs=require(_0xfef9('0x12'));var as=require(_0xfef9('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xfef9('0x14'))('api');var utils=require(_0xfef9('0x15'));var config=require('../../config/environment');var licenseUtil=require(_0xfef9('0x16'));var db=require(_0xfef9('0x17'))['db'];function respondWithStatusCode(_0x3df20b,_0x20c90e){_0x20c90e=_0x20c90e||0xcc;return function(_0x350a31){if(_0x350a31){return _0x3df20b[_0xfef9('0x18')](_0x20c90e);}return _0x3df20b['status'](_0x20c90e)['end']();};}function respondWithResult(_0x2e3c95,_0x3eab72){_0x3eab72=_0x3eab72||0xc8;return function(_0x41064e){if(_0x41064e){return _0x2e3c95[_0xfef9('0x19')](_0x3eab72)['json'](_0x41064e);}};}function respondWithFilteredResult(_0x44646e,_0xa32f1){return function(_0x263386){if(_0x263386){var _0x4c6683=typeof _0xa32f1[_0xfef9('0x1a')]===_0xfef9('0x1b')&&typeof _0xa32f1['limit']===_0xfef9('0x1b');var _0x1d2277=_0x263386[_0xfef9('0x1c')];var _0xeaa514=_0x4c6683?0x0:_0xa32f1[_0xfef9('0x1a')];var _0x108a6b=_0x4c6683?_0x263386[_0xfef9('0x1c')]:_0xa32f1[_0xfef9('0x1a')]+_0xa32f1['limit'];var _0x36df58;if(_0x108a6b>=_0x1d2277){_0x108a6b=_0x1d2277;_0x36df58=0xc8;}else{_0x36df58=0xce;}_0x44646e[_0xfef9('0x19')](_0x36df58);return _0x44646e['set'](_0xfef9('0x1d'),_0xeaa514+'-'+_0x108a6b+'/'+_0x1d2277)[_0xfef9('0x1e')](_0x263386);}return null;};}function patchUpdates(_0x5e3cf9){return function(_0x381237){try{jsonpatch[_0xfef9('0x1f')](_0x381237,_0x5e3cf9,!![]);}catch(_0x57266d){return BPromise[_0xfef9('0x20')](_0x57266d);}return _0x381237['save']();};}function saveUpdates(_0x107cc1,_0x1ce2d8){return function(_0x3801fc){if(_0x3801fc){return _0x3801fc[_0xfef9('0x21')](_0x107cc1)[_0xfef9('0x22')](function(_0x20a8d3){return _0x20a8d3;});}return null;};}function removeEntity(_0x86ed5d,_0x376ca7){return function(_0x23b3d2){if(_0x23b3d2){return _0x23b3d2[_0xfef9('0x23')]()[_0xfef9('0x22')](function(){var _0x573740=_0x23b3d2[_0xfef9('0x24')]({'plain':!![]});var _0x32c213=_0xfef9('0x25');return db[_0xfef9('0x26')][_0xfef9('0x23')]({'where':{'type':_0x32c213,'resourceId':_0x573740['id']}})[_0xfef9('0x22')](function(){return _0x23b3d2;});})[_0xfef9('0x22')](function(){_0x86ed5d[_0xfef9('0x19')](0xcc)[_0xfef9('0x27')]();});}};}function handleEntityNotFound(_0x528c02,_0x566642){return function(_0x2af7d2){if(!_0x2af7d2){_0x528c02[_0xfef9('0x18')](0x194);}return _0x2af7d2;};}function handleError(_0x28dfc5,_0x5aaa9f){_0x5aaa9f=_0x5aaa9f||0x1f4;return function(_0x1f74ef){logger[_0xfef9('0x28')](_0x1f74ef[_0xfef9('0x29')]);if(_0x1f74ef[_0xfef9('0x2a')]){delete _0x1f74ef[_0xfef9('0x2a')];}_0x28dfc5[_0xfef9('0x19')](_0x5aaa9f)[_0xfef9('0x2b')](_0x1f74ef);};}exports[_0xfef9('0x2c')]=function(_0x6a2edc,_0x1ef741){var _0x345661={},_0x46da4d={},_0x245958={'count':0x0,'rows':[]};var _0x6955b2=_[_0xfef9('0x2d')](db['CannedAnswer'][_0xfef9('0x2e')],function(_0x1c0ab9){return{'name':_0x1c0ab9[_0xfef9('0x2f')],'type':_0x1c0ab9[_0xfef9('0x30')][_0xfef9('0x31')]};});_0x46da4d[_0xfef9('0x32')]=_[_0xfef9('0x2d')](_0x6955b2,_0xfef9('0x2a'));_0x46da4d[_0xfef9('0x33')]=_[_0xfef9('0x34')](_0x6a2edc['query']);_0x46da4d[_0xfef9('0x35')]=_['intersection'](_0x46da4d['model'],_0x46da4d[_0xfef9('0x33')]);_0x345661['attributes']=_[_0xfef9('0x36')](_0x46da4d[_0xfef9('0x32')],qs['fields'](_0x6a2edc[_0xfef9('0x33')][_0xfef9('0x37')]));_0x345661[_0xfef9('0x38')]=_0x345661[_0xfef9('0x38')][_0xfef9('0x39')]?_0x345661[_0xfef9('0x38')]:_0x46da4d[_0xfef9('0x32')];if(!_0x6a2edc['query'][_0xfef9('0x3a')](_0xfef9('0x3b'))){_0x345661[_0xfef9('0x3c')]=qs[_0xfef9('0x3c')](_0x6a2edc[_0xfef9('0x33')][_0xfef9('0x3c')]);_0x345661[_0xfef9('0x1a')]=qs['offset'](_0x6a2edc['query'][_0xfef9('0x1a')]);}_0x345661[_0xfef9('0x3d')]=qs[_0xfef9('0x3e')](_0x6a2edc['query']['sort']);_0x345661[_0xfef9('0x3f')]=qs[_0xfef9('0x35')](_[_0xfef9('0x40')](_0x6a2edc['query'],_0x46da4d['filters']),_0x6955b2);if(_0x6a2edc[_0xfef9('0x33')][_0xfef9('0x41')]){_0x345661[_0xfef9('0x3f')]=_[_0xfef9('0x42')](_0x345661[_0xfef9('0x3f')],{'$or':[{'key':{'$like':'%'+_0x6a2edc[_0xfef9('0x33')][_0xfef9('0x41')]+'%'}},{'value':{'$like':'%'+_0x6a2edc['query']['filter']+'%'}}]});}_0x345661=_[_0xfef9('0x42')]({},_0x345661,_0x6a2edc[_0xfef9('0x43')]);var _0xf64f63={'where':_0x345661['where']};return db[_0xfef9('0x44')]['count'](_0xf64f63)[_0xfef9('0x22')](function(_0x1008eb){_0x245958[_0xfef9('0x1c')]=_0x1008eb;if(_0x6a2edc[_0xfef9('0x33')][_0xfef9('0x45')]){_0x345661[_0xfef9('0x46')]=[{'all':!![]}];}return db[_0xfef9('0x44')][_0xfef9('0x47')](_0x345661);})[_0xfef9('0x22')](function(_0xf13127){_0x245958[_0xfef9('0x48')]=_0xf13127;return _0x245958;})[_0xfef9('0x22')](respondWithFilteredResult(_0x1ef741,_0x345661))['catch'](handleError(_0x1ef741,null));};exports[_0xfef9('0x49')]=function(_0x4d411b,_0x45a701){var _0x4b29fb={'raw':!![],'where':{'id':_0x4d411b[_0xfef9('0x4a')]['id']}},_0x4fc3ad={};_0x4fc3ad['model']=_[_0xfef9('0x34')](db[_0xfef9('0x44')][_0xfef9('0x2e')]);_0x4fc3ad['query']=_[_0xfef9('0x34')](_0x4d411b['query']);_0x4fc3ad[_0xfef9('0x35')]=_['intersection'](_0x4fc3ad[_0xfef9('0x32')],_0x4fc3ad[_0xfef9('0x33')]);_0x4b29fb[_0xfef9('0x38')]=_['intersection'](_0x4fc3ad[_0xfef9('0x32')],qs[_0xfef9('0x37')](_0x4d411b[_0xfef9('0x33')]['fields']));_0x4b29fb[_0xfef9('0x38')]=_0x4b29fb[_0xfef9('0x38')][_0xfef9('0x39')]?_0x4b29fb['attributes']:_0x4fc3ad[_0xfef9('0x32')];if(_0x4d411b['query'][_0xfef9('0x45')]){_0x4b29fb[_0xfef9('0x46')]=[{'all':!![]}];}_0x4b29fb=_[_0xfef9('0x42')]({},_0x4b29fb,_0x4d411b['options']);return db['CannedAnswer']['find'](_0x4b29fb)[_0xfef9('0x22')](handleEntityNotFound(_0x45a701,null))[_0xfef9('0x22')](respondWithResult(_0x45a701,null))[_0xfef9('0x4b')](handleError(_0x45a701,null));};exports[_0xfef9('0x21')]=function(_0x135882,_0x7bd636){if(_0x135882[_0xfef9('0x4c')]['id']){delete _0x135882[_0xfef9('0x4c')]['id'];}return db[_0xfef9('0x44')]['find']({'where':{'id':_0x135882['params']['id']}})[_0xfef9('0x22')](handleEntityNotFound(_0x7bd636,null))[_0xfef9('0x22')](saveUpdates(_0x135882['body'],null))[_0xfef9('0x22')](respondWithResult(_0x7bd636,null))[_0xfef9('0x4b')](handleError(_0x7bd636,null));};exports['destroy']=function(_0x134f65,_0x370239){return db[_0xfef9('0x44')][_0xfef9('0x4d')]({'where':{'id':_0x134f65[_0xfef9('0x4a')]['id']}})[_0xfef9('0x22')](handleEntityNotFound(_0x370239,null))[_0xfef9('0x22')](removeEntity(_0x370239,null))['catch'](handleError(_0x370239,null));};exports[_0xfef9('0x4e')]=function(_0x59368d,_0x12f547){var _0x2566a7={'key':_0x59368d[_0xfef9('0x4c')][_0xfef9('0x31')]};if(_0x59368d[_0xfef9('0x4c')][_0xfef9('0x4f')]){_0x2566a7[_0xfef9('0x4f')]=_0x59368d[_0xfef9('0x4c')][_0xfef9('0x4f')];}else if(_0x59368d['body'][_0xfef9('0x50')]){_0x2566a7[_0xfef9('0x50')]=_0x59368d['body'][_0xfef9('0x50')];}else if(_0x59368d[_0xfef9('0x4c')]['OpenchannelAccountId']){_0x2566a7[_0xfef9('0x51')]=_0x59368d[_0xfef9('0x4c')][_0xfef9('0x51')];}else if(_0x59368d[_0xfef9('0x4c')]['ChatWebsiteId']){_0x2566a7['ChatWebsiteId']=_0x59368d[_0xfef9('0x4c')][_0xfef9('0x52')];}return db['CannedAnswer'][_0xfef9('0x4d')]({'where':_0x2566a7})[_0xfef9('0x22')](function(_0x3765a5){if(_0x3765a5){throw new db[(_0xfef9('0x53'))][(_0xfef9('0x54'))](_0xfef9('0x55'));}return db['CannedAnswer'][_0xfef9('0x4e')](_0x59368d[_0xfef9('0x4c')]);})[_0xfef9('0x22')](function(_0x1c4db4){var _0x56a64c=_0x59368d[_0xfef9('0x56')][_0xfef9('0x24')]({'plain':!![]});if(!_0x56a64c)throw new Error(_0xfef9('0x57'));if(_0x56a64c['role']===_0xfef9('0x56')){var _0x5c3c7a=_0x1c4db4[_0xfef9('0x24')]({'plain':!![]});return db[_0xfef9('0x58')][_0xfef9('0x4d')]({'where':{'name':_0xfef9('0x25'),'userProfileId':_0x56a64c[_0xfef9('0x59')]},'raw':!![]})['then'](function(_0x1115a5){if(_0x1115a5&&_0x1115a5[_0xfef9('0x5a')]===0x0){return db[_0xfef9('0x26')][_0xfef9('0x4e')]({'name':_0x5c3c7a[_0xfef9('0x2a')],'resourceId':_0x5c3c7a['id'],'type':_0x1115a5[_0xfef9('0x2a')],'sectionId':_0x1115a5['id']},{})['then'](function(){return _0x1c4db4;});}else{return _0x1c4db4;}})[_0xfef9('0x4b')](function(_0x4efd85){logger[_0xfef9('0x28')](_0xfef9('0x5b'),_0x4efd85);throw _0x4efd85;});}return _0x1c4db4;})[_0xfef9('0x22')](respondWithResult(_0x12f547,0xc9))[_0xfef9('0x4b')](handleError(_0x12f547,null));};
\ No newline at end of file
diff --git a/server/api/cannedAnswer/cannedAnswer.model.js b/server/api/cannedAnswer/cannedAnswer.model.js
index 9156d2d..b0e1841 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 _0x81f6=['tools_canned_answers','utf8mb4','utf8mb4_unicode_ci','lodash','../../config/logger','moment','bluebird','request-promise','rimraf','../../config/environment','./cannedAnswer.attributes','define','CannedAnswer'];(function(_0x1e7be4,_0x18ed8a){var _0x3bc4ff=function(_0x2b5a94){while(--_0x2b5a94){_0x1e7be4['push'](_0x1e7be4['shift']());}};_0x3bc4ff(++_0x18ed8a);}(_0x81f6,0x107));var _0x681f=function(_0x299ecc,_0x4a5760){_0x299ecc=_0x299ecc-0x0;var _0x5c6ab=_0x81f6[_0x299ecc];return _0x5c6ab;};'use strict';var _=require(_0x681f('0x0'));var util=require('util');var logger=require(_0x681f('0x1'))('api');var moment=require(_0x681f('0x2'));var BPromise=require(_0x681f('0x3'));var rp=require(_0x681f('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x681f('0x5'));var config=require(_0x681f('0x6'));var attributes=require(_0x681f('0x7'));module['exports']=function(_0x8ae55a,_0x51edd9){return _0x8ae55a[_0x681f('0x8')](_0x681f('0x9'),attributes,{'tableName':_0x681f('0xa'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x681f('0xb'),'collate':_0x681f('0xc')});};
\ No newline at end of file
+var _0xbf2b=['define','CannedAnswer','tools_canned_answers','utf8mb4_unicode_ci','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','exports'];(function(_0x20ac07,_0x55002e){var _0x25d350=function(_0x51910c){while(--_0x51910c){_0x20ac07['push'](_0x20ac07['shift']());}};_0x25d350(++_0x55002e);}(_0xbf2b,0x12f));var _0xbbf2=function(_0xccd88b,_0x18f330){_0xccd88b=_0xccd88b-0x0;var _0x1ea528=_0xbf2b[_0xccd88b];return _0x1ea528;};'use strict';var _=require(_0xbbf2('0x0'));var util=require(_0xbbf2('0x1'));var logger=require(_0xbbf2('0x2'))(_0xbbf2('0x3'));var moment=require(_0xbbf2('0x4'));var BPromise=require(_0xbbf2('0x5'));var rp=require(_0xbbf2('0x6'));var fs=require('fs');var path=require(_0xbbf2('0x7'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require('./cannedAnswer.attributes');module[_0xbbf2('0x8')]=function(_0x3c887f,_0x420df3){return _0x3c887f[_0xbbf2('0x9')](_0xbbf2('0xa'),attributes,{'tableName':_0xbbf2('0xb'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':'utf8mb4','collate':_0xbbf2('0xc')});};
\ No newline at end of file
diff --git a/server/api/cannedAnswer/cannedAnswer.rpc.js b/server/api/cannedAnswer/cannedAnswer.rpc.js
index bc9dcab..cb45144 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(_0x53f248,_0x3682ed){var _0x13332c=function(_0xd6a851){while(--_0xd6a851){_0x53f248['push'](_0x53f248['shift']());}};_0x13332c(++_0x3682ed);}(_0xa9e0,0x123));var _0x0a9e=function(_0x5b78e8,_0x55096b){_0x5b78e8=_0x5b78e8-0x0;var _0xf2c321=_0xa9e0[_0x5b78e8];return _0xf2c321;};'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(_0x286977,_0x4ffc3b){var _0x48da52=function(_0x3bf836){while(--_0x3bf836){_0x286977['push'](_0x286977['shift']());}};_0x48da52(++_0x4ffc3b);}(_0xa9e0,0x123));var _0x0a9e=function(_0x2b4411,_0x2625ed){_0x2b4411=_0x2b4411-0x0;var _0x8e41ef=_0xa9e0[_0x2b4411];return _0x8e41ef;};'use strict';var _=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var moment=require(_0x0a9e('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x0a9e('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x0a9e('0x4'));var logger=require(_0x0a9e('0x5'))(_0x0a9e('0x6'));var config=require(_0x0a9e('0x7'));var jayson=require(_0x0a9e('0x8'));var client=jayson['client'][_0x0a9e('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x441e3a,_0x2cc193,_0x5f41ea){return new BPromise(function(_0x503809,_0xe42b77){return client['request'](_0x441e3a,_0x5f41ea)['then'](function(_0x39753a){logger[_0x0a9e('0xa')](_0x0a9e('0xb'),_0x2cc193,_0x0a9e('0xc'));logger[_0x0a9e('0xd')](_0x0a9e('0xe'),_0x2cc193,'request\x20sent',JSON['stringify'](_0x39753a));if(_0x39753a['error']){if(_0x39753a['error'][_0x0a9e('0xf')]===0x1f4){logger[_0x0a9e('0x10')](_0x0a9e('0xb'),_0x2cc193,_0x39753a[_0x0a9e('0x10')][_0x0a9e('0x11')]);return _0xe42b77(_0x39753a[_0x0a9e('0x10')]['message']);}logger[_0x0a9e('0x10')](_0x0a9e('0xb'),_0x2cc193,_0x39753a[_0x0a9e('0x10')][_0x0a9e('0x11')]);return _0x503809(_0x39753a[_0x0a9e('0x10')][_0x0a9e('0x11')]);}else{logger['info'](_0x0a9e('0xb'),_0x2cc193,'request\x20sent');_0x503809(_0x39753a[_0x0a9e('0x12')]['message']);}})[_0x0a9e('0x13')](function(_0x12066b){logger['error'](_0x0a9e('0xb'),_0x2cc193,_0x12066b);_0xe42b77(_0x12066b);});});}
\ No newline at end of file
diff --git a/server/api/cannedAnswer/index.js b/server/api/cannedAnswer/index.js
index ed61248..baa9c9c 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 _0x1af2=['create','put','update','delete','exports','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./cannedAnswer.controller','get','isAuthenticated','index','/:id','post'];(function(_0x1a30ea,_0x22bf39){var _0x36b8f2=function(_0x32fbbb){while(--_0x32fbbb){_0x1a30ea['push'](_0x1a30ea['shift']());}};_0x36b8f2(++_0x22bf39);}(_0x1af2,0x7c));var _0x21af=function(_0x45b4d9,_0x6228b9){_0x45b4d9=_0x45b4d9-0x0;var _0x54ae0e=_0x1af2[_0x45b4d9];return _0x54ae0e;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x21af('0x0'));var timeout=require(_0x21af('0x1'));var express=require('express');var router=express[_0x21af('0x2')]();var fs_extra=require(_0x21af('0x3'));var auth=require(_0x21af('0x4'));var interaction=require(_0x21af('0x5'));var config=require('../../config/environment');var controller=require(_0x21af('0x6'));router[_0x21af('0x7')]('/',auth[_0x21af('0x8')](),controller[_0x21af('0x9')]);router[_0x21af('0x7')](_0x21af('0xa'),auth[_0x21af('0x8')](),controller['show']);router[_0x21af('0xb')]('/',auth[_0x21af('0x8')](),controller[_0x21af('0xc')]);router[_0x21af('0xd')]('/:id',auth[_0x21af('0x8')](),controller[_0x21af('0xe')]);router[_0x21af('0xf')](_0x21af('0xa'),auth[_0x21af('0x8')](),controller['destroy']);module[_0x21af('0x10')]=router;
\ No newline at end of file
+var _0xeb12=['../../components/interaction/service','../../config/environment','./cannedAnswer.controller','get','isAuthenticated','index','/:id','create','put','update','destroy','exports','multer','util','connect-timeout','express','fs-extra','../../components/auth/service'];(function(_0x122b35,_0x140c1){var _0xc54eb4=function(_0x2a0fdf){while(--_0x2a0fdf){_0x122b35['push'](_0x122b35['shift']());}};_0xc54eb4(++_0x140c1);}(_0xeb12,0x1f2));var _0x2eb1=function(_0x565569,_0x5c0375){_0x565569=_0x565569-0x0;var _0x1ac5da=_0xeb12[_0x565569];return _0x1ac5da;};'use strict';var multer=require(_0x2eb1('0x0'));var util=require(_0x2eb1('0x1'));var path=require('path');var timeout=require(_0x2eb1('0x2'));var express=require(_0x2eb1('0x3'));var router=express['Router']();var fs_extra=require(_0x2eb1('0x4'));var auth=require(_0x2eb1('0x5'));var interaction=require(_0x2eb1('0x6'));var config=require(_0x2eb1('0x7'));var controller=require(_0x2eb1('0x8'));router[_0x2eb1('0x9')]('/',auth[_0x2eb1('0xa')](),controller[_0x2eb1('0xb')]);router[_0x2eb1('0x9')](_0x2eb1('0xc'),auth['isAuthenticated'](),controller['show']);router['post']('/',auth[_0x2eb1('0xa')](),controller[_0x2eb1('0xd')]);router[_0x2eb1('0xe')](_0x2eb1('0xc'),auth['isAuthenticated'](),controller[_0x2eb1('0xf')]);router['delete'](_0x2eb1('0xc'),auth[_0x2eb1('0xa')](),controller[_0x2eb1('0x10')]);module[_0x2eb1('0x11')]=router;
\ No newline at end of file
diff --git a/server/api/cdr/cdr.attributes.js b/server/api/cdr/cdr.attributes.js
index 048601d..60fcb46 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 _0x3657=['STRING','INTEGER','sequelize','exports','DATE'];(function(_0x3f8743,_0x33973f){var _0x1f844c=function(_0x568841){while(--_0x568841){_0x3f8743['push'](_0x3f8743['shift']());}};_0x1f844c(++_0x33973f);}(_0x3657,0x183));var _0x7365=function(_0x5397f4,_0x3f2c05){_0x5397f4=_0x5397f4-0x0;var _0x4cba07=_0x3657[_0x5397f4];return _0x4cba07;};'use strict';var Sequelize=require(_0x7365('0x0'));module[_0x7365('0x1')]={'calldate':{'type':Sequelize[_0x7365('0x2')],'allowNull':![],'defaultValue':'1970-01-01\x2000:00:01'},'clid':{'type':Sequelize[_0x7365('0x3')]},'src':{'type':Sequelize[_0x7365('0x3')]},'dst':{'type':Sequelize[_0x7365('0x3')]},'dcontext':{'type':Sequelize[_0x7365('0x3')]},'channel':{'type':Sequelize['STRING']},'dstchannel':{'type':Sequelize[_0x7365('0x3')]},'lastapp':{'type':Sequelize[_0x7365('0x3')]},'lastdata':{'type':Sequelize[_0x7365('0x3')]},'duration':{'type':Sequelize['INTEGER'],'allowNull':![],'defaultValue':0x0},'billsec':{'type':Sequelize[_0x7365('0x4')],'allowNull':![],'defaultValue':0x0},'disposition':{'type':Sequelize[_0x7365('0x3')]},'amaflags':{'type':Sequelize[_0x7365('0x4')],'allowNull':![],'defaultValue':0x0},'accountcode':{'type':Sequelize['STRING']},'userfield':{'type':Sequelize[_0x7365('0x3')]},'uniqueid':{'type':Sequelize[_0x7365('0x3')]},'linkedid':{'type':Sequelize[_0x7365('0x3')]},'sequence':{'type':Sequelize['STRING']},'peeraccount':{'type':Sequelize[_0x7365('0x3')]},'type':{'type':Sequelize[_0x7365('0x3')]},'tag':{'type':Sequelize['STRING']}};
\ No newline at end of file
+var _0xc423=['1970-01-01\x2000:00:01','STRING','INTEGER','sequelize','exports','DATE'];(function(_0x94b9d4,_0x1d58d8){var _0x4dfe17=function(_0x3f9aa4){while(--_0x3f9aa4){_0x94b9d4['push'](_0x94b9d4['shift']());}};_0x4dfe17(++_0x1d58d8);}(_0xc423,0x159));var _0x3c42=function(_0x4565bf,_0x5ad9d6){_0x4565bf=_0x4565bf-0x0;var _0x5610ba=_0xc423[_0x4565bf];return _0x5610ba;};'use strict';var Sequelize=require(_0x3c42('0x0'));module[_0x3c42('0x1')]={'calldate':{'type':Sequelize[_0x3c42('0x2')],'allowNull':![],'defaultValue':_0x3c42('0x3')},'clid':{'type':Sequelize[_0x3c42('0x4')]},'src':{'type':Sequelize['STRING']},'dst':{'type':Sequelize[_0x3c42('0x4')]},'dcontext':{'type':Sequelize[_0x3c42('0x4')]},'channel':{'type':Sequelize[_0x3c42('0x4')]},'dstchannel':{'type':Sequelize['STRING']},'lastapp':{'type':Sequelize[_0x3c42('0x4')]},'lastdata':{'type':Sequelize[_0x3c42('0x4')]},'duration':{'type':Sequelize[_0x3c42('0x5')],'allowNull':![],'defaultValue':0x0},'billsec':{'type':Sequelize[_0x3c42('0x5')],'allowNull':![],'defaultValue':0x0},'disposition':{'type':Sequelize[_0x3c42('0x4')]},'amaflags':{'type':Sequelize[_0x3c42('0x5')],'allowNull':![],'defaultValue':0x0},'accountcode':{'type':Sequelize[_0x3c42('0x4')]},'userfield':{'type':Sequelize[_0x3c42('0x4')]},'uniqueid':{'type':Sequelize['STRING']},'linkedid':{'type':Sequelize[_0x3c42('0x4')]},'sequence':{'type':Sequelize['STRING']},'peeraccount':{'type':Sequelize['STRING']},'type':{'type':Sequelize[_0x3c42('0x4')]},'tag':{'type':Sequelize[_0x3c42('0x4')]}};
\ No newline at end of file
diff --git a/server/api/cdr/cdr.controller.js b/server/api/cdr/cdr.controller.js
index 5b28a42..47e724a 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 _0x5162=['undefined','count','limit','set','Content-Range','apply','reject','save','update','then','destroy','error','name','send','index','map','Cdr','rawAttributes','fieldName','type','key','model','query','keys','filters','attributes','fields','length','hasOwnProperty','order','sort','where','pick','filter','VIRTUAL','merge','options','includeAll','include','catch','show','params','intersection','find','create','body','eml-format','moment','bluebird','mustache','util','path','sox','to-csv','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x5162,0x103));var _0x2516=function(_0x501695,_0xda9d02){_0x501695=_0x501695-0x0;var _0xca4b6c=_0x5162[_0x501695];return _0xca4b6c;};'use strict';var emlformat=require(_0x2516('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x2516('0x1'));var BPromise=require(_0x2516('0x2'));var Mustache=require(_0x2516('0x3'));var util=require(_0x2516('0x4'));var path=require(_0x2516('0x5'));var sox=require(_0x2516('0x6'));var csv=require(_0x2516('0x7'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0x2516('0x8'));var crypto=require(_0x2516('0x9'));var jsforce=require(_0x2516('0xa'));var deskjs=require(_0x2516('0xb'));var toCsv=require(_0x2516('0x7'));var querystring=require(_0x2516('0xc'));var Papa=require(_0x2516('0xd'));var Redis=require('ioredis');var authService=require(_0x2516('0xe'));var qs=require(_0x2516('0xf'));var as=require(_0x2516('0x10'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')('api');var utils=require('../../config/utils');var config=require(_0x2516('0x11'));var licenseUtil=require(_0x2516('0x12'));var db=require(_0x2516('0x13'))['db'];function respondWithStatusCode(_0x3ef6ff,_0x56c69c){_0x56c69c=_0x56c69c||0xcc;return function(_0x33496b){if(_0x33496b){return _0x3ef6ff[_0x2516('0x14')](_0x56c69c);}return _0x3ef6ff[_0x2516('0x15')](_0x56c69c)[_0x2516('0x16')]();};}function respondWithResult(_0x42c771,_0x558d20){_0x558d20=_0x558d20||0xc8;return function(_0x3e5e0f){if(_0x3e5e0f){return _0x42c771[_0x2516('0x15')](_0x558d20)[_0x2516('0x17')](_0x3e5e0f);}};}function respondWithFilteredResult(_0x181a28,_0x2637e8){return function(_0x2ec31f){if(_0x2ec31f){var _0x19aacb=typeof _0x2637e8[_0x2516('0x18')]===_0x2516('0x19')&&typeof _0x2637e8['limit']===_0x2516('0x19');var _0x1ced29=_0x2ec31f[_0x2516('0x1a')];var _0x564d05=_0x19aacb?0x0:_0x2637e8[_0x2516('0x18')];var _0x5e96c7=_0x19aacb?_0x2ec31f['count']:_0x2637e8[_0x2516('0x18')]+_0x2637e8[_0x2516('0x1b')];var _0x151168;if(_0x5e96c7>=_0x1ced29){_0x5e96c7=_0x1ced29;_0x151168=0xc8;}else{_0x151168=0xce;}_0x181a28[_0x2516('0x15')](_0x151168);return _0x181a28[_0x2516('0x1c')](_0x2516('0x1d'),_0x564d05+'-'+_0x5e96c7+'/'+_0x1ced29)[_0x2516('0x17')](_0x2ec31f);}return null;};}function patchUpdates(_0x113616){return function(_0x248c5a){try{jsonpatch[_0x2516('0x1e')](_0x248c5a,_0x113616,!![]);}catch(_0x39ba5b){return BPromise[_0x2516('0x1f')](_0x39ba5b);}return _0x248c5a[_0x2516('0x20')]();};}function saveUpdates(_0x4fb7d9,_0x559a3e){return function(_0x12db4d){if(_0x12db4d){return _0x12db4d[_0x2516('0x21')](_0x4fb7d9)[_0x2516('0x22')](function(_0x2d5b1b){return _0x2d5b1b;});}return null;};}function removeEntity(_0x3ffb6d,_0x32de7a){return function(_0x3d906d){if(_0x3d906d){return _0x3d906d[_0x2516('0x23')]()['then'](function(){_0x3ffb6d[_0x2516('0x15')](0xcc)[_0x2516('0x16')]();});}};}function handleEntityNotFound(_0x774b60,_0x434d54){return function(_0x47f4fb){if(!_0x47f4fb){_0x774b60[_0x2516('0x14')](0x194);}return _0x47f4fb;};}function handleError(_0x30eeb9,_0x1f722c){_0x1f722c=_0x1f722c||0x1f4;return function(_0x3d728a){logger[_0x2516('0x24')](_0x3d728a['stack']);if(_0x3d728a[_0x2516('0x25')]){delete _0x3d728a[_0x2516('0x25')];}_0x30eeb9[_0x2516('0x15')](_0x1f722c)[_0x2516('0x26')](_0x3d728a);};}exports[_0x2516('0x27')]=function(_0x285e67,_0x556f01){var _0x136893={},_0x20dc9f={},_0x493a3e={'count':0x0,'rows':[]};var _0x19d90d=_[_0x2516('0x28')](db[_0x2516('0x29')][_0x2516('0x2a')],function(_0x539704){return{'name':_0x539704[_0x2516('0x2b')],'type':_0x539704[_0x2516('0x2c')][_0x2516('0x2d')]};});_0x20dc9f[_0x2516('0x2e')]=_[_0x2516('0x28')](_0x19d90d,_0x2516('0x25'));_0x20dc9f[_0x2516('0x2f')]=_[_0x2516('0x30')](_0x285e67[_0x2516('0x2f')]);_0x20dc9f[_0x2516('0x31')]=_['intersection'](_0x20dc9f[_0x2516('0x2e')],_0x20dc9f['query']);_0x136893[_0x2516('0x32')]=_['intersection'](_0x20dc9f[_0x2516('0x2e')],qs['fields'](_0x285e67[_0x2516('0x2f')][_0x2516('0x33')]));_0x136893[_0x2516('0x32')]=_0x136893[_0x2516('0x32')][_0x2516('0x34')]?_0x136893[_0x2516('0x32')]:_0x20dc9f[_0x2516('0x2e')];if(!_0x285e67[_0x2516('0x2f')][_0x2516('0x35')]('nolimit')){_0x136893[_0x2516('0x1b')]=qs[_0x2516('0x1b')](_0x285e67[_0x2516('0x2f')][_0x2516('0x1b')]);_0x136893['offset']=qs['offset'](_0x285e67[_0x2516('0x2f')][_0x2516('0x18')]);}_0x136893[_0x2516('0x36')]=qs[_0x2516('0x37')](_0x285e67[_0x2516('0x2f')][_0x2516('0x37')]);_0x136893[_0x2516('0x38')]=qs[_0x2516('0x31')](_[_0x2516('0x39')](_0x285e67[_0x2516('0x2f')],_0x20dc9f['filters']),_0x19d90d);if(_0x285e67['query'][_0x2516('0x3a')]){_0x136893[_0x2516('0x38')]=_['merge'](_0x136893['where'],{'$or':_[_0x2516('0x28')](_0x19d90d,function(_0x3b310f){if(_0x3b310f['type']!==_0x2516('0x3b')){var _0x52ef6b={};_0x52ef6b[_0x3b310f[_0x2516('0x25')]]={'$like':'%'+_0x285e67[_0x2516('0x2f')]['filter']+'%'};return _0x52ef6b;}})});}_0x136893=_[_0x2516('0x3c')]({},_0x136893,_0x285e67[_0x2516('0x3d')]);var _0x155cf7={'where':_0x136893[_0x2516('0x38')]};return db[_0x2516('0x29')][_0x2516('0x1a')](_0x155cf7)[_0x2516('0x22')](function(_0x2371a8){_0x493a3e[_0x2516('0x1a')]=_0x2371a8;if(_0x285e67[_0x2516('0x2f')][_0x2516('0x3e')]){_0x136893[_0x2516('0x3f')]=[{'all':!![]}];}return db[_0x2516('0x29')]['findAll'](_0x136893);})[_0x2516('0x22')](function(_0x1bc0e){_0x493a3e['rows']=_0x1bc0e;return _0x493a3e;})[_0x2516('0x22')](respondWithFilteredResult(_0x556f01,_0x136893))[_0x2516('0x40')](handleError(_0x556f01,null));};exports[_0x2516('0x41')]=function(_0x1afefb,_0x421c58){var _0x582cb6={'raw':!![],'where':{'id':_0x1afefb[_0x2516('0x42')]['id']}},_0x1a8d2d={};_0x1a8d2d[_0x2516('0x2e')]=_[_0x2516('0x30')](db[_0x2516('0x29')][_0x2516('0x2a')]);_0x1a8d2d['query']=_[_0x2516('0x30')](_0x1afefb[_0x2516('0x2f')]);_0x1a8d2d[_0x2516('0x31')]=_[_0x2516('0x43')](_0x1a8d2d[_0x2516('0x2e')],_0x1a8d2d[_0x2516('0x2f')]);_0x582cb6[_0x2516('0x32')]=_['intersection'](_0x1a8d2d[_0x2516('0x2e')],qs['fields'](_0x1afefb[_0x2516('0x2f')]['fields']));_0x582cb6[_0x2516('0x32')]=_0x582cb6[_0x2516('0x32')][_0x2516('0x34')]?_0x582cb6['attributes']:_0x1a8d2d['model'];if(_0x1afefb[_0x2516('0x2f')][_0x2516('0x3e')]){_0x582cb6['include']=[{'all':!![]}];}_0x582cb6=_['merge']({},_0x582cb6,_0x1afefb[_0x2516('0x3d')]);return db[_0x2516('0x29')][_0x2516('0x44')](_0x582cb6)['then'](handleEntityNotFound(_0x421c58,null))[_0x2516('0x22')](respondWithResult(_0x421c58,null))['catch'](handleError(_0x421c58,null));};exports[_0x2516('0x45')]=function(_0x39fd32,_0x318128){return db[_0x2516('0x29')]['create'](_0x39fd32[_0x2516('0x46')],{})[_0x2516('0x22')](respondWithResult(_0x318128,0xc9))[_0x2516('0x40')](handleError(_0x318128,null));};exports[_0x2516('0x21')]=function(_0x43874c,_0x482883){if(_0x43874c[_0x2516('0x46')]['id']){delete _0x43874c[_0x2516('0x46')]['id'];}return db[_0x2516('0x29')][_0x2516('0x44')]({'where':{'id':_0x43874c['params']['id']}})[_0x2516('0x22')](handleEntityNotFound(_0x482883,null))[_0x2516('0x22')](saveUpdates(_0x43874c[_0x2516('0x46')],null))[_0x2516('0x22')](respondWithResult(_0x482883,null))[_0x2516('0x40')](handleError(_0x482883,null));};exports['destroy']=function(_0x1c4be3,_0x1aa854){return db[_0x2516('0x29')][_0x2516('0x44')]({'where':{'id':_0x1c4be3[_0x2516('0x42')]['id']}})[_0x2516('0x22')](handleEntityNotFound(_0x1aa854,null))['then'](removeEntity(_0x1aa854,null))['catch'](handleError(_0x1aa854,null));};exports['describe']=function(_0x323590,_0x4f7eb4){return db['Cdr']['describe']()[_0x2516('0x22')](respondWithResult(_0x4f7eb4,null))[_0x2516('0x40')](handleError(_0x4f7eb4,null));};
\ No newline at end of file
+var _0xae30=['offset','apply','reject','end','sendStatus','error','name','index','map','Cdr','rawAttributes','fieldName','type','key','model','query','keys','intersection','attributes','fields','length','nolimit','order','sort','where','filters','pick','filter','VIRTUAL','merge','options','findAll','then','rows','catch','show','params','includeAll','include','create','body','find','destroy','describe','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../config/environment','status','json','undefined','limit','count'];(function(_0x510b98,_0x4c4cbb){var _0x45e775=function(_0x29ec11){while(--_0x29ec11){_0x510b98['push'](_0x510b98['shift']());}};_0x45e775(++_0x4c4cbb);}(_0xae30,0x10a));var _0x0ae3=function(_0x239786,_0x471f27){_0x239786=_0x239786-0x0;var _0x3f15e2=_0xae30[_0x239786];return _0x3f15e2;};'use strict';var emlformat=require(_0x0ae3('0x0'));var rimraf=require(_0x0ae3('0x1'));var zipdir=require(_0x0ae3('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x0ae3('0x3'));var moment=require(_0x0ae3('0x4'));var BPromise=require(_0x0ae3('0x5'));var Mustache=require(_0x0ae3('0x6'));var util=require('util');var path=require(_0x0ae3('0x7'));var sox=require(_0x0ae3('0x8'));var csv=require(_0x0ae3('0x9'));var ejs=require(_0x0ae3('0xa'));var fs=require('fs');var fs_extra=require(_0x0ae3('0xb'));var _=require(_0x0ae3('0xc'));var squel=require(_0x0ae3('0xd'));var crypto=require(_0x0ae3('0xe'));var jsforce=require(_0x0ae3('0xf'));var deskjs=require(_0x0ae3('0x10'));var toCsv=require(_0x0ae3('0x9'));var querystring=require(_0x0ae3('0x11'));var Papa=require(_0x0ae3('0x12'));var Redis=require('ioredis');var authService=require(_0x0ae3('0x13'));var qs=require(_0x0ae3('0x14'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0x0ae3('0x15'))(_0x0ae3('0x16'));var utils=require(_0x0ae3('0x17'));var config=require(_0x0ae3('0x18'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x245ac0,_0x45242d){_0x45242d=_0x45242d||0xcc;return function(_0x50cee6){if(_0x50cee6){return _0x245ac0['sendStatus'](_0x45242d);}return _0x245ac0[_0x0ae3('0x19')](_0x45242d)['end']();};}function respondWithResult(_0x1b1e46,_0x450000){_0x450000=_0x450000||0xc8;return function(_0x1a6c69){if(_0x1a6c69){return _0x1b1e46[_0x0ae3('0x19')](_0x450000)[_0x0ae3('0x1a')](_0x1a6c69);}};}function respondWithFilteredResult(_0x1600bc,_0x28b547){return function(_0x5af348){if(_0x5af348){var _0x17f280=typeof _0x28b547['offset']===_0x0ae3('0x1b')&&typeof _0x28b547[_0x0ae3('0x1c')]===_0x0ae3('0x1b');var _0x59d0de=_0x5af348[_0x0ae3('0x1d')];var _0x40edc6=_0x17f280?0x0:_0x28b547[_0x0ae3('0x1e')];var _0x1bf406=_0x17f280?_0x5af348[_0x0ae3('0x1d')]:_0x28b547['offset']+_0x28b547[_0x0ae3('0x1c')];var _0x4b8949;if(_0x1bf406>=_0x59d0de){_0x1bf406=_0x59d0de;_0x4b8949=0xc8;}else{_0x4b8949=0xce;}_0x1600bc['status'](_0x4b8949);return _0x1600bc['set']('Content-Range',_0x40edc6+'-'+_0x1bf406+'/'+_0x59d0de)['json'](_0x5af348);}return null;};}function patchUpdates(_0x4e8135){return function(_0x4d1385){try{jsonpatch[_0x0ae3('0x1f')](_0x4d1385,_0x4e8135,!![]);}catch(_0x1fd946){return BPromise[_0x0ae3('0x20')](_0x1fd946);}return _0x4d1385['save']();};}function saveUpdates(_0x1cdd85,_0x5ecc45){return function(_0xfcf4a8){if(_0xfcf4a8){return _0xfcf4a8['update'](_0x1cdd85)['then'](function(_0x5ab18d){return _0x5ab18d;});}return null;};}function removeEntity(_0x281adf,_0x3b49a0){return function(_0x51e7d1){if(_0x51e7d1){return _0x51e7d1['destroy']()['then'](function(){_0x281adf[_0x0ae3('0x19')](0xcc)[_0x0ae3('0x21')]();});}};}function handleEntityNotFound(_0x5a76e5,_0x36ce4e){return function(_0x1613c3){if(!_0x1613c3){_0x5a76e5[_0x0ae3('0x22')](0x194);}return _0x1613c3;};}function handleError(_0x5b0117,_0x2f8134){_0x2f8134=_0x2f8134||0x1f4;return function(_0x1f9cde){logger[_0x0ae3('0x23')](_0x1f9cde['stack']);if(_0x1f9cde[_0x0ae3('0x24')]){delete _0x1f9cde[_0x0ae3('0x24')];}_0x5b0117[_0x0ae3('0x19')](_0x2f8134)['send'](_0x1f9cde);};}exports[_0x0ae3('0x25')]=function(_0x247623,_0xf0e310){var _0x152876={},_0x1f8f61={},_0x10a7bd={'count':0x0,'rows':[]};var _0x5e8979=_[_0x0ae3('0x26')](db[_0x0ae3('0x27')][_0x0ae3('0x28')],function(_0x4032f4){return{'name':_0x4032f4[_0x0ae3('0x29')],'type':_0x4032f4[_0x0ae3('0x2a')][_0x0ae3('0x2b')]};});_0x1f8f61[_0x0ae3('0x2c')]=_['map'](_0x5e8979,_0x0ae3('0x24'));_0x1f8f61[_0x0ae3('0x2d')]=_[_0x0ae3('0x2e')](_0x247623[_0x0ae3('0x2d')]);_0x1f8f61['filters']=_[_0x0ae3('0x2f')](_0x1f8f61[_0x0ae3('0x2c')],_0x1f8f61[_0x0ae3('0x2d')]);_0x152876[_0x0ae3('0x30')]=_[_0x0ae3('0x2f')](_0x1f8f61[_0x0ae3('0x2c')],qs['fields'](_0x247623[_0x0ae3('0x2d')][_0x0ae3('0x31')]));_0x152876[_0x0ae3('0x30')]=_0x152876[_0x0ae3('0x30')][_0x0ae3('0x32')]?_0x152876[_0x0ae3('0x30')]:_0x1f8f61[_0x0ae3('0x2c')];if(!_0x247623['query']['hasOwnProperty'](_0x0ae3('0x33'))){_0x152876[_0x0ae3('0x1c')]=qs[_0x0ae3('0x1c')](_0x247623['query']['limit']);_0x152876[_0x0ae3('0x1e')]=qs[_0x0ae3('0x1e')](_0x247623[_0x0ae3('0x2d')][_0x0ae3('0x1e')]);}_0x152876[_0x0ae3('0x34')]=qs[_0x0ae3('0x35')](_0x247623[_0x0ae3('0x2d')]['sort']);_0x152876[_0x0ae3('0x36')]=qs[_0x0ae3('0x37')](_[_0x0ae3('0x38')](_0x247623['query'],_0x1f8f61['filters']),_0x5e8979);if(_0x247623['query'][_0x0ae3('0x39')]){_0x152876[_0x0ae3('0x36')]=_['merge'](_0x152876[_0x0ae3('0x36')],{'$or':_[_0x0ae3('0x26')](_0x5e8979,function(_0x3ee862){if(_0x3ee862['type']!==_0x0ae3('0x3a')){var _0x5dd8d7={};_0x5dd8d7[_0x3ee862[_0x0ae3('0x24')]]={'$like':'%'+_0x247623[_0x0ae3('0x2d')]['filter']+'%'};return _0x5dd8d7;}})});}_0x152876=_[_0x0ae3('0x3b')]({},_0x152876,_0x247623[_0x0ae3('0x3c')]);var _0xfa6c7f={'where':_0x152876[_0x0ae3('0x36')]};return db[_0x0ae3('0x27')]['count'](_0xfa6c7f)['then'](function(_0x2e95e5){_0x10a7bd[_0x0ae3('0x1d')]=_0x2e95e5;if(_0x247623['query']['includeAll']){_0x152876['include']=[{'all':!![]}];}return db['Cdr'][_0x0ae3('0x3d')](_0x152876);})[_0x0ae3('0x3e')](function(_0x325153){_0x10a7bd[_0x0ae3('0x3f')]=_0x325153;return _0x10a7bd;})[_0x0ae3('0x3e')](respondWithFilteredResult(_0xf0e310,_0x152876))[_0x0ae3('0x40')](handleError(_0xf0e310,null));};exports[_0x0ae3('0x41')]=function(_0x3166af,_0x2cfc16){var _0x1230c9={'raw':!![],'where':{'id':_0x3166af[_0x0ae3('0x42')]['id']}},_0x5a0e74={};_0x5a0e74[_0x0ae3('0x2c')]=_['keys'](db[_0x0ae3('0x27')][_0x0ae3('0x28')]);_0x5a0e74[_0x0ae3('0x2d')]=_[_0x0ae3('0x2e')](_0x3166af[_0x0ae3('0x2d')]);_0x5a0e74['filters']=_[_0x0ae3('0x2f')](_0x5a0e74[_0x0ae3('0x2c')],_0x5a0e74[_0x0ae3('0x2d')]);_0x1230c9[_0x0ae3('0x30')]=_['intersection'](_0x5a0e74[_0x0ae3('0x2c')],qs[_0x0ae3('0x31')](_0x3166af['query'][_0x0ae3('0x31')]));_0x1230c9[_0x0ae3('0x30')]=_0x1230c9['attributes']['length']?_0x1230c9[_0x0ae3('0x30')]:_0x5a0e74[_0x0ae3('0x2c')];if(_0x3166af[_0x0ae3('0x2d')][_0x0ae3('0x43')]){_0x1230c9[_0x0ae3('0x44')]=[{'all':!![]}];}_0x1230c9=_['merge']({},_0x1230c9,_0x3166af['options']);return db[_0x0ae3('0x27')]['find'](_0x1230c9)[_0x0ae3('0x3e')](handleEntityNotFound(_0x2cfc16,null))[_0x0ae3('0x3e')](respondWithResult(_0x2cfc16,null))['catch'](handleError(_0x2cfc16,null));};exports[_0x0ae3('0x45')]=function(_0x3e4bfb,_0x53e018){return db[_0x0ae3('0x27')][_0x0ae3('0x45')](_0x3e4bfb[_0x0ae3('0x46')],{})[_0x0ae3('0x3e')](respondWithResult(_0x53e018,0xc9))[_0x0ae3('0x40')](handleError(_0x53e018,null));};exports['update']=function(_0x3ad6b3,_0x53393b){if(_0x3ad6b3[_0x0ae3('0x46')]['id']){delete _0x3ad6b3[_0x0ae3('0x46')]['id'];}return db[_0x0ae3('0x27')][_0x0ae3('0x47')]({'where':{'id':_0x3ad6b3[_0x0ae3('0x42')]['id']}})[_0x0ae3('0x3e')](handleEntityNotFound(_0x53393b,null))[_0x0ae3('0x3e')](saveUpdates(_0x3ad6b3[_0x0ae3('0x46')],null))['then'](respondWithResult(_0x53393b,null))[_0x0ae3('0x40')](handleError(_0x53393b,null));};exports[_0x0ae3('0x48')]=function(_0x29479f,_0x12ea03){return db[_0x0ae3('0x27')][_0x0ae3('0x47')]({'where':{'id':_0x29479f[_0x0ae3('0x42')]['id']}})[_0x0ae3('0x3e')](handleEntityNotFound(_0x12ea03,null))[_0x0ae3('0x3e')](removeEntity(_0x12ea03,null))[_0x0ae3('0x40')](handleError(_0x12ea03,null));};exports[_0x0ae3('0x49')]=function(_0x572166,_0x256dc5){return db['Cdr'][_0x0ae3('0x49')]()[_0x0ae3('0x3e')](respondWithResult(_0x256dc5,null))[_0x0ae3('0x40')](handleError(_0x256dc5,null));};
\ No newline at end of file
diff --git a/server/api/cdr/cdr.model.js b/server/api/cdr/cdr.model.js
index 665b58b..283d202 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(_0x16dd42,_0x39ba8a){var _0x9a6b31=function(_0x25ebc1){while(--_0x25ebc1){_0x16dd42['push'](_0x16dd42['shift']());}};_0x9a6b31(++_0x39ba8a);}(_0x9957,0x93));var _0x7995=function(_0x3b380d,_0x4bf247){_0x3b380d=_0x3b380d-0x0;var _0x54502b=_0x9957[_0x3b380d];return _0x54502b;};'use strict';var _=require(_0x7995('0x0'));var util=require(_0x7995('0x1'));var logger=require(_0x7995('0x2'))(_0x7995('0x3'));var moment=require('moment');var BPromise=require(_0x7995('0x4'));var rp=require(_0x7995('0x5'));var fs=require('fs');var path=require(_0x7995('0x6'));var rimraf=require(_0x7995('0x7'));var config=require('../../config/environment');var attributes=require(_0x7995('0x8'));module[_0x7995('0x9')]=function(_0x137b6b,_0x219534){return _0x137b6b[_0x7995('0xa')](_0x7995('0xb'),attributes,{'tableName':'cdr','paranoid':![],'indexes':[{'name':_0x7995('0xc'),'fields':[_0x7995('0xc')]},{'name':'calldate','fields':[_0x7995('0xd')]},{'name':_0x7995('0xe'),'fields':[_0x7995('0xe')]},{'name':_0x7995('0xf'),'fields':[_0x7995('0xf')]},{'name':_0x7995('0x10'),'fields':[_0x7995('0x10')]},{'name':'uniqueid','fields':[_0x7995('0x11')]}],'timestamps':![]});};
\ No newline at end of file
+var _0x7a54=['Cdr','cdr','accountcode','disposition','dst','src','uniqueid','lodash','util','../../config/logger','moment','bluebird','path','rimraf','../../config/environment','./cdr.attributes','exports'];(function(_0x3b59c4,_0x3e1816){var _0x497ad2=function(_0x3288f8){while(--_0x3288f8){_0x3b59c4['push'](_0x3b59c4['shift']());}};_0x497ad2(++_0x3e1816);}(_0x7a54,0x106));var _0x47a5=function(_0x323229,_0xff09){_0x323229=_0x323229-0x0;var _0x488de3=_0x7a54[_0x323229];return _0x488de3;};'use strict';var _=require(_0x47a5('0x0'));var util=require(_0x47a5('0x1'));var logger=require(_0x47a5('0x2'))('api');var moment=require(_0x47a5('0x3'));var BPromise=require(_0x47a5('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x47a5('0x5'));var rimraf=require(_0x47a5('0x6'));var config=require(_0x47a5('0x7'));var attributes=require(_0x47a5('0x8'));module[_0x47a5('0x9')]=function(_0x545a97,_0x3d5629){return _0x545a97['define'](_0x47a5('0xa'),attributes,{'tableName':_0x47a5('0xb'),'paranoid':![],'indexes':[{'name':'accountcode','fields':[_0x47a5('0xc')]},{'name':'calldate','fields':['calldate']},{'name':'disposition','fields':[_0x47a5('0xd')]},{'name':_0x47a5('0xe'),'fields':['dst']},{'name':_0x47a5('0xf'),'fields':['src']},{'name':'uniqueid','fields':[_0x47a5('0x10')]}],'timestamps':![]});};
\ No newline at end of file
diff --git a/server/api/cdr/cdr.rpc.js b/server/api/cdr/cdr.rpc.js
index 48eeef5..512889d 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 _0x1bd5=['../../config/environment','jayson/promise','client','http','request','then','info','request\x20sent','debug','stringify','error','code','Cdr,\x20%s,\x20%s','message','result','catch','util','moment','bluebird','randomstring','../../mysqldb','rpc'];(function(_0x20a86a,_0x41e382){var _0x16354e=function(_0x5e32b8){while(--_0x5e32b8){_0x20a86a['push'](_0x20a86a['shift']());}};_0x16354e(++_0x41e382);}(_0x1bd5,0x7e));var _0x51bd=function(_0x2dafbe,_0x5d04de){_0x2dafbe=_0x2dafbe-0x0;var _0x58a45a=_0x1bd5[_0x2dafbe];return _0x58a45a;};'use strict';var _=require('lodash');var util=require(_0x51bd('0x0'));var moment=require(_0x51bd('0x1'));var BPromise=require(_0x51bd('0x2'));var rs=require(_0x51bd('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x51bd('0x4'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x51bd('0x5'));var config=require(_0x51bd('0x6'));var jayson=require(_0x51bd('0x7'));var client=jayson[_0x51bd('0x8')][_0x51bd('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x543b3d,_0x34af3e,_0x57a6e1){return new BPromise(function(_0x5e372f,_0x356700){return client[_0x51bd('0xa')](_0x543b3d,_0x57a6e1)[_0x51bd('0xb')](function(_0x57279e){logger[_0x51bd('0xc')]('Cdr,\x20%s,\x20%s',_0x34af3e,_0x51bd('0xd'));logger[_0x51bd('0xe')]('Cdr,\x20%s,\x20%s,\x20%s',_0x34af3e,'request\x20sent',JSON[_0x51bd('0xf')](_0x57279e));if(_0x57279e['error']){if(_0x57279e[_0x51bd('0x10')][_0x51bd('0x11')]===0x1f4){logger[_0x51bd('0x10')](_0x51bd('0x12'),_0x34af3e,_0x57279e[_0x51bd('0x10')][_0x51bd('0x13')]);return _0x356700(_0x57279e[_0x51bd('0x10')][_0x51bd('0x13')]);}logger[_0x51bd('0x10')](_0x51bd('0x12'),_0x34af3e,_0x57279e[_0x51bd('0x10')][_0x51bd('0x13')]);return _0x5e372f(_0x57279e[_0x51bd('0x10')][_0x51bd('0x13')]);}else{logger[_0x51bd('0xc')](_0x51bd('0x12'),_0x34af3e,_0x51bd('0xd'));_0x5e372f(_0x57279e[_0x51bd('0x14')][_0x51bd('0x13')]);}})[_0x51bd('0x15')](function(_0x1aaee4){logger[_0x51bd('0x10')](_0x51bd('0x12'),_0x34af3e,_0x1aaee4);_0x356700(_0x1aaee4);});});}
\ No newline at end of file
+var _0x77b7=['stringify','error','message','request\x20sent','result','catch','lodash','util','randomstring','ioredis','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','request','then','info','Cdr,\x20%s,\x20%s','Cdr,\x20%s,\x20%s,\x20%s'];(function(_0x263a74,_0xc31414){var _0x2aa86c=function(_0x382896){while(--_0x382896){_0x263a74['push'](_0x263a74['shift']());}};_0x2aa86c(++_0xc31414);}(_0x77b7,0x180));var _0x777b=function(_0x5b644e,_0x2e5e07){_0x5b644e=_0x5b644e-0x0;var _0x49c6bf=_0x77b7[_0x5b644e];return _0x49c6bf;};'use strict';var _=require(_0x777b('0x0'));var util=require(_0x777b('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x777b('0x2'));var fs=require('fs');var Redis=require(_0x777b('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x777b('0x4'));var logger=require(_0x777b('0x5'))(_0x777b('0x6'));var config=require('../../config/environment');var jayson=require(_0x777b('0x7'));var client=jayson[_0x777b('0x8')][_0x777b('0x9')]({'port':0x232a});function respondWithRpcPromise(_0xe2ff9c,_0x549de1,_0x649df0){return new BPromise(function(_0x5595ff,_0x2f4c0f){return client[_0x777b('0xa')](_0xe2ff9c,_0x649df0)[_0x777b('0xb')](function(_0x5f3567){logger[_0x777b('0xc')](_0x777b('0xd'),_0x549de1,'request\x20sent');logger['debug'](_0x777b('0xe'),_0x549de1,'request\x20sent',JSON[_0x777b('0xf')](_0x5f3567));if(_0x5f3567[_0x777b('0x10')]){if(_0x5f3567['error']['code']===0x1f4){logger[_0x777b('0x10')](_0x777b('0xd'),_0x549de1,_0x5f3567[_0x777b('0x10')]['message']);return _0x2f4c0f(_0x5f3567[_0x777b('0x10')][_0x777b('0x11')]);}logger[_0x777b('0x10')]('Cdr,\x20%s,\x20%s',_0x549de1,_0x5f3567[_0x777b('0x10')][_0x777b('0x11')]);return _0x5595ff(_0x5f3567[_0x777b('0x10')][_0x777b('0x11')]);}else{logger[_0x777b('0xc')](_0x777b('0xd'),_0x549de1,_0x777b('0x12'));_0x5595ff(_0x5f3567[_0x777b('0x13')][_0x777b('0x11')]);}})[_0x777b('0x14')](function(_0x3e4a02){logger[_0x777b('0x10')](_0x777b('0xd'),_0x549de1,_0x3e4a02);_0x2f4c0f(_0x3e4a02);});});}
\ No newline at end of file
diff --git a/server/api/cdr/index.js b/server/api/cdr/index.js
index 910dc27..67cde74 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 _0xb10b=['../../components/interaction/service','../../config/environment','./cdr.controller','get','index','isAuthenticated','describe','/:id','show','post','update','destroy','exports','multer','path','connect-timeout','express','fs-extra','../../components/auth/service'];(function(_0x2a1892,_0x3ccd75){var _0x22e545=function(_0x1b5b78){while(--_0x1b5b78){_0x2a1892['push'](_0x2a1892['shift']());}};_0x22e545(++_0x3ccd75);}(_0xb10b,0x12a));var _0xbb10=function(_0x2b6124,_0x4d25f2){_0x2b6124=_0x2b6124-0x0;var _0x44c3f4=_0xb10b[_0x2b6124];return _0x44c3f4;};'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')]('/describe',auth[_0xbb10('0xb')](),controller[_0xbb10('0xc')]);router[_0xbb10('0x9')](_0xbb10('0xd'),auth[_0xbb10('0xb')](),controller[_0xbb10('0xe')]);router[_0xbb10('0xf')]('/',auth[_0xbb10('0xb')](),controller['create']);router['put'](_0xbb10('0xd'),auth[_0xbb10('0xb')](),controller[_0xbb10('0x10')]);router['delete'](_0xbb10('0xd'),auth['isAuthenticated'](),controller[_0xbb10('0x11')]);module[_0xbb10('0x12')]=router;
\ No newline at end of file
+var _0xa9e0=['isAuthenticated','create','put','/:id','destroy','exports','multer','util','path','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./cdr.controller','get','index','/describe','show','post'];(function(_0x39e283,_0x247e6b){var _0x7de89f=function(_0x2f8c50){while(--_0x2f8c50){_0x39e283['push'](_0x39e283['shift']());}};_0x7de89f(++_0x247e6b);}(_0xa9e0,0x123));var _0x0a9e=function(_0x1c546c,_0x5c57cb){_0x1c546c=_0x1c546c-0x0;var _0x2cc384=_0xa9e0[_0x1c546c];return _0x2cc384;};'use strict';var multer=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var path=require(_0x0a9e('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0a9e('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x0a9e('0x4'));var interaction=require(_0x0a9e('0x5'));var config=require(_0x0a9e('0x6'));var controller=require(_0x0a9e('0x7'));router[_0x0a9e('0x8')]('/',auth['isAuthenticated'](),controller[_0x0a9e('0x9')]);router[_0x0a9e('0x8')](_0x0a9e('0xa'),auth['isAuthenticated'](),controller['describe']);router[_0x0a9e('0x8')]('/:id',auth['isAuthenticated'](),controller[_0x0a9e('0xb')]);router[_0x0a9e('0xc')]('/',auth[_0x0a9e('0xd')](),controller[_0x0a9e('0xe')]);router[_0x0a9e('0xf')](_0x0a9e('0x10'),auth['isAuthenticated'](),controller['update']);router['delete']('/:id',auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x11')]);module[_0x0a9e('0x12')]=router;
\ No newline at end of file
diff --git a/server/api/chatApplication/chatApplication.attributes.js b/server/api/chatApplication/chatApplication.attributes.js
index 45d48d9..fde4ae1 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 _0x6202=['INTEGER','noop','TEXT','STRING','*,*,*,*'];(function(_0x4b7b9b,_0xa4aff9){var _0x3be710=function(_0x5b64fa){while(--_0x5b64fa){_0x4b7b9b['push'](_0x4b7b9b['shift']());}};_0x3be710(++_0xa4aff9);}(_0x6202,0x1bd));var _0x2620=function(_0x131585,_0x1abd33){_0x131585=_0x131585-0x0;var _0x1fcca2=_0x6202[_0x131585];return _0x1fcca2;};'use strict';var Sequelize=require('sequelize');module['exports']={'priority':{'type':Sequelize[_0x2620('0x0')],'allowNull':![]},'app':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0x2620('0x1')},'appdata':{'type':Sequelize[_0x2620('0x2')]()},'description':{'type':Sequelize['STRING']},'interval':{'type':Sequelize[_0x2620('0x3')],'defaultValue':_0x2620('0x4')}};
\ No newline at end of file
+var _0x251e=['sequelize','exports','INTEGER','noop','*,*,*,*'];(function(_0x1c86cf,_0xd758df){var _0x22c104=function(_0x330796){while(--_0x330796){_0x1c86cf['push'](_0x1c86cf['shift']());}};_0x22c104(++_0xd758df);}(_0x251e,0x195));var _0xe251=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x251e[_0x3dd15e];return _0x231fd0;};'use strict';var Sequelize=require(_0xe251('0x0'));module[_0xe251('0x1')]={'priority':{'type':Sequelize[_0xe251('0x2')],'allowNull':![]},'app':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0xe251('0x3')},'appdata':{'type':Sequelize['TEXT']()},'description':{'type':Sequelize['STRING']},'interval':{'type':Sequelize['STRING'],'defaultValue':_0xe251('0x4')}};
\ No newline at end of file
diff --git a/server/api/chatApplication/chatApplication.controller.js b/server/api/chatApplication/chatApplication.controller.js
index 74f7ef2..fb2489a 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 _0x3c2c=['params','model','ChatApplication','rawAttributes','query','keys','filters','intersection','fields','length','includeAll','options','find','then','catch','body','eml-format','rimraf','zip-dir','fast-json-patch','bluebird','mustache','util','path','to-csv','ejs','fs-extra','lodash','squel','querystring','ioredis','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','json','offset','undefined','limit','count','set','Content-Range','reject','save','update','destroy','end','sendStatus','stack','name','send','show'];(function(_0x3cb41d,_0x2d7f6d){var _0x4dc372=function(_0x2e7351){while(--_0x2e7351){_0x3cb41d['push'](_0x3cb41d['shift']());}};_0x4dc372(++_0x2d7f6d);}(_0x3c2c,0x160));var _0xc3c2=function(_0x36184e,_0x53281e){_0x36184e=_0x36184e-0x0;var _0xd317ab=_0x3c2c[_0x36184e];return _0xd317ab;};'use strict';var emlformat=require(_0xc3c2('0x0'));var rimraf=require(_0xc3c2('0x1'));var zipdir=require(_0xc3c2('0x2'));var jsonpatch=require(_0xc3c2('0x3'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0xc3c2('0x4'));var Mustache=require(_0xc3c2('0x5'));var util=require(_0xc3c2('0x6'));var path=require(_0xc3c2('0x7'));var sox=require('sox');var csv=require(_0xc3c2('0x8'));var ejs=require(_0xc3c2('0x9'));var fs=require('fs');var fs_extra=require(_0xc3c2('0xa'));var _=require(_0xc3c2('0xb'));var squel=require(_0xc3c2('0xc'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0xc3c2('0x8'));var querystring=require(_0xc3c2('0xd'));var Papa=require('papaparse');var Redis=require(_0xc3c2('0xe'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0xc3c2('0xf'));var hardwareService=require(_0xc3c2('0x10'));var logger=require(_0xc3c2('0x11'))('api');var utils=require(_0xc3c2('0x12'));var config=require(_0xc3c2('0x13'));var licenseUtil=require(_0xc3c2('0x14'));var db=require(_0xc3c2('0x15'))['db'];function respondWithStatusCode(_0x578ac4,_0x3920e7){_0x3920e7=_0x3920e7||0xcc;return function(_0x1befad){if(_0x1befad){return _0x578ac4['sendStatus'](_0x3920e7);}return _0x578ac4[_0xc3c2('0x16')](_0x3920e7)['end']();};}function respondWithResult(_0x25b091,_0x4d7d11){_0x4d7d11=_0x4d7d11||0xc8;return function(_0x154071){if(_0x154071){return _0x25b091['status'](_0x4d7d11)[_0xc3c2('0x17')](_0x154071);}};}function respondWithFilteredResult(_0xf5d9a,_0x56bc61){return function(_0x1c2987){if(_0x1c2987){var _0x36f10f=typeof _0x56bc61[_0xc3c2('0x18')]===_0xc3c2('0x19')&&typeof _0x56bc61[_0xc3c2('0x1a')]===_0xc3c2('0x19');var _0x57b7b3=_0x1c2987['count'];var _0x4c0f2d=_0x36f10f?0x0:_0x56bc61[_0xc3c2('0x18')];var _0x3e26e1=_0x36f10f?_0x1c2987[_0xc3c2('0x1b')]:_0x56bc61[_0xc3c2('0x18')]+_0x56bc61[_0xc3c2('0x1a')];var _0x5c9d2c;if(_0x3e26e1>=_0x57b7b3){_0x3e26e1=_0x57b7b3;_0x5c9d2c=0xc8;}else{_0x5c9d2c=0xce;}_0xf5d9a['status'](_0x5c9d2c);return _0xf5d9a[_0xc3c2('0x1c')](_0xc3c2('0x1d'),_0x4c0f2d+'-'+_0x3e26e1+'/'+_0x57b7b3)[_0xc3c2('0x17')](_0x1c2987);}return null;};}function patchUpdates(_0x5e925e){return function(_0x42feba){try{jsonpatch['apply'](_0x42feba,_0x5e925e,!![]);}catch(_0x2e9c78){return BPromise[_0xc3c2('0x1e')](_0x2e9c78);}return _0x42feba[_0xc3c2('0x1f')]();};}function saveUpdates(_0x57458a,_0x2ca609){return function(_0x340c75){if(_0x340c75){return _0x340c75[_0xc3c2('0x20')](_0x57458a)['then'](function(_0x3db978){return _0x3db978;});}return null;};}function removeEntity(_0x3287a3,_0x6ad7af){return function(_0x5d7789){if(_0x5d7789){return _0x5d7789[_0xc3c2('0x21')]()['then'](function(){_0x3287a3[_0xc3c2('0x16')](0xcc)[_0xc3c2('0x22')]();});}};}function handleEntityNotFound(_0x26aacc,_0x38d0b9){return function(_0x15f5f9){if(!_0x15f5f9){_0x26aacc[_0xc3c2('0x23')](0x194);}return _0x15f5f9;};}function handleError(_0x978056,_0x4b6504){_0x4b6504=_0x4b6504||0x1f4;return function(_0x48fa15){logger['error'](_0x48fa15[_0xc3c2('0x24')]);if(_0x48fa15[_0xc3c2('0x25')]){delete _0x48fa15[_0xc3c2('0x25')];}_0x978056['status'](_0x4b6504)[_0xc3c2('0x26')](_0x48fa15);};}exports[_0xc3c2('0x27')]=function(_0x2dc9ec,_0x2bc3b7){var _0x7686ac={'raw':!![],'where':{'id':_0x2dc9ec[_0xc3c2('0x28')]['id']}},_0x166f8e={};_0x166f8e[_0xc3c2('0x29')]=_['keys'](db[_0xc3c2('0x2a')][_0xc3c2('0x2b')]);_0x166f8e[_0xc3c2('0x2c')]=_[_0xc3c2('0x2d')](_0x2dc9ec[_0xc3c2('0x2c')]);_0x166f8e[_0xc3c2('0x2e')]=_['intersection'](_0x166f8e['model'],_0x166f8e[_0xc3c2('0x2c')]);_0x7686ac['attributes']=_[_0xc3c2('0x2f')](_0x166f8e[_0xc3c2('0x29')],qs[_0xc3c2('0x30')](_0x2dc9ec['query']['fields']));_0x7686ac['attributes']=_0x7686ac['attributes'][_0xc3c2('0x31')]?_0x7686ac['attributes']:_0x166f8e[_0xc3c2('0x29')];if(_0x2dc9ec['query'][_0xc3c2('0x32')]){_0x7686ac['include']=[{'all':!![]}];}_0x7686ac=_['merge']({},_0x7686ac,_0x2dc9ec[_0xc3c2('0x33')]);return db[_0xc3c2('0x2a')][_0xc3c2('0x34')](_0x7686ac)[_0xc3c2('0x35')](handleEntityNotFound(_0x2bc3b7,null))[_0xc3c2('0x35')](respondWithResult(_0x2bc3b7,null))[_0xc3c2('0x36')](handleError(_0x2bc3b7,null));};exports[_0xc3c2('0x20')]=function(_0x434430,_0x3ee2ee){if(_0x434430['body']['id']){delete _0x434430['body']['id'];}return db[_0xc3c2('0x2a')][_0xc3c2('0x34')]({'where':{'id':_0x434430[_0xc3c2('0x28')]['id']}})[_0xc3c2('0x35')](handleEntityNotFound(_0x3ee2ee,null))[_0xc3c2('0x35')](saveUpdates(_0x434430[_0xc3c2('0x37')],null))['then'](respondWithResult(_0x3ee2ee,null))[_0xc3c2('0x36')](handleError(_0x3ee2ee,null));};exports['destroy']=function(_0x2278fa,_0x227dfb){return db['ChatApplication'][_0xc3c2('0x34')]({'where':{'id':_0x2278fa[_0xc3c2('0x28')]['id']}})['then'](handleEntityNotFound(_0x227dfb,null))[_0xc3c2('0x35')](removeEntity(_0x227dfb,null))[_0xc3c2('0x36')](handleError(_0x227dfb,null));};
\ No newline at end of file
+var _0xc041=['../../config/license/util','sendStatus','status','end','offset','limit','undefined','count','set','Content-Range','json','apply','reject','save','update','destroy','then','error','stack','show','params','model','query','filters','intersection','attributes','length','includeAll','include','merge','ChatApplication','find','body','catch','eml-format','rimraf','fast-json-patch','moment','bluebird','mustache','util','path','sox','ejs','squel','crypto','jsforce','desk.js','to-csv','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xc041,0x1ea));var _0x1c04=function(_0xaf33a2,_0x3038e1){_0xaf33a2=_0xaf33a2-0x0;var _0x37d5a3=_0xc041[_0xaf33a2];return _0x37d5a3;};'use strict';var emlformat=require(_0x1c04('0x0'));var rimraf=require(_0x1c04('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x1c04('0x2'));var rp=require('request-promise');var moment=require(_0x1c04('0x3'));var BPromise=require(_0x1c04('0x4'));var Mustache=require(_0x1c04('0x5'));var util=require(_0x1c04('0x6'));var path=require(_0x1c04('0x7'));var sox=require(_0x1c04('0x8'));var csv=require('to-csv');var ejs=require(_0x1c04('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0x1c04('0xa'));var crypto=require(_0x1c04('0xb'));var jsforce=require(_0x1c04('0xc'));var deskjs=require(_0x1c04('0xd'));var toCsv=require(_0x1c04('0xe'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x1c04('0xf'));var authService=require(_0x1c04('0x10'));var qs=require(_0x1c04('0x11'));var as=require(_0x1c04('0x12'));var hardwareService=require(_0x1c04('0x13'));var logger=require(_0x1c04('0x14'))(_0x1c04('0x15'));var utils=require(_0x1c04('0x16'));var config=require('../../config/environment');var licenseUtil=require(_0x1c04('0x17'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x178900,_0x167bd5){_0x167bd5=_0x167bd5||0xcc;return function(_0x48e69f){if(_0x48e69f){return _0x178900[_0x1c04('0x18')](_0x167bd5);}return _0x178900[_0x1c04('0x19')](_0x167bd5)[_0x1c04('0x1a')]();};}function respondWithResult(_0x199782,_0x3c7bb3){_0x3c7bb3=_0x3c7bb3||0xc8;return function(_0x30b019){if(_0x30b019){return _0x199782[_0x1c04('0x19')](_0x3c7bb3)['json'](_0x30b019);}};}function respondWithFilteredResult(_0x28d516,_0x2dbf09){return function(_0x408e4c){if(_0x408e4c){var _0x5a0ff4=typeof _0x2dbf09[_0x1c04('0x1b')]==='undefined'&&typeof _0x2dbf09[_0x1c04('0x1c')]===_0x1c04('0x1d');var _0x2ed73c=_0x408e4c[_0x1c04('0x1e')];var _0x2b3a8b=_0x5a0ff4?0x0:_0x2dbf09[_0x1c04('0x1b')];var _0x3e2bd9=_0x5a0ff4?_0x408e4c[_0x1c04('0x1e')]:_0x2dbf09['offset']+_0x2dbf09['limit'];var _0x51dad0;if(_0x3e2bd9>=_0x2ed73c){_0x3e2bd9=_0x2ed73c;_0x51dad0=0xc8;}else{_0x51dad0=0xce;}_0x28d516[_0x1c04('0x19')](_0x51dad0);return _0x28d516[_0x1c04('0x1f')](_0x1c04('0x20'),_0x2b3a8b+'-'+_0x3e2bd9+'/'+_0x2ed73c)[_0x1c04('0x21')](_0x408e4c);}return null;};}function patchUpdates(_0x1724a4){return function(_0x21c320){try{jsonpatch[_0x1c04('0x22')](_0x21c320,_0x1724a4,!![]);}catch(_0xf9255d){return BPromise[_0x1c04('0x23')](_0xf9255d);}return _0x21c320[_0x1c04('0x24')]();};}function saveUpdates(_0x290375,_0x460dd1){return function(_0x22a4cc){if(_0x22a4cc){return _0x22a4cc[_0x1c04('0x25')](_0x290375)['then'](function(_0x2ee6b2){return _0x2ee6b2;});}return null;};}function removeEntity(_0x5bb5bc,_0x247116){return function(_0x3c81b0){if(_0x3c81b0){return _0x3c81b0[_0x1c04('0x26')]()[_0x1c04('0x27')](function(){_0x5bb5bc[_0x1c04('0x19')](0xcc)['end']();});}};}function handleEntityNotFound(_0x5101e2,_0x29293c){return function(_0x2c9f84){if(!_0x2c9f84){_0x5101e2[_0x1c04('0x18')](0x194);}return _0x2c9f84;};}function handleError(_0x43c4a8,_0x252fbe){_0x252fbe=_0x252fbe||0x1f4;return function(_0x1e2daa){logger[_0x1c04('0x28')](_0x1e2daa[_0x1c04('0x29')]);if(_0x1e2daa['name']){delete _0x1e2daa['name'];}_0x43c4a8[_0x1c04('0x19')](_0x252fbe)['send'](_0x1e2daa);};}exports[_0x1c04('0x2a')]=function(_0x228e4,_0x29d273){var _0x220cdc={'raw':!![],'where':{'id':_0x228e4[_0x1c04('0x2b')]['id']}},_0x3bf4fd={};_0x3bf4fd[_0x1c04('0x2c')]=_['keys'](db['ChatApplication']['rawAttributes']);_0x3bf4fd[_0x1c04('0x2d')]=_['keys'](_0x228e4[_0x1c04('0x2d')]);_0x3bf4fd[_0x1c04('0x2e')]=_[_0x1c04('0x2f')](_0x3bf4fd[_0x1c04('0x2c')],_0x3bf4fd[_0x1c04('0x2d')]);_0x220cdc[_0x1c04('0x30')]=_[_0x1c04('0x2f')](_0x3bf4fd[_0x1c04('0x2c')],qs['fields'](_0x228e4[_0x1c04('0x2d')]['fields']));_0x220cdc['attributes']=_0x220cdc['attributes'][_0x1c04('0x31')]?_0x220cdc[_0x1c04('0x30')]:_0x3bf4fd[_0x1c04('0x2c')];if(_0x228e4[_0x1c04('0x2d')][_0x1c04('0x32')]){_0x220cdc[_0x1c04('0x33')]=[{'all':!![]}];}_0x220cdc=_[_0x1c04('0x34')]({},_0x220cdc,_0x228e4['options']);return db[_0x1c04('0x35')][_0x1c04('0x36')](_0x220cdc)[_0x1c04('0x27')](handleEntityNotFound(_0x29d273,null))[_0x1c04('0x27')](respondWithResult(_0x29d273,null))['catch'](handleError(_0x29d273,null));};exports['update']=function(_0x1e5586,_0x236b7f){if(_0x1e5586[_0x1c04('0x37')]['id']){delete _0x1e5586[_0x1c04('0x37')]['id'];}return db[_0x1c04('0x35')]['find']({'where':{'id':_0x1e5586[_0x1c04('0x2b')]['id']}})[_0x1c04('0x27')](handleEntityNotFound(_0x236b7f,null))['then'](saveUpdates(_0x1e5586[_0x1c04('0x37')],null))[_0x1c04('0x27')](respondWithResult(_0x236b7f,null))[_0x1c04('0x38')](handleError(_0x236b7f,null));};exports[_0x1c04('0x26')]=function(_0x587b09,_0x220c64){return db['ChatApplication'][_0x1c04('0x36')]({'where':{'id':_0x587b09[_0x1c04('0x2b')]['id']}})[_0x1c04('0x27')](handleEntityNotFound(_0x220c64,null))[_0x1c04('0x27')](removeEntity(_0x220c64,null))[_0x1c04('0x38')](handleError(_0x220c64,null));};
\ No newline at end of file
diff --git a/server/api/chatApplication/chatApplication.model.js b/server/api/chatApplication/chatApplication.model.js
index 5b0fad3..03e3f89 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 _0xaba8=['moment','request-promise','path','rimraf','./chatApplication.attributes','exports','define','ChatApplication','chat_applications','utf8mb4','utf8mb4_unicode_ci','lodash','../../config/logger','api'];(function(_0x1cc8fe,_0x105328){var _0x230054=function(_0x1a1b56){while(--_0x1a1b56){_0x1cc8fe['push'](_0x1cc8fe['shift']());}};_0x230054(++_0x105328);}(_0xaba8,0x1af));var _0x8aba=function(_0x3632fa,_0x30c819){_0x3632fa=_0x3632fa-0x0;var _0x35c4cf=_0xaba8[_0x3632fa];return _0x35c4cf;};'use strict';var _=require(_0x8aba('0x0'));var util=require('util');var logger=require(_0x8aba('0x1'))(_0x8aba('0x2'));var moment=require(_0x8aba('0x3'));var BPromise=require('bluebird');var rp=require(_0x8aba('0x4'));var fs=require('fs');var path=require(_0x8aba('0x5'));var rimraf=require(_0x8aba('0x6'));var config=require('../../config/environment');var attributes=require(_0x8aba('0x7'));module[_0x8aba('0x8')]=function(_0x421cbf,_0x896c12){return _0x421cbf[_0x8aba('0x9')](_0x8aba('0xa'),attributes,{'tableName':_0x8aba('0xb'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x8aba('0xc'),'collate':_0x8aba('0xd')});};
\ No newline at end of file
+var _0x655d=['rimraf','./chatApplication.attributes','define','ChatApplication','chat_applications','utf8mb4','utf8mb4_unicode_ci','lodash','util','../../config/logger','api','moment','bluebird','path'];(function(_0x5c351c,_0x2046d8){var _0x26f3b3=function(_0x47ac18){while(--_0x47ac18){_0x5c351c['push'](_0x5c351c['shift']());}};_0x26f3b3(++_0x2046d8);}(_0x655d,0x13b));var _0xd655=function(_0x2c91e9,_0x2fb965){_0x2c91e9=_0x2c91e9-0x0;var _0x13f0ff=_0x655d[_0x2c91e9];return _0x13f0ff;};'use strict';var _=require(_0xd655('0x0'));var util=require(_0xd655('0x1'));var logger=require(_0xd655('0x2'))(_0xd655('0x3'));var moment=require(_0xd655('0x4'));var BPromise=require(_0xd655('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xd655('0x6'));var rimraf=require(_0xd655('0x7'));var config=require('../../config/environment');var attributes=require(_0xd655('0x8'));module['exports']=function(_0x1a2ecb,_0x1c3f69){return _0x1a2ecb[_0xd655('0x9')](_0xd655('0xa'),attributes,{'tableName':_0xd655('0xb'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0xd655('0xc'),'collate':_0xd655('0xd')});};
\ No newline at end of file
diff --git a/server/api/chatApplication/chatApplication.rpc.js b/server/api/chatApplication/chatApplication.rpc.js
index af46f81..5420fa0 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 _0x164d=['request','then','info','debug','ChatApplication,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','ChatApplication,\x20%s,\x20%s','message','result','catch','lodash','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise'];(function(_0xea6c20,_0x5a0de8){var _0x458655=function(_0x4afe96){while(--_0x4afe96){_0xea6c20['push'](_0xea6c20['shift']());}};_0x458655(++_0x5a0de8);}(_0x164d,0x12a));var _0xd164=function(_0x284609,_0x386b54){_0x284609=_0x284609-0x0;var _0x55116b=_0x164d[_0x284609];return _0x55116b;};'use strict';var _=require(_0xd164('0x0'));var util=require('util');var moment=require(_0xd164('0x1'));var BPromise=require('bluebird');var rs=require(_0xd164('0x2'));var fs=require('fs');var Redis=require(_0xd164('0x3'));var db=require(_0xd164('0x4'))['db'];var utils=require(_0xd164('0x5'));var logger=require(_0xd164('0x6'))(_0xd164('0x7'));var config=require(_0xd164('0x8'));var jayson=require(_0xd164('0x9'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x4b204c,_0xf41798,_0x3e60a6){return new BPromise(function(_0x26b5db,_0x303a6f){return client[_0xd164('0xa')](_0x4b204c,_0x3e60a6)[_0xd164('0xb')](function(_0x5a93cc){logger[_0xd164('0xc')]('ChatApplication,\x20%s,\x20%s',_0xf41798,'request\x20sent');logger[_0xd164('0xd')](_0xd164('0xe'),_0xf41798,_0xd164('0xf'),JSON['stringify'](_0x5a93cc));if(_0x5a93cc[_0xd164('0x10')]){if(_0x5a93cc[_0xd164('0x10')][_0xd164('0x11')]===0x1f4){logger['error'](_0xd164('0x12'),_0xf41798,_0x5a93cc[_0xd164('0x10')][_0xd164('0x13')]);return _0x303a6f(_0x5a93cc[_0xd164('0x10')][_0xd164('0x13')]);}logger[_0xd164('0x10')](_0xd164('0x12'),_0xf41798,_0x5a93cc[_0xd164('0x10')]['message']);return _0x26b5db(_0x5a93cc[_0xd164('0x10')][_0xd164('0x13')]);}else{logger[_0xd164('0xc')](_0xd164('0x12'),_0xf41798,_0xd164('0xf'));_0x26b5db(_0x5a93cc[_0xd164('0x14')]['message']);}})[_0xd164('0x15')](function(_0x37cba5){logger[_0xd164('0x10')](_0xd164('0x12'),_0xf41798,_0x37cba5);_0x303a6f(_0x37cba5);});});}
\ No newline at end of file
+var _0x17e9=['../../config/utils','rpc','../../config/environment','jayson/promise','client','ChatApplication,\x20%s,\x20%s','request\x20sent','debug','ChatApplication,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','catch','lodash','util','randomstring','ioredis','../../mysqldb'];(function(_0x50045a,_0x1e1fb4){var _0x41eba7=function(_0x4c44fe){while(--_0x4c44fe){_0x50045a['push'](_0x50045a['shift']());}};_0x41eba7(++_0x1e1fb4);}(_0x17e9,0x1db));var _0x917e=function(_0x5ce4db,_0x313a2b){_0x5ce4db=_0x5ce4db-0x0;var _0x918b0a=_0x17e9[_0x5ce4db];return _0x918b0a;};'use strict';var _=require(_0x917e('0x0'));var util=require(_0x917e('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x917e('0x2'));var fs=require('fs');var Redis=require(_0x917e('0x3'));var db=require(_0x917e('0x4'))['db'];var utils=require(_0x917e('0x5'));var logger=require('../../config/logger')(_0x917e('0x6'));var config=require(_0x917e('0x7'));var jayson=require(_0x917e('0x8'));var client=jayson[_0x917e('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x4c7103,_0x311df1,_0x24c370){return new BPromise(function(_0x24f190,_0x34be88){return client['request'](_0x4c7103,_0x24c370)['then'](function(_0x383a07){logger['info'](_0x917e('0xa'),_0x311df1,_0x917e('0xb'));logger[_0x917e('0xc')](_0x917e('0xd'),_0x311df1,_0x917e('0xb'),JSON[_0x917e('0xe')](_0x383a07));if(_0x383a07[_0x917e('0xf')]){if(_0x383a07[_0x917e('0xf')][_0x917e('0x10')]===0x1f4){logger[_0x917e('0xf')](_0x917e('0xa'),_0x311df1,_0x383a07[_0x917e('0xf')][_0x917e('0x11')]);return _0x34be88(_0x383a07[_0x917e('0xf')]['message']);}logger[_0x917e('0xf')]('ChatApplication,\x20%s,\x20%s',_0x311df1,_0x383a07[_0x917e('0xf')]['message']);return _0x24f190(_0x383a07[_0x917e('0xf')][_0x917e('0x11')]);}else{logger[_0x917e('0x12')](_0x917e('0xa'),_0x311df1,'request\x20sent');_0x24f190(_0x383a07['result'][_0x917e('0x11')]);}})[_0x917e('0x13')](function(_0x327fb3){logger[_0x917e('0xf')](_0x917e('0xa'),_0x311df1,_0x327fb3);_0x34be88(_0x327fb3);});});}
\ No newline at end of file
diff --git a/server/api/chatApplication/index.js b/server/api/chatApplication/index.js
index 0df145f..68aa577 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 _0x9f2c=['isAuthenticated','show','put','update','delete','destroy','exports','util','path','express','fs-extra','../../components/auth/service','../../components/interaction/service','get','/:id'];(function(_0x5c76ec,_0x97b402){var _0x2e2a20=function(_0x3d637f){while(--_0x3d637f){_0x5c76ec['push'](_0x5c76ec['shift']());}};_0x2e2a20(++_0x97b402);}(_0x9f2c,0xd9));var _0xc9f2=function(_0xff5df6,_0x514e73){_0xff5df6=_0xff5df6-0x0;var _0x2634bb=_0x9f2c[_0xff5df6];return _0x2634bb;};'use strict';var multer=require('multer');var util=require(_0xc9f2('0x0'));var path=require(_0xc9f2('0x1'));var timeout=require('connect-timeout');var express=require(_0xc9f2('0x2'));var router=express['Router']();var fs_extra=require(_0xc9f2('0x3'));var auth=require(_0xc9f2('0x4'));var interaction=require(_0xc9f2('0x5'));var config=require('../../config/environment');var controller=require('./chatApplication.controller');router[_0xc9f2('0x6')](_0xc9f2('0x7'),auth[_0xc9f2('0x8')](),controller[_0xc9f2('0x9')]);router[_0xc9f2('0xa')](_0xc9f2('0x7'),auth[_0xc9f2('0x8')](),controller[_0xc9f2('0xb')]);router[_0xc9f2('0xc')]('/:id',auth[_0xc9f2('0x8')](),controller[_0xc9f2('0xd')]);module[_0xc9f2('0xe')]=router;
\ No newline at end of file
+var _0x1add=['put','/:id','destroy','path','connect-timeout','Router','../../components/interaction/service','../../config/environment','./chatApplication.controller','get','show'];(function(_0x32acd1,_0x434e8a){var _0x446047=function(_0x17ce14){while(--_0x17ce14){_0x32acd1['push'](_0x32acd1['shift']());}};_0x446047(++_0x434e8a);}(_0x1add,0x14d));var _0xd1ad=function(_0x44174f,_0x5b0087){_0x44174f=_0x44174f-0x0;var _0x4f0d66=_0x1add[_0x44174f];return _0x4f0d66;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0xd1ad('0x0'));var timeout=require(_0xd1ad('0x1'));var express=require('express');var router=express[_0xd1ad('0x2')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0xd1ad('0x3'));var config=require(_0xd1ad('0x4'));var controller=require(_0xd1ad('0x5'));router[_0xd1ad('0x6')]('/:id',auth['isAuthenticated'](),controller[_0xd1ad('0x7')]);router[_0xd1ad('0x8')](_0xd1ad('0x9'),auth['isAuthenticated'](),controller['update']);router['delete'](_0xd1ad('0x9'),auth['isAuthenticated'](),controller[_0xd1ad('0xa')]);module['exports']=router;
\ No newline at end of file
diff --git a/server/api/chatGroup/chatGroup.attributes.js b/server/api/chatGroup/chatGroup.attributes.js
index d63acb5..6e704d7 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 _0x1488=['BOOLEAN','sequelize','STRING'];(function(_0x1e7b16,_0x4607a1){var _0x37fadc=function(_0x1fc9ce){while(--_0x1fc9ce){_0x1e7b16['push'](_0x1e7b16['shift']());}};_0x37fadc(++_0x4607a1);}(_0x1488,0x88));var _0x8148=function(_0x46361e,_0x243aaf){_0x46361e=_0x46361e-0x0;var _0x14e302=_0x1488[_0x46361e];return _0x14e302;};'use strict';var Sequelize=require(_0x8148('0x0'));module['exports']={'name':{'type':Sequelize[_0x8148('0x1')],'allowNull':![]},'description':{'type':Sequelize[_0x8148('0x1')]},'write':{'type':Sequelize[_0x8148('0x2')],'defaultValue':!![]}};
\ No newline at end of file
+var _0xce62=['exports','STRING','BOOLEAN','sequelize'];(function(_0x367f71,_0x539921){var _0x123610=function(_0x5b9a32){while(--_0x5b9a32){_0x367f71['push'](_0x367f71['shift']());}};_0x123610(++_0x539921);}(_0xce62,0x83));var _0x2ce6=function(_0xf081c9,_0x90f843){_0xf081c9=_0xf081c9-0x0;var _0x1e3b8f=_0xce62[_0xf081c9];return _0x1e3b8f;};'use strict';var Sequelize=require(_0x2ce6('0x0'));module[_0x2ce6('0x1')]={'name':{'type':Sequelize['STRING'],'allowNull':![]},'description':{'type':Sequelize[_0x2ce6('0x2')]},'write':{'type':Sequelize[_0x2ce6('0x3')],'defaultValue':!![]}};
\ No newline at end of file
diff --git a/server/api/chatGroup/chatGroup.controller.js b/server/api/chatGroup/chatGroup.controller.js
index bd10579..55a9886 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 _0x404d=['eml-format','rimraf','request-promise','bluebird','mustache','path','sox','ejs','lodash','squel','crypto','querystring','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./chatGroup.socket','register','sendStatus','status','json','offset','undefined','count','limit','set','apply','reject','save','update','then','error','name','send','ChatGroup','rawAttributes','fieldName','model','map','keys','query','attributes','intersection','fields','length','hasOwnProperty','nolimit','sort','filters','filter','where','merge','VIRTUAL','options','includeAll','include','findAll','params','find','catch','create','body','destroy','describe','getUnread','ChatInternalMessage','toInteger','addMembers','ids','getMembers','User','pick','removeMembers','addMessage','ChatGroupId','getMessages','findOne','order','$gte','split','format','YYYY-MM-DD\x20HH:mm:ss'];(function(_0x5b644e,_0x2e5e07){var _0x49c6bf=function(_0x3032d9){while(--_0x3032d9){_0x5b644e['push'](_0x5b644e['shift']());}};_0x49c6bf(++_0x2e5e07);}(_0x404d,0xb4));var _0xd404=function(_0x3d7355,_0x47d074){_0x3d7355=_0x3d7355-0x0;var _0x33f055=_0x404d[_0x3d7355];return _0x33f055;};'use strict';var emlformat=require(_0xd404('0x0'));var rimraf=require(_0xd404('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0xd404('0x2'));var moment=require('moment');var BPromise=require(_0xd404('0x3'));var Mustache=require(_0xd404('0x4'));var util=require('util');var path=require(_0xd404('0x5'));var sox=require(_0xd404('0x6'));var csv=require('to-csv');var ejs=require(_0xd404('0x7'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xd404('0x8'));var squel=require(_0xd404('0x9'));var crypto=require(_0xd404('0xa'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0xd404('0xb'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0xd404('0xc'));var qs=require('../../components/parsers/qs');var as=require(_0xd404('0xd'));var hardwareService=require(_0xd404('0xe'));var logger=require(_0xd404('0xf'))(_0xd404('0x10'));var utils=require(_0xd404('0x11'));var config=require('../../config/environment');var licenseUtil=require(_0xd404('0x12'));var db=require(_0xd404('0x13'))['db'];config[_0xd404('0x14')]=_[_0xd404('0x15')](config['redis'],{'host':_0xd404('0x16'),'port':0x18eb});var socket=require(_0xd404('0x17'))(new Redis(config['redis']));require(_0xd404('0x18'))[_0xd404('0x19')](socket);function respondWithStatusCode(_0x9060ad,_0x673fee){_0x673fee=_0x673fee||0xcc;return function(_0x2671cd){if(_0x2671cd){return _0x9060ad[_0xd404('0x1a')](_0x673fee);}return _0x9060ad[_0xd404('0x1b')](_0x673fee)['end']();};}function respondWithResult(_0x37e941,_0x44a3ff){_0x44a3ff=_0x44a3ff||0xc8;return function(_0x58b8b6){if(_0x58b8b6){return _0x37e941[_0xd404('0x1b')](_0x44a3ff)[_0xd404('0x1c')](_0x58b8b6);}};}function respondWithFilteredResult(_0x58c0bb,_0x2966e7){return function(_0xb646ac){if(_0xb646ac){var _0x366688=typeof _0x2966e7[_0xd404('0x1d')]==='undefined'&&typeof _0x2966e7['limit']===_0xd404('0x1e');var _0x32abb3=_0xb646ac[_0xd404('0x1f')];var _0x15cf3b=_0x366688?0x0:_0x2966e7['offset'];var _0x40be61=_0x366688?_0xb646ac[_0xd404('0x1f')]:_0x2966e7['offset']+_0x2966e7[_0xd404('0x20')];var _0x5c333d;if(_0x40be61>=_0x32abb3){_0x40be61=_0x32abb3;_0x5c333d=0xc8;}else{_0x5c333d=0xce;}_0x58c0bb['status'](_0x5c333d);return _0x58c0bb[_0xd404('0x21')]('Content-Range',_0x15cf3b+'-'+_0x40be61+'/'+_0x32abb3)[_0xd404('0x1c')](_0xb646ac);}return null;};}function patchUpdates(_0x38f61c){return function(_0x26cb24){try{jsonpatch[_0xd404('0x22')](_0x26cb24,_0x38f61c,!![]);}catch(_0x522770){return BPromise[_0xd404('0x23')](_0x522770);}return _0x26cb24[_0xd404('0x24')]();};}function saveUpdates(_0xb6edb8,_0x27e6ae){return function(_0x409b42){if(_0x409b42){return _0x409b42[_0xd404('0x25')](_0xb6edb8)[_0xd404('0x26')](function(_0x20ac73){return _0x20ac73;});}return null;};}function removeEntity(_0x597c2d,_0x3aa91b){return function(_0x238f8f){if(_0x238f8f){return _0x238f8f['destroy']()['then'](function(){_0x597c2d[_0xd404('0x1b')](0xcc)['end']();});}};}function handleEntityNotFound(_0x5d7369,_0x2169a2){return function(_0x23ef2e){if(!_0x23ef2e){_0x5d7369[_0xd404('0x1a')](0x194);}return _0x23ef2e;};}function handleError(_0x1c1822,_0x28cea3){_0x28cea3=_0x28cea3||0x1f4;return function(_0x19f2c6){logger[_0xd404('0x27')](_0x19f2c6['stack']);if(_0x19f2c6['name']){delete _0x19f2c6[_0xd404('0x28')];}_0x1c1822[_0xd404('0x1b')](_0x28cea3)[_0xd404('0x29')](_0x19f2c6);};}exports['index']=function(_0x45e377,_0xa9d10b){var _0x2994f7={},_0xdaeffa={},_0x10f99f={'count':0x0,'rows':[]};var _0x5c7280=_['map'](db[_0xd404('0x2a')][_0xd404('0x2b')],function(_0x560fff){return{'name':_0x560fff[_0xd404('0x2c')],'type':_0x560fff['type']['key']};});_0xdaeffa[_0xd404('0x2d')]=_[_0xd404('0x2e')](_0x5c7280,_0xd404('0x28'));_0xdaeffa['query']=_[_0xd404('0x2f')](_0x45e377[_0xd404('0x30')]);_0xdaeffa['filters']=_['intersection'](_0xdaeffa[_0xd404('0x2d')],_0xdaeffa[_0xd404('0x30')]);_0x2994f7[_0xd404('0x31')]=_[_0xd404('0x32')](_0xdaeffa['model'],qs[_0xd404('0x33')](_0x45e377[_0xd404('0x30')][_0xd404('0x33')]));_0x2994f7[_0xd404('0x31')]=_0x2994f7['attributes'][_0xd404('0x34')]?_0x2994f7['attributes']:_0xdaeffa[_0xd404('0x2d')];if(!_0x45e377['query'][_0xd404('0x35')](_0xd404('0x36'))){_0x2994f7[_0xd404('0x20')]=qs[_0xd404('0x20')](_0x45e377[_0xd404('0x30')][_0xd404('0x20')]);_0x2994f7[_0xd404('0x1d')]=qs[_0xd404('0x1d')](_0x45e377['query'][_0xd404('0x1d')]);}_0x2994f7['order']=qs[_0xd404('0x37')](_0x45e377[_0xd404('0x30')]['sort']);_0x2994f7['where']=qs['filters'](_['pick'](_0x45e377[_0xd404('0x30')],_0xdaeffa[_0xd404('0x38')]),_0x5c7280);if(_0x45e377['query'][_0xd404('0x39')]){_0x2994f7[_0xd404('0x3a')]=_[_0xd404('0x3b')](_0x2994f7['where'],{'$or':_[_0xd404('0x2e')](_0x5c7280,function(_0x14c53d){if(_0x14c53d['type']!==_0xd404('0x3c')){var _0x365e6d={};_0x365e6d[_0x14c53d[_0xd404('0x28')]]={'$like':'%'+_0x45e377[_0xd404('0x30')][_0xd404('0x39')]+'%'};return _0x365e6d;}})});}_0x2994f7=_[_0xd404('0x3b')]({},_0x2994f7,_0x45e377[_0xd404('0x3d')]);var _0x41cd75={'where':_0x2994f7['where']};return db[_0xd404('0x2a')][_0xd404('0x1f')](_0x41cd75)['then'](function(_0x57a675){_0x10f99f['count']=_0x57a675;if(_0x45e377[_0xd404('0x30')][_0xd404('0x3e')]){_0x2994f7[_0xd404('0x3f')]=[{'all':!![]}];}return db['ChatGroup'][_0xd404('0x40')](_0x2994f7);})[_0xd404('0x26')](function(_0x51e5ad){_0x10f99f['rows']=_0x51e5ad;return _0x10f99f;})[_0xd404('0x26')](respondWithFilteredResult(_0xa9d10b,_0x2994f7))['catch'](handleError(_0xa9d10b,null));};exports['show']=function(_0x2fcbb4,_0x48da7b){var _0x17decc={'raw':!![],'where':{'id':_0x2fcbb4[_0xd404('0x41')]['id']}},_0x2f95da={};_0x2f95da[_0xd404('0x2d')]=_[_0xd404('0x2f')](db[_0xd404('0x2a')]['rawAttributes']);_0x2f95da[_0xd404('0x30')]=_[_0xd404('0x2f')](_0x2fcbb4['query']);_0x2f95da[_0xd404('0x38')]=_[_0xd404('0x32')](_0x2f95da[_0xd404('0x2d')],_0x2f95da[_0xd404('0x30')]);_0x17decc['attributes']=_[_0xd404('0x32')](_0x2f95da[_0xd404('0x2d')],qs[_0xd404('0x33')](_0x2fcbb4[_0xd404('0x30')]['fields']));_0x17decc[_0xd404('0x31')]=_0x17decc[_0xd404('0x31')][_0xd404('0x34')]?_0x17decc['attributes']:_0x2f95da[_0xd404('0x2d')];if(_0x2fcbb4[_0xd404('0x30')][_0xd404('0x3e')]){_0x17decc[_0xd404('0x3f')]=[{'all':!![]}];}_0x17decc=_[_0xd404('0x3b')]({},_0x17decc,_0x2fcbb4[_0xd404('0x3d')]);return db[_0xd404('0x2a')][_0xd404('0x42')](_0x17decc)['then'](handleEntityNotFound(_0x48da7b,null))[_0xd404('0x26')](respondWithResult(_0x48da7b,null))[_0xd404('0x43')](handleError(_0x48da7b,null));};exports['create']=function(_0x186b85,_0x2aa030){return db[_0xd404('0x2a')][_0xd404('0x44')](_0x186b85['body'],{})[_0xd404('0x26')](respondWithResult(_0x2aa030,0xc9))[_0xd404('0x43')](handleError(_0x2aa030,null));};exports[_0xd404('0x25')]=function(_0x5983f7,_0x3f7446){if(_0x5983f7[_0xd404('0x45')]['id']){delete _0x5983f7[_0xd404('0x45')]['id'];}return db[_0xd404('0x2a')][_0xd404('0x42')]({'where':{'id':_0x5983f7[_0xd404('0x41')]['id']}})[_0xd404('0x26')](handleEntityNotFound(_0x3f7446,null))['then'](saveUpdates(_0x5983f7[_0xd404('0x45')],null))[_0xd404('0x26')](respondWithResult(_0x3f7446,null))['catch'](handleError(_0x3f7446,null));};exports[_0xd404('0x46')]=function(_0x23222f,_0x586234){return db[_0xd404('0x2a')][_0xd404('0x42')]({'where':{'id':_0x23222f['params']['id']}})[_0xd404('0x26')](handleEntityNotFound(_0x586234,null))['then'](removeEntity(_0x586234,null))['catch'](handleError(_0x586234,null));};exports[_0xd404('0x47')]=function(_0x3a1b39,_0x422b21){return db[_0xd404('0x2a')][_0xd404('0x47')]()[_0xd404('0x26')](respondWithResult(_0x422b21,null))[_0xd404('0x43')](handleError(_0x422b21,null));};exports[_0xd404('0x48')]=function(_0x1d18c6,_0x12fe10,_0x276671){return db[_0xd404('0x49')]['count']({'where':{'ChatGroupId':_0x1d18c6[_0xd404('0x41')]['id'],'ToId':_0x1d18c6['user']['id'],'read':![]}})[_0xd404('0x26')](function(_0x325206){return{'id':_[_0xd404('0x4a')](_0x1d18c6[_0xd404('0x41')]['id']),'count':_0x325206};})[_0xd404('0x26')](respondWithResult(_0x12fe10,null))['catch'](handleError(_0x12fe10,null));};exports[_0xd404('0x4b')]=function(_0x3f2314,_0x5a80a4,_0x2718f2){return db['ChatGroup'][_0xd404('0x42')]({'where':{'id':_0x3f2314[_0xd404('0x41')]['id']}})[_0xd404('0x26')](handleEntityNotFound(_0x5a80a4,null))['then'](function(_0x466240){if(_0x466240){return _0x466240[_0xd404('0x4b')](_0x3f2314['body'][_0xd404('0x4c')],_['omit'](_0x3f2314[_0xd404('0x45')],['ids','id'])||{});}})[_0xd404('0x26')](respondWithResult(_0x5a80a4,null))[_0xd404('0x43')](handleError(_0x5a80a4,null));};exports[_0xd404('0x4d')]=function(_0x478fd3,_0x16b592,_0xc0bab8){var _0x1ede7e={};var _0x4f9cf5={};var _0x388953;var _0x27fb93;return db[_0xd404('0x2a')]['findOne']({'where':{'id':_0x478fd3[_0xd404('0x41')]['id']}})[_0xd404('0x26')](handleEntityNotFound(_0x16b592,null))['then'](function(_0x435c42){if(_0x435c42){_0x388953=_0x435c42;_0x4f9cf5[_0xd404('0x2d')]=_['keys'](db[_0xd404('0x4e')][_0xd404('0x2b')]);_0x4f9cf5[_0xd404('0x30')]=_[_0xd404('0x2f')](_0x478fd3['query']);_0x4f9cf5[_0xd404('0x38')]=_[_0xd404('0x32')](_0x4f9cf5[_0xd404('0x2d')],_0x4f9cf5[_0xd404('0x30')]);_0x1ede7e['attributes']=_[_0xd404('0x32')](_0x4f9cf5['model'],qs[_0xd404('0x33')](_0x478fd3[_0xd404('0x30')][_0xd404('0x33')]));_0x1ede7e[_0xd404('0x31')]=_0x1ede7e[_0xd404('0x31')][_0xd404('0x34')]?_0x1ede7e[_0xd404('0x31')]:_0x4f9cf5['model'];_0x1ede7e['order']=qs[_0xd404('0x37')](_0x478fd3[_0xd404('0x30')][_0xd404('0x37')]);_0x1ede7e['where']=qs[_0xd404('0x38')](_[_0xd404('0x4f')](_0x478fd3['query'],_0x4f9cf5[_0xd404('0x38')]));if(_0x478fd3[_0xd404('0x30')][_0xd404('0x39')]){_0x1ede7e['where']=_['merge'](_0x1ede7e['where'],{'$or':_[_0xd404('0x2e')](_0x1ede7e['attributes'],function(_0x64f7d3){var _0x23e611={};_0x23e611[_0x64f7d3]={'$like':'%'+_0x478fd3[_0xd404('0x30')][_0xd404('0x39')]+'%'};return _0x23e611;})});}_0x1ede7e=_[_0xd404('0x3b')]({},_0x1ede7e,_0x478fd3['options']);return _0x388953[_0xd404('0x4d')](_0x1ede7e);}})[_0xd404('0x26')](function(_0x3c84b0){if(_0x3c84b0){_0x27fb93=_0x3c84b0[_0xd404('0x34')];if(!_0x478fd3[_0xd404('0x30')][_0xd404('0x35')](_0xd404('0x36'))){_0x1ede7e[_0xd404('0x20')]=qs['limit'](_0x478fd3[_0xd404('0x30')]['limit']);_0x1ede7e[_0xd404('0x1d')]=qs[_0xd404('0x1d')](_0x478fd3[_0xd404('0x30')]['offset']);}return _0x388953['getMembers'](_0x1ede7e);}})[_0xd404('0x26')](function(_0x5ab715){if(_0x5ab715){return _0x5ab715?{'count':_0x27fb93,'rows':_0x5ab715}:null;}})['then'](respondWithResult(_0x16b592,null))['catch'](handleError(_0x16b592,null));};exports['removeMembers']=function(_0x5aef9f,_0x4ba0c3,_0x451f9d){return db[_0xd404('0x2a')][_0xd404('0x42')]({'where':{'id':_0x5aef9f[_0xd404('0x41')]['id']}})['then'](handleEntityNotFound(_0x4ba0c3,null))['then'](function(_0xf677be){if(_0xf677be){return _0xf677be[_0xd404('0x50')](_0x5aef9f[_0xd404('0x30')]['ids']);}})['then'](respondWithStatusCode(_0x4ba0c3,null))[_0xd404('0x43')](handleError(_0x4ba0c3,null));};exports[_0xd404('0x51')]=function(_0x5e9999,_0x1af587,_0x4edfab){if(_0x5e9999[_0xd404('0x45')]['id']){delete _0x5e9999[_0xd404('0x45')]['id'];}return db[_0xd404('0x2a')]['find']({'where':{'id':_0x5e9999['params']['id']}})[_0xd404('0x26')](handleEntityNotFound(_0x1af587,null))[_0xd404('0x26')](function(_0x555ae5){if(_0x555ae5){_0x5e9999[_0xd404('0x45')][_0xd404('0x52')]=_0x555ae5['id'];return db[_0xd404('0x49')][_0xd404('0x44')](_0x5e9999['body']);}})['then'](respondWithResult(_0x1af587,null))['catch'](handleError(_0x1af587,null));};exports[_0xd404('0x53')]=function(_0x2cbe8a,_0x2edac9,_0x1884fb){var _0x42c753={};var _0x576422={};var _0x420cc3;var _0x56c9af;return db[_0xd404('0x2a')][_0xd404('0x54')]({'where':{'id':_0x2cbe8a[_0xd404('0x41')]['id']}})['then'](handleEntityNotFound(_0x2edac9,null))[_0xd404('0x26')](function(_0x1996d0){if(_0x1996d0){_0x420cc3=_0x1996d0;_0x576422['model']=_[_0xd404('0x2f')](db[_0xd404('0x49')][_0xd404('0x2b')]);_0x576422[_0xd404('0x30')]=_[_0xd404('0x2f')](_0x2cbe8a[_0xd404('0x30')]);_0x576422['filters']=_['intersection'](_0x576422[_0xd404('0x2d')],_0x576422[_0xd404('0x30')]);_0x42c753[_0xd404('0x31')]=_[_0xd404('0x32')](_0x576422[_0xd404('0x2d')],qs[_0xd404('0x33')](_0x2cbe8a[_0xd404('0x30')][_0xd404('0x33')]));_0x42c753[_0xd404('0x31')]=_0x42c753[_0xd404('0x31')]['length']?_0x42c753[_0xd404('0x31')]:_0x576422[_0xd404('0x2d')];_0x42c753[_0xd404('0x55')]=qs[_0xd404('0x37')](_0x2cbe8a[_0xd404('0x30')][_0xd404('0x37')]);_0x42c753[_0xd404('0x3a')]=qs['filters'](_[_0xd404('0x4f')](_0x2cbe8a['query'],_0x576422[_0xd404('0x38')]));if(_0x2cbe8a['query'][_0xd404('0x39')]){_0x42c753[_0xd404('0x3a')]=_[_0xd404('0x3b')](_0x42c753['where'],{'$or':_['map'](_0x42c753[_0xd404('0x31')],function(_0x1e4ffb){var _0x84400f={};_0x84400f[_0x1e4ffb]={'$like':'%'+_0x2cbe8a[_0xd404('0x30')]['filter']+'%'};return _0x84400f;})});}if(_0x2cbe8a[_0xd404('0x30')][_0xd404('0x56')]){var _0xf4e48=_0x2cbe8a[_0xd404('0x30')][_0xd404('0x56')][_0xd404('0x57')](',');var _0x48cd4d={};_0x48cd4d[_0xf4e48[0x0]]={'$gte':moment(_0xf4e48[0x1])[_0xd404('0x58')](_0xd404('0x59'))};_0x42c753['where']=_[_0xd404('0x3b')](_0x42c753['where'],_0x48cd4d);}_0x42c753=_['merge']({},_0x42c753,_0x2cbe8a[_0xd404('0x3d')]);return _0x420cc3['getMessages'](_0x42c753);}})[_0xd404('0x26')](function(_0xcb832){if(_0xcb832){_0x56c9af=_0xcb832[_0xd404('0x34')];if(!_0x2cbe8a['query']['hasOwnProperty']('nolimit')){_0x42c753[_0xd404('0x20')]=qs[_0xd404('0x20')](_0x2cbe8a[_0xd404('0x30')][_0xd404('0x20')]);_0x42c753['offset']=qs['offset'](_0x2cbe8a['query'][_0xd404('0x1d')]);}return _0x420cc3[_0xd404('0x53')](_0x42c753);}})[_0xd404('0x26')](function(_0x539265){if(_0x539265){return _0x539265?{'count':_0x56c9af,'rows':_0x539265}:null;}})[_0xd404('0x26')](respondWithResult(_0x2edac9,null))[_0xd404('0x43')](handleError(_0x2edac9,null));};
\ No newline at end of file
+var _0xb140=['../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./chatGroup.socket','register','status','end','json','undefined','limit','count','offset','set','Content-Range','apply','reject','update','then','sendStatus','error','stack','name','send','index','map','ChatGroup','fieldName','query','filters','model','attributes','intersection','fields','hasOwnProperty','nolimit','order','sort','where','pick','filter','type','VIRTUAL','include','findAll','rows','catch','show','params','keys','rawAttributes','includeAll','merge','find','create','body','describe','getUnread','ChatInternalMessage','addMembers','ids','omit','getMembers','findOne','options','length','removeMembers','ChatGroupId','getMessages','$gte','split','format','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','sox','to-csv','ejs','fs-extra','squel','jsforce','desk.js','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware'];(function(_0x53adf9,_0x381ee9){var _0x41b41f=function(_0x226bb8){while(--_0x226bb8){_0x53adf9['push'](_0x53adf9['shift']());}};_0x41b41f(++_0x381ee9);}(_0xb140,0x10f));var _0x0b14=function(_0xb66f92,_0x301f99){_0xb66f92=_0xb66f92-0x0;var _0x344d2d=_0xb140[_0xb66f92];return _0x344d2d;};'use strict';var emlformat=require(_0x0b14('0x0'));var rimraf=require(_0x0b14('0x1'));var zipdir=require(_0x0b14('0x2'));var jsonpatch=require(_0x0b14('0x3'));var rp=require(_0x0b14('0x4'));var moment=require(_0x0b14('0x5'));var BPromise=require('bluebird');var Mustache=require(_0x0b14('0x6'));var util=require(_0x0b14('0x7'));var path=require('path');var sox=require(_0x0b14('0x8'));var csv=require(_0x0b14('0x9'));var ejs=require(_0x0b14('0xa'));var fs=require('fs');var fs_extra=require(_0x0b14('0xb'));var _=require('lodash');var squel=require(_0x0b14('0xc'));var crypto=require('crypto');var jsforce=require(_0x0b14('0xd'));var deskjs=require(_0x0b14('0xe'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x0b14('0xf'));var Redis=require('ioredis');var authService=require(_0x0b14('0x10'));var qs=require(_0x0b14('0x11'));var as=require(_0x0b14('0x12'));var hardwareService=require(_0x0b14('0x13'));var logger=require(_0x0b14('0x14'))(_0x0b14('0x15'));var utils=require(_0x0b14('0x16'));var config=require(_0x0b14('0x17'));var licenseUtil=require('../../config/license/util');var db=require(_0x0b14('0x18'))['db'];config[_0x0b14('0x19')]=_[_0x0b14('0x1a')](config[_0x0b14('0x19')],{'host':_0x0b14('0x1b'),'port':0x18eb});var socket=require(_0x0b14('0x1c'))(new Redis(config['redis']));require(_0x0b14('0x1d'))[_0x0b14('0x1e')](socket);function respondWithStatusCode(_0x242c3c,_0x8a9a80){_0x8a9a80=_0x8a9a80||0xcc;return function(_0x10c64a){if(_0x10c64a){return _0x242c3c['sendStatus'](_0x8a9a80);}return _0x242c3c[_0x0b14('0x1f')](_0x8a9a80)[_0x0b14('0x20')]();};}function respondWithResult(_0x3a5673,_0x4694a5){_0x4694a5=_0x4694a5||0xc8;return function(_0x2e3c7b){if(_0x2e3c7b){return _0x3a5673[_0x0b14('0x1f')](_0x4694a5)[_0x0b14('0x21')](_0x2e3c7b);}};}function respondWithFilteredResult(_0x4febd9,_0x15867a){return function(_0x1a5538){if(_0x1a5538){var _0xfc6704=typeof _0x15867a['offset']===_0x0b14('0x22')&&typeof _0x15867a[_0x0b14('0x23')]===_0x0b14('0x22');var _0x47be90=_0x1a5538[_0x0b14('0x24')];var _0x46a35d=_0xfc6704?0x0:_0x15867a[_0x0b14('0x25')];var _0x334e55=_0xfc6704?_0x1a5538[_0x0b14('0x24')]:_0x15867a[_0x0b14('0x25')]+_0x15867a[_0x0b14('0x23')];var _0x45f407;if(_0x334e55>=_0x47be90){_0x334e55=_0x47be90;_0x45f407=0xc8;}else{_0x45f407=0xce;}_0x4febd9['status'](_0x45f407);return _0x4febd9[_0x0b14('0x26')](_0x0b14('0x27'),_0x46a35d+'-'+_0x334e55+'/'+_0x47be90)[_0x0b14('0x21')](_0x1a5538);}return null;};}function patchUpdates(_0x2ee5dc){return function(_0x5b5e83){try{jsonpatch[_0x0b14('0x28')](_0x5b5e83,_0x2ee5dc,!![]);}catch(_0x4bd933){return BPromise[_0x0b14('0x29')](_0x4bd933);}return _0x5b5e83['save']();};}function saveUpdates(_0x494a0c,_0x862b28){return function(_0x224d5c){if(_0x224d5c){return _0x224d5c[_0x0b14('0x2a')](_0x494a0c)[_0x0b14('0x2b')](function(_0xd4e75f){return _0xd4e75f;});}return null;};}function removeEntity(_0x3b2b2e,_0x260103){return function(_0x36dcf2){if(_0x36dcf2){return _0x36dcf2['destroy']()[_0x0b14('0x2b')](function(){_0x3b2b2e[_0x0b14('0x1f')](0xcc)[_0x0b14('0x20')]();});}};}function handleEntityNotFound(_0x2a331d,_0x53d06d){return function(_0xdd7286){if(!_0xdd7286){_0x2a331d[_0x0b14('0x2c')](0x194);}return _0xdd7286;};}function handleError(_0x91107f,_0x3160e0){_0x3160e0=_0x3160e0||0x1f4;return function(_0x27c8c7){logger[_0x0b14('0x2d')](_0x27c8c7[_0x0b14('0x2e')]);if(_0x27c8c7[_0x0b14('0x2f')]){delete _0x27c8c7['name'];}_0x91107f[_0x0b14('0x1f')](_0x3160e0)[_0x0b14('0x30')](_0x27c8c7);};}exports[_0x0b14('0x31')]=function(_0x26a245,_0x29c48e){var _0x1f6b99={},_0x1c65a1={},_0xe00c55={'count':0x0,'rows':[]};var _0x2083e9=_[_0x0b14('0x32')](db[_0x0b14('0x33')]['rawAttributes'],function(_0x70d87){return{'name':_0x70d87[_0x0b14('0x34')],'type':_0x70d87['type']['key']};});_0x1c65a1['model']=_[_0x0b14('0x32')](_0x2083e9,_0x0b14('0x2f'));_0x1c65a1[_0x0b14('0x35')]=_['keys'](_0x26a245[_0x0b14('0x35')]);_0x1c65a1[_0x0b14('0x36')]=_['intersection'](_0x1c65a1[_0x0b14('0x37')],_0x1c65a1[_0x0b14('0x35')]);_0x1f6b99[_0x0b14('0x38')]=_[_0x0b14('0x39')](_0x1c65a1[_0x0b14('0x37')],qs[_0x0b14('0x3a')](_0x26a245[_0x0b14('0x35')]['fields']));_0x1f6b99[_0x0b14('0x38')]=_0x1f6b99[_0x0b14('0x38')]['length']?_0x1f6b99[_0x0b14('0x38')]:_0x1c65a1[_0x0b14('0x37')];if(!_0x26a245[_0x0b14('0x35')][_0x0b14('0x3b')](_0x0b14('0x3c'))){_0x1f6b99[_0x0b14('0x23')]=qs[_0x0b14('0x23')](_0x26a245[_0x0b14('0x35')][_0x0b14('0x23')]);_0x1f6b99[_0x0b14('0x25')]=qs[_0x0b14('0x25')](_0x26a245[_0x0b14('0x35')]['offset']);}_0x1f6b99[_0x0b14('0x3d')]=qs[_0x0b14('0x3e')](_0x26a245[_0x0b14('0x35')][_0x0b14('0x3e')]);_0x1f6b99[_0x0b14('0x3f')]=qs[_0x0b14('0x36')](_[_0x0b14('0x40')](_0x26a245[_0x0b14('0x35')],_0x1c65a1['filters']),_0x2083e9);if(_0x26a245[_0x0b14('0x35')][_0x0b14('0x41')]){_0x1f6b99['where']=_['merge'](_0x1f6b99[_0x0b14('0x3f')],{'$or':_[_0x0b14('0x32')](_0x2083e9,function(_0xd21c31){if(_0xd21c31[_0x0b14('0x42')]!==_0x0b14('0x43')){var _0x29f8cb={};_0x29f8cb[_0xd21c31[_0x0b14('0x2f')]]={'$like':'%'+_0x26a245[_0x0b14('0x35')]['filter']+'%'};return _0x29f8cb;}})});}_0x1f6b99=_['merge']({},_0x1f6b99,_0x26a245['options']);var _0x366bea={'where':_0x1f6b99[_0x0b14('0x3f')]};return db[_0x0b14('0x33')]['count'](_0x366bea)[_0x0b14('0x2b')](function(_0x4b0a7c){_0xe00c55[_0x0b14('0x24')]=_0x4b0a7c;if(_0x26a245[_0x0b14('0x35')]['includeAll']){_0x1f6b99[_0x0b14('0x44')]=[{'all':!![]}];}return db[_0x0b14('0x33')][_0x0b14('0x45')](_0x1f6b99);})[_0x0b14('0x2b')](function(_0x12a091){_0xe00c55[_0x0b14('0x46')]=_0x12a091;return _0xe00c55;})[_0x0b14('0x2b')](respondWithFilteredResult(_0x29c48e,_0x1f6b99))[_0x0b14('0x47')](handleError(_0x29c48e,null));};exports[_0x0b14('0x48')]=function(_0x5a8f5b,_0x10d903){var _0x205ca9={'raw':!![],'where':{'id':_0x5a8f5b[_0x0b14('0x49')]['id']}},_0x4aba3e={};_0x4aba3e['model']=_[_0x0b14('0x4a')](db[_0x0b14('0x33')][_0x0b14('0x4b')]);_0x4aba3e[_0x0b14('0x35')]=_[_0x0b14('0x4a')](_0x5a8f5b['query']);_0x4aba3e['filters']=_[_0x0b14('0x39')](_0x4aba3e[_0x0b14('0x37')],_0x4aba3e[_0x0b14('0x35')]);_0x205ca9[_0x0b14('0x38')]=_[_0x0b14('0x39')](_0x4aba3e[_0x0b14('0x37')],qs[_0x0b14('0x3a')](_0x5a8f5b[_0x0b14('0x35')]['fields']));_0x205ca9[_0x0b14('0x38')]=_0x205ca9[_0x0b14('0x38')]['length']?_0x205ca9['attributes']:_0x4aba3e[_0x0b14('0x37')];if(_0x5a8f5b['query'][_0x0b14('0x4c')]){_0x205ca9[_0x0b14('0x44')]=[{'all':!![]}];}_0x205ca9=_[_0x0b14('0x4d')]({},_0x205ca9,_0x5a8f5b['options']);return db[_0x0b14('0x33')][_0x0b14('0x4e')](_0x205ca9)[_0x0b14('0x2b')](handleEntityNotFound(_0x10d903,null))[_0x0b14('0x2b')](respondWithResult(_0x10d903,null))['catch'](handleError(_0x10d903,null));};exports[_0x0b14('0x4f')]=function(_0x517b7a,_0x110d7d){return db[_0x0b14('0x33')][_0x0b14('0x4f')](_0x517b7a[_0x0b14('0x50')],{})[_0x0b14('0x2b')](respondWithResult(_0x110d7d,0xc9))['catch'](handleError(_0x110d7d,null));};exports[_0x0b14('0x2a')]=function(_0x5ede4e,_0x496ff7){if(_0x5ede4e[_0x0b14('0x50')]['id']){delete _0x5ede4e['body']['id'];}return db[_0x0b14('0x33')]['find']({'where':{'id':_0x5ede4e[_0x0b14('0x49')]['id']}})['then'](handleEntityNotFound(_0x496ff7,null))[_0x0b14('0x2b')](saveUpdates(_0x5ede4e['body'],null))['then'](respondWithResult(_0x496ff7,null))['catch'](handleError(_0x496ff7,null));};exports['destroy']=function(_0x398300,_0x111d7e){return db[_0x0b14('0x33')]['find']({'where':{'id':_0x398300[_0x0b14('0x49')]['id']}})[_0x0b14('0x2b')](handleEntityNotFound(_0x111d7e,null))[_0x0b14('0x2b')](removeEntity(_0x111d7e,null))['catch'](handleError(_0x111d7e,null));};exports['describe']=function(_0x48cf1b,_0x3f612a){return db[_0x0b14('0x33')][_0x0b14('0x51')]()[_0x0b14('0x2b')](respondWithResult(_0x3f612a,null))[_0x0b14('0x47')](handleError(_0x3f612a,null));};exports[_0x0b14('0x52')]=function(_0x56b8c0,_0x391c6f,_0x2dbda2){return db[_0x0b14('0x53')][_0x0b14('0x24')]({'where':{'ChatGroupId':_0x56b8c0[_0x0b14('0x49')]['id'],'ToId':_0x56b8c0['user']['id'],'read':![]}})['then'](function(_0x4cd541){return{'id':_['toInteger'](_0x56b8c0[_0x0b14('0x49')]['id']),'count':_0x4cd541};})[_0x0b14('0x2b')](respondWithResult(_0x391c6f,null))['catch'](handleError(_0x391c6f,null));};exports[_0x0b14('0x54')]=function(_0x305ccc,_0x2d77e9,_0x1e2edc){return db[_0x0b14('0x33')]['find']({'where':{'id':_0x305ccc[_0x0b14('0x49')]['id']}})[_0x0b14('0x2b')](handleEntityNotFound(_0x2d77e9,null))[_0x0b14('0x2b')](function(_0x55e8de){if(_0x55e8de){return _0x55e8de[_0x0b14('0x54')](_0x305ccc['body'][_0x0b14('0x55')],_[_0x0b14('0x56')](_0x305ccc[_0x0b14('0x50')],[_0x0b14('0x55'),'id'])||{});}})[_0x0b14('0x2b')](respondWithResult(_0x2d77e9,null))[_0x0b14('0x47')](handleError(_0x2d77e9,null));};exports[_0x0b14('0x57')]=function(_0x33b4b3,_0x1fb474,_0x5bb6df){var _0x4b90df={};var _0x189f7d={};var _0x160ad6;var _0x56696f;return db['ChatGroup'][_0x0b14('0x58')]({'where':{'id':_0x33b4b3[_0x0b14('0x49')]['id']}})[_0x0b14('0x2b')](handleEntityNotFound(_0x1fb474,null))[_0x0b14('0x2b')](function(_0x4ec94e){if(_0x4ec94e){_0x160ad6=_0x4ec94e;_0x189f7d[_0x0b14('0x37')]=_[_0x0b14('0x4a')](db['User'][_0x0b14('0x4b')]);_0x189f7d[_0x0b14('0x35')]=_['keys'](_0x33b4b3[_0x0b14('0x35')]);_0x189f7d['filters']=_[_0x0b14('0x39')](_0x189f7d[_0x0b14('0x37')],_0x189f7d[_0x0b14('0x35')]);_0x4b90df[_0x0b14('0x38')]=_['intersection'](_0x189f7d[_0x0b14('0x37')],qs['fields'](_0x33b4b3[_0x0b14('0x35')][_0x0b14('0x3a')]));_0x4b90df['attributes']=_0x4b90df[_0x0b14('0x38')]['length']?_0x4b90df[_0x0b14('0x38')]:_0x189f7d[_0x0b14('0x37')];_0x4b90df['order']=qs[_0x0b14('0x3e')](_0x33b4b3[_0x0b14('0x35')][_0x0b14('0x3e')]);_0x4b90df[_0x0b14('0x3f')]=qs['filters'](_[_0x0b14('0x40')](_0x33b4b3[_0x0b14('0x35')],_0x189f7d[_0x0b14('0x36')]));if(_0x33b4b3[_0x0b14('0x35')][_0x0b14('0x41')]){_0x4b90df[_0x0b14('0x3f')]=_['merge'](_0x4b90df[_0x0b14('0x3f')],{'$or':_[_0x0b14('0x32')](_0x4b90df['attributes'],function(_0x178c2e){var _0x52f829={};_0x52f829[_0x178c2e]={'$like':'%'+_0x33b4b3['query'][_0x0b14('0x41')]+'%'};return _0x52f829;})});}_0x4b90df=_[_0x0b14('0x4d')]({},_0x4b90df,_0x33b4b3[_0x0b14('0x59')]);return _0x160ad6['getMembers'](_0x4b90df);}})[_0x0b14('0x2b')](function(_0x7a04bb){if(_0x7a04bb){_0x56696f=_0x7a04bb[_0x0b14('0x5a')];if(!_0x33b4b3[_0x0b14('0x35')]['hasOwnProperty'](_0x0b14('0x3c'))){_0x4b90df[_0x0b14('0x23')]=qs[_0x0b14('0x23')](_0x33b4b3[_0x0b14('0x35')][_0x0b14('0x23')]);_0x4b90df[_0x0b14('0x25')]=qs[_0x0b14('0x25')](_0x33b4b3[_0x0b14('0x35')][_0x0b14('0x25')]);}return _0x160ad6[_0x0b14('0x57')](_0x4b90df);}})[_0x0b14('0x2b')](function(_0x54823c){if(_0x54823c){return _0x54823c?{'count':_0x56696f,'rows':_0x54823c}:null;}})[_0x0b14('0x2b')](respondWithResult(_0x1fb474,null))[_0x0b14('0x47')](handleError(_0x1fb474,null));};exports[_0x0b14('0x5b')]=function(_0x57b7f2,_0x111fcb,_0x557545){return db[_0x0b14('0x33')][_0x0b14('0x4e')]({'where':{'id':_0x57b7f2[_0x0b14('0x49')]['id']}})[_0x0b14('0x2b')](handleEntityNotFound(_0x111fcb,null))[_0x0b14('0x2b')](function(_0x1479e4){if(_0x1479e4){return _0x1479e4[_0x0b14('0x5b')](_0x57b7f2[_0x0b14('0x35')][_0x0b14('0x55')]);}})[_0x0b14('0x2b')](respondWithStatusCode(_0x111fcb,null))[_0x0b14('0x47')](handleError(_0x111fcb,null));};exports['addMessage']=function(_0x185264,_0x5ce9d5,_0x119fa7){if(_0x185264[_0x0b14('0x50')]['id']){delete _0x185264['body']['id'];}return db[_0x0b14('0x33')][_0x0b14('0x4e')]({'where':{'id':_0x185264[_0x0b14('0x49')]['id']}})[_0x0b14('0x2b')](handleEntityNotFound(_0x5ce9d5,null))[_0x0b14('0x2b')](function(_0x494688){if(_0x494688){_0x185264['body'][_0x0b14('0x5c')]=_0x494688['id'];return db[_0x0b14('0x53')][_0x0b14('0x4f')](_0x185264['body']);}})[_0x0b14('0x2b')](respondWithResult(_0x5ce9d5,null))['catch'](handleError(_0x5ce9d5,null));};exports[_0x0b14('0x5d')]=function(_0x3fb96c,_0x4d1eb5,_0x310c83){var _0x3bffaf={};var _0x44a103={};var _0x26eb2a;var _0x3b5a7a;return db[_0x0b14('0x33')][_0x0b14('0x58')]({'where':{'id':_0x3fb96c[_0x0b14('0x49')]['id']}})['then'](handleEntityNotFound(_0x4d1eb5,null))[_0x0b14('0x2b')](function(_0x4f28fd){if(_0x4f28fd){_0x26eb2a=_0x4f28fd;_0x44a103['model']=_[_0x0b14('0x4a')](db['ChatInternalMessage']['rawAttributes']);_0x44a103[_0x0b14('0x35')]=_[_0x0b14('0x4a')](_0x3fb96c[_0x0b14('0x35')]);_0x44a103[_0x0b14('0x36')]=_[_0x0b14('0x39')](_0x44a103[_0x0b14('0x37')],_0x44a103[_0x0b14('0x35')]);_0x3bffaf[_0x0b14('0x38')]=_[_0x0b14('0x39')](_0x44a103[_0x0b14('0x37')],qs[_0x0b14('0x3a')](_0x3fb96c[_0x0b14('0x35')]['fields']));_0x3bffaf[_0x0b14('0x38')]=_0x3bffaf['attributes'][_0x0b14('0x5a')]?_0x3bffaf['attributes']:_0x44a103[_0x0b14('0x37')];_0x3bffaf[_0x0b14('0x3d')]=qs[_0x0b14('0x3e')](_0x3fb96c[_0x0b14('0x35')][_0x0b14('0x3e')]);_0x3bffaf[_0x0b14('0x3f')]=qs[_0x0b14('0x36')](_[_0x0b14('0x40')](_0x3fb96c[_0x0b14('0x35')],_0x44a103['filters']));if(_0x3fb96c[_0x0b14('0x35')][_0x0b14('0x41')]){_0x3bffaf[_0x0b14('0x3f')]=_[_0x0b14('0x4d')](_0x3bffaf[_0x0b14('0x3f')],{'$or':_[_0x0b14('0x32')](_0x3bffaf[_0x0b14('0x38')],function(_0x4edc0a){var _0x444023={};_0x444023[_0x4edc0a]={'$like':'%'+_0x3fb96c['query'][_0x0b14('0x41')]+'%'};return _0x444023;})});}if(_0x3fb96c[_0x0b14('0x35')]['$gte']){var _0x50bff7=_0x3fb96c[_0x0b14('0x35')][_0x0b14('0x5e')][_0x0b14('0x5f')](',');var _0x150454={};_0x150454[_0x50bff7[0x0]]={'$gte':moment(_0x50bff7[0x1])[_0x0b14('0x60')]('YYYY-MM-DD\x20HH:mm:ss')};_0x3bffaf['where']=_[_0x0b14('0x4d')](_0x3bffaf[_0x0b14('0x3f')],_0x150454);}_0x3bffaf=_['merge']({},_0x3bffaf,_0x3fb96c['options']);return _0x26eb2a['getMessages'](_0x3bffaf);}})[_0x0b14('0x2b')](function(_0x513f75){if(_0x513f75){_0x3b5a7a=_0x513f75[_0x0b14('0x5a')];if(!_0x3fb96c['query'][_0x0b14('0x3b')]('nolimit')){_0x3bffaf[_0x0b14('0x23')]=qs[_0x0b14('0x23')](_0x3fb96c[_0x0b14('0x35')]['limit']);_0x3bffaf[_0x0b14('0x25')]=qs[_0x0b14('0x25')](_0x3fb96c['query']['offset']);}return _0x26eb2a['getMessages'](_0x3bffaf);}})[_0x0b14('0x2b')](function(_0x3e013b){if(_0x3e013b){return _0x3e013b?{'count':_0x3b5a7a,'rows':_0x3e013b}:null;}})[_0x0b14('0x2b')](respondWithResult(_0x4d1eb5,null))[_0x0b14('0x47')](handleError(_0x4d1eb5,null));};
\ No newline at end of file
diff --git a/server/api/chatGroup/chatGroup.events.js b/server/api/chatGroup/chatGroup.events.js
index e772693..224a880 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 _0xf470=['hasOwnProperty','hook','exports','events','../../mysqldb','ChatGroup','setMaxListeners','save','update','emit'];(function(_0x3e8c0f,_0x3637c1){var _0x5a3f90=function(_0x59933d){while(--_0x59933d){_0x3e8c0f['push'](_0x3e8c0f['shift']());}};_0x5a3f90(++_0x3637c1);}(_0xf470,0xfd));var _0x0f47=function(_0x2fc012,_0x503e5b){_0x2fc012=_0x2fc012-0x0;var _0x2891f9=_0xf470[_0x2fc012];return _0x2891f9;};'use strict';var EventEmitter=require(_0x0f47('0x0'));var ChatGroup=require(_0x0f47('0x1'))['db'][_0x0f47('0x2')];var ChatGroupEvents=new EventEmitter();ChatGroupEvents[_0x0f47('0x3')](0x0);var events={'afterCreate':_0x0f47('0x4'),'afterUpdate':_0x0f47('0x5'),'afterDestroy':'remove'};function emitEvent(_0x8fd765){return function(_0x3e20a3,_0x493828,_0x1b6cfc){ChatGroupEvents[_0x0f47('0x6')](_0x8fd765+':'+_0x3e20a3['id'],_0x3e20a3);ChatGroupEvents[_0x0f47('0x6')](_0x8fd765,_0x3e20a3);_0x1b6cfc(null);};}for(var e in events){if(events[_0x0f47('0x7')](e)){var event=events[e];ChatGroup[_0x0f47('0x8')](e,emitEvent(event));}}module[_0x0f47('0x9')]=ChatGroupEvents;
\ No newline at end of file
+var _0x9790=['exports','events','../../mysqldb','save','update','remove','emit','hook'];(function(_0x12f934,_0x2bc2ec){var _0x3a0eb4=function(_0x382da6){while(--_0x382da6){_0x12f934['push'](_0x12f934['shift']());}};_0x3a0eb4(++_0x2bc2ec);}(_0x9790,0xc1));var _0x0979=function(_0x1d36d5,_0x261e4d){_0x1d36d5=_0x1d36d5-0x0;var _0x1c583c=_0x9790[_0x1d36d5];return _0x1c583c;};'use strict';var EventEmitter=require(_0x0979('0x0'));var ChatGroup=require(_0x0979('0x1'))['db']['ChatGroup'];var ChatGroupEvents=new EventEmitter();ChatGroupEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x0979('0x2'),'afterUpdate':_0x0979('0x3'),'afterDestroy':_0x0979('0x4')};function emitEvent(_0x4c512a){return function(_0x4316f1,_0x4f2e67,_0x16f7b8){ChatGroupEvents[_0x0979('0x5')](_0x4c512a+':'+_0x4316f1['id'],_0x4316f1);ChatGroupEvents[_0x0979('0x5')](_0x4c512a,_0x4316f1);_0x16f7b8(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];ChatGroup[_0x0979('0x6')](e,emitEvent(event));}}module[_0x0979('0x7')]=ChatGroupEvents;
\ No newline at end of file
diff --git a/server/api/chatGroup/chatGroup.model.js b/server/api/chatGroup/chatGroup.model.js
index 25633ac..3a82011 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 _0x295c=['path','../../config/environment','./chatGroup.attributes','exports','define','chat_groups','lodash','util','../../config/logger','api','bluebird','request-promise'];(function(_0x1cc8fe,_0x105328){var _0x230054=function(_0x1a1b56){while(--_0x1a1b56){_0x1cc8fe['push'](_0x1cc8fe['shift']());}};_0x230054(++_0x105328);}(_0x295c,0x1da));var _0xc295=function(_0x42a6ec,_0x49d1dd){_0x42a6ec=_0x42a6ec-0x0;var _0x18bd7f=_0x295c[_0x42a6ec];return _0x18bd7f;};'use strict';var _=require(_0xc295('0x0'));var util=require(_0xc295('0x1'));var logger=require(_0xc295('0x2'))(_0xc295('0x3'));var moment=require('moment');var BPromise=require(_0xc295('0x4'));var rp=require(_0xc295('0x5'));var fs=require('fs');var path=require(_0xc295('0x6'));var rimraf=require('rimraf');var config=require(_0xc295('0x7'));var attributes=require(_0xc295('0x8'));module[_0xc295('0x9')]=function(_0x48d89c,_0x56b0b6){return _0x48d89c[_0xc295('0xa')]('ChatGroup',attributes,{'tableName':_0xc295('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x1dfa=['../../config/logger','moment','bluebird','path','../../config/environment','./chatGroup.attributes','exports','define','lodash'];(function(_0x2c91e9,_0x2fb965){var _0x13f0ff=function(_0xb39edf){while(--_0xb39edf){_0x2c91e9['push'](_0x2c91e9['shift']());}};_0x13f0ff(++_0x2fb965);}(_0x1dfa,0xb3));var _0xa1df=function(_0x5037ab,_0x43209e){_0x5037ab=_0x5037ab-0x0;var _0x512adb=_0x1dfa[_0x5037ab];return _0x512adb;};'use strict';var _=require(_0xa1df('0x0'));var util=require('util');var logger=require(_0xa1df('0x1'))('api');var moment=require(_0xa1df('0x2'));var BPromise=require(_0xa1df('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xa1df('0x4'));var rimraf=require('rimraf');var config=require(_0xa1df('0x5'));var attributes=require(_0xa1df('0x6'));module[_0xa1df('0x7')]=function(_0xb6a3e,_0x4f55d1){return _0xb6a3e[_0xa1df('0x8')]('ChatGroup',attributes,{'tableName':'chat_groups','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
diff --git a/server/api/chatGroup/chatGroup.rpc.js b/server/api/chatGroup/chatGroup.rpc.js
index a73d517..7868ec2 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 _0xbcc7=['then','info','ChatGroup,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','lodash','util','bluebird','../../mysqldb','../../config/logger','rpc','jayson/promise','client','http','redis','defaults','socket.io-emitter','./chatGroup.socket','register','request'];(function(_0x3ab136,_0x5d1e7e){var _0xb015df=function(_0x511901){while(--_0x511901){_0x3ab136['push'](_0x3ab136['shift']());}};_0xb015df(++_0x5d1e7e);}(_0xbcc7,0x19a));var _0x7bcc=function(_0x131598,_0x332e0d){_0x131598=_0x131598-0x0;var _0x36d7df=_0xbcc7[_0x131598];return _0x36d7df;};'use strict';var _=require(_0x7bcc('0x0'));var util=require(_0x7bcc('0x1'));var moment=require('moment');var BPromise=require(_0x7bcc('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x7bcc('0x3'))['db'];var utils=require('../../config/utils');var logger=require(_0x7bcc('0x4'))(_0x7bcc('0x5'));var config=require('../../config/environment');var jayson=require(_0x7bcc('0x6'));var client=jayson[_0x7bcc('0x7')][_0x7bcc('0x8')]({'port':0x232a});config[_0x7bcc('0x9')]=_[_0x7bcc('0xa')](config[_0x7bcc('0x9')],{'host':'localhost','port':0x18eb});var socket=require(_0x7bcc('0xb'))(new Redis(config['redis']));require(_0x7bcc('0xc'))[_0x7bcc('0xd')](socket);function respondWithRpcPromise(_0x4c38fa,_0x225f39,_0x54fa3d){return new BPromise(function(_0x58e035,_0x5c4a28){return client[_0x7bcc('0xe')](_0x4c38fa,_0x54fa3d)[_0x7bcc('0xf')](function(_0xb3207){logger[_0x7bcc('0x10')](_0x7bcc('0x11'),_0x225f39,_0x7bcc('0x12'));logger[_0x7bcc('0x13')]('ChatGroup,\x20%s,\x20%s,\x20%s',_0x225f39,_0x7bcc('0x12'),JSON[_0x7bcc('0x14')](_0xb3207));if(_0xb3207[_0x7bcc('0x15')]){if(_0xb3207[_0x7bcc('0x15')][_0x7bcc('0x16')]===0x1f4){logger[_0x7bcc('0x15')]('ChatGroup,\x20%s,\x20%s',_0x225f39,_0xb3207[_0x7bcc('0x15')][_0x7bcc('0x17')]);return _0x5c4a28(_0xb3207[_0x7bcc('0x15')][_0x7bcc('0x17')]);}logger[_0x7bcc('0x15')](_0x7bcc('0x11'),_0x225f39,_0xb3207[_0x7bcc('0x15')]['message']);return _0x58e035(_0xb3207[_0x7bcc('0x15')]['message']);}else{logger[_0x7bcc('0x10')](_0x7bcc('0x11'),_0x225f39,_0x7bcc('0x12'));_0x58e035(_0xb3207[_0x7bcc('0x18')]['message']);}})['catch'](function(_0xbab5b6){logger[_0x7bcc('0x15')](_0x7bcc('0x11'),_0x225f39,_0xbab5b6);_0x5c4a28(_0xbab5b6);});});}
\ No newline at end of file
+var _0x548b=['randomstring','ioredis','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','./chatGroup.socket','register','info','ChatGroup,\x20%s,\x20%s','debug','ChatGroup,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','lodash','moment','bluebird'];(function(_0x348c09,_0x539458){var _0x22d339=function(_0x3be039){while(--_0x3be039){_0x348c09['push'](_0x348c09['shift']());}};_0x22d339(++_0x539458);}(_0x548b,0x14f));var _0xb548=function(_0xb8d5b6,_0x22ab4b){_0xb8d5b6=_0xb8d5b6-0x0;var _0x4f0b2f=_0x548b[_0xb8d5b6];return _0x4f0b2f;};'use strict';var _=require(_0xb548('0x0'));var util=require('util');var moment=require(_0xb548('0x1'));var BPromise=require(_0xb548('0x2'));var rs=require(_0xb548('0x3'));var fs=require('fs');var Redis=require(_0xb548('0x4'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0xb548('0x5'))(_0xb548('0x6'));var config=require(_0xb548('0x7'));var jayson=require(_0xb548('0x8'));var client=jayson[_0xb548('0x9')][_0xb548('0xa')]({'port':0x232a});config[_0xb548('0xb')]=_[_0xb548('0xc')](config[_0xb548('0xb')],{'host':_0xb548('0xd'),'port':0x18eb});var socket=require(_0xb548('0xe'))(new Redis(config['redis']));require(_0xb548('0xf'))[_0xb548('0x10')](socket);function respondWithRpcPromise(_0x14d205,_0x4afd2e,_0x29c118){return new BPromise(function(_0x3d03d6,_0x4fec63){return client['request'](_0x14d205,_0x29c118)['then'](function(_0x260ecf){logger[_0xb548('0x11')](_0xb548('0x12'),_0x4afd2e,'request\x20sent');logger[_0xb548('0x13')](_0xb548('0x14'),_0x4afd2e,'request\x20sent',JSON[_0xb548('0x15')](_0x260ecf));if(_0x260ecf[_0xb548('0x16')]){if(_0x260ecf[_0xb548('0x16')]['code']===0x1f4){logger[_0xb548('0x16')](_0xb548('0x12'),_0x4afd2e,_0x260ecf[_0xb548('0x16')][_0xb548('0x17')]);return _0x4fec63(_0x260ecf[_0xb548('0x16')]['message']);}logger['error'](_0xb548('0x12'),_0x4afd2e,_0x260ecf['error']['message']);return _0x3d03d6(_0x260ecf['error'][_0xb548('0x17')]);}else{logger['info'](_0xb548('0x12'),_0x4afd2e,'request\x20sent');_0x3d03d6(_0x260ecf[_0xb548('0x18')][_0xb548('0x17')]);}})[_0xb548('0x19')](function(_0x521a3c){logger[_0xb548('0x16')](_0xb548('0x12'),_0x4afd2e,_0x521a3c);_0x4fec63(_0x521a3c);});});}
\ No newline at end of file
diff --git a/server/api/chatGroup/chatGroup.socket.js b/server/api/chatGroup/chatGroup.socket.js
index 0e67a16..a1afcec 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 _0x08d3=['./chatGroup.events','save','remove','update','register','length'];(function(_0xc971a4,_0x5b381c){var _0x4ebd6b=function(_0x371149){while(--_0x371149){_0xc971a4['push'](_0xc971a4['shift']());}};_0x4ebd6b(++_0x5b381c);}(_0x08d3,0xf0));var _0x308d=function(_0x55644a,_0x227184){_0x55644a=_0x55644a-0x0;var _0x2b0918=_0x08d3[_0x55644a];return _0x2b0918;};'use strict';var ChatGroupEvents=require(_0x308d('0x0'));var events=[_0x308d('0x1'),_0x308d('0x2'),_0x308d('0x3')];function createListener(_0x24ac3a,_0x4bb560){return function(_0x1f48b9){_0x4bb560['emit'](_0x24ac3a,_0x1f48b9);};}function removeListener(_0x68a43e,_0x39b31d){return function(){ChatGroupEvents['removeListener'](_0x68a43e,_0x39b31d);};}exports[_0x308d('0x4')]=function(_0x3ea655){for(var _0x35e860=0x0,_0x3f040e=events[_0x308d('0x5')];_0x35e860<_0x3f040e;_0x35e860++){var _0x534eab=events[_0x35e860];var _0x489abf=createListener('chatGroup:'+_0x534eab,_0x3ea655);ChatGroupEvents['on'](_0x534eab,_0x489abf);}};
\ No newline at end of file
+var _0x63bf=['chatGroup:','./chatGroup.events','remove','update','emit','removeListener','register','length'];(function(_0x464470,_0x3439e7){var _0xae7c25=function(_0x44e58e){while(--_0x44e58e){_0x464470['push'](_0x464470['shift']());}};_0xae7c25(++_0x3439e7);}(_0x63bf,0x199));var _0xf63b=function(_0x2f0b27,_0x3e7ee2){_0x2f0b27=_0x2f0b27-0x0;var _0x2acf69=_0x63bf[_0x2f0b27];return _0x2acf69;};'use strict';var ChatGroupEvents=require(_0xf63b('0x0'));var events=['save',_0xf63b('0x1'),_0xf63b('0x2')];function createListener(_0x56f8eb,_0x29b7f8){return function(_0x22a5db){_0x29b7f8[_0xf63b('0x3')](_0x56f8eb,_0x22a5db);};}function removeListener(_0x9dfee8,_0x12912e){return function(){ChatGroupEvents[_0xf63b('0x4')](_0x9dfee8,_0x12912e);};}exports[_0xf63b('0x5')]=function(_0x14fd2e){for(var _0x333aa7=0x0,_0x5f1bb0=events[_0xf63b('0x6')];_0x333aa7<_0x5f1bb0;_0x333aa7++){var _0x51c09b=events[_0x333aa7];var _0x5421f1=createListener(_0xf63b('0x7')+_0x51c09b,_0x14fd2e);ChatGroupEvents['on'](_0x51c09b,_0x5421f1);}};
\ No newline at end of file
diff --git a/server/api/chatGroup/index.js b/server/api/chatGroup/index.js
index 8f1bbc9..1b12dcd 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 _0x6847=['isAuthenticated','describe','/:id','show','/:id/unread','/:id/members','getMembers','/:id/messages','getMessages','post','create','addMembers','addMessage','put','delete','removeMembers','exports','multer','util','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','get','/describe'];(function(_0x2bb59b,_0x55cdbd){var _0x347c20=function(_0x1ab038){while(--_0x1ab038){_0x2bb59b['push'](_0x2bb59b['shift']());}};_0x347c20(++_0x55cdbd);}(_0x6847,0x12f));var _0x7684=function(_0x166d93,_0x301f09){_0x166d93=_0x166d93-0x0;var _0xba708=_0x6847[_0x166d93];return _0xba708;};'use strict';var multer=require(_0x7684('0x0'));var util=require(_0x7684('0x1'));var path=require('path');var timeout=require(_0x7684('0x2'));var express=require('express');var router=express[_0x7684('0x3')]();var fs_extra=require(_0x7684('0x4'));var auth=require(_0x7684('0x5'));var interaction=require(_0x7684('0x6'));var config=require('../../config/environment');var controller=require('./chatGroup.controller');router[_0x7684('0x7')]('/',auth['isAuthenticated'](),controller['index']);router[_0x7684('0x7')](_0x7684('0x8'),auth[_0x7684('0x9')](),controller[_0x7684('0xa')]);router[_0x7684('0x7')](_0x7684('0xb'),auth[_0x7684('0x9')](),controller[_0x7684('0xc')]);router[_0x7684('0x7')](_0x7684('0xd'),auth[_0x7684('0x9')](),controller['getUnread']);router[_0x7684('0x7')](_0x7684('0xe'),auth[_0x7684('0x9')](),controller[_0x7684('0xf')]);router[_0x7684('0x7')](_0x7684('0x10'),auth[_0x7684('0x9')](),controller[_0x7684('0x11')]);router[_0x7684('0x12')]('/',auth[_0x7684('0x9')](),controller[_0x7684('0x13')]);router['post'](_0x7684('0xe'),auth[_0x7684('0x9')](),controller[_0x7684('0x14')]);router[_0x7684('0x12')](_0x7684('0x10'),auth[_0x7684('0x9')](),controller[_0x7684('0x15')]);router[_0x7684('0x16')](_0x7684('0xb'),auth['isAuthenticated'](),controller['update']);router[_0x7684('0x17')](_0x7684('0xb'),auth[_0x7684('0x9')](),controller['destroy']);router[_0x7684('0x17')](_0x7684('0xe'),auth['isAuthenticated'](),controller[_0x7684('0x18')]);module[_0x7684('0x19')]=router;
\ No newline at end of file
+var _0x2a44=['/:id/members','getMembers','/:id/messages','getMessages','post','create','addMembers','addMessage','delete','removeMembers','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatGroup.controller','get','index','/describe','describe','/:id','isAuthenticated','show','/:id/unread','getUnread'];(function(_0x203d1e,_0x2166de){var _0x4b086d=function(_0x5c1bd0){while(--_0x5c1bd0){_0x203d1e['push'](_0x203d1e['shift']());}};_0x4b086d(++_0x2166de);}(_0x2a44,0xbe));var _0x42a4=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x2a44[_0x14add3];return _0x4a174f;};'use strict';var multer=require(_0x42a4('0x0'));var util=require(_0x42a4('0x1'));var path=require(_0x42a4('0x2'));var timeout=require(_0x42a4('0x3'));var express=require(_0x42a4('0x4'));var router=express[_0x42a4('0x5')]();var fs_extra=require(_0x42a4('0x6'));var auth=require(_0x42a4('0x7'));var interaction=require(_0x42a4('0x8'));var config=require(_0x42a4('0x9'));var controller=require(_0x42a4('0xa'));router[_0x42a4('0xb')]('/',auth['isAuthenticated'](),controller[_0x42a4('0xc')]);router[_0x42a4('0xb')](_0x42a4('0xd'),auth['isAuthenticated'](),controller[_0x42a4('0xe')]);router[_0x42a4('0xb')](_0x42a4('0xf'),auth[_0x42a4('0x10')](),controller[_0x42a4('0x11')]);router[_0x42a4('0xb')](_0x42a4('0x12'),auth[_0x42a4('0x10')](),controller[_0x42a4('0x13')]);router[_0x42a4('0xb')](_0x42a4('0x14'),auth[_0x42a4('0x10')](),controller[_0x42a4('0x15')]);router[_0x42a4('0xb')](_0x42a4('0x16'),auth[_0x42a4('0x10')](),controller[_0x42a4('0x17')]);router[_0x42a4('0x18')]('/',auth['isAuthenticated'](),controller[_0x42a4('0x19')]);router[_0x42a4('0x18')](_0x42a4('0x14'),auth[_0x42a4('0x10')](),controller[_0x42a4('0x1a')]);router['post'](_0x42a4('0x16'),auth[_0x42a4('0x10')](),controller[_0x42a4('0x1b')]);router['put'](_0x42a4('0xf'),auth[_0x42a4('0x10')](),controller['update']);router[_0x42a4('0x1c')]('/:id',auth[_0x42a4('0x10')](),controller['destroy']);router['delete'](_0x42a4('0x14'),auth['isAuthenticated'](),controller[_0x42a4('0x1d')]);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 fefa09c..502fa93 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 _0x4899=['star','TEXT','STRING','long','DATE','out','sequelize','BOOLEAN','ENUM','thumb'];(function(_0x287a0c,_0xa5cbc5){var _0x1233eb=function(_0x3f3c0c){while(--_0x3f3c0c){_0x287a0c['push'](_0x287a0c['shift']());}};_0x1233eb(++_0xa5cbc5);}(_0x4899,0x74));var _0x9489=function(_0x3258ca,_0x28e8f2){_0x3258ca=_0x3258ca-0x0;var _0xc3f176=_0x4899[_0x3258ca];return _0xc3f176;};'use strict';var Sequelize=require(_0x9489('0x0'));module['exports']={'closed':{'type':Sequelize[_0x9489('0x1')],'defaultValue':![]},'ratingValue':{'type':Sequelize['INTEGER']},'ratingType':{'type':Sequelize[_0x9489('0x2')]('star',_0x9489('0x3')),'defaultValue':_0x9489('0x4')},'ratingMessage':{'type':Sequelize[_0x9489('0x5')]},'pathTranscript':{'type':Sequelize[_0x9489('0x5')]},'mailTranscript':{'type':Sequelize[_0x9489('0x6')],'validate':{'isEmail':!![]}},'closedAt':{'type':Sequelize['DATE']},'disposition':{'type':Sequelize[_0x9489('0x6')]},'secondDisposition':{'type':Sequelize[_0x9489('0x6')]},'thirdDisposition':{'type':Sequelize[_0x9489('0x6')]},'note':{'type':Sequelize[_0x9489('0x6')]},'browserName':{'type':Sequelize['STRING']},'browserVersion':{'type':Sequelize['STRING']},'osName':{'type':Sequelize[_0x9489('0x6')]},'osVersion':{'type':Sequelize['STRING']},'deviceModel':{'type':Sequelize[_0x9489('0x6')]},'deviceVendor':{'type':Sequelize[_0x9489('0x6')]},'deviceType':{'type':Sequelize['STRING']},'referer':{'type':Sequelize[_0x9489('0x5')]},'customerIp':{'type':Sequelize[_0x9489('0x6')]},'formData':{'type':Sequelize[_0x9489('0x5')](_0x9489('0x7'))},'read1stAt':{'type':Sequelize[_0x9489('0x8')]},'lastMsgAt':{'type':Sequelize[_0x9489('0x8')]},'lastMsgDirection':{'type':Sequelize[_0x9489('0x2')]('in',_0x9489('0x9')),'defaultValue':'in','allowNull':![]},'closeReason':{'type':Sequelize['STRING']},'customerPort':{'type':Sequelize[_0x9489('0x6')]},'vidaooSessionId':{'type':Sequelize[_0x9489('0x5')]},'autoreplyExecuted':{'type':Sequelize[_0x9489('0x1')],'defaultValue':![]}};
\ No newline at end of file
+var _0x1619=['DATE','BOOLEAN','ENUM','star','thumb','TEXT','STRING','long'];(function(_0x42fac1,_0x38fa53){var _0x286b82=function(_0x5938e8){while(--_0x5938e8){_0x42fac1['push'](_0x42fac1['shift']());}};_0x286b82(++_0x38fa53);}(_0x1619,0x189));var _0x9161=function(_0x1e29cc,_0x4b668a){_0x1e29cc=_0x1e29cc-0x0;var _0x25fabb=_0x1619[_0x1e29cc];return _0x25fabb;};'use strict';var Sequelize=require('sequelize');module['exports']={'closed':{'type':Sequelize[_0x9161('0x0')],'defaultValue':![]},'ratingValue':{'type':Sequelize['INTEGER']},'ratingType':{'type':Sequelize[_0x9161('0x1')](_0x9161('0x2'),_0x9161('0x3')),'defaultValue':'star'},'ratingMessage':{'type':Sequelize[_0x9161('0x4')]},'pathTranscript':{'type':Sequelize['TEXT']},'mailTranscript':{'type':Sequelize[_0x9161('0x5')],'validate':{'isEmail':!![]}},'closedAt':{'type':Sequelize['DATE']},'disposition':{'type':Sequelize['STRING']},'secondDisposition':{'type':Sequelize[_0x9161('0x5')]},'thirdDisposition':{'type':Sequelize[_0x9161('0x5')]},'note':{'type':Sequelize['STRING']},'browserName':{'type':Sequelize[_0x9161('0x5')]},'browserVersion':{'type':Sequelize[_0x9161('0x5')]},'osName':{'type':Sequelize['STRING']},'osVersion':{'type':Sequelize[_0x9161('0x5')]},'deviceModel':{'type':Sequelize['STRING']},'deviceVendor':{'type':Sequelize[_0x9161('0x5')]},'deviceType':{'type':Sequelize['STRING']},'referer':{'type':Sequelize[_0x9161('0x4')]},'customerIp':{'type':Sequelize[_0x9161('0x5')]},'formData':{'type':Sequelize[_0x9161('0x4')](_0x9161('0x6'))},'read1stAt':{'type':Sequelize[_0x9161('0x7')]},'lastMsgAt':{'type':Sequelize[_0x9161('0x7')]},'lastMsgDirection':{'type':Sequelize[_0x9161('0x1')]('in','out'),'defaultValue':'in','allowNull':![]},'closeReason':{'type':Sequelize['STRING']},'customerPort':{'type':Sequelize['STRING']},'vidaooSessionId':{'type':Sequelize['TEXT']},'autoreplyExecuted':{'type':Sequelize[_0x9161('0x0')],'defaultValue':![]}};
\ No newline at end of file
diff --git a/server/api/chatInteraction/chatInteraction.controller.js b/server/api/chatInteraction/chatInteraction.controller.js
index ef28100..028cf6f 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 _0xb10b=['querystring','papaparse','ioredis','../../components/auth/service','../../components/export/pdf','../../config/license/hardware','../../config/logger','../../config/utils','../../config/license/util','../../mysqldb','redis','defaults','localhost','./chatInteraction.socket','register','jayson/promise','client','http','request','then','info','ChatInteraction,\x20%s,\x20%s','request\x20sent','ChatInteraction,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','sendStatus','status','end','offset','undefined','count','Content-Range','json','apply','reject','update','stack','name','send','body','contact','interaction','account','Users','map','fullname','TagIds','Tags','forEach','push','index','ChatInteraction','rawAttributes','fieldName','type','key','model','query','filters','attributes','intersection','fields','length','hasOwnProperty','nolimit','limit','sort','where','pick','select','field','color','tools_tags','u.id','u.fullname','ui.ChatInteractionId','from','user_has_chat_interactions','left_join','users','u.id\x20=\x20ui.UserId','cm_contacts','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','t.id\x20=\x20it.TagId','expr','search','sqlOperator','conditions','unreadMessages','value','having','`\x20>\x200','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?','find','ContactId','text','start','Tag','CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','union','User','UserId','buildExpression','some','ChatWebsiteId','i.ChatWebsiteId\x20IN\x20?','concat','createdAt','parse','$gte','$lte','i.createdAt\x20BETWEEN\x20?\x20AND\x20?','null','\x20IS\x20NULL','read','`unreadMessages`\x20=\x200','tag','isArray','filter','replace','isNumeric','MATCH\x20(me.body)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','CONCAT(c.firstName,\x20\x27\x20\x27,\x20c.lastName)\x20LIKE\x20?','group','Sequelize','QueryTypes','SELECT','clone','SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)','order','contactName','DESC','isEmpty','resolve','i.ChatWebsiteId\x20IS\x20NOT\x20NULL','user','role','agent','i.ChatWebsiteId\x20IS\x20NULL','sequelize','toString','keyBy','merge','a.key','Account.key','a.mandatoryDisposition','Account.mandatoryDisposition','CASE\x20WHEN\x20(c.firstName\x20IS\x20NOT\x20NULL\x20AND\x20c.firstName\x20<>\x20\x27\x27)\x20OR\x20(c.lastName\x20IS\x20NOT\x20NULL\x20AND\x20c.lastName\x20<>\x20\x27\x27)\x20THEN\x20CONCAT(IFNULL(c.firstName,\x20\x27\x27),\x20\x27\x20\x27,\x20IFNULL(c.lastName,\x20\x27\x27))\x20ELSE\x20\x27Unknown\x27\x20END','i.*','c.firstName','c.lastName','Contact.lastName','c.email','c.phone','Contact.phone','c.mobile','Contact.mobile','Contact.fax','o.fullname','o.internal','GROUP_CONCAT(DISTINCT\x20t.id)','ui.ChatInteractionId\x20IN\x20?','groupBy','ChatInteractionId','all','rows','catch','show','params','keys','includeAll','include','options','create','describe','createVidaooSession','findOne','ChatWebsite','vidaooApiKey','vidaooEscalation','vidaooNote','email','https://api-vidaoo.xcally.com/api/v1/meetings','vidaooTopic','isNull','follow','ValidationError','Error\x20in\x20conversion\x20vidaooMetadata','join_url','out','ChatMessage','Unable\x20to\x20create\x20Vidaoo\x20session','updateAttributes','CmContact','abandon','abandonInteraction,\x20%s,\x20%s,\x20%s','entity\x20not\x20found','Interaction\x20already\x20assigned','AbandonInteraction','attachmentUpload','file','filename','mimetype','attachmentDownload','closed','Unauthorized','Attachment','attachId','ChatOfflineMessageId','join','server/files/attachments/','offline-chat/','basename','close','mailTranscript','root','now','Messages','format','%s%d','System','customer','Visitor','agentIdentifier','website_alias','agentAlias','direction','secret','appendFileSync','MailAccount','MailServerOut','Smtp','service','host','port','secure','authentication','sendMail','\x22%s\x22\x20<%s>','Hi\x20%s,\x20attached\x20you\x20can\x20find\x20your\x20transcript\x20file.\x20\x0a\x0aRegards.\x20\x0a\x0a','ids','omit','getMessages','split','YYYY-MM-DD\x20HH:mm:ss','includeAgent','alias','findAll','setTags','chatInteractionTags:save','removeTags','unix','server','files','tmp','attachments','transcript-%d-%s.zip','Contact','firstName','lastName','Account','Owner','get','mkdirSync','Chat','N.A.','disposition','osName','referer','customerPort','tail','existsSync','pipe','createWriteStream','views','downloadInteraction.ejs','transcript-','.pdf','createPdfFromHTML','download','log','err','unlinkSync','eml-format','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','to-csv','fs-extra','lodash','crypto','jsforce','desk.js'];(function(_0x27dc8d,_0x1f0639){var _0x3f7fd4=function(_0x3ca25d){while(--_0x3ca25d){_0x27dc8d['push'](_0x27dc8d['shift']());}};_0x3f7fd4(++_0x1f0639);}(_0xb10b,0x12a));var _0xbb10=function(_0x21ecd6,_0x53e0a6){_0x21ecd6=_0x21ecd6-0x0;var _0x5b2b5a=_0xb10b[_0x21ecd6];return _0x5b2b5a;};'use strict';var emlformat=require(_0xbb10('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xbb10('0x1'));var jsonpatch=require(_0xbb10('0x2'));var rp=require(_0xbb10('0x3'));var moment=require('moment');var BPromise=require(_0xbb10('0x4'));var Mustache=require(_0xbb10('0x5'));var util=require(_0xbb10('0x6'));var path=require(_0xbb10('0x7'));var sox=require(_0xbb10('0x8'));var csv=require(_0xbb10('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xbb10('0xa'));var _=require(_0xbb10('0xb'));var squel=require('squel');var crypto=require(_0xbb10('0xc'));var jsforce=require(_0xbb10('0xd'));var deskjs=require(_0xbb10('0xe'));var toCsv=require(_0xbb10('0x9'));var querystring=require(_0xbb10('0xf'));var Papa=require(_0xbb10('0x10'));var Redis=require(_0xbb10('0x11'));var authService=require(_0xbb10('0x12'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var pdf=require(_0xbb10('0x13'));var hardwareService=require(_0xbb10('0x14'));var logger=require(_0xbb10('0x15'))('api');var utils=require(_0xbb10('0x16'));var config=require('../../config/environment');var licenseUtil=require(_0xbb10('0x17'));var db=require(_0xbb10('0x18'))['db'];config[_0xbb10('0x19')]=_[_0xbb10('0x1a')](config[_0xbb10('0x19')],{'host':_0xbb10('0x1b'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xbb10('0x19')]));require(_0xbb10('0x1c'))[_0xbb10('0x1d')](socket);var jayson=require(_0xbb10('0x1e'));var client=jayson[_0xbb10('0x1f')][_0xbb10('0x20')]({'port':0x232b});var client9004=jayson[_0xbb10('0x1f')][_0xbb10('0x20')]({'port':0x232c});function respondWithRpcPromise(_0x3e26f4,_0x2b184e,_0x4a2bfc,_0x2eca0f){return new BPromise(function(_0x1145f1,_0x133ac2){var _0x42db98=_0x2eca0f||client;return _0x42db98[_0xbb10('0x21')](_0x3e26f4,_0x4a2bfc)[_0xbb10('0x22')](function(_0x575cca){logger[_0xbb10('0x23')](_0xbb10('0x24'),_0x2b184e,_0xbb10('0x25'));logger['debug'](_0xbb10('0x26'),_0x2b184e,_0xbb10('0x25'),JSON[_0xbb10('0x27')](_0x575cca));if(_0x575cca[_0xbb10('0x28')]){if(_0x575cca[_0xbb10('0x28')][_0xbb10('0x29')]===0x1f4){logger['error'](_0xbb10('0x24'),_0x2b184e,_0x575cca[_0xbb10('0x28')]['message']);return _0x133ac2(_0x575cca['error'][_0xbb10('0x2a')]);}logger[_0xbb10('0x28')](_0xbb10('0x24'),_0x2b184e,_0x575cca[_0xbb10('0x28')][_0xbb10('0x2a')]);return _0x1145f1(_0x575cca[_0xbb10('0x28')][_0xbb10('0x2a')]);}else{logger[_0xbb10('0x23')](_0xbb10('0x24'),_0x2b184e,_0xbb10('0x25'));_0x1145f1(_0x575cca[_0xbb10('0x2b')][_0xbb10('0x2a')]);}})['catch'](function(_0x4fedac){logger['error'](_0xbb10('0x24'),_0x2b184e,_0x4fedac);_0x133ac2(_0x4fedac);});});}function respondWithStatusCode(_0x3c5ae7,_0x2c89b9){_0x2c89b9=_0x2c89b9||0xcc;return function(_0x4e25ff){if(_0x4e25ff){return _0x3c5ae7[_0xbb10('0x2c')](_0x2c89b9);}return _0x3c5ae7[_0xbb10('0x2d')](_0x2c89b9)[_0xbb10('0x2e')]();};}function respondWithResult(_0x1d5e95,_0x1acce9){_0x1acce9=_0x1acce9||0xc8;return function(_0x20d946){if(_0x20d946){return _0x1d5e95[_0xbb10('0x2d')](_0x1acce9)['json'](_0x20d946);}};}function respondWithFilteredResult(_0x3796c7,_0x21ac54){return function(_0xfc3595){if(_0xfc3595){var _0x2e0249=typeof _0x21ac54[_0xbb10('0x2f')]===_0xbb10('0x30')&&typeof _0x21ac54['limit']===_0xbb10('0x30');var _0x4ee02e=_0xfc3595[_0xbb10('0x31')];var _0x56f2da=_0x2e0249?0x0:_0x21ac54[_0xbb10('0x2f')];var _0x1dcc9c=_0x2e0249?_0xfc3595[_0xbb10('0x31')]:_0x21ac54['offset']+_0x21ac54['limit'];var _0x4c3744;if(_0x1dcc9c>=_0x4ee02e){_0x1dcc9c=_0x4ee02e;_0x4c3744=0xc8;}else{_0x4c3744=0xce;}_0x3796c7[_0xbb10('0x2d')](_0x4c3744);return _0x3796c7['set'](_0xbb10('0x32'),_0x56f2da+'-'+_0x1dcc9c+'/'+_0x4ee02e)[_0xbb10('0x33')](_0xfc3595);}return null;};}function patchUpdates(_0x2f653f){return function(_0x1c0b57){try{jsonpatch[_0xbb10('0x34')](_0x1c0b57,_0x2f653f,!![]);}catch(_0x138bc6){return BPromise[_0xbb10('0x35')](_0x138bc6);}return _0x1c0b57['save']();};}function saveUpdates(_0x25acb3,_0x1da9c9){return function(_0x441d15){if(_0x441d15){return _0x441d15[_0xbb10('0x36')](_0x25acb3)[_0xbb10('0x22')](function(_0x9de708){return _0x9de708;});}return null;};}function removeEntity(_0x188cbd,_0x10202c){return function(_0x3c8d7d){if(_0x3c8d7d){return _0x3c8d7d['destroy']()[_0xbb10('0x22')](function(){_0x188cbd[_0xbb10('0x2d')](0xcc)[_0xbb10('0x2e')]();});}};}function handleEntityNotFound(_0x3c3c45,_0x570f5a){return function(_0x111762){if(!_0x111762){_0x3c3c45['sendStatus'](0x194);}return _0x111762;};}function handleError(_0x4e2754,_0x3eb3cc){_0x3eb3cc=_0x3eb3cc||0x1f4;return function(_0x40c164){logger[_0xbb10('0x28')](_0x40c164[_0xbb10('0x37')]);if(_0x40c164[_0xbb10('0x38')]){delete _0x40c164[_0xbb10('0x38')];}_0x4e2754['status'](_0x3eb3cc)[_0xbb10('0x39')](_0x40c164);};}function getMustacheRender(_0x25d72f,_0x52de31){return Mustache['render'](_0x25d72f,_['merge'](_0x52de31[_0xbb10('0x3a')],{'contact':_0x52de31[_0xbb10('0x3b')],'message':_0x52de31[_0xbb10('0x2a')],'agent':_0x52de31['agent'],'interaction':_0x52de31[_0xbb10('0x3c')],'account':_0x52de31[_0xbb10('0x3d')]}))||'';}function getInteractionUsers(_0x4345f3,_0x4d1a83){return new BPromise(function(_0x17b6c5,_0x12238a){try{if(_0x4d1a83[_0x4345f3['id']]){_0x4345f3[_0xbb10('0x3e')]=_[_0xbb10('0x3f')](_0x4d1a83[_0x4345f3['id']],function(_0x4f1cdd){return{'id':_0x4f1cdd['id'],'fullname':_0x4f1cdd[_0xbb10('0x40')]};});}}catch(_0x110eb5){_0x12238a(_0x110eb5);}_0x17b6c5(_0x4345f3);});}function getInteractionTags(_0x5835fd,_0xe2040f){return new BPromise(function(_0x2e3214,_0x44d6ae){try{if(_0x5835fd[_0xbb10('0x41')]){_0x5835fd[_0xbb10('0x42')]=[];_0x5835fd[_0xbb10('0x41')]['split'](',')[_0xbb10('0x43')](function(_0x1c7fae){_0x5835fd[_0xbb10('0x42')][_0xbb10('0x44')](_0xe2040f[_0x1c7fae]);});}delete _0x5835fd['TagIds'];}catch(_0x3fff6c){_0x44d6ae(_0x3fff6c);}_0x2e3214(_0x5835fd);});}function updateChatInteraction(_0x331751,_0x23dc18,_0x403beb){return new BPromise(function(_0x5e2cfa,_0x351484){return getInteractionUsers(_0x331751,_0x403beb)[_0xbb10('0x22')](function(_0x54ac18){return getInteractionTags(_0x54ac18,_0x23dc18);})['then'](function(_0x38d78f){_0x5e2cfa(_0x38d78f);})['catch'](function(_0x318984){_0x351484(_0x318984);});});}exports[_0xbb10('0x45')]=function(_0x4c66d8,_0x366608){var _0x1d82bf={},_0x474e99={},_0x5cf4f8={'count':0x0,'rows':[]};var _0x2dd02b=_[_0xbb10('0x3f')](db[_0xbb10('0x46')][_0xbb10('0x47')],function(_0x36e1fa){return{'name':_0x36e1fa[_0xbb10('0x48')],'type':_0x36e1fa[_0xbb10('0x49')][_0xbb10('0x4a')]};});_0x474e99[_0xbb10('0x4b')]=_[_0xbb10('0x3f')](_0x2dd02b,_0xbb10('0x38'));_0x474e99[_0xbb10('0x4c')]=_['keys'](_0x4c66d8[_0xbb10('0x4c')]);_0x474e99[_0xbb10('0x4d')]=_['intersection'](_0x474e99[_0xbb10('0x4b')],_0x474e99[_0xbb10('0x4c')]);_0x1d82bf[_0xbb10('0x4e')]=_[_0xbb10('0x4f')](_0x474e99[_0xbb10('0x4b')],qs[_0xbb10('0x50')](_0x4c66d8[_0xbb10('0x4c')]['fields']));_0x1d82bf['attributes']=_0x1d82bf[_0xbb10('0x4e')][_0xbb10('0x51')]?_0x1d82bf[_0xbb10('0x4e')]:_0x474e99['model'];if(!_0x4c66d8['query'][_0xbb10('0x52')](_0xbb10('0x53'))){_0x1d82bf[_0xbb10('0x54')]=qs[_0xbb10('0x54')](_0x4c66d8[_0xbb10('0x4c')][_0xbb10('0x54')]);_0x1d82bf[_0xbb10('0x2f')]=qs[_0xbb10('0x2f')](_0x4c66d8[_0xbb10('0x4c')][_0xbb10('0x2f')]);}_0x1d82bf['order']=qs['sort'](_0x4c66d8[_0xbb10('0x4c')][_0xbb10('0x55')]);_0x1d82bf[_0xbb10('0x56')]=qs[_0xbb10('0x4d')](_[_0xbb10('0x57')](_0x4c66d8[_0xbb10('0x4c')],_0x474e99[_0xbb10('0x4d')]),_0x2dd02b);var _0x445870=[];var _0x1c0d8f=squel[_0xbb10('0x58')]()[_0xbb10('0x59')]('id')[_0xbb10('0x59')](_0xbb10('0x38'))[_0xbb10('0x59')](_0xbb10('0x5a'))['from'](_0xbb10('0x5b'));var _0x5bd44d=squel[_0xbb10('0x58')]()[_0xbb10('0x59')](_0xbb10('0x5c'))[_0xbb10('0x59')](_0xbb10('0x5d'))[_0xbb10('0x59')](_0xbb10('0x5e'))[_0xbb10('0x5f')](_0xbb10('0x60'),'ui')[_0xbb10('0x61')](_0xbb10('0x62'),'u',_0xbb10('0x63'));var _0x1d49e1=squel[_0xbb10('0x58')]()[_0xbb10('0x5f')]('chat_interactions','i')[_0xbb10('0x61')](_0xbb10('0x64'),'c',_0xbb10('0x65'))[_0xbb10('0x61')](_0xbb10('0x62'),'o',_0xbb10('0x66'))['left_join'](_0xbb10('0x67'),'a',_0xbb10('0x68'))[_0xbb10('0x61')](_0xbb10('0x69'),'me',_0xbb10('0x6a'))[_0xbb10('0x61')](_0xbb10('0x6b'),'it',_0xbb10('0x6c'))[_0xbb10('0x61')](_0xbb10('0x5b'),'t',_0xbb10('0x6d'));var _0x2a1ce1=squel[_0xbb10('0x6e')]();var _0x4e7fac=[];var _0x4ea1a6=squel[_0xbb10('0x6e')]();var _0x3e6338;if(_0x4c66d8[_0xbb10('0x4c')][_0xbb10('0x6f')]){_0x3e6338=as['parseSearch'](_0x4c66d8['query'][_0xbb10('0x6f')]);var _0xaf2cc3=_0x3e6338[_0xbb10('0x70')];for(var _0x2dd150=0x0;_0x2dd150<_0x3e6338[_0xbb10('0x71')][_0xbb10('0x51')];_0x2dd150++){var _0x45c0dc=_0x3e6338['conditions'][_0x2dd150];var _0x117e84='i';var _0x216cff=_['find'](_0x2dd02b,['name',_0x45c0dc['field']]);if(!_0x216cff){switch(_0x45c0dc[_0xbb10('0x59')]){case _0xbb10('0x72'):if(_0x45c0dc[_0xbb10('0x73')]==0x1){_0x1d49e1['having']('`'+_0x45c0dc['field']+'`\x20=\x200');}else{_0x1d49e1[_0xbb10('0x74')]('`'+_0x45c0dc[_0xbb10('0x59')]+_0xbb10('0x75'));}break;case'Contact':if(_0x45c0dc[_0xbb10('0x76')]===_0xbb10('0x77')){if(_0x45c0dc['value']['split']('\x20')[_0xbb10('0x51')]>0x1){_0x2a1ce1[_0xaf2cc3](_0xbb10('0x78'),qs[_0xbb10('0x79')](_0x45c0dc[_0xbb10('0x73')]),null);}else{var _0x54b7c5='%'+_0x45c0dc[_0xbb10('0x73')]+'%';_0x2a1ce1[_0xaf2cc3](_0xbb10('0x7a'),_0x54b7c5,_0x54b7c5,_0x54b7c5);}}else{_0x216cff=_[_0xbb10('0x7b')](_0x2dd02b,['name',_0xbb10('0x7c')]);_0x45c0dc[_0xbb10('0x59')]=_0xbb10('0x7c');_0x329da7=as['buildExpression'](_0x117e84,_0x216cff[_0xbb10('0x49')],_0x45c0dc);_0x2a1ce1[_0xaf2cc3](_0x329da7[_0xbb10('0x7d')],_0x329da7[_0xbb10('0x73')][_0xbb10('0x7e')],_0x329da7['value'][_0xbb10('0x2e')]);}break;case _0xbb10('0x7f'):var _0x108e5b=_0x45c0dc[_0xbb10('0x73')]['split'](',')[_0xbb10('0x3f')](function(_0x277fe7){return Number(_0x277fe7);});_0x108e5b[_0xbb10('0x43')](function(_0x2ceb3e){_0x4ea1a6['or'](_0xbb10('0x80'),'%,'+_0x2ceb3e+',%');});_0x4e7fac=_[_0xbb10('0x81')](_0x4e7fac,_0x108e5b);break;case _0xbb10('0x82'):if(_0x45c0dc['operator']==='$substring'){_0x2a1ce1[_0xaf2cc3]('CONCAT_WS(\x27\x20\x27,\x20o.name,\x20o.fullname)\x20LIKE\x20?','%'+_0x45c0dc[_0xbb10('0x73')]+'%',null);}else{_0x216cff=_[_0xbb10('0x7b')](_0x2dd02b,[_0xbb10('0x38'),'UserId']);_0x45c0dc['field']=_0xbb10('0x83');_0x329da7=as[_0xbb10('0x84')](_0x117e84,_0x216cff[_0xbb10('0x49')],_0x45c0dc);_0x2a1ce1[_0xaf2cc3](_0x329da7[_0xbb10('0x7d')],_0x329da7[_0xbb10('0x73')][_0xbb10('0x7e')],_0x329da7['value'][_0xbb10('0x2e')]);}break;case _0xbb10('0x3a'):_0x329da7=as[_0xbb10('0x84')]('me',null,_0x45c0dc);_0x2a1ce1[_0xaf2cc3](_0x329da7[_0xbb10('0x7d')],_0x329da7[_0xbb10('0x73')]['start'],_0x329da7['value']['end']);break;}}else{var _0x329da7=as[_0xbb10('0x84')](_0x117e84,_0x216cff[_0xbb10('0x49')],_0x45c0dc);_0x2a1ce1[_0xaf2cc3](_0x329da7[_0xbb10('0x7d')],_0x329da7[_0xbb10('0x73')][_0xbb10('0x7e')],_0x329da7['value'][_0xbb10('0x2e')]);}}}else{var _0x4bc316=_(_0x4c66d8['query'])['keys']()[_0xbb10('0x3f')](function(_0x13040d){return _[_0xbb10('0x85')](_0x2dd02b,[_0xbb10('0x38'),_0x13040d])?_0x13040d:undefined;})['compact']()[_0xbb10('0x73')]();if(!_['isEmpty'](_0x4bc316)){_0x4bc316['forEach'](function(_0x165fe9){if(_0x165fe9===_0xbb10('0x86')){_0x1d49e1[_0xbb10('0x56')](_0xbb10('0x87'),[][_0xbb10('0x88')](_0x4c66d8['query'][_0x165fe9]));}else if(_0x165fe9===_0xbb10('0x89')){var _0x19fcec=JSON[_0xbb10('0x8a')](_0x4c66d8[_0xbb10('0x4c')][_0x165fe9])[_0xbb10('0x8b')];var _0x27f42f=JSON[_0xbb10('0x8a')](_0x4c66d8['query'][_0x165fe9])[_0xbb10('0x8c')];_0x1d49e1[_0xbb10('0x56')](_0xbb10('0x8d'),_0x19fcec,_0x27f42f);}else{if(_0x4c66d8[_0xbb10('0x4c')][_0x165fe9]===_0xbb10('0x8e')){_0x1d49e1[_0xbb10('0x56')]('i.'+_0x165fe9+_0xbb10('0x8f'));}else{_0x1d49e1[_0xbb10('0x56')]('i.'+_0x165fe9+'\x20=\x20?',_0x4c66d8[_0xbb10('0x4c')][_0x165fe9]);}}});}if(_0x4c66d8[_0xbb10('0x4c')][_0xbb10('0x90')]){if(_0x4c66d8['query']['read']==0x1){_0x1d49e1['having'](_0xbb10('0x91'));}else{_0x1d49e1['having']('`unreadMessages`\x20>\x200');}}if(_0x4c66d8[_0xbb10('0x4c')][_0xbb10('0x92')]){_0x4e7fac=_[_0xbb10('0x93')](_0x4c66d8[_0xbb10('0x4c')][_0xbb10('0x92')])?_0x4c66d8[_0xbb10('0x4c')][_0xbb10('0x92')]:new Array(_0x4c66d8[_0xbb10('0x4c')][_0xbb10('0x92')]);_0x4e7fac['forEach'](function(_0x318a14){_0x4ea1a6['or'](_0xbb10('0x80'),'%,'+_0x318a14+',%');});}if(_0x4c66d8[_0xbb10('0x4c')][_0xbb10('0x94')]){var _0x5c8eb8=_0x4c66d8['query'][_0xbb10('0x94')][_0xbb10('0x95')]('\x5c','\x5c\x5c')[_0xbb10('0x95')](/'/g,'\x27\x27');if(qs[_0xbb10('0x96')](_0x5c8eb8)){_0x2a1ce1['or']('i.id\x20LIKE\x20?',_0x5c8eb8+'%');}else{_0x2a1ce1['or'](_0xbb10('0x97'),qs[_0xbb10('0x79')](_0x5c8eb8))['or'](_0xbb10('0x98'),_0x5c8eb8+'%');}}}_0x1d49e1[_0xbb10('0x56')](_0x2a1ce1);_0x1d49e1[_0xbb10('0x99')]('i.id');var _0x5f0691={'type':db[_0xbb10('0x9a')][_0xbb10('0x9b')][_0xbb10('0x9c')],'raw':!![]};var _0x5239da=_0x1d49e1[_0xbb10('0x9d')]();_0x5239da[_0xbb10('0x59')]('i.id');_0x5239da['field'](_0xbb10('0x9e'),_0xbb10('0x72'));if(_0x1d82bf[_0xbb10('0x9f')]){_0x1d82bf['order'][_0xbb10('0x43')](function(_0x3a17fc){var _0xfbb365=_0x3a17fc[0x0]===_0xbb10('0xa0')?_0x3a17fc[0x0]:'i.'+_0x3a17fc[0x0];_0x1d49e1[_0xbb10('0x9f')](_0xfbb365,_0x3a17fc[0x1]===_0xbb10('0xa1')?![]:!![]);});}if(!_[_0xbb10('0xa2')](_0x4e7fac)){_0x1d49e1[_0xbb10('0x74')](_0x4ea1a6);_0x5239da[_0xbb10('0x56')]('t.id\x20IN\x20?',_0x4e7fac);}BPromise[_0xbb10('0xa3')]()[_0xbb10('0x22')](function(){if(!_0x3e6338){if(_0x4c66d8[_0xbb10('0x4c')][_0xbb10('0x86')])return;_0x5239da[_0xbb10('0x56')](_0xbb10('0xa4'));_0x1d49e1[_0xbb10('0x56')](_0xbb10('0xa4'));return;}if(_0x4c66d8[_0xbb10('0xa5')][_0xbb10('0xa6')]!==_0xbb10('0xa7'))return;return _0x4c66d8[_0xbb10('0xa5')]['getChatWebsites']({'attributes':['id'],'raw':!![]})['then'](function(_0xe1fc51){if(_[_0xbb10('0xa2')](_0xe1fc51)){_0x5239da[_0xbb10('0x56')](_0xbb10('0xa8'));_0x1d49e1[_0xbb10('0x56')]('i.ChatWebsiteId\x20IS\x20NULL');}else{_0x5239da[_0xbb10('0x56')](_0xbb10('0x87'),_[_0xbb10('0x3f')](_0xe1fc51,'id'));_0x1d49e1[_0xbb10('0x56')](_0xbb10('0x87'),_[_0xbb10('0x3f')](_0xe1fc51,'id'));}});})['then'](function(){if(_0x4c66d8[_0xbb10('0xa5')][_0xbb10('0xa6')]==='agent'&&!_0x3e6338&&!_0x4c66d8[_0xbb10('0x4c')]['ChatWebsiteId'])return[];return db[_0xbb10('0xa9')][_0xbb10('0x4c')](_0x5239da[_0xbb10('0xaa')](),_0x5f0691);})[_0xbb10('0x22')](function(_0x3a4a6e){_0x5cf4f8['count']=_0x3a4a6e[_0xbb10('0x51')];if(_0x5cf4f8['count']===0x0)return[];return db[_0xbb10('0xa9')][_0xbb10('0x4c')](_0x1c0d8f['toString'](),_0x5f0691)['then'](function(_0x415407){_0x445870=_[_0xbb10('0xab')](_0x415407,'id');_0x5f0691=_[_0xbb10('0xac')](_0x5f0691,{'model':db[_0xbb10('0x46')],'mapToModel':!![],'raw':!![],'nest':!![]});if(_0x4c66d8[_0xbb10('0x4c')][_0xbb10('0x50')]){_0x1d82bf[_0xbb10('0x4e')][_0xbb10('0x43')](function(_0x252ab8){_0x1d49e1[_0xbb10('0x59')]('i.'+_0x252ab8);});}else{_0x1d49e1[_0xbb10('0x59')]('SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)',_0xbb10('0x72'));_0x1d49e1[_0xbb10('0x59')](_0xbb10('0xad'),_0xbb10('0xae'));_0x1d49e1[_0xbb10('0x59')](_0xbb10('0xaf'),_0xbb10('0xb0'));_0x1d49e1[_0xbb10('0x59')](_0xbb10('0xb1'),_0xbb10('0xa0'));_0x1d49e1[_0xbb10('0x59')](_0xbb10('0xb2'));_0x1d49e1['field'](_0xbb10('0xb3'),'Contact.firstName');_0x1d49e1[_0xbb10('0x59')](_0xbb10('0xb4'),_0xbb10('0xb5'));_0x1d49e1[_0xbb10('0x59')](_0xbb10('0xb6'),'Contact.email');_0x1d49e1[_0xbb10('0x59')](_0xbb10('0xb7'),_0xbb10('0xb8'));_0x1d49e1[_0xbb10('0x59')](_0xbb10('0xb9'),_0xbb10('0xba'));_0x1d49e1['field']('c.fax',_0xbb10('0xbb'));_0x1d49e1[_0xbb10('0x59')](_0xbb10('0xbc'),'Owner.fullname');_0x1d49e1[_0xbb10('0x59')](_0xbb10('0xbd'),'Owner.internal');_0x1d49e1[_0xbb10('0x59')](_0xbb10('0xbe'),'TagIds');}if(_0x1d82bf[_0xbb10('0x54')])_0x1d49e1['limit'](_0x1d82bf[_0xbb10('0x54')]);if(_0x1d82bf[_0xbb10('0x2f')])_0x1d49e1['offset'](_0x1d82bf[_0xbb10('0x2f')]);return db[_0xbb10('0xa9')]['query'](_0x1d49e1['toString'](),_0x5f0691);})[_0xbb10('0x22')](function(_0x13ae83){if(_0x13ae83[_0xbb10('0x51')]>0x0)_0x5bd44d[_0xbb10('0x56')](_0xbb10('0xbf'),_['map'](_0x13ae83,'id'));return db[_0xbb10('0xa9')][_0xbb10('0x4c')](_0x5bd44d[_0xbb10('0xaa')](),_0x5f0691)['then'](function(_0xd68afa){var _0x4f90e6=_[_0xbb10('0xc0')](_0xd68afa,_0xbb10('0xc1'));var _0x44a3e1=[];_0x13ae83[_0xbb10('0x43')](function(_0x1f55d3){_0x44a3e1[_0xbb10('0x44')](updateChatInteraction(_0x1f55d3,_0x445870,_0x4f90e6));});return BPromise[_0xbb10('0xc2')](_0x44a3e1);});});})['then'](function(_0x4fc544){_0x5cf4f8[_0xbb10('0xc3')]=_0x4fc544;return _0x5cf4f8;})[_0xbb10('0x22')](respondWithFilteredResult(_0x366608,_0x1d82bf))[_0xbb10('0xc4')](handleError(_0x366608,null));};exports[_0xbb10('0xc5')]=function(_0x20b585,_0x363b81){var _0x1cccec={'raw':![],'where':{'id':_0x20b585[_0xbb10('0xc6')]['id']}},_0x1674f7={};_0x1674f7[_0xbb10('0x4b')]=_[_0xbb10('0xc7')](db[_0xbb10('0x46')][_0xbb10('0x47')]);_0x1674f7['query']=_[_0xbb10('0xc7')](_0x20b585[_0xbb10('0x4c')]);_0x1674f7[_0xbb10('0x4d')]=_[_0xbb10('0x4f')](_0x1674f7[_0xbb10('0x4b')],_0x1674f7[_0xbb10('0x4c')]);_0x1cccec[_0xbb10('0x4e')]=_[_0xbb10('0x4f')](_0x1674f7[_0xbb10('0x4b')],qs[_0xbb10('0x50')](_0x20b585[_0xbb10('0x4c')]['fields']));_0x1cccec[_0xbb10('0x4e')]=_0x1cccec['attributes'][_0xbb10('0x51')]?_0x1cccec[_0xbb10('0x4e')]:_0x1674f7[_0xbb10('0x4b')];if(_0x20b585[_0xbb10('0x4c')][_0xbb10('0xc8')]){_0x1cccec[_0xbb10('0xc9')]=[{'all':!![]}];}_0x1cccec=_['merge']({},_0x1cccec,_0x20b585[_0xbb10('0xca')]);return db['ChatInteraction'][_0xbb10('0x7b')](_0x1cccec)[_0xbb10('0x22')](handleEntityNotFound(_0x363b81,null))[_0xbb10('0x22')](respondWithResult(_0x363b81,null))[_0xbb10('0xc4')](handleError(_0x363b81,null));};exports[_0xbb10('0xcb')]=function(_0x31907e,_0x4f06c){return db[_0xbb10('0x46')][_0xbb10('0xcb')](_0x31907e[_0xbb10('0x3a')],{})[_0xbb10('0x22')](respondWithResult(_0x4f06c,0xc9))[_0xbb10('0xc4')](handleError(_0x4f06c,null));};exports['update']=function(_0x3696b3,_0x516520){if(_0x3696b3[_0xbb10('0x3a')]['id']){delete _0x3696b3[_0xbb10('0x3a')]['id'];}return db[_0xbb10('0x46')][_0xbb10('0x7b')]({'where':{'id':_0x3696b3[_0xbb10('0xc6')]['id']}})[_0xbb10('0x22')](handleEntityNotFound(_0x516520,null))[_0xbb10('0x22')](saveUpdates(_0x3696b3['body'],null))[_0xbb10('0x22')](respondWithResult(_0x516520,null))['catch'](handleError(_0x516520,null));};exports['destroy']=function(_0x1513e0,_0x35cbb9){return db[_0xbb10('0x46')][_0xbb10('0x7b')]({'where':{'id':_0x1513e0[_0xbb10('0xc6')]['id']}})[_0xbb10('0x22')](handleEntityNotFound(_0x35cbb9,null))['then'](removeEntity(_0x35cbb9,null))[_0xbb10('0xc4')](handleError(_0x35cbb9,null));};exports[_0xbb10('0xcc')]=function(_0x39aa9e,_0xb1b7c8){return db[_0xbb10('0x46')][_0xbb10('0xcc')]()['then'](respondWithResult(_0xb1b7c8,null))[_0xbb10('0xc4')](handleError(_0xb1b7c8,null));};exports[_0xbb10('0xcd')]=function(_0xb7c454,_0xa8b7c3){var _0x31718f=_0xb7c454[_0xbb10('0xc6')]['id'];var _0x2764e1;var _0x5e405b;var _0x33a43e;return db['ChatInteraction'][_0xbb10('0xce')]({'where':{'id':_0x31718f}})['then'](function(_0x4c8b68){_0x2764e1=_0x4c8b68;return db[_0xbb10('0xcf')][_0xbb10('0xce')]({'where':{'id':_0x4c8b68[_0xbb10('0x86')]},'attributes':['id',_0xbb10('0xd0'),_0xbb10('0xd1'),'vidaooTopic',_0xbb10('0xd2'),'vidaooMetadata'],'raw':!![]});})['then'](function(_0x4dd138){if(_0x4dd138&&_0x4dd138[_0xbb10('0xd0')]&&_0x4dd138[_0xbb10('0xd1')]){_0x5e405b=_0x4dd138;var _0x1b9012={'interaction':{'id':_0x31718f},'agent':{'id':_0xb7c454[_0xbb10('0xa5')]['id'],'name':_0xb7c454[_0xbb10('0xa5')]['name'],'fullname':_0xb7c454[_0xbb10('0xa5')][_0xbb10('0x40')],'email':_0xb7c454[_0xbb10('0xa5')][_0xbb10('0xd3')]},'contact':_0xb7c454[_0xbb10('0x3a')][_0xbb10('0x3b')],'account':_0xb7c454[_0xbb10('0x3a')]['account']};var _0x4c95c2={'rejectUnauthorized':![],'method':'POST','url':_0xbb10('0xd4'),'headers':{'X-APIKEY':_0x4dd138[_0xbb10('0xd0')]},'body':{'duration':null,'scheduledAt':null,'participants':[_0xb7c454[_0xbb10('0xa5')][_0xbb10('0xd3')]],'buttons':null,'topic':_0x5e405b[_0xbb10('0xd5')],'note':_[_0xbb10('0xd6')](_0x5e405b[_0xbb10('0xd2')])?null:getMustacheRender(_0x5e405b[_0xbb10('0xd2')],_0x1b9012),'metadata':null},'redirect':_0xbb10('0xd7'),'json':!![]};try{if(!_[_0xbb10('0xd6')](_0x5e405b['vidaooMetadata'])){var _0x58295f=getMustacheRender(_0x5e405b['vidaooMetadata'],_0x1b9012);var _0x3d4b89=JSON[_0xbb10('0x8a')](_0x58295f);_0x4c95c2[_0xbb10('0x3a')]['metadata']=_0x3d4b89;}}catch(_0x2bfa8e){throw new db[(_0xbb10('0x9a'))][(_0xbb10('0xd8'))](_0xbb10('0xd9'));}return rp(_0x4c95c2);}else{throw new db[(_0xbb10('0x9a'))][(_0xbb10('0xd8'))]('Error\x20in\x20Vidaoo\x20configuration');}})['then'](function(_0x356660){_0x33a43e=_0x356660;if(_0x33a43e['id']){var _0x48889b={'body':_0x33a43e[_0xbb10('0xda')],'ChatWebsiteId':_0x5e405b['id'],'ChatInteractionId':_0x2764e1['id'],'direction':_0xbb10('0xdb'),'UserId':_0xb7c454[_0xbb10('0xa5')]['id']};return db[_0xbb10('0xdc')][_0xbb10('0xcb')](_0x48889b,{});}else{throw new db[(_0xbb10('0x9a'))][(_0xbb10('0xd8'))](_0xbb10('0xdd'));}})[_0xbb10('0x22')](function(){return _0x2764e1[_0xbb10('0xde')]({'vidaooSessionId':_0x33a43e['id']});})['then'](respondWithResult(_0xa8b7c3,null))[_0xbb10('0xc4')](handleError(_0xa8b7c3,null));};exports['customUpdate']=function(_0x27bed2,_0x5547fa){if(_0x27bed2[_0xbb10('0x3a')]['id']){delete _0x27bed2[_0xbb10('0x3a')]['id'];}return db[_0xbb10('0x46')][_0xbb10('0x7b')]({'where':{'id':_0x27bed2['params']['id']},'include':[{'model':db[_0xbb10('0xdf')],'as':'Contact'}]})[_0xbb10('0x22')](handleEntityNotFound(_0x5547fa,null))[_0xbb10('0x22')](saveUpdates(_0x27bed2[_0xbb10('0x3a')],null))['then'](respondWithResult(_0x5547fa,null))[_0xbb10('0xc4')](handleError(_0x5547fa,null));};exports[_0xbb10('0xe0')]=function(_0x140173,_0x18a44f,_0x11d31b){if(_0x140173[_0xbb10('0x3a')]['id']){delete _0x140173['body']['id'];}return db['ChatInteraction']['find']({'where':{'id':_0x140173[_0xbb10('0xc6')]['id']}})['then'](function(_0x318908){if(!_0x318908){logger['error'](_0xbb10('0xe1'),_0xbb10('0xe0'),0x194,_0xbb10('0xe2'));_0x18a44f['sendStatus'](0x194);}else{if(_0x318908['UserId']){throw new db[(_0xbb10('0x9a'))][(_0xbb10('0xd8'))](_0xbb10('0xe3'));}}return _0x318908;})['then'](function(_0x440108){if(_0x440108){return _0x440108[_0xbb10('0x36')]({'closed':_0x140173[_0xbb10('0x3a')]['closed'],'disposition':_0x140173['body']['disposition']})[_0xbb10('0x22')](function(_0x55aa03){return _0x55aa03;});}})[_0xbb10('0x22')](function(_0x1c2c95){return respondWithRpcPromise(_0xbb10('0xe4'),_0xbb10('0xe0'),_0x140173[_0xbb10('0x3a')],client9004);})[_0xbb10('0x22')](respondWithResult(_0x18a44f,null))[_0xbb10('0xc4')](handleError(_0x18a44f,null));};exports[_0xbb10('0xe5')]=function(_0x2746eb,_0x431792,_0x2e2710){_0x2746eb['body'][_0xbb10('0x38')]=_0x2746eb[_0xbb10('0xe6')]['originalname'];_0x2746eb[_0xbb10('0x3a')]['basename']=_0x2746eb['file'][_0xbb10('0xe7')];_0x2746eb[_0xbb10('0x3a')][_0xbb10('0x49')]=_0x2746eb[_0xbb10('0xe6')][_0xbb10('0xe8')];return db['Attachment'][_0xbb10('0xcb')](_0x2746eb[_0xbb10('0x3a')])['then'](respondWithResult(_0x431792,0xc9))[_0xbb10('0xc4')](handleError(_0x431792,null));};exports[_0xbb10('0xe9')]=function(_0x5a82e7,_0x424c96,_0x4c769b){return db[_0xbb10('0x46')][_0xbb10('0xce')]({'where':{'id':_0x5a82e7[_0xbb10('0xc6')]['id']},'raw':!![]})[_0xbb10('0x22')](handleEntityNotFound(_0x424c96,null))[_0xbb10('0x22')](function(_0x20b312){if(_0x20b312){if(_0x20b312[_0xbb10('0xea')]){return _0x424c96['status'](0x193)[_0xbb10('0x33')]({'status':0x193,'message':_0xbb10('0xeb')});}return db[_0xbb10('0xec')][_0xbb10('0xce')]({'where':{'id':_0x5a82e7[_0xbb10('0x4c')][_0xbb10('0xed')]},'raw':!![]})['then'](handleEntityNotFound(_0x424c96,null));}})['then'](function(_0x5a40e8){if(_0x5a40e8){var _0x23849e=_0x5a40e8[_0xbb10('0xee')]!==null;var _0x3e1a86=path[_0xbb10('0xef')](config['root'],_0xbb10('0xf0'));if(_0x23849e){_0x3e1a86=path[_0xbb10('0xef')](_0x3e1a86,_0xbb10('0xf1'));}var _0x577d27=path['join'](_0x3e1a86,_0x5a40e8[_0xbb10('0xf2')]);return _0x424c96['download'](_0x577d27);}})[_0xbb10('0xc4')](handleError(_0x424c96,null));};exports[_0xbb10('0xf3')]=function(_0xb9bc5a,_0x42276f){var _0x425505=null;var _0xcb61bb=null;var _0x1fe250=null;var _0x57933f=null;if(_0xb9bc5a[_0xbb10('0x3a')]['id']){delete _0xb9bc5a[_0xbb10('0x3a')]['id'];}if(_0xb9bc5a['body'][_0xbb10('0xf4')]){_0x57933f=path[_0xbb10('0xef')](config[_0xbb10('0xf5')],'server/files/chat/upload/',util['format']('transcript-%s.txt',Date[_0xbb10('0xf6')]()));_0xb9bc5a[_0xbb10('0x3a')]['pathTranscript']=_0x57933f;}return db[_0xbb10('0x46')][_0xbb10('0x7b')]({'where':{'id':_0xb9bc5a[_0xbb10('0xc6')]['id']},'include':[{'model':db[_0xbb10('0xdc')],'as':_0xbb10('0xf7'),'include':[{'model':db[_0xbb10('0x82')],'as':_0xbb10('0x82')}]}]})['then'](handleEntityNotFound(_0x42276f,null))[_0xbb10('0x22')](saveUpdates(_0xb9bc5a['body'],null))['then'](function(_0x4aa0d7){if(_0x4aa0d7){_0x425505=_0x4aa0d7;return db[_0xbb10('0xcf')][_0xbb10('0x7b')]({'where':{'id':_0x425505['ChatWebsiteId']}});}})[_0xbb10('0x22')](function(_0x49f324){if(_0x49f324){_0x1fe250=_0x49f324;return db[_0xbb10('0xdf')][_0xbb10('0x7b')]({'where':{'id':_0x425505[_0xbb10('0x7c')]}});}})['then'](function(_0x4d10ea){if(_0x4d10ea){_0xcb61bb=_0x4d10ea;if(_0x57933f){var _0x447c0d=null;for(var _0x502e73=0x1;_0x502e73<_0x425505[_0xbb10('0xf7')][_0xbb10('0x51')];++_0x502e73){_0x447c0d=_0x425505['Messages'][_0x502e73];var _0x50cd00=_0x447c0d[_0xbb10('0x83')]?util[_0xbb10('0xf8')](_0xbb10('0xf9'),_0x1fe250['agentAlias'],_0x447c0d[_0xbb10('0x83')]):_0xbb10('0xfa');var _0x22f153=_0xb9bc5a['body'][_0xbb10('0xfb')]||util[_0xbb10('0xf8')](_0xbb10('0xf9'),_0xbb10('0xfc'),_0x447c0d[_0xbb10('0x7c')]);switch(_0x1fe250[_0xbb10('0xfd')]){case _0xbb10('0xfe'):_0x50cd00=_0x447c0d[_0xbb10('0x83')]?util[_0xbb10('0xf8')](_0xbb10('0xf9'),_0x1fe250[_0xbb10('0xff')],_0x447c0d[_0xbb10('0x83')]):_0xbb10('0xfa');break;case'agent_alias':_0x50cd00=_0x447c0d['UserId']?_0x447c0d[_0xbb10('0x82')]['alias']||_0x447c0d[_0xbb10('0x82')][_0xbb10('0x40')]:_0xbb10('0xfa');break;case'agent_fullname':_0x50cd00=_0x447c0d[_0xbb10('0x83')]?_0x447c0d[_0xbb10('0x82')][_0xbb10('0x40')]:_0xbb10('0xfa');break;default:_0x50cd00=_0x447c0d[_0xbb10('0x83')]?util['format'](_0xbb10('0xf9'),_0x1fe250[_0xbb10('0xff')],_0x447c0d[_0xbb10('0x83')]):_0xbb10('0xfa');}var _0x150d4c=util[_0xbb10('0xf8')]('[%s]\x20%s:\x20%s\x0a',moment(_0x447c0d[_0xbb10('0x89')])[_0xbb10('0xf8')]('MM/DD/YYYY\x20HH:mm:ss'),_0x447c0d[_0xbb10('0x100')]==='in'?_0x22f153:_0x50cd00,_0x447c0d[_0xbb10('0x3a')]);if(!_0x447c0d[_0xbb10('0x101')]){fs[_0xbb10('0x102')](_0x57933f,_0x150d4c);}}return db[_0xbb10('0x103')][_0xbb10('0xce')]({'where':{'service':!![]},'include':[{'model':db[_0xbb10('0x104')],'as':_0xbb10('0x105'),'raw':!![]}]});}}})[_0xbb10('0x22')](function(_0x33d1b7){if(_0x33d1b7&&_0x33d1b7[_0xbb10('0x105')]&&_0xb9bc5a[_0xbb10('0x3a')]){var _0x1db646={'tls':{'rejectUnauthorized':![]}};if(_0x33d1b7[_0xbb10('0x105')][_0xbb10('0x106')]){_0x1db646['service']=_0x33d1b7[_0xbb10('0x105')][_0xbb10('0x106')];}else{_0x1db646['host']=_0x33d1b7['Smtp'][_0xbb10('0x107')];_0x1db646[_0xbb10('0x108')]=_0x33d1b7[_0xbb10('0x105')][_0xbb10('0x108')];_0x1db646[_0xbb10('0x109')]=_0x33d1b7[_0xbb10('0x105')][_0xbb10('0x109')];}if(_0x33d1b7[_0xbb10('0x105')][_0xbb10('0x10a')]){_0x1db646['auth']={'user':_0x33d1b7['Smtp']['user'],'pass':_0x33d1b7['Smtp']['pass']};}return respondWithRpcPromise('SendMail',_0xbb10('0x10b'),{'account':_0x1db646,'message':{'from':util[_0xbb10('0xf8')](_0xbb10('0x10c'),_0x33d1b7[_0xbb10('0x38')],_0x33d1b7['email']||_0x33d1b7[_0xbb10('0x105')][_0xbb10('0xa5')]),'to':_0xb9bc5a[_0xbb10('0x3a')][_0xbb10('0xf4')],'subject':'Mail\x20Transcript','text':util['format'](_0xbb10('0x10d'),_0xb9bc5a[_0xbb10('0x3a')]['mailTranscript']),'attachments':[{'path':_0x57933f}]}})['then'](function(){return _0x425505;})[_0xbb10('0xc4')](function(_0xf1371a){console[_0xbb10('0x28')](_0xf1371a);});}else{return _0x425505;}})[_0xbb10('0x22')](respondWithStatusCode(_0x42276f,0xc8))[_0xbb10('0xc4')](handleError(_0x42276f,null));};exports['addMessage']=function(_0x4744f4,_0x5382e9,_0x4c97b9){return db[_0xbb10('0xdc')][_0xbb10('0x7b')]({'where':{'id':_0x4744f4[_0xbb10('0xc6')]['id']}})[_0xbb10('0x22')](handleEntityNotFound(_0x5382e9,null))[_0xbb10('0x22')](function(_0x21c0fd){if(_0x21c0fd){return _0x21c0fd['addMessage'](_0x4744f4[_0xbb10('0x3a')][_0xbb10('0x10e')],_[_0xbb10('0x10f')](_0x4744f4[_0xbb10('0x3a')],[_0xbb10('0x10e'),'id'])||{});}})[_0xbb10('0x22')](respondWithResult(_0x5382e9,null))[_0xbb10('0xc4')](handleError(_0x5382e9,null));};exports[_0xbb10('0x110')]=function(_0x233d5e,_0x16f3ce,_0xbae19c){var _0x26f4b0={'raw':![],'where':{}};var _0x1dbf7b={};var _0x117e95={'count':0x0,'rows':[]};return db[_0xbb10('0x46')][_0xbb10('0xce')]({'where':{'id':_0x233d5e[_0xbb10('0xc6')]['id']}})[_0xbb10('0x22')](handleEntityNotFound(_0x16f3ce,null))[_0xbb10('0x22')](function(_0x43a203){if(_0x43a203){_0x1dbf7b[_0xbb10('0x4b')]=_[_0xbb10('0xc7')](db['ChatMessage'][_0xbb10('0x47')]);_0x1dbf7b['query']=_[_0xbb10('0xc7')](_0x233d5e[_0xbb10('0x4c')]);_0x1dbf7b[_0xbb10('0x4d')]=_[_0xbb10('0x4f')](_0x1dbf7b[_0xbb10('0x4b')],_0x1dbf7b['query']);_0x26f4b0['attributes']=_['intersection'](_0x1dbf7b[_0xbb10('0x4b')],qs[_0xbb10('0x50')](_0x233d5e['query'][_0xbb10('0x50')]));_0x26f4b0[_0xbb10('0x4e')]=_0x26f4b0[_0xbb10('0x4e')]['length']?_0x26f4b0[_0xbb10('0x4e')]:_0x1dbf7b[_0xbb10('0x4b')];if(!_0x233d5e[_0xbb10('0x4c')]['hasOwnProperty'](_0xbb10('0x53'))){_0x26f4b0['limit']=qs[_0xbb10('0x54')](_0x233d5e['query']['limit']);_0x26f4b0['offset']=qs['offset'](_0x233d5e['query']['offset']);}_0x26f4b0[_0xbb10('0x9f')]=qs[_0xbb10('0x55')](_0x233d5e[_0xbb10('0x4c')][_0xbb10('0x55')]);_0x26f4b0['where']=qs[_0xbb10('0x4d')](_[_0xbb10('0x57')](_0x233d5e[_0xbb10('0x4c')],_0x1dbf7b[_0xbb10('0x4d')]));_0x26f4b0[_0xbb10('0x56')][_0xbb10('0xc1')]=_0x43a203['id'];if(_0x233d5e[_0xbb10('0x4c')][_0xbb10('0x94')]){_0x26f4b0[_0xbb10('0x56')]=_[_0xbb10('0xac')](_0x26f4b0['where'],{'$or':_[_0xbb10('0x3f')](_0x26f4b0[_0xbb10('0x4e')],function(_0x288ccc){var _0x5c5ecc={};_0x5c5ecc[_0x288ccc]={'$like':'%'+_0x233d5e[_0xbb10('0x4c')][_0xbb10('0x94')]+'%'};return _0x5c5ecc;})});}if(_0x233d5e[_0xbb10('0x4c')][_0xbb10('0x8b')]){var _0x5b2292=_0x233d5e[_0xbb10('0x4c')][_0xbb10('0x8b')][_0xbb10('0x111')](',');var _0x22ec50={};_0x22ec50[_0x5b2292[0x0]]={'$gte':moment(_0x5b2292[0x1])[_0xbb10('0xf8')](_0xbb10('0x112'))};_0x26f4b0[_0xbb10('0x56')]=_[_0xbb10('0xac')](_0x26f4b0[_0xbb10('0x56')],_0x22ec50);}_0x26f4b0=_[_0xbb10('0xac')]({},_0x26f4b0,_0x233d5e[_0xbb10('0xca')]);return db['ChatMessage'][_0xbb10('0x31')]({'where':_0x26f4b0[_0xbb10('0x56')]})['then'](function(_0x5eb1fb){_0x117e95[_0xbb10('0x31')]=_0x5eb1fb;if(_0x233d5e[_0xbb10('0x4c')]['includeAll']){_0x26f4b0[_0xbb10('0xc9')]=[{'all':!![]}];}return db[_0xbb10('0xdc')]['findAll'](_0x26f4b0);})[_0xbb10('0x22')](function(_0x42441e){_0x117e95[_0xbb10('0xc3')]=_0x42441e;return _0x117e95;});}})[_0xbb10('0x22')](respondWithFilteredResult(_0x16f3ce,_0x26f4b0))[_0xbb10('0xc4')](handleError(_0x16f3ce,null));};exports['getMyMessages']=function(_0x4fc260,_0x5a502c,_0xaeaa51){var _0x4db9ad={'where':{}},_0x43deea={},_0x53e73e={'count':0x0,'rows':[]};return db['ChatInteraction'][_0xbb10('0xce')]({'where':{'id':_0x4fc260[_0xbb10('0xc6')]['id']}})[_0xbb10('0x22')](handleEntityNotFound(_0x5a502c,null))[_0xbb10('0x22')](function(_0x2527f4){if(_0x2527f4){_0x43deea[_0xbb10('0x4b')]=_['keys'](db['ChatMessage']['rawAttributes']);_0x43deea[_0xbb10('0x4c')]=_[_0xbb10('0xc7')](_0x4fc260[_0xbb10('0x4c')]);_0x43deea[_0xbb10('0x4d')]=_[_0xbb10('0x4f')](_0x43deea[_0xbb10('0x4b')],_0x43deea[_0xbb10('0x4c')]);_0x4db9ad['attributes']=_[_0xbb10('0x4f')](_0x43deea[_0xbb10('0x4b')],qs[_0xbb10('0x50')](_0x4fc260[_0xbb10('0x4c')]['fields']));_0x4db9ad[_0xbb10('0x4e')]=_0x4db9ad['attributes']['length']?_0x4db9ad[_0xbb10('0x4e')]:_0x43deea[_0xbb10('0x4b')];if(!_0x4fc260[_0xbb10('0x4c')][_0xbb10('0x52')](_0xbb10('0x53'))){_0x4db9ad[_0xbb10('0x54')]=qs['limit'](_0x4fc260[_0xbb10('0x4c')][_0xbb10('0x54')]);_0x4db9ad[_0xbb10('0x2f')]=qs[_0xbb10('0x2f')](_0x4fc260[_0xbb10('0x4c')][_0xbb10('0x2f')]);}_0x4db9ad[_0xbb10('0x9f')]=qs['sort'](_0x4fc260[_0xbb10('0x4c')][_0xbb10('0x55')]);_0x4db9ad[_0xbb10('0x56')]=qs['filters'](_['pick'](_0x4fc260[_0xbb10('0x4c')],_0x43deea[_0xbb10('0x4d')]));_0x4db9ad[_0xbb10('0x56')][_0xbb10('0xc1')]=_0x2527f4['id'];if(_0x4fc260[_0xbb10('0x4c')][_0xbb10('0x94')]){_0x4db9ad[_0xbb10('0x56')]=_['merge'](_0x4db9ad[_0xbb10('0x56')],{'$or':_[_0xbb10('0x3f')](_0x4db9ad[_0xbb10('0x4e')],function(_0x55ba78){var _0x5e195a={};_0x5e195a[_0x55ba78]={'$like':'%'+_0x4fc260['query']['filter']+'%'};return _0x5e195a;})});}_0x4db9ad[_0xbb10('0x56')][_0xbb10('0x101')]=![];if(_0x4fc260[_0xbb10('0x4c')]['id']){_0x4db9ad[_0xbb10('0x56')]['id']={'$gt':_0x4fc260['query']['id']};}_0x4db9ad=_[_0xbb10('0xac')]({},_0x4db9ad,_0x4fc260['options']);return db[_0xbb10('0xdc')][_0xbb10('0x31')]({'where':_0x4db9ad[_0xbb10('0x56')]})[_0xbb10('0x22')](function(_0xa16287){_0x53e73e[_0xbb10('0x31')]=_0xa16287;_0x4db9ad[_0xbb10('0xc9')]=[];if(_0x4fc260[_0xbb10('0x4c')][_0xbb10('0x113')]){_0x4db9ad[_0xbb10('0xc9')][_0xbb10('0x44')]({'model':db[_0xbb10('0x82')],'as':'User','attributes':['id',_0xbb10('0x40'),_0xbb10('0x114')]});}if(_0x4fc260[_0xbb10('0x4c')]['includeAll']){_0x4db9ad[_0xbb10('0xc9')]=[{'all':!![]}];}return db['ChatMessage'][_0xbb10('0x115')](_0x4db9ad);})[_0xbb10('0x22')](function(_0x280119){_0x53e73e[_0xbb10('0xc3')]=_0x280119;return _0x53e73e;});}})[_0xbb10('0x22')](respondWithFilteredResult(_0x5a502c,_0x4db9ad))['catch'](handleError(_0x5a502c,null));};exports['addTags']=function(_0x842d94,_0x4cf5cc,_0x553bb8){return db[_0xbb10('0x46')]['find']({'where':{'id':_0x842d94[_0xbb10('0xc6')]['id']}})[_0xbb10('0x22')](handleEntityNotFound(_0x4cf5cc,null))[_0xbb10('0x22')](function(_0x4469c4){if(_0x4469c4){return _0x4469c4[_0xbb10('0x116')](_0x842d94[_0xbb10('0x3a')][_0xbb10('0x10e')],_[_0xbb10('0x10f')](_0x842d94['body'],[_0xbb10('0x10e'),'id'])||{})['spread'](function(){return db[_0xbb10('0x7f')]['findAll']({'attributes':['id',_0xbb10('0x38'),_0xbb10('0x5a')],'where':{'id':_0x842d94['body'][_0xbb10('0x10e')]}});})[_0xbb10('0x22')](function(_0x1bb072){socket['emit'](_0xbb10('0x117'),{'id':Number(_0x842d94[_0xbb10('0xc6')]['id']),'tags':_0x1bb072||[]});return{'id':Number(_0x842d94[_0xbb10('0xc6')]['id']),'tags':_0x1bb072||[]};});}})['then'](respondWithResult(_0x4cf5cc,null))[_0xbb10('0xc4')](handleError(_0x4cf5cc,null));};exports[_0xbb10('0x118')]=function(_0x46df90,_0x4b781e,_0x3e6756){return db['ChatInteraction'][_0xbb10('0x7b')]({'where':{'id':_0x46df90[_0xbb10('0xc6')]['id']}})[_0xbb10('0x22')](handleEntityNotFound(_0x4b781e,null))[_0xbb10('0x22')](function(_0x583a3e){if(_0x583a3e){return _0x583a3e[_0xbb10('0x118')](_0x46df90[_0xbb10('0x4c')][_0xbb10('0x10e')]);}})[_0xbb10('0x22')](respondWithStatusCode(_0x4b781e,null))[_0xbb10('0xc4')](handleError(_0x4b781e,null));};exports['download']=function(_0x4b10ed,_0x40b5da){var _0x4739a6=moment()[_0xbb10('0x119')]()['toString']();var _0x3d5870=path[_0xbb10('0xef')](config[_0xbb10('0xf5')],_0xbb10('0x11a'),_0xbb10('0x11b'),_0xbb10('0x11c'));var _0x81d970=path[_0xbb10('0xef')](config[_0xbb10('0xf5')],'server',_0xbb10('0x11b'),_0xbb10('0x11d'));var _0x4102af=path[_0xbb10('0xef')](_0x3d5870,_0x4739a6);var _0x4d49a7=util[_0xbb10('0xf8')](_0xbb10('0x11e'),_0x4b10ed[_0xbb10('0xc6')]['id'],_0x4739a6);var _0x59fef2=path['join'](_0x3d5870,_0x4d49a7);var _0x3b45c4=[];_0x3b45c4['push']({'model':db[_0xbb10('0x82')],'as':'User','attributes':['id',_0xbb10('0x40')],'raw':!![]});_0x3b45c4[_0xbb10('0x44')]({'model':db[_0xbb10('0xdf')],'as':_0xbb10('0x11f'),'attributes':['id',_0xbb10('0x120'),_0xbb10('0x121')],'raw':!![]});if(_0x4b10ed[_0xbb10('0x4c')]['attachments']){_0x3b45c4[_0xbb10('0x44')]({'model':db[_0xbb10('0xec')],'as':_0xbb10('0xec'),'raw':!![]});}var _0x2807d2=[{'model':db[_0xbb10('0xdc')],'as':_0xbb10('0xf7'),'attributes':['id','body',_0xbb10('0x89'),_0xbb10('0x100'),_0xbb10('0x101'),_0xbb10('0x90')],'include':_0x3b45c4}];_0x2807d2[_0xbb10('0x44')]({'model':db[_0xbb10('0xcf')],'as':_0xbb10('0x122'),'attributes':['id','name']});_0x2807d2[_0xbb10('0x44')]({'model':db[_0xbb10('0x82')],'as':_0xbb10('0x123'),'attributes':['id','fullname']});return db[_0xbb10('0x46')]['find']({'where':{'id':_0x4b10ed[_0xbb10('0xc6')]['id']},'include':_0x2807d2})[_0xbb10('0x22')](handleEntityNotFound(_0x40b5da,null))[_0xbb10('0x22')](function(_0x58a447){if(_0x58a447){var _0x50fa4e=_0x58a447[_0xbb10('0x124')]({'plain':!![]});fs[_0xbb10('0x125')](_0x4102af);var _0xbb410e={'channel':_0xbb10('0x126'),'account':_0x50fa4e[_0xbb10('0x122')][_0xbb10('0x38')],'agent':_0x50fa4e[_0xbb10('0x123')]?_0x50fa4e[_0xbb10('0x123')][_0xbb10('0x40')]:_0xbb10('0x127'),'createdAt':moment(_0x50fa4e[_0xbb10('0x89')])['format']('YYYY-MM-DD\x20HH:mm:ss')[_0xbb10('0xaa')](),'closedAt':_0x50fa4e[_0xbb10('0xea')]?moment(_0x50fa4e['closedAt'])['format'](_0xbb10('0x112'))[_0xbb10('0xaa')]():'','disposition':_0x50fa4e[_0xbb10('0x128')],'chatInfo':{'browser':_0x50fa4e['browserName'],'os':_0x50fa4e[_0xbb10('0x129')],'referer':_0x50fa4e[_0xbb10('0x12a')],'customerIp':_0x50fa4e['customerIp'],'customerPort':_0x50fa4e[_0xbb10('0x12b')]?_0x50fa4e[_0xbb10('0x12b')]:'N.A.'},'messages':_(_0x50fa4e['Messages'])[_0xbb10('0x12c')]()[_0xbb10('0x94')]({'secret':![]})[_0xbb10('0x3f')](function(_0x5cab64){if(_0x5cab64['Attachment']){var _0x58ee41=path[_0xbb10('0xef')](_0x81d970,_0x5cab64['Attachment'][_0xbb10('0xf2')]);if(fs[_0xbb10('0x12d')](_0x58ee41)){fs['createReadStream'](_0x58ee41)[_0xbb10('0x12e')](fs[_0xbb10('0x12f')](path[_0xbb10('0xef')](_0x4102af,_0x5cab64[_0xbb10('0xec')]['basename'])));}}return{'date':moment(_0x5cab64[_0xbb10('0x89')])['format'](_0xbb10('0x112'))[_0xbb10('0xaa')](),'sender':_0x5cab64[_0xbb10('0x100')]===_0xbb10('0xdb')?_0x5cab64[_0xbb10('0x82')]?_0x5cab64[_0xbb10('0x82')][_0xbb10('0x40')]:_0xbb10('0xfa'):_0x5cab64['Contact'][_0xbb10('0x120')]+(_0x5cab64[_0xbb10('0x11f')][_0xbb10('0x121')]?'\x20'+_0x5cab64[_0xbb10('0x11f')]['lastName']:''),'body':_0x5cab64['Attachment']?_0x5cab64[_0xbb10('0xec')][_0xbb10('0xf2')]:_0x5cab64[_0xbb10('0x3a')],'direction':_0x5cab64[_0xbb10('0x100')]==='out'?'A':'C','secret':_0x5cab64[_0xbb10('0x101')],'read':_0x5cab64[_0xbb10('0x90')],'attachment':_0x5cab64['Attachment']};})[_0xbb10('0x73')]()};return ejs['renderFile'](path['join'](config[_0xbb10('0xf5')],_0xbb10('0x11a'),_0xbb10('0x130'),_0xbb10('0x131')),{'interaction':_0xbb410e})[_0xbb10('0x22')](function(_0x4aa76a){var _0x38403e=path[_0xbb10('0xef')](_0x4102af,_0xbb10('0x132')+_0x50fa4e['id']+'-'+_0x4739a6+_0xbb10('0x133'));var _0x1b7274={'path':_0x38403e,'channel':_0xbb10('0x126'),'interactionId':_0x50fa4e['id']};return pdf[_0xbb10('0x134')](_0x4aa76a,_0x1b7274);})[_0xbb10('0x22')](function(){return new BPromise(function(_0x34f4d6,_0x254b6e){zipdir(_0x4102af,{'saveTo':_0x59fef2},function(_0x368adb,_0xef4ccf){if(_0x368adb)return _0x254b6e(_0x368adb);return _0x34f4d6(_0xef4ccf);});})[_0xbb10('0x22')](function(){return new BPromise(function(_0x9fcc26,_0x111fd4){rimraf(_0x4102af,function(_0x256ce9){if(_0x256ce9)_0x111fd4(_0x256ce9);return _0x9fcc26();});});})[_0xbb10('0x22')](function(){return _0x40b5da[_0xbb10('0x135')](_0x59fef2,_0x4d49a7,function(_0x27e0c5){if(_0x27e0c5){console[_0xbb10('0x136')](_0xbb10('0x137'),_0x27e0c5);}else{fs[_0xbb10('0x138')](_0x59fef2);}});});});}else{return _0x40b5da[_0xbb10('0x2c')](0xc8);}})[_0xbb10('0xc4')](handleError(_0x40b5da,null));};
\ No newline at end of file
+var _0xef0f=['alias','fullname','agent_fullname','[%s]\x20%s:\x20%s\x0a','MM/DD/YYYY\x20HH:mm:ss','secret','appendFileSync','MailAccount','MailServerOut','Smtp','service','host','port','secure','auth','pass','sendMail','\x22%s\x22\x20<%s>','Mail\x20Transcript','mailTranscript','addMessage','ids','getMessages','YYYY-MM-DD\x20HH:mm:ss','findAll','hasOwnProperty','includeAgent','addTags','setTags','omit','emit','removeTags','download','unix','server','files','tmp','attachments','transcript-%d-%s.zip','firstName','lastName','direction','Account','mkdirSync','Chat','Owner','N.A.','browserName','osName','existsSync','pipe','createWriteStream','renderFile','views','downloadInteraction.ejs','transcript-','createPdfFromHTML','err','eml-format','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../components/export/pdf','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','redis','defaults','localhost','socket.io-emitter','./chatInteraction.socket','jayson/promise','http','then','info','ChatInteraction,\x20%s,\x20%s','request\x20sent','ChatInteraction,\x20%s,\x20%s,\x20%s','stringify','error','message','catch','sendStatus','status','json','offset','undefined','limit','set','Content-Range','save','update','destroy','end','stack','name','send','render','body','contact','interaction','account','Users','TagIds','Tags','split','forEach','push','index','ChatInteraction','rawAttributes','fieldName','key','model','query','filters','intersection','attributes','fields','nolimit','sort','where','pick','select','field','u.id','u.fullname','ui.ChatInteractionId','from','user_has_chat_interactions','left_join','users','chat_interactions','cm_contacts','c.id\x20=\x20i.ContactId\x20AND\x20c.deletedAt\x20IS\x20NULL','a.id\x20=\x20i.ChatWebsiteId','chat_messages','me.ChatInteractionId\x20=\x20i.id','chat_interaction_has_tags','tools_tags','t.id\x20=\x20it.TagId','expr','search','parseSearch','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','type','text','start','Tag','map','CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','union','User','CONCAT_WS(\x27\x20\x27,\x20o.name,\x20o.fullname)\x20LIKE\x20?','UserId','buildExpression','some','compact','isEmpty','i.ChatWebsiteId\x20IN\x20?','concat','createdAt','$gte','parse','$lte','i.createdAt\x20BETWEEN\x20?\x20AND\x20?','null','\x20=\x20?','read','`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)','order','DESC','t.id\x20IN\x20?','i.ChatWebsiteId\x20IS\x20NOT\x20NULL','user','role','agent','getChatWebsites','ChatWebsiteId','sequelize','toString','count','merge','a.key','Account.key','a.mandatoryDisposition','Account.mandatoryDisposition','contactName','Contact.firstName','Contact.lastName','c.phone','Contact.phone','Contact.mobile','c.fax','Contact.fax','o.internal','GROUP_CONCAT(DISTINCT\x20t.id)','ui.ChatInteractionId\x20IN\x20?','groupBy','ChatInteractionId','all','rows','params','keys','includeAll','include','options','create','describe','createVidaooSession','ChatWebsite','findOne','vidaooEscalation','vidaooTopic','vidaooMetadata','vidaooApiKey','email','isNull','vidaooNote','follow','metadata','ValidationError','join_url','out','ChatMessage','Unable\x20to\x20create\x20Vidaoo\x20session','updateAttributes','CmContact','abandon','abandonInteraction,\x20%s,\x20%s,\x20%s','Interaction\x20already\x20assigned','closed','disposition','attachmentUpload','originalname','basename','file','filename','mimetype','Unauthorized','Attachment','attachId','join','root','server/files/attachments/','offline-chat/','server/files/chat/upload/','format','now','Messages','%s%d','agentAlias','System','customer','Visitor','agentIdentifier','website_alias'];(function(_0x483dba,_0x1a3942){var _0x15b8c7=function(_0x514902){while(--_0x514902){_0x483dba['push'](_0x483dba['shift']());}};_0x15b8c7(++_0x1a3942);}(_0xef0f,0x168));var _0xfef0=function(_0x15beb5,_0x206a03){_0x15beb5=_0x15beb5-0x0;var _0x213c61=_0xef0f[_0x15beb5];return _0x213c61;};'use strict';var emlformat=require(_0xfef0('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xfef0('0x1'));var jsonpatch=require(_0xfef0('0x2'));var rp=require(_0xfef0('0x3'));var moment=require('moment');var BPromise=require(_0xfef0('0x4'));var Mustache=require(_0xfef0('0x5'));var util=require(_0xfef0('0x6'));var path=require('path');var sox=require(_0xfef0('0x7'));var csv=require(_0xfef0('0x8'));var ejs=require(_0xfef0('0x9'));var fs=require('fs');var fs_extra=require(_0xfef0('0xa'));var _=require(_0xfef0('0xb'));var squel=require(_0xfef0('0xc'));var crypto=require('crypto');var jsforce=require(_0xfef0('0xd'));var deskjs=require('desk.js');var toCsv=require(_0xfef0('0x8'));var querystring=require(_0xfef0('0xe'));var Papa=require(_0xfef0('0xf'));var Redis=require(_0xfef0('0x10'));var authService=require(_0xfef0('0x11'));var qs=require(_0xfef0('0x12'));var as=require(_0xfef0('0x13'));var pdf=require(_0xfef0('0x14'));var hardwareService=require(_0xfef0('0x15'));var logger=require(_0xfef0('0x16'))(_0xfef0('0x17'));var utils=require(_0xfef0('0x18'));var config=require(_0xfef0('0x19'));var licenseUtil=require(_0xfef0('0x1a'));var db=require('../../mysqldb')['db'];config[_0xfef0('0x1b')]=_[_0xfef0('0x1c')](config[_0xfef0('0x1b')],{'host':_0xfef0('0x1d'),'port':0x18eb});var socket=require(_0xfef0('0x1e'))(new Redis(config[_0xfef0('0x1b')]));require(_0xfef0('0x1f'))['register'](socket);var jayson=require(_0xfef0('0x20'));var client=jayson['client']['http']({'port':0x232b});var client9004=jayson['client'][_0xfef0('0x21')]({'port':0x232c});function respondWithRpcPromise(_0x284b6d,_0x3510a7,_0x1bce2f,_0x2a96d9){return new BPromise(function(_0x3f9a6c,_0x155833){var _0x2887e6=_0x2a96d9||client;return _0x2887e6['request'](_0x284b6d,_0x1bce2f)[_0xfef0('0x22')](function(_0x1642cd){logger[_0xfef0('0x23')](_0xfef0('0x24'),_0x3510a7,_0xfef0('0x25'));logger['debug'](_0xfef0('0x26'),_0x3510a7,'request\x20sent',JSON[_0xfef0('0x27')](_0x1642cd));if(_0x1642cd[_0xfef0('0x28')]){if(_0x1642cd[_0xfef0('0x28')]['code']===0x1f4){logger[_0xfef0('0x28')]('ChatInteraction,\x20%s,\x20%s',_0x3510a7,_0x1642cd[_0xfef0('0x28')][_0xfef0('0x29')]);return _0x155833(_0x1642cd['error']['message']);}logger['error'](_0xfef0('0x24'),_0x3510a7,_0x1642cd['error'][_0xfef0('0x29')]);return _0x3f9a6c(_0x1642cd[_0xfef0('0x28')][_0xfef0('0x29')]);}else{logger[_0xfef0('0x23')](_0xfef0('0x24'),_0x3510a7,_0xfef0('0x25'));_0x3f9a6c(_0x1642cd['result']['message']);}})[_0xfef0('0x2a')](function(_0x1ffaa4){logger[_0xfef0('0x28')](_0xfef0('0x24'),_0x3510a7,_0x1ffaa4);_0x155833(_0x1ffaa4);});});}function respondWithStatusCode(_0xab231c,_0xf60f2){_0xf60f2=_0xf60f2||0xcc;return function(_0x5df04f){if(_0x5df04f){return _0xab231c[_0xfef0('0x2b')](_0xf60f2);}return _0xab231c[_0xfef0('0x2c')](_0xf60f2)['end']();};}function respondWithResult(_0x1a6758,_0x394bad){_0x394bad=_0x394bad||0xc8;return function(_0xca0cce){if(_0xca0cce){return _0x1a6758[_0xfef0('0x2c')](_0x394bad)[_0xfef0('0x2d')](_0xca0cce);}};}function respondWithFilteredResult(_0x1ac4a3,_0x3e3c4c){return function(_0x3e026a){if(_0x3e026a){var _0x26cb9a=typeof _0x3e3c4c[_0xfef0('0x2e')]===_0xfef0('0x2f')&&typeof _0x3e3c4c[_0xfef0('0x30')]==='undefined';var _0x445625=_0x3e026a['count'];var _0x4eaf74=_0x26cb9a?0x0:_0x3e3c4c[_0xfef0('0x2e')];var _0x2ae54a=_0x26cb9a?_0x3e026a['count']:_0x3e3c4c['offset']+_0x3e3c4c['limit'];var _0x4f65cd;if(_0x2ae54a>=_0x445625){_0x2ae54a=_0x445625;_0x4f65cd=0xc8;}else{_0x4f65cd=0xce;}_0x1ac4a3['status'](_0x4f65cd);return _0x1ac4a3[_0xfef0('0x31')](_0xfef0('0x32'),_0x4eaf74+'-'+_0x2ae54a+'/'+_0x445625)[_0xfef0('0x2d')](_0x3e026a);}return null;};}function patchUpdates(_0x5cda6b){return function(_0x4d0778){try{jsonpatch['apply'](_0x4d0778,_0x5cda6b,!![]);}catch(_0x1f8110){return BPromise['reject'](_0x1f8110);}return _0x4d0778[_0xfef0('0x33')]();};}function saveUpdates(_0x3783f9,_0x1b9f39){return function(_0x4a2773){if(_0x4a2773){return _0x4a2773[_0xfef0('0x34')](_0x3783f9)['then'](function(_0x4234e4){return _0x4234e4;});}return null;};}function removeEntity(_0x1f21b7,_0x234d49){return function(_0xe5188e){if(_0xe5188e){return _0xe5188e[_0xfef0('0x35')]()[_0xfef0('0x22')](function(){_0x1f21b7[_0xfef0('0x2c')](0xcc)[_0xfef0('0x36')]();});}};}function handleEntityNotFound(_0x590e37,_0x24ea7c){return function(_0xea09ec){if(!_0xea09ec){_0x590e37[_0xfef0('0x2b')](0x194);}return _0xea09ec;};}function handleError(_0x36b2d1,_0xae697){_0xae697=_0xae697||0x1f4;return function(_0x262341){logger[_0xfef0('0x28')](_0x262341[_0xfef0('0x37')]);if(_0x262341[_0xfef0('0x38')]){delete _0x262341[_0xfef0('0x38')];}_0x36b2d1[_0xfef0('0x2c')](_0xae697)[_0xfef0('0x39')](_0x262341);};}function getMustacheRender(_0x366667,_0x4a8af4){return Mustache[_0xfef0('0x3a')](_0x366667,_['merge'](_0x4a8af4[_0xfef0('0x3b')],{'contact':_0x4a8af4[_0xfef0('0x3c')],'message':_0x4a8af4[_0xfef0('0x29')],'agent':_0x4a8af4['agent'],'interaction':_0x4a8af4[_0xfef0('0x3d')],'account':_0x4a8af4[_0xfef0('0x3e')]}))||'';}function getInteractionUsers(_0x3f2753,_0x5537c8){return new BPromise(function(_0x8613a0,_0x3abcc5){try{if(_0x5537c8[_0x3f2753['id']]){_0x3f2753[_0xfef0('0x3f')]=_['map'](_0x5537c8[_0x3f2753['id']],function(_0x3a6667){return{'id':_0x3a6667['id'],'fullname':_0x3a6667['fullname']};});}}catch(_0x49ed48){_0x3abcc5(_0x49ed48);}_0x8613a0(_0x3f2753);});}function getInteractionTags(_0xf30aff,_0x547a5d){return new BPromise(function(_0x5c3305,_0xbf6ddd){try{if(_0xf30aff[_0xfef0('0x40')]){_0xf30aff[_0xfef0('0x41')]=[];_0xf30aff[_0xfef0('0x40')][_0xfef0('0x42')](',')[_0xfef0('0x43')](function(_0x4dd8f8){_0xf30aff[_0xfef0('0x41')][_0xfef0('0x44')](_0x547a5d[_0x4dd8f8]);});}delete _0xf30aff['TagIds'];}catch(_0x54d5cb){_0xbf6ddd(_0x54d5cb);}_0x5c3305(_0xf30aff);});}function updateChatInteraction(_0x1d554e,_0x5dc824,_0x1fc518){return new BPromise(function(_0x22c940,_0x3c100c){return getInteractionUsers(_0x1d554e,_0x1fc518)[_0xfef0('0x22')](function(_0x199c57){return getInteractionTags(_0x199c57,_0x5dc824);})[_0xfef0('0x22')](function(_0x166a7b){_0x22c940(_0x166a7b);})[_0xfef0('0x2a')](function(_0x4e63f3){_0x3c100c(_0x4e63f3);});});}exports[_0xfef0('0x45')]=function(_0x50e372,_0x4b6da1){var _0x18c656={},_0x17d7f2={},_0x5bf416={'count':0x0,'rows':[]};var _0x2af79f=_['map'](db[_0xfef0('0x46')][_0xfef0('0x47')],function(_0x1f252e){return{'name':_0x1f252e[_0xfef0('0x48')],'type':_0x1f252e['type'][_0xfef0('0x49')]};});_0x17d7f2[_0xfef0('0x4a')]=_['map'](_0x2af79f,'name');_0x17d7f2[_0xfef0('0x4b')]=_['keys'](_0x50e372[_0xfef0('0x4b')]);_0x17d7f2[_0xfef0('0x4c')]=_[_0xfef0('0x4d')](_0x17d7f2[_0xfef0('0x4a')],_0x17d7f2[_0xfef0('0x4b')]);_0x18c656[_0xfef0('0x4e')]=_['intersection'](_0x17d7f2[_0xfef0('0x4a')],qs['fields'](_0x50e372['query'][_0xfef0('0x4f')]));_0x18c656[_0xfef0('0x4e')]=_0x18c656[_0xfef0('0x4e')]['length']?_0x18c656[_0xfef0('0x4e')]:_0x17d7f2['model'];if(!_0x50e372['query']['hasOwnProperty'](_0xfef0('0x50'))){_0x18c656[_0xfef0('0x30')]=qs[_0xfef0('0x30')](_0x50e372[_0xfef0('0x4b')][_0xfef0('0x30')]);_0x18c656[_0xfef0('0x2e')]=qs[_0xfef0('0x2e')](_0x50e372[_0xfef0('0x4b')][_0xfef0('0x2e')]);}_0x18c656['order']=qs['sort'](_0x50e372[_0xfef0('0x4b')][_0xfef0('0x51')]);_0x18c656[_0xfef0('0x52')]=qs[_0xfef0('0x4c')](_[_0xfef0('0x53')](_0x50e372[_0xfef0('0x4b')],_0x17d7f2[_0xfef0('0x4c')]),_0x2af79f);var _0x20b647=[];var _0x5e989f=squel[_0xfef0('0x54')]()[_0xfef0('0x55')]('id')[_0xfef0('0x55')](_0xfef0('0x38'))[_0xfef0('0x55')]('color')['from']('tools_tags');var _0x445f3f=squel[_0xfef0('0x54')]()[_0xfef0('0x55')](_0xfef0('0x56'))['field'](_0xfef0('0x57'))[_0xfef0('0x55')](_0xfef0('0x58'))[_0xfef0('0x59')](_0xfef0('0x5a'),'ui')[_0xfef0('0x5b')](_0xfef0('0x5c'),'u','u.id\x20=\x20ui.UserId');var _0x3458b0=squel[_0xfef0('0x54')]()['from'](_0xfef0('0x5d'),'i')['left_join'](_0xfef0('0x5e'),'c',_0xfef0('0x5f'))['left_join'](_0xfef0('0x5c'),'o','o.id\x20=\x20i.UserId')['left_join']('chat_websites','a',_0xfef0('0x60'))[_0xfef0('0x5b')](_0xfef0('0x61'),'me',_0xfef0('0x62'))[_0xfef0('0x5b')](_0xfef0('0x63'),'it','it.ChatInteractionId\x20=\x20i.id')[_0xfef0('0x5b')](_0xfef0('0x64'),'t',_0xfef0('0x65'));var _0x45abb3=squel[_0xfef0('0x66')]();var _0x58d95e=[];var _0x59d1b6=squel['expr']();var _0x135653;if(_0x50e372['query'][_0xfef0('0x67')]){_0x135653=as[_0xfef0('0x68')](_0x50e372[_0xfef0('0x4b')][_0xfef0('0x67')]);var _0xd0255c=_0x135653['sqlOperator'];for(var _0x2abdb7=0x0;_0x2abdb7<_0x135653['conditions'][_0xfef0('0x69')];_0x2abdb7++){var _0x4a1316=_0x135653['conditions'][_0x2abdb7];var _0x3a12c5='i';var _0x3c5640=_[_0xfef0('0x6a')](_0x2af79f,[_0xfef0('0x38'),_0x4a1316[_0xfef0('0x55')]]);if(!_0x3c5640){switch(_0x4a1316[_0xfef0('0x55')]){case _0xfef0('0x6b'):if(_0x4a1316[_0xfef0('0x6c')]==0x1){_0x3458b0[_0xfef0('0x6d')]('`'+_0x4a1316[_0xfef0('0x55')]+_0xfef0('0x6e'));}else{_0x3458b0[_0xfef0('0x6d')]('`'+_0x4a1316['field']+_0xfef0('0x6f'));}break;case _0xfef0('0x70'):if(_0x4a1316[_0xfef0('0x71')]===_0xfef0('0x72')){if(_0x4a1316[_0xfef0('0x6c')]['split']('\x20')[_0xfef0('0x69')]>0x1){_0x45abb3[_0xd0255c](_0xfef0('0x73'),qs[_0xfef0('0x74')](_0x4a1316[_0xfef0('0x6c')]),null);}else{var _0x176fc7='%'+_0x4a1316[_0xfef0('0x6c')]+'%';_0x45abb3[_0xd0255c](_0xfef0('0x75'),_0x176fc7,_0x176fc7,_0x176fc7);}}else{_0x3c5640=_[_0xfef0('0x6a')](_0x2af79f,[_0xfef0('0x38'),_0xfef0('0x76')]);_0x4a1316['field']=_0xfef0('0x76');_0x1d7caf=as['buildExpression'](_0x3a12c5,_0x3c5640[_0xfef0('0x77')],_0x4a1316);_0x45abb3[_0xd0255c](_0x1d7caf[_0xfef0('0x78')],_0x1d7caf['value'][_0xfef0('0x79')],_0x1d7caf[_0xfef0('0x6c')][_0xfef0('0x36')]);}break;case _0xfef0('0x7a'):var _0x1e0ad5=_0x4a1316['value'][_0xfef0('0x42')](',')[_0xfef0('0x7b')](function(_0x2ccb33){return Number(_0x2ccb33);});_0x1e0ad5['forEach'](function(_0x117b74){_0x59d1b6['or'](_0xfef0('0x7c'),'%,'+_0x117b74+',%');});_0x58d95e=_[_0xfef0('0x7d')](_0x58d95e,_0x1e0ad5);break;case _0xfef0('0x7e'):if(_0x4a1316[_0xfef0('0x71')]===_0xfef0('0x72')){_0x45abb3[_0xd0255c](_0xfef0('0x7f'),'%'+_0x4a1316['value']+'%',null);}else{_0x3c5640=_[_0xfef0('0x6a')](_0x2af79f,[_0xfef0('0x38'),_0xfef0('0x80')]);_0x4a1316[_0xfef0('0x55')]=_0xfef0('0x80');_0x1d7caf=as[_0xfef0('0x81')](_0x3a12c5,_0x3c5640['type'],_0x4a1316);_0x45abb3[_0xd0255c](_0x1d7caf[_0xfef0('0x78')],_0x1d7caf[_0xfef0('0x6c')][_0xfef0('0x79')],_0x1d7caf[_0xfef0('0x6c')]['end']);}break;case _0xfef0('0x3b'):_0x1d7caf=as[_0xfef0('0x81')]('me',null,_0x4a1316);_0x45abb3[_0xd0255c](_0x1d7caf['text'],_0x1d7caf[_0xfef0('0x6c')][_0xfef0('0x79')],_0x1d7caf[_0xfef0('0x6c')][_0xfef0('0x36')]);break;}}else{var _0x1d7caf=as['buildExpression'](_0x3a12c5,_0x3c5640['type'],_0x4a1316);_0x45abb3[_0xd0255c](_0x1d7caf['text'],_0x1d7caf[_0xfef0('0x6c')][_0xfef0('0x79')],_0x1d7caf[_0xfef0('0x6c')]['end']);}}}else{var _0x24229e=_(_0x50e372['query'])['keys']()['map'](function(_0x2a92de){return _[_0xfef0('0x82')](_0x2af79f,['name',_0x2a92de])?_0x2a92de:undefined;})[_0xfef0('0x83')]()[_0xfef0('0x6c')]();if(!_[_0xfef0('0x84')](_0x24229e)){_0x24229e['forEach'](function(_0x3f2b55){if(_0x3f2b55==='ChatWebsiteId'){_0x3458b0['where'](_0xfef0('0x85'),[][_0xfef0('0x86')](_0x50e372[_0xfef0('0x4b')][_0x3f2b55]));}else if(_0x3f2b55===_0xfef0('0x87')){var _0x4df63b=JSON['parse'](_0x50e372['query'][_0x3f2b55])[_0xfef0('0x88')];var _0x546455=JSON[_0xfef0('0x89')](_0x50e372[_0xfef0('0x4b')][_0x3f2b55])[_0xfef0('0x8a')];_0x3458b0[_0xfef0('0x52')](_0xfef0('0x8b'),_0x4df63b,_0x546455);}else{if(_0x50e372['query'][_0x3f2b55]===_0xfef0('0x8c')){_0x3458b0['where']('i.'+_0x3f2b55+'\x20IS\x20NULL');}else{_0x3458b0[_0xfef0('0x52')]('i.'+_0x3f2b55+_0xfef0('0x8d'),_0x50e372[_0xfef0('0x4b')][_0x3f2b55]);}}});}if(_0x50e372[_0xfef0('0x4b')]['read']){if(_0x50e372['query'][_0xfef0('0x8e')]==0x1){_0x3458b0[_0xfef0('0x6d')]('`unreadMessages`\x20=\x200');}else{_0x3458b0[_0xfef0('0x6d')](_0xfef0('0x8f'));}}if(_0x50e372[_0xfef0('0x4b')][_0xfef0('0x90')]){_0x58d95e=_[_0xfef0('0x91')](_0x50e372[_0xfef0('0x4b')][_0xfef0('0x90')])?_0x50e372[_0xfef0('0x4b')][_0xfef0('0x90')]:new Array(_0x50e372[_0xfef0('0x4b')][_0xfef0('0x90')]);_0x58d95e[_0xfef0('0x43')](function(_0x3c1136){_0x59d1b6['or'](_0xfef0('0x7c'),'%,'+_0x3c1136+',%');});}if(_0x50e372[_0xfef0('0x4b')][_0xfef0('0x92')]){var _0x1a61e4=_0x50e372['query'][_0xfef0('0x92')][_0xfef0('0x93')]('\x5c','\x5c\x5c')[_0xfef0('0x93')](/'/g,'\x27\x27');if(qs[_0xfef0('0x94')](_0x1a61e4)){_0x45abb3['or'](_0xfef0('0x95'),_0x1a61e4+'%');}else{_0x45abb3['or'](_0xfef0('0x96'),qs[_0xfef0('0x74')](_0x1a61e4))['or'](_0xfef0('0x97'),_0x1a61e4+'%');}}}_0x3458b0[_0xfef0('0x52')](_0x45abb3);_0x3458b0[_0xfef0('0x98')](_0xfef0('0x99'));var _0x17c350={'type':db[_0xfef0('0x9a')]['QueryTypes'][_0xfef0('0x9b')],'raw':!![]};var _0x56af65=_0x3458b0['clone']();_0x56af65[_0xfef0('0x55')](_0xfef0('0x99'));_0x56af65['field'](_0xfef0('0x9c'),'unreadMessages');if(_0x18c656['order']){_0x18c656[_0xfef0('0x9d')][_0xfef0('0x43')](function(_0x4ebcf){var _0x437cb2=_0x4ebcf[0x0]==='contactName'?_0x4ebcf[0x0]:'i.'+_0x4ebcf[0x0];_0x3458b0[_0xfef0('0x9d')](_0x437cb2,_0x4ebcf[0x1]===_0xfef0('0x9e')?![]:!![]);});}if(!_['isEmpty'](_0x58d95e)){_0x3458b0[_0xfef0('0x6d')](_0x59d1b6);_0x56af65[_0xfef0('0x52')](_0xfef0('0x9f'),_0x58d95e);}BPromise['resolve']()['then'](function(){if(!_0x135653){if(_0x50e372[_0xfef0('0x4b')]['ChatWebsiteId'])return;_0x56af65['where'](_0xfef0('0xa0'));_0x3458b0['where'](_0xfef0('0xa0'));return;}if(_0x50e372[_0xfef0('0xa1')][_0xfef0('0xa2')]!==_0xfef0('0xa3'))return;return _0x50e372[_0xfef0('0xa1')][_0xfef0('0xa4')]({'attributes':['id'],'raw':!![]})[_0xfef0('0x22')](function(_0x28cc77){if(_[_0xfef0('0x84')](_0x28cc77)){_0x56af65[_0xfef0('0x52')]('i.ChatWebsiteId\x20IS\x20NULL');_0x3458b0[_0xfef0('0x52')]('i.ChatWebsiteId\x20IS\x20NULL');}else{_0x56af65['where'](_0xfef0('0x85'),_['map'](_0x28cc77,'id'));_0x3458b0[_0xfef0('0x52')](_0xfef0('0x85'),_[_0xfef0('0x7b')](_0x28cc77,'id'));}});})[_0xfef0('0x22')](function(){if(_0x50e372[_0xfef0('0xa1')][_0xfef0('0xa2')]==='agent'&&!_0x135653&&!_0x50e372[_0xfef0('0x4b')][_0xfef0('0xa5')])return[];return db[_0xfef0('0xa6')][_0xfef0('0x4b')](_0x56af65[_0xfef0('0xa7')](),_0x17c350);})[_0xfef0('0x22')](function(_0x3cc27e){_0x5bf416[_0xfef0('0xa8')]=_0x3cc27e['length'];if(_0x5bf416[_0xfef0('0xa8')]===0x0)return[];return db[_0xfef0('0xa6')]['query'](_0x5e989f[_0xfef0('0xa7')](),_0x17c350)[_0xfef0('0x22')](function(_0x221b17){_0x20b647=_['keyBy'](_0x221b17,'id');_0x17c350=_[_0xfef0('0xa9')](_0x17c350,{'model':db['ChatInteraction'],'mapToModel':!![],'raw':!![],'nest':!![]});if(_0x50e372[_0xfef0('0x4b')][_0xfef0('0x4f')]){_0x18c656['attributes'][_0xfef0('0x43')](function(_0x51f79b){_0x3458b0[_0xfef0('0x55')]('i.'+_0x51f79b);});}else{_0x3458b0[_0xfef0('0x55')](_0xfef0('0x9c'),_0xfef0('0x6b'));_0x3458b0[_0xfef0('0x55')](_0xfef0('0xaa'),_0xfef0('0xab'));_0x3458b0[_0xfef0('0x55')](_0xfef0('0xac'),_0xfef0('0xad'));_0x3458b0[_0xfef0('0x55')]('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',_0xfef0('0xae'));_0x3458b0['field']('i.*');_0x3458b0[_0xfef0('0x55')]('c.firstName',_0xfef0('0xaf'));_0x3458b0['field']('c.lastName',_0xfef0('0xb0'));_0x3458b0['field']('c.email','Contact.email');_0x3458b0[_0xfef0('0x55')](_0xfef0('0xb1'),_0xfef0('0xb2'));_0x3458b0[_0xfef0('0x55')]('c.mobile',_0xfef0('0xb3'));_0x3458b0[_0xfef0('0x55')](_0xfef0('0xb4'),_0xfef0('0xb5'));_0x3458b0[_0xfef0('0x55')]('o.fullname','Owner.fullname');_0x3458b0[_0xfef0('0x55')](_0xfef0('0xb6'),'Owner.internal');_0x3458b0[_0xfef0('0x55')](_0xfef0('0xb7'),_0xfef0('0x40'));}if(_0x18c656[_0xfef0('0x30')])_0x3458b0[_0xfef0('0x30')](_0x18c656[_0xfef0('0x30')]);if(_0x18c656[_0xfef0('0x2e')])_0x3458b0[_0xfef0('0x2e')](_0x18c656['offset']);return db['sequelize'][_0xfef0('0x4b')](_0x3458b0[_0xfef0('0xa7')](),_0x17c350);})[_0xfef0('0x22')](function(_0x475eb7){if(_0x475eb7[_0xfef0('0x69')]>0x0)_0x445f3f[_0xfef0('0x52')](_0xfef0('0xb8'),_[_0xfef0('0x7b')](_0x475eb7,'id'));return db['sequelize']['query'](_0x445f3f[_0xfef0('0xa7')](),_0x17c350)[_0xfef0('0x22')](function(_0x374877){var _0xd780bb=_[_0xfef0('0xb9')](_0x374877,_0xfef0('0xba'));var _0x5ac2df=[];_0x475eb7[_0xfef0('0x43')](function(_0x1060c2){_0x5ac2df['push'](updateChatInteraction(_0x1060c2,_0x20b647,_0xd780bb));});return BPromise[_0xfef0('0xbb')](_0x5ac2df);});});})[_0xfef0('0x22')](function(_0x36873f){_0x5bf416[_0xfef0('0xbc')]=_0x36873f;return _0x5bf416;})[_0xfef0('0x22')](respondWithFilteredResult(_0x4b6da1,_0x18c656))[_0xfef0('0x2a')](handleError(_0x4b6da1,null));};exports['show']=function(_0x4dd6e8,_0x1084b9){var _0xd7c5b={'raw':![],'where':{'id':_0x4dd6e8[_0xfef0('0xbd')]['id']}},_0xd2c0be={};_0xd2c0be[_0xfef0('0x4a')]=_[_0xfef0('0xbe')](db['ChatInteraction'][_0xfef0('0x47')]);_0xd2c0be['query']=_[_0xfef0('0xbe')](_0x4dd6e8['query']);_0xd2c0be[_0xfef0('0x4c')]=_[_0xfef0('0x4d')](_0xd2c0be['model'],_0xd2c0be[_0xfef0('0x4b')]);_0xd7c5b[_0xfef0('0x4e')]=_[_0xfef0('0x4d')](_0xd2c0be['model'],qs['fields'](_0x4dd6e8['query'][_0xfef0('0x4f')]));_0xd7c5b['attributes']=_0xd7c5b[_0xfef0('0x4e')][_0xfef0('0x69')]?_0xd7c5b['attributes']:_0xd2c0be[_0xfef0('0x4a')];if(_0x4dd6e8['query'][_0xfef0('0xbf')]){_0xd7c5b[_0xfef0('0xc0')]=[{'all':!![]}];}_0xd7c5b=_[_0xfef0('0xa9')]({},_0xd7c5b,_0x4dd6e8[_0xfef0('0xc1')]);return db[_0xfef0('0x46')][_0xfef0('0x6a')](_0xd7c5b)[_0xfef0('0x22')](handleEntityNotFound(_0x1084b9,null))['then'](respondWithResult(_0x1084b9,null))[_0xfef0('0x2a')](handleError(_0x1084b9,null));};exports[_0xfef0('0xc2')]=function(_0x38f96f,_0x1bdf18){return db[_0xfef0('0x46')][_0xfef0('0xc2')](_0x38f96f[_0xfef0('0x3b')],{})[_0xfef0('0x22')](respondWithResult(_0x1bdf18,0xc9))[_0xfef0('0x2a')](handleError(_0x1bdf18,null));};exports[_0xfef0('0x34')]=function(_0x2a25cb,_0x34f1db){if(_0x2a25cb[_0xfef0('0x3b')]['id']){delete _0x2a25cb[_0xfef0('0x3b')]['id'];}return db['ChatInteraction'][_0xfef0('0x6a')]({'where':{'id':_0x2a25cb[_0xfef0('0xbd')]['id']}})[_0xfef0('0x22')](handleEntityNotFound(_0x34f1db,null))[_0xfef0('0x22')](saveUpdates(_0x2a25cb[_0xfef0('0x3b')],null))[_0xfef0('0x22')](respondWithResult(_0x34f1db,null))[_0xfef0('0x2a')](handleError(_0x34f1db,null));};exports[_0xfef0('0x35')]=function(_0x191072,_0x5b5a15){return db['ChatInteraction'][_0xfef0('0x6a')]({'where':{'id':_0x191072['params']['id']}})[_0xfef0('0x22')](handleEntityNotFound(_0x5b5a15,null))[_0xfef0('0x22')](removeEntity(_0x5b5a15,null))[_0xfef0('0x2a')](handleError(_0x5b5a15,null));};exports[_0xfef0('0xc3')]=function(_0xd9c290,_0x365938){return db[_0xfef0('0x46')][_0xfef0('0xc3')]()[_0xfef0('0x22')](respondWithResult(_0x365938,null))[_0xfef0('0x2a')](handleError(_0x365938,null));};exports[_0xfef0('0xc4')]=function(_0x4c6ddd,_0x17ac08){var _0x40afcb=_0x4c6ddd['params']['id'];var _0xaa5902;var _0x189964;var _0x524db7;return db[_0xfef0('0x46')]['findOne']({'where':{'id':_0x40afcb}})[_0xfef0('0x22')](function(_0x41aadf){_0xaa5902=_0x41aadf;return db[_0xfef0('0xc5')][_0xfef0('0xc6')]({'where':{'id':_0x41aadf[_0xfef0('0xa5')]},'attributes':['id','vidaooApiKey',_0xfef0('0xc7'),_0xfef0('0xc8'),'vidaooNote',_0xfef0('0xc9')],'raw':!![]});})['then'](function(_0x3a180e){if(_0x3a180e&&_0x3a180e[_0xfef0('0xca')]&&_0x3a180e[_0xfef0('0xc7')]){_0x189964=_0x3a180e;var _0x52fb8b={'interaction':{'id':_0x40afcb},'agent':{'id':_0x4c6ddd[_0xfef0('0xa1')]['id'],'name':_0x4c6ddd['user']['name'],'fullname':_0x4c6ddd[_0xfef0('0xa1')]['fullname'],'email':_0x4c6ddd[_0xfef0('0xa1')][_0xfef0('0xcb')]},'contact':_0x4c6ddd[_0xfef0('0x3b')][_0xfef0('0x3c')],'account':_0x4c6ddd[_0xfef0('0x3b')][_0xfef0('0x3e')]};var _0x7f9b61={'rejectUnauthorized':![],'method':'POST','url':'https://api-vidaoo.xcally.com/api/v1/meetings','headers':{'X-APIKEY':_0x3a180e[_0xfef0('0xca')]},'body':{'duration':null,'scheduledAt':null,'participants':[_0x4c6ddd['user'][_0xfef0('0xcb')]],'buttons':null,'topic':_0x189964[_0xfef0('0xc8')],'note':_[_0xfef0('0xcc')](_0x189964[_0xfef0('0xcd')])?null:getMustacheRender(_0x189964[_0xfef0('0xcd')],_0x52fb8b),'metadata':null},'redirect':_0xfef0('0xce'),'json':!![]};try{if(!_[_0xfef0('0xcc')](_0x189964[_0xfef0('0xc9')])){var _0x4a3b68=getMustacheRender(_0x189964['vidaooMetadata'],_0x52fb8b);var _0x3c5471=JSON[_0xfef0('0x89')](_0x4a3b68);_0x7f9b61[_0xfef0('0x3b')][_0xfef0('0xcf')]=_0x3c5471;}}catch(_0xdbd7f2){throw new db['Sequelize']['ValidationError']('Error\x20in\x20conversion\x20vidaooMetadata');}return rp(_0x7f9b61);}else{throw new db[(_0xfef0('0x9a'))][(_0xfef0('0xd0'))]('Error\x20in\x20Vidaoo\x20configuration');}})[_0xfef0('0x22')](function(_0x4f171b){_0x524db7=_0x4f171b;if(_0x524db7['id']){var _0x236523={'body':_0x524db7[_0xfef0('0xd1')],'ChatWebsiteId':_0x189964['id'],'ChatInteractionId':_0xaa5902['id'],'direction':_0xfef0('0xd2'),'UserId':_0x4c6ddd[_0xfef0('0xa1')]['id']};return db[_0xfef0('0xd3')][_0xfef0('0xc2')](_0x236523,{});}else{throw new db[(_0xfef0('0x9a'))][(_0xfef0('0xd0'))](_0xfef0('0xd4'));}})[_0xfef0('0x22')](function(){return _0xaa5902[_0xfef0('0xd5')]({'vidaooSessionId':_0x524db7['id']});})['then'](respondWithResult(_0x17ac08,null))[_0xfef0('0x2a')](handleError(_0x17ac08,null));};exports['customUpdate']=function(_0xf763b1,_0x1fc6a0){if(_0xf763b1[_0xfef0('0x3b')]['id']){delete _0xf763b1[_0xfef0('0x3b')]['id'];}return db[_0xfef0('0x46')][_0xfef0('0x6a')]({'where':{'id':_0xf763b1[_0xfef0('0xbd')]['id']},'include':[{'model':db[_0xfef0('0xd6')],'as':_0xfef0('0x70')}]})['then'](handleEntityNotFound(_0x1fc6a0,null))['then'](saveUpdates(_0xf763b1[_0xfef0('0x3b')],null))['then'](respondWithResult(_0x1fc6a0,null))[_0xfef0('0x2a')](handleError(_0x1fc6a0,null));};exports[_0xfef0('0xd7')]=function(_0x45049d,_0x238112,_0x3a7c93){if(_0x45049d['body']['id']){delete _0x45049d[_0xfef0('0x3b')]['id'];}return db['ChatInteraction'][_0xfef0('0x6a')]({'where':{'id':_0x45049d[_0xfef0('0xbd')]['id']}})['then'](function(_0x34bcc3){if(!_0x34bcc3){logger['error'](_0xfef0('0xd8'),'abandon',0x194,'entity\x20not\x20found');_0x238112[_0xfef0('0x2b')](0x194);}else{if(_0x34bcc3['UserId']){throw new db[(_0xfef0('0x9a'))][(_0xfef0('0xd0'))](_0xfef0('0xd9'));}}return _0x34bcc3;})['then'](function(_0x5c7b35){if(_0x5c7b35){return _0x5c7b35[_0xfef0('0x34')]({'closed':_0x45049d[_0xfef0('0x3b')][_0xfef0('0xda')],'disposition':_0x45049d[_0xfef0('0x3b')][_0xfef0('0xdb')]})[_0xfef0('0x22')](function(_0x3107e2){return _0x3107e2;});}})[_0xfef0('0x22')](function(_0x325d36){return respondWithRpcPromise('AbandonInteraction',_0xfef0('0xd7'),_0x45049d[_0xfef0('0x3b')],client9004);})[_0xfef0('0x22')](respondWithResult(_0x238112,null))[_0xfef0('0x2a')](handleError(_0x238112,null));};exports[_0xfef0('0xdc')]=function(_0xb1df6f,_0x42604b,_0x5969d2){_0xb1df6f[_0xfef0('0x3b')][_0xfef0('0x38')]=_0xb1df6f['file'][_0xfef0('0xdd')];_0xb1df6f[_0xfef0('0x3b')][_0xfef0('0xde')]=_0xb1df6f[_0xfef0('0xdf')][_0xfef0('0xe0')];_0xb1df6f['body'][_0xfef0('0x77')]=_0xb1df6f['file'][_0xfef0('0xe1')];return db['Attachment']['create'](_0xb1df6f['body'])[_0xfef0('0x22')](respondWithResult(_0x42604b,0xc9))['catch'](handleError(_0x42604b,null));};exports['attachmentDownload']=function(_0x25fed0,_0x43453b,_0x4da5b0){return db[_0xfef0('0x46')][_0xfef0('0xc6')]({'where':{'id':_0x25fed0[_0xfef0('0xbd')]['id']},'raw':!![]})['then'](handleEntityNotFound(_0x43453b,null))['then'](function(_0x39a2a7){if(_0x39a2a7){if(_0x39a2a7[_0xfef0('0xda')]){return _0x43453b[_0xfef0('0x2c')](0x193)[_0xfef0('0x2d')]({'status':0x193,'message':_0xfef0('0xe2')});}return db[_0xfef0('0xe3')][_0xfef0('0xc6')]({'where':{'id':_0x25fed0['query'][_0xfef0('0xe4')]},'raw':!![]})[_0xfef0('0x22')](handleEntityNotFound(_0x43453b,null));}})[_0xfef0('0x22')](function(_0x4544fe){if(_0x4544fe){var _0x5c0f32=_0x4544fe['ChatOfflineMessageId']!==null;var _0x461c91=path[_0xfef0('0xe5')](config[_0xfef0('0xe6')],_0xfef0('0xe7'));if(_0x5c0f32){_0x461c91=path[_0xfef0('0xe5')](_0x461c91,_0xfef0('0xe8'));}var _0xe24c2d=path['join'](_0x461c91,_0x4544fe['basename']);return _0x43453b['download'](_0xe24c2d);}})[_0xfef0('0x2a')](handleError(_0x43453b,null));};exports['close']=function(_0x38ac84,_0x4a1406){var _0x2daf2a=null;var _0x4f703e=null;var _0x20cf67=null;var _0x235122=null;if(_0x38ac84[_0xfef0('0x3b')]['id']){delete _0x38ac84[_0xfef0('0x3b')]['id'];}if(_0x38ac84[_0xfef0('0x3b')]['mailTranscript']){_0x235122=path[_0xfef0('0xe5')](config[_0xfef0('0xe6')],_0xfef0('0xe9'),util[_0xfef0('0xea')]('transcript-%s.txt',Date[_0xfef0('0xeb')]()));_0x38ac84['body']['pathTranscript']=_0x235122;}return db[_0xfef0('0x46')]['find']({'where':{'id':_0x38ac84['params']['id']},'include':[{'model':db[_0xfef0('0xd3')],'as':'Messages','include':[{'model':db[_0xfef0('0x7e')],'as':_0xfef0('0x7e')}]}]})[_0xfef0('0x22')](handleEntityNotFound(_0x4a1406,null))[_0xfef0('0x22')](saveUpdates(_0x38ac84[_0xfef0('0x3b')],null))[_0xfef0('0x22')](function(_0x4f6c50){if(_0x4f6c50){_0x2daf2a=_0x4f6c50;return db[_0xfef0('0xc5')][_0xfef0('0x6a')]({'where':{'id':_0x2daf2a[_0xfef0('0xa5')]}});}})['then'](function(_0x3ac462){if(_0x3ac462){_0x20cf67=_0x3ac462;return db['CmContact'][_0xfef0('0x6a')]({'where':{'id':_0x2daf2a[_0xfef0('0x76')]}});}})[_0xfef0('0x22')](function(_0x5ef687){if(_0x5ef687){_0x4f703e=_0x5ef687;if(_0x235122){var _0x906e55=null;for(var _0x4cec7d=0x1;_0x4cec7d<_0x2daf2a['Messages'][_0xfef0('0x69')];++_0x4cec7d){_0x906e55=_0x2daf2a[_0xfef0('0xec')][_0x4cec7d];var _0x58a4ef=_0x906e55[_0xfef0('0x80')]?util[_0xfef0('0xea')](_0xfef0('0xed'),_0x20cf67[_0xfef0('0xee')],_0x906e55['UserId']):_0xfef0('0xef');var _0x484cc3=_0x38ac84[_0xfef0('0x3b')][_0xfef0('0xf0')]||util[_0xfef0('0xea')](_0xfef0('0xed'),_0xfef0('0xf1'),_0x906e55[_0xfef0('0x76')]);switch(_0x20cf67[_0xfef0('0xf2')]){case _0xfef0('0xf3'):_0x58a4ef=_0x906e55[_0xfef0('0x80')]?util['format'](_0xfef0('0xed'),_0x20cf67[_0xfef0('0xee')],_0x906e55['UserId']):_0xfef0('0xef');break;case'agent_alias':_0x58a4ef=_0x906e55[_0xfef0('0x80')]?_0x906e55[_0xfef0('0x7e')][_0xfef0('0xf4')]||_0x906e55[_0xfef0('0x7e')][_0xfef0('0xf5')]:'System';break;case _0xfef0('0xf6'):_0x58a4ef=_0x906e55[_0xfef0('0x80')]?_0x906e55[_0xfef0('0x7e')]['fullname']:'System';break;default:_0x58a4ef=_0x906e55[_0xfef0('0x80')]?util[_0xfef0('0xea')](_0xfef0('0xed'),_0x20cf67[_0xfef0('0xee')],_0x906e55['UserId']):_0xfef0('0xef');}var _0x4b4986=util[_0xfef0('0xea')](_0xfef0('0xf7'),moment(_0x906e55[_0xfef0('0x87')])[_0xfef0('0xea')](_0xfef0('0xf8')),_0x906e55['direction']==='in'?_0x484cc3:_0x58a4ef,_0x906e55[_0xfef0('0x3b')]);if(!_0x906e55[_0xfef0('0xf9')]){fs[_0xfef0('0xfa')](_0x235122,_0x4b4986);}}return db[_0xfef0('0xfb')]['findOne']({'where':{'service':!![]},'include':[{'model':db[_0xfef0('0xfc')],'as':'Smtp','raw':!![]}]});}}})[_0xfef0('0x22')](function(_0x402c7d){if(_0x402c7d&&_0x402c7d[_0xfef0('0xfd')]&&_0x38ac84[_0xfef0('0x3b')]){var _0x5315eb={'tls':{'rejectUnauthorized':![]}};if(_0x402c7d['Smtp'][_0xfef0('0xfe')]){_0x5315eb[_0xfef0('0xfe')]=_0x402c7d[_0xfef0('0xfd')][_0xfef0('0xfe')];}else{_0x5315eb[_0xfef0('0xff')]=_0x402c7d[_0xfef0('0xfd')][_0xfef0('0xff')];_0x5315eb['port']=_0x402c7d['Smtp'][_0xfef0('0x100')];_0x5315eb[_0xfef0('0x101')]=_0x402c7d['Smtp'][_0xfef0('0x101')];}if(_0x402c7d['Smtp']['authentication']){_0x5315eb[_0xfef0('0x102')]={'user':_0x402c7d[_0xfef0('0xfd')][_0xfef0('0xa1')],'pass':_0x402c7d[_0xfef0('0xfd')][_0xfef0('0x103')]};}return respondWithRpcPromise('SendMail',_0xfef0('0x104'),{'account':_0x5315eb,'message':{'from':util[_0xfef0('0xea')](_0xfef0('0x105'),_0x402c7d[_0xfef0('0x38')],_0x402c7d['email']||_0x402c7d['Smtp']['user']),'to':_0x38ac84[_0xfef0('0x3b')]['mailTranscript'],'subject':_0xfef0('0x106'),'text':util['format']('Hi\x20%s,\x20attached\x20you\x20can\x20find\x20your\x20transcript\x20file.\x20\x0a\x0aRegards.\x20\x0a\x0a',_0x38ac84['body'][_0xfef0('0x107')]),'attachments':[{'path':_0x235122}]}})[_0xfef0('0x22')](function(){return _0x2daf2a;})['catch'](function(_0x411870){console['error'](_0x411870);});}else{return _0x2daf2a;}})[_0xfef0('0x22')](respondWithStatusCode(_0x4a1406,0xc8))[_0xfef0('0x2a')](handleError(_0x4a1406,null));};exports[_0xfef0('0x108')]=function(_0x9b2969,_0x1f842f,_0x36c978){return db[_0xfef0('0xd3')][_0xfef0('0x6a')]({'where':{'id':_0x9b2969[_0xfef0('0xbd')]['id']}})[_0xfef0('0x22')](handleEntityNotFound(_0x1f842f,null))['then'](function(_0x1d342a){if(_0x1d342a){return _0x1d342a[_0xfef0('0x108')](_0x9b2969['body'][_0xfef0('0x109')],_['omit'](_0x9b2969[_0xfef0('0x3b')],[_0xfef0('0x109'),'id'])||{});}})[_0xfef0('0x22')](respondWithResult(_0x1f842f,null))[_0xfef0('0x2a')](handleError(_0x1f842f,null));};exports[_0xfef0('0x10a')]=function(_0x422af1,_0xcb9eb8,_0x38e829){var _0x287403={'raw':![],'where':{}};var _0x2ebd8d={};var _0x115454={'count':0x0,'rows':[]};return db[_0xfef0('0x46')][_0xfef0('0xc6')]({'where':{'id':_0x422af1[_0xfef0('0xbd')]['id']}})['then'](handleEntityNotFound(_0xcb9eb8,null))[_0xfef0('0x22')](function(_0x5593de){if(_0x5593de){_0x2ebd8d['model']=_[_0xfef0('0xbe')](db['ChatMessage'][_0xfef0('0x47')]);_0x2ebd8d[_0xfef0('0x4b')]=_[_0xfef0('0xbe')](_0x422af1['query']);_0x2ebd8d[_0xfef0('0x4c')]=_[_0xfef0('0x4d')](_0x2ebd8d[_0xfef0('0x4a')],_0x2ebd8d[_0xfef0('0x4b')]);_0x287403[_0xfef0('0x4e')]=_[_0xfef0('0x4d')](_0x2ebd8d[_0xfef0('0x4a')],qs[_0xfef0('0x4f')](_0x422af1[_0xfef0('0x4b')][_0xfef0('0x4f')]));_0x287403[_0xfef0('0x4e')]=_0x287403[_0xfef0('0x4e')][_0xfef0('0x69')]?_0x287403[_0xfef0('0x4e')]:_0x2ebd8d['model'];if(!_0x422af1[_0xfef0('0x4b')]['hasOwnProperty'](_0xfef0('0x50'))){_0x287403['limit']=qs[_0xfef0('0x30')](_0x422af1[_0xfef0('0x4b')][_0xfef0('0x30')]);_0x287403[_0xfef0('0x2e')]=qs[_0xfef0('0x2e')](_0x422af1['query']['offset']);}_0x287403[_0xfef0('0x9d')]=qs[_0xfef0('0x51')](_0x422af1['query'][_0xfef0('0x51')]);_0x287403[_0xfef0('0x52')]=qs[_0xfef0('0x4c')](_[_0xfef0('0x53')](_0x422af1[_0xfef0('0x4b')],_0x2ebd8d[_0xfef0('0x4c')]));_0x287403[_0xfef0('0x52')][_0xfef0('0xba')]=_0x5593de['id'];if(_0x422af1['query'][_0xfef0('0x92')]){_0x287403[_0xfef0('0x52')]=_['merge'](_0x287403[_0xfef0('0x52')],{'$or':_['map'](_0x287403[_0xfef0('0x4e')],function(_0x41790c){var _0x189965={};_0x189965[_0x41790c]={'$like':'%'+_0x422af1[_0xfef0('0x4b')][_0xfef0('0x92')]+'%'};return _0x189965;})});}if(_0x422af1[_0xfef0('0x4b')][_0xfef0('0x88')]){var _0x5b1b34=_0x422af1[_0xfef0('0x4b')][_0xfef0('0x88')]['split'](',');var _0xfa83e1={};_0xfa83e1[_0x5b1b34[0x0]]={'$gte':moment(_0x5b1b34[0x1])[_0xfef0('0xea')](_0xfef0('0x10b'))};_0x287403['where']=_[_0xfef0('0xa9')](_0x287403[_0xfef0('0x52')],_0xfa83e1);}_0x287403=_[_0xfef0('0xa9')]({},_0x287403,_0x422af1[_0xfef0('0xc1')]);return db[_0xfef0('0xd3')][_0xfef0('0xa8')]({'where':_0x287403[_0xfef0('0x52')]})[_0xfef0('0x22')](function(_0x464d00){_0x115454[_0xfef0('0xa8')]=_0x464d00;if(_0x422af1['query'][_0xfef0('0xbf')]){_0x287403[_0xfef0('0xc0')]=[{'all':!![]}];}return db[_0xfef0('0xd3')][_0xfef0('0x10c')](_0x287403);})[_0xfef0('0x22')](function(_0x1b23f0){_0x115454['rows']=_0x1b23f0;return _0x115454;});}})['then'](respondWithFilteredResult(_0xcb9eb8,_0x287403))[_0xfef0('0x2a')](handleError(_0xcb9eb8,null));};exports['getMyMessages']=function(_0x30f7d5,_0x1a53fa,_0x14a37e){var _0x303128={'where':{}},_0x2b3263={},_0x43e758={'count':0x0,'rows':[]};return db['ChatInteraction'][_0xfef0('0xc6')]({'where':{'id':_0x30f7d5[_0xfef0('0xbd')]['id']}})[_0xfef0('0x22')](handleEntityNotFound(_0x1a53fa,null))[_0xfef0('0x22')](function(_0x273e8b){if(_0x273e8b){_0x2b3263[_0xfef0('0x4a')]=_[_0xfef0('0xbe')](db['ChatMessage'][_0xfef0('0x47')]);_0x2b3263[_0xfef0('0x4b')]=_[_0xfef0('0xbe')](_0x30f7d5[_0xfef0('0x4b')]);_0x2b3263[_0xfef0('0x4c')]=_[_0xfef0('0x4d')](_0x2b3263['model'],_0x2b3263['query']);_0x303128[_0xfef0('0x4e')]=_[_0xfef0('0x4d')](_0x2b3263[_0xfef0('0x4a')],qs[_0xfef0('0x4f')](_0x30f7d5[_0xfef0('0x4b')][_0xfef0('0x4f')]));_0x303128[_0xfef0('0x4e')]=_0x303128[_0xfef0('0x4e')][_0xfef0('0x69')]?_0x303128[_0xfef0('0x4e')]:_0x2b3263[_0xfef0('0x4a')];if(!_0x30f7d5['query'][_0xfef0('0x10d')](_0xfef0('0x50'))){_0x303128[_0xfef0('0x30')]=qs[_0xfef0('0x30')](_0x30f7d5[_0xfef0('0x4b')][_0xfef0('0x30')]);_0x303128['offset']=qs[_0xfef0('0x2e')](_0x30f7d5[_0xfef0('0x4b')][_0xfef0('0x2e')]);}_0x303128[_0xfef0('0x9d')]=qs['sort'](_0x30f7d5[_0xfef0('0x4b')][_0xfef0('0x51')]);_0x303128['where']=qs[_0xfef0('0x4c')](_[_0xfef0('0x53')](_0x30f7d5[_0xfef0('0x4b')],_0x2b3263[_0xfef0('0x4c')]));_0x303128[_0xfef0('0x52')][_0xfef0('0xba')]=_0x273e8b['id'];if(_0x30f7d5[_0xfef0('0x4b')][_0xfef0('0x92')]){_0x303128['where']=_[_0xfef0('0xa9')](_0x303128[_0xfef0('0x52')],{'$or':_['map'](_0x303128['attributes'],function(_0x3081e){var _0xd34b68={};_0xd34b68[_0x3081e]={'$like':'%'+_0x30f7d5[_0xfef0('0x4b')]['filter']+'%'};return _0xd34b68;})});}_0x303128[_0xfef0('0x52')][_0xfef0('0xf9')]=![];if(_0x30f7d5['query']['id']){_0x303128[_0xfef0('0x52')]['id']={'$gt':_0x30f7d5[_0xfef0('0x4b')]['id']};}_0x303128=_[_0xfef0('0xa9')]({},_0x303128,_0x30f7d5[_0xfef0('0xc1')]);return db[_0xfef0('0xd3')]['count']({'where':_0x303128[_0xfef0('0x52')]})['then'](function(_0x63bcae){_0x43e758['count']=_0x63bcae;_0x303128[_0xfef0('0xc0')]=[];if(_0x30f7d5[_0xfef0('0x4b')][_0xfef0('0x10e')]){_0x303128['include'][_0xfef0('0x44')]({'model':db[_0xfef0('0x7e')],'as':'User','attributes':['id','fullname',_0xfef0('0xf4')]});}if(_0x30f7d5[_0xfef0('0x4b')][_0xfef0('0xbf')]){_0x303128['include']=[{'all':!![]}];}return db[_0xfef0('0xd3')][_0xfef0('0x10c')](_0x303128);})['then'](function(_0x527d0d){_0x43e758[_0xfef0('0xbc')]=_0x527d0d;return _0x43e758;});}})[_0xfef0('0x22')](respondWithFilteredResult(_0x1a53fa,_0x303128))['catch'](handleError(_0x1a53fa,null));};exports[_0xfef0('0x10f')]=function(_0x3f68ed,_0x45a5e8,_0x33cecb){return db[_0xfef0('0x46')][_0xfef0('0x6a')]({'where':{'id':_0x3f68ed[_0xfef0('0xbd')]['id']}})[_0xfef0('0x22')](handleEntityNotFound(_0x45a5e8,null))[_0xfef0('0x22')](function(_0x53ce05){if(_0x53ce05){return _0x53ce05[_0xfef0('0x110')](_0x3f68ed[_0xfef0('0x3b')][_0xfef0('0x109')],_[_0xfef0('0x111')](_0x3f68ed[_0xfef0('0x3b')],[_0xfef0('0x109'),'id'])||{})['spread'](function(){return db[_0xfef0('0x7a')][_0xfef0('0x10c')]({'attributes':['id','name','color'],'where':{'id':_0x3f68ed[_0xfef0('0x3b')][_0xfef0('0x109')]}});})[_0xfef0('0x22')](function(_0x4697ee){socket[_0xfef0('0x112')]('chatInteractionTags:save',{'id':Number(_0x3f68ed[_0xfef0('0xbd')]['id']),'tags':_0x4697ee||[]});return{'id':Number(_0x3f68ed[_0xfef0('0xbd')]['id']),'tags':_0x4697ee||[]};});}})[_0xfef0('0x22')](respondWithResult(_0x45a5e8,null))['catch'](handleError(_0x45a5e8,null));};exports[_0xfef0('0x113')]=function(_0x2a229b,_0xcb6d50,_0x53ed7e){return db['ChatInteraction'][_0xfef0('0x6a')]({'where':{'id':_0x2a229b[_0xfef0('0xbd')]['id']}})[_0xfef0('0x22')](handleEntityNotFound(_0xcb6d50,null))['then'](function(_0x241763){if(_0x241763){return _0x241763[_0xfef0('0x113')](_0x2a229b['query'][_0xfef0('0x109')]);}})[_0xfef0('0x22')](respondWithStatusCode(_0xcb6d50,null))['catch'](handleError(_0xcb6d50,null));};exports[_0xfef0('0x114')]=function(_0x57e2d8,_0x3fdeae){var _0x30b0a9=moment()[_0xfef0('0x115')]()['toString']();var _0x416d36=path[_0xfef0('0xe5')](config['root'],_0xfef0('0x116'),_0xfef0('0x117'),_0xfef0('0x118'));var _0x50b3d7=path[_0xfef0('0xe5')](config[_0xfef0('0xe6')],_0xfef0('0x116'),_0xfef0('0x117'),_0xfef0('0x119'));var _0x2a9a1e=path[_0xfef0('0xe5')](_0x416d36,_0x30b0a9);var _0x584c9b=util[_0xfef0('0xea')](_0xfef0('0x11a'),_0x57e2d8[_0xfef0('0xbd')]['id'],_0x30b0a9);var _0x4f4c4e=path[_0xfef0('0xe5')](_0x416d36,_0x584c9b);var _0x1c6ab9=[];_0x1c6ab9[_0xfef0('0x44')]({'model':db[_0xfef0('0x7e')],'as':_0xfef0('0x7e'),'attributes':['id',_0xfef0('0xf5')],'raw':!![]});_0x1c6ab9['push']({'model':db[_0xfef0('0xd6')],'as':'Contact','attributes':['id',_0xfef0('0x11b'),_0xfef0('0x11c')],'raw':!![]});if(_0x57e2d8[_0xfef0('0x4b')][_0xfef0('0x119')]){_0x1c6ab9[_0xfef0('0x44')]({'model':db[_0xfef0('0xe3')],'as':'Attachment','raw':!![]});}var _0x937d8e=[{'model':db[_0xfef0('0xd3')],'as':_0xfef0('0xec'),'attributes':['id',_0xfef0('0x3b'),'createdAt',_0xfef0('0x11d'),_0xfef0('0xf9'),'read'],'include':_0x1c6ab9}];_0x937d8e['push']({'model':db[_0xfef0('0xc5')],'as':_0xfef0('0x11e'),'attributes':['id',_0xfef0('0x38')]});_0x937d8e[_0xfef0('0x44')]({'model':db['User'],'as':'Owner','attributes':['id',_0xfef0('0xf5')]});return db[_0xfef0('0x46')][_0xfef0('0x6a')]({'where':{'id':_0x57e2d8[_0xfef0('0xbd')]['id']},'include':_0x937d8e})[_0xfef0('0x22')](handleEntityNotFound(_0x3fdeae,null))['then'](function(_0x2978cc){if(_0x2978cc){var _0x81bcee=_0x2978cc['get']({'plain':!![]});fs[_0xfef0('0x11f')](_0x2a9a1e);var _0xc8d0ca={'channel':_0xfef0('0x120'),'account':_0x81bcee[_0xfef0('0x11e')][_0xfef0('0x38')],'agent':_0x81bcee[_0xfef0('0x121')]?_0x81bcee['Owner']['fullname']:_0xfef0('0x122'),'createdAt':moment(_0x81bcee[_0xfef0('0x87')])[_0xfef0('0xea')](_0xfef0('0x10b'))['toString'](),'closedAt':_0x81bcee['closed']?moment(_0x81bcee['closedAt'])[_0xfef0('0xea')](_0xfef0('0x10b'))[_0xfef0('0xa7')]():'','disposition':_0x81bcee[_0xfef0('0xdb')],'chatInfo':{'browser':_0x81bcee[_0xfef0('0x123')],'os':_0x81bcee[_0xfef0('0x124')],'referer':_0x81bcee['referer'],'customerIp':_0x81bcee['customerIp'],'customerPort':_0x81bcee['customerPort']?_0x81bcee['customerPort']:'N.A.'},'messages':_(_0x81bcee[_0xfef0('0xec')])['tail']()[_0xfef0('0x92')]({'secret':![]})[_0xfef0('0x7b')](function(_0x46ab62){if(_0x46ab62[_0xfef0('0xe3')]){var _0x3507a8=path['join'](_0x50b3d7,_0x46ab62[_0xfef0('0xe3')][_0xfef0('0xde')]);if(fs[_0xfef0('0x125')](_0x3507a8)){fs['createReadStream'](_0x3507a8)[_0xfef0('0x126')](fs[_0xfef0('0x127')](path[_0xfef0('0xe5')](_0x2a9a1e,_0x46ab62[_0xfef0('0xe3')][_0xfef0('0xde')])));}}return{'date':moment(_0x46ab62[_0xfef0('0x87')])[_0xfef0('0xea')](_0xfef0('0x10b'))[_0xfef0('0xa7')](),'sender':_0x46ab62[_0xfef0('0x11d')]===_0xfef0('0xd2')?_0x46ab62[_0xfef0('0x7e')]?_0x46ab62[_0xfef0('0x7e')][_0xfef0('0xf5')]:_0xfef0('0xef'):_0x46ab62[_0xfef0('0x70')][_0xfef0('0x11b')]+(_0x46ab62[_0xfef0('0x70')][_0xfef0('0x11c')]?'\x20'+_0x46ab62[_0xfef0('0x70')]['lastName']:''),'body':_0x46ab62['Attachment']?_0x46ab62['Attachment']['basename']:_0x46ab62[_0xfef0('0x3b')],'direction':_0x46ab62[_0xfef0('0x11d')]===_0xfef0('0xd2')?'A':'C','secret':_0x46ab62['secret'],'read':_0x46ab62[_0xfef0('0x8e')],'attachment':_0x46ab62[_0xfef0('0xe3')]};})[_0xfef0('0x6c')]()};return ejs[_0xfef0('0x128')](path['join'](config['root'],'server',_0xfef0('0x129'),_0xfef0('0x12a')),{'interaction':_0xc8d0ca})[_0xfef0('0x22')](function(_0x2b1f64){var _0x55ecff=path[_0xfef0('0xe5')](_0x2a9a1e,_0xfef0('0x12b')+_0x81bcee['id']+'-'+_0x30b0a9+'.pdf');var _0x409147={'path':_0x55ecff,'channel':_0xfef0('0x120'),'interactionId':_0x81bcee['id']};return pdf[_0xfef0('0x12c')](_0x2b1f64,_0x409147);})[_0xfef0('0x22')](function(){return new BPromise(function(_0x27856d,_0x44081d){zipdir(_0x2a9a1e,{'saveTo':_0x4f4c4e},function(_0x177c9b,_0x322672){if(_0x177c9b)return _0x44081d(_0x177c9b);return _0x27856d(_0x322672);});})[_0xfef0('0x22')](function(){return new BPromise(function(_0x102b4e,_0x2a206b){rimraf(_0x2a9a1e,function(_0x279f5b){if(_0x279f5b)_0x2a206b(_0x279f5b);return _0x102b4e();});});})[_0xfef0('0x22')](function(){return _0x3fdeae[_0xfef0('0x114')](_0x4f4c4e,_0x584c9b,function(_0x44603e){if(_0x44603e){console['log'](_0xfef0('0x12d'),_0x44603e);}else{fs['unlinkSync'](_0x4f4c4e);}});});});}else{return _0x3fdeae[_0xfef0('0x2b')](0xc8);}})['catch'](handleError(_0x3fdeae,null));};
\ No newline at end of file
diff --git a/server/api/chatInteraction/chatInteraction.events.js b/server/api/chatInteraction/chatInteraction.events.js
index 08f5b28..c5e7a2a 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 _0xf70d=['remove','getUsers','then','Users','map','length','emit','catch','hasOwnProperty','hook','exports','events','ChatInteraction','../../mysqldb','setMaxListeners','save','update'];(function(_0x19148e,_0x4b771d){var _0x73539a=function(_0x390d98){while(--_0x390d98){_0x19148e['push'](_0x19148e['shift']());}};_0x73539a(++_0x4b771d);}(_0xf70d,0x192));var _0xdf70=function(_0x13ce0c,_0x3f2a0d){_0x13ce0c=_0x13ce0c-0x0;var _0x4388fb=_0xf70d[_0x13ce0c];return _0x4388fb;};'use strict';var EventEmitter=require(_0xdf70('0x0'));var ChatInteraction=require('../../mysqldb')['db'][_0xdf70('0x1')];var ChatMessage=require(_0xdf70('0x2'))['db']['ChatMessage'];var ChatInteractionEvents=new EventEmitter();ChatInteractionEvents[_0xdf70('0x3')](0x0);var events={'afterCreate':_0xdf70('0x4'),'afterUpdate':_0xdf70('0x5'),'afterDestroy':_0xdf70('0x6')};function emitEvent(_0x3b51d6){return function(_0x492c81,_0x57d1a7,_0x3ee28a){_0x492c81[_0xdf70('0x7')]({'attributes':['id'],'raw':!![]})[_0xdf70('0x8')](function(_0x47d6c9){_0x492c81['setDataValue'](_0xdf70('0x9'),_0x47d6c9[_0xdf70('0xa')](function(_0xaaa3ec){return{'id':_0xaaa3ec['id']};}));return ChatMessage['findAll']({'where':{'ChatInteractionId':_0x492c81['id'],'direction':'in','read':![]},'raw':!![]});})[_0xdf70('0x8')](function(_0x2036b3){_0x492c81['setDataValue']('unreadMessages',_0x2036b3[_0xdf70('0xb')]);ChatInteractionEvents[_0xdf70('0xc')](_0x3b51d6+':'+_0x492c81['id'],_0x492c81);ChatInteractionEvents[_0xdf70('0xc')](_0x3b51d6,_0x492c81);_0x3ee28a(null);})[_0xdf70('0xd')](_0x3ee28a(null));};}for(var e in events){if(events[_0xdf70('0xe')](e)){var event=events[e];ChatInteraction[_0xdf70('0xf')](e,emitEvent(event));}}module[_0xdf70('0x10')]=ChatInteractionEvents;
\ No newline at end of file
+var _0xc5ab=['catch','hasOwnProperty','hook','../../mysqldb','save','update','remove','then','setDataValue','Users','findAll','unreadMessages','length','emit'];(function(_0x35d2d6,_0x14e944){var _0x1637d5=function(_0x327b04){while(--_0x327b04){_0x35d2d6['push'](_0x35d2d6['shift']());}};_0x1637d5(++_0x14e944);}(_0xc5ab,0x73));var _0xbc5a=function(_0x3566b7,_0x408f7c){_0x3566b7=_0x3566b7-0x0;var _0x10fdc1=_0xc5ab[_0x3566b7];return _0x10fdc1;};'use strict';var EventEmitter=require('events');var ChatInteraction=require(_0xbc5a('0x0'))['db']['ChatInteraction'];var ChatMessage=require(_0xbc5a('0x0'))['db']['ChatMessage'];var ChatInteractionEvents=new EventEmitter();ChatInteractionEvents['setMaxListeners'](0x0);var events={'afterCreate':_0xbc5a('0x1'),'afterUpdate':_0xbc5a('0x2'),'afterDestroy':_0xbc5a('0x3')};function emitEvent(_0x1d8791){return function(_0x28b068,_0x296403,_0x2ab4a0){_0x28b068['getUsers']({'attributes':['id'],'raw':!![]})[_0xbc5a('0x4')](function(_0x54f751){_0x28b068[_0xbc5a('0x5')](_0xbc5a('0x6'),_0x54f751['map'](function(_0x21ad58){return{'id':_0x21ad58['id']};}));return ChatMessage[_0xbc5a('0x7')]({'where':{'ChatInteractionId':_0x28b068['id'],'direction':'in','read':![]},'raw':!![]});})[_0xbc5a('0x4')](function(_0x13ac20){_0x28b068[_0xbc5a('0x5')](_0xbc5a('0x8'),_0x13ac20[_0xbc5a('0x9')]);ChatInteractionEvents['emit'](_0x1d8791+':'+_0x28b068['id'],_0x28b068);ChatInteractionEvents[_0xbc5a('0xa')](_0x1d8791,_0x28b068);_0x2ab4a0(null);})[_0xbc5a('0xb')](_0x2ab4a0(null));};}for(var e in events){if(events[_0xbc5a('0xc')](e)){var event=events[e];ChatInteraction[_0xbc5a('0xd')](e,emitEvent(event));}}module['exports']=ChatInteractionEvents;
\ No newline at end of file
diff --git a/server/api/chatInteraction/chatInteraction.model.js b/server/api/chatInteraction/chatInteraction.model.js
index 0be0383..6223ac2 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 _0xaa99=['request-promise','path','rimraf','../../config/environment','./chatInteraction.attributes','define','ChatInteraction','chat_interactions','changed','closed','closedAt','format','utf8mb4','utf8mb4_unicode_ci','lodash','util','api','moment','bluebird'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xaa99,0x1b0));var _0x9aa9=function(_0x494ea5,_0x234211){_0x494ea5=_0x494ea5-0x0;var _0x3e6800=_0xaa99[_0x494ea5];return _0x3e6800;};'use strict';var _=require(_0x9aa9('0x0'));var util=require(_0x9aa9('0x1'));var logger=require('../../config/logger')(_0x9aa9('0x2'));var moment=require(_0x9aa9('0x3'));var BPromise=require(_0x9aa9('0x4'));var rp=require(_0x9aa9('0x5'));var fs=require('fs');var path=require(_0x9aa9('0x6'));var rimraf=require(_0x9aa9('0x7'));var config=require(_0x9aa9('0x8'));var attributes=require(_0x9aa9('0x9'));module['exports']=function(_0x55aea9,_0x2029d1){return _0x55aea9[_0x9aa9('0xa')](_0x9aa9('0xb'),attributes,{'tableName':_0x9aa9('0xc'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x20b0b4,_0x4ee185,_0x1af795){if(_0x20b0b4[_0x9aa9('0xd')](_0x9aa9('0xe'))){_0x20b0b4[_0x9aa9('0xf')]=moment()[_0x9aa9('0x10')]('YYYY-MM-DD\x20HH:mm:ss');}_0x1af795(null,_0x20b0b4);}},'charset':_0x9aa9('0x11'),'collate':_0x9aa9('0x12')});};
\ No newline at end of file
+var _0xafa1=['define','ChatInteraction','chat_interactions','closed','format','YYYY-MM-DD\x20HH:mm:ss','utf8mb4','utf8mb4_unicode_ci','util','../../config/logger','api','moment','bluebird','request-promise','path','../../config/environment','./chatInteraction.attributes','exports'];(function(_0x40b2ed,_0x2b1765){var _0x18397d=function(_0xc6a86f){while(--_0xc6a86f){_0x40b2ed['push'](_0x40b2ed['shift']());}};_0x18397d(++_0x2b1765);}(_0xafa1,0x1a6));var _0x1afa=function(_0x5b862e,_0x3bc15f){_0x5b862e=_0x5b862e-0x0;var _0x4d2295=_0xafa1[_0x5b862e];return _0x4d2295;};'use strict';var _=require('lodash');var util=require(_0x1afa('0x0'));var logger=require(_0x1afa('0x1'))(_0x1afa('0x2'));var moment=require(_0x1afa('0x3'));var BPromise=require(_0x1afa('0x4'));var rp=require(_0x1afa('0x5'));var fs=require('fs');var path=require(_0x1afa('0x6'));var rimraf=require('rimraf');var config=require(_0x1afa('0x7'));var attributes=require(_0x1afa('0x8'));module[_0x1afa('0x9')]=function(_0x12282a,_0x2e6a0e){return _0x12282a[_0x1afa('0xa')](_0x1afa('0xb'),attributes,{'tableName':_0x1afa('0xc'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x1267b8,_0x5d3dab,_0x327c03){if(_0x1267b8['changed'](_0x1afa('0xd'))){_0x1267b8['closedAt']=moment()[_0x1afa('0xe')](_0x1afa('0xf'));}_0x327c03(null,_0x1267b8);}},'charset':_0x1afa('0x10'),'collate':_0x1afa('0x11')});};
\ No newline at end of file
diff --git a/server/api/chatInteraction/chatInteraction.rpc.js b/server/api/chatInteraction/chatInteraction.rpc.js
index b3d409a..9fbc4f4 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 _0x54b6=['localhost','redis','./chatInteraction.socket','register','request','then','ChatInteraction,\x20%s,\x20%s','request\x20sent','debug','error','code','message','info','result','catch','ChatInteraction','update','options','limit','UpdateChatInteraction','stringify','AddTagsToChatInteraction','where','addTags','body','ids','omit','spread','AddTags','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','http'];(function(_0x5f4c1c,_0x4f50b9){var _0x1d5999=function(_0x55400b){while(--_0x55400b){_0x5f4c1c['push'](_0x5f4c1c['shift']());}};_0x1d5999(++_0x4f50b9);}(_0x54b6,0x1ca));var _0x654b=function(_0x39d544,_0x35c14f){_0x39d544=_0x39d544-0x0;var _0x5a5ff2=_0x54b6[_0x39d544];return _0x5a5ff2;};'use strict';var _=require('lodash');var util=require(_0x654b('0x0'));var moment=require(_0x654b('0x1'));var BPromise=require(_0x654b('0x2'));var rs=require(_0x654b('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x654b('0x4'))['db'];var utils=require(_0x654b('0x5'));var logger=require(_0x654b('0x6'))(_0x654b('0x7'));var config=require(_0x654b('0x8'));var jayson=require('jayson/promise');var client=jayson['client'][_0x654b('0x9')]({'port':0x232a});config['redis']=_['defaults'](config['redis'],{'host':_0x654b('0xa'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x654b('0xb')]));require(_0x654b('0xc'))[_0x654b('0xd')](socket);function respondWithRpcPromise(_0x56a735,_0x232c17,_0xcc5e43){return new BPromise(function(_0x4f5031,_0x55a335){return client[_0x654b('0xe')](_0x56a735,_0xcc5e43)[_0x654b('0xf')](function(_0x38a898){logger['info'](_0x654b('0x10'),_0x232c17,_0x654b('0x11'));logger[_0x654b('0x12')]('ChatInteraction,\x20%s,\x20%s,\x20%s',_0x232c17,_0x654b('0x11'),JSON['stringify'](_0x38a898));if(_0x38a898['error']){if(_0x38a898[_0x654b('0x13')][_0x654b('0x14')]===0x1f4){logger[_0x654b('0x13')](_0x654b('0x10'),_0x232c17,_0x38a898[_0x654b('0x13')][_0x654b('0x15')]);return _0x55a335(_0x38a898['error'][_0x654b('0x15')]);}logger[_0x654b('0x13')]('ChatInteraction,\x20%s,\x20%s',_0x232c17,_0x38a898[_0x654b('0x13')][_0x654b('0x15')]);return _0x4f5031(_0x38a898[_0x654b('0x13')]['message']);}else{logger[_0x654b('0x16')](_0x654b('0x10'),_0x232c17,_0x654b('0x11'));_0x4f5031(_0x38a898[_0x654b('0x17')][_0x654b('0x15')]);}})[_0x654b('0x18')](function(_0x8eb8f7){logger[_0x654b('0x13')](_0x654b('0x10'),_0x232c17,_0x8eb8f7);_0x55a335(_0x8eb8f7);});});}exports['UpdateChatInteraction']=function(_0x5de6e6){var _0x480582=this;return new Promise(function(_0x1226de,_0x820b5){return db[_0x654b('0x19')][_0x654b('0x1a')](_0x5de6e6['body'],{'raw':_0x5de6e6[_0x654b('0x1b')]?_0x5de6e6[_0x654b('0x1b')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x5de6e6[_0x654b('0x1b')]?_0x5de6e6[_0x654b('0x1b')]['where']||null:null,'attributes':_0x5de6e6[_0x654b('0x1b')]?_0x5de6e6[_0x654b('0x1b')]['attributes']||null:null,'limit':_0x5de6e6[_0x654b('0x1b')]?_0x5de6e6[_0x654b('0x1b')][_0x654b('0x1c')]||null:null})[_0x654b('0xf')](function(_0x1174da){logger[_0x654b('0x16')](_0x654b('0x1d'),_0x5de6e6);logger[_0x654b('0x12')]('UpdateChatInteraction',_0x5de6e6,JSON[_0x654b('0x1e')](_0x1174da));_0x1226de(_0x1174da);})[_0x654b('0x18')](function(_0x1663a5){logger[_0x654b('0x13')](_0x654b('0x1d'),_0x1663a5[_0x654b('0x15')],_0x5de6e6);_0x820b5(_0x480582[_0x654b('0x13')](0x1f4,_0x1663a5[_0x654b('0x15')]));});});};exports[_0x654b('0x1f')]=function(_0x4a1c0d){return new Promise(function(_0x27a2b9,_0x2d4a02){return db[_0x654b('0x19')]['find']({'where':_0x4a1c0d[_0x654b('0x1b')]?_0x4a1c0d['options'][_0x654b('0x20')]||null:null})['then'](function(_0x12e50b){if(_0x12e50b){return _0x12e50b[_0x654b('0x21')](_0x4a1c0d[_0x654b('0x22')][_0x654b('0x23')],_[_0x654b('0x24')](_0x4a1c0d[_0x654b('0x22')],[_0x654b('0x23'),'id'])||{});}})[_0x654b('0x25')](function(_0x3fdf4e){logger[_0x654b('0x16')](_0x654b('0x26'),_0x4a1c0d);logger[_0x654b('0x12')](_0x654b('0x26'),_0x4a1c0d,JSON[_0x654b('0x1e')](_0x3fdf4e));_0x27a2b9(_0x3fdf4e);})['catch'](function(_0x3d9294){logger[_0x654b('0x13')](_0x654b('0x26'),_0x3d9294[_0x654b('0x15')],_0x4a1c0d);_0x2d4a02(_this['error'](0x1f4,_0x3d9294[_0x654b('0x15')]));});});};
\ No newline at end of file
+var _0x5adc=['error','code','message','request\x20sent','result','UpdateChatInteraction','ChatInteraction','update','body','options','where','attributes','limit','then','catch','AddTagsToChatInteraction','find','omit','spread','AddTags','stringify','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','./chatInteraction.socket','register','request','info','ChatInteraction,\x20%s,\x20%s','debug','ChatInteraction,\x20%s,\x20%s,\x20%s'];(function(_0x13ac10,_0x46e79e){var _0x28eda2=function(_0x169ef0){while(--_0x169ef0){_0x13ac10['push'](_0x13ac10['shift']());}};_0x28eda2(++_0x46e79e);}(_0x5adc,0x10b));var _0xc5ad=function(_0x39fa33,_0xb1c5f7){_0x39fa33=_0x39fa33-0x0;var _0xcab27d=_0x5adc[_0x39fa33];return _0xcab27d;};'use strict';var _=require('lodash');var util=require(_0xc5ad('0x0'));var moment=require(_0xc5ad('0x1'));var BPromise=require('bluebird');var rs=require(_0xc5ad('0x2'));var fs=require('fs');var Redis=require(_0xc5ad('0x3'));var db=require(_0xc5ad('0x4'))['db'];var utils=require(_0xc5ad('0x5'));var logger=require('../../config/logger')('rpc');var config=require(_0xc5ad('0x6'));var jayson=require(_0xc5ad('0x7'));var client=jayson[_0xc5ad('0x8')][_0xc5ad('0x9')]({'port':0x232a});config[_0xc5ad('0xa')]=_[_0xc5ad('0xb')](config[_0xc5ad('0xa')],{'host':_0xc5ad('0xc'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xc5ad('0xa')]));require(_0xc5ad('0xd'))[_0xc5ad('0xe')](socket);function respondWithRpcPromise(_0x5f4e10,_0x4d0e7e,_0x4f8ee2){return new BPromise(function(_0x3b36a1,_0x404e88){return client[_0xc5ad('0xf')](_0x5f4e10,_0x4f8ee2)['then'](function(_0x174bed){logger[_0xc5ad('0x10')](_0xc5ad('0x11'),_0x4d0e7e,'request\x20sent');logger[_0xc5ad('0x12')](_0xc5ad('0x13'),_0x4d0e7e,'request\x20sent',JSON['stringify'](_0x174bed));if(_0x174bed['error']){if(_0x174bed[_0xc5ad('0x14')][_0xc5ad('0x15')]===0x1f4){logger[_0xc5ad('0x14')]('ChatInteraction,\x20%s,\x20%s',_0x4d0e7e,_0x174bed[_0xc5ad('0x14')]['message']);return _0x404e88(_0x174bed[_0xc5ad('0x14')][_0xc5ad('0x16')]);}logger[_0xc5ad('0x14')](_0xc5ad('0x11'),_0x4d0e7e,_0x174bed[_0xc5ad('0x14')][_0xc5ad('0x16')]);return _0x3b36a1(_0x174bed[_0xc5ad('0x14')][_0xc5ad('0x16')]);}else{logger[_0xc5ad('0x10')](_0xc5ad('0x11'),_0x4d0e7e,_0xc5ad('0x17'));_0x3b36a1(_0x174bed[_0xc5ad('0x18')][_0xc5ad('0x16')]);}})['catch'](function(_0x5db34c){logger['error'](_0xc5ad('0x11'),_0x4d0e7e,_0x5db34c);_0x404e88(_0x5db34c);});});}exports[_0xc5ad('0x19')]=function(_0x292288){var _0x18e1dd=this;return new Promise(function(_0x59224d,_0x4f08ed){return db[_0xc5ad('0x1a')][_0xc5ad('0x1b')](_0x292288[_0xc5ad('0x1c')],{'raw':_0x292288['options']?_0x292288['options']['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x292288[_0xc5ad('0x1d')]?_0x292288[_0xc5ad('0x1d')][_0xc5ad('0x1e')]||null:null,'attributes':_0x292288['options']?_0x292288[_0xc5ad('0x1d')][_0xc5ad('0x1f')]||null:null,'limit':_0x292288[_0xc5ad('0x1d')]?_0x292288['options'][_0xc5ad('0x20')]||null:null})[_0xc5ad('0x21')](function(_0x2475c2){logger[_0xc5ad('0x10')](_0xc5ad('0x19'),_0x292288);logger[_0xc5ad('0x12')]('UpdateChatInteraction',_0x292288,JSON['stringify'](_0x2475c2));_0x59224d(_0x2475c2);})[_0xc5ad('0x22')](function(_0x2a73cd){logger[_0xc5ad('0x14')]('UpdateChatInteraction',_0x2a73cd[_0xc5ad('0x16')],_0x292288);_0x4f08ed(_0x18e1dd['error'](0x1f4,_0x2a73cd[_0xc5ad('0x16')]));});});};exports[_0xc5ad('0x23')]=function(_0x13bbba){return new Promise(function(_0x9e48d7,_0x4b95a9){return db['ChatInteraction'][_0xc5ad('0x24')]({'where':_0x13bbba['options']?_0x13bbba[_0xc5ad('0x1d')][_0xc5ad('0x1e')]||null:null})[_0xc5ad('0x21')](function(_0x3aa706){if(_0x3aa706){return _0x3aa706['addTags'](_0x13bbba['body']['ids'],_[_0xc5ad('0x25')](_0x13bbba[_0xc5ad('0x1c')],['ids','id'])||{});}})[_0xc5ad('0x26')](function(_0xe900c5){logger[_0xc5ad('0x10')](_0xc5ad('0x27'),_0x13bbba);logger['debug']('AddTags',_0x13bbba,JSON[_0xc5ad('0x28')](_0xe900c5));_0x9e48d7(_0xe900c5);})['catch'](function(_0x591763){logger['error']('AddTags',_0x591763[_0xc5ad('0x16')],_0x13bbba);_0x4b95a9(_this['error'](0x1f4,_0x591763[_0xc5ad('0x16')]));});});};
\ No newline at end of file
diff --git a/server/api/chatInteraction/chatInteraction.socket.js b/server/api/chatInteraction/chatInteraction.socket.js
index 34f6a60..a63c3bc 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 _0x4f80=['save','remove','emit','register','chatInteraction:','./chatInteraction.events'];(function(_0x1dae94,_0x239003){var _0x36ce2d=function(_0x295f18){while(--_0x295f18){_0x1dae94['push'](_0x1dae94['shift']());}};_0x36ce2d(++_0x239003);}(_0x4f80,0xcb));var _0x04f8=function(_0x234ce7,_0x3e909c){_0x234ce7=_0x234ce7-0x0;var _0x57c561=_0x4f80[_0x234ce7];return _0x57c561;};'use strict';var ChatInteractionEvents=require(_0x04f8('0x0'));var events=[_0x04f8('0x1'),_0x04f8('0x2'),'update'];function createListener(_0x3e61d0,_0xaccb55){return function(_0x252ef1){_0xaccb55[_0x04f8('0x3')](_0x3e61d0,_0x252ef1);};}function removeListener(_0x3a4eab,_0x37dd7c){return function(){ChatInteractionEvents['removeListener'](_0x3a4eab,_0x37dd7c);};}exports[_0x04f8('0x4')]=function(_0x520bd8){for(var _0x56b3ad=0x0,_0x255cd0=events['length'];_0x56b3ad<_0x255cd0;_0x56b3ad++){var _0x201be1=events[_0x56b3ad];var _0x3a77d6=createListener(_0x04f8('0x5')+_0x201be1,_0x520bd8);ChatInteractionEvents['on'](_0x201be1,_0x3a77d6);}};
\ No newline at end of file
+var _0x9d89=['register','length','chatInteraction:','remove','emit','removeListener'];(function(_0x5851c0,_0x3f4287){var _0x408a1c=function(_0x3f8794){while(--_0x3f8794){_0x5851c0['push'](_0x5851c0['shift']());}};_0x408a1c(++_0x3f4287);}(_0x9d89,0xd5));var _0x99d8=function(_0x191ee1,_0x43e84c){_0x191ee1=_0x191ee1-0x0;var _0x5e0942=_0x9d89[_0x191ee1];return _0x5e0942;};'use strict';var ChatInteractionEvents=require('./chatInteraction.events');var events=['save',_0x99d8('0x0'),'update'];function createListener(_0x421c7f,_0x3f00cb){return function(_0x712a3e){_0x3f00cb[_0x99d8('0x1')](_0x421c7f,_0x712a3e);};}function removeListener(_0x25fd10,_0x1428de){return function(){ChatInteractionEvents[_0x99d8('0x2')](_0x25fd10,_0x1428de);};}exports[_0x99d8('0x3')]=function(_0xe8b79b){for(var _0x1c814a=0x0,_0x34f4d4=events[_0x99d8('0x4')];_0x1c814a<_0x34f4d4;_0x1c814a++){var _0x18e11b=events[_0x1c814a];var _0x336de3=createListener(_0x99d8('0x5')+_0x18e11b,_0xe8b79b);ChatInteractionEvents['on'](_0x18e11b,_0x336de3);}};
\ No newline at end of file
diff --git a/server/api/chatInteraction/index.js b/server/api/chatInteraction/index.js
index c839059..080fc5a 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 _0x3737=['download','create','post','/:id/vidaoo','createVidaooSession','join','root','format','%s-%s','now','originalname','replace','/:id/attachment_upload','single','attachmentUpload','addMessage','/:id/tags','tracked','chat','chatinteraction:addtags','addTags','put','chatinteraction:update','update','/:id/custom_update','customUpdate','/:id/abandon','/:id/close','close','delete','chatinteraction:destroy','destroy','removeTags','util','path','connect-timeout','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatInteraction.controller','get','isAuthenticated','index','/:id','isChatInteractionAuthorized','show','/:id/attachment_download','/:id/messages','getMessages','/:id/download'];(function(_0x849cf9,_0x2f0f0b){var _0x35b75c=function(_0x15f19f){while(--_0x15f19f){_0x849cf9['push'](_0x849cf9['shift']());}};_0x35b75c(++_0x2f0f0b);}(_0x3737,0x120));var _0x7373=function(_0x483456,_0x4fb1f4){_0x483456=_0x483456-0x0;var _0x2bf147=_0x3737[_0x483456];return _0x2bf147;};'use strict';var multer=require('multer');var util=require(_0x7373('0x0'));var path=require(_0x7373('0x1'));var timeout=require(_0x7373('0x2'));var express=require('express');var router=express[_0x7373('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x7373('0x4'));var interaction=require(_0x7373('0x5'));var config=require(_0x7373('0x6'));var controller=require(_0x7373('0x7'));router[_0x7373('0x8')]('/',auth[_0x7373('0x9')](),controller[_0x7373('0xa')]);router[_0x7373('0x8')]('/describe',auth[_0x7373('0x9')](),controller['describe']);router['get'](_0x7373('0xb'),auth[_0x7373('0xc')](),controller[_0x7373('0xd')]);router[_0x7373('0x8')](_0x7373('0xe'),auth[_0x7373('0xc')](),controller['attachmentDownload']);router[_0x7373('0x8')](_0x7373('0xf'),auth[_0x7373('0x9')](),controller[_0x7373('0x10')]);router[_0x7373('0x8')]('/:id/my_messages',auth[_0x7373('0xc')](),controller['getMyMessages']);router[_0x7373('0x8')](_0x7373('0x11'),auth[_0x7373('0x9')](),controller[_0x7373('0x12')]);router['post']('/',auth[_0x7373('0x9')](),controller[_0x7373('0x13')]);router[_0x7373('0x14')](_0x7373('0x15'),auth[_0x7373('0x9')](),controller[_0x7373('0x16')]);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0xc4e0db,_0x4c33b8,_0x1c974b){_0x1c974b(null,path[_0x7373('0x17')](config[_0x7373('0x18')],'server/files/attachments/'));},'filename':function(_0x2fa775,_0xe05a32,_0x91c8e9){_0x91c8e9(null,util[_0x7373('0x19')](_0x7373('0x1a'),Date[_0x7373('0x1b')](),_0xe05a32[_0x7373('0x1c')][_0x7373('0x1d')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-')));}})});router[_0x7373('0x14')](_0x7373('0x1e'),upload[_0x7373('0x1f')]('file'),controller[_0x7373('0x20')]);router[_0x7373('0x14')](_0x7373('0xf'),auth['isChatInteractionAuthorized'](),controller[_0x7373('0x21')]);router[_0x7373('0x14')](_0x7373('0x22'),auth[_0x7373('0x9')](),interaction[_0x7373('0x23')](_0x7373('0x24'),_0x7373('0x25')),controller[_0x7373('0x26')]);router[_0x7373('0x27')](_0x7373('0xb'),auth['isAuthenticated'](),interaction['tracked'](_0x7373('0x24'),_0x7373('0x28')),controller[_0x7373('0x29')]);router[_0x7373('0x27')](_0x7373('0x2a'),controller[_0x7373('0x2b')]);router[_0x7373('0x27')](_0x7373('0x2c'),auth[_0x7373('0xc')](),controller['abandon']);router['put'](_0x7373('0x2d'),controller[_0x7373('0x2e')]);router[_0x7373('0x2f')]('/:id',auth[_0x7373('0x9')](),interaction[_0x7373('0x23')](_0x7373('0x24'),_0x7373('0x30')),controller[_0x7373('0x31')]);router[_0x7373('0x2f')]('/:id/tags',auth['isAuthenticated'](),controller[_0x7373('0x32')]);module['exports']=router;
\ No newline at end of file
+var _0x97f4=['isAuthenticated','describe','/:id','isChatInteractionAuthorized','show','/:id/attachment_download','attachmentDownload','/:id/messages','getMessages','/:id/my_messages','getMyMessages','download','post','create','/:id/vidaoo','createVidaooSession','join','root','server/files/attachments/','format','%s-%s','now','originalname','single','file','attachmentUpload','chatinteraction:addtags','addTags','put','tracked','chat','update','/:id/custom_update','customUpdate','/:id/abandon','/:id/close','close','chatinteraction:destroy','destroy','/:id/tags','removeTags','exports','multer','util','path','express','Router','fs-extra','../../components/interaction/service','../../config/environment','./chatInteraction.controller','get','/describe'];(function(_0xbac7a6,_0x1cc55f){var _0x41e7e9=function(_0x2d4b01){while(--_0x2d4b01){_0xbac7a6['push'](_0xbac7a6['shift']());}};_0x41e7e9(++_0x1cc55f);}(_0x97f4,0x94));var _0x497f=function(_0x53dc2f,_0x433560){_0x53dc2f=_0x53dc2f-0x0;var _0x275565=_0x97f4[_0x53dc2f];return _0x275565;};'use strict';var multer=require(_0x497f('0x0'));var util=require(_0x497f('0x1'));var path=require(_0x497f('0x2'));var timeout=require('connect-timeout');var express=require(_0x497f('0x3'));var router=express[_0x497f('0x4')]();var fs_extra=require(_0x497f('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0x497f('0x6'));var config=require(_0x497f('0x7'));var controller=require(_0x497f('0x8'));router[_0x497f('0x9')]('/',auth['isAuthenticated'](),controller['index']);router[_0x497f('0x9')](_0x497f('0xa'),auth[_0x497f('0xb')](),controller[_0x497f('0xc')]);router['get'](_0x497f('0xd'),auth[_0x497f('0xe')](),controller[_0x497f('0xf')]);router[_0x497f('0x9')](_0x497f('0x10'),auth[_0x497f('0xe')](),controller[_0x497f('0x11')]);router['get'](_0x497f('0x12'),auth[_0x497f('0xb')](),controller[_0x497f('0x13')]);router['get'](_0x497f('0x14'),auth[_0x497f('0xe')](),controller[_0x497f('0x15')]);router[_0x497f('0x9')]('/:id/download',auth[_0x497f('0xb')](),controller[_0x497f('0x16')]);router[_0x497f('0x17')]('/',auth[_0x497f('0xb')](),controller[_0x497f('0x18')]);router['post'](_0x497f('0x19'),auth['isAuthenticated'](),controller[_0x497f('0x1a')]);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x5c8e00,_0x15ddb5,_0x17d051){_0x17d051(null,path[_0x497f('0x1b')](config[_0x497f('0x1c')],_0x497f('0x1d')));},'filename':function(_0x1d5889,_0x687595,_0x1f61dd){_0x1f61dd(null,util[_0x497f('0x1e')](_0x497f('0x1f'),Date[_0x497f('0x20')](),_0x687595[_0x497f('0x21')]['replace'](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-')));}})});router['post']('/:id/attachment_upload',upload[_0x497f('0x22')](_0x497f('0x23')),controller[_0x497f('0x24')]);router[_0x497f('0x17')](_0x497f('0x12'),auth[_0x497f('0xe')](),controller['addMessage']);router[_0x497f('0x17')]('/:id/tags',auth['isAuthenticated'](),interaction['tracked']('chat',_0x497f('0x25')),controller[_0x497f('0x26')]);router[_0x497f('0x27')](_0x497f('0xd'),auth[_0x497f('0xb')](),interaction[_0x497f('0x28')](_0x497f('0x29'),'chatinteraction:update'),controller[_0x497f('0x2a')]);router[_0x497f('0x27')](_0x497f('0x2b'),controller[_0x497f('0x2c')]);router['put'](_0x497f('0x2d'),auth[_0x497f('0xe')](),controller['abandon']);router[_0x497f('0x27')](_0x497f('0x2e'),controller[_0x497f('0x2f')]);router['delete'](_0x497f('0xd'),auth['isAuthenticated'](),interaction['tracked']('chat',_0x497f('0x30')),controller[_0x497f('0x31')]);router['delete'](_0x497f('0x32'),auth[_0x497f('0xb')](),controller[_0x497f('0x33')]);module[_0x497f('0x34')]=router;
\ No newline at end of file
diff --git a/server/api/chatInternalMessage/chatInternalMessage.attributes.js b/server/api/chatInternalMessage/chatInternalMessage.attributes.js
index 3a8ee26..2d53375 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 _0xef5a=['TEXT','medium','BOOLEAN','INTEGER','exports'];(function(_0x3cb316,_0x350f2a){var _0x356dca=function(_0xae24b5){while(--_0xae24b5){_0x3cb316['push'](_0x3cb316['shift']());}};_0x356dca(++_0x350f2a);}(_0xef5a,0xe0));var _0xaef5=function(_0x312a0b,_0x2d71ba){_0x312a0b=_0x312a0b-0x0;var _0x501292=_0xef5a[_0x312a0b];return _0x501292;};'use strict';var Sequelize=require('sequelize');module[_0xaef5('0x0')]={'body':{'type':Sequelize[_0xaef5('0x1')](_0xaef5('0x2')),'allowNull':![]},'read':{'type':Sequelize[_0xaef5('0x3')],'defaultValue':![]},'ChatInternalMessageId':{'type':Sequelize[_0xaef5('0x4')]}};
\ No newline at end of file
+var _0x3e94=['medium','BOOLEAN','INTEGER','sequelize','exports'];(function(_0x406ae7,_0x12181b){var _0x5a5b9d=function(_0x3f20c2){while(--_0x3f20c2){_0x406ae7['push'](_0x406ae7['shift']());}};_0x5a5b9d(++_0x12181b);}(_0x3e94,0x1e3));var _0x43e9=function(_0xa464c9,_0x7c86d8){_0xa464c9=_0xa464c9-0x0;var _0x3d73c4=_0x3e94[_0xa464c9];return _0x3d73c4;};'use strict';var Sequelize=require(_0x43e9('0x0'));module[_0x43e9('0x1')]={'body':{'type':Sequelize['TEXT'](_0x43e9('0x2')),'allowNull':![]},'read':{'type':Sequelize[_0x43e9('0x3')],'defaultValue':![]},'ChatInternalMessageId':{'type':Sequelize[_0x43e9('0x4')]}};
\ No newline at end of file
diff --git a/server/api/chatInternalMessage/chatInternalMessage.controller.js b/server/api/chatInternalMessage/chatInternalMessage.controller.js
index 0eb2d11..8052889 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 _0xebfb=['format','YYYY-MM-DD\x20HH:mm:ss','getUsers','User','agent','admin','user','fullname','role','userpic','internal','online','allowmessenger','showWebBar','-online','VoiceQueue','VoiceQueues','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','Agents','userProfileId','UserProfileResource','resourceId','push','messages','FromId','ToId','read','-createdAt','all','eml-format','rimraf','zip-dir','request-promise','moment','util','path','sox','to-csv','fs-extra','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','defaults','redis','localhost','socket.io-emitter','./chatInternalMessage.socket','sendStatus','status','end','json','offset','limit','count','set','Content-Range','apply','reject','save','then','destroy','name','send','index','map','ChatInternalMessage','rawAttributes','key','model','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','where','pick','filter','merge','type','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','params','find','create','body','update','describe','get','lastMessageAt','createdAt','lastMessage'];(function(_0x51aaaf,_0x133068){var _0x34399f=function(_0x43eb01){while(--_0x43eb01){_0x51aaaf['push'](_0x51aaaf['shift']());}};_0x34399f(++_0x133068);}(_0xebfb,0x91));var _0xbebf=function(_0x1c208e,_0x2a0a5b){_0x1c208e=_0x1c208e-0x0;var _0x5104ff=_0xebfb[_0x1c208e];return _0x5104ff;};'use strict';var emlformat=require(_0xbebf('0x0'));var rimraf=require(_0xbebf('0x1'));var zipdir=require(_0xbebf('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xbebf('0x3'));var moment=require(_0xbebf('0x4'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0xbebf('0x5'));var path=require(_0xbebf('0x6'));var sox=require(_0xbebf('0x7'));var csv=require(_0xbebf('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xbebf('0x9'));var _=require('lodash');var squel=require(_0xbebf('0xa'));var crypto=require('crypto');var jsforce=require(_0xbebf('0xb'));var deskjs=require(_0xbebf('0xc'));var toCsv=require(_0xbebf('0x8'));var querystring=require(_0xbebf('0xd'));var Papa=require(_0xbebf('0xe'));var Redis=require(_0xbebf('0xf'));var authService=require(_0xbebf('0x10'));var qs=require(_0xbebf('0x11'));var as=require(_0xbebf('0x12'));var hardwareService=require(_0xbebf('0x13'));var logger=require(_0xbebf('0x14'))(_0xbebf('0x15'));var utils=require('../../config/utils');var config=require(_0xbebf('0x16'));var licenseUtil=require(_0xbebf('0x17'));var db=require(_0xbebf('0x18'))['db'];config['redis']=_[_0xbebf('0x19')](config[_0xbebf('0x1a')],{'host':_0xbebf('0x1b'),'port':0x18eb});var socket=require(_0xbebf('0x1c'))(new Redis(config[_0xbebf('0x1a')]));require(_0xbebf('0x1d'))['register'](socket);function respondWithStatusCode(_0x52e90d,_0x4d1870){_0x4d1870=_0x4d1870||0xcc;return function(_0x9eb052){if(_0x9eb052){return _0x52e90d[_0xbebf('0x1e')](_0x4d1870);}return _0x52e90d[_0xbebf('0x1f')](_0x4d1870)[_0xbebf('0x20')]();};}function respondWithResult(_0x3f8bc2,_0x1e90f2){_0x1e90f2=_0x1e90f2||0xc8;return function(_0x56940c){if(_0x56940c){return _0x3f8bc2['status'](_0x1e90f2)[_0xbebf('0x21')](_0x56940c);}};}function respondWithFilteredResult(_0x1bc99f,_0x1cee9b){return function(_0x57a330){if(_0x57a330){var _0x45d1bd=typeof _0x1cee9b[_0xbebf('0x22')]==='undefined'&&typeof _0x1cee9b[_0xbebf('0x23')]==='undefined';var _0x1815e0=_0x57a330[_0xbebf('0x24')];var _0x46efa6=_0x45d1bd?0x0:_0x1cee9b[_0xbebf('0x22')];var _0x5b152a=_0x45d1bd?_0x57a330[_0xbebf('0x24')]:_0x1cee9b['offset']+_0x1cee9b[_0xbebf('0x23')];var _0x295e44;if(_0x5b152a>=_0x1815e0){_0x5b152a=_0x1815e0;_0x295e44=0xc8;}else{_0x295e44=0xce;}_0x1bc99f[_0xbebf('0x1f')](_0x295e44);return _0x1bc99f[_0xbebf('0x25')](_0xbebf('0x26'),_0x46efa6+'-'+_0x5b152a+'/'+_0x1815e0)[_0xbebf('0x21')](_0x57a330);}return null;};}function patchUpdates(_0x1f5236){return function(_0x2b120c){try{jsonpatch[_0xbebf('0x27')](_0x2b120c,_0x1f5236,!![]);}catch(_0x57bdae){return BPromise[_0xbebf('0x28')](_0x57bdae);}return _0x2b120c[_0xbebf('0x29')]();};}function saveUpdates(_0x21dd7f,_0x2c3efd){return function(_0x4e13c1){if(_0x4e13c1){return _0x4e13c1['update'](_0x21dd7f)[_0xbebf('0x2a')](function(_0x101eff){return _0x101eff;});}return null;};}function removeEntity(_0x12a05f,_0x4ca429){return function(_0x1d51ac){if(_0x1d51ac){return _0x1d51ac[_0xbebf('0x2b')]()[_0xbebf('0x2a')](function(){_0x12a05f[_0xbebf('0x1f')](0xcc)[_0xbebf('0x20')]();});}};}function handleEntityNotFound(_0x2a3016,_0x45d769){return function(_0x1743dd){if(!_0x1743dd){_0x2a3016[_0xbebf('0x1e')](0x194);}return _0x1743dd;};}function handleError(_0x312565,_0x4015b2){_0x4015b2=_0x4015b2||0x1f4;return function(_0x2cf79f){logger['error'](_0x2cf79f['stack']);if(_0x2cf79f[_0xbebf('0x2c')]){delete _0x2cf79f[_0xbebf('0x2c')];}_0x312565[_0xbebf('0x1f')](_0x4015b2)[_0xbebf('0x2d')](_0x2cf79f);};}exports[_0xbebf('0x2e')]=function(_0x1d5165,_0x3b8db6){var _0x44a943={},_0xcbf2bf={},_0x29bf4f={'count':0x0,'rows':[]};var _0x431734=_[_0xbebf('0x2f')](db[_0xbebf('0x30')][_0xbebf('0x31')],function(_0x917f9c){return{'name':_0x917f9c['fieldName'],'type':_0x917f9c['type'][_0xbebf('0x32')]};});_0xcbf2bf[_0xbebf('0x33')]=_[_0xbebf('0x2f')](_0x431734,_0xbebf('0x2c'));_0xcbf2bf['query']=_[_0xbebf('0x34')](_0x1d5165[_0xbebf('0x35')]);_0xcbf2bf[_0xbebf('0x36')]=_[_0xbebf('0x37')](_0xcbf2bf[_0xbebf('0x33')],_0xcbf2bf[_0xbebf('0x35')]);_0x44a943[_0xbebf('0x38')]=_['intersection'](_0xcbf2bf[_0xbebf('0x33')],qs[_0xbebf('0x39')](_0x1d5165[_0xbebf('0x35')]['fields']));_0x44a943[_0xbebf('0x38')]=_0x44a943[_0xbebf('0x38')][_0xbebf('0x3a')]?_0x44a943['attributes']:_0xcbf2bf[_0xbebf('0x33')];if(!_0x1d5165[_0xbebf('0x35')][_0xbebf('0x3b')](_0xbebf('0x3c'))){_0x44a943[_0xbebf('0x23')]=qs[_0xbebf('0x23')](_0x1d5165[_0xbebf('0x35')][_0xbebf('0x23')]);_0x44a943['offset']=qs[_0xbebf('0x22')](_0x1d5165['query'][_0xbebf('0x22')]);}_0x44a943['order']=qs[_0xbebf('0x3d')](_0x1d5165[_0xbebf('0x35')][_0xbebf('0x3d')]);_0x44a943[_0xbebf('0x3e')]=qs['filters'](_[_0xbebf('0x3f')](_0x1d5165[_0xbebf('0x35')],_0xcbf2bf['filters']),_0x431734);if(_0x1d5165[_0xbebf('0x35')][_0xbebf('0x40')]){_0x44a943[_0xbebf('0x3e')]=_[_0xbebf('0x41')](_0x44a943[_0xbebf('0x3e')],{'$or':_[_0xbebf('0x2f')](_0x431734,function(_0x15e14d){if(_0x15e14d[_0xbebf('0x42')]!==_0xbebf('0x43')){var _0x307db9={};_0x307db9[_0x15e14d[_0xbebf('0x2c')]]={'$like':'%'+_0x1d5165[_0xbebf('0x35')][_0xbebf('0x40')]+'%'};return _0x307db9;}})});}_0x44a943=_[_0xbebf('0x41')]({},_0x44a943,_0x1d5165[_0xbebf('0x44')]);var _0x51e27a={'where':_0x44a943['where']};return db[_0xbebf('0x30')][_0xbebf('0x24')](_0x51e27a)[_0xbebf('0x2a')](function(_0x41abfd){_0x29bf4f['count']=_0x41abfd;if(_0x1d5165['query'][_0xbebf('0x45')]){_0x44a943[_0xbebf('0x46')]=[{'all':!![]}];}return db[_0xbebf('0x30')][_0xbebf('0x47')](_0x44a943);})[_0xbebf('0x2a')](function(_0x3667bf){_0x29bf4f[_0xbebf('0x48')]=_0x3667bf;return _0x29bf4f;})[_0xbebf('0x2a')](respondWithFilteredResult(_0x3b8db6,_0x44a943))[_0xbebf('0x49')](handleError(_0x3b8db6,null));};exports[_0xbebf('0x4a')]=function(_0x10665a,_0x56d008){var _0xa33689={'raw':!![],'where':{'id':_0x10665a[_0xbebf('0x4b')]['id']}},_0x5717c9={};_0x5717c9['model']=_['keys'](db['ChatInternalMessage'][_0xbebf('0x31')]);_0x5717c9[_0xbebf('0x35')]=_[_0xbebf('0x34')](_0x10665a[_0xbebf('0x35')]);_0x5717c9[_0xbebf('0x36')]=_[_0xbebf('0x37')](_0x5717c9[_0xbebf('0x33')],_0x5717c9['query']);_0xa33689[_0xbebf('0x38')]=_[_0xbebf('0x37')](_0x5717c9['model'],qs[_0xbebf('0x39')](_0x10665a[_0xbebf('0x35')][_0xbebf('0x39')]));_0xa33689[_0xbebf('0x38')]=_0xa33689[_0xbebf('0x38')]['length']?_0xa33689[_0xbebf('0x38')]:_0x5717c9[_0xbebf('0x33')];if(_0x10665a[_0xbebf('0x35')]['includeAll']){_0xa33689[_0xbebf('0x46')]=[{'all':!![]}];}_0xa33689=_[_0xbebf('0x41')]({},_0xa33689,_0x10665a['options']);return db['ChatInternalMessage'][_0xbebf('0x4c')](_0xa33689)[_0xbebf('0x2a')](handleEntityNotFound(_0x56d008,null))[_0xbebf('0x2a')](respondWithResult(_0x56d008,null))[_0xbebf('0x49')](handleError(_0x56d008,null));};exports[_0xbebf('0x4d')]=function(_0x53b46f,_0x4833f7){return db['ChatInternalMessage'][_0xbebf('0x4d')](_0x53b46f[_0xbebf('0x4e')],{})['then'](respondWithResult(_0x4833f7,0xc9))['catch'](handleError(_0x4833f7,null));};exports[_0xbebf('0x4f')]=function(_0x5dcad6,_0x32f82b){if(_0x5dcad6[_0xbebf('0x4e')]['id']){delete _0x5dcad6[_0xbebf('0x4e')]['id'];}return db['ChatInternalMessage']['find']({'where':{'id':_0x5dcad6[_0xbebf('0x4b')]['id']}})[_0xbebf('0x2a')](handleEntityNotFound(_0x32f82b,null))[_0xbebf('0x2a')](saveUpdates(_0x5dcad6[_0xbebf('0x4e')],null))['then'](respondWithResult(_0x32f82b,null))[_0xbebf('0x49')](handleError(_0x32f82b,null));};exports[_0xbebf('0x2b')]=function(_0x238708,_0x37b227){return db[_0xbebf('0x30')][_0xbebf('0x4c')]({'where':{'id':_0x238708[_0xbebf('0x4b')]['id']}})['then'](handleEntityNotFound(_0x37b227,null))[_0xbebf('0x2a')](removeEntity(_0x37b227,null))['catch'](handleError(_0x37b227,null));};exports['describe']=function(_0x3b7f2f,_0x420b94){return db[_0xbebf('0x30')][_0xbebf('0x50')]()[_0xbebf('0x2a')](respondWithResult(_0x420b94,null))['catch'](handleError(_0x420b94,null));};function wrapUser(_0x4cd13d){return function(_0x5476cd){var _0x1e5be9=_0x4cd13d[_0xbebf('0x51')]({'plain':!![]});_0x1e5be9['messages']=[];if(_0x5476cd){_0x1e5be9[_0xbebf('0x52')]=_0x5476cd[_0xbebf('0x53')];_0x1e5be9[_0xbebf('0x54')]=_0x5476cd;}else{_0x1e5be9['lastMessageAt']=moment(0x0)[_0xbebf('0x55')](_0xbebf('0x56'));_0x1e5be9[_0xbebf('0x54')]={};}return _0x1e5be9;};}exports[_0xbebf('0x57')]=function(_0x25246e,_0x50e6be,_0x3aea07){var _0x387d3f=[];return db[_0xbebf('0x58')][_0xbebf('0x47')]({'where':{'role':[_0xbebf('0x59'),_0xbebf('0x5a'),_0xbebf('0x5b')]},'attributes':['id',_0xbebf('0x5c'),'name',_0xbebf('0x5d'),_0xbebf('0x5e'),_0xbebf('0x5f'),_0xbebf('0x60'),'lastLoginAt',_0xbebf('0x61'),_0xbebf('0x62')],'order':qs[_0xbebf('0x3d')](_0xbebf('0x63')),'include':[{'model':db[_0xbebf('0x64')],'as':_0xbebf('0x65'),'attributes':['id','name',_0xbebf('0x42')],'through':{'attributes':[]}}]})[_0xbebf('0x2a')](function(_0x2b831e){if(_0x2b831e){var _0x5a251c=_0x25246e['user']['get']({'plain':!![]});if(!_0x5a251c)throw new Error(_0xbebf('0x66'));if(_0x5a251c[_0xbebf('0x5d')]===_0xbebf('0x5b')){return db[_0xbebf('0x67')][_0xbebf('0x4c')]({'where':{'name':_0xbebf('0x68'),'userProfileId':_0x5a251c[_0xbebf('0x69')]},'raw':!![]})[_0xbebf('0x2a')](function(_0x55d259){if(_0x55d259){if(_0x55d259['autoAssociation']===0x0){return db[_0xbebf('0x6a')][_0xbebf('0x47')]({'where':{'sectionId':_0x55d259['id']},'raw':!![]})[_0xbebf('0x2a')](function(_0xa120df){var _0x30af6c=[];if(_['isEmpty'](_0xa120df)){_0x30af6c=_[_0xbebf('0x40')](_0x2b831e,function(_0xd5f1d0){if(_0xd5f1d0[_0xbebf('0x5d')]!==_0xbebf('0x59')){return _0xd5f1d0;}});return _0x30af6c;}else{for(var _0x2a45dc=0x0;_0x2a45dc<_0x2b831e[_0xbebf('0x3a')];_0x2a45dc++){var _0x38cca6=_0x2b831e[_0x2a45dc];if(_0x38cca6[_0xbebf('0x5d')]==='agent'){var _0x38b335=_[_0xbebf('0x4c')](_0xa120df,function(_0xe692f7){return _0xe692f7[_0xbebf('0x6b')]===_0x38cca6['id'];});if(_0x38b335)_0x30af6c[_0xbebf('0x6c')](_0x38cca6);}else{_0x30af6c[_0xbebf('0x6c')](_0x38cca6);}}return _0x30af6c;}});}else{return _0x2b831e;}}else{var _0x51ef5d=_[_0xbebf('0x40')](_0x2b831e,function(_0x554d00){if(_0x554d00[_0xbebf('0x5d')]!=='agent'){return _0x554d00;}});return _0x51ef5d;}});}else{return _0x2b831e;}}})[_0xbebf('0x2a')](function(_0x19cb37){var _0x252517=[];if(_0x19cb37){_0x387d3f=_0x19cb37;for(var _0x33aa1c=0x0;_0x33aa1c<_0x19cb37[_0xbebf('0x3a')];_0x33aa1c+=0x1){_0x387d3f[_0x33aa1c][_0xbebf('0x6d')]=[];_0x252517['push'](db[_0xbebf('0x30')][_0xbebf('0x4c')]({'where':{'FromId':[_0x25246e['user']['id'],_0x19cb37[_0x33aa1c]['id']],'ToId':[_0x25246e[_0xbebf('0x5b')]['id'],_0x19cb37[_0x33aa1c]['id']],'ChatGroupId':null},'attributes':['id',_0xbebf('0x53'),_0xbebf('0x6e'),_0xbebf('0x6f'),_0xbebf('0x70'),_0xbebf('0x4e')],'order':qs[_0xbebf('0x3d')](_0xbebf('0x71')),'limit':0x1,'offset':0x0,'raw':!![]})['then'](wrapUser(_0x19cb37[_0x33aa1c])));}return BPromise[_0xbebf('0x72')](_0x252517);}return[];})[_0xbebf('0x2a')](function(_0x4b9fde){return{'rows':_0x4b9fde,'count':_0x4b9fde[_0xbebf('0x3a')]};})[_0xbebf('0x2a')](respondWithResult(_0x50e6be,null))[_0xbebf('0x49')](handleError(_0x50e6be,null));};
\ No newline at end of file
+var _0x56a7=['userProfileId','autoAssociation','UserProfileResource','isEmpty','role','resourceId','messages','push','ToId','read','eml-format','zip-dir','fast-json-patch','request-promise','mustache','util','path','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/license/util','redis','defaults','localhost','socket.io-emitter','register','json','offset','undefined','limit','count','status','Content-Range','apply','reject','save','update','destroy','then','end','sendStatus','error','stack','name','send','index','map','ChatInternalMessage','rawAttributes','fieldName','type','key','model','query','keys','filters','attributes','intersection','fields','length','hasOwnProperty','nolimit','sort','pick','filter','where','VIRTUAL','merge','options','include','findAll','rows','catch','show','params','create','body','find','describe','lastMessageAt','createdAt','lastMessage','format','getUsers','User','agent','user','fullname','userpic','internal','lastLoginAt','allowmessenger','showWebBar','-online','VoiceQueues','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection'];(function(_0x1e98f6,_0x454ce1){var _0x54e601=function(_0x148ac3){while(--_0x148ac3){_0x1e98f6['push'](_0x1e98f6['shift']());}};_0x54e601(++_0x454ce1);}(_0x56a7,0x77));var _0x756a=function(_0x2ef8f1,_0x1280a3){_0x2ef8f1=_0x2ef8f1-0x0;var _0x17498d=_0x56a7[_0x2ef8f1];return _0x17498d;};'use strict';var emlformat=require(_0x756a('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x756a('0x1'));var jsonpatch=require(_0x756a('0x2'));var rp=require(_0x756a('0x3'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x756a('0x4'));var util=require(_0x756a('0x5'));var path=require(_0x756a('0x6'));var sox=require('sox');var csv=require(_0x756a('0x7'));var ejs=require(_0x756a('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x756a('0x9'));var squel=require(_0x756a('0xa'));var crypto=require(_0x756a('0xb'));var jsforce=require(_0x756a('0xc'));var deskjs=require(_0x756a('0xd'));var toCsv=require('to-csv');var querystring=require(_0x756a('0xe'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x756a('0xf'));var qs=require(_0x756a('0x10'));var as=require(_0x756a('0x11'));var hardwareService=require(_0x756a('0x12'));var logger=require('../../config/logger')(_0x756a('0x13'));var utils=require(_0x756a('0x14'));var config=require('../../config/environment');var licenseUtil=require(_0x756a('0x15'));var db=require('../../mysqldb')['db'];config[_0x756a('0x16')]=_[_0x756a('0x17')](config['redis'],{'host':_0x756a('0x18'),'port':0x18eb});var socket=require(_0x756a('0x19'))(new Redis(config[_0x756a('0x16')]));require('./chatInternalMessage.socket')[_0x756a('0x1a')](socket);function respondWithStatusCode(_0x6e2cd8,_0x1e2b03){_0x1e2b03=_0x1e2b03||0xcc;return function(_0x2c0fd7){if(_0x2c0fd7){return _0x6e2cd8['sendStatus'](_0x1e2b03);}return _0x6e2cd8['status'](_0x1e2b03)['end']();};}function respondWithResult(_0x401140,_0x6487de){_0x6487de=_0x6487de||0xc8;return function(_0x3a8d9d){if(_0x3a8d9d){return _0x401140['status'](_0x6487de)[_0x756a('0x1b')](_0x3a8d9d);}};}function respondWithFilteredResult(_0x36c858,_0x29d0c7){return function(_0x1f552d){if(_0x1f552d){var _0x32773a=typeof _0x29d0c7[_0x756a('0x1c')]===_0x756a('0x1d')&&typeof _0x29d0c7[_0x756a('0x1e')]===_0x756a('0x1d');var _0x143757=_0x1f552d[_0x756a('0x1f')];var _0x27b367=_0x32773a?0x0:_0x29d0c7[_0x756a('0x1c')];var _0x3c58c3=_0x32773a?_0x1f552d[_0x756a('0x1f')]:_0x29d0c7['offset']+_0x29d0c7[_0x756a('0x1e')];var _0x3fc115;if(_0x3c58c3>=_0x143757){_0x3c58c3=_0x143757;_0x3fc115=0xc8;}else{_0x3fc115=0xce;}_0x36c858[_0x756a('0x20')](_0x3fc115);return _0x36c858['set'](_0x756a('0x21'),_0x27b367+'-'+_0x3c58c3+'/'+_0x143757)[_0x756a('0x1b')](_0x1f552d);}return null;};}function patchUpdates(_0x30c626){return function(_0x55fd84){try{jsonpatch[_0x756a('0x22')](_0x55fd84,_0x30c626,!![]);}catch(_0x3423ff){return BPromise[_0x756a('0x23')](_0x3423ff);}return _0x55fd84[_0x756a('0x24')]();};}function saveUpdates(_0x5b28f7,_0x5d5db6){return function(_0x98f872){if(_0x98f872){return _0x98f872[_0x756a('0x25')](_0x5b28f7)['then'](function(_0x59d914){return _0x59d914;});}return null;};}function removeEntity(_0x1be1d7,_0x44cd1f){return function(_0x5290ab){if(_0x5290ab){return _0x5290ab[_0x756a('0x26')]()[_0x756a('0x27')](function(){_0x1be1d7[_0x756a('0x20')](0xcc)[_0x756a('0x28')]();});}};}function handleEntityNotFound(_0x192785,_0x416693){return function(_0x5e762e){if(!_0x5e762e){_0x192785[_0x756a('0x29')](0x194);}return _0x5e762e;};}function handleError(_0x46c147,_0x157dcc){_0x157dcc=_0x157dcc||0x1f4;return function(_0x38fcc3){logger[_0x756a('0x2a')](_0x38fcc3[_0x756a('0x2b')]);if(_0x38fcc3[_0x756a('0x2c')]){delete _0x38fcc3[_0x756a('0x2c')];}_0x46c147['status'](_0x157dcc)[_0x756a('0x2d')](_0x38fcc3);};}exports[_0x756a('0x2e')]=function(_0x2060ff,_0x155585){var _0x45b997={},_0x5a65e7={},_0x297553={'count':0x0,'rows':[]};var _0x323fe0=_[_0x756a('0x2f')](db[_0x756a('0x30')][_0x756a('0x31')],function(_0x2d6c81){return{'name':_0x2d6c81[_0x756a('0x32')],'type':_0x2d6c81[_0x756a('0x33')][_0x756a('0x34')]};});_0x5a65e7[_0x756a('0x35')]=_[_0x756a('0x2f')](_0x323fe0,_0x756a('0x2c'));_0x5a65e7[_0x756a('0x36')]=_[_0x756a('0x37')](_0x2060ff['query']);_0x5a65e7[_0x756a('0x38')]=_['intersection'](_0x5a65e7[_0x756a('0x35')],_0x5a65e7[_0x756a('0x36')]);_0x45b997[_0x756a('0x39')]=_[_0x756a('0x3a')](_0x5a65e7['model'],qs['fields'](_0x2060ff[_0x756a('0x36')][_0x756a('0x3b')]));_0x45b997[_0x756a('0x39')]=_0x45b997[_0x756a('0x39')][_0x756a('0x3c')]?_0x45b997[_0x756a('0x39')]:_0x5a65e7[_0x756a('0x35')];if(!_0x2060ff[_0x756a('0x36')][_0x756a('0x3d')](_0x756a('0x3e'))){_0x45b997[_0x756a('0x1e')]=qs[_0x756a('0x1e')](_0x2060ff['query']['limit']);_0x45b997[_0x756a('0x1c')]=qs[_0x756a('0x1c')](_0x2060ff[_0x756a('0x36')]['offset']);}_0x45b997['order']=qs[_0x756a('0x3f')](_0x2060ff['query'][_0x756a('0x3f')]);_0x45b997['where']=qs[_0x756a('0x38')](_[_0x756a('0x40')](_0x2060ff[_0x756a('0x36')],_0x5a65e7['filters']),_0x323fe0);if(_0x2060ff[_0x756a('0x36')][_0x756a('0x41')]){_0x45b997[_0x756a('0x42')]=_['merge'](_0x45b997['where'],{'$or':_[_0x756a('0x2f')](_0x323fe0,function(_0x314a7d){if(_0x314a7d['type']!==_0x756a('0x43')){var _0x2d97e7={};_0x2d97e7[_0x314a7d[_0x756a('0x2c')]]={'$like':'%'+_0x2060ff[_0x756a('0x36')]['filter']+'%'};return _0x2d97e7;}})});}_0x45b997=_[_0x756a('0x44')]({},_0x45b997,_0x2060ff[_0x756a('0x45')]);var _0x270a7d={'where':_0x45b997[_0x756a('0x42')]};return db[_0x756a('0x30')][_0x756a('0x1f')](_0x270a7d)[_0x756a('0x27')](function(_0x5cde78){_0x297553[_0x756a('0x1f')]=_0x5cde78;if(_0x2060ff['query']['includeAll']){_0x45b997[_0x756a('0x46')]=[{'all':!![]}];}return db[_0x756a('0x30')][_0x756a('0x47')](_0x45b997);})[_0x756a('0x27')](function(_0x129f5){_0x297553[_0x756a('0x48')]=_0x129f5;return _0x297553;})['then'](respondWithFilteredResult(_0x155585,_0x45b997))[_0x756a('0x49')](handleError(_0x155585,null));};exports[_0x756a('0x4a')]=function(_0x5d8d45,_0x3f80be){var _0x5d44ec={'raw':!![],'where':{'id':_0x5d8d45[_0x756a('0x4b')]['id']}},_0x14851a={};_0x14851a[_0x756a('0x35')]=_[_0x756a('0x37')](db[_0x756a('0x30')][_0x756a('0x31')]);_0x14851a['query']=_[_0x756a('0x37')](_0x5d8d45[_0x756a('0x36')]);_0x14851a['filters']=_['intersection'](_0x14851a[_0x756a('0x35')],_0x14851a[_0x756a('0x36')]);_0x5d44ec[_0x756a('0x39')]=_[_0x756a('0x3a')](_0x14851a['model'],qs[_0x756a('0x3b')](_0x5d8d45[_0x756a('0x36')][_0x756a('0x3b')]));_0x5d44ec[_0x756a('0x39')]=_0x5d44ec['attributes'][_0x756a('0x3c')]?_0x5d44ec[_0x756a('0x39')]:_0x14851a[_0x756a('0x35')];if(_0x5d8d45[_0x756a('0x36')]['includeAll']){_0x5d44ec[_0x756a('0x46')]=[{'all':!![]}];}_0x5d44ec=_[_0x756a('0x44')]({},_0x5d44ec,_0x5d8d45[_0x756a('0x45')]);return db[_0x756a('0x30')]['find'](_0x5d44ec)[_0x756a('0x27')](handleEntityNotFound(_0x3f80be,null))[_0x756a('0x27')](respondWithResult(_0x3f80be,null))[_0x756a('0x49')](handleError(_0x3f80be,null));};exports['create']=function(_0x46ae43,_0x32dfb8){return db[_0x756a('0x30')][_0x756a('0x4c')](_0x46ae43[_0x756a('0x4d')],{})['then'](respondWithResult(_0x32dfb8,0xc9))[_0x756a('0x49')](handleError(_0x32dfb8,null));};exports[_0x756a('0x25')]=function(_0x31efdf,_0x18da84){if(_0x31efdf[_0x756a('0x4d')]['id']){delete _0x31efdf['body']['id'];}return db[_0x756a('0x30')][_0x756a('0x4e')]({'where':{'id':_0x31efdf[_0x756a('0x4b')]['id']}})[_0x756a('0x27')](handleEntityNotFound(_0x18da84,null))[_0x756a('0x27')](saveUpdates(_0x31efdf[_0x756a('0x4d')],null))[_0x756a('0x27')](respondWithResult(_0x18da84,null))[_0x756a('0x49')](handleError(_0x18da84,null));};exports[_0x756a('0x26')]=function(_0x24d3eb,_0x4ce710){return db[_0x756a('0x30')][_0x756a('0x4e')]({'where':{'id':_0x24d3eb['params']['id']}})[_0x756a('0x27')](handleEntityNotFound(_0x4ce710,null))[_0x756a('0x27')](removeEntity(_0x4ce710,null))[_0x756a('0x49')](handleError(_0x4ce710,null));};exports[_0x756a('0x4f')]=function(_0x341810,_0x364349){return db['ChatInternalMessage']['describe']()[_0x756a('0x27')](respondWithResult(_0x364349,null))[_0x756a('0x49')](handleError(_0x364349,null));};function wrapUser(_0x63fa63){return function(_0x4e783e){var _0x434542=_0x63fa63['get']({'plain':!![]});_0x434542['messages']=[];if(_0x4e783e){_0x434542[_0x756a('0x50')]=_0x4e783e[_0x756a('0x51')];_0x434542[_0x756a('0x52')]=_0x4e783e;}else{_0x434542[_0x756a('0x50')]=moment(0x0)[_0x756a('0x53')]('YYYY-MM-DD\x20HH:mm:ss');_0x434542[_0x756a('0x52')]={};}return _0x434542;};}exports[_0x756a('0x54')]=function(_0x29dc28,_0x1df751,_0x13c484){var _0x7b003f=[];return db[_0x756a('0x55')][_0x756a('0x47')]({'where':{'role':[_0x756a('0x56'),'admin',_0x756a('0x57')]},'attributes':['id',_0x756a('0x58'),_0x756a('0x2c'),'role',_0x756a('0x59'),_0x756a('0x5a'),'online',_0x756a('0x5b'),_0x756a('0x5c'),_0x756a('0x5d')],'order':qs[_0x756a('0x3f')](_0x756a('0x5e')),'include':[{'model':db['VoiceQueue'],'as':_0x756a('0x5f'),'attributes':['id',_0x756a('0x2c'),_0x756a('0x33')],'through':{'attributes':[]}}]})[_0x756a('0x27')](function(_0xf4aeeb){if(_0xf4aeeb){var _0x3b98fd=_0x29dc28['user'][_0x756a('0x60')]({'plain':!![]});if(!_0x3b98fd)throw new Error(_0x756a('0x61'));if(_0x3b98fd['role']===_0x756a('0x57')){return db[_0x756a('0x62')]['find']({'where':{'name':'Agents','userProfileId':_0x3b98fd[_0x756a('0x63')]},'raw':!![]})[_0x756a('0x27')](function(_0x99ad21){if(_0x99ad21){if(_0x99ad21[_0x756a('0x64')]===0x0){return db[_0x756a('0x65')][_0x756a('0x47')]({'where':{'sectionId':_0x99ad21['id']},'raw':!![]})[_0x756a('0x27')](function(_0x4b3dcf){var _0x47a842=[];if(_[_0x756a('0x66')](_0x4b3dcf)){_0x47a842=_[_0x756a('0x41')](_0xf4aeeb,function(_0x70f717){if(_0x70f717['role']!==_0x756a('0x56')){return _0x70f717;}});return _0x47a842;}else{for(var _0x5ef4b2=0x0;_0x5ef4b2<_0xf4aeeb[_0x756a('0x3c')];_0x5ef4b2++){var _0x1192a4=_0xf4aeeb[_0x5ef4b2];if(_0x1192a4[_0x756a('0x67')]===_0x756a('0x56')){var _0x2206ab=_[_0x756a('0x4e')](_0x4b3dcf,function(_0x31d5d9){return _0x31d5d9[_0x756a('0x68')]===_0x1192a4['id'];});if(_0x2206ab)_0x47a842['push'](_0x1192a4);}else{_0x47a842['push'](_0x1192a4);}}return _0x47a842;}});}else{return _0xf4aeeb;}}else{var _0x14e457=_[_0x756a('0x41')](_0xf4aeeb,function(_0xcfdfc5){if(_0xcfdfc5[_0x756a('0x67')]!==_0x756a('0x56')){return _0xcfdfc5;}});return _0x14e457;}});}else{return _0xf4aeeb;}}})['then'](function(_0x550e3c){var _0x50ba78=[];if(_0x550e3c){_0x7b003f=_0x550e3c;for(var _0x280fe5=0x0;_0x280fe5<_0x550e3c['length'];_0x280fe5+=0x1){_0x7b003f[_0x280fe5][_0x756a('0x69')]=[];_0x50ba78[_0x756a('0x6a')](db[_0x756a('0x30')][_0x756a('0x4e')]({'where':{'FromId':[_0x29dc28[_0x756a('0x57')]['id'],_0x550e3c[_0x280fe5]['id']],'ToId':[_0x29dc28[_0x756a('0x57')]['id'],_0x550e3c[_0x280fe5]['id']],'ChatGroupId':null},'attributes':['id','createdAt','FromId',_0x756a('0x6b'),_0x756a('0x6c'),_0x756a('0x4d')],'order':qs[_0x756a('0x3f')]('-createdAt'),'limit':0x1,'offset':0x0,'raw':!![]})[_0x756a('0x27')](wrapUser(_0x550e3c[_0x280fe5])));}return BPromise['all'](_0x50ba78);}return[];})[_0x756a('0x27')](function(_0x5bf72e){return{'rows':_0x5bf72e,'count':_0x5bf72e[_0x756a('0x3c')]};})[_0x756a('0x27')](respondWithResult(_0x1df751,null))[_0x756a('0x49')](handleError(_0x1df751,null));};
\ No newline at end of file
diff --git a/server/api/chatInternalMessage/chatInternalMessage.events.js b/server/api/chatInternalMessage/chatInternalMessage.events.js
index 51650a4..511a211 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 _0xf19d=['ChatInternalMessage','setMaxListeners','update','emit','hasOwnProperty','hook','exports','events','../../mysqldb'];(function(_0x463852,_0x47f96b){var _0x5deab2=function(_0xab39e2){while(--_0xab39e2){_0x463852['push'](_0x463852['shift']());}};_0x5deab2(++_0x47f96b);}(_0xf19d,0x1b7));var _0xdf19=function(_0x1ac595,_0x5d2081){_0x1ac595=_0x1ac595-0x0;var _0x455fff=_0xf19d[_0x1ac595];return _0x455fff;};'use strict';var EventEmitter=require(_0xdf19('0x0'));var ChatInternalMessage=require(_0xdf19('0x1'))['db'][_0xdf19('0x2')];var ChatInternalMessageEvents=new EventEmitter();ChatInternalMessageEvents[_0xdf19('0x3')](0x0);var events={'afterCreate':'save','afterUpdate':_0xdf19('0x4'),'afterDestroy':'remove'};function emitEvent(_0x725908){return function(_0x2db030,_0x34c25b,_0x4bd11f){ChatInternalMessageEvents[_0xdf19('0x5')](_0x725908+':'+_0x2db030['id'],_0x2db030);ChatInternalMessageEvents[_0xdf19('0x5')](_0x725908,_0x2db030);_0x4bd11f(null);};}for(var e in events){if(events[_0xdf19('0x6')](e)){var event=events[e];ChatInternalMessage[_0xdf19('0x7')](e,emitEvent(event));}}module[_0xdf19('0x8')]=ChatInternalMessageEvents;
\ No newline at end of file
+var _0x1a80=['save','remove','emit','hasOwnProperty','hook','events','ChatInternalMessage'];(function(_0x355d8c,_0x2de949){var _0xd527fa=function(_0x49ca82){while(--_0x49ca82){_0x355d8c['push'](_0x355d8c['shift']());}};_0xd527fa(++_0x2de949);}(_0x1a80,0x1e1));var _0x01a8=function(_0x2b063d,_0x57b7c2){_0x2b063d=_0x2b063d-0x0;var _0x17bceb=_0x1a80[_0x2b063d];return _0x17bceb;};'use strict';var EventEmitter=require(_0x01a8('0x0'));var ChatInternalMessage=require('../../mysqldb')['db'][_0x01a8('0x1')];var ChatInternalMessageEvents=new EventEmitter();ChatInternalMessageEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x01a8('0x2'),'afterUpdate':'update','afterDestroy':_0x01a8('0x3')};function emitEvent(_0x2b5c85){return function(_0xb926,_0x2872f4,_0xb25951){ChatInternalMessageEvents[_0x01a8('0x4')](_0x2b5c85+':'+_0xb926['id'],_0xb926);ChatInternalMessageEvents['emit'](_0x2b5c85,_0xb926);_0xb25951(null);};}for(var e in events){if(events[_0x01a8('0x5')](e)){var event=events[e];ChatInternalMessage[_0x01a8('0x6')](e,emitEvent(event));}}module['exports']=ChatInternalMessageEvents;
\ No newline at end of file
diff --git a/server/api/chatInternalMessage/chatInternalMessage.model.js b/server/api/chatInternalMessage/chatInternalMessage.model.js
index bcc77ca..513b04a 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 _0x8b63=['request-promise','../../config/environment','./chatInternalMessage.attributes','define','ChatInternalMessage','chat_internal_messages','lodash','util','api','bluebird'];(function(_0x3509b8,_0x38f51c){var _0x24239c=function(_0x1f3f40){while(--_0x1f3f40){_0x3509b8['push'](_0x3509b8['shift']());}};_0x24239c(++_0x38f51c);}(_0x8b63,0x10a));var _0x38b6=function(_0x55b8f9,_0x26f376){_0x55b8f9=_0x55b8f9-0x0;var _0x21ef2e=_0x8b63[_0x55b8f9];return _0x21ef2e;};'use strict';var _=require(_0x38b6('0x0'));var util=require(_0x38b6('0x1'));var logger=require('../../config/logger')(_0x38b6('0x2'));var moment=require('moment');var BPromise=require(_0x38b6('0x3'));var rp=require(_0x38b6('0x4'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x38b6('0x5'));var attributes=require(_0x38b6('0x6'));module['exports']=function(_0x59081a,_0x22be3a){return _0x59081a[_0x38b6('0x7')](_0x38b6('0x8'),attributes,{'tableName':_0x38b6('0x9'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':'utf8mb4','collate':'utf8mb4_unicode_ci'});};
\ No newline at end of file
+var _0x0f25=['rimraf','../../config/environment','exports','define','utf8mb4','utf8mb4_unicode_ci','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path'];(function(_0x401d67,_0xeb1592){var _0x25076b=function(_0x233577){while(--_0x233577){_0x401d67['push'](_0x401d67['shift']());}};_0x25076b(++_0xeb1592);}(_0x0f25,0x18e));var _0x50f2=function(_0x301cd8,_0x2eceb8){_0x301cd8=_0x301cd8-0x0;var _0x52a8ad=_0x0f25[_0x301cd8];return _0x52a8ad;};'use strict';var _=require(_0x50f2('0x0'));var util=require(_0x50f2('0x1'));var logger=require(_0x50f2('0x2'))(_0x50f2('0x3'));var moment=require(_0x50f2('0x4'));var BPromise=require(_0x50f2('0x5'));var rp=require(_0x50f2('0x6'));var fs=require('fs');var path=require(_0x50f2('0x7'));var rimraf=require(_0x50f2('0x8'));var config=require(_0x50f2('0x9'));var attributes=require('./chatInternalMessage.attributes');module[_0x50f2('0xa')]=function(_0x3428b7,_0x4dd7b1){return _0x3428b7[_0x50f2('0xb')]('ChatInternalMessage',attributes,{'tableName':'chat_internal_messages','paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x50f2('0xc'),'collate':_0x50f2('0xd')});};
\ No newline at end of file
diff --git a/server/api/chatInternalMessage/chatInternalMessage.rpc.js b/server/api/chatInternalMessage/chatInternalMessage.rpc.js
index 877db7f..d211dab 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 _0x11a5=['../../config/environment','jayson/promise','client','http','redis','defaults','localhost','./chatInternalMessage.socket','register','request','info','ChatInternalMessage,\x20%s,\x20%s','request\x20sent','ChatInternalMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc'];(function(_0x44c29e,_0x1d5eb8){var _0x4d50f4=function(_0x4d913f){while(--_0x4d913f){_0x44c29e['push'](_0x44c29e['shift']());}};_0x4d50f4(++_0x1d5eb8);}(_0x11a5,0x88));var _0x511a=function(_0x23c217,_0x3aee12){_0x23c217=_0x23c217-0x0;var _0x53fcf8=_0x11a5[_0x23c217];return _0x53fcf8;};'use strict';var _=require(_0x511a('0x0'));var util=require(_0x511a('0x1'));var moment=require(_0x511a('0x2'));var BPromise=require('bluebird');var rs=require(_0x511a('0x3'));var fs=require('fs');var Redis=require(_0x511a('0x4'));var db=require(_0x511a('0x5'))['db'];var utils=require(_0x511a('0x6'));var logger=require(_0x511a('0x7'))(_0x511a('0x8'));var config=require(_0x511a('0x9'));var jayson=require(_0x511a('0xa'));var client=jayson[_0x511a('0xb')][_0x511a('0xc')]({'port':0x232a});config[_0x511a('0xd')]=_[_0x511a('0xe')](config[_0x511a('0xd')],{'host':_0x511a('0xf'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x511a('0xd')]));require(_0x511a('0x10'))[_0x511a('0x11')](socket);function respondWithRpcPromise(_0x461805,_0x11b1d7,_0x3d7fba){return new BPromise(function(_0x316391,_0x5b6bc6){return client[_0x511a('0x12')](_0x461805,_0x3d7fba)['then'](function(_0x571ef0){logger[_0x511a('0x13')](_0x511a('0x14'),_0x11b1d7,_0x511a('0x15'));logger['debug'](_0x511a('0x16'),_0x11b1d7,_0x511a('0x15'),JSON[_0x511a('0x17')](_0x571ef0));if(_0x571ef0[_0x511a('0x18')]){if(_0x571ef0[_0x511a('0x18')][_0x511a('0x19')]===0x1f4){logger[_0x511a('0x18')](_0x511a('0x14'),_0x11b1d7,_0x571ef0[_0x511a('0x18')]['message']);return _0x5b6bc6(_0x571ef0[_0x511a('0x18')][_0x511a('0x1a')]);}logger[_0x511a('0x18')](_0x511a('0x14'),_0x11b1d7,_0x571ef0['error']['message']);return _0x316391(_0x571ef0['error']['message']);}else{logger[_0x511a('0x13')](_0x511a('0x14'),_0x11b1d7,'request\x20sent');_0x316391(_0x571ef0[_0x511a('0x1b')]['message']);}})[_0x511a('0x1c')](function(_0x2a25ab){logger[_0x511a('0x18')]('ChatInternalMessage,\x20%s,\x20%s',_0x11b1d7,_0x2a25ab);_0x5b6bc6(_0x2a25ab);});});}
\ No newline at end of file
+var _0x0e28=['http','redis','localhost','request','info','ChatInternalMessage,\x20%s,\x20%s','request\x20sent','debug','ChatInternalMessage,\x20%s,\x20%s,\x20%s','stringify','code','error','message','result','catch','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client'];(function(_0x1781f9,_0x5c36a3){var _0x4bd468=function(_0x3d3efb){while(--_0x3d3efb){_0x1781f9['push'](_0x1781f9['shift']());}};_0x4bd468(++_0x5c36a3);}(_0x0e28,0x12d));var _0x80e2=function(_0x57b54c,_0x54ce0d){_0x57b54c=_0x57b54c-0x0;var _0x59cc19=_0x0e28[_0x57b54c];return _0x59cc19;};'use strict';var _=require('lodash');var util=require(_0x80e2('0x0'));var moment=require(_0x80e2('0x1'));var BPromise=require(_0x80e2('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x80e2('0x3'));var db=require(_0x80e2('0x4'))['db'];var utils=require(_0x80e2('0x5'));var logger=require(_0x80e2('0x6'))(_0x80e2('0x7'));var config=require(_0x80e2('0x8'));var jayson=require(_0x80e2('0x9'));var client=jayson[_0x80e2('0xa')][_0x80e2('0xb')]({'port':0x232a});config[_0x80e2('0xc')]=_['defaults'](config[_0x80e2('0xc')],{'host':_0x80e2('0xd'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x80e2('0xc')]));require('./chatInternalMessage.socket')['register'](socket);function respondWithRpcPromise(_0x23f3b4,_0x1e997e,_0x4cde86){return new BPromise(function(_0x15771a,_0x349d3c){return client[_0x80e2('0xe')](_0x23f3b4,_0x4cde86)['then'](function(_0x3ffeb9){logger[_0x80e2('0xf')](_0x80e2('0x10'),_0x1e997e,_0x80e2('0x11'));logger[_0x80e2('0x12')](_0x80e2('0x13'),_0x1e997e,_0x80e2('0x11'),JSON[_0x80e2('0x14')](_0x3ffeb9));if(_0x3ffeb9['error']){if(_0x3ffeb9['error'][_0x80e2('0x15')]===0x1f4){logger[_0x80e2('0x16')](_0x80e2('0x10'),_0x1e997e,_0x3ffeb9[_0x80e2('0x16')][_0x80e2('0x17')]);return _0x349d3c(_0x3ffeb9[_0x80e2('0x16')][_0x80e2('0x17')]);}logger['error'](_0x80e2('0x10'),_0x1e997e,_0x3ffeb9[_0x80e2('0x16')][_0x80e2('0x17')]);return _0x15771a(_0x3ffeb9['error'][_0x80e2('0x17')]);}else{logger[_0x80e2('0xf')](_0x80e2('0x10'),_0x1e997e,_0x80e2('0x11'));_0x15771a(_0x3ffeb9[_0x80e2('0x18')][_0x80e2('0x17')]);}})[_0x80e2('0x19')](function(_0x267e15){logger[_0x80e2('0x16')](_0x80e2('0x10'),_0x1e997e,_0x267e15);_0x349d3c(_0x267e15);});});}
\ No newline at end of file
diff --git a/server/api/chatInternalMessage/chatInternalMessage.socket.js b/server/api/chatInternalMessage/chatInternalMessage.socket.js
index be41b0e..d51869c 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 _0xda03=['removeListener','register','length','chatInternalMessage:','./chatInternalMessage.events','save','update','emit'];(function(_0xb41e07,_0x96401e){var _0x267ffe=function(_0x4c433f){while(--_0x4c433f){_0xb41e07['push'](_0xb41e07['shift']());}};_0x267ffe(++_0x96401e);}(_0xda03,0x1ac));var _0x3da0=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xda03[_0x3dd15e];return _0x231fd0;};'use strict';var ChatInternalMessageEvents=require(_0x3da0('0x0'));var events=[_0x3da0('0x1'),'remove',_0x3da0('0x2')];function createListener(_0x13d9af,_0x50f58f){return function(_0x34511f){_0x50f58f[_0x3da0('0x3')](_0x13d9af,_0x34511f);};}function removeListener(_0x2c57a7,_0x227d0d){return function(){ChatInternalMessageEvents[_0x3da0('0x4')](_0x2c57a7,_0x227d0d);};}exports[_0x3da0('0x5')]=function(_0x2c6561){for(var _0x3759cf=0x0,_0x1d1b51=events[_0x3da0('0x6')];_0x3759cf<_0x1d1b51;_0x3759cf++){var _0x309b48=events[_0x3759cf];var _0x1ddc16=createListener(_0x3da0('0x7')+_0x309b48,_0x2c6561);ChatInternalMessageEvents['on'](_0x309b48,_0x1ddc16);}};
\ No newline at end of file
+var _0xe60f=['register','length','chatInternalMessage:','save','remove'];(function(_0x30e53b,_0xac1400){var _0x5a5c36=function(_0x1c1507){while(--_0x1c1507){_0x30e53b['push'](_0x30e53b['shift']());}};_0x5a5c36(++_0xac1400);}(_0xe60f,0x1f2));var _0xfe60=function(_0x99a3df,_0x45aafc){_0x99a3df=_0x99a3df-0x0;var _0x3f6369=_0xe60f[_0x99a3df];return _0x3f6369;};'use strict';var ChatInternalMessageEvents=require('./chatInternalMessage.events');var events=[_0xfe60('0x0'),_0xfe60('0x1'),'update'];function createListener(_0x1873ce,_0x21787f){return function(_0xa99cc1){_0x21787f['emit'](_0x1873ce,_0xa99cc1);};}function removeListener(_0x2b14fa,_0x4de8d6){return function(){ChatInternalMessageEvents['removeListener'](_0x2b14fa,_0x4de8d6);};}exports[_0xfe60('0x2')]=function(_0xa589cd){for(var _0x41b372=0x0,_0x64e9ae=events[_0xfe60('0x3')];_0x41b372<_0x64e9ae;_0x41b372++){var _0x5230ec=events[_0x41b372];var _0x168dbf=createListener(_0xfe60('0x4')+_0x5230ec,_0xa589cd);ChatInternalMessageEvents['on'](_0x5230ec,_0x168dbf);}};
\ No newline at end of file
diff --git a/server/api/chatInternalMessage/index.js b/server/api/chatInternalMessage/index.js
index 5383e19..a77eb5f 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 _0xa978=['get','isAuthenticated','/describe','/users','/:id','show','create','put','update','delete','exports','multer','connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment'];(function(_0x4b369d,_0x265eb8){var _0x571a98=function(_0x56341a){while(--_0x56341a){_0x4b369d['push'](_0x4b369d['shift']());}};_0x571a98(++_0x265eb8);}(_0xa978,0x185));var _0x8a97=function(_0x59e7f0,_0x44d4c8){_0x59e7f0=_0x59e7f0-0x0;var _0x20ea60=_0xa978[_0x59e7f0];return _0x20ea60;};'use strict';var multer=require(_0x8a97('0x0'));var util=require('util');var path=require('path');var timeout=require(_0x8a97('0x1'));var express=require(_0x8a97('0x2'));var router=express[_0x8a97('0x3')]();var fs_extra=require(_0x8a97('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0x8a97('0x5'));var config=require(_0x8a97('0x6'));var controller=require('./chatInternalMessage.controller');router[_0x8a97('0x7')]('/',auth[_0x8a97('0x8')](),controller['index']);router[_0x8a97('0x7')](_0x8a97('0x9'),auth[_0x8a97('0x8')](),controller['describe']);router[_0x8a97('0x7')](_0x8a97('0xa'),auth[_0x8a97('0x8')](),controller['getUsers']);router[_0x8a97('0x7')](_0x8a97('0xb'),auth[_0x8a97('0x8')](),controller[_0x8a97('0xc')]);router['post']('/',auth[_0x8a97('0x8')](),controller[_0x8a97('0xd')]);router[_0x8a97('0xe')](_0x8a97('0xb'),controller[_0x8a97('0xf')]);router[_0x8a97('0x10')](_0x8a97('0xb'),auth[_0x8a97('0x8')](),controller['destroy']);module[_0x8a97('0x11')]=router;
\ No newline at end of file
+var _0x5026=['../../components/interaction/service','./chatInternalMessage.controller','get','index','/describe','isAuthenticated','/users','getUsers','/:id','create','update','destroy','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service'];(function(_0x4ca1b8,_0x9faad5){var _0x49b9e4=function(_0x360bcd){while(--_0x360bcd){_0x4ca1b8['push'](_0x4ca1b8['shift']());}};_0x49b9e4(++_0x9faad5);}(_0x5026,0xac));var _0x6502=function(_0x5be840,_0x4e11ec){_0x5be840=_0x5be840-0x0;var _0x576dd5=_0x5026[_0x5be840];return _0x576dd5;};'use strict';var multer=require(_0x6502('0x0'));var util=require(_0x6502('0x1'));var path=require(_0x6502('0x2'));var timeout=require(_0x6502('0x3'));var express=require(_0x6502('0x4'));var router=express[_0x6502('0x5')]();var fs_extra=require(_0x6502('0x6'));var auth=require(_0x6502('0x7'));var interaction=require(_0x6502('0x8'));var config=require('../../config/environment');var controller=require(_0x6502('0x9'));router[_0x6502('0xa')]('/',auth['isAuthenticated'](),controller[_0x6502('0xb')]);router['get'](_0x6502('0xc'),auth[_0x6502('0xd')](),controller['describe']);router['get'](_0x6502('0xe'),auth['isAuthenticated'](),controller[_0x6502('0xf')]);router[_0x6502('0xa')](_0x6502('0x10'),auth[_0x6502('0xd')](),controller['show']);router['post']('/',auth[_0x6502('0xd')](),controller[_0x6502('0x11')]);router['put'](_0x6502('0x10'),controller[_0x6502('0x12')]);router['delete'](_0x6502('0x10'),auth[_0x6502('0xd')](),controller[_0x6502('0x13')]);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 deed161..2005ea4 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 _0xb91a=['medium','BOOLEAN','ENUM','out','DATE','exports','TEXT'];(function(_0x1b3ddb,_0x190f99){var _0x3b952d=function(_0x590bd0){while(--_0x590bd0){_0x1b3ddb['push'](_0x1b3ddb['shift']());}};_0x3b952d(++_0x190f99);}(_0xb91a,0xe5));var _0xab91=function(_0x5d87b0,_0x3135a5){_0x5d87b0=_0x5d87b0-0x0;var _0x5872fc=_0xb91a[_0x5d87b0];return _0x5872fc;};'use strict';var Sequelize=require('sequelize');module[_0xab91('0x0')]={'body':{'type':Sequelize[_0xab91('0x1')](_0xab91('0x2')),'allowNull':![]},'read':{'type':Sequelize[_0xab91('0x3')],'defaultValue':![]},'secret':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'direction':{'type':Sequelize[_0xab91('0x4')]('in',_0xab91('0x5')),'defaultValue':'out','allowNull':![]},'readAt':{'type':Sequelize[_0xab91('0x6')]},'providerName':{'type':Sequelize['STRING']},'providerResponse':{'type':Sequelize['TEXT']}};
\ No newline at end of file
+var _0x7033=['sequelize','exports','TEXT','medium','BOOLEAN','ENUM','out','DATE','STRING'];(function(_0x4099ee,_0x38495a){var _0x1b7bfc=function(_0x5f5388){while(--_0x5f5388){_0x4099ee['push'](_0x4099ee['shift']());}};_0x1b7bfc(++_0x38495a);}(_0x7033,0x19e));var _0x3703=function(_0x167cc1,_0x56ef5a){_0x167cc1=_0x167cc1-0x0;var _0x10bc4b=_0x7033[_0x167cc1];return _0x10bc4b;};'use strict';var Sequelize=require(_0x3703('0x0'));module[_0x3703('0x1')]={'body':{'type':Sequelize[_0x3703('0x2')](_0x3703('0x3')),'allowNull':![]},'read':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'secret':{'type':Sequelize[_0x3703('0x4')],'defaultValue':![]},'direction':{'type':Sequelize[_0x3703('0x5')]('in',_0x3703('0x6')),'defaultValue':_0x3703('0x6'),'allowNull':![]},'readAt':{'type':Sequelize[_0x3703('0x7')]},'providerName':{'type':Sequelize[_0x3703('0x8')]},'providerResponse':{'type':Sequelize[_0x3703('0x2')]}};
\ No newline at end of file
diff --git a/server/api/chatMessage/chatMessage.controller.js b/server/api/chatMessage/chatMessage.controller.js
index da554ea..f3c0251 100644
--- a/server/api/chatMessage/chatMessage.controller.js
+++ b/server/api/chatMessage/chatMessage.controller.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xa9e0=['interaction','[CHATMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','user','role','null','AcceptMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','ContactId','sequelize','contact','email','internal','manual','interface','SIP/%s','channel','event','EventManager','acceptmessage','parse','formData','chat-interactions','chat','ChatInteraction','RejectMessage','rejectMessage','Sequelize','QueryTypes','SELECT','fullname','rejectmessage','eml-format','rimraf','zip-dir','moment','mustache','util','path','sox','to-csv','fs-extra','lodash','squel','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/license/util','../../mysqldb','redis','defaults','localhost','./chatMessage.socket','register','jayson/promise','client','http','then','info','ChatMessage,\x20%s,\x20%s','request\x20sent','debug','ChatMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','sendStatus','end','status','json','offset','undefined','count','limit','set','Content-Range','reject','save','update','destroy','stack','name','send','map','ChatMessage','fieldName','type','keys','query','filters','intersection','attributes','fields','length','model','hasOwnProperty','nolimit','sort','where','pick','filter','merge','VIRTUAL','includeAll','include','findAll','rows','show','params','body','find','describe','../../config/logger','accept','read','readAt','YYYY-MM-DD\x20HH:mm:ss','UserId','agent','get','ChatInteractionId','isNil','read1stAt','format'];(function(_0x7484a8,_0x55a315){var _0x1f0527=function(_0x5d6476){while(--_0x5d6476){_0x7484a8['push'](_0x7484a8['shift']());}};_0x1f0527(++_0x55a315);}(_0xa9e0,0x123));var _0x0a9e=function(_0x138f59,_0x1b53fb){_0x138f59=_0x138f59-0x0;var _0x3d114d=_0xa9e0[_0x138f59];return _0x3d114d;};'use strict';var emlformat=require(_0x0a9e('0x0'));var rimraf=require(_0x0a9e('0x1'));var zipdir=require(_0x0a9e('0x2'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x0a9e('0x3'));var BPromise=require('bluebird');var Mustache=require(_0x0a9e('0x4'));var util=require(_0x0a9e('0x5'));var path=require(_0x0a9e('0x6'));var sox=require(_0x0a9e('0x7'));var csv=require(_0x0a9e('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x0a9e('0x9'));var _=require(_0x0a9e('0xa'));var squel=require(_0x0a9e('0xb'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x0a9e('0xc'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x0a9e('0xd'));var Redis=require(_0x0a9e('0xe'));var authService=require(_0x0a9e('0xf'));var qs=require(_0x0a9e('0x10'));var as=require(_0x0a9e('0x11'));var hardwareService=require(_0x0a9e('0x12'));var logger=require('../../config/logger')('api');var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0x0a9e('0x13'));var db=require(_0x0a9e('0x14'))['db'];config[_0x0a9e('0x15')]=_[_0x0a9e('0x16')](config[_0x0a9e('0x15')],{'host':_0x0a9e('0x17'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x0a9e('0x15')]));require(_0x0a9e('0x18'))[_0x0a9e('0x19')](socket);var jayson=require(_0x0a9e('0x1a'));var client=jayson[_0x0a9e('0x1b')][_0x0a9e('0x1c')]({'port':0x232c});var client9002=jayson['client'][_0x0a9e('0x1c')]({'port':0x232a});function respondWithRpcPromise(_0x5d0880,_0x1985b6,_0x519dfd,_0x16033c){return new BPromise(function(_0x12066b,_0x48f32d){var _0x225616=_0x16033c||client;return _0x225616['request'](_0x5d0880,_0x519dfd)[_0x0a9e('0x1d')](function(_0x478723){logger[_0x0a9e('0x1e')](_0x0a9e('0x1f'),_0x1985b6,_0x0a9e('0x20'));logger[_0x0a9e('0x21')](_0x0a9e('0x22'),_0x1985b6,_0x0a9e('0x20'),JSON[_0x0a9e('0x23')](_0x478723));if(_0x478723[_0x0a9e('0x24')]){if(_0x478723[_0x0a9e('0x24')][_0x0a9e('0x25')]===0x1f4){logger['error'](_0x0a9e('0x1f'),_0x1985b6,_0x478723[_0x0a9e('0x24')]['message']);return _0x48f32d(_0x478723[_0x0a9e('0x24')]['message']);}logger['error'](_0x0a9e('0x1f'),_0x1985b6,_0x478723[_0x0a9e('0x24')][_0x0a9e('0x26')]);return _0x12066b(_0x478723[_0x0a9e('0x24')]['message']);}else{logger[_0x0a9e('0x1e')](_0x0a9e('0x1f'),_0x1985b6,_0x0a9e('0x20'));_0x12066b(_0x478723[_0x0a9e('0x27')][_0x0a9e('0x26')]);}})[_0x0a9e('0x28')](function(_0x16b1ca){logger['error']('ChatMessage,\x20%s,\x20%s',_0x1985b6,_0x16b1ca);_0x48f32d(_0x16b1ca);});});}function respondWithStatusCode(_0x197ec0,_0x3a8e58){_0x3a8e58=_0x3a8e58||0xcc;return function(_0x40c424){if(_0x40c424){return _0x197ec0[_0x0a9e('0x29')](_0x3a8e58);}return _0x197ec0['status'](_0x3a8e58)[_0x0a9e('0x2a')]();};}function respondWithResult(_0x479bc4,_0x45a1e7){_0x45a1e7=_0x45a1e7||0xc8;return function(_0x5bfb33){if(_0x5bfb33){return _0x479bc4[_0x0a9e('0x2b')](_0x45a1e7)[_0x0a9e('0x2c')](_0x5bfb33);}};}function respondWithFilteredResult(_0x25fba9,_0x14433c){return function(_0x140511){if(_0x140511){var _0x1538a4=typeof _0x14433c[_0x0a9e('0x2d')]===_0x0a9e('0x2e')&&typeof _0x14433c['limit']===_0x0a9e('0x2e');var _0x468813=_0x140511[_0x0a9e('0x2f')];var _0x2ec755=_0x1538a4?0x0:_0x14433c['offset'];var _0x15b200=_0x1538a4?_0x140511[_0x0a9e('0x2f')]:_0x14433c[_0x0a9e('0x2d')]+_0x14433c[_0x0a9e('0x30')];var _0x58b06f;if(_0x15b200>=_0x468813){_0x15b200=_0x468813;_0x58b06f=0xc8;}else{_0x58b06f=0xce;}_0x25fba9[_0x0a9e('0x2b')](_0x58b06f);return _0x25fba9[_0x0a9e('0x31')](_0x0a9e('0x32'),_0x2ec755+'-'+_0x15b200+'/'+_0x468813)[_0x0a9e('0x2c')](_0x140511);}return null;};}function patchUpdates(_0x540530){return function(_0x426950){try{jsonpatch['apply'](_0x426950,_0x540530,!![]);}catch(_0x2407f9){return BPromise[_0x0a9e('0x33')](_0x2407f9);}return _0x426950[_0x0a9e('0x34')]();};}function saveUpdates(_0x33bdb7,_0x25ce3a){return function(_0x5180f1){if(_0x5180f1){return _0x5180f1[_0x0a9e('0x35')](_0x33bdb7)[_0x0a9e('0x1d')](function(_0x40cb85){return _0x40cb85;});}return null;};}function removeEntity(_0x2da5c0,_0x2b45ea){return function(_0x409319){if(_0x409319){return _0x409319[_0x0a9e('0x36')]()[_0x0a9e('0x1d')](function(){_0x2da5c0['status'](0xcc)[_0x0a9e('0x2a')]();});}};}function handleEntityNotFound(_0x5e7238,_0x2cc7a0){return function(_0x14b13f){if(!_0x14b13f){_0x5e7238[_0x0a9e('0x29')](0x194);}return _0x14b13f;};}function handleError(_0x3f3d41,_0x567193){_0x567193=_0x567193||0x1f4;return function(_0x191e91){logger[_0x0a9e('0x24')](_0x191e91[_0x0a9e('0x37')]);if(_0x191e91[_0x0a9e('0x38')]){delete _0x191e91['name'];}_0x3f3d41['status'](_0x567193)[_0x0a9e('0x39')](_0x191e91);};}exports['index']=function(_0x24936a,_0x3d9717){var _0x381c37={},_0x1ef87a={},_0x4f41ae={'count':0x0,'rows':[]};var _0x31916f=_[_0x0a9e('0x3a')](db[_0x0a9e('0x3b')]['rawAttributes'],function(_0x1dbf74){return{'name':_0x1dbf74[_0x0a9e('0x3c')],'type':_0x1dbf74[_0x0a9e('0x3d')]['key']};});_0x1ef87a['model']=_[_0x0a9e('0x3a')](_0x31916f,_0x0a9e('0x38'));_0x1ef87a['query']=_[_0x0a9e('0x3e')](_0x24936a[_0x0a9e('0x3f')]);_0x1ef87a[_0x0a9e('0x40')]=_[_0x0a9e('0x41')](_0x1ef87a['model'],_0x1ef87a['query']);_0x381c37[_0x0a9e('0x42')]=_[_0x0a9e('0x41')](_0x1ef87a['model'],qs[_0x0a9e('0x43')](_0x24936a[_0x0a9e('0x3f')][_0x0a9e('0x43')]));_0x381c37['attributes']=_0x381c37[_0x0a9e('0x42')][_0x0a9e('0x44')]?_0x381c37[_0x0a9e('0x42')]:_0x1ef87a[_0x0a9e('0x45')];if(!_0x24936a[_0x0a9e('0x3f')][_0x0a9e('0x46')](_0x0a9e('0x47'))){_0x381c37[_0x0a9e('0x30')]=qs[_0x0a9e('0x30')](_0x24936a[_0x0a9e('0x3f')][_0x0a9e('0x30')]);_0x381c37[_0x0a9e('0x2d')]=qs[_0x0a9e('0x2d')](_0x24936a[_0x0a9e('0x3f')][_0x0a9e('0x2d')]);}_0x381c37['order']=qs['sort'](_0x24936a[_0x0a9e('0x3f')][_0x0a9e('0x48')]);_0x381c37[_0x0a9e('0x49')]=qs[_0x0a9e('0x40')](_[_0x0a9e('0x4a')](_0x24936a[_0x0a9e('0x3f')],_0x1ef87a[_0x0a9e('0x40')]),_0x31916f);if(_0x24936a[_0x0a9e('0x3f')][_0x0a9e('0x4b')]){_0x381c37[_0x0a9e('0x49')]=_[_0x0a9e('0x4c')](_0x381c37[_0x0a9e('0x49')],{'$or':_['map'](_0x31916f,function(_0x117c99){if(_0x117c99[_0x0a9e('0x3d')]!==_0x0a9e('0x4d')){var _0xfbd5ad={};_0xfbd5ad[_0x117c99[_0x0a9e('0x38')]]={'$like':'%'+_0x24936a[_0x0a9e('0x3f')][_0x0a9e('0x4b')]+'%'};return _0xfbd5ad;}})});}_0x381c37=_[_0x0a9e('0x4c')]({},_0x381c37,_0x24936a['options']);var _0x2e9d90={'where':_0x381c37['where']};return db[_0x0a9e('0x3b')][_0x0a9e('0x2f')](_0x2e9d90)[_0x0a9e('0x1d')](function(_0x562fb4){_0x4f41ae[_0x0a9e('0x2f')]=_0x562fb4;if(_0x24936a[_0x0a9e('0x3f')][_0x0a9e('0x4e')]){_0x381c37[_0x0a9e('0x4f')]=[{'all':!![]}];}return db[_0x0a9e('0x3b')][_0x0a9e('0x50')](_0x381c37);})[_0x0a9e('0x1d')](function(_0x5bbcde){_0x4f41ae[_0x0a9e('0x51')]=_0x5bbcde;return _0x4f41ae;})[_0x0a9e('0x1d')](respondWithFilteredResult(_0x3d9717,_0x381c37))[_0x0a9e('0x28')](handleError(_0x3d9717,null));};exports[_0x0a9e('0x52')]=function(_0x409789,_0x992c77){var _0x6054ee={'raw':!![],'where':{'id':_0x409789[_0x0a9e('0x53')]['id']}},_0x19383e={};_0x19383e['model']=_[_0x0a9e('0x3e')](db[_0x0a9e('0x3b')]['rawAttributes']);_0x19383e['query']=_['keys'](_0x409789[_0x0a9e('0x3f')]);_0x19383e[_0x0a9e('0x40')]=_[_0x0a9e('0x41')](_0x19383e[_0x0a9e('0x45')],_0x19383e[_0x0a9e('0x3f')]);_0x6054ee[_0x0a9e('0x42')]=_[_0x0a9e('0x41')](_0x19383e[_0x0a9e('0x45')],qs['fields'](_0x409789['query']['fields']));_0x6054ee[_0x0a9e('0x42')]=_0x6054ee[_0x0a9e('0x42')][_0x0a9e('0x44')]?_0x6054ee['attributes']:_0x19383e[_0x0a9e('0x45')];if(_0x409789[_0x0a9e('0x3f')]['includeAll']){_0x6054ee['include']=[{'all':!![]}];}_0x6054ee=_[_0x0a9e('0x4c')]({},_0x6054ee,_0x409789['options']);return db[_0x0a9e('0x3b')]['find'](_0x6054ee)[_0x0a9e('0x1d')](handleEntityNotFound(_0x992c77,null))[_0x0a9e('0x1d')](respondWithResult(_0x992c77,null))[_0x0a9e('0x28')](handleError(_0x992c77,null));};exports['create']=function(_0x2f82da,_0x1bf38a){return db['ChatMessage']['create'](_0x2f82da[_0x0a9e('0x54')],{})[_0x0a9e('0x1d')](respondWithResult(_0x1bf38a,0xc9))['catch'](handleError(_0x1bf38a,null));};exports[_0x0a9e('0x35')]=function(_0x5ce9ac,_0x211ef9){if(_0x5ce9ac['body']['id']){delete _0x5ce9ac[_0x0a9e('0x54')]['id'];}return db['ChatMessage']['find']({'where':{'id':_0x5ce9ac['params']['id']}})[_0x0a9e('0x1d')](handleEntityNotFound(_0x211ef9,null))['then'](saveUpdates(_0x5ce9ac[_0x0a9e('0x54')],null))[_0x0a9e('0x1d')](respondWithResult(_0x211ef9,null))[_0x0a9e('0x28')](handleError(_0x211ef9,null));};exports[_0x0a9e('0x36')]=function(_0x232830,_0x272738){return db[_0x0a9e('0x3b')][_0x0a9e('0x55')]({'where':{'id':_0x232830['params']['id']}})[_0x0a9e('0x1d')](handleEntityNotFound(_0x272738,null))[_0x0a9e('0x1d')](removeEntity(_0x272738,null))[_0x0a9e('0x28')](handleError(_0x272738,null));};exports[_0x0a9e('0x56')]=function(_0xb83dfd,_0x156662){return db['ChatMessage'][_0x0a9e('0x56')]()[_0x0a9e('0x1d')](respondWithResult(_0x156662,null))['catch'](handleError(_0x156662,null));};var interaction_log=require(_0x0a9e('0x57'))('chat-interactions');exports[_0x0a9e('0x58')]=function(_0x5ba1f9,_0x4b3c1a,_0x5674ee){var _0x273cb5={'agent':{},'channel':'chat'};if(_0x5ba1f9[_0x0a9e('0x54')]['id']){delete _0x5ba1f9[_0x0a9e('0x54')]['id'];}_0x5ba1f9[_0x0a9e('0x54')][_0x0a9e('0x59')]=!![];_0x5ba1f9[_0x0a9e('0x54')][_0x0a9e('0x5a')]=moment()['format'](_0x0a9e('0x5b'));_0x5ba1f9['body'][_0x0a9e('0x5c')]=_0x5ba1f9[_0x0a9e('0x54')][_0x0a9e('0x5c')]||_0x5ba1f9['user']['id'];_0x273cb5[_0x0a9e('0x5d')]['id']=_0x5ba1f9[_0x0a9e('0x54')][_0x0a9e('0x5c')];return db[_0x0a9e('0x3b')]['find']({'where':{'id':_0x5ba1f9[_0x0a9e('0x53')]['id'],'UserId':null}})[_0x0a9e('0x1d')](handleEntityNotFound(_0x4b3c1a,null))['then'](saveUpdates(_0x5ba1f9[_0x0a9e('0x54')],null))[_0x0a9e('0x1d')](function(_0x88dcbf){if(_0x88dcbf){_0x273cb5[_0x0a9e('0x26')]=_0x88dcbf[_0x0a9e('0x5e')]({'plain':!![]});return db['ChatInteraction'][_0x0a9e('0x55')]({'where':{'id':_0x88dcbf[_0x0a9e('0x5f')]}});}return null;})[_0x0a9e('0x1d')](handleEntityNotFound(_0x4b3c1a,null))['then'](function(_0x3528b7){if(_0x3528b7){return _0x3528b7['update']({'UserId':_0x5ba1f9['body'][_0x0a9e('0x5c')],'read1stAt':_[_0x0a9e('0x60')](_0x3528b7[_0x0a9e('0x61')])?moment()[_0x0a9e('0x62')](_0x0a9e('0x5b')):undefined});}return null;})[_0x0a9e('0x1d')](function(_0x387489){if(_0x387489){_0x273cb5[_0x0a9e('0x63')]=_0x387489[_0x0a9e('0x5e')]({'plain':!![]});interaction_log[_0x0a9e('0x1e')](_0x0a9e('0x64'),_0x5ba1f9[_0x0a9e('0x65')]['id'],_0x5ba1f9[_0x0a9e('0x65')][_0x0a9e('0x38')],_0x5ba1f9[_0x0a9e('0x65')][_0x0a9e('0x66')],_0x273cb5[_0x0a9e('0x63')]['id'],_0x5ba1f9[_0x0a9e('0x54')]?JSON['stringify'](_0x5ba1f9[_0x0a9e('0x54')]):_0x0a9e('0x67'));return respondWithRpcPromise(_0x0a9e('0x68'),'acceptMessage',_0x273cb5);}return null;})[_0x0a9e('0x1d')](function(_0x30944e){var _0x4b341d=_0x0a9e('0x69')+_0x30944e[_0x0a9e('0x26')][_0x0a9e('0x6a')];return db[_0x0a9e('0x6b')][_0x0a9e('0x3f')](_0x4b341d,{'type':db['Sequelize']['QueryTypes']['SELECT'],'raw':!![]})[_0x0a9e('0x1d')](function(_0x18bf5d){return _0x18bf5d;});})[_0x0a9e('0x1d')](function(_0x23a7d3){if(_0x23a7d3){_0x273cb5[_0x0a9e('0x26')][_0x0a9e('0x6c')]=_0x23a7d3[0x0];if(!_0x5ba1f9[_0x0a9e('0x54')][_0x0a9e('0x5c')])return;return db['User'][_0x0a9e('0x55')]({'where':{'id':_0x5ba1f9[_0x0a9e('0x54')][_0x0a9e('0x5c')],'role':'agent'},'attributes':['id',_0x0a9e('0x38'),'fullname',_0x0a9e('0x6d'),_0x0a9e('0x6e')],'raw':!![]});}return null;})['then'](function(_0x2ed01e){if(!_0x2ed01e)return null;_0x273cb5[_0x0a9e('0x26')][_0x0a9e('0x5d')]=_0x2ed01e;return _0x273cb5;})[_0x0a9e('0x1d')](function(_0x542ece){if(_0x542ece){if(_0x5ba1f9[_0x0a9e('0x54')][_0x0a9e('0x6f')]){_0x273cb5[_0x0a9e('0x26')][_0x0a9e('0x70')]=util['format'](_0x0a9e('0x71'),_0x5ba1f9[_0x0a9e('0x65')][_0x0a9e('0x38')]);_0x273cb5[_0x0a9e('0x26')]['channel']=_0x273cb5[_0x0a9e('0x72')];_0x273cb5[_0x0a9e('0x26')][_0x0a9e('0x73')]=_0x0a9e('0x58');return respondWithRpcPromise(_0x0a9e('0x74'),_0x0a9e('0x74'),{'event':_0x0a9e('0x75'),'message':_[_0x0a9e('0x4c')](_0x273cb5[_0x0a9e('0x26')],JSON[_0x0a9e('0x76')](_0x273cb5[_0x0a9e('0x63')][_0x0a9e('0x77')]))},client9002)[_0x0a9e('0x1d')](function(){return _0x273cb5;});}return _0x273cb5;}return null;})[_0x0a9e('0x1d')](respondWithResult(_0x4b3c1a,null))['catch'](handleError(_0x4b3c1a,null));};var interaction_log=require(_0x0a9e('0x57'))(_0x0a9e('0x78'));exports[_0x0a9e('0x33')]=function(_0x563627,_0x3736e0,_0x33dda0){var _0x8cea96={'agent':{},'channel':_0x0a9e('0x79')};if(_0x563627['body']['id']){delete _0x563627['body']['id'];}_0x563627[_0x0a9e('0x54')][_0x0a9e('0x5c')]=_0x563627['body'][_0x0a9e('0x5c')]||_0x563627['user']['id'];_0x8cea96[_0x0a9e('0x5d')]['id']=_0x563627[_0x0a9e('0x54')]['UserId'];return db[_0x0a9e('0x3b')][_0x0a9e('0x55')]({'where':{'id':_0x563627[_0x0a9e('0x53')]['id'],'UserId':null}})[_0x0a9e('0x1d')](handleEntityNotFound(_0x3736e0,null))[_0x0a9e('0x1d')](function(_0x1f42a0){if(_0x1f42a0){_0x8cea96[_0x0a9e('0x26')]=_0x1f42a0['get']({'plain':!![]});return db[_0x0a9e('0x7a')][_0x0a9e('0x55')]({'where':{'id':_0x1f42a0[_0x0a9e('0x5f')]}});}return null;})[_0x0a9e('0x1d')](handleEntityNotFound(_0x3736e0,null))['then'](function(_0xf51744){if(_0xf51744){_0x8cea96[_0x0a9e('0x63')]=_0xf51744['get']({'plain':!![]});interaction_log[_0x0a9e('0x1e')]('[CHATMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s',_0x563627[_0x0a9e('0x65')]['id'],_0x563627[_0x0a9e('0x65')][_0x0a9e('0x38')],_0x563627[_0x0a9e('0x65')]['role'],_0x8cea96['interaction']['id'],_0x563627[_0x0a9e('0x54')]?JSON[_0x0a9e('0x23')](_0x563627[_0x0a9e('0x54')]):'null');return respondWithRpcPromise(_0x0a9e('0x7b'),_0x0a9e('0x7c'),_0x8cea96);}return null;})['then'](function(_0x4e46b2){var _0xf0a802='SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20'+_0x4e46b2['message']['ContactId'];return db[_0x0a9e('0x6b')][_0x0a9e('0x3f')](_0xf0a802,{'type':db[_0x0a9e('0x7d')][_0x0a9e('0x7e')][_0x0a9e('0x7f')],'raw':!![]})[_0x0a9e('0x1d')](function(_0x5a8854){return _0x5a8854;});})[_0x0a9e('0x1d')](function(_0x5955f1){if(_0x5955f1){_0x8cea96[_0x0a9e('0x26')][_0x0a9e('0x6c')]=_0x5955f1[0x0];if(!_0x563627[_0x0a9e('0x54')][_0x0a9e('0x5c')])return;return db['User'][_0x0a9e('0x55')]({'where':{'id':_0x563627[_0x0a9e('0x54')][_0x0a9e('0x5c')],'role':'agent'},'attributes':['id',_0x0a9e('0x38'),_0x0a9e('0x80'),_0x0a9e('0x6d'),_0x0a9e('0x6e')],'raw':!![]});}return null;})[_0x0a9e('0x1d')](function(_0x1910bf){if(!_0x1910bf)return null;_0x8cea96[_0x0a9e('0x26')][_0x0a9e('0x5d')]=_0x1910bf;return _0x8cea96;})['then'](function(_0x2645d6){if(_0x2645d6){_0x2645d6[_0x0a9e('0x26')]['interface']=util[_0x0a9e('0x62')](_0x0a9e('0x71'),_0x563627[_0x0a9e('0x65')]['name']);_0x2645d6[_0x0a9e('0x26')]['channel']=_0x8cea96[_0x0a9e('0x72')];_0x2645d6[_0x0a9e('0x26')][_0x0a9e('0x73')]=_0x0a9e('0x33');respondWithRpcPromise(_0x0a9e('0x74'),_0x0a9e('0x74'),{'event':_0x0a9e('0x81'),'message':_[_0x0a9e('0x4c')](_0x8cea96['message'],JSON[_0x0a9e('0x76')](_0x8cea96[_0x0a9e('0x63')][_0x0a9e('0x77')]))},client9002);return _0x8cea96;}return null;})[_0x0a9e('0x1d')](respondWithResult(_0x3736e0,null))[_0x0a9e('0x28')](handleError(_0x3736e0,null));};
\ No newline at end of file
+var _0xa9e0=['interaction','[CHATMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','user','role','null','AcceptMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','ContactId','sequelize','contact','email','internal','manual','interface','SIP/%s','channel','event','EventManager','acceptmessage','parse','formData','chat-interactions','chat','ChatInteraction','RejectMessage','rejectMessage','Sequelize','QueryTypes','SELECT','fullname','rejectmessage','eml-format','rimraf','zip-dir','moment','mustache','util','path','sox','to-csv','fs-extra','lodash','squel','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/license/util','../../mysqldb','redis','defaults','localhost','./chatMessage.socket','register','jayson/promise','client','http','then','info','ChatMessage,\x20%s,\x20%s','request\x20sent','debug','ChatMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','sendStatus','end','status','json','offset','undefined','count','limit','set','Content-Range','reject','save','update','destroy','stack','name','send','map','ChatMessage','fieldName','type','keys','query','filters','intersection','attributes','fields','length','model','hasOwnProperty','nolimit','sort','where','pick','filter','merge','VIRTUAL','includeAll','include','findAll','rows','show','params','body','find','describe','../../config/logger','accept','read','readAt','YYYY-MM-DD\x20HH:mm:ss','UserId','agent','get','ChatInteractionId','isNil','read1stAt','format'];(function(_0x2da02c,_0x293473){var _0x1b6fe9=function(_0x2cdfa4){while(--_0x2cdfa4){_0x2da02c['push'](_0x2da02c['shift']());}};_0x1b6fe9(++_0x293473);}(_0xa9e0,0x123));var _0x0a9e=function(_0x4cf98e,_0xba4b79){_0x4cf98e=_0x4cf98e-0x0;var _0x1623ac=_0xa9e0[_0x4cf98e];return _0x1623ac;};'use strict';var emlformat=require(_0x0a9e('0x0'));var rimraf=require(_0x0a9e('0x1'));var zipdir=require(_0x0a9e('0x2'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x0a9e('0x3'));var BPromise=require('bluebird');var Mustache=require(_0x0a9e('0x4'));var util=require(_0x0a9e('0x5'));var path=require(_0x0a9e('0x6'));var sox=require(_0x0a9e('0x7'));var csv=require(_0x0a9e('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x0a9e('0x9'));var _=require(_0x0a9e('0xa'));var squel=require(_0x0a9e('0xb'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x0a9e('0xc'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x0a9e('0xd'));var Redis=require(_0x0a9e('0xe'));var authService=require(_0x0a9e('0xf'));var qs=require(_0x0a9e('0x10'));var as=require(_0x0a9e('0x11'));var hardwareService=require(_0x0a9e('0x12'));var logger=require('../../config/logger')('api');var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0x0a9e('0x13'));var db=require(_0x0a9e('0x14'))['db'];config[_0x0a9e('0x15')]=_[_0x0a9e('0x16')](config[_0x0a9e('0x15')],{'host':_0x0a9e('0x17'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x0a9e('0x15')]));require(_0x0a9e('0x18'))[_0x0a9e('0x19')](socket);var jayson=require(_0x0a9e('0x1a'));var client=jayson[_0x0a9e('0x1b')][_0x0a9e('0x1c')]({'port':0x232c});var client9002=jayson['client'][_0x0a9e('0x1c')]({'port':0x232a});function respondWithRpcPromise(_0x5d0880,_0x1985b6,_0x519dfd,_0x16033c){return new BPromise(function(_0x12066b,_0x48f32d){var _0x225616=_0x16033c||client;return _0x225616['request'](_0x5d0880,_0x519dfd)[_0x0a9e('0x1d')](function(_0x478723){logger[_0x0a9e('0x1e')](_0x0a9e('0x1f'),_0x1985b6,_0x0a9e('0x20'));logger[_0x0a9e('0x21')](_0x0a9e('0x22'),_0x1985b6,_0x0a9e('0x20'),JSON[_0x0a9e('0x23')](_0x478723));if(_0x478723[_0x0a9e('0x24')]){if(_0x478723[_0x0a9e('0x24')][_0x0a9e('0x25')]===0x1f4){logger['error'](_0x0a9e('0x1f'),_0x1985b6,_0x478723[_0x0a9e('0x24')]['message']);return _0x48f32d(_0x478723[_0x0a9e('0x24')]['message']);}logger['error'](_0x0a9e('0x1f'),_0x1985b6,_0x478723[_0x0a9e('0x24')][_0x0a9e('0x26')]);return _0x12066b(_0x478723[_0x0a9e('0x24')]['message']);}else{logger[_0x0a9e('0x1e')](_0x0a9e('0x1f'),_0x1985b6,_0x0a9e('0x20'));_0x12066b(_0x478723[_0x0a9e('0x27')][_0x0a9e('0x26')]);}})[_0x0a9e('0x28')](function(_0x16b1ca){logger['error']('ChatMessage,\x20%s,\x20%s',_0x1985b6,_0x16b1ca);_0x48f32d(_0x16b1ca);});});}function respondWithStatusCode(_0x197ec0,_0x3a8e58){_0x3a8e58=_0x3a8e58||0xcc;return function(_0x40c424){if(_0x40c424){return _0x197ec0[_0x0a9e('0x29')](_0x3a8e58);}return _0x197ec0['status'](_0x3a8e58)[_0x0a9e('0x2a')]();};}function respondWithResult(_0x479bc4,_0x45a1e7){_0x45a1e7=_0x45a1e7||0xc8;return function(_0x5bfb33){if(_0x5bfb33){return _0x479bc4[_0x0a9e('0x2b')](_0x45a1e7)[_0x0a9e('0x2c')](_0x5bfb33);}};}function respondWithFilteredResult(_0x25fba9,_0x14433c){return function(_0x140511){if(_0x140511){var _0x1538a4=typeof _0x14433c[_0x0a9e('0x2d')]===_0x0a9e('0x2e')&&typeof _0x14433c['limit']===_0x0a9e('0x2e');var _0x468813=_0x140511[_0x0a9e('0x2f')];var _0x2ec755=_0x1538a4?0x0:_0x14433c['offset'];var _0x15b200=_0x1538a4?_0x140511[_0x0a9e('0x2f')]:_0x14433c[_0x0a9e('0x2d')]+_0x14433c[_0x0a9e('0x30')];var _0x58b06f;if(_0x15b200>=_0x468813){_0x15b200=_0x468813;_0x58b06f=0xc8;}else{_0x58b06f=0xce;}_0x25fba9[_0x0a9e('0x2b')](_0x58b06f);return _0x25fba9[_0x0a9e('0x31')](_0x0a9e('0x32'),_0x2ec755+'-'+_0x15b200+'/'+_0x468813)[_0x0a9e('0x2c')](_0x140511);}return null;};}function patchUpdates(_0x540530){return function(_0x426950){try{jsonpatch['apply'](_0x426950,_0x540530,!![]);}catch(_0x2407f9){return BPromise[_0x0a9e('0x33')](_0x2407f9);}return _0x426950[_0x0a9e('0x34')]();};}function saveUpdates(_0x33bdb7,_0x25ce3a){return function(_0x5180f1){if(_0x5180f1){return _0x5180f1[_0x0a9e('0x35')](_0x33bdb7)[_0x0a9e('0x1d')](function(_0x40cb85){return _0x40cb85;});}return null;};}function removeEntity(_0x2da5c0,_0x2b45ea){return function(_0x409319){if(_0x409319){return _0x409319[_0x0a9e('0x36')]()[_0x0a9e('0x1d')](function(){_0x2da5c0['status'](0xcc)[_0x0a9e('0x2a')]();});}};}function handleEntityNotFound(_0x5e7238,_0x2cc7a0){return function(_0x14b13f){if(!_0x14b13f){_0x5e7238[_0x0a9e('0x29')](0x194);}return _0x14b13f;};}function handleError(_0x3f3d41,_0x567193){_0x567193=_0x567193||0x1f4;return function(_0x191e91){logger[_0x0a9e('0x24')](_0x191e91[_0x0a9e('0x37')]);if(_0x191e91[_0x0a9e('0x38')]){delete _0x191e91['name'];}_0x3f3d41['status'](_0x567193)[_0x0a9e('0x39')](_0x191e91);};}exports['index']=function(_0x24936a,_0x3d9717){var _0x381c37={},_0x1ef87a={},_0x4f41ae={'count':0x0,'rows':[]};var _0x31916f=_[_0x0a9e('0x3a')](db[_0x0a9e('0x3b')]['rawAttributes'],function(_0x1dbf74){return{'name':_0x1dbf74[_0x0a9e('0x3c')],'type':_0x1dbf74[_0x0a9e('0x3d')]['key']};});_0x1ef87a['model']=_[_0x0a9e('0x3a')](_0x31916f,_0x0a9e('0x38'));_0x1ef87a['query']=_[_0x0a9e('0x3e')](_0x24936a[_0x0a9e('0x3f')]);_0x1ef87a[_0x0a9e('0x40')]=_[_0x0a9e('0x41')](_0x1ef87a['model'],_0x1ef87a['query']);_0x381c37[_0x0a9e('0x42')]=_[_0x0a9e('0x41')](_0x1ef87a['model'],qs[_0x0a9e('0x43')](_0x24936a[_0x0a9e('0x3f')][_0x0a9e('0x43')]));_0x381c37['attributes']=_0x381c37[_0x0a9e('0x42')][_0x0a9e('0x44')]?_0x381c37[_0x0a9e('0x42')]:_0x1ef87a[_0x0a9e('0x45')];if(!_0x24936a[_0x0a9e('0x3f')][_0x0a9e('0x46')](_0x0a9e('0x47'))){_0x381c37[_0x0a9e('0x30')]=qs[_0x0a9e('0x30')](_0x24936a[_0x0a9e('0x3f')][_0x0a9e('0x30')]);_0x381c37[_0x0a9e('0x2d')]=qs[_0x0a9e('0x2d')](_0x24936a[_0x0a9e('0x3f')][_0x0a9e('0x2d')]);}_0x381c37['order']=qs['sort'](_0x24936a[_0x0a9e('0x3f')][_0x0a9e('0x48')]);_0x381c37[_0x0a9e('0x49')]=qs[_0x0a9e('0x40')](_[_0x0a9e('0x4a')](_0x24936a[_0x0a9e('0x3f')],_0x1ef87a[_0x0a9e('0x40')]),_0x31916f);if(_0x24936a[_0x0a9e('0x3f')][_0x0a9e('0x4b')]){_0x381c37[_0x0a9e('0x49')]=_[_0x0a9e('0x4c')](_0x381c37[_0x0a9e('0x49')],{'$or':_['map'](_0x31916f,function(_0x117c99){if(_0x117c99[_0x0a9e('0x3d')]!==_0x0a9e('0x4d')){var _0xfbd5ad={};_0xfbd5ad[_0x117c99[_0x0a9e('0x38')]]={'$like':'%'+_0x24936a[_0x0a9e('0x3f')][_0x0a9e('0x4b')]+'%'};return _0xfbd5ad;}})});}_0x381c37=_[_0x0a9e('0x4c')]({},_0x381c37,_0x24936a['options']);var _0x2e9d90={'where':_0x381c37['where']};return db[_0x0a9e('0x3b')][_0x0a9e('0x2f')](_0x2e9d90)[_0x0a9e('0x1d')](function(_0x562fb4){_0x4f41ae[_0x0a9e('0x2f')]=_0x562fb4;if(_0x24936a[_0x0a9e('0x3f')][_0x0a9e('0x4e')]){_0x381c37[_0x0a9e('0x4f')]=[{'all':!![]}];}return db[_0x0a9e('0x3b')][_0x0a9e('0x50')](_0x381c37);})[_0x0a9e('0x1d')](function(_0x5bbcde){_0x4f41ae[_0x0a9e('0x51')]=_0x5bbcde;return _0x4f41ae;})[_0x0a9e('0x1d')](respondWithFilteredResult(_0x3d9717,_0x381c37))[_0x0a9e('0x28')](handleError(_0x3d9717,null));};exports[_0x0a9e('0x52')]=function(_0x409789,_0x992c77){var _0x6054ee={'raw':!![],'where':{'id':_0x409789[_0x0a9e('0x53')]['id']}},_0x19383e={};_0x19383e['model']=_[_0x0a9e('0x3e')](db[_0x0a9e('0x3b')]['rawAttributes']);_0x19383e['query']=_['keys'](_0x409789[_0x0a9e('0x3f')]);_0x19383e[_0x0a9e('0x40')]=_[_0x0a9e('0x41')](_0x19383e[_0x0a9e('0x45')],_0x19383e[_0x0a9e('0x3f')]);_0x6054ee[_0x0a9e('0x42')]=_[_0x0a9e('0x41')](_0x19383e[_0x0a9e('0x45')],qs['fields'](_0x409789['query']['fields']));_0x6054ee[_0x0a9e('0x42')]=_0x6054ee[_0x0a9e('0x42')][_0x0a9e('0x44')]?_0x6054ee['attributes']:_0x19383e[_0x0a9e('0x45')];if(_0x409789[_0x0a9e('0x3f')]['includeAll']){_0x6054ee['include']=[{'all':!![]}];}_0x6054ee=_[_0x0a9e('0x4c')]({},_0x6054ee,_0x409789['options']);return db[_0x0a9e('0x3b')]['find'](_0x6054ee)[_0x0a9e('0x1d')](handleEntityNotFound(_0x992c77,null))[_0x0a9e('0x1d')](respondWithResult(_0x992c77,null))[_0x0a9e('0x28')](handleError(_0x992c77,null));};exports['create']=function(_0x2f82da,_0x1bf38a){return db['ChatMessage']['create'](_0x2f82da[_0x0a9e('0x54')],{})[_0x0a9e('0x1d')](respondWithResult(_0x1bf38a,0xc9))['catch'](handleError(_0x1bf38a,null));};exports[_0x0a9e('0x35')]=function(_0x5ce9ac,_0x211ef9){if(_0x5ce9ac['body']['id']){delete _0x5ce9ac[_0x0a9e('0x54')]['id'];}return db['ChatMessage']['find']({'where':{'id':_0x5ce9ac['params']['id']}})[_0x0a9e('0x1d')](handleEntityNotFound(_0x211ef9,null))['then'](saveUpdates(_0x5ce9ac[_0x0a9e('0x54')],null))[_0x0a9e('0x1d')](respondWithResult(_0x211ef9,null))[_0x0a9e('0x28')](handleError(_0x211ef9,null));};exports[_0x0a9e('0x36')]=function(_0x232830,_0x272738){return db[_0x0a9e('0x3b')][_0x0a9e('0x55')]({'where':{'id':_0x232830['params']['id']}})[_0x0a9e('0x1d')](handleEntityNotFound(_0x272738,null))[_0x0a9e('0x1d')](removeEntity(_0x272738,null))[_0x0a9e('0x28')](handleError(_0x272738,null));};exports[_0x0a9e('0x56')]=function(_0xb83dfd,_0x156662){return db['ChatMessage'][_0x0a9e('0x56')]()[_0x0a9e('0x1d')](respondWithResult(_0x156662,null))['catch'](handleError(_0x156662,null));};var interaction_log=require(_0x0a9e('0x57'))('chat-interactions');exports[_0x0a9e('0x58')]=function(_0x5ba1f9,_0x4b3c1a,_0x5674ee){var _0x273cb5={'agent':{},'channel':'chat'};if(_0x5ba1f9[_0x0a9e('0x54')]['id']){delete _0x5ba1f9[_0x0a9e('0x54')]['id'];}_0x5ba1f9[_0x0a9e('0x54')][_0x0a9e('0x59')]=!![];_0x5ba1f9[_0x0a9e('0x54')][_0x0a9e('0x5a')]=moment()['format'](_0x0a9e('0x5b'));_0x5ba1f9['body'][_0x0a9e('0x5c')]=_0x5ba1f9[_0x0a9e('0x54')][_0x0a9e('0x5c')]||_0x5ba1f9['user']['id'];_0x273cb5[_0x0a9e('0x5d')]['id']=_0x5ba1f9[_0x0a9e('0x54')][_0x0a9e('0x5c')];return db[_0x0a9e('0x3b')]['find']({'where':{'id':_0x5ba1f9[_0x0a9e('0x53')]['id'],'UserId':null}})[_0x0a9e('0x1d')](handleEntityNotFound(_0x4b3c1a,null))['then'](saveUpdates(_0x5ba1f9[_0x0a9e('0x54')],null))[_0x0a9e('0x1d')](function(_0x88dcbf){if(_0x88dcbf){_0x273cb5[_0x0a9e('0x26')]=_0x88dcbf[_0x0a9e('0x5e')]({'plain':!![]});return db['ChatInteraction'][_0x0a9e('0x55')]({'where':{'id':_0x88dcbf[_0x0a9e('0x5f')]}});}return null;})[_0x0a9e('0x1d')](handleEntityNotFound(_0x4b3c1a,null))['then'](function(_0x3528b7){if(_0x3528b7){return _0x3528b7['update']({'UserId':_0x5ba1f9['body'][_0x0a9e('0x5c')],'read1stAt':_[_0x0a9e('0x60')](_0x3528b7[_0x0a9e('0x61')])?moment()[_0x0a9e('0x62')](_0x0a9e('0x5b')):undefined});}return null;})[_0x0a9e('0x1d')](function(_0x387489){if(_0x387489){_0x273cb5[_0x0a9e('0x63')]=_0x387489[_0x0a9e('0x5e')]({'plain':!![]});interaction_log[_0x0a9e('0x1e')](_0x0a9e('0x64'),_0x5ba1f9[_0x0a9e('0x65')]['id'],_0x5ba1f9[_0x0a9e('0x65')][_0x0a9e('0x38')],_0x5ba1f9[_0x0a9e('0x65')][_0x0a9e('0x66')],_0x273cb5[_0x0a9e('0x63')]['id'],_0x5ba1f9[_0x0a9e('0x54')]?JSON['stringify'](_0x5ba1f9[_0x0a9e('0x54')]):_0x0a9e('0x67'));return respondWithRpcPromise(_0x0a9e('0x68'),'acceptMessage',_0x273cb5);}return null;})[_0x0a9e('0x1d')](function(_0x30944e){var _0x4b341d=_0x0a9e('0x69')+_0x30944e[_0x0a9e('0x26')][_0x0a9e('0x6a')];return db[_0x0a9e('0x6b')][_0x0a9e('0x3f')](_0x4b341d,{'type':db['Sequelize']['QueryTypes']['SELECT'],'raw':!![]})[_0x0a9e('0x1d')](function(_0x18bf5d){return _0x18bf5d;});})[_0x0a9e('0x1d')](function(_0x23a7d3){if(_0x23a7d3){_0x273cb5[_0x0a9e('0x26')][_0x0a9e('0x6c')]=_0x23a7d3[0x0];if(!_0x5ba1f9[_0x0a9e('0x54')][_0x0a9e('0x5c')])return;return db['User'][_0x0a9e('0x55')]({'where':{'id':_0x5ba1f9[_0x0a9e('0x54')][_0x0a9e('0x5c')],'role':'agent'},'attributes':['id',_0x0a9e('0x38'),'fullname',_0x0a9e('0x6d'),_0x0a9e('0x6e')],'raw':!![]});}return null;})['then'](function(_0x2ed01e){if(!_0x2ed01e)return null;_0x273cb5[_0x0a9e('0x26')][_0x0a9e('0x5d')]=_0x2ed01e;return _0x273cb5;})[_0x0a9e('0x1d')](function(_0x542ece){if(_0x542ece){if(_0x5ba1f9[_0x0a9e('0x54')][_0x0a9e('0x6f')]){_0x273cb5[_0x0a9e('0x26')][_0x0a9e('0x70')]=util['format'](_0x0a9e('0x71'),_0x5ba1f9[_0x0a9e('0x65')][_0x0a9e('0x38')]);_0x273cb5[_0x0a9e('0x26')]['channel']=_0x273cb5[_0x0a9e('0x72')];_0x273cb5[_0x0a9e('0x26')][_0x0a9e('0x73')]=_0x0a9e('0x58');return respondWithRpcPromise(_0x0a9e('0x74'),_0x0a9e('0x74'),{'event':_0x0a9e('0x75'),'message':_[_0x0a9e('0x4c')](_0x273cb5[_0x0a9e('0x26')],JSON[_0x0a9e('0x76')](_0x273cb5[_0x0a9e('0x63')][_0x0a9e('0x77')]))},client9002)[_0x0a9e('0x1d')](function(){return _0x273cb5;});}return _0x273cb5;}return null;})[_0x0a9e('0x1d')](respondWithResult(_0x4b3c1a,null))['catch'](handleError(_0x4b3c1a,null));};var interaction_log=require(_0x0a9e('0x57'))(_0x0a9e('0x78'));exports[_0x0a9e('0x33')]=function(_0x563627,_0x3736e0,_0x33dda0){var _0x8cea96={'agent':{},'channel':_0x0a9e('0x79')};if(_0x563627['body']['id']){delete _0x563627['body']['id'];}_0x563627[_0x0a9e('0x54')][_0x0a9e('0x5c')]=_0x563627['body'][_0x0a9e('0x5c')]||_0x563627['user']['id'];_0x8cea96[_0x0a9e('0x5d')]['id']=_0x563627[_0x0a9e('0x54')]['UserId'];return db[_0x0a9e('0x3b')][_0x0a9e('0x55')]({'where':{'id':_0x563627[_0x0a9e('0x53')]['id'],'UserId':null}})[_0x0a9e('0x1d')](handleEntityNotFound(_0x3736e0,null))[_0x0a9e('0x1d')](function(_0x1f42a0){if(_0x1f42a0){_0x8cea96[_0x0a9e('0x26')]=_0x1f42a0['get']({'plain':!![]});return db[_0x0a9e('0x7a')][_0x0a9e('0x55')]({'where':{'id':_0x1f42a0[_0x0a9e('0x5f')]}});}return null;})[_0x0a9e('0x1d')](handleEntityNotFound(_0x3736e0,null))['then'](function(_0xf51744){if(_0xf51744){_0x8cea96[_0x0a9e('0x63')]=_0xf51744['get']({'plain':!![]});interaction_log[_0x0a9e('0x1e')]('[CHATMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s',_0x563627[_0x0a9e('0x65')]['id'],_0x563627[_0x0a9e('0x65')][_0x0a9e('0x38')],_0x563627[_0x0a9e('0x65')]['role'],_0x8cea96['interaction']['id'],_0x563627[_0x0a9e('0x54')]?JSON[_0x0a9e('0x23')](_0x563627[_0x0a9e('0x54')]):'null');return respondWithRpcPromise(_0x0a9e('0x7b'),_0x0a9e('0x7c'),_0x8cea96);}return null;})['then'](function(_0x4e46b2){var _0xf0a802='SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20'+_0x4e46b2['message']['ContactId'];return db[_0x0a9e('0x6b')][_0x0a9e('0x3f')](_0xf0a802,{'type':db[_0x0a9e('0x7d')][_0x0a9e('0x7e')][_0x0a9e('0x7f')],'raw':!![]})[_0x0a9e('0x1d')](function(_0x5a8854){return _0x5a8854;});})[_0x0a9e('0x1d')](function(_0x5955f1){if(_0x5955f1){_0x8cea96[_0x0a9e('0x26')][_0x0a9e('0x6c')]=_0x5955f1[0x0];if(!_0x563627[_0x0a9e('0x54')][_0x0a9e('0x5c')])return;return db['User'][_0x0a9e('0x55')]({'where':{'id':_0x563627[_0x0a9e('0x54')][_0x0a9e('0x5c')],'role':'agent'},'attributes':['id',_0x0a9e('0x38'),_0x0a9e('0x80'),_0x0a9e('0x6d'),_0x0a9e('0x6e')],'raw':!![]});}return null;})[_0x0a9e('0x1d')](function(_0x1910bf){if(!_0x1910bf)return null;_0x8cea96[_0x0a9e('0x26')][_0x0a9e('0x5d')]=_0x1910bf;return _0x8cea96;})['then'](function(_0x2645d6){if(_0x2645d6){_0x2645d6[_0x0a9e('0x26')]['interface']=util[_0x0a9e('0x62')](_0x0a9e('0x71'),_0x563627[_0x0a9e('0x65')]['name']);_0x2645d6[_0x0a9e('0x26')]['channel']=_0x8cea96[_0x0a9e('0x72')];_0x2645d6[_0x0a9e('0x26')][_0x0a9e('0x73')]=_0x0a9e('0x33');respondWithRpcPromise(_0x0a9e('0x74'),_0x0a9e('0x74'),{'event':_0x0a9e('0x81'),'message':_[_0x0a9e('0x4c')](_0x8cea96['message'],JSON[_0x0a9e('0x76')](_0x8cea96[_0x0a9e('0x63')][_0x0a9e('0x77')]))},client9002);return _0x8cea96;}return null;})[_0x0a9e('0x1d')](respondWithResult(_0x3736e0,null))[_0x0a9e('0x28')](handleError(_0x3736e0,null));};
\ No newline at end of file
diff --git a/server/api/chatMessage/chatMessage.events.js b/server/api/chatMessage/chatMessage.events.js
index c51612b..6a8c762 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 _0x1cc5=['ChatMessage','update','remove','emit','hasOwnProperty','hook','events','../../mysqldb'];(function(_0x4154a6,_0x2c0b8e){var _0x3b2786=function(_0x2f5936){while(--_0x2f5936){_0x4154a6['push'](_0x4154a6['shift']());}};_0x3b2786(++_0x2c0b8e);}(_0x1cc5,0x1e6));var _0x51cc=function(_0x5d07e1,_0x418799){_0x5d07e1=_0x5d07e1-0x0;var _0x21617f=_0x1cc5[_0x5d07e1];return _0x21617f;};'use strict';var EventEmitter=require(_0x51cc('0x0'));var ChatMessage=require(_0x51cc('0x1'))['db'][_0x51cc('0x2')];var ChatMessageEvents=new EventEmitter();ChatMessageEvents['setMaxListeners'](0x0);var events={'afterCreate':'save','afterUpdate':_0x51cc('0x3'),'afterDestroy':_0x51cc('0x4')};function emitEvent(_0x5f71a7){return function(_0x1cdcc0,_0x47ef69,_0x5487a7){ChatMessageEvents[_0x51cc('0x5')](_0x5f71a7+':'+_0x1cdcc0['id'],_0x1cdcc0);ChatMessageEvents[_0x51cc('0x5')](_0x5f71a7,_0x1cdcc0);_0x5487a7(null);};}for(var e in events){if(events[_0x51cc('0x6')](e)){var event=events[e];ChatMessage[_0x51cc('0x7')](e,emitEvent(event));}}module['exports']=ChatMessageEvents;
\ No newline at end of file
+var _0xe1a1=['hook','exports','events','../../mysqldb','setMaxListeners','save','emit'];(function(_0x1fd675,_0x165dfe){var _0x16b554=function(_0x5761ff){while(--_0x5761ff){_0x1fd675['push'](_0x1fd675['shift']());}};_0x16b554(++_0x165dfe);}(_0xe1a1,0x183));var _0x1e1a=function(_0x4a53d,_0x58a95e){_0x4a53d=_0x4a53d-0x0;var _0x27410e=_0xe1a1[_0x4a53d];return _0x27410e;};'use strict';var EventEmitter=require(_0x1e1a('0x0'));var ChatMessage=require(_0x1e1a('0x1'))['db']['ChatMessage'];var ChatMessageEvents=new EventEmitter();ChatMessageEvents[_0x1e1a('0x2')](0x0);var events={'afterCreate':_0x1e1a('0x3'),'afterUpdate':'update','afterDestroy':'remove'};function emitEvent(_0x79cc45){return function(_0x264e8c,_0x5b1261,_0x2d389f){ChatMessageEvents[_0x1e1a('0x4')](_0x79cc45+':'+_0x264e8c['id'],_0x264e8c);ChatMessageEvents[_0x1e1a('0x4')](_0x79cc45,_0x264e8c);_0x2d389f(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];ChatMessage[_0x1e1a('0x5')](e,emitEvent(event));}}module[_0x1e1a('0x6')]=ChatMessageEvents;
\ No newline at end of file
diff --git a/server/api/chatMessage/chatMessage.model.js b/server/api/chatMessage/chatMessage.model.js
index bc2c983..0b3615d 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 _0xb6a3=['bluebird','request-promise','rimraf','../../config/environment','./chatMessage.attributes','exports','define','ChatMessage','chat_messages','fti_chat_messages','body','FULLTEXT','models','toLowerCase','out','secret','UserId','findOne','ChatInteractionId','then','update','direction','error','utf8mb4','lodash','util','../../config/logger','api'];(function(_0x20620f,_0x37c815){var _0x593a2f=function(_0x25479a){while(--_0x25479a){_0x20620f['push'](_0x20620f['shift']());}};_0x593a2f(++_0x37c815);}(_0xb6a3,0x1d8));var _0x3b6a=function(_0x4e676e,_0x2a7c6d){_0x4e676e=_0x4e676e-0x0;var _0x336a3c=_0xb6a3[_0x4e676e];return _0x336a3c;};'use strict';var _=require(_0x3b6a('0x0'));var util=require(_0x3b6a('0x1'));var logger=require(_0x3b6a('0x2'))(_0x3b6a('0x3'));var moment=require('moment');var BPromise=require(_0x3b6a('0x4'));var rp=require(_0x3b6a('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x3b6a('0x6'));var config=require(_0x3b6a('0x7'));var attributes=require(_0x3b6a('0x8'));module[_0x3b6a('0x9')]=function(_0x1b52a9,_0x2ca1ba){return _0x1b52a9[_0x3b6a('0xa')](_0x3b6a('0xb'),attributes,{'tableName':_0x3b6a('0xc'),'paranoid':![],'indexes':[{'name':_0x3b6a('0xd'),'fields':[_0x3b6a('0xe')],'type':_0x3b6a('0xf')}],'timestamps':!![],'hooks':{'afterCreate':function(_0x5e48ca,_0xc2655b,_0x5ccd9d){var _0x24e34d=_0x1b52a9[_0x3b6a('0x10')];var _0x4d8b8b=_0x5e48ca['get']({'plain':!![]});if(_0x4d8b8b['direction'][_0x3b6a('0x11')]()==='in'||_0x4d8b8b['direction']['toLowerCase']()===_0x3b6a('0x12')&&!_0x4d8b8b[_0x3b6a('0x13')]&&!_['isNil'](_0x4d8b8b[_0x3b6a('0x14')])){_0x24e34d['ChatInteraction'][_0x3b6a('0x15')]({'where':{'id':_0x4d8b8b[_0x3b6a('0x16')]}})[_0x3b6a('0x17')](function(_0x5313cf){if(_0x5313cf){_0x5313cf[_0x3b6a('0x18')]({'lastMsgAt':_0x4d8b8b['createdAt'],'lastMsgDirection':_0x4d8b8b[_0x3b6a('0x19')][_0x3b6a('0x11')]()});}})['catch'](function(_0x285d4a){console[_0x3b6a('0x1a')](_0x285d4a);});}_0x5ccd9d();}},'charset':_0x3b6a('0x1b'),'collate':'utf8mb4_unicode_ci'});};
\ No newline at end of file
+var _0xacd4=['bluebird','request-promise','rimraf','../../config/environment','./chatMessage.attributes','exports','ChatMessage','chat_messages','fti_chat_messages','body','models','direction','toLowerCase','out','isNil','UserId','ChatInteraction','findOne','ChatInteractionId','createdAt','catch','utf8mb4_unicode_ci','lodash','../../config/logger','api','moment'];(function(_0x9815f2,_0x1bf69d){var _0x4dd2d4=function(_0x28e750){while(--_0x28e750){_0x9815f2['push'](_0x9815f2['shift']());}};_0x4dd2d4(++_0x1bf69d);}(_0xacd4,0xe6));var _0x4acd=function(_0x42cae2,_0x284ef8){_0x42cae2=_0x42cae2-0x0;var _0x5f256f=_0xacd4[_0x42cae2];return _0x5f256f;};'use strict';var _=require(_0x4acd('0x0'));var util=require('util');var logger=require(_0x4acd('0x1'))(_0x4acd('0x2'));var moment=require(_0x4acd('0x3'));var BPromise=require(_0x4acd('0x4'));var rp=require(_0x4acd('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x4acd('0x6'));var config=require(_0x4acd('0x7'));var attributes=require(_0x4acd('0x8'));module[_0x4acd('0x9')]=function(_0x2bf7b5,_0x100fb9){return _0x2bf7b5['define'](_0x4acd('0xa'),attributes,{'tableName':_0x4acd('0xb'),'paranoid':![],'indexes':[{'name':_0x4acd('0xc'),'fields':[_0x4acd('0xd')],'type':'FULLTEXT'}],'timestamps':!![],'hooks':{'afterCreate':function(_0x308a93,_0x365427,_0x218078){var _0xe9a34d=_0x2bf7b5[_0x4acd('0xe')];var _0x248e08=_0x308a93['get']({'plain':!![]});if(_0x248e08[_0x4acd('0xf')][_0x4acd('0x10')]()==='in'||_0x248e08[_0x4acd('0xf')]['toLowerCase']()===_0x4acd('0x11')&&!_0x248e08['secret']&&!_[_0x4acd('0x12')](_0x248e08[_0x4acd('0x13')])){_0xe9a34d[_0x4acd('0x14')][_0x4acd('0x15')]({'where':{'id':_0x248e08[_0x4acd('0x16')]}})['then'](function(_0x44bedf){if(_0x44bedf){_0x44bedf['update']({'lastMsgAt':_0x248e08[_0x4acd('0x17')],'lastMsgDirection':_0x248e08[_0x4acd('0xf')][_0x4acd('0x10')]()});}})[_0x4acd('0x18')](function(_0x13697a){console['error'](_0x13697a);});}_0x218078();}},'charset':'utf8mb4','collate':_0x4acd('0x19')});};
\ No newline at end of file
diff --git a/server/api/chatMessage/chatMessage.rpc.js b/server/api/chatMessage/chatMessage.rpc.js
index 8ae2598..3945e6f 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 _0xfcfa=['debug','ChatMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','body','raw','CreateChatMessage','catch','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/logger','../../config/environment','jayson/promise','http','defaults','localhost','socket.io-emitter','redis','./chatMessage.socket','register','request','then','info','ChatMessage,\x20%s,\x20%s','request\x20sent'];(function(_0x4dc2a5,_0x2fed9a){var _0x3279a8=function(_0x3c0d91){while(--_0x3c0d91){_0x4dc2a5['push'](_0x4dc2a5['shift']());}};_0x3279a8(++_0x2fed9a);}(_0xfcfa,0x14b));var _0xafcf=function(_0x49d9bd,_0xc72fd3){_0x49d9bd=_0x49d9bd-0x0;var _0xf7561e=_0xfcfa[_0x49d9bd];return _0xf7561e;};'use strict';var _=require(_0xafcf('0x0'));var util=require(_0xafcf('0x1'));var moment=require(_0xafcf('0x2'));var BPromise=require(_0xafcf('0x3'));var rs=require(_0xafcf('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xafcf('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0xafcf('0x6'))('rpc');var config=require(_0xafcf('0x7'));var jayson=require(_0xafcf('0x8'));var client=jayson['client'][_0xafcf('0x9')]({'port':0x232a});config['redis']=_[_0xafcf('0xa')](config['redis'],{'host':_0xafcf('0xb'),'port':0x18eb});var socket=require(_0xafcf('0xc'))(new Redis(config[_0xafcf('0xd')]));require(_0xafcf('0xe'))[_0xafcf('0xf')](socket);function respondWithRpcPromise(_0x55eadc,_0x91d958,_0x48c935){return new BPromise(function(_0x533a04,_0x19bd2f){return client[_0xafcf('0x10')](_0x55eadc,_0x48c935)[_0xafcf('0x11')](function(_0x1b2ad4){logger[_0xafcf('0x12')](_0xafcf('0x13'),_0x91d958,_0xafcf('0x14'));logger[_0xafcf('0x15')](_0xafcf('0x16'),_0x91d958,_0xafcf('0x14'),JSON[_0xafcf('0x17')](_0x1b2ad4));if(_0x1b2ad4[_0xafcf('0x18')]){if(_0x1b2ad4[_0xafcf('0x18')][_0xafcf('0x19')]===0x1f4){logger['error'](_0xafcf('0x13'),_0x91d958,_0x1b2ad4[_0xafcf('0x18')][_0xafcf('0x1a')]);return _0x19bd2f(_0x1b2ad4[_0xafcf('0x18')][_0xafcf('0x1a')]);}logger[_0xafcf('0x18')](_0xafcf('0x13'),_0x91d958,_0x1b2ad4[_0xafcf('0x18')]['message']);return _0x533a04(_0x1b2ad4[_0xafcf('0x18')]['message']);}else{logger[_0xafcf('0x12')]('ChatMessage,\x20%s,\x20%s',_0x91d958,_0xafcf('0x14'));_0x533a04(_0x1b2ad4[_0xafcf('0x1b')][_0xafcf('0x1a')]);}})['catch'](function(_0x15ddfe){logger[_0xafcf('0x18')]('ChatMessage,\x20%s,\x20%s',_0x91d958,_0x15ddfe);_0x19bd2f(_0x15ddfe);});});}exports['CreateChatMessage']=function(_0x532e58){var _0x130714=this;return new Promise(function(_0x3fb518,_0x519912){return db['ChatMessage']['create'](_0x532e58[_0xafcf('0x1c')],{'raw':_0x532e58['options']?_0x532e58['options'][_0xafcf('0x1d')]===undefined?!![]:![]:!![]})[_0xafcf('0x11')](function(_0x29ba2c){logger['info'](_0xafcf('0x1e'),_0x532e58);logger['debug']('CreateChatMessage',_0x532e58,JSON[_0xafcf('0x17')](_0x29ba2c));_0x3fb518(_0x29ba2c);})[_0xafcf('0x1f')](function(_0x5b1308){logger['error'](_0xafcf('0x1e'),_0x5b1308[_0xafcf('0x1a')],_0x532e58);_0x519912(_0x130714[_0xafcf('0x18')](0x1f4,_0x5b1308[_0xafcf('0x1a')]));});});};
\ No newline at end of file
+var _0x56cd=['../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','info','ChatMessage,\x20%s,\x20%s','request\x20sent','debug','ChatMessage,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','CreateChatMessage','ChatMessage','create','body','raw','lodash','util','bluebird','randomstring','ioredis'];(function(_0x4754b3,_0x135d7f){var _0x39a6fe=function(_0x5b4827){while(--_0x5b4827){_0x4754b3['push'](_0x4754b3['shift']());}};_0x39a6fe(++_0x135d7f);}(_0x56cd,0x77));var _0xd56c=function(_0x4bfac3,_0x58324d){_0x4bfac3=_0x4bfac3-0x0;var _0x15f0f2=_0x56cd[_0x4bfac3];return _0x15f0f2;};'use strict';var _=require(_0xd56c('0x0'));var util=require(_0xd56c('0x1'));var moment=require('moment');var BPromise=require(_0xd56c('0x2'));var rs=require(_0xd56c('0x3'));var fs=require('fs');var Redis=require(_0xd56c('0x4'));var db=require(_0xd56c('0x5'))['db'];var utils=require(_0xd56c('0x6'));var logger=require(_0xd56c('0x7'))(_0xd56c('0x8'));var config=require('../../config/environment');var jayson=require(_0xd56c('0x9'));var client=jayson[_0xd56c('0xa')][_0xd56c('0xb')]({'port':0x232a});config[_0xd56c('0xc')]=_[_0xd56c('0xd')](config[_0xd56c('0xc')],{'host':_0xd56c('0xe'),'port':0x18eb});var socket=require(_0xd56c('0xf'))(new Redis(config[_0xd56c('0xc')]));require('./chatMessage.socket')['register'](socket);function respondWithRpcPromise(_0x363b24,_0x8bce44,_0x3e6da4){return new BPromise(function(_0x517cc3,_0x594fd7){return client['request'](_0x363b24,_0x3e6da4)['then'](function(_0x416f59){logger[_0xd56c('0x10')](_0xd56c('0x11'),_0x8bce44,_0xd56c('0x12'));logger[_0xd56c('0x13')](_0xd56c('0x14'),_0x8bce44,_0xd56c('0x12'),JSON[_0xd56c('0x15')](_0x416f59));if(_0x416f59[_0xd56c('0x16')]){if(_0x416f59[_0xd56c('0x16')]['code']===0x1f4){logger['error'](_0xd56c('0x11'),_0x8bce44,_0x416f59[_0xd56c('0x16')]['message']);return _0x594fd7(_0x416f59['error'][_0xd56c('0x17')]);}logger['error']('ChatMessage,\x20%s,\x20%s',_0x8bce44,_0x416f59['error']['message']);return _0x517cc3(_0x416f59[_0xd56c('0x16')][_0xd56c('0x17')]);}else{logger[_0xd56c('0x10')](_0xd56c('0x11'),_0x8bce44,'request\x20sent');_0x517cc3(_0x416f59[_0xd56c('0x18')][_0xd56c('0x17')]);}})[_0xd56c('0x19')](function(_0x3dbe59){logger[_0xd56c('0x16')](_0xd56c('0x11'),_0x8bce44,_0x3dbe59);_0x594fd7(_0x3dbe59);});});}exports[_0xd56c('0x1a')]=function(_0x23cafc){var _0x4ce500=this;return new Promise(function(_0x503c32,_0x1e1c68){return db[_0xd56c('0x1b')][_0xd56c('0x1c')](_0x23cafc[_0xd56c('0x1d')],{'raw':_0x23cafc['options']?_0x23cafc['options'][_0xd56c('0x1e')]===undefined?!![]:![]:!![]})['then'](function(_0x37934d){logger['info'](_0xd56c('0x1a'),_0x23cafc);logger['debug'](_0xd56c('0x1a'),_0x23cafc,JSON[_0xd56c('0x15')](_0x37934d));_0x503c32(_0x37934d);})[_0xd56c('0x19')](function(_0x470f9f){logger[_0xd56c('0x16')](_0xd56c('0x1a'),_0x470f9f['message'],_0x23cafc);_0x1e1c68(_0x4ce500['error'](0x1f4,_0x470f9f['message']));});});};
\ No newline at end of file
diff --git a/server/api/chatMessage/chatMessage.socket.js b/server/api/chatMessage/chatMessage.socket.js
index 7867420..e510f08 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 _0x826a=['update','emit','removeListener','register','length','chatMessage:','save'];(function(_0x84a5b6,_0x280deb){var _0x59014f=function(_0x59f5ca){while(--_0x59f5ca){_0x84a5b6['push'](_0x84a5b6['shift']());}};_0x59014f(++_0x280deb);}(_0x826a,0x1aa));var _0xa826=function(_0x263dbf,_0x4f18ad){_0x263dbf=_0x263dbf-0x0;var _0x1c39a7=_0x826a[_0x263dbf];return _0x1c39a7;};'use strict';var ChatMessageEvents=require('./chatMessage.events');var events=[_0xa826('0x0'),'remove',_0xa826('0x1')];function createListener(_0x50c70e,_0x376d53){return function(_0x19ba11){_0x376d53[_0xa826('0x2')](_0x50c70e,_0x19ba11);};}function removeListener(_0x34e1ad,_0x5372ab){return function(){ChatMessageEvents[_0xa826('0x3')](_0x34e1ad,_0x5372ab);};}exports[_0xa826('0x4')]=function(_0x3929d4){for(var _0x34327b=0x0,_0x45154f=events[_0xa826('0x5')];_0x34327b<_0x45154f;_0x34327b++){var _0x4339f9=events[_0x34327b];var _0x14c2ba=createListener(_0xa826('0x6')+_0x4339f9,_0x3929d4);ChatMessageEvents['on'](_0x4339f9,_0x14c2ba);}};
\ No newline at end of file
+var _0x06f4=['register','chatMessage:','./chatMessage.events','save','update','emit','removeListener'];(function(_0x4e8618,_0x1a4c6d){var _0x50e0ed=function(_0x7c28ec){while(--_0x7c28ec){_0x4e8618['push'](_0x4e8618['shift']());}};_0x50e0ed(++_0x1a4c6d);}(_0x06f4,0x136));var _0x406f=function(_0x2904eb,_0x5906a4){_0x2904eb=_0x2904eb-0x0;var _0x2dbbd7=_0x06f4[_0x2904eb];return _0x2dbbd7;};'use strict';var ChatMessageEvents=require(_0x406f('0x0'));var events=[_0x406f('0x1'),'remove',_0x406f('0x2')];function createListener(_0x276a15,_0x58cd7d){return function(_0x5cab5e){_0x58cd7d[_0x406f('0x3')](_0x276a15,_0x5cab5e);};}function removeListener(_0x5ed32f,_0x32abfd){return function(){ChatMessageEvents[_0x406f('0x4')](_0x5ed32f,_0x32abfd);};}exports[_0x406f('0x5')]=function(_0x32b2bd){for(var _0x59821c=0x0,_0x1d2886=events['length'];_0x59821c<_0x1d2886;_0x59821c++){var _0x1afec4=events[_0x59821c];var _0x1c39ce=createListener(_0x406f('0x6')+_0x1afec4,_0x32b2bd);ChatMessageEvents['on'](_0x1afec4,_0x1c39ce);}};
\ No newline at end of file
diff --git a/server/api/chatMessage/index.js b/server/api/chatMessage/index.js
index 0350ee6..43eb1f0 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 _0x4433=['express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatMessage.controller','isAuthenticated','index','get','/describe','describe','show','post','tracked','chat','chatmessage:create','put','/:id','update','accept','/:id/reject','reject','delete','destroy','exports','util','path','connect-timeout'];(function(_0x27bcf5,_0x236765){var _0x4ce4cf=function(_0x4864ea){while(--_0x4864ea){_0x27bcf5['push'](_0x27bcf5['shift']());}};_0x4ce4cf(++_0x236765);}(_0x4433,0x176));var _0x3443=function(_0x122ef9,_0x451d2a){_0x122ef9=_0x122ef9-0x0;var _0x42fba0=_0x4433[_0x122ef9];return _0x42fba0;};'use strict';var multer=require('multer');var util=require(_0x3443('0x0'));var path=require(_0x3443('0x1'));var timeout=require(_0x3443('0x2'));var express=require(_0x3443('0x3'));var router=express[_0x3443('0x4')]();var fs_extra=require(_0x3443('0x5'));var auth=require(_0x3443('0x6'));var interaction=require(_0x3443('0x7'));var config=require(_0x3443('0x8'));var controller=require(_0x3443('0x9'));router['get']('/',auth[_0x3443('0xa')](),controller[_0x3443('0xb')]);router[_0x3443('0xc')](_0x3443('0xd'),auth[_0x3443('0xa')](),controller[_0x3443('0xe')]);router['get']('/:id',auth[_0x3443('0xa')](),controller[_0x3443('0xf')]);router[_0x3443('0x10')]('/',auth[_0x3443('0xa')](),interaction[_0x3443('0x11')](_0x3443('0x12'),_0x3443('0x13')),controller['create']);router[_0x3443('0x14')](_0x3443('0x15'),controller[_0x3443('0x16')]);router[_0x3443('0x14')]('/:id/accept',auth[_0x3443('0xa')](),controller[_0x3443('0x17')]);router[_0x3443('0x14')](_0x3443('0x18'),auth[_0x3443('0xa')](),controller[_0x3443('0x19')]);router[_0x3443('0x1a')](_0x3443('0x15'),auth['isAuthenticated'](),controller[_0x3443('0x1b')]);module[_0x3443('0x1c')]=router;
\ No newline at end of file
+var _0x8f5f=['update','accept','reject','delete','/:id','destroy','exports','util','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','./chatMessage.controller','get','isAuthenticated','index','/describe','describe','post','tracked','chat','chatmessage:create','put'];(function(_0x489d50,_0x16d213){var _0x10d007=function(_0x143ae3){while(--_0x143ae3){_0x489d50['push'](_0x489d50['shift']());}};_0x10d007(++_0x16d213);}(_0x8f5f,0x133));var _0xf8f5=function(_0x556634,_0x520958){_0x556634=_0x556634-0x0;var _0x4429fd=_0x8f5f[_0x556634];return _0x4429fd;};'use strict';var multer=require('multer');var util=require(_0xf8f5('0x0'));var path=require(_0xf8f5('0x1'));var timeout=require(_0xf8f5('0x2'));var express=require(_0xf8f5('0x3'));var router=express['Router']();var fs_extra=require(_0xf8f5('0x4'));var auth=require(_0xf8f5('0x5'));var interaction=require(_0xf8f5('0x6'));var config=require('../../config/environment');var controller=require(_0xf8f5('0x7'));router[_0xf8f5('0x8')]('/',auth[_0xf8f5('0x9')](),controller[_0xf8f5('0xa')]);router[_0xf8f5('0x8')](_0xf8f5('0xb'),auth['isAuthenticated'](),controller[_0xf8f5('0xc')]);router[_0xf8f5('0x8')]('/:id',auth[_0xf8f5('0x9')](),controller['show']);router[_0xf8f5('0xd')]('/',auth[_0xf8f5('0x9')](),interaction[_0xf8f5('0xe')](_0xf8f5('0xf'),_0xf8f5('0x10')),controller['create']);router[_0xf8f5('0x11')]('/:id',controller[_0xf8f5('0x12')]);router[_0xf8f5('0x11')]('/:id/accept',auth[_0xf8f5('0x9')](),controller[_0xf8f5('0x13')]);router[_0xf8f5('0x11')]('/:id/reject',auth[_0xf8f5('0x9')](),controller[_0xf8f5('0x14')]);router[_0xf8f5('0x15')](_0xf8f5('0x16'),auth['isAuthenticated'](),controller[_0xf8f5('0x17')]);module[_0xf8f5('0x18')]=router;
\ No newline at end of file
diff --git a/server/api/chatOfflineMessage/chatOfflineMessage.attributes.js b/server/api/chatOfflineMessage/chatOfflineMessage.attributes.js
index 2f44a77..4f7d5b0 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 _0x55bc=['exports','TEXT','medium','sequelize'];(function(_0x5515ba,_0x4ad978){var _0x1f7b06=function(_0x1efa7f){while(--_0x1efa7f){_0x5515ba['push'](_0x5515ba['shift']());}};_0x1f7b06(++_0x4ad978);}(_0x55bc,0x18b));var _0xc55b=function(_0x43a65c,_0x34f170){_0x43a65c=_0x43a65c-0x0;var _0x22d44b=_0x55bc[_0x43a65c];return _0x22d44b;};'use strict';var Sequelize=require(_0xc55b('0x0'));module[_0xc55b('0x1')]={'body':{'type':Sequelize[_0xc55b('0x2')](_0xc55b('0x3')),'allowNull':![]}};
\ No newline at end of file
+var _0x896d=['sequelize','medium'];(function(_0x6c993a,_0x5ea3ab){var _0x27f547=function(_0x22df20){while(--_0x22df20){_0x6c993a['push'](_0x6c993a['shift']());}};_0x27f547(++_0x5ea3ab);}(_0x896d,0x1dc));var _0xd896=function(_0x3c056a,_0x34c1ce){_0x3c056a=_0x3c056a-0x0;var _0x1bff8f=_0x896d[_0x3c056a];return _0x1bff8f;};'use strict';var Sequelize=require(_0xd896('0x0'));module['exports']={'body':{'type':Sequelize['TEXT'](_0xd896('0x1')),'allowNull':![]}};
\ No newline at end of file
diff --git a/server/api/chatOfflineMessage/chatOfflineMessage.controller.js b/server/api/chatOfflineMessage/chatOfflineMessage.controller.js
index 01353a7..364cf4b 100644
--- a/server/api/chatOfflineMessage/chatOfflineMessage.controller.js
+++ b/server/api/chatOfflineMessage/chatOfflineMessage.controller.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x7a54=['filter','VIRTUAL','includeAll','include','findAll','rows','show','params','length','merge','options','find','catch','body','Attachment','join','server','attachments','offline-chat','basename','remove','describe','eml-format','rimraf','zip-dir','request-promise','moment','mustache','util','path','sox','to-csv','fs-extra','squel','crypto','desk.js','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','count','limit','set','Content-Range','reject','save','update','then','destroy','error','stack','name','send','index','ChatOfflineMessage','fieldName','type','model','map','query','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','where','pick'];(function(_0x3ce3c,_0x319337){var _0x55a2c9=function(_0x1568d0){while(--_0x1568d0){_0x3ce3c['push'](_0x3ce3c['shift']());}};_0x55a2c9(++_0x319337);}(_0x7a54,0x106));var _0x47a5=function(_0x35f7a7,_0x971f7b){_0x35f7a7=_0x35f7a7-0x0;var _0x452cde=_0x7a54[_0x35f7a7];return _0x452cde;};'use strict';var emlformat=require(_0x47a5('0x0'));var rimraf=require(_0x47a5('0x1'));var zipdir=require(_0x47a5('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x47a5('0x3'));var moment=require(_0x47a5('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x47a5('0x5'));var util=require(_0x47a5('0x6'));var path=require(_0x47a5('0x7'));var sox=require(_0x47a5('0x8'));var csv=require(_0x47a5('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x47a5('0xa'));var _=require('lodash');var squel=require(_0x47a5('0xb'));var crypto=require(_0x47a5('0xc'));var jsforce=require('jsforce');var deskjs=require(_0x47a5('0xd'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x47a5('0xe'));var authService=require(_0x47a5('0xf'));var qs=require('../../components/parsers/qs');var as=require(_0x47a5('0x10'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x47a5('0x11'));var utils=require(_0x47a5('0x12'));var config=require(_0x47a5('0x13'));var licenseUtil=require(_0x47a5('0x14'));var db=require(_0x47a5('0x15'))['db'];function respondWithStatusCode(_0xd308b8,_0x1eae59){_0x1eae59=_0x1eae59||0xcc;return function(_0x5beb89){if(_0x5beb89){return _0xd308b8[_0x47a5('0x16')](_0x1eae59);}return _0xd308b8[_0x47a5('0x17')](_0x1eae59)[_0x47a5('0x18')]();};}function respondWithResult(_0x711793,_0x139f25){_0x139f25=_0x139f25||0xc8;return function(_0x620ee9){if(_0x620ee9){return _0x711793[_0x47a5('0x17')](_0x139f25)[_0x47a5('0x19')](_0x620ee9);}};}function respondWithFilteredResult(_0x4e99a8,_0x362359){return function(_0x11faf5){if(_0x11faf5){var _0x3b001e=typeof _0x362359[_0x47a5('0x1a')]===_0x47a5('0x1b')&&typeof _0x362359['limit']==='undefined';var _0x138bc0=_0x11faf5['count'];var _0x5247fd=_0x3b001e?0x0:_0x362359[_0x47a5('0x1a')];var _0xaf70a6=_0x3b001e?_0x11faf5[_0x47a5('0x1c')]:_0x362359[_0x47a5('0x1a')]+_0x362359[_0x47a5('0x1d')];var _0x12b98e;if(_0xaf70a6>=_0x138bc0){_0xaf70a6=_0x138bc0;_0x12b98e=0xc8;}else{_0x12b98e=0xce;}_0x4e99a8[_0x47a5('0x17')](_0x12b98e);return _0x4e99a8[_0x47a5('0x1e')](_0x47a5('0x1f'),_0x5247fd+'-'+_0xaf70a6+'/'+_0x138bc0)['json'](_0x11faf5);}return null;};}function patchUpdates(_0x1570bc){return function(_0xf160ba){try{jsonpatch['apply'](_0xf160ba,_0x1570bc,!![]);}catch(_0x2b0360){return BPromise[_0x47a5('0x20')](_0x2b0360);}return _0xf160ba[_0x47a5('0x21')]();};}function saveUpdates(_0x4c5910,_0xb8ae6c){return function(_0x2f142b){if(_0x2f142b){return _0x2f142b[_0x47a5('0x22')](_0x4c5910)[_0x47a5('0x23')](function(_0x5ef1b1){return _0x5ef1b1;});}return null;};}function removeEntity(_0xe2dea9,_0x385687){return function(_0x513981){if(_0x513981){return _0x513981[_0x47a5('0x24')]()[_0x47a5('0x23')](function(){_0xe2dea9[_0x47a5('0x17')](0xcc)[_0x47a5('0x18')]();});}};}function handleEntityNotFound(_0x3abd6a,_0x50bf17){return function(_0x53078a){if(!_0x53078a){_0x3abd6a[_0x47a5('0x16')](0x194);}return _0x53078a;};}function handleError(_0x5686db,_0x1ea9c8){_0x1ea9c8=_0x1ea9c8||0x1f4;return function(_0x5b6c4e){logger[_0x47a5('0x25')](_0x5b6c4e[_0x47a5('0x26')]);if(_0x5b6c4e[_0x47a5('0x27')]){delete _0x5b6c4e[_0x47a5('0x27')];}_0x5686db[_0x47a5('0x17')](_0x1ea9c8)[_0x47a5('0x28')](_0x5b6c4e);};}exports[_0x47a5('0x29')]=function(_0x136b14,_0x16631f){var _0x361bfa={},_0x1127f8={},_0x11a4fa={'count':0x0,'rows':[]};var _0x3ad507=_['map'](db[_0x47a5('0x2a')]['rawAttributes'],function(_0x2ef875){return{'name':_0x2ef875[_0x47a5('0x2b')],'type':_0x2ef875[_0x47a5('0x2c')]['key']};});_0x1127f8[_0x47a5('0x2d')]=_[_0x47a5('0x2e')](_0x3ad507,_0x47a5('0x27'));_0x1127f8[_0x47a5('0x2f')]=_['keys'](_0x136b14['query']);_0x1127f8[_0x47a5('0x30')]=_[_0x47a5('0x31')](_0x1127f8['model'],_0x1127f8['query']);_0x361bfa[_0x47a5('0x32')]=_[_0x47a5('0x31')](_0x1127f8['model'],qs[_0x47a5('0x33')](_0x136b14['query'][_0x47a5('0x33')]));_0x361bfa[_0x47a5('0x32')]=_0x361bfa['attributes']['length']?_0x361bfa[_0x47a5('0x32')]:_0x1127f8['model'];if(!_0x136b14[_0x47a5('0x2f')][_0x47a5('0x34')](_0x47a5('0x35'))){_0x361bfa['limit']=qs[_0x47a5('0x1d')](_0x136b14['query']['limit']);_0x361bfa[_0x47a5('0x1a')]=qs['offset'](_0x136b14[_0x47a5('0x2f')]['offset']);}_0x361bfa[_0x47a5('0x36')]=qs[_0x47a5('0x37')](_0x136b14[_0x47a5('0x2f')][_0x47a5('0x37')]);_0x361bfa[_0x47a5('0x38')]=qs[_0x47a5('0x30')](_[_0x47a5('0x39')](_0x136b14[_0x47a5('0x2f')],_0x1127f8[_0x47a5('0x30')]),_0x3ad507);if(_0x136b14['query'][_0x47a5('0x3a')]){_0x361bfa[_0x47a5('0x38')]=_['merge'](_0x361bfa[_0x47a5('0x38')],{'$or':_[_0x47a5('0x2e')](_0x3ad507,function(_0x1d4348){if(_0x1d4348['type']!==_0x47a5('0x3b')){var _0x10f660={};_0x10f660[_0x1d4348['name']]={'$like':'%'+_0x136b14[_0x47a5('0x2f')][_0x47a5('0x3a')]+'%'};return _0x10f660;}})});}_0x361bfa=_['merge']({},_0x361bfa,_0x136b14['options']);var _0x5ebd8c={'where':_0x361bfa[_0x47a5('0x38')]};return db['ChatOfflineMessage'][_0x47a5('0x1c')](_0x5ebd8c)[_0x47a5('0x23')](function(_0x301a85){_0x11a4fa[_0x47a5('0x1c')]=_0x301a85;if(_0x136b14[_0x47a5('0x2f')][_0x47a5('0x3c')]){_0x361bfa[_0x47a5('0x3d')]=[{'all':!![]}];}return db[_0x47a5('0x2a')][_0x47a5('0x3e')](_0x361bfa);})[_0x47a5('0x23')](function(_0x280500){_0x11a4fa[_0x47a5('0x3f')]=_0x280500;return _0x11a4fa;})[_0x47a5('0x23')](respondWithFilteredResult(_0x16631f,_0x361bfa))['catch'](handleError(_0x16631f,null));};exports[_0x47a5('0x40')]=function(_0x1c36fa,_0x331474){var _0x23bd8d={'raw':!![],'where':{'id':_0x1c36fa[_0x47a5('0x41')]['id']}},_0x586f4f={};_0x586f4f['model']=_['keys'](db['ChatOfflineMessage']['rawAttributes']);_0x586f4f[_0x47a5('0x2f')]=_['keys'](_0x1c36fa[_0x47a5('0x2f')]);_0x586f4f[_0x47a5('0x30')]=_[_0x47a5('0x31')](_0x586f4f['model'],_0x586f4f[_0x47a5('0x2f')]);_0x23bd8d[_0x47a5('0x32')]=_['intersection'](_0x586f4f['model'],qs[_0x47a5('0x33')](_0x1c36fa['query'][_0x47a5('0x33')]));_0x23bd8d[_0x47a5('0x32')]=_0x23bd8d[_0x47a5('0x32')][_0x47a5('0x42')]?_0x23bd8d[_0x47a5('0x32')]:_0x586f4f[_0x47a5('0x2d')];if(_0x1c36fa[_0x47a5('0x2f')][_0x47a5('0x3c')]){_0x23bd8d[_0x47a5('0x3d')]=[{'all':!![]}];}_0x23bd8d=_[_0x47a5('0x43')]({},_0x23bd8d,_0x1c36fa[_0x47a5('0x44')]);return db[_0x47a5('0x2a')][_0x47a5('0x45')](_0x23bd8d)[_0x47a5('0x23')](handleEntityNotFound(_0x331474,null))[_0x47a5('0x23')](respondWithResult(_0x331474,null))[_0x47a5('0x46')](handleError(_0x331474,null));};exports['create']=function(_0x2d38de,_0x23bb04){return db['ChatOfflineMessage']['create'](_0x2d38de[_0x47a5('0x47')],{})['then'](respondWithResult(_0x23bb04,0xc9))[_0x47a5('0x46')](handleError(_0x23bb04,null));};exports[_0x47a5('0x22')]=function(_0x54c35f,_0x4f62d3){if(_0x54c35f[_0x47a5('0x47')]['id']){delete _0x54c35f['body']['id'];}return db[_0x47a5('0x2a')][_0x47a5('0x45')]({'where':{'id':_0x54c35f[_0x47a5('0x41')]['id']}})[_0x47a5('0x23')](handleEntityNotFound(_0x4f62d3,null))[_0x47a5('0x23')](saveUpdates(_0x54c35f[_0x47a5('0x47')],null))[_0x47a5('0x23')](respondWithResult(_0x4f62d3,null))['catch'](handleError(_0x4f62d3,null));};exports['destroy']=function(_0x2dd1db,_0x411230){return db[_0x47a5('0x48')][_0x47a5('0x3e')]({'where':{'ChatOfflineMessageId':_0x2dd1db[_0x47a5('0x41')]['id']},'raw':!![]})[_0x47a5('0x23')](function(_0x249de5){_0x249de5['forEach'](function(_0x45cca5){var _0x1c9a62=path[_0x47a5('0x49')](config['root'],_0x47a5('0x4a'),'files',_0x47a5('0x4b'),_0x47a5('0x4c'),_0x45cca5[_0x47a5('0x4d')]);var _0xf03bd5=fs['existsSync'](_0x1c9a62);if(_0xf03bd5)fs_extra[_0x47a5('0x4e')](_0x1c9a62);});})[_0x47a5('0x23')](function(){return db[_0x47a5('0x2a')][_0x47a5('0x45')]({'where':{'id':_0x2dd1db[_0x47a5('0x41')]['id']},'individualHooks':!![]});})[_0x47a5('0x23')](handleEntityNotFound(_0x411230,null))[_0x47a5('0x23')](removeEntity(_0x411230,null))['catch'](handleError(_0x411230,null));};exports[_0x47a5('0x4f')]=function(_0x43721b,_0x187d7e){return db[_0x47a5('0x2a')][_0x47a5('0x4f')]()[_0x47a5('0x23')](respondWithResult(_0x187d7e,null))['catch'](handleError(_0x187d7e,null));};
\ No newline at end of file
+var _0x9957=['sendStatus','status','json','undefined','count','offset','limit','set','Content-Range','reject','save','then','destroy','error','name','send','index','fieldName','type','key','model','map','keys','filters','intersection','query','attributes','fields','length','hasOwnProperty','nolimit','sort','where','filter','merge','VIRTUAL','options','ChatOfflineMessage','findAll','rows','show','rawAttributes','includeAll','include','find','create','catch','body','params','Attachment','forEach','join','root','server','files','attachments','basename','existsSync','remove','describe','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/license/util','../../mysqldb'];(function(_0x4201a8,_0x5685a9){var _0x36899e=function(_0x39ae87){while(--_0x39ae87){_0x4201a8['push'](_0x4201a8['shift']());}};_0x36899e(++_0x5685a9);}(_0x9957,0x93));var _0x7995=function(_0x1ac595,_0x5d2081){_0x1ac595=_0x1ac595-0x0;var _0x455fff=_0x9957[_0x1ac595];return _0x455fff;};'use strict';var emlformat=require(_0x7995('0x0'));var rimraf=require(_0x7995('0x1'));var zipdir=require(_0x7995('0x2'));var jsonpatch=require(_0x7995('0x3'));var rp=require('request-promise');var moment=require(_0x7995('0x4'));var BPromise=require(_0x7995('0x5'));var Mustache=require(_0x7995('0x6'));var util=require(_0x7995('0x7'));var path=require('path');var sox=require(_0x7995('0x8'));var csv=require(_0x7995('0x9'));var ejs=require(_0x7995('0xa'));var fs=require('fs');var fs_extra=require(_0x7995('0xb'));var _=require(_0x7995('0xc'));var squel=require(_0x7995('0xd'));var crypto=require('crypto');var jsforce=require(_0x7995('0xe'));var deskjs=require(_0x7995('0xf'));var toCsv=require('to-csv');var querystring=require(_0x7995('0x10'));var Papa=require(_0x7995('0x11'));var Redis=require(_0x7995('0x12'));var authService=require(_0x7995('0x13'));var qs=require(_0x7995('0x14'));var as=require(_0x7995('0x15'));var hardwareService=require(_0x7995('0x16'));var logger=require('../../config/logger')(_0x7995('0x17'));var utils=require(_0x7995('0x18'));var config=require('../../config/environment');var licenseUtil=require(_0x7995('0x19'));var db=require(_0x7995('0x1a'))['db'];function respondWithStatusCode(_0x19a27e,_0x385f00){_0x385f00=_0x385f00||0xcc;return function(_0x281576){if(_0x281576){return _0x19a27e[_0x7995('0x1b')](_0x385f00);}return _0x19a27e[_0x7995('0x1c')](_0x385f00)['end']();};}function respondWithResult(_0x58f5ad,_0x2b4e94){_0x2b4e94=_0x2b4e94||0xc8;return function(_0x2233dd){if(_0x2233dd){return _0x58f5ad[_0x7995('0x1c')](_0x2b4e94)[_0x7995('0x1d')](_0x2233dd);}};}function respondWithFilteredResult(_0x3f1d3e,_0x1a5310){return function(_0x2202ce){if(_0x2202ce){var _0x41cbf0=typeof _0x1a5310['offset']===_0x7995('0x1e')&&typeof _0x1a5310['limit']===_0x7995('0x1e');var _0x37f297=_0x2202ce[_0x7995('0x1f')];var _0x291317=_0x41cbf0?0x0:_0x1a5310[_0x7995('0x20')];var _0x37a7d4=_0x41cbf0?_0x2202ce['count']:_0x1a5310['offset']+_0x1a5310[_0x7995('0x21')];var _0x5e6f90;if(_0x37a7d4>=_0x37f297){_0x37a7d4=_0x37f297;_0x5e6f90=0xc8;}else{_0x5e6f90=0xce;}_0x3f1d3e['status'](_0x5e6f90);return _0x3f1d3e[_0x7995('0x22')](_0x7995('0x23'),_0x291317+'-'+_0x37a7d4+'/'+_0x37f297)['json'](_0x2202ce);}return null;};}function patchUpdates(_0x3a9b54){return function(_0x51f276){try{jsonpatch['apply'](_0x51f276,_0x3a9b54,!![]);}catch(_0x3e4c54){return BPromise[_0x7995('0x24')](_0x3e4c54);}return _0x51f276[_0x7995('0x25')]();};}function saveUpdates(_0x1a8568,_0x460924){return function(_0x1c278a){if(_0x1c278a){return _0x1c278a['update'](_0x1a8568)[_0x7995('0x26')](function(_0x46ee4b){return _0x46ee4b;});}return null;};}function removeEntity(_0x204507,_0x285437){return function(_0x563799){if(_0x563799){return _0x563799[_0x7995('0x27')]()[_0x7995('0x26')](function(){_0x204507[_0x7995('0x1c')](0xcc)['end']();});}};}function handleEntityNotFound(_0x39df42,_0x34e70c){return function(_0x401dc3){if(!_0x401dc3){_0x39df42[_0x7995('0x1b')](0x194);}return _0x401dc3;};}function handleError(_0x3a3fcf,_0x2a307e){_0x2a307e=_0x2a307e||0x1f4;return function(_0x56691a){logger[_0x7995('0x28')](_0x56691a['stack']);if(_0x56691a[_0x7995('0x29')]){delete _0x56691a[_0x7995('0x29')];}_0x3a3fcf[_0x7995('0x1c')](_0x2a307e)[_0x7995('0x2a')](_0x56691a);};}exports[_0x7995('0x2b')]=function(_0x4b6f99,_0x9b2a15){var _0x514445={},_0x456a28={},_0x3250e0={'count':0x0,'rows':[]};var _0x4253e5=_['map'](db['ChatOfflineMessage']['rawAttributes'],function(_0x3573be){return{'name':_0x3573be[_0x7995('0x2c')],'type':_0x3573be[_0x7995('0x2d')][_0x7995('0x2e')]};});_0x456a28[_0x7995('0x2f')]=_[_0x7995('0x30')](_0x4253e5,'name');_0x456a28['query']=_[_0x7995('0x31')](_0x4b6f99['query']);_0x456a28[_0x7995('0x32')]=_[_0x7995('0x33')](_0x456a28[_0x7995('0x2f')],_0x456a28[_0x7995('0x34')]);_0x514445[_0x7995('0x35')]=_['intersection'](_0x456a28[_0x7995('0x2f')],qs[_0x7995('0x36')](_0x4b6f99['query']['fields']));_0x514445['attributes']=_0x514445[_0x7995('0x35')][_0x7995('0x37')]?_0x514445['attributes']:_0x456a28[_0x7995('0x2f')];if(!_0x4b6f99['query'][_0x7995('0x38')](_0x7995('0x39'))){_0x514445[_0x7995('0x21')]=qs['limit'](_0x4b6f99['query'][_0x7995('0x21')]);_0x514445['offset']=qs['offset'](_0x4b6f99[_0x7995('0x34')][_0x7995('0x20')]);}_0x514445['order']=qs[_0x7995('0x3a')](_0x4b6f99[_0x7995('0x34')][_0x7995('0x3a')]);_0x514445[_0x7995('0x3b')]=qs[_0x7995('0x32')](_['pick'](_0x4b6f99[_0x7995('0x34')],_0x456a28[_0x7995('0x32')]),_0x4253e5);if(_0x4b6f99[_0x7995('0x34')][_0x7995('0x3c')]){_0x514445['where']=_[_0x7995('0x3d')](_0x514445[_0x7995('0x3b')],{'$or':_[_0x7995('0x30')](_0x4253e5,function(_0xe5ea43){if(_0xe5ea43[_0x7995('0x2d')]!==_0x7995('0x3e')){var _0x5688a1={};_0x5688a1[_0xe5ea43[_0x7995('0x29')]]={'$like':'%'+_0x4b6f99[_0x7995('0x34')][_0x7995('0x3c')]+'%'};return _0x5688a1;}})});}_0x514445=_[_0x7995('0x3d')]({},_0x514445,_0x4b6f99[_0x7995('0x3f')]);var _0x298fc2={'where':_0x514445[_0x7995('0x3b')]};return db[_0x7995('0x40')][_0x7995('0x1f')](_0x298fc2)[_0x7995('0x26')](function(_0x6fe77b){_0x3250e0[_0x7995('0x1f')]=_0x6fe77b;if(_0x4b6f99[_0x7995('0x34')]['includeAll']){_0x514445['include']=[{'all':!![]}];}return db[_0x7995('0x40')][_0x7995('0x41')](_0x514445);})['then'](function(_0x4b0855){_0x3250e0[_0x7995('0x42')]=_0x4b0855;return _0x3250e0;})['then'](respondWithFilteredResult(_0x9b2a15,_0x514445))['catch'](handleError(_0x9b2a15,null));};exports[_0x7995('0x43')]=function(_0x36e28b,_0x35c8ff){var _0x576b96={'raw':!![],'where':{'id':_0x36e28b['params']['id']}},_0x46ac4f={};_0x46ac4f[_0x7995('0x2f')]=_['keys'](db['ChatOfflineMessage'][_0x7995('0x44')]);_0x46ac4f[_0x7995('0x34')]=_[_0x7995('0x31')](_0x36e28b[_0x7995('0x34')]);_0x46ac4f['filters']=_[_0x7995('0x33')](_0x46ac4f[_0x7995('0x2f')],_0x46ac4f[_0x7995('0x34')]);_0x576b96[_0x7995('0x35')]=_['intersection'](_0x46ac4f['model'],qs[_0x7995('0x36')](_0x36e28b['query'][_0x7995('0x36')]));_0x576b96['attributes']=_0x576b96[_0x7995('0x35')]['length']?_0x576b96[_0x7995('0x35')]:_0x46ac4f[_0x7995('0x2f')];if(_0x36e28b['query'][_0x7995('0x45')]){_0x576b96[_0x7995('0x46')]=[{'all':!![]}];}_0x576b96=_[_0x7995('0x3d')]({},_0x576b96,_0x36e28b[_0x7995('0x3f')]);return db['ChatOfflineMessage'][_0x7995('0x47')](_0x576b96)[_0x7995('0x26')](handleEntityNotFound(_0x35c8ff,null))[_0x7995('0x26')](respondWithResult(_0x35c8ff,null))['catch'](handleError(_0x35c8ff,null));};exports[_0x7995('0x48')]=function(_0x44f516,_0x511567){return db[_0x7995('0x40')][_0x7995('0x48')](_0x44f516['body'],{})[_0x7995('0x26')](respondWithResult(_0x511567,0xc9))[_0x7995('0x49')](handleError(_0x511567,null));};exports['update']=function(_0x3d1dbb,_0x5843ba){if(_0x3d1dbb[_0x7995('0x4a')]['id']){delete _0x3d1dbb[_0x7995('0x4a')]['id'];}return db[_0x7995('0x40')][_0x7995('0x47')]({'where':{'id':_0x3d1dbb[_0x7995('0x4b')]['id']}})[_0x7995('0x26')](handleEntityNotFound(_0x5843ba,null))[_0x7995('0x26')](saveUpdates(_0x3d1dbb['body'],null))[_0x7995('0x26')](respondWithResult(_0x5843ba,null))[_0x7995('0x49')](handleError(_0x5843ba,null));};exports[_0x7995('0x27')]=function(_0x4ffc8a,_0x19da63){return db[_0x7995('0x4c')][_0x7995('0x41')]({'where':{'ChatOfflineMessageId':_0x4ffc8a['params']['id']},'raw':!![]})['then'](function(_0x5a592e){_0x5a592e[_0x7995('0x4d')](function(_0x1fd1ca){var _0x4cf5db=path[_0x7995('0x4e')](config[_0x7995('0x4f')],_0x7995('0x50'),_0x7995('0x51'),_0x7995('0x52'),'offline-chat',_0x1fd1ca[_0x7995('0x53')]);var _0x4ab09f=fs[_0x7995('0x54')](_0x4cf5db);if(_0x4ab09f)fs_extra[_0x7995('0x55')](_0x4cf5db);});})[_0x7995('0x26')](function(){return db['ChatOfflineMessage']['find']({'where':{'id':_0x4ffc8a['params']['id']},'individualHooks':!![]});})['then'](handleEntityNotFound(_0x19da63,null))[_0x7995('0x26')](removeEntity(_0x19da63,null))[_0x7995('0x49')](handleError(_0x19da63,null));};exports[_0x7995('0x56')]=function(_0x150261,_0x1d957e){return db[_0x7995('0x40')][_0x7995('0x56')]()[_0x7995('0x26')](respondWithResult(_0x1d957e,null))[_0x7995('0x49')](handleError(_0x1d957e,null));};
\ No newline at end of file
diff --git a/server/api/chatOfflineMessage/chatOfflineMessage.model.js b/server/api/chatOfflineMessage/chatOfflineMessage.model.js
index ad3e7ac..43dcf11 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 _0x0456=['utf8mb4','utf8mb4_unicode_ci','lodash','util','../../config/logger','api','moment','bluebird','request-promise','rimraf','../../config/environment','./chatOfflineMessage.attributes','exports','define','chat_offline_messages'];(function(_0x4e0026,_0x2b52b6){var _0x3f8ee7=function(_0x31d891){while(--_0x31d891){_0x4e0026['push'](_0x4e0026['shift']());}};_0x3f8ee7(++_0x2b52b6);}(_0x0456,0x1a6));var _0x6045=function(_0x308981,_0x28a394){_0x308981=_0x308981-0x0;var _0x1370df=_0x0456[_0x308981];return _0x1370df;};'use strict';var _=require(_0x6045('0x0'));var util=require(_0x6045('0x1'));var logger=require(_0x6045('0x2'))(_0x6045('0x3'));var moment=require(_0x6045('0x4'));var BPromise=require(_0x6045('0x5'));var rp=require(_0x6045('0x6'));var fs=require('fs');var path=require('path');var rimraf=require(_0x6045('0x7'));var config=require(_0x6045('0x8'));var attributes=require(_0x6045('0x9'));module[_0x6045('0xa')]=function(_0x323047,_0x5e0bd5){return _0x323047[_0x6045('0xb')]('ChatOfflineMessage',attributes,{'tableName':_0x6045('0xc'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x6045('0xd'),'collate':_0x6045('0xe')});};
\ No newline at end of file
+var _0x0243=['utf8mb4_unicode_ci','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./chatOfflineMessage.attributes','exports','define','ChatOfflineMessage','chat_offline_messages','utf8mb4'];(function(_0x31ba88,_0x4430b7){var _0x412113=function(_0x3a0dc9){while(--_0x3a0dc9){_0x31ba88['push'](_0x31ba88['shift']());}};_0x412113(++_0x4430b7);}(_0x0243,0x191));var _0x3024=function(_0x70a176,_0x3f2e3f){_0x70a176=_0x70a176-0x0;var _0x1ad0b4=_0x0243[_0x70a176];return _0x1ad0b4;};'use strict';var _=require('lodash');var util=require(_0x3024('0x0'));var logger=require(_0x3024('0x1'))(_0x3024('0x2'));var moment=require(_0x3024('0x3'));var BPromise=require(_0x3024('0x4'));var rp=require(_0x3024('0x5'));var fs=require('fs');var path=require(_0x3024('0x6'));var rimraf=require(_0x3024('0x7'));var config=require(_0x3024('0x8'));var attributes=require(_0x3024('0x9'));module[_0x3024('0xa')]=function(_0xd1404e,_0x19f3e8){return _0xd1404e[_0x3024('0xb')](_0x3024('0xc'),attributes,{'tableName':_0x3024('0xd'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x3024('0xe'),'collate':_0x3024('0xf')});};
\ No newline at end of file
diff --git a/server/api/chatOfflineMessage/chatOfflineMessage.rpc.js b/server/api/chatOfflineMessage/chatOfflineMessage.rpc.js
index de6e03e..185c291 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 _0x2aca=['moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','request','then','info','ChatOfflineMessage,\x20%s,\x20%s','request\x20sent','debug','ChatOfflineMessage,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','lodash','util'];(function(_0x4c7194,_0x369feb){var _0x2f7b2c=function(_0x97427a){while(--_0x97427a){_0x4c7194['push'](_0x4c7194['shift']());}};_0x2f7b2c(++_0x369feb);}(_0x2aca,0x166));var _0xa2ac=function(_0x2982f9,_0x3b5402){_0x2982f9=_0x2982f9-0x0;var _0x3be8d0=_0x2aca[_0x2982f9];return _0x3be8d0;};'use strict';var _=require(_0xa2ac('0x0'));var util=require(_0xa2ac('0x1'));var moment=require(_0xa2ac('0x2'));var BPromise=require(_0xa2ac('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xa2ac('0x4'));var db=require(_0xa2ac('0x5'))['db'];var utils=require(_0xa2ac('0x6'));var logger=require(_0xa2ac('0x7'))(_0xa2ac('0x8'));var config=require(_0xa2ac('0x9'));var jayson=require('jayson/promise');var client=jayson[_0xa2ac('0xa')][_0xa2ac('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x125160,_0x1d5d73,_0x1045a5){return new BPromise(function(_0x214ba7,_0x998a97){return client[_0xa2ac('0xc')](_0x125160,_0x1045a5)[_0xa2ac('0xd')](function(_0x314e77){logger[_0xa2ac('0xe')](_0xa2ac('0xf'),_0x1d5d73,_0xa2ac('0x10'));logger[_0xa2ac('0x11')](_0xa2ac('0x12'),_0x1d5d73,'request\x20sent',JSON['stringify'](_0x314e77));if(_0x314e77[_0xa2ac('0x13')]){if(_0x314e77[_0xa2ac('0x13')][_0xa2ac('0x14')]===0x1f4){logger[_0xa2ac('0x13')](_0xa2ac('0xf'),_0x1d5d73,_0x314e77[_0xa2ac('0x13')][_0xa2ac('0x15')]);return _0x998a97(_0x314e77[_0xa2ac('0x13')]['message']);}logger['error'](_0xa2ac('0xf'),_0x1d5d73,_0x314e77['error'][_0xa2ac('0x15')]);return _0x214ba7(_0x314e77[_0xa2ac('0x13')][_0xa2ac('0x15')]);}else{logger[_0xa2ac('0xe')](_0xa2ac('0xf'),_0x1d5d73,'request\x20sent');_0x214ba7(_0x314e77[_0xa2ac('0x16')][_0xa2ac('0x15')]);}})[_0xa2ac('0x17')](function(_0x266167){logger[_0xa2ac('0x13')](_0xa2ac('0xf'),_0x1d5d73,_0x266167);_0x998a97(_0x266167);});});}
\ No newline at end of file
+var _0x33ba=['ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','ChatOfflineMessage,\x20%s,\x20%s','request\x20sent','debug','ChatOfflineMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','lodash','util','bluebird','randomstring'];(function(_0x459bcb,_0x1c02aa){var _0x308a6b=function(_0x3224ab){while(--_0x3224ab){_0x459bcb['push'](_0x459bcb['shift']());}};_0x308a6b(++_0x1c02aa);}(_0x33ba,0x1f0));var _0xa33b=function(_0x320210,_0x11dfb7){_0x320210=_0x320210-0x0;var _0x5be217=_0x33ba[_0x320210];return _0x5be217;};'use strict';var _=require(_0xa33b('0x0'));var util=require(_0xa33b('0x1'));var moment=require('moment');var BPromise=require(_0xa33b('0x2'));var rs=require(_0xa33b('0x3'));var fs=require('fs');var Redis=require(_0xa33b('0x4'));var db=require(_0xa33b('0x5'))['db'];var utils=require(_0xa33b('0x6'));var logger=require(_0xa33b('0x7'))(_0xa33b('0x8'));var config=require(_0xa33b('0x9'));var jayson=require(_0xa33b('0xa'));var client=jayson[_0xa33b('0xb')][_0xa33b('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x371668,_0x1723e9,_0xc09188){return new BPromise(function(_0x387c2c,_0x4b49e2){return client[_0xa33b('0xd')](_0x371668,_0xc09188)[_0xa33b('0xe')](function(_0x333220){logger[_0xa33b('0xf')](_0xa33b('0x10'),_0x1723e9,_0xa33b('0x11'));logger[_0xa33b('0x12')](_0xa33b('0x13'),_0x1723e9,_0xa33b('0x11'),JSON[_0xa33b('0x14')](_0x333220));if(_0x333220[_0xa33b('0x15')]){if(_0x333220[_0xa33b('0x15')][_0xa33b('0x16')]===0x1f4){logger[_0xa33b('0x15')](_0xa33b('0x10'),_0x1723e9,_0x333220[_0xa33b('0x15')][_0xa33b('0x17')]);return _0x4b49e2(_0x333220[_0xa33b('0x15')][_0xa33b('0x17')]);}logger[_0xa33b('0x15')](_0xa33b('0x10'),_0x1723e9,_0x333220[_0xa33b('0x15')]['message']);return _0x387c2c(_0x333220['error'][_0xa33b('0x17')]);}else{logger[_0xa33b('0xf')]('ChatOfflineMessage,\x20%s,\x20%s',_0x1723e9,'request\x20sent');_0x387c2c(_0x333220['result'][_0xa33b('0x17')]);}})[_0xa33b('0x18')](function(_0x53200a){logger['error'](_0xa33b('0x10'),_0x1723e9,_0x53200a);_0x4b49e2(_0x53200a);});});}
\ No newline at end of file
diff --git a/server/api/chatOfflineMessage/index.js b/server/api/chatOfflineMessage/index.js
index 31fb8a1..6476fed 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 _0x293f=['path','express','Router','fs-extra','../../components/auth/service','../../config/environment','get','isAuthenticated','/describe','/:id','show','post','create','put','update','delete','destroy','exports','util'];(function(_0x3c4e4c,_0x36ff70){var _0x144a87=function(_0x5efb4b){while(--_0x5efb4b){_0x3c4e4c['push'](_0x3c4e4c['shift']());}};_0x144a87(++_0x36ff70);}(_0x293f,0x1da));var _0xf293=function(_0x4b2e88,_0xcd5187){_0x4b2e88=_0x4b2e88-0x0;var _0x5a02c6=_0x293f[_0x4b2e88];return _0x5a02c6;};'use strict';var multer=require('multer');var util=require(_0xf293('0x0'));var path=require(_0xf293('0x1'));var timeout=require('connect-timeout');var express=require(_0xf293('0x2'));var router=express[_0xf293('0x3')]();var fs_extra=require(_0xf293('0x4'));var auth=require(_0xf293('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0xf293('0x6'));var controller=require('./chatOfflineMessage.controller');router[_0xf293('0x7')]('/',auth[_0xf293('0x8')](),controller['index']);router[_0xf293('0x7')](_0xf293('0x9'),auth['isAuthenticated'](),controller['describe']);router[_0xf293('0x7')](_0xf293('0xa'),auth[_0xf293('0x8')](),controller[_0xf293('0xb')]);router[_0xf293('0xc')]('/',auth[_0xf293('0x8')](),controller[_0xf293('0xd')]);router[_0xf293('0xe')](_0xf293('0xa'),auth[_0xf293('0x8')](),controller[_0xf293('0xf')]);router[_0xf293('0x10')](_0xf293('0xa'),auth[_0xf293('0x8')](),controller[_0xf293('0x11')]);module[_0xf293('0x12')]=router;
\ No newline at end of file
+var _0x54fe=['show','create','put','update','delete','destroy','exports','multer','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatOfflineMessage.controller','get','index','/describe','isAuthenticated','/:id'];(function(_0x57b236,_0x30614e){var _0x4feb29=function(_0x26d3e6){while(--_0x26d3e6){_0x57b236['push'](_0x57b236['shift']());}};_0x4feb29(++_0x30614e);}(_0x54fe,0x9a));var _0xe54f=function(_0x426d1d,_0x5f364d){_0x426d1d=_0x426d1d-0x0;var _0x18366a=_0x54fe[_0x426d1d];return _0x18366a;};'use strict';var multer=require(_0xe54f('0x0'));var util=require('util');var path=require(_0xe54f('0x1'));var timeout=require(_0xe54f('0x2'));var express=require(_0xe54f('0x3'));var router=express[_0xe54f('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0xe54f('0x5'));var interaction=require(_0xe54f('0x6'));var config=require(_0xe54f('0x7'));var controller=require(_0xe54f('0x8'));router[_0xe54f('0x9')]('/',auth['isAuthenticated'](),controller[_0xe54f('0xa')]);router[_0xe54f('0x9')](_0xe54f('0xb'),auth[_0xe54f('0xc')](),controller['describe']);router[_0xe54f('0x9')](_0xe54f('0xd'),auth['isAuthenticated'](),controller[_0xe54f('0xe')]);router['post']('/',auth[_0xe54f('0xc')](),controller[_0xe54f('0xf')]);router[_0xe54f('0x10')](_0xe54f('0xd'),auth[_0xe54f('0xc')](),controller[_0xe54f('0x11')]);router[_0xe54f('0x12')]('/:id',auth[_0xe54f('0xc')](),controller[_0xe54f('0x13')]);module[_0xe54f('0x14')]=router;
\ No newline at end of file
diff --git a/server/api/chatProactiveAction/chatProactiveAction.attributes.js b/server/api/chatProactiveAction/chatProactiveAction.attributes.js
index 738ce3b..70fc06d 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 _0xd9ba=['exports','STRING','mouseOver','INTEGER'];(function(_0x1bd85d,_0xdc683f){var _0xd40669=function(_0x318648){while(--_0x318648){_0x1bd85d['push'](_0x1bd85d['shift']());}};_0xd40669(++_0xdc683f);}(_0xd9ba,0x15c));var _0xad9b=function(_0x5b2768,_0x4d6c05){_0x5b2768=_0x5b2768-0x0;var _0x11114e=_0xd9ba[_0x5b2768];return _0x11114e;};'use strict';var Sequelize=require('sequelize');module[_0xad9b('0x0')]={'name':{'type':Sequelize[_0xad9b('0x1')],'allowNull':![]},'type':{'type':Sequelize['ENUM']('mouseOver','timeout'),'defaultValue':_0xad9b('0x2')},'selector':{'type':Sequelize[_0xad9b('0x1')]},'timeout':{'type':Sequelize[_0xad9b('0x3')]}};
\ No newline at end of file
+var _0x2014=['sequelize','STRING','ENUM','mouseOver','timeout','INTEGER'];(function(_0x17ef88,_0x581af4){var _0x1dc0fc=function(_0x390176){while(--_0x390176){_0x17ef88['push'](_0x17ef88['shift']());}};_0x1dc0fc(++_0x581af4);}(_0x2014,0x16e));var _0x4201=function(_0x48f399,_0xfff5d1){_0x48f399=_0x48f399-0x0;var _0x176413=_0x2014[_0x48f399];return _0x176413;};'use strict';var Sequelize=require(_0x4201('0x0'));module['exports']={'name':{'type':Sequelize[_0x4201('0x1')],'allowNull':![]},'type':{'type':Sequelize[_0x4201('0x2')](_0x4201('0x3'),_0x4201('0x4')),'defaultValue':_0x4201('0x3')},'selector':{'type':Sequelize[_0x4201('0x1')]},'timeout':{'type':Sequelize[_0x4201('0x5')]}};
\ No newline at end of file
diff --git a/server/api/chatProactiveAction/chatProactiveAction.controller.js b/server/api/chatProactiveAction/chatProactiveAction.controller.js
index f8b98d7..00bc532 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 _0x4f5d=['then','destroy','sendStatus','stack','name','show','params','model','keys','ChatProactiveAction','filters','intersection','query','fields','attributes','length','includeAll','include','merge','options','catch','create','body','find','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','end','json','offset','limit','count','Content-Range','apply','save','update'];(function(_0x5a1371,_0x3c14e6){var _0x46f9a7=function(_0x4867da){while(--_0x4867da){_0x5a1371['push'](_0x5a1371['shift']());}};_0x46f9a7(++_0x3c14e6);}(_0x4f5d,0x1d1));var _0xd4f5=function(_0x4b055c,_0x4b870b){_0x4b055c=_0x4b055c-0x0;var _0x4b62bb=_0x4f5d[_0x4b055c];return _0x4b62bb;};'use strict';var emlformat=require(_0xd4f5('0x0'));var rimraf=require(_0xd4f5('0x1'));var zipdir=require(_0xd4f5('0x2'));var jsonpatch=require(_0xd4f5('0x3'));var rp=require(_0xd4f5('0x4'));var moment=require(_0xd4f5('0x5'));var BPromise=require('bluebird');var Mustache=require(_0xd4f5('0x6'));var util=require(_0xd4f5('0x7'));var path=require(_0xd4f5('0x8'));var sox=require(_0xd4f5('0x9'));var csv=require(_0xd4f5('0xa'));var ejs=require(_0xd4f5('0xb'));var fs=require('fs');var fs_extra=require(_0xd4f5('0xc'));var _=require(_0xd4f5('0xd'));var squel=require(_0xd4f5('0xe'));var crypto=require(_0xd4f5('0xf'));var jsforce=require(_0xd4f5('0x10'));var deskjs=require(_0xd4f5('0x11'));var toCsv=require(_0xd4f5('0xa'));var querystring=require('querystring');var Papa=require(_0xd4f5('0x12'));var Redis=require(_0xd4f5('0x13'));var authService=require('../../components/auth/service');var qs=require(_0xd4f5('0x14'));var as=require(_0xd4f5('0x15'));var hardwareService=require(_0xd4f5('0x16'));var logger=require(_0xd4f5('0x17'))(_0xd4f5('0x18'));var utils=require(_0xd4f5('0x19'));var config=require(_0xd4f5('0x1a'));var licenseUtil=require(_0xd4f5('0x1b'));var db=require(_0xd4f5('0x1c'))['db'];function respondWithStatusCode(_0x5d5554,_0x445072){_0x445072=_0x445072||0xcc;return function(_0x21b2a2){if(_0x21b2a2){return _0x5d5554['sendStatus'](_0x445072);}return _0x5d5554[_0xd4f5('0x1d')](_0x445072)[_0xd4f5('0x1e')]();};}function respondWithResult(_0x28e1cf,_0x511fcf){_0x511fcf=_0x511fcf||0xc8;return function(_0x166d4d){if(_0x166d4d){return _0x28e1cf[_0xd4f5('0x1d')](_0x511fcf)[_0xd4f5('0x1f')](_0x166d4d);}};}function respondWithFilteredResult(_0x1a158f,_0x33f6dc){return function(_0x32f4b7){if(_0x32f4b7){var _0x23780a=typeof _0x33f6dc[_0xd4f5('0x20')]==='undefined'&&typeof _0x33f6dc[_0xd4f5('0x21')]==='undefined';var _0x45d043=_0x32f4b7['count'];var _0x220707=_0x23780a?0x0:_0x33f6dc[_0xd4f5('0x20')];var _0x271f53=_0x23780a?_0x32f4b7[_0xd4f5('0x22')]:_0x33f6dc[_0xd4f5('0x20')]+_0x33f6dc[_0xd4f5('0x21')];var _0x8c7e05;if(_0x271f53>=_0x45d043){_0x271f53=_0x45d043;_0x8c7e05=0xc8;}else{_0x8c7e05=0xce;}_0x1a158f[_0xd4f5('0x1d')](_0x8c7e05);return _0x1a158f['set'](_0xd4f5('0x23'),_0x220707+'-'+_0x271f53+'/'+_0x45d043)[_0xd4f5('0x1f')](_0x32f4b7);}return null;};}function patchUpdates(_0x57a16b){return function(_0x1aae04){try{jsonpatch[_0xd4f5('0x24')](_0x1aae04,_0x57a16b,!![]);}catch(_0x47f101){return BPromise['reject'](_0x47f101);}return _0x1aae04[_0xd4f5('0x25')]();};}function saveUpdates(_0x161443,_0x3cbe7b){return function(_0x3ae7af){if(_0x3ae7af){return _0x3ae7af[_0xd4f5('0x26')](_0x161443)[_0xd4f5('0x27')](function(_0x378af6){return _0x378af6;});}return null;};}function removeEntity(_0x527dd4,_0x578071){return function(_0x5ccc63){if(_0x5ccc63){return _0x5ccc63[_0xd4f5('0x28')]()[_0xd4f5('0x27')](function(){_0x527dd4[_0xd4f5('0x1d')](0xcc)[_0xd4f5('0x1e')]();});}};}function handleEntityNotFound(_0x5f3a5d,_0xb7ea1){return function(_0x49ad32){if(!_0x49ad32){_0x5f3a5d[_0xd4f5('0x29')](0x194);}return _0x49ad32;};}function handleError(_0x2fbee8,_0x5b519e){_0x5b519e=_0x5b519e||0x1f4;return function(_0x5ba979){logger['error'](_0x5ba979[_0xd4f5('0x2a')]);if(_0x5ba979[_0xd4f5('0x2b')]){delete _0x5ba979['name'];}_0x2fbee8[_0xd4f5('0x1d')](_0x5b519e)['send'](_0x5ba979);};}exports[_0xd4f5('0x2c')]=function(_0xb5dd60,_0x2134f2){var _0x2130e4={'raw':!![],'where':{'id':_0xb5dd60[_0xd4f5('0x2d')]['id']}},_0x32d067={};_0x32d067[_0xd4f5('0x2e')]=_[_0xd4f5('0x2f')](db[_0xd4f5('0x30')]['rawAttributes']);_0x32d067['query']=_['keys'](_0xb5dd60['query']);_0x32d067[_0xd4f5('0x31')]=_[_0xd4f5('0x32')](_0x32d067[_0xd4f5('0x2e')],_0x32d067[_0xd4f5('0x33')]);_0x2130e4['attributes']=_[_0xd4f5('0x32')](_0x32d067[_0xd4f5('0x2e')],qs[_0xd4f5('0x34')](_0xb5dd60[_0xd4f5('0x33')][_0xd4f5('0x34')]));_0x2130e4[_0xd4f5('0x35')]=_0x2130e4[_0xd4f5('0x35')][_0xd4f5('0x36')]?_0x2130e4[_0xd4f5('0x35')]:_0x32d067['model'];if(_0xb5dd60['query'][_0xd4f5('0x37')]){_0x2130e4[_0xd4f5('0x38')]=[{'all':!![]}];}_0x2130e4=_[_0xd4f5('0x39')]({},_0x2130e4,_0xb5dd60[_0xd4f5('0x3a')]);return db[_0xd4f5('0x30')]['find'](_0x2130e4)[_0xd4f5('0x27')](handleEntityNotFound(_0x2134f2,null))[_0xd4f5('0x27')](respondWithResult(_0x2134f2,null))[_0xd4f5('0x3b')](handleError(_0x2134f2,null));};exports['create']=function(_0x23b0af,_0x31b9e6){return db[_0xd4f5('0x30')][_0xd4f5('0x3c')](_0x23b0af[_0xd4f5('0x3d')],{})[_0xd4f5('0x27')](respondWithResult(_0x31b9e6,0xc9))['catch'](handleError(_0x31b9e6,null));};exports['update']=function(_0x5555b8,_0x29f348){if(_0x5555b8[_0xd4f5('0x3d')]['id']){delete _0x5555b8['body']['id'];}return db[_0xd4f5('0x30')][_0xd4f5('0x3e')]({'where':{'id':_0x5555b8['params']['id']}})[_0xd4f5('0x27')](handleEntityNotFound(_0x29f348,null))[_0xd4f5('0x27')](saveUpdates(_0x5555b8['body'],null))['then'](respondWithResult(_0x29f348,null))[_0xd4f5('0x3b')](handleError(_0x29f348,null));};exports['destroy']=function(_0x172294,_0x3070bb){return db[_0xd4f5('0x30')][_0xd4f5('0x3e')]({'where':{'id':_0x172294[_0xd4f5('0x2d')]['id']}})[_0xd4f5('0x27')](handleEntityNotFound(_0x3070bb,null))[_0xd4f5('0x27')](removeEntity(_0x3070bb,null))[_0xd4f5('0x3b')](handleError(_0x3070bb,null));};
\ No newline at end of file
+var _0x3cd8=['destroy','error','name','send','show','params','model','ChatProactiveAction','rawAttributes','keys','query','attributes','fields','length','includeAll','merge','options','find','create','body','catch','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','json','offset','undefined','limit','count','Content-Range','reject','save','update','then'];(function(_0x4f3479,_0x146014){var _0x594fe3=function(_0x219022){while(--_0x219022){_0x4f3479['push'](_0x4f3479['shift']());}};_0x594fe3(++_0x146014);}(_0x3cd8,0x150));var _0x83cd=function(_0x21929f,_0xb96182){_0x21929f=_0x21929f-0x0;var _0x1a6077=_0x3cd8[_0x21929f];return _0x1a6077;};'use strict';var emlformat=require(_0x83cd('0x0'));var rimraf=require(_0x83cd('0x1'));var zipdir=require(_0x83cd('0x2'));var jsonpatch=require(_0x83cd('0x3'));var rp=require(_0x83cd('0x4'));var moment=require(_0x83cd('0x5'));var BPromise=require(_0x83cd('0x6'));var Mustache=require(_0x83cd('0x7'));var util=require('util');var path=require(_0x83cd('0x8'));var sox=require(_0x83cd('0x9'));var csv=require(_0x83cd('0xa'));var ejs=require(_0x83cd('0xb'));var fs=require('fs');var fs_extra=require(_0x83cd('0xc'));var _=require(_0x83cd('0xd'));var squel=require(_0x83cd('0xe'));var crypto=require(_0x83cd('0xf'));var jsforce=require(_0x83cd('0x10'));var deskjs=require(_0x83cd('0x11'));var toCsv=require(_0x83cd('0xa'));var querystring=require(_0x83cd('0x12'));var Papa=require(_0x83cd('0x13'));var Redis=require(_0x83cd('0x14'));var authService=require(_0x83cd('0x15'));var qs=require(_0x83cd('0x16'));var as=require(_0x83cd('0x17'));var hardwareService=require(_0x83cd('0x18'));var logger=require(_0x83cd('0x19'))(_0x83cd('0x1a'));var utils=require('../../config/utils');var config=require(_0x83cd('0x1b'));var licenseUtil=require(_0x83cd('0x1c'));var db=require(_0x83cd('0x1d'))['db'];function respondWithStatusCode(_0x44ab88,_0x3e2fd6){_0x3e2fd6=_0x3e2fd6||0xcc;return function(_0x1d4114){if(_0x1d4114){return _0x44ab88[_0x83cd('0x1e')](_0x3e2fd6);}return _0x44ab88[_0x83cd('0x1f')](_0x3e2fd6)['end']();};}function respondWithResult(_0x53e70f,_0x6c51e2){_0x6c51e2=_0x6c51e2||0xc8;return function(_0x2d330d){if(_0x2d330d){return _0x53e70f[_0x83cd('0x1f')](_0x6c51e2)[_0x83cd('0x20')](_0x2d330d);}};}function respondWithFilteredResult(_0x385166,_0x501688){return function(_0x4df635){if(_0x4df635){var _0x268f58=typeof _0x501688[_0x83cd('0x21')]===_0x83cd('0x22')&&typeof _0x501688[_0x83cd('0x23')]===_0x83cd('0x22');var _0x3d6303=_0x4df635[_0x83cd('0x24')];var _0x1e136e=_0x268f58?0x0:_0x501688['offset'];var _0x1df488=_0x268f58?_0x4df635['count']:_0x501688[_0x83cd('0x21')]+_0x501688[_0x83cd('0x23')];var _0x23d9e4;if(_0x1df488>=_0x3d6303){_0x1df488=_0x3d6303;_0x23d9e4=0xc8;}else{_0x23d9e4=0xce;}_0x385166['status'](_0x23d9e4);return _0x385166['set'](_0x83cd('0x25'),_0x1e136e+'-'+_0x1df488+'/'+_0x3d6303)['json'](_0x4df635);}return null;};}function patchUpdates(_0x2748ba){return function(_0x6bb0f4){try{jsonpatch['apply'](_0x6bb0f4,_0x2748ba,!![]);}catch(_0x327f7e){return BPromise[_0x83cd('0x26')](_0x327f7e);}return _0x6bb0f4[_0x83cd('0x27')]();};}function saveUpdates(_0x648d88,_0x7a81d7){return function(_0x3f6c85){if(_0x3f6c85){return _0x3f6c85[_0x83cd('0x28')](_0x648d88)[_0x83cd('0x29')](function(_0x507f7e){return _0x507f7e;});}return null;};}function removeEntity(_0x55821c,_0x10c4ef){return function(_0x56c424){if(_0x56c424){return _0x56c424[_0x83cd('0x2a')]()[_0x83cd('0x29')](function(){_0x55821c[_0x83cd('0x1f')](0xcc)['end']();});}};}function handleEntityNotFound(_0x30c29e,_0x33bb16){return function(_0x3558fa){if(!_0x3558fa){_0x30c29e[_0x83cd('0x1e')](0x194);}return _0x3558fa;};}function handleError(_0x124ce0,_0x1c4fed){_0x1c4fed=_0x1c4fed||0x1f4;return function(_0x14ab2e){logger[_0x83cd('0x2b')](_0x14ab2e['stack']);if(_0x14ab2e[_0x83cd('0x2c')]){delete _0x14ab2e[_0x83cd('0x2c')];}_0x124ce0[_0x83cd('0x1f')](_0x1c4fed)[_0x83cd('0x2d')](_0x14ab2e);};}exports[_0x83cd('0x2e')]=function(_0x9dbb16,_0x317546){var _0x1df0ef={'raw':!![],'where':{'id':_0x9dbb16[_0x83cd('0x2f')]['id']}},_0x3eb69c={};_0x3eb69c[_0x83cd('0x30')]=_['keys'](db[_0x83cd('0x31')][_0x83cd('0x32')]);_0x3eb69c['query']=_[_0x83cd('0x33')](_0x9dbb16[_0x83cd('0x34')]);_0x3eb69c['filters']=_['intersection'](_0x3eb69c['model'],_0x3eb69c[_0x83cd('0x34')]);_0x1df0ef[_0x83cd('0x35')]=_['intersection'](_0x3eb69c[_0x83cd('0x30')],qs[_0x83cd('0x36')](_0x9dbb16[_0x83cd('0x34')][_0x83cd('0x36')]));_0x1df0ef[_0x83cd('0x35')]=_0x1df0ef[_0x83cd('0x35')][_0x83cd('0x37')]?_0x1df0ef[_0x83cd('0x35')]:_0x3eb69c[_0x83cd('0x30')];if(_0x9dbb16[_0x83cd('0x34')][_0x83cd('0x38')]){_0x1df0ef['include']=[{'all':!![]}];}_0x1df0ef=_[_0x83cd('0x39')]({},_0x1df0ef,_0x9dbb16[_0x83cd('0x3a')]);return db[_0x83cd('0x31')][_0x83cd('0x3b')](_0x1df0ef)['then'](handleEntityNotFound(_0x317546,null))['then'](respondWithResult(_0x317546,null))['catch'](handleError(_0x317546,null));};exports[_0x83cd('0x3c')]=function(_0x51930b,_0x5867ad){return db['ChatProactiveAction'][_0x83cd('0x3c')](_0x51930b[_0x83cd('0x3d')],{})[_0x83cd('0x29')](respondWithResult(_0x5867ad,0xc9))[_0x83cd('0x3e')](handleError(_0x5867ad,null));};exports[_0x83cd('0x28')]=function(_0x2c87aa,_0x58a782){if(_0x2c87aa[_0x83cd('0x3d')]['id']){delete _0x2c87aa[_0x83cd('0x3d')]['id'];}return db[_0x83cd('0x31')]['find']({'where':{'id':_0x2c87aa[_0x83cd('0x2f')]['id']}})[_0x83cd('0x29')](handleEntityNotFound(_0x58a782,null))[_0x83cd('0x29')](saveUpdates(_0x2c87aa['body'],null))['then'](respondWithResult(_0x58a782,null))[_0x83cd('0x3e')](handleError(_0x58a782,null));};exports[_0x83cd('0x2a')]=function(_0x4bd47c,_0xac795e){return db[_0x83cd('0x31')][_0x83cd('0x3b')]({'where':{'id':_0x4bd47c[_0x83cd('0x2f')]['id']}})[_0x83cd('0x29')](handleEntityNotFound(_0xac795e,null))['then'](removeEntity(_0xac795e,null))[_0x83cd('0x3e')](handleError(_0xac795e,null));};
\ No newline at end of file
diff --git a/server/api/chatProactiveAction/chatProactiveAction.model.js b/server/api/chatProactiveAction/chatProactiveAction.model.js
index 80e1513..1bc4525 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 _0xdb6a=['ChatProactiveAction','chat_proactive_actions','lodash','util','../../config/logger','moment','bluebird','request-promise','path','rimraf','../../config/environment','./chatProactiveAction.attributes','define'];(function(_0x47041d,_0x42153f){var _0x5022bd=function(_0x1dbb9a){while(--_0x1dbb9a){_0x47041d['push'](_0x47041d['shift']());}};_0x5022bd(++_0x42153f);}(_0xdb6a,0xd2));var _0xadb6=function(_0x4cde90,_0x537324){_0x4cde90=_0x4cde90-0x0;var _0x443fdd=_0xdb6a[_0x4cde90];return _0x443fdd;};'use strict';var _=require(_0xadb6('0x0'));var util=require(_0xadb6('0x1'));var logger=require(_0xadb6('0x2'))('api');var moment=require(_0xadb6('0x3'));var BPromise=require(_0xadb6('0x4'));var rp=require(_0xadb6('0x5'));var fs=require('fs');var path=require(_0xadb6('0x6'));var rimraf=require(_0xadb6('0x7'));var config=require(_0xadb6('0x8'));var attributes=require(_0xadb6('0x9'));module['exports']=function(_0x2d14cb,_0x279511){return _0x2d14cb[_0xadb6('0xa')](_0xadb6('0xb'),attributes,{'tableName':_0xadb6('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xe465=['lodash','util','../../config/logger','api','moment','path','rimraf','./chatProactiveAction.attributes','exports','define','ChatProactiveAction','chat_proactive_actions'];(function(_0x3b0a54,_0xbe0c37){var _0x5fffbf=function(_0x111940){while(--_0x111940){_0x3b0a54['push'](_0x3b0a54['shift']());}};_0x5fffbf(++_0xbe0c37);}(_0xe465,0xc0));var _0x5e46=function(_0xd949b3,_0x2f38d5){_0xd949b3=_0xd949b3-0x0;var _0xdc1707=_0xe465[_0xd949b3];return _0xdc1707;};'use strict';var _=require(_0x5e46('0x0'));var util=require(_0x5e46('0x1'));var logger=require(_0x5e46('0x2'))(_0x5e46('0x3'));var moment=require(_0x5e46('0x4'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x5e46('0x5'));var rimraf=require(_0x5e46('0x6'));var config=require('../../config/environment');var attributes=require(_0x5e46('0x7'));module[_0x5e46('0x8')]=function(_0x5979fb,_0x241e43){return _0x5979fb[_0x5e46('0x9')](_0x5e46('0xa'),attributes,{'tableName':_0x5e46('0xb'),'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 e7cca0b..8a6c679 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 _0x6a5c=['moment','ioredis','../../config/utils','../../config/logger','../../config/environment','jayson/promise','http','request','then','info','request\x20sent','debug','ChatProactiveAction,\x20%s,\x20%s,\x20%s','stringify','error','code','ChatProactiveAction,\x20%s,\x20%s','message','result','lodash','util'];(function(_0x331dc8,_0xb89dcc){var _0x565cbd=function(_0x2cbbcd){while(--_0x2cbbcd){_0x331dc8['push'](_0x331dc8['shift']());}};_0x565cbd(++_0xb89dcc);}(_0x6a5c,0x163));var _0xc6a5=function(_0x4c9d58,_0x1c83f0){_0x4c9d58=_0x4c9d58-0x0;var _0x3ad22d=_0x6a5c[_0x4c9d58];return _0x3ad22d;};'use strict';var _=require(_0xc6a5('0x0'));var util=require(_0xc6a5('0x1'));var moment=require(_0xc6a5('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xc6a5('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0xc6a5('0x4'));var logger=require(_0xc6a5('0x5'))('rpc');var config=require(_0xc6a5('0x6'));var jayson=require(_0xc6a5('0x7'));var client=jayson['client'][_0xc6a5('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x13f8a9,_0x46caeb,_0x457234){return new BPromise(function(_0x2cce98,_0x448640){return client[_0xc6a5('0x9')](_0x13f8a9,_0x457234)[_0xc6a5('0xa')](function(_0x30f095){logger[_0xc6a5('0xb')]('ChatProactiveAction,\x20%s,\x20%s',_0x46caeb,_0xc6a5('0xc'));logger[_0xc6a5('0xd')](_0xc6a5('0xe'),_0x46caeb,_0xc6a5('0xc'),JSON[_0xc6a5('0xf')](_0x30f095));if(_0x30f095['error']){if(_0x30f095[_0xc6a5('0x10')][_0xc6a5('0x11')]===0x1f4){logger[_0xc6a5('0x10')](_0xc6a5('0x12'),_0x46caeb,_0x30f095['error'][_0xc6a5('0x13')]);return _0x448640(_0x30f095[_0xc6a5('0x10')][_0xc6a5('0x13')]);}logger['error']('ChatProactiveAction,\x20%s,\x20%s',_0x46caeb,_0x30f095[_0xc6a5('0x10')][_0xc6a5('0x13')]);return _0x2cce98(_0x30f095['error'][_0xc6a5('0x13')]);}else{logger[_0xc6a5('0xb')](_0xc6a5('0x12'),_0x46caeb,_0xc6a5('0xc'));_0x2cce98(_0x30f095[_0xc6a5('0x14')][_0xc6a5('0x13')]);}})['catch'](function(_0x421d92){logger[_0xc6a5('0x10')]('ChatProactiveAction,\x20%s,\x20%s',_0x46caeb,_0x421d92);_0x448640(_0x421d92);});});}
\ No newline at end of file
+var _0xb7ef=['ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','request','then','ChatProactiveAction,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','catch','lodash','randomstring'];(function(_0x26ef09,_0x595cd9){var _0xba8683=function(_0x4a2f18){while(--_0x4a2f18){_0x26ef09['push'](_0x26ef09['shift']());}};_0xba8683(++_0x595cd9);}(_0xb7ef,0x154));var _0xfb7e=function(_0x3046bf,_0x90194e){_0x3046bf=_0x3046bf-0x0;var _0x246932=_0xb7ef[_0x3046bf];return _0x246932;};'use strict';var _=require(_0xfb7e('0x0'));var util=require('util');var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0xfb7e('0x1'));var fs=require('fs');var Redis=require(_0xfb7e('0x2'));var db=require(_0xfb7e('0x3'))['db'];var utils=require('../../config/utils');var logger=require(_0xfb7e('0x4'))(_0xfb7e('0x5'));var config=require(_0xfb7e('0x6'));var jayson=require(_0xfb7e('0x7'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x4b6339,_0x204ae6,_0x13f96c){return new BPromise(function(_0x1daae8,_0x4cbc51){return client[_0xfb7e('0x8')](_0x4b6339,_0x13f96c)[_0xfb7e('0x9')](function(_0x244662){logger['info'](_0xfb7e('0xa'),_0x204ae6,_0xfb7e('0xb'));logger[_0xfb7e('0xc')]('ChatProactiveAction,\x20%s,\x20%s,\x20%s',_0x204ae6,_0xfb7e('0xb'),JSON[_0xfb7e('0xd')](_0x244662));if(_0x244662[_0xfb7e('0xe')]){if(_0x244662[_0xfb7e('0xe')][_0xfb7e('0xf')]===0x1f4){logger['error'](_0xfb7e('0xa'),_0x204ae6,_0x244662[_0xfb7e('0xe')][_0xfb7e('0x10')]);return _0x4cbc51(_0x244662[_0xfb7e('0xe')][_0xfb7e('0x10')]);}logger[_0xfb7e('0xe')]('ChatProactiveAction,\x20%s,\x20%s',_0x204ae6,_0x244662[_0xfb7e('0xe')][_0xfb7e('0x10')]);return _0x1daae8(_0x244662['error'][_0xfb7e('0x10')]);}else{logger['info']('ChatProactiveAction,\x20%s,\x20%s',_0x204ae6,_0xfb7e('0xb'));_0x1daae8(_0x244662[_0xfb7e('0x11')][_0xfb7e('0x10')]);}})[_0xfb7e('0x12')](function(_0x23a841){logger[_0xfb7e('0xe')](_0xfb7e('0xa'),_0x204ae6,_0x23a841);_0x4cbc51(_0x23a841);});});}
\ No newline at end of file
diff --git a/server/api/chatProactiveAction/index.js b/server/api/chatProactiveAction/index.js
index c1c9318..649f42e 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 _0xa630=['/:id','show','post','isAuthenticated','create','put','update','delete','destroy','exports','multer','util','express','fs-extra','../../components/interaction/service','../../config/environment','./chatProactiveAction.controller','get'];(function(_0x38ae50,_0x2f2c0b){var _0x2267e0=function(_0x47eb0e){while(--_0x47eb0e){_0x38ae50['push'](_0x38ae50['shift']());}};_0x2267e0(++_0x2f2c0b);}(_0xa630,0xbe));var _0x0a63=function(_0x566ed7,_0x1e279f){_0x566ed7=_0x566ed7-0x0;var _0x5333e9=_0xa630[_0x566ed7];return _0x5333e9;};'use strict';var multer=require(_0x0a63('0x0'));var util=require(_0x0a63('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0x0a63('0x2'));var router=express['Router']();var fs_extra=require(_0x0a63('0x3'));var auth=require('../../components/auth/service');var interaction=require(_0x0a63('0x4'));var config=require(_0x0a63('0x5'));var controller=require(_0x0a63('0x6'));router[_0x0a63('0x7')](_0x0a63('0x8'),auth['isAuthenticated'](),controller[_0x0a63('0x9')]);router[_0x0a63('0xa')]('/',auth[_0x0a63('0xb')](),controller[_0x0a63('0xc')]);router[_0x0a63('0xd')](_0x0a63('0x8'),auth['isAuthenticated'](),controller[_0x0a63('0xe')]);router[_0x0a63('0xf')](_0x0a63('0x8'),auth[_0x0a63('0xb')](),controller[_0x0a63('0x10')]);module[_0x0a63('0x11')]=router;
\ No newline at end of file
+var _0x98a8=['express','Router','fs-extra','../../components/interaction/service','../../config/environment','./chatProactiveAction.controller','get','/:id','show','isAuthenticated','put','update','delete','destroy','exports','multer','util','path','connect-timeout'];(function(_0x389832,_0x10a4a9){var _0x59429e=function(_0x5f3562){while(--_0x5f3562){_0x389832['push'](_0x389832['shift']());}};_0x59429e(++_0x10a4a9);}(_0x98a8,0x12c));var _0x898a=function(_0x11d6d8,_0x14de42){_0x11d6d8=_0x11d6d8-0x0;var _0x599188=_0x98a8[_0x11d6d8];return _0x599188;};'use strict';var multer=require(_0x898a('0x0'));var util=require(_0x898a('0x1'));var path=require(_0x898a('0x2'));var timeout=require(_0x898a('0x3'));var express=require(_0x898a('0x4'));var router=express[_0x898a('0x5')]();var fs_extra=require(_0x898a('0x6'));var auth=require('../../components/auth/service');var interaction=require(_0x898a('0x7'));var config=require(_0x898a('0x8'));var controller=require(_0x898a('0x9'));router[_0x898a('0xa')](_0x898a('0xb'),auth['isAuthenticated'](),controller[_0x898a('0xc')]);router['post']('/',auth[_0x898a('0xd')](),controller['create']);router[_0x898a('0xe')](_0x898a('0xb'),auth[_0x898a('0xd')](),controller[_0x898a('0xf')]);router[_0x898a('0x10')](_0x898a('0xb'),auth[_0x898a('0xd')](),controller[_0x898a('0x11')]);module[_0x898a('0x12')]=router;
\ No newline at end of file
diff --git a/server/api/chatQueue/chatQueue.attributes.js b/server/api/chatQueue/chatQueue.attributes.js
index 506e94e..fcb8b64 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 _0x5fac=['STRING','INTEGER','rrmemory','beepall','roundrobin','sequelize','exports'];(function(_0x1906f8,_0x5a695f){var _0x2f7f6d=function(_0x2071b1){while(--_0x2071b1){_0x1906f8['push'](_0x1906f8['shift']());}};_0x2f7f6d(++_0x5a695f);}(_0x5fac,0xec));var _0xc5fa=function(_0x18941b,_0x5c72bd){_0x18941b=_0x18941b-0x0;var _0x1585fc=_0x5fac[_0x18941b];return _0x1585fc;};'use strict';var Sequelize=require(_0xc5fa('0x0'));module[_0xc5fa('0x1')]={'name':{'type':Sequelize[_0xc5fa('0x2')],'unique':'name','allowNull':![],'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize[_0xc5fa('0x2')]},'timeout':{'type':Sequelize[_0xc5fa('0x3')],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize['ENUM'](_0xc5fa('0x4'),_0xc5fa('0x5'),_0xc5fa('0x6'))}};
\ No newline at end of file
+var _0xd1c5=['rrmemory','beepall','roundrobin','exports','STRING','name','INTEGER'];(function(_0x467c05,_0x2cbb49){var _0x192eee=function(_0x258750){while(--_0x258750){_0x467c05['push'](_0x467c05['shift']());}};_0x192eee(++_0x2cbb49);}(_0xd1c5,0x96));var _0x5d1c=function(_0x30d9ac,_0x462f03){_0x30d9ac=_0x30d9ac-0x0;var _0x2f1283=_0xd1c5[_0x30d9ac];return _0x2f1283;};'use strict';var Sequelize=require('sequelize');module[_0x5d1c('0x0')]={'name':{'type':Sequelize[_0x5d1c('0x1')],'unique':_0x5d1c('0x2'),'allowNull':![],'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize['STRING']},'timeout':{'type':Sequelize[_0x5d1c('0x3')],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize['ENUM'](_0x5d1c('0x4'),_0x5d1c('0x5'),_0x5d1c('0x6'))}};
\ No newline at end of file
diff --git a/server/api/chatQueue/chatQueue.controller.js b/server/api/chatQueue/chatQueue.controller.js
index 256e29d..983968f 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 _0x2d87=['TeamId','all','union','compact','value','removeAgents','addAgents','omit','spread','isArray','userChatQueue:remove','getAgents','rimraf','zip-dir','moment','bluebird','mustache','path','to-csv','ejs','fs-extra','squel','crypto','desk.js','querystring','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../mysqldb','redis','localhost','socket.io-emitter','register','jayson/promise','client','http','then','ChatQueue,\x20%s,\x20%s','debug','request\x20sent','stringify','error','code','message','result','sendStatus','end','json','offset','undefined','count','limit','status','set','Content-Range','apply','save','update','destroy','get','UserProfileResource','stack','name','index','ChatQueue','type','key','model','map','query','filters','intersection','fields','attributes','nolimit','order','sort','where','filter','merge','includeAll','include','findAll','rows','catch','params','keys','rawAttributes','length','find','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','user','ChatQueues','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','describe','findOne','UserChatQueue','hasOwnProperty','pick','User','agent','chatPause','updatedAt','createdAt','format','%s/%s','SIP','Team','options','getTeams','addTeams','ids','Agents','online','voicePause','flatMap','transaction','each','findOrCreate','forEach','emit','userChatQueue:save','select','field','team_has_chat_queues','join','ChatQueueId\x20=\x20?','clone','ut.UserId\x20=\x20?','push','sequelize','toString','QueryTypes','SELECT','every'];(function(_0x26fc81,_0x57fc19){var _0x9feece=function(_0x4344c3){while(--_0x4344c3){_0x26fc81['push'](_0x26fc81['shift']());}};_0x9feece(++_0x57fc19);}(_0x2d87,0x1b6));var _0x72d8=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x2d87[_0x14add3];return _0x4a174f;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x72d8('0x0'));var zipdir=require(_0x72d8('0x1'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x72d8('0x2'));var BPromise=require(_0x72d8('0x3'));var Mustache=require(_0x72d8('0x4'));var util=require('util');var path=require(_0x72d8('0x5'));var sox=require('sox');var csv=require(_0x72d8('0x6'));var ejs=require(_0x72d8('0x7'));var fs=require('fs');var fs_extra=require(_0x72d8('0x8'));var _=require('lodash');var squel=require(_0x72d8('0x9'));var crypto=require(_0x72d8('0xa'));var jsforce=require('jsforce');var deskjs=require(_0x72d8('0xb'));var toCsv=require(_0x72d8('0x6'));var querystring=require(_0x72d8('0xc'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x72d8('0xd'));var qs=require('../../components/parsers/qs');var as=require(_0x72d8('0xe'));var hardwareService=require(_0x72d8('0xf'));var logger=require('../../config/logger')(_0x72d8('0x10'));var utils=require(_0x72d8('0x11'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0x72d8('0x12'))['db'];config[_0x72d8('0x13')]=_['defaults'](config[_0x72d8('0x13')],{'host':_0x72d8('0x14'),'port':0x18eb});var socket=require(_0x72d8('0x15'))(new Redis(config[_0x72d8('0x13')]));require('./chatQueue.socket')[_0x72d8('0x16')](socket);var jayson=require(_0x72d8('0x17'));var client=jayson[_0x72d8('0x18')][_0x72d8('0x19')]({'port':0x232a});function respondWithRpcPromise(_0x529fe7,_0x5445b0,_0x37f300,_0x3ef487){return new BPromise(function(_0x1202f2,_0x386c5b){var _0x3954c1=_0x3ef487||client;return _0x3954c1['request'](_0x529fe7,_0x37f300)[_0x72d8('0x1a')](function(_0x2d3ce5){logger['info'](_0x72d8('0x1b'),_0x5445b0,'request\x20sent');logger[_0x72d8('0x1c')]('ChatQueue,\x20%s,\x20%s,\x20%s',_0x5445b0,_0x72d8('0x1d'),JSON[_0x72d8('0x1e')](_0x2d3ce5));if(_0x2d3ce5[_0x72d8('0x1f')]){if(_0x2d3ce5['error'][_0x72d8('0x20')]===0x1f4){logger[_0x72d8('0x1f')](_0x72d8('0x1b'),_0x5445b0,_0x2d3ce5[_0x72d8('0x1f')]['message']);return _0x386c5b(_0x2d3ce5[_0x72d8('0x1f')][_0x72d8('0x21')]);}logger[_0x72d8('0x1f')](_0x72d8('0x1b'),_0x5445b0,_0x2d3ce5[_0x72d8('0x1f')][_0x72d8('0x21')]);return _0x1202f2(_0x2d3ce5[_0x72d8('0x1f')][_0x72d8('0x21')]);}else{logger['info']('ChatQueue,\x20%s,\x20%s',_0x5445b0,_0x72d8('0x1d'));_0x1202f2(_0x2d3ce5[_0x72d8('0x22')]['message']);}})['catch'](function(_0x5ed822){logger[_0x72d8('0x1f')](_0x72d8('0x1b'),_0x5445b0,_0x5ed822);_0x386c5b(_0x5ed822);});});}function respondWithStatusCode(_0x315b25,_0x5cdf94){_0x5cdf94=_0x5cdf94||0xcc;return function(_0x21c773){if(_0x21c773){return _0x315b25[_0x72d8('0x23')](_0x5cdf94);}return _0x315b25['status'](_0x5cdf94)[_0x72d8('0x24')]();};}function respondWithResult(_0x326b7c,_0x4debc0){_0x4debc0=_0x4debc0||0xc8;return function(_0x596f6c){if(_0x596f6c){return _0x326b7c['status'](_0x4debc0)[_0x72d8('0x25')](_0x596f6c);}};}function respondWithFilteredResult(_0x63f54c,_0x3e58bf){return function(_0x3c4e80){if(_0x3c4e80){var _0x3415dd=typeof _0x3e58bf[_0x72d8('0x26')]===_0x72d8('0x27')&&typeof _0x3e58bf['limit']===_0x72d8('0x27');var _0xbcf72f=_0x3c4e80['count'];var _0x1818b9=_0x3415dd?0x0:_0x3e58bf[_0x72d8('0x26')];var _0x2328f4=_0x3415dd?_0x3c4e80[_0x72d8('0x28')]:_0x3e58bf['offset']+_0x3e58bf[_0x72d8('0x29')];var _0xca6358;if(_0x2328f4>=_0xbcf72f){_0x2328f4=_0xbcf72f;_0xca6358=0xc8;}else{_0xca6358=0xce;}_0x63f54c[_0x72d8('0x2a')](_0xca6358);return _0x63f54c[_0x72d8('0x2b')](_0x72d8('0x2c'),_0x1818b9+'-'+_0x2328f4+'/'+_0xbcf72f)['json'](_0x3c4e80);}return null;};}function patchUpdates(_0x3f7745){return function(_0x1de91e){try{jsonpatch[_0x72d8('0x2d')](_0x1de91e,_0x3f7745,!![]);}catch(_0x7f8e02){return BPromise['reject'](_0x7f8e02);}return _0x1de91e[_0x72d8('0x2e')]();};}function saveUpdates(_0x5e018c,_0x69ac29){return function(_0x3bfecc){if(_0x3bfecc){return _0x3bfecc[_0x72d8('0x2f')](_0x5e018c)[_0x72d8('0x1a')](function(_0x121a5c){return _0x121a5c;});}return null;};}function removeEntity(_0x68d79d,_0x1a3e93){return function(_0x495b58){if(_0x495b58){return _0x495b58[_0x72d8('0x30')]()[_0x72d8('0x1a')](function(){var _0x3a04c4=_0x495b58[_0x72d8('0x31')]({'plain':!![]});var _0x56e377='ChatQueues';return db[_0x72d8('0x32')][_0x72d8('0x30')]({'where':{'type':_0x56e377,'resourceId':_0x3a04c4['id']}})[_0x72d8('0x1a')](function(){return _0x495b58;});})[_0x72d8('0x1a')](function(){_0x68d79d[_0x72d8('0x2a')](0xcc)[_0x72d8('0x24')]();});}};}function handleEntityNotFound(_0x405fd6,_0x57819e){return function(_0x319327){if(!_0x319327){_0x405fd6[_0x72d8('0x23')](0x194);}return _0x319327;};}function handleError(_0x22cdf3,_0x21182e){_0x21182e=_0x21182e||0x1f4;return function(_0x3e53c9){logger[_0x72d8('0x1f')](_0x3e53c9[_0x72d8('0x33')]);if(_0x3e53c9[_0x72d8('0x34')]){delete _0x3e53c9[_0x72d8('0x34')];}_0x22cdf3[_0x72d8('0x2a')](_0x21182e)['send'](_0x3e53c9);};}exports[_0x72d8('0x35')]=function(_0x4722c2,_0x5f0ddc){var _0x3f695a={},_0x1f9471={},_0xc3e989={'count':0x0,'rows':[]};var _0x3cdd2f=_['map'](db[_0x72d8('0x36')]['rawAttributes'],function(_0xf39469){return{'name':_0xf39469['fieldName'],'type':_0xf39469[_0x72d8('0x37')][_0x72d8('0x38')]};});_0x1f9471[_0x72d8('0x39')]=_[_0x72d8('0x3a')](_0x3cdd2f,_0x72d8('0x34'));_0x1f9471[_0x72d8('0x3b')]=_['keys'](_0x4722c2[_0x72d8('0x3b')]);_0x1f9471[_0x72d8('0x3c')]=_[_0x72d8('0x3d')](_0x1f9471[_0x72d8('0x39')],_0x1f9471[_0x72d8('0x3b')]);_0x3f695a['attributes']=_[_0x72d8('0x3d')](_0x1f9471[_0x72d8('0x39')],qs[_0x72d8('0x3e')](_0x4722c2[_0x72d8('0x3b')][_0x72d8('0x3e')]));_0x3f695a[_0x72d8('0x3f')]=_0x3f695a['attributes']['length']?_0x3f695a['attributes']:_0x1f9471['model'];if(!_0x4722c2['query']['hasOwnProperty'](_0x72d8('0x40'))){_0x3f695a['limit']=qs['limit'](_0x4722c2['query'][_0x72d8('0x29')]);_0x3f695a[_0x72d8('0x26')]=qs[_0x72d8('0x26')](_0x4722c2['query'][_0x72d8('0x26')]);}_0x3f695a[_0x72d8('0x41')]=qs[_0x72d8('0x42')](_0x4722c2['query'][_0x72d8('0x42')]);_0x3f695a[_0x72d8('0x43')]=qs[_0x72d8('0x3c')](_['pick'](_0x4722c2[_0x72d8('0x3b')],_0x1f9471[_0x72d8('0x3c')]),_0x3cdd2f);if(_0x4722c2[_0x72d8('0x3b')][_0x72d8('0x44')]){_0x3f695a[_0x72d8('0x43')]=_[_0x72d8('0x45')](_0x3f695a[_0x72d8('0x43')],{'$or':_['map'](_0x3cdd2f,function(_0xc45de2){if(_0xc45de2['type']!=='VIRTUAL'){var _0xd05cf3={};_0xd05cf3[_0xc45de2[_0x72d8('0x34')]]={'$like':'%'+_0x4722c2[_0x72d8('0x3b')][_0x72d8('0x44')]+'%'};return _0xd05cf3;}})});}_0x3f695a=_['merge']({},_0x3f695a,_0x4722c2['options']);var _0x4c52b3={'where':_0x3f695a[_0x72d8('0x43')]};return db['ChatQueue'][_0x72d8('0x28')](_0x4c52b3)[_0x72d8('0x1a')](function(_0x46bb65){_0xc3e989[_0x72d8('0x28')]=_0x46bb65;if(_0x4722c2['query'][_0x72d8('0x46')]){_0x3f695a[_0x72d8('0x47')]=[{'all':!![]}];}return db['ChatQueue'][_0x72d8('0x48')](_0x3f695a);})[_0x72d8('0x1a')](function(_0x2cf3eb){_0xc3e989[_0x72d8('0x49')]=_0x2cf3eb;return _0xc3e989;})[_0x72d8('0x1a')](respondWithFilteredResult(_0x5f0ddc,_0x3f695a))[_0x72d8('0x4a')](handleError(_0x5f0ddc,null));};exports['show']=function(_0x5302ce,_0x34231c){var _0x23eb39={'raw':!![],'where':{'id':_0x5302ce[_0x72d8('0x4b')]['id']}},_0x2fc00d={};_0x2fc00d[_0x72d8('0x39')]=_[_0x72d8('0x4c')](db[_0x72d8('0x36')][_0x72d8('0x4d')]);_0x2fc00d['query']=_[_0x72d8('0x4c')](_0x5302ce[_0x72d8('0x3b')]);_0x2fc00d['filters']=_[_0x72d8('0x3d')](_0x2fc00d[_0x72d8('0x39')],_0x2fc00d[_0x72d8('0x3b')]);_0x23eb39['attributes']=_[_0x72d8('0x3d')](_0x2fc00d[_0x72d8('0x39')],qs[_0x72d8('0x3e')](_0x5302ce[_0x72d8('0x3b')][_0x72d8('0x3e')]));_0x23eb39[_0x72d8('0x3f')]=_0x23eb39[_0x72d8('0x3f')][_0x72d8('0x4e')]?_0x23eb39[_0x72d8('0x3f')]:_0x2fc00d[_0x72d8('0x39')];if(_0x5302ce[_0x72d8('0x3b')][_0x72d8('0x46')]){_0x23eb39[_0x72d8('0x47')]=[{'all':!![]}];}_0x23eb39=_[_0x72d8('0x45')]({},_0x23eb39,_0x5302ce['options']);return db[_0x72d8('0x36')][_0x72d8('0x4f')](_0x23eb39)[_0x72d8('0x1a')](handleEntityNotFound(_0x34231c,null))['then'](respondWithResult(_0x34231c,null))[_0x72d8('0x4a')](handleError(_0x34231c,null));};exports[_0x72d8('0x50')]=function(_0x4b3d76,_0x1149bc){return db[_0x72d8('0x36')]['create'](_0x4b3d76[_0x72d8('0x51')],{})[_0x72d8('0x1a')](function(_0x5d86cf){var _0x53b2a9=_0x4b3d76['user']['get']({'plain':!![]});if(!_0x53b2a9)throw new Error(_0x72d8('0x52'));if(_0x53b2a9['role']===_0x72d8('0x53')){var _0x40b14c=_0x5d86cf[_0x72d8('0x31')]({'plain':!![]});var _0x303587=_0x72d8('0x54');return db[_0x72d8('0x55')]['find']({'where':{'name':_0x303587,'userProfileId':_0x53b2a9[_0x72d8('0x56')]},'raw':!![]})[_0x72d8('0x1a')](function(_0x53bbe9){if(_0x53bbe9&&_0x53bbe9[_0x72d8('0x57')]===0x0){return db['UserProfileResource']['create']({'name':_0x40b14c[_0x72d8('0x34')],'resourceId':_0x40b14c['id'],'type':_0x53bbe9[_0x72d8('0x34')],'sectionId':_0x53bbe9['id']},{})[_0x72d8('0x1a')](function(){return _0x5d86cf;});}else{return _0x5d86cf;}})[_0x72d8('0x4a')](function(_0x37ce8a){logger[_0x72d8('0x1f')](_0x72d8('0x58'),_0x37ce8a);throw _0x37ce8a;});}return _0x5d86cf;})[_0x72d8('0x1a')](respondWithResult(_0x1149bc,0xc9))[_0x72d8('0x4a')](handleError(_0x1149bc,null));};exports[_0x72d8('0x2f')]=function(_0xfab644,_0x4e3798){if(_0xfab644[_0x72d8('0x51')]['id']){delete _0xfab644[_0x72d8('0x51')]['id'];}return db[_0x72d8('0x36')][_0x72d8('0x4f')]({'where':{'id':_0xfab644['params']['id']}})[_0x72d8('0x1a')](handleEntityNotFound(_0x4e3798,null))[_0x72d8('0x1a')](saveUpdates(_0xfab644[_0x72d8('0x51')],null))[_0x72d8('0x1a')](respondWithResult(_0x4e3798,null))[_0x72d8('0x4a')](handleError(_0x4e3798,null));};exports['destroy']=function(_0x38211d,_0x2402c9){return db[_0x72d8('0x36')][_0x72d8('0x4f')]({'where':{'id':_0x38211d[_0x72d8('0x4b')]['id']}})[_0x72d8('0x1a')](handleEntityNotFound(_0x2402c9,null))[_0x72d8('0x1a')](removeEntity(_0x2402c9,null))[_0x72d8('0x4a')](handleError(_0x2402c9,null));};exports[_0x72d8('0x59')]=function(_0xe8dd8,_0x3f9b51){return db[_0x72d8('0x36')][_0x72d8('0x59')]()['then'](respondWithResult(_0x3f9b51,null))[_0x72d8('0x4a')](handleError(_0x3f9b51,null));};exports['getMembers']=function(_0x44ae74,_0x4c3b0f,_0x5047b1){var _0x370a3d={'raw':!![],'where':{}},_0x5db58e={},_0x45b3aa;return db[_0x72d8('0x36')][_0x72d8('0x5a')]({'where':{'id':_0x44ae74['params']['id']}})[_0x72d8('0x1a')](handleEntityNotFound(_0x4c3b0f,null))[_0x72d8('0x1a')](function(_0x2a2bb7){if(_0x2a2bb7){_0x45b3aa=_0x2a2bb7['get']({'plain':!![]});_0x5db58e[_0x72d8('0x39')]=_[_0x72d8('0x4c')](db[_0x72d8('0x5b')][_0x72d8('0x4d')]);_0x5db58e[_0x72d8('0x3b')]=_[_0x72d8('0x4c')](_0x44ae74['query']);_0x5db58e[_0x72d8('0x3c')]=_['intersection'](_0x5db58e[_0x72d8('0x39')],_0x5db58e['query']);_0x370a3d[_0x72d8('0x3f')]=_[_0x72d8('0x3d')](_0x5db58e[_0x72d8('0x39')],qs[_0x72d8('0x3e')](_0x44ae74['query'][_0x72d8('0x3e')]));_0x370a3d[_0x72d8('0x3f')]=_0x370a3d['attributes'][_0x72d8('0x4e')]?_0x370a3d['attributes']:_0x5db58e['model'];if(!_0x44ae74[_0x72d8('0x3b')][_0x72d8('0x5c')](_0x72d8('0x40'))){_0x370a3d['limit']=qs[_0x72d8('0x29')](_0x44ae74[_0x72d8('0x3b')][_0x72d8('0x29')]);_0x370a3d[_0x72d8('0x26')]=qs[_0x72d8('0x26')](_0x44ae74[_0x72d8('0x3b')][_0x72d8('0x26')]);}_0x370a3d[_0x72d8('0x41')]=qs[_0x72d8('0x42')](_0x44ae74[_0x72d8('0x3b')][_0x72d8('0x42')]);_0x370a3d[_0x72d8('0x43')]=qs[_0x72d8('0x3c')](_[_0x72d8('0x5d')](_0x44ae74['query'],_0x5db58e[_0x72d8('0x3c')]));_0x370a3d[_0x72d8('0x43')]['ChatQueueId']=_0x2a2bb7['id'];if(_0x44ae74[_0x72d8('0x3b')][_0x72d8('0x44')]){_0x370a3d[_0x72d8('0x43')]=_['merge'](_0x370a3d[_0x72d8('0x43')],{'$or':_[_0x72d8('0x3a')](_0x370a3d['attributes'],function(_0x479133){var _0x54da9d={};_0x54da9d[_0x479133]={'$like':'%'+_0x44ae74[_0x72d8('0x3b')][_0x72d8('0x44')]+'%'};return _0x54da9d;})});}_0x370a3d=_['merge']({},_0x370a3d,_0x44ae74['options']);return db[_0x72d8('0x5b')]['findAll'](_0x370a3d);}})[_0x72d8('0x1a')](function(_0x3cd9e0){if(_0x3cd9e0){return db[_0x72d8('0x5e')]['findAndCountAll']({'where':{'id':_[_0x72d8('0x3a')](_0x3cd9e0,'UserId'),'role':_0x72d8('0x5f')},'attributes':['id',_0x72d8('0x34'),_0x72d8('0x60'),_0x72d8('0x61'),_0x72d8('0x62')]});}})['then'](function(_0x2e3b4e){if(_0x2e3b4e){return{'count':_0x2e3b4e[_0x72d8('0x28')],'rows':_[_0x72d8('0x3a')](_0x2e3b4e['rows'],function(_0x4d6468){return{'membername':_0x4d6468['name'],'UserId':_0x4d6468['id'],'queue_name':_0x45b3aa[_0x72d8('0x34')],'ChatQueueId':_0x45b3aa['id'],'interface':util[_0x72d8('0x63')](_0x72d8('0x64'),_0x72d8('0x65'),_0x4d6468['name']),'penalty':0x0,'paused':_0x4d6468['chatPause'],'createdAt':_0x4d6468[_0x72d8('0x62')],'updatedAt':_0x4d6468[_0x72d8('0x61')]};})};}else{return{'count':0x0,'rows':[]};}})[_0x72d8('0x1a')](respondWithFilteredResult(_0x4c3b0f,_0x370a3d))[_0x72d8('0x4a')](handleError(_0x4c3b0f,null));};exports['getTeams']=function(_0x4a3a93,_0x3091a9,_0x97eaa){var _0x1c4b51={};var _0x4a455f={};var _0x319497;var _0x507ad6;return db[_0x72d8('0x36')]['findOne']({'where':{'id':_0x4a3a93[_0x72d8('0x4b')]['id']}})[_0x72d8('0x1a')](handleEntityNotFound(_0x3091a9,null))[_0x72d8('0x1a')](function(_0x465faa){if(_0x465faa){_0x319497=_0x465faa;_0x4a455f[_0x72d8('0x39')]=_['keys'](db[_0x72d8('0x66')][_0x72d8('0x4d')]);_0x4a455f[_0x72d8('0x3b')]=_['keys'](_0x4a3a93['query']);_0x4a455f[_0x72d8('0x3c')]=_[_0x72d8('0x3d')](_0x4a455f[_0x72d8('0x39')],_0x4a455f[_0x72d8('0x3b')]);_0x1c4b51['attributes']=_[_0x72d8('0x3d')](_0x4a455f[_0x72d8('0x39')],qs[_0x72d8('0x3e')](_0x4a3a93[_0x72d8('0x3b')][_0x72d8('0x3e')]));_0x1c4b51['attributes']=_0x1c4b51['attributes'][_0x72d8('0x4e')]?_0x1c4b51[_0x72d8('0x3f')]:_0x4a455f[_0x72d8('0x39')];_0x1c4b51[_0x72d8('0x41')]=qs[_0x72d8('0x42')](_0x4a3a93[_0x72d8('0x3b')][_0x72d8('0x42')]);_0x1c4b51['where']=qs['filters'](_[_0x72d8('0x5d')](_0x4a3a93[_0x72d8('0x3b')],_0x4a455f[_0x72d8('0x3c')]));if(_0x4a3a93['query'][_0x72d8('0x44')]){_0x1c4b51[_0x72d8('0x43')]=_[_0x72d8('0x45')](_0x1c4b51['where'],{'$or':_[_0x72d8('0x3a')](_0x1c4b51['attributes'],function(_0x181f67){var _0x21da6b={};_0x21da6b[_0x181f67]={'$like':'%'+_0x4a3a93['query'][_0x72d8('0x44')]+'%'};return _0x21da6b;})});}_0x1c4b51=_[_0x72d8('0x45')]({},_0x1c4b51,_0x4a3a93[_0x72d8('0x67')]);return _0x319497['getTeams'](_0x1c4b51);}})['then'](function(_0xbc468e){if(_0xbc468e){_0x507ad6=_0xbc468e[_0x72d8('0x4e')];if(!_0x4a3a93[_0x72d8('0x3b')][_0x72d8('0x5c')](_0x72d8('0x40'))){_0x1c4b51[_0x72d8('0x29')]=qs['limit'](_0x4a3a93[_0x72d8('0x3b')][_0x72d8('0x29')]);_0x1c4b51[_0x72d8('0x26')]=qs['offset'](_0x4a3a93['query'][_0x72d8('0x26')]);}return _0x319497[_0x72d8('0x68')](_0x1c4b51);}})[_0x72d8('0x1a')](function(_0x469856){if(_0x469856){return _0x469856?{'count':_0x507ad6,'rows':_0x469856}:null;}})[_0x72d8('0x1a')](respondWithResult(_0x3091a9,null))[_0x72d8('0x4a')](handleError(_0x3091a9,null));};exports[_0x72d8('0x69')]=function(_0x2eed4c,_0x525ca3,_0xfc9920){var _0x466b26=_0x2eed4c['body'][_0x72d8('0x6a')];return db[_0x72d8('0x66')][_0x72d8('0x48')]({'where':{'id':_0x466b26},'attributes':['id'],'include':[{'model':db[_0x72d8('0x5e')],'as':_0x72d8('0x6b'),'attributes':['id',_0x72d8('0x34'),_0x72d8('0x6c'),_0x72d8('0x6d'),'interface'],'raw':!![]}]})[_0x72d8('0x1a')](function(_0x2e5801){if(_0x2e5801){var _0x1e6664=_[_0x72d8('0x6e')](_0x2e5801,function(_0x434191){var _0xf7a0d0=_0x434191[_0x72d8('0x31')]({'plain':!![]});return _0xf7a0d0['Agents'];});return db[_0x72d8('0x36')]['find']({'where':{'id':_0x2eed4c[_0x72d8('0x4b')]['id']}})[_0x72d8('0x1a')](function(_0x3efc29){return db['sequelize'][_0x72d8('0x6f')](function(_0x59eefb){return _0x3efc29[_0x72d8('0x69')](_0x466b26,{'transaction':_0x59eefb})[_0x72d8('0x1a')](function(){return BPromise[_0x72d8('0x70')](_0x1e6664,function(_0x596b87){return db['UserChatQueue'][_0x72d8('0x71')]({'where':{'UserId':_0x596b87['id'],'ChatQueueId':_0x2eed4c['params']['id']},'transaction':_0x59eefb});});})[_0x72d8('0x1a')](function(){_0x1e6664[_0x72d8('0x72')](function(_0x24dde7){socket[_0x72d8('0x73')](_0x72d8('0x74'),{'UserId':_0x24dde7['id'],'ChatQueueId':_0x3efc29['id']});});});});});}})['then'](respondWithStatusCode(_0x525ca3,null))[_0x72d8('0x4a')](handleError(_0x525ca3,null));};exports['removeTeams']=function(_0x889dfc,_0xdc10cd,_0x3b5d08){return db['Team'][_0x72d8('0x48')]({'where':{'id':_0x889dfc[_0x72d8('0x3b')][_0x72d8('0x6a')]},'attributes':['id'],'include':[{'model':db[_0x72d8('0x5e')],'as':_0x72d8('0x6b'),'attributes':['id'],'raw':!![]}]})['then'](handleEntityNotFound(_0xdc10cd,null))[_0x72d8('0x1a')](function(_0x14739d){var _0x3caf60=_[_0x72d8('0x3a')](_0x14739d,'id');var _0x571075=[];var _0x4c0cb8=[];var _0x2e9fd9=squel[_0x72d8('0x75')]();_0x2e9fd9[_0x72d8('0x76')]('tq.TeamId')['from'](_0x72d8('0x77'),'tq')[_0x72d8('0x78')]('user_has_teams','ut','ut.TeamId\x20=\x20tq.TeamId')[_0x72d8('0x43')](_0x72d8('0x79'),_0x889dfc[_0x72d8('0x4b')]['id']);for(var _0x89a813=0x0;_0x89a813<_0x14739d[_0x72d8('0x4e')];_0x89a813+=0x1){let _0x58b7a4=_0x14739d[_0x89a813];for(var _0x53eb79=0x0;_0x53eb79<_0x58b7a4[_0x72d8('0x6b')][_0x72d8('0x4e')];_0x53eb79+=0x1){let _0x4593fb=_0x58b7a4['Agents'][_0x53eb79];var _0x5d4912=_0x2e9fd9[_0x72d8('0x7a')]();_0x5d4912[_0x72d8('0x43')](_0x72d8('0x7b'),_0x4593fb['id']);_0x4c0cb8[_0x72d8('0x7c')](db[_0x72d8('0x7d')][_0x72d8('0x3b')](_0x5d4912[_0x72d8('0x7e')](),{'type':db[_0x72d8('0x7d')][_0x72d8('0x7f')][_0x72d8('0x80')]})['then'](function(_0x48bddd){if(_0x48bddd['length']===0x1){return _0x4593fb['id'];}else{var _0x59b9b8=_[_0x72d8('0x81')](_['map'](_0x48bddd,_0x72d8('0x82')),function(_0x5a3c37){return _['includes'](_0x3caf60,_0x5a3c37);});if(_0x59b9b8){return _0x4593fb['id'];}}}));}}return BPromise[_0x72d8('0x83')](_0x4c0cb8)['then'](function(_0x399eed){_0x571075=_(_0x571075)[_0x72d8('0x84')](_0x399eed)[_0x72d8('0x85')]()[_0x72d8('0x86')]();return db[_0x72d8('0x36')]['find']({'where':{'id':_0x889dfc[_0x72d8('0x4b')]['id']}})[_0x72d8('0x1a')](function(_0x34c5bf){return db[_0x72d8('0x7d')][_0x72d8('0x6f')](function(_0x43b7dc){return _0x34c5bf['removeTeams'](_0x889dfc['query'][_0x72d8('0x6a')],{'transaction':_0x43b7dc})[_0x72d8('0x1a')](function(){if(!_['isEmpty'](_0x571075)){return _0x34c5bf[_0x72d8('0x87')](_0x571075,{'transaction':_0x43b7dc});}})['then'](function(){_0x571075[_0x72d8('0x72')](function(_0xce5739){socket['emit']('userChatQueue:remove',{'UserId':_0xce5739,'ChatQueueId':_0x34c5bf['id']});});});});});});})[_0x72d8('0x1a')](respondWithStatusCode(_0xdc10cd,null))['catch'](handleError(_0xdc10cd,null));};exports[_0x72d8('0x88')]=function(_0x1927fc,_0x2af689,_0x3fb8a3){return db[_0x72d8('0x36')]['find']({'where':{'id':_0x1927fc[_0x72d8('0x4b')]['id']}})[_0x72d8('0x1a')](handleEntityNotFound(_0x2af689,null))[_0x72d8('0x1a')](function(_0x2a62a7){if(_0x2a62a7){return _0x2a62a7[_0x72d8('0x88')](_0x1927fc[_0x72d8('0x51')]['ids'],_[_0x72d8('0x89')](_0x1927fc[_0x72d8('0x51')],['ids','id'])||{})[_0x72d8('0x8a')](function(_0x2f2458){for(var _0x4e270b=0x0;_0x4e270b<_0x1927fc[_0x72d8('0x51')]['ids']['length'];_0x4e270b+=0x1){socket[_0x72d8('0x73')](_0x72d8('0x74'),{'UserId':Number(_0x1927fc[_0x72d8('0x51')][_0x72d8('0x6a')][_0x4e270b]),'ChatQueueId':Number(_0x1927fc[_0x72d8('0x4b')]['id'])});}return _0x2f2458;});}})[_0x72d8('0x1a')](respondWithResult(_0x2af689,null))['catch'](handleError(_0x2af689,null));};exports['removeAgents']=function(_0x3e6ed0,_0x2a25a5,_0x2d29cc){return db[_0x72d8('0x36')][_0x72d8('0x4f')]({'where':{'id':_0x3e6ed0['params']['id']}})['then'](handleEntityNotFound(_0x2a25a5,null))[_0x72d8('0x1a')](function(_0x45263f){if(_0x45263f){return _0x45263f[_0x72d8('0x87')](_0x3e6ed0[_0x72d8('0x3b')][_0x72d8('0x6a')])['then'](function(){if(_[_0x72d8('0x8b')](_0x3e6ed0[_0x72d8('0x3b')][_0x72d8('0x6a')])){for(var _0xf084c8=0x0;_0xf084c8<_0x3e6ed0[_0x72d8('0x3b')][_0x72d8('0x6a')][_0x72d8('0x4e')];_0xf084c8+=0x1){socket[_0x72d8('0x73')](_0x72d8('0x8c'),{'UserId':Number(_0x3e6ed0[_0x72d8('0x3b')]['ids'][_0xf084c8]),'ChatQueueId':Number(_0x3e6ed0['params']['id'])});}}else{socket['emit'](_0x72d8('0x8c'),{'UserId':Number(_0x3e6ed0[_0x72d8('0x3b')]['ids']),'ChatQueueId':Number(_0x3e6ed0[_0x72d8('0x4b')]['id'])});}});}})[_0x72d8('0x1a')](respondWithStatusCode(_0x2a25a5,null))[_0x72d8('0x4a')](handleError(_0x2a25a5,null));};exports[_0x72d8('0x8d')]=function(_0x2d03ac,_0x238d25,_0x46da04){var _0x499637={};var _0x134f20={};var _0x4c182b;var _0xec1abb;return db[_0x72d8('0x36')][_0x72d8('0x5a')]({'where':{'id':_0x2d03ac['params']['id']}})[_0x72d8('0x1a')](handleEntityNotFound(_0x238d25,null))['then'](function(_0x46b47c){if(_0x46b47c){_0x4c182b=_0x46b47c;_0x134f20[_0x72d8('0x39')]=_[_0x72d8('0x4c')](db[_0x72d8('0x5e')][_0x72d8('0x4d')]);_0x134f20[_0x72d8('0x3b')]=_[_0x72d8('0x4c')](_0x2d03ac['query']);_0x134f20['filters']=_[_0x72d8('0x3d')](_0x134f20[_0x72d8('0x39')],_0x134f20[_0x72d8('0x3b')]);_0x499637[_0x72d8('0x3f')]=_['intersection'](_0x134f20[_0x72d8('0x39')],qs[_0x72d8('0x3e')](_0x2d03ac['query'][_0x72d8('0x3e')]));_0x499637[_0x72d8('0x3f')]=_0x499637[_0x72d8('0x3f')][_0x72d8('0x4e')]?_0x499637[_0x72d8('0x3f')]:_0x134f20[_0x72d8('0x39')];_0x499637[_0x72d8('0x41')]=qs[_0x72d8('0x42')](_0x2d03ac[_0x72d8('0x3b')]['sort']);_0x499637[_0x72d8('0x43')]=qs[_0x72d8('0x3c')](_[_0x72d8('0x5d')](_0x2d03ac[_0x72d8('0x3b')],_0x134f20[_0x72d8('0x3c')]));if(_0x2d03ac[_0x72d8('0x3b')]['filter']){_0x499637[_0x72d8('0x43')]=_[_0x72d8('0x45')](_0x499637['where'],{'$or':_[_0x72d8('0x3a')](_0x499637[_0x72d8('0x3f')],function(_0x17dfe4){var _0x694d8={};_0x694d8[_0x17dfe4]={'$like':'%'+_0x2d03ac[_0x72d8('0x3b')]['filter']+'%'};return _0x694d8;})});}_0x499637=_['merge']({},_0x499637,_0x2d03ac['options']);return _0x4c182b[_0x72d8('0x8d')](_0x499637);}})[_0x72d8('0x1a')](function(_0x4c745c){if(_0x4c745c){_0xec1abb=_0x4c745c['length'];if(!_0x2d03ac['query'][_0x72d8('0x5c')](_0x72d8('0x40'))){_0x499637['limit']=qs[_0x72d8('0x29')](_0x2d03ac[_0x72d8('0x3b')][_0x72d8('0x29')]);_0x499637[_0x72d8('0x26')]=qs[_0x72d8('0x26')](_0x2d03ac[_0x72d8('0x3b')][_0x72d8('0x26')]);}return _0x4c182b['getAgents'](_0x499637);}})[_0x72d8('0x1a')](function(_0x451b94){if(_0x451b94){return _0x451b94?{'count':_0xec1abb,'rows':_0x451b94}:null;}})[_0x72d8('0x1a')](respondWithResult(_0x238d25,null))[_0x72d8('0x4a')](handleError(_0x238d25,null));};
\ No newline at end of file
+var _0x8d5e=['get','ChatQueues','UserProfileResource','name','send','rawAttributes','type','key','model','map','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','limit','sort','where','pick','filter','merge','VIRTUAL','options','ChatQueue','rows','catch','show','params','includeAll','include','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','find','autoAssociation','describe','getMembers','findOne','UserChatQueue','order','findAll','User','findAndCountAll','UserId','agent','chatPause','format','SIP','createdAt','updatedAt','getTeams','addTeams','Team','Agents','online','voicePause','interface','flatMap','sequelize','transaction','each','findOrCreate','forEach','emit','removeTeams','ids','field','tq.TeamId','team_has_chat_queues','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','clone','ut.UserId\x20=\x20?','QueryTypes','every','TeamId','includes','all','compact','isEmpty','removeAgents','userChatQueue:remove','addAgents','omit','spread','isArray','getAgents','eml-format','rimraf','zip-dir','request-promise','bluebird','path','sox','to-csv','fs-extra','lodash','squel','crypto','jsforce','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./chatQueue.socket','register','client','http','request','then','ChatQueue,\x20%s,\x20%s','debug','ChatQueue,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','sendStatus','status','end','json','undefined','offset','count','Content-Range','apply','update','destroy'];(function(_0x3074f3,_0x4f2c03){var _0x53f112=function(_0x4a17af){while(--_0x4a17af){_0x3074f3['push'](_0x3074f3['shift']());}};_0x53f112(++_0x4f2c03);}(_0x8d5e,0xf0));var _0xe8d5=function(_0x4b2863,_0x494899){_0x4b2863=_0x4b2863-0x0;var _0x567d67=_0x8d5e[_0x4b2863];return _0x567d67;};'use strict';var emlformat=require(_0xe8d5('0x0'));var rimraf=require(_0xe8d5('0x1'));var zipdir=require(_0xe8d5('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xe8d5('0x3'));var moment=require('moment');var BPromise=require(_0xe8d5('0x4'));var Mustache=require('mustache');var util=require('util');var path=require(_0xe8d5('0x5'));var sox=require(_0xe8d5('0x6'));var csv=require(_0xe8d5('0x7'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xe8d5('0x8'));var _=require(_0xe8d5('0x9'));var squel=require(_0xe8d5('0xa'));var crypto=require(_0xe8d5('0xb'));var jsforce=require(_0xe8d5('0xc'));var deskjs=require('desk.js');var toCsv=require(_0xe8d5('0x7'));var querystring=require('querystring');var Papa=require(_0xe8d5('0xd'));var Redis=require('ioredis');var authService=require(_0xe8d5('0xe'));var qs=require(_0xe8d5('0xf'));var as=require(_0xe8d5('0x10'));var hardwareService=require(_0xe8d5('0x11'));var logger=require(_0xe8d5('0x12'))(_0xe8d5('0x13'));var utils=require(_0xe8d5('0x14'));var config=require('../../config/environment');var licenseUtil=require(_0xe8d5('0x15'));var db=require(_0xe8d5('0x16'))['db'];config[_0xe8d5('0x17')]=_[_0xe8d5('0x18')](config[_0xe8d5('0x17')],{'host':_0xe8d5('0x19'),'port':0x18eb});var socket=require(_0xe8d5('0x1a'))(new Redis(config['redis']));require(_0xe8d5('0x1b'))[_0xe8d5('0x1c')](socket);var jayson=require('jayson/promise');var client=jayson[_0xe8d5('0x1d')][_0xe8d5('0x1e')]({'port':0x232a});function respondWithRpcPromise(_0x465eb3,_0x40d2cc,_0x13cf11,_0x3ad494){return new BPromise(function(_0x228204,_0x46633e){var _0x4baf98=_0x3ad494||client;return _0x4baf98[_0xe8d5('0x1f')](_0x465eb3,_0x13cf11)[_0xe8d5('0x20')](function(_0x529ede){logger['info'](_0xe8d5('0x21'),_0x40d2cc,'request\x20sent');logger[_0xe8d5('0x22')](_0xe8d5('0x23'),_0x40d2cc,_0xe8d5('0x24'),JSON[_0xe8d5('0x25')](_0x529ede));if(_0x529ede[_0xe8d5('0x26')]){if(_0x529ede[_0xe8d5('0x26')][_0xe8d5('0x27')]===0x1f4){logger[_0xe8d5('0x26')](_0xe8d5('0x21'),_0x40d2cc,_0x529ede[_0xe8d5('0x26')]['message']);return _0x46633e(_0x529ede[_0xe8d5('0x26')][_0xe8d5('0x28')]);}logger[_0xe8d5('0x26')](_0xe8d5('0x21'),_0x40d2cc,_0x529ede[_0xe8d5('0x26')]['message']);return _0x228204(_0x529ede[_0xe8d5('0x26')][_0xe8d5('0x28')]);}else{logger['info']('ChatQueue,\x20%s,\x20%s',_0x40d2cc,'request\x20sent');_0x228204(_0x529ede['result'][_0xe8d5('0x28')]);}})['catch'](function(_0x279e31){logger[_0xe8d5('0x26')](_0xe8d5('0x21'),_0x40d2cc,_0x279e31);_0x46633e(_0x279e31);});});}function respondWithStatusCode(_0x583cfd,_0x29c1f0){_0x29c1f0=_0x29c1f0||0xcc;return function(_0x4b9bd2){if(_0x4b9bd2){return _0x583cfd[_0xe8d5('0x29')](_0x29c1f0);}return _0x583cfd[_0xe8d5('0x2a')](_0x29c1f0)[_0xe8d5('0x2b')]();};}function respondWithResult(_0x535411,_0x1bf451){_0x1bf451=_0x1bf451||0xc8;return function(_0x14d095){if(_0x14d095){return _0x535411[_0xe8d5('0x2a')](_0x1bf451)[_0xe8d5('0x2c')](_0x14d095);}};}function respondWithFilteredResult(_0x3f5af9,_0x1a9b2d){return function(_0x426009){if(_0x426009){var _0x798fdd=typeof _0x1a9b2d['offset']===_0xe8d5('0x2d')&&typeof _0x1a9b2d['limit']===_0xe8d5('0x2d');var _0x19b7e3=_0x426009['count'];var _0x4a2e31=_0x798fdd?0x0:_0x1a9b2d[_0xe8d5('0x2e')];var _0x181e94=_0x798fdd?_0x426009[_0xe8d5('0x2f')]:_0x1a9b2d[_0xe8d5('0x2e')]+_0x1a9b2d['limit'];var _0x464dd3;if(_0x181e94>=_0x19b7e3){_0x181e94=_0x19b7e3;_0x464dd3=0xc8;}else{_0x464dd3=0xce;}_0x3f5af9[_0xe8d5('0x2a')](_0x464dd3);return _0x3f5af9['set'](_0xe8d5('0x30'),_0x4a2e31+'-'+_0x181e94+'/'+_0x19b7e3)['json'](_0x426009);}return null;};}function patchUpdates(_0x5a7968){return function(_0x4bcdfd){try{jsonpatch[_0xe8d5('0x31')](_0x4bcdfd,_0x5a7968,!![]);}catch(_0x26f6da){return BPromise['reject'](_0x26f6da);}return _0x4bcdfd['save']();};}function saveUpdates(_0x473e52,_0x28f904){return function(_0x4ad8f6){if(_0x4ad8f6){return _0x4ad8f6[_0xe8d5('0x32')](_0x473e52)[_0xe8d5('0x20')](function(_0x31e058){return _0x31e058;});}return null;};}function removeEntity(_0x3f6a5f,_0x564ad4){return function(_0x1775f5){if(_0x1775f5){return _0x1775f5[_0xe8d5('0x33')]()[_0xe8d5('0x20')](function(){var _0x351a5e=_0x1775f5[_0xe8d5('0x34')]({'plain':!![]});var _0x5eb714=_0xe8d5('0x35');return db[_0xe8d5('0x36')]['destroy']({'where':{'type':_0x5eb714,'resourceId':_0x351a5e['id']}})[_0xe8d5('0x20')](function(){return _0x1775f5;});})[_0xe8d5('0x20')](function(){_0x3f6a5f[_0xe8d5('0x2a')](0xcc)[_0xe8d5('0x2b')]();});}};}function handleEntityNotFound(_0x254fff,_0x59f1ae){return function(_0x5c710c){if(!_0x5c710c){_0x254fff[_0xe8d5('0x29')](0x194);}return _0x5c710c;};}function handleError(_0x17f720,_0x527e65){_0x527e65=_0x527e65||0x1f4;return function(_0xa11dec){logger[_0xe8d5('0x26')](_0xa11dec['stack']);if(_0xa11dec[_0xe8d5('0x37')]){delete _0xa11dec[_0xe8d5('0x37')];}_0x17f720['status'](_0x527e65)[_0xe8d5('0x38')](_0xa11dec);};}exports['index']=function(_0x1e8cff,_0x13a02d){var _0x5230bf={},_0x242c2e={},_0x242b4e={'count':0x0,'rows':[]};var _0x41868e=_['map'](db['ChatQueue'][_0xe8d5('0x39')],function(_0x2401c2){return{'name':_0x2401c2['fieldName'],'type':_0x2401c2[_0xe8d5('0x3a')][_0xe8d5('0x3b')]};});_0x242c2e[_0xe8d5('0x3c')]=_[_0xe8d5('0x3d')](_0x41868e,_0xe8d5('0x37'));_0x242c2e[_0xe8d5('0x3e')]=_[_0xe8d5('0x3f')](_0x1e8cff[_0xe8d5('0x3e')]);_0x242c2e[_0xe8d5('0x40')]=_[_0xe8d5('0x41')](_0x242c2e[_0xe8d5('0x3c')],_0x242c2e[_0xe8d5('0x3e')]);_0x5230bf[_0xe8d5('0x42')]=_[_0xe8d5('0x41')](_0x242c2e[_0xe8d5('0x3c')],qs['fields'](_0x1e8cff['query'][_0xe8d5('0x43')]));_0x5230bf['attributes']=_0x5230bf[_0xe8d5('0x42')][_0xe8d5('0x44')]?_0x5230bf['attributes']:_0x242c2e['model'];if(!_0x1e8cff[_0xe8d5('0x3e')][_0xe8d5('0x45')](_0xe8d5('0x46'))){_0x5230bf['limit']=qs[_0xe8d5('0x47')](_0x1e8cff[_0xe8d5('0x3e')]['limit']);_0x5230bf[_0xe8d5('0x2e')]=qs[_0xe8d5('0x2e')](_0x1e8cff[_0xe8d5('0x3e')][_0xe8d5('0x2e')]);}_0x5230bf['order']=qs['sort'](_0x1e8cff['query'][_0xe8d5('0x48')]);_0x5230bf[_0xe8d5('0x49')]=qs['filters'](_[_0xe8d5('0x4a')](_0x1e8cff[_0xe8d5('0x3e')],_0x242c2e[_0xe8d5('0x40')]),_0x41868e);if(_0x1e8cff['query'][_0xe8d5('0x4b')]){_0x5230bf[_0xe8d5('0x49')]=_[_0xe8d5('0x4c')](_0x5230bf[_0xe8d5('0x49')],{'$or':_[_0xe8d5('0x3d')](_0x41868e,function(_0x304883){if(_0x304883[_0xe8d5('0x3a')]!==_0xe8d5('0x4d')){var _0x5aea19={};_0x5aea19[_0x304883[_0xe8d5('0x37')]]={'$like':'%'+_0x1e8cff[_0xe8d5('0x3e')]['filter']+'%'};return _0x5aea19;}})});}_0x5230bf=_[_0xe8d5('0x4c')]({},_0x5230bf,_0x1e8cff[_0xe8d5('0x4e')]);var _0x277c28={'where':_0x5230bf[_0xe8d5('0x49')]};return db[_0xe8d5('0x4f')][_0xe8d5('0x2f')](_0x277c28)[_0xe8d5('0x20')](function(_0x312edc){_0x242b4e[_0xe8d5('0x2f')]=_0x312edc;if(_0x1e8cff[_0xe8d5('0x3e')]['includeAll']){_0x5230bf['include']=[{'all':!![]}];}return db[_0xe8d5('0x4f')]['findAll'](_0x5230bf);})[_0xe8d5('0x20')](function(_0xa9b920){_0x242b4e[_0xe8d5('0x50')]=_0xa9b920;return _0x242b4e;})['then'](respondWithFilteredResult(_0x13a02d,_0x5230bf))[_0xe8d5('0x51')](handleError(_0x13a02d,null));};exports[_0xe8d5('0x52')]=function(_0x1abc1e,_0x3ab11e){var _0x3474ad={'raw':!![],'where':{'id':_0x1abc1e[_0xe8d5('0x53')]['id']}},_0x36485d={};_0x36485d[_0xe8d5('0x3c')]=_[_0xe8d5('0x3f')](db[_0xe8d5('0x4f')][_0xe8d5('0x39')]);_0x36485d['query']=_[_0xe8d5('0x3f')](_0x1abc1e[_0xe8d5('0x3e')]);_0x36485d[_0xe8d5('0x40')]=_[_0xe8d5('0x41')](_0x36485d['model'],_0x36485d[_0xe8d5('0x3e')]);_0x3474ad[_0xe8d5('0x42')]=_['intersection'](_0x36485d[_0xe8d5('0x3c')],qs[_0xe8d5('0x43')](_0x1abc1e[_0xe8d5('0x3e')][_0xe8d5('0x43')]));_0x3474ad[_0xe8d5('0x42')]=_0x3474ad[_0xe8d5('0x42')][_0xe8d5('0x44')]?_0x3474ad[_0xe8d5('0x42')]:_0x36485d[_0xe8d5('0x3c')];if(_0x1abc1e['query'][_0xe8d5('0x54')]){_0x3474ad[_0xe8d5('0x55')]=[{'all':!![]}];}_0x3474ad=_['merge']({},_0x3474ad,_0x1abc1e['options']);return db[_0xe8d5('0x4f')]['find'](_0x3474ad)[_0xe8d5('0x20')](handleEntityNotFound(_0x3ab11e,null))['then'](respondWithResult(_0x3ab11e,null))['catch'](handleError(_0x3ab11e,null));};exports['create']=function(_0x3448e9,_0x43efa9){return db[_0xe8d5('0x4f')][_0xe8d5('0x56')](_0x3448e9[_0xe8d5('0x57')],{})[_0xe8d5('0x20')](function(_0x2c282b){var _0x2c558c=_0x3448e9[_0xe8d5('0x58')][_0xe8d5('0x34')]({'plain':!![]});if(!_0x2c558c)throw new Error(_0xe8d5('0x59'));if(_0x2c558c[_0xe8d5('0x5a')]===_0xe8d5('0x58')){var _0x315b67=_0x2c282b[_0xe8d5('0x34')]({'plain':!![]});var _0x53ff36='ChatQueues';return db[_0xe8d5('0x5b')][_0xe8d5('0x5c')]({'where':{'name':_0x53ff36,'userProfileId':_0x2c558c['userProfileId']},'raw':!![]})[_0xe8d5('0x20')](function(_0x565440){if(_0x565440&&_0x565440[_0xe8d5('0x5d')]===0x0){return db[_0xe8d5('0x36')]['create']({'name':_0x315b67[_0xe8d5('0x37')],'resourceId':_0x315b67['id'],'type':_0x565440[_0xe8d5('0x37')],'sectionId':_0x565440['id']},{})[_0xe8d5('0x20')](function(){return _0x2c282b;});}else{return _0x2c282b;}})['catch'](function(_0x400f9a){logger['error']('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x400f9a);throw _0x400f9a;});}return _0x2c282b;})['then'](respondWithResult(_0x43efa9,0xc9))[_0xe8d5('0x51')](handleError(_0x43efa9,null));};exports[_0xe8d5('0x32')]=function(_0x320f4a,_0x5f1641){if(_0x320f4a[_0xe8d5('0x57')]['id']){delete _0x320f4a[_0xe8d5('0x57')]['id'];}return db[_0xe8d5('0x4f')][_0xe8d5('0x5c')]({'where':{'id':_0x320f4a[_0xe8d5('0x53')]['id']}})[_0xe8d5('0x20')](handleEntityNotFound(_0x5f1641,null))['then'](saveUpdates(_0x320f4a[_0xe8d5('0x57')],null))[_0xe8d5('0x20')](respondWithResult(_0x5f1641,null))['catch'](handleError(_0x5f1641,null));};exports['destroy']=function(_0x3fc435,_0x504afb){return db[_0xe8d5('0x4f')]['find']({'where':{'id':_0x3fc435['params']['id']}})[_0xe8d5('0x20')](handleEntityNotFound(_0x504afb,null))[_0xe8d5('0x20')](removeEntity(_0x504afb,null))[_0xe8d5('0x51')](handleError(_0x504afb,null));};exports[_0xe8d5('0x5e')]=function(_0x50120e,_0x468b30){return db[_0xe8d5('0x4f')][_0xe8d5('0x5e')]()[_0xe8d5('0x20')](respondWithResult(_0x468b30,null))[_0xe8d5('0x51')](handleError(_0x468b30,null));};exports[_0xe8d5('0x5f')]=function(_0x5b9fc0,_0xaee930,_0x17ada6){var _0x369967={'raw':!![],'where':{}},_0x1305e2={},_0x36a046;return db['ChatQueue'][_0xe8d5('0x60')]({'where':{'id':_0x5b9fc0['params']['id']}})[_0xe8d5('0x20')](handleEntityNotFound(_0xaee930,null))[_0xe8d5('0x20')](function(_0x1f55d0){if(_0x1f55d0){_0x36a046=_0x1f55d0['get']({'plain':!![]});_0x1305e2[_0xe8d5('0x3c')]=_[_0xe8d5('0x3f')](db[_0xe8d5('0x61')]['rawAttributes']);_0x1305e2['query']=_[_0xe8d5('0x3f')](_0x5b9fc0[_0xe8d5('0x3e')]);_0x1305e2['filters']=_[_0xe8d5('0x41')](_0x1305e2[_0xe8d5('0x3c')],_0x1305e2[_0xe8d5('0x3e')]);_0x369967[_0xe8d5('0x42')]=_['intersection'](_0x1305e2[_0xe8d5('0x3c')],qs['fields'](_0x5b9fc0[_0xe8d5('0x3e')][_0xe8d5('0x43')]));_0x369967[_0xe8d5('0x42')]=_0x369967[_0xe8d5('0x42')][_0xe8d5('0x44')]?_0x369967[_0xe8d5('0x42')]:_0x1305e2['model'];if(!_0x5b9fc0['query'][_0xe8d5('0x45')](_0xe8d5('0x46'))){_0x369967[_0xe8d5('0x47')]=qs['limit'](_0x5b9fc0[_0xe8d5('0x3e')][_0xe8d5('0x47')]);_0x369967[_0xe8d5('0x2e')]=qs[_0xe8d5('0x2e')](_0x5b9fc0['query'][_0xe8d5('0x2e')]);}_0x369967[_0xe8d5('0x62')]=qs[_0xe8d5('0x48')](_0x5b9fc0[_0xe8d5('0x3e')][_0xe8d5('0x48')]);_0x369967[_0xe8d5('0x49')]=qs['filters'](_[_0xe8d5('0x4a')](_0x5b9fc0['query'],_0x1305e2[_0xe8d5('0x40')]));_0x369967[_0xe8d5('0x49')]['ChatQueueId']=_0x1f55d0['id'];if(_0x5b9fc0['query'][_0xe8d5('0x4b')]){_0x369967[_0xe8d5('0x49')]=_[_0xe8d5('0x4c')](_0x369967[_0xe8d5('0x49')],{'$or':_[_0xe8d5('0x3d')](_0x369967[_0xe8d5('0x42')],function(_0x149cd7){var _0x218b5c={};_0x218b5c[_0x149cd7]={'$like':'%'+_0x5b9fc0['query'][_0xe8d5('0x4b')]+'%'};return _0x218b5c;})});}_0x369967=_[_0xe8d5('0x4c')]({},_0x369967,_0x5b9fc0[_0xe8d5('0x4e')]);return db['UserChatQueue'][_0xe8d5('0x63')](_0x369967);}})[_0xe8d5('0x20')](function(_0x750ba2){if(_0x750ba2){return db[_0xe8d5('0x64')][_0xe8d5('0x65')]({'where':{'id':_[_0xe8d5('0x3d')](_0x750ba2,_0xe8d5('0x66')),'role':_0xe8d5('0x67')},'attributes':['id',_0xe8d5('0x37'),_0xe8d5('0x68'),'updatedAt','createdAt']});}})[_0xe8d5('0x20')](function(_0x1204f9){if(_0x1204f9){return{'count':_0x1204f9[_0xe8d5('0x2f')],'rows':_[_0xe8d5('0x3d')](_0x1204f9[_0xe8d5('0x50')],function(_0x4179d8){return{'membername':_0x4179d8[_0xe8d5('0x37')],'UserId':_0x4179d8['id'],'queue_name':_0x36a046['name'],'ChatQueueId':_0x36a046['id'],'interface':util[_0xe8d5('0x69')]('%s/%s',_0xe8d5('0x6a'),_0x4179d8[_0xe8d5('0x37')]),'penalty':0x0,'paused':_0x4179d8['chatPause'],'createdAt':_0x4179d8[_0xe8d5('0x6b')],'updatedAt':_0x4179d8[_0xe8d5('0x6c')]};})};}else{return{'count':0x0,'rows':[]};}})['then'](respondWithFilteredResult(_0xaee930,_0x369967))[_0xe8d5('0x51')](handleError(_0xaee930,null));};exports[_0xe8d5('0x6d')]=function(_0x1edddf,_0x466725,_0x37a803){var _0x38e631={};var _0x1afc73={};var _0x5b6d8f;var _0x3ab933;return db[_0xe8d5('0x4f')][_0xe8d5('0x60')]({'where':{'id':_0x1edddf[_0xe8d5('0x53')]['id']}})['then'](handleEntityNotFound(_0x466725,null))[_0xe8d5('0x20')](function(_0x605a6){if(_0x605a6){_0x5b6d8f=_0x605a6;_0x1afc73[_0xe8d5('0x3c')]=_[_0xe8d5('0x3f')](db['Team'][_0xe8d5('0x39')]);_0x1afc73[_0xe8d5('0x3e')]=_[_0xe8d5('0x3f')](_0x1edddf[_0xe8d5('0x3e')]);_0x1afc73[_0xe8d5('0x40')]=_['intersection'](_0x1afc73['model'],_0x1afc73[_0xe8d5('0x3e')]);_0x38e631[_0xe8d5('0x42')]=_[_0xe8d5('0x41')](_0x1afc73[_0xe8d5('0x3c')],qs[_0xe8d5('0x43')](_0x1edddf[_0xe8d5('0x3e')]['fields']));_0x38e631['attributes']=_0x38e631[_0xe8d5('0x42')][_0xe8d5('0x44')]?_0x38e631[_0xe8d5('0x42')]:_0x1afc73[_0xe8d5('0x3c')];_0x38e631[_0xe8d5('0x62')]=qs[_0xe8d5('0x48')](_0x1edddf[_0xe8d5('0x3e')][_0xe8d5('0x48')]);_0x38e631[_0xe8d5('0x49')]=qs['filters'](_['pick'](_0x1edddf['query'],_0x1afc73[_0xe8d5('0x40')]));if(_0x1edddf[_0xe8d5('0x3e')][_0xe8d5('0x4b')]){_0x38e631['where']=_[_0xe8d5('0x4c')](_0x38e631[_0xe8d5('0x49')],{'$or':_[_0xe8d5('0x3d')](_0x38e631[_0xe8d5('0x42')],function(_0x535669){var _0x5294d8={};_0x5294d8[_0x535669]={'$like':'%'+_0x1edddf[_0xe8d5('0x3e')]['filter']+'%'};return _0x5294d8;})});}_0x38e631=_[_0xe8d5('0x4c')]({},_0x38e631,_0x1edddf[_0xe8d5('0x4e')]);return _0x5b6d8f[_0xe8d5('0x6d')](_0x38e631);}})[_0xe8d5('0x20')](function(_0x27ed12){if(_0x27ed12){_0x3ab933=_0x27ed12[_0xe8d5('0x44')];if(!_0x1edddf[_0xe8d5('0x3e')]['hasOwnProperty'](_0xe8d5('0x46'))){_0x38e631[_0xe8d5('0x47')]=qs[_0xe8d5('0x47')](_0x1edddf[_0xe8d5('0x3e')][_0xe8d5('0x47')]);_0x38e631[_0xe8d5('0x2e')]=qs['offset'](_0x1edddf[_0xe8d5('0x3e')][_0xe8d5('0x2e')]);}return _0x5b6d8f[_0xe8d5('0x6d')](_0x38e631);}})[_0xe8d5('0x20')](function(_0x3c5398){if(_0x3c5398){return _0x3c5398?{'count':_0x3ab933,'rows':_0x3c5398}:null;}})['then'](respondWithResult(_0x466725,null))['catch'](handleError(_0x466725,null));};exports[_0xe8d5('0x6e')]=function(_0x403bc2,_0x5ea83c,_0x3f87dd){var _0x4ce309=_0x403bc2[_0xe8d5('0x57')]['ids'];return db[_0xe8d5('0x6f')]['findAll']({'where':{'id':_0x4ce309},'attributes':['id'],'include':[{'model':db[_0xe8d5('0x64')],'as':_0xe8d5('0x70'),'attributes':['id',_0xe8d5('0x37'),_0xe8d5('0x71'),_0xe8d5('0x72'),_0xe8d5('0x73')],'raw':!![]}]})[_0xe8d5('0x20')](function(_0x321a55){if(_0x321a55){var _0x3b4518=_[_0xe8d5('0x74')](_0x321a55,function(_0x4f4be8){var _0x5f42ec=_0x4f4be8[_0xe8d5('0x34')]({'plain':!![]});return _0x5f42ec[_0xe8d5('0x70')];});return db['ChatQueue'][_0xe8d5('0x5c')]({'where':{'id':_0x403bc2[_0xe8d5('0x53')]['id']}})['then'](function(_0x3cd784){return db[_0xe8d5('0x75')][_0xe8d5('0x76')](function(_0x481993){return _0x3cd784[_0xe8d5('0x6e')](_0x4ce309,{'transaction':_0x481993})[_0xe8d5('0x20')](function(){return BPromise[_0xe8d5('0x77')](_0x3b4518,function(_0x1f5167){return db['UserChatQueue'][_0xe8d5('0x78')]({'where':{'UserId':_0x1f5167['id'],'ChatQueueId':_0x403bc2[_0xe8d5('0x53')]['id']},'transaction':_0x481993});});})[_0xe8d5('0x20')](function(){_0x3b4518[_0xe8d5('0x79')](function(_0x1d01e8){socket[_0xe8d5('0x7a')]('userChatQueue:save',{'UserId':_0x1d01e8['id'],'ChatQueueId':_0x3cd784['id']});});});});});}})[_0xe8d5('0x20')](respondWithStatusCode(_0x5ea83c,null))[_0xe8d5('0x51')](handleError(_0x5ea83c,null));};exports[_0xe8d5('0x7b')]=function(_0xc63745,_0x46c761,_0x47d3bb){return db[_0xe8d5('0x6f')][_0xe8d5('0x63')]({'where':{'id':_0xc63745[_0xe8d5('0x3e')][_0xe8d5('0x7c')]},'attributes':['id'],'include':[{'model':db[_0xe8d5('0x64')],'as':_0xe8d5('0x70'),'attributes':['id'],'raw':!![]}]})[_0xe8d5('0x20')](handleEntityNotFound(_0x46c761,null))[_0xe8d5('0x20')](function(_0x72c52){var _0xe83183=_[_0xe8d5('0x3d')](_0x72c52,'id');var _0x45e675=[];var _0x2eacc8=[];var _0x3c302e=squel['select']();_0x3c302e[_0xe8d5('0x7d')](_0xe8d5('0x7e'))['from'](_0xe8d5('0x7f'),'tq')['join'](_0xe8d5('0x80'),'ut',_0xe8d5('0x81'))[_0xe8d5('0x49')]('ChatQueueId\x20=\x20?',_0xc63745[_0xe8d5('0x53')]['id']);for(var _0xf9980a=0x0;_0xf9980a<_0x72c52[_0xe8d5('0x44')];_0xf9980a+=0x1){let _0x434048=_0x72c52[_0xf9980a];for(var _0x577048=0x0;_0x577048<_0x434048['Agents'][_0xe8d5('0x44')];_0x577048+=0x1){let _0x39f399=_0x434048[_0xe8d5('0x70')][_0x577048];var _0x38a8d9=_0x3c302e[_0xe8d5('0x82')]();_0x38a8d9[_0xe8d5('0x49')](_0xe8d5('0x83'),_0x39f399['id']);_0x2eacc8['push'](db[_0xe8d5('0x75')][_0xe8d5('0x3e')](_0x38a8d9['toString'](),{'type':db['sequelize'][_0xe8d5('0x84')]['SELECT']})[_0xe8d5('0x20')](function(_0x7b8495){if(_0x7b8495[_0xe8d5('0x44')]===0x1){return _0x39f399['id'];}else{var _0x3b9ded=_[_0xe8d5('0x85')](_[_0xe8d5('0x3d')](_0x7b8495,_0xe8d5('0x86')),function(_0x388c67){return _[_0xe8d5('0x87')](_0xe83183,_0x388c67);});if(_0x3b9ded){return _0x39f399['id'];}}}));}}return BPromise[_0xe8d5('0x88')](_0x2eacc8)[_0xe8d5('0x20')](function(_0x135ab4){_0x45e675=_(_0x45e675)['union'](_0x135ab4)[_0xe8d5('0x89')]()['value']();return db[_0xe8d5('0x4f')][_0xe8d5('0x5c')]({'where':{'id':_0xc63745[_0xe8d5('0x53')]['id']}})['then'](function(_0x5c3a3a){return db['sequelize'][_0xe8d5('0x76')](function(_0x26502a){return _0x5c3a3a[_0xe8d5('0x7b')](_0xc63745[_0xe8d5('0x3e')]['ids'],{'transaction':_0x26502a})[_0xe8d5('0x20')](function(){if(!_[_0xe8d5('0x8a')](_0x45e675)){return _0x5c3a3a[_0xe8d5('0x8b')](_0x45e675,{'transaction':_0x26502a});}})[_0xe8d5('0x20')](function(){_0x45e675[_0xe8d5('0x79')](function(_0x5ae2b8){socket[_0xe8d5('0x7a')](_0xe8d5('0x8c'),{'UserId':_0x5ae2b8,'ChatQueueId':_0x5c3a3a['id']});});});});});});})['then'](respondWithStatusCode(_0x46c761,null))[_0xe8d5('0x51')](handleError(_0x46c761,null));};exports[_0xe8d5('0x8d')]=function(_0x5a8348,_0x158f79,_0x552b75){return db[_0xe8d5('0x4f')]['find']({'where':{'id':_0x5a8348[_0xe8d5('0x53')]['id']}})[_0xe8d5('0x20')](handleEntityNotFound(_0x158f79,null))[_0xe8d5('0x20')](function(_0x1db074){if(_0x1db074){return _0x1db074[_0xe8d5('0x8d')](_0x5a8348[_0xe8d5('0x57')]['ids'],_[_0xe8d5('0x8e')](_0x5a8348[_0xe8d5('0x57')],[_0xe8d5('0x7c'),'id'])||{})[_0xe8d5('0x8f')](function(_0x417425){for(var _0x1c1ea8=0x0;_0x1c1ea8<_0x5a8348[_0xe8d5('0x57')][_0xe8d5('0x7c')][_0xe8d5('0x44')];_0x1c1ea8+=0x1){socket[_0xe8d5('0x7a')]('userChatQueue:save',{'UserId':Number(_0x5a8348[_0xe8d5('0x57')][_0xe8d5('0x7c')][_0x1c1ea8]),'ChatQueueId':Number(_0x5a8348[_0xe8d5('0x53')]['id'])});}return _0x417425;});}})[_0xe8d5('0x20')](respondWithResult(_0x158f79,null))[_0xe8d5('0x51')](handleError(_0x158f79,null));};exports['removeAgents']=function(_0x497a57,_0x21c492,_0x2fd3ef){return db[_0xe8d5('0x4f')][_0xe8d5('0x5c')]({'where':{'id':_0x497a57['params']['id']}})[_0xe8d5('0x20')](handleEntityNotFound(_0x21c492,null))[_0xe8d5('0x20')](function(_0x108f38){if(_0x108f38){return _0x108f38[_0xe8d5('0x8b')](_0x497a57[_0xe8d5('0x3e')][_0xe8d5('0x7c')])[_0xe8d5('0x20')](function(){if(_[_0xe8d5('0x90')](_0x497a57[_0xe8d5('0x3e')][_0xe8d5('0x7c')])){for(var _0x2c2a65=0x0;_0x2c2a65<_0x497a57[_0xe8d5('0x3e')][_0xe8d5('0x7c')][_0xe8d5('0x44')];_0x2c2a65+=0x1){socket[_0xe8d5('0x7a')]('userChatQueue:remove',{'UserId':Number(_0x497a57[_0xe8d5('0x3e')]['ids'][_0x2c2a65]),'ChatQueueId':Number(_0x497a57['params']['id'])});}}else{socket[_0xe8d5('0x7a')](_0xe8d5('0x8c'),{'UserId':Number(_0x497a57[_0xe8d5('0x3e')][_0xe8d5('0x7c')]),'ChatQueueId':Number(_0x497a57['params']['id'])});}});}})['then'](respondWithStatusCode(_0x21c492,null))['catch'](handleError(_0x21c492,null));};exports[_0xe8d5('0x91')]=function(_0x20e913,_0x4d5c1c,_0x161f80){var _0x3646c7={};var _0x3a994a={};var _0x412200;var _0x41c7a4;return db[_0xe8d5('0x4f')][_0xe8d5('0x60')]({'where':{'id':_0x20e913[_0xe8d5('0x53')]['id']}})[_0xe8d5('0x20')](handleEntityNotFound(_0x4d5c1c,null))['then'](function(_0x312b0d){if(_0x312b0d){_0x412200=_0x312b0d;_0x3a994a[_0xe8d5('0x3c')]=_[_0xe8d5('0x3f')](db[_0xe8d5('0x64')][_0xe8d5('0x39')]);_0x3a994a[_0xe8d5('0x3e')]=_[_0xe8d5('0x3f')](_0x20e913[_0xe8d5('0x3e')]);_0x3a994a[_0xe8d5('0x40')]=_[_0xe8d5('0x41')](_0x3a994a[_0xe8d5('0x3c')],_0x3a994a['query']);_0x3646c7['attributes']=_['intersection'](_0x3a994a[_0xe8d5('0x3c')],qs['fields'](_0x20e913[_0xe8d5('0x3e')][_0xe8d5('0x43')]));_0x3646c7['attributes']=_0x3646c7[_0xe8d5('0x42')][_0xe8d5('0x44')]?_0x3646c7[_0xe8d5('0x42')]:_0x3a994a['model'];_0x3646c7[_0xe8d5('0x62')]=qs[_0xe8d5('0x48')](_0x20e913['query'][_0xe8d5('0x48')]);_0x3646c7[_0xe8d5('0x49')]=qs['filters'](_[_0xe8d5('0x4a')](_0x20e913[_0xe8d5('0x3e')],_0x3a994a[_0xe8d5('0x40')]));if(_0x20e913[_0xe8d5('0x3e')][_0xe8d5('0x4b')]){_0x3646c7[_0xe8d5('0x49')]=_['merge'](_0x3646c7[_0xe8d5('0x49')],{'$or':_[_0xe8d5('0x3d')](_0x3646c7['attributes'],function(_0x3cd770){var _0x5b6997={};_0x5b6997[_0x3cd770]={'$like':'%'+_0x20e913[_0xe8d5('0x3e')][_0xe8d5('0x4b')]+'%'};return _0x5b6997;})});}_0x3646c7=_['merge']({},_0x3646c7,_0x20e913['options']);return _0x412200[_0xe8d5('0x91')](_0x3646c7);}})[_0xe8d5('0x20')](function(_0x308959){if(_0x308959){_0x41c7a4=_0x308959[_0xe8d5('0x44')];if(!_0x20e913['query'][_0xe8d5('0x45')](_0xe8d5('0x46'))){_0x3646c7[_0xe8d5('0x47')]=qs[_0xe8d5('0x47')](_0x20e913[_0xe8d5('0x3e')][_0xe8d5('0x47')]);_0x3646c7[_0xe8d5('0x2e')]=qs[_0xe8d5('0x2e')](_0x20e913['query'][_0xe8d5('0x2e')]);}return _0x412200[_0xe8d5('0x91')](_0x3646c7);}})[_0xe8d5('0x20')](function(_0x283629){if(_0x283629){return _0x283629?{'count':_0x41c7a4,'rows':_0x283629}:null;}})['then'](respondWithResult(_0x4d5c1c,null))[_0xe8d5('0x51')](handleError(_0x4d5c1c,null));};
\ No newline at end of file
diff --git a/server/api/chatQueue/chatQueue.events.js b/server/api/chatQueue/chatQueue.events.js
index affb89e..f2626c6 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 _0x1a22=['emit','hasOwnProperty','hook','exports','events','../../mysqldb','ChatQueue','setMaxListeners'];(function(_0x528112,_0x51eec7){var _0xd902ad=function(_0x4ef4cb){while(--_0x4ef4cb){_0x528112['push'](_0x528112['shift']());}};_0xd902ad(++_0x51eec7);}(_0x1a22,0xcc));var _0x21a2=function(_0xb04cb1,_0x13b8e3){_0xb04cb1=_0xb04cb1-0x0;var _0x309445=_0x1a22[_0xb04cb1];return _0x309445;};'use strict';var EventEmitter=require(_0x21a2('0x0'));var ChatQueue=require(_0x21a2('0x1'))['db'][_0x21a2('0x2')];var ChatQueueEvents=new EventEmitter();ChatQueueEvents[_0x21a2('0x3')](0x0);var events={'afterCreate':'save','afterUpdate':'update','afterDestroy':'remove'};function emitEvent(_0x331edd){return function(_0x1b6efc,_0x6533ac,_0x42091d){ChatQueueEvents[_0x21a2('0x4')](_0x331edd+':'+_0x1b6efc['id'],_0x1b6efc);ChatQueueEvents[_0x21a2('0x4')](_0x331edd,_0x1b6efc);_0x42091d(null);};}for(var e in events){if(events[_0x21a2('0x5')](e)){var event=events[e];ChatQueue[_0x21a2('0x6')](e,emitEvent(event));}}module[_0x21a2('0x7')]=ChatQueueEvents;
\ No newline at end of file
+var _0x15e1=['exports','events','../../mysqldb','ChatQueue','setMaxListeners','save','remove','emit'];(function(_0x579ae3,_0x303b07){var _0x19aef2=function(_0x9fdfcb){while(--_0x9fdfcb){_0x579ae3['push'](_0x579ae3['shift']());}};_0x19aef2(++_0x303b07);}(_0x15e1,0x1c1));var _0x115e=function(_0x3cd944,_0x2f134b){_0x3cd944=_0x3cd944-0x0;var _0xad852c=_0x15e1[_0x3cd944];return _0xad852c;};'use strict';var EventEmitter=require(_0x115e('0x0'));var ChatQueue=require(_0x115e('0x1'))['db'][_0x115e('0x2')];var ChatQueueEvents=new EventEmitter();ChatQueueEvents[_0x115e('0x3')](0x0);var events={'afterCreate':_0x115e('0x4'),'afterUpdate':'update','afterDestroy':_0x115e('0x5')};function emitEvent(_0x189f43){return function(_0x1e25d5,_0x362a21,_0x29b35a){ChatQueueEvents[_0x115e('0x6')](_0x189f43+':'+_0x1e25d5['id'],_0x1e25d5);ChatQueueEvents[_0x115e('0x6')](_0x189f43,_0x1e25d5);_0x29b35a(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];ChatQueue['hook'](e,emitEvent(event));}}module[_0x115e('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 321dc2f..5bc01f8 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 _0xed41=['path','../../config/environment','exports','define','ChatQueue','chat_queues','lodash','api','bluebird','request-promise'];(function(_0x208256,_0x366b10){var _0x3c1733=function(_0x36394e){while(--_0x36394e){_0x208256['push'](_0x208256['shift']());}};_0x3c1733(++_0x366b10);}(_0xed41,0xec));var _0x1ed4=function(_0x51d319,_0x1edbb4){_0x51d319=_0x51d319-0x0;var _0x407ec9=_0xed41[_0x51d319];return _0x407ec9;};'use strict';var _=require(_0x1ed4('0x0'));var util=require('util');var logger=require('../../config/logger')(_0x1ed4('0x1'));var moment=require('moment');var BPromise=require(_0x1ed4('0x2'));var rp=require(_0x1ed4('0x3'));var fs=require('fs');var path=require(_0x1ed4('0x4'));var rimraf=require('rimraf');var config=require(_0x1ed4('0x5'));var attributes=require('./chatQueue.attributes');module[_0x1ed4('0x6')]=function(_0x590f15,_0xa94660){return _0x590f15[_0x1ed4('0x7')](_0x1ed4('0x8'),attributes,{'tableName':_0x1ed4('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xf37b=['bluebird','path','../../config/environment','define','ChatQueue','lodash','../../config/logger','api'];(function(_0x3a7767,_0x3ada12){var _0x3e2724=function(_0x36e8c5){while(--_0x36e8c5){_0x3a7767['push'](_0x3a7767['shift']());}};_0x3e2724(++_0x3ada12);}(_0xf37b,0x1ad));var _0xbf37=function(_0x47e549,_0x2e53d6){_0x47e549=_0x47e549-0x0;var _0x251374=_0xf37b[_0x47e549];return _0x251374;};'use strict';var _=require(_0xbf37('0x0'));var util=require('util');var logger=require(_0xbf37('0x1'))(_0xbf37('0x2'));var moment=require('moment');var BPromise=require(_0xbf37('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xbf37('0x4'));var rimraf=require('rimraf');var config=require(_0xbf37('0x5'));var attributes=require('./chatQueue.attributes');module['exports']=function(_0x713a32,_0xf6195a){return _0x713a32[_0xbf37('0x6')](_0xbf37('0x7'),attributes,{'tableName':'chat_queues','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 e49e376..df3b7af 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 _0x2a5c=['ChatQueue,\x20%s,\x20%s,\x20%s','stringify','error','ChatQueue,\x20%s,\x20%s','message','result','catch','GetChatQueue','ChatQueue','findAll','options','raw','where','attributes','include','model','ShowChatQueue','find','map','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','http','redis','localhost','socket.io-emitter','./chatQueue.socket','register','request','then','info','request\x20sent','debug'];(function(_0x36426d,_0x4d62fe){var _0x40bd33=function(_0x278d94){while(--_0x278d94){_0x36426d['push'](_0x36426d['shift']());}};_0x40bd33(++_0x4d62fe);}(_0x2a5c,0x1f3));var _0xc2a5=function(_0x258b31,_0x1aa3d1){_0x258b31=_0x258b31-0x0;var _0x47838b=_0x2a5c[_0x258b31];return _0x47838b;};'use strict';var _=require(_0xc2a5('0x0'));var util=require(_0xc2a5('0x1'));var moment=require(_0xc2a5('0x2'));var BPromise=require(_0xc2a5('0x3'));var rs=require(_0xc2a5('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xc2a5('0x5'))['db'];var utils=require(_0xc2a5('0x6'));var logger=require(_0xc2a5('0x7'))(_0xc2a5('0x8'));var config=require('../../config/environment');var jayson=require(_0xc2a5('0x9'));var client=jayson['client'][_0xc2a5('0xa')]({'port':0x232a});config[_0xc2a5('0xb')]=_['defaults'](config['redis'],{'host':_0xc2a5('0xc'),'port':0x18eb});var socket=require(_0xc2a5('0xd'))(new Redis(config['redis']));require(_0xc2a5('0xe'))[_0xc2a5('0xf')](socket);function respondWithRpcPromise(_0xa5e68d,_0x3d0e4d,_0x51ac92){return new BPromise(function(_0x1c096a,_0x253b3a){return client[_0xc2a5('0x10')](_0xa5e68d,_0x51ac92)[_0xc2a5('0x11')](function(_0x18e60c){logger[_0xc2a5('0x12')]('ChatQueue,\x20%s,\x20%s',_0x3d0e4d,_0xc2a5('0x13'));logger[_0xc2a5('0x14')](_0xc2a5('0x15'),_0x3d0e4d,_0xc2a5('0x13'),JSON[_0xc2a5('0x16')](_0x18e60c));if(_0x18e60c[_0xc2a5('0x17')]){if(_0x18e60c['error']['code']===0x1f4){logger[_0xc2a5('0x17')](_0xc2a5('0x18'),_0x3d0e4d,_0x18e60c['error'][_0xc2a5('0x19')]);return _0x253b3a(_0x18e60c['error'][_0xc2a5('0x19')]);}logger[_0xc2a5('0x17')](_0xc2a5('0x18'),_0x3d0e4d,_0x18e60c[_0xc2a5('0x17')]['message']);return _0x1c096a(_0x18e60c[_0xc2a5('0x17')][_0xc2a5('0x19')]);}else{logger[_0xc2a5('0x12')](_0xc2a5('0x18'),_0x3d0e4d,_0xc2a5('0x13'));_0x1c096a(_0x18e60c[_0xc2a5('0x1a')][_0xc2a5('0x19')]);}})[_0xc2a5('0x1b')](function(_0x3d0b24){logger[_0xc2a5('0x17')]('ChatQueue,\x20%s,\x20%s',_0x3d0e4d,_0x3d0b24);_0x253b3a(_0x3d0b24);});});}exports[_0xc2a5('0x1c')]=function(_0x35be64){var _0x2f3753=this;return new Promise(function(_0x1e6aee,_0x3d29d7){return db[_0xc2a5('0x1d')][_0xc2a5('0x1e')]({'raw':_0x35be64[_0xc2a5('0x1f')]?_0x35be64[_0xc2a5('0x1f')][_0xc2a5('0x20')]===undefined?!![]:![]:!![],'where':_0x35be64[_0xc2a5('0x1f')]?_0x35be64['options'][_0xc2a5('0x21')]||null:null,'attributes':_0x35be64['options']?_0x35be64[_0xc2a5('0x1f')][_0xc2a5('0x22')]||null:null,'limit':_0x35be64[_0xc2a5('0x1f')]?_0x35be64[_0xc2a5('0x1f')]['limit']||null:null,'include':_0x35be64[_0xc2a5('0x1f')]?_0x35be64['options'][_0xc2a5('0x23')]?_['map'](_0x35be64[_0xc2a5('0x1f')][_0xc2a5('0x23')],function(_0x206a95){return{'model':db[_0x206a95[_0xc2a5('0x24')]],'as':_0x206a95['as'],'attributes':_0x206a95[_0xc2a5('0x22')],'include':_0x206a95['include']?_['map'](_0x206a95['include'],function(_0x5bc41d){return{'model':db[_0x5bc41d['model']],'as':_0x5bc41d['as'],'attributes':_0x5bc41d['attributes'],'include':_0x5bc41d[_0xc2a5('0x23')]?_['map'](_0x5bc41d[_0xc2a5('0x23')],function(_0x2012f2){return{'model':db[_0x2012f2[_0xc2a5('0x24')]],'as':_0x2012f2['as'],'attributes':_0x2012f2[_0xc2a5('0x22')]};}):[]};}):[]};}):[]:[]})[_0xc2a5('0x11')](function(_0x1ed507){logger[_0xc2a5('0x12')](_0xc2a5('0x1c'),_0x35be64);logger['debug']('GetChatQueue',_0x35be64,JSON[_0xc2a5('0x16')](_0x1ed507));_0x1e6aee(_0x1ed507);})[_0xc2a5('0x1b')](function(_0x3e2836){logger[_0xc2a5('0x17')](_0xc2a5('0x1c'),_0x3e2836[_0xc2a5('0x19')],_0x35be64);_0x3d29d7(_0x2f3753['error'](0x1f4,_0x3e2836['message']));});});};exports[_0xc2a5('0x25')]=function(_0x2037d5){var _0x5310b6=this;return new Promise(function(_0x2ee0c2,_0x347e54){return db[_0xc2a5('0x1d')][_0xc2a5('0x26')]({'raw':_0x2037d5[_0xc2a5('0x1f')]?_0x2037d5[_0xc2a5('0x1f')][_0xc2a5('0x20')]===undefined?!![]:![]:!![],'where':_0x2037d5[_0xc2a5('0x1f')]?_0x2037d5['options'][_0xc2a5('0x21')]||null:null,'attributes':_0x2037d5[_0xc2a5('0x1f')]?_0x2037d5[_0xc2a5('0x1f')][_0xc2a5('0x22')]||null:null,'include':_0x2037d5['options']?_0x2037d5[_0xc2a5('0x1f')]['include']?_['map'](_0x2037d5[_0xc2a5('0x1f')][_0xc2a5('0x23')],function(_0x1fec30){return{'model':db[_0x1fec30[_0xc2a5('0x24')]],'as':_0x1fec30['as'],'attributes':_0x1fec30['attributes'],'include':_0x1fec30[_0xc2a5('0x23')]?_[_0xc2a5('0x27')](_0x1fec30[_0xc2a5('0x23')],function(_0x3f2f06){return{'model':db[_0x3f2f06['model']],'as':_0x3f2f06['as'],'attributes':_0x3f2f06[_0xc2a5('0x22')],'include':_0x3f2f06[_0xc2a5('0x23')]?_[_0xc2a5('0x27')](_0x3f2f06[_0xc2a5('0x23')],function(_0x1c296f){return{'model':db[_0x1c296f[_0xc2a5('0x24')]],'as':_0x1c296f['as'],'attributes':_0x1c296f[_0xc2a5('0x22')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x377c49){logger['info'](_0xc2a5('0x25'),_0x2037d5);logger['debug'](_0xc2a5('0x25'),_0x2037d5,JSON['stringify'](_0x377c49));_0x2ee0c2(_0x377c49);})['catch'](function(_0x15f5e2){logger[_0xc2a5('0x17')](_0xc2a5('0x25'),_0x15f5e2['message'],_0x2037d5);_0x347e54(_0x5310b6['error'](0x1f4,_0x15f5e2[_0xc2a5('0x19')]));});});};
\ No newline at end of file
+var _0x8cce=['jayson/promise','client','redis','socket.io-emitter','register','request','then','info','ChatQueue,\x20%s,\x20%s','ChatQueue,\x20%s,\x20%s,\x20%s','error','code','message','result','GetChatQueue','ChatQueue','options','where','attributes','limit','include','map','model','debug','stringify','catch','ShowChatQueue','find','raw','util','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment'];(function(_0x4191af,_0x5783da){var _0x27bebf=function(_0x355be7){while(--_0x355be7){_0x4191af['push'](_0x4191af['shift']());}};_0x27bebf(++_0x5783da);}(_0x8cce,0xd6));var _0xe8cc=function(_0x413af4,_0x34f2f1){_0x413af4=_0x413af4-0x0;var _0x20f98b=_0x8cce[_0x413af4];return _0x20f98b;};'use strict';var _=require('lodash');var util=require(_0xe8cc('0x0'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0xe8cc('0x1'));var fs=require('fs');var Redis=require(_0xe8cc('0x2'));var db=require(_0xe8cc('0x3'))['db'];var utils=require(_0xe8cc('0x4'));var logger=require(_0xe8cc('0x5'))(_0xe8cc('0x6'));var config=require(_0xe8cc('0x7'));var jayson=require(_0xe8cc('0x8'));var client=jayson[_0xe8cc('0x9')]['http']({'port':0x232a});config[_0xe8cc('0xa')]=_['defaults'](config['redis'],{'host':'localhost','port':0x18eb});var socket=require(_0xe8cc('0xb'))(new Redis(config[_0xe8cc('0xa')]));require('./chatQueue.socket')[_0xe8cc('0xc')](socket);function respondWithRpcPromise(_0x4c211b,_0x22ca98,_0x401515){return new BPromise(function(_0xcbf3ec,_0x826385){return client[_0xe8cc('0xd')](_0x4c211b,_0x401515)[_0xe8cc('0xe')](function(_0x4d499c){logger[_0xe8cc('0xf')](_0xe8cc('0x10'),_0x22ca98,'request\x20sent');logger['debug'](_0xe8cc('0x11'),_0x22ca98,'request\x20sent',JSON['stringify'](_0x4d499c));if(_0x4d499c[_0xe8cc('0x12')]){if(_0x4d499c['error'][_0xe8cc('0x13')]===0x1f4){logger[_0xe8cc('0x12')](_0xe8cc('0x10'),_0x22ca98,_0x4d499c['error'][_0xe8cc('0x14')]);return _0x826385(_0x4d499c[_0xe8cc('0x12')][_0xe8cc('0x14')]);}logger[_0xe8cc('0x12')](_0xe8cc('0x10'),_0x22ca98,_0x4d499c[_0xe8cc('0x12')][_0xe8cc('0x14')]);return _0xcbf3ec(_0x4d499c[_0xe8cc('0x12')][_0xe8cc('0x14')]);}else{logger[_0xe8cc('0xf')]('ChatQueue,\x20%s,\x20%s',_0x22ca98,'request\x20sent');_0xcbf3ec(_0x4d499c[_0xe8cc('0x15')][_0xe8cc('0x14')]);}})['catch'](function(_0x53014b){logger[_0xe8cc('0x12')](_0xe8cc('0x10'),_0x22ca98,_0x53014b);_0x826385(_0x53014b);});});}exports[_0xe8cc('0x16')]=function(_0x403f91){var _0xbafd99=this;return new Promise(function(_0x21e933,_0x445f4f){return db[_0xe8cc('0x17')]['findAll']({'raw':_0x403f91['options']?_0x403f91[_0xe8cc('0x18')]['raw']===undefined?!![]:![]:!![],'where':_0x403f91['options']?_0x403f91[_0xe8cc('0x18')][_0xe8cc('0x19')]||null:null,'attributes':_0x403f91[_0xe8cc('0x18')]?_0x403f91['options'][_0xe8cc('0x1a')]||null:null,'limit':_0x403f91[_0xe8cc('0x18')]?_0x403f91[_0xe8cc('0x18')][_0xe8cc('0x1b')]||null:null,'include':_0x403f91[_0xe8cc('0x18')]?_0x403f91[_0xe8cc('0x18')][_0xe8cc('0x1c')]?_[_0xe8cc('0x1d')](_0x403f91['options'][_0xe8cc('0x1c')],function(_0x34d6e0){return{'model':db[_0x34d6e0[_0xe8cc('0x1e')]],'as':_0x34d6e0['as'],'attributes':_0x34d6e0[_0xe8cc('0x1a')],'include':_0x34d6e0[_0xe8cc('0x1c')]?_[_0xe8cc('0x1d')](_0x34d6e0[_0xe8cc('0x1c')],function(_0x2c5fb2){return{'model':db[_0x2c5fb2[_0xe8cc('0x1e')]],'as':_0x2c5fb2['as'],'attributes':_0x2c5fb2[_0xe8cc('0x1a')],'include':_0x2c5fb2[_0xe8cc('0x1c')]?_[_0xe8cc('0x1d')](_0x2c5fb2[_0xe8cc('0x1c')],function(_0x35029c){return{'model':db[_0x35029c['model']],'as':_0x35029c['as'],'attributes':_0x35029c[_0xe8cc('0x1a')]};}):[]};}):[]};}):[]:[]})[_0xe8cc('0xe')](function(_0x4bed04){logger[_0xe8cc('0xf')](_0xe8cc('0x16'),_0x403f91);logger[_0xe8cc('0x1f')](_0xe8cc('0x16'),_0x403f91,JSON[_0xe8cc('0x20')](_0x4bed04));_0x21e933(_0x4bed04);})[_0xe8cc('0x21')](function(_0xdc9b1b){logger[_0xe8cc('0x12')](_0xe8cc('0x16'),_0xdc9b1b['message'],_0x403f91);_0x445f4f(_0xbafd99[_0xe8cc('0x12')](0x1f4,_0xdc9b1b[_0xe8cc('0x14')]));});});};exports[_0xe8cc('0x22')]=function(_0x5f6a3c){var _0x1518ce=this;return new Promise(function(_0x5048a7,_0x17405d){return db[_0xe8cc('0x17')][_0xe8cc('0x23')]({'raw':_0x5f6a3c[_0xe8cc('0x18')]?_0x5f6a3c[_0xe8cc('0x18')][_0xe8cc('0x24')]===undefined?!![]:![]:!![],'where':_0x5f6a3c['options']?_0x5f6a3c['options']['where']||null:null,'attributes':_0x5f6a3c['options']?_0x5f6a3c[_0xe8cc('0x18')][_0xe8cc('0x1a')]||null:null,'include':_0x5f6a3c[_0xe8cc('0x18')]?_0x5f6a3c['options'][_0xe8cc('0x1c')]?_[_0xe8cc('0x1d')](_0x5f6a3c[_0xe8cc('0x18')][_0xe8cc('0x1c')],function(_0x550d9a){return{'model':db[_0x550d9a[_0xe8cc('0x1e')]],'as':_0x550d9a['as'],'attributes':_0x550d9a['attributes'],'include':_0x550d9a[_0xe8cc('0x1c')]?_[_0xe8cc('0x1d')](_0x550d9a['include'],function(_0x1dcf5b){return{'model':db[_0x1dcf5b[_0xe8cc('0x1e')]],'as':_0x1dcf5b['as'],'attributes':_0x1dcf5b[_0xe8cc('0x1a')],'include':_0x1dcf5b['include']?_[_0xe8cc('0x1d')](_0x1dcf5b[_0xe8cc('0x1c')],function(_0x531555){return{'model':db[_0x531555[_0xe8cc('0x1e')]],'as':_0x531555['as'],'attributes':_0x531555[_0xe8cc('0x1a')]};}):[]};}):[]};}):[]:[]})[_0xe8cc('0xe')](function(_0x286685){logger[_0xe8cc('0xf')](_0xe8cc('0x22'),_0x5f6a3c);logger[_0xe8cc('0x1f')](_0xe8cc('0x22'),_0x5f6a3c,JSON[_0xe8cc('0x20')](_0x286685));_0x5048a7(_0x286685);})[_0xe8cc('0x21')](function(_0x2e6e13){logger[_0xe8cc('0x12')](_0xe8cc('0x22'),_0x2e6e13[_0xe8cc('0x14')],_0x5f6a3c);_0x17405d(_0x1518ce[_0xe8cc('0x12')](0x1f4,_0x2e6e13['message']));});});};
\ No newline at end of file
diff --git a/server/api/chatQueue/chatQueue.socket.js b/server/api/chatQueue/chatQueue.socket.js
index 8d4642e..cb4e338 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 _0x2dae=['remove','update','removeListener','register','length','chatQueue:','./chatQueue.events'];(function(_0x3b00b0,_0x3555d5){var _0x4c0bc5=function(_0x48c7dc){while(--_0x48c7dc){_0x3b00b0['push'](_0x3b00b0['shift']());}};_0x4c0bc5(++_0x3555d5);}(_0x2dae,0xc3));var _0xe2da=function(_0x1ebeea,_0x2f54f4){_0x1ebeea=_0x1ebeea-0x0;var _0x576465=_0x2dae[_0x1ebeea];return _0x576465;};'use strict';var ChatQueueEvents=require(_0xe2da('0x0'));var events=['save',_0xe2da('0x1'),_0xe2da('0x2')];function createListener(_0xcd0055,_0x167432){return function(_0x99b46f){_0x167432['emit'](_0xcd0055,_0x99b46f);};}function removeListener(_0x25b9f2,_0x439b5d){return function(){ChatQueueEvents[_0xe2da('0x3')](_0x25b9f2,_0x439b5d);};}exports[_0xe2da('0x4')]=function(_0x523c60){for(var _0x3e3e25=0x0,_0x89c70b=events[_0xe2da('0x5')];_0x3e3e25<_0x89c70b;_0x3e3e25++){var _0x2efbd8=events[_0x3e3e25];var _0x238da3=createListener(_0xe2da('0x6')+_0x2efbd8,_0x523c60);ChatQueueEvents['on'](_0x2efbd8,_0x238da3);}};
\ No newline at end of file
+var _0xf72b=['removeListener','register','length','chatQueue:','./chatQueue.events','remove','emit'];(function(_0x1af3db,_0x369209){var _0x5da06a=function(_0x3eb995){while(--_0x3eb995){_0x1af3db['push'](_0x1af3db['shift']());}};_0x5da06a(++_0x369209);}(_0xf72b,0x1d9));var _0xbf72=function(_0x21d88d,_0x3df29e){_0x21d88d=_0x21d88d-0x0;var _0xc044bd=_0xf72b[_0x21d88d];return _0xc044bd;};'use strict';var ChatQueueEvents=require(_0xbf72('0x0'));var events=['save',_0xbf72('0x1'),'update'];function createListener(_0xd09dd2,_0x1880d0){return function(_0x5a9feb){_0x1880d0[_0xbf72('0x2')](_0xd09dd2,_0x5a9feb);};}function removeListener(_0x550a9e,_0x37afc8){return function(){ChatQueueEvents[_0xbf72('0x3')](_0x550a9e,_0x37afc8);};}exports[_0xbf72('0x4')]=function(_0x2b8440){for(var _0x5ee060=0x0,_0x41c11d=events[_0xbf72('0x5')];_0x5ee060<_0x41c11d;_0x5ee060++){var _0x119807=events[_0x5ee060];var _0xd0402c=createListener(_0xbf72('0x6')+_0x119807,_0x2b8440);ChatQueueEvents['on'](_0x119807,_0xd0402c);}};
\ No newline at end of file
diff --git a/server/api/chatQueue/index.js b/server/api/chatQueue/index.js
index 8a9ec9f..941eeec 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(_0x21a9d9,_0x4d5ac8){var _0x46adce=function(_0xfdd336){while(--_0xfdd336){_0x21a9d9['push'](_0x21a9d9['shift']());}};_0x46adce(++_0x4d5ac8);}(_0x3e74,0x175));var _0x43e7=function(_0x4ece86,_0x23aacb){_0x4ece86=_0x4ece86-0x0;var _0x157e8e=_0x3e74[_0x4ece86];return _0x157e8e;};'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 _0xe14b=['/describe','show','/:id/members','/:id/teams','getTeams','/:id/users','getAgents','post','create','addTeams','addAgents','put','/:id','delete','destroy','removeAgents','exports','multer','util','express','Router','../../components/auth/service','./chatQueue.controller','get','isAuthenticated','index'];(function(_0x95eba9,_0x41c502){var _0x4cec3f=function(_0x42e18c){while(--_0x42e18c){_0x95eba9['push'](_0x95eba9['shift']());}};_0x4cec3f(++_0x41c502);}(_0xe14b,0x93));var _0xbe14=function(_0x2b76e6,_0x11f93c){_0x2b76e6=_0x2b76e6-0x0;var _0x36fd04=_0xe14b[_0x2b76e6];return _0x36fd04;};'use strict';var multer=require(_0xbe14('0x0'));var util=require(_0xbe14('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0xbe14('0x2'));var router=express[_0xbe14('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0xbe14('0x4'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0xbe14('0x5'));router[_0xbe14('0x6')]('/',auth[_0xbe14('0x7')](),controller[_0xbe14('0x8')]);router[_0xbe14('0x6')](_0xbe14('0x9'),auth[_0xbe14('0x7')](),controller['describe']);router['get']('/:id',auth[_0xbe14('0x7')](),controller[_0xbe14('0xa')]);router[_0xbe14('0x6')](_0xbe14('0xb'),auth['isAuthenticated'](),controller['getMembers']);router[_0xbe14('0x6')](_0xbe14('0xc'),auth['isAuthenticated'](),controller[_0xbe14('0xd')]);router[_0xbe14('0x6')](_0xbe14('0xe'),auth[_0xbe14('0x7')](),controller[_0xbe14('0xf')]);router[_0xbe14('0x10')]('/',auth[_0xbe14('0x7')](),controller[_0xbe14('0x11')]);router[_0xbe14('0x10')](_0xbe14('0xc'),auth[_0xbe14('0x7')](),controller[_0xbe14('0x12')]);router[_0xbe14('0x10')]('/:id/users',auth['isAuthenticated'](),controller[_0xbe14('0x13')]);router[_0xbe14('0x14')](_0xbe14('0x15'),auth[_0xbe14('0x7')](),controller['update']);router[_0xbe14('0x16')](_0xbe14('0x15'),auth[_0xbe14('0x7')](),controller[_0xbe14('0x17')]);router[_0xbe14('0x16')](_0xbe14('0xc'),auth[_0xbe14('0x7')](),controller['removeTeams']);router[_0xbe14('0x16')](_0xbe14('0xe'),auth[_0xbe14('0x7')](),controller[_0xbe14('0x18')]);module[_0xbe14('0x19')]=router;
\ No newline at end of file
diff --git a/server/api/chatQueueReport/chatQueueReport.attributes.js b/server/api/chatQueueReport/chatQueueReport.attributes.js
index 819b0d3..9331309 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 _0xeb69=['STRING','DATE','moment','sequelize','exports'];(function(_0xfae23b,_0x2be4ba){var _0x200640=function(_0x4ae258){while(--_0x4ae258){_0xfae23b['push'](_0xfae23b['shift']());}};_0x200640(++_0x2be4ba);}(_0xeb69,0xf7));var _0x9eb6=function(_0x37f7d5,_0x5222e7){_0x37f7d5=_0x37f7d5-0x0;var _0x4aa6d8=_0xeb69[_0x37f7d5];return _0x4aa6d8;};'use strict';var moment=require(_0x9eb6('0x0'));var Sequelize=require(_0x9eb6('0x1'));module[_0x9eb6('0x2')]={'uniqueid':{'type':Sequelize['STRING'],'allowNull':![]},'from':{'type':Sequelize[_0x9eb6('0x3')]},'joinAt':{'type':Sequelize[_0x9eb6('0x4')]},'leaveAt':{'type':Sequelize[_0x9eb6('0x4')]},'acceptAt':{'type':Sequelize['DATE']},'exitAt':{'type':Sequelize[_0x9eb6('0x4')]},'reason':{'type':Sequelize[_0x9eb6('0x3')]}};
\ No newline at end of file
+var _0x8143=['sequelize','exports','STRING','DATE'];(function(_0x4ee9cd,_0xd375b0){var _0x328a5b=function(_0x3ad1f4){while(--_0x3ad1f4){_0x4ee9cd['push'](_0x4ee9cd['shift']());}};_0x328a5b(++_0xd375b0);}(_0x8143,0x74));var _0x3814=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0x8143[_0x321bb2];return _0x9c12ed;};'use strict';var moment=require('moment');var Sequelize=require(_0x3814('0x0'));module[_0x3814('0x1')]={'uniqueid':{'type':Sequelize[_0x3814('0x2')],'allowNull':![]},'from':{'type':Sequelize[_0x3814('0x2')]},'joinAt':{'type':Sequelize[_0x3814('0x3')]},'leaveAt':{'type':Sequelize['DATE']},'acceptAt':{'type':Sequelize[_0x3814('0x3')]},'exitAt':{'type':Sequelize[_0x3814('0x3')]},'reason':{'type':Sequelize[_0x3814('0x2')]}};
\ No newline at end of file
diff --git a/server/api/chatQueueReport/chatQueueReport.controller.js b/server/api/chatQueueReport/chatQueueReport.controller.js
index b122614..8207d3f 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 _0xd47f=['nolimit','order','sort','pick','where','type','merge','options','includeAll','ChatQueueReport','findAll','rows','catch','show','find','create','body','params','describe','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','crypto','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','api','../../config/license/util','status','end','json','offset','undefined','count','limit','set','apply','reject','update','destroy','then','sendStatus','error','name','send','index','map','rawAttributes','fieldName','key','query','keys','filters','intersection','model','attributes','fields','length'];(function(_0x3333bd,_0x23cf4c){var _0x5edb96=function(_0x53f786){while(--_0x53f786){_0x3333bd['push'](_0x3333bd['shift']());}};_0x5edb96(++_0x23cf4c);}(_0xd47f,0x1bd));var _0xfd47=function(_0x5a5a98,_0x74f555){_0x5a5a98=_0x5a5a98-0x0;var _0x7d43ef=_0xd47f[_0x5a5a98];return _0x7d43ef;};'use strict';var emlformat=require(_0xfd47('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xfd47('0x1'));var jsonpatch=require(_0xfd47('0x2'));var rp=require(_0xfd47('0x3'));var moment=require(_0xfd47('0x4'));var BPromise=require(_0xfd47('0x5'));var Mustache=require(_0xfd47('0x6'));var util=require(_0xfd47('0x7'));var path=require(_0xfd47('0x8'));var sox=require(_0xfd47('0x9'));var csv=require(_0xfd47('0xa'));var ejs=require(_0xfd47('0xb'));var fs=require('fs');var fs_extra=require(_0xfd47('0xc'));var _=require('lodash');var squel=require('squel');var crypto=require(_0xfd47('0xd'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0xfd47('0xe'));var Papa=require(_0xfd47('0xf'));var Redis=require(_0xfd47('0x10'));var authService=require(_0xfd47('0x11'));var qs=require(_0xfd47('0x12'));var as=require(_0xfd47('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0xfd47('0x14'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0xfd47('0x15'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x4b01ce,_0x4a1e0c){_0x4a1e0c=_0x4a1e0c||0xcc;return function(_0x1bf3ab){if(_0x1bf3ab){return _0x4b01ce['sendStatus'](_0x4a1e0c);}return _0x4b01ce[_0xfd47('0x16')](_0x4a1e0c)[_0xfd47('0x17')]();};}function respondWithResult(_0x3ada2a,_0x49c00a){_0x49c00a=_0x49c00a||0xc8;return function(_0x1cd77f){if(_0x1cd77f){return _0x3ada2a[_0xfd47('0x16')](_0x49c00a)[_0xfd47('0x18')](_0x1cd77f);}};}function respondWithFilteredResult(_0x24873a,_0x584fe1){return function(_0x791937){if(_0x791937){var _0x1011a3=typeof _0x584fe1[_0xfd47('0x19')]==='undefined'&&typeof _0x584fe1['limit']===_0xfd47('0x1a');var _0xf8e74b=_0x791937[_0xfd47('0x1b')];var _0xf1bbb=_0x1011a3?0x0:_0x584fe1[_0xfd47('0x19')];var _0x4d2d27=_0x1011a3?_0x791937[_0xfd47('0x1b')]:_0x584fe1[_0xfd47('0x19')]+_0x584fe1[_0xfd47('0x1c')];var _0x231106;if(_0x4d2d27>=_0xf8e74b){_0x4d2d27=_0xf8e74b;_0x231106=0xc8;}else{_0x231106=0xce;}_0x24873a[_0xfd47('0x16')](_0x231106);return _0x24873a[_0xfd47('0x1d')]('Content-Range',_0xf1bbb+'-'+_0x4d2d27+'/'+_0xf8e74b)[_0xfd47('0x18')](_0x791937);}return null;};}function patchUpdates(_0x59239c){return function(_0x411680){try{jsonpatch[_0xfd47('0x1e')](_0x411680,_0x59239c,!![]);}catch(_0x4153f6){return BPromise[_0xfd47('0x1f')](_0x4153f6);}return _0x411680['save']();};}function saveUpdates(_0x45e681,_0x29a2dd){return function(_0x943c8a){if(_0x943c8a){return _0x943c8a[_0xfd47('0x20')](_0x45e681)['then'](function(_0x511dbd){return _0x511dbd;});}return null;};}function removeEntity(_0x285f2a,_0xc06999){return function(_0x4395ba){if(_0x4395ba){return _0x4395ba[_0xfd47('0x21')]()[_0xfd47('0x22')](function(){_0x285f2a['status'](0xcc)[_0xfd47('0x17')]();});}};}function handleEntityNotFound(_0x5ca823,_0x48ec3a){return function(_0x26e5fa){if(!_0x26e5fa){_0x5ca823[_0xfd47('0x23')](0x194);}return _0x26e5fa;};}function handleError(_0x2d319a,_0x1905df){_0x1905df=_0x1905df||0x1f4;return function(_0xcce2e3){logger[_0xfd47('0x24')](_0xcce2e3['stack']);if(_0xcce2e3[_0xfd47('0x25')]){delete _0xcce2e3[_0xfd47('0x25')];}_0x2d319a[_0xfd47('0x16')](_0x1905df)[_0xfd47('0x26')](_0xcce2e3);};}exports[_0xfd47('0x27')]=function(_0x4c9a78,_0x120c38){var _0x46c3f8={},_0x3dfd47={},_0x332f6f={'count':0x0,'rows':[]};var _0x1500e9=_[_0xfd47('0x28')](db['ChatQueueReport'][_0xfd47('0x29')],function(_0x3d415b){return{'name':_0x3d415b[_0xfd47('0x2a')],'type':_0x3d415b['type'][_0xfd47('0x2b')]};});_0x3dfd47['model']=_[_0xfd47('0x28')](_0x1500e9,'name');_0x3dfd47[_0xfd47('0x2c')]=_[_0xfd47('0x2d')](_0x4c9a78['query']);_0x3dfd47[_0xfd47('0x2e')]=_[_0xfd47('0x2f')](_0x3dfd47[_0xfd47('0x30')],_0x3dfd47[_0xfd47('0x2c')]);_0x46c3f8[_0xfd47('0x31')]=_[_0xfd47('0x2f')](_0x3dfd47[_0xfd47('0x30')],qs['fields'](_0x4c9a78[_0xfd47('0x2c')][_0xfd47('0x32')]));_0x46c3f8['attributes']=_0x46c3f8[_0xfd47('0x31')][_0xfd47('0x33')]?_0x46c3f8[_0xfd47('0x31')]:_0x3dfd47['model'];if(!_0x4c9a78[_0xfd47('0x2c')]['hasOwnProperty'](_0xfd47('0x34'))){_0x46c3f8[_0xfd47('0x1c')]=qs['limit'](_0x4c9a78[_0xfd47('0x2c')][_0xfd47('0x1c')]);_0x46c3f8[_0xfd47('0x19')]=qs['offset'](_0x4c9a78[_0xfd47('0x2c')][_0xfd47('0x19')]);}_0x46c3f8[_0xfd47('0x35')]=qs['sort'](_0x4c9a78[_0xfd47('0x2c')][_0xfd47('0x36')]);_0x46c3f8['where']=qs[_0xfd47('0x2e')](_[_0xfd47('0x37')](_0x4c9a78['query'],_0x3dfd47['filters']),_0x1500e9);if(_0x4c9a78[_0xfd47('0x2c')]['filter']){_0x46c3f8[_0xfd47('0x38')]=_['merge'](_0x46c3f8[_0xfd47('0x38')],{'$or':_[_0xfd47('0x28')](_0x1500e9,function(_0x4b81ab){if(_0x4b81ab[_0xfd47('0x39')]!=='VIRTUAL'){var _0x5db418={};_0x5db418[_0x4b81ab['name']]={'$like':'%'+_0x4c9a78[_0xfd47('0x2c')]['filter']+'%'};return _0x5db418;}})});}_0x46c3f8=_[_0xfd47('0x3a')]({},_0x46c3f8,_0x4c9a78[_0xfd47('0x3b')]);var _0x2c70a8={'where':_0x46c3f8['where']};return db['ChatQueueReport']['count'](_0x2c70a8)[_0xfd47('0x22')](function(_0x420ce0){_0x332f6f[_0xfd47('0x1b')]=_0x420ce0;if(_0x4c9a78[_0xfd47('0x2c')][_0xfd47('0x3c')]){_0x46c3f8['include']=[{'all':!![]}];}return db[_0xfd47('0x3d')][_0xfd47('0x3e')](_0x46c3f8);})[_0xfd47('0x22')](function(_0x22d967){_0x332f6f[_0xfd47('0x3f')]=_0x22d967;return _0x332f6f;})[_0xfd47('0x22')](respondWithFilteredResult(_0x120c38,_0x46c3f8))[_0xfd47('0x40')](handleError(_0x120c38,null));};exports[_0xfd47('0x41')]=function(_0x3aff8f,_0x4158dc){var _0x3c4b7c={'raw':!![],'where':{'id':_0x3aff8f['params']['id']}},_0x11e823={};_0x11e823[_0xfd47('0x30')]=_[_0xfd47('0x2d')](db[_0xfd47('0x3d')][_0xfd47('0x29')]);_0x11e823[_0xfd47('0x2c')]=_[_0xfd47('0x2d')](_0x3aff8f['query']);_0x11e823[_0xfd47('0x2e')]=_[_0xfd47('0x2f')](_0x11e823[_0xfd47('0x30')],_0x11e823['query']);_0x3c4b7c[_0xfd47('0x31')]=_[_0xfd47('0x2f')](_0x11e823[_0xfd47('0x30')],qs[_0xfd47('0x32')](_0x3aff8f[_0xfd47('0x2c')][_0xfd47('0x32')]));_0x3c4b7c[_0xfd47('0x31')]=_0x3c4b7c['attributes'][_0xfd47('0x33')]?_0x3c4b7c[_0xfd47('0x31')]:_0x11e823[_0xfd47('0x30')];if(_0x3aff8f['query'][_0xfd47('0x3c')]){_0x3c4b7c['include']=[{'all':!![]}];}_0x3c4b7c=_[_0xfd47('0x3a')]({},_0x3c4b7c,_0x3aff8f[_0xfd47('0x3b')]);return db['ChatQueueReport'][_0xfd47('0x42')](_0x3c4b7c)[_0xfd47('0x22')](handleEntityNotFound(_0x4158dc,null))[_0xfd47('0x22')](respondWithResult(_0x4158dc,null))[_0xfd47('0x40')](handleError(_0x4158dc,null));};exports['create']=function(_0x9adf23,_0x50e41a){return db['ChatQueueReport'][_0xfd47('0x43')](_0x9adf23[_0xfd47('0x44')],{})['then'](respondWithResult(_0x50e41a,0xc9))[_0xfd47('0x40')](handleError(_0x50e41a,null));};exports[_0xfd47('0x20')]=function(_0x48a995,_0x45ed3f){if(_0x48a995[_0xfd47('0x44')]['id']){delete _0x48a995[_0xfd47('0x44')]['id'];}return db[_0xfd47('0x3d')][_0xfd47('0x42')]({'where':{'id':_0x48a995['params']['id']}})[_0xfd47('0x22')](handleEntityNotFound(_0x45ed3f,null))[_0xfd47('0x22')](saveUpdates(_0x48a995[_0xfd47('0x44')],null))['then'](respondWithResult(_0x45ed3f,null))['catch'](handleError(_0x45ed3f,null));};exports[_0xfd47('0x21')]=function(_0x44df07,_0x56fa32){return db[_0xfd47('0x3d')][_0xfd47('0x42')]({'where':{'id':_0x44df07[_0xfd47('0x45')]['id']}})[_0xfd47('0x22')](handleEntityNotFound(_0x56fa32,null))['then'](removeEntity(_0x56fa32,null))[_0xfd47('0x40')](handleError(_0x56fa32,null));};exports[_0xfd47('0x46')]=function(_0x1bd4ba,_0x5c9bd0){return db[_0xfd47('0x3d')][_0xfd47('0x46')]()['then'](respondWithResult(_0x5c9bd0,null))[_0xfd47('0x40')](handleError(_0x5c9bd0,null));};
\ No newline at end of file
+var _0x0f9f=['then','includeAll','include','findAll','rows','catch','show','params','keys','length','find','create','body','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','ejs','fs-extra','squel','crypto','jsforce','to-csv','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','offset','undefined','limit','count','Content-Range','apply','reject','save','update','destroy','end','error','stack','name','send','index','ChatQueueReport','rawAttributes','fieldName','type','key','model','map','query','filters','attributes','intersection','fields','nolimit','order','sort','where','pick','merge','VIRTUAL','options'];(function(_0x49a15e,_0x1fba32){var _0x19e9b5=function(_0x147e4d){while(--_0x147e4d){_0x49a15e['push'](_0x49a15e['shift']());}};_0x19e9b5(++_0x1fba32);}(_0x0f9f,0xae));var _0xf0f9=function(_0x2ef60e,_0x35c32c){_0x2ef60e=_0x2ef60e-0x0;var _0x3be207=_0x0f9f[_0x2ef60e];return _0x3be207;};'use strict';var emlformat=require(_0xf0f9('0x0'));var rimraf=require(_0xf0f9('0x1'));var zipdir=require(_0xf0f9('0x2'));var jsonpatch=require(_0xf0f9('0x3'));var rp=require(_0xf0f9('0x4'));var moment=require(_0xf0f9('0x5'));var BPromise=require(_0xf0f9('0x6'));var Mustache=require(_0xf0f9('0x7'));var util=require(_0xf0f9('0x8'));var path=require(_0xf0f9('0x9'));var sox=require(_0xf0f9('0xa'));var csv=require('to-csv');var ejs=require(_0xf0f9('0xb'));var fs=require('fs');var fs_extra=require(_0xf0f9('0xc'));var _=require('lodash');var squel=require(_0xf0f9('0xd'));var crypto=require(_0xf0f9('0xe'));var jsforce=require(_0xf0f9('0xf'));var deskjs=require('desk.js');var toCsv=require(_0xf0f9('0x10'));var querystring=require(_0xf0f9('0x11'));var Papa=require('papaparse');var Redis=require(_0xf0f9('0x12'));var authService=require(_0xf0f9('0x13'));var qs=require(_0xf0f9('0x14'));var as=require(_0xf0f9('0x15'));var hardwareService=require(_0xf0f9('0x16'));var logger=require(_0xf0f9('0x17'))(_0xf0f9('0x18'));var utils=require(_0xf0f9('0x19'));var config=require('../../config/environment');var licenseUtil=require(_0xf0f9('0x1a'));var db=require(_0xf0f9('0x1b'))['db'];function respondWithStatusCode(_0xc23039,_0x458e1c){_0x458e1c=_0x458e1c||0xcc;return function(_0x5b0fa7){if(_0x5b0fa7){return _0xc23039[_0xf0f9('0x1c')](_0x458e1c);}return _0xc23039[_0xf0f9('0x1d')](_0x458e1c)['end']();};}function respondWithResult(_0x334c39,_0x519adf){_0x519adf=_0x519adf||0xc8;return function(_0x538864){if(_0x538864){return _0x334c39[_0xf0f9('0x1d')](_0x519adf)['json'](_0x538864);}};}function respondWithFilteredResult(_0x3e1587,_0x516717){return function(_0x3c23ec){if(_0x3c23ec){var _0x336483=typeof _0x516717[_0xf0f9('0x1e')]===_0xf0f9('0x1f')&&typeof _0x516717[_0xf0f9('0x20')]===_0xf0f9('0x1f');var _0x10dae6=_0x3c23ec['count'];var _0x44d248=_0x336483?0x0:_0x516717[_0xf0f9('0x1e')];var _0x43de16=_0x336483?_0x3c23ec[_0xf0f9('0x21')]:_0x516717[_0xf0f9('0x1e')]+_0x516717[_0xf0f9('0x20')];var _0x1765ad;if(_0x43de16>=_0x10dae6){_0x43de16=_0x10dae6;_0x1765ad=0xc8;}else{_0x1765ad=0xce;}_0x3e1587[_0xf0f9('0x1d')](_0x1765ad);return _0x3e1587['set'](_0xf0f9('0x22'),_0x44d248+'-'+_0x43de16+'/'+_0x10dae6)['json'](_0x3c23ec);}return null;};}function patchUpdates(_0x3664ff){return function(_0x510119){try{jsonpatch[_0xf0f9('0x23')](_0x510119,_0x3664ff,!![]);}catch(_0x1d5965){return BPromise[_0xf0f9('0x24')](_0x1d5965);}return _0x510119[_0xf0f9('0x25')]();};}function saveUpdates(_0xaff53c,_0x1b9740){return function(_0x49bddc){if(_0x49bddc){return _0x49bddc[_0xf0f9('0x26')](_0xaff53c)['then'](function(_0x2cb8f8){return _0x2cb8f8;});}return null;};}function removeEntity(_0x21dd05,_0x55ba89){return function(_0x217a15){if(_0x217a15){return _0x217a15[_0xf0f9('0x27')]()['then'](function(){_0x21dd05[_0xf0f9('0x1d')](0xcc)[_0xf0f9('0x28')]();});}};}function handleEntityNotFound(_0xa0b46e,_0x27defc){return function(_0x3ce34a){if(!_0x3ce34a){_0xa0b46e[_0xf0f9('0x1c')](0x194);}return _0x3ce34a;};}function handleError(_0x4c7c7c,_0x1849f0){_0x1849f0=_0x1849f0||0x1f4;return function(_0x4c31f2){logger[_0xf0f9('0x29')](_0x4c31f2[_0xf0f9('0x2a')]);if(_0x4c31f2[_0xf0f9('0x2b')]){delete _0x4c31f2[_0xf0f9('0x2b')];}_0x4c7c7c['status'](_0x1849f0)[_0xf0f9('0x2c')](_0x4c31f2);};}exports[_0xf0f9('0x2d')]=function(_0x477eb0,_0x5a435d){var _0x3bcd66={},_0x1cafc0={},_0x5957b1={'count':0x0,'rows':[]};var _0xfd5593=_['map'](db[_0xf0f9('0x2e')][_0xf0f9('0x2f')],function(_0x280681){return{'name':_0x280681[_0xf0f9('0x30')],'type':_0x280681[_0xf0f9('0x31')][_0xf0f9('0x32')]};});_0x1cafc0[_0xf0f9('0x33')]=_[_0xf0f9('0x34')](_0xfd5593,_0xf0f9('0x2b'));_0x1cafc0[_0xf0f9('0x35')]=_['keys'](_0x477eb0[_0xf0f9('0x35')]);_0x1cafc0[_0xf0f9('0x36')]=_['intersection'](_0x1cafc0['model'],_0x1cafc0[_0xf0f9('0x35')]);_0x3bcd66[_0xf0f9('0x37')]=_[_0xf0f9('0x38')](_0x1cafc0[_0xf0f9('0x33')],qs[_0xf0f9('0x39')](_0x477eb0[_0xf0f9('0x35')][_0xf0f9('0x39')]));_0x3bcd66['attributes']=_0x3bcd66[_0xf0f9('0x37')]['length']?_0x3bcd66[_0xf0f9('0x37')]:_0x1cafc0[_0xf0f9('0x33')];if(!_0x477eb0[_0xf0f9('0x35')]['hasOwnProperty'](_0xf0f9('0x3a'))){_0x3bcd66['limit']=qs[_0xf0f9('0x20')](_0x477eb0['query']['limit']);_0x3bcd66[_0xf0f9('0x1e')]=qs[_0xf0f9('0x1e')](_0x477eb0[_0xf0f9('0x35')][_0xf0f9('0x1e')]);}_0x3bcd66[_0xf0f9('0x3b')]=qs[_0xf0f9('0x3c')](_0x477eb0['query']['sort']);_0x3bcd66[_0xf0f9('0x3d')]=qs[_0xf0f9('0x36')](_[_0xf0f9('0x3e')](_0x477eb0['query'],_0x1cafc0['filters']),_0xfd5593);if(_0x477eb0[_0xf0f9('0x35')]['filter']){_0x3bcd66[_0xf0f9('0x3d')]=_[_0xf0f9('0x3f')](_0x3bcd66[_0xf0f9('0x3d')],{'$or':_[_0xf0f9('0x34')](_0xfd5593,function(_0x5b19b2){if(_0x5b19b2[_0xf0f9('0x31')]!==_0xf0f9('0x40')){var _0x11ea8f={};_0x11ea8f[_0x5b19b2[_0xf0f9('0x2b')]]={'$like':'%'+_0x477eb0['query']['filter']+'%'};return _0x11ea8f;}})});}_0x3bcd66=_['merge']({},_0x3bcd66,_0x477eb0[_0xf0f9('0x41')]);var _0x458810={'where':_0x3bcd66[_0xf0f9('0x3d')]};return db[_0xf0f9('0x2e')][_0xf0f9('0x21')](_0x458810)[_0xf0f9('0x42')](function(_0xcf598f){_0x5957b1['count']=_0xcf598f;if(_0x477eb0[_0xf0f9('0x35')][_0xf0f9('0x43')]){_0x3bcd66[_0xf0f9('0x44')]=[{'all':!![]}];}return db[_0xf0f9('0x2e')][_0xf0f9('0x45')](_0x3bcd66);})[_0xf0f9('0x42')](function(_0x4eb772){_0x5957b1[_0xf0f9('0x46')]=_0x4eb772;return _0x5957b1;})['then'](respondWithFilteredResult(_0x5a435d,_0x3bcd66))[_0xf0f9('0x47')](handleError(_0x5a435d,null));};exports[_0xf0f9('0x48')]=function(_0x290849,_0x181ed0){var _0x294e57={'raw':!![],'where':{'id':_0x290849[_0xf0f9('0x49')]['id']}},_0x574364={};_0x574364['model']=_[_0xf0f9('0x4a')](db[_0xf0f9('0x2e')][_0xf0f9('0x2f')]);_0x574364[_0xf0f9('0x35')]=_[_0xf0f9('0x4a')](_0x290849[_0xf0f9('0x35')]);_0x574364['filters']=_[_0xf0f9('0x38')](_0x574364[_0xf0f9('0x33')],_0x574364[_0xf0f9('0x35')]);_0x294e57['attributes']=_[_0xf0f9('0x38')](_0x574364['model'],qs[_0xf0f9('0x39')](_0x290849['query']['fields']));_0x294e57['attributes']=_0x294e57['attributes'][_0xf0f9('0x4b')]?_0x294e57['attributes']:_0x574364[_0xf0f9('0x33')];if(_0x290849[_0xf0f9('0x35')]['includeAll']){_0x294e57[_0xf0f9('0x44')]=[{'all':!![]}];}_0x294e57=_[_0xf0f9('0x3f')]({},_0x294e57,_0x290849[_0xf0f9('0x41')]);return db[_0xf0f9('0x2e')][_0xf0f9('0x4c')](_0x294e57)['then'](handleEntityNotFound(_0x181ed0,null))[_0xf0f9('0x42')](respondWithResult(_0x181ed0,null))[_0xf0f9('0x47')](handleError(_0x181ed0,null));};exports[_0xf0f9('0x4d')]=function(_0x3512d5,_0x5601ca){return db[_0xf0f9('0x2e')][_0xf0f9('0x4d')](_0x3512d5[_0xf0f9('0x4e')],{})[_0xf0f9('0x42')](respondWithResult(_0x5601ca,0xc9))[_0xf0f9('0x47')](handleError(_0x5601ca,null));};exports[_0xf0f9('0x26')]=function(_0x3dd389,_0x299cec){if(_0x3dd389[_0xf0f9('0x4e')]['id']){delete _0x3dd389[_0xf0f9('0x4e')]['id'];}return db[_0xf0f9('0x2e')][_0xf0f9('0x4c')]({'where':{'id':_0x3dd389['params']['id']}})[_0xf0f9('0x42')](handleEntityNotFound(_0x299cec,null))[_0xf0f9('0x42')](saveUpdates(_0x3dd389[_0xf0f9('0x4e')],null))['then'](respondWithResult(_0x299cec,null))[_0xf0f9('0x47')](handleError(_0x299cec,null));};exports[_0xf0f9('0x27')]=function(_0xa003e7,_0x1fe3b7){return db[_0xf0f9('0x2e')][_0xf0f9('0x4c')]({'where':{'id':_0xa003e7[_0xf0f9('0x49')]['id']}})[_0xf0f9('0x42')](handleEntityNotFound(_0x1fe3b7,null))['then'](removeEntity(_0x1fe3b7,null))[_0xf0f9('0x47')](handleError(_0x1fe3b7,null));};exports[_0xf0f9('0x4f')]=function(_0x5d3756,_0x56c5e8){return db[_0xf0f9('0x2e')][_0xf0f9('0x4f')]()[_0xf0f9('0x42')](respondWithResult(_0x56c5e8,null))['catch'](handleError(_0x56c5e8,null));};
\ No newline at end of file
diff --git a/server/api/chatQueueReport/chatQueueReport.model.js b/server/api/chatQueueReport/chatQueueReport.model.js
index fbfbdfb..2af0748 100644
--- a/server/api/chatQueueReport/chatQueueReport.model.js
+++ b/server/api/chatQueueReport/chatQueueReport.model.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xb7e7=['../../config/logger','moment','request-promise','rimraf','../../config/environment','./chatQueueReport.attributes','define','ChatQueueReport','uniqueid','lodash'];(function(_0x15d032,_0x14f9f2){var _0x36cff2=function(_0x1411e1){while(--_0x1411e1){_0x15d032['push'](_0x15d032['shift']());}};_0x36cff2(++_0x14f9f2);}(_0xb7e7,0x121));var _0x7b7e=function(_0x342700,_0x569f75){_0x342700=_0x342700-0x0;var _0x53406f=_0xb7e7[_0x342700];return _0x53406f;};'use strict';var _=require(_0x7b7e('0x0'));var util=require('util');var logger=require(_0x7b7e('0x1'))('api');var moment=require(_0x7b7e('0x2'));var BPromise=require('bluebird');var rp=require(_0x7b7e('0x3'));var fs=require('fs');var path=require('path');var rimraf=require(_0x7b7e('0x4'));var config=require(_0x7b7e('0x5'));var attributes=require(_0x7b7e('0x6'));module['exports']=function(_0x53ed64,_0x333fa4){return _0x53ed64[_0x7b7e('0x7')](_0x7b7e('0x8'),attributes,{'tableName':'report_chat_queue','paranoid':![],'indexes':[{'name':_0x7b7e('0x9'),'fields':[_0x7b7e('0x9')]}],'timestamps':!![]});};
\ No newline at end of file
+var _0x0713=['../../config/logger','api','moment','bluebird','request-promise','rimraf','../../config/environment','./chatQueueReport.attributes','exports','define','ChatQueueReport','report_chat_queue','uniqueid'];(function(_0x49beea,_0x47add1){var _0x27693a=function(_0x192ed8){while(--_0x192ed8){_0x49beea['push'](_0x49beea['shift']());}};_0x27693a(++_0x47add1);}(_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 b202a2e..b51faa5 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 _0x3d78=['../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','request','info','ChatQueueReport,\x20%s,\x20%s','request\x20sent','debug','ChatQueueReport,\x20%s,\x20%s,\x20%s','error','code','message','result','CreateChatQueueReport','create','body','options','then','stringify','catch','UpdateChatQueueReport','ChatQueueReport','where','limit','util','bluebird','randomstring','ioredis'];(function(_0x491cbe,_0x45c8ba){var _0x59449d=function(_0x21b463){while(--_0x21b463){_0x491cbe['push'](_0x491cbe['shift']());}};_0x59449d(++_0x45c8ba);}(_0x3d78,0x19c));var _0x83d7=function(_0xabfca,_0x57d1d2){_0xabfca=_0xabfca-0x0;var _0x2a77e6=_0x3d78[_0xabfca];return _0x2a77e6;};'use strict';var _=require('lodash');var util=require(_0x83d7('0x0'));var moment=require('moment');var BPromise=require(_0x83d7('0x1'));var rs=require(_0x83d7('0x2'));var fs=require('fs');var Redis=require(_0x83d7('0x3'));var db=require(_0x83d7('0x4'))['db'];var utils=require(_0x83d7('0x5'));var logger=require(_0x83d7('0x6'))(_0x83d7('0x7'));var config=require(_0x83d7('0x8'));var jayson=require('jayson/promise');var client=jayson[_0x83d7('0x9')][_0x83d7('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x26838e,_0x3e49ac,_0x41b681){return new BPromise(function(_0x302012,_0x5ce2e0){return client[_0x83d7('0xb')](_0x26838e,_0x41b681)['then'](function(_0x1c49cc){logger[_0x83d7('0xc')](_0x83d7('0xd'),_0x3e49ac,_0x83d7('0xe'));logger[_0x83d7('0xf')](_0x83d7('0x10'),_0x3e49ac,_0x83d7('0xe'),JSON['stringify'](_0x1c49cc));if(_0x1c49cc[_0x83d7('0x11')]){if(_0x1c49cc[_0x83d7('0x11')][_0x83d7('0x12')]===0x1f4){logger['error'](_0x83d7('0xd'),_0x3e49ac,_0x1c49cc[_0x83d7('0x11')][_0x83d7('0x13')]);return _0x5ce2e0(_0x1c49cc[_0x83d7('0x11')][_0x83d7('0x13')]);}logger[_0x83d7('0x11')](_0x83d7('0xd'),_0x3e49ac,_0x1c49cc[_0x83d7('0x11')][_0x83d7('0x13')]);return _0x302012(_0x1c49cc[_0x83d7('0x11')][_0x83d7('0x13')]);}else{logger[_0x83d7('0xc')](_0x83d7('0xd'),_0x3e49ac,_0x83d7('0xe'));_0x302012(_0x1c49cc[_0x83d7('0x14')][_0x83d7('0x13')]);}})['catch'](function(_0x4152f3){logger['error']('ChatQueueReport,\x20%s,\x20%s',_0x3e49ac,_0x4152f3);_0x5ce2e0(_0x4152f3);});});}exports[_0x83d7('0x15')]=function(_0x2b2b92){var _0x573b4c=this;return new Promise(function(_0x15b6e1,_0x5e415a){return db['ChatQueueReport'][_0x83d7('0x16')](_0x2b2b92[_0x83d7('0x17')],{'raw':_0x2b2b92[_0x83d7('0x18')]?_0x2b2b92[_0x83d7('0x18')]['raw']===undefined?!![]:![]:!![]})[_0x83d7('0x19')](function(_0x5b35b2){logger['info'](_0x83d7('0x15'),_0x2b2b92);logger[_0x83d7('0xf')]('CreateChatQueueReport',_0x2b2b92,JSON[_0x83d7('0x1a')](_0x5b35b2));_0x15b6e1(_0x5b35b2);})[_0x83d7('0x1b')](function(_0x3ba37f){logger[_0x83d7('0x11')](_0x83d7('0x15'),_0x3ba37f['message'],_0x2b2b92);_0x5e415a(_0x573b4c[_0x83d7('0x11')](0x1f4,_0x3ba37f[_0x83d7('0x13')]));});});};exports[_0x83d7('0x1c')]=function(_0x450f74){var _0x20d80b=this;return new Promise(function(_0x203eec,_0x1a6bac){return db[_0x83d7('0x1d')]['update'](_0x450f74['body'],{'raw':_0x450f74[_0x83d7('0x18')]?_0x450f74['options']['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x450f74[_0x83d7('0x18')]?_0x450f74[_0x83d7('0x18')][_0x83d7('0x1e')]||null:null,'attributes':_0x450f74[_0x83d7('0x18')]?_0x450f74[_0x83d7('0x18')]['attributes']||null:null,'limit':_0x450f74['options']?_0x450f74[_0x83d7('0x18')][_0x83d7('0x1f')]||null:null})[_0x83d7('0x19')](function(_0x3bc202){logger[_0x83d7('0xc')](_0x83d7('0x1c'),_0x450f74);logger['debug']('UpdateChatQueueReport',_0x450f74,JSON[_0x83d7('0x1a')](_0x3bc202));_0x203eec(_0x3bc202);})['catch'](function(_0x399f3d){logger[_0x83d7('0x11')](_0x83d7('0x1c'),_0x399f3d[_0x83d7('0x13')],_0x450f74);_0x1a6bac(_0x20d80b['error'](0x1f4,_0x399f3d[_0x83d7('0x13')]));});});};
\ No newline at end of file
+var _0x813c=['attributes','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','http','request','then','info','ChatQueueReport,\x20%s,\x20%s','request\x20sent','ChatQueueReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','CreateChatQueueReport','body','options','raw','debug','UpdateChatQueueReport','update','where'];(function(_0x23db19,_0x4ac567){var _0x3becef=function(_0x14a37b){while(--_0x14a37b){_0x23db19['push'](_0x23db19['shift']());}};_0x3becef(++_0x4ac567);}(_0x813c,0x169));var _0xc813=function(_0x20ab23,_0x516530){_0x20ab23=_0x20ab23-0x0;var _0x44dc5a=_0x813c[_0x20ab23];return _0x44dc5a;};'use strict';var _=require('lodash');var util=require(_0xc813('0x0'));var moment=require(_0xc813('0x1'));var BPromise=require(_0xc813('0x2'));var rs=require(_0xc813('0x3'));var fs=require('fs');var Redis=require(_0xc813('0x4'));var db=require(_0xc813('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0xc813('0x6'))(_0xc813('0x7'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson['client'][_0xc813('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x26833c,_0x362188,_0x1e5706){return new BPromise(function(_0x327468,_0x352385){return client[_0xc813('0x9')](_0x26833c,_0x1e5706)[_0xc813('0xa')](function(_0x4cd271){logger[_0xc813('0xb')](_0xc813('0xc'),_0x362188,_0xc813('0xd'));logger['debug'](_0xc813('0xe'),_0x362188,_0xc813('0xd'),JSON[_0xc813('0xf')](_0x4cd271));if(_0x4cd271[_0xc813('0x10')]){if(_0x4cd271[_0xc813('0x10')][_0xc813('0x11')]===0x1f4){logger['error'](_0xc813('0xc'),_0x362188,_0x4cd271[_0xc813('0x10')]['message']);return _0x352385(_0x4cd271[_0xc813('0x10')]['message']);}logger[_0xc813('0x10')](_0xc813('0xc'),_0x362188,_0x4cd271[_0xc813('0x10')][_0xc813('0x12')]);return _0x327468(_0x4cd271[_0xc813('0x10')]['message']);}else{logger[_0xc813('0xb')](_0xc813('0xc'),_0x362188,'request\x20sent');_0x327468(_0x4cd271[_0xc813('0x13')][_0xc813('0x12')]);}})[_0xc813('0x14')](function(_0x21282c){logger[_0xc813('0x10')]('ChatQueueReport,\x20%s,\x20%s',_0x362188,_0x21282c);_0x352385(_0x21282c);});});}exports[_0xc813('0x15')]=function(_0x1fc7ce){var _0xdb8fdf=this;return new Promise(function(_0x255296,_0x376c84){return db['ChatQueueReport']['create'](_0x1fc7ce[_0xc813('0x16')],{'raw':_0x1fc7ce[_0xc813('0x17')]?_0x1fc7ce[_0xc813('0x17')][_0xc813('0x18')]===undefined?!![]:![]:!![]})[_0xc813('0xa')](function(_0x2ecc79){logger[_0xc813('0xb')]('CreateChatQueueReport',_0x1fc7ce);logger[_0xc813('0x19')](_0xc813('0x15'),_0x1fc7ce,JSON[_0xc813('0xf')](_0x2ecc79));_0x255296(_0x2ecc79);})['catch'](function(_0x1f8d81){logger[_0xc813('0x10')](_0xc813('0x15'),_0x1f8d81[_0xc813('0x12')],_0x1fc7ce);_0x376c84(_0xdb8fdf[_0xc813('0x10')](0x1f4,_0x1f8d81['message']));});});};exports[_0xc813('0x1a')]=function(_0x14d351){var _0x18fbad=this;return new Promise(function(_0x1b3596,_0x49be2e){return db['ChatQueueReport'][_0xc813('0x1b')](_0x14d351['body'],{'raw':_0x14d351[_0xc813('0x17')]?_0x14d351[_0xc813('0x17')][_0xc813('0x18')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x14d351['options']?_0x14d351[_0xc813('0x17')][_0xc813('0x1c')]||null:null,'attributes':_0x14d351['options']?_0x14d351[_0xc813('0x17')][_0xc813('0x1d')]||null:null,'limit':_0x14d351[_0xc813('0x17')]?_0x14d351['options']['limit']||null:null})[_0xc813('0xa')](function(_0x3a7798){logger[_0xc813('0xb')](_0xc813('0x1a'),_0x14d351);logger[_0xc813('0x19')](_0xc813('0x1a'),_0x14d351,JSON['stringify'](_0x3a7798));_0x1b3596(_0x3a7798);})[_0xc813('0x14')](function(_0x137f57){logger[_0xc813('0x10')](_0xc813('0x1a'),_0x137f57[_0xc813('0x12')],_0x14d351);_0x49be2e(_0x18fbad[_0xc813('0x10')](0x1f4,_0x137f57[_0xc813('0x12')]));});});};
\ No newline at end of file
diff --git a/server/api/chatQueueReport/index.js b/server/api/chatQueueReport/index.js
index 1b75a3e..1878428 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 _0x3ad9=['/describe','describe','/:id','show','post','create','put','update','delete','exports','multer','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatQueueReport.controller','get','isAuthenticated','index'];(function(_0x13b02f,_0x462a53){var _0x12e9a6=function(_0x187d57){while(--_0x187d57){_0x13b02f['push'](_0x13b02f['shift']());}};_0x12e9a6(++_0x462a53);}(_0x3ad9,0xc2));var _0x93ad=function(_0x585d09,_0x1274bc){_0x585d09=_0x585d09-0x0;var _0x7d9a14=_0x3ad9[_0x585d09];return _0x7d9a14;};'use strict';var multer=require(_0x93ad('0x0'));var util=require('util');var path=require(_0x93ad('0x1'));var timeout=require(_0x93ad('0x2'));var express=require(_0x93ad('0x3'));var router=express[_0x93ad('0x4')]();var fs_extra=require(_0x93ad('0x5'));var auth=require(_0x93ad('0x6'));var interaction=require(_0x93ad('0x7'));var config=require(_0x93ad('0x8'));var controller=require(_0x93ad('0x9'));router[_0x93ad('0xa')]('/',auth[_0x93ad('0xb')](),controller[_0x93ad('0xc')]);router[_0x93ad('0xa')](_0x93ad('0xd'),auth[_0x93ad('0xb')](),controller[_0x93ad('0xe')]);router[_0x93ad('0xa')](_0x93ad('0xf'),auth[_0x93ad('0xb')](),controller[_0x93ad('0x10')]);router[_0x93ad('0x11')]('/',auth[_0x93ad('0xb')](),controller[_0x93ad('0x12')]);router[_0x93ad('0x13')]('/:id',auth[_0x93ad('0xb')](),controller[_0x93ad('0x14')]);router[_0x93ad('0x15')](_0x93ad('0xf'),auth[_0x93ad('0xb')](),controller['destroy']);module[_0x93ad('0x16')]=router;
\ No newline at end of file
+var _0xf974=['exports','path','Router','../../components/interaction/service','./chatQueueReport.controller','get','isAuthenticated','index','/describe','/:id','show','post','create','put','update','delete','destroy'];(function(_0x3e2c1e,_0x1e8d40){var _0x1c6666=function(_0x190b73){while(--_0x190b73){_0x3e2c1e['push'](_0x3e2c1e['shift']());}};_0x1c6666(++_0x1e8d40);}(_0xf974,0xab));var _0x4f97=function(_0x464b63,_0x3b71a4){_0x464b63=_0x464b63-0x0;var _0xdb1776=_0xf974[_0x464b63];return _0xdb1776;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x4f97('0x0'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x4f97('0x1')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0x4f97('0x2'));var config=require('../../config/environment');var controller=require(_0x4f97('0x3'));router[_0x4f97('0x4')]('/',auth[_0x4f97('0x5')](),controller[_0x4f97('0x6')]);router[_0x4f97('0x4')](_0x4f97('0x7'),auth[_0x4f97('0x5')](),controller['describe']);router[_0x4f97('0x4')](_0x4f97('0x8'),auth[_0x4f97('0x5')](),controller[_0x4f97('0x9')]);router[_0x4f97('0xa')]('/',auth[_0x4f97('0x5')](),controller[_0x4f97('0xb')]);router[_0x4f97('0xc')](_0x4f97('0x8'),auth['isAuthenticated'](),controller[_0x4f97('0xd')]);router[_0x4f97('0xe')](_0x4f97('0x8'),auth[_0x4f97('0x5')](),controller[_0x4f97('0xf')]);module[_0x4f97('0x10')]=router;
\ No newline at end of file
diff --git a/server/api/chatTransferReport/chatTransferReport.attributes.js b/server/api/chatTransferReport/chatTransferReport.attributes.js
index 35ec973..a294b23 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 _0x70e0=['NOW','moment','sequelize','exports','account','agent','queue'];(function(_0x1bbd88,_0x54005f){var _0x1fd440=function(_0x356391){while(--_0x356391){_0x1bbd88['push'](_0x1bbd88['shift']());}};_0x1fd440(++_0x54005f);}(_0x70e0,0x17b));var _0x070e=function(_0x35213f,_0x1a4a25){_0x35213f=_0x35213f-0x0;var _0xfedb93=_0x70e0[_0x35213f];return _0xfedb93;};'use strict';var moment=require(_0x070e('0x0'));var Sequelize=require(_0x070e('0x1'));module[_0x070e('0x2')]={'uniqueid':{'type':Sequelize['STRING'],'allowNull':![]},'type':{'type':Sequelize['ENUM'](_0x070e('0x3'),_0x070e('0x4'),_0x070e('0x5')),'allowNull':![],'defaultValue':_0x070e('0x5')},'transferredAt':{'type':Sequelize['DATE'],'allowNull':![],'defaultValue':Sequelize[_0x070e('0x6')]}};
\ No newline at end of file
+var _0xf3cd=['exports','STRING','ENUM','account','queue','DATE','moment','sequelize'];(function(_0x468d16,_0x17ece7){var _0x55850a=function(_0x4326e2){while(--_0x4326e2){_0x468d16['push'](_0x468d16['shift']());}};_0x55850a(++_0x17ece7);}(_0xf3cd,0xfe));var _0xdf3c=function(_0x49e584,_0x2886f8){_0x49e584=_0x49e584-0x0;var _0x58b1be=_0xf3cd[_0x49e584];return _0x58b1be;};'use strict';var moment=require(_0xdf3c('0x0'));var Sequelize=require(_0xdf3c('0x1'));module[_0xdf3c('0x2')]={'uniqueid':{'type':Sequelize[_0xdf3c('0x3')],'allowNull':![]},'type':{'type':Sequelize[_0xdf3c('0x4')](_0xdf3c('0x5'),'agent',_0xdf3c('0x6')),'allowNull':![],'defaultValue':_0xdf3c('0x6')},'transferredAt':{'type':Sequelize[_0xdf3c('0x7')],'allowNull':![],'defaultValue':Sequelize['NOW']}};
\ No newline at end of file
diff --git a/server/api/chatTransferReport/chatTransferReport.controller.js b/server/api/chatTransferReport/chatTransferReport.controller.js
index bb7db05..86c889c 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 _0x7f76=['count','set','Content-Range','apply','reject','save','update','then','destroy','name','send','index','map','rawAttributes','fieldName','type','model','query','keys','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filters','merge','ChatTransferReport','findAll','rows','show','params','intersection','include','find','catch','create','body','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','ejs','lodash','jsforce','desk.js','to-csv','querystring','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','sendStatus','status','end','json','offset','limit','undefined'];(function(_0x3c977c,_0x301239){var _0x3a257b=function(_0x46c33c){while(--_0x46c33c){_0x3c977c['push'](_0x3c977c['shift']());}};_0x3a257b(++_0x301239);}(_0x7f76,0x1e0));var _0x67f7=function(_0x3c4919,_0x3c3201){_0x3c4919=_0x3c4919-0x0;var _0x29b5f6=_0x7f76[_0x3c4919];return _0x29b5f6;};'use strict';var emlformat=require(_0x67f7('0x0'));var rimraf=require(_0x67f7('0x1'));var zipdir=require(_0x67f7('0x2'));var jsonpatch=require(_0x67f7('0x3'));var rp=require(_0x67f7('0x4'));var moment=require(_0x67f7('0x5'));var BPromise=require(_0x67f7('0x6'));var Mustache=require(_0x67f7('0x7'));var util=require('util');var path=require(_0x67f7('0x8'));var sox=require(_0x67f7('0x9'));var csv=require('to-csv');var ejs=require(_0x67f7('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x67f7('0xb'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x67f7('0xc'));var deskjs=require(_0x67f7('0xd'));var toCsv=require(_0x67f7('0xe'));var querystring=require(_0x67f7('0xf'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x67f7('0x10'));var as=require(_0x67f7('0x11'));var hardwareService=require(_0x67f7('0x12'));var logger=require(_0x67f7('0x13'))(_0x67f7('0x14'));var utils=require(_0x67f7('0x15'));var config=require(_0x67f7('0x16'));var licenseUtil=require(_0x67f7('0x17'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x371fd2,_0x2af5c8){_0x2af5c8=_0x2af5c8||0xcc;return function(_0x355f3e){if(_0x355f3e){return _0x371fd2[_0x67f7('0x18')](_0x2af5c8);}return _0x371fd2[_0x67f7('0x19')](_0x2af5c8)[_0x67f7('0x1a')]();};}function respondWithResult(_0x510504,_0x478170){_0x478170=_0x478170||0xc8;return function(_0x43887b){if(_0x43887b){return _0x510504['status'](_0x478170)[_0x67f7('0x1b')](_0x43887b);}};}function respondWithFilteredResult(_0x2a26f5,_0x4bf7b5){return function(_0x12328c){if(_0x12328c){var _0xd5274a=typeof _0x4bf7b5[_0x67f7('0x1c')]==='undefined'&&typeof _0x4bf7b5[_0x67f7('0x1d')]===_0x67f7('0x1e');var _0xcc8a99=_0x12328c[_0x67f7('0x1f')];var _0x5d909b=_0xd5274a?0x0:_0x4bf7b5[_0x67f7('0x1c')];var _0x1c6ea4=_0xd5274a?_0x12328c[_0x67f7('0x1f')]:_0x4bf7b5['offset']+_0x4bf7b5['limit'];var _0x2dd817;if(_0x1c6ea4>=_0xcc8a99){_0x1c6ea4=_0xcc8a99;_0x2dd817=0xc8;}else{_0x2dd817=0xce;}_0x2a26f5[_0x67f7('0x19')](_0x2dd817);return _0x2a26f5[_0x67f7('0x20')](_0x67f7('0x21'),_0x5d909b+'-'+_0x1c6ea4+'/'+_0xcc8a99)[_0x67f7('0x1b')](_0x12328c);}return null;};}function patchUpdates(_0x320fea){return function(_0x5290e5){try{jsonpatch[_0x67f7('0x22')](_0x5290e5,_0x320fea,!![]);}catch(_0x26ffba){return BPromise[_0x67f7('0x23')](_0x26ffba);}return _0x5290e5[_0x67f7('0x24')]();};}function saveUpdates(_0x503004,_0x2233b5){return function(_0x2bf951){if(_0x2bf951){return _0x2bf951[_0x67f7('0x25')](_0x503004)[_0x67f7('0x26')](function(_0x10f6ab){return _0x10f6ab;});}return null;};}function removeEntity(_0x3e961c,_0x1e8a33){return function(_0x43271e){if(_0x43271e){return _0x43271e[_0x67f7('0x27')]()['then'](function(){_0x3e961c[_0x67f7('0x19')](0xcc)[_0x67f7('0x1a')]();});}};}function handleEntityNotFound(_0x1ee876,_0xe99d22){return function(_0x127bbc){if(!_0x127bbc){_0x1ee876[_0x67f7('0x18')](0x194);}return _0x127bbc;};}function handleError(_0x2a95bc,_0x1da853){_0x1da853=_0x1da853||0x1f4;return function(_0x19d955){logger['error'](_0x19d955['stack']);if(_0x19d955[_0x67f7('0x28')]){delete _0x19d955[_0x67f7('0x28')];}_0x2a95bc[_0x67f7('0x19')](_0x1da853)[_0x67f7('0x29')](_0x19d955);};}exports[_0x67f7('0x2a')]=function(_0x177294,_0xe27fbf){var _0x1617e6={},_0x5835a5={},_0x3c12d9={'count':0x0,'rows':[]};var _0x55d511=_[_0x67f7('0x2b')](db['ChatTransferReport'][_0x67f7('0x2c')],function(_0x5a9b9c){return{'name':_0x5a9b9c[_0x67f7('0x2d')],'type':_0x5a9b9c[_0x67f7('0x2e')]['key']};});_0x5835a5[_0x67f7('0x2f')]=_['map'](_0x55d511,'name');_0x5835a5[_0x67f7('0x30')]=_[_0x67f7('0x31')](_0x177294[_0x67f7('0x30')]);_0x5835a5['filters']=_['intersection'](_0x5835a5['model'],_0x5835a5[_0x67f7('0x30')]);_0x1617e6[_0x67f7('0x32')]=_['intersection'](_0x5835a5[_0x67f7('0x2f')],qs[_0x67f7('0x33')](_0x177294['query'][_0x67f7('0x33')]));_0x1617e6[_0x67f7('0x32')]=_0x1617e6[_0x67f7('0x32')][_0x67f7('0x34')]?_0x1617e6[_0x67f7('0x32')]:_0x5835a5[_0x67f7('0x2f')];if(!_0x177294['query'][_0x67f7('0x35')](_0x67f7('0x36'))){_0x1617e6[_0x67f7('0x1d')]=qs[_0x67f7('0x1d')](_0x177294[_0x67f7('0x30')][_0x67f7('0x1d')]);_0x1617e6[_0x67f7('0x1c')]=qs[_0x67f7('0x1c')](_0x177294[_0x67f7('0x30')]['offset']);}_0x1617e6[_0x67f7('0x37')]=qs[_0x67f7('0x38')](_0x177294[_0x67f7('0x30')][_0x67f7('0x38')]);_0x1617e6[_0x67f7('0x39')]=qs['filters'](_[_0x67f7('0x3a')](_0x177294['query'],_0x5835a5[_0x67f7('0x3b')]),_0x55d511);if(_0x177294['query']['filter']){_0x1617e6['where']=_[_0x67f7('0x3c')](_0x1617e6['where'],{'$or':_['map'](_0x55d511,function(_0x97f7a1){if(_0x97f7a1[_0x67f7('0x2e')]!=='VIRTUAL'){var _0x48758f={};_0x48758f[_0x97f7a1[_0x67f7('0x28')]]={'$like':'%'+_0x177294['query']['filter']+'%'};return _0x48758f;}})});}_0x1617e6=_[_0x67f7('0x3c')]({},_0x1617e6,_0x177294['options']);var _0x557b37={'where':_0x1617e6[_0x67f7('0x39')]};return db[_0x67f7('0x3d')]['count'](_0x557b37)[_0x67f7('0x26')](function(_0x40d22f){_0x3c12d9[_0x67f7('0x1f')]=_0x40d22f;if(_0x177294[_0x67f7('0x30')]['includeAll']){_0x1617e6['include']=[{'all':!![]}];}return db['ChatTransferReport'][_0x67f7('0x3e')](_0x1617e6);})[_0x67f7('0x26')](function(_0x30f8c0){_0x3c12d9[_0x67f7('0x3f')]=_0x30f8c0;return _0x3c12d9;})[_0x67f7('0x26')](respondWithFilteredResult(_0xe27fbf,_0x1617e6))['catch'](handleError(_0xe27fbf,null));};exports[_0x67f7('0x40')]=function(_0x2491bd,_0x502c43){var _0x2fb9c8={'raw':!![],'where':{'id':_0x2491bd[_0x67f7('0x41')]['id']}},_0x2260b3={};_0x2260b3[_0x67f7('0x2f')]=_[_0x67f7('0x31')](db[_0x67f7('0x3d')][_0x67f7('0x2c')]);_0x2260b3['query']=_[_0x67f7('0x31')](_0x2491bd[_0x67f7('0x30')]);_0x2260b3[_0x67f7('0x3b')]=_[_0x67f7('0x42')](_0x2260b3['model'],_0x2260b3[_0x67f7('0x30')]);_0x2fb9c8[_0x67f7('0x32')]=_['intersection'](_0x2260b3[_0x67f7('0x2f')],qs['fields'](_0x2491bd[_0x67f7('0x30')][_0x67f7('0x33')]));_0x2fb9c8[_0x67f7('0x32')]=_0x2fb9c8[_0x67f7('0x32')][_0x67f7('0x34')]?_0x2fb9c8[_0x67f7('0x32')]:_0x2260b3[_0x67f7('0x2f')];if(_0x2491bd[_0x67f7('0x30')]['includeAll']){_0x2fb9c8[_0x67f7('0x43')]=[{'all':!![]}];}_0x2fb9c8=_[_0x67f7('0x3c')]({},_0x2fb9c8,_0x2491bd['options']);return db['ChatTransferReport'][_0x67f7('0x44')](_0x2fb9c8)['then'](handleEntityNotFound(_0x502c43,null))[_0x67f7('0x26')](respondWithResult(_0x502c43,null))[_0x67f7('0x45')](handleError(_0x502c43,null));};exports[_0x67f7('0x46')]=function(_0xcdde4f,_0x462bfb){return db[_0x67f7('0x3d')][_0x67f7('0x46')](_0xcdde4f[_0x67f7('0x47')],{})['then'](respondWithResult(_0x462bfb,0xc9))[_0x67f7('0x45')](handleError(_0x462bfb,null));};exports['update']=function(_0x1ae6b8,_0xe843a1){if(_0x1ae6b8[_0x67f7('0x47')]['id']){delete _0x1ae6b8[_0x67f7('0x47')]['id'];}return db['ChatTransferReport'][_0x67f7('0x44')]({'where':{'id':_0x1ae6b8[_0x67f7('0x41')]['id']}})['then'](handleEntityNotFound(_0xe843a1,null))[_0x67f7('0x26')](saveUpdates(_0x1ae6b8['body'],null))[_0x67f7('0x26')](respondWithResult(_0xe843a1,null))[_0x67f7('0x45')](handleError(_0xe843a1,null));};exports[_0x67f7('0x27')]=function(_0xaa1cfd,_0x56fe29){return db[_0x67f7('0x3d')][_0x67f7('0x44')]({'where':{'id':_0xaa1cfd['params']['id']}})[_0x67f7('0x26')](handleEntityNotFound(_0x56fe29,null))['then'](removeEntity(_0x56fe29,null))[_0x67f7('0x45')](handleError(_0x56fe29,null));};exports[_0x67f7('0x48')]=function(_0x386763,_0x5f0a41){return db[_0x67f7('0x3d')][_0x67f7('0x48')]()['then'](respondWithResult(_0x5f0a41,null))[_0x67f7('0x45')](handleError(_0x5f0a41,null));};
\ No newline at end of file
+var _0x672e=['pick','where','findAll','show','params','keys','length','includeAll','include','merge','catch','create','body','find','describe','eml-format','request-promise','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','sendStatus','status','end','offset','undefined','limit','count','set','Content-Range','json','apply','save','then','destroy','error','stack','name','send','index','map','ChatTransferReport','fieldName','type','model','query','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort'];(function(_0x5ed068,_0x470a7c){var _0x141d2d=function(_0x32ce1a){while(--_0x32ce1a){_0x5ed068['push'](_0x5ed068['shift']());}};_0x141d2d(++_0x470a7c);}(_0x672e,0x9b));var _0xe672=function(_0x39bab8,_0x23d6c2){_0x39bab8=_0x39bab8-0x0;var _0x14ade4=_0x672e[_0x39bab8];return _0x14ade4;};'use strict';var emlformat=require(_0xe672('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0xe672('0x1'));var moment=require('moment');var BPromise=require(_0xe672('0x2'));var Mustache=require(_0xe672('0x3'));var util=require(_0xe672('0x4'));var path=require(_0xe672('0x5'));var sox=require(_0xe672('0x6'));var csv=require(_0xe672('0x7'));var ejs=require(_0xe672('0x8'));var fs=require('fs');var fs_extra=require(_0xe672('0x9'));var _=require(_0xe672('0xa'));var squel=require(_0xe672('0xb'));var crypto=require(_0xe672('0xc'));var jsforce=require(_0xe672('0xd'));var deskjs=require(_0xe672('0xe'));var toCsv=require('to-csv');var querystring=require(_0xe672('0xf'));var Papa=require(_0xe672('0x10'));var Redis=require(_0xe672('0x11'));var authService=require(_0xe672('0x12'));var qs=require(_0xe672('0x13'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xe672('0x14'));var logger=require(_0xe672('0x15'))('api');var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x262924,_0x4fec67){_0x4fec67=_0x4fec67||0xcc;return function(_0x19f156){if(_0x19f156){return _0x262924[_0xe672('0x16')](_0x4fec67);}return _0x262924[_0xe672('0x17')](_0x4fec67)[_0xe672('0x18')]();};}function respondWithResult(_0x453b01,_0x30d7d5){_0x30d7d5=_0x30d7d5||0xc8;return function(_0x38f394){if(_0x38f394){return _0x453b01[_0xe672('0x17')](_0x30d7d5)['json'](_0x38f394);}};}function respondWithFilteredResult(_0x5df333,_0x716626){return function(_0x7bdb4d){if(_0x7bdb4d){var _0x5c60fd=typeof _0x716626[_0xe672('0x19')]===_0xe672('0x1a')&&typeof _0x716626[_0xe672('0x1b')]==='undefined';var _0x369578=_0x7bdb4d[_0xe672('0x1c')];var _0x584433=_0x5c60fd?0x0:_0x716626[_0xe672('0x19')];var _0x1883da=_0x5c60fd?_0x7bdb4d['count']:_0x716626[_0xe672('0x19')]+_0x716626[_0xe672('0x1b')];var _0x400a01;if(_0x1883da>=_0x369578){_0x1883da=_0x369578;_0x400a01=0xc8;}else{_0x400a01=0xce;}_0x5df333['status'](_0x400a01);return _0x5df333[_0xe672('0x1d')](_0xe672('0x1e'),_0x584433+'-'+_0x1883da+'/'+_0x369578)[_0xe672('0x1f')](_0x7bdb4d);}return null;};}function patchUpdates(_0x18380c){return function(_0x500cdf){try{jsonpatch[_0xe672('0x20')](_0x500cdf,_0x18380c,!![]);}catch(_0x459a16){return BPromise['reject'](_0x459a16);}return _0x500cdf[_0xe672('0x21')]();};}function saveUpdates(_0x11afff,_0x589628){return function(_0xfe1057){if(_0xfe1057){return _0xfe1057['update'](_0x11afff)[_0xe672('0x22')](function(_0x15db50){return _0x15db50;});}return null;};}function removeEntity(_0x41f14a,_0x17f439){return function(_0xade1c1){if(_0xade1c1){return _0xade1c1[_0xe672('0x23')]()[_0xe672('0x22')](function(){_0x41f14a['status'](0xcc)[_0xe672('0x18')]();});}};}function handleEntityNotFound(_0x3cd974,_0x414e5e){return function(_0x5a93f7){if(!_0x5a93f7){_0x3cd974[_0xe672('0x16')](0x194);}return _0x5a93f7;};}function handleError(_0x36df39,_0x45e3c5){_0x45e3c5=_0x45e3c5||0x1f4;return function(_0xd03513){logger[_0xe672('0x24')](_0xd03513[_0xe672('0x25')]);if(_0xd03513[_0xe672('0x26')]){delete _0xd03513['name'];}_0x36df39['status'](_0x45e3c5)[_0xe672('0x27')](_0xd03513);};}exports[_0xe672('0x28')]=function(_0x36f1b4,_0x2ea55b){var _0x52af5b={},_0x4b8595={},_0x5f2f83={'count':0x0,'rows':[]};var _0x47190d=_[_0xe672('0x29')](db[_0xe672('0x2a')]['rawAttributes'],function(_0x214133){return{'name':_0x214133[_0xe672('0x2b')],'type':_0x214133[_0xe672('0x2c')]['key']};});_0x4b8595[_0xe672('0x2d')]=_[_0xe672('0x29')](_0x47190d,'name');_0x4b8595[_0xe672('0x2e')]=_['keys'](_0x36f1b4[_0xe672('0x2e')]);_0x4b8595[_0xe672('0x2f')]=_[_0xe672('0x30')](_0x4b8595[_0xe672('0x2d')],_0x4b8595[_0xe672('0x2e')]);_0x52af5b[_0xe672('0x31')]=_[_0xe672('0x30')](_0x4b8595[_0xe672('0x2d')],qs[_0xe672('0x32')](_0x36f1b4[_0xe672('0x2e')]['fields']));_0x52af5b[_0xe672('0x31')]=_0x52af5b[_0xe672('0x31')]['length']?_0x52af5b[_0xe672('0x31')]:_0x4b8595['model'];if(!_0x36f1b4['query'][_0xe672('0x33')](_0xe672('0x34'))){_0x52af5b[_0xe672('0x1b')]=qs[_0xe672('0x1b')](_0x36f1b4['query'][_0xe672('0x1b')]);_0x52af5b[_0xe672('0x19')]=qs['offset'](_0x36f1b4[_0xe672('0x2e')]['offset']);}_0x52af5b[_0xe672('0x35')]=qs[_0xe672('0x36')](_0x36f1b4['query'][_0xe672('0x36')]);_0x52af5b['where']=qs[_0xe672('0x2f')](_[_0xe672('0x37')](_0x36f1b4[_0xe672('0x2e')],_0x4b8595['filters']),_0x47190d);if(_0x36f1b4[_0xe672('0x2e')]['filter']){_0x52af5b[_0xe672('0x38')]=_['merge'](_0x52af5b[_0xe672('0x38')],{'$or':_[_0xe672('0x29')](_0x47190d,function(_0x52b0cd){if(_0x52b0cd[_0xe672('0x2c')]!=='VIRTUAL'){var _0x593b2e={};_0x593b2e[_0x52b0cd['name']]={'$like':'%'+_0x36f1b4[_0xe672('0x2e')]['filter']+'%'};return _0x593b2e;}})});}_0x52af5b=_['merge']({},_0x52af5b,_0x36f1b4['options']);var _0x5e5967={'where':_0x52af5b[_0xe672('0x38')]};return db[_0xe672('0x2a')][_0xe672('0x1c')](_0x5e5967)[_0xe672('0x22')](function(_0xdfa0f6){_0x5f2f83[_0xe672('0x1c')]=_0xdfa0f6;if(_0x36f1b4[_0xe672('0x2e')]['includeAll']){_0x52af5b['include']=[{'all':!![]}];}return db[_0xe672('0x2a')][_0xe672('0x39')](_0x52af5b);})[_0xe672('0x22')](function(_0x4c5346){_0x5f2f83['rows']=_0x4c5346;return _0x5f2f83;})[_0xe672('0x22')](respondWithFilteredResult(_0x2ea55b,_0x52af5b))['catch'](handleError(_0x2ea55b,null));};exports[_0xe672('0x3a')]=function(_0x2ad1e5,_0x30d2a5){var _0x44d69c={'raw':!![],'where':{'id':_0x2ad1e5[_0xe672('0x3b')]['id']}},_0x4f3bf3={};_0x4f3bf3[_0xe672('0x2d')]=_[_0xe672('0x3c')](db['ChatTransferReport']['rawAttributes']);_0x4f3bf3[_0xe672('0x2e')]=_['keys'](_0x2ad1e5[_0xe672('0x2e')]);_0x4f3bf3[_0xe672('0x2f')]=_['intersection'](_0x4f3bf3['model'],_0x4f3bf3[_0xe672('0x2e')]);_0x44d69c[_0xe672('0x31')]=_[_0xe672('0x30')](_0x4f3bf3[_0xe672('0x2d')],qs[_0xe672('0x32')](_0x2ad1e5[_0xe672('0x2e')]['fields']));_0x44d69c[_0xe672('0x31')]=_0x44d69c[_0xe672('0x31')][_0xe672('0x3d')]?_0x44d69c[_0xe672('0x31')]:_0x4f3bf3[_0xe672('0x2d')];if(_0x2ad1e5[_0xe672('0x2e')][_0xe672('0x3e')]){_0x44d69c[_0xe672('0x3f')]=[{'all':!![]}];}_0x44d69c=_[_0xe672('0x40')]({},_0x44d69c,_0x2ad1e5['options']);return db[_0xe672('0x2a')]['find'](_0x44d69c)[_0xe672('0x22')](handleEntityNotFound(_0x30d2a5,null))['then'](respondWithResult(_0x30d2a5,null))[_0xe672('0x41')](handleError(_0x30d2a5,null));};exports[_0xe672('0x42')]=function(_0x15af09,_0x17cb60){return db['ChatTransferReport']['create'](_0x15af09[_0xe672('0x43')],{})[_0xe672('0x22')](respondWithResult(_0x17cb60,0xc9))[_0xe672('0x41')](handleError(_0x17cb60,null));};exports['update']=function(_0x5ac8e0,_0x2b9b13){if(_0x5ac8e0['body']['id']){delete _0x5ac8e0['body']['id'];}return db['ChatTransferReport'][_0xe672('0x44')]({'where':{'id':_0x5ac8e0['params']['id']}})[_0xe672('0x22')](handleEntityNotFound(_0x2b9b13,null))['then'](saveUpdates(_0x5ac8e0[_0xe672('0x43')],null))['then'](respondWithResult(_0x2b9b13,null))[_0xe672('0x41')](handleError(_0x2b9b13,null));};exports[_0xe672('0x23')]=function(_0x3eb924,_0x5886dd){return db[_0xe672('0x2a')][_0xe672('0x44')]({'where':{'id':_0x3eb924[_0xe672('0x3b')]['id']}})[_0xe672('0x22')](handleEntityNotFound(_0x5886dd,null))[_0xe672('0x22')](removeEntity(_0x5886dd,null))[_0xe672('0x41')](handleError(_0x5886dd,null));};exports[_0xe672('0x45')]=function(_0x41c3f9,_0x5266fb){return db['ChatTransferReport'][_0xe672('0x45')]()['then'](respondWithResult(_0x5266fb,null))[_0xe672('0x41')](handleError(_0x5266fb,null));};
\ No newline at end of file
diff --git a/server/api/chatTransferReport/chatTransferReport.model.js b/server/api/chatTransferReport/chatTransferReport.model.js
index b5ad9cc..af7b134 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 _0x429f=['util','api','request-promise','path','rimraf','../../config/environment','./chatTransferReport.attributes','exports','define','ChatTransferReport','uniqueid','lodash'];(function(_0x35fa08,_0x28a465){var _0x57c9a8=function(_0x367eb9){while(--_0x367eb9){_0x35fa08['push'](_0x35fa08['shift']());}};_0x57c9a8(++_0x28a465);}(_0x429f,0x1df));var _0xf429=function(_0x5cdc79,_0x24beb1){_0x5cdc79=_0x5cdc79-0x0;var _0x22ddcf=_0x429f[_0x5cdc79];return _0x22ddcf;};'use strict';var _=require(_0xf429('0x0'));var util=require(_0xf429('0x1'));var logger=require('../../config/logger')(_0xf429('0x2'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0xf429('0x3'));var fs=require('fs');var path=require(_0xf429('0x4'));var rimraf=require(_0xf429('0x5'));var config=require(_0xf429('0x6'));var attributes=require(_0xf429('0x7'));module[_0xf429('0x8')]=function(_0x1c4e14,_0x39f486){return _0x1c4e14[_0xf429('0x9')](_0xf429('0xa'),attributes,{'tableName':'report_chat_transfer','paranoid':![],'indexes':[{'name':'uniqueid','fields':[_0xf429('0xb')]}],'timestamps':!![]});};
\ No newline at end of file
+var _0x1646=['lodash','util','../../config/logger','api','bluebird','request-promise','path','rimraf','../../config/environment','./chatTransferReport.attributes','define','ChatTransferReport','uniqueid'];(function(_0x34daaf,_0x11df92){var _0x3d49d1=function(_0x1671b2){while(--_0x1671b2){_0x34daaf['push'](_0x34daaf['shift']());}};_0x3d49d1(++_0x11df92);}(_0x1646,0x11e));var _0x6164=function(_0x15b399,_0x59db1a){_0x15b399=_0x15b399-0x0;var _0x199f2d=_0x1646[_0x15b399];return _0x199f2d;};'use strict';var _=require(_0x6164('0x0'));var util=require(_0x6164('0x1'));var logger=require(_0x6164('0x2'))(_0x6164('0x3'));var moment=require('moment');var BPromise=require(_0x6164('0x4'));var rp=require(_0x6164('0x5'));var fs=require('fs');var path=require(_0x6164('0x6'));var rimraf=require(_0x6164('0x7'));var config=require(_0x6164('0x8'));var attributes=require(_0x6164('0x9'));module['exports']=function(_0x262f1b,_0x26d669){return _0x262f1b[_0x6164('0xa')](_0x6164('0xb'),attributes,{'tableName':'report_chat_transfer','paranoid':![],'indexes':[{'name':_0x6164('0xc'),'fields':[_0x6164('0xc')]}],'timestamps':!![]});};
\ No newline at end of file
diff --git a/server/api/chatTransferReport/chatTransferReport.rpc.js b/server/api/chatTransferReport/chatTransferReport.rpc.js
index 4a75f55..11c1423 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 _0x2618=['jayson/promise','client','http','request','then','info','ChatTransferReport,\x20%s,\x20%s','debug','ChatTransferReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','request\x20sent','result','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment'];(function(_0x169cab,_0x444117){var _0x1be1bc=function(_0x38876a){while(--_0x38876a){_0x169cab['push'](_0x169cab['shift']());}};_0x1be1bc(++_0x444117);}(_0x2618,0x16d));var _0x8261=function(_0x8310d7,_0x1bd680){_0x8310d7=_0x8310d7-0x0;var _0x368af3=_0x2618[_0x8310d7];return _0x368af3;};'use strict';var _=require('lodash');var util=require(_0x8261('0x0'));var moment=require(_0x8261('0x1'));var BPromise=require(_0x8261('0x2'));var rs=require(_0x8261('0x3'));var fs=require('fs');var Redis=require(_0x8261('0x4'));var db=require(_0x8261('0x5'))['db'];var utils=require(_0x8261('0x6'));var logger=require(_0x8261('0x7'))(_0x8261('0x8'));var config=require(_0x8261('0x9'));var jayson=require(_0x8261('0xa'));var client=jayson[_0x8261('0xb')][_0x8261('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x5d59ea,_0x2f40db,_0x1ff0a1){return new BPromise(function(_0x563b6c,_0x589447){return client[_0x8261('0xd')](_0x5d59ea,_0x1ff0a1)[_0x8261('0xe')](function(_0x4212e5){logger[_0x8261('0xf')](_0x8261('0x10'),_0x2f40db,'request\x20sent');logger[_0x8261('0x11')](_0x8261('0x12'),_0x2f40db,'request\x20sent',JSON[_0x8261('0x13')](_0x4212e5));if(_0x4212e5[_0x8261('0x14')]){if(_0x4212e5[_0x8261('0x14')][_0x8261('0x15')]===0x1f4){logger['error'](_0x8261('0x10'),_0x2f40db,_0x4212e5[_0x8261('0x14')][_0x8261('0x16')]);return _0x589447(_0x4212e5['error']['message']);}logger[_0x8261('0x14')](_0x8261('0x10'),_0x2f40db,_0x4212e5[_0x8261('0x14')][_0x8261('0x16')]);return _0x563b6c(_0x4212e5[_0x8261('0x14')][_0x8261('0x16')]);}else{logger['info'](_0x8261('0x10'),_0x2f40db,_0x8261('0x17'));_0x563b6c(_0x4212e5[_0x8261('0x18')][_0x8261('0x16')]);}})['catch'](function(_0x1cd748){logger['error'](_0x8261('0x10'),_0x2f40db,_0x1cd748);_0x589447(_0x1cd748);});});}
\ No newline at end of file
+var _0xad9e=['lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','jayson/promise','client','request','info','ChatTransferReport,\x20%s,\x20%s','request\x20sent','ChatTransferReport,\x20%s,\x20%s,\x20%s','stringify','error','message','catch'];(function(_0x4c9734,_0x559b03){var _0x308459=function(_0x5093a3){while(--_0x5093a3){_0x4c9734['push'](_0x4c9734['shift']());}};_0x308459(++_0x559b03);}(_0xad9e,0xe4));var _0xead9=function(_0x28c3d6,_0x4fd2ca){_0x28c3d6=_0x28c3d6-0x0;var _0x13f769=_0xad9e[_0x28c3d6];return _0x13f769;};'use strict';var _=require(_0xead9('0x0'));var util=require(_0xead9('0x1'));var moment=require(_0xead9('0x2'));var BPromise=require('bluebird');var rs=require(_0xead9('0x3'));var fs=require('fs');var Redis=require(_0xead9('0x4'));var db=require(_0xead9('0x5'))['db'];var utils=require(_0xead9('0x6'));var logger=require(_0xead9('0x7'))('rpc');var config=require('../../config/environment');var jayson=require(_0xead9('0x8'));var client=jayson[_0xead9('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x5d42d6,_0x31961d,_0x24e951){return new BPromise(function(_0x429288,_0x5a1c81){return client[_0xead9('0xa')](_0x5d42d6,_0x24e951)['then'](function(_0x1f0d50){logger[_0xead9('0xb')](_0xead9('0xc'),_0x31961d,_0xead9('0xd'));logger['debug'](_0xead9('0xe'),_0x31961d,_0xead9('0xd'),JSON[_0xead9('0xf')](_0x1f0d50));if(_0x1f0d50[_0xead9('0x10')]){if(_0x1f0d50['error']['code']===0x1f4){logger[_0xead9('0x10')](_0xead9('0xc'),_0x31961d,_0x1f0d50[_0xead9('0x10')][_0xead9('0x11')]);return _0x5a1c81(_0x1f0d50[_0xead9('0x10')][_0xead9('0x11')]);}logger[_0xead9('0x10')]('ChatTransferReport,\x20%s,\x20%s',_0x31961d,_0x1f0d50['error'][_0xead9('0x11')]);return _0x429288(_0x1f0d50['error'][_0xead9('0x11')]);}else{logger[_0xead9('0xb')](_0xead9('0xc'),_0x31961d,_0xead9('0xd'));_0x429288(_0x1f0d50['result'][_0xead9('0x11')]);}})[_0xead9('0x12')](function(_0x1092f6){logger['error']('ChatTransferReport,\x20%s,\x20%s',_0x31961d,_0x1092f6);_0x5a1c81(_0x1092f6);});});}
\ No newline at end of file
diff --git a/server/api/chatTransferReport/index.js b/server/api/chatTransferReport/index.js
index 384dd3d..9971165 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 _0xb0fd=['describe','/:id','post','create','put','update','delete','destroy','exports','multer','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatTransferReport.controller','get','isAuthenticated'];(function(_0x47b017,_0x52942d){var _0x485638=function(_0x3af023){while(--_0x3af023){_0x47b017['push'](_0x47b017['shift']());}};_0x485638(++_0x52942d);}(_0xb0fd,0x14c));var _0xdb0f=function(_0x5027b1,_0x1409a5){_0x5027b1=_0x5027b1-0x0;var _0x4a46cf=_0xb0fd[_0x5027b1];return _0x4a46cf;};'use strict';var multer=require(_0xdb0f('0x0'));var util=require('util');var path=require('path');var timeout=require(_0xdb0f('0x1'));var express=require('express');var router=express[_0xdb0f('0x2')]();var fs_extra=require(_0xdb0f('0x3'));var auth=require(_0xdb0f('0x4'));var interaction=require(_0xdb0f('0x5'));var config=require(_0xdb0f('0x6'));var controller=require(_0xdb0f('0x7'));router[_0xdb0f('0x8')]('/',auth['isAuthenticated'](),controller['index']);router[_0xdb0f('0x8')]('/describe',auth[_0xdb0f('0x9')](),controller[_0xdb0f('0xa')]);router[_0xdb0f('0x8')](_0xdb0f('0xb'),auth['isAuthenticated'](),controller['show']);router[_0xdb0f('0xc')]('/',auth[_0xdb0f('0x9')](),controller[_0xdb0f('0xd')]);router[_0xdb0f('0xe')]('/:id',auth[_0xdb0f('0x9')](),controller[_0xdb0f('0xf')]);router[_0xdb0f('0x10')](_0xdb0f('0xb'),auth[_0xdb0f('0x9')](),controller[_0xdb0f('0x11')]);module[_0xdb0f('0x12')]=router;
\ No newline at end of file
+var _0x9cae=['create','put','delete','destroy','exports','util','connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment','./chatTransferReport.controller','get','isAuthenticated','/describe','describe','/:id','show','post'];(function(_0x3605e1,_0x15c574){var _0x9f0586=function(_0x4422c4){while(--_0x4422c4){_0x3605e1['push'](_0x3605e1['shift']());}};_0x9f0586(++_0x15c574);}(_0x9cae,0xb9));var _0xe9ca=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x9cae[_0x20a584];return _0x4b41a8;};'use strict';var multer=require('multer');var util=require(_0xe9ca('0x0'));var path=require('path');var timeout=require(_0xe9ca('0x1'));var express=require(_0xe9ca('0x2'));var router=express[_0xe9ca('0x3')]();var fs_extra=require(_0xe9ca('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0xe9ca('0x5'));var config=require(_0xe9ca('0x6'));var controller=require(_0xe9ca('0x7'));router[_0xe9ca('0x8')]('/',auth[_0xe9ca('0x9')](),controller['index']);router[_0xe9ca('0x8')](_0xe9ca('0xa'),auth[_0xe9ca('0x9')](),controller[_0xe9ca('0xb')]);router[_0xe9ca('0x8')](_0xe9ca('0xc'),auth[_0xe9ca('0x9')](),controller[_0xe9ca('0xd')]);router[_0xe9ca('0xe')]('/',auth['isAuthenticated'](),controller[_0xe9ca('0xf')]);router[_0xe9ca('0x10')](_0xe9ca('0xc'),auth[_0xe9ca('0x9')](),controller['update']);router[_0xe9ca('0x11')]('/:id',auth[_0xe9ca('0x9')](),controller[_0xe9ca('0x12')]);module[_0xe9ca('0x13')]=router;
\ No newline at end of file
diff --git a/server/api/chatWebsite/chatWebsite.attributes.js b/server/api/chatWebsite/chatWebsite.attributes.js
index 2f96570..d5da5a8 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 _0x400d=['STRING','address','email','#ffffff','BOOLEAN','ENUM','rounded','squared','We\x20are\x20here!','Chat','Powered\x20by\x20xCALLY','TEXT','Do\x20you\x20want\x20to\x20close\x20the\x20interaction?','Note','Thanks\x20you\x20for\x20your\x20time!','Send','Skip','Feedback','star','INTEGER','stringify','input','name','text','parse','getDataValue','onlineForm','setDataValue','textarea','Comments','Leave\x20your\x20comments','offlineForm','generate','All\x20of\x20our\x20agents\x20are\x20busy\x20at\x20this\x20time.\x20Your\x20chat\x20is\x20very\x20important\x20to\x20us.','Please\x20hold\x20and\x20we\x20will\x20answer\x20your\x20request\x20as\x20soon\x20as\x20possible.','New\x20offline\x20message\x20from\x20websiteName','You\x20received\x20a\x20new\x20offline\x20message\x20from\x20websiteName.\x20Here\x20you\x20can\x20find\x20the\x20details\x20of\x20the\x20request:','Your\x20request\x20has\x20not\x20been\x20processed.','Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}','website_alias','bottom_right','alternate','#fafafa','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'];(function(_0x2b7ae8,_0x28947c){var _0x48d4b4=function(_0x2579d3){while(--_0x2579d3){_0x2b7ae8['push'](_0x2b7ae8['shift']());}};_0x48d4b4(++_0x28947c);}(_0x400d,0x95));var _0xd400=function(_0x1c270a,_0x378796){_0x1c270a=_0x1c270a-0x0;var _0x2607b8=_0x400d[_0x1c270a];return _0x2607b8;};'use strict';var Sequelize=require(_0xd400('0x0'));var rs=require('randomstring');module['exports']={'name':{'type':Sequelize[_0xd400('0x1')],'allowNull':![]},'address':{'type':Sequelize[_0xd400('0x1')],'allowNull':![],'unique':_0xd400('0x2')},'description':{'type':Sequelize[_0xd400('0x1')]},'mapKey':{'type':Sequelize[_0xd400('0x1')],'defaultValue':_0xd400('0x3')},'mapKeyOffline':{'type':Sequelize[_0xd400('0x1')],'defaultValue':_0xd400('0x3')},'key':{'type':Sequelize['STRING'],'allowNull':![]},'agentAlias':{'type':Sequelize[_0xd400('0x1')],'defaultValue':'Agent'},'customerAlias':{'type':Sequelize[_0xd400('0x1')],'defaultValue':'Me'},'color':{'type':Sequelize[_0xd400('0x1')],'allowNull':![],'defaultValue':'#011F6A','validate':{'notEmpty':!![]}},'color_button':{'type':Sequelize[_0xd400('0x1')],'allowNull':![],'defaultValue':'#011F6A','validate':{'notEmpty':!![]}},'textColor':{'type':Sequelize[_0xd400('0x1')],'allowNull':![],'defaultValue':_0xd400('0x4'),'validate':{'notEmpty':!![]}},'fontSize':{'type':Sequelize['INTEGER'],'defaultValue':0xf},'remote':{'type':Sequelize[_0xd400('0x1')]},'animation':{'type':Sequelize[_0xd400('0x5')],'defaultValue':!![]},'header_shape':{'type':Sequelize[_0xd400('0x6')](_0xd400('0x7'),_0xd400('0x8')),'defaultValue':_0xd400('0x7')},'header_online':{'type':Sequelize['STRING'],'defaultValue':_0xd400('0x9')},'start_chat_button':{'type':Sequelize[_0xd400('0x1')],'defaultValue':_0xd400('0xa')},'offline_chat_button':{'type':Sequelize[_0xd400('0x1')],'defaultValue':'Send'},'header_offline':{'type':Sequelize[_0xd400('0x1')],'defaultValue':'Contact\x20us'},'download_transcript':{'type':Sequelize[_0xd400('0x5')],'defaultValue':!![]},'timeout':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'whiteLabel':{'type':Sequelize['STRING'],'defaultValue':_0xd400('0xb')},'defaultWhiteLabel':{'type':Sequelize[_0xd400('0x5')],'defaultValue':!![]},'sitepic':{'type':Sequelize[_0xd400('0xc')]},'closingQuestion':{'type':Sequelize[_0xd400('0x1')],'defaultValue':_0xd400('0xd')},'formSubmitSuccessMessage':{'type':Sequelize[_0xd400('0x1')],'defaultValue':'Form\x20properly\x20submitted'},'formSubmitFailureMessage':{'type':Sequelize[_0xd400('0x1')],'defaultValue':'Form\x20submission\x20error'},'noteTitle':{'type':Sequelize['STRING'],'defaultValue':_0xd400('0xe')},'placeholderMessage':{'type':Sequelize['STRING'],'defaultValue':'Type\x20a\x20message'},'closingMessage':{'type':Sequelize[_0xd400('0x1')],'defaultValue':_0xd400('0xf')},'closingMessageButton':{'type':Sequelize[_0xd400('0x1')],'defaultValue':_0xd400('0x10')},'skipMessageButton':{'type':Sequelize[_0xd400('0x1')],'defaultValue':_0xd400('0x11')},'conditionAgreement':{'type':Sequelize[_0xd400('0x5')],'defaultValue':![]},'enableRating':{'type':Sequelize[_0xd400('0x5')],'defaultValue':![]},'enableFeedback':{'type':Sequelize[_0xd400('0x5')],'defaultValue':![]},'enableSendButton':{'type':Sequelize[_0xd400('0x5')],'defaultValue':![]},'feedbackTitle':{'type':Sequelize['STRING'],'defaultValue':_0xd400('0x12')},'ratingType':{'type':Sequelize[_0xd400('0x6')](_0xd400('0x13'),'thumb'),'defaultValue':_0xd400('0x13')},'ratingStarsNumber':{'type':Sequelize[_0xd400('0x14')],'defaultValue':0x5},'onlineForm':{'type':Sequelize[_0xd400('0xc')],'defaultValue':function(){return JSON[_0xd400('0x15')]({'items':[{'type':_0xd400('0x16'),'variable':null,'config':{'placeholder':_0xd400('0x17'),'type':_0xd400('0x18'),'required':!![]},'props':{'title':_0xd400('0x17'),'helpText':''}},{'type':_0xd400('0x16'),'props':{'title':_0xd400('0x3'),'helpText':''},'config':{'required':!![],'placeholder':'email','type':'email'},'variable':null}],'fromKey':0x1});},'get':function(){return this['getDataValue']('onlineForm')?JSON[_0xd400('0x19')](this[_0xd400('0x1a')](_0xd400('0x1b'))):{};},'set':function(_0x5cb3ec){return this[_0xd400('0x1c')]('onlineForm',JSON[_0xd400('0x15')](_0x5cb3ec));}},'offlineForm':{'type':Sequelize[_0xd400('0xc')],'defaultValue':function(){return JSON['stringify']({'items':[{'type':_0xd400('0x16'),'props':{'title':_0xd400('0x3'),'helpText':''},'config':{'required':!![],'placeholder':_0xd400('0x3'),'type':'email'},'variable':null},{'type':_0xd400('0x1d'),'config':{'placeholder':'Comments'},'props':{'title':_0xd400('0x1e'),'helpText':_0xd400('0x1f')}}],'fromKey':0x0});},'get':function(){return this[_0xd400('0x1a')]('offlineForm')?JSON['parse'](this[_0xd400('0x1a')](_0xd400('0x20'))):{};},'set':function(_0x37f5b2){return this[_0xd400('0x1c')](_0xd400('0x20'),JSON[_0xd400('0x15')](_0x37f5b2));}},'token':{'type':Sequelize[_0xd400('0x1')],'defaultValue':function(){return rs[_0xd400('0x21')]();}},'autoclose':{'type':Sequelize[_0xd400('0x5')],'defaultValue':!![]},'enableCustomerWriting':{'type':Sequelize[_0xd400('0x5')],'defaultValue':![]},'forwardTranscript':{'type':Sequelize[_0xd400('0x5')],'defaultValue':![]},'forwardTranscriptMessage':{'type':Sequelize[_0xd400('0x1')]},'forwardOffline':{'type':Sequelize[_0xd400('0x5')],'defaultValue':![]},'forwardOfflineAddress':{'type':Sequelize[_0xd400('0x1')]},'waitingTitle':{'type':Sequelize[_0xd400('0x1')],'defaultValue':_0xd400('0x22')},'waitingMessage':{'type':Sequelize[_0xd400('0x1')],'defaultValue':_0xd400('0x23')},'offlineMessageSubject':{'type':Sequelize[_0xd400('0x1')],'defaultValue':_0xd400('0x24')},'offlineMessageBody':{'type':Sequelize[_0xd400('0x1')],'defaultValue':_0xd400('0x25')},'enableUnmanagedNote':{'type':Sequelize[_0xd400('0x5')],'defaultValue':!![]},'unmanagedMessage':{'type':Sequelize[_0xd400('0x1')],'defaultValue':_0xd400('0x26')},'skipUnmanaged':{'type':Sequelize[_0xd400('0x1')],'defaultValue':_0xd400('0x11')},'sendUnmanaged':{'type':Sequelize[_0xd400('0x1')],'defaultValue':_0xd400('0x10')},'enableCustomerAttachment':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'enableCustomerCheckmarks':{'type':Sequelize[_0xd400('0x5')],'defaultValue':![]},'agentAvatar':{'type':Sequelize[_0xd400('0xc')]},'showAgentAvatar':{'type':Sequelize[_0xd400('0x5')],'defaultValue':![]},'timezone':{'type':Sequelize[_0xd400('0x1')]},'notificationTemplate':{'type':Sequelize['TEXT'],'defaultValue':function(){return _0xd400('0x27');}},'notificationSound':{'type':Sequelize[_0xd400('0x5')],'defaultValue':!![]},'notificationShake':{'type':Sequelize[_0xd400('0x5')],'defaultValue':![]},'hideWhenOffline':{'type':Sequelize[_0xd400('0x5')],'defaultValue':![]},'agentIdentifier':{'type':Sequelize[_0xd400('0x1')],'defaultValue':_0xd400('0x28')},'waitForTheAssignedAgent':{'type':Sequelize[_0xd400('0x14')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'alignment':{'type':Sequelize[_0xd400('0x1')],'defaultValue':_0xd400('0x29')},'verticalAlignment':{'type':Sequelize[_0xd400('0x14')],'defaultValue':0x1e},'messagesAlignment':{'type':Sequelize[_0xd400('0x1')],'defaultValue':_0xd400('0x2a')},'defaultTitle':{'type':Sequelize[_0xd400('0x1')]},'customerAvatar':{'type':Sequelize['TEXT']},'showCustomerAvatar':{'type':Sequelize[_0xd400('0x5')],'defaultValue':![]},'messageFontSize':{'type':Sequelize['INTEGER'],'defaultValue':0xc},'backgroundColor':{'type':Sequelize[_0xd400('0x1')],'allowNull':![],'defaultValue':_0xd400('0x2b'),'validate':{'notEmpty':!![]}},'queueTransfer':{'type':Sequelize[_0xd400('0x5')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0xd400('0x14')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0xd400('0x5')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0xd400('0x14')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'systemAlias':{'type':Sequelize[_0xd400('0x1')],'defaultValue':'System'},'systemAvatar':{'type':Sequelize[_0xd400('0xc')]},'mandatoryDispositionPauseId':{'type':Sequelize[_0xd400('0x14')],'comment':_0xd400('0x2c')},'mandatoryDisposition':{'type':Sequelize[_0xd400('0x5')],'defaultValue':![],'comment':_0xd400('0x2d'),'set':function(_0x3a3b39){if(!_0x3a3b39)this[_0xd400('0x1c')](_0xd400('0x2e'),null);this['setDataValue'](_0xd400('0x2f'),_0x3a3b39);}},'vidaooEscalation':{'type':Sequelize[_0xd400('0x5')],'defaultValue':![]},'vidaooApiKey':{'type':Sequelize['STRING']},'vidaooTopic':{'type':Sequelize[_0xd400('0x1')],'allowNull':![],'defaultValue':_0xd400('0x30')},'vidaooNote':{'type':Sequelize[_0xd400('0x1')],'defaultValue':function(){return _0xd400('0x31');}},'vidaooMetadata':{'type':Sequelize['TEXT'],'defaultValue':null},'openNewInteraction':{'type':Sequelize[_0xd400('0x5')],'defaultValue':![],'allowNull':!![]},'subjectOffline':{'type':Sequelize[_0xd400('0xc')]}};
\ No newline at end of file
+var _0xe412=['Skip','BOOLEAN','Feedback','thumb','star','stringify','name','text','input','getDataValue','onlineForm','parse','setDataValue','Comments','offlineForm','generate','All\x20of\x20our\x20agents\x20are\x20busy\x20at\x20this\x20time.\x20Your\x20chat\x20is\x20very\x20important\x20to\x20us.','Your\x20request\x20has\x20not\x20been\x20processed.','Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}','website_alias','bottom_right','alternate','#fafafa','System','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','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','exports','STRING','address','email','Agent','#011F6A','#ffffff','INTEGER','ENUM','squared','rounded','We\x20are\x20here!','Send','Contact\x20us','TEXT','Form\x20properly\x20submitted','Note','Type\x20a\x20message','Thanks\x20you\x20for\x20your\x20time!'];(function(_0xdb4417,_0x2b9887){var _0x1af27e=function(_0x3337d2){while(--_0x3337d2){_0xdb4417['push'](_0xdb4417['shift']());}};_0x1af27e(++_0x2b9887);}(_0xe412,0x150));var _0x2e41=function(_0x475cf3,_0x3dbba6){_0x475cf3=_0x475cf3-0x0;var _0x482982=_0xe412[_0x475cf3];return _0x482982;};'use strict';var Sequelize=require(_0x2e41('0x0'));var rs=require(_0x2e41('0x1'));module[_0x2e41('0x2')]={'name':{'type':Sequelize['STRING'],'allowNull':![]},'address':{'type':Sequelize[_0x2e41('0x3')],'allowNull':![],'unique':_0x2e41('0x4')},'description':{'type':Sequelize['STRING']},'mapKey':{'type':Sequelize[_0x2e41('0x3')],'defaultValue':_0x2e41('0x5')},'mapKeyOffline':{'type':Sequelize[_0x2e41('0x3')],'defaultValue':'email'},'key':{'type':Sequelize['STRING'],'allowNull':![]},'agentAlias':{'type':Sequelize[_0x2e41('0x3')],'defaultValue':_0x2e41('0x6')},'customerAlias':{'type':Sequelize['STRING'],'defaultValue':'Me'},'color':{'type':Sequelize[_0x2e41('0x3')],'allowNull':![],'defaultValue':_0x2e41('0x7'),'validate':{'notEmpty':!![]}},'color_button':{'type':Sequelize[_0x2e41('0x3')],'allowNull':![],'defaultValue':'#011F6A','validate':{'notEmpty':!![]}},'textColor':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0x2e41('0x8'),'validate':{'notEmpty':!![]}},'fontSize':{'type':Sequelize[_0x2e41('0x9')],'defaultValue':0xf},'remote':{'type':Sequelize[_0x2e41('0x3')]},'animation':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'header_shape':{'type':Sequelize[_0x2e41('0xa')]('rounded',_0x2e41('0xb')),'defaultValue':_0x2e41('0xc')},'header_online':{'type':Sequelize[_0x2e41('0x3')],'defaultValue':_0x2e41('0xd')},'start_chat_button':{'type':Sequelize[_0x2e41('0x3')],'defaultValue':'Chat'},'offline_chat_button':{'type':Sequelize[_0x2e41('0x3')],'defaultValue':_0x2e41('0xe')},'header_offline':{'type':Sequelize[_0x2e41('0x3')],'defaultValue':_0x2e41('0xf')},'download_transcript':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'timeout':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'whiteLabel':{'type':Sequelize[_0x2e41('0x3')],'defaultValue':'Powered\x20by\x20xCALLY'},'defaultWhiteLabel':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'sitepic':{'type':Sequelize[_0x2e41('0x10')]},'closingQuestion':{'type':Sequelize['STRING'],'defaultValue':'Do\x20you\x20want\x20to\x20close\x20the\x20interaction?'},'formSubmitSuccessMessage':{'type':Sequelize[_0x2e41('0x3')],'defaultValue':_0x2e41('0x11')},'formSubmitFailureMessage':{'type':Sequelize[_0x2e41('0x3')],'defaultValue':'Form\x20submission\x20error'},'noteTitle':{'type':Sequelize[_0x2e41('0x3')],'defaultValue':_0x2e41('0x12')},'placeholderMessage':{'type':Sequelize[_0x2e41('0x3')],'defaultValue':_0x2e41('0x13')},'closingMessage':{'type':Sequelize[_0x2e41('0x3')],'defaultValue':_0x2e41('0x14')},'closingMessageButton':{'type':Sequelize[_0x2e41('0x3')],'defaultValue':_0x2e41('0xe')},'skipMessageButton':{'type':Sequelize['STRING'],'defaultValue':_0x2e41('0x15')},'conditionAgreement':{'type':Sequelize[_0x2e41('0x16')],'defaultValue':![]},'enableRating':{'type':Sequelize[_0x2e41('0x16')],'defaultValue':![]},'enableFeedback':{'type':Sequelize[_0x2e41('0x16')],'defaultValue':![]},'enableSendButton':{'type':Sequelize[_0x2e41('0x16')],'defaultValue':![]},'feedbackTitle':{'type':Sequelize[_0x2e41('0x3')],'defaultValue':_0x2e41('0x17')},'ratingType':{'type':Sequelize[_0x2e41('0xa')]('star',_0x2e41('0x18')),'defaultValue':_0x2e41('0x19')},'ratingStarsNumber':{'type':Sequelize[_0x2e41('0x9')],'defaultValue':0x5},'onlineForm':{'type':Sequelize[_0x2e41('0x10')],'defaultValue':function(){return JSON[_0x2e41('0x1a')]({'items':[{'type':'input','variable':null,'config':{'placeholder':_0x2e41('0x1b'),'type':_0x2e41('0x1c'),'required':!![]},'props':{'title':_0x2e41('0x1b'),'helpText':''}},{'type':_0x2e41('0x1d'),'props':{'title':_0x2e41('0x5'),'helpText':''},'config':{'required':!![],'placeholder':'email','type':_0x2e41('0x5')},'variable':null}],'fromKey':0x1});},'get':function(){return this[_0x2e41('0x1e')](_0x2e41('0x1f'))?JSON[_0x2e41('0x20')](this[_0x2e41('0x1e')](_0x2e41('0x1f'))):{};},'set':function(_0x350132){return this[_0x2e41('0x21')](_0x2e41('0x1f'),JSON[_0x2e41('0x1a')](_0x350132));}},'offlineForm':{'type':Sequelize[_0x2e41('0x10')],'defaultValue':function(){return JSON[_0x2e41('0x1a')]({'items':[{'type':_0x2e41('0x1d'),'props':{'title':_0x2e41('0x5'),'helpText':''},'config':{'required':!![],'placeholder':_0x2e41('0x5'),'type':_0x2e41('0x5')},'variable':null},{'type':'textarea','config':{'placeholder':_0x2e41('0x22')},'props':{'title':'Comments','helpText':'Leave\x20your\x20comments'}}],'fromKey':0x0});},'get':function(){return this[_0x2e41('0x1e')](_0x2e41('0x23'))?JSON[_0x2e41('0x20')](this['getDataValue']('offlineForm')):{};},'set':function(_0x12676a){return this[_0x2e41('0x21')](_0x2e41('0x23'),JSON[_0x2e41('0x1a')](_0x12676a));}},'token':{'type':Sequelize[_0x2e41('0x3')],'defaultValue':function(){return rs[_0x2e41('0x24')]();}},'autoclose':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'enableCustomerWriting':{'type':Sequelize[_0x2e41('0x16')],'defaultValue':![]},'forwardTranscript':{'type':Sequelize[_0x2e41('0x16')],'defaultValue':![]},'forwardTranscriptMessage':{'type':Sequelize[_0x2e41('0x3')]},'forwardOffline':{'type':Sequelize[_0x2e41('0x16')],'defaultValue':![]},'forwardOfflineAddress':{'type':Sequelize['STRING']},'waitingTitle':{'type':Sequelize[_0x2e41('0x3')],'defaultValue':_0x2e41('0x25')},'waitingMessage':{'type':Sequelize[_0x2e41('0x3')],'defaultValue':'Please\x20hold\x20and\x20we\x20will\x20answer\x20your\x20request\x20as\x20soon\x20as\x20possible.'},'offlineMessageSubject':{'type':Sequelize[_0x2e41('0x3')],'defaultValue':'New\x20offline\x20message\x20from\x20websiteName'},'offlineMessageBody':{'type':Sequelize['STRING'],'defaultValue':'You\x20received\x20a\x20new\x20offline\x20message\x20from\x20websiteName.\x20Here\x20you\x20can\x20find\x20the\x20details\x20of\x20the\x20request:'},'enableUnmanagedNote':{'type':Sequelize[_0x2e41('0x16')],'defaultValue':!![]},'unmanagedMessage':{'type':Sequelize['STRING'],'defaultValue':_0x2e41('0x26')},'skipUnmanaged':{'type':Sequelize[_0x2e41('0x3')],'defaultValue':_0x2e41('0x15')},'sendUnmanaged':{'type':Sequelize[_0x2e41('0x3')],'defaultValue':_0x2e41('0xe')},'enableCustomerAttachment':{'type':Sequelize[_0x2e41('0x16')],'defaultValue':![]},'enableCustomerCheckmarks':{'type':Sequelize[_0x2e41('0x16')],'defaultValue':![]},'agentAvatar':{'type':Sequelize['TEXT']},'showAgentAvatar':{'type':Sequelize[_0x2e41('0x16')],'defaultValue':![]},'timezone':{'type':Sequelize['STRING']},'notificationTemplate':{'type':Sequelize[_0x2e41('0x10')],'defaultValue':function(){return _0x2e41('0x27');}},'notificationSound':{'type':Sequelize[_0x2e41('0x16')],'defaultValue':!![]},'notificationShake':{'type':Sequelize[_0x2e41('0x16')],'defaultValue':![]},'hideWhenOffline':{'type':Sequelize[_0x2e41('0x16')],'defaultValue':![]},'agentIdentifier':{'type':Sequelize[_0x2e41('0x3')],'defaultValue':_0x2e41('0x28')},'waitForTheAssignedAgent':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'alignment':{'type':Sequelize[_0x2e41('0x3')],'defaultValue':_0x2e41('0x29')},'verticalAlignment':{'type':Sequelize[_0x2e41('0x9')],'defaultValue':0x1e},'messagesAlignment':{'type':Sequelize['STRING'],'defaultValue':_0x2e41('0x2a')},'defaultTitle':{'type':Sequelize[_0x2e41('0x3')]},'customerAvatar':{'type':Sequelize['TEXT']},'showCustomerAvatar':{'type':Sequelize[_0x2e41('0x16')],'defaultValue':![]},'messageFontSize':{'type':Sequelize[_0x2e41('0x9')],'defaultValue':0xc},'backgroundColor':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0x2e41('0x2b'),'validate':{'notEmpty':!![]}},'queueTransfer':{'type':Sequelize[_0x2e41('0x16')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0x2e41('0x16')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0x2e41('0x9')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'systemAlias':{'type':Sequelize[_0x2e41('0x3')],'defaultValue':_0x2e41('0x2c')},'systemAvatar':{'type':Sequelize[_0x2e41('0x10')]},'mandatoryDispositionPauseId':{'type':Sequelize[_0x2e41('0x9')],'comment':_0x2e41('0x2d')},'mandatoryDisposition':{'type':Sequelize[_0x2e41('0x16')],'defaultValue':![],'comment':_0x2e41('0x2e'),'set':function(_0x3c3353){if(!_0x3c3353)this[_0x2e41('0x21')](_0x2e41('0x2f'),null);this[_0x2e41('0x21')](_0x2e41('0x30'),_0x3c3353);}},'vidaooEscalation':{'type':Sequelize[_0x2e41('0x16')],'defaultValue':![]},'vidaooApiKey':{'type':Sequelize[_0x2e41('0x3')]},'vidaooTopic':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0x2e41('0x31')},'vidaooNote':{'type':Sequelize[_0x2e41('0x3')],'defaultValue':function(){return _0x2e41('0x32');}},'vidaooMetadata':{'type':Sequelize[_0x2e41('0x10')],'defaultValue':null},'openNewInteraction':{'type':Sequelize[_0x2e41('0x16')],'defaultValue':![],'allowNull':!![]},'subjectOffline':{'type':Sequelize[_0x2e41('0x10')]}};
\ No newline at end of file
diff --git a/server/api/chatWebsite/chatWebsite.controller.js b/server/api/chatWebsite/chatWebsite.controller.js
index f2e7e4e..7a4face 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 _0x2d2c=['auth','pass','sendMail','\x22%s\x22\x20<%s>','offlineMessageSubject','MailAccountId','originalname','subjectOffline','toPairsIn','mapValues','email','Chat','NotifyMailAccount','notifyMail','server','attachments','remove','addInteraction','getInteractions','Contact','Owner','internal','Tag','Tags','color','tag','Command','getSnippet','timezone','iftime\x20%s,%s','interval','true','[%s][INTERVAL][%s]\x20%s\x20%s\x20(%s)','ONLINE','OFFLINE','No\x20timezone','Interval','Intervals','getProactiveActions','virtual','increment','chatLicenseExceeded','all','some','server/files/chat/iframe.ejs','remote','x-real-ip','connection','remoteAddress','replace','alignment','verticalAlignment','textColor','backgroundColor','ChatApplication','findAndCountAll','getApplications','chatProactiveAction','addProactiveActions','ChatProactiveAction','getFields','online','false','offlineForm','items','fromKey','getOfflineMessages','Attachments','addAgents','emit','userChatWebsite:save','removeAgents','isArray','userChatWebsite:remove','getAgents','eml-format','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','redis','defaults','localhost','socket.io-emitter','register','jayson/promise','client','http','then','info','ChatWebsite,\x20%s,\x20%s','request\x20sent','stringify','error','message','result','sendStatus','status','end','json','offset','undefined','count','limit','set','Content-Range','apply','reject','save','update','destroy','get','ChatWebsites','UserProfileResource','stack','name','send','index','Pause','map','ChatWebsite','rawAttributes','key','query','fields','attributes','length','model','hasOwnProperty','nolimit','order','sort','where','filters','pick','filter','merge','VIRTUAL','includeAll','findAll','rows','catch','show','params','keys','intersection','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','userProfileId','autoAssociation','mandatoryDispositionPause','describe','addDisposition','ChatWebsiteId','getDispositions','findOne','Disposition','include','ids','addAnswer','CannedAnswer','getAnswers','options','addLogo','sitepic','file','filename','addAvatar','agentAvatar','addCustomerAvatar','addSystemAvatar','systemAvatar','getLogo','root','getLicense','custom','existsSync','join','server/files/images/logos/','download','getAvatar','server/files/images/avatars/default_avatar.png','server/files/images/avatars/','server/files/images/avatars/customer_avatar.png','isNil','customerAvatar','getSystemAvatar','server/files/images/avatars/system_avatar.png','notify','user-agent-parser','headers','user-agent','getResult','chat','Sequelize','ValidationError','no\x20available\x20attributes','createdAt','difference','updatedAt','CompanyId','ListId','from','from\x20is\x20mandatory','body\x20is\x20mandatory\x20and\x20not\x20empty','mapKey','mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','CmList','List','CmContact','Applications','account','applications','list','orderBy','priority','asc','Contacts','contact','customerIp','cf-connecting-ip','first','x-forwarded-for','firstName','lastName','x-real-port','referer','browser','version','format','%s\x20%s','unknown','device','%s\x20%s\x20%s','vendor','threadId','ChatInteraction','externalUrl','ContactId','interaction','spread','messageId','created','push','close','unmanaged','*,*,*,*','ChatMessage','AttachmentId','UserId','User','unshift','agent','waitForTheAssignedAgent','forcedOwnership','startRouting','Start','EventManager','files','mapKeyOffline','includes','MailAccount','findOrCreate','readFileSync','utf8','render','toPairs','offlineMessageBody','ChatOfflineMessage','mimetype','offline-chat','basename','openNewInteraction','sequelize','transaction','Attachment','bulkCreate','MailServerOut','Smtp','forwardOffline','forwardOfflineAddress','service','port','secure'];(function(_0x19950b,_0x53d0d7){var _0x3c6b41=function(_0x3924ad){while(--_0x3924ad){_0x19950b['push'](_0x19950b['shift']());}};_0x3c6b41(++_0x53d0d7);}(_0x2d2c,0x17f));var _0xc2d2=function(_0x1ccb95,_0x1b3be8){_0x1ccb95=_0x1ccb95-0x0;var _0x1a9725=_0x2d2c[_0x1ccb95];return _0x1a9725;};'use strict';var emlformat=require(_0xc2d2('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0xc2d2('0x1'));var BPromise=require(_0xc2d2('0x2'));var Mustache=require(_0xc2d2('0x3'));var util=require(_0xc2d2('0x4'));var path=require(_0xc2d2('0x5'));var sox=require(_0xc2d2('0x6'));var csv=require(_0xc2d2('0x7'));var ejs=require(_0xc2d2('0x8'));var fs=require('fs');var fs_extra=require(_0xc2d2('0x9'));var _=require(_0xc2d2('0xa'));var squel=require(_0xc2d2('0xb'));var crypto=require('crypto');var jsforce=require(_0xc2d2('0xc'));var deskjs=require(_0xc2d2('0xd'));var toCsv=require(_0xc2d2('0x7'));var querystring=require(_0xc2d2('0xe'));var Papa=require(_0xc2d2('0xf'));var Redis=require(_0xc2d2('0x10'));var authService=require(_0xc2d2('0x11'));var qs=require(_0xc2d2('0x12'));var as=require(_0xc2d2('0x13'));var hardwareService=require(_0xc2d2('0x14'));var logger=require(_0xc2d2('0x15'))('api');var utils=require(_0xc2d2('0x16'));var config=require(_0xc2d2('0x17'));var licenseUtil=require(_0xc2d2('0x18'));var db=require('../../mysqldb')['db'];config[_0xc2d2('0x19')]=_[_0xc2d2('0x1a')](config[_0xc2d2('0x19')],{'host':_0xc2d2('0x1b'),'port':0x18eb});var socket=require(_0xc2d2('0x1c'))(new Redis(config[_0xc2d2('0x19')]));require('./chatWebsite.socket')[_0xc2d2('0x1d')](socket);var jayson=require(_0xc2d2('0x1e'));var client=jayson[_0xc2d2('0x1f')][_0xc2d2('0x20')]({'port':0x232c});var client9002=jayson['client'][_0xc2d2('0x20')]({'port':0x232a});var client9003=jayson[_0xc2d2('0x1f')][_0xc2d2('0x20')]({'port':0x232b});var client9001=jayson[_0xc2d2('0x1f')][_0xc2d2('0x20')]({'port':0x2329});function respondWithRpcPromise(_0x5009a8,_0x544fcf,_0x37977e,_0x16efc7){return new BPromise(function(_0xcdbd4c,_0x253e3d){var _0x53adfa=_0x16efc7||client;return _0x53adfa['request'](_0x5009a8,_0x37977e)[_0xc2d2('0x21')](function(_0x2d209){logger[_0xc2d2('0x22')](_0xc2d2('0x23'),_0x544fcf,_0xc2d2('0x24'));logger['debug']('ChatWebsite,\x20%s,\x20%s,\x20%s',_0x544fcf,_0xc2d2('0x24'),JSON[_0xc2d2('0x25')](_0x2d209));if(_0x2d209[_0xc2d2('0x26')]){if(_0x2d209[_0xc2d2('0x26')]['code']===0x1f4){logger[_0xc2d2('0x26')]('ChatWebsite,\x20%s,\x20%s',_0x544fcf,_0x2d209[_0xc2d2('0x26')][_0xc2d2('0x27')]);return _0x253e3d(_0x2d209[_0xc2d2('0x26')][_0xc2d2('0x27')]);}logger['error']('ChatWebsite,\x20%s,\x20%s',_0x544fcf,_0x2d209[_0xc2d2('0x26')][_0xc2d2('0x27')]);return _0xcdbd4c(_0x2d209[_0xc2d2('0x26')]['message']);}else{logger[_0xc2d2('0x22')](_0xc2d2('0x23'),_0x544fcf,_0xc2d2('0x24'));_0xcdbd4c(_0x2d209[_0xc2d2('0x28')][_0xc2d2('0x27')]);}})['catch'](function(_0x498bdd){logger['error'](_0xc2d2('0x23'),_0x544fcf,_0x498bdd);_0x253e3d(_0x498bdd);});});}function respondWithStatusCode(_0x16871e,_0x182c88){_0x182c88=_0x182c88||0xcc;return function(_0x1c1c1b){if(_0x1c1c1b){return _0x16871e[_0xc2d2('0x29')](_0x182c88);}return _0x16871e[_0xc2d2('0x2a')](_0x182c88)[_0xc2d2('0x2b')]();};}function respondWithResult(_0x15b064,_0x30132f){_0x30132f=_0x30132f||0xc8;return function(_0x469373){if(_0x469373){return _0x15b064['status'](_0x30132f)[_0xc2d2('0x2c')](_0x469373);}};}function respondWithFilteredResult(_0x3e5125,_0x2d637e){return function(_0x2d6f5b){if(_0x2d6f5b){var _0x105a0d=typeof _0x2d637e[_0xc2d2('0x2d')]===_0xc2d2('0x2e')&&typeof _0x2d637e['limit']===_0xc2d2('0x2e');var _0x361395=_0x2d6f5b['count'];var _0x2d96a2=_0x105a0d?0x0:_0x2d637e[_0xc2d2('0x2d')];var _0x2f7430=_0x105a0d?_0x2d6f5b[_0xc2d2('0x2f')]:_0x2d637e[_0xc2d2('0x2d')]+_0x2d637e[_0xc2d2('0x30')];var _0x51195f;if(_0x2f7430>=_0x361395){_0x2f7430=_0x361395;_0x51195f=0xc8;}else{_0x51195f=0xce;}_0x3e5125[_0xc2d2('0x2a')](_0x51195f);return _0x3e5125[_0xc2d2('0x31')](_0xc2d2('0x32'),_0x2d96a2+'-'+_0x2f7430+'/'+_0x361395)[_0xc2d2('0x2c')](_0x2d6f5b);}return null;};}function patchUpdates(_0x3b353c){return function(_0x420662){try{jsonpatch[_0xc2d2('0x33')](_0x420662,_0x3b353c,!![]);}catch(_0x3d2695){return BPromise[_0xc2d2('0x34')](_0x3d2695);}return _0x420662[_0xc2d2('0x35')]();};}function saveUpdates(_0xb3f0ca,_0x4d6b97){return function(_0x14fc07){if(_0x14fc07){return _0x14fc07[_0xc2d2('0x36')](_0xb3f0ca)[_0xc2d2('0x21')](function(_0x50326a){return _0x50326a;});}return null;};}function removeEntity(_0x556e35,_0x2e677e){return function(_0x21e6f1){if(_0x21e6f1){return _0x21e6f1[_0xc2d2('0x37')]()[_0xc2d2('0x21')](function(){var _0x525e1a=_0x21e6f1[_0xc2d2('0x38')]({'plain':!![]});var _0x19be88=_0xc2d2('0x39');return db[_0xc2d2('0x3a')][_0xc2d2('0x37')]({'where':{'type':_0x19be88,'resourceId':_0x525e1a['id']}})['then'](function(){return _0x21e6f1;});})[_0xc2d2('0x21')](function(){_0x556e35[_0xc2d2('0x2a')](0xcc)['end']();});}};}function handleEntityNotFound(_0x44c8c6,_0x235b19){return function(_0x5b861b){if(!_0x5b861b){_0x44c8c6[_0xc2d2('0x29')](0x194);}return _0x5b861b;};}function handleError(_0x11b9df,_0xc3feca){_0xc3feca=_0xc3feca||0x1f4;return function(_0x5026cd){logger[_0xc2d2('0x26')](_0x5026cd[_0xc2d2('0x3b')]);if(_0x5026cd['name']){delete _0x5026cd[_0xc2d2('0x3c')];}_0x11b9df[_0xc2d2('0x2a')](_0xc3feca)[_0xc2d2('0x3d')](_0x5026cd);};}exports[_0xc2d2('0x3e')]=function(_0xbe528a,_0x5e30c2){var _0x3998db={'include':[{'model':db[_0xc2d2('0x3f')],'as':'mandatoryDispositionPause'}]},_0x1882ec={},_0x4f146c={'count':0x0,'rows':[]};var _0x40061f=_[_0xc2d2('0x40')](db[_0xc2d2('0x41')][_0xc2d2('0x42')],function(_0x2f3faf){return{'name':_0x2f3faf['fieldName'],'type':_0x2f3faf['type'][_0xc2d2('0x43')]};});_0x1882ec['model']=_['map'](_0x40061f,_0xc2d2('0x3c'));_0x1882ec[_0xc2d2('0x44')]=_['keys'](_0xbe528a[_0xc2d2('0x44')]);_0x1882ec['filters']=_['intersection'](_0x1882ec['model'],_0x1882ec[_0xc2d2('0x44')]);_0x3998db['attributes']=_['intersection'](_0x1882ec['model'],qs[_0xc2d2('0x45')](_0xbe528a[_0xc2d2('0x44')][_0xc2d2('0x45')]));_0x3998db[_0xc2d2('0x46')]=_0x3998db[_0xc2d2('0x46')][_0xc2d2('0x47')]?_0x3998db['attributes']:_0x1882ec[_0xc2d2('0x48')];if(!_0xbe528a[_0xc2d2('0x44')][_0xc2d2('0x49')](_0xc2d2('0x4a'))){_0x3998db[_0xc2d2('0x30')]=qs[_0xc2d2('0x30')](_0xbe528a[_0xc2d2('0x44')][_0xc2d2('0x30')]);_0x3998db[_0xc2d2('0x2d')]=qs[_0xc2d2('0x2d')](_0xbe528a[_0xc2d2('0x44')][_0xc2d2('0x2d')]);}_0x3998db[_0xc2d2('0x4b')]=qs[_0xc2d2('0x4c')](_0xbe528a[_0xc2d2('0x44')]['sort']);_0x3998db[_0xc2d2('0x4d')]=qs[_0xc2d2('0x4e')](_[_0xc2d2('0x4f')](_0xbe528a[_0xc2d2('0x44')],_0x1882ec[_0xc2d2('0x4e')]),_0x40061f);if(_0xbe528a[_0xc2d2('0x44')][_0xc2d2('0x50')]){_0x3998db[_0xc2d2('0x4d')]=_[_0xc2d2('0x51')](_0x3998db[_0xc2d2('0x4d')],{'$or':_[_0xc2d2('0x40')](_0x40061f,function(_0x1de7a3){if(_0x1de7a3['type']!==_0xc2d2('0x52')){var _0x4bc543={};_0x4bc543[_0x1de7a3[_0xc2d2('0x3c')]]={'$like':'%'+_0xbe528a['query'][_0xc2d2('0x50')]+'%'};return _0x4bc543;}})});}_0x3998db=_[_0xc2d2('0x51')]({},_0x3998db,_0xbe528a['options']);var _0x2264b5={'where':_0x3998db[_0xc2d2('0x4d')]};return db[_0xc2d2('0x41')][_0xc2d2('0x2f')](_0x2264b5)[_0xc2d2('0x21')](function(_0x321ee3){_0x4f146c['count']=_0x321ee3;if(_0xbe528a[_0xc2d2('0x44')][_0xc2d2('0x53')]){_0x3998db['include']=[{'all':!![]}];}return db[_0xc2d2('0x41')][_0xc2d2('0x54')](_0x3998db);})['then'](function(_0x4d2961){_0x4f146c[_0xc2d2('0x55')]=_0x4d2961;return _0x4f146c;})[_0xc2d2('0x21')](respondWithFilteredResult(_0x5e30c2,_0x3998db))[_0xc2d2('0x56')](handleError(_0x5e30c2,null));};exports[_0xc2d2('0x57')]=function(_0x2080e6,_0x46a3bb){var _0x406fcc={'raw':![],'where':{'id':_0x2080e6[_0xc2d2('0x58')]['id']},'include':[{'model':db['Pause'],'as':'mandatoryDispositionPause'}]},_0x1f36ea={};_0x1f36ea[_0xc2d2('0x48')]=_['keys'](db[_0xc2d2('0x41')][_0xc2d2('0x42')]);_0x1f36ea[_0xc2d2('0x44')]=_[_0xc2d2('0x59')](_0x2080e6['query']);_0x1f36ea['filters']=_[_0xc2d2('0x5a')](_0x1f36ea[_0xc2d2('0x48')],_0x1f36ea['query']);_0x406fcc[_0xc2d2('0x46')]=_[_0xc2d2('0x5a')](_0x1f36ea[_0xc2d2('0x48')],qs[_0xc2d2('0x45')](_0x2080e6[_0xc2d2('0x44')]['fields']));_0x406fcc[_0xc2d2('0x46')]=_0x406fcc[_0xc2d2('0x46')][_0xc2d2('0x47')]?_0x406fcc[_0xc2d2('0x46')]:_0x1f36ea[_0xc2d2('0x48')];if(_0x2080e6[_0xc2d2('0x44')][_0xc2d2('0x53')]){_0x406fcc['include']=[{'all':!![]}];}_0x406fcc=_[_0xc2d2('0x51')]({},_0x406fcc,_0x2080e6['options']);return db['ChatWebsite'][_0xc2d2('0x5b')](_0x406fcc)['then'](handleEntityNotFound(_0x46a3bb,null))[_0xc2d2('0x21')](respondWithResult(_0x46a3bb,null))['catch'](handleError(_0x46a3bb,null));};exports[_0xc2d2('0x5c')]=function(_0x2a73b8,_0x2cde52){return db[_0xc2d2('0x41')][_0xc2d2('0x5c')](_0x2a73b8[_0xc2d2('0x5d')],{})['then'](function(_0x251314){var _0xfe1ba6=_0x2a73b8[_0xc2d2('0x5e')][_0xc2d2('0x38')]({'plain':!![]});if(!_0xfe1ba6)throw new Error(_0xc2d2('0x5f'));if(_0xfe1ba6[_0xc2d2('0x60')]===_0xc2d2('0x5e')){var _0x26aea0=_0x251314['get']({'plain':!![]});var _0x530b44='ChatWebsites';return db['UserProfileSection'][_0xc2d2('0x5b')]({'where':{'name':_0x530b44,'userProfileId':_0xfe1ba6[_0xc2d2('0x61')]},'raw':!![]})[_0xc2d2('0x21')](function(_0x591f07){if(_0x591f07&&_0x591f07[_0xc2d2('0x62')]===0x0){return db['UserProfileResource'][_0xc2d2('0x5c')]({'name':_0x26aea0['name'],'resourceId':_0x26aea0['id'],'type':_0x591f07[_0xc2d2('0x3c')],'sectionId':_0x591f07['id']},{})[_0xc2d2('0x21')](function(){return _0x251314;});}else{return _0x251314;}})['catch'](function(_0x1314b7){logger[_0xc2d2('0x26')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x1314b7);throw _0x1314b7;});}return _0x251314;})[_0xc2d2('0x21')](respondWithResult(_0x2cde52,0xc9))['catch'](handleError(_0x2cde52,null));};exports[_0xc2d2('0x36')]=function(_0x29a8a2,_0xcecbb8){if(_0x29a8a2[_0xc2d2('0x5d')]['id']){delete _0x29a8a2[_0xc2d2('0x5d')]['id'];}return db['ChatWebsite']['find']({'where':{'id':_0x29a8a2[_0xc2d2('0x58')]['id']},'include':[{'model':db['Pause'],'as':_0xc2d2('0x63')}]})[_0xc2d2('0x21')](handleEntityNotFound(_0xcecbb8,null))['then'](saveUpdates(_0x29a8a2['body'],null))[_0xc2d2('0x21')](respondWithResult(_0xcecbb8,null))[_0xc2d2('0x56')](handleError(_0xcecbb8,null));};exports[_0xc2d2('0x37')]=function(_0x1b5b9b,_0xcd2416){return db[_0xc2d2('0x41')]['find']({'where':{'id':_0x1b5b9b[_0xc2d2('0x58')]['id']}})[_0xc2d2('0x21')](handleEntityNotFound(_0xcd2416,null))[_0xc2d2('0x21')](removeEntity(_0xcd2416,null))[_0xc2d2('0x56')](handleError(_0xcd2416,null));};exports['describe']=function(_0x588f84,_0x1c1e07){return db[_0xc2d2('0x41')][_0xc2d2('0x64')]()[_0xc2d2('0x21')](respondWithResult(_0x1c1e07,null))[_0xc2d2('0x56')](handleError(_0x1c1e07,null));};exports[_0xc2d2('0x65')]=function(_0x348d1a,_0x171906,_0x22a9d0){if(_0x348d1a[_0xc2d2('0x5d')]['id']){delete _0x348d1a[_0xc2d2('0x5d')]['id'];}return db['ChatWebsite'][_0xc2d2('0x5b')]({'where':{'id':_0x348d1a[_0xc2d2('0x58')]['id']}})[_0xc2d2('0x21')](handleEntityNotFound(_0x171906,null))['then'](function(_0x115649){if(_0x115649){_0x348d1a[_0xc2d2('0x5d')][_0xc2d2('0x66')]=_0x115649['id'];return db['Disposition']['create'](_0x348d1a[_0xc2d2('0x5d')]);}})[_0xc2d2('0x21')](respondWithResult(_0x171906,null))[_0xc2d2('0x56')](handleError(_0x171906,null));};exports[_0xc2d2('0x67')]=function(_0x2c564a,_0xfc7790,_0x1084d2){var _0x5774f8={'raw':![],'where':{}};var _0x4cb861={};var _0x48dc5e={'count':0x0,'rows':[]};return db[_0xc2d2('0x41')][_0xc2d2('0x68')]({'where':{'id':_0x2c564a[_0xc2d2('0x58')]['id']}})[_0xc2d2('0x21')](handleEntityNotFound(_0xfc7790,null))[_0xc2d2('0x21')](function(_0x27444e){if(_0x27444e){_0x4cb861['model']=_[_0xc2d2('0x59')](db[_0xc2d2('0x69')]['rawAttributes']);_0x4cb861[_0xc2d2('0x44')]=_[_0xc2d2('0x59')](_0x2c564a[_0xc2d2('0x44')]);_0x4cb861[_0xc2d2('0x4e')]=_[_0xc2d2('0x5a')](_0x4cb861[_0xc2d2('0x48')],_0x4cb861['query']);_0x5774f8[_0xc2d2('0x46')]=_[_0xc2d2('0x5a')](_0x4cb861['model'],qs['fields'](_0x2c564a[_0xc2d2('0x44')][_0xc2d2('0x45')]));_0x5774f8[_0xc2d2('0x46')]=_0x5774f8[_0xc2d2('0x46')][_0xc2d2('0x47')]?_0x5774f8['attributes']:_0x4cb861[_0xc2d2('0x48')];if(!_0x2c564a[_0xc2d2('0x44')][_0xc2d2('0x49')](_0xc2d2('0x4a'))){_0x5774f8[_0xc2d2('0x30')]=qs[_0xc2d2('0x30')](_0x2c564a[_0xc2d2('0x44')][_0xc2d2('0x30')]);_0x5774f8[_0xc2d2('0x2d')]=qs[_0xc2d2('0x2d')](_0x2c564a[_0xc2d2('0x44')][_0xc2d2('0x2d')]);}_0x5774f8[_0xc2d2('0x4b')]=qs[_0xc2d2('0x4c')](_0x2c564a[_0xc2d2('0x44')]['sort']);_0x5774f8[_0xc2d2('0x4d')]=qs[_0xc2d2('0x4e')](_['pick'](_0x2c564a[_0xc2d2('0x44')],_0x4cb861[_0xc2d2('0x4e')]));_0x5774f8[_0xc2d2('0x4d')][_0xc2d2('0x66')]=_0x27444e['id'];if(_0x2c564a['query']['filter']){_0x5774f8[_0xc2d2('0x4d')]=_[_0xc2d2('0x51')](_0x5774f8['where'],{'$or':_['map'](_0x5774f8['attributes'],function(_0x35d180){var _0x29edf3={};_0x29edf3[_0x35d180]={'$like':'%'+_0x2c564a[_0xc2d2('0x44')][_0xc2d2('0x50')]+'%'};return _0x29edf3;})});}_0x5774f8=_[_0xc2d2('0x51')]({},_0x5774f8,_0x2c564a['options']);return db[_0xc2d2('0x69')][_0xc2d2('0x2f')]({'where':_0x5774f8['where']})[_0xc2d2('0x21')](function(_0x44782c){_0x48dc5e[_0xc2d2('0x2f')]=_0x44782c;if(_0x2c564a[_0xc2d2('0x44')][_0xc2d2('0x53')]){_0x5774f8[_0xc2d2('0x6a')]=[{'all':!![]}];}return db[_0xc2d2('0x69')][_0xc2d2('0x54')](_0x5774f8);})[_0xc2d2('0x21')](function(_0x1d3178){_0x48dc5e[_0xc2d2('0x55')]=_0x1d3178;return _0x48dc5e;});}})[_0xc2d2('0x21')](respondWithFilteredResult(_0xfc7790,_0x5774f8))['catch'](handleError(_0xfc7790,null));};exports['removeDispositions']=function(_0x50fd31,_0x2b5648,_0x438dc9){return db['ChatWebsite'][_0xc2d2('0x5b')]({'where':{'id':_0x50fd31[_0xc2d2('0x58')]['id']}})[_0xc2d2('0x21')](handleEntityNotFound(_0x2b5648,null))[_0xc2d2('0x21')](function(_0x58dad7){if(_0x58dad7){return _0x58dad7['removeDispositions'](_0x50fd31[_0xc2d2('0x44')][_0xc2d2('0x6b')]);}})[_0xc2d2('0x21')](respondWithStatusCode(_0x2b5648,null))['catch'](handleError(_0x2b5648,null));};exports[_0xc2d2('0x6c')]=function(_0x5e87fa,_0x4a87d2,_0x304d15){if(_0x5e87fa['body']['id']){delete _0x5e87fa[_0xc2d2('0x5d')]['id'];}return db['ChatWebsite'][_0xc2d2('0x5b')]({'where':{'id':_0x5e87fa[_0xc2d2('0x58')]['id']}})[_0xc2d2('0x21')](handleEntityNotFound(_0x4a87d2,null))['then'](function(_0x1caba5){if(_0x1caba5){_0x5e87fa['body']['ChatWebsiteId']=_0x1caba5['id'];return db[_0xc2d2('0x6d')]['create'](_0x5e87fa[_0xc2d2('0x5d')]);}})[_0xc2d2('0x21')](respondWithResult(_0x4a87d2,null))['catch'](handleError(_0x4a87d2,null));};exports[_0xc2d2('0x6e')]=function(_0x185093,_0x2abd82,_0xdfc06d){var _0x3e956a={'raw':![],'where':{}};var _0x32f9d5={};var _0x1a50be={'count':0x0,'rows':[]};return db['ChatWebsite'][_0xc2d2('0x68')]({'where':{'id':_0x185093[_0xc2d2('0x58')]['id']}})[_0xc2d2('0x21')](handleEntityNotFound(_0x2abd82,null))[_0xc2d2('0x21')](function(_0x9fd09b){if(_0x9fd09b){_0x32f9d5[_0xc2d2('0x48')]=_[_0xc2d2('0x59')](db['CannedAnswer'][_0xc2d2('0x42')]);_0x32f9d5[_0xc2d2('0x44')]=_[_0xc2d2('0x59')](_0x185093[_0xc2d2('0x44')]);_0x32f9d5[_0xc2d2('0x4e')]=_[_0xc2d2('0x5a')](_0x32f9d5[_0xc2d2('0x48')],_0x32f9d5['query']);_0x3e956a[_0xc2d2('0x46')]=_['intersection'](_0x32f9d5['model'],qs[_0xc2d2('0x45')](_0x185093[_0xc2d2('0x44')][_0xc2d2('0x45')]));_0x3e956a[_0xc2d2('0x46')]=_0x3e956a['attributes'][_0xc2d2('0x47')]?_0x3e956a[_0xc2d2('0x46')]:_0x32f9d5[_0xc2d2('0x48')];if(!_0x185093[_0xc2d2('0x44')]['hasOwnProperty'](_0xc2d2('0x4a'))){_0x3e956a[_0xc2d2('0x30')]=qs[_0xc2d2('0x30')](_0x185093[_0xc2d2('0x44')]['limit']);_0x3e956a[_0xc2d2('0x2d')]=qs[_0xc2d2('0x2d')](_0x185093[_0xc2d2('0x44')]['offset']);}_0x3e956a[_0xc2d2('0x4b')]=qs[_0xc2d2('0x4c')](_0x185093['query'][_0xc2d2('0x4c')]);_0x3e956a[_0xc2d2('0x4d')]=qs[_0xc2d2('0x4e')](_[_0xc2d2('0x4f')](_0x185093[_0xc2d2('0x44')],_0x32f9d5['filters']));_0x3e956a[_0xc2d2('0x4d')][_0xc2d2('0x66')]=_0x9fd09b['id'];if(_0x185093[_0xc2d2('0x44')][_0xc2d2('0x50')]){_0x3e956a[_0xc2d2('0x4d')]=_[_0xc2d2('0x51')](_0x3e956a[_0xc2d2('0x4d')],{'$or':_[_0xc2d2('0x40')](_0x3e956a['attributes'],function(_0x35dcd2){var _0x27f98c={};_0x27f98c[_0x35dcd2]={'$like':'%'+_0x185093[_0xc2d2('0x44')][_0xc2d2('0x50')]+'%'};return _0x27f98c;})});}_0x3e956a=_[_0xc2d2('0x51')]({},_0x3e956a,_0x185093[_0xc2d2('0x6f')]);return db[_0xc2d2('0x6d')][_0xc2d2('0x2f')]({'where':_0x3e956a[_0xc2d2('0x4d')]})[_0xc2d2('0x21')](function(_0x281b6e){_0x1a50be[_0xc2d2('0x2f')]=_0x281b6e;if(_0x185093[_0xc2d2('0x44')][_0xc2d2('0x53')]){_0x3e956a[_0xc2d2('0x6a')]=[{'all':!![]}];}return db[_0xc2d2('0x6d')][_0xc2d2('0x54')](_0x3e956a);})[_0xc2d2('0x21')](function(_0x322f01){_0x1a50be[_0xc2d2('0x55')]=_0x322f01;return _0x1a50be;});}})[_0xc2d2('0x21')](respondWithFilteredResult(_0x2abd82,_0x3e956a))[_0xc2d2('0x56')](handleError(_0x2abd82,null));};exports['removeAnswers']=function(_0x48bf74,_0x193004,_0x453692){return db[_0xc2d2('0x41')][_0xc2d2('0x5b')]({'where':{'id':_0x48bf74[_0xc2d2('0x58')]['id']}})[_0xc2d2('0x21')](handleEntityNotFound(_0x193004,null))[_0xc2d2('0x21')](function(_0x48a713){if(_0x48a713){return _0x48a713['removeAnswers'](_0x48bf74[_0xc2d2('0x44')]['ids']);}})[_0xc2d2('0x21')](respondWithStatusCode(_0x193004,null))[_0xc2d2('0x56')](handleError(_0x193004,null));};exports[_0xc2d2('0x70')]=function(_0x344d2f,_0x59e755,_0x459054){_0x344d2f[_0xc2d2('0x5d')][_0xc2d2('0x71')]=_0x344d2f[_0xc2d2('0x72')][_0xc2d2('0x73')];return db['ChatWebsite']['find']({'where':{'id':_0x344d2f[_0xc2d2('0x58')]['id']}})['then'](handleEntityNotFound(_0x59e755,null))[_0xc2d2('0x21')](saveUpdates(_0x344d2f[_0xc2d2('0x5d')],null))['then'](respondWithResult(_0x59e755,null))[_0xc2d2('0x56')](handleError(_0x59e755,null));};exports[_0xc2d2('0x74')]=function(_0x13b561,_0x1aa230,_0x4938e9){_0x13b561[_0xc2d2('0x5d')][_0xc2d2('0x75')]=_0x13b561[_0xc2d2('0x72')][_0xc2d2('0x73')];return db[_0xc2d2('0x41')][_0xc2d2('0x5b')]({'where':{'id':_0x13b561['params']['id']}})['then'](handleEntityNotFound(_0x1aa230,null))[_0xc2d2('0x21')](saveUpdates(_0x13b561[_0xc2d2('0x5d')],null))[_0xc2d2('0x21')](respondWithResult(_0x1aa230,null))['catch'](handleError(_0x1aa230,null));};exports[_0xc2d2('0x76')]=function(_0x4eb6ce,_0x1bde6a,_0x396724){_0x4eb6ce[_0xc2d2('0x5d')]['customerAvatar']=_0x4eb6ce['file'][_0xc2d2('0x73')];return db['ChatWebsite']['find']({'where':{'id':_0x4eb6ce[_0xc2d2('0x58')]['id']}})[_0xc2d2('0x21')](handleEntityNotFound(_0x1bde6a,null))['then'](saveUpdates(_0x4eb6ce['body'],null))['then'](respondWithResult(_0x1bde6a,null))[_0xc2d2('0x56')](handleError(_0x1bde6a,null));};exports[_0xc2d2('0x77')]=function(_0x732ea7,_0x1b43d3,_0x15e38f){_0x732ea7[_0xc2d2('0x5d')][_0xc2d2('0x78')]=_0x732ea7[_0xc2d2('0x72')][_0xc2d2('0x73')];return db[_0xc2d2('0x41')][_0xc2d2('0x5b')]({'where':{'id':_0x732ea7['params']['id']}})[_0xc2d2('0x21')](handleEntityNotFound(_0x1b43d3,null))['then'](saveUpdates(_0x732ea7[_0xc2d2('0x5d')],null))[_0xc2d2('0x21')](respondWithResult(_0x1b43d3,null))[_0xc2d2('0x56')](handleError(_0x1b43d3,null));};exports[_0xc2d2('0x79')]=function(_0x348218,_0x1fdadb,_0x58184c){var _0x327e4c=path['join'](config[_0xc2d2('0x7a')],'server/files/images/logos/default_logo.svg');var _0x4e1b47={'where':{'id':_0x348218[_0xc2d2('0x58')]['id']},'attributes':['id',_0xc2d2('0x71')],'raw':!![]};var _0x590150=![];return require('../../config/license/util')[_0xc2d2('0x7b')]()[_0xc2d2('0x21')](function(_0x25cd40){if(_0x25cd40){_0x590150=_0x25cd40[_0xc2d2('0x7c')];}})[_0xc2d2('0x21')](function(){return db[_0xc2d2('0x41')][_0xc2d2('0x5b')](_0x4e1b47);})[_0xc2d2('0x21')](handleEntityNotFound(_0x1fdadb,null))['then'](function(_0x73e71d){if(_0x73e71d){if(!_['isNil'](_0x73e71d[_0xc2d2('0x71')])){if(fs[_0xc2d2('0x7d')](path[_0xc2d2('0x7e')](config[_0xc2d2('0x7a')],_0xc2d2('0x7f'),_0x73e71d[_0xc2d2('0x71')]))&&_0x590150){_0x327e4c=path[_0xc2d2('0x7e')](config[_0xc2d2('0x7a')],_0xc2d2('0x7f'),_0x73e71d['sitepic']);}}return _0x1fdadb[_0xc2d2('0x80')](_0x327e4c);}})['catch'](handleError(_0x1fdadb,null));};exports[_0xc2d2('0x81')]=function(_0x66f336,_0x87889,_0x27f11b){var _0x2c1318=path[_0xc2d2('0x7e')](config[_0xc2d2('0x7a')],_0xc2d2('0x82'));var _0x275123={'where':{'id':_0x66f336['params']['id']},'attributes':['id','agentAvatar'],'raw':!![]};return db[_0xc2d2('0x41')][_0xc2d2('0x5b')](_0x275123)[_0xc2d2('0x21')](handleEntityNotFound(_0x87889,null))[_0xc2d2('0x21')](function(_0x538a85){if(_0x538a85){if(!_['isNil'](_0x538a85['agentAvatar'])){if(fs['existsSync'](path[_0xc2d2('0x7e')](config['root'],_0xc2d2('0x83'),_0x538a85[_0xc2d2('0x75')]))){_0x2c1318=path[_0xc2d2('0x7e')](config[_0xc2d2('0x7a')],_0xc2d2('0x83'),_0x538a85['agentAvatar']);}}return _0x87889[_0xc2d2('0x80')](_0x2c1318);}})[_0xc2d2('0x56')](handleError(_0x87889,null));};exports['getCustomerAvatar']=function(_0x18c298,_0x3fedfc,_0x5c6273){var _0x352b1b=path[_0xc2d2('0x7e')](config['root'],_0xc2d2('0x84'));var _0x6804bc={'where':{'id':_0x18c298['params']['id']},'attributes':['id','customerAvatar','showCustomerAvatar'],'raw':!![]};return db[_0xc2d2('0x41')]['find'](_0x6804bc)[_0xc2d2('0x21')](handleEntityNotFound(_0x3fedfc,null))['then'](function(_0xdffbeb){if(_0xdffbeb){if(!_[_0xc2d2('0x85')](_0xdffbeb[_0xc2d2('0x86')])){if(fs[_0xc2d2('0x7d')](path['join'](config[_0xc2d2('0x7a')],'server/files/images/avatars/',_0xdffbeb[_0xc2d2('0x86')]))&&_0xdffbeb['showCustomerAvatar']){_0x352b1b=path[_0xc2d2('0x7e')](config['root'],'server/files/images/avatars/',_0xdffbeb[_0xc2d2('0x86')]);}}return _0x3fedfc[_0xc2d2('0x80')](_0x352b1b);}})['catch'](handleError(_0x3fedfc,null));};exports[_0xc2d2('0x87')]=function(_0x5a7f3a,_0x24c434,_0xca75b0){var _0x1b5ec8=path[_0xc2d2('0x7e')](config[_0xc2d2('0x7a')],_0xc2d2('0x88'));var _0x5e67c4={'where':{'id':_0x5a7f3a['params']['id']},'attributes':['id',_0xc2d2('0x78')],'raw':!![]};return db[_0xc2d2('0x41')][_0xc2d2('0x5b')](_0x5e67c4)[_0xc2d2('0x21')](handleEntityNotFound(_0x24c434,null))[_0xc2d2('0x21')](function(_0x382e6e){if(_0x382e6e){if(!_[_0xc2d2('0x85')](_0x382e6e[_0xc2d2('0x78')])){if(fs['existsSync'](path['join'](config[_0xc2d2('0x7a')],_0xc2d2('0x83'),_0x382e6e['systemAvatar']))){_0x1b5ec8=path[_0xc2d2('0x7e')](config[_0xc2d2('0x7a')],_0xc2d2('0x83'),_0x382e6e[_0xc2d2('0x78')]);}}return _0x24c434[_0xc2d2('0x80')](_0x1b5ec8);}})['catch'](handleError(_0x24c434,null));};exports[_0xc2d2('0x89')]=function(_0x170808,_0x526a98,_0x591609){var _0x358fc5=require(_0xc2d2('0x8a'));var _0x4469cb=new _0x358fc5();var _0x4edeed=_0x4469cb['setUA'](_0x170808[_0xc2d2('0x8b')][_0xc2d2('0x8c')])[_0xc2d2('0x8d')]();var _0x20dad5={'body':_0x170808[_0xc2d2('0x5d')],'channel':_0xc2d2('0x8e')};var _0x34a77f=[];var _0x59dce8=[];var _0x25776c={};var _0x203aac=![];return db['CmContact'][_0xc2d2('0x64')]()[_0xc2d2('0x21')](function(_0xedc4f4){if(!_0xedc4f4){throw new db[(_0xc2d2('0x8f'))][(_0xc2d2('0x90'))](_0xc2d2('0x91'));}_0x34a77f=_['difference'](_[_0xc2d2('0x59')](_0xedc4f4),[_0xc2d2('0x92'),'updatedAt']);_0x59dce8=_[_0xc2d2('0x93')](_[_0xc2d2('0x59')](_0xedc4f4),[_0xc2d2('0x92'),_0xc2d2('0x94'),_0xc2d2('0x95'),_0xc2d2('0x96')]);if(_0x170808[_0xc2d2('0x5d')]['id']){delete _0x170808['body']['id'];}if(_[_0xc2d2('0x85')](_0x170808[_0xc2d2('0x5d')][_0xc2d2('0x97')])){throw new db[(_0xc2d2('0x8f'))][(_0xc2d2('0x90'))](_0xc2d2('0x98'));}if(_[_0xc2d2('0x85')](_0x170808[_0xc2d2('0x5d')][_0xc2d2('0x5d')])||_0x170808[_0xc2d2('0x5d')][_0xc2d2('0x5d')]===''){throw new db[(_0xc2d2('0x8f'))][(_0xc2d2('0x90'))](_0xc2d2('0x99'));}if(_[_0xc2d2('0x85')](_0x170808[_0xc2d2('0x5d')]['mapKey'])){throw new db[(_0xc2d2('0x8f'))]['ValidationError']('mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20'+_0x59dce8);}if(!_['includes'](_0x59dce8,_0x170808[_0xc2d2('0x5d')][_0xc2d2('0x9a')])){throw new db[(_0xc2d2('0x8f'))][(_0xc2d2('0x90'))](_0xc2d2('0x9b')+_0x59dce8);}_0x25776c[_0x170808[_0xc2d2('0x5d')][_0xc2d2('0x9a')]]=_0x170808['body']['from'];})[_0xc2d2('0x21')](function(){return db[_0xc2d2('0x41')]['find']({'where':{'id':_0x170808['params']['id']},'include':[{'model':db[_0xc2d2('0x9c')],'as':_0xc2d2('0x9d'),'include':[{'model':db[_0xc2d2('0x9e')],'as':'Contacts','where':_0x25776c,'limit':0x1,'order':[['updatedAt','DESC']]}]},{'model':db['ChatApplication'],'as':_0xc2d2('0x9f')}]});})[_0xc2d2('0x21')](handleEntityNotFound(_0x526a98,null))[_0xc2d2('0x21')](function(_0x11bc85){if(_0x11bc85&&_0x11bc85[_0xc2d2('0x9d')]){_0x20dad5[_0xc2d2('0xa0')]=_0x11bc85;_0x20dad5[_0xc2d2('0xa1')]=_0x11bc85[_0xc2d2('0x9f')];_0x20dad5[_0xc2d2('0xa2')]=_0x11bc85['List'];_0x20dad5[_0xc2d2('0xa1')]=_[_0xc2d2('0xa3')](_0x20dad5['applications'],[_0xc2d2('0xa4')],[_0xc2d2('0xa5')]);if(_0x20dad5[_0xc2d2('0xa0')][_0xc2d2('0x9f')]){delete _0x20dad5[_0xc2d2('0xa0')][_0xc2d2('0x9f')];}if(_0x20dad5['account'][_0xc2d2('0x9d')]&&_0x20dad5['account']['List'][_0xc2d2('0xa6')][_0xc2d2('0x47')]){return _0x20dad5[_0xc2d2('0xa0')][_0xc2d2('0x9d')][_0xc2d2('0xa6')][0x0];}var _0x3b414c=_[_0xc2d2('0x1a')](_0x170808[_0xc2d2('0x5d')],{'firstName':_0x170808['body'][_0xc2d2('0x97')],'ListId':_0x11bc85['ListId']});_0x3b414c[_0x170808['body']['mapKey']]=_0x170808[_0xc2d2('0x5d')][_0xc2d2('0x97')];return db[_0xc2d2('0x9e')]['create'](_0x3b414c,{'fields':_0x34a77f,'raw':!![]});}})[_0xc2d2('0x21')](handleEntityNotFound(_0x526a98,null))[_0xc2d2('0x21')](function(_0x336763){_0x20dad5[_0xc2d2('0xa7')]=_0x336763;var _0x3c7601=_0x170808[_0xc2d2('0x5d')][_0xc2d2('0xa8')];if(_0x170808[_0xc2d2('0x8b')][_0xc2d2('0xa9')]){_0x3c7601=_0x170808[_0xc2d2('0x8b')][_0xc2d2('0xa9')];}else if(_0x170808[_0xc2d2('0x8b')]['x-forwarded-for']){_0x3c7601=_[_0xc2d2('0xaa')](_0x170808['headers'][_0xc2d2('0xab')]['split'](','));}if(_0x336763){var _0x3373d7={'ContactId':_0x336763['id'],'ChatWebsiteId':_0x170808[_0xc2d2('0x58')]['id'],'from':(_0x336763[_0xc2d2('0xac')]||'')+'\x20'+(_0x336763[_0xc2d2('0xad')]||''),'customerIp':_0x3c7601,'customerPort':_0x170808[_0xc2d2('0x8b')][_0xc2d2('0xae')]?_0x170808[_0xc2d2('0x8b')]['x-real-port']:null,'referer':_0x170808[_0xc2d2('0x5d')][_0xc2d2('0xaf')],'browserName':_0x4edeed[_0xc2d2('0xb0')][_0xc2d2('0x3c')]&&_0x4edeed[_0xc2d2('0xb0')][_0xc2d2('0xb1')]?util[_0xc2d2('0xb2')](_0xc2d2('0xb3'),_0x4edeed[_0xc2d2('0xb0')]['name'],_0x4edeed[_0xc2d2('0xb0')][_0xc2d2('0xb1')]):_0xc2d2('0xb4'),'browserVersion':_0x4edeed[_0xc2d2('0xb0')][_0xc2d2('0xb1')]||_0xc2d2('0xb4'),'osName':util['format'](_0xc2d2('0xb3'),_0x4edeed['os'][_0xc2d2('0x3c')],_0x4edeed['os']['version']),'osVersion':_0x4edeed['os'][_0xc2d2('0xb1')],'deviceModel':_0x4edeed[_0xc2d2('0xb5')][_0xc2d2('0x48')]&&_0x4edeed['device']['vendor']?util[_0xc2d2('0xb2')](_0xc2d2('0xb6'),_0x4edeed[_0xc2d2('0xb5')][_0xc2d2('0x48')],_0x4edeed[_0xc2d2('0xb5')][_0xc2d2('0xb7')],_0x4edeed[_0xc2d2('0xb5')]['type']):null,'deviceVendor':_0x4edeed['device'][_0xc2d2('0xb7')],'deviceType':_0x4edeed[_0xc2d2('0xb5')]['type'],'formData':JSON[_0xc2d2('0x25')](_0x170808[_0xc2d2('0x5d')])};var _0x2a03f6={'ChatWebsiteId':_0x170808['params']['id'],'closed':![]};if(_0x170808['body'][_0xc2d2('0xb8')]){_0x2a03f6[_0xc2d2('0xb8')]=_0x170808[_0xc2d2('0x5d')][_0xc2d2('0xb8')];return db[_0xc2d2('0xb9')][_0xc2d2('0x5b')]({'where':_0x2a03f6})[_0xc2d2('0x21')](function(_0xd916ec){if(_0xd916ec){return[_0xd916ec,![]];}_0x3373d7[_0xc2d2('0xb8')]=_0x170808['body']['threadId'];_0x3373d7[_0xc2d2('0xba')]=_0x170808[_0xc2d2('0x5d')][_0xc2d2('0xba')];return db[_0xc2d2('0xb9')][_0xc2d2('0x5c')](_0x3373d7)[_0xc2d2('0x21')](function(_0x3d8380){return[_0x3d8380,!![]];});});}_0x2a03f6[_0xc2d2('0xbb')]=_0x336763['id'];if(_0x170808[_0xc2d2('0x5d')][_0xc2d2('0xbc')]&&_0x170808['body'][_0xc2d2('0xbc')]['id']){_0x2a03f6['id']=_0x170808['body']['interaction']['id'];return db['ChatInteraction'][_0xc2d2('0x5b')]({'where':_0x2a03f6})[_0xc2d2('0x21')](function(_0x5b4a26){if(_0x5b4a26){return[_0x5b4a26,![]];}return db['ChatInteraction']['create'](_0x3373d7)[_0xc2d2('0x21')](function(_0x2f3ec0){return[_0x2f3ec0,!![]];});});}return db[_0xc2d2('0xb9')][_0xc2d2('0x5c')](_0x3373d7)[_0xc2d2('0x21')](function(_0x2e729a){return[_0x2e729a,!![]];});}})[_0xc2d2('0xbd')](function(_0x4d875e,_0x2fa727){if(_0x4d875e){_0x203aac=_0x2fa727;if(!_0x2fa727){var _0xd1c839={'from':(_0x20dad5[_0xc2d2('0xa7')][_0xc2d2('0xac')]||'')+'\x20'+(_0x20dad5[_0xc2d2('0xa7')]['lastName']||'')};if(_0x170808['body'][_0xc2d2('0xb8')]&&_0x170808[_0xc2d2('0x5d')][_0xc2d2('0xbe')]&&_0x170808[_0xc2d2('0x5d')][_0xc2d2('0xb8')]!=_0x170808[_0xc2d2('0x5d')]['messageId']){_0xd1c839[_0xc2d2('0xb8')]=_0x170808[_0xc2d2('0x5d')][_0xc2d2('0xbe')];}return _0x4d875e[_0xc2d2('0x36')](_0xd1c839);}else{return _0x4d875e;}}})[_0xc2d2('0x21')](function(_0x5e0fe4){_0x20dad5['interaction']=_0x5e0fe4[_0xc2d2('0x38')]({'plain':!![]});_0x20dad5['interaction']['created']=_0x203aac;if(_0x20dad5[_0xc2d2('0xbc')][_0xc2d2('0xbf')]){if(_0x20dad5[_0xc2d2('0xa0')]['autoclose']){_0x20dad5[_0xc2d2('0xa1')][_0xc2d2('0xc0')]({'id':0x0,'priority':_0x20dad5['applications']['length']+0x1,'app':_0xc2d2('0xc1'),'appdata':_0xc2d2('0xc2'),'interval':_0xc2d2('0xc3')});}}return db[_0xc2d2('0xc4')][_0xc2d2('0x5c')]({'body':_0x170808[_0xc2d2('0x5d')]['body'],'ChatWebsiteId':_0x170808[_0xc2d2('0x58')]['id'],'ChatInteractionId':_0x5e0fe4['id'],'direction':'in','ContactId':_0x20dad5[_0xc2d2('0xa7')]['id'],'AttachmentId':_0x170808['body'][_0xc2d2('0xc5')]});})['then'](function(_0x41eab8){_0x20dad5['message']=_0x41eab8;if(_0x20dad5[_0xc2d2('0xbc')][_0xc2d2('0xc6')]){return db[_0xc2d2('0xc7')]['find']({'attributes':['id',_0xc2d2('0x3c')],'where':{'id':_0x20dad5[_0xc2d2('0xbc')][_0xc2d2('0xc6')]}})['then'](function(_0x22e031){if(_0x22e031){_0x20dad5[_0xc2d2('0xa1')][_0xc2d2('0xc8')]({'id':0x0,'priority':0x0,'app':_0xc2d2('0xc9'),'appdata':_0x22e031[_0xc2d2('0x3c')]+','+(_0x20dad5[_0xc2d2('0xa0')][_0xc2d2('0xca')]||0xa),'interval':_0xc2d2('0xc3')});_0x20dad5[_0xc2d2('0xcb')]=!![];}return respondWithRpcPromise('Start',_0xc2d2('0xcc'),_0x20dad5);});}return respondWithRpcPromise(_0xc2d2('0xcd'),'startRouting',_0x20dad5);})[_0xc2d2('0x21')](function(_0x527cfc){respondWithRpcPromise(_0xc2d2('0xce'),_0xc2d2('0xce'),{'event':_0xc2d2('0x89'),'message':_0x527cfc},client9002);return _0x527cfc;})[_0xc2d2('0x21')](respondWithResult(_0x526a98,null))[_0xc2d2('0x56')](handleError(_0x526a98,null));};exports['offline']=function(_0x5ea697,_0x445f86,_0x10b168){var _0x27d804,_0x4e6243,_0x15bf22;var _0x5214fb=[];var _0x5a575d=[];var _0x1c913d={};var _0x377141=_0x5ea697[_0xc2d2('0xcf')]||[];var _0x2be476=[];var _0x735f99;return db[_0xc2d2('0x9e')][_0xc2d2('0x64')]()[_0xc2d2('0x21')](function(_0x13799c){if(!_0x13799c){throw new db[(_0xc2d2('0x8f'))][(_0xc2d2('0x90'))](_0xc2d2('0x91'));}_0x5a575d=_[_0xc2d2('0x93')](_[_0xc2d2('0x59')](_0x13799c),['createdAt','updatedAt']);_0x5214fb=_[_0xc2d2('0x93')](_[_0xc2d2('0x59')](_0x13799c),['createdAt','updatedAt',_0xc2d2('0x95'),_0xc2d2('0x96')]);if(_0x5ea697[_0xc2d2('0x5d')]['id']){delete _0x5ea697[_0xc2d2('0x5d')]['id'];}if(_[_0xc2d2('0x85')](_0x5ea697[_0xc2d2('0x5d')][_0xc2d2('0x97')])){throw _0x445f86[_0xc2d2('0x2a')](0x1f4)[_0xc2d2('0x3d')](new db[(_0xc2d2('0x8f'))][(_0xc2d2('0x90'))](_0xc2d2('0x98')));}if(_[_0xc2d2('0x85')](_0x5ea697[_0xc2d2('0x5d')][_0xc2d2('0x5d')])||_0x5ea697[_0xc2d2('0x5d')][_0xc2d2('0x5d')]===''){throw _0x445f86[_0xc2d2('0x2a')](0x1f4)[_0xc2d2('0x3d')](new db['Sequelize'][(_0xc2d2('0x90'))](_0xc2d2('0x99')));}if(_[_0xc2d2('0x85')](_0x5ea697['body'][_0xc2d2('0xd0')])){throw _0x445f86[_0xc2d2('0x2a')](0x1f4)[_0xc2d2('0x3d')](new db['Sequelize'][(_0xc2d2('0x90'))]('mapKeyOffline\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20'+_0x5214fb));}if(!_[_0xc2d2('0xd1')](_0x5214fb,_0x5ea697[_0xc2d2('0x5d')]['mapKeyOffline'])){throw _0x445f86[_0xc2d2('0x2a')](0x1f4)[_0xc2d2('0x3d')](new db[(_0xc2d2('0x8f'))][(_0xc2d2('0x90'))]('mapKeyOffline\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20'+_0x5214fb));}_0x1c913d[_0x5ea697[_0xc2d2('0x5d')][_0xc2d2('0xd0')]]=_0x5ea697['body'][_0xc2d2('0x97')];})[_0xc2d2('0x21')](function(){return db[_0xc2d2('0x41')][_0xc2d2('0x5b')]({'where':{'id':_0x5ea697[_0xc2d2('0x58')]['id']},'include':[{'model':db['CmList'],'as':_0xc2d2('0x9d')},{'model':db[_0xc2d2('0xd2')],'as':_0xc2d2('0xd2')}]});})[_0xc2d2('0x21')](handleEntityNotFound(_0x445f86,null))[_0xc2d2('0x21')](function(_0x35ce86){if(_0x35ce86&&_0x35ce86[_0xc2d2('0x9d')]){_0x4e6243=_0x35ce86;var _0x52e04f=_[_0xc2d2('0x1a')](_0x5ea697[_0xc2d2('0x5d')],{'firstName':_0x5ea697[_0xc2d2('0x5d')][_0xc2d2('0x97')],'phone':_0x5ea697[_0xc2d2('0x5d')][_0xc2d2('0x97')],'ListId':_0x35ce86[_0xc2d2('0x96')]});_0x52e04f[_0x5ea697[_0xc2d2('0x5d')][_0xc2d2('0xd0')]]=_0x5ea697[_0xc2d2('0x5d')][_0xc2d2('0x97')];return db[_0xc2d2('0x9e')][_0xc2d2('0xd3')]({'where':_0x1c913d,'defaults':_0x52e04f});}})[_0xc2d2('0xbd')](function(_0x3c8bb2){if(_0x3c8bb2){_0x15bf22=_0x3c8bb2;var _0x3823cb=fs[_0xc2d2('0xd4')](path[_0xc2d2('0x7e')](config['root'],'server/files/templates/chatOfflineMessage.ejs'),_0xc2d2('0xd5'));var _0x28c2e9=ejs[_0xc2d2('0xd6')](_0x3823cb,{'body':_[_0xc2d2('0xd7')](_0x5ea697['body'][_0xc2d2('0x5d')]),'bodyTitle':_0x4e6243[_0xc2d2('0xd8')]});return db[_0xc2d2('0xd9')][_0xc2d2('0x5c')]({'body':_0x28c2e9,'ContactId':_0x3c8bb2['id'],'ChatWebsiteId':_0x4e6243['id']});}})[_0xc2d2('0x21')](function(_0x59f841){_0x735f99=_0x59f841;if(_0x377141[_0xc2d2('0x47')]){var _0x1b696d=_0x377141[_0xc2d2('0x40')](function(_0x433cfd){return{'name':_0x433cfd['originalname'],'basename':_0x433cfd[_0xc2d2('0x73')],'type':_0x433cfd[_0xc2d2('0xda')],'ChatOfflineMessageId':_0x59f841['id']};});_0x2be476=_0x1b696d[_0xc2d2('0x40')](_0x34d1d1=>{var _0x54b1b8={'filename':_0x34d1d1[_0xc2d2('0x3c')],'path':path['join'](config[_0xc2d2('0x7a')],'server','files','attachments',_0xc2d2('0xdb'),_0x34d1d1[_0xc2d2('0xdc')])};return _0x54b1b8;});if(!_0x4e6243[_0xc2d2('0xdd')]){return db[_0xc2d2('0xde')][_0xc2d2('0xdf')](function(_0x418a08){return db[_0xc2d2('0xe0')][_0xc2d2('0xe1')](_0x1b696d,{'transaction':_0x418a08});});}}})[_0xc2d2('0x21')](function(){if(_0x735f99){_0x27d804=_0x735f99;return db[_0xc2d2('0xd2')][_0xc2d2('0x68')]({'where':{'active':!![]},'include':[{'model':db[_0xc2d2('0xe2')],'as':_0xc2d2('0xe3'),'raw':!![]}]});}})[_0xc2d2('0x21')](function(_0x6738f6){if(_0x6738f6&&_0x6738f6[_0xc2d2('0xe3')]&&_0x4e6243[_0xc2d2('0xe4')]&&_0x4e6243[_0xc2d2('0xe5')]){var _0x1b1b05={'tls':{'rejectUnauthorized':![]}};if(_0x6738f6[_0xc2d2('0xe3')]['service']){_0x1b1b05[_0xc2d2('0xe6')]=_0x6738f6[_0xc2d2('0xe3')][_0xc2d2('0xe6')];}else{_0x1b1b05['host']=_0x6738f6['Smtp']['host'];_0x1b1b05[_0xc2d2('0xe7')]=_0x6738f6[_0xc2d2('0xe3')][_0xc2d2('0xe7')];_0x1b1b05['secure']=_0x6738f6[_0xc2d2('0xe3')][_0xc2d2('0xe8')];}if(_0x6738f6['Smtp']['authentication']){_0x1b1b05[_0xc2d2('0xe9')]={'user':_0x6738f6[_0xc2d2('0xe3')][_0xc2d2('0x5e')],'pass':_0x6738f6[_0xc2d2('0xe3')][_0xc2d2('0xea')]};}return respondWithRpcPromise('SendMail',_0xc2d2('0xeb'),{'account':_0x1b1b05,'message':{'from':util[_0xc2d2('0xb2')](_0xc2d2('0xec'),_0x6738f6[_0xc2d2('0x3c')],_0x6738f6['email']||_0x6738f6['Smtp'][_0xc2d2('0x5e')]),'to':_0x4e6243[_0xc2d2('0xe5')],'subject':_0x4e6243[_0xc2d2('0xed')],'html':_0x27d804['body'],'attachments':_0x2be476}},client9003)[_0xc2d2('0x21')](function(){return _0x27d804;})[_0xc2d2('0x56')](function(_0x2fe58d){console[_0xc2d2('0x26')](_0x2fe58d);});}})[_0xc2d2('0x21')](function(){if(_0x4e6243&&_0x4e6243[_0xc2d2('0xdd')]&&_0x4e6243[_0xc2d2('0xee')]){var _0x32279f=[];if(_0x377141[_0xc2d2('0x47')]){_0x32279f=_0x377141[_0xc2d2('0x40')](function(_0x37df83){return{'name':_0x37df83[_0xc2d2('0xef')],'basename':_0x37df83[_0xc2d2('0x73')],'type':_0x37df83['mimetype'],'ChatOfflineMessageId':_0x735f99['id']};});}var _0x13b903;if(!_['isNil'](_0x4e6243[_0xc2d2('0xf0')])){var _0x30accc=_[_0xc2d2('0x40')](_0x5ea697[_0xc2d2('0x5d')],function(_0x310012){return _0x310012;});var _0x128165=_[_0xc2d2('0xf1')](_0x30accc)[0x0];var _0x4f3325=_[_0xc2d2('0xf2')](_0x128165,function(_0x3e70bd){return _0x3e70bd;});_0x13b903=_0x4f3325[0x1][_0x4e6243[_0xc2d2('0xf0')]];}var _0x4ea027={'from':_0x15bf22[_0xc2d2('0xf3')],'firstName':_0x15bf22[_0xc2d2('0xac')],'lastName':_0x15bf22[_0xc2d2('0xad')],'mapKey':_0xc2d2('0xf3'),'message':{'from':_0x15bf22[_0xc2d2('0xf3')],'to':_0x4e6243['MailAccount'][_0xc2d2('0xf3')],'cc':'','subject':_[_0xc2d2('0x85')](_0x13b903)?_0x4e6243[_0xc2d2('0xed')]:_0x13b903,'messageId':'','sentAt':new Date(),'attach':_0x32279f[_0xc2d2('0x47')],'attachments':_0x32279f,'originChannel':_0xc2d2('0xf4'),'ChatWebsiteId':_0x4e6243['id'],'ChatOfflineMessageId':_0x27d804['id'],'originTo':_0x4e6243[_0xc2d2('0xd2')][_0xc2d2('0xf3')]},'body':_0x27d804[_0xc2d2('0x5d')]};var _0x4bbb82={'account':{'id':_0x4e6243[_0xc2d2('0xee')]},'body':_0x4ea027,'log':_0xc2d2('0xf5')};return respondWithRpcPromise(_0xc2d2('0xf5'),_0xc2d2('0xf6'),_0x4bbb82,client9001)[_0xc2d2('0x21')](function(){return _0x27d804;})[_0xc2d2('0x56')](function(_0x3cd944){console[_0xc2d2('0x26')](_0x3cd944);});}return;})[_0xc2d2('0x21')](function(){if(_0x27d804){return _0x27d804;}})[_0xc2d2('0x21')](respondWithResult(_0x445f86,null))['catch'](function(_0x28e4b9){console[_0xc2d2('0x26')]('catch',_0x28e4b9);for(var _0x595e76 of _0x377141){var _0x46a60b=path[_0xc2d2('0x7e')](config[_0xc2d2('0x7a')],_0xc2d2('0xf7'),_0xc2d2('0xcf'),_0xc2d2('0xf8'),_0xc2d2('0xdb'),_0x595e76[_0xc2d2('0x73')]);fs_extra[_0xc2d2('0xf9')](_0x46a60b)[_0xc2d2('0x56')](function(_0x54d34b){console[_0xc2d2('0x26')]('Could\x20not\x20remove\x20attachment\x20file',_0x46a60b,_0x54d34b);});}});};exports[_0xc2d2('0xfa')]=function(_0x20de97,_0x5b40ac,_0x105621){return db[_0xc2d2('0xb9')][_0xc2d2('0x5b')]({'where':{'id':_0x20de97['params']['id']}})[_0xc2d2('0x21')](handleEntityNotFound(_0x5b40ac,null))[_0xc2d2('0x21')](function(_0x5ae770){if(_0x5ae770){return _0x5ae770[_0xc2d2('0xfa')](_0x20de97[_0xc2d2('0x5d')][_0xc2d2('0x6b')],_['omit'](_0x20de97['body'],[_0xc2d2('0x6b'),'id'])||{});}})['then'](respondWithResult(_0x5b40ac,null))['catch'](handleError(_0x5b40ac,null));};exports[_0xc2d2('0xfb')]=function(_0x588df2,_0x205bc6,_0x16cc9d){var _0xedb9e6={'raw':![],'where':{}};var _0x46197f={};var _0x24e77f={'count':0x0,'rows':[]};return db[_0xc2d2('0x41')][_0xc2d2('0x68')]({'where':{'id':_0x588df2['params']['id']}})[_0xc2d2('0x21')](handleEntityNotFound(_0x205bc6,null))['then'](function(_0x412752){if(_0x412752){_0x46197f[_0xc2d2('0x48')]=_[_0xc2d2('0x59')](db['ChatInteraction']['rawAttributes']);_0x46197f[_0xc2d2('0x44')]=_[_0xc2d2('0x59')](_0x588df2[_0xc2d2('0x44')]);_0x46197f['filters']=_['intersection'](_0x46197f['model'],_0x46197f[_0xc2d2('0x44')]);_0xedb9e6[_0xc2d2('0x46')]=_[_0xc2d2('0x5a')](_0x46197f[_0xc2d2('0x48')],qs[_0xc2d2('0x45')](_0x588df2[_0xc2d2('0x44')][_0xc2d2('0x45')]));_0xedb9e6[_0xc2d2('0x46')]=_0xedb9e6[_0xc2d2('0x46')][_0xc2d2('0x47')]?_0xedb9e6['attributes']:_0x46197f[_0xc2d2('0x48')];if(!_0x588df2[_0xc2d2('0x44')][_0xc2d2('0x49')](_0xc2d2('0x4a'))){_0xedb9e6['limit']=qs[_0xc2d2('0x30')](_0x588df2['query'][_0xc2d2('0x30')]);_0xedb9e6[_0xc2d2('0x2d')]=qs[_0xc2d2('0x2d')](_0x588df2['query'][_0xc2d2('0x2d')]);}_0xedb9e6[_0xc2d2('0x4b')]=qs['sort'](_0x588df2[_0xc2d2('0x44')][_0xc2d2('0x4c')]);_0xedb9e6[_0xc2d2('0x4d')]=qs[_0xc2d2('0x4e')](_[_0xc2d2('0x4f')](_0x588df2[_0xc2d2('0x44')],_0x46197f['filters']));_0xedb9e6[_0xc2d2('0x4d')][_0xc2d2('0x66')]=_0x412752['id'];if(_0x588df2[_0xc2d2('0x44')][_0xc2d2('0x50')]){_0xedb9e6[_0xc2d2('0x4d')]=_['merge'](_0xedb9e6[_0xc2d2('0x4d')],{'$or':_[_0xc2d2('0x40')](_0xedb9e6[_0xc2d2('0x46')],function(_0x2b7bb4){var _0x5692de={};_0x5692de[_0x2b7bb4]={'$like':'%'+_0x588df2[_0xc2d2('0x44')]['filter']+'%'};return _0x5692de;})});}_0xedb9e6=_[_0xc2d2('0x51')]({},_0xedb9e6,_0x588df2[_0xc2d2('0x6f')]);return db[_0xc2d2('0xb9')][_0xc2d2('0x2f')]({'where':_0xedb9e6[_0xc2d2('0x4d')]})['then'](function(_0x1dde1f){_0x24e77f[_0xc2d2('0x2f')]=_0x1dde1f;if(_0x588df2[_0xc2d2('0x44')][_0xc2d2('0x53')]){_0xedb9e6[_0xc2d2('0x6a')]=[{'model':db[_0xc2d2('0x9e')],'as':_0xc2d2('0xfc'),'required':![]},{'model':db[_0xc2d2('0xc7')],'as':_0xc2d2('0xfd'),'attributes':[_0xc2d2('0x3c'),'fullname',_0xc2d2('0xfe')],'required':![]},{'model':db[_0xc2d2('0xff')],'as':_0xc2d2('0x100'),'attributes':['id',_0xc2d2('0x3c'),_0xc2d2('0x101')],'where':_0x588df2['query'][_0xc2d2('0x102')]?{'id':_0x588df2[_0xc2d2('0x44')]['tag']}:undefined,'required':_0x588df2[_0xc2d2('0x44')][_0xc2d2('0x102')]?!![]:![]}];}return db[_0xc2d2('0xb9')][_0xc2d2('0x54')](_0xedb9e6);})[_0xc2d2('0x21')](function(_0x140618){_0x24e77f[_0xc2d2('0x55')]=_0x140618;return _0x24e77f;});}})[_0xc2d2('0x21')](respondWithFilteredResult(_0x205bc6,_0xedb9e6))['catch'](handleError(_0x205bc6,null));};function iftimePromise(_0x4c21a1,_0x2b851f){return respondWithRpcPromise(_0xc2d2('0x103'),_0xc2d2('0x104'),{'command':_0x2b851f[_0xc2d2('0x105')]?util['format'](_0xc2d2('0x106'),_0x4c21a1[_0xc2d2('0x107')],_0x2b851f[_0xc2d2('0x105')]):util[_0xc2d2('0xb2')]('iftime\x20%s',_0x4c21a1[_0xc2d2('0x107')])},client9002)[_0xc2d2('0x21')](function(_0x186dda){var _0x596f12=_0x186dda&&_0x186dda['indexOf'](_0xc2d2('0x108'))>=0x0?!![]:![];logger['info'](_0xc2d2('0x109'),_0x2b851f['id'],_0x4c21a1['id'],_0x4c21a1['interval'],_0x596f12?_0xc2d2('0x10a'):_0xc2d2('0x10b'),_0x2b851f[_0xc2d2('0x105')]?_0x2b851f[_0xc2d2('0x105')]:_0xc2d2('0x10c'));return _0x596f12;})[_0xc2d2('0x56')](function(_0x54871d){logger[_0xc2d2('0x26')](_0xc2d2('0x109'),_0x2b851f['id'],_0x4c21a1['id'],_0x4c21a1[_0xc2d2('0x107')],util['inspect'](_0x54871d,{'showHidden':![],'depth':null}),_0x2b851f[_0xc2d2('0x105')]?_0x2b851f[_0xc2d2('0x105')]:_0xc2d2('0x10c'));return![];});}exports[_0xc2d2('0x104')]=function(_0x56735f,_0x16ce7,_0x47697f){var _0x47a7e0=0x0;var _0x1a4a7e=0x0;var _0x5c5629=![];var _0x448890;var _0x2e718e;return db[_0xc2d2('0x41')][_0xc2d2('0x5b')]({'where':{'id':_0x56735f[_0xc2d2('0x58')]['id']},'include':[{'model':db[_0xc2d2('0x10d')],'as':'Interval','include':[{'model':db[_0xc2d2('0x10d')],'as':_0xc2d2('0x10e'),'attributes':['id',_0xc2d2('0x107')],'raw':!![]}]}]})[_0xc2d2('0x21')](handleEntityNotFound(_0x16ce7,null))['then'](function(_0x236d11){if(_0x236d11){_0x448890=_0x236d11;return _0x236d11[_0xc2d2('0x10f')]({'raw':!![]});}})['then'](function(_0x3ffa3e){if(_0x448890){if(_0x3ffa3e){_0x2e718e=_0x3ffa3e;}}return require(_0xc2d2('0x18'))['getLicense']();})[_0xc2d2('0x21')](function(_0x55dfae){if(_0x55dfae){_0x1a4a7e=_0x55dfae[_0xc2d2('0x110')];_0x5c5629=_0x55dfae[_0xc2d2('0x7c')];}})[_0xc2d2('0x21')](function(){return db['ChatInteraction'][_0xc2d2('0x2f')]({'where':{'closed':![]}});})[_0xc2d2('0x21')](function(_0x185db9){_0x47a7e0=_0x185db9;if(_0x1a4a7e&&_0x185db9>_0x1a4a7e){return db['License'][_0xc2d2('0x68')]({'where':{'id':0x1}})[_0xc2d2('0x21')](function(_0x3af522){if(_0x3af522){_0x3af522[_0xc2d2('0x111')](_0xc2d2('0x112'));}});}})[_0xc2d2('0x21')](function(){if(_0x448890[_0xc2d2('0x10d')]&&_0x448890['Interval'][_0xc2d2('0x10e')]){var _0x2813c3=[];for(var _0x151c59=0x0;_0x151c59<_0x448890['Interval']['Intervals'][_0xc2d2('0x47')];_0x151c59++){var _0x457424=_0x448890['Interval'][_0xc2d2('0x10e')][_0x151c59][_0xc2d2('0x38')]({'plain':!![]});_0x2813c3['push'](iftimePromise(_0x457424,_0x448890));}return BPromise[_0xc2d2('0x113')](_0x2813c3)[_0xc2d2('0x21')](function(_0xbbed4c){return _[_0xc2d2('0x114')](_0xbbed4c);});}else{return!![];}})[_0xc2d2('0x21')](function(_0x35bb5f){var _0x4a07eb=fs['readFileSync'](path[_0xc2d2('0x7e')](config['root'],_0xc2d2('0x115')),_0xc2d2('0xd5'));var _0x48a935={'remote':_0x448890[_0xc2d2('0x116')],'query':querystring[_0xc2d2('0x25')](_[_0xc2d2('0x51')](_0x448890['get']({'plain':!![]}),{'customerIp':_0x56735f['headers']['x-forwarded-for']||_0x56735f[_0xc2d2('0x8b')][_0xc2d2('0x117')]||_0x56735f[_0xc2d2('0x118')][_0xc2d2('0x119')]||_0x56735f['ip'],'referer':_0x56735f[_0xc2d2('0x8b')]['referer'],'openedInteractions':_0x47a7e0,'maxInteractions':_0x1a4a7e,'virtual':_0x5c5629[_0xc2d2('0x110')],'online':_0x35bb5f,'custom':_0x5c5629}))[_0xc2d2('0x11a')](/'/g,'\x5c\x27')};_0x16ce7['send'](ejs[_0xc2d2('0xd6')](Mustache[_0xc2d2('0xd6')](_0x4a07eb,_0x48a935),{'proactiveActions':_0x2e718e,'alignment':_0x448890[_0xc2d2('0x11b')],'verticalAlignment':_0x448890[_0xc2d2('0x11c')],'div_color':_0x448890[_0xc2d2('0x101')],'text_color':_0x448890[_0xc2d2('0x11d')],'button_color':_0x448890['color_button'],'background_color':_0x448890[_0xc2d2('0x11e')]}));})[_0xc2d2('0x56')](handleError(_0x16ce7,null));};exports['addApplications']=function(_0x22b120,_0x58b622,_0x2354c1){return db['ChatWebsite'][_0xc2d2('0x68')]({'where':{'id':_0x22b120[_0xc2d2('0x58')]['id']}})['then'](handleEntityNotFound(_0x58b622,null))[_0xc2d2('0x21')](function(_0x351f0d){if(_0x351f0d){return db[_0xc2d2('0xde')][_0xc2d2('0xdf')](function(_0x2434e6){return db[_0xc2d2('0x11f')][_0xc2d2('0x37')]({'where':{'ChatWebsiteId':_0x22b120[_0xc2d2('0x58')]['id']},'transaction':_0x2434e6})[_0xc2d2('0x21')](function(_0x422b24){var _0x64cbdf=_['map'](_0x22b120[_0xc2d2('0x5d')],function(_0x19d01a){_0x19d01a[_0xc2d2('0x66')]=_0x22b120['params']['id'];return _0x19d01a;});return db[_0xc2d2('0x11f')]['bulkCreate'](_0x64cbdf,{'transaction':_0x2434e6});});})['then'](function(){return db[_0xc2d2('0x11f')][_0xc2d2('0x120')]({'where':{'ChatWebsiteId':_0x22b120[_0xc2d2('0x58')]['id']},'order':'priority'});});}})['then'](respondWithResult(_0x58b622,null))[_0xc2d2('0x56')](handleError(_0x58b622,null));};exports[_0xc2d2('0x121')]=function(_0x419113,_0xd59e02,_0x5f73d3){var _0x3dd029={};var _0x4e750e={};var _0x4a39f5;var _0x11ebb1;return db['ChatWebsite']['findOne']({'where':{'id':_0x419113[_0xc2d2('0x58')]['id']}})[_0xc2d2('0x21')](handleEntityNotFound(_0xd59e02,null))[_0xc2d2('0x21')](function(_0x4af8ab){if(_0x4af8ab){_0x4a39f5=_0x4af8ab;_0x4e750e[_0xc2d2('0x48')]=_[_0xc2d2('0x59')](db['ChatApplication'][_0xc2d2('0x42')]);_0x4e750e[_0xc2d2('0x44')]=_['keys'](_0x419113[_0xc2d2('0x44')]);_0x4e750e['filters']=_[_0xc2d2('0x5a')](_0x4e750e[_0xc2d2('0x48')],_0x4e750e['query']);_0x3dd029[_0xc2d2('0x46')]=_[_0xc2d2('0x5a')](_0x4e750e[_0xc2d2('0x48')],qs['fields'](_0x419113[_0xc2d2('0x44')]['fields']));_0x3dd029['attributes']=_0x3dd029[_0xc2d2('0x46')][_0xc2d2('0x47')]?_0x3dd029['attributes']:_0x4e750e[_0xc2d2('0x48')];_0x3dd029['order']=qs[_0xc2d2('0x4c')](_0x419113[_0xc2d2('0x44')][_0xc2d2('0x4c')]);_0x3dd029[_0xc2d2('0x4d')]=qs[_0xc2d2('0x4e')](_[_0xc2d2('0x4f')](_0x419113[_0xc2d2('0x44')],_0x4e750e[_0xc2d2('0x4e')]));if(_0x419113['query'][_0xc2d2('0x50')]){_0x3dd029[_0xc2d2('0x4d')]=_[_0xc2d2('0x51')](_0x3dd029[_0xc2d2('0x4d')],{'$or':_[_0xc2d2('0x40')](_0x3dd029[_0xc2d2('0x46')],function(_0x59fca7){var _0x25d492={};_0x25d492[_0x59fca7]={'$like':'%'+_0x419113[_0xc2d2('0x44')][_0xc2d2('0x50')]+'%'};return _0x25d492;})});}_0x3dd029=_[_0xc2d2('0x51')]({},_0x3dd029,_0x419113[_0xc2d2('0x6f')]);return _0x4a39f5['getApplications'](_0x3dd029);}})['then'](function(_0x51a579){if(_0x51a579){_0x11ebb1=_0x51a579['length'];if(!_0x419113['query']['hasOwnProperty'](_0xc2d2('0x4a'))){_0x3dd029[_0xc2d2('0x30')]=qs[_0xc2d2('0x30')](_0x419113[_0xc2d2('0x44')]['limit']);_0x3dd029['offset']=qs[_0xc2d2('0x2d')](_0x419113[_0xc2d2('0x44')][_0xc2d2('0x2d')]);}return _0x4a39f5[_0xc2d2('0x121')](_0x3dd029);}})[_0xc2d2('0x21')](function(_0x500e22){if(_0x500e22){return _0x500e22?{'count':_0x11ebb1,'rows':_0x500e22}:null;}})['then'](respondWithResult(_0xd59e02,null))[_0xc2d2('0x56')](handleError(_0xd59e02,null));};exports['addProactiveActions']=function(_0x397d1a,_0x139bc3,_0x4e2f3f){return db[_0xc2d2('0x122')]['find']({'where':{'id':_0x397d1a['params']['id']}})[_0xc2d2('0x21')](handleEntityNotFound(_0x139bc3,null))['then'](function(_0x419812){if(_0x419812){return _0x419812[_0xc2d2('0x123')](_0x397d1a[_0xc2d2('0x5d')][_0xc2d2('0x6b')],_['omit'](_0x397d1a[_0xc2d2('0x5d')],[_0xc2d2('0x6b'),'id'])||{});}})[_0xc2d2('0x21')](respondWithResult(_0x139bc3,null))[_0xc2d2('0x56')](handleError(_0x139bc3,null));};exports[_0xc2d2('0x10f')]=function(_0x1ed860,_0x1086f5,_0x19a063){var _0x931c7f={};var _0x5cbd6d={};var _0x32a842;var _0x193539;return db[_0xc2d2('0x41')]['findOne']({'where':{'id':_0x1ed860[_0xc2d2('0x58')]['id']}})[_0xc2d2('0x21')](handleEntityNotFound(_0x1086f5,null))[_0xc2d2('0x21')](function(_0x16b67e){if(_0x16b67e){_0x32a842=_0x16b67e;_0x5cbd6d[_0xc2d2('0x48')]=_[_0xc2d2('0x59')](db[_0xc2d2('0x124')][_0xc2d2('0x42')]);_0x5cbd6d['query']=_[_0xc2d2('0x59')](_0x1ed860[_0xc2d2('0x44')]);_0x5cbd6d[_0xc2d2('0x4e')]=_[_0xc2d2('0x5a')](_0x5cbd6d[_0xc2d2('0x48')],_0x5cbd6d[_0xc2d2('0x44')]);_0x931c7f[_0xc2d2('0x46')]=_[_0xc2d2('0x5a')](_0x5cbd6d[_0xc2d2('0x48')],qs['fields'](_0x1ed860['query'][_0xc2d2('0x45')]));_0x931c7f[_0xc2d2('0x46')]=_0x931c7f['attributes'][_0xc2d2('0x47')]?_0x931c7f['attributes']:_0x5cbd6d[_0xc2d2('0x48')];_0x931c7f[_0xc2d2('0x4b')]=qs['sort'](_0x1ed860[_0xc2d2('0x44')][_0xc2d2('0x4c')]);_0x931c7f[_0xc2d2('0x4d')]=qs[_0xc2d2('0x4e')](_[_0xc2d2('0x4f')](_0x1ed860['query'],_0x5cbd6d['filters']));if(_0x1ed860[_0xc2d2('0x44')][_0xc2d2('0x50')]){_0x931c7f['where']=_['merge'](_0x931c7f['where'],{'$or':_[_0xc2d2('0x40')](_0x931c7f[_0xc2d2('0x46')],function(_0x38e1ad){var _0x1e38ab={};_0x1e38ab[_0x38e1ad]={'$like':'%'+_0x1ed860['query'][_0xc2d2('0x50')]+'%'};return _0x1e38ab;})});}_0x931c7f=_[_0xc2d2('0x51')]({},_0x931c7f,_0x1ed860['options']);return _0x32a842[_0xc2d2('0x10f')](_0x931c7f);}})[_0xc2d2('0x21')](function(_0x365c10){if(_0x365c10){_0x193539=_0x365c10[_0xc2d2('0x47')];if(!_0x1ed860[_0xc2d2('0x44')][_0xc2d2('0x49')](_0xc2d2('0x4a'))){_0x931c7f[_0xc2d2('0x30')]=qs[_0xc2d2('0x30')](_0x1ed860[_0xc2d2('0x44')][_0xc2d2('0x30')]);_0x931c7f['offset']=qs[_0xc2d2('0x2d')](_0x1ed860[_0xc2d2('0x44')][_0xc2d2('0x2d')]);}return _0x32a842['getProactiveActions'](_0x931c7f);}})[_0xc2d2('0x21')](function(_0x526ce2){if(_0x526ce2){return _0x526ce2?{'count':_0x193539,'rows':_0x526ce2}:null;}})['then'](respondWithResult(_0x1086f5,null))[_0xc2d2('0x56')](handleError(_0x1086f5,null));};exports[_0xc2d2('0x125')]=function(_0x31aa1f,_0x11e350,_0x467c35){var _0x25a2e4=_0x31aa1f[_0xc2d2('0x44')][_0xc2d2('0x126')]===_0xc2d2('0x127')?_0xc2d2('0x128'):'onlineForm';return db['ChatWebsite'][_0xc2d2('0x5b')]({'attributes':['id',_0x25a2e4],'where':{'id':_0x31aa1f[_0xc2d2('0x58')]['id']}})[_0xc2d2('0x21')](handleEntityNotFound(_0x11e350,null))[_0xc2d2('0x21')](function(_0x4ca46f){if(_0x4ca46f){var _0x3ec395=_0x4ca46f[_0x25a2e4];var _0x51d102=_0x3ec395&&_0x3ec395[_0xc2d2('0x129')]?_0x3ec395[_0xc2d2('0x129')]:[];_0x11e350[_0xc2d2('0x3d')]({'fromKey':_[_0xc2d2('0x85')](_0x3ec395[_0xc2d2('0x12a')])?undefined:_0x3ec395[_0xc2d2('0x12a')],'count':_0x51d102[_0xc2d2('0x47')],'rows':_0x51d102});}})[_0xc2d2('0x56')](handleError(_0x11e350,null));};exports[_0xc2d2('0x12b')]=function(_0x11b8c2,_0x2507a7,_0x1eb875){var _0x5a5ea6={'raw':![],'where':{}};var _0x429262={};var _0x47f6ad={'count':0x0,'rows':[]};return db[_0xc2d2('0x41')]['findOne']({'where':{'id':_0x11b8c2[_0xc2d2('0x58')]['id']}})[_0xc2d2('0x21')](handleEntityNotFound(_0x2507a7,null))[_0xc2d2('0x21')](function(_0xcbe640){if(_0xcbe640){_0x429262['model']=_[_0xc2d2('0x59')](db[_0xc2d2('0xd9')]['rawAttributes']);_0x429262[_0xc2d2('0x44')]=_[_0xc2d2('0x59')](_0x11b8c2['query']);_0x429262[_0xc2d2('0x4e')]=_['intersection'](_0x429262['model'],_0x429262[_0xc2d2('0x44')]);_0x5a5ea6[_0xc2d2('0x46')]=_[_0xc2d2('0x5a')](_0x429262[_0xc2d2('0x48')],qs[_0xc2d2('0x45')](_0x11b8c2[_0xc2d2('0x44')][_0xc2d2('0x45')]));_0x5a5ea6[_0xc2d2('0x46')]=_0x5a5ea6['attributes'][_0xc2d2('0x47')]?_0x5a5ea6['attributes']:_0x429262[_0xc2d2('0x48')];if(!_0x11b8c2[_0xc2d2('0x44')][_0xc2d2('0x49')](_0xc2d2('0x4a'))){_0x5a5ea6['limit']=qs['limit'](_0x11b8c2[_0xc2d2('0x44')][_0xc2d2('0x30')]);_0x5a5ea6['offset']=qs[_0xc2d2('0x2d')](_0x11b8c2[_0xc2d2('0x44')][_0xc2d2('0x2d')]);}_0x5a5ea6[_0xc2d2('0x4b')]=qs['sort'](_0x11b8c2[_0xc2d2('0x44')][_0xc2d2('0x4c')]);_0x5a5ea6[_0xc2d2('0x4d')]=qs[_0xc2d2('0x4e')](_['pick'](_0x11b8c2[_0xc2d2('0x44')],_0x429262[_0xc2d2('0x4e')]));_0x5a5ea6['where'][_0xc2d2('0x66')]=_0xcbe640['id'];if(_0x11b8c2[_0xc2d2('0x44')]['filter']){_0x5a5ea6['where']=_[_0xc2d2('0x51')](_0x5a5ea6['where'],{'$or':_[_0xc2d2('0x40')](_0x5a5ea6[_0xc2d2('0x46')],function(_0x4c1244){var _0x33e917={};_0x33e917[_0x4c1244]={'$like':'%'+_0x11b8c2[_0xc2d2('0x44')][_0xc2d2('0x50')]+'%'};return _0x33e917;})});}_0x5a5ea6=_[_0xc2d2('0x51')]({},_0x5a5ea6,_0x11b8c2['options']);return db[_0xc2d2('0xd9')][_0xc2d2('0x2f')]({'where':_0x5a5ea6[_0xc2d2('0x4d')]})[_0xc2d2('0x21')](function(_0x38a82e){_0x47f6ad[_0xc2d2('0x2f')]=_0x38a82e;if(_0x11b8c2[_0xc2d2('0x44')][_0xc2d2('0x53')]){_0x5a5ea6[_0xc2d2('0x6a')]=[{'all':!![]}];}else{_0x5a5ea6[_0xc2d2('0x6a')]=[{'model':db[_0xc2d2('0x9e')],'as':_0xc2d2('0xfc'),'required':![]},{'model':db['Attachment'],'as':_0xc2d2('0x12c'),'required':![]}];}return db['ChatOfflineMessage']['findAll'](_0x5a5ea6);})[_0xc2d2('0x21')](function(_0x8c563){_0x47f6ad[_0xc2d2('0x55')]=_0x8c563;return _0x47f6ad;});}})[_0xc2d2('0x21')](respondWithFilteredResult(_0x2507a7,_0x5a5ea6))[_0xc2d2('0x56')](handleError(_0x2507a7,null));};exports[_0xc2d2('0x12d')]=function(_0x51b22e,_0x414b12,_0x22b386){return db[_0xc2d2('0x41')][_0xc2d2('0x5b')]({'where':{'id':_0x51b22e[_0xc2d2('0x58')]['id']}})[_0xc2d2('0x21')](handleEntityNotFound(_0x414b12,null))[_0xc2d2('0x21')](function(_0x4a3aa6){if(_0x4a3aa6){return _0x4a3aa6['addAgents'](_0x51b22e[_0xc2d2('0x5d')]['ids'],_['omit'](_0x51b22e[_0xc2d2('0x5d')],[_0xc2d2('0x6b'),'id'])||{})['spread'](function(_0x57701e){for(var _0x479db3=0x0;_0x479db3<_0x51b22e[_0xc2d2('0x5d')]['ids'][_0xc2d2('0x47')];_0x479db3+=0x1){socket[_0xc2d2('0x12e')](_0xc2d2('0x12f'),{'UserId':Number(_0x51b22e['body'][_0xc2d2('0x6b')][_0x479db3]),'ChatWebsiteId':Number(_0x51b22e[_0xc2d2('0x58')]['id'])});}return _0x57701e;});}})[_0xc2d2('0x21')](respondWithResult(_0x414b12,null))['catch'](handleError(_0x414b12,null));};exports[_0xc2d2('0x130')]=function(_0x21dc33,_0x9a92d1,_0x3cc2ce){return db[_0xc2d2('0x41')][_0xc2d2('0x5b')]({'where':{'id':_0x21dc33[_0xc2d2('0x58')]['id']}})[_0xc2d2('0x21')](handleEntityNotFound(_0x9a92d1,null))['then'](function(_0x4b2c56){if(_0x4b2c56){return _0x4b2c56[_0xc2d2('0x130')](_0x21dc33[_0xc2d2('0x44')][_0xc2d2('0x6b')])[_0xc2d2('0x21')](function(){if(_[_0xc2d2('0x131')](_0x21dc33[_0xc2d2('0x44')][_0xc2d2('0x6b')])){for(var _0xf5eb86=0x0;_0xf5eb86<_0x21dc33[_0xc2d2('0x44')][_0xc2d2('0x6b')]['length'];_0xf5eb86+=0x1){socket['emit'](_0xc2d2('0x132'),{'UserId':Number(_0x21dc33[_0xc2d2('0x44')][_0xc2d2('0x6b')][_0xf5eb86]),'ChatWebsiteId':Number(_0x21dc33['params']['id'])});}}else{socket[_0xc2d2('0x12e')](_0xc2d2('0x132'),{'UserId':Number(_0x21dc33[_0xc2d2('0x44')][_0xc2d2('0x6b')]),'ChatWebsiteId':Number(_0x21dc33['params']['id'])});}});}})['then'](respondWithStatusCode(_0x9a92d1,null))['catch'](handleError(_0x9a92d1,null));};exports[_0xc2d2('0x133')]=function(_0x4e6c85,_0x3c5914,_0x56d5c5){var _0xea6f62={};var _0x37b7d6={};var _0x5e3813;var _0x4caaf8;return db[_0xc2d2('0x41')][_0xc2d2('0x68')]({'where':{'id':_0x4e6c85[_0xc2d2('0x58')]['id']}})['then'](handleEntityNotFound(_0x3c5914,null))[_0xc2d2('0x21')](function(_0x504afb){if(_0x504afb){_0x5e3813=_0x504afb;_0x37b7d6['model']=_['keys'](db[_0xc2d2('0xc7')][_0xc2d2('0x42')]);_0x37b7d6['query']=_[_0xc2d2('0x59')](_0x4e6c85[_0xc2d2('0x44')]);_0x37b7d6[_0xc2d2('0x4e')]=_[_0xc2d2('0x5a')](_0x37b7d6[_0xc2d2('0x48')],_0x37b7d6[_0xc2d2('0x44')]);_0xea6f62[_0xc2d2('0x46')]=_['intersection'](_0x37b7d6[_0xc2d2('0x48')],qs[_0xc2d2('0x45')](_0x4e6c85['query']['fields']));_0xea6f62[_0xc2d2('0x46')]=_0xea6f62['attributes'][_0xc2d2('0x47')]?_0xea6f62[_0xc2d2('0x46')]:_0x37b7d6[_0xc2d2('0x48')];_0xea6f62[_0xc2d2('0x4b')]=qs[_0xc2d2('0x4c')](_0x4e6c85[_0xc2d2('0x44')][_0xc2d2('0x4c')]);_0xea6f62[_0xc2d2('0x4d')]=qs['filters'](_['pick'](_0x4e6c85[_0xc2d2('0x44')],_0x37b7d6[_0xc2d2('0x4e')]));if(_0x4e6c85[_0xc2d2('0x44')][_0xc2d2('0x50')]){_0xea6f62[_0xc2d2('0x4d')]=_[_0xc2d2('0x51')](_0xea6f62['where'],{'$or':_['map'](_0xea6f62['attributes'],function(_0x2a523d){var _0x436547={};_0x436547[_0x2a523d]={'$like':'%'+_0x4e6c85[_0xc2d2('0x44')][_0xc2d2('0x50')]+'%'};return _0x436547;})});}_0xea6f62=_[_0xc2d2('0x51')]({},_0xea6f62,_0x4e6c85[_0xc2d2('0x6f')]);return _0x5e3813[_0xc2d2('0x133')](_0xea6f62);}})[_0xc2d2('0x21')](function(_0x59c1ad){if(_0x59c1ad){_0x4caaf8=_0x59c1ad['length'];if(!_0x4e6c85[_0xc2d2('0x44')][_0xc2d2('0x49')](_0xc2d2('0x4a'))){_0xea6f62[_0xc2d2('0x30')]=qs[_0xc2d2('0x30')](_0x4e6c85[_0xc2d2('0x44')]['limit']);_0xea6f62[_0xc2d2('0x2d')]=qs['offset'](_0x4e6c85[_0xc2d2('0x44')][_0xc2d2('0x2d')]);}return _0x5e3813['getAgents'](_0xea6f62);}})[_0xc2d2('0x21')](function(_0x3a5c65){if(_0x3a5c65){return _0x3a5c65?{'count':_0x4caaf8,'rows':_0x3a5c65}:null;}})['then'](respondWithResult(_0x3c5914,null))[_0xc2d2('0x56')](handleError(_0x3c5914,null));};
\ No newline at end of file
+var _0x9388=['defaults','localhost','socket.io-emitter','./chatWebsite.socket','register','client','http','request','then','ChatWebsite,\x20%s,\x20%s','request\x20sent','debug','ChatWebsite,\x20%s,\x20%s,\x20%s','error','message','info','result','catch','status','end','json','offset','limit','undefined','set','Content-Range','apply','save','update','get','ChatWebsites','UserProfileResource','destroy','sendStatus','stack','name','send','Pause','mandatoryDispositionPause','map','ChatWebsite','rawAttributes','fieldName','type','key','model','query','intersection','fields','attributes','length','hasOwnProperty','nolimit','sort','where','filters','pick','merge','filter','options','include','findAll','rows','show','params','keys','find','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','autoAssociation','body','describe','ChatWebsiteId','Disposition','getDispositions','findOne','order','count','removeDispositions','CannedAnswer','getAnswers','includeAll','removeAnswers','addLogo','sitepic','file','addAvatar','agentAvatar','addCustomerAvatar','customerAvatar','filename','addSystemAvatar','systemAvatar','getLogo','join','getLicense','custom','isNil','existsSync','root','server/files/images/logos/','download','server/files/images/avatars/default_avatar.png','server/files/images/avatars/','getCustomerAvatar','server/files/images/avatars/customer_avatar.png','server/files/images/avatars/system_avatar.png','notify','user-agent-parser','setUA','user-agent','getResult','chat','ValidationError','no\x20available\x20attributes','updatedAt','difference','createdAt','CompanyId','ListId','from','from\x20is\x20mandatory','Sequelize','body\x20is\x20mandatory\x20and\x20not\x20empty','mapKey','mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','includes','List','CmContact','Contacts','DESC','account','applications','Applications','list','orderBy','contact','headers','first','x-forwarded-for','split','firstName','lastName','x-real-port','browser','format','%s\x20%s','unknown','version','device','vendor','%s\x20%s\x20%s','threadId','ChatInteraction','externalUrl','interaction','spread','messageId','created','autoclose','push','close','AttachmentId','UserId','User','unshift','agent','waitForTheAssignedAgent','*,*,*,*','forcedOwnership','Start','startRouting','EventManager','files','mapKeyOffline','mapKeyOffline\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','mapKeyOffline\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','CmList','findOrCreate','readFileSync','server/files/templates/chatOfflineMessage.ejs','utf8','toPairs','offlineMessageBody','ChatOfflineMessage','originalname','mimetype','server','attachments','offline-chat','basename','openNewInteraction','transaction','Attachment','MailAccount','Smtp','service','host','port','secure','pass','SendMail','sendMail','email','offlineMessageSubject','subjectOffline','toPairsIn','mapValues','Chat','MailAccountId','NotifyMailAccount','remove','Could\x20not\x20remove\x20attachment\x20file','addInteraction','omit','ids','getInteractions','Contact','Owner','internal','Tag','color','tag','Command','timezone','interval','iftime\x20%s','indexOf','true','[%s][INTERVAL][%s]\x20%s\x20%s\x20(%s)','OFFLINE','No\x20timezone','Interval','Intervals','getProactiveActions','License','all','some','server/files/chat/iframe.ejs','remote','stringify','x-real-ip','referer','virtual','replace','render','alignment','textColor','color_button','addApplications','sequelize','ChatApplication','findAndCountAll','priority','getApplications','addProactiveActions','chatProactiveAction','ChatProactiveAction','getFields','online','offlineForm','items','fromKey','getOfflineMessages','userChatWebsite:save','removeAgents','isArray','emit','userChatWebsite:remove','getAgents','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','to-csv','ejs','squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','redis'];(function(_0x5cb1af,_0x4bdc8c){var _0x8d7940=function(_0x3db70a){while(--_0x3db70a){_0x5cb1af['push'](_0x5cb1af['shift']());}};_0x8d7940(++_0x4bdc8c);}(_0x9388,0x10f));var _0x8938=function(_0x2cc555,_0x44123b){_0x2cc555=_0x2cc555-0x0;var _0xb43253=_0x9388[_0x2cc555];return _0xb43253;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x8938('0x0'));var zipdir=require(_0x8938('0x1'));var jsonpatch=require(_0x8938('0x2'));var rp=require(_0x8938('0x3'));var moment=require(_0x8938('0x4'));var BPromise=require(_0x8938('0x5'));var Mustache=require(_0x8938('0x6'));var util=require(_0x8938('0x7'));var path=require(_0x8938('0x8'));var sox=require('sox');var csv=require(_0x8938('0x9'));var ejs=require(_0x8938('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0x8938('0xb'));var crypto=require(_0x8938('0xc'));var jsforce=require(_0x8938('0xd'));var deskjs=require(_0x8938('0xe'));var toCsv=require(_0x8938('0x9'));var querystring=require(_0x8938('0xf'));var Papa=require('papaparse');var Redis=require(_0x8938('0x10'));var authService=require(_0x8938('0x11'));var qs=require(_0x8938('0x12'));var as=require(_0x8938('0x13'));var hardwareService=require(_0x8938('0x14'));var logger=require(_0x8938('0x15'))(_0x8938('0x16'));var utils=require(_0x8938('0x17'));var config=require('../../config/environment');var licenseUtil=require(_0x8938('0x18'));var db=require('../../mysqldb')['db'];config[_0x8938('0x19')]=_[_0x8938('0x1a')](config[_0x8938('0x19')],{'host':_0x8938('0x1b'),'port':0x18eb});var socket=require(_0x8938('0x1c'))(new Redis(config[_0x8938('0x19')]));require(_0x8938('0x1d'))[_0x8938('0x1e')](socket);var jayson=require('jayson/promise');var client=jayson[_0x8938('0x1f')][_0x8938('0x20')]({'port':0x232c});var client9002=jayson[_0x8938('0x1f')]['http']({'port':0x232a});var client9003=jayson[_0x8938('0x1f')][_0x8938('0x20')]({'port':0x232b});var client9001=jayson[_0x8938('0x1f')][_0x8938('0x20')]({'port':0x2329});function respondWithRpcPromise(_0x570fed,_0x60346,_0x12689f,_0x4af5ee){return new BPromise(function(_0x5c9bcf,_0x2d9a3f){var _0x45bfa6=_0x4af5ee||client;return _0x45bfa6[_0x8938('0x21')](_0x570fed,_0x12689f)[_0x8938('0x22')](function(_0x61e6ea){logger['info'](_0x8938('0x23'),_0x60346,_0x8938('0x24'));logger[_0x8938('0x25')](_0x8938('0x26'),_0x60346,'request\x20sent',JSON['stringify'](_0x61e6ea));if(_0x61e6ea[_0x8938('0x27')]){if(_0x61e6ea[_0x8938('0x27')]['code']===0x1f4){logger['error'](_0x8938('0x23'),_0x60346,_0x61e6ea[_0x8938('0x27')][_0x8938('0x28')]);return _0x2d9a3f(_0x61e6ea[_0x8938('0x27')]['message']);}logger[_0x8938('0x27')](_0x8938('0x23'),_0x60346,_0x61e6ea[_0x8938('0x27')][_0x8938('0x28')]);return _0x5c9bcf(_0x61e6ea[_0x8938('0x27')]['message']);}else{logger[_0x8938('0x29')](_0x8938('0x23'),_0x60346,_0x8938('0x24'));_0x5c9bcf(_0x61e6ea[_0x8938('0x2a')][_0x8938('0x28')]);}})[_0x8938('0x2b')](function(_0x5c91a0){logger['error'](_0x8938('0x23'),_0x60346,_0x5c91a0);_0x2d9a3f(_0x5c91a0);});});}function respondWithStatusCode(_0xd26d0d,_0x2a15e0){_0x2a15e0=_0x2a15e0||0xcc;return function(_0x216d52){if(_0x216d52){return _0xd26d0d['sendStatus'](_0x2a15e0);}return _0xd26d0d[_0x8938('0x2c')](_0x2a15e0)[_0x8938('0x2d')]();};}function respondWithResult(_0x1ce863,_0x5ba877){_0x5ba877=_0x5ba877||0xc8;return function(_0x7ba87a){if(_0x7ba87a){return _0x1ce863[_0x8938('0x2c')](_0x5ba877)[_0x8938('0x2e')](_0x7ba87a);}};}function respondWithFilteredResult(_0xa1b664,_0x4da873){return function(_0x46881b){if(_0x46881b){var _0x12d72a=typeof _0x4da873[_0x8938('0x2f')]==='undefined'&&typeof _0x4da873[_0x8938('0x30')]===_0x8938('0x31');var _0x304415=_0x46881b['count'];var _0x3bede0=_0x12d72a?0x0:_0x4da873[_0x8938('0x2f')];var _0x16af18=_0x12d72a?_0x46881b['count']:_0x4da873['offset']+_0x4da873[_0x8938('0x30')];var _0x29b02b;if(_0x16af18>=_0x304415){_0x16af18=_0x304415;_0x29b02b=0xc8;}else{_0x29b02b=0xce;}_0xa1b664[_0x8938('0x2c')](_0x29b02b);return _0xa1b664[_0x8938('0x32')](_0x8938('0x33'),_0x3bede0+'-'+_0x16af18+'/'+_0x304415)[_0x8938('0x2e')](_0x46881b);}return null;};}function patchUpdates(_0x4cb898){return function(_0x22ef84){try{jsonpatch[_0x8938('0x34')](_0x22ef84,_0x4cb898,!![]);}catch(_0x9bdb9){return BPromise['reject'](_0x9bdb9);}return _0x22ef84[_0x8938('0x35')]();};}function saveUpdates(_0x36c91c,_0x4942f2){return function(_0x5d5d44){if(_0x5d5d44){return _0x5d5d44[_0x8938('0x36')](_0x36c91c)[_0x8938('0x22')](function(_0x1753ce){return _0x1753ce;});}return null;};}function removeEntity(_0x135910,_0x4d83f9){return function(_0x1d3a36){if(_0x1d3a36){return _0x1d3a36['destroy']()['then'](function(){var _0x27d80b=_0x1d3a36[_0x8938('0x37')]({'plain':!![]});var _0x12a93b=_0x8938('0x38');return db[_0x8938('0x39')][_0x8938('0x3a')]({'where':{'type':_0x12a93b,'resourceId':_0x27d80b['id']}})[_0x8938('0x22')](function(){return _0x1d3a36;});})[_0x8938('0x22')](function(){_0x135910['status'](0xcc)[_0x8938('0x2d')]();});}};}function handleEntityNotFound(_0xe4fe40,_0xeb5724){return function(_0xd3df2){if(!_0xd3df2){_0xe4fe40[_0x8938('0x3b')](0x194);}return _0xd3df2;};}function handleError(_0x46171c,_0x16c359){_0x16c359=_0x16c359||0x1f4;return function(_0x8807c3){logger['error'](_0x8807c3[_0x8938('0x3c')]);if(_0x8807c3[_0x8938('0x3d')]){delete _0x8807c3[_0x8938('0x3d')];}_0x46171c[_0x8938('0x2c')](_0x16c359)[_0x8938('0x3e')](_0x8807c3);};}exports['index']=function(_0x3fdaba,_0x2f1e96){var _0x19dc86={'include':[{'model':db[_0x8938('0x3f')],'as':_0x8938('0x40')}]},_0x42a386={},_0x649414={'count':0x0,'rows':[]};var _0x1289df=_[_0x8938('0x41')](db[_0x8938('0x42')][_0x8938('0x43')],function(_0x30c942){return{'name':_0x30c942[_0x8938('0x44')],'type':_0x30c942[_0x8938('0x45')][_0x8938('0x46')]};});_0x42a386[_0x8938('0x47')]=_['map'](_0x1289df,_0x8938('0x3d'));_0x42a386['query']=_['keys'](_0x3fdaba[_0x8938('0x48')]);_0x42a386['filters']=_[_0x8938('0x49')](_0x42a386[_0x8938('0x47')],_0x42a386[_0x8938('0x48')]);_0x19dc86['attributes']=_[_0x8938('0x49')](_0x42a386['model'],qs['fields'](_0x3fdaba[_0x8938('0x48')][_0x8938('0x4a')]));_0x19dc86[_0x8938('0x4b')]=_0x19dc86[_0x8938('0x4b')][_0x8938('0x4c')]?_0x19dc86[_0x8938('0x4b')]:_0x42a386[_0x8938('0x47')];if(!_0x3fdaba[_0x8938('0x48')][_0x8938('0x4d')](_0x8938('0x4e'))){_0x19dc86['limit']=qs[_0x8938('0x30')](_0x3fdaba['query']['limit']);_0x19dc86[_0x8938('0x2f')]=qs[_0x8938('0x2f')](_0x3fdaba[_0x8938('0x48')]['offset']);}_0x19dc86['order']=qs[_0x8938('0x4f')](_0x3fdaba['query'][_0x8938('0x4f')]);_0x19dc86[_0x8938('0x50')]=qs[_0x8938('0x51')](_[_0x8938('0x52')](_0x3fdaba[_0x8938('0x48')],_0x42a386[_0x8938('0x51')]),_0x1289df);if(_0x3fdaba[_0x8938('0x48')]['filter']){_0x19dc86[_0x8938('0x50')]=_[_0x8938('0x53')](_0x19dc86[_0x8938('0x50')],{'$or':_[_0x8938('0x41')](_0x1289df,function(_0x2b9bea){if(_0x2b9bea[_0x8938('0x45')]!=='VIRTUAL'){var _0x57cd6e={};_0x57cd6e[_0x2b9bea[_0x8938('0x3d')]]={'$like':'%'+_0x3fdaba[_0x8938('0x48')][_0x8938('0x54')]+'%'};return _0x57cd6e;}})});}_0x19dc86=_[_0x8938('0x53')]({},_0x19dc86,_0x3fdaba[_0x8938('0x55')]);var _0x2ec187={'where':_0x19dc86[_0x8938('0x50')]};return db[_0x8938('0x42')]['count'](_0x2ec187)['then'](function(_0x44793a){_0x649414['count']=_0x44793a;if(_0x3fdaba[_0x8938('0x48')]['includeAll']){_0x19dc86[_0x8938('0x56')]=[{'all':!![]}];}return db[_0x8938('0x42')][_0x8938('0x57')](_0x19dc86);})[_0x8938('0x22')](function(_0x2848f2){_0x649414[_0x8938('0x58')]=_0x2848f2;return _0x649414;})[_0x8938('0x22')](respondWithFilteredResult(_0x2f1e96,_0x19dc86))[_0x8938('0x2b')](handleError(_0x2f1e96,null));};exports[_0x8938('0x59')]=function(_0x2beeb5,_0x394f03){var _0x34ae55={'raw':![],'where':{'id':_0x2beeb5[_0x8938('0x5a')]['id']},'include':[{'model':db[_0x8938('0x3f')],'as':_0x8938('0x40')}]},_0x33bef5={};_0x33bef5[_0x8938('0x47')]=_[_0x8938('0x5b')](db[_0x8938('0x42')][_0x8938('0x43')]);_0x33bef5[_0x8938('0x48')]=_[_0x8938('0x5b')](_0x2beeb5[_0x8938('0x48')]);_0x33bef5['filters']=_[_0x8938('0x49')](_0x33bef5[_0x8938('0x47')],_0x33bef5[_0x8938('0x48')]);_0x34ae55[_0x8938('0x4b')]=_[_0x8938('0x49')](_0x33bef5[_0x8938('0x47')],qs['fields'](_0x2beeb5['query'][_0x8938('0x4a')]));_0x34ae55[_0x8938('0x4b')]=_0x34ae55['attributes'][_0x8938('0x4c')]?_0x34ae55[_0x8938('0x4b')]:_0x33bef5[_0x8938('0x47')];if(_0x2beeb5[_0x8938('0x48')]['includeAll']){_0x34ae55[_0x8938('0x56')]=[{'all':!![]}];}_0x34ae55=_[_0x8938('0x53')]({},_0x34ae55,_0x2beeb5[_0x8938('0x55')]);return db['ChatWebsite'][_0x8938('0x5c')](_0x34ae55)[_0x8938('0x22')](handleEntityNotFound(_0x394f03,null))[_0x8938('0x22')](respondWithResult(_0x394f03,null))[_0x8938('0x2b')](handleError(_0x394f03,null));};exports[_0x8938('0x5d')]=function(_0x470287,_0x49f60e){return db[_0x8938('0x42')][_0x8938('0x5d')](_0x470287['body'],{})[_0x8938('0x22')](function(_0x117e89){var _0x4add37=_0x470287[_0x8938('0x5e')][_0x8938('0x37')]({'plain':!![]});if(!_0x4add37)throw new Error(_0x8938('0x5f'));if(_0x4add37['role']==='user'){var _0x3114af=_0x117e89[_0x8938('0x37')]({'plain':!![]});var _0x2be453=_0x8938('0x38');return db['UserProfileSection'][_0x8938('0x5c')]({'where':{'name':_0x2be453,'userProfileId':_0x4add37['userProfileId']},'raw':!![]})[_0x8938('0x22')](function(_0x53fb3c){if(_0x53fb3c&&_0x53fb3c[_0x8938('0x60')]===0x0){return db[_0x8938('0x39')]['create']({'name':_0x3114af[_0x8938('0x3d')],'resourceId':_0x3114af['id'],'type':_0x53fb3c['name'],'sectionId':_0x53fb3c['id']},{})[_0x8938('0x22')](function(){return _0x117e89;});}else{return _0x117e89;}})[_0x8938('0x2b')](function(_0x2ba94a){logger[_0x8938('0x27')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x2ba94a);throw _0x2ba94a;});}return _0x117e89;})[_0x8938('0x22')](respondWithResult(_0x49f60e,0xc9))[_0x8938('0x2b')](handleError(_0x49f60e,null));};exports[_0x8938('0x36')]=function(_0x598386,_0x78cd39){if(_0x598386[_0x8938('0x61')]['id']){delete _0x598386[_0x8938('0x61')]['id'];}return db[_0x8938('0x42')][_0x8938('0x5c')]({'where':{'id':_0x598386[_0x8938('0x5a')]['id']},'include':[{'model':db[_0x8938('0x3f')],'as':_0x8938('0x40')}]})['then'](handleEntityNotFound(_0x78cd39,null))[_0x8938('0x22')](saveUpdates(_0x598386[_0x8938('0x61')],null))[_0x8938('0x22')](respondWithResult(_0x78cd39,null))['catch'](handleError(_0x78cd39,null));};exports[_0x8938('0x3a')]=function(_0x513907,_0x3b3779){return db[_0x8938('0x42')]['find']({'where':{'id':_0x513907[_0x8938('0x5a')]['id']}})['then'](handleEntityNotFound(_0x3b3779,null))[_0x8938('0x22')](removeEntity(_0x3b3779,null))[_0x8938('0x2b')](handleError(_0x3b3779,null));};exports[_0x8938('0x62')]=function(_0x54e8e1,_0x4544f0){return db[_0x8938('0x42')][_0x8938('0x62')]()[_0x8938('0x22')](respondWithResult(_0x4544f0,null))['catch'](handleError(_0x4544f0,null));};exports['addDisposition']=function(_0x1a29f7,_0x42588c,_0x836e56){if(_0x1a29f7[_0x8938('0x61')]['id']){delete _0x1a29f7[_0x8938('0x61')]['id'];}return db[_0x8938('0x42')][_0x8938('0x5c')]({'where':{'id':_0x1a29f7[_0x8938('0x5a')]['id']}})[_0x8938('0x22')](handleEntityNotFound(_0x42588c,null))[_0x8938('0x22')](function(_0x210c1d){if(_0x210c1d){_0x1a29f7[_0x8938('0x61')][_0x8938('0x63')]=_0x210c1d['id'];return db[_0x8938('0x64')][_0x8938('0x5d')](_0x1a29f7['body']);}})[_0x8938('0x22')](respondWithResult(_0x42588c,null))[_0x8938('0x2b')](handleError(_0x42588c,null));};exports[_0x8938('0x65')]=function(_0x3a33b4,_0x4f8d78,_0x5be9ad){var _0x4ae9f4={'raw':![],'where':{}};var _0x45fb3c={};var _0x5d50fa={'count':0x0,'rows':[]};return db[_0x8938('0x42')][_0x8938('0x66')]({'where':{'id':_0x3a33b4[_0x8938('0x5a')]['id']}})[_0x8938('0x22')](handleEntityNotFound(_0x4f8d78,null))[_0x8938('0x22')](function(_0x13edd2){if(_0x13edd2){_0x45fb3c[_0x8938('0x47')]=_[_0x8938('0x5b')](db['Disposition'][_0x8938('0x43')]);_0x45fb3c[_0x8938('0x48')]=_['keys'](_0x3a33b4[_0x8938('0x48')]);_0x45fb3c[_0x8938('0x51')]=_['intersection'](_0x45fb3c['model'],_0x45fb3c[_0x8938('0x48')]);_0x4ae9f4[_0x8938('0x4b')]=_['intersection'](_0x45fb3c['model'],qs['fields'](_0x3a33b4[_0x8938('0x48')][_0x8938('0x4a')]));_0x4ae9f4[_0x8938('0x4b')]=_0x4ae9f4[_0x8938('0x4b')][_0x8938('0x4c')]?_0x4ae9f4[_0x8938('0x4b')]:_0x45fb3c['model'];if(!_0x3a33b4[_0x8938('0x48')][_0x8938('0x4d')](_0x8938('0x4e'))){_0x4ae9f4[_0x8938('0x30')]=qs[_0x8938('0x30')](_0x3a33b4[_0x8938('0x48')][_0x8938('0x30')]);_0x4ae9f4[_0x8938('0x2f')]=qs[_0x8938('0x2f')](_0x3a33b4[_0x8938('0x48')]['offset']);}_0x4ae9f4[_0x8938('0x67')]=qs[_0x8938('0x4f')](_0x3a33b4[_0x8938('0x48')][_0x8938('0x4f')]);_0x4ae9f4['where']=qs['filters'](_['pick'](_0x3a33b4[_0x8938('0x48')],_0x45fb3c[_0x8938('0x51')]));_0x4ae9f4['where'][_0x8938('0x63')]=_0x13edd2['id'];if(_0x3a33b4[_0x8938('0x48')][_0x8938('0x54')]){_0x4ae9f4[_0x8938('0x50')]=_[_0x8938('0x53')](_0x4ae9f4[_0x8938('0x50')],{'$or':_[_0x8938('0x41')](_0x4ae9f4[_0x8938('0x4b')],function(_0x4f2f86){var _0x1da87f={};_0x1da87f[_0x4f2f86]={'$like':'%'+_0x3a33b4[_0x8938('0x48')][_0x8938('0x54')]+'%'};return _0x1da87f;})});}_0x4ae9f4=_[_0x8938('0x53')]({},_0x4ae9f4,_0x3a33b4[_0x8938('0x55')]);return db[_0x8938('0x64')][_0x8938('0x68')]({'where':_0x4ae9f4[_0x8938('0x50')]})['then'](function(_0x4d4211){_0x5d50fa[_0x8938('0x68')]=_0x4d4211;if(_0x3a33b4[_0x8938('0x48')]['includeAll']){_0x4ae9f4['include']=[{'all':!![]}];}return db[_0x8938('0x64')][_0x8938('0x57')](_0x4ae9f4);})[_0x8938('0x22')](function(_0x32d353){_0x5d50fa[_0x8938('0x58')]=_0x32d353;return _0x5d50fa;});}})[_0x8938('0x22')](respondWithFilteredResult(_0x4f8d78,_0x4ae9f4))['catch'](handleError(_0x4f8d78,null));};exports[_0x8938('0x69')]=function(_0x27618b,_0x429873,_0x35887a){return db[_0x8938('0x42')][_0x8938('0x5c')]({'where':{'id':_0x27618b['params']['id']}})[_0x8938('0x22')](handleEntityNotFound(_0x429873,null))[_0x8938('0x22')](function(_0x4c4be2){if(_0x4c4be2){return _0x4c4be2['removeDispositions'](_0x27618b['query']['ids']);}})['then'](respondWithStatusCode(_0x429873,null))[_0x8938('0x2b')](handleError(_0x429873,null));};exports['addAnswer']=function(_0x36215b,_0x5be8f3,_0x5a461a){if(_0x36215b[_0x8938('0x61')]['id']){delete _0x36215b[_0x8938('0x61')]['id'];}return db['ChatWebsite']['find']({'where':{'id':_0x36215b[_0x8938('0x5a')]['id']}})[_0x8938('0x22')](handleEntityNotFound(_0x5be8f3,null))[_0x8938('0x22')](function(_0x16de85){if(_0x16de85){_0x36215b['body']['ChatWebsiteId']=_0x16de85['id'];return db[_0x8938('0x6a')]['create'](_0x36215b[_0x8938('0x61')]);}})['then'](respondWithResult(_0x5be8f3,null))['catch'](handleError(_0x5be8f3,null));};exports[_0x8938('0x6b')]=function(_0x54eac4,_0x1e2782,_0x353b96){var _0x4e6102={'raw':![],'where':{}};var _0x4ea1cd={};var _0x521029={'count':0x0,'rows':[]};return db['ChatWebsite'][_0x8938('0x66')]({'where':{'id':_0x54eac4[_0x8938('0x5a')]['id']}})['then'](handleEntityNotFound(_0x1e2782,null))[_0x8938('0x22')](function(_0x5704be){if(_0x5704be){_0x4ea1cd['model']=_['keys'](db['CannedAnswer'][_0x8938('0x43')]);_0x4ea1cd[_0x8938('0x48')]=_[_0x8938('0x5b')](_0x54eac4[_0x8938('0x48')]);_0x4ea1cd[_0x8938('0x51')]=_[_0x8938('0x49')](_0x4ea1cd[_0x8938('0x47')],_0x4ea1cd[_0x8938('0x48')]);_0x4e6102[_0x8938('0x4b')]=_['intersection'](_0x4ea1cd[_0x8938('0x47')],qs[_0x8938('0x4a')](_0x54eac4[_0x8938('0x48')][_0x8938('0x4a')]));_0x4e6102[_0x8938('0x4b')]=_0x4e6102['attributes'][_0x8938('0x4c')]?_0x4e6102[_0x8938('0x4b')]:_0x4ea1cd[_0x8938('0x47')];if(!_0x54eac4['query'][_0x8938('0x4d')](_0x8938('0x4e'))){_0x4e6102[_0x8938('0x30')]=qs[_0x8938('0x30')](_0x54eac4[_0x8938('0x48')][_0x8938('0x30')]);_0x4e6102['offset']=qs['offset'](_0x54eac4['query'][_0x8938('0x2f')]);}_0x4e6102['order']=qs[_0x8938('0x4f')](_0x54eac4[_0x8938('0x48')]['sort']);_0x4e6102[_0x8938('0x50')]=qs[_0x8938('0x51')](_[_0x8938('0x52')](_0x54eac4[_0x8938('0x48')],_0x4ea1cd[_0x8938('0x51')]));_0x4e6102['where'][_0x8938('0x63')]=_0x5704be['id'];if(_0x54eac4[_0x8938('0x48')][_0x8938('0x54')]){_0x4e6102[_0x8938('0x50')]=_['merge'](_0x4e6102[_0x8938('0x50')],{'$or':_['map'](_0x4e6102[_0x8938('0x4b')],function(_0x9f6e64){var _0xf898de={};_0xf898de[_0x9f6e64]={'$like':'%'+_0x54eac4[_0x8938('0x48')]['filter']+'%'};return _0xf898de;})});}_0x4e6102=_[_0x8938('0x53')]({},_0x4e6102,_0x54eac4[_0x8938('0x55')]);return db['CannedAnswer'][_0x8938('0x68')]({'where':_0x4e6102[_0x8938('0x50')]})['then'](function(_0x122393){_0x521029[_0x8938('0x68')]=_0x122393;if(_0x54eac4[_0x8938('0x48')][_0x8938('0x6c')]){_0x4e6102[_0x8938('0x56')]=[{'all':!![]}];}return db[_0x8938('0x6a')]['findAll'](_0x4e6102);})['then'](function(_0xb7a065){_0x521029[_0x8938('0x58')]=_0xb7a065;return _0x521029;});}})[_0x8938('0x22')](respondWithFilteredResult(_0x1e2782,_0x4e6102))[_0x8938('0x2b')](handleError(_0x1e2782,null));};exports[_0x8938('0x6d')]=function(_0xe0c93c,_0x2c599e,_0x37327b){return db['ChatWebsite'][_0x8938('0x5c')]({'where':{'id':_0xe0c93c[_0x8938('0x5a')]['id']}})['then'](handleEntityNotFound(_0x2c599e,null))[_0x8938('0x22')](function(_0x31431b){if(_0x31431b){return _0x31431b['removeAnswers'](_0xe0c93c['query']['ids']);}})[_0x8938('0x22')](respondWithStatusCode(_0x2c599e,null))['catch'](handleError(_0x2c599e,null));};exports[_0x8938('0x6e')]=function(_0x51ab83,_0x582664,_0x1b0443){_0x51ab83['body'][_0x8938('0x6f')]=_0x51ab83[_0x8938('0x70')]['filename'];return db['ChatWebsite'][_0x8938('0x5c')]({'where':{'id':_0x51ab83[_0x8938('0x5a')]['id']}})['then'](handleEntityNotFound(_0x582664,null))[_0x8938('0x22')](saveUpdates(_0x51ab83[_0x8938('0x61')],null))['then'](respondWithResult(_0x582664,null))[_0x8938('0x2b')](handleError(_0x582664,null));};exports[_0x8938('0x71')]=function(_0x108654,_0x3382c7,_0x2beb91){_0x108654['body'][_0x8938('0x72')]=_0x108654['file']['filename'];return db[_0x8938('0x42')][_0x8938('0x5c')]({'where':{'id':_0x108654[_0x8938('0x5a')]['id']}})[_0x8938('0x22')](handleEntityNotFound(_0x3382c7,null))[_0x8938('0x22')](saveUpdates(_0x108654['body'],null))[_0x8938('0x22')](respondWithResult(_0x3382c7,null))[_0x8938('0x2b')](handleError(_0x3382c7,null));};exports[_0x8938('0x73')]=function(_0x27d0e8,_0x47fa47,_0x3e2a99){_0x27d0e8[_0x8938('0x61')][_0x8938('0x74')]=_0x27d0e8['file'][_0x8938('0x75')];return db[_0x8938('0x42')][_0x8938('0x5c')]({'where':{'id':_0x27d0e8[_0x8938('0x5a')]['id']}})[_0x8938('0x22')](handleEntityNotFound(_0x47fa47,null))[_0x8938('0x22')](saveUpdates(_0x27d0e8[_0x8938('0x61')],null))['then'](respondWithResult(_0x47fa47,null))[_0x8938('0x2b')](handleError(_0x47fa47,null));};exports[_0x8938('0x76')]=function(_0x384557,_0x24e30f,_0x57b2db){_0x384557['body'][_0x8938('0x77')]=_0x384557[_0x8938('0x70')]['filename'];return db[_0x8938('0x42')][_0x8938('0x5c')]({'where':{'id':_0x384557[_0x8938('0x5a')]['id']}})[_0x8938('0x22')](handleEntityNotFound(_0x24e30f,null))[_0x8938('0x22')](saveUpdates(_0x384557[_0x8938('0x61')],null))['then'](respondWithResult(_0x24e30f,null))[_0x8938('0x2b')](handleError(_0x24e30f,null));};exports[_0x8938('0x78')]=function(_0x4f1699,_0x383b8d,_0x40a570){var _0x216e59=path[_0x8938('0x79')](config['root'],'server/files/images/logos/default_logo.svg');var _0x56c1e3={'where':{'id':_0x4f1699[_0x8938('0x5a')]['id']},'attributes':['id',_0x8938('0x6f')],'raw':!![]};var _0x36d889=![];return require(_0x8938('0x18'))[_0x8938('0x7a')]()[_0x8938('0x22')](function(_0x320974){if(_0x320974){_0x36d889=_0x320974[_0x8938('0x7b')];}})[_0x8938('0x22')](function(){return db[_0x8938('0x42')][_0x8938('0x5c')](_0x56c1e3);})[_0x8938('0x22')](handleEntityNotFound(_0x383b8d,null))[_0x8938('0x22')](function(_0x1dbe5e){if(_0x1dbe5e){if(!_[_0x8938('0x7c')](_0x1dbe5e[_0x8938('0x6f')])){if(fs[_0x8938('0x7d')](path[_0x8938('0x79')](config[_0x8938('0x7e')],_0x8938('0x7f'),_0x1dbe5e['sitepic']))&&_0x36d889){_0x216e59=path[_0x8938('0x79')](config[_0x8938('0x7e')],_0x8938('0x7f'),_0x1dbe5e['sitepic']);}}return _0x383b8d[_0x8938('0x80')](_0x216e59);}})['catch'](handleError(_0x383b8d,null));};exports['getAvatar']=function(_0x595312,_0x276daf,_0x2872b6){var _0x1398bd=path['join'](config['root'],_0x8938('0x81'));var _0xdfddff={'where':{'id':_0x595312[_0x8938('0x5a')]['id']},'attributes':['id',_0x8938('0x72')],'raw':!![]};return db[_0x8938('0x42')][_0x8938('0x5c')](_0xdfddff)[_0x8938('0x22')](handleEntityNotFound(_0x276daf,null))[_0x8938('0x22')](function(_0x40b822){if(_0x40b822){if(!_[_0x8938('0x7c')](_0x40b822[_0x8938('0x72')])){if(fs[_0x8938('0x7d')](path['join'](config[_0x8938('0x7e')],_0x8938('0x82'),_0x40b822[_0x8938('0x72')]))){_0x1398bd=path[_0x8938('0x79')](config[_0x8938('0x7e')],_0x8938('0x82'),_0x40b822['agentAvatar']);}}return _0x276daf[_0x8938('0x80')](_0x1398bd);}})[_0x8938('0x2b')](handleError(_0x276daf,null));};exports[_0x8938('0x83')]=function(_0x5e979e,_0x413581,_0x168966){var _0x2c4b57=path[_0x8938('0x79')](config[_0x8938('0x7e')],_0x8938('0x84'));var _0x168634={'where':{'id':_0x5e979e['params']['id']},'attributes':['id',_0x8938('0x74'),'showCustomerAvatar'],'raw':!![]};return db[_0x8938('0x42')][_0x8938('0x5c')](_0x168634)[_0x8938('0x22')](handleEntityNotFound(_0x413581,null))[_0x8938('0x22')](function(_0x15d749){if(_0x15d749){if(!_[_0x8938('0x7c')](_0x15d749[_0x8938('0x74')])){if(fs[_0x8938('0x7d')](path[_0x8938('0x79')](config[_0x8938('0x7e')],_0x8938('0x82'),_0x15d749[_0x8938('0x74')]))&&_0x15d749['showCustomerAvatar']){_0x2c4b57=path['join'](config['root'],_0x8938('0x82'),_0x15d749[_0x8938('0x74')]);}}return _0x413581[_0x8938('0x80')](_0x2c4b57);}})[_0x8938('0x2b')](handleError(_0x413581,null));};exports['getSystemAvatar']=function(_0x3ee2bb,_0x176850,_0x113d58){var _0x289fa3=path[_0x8938('0x79')](config[_0x8938('0x7e')],_0x8938('0x85'));var _0x42efcf={'where':{'id':_0x3ee2bb['params']['id']},'attributes':['id',_0x8938('0x77')],'raw':!![]};return db['ChatWebsite'][_0x8938('0x5c')](_0x42efcf)['then'](handleEntityNotFound(_0x176850,null))[_0x8938('0x22')](function(_0x1dfe4c){if(_0x1dfe4c){if(!_['isNil'](_0x1dfe4c[_0x8938('0x77')])){if(fs['existsSync'](path['join'](config['root'],_0x8938('0x82'),_0x1dfe4c[_0x8938('0x77')]))){_0x289fa3=path[_0x8938('0x79')](config[_0x8938('0x7e')],_0x8938('0x82'),_0x1dfe4c['systemAvatar']);}}return _0x176850['download'](_0x289fa3);}})['catch'](handleError(_0x176850,null));};exports[_0x8938('0x86')]=function(_0x1f8e4c,_0x5f12d1,_0x58f475){var _0x1dd486=require(_0x8938('0x87'));var _0x43b39b=new _0x1dd486();var _0x10e840=_0x43b39b[_0x8938('0x88')](_0x1f8e4c['headers'][_0x8938('0x89')])[_0x8938('0x8a')]();var _0x3ac59b={'body':_0x1f8e4c[_0x8938('0x61')],'channel':_0x8938('0x8b')};var _0x36f9ed=[];var _0x16199e=[];var _0x463890={};var _0x443d21=![];return db['CmContact'][_0x8938('0x62')]()[_0x8938('0x22')](function(_0x11e339){if(!_0x11e339){throw new db['Sequelize'][(_0x8938('0x8c'))](_0x8938('0x8d'));}_0x36f9ed=_['difference'](_[_0x8938('0x5b')](_0x11e339),['createdAt',_0x8938('0x8e')]);_0x16199e=_[_0x8938('0x8f')](_[_0x8938('0x5b')](_0x11e339),[_0x8938('0x90'),'updatedAt',_0x8938('0x91'),_0x8938('0x92')]);if(_0x1f8e4c[_0x8938('0x61')]['id']){delete _0x1f8e4c[_0x8938('0x61')]['id'];}if(_[_0x8938('0x7c')](_0x1f8e4c[_0x8938('0x61')][_0x8938('0x93')])){throw new db['Sequelize'][(_0x8938('0x8c'))](_0x8938('0x94'));}if(_[_0x8938('0x7c')](_0x1f8e4c[_0x8938('0x61')][_0x8938('0x61')])||_0x1f8e4c[_0x8938('0x61')][_0x8938('0x61')]===''){throw new db[(_0x8938('0x95'))]['ValidationError'](_0x8938('0x96'));}if(_[_0x8938('0x7c')](_0x1f8e4c[_0x8938('0x61')][_0x8938('0x97')])){throw new db[(_0x8938('0x95'))][(_0x8938('0x8c'))](_0x8938('0x98')+_0x16199e);}if(!_[_0x8938('0x99')](_0x16199e,_0x1f8e4c[_0x8938('0x61')][_0x8938('0x97')])){throw new db['Sequelize'][(_0x8938('0x8c'))]('mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20'+_0x16199e);}_0x463890[_0x1f8e4c[_0x8938('0x61')][_0x8938('0x97')]]=_0x1f8e4c[_0x8938('0x61')][_0x8938('0x93')];})[_0x8938('0x22')](function(){return db[_0x8938('0x42')][_0x8938('0x5c')]({'where':{'id':_0x1f8e4c['params']['id']},'include':[{'model':db['CmList'],'as':_0x8938('0x9a'),'include':[{'model':db[_0x8938('0x9b')],'as':_0x8938('0x9c'),'where':_0x463890,'limit':0x1,'order':[[_0x8938('0x8e'),_0x8938('0x9d')]]}]},{'model':db['ChatApplication'],'as':'Applications'}]});})['then'](handleEntityNotFound(_0x5f12d1,null))[_0x8938('0x22')](function(_0xfd3cd6){if(_0xfd3cd6&&_0xfd3cd6['List']){_0x3ac59b[_0x8938('0x9e')]=_0xfd3cd6;_0x3ac59b[_0x8938('0x9f')]=_0xfd3cd6[_0x8938('0xa0')];_0x3ac59b[_0x8938('0xa1')]=_0xfd3cd6[_0x8938('0x9a')];_0x3ac59b[_0x8938('0x9f')]=_[_0x8938('0xa2')](_0x3ac59b['applications'],['priority'],['asc']);if(_0x3ac59b[_0x8938('0x9e')][_0x8938('0xa0')]){delete _0x3ac59b['account']['Applications'];}if(_0x3ac59b[_0x8938('0x9e')][_0x8938('0x9a')]&&_0x3ac59b[_0x8938('0x9e')]['List'][_0x8938('0x9c')][_0x8938('0x4c')]){return _0x3ac59b[_0x8938('0x9e')]['List'][_0x8938('0x9c')][0x0];}var _0x4ab18b=_[_0x8938('0x1a')](_0x1f8e4c[_0x8938('0x61')],{'firstName':_0x1f8e4c['body'][_0x8938('0x93')],'ListId':_0xfd3cd6[_0x8938('0x92')]});_0x4ab18b[_0x1f8e4c[_0x8938('0x61')][_0x8938('0x97')]]=_0x1f8e4c[_0x8938('0x61')][_0x8938('0x93')];return db[_0x8938('0x9b')][_0x8938('0x5d')](_0x4ab18b,{'fields':_0x36f9ed,'raw':!![]});}})['then'](handleEntityNotFound(_0x5f12d1,null))['then'](function(_0xb8135d){_0x3ac59b[_0x8938('0xa3')]=_0xb8135d;var _0x3e39dc=_0x1f8e4c[_0x8938('0x61')]['customerIp'];if(_0x1f8e4c[_0x8938('0xa4')]['cf-connecting-ip']){_0x3e39dc=_0x1f8e4c[_0x8938('0xa4')]['cf-connecting-ip'];}else if(_0x1f8e4c['headers']['x-forwarded-for']){_0x3e39dc=_[_0x8938('0xa5')](_0x1f8e4c[_0x8938('0xa4')][_0x8938('0xa6')][_0x8938('0xa7')](','));}if(_0xb8135d){var _0x31cd58={'ContactId':_0xb8135d['id'],'ChatWebsiteId':_0x1f8e4c['params']['id'],'from':(_0xb8135d[_0x8938('0xa8')]||'')+'\x20'+(_0xb8135d[_0x8938('0xa9')]||''),'customerIp':_0x3e39dc,'customerPort':_0x1f8e4c[_0x8938('0xa4')]['x-real-port']?_0x1f8e4c[_0x8938('0xa4')][_0x8938('0xaa')]:null,'referer':_0x1f8e4c[_0x8938('0x61')]['referer'],'browserName':_0x10e840[_0x8938('0xab')][_0x8938('0x3d')]&&_0x10e840[_0x8938('0xab')]['version']?util[_0x8938('0xac')](_0x8938('0xad'),_0x10e840['browser'][_0x8938('0x3d')],_0x10e840['browser']['version']):_0x8938('0xae'),'browserVersion':_0x10e840[_0x8938('0xab')][_0x8938('0xaf')]||'unknown','osName':util['format']('%s\x20%s',_0x10e840['os']['name'],_0x10e840['os'][_0x8938('0xaf')]),'osVersion':_0x10e840['os'][_0x8938('0xaf')],'deviceModel':_0x10e840['device'][_0x8938('0x47')]&&_0x10e840[_0x8938('0xb0')][_0x8938('0xb1')]?util[_0x8938('0xac')](_0x8938('0xb2'),_0x10e840[_0x8938('0xb0')][_0x8938('0x47')],_0x10e840['device'][_0x8938('0xb1')],_0x10e840['device']['type']):null,'deviceVendor':_0x10e840['device'][_0x8938('0xb1')],'deviceType':_0x10e840[_0x8938('0xb0')][_0x8938('0x45')],'formData':JSON['stringify'](_0x1f8e4c[_0x8938('0x61')])};var _0xd6b136={'ChatWebsiteId':_0x1f8e4c['params']['id'],'closed':![]};if(_0x1f8e4c['body'][_0x8938('0xb3')]){_0xd6b136[_0x8938('0xb3')]=_0x1f8e4c[_0x8938('0x61')][_0x8938('0xb3')];return db[_0x8938('0xb4')][_0x8938('0x5c')]({'where':_0xd6b136})[_0x8938('0x22')](function(_0x5abae8){if(_0x5abae8){return[_0x5abae8,![]];}_0x31cd58[_0x8938('0xb3')]=_0x1f8e4c[_0x8938('0x61')]['threadId'];_0x31cd58[_0x8938('0xb5')]=_0x1f8e4c[_0x8938('0x61')][_0x8938('0xb5')];return db[_0x8938('0xb4')][_0x8938('0x5d')](_0x31cd58)[_0x8938('0x22')](function(_0x2d5214){return[_0x2d5214,!![]];});});}_0xd6b136['ContactId']=_0xb8135d['id'];if(_0x1f8e4c['body'][_0x8938('0xb6')]&&_0x1f8e4c['body'][_0x8938('0xb6')]['id']){_0xd6b136['id']=_0x1f8e4c['body'][_0x8938('0xb6')]['id'];return db[_0x8938('0xb4')]['find']({'where':_0xd6b136})[_0x8938('0x22')](function(_0xef474f){if(_0xef474f){return[_0xef474f,![]];}return db[_0x8938('0xb4')][_0x8938('0x5d')](_0x31cd58)[_0x8938('0x22')](function(_0x3c975e){return[_0x3c975e,!![]];});});}return db[_0x8938('0xb4')]['create'](_0x31cd58)[_0x8938('0x22')](function(_0x547096){return[_0x547096,!![]];});}})[_0x8938('0xb7')](function(_0x1ee506,_0x5e30a9){if(_0x1ee506){_0x443d21=_0x5e30a9;if(!_0x5e30a9){var _0x3ff221={'from':(_0x3ac59b['contact']['firstName']||'')+'\x20'+(_0x3ac59b[_0x8938('0xa3')][_0x8938('0xa9')]||'')};if(_0x1f8e4c[_0x8938('0x61')]['threadId']&&_0x1f8e4c[_0x8938('0x61')][_0x8938('0xb8')]&&_0x1f8e4c[_0x8938('0x61')][_0x8938('0xb3')]!=_0x1f8e4c[_0x8938('0x61')][_0x8938('0xb8')]){_0x3ff221[_0x8938('0xb3')]=_0x1f8e4c[_0x8938('0x61')][_0x8938('0xb8')];}return _0x1ee506[_0x8938('0x36')](_0x3ff221);}else{return _0x1ee506;}}})['then'](function(_0xc676fb){_0x3ac59b[_0x8938('0xb6')]=_0xc676fb[_0x8938('0x37')]({'plain':!![]});_0x3ac59b[_0x8938('0xb6')][_0x8938('0xb9')]=_0x443d21;if(_0x3ac59b[_0x8938('0xb6')]['created']){if(_0x3ac59b[_0x8938('0x9e')][_0x8938('0xba')]){_0x3ac59b[_0x8938('0x9f')][_0x8938('0xbb')]({'id':0x0,'priority':_0x3ac59b[_0x8938('0x9f')][_0x8938('0x4c')]+0x1,'app':_0x8938('0xbc'),'appdata':'unmanaged','interval':'*,*,*,*'});}}return db['ChatMessage'][_0x8938('0x5d')]({'body':_0x1f8e4c[_0x8938('0x61')][_0x8938('0x61')],'ChatWebsiteId':_0x1f8e4c['params']['id'],'ChatInteractionId':_0xc676fb['id'],'direction':'in','ContactId':_0x3ac59b['contact']['id'],'AttachmentId':_0x1f8e4c[_0x8938('0x61')][_0x8938('0xbd')]});})[_0x8938('0x22')](function(_0x2e6b6c){_0x3ac59b[_0x8938('0x28')]=_0x2e6b6c;if(_0x3ac59b['interaction'][_0x8938('0xbe')]){return db[_0x8938('0xbf')][_0x8938('0x5c')]({'attributes':['id',_0x8938('0x3d')],'where':{'id':_0x3ac59b[_0x8938('0xb6')]['UserId']}})['then'](function(_0x991f43){if(_0x991f43){_0x3ac59b[_0x8938('0x9f')][_0x8938('0xc0')]({'id':0x0,'priority':0x0,'app':_0x8938('0xc1'),'appdata':_0x991f43[_0x8938('0x3d')]+','+(_0x3ac59b[_0x8938('0x9e')][_0x8938('0xc2')]||0xa),'interval':_0x8938('0xc3')});_0x3ac59b[_0x8938('0xc4')]=!![];}return respondWithRpcPromise('Start','startRouting',_0x3ac59b);});}return respondWithRpcPromise(_0x8938('0xc5'),_0x8938('0xc6'),_0x3ac59b);})['then'](function(_0x53d6f6){respondWithRpcPromise(_0x8938('0xc7'),'EventManager',{'event':_0x8938('0x86'),'message':_0x53d6f6},client9002);return _0x53d6f6;})[_0x8938('0x22')](respondWithResult(_0x5f12d1,null))['catch'](handleError(_0x5f12d1,null));};exports['offline']=function(_0x3f5b64,_0x252102,_0x1b25a7){var _0x1adcc6,_0x2c7981,_0x3b11fb;var _0x580b6e=[];var _0x5df022=[];var _0x5b4483={};var _0x320885=_0x3f5b64[_0x8938('0xc8')]||[];var _0x29ec6c=[];var _0x5482ec;return db[_0x8938('0x9b')]['describe']()[_0x8938('0x22')](function(_0x59a637){if(!_0x59a637){throw new db[(_0x8938('0x95'))]['ValidationError'](_0x8938('0x8d'));}_0x5df022=_[_0x8938('0x8f')](_['keys'](_0x59a637),[_0x8938('0x90'),_0x8938('0x8e')]);_0x580b6e=_['difference'](_[_0x8938('0x5b')](_0x59a637),[_0x8938('0x90'),_0x8938('0x8e'),'CompanyId',_0x8938('0x92')]);if(_0x3f5b64['body']['id']){delete _0x3f5b64['body']['id'];}if(_['isNil'](_0x3f5b64[_0x8938('0x61')][_0x8938('0x93')])){throw _0x252102[_0x8938('0x2c')](0x1f4)[_0x8938('0x3e')](new db[(_0x8938('0x95'))]['ValidationError'](_0x8938('0x94')));}if(_[_0x8938('0x7c')](_0x3f5b64[_0x8938('0x61')][_0x8938('0x61')])||_0x3f5b64['body'][_0x8938('0x61')]===''){throw _0x252102[_0x8938('0x2c')](0x1f4)[_0x8938('0x3e')](new db['Sequelize'][(_0x8938('0x8c'))]('body\x20is\x20mandatory\x20and\x20not\x20empty'));}if(_[_0x8938('0x7c')](_0x3f5b64[_0x8938('0x61')][_0x8938('0xc9')])){throw _0x252102[_0x8938('0x2c')](0x1f4)[_0x8938('0x3e')](new db['Sequelize'][(_0x8938('0x8c'))](_0x8938('0xca')+_0x580b6e));}if(!_[_0x8938('0x99')](_0x580b6e,_0x3f5b64[_0x8938('0x61')][_0x8938('0xc9')])){throw _0x252102[_0x8938('0x2c')](0x1f4)[_0x8938('0x3e')](new db[(_0x8938('0x95'))]['ValidationError'](_0x8938('0xcb')+_0x580b6e));}_0x5b4483[_0x3f5b64[_0x8938('0x61')][_0x8938('0xc9')]]=_0x3f5b64['body'][_0x8938('0x93')];})[_0x8938('0x22')](function(){return db[_0x8938('0x42')][_0x8938('0x5c')]({'where':{'id':_0x3f5b64[_0x8938('0x5a')]['id']},'include':[{'model':db[_0x8938('0xcc')],'as':_0x8938('0x9a')},{'model':db['MailAccount'],'as':'MailAccount'}]});})[_0x8938('0x22')](handleEntityNotFound(_0x252102,null))[_0x8938('0x22')](function(_0x2d5cb3){if(_0x2d5cb3&&_0x2d5cb3[_0x8938('0x9a')]){_0x2c7981=_0x2d5cb3;var _0x4b174e=_[_0x8938('0x1a')](_0x3f5b64[_0x8938('0x61')],{'firstName':_0x3f5b64[_0x8938('0x61')][_0x8938('0x93')],'phone':_0x3f5b64[_0x8938('0x61')]['from'],'ListId':_0x2d5cb3['ListId']});_0x4b174e[_0x3f5b64[_0x8938('0x61')][_0x8938('0xc9')]]=_0x3f5b64['body'][_0x8938('0x93')];return db[_0x8938('0x9b')][_0x8938('0xcd')]({'where':_0x5b4483,'defaults':_0x4b174e});}})[_0x8938('0xb7')](function(_0x316d24){if(_0x316d24){_0x3b11fb=_0x316d24;var _0x208dce=fs[_0x8938('0xce')](path[_0x8938('0x79')](config[_0x8938('0x7e')],_0x8938('0xcf')),_0x8938('0xd0'));var _0xd2853d=ejs['render'](_0x208dce,{'body':_[_0x8938('0xd1')](_0x3f5b64[_0x8938('0x61')][_0x8938('0x61')]),'bodyTitle':_0x2c7981[_0x8938('0xd2')]});return db[_0x8938('0xd3')][_0x8938('0x5d')]({'body':_0xd2853d,'ContactId':_0x316d24['id'],'ChatWebsiteId':_0x2c7981['id']});}})[_0x8938('0x22')](function(_0x2e3aa1){_0x5482ec=_0x2e3aa1;if(_0x320885[_0x8938('0x4c')]){var _0x155d0b=_0x320885[_0x8938('0x41')](function(_0x519d02){return{'name':_0x519d02[_0x8938('0xd4')],'basename':_0x519d02[_0x8938('0x75')],'type':_0x519d02[_0x8938('0xd5')],'ChatOfflineMessageId':_0x2e3aa1['id']};});_0x29ec6c=_0x155d0b[_0x8938('0x41')](_0x4bd3a5=>{var _0x4e212b={'filename':_0x4bd3a5[_0x8938('0x3d')],'path':path['join'](config[_0x8938('0x7e')],_0x8938('0xd6'),'files',_0x8938('0xd7'),_0x8938('0xd8'),_0x4bd3a5[_0x8938('0xd9')])};return _0x4e212b;});if(!_0x2c7981[_0x8938('0xda')]){return db['sequelize'][_0x8938('0xdb')](function(_0x12ce01){return db[_0x8938('0xdc')]['bulkCreate'](_0x155d0b,{'transaction':_0x12ce01});});}}})[_0x8938('0x22')](function(){if(_0x5482ec){_0x1adcc6=_0x5482ec;return db[_0x8938('0xdd')][_0x8938('0x66')]({'where':{'active':!![]},'include':[{'model':db['MailServerOut'],'as':_0x8938('0xde'),'raw':!![]}]});}})[_0x8938('0x22')](function(_0x343197){if(_0x343197&&_0x343197['Smtp']&&_0x2c7981['forwardOffline']&&_0x2c7981['forwardOfflineAddress']){var _0x3af5ea={'tls':{'rejectUnauthorized':![]}};if(_0x343197['Smtp'][_0x8938('0xdf')]){_0x3af5ea['service']=_0x343197[_0x8938('0xde')][_0x8938('0xdf')];}else{_0x3af5ea[_0x8938('0xe0')]=_0x343197[_0x8938('0xde')][_0x8938('0xe0')];_0x3af5ea[_0x8938('0xe1')]=_0x343197[_0x8938('0xde')][_0x8938('0xe1')];_0x3af5ea['secure']=_0x343197[_0x8938('0xde')][_0x8938('0xe2')];}if(_0x343197[_0x8938('0xde')]['authentication']){_0x3af5ea['auth']={'user':_0x343197['Smtp'][_0x8938('0x5e')],'pass':_0x343197[_0x8938('0xde')][_0x8938('0xe3')]};}return respondWithRpcPromise(_0x8938('0xe4'),_0x8938('0xe5'),{'account':_0x3af5ea,'message':{'from':util[_0x8938('0xac')]('\x22%s\x22\x20<%s>',_0x343197[_0x8938('0x3d')],_0x343197[_0x8938('0xe6')]||_0x343197[_0x8938('0xde')][_0x8938('0x5e')]),'to':_0x2c7981['forwardOfflineAddress'],'subject':_0x2c7981[_0x8938('0xe7')],'html':_0x1adcc6[_0x8938('0x61')],'attachments':_0x29ec6c}},client9003)[_0x8938('0x22')](function(){return _0x1adcc6;})[_0x8938('0x2b')](function(_0x58b6c5){console[_0x8938('0x27')](_0x58b6c5);});}})[_0x8938('0x22')](function(){if(_0x2c7981&&_0x2c7981[_0x8938('0xda')]&&_0x2c7981['MailAccountId']){var _0x1bf54a=[];if(_0x320885[_0x8938('0x4c')]){_0x1bf54a=_0x320885[_0x8938('0x41')](function(_0x269ad8){return{'name':_0x269ad8[_0x8938('0xd4')],'basename':_0x269ad8[_0x8938('0x75')],'type':_0x269ad8[_0x8938('0xd5')],'ChatOfflineMessageId':_0x5482ec['id']};});}var _0x456540;if(!_[_0x8938('0x7c')](_0x2c7981[_0x8938('0xe8')])){var _0x6d1852=_[_0x8938('0x41')](_0x3f5b64['body'],function(_0x5f4948){return _0x5f4948;});var _0x426ba8=_[_0x8938('0xe9')](_0x6d1852)[0x0];var _0x41031b=_[_0x8938('0xea')](_0x426ba8,function(_0x2834b0){return _0x2834b0;});_0x456540=_0x41031b[0x1][_0x2c7981[_0x8938('0xe8')]];}var _0x1cf17d={'from':_0x3b11fb[_0x8938('0xe6')],'firstName':_0x3b11fb[_0x8938('0xa8')],'lastName':_0x3b11fb['lastName'],'mapKey':_0x8938('0xe6'),'message':{'from':_0x3b11fb['email'],'to':_0x2c7981['MailAccount']['email'],'cc':'','subject':_[_0x8938('0x7c')](_0x456540)?_0x2c7981[_0x8938('0xe7')]:_0x456540,'messageId':'','sentAt':new Date(),'attach':_0x1bf54a[_0x8938('0x4c')],'attachments':_0x1bf54a,'originChannel':_0x8938('0xeb'),'ChatWebsiteId':_0x2c7981['id'],'ChatOfflineMessageId':_0x1adcc6['id'],'originTo':_0x2c7981[_0x8938('0xdd')]['email']},'body':_0x1adcc6[_0x8938('0x61')]};var _0x8f78d0={'account':{'id':_0x2c7981[_0x8938('0xec')]},'body':_0x1cf17d,'log':_0x8938('0xed')};return respondWithRpcPromise(_0x8938('0xed'),'notifyMail',_0x8f78d0,client9001)[_0x8938('0x22')](function(){return _0x1adcc6;})[_0x8938('0x2b')](function(_0x1256d1){console[_0x8938('0x27')](_0x1256d1);});}return;})[_0x8938('0x22')](function(){if(_0x1adcc6){return _0x1adcc6;}})[_0x8938('0x22')](respondWithResult(_0x252102,null))['catch'](function(_0xdedfa3){console[_0x8938('0x27')](_0x8938('0x2b'),_0xdedfa3);for(var _0x1a97bd of _0x320885){var _0x444e9e=path[_0x8938('0x79')](config[_0x8938('0x7e')],_0x8938('0xd6'),'files',_0x8938('0xd7'),_0x8938('0xd8'),_0x1a97bd[_0x8938('0x75')]);fs_extra[_0x8938('0xee')](_0x444e9e)['catch'](function(_0x29d40e){console['error'](_0x8938('0xef'),_0x444e9e,_0x29d40e);});}});};exports[_0x8938('0xf0')]=function(_0x3b2443,_0x2090e5,_0x5da7d6){return db[_0x8938('0xb4')][_0x8938('0x5c')]({'where':{'id':_0x3b2443['params']['id']}})[_0x8938('0x22')](handleEntityNotFound(_0x2090e5,null))[_0x8938('0x22')](function(_0x45d459){if(_0x45d459){return _0x45d459[_0x8938('0xf0')](_0x3b2443[_0x8938('0x61')]['ids'],_[_0x8938('0xf1')](_0x3b2443[_0x8938('0x61')],[_0x8938('0xf2'),'id'])||{});}})[_0x8938('0x22')](respondWithResult(_0x2090e5,null))[_0x8938('0x2b')](handleError(_0x2090e5,null));};exports[_0x8938('0xf3')]=function(_0x8f67c9,_0x2f5398,_0x3aca12){var _0x22fd55={'raw':![],'where':{}};var _0x3d630f={};var _0x1ffa5e={'count':0x0,'rows':[]};return db['ChatWebsite'][_0x8938('0x66')]({'where':{'id':_0x8f67c9[_0x8938('0x5a')]['id']}})['then'](handleEntityNotFound(_0x2f5398,null))[_0x8938('0x22')](function(_0x16d438){if(_0x16d438){_0x3d630f['model']=_[_0x8938('0x5b')](db[_0x8938('0xb4')][_0x8938('0x43')]);_0x3d630f[_0x8938('0x48')]=_['keys'](_0x8f67c9[_0x8938('0x48')]);_0x3d630f[_0x8938('0x51')]=_[_0x8938('0x49')](_0x3d630f[_0x8938('0x47')],_0x3d630f[_0x8938('0x48')]);_0x22fd55[_0x8938('0x4b')]=_['intersection'](_0x3d630f[_0x8938('0x47')],qs[_0x8938('0x4a')](_0x8f67c9[_0x8938('0x48')][_0x8938('0x4a')]));_0x22fd55['attributes']=_0x22fd55[_0x8938('0x4b')][_0x8938('0x4c')]?_0x22fd55[_0x8938('0x4b')]:_0x3d630f[_0x8938('0x47')];if(!_0x8f67c9[_0x8938('0x48')][_0x8938('0x4d')](_0x8938('0x4e'))){_0x22fd55[_0x8938('0x30')]=qs[_0x8938('0x30')](_0x8f67c9[_0x8938('0x48')][_0x8938('0x30')]);_0x22fd55[_0x8938('0x2f')]=qs[_0x8938('0x2f')](_0x8f67c9[_0x8938('0x48')][_0x8938('0x2f')]);}_0x22fd55[_0x8938('0x67')]=qs[_0x8938('0x4f')](_0x8f67c9[_0x8938('0x48')][_0x8938('0x4f')]);_0x22fd55[_0x8938('0x50')]=qs[_0x8938('0x51')](_['pick'](_0x8f67c9[_0x8938('0x48')],_0x3d630f[_0x8938('0x51')]));_0x22fd55[_0x8938('0x50')]['ChatWebsiteId']=_0x16d438['id'];if(_0x8f67c9[_0x8938('0x48')][_0x8938('0x54')]){_0x22fd55[_0x8938('0x50')]=_[_0x8938('0x53')](_0x22fd55[_0x8938('0x50')],{'$or':_['map'](_0x22fd55[_0x8938('0x4b')],function(_0xd29739){var _0x3f18cd={};_0x3f18cd[_0xd29739]={'$like':'%'+_0x8f67c9[_0x8938('0x48')][_0x8938('0x54')]+'%'};return _0x3f18cd;})});}_0x22fd55=_[_0x8938('0x53')]({},_0x22fd55,_0x8f67c9[_0x8938('0x55')]);return db[_0x8938('0xb4')][_0x8938('0x68')]({'where':_0x22fd55[_0x8938('0x50')]})[_0x8938('0x22')](function(_0x396249){_0x1ffa5e['count']=_0x396249;if(_0x8f67c9['query']['includeAll']){_0x22fd55[_0x8938('0x56')]=[{'model':db[_0x8938('0x9b')],'as':_0x8938('0xf4'),'required':![]},{'model':db[_0x8938('0xbf')],'as':_0x8938('0xf5'),'attributes':[_0x8938('0x3d'),'fullname',_0x8938('0xf6')],'required':![]},{'model':db[_0x8938('0xf7')],'as':'Tags','attributes':['id',_0x8938('0x3d'),_0x8938('0xf8')],'where':_0x8f67c9[_0x8938('0x48')][_0x8938('0xf9')]?{'id':_0x8f67c9[_0x8938('0x48')][_0x8938('0xf9')]}:undefined,'required':_0x8f67c9[_0x8938('0x48')][_0x8938('0xf9')]?!![]:![]}];}return db['ChatInteraction']['findAll'](_0x22fd55);})[_0x8938('0x22')](function(_0x4f58b5){_0x1ffa5e['rows']=_0x4f58b5;return _0x1ffa5e;});}})[_0x8938('0x22')](respondWithFilteredResult(_0x2f5398,_0x22fd55))[_0x8938('0x2b')](handleError(_0x2f5398,null));};function iftimePromise(_0x123992,_0x1bb43e){return respondWithRpcPromise(_0x8938('0xfa'),'getSnippet',{'command':_0x1bb43e[_0x8938('0xfb')]?util[_0x8938('0xac')]('iftime\x20%s,%s',_0x123992[_0x8938('0xfc')],_0x1bb43e[_0x8938('0xfb')]):util[_0x8938('0xac')](_0x8938('0xfd'),_0x123992[_0x8938('0xfc')])},client9002)[_0x8938('0x22')](function(_0x3bbb45){var _0x57d9c0=_0x3bbb45&&_0x3bbb45[_0x8938('0xfe')](_0x8938('0xff'))>=0x0?!![]:![];logger[_0x8938('0x29')](_0x8938('0x100'),_0x1bb43e['id'],_0x123992['id'],_0x123992['interval'],_0x57d9c0?'ONLINE':_0x8938('0x101'),_0x1bb43e[_0x8938('0xfb')]?_0x1bb43e['timezone']:_0x8938('0x102'));return _0x57d9c0;})['catch'](function(_0x1fcdfe){logger[_0x8938('0x27')](_0x8938('0x100'),_0x1bb43e['id'],_0x123992['id'],_0x123992[_0x8938('0xfc')],util['inspect'](_0x1fcdfe,{'showHidden':![],'depth':null}),_0x1bb43e[_0x8938('0xfb')]?_0x1bb43e[_0x8938('0xfb')]:_0x8938('0x102'));return![];});}exports['getSnippet']=function(_0x157065,_0x1d90d8,_0x579a43){var _0x5df8ab=0x0;var _0x33ef92=0x0;var _0x227091=![];var _0x1490ce;var _0xea28c8;return db['ChatWebsite'][_0x8938('0x5c')]({'where':{'id':_0x157065['params']['id']},'include':[{'model':db[_0x8938('0x103')],'as':'Interval','include':[{'model':db[_0x8938('0x103')],'as':_0x8938('0x104'),'attributes':['id',_0x8938('0xfc')],'raw':!![]}]}]})[_0x8938('0x22')](handleEntityNotFound(_0x1d90d8,null))[_0x8938('0x22')](function(_0xdbf039){if(_0xdbf039){_0x1490ce=_0xdbf039;return _0xdbf039[_0x8938('0x105')]({'raw':!![]});}})[_0x8938('0x22')](function(_0x5271d2){if(_0x1490ce){if(_0x5271d2){_0xea28c8=_0x5271d2;}}return require('../../config/license/util')[_0x8938('0x7a')]();})[_0x8938('0x22')](function(_0x33ac97){if(_0x33ac97){_0x33ef92=_0x33ac97['virtual'];_0x227091=_0x33ac97[_0x8938('0x7b')];}})[_0x8938('0x22')](function(){return db[_0x8938('0xb4')][_0x8938('0x68')]({'where':{'closed':![]}});})[_0x8938('0x22')](function(_0x26e063){_0x5df8ab=_0x26e063;if(_0x33ef92&&_0x26e063>_0x33ef92){return db[_0x8938('0x106')][_0x8938('0x66')]({'where':{'id':0x1}})[_0x8938('0x22')](function(_0xf08597){if(_0xf08597){_0xf08597['increment']('chatLicenseExceeded');}});}})[_0x8938('0x22')](function(){if(_0x1490ce[_0x8938('0x103')]&&_0x1490ce[_0x8938('0x103')]['Intervals']){var _0x4f14cf=[];for(var _0x158d97=0x0;_0x158d97<_0x1490ce[_0x8938('0x103')][_0x8938('0x104')]['length'];_0x158d97++){var _0x551ba5=_0x1490ce['Interval'][_0x8938('0x104')][_0x158d97][_0x8938('0x37')]({'plain':!![]});_0x4f14cf[_0x8938('0xbb')](iftimePromise(_0x551ba5,_0x1490ce));}return BPromise[_0x8938('0x107')](_0x4f14cf)[_0x8938('0x22')](function(_0x4e570e){return _[_0x8938('0x108')](_0x4e570e);});}else{return!![];}})[_0x8938('0x22')](function(_0x84c45){var _0x101938=fs[_0x8938('0xce')](path[_0x8938('0x79')](config[_0x8938('0x7e')],_0x8938('0x109')),_0x8938('0xd0'));var _0x183d6a={'remote':_0x1490ce[_0x8938('0x10a')],'query':querystring[_0x8938('0x10b')](_[_0x8938('0x53')](_0x1490ce[_0x8938('0x37')]({'plain':!![]}),{'customerIp':_0x157065['headers'][_0x8938('0xa6')]||_0x157065['headers'][_0x8938('0x10c')]||_0x157065['connection']['remoteAddress']||_0x157065['ip'],'referer':_0x157065[_0x8938('0xa4')][_0x8938('0x10d')],'openedInteractions':_0x5df8ab,'maxInteractions':_0x33ef92,'virtual':_0x227091[_0x8938('0x10e')],'online':_0x84c45,'custom':_0x227091}))[_0x8938('0x10f')](/'/g,'\x5c\x27')};_0x1d90d8[_0x8938('0x3e')](ejs[_0x8938('0x110')](Mustache[_0x8938('0x110')](_0x101938,_0x183d6a),{'proactiveActions':_0xea28c8,'alignment':_0x1490ce[_0x8938('0x111')],'verticalAlignment':_0x1490ce['verticalAlignment'],'div_color':_0x1490ce[_0x8938('0xf8')],'text_color':_0x1490ce[_0x8938('0x112')],'button_color':_0x1490ce[_0x8938('0x113')],'background_color':_0x1490ce['backgroundColor']}));})[_0x8938('0x2b')](handleError(_0x1d90d8,null));};exports[_0x8938('0x114')]=function(_0x4b1702,_0x478a56,_0x38a8af){return db[_0x8938('0x42')]['findOne']({'where':{'id':_0x4b1702['params']['id']}})[_0x8938('0x22')](handleEntityNotFound(_0x478a56,null))[_0x8938('0x22')](function(_0x3a7a80){if(_0x3a7a80){return db[_0x8938('0x115')][_0x8938('0xdb')](function(_0x147752){return db['ChatApplication'][_0x8938('0x3a')]({'where':{'ChatWebsiteId':_0x4b1702[_0x8938('0x5a')]['id']},'transaction':_0x147752})[_0x8938('0x22')](function(_0x12abf6){var _0x391819=_[_0x8938('0x41')](_0x4b1702['body'],function(_0x35153a){_0x35153a[_0x8938('0x63')]=_0x4b1702[_0x8938('0x5a')]['id'];return _0x35153a;});return db[_0x8938('0x116')]['bulkCreate'](_0x391819,{'transaction':_0x147752});});})[_0x8938('0x22')](function(){return db[_0x8938('0x116')][_0x8938('0x117')]({'where':{'ChatWebsiteId':_0x4b1702[_0x8938('0x5a')]['id']},'order':_0x8938('0x118')});});}})[_0x8938('0x22')](respondWithResult(_0x478a56,null))[_0x8938('0x2b')](handleError(_0x478a56,null));};exports[_0x8938('0x119')]=function(_0x262217,_0x3585d1,_0x4602b6){var _0x51293c={};var _0x440102={};var _0x16fdb1;var _0x1e3850;return db[_0x8938('0x42')][_0x8938('0x66')]({'where':{'id':_0x262217[_0x8938('0x5a')]['id']}})[_0x8938('0x22')](handleEntityNotFound(_0x3585d1,null))['then'](function(_0x7f6422){if(_0x7f6422){_0x16fdb1=_0x7f6422;_0x440102[_0x8938('0x47')]=_[_0x8938('0x5b')](db[_0x8938('0x116')]['rawAttributes']);_0x440102['query']=_[_0x8938('0x5b')](_0x262217[_0x8938('0x48')]);_0x440102['filters']=_['intersection'](_0x440102[_0x8938('0x47')],_0x440102[_0x8938('0x48')]);_0x51293c[_0x8938('0x4b')]=_[_0x8938('0x49')](_0x440102[_0x8938('0x47')],qs['fields'](_0x262217['query'][_0x8938('0x4a')]));_0x51293c[_0x8938('0x4b')]=_0x51293c[_0x8938('0x4b')]['length']?_0x51293c[_0x8938('0x4b')]:_0x440102[_0x8938('0x47')];_0x51293c[_0x8938('0x67')]=qs[_0x8938('0x4f')](_0x262217[_0x8938('0x48')][_0x8938('0x4f')]);_0x51293c[_0x8938('0x50')]=qs[_0x8938('0x51')](_[_0x8938('0x52')](_0x262217[_0x8938('0x48')],_0x440102['filters']));if(_0x262217[_0x8938('0x48')][_0x8938('0x54')]){_0x51293c['where']=_[_0x8938('0x53')](_0x51293c['where'],{'$or':_[_0x8938('0x41')](_0x51293c[_0x8938('0x4b')],function(_0x41deda){var _0x345ba7={};_0x345ba7[_0x41deda]={'$like':'%'+_0x262217[_0x8938('0x48')][_0x8938('0x54')]+'%'};return _0x345ba7;})});}_0x51293c=_[_0x8938('0x53')]({},_0x51293c,_0x262217[_0x8938('0x55')]);return _0x16fdb1[_0x8938('0x119')](_0x51293c);}})[_0x8938('0x22')](function(_0x38a2ce){if(_0x38a2ce){_0x1e3850=_0x38a2ce['length'];if(!_0x262217[_0x8938('0x48')][_0x8938('0x4d')]('nolimit')){_0x51293c[_0x8938('0x30')]=qs[_0x8938('0x30')](_0x262217[_0x8938('0x48')][_0x8938('0x30')]);_0x51293c[_0x8938('0x2f')]=qs[_0x8938('0x2f')](_0x262217[_0x8938('0x48')][_0x8938('0x2f')]);}return _0x16fdb1['getApplications'](_0x51293c);}})[_0x8938('0x22')](function(_0x24a6ef){if(_0x24a6ef){return _0x24a6ef?{'count':_0x1e3850,'rows':_0x24a6ef}:null;}})['then'](respondWithResult(_0x3585d1,null))[_0x8938('0x2b')](handleError(_0x3585d1,null));};exports[_0x8938('0x11a')]=function(_0x398d2c,_0x3c257a,_0x3a1445){return db[_0x8938('0x11b')][_0x8938('0x5c')]({'where':{'id':_0x398d2c[_0x8938('0x5a')]['id']}})[_0x8938('0x22')](handleEntityNotFound(_0x3c257a,null))['then'](function(_0x184964){if(_0x184964){return _0x184964[_0x8938('0x11a')](_0x398d2c[_0x8938('0x61')]['ids'],_[_0x8938('0xf1')](_0x398d2c[_0x8938('0x61')],[_0x8938('0xf2'),'id'])||{});}})[_0x8938('0x22')](respondWithResult(_0x3c257a,null))[_0x8938('0x2b')](handleError(_0x3c257a,null));};exports['getProactiveActions']=function(_0x5cf80b,_0xc83460,_0x4696b4){var _0x14cf98={};var _0x49986d={};var _0x359c96;var _0x72a7f3;return db['ChatWebsite'][_0x8938('0x66')]({'where':{'id':_0x5cf80b[_0x8938('0x5a')]['id']}})[_0x8938('0x22')](handleEntityNotFound(_0xc83460,null))[_0x8938('0x22')](function(_0x4cb2b6){if(_0x4cb2b6){_0x359c96=_0x4cb2b6;_0x49986d['model']=_[_0x8938('0x5b')](db[_0x8938('0x11c')][_0x8938('0x43')]);_0x49986d['query']=_[_0x8938('0x5b')](_0x5cf80b['query']);_0x49986d['filters']=_['intersection'](_0x49986d[_0x8938('0x47')],_0x49986d[_0x8938('0x48')]);_0x14cf98[_0x8938('0x4b')]=_[_0x8938('0x49')](_0x49986d[_0x8938('0x47')],qs['fields'](_0x5cf80b[_0x8938('0x48')][_0x8938('0x4a')]));_0x14cf98['attributes']=_0x14cf98[_0x8938('0x4b')]['length']?_0x14cf98[_0x8938('0x4b')]:_0x49986d[_0x8938('0x47')];_0x14cf98[_0x8938('0x67')]=qs[_0x8938('0x4f')](_0x5cf80b[_0x8938('0x48')]['sort']);_0x14cf98[_0x8938('0x50')]=qs[_0x8938('0x51')](_['pick'](_0x5cf80b[_0x8938('0x48')],_0x49986d[_0x8938('0x51')]));if(_0x5cf80b[_0x8938('0x48')][_0x8938('0x54')]){_0x14cf98[_0x8938('0x50')]=_[_0x8938('0x53')](_0x14cf98[_0x8938('0x50')],{'$or':_[_0x8938('0x41')](_0x14cf98[_0x8938('0x4b')],function(_0x2d4899){var _0x43e945={};_0x43e945[_0x2d4899]={'$like':'%'+_0x5cf80b[_0x8938('0x48')][_0x8938('0x54')]+'%'};return _0x43e945;})});}_0x14cf98=_['merge']({},_0x14cf98,_0x5cf80b[_0x8938('0x55')]);return _0x359c96[_0x8938('0x105')](_0x14cf98);}})[_0x8938('0x22')](function(_0x357742){if(_0x357742){_0x72a7f3=_0x357742[_0x8938('0x4c')];if(!_0x5cf80b[_0x8938('0x48')][_0x8938('0x4d')](_0x8938('0x4e'))){_0x14cf98[_0x8938('0x30')]=qs[_0x8938('0x30')](_0x5cf80b[_0x8938('0x48')][_0x8938('0x30')]);_0x14cf98[_0x8938('0x2f')]=qs[_0x8938('0x2f')](_0x5cf80b[_0x8938('0x48')][_0x8938('0x2f')]);}return _0x359c96['getProactiveActions'](_0x14cf98);}})[_0x8938('0x22')](function(_0x1a19dd){if(_0x1a19dd){return _0x1a19dd?{'count':_0x72a7f3,'rows':_0x1a19dd}:null;}})[_0x8938('0x22')](respondWithResult(_0xc83460,null))[_0x8938('0x2b')](handleError(_0xc83460,null));};exports[_0x8938('0x11d')]=function(_0x3aa8d0,_0xd17e87,_0x44c3f3){var _0x23afdc=_0x3aa8d0[_0x8938('0x48')][_0x8938('0x11e')]==='false'?_0x8938('0x11f'):'onlineForm';return db['ChatWebsite'][_0x8938('0x5c')]({'attributes':['id',_0x23afdc],'where':{'id':_0x3aa8d0[_0x8938('0x5a')]['id']}})[_0x8938('0x22')](handleEntityNotFound(_0xd17e87,null))[_0x8938('0x22')](function(_0x65c864){if(_0x65c864){var _0x2760ed=_0x65c864[_0x23afdc];var _0x374975=_0x2760ed&&_0x2760ed[_0x8938('0x120')]?_0x2760ed[_0x8938('0x120')]:[];_0xd17e87['send']({'fromKey':_[_0x8938('0x7c')](_0x2760ed[_0x8938('0x121')])?undefined:_0x2760ed[_0x8938('0x121')],'count':_0x374975[_0x8938('0x4c')],'rows':_0x374975});}})[_0x8938('0x2b')](handleError(_0xd17e87,null));};exports[_0x8938('0x122')]=function(_0x412ed5,_0x2c6b17,_0x526867){var _0x28c4c0={'raw':![],'where':{}};var _0x17f499={};var _0x504a3e={'count':0x0,'rows':[]};return db[_0x8938('0x42')][_0x8938('0x66')]({'where':{'id':_0x412ed5['params']['id']}})['then'](handleEntityNotFound(_0x2c6b17,null))[_0x8938('0x22')](function(_0x4a1be5){if(_0x4a1be5){_0x17f499[_0x8938('0x47')]=_[_0x8938('0x5b')](db[_0x8938('0xd3')]['rawAttributes']);_0x17f499['query']=_['keys'](_0x412ed5[_0x8938('0x48')]);_0x17f499[_0x8938('0x51')]=_[_0x8938('0x49')](_0x17f499['model'],_0x17f499[_0x8938('0x48')]);_0x28c4c0['attributes']=_[_0x8938('0x49')](_0x17f499[_0x8938('0x47')],qs['fields'](_0x412ed5[_0x8938('0x48')][_0x8938('0x4a')]));_0x28c4c0[_0x8938('0x4b')]=_0x28c4c0[_0x8938('0x4b')][_0x8938('0x4c')]?_0x28c4c0[_0x8938('0x4b')]:_0x17f499[_0x8938('0x47')];if(!_0x412ed5['query'][_0x8938('0x4d')](_0x8938('0x4e'))){_0x28c4c0['limit']=qs[_0x8938('0x30')](_0x412ed5[_0x8938('0x48')][_0x8938('0x30')]);_0x28c4c0[_0x8938('0x2f')]=qs[_0x8938('0x2f')](_0x412ed5[_0x8938('0x48')][_0x8938('0x2f')]);}_0x28c4c0[_0x8938('0x67')]=qs[_0x8938('0x4f')](_0x412ed5[_0x8938('0x48')][_0x8938('0x4f')]);_0x28c4c0['where']=qs[_0x8938('0x51')](_[_0x8938('0x52')](_0x412ed5[_0x8938('0x48')],_0x17f499['filters']));_0x28c4c0[_0x8938('0x50')][_0x8938('0x63')]=_0x4a1be5['id'];if(_0x412ed5[_0x8938('0x48')][_0x8938('0x54')]){_0x28c4c0[_0x8938('0x50')]=_[_0x8938('0x53')](_0x28c4c0[_0x8938('0x50')],{'$or':_[_0x8938('0x41')](_0x28c4c0['attributes'],function(_0x486a82){var _0x2b13df={};_0x2b13df[_0x486a82]={'$like':'%'+_0x412ed5[_0x8938('0x48')][_0x8938('0x54')]+'%'};return _0x2b13df;})});}_0x28c4c0=_[_0x8938('0x53')]({},_0x28c4c0,_0x412ed5['options']);return db[_0x8938('0xd3')]['count']({'where':_0x28c4c0['where']})[_0x8938('0x22')](function(_0x2d7264){_0x504a3e[_0x8938('0x68')]=_0x2d7264;if(_0x412ed5['query'][_0x8938('0x6c')]){_0x28c4c0[_0x8938('0x56')]=[{'all':!![]}];}else{_0x28c4c0[_0x8938('0x56')]=[{'model':db[_0x8938('0x9b')],'as':_0x8938('0xf4'),'required':![]},{'model':db[_0x8938('0xdc')],'as':'Attachments','required':![]}];}return db[_0x8938('0xd3')][_0x8938('0x57')](_0x28c4c0);})[_0x8938('0x22')](function(_0x2c472c){_0x504a3e[_0x8938('0x58')]=_0x2c472c;return _0x504a3e;});}})[_0x8938('0x22')](respondWithFilteredResult(_0x2c6b17,_0x28c4c0))[_0x8938('0x2b')](handleError(_0x2c6b17,null));};exports['addAgents']=function(_0x2d15ff,_0x44190c,_0x4c407f){return db[_0x8938('0x42')]['find']({'where':{'id':_0x2d15ff[_0x8938('0x5a')]['id']}})[_0x8938('0x22')](handleEntityNotFound(_0x44190c,null))[_0x8938('0x22')](function(_0x348870){if(_0x348870){return _0x348870['addAgents'](_0x2d15ff['body'][_0x8938('0xf2')],_['omit'](_0x2d15ff[_0x8938('0x61')],[_0x8938('0xf2'),'id'])||{})['spread'](function(_0x516ba3){for(var _0x51ddd5=0x0;_0x51ddd5<_0x2d15ff[_0x8938('0x61')][_0x8938('0xf2')][_0x8938('0x4c')];_0x51ddd5+=0x1){socket['emit'](_0x8938('0x123'),{'UserId':Number(_0x2d15ff[_0x8938('0x61')][_0x8938('0xf2')][_0x51ddd5]),'ChatWebsiteId':Number(_0x2d15ff[_0x8938('0x5a')]['id'])});}return _0x516ba3;});}})['then'](respondWithResult(_0x44190c,null))[_0x8938('0x2b')](handleError(_0x44190c,null));};exports['removeAgents']=function(_0x4af9d9,_0x12be0a,_0x1ec88a){return db['ChatWebsite'][_0x8938('0x5c')]({'where':{'id':_0x4af9d9[_0x8938('0x5a')]['id']}})[_0x8938('0x22')](handleEntityNotFound(_0x12be0a,null))['then'](function(_0x59bdec){if(_0x59bdec){return _0x59bdec[_0x8938('0x124')](_0x4af9d9['query'][_0x8938('0xf2')])[_0x8938('0x22')](function(){if(_[_0x8938('0x125')](_0x4af9d9[_0x8938('0x48')][_0x8938('0xf2')])){for(var _0x486e23=0x0;_0x486e23<_0x4af9d9[_0x8938('0x48')]['ids'][_0x8938('0x4c')];_0x486e23+=0x1){socket[_0x8938('0x126')](_0x8938('0x127'),{'UserId':Number(_0x4af9d9[_0x8938('0x48')][_0x8938('0xf2')][_0x486e23]),'ChatWebsiteId':Number(_0x4af9d9[_0x8938('0x5a')]['id'])});}}else{socket['emit']('userChatWebsite:remove',{'UserId':Number(_0x4af9d9['query'][_0x8938('0xf2')]),'ChatWebsiteId':Number(_0x4af9d9['params']['id'])});}});}})[_0x8938('0x22')](respondWithStatusCode(_0x12be0a,null))[_0x8938('0x2b')](handleError(_0x12be0a,null));};exports[_0x8938('0x128')]=function(_0x388dbb,_0x897f5c,_0x373607){var _0x27e10f={};var _0x12e2b2={};var _0x1a532b;var _0x2469f6;return db[_0x8938('0x42')][_0x8938('0x66')]({'where':{'id':_0x388dbb[_0x8938('0x5a')]['id']}})[_0x8938('0x22')](handleEntityNotFound(_0x897f5c,null))[_0x8938('0x22')](function(_0x326b6e){if(_0x326b6e){_0x1a532b=_0x326b6e;_0x12e2b2[_0x8938('0x47')]=_[_0x8938('0x5b')](db[_0x8938('0xbf')][_0x8938('0x43')]);_0x12e2b2[_0x8938('0x48')]=_['keys'](_0x388dbb[_0x8938('0x48')]);_0x12e2b2[_0x8938('0x51')]=_[_0x8938('0x49')](_0x12e2b2[_0x8938('0x47')],_0x12e2b2[_0x8938('0x48')]);_0x27e10f[_0x8938('0x4b')]=_[_0x8938('0x49')](_0x12e2b2[_0x8938('0x47')],qs['fields'](_0x388dbb[_0x8938('0x48')][_0x8938('0x4a')]));_0x27e10f[_0x8938('0x4b')]=_0x27e10f[_0x8938('0x4b')]['length']?_0x27e10f[_0x8938('0x4b')]:_0x12e2b2[_0x8938('0x47')];_0x27e10f['order']=qs[_0x8938('0x4f')](_0x388dbb[_0x8938('0x48')]['sort']);_0x27e10f[_0x8938('0x50')]=qs[_0x8938('0x51')](_[_0x8938('0x52')](_0x388dbb['query'],_0x12e2b2['filters']));if(_0x388dbb[_0x8938('0x48')][_0x8938('0x54')]){_0x27e10f['where']=_[_0x8938('0x53')](_0x27e10f[_0x8938('0x50')],{'$or':_[_0x8938('0x41')](_0x27e10f[_0x8938('0x4b')],function(_0x74e8f2){var _0x59e7fb={};_0x59e7fb[_0x74e8f2]={'$like':'%'+_0x388dbb[_0x8938('0x48')][_0x8938('0x54')]+'%'};return _0x59e7fb;})});}_0x27e10f=_[_0x8938('0x53')]({},_0x27e10f,_0x388dbb['options']);return _0x1a532b['getAgents'](_0x27e10f);}})[_0x8938('0x22')](function(_0x1151e9){if(_0x1151e9){_0x2469f6=_0x1151e9['length'];if(!_0x388dbb[_0x8938('0x48')][_0x8938('0x4d')](_0x8938('0x4e'))){_0x27e10f[_0x8938('0x30')]=qs['limit'](_0x388dbb['query'][_0x8938('0x30')]);_0x27e10f[_0x8938('0x2f')]=qs[_0x8938('0x2f')](_0x388dbb[_0x8938('0x48')][_0x8938('0x2f')]);}return _0x1a532b[_0x8938('0x128')](_0x27e10f);}})[_0x8938('0x22')](function(_0x3bdb20){if(_0x3bdb20){return _0x3bdb20?{'count':_0x2469f6,'rows':_0x3bdb20}:null;}})[_0x8938('0x22')](respondWithResult(_0x897f5c,null))['catch'](handleError(_0x897f5c,null));};
\ No newline at end of file
diff --git a/server/api/chatWebsite/chatWebsite.events.js b/server/api/chatWebsite/chatWebsite.events.js
index 18b582d..780d79a 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 _0xd246=['hasOwnProperty','hook','exports','events','../../mysqldb','ChatWebsite','setMaxListeners','save','update','remove','emit'];(function(_0x258ac4,_0x50432d){var _0x3b4c31=function(_0x5f4857){while(--_0x5f4857){_0x258ac4['push'](_0x258ac4['shift']());}};_0x3b4c31(++_0x50432d);}(_0xd246,0xf5));var _0x6d24=function(_0x562faf,_0x102bcc){_0x562faf=_0x562faf-0x0;var _0x22c1f6=_0xd246[_0x562faf];return _0x22c1f6;};'use strict';var EventEmitter=require(_0x6d24('0x0'));var ChatWebsite=require(_0x6d24('0x1'))['db'][_0x6d24('0x2')];var ChatWebsiteEvents=new EventEmitter();ChatWebsiteEvents[_0x6d24('0x3')](0x0);var events={'afterCreate':_0x6d24('0x4'),'afterUpdate':_0x6d24('0x5'),'afterDestroy':_0x6d24('0x6')};function emitEvent(_0x51c18f){return function(_0x4e76e1,_0xfa68f3,_0x58e7fc){ChatWebsiteEvents[_0x6d24('0x7')](_0x51c18f+':'+_0x4e76e1['id'],_0x4e76e1);ChatWebsiteEvents['emit'](_0x51c18f,_0x4e76e1);_0x58e7fc(null);};}for(var e in events){if(events[_0x6d24('0x8')](e)){var event=events[e];ChatWebsite[_0x6d24('0x9')](e,emitEvent(event));}}module[_0x6d24('0xa')]=ChatWebsiteEvents;
\ No newline at end of file
+var _0xc9b9=['hasOwnProperty','hook','exports','ChatWebsite','setMaxListeners','save'];(function(_0x23239b,_0x4a22c8){var _0xaae286=function(_0x5dbd44){while(--_0x5dbd44){_0x23239b['push'](_0x23239b['shift']());}};_0xaae286(++_0x4a22c8);}(_0xc9b9,0x18f));var _0x9c9b=function(_0x1655bb,_0x5a82ae){_0x1655bb=_0x1655bb-0x0;var _0x5e2020=_0xc9b9[_0x1655bb];return _0x5e2020;};'use strict';var EventEmitter=require('events');var ChatWebsite=require('../../mysqldb')['db'][_0x9c9b('0x0')];var ChatWebsiteEvents=new EventEmitter();ChatWebsiteEvents[_0x9c9b('0x1')](0x0);var events={'afterCreate':_0x9c9b('0x2'),'afterUpdate':'update','afterDestroy':'remove'};function emitEvent(_0x48231c){return function(_0x497d53,_0x38a64b,_0x4be6dc){ChatWebsiteEvents['emit'](_0x48231c+':'+_0x497d53['id'],_0x497d53);ChatWebsiteEvents['emit'](_0x48231c,_0x497d53);_0x4be6dc(null);};}for(var e in events){if(events[_0x9c9b('0x3')](e)){var event=events[e];ChatWebsite[_0x9c9b('0x4')](e,emitEvent(event));}}module[_0x9c9b('0x5')]=ChatWebsiteEvents;
\ No newline at end of file
diff --git a/server/api/chatWebsite/chatWebsite.model.js b/server/api/chatWebsite/chatWebsite.model.js
index cbf5e48..7feb8b3 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 _0x4140=['request-promise','path','rimraf','../../config/environment','./chatWebsite.attributes','exports','define','chat_websites','lodash','util','../../config/logger','api','moment'];(function(_0x9aada2,_0xd2d349){var _0x196dff=function(_0x5ad061){while(--_0x5ad061){_0x9aada2['push'](_0x9aada2['shift']());}};_0x196dff(++_0xd2d349);}(_0x4140,0xa4));var _0x0414=function(_0x4cdf87,_0x200caf){_0x4cdf87=_0x4cdf87-0x0;var _0x14d49d=_0x4140[_0x4cdf87];return _0x14d49d;};'use strict';var _=require(_0x0414('0x0'));var util=require(_0x0414('0x1'));var logger=require(_0x0414('0x2'))(_0x0414('0x3'));var moment=require(_0x0414('0x4'));var BPromise=require('bluebird');var rp=require(_0x0414('0x5'));var fs=require('fs');var path=require(_0x0414('0x6'));var rimraf=require(_0x0414('0x7'));var config=require(_0x0414('0x8'));var attributes=require(_0x0414('0x9'));module[_0x0414('0xa')]=function(_0x2b089c,_0xd45ef4){return _0x2b089c[_0x0414('0xb')]('ChatWebsite',attributes,{'tableName':_0x0414('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x77f8=['moment','request-promise','path','../../config/environment','./chatWebsite.attributes','exports','define','ChatWebsite','chat_websites','util','../../config/logger','api'];(function(_0x1fb55b,_0x473495){var _0x30ec9a=function(_0x94638){while(--_0x94638){_0x1fb55b['push'](_0x1fb55b['shift']());}};_0x30ec9a(++_0x473495);}(_0x77f8,0xd5));var _0x877f=function(_0x5a3cf0,_0x160a68){_0x5a3cf0=_0x5a3cf0-0x0;var _0x5a64ee=_0x77f8[_0x5a3cf0];return _0x5a64ee;};'use strict';var _=require('lodash');var util=require(_0x877f('0x0'));var logger=require(_0x877f('0x1'))(_0x877f('0x2'));var moment=require(_0x877f('0x3'));var BPromise=require('bluebird');var rp=require(_0x877f('0x4'));var fs=require('fs');var path=require(_0x877f('0x5'));var rimraf=require('rimraf');var config=require(_0x877f('0x6'));var attributes=require(_0x877f('0x7'));module[_0x877f('0x8')]=function(_0x455c99,_0x1ac165){return _0x455c99[_0x877f('0x9')](_0x877f('0xa'),attributes,{'tableName':_0x877f('0xb'),'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 1a00303..1b93e85 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 _0x25f2=['http','redis','localhost','register','request','then','info','ChatWebsite,\x20%s,\x20%s','request\x20sent','ChatWebsite,\x20%s,\x20%s,\x20%s','stringify','error','code','message','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','client'];(function(_0x336ca2,_0x1a813a){var _0xda59a6=function(_0x47caa6){while(--_0x47caa6){_0x336ca2['push'](_0x336ca2['shift']());}};_0xda59a6(++_0x1a813a);}(_0x25f2,0x8b));var _0x225f=function(_0x45e987,_0x3f95d8){_0x45e987=_0x45e987-0x0;var _0x3cc3e0=_0x25f2[_0x45e987];return _0x3cc3e0;};'use strict';var _=require(_0x225f('0x0'));var util=require(_0x225f('0x1'));var moment=require(_0x225f('0x2'));var BPromise=require(_0x225f('0x3'));var rs=require(_0x225f('0x4'));var fs=require('fs');var Redis=require(_0x225f('0x5'));var db=require(_0x225f('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0x225f('0x7'))(_0x225f('0x8'));var config=require(_0x225f('0x9'));var jayson=require('jayson/promise');var client=jayson[_0x225f('0xa')][_0x225f('0xb')]({'port':0x232a});config[_0x225f('0xc')]=_['defaults'](config[_0x225f('0xc')],{'host':_0x225f('0xd'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x225f('0xc')]));require('./chatWebsite.socket')[_0x225f('0xe')](socket);function respondWithRpcPromise(_0x555642,_0x2390c0,_0x4e9a0e){return new BPromise(function(_0x304d4b,_0x1f7008){return client[_0x225f('0xf')](_0x555642,_0x4e9a0e)[_0x225f('0x10')](function(_0x4399f0){logger[_0x225f('0x11')](_0x225f('0x12'),_0x2390c0,_0x225f('0x13'));logger['debug'](_0x225f('0x14'),_0x2390c0,_0x225f('0x13'),JSON[_0x225f('0x15')](_0x4399f0));if(_0x4399f0[_0x225f('0x16')]){if(_0x4399f0[_0x225f('0x16')][_0x225f('0x17')]===0x1f4){logger[_0x225f('0x16')](_0x225f('0x12'),_0x2390c0,_0x4399f0[_0x225f('0x16')][_0x225f('0x18')]);return _0x1f7008(_0x4399f0['error'][_0x225f('0x18')]);}logger[_0x225f('0x16')]('ChatWebsite,\x20%s,\x20%s',_0x2390c0,_0x4399f0[_0x225f('0x16')][_0x225f('0x18')]);return _0x304d4b(_0x4399f0['error'][_0x225f('0x18')]);}else{logger['info'](_0x225f('0x12'),_0x2390c0,'request\x20sent');_0x304d4b(_0x4399f0['result'][_0x225f('0x18')]);}})['catch'](function(_0x8bd13a){logger[_0x225f('0x16')](_0x225f('0x12'),_0x2390c0,_0x8bd13a);_0x1f7008(_0x8bd13a);});});}
\ No newline at end of file
+var _0x8d7c=['localhost','socket.io-emitter','./chatWebsite.socket','register','then','info','ChatWebsite,\x20%s,\x20%s','request\x20sent','debug','ChatWebsite,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','defaults','redis'];(function(_0x40a045,_0x516f0e){var _0x1a687c=function(_0x48c9fe){while(--_0x48c9fe){_0x40a045['push'](_0x40a045['shift']());}};_0x1a687c(++_0x516f0e);}(_0x8d7c,0xdf));var _0xc8d7=function(_0x57611e,_0x4482c8){_0x57611e=_0x57611e-0x0;var _0x36cacc=_0x8d7c[_0x57611e];return _0x36cacc;};'use strict';var _=require(_0xc8d7('0x0'));var util=require(_0xc8d7('0x1'));var moment=require(_0xc8d7('0x2'));var BPromise=require(_0xc8d7('0x3'));var rs=require(_0xc8d7('0x4'));var fs=require('fs');var Redis=require(_0xc8d7('0x5'));var db=require(_0xc8d7('0x6'))['db'];var utils=require(_0xc8d7('0x7'));var logger=require('../../config/logger')(_0xc8d7('0x8'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson['client']['http']({'port':0x232a});config['redis']=_[_0xc8d7('0x9')](config[_0xc8d7('0xa')],{'host':_0xc8d7('0xb'),'port':0x18eb});var socket=require(_0xc8d7('0xc'))(new Redis(config['redis']));require(_0xc8d7('0xd'))[_0xc8d7('0xe')](socket);function respondWithRpcPromise(_0x1c5978,_0x3c85a,_0x323a13){return new BPromise(function(_0x4acc08,_0x338bd1){return client['request'](_0x1c5978,_0x323a13)[_0xc8d7('0xf')](function(_0x15ead5){logger[_0xc8d7('0x10')](_0xc8d7('0x11'),_0x3c85a,_0xc8d7('0x12'));logger[_0xc8d7('0x13')](_0xc8d7('0x14'),_0x3c85a,_0xc8d7('0x12'),JSON[_0xc8d7('0x15')](_0x15ead5));if(_0x15ead5[_0xc8d7('0x16')]){if(_0x15ead5[_0xc8d7('0x16')][_0xc8d7('0x17')]===0x1f4){logger[_0xc8d7('0x16')](_0xc8d7('0x11'),_0x3c85a,_0x15ead5[_0xc8d7('0x16')][_0xc8d7('0x18')]);return _0x338bd1(_0x15ead5[_0xc8d7('0x16')][_0xc8d7('0x18')]);}logger[_0xc8d7('0x16')](_0xc8d7('0x11'),_0x3c85a,_0x15ead5[_0xc8d7('0x16')][_0xc8d7('0x18')]);return _0x4acc08(_0x15ead5[_0xc8d7('0x16')][_0xc8d7('0x18')]);}else{logger['info'](_0xc8d7('0x11'),_0x3c85a,_0xc8d7('0x12'));_0x4acc08(_0x15ead5['result'][_0xc8d7('0x18')]);}})[_0xc8d7('0x19')](function(_0x5042b9){logger[_0xc8d7('0x16')]('ChatWebsite,\x20%s,\x20%s',_0x3c85a,_0x5042b9);_0x338bd1(_0x5042b9);});});}
\ No newline at end of file
diff --git a/server/api/chatWebsite/chatWebsite.socket.js b/server/api/chatWebsite/chatWebsite.socket.js
index 56b4b51..5528ed6 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 _0x6645=['chatWebsite:','./chatWebsite.events','save','remove','update','emit','removeListener','register','length'];(function(_0x2b1112,_0x51d6bd){var _0x1776e9=function(_0x264015){while(--_0x264015){_0x2b1112['push'](_0x2b1112['shift']());}};_0x1776e9(++_0x51d6bd);}(_0x6645,0x118));var _0x5664=function(_0x5f2301,_0x5b012d){_0x5f2301=_0x5f2301-0x0;var _0x4a0d33=_0x6645[_0x5f2301];return _0x4a0d33;};'use strict';var ChatWebsiteEvents=require(_0x5664('0x0'));var events=[_0x5664('0x1'),_0x5664('0x2'),_0x5664('0x3')];function createListener(_0x547df4,_0x1cd19d){return function(_0x5992c4){_0x1cd19d[_0x5664('0x4')](_0x547df4,_0x5992c4);};}function removeListener(_0xc7866f,_0x1c4c64){return function(){ChatWebsiteEvents[_0x5664('0x5')](_0xc7866f,_0x1c4c64);};}exports[_0x5664('0x6')]=function(_0x38bf1e){for(var _0x48aaaf=0x0,_0x5ed9f1=events[_0x5664('0x7')];_0x48aaaf<_0x5ed9f1;_0x48aaaf++){var _0x1f3189=events[_0x48aaaf];var _0xa0773e=createListener(_0x5664('0x8')+_0x1f3189,_0x38bf1e);ChatWebsiteEvents['on'](_0x1f3189,_0xa0773e);}};
\ No newline at end of file
+var _0x98bf=['length','chatWebsite:','./chatWebsite.events','save','remove','update','emit','removeListener','register'];(function(_0x576292,_0x23b1a2){var _0x3aa65b=function(_0x2eac91){while(--_0x2eac91){_0x576292['push'](_0x576292['shift']());}};_0x3aa65b(++_0x23b1a2);}(_0x98bf,0xb6));var _0xf98b=function(_0xd60ec9,_0x4c62fd){_0xd60ec9=_0xd60ec9-0x0;var _0x4a6c4b=_0x98bf[_0xd60ec9];return _0x4a6c4b;};'use strict';var ChatWebsiteEvents=require(_0xf98b('0x0'));var events=[_0xf98b('0x1'),_0xf98b('0x2'),_0xf98b('0x3')];function createListener(_0x9ed68,_0x2b2a4e){return function(_0x226a00){_0x2b2a4e[_0xf98b('0x4')](_0x9ed68,_0x226a00);};}function removeListener(_0x528232,_0xeda2ce){return function(){ChatWebsiteEvents[_0xf98b('0x5')](_0x528232,_0xeda2ce);};}exports[_0xf98b('0x6')]=function(_0x35d2cd){for(var _0x40d437=0x0,_0x3cc5ab=events[_0xf98b('0x7')];_0x40d437<_0x3cc5ab;_0x40d437++){var _0x209326=events[_0x40d437];var _0x57874e=createListener(_0xf98b('0x8')+_0x209326,_0x35d2cd);ChatWebsiteEvents['on'](_0x209326,_0x57874e);}};
\ No newline at end of file
diff --git a/server/api/chatWebsite/index.js b/server/api/chatWebsite/index.js
index 04e284f..32ee1c1 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 _0xe493=['util','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatWebsite.controller','get','isAuthenticated','index','/describe','describe','/:id','show','/:id/dispositions','getDispositions','/:id/canned_answers','getAnswers','/:id/logo','getLogo','/:id/avatar','getAvatar','/:id/customer_avatar','getCustomerAvatar','/:id/system_avatar','getSystemAvatar','/:id/interactions','getInteractions','/:id/snippet','getSnippet','/:id/applications','getApplications','/:id/proactive_actions','/:id/fields','getFields','getOfflineMessages','post','create','addAnswer','root','format','%s-%s','originalname','file','addLogo','diskStorage','join','server/files/images/avatars/','now','addAvatar','single','notify','server/files','attachments','offline-chat','extname','any','offline','addInteraction','addApplications','addProactiveActions','/:id/users','addAgents','update','delete','destroy','removeDispositions','removeAgents','exports','multer'];(function(_0x4dd4fe,_0x200d4a){var _0x20b374=function(_0x589039){while(--_0x589039){_0x4dd4fe['push'](_0x4dd4fe['shift']());}};_0x20b374(++_0x200d4a);}(_0xe493,0x8d));var _0x3e49=function(_0x6f1bdd,_0x10be27){_0x6f1bdd=_0x6f1bdd-0x0;var _0x44a67e=_0xe493[_0x6f1bdd];return _0x44a67e;};'use strict';var multer=require(_0x3e49('0x0'));var util=require(_0x3e49('0x1'));var path=require('path');var timeout=require(_0x3e49('0x2'));var express=require(_0x3e49('0x3'));var router=express['Router']();var fs_extra=require(_0x3e49('0x4'));var auth=require(_0x3e49('0x5'));var interaction=require(_0x3e49('0x6'));var config=require(_0x3e49('0x7'));var controller=require(_0x3e49('0x8'));router[_0x3e49('0x9')]('/',auth[_0x3e49('0xa')](),controller[_0x3e49('0xb')]);router[_0x3e49('0x9')](_0x3e49('0xc'),auth[_0x3e49('0xa')](),controller[_0x3e49('0xd')]);router['get'](_0x3e49('0xe'),auth[_0x3e49('0xa')](),controller[_0x3e49('0xf')]);router[_0x3e49('0x9')](_0x3e49('0x10'),auth[_0x3e49('0xa')](),controller[_0x3e49('0x11')]);router[_0x3e49('0x9')](_0x3e49('0x12'),auth[_0x3e49('0xa')](),controller[_0x3e49('0x13')]);router[_0x3e49('0x9')](_0x3e49('0x14'),controller[_0x3e49('0x15')]);router[_0x3e49('0x9')](_0x3e49('0x16'),controller[_0x3e49('0x17')]);router[_0x3e49('0x9')](_0x3e49('0x18'),controller[_0x3e49('0x19')]);router[_0x3e49('0x9')](_0x3e49('0x1a'),controller[_0x3e49('0x1b')]);router[_0x3e49('0x9')](_0x3e49('0x1c'),auth['isAuthenticated'](),controller[_0x3e49('0x1d')]);router['get'](_0x3e49('0x1e'),controller[_0x3e49('0x1f')]);router[_0x3e49('0x9')](_0x3e49('0x20'),auth['isAuthenticated'](),controller[_0x3e49('0x21')]);router['get'](_0x3e49('0x22'),auth[_0x3e49('0xa')](),controller['getProactiveActions']);router['get'](_0x3e49('0x23'),controller[_0x3e49('0x24')]);router['get']('/:id/offline_messages',auth[_0x3e49('0xa')](),controller[_0x3e49('0x25')]);router[_0x3e49('0x9')]('/:id/users',auth[_0x3e49('0xa')](),controller['getAgents']);router[_0x3e49('0x26')]('/',auth[_0x3e49('0xa')](),controller[_0x3e49('0x27')]);router[_0x3e49('0x26')](_0x3e49('0x10'),auth[_0x3e49('0xa')](),controller['addDisposition']);router[_0x3e49('0x26')](_0x3e49('0x12'),auth[_0x3e49('0xa')](),controller[_0x3e49('0x28')]);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x2a5d74,_0x27322a,_0x437b62){_0x437b62(null,path['join'](config[_0x3e49('0x29')],'server/files/images/logos/'));},'filename':function(_0xb0a4d3,_0x50a310,_0x39d544){_0x39d544(null,util[_0x3e49('0x2a')](_0x3e49('0x2b'),Date['now'](),_0x50a310[_0x3e49('0x2c')]));}})});router[_0x3e49('0x26')]('/:id/logo',upload['single'](_0x3e49('0x2d')),controller[_0x3e49('0x2e')]);var upload=multer({'storage':multer[_0x3e49('0x2f')]({'destination':function(_0x3defb5,_0x5e485c,_0x2901cd){_0x2901cd(null,path[_0x3e49('0x30')](config['root'],_0x3e49('0x31')));},'filename':function(_0x332301,_0x49a95a,_0x13e547){_0x13e547(null,util[_0x3e49('0x2a')](_0x3e49('0x2b'),Date[_0x3e49('0x32')](),_0x49a95a[_0x3e49('0x2c')]));}})});router[_0x3e49('0x26')]('/:id/avatar',upload['single'](_0x3e49('0x2d')),controller[_0x3e49('0x33')]);var upload=multer({'storage':multer[_0x3e49('0x2f')]({'destination':function(_0x3cc346,_0x23bd16,_0x393a86){_0x393a86(null,path[_0x3e49('0x30')](config[_0x3e49('0x29')],_0x3e49('0x31')));},'filename':function(_0x37f2e4,_0xe29359,_0xaebb73){_0xaebb73(null,util[_0x3e49('0x2a')](_0x3e49('0x2b'),Date['now'](),_0xe29359[_0x3e49('0x2c')]));}})});router[_0x3e49('0x26')](_0x3e49('0x18'),upload[_0x3e49('0x34')](_0x3e49('0x2d')),controller['addCustomerAvatar']);var upload=multer({'storage':multer[_0x3e49('0x2f')]({'destination':function(_0x1af537,_0x5350cb,_0x35c583){_0x35c583(null,path[_0x3e49('0x30')](config['root'],_0x3e49('0x31')));},'filename':function(_0x2a70d6,_0x1f87f8,_0x2e2a4d){_0x2e2a4d(null,util['format']('%s-%s',Date[_0x3e49('0x32')](),_0x1f87f8[_0x3e49('0x2c')]));}})});router['post']('/:id/system_avatar',upload[_0x3e49('0x34')](_0x3e49('0x2d')),controller['addSystemAvatar']);router[_0x3e49('0x26')]('/:id/notify',controller[_0x3e49('0x35')]);const offlineUploadMulter=multer({'storage':multer[_0x3e49('0x2f')]({'destination':function(_0x4d81da,_0x411ed4,_0x4f053c){const _0x5574b2=path[_0x3e49('0x30')](config['root'],_0x3e49('0x36'),_0x3e49('0x37'),_0x3e49('0x38'));fs_extra['ensureDir'](_0x5574b2,function(){_0x4f053c(null,_0x5574b2);});},'filename':function(_0x55958e,_0x524b0e,_0x369fc8){const _0x42b25b=_0x524b0e[_0x3e49('0x2c')]['replace'](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');const _0x8297c2=path[_0x3e49('0x39')](_0x42b25b);const _0x535441=Date['now']()+'-'+_0x42b25b['replace'](_0x8297c2,'')+_0x8297c2;_0x369fc8(null,_0x535441);}})});router[_0x3e49('0x26')]('/:id/offline',offlineUploadMulter[_0x3e49('0x3a')](),controller[_0x3e49('0x3b')]);router[_0x3e49('0x26')]('/:id/interactions',auth[_0x3e49('0xa')](),controller[_0x3e49('0x3c')]);router[_0x3e49('0x26')](_0x3e49('0x20'),auth[_0x3e49('0xa')](),controller[_0x3e49('0x3d')]);router['post'](_0x3e49('0x22'),auth[_0x3e49('0xa')](),controller[_0x3e49('0x3e')]);router[_0x3e49('0x26')](_0x3e49('0x3f'),auth['isAuthenticated'](),controller[_0x3e49('0x40')]);router['put'](_0x3e49('0xe'),auth[_0x3e49('0xa')](),controller[_0x3e49('0x41')]);router[_0x3e49('0x42')](_0x3e49('0xe'),auth[_0x3e49('0xa')](),controller[_0x3e49('0x43')]);router['delete']('/:id/dispositions',auth[_0x3e49('0xa')](),controller[_0x3e49('0x44')]);router['delete'](_0x3e49('0x12'),auth[_0x3e49('0xa')](),controller['removeAnswers']);router[_0x3e49('0x42')]('/:id/users',auth[_0x3e49('0xa')](),controller[_0x3e49('0x45')]);module[_0x3e49('0x46')]=router;
\ No newline at end of file
+var _0x908f=['./chatWebsite.controller','get','isAuthenticated','index','/describe','describe','/:id','show','/:id/dispositions','getDispositions','/:id/canned_answers','/:id/logo','getLogo','/:id/customer_avatar','getSystemAvatar','/:id/interactions','/:id/snippet','/:id/applications','/:id/proactive_actions','getProactiveActions','/:id/fields','getFields','getOfflineMessages','/:id/users','post','diskStorage','join','format','%s-%s','now','originalname','single','addLogo','root','file','addAvatar','addCustomerAvatar','server/files/images/avatars/','/:id/system_avatar','notify','server/files','offline-chat','ensureDir','replace','/:id/offline','any','offline','addInteraction','addProactiveActions','addAgents','put','update','delete','destroy','removeAnswers','multer','path','connect-timeout','Router','fs-extra','../../components/interaction/service'];(function(_0x1a920f,_0x547b1b){var _0x390e05=function(_0xa37692){while(--_0xa37692){_0x1a920f['push'](_0x1a920f['shift']());}};_0x390e05(++_0x547b1b);}(_0x908f,0x1a5));var _0xf908=function(_0x26868d,_0x471272){_0x26868d=_0x26868d-0x0;var _0x4d24ad=_0x908f[_0x26868d];return _0x4d24ad;};'use strict';var multer=require(_0xf908('0x0'));var util=require('util');var path=require(_0xf908('0x1'));var timeout=require(_0xf908('0x2'));var express=require('express');var router=express[_0xf908('0x3')]();var fs_extra=require(_0xf908('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0xf908('0x5'));var config=require('../../config/environment');var controller=require(_0xf908('0x6'));router[_0xf908('0x7')]('/',auth[_0xf908('0x8')](),controller[_0xf908('0x9')]);router[_0xf908('0x7')](_0xf908('0xa'),auth[_0xf908('0x8')](),controller[_0xf908('0xb')]);router[_0xf908('0x7')](_0xf908('0xc'),auth['isAuthenticated'](),controller[_0xf908('0xd')]);router[_0xf908('0x7')](_0xf908('0xe'),auth[_0xf908('0x8')](),controller[_0xf908('0xf')]);router[_0xf908('0x7')](_0xf908('0x10'),auth[_0xf908('0x8')](),controller['getAnswers']);router[_0xf908('0x7')](_0xf908('0x11'),controller[_0xf908('0x12')]);router[_0xf908('0x7')]('/:id/avatar',controller['getAvatar']);router[_0xf908('0x7')](_0xf908('0x13'),controller['getCustomerAvatar']);router[_0xf908('0x7')]('/:id/system_avatar',controller[_0xf908('0x14')]);router[_0xf908('0x7')](_0xf908('0x15'),auth[_0xf908('0x8')](),controller['getInteractions']);router[_0xf908('0x7')](_0xf908('0x16'),controller['getSnippet']);router['get'](_0xf908('0x17'),auth[_0xf908('0x8')](),controller['getApplications']);router['get'](_0xf908('0x18'),auth[_0xf908('0x8')](),controller[_0xf908('0x19')]);router[_0xf908('0x7')](_0xf908('0x1a'),controller[_0xf908('0x1b')]);router[_0xf908('0x7')]('/:id/offline_messages',auth[_0xf908('0x8')](),controller[_0xf908('0x1c')]);router[_0xf908('0x7')](_0xf908('0x1d'),auth[_0xf908('0x8')](),controller['getAgents']);router['post']('/',auth['isAuthenticated'](),controller['create']);router[_0xf908('0x1e')]('/:id/dispositions',auth['isAuthenticated'](),controller['addDisposition']);router[_0xf908('0x1e')](_0xf908('0x10'),auth[_0xf908('0x8')](),controller['addAnswer']);var upload=multer({'storage':multer[_0xf908('0x1f')]({'destination':function(_0x91d1c8,_0x158fb2,_0x4d2436){_0x4d2436(null,path[_0xf908('0x20')](config['root'],'server/files/images/logos/'));},'filename':function(_0x3024ae,_0x6bcae5,_0x2c9d5c){_0x2c9d5c(null,util[_0xf908('0x21')](_0xf908('0x22'),Date[_0xf908('0x23')](),_0x6bcae5[_0xf908('0x24')]));}})});router[_0xf908('0x1e')](_0xf908('0x11'),upload[_0xf908('0x25')]('file'),controller[_0xf908('0x26')]);var upload=multer({'storage':multer[_0xf908('0x1f')]({'destination':function(_0x438ac4,_0x597bd6,_0x637d93){_0x637d93(null,path['join'](config[_0xf908('0x27')],'server/files/images/avatars/'));},'filename':function(_0x145fe4,_0x3cebfa,_0x284ecd){_0x284ecd(null,util[_0xf908('0x21')]('%s-%s',Date[_0xf908('0x23')](),_0x3cebfa[_0xf908('0x24')]));}})});router['post']('/:id/avatar',upload[_0xf908('0x25')](_0xf908('0x28')),controller[_0xf908('0x29')]);var upload=multer({'storage':multer[_0xf908('0x1f')]({'destination':function(_0x34139e,_0x10f981,_0x107fd8){_0x107fd8(null,path[_0xf908('0x20')](config[_0xf908('0x27')],'server/files/images/avatars/'));},'filename':function(_0xc87017,_0x200681,_0x51a343){_0x51a343(null,util[_0xf908('0x21')]('%s-%s',Date['now'](),_0x200681['originalname']));}})});router[_0xf908('0x1e')](_0xf908('0x13'),upload[_0xf908('0x25')](_0xf908('0x28')),controller[_0xf908('0x2a')]);var upload=multer({'storage':multer[_0xf908('0x1f')]({'destination':function(_0x22d8fa,_0xbd5a0d,_0x2cec0c){_0x2cec0c(null,path[_0xf908('0x20')](config[_0xf908('0x27')],_0xf908('0x2b')));},'filename':function(_0x57eee0,_0xa1c29b,_0x56c329){_0x56c329(null,util['format']('%s-%s',Date[_0xf908('0x23')](),_0xa1c29b[_0xf908('0x24')]));}})});router[_0xf908('0x1e')](_0xf908('0x2c'),upload[_0xf908('0x25')](_0xf908('0x28')),controller['addSystemAvatar']);router[_0xf908('0x1e')]('/:id/notify',controller[_0xf908('0x2d')]);const offlineUploadMulter=multer({'storage':multer[_0xf908('0x1f')]({'destination':function(_0x2d11c4,_0x230443,_0x5f4d1b){const _0x717e9c=path[_0xf908('0x20')](config['root'],_0xf908('0x2e'),'attachments',_0xf908('0x2f'));fs_extra[_0xf908('0x30')](_0x717e9c,function(){_0x5f4d1b(null,_0x717e9c);});},'filename':function(_0x545a82,_0x5cf982,_0x2bb762){const _0x29412e=_0x5cf982[_0xf908('0x24')]['replace'](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');const _0x3c7e5b=path['extname'](_0x29412e);const _0x4c30c6=Date[_0xf908('0x23')]()+'-'+_0x29412e[_0xf908('0x31')](_0x3c7e5b,'')+_0x3c7e5b;_0x2bb762(null,_0x4c30c6);}})});router['post'](_0xf908('0x32'),offlineUploadMulter[_0xf908('0x33')](),controller[_0xf908('0x34')]);router[_0xf908('0x1e')](_0xf908('0x15'),auth[_0xf908('0x8')](),controller[_0xf908('0x35')]);router[_0xf908('0x1e')](_0xf908('0x17'),auth[_0xf908('0x8')](),controller['addApplications']);router[_0xf908('0x1e')]('/:id/proactive_actions',auth[_0xf908('0x8')](),controller[_0xf908('0x36')]);router[_0xf908('0x1e')](_0xf908('0x1d'),auth[_0xf908('0x8')](),controller[_0xf908('0x37')]);router[_0xf908('0x38')]('/:id',auth[_0xf908('0x8')](),controller[_0xf908('0x39')]);router[_0xf908('0x3a')](_0xf908('0xc'),auth['isAuthenticated'](),controller[_0xf908('0x3b')]);router['delete']('/:id/dispositions',auth[_0xf908('0x8')](),controller['removeDispositions']);router[_0xf908('0x3a')](_0xf908('0x10'),auth[_0xf908('0x8')](),controller[_0xf908('0x3c')]);router[_0xf908('0x3a')](_0xf908('0x1d'),auth[_0xf908('0x8')](),controller['removeAgents']);module['exports']=router;
\ No newline at end of file
diff --git a/server/api/cloudProvider/cloudProvider.attributes.js b/server/api/cloudProvider/cloudProvider.attributes.js
index e810319..33e0149 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 _0x8958=['STRING','exports'];(function(_0x1e3c02,_0x5c07a2){var _0x4d26d7=function(_0x367ed9){while(--_0x367ed9){_0x1e3c02['push'](_0x1e3c02['shift']());}};_0x4d26d7(++_0x5c07a2);}(_0x8958,0x93));var _0x8895=function(_0x234e48,_0x28cd01){_0x234e48=_0x234e48-0x0;var _0x599086=_0x8958[_0x234e48];return _0x599086;};'use strict';var Sequelize=require('sequelize');module[_0x8895('0x0')]={'name':{'type':Sequelize['STRING'],'allowNull':![],'validate':{'notEmpty':!![]}},'service':{'type':Sequelize['ENUM']('AmazonAWS','Google'),'allowNull':![],'validate':{'notEmpty':!![]}},'data1':{'type':Sequelize[_0x8895('0x1')]},'data2':{'type':Sequelize['STRING']}};
\ No newline at end of file
+var _0x624c=['STRING','ENUM','AmazonAWS','Google','exports'];(function(_0x3ebb69,_0x3e612e){var _0x421e59=function(_0x5a8c66){while(--_0x5a8c66){_0x3ebb69['push'](_0x3ebb69['shift']());}};_0x421e59(++_0x3e612e);}(_0x624c,0x1ee));var _0xc624=function(_0x42235f,_0x5dabfd){_0x42235f=_0x42235f-0x0;var _0x3f5fab=_0x624c[_0x42235f];return _0x3f5fab;};'use strict';var Sequelize=require('sequelize');module[_0xc624('0x0')]={'name':{'type':Sequelize[_0xc624('0x1')],'allowNull':![],'validate':{'notEmpty':!![]}},'service':{'type':Sequelize[_0xc624('0x2')](_0xc624('0x3'),_0xc624('0x4')),'allowNull':![],'validate':{'notEmpty':!![]}},'data1':{'type':Sequelize['STRING']},'data2':{'type':Sequelize[_0xc624('0x1')]}};
\ No newline at end of file
diff --git a/server/api/cloudProvider/cloudProvider.controller.js b/server/api/cloudProvider/cloudProvider.controller.js
index b91e040..ef2bfcf 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 _0xadb5=['model','query','keys','intersection','attributes','fields','hasOwnProperty','nolimit','sort','where','pick','filters','filter','VIRTUAL','merge','options','includeAll','include','findAll','rows','catch','show','params','rawAttributes','create','body','find','rimraf','fast-json-patch','request-promise','moment','mustache','util','path','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../config/license/util','sendStatus','status','json','offset','undefined','limit','count','set','Content-Range','update','then','destroy','end','stack','name','send','index','map','CloudProvider','fieldName','type','key'];(function(_0xdea41a,_0x552987){var _0x15d0d8=function(_0x1e0d0b){while(--_0x1e0d0b){_0xdea41a['push'](_0xdea41a['shift']());}};_0x15d0d8(++_0x552987);}(_0xadb5,0xad));var _0x5adb=function(_0x2a79f2,_0x260252){_0x2a79f2=_0x2a79f2-0x0;var _0x5c0e5f=_0xadb5[_0x2a79f2];return _0x5c0e5f;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x5adb('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0x5adb('0x1'));var rp=require(_0x5adb('0x2'));var moment=require(_0x5adb('0x3'));var BPromise=require('bluebird');var Mustache=require(_0x5adb('0x4'));var util=require(_0x5adb('0x5'));var path=require(_0x5adb('0x6'));var sox=require('sox');var csv=require(_0x5adb('0x7'));var ejs=require(_0x5adb('0x8'));var fs=require('fs');var fs_extra=require(_0x5adb('0x9'));var _=require(_0x5adb('0xa'));var squel=require(_0x5adb('0xb'));var crypto=require(_0x5adb('0xc'));var jsforce=require(_0x5adb('0xd'));var deskjs=require(_0x5adb('0xe'));var toCsv=require(_0x5adb('0x7'));var querystring=require(_0x5adb('0xf'));var Papa=require(_0x5adb('0x10'));var Redis=require(_0x5adb('0x11'));var authService=require(_0x5adb('0x12'));var qs=require(_0x5adb('0x13'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0x5adb('0x14'))(_0x5adb('0x15'));var utils=require(_0x5adb('0x16'));var config=require('../../config/environment');var licenseUtil=require(_0x5adb('0x17'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x2a0b70,_0x5433bf){_0x5433bf=_0x5433bf||0xcc;return function(_0x8cfcc6){if(_0x8cfcc6){return _0x2a0b70[_0x5adb('0x18')](_0x5433bf);}return _0x2a0b70[_0x5adb('0x19')](_0x5433bf)['end']();};}function respondWithResult(_0x2a545b,_0x34af2c){_0x34af2c=_0x34af2c||0xc8;return function(_0xf82f72){if(_0xf82f72){return _0x2a545b['status'](_0x34af2c)[_0x5adb('0x1a')](_0xf82f72);}};}function respondWithFilteredResult(_0x518823,_0x367d82){return function(_0x42a482){if(_0x42a482){var _0x30614e=typeof _0x367d82[_0x5adb('0x1b')]===_0x5adb('0x1c')&&typeof _0x367d82[_0x5adb('0x1d')]===_0x5adb('0x1c');var _0x42f4c6=_0x42a482[_0x5adb('0x1e')];var _0x529b65=_0x30614e?0x0:_0x367d82[_0x5adb('0x1b')];var _0x5de028=_0x30614e?_0x42a482[_0x5adb('0x1e')]:_0x367d82['offset']+_0x367d82[_0x5adb('0x1d')];var _0x50e84f;if(_0x5de028>=_0x42f4c6){_0x5de028=_0x42f4c6;_0x50e84f=0xc8;}else{_0x50e84f=0xce;}_0x518823['status'](_0x50e84f);return _0x518823[_0x5adb('0x1f')](_0x5adb('0x20'),_0x529b65+'-'+_0x5de028+'/'+_0x42f4c6)[_0x5adb('0x1a')](_0x42a482);}return null;};}function patchUpdates(_0x1fd4a7){return function(_0x99bc6c){try{jsonpatch['apply'](_0x99bc6c,_0x1fd4a7,!![]);}catch(_0x3255b3){return BPromise['reject'](_0x3255b3);}return _0x99bc6c['save']();};}function saveUpdates(_0x3754cc,_0x379b33){return function(_0x1a38d3){if(_0x1a38d3){return _0x1a38d3[_0x5adb('0x21')](_0x3754cc)[_0x5adb('0x22')](function(_0x413911){return _0x413911;});}return null;};}function removeEntity(_0xfd9bb9,_0x4ca150){return function(_0x4b1957){if(_0x4b1957){return _0x4b1957[_0x5adb('0x23')]()[_0x5adb('0x22')](function(){_0xfd9bb9[_0x5adb('0x19')](0xcc)[_0x5adb('0x24')]();});}};}function handleEntityNotFound(_0x49f203,_0x2fee18){return function(_0x2e1e63){if(!_0x2e1e63){_0x49f203['sendStatus'](0x194);}return _0x2e1e63;};}function handleError(_0x1feecf,_0x1ded9f){_0x1ded9f=_0x1ded9f||0x1f4;return function(_0x1a0acd){logger['error'](_0x1a0acd[_0x5adb('0x25')]);if(_0x1a0acd[_0x5adb('0x26')]){delete _0x1a0acd[_0x5adb('0x26')];}_0x1feecf[_0x5adb('0x19')](_0x1ded9f)[_0x5adb('0x27')](_0x1a0acd);};}exports[_0x5adb('0x28')]=function(_0x4a5d46,_0x49992e){var _0x5d457e={},_0x39bddd={},_0x1eac55={'count':0x0,'rows':[]};var _0x60a672=_[_0x5adb('0x29')](db[_0x5adb('0x2a')]['rawAttributes'],function(_0x11ec2a){return{'name':_0x11ec2a[_0x5adb('0x2b')],'type':_0x11ec2a[_0x5adb('0x2c')][_0x5adb('0x2d')]};});_0x39bddd[_0x5adb('0x2e')]=_[_0x5adb('0x29')](_0x60a672,_0x5adb('0x26'));_0x39bddd[_0x5adb('0x2f')]=_[_0x5adb('0x30')](_0x4a5d46[_0x5adb('0x2f')]);_0x39bddd['filters']=_[_0x5adb('0x31')](_0x39bddd['model'],_0x39bddd[_0x5adb('0x2f')]);_0x5d457e[_0x5adb('0x32')]=_['intersection'](_0x39bddd[_0x5adb('0x2e')],qs[_0x5adb('0x33')](_0x4a5d46[_0x5adb('0x2f')]['fields']));_0x5d457e[_0x5adb('0x32')]=_0x5d457e[_0x5adb('0x32')]['length']?_0x5d457e['attributes']:_0x39bddd[_0x5adb('0x2e')];if(!_0x4a5d46['query'][_0x5adb('0x34')](_0x5adb('0x35'))){_0x5d457e[_0x5adb('0x1d')]=qs[_0x5adb('0x1d')](_0x4a5d46[_0x5adb('0x2f')]['limit']);_0x5d457e[_0x5adb('0x1b')]=qs[_0x5adb('0x1b')](_0x4a5d46[_0x5adb('0x2f')]['offset']);}_0x5d457e['order']=qs[_0x5adb('0x36')](_0x4a5d46[_0x5adb('0x2f')]['sort']);_0x5d457e[_0x5adb('0x37')]=qs['filters'](_[_0x5adb('0x38')](_0x4a5d46['query'],_0x39bddd[_0x5adb('0x39')]),_0x60a672);if(_0x4a5d46['query'][_0x5adb('0x3a')]){_0x5d457e[_0x5adb('0x37')]=_['merge'](_0x5d457e[_0x5adb('0x37')],{'$or':_['map'](_0x60a672,function(_0xadbe37){if(_0xadbe37[_0x5adb('0x2c')]!==_0x5adb('0x3b')){var _0x50edd1={};_0x50edd1[_0xadbe37[_0x5adb('0x26')]]={'$like':'%'+_0x4a5d46[_0x5adb('0x2f')][_0x5adb('0x3a')]+'%'};return _0x50edd1;}})});}_0x5d457e=_[_0x5adb('0x3c')]({},_0x5d457e,_0x4a5d46[_0x5adb('0x3d')]);var _0x52d74f={'where':_0x5d457e['where']};return db['CloudProvider']['count'](_0x52d74f)[_0x5adb('0x22')](function(_0x2fbe14){_0x1eac55[_0x5adb('0x1e')]=_0x2fbe14;if(_0x4a5d46[_0x5adb('0x2f')][_0x5adb('0x3e')]){_0x5d457e[_0x5adb('0x3f')]=[{'all':!![]}];}return db[_0x5adb('0x2a')][_0x5adb('0x40')](_0x5d457e);})['then'](function(_0x53f2c6){_0x1eac55[_0x5adb('0x41')]=_0x53f2c6;return _0x1eac55;})['then'](respondWithFilteredResult(_0x49992e,_0x5d457e))[_0x5adb('0x42')](handleError(_0x49992e,null));};exports[_0x5adb('0x43')]=function(_0x299746,_0x121714){var _0xdfecfd={'raw':!![],'where':{'id':_0x299746[_0x5adb('0x44')]['id']}},_0x522ee5={};_0x522ee5[_0x5adb('0x2e')]=_['keys'](db[_0x5adb('0x2a')][_0x5adb('0x45')]);_0x522ee5['query']=_[_0x5adb('0x30')](_0x299746[_0x5adb('0x2f')]);_0x522ee5[_0x5adb('0x39')]=_[_0x5adb('0x31')](_0x522ee5[_0x5adb('0x2e')],_0x522ee5[_0x5adb('0x2f')]);_0xdfecfd[_0x5adb('0x32')]=_['intersection'](_0x522ee5['model'],qs[_0x5adb('0x33')](_0x299746[_0x5adb('0x2f')][_0x5adb('0x33')]));_0xdfecfd[_0x5adb('0x32')]=_0xdfecfd['attributes']['length']?_0xdfecfd[_0x5adb('0x32')]:_0x522ee5[_0x5adb('0x2e')];if(_0x299746[_0x5adb('0x2f')][_0x5adb('0x3e')]){_0xdfecfd[_0x5adb('0x3f')]=[{'all':!![]}];}_0xdfecfd=_['merge']({},_0xdfecfd,_0x299746[_0x5adb('0x3d')]);return db[_0x5adb('0x2a')]['find'](_0xdfecfd)[_0x5adb('0x22')](handleEntityNotFound(_0x121714,null))[_0x5adb('0x22')](respondWithResult(_0x121714,null))[_0x5adb('0x42')](handleError(_0x121714,null));};exports[_0x5adb('0x46')]=function(_0x186bd2,_0x3a5409){return db[_0x5adb('0x2a')][_0x5adb('0x46')](_0x186bd2['body'],{})[_0x5adb('0x22')](respondWithResult(_0x3a5409,0xc9))['catch'](handleError(_0x3a5409,null));};exports['update']=function(_0x5015ee,_0x3cd211){if(_0x5015ee[_0x5adb('0x47')]['id']){delete _0x5015ee[_0x5adb('0x47')]['id'];}return db['CloudProvider'][_0x5adb('0x48')]({'where':{'id':_0x5015ee['params']['id']}})[_0x5adb('0x22')](handleEntityNotFound(_0x3cd211,null))[_0x5adb('0x22')](saveUpdates(_0x5015ee[_0x5adb('0x47')],null))['then'](respondWithResult(_0x3cd211,null))[_0x5adb('0x42')](handleError(_0x3cd211,null));};exports['destroy']=function(_0x22fa54,_0x6dc067){return db['CloudProvider'][_0x5adb('0x48')]({'where':{'id':_0x22fa54[_0x5adb('0x44')]['id']}})[_0x5adb('0x22')](handleEntityNotFound(_0x6dc067,null))[_0x5adb('0x22')](removeEntity(_0x6dc067,null))[_0x5adb('0x42')](handleError(_0x6dc067,null));};
\ No newline at end of file
+var _0xadb5=['model','query','keys','intersection','attributes','fields','hasOwnProperty','nolimit','sort','where','pick','filters','filter','VIRTUAL','merge','options','includeAll','include','findAll','rows','catch','show','params','rawAttributes','create','body','find','rimraf','fast-json-patch','request-promise','moment','mustache','util','path','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../config/license/util','sendStatus','status','json','offset','undefined','limit','count','set','Content-Range','update','then','destroy','end','stack','name','send','index','map','CloudProvider','fieldName','type','key'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xadb5,0xad));var _0x5adb=function(_0x5e45ca,_0x4853ca){_0x5e45ca=_0x5e45ca-0x0;var _0x1fab16=_0xadb5[_0x5e45ca];return _0x1fab16;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x5adb('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0x5adb('0x1'));var rp=require(_0x5adb('0x2'));var moment=require(_0x5adb('0x3'));var BPromise=require('bluebird');var Mustache=require(_0x5adb('0x4'));var util=require(_0x5adb('0x5'));var path=require(_0x5adb('0x6'));var sox=require('sox');var csv=require(_0x5adb('0x7'));var ejs=require(_0x5adb('0x8'));var fs=require('fs');var fs_extra=require(_0x5adb('0x9'));var _=require(_0x5adb('0xa'));var squel=require(_0x5adb('0xb'));var crypto=require(_0x5adb('0xc'));var jsforce=require(_0x5adb('0xd'));var deskjs=require(_0x5adb('0xe'));var toCsv=require(_0x5adb('0x7'));var querystring=require(_0x5adb('0xf'));var Papa=require(_0x5adb('0x10'));var Redis=require(_0x5adb('0x11'));var authService=require(_0x5adb('0x12'));var qs=require(_0x5adb('0x13'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0x5adb('0x14'))(_0x5adb('0x15'));var utils=require(_0x5adb('0x16'));var config=require('../../config/environment');var licenseUtil=require(_0x5adb('0x17'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x2a0b70,_0x5433bf){_0x5433bf=_0x5433bf||0xcc;return function(_0x8cfcc6){if(_0x8cfcc6){return _0x2a0b70[_0x5adb('0x18')](_0x5433bf);}return _0x2a0b70[_0x5adb('0x19')](_0x5433bf)['end']();};}function respondWithResult(_0x2a545b,_0x34af2c){_0x34af2c=_0x34af2c||0xc8;return function(_0xf82f72){if(_0xf82f72){return _0x2a545b['status'](_0x34af2c)[_0x5adb('0x1a')](_0xf82f72);}};}function respondWithFilteredResult(_0x518823,_0x367d82){return function(_0x42a482){if(_0x42a482){var _0x30614e=typeof _0x367d82[_0x5adb('0x1b')]===_0x5adb('0x1c')&&typeof _0x367d82[_0x5adb('0x1d')]===_0x5adb('0x1c');var _0x42f4c6=_0x42a482[_0x5adb('0x1e')];var _0x529b65=_0x30614e?0x0:_0x367d82[_0x5adb('0x1b')];var _0x5de028=_0x30614e?_0x42a482[_0x5adb('0x1e')]:_0x367d82['offset']+_0x367d82[_0x5adb('0x1d')];var _0x50e84f;if(_0x5de028>=_0x42f4c6){_0x5de028=_0x42f4c6;_0x50e84f=0xc8;}else{_0x50e84f=0xce;}_0x518823['status'](_0x50e84f);return _0x518823[_0x5adb('0x1f')](_0x5adb('0x20'),_0x529b65+'-'+_0x5de028+'/'+_0x42f4c6)[_0x5adb('0x1a')](_0x42a482);}return null;};}function patchUpdates(_0x1fd4a7){return function(_0x99bc6c){try{jsonpatch['apply'](_0x99bc6c,_0x1fd4a7,!![]);}catch(_0x3255b3){return BPromise['reject'](_0x3255b3);}return _0x99bc6c['save']();};}function saveUpdates(_0x3754cc,_0x379b33){return function(_0x1a38d3){if(_0x1a38d3){return _0x1a38d3[_0x5adb('0x21')](_0x3754cc)[_0x5adb('0x22')](function(_0x413911){return _0x413911;});}return null;};}function removeEntity(_0xfd9bb9,_0x4ca150){return function(_0x4b1957){if(_0x4b1957){return _0x4b1957[_0x5adb('0x23')]()[_0x5adb('0x22')](function(){_0xfd9bb9[_0x5adb('0x19')](0xcc)[_0x5adb('0x24')]();});}};}function handleEntityNotFound(_0x49f203,_0x2fee18){return function(_0x2e1e63){if(!_0x2e1e63){_0x49f203['sendStatus'](0x194);}return _0x2e1e63;};}function handleError(_0x1feecf,_0x1ded9f){_0x1ded9f=_0x1ded9f||0x1f4;return function(_0x1a0acd){logger['error'](_0x1a0acd[_0x5adb('0x25')]);if(_0x1a0acd[_0x5adb('0x26')]){delete _0x1a0acd[_0x5adb('0x26')];}_0x1feecf[_0x5adb('0x19')](_0x1ded9f)[_0x5adb('0x27')](_0x1a0acd);};}exports[_0x5adb('0x28')]=function(_0x4a5d46,_0x49992e){var _0x5d457e={},_0x39bddd={},_0x1eac55={'count':0x0,'rows':[]};var _0x60a672=_[_0x5adb('0x29')](db[_0x5adb('0x2a')]['rawAttributes'],function(_0x11ec2a){return{'name':_0x11ec2a[_0x5adb('0x2b')],'type':_0x11ec2a[_0x5adb('0x2c')][_0x5adb('0x2d')]};});_0x39bddd[_0x5adb('0x2e')]=_[_0x5adb('0x29')](_0x60a672,_0x5adb('0x26'));_0x39bddd[_0x5adb('0x2f')]=_[_0x5adb('0x30')](_0x4a5d46[_0x5adb('0x2f')]);_0x39bddd['filters']=_[_0x5adb('0x31')](_0x39bddd['model'],_0x39bddd[_0x5adb('0x2f')]);_0x5d457e[_0x5adb('0x32')]=_['intersection'](_0x39bddd[_0x5adb('0x2e')],qs[_0x5adb('0x33')](_0x4a5d46[_0x5adb('0x2f')]['fields']));_0x5d457e[_0x5adb('0x32')]=_0x5d457e[_0x5adb('0x32')]['length']?_0x5d457e['attributes']:_0x39bddd[_0x5adb('0x2e')];if(!_0x4a5d46['query'][_0x5adb('0x34')](_0x5adb('0x35'))){_0x5d457e[_0x5adb('0x1d')]=qs[_0x5adb('0x1d')](_0x4a5d46[_0x5adb('0x2f')]['limit']);_0x5d457e[_0x5adb('0x1b')]=qs[_0x5adb('0x1b')](_0x4a5d46[_0x5adb('0x2f')]['offset']);}_0x5d457e['order']=qs[_0x5adb('0x36')](_0x4a5d46[_0x5adb('0x2f')]['sort']);_0x5d457e[_0x5adb('0x37')]=qs['filters'](_[_0x5adb('0x38')](_0x4a5d46['query'],_0x39bddd[_0x5adb('0x39')]),_0x60a672);if(_0x4a5d46['query'][_0x5adb('0x3a')]){_0x5d457e[_0x5adb('0x37')]=_['merge'](_0x5d457e[_0x5adb('0x37')],{'$or':_['map'](_0x60a672,function(_0xadbe37){if(_0xadbe37[_0x5adb('0x2c')]!==_0x5adb('0x3b')){var _0x50edd1={};_0x50edd1[_0xadbe37[_0x5adb('0x26')]]={'$like':'%'+_0x4a5d46[_0x5adb('0x2f')][_0x5adb('0x3a')]+'%'};return _0x50edd1;}})});}_0x5d457e=_[_0x5adb('0x3c')]({},_0x5d457e,_0x4a5d46[_0x5adb('0x3d')]);var _0x52d74f={'where':_0x5d457e['where']};return db['CloudProvider']['count'](_0x52d74f)[_0x5adb('0x22')](function(_0x2fbe14){_0x1eac55[_0x5adb('0x1e')]=_0x2fbe14;if(_0x4a5d46[_0x5adb('0x2f')][_0x5adb('0x3e')]){_0x5d457e[_0x5adb('0x3f')]=[{'all':!![]}];}return db[_0x5adb('0x2a')][_0x5adb('0x40')](_0x5d457e);})['then'](function(_0x53f2c6){_0x1eac55[_0x5adb('0x41')]=_0x53f2c6;return _0x1eac55;})['then'](respondWithFilteredResult(_0x49992e,_0x5d457e))[_0x5adb('0x42')](handleError(_0x49992e,null));};exports[_0x5adb('0x43')]=function(_0x299746,_0x121714){var _0xdfecfd={'raw':!![],'where':{'id':_0x299746[_0x5adb('0x44')]['id']}},_0x522ee5={};_0x522ee5[_0x5adb('0x2e')]=_['keys'](db[_0x5adb('0x2a')][_0x5adb('0x45')]);_0x522ee5['query']=_[_0x5adb('0x30')](_0x299746[_0x5adb('0x2f')]);_0x522ee5[_0x5adb('0x39')]=_[_0x5adb('0x31')](_0x522ee5[_0x5adb('0x2e')],_0x522ee5[_0x5adb('0x2f')]);_0xdfecfd[_0x5adb('0x32')]=_['intersection'](_0x522ee5['model'],qs[_0x5adb('0x33')](_0x299746[_0x5adb('0x2f')][_0x5adb('0x33')]));_0xdfecfd[_0x5adb('0x32')]=_0xdfecfd['attributes']['length']?_0xdfecfd[_0x5adb('0x32')]:_0x522ee5[_0x5adb('0x2e')];if(_0x299746[_0x5adb('0x2f')][_0x5adb('0x3e')]){_0xdfecfd[_0x5adb('0x3f')]=[{'all':!![]}];}_0xdfecfd=_['merge']({},_0xdfecfd,_0x299746[_0x5adb('0x3d')]);return db[_0x5adb('0x2a')]['find'](_0xdfecfd)[_0x5adb('0x22')](handleEntityNotFound(_0x121714,null))[_0x5adb('0x22')](respondWithResult(_0x121714,null))[_0x5adb('0x42')](handleError(_0x121714,null));};exports[_0x5adb('0x46')]=function(_0x186bd2,_0x3a5409){return db[_0x5adb('0x2a')][_0x5adb('0x46')](_0x186bd2['body'],{})[_0x5adb('0x22')](respondWithResult(_0x3a5409,0xc9))['catch'](handleError(_0x3a5409,null));};exports['update']=function(_0x5015ee,_0x3cd211){if(_0x5015ee[_0x5adb('0x47')]['id']){delete _0x5015ee[_0x5adb('0x47')]['id'];}return db['CloudProvider'][_0x5adb('0x48')]({'where':{'id':_0x5015ee['params']['id']}})[_0x5adb('0x22')](handleEntityNotFound(_0x3cd211,null))[_0x5adb('0x22')](saveUpdates(_0x5015ee[_0x5adb('0x47')],null))['then'](respondWithResult(_0x3cd211,null))[_0x5adb('0x42')](handleError(_0x3cd211,null));};exports['destroy']=function(_0x22fa54,_0x6dc067){return db['CloudProvider'][_0x5adb('0x48')]({'where':{'id':_0x22fa54[_0x5adb('0x44')]['id']}})[_0x5adb('0x22')](handleEntityNotFound(_0x6dc067,null))[_0x5adb('0x22')](removeEntity(_0x6dc067,null))[_0x5adb('0x42')](handleError(_0x6dc067,null));};
\ No newline at end of file
diff --git a/server/api/cloudProvider/cloudProvider.model.js b/server/api/cloudProvider/cloudProvider.model.js
index a354523..82bef70 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 _0x331c=['util','../../config/logger','api','moment','request-promise','rimraf','../../config/environment','./cloudProvider.attributes','exports','CloudProvider','lodash'];(function(_0x2ba52e,_0x30f462){var _0x5165c0=function(_0x26db06){while(--_0x26db06){_0x2ba52e['push'](_0x2ba52e['shift']());}};_0x5165c0(++_0x30f462);}(_0x331c,0xc5));var _0xc331=function(_0x3054be,_0x1bdc8b){_0x3054be=_0x3054be-0x0;var _0x3df150=_0x331c[_0x3054be];return _0x3df150;};'use strict';var _=require(_0xc331('0x0'));var util=require(_0xc331('0x1'));var logger=require(_0xc331('0x2'))(_0xc331('0x3'));var moment=require(_0xc331('0x4'));var BPromise=require('bluebird');var rp=require(_0xc331('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0xc331('0x6'));var config=require(_0xc331('0x7'));var attributes=require(_0xc331('0x8'));module[_0xc331('0x9')]=function(_0x1133d1,_0x39ce2d){return _0x1133d1['define'](_0xc331('0xa'),attributes,{'tableName':'cloud_providers','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x2494=['./cloudProvider.attributes','exports','define','CloudProvider','cloud_providers','lodash','util','../../config/logger','bluebird','request-promise','path','rimraf'];(function(_0x202962,_0x4baf03){var _0x4896a0=function(_0x10c05b){while(--_0x10c05b){_0x202962['push'](_0x202962['shift']());}};_0x4896a0(++_0x4baf03);}(_0x2494,0xf5));var _0x4249=function(_0x3cf5ec,_0x250439){_0x3cf5ec=_0x3cf5ec-0x0;var _0x986eec=_0x2494[_0x3cf5ec];return _0x986eec;};'use strict';var _=require(_0x4249('0x0'));var util=require(_0x4249('0x1'));var logger=require(_0x4249('0x2'))('api');var moment=require('moment');var BPromise=require(_0x4249('0x3'));var rp=require(_0x4249('0x4'));var fs=require('fs');var path=require(_0x4249('0x5'));var rimraf=require(_0x4249('0x6'));var config=require('../../config/environment');var attributes=require(_0x4249('0x7'));module[_0x4249('0x8')]=function(_0x473708,_0x2ceed7){return _0x473708[_0x4249('0x9')](_0x4249('0xa'),attributes,{'tableName':_0x4249('0xb'),'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 c5829f0..01f376b 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 _0x1219=['http','then','info','CloudProvider,\x20%s,\x20%s','debug','CloudProvider,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','catch','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client'];(function(_0x306d00,_0x3b0d22){var _0x12020d=function(_0x1f66fa){while(--_0x1f66fa){_0x306d00['push'](_0x306d00['shift']());}};_0x12020d(++_0x3b0d22);}(_0x1219,0x17c));var _0x9121=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x1219[_0x14add3];return _0x4a174f;};'use strict';var _=require(_0x9121('0x0'));var util=require(_0x9121('0x1'));var moment=require(_0x9121('0x2'));var BPromise=require(_0x9121('0x3'));var rs=require(_0x9121('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x9121('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x9121('0x6'))(_0x9121('0x7'));var config=require(_0x9121('0x8'));var jayson=require(_0x9121('0x9'));var client=jayson[_0x9121('0xa')][_0x9121('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x437bac,_0x1387b7,_0x262520){return new BPromise(function(_0x409a74,_0x2c55eb){return client['request'](_0x437bac,_0x262520)[_0x9121('0xc')](function(_0x2bf1d6){logger[_0x9121('0xd')](_0x9121('0xe'),_0x1387b7,'request\x20sent');logger[_0x9121('0xf')](_0x9121('0x10'),_0x1387b7,_0x9121('0x11'),JSON[_0x9121('0x12')](_0x2bf1d6));if(_0x2bf1d6[_0x9121('0x13')]){if(_0x2bf1d6[_0x9121('0x13')][_0x9121('0x14')]===0x1f4){logger[_0x9121('0x13')](_0x9121('0xe'),_0x1387b7,_0x2bf1d6[_0x9121('0x13')][_0x9121('0x15')]);return _0x2c55eb(_0x2bf1d6[_0x9121('0x13')][_0x9121('0x15')]);}logger[_0x9121('0x13')](_0x9121('0xe'),_0x1387b7,_0x2bf1d6['error'][_0x9121('0x15')]);return _0x409a74(_0x2bf1d6[_0x9121('0x13')][_0x9121('0x15')]);}else{logger[_0x9121('0xd')](_0x9121('0xe'),_0x1387b7,_0x9121('0x11'));_0x409a74(_0x2bf1d6['result']['message']);}})[_0x9121('0x16')](function(_0x200a28){logger[_0x9121('0x13')](_0x9121('0xe'),_0x1387b7,_0x200a28);_0x2c55eb(_0x200a28);});});}
\ No newline at end of file
+var _0xc177=['../../config/utils','../../config/logger','rpc','jayson/promise','client','http','request','then','info','CloudProvider,\x20%s,\x20%s','request\x20sent','stringify','error','message','result','catch','lodash','util','moment','bluebird','randomstring','../../mysqldb'];(function(_0x280ddd,_0xdd88f3){var _0x1ae8bd=function(_0xfe3652){while(--_0xfe3652){_0x280ddd['push'](_0x280ddd['shift']());}};_0x1ae8bd(++_0xdd88f3);}(_0xc177,0x1b2));var _0x7c17=function(_0x53cb6d,_0x1826c3){_0x53cb6d=_0x53cb6d-0x0;var _0x245e70=_0xc177[_0x53cb6d];return _0x245e70;};'use strict';var _=require(_0x7c17('0x0'));var util=require(_0x7c17('0x1'));var moment=require(_0x7c17('0x2'));var BPromise=require(_0x7c17('0x3'));var rs=require(_0x7c17('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x7c17('0x5'))['db'];var utils=require(_0x7c17('0x6'));var logger=require(_0x7c17('0x7'))(_0x7c17('0x8'));var config=require('../../config/environment');var jayson=require(_0x7c17('0x9'));var client=jayson[_0x7c17('0xa')][_0x7c17('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x4810b7,_0x3ab87c,_0x3aa79e){return new BPromise(function(_0x33dd1e,_0x3854dd){return client[_0x7c17('0xc')](_0x4810b7,_0x3aa79e)[_0x7c17('0xd')](function(_0x44e782){logger[_0x7c17('0xe')](_0x7c17('0xf'),_0x3ab87c,_0x7c17('0x10'));logger['debug']('CloudProvider,\x20%s,\x20%s,\x20%s',_0x3ab87c,'request\x20sent',JSON[_0x7c17('0x11')](_0x44e782));if(_0x44e782[_0x7c17('0x12')]){if(_0x44e782[_0x7c17('0x12')]['code']===0x1f4){logger[_0x7c17('0x12')](_0x7c17('0xf'),_0x3ab87c,_0x44e782[_0x7c17('0x12')]['message']);return _0x3854dd(_0x44e782['error'][_0x7c17('0x13')]);}logger[_0x7c17('0x12')]('CloudProvider,\x20%s,\x20%s',_0x3ab87c,_0x44e782[_0x7c17('0x12')]['message']);return _0x33dd1e(_0x44e782[_0x7c17('0x12')]['message']);}else{logger[_0x7c17('0xe')](_0x7c17('0xf'),_0x3ab87c,_0x7c17('0x10'));_0x33dd1e(_0x44e782[_0x7c17('0x14')][_0x7c17('0x13')]);}})[_0x7c17('0x15')](function(_0x87715a){logger[_0x7c17('0x12')](_0x7c17('0xf'),_0x3ab87c,_0x87715a);_0x3854dd(_0x87715a);});});}
\ No newline at end of file
diff --git a/server/api/cloudProvider/index.js b/server/api/cloudProvider/index.js
index f62f538..22ccb20 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 _0x25d3=['delete','exports','multer','util','path','connect-timeout','Router','fs-extra','../../components/interaction/service','../../config/environment','isAuthenticated','index','get','/:id','show','post','create','put','update'];(function(_0x32fdea,_0x2cc54e){var _0x39e620=function(_0x1e6a5e){while(--_0x1e6a5e){_0x32fdea['push'](_0x32fdea['shift']());}};_0x39e620(++_0x2cc54e);}(_0x25d3,0x1b7));var _0x325d=function(_0x3d16bc,_0x475667){_0x3d16bc=_0x3d16bc-0x0;var _0x5e03ea=_0x25d3[_0x3d16bc];return _0x5e03ea;};'use strict';var multer=require(_0x325d('0x0'));var util=require(_0x325d('0x1'));var path=require(_0x325d('0x2'));var timeout=require(_0x325d('0x3'));var express=require('express');var router=express[_0x325d('0x4')]();var fs_extra=require(_0x325d('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0x325d('0x6'));var config=require(_0x325d('0x7'));var controller=require('./cloudProvider.controller');router['get']('/',auth[_0x325d('0x8')](),controller[_0x325d('0x9')]);router[_0x325d('0xa')](_0x325d('0xb'),auth[_0x325d('0x8')](),controller[_0x325d('0xc')]);router[_0x325d('0xd')]('/',auth[_0x325d('0x8')](),controller[_0x325d('0xe')]);router[_0x325d('0xf')](_0x325d('0xb'),auth['isAuthenticated'](),controller[_0x325d('0x10')]);router[_0x325d('0x11')](_0x325d('0xb'),auth[_0x325d('0x8')](),controller['destroy']);module[_0x325d('0x12')]=router;
\ No newline at end of file
+var _0x97dd=['get','index','/:id','show','post','isAuthenticated','put','update','delete','destroy','exports','multer','util','connect-timeout','express','Router','fs-extra','../../components/interaction/service','./cloudProvider.controller'];(function(_0x58ee54,_0x4e92ec){var _0x4d89d0=function(_0x4ab5c1){while(--_0x4ab5c1){_0x58ee54['push'](_0x58ee54['shift']());}};_0x4d89d0(++_0x4e92ec);}(_0x97dd,0xef));var _0xd97d=function(_0x2c98af,_0x3f5a43){_0x2c98af=_0x2c98af-0x0;var _0x372dba=_0x97dd[_0x2c98af];return _0x372dba;};'use strict';var multer=require(_0xd97d('0x0'));var util=require(_0xd97d('0x1'));var path=require('path');var timeout=require(_0xd97d('0x2'));var express=require(_0xd97d('0x3'));var router=express[_0xd97d('0x4')]();var fs_extra=require(_0xd97d('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0xd97d('0x6'));var config=require('../../config/environment');var controller=require(_0xd97d('0x7'));router[_0xd97d('0x8')]('/',auth['isAuthenticated'](),controller[_0xd97d('0x9')]);router[_0xd97d('0x8')](_0xd97d('0xa'),auth['isAuthenticated'](),controller[_0xd97d('0xb')]);router[_0xd97d('0xc')]('/',auth[_0xd97d('0xd')](),controller['create']);router[_0xd97d('0xe')](_0xd97d('0xa'),auth[_0xd97d('0xd')](),controller[_0xd97d('0xf')]);router[_0xd97d('0x10')]('/:id',auth[_0xd97d('0xd')](),controller[_0xd97d('0x11')]);module[_0xd97d('0x12')]=router;
\ No newline at end of file
diff --git a/server/api/cmCompany/cmCompany.attributes.js b/server/api/cmCompany/cmCompany.attributes.js
index d185e85..a8d1e96 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 _0x0a21=['exports','name','STRING'];(function(_0x30ae5e,_0x391fc4){var _0x1f2e93=function(_0x60307d){while(--_0x60307d){_0x30ae5e['push'](_0x30ae5e['shift']());}};_0x1f2e93(++_0x391fc4);}(_0x0a21,0x9f));var _0x10a2=function(_0x56fc55,_0x1cd50e){_0x56fc55=_0x56fc55-0x0;var _0x2de620=_0x0a21[_0x56fc55];return _0x2de620;};'use strict';var Sequelize=require('sequelize');module[_0x10a2('0x0')]={'name':{'type':Sequelize['STRING'],'unique':_0x10a2('0x1'),'allowNull':![],'validate':{'notEmpty':!![]}},'vat':{'type':Sequelize[_0x10a2('0x2')]},'companyId':{'type':Sequelize['STRING']},'website':{'type':Sequelize[_0x10a2('0x2')]},'phone':{'type':Sequelize[_0x10a2('0x2')]},'fax':{'type':Sequelize[_0x10a2('0x2')]},'type':{'type':Sequelize[_0x10a2('0x2')]},'street':{'type':Sequelize[_0x10a2('0x2')]},'postalCode':{'type':Sequelize['STRING']},'city':{'type':Sequelize[_0x10a2('0x2')]},'country':{'type':Sequelize['STRING']},'email':{'type':Sequelize[_0x10a2('0x2')],'validate':{'isEmail':!![]}},'emailDomain':{'type':Sequelize['STRING']},'sStreet':{'type':Sequelize[_0x10a2('0x2')]},'sPostalCode':{'type':Sequelize[_0x10a2('0x2')]},'sCity':{'type':Sequelize[_0x10a2('0x2')]},'sCountry':{'type':Sequelize[_0x10a2('0x2')]},'description':{'type':Sequelize['STRING']}};
\ No newline at end of file
+var _0xc7b1=['STRING','sequelize','name'];(function(_0x1f4b18,_0x4e777c){var _0xde3957=function(_0x1dcbbc){while(--_0x1dcbbc){_0x1f4b18['push'](_0x1f4b18['shift']());}};_0xde3957(++_0x4e777c);}(_0xc7b1,0xe5));var _0x1c7b=function(_0x2300f2,_0x315c5f){_0x2300f2=_0x2300f2-0x0;var _0x6bd508=_0xc7b1[_0x2300f2];return _0x6bd508;};'use strict';var Sequelize=require(_0x1c7b('0x0'));module['exports']={'name':{'type':Sequelize['STRING'],'unique':_0x1c7b('0x1'),'allowNull':![],'validate':{'notEmpty':!![]}},'vat':{'type':Sequelize[_0x1c7b('0x2')]},'companyId':{'type':Sequelize[_0x1c7b('0x2')]},'website':{'type':Sequelize[_0x1c7b('0x2')]},'phone':{'type':Sequelize['STRING']},'fax':{'type':Sequelize[_0x1c7b('0x2')]},'type':{'type':Sequelize[_0x1c7b('0x2')]},'street':{'type':Sequelize[_0x1c7b('0x2')]},'postalCode':{'type':Sequelize[_0x1c7b('0x2')]},'city':{'type':Sequelize[_0x1c7b('0x2')]},'country':{'type':Sequelize['STRING']},'email':{'type':Sequelize['STRING'],'validate':{'isEmail':!![]}},'emailDomain':{'type':Sequelize[_0x1c7b('0x2')]},'sStreet':{'type':Sequelize[_0x1c7b('0x2')]},'sPostalCode':{'type':Sequelize[_0x1c7b('0x2')]},'sCity':{'type':Sequelize[_0x1c7b('0x2')]},'sCountry':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0x1c7b('0x2')]}};
\ No newline at end of file
diff --git a/server/api/cmCompany/cmCompany.controller.js b/server/api/cmCompany/cmCompany.controller.js
index b97b6d5..6ca7c1e 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 _0x20ba=['ejs','fs-extra','lodash','squel','jsforce','papaparse','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','then','destroy','sendStatus','stack','name','describe','model','keys','query','filters','attributes','intersection','fields','length','hasOwnProperty','order','sort','pick','filter','where','merge','options','CmCompany','include','findAll','catch','params','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','get','Companies','find','autoAssociation','UserProfileResource','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','addContacts','CmContact','ids','getContacts','findOne','rawAttributes','map','nolimit','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv'];(function(_0x57a483,_0x92e96c){var _0x35f7ac=function(_0x3a7d39){while(--_0x3a7d39){_0x57a483['push'](_0x57a483['shift']());}};_0x35f7ac(++_0x92e96c);}(_0x20ba,0x1e6));var _0xa20b=function(_0x440917,_0x20ea7b){_0x440917=_0x440917-0x0;var _0x5e906b=_0x20ba[_0x440917];return _0x5e906b;};'use strict';var emlformat=require(_0xa20b('0x0'));var rimraf=require(_0xa20b('0x1'));var zipdir=require(_0xa20b('0x2'));var jsonpatch=require(_0xa20b('0x3'));var rp=require(_0xa20b('0x4'));var moment=require(_0xa20b('0x5'));var BPromise=require(_0xa20b('0x6'));var Mustache=require(_0xa20b('0x7'));var util=require(_0xa20b('0x8'));var path=require(_0xa20b('0x9'));var sox=require(_0xa20b('0xa'));var csv=require(_0xa20b('0xb'));var ejs=require(_0xa20b('0xc'));var fs=require('fs');var fs_extra=require(_0xa20b('0xd'));var _=require(_0xa20b('0xe'));var squel=require(_0xa20b('0xf'));var crypto=require('crypto');var jsforce=require(_0xa20b('0x10'));var deskjs=require('desk.js');var toCsv=require(_0xa20b('0xb'));var querystring=require('querystring');var Papa=require(_0xa20b('0x11'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0xa20b('0x12'))(_0xa20b('0x13'));var utils=require(_0xa20b('0x14'));var config=require('../../config/environment');var licenseUtil=require(_0xa20b('0x15'));var db=require(_0xa20b('0x16'))['db'];function respondWithStatusCode(_0x5e200a,_0x4d9ef1){_0x4d9ef1=_0x4d9ef1||0xcc;return function(_0x338a70){if(_0x338a70){return _0x5e200a['sendStatus'](_0x4d9ef1);}return _0x5e200a[_0xa20b('0x17')](_0x4d9ef1)[_0xa20b('0x18')]();};}function respondWithResult(_0x1b445f,_0x230c62){_0x230c62=_0x230c62||0xc8;return function(_0x11ea21){if(_0x11ea21){return _0x1b445f[_0xa20b('0x17')](_0x230c62)[_0xa20b('0x19')](_0x11ea21);}};}function respondWithFilteredResult(_0x35c24c,_0x53860a){return function(_0x49e06c){if(_0x49e06c){var _0x5563e0=typeof _0x53860a[_0xa20b('0x1a')]===_0xa20b('0x1b')&&typeof _0x53860a[_0xa20b('0x1c')]===_0xa20b('0x1b');var _0x1f02e2=_0x49e06c[_0xa20b('0x1d')];var _0x32920c=_0x5563e0?0x0:_0x53860a[_0xa20b('0x1a')];var _0x2eafb6=_0x5563e0?_0x49e06c[_0xa20b('0x1d')]:_0x53860a[_0xa20b('0x1a')]+_0x53860a[_0xa20b('0x1c')];var _0x54caab;if(_0x2eafb6>=_0x1f02e2){_0x2eafb6=_0x1f02e2;_0x54caab=0xc8;}else{_0x54caab=0xce;}_0x35c24c[_0xa20b('0x17')](_0x54caab);return _0x35c24c[_0xa20b('0x1e')](_0xa20b('0x1f'),_0x32920c+'-'+_0x2eafb6+'/'+_0x1f02e2)[_0xa20b('0x19')](_0x49e06c);}return null;};}function patchUpdates(_0x1bc992){return function(_0x5bccf9){try{jsonpatch[_0xa20b('0x20')](_0x5bccf9,_0x1bc992,!![]);}catch(_0x17fbdd){return BPromise[_0xa20b('0x21')](_0x17fbdd);}return _0x5bccf9[_0xa20b('0x22')]();};}function saveUpdates(_0x46f77d,_0x3503a5){return function(_0x3641a3){if(_0x3641a3){return _0x3641a3[_0xa20b('0x23')](_0x46f77d)[_0xa20b('0x24')](function(_0x441fe6){return _0x441fe6;});}return null;};}function removeEntity(_0x312e45,_0x5ada15){return function(_0x474bec){if(_0x474bec){return _0x474bec[_0xa20b('0x25')]()[_0xa20b('0x24')](function(){var _0x459f23=_0x474bec['get']({'plain':!![]});var _0x2a24fc='Companies';return db['UserProfileResource'][_0xa20b('0x25')]({'where':{'type':_0x2a24fc,'resourceId':_0x459f23['id']}})[_0xa20b('0x24')](function(){return _0x474bec;});})[_0xa20b('0x24')](function(){_0x312e45[_0xa20b('0x17')](0xcc)['end']();});}};}function handleEntityNotFound(_0x35bc2b,_0xd5af6c){return function(_0x4b7497){if(!_0x4b7497){_0x35bc2b[_0xa20b('0x26')](0x194);}return _0x4b7497;};}function handleError(_0x657e5c,_0x27e752){_0x27e752=_0x27e752||0x1f4;return function(_0x2e3bff){logger['error'](_0x2e3bff[_0xa20b('0x27')]);if(_0x2e3bff[_0xa20b('0x28')]){delete _0x2e3bff[_0xa20b('0x28')];}_0x657e5c['status'](_0x27e752)['send'](_0x2e3bff);};}exports['index']=function(_0x178993,_0x3bb3a6){var _0x4a8f48={},_0x499865={},_0xc910f1={'count':0x0,'rows':[]};return db['CmCompany'][_0xa20b('0x29')]()[_0xa20b('0x24')](function(_0x5552f0){_0x499865[_0xa20b('0x2a')]=_[_0xa20b('0x2b')](_0x5552f0);_0x499865[_0xa20b('0x2c')]=_[_0xa20b('0x2b')](_0x178993[_0xa20b('0x2c')]);_0x499865[_0xa20b('0x2d')]=_['intersection'](_0x499865[_0xa20b('0x2a')],_0x499865[_0xa20b('0x2c')]);_0x4a8f48[_0xa20b('0x2e')]=_[_0xa20b('0x2f')](_0x499865[_0xa20b('0x2a')],qs['fields'](_0x178993[_0xa20b('0x2c')][_0xa20b('0x30')]));_0x4a8f48[_0xa20b('0x2e')]=_0x4a8f48[_0xa20b('0x2e')][_0xa20b('0x31')]?_0x4a8f48[_0xa20b('0x2e')]:_0x499865[_0xa20b('0x2a')];if(!_0x178993[_0xa20b('0x2c')][_0xa20b('0x32')]('nolimit')){_0x4a8f48['limit']=qs[_0xa20b('0x1c')](_0x178993[_0xa20b('0x2c')]['limit']);_0x4a8f48[_0xa20b('0x1a')]=qs[_0xa20b('0x1a')](_0x178993['query'][_0xa20b('0x1a')]);}_0x4a8f48[_0xa20b('0x33')]=qs[_0xa20b('0x34')](_0x178993[_0xa20b('0x2c')][_0xa20b('0x34')]);_0x4a8f48['where']=qs[_0xa20b('0x2d')](_[_0xa20b('0x35')](_0x178993[_0xa20b('0x2c')],_0x499865['filters']),_0x5552f0);if(_0x178993['query'][_0xa20b('0x36')]){_0x4a8f48[_0xa20b('0x37')]=_[_0xa20b('0x38')](_0x4a8f48[_0xa20b('0x37')],{'$or':_['map'](_0x4a8f48['attributes'],function(_0x519c33){var _0x179225={};_0x179225[_0x519c33]={'$like':'%'+_0x178993['query']['filter']+'%'};return _0x179225;})});}_0x4a8f48=_[_0xa20b('0x38')]({},_0x4a8f48,_0x178993[_0xa20b('0x39')]);var _0x524e46={'where':_0x4a8f48[_0xa20b('0x37')]};return db[_0xa20b('0x3a')][_0xa20b('0x1d')](_0x524e46)[_0xa20b('0x24')](function(_0xa9b8f3){_0xc910f1[_0xa20b('0x1d')]=_0xa9b8f3;if(_0x178993[_0xa20b('0x2c')]['includeAll']){_0x4a8f48[_0xa20b('0x3b')]=[{'all':!![]}];}return db[_0xa20b('0x3a')][_0xa20b('0x3c')](_0x4a8f48);})[_0xa20b('0x24')](function(_0x1b21aa){_0xc910f1['rows']=_0x1b21aa;return _0xc910f1;})[_0xa20b('0x24')](respondWithFilteredResult(_0x3bb3a6,_0x4a8f48))[_0xa20b('0x3d')](handleError(_0x3bb3a6,null));})[_0xa20b('0x3d')](handleError(_0x3bb3a6,null));};exports['show']=function(_0x2b11d7,_0x3efb5f){var _0x3b4ea5={'raw':![],'where':{'id':_0x2b11d7[_0xa20b('0x3e')]['id']}},_0x4e402b={};_0x4e402b[_0xa20b('0x2a')]=_[_0xa20b('0x2b')](db[_0xa20b('0x3a')]['rawAttributes']);_0x4e402b[_0xa20b('0x2c')]=_['keys'](_0x2b11d7[_0xa20b('0x2c')]);_0x4e402b['filters']=_['intersection'](_0x4e402b[_0xa20b('0x2a')],_0x4e402b[_0xa20b('0x2c')]);_0x3b4ea5[_0xa20b('0x2e')]=_['intersection'](_0x4e402b[_0xa20b('0x2a')],qs[_0xa20b('0x30')](_0x2b11d7[_0xa20b('0x2c')][_0xa20b('0x30')]));_0x3b4ea5['attributes']=_0x3b4ea5['attributes'][_0xa20b('0x31')]?_0x3b4ea5[_0xa20b('0x2e')]:_0x4e402b[_0xa20b('0x2a')];if(_0x2b11d7[_0xa20b('0x2c')]['includeAll']){_0x3b4ea5['include']=[{'all':!![]}];}_0x3b4ea5=_[_0xa20b('0x38')]({},_0x3b4ea5,_0x2b11d7['options']);return db[_0xa20b('0x3a')]['find'](_0x3b4ea5)['then'](handleEntityNotFound(_0x3efb5f,null))[_0xa20b('0x24')](respondWithResult(_0x3efb5f,null))[_0xa20b('0x3d')](handleError(_0x3efb5f,null));};exports[_0xa20b('0x3f')]=function(_0x37ac35,_0x253c62){return db['CmCompany'][_0xa20b('0x3f')](_0x37ac35[_0xa20b('0x40')],{})[_0xa20b('0x24')](function(_0x318956){var _0x30d98d=_0x37ac35[_0xa20b('0x41')]['get']({'plain':!![]});if(!_0x30d98d)throw new Error(_0xa20b('0x42'));if(_0x30d98d[_0xa20b('0x43')]===_0xa20b('0x41')){var _0x6826b5=_0x318956[_0xa20b('0x44')]({'plain':!![]});var _0x516cc9=_0xa20b('0x45');return db['UserProfileSection'][_0xa20b('0x46')]({'where':{'name':_0x516cc9,'userProfileId':_0x30d98d['userProfileId']},'raw':!![]})[_0xa20b('0x24')](function(_0x2365e4){if(_0x2365e4&&_0x2365e4[_0xa20b('0x47')]===0x0){return db[_0xa20b('0x48')][_0xa20b('0x3f')]({'name':_0x6826b5['name'],'resourceId':_0x6826b5['id'],'type':_0x2365e4[_0xa20b('0x28')],'sectionId':_0x2365e4['id']},{})[_0xa20b('0x24')](function(){return _0x318956;});}else{return _0x318956;}})['catch'](function(_0x2cb49a){logger[_0xa20b('0x49')](_0xa20b('0x4a'),_0x2cb49a);throw _0x2cb49a;});}return _0x318956;})['then'](respondWithResult(_0x253c62,0xc9))['catch'](handleError(_0x253c62,null));};exports['update']=function(_0x2f16cf,_0x5961eb){if(_0x2f16cf[_0xa20b('0x40')]['id']){delete _0x2f16cf['body']['id'];}return db[_0xa20b('0x3a')][_0xa20b('0x46')]({'where':{'id':_0x2f16cf[_0xa20b('0x3e')]['id']}})[_0xa20b('0x24')](handleEntityNotFound(_0x5961eb,null))[_0xa20b('0x24')](saveUpdates(_0x2f16cf['body'],null))[_0xa20b('0x24')](respondWithResult(_0x5961eb,null))['catch'](handleError(_0x5961eb,null));};exports[_0xa20b('0x25')]=function(_0x56f0ed,_0x477d60){return db[_0xa20b('0x3a')][_0xa20b('0x46')]({'where':{'id':_0x56f0ed[_0xa20b('0x3e')]['id']}})['then'](handleEntityNotFound(_0x477d60,null))[_0xa20b('0x24')](removeEntity(_0x477d60,null))['catch'](handleError(_0x477d60,null));};exports[_0xa20b('0x29')]=function(_0x1ae9f8,_0x1c065c){return db[_0xa20b('0x3a')][_0xa20b('0x29')]()[_0xa20b('0x24')](respondWithResult(_0x1c065c,null))[_0xa20b('0x3d')](handleError(_0x1c065c,null));};exports[_0xa20b('0x4b')]=function(_0x62c92d,_0xc91c8b,_0x355bc6){return db[_0xa20b('0x4c')][_0xa20b('0x46')]({'where':{'id':_0x62c92d[_0xa20b('0x3e')]['id']}})['then'](handleEntityNotFound(_0xc91c8b,null))[_0xa20b('0x24')](function(_0x41f6bc){if(_0x41f6bc){return _0x41f6bc[_0xa20b('0x4b')](_0x62c92d[_0xa20b('0x40')][_0xa20b('0x4d')],_['omit'](_0x62c92d[_0xa20b('0x40')],[_0xa20b('0x4d'),'id'])||{});}})[_0xa20b('0x24')](respondWithResult(_0xc91c8b,null))[_0xa20b('0x3d')](handleError(_0xc91c8b,null));};exports[_0xa20b('0x4e')]=function(_0x46a908,_0xa5340f,_0x31db5e){var _0x4915e5={};var _0x278903={};var _0x22d8e7;var _0x216f27;return db[_0xa20b('0x3a')][_0xa20b('0x4f')]({'where':{'id':_0x46a908[_0xa20b('0x3e')]['id']}})[_0xa20b('0x24')](handleEntityNotFound(_0xa5340f,null))[_0xa20b('0x24')](function(_0x476954){if(_0x476954){_0x22d8e7=_0x476954;_0x278903[_0xa20b('0x2a')]=_[_0xa20b('0x2b')](db[_0xa20b('0x4c')][_0xa20b('0x50')]);_0x278903[_0xa20b('0x2c')]=_[_0xa20b('0x2b')](_0x46a908[_0xa20b('0x2c')]);_0x278903['filters']=_['intersection'](_0x278903['model'],_0x278903[_0xa20b('0x2c')]);_0x4915e5[_0xa20b('0x2e')]=_[_0xa20b('0x2f')](_0x278903[_0xa20b('0x2a')],qs['fields'](_0x46a908[_0xa20b('0x2c')][_0xa20b('0x30')]));_0x4915e5[_0xa20b('0x2e')]=_0x4915e5['attributes']['length']?_0x4915e5[_0xa20b('0x2e')]:_0x278903[_0xa20b('0x2a')];_0x4915e5[_0xa20b('0x33')]=qs[_0xa20b('0x34')](_0x46a908[_0xa20b('0x2c')][_0xa20b('0x34')]);_0x4915e5['where']=qs[_0xa20b('0x2d')](_[_0xa20b('0x35')](_0x46a908[_0xa20b('0x2c')],_0x278903[_0xa20b('0x2d')]));if(_0x46a908[_0xa20b('0x2c')][_0xa20b('0x36')]){_0x4915e5['where']=_[_0xa20b('0x38')](_0x4915e5[_0xa20b('0x37')],{'$or':_[_0xa20b('0x51')](_0x4915e5[_0xa20b('0x2e')],function(_0x595689){var _0x3a5a50={};_0x3a5a50[_0x595689]={'$like':'%'+_0x46a908[_0xa20b('0x2c')]['filter']+'%'};return _0x3a5a50;})});}_0x4915e5=_['merge']({},_0x4915e5,_0x46a908[_0xa20b('0x39')]);return _0x22d8e7['getContacts'](_0x4915e5);}})['then'](function(_0x5b21e4){if(_0x5b21e4){_0x216f27=_0x5b21e4[_0xa20b('0x31')];if(!_0x46a908[_0xa20b('0x2c')]['hasOwnProperty'](_0xa20b('0x52'))){_0x4915e5[_0xa20b('0x1c')]=qs[_0xa20b('0x1c')](_0x46a908[_0xa20b('0x2c')][_0xa20b('0x1c')]);_0x4915e5[_0xa20b('0x1a')]=qs['offset'](_0x46a908['query'][_0xa20b('0x1a')]);}return _0x22d8e7[_0xa20b('0x4e')](_0x4915e5);}})[_0xa20b('0x24')](function(_0x3c5e04){if(_0x3c5e04){return _0x3c5e04?{'count':_0x216f27,'rows':_0x3c5e04}:null;}})[_0xa20b('0x24')](respondWithResult(_0xa5340f,null))['catch'](handleError(_0xa5340f,null));};
\ No newline at end of file
+var _0xe2de=['update','then','destroy','get','UserProfileResource','end','error','stack','name','index','CmCompany','describe','model','keys','query','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','sort','filters','pick','filter','where','map','merge','options','rows','catch','show','includeAll','include','find','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','params','addContacts','CmContact','omit','getContacts','findOne','rawAttributes','eml-format','rimraf','zip-dir','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/environment','sendStatus','status','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save'];(function(_0x3acee8,_0x5f3924){var _0x5046cc=function(_0x338def){while(--_0x338def){_0x3acee8['push'](_0x3acee8['shift']());}};_0x5046cc(++_0x5f3924);}(_0xe2de,0x132));var _0xee2d=function(_0x5cc1ed,_0x6a43c1){_0x5cc1ed=_0x5cc1ed-0x0;var _0x3c6695=_0xe2de[_0x5cc1ed];return _0x3c6695;};'use strict';var emlformat=require(_0xee2d('0x0'));var rimraf=require(_0xee2d('0x1'));var zipdir=require(_0xee2d('0x2'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0xee2d('0x3'));var Mustache=require(_0xee2d('0x4'));var util=require(_0xee2d('0x5'));var path=require(_0xee2d('0x6'));var sox=require(_0xee2d('0x7'));var csv=require(_0xee2d('0x8'));var ejs=require(_0xee2d('0x9'));var fs=require('fs');var fs_extra=require(_0xee2d('0xa'));var _=require(_0xee2d('0xb'));var squel=require(_0xee2d('0xc'));var crypto=require(_0xee2d('0xd'));var jsforce=require(_0xee2d('0xe'));var deskjs=require('desk.js');var toCsv=require(_0xee2d('0x8'));var querystring=require('querystring');var Papa=require(_0xee2d('0xf'));var Redis=require('ioredis');var authService=require(_0xee2d('0x10'));var qs=require(_0xee2d('0x11'));var as=require(_0xee2d('0x12'));var hardwareService=require(_0xee2d('0x13'));var logger=require(_0xee2d('0x14'))('api');var utils=require('../../config/utils');var config=require(_0xee2d('0x15'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x839df4,_0x2d53f9){_0x2d53f9=_0x2d53f9||0xcc;return function(_0x5e2a30){if(_0x5e2a30){return _0x839df4[_0xee2d('0x16')](_0x2d53f9);}return _0x839df4[_0xee2d('0x17')](_0x2d53f9)['end']();};}function respondWithResult(_0x231a3b,_0x340f35){_0x340f35=_0x340f35||0xc8;return function(_0x72f5e2){if(_0x72f5e2){return _0x231a3b[_0xee2d('0x17')](_0x340f35)[_0xee2d('0x18')](_0x72f5e2);}};}function respondWithFilteredResult(_0x3d8371,_0x46fb8f){return function(_0x4a237e){if(_0x4a237e){var _0x226f81=typeof _0x46fb8f[_0xee2d('0x19')]===_0xee2d('0x1a')&&typeof _0x46fb8f[_0xee2d('0x1b')]==='undefined';var _0x4519ec=_0x4a237e['count'];var _0x2b94ad=_0x226f81?0x0:_0x46fb8f[_0xee2d('0x19')];var _0x1e9bba=_0x226f81?_0x4a237e[_0xee2d('0x1c')]:_0x46fb8f[_0xee2d('0x19')]+_0x46fb8f[_0xee2d('0x1b')];var _0x2bfbf7;if(_0x1e9bba>=_0x4519ec){_0x1e9bba=_0x4519ec;_0x2bfbf7=0xc8;}else{_0x2bfbf7=0xce;}_0x3d8371[_0xee2d('0x17')](_0x2bfbf7);return _0x3d8371[_0xee2d('0x1d')](_0xee2d('0x1e'),_0x2b94ad+'-'+_0x1e9bba+'/'+_0x4519ec)[_0xee2d('0x18')](_0x4a237e);}return null;};}function patchUpdates(_0x5493f5){return function(_0x2a93c6){try{jsonpatch[_0xee2d('0x1f')](_0x2a93c6,_0x5493f5,!![]);}catch(_0x5beaed){return BPromise[_0xee2d('0x20')](_0x5beaed);}return _0x2a93c6[_0xee2d('0x21')]();};}function saveUpdates(_0x51ed04,_0x3bf523){return function(_0x20c8be){if(_0x20c8be){return _0x20c8be[_0xee2d('0x22')](_0x51ed04)[_0xee2d('0x23')](function(_0x36df42){return _0x36df42;});}return null;};}function removeEntity(_0x28ef76,_0x17712c){return function(_0x2eda40){if(_0x2eda40){return _0x2eda40[_0xee2d('0x24')]()[_0xee2d('0x23')](function(){var _0x334e20=_0x2eda40[_0xee2d('0x25')]({'plain':!![]});var _0x1a66da='Companies';return db[_0xee2d('0x26')][_0xee2d('0x24')]({'where':{'type':_0x1a66da,'resourceId':_0x334e20['id']}})[_0xee2d('0x23')](function(){return _0x2eda40;});})[_0xee2d('0x23')](function(){_0x28ef76[_0xee2d('0x17')](0xcc)[_0xee2d('0x27')]();});}};}function handleEntityNotFound(_0xf8787f,_0x1b87fb){return function(_0x2bf33b){if(!_0x2bf33b){_0xf8787f[_0xee2d('0x16')](0x194);}return _0x2bf33b;};}function handleError(_0x27082a,_0x2a6983){_0x2a6983=_0x2a6983||0x1f4;return function(_0x9a9f46){logger[_0xee2d('0x28')](_0x9a9f46[_0xee2d('0x29')]);if(_0x9a9f46[_0xee2d('0x2a')]){delete _0x9a9f46[_0xee2d('0x2a')];}_0x27082a[_0xee2d('0x17')](_0x2a6983)['send'](_0x9a9f46);};}exports[_0xee2d('0x2b')]=function(_0x23d9bd,_0x39cca0){var _0x252a1a={},_0x65dbb8={},_0x374498={'count':0x0,'rows':[]};return db[_0xee2d('0x2c')][_0xee2d('0x2d')]()[_0xee2d('0x23')](function(_0xa7979f){_0x65dbb8[_0xee2d('0x2e')]=_[_0xee2d('0x2f')](_0xa7979f);_0x65dbb8[_0xee2d('0x30')]=_[_0xee2d('0x2f')](_0x23d9bd[_0xee2d('0x30')]);_0x65dbb8['filters']=_['intersection'](_0x65dbb8[_0xee2d('0x2e')],_0x65dbb8[_0xee2d('0x30')]);_0x252a1a[_0xee2d('0x31')]=_[_0xee2d('0x32')](_0x65dbb8[_0xee2d('0x2e')],qs[_0xee2d('0x33')](_0x23d9bd[_0xee2d('0x30')][_0xee2d('0x33')]));_0x252a1a[_0xee2d('0x31')]=_0x252a1a[_0xee2d('0x31')][_0xee2d('0x34')]?_0x252a1a['attributes']:_0x65dbb8[_0xee2d('0x2e')];if(!_0x23d9bd[_0xee2d('0x30')][_0xee2d('0x35')](_0xee2d('0x36'))){_0x252a1a[_0xee2d('0x1b')]=qs[_0xee2d('0x1b')](_0x23d9bd[_0xee2d('0x30')][_0xee2d('0x1b')]);_0x252a1a[_0xee2d('0x19')]=qs[_0xee2d('0x19')](_0x23d9bd[_0xee2d('0x30')][_0xee2d('0x19')]);}_0x252a1a[_0xee2d('0x37')]=qs[_0xee2d('0x38')](_0x23d9bd[_0xee2d('0x30')][_0xee2d('0x38')]);_0x252a1a['where']=qs[_0xee2d('0x39')](_[_0xee2d('0x3a')](_0x23d9bd[_0xee2d('0x30')],_0x65dbb8['filters']),_0xa7979f);if(_0x23d9bd[_0xee2d('0x30')][_0xee2d('0x3b')]){_0x252a1a[_0xee2d('0x3c')]=_['merge'](_0x252a1a[_0xee2d('0x3c')],{'$or':_[_0xee2d('0x3d')](_0x252a1a[_0xee2d('0x31')],function(_0x16022f){var _0x679600={};_0x679600[_0x16022f]={'$like':'%'+_0x23d9bd[_0xee2d('0x30')][_0xee2d('0x3b')]+'%'};return _0x679600;})});}_0x252a1a=_[_0xee2d('0x3e')]({},_0x252a1a,_0x23d9bd[_0xee2d('0x3f')]);var _0x3896a2={'where':_0x252a1a[_0xee2d('0x3c')]};return db[_0xee2d('0x2c')][_0xee2d('0x1c')](_0x3896a2)[_0xee2d('0x23')](function(_0x65c7d0){_0x374498[_0xee2d('0x1c')]=_0x65c7d0;if(_0x23d9bd['query']['includeAll']){_0x252a1a['include']=[{'all':!![]}];}return db[_0xee2d('0x2c')]['findAll'](_0x252a1a);})['then'](function(_0x5db388){_0x374498[_0xee2d('0x40')]=_0x5db388;return _0x374498;})[_0xee2d('0x23')](respondWithFilteredResult(_0x39cca0,_0x252a1a))[_0xee2d('0x41')](handleError(_0x39cca0,null));})[_0xee2d('0x41')](handleError(_0x39cca0,null));};exports[_0xee2d('0x42')]=function(_0x2f8b27,_0x482f66){var _0x3d1438={'raw':![],'where':{'id':_0x2f8b27['params']['id']}},_0x1cb718={};_0x1cb718[_0xee2d('0x2e')]=_[_0xee2d('0x2f')](db['CmCompany']['rawAttributes']);_0x1cb718[_0xee2d('0x30')]=_[_0xee2d('0x2f')](_0x2f8b27['query']);_0x1cb718[_0xee2d('0x39')]=_[_0xee2d('0x32')](_0x1cb718[_0xee2d('0x2e')],_0x1cb718['query']);_0x3d1438[_0xee2d('0x31')]=_['intersection'](_0x1cb718[_0xee2d('0x2e')],qs[_0xee2d('0x33')](_0x2f8b27[_0xee2d('0x30')][_0xee2d('0x33')]));_0x3d1438[_0xee2d('0x31')]=_0x3d1438['attributes']['length']?_0x3d1438['attributes']:_0x1cb718[_0xee2d('0x2e')];if(_0x2f8b27[_0xee2d('0x30')][_0xee2d('0x43')]){_0x3d1438[_0xee2d('0x44')]=[{'all':!![]}];}_0x3d1438=_['merge']({},_0x3d1438,_0x2f8b27[_0xee2d('0x3f')]);return db['CmCompany'][_0xee2d('0x45')](_0x3d1438)[_0xee2d('0x23')](handleEntityNotFound(_0x482f66,null))[_0xee2d('0x23')](respondWithResult(_0x482f66,null))['catch'](handleError(_0x482f66,null));};exports[_0xee2d('0x46')]=function(_0xed71a7,_0x31ee29){return db[_0xee2d('0x2c')][_0xee2d('0x46')](_0xed71a7['body'],{})[_0xee2d('0x23')](function(_0x434c7e){var _0x52e65c=_0xed71a7[_0xee2d('0x47')]['get']({'plain':!![]});if(!_0x52e65c)throw new Error(_0xee2d('0x48'));if(_0x52e65c['role']===_0xee2d('0x47')){var _0x51dff8=_0x434c7e[_0xee2d('0x25')]({'plain':!![]});var _0x4b72f0='Companies';return db[_0xee2d('0x49')][_0xee2d('0x45')]({'where':{'name':_0x4b72f0,'userProfileId':_0x52e65c[_0xee2d('0x4a')]},'raw':!![]})[_0xee2d('0x23')](function(_0x3c3b29){if(_0x3c3b29&&_0x3c3b29[_0xee2d('0x4b')]===0x0){return db[_0xee2d('0x26')][_0xee2d('0x46')]({'name':_0x51dff8[_0xee2d('0x2a')],'resourceId':_0x51dff8['id'],'type':_0x3c3b29['name'],'sectionId':_0x3c3b29['id']},{})[_0xee2d('0x23')](function(){return _0x434c7e;});}else{return _0x434c7e;}})[_0xee2d('0x41')](function(_0x33b2bd){logger[_0xee2d('0x28')](_0xee2d('0x4c'),_0x33b2bd);throw _0x33b2bd;});}return _0x434c7e;})[_0xee2d('0x23')](respondWithResult(_0x31ee29,0xc9))['catch'](handleError(_0x31ee29,null));};exports['update']=function(_0x271df2,_0x427c30){if(_0x271df2[_0xee2d('0x4d')]['id']){delete _0x271df2['body']['id'];}return db['CmCompany'][_0xee2d('0x45')]({'where':{'id':_0x271df2['params']['id']}})[_0xee2d('0x23')](handleEntityNotFound(_0x427c30,null))[_0xee2d('0x23')](saveUpdates(_0x271df2[_0xee2d('0x4d')],null))[_0xee2d('0x23')](respondWithResult(_0x427c30,null))[_0xee2d('0x41')](handleError(_0x427c30,null));};exports[_0xee2d('0x24')]=function(_0x5c98eb,_0x3924ee){return db['CmCompany']['find']({'where':{'id':_0x5c98eb[_0xee2d('0x4e')]['id']}})[_0xee2d('0x23')](handleEntityNotFound(_0x3924ee,null))['then'](removeEntity(_0x3924ee,null))[_0xee2d('0x41')](handleError(_0x3924ee,null));};exports[_0xee2d('0x2d')]=function(_0x41d64f,_0x45b082){return db[_0xee2d('0x2c')][_0xee2d('0x2d')]()[_0xee2d('0x23')](respondWithResult(_0x45b082,null))[_0xee2d('0x41')](handleError(_0x45b082,null));};exports[_0xee2d('0x4f')]=function(_0x3e22b0,_0x3e8223,_0x22f930){return db[_0xee2d('0x50')][_0xee2d('0x45')]({'where':{'id':_0x3e22b0[_0xee2d('0x4e')]['id']}})[_0xee2d('0x23')](handleEntityNotFound(_0x3e8223,null))[_0xee2d('0x23')](function(_0x3e5d5d){if(_0x3e5d5d){return _0x3e5d5d[_0xee2d('0x4f')](_0x3e22b0[_0xee2d('0x4d')]['ids'],_[_0xee2d('0x51')](_0x3e22b0[_0xee2d('0x4d')],['ids','id'])||{});}})[_0xee2d('0x23')](respondWithResult(_0x3e8223,null))[_0xee2d('0x41')](handleError(_0x3e8223,null));};exports[_0xee2d('0x52')]=function(_0x10de76,_0x276e7e,_0x4dae13){var _0x46e094={};var _0x57f421={};var _0x4e1695;var _0x13b04c;return db[_0xee2d('0x2c')][_0xee2d('0x53')]({'where':{'id':_0x10de76[_0xee2d('0x4e')]['id']}})[_0xee2d('0x23')](handleEntityNotFound(_0x276e7e,null))[_0xee2d('0x23')](function(_0xee0e8d){if(_0xee0e8d){_0x4e1695=_0xee0e8d;_0x57f421[_0xee2d('0x2e')]=_['keys'](db['CmContact'][_0xee2d('0x54')]);_0x57f421[_0xee2d('0x30')]=_[_0xee2d('0x2f')](_0x10de76['query']);_0x57f421['filters']=_['intersection'](_0x57f421['model'],_0x57f421[_0xee2d('0x30')]);_0x46e094[_0xee2d('0x31')]=_['intersection'](_0x57f421[_0xee2d('0x2e')],qs[_0xee2d('0x33')](_0x10de76['query'][_0xee2d('0x33')]));_0x46e094[_0xee2d('0x31')]=_0x46e094[_0xee2d('0x31')][_0xee2d('0x34')]?_0x46e094['attributes']:_0x57f421[_0xee2d('0x2e')];_0x46e094[_0xee2d('0x37')]=qs[_0xee2d('0x38')](_0x10de76['query'][_0xee2d('0x38')]);_0x46e094[_0xee2d('0x3c')]=qs[_0xee2d('0x39')](_[_0xee2d('0x3a')](_0x10de76['query'],_0x57f421[_0xee2d('0x39')]));if(_0x10de76[_0xee2d('0x30')]['filter']){_0x46e094[_0xee2d('0x3c')]=_[_0xee2d('0x3e')](_0x46e094[_0xee2d('0x3c')],{'$or':_['map'](_0x46e094[_0xee2d('0x31')],function(_0x54b18e){var _0x1b7846={};_0x1b7846[_0x54b18e]={'$like':'%'+_0x10de76[_0xee2d('0x30')][_0xee2d('0x3b')]+'%'};return _0x1b7846;})});}_0x46e094=_[_0xee2d('0x3e')]({},_0x46e094,_0x10de76[_0xee2d('0x3f')]);return _0x4e1695[_0xee2d('0x52')](_0x46e094);}})['then'](function(_0xb3b0a3){if(_0xb3b0a3){_0x13b04c=_0xb3b0a3[_0xee2d('0x34')];if(!_0x10de76[_0xee2d('0x30')][_0xee2d('0x35')](_0xee2d('0x36'))){_0x46e094[_0xee2d('0x1b')]=qs[_0xee2d('0x1b')](_0x10de76['query'][_0xee2d('0x1b')]);_0x46e094[_0xee2d('0x19')]=qs['offset'](_0x10de76[_0xee2d('0x30')]['offset']);}return _0x4e1695['getContacts'](_0x46e094);}})[_0xee2d('0x23')](function(_0x2b9e87){if(_0x2b9e87){return _0x2b9e87?{'count':_0x13b04c,'rows':_0x2b9e87}:null;}})[_0xee2d('0x23')](respondWithResult(_0x276e7e,null))[_0xee2d('0x41')](handleError(_0x276e7e,null));};
\ No newline at end of file
diff --git a/server/api/cmCompany/cmCompany.model.js b/server/api/cmCompany/cmCompany.model.js
index d21e16c..a50d625 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 _0x5005=['path','rimraf','../../config/environment','./cmCompany.attributes','exports','define','cm_companies','lodash','util','../../config/logger','api','moment','bluebird','request-promise'];(function(_0x202eeb,_0x453857){var _0x24b967=function(_0x1f2f4f){while(--_0x1f2f4f){_0x202eeb['push'](_0x202eeb['shift']());}};_0x24b967(++_0x453857);}(_0x5005,0x149));var _0x5500=function(_0xd63e3a,_0x1bd6eb){_0xd63e3a=_0xd63e3a-0x0;var _0x19c178=_0x5005[_0xd63e3a];return _0x19c178;};'use strict';var _=require(_0x5500('0x0'));var util=require(_0x5500('0x1'));var logger=require(_0x5500('0x2'))(_0x5500('0x3'));var moment=require(_0x5500('0x4'));var BPromise=require(_0x5500('0x5'));var rp=require(_0x5500('0x6'));var fs=require('fs');var path=require(_0x5500('0x7'));var rimraf=require(_0x5500('0x8'));var config=require(_0x5500('0x9'));var attributes=require(_0x5500('0xa'));module[_0x5500('0xb')]=function(_0x5eaca7,_0x31231e){return _0x5eaca7[_0x5500('0xc')]('CmCompany',attributes,{'tableName':_0x5500('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x6349=['./cmCompany.attributes','exports','define','CmCompany','cm_companies','util','../../config/logger','bluebird','request-promise','path','rimraf','../../config/environment'];(function(_0x17499b,_0x1b2ffd){var _0x5d2b45=function(_0x55f4e2){while(--_0x55f4e2){_0x17499b['push'](_0x17499b['shift']());}};_0x5d2b45(++_0x1b2ffd);}(_0x6349,0x101));var _0x9634=function(_0x1a4a85,_0x2af844){_0x1a4a85=_0x1a4a85-0x0;var _0x185e02=_0x6349[_0x1a4a85];return _0x185e02;};'use strict';var _=require('lodash');var util=require(_0x9634('0x0'));var logger=require(_0x9634('0x1'))('api');var moment=require('moment');var BPromise=require(_0x9634('0x2'));var rp=require(_0x9634('0x3'));var fs=require('fs');var path=require(_0x9634('0x4'));var rimraf=require(_0x9634('0x5'));var config=require(_0x9634('0x6'));var attributes=require(_0x9634('0x7'));module[_0x9634('0x8')]=function(_0x43a8a0,_0x57a3b3){return _0x43a8a0[_0x9634('0x9')](_0x9634('0xa'),attributes,{'tableName':_0x9634('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
diff --git a/server/api/cmCompany/cmCompany.rpc.js b/server/api/cmCompany/cmCompany.rpc.js
index dce421e..a2379c2 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 _0x0327=['CmCompany,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','message','result','util','moment','randomstring','ioredis','../../config/logger','../../config/environment','jayson/promise','then','CmCompany,\x20%s,\x20%s','debug'];(function(_0x52442b,_0x5356c3){var _0xd96937=function(_0x4e3ebe){while(--_0x4e3ebe){_0x52442b['push'](_0x52442b['shift']());}};_0xd96937(++_0x5356c3);}(_0x0327,0x76));var _0x7032=function(_0x1f703a,_0x3031b7){_0x1f703a=_0x1f703a-0x0;var _0xd7b7e1=_0x0327[_0x1f703a];return _0xd7b7e1;};'use strict';var _=require('lodash');var util=require(_0x7032('0x0'));var moment=require(_0x7032('0x1'));var BPromise=require('bluebird');var rs=require(_0x7032('0x2'));var fs=require('fs');var Redis=require(_0x7032('0x3'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x7032('0x4'))('rpc');var config=require(_0x7032('0x5'));var jayson=require(_0x7032('0x6'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x4d91b7,_0x2ce411,_0x24c2de){return new BPromise(function(_0xcc8f2f,_0x246cff){return client['request'](_0x4d91b7,_0x24c2de)[_0x7032('0x7')](function(_0x3579ac){logger['info'](_0x7032('0x8'),_0x2ce411,'request\x20sent');logger[_0x7032('0x9')](_0x7032('0xa'),_0x2ce411,_0x7032('0xb'),JSON['stringify'](_0x3579ac));if(_0x3579ac['error']){if(_0x3579ac[_0x7032('0xc')][_0x7032('0xd')]===0x1f4){logger['error'](_0x7032('0x8'),_0x2ce411,_0x3579ac['error']['message']);return _0x246cff(_0x3579ac[_0x7032('0xc')][_0x7032('0xe')]);}logger[_0x7032('0xc')](_0x7032('0x8'),_0x2ce411,_0x3579ac[_0x7032('0xc')]['message']);return _0xcc8f2f(_0x3579ac['error'][_0x7032('0xe')]);}else{logger['info'](_0x7032('0x8'),_0x2ce411,_0x7032('0xb'));_0xcc8f2f(_0x3579ac[_0x7032('0xf')]['message']);}})['catch'](function(_0x320714){logger[_0x7032('0xc')]('CmCompany,\x20%s,\x20%s',_0x2ce411,_0x320714);_0x246cff(_0x320714);});});}
\ No newline at end of file
+var _0x1fb0=['request\x20sent','debug','error','code','message','result','catch','util','moment','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then','CmCompany,\x20%s,\x20%s'];(function(_0x3c4dad,_0x25ffd5){var _0x1a4f49=function(_0x6fe6c){while(--_0x6fe6c){_0x3c4dad['push'](_0x3c4dad['shift']());}};_0x1a4f49(++_0x25ffd5);}(_0x1fb0,0x15b));var _0x01fb=function(_0x47a5f8,_0x1b4545){_0x47a5f8=_0x47a5f8-0x0;var _0x554bbf=_0x1fb0[_0x47a5f8];return _0x554bbf;};'use strict';var _=require('lodash');var util=require(_0x01fb('0x0'));var moment=require(_0x01fb('0x1'));var BPromise=require('bluebird');var rs=require(_0x01fb('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x01fb('0x3'))['db'];var utils=require(_0x01fb('0x4'));var logger=require(_0x01fb('0x5'))(_0x01fb('0x6'));var config=require(_0x01fb('0x7'));var jayson=require(_0x01fb('0x8'));var client=jayson['client'][_0x01fb('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x4ab1ce,_0x21c6cd,_0x492b2e){return new BPromise(function(_0x3d4d6c,_0x3eb8ba){return client[_0x01fb('0xa')](_0x4ab1ce,_0x492b2e)[_0x01fb('0xb')](function(_0x25b6e3){logger['info'](_0x01fb('0xc'),_0x21c6cd,_0x01fb('0xd'));logger[_0x01fb('0xe')]('CmCompany,\x20%s,\x20%s,\x20%s',_0x21c6cd,_0x01fb('0xd'),JSON['stringify'](_0x25b6e3));if(_0x25b6e3[_0x01fb('0xf')]){if(_0x25b6e3['error'][_0x01fb('0x10')]===0x1f4){logger[_0x01fb('0xf')](_0x01fb('0xc'),_0x21c6cd,_0x25b6e3[_0x01fb('0xf')][_0x01fb('0x11')]);return _0x3eb8ba(_0x25b6e3['error'][_0x01fb('0x11')]);}logger['error'](_0x01fb('0xc'),_0x21c6cd,_0x25b6e3[_0x01fb('0xf')][_0x01fb('0x11')]);return _0x3d4d6c(_0x25b6e3[_0x01fb('0xf')][_0x01fb('0x11')]);}else{logger['info'](_0x01fb('0xc'),_0x21c6cd,_0x01fb('0xd'));_0x3d4d6c(_0x25b6e3[_0x01fb('0x12')]['message']);}})[_0x01fb('0x13')](function(_0x5c7218){logger['error'](_0x01fb('0xc'),_0x21c6cd,_0x5c7218);_0x3eb8ba(_0x5c7218);});});}
\ No newline at end of file
diff --git a/server/api/cmCompany/index.js b/server/api/cmCompany/index.js
index bf33166..0b90850 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 _0x4adc=['connect-timeout','Router','../../components/auth/service','../../config/environment','isAuthenticated','index','describe','get','/:id','/:id/contacts','getContacts','post','create','addContacts','put','update','delete','destroy','exports','multer','path'];(function(_0x2dc4be,_0x3dbc7e){var _0x2ce4fe=function(_0x3a7744){while(--_0x3a7744){_0x2dc4be['push'](_0x2dc4be['shift']());}};_0x2ce4fe(++_0x3dbc7e);}(_0x4adc,0x14e));var _0xc4ad=function(_0x50a0c2,_0x4befab){_0x50a0c2=_0x50a0c2-0x0;var _0x5ebadd=_0x4adc[_0x50a0c2];return _0x5ebadd;};'use strict';var multer=require(_0xc4ad('0x0'));var util=require('util');var path=require(_0xc4ad('0x1'));var timeout=require(_0xc4ad('0x2'));var express=require('express');var router=express[_0xc4ad('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0xc4ad('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0xc4ad('0x5'));var controller=require('./cmCompany.controller');router['get']('/',auth[_0xc4ad('0x6')](),controller[_0xc4ad('0x7')]);router['get']('/describe',auth[_0xc4ad('0x6')](),controller[_0xc4ad('0x8')]);router[_0xc4ad('0x9')](_0xc4ad('0xa'),auth['isAuthenticated'](),controller['show']);router[_0xc4ad('0x9')](_0xc4ad('0xb'),auth[_0xc4ad('0x6')](),controller[_0xc4ad('0xc')]);router[_0xc4ad('0xd')]('/',auth[_0xc4ad('0x6')](),controller[_0xc4ad('0xe')]);router[_0xc4ad('0xd')](_0xc4ad('0xb'),auth['isAuthenticated'](),controller[_0xc4ad('0xf')]);router[_0xc4ad('0x10')]('/:id',auth[_0xc4ad('0x6')](),controller[_0xc4ad('0x11')]);router[_0xc4ad('0x12')](_0xc4ad('0xa'),auth['isAuthenticated'](),controller[_0xc4ad('0x13')]);module[_0xc4ad('0x14')]=router;
\ No newline at end of file
+var _0x8b0a=['Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./cmCompany.controller','get','isAuthenticated','index','/describe','describe','/:id','show','/:id/contacts','getContacts','post','destroy','exports','multer','util','path','express'];(function(_0x585b20,_0xed7dd){var _0x43aaa0=function(_0xf54695){while(--_0xf54695){_0x585b20['push'](_0x585b20['shift']());}};_0x43aaa0(++_0xed7dd);}(_0x8b0a,0xac));var _0xa8b0=function(_0x2acd35,_0x2b21df){_0x2acd35=_0x2acd35-0x0;var _0x272693=_0x8b0a[_0x2acd35];return _0x272693;};'use strict';var multer=require(_0xa8b0('0x0'));var util=require(_0xa8b0('0x1'));var path=require(_0xa8b0('0x2'));var timeout=require('connect-timeout');var express=require(_0xa8b0('0x3'));var router=express[_0xa8b0('0x4')]();var fs_extra=require(_0xa8b0('0x5'));var auth=require(_0xa8b0('0x6'));var interaction=require(_0xa8b0('0x7'));var config=require(_0xa8b0('0x8'));var controller=require(_0xa8b0('0x9'));router[_0xa8b0('0xa')]('/',auth[_0xa8b0('0xb')](),controller[_0xa8b0('0xc')]);router['get'](_0xa8b0('0xd'),auth[_0xa8b0('0xb')](),controller[_0xa8b0('0xe')]);router[_0xa8b0('0xa')](_0xa8b0('0xf'),auth[_0xa8b0('0xb')](),controller[_0xa8b0('0x10')]);router[_0xa8b0('0xa')](_0xa8b0('0x11'),auth[_0xa8b0('0xb')](),controller[_0xa8b0('0x12')]);router['post']('/',auth[_0xa8b0('0xb')](),controller['create']);router[_0xa8b0('0x13')](_0xa8b0('0x11'),auth['isAuthenticated'](),controller['addContacts']);router['put'](_0xa8b0('0xf'),auth[_0xa8b0('0xb')](),controller['update']);router['delete'](_0xa8b0('0xf'),auth['isAuthenticated'](),controller[_0xa8b0('0x14')]);module[_0xa8b0('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 33328ae..801e0dd 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 _0x58c7=['lodash','exports','STRING','INTEGER','UNSIGNED','NOW'];(function(_0x50c5a9,_0x355ab2){var _0x24438d=function(_0xfebd8c){while(--_0xfebd8c){_0x50c5a9['push'](_0x50c5a9['shift']());}};_0x24438d(++_0x355ab2);}(_0x58c7,0xf0));var _0x758c=function(_0x36faf6,_0x3976b3){_0x36faf6=_0x36faf6-0x0;var _0x180e16=_0x58c7[_0x36faf6];return _0x180e16;};'use strict';var _=require(_0x758c('0x0'));var Sequelize=require('sequelize');module[_0x758c('0x1')]={'firstName':{'type':Sequelize[_0x758c('0x2')],'allowNull':![]},'lastName':{'type':Sequelize[_0x758c('0x2')]},'street':{'type':Sequelize[_0x758c('0x2')]},'postalCode':{'type':Sequelize[_0x758c('0x2')]},'city':{'type':Sequelize['STRING']},'country':{'type':Sequelize[_0x758c('0x2')]},'dateOfBirth':{'type':Sequelize[_0x758c('0x2')]},'description':{'type':Sequelize['TEXT']},'phone':{'type':Sequelize[_0x758c('0x2')]},'mobile':{'type':Sequelize[_0x758c('0x2')]},'fax':{'type':Sequelize['STRING']},'email':{'type':Sequelize[_0x758c('0x2')]},'url':{'type':Sequelize[_0x758c('0x2')]},'facebook':{'type':Sequelize[_0x758c('0x2')]},'fb_data':{'type':Sequelize[_0x758c('0x2')]},'twitter':{'type':Sequelize[_0x758c('0x2')]},'skype':{'type':Sequelize[_0x758c('0x2')]},'teams':{'type':Sequelize[_0x758c('0x2')]},'viber':{'type':Sequelize['STRING']},'line':{'type':Sequelize[_0x758c('0x2')]},'wechat':{'type':Sequelize[_0x758c('0x2')]},'telegram':{'type':Sequelize[_0x758c('0x2')]},'UserId':{'type':Sequelize['INTEGER']},'priority':{'type':Sequelize[_0x758c('0x3')](0x2)[_0x758c('0x4')],'defaultValue':0x2,'validate':{'min':0x0,'max':0x4}},'scheduledat':{'type':Sequelize['DATE'],'defaultValue':Sequelize[_0x758c('0x5')]}};
\ No newline at end of file
+var _0x2c13=['STRING','TEXT','INTEGER','UNSIGNED','NOW','lodash','sequelize','exports'];(function(_0x19b2ff,_0x4e04c5){var _0x31bc90=function(_0x56e881){while(--_0x56e881){_0x19b2ff['push'](_0x19b2ff['shift']());}};_0x31bc90(++_0x4e04c5);}(_0x2c13,0x1cd));var _0x32c1=function(_0x1f7d8f,_0x43e1ed){_0x1f7d8f=_0x1f7d8f-0x0;var _0x41bd00=_0x2c13[_0x1f7d8f];return _0x41bd00;};'use strict';var _=require(_0x32c1('0x0'));var Sequelize=require(_0x32c1('0x1'));module[_0x32c1('0x2')]={'firstName':{'type':Sequelize['STRING'],'allowNull':![]},'lastName':{'type':Sequelize[_0x32c1('0x3')]},'street':{'type':Sequelize['STRING']},'postalCode':{'type':Sequelize[_0x32c1('0x3')]},'city':{'type':Sequelize[_0x32c1('0x3')]},'country':{'type':Sequelize[_0x32c1('0x3')]},'dateOfBirth':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0x32c1('0x4')]},'phone':{'type':Sequelize[_0x32c1('0x3')]},'mobile':{'type':Sequelize[_0x32c1('0x3')]},'fax':{'type':Sequelize['STRING']},'email':{'type':Sequelize[_0x32c1('0x3')]},'url':{'type':Sequelize['STRING']},'facebook':{'type':Sequelize['STRING']},'fb_data':{'type':Sequelize[_0x32c1('0x3')]},'twitter':{'type':Sequelize['STRING']},'skype':{'type':Sequelize['STRING']},'teams':{'type':Sequelize[_0x32c1('0x3')]},'viber':{'type':Sequelize[_0x32c1('0x3')]},'line':{'type':Sequelize[_0x32c1('0x3')]},'wechat':{'type':Sequelize[_0x32c1('0x3')]},'telegram':{'type':Sequelize[_0x32c1('0x3')]},'UserId':{'type':Sequelize[_0x32c1('0x5')]},'priority':{'type':Sequelize['INTEGER'](0x2)[_0x32c1('0x6')],'defaultValue':0x2,'validate':{'min':0x0,'max':0x4}},'scheduledat':{'type':Sequelize['DATE'],'defaultValue':Sequelize[_0x32c1('0x7')]}};
\ No newline at end of file
diff --git a/server/api/cmContact/cmContact.controller.js b/server/api/cmContact/cmContact.controller.js
index 5765ebf..2f9c78e 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 _0xf81a=['order','sort','where','pick','select','field','color','from','tools_tags','left_join','cm_contact_has_tags','ct.CmContactId\x20=\x20c.id','t.id\x20=\x20ct.TagId','c.deletedAt\x20IS\x20NULL','expr','parseSearch','sqlOperator','conditions','find','value','split','forEach','union','User','and','fieldType','datetime','castTo','DATE','buildExpression','text','start','map','filter','isNil','Contact','isEmpty','ListId','concat','tag','CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','replace','getFullTextValue','isNumeric','c.id\x20LIKE\x20?','c.phone\x20LIKE\x20?','c.fax\x20LIKE\x20?','c.email\x20LIKE\x20?','c.firstName\x20LIKE\x20?','c.lastName\x20LIKE\x20?','group','c.id','Sequelize','QueryTypes','clone','having','t.id\x20IN\x20?','role','agent','some','user','getLists','c.ListId\x20IS\x20NULL','c.ListId\x20IN\x20?','sequelize','toString','keyBy','merge','c.firstName','c.phone','c.mobile','c.ListId','c.CompanyId','GROUP_CONCAT(DISTINCT\x20t.id)','TagIds','Tags','rows','catch','destroy','params','describe','tags','startsWith','columnName','displayName','CmCustomField','findAll','alias','custom','body','get','mergeWith','isArray','join','info','[CmContact][merge]\x20to\x20%s\x20from\x20%s','CmHopper','[CmContact][merge][destroy][CmHopper],\x20%s','CmHopperBlack','[CmContact][merge][destroy][CmHopperBlack],\x20%s','ChatInteraction','update','ChatMessage','MailInteraction','MailMessage','FaxMessage','OpenchannelInteraction','OpenchannelMessage','CmHopperFinal','CmHopperHistory','VoiceCallReport','MailQueueReport','SmsQueueReport','JscriptySessionReport','WhatsappInteraction','WhatsappMessage','WhatsappQueueReport','create','bulkCreate','each','duplicates','$or','spread','show','Tag','omit','cf_%d','$and','format','table','setFields','toParam','values','phone','rawAttributes','options','nolimit','getTags','setTags','ContactId','include','includeAll','getHopperFinals','getJscriptySessions','uploadCsv','No\x20ListId\x20specified','binding_keys','No\x20association\x20keys\x20specified!','binding_values','No\x20association\x20values\x20specified!','socket_timestamp','zipObject','No\x20phone\x20column\x20specified','firstName','No\x20firstName\x20column\x20specified','root','server/files/tmp','file','child_process','fork','../../components/import/cm/csv','File\x20uploaded\x20correctly!','upload','meta','import','binding','stringify','start\x20child\x20process\x20correctly!','pid','exit','error\x20child\x20process','getJourney','mail','fax','voice','-createdAt','includes','channel','toLowerCase','Invalid\x20channel','range','parse','isValid','Invalid\x20date\x20for\x20range\x20from\x20filter','uniqueid','destination','callerid','endtime','duration','note','userDisposition','userSecondDisposition','UserId','DESC','createdAt','findAndCountAll','fullname','startCase','chat','Website','Account','closed','closedAt','thirdDisposition','key','Owner','browserName','customerIp','customerPort','osName','ratingType','referer','subject','substatus','openchannel','flatten','sortBy','reverse','slice','eml-format','zip-dir','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','squel','jsforce','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','redis','defaults','socket.io-emitter','./cmContact.socket','register','sendStatus','end','status','json','offset','limit','undefined','count','apply','reject','save','then','error','stack','name','send','index','CmContact','keys','cf_','push','findOne','trimStart','all','type','model','query','filters','intersection','attributes','fields','length','hasOwnProperty'];(function(_0x3b0988,_0x167e03){var _0x5bac55=function(_0x5b920f){while(--_0x5b920f){_0x3b0988['push'](_0x3b0988['shift']());}};_0x5bac55(++_0x167e03);}(_0xf81a,0xdb));var _0xaf81=function(_0xe1cf16,_0x2ada6b){_0xe1cf16=_0xe1cf16-0x0;var _0x1b6838=_0xf81a[_0xe1cf16];return _0x1b6838;};'use strict';var emlformat=require(_0xaf81('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xaf81('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0xaf81('0x2'));var moment=require(_0xaf81('0x3'));var BPromise=require(_0xaf81('0x4'));var Mustache=require(_0xaf81('0x5'));var util=require(_0xaf81('0x6'));var path=require(_0xaf81('0x7'));var sox=require(_0xaf81('0x8'));var csv=require(_0xaf81('0x9'));var ejs=require(_0xaf81('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0xaf81('0xb'));var crypto=require('crypto');var jsforce=require(_0xaf81('0xc'));var deskjs=require('desk.js');var toCsv=require(_0xaf81('0x9'));var querystring=require(_0xaf81('0xd'));var Papa=require(_0xaf81('0xe'));var Redis=require('ioredis');var authService=require(_0xaf81('0xf'));var qs=require(_0xaf81('0x10'));var as=require(_0xaf81('0x11'));var hardwareService=require(_0xaf81('0x12'));var logger=require('../../config/logger')(_0xaf81('0x13'));var utils=require(_0xaf81('0x14'));var config=require(_0xaf81('0x15'));var licenseUtil=require(_0xaf81('0x16'));var db=require('../../mysqldb')['db'];config[_0xaf81('0x17')]=_[_0xaf81('0x18')](config[_0xaf81('0x17')],{'host':'localhost','port':0x18eb});var socket=require(_0xaf81('0x19'))(new Redis(config[_0xaf81('0x17')]));require(_0xaf81('0x1a'))[_0xaf81('0x1b')](socket);function respondWithStatusCode(_0x15f9a5,_0x219d95){_0x219d95=_0x219d95||0xcc;return function(_0x2a12ab){if(_0x2a12ab){return _0x15f9a5[_0xaf81('0x1c')](_0x219d95);}return _0x15f9a5['status'](_0x219d95)[_0xaf81('0x1d')]();};}function respondWithResult(_0x454ae6,_0x336aa3){_0x336aa3=_0x336aa3||0xc8;return function(_0x34de98){if(_0x34de98){return _0x454ae6[_0xaf81('0x1e')](_0x336aa3)[_0xaf81('0x1f')](_0x34de98);}};}function respondWithFilteredResult(_0x5af934,_0xb7d964){return function(_0x2e385f){if(_0x2e385f){var _0x29cff2=typeof _0xb7d964[_0xaf81('0x20')]==='undefined'&&typeof _0xb7d964[_0xaf81('0x21')]===_0xaf81('0x22');var _0x3aec0e=_0x2e385f[_0xaf81('0x23')];var _0x45309b=_0x29cff2?0x0:_0xb7d964[_0xaf81('0x20')];var _0x2c250d=_0x29cff2?_0x2e385f[_0xaf81('0x23')]:_0xb7d964[_0xaf81('0x20')]+_0xb7d964['limit'];var _0x506a99;if(_0x2c250d>=_0x3aec0e){_0x2c250d=_0x3aec0e;_0x506a99=0xc8;}else{_0x506a99=0xce;}_0x5af934[_0xaf81('0x1e')](_0x506a99);return _0x5af934['set']('Content-Range',_0x45309b+'-'+_0x2c250d+'/'+_0x3aec0e)[_0xaf81('0x1f')](_0x2e385f);}return null;};}function patchUpdates(_0x3cf20b){return function(_0x30494d){try{jsonpatch[_0xaf81('0x24')](_0x30494d,_0x3cf20b,!![]);}catch(_0x2af7d8){return BPromise[_0xaf81('0x25')](_0x2af7d8);}return _0x30494d[_0xaf81('0x26')]();};}function saveUpdates(_0x371c5a,_0x4f586a){return function(_0x205b60){if(_0x205b60){return _0x205b60['update'](_0x371c5a)[_0xaf81('0x27')](function(_0x33eca4){return _0x33eca4;});}return null;};}function removeEntity(_0x20df74,_0x1ab68c){return function(_0x1ba279){if(_0x1ba279){return _0x1ba279['destroy']()[_0xaf81('0x27')](function(){_0x20df74[_0xaf81('0x1e')](0xcc)[_0xaf81('0x1d')]();});}};}function handleEntityNotFound(_0x5b91e8,_0x1d8941){return function(_0x2d4678){if(!_0x2d4678){_0x5b91e8['sendStatus'](0x194);}return _0x2d4678;};}function handleError(_0x45d325,_0x2a63e5){_0x2a63e5=_0x2a63e5||0x1f4;return function(_0x131869){logger[_0xaf81('0x28')](_0x131869[_0xaf81('0x29')]);if(_0x131869[_0xaf81('0x2a')]){delete _0x131869[_0xaf81('0x2a')];}_0x45d325[_0xaf81('0x1e')](_0x2a63e5)[_0xaf81('0x2b')](_0x131869);};}exports[_0xaf81('0x2c')]=function(_0x3e5224,_0x4e60ba){var _0x26cdf5={},_0x575be1={},_0x1c44d4={'count':0x0,'rows':[]};return db[_0xaf81('0x2d')]['describe']()[_0xaf81('0x27')](function(_0x4e947c){var _0x160796=[];for(var _0x2df4ae=0x0;_0x2df4ae
','Attachments','Data','gmail','imap.gmail.com','yahoo','hotmail','imap-mail.outlook.com','outlook365','outlook.office365.com','lodash','moment','node-tnef','../../../config/logger','email','value','anonymous','@xcally.com','name','address'];(function(_0x554142,_0x3e7e89){var _0x5a0ae8=function(_0x4f02e6){while(--_0x4f02e6){_0x554142['push'](_0x554142['shift']());}};_0x5a0ae8(++_0x3e7e89);}(_0x9e54,0x88));var _0x49e5=function(_0x2d8935,_0x2c9d2e){_0x2d8935=_0x2d8935-0x0;var _0x2c5156=_0x9e54[_0x2d8935];return _0x2c5156;};'use strict';var _=require(_0x49e5('0x0'));var moment=require(_0x49e5('0x1'));var random=require('randomstring');var fs=require('fs');var path=require('path');var util=require('util');var tnef=require(_0x49e5('0x2'));var logger=require(_0x49e5('0x3'))(_0x49e5('0x4'));var config=require('../../../config/environment');function getAddress(_0x377300){var _0x31b5c4=_['head'](_0x377300[_0x49e5('0x5')]);return _0x31b5c4&&_0x31b5c4['address']?_0x31b5c4['address']:_0x49e5('0x6')+random['generate'](0x6)+_0x49e5('0x7');}function getFirstName(_0x234dd3){var _0x4302ff=_['head'](_0x234dd3['value']);if(_0x4302ff&&_0x4302ff[_0x49e5('0x8')]){if(_0x4302ff['name']==_0x4302ff[_0x49e5('0x9')]){return _0x4302ff[_0x49e5('0x8')][_0x49e5('0xa')](0x0,_0x4302ff[_0x49e5('0x8')][_0x49e5('0xb')]('@'));}var _0x51cf9b=_0x4302ff[_0x49e5('0x8')]['split'](/\s+/);return _0x51cf9b[_0x49e5('0xc')]>0x1?_0x51cf9b[_0x49e5('0xd')](0x0,-0x1)[_0x49e5('0xe')]('\x20'):_0x4302ff[_0x49e5('0x8')];}return _0x49e5('0xf');}function getLastName(_0x56b341){var _0x5545c1=_[_0x49e5('0x10')](_0x56b341[_0x49e5('0x5')]);if(_0x5545c1&&_0x5545c1['name']){var _0x56ae34=_0x5545c1[_0x49e5('0x8')]['split'](/\s+/);return _0x56ae34[_0x49e5('0xc')]>0x1?_0x56ae34['pop']():'';}return'';}function getMails(_0x2cc353,_0x13bc7f){var _0x375488='';for(var _0x568cfb=0x0;_0x568cfb<_0x13bc7f[_0x49e5('0x5')][_0x49e5('0xc')];_0x568cfb+=0x1){if(_0x13bc7f[_0x49e5('0x5')][_0x568cfb][_0x49e5('0x9')]!==_0x2cc353){if(!_[_0x49e5('0x11')](_0x375488)){_0x375488+=',';}_0x375488+=_0x13bc7f[_0x49e5('0x5')][_0x568cfb][_0x49e5('0x8')]||_0x13bc7f['value'][_0x568cfb][_0x49e5('0x9')]||'';_0x375488+='\x20<';_0x375488+=_0x13bc7f[_0x49e5('0x5')][_0x568cfb]['address']?_0x13bc7f[_0x49e5('0x5')][_0x568cfb]['address']:_0x49e5('0x6')+random[_0x49e5('0x12')](0x6)+'@xcally.com';_0x375488+='>';}}return _0x375488;}function parseEmail(_0x136838,_0x41c6d0,_0x31fddc){if(_0x41c6d0[_0x49e5('0x13')]){var _0xe9a50=/