From 9d697bc3989748f125859ebe0dc22475124608a9 Mon Sep 17 00:00:00 2001
From: Andrea Amorese
Date: Tue, 24 Aug 2021 17:26:11 +0200
Subject: [PATCH] Built motion from commit 85951d68.|2.5.33
---
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 +-
.../cmContactHasItem.attributes.js | 2 +-
.../cmContactHasItem.controller.js | 2 +-
.../api/cmContactHasItem/cmContactHasItem.model.js | 2 +-
.../api/cmContactHasItem/cmContactHasItem.rpc.js | 2 +-
server/api/cmContactHasItem/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 +-
.../cmHopperAdditionalPhone.attributes.js | 2 +-
.../cmHopperAdditionalPhone.controller.js | 2 +-
.../cmHopperAdditionalPhone.model.js | 2 +-
.../cmHopperAdditionalPhone.rpc.js | 2 +-
server/api/cmHopperAdditionalPhone/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 +-
.../contactItemType/contactItemType.attributes.js | 2 +-
.../contactItemType/contactItemType.controller.js | 2 +-
.../api/contactItemType/contactItemType.model.js | 2 +-
server/api/contactItemType/contactItemType.rpc.js | 2 +-
server/api/contactItemType/index.js | 2 +-
server/api/dashboard/dashboard.attributes.js | 2 +-
server/api/dashboard/dashboard.controller.js | 2 +-
server/api/dashboard/dashboard.events.js | 2 +-
server/api/dashboard/dashboard.model.js | 2 +-
server/api/dashboard/dashboard.rpc.js | 2 +-
server/api/dashboard/dashboard.socket.js | 2 +-
server/api/dashboard/index.js | 2 +-
.../api/dashboardItem/dashboardItem.attributes.js | 2 +-
.../api/dashboardItem/dashboardItem.controller.js | 2 +-
server/api/dashboardItem/dashboardItem.events.js | 2 +-
server/api/dashboardItem/dashboardItem.model.js | 2 +-
server/api/dashboardItem/dashboardItem.rpc.js | 2 +-
server/api/dashboardItem/dashboardItem.socket.js | 2 +-
server/api/dashboardItem/index.js | 2 +-
server/api/disposition/disposition.attributes.js | 2 +-
server/api/disposition/disposition.controller.js | 2 +-
server/api/disposition/disposition.model.js | 2 +-
server/api/disposition/disposition.rpc.js | 2 +-
server/api/disposition/index.js | 2 +-
server/api/faxAccount/faxAccount.attributes.js | 2 +-
server/api/faxAccount/faxAccount.controller.js | 2 +-
server/api/faxAccount/faxAccount.events.js | 2 +-
server/api/faxAccount/faxAccount.model.js | 2 +-
server/api/faxAccount/faxAccount.rpc.js | 2 +-
server/api/faxAccount/faxAccount.socket.js | 2 +-
server/api/faxAccount/index.js | 2 +-
.../faxApplication/faxApplication.attributes.js | 2 +-
.../faxApplication/faxApplication.controller.js | 2 +-
server/api/faxApplication/faxApplication.model.js | 2 +-
server/api/faxApplication/faxApplication.rpc.js | 2 +-
server/api/faxApplication/index.js | 2 +-
.../faxInteraction/faxInteraction.attributes.js | 2 +-
.../faxInteraction/faxInteraction.controller.js | 2 +-
server/api/faxInteraction/faxInteraction.events.js | 2 +-
server/api/faxInteraction/faxInteraction.model.js | 2 +-
server/api/faxInteraction/faxInteraction.rpc.js | 2 +-
server/api/faxInteraction/faxInteraction.socket.js | 2 +-
server/api/faxInteraction/index.js | 2 +-
server/api/faxMessage/faxMessage.attributes.js | 2 +-
server/api/faxMessage/faxMessage.controller.js | 2 +-
server/api/faxMessage/faxMessage.events.js | 2 +-
server/api/faxMessage/faxMessage.model.js | 2 +-
server/api/faxMessage/faxMessage.rpc.js | 2 +-
server/api/faxMessage/faxMessage.socket.js | 2 +-
server/api/faxMessage/index.js | 2 +-
server/api/faxQueue/faxQueue.attributes.js | 2 +-
server/api/faxQueue/faxQueue.controller.js | 2 +-
server/api/faxQueue/faxQueue.events.js | 2 +-
server/api/faxQueue/faxQueue.model.js | 2 +-
server/api/faxQueue/faxQueue.rpc.js | 2 +-
server/api/faxQueue/faxQueue.socket.js | 2 +-
server/api/faxQueue/index.js | 2 +-
.../faxQueueReport/faxQueueReport.attributes.js | 2 +-
.../faxQueueReport/faxQueueReport.controller.js | 2 +-
server/api/faxQueueReport/faxQueueReport.model.js | 2 +-
server/api/faxQueueReport/faxQueueReport.rpc.js | 2 +-
server/api/faxQueueReport/index.js | 2 +-
.../faxTransferReport.attributes.js | 2 +-
.../faxTransferReport.controller.js | 2 +-
.../faxTransferReport/faxTransferReport.model.js | 2 +-
.../api/faxTransferReport/faxTransferReport.rpc.js | 2 +-
server/api/faxTransferReport/index.js | 2 +-
server/api/intDeskAccount/index.js | 2 +-
.../intDeskAccount/intDeskAccount.attributes.js | 2 +-
.../intDeskAccount/intDeskAccount.controller.js | 2 +-
server/api/intDeskAccount/intDeskAccount.model.js | 2 +-
server/api/intDeskAccount/intDeskAccount.rpc.js | 2 +-
server/api/intDeskConfiguration/index.js | 2 +-
.../intDeskConfiguration.attributes.js | 2 +-
.../intDeskConfiguration.controller.js | 2 +-
.../intDeskConfiguration.model.js | 2 +-
.../intDeskConfiguration.rpc.js | 2 +-
server/api/intDeskField/index.js | 2 +-
server/api/intDeskField/intDeskField.attributes.js | 2 +-
server/api/intDeskField/intDeskField.controller.js | 2 +-
server/api/intDeskField/intDeskField.model.js | 2 +-
server/api/intDeskField/intDeskField.rpc.js | 2 +-
server/api/intDynamics365Account/index.js | 2 +-
.../intDynamics365Account.attributes.js | 2 +-
.../intDynamics365Account.controller.js | 2 +-
.../intDynamics365Account.model.js | 2 +-
.../intDynamics365Account.rpc.js | 2 +-
server/api/intDynamics365Configuration/index.js | 2 +-
.../intDynamics365Configuration.attributes.js | 2 +-
.../intDynamics365Configuration.controller.js | 2 +-
.../intDynamics365Configuration.model.js | 2 +-
.../intDynamics365Configuration.rpc.js | 2 +-
server/api/intDynamics365Field/index.js | 2 +-
.../intDynamics365Field.attributes.js | 2 +-
.../intDynamics365Field.controller.js | 2 +-
.../intDynamics365Field.model.js | 2 +-
.../intDynamics365Field/intDynamics365Field.rpc.js | 2 +-
server/api/intFreshdeskAccount/index.js | 2 +-
.../intFreshdeskAccount.attributes.js | 2 +-
.../intFreshdeskAccount.controller.js | 2 +-
.../intFreshdeskAccount.model.js | 2 +-
.../intFreshdeskAccount/intFreshdeskAccount.rpc.js | 2 +-
server/api/intFreshdeskConfiguration/index.js | 2 +-
.../intFreshdeskConfiguration.attributes.js | 2 +-
.../intFreshdeskConfiguration.controller.js | 2 +-
.../intFreshdeskConfiguration.model.js | 2 +-
.../intFreshdeskConfiguration.rpc.js | 2 +-
server/api/intFreshdeskField/index.js | 2 +-
.../intFreshdeskField.attributes.js | 2 +-
.../intFreshdeskField.controller.js | 2 +-
.../intFreshdeskField/intFreshdeskField.model.js | 2 +-
.../api/intFreshdeskField/intFreshdeskField.rpc.js | 2 +-
server/api/intFreshsalesAccount/index.js | 2 +-
.../intFreshsalesAccount.attributes.js | 2 +-
.../intFreshsalesAccount.controller.js | 2 +-
.../intFreshsalesAccount.model.js | 2 +-
.../intFreshsalesAccount.rpc.js | 2 +-
server/api/intFreshsalesConfiguration/index.js | 2 +-
.../intFreshsalesConfiguration.attributes.js | 2 +-
.../intFreshsalesConfiguration.controller.js | 2 +-
.../intFreshsalesConfiguration.model.js | 2 +-
.../intFreshsalesConfiguration.rpc.js | 2 +-
server/api/intFreshsalesField/index.js | 2 +-
.../intFreshsalesField.attributes.js | 2 +-
.../intFreshsalesField.controller.js | 2 +-
.../intFreshsalesField/intFreshsalesField.model.js | 2 +-
.../intFreshsalesField/intFreshsalesField.rpc.js | 2 +-
server/api/intSalesforceAccount/index.js | 2 +-
.../intSalesforceAccount.attributes.js | 2 +-
.../intSalesforceAccount.controller.js | 2 +-
.../intSalesforceAccount.model.js | 2 +-
.../intSalesforceAccount.rpc.js | 2 +-
server/api/intSalesforceConfiguration/index.js | 2 +-
.../intSalesforceConfiguration.attributes.js | 2 +-
.../intSalesforceConfiguration.controller.js | 2 +-
.../intSalesforceConfiguration.model.js | 2 +-
.../intSalesforceConfiguration.rpc.js | 2 +-
server/api/intSalesforceField/index.js | 2 +-
.../intSalesforceField.attributes.js | 2 +-
.../intSalesforceField.controller.js | 2 +-
.../intSalesforceField/intSalesforceField.model.js | 2 +-
.../intSalesforceField/intSalesforceField.rpc.js | 2 +-
server/api/intServicenowAccount/index.js | 2 +-
.../intServicenowAccount.attributes.js | 2 +-
.../intServicenowAccount.controller.js | 2 +-
.../intServicenowAccount.model.js | 2 +-
.../intServicenowAccount.rpc.js | 2 +-
server/api/intServicenowConfiguration/index.js | 2 +-
.../intServicenowConfiguration.attributes.js | 2 +-
.../intServicenowConfiguration.controller.js | 2 +-
.../intServicenowConfiguration.model.js | 2 +-
.../intServicenowConfiguration.rpc.js | 2 +-
server/api/intServicenowField/index.js | 2 +-
.../intServicenowField.attributes.js | 2 +-
.../intServicenowField.controller.js | 2 +-
.../intServicenowField/intServicenowField.model.js | 2 +-
.../intServicenowField/intServicenowField.rpc.js | 2 +-
server/api/intSugarcrmAccount/index.js | 2 +-
.../intSugarcrmAccount.attributes.js | 2 +-
.../intSugarcrmAccount.controller.js | 2 +-
.../intSugarcrmAccount/intSugarcrmAccount.model.js | 2 +-
.../intSugarcrmAccount/intSugarcrmAccount.rpc.js | 2 +-
server/api/intSugarcrmConfiguration/index.js | 2 +-
.../intSugarcrmConfiguration.attributes.js | 2 +-
.../intSugarcrmConfiguration.controller.js | 2 +-
.../intSugarcrmConfiguration.model.js | 2 +-
.../intSugarcrmConfiguration.rpc.js | 2 +-
server/api/intSugarcrmField/index.js | 2 +-
.../intSugarcrmField.attributes.js | 2 +-
.../intSugarcrmField.controller.js | 2 +-
.../api/intSugarcrmField/intSugarcrmField.model.js | 2 +-
.../api/intSugarcrmField/intSugarcrmField.rpc.js | 2 +-
server/api/intVtigerAccount/index.js | 2 +-
.../intVtigerAccount.attributes.js | 2 +-
.../intVtigerAccount.controller.js | 2 +-
.../api/intVtigerAccount/intVtigerAccount.model.js | 2 +-
.../api/intVtigerAccount/intVtigerAccount.rpc.js | 2 +-
server/api/intVtigerConfiguration/index.js | 2 +-
.../intVtigerConfiguration.attributes.js | 2 +-
.../intVtigerConfiguration.controller.js | 2 +-
.../intVtigerConfiguration.model.js | 2 +-
.../intVtigerConfiguration.rpc.js | 2 +-
server/api/intVtigerField/index.js | 2 +-
.../intVtigerField/intVtigerField.attributes.js | 2 +-
.../intVtigerField/intVtigerField.controller.js | 2 +-
server/api/intVtigerField/intVtigerField.model.js | 2 +-
server/api/intVtigerField/intVtigerField.rpc.js | 2 +-
server/api/intZendeskAccount/index.js | 2 +-
.../intZendeskAccount.attributes.js | 2 +-
.../intZendeskAccount.controller.js | 2 +-
.../intZendeskAccount/intZendeskAccount.model.js | 2 +-
.../api/intZendeskAccount/intZendeskAccount.rpc.js | 2 +-
server/api/intZendeskConfiguration/index.js | 2 +-
.../intZendeskConfiguration.attributes.js | 2 +-
.../intZendeskConfiguration.controller.js | 2 +-
.../intZendeskConfiguration.model.js | 2 +-
.../intZendeskConfiguration.rpc.js | 2 +-
server/api/intZendeskField/index.js | 2 +-
.../intZendeskField/intZendeskField.attributes.js | 2 +-
.../intZendeskField/intZendeskField.controller.js | 2 +-
.../api/intZendeskField/intZendeskField.model.js | 2 +-
server/api/intZendeskField/intZendeskField.rpc.js | 2 +-
server/api/intZohoAccount/index.js | 2 +-
.../intZohoAccount/intZohoAccount.attributes.js | 2 +-
.../intZohoAccount/intZohoAccount.controller.js | 2 +-
server/api/intZohoAccount/intZohoAccount.model.js | 2 +-
server/api/intZohoAccount/intZohoAccount.rpc.js | 2 +-
server/api/intZohoConfiguration/index.js | 2 +-
.../intZohoConfiguration.attributes.js | 2 +-
.../intZohoConfiguration.controller.js | 2 +-
.../intZohoConfiguration.model.js | 2 +-
.../intZohoConfiguration.rpc.js | 2 +-
server/api/intZohoField/index.js | 2 +-
server/api/intZohoField/intZohoField.attributes.js | 2 +-
server/api/intZohoField/intZohoField.controller.js | 2 +-
server/api/intZohoField/intZohoField.model.js | 2 +-
server/api/intZohoField/intZohoField.rpc.js | 2 +-
server/api/integration/index.js | 2 +-
server/api/integration/integration.attributes.js | 2 +-
server/api/integration/integration.controller.js | 2 +-
server/api/integration/integration.model.js | 2 +-
server/api/integration/integration.rpc.js | 2 +-
server/api/integrationReport/index.js | 2 +-
.../integrationReport.attributes.js | 2 +-
.../integrationReport.controller.js | 2 +-
.../integrationReport/integrationReport.model.js | 2 +-
.../api/integrationReport/integrationReport.rpc.js | 2 +-
server/api/interval/index.js | 2 +-
server/api/interval/interval.attributes.js | 2 +-
server/api/interval/interval.controller.js | 2 +-
server/api/interval/interval.model.js | 2 +-
server/api/interval/interval.rpc.js | 2 +-
server/api/jira/index.js | 2 +-
server/api/jira/jira.controller.js | 2 +-
server/api/jscriptyAnswerReport/index.js | 2 +-
.../jscriptyAnswerReport.attributes.js | 2 +-
.../jscriptyAnswerReport.controller.js | 2 +-
.../jscriptyAnswerReport.model.js | 2 +-
.../jscriptyAnswerReport.rpc.js | 2 +-
server/api/jscriptyProject/index.js | 2 +-
.../jscriptyProject/jscriptyProject.attributes.js | 2 +-
.../jscriptyProject/jscriptyProject.controller.js | 2 +-
.../api/jscriptyProject/jscriptyProject.model.js | 2 +-
server/api/jscriptyProject/jscriptyProject.rpc.js | 2 +-
server/api/jscriptyQuestionReport/index.js | 2 +-
.../jscriptyQuestionReport.attributes.js | 2 +-
.../jscriptyQuestionReport.controller.js | 2 +-
.../jscriptyQuestionReport.model.js | 2 +-
.../jscriptyQuestionReport.rpc.js | 2 +-
server/api/jscriptySessionReport/index.js | 2 +-
.../jscriptySessionReport.attributes.js | 2 +-
.../jscriptySessionReport.controller.js | 2 +-
.../jscriptySessionReport.model.js | 2 +-
.../jscriptySessionReport.rpc.js | 2 +-
server/api/license/index.js | 2 +-
server/api/license/license.attributes.js | 2 +-
server/api/license/license.controller.js | 2 +-
server/api/license/license.model.js | 2 +-
server/api/license/license.rpc.js | 2 +-
server/api/mailAccount/index.js | 2 +-
server/api/mailAccount/mailAccount.attributes.js | 2 +-
server/api/mailAccount/mailAccount.controller.js | 2 +-
server/api/mailAccount/mailAccount.events.js | 2 +-
server/api/mailAccount/mailAccount.model.js | 2 +-
server/api/mailAccount/mailAccount.rpc.js | 2 +-
server/api/mailAccount/mailAccount.socket.js | 2 +-
server/api/mailApplication/index.js | 2 +-
.../mailApplication/mailApplication.attributes.js | 2 +-
.../mailApplication/mailApplication.controller.js | 2 +-
.../api/mailApplication/mailApplication.model.js | 2 +-
server/api/mailApplication/mailApplication.rpc.js | 2 +-
server/api/mailInteraction/index.js | 2 +-
.../mailInteraction/mailInteraction.attributes.js | 2 +-
.../mailInteraction/mailInteraction.controller.js | 2 +-
.../api/mailInteraction/mailInteraction.events.js | 2 +-
.../api/mailInteraction/mailInteraction.model.js | 2 +-
server/api/mailInteraction/mailInteraction.rpc.js | 2 +-
.../api/mailInteraction/mailInteraction.socket.js | 2 +-
server/api/mailMessage/index.js | 2 +-
server/api/mailMessage/mailMessage.attributes.js | 2 +-
server/api/mailMessage/mailMessage.controller.js | 2 +-
server/api/mailMessage/mailMessage.events.js | 2 +-
server/api/mailMessage/mailMessage.model.js | 2 +-
server/api/mailMessage/mailMessage.rpc.js | 2 +-
server/api/mailMessage/mailMessage.socket.js | 2 +-
server/api/mailQueue/index.js | 2 +-
server/api/mailQueue/mailQueue.attributes.js | 2 +-
server/api/mailQueue/mailQueue.controller.js | 2 +-
server/api/mailQueue/mailQueue.events.js | 2 +-
server/api/mailQueue/mailQueue.model.js | 2 +-
server/api/mailQueue/mailQueue.rpc.js | 2 +-
server/api/mailQueue/mailQueue.socket.js | 2 +-
server/api/mailQueueReport/index.js | 2 +-
.../mailQueueReport/mailQueueReport.attributes.js | 2 +-
.../mailQueueReport/mailQueueReport.controller.js | 2 +-
.../api/mailQueueReport/mailQueueReport.model.js | 2 +-
server/api/mailQueueReport/mailQueueReport.rpc.js | 2 +-
server/api/mailServerIn/index.js | 2 +-
server/api/mailServerIn/mailServerIn.attributes.js | 2 +-
server/api/mailServerIn/mailServerIn.model.js | 2 +-
server/api/mailServerIn/mailServerIn.rpc.js | 2 +-
server/api/mailServerOut/index.js | 2 +-
.../api/mailServerOut/mailServerOut.attributes.js | 2 +-
.../api/mailServerOut/mailServerOut.controller.js | 2 +-
server/api/mailServerOut/mailServerOut.model.js | 2 +-
server/api/mailServerOut/mailServerOut.rpc.js | 2 +-
server/api/mailSubstatus/index.js | 2 +-
.../api/mailSubstatus/mailSubstatus.attributes.js | 2 +-
.../api/mailSubstatus/mailSubstatus.controller.js | 2 +-
server/api/mailSubstatus/mailSubstatus.model.js | 2 +-
server/api/mailSubstatus/mailSubstatus.rpc.js | 2 +-
server/api/mailTransferReport/index.js | 2 +-
.../mailTransferReport.attributes.js | 2 +-
.../mailTransferReport.controller.js | 2 +-
.../mailTransferReport/mailTransferReport.model.js | 2 +-
.../mailTransferReport/mailTransferReport.rpc.js | 2 +-
server/api/memberReport/index.js | 2 +-
server/api/memberReport/memberReport.attributes.js | 2 +-
server/api/memberReport/memberReport.controller.js | 2 +-
server/api/memberReport/memberReport.model.js | 2 +-
server/api/memberReport/memberReport.rpc.js | 2 +-
server/api/migration/index.js | 2 +-
server/api/migration/migration.attributes.js | 2 +-
server/api/migration/migration.controller.js | 2 +-
server/api/migration/migration.model.js | 2 +-
server/api/migration/migration.rpc.js | 2 +-
server/api/network/index.js | 2 +-
server/api/network/network.attributes.js | 2 +-
server/api/network/network.controller.js | 2 +-
server/api/network/network.model.js | 2 +-
server/api/network/network.rpc.js | 2 +-
server/api/openchannelAccount/index.js | 2 +-
.../openchannelAccount.attributes.js | 2 +-
.../openchannelAccount.controller.js | 2 +-
.../openchannelAccount.events.js | 2 +-
.../openchannelAccount/openchannelAccount.model.js | 2 +-
.../openchannelAccount/openchannelAccount.rpc.js | 2 +-
.../openchannelAccount.socket.js | 2 +-
server/api/openchannelApplication/index.js | 2 +-
.../openchannelApplication.attributes.js | 2 +-
.../openchannelApplication.controller.js | 2 +-
.../openchannelApplication.model.js | 2 +-
.../openchannelApplication.rpc.js | 2 +-
server/api/openchannelInteraction/index.js | 2 +-
.../openchannelInteraction.attributes.js | 2 +-
.../openchannelInteraction.controller.js | 2 +-
.../openchannelInteraction.events.js | 2 +-
.../openchannelInteraction.model.js | 2 +-
.../openchannelInteraction.rpc.js | 2 +-
.../openchannelInteraction.socket.js | 2 +-
server/api/openchannelMessage/index.js | 2 +-
.../openchannelMessage.attributes.js | 2 +-
.../openchannelMessage.controller.js | 2 +-
.../openchannelMessage.events.js | 2 +-
.../openchannelMessage/openchannelMessage.model.js | 2 +-
.../openchannelMessage/openchannelMessage.rpc.js | 2 +-
.../openchannelMessage.socket.js | 2 +-
server/api/openchannelQueue/index.js | 2 +-
.../openchannelQueue.attributes.js | 2 +-
.../openchannelQueue.controller.js | 2 +-
.../openchannelQueue/openchannelQueue.events.js | 2 +-
.../api/openchannelQueue/openchannelQueue.model.js | 2 +-
.../api/openchannelQueue/openchannelQueue.rpc.js | 2 +-
.../openchannelQueue/openchannelQueue.socket.js | 2 +-
server/api/openchannelQueueReport/index.js | 2 +-
.../openchannelQueueReport.attributes.js | 2 +-
.../openchannelQueueReport.controller.js | 2 +-
.../openchannelQueueReport.model.js | 2 +-
.../openchannelQueueReport.rpc.js | 2 +-
server/api/openchannelTransferReport/index.js | 2 +-
.../openchannelTransferReport.attributes.js | 2 +-
.../openchannelTransferReport.controller.js | 2 +-
.../openchannelTransferReport.model.js | 2 +-
.../openchannelTransferReport.rpc.js | 2 +-
server/api/pause/index.js | 2 +-
server/api/pause/pause.attributes.js | 2 +-
server/api/pause/pause.controller.js | 2 +-
server/api/pause/pause.model.js | 2 +-
server/api/pause/pause.rpc.js | 2 +-
server/api/plugin/index.js | 2 +-
server/api/plugin/plugin.attributes.js | 2 +-
server/api/plugin/plugin.controller.js | 2 +-
server/api/plugin/plugin.events.js | 2 +-
server/api/plugin/plugin.model.js | 2 +-
server/api/plugin/plugin.rpc.js | 2 +-
server/api/plugin/plugin.socket.js | 2 +-
server/api/pm2/index.js | 2 +-
server/api/pm2/pm2.controller.js | 2 +-
server/api/realtime/index.js | 2 +-
server/api/realtime/realtime.controller.js | 2 +-
server/api/realtime/realtime.model.js | 2 +-
server/api/reportAgentPreview/index.js | 2 +-
.../reportAgentPreview.attributes.js | 2 +-
.../reportAgentPreview/reportAgentPreview.model.js | 2 +-
.../reportAgentPreview/reportAgentPreview.rpc.js | 2 +-
server/api/rpc/index.js | 2 +-
server/api/rpc/rpc.controller.js | 2 +-
server/api/schedule/index.js | 2 +-
server/api/schedule/schedule.attributes.js | 2 +-
server/api/schedule/schedule.controller.js | 2 +-
server/api/schedule/schedule.model.js | 2 +-
server/api/schedule/schedule.rpc.js | 2 +-
server/api/screenRecording/index.js | 2 +-
.../screenRecording/screenRecording.attributes.js | 2 +-
.../screenRecording/screenRecording.controller.js | 2 +-
.../api/screenRecording/screenRecording.model.js | 2 +-
server/api/screenRecording/screenRecording.rpc.js | 2 +-
server/api/setting/index.js | 2 +-
server/api/setting/setting.attributes.js | 2 +-
server/api/setting/setting.controller.js | 2 +-
server/api/setting/setting.model.js | 2 +-
server/api/setting/setting.rpc.js | 2 +-
server/api/smsAccount/index.js | 2 +-
server/api/smsAccount/smsAccount.attributes.js | 2 +-
server/api/smsAccount/smsAccount.controller.js | 2 +-
server/api/smsAccount/smsAccount.events.js | 2 +-
server/api/smsAccount/smsAccount.model.js | 2 +-
server/api/smsAccount/smsAccount.rpc.js | 2 +-
server/api/smsAccount/smsAccount.socket.js | 2 +-
server/api/smsApplication/index.js | 2 +-
.../smsApplication/smsApplication.attributes.js | 2 +-
.../smsApplication/smsApplication.controller.js | 2 +-
server/api/smsApplication/smsApplication.model.js | 2 +-
server/api/smsApplication/smsApplication.rpc.js | 2 +-
server/api/smsInteraction/index.js | 2 +-
.../smsInteraction/smsInteraction.attributes.js | 2 +-
.../smsInteraction/smsInteraction.controller.js | 2 +-
server/api/smsInteraction/smsInteraction.events.js | 2 +-
server/api/smsInteraction/smsInteraction.model.js | 2 +-
server/api/smsInteraction/smsInteraction.rpc.js | 2 +-
server/api/smsInteraction/smsInteraction.socket.js | 2 +-
server/api/smsMessage/index.js | 2 +-
server/api/smsMessage/smsMessage.attributes.js | 2 +-
server/api/smsMessage/smsMessage.controller.js | 2 +-
server/api/smsMessage/smsMessage.events.js | 2 +-
server/api/smsMessage/smsMessage.model.js | 2 +-
server/api/smsMessage/smsMessage.rpc.js | 2 +-
server/api/smsMessage/smsMessage.socket.js | 2 +-
server/api/smsQueue/index.js | 2 +-
server/api/smsQueue/smsQueue.attributes.js | 2 +-
server/api/smsQueue/smsQueue.controller.js | 2 +-
server/api/smsQueue/smsQueue.events.js | 2 +-
server/api/smsQueue/smsQueue.model.js | 2 +-
server/api/smsQueue/smsQueue.rpc.js | 2 +-
server/api/smsQueue/smsQueue.socket.js | 2 +-
server/api/smsQueueReport/index.js | 2 +-
.../smsQueueReport/smsQueueReport.attributes.js | 2 +-
.../smsQueueReport/smsQueueReport.controller.js | 2 +-
server/api/smsQueueReport/smsQueueReport.model.js | 2 +-
server/api/smsQueueReport/smsQueueReport.rpc.js | 2 +-
server/api/smsTransferReport/index.js | 2 +-
.../smsTransferReport.attributes.js | 2 +-
.../smsTransferReport.controller.js | 2 +-
.../smsTransferReport/smsTransferReport.model.js | 2 +-
.../api/smsTransferReport/smsTransferReport.rpc.js | 2 +-
server/api/sound/index.js | 2 +-
server/api/sound/sound.attributes.js | 2 +-
server/api/sound/sound.controller.js | 2 +-
server/api/sound/sound.model.js | 2 +-
server/api/sound/sound.rpc.js | 2 +-
server/api/squareMessage/index.js | 2 +-
.../api/squareMessage/squareMessage.attributes.js | 2 +-
.../api/squareMessage/squareMessage.controller.js | 2 +-
server/api/squareMessage/squareMessage.model.js | 2 +-
server/api/squareMessage/squareMessage.rpc.js | 2 +-
server/api/squareOdbc/index.js | 2 +-
server/api/squareOdbc/squareOdbc.attributes.js | 2 +-
server/api/squareOdbc/squareOdbc.controller.js | 2 +-
server/api/squareOdbc/squareOdbc.model.js | 2 +-
server/api/squareOdbc/squareOdbc.rpc.js | 2 +-
server/api/squareProject/index.js | 2 +-
.../api/squareProject/squareProject.attributes.js | 2 +-
.../api/squareProject/squareProject.controller.js | 2 +-
server/api/squareProject/squareProject.events.js | 2 +-
server/api/squareProject/squareProject.model.js | 2 +-
server/api/squareProject/squareProject.rpc.js | 2 +-
server/api/squareProject/squareProject.socket.js | 2 +-
server/api/squareRecording/index.js | 2 +-
.../squareRecording/squareRecording.attributes.js | 2 +-
.../squareRecording/squareRecording.controller.js | 2 +-
.../api/squareRecording/squareRecording.model.js | 2 +-
server/api/squareRecording/squareRecording.rpc.js | 2 +-
server/api/squareReport/index.js | 2 +-
server/api/squareReport/squareReport.attributes.js | 2 +-
server/api/squareReport/squareReport.controller.js | 2 +-
server/api/squareReport/squareReport.model.js | 2 +-
server/api/squareReport/squareReport.rpc.js | 2 +-
server/api/squareReportDetail/index.js | 2 +-
.../squareReportDetail.attributes.js | 2 +-
.../squareReportDetail.controller.js | 2 +-
.../squareReportDetail/squareReportDetail.model.js | 2 +-
.../squareReportDetail/squareReportDetail.rpc.js | 2 +-
server/api/system/index.js | 2 +-
server/api/system/system.controller.js | 2 +-
server/api/tag/index.js | 2 +-
server/api/tag/tag.attributes.js | 2 +-
server/api/tag/tag.controller.js | 2 +-
server/api/tag/tag.model.js | 2 +-
server/api/tag/tag.rpc.js | 2 +-
server/api/team/index.js | 2 +-
server/api/team/team.attributes.js | 2 +-
server/api/team/team.controller.js | 2 +-
server/api/team/team.events.js | 2 +-
server/api/team/team.model.js | 2 +-
server/api/team/team.rpc.js | 2 +-
server/api/team/team.socket.js | 2 +-
server/api/teamVoiceQueue/index.js | 2 +-
.../teamVoiceQueue/teamVoiceQueue.attributes.js | 2 +-
server/api/teamVoiceQueue/teamVoiceQueue.model.js | 2 +-
server/api/teamVoiceQueue/teamVoiceQueue.rpc.js | 2 +-
server/api/template/index.js | 2 +-
server/api/template/template.attributes.js | 2 +-
server/api/template/template.controller.js | 2 +-
server/api/template/template.model.js | 2 +-
server/api/template/template.rpc.js | 2 +-
server/api/trigger/index.js | 2 +-
server/api/trigger/trigger.attributes.js | 2 +-
server/api/trigger/trigger.controller.js | 2 +-
server/api/trigger/trigger.model.js | 2 +-
server/api/trigger/trigger.rpc.js | 2 +-
server/api/trunk/index.js | 2 +-
server/api/trunk/trunk.attributes.js | 2 +-
server/api/trunk/trunk.controller.js | 2 +-
server/api/trunk/trunk.model.js | 2 +-
server/api/trunk/trunk.rpc.js | 2 +-
server/api/user/index.js | 2 +-
server/api/user/user.attributes.js | 2 +-
server/api/user/user.controller.js | 2 +-
server/api/user/user.events.js | 2 +-
server/api/user/user.model.js | 2 +-
server/api/user/user.rpc.js | 2 +-
server/api/user/user.socket.js | 2 +-
server/api/userChatQueue/index.js | 2 +-
.../api/userChatQueue/userChatQueue.attributes.js | 2 +-
server/api/userChatQueue/userChatQueue.model.js | 2 +-
server/api/userChatQueue/userChatQueue.rpc.js | 2 +-
server/api/userFaxQueue/index.js | 2 +-
server/api/userFaxQueue/userFaxQueue.attributes.js | 2 +-
server/api/userFaxQueue/userFaxQueue.model.js | 2 +-
server/api/userFaxQueue/userFaxQueue.rpc.js | 2 +-
server/api/userMailQueue/index.js | 2 +-
.../api/userMailQueue/userMailQueue.attributes.js | 2 +-
server/api/userMailQueue/userMailQueue.model.js | 2 +-
server/api/userMailQueue/userMailQueue.rpc.js | 2 +-
server/api/userNotification/index.js | 2 +-
.../userNotification.attributes.js | 2 +-
.../userNotification.controller.js | 2 +-
.../userNotification/userNotification.events.js | 2 +-
.../api/userNotification/userNotification.model.js | 2 +-
.../api/userNotification/userNotification.rpc.js | 2 +-
.../userNotification/userNotification.socket.js | 2 +-
server/api/userOpenchannelQueue/index.js | 2 +-
.../userOpenchannelQueue.attributes.js | 2 +-
.../userOpenchannelQueue.model.js | 2 +-
.../userOpenchannelQueue.rpc.js | 2 +-
server/api/userProfile/index.js | 2 +-
server/api/userProfile/userProfile.attributes.js | 2 +-
server/api/userProfile/userProfile.controller.js | 2 +-
server/api/userProfile/userProfile.events.js | 2 +-
server/api/userProfile/userProfile.model.js | 2 +-
server/api/userProfile/userProfile.rpc.js | 2 +-
server/api/userProfile/userProfile.socket.js | 2 +-
server/api/userProfileResource/index.js | 2 +-
.../userProfileResource.attributes.js | 2 +-
.../userProfileResource.controller.js | 2 +-
.../userProfileResource.model.js | 2 +-
.../userProfileResource/userProfileResource.rpc.js | 2 +-
server/api/userProfileSection/index.js | 2 +-
.../userProfileSection.attributes.js | 2 +-
.../userProfileSection.controller.js | 2 +-
.../userProfileSection/userProfileSection.model.js | 2 +-
.../userProfileSection/userProfileSection.rpc.js | 2 +-
server/api/userSmsQueue/index.js | 2 +-
server/api/userSmsQueue/userSmsQueue.attributes.js | 2 +-
server/api/userSmsQueue/userSmsQueue.model.js | 2 +-
server/api/userSmsQueue/userSmsQueue.rpc.js | 2 +-
server/api/userVoiceQueue/index.js | 2 +-
.../userVoiceQueue/userVoiceQueue.attributes.js | 2 +-
server/api/userVoiceQueue/userVoiceQueue.model.js | 2 +-
server/api/userVoiceQueue/userVoiceQueue.rpc.js | 2 +-
server/api/userVoiceQueueRt/index.js | 2 +-
.../userVoiceQueueRt.attributes.js | 2 +-
.../userVoiceQueueRt/userVoiceQueueRt.events.js | 2 +-
.../api/userVoiceQueueRt/userVoiceQueueRt.model.js | 2 +-
.../api/userVoiceQueueRt/userVoiceQueueRt.rpc.js | 2 +-
.../userVoiceQueueRt/userVoiceQueueRt.socket.js | 2 +-
server/api/userWhatsappQueue/index.js | 2 +-
.../userWhatsappQueue.attributes.js | 2 +-
.../userWhatsappQueue/userWhatsappQueue.model.js | 2 +-
.../api/userWhatsappQueue/userWhatsappQueue.rpc.js | 2 +-
server/api/variable/index.js | 2 +-
server/api/variable/variable.attributes.js | 2 +-
server/api/variable/variable.controller.js | 2 +-
server/api/variable/variable.model.js | 2 +-
server/api/variable/variable.rpc.js | 2 +-
server/api/version/index.js | 2 +-
server/api/version/version.controller.js | 2 +-
server/api/voiceAgentReport/index.js | 2 +-
.../voiceAgentReport.attributes.js | 2 +-
.../voiceAgentReport.controller.js | 2 +-
.../api/voiceAgentReport/voiceAgentReport.model.js | 2 +-
.../api/voiceAgentReport/voiceAgentReport.rpc.js | 2 +-
server/api/voiceCallReport/index.js | 2 +-
.../voiceCallReport/voiceCallReport.attributes.js | 2 +-
.../voiceCallReport/voiceCallReport.controller.js | 2 +-
.../api/voiceCallReport/voiceCallReport.model.js | 2 +-
server/api/voiceCallReport/voiceCallReport.rpc.js | 2 +-
server/api/voiceChanSpy/index.js | 2 +-
server/api/voiceChanSpy/voiceChanSpy.attributes.js | 2 +-
server/api/voiceChanSpy/voiceChanSpy.controller.js | 2 +-
server/api/voiceChanSpy/voiceChanSpy.model.js | 2 +-
server/api/voiceChanSpy/voiceChanSpy.rpc.js | 2 +-
server/api/voiceContext/index.js | 2 +-
server/api/voiceContext/voiceContext.attributes.js | 2 +-
server/api/voiceContext/voiceContext.controller.js | 2 +-
server/api/voiceContext/voiceContext.model.js | 2 +-
server/api/voiceContext/voiceContext.rpc.js | 2 +-
server/api/voiceDialReport/index.js | 2 +-
.../voiceDialReport/voiceDialReport.attributes.js | 2 +-
.../voiceDialReport/voiceDialReport.controller.js | 2 +-
.../api/voiceDialReport/voiceDialReport.model.js | 2 +-
server/api/voiceDialReport/voiceDialReport.rpc.js | 2 +-
server/api/voiceExtension/index.js | 2 +-
.../voiceExtension/voiceExtension.attributes.js | 2 +-
.../voiceExtension/voiceExtension.controller.js | 2 +-
server/api/voiceExtension/voiceExtension.events.js | 2 +-
server/api/voiceExtension/voiceExtension.model.js | 2 +-
server/api/voiceExtension/voiceExtension.rpc.js | 2 +-
server/api/voiceExtension/voiceExtension.socket.js | 2 +-
server/api/voiceMail/index.js | 2 +-
server/api/voiceMail/voiceMail.attributes.js | 2 +-
server/api/voiceMail/voiceMail.controller.js | 2 +-
server/api/voiceMail/voiceMail.model.js | 2 +-
server/api/voiceMail/voiceMail.rpc.js | 2 +-
server/api/voiceMailMessage/index.js | 2 +-
.../voiceMailMessage.attributes.js | 2 +-
.../voiceMailMessage.controller.js | 2 +-
.../api/voiceMailMessage/voiceMailMessage.model.js | 2 +-
.../api/voiceMailMessage/voiceMailMessage.rpc.js | 2 +-
server/api/voiceMusicOnHold/index.js | 2 +-
.../voiceMusicOnHold.attributes.js | 2 +-
.../voiceMusicOnHold.controller.js | 2 +-
.../api/voiceMusicOnHold/voiceMusicOnHold.model.js | 2 +-
.../api/voiceMusicOnHold/voiceMusicOnHold.rpc.js | 2 +-
server/api/voicePrefix/index.js | 2 +-
server/api/voicePrefix/voicePrefix.attributes.js | 2 +-
server/api/voicePrefix/voicePrefix.controller.js | 2 +-
server/api/voicePrefix/voicePrefix.events.js | 2 +-
server/api/voicePrefix/voicePrefix.model.js | 2 +-
server/api/voicePrefix/voicePrefix.rpc.js | 2 +-
server/api/voicePrefix/voicePrefix.socket.js | 2 +-
server/api/voiceQueue/index.js | 2 +-
server/api/voiceQueue/voiceQueue.attributes.js | 2 +-
server/api/voiceQueue/voiceQueue.controller.js | 2 +-
server/api/voiceQueue/voiceQueue.events.js | 2 +-
server/api/voiceQueue/voiceQueue.model.js | 2 +-
server/api/voiceQueue/voiceQueue.rpc.js | 2 +-
server/api/voiceQueue/voiceQueue.socket.js | 2 +-
server/api/voiceQueueReport/index.js | 2 +-
.../voiceQueueReport.attributes.js | 2 +-
.../voiceQueueReport.controller.js | 2 +-
.../voiceQueueReport/voiceQueueReport.events.js | 2 +-
.../api/voiceQueueReport/voiceQueueReport.model.js | 2 +-
.../api/voiceQueueReport/voiceQueueReport.rpc.js | 2 +-
.../voiceQueueReport/voiceQueueReport.socket.js | 2 +-
server/api/voiceQueuesLog/index.js | 2 +-
.../voiceQueuesLog/voiceQueuesLog.attributes.js | 2 +-
.../voiceQueuesLog/voiceQueuesLog.controller.js | 2 +-
server/api/voiceQueuesLog/voiceQueuesLog.model.js | 2 +-
server/api/voiceQueuesLog/voiceQueuesLog.rpc.js | 2 +-
server/api/voiceRecording/index.js | 2 +-
.../voiceRecording/voiceRecording.attributes.js | 2 +-
.../voiceRecording/voiceRecording.controller.js | 2 +-
server/api/voiceRecording/voiceRecording.model.js | 2 +-
server/api/voiceRecording/voiceRecording.rpc.js | 2 +-
server/api/voiceTransferReport/index.js | 2 +-
.../voiceTransferReport.attributes.js | 2 +-
.../voiceTransferReport.controller.js | 2 +-
.../voiceTransferReport.model.js | 2 +-
.../voiceTransferReport/voiceTransferReport.rpc.js | 2 +-
server/api/webbar/index.js | 2 +-
server/api/webbar/webbar.controller.js | 2 +-
server/api/whatsappAccount/index.js | 2 +-
.../whatsappAccount/whatsappAccount.attributes.js | 2 +-
.../whatsappAccount/whatsappAccount.controller.js | 2 +-
.../api/whatsappAccount/whatsappAccount.events.js | 2 +-
.../api/whatsappAccount/whatsappAccount.model.js | 2 +-
server/api/whatsappAccount/whatsappAccount.rpc.js | 2 +-
.../api/whatsappAccount/whatsappAccount.socket.js | 2 +-
server/api/whatsappApplication/index.js | 2 +-
.../whatsappApplication.attributes.js | 2 +-
.../whatsappApplication.controller.js | 2 +-
.../whatsappApplication.model.js | 2 +-
.../whatsappApplication/whatsappApplication.rpc.js | 2 +-
server/api/whatsappInteraction/index.js | 2 +-
.../whatsappInteraction.attributes.js | 2 +-
.../whatsappInteraction.controller.js | 2 +-
.../whatsappInteraction.events.js | 2 +-
.../whatsappInteraction.model.js | 2 +-
.../whatsappInteraction/whatsappInteraction.rpc.js | 2 +-
.../whatsappInteraction.socket.js | 2 +-
server/api/whatsappMessage/index.js | 2 +-
.../whatsappMessage/whatsappMessage.attributes.js | 2 +-
.../whatsappMessage/whatsappMessage.controller.js | 2 +-
.../api/whatsappMessage/whatsappMessage.events.js | 2 +-
.../api/whatsappMessage/whatsappMessage.model.js | 2 +-
server/api/whatsappMessage/whatsappMessage.rpc.js | 2 +-
.../api/whatsappMessage/whatsappMessage.socket.js | 2 +-
server/api/whatsappQueue/index.js | 2 +-
.../api/whatsappQueue/whatsappQueue.attributes.js | 2 +-
.../api/whatsappQueue/whatsappQueue.controller.js | 2 +-
server/api/whatsappQueue/whatsappQueue.events.js | 2 +-
server/api/whatsappQueue/whatsappQueue.model.js | 2 +-
server/api/whatsappQueue/whatsappQueue.rpc.js | 2 +-
server/api/whatsappQueue/whatsappQueue.socket.js | 2 +-
server/api/whatsappQueueReport/index.js | 2 +-
.../whatsappQueueReport.attributes.js | 2 +-
.../whatsappQueueReport.controller.js | 2 +-
.../whatsappQueueReport.model.js | 2 +-
.../whatsappQueueReport/whatsappQueueReport.rpc.js | 2 +-
server/api/whatsappTransferReport/index.js | 2 +-
.../whatsappTransferReport.attributes.js | 2 +-
.../whatsappTransferReport.controller.js | 2 +-
.../whatsappTransferReport.model.js | 2 +-
.../whatsappTransferReport.rpc.js | 2 +-
server/app.js | 2 +-
server/components/auth/service.js | 2 +-
server/components/encryptor/index.js | 2 +-
server/components/export/csv.js | 2 +-
server/components/export/pdf.js | 2 +-
server/components/export/xlsx.js | 2 +-
server/components/extensions/rewrite.js | 2 +-
server/components/import/cm/csv.js | 2 +-
server/components/import/cm/csv2.js | 2 +-
server/components/import/cm/csvUpdates.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/additionalPhone.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/cmHopperAdditionalPhone.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 +-
1166 files changed, 1166 insertions(+), 1166 deletions(-)
diff --git a/apidoc/api_project.js b/apidoc/api_project.js
index 26ac1c8..0506226 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-24T15:12:00.018Z",
+ "time": "2021-08-24T15:20:17.729Z",
"url": "http://apidocjs.com",
"version": "0.24.0"
}
diff --git a/apidoc/api_project.json b/apidoc/api_project.json
index ebb7023..4145310 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-24T15:12:00.018Z",
+ "time": "2021-08-24T15:20:17.729Z",
"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 2704a5f..f59f7f7 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 _0xf3ff=['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)]','integration[AccountId],\x20motionbar[TemplateId,URL,WinAppPath],\x20urlForward[URL]','motionbar[NULL,NULL,WinAppArguments]','TEXT','sequelize','exports','VIRTUAL','getDataValue','action','STRING','contactManager','integration','motionbar','urlForward'];(function(_0x520401,_0x6a3ccc){var _0x250325=function(_0x53f3c3){while(--_0x53f3c3){_0x520401['push'](_0x520401['shift']());}};_0x250325(++_0x6a3ccc);}(_0xf3ff,0x104));var _0xff3f=function(_0x202a07,_0x3b0cec){_0x202a07=_0x202a07-0x0;var _0x4c966f=_0xf3ff[_0x202a07];return _0x4c966f;};'use strict';var Sequelize=require(_0xff3f('0x0'));module[_0xff3f('0x1')]={'name':{'type':Sequelize[_0xff3f('0x2')],'get':function(_0x40c978){return this[_0xff3f('0x3')](_0xff3f('0x4'));}},'action':{'type':Sequelize[_0xff3f('0x5')],'allowNull':![],'validate':{'isIn':{'args':[[_0xff3f('0x6'),_0xff3f('0x7'),_0xff3f('0x8'),'jscripty',_0xff3f('0x9'),'browser','bot','script']],'msg':_0xff3f('0xa')}},'comment':_0xff3f('0xa')},'data1':{'type':Sequelize['STRING'](0x1000),'comment':_0xff3f('0xb')},'data2':{'type':Sequelize[_0xff3f('0x5')](0x1000),'comment':_0xff3f('0xc')},'data3':{'type':Sequelize[_0xff3f('0x5')](0x1000),'comment':_0xff3f('0xd')},'data4':{'type':Sequelize[_0xff3f('0x5')](0x1000)},'data5':{'type':Sequelize['STRING'](0x1000)},'data6':{'type':Sequelize['STRING']},'data7':{'type':Sequelize[_0xff3f('0xe')]}};
\ No newline at end of file
+var _0xbd4d=['STRING','contactManager','urlForward','browser','bot','script','Allowed\x20values:\x20contactManager,\x20integration,\x20motionbar,\x20jscripty,\x20urlForward,\x20browser,\x20bot,\x20script','integration[AccountId],\x20motionbar[TemplateId,URL,WinAppPath],\x20urlForward[URL]','motionbar[NULL,NULL,WinAppArguments]','TEXT','sequelize','exports','action'];(function(_0x46a8b5,_0x5bdeb9){var _0x18588e=function(_0x283553){while(--_0x283553){_0x46a8b5['push'](_0x46a8b5['shift']());}};_0x18588e(++_0x5bdeb9);}(_0xbd4d,0x1eb));var _0xdbd4=function(_0x29d915,_0x54a040){_0x29d915=_0x29d915-0x0;var _0x160f86=_0xbd4d[_0x29d915];return _0x160f86;};'use strict';var Sequelize=require(_0xdbd4('0x0'));module[_0xdbd4('0x1')]={'name':{'type':Sequelize['VIRTUAL'],'get':function(_0x38b926){return this['getDataValue'](_0xdbd4('0x2'));}},'action':{'type':Sequelize[_0xdbd4('0x3')],'allowNull':![],'validate':{'isIn':{'args':[[_0xdbd4('0x4'),'integration','motionbar','jscripty',_0xdbd4('0x5'),_0xdbd4('0x6'),_0xdbd4('0x7'),_0xdbd4('0x8')]],'msg':_0xdbd4('0x9')}},'comment':_0xdbd4('0x9')},'data1':{'type':Sequelize[_0xdbd4('0x3')](0x1000),'comment':'contactManager[ListId],\x20integration[intName(zendesk)],\x20motionbar[Popup(0),URL(1),WinApp(2)],\x20urlForward[GET,POST],\x20browser[TemplateId(0),URL(1)]'},'data2':{'type':Sequelize[_0xdbd4('0x3')](0x1000),'comment':_0xdbd4('0xa')},'data3':{'type':Sequelize['STRING'](0x1000),'comment':_0xdbd4('0xb')},'data4':{'type':Sequelize[_0xdbd4('0x3')](0x1000)},'data5':{'type':Sequelize[_0xdbd4('0x3')](0x1000)},'data6':{'type':Sequelize['STRING']},'data7':{'type':Sequelize[_0xdbd4('0xc')]}};
\ No newline at end of file
diff --git a/server/api/action/action.controller.js b/server/api/action/action.controller.js
index 00c466e..eb984cb 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 _0xbdde=['find','request-promise','bluebird','mustache','util','sox','to-csv','fs-extra','lodash','squel','crypto','jsforce','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','status','offset','undefined','count','limit','json','apply','reject','save','update','then','destroy','end','sendStatus','error','name','send','body','params','catch','Action'];(function(_0x94b169,_0x5df9e5){var _0x14434c=function(_0x46593c){while(--_0x46593c){_0x94b169['push'](_0x94b169['shift']());}};_0x14434c(++_0x5df9e5);}(_0xbdde,0x12e));var _0xebdd=function(_0x250453,_0x2a0799){_0x250453=_0x250453-0x0;var _0x471c1a=_0xbdde[_0x250453];return _0x471c1a;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0xebdd('0x0'));var moment=require('moment');var BPromise=require(_0xebdd('0x1'));var Mustache=require(_0xebdd('0x2'));var util=require(_0xebdd('0x3'));var path=require('path');var sox=require(_0xebdd('0x4'));var csv=require(_0xebdd('0x5'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xebdd('0x6'));var _=require(_0xebdd('0x7'));var squel=require(_0xebdd('0x8'));var crypto=require(_0xebdd('0x9'));var jsforce=require(_0xebdd('0xa'));var deskjs=require('desk.js');var toCsv=require(_0xebdd('0x5'));var querystring=require(_0xebdd('0xb'));var Papa=require(_0xebdd('0xc'));var Redis=require(_0xebdd('0xd'));var authService=require('../../components/auth/service');var qs=require(_0xebdd('0xe'));var as=require(_0xebdd('0xf'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xebdd('0x10'))(_0xebdd('0x11'));var utils=require(_0xebdd('0x12'));var config=require(_0xebdd('0x13'));var licenseUtil=require(_0xebdd('0x14'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x7e35ac,_0x1f566a){_0x1f566a=_0x1f566a||0xcc;return function(_0x39050c){if(_0x39050c){return _0x7e35ac['sendStatus'](_0x1f566a);}return _0x7e35ac[_0xebdd('0x15')](_0x1f566a)['end']();};}function respondWithResult(_0x1dbe68,_0xf3d997){_0xf3d997=_0xf3d997||0xc8;return function(_0x57e83d){if(_0x57e83d){return _0x1dbe68['status'](_0xf3d997)['json'](_0x57e83d);}};}function respondWithFilteredResult(_0x1bc740,_0x611915){return function(_0x18640e){if(_0x18640e){var _0x747cb5=typeof _0x611915[_0xebdd('0x16')]==='undefined'&&typeof _0x611915['limit']===_0xebdd('0x17');var _0x37b220=_0x18640e['count'];var _0x438e27=_0x747cb5?0x0:_0x611915[_0xebdd('0x16')];var _0x49d72e=_0x747cb5?_0x18640e[_0xebdd('0x18')]:_0x611915[_0xebdd('0x16')]+_0x611915[_0xebdd('0x19')];var _0x42d3be;if(_0x49d72e>=_0x37b220){_0x49d72e=_0x37b220;_0x42d3be=0xc8;}else{_0x42d3be=0xce;}_0x1bc740[_0xebdd('0x15')](_0x42d3be);return _0x1bc740['set']('Content-Range',_0x438e27+'-'+_0x49d72e+'/'+_0x37b220)[_0xebdd('0x1a')](_0x18640e);}return null;};}function patchUpdates(_0x312e5c){return function(_0x49339a){try{jsonpatch[_0xebdd('0x1b')](_0x49339a,_0x312e5c,!![]);}catch(_0x1875b1){return BPromise[_0xebdd('0x1c')](_0x1875b1);}return _0x49339a[_0xebdd('0x1d')]();};}function saveUpdates(_0x32ca78,_0x295d51){return function(_0x1b9452){if(_0x1b9452){return _0x1b9452[_0xebdd('0x1e')](_0x32ca78)[_0xebdd('0x1f')](function(_0x1febc2){return _0x1febc2;});}return null;};}function removeEntity(_0x2eb6a0,_0x4ac289){return function(_0x855255){if(_0x855255){return _0x855255[_0xebdd('0x20')]()[_0xebdd('0x1f')](function(){_0x2eb6a0['status'](0xcc)[_0xebdd('0x21')]();});}};}function handleEntityNotFound(_0x33d18c,_0xb3fbc4){return function(_0x50d3ee){if(!_0x50d3ee){_0x33d18c[_0xebdd('0x22')](0x194);}return _0x50d3ee;};}function handleError(_0x203fc7,_0x26045f){_0x26045f=_0x26045f||0x1f4;return function(_0x32c075){logger[_0xebdd('0x23')](_0x32c075['stack']);if(_0x32c075[_0xebdd('0x24')]){delete _0x32c075['name'];}_0x203fc7[_0xebdd('0x15')](_0x26045f)[_0xebdd('0x25')](_0x32c075);};}exports[_0xebdd('0x1e')]=function(_0x5f4b63,_0x50cd4a){if(_0x5f4b63[_0xebdd('0x26')]['id']){delete _0x5f4b63['body']['id'];}return db['Action']['find']({'where':{'id':_0x5f4b63[_0xebdd('0x27')]['id']}})[_0xebdd('0x1f')](handleEntityNotFound(_0x50cd4a,null))[_0xebdd('0x1f')](saveUpdates(_0x5f4b63[_0xebdd('0x26')],null))[_0xebdd('0x1f')](respondWithResult(_0x50cd4a,null))[_0xebdd('0x28')](handleError(_0x50cd4a,null));};exports['destroy']=function(_0x5c4757,_0x52849b){return db[_0xebdd('0x29')][_0xebdd('0x2a')]({'where':{'id':_0x5c4757['params']['id']}})[_0xebdd('0x1f')](handleEntityNotFound(_0x52849b,null))[_0xebdd('0x1f')](removeEntity(_0x52849b,null))['catch'](handleError(_0x52849b,null));};
\ No newline at end of file
+var _0x03c3=['name','send','body','Action','find','params','catch','eml-format','rimraf','request-promise','moment','bluebird','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','api','../../config/environment','../../config/license/util','sendStatus','status','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','then','destroy','end','error'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x03c3,0xf2));var _0x303c=function(_0x8a3dee,_0x37f627){_0x8a3dee=_0x8a3dee-0x0;var _0x3a8474=_0x03c3[_0x8a3dee];return _0x3a8474;};'use strict';var emlformat=require(_0x303c('0x0'));var rimraf=require(_0x303c('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x303c('0x2'));var moment=require(_0x303c('0x3'));var BPromise=require(_0x303c('0x4'));var Mustache=require('mustache');var util=require(_0x303c('0x5'));var path=require(_0x303c('0x6'));var sox=require(_0x303c('0x7'));var csv=require(_0x303c('0x8'));var ejs=require(_0x303c('0x9'));var fs=require('fs');var fs_extra=require(_0x303c('0xa'));var _=require(_0x303c('0xb'));var squel=require(_0x303c('0xc'));var crypto=require(_0x303c('0xd'));var jsforce=require('jsforce');var deskjs=require(_0x303c('0xe'));var toCsv=require(_0x303c('0x8'));var querystring=require(_0x303c('0xf'));var Papa=require('papaparse');var Redis=require(_0x303c('0x10'));var authService=require(_0x303c('0x11'));var qs=require(_0x303c('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x303c('0x13'));var logger=require('../../config/logger')(_0x303c('0x14'));var utils=require('../../config/utils');var config=require(_0x303c('0x15'));var licenseUtil=require(_0x303c('0x16'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x1a8122,_0xda684f){_0xda684f=_0xda684f||0xcc;return function(_0x328d27){if(_0x328d27){return _0x1a8122[_0x303c('0x17')](_0xda684f);}return _0x1a8122[_0x303c('0x18')](_0xda684f)['end']();};}function respondWithResult(_0x5ea30e,_0x7f58ef){_0x7f58ef=_0x7f58ef||0xc8;return function(_0x277bda){if(_0x277bda){return _0x5ea30e[_0x303c('0x18')](_0x7f58ef)[_0x303c('0x19')](_0x277bda);}};}function respondWithFilteredResult(_0x4b239f,_0x10d42c){return function(_0x2fe6f9){if(_0x2fe6f9){var _0x9869e6=typeof _0x10d42c[_0x303c('0x1a')]===_0x303c('0x1b')&&typeof _0x10d42c[_0x303c('0x1c')]==='undefined';var _0x2628cd=_0x2fe6f9[_0x303c('0x1d')];var _0x366833=_0x9869e6?0x0:_0x10d42c[_0x303c('0x1a')];var _0x3282c2=_0x9869e6?_0x2fe6f9[_0x303c('0x1d')]:_0x10d42c[_0x303c('0x1a')]+_0x10d42c['limit'];var _0x2061af;if(_0x3282c2>=_0x2628cd){_0x3282c2=_0x2628cd;_0x2061af=0xc8;}else{_0x2061af=0xce;}_0x4b239f['status'](_0x2061af);return _0x4b239f[_0x303c('0x1e')](_0x303c('0x1f'),_0x366833+'-'+_0x3282c2+'/'+_0x2628cd)[_0x303c('0x19')](_0x2fe6f9);}return null;};}function patchUpdates(_0x43a31c){return function(_0x4697d4){try{jsonpatch[_0x303c('0x20')](_0x4697d4,_0x43a31c,!![]);}catch(_0x3c8dad){return BPromise[_0x303c('0x21')](_0x3c8dad);}return _0x4697d4[_0x303c('0x22')]();};}function saveUpdates(_0x2d1361,_0x1bc66e){return function(_0x1a5a1d){if(_0x1a5a1d){return _0x1a5a1d[_0x303c('0x23')](_0x2d1361)[_0x303c('0x24')](function(_0x1c2123){return _0x1c2123;});}return null;};}function removeEntity(_0x2c566a,_0x4fb59f){return function(_0x16edcb){if(_0x16edcb){return _0x16edcb[_0x303c('0x25')]()[_0x303c('0x24')](function(){_0x2c566a[_0x303c('0x18')](0xcc)[_0x303c('0x26')]();});}};}function handleEntityNotFound(_0x2430e7,_0x3fc9dd){return function(_0x5754bb){if(!_0x5754bb){_0x2430e7['sendStatus'](0x194);}return _0x5754bb;};}function handleError(_0x3d7107,_0x4a23ec){_0x4a23ec=_0x4a23ec||0x1f4;return function(_0x15c62b){logger[_0x303c('0x27')](_0x15c62b['stack']);if(_0x15c62b[_0x303c('0x28')]){delete _0x15c62b[_0x303c('0x28')];}_0x3d7107[_0x303c('0x18')](_0x4a23ec)[_0x303c('0x29')](_0x15c62b);};}exports[_0x303c('0x23')]=function(_0x158fda,_0x292ddb){if(_0x158fda[_0x303c('0x2a')]['id']){delete _0x158fda[_0x303c('0x2a')]['id'];}return db[_0x303c('0x2b')][_0x303c('0x2c')]({'where':{'id':_0x158fda[_0x303c('0x2d')]['id']}})['then'](handleEntityNotFound(_0x292ddb,null))[_0x303c('0x24')](saveUpdates(_0x158fda[_0x303c('0x2a')],null))[_0x303c('0x24')](respondWithResult(_0x292ddb,null))['catch'](handleError(_0x292ddb,null));};exports[_0x303c('0x25')]=function(_0x50e8db,_0x1d5ac5){return db[_0x303c('0x2b')][_0x303c('0x2c')]({'where':{'id':_0x50e8db[_0x303c('0x2d')]['id']}})[_0x303c('0x24')](handleEntityNotFound(_0x1d5ac5,null))[_0x303c('0x24')](removeEntity(_0x1d5ac5,null))[_0x303c('0x2e')](handleError(_0x1d5ac5,null));};
\ No newline at end of file
diff --git a/server/api/action/action.model.js b/server/api/action/action.model.js
index 3b47045..00e5d78 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 _0x29b1=['rimraf','../../config/environment','./action.attributes','exports','Action','lodash','util','../../config/logger','api','moment','request-promise','path'];(function(_0x3f5c46,_0x1cb7c4){var _0x2ce2fc=function(_0x96dff3){while(--_0x96dff3){_0x3f5c46['push'](_0x3f5c46['shift']());}};_0x2ce2fc(++_0x1cb7c4);}(_0x29b1,0x16d));var _0x129b=function(_0x298ed3,_0x4ab5e1){_0x298ed3=_0x298ed3-0x0;var _0x5aad28=_0x29b1[_0x298ed3];return _0x5aad28;};'use strict';var _=require(_0x129b('0x0'));var util=require(_0x129b('0x1'));var logger=require(_0x129b('0x2'))(_0x129b('0x3'));var moment=require(_0x129b('0x4'));var BPromise=require('bluebird');var rp=require(_0x129b('0x5'));var fs=require('fs');var path=require(_0x129b('0x6'));var rimraf=require(_0x129b('0x7'));var config=require(_0x129b('0x8'));var attributes=require(_0x129b('0x9'));module[_0x129b('0xa')]=function(_0x31e428,_0xe27ed4){return _0x31e428['define'](_0x129b('0xb'),attributes,{'tableName':'tools_actions','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xbf75=['../../config/environment','./action.attributes','define','tools_actions','lodash','util','../../config/logger','moment','bluebird','request-promise','path'];(function(_0x2e3b99,_0x5194f9){var _0x4fca25=function(_0xd6efa7){while(--_0xd6efa7){_0x2e3b99['push'](_0x2e3b99['shift']());}};_0x4fca25(++_0x5194f9);}(_0xbf75,0x1f3));var _0x5bf7=function(_0x2b5eae,_0x55010d){_0x2b5eae=_0x2b5eae-0x0;var _0x5f3ac9=_0xbf75[_0x2b5eae];return _0x5f3ac9;};'use strict';var _=require(_0x5bf7('0x0'));var util=require(_0x5bf7('0x1'));var logger=require(_0x5bf7('0x2'))('api');var moment=require(_0x5bf7('0x3'));var BPromise=require(_0x5bf7('0x4'));var rp=require(_0x5bf7('0x5'));var fs=require('fs');var path=require(_0x5bf7('0x6'));var rimraf=require('rimraf');var config=require(_0x5bf7('0x7'));var attributes=require(_0x5bf7('0x8'));module['exports']=function(_0x3081e2,_0x592ae7){return _0x3081e2[_0x5bf7('0x9')]('Action',attributes,{'tableName':_0x5bf7('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
diff --git a/server/api/action/action.rpc.js b/server/api/action/action.rpc.js
index 287729d..c830b87 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 _0x1261=['then','info','Action,\x20%s,\x20%s','request\x20sent','Action,\x20%s,\x20%s,\x20%s','error','code','message','catch','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','http','request'];(function(_0x2b65b3,_0x1cbb98){var _0xf7b6ff=function(_0x526859){while(--_0x526859){_0x2b65b3['push'](_0x2b65b3['shift']());}};_0xf7b6ff(++_0x1cbb98);}(_0x1261,0x144));var _0x1126=function(_0x117f4c,_0x36a9b1){_0x117f4c=_0x117f4c-0x0;var _0x2b24e9=_0x1261[_0x117f4c];return _0x2b24e9;};'use strict';var _=require('lodash');var util=require(_0x1126('0x0'));var moment=require(_0x1126('0x1'));var BPromise=require(_0x1126('0x2'));var rs=require(_0x1126('0x3'));var fs=require('fs');var Redis=require(_0x1126('0x4'));var db=require(_0x1126('0x5'))['db'];var utils=require(_0x1126('0x6'));var logger=require(_0x1126('0x7'))(_0x1126('0x8'));var config=require(_0x1126('0x9'));var jayson=require('jayson/promise');var client=jayson['client'][_0x1126('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x907180,_0x4f239c,_0x17e5f0){return new BPromise(function(_0x28772d,_0x245be9){return client[_0x1126('0xb')](_0x907180,_0x17e5f0)[_0x1126('0xc')](function(_0x59cfa1){logger[_0x1126('0xd')](_0x1126('0xe'),_0x4f239c,_0x1126('0xf'));logger['debug'](_0x1126('0x10'),_0x4f239c,'request\x20sent',JSON['stringify'](_0x59cfa1));if(_0x59cfa1[_0x1126('0x11')]){if(_0x59cfa1['error'][_0x1126('0x12')]===0x1f4){logger[_0x1126('0x11')](_0x1126('0xe'),_0x4f239c,_0x59cfa1[_0x1126('0x11')][_0x1126('0x13')]);return _0x245be9(_0x59cfa1[_0x1126('0x11')][_0x1126('0x13')]);}logger[_0x1126('0x11')](_0x1126('0xe'),_0x4f239c,_0x59cfa1['error']['message']);return _0x28772d(_0x59cfa1[_0x1126('0x11')][_0x1126('0x13')]);}else{logger[_0x1126('0xd')]('Action,\x20%s,\x20%s',_0x4f239c,_0x1126('0xf'));_0x28772d(_0x59cfa1['result'][_0x1126('0x13')]);}})[_0x1126('0x14')](function(_0x257b5f){logger['error'](_0x1126('0xe'),_0x4f239c,_0x257b5f);_0x245be9(_0x257b5f);});});}
\ No newline at end of file
+var _0xabce=['util','moment','bluebird','randomstring','../../config/utils','../../config/logger','rpc','client','then','info','Action,\x20%s,\x20%s','request\x20sent','debug','Action,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','lodash'];(function(_0x24ede5,_0x28425f){var _0x5320ea=function(_0x4fef7c){while(--_0x4fef7c){_0x24ede5['push'](_0x24ede5['shift']());}};_0x5320ea(++_0x28425f);}(_0xabce,0x103));var _0xeabc=function(_0x12d033,_0x25fa2f){_0x12d033=_0x12d033-0x0;var _0x3b4e80=_0xabce[_0x12d033];return _0x3b4e80;};'use strict';var _=require(_0xeabc('0x0'));var util=require(_0xeabc('0x1'));var moment=require(_0xeabc('0x2'));var BPromise=require(_0xeabc('0x3'));var rs=require(_0xeabc('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0xeabc('0x5'));var logger=require(_0xeabc('0x6'))(_0xeabc('0x7'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0xeabc('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x229ba4,_0x52ede8,_0x3bdc29){return new BPromise(function(_0x9417af,_0x8434c5){return client['request'](_0x229ba4,_0x3bdc29)[_0xeabc('0x9')](function(_0x341f16){logger[_0xeabc('0xa')](_0xeabc('0xb'),_0x52ede8,_0xeabc('0xc'));logger[_0xeabc('0xd')](_0xeabc('0xe'),_0x52ede8,_0xeabc('0xc'),JSON[_0xeabc('0xf')](_0x341f16));if(_0x341f16[_0xeabc('0x10')]){if(_0x341f16[_0xeabc('0x10')][_0xeabc('0x11')]===0x1f4){logger[_0xeabc('0x10')](_0xeabc('0xb'),_0x52ede8,_0x341f16[_0xeabc('0x10')][_0xeabc('0x12')]);return _0x8434c5(_0x341f16['error'][_0xeabc('0x12')]);}logger[_0xeabc('0x10')](_0xeabc('0xb'),_0x52ede8,_0x341f16['error']['message']);return _0x9417af(_0x341f16[_0xeabc('0x10')][_0xeabc('0x12')]);}else{logger[_0xeabc('0xa')]('Action,\x20%s,\x20%s',_0x52ede8,_0xeabc('0xc'));_0x9417af(_0x341f16[_0xeabc('0x13')]['message']);}})['catch'](function(_0x10fa8e){logger['error'](_0xeabc('0xb'),_0x52ede8,_0x10fa8e);_0x8434c5(_0x10fa8e);});});}
\ No newline at end of file
diff --git a/server/api/action/index.js b/server/api/action/index.js
index 6ee8581..f78c200 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 _0xb23d=['connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./action.controller','put','/:id','isAuthenticated','update','delete','exports','multer','path'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0xb23d,0x184));var _0xdb23=function(_0xf5d71c,_0x2613a6){_0xf5d71c=_0xf5d71c-0x0;var _0x5af672=_0xb23d[_0xf5d71c];return _0x5af672;};'use strict';var multer=require(_0xdb23('0x0'));var util=require('util');var path=require(_0xdb23('0x1'));var timeout=require(_0xdb23('0x2'));var express=require(_0xdb23('0x3'));var router=express[_0xdb23('0x4')]();var fs_extra=require(_0xdb23('0x5'));var auth=require(_0xdb23('0x6'));var interaction=require(_0xdb23('0x7'));var config=require('../../config/environment');var controller=require(_0xdb23('0x8'));router[_0xdb23('0x9')](_0xdb23('0xa'),auth[_0xdb23('0xb')](),controller[_0xdb23('0xc')]);router[_0xdb23('0xd')](_0xdb23('0xa'),auth['isAuthenticated'](),controller['destroy']);module[_0xdb23('0xe')]=router;
\ No newline at end of file
+var _0x2a40=['path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./action.controller','put','/:id','delete','isAuthenticated','destroy','exports','util'];(function(_0x20aadb,_0x5a607a){var _0x520018=function(_0x1d258a){while(--_0x1d258a){_0x20aadb['push'](_0x20aadb['shift']());}};_0x520018(++_0x5a607a);}(_0x2a40,0x194));var _0x02a4=function(_0x30033a,_0x5ce4a6){_0x30033a=_0x30033a-0x0;var _0x5e3518=_0x2a40[_0x30033a];return _0x5e3518;};'use strict';var multer=require('multer');var util=require(_0x02a4('0x0'));var path=require(_0x02a4('0x1'));var timeout=require(_0x02a4('0x2'));var express=require(_0x02a4('0x3'));var router=express[_0x02a4('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x02a4('0x5'));var interaction=require(_0x02a4('0x6'));var config=require(_0x02a4('0x7'));var controller=require(_0x02a4('0x8'));router[_0x02a4('0x9')](_0x02a4('0xa'),auth['isAuthenticated'](),controller['update']);router[_0x02a4('0xb')](_0x02a4('0xa'),auth[_0x02a4('0xc')](),controller[_0x02a4('0xd')]);module[_0x02a4('0xe')]=router;
\ No newline at end of file
diff --git a/server/api/analyticCustomReport/analyticCustomReport.attributes.js b/server/api/analyticCustomReport/analyticCustomReport.attributes.js
index 9a2753d..de86e22 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 _0xb4c7=['STRING','TEXT','sequelize','exports'];(function(_0x6173fc,_0x32aadf){var _0x965fbe=function(_0x50d5b3){while(--_0x50d5b3){_0x6173fc['push'](_0x6173fc['shift']());}};_0x965fbe(++_0x32aadf);}(_0xb4c7,0x1ea));var _0x7b4c=function(_0x4d98ab,_0x2e35cc){_0x4d98ab=_0x4d98ab-0x0;var _0x3d582e=_0xb4c7[_0x4d98ab];return _0x3d582e;};'use strict';var Sequelize=require(_0x7b4c('0x0'));module[_0x7b4c('0x1')]={'name':{'type':Sequelize[_0x7b4c('0x2')],'allowNull':![]},'description':{'type':Sequelize[_0x7b4c('0x2')]},'parent':{'type':Sequelize[_0x7b4c('0x2')]},'table':{'type':Sequelize['STRING']},'conditions':{'type':Sequelize[_0x7b4c('0x3')]},'joins':{'type':Sequelize[_0x7b4c('0x3')]}};
\ No newline at end of file
+var _0xd8fb=['TEXT','sequelize','exports','STRING'];(function(_0x47c9c9,_0x5618bf){var _0x4462bd=function(_0x3dbf26){while(--_0x3dbf26){_0x47c9c9['push'](_0x47c9c9['shift']());}};_0x4462bd(++_0x5618bf);}(_0xd8fb,0x99));var _0xbd8f=function(_0x3872a1,_0x5807e2){_0x3872a1=_0x3872a1-0x0;var _0xee61e8=_0xd8fb[_0x3872a1];return _0xee61e8;};'use strict';var Sequelize=require(_0xbd8f('0x0'));module[_0xbd8f('0x1')]={'name':{'type':Sequelize[_0xbd8f('0x2')],'allowNull':![]},'description':{'type':Sequelize[_0xbd8f('0x2')]},'parent':{'type':Sequelize['STRING']},'table':{'type':Sequelize['STRING']},'conditions':{'type':Sequelize['TEXT']},'joins':{'type':Sequelize[_0xbd8f('0x3')]}};
\ No newline at end of file
diff --git a/server/api/analyticCustomReport/analyticCustomReport.controller.js b/server/api/analyticCustomReport/analyticCustomReport.controller.js
index 5921266..d658435 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 _0x50bf=['merge','options','includeAll','include','rows','catch','show','params','body','user','role','Reports','find','autoAssociation','UserProfileResource','create','error','cross_join','SUM(%s)','COUNT(%s)','COUNT(DISTINCT\x20%s)','MAX(%s)','AVG(%s)','GROUP_CONCAT(%s)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','DATE(%s)','HOUR(%s)','ROUND(%s)','UNIX_TIMESTAMP(%s)','IS\x20NULL','IS\x20NOT\x20NULL','IS\x20EMPTY','IS\x20NOT\x20EMPTY','rules','group','field','condition','value','Sequelize','ValidationErrorItem','Please\x20insert\x20at\x20least\x20one\x20field','AnalyticMetric','findAll','keyBy','select','from','MetricId','replace','function','format','orderBy','DESC','alias','joins','parse','parentKey','foreignTable','foreignKey','%s.%s\x20=\x20%s.%s','table','conditions','clone','debug','Limited\x20Query:','sequelize','SELECT','join','right_join','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)','includes','operator','getFields','metric','groupBy','output','fullPath','%s-%s.%s','randomstring','generate','custom','AnalyticExtractedReport','cdr','.calldate\x20BETWEEN\x20?\x20AND\x20?','startDate','endDate','.createdAt\x20BETWEEN\x20?\x20AND\x20?','Run\x20Query:','child_process','fork','../../components/export/','../../files/reports','savename','toString','countTable','COUNT(*)','QueryTypes','run','left_join','MIN(%s)','SEC_TO_TIME(%s)','rimraf','fast-json-patch','request-promise','bluebird','mustache','path','to-csv','fs-extra','lodash','squel','jsforce','desk.js','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','api','../../config/utils','../../config/license/util','../../mysqldb','dbH','status','end','json','offset','undefined','count','set','Content-Range','apply','reject','save','update','then','destroy','get','CustomReports','sendStatus','stack','name','send','index','map','AnalyticCustomReport','rawAttributes','type','key','model','query','keys','filters','intersection','attributes','fields','length','nolimit','limit','order','sort','where','pick','filter','VIRTUAL'];(function(_0x3d6d10,_0x57c8fb){var _0xbeda88=function(_0x2171e7){while(--_0x2171e7){_0x3d6d10['push'](_0x3d6d10['shift']());}};_0xbeda88(++_0x57c8fb);}(_0x50bf,0x106));var _0xf50b=function(_0x365890,_0xd9d579){_0x365890=_0x365890-0x0;var _0x4199ae=_0x50bf[_0x365890];return _0x4199ae;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xf50b('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0xf50b('0x1'));var rp=require(_0xf50b('0x2'));var moment=require('moment');var BPromise=require(_0xf50b('0x3'));var Mustache=require(_0xf50b('0x4'));var util=require('util');var path=require(_0xf50b('0x5'));var sox=require('sox');var csv=require(_0xf50b('0x6'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xf50b('0x7'));var _=require(_0xf50b('0x8'));var squel=require(_0xf50b('0x9'));var crypto=require('crypto');var jsforce=require(_0xf50b('0xa'));var deskjs=require(_0xf50b('0xb'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0xf50b('0xc'));var qs=require(_0xf50b('0xd'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xf50b('0xe'));var logger=require('../../config/logger')(_0xf50b('0xf'));var utils=require(_0xf50b('0x10'));var config=require('../../config/environment');var licenseUtil=require(_0xf50b('0x11'));var db=require(_0xf50b('0x12'))['db'];var dbH=require('../../mysqldb')[_0xf50b('0x13')];function respondWithStatusCode(_0x420701,_0x12ce91){_0x12ce91=_0x12ce91||0xcc;return function(_0x2cf201){if(_0x2cf201){return _0x420701['sendStatus'](_0x12ce91);}return _0x420701[_0xf50b('0x14')](_0x12ce91)[_0xf50b('0x15')]();};}function respondWithResult(_0x405f94,_0x4e28c7){_0x4e28c7=_0x4e28c7||0xc8;return function(_0x5cf90c){if(_0x5cf90c){return _0x405f94['status'](_0x4e28c7)[_0xf50b('0x16')](_0x5cf90c);}};}function respondWithFilteredResult(_0x4c041d,_0x19460c){return function(_0x39b90f){if(_0x39b90f){var _0x6b3d2d=typeof _0x19460c[_0xf50b('0x17')]==='undefined'&&typeof _0x19460c['limit']===_0xf50b('0x18');var _0x4fbf00=_0x39b90f['count'];var _0x43ad41=_0x6b3d2d?0x0:_0x19460c[_0xf50b('0x17')];var _0x159e70=_0x6b3d2d?_0x39b90f[_0xf50b('0x19')]:_0x19460c['offset']+_0x19460c['limit'];var _0x10f1f4;if(_0x159e70>=_0x4fbf00){_0x159e70=_0x4fbf00;_0x10f1f4=0xc8;}else{_0x10f1f4=0xce;}_0x4c041d['status'](_0x10f1f4);return _0x4c041d[_0xf50b('0x1a')](_0xf50b('0x1b'),_0x43ad41+'-'+_0x159e70+'/'+_0x4fbf00)[_0xf50b('0x16')](_0x39b90f);}return null;};}function patchUpdates(_0x43a8a2){return function(_0x26912b){try{jsonpatch[_0xf50b('0x1c')](_0x26912b,_0x43a8a2,!![]);}catch(_0x217451){return BPromise[_0xf50b('0x1d')](_0x217451);}return _0x26912b[_0xf50b('0x1e')]();};}function saveUpdates(_0x5121fd,_0x12d6e5){return function(_0xf7a4d3){if(_0xf7a4d3){return _0xf7a4d3[_0xf50b('0x1f')](_0x5121fd)[_0xf50b('0x20')](function(_0x1572c9){return _0x1572c9;});}return null;};}function removeEntity(_0x3a0df9,_0x4a23e9){return function(_0x3942fb){if(_0x3942fb){return _0x3942fb[_0xf50b('0x21')]()['then'](function(){var _0x531399=_0x3942fb[_0xf50b('0x22')]({'plain':!![]});var _0x50f773=_0xf50b('0x23');return db['UserProfileResource'][_0xf50b('0x21')]({'where':{'type':_0x50f773,'resourceId':_0x531399['id']}})[_0xf50b('0x20')](function(){return _0x3942fb;});})['then'](function(){_0x3a0df9[_0xf50b('0x14')](0xcc)[_0xf50b('0x15')]();});}};}function handleEntityNotFound(_0xc9c5a6,_0x532367){return function(_0x33a55e){if(!_0x33a55e){_0xc9c5a6[_0xf50b('0x24')](0x194);}return _0x33a55e;};}function handleError(_0xf2dfac,_0x2997b9){_0x2997b9=_0x2997b9||0x1f4;return function(_0x5e4c29){logger['error'](_0x5e4c29[_0xf50b('0x25')]);if(_0x5e4c29['name']){delete _0x5e4c29[_0xf50b('0x26')];}_0xf2dfac[_0xf50b('0x14')](_0x2997b9)[_0xf50b('0x27')](_0x5e4c29);};}exports[_0xf50b('0x28')]=function(_0x4ec50d,_0x3c1666){var _0x4446f0={},_0x58a132={},_0x4978bb={'count':0x0,'rows':[]};var _0xec921a=_[_0xf50b('0x29')](db[_0xf50b('0x2a')][_0xf50b('0x2b')],function(_0x5315f0){return{'name':_0x5315f0['fieldName'],'type':_0x5315f0[_0xf50b('0x2c')][_0xf50b('0x2d')]};});_0x58a132[_0xf50b('0x2e')]=_[_0xf50b('0x29')](_0xec921a,'name');_0x58a132[_0xf50b('0x2f')]=_[_0xf50b('0x30')](_0x4ec50d[_0xf50b('0x2f')]);_0x58a132[_0xf50b('0x31')]=_[_0xf50b('0x32')](_0x58a132['model'],_0x58a132[_0xf50b('0x2f')]);_0x4446f0[_0xf50b('0x33')]=_[_0xf50b('0x32')](_0x58a132[_0xf50b('0x2e')],qs[_0xf50b('0x34')](_0x4ec50d['query'][_0xf50b('0x34')]));_0x4446f0[_0xf50b('0x33')]=_0x4446f0['attributes'][_0xf50b('0x35')]?_0x4446f0[_0xf50b('0x33')]:_0x58a132[_0xf50b('0x2e')];if(!_0x4ec50d[_0xf50b('0x2f')]['hasOwnProperty'](_0xf50b('0x36'))){_0x4446f0[_0xf50b('0x37')]=qs[_0xf50b('0x37')](_0x4ec50d[_0xf50b('0x2f')][_0xf50b('0x37')]);_0x4446f0['offset']=qs[_0xf50b('0x17')](_0x4ec50d[_0xf50b('0x2f')]['offset']);}_0x4446f0[_0xf50b('0x38')]=qs[_0xf50b('0x39')](_0x4ec50d[_0xf50b('0x2f')][_0xf50b('0x39')]);_0x4446f0[_0xf50b('0x3a')]=qs[_0xf50b('0x31')](_[_0xf50b('0x3b')](_0x4ec50d['query'],_0x58a132['filters']),_0xec921a);if(_0x4ec50d[_0xf50b('0x2f')][_0xf50b('0x3c')]){_0x4446f0['where']=_['merge'](_0x4446f0[_0xf50b('0x3a')],{'$or':_['map'](_0xec921a,function(_0x4394e2){if(_0x4394e2[_0xf50b('0x2c')]!==_0xf50b('0x3d')){var _0x4375f7={};_0x4375f7[_0x4394e2['name']]={'$like':'%'+_0x4ec50d['query'][_0xf50b('0x3c')]+'%'};return _0x4375f7;}})});}_0x4446f0=_[_0xf50b('0x3e')]({},_0x4446f0,_0x4ec50d[_0xf50b('0x3f')]);var _0x940983={'where':_0x4446f0[_0xf50b('0x3a')]};return db['AnalyticCustomReport']['count'](_0x940983)[_0xf50b('0x20')](function(_0x421699){_0x4978bb[_0xf50b('0x19')]=_0x421699;if(_0x4ec50d[_0xf50b('0x2f')][_0xf50b('0x40')]){_0x4446f0[_0xf50b('0x41')]=[{'all':!![]}];}return db[_0xf50b('0x2a')]['findAll'](_0x4446f0);})[_0xf50b('0x20')](function(_0x263738){_0x4978bb[_0xf50b('0x42')]=_0x263738;return _0x4978bb;})['then'](respondWithFilteredResult(_0x3c1666,_0x4446f0))[_0xf50b('0x43')](handleError(_0x3c1666,null));};exports[_0xf50b('0x44')]=function(_0x593df2,_0x50d812){var _0x1e4b1f={'raw':![],'where':{'id':_0x593df2[_0xf50b('0x45')]['id']}},_0x1a6fd6={};_0x1a6fd6['model']=_[_0xf50b('0x30')](db['AnalyticCustomReport'][_0xf50b('0x2b')]);_0x1a6fd6['query']=_[_0xf50b('0x30')](_0x593df2[_0xf50b('0x2f')]);_0x1a6fd6[_0xf50b('0x31')]=_[_0xf50b('0x32')](_0x1a6fd6['model'],_0x1a6fd6['query']);_0x1e4b1f[_0xf50b('0x33')]=_[_0xf50b('0x32')](_0x1a6fd6[_0xf50b('0x2e')],qs[_0xf50b('0x34')](_0x593df2[_0xf50b('0x2f')][_0xf50b('0x34')]));_0x1e4b1f[_0xf50b('0x33')]=_0x1e4b1f[_0xf50b('0x33')][_0xf50b('0x35')]?_0x1e4b1f[_0xf50b('0x33')]:_0x1a6fd6[_0xf50b('0x2e')];if(_0x593df2['query']['includeAll']){_0x1e4b1f[_0xf50b('0x41')]=[{'all':!![]}];}_0x1e4b1f=_[_0xf50b('0x3e')]({},_0x1e4b1f,_0x593df2[_0xf50b('0x3f')]);return db['AnalyticCustomReport']['find'](_0x1e4b1f)['then'](handleEntityNotFound(_0x50d812,null))['then'](respondWithResult(_0x50d812,null))[_0xf50b('0x43')](handleError(_0x50d812,null));};exports['create']=function(_0x12030d,_0x3e8175){return db[_0xf50b('0x2a')]['create'](_0x12030d[_0xf50b('0x46')],{})[_0xf50b('0x20')](function(_0x402207){var _0x3fc592=_0x12030d[_0xf50b('0x47')][_0xf50b('0x22')]({'plain':!![]});if(!_0x3fc592)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x3fc592[_0xf50b('0x48')]==='user'){var _0x32391e=_0x402207[_0xf50b('0x22')]({'plain':!![]});var _0x5e9f25=_0xf50b('0x49');return db['UserProfileSection'][_0xf50b('0x4a')]({'where':{'name':_0x5e9f25,'userProfileId':_0x3fc592['userProfileId']},'raw':!![]})[_0xf50b('0x20')](function(_0x57de5e){if(_0x57de5e&&_0x57de5e[_0xf50b('0x4b')]===0x0){return db[_0xf50b('0x4c')][_0xf50b('0x4d')]({'name':_0x32391e[_0xf50b('0x26')],'resourceId':_0x32391e['id'],'type':'CustomReports','sectionId':_0x57de5e['id']},{})['then'](function(){return _0x402207;});}else{return _0x402207;}})['catch'](function(_0x2d456a){logger[_0xf50b('0x4e')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x2d456a);throw _0x2d456a;});}return _0x402207;})[_0xf50b('0x20')](respondWithResult(_0x3e8175,0xc9))[_0xf50b('0x43')](handleError(_0x3e8175,null));};exports[_0xf50b('0x1f')]=function(_0x4e247a,_0x292b4d){if(_0x4e247a[_0xf50b('0x46')]['id']){delete _0x4e247a[_0xf50b('0x46')]['id'];}return db['AnalyticCustomReport'][_0xf50b('0x4a')]({'where':{'id':_0x4e247a[_0xf50b('0x45')]['id']}})[_0xf50b('0x20')](handleEntityNotFound(_0x292b4d,null))[_0xf50b('0x20')](saveUpdates(_0x4e247a[_0xf50b('0x46')],null))[_0xf50b('0x20')](respondWithResult(_0x292b4d,null))[_0xf50b('0x43')](handleError(_0x292b4d,null));};exports[_0xf50b('0x21')]=function(_0x2e798a,_0xeec22d){return db[_0xf50b('0x2a')][_0xf50b('0x4a')]({'where':{'id':_0x2e798a[_0xf50b('0x45')]['id']}})['then'](handleEntityNotFound(_0xeec22d,null))[_0xf50b('0x20')](removeEntity(_0xeec22d,null))['catch'](handleError(_0xeec22d,null));};exports['preview']=function(_0xbe4791,_0x2ee0ac){var _0xc43bfa=0xa;var _0xf19fec=['join','left_join','right_join',_0xf50b('0x4f')];var _0x56695e={'SUM':_0xf50b('0x50'),'COUNT':_0xf50b('0x51'),'COUNT DISTINCT':_0xf50b('0x52'),'MAX':_0xf50b('0x53'),'MIN':'MIN(%s)','AVG':_0xf50b('0x54'),'GROUP_CONCAT':_0xf50b('0x55'),'GROUP_CONCAT ASC':_0xf50b('0x56'),'GROUP_CONCAT DESC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)'};var _0xa358fc={'SEC_TO_TIME':'SEC_TO_TIME(%s)','DATE':_0xf50b('0x57'),'HOUR':_0xf50b('0x58'),'ROUND':_0xf50b('0x59'),'UNIX_TIMESTAMP':_0xf50b('0x5a')};var _0x2d9ef2=function(_0x4d5180){return!_['includes']([_0xf50b('0x5b'),_0xf50b('0x5c'),_0xf50b('0x5d'),_0xf50b('0x5e')],_0x4d5180);};var _0x3174c9=function(_0x42fb77){if(!_0x42fb77||!_0x42fb77[_0xf50b('0x5f')][_0xf50b('0x35')]){return'';}for(var _0x309dee='(',_0x12ba67=0x0;_0x12ba67<_0x42fb77['rules'][_0xf50b('0x35')];_0x12ba67+=0x1){_0x12ba67>0x0&&(_0x309dee+='\x20'+_0x42fb77['operator']+'\x20');_0x309dee+=_0x42fb77[_0xf50b('0x5f')][_0x12ba67][_0xf50b('0x60')]?_0x3174c9(_0x42fb77[_0xf50b('0x5f')][_0x12ba67]['group']):_0x42fb77[_0xf50b('0x5f')][_0x12ba67][_0xf50b('0x61')]+'\x20'+_0x42fb77['rules'][_0x12ba67][_0xf50b('0x62')]+(_0x2d9ef2(_0x42fb77[_0xf50b('0x5f')][_0x12ba67][_0xf50b('0x62')])?'\x20'+_0x42fb77[_0xf50b('0x5f')][_0x12ba67][_0xf50b('0x63')]:'');}return _0x309dee+')';};var _0x4ed0a9={'where':{'id':_0xbe4791[_0xf50b('0x45')]['id']}},_0x3c0a07,_0x1e1ca4,_0x1c126d,_0x6ad1c,_0x444f16;_0x4ed0a9=_[_0xf50b('0x3e')]({},_0x4ed0a9,_0xbe4791[_0xf50b('0x3f')]);return db[_0xf50b('0x2a')]['find'](_0x4ed0a9)[_0xf50b('0x20')](function(_0x456cdc){if(_0x456cdc){_0x3c0a07=_0x456cdc;return _0x456cdc['getFields']();}return null;})['then'](function(_0x192e51){if(_0x192e51){if(!_0x192e51[_0xf50b('0x35')]){throw new db[(_0xf50b('0x64'))][(_0xf50b('0x65'))](_0xf50b('0x66'),0x193);}_0x1e1ca4=_0x192e51;return db[_0xf50b('0x67')][_0xf50b('0x68')]({'raw':!![]});}return null;})[_0xf50b('0x20')](function(_0x3fee9d){if(_0x3fee9d){_0x1c126d=_[_0xf50b('0x69')](_0x3fee9d,'id');var _0x5d3b31;var _0x203169=squel[_0xf50b('0x6a')]();_0x203169[_0xf50b('0x6b')](_0x3c0a07['table']);for(var _0x544bee=0x0;_0x544bee<_0x1e1ca4[_0xf50b('0x35')];_0x544bee+=0x1){_0x5d3b31=_0x1e1ca4[_0x544bee][_0xf50b('0x6c')]?_0x1c126d[_0x1e1ca4[_0x544bee][_0xf50b('0x6c')]]['metric']:_0x1e1ca4[_0x544bee][_0xf50b('0x61')];_0x5d3b31=_0x1e1ca4[_0x544bee]['function']?_[_0xf50b('0x6d')](_0x56695e[_0x1e1ca4[_0x544bee][_0xf50b('0x6e')]],'%s',_0x5d3b31):_0x5d3b31;_0x5d3b31=_0x1e1ca4[_0x544bee][_0xf50b('0x6f')]?_[_0xf50b('0x6d')](_0xa358fc[_0x1e1ca4[_0x544bee][_0xf50b('0x6f')]],'%s',_0x5d3b31):_0x5d3b31;if(_0x1e1ca4[_0x544bee]['groupBy']){_0x203169[_0xf50b('0x60')](_0x5d3b31);}_0x1e1ca4[_0x544bee][_0xf50b('0x70')]&&_0x203169[_0xf50b('0x38')](_0x5d3b31,_0x1e1ca4[_0x544bee][_0xf50b('0x70')]===_0xf50b('0x71')?![]:!![]);_0x203169[_0xf50b('0x61')](_0x5d3b31,_0x1e1ca4[_0x544bee][_0xf50b('0x72')]||_0x5d3b31);}if(_0x3c0a07[_0xf50b('0x73')]){_0x3c0a07['joins']=JSON[_0xf50b('0x74')](_0x3c0a07['joins']);for(var _0x439511=0x0;_0x439511<_0x3c0a07[_0xf50b('0x73')][_0xf50b('0x35')];_0x439511+=0x1){if(_0x3c0a07['joins'][_0x439511]['type']&&_['includes'](_0xf19fec,_0x3c0a07['joins'][_0x439511][_0xf50b('0x2c')])&&_0x3c0a07[_0xf50b('0x73')][_0x439511][_0xf50b('0x75')]&&_0x3c0a07[_0xf50b('0x73')][_0x439511][_0xf50b('0x76')]&&_0x3c0a07[_0xf50b('0x73')][_0x439511][_0xf50b('0x77')]){_0x203169[_0x3c0a07[_0xf50b('0x73')][_0x439511][_0xf50b('0x2c')]](_0x3c0a07[_0xf50b('0x73')][_0x439511][_0xf50b('0x76')],null,util[_0xf50b('0x6f')](_0xf50b('0x78'),_0x3c0a07[_0xf50b('0x79')],_0x3c0a07[_0xf50b('0x73')][_0x439511]['parentKey'],_0x3c0a07[_0xf50b('0x73')][_0x439511][_0xf50b('0x76')],_0x3c0a07[_0xf50b('0x73')][_0x439511]['foreignKey']));}}}if(_0x3c0a07[_0xf50b('0x7a')]){_0x3c0a07[_0xf50b('0x7a')]=JSON[_0xf50b('0x74')](_0x3c0a07[_0xf50b('0x7a')]);_0x203169['where'](_0x3174c9(_0x3c0a07['conditions'][_0xf50b('0x60')]));}_0x444f16=_0x203169[_0xf50b('0x7b')]();_0x203169[_0xf50b('0x37')](_0xc43bfa);_0x203169[_0xf50b('0x17')](0x0);logger[_0xf50b('0x7c')](_0xf50b('0x7d'),_0x203169['toString']());return dbH[_0xf50b('0x7e')][_0xf50b('0x2f')](_0x203169['toString'](),{'type':dbH['sequelize']['QueryTypes'][_0xf50b('0x7f')]});}})[_0xf50b('0x20')](respondWithResult(_0x2ee0ac,null))[_0xf50b('0x43')](handleError(_0x2ee0ac,null));};function runReport(_0x34e1bf,_0x42aa44,_0xb84e51){var _0x44aa76=_0x42aa44[_0xf50b('0x26')];var _0x59fca5=0xa;var _0x4e748b=[_0xf50b('0x80'),'left_join',_0xf50b('0x81'),_0xf50b('0x4f')];var _0x1b285c={'SUM':'SUM(%s)','COUNT':_0xf50b('0x51'),'COUNT DISTINCT':'COUNT(DISTINCT\x20%s)','MAX':_0xf50b('0x53'),'MIN':'MIN(%s)','AVG':_0xf50b('0x54'),'GROUP_CONCAT':_0xf50b('0x55'),'GROUP_CONCAT ASC':_0xf50b('0x56'),'GROUP_CONCAT DESC':_0xf50b('0x82')};var _0x1eeb53={'SEC_TO_TIME':'SEC_TO_TIME(%s)','DATE':_0xf50b('0x57'),'HOUR':_0xf50b('0x58'),'ROUND':_0xf50b('0x59'),'UNIX_TIMESTAMP':_0xf50b('0x5a')};var _0x6fd21b=function(_0x146ab7){return!_[_0xf50b('0x83')]([_0xf50b('0x5b'),_0xf50b('0x5c'),_0xf50b('0x5d'),_0xf50b('0x5e')],_0x146ab7);};var _0x317190=function(_0xe2b562){if(!_0xe2b562||!_0xe2b562[_0xf50b('0x5f')][_0xf50b('0x35')]){return'';}for(var _0x1eac4c='(',_0xc2719e=0x0;_0xc2719e<_0xe2b562['rules'][_0xf50b('0x35')];_0xc2719e+=0x1){_0xc2719e>0x0&&(_0x1eac4c+='\x20'+_0xe2b562[_0xf50b('0x84')]+'\x20');_0x1eac4c+=_0xe2b562['rules'][_0xc2719e]['group']?_0x317190(_0xe2b562['rules'][_0xc2719e]['group']):_0xe2b562[_0xf50b('0x5f')][_0xc2719e][_0xf50b('0x61')]+'\x20'+_0xe2b562[_0xf50b('0x5f')][_0xc2719e]['condition']+(_0x6fd21b(_0xe2b562[_0xf50b('0x5f')][_0xc2719e]['condition'])?'\x20'+_0xe2b562['rules'][_0xc2719e][_0xf50b('0x63')]:'');}return _0x1eac4c+')';};var _0xf829f1={'where':{'id':_0x34e1bf['id']}},_0x3f72c0,_0x5212c3,_0x28da62,_0x16f384,_0xedc329;_0xf829f1=_[_0xf50b('0x3e')]({},_0xf829f1,_0xb84e51);return db[_0xf50b('0x2a')][_0xf50b('0x4a')](_0xf829f1)[_0xf50b('0x20')](function(_0x551be7){if(_0x551be7){_0x3f72c0=_0x551be7;return _0x551be7[_0xf50b('0x85')]();}return null;})['then'](function(_0xdfe0c8){if(_0xdfe0c8){if(!_0xdfe0c8['length']){throw new db[(_0xf50b('0x64'))][(_0xf50b('0x65'))](_0xf50b('0x66'),0x193);}_0x5212c3=_0xdfe0c8;return db[_0xf50b('0x67')]['findAll']({'raw':!![]});}return null;})[_0xf50b('0x20')](function(_0x2dc994){if(_0x2dc994){_0x28da62=_['keyBy'](_0x2dc994,'id');var _0x226bf4;var _0x155ba3=squel[_0xf50b('0x6a')]();_0x155ba3[_0xf50b('0x6b')](_0x3f72c0[_0xf50b('0x79')]);for(var _0x24395b=0x0;_0x24395b<_0x5212c3[_0xf50b('0x35')];_0x24395b+=0x1){_0x226bf4=_0x5212c3[_0x24395b][_0xf50b('0x6c')]?_0x28da62[_0x5212c3[_0x24395b]['MetricId']][_0xf50b('0x86')]:_0x5212c3[_0x24395b][_0xf50b('0x61')];_0x226bf4=_0x5212c3[_0x24395b][_0xf50b('0x6e')]?_[_0xf50b('0x6d')](_0x1b285c[_0x5212c3[_0x24395b][_0xf50b('0x6e')]],'%s',_0x226bf4):_0x226bf4;_0x226bf4=_0x5212c3[_0x24395b]['format']?_['replace'](_0x1eeb53[_0x5212c3[_0x24395b][_0xf50b('0x6f')]],'%s',_0x226bf4):_0x226bf4;if(_0x5212c3[_0x24395b][_0xf50b('0x87')]){_0x155ba3[_0xf50b('0x60')](_0x226bf4);}_0x5212c3[_0x24395b][_0xf50b('0x70')]&&_0x155ba3[_0xf50b('0x38')](_0x226bf4,_0x5212c3[_0x24395b][_0xf50b('0x70')]==='DESC'?![]:!![]);_0x155ba3[_0xf50b('0x61')](_0x226bf4,_0x5212c3[_0x24395b][_0xf50b('0x72')]||_0x226bf4);}if(_0x3f72c0[_0xf50b('0x73')]){_0x3f72c0['joins']=JSON[_0xf50b('0x74')](_0x3f72c0[_0xf50b('0x73')]);for(var _0x125821=0x0;_0x125821<_0x3f72c0['joins'][_0xf50b('0x35')];_0x125821+=0x1){if(_0x3f72c0[_0xf50b('0x73')][_0x125821][_0xf50b('0x2c')]&&_['includes'](_0x4e748b,_0x3f72c0['joins'][_0x125821][_0xf50b('0x2c')])&&_0x3f72c0[_0xf50b('0x73')][_0x125821][_0xf50b('0x75')]&&_0x3f72c0[_0xf50b('0x73')][_0x125821][_0xf50b('0x76')]&&_0x3f72c0[_0xf50b('0x73')][_0x125821][_0xf50b('0x77')]){_0x155ba3[_0x3f72c0[_0xf50b('0x73')][_0x125821][_0xf50b('0x2c')]](_0x3f72c0['joins'][_0x125821][_0xf50b('0x76')],null,util[_0xf50b('0x6f')](_0xf50b('0x78'),_0x3f72c0[_0xf50b('0x79')],_0x3f72c0[_0xf50b('0x73')][_0x125821][_0xf50b('0x75')],_0x3f72c0[_0xf50b('0x73')][_0x125821][_0xf50b('0x76')],_0x3f72c0[_0xf50b('0x73')][_0x125821][_0xf50b('0x77')]));}}}if(_0x3f72c0[_0xf50b('0x7a')]){_0x3f72c0['conditions']=JSON['parse'](_0x3f72c0[_0xf50b('0x7a')]);_0x155ba3[_0xf50b('0x3a')](_0x317190(_0x3f72c0['conditions'][_0xf50b('0x60')]));}_0xedc329=_0x155ba3[_0xf50b('0x7b')]();_0x155ba3[_0xf50b('0x37')](_0x59fca5);_0x155ba3['offset'](0x0);return;}})[_0xf50b('0x20')](function(){if(_0x42aa44[_0xf50b('0x88')]==='web'){return null;}var _0x3e0879=_[_0xf50b('0x3e')](_0x42aa44,{'name':_0x42aa44[_0xf50b('0x89')]||_0x42aa44[_0xf50b('0x26')]||_0x3f72c0[_0xf50b('0x26')],'basename':_0x44aa76,'savename':util[_0xf50b('0x6f')](_0xf50b('0x8a'),_0x42aa44[_0xf50b('0x26')]||_0x3f72c0['name'],require(_0xf50b('0x8b'))[_0xf50b('0x8c')](0x4),_0x42aa44['output']||'csv'),'reportId':_0x3f72c0['id'],'reportType':_0xf50b('0x8d')});return db[_0xf50b('0x8e')][_0xf50b('0x4d')](_0x3e0879,{'raw':!![]});})[_0xf50b('0x20')](function(_0x5c7465){if(_0x3f72c0[_0xf50b('0x79')]===_0xf50b('0x8f')){_0xedc329[_0xf50b('0x3a')](_0x3f72c0[_0xf50b('0x79')]+_0xf50b('0x90'),_0x42aa44[_0xf50b('0x91')],_0x42aa44[_0xf50b('0x92')]);}else{_0xedc329['where'](_0x3f72c0[_0xf50b('0x79')]+_0xf50b('0x93'),_0x42aa44[_0xf50b('0x91')],_0x42aa44[_0xf50b('0x92')]);}if(_0x5c7465){logger['info'](_0xf50b('0x94'),_0xedc329['toString']());require(_0xf50b('0x95'))[_0xf50b('0x96')](path[_0xf50b('0x80')](__dirname,_0xf50b('0x97'),_0x5c7465[_0xf50b('0x88')]),[_0x5c7465['id'],_0xedc329['toString'](),path['join'](__dirname,_0xf50b('0x98'),_0x5c7465[_0xf50b('0x99')]),_0x44aa76]);return _0x5c7465;}else{var _0x3c0834=squel[_0xf50b('0x6a')]();_0x3c0834[_0xf50b('0x6b')]('('+_0xedc329[_0xf50b('0x9a')]()+')',_0xf50b('0x9b'));_0x3c0834['field'](_0xf50b('0x9c'),_0xf50b('0x19'));_0xedc329[_0xf50b('0x37')](_0x42aa44[_0xf50b('0x37')]||_0x59fca5);_0xedc329['offset'](_0x42aa44[_0xf50b('0x17')]||0x0);return dbH[_0xf50b('0x7e')][_0xf50b('0x2f')](_0x3c0834['toString'](),{'type':dbH[_0xf50b('0x7e')][_0xf50b('0x9d')][_0xf50b('0x7f')]})['then'](function(_0x1e33c6){if(!_0x1e33c6['length']){_0x16f384=0x0;}else{_0x16f384=_0x1e33c6[0x0]['count']||0x0;}return dbH[_0xf50b('0x7e')][_0xf50b('0x2f')](_0xedc329[_0xf50b('0x9a')](),{'type':dbH['sequelize'][_0xf50b('0x9d')]['SELECT']});})['then'](function(_0x38d030){return{'rows':_0x38d030||[],'count':_0x16f384};});}});}exports[_0xf50b('0x9e')]=function(_0x230fd4,_0x193d94){return runReport(_0x230fd4['params'],_0x230fd4[_0xf50b('0x2f')],_0x230fd4['options'])[_0xf50b('0x20')](respondWithResult(_0x193d94,null))['catch'](handleError(_0x193d94,null));};exports['runReport']=runReport;exports[_0xf50b('0x2f')]=function(_0x40392b,_0x1bd938){var _0x526430=0xa;var _0x1786df=[_0xf50b('0x80'),_0xf50b('0x9f'),_0xf50b('0x81'),_0xf50b('0x4f')];var _0x4bcce3={'SUM':_0xf50b('0x50'),'COUNT':'COUNT(%s)','COUNT DISTINCT':_0xf50b('0x52'),'MAX':'MAX(%s)','MIN':_0xf50b('0xa0'),'AVG':'AVG(%s)','GROUP_CONCAT':_0xf50b('0x55'),'GROUP_CONCAT ASC':_0xf50b('0x56'),'GROUP_CONCAT DESC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)'};var _0x10db4b={'SEC_TO_TIME':_0xf50b('0xa1'),'DATE':_0xf50b('0x57'),'HOUR':'HOUR(%s)','ROUND':'ROUND(%s)','UNIX_TIMESTAMP':_0xf50b('0x5a')};var _0x105bcd=function(_0x85545b){return!_['includes']([_0xf50b('0x5b'),_0xf50b('0x5c'),_0xf50b('0x5d'),_0xf50b('0x5e')],_0x85545b);};var _0x31b572=function(_0x57926d){if(!_0x57926d||!_0x57926d[_0xf50b('0x5f')][_0xf50b('0x35')]){return'';}for(var _0x365c50='(',_0xeaaa3f=0x0;_0xeaaa3f<_0x57926d[_0xf50b('0x5f')][_0xf50b('0x35')];_0xeaaa3f+=0x1){_0xeaaa3f>0x0&&(_0x365c50+='\x20'+_0x57926d[_0xf50b('0x84')]+'\x20');_0x365c50+=_0x57926d[_0xf50b('0x5f')][_0xeaaa3f]['group']?_0x31b572(_0x57926d[_0xf50b('0x5f')][_0xeaaa3f]['group']):_0x57926d[_0xf50b('0x5f')][_0xeaaa3f][_0xf50b('0x61')]+'\x20'+_0x57926d[_0xf50b('0x5f')][_0xeaaa3f][_0xf50b('0x62')]+(_0x105bcd(_0x57926d[_0xf50b('0x5f')][_0xeaaa3f][_0xf50b('0x62')])?'\x20'+_0x57926d[_0xf50b('0x5f')][_0xeaaa3f][_0xf50b('0x63')]:'');}return _0x365c50+')';};var _0x4a23f3={'where':{'id':_0x40392b[_0xf50b('0x45')]['id']}},_0x3a6101,_0x135d41,_0x1a21bc,_0x415c32,_0x4d0d3e;_0x4a23f3=_[_0xf50b('0x3e')]({},_0x4a23f3,_0x40392b[_0xf50b('0x3f')]);return db[_0xf50b('0x2a')][_0xf50b('0x4a')](_0x4a23f3)[_0xf50b('0x20')](function(_0x2324d2){if(_0x2324d2){_0x3a6101=_0x2324d2;return _0x2324d2[_0xf50b('0x85')]();}return null;})[_0xf50b('0x20')](function(_0x5e6041){if(_0x5e6041){if(!_0x5e6041[_0xf50b('0x35')]){throw new db[(_0xf50b('0x64'))][(_0xf50b('0x65'))](_0xf50b('0x66'),0x193);}_0x135d41=_0x5e6041;return db['AnalyticMetric']['findAll']({'raw':!![]});}return null;})['then'](function(_0x4ac860){if(_0x4ac860){_0x1a21bc=_['keyBy'](_0x4ac860,'id');var _0x2273c1;var _0x53ae15=squel[_0xf50b('0x6a')]();_0x53ae15[_0xf50b('0x6b')](_0x3a6101['table']);for(var _0x2ad825=0x0;_0x2ad825<_0x135d41[_0xf50b('0x35')];_0x2ad825+=0x1){_0x2273c1=_0x135d41[_0x2ad825]['MetricId']?_0x1a21bc[_0x135d41[_0x2ad825][_0xf50b('0x6c')]]['metric']:_0x135d41[_0x2ad825][_0xf50b('0x61')];_0x2273c1=_0x135d41[_0x2ad825]['function']?_['replace'](_0x4bcce3[_0x135d41[_0x2ad825][_0xf50b('0x6e')]],'%s',_0x2273c1):_0x2273c1;_0x2273c1=_0x135d41[_0x2ad825]['format']?_[_0xf50b('0x6d')](_0x10db4b[_0x135d41[_0x2ad825][_0xf50b('0x6f')]],'%s',_0x2273c1):_0x2273c1;if(_0x135d41[_0x2ad825][_0xf50b('0x87')]){_0x53ae15[_0xf50b('0x60')](_0x2273c1);}_0x135d41[_0x2ad825][_0xf50b('0x70')]&&_0x53ae15[_0xf50b('0x38')](_0x2273c1,_0x135d41[_0x2ad825][_0xf50b('0x70')]===_0xf50b('0x71')?![]:!![]);_0x53ae15['field'](_0x2273c1,_0x135d41[_0x2ad825][_0xf50b('0x72')]||_0x2273c1);}if(_0x3a6101[_0xf50b('0x73')]){_0x3a6101[_0xf50b('0x73')]=JSON[_0xf50b('0x74')](_0x3a6101['joins']);for(var _0x572e0a=0x0;_0x572e0a<_0x3a6101[_0xf50b('0x73')][_0xf50b('0x35')];_0x572e0a+=0x1){if(_0x3a6101['joins'][_0x572e0a][_0xf50b('0x2c')]&&_[_0xf50b('0x83')](_0x1786df,_0x3a6101[_0xf50b('0x73')][_0x572e0a][_0xf50b('0x2c')])&&_0x3a6101[_0xf50b('0x73')][_0x572e0a]['parentKey']&&_0x3a6101['joins'][_0x572e0a]['foreignTable']&&_0x3a6101[_0xf50b('0x73')][_0x572e0a][_0xf50b('0x77')]){_0x53ae15[_0x3a6101[_0xf50b('0x73')][_0x572e0a][_0xf50b('0x2c')]](_0x3a6101[_0xf50b('0x73')][_0x572e0a][_0xf50b('0x76')],null,util[_0xf50b('0x6f')]('%s.%s\x20=\x20%s.%s',_0x3a6101[_0xf50b('0x79')],_0x3a6101['joins'][_0x572e0a][_0xf50b('0x75')],_0x3a6101[_0xf50b('0x73')][_0x572e0a][_0xf50b('0x76')],_0x3a6101['joins'][_0x572e0a][_0xf50b('0x77')]));}}}if(_0x3a6101[_0xf50b('0x7a')]){_0x3a6101[_0xf50b('0x7a')]=JSON[_0xf50b('0x74')](_0x3a6101[_0xf50b('0x7a')]);_0x53ae15[_0xf50b('0x3a')](_0x31b572(_0x3a6101[_0xf50b('0x7a')][_0xf50b('0x60')]));}_0x4d0d3e=_0x53ae15[_0xf50b('0x7b')]();_0x53ae15['limit'](_0x526430);_0x53ae15[_0xf50b('0x17')](0x0);logger[_0xf50b('0x7c')](_0xf50b('0x7d'),_0x53ae15['toString']());return dbH['sequelize'][_0xf50b('0x2f')](_0x53ae15[_0xf50b('0x9a')](),{'type':dbH['sequelize'][_0xf50b('0x9d')][_0xf50b('0x7f')]});}})[_0xf50b('0x20')](function(){return{'sql':_0x4d0d3e[_0xf50b('0x9a')]()};})[_0xf50b('0x20')](respondWithResult(_0x1bd938,null))['catch'](handleError(_0x1bd938,null));};
\ No newline at end of file
+var _0xd3c5=['squel','crypto','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../mysqldb','dbH','sendStatus','status','end','offset','undefined','count','set','Content-Range','apply','reject','then','destroy','get','UserProfileResource','error','stack','name','send','index','map','rawAttributes','fieldName','type','key','query','keys','filters','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','limit','order','sort','where','pick','filter','merge','VIRTUAL','AnalyticCustomReport','includeAll','include','findAll','rows','catch','show','params','find','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','body','join','right_join','COUNT(%s)','MAX(%s)','AVG(%s)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)','SEC_TO_TIME(%s)','HOUR(%s)','ROUND(%s)','IS\x20NULL','IS\x20NOT\x20NULL','IS\x20EMPTY','rules','operator','group','field','condition','options','getFields','Sequelize','ValidationErrorItem','AnalyticMetric','select','from','table','MetricId','replace','function','groupBy','orderBy','DESC','alias','joins','includes','foreignTable','%s.%s\x20=\x20%s.%s','parentKey','foreignKey','conditions','parse','clone','Limited\x20Query:','toString','sequelize','QueryTypes','SELECT','cross_join','SUM(%s)','MIN(%s)','GROUP_CONCAT(%s)','DATE(%s)','value','Please\x20insert\x20at\x20least\x20one\x20field','keyBy','metric','format','output','web','fullPath','randomstring','custom','AnalyticExtractedReport','cdr','.calldate\x20BETWEEN\x20?\x20AND\x20?','startDate','.createdAt\x20BETWEEN\x20?\x20AND\x20?','endDate','info','Run\x20Query:','child_process','fork','../../components/export/','../../files/reports','countTable','COUNT(*)','runReport','left_join','COUNT(DISTINCT\x20%s)','UNIX_TIMESTAMP(%s)','IS\x20NOT\x20EMPTY','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','lodash'];(function(_0x3fa694,_0x477066){var _0x5d345c=function(_0x43d71f){while(--_0x43d71f){_0x3fa694['push'](_0x3fa694['shift']());}};_0x5d345c(++_0x477066);}(_0xd3c5,0x9a));var _0x5d3c=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xd3c5[_0x20a584];return _0x4b41a8;};'use strict';var emlformat=require(_0x5d3c('0x0'));var rimraf=require(_0x5d3c('0x1'));var zipdir=require(_0x5d3c('0x2'));var jsonpatch=require(_0x5d3c('0x3'));var rp=require(_0x5d3c('0x4'));var moment=require(_0x5d3c('0x5'));var BPromise=require(_0x5d3c('0x6'));var Mustache=require(_0x5d3c('0x7'));var util=require('util');var path=require(_0x5d3c('0x8'));var sox=require(_0x5d3c('0x9'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x5d3c('0xa'));var squel=require(_0x5d3c('0xb'));var crypto=require(_0x5d3c('0xc'));var jsforce=require('jsforce');var deskjs=require(_0x5d3c('0xd'));var toCsv=require('to-csv');var querystring=require(_0x5d3c('0xe'));var Papa=require(_0x5d3c('0xf'));var Redis=require(_0x5d3c('0x10'));var authService=require(_0x5d3c('0x11'));var qs=require('../../components/parsers/qs');var as=require(_0x5d3c('0x12'));var hardwareService=require(_0x5d3c('0x13'));var logger=require('../../config/logger')(_0x5d3c('0x14'));var utils=require(_0x5d3c('0x15'));var config=require(_0x5d3c('0x16'));var licenseUtil=require('../../config/license/util');var db=require(_0x5d3c('0x17'))['db'];var dbH=require(_0x5d3c('0x17'))[_0x5d3c('0x18')];function respondWithStatusCode(_0x5cad02,_0x140722){_0x140722=_0x140722||0xcc;return function(_0x12340b){if(_0x12340b){return _0x5cad02[_0x5d3c('0x19')](_0x140722);}return _0x5cad02[_0x5d3c('0x1a')](_0x140722)[_0x5d3c('0x1b')]();};}function respondWithResult(_0x2c2116,_0x11cb51){_0x11cb51=_0x11cb51||0xc8;return function(_0x328309){if(_0x328309){return _0x2c2116[_0x5d3c('0x1a')](_0x11cb51)['json'](_0x328309);}};}function respondWithFilteredResult(_0xcbf8e2,_0x47c114){return function(_0x411896){if(_0x411896){var _0x13e44f=typeof _0x47c114[_0x5d3c('0x1c')]===_0x5d3c('0x1d')&&typeof _0x47c114['limit']===_0x5d3c('0x1d');var _0x6ba636=_0x411896[_0x5d3c('0x1e')];var _0x1bcf40=_0x13e44f?0x0:_0x47c114['offset'];var _0x508915=_0x13e44f?_0x411896[_0x5d3c('0x1e')]:_0x47c114['offset']+_0x47c114['limit'];var _0x20ed36;if(_0x508915>=_0x6ba636){_0x508915=_0x6ba636;_0x20ed36=0xc8;}else{_0x20ed36=0xce;}_0xcbf8e2[_0x5d3c('0x1a')](_0x20ed36);return _0xcbf8e2[_0x5d3c('0x1f')](_0x5d3c('0x20'),_0x1bcf40+'-'+_0x508915+'/'+_0x6ba636)['json'](_0x411896);}return null;};}function patchUpdates(_0x119a82){return function(_0x34c9f8){try{jsonpatch[_0x5d3c('0x21')](_0x34c9f8,_0x119a82,!![]);}catch(_0x3b1bd6){return BPromise[_0x5d3c('0x22')](_0x3b1bd6);}return _0x34c9f8['save']();};}function saveUpdates(_0xcde6bf,_0x48b6cc){return function(_0x26ca92){if(_0x26ca92){return _0x26ca92['update'](_0xcde6bf)[_0x5d3c('0x23')](function(_0x1bdd10){return _0x1bdd10;});}return null;};}function removeEntity(_0x35d03b,_0x2eff95){return function(_0x3ab5e3){if(_0x3ab5e3){return _0x3ab5e3[_0x5d3c('0x24')]()[_0x5d3c('0x23')](function(){var _0x276000=_0x3ab5e3[_0x5d3c('0x25')]({'plain':!![]});var _0x204777='CustomReports';return db[_0x5d3c('0x26')][_0x5d3c('0x24')]({'where':{'type':_0x204777,'resourceId':_0x276000['id']}})[_0x5d3c('0x23')](function(){return _0x3ab5e3;});})[_0x5d3c('0x23')](function(){_0x35d03b[_0x5d3c('0x1a')](0xcc)['end']();});}};}function handleEntityNotFound(_0x220b4c,_0x5a3d29){return function(_0x43acd0){if(!_0x43acd0){_0x220b4c['sendStatus'](0x194);}return _0x43acd0;};}function handleError(_0x1d01f9,_0x3c3006){_0x3c3006=_0x3c3006||0x1f4;return function(_0x5bf3d6){logger[_0x5d3c('0x27')](_0x5bf3d6[_0x5d3c('0x28')]);if(_0x5bf3d6[_0x5d3c('0x29')]){delete _0x5bf3d6[_0x5d3c('0x29')];}_0x1d01f9['status'](_0x3c3006)[_0x5d3c('0x2a')](_0x5bf3d6);};}exports[_0x5d3c('0x2b')]=function(_0x14e0fd,_0x2a16a3){var _0x562a5c={},_0x18c16c={},_0x4666c6={'count':0x0,'rows':[]};var _0x158777=_[_0x5d3c('0x2c')](db['AnalyticCustomReport'][_0x5d3c('0x2d')],function(_0x5afc2f){return{'name':_0x5afc2f[_0x5d3c('0x2e')],'type':_0x5afc2f[_0x5d3c('0x2f')][_0x5d3c('0x30')]};});_0x18c16c['model']=_[_0x5d3c('0x2c')](_0x158777,_0x5d3c('0x29'));_0x18c16c[_0x5d3c('0x31')]=_[_0x5d3c('0x32')](_0x14e0fd[_0x5d3c('0x31')]);_0x18c16c[_0x5d3c('0x33')]=_[_0x5d3c('0x34')](_0x18c16c[_0x5d3c('0x35')],_0x18c16c[_0x5d3c('0x31')]);_0x562a5c[_0x5d3c('0x36')]=_['intersection'](_0x18c16c[_0x5d3c('0x35')],qs[_0x5d3c('0x37')](_0x14e0fd[_0x5d3c('0x31')][_0x5d3c('0x37')]));_0x562a5c['attributes']=_0x562a5c[_0x5d3c('0x36')][_0x5d3c('0x38')]?_0x562a5c[_0x5d3c('0x36')]:_0x18c16c[_0x5d3c('0x35')];if(!_0x14e0fd[_0x5d3c('0x31')][_0x5d3c('0x39')](_0x5d3c('0x3a'))){_0x562a5c[_0x5d3c('0x3b')]=qs['limit'](_0x14e0fd['query']['limit']);_0x562a5c[_0x5d3c('0x1c')]=qs[_0x5d3c('0x1c')](_0x14e0fd[_0x5d3c('0x31')][_0x5d3c('0x1c')]);}_0x562a5c[_0x5d3c('0x3c')]=qs[_0x5d3c('0x3d')](_0x14e0fd[_0x5d3c('0x31')][_0x5d3c('0x3d')]);_0x562a5c[_0x5d3c('0x3e')]=qs[_0x5d3c('0x33')](_[_0x5d3c('0x3f')](_0x14e0fd['query'],_0x18c16c[_0x5d3c('0x33')]),_0x158777);if(_0x14e0fd[_0x5d3c('0x31')][_0x5d3c('0x40')]){_0x562a5c[_0x5d3c('0x3e')]=_[_0x5d3c('0x41')](_0x562a5c['where'],{'$or':_[_0x5d3c('0x2c')](_0x158777,function(_0x581cec){if(_0x581cec['type']!==_0x5d3c('0x42')){var _0x3c1c10={};_0x3c1c10[_0x581cec[_0x5d3c('0x29')]]={'$like':'%'+_0x14e0fd[_0x5d3c('0x31')][_0x5d3c('0x40')]+'%'};return _0x3c1c10;}})});}_0x562a5c=_[_0x5d3c('0x41')]({},_0x562a5c,_0x14e0fd['options']);var _0x75e500={'where':_0x562a5c[_0x5d3c('0x3e')]};return db[_0x5d3c('0x43')]['count'](_0x75e500)[_0x5d3c('0x23')](function(_0xb06b64){_0x4666c6['count']=_0xb06b64;if(_0x14e0fd[_0x5d3c('0x31')][_0x5d3c('0x44')]){_0x562a5c[_0x5d3c('0x45')]=[{'all':!![]}];}return db[_0x5d3c('0x43')][_0x5d3c('0x46')](_0x562a5c);})['then'](function(_0x841d24){_0x4666c6[_0x5d3c('0x47')]=_0x841d24;return _0x4666c6;})[_0x5d3c('0x23')](respondWithFilteredResult(_0x2a16a3,_0x562a5c))[_0x5d3c('0x48')](handleError(_0x2a16a3,null));};exports[_0x5d3c('0x49')]=function(_0x9d3dcc,_0x37e627){var _0x41480c={'raw':![],'where':{'id':_0x9d3dcc[_0x5d3c('0x4a')]['id']}},_0x1cfbb3={};_0x1cfbb3[_0x5d3c('0x35')]=_[_0x5d3c('0x32')](db[_0x5d3c('0x43')][_0x5d3c('0x2d')]);_0x1cfbb3['query']=_[_0x5d3c('0x32')](_0x9d3dcc[_0x5d3c('0x31')]);_0x1cfbb3[_0x5d3c('0x33')]=_[_0x5d3c('0x34')](_0x1cfbb3[_0x5d3c('0x35')],_0x1cfbb3[_0x5d3c('0x31')]);_0x41480c[_0x5d3c('0x36')]=_[_0x5d3c('0x34')](_0x1cfbb3[_0x5d3c('0x35')],qs[_0x5d3c('0x37')](_0x9d3dcc[_0x5d3c('0x31')][_0x5d3c('0x37')]));_0x41480c[_0x5d3c('0x36')]=_0x41480c[_0x5d3c('0x36')]['length']?_0x41480c[_0x5d3c('0x36')]:_0x1cfbb3['model'];if(_0x9d3dcc[_0x5d3c('0x31')]['includeAll']){_0x41480c[_0x5d3c('0x45')]=[{'all':!![]}];}_0x41480c=_[_0x5d3c('0x41')]({},_0x41480c,_0x9d3dcc['options']);return db['AnalyticCustomReport'][_0x5d3c('0x4b')](_0x41480c)[_0x5d3c('0x23')](handleEntityNotFound(_0x37e627,null))[_0x5d3c('0x23')](respondWithResult(_0x37e627,null))[_0x5d3c('0x48')](handleError(_0x37e627,null));};exports[_0x5d3c('0x4c')]=function(_0x4b1e0f,_0x1eea9d){return db[_0x5d3c('0x43')][_0x5d3c('0x4c')](_0x4b1e0f['body'],{})['then'](function(_0xd383ae){var _0x5bd284=_0x4b1e0f[_0x5d3c('0x4d')]['get']({'plain':!![]});if(!_0x5bd284)throw new Error(_0x5d3c('0x4e'));if(_0x5bd284[_0x5d3c('0x4f')]===_0x5d3c('0x4d')){var _0x4db062=_0xd383ae[_0x5d3c('0x25')]({'plain':!![]});var _0x3f8f4f='Reports';return db['UserProfileSection'][_0x5d3c('0x4b')]({'where':{'name':_0x3f8f4f,'userProfileId':_0x5bd284[_0x5d3c('0x50')]},'raw':!![]})['then'](function(_0x207acb){if(_0x207acb&&_0x207acb['autoAssociation']===0x0){return db[_0x5d3c('0x26')][_0x5d3c('0x4c')]({'name':_0x4db062[_0x5d3c('0x29')],'resourceId':_0x4db062['id'],'type':'CustomReports','sectionId':_0x207acb['id']},{})['then'](function(){return _0xd383ae;});}else{return _0xd383ae;}})[_0x5d3c('0x48')](function(_0x3937ac){logger[_0x5d3c('0x27')](_0x5d3c('0x51'),_0x3937ac);throw _0x3937ac;});}return _0xd383ae;})[_0x5d3c('0x23')](respondWithResult(_0x1eea9d,0xc9))[_0x5d3c('0x48')](handleError(_0x1eea9d,null));};exports[_0x5d3c('0x52')]=function(_0x2cf5fa,_0x41d1c9){if(_0x2cf5fa[_0x5d3c('0x53')]['id']){delete _0x2cf5fa[_0x5d3c('0x53')]['id'];}return db['AnalyticCustomReport'][_0x5d3c('0x4b')]({'where':{'id':_0x2cf5fa[_0x5d3c('0x4a')]['id']}})[_0x5d3c('0x23')](handleEntityNotFound(_0x41d1c9,null))['then'](saveUpdates(_0x2cf5fa[_0x5d3c('0x53')],null))[_0x5d3c('0x23')](respondWithResult(_0x41d1c9,null))[_0x5d3c('0x48')](handleError(_0x41d1c9,null));};exports[_0x5d3c('0x24')]=function(_0xf0556a,_0x54ff16){return db[_0x5d3c('0x43')][_0x5d3c('0x4b')]({'where':{'id':_0xf0556a[_0x5d3c('0x4a')]['id']}})[_0x5d3c('0x23')](handleEntityNotFound(_0x54ff16,null))[_0x5d3c('0x23')](removeEntity(_0x54ff16,null))[_0x5d3c('0x48')](handleError(_0x54ff16,null));};exports['preview']=function(_0x29335d,_0x594966){var _0x69e8ed=0xa;var _0x12db24=[_0x5d3c('0x54'),'left_join',_0x5d3c('0x55'),'cross_join'];var _0x3fa2ec={'SUM':'SUM(%s)','COUNT':_0x5d3c('0x56'),'COUNT DISTINCT':'COUNT(DISTINCT\x20%s)','MAX':_0x5d3c('0x57'),'MIN':'MIN(%s)','AVG':_0x5d3c('0x58'),'GROUP_CONCAT':'GROUP_CONCAT(%s)','GROUP_CONCAT ASC':_0x5d3c('0x59'),'GROUP_CONCAT DESC':_0x5d3c('0x5a')};var _0x568be1={'SEC_TO_TIME':_0x5d3c('0x5b'),'DATE':'DATE(%s)','HOUR':_0x5d3c('0x5c'),'ROUND':_0x5d3c('0x5d'),'UNIX_TIMESTAMP':'UNIX_TIMESTAMP(%s)'};var _0x34cbc3=function(_0x41618f){return!_['includes']([_0x5d3c('0x5e'),_0x5d3c('0x5f'),_0x5d3c('0x60'),'IS\x20NOT\x20EMPTY'],_0x41618f);};var _0x4a52db=function(_0x5d2ddd){if(!_0x5d2ddd||!_0x5d2ddd['rules'][_0x5d3c('0x38')]){return'';}for(var _0x2799ba='(',_0x3ff7eb=0x0;_0x3ff7eb<_0x5d2ddd[_0x5d3c('0x61')][_0x5d3c('0x38')];_0x3ff7eb+=0x1){_0x3ff7eb>0x0&&(_0x2799ba+='\x20'+_0x5d2ddd[_0x5d3c('0x62')]+'\x20');_0x2799ba+=_0x5d2ddd[_0x5d3c('0x61')][_0x3ff7eb][_0x5d3c('0x63')]?_0x4a52db(_0x5d2ddd[_0x5d3c('0x61')][_0x3ff7eb][_0x5d3c('0x63')]):_0x5d2ddd['rules'][_0x3ff7eb][_0x5d3c('0x64')]+'\x20'+_0x5d2ddd[_0x5d3c('0x61')][_0x3ff7eb][_0x5d3c('0x65')]+(_0x34cbc3(_0x5d2ddd[_0x5d3c('0x61')][_0x3ff7eb][_0x5d3c('0x65')])?'\x20'+_0x5d2ddd[_0x5d3c('0x61')][_0x3ff7eb]['value']:'');}return _0x2799ba+')';};var _0x2953db={'where':{'id':_0x29335d[_0x5d3c('0x4a')]['id']}},_0x32d0cb,_0x403eef,_0x388c9f,_0x5c95f4,_0x1b7bc9;_0x2953db=_[_0x5d3c('0x41')]({},_0x2953db,_0x29335d[_0x5d3c('0x66')]);return db[_0x5d3c('0x43')][_0x5d3c('0x4b')](_0x2953db)['then'](function(_0xe0437d){if(_0xe0437d){_0x32d0cb=_0xe0437d;return _0xe0437d[_0x5d3c('0x67')]();}return null;})[_0x5d3c('0x23')](function(_0x3c51c8){if(_0x3c51c8){if(!_0x3c51c8['length']){throw new db[(_0x5d3c('0x68'))][(_0x5d3c('0x69'))]('Please\x20insert\x20at\x20least\x20one\x20field',0x193);}_0x403eef=_0x3c51c8;return db[_0x5d3c('0x6a')]['findAll']({'raw':!![]});}return null;})[_0x5d3c('0x23')](function(_0x52ee1d){if(_0x52ee1d){_0x388c9f=_['keyBy'](_0x52ee1d,'id');var _0x9c1a32;var _0x4f0de9=squel[_0x5d3c('0x6b')]();_0x4f0de9[_0x5d3c('0x6c')](_0x32d0cb[_0x5d3c('0x6d')]);for(var _0x341269=0x0;_0x341269<_0x403eef[_0x5d3c('0x38')];_0x341269+=0x1){_0x9c1a32=_0x403eef[_0x341269][_0x5d3c('0x6e')]?_0x388c9f[_0x403eef[_0x341269][_0x5d3c('0x6e')]]['metric']:_0x403eef[_0x341269][_0x5d3c('0x64')];_0x9c1a32=_0x403eef[_0x341269]['function']?_[_0x5d3c('0x6f')](_0x3fa2ec[_0x403eef[_0x341269][_0x5d3c('0x70')]],'%s',_0x9c1a32):_0x9c1a32;_0x9c1a32=_0x403eef[_0x341269]['format']?_[_0x5d3c('0x6f')](_0x568be1[_0x403eef[_0x341269]['format']],'%s',_0x9c1a32):_0x9c1a32;if(_0x403eef[_0x341269][_0x5d3c('0x71')]){_0x4f0de9['group'](_0x9c1a32);}_0x403eef[_0x341269][_0x5d3c('0x72')]&&_0x4f0de9[_0x5d3c('0x3c')](_0x9c1a32,_0x403eef[_0x341269][_0x5d3c('0x72')]===_0x5d3c('0x73')?![]:!![]);_0x4f0de9[_0x5d3c('0x64')](_0x9c1a32,_0x403eef[_0x341269][_0x5d3c('0x74')]||_0x9c1a32);}if(_0x32d0cb['joins']){_0x32d0cb['joins']=JSON['parse'](_0x32d0cb['joins']);for(var _0x38daa1=0x0;_0x38daa1<_0x32d0cb[_0x5d3c('0x75')][_0x5d3c('0x38')];_0x38daa1+=0x1){if(_0x32d0cb[_0x5d3c('0x75')][_0x38daa1][_0x5d3c('0x2f')]&&_[_0x5d3c('0x76')](_0x12db24,_0x32d0cb[_0x5d3c('0x75')][_0x38daa1][_0x5d3c('0x2f')])&&_0x32d0cb[_0x5d3c('0x75')][_0x38daa1]['parentKey']&&_0x32d0cb[_0x5d3c('0x75')][_0x38daa1][_0x5d3c('0x77')]&&_0x32d0cb[_0x5d3c('0x75')][_0x38daa1]['foreignKey']){_0x4f0de9[_0x32d0cb[_0x5d3c('0x75')][_0x38daa1][_0x5d3c('0x2f')]](_0x32d0cb[_0x5d3c('0x75')][_0x38daa1][_0x5d3c('0x77')],null,util['format'](_0x5d3c('0x78'),_0x32d0cb[_0x5d3c('0x6d')],_0x32d0cb[_0x5d3c('0x75')][_0x38daa1][_0x5d3c('0x79')],_0x32d0cb['joins'][_0x38daa1][_0x5d3c('0x77')],_0x32d0cb['joins'][_0x38daa1][_0x5d3c('0x7a')]));}}}if(_0x32d0cb[_0x5d3c('0x7b')]){_0x32d0cb[_0x5d3c('0x7b')]=JSON[_0x5d3c('0x7c')](_0x32d0cb[_0x5d3c('0x7b')]);_0x4f0de9[_0x5d3c('0x3e')](_0x4a52db(_0x32d0cb['conditions']['group']));}_0x1b7bc9=_0x4f0de9[_0x5d3c('0x7d')]();_0x4f0de9[_0x5d3c('0x3b')](_0x69e8ed);_0x4f0de9[_0x5d3c('0x1c')](0x0);logger['debug'](_0x5d3c('0x7e'),_0x4f0de9[_0x5d3c('0x7f')]());return dbH[_0x5d3c('0x80')][_0x5d3c('0x31')](_0x4f0de9[_0x5d3c('0x7f')](),{'type':dbH[_0x5d3c('0x80')][_0x5d3c('0x81')][_0x5d3c('0x82')]});}})[_0x5d3c('0x23')](respondWithResult(_0x594966,null))[_0x5d3c('0x48')](handleError(_0x594966,null));};function runReport(_0x308bd0,_0x282889,_0xd7351){var _0x3441a4=_0x282889[_0x5d3c('0x29')];var _0x40459f=0xa;var _0x1807f1=[_0x5d3c('0x54'),'left_join',_0x5d3c('0x55'),_0x5d3c('0x83')];var _0x129b0b={'SUM':_0x5d3c('0x84'),'COUNT':_0x5d3c('0x56'),'COUNT DISTINCT':'COUNT(DISTINCT\x20%s)','MAX':_0x5d3c('0x57'),'MIN':_0x5d3c('0x85'),'AVG':_0x5d3c('0x58'),'GROUP_CONCAT':_0x5d3c('0x86'),'GROUP_CONCAT ASC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT DESC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)'};var _0x222bd9={'SEC_TO_TIME':_0x5d3c('0x5b'),'DATE':_0x5d3c('0x87'),'HOUR':_0x5d3c('0x5c'),'ROUND':'ROUND(%s)','UNIX_TIMESTAMP':'UNIX_TIMESTAMP(%s)'};var _0x51ec31=function(_0x57b340){return!_[_0x5d3c('0x76')]([_0x5d3c('0x5e'),_0x5d3c('0x5f'),_0x5d3c('0x60'),'IS\x20NOT\x20EMPTY'],_0x57b340);};var _0x1dff23=function(_0x36cced){if(!_0x36cced||!_0x36cced[_0x5d3c('0x61')][_0x5d3c('0x38')]){return'';}for(var _0x3a7798='(',_0x33cb79=0x0;_0x33cb79<_0x36cced['rules'][_0x5d3c('0x38')];_0x33cb79+=0x1){_0x33cb79>0x0&&(_0x3a7798+='\x20'+_0x36cced[_0x5d3c('0x62')]+'\x20');_0x3a7798+=_0x36cced[_0x5d3c('0x61')][_0x33cb79][_0x5d3c('0x63')]?_0x1dff23(_0x36cced[_0x5d3c('0x61')][_0x33cb79][_0x5d3c('0x63')]):_0x36cced['rules'][_0x33cb79][_0x5d3c('0x64')]+'\x20'+_0x36cced[_0x5d3c('0x61')][_0x33cb79]['condition']+(_0x51ec31(_0x36cced[_0x5d3c('0x61')][_0x33cb79]['condition'])?'\x20'+_0x36cced[_0x5d3c('0x61')][_0x33cb79][_0x5d3c('0x88')]:'');}return _0x3a7798+')';};var _0x731fb2={'where':{'id':_0x308bd0['id']}},_0x530228,_0x374105,_0x39d458,_0x330be2,_0x324813;_0x731fb2=_['merge']({},_0x731fb2,_0xd7351);return db[_0x5d3c('0x43')]['find'](_0x731fb2)[_0x5d3c('0x23')](function(_0x28c889){if(_0x28c889){_0x530228=_0x28c889;return _0x28c889[_0x5d3c('0x67')]();}return null;})[_0x5d3c('0x23')](function(_0x372984){if(_0x372984){if(!_0x372984[_0x5d3c('0x38')]){throw new db[(_0x5d3c('0x68'))]['ValidationErrorItem'](_0x5d3c('0x89'),0x193);}_0x374105=_0x372984;return db[_0x5d3c('0x6a')][_0x5d3c('0x46')]({'raw':!![]});}return null;})[_0x5d3c('0x23')](function(_0x55c8b7){if(_0x55c8b7){_0x39d458=_[_0x5d3c('0x8a')](_0x55c8b7,'id');var _0x1f2c4f;var _0x56dc92=squel[_0x5d3c('0x6b')]();_0x56dc92[_0x5d3c('0x6c')](_0x530228[_0x5d3c('0x6d')]);for(var _0x2c0f3f=0x0;_0x2c0f3f<_0x374105['length'];_0x2c0f3f+=0x1){_0x1f2c4f=_0x374105[_0x2c0f3f][_0x5d3c('0x6e')]?_0x39d458[_0x374105[_0x2c0f3f][_0x5d3c('0x6e')]][_0x5d3c('0x8b')]:_0x374105[_0x2c0f3f][_0x5d3c('0x64')];_0x1f2c4f=_0x374105[_0x2c0f3f][_0x5d3c('0x70')]?_[_0x5d3c('0x6f')](_0x129b0b[_0x374105[_0x2c0f3f][_0x5d3c('0x70')]],'%s',_0x1f2c4f):_0x1f2c4f;_0x1f2c4f=_0x374105[_0x2c0f3f][_0x5d3c('0x8c')]?_[_0x5d3c('0x6f')](_0x222bd9[_0x374105[_0x2c0f3f][_0x5d3c('0x8c')]],'%s',_0x1f2c4f):_0x1f2c4f;if(_0x374105[_0x2c0f3f][_0x5d3c('0x71')]){_0x56dc92['group'](_0x1f2c4f);}_0x374105[_0x2c0f3f][_0x5d3c('0x72')]&&_0x56dc92['order'](_0x1f2c4f,_0x374105[_0x2c0f3f][_0x5d3c('0x72')]===_0x5d3c('0x73')?![]:!![]);_0x56dc92['field'](_0x1f2c4f,_0x374105[_0x2c0f3f][_0x5d3c('0x74')]||_0x1f2c4f);}if(_0x530228[_0x5d3c('0x75')]){_0x530228[_0x5d3c('0x75')]=JSON[_0x5d3c('0x7c')](_0x530228[_0x5d3c('0x75')]);for(var _0x45a3c6=0x0;_0x45a3c6<_0x530228[_0x5d3c('0x75')][_0x5d3c('0x38')];_0x45a3c6+=0x1){if(_0x530228[_0x5d3c('0x75')][_0x45a3c6][_0x5d3c('0x2f')]&&_[_0x5d3c('0x76')](_0x1807f1,_0x530228[_0x5d3c('0x75')][_0x45a3c6][_0x5d3c('0x2f')])&&_0x530228['joins'][_0x45a3c6]['parentKey']&&_0x530228[_0x5d3c('0x75')][_0x45a3c6][_0x5d3c('0x77')]&&_0x530228[_0x5d3c('0x75')][_0x45a3c6][_0x5d3c('0x7a')]){_0x56dc92[_0x530228['joins'][_0x45a3c6][_0x5d3c('0x2f')]](_0x530228[_0x5d3c('0x75')][_0x45a3c6][_0x5d3c('0x77')],null,util[_0x5d3c('0x8c')](_0x5d3c('0x78'),_0x530228[_0x5d3c('0x6d')],_0x530228[_0x5d3c('0x75')][_0x45a3c6]['parentKey'],_0x530228[_0x5d3c('0x75')][_0x45a3c6][_0x5d3c('0x77')],_0x530228[_0x5d3c('0x75')][_0x45a3c6][_0x5d3c('0x7a')]));}}}if(_0x530228[_0x5d3c('0x7b')]){_0x530228[_0x5d3c('0x7b')]=JSON['parse'](_0x530228['conditions']);_0x56dc92['where'](_0x1dff23(_0x530228[_0x5d3c('0x7b')][_0x5d3c('0x63')]));}_0x324813=_0x56dc92[_0x5d3c('0x7d')]();_0x56dc92[_0x5d3c('0x3b')](_0x40459f);_0x56dc92[_0x5d3c('0x1c')](0x0);return;}})['then'](function(){if(_0x282889[_0x5d3c('0x8d')]===_0x5d3c('0x8e')){return null;}var _0x1eb527=_[_0x5d3c('0x41')](_0x282889,{'name':_0x282889[_0x5d3c('0x8f')]||_0x282889['name']||_0x530228['name'],'basename':_0x3441a4,'savename':util[_0x5d3c('0x8c')]('%s-%s.%s',_0x282889[_0x5d3c('0x29')]||_0x530228[_0x5d3c('0x29')],require(_0x5d3c('0x90'))['generate'](0x4),_0x282889[_0x5d3c('0x8d')]||'csv'),'reportId':_0x530228['id'],'reportType':_0x5d3c('0x91')});return db[_0x5d3c('0x92')][_0x5d3c('0x4c')](_0x1eb527,{'raw':!![]});})[_0x5d3c('0x23')](function(_0x1a21de){if(_0x530228[_0x5d3c('0x6d')]===_0x5d3c('0x93')){_0x324813[_0x5d3c('0x3e')](_0x530228[_0x5d3c('0x6d')]+_0x5d3c('0x94'),_0x282889[_0x5d3c('0x95')],_0x282889['endDate']);}else{_0x324813[_0x5d3c('0x3e')](_0x530228[_0x5d3c('0x6d')]+_0x5d3c('0x96'),_0x282889[_0x5d3c('0x95')],_0x282889[_0x5d3c('0x97')]);}if(_0x1a21de){logger[_0x5d3c('0x98')](_0x5d3c('0x99'),_0x324813[_0x5d3c('0x7f')]());require(_0x5d3c('0x9a'))[_0x5d3c('0x9b')](path[_0x5d3c('0x54')](__dirname,_0x5d3c('0x9c'),_0x1a21de['output']),[_0x1a21de['id'],_0x324813[_0x5d3c('0x7f')](),path[_0x5d3c('0x54')](__dirname,_0x5d3c('0x9d'),_0x1a21de['savename']),_0x3441a4]);return _0x1a21de;}else{var _0x22c45c=squel[_0x5d3c('0x6b')]();_0x22c45c[_0x5d3c('0x6c')]('('+_0x324813[_0x5d3c('0x7f')]()+')',_0x5d3c('0x9e'));_0x22c45c[_0x5d3c('0x64')](_0x5d3c('0x9f'),_0x5d3c('0x1e'));_0x324813[_0x5d3c('0x3b')](_0x282889[_0x5d3c('0x3b')]||_0x40459f);_0x324813['offset'](_0x282889[_0x5d3c('0x1c')]||0x0);return dbH[_0x5d3c('0x80')]['query'](_0x22c45c[_0x5d3c('0x7f')](),{'type':dbH[_0x5d3c('0x80')]['QueryTypes'][_0x5d3c('0x82')]})[_0x5d3c('0x23')](function(_0x50d1f2){if(!_0x50d1f2[_0x5d3c('0x38')]){_0x330be2=0x0;}else{_0x330be2=_0x50d1f2[0x0][_0x5d3c('0x1e')]||0x0;}return dbH[_0x5d3c('0x80')][_0x5d3c('0x31')](_0x324813[_0x5d3c('0x7f')](),{'type':dbH[_0x5d3c('0x80')]['QueryTypes']['SELECT']});})[_0x5d3c('0x23')](function(_0x1fbe73){return{'rows':_0x1fbe73||[],'count':_0x330be2};});}});}exports['run']=function(_0x50258a,_0x48bc7b){return runReport(_0x50258a['params'],_0x50258a[_0x5d3c('0x31')],_0x50258a[_0x5d3c('0x66')])[_0x5d3c('0x23')](respondWithResult(_0x48bc7b,null))[_0x5d3c('0x48')](handleError(_0x48bc7b,null));};exports[_0x5d3c('0xa0')]=runReport;exports[_0x5d3c('0x31')]=function(_0x206e86,_0x491123){var _0x2f38a9=0xa;var _0x5de5b9=[_0x5d3c('0x54'),_0x5d3c('0xa1'),_0x5d3c('0x55'),_0x5d3c('0x83')];var _0x4fedac={'SUM':_0x5d3c('0x84'),'COUNT':_0x5d3c('0x56'),'COUNT DISTINCT':_0x5d3c('0xa2'),'MAX':_0x5d3c('0x57'),'MIN':_0x5d3c('0x85'),'AVG':_0x5d3c('0x58'),'GROUP_CONCAT':_0x5d3c('0x86'),'GROUP_CONCAT ASC':_0x5d3c('0x59'),'GROUP_CONCAT DESC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)'};var _0x2945cb={'SEC_TO_TIME':'SEC_TO_TIME(%s)','DATE':_0x5d3c('0x87'),'HOUR':_0x5d3c('0x5c'),'ROUND':_0x5d3c('0x5d'),'UNIX_TIMESTAMP':_0x5d3c('0xa3')};var _0x1e3a4b=function(_0x85786b){return!_[_0x5d3c('0x76')](['IS\x20NULL',_0x5d3c('0x5f'),'IS\x20EMPTY',_0x5d3c('0xa4')],_0x85786b);};var _0x2b63d3=function(_0x3e6fc3){if(!_0x3e6fc3||!_0x3e6fc3[_0x5d3c('0x61')]['length']){return'';}for(var _0x4f2130='(',_0x2d5fa0=0x0;_0x2d5fa0<_0x3e6fc3[_0x5d3c('0x61')][_0x5d3c('0x38')];_0x2d5fa0+=0x1){_0x2d5fa0>0x0&&(_0x4f2130+='\x20'+_0x3e6fc3[_0x5d3c('0x62')]+'\x20');_0x4f2130+=_0x3e6fc3['rules'][_0x2d5fa0]['group']?_0x2b63d3(_0x3e6fc3[_0x5d3c('0x61')][_0x2d5fa0][_0x5d3c('0x63')]):_0x3e6fc3['rules'][_0x2d5fa0]['field']+'\x20'+_0x3e6fc3[_0x5d3c('0x61')][_0x2d5fa0][_0x5d3c('0x65')]+(_0x1e3a4b(_0x3e6fc3[_0x5d3c('0x61')][_0x2d5fa0][_0x5d3c('0x65')])?'\x20'+_0x3e6fc3[_0x5d3c('0x61')][_0x2d5fa0][_0x5d3c('0x88')]:'');}return _0x4f2130+')';};var _0x34bedd={'where':{'id':_0x206e86[_0x5d3c('0x4a')]['id']}},_0x9ea147,_0x391727,_0x46705d,_0x586813,_0x43b512;_0x34bedd=_[_0x5d3c('0x41')]({},_0x34bedd,_0x206e86[_0x5d3c('0x66')]);return db[_0x5d3c('0x43')]['find'](_0x34bedd)[_0x5d3c('0x23')](function(_0x126fae){if(_0x126fae){_0x9ea147=_0x126fae;return _0x126fae[_0x5d3c('0x67')]();}return null;})[_0x5d3c('0x23')](function(_0x371ff2){if(_0x371ff2){if(!_0x371ff2['length']){throw new db[(_0x5d3c('0x68'))]['ValidationErrorItem'](_0x5d3c('0x89'),0x193);}_0x391727=_0x371ff2;return db['AnalyticMetric'][_0x5d3c('0x46')]({'raw':!![]});}return null;})[_0x5d3c('0x23')](function(_0x3a6087){if(_0x3a6087){_0x46705d=_[_0x5d3c('0x8a')](_0x3a6087,'id');var _0x28dc0f;var _0x3fc32b=squel['select']();_0x3fc32b[_0x5d3c('0x6c')](_0x9ea147[_0x5d3c('0x6d')]);for(var _0x329c47=0x0;_0x329c47<_0x391727['length'];_0x329c47+=0x1){_0x28dc0f=_0x391727[_0x329c47][_0x5d3c('0x6e')]?_0x46705d[_0x391727[_0x329c47][_0x5d3c('0x6e')]][_0x5d3c('0x8b')]:_0x391727[_0x329c47][_0x5d3c('0x64')];_0x28dc0f=_0x391727[_0x329c47]['function']?_['replace'](_0x4fedac[_0x391727[_0x329c47][_0x5d3c('0x70')]],'%s',_0x28dc0f):_0x28dc0f;_0x28dc0f=_0x391727[_0x329c47]['format']?_[_0x5d3c('0x6f')](_0x2945cb[_0x391727[_0x329c47][_0x5d3c('0x8c')]],'%s',_0x28dc0f):_0x28dc0f;if(_0x391727[_0x329c47][_0x5d3c('0x71')]){_0x3fc32b['group'](_0x28dc0f);}_0x391727[_0x329c47][_0x5d3c('0x72')]&&_0x3fc32b[_0x5d3c('0x3c')](_0x28dc0f,_0x391727[_0x329c47][_0x5d3c('0x72')]===_0x5d3c('0x73')?![]:!![]);_0x3fc32b[_0x5d3c('0x64')](_0x28dc0f,_0x391727[_0x329c47][_0x5d3c('0x74')]||_0x28dc0f);}if(_0x9ea147[_0x5d3c('0x75')]){_0x9ea147[_0x5d3c('0x75')]=JSON[_0x5d3c('0x7c')](_0x9ea147['joins']);for(var _0x433014=0x0;_0x433014<_0x9ea147[_0x5d3c('0x75')][_0x5d3c('0x38')];_0x433014+=0x1){if(_0x9ea147[_0x5d3c('0x75')][_0x433014][_0x5d3c('0x2f')]&&_[_0x5d3c('0x76')](_0x5de5b9,_0x9ea147[_0x5d3c('0x75')][_0x433014]['type'])&&_0x9ea147[_0x5d3c('0x75')][_0x433014]['parentKey']&&_0x9ea147[_0x5d3c('0x75')][_0x433014][_0x5d3c('0x77')]&&_0x9ea147[_0x5d3c('0x75')][_0x433014][_0x5d3c('0x7a')]){_0x3fc32b[_0x9ea147[_0x5d3c('0x75')][_0x433014][_0x5d3c('0x2f')]](_0x9ea147[_0x5d3c('0x75')][_0x433014][_0x5d3c('0x77')],null,util[_0x5d3c('0x8c')](_0x5d3c('0x78'),_0x9ea147[_0x5d3c('0x6d')],_0x9ea147['joins'][_0x433014][_0x5d3c('0x79')],_0x9ea147['joins'][_0x433014][_0x5d3c('0x77')],_0x9ea147[_0x5d3c('0x75')][_0x433014]['foreignKey']));}}}if(_0x9ea147['conditions']){_0x9ea147[_0x5d3c('0x7b')]=JSON[_0x5d3c('0x7c')](_0x9ea147[_0x5d3c('0x7b')]);_0x3fc32b[_0x5d3c('0x3e')](_0x2b63d3(_0x9ea147['conditions'][_0x5d3c('0x63')]));}_0x43b512=_0x3fc32b[_0x5d3c('0x7d')]();_0x3fc32b[_0x5d3c('0x3b')](_0x2f38a9);_0x3fc32b[_0x5d3c('0x1c')](0x0);logger['debug'](_0x5d3c('0x7e'),_0x3fc32b[_0x5d3c('0x7f')]());return dbH[_0x5d3c('0x80')][_0x5d3c('0x31')](_0x3fc32b['toString'](),{'type':dbH[_0x5d3c('0x80')][_0x5d3c('0x81')][_0x5d3c('0x82')]});}})[_0x5d3c('0x23')](function(){return{'sql':_0x43b512[_0x5d3c('0x7f')]()};})['then'](respondWithResult(_0x491123,null))[_0x5d3c('0x48')](handleError(_0x491123,null));};
\ No newline at end of file
diff --git a/server/api/analyticCustomReport/analyticCustomReport.model.js b/server/api/analyticCustomReport/analyticCustomReport.model.js
index 02f74ed..fde3803 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 _0x9cb7=['path','rimraf','../../config/environment','./analyticCustomReport.attributes','define','analytics_custom_reports','lodash','util','../../config/logger','api','moment','bluebird','request-promise'];(function(_0x57e118,_0x99b7b8){var _0x58896c=function(_0xb83347){while(--_0xb83347){_0x57e118['push'](_0x57e118['shift']());}};_0x58896c(++_0x99b7b8);}(_0x9cb7,0xbc));var _0x79cb=function(_0x41fe6b,_0x2aea0f){_0x41fe6b=_0x41fe6b-0x0;var _0x2c4d39=_0x9cb7[_0x41fe6b];return _0x2c4d39;};'use strict';var _=require(_0x79cb('0x0'));var util=require(_0x79cb('0x1'));var logger=require(_0x79cb('0x2'))(_0x79cb('0x3'));var moment=require(_0x79cb('0x4'));var BPromise=require(_0x79cb('0x5'));var rp=require(_0x79cb('0x6'));var fs=require('fs');var path=require(_0x79cb('0x7'));var rimraf=require(_0x79cb('0x8'));var config=require(_0x79cb('0x9'));var attributes=require(_0x79cb('0xa'));module['exports']=function(_0x419685,_0x37bb0c){return _0x419685[_0x79cb('0xb')]('AnalyticCustomReport',attributes,{'tableName':_0x79cb('0xc'),'paranoid':!![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xddb5=['rimraf','../../config/environment','exports','define','AnalyticCustomReport','analytics_custom_reports','util','../../config/logger','bluebird','request-promise','path'];(function(_0x3670e8,_0x3dc1d6){var _0x4b99cf=function(_0x19556c){while(--_0x19556c){_0x3670e8['push'](_0x3670e8['shift']());}};_0x4b99cf(++_0x3dc1d6);}(_0xddb5,0xab));var _0x5ddb=function(_0x3947c9,_0x4d6c97){_0x3947c9=_0x3947c9-0x0;var _0x2e7871=_0xddb5[_0x3947c9];return _0x2e7871;};'use strict';var _=require('lodash');var util=require(_0x5ddb('0x0'));var logger=require(_0x5ddb('0x1'))('api');var moment=require('moment');var BPromise=require(_0x5ddb('0x2'));var rp=require(_0x5ddb('0x3'));var fs=require('fs');var path=require(_0x5ddb('0x4'));var rimraf=require(_0x5ddb('0x5'));var config=require(_0x5ddb('0x6'));var attributes=require('./analyticCustomReport.attributes');module[_0x5ddb('0x7')]=function(_0x18b686,_0x4f352c){return _0x18b686[_0x5ddb('0x8')](_0x5ddb('0x9'),attributes,{'tableName':_0x5ddb('0xa'),'paranoid':!![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
diff --git a/server/api/analyticCustomReport/analyticCustomReport.rpc.js b/server/api/analyticCustomReport/analyticCustomReport.rpc.js
index 8277f7d..0c34986 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 _0x157e=['code','message','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','AnalyticCustomReport,\x20%s,\x20%s','request\x20sent','debug','AnalyticCustomReport,\x20%s,\x20%s,\x20%s','stringify','error'];(function(_0x16404b,_0x28a2dc){var _0x55fa00=function(_0x595d67){while(--_0x595d67){_0x16404b['push'](_0x16404b['shift']());}};_0x55fa00(++_0x28a2dc);}(_0x157e,0x9c));var _0xe157=function(_0x112e2a,_0x364486){_0x112e2a=_0x112e2a-0x0;var _0x4f8af9=_0x157e[_0x112e2a];return _0x4f8af9;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0xe157('0x0'));var BPromise=require(_0xe157('0x1'));var rs=require(_0xe157('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xe157('0x3'))['db'];var utils=require(_0xe157('0x4'));var logger=require(_0xe157('0x5'))(_0xe157('0x6'));var config=require(_0xe157('0x7'));var jayson=require(_0xe157('0x8'));var client=jayson[_0xe157('0x9')][_0xe157('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x4262b9,_0x107fd3,_0x17770a){return new BPromise(function(_0x4f1980,_0x1b4606){return client[_0xe157('0xb')](_0x4262b9,_0x17770a)[_0xe157('0xc')](function(_0x3ec433){logger[_0xe157('0xd')](_0xe157('0xe'),_0x107fd3,_0xe157('0xf'));logger[_0xe157('0x10')](_0xe157('0x11'),_0x107fd3,_0xe157('0xf'),JSON[_0xe157('0x12')](_0x3ec433));if(_0x3ec433[_0xe157('0x13')]){if(_0x3ec433[_0xe157('0x13')][_0xe157('0x14')]===0x1f4){logger[_0xe157('0x13')](_0xe157('0xe'),_0x107fd3,_0x3ec433[_0xe157('0x13')][_0xe157('0x15')]);return _0x1b4606(_0x3ec433[_0xe157('0x13')][_0xe157('0x15')]);}logger['error'](_0xe157('0xe'),_0x107fd3,_0x3ec433[_0xe157('0x13')][_0xe157('0x15')]);return _0x4f1980(_0x3ec433[_0xe157('0x13')]['message']);}else{logger[_0xe157('0xd')](_0xe157('0xe'),_0x107fd3,_0xe157('0xf'));_0x4f1980(_0x3ec433['result'][_0xe157('0x15')]);}})['catch'](function(_0x1bcde1){logger['error'](_0xe157('0xe'),_0x107fd3,_0x1bcde1);_0x1b4606(_0x1bcde1);});});}
\ No newline at end of file
+var _0x61d9=['catch','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','info','AnalyticCustomReport,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result'];(function(_0x501510,_0x61caa9){var _0x1e6ee5=function(_0x32845b){while(--_0x32845b){_0x501510['push'](_0x501510['shift']());}};_0x1e6ee5(++_0x61caa9);}(_0x61d9,0x1b9));var _0x961d=function(_0x133079,_0x2f6535){_0x133079=_0x133079-0x0;var _0x97e20f=_0x61d9[_0x133079];return _0x97e20f;};'use strict';var _=require(_0x961d('0x0'));var util=require(_0x961d('0x1'));var moment=require(_0x961d('0x2'));var BPromise=require(_0x961d('0x3'));var rs=require(_0x961d('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x961d('0x5'))['db'];var utils=require(_0x961d('0x6'));var logger=require(_0x961d('0x7'))(_0x961d('0x8'));var config=require(_0x961d('0x9'));var jayson=require(_0x961d('0xa'));var client=jayson['client'][_0x961d('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x2a0fa2,_0x2820d2,_0x5871d9){return new BPromise(function(_0x115589,_0x25e3ad){return client['request'](_0x2a0fa2,_0x5871d9)['then'](function(_0xe924b1){logger[_0x961d('0xc')](_0x961d('0xd'),_0x2820d2,_0x961d('0xe'));logger[_0x961d('0xf')]('AnalyticCustomReport,\x20%s,\x20%s,\x20%s',_0x2820d2,_0x961d('0xe'),JSON[_0x961d('0x10')](_0xe924b1));if(_0xe924b1[_0x961d('0x11')]){if(_0xe924b1['error'][_0x961d('0x12')]===0x1f4){logger[_0x961d('0x11')](_0x961d('0xd'),_0x2820d2,_0xe924b1[_0x961d('0x11')][_0x961d('0x13')]);return _0x25e3ad(_0xe924b1[_0x961d('0x11')][_0x961d('0x13')]);}logger[_0x961d('0x11')](_0x961d('0xd'),_0x2820d2,_0xe924b1[_0x961d('0x11')][_0x961d('0x13')]);return _0x115589(_0xe924b1[_0x961d('0x11')][_0x961d('0x13')]);}else{logger['info']('AnalyticCustomReport,\x20%s,\x20%s',_0x2820d2,_0x961d('0xe'));_0x115589(_0xe924b1[_0x961d('0x14')][_0x961d('0x13')]);}})[_0x961d('0x15')](function(_0x3e559d){logger['error'](_0x961d('0xd'),_0x2820d2,_0x3e559d);_0x25e3ad(_0x3e559d);});});}
\ No newline at end of file
diff --git a/server/api/analyticCustomReport/index.js b/server/api/analyticCustomReport/index.js
index 219df1d..bd4f5f8 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 _0xaf08=['index','show','/:id/preview','preview','run','/:id/query','query','post','create','put','/:id','update','destroy','util','path','express','Router','fs-extra','../../components/auth/service','../../config/environment','./analyticCustomReport.controller','get','isAuthenticated'];(function(_0x5e3665,_0x369ac8){var _0x187299=function(_0x5c37f8){while(--_0x5c37f8){_0x5e3665['push'](_0x5e3665['shift']());}};_0x187299(++_0x369ac8);}(_0xaf08,0x138));var _0x8af0=function(_0xc7348b,_0x145880){_0xc7348b=_0xc7348b-0x0;var _0x307cec=_0xaf08[_0xc7348b];return _0x307cec;};'use strict';var multer=require('multer');var util=require(_0x8af0('0x0'));var path=require(_0x8af0('0x1'));var timeout=require('connect-timeout');var express=require(_0x8af0('0x2'));var router=express[_0x8af0('0x3')]();var fs_extra=require(_0x8af0('0x4'));var auth=require(_0x8af0('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x8af0('0x6'));var controller=require(_0x8af0('0x7'));router[_0x8af0('0x8')]('/',auth[_0x8af0('0x9')](),controller[_0x8af0('0xa')]);router[_0x8af0('0x8')]('/:id',auth[_0x8af0('0x9')](),controller[_0x8af0('0xb')]);router['get'](_0x8af0('0xc'),auth['isAuthenticated'](),controller[_0x8af0('0xd')]);router['get']('/:id/run',auth[_0x8af0('0x9')](),controller[_0x8af0('0xe')]);router[_0x8af0('0x8')](_0x8af0('0xf'),auth[_0x8af0('0x9')](),controller[_0x8af0('0x10')]);router[_0x8af0('0x11')]('/',auth[_0x8af0('0x9')](),controller[_0x8af0('0x12')]);router[_0x8af0('0x13')](_0x8af0('0x14'),auth[_0x8af0('0x9')](),controller[_0x8af0('0x15')]);router['delete']('/:id',auth[_0x8af0('0x9')](),controller[_0x8af0('0x16')]);module['exports']=router;
\ No newline at end of file
+var _0xf7de=['/:id/preview','preview','/:id/query','query','post','create','put','/:id','exports','util','path','express','Router','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','show'];(function(_0x5680cb,_0x18be32){var _0x3e8a55=function(_0x3d5190){while(--_0x3d5190){_0x5680cb['push'](_0x5680cb['shift']());}};_0x3e8a55(++_0x18be32);}(_0xf7de,0xed));var _0xef7d=function(_0x3ce09c,_0x1d7dd8){_0x3ce09c=_0x3ce09c-0x0;var _0x193a6f=_0xf7de[_0x3ce09c];return _0x193a6f;};'use strict';var multer=require('multer');var util=require(_0xef7d('0x0'));var path=require(_0xef7d('0x1'));var timeout=require('connect-timeout');var express=require(_0xef7d('0x2'));var router=express[_0xef7d('0x3')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0xef7d('0x4'));var config=require(_0xef7d('0x5'));var controller=require('./analyticCustomReport.controller');router[_0xef7d('0x6')]('/',auth[_0xef7d('0x7')](),controller[_0xef7d('0x8')]);router[_0xef7d('0x6')]('/:id',auth[_0xef7d('0x7')](),controller[_0xef7d('0x9')]);router[_0xef7d('0x6')](_0xef7d('0xa'),auth[_0xef7d('0x7')](),controller[_0xef7d('0xb')]);router[_0xef7d('0x6')]('/:id/run',auth['isAuthenticated'](),controller['run']);router[_0xef7d('0x6')](_0xef7d('0xc'),auth[_0xef7d('0x7')](),controller[_0xef7d('0xd')]);router[_0xef7d('0xe')]('/',auth[_0xef7d('0x7')](),controller[_0xef7d('0xf')]);router[_0xef7d('0x10')](_0xef7d('0x11'),auth[_0xef7d('0x7')](),controller['update']);router['delete']('/:id',auth[_0xef7d('0x7')](),controller['destroy']);module[_0xef7d('0x12')]=router;
\ No newline at end of file
diff --git a/server/api/analyticDefaultReport/analyticDefaultReport.attributes.js b/server/api/analyticDefaultReport/analyticDefaultReport.attributes.js
index 1965a14..ea5dce0 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 _0x31f0=['sequelize','STRING','TEXT'];(function(_0x2a275f,_0x14b467){var _0x445d29=function(_0x239cdb){while(--_0x239cdb){_0x2a275f['push'](_0x2a275f['shift']());}};_0x445d29(++_0x14b467);}(_0x31f0,0xb7));var _0x031f=function(_0x8b4957,_0xb90afa){_0x8b4957=_0x8b4957-0x0;var _0x54b3e4=_0x31f0[_0x8b4957];return _0x54b3e4;};'use strict';var Sequelize=require(_0x031f('0x0'));module['exports']={'name':{'type':Sequelize[_0x031f('0x1')],'allowNull':![]},'description':{'type':Sequelize['STRING']},'parent':{'type':Sequelize[_0x031f('0x1')]},'table':{'type':Sequelize[_0x031f('0x1')]},'conditions':{'type':Sequelize[_0x031f('0x2')]},'joins':{'type':Sequelize[_0x031f('0x2')]}};
\ No newline at end of file
+var _0x7fbe=['STRING','TEXT'];(function(_0x3ceb6c,_0x554602){var _0x256814=function(_0x7800cf){while(--_0x7800cf){_0x3ceb6c['push'](_0x3ceb6c['shift']());}};_0x256814(++_0x554602);}(_0x7fbe,0x1ec));var _0xe7fb=function(_0x2bd007,_0x281ba0){_0x2bd007=_0x2bd007-0x0;var _0x53c252=_0x7fbe[_0x2bd007];return _0x53c252;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize[_0xe7fb('0x0')],'allowNull':![]},'description':{'type':Sequelize[_0xe7fb('0x0')]},'parent':{'type':Sequelize[_0xe7fb('0x0')]},'table':{'type':Sequelize[_0xe7fb('0x0')]},'conditions':{'type':Sequelize[_0xe7fb('0x1')]},'joins':{'type':Sequelize[_0xe7fb('0x1')]}};
\ No newline at end of file
diff --git a/server/api/analyticDefaultReport/analyticDefaultReport.controller.js b/server/api/analyticDefaultReport/analyticDefaultReport.controller.js
index 6be9bb5..8dc543d 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 _0xc4aa=['Content-Range','apply','reject','save','update','then','destroy','get','DefaultReports','UserProfileResource','name','map','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','hasOwnProperty','order','sort','where','merge','VIRTUAL','filter','options','includeAll','include','AnalyticDefaultReport','findAll','rows','catch','show','length','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','Reports','find','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','params','preview','join','left_join','right_join','cross_join','SUM(%s)','COUNT(DISTINCT\x20%s)','MIN(%s)','GROUP_CONCAT(%s)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)','DATE(%s)','HOUR(%s)','ROUND(%s)','UNIX_TIMESTAMP(%s)','IS\x20NULL','IS\x20EMPTY','rules','operator','group','field','condition','getFields','Sequelize','AnalyticMetric','keyBy','select','from','table','MetricId','metric','function','replace','format','orderBy','joins','parentKey','foreignTable','%s.%s\x20=\x20%s.%s','conditions','parse','clone','Limited\x20Query:','toString','sequelize','QueryTypes','SELECT','COUNT(%s)','MAX(%s)','AVG(%s)','SEC_TO_TIME(%s)','IS\x20NOT\x20EMPTY','value','ValidationErrorItem','Please\x20insert\x20at\x20least\x20one\x20field','groupBy','alias','includes','foreignKey','output','web','fullPath','%s-%s.%s','randomstring','default','AnalyticExtractedReport','.calldate\x20BETWEEN\x20?\x20AND\x20?','endDate','startDate','info','Run\x20Query:','child_process','fork','countTable','runReport','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','IS\x20NOT\x20NULL','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set'];(function(_0x5ba549,_0x425afd){var _0x36e3a1=function(_0x464308){while(--_0x464308){_0x5ba549['push'](_0x5ba549['shift']());}};_0x36e3a1(++_0x425afd);}(_0xc4aa,0x1b7));var _0xac4a=function(_0x199572,_0x33e667){_0x199572=_0x199572-0x0;var _0x13cfa3=_0xc4aa[_0x199572];return _0x13cfa3;};'use strict';var emlformat=require(_0xac4a('0x0'));var rimraf=require(_0xac4a('0x1'));var zipdir=require(_0xac4a('0x2'));var jsonpatch=require(_0xac4a('0x3'));var rp=require(_0xac4a('0x4'));var moment=require(_0xac4a('0x5'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require('util');var path=require(_0xac4a('0x6'));var sox=require(_0xac4a('0x7'));var csv=require(_0xac4a('0x8'));var ejs=require(_0xac4a('0x9'));var fs=require('fs');var fs_extra=require(_0xac4a('0xa'));var _=require(_0xac4a('0xb'));var squel=require(_0xac4a('0xc'));var crypto=require(_0xac4a('0xd'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0xac4a('0x8'));var querystring=require(_0xac4a('0xe'));var Papa=require(_0xac4a('0xf'));var Redis=require('ioredis');var authService=require(_0xac4a('0x10'));var qs=require(_0xac4a('0x11'));var as=require(_0xac4a('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xac4a('0x13'))('api');var utils=require(_0xac4a('0x14'));var config=require('../../config/environment');var licenseUtil=require(_0xac4a('0x15'));var db=require(_0xac4a('0x16'))['db'];var dbH=require(_0xac4a('0x16'))['dbH'];function respondWithStatusCode(_0x21a79,_0x68424a){_0x68424a=_0x68424a||0xcc;return function(_0x247b78){if(_0x247b78){return _0x21a79[_0xac4a('0x17')](_0x68424a);}return _0x21a79[_0xac4a('0x18')](_0x68424a)[_0xac4a('0x19')]();};}function respondWithResult(_0x34bc01,_0x33c287){_0x33c287=_0x33c287||0xc8;return function(_0x190418){if(_0x190418){return _0x34bc01[_0xac4a('0x18')](_0x33c287)[_0xac4a('0x1a')](_0x190418);}};}function respondWithFilteredResult(_0x26dbb8,_0x4a2119){return function(_0x402fff){if(_0x402fff){var _0x34d797=typeof _0x4a2119[_0xac4a('0x1b')]===_0xac4a('0x1c')&&typeof _0x4a2119[_0xac4a('0x1d')]===_0xac4a('0x1c');var _0x28e304=_0x402fff[_0xac4a('0x1e')];var _0x546c5d=_0x34d797?0x0:_0x4a2119['offset'];var _0x21a729=_0x34d797?_0x402fff[_0xac4a('0x1e')]:_0x4a2119[_0xac4a('0x1b')]+_0x4a2119['limit'];var _0x39e83e;if(_0x21a729>=_0x28e304){_0x21a729=_0x28e304;_0x39e83e=0xc8;}else{_0x39e83e=0xce;}_0x26dbb8[_0xac4a('0x18')](_0x39e83e);return _0x26dbb8[_0xac4a('0x1f')](_0xac4a('0x20'),_0x546c5d+'-'+_0x21a729+'/'+_0x28e304)[_0xac4a('0x1a')](_0x402fff);}return null;};}function patchUpdates(_0x3e829c){return function(_0xe38996){try{jsonpatch[_0xac4a('0x21')](_0xe38996,_0x3e829c,!![]);}catch(_0x534092){return BPromise[_0xac4a('0x22')](_0x534092);}return _0xe38996[_0xac4a('0x23')]();};}function saveUpdates(_0x599787,_0x3d7ce0){return function(_0x4169c0){if(_0x4169c0){return _0x4169c0[_0xac4a('0x24')](_0x599787)[_0xac4a('0x25')](function(_0x4d2d6c){return _0x4d2d6c;});}return null;};}function removeEntity(_0x1b7998,_0x2503d8){return function(_0x15435c){if(_0x15435c){return _0x15435c[_0xac4a('0x26')]()[_0xac4a('0x25')](function(){var _0x2b0dc2=_0x15435c[_0xac4a('0x27')]({'plain':!![]});var _0x36054a=_0xac4a('0x28');return db[_0xac4a('0x29')][_0xac4a('0x26')]({'where':{'type':_0x36054a,'resourceId':_0x2b0dc2['id']}})[_0xac4a('0x25')](function(){return _0x15435c;});})[_0xac4a('0x25')](function(){_0x1b7998[_0xac4a('0x18')](0xcc)[_0xac4a('0x19')]();});}};}function handleEntityNotFound(_0x20202c,_0x4e17ce){return function(_0x23b061){if(!_0x23b061){_0x20202c[_0xac4a('0x17')](0x194);}return _0x23b061;};}function handleError(_0x42a33c,_0x2772fe){_0x2772fe=_0x2772fe||0x1f4;return function(_0x116700){logger['error'](_0x116700['stack']);if(_0x116700[_0xac4a('0x2a')]){delete _0x116700[_0xac4a('0x2a')];}_0x42a33c[_0xac4a('0x18')](_0x2772fe)['send'](_0x116700);};}exports['index']=function(_0x355755,_0x2896bc){var _0x228629={},_0x432066={},_0x17118e={'count':0x0,'rows':[]};var _0x53d3a5=_[_0xac4a('0x2b')](db['AnalyticDefaultReport'][_0xac4a('0x2c')],function(_0x57adcf){return{'name':_0x57adcf[_0xac4a('0x2d')],'type':_0x57adcf[_0xac4a('0x2e')][_0xac4a('0x2f')]};});_0x432066[_0xac4a('0x30')]=_[_0xac4a('0x2b')](_0x53d3a5,_0xac4a('0x2a'));_0x432066[_0xac4a('0x31')]=_[_0xac4a('0x32')](_0x355755[_0xac4a('0x31')]);_0x432066[_0xac4a('0x33')]=_[_0xac4a('0x34')](_0x432066[_0xac4a('0x30')],_0x432066[_0xac4a('0x31')]);_0x228629[_0xac4a('0x35')]=_['intersection'](_0x432066[_0xac4a('0x30')],qs[_0xac4a('0x36')](_0x355755['query'][_0xac4a('0x36')]));_0x228629[_0xac4a('0x35')]=_0x228629['attributes']['length']?_0x228629[_0xac4a('0x35')]:_0x432066[_0xac4a('0x30')];if(!_0x355755[_0xac4a('0x31')][_0xac4a('0x37')]('nolimit')){_0x228629[_0xac4a('0x1d')]=qs[_0xac4a('0x1d')](_0x355755['query'][_0xac4a('0x1d')]);_0x228629[_0xac4a('0x1b')]=qs[_0xac4a('0x1b')](_0x355755['query'][_0xac4a('0x1b')]);}_0x228629[_0xac4a('0x38')]=qs[_0xac4a('0x39')](_0x355755['query'][_0xac4a('0x39')]);_0x228629[_0xac4a('0x3a')]=qs['filters'](_['pick'](_0x355755[_0xac4a('0x31')],_0x432066['filters']),_0x53d3a5);if(_0x355755['query']['filter']){_0x228629['where']=_[_0xac4a('0x3b')](_0x228629[_0xac4a('0x3a')],{'$or':_[_0xac4a('0x2b')](_0x53d3a5,function(_0x472484){if(_0x472484[_0xac4a('0x2e')]!==_0xac4a('0x3c')){var _0x4220e2={};_0x4220e2[_0x472484[_0xac4a('0x2a')]]={'$like':'%'+_0x355755[_0xac4a('0x31')][_0xac4a('0x3d')]+'%'};return _0x4220e2;}})});}_0x228629=_[_0xac4a('0x3b')]({},_0x228629,_0x355755[_0xac4a('0x3e')]);var _0x4e4994={'where':_0x228629['where']};return db['AnalyticDefaultReport'][_0xac4a('0x1e')](_0x4e4994)[_0xac4a('0x25')](function(_0x14e80b){_0x17118e[_0xac4a('0x1e')]=_0x14e80b;if(_0x355755[_0xac4a('0x31')][_0xac4a('0x3f')]){_0x228629[_0xac4a('0x40')]=[{'all':!![]}];}return db[_0xac4a('0x41')][_0xac4a('0x42')](_0x228629);})[_0xac4a('0x25')](function(_0x561cb7){_0x17118e[_0xac4a('0x43')]=_0x561cb7;return _0x17118e;})[_0xac4a('0x25')](respondWithFilteredResult(_0x2896bc,_0x228629))[_0xac4a('0x44')](handleError(_0x2896bc,null));};exports[_0xac4a('0x45')]=function(_0x1a96cf,_0x57b879){var _0x8700b4={'raw':!![],'where':{'id':_0x1a96cf['params']['id']}},_0x1b77bb={};_0x1b77bb[_0xac4a('0x30')]=_['keys'](db[_0xac4a('0x41')][_0xac4a('0x2c')]);_0x1b77bb[_0xac4a('0x31')]=_[_0xac4a('0x32')](_0x1a96cf[_0xac4a('0x31')]);_0x1b77bb[_0xac4a('0x33')]=_[_0xac4a('0x34')](_0x1b77bb[_0xac4a('0x30')],_0x1b77bb[_0xac4a('0x31')]);_0x8700b4[_0xac4a('0x35')]=_[_0xac4a('0x34')](_0x1b77bb[_0xac4a('0x30')],qs['fields'](_0x1a96cf[_0xac4a('0x31')][_0xac4a('0x36')]));_0x8700b4[_0xac4a('0x35')]=_0x8700b4['attributes'][_0xac4a('0x46')]?_0x8700b4[_0xac4a('0x35')]:_0x1b77bb['model'];if(_0x1a96cf[_0xac4a('0x31')]['includeAll']){_0x8700b4[_0xac4a('0x40')]=[{'all':!![]}];}_0x8700b4=_[_0xac4a('0x3b')]({},_0x8700b4,_0x1a96cf[_0xac4a('0x3e')]);return db['AnalyticDefaultReport']['find'](_0x8700b4)[_0xac4a('0x25')](handleEntityNotFound(_0x57b879,null))['then'](respondWithResult(_0x57b879,null))[_0xac4a('0x44')](handleError(_0x57b879,null));};exports['create']=function(_0x3d2aaf,_0x530bbb){return db[_0xac4a('0x41')][_0xac4a('0x47')](_0x3d2aaf[_0xac4a('0x48')],{})[_0xac4a('0x25')](function(_0x54782f){var _0x31c794=_0x3d2aaf[_0xac4a('0x49')][_0xac4a('0x27')]({'plain':!![]});if(!_0x31c794)throw new Error(_0xac4a('0x4a'));if(_0x31c794[_0xac4a('0x4b')]===_0xac4a('0x49')){var _0x187306=_0x54782f['get']({'plain':!![]});var _0x35dee5=_0xac4a('0x4c');return db['UserProfileSection'][_0xac4a('0x4d')]({'where':{'name':_0x35dee5,'userProfileId':_0x31c794[_0xac4a('0x4e')]},'raw':!![]})[_0xac4a('0x25')](function(_0x3ac36e){if(_0x3ac36e&&_0x3ac36e['autoAssociation']===0x0){return db[_0xac4a('0x29')][_0xac4a('0x47')]({'name':_0x187306[_0xac4a('0x2a')],'resourceId':_0x187306['id'],'type':_0xac4a('0x28'),'sectionId':_0x3ac36e['id']},{})[_0xac4a('0x25')](function(){return _0x54782f;});}else{return _0x54782f;}})['catch'](function(_0x179373){logger['error'](_0xac4a('0x4f'),_0x179373);throw _0x179373;});}return _0x54782f;})[_0xac4a('0x25')](respondWithResult(_0x530bbb,0xc9))['catch'](handleError(_0x530bbb,null));};exports['update']=function(_0x437466,_0x70fdc3){if(_0x437466['body']['id']){delete _0x437466[_0xac4a('0x48')]['id'];}return db[_0xac4a('0x41')][_0xac4a('0x4d')]({'where':{'id':_0x437466[_0xac4a('0x50')]['id']}})['then'](handleEntityNotFound(_0x70fdc3,null))[_0xac4a('0x25')](saveUpdates(_0x437466[_0xac4a('0x48')],null))[_0xac4a('0x25')](respondWithResult(_0x70fdc3,null))[_0xac4a('0x44')](handleError(_0x70fdc3,null));};exports[_0xac4a('0x26')]=function(_0x411547,_0x36179a){return db['AnalyticDefaultReport'][_0xac4a('0x4d')]({'where':{'id':_0x411547[_0xac4a('0x50')]['id']}})[_0xac4a('0x25')](handleEntityNotFound(_0x36179a,null))[_0xac4a('0x25')](removeEntity(_0x36179a,null))[_0xac4a('0x44')](handleError(_0x36179a,null));};exports[_0xac4a('0x51')]=function(_0x213df2,_0x236f57){var _0x159e43=0xa;var _0x786d9=[_0xac4a('0x52'),_0xac4a('0x53'),_0xac4a('0x54'),_0xac4a('0x55')];var _0x5222f3={'SUM':_0xac4a('0x56'),'COUNT':'COUNT(%s)','COUNT DISTINCT':_0xac4a('0x57'),'MAX':'MAX(%s)','MIN':_0xac4a('0x58'),'AVG':'AVG(%s)','GROUP_CONCAT':_0xac4a('0x59'),'GROUP_CONCAT ASC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT DESC':_0xac4a('0x5a')};var _0x5cac9b={'SEC_TO_TIME':'SEC_TO_TIME(%s)','DATE':_0xac4a('0x5b'),'HOUR':_0xac4a('0x5c'),'ROUND':_0xac4a('0x5d'),'UNIX_TIMESTAMP':_0xac4a('0x5e')};var _0x2f9940=function(_0xb7b884){return!_['includes']([_0xac4a('0x5f'),'IS\x20NOT\x20NULL',_0xac4a('0x60'),'IS\x20NOT\x20EMPTY'],_0xb7b884);};var _0x347880=function(_0x19ce2c){if(!_0x19ce2c||!_0x19ce2c[_0xac4a('0x61')][_0xac4a('0x46')]){return'';}for(var _0x429273='(',_0x2bc39a=0x0;_0x2bc39a<_0x19ce2c[_0xac4a('0x61')][_0xac4a('0x46')];_0x2bc39a+=0x1){_0x2bc39a>0x0&&(_0x429273+='\x20'+_0x19ce2c[_0xac4a('0x62')]+'\x20');_0x429273+=_0x19ce2c[_0xac4a('0x61')][_0x2bc39a][_0xac4a('0x63')]?_0x347880(_0x19ce2c[_0xac4a('0x61')][_0x2bc39a][_0xac4a('0x63')]):_0x19ce2c[_0xac4a('0x61')][_0x2bc39a][_0xac4a('0x64')]+'\x20'+_0x19ce2c[_0xac4a('0x61')][_0x2bc39a][_0xac4a('0x65')]+(_0x2f9940(_0x19ce2c['rules'][_0x2bc39a][_0xac4a('0x65')])?'\x20'+_0x19ce2c[_0xac4a('0x61')][_0x2bc39a]['value']:'');}return _0x429273+')';};var _0x3c3576={'where':{'id':_0x213df2['params']['id']}},_0x34bd1c,_0x2d24c7,_0x2b8562,_0x357cac,_0x4d1440;_0x3c3576=_[_0xac4a('0x3b')]({},_0x3c3576,_0x213df2[_0xac4a('0x3e')]);return db[_0xac4a('0x41')][_0xac4a('0x4d')](_0x3c3576)[_0xac4a('0x25')](function(_0x21ef8b){if(_0x21ef8b){_0x34bd1c=_0x21ef8b;return _0x21ef8b[_0xac4a('0x66')]();}return null;})[_0xac4a('0x25')](function(_0x44c60b){if(_0x44c60b){if(!_0x44c60b[_0xac4a('0x46')]){throw new db[(_0xac4a('0x67'))]['ValidationErrorItem']('Please\x20insert\x20at\x20least\x20one\x20field',0x193);}_0x2d24c7=_0x44c60b;return db[_0xac4a('0x68')][_0xac4a('0x42')]({'raw':!![]});}return null;})[_0xac4a('0x25')](function(_0x423f70){if(_0x423f70){_0x2b8562=_[_0xac4a('0x69')](_0x423f70,'id');var _0x283107;var _0x1d24bb=squel[_0xac4a('0x6a')]();_0x1d24bb[_0xac4a('0x6b')](_0x34bd1c[_0xac4a('0x6c')]);for(var _0xb09b89=0x0;_0xb09b89<_0x2d24c7[_0xac4a('0x46')];_0xb09b89+=0x1){_0x283107=_0x2d24c7[_0xb09b89]['MetricId']?_0x2b8562[_0x2d24c7[_0xb09b89][_0xac4a('0x6d')]][_0xac4a('0x6e')]:_0x2d24c7[_0xb09b89][_0xac4a('0x64')];_0x283107=_0x2d24c7[_0xb09b89][_0xac4a('0x6f')]?_['replace'](_0x5222f3[_0x2d24c7[_0xb09b89][_0xac4a('0x6f')]],'%s',_0x283107):_0x283107;_0x283107=_0x2d24c7[_0xb09b89]['format']?_[_0xac4a('0x70')](_0x5cac9b[_0x2d24c7[_0xb09b89][_0xac4a('0x71')]],'%s',_0x283107):_0x283107;if(_0x2d24c7[_0xb09b89]['groupBy']){_0x1d24bb['group'](_0x283107);}_0x2d24c7[_0xb09b89][_0xac4a('0x72')]&&_0x1d24bb[_0xac4a('0x38')](_0x283107,_0x2d24c7[_0xb09b89][_0xac4a('0x72')]==='DESC'?![]:!![]);_0x1d24bb[_0xac4a('0x64')](_0x283107,_0x2d24c7[_0xb09b89]['alias']||_0x283107);}if(_0x34bd1c[_0xac4a('0x73')]){_0x34bd1c['joins']=JSON['parse'](_0x34bd1c[_0xac4a('0x73')]);for(var _0x56ef2a=0x0;_0x56ef2a<_0x34bd1c[_0xac4a('0x73')]['length'];_0x56ef2a+=0x1){if(_0x34bd1c[_0xac4a('0x73')][_0x56ef2a][_0xac4a('0x2e')]&&_['includes'](_0x786d9,_0x34bd1c[_0xac4a('0x73')][_0x56ef2a]['type'])&&_0x34bd1c[_0xac4a('0x73')][_0x56ef2a][_0xac4a('0x74')]&&_0x34bd1c['joins'][_0x56ef2a][_0xac4a('0x75')]&&_0x34bd1c['joins'][_0x56ef2a]['foreignKey']){_0x1d24bb[_0x34bd1c[_0xac4a('0x73')][_0x56ef2a]['type']](_0x34bd1c[_0xac4a('0x73')][_0x56ef2a]['foreignTable'],null,util['format'](_0xac4a('0x76'),_0x34bd1c[_0xac4a('0x6c')],_0x34bd1c[_0xac4a('0x73')][_0x56ef2a]['parentKey'],_0x34bd1c['joins'][_0x56ef2a][_0xac4a('0x75')],_0x34bd1c[_0xac4a('0x73')][_0x56ef2a]['foreignKey']));}}}if(_0x34bd1c['conditions']){_0x34bd1c[_0xac4a('0x77')]=JSON[_0xac4a('0x78')](_0x34bd1c[_0xac4a('0x77')]);_0x1d24bb[_0xac4a('0x3a')](_0x347880(_0x34bd1c[_0xac4a('0x77')][_0xac4a('0x63')]));}_0x4d1440=_0x1d24bb[_0xac4a('0x79')]();_0x1d24bb[_0xac4a('0x1d')](_0x159e43);_0x1d24bb[_0xac4a('0x1b')](0x0);logger['debug'](_0xac4a('0x7a'),_0x1d24bb[_0xac4a('0x7b')]());return dbH[_0xac4a('0x7c')]['query'](_0x1d24bb[_0xac4a('0x7b')](),{'type':dbH[_0xac4a('0x7c')][_0xac4a('0x7d')][_0xac4a('0x7e')]});}})[_0xac4a('0x25')](respondWithResult(_0x236f57,null))['catch'](handleError(_0x236f57,null));};function runReport(_0x290a73,_0x19ce24,_0xc9d040){var _0x37e519=_0x19ce24[_0xac4a('0x2a')];var _0x451248=0xa;var _0xd7bdd6=['join',_0xac4a('0x53'),_0xac4a('0x54'),_0xac4a('0x55')];var _0x35a97c={'SUM':_0xac4a('0x56'),'COUNT':_0xac4a('0x7f'),'COUNT DISTINCT':'COUNT(DISTINCT\x20%s)','MAX':_0xac4a('0x80'),'MIN':_0xac4a('0x58'),'AVG':_0xac4a('0x81'),'GROUP_CONCAT':_0xac4a('0x59'),'GROUP_CONCAT ASC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT DESC':_0xac4a('0x5a')};var _0x56a934={'SEC_TO_TIME':_0xac4a('0x82'),'DATE':_0xac4a('0x5b'),'HOUR':'HOUR(%s)','ROUND':'ROUND(%s)','UNIX_TIMESTAMP':_0xac4a('0x5e')};var _0x212a22=function(_0x1fe86a){return!_['includes']([_0xac4a('0x5f'),'IS\x20NOT\x20NULL',_0xac4a('0x60'),_0xac4a('0x83')],_0x1fe86a);};var _0x406b64=function(_0x35328e){if(!_0x35328e||!_0x35328e[_0xac4a('0x61')]['length']){return'';}for(var _0x50f471='(',_0x31cda0=0x0;_0x31cda0<_0x35328e[_0xac4a('0x61')][_0xac4a('0x46')];_0x31cda0+=0x1){_0x31cda0>0x0&&(_0x50f471+='\x20'+_0x35328e[_0xac4a('0x62')]+'\x20');_0x50f471+=_0x35328e[_0xac4a('0x61')][_0x31cda0][_0xac4a('0x63')]?_0x406b64(_0x35328e[_0xac4a('0x61')][_0x31cda0][_0xac4a('0x63')]):_0x35328e['rules'][_0x31cda0]['field']+'\x20'+_0x35328e[_0xac4a('0x61')][_0x31cda0][_0xac4a('0x65')]+(_0x212a22(_0x35328e[_0xac4a('0x61')][_0x31cda0][_0xac4a('0x65')])?'\x20'+_0x35328e[_0xac4a('0x61')][_0x31cda0][_0xac4a('0x84')]:'');}return _0x50f471+')';};var _0xdaa2ef={'where':{'id':_0x290a73['id']}},_0x2e704b,_0x540d8e,_0x5e0be4,_0x32fd0c,_0x168f30;_0xdaa2ef=_[_0xac4a('0x3b')]({},_0xdaa2ef,_0xc9d040);return db[_0xac4a('0x41')][_0xac4a('0x4d')](_0xdaa2ef)[_0xac4a('0x25')](function(_0x338af3){if(_0x338af3){_0x2e704b=_0x338af3;return _0x338af3['getFields']();}return null;})[_0xac4a('0x25')](function(_0x1bacf2){if(_0x1bacf2){if(!_0x1bacf2[_0xac4a('0x46')]){throw new db['Sequelize'][(_0xac4a('0x85'))](_0xac4a('0x86'),0x193);}_0x540d8e=_0x1bacf2;return db[_0xac4a('0x68')][_0xac4a('0x42')]({'raw':!![]});}return null;})[_0xac4a('0x25')](function(_0x27d023){if(_0x27d023){_0x5e0be4=_[_0xac4a('0x69')](_0x27d023,'id');var _0x2ef42a;var _0x322465=squel['select']();_0x322465[_0xac4a('0x6b')](_0x2e704b['table']);for(var _0x203321=0x0;_0x203321<_0x540d8e[_0xac4a('0x46')];_0x203321+=0x1){_0x2ef42a=_0x540d8e[_0x203321][_0xac4a('0x6d')]?_0x5e0be4[_0x540d8e[_0x203321][_0xac4a('0x6d')]][_0xac4a('0x6e')]:_0x540d8e[_0x203321][_0xac4a('0x64')];_0x2ef42a=_0x540d8e[_0x203321][_0xac4a('0x6f')]?_['replace'](_0x35a97c[_0x540d8e[_0x203321][_0xac4a('0x6f')]],'%s',_0x2ef42a):_0x2ef42a;_0x2ef42a=_0x540d8e[_0x203321][_0xac4a('0x71')]?_[_0xac4a('0x70')](_0x56a934[_0x540d8e[_0x203321][_0xac4a('0x71')]],'%s',_0x2ef42a):_0x2ef42a;if(_0x540d8e[_0x203321][_0xac4a('0x87')]){_0x322465['group'](_0x2ef42a);}_0x540d8e[_0x203321][_0xac4a('0x72')]&&_0x322465[_0xac4a('0x38')](_0x2ef42a,_0x540d8e[_0x203321]['orderBy']==='DESC'?![]:!![]);_0x322465[_0xac4a('0x64')](_0x2ef42a,_0x540d8e[_0x203321][_0xac4a('0x88')]||_0x2ef42a);}if(_0x2e704b['joins']){_0x2e704b[_0xac4a('0x73')]=JSON[_0xac4a('0x78')](_0x2e704b[_0xac4a('0x73')]);for(var _0x37657e=0x0;_0x37657e<_0x2e704b[_0xac4a('0x73')][_0xac4a('0x46')];_0x37657e+=0x1){if(_0x2e704b['joins'][_0x37657e][_0xac4a('0x2e')]&&_[_0xac4a('0x89')](_0xd7bdd6,_0x2e704b[_0xac4a('0x73')][_0x37657e]['type'])&&_0x2e704b[_0xac4a('0x73')][_0x37657e][_0xac4a('0x74')]&&_0x2e704b[_0xac4a('0x73')][_0x37657e][_0xac4a('0x75')]&&_0x2e704b[_0xac4a('0x73')][_0x37657e][_0xac4a('0x8a')]){_0x322465[_0x2e704b['joins'][_0x37657e][_0xac4a('0x2e')]](_0x2e704b[_0xac4a('0x73')][_0x37657e]['foreignTable'],null,util[_0xac4a('0x71')]('%s.%s\x20=\x20%s.%s',_0x2e704b[_0xac4a('0x6c')],_0x2e704b[_0xac4a('0x73')][_0x37657e]['parentKey'],_0x2e704b[_0xac4a('0x73')][_0x37657e]['foreignTable'],_0x2e704b[_0xac4a('0x73')][_0x37657e]['foreignKey']));}}}if(_0x2e704b[_0xac4a('0x77')]){_0x2e704b[_0xac4a('0x77')]=JSON[_0xac4a('0x78')](_0x2e704b[_0xac4a('0x77')]);_0x322465[_0xac4a('0x3a')](_0x406b64(_0x2e704b[_0xac4a('0x77')][_0xac4a('0x63')]));}_0x168f30=_0x322465[_0xac4a('0x79')]();_0x322465[_0xac4a('0x1d')](_0x451248);_0x322465[_0xac4a('0x1b')](0x0);return;}})[_0xac4a('0x25')](function(){if(_0x19ce24[_0xac4a('0x8b')]===_0xac4a('0x8c')){return null;}var _0x4217df=_['merge'](_0x19ce24,{'name':_0x19ce24[_0xac4a('0x8d')]||_0x19ce24[_0xac4a('0x2a')]||_0x2e704b['name'],'basename':_0x37e519,'savename':util[_0xac4a('0x71')](_0xac4a('0x8e'),_0x19ce24[_0xac4a('0x2a')]||_0x2e704b[_0xac4a('0x2a')],require(_0xac4a('0x8f'))['generate'](0x4),_0x19ce24[_0xac4a('0x8b')]||'csv'),'reportId':_0x2e704b['id'],'reportType':_0xac4a('0x90')});return db[_0xac4a('0x91')][_0xac4a('0x47')](_0x4217df,{'raw':!![]});})[_0xac4a('0x25')](function(_0x53f23d){if(_0x2e704b[_0xac4a('0x6c')]==='cdr'){_0x168f30[_0xac4a('0x3a')](_0x2e704b[_0xac4a('0x6c')]+_0xac4a('0x92'),_0x19ce24['startDate'],_0x19ce24[_0xac4a('0x93')]);}else{_0x168f30[_0xac4a('0x3a')](_0x2e704b[_0xac4a('0x6c')]+'.createdAt\x20BETWEEN\x20?\x20AND\x20?',_0x19ce24[_0xac4a('0x94')],_0x19ce24[_0xac4a('0x93')]);}if(_0x53f23d){logger[_0xac4a('0x95')](_0xac4a('0x96'),_0x168f30[_0xac4a('0x7b')]());require(_0xac4a('0x97'))[_0xac4a('0x98')](path[_0xac4a('0x52')](__dirname,'../../components/export/',_0x53f23d[_0xac4a('0x8b')]),[_0x53f23d['id'],_0x168f30['toString'](),path['join'](__dirname,'../../files/reports',_0x53f23d['savename']),_0x37e519]);return _0x53f23d;}else{var _0x502275=squel[_0xac4a('0x6a')]();_0x502275[_0xac4a('0x6b')]('('+_0x168f30[_0xac4a('0x7b')]()+')',_0xac4a('0x99'));_0x502275[_0xac4a('0x64')]('COUNT(*)',_0xac4a('0x1e'));_0x168f30[_0xac4a('0x1d')](_0x19ce24[_0xac4a('0x1d')]||_0x451248);_0x168f30[_0xac4a('0x1b')](_0x19ce24[_0xac4a('0x1b')]||0x0);return dbH[_0xac4a('0x7c')][_0xac4a('0x31')](_0x502275[_0xac4a('0x7b')](),{'type':dbH['sequelize'][_0xac4a('0x7d')][_0xac4a('0x7e')]})[_0xac4a('0x25')](function(_0x25331f){if(!_0x25331f[_0xac4a('0x46')]){_0x32fd0c=0x0;}else{_0x32fd0c=_0x25331f[0x0][_0xac4a('0x1e')]||0x0;}return dbH[_0xac4a('0x7c')]['query'](_0x168f30['toString'](),{'type':dbH[_0xac4a('0x7c')][_0xac4a('0x7d')]['SELECT']});})[_0xac4a('0x25')](function(_0x366f5a){return{'rows':_0x366f5a||[],'count':_0x32fd0c};});}});}exports['run']=function(_0x5bd013,_0x2fe103){return runReport(_0x5bd013[_0xac4a('0x50')],_0x5bd013[_0xac4a('0x31')],_0x5bd013[_0xac4a('0x3e')])[_0xac4a('0x25')](respondWithResult(_0x2fe103,null))['catch'](handleError(_0x2fe103,null));};exports[_0xac4a('0x9a')]=runReport;exports['query']=function(_0x4f2d85,_0x538cfd){var _0x63c30=0xa;var _0x4301c3=[_0xac4a('0x52'),_0xac4a('0x53'),_0xac4a('0x54'),_0xac4a('0x55')];var _0xcad25d={'SUM':_0xac4a('0x56'),'COUNT':'COUNT(%s)','COUNT DISTINCT':'COUNT(DISTINCT\x20%s)','MAX':'MAX(%s)','MIN':_0xac4a('0x58'),'AVG':_0xac4a('0x81'),'GROUP_CONCAT':_0xac4a('0x59'),'GROUP_CONCAT ASC':_0xac4a('0x9b'),'GROUP_CONCAT DESC':_0xac4a('0x5a')};var _0xcd140e={'SEC_TO_TIME':_0xac4a('0x82'),'DATE':_0xac4a('0x5b'),'HOUR':_0xac4a('0x5c'),'ROUND':_0xac4a('0x5d'),'UNIX_TIMESTAMP':_0xac4a('0x5e')};var _0x37cb49=function(_0xe0fd57){return!_[_0xac4a('0x89')]([_0xac4a('0x5f'),_0xac4a('0x9c'),_0xac4a('0x60'),_0xac4a('0x83')],_0xe0fd57);};var _0x41cdb5=function(_0x172d03){if(!_0x172d03||!_0x172d03[_0xac4a('0x61')][_0xac4a('0x46')]){return'';}for(var _0x3e2575='(',_0x4cc581=0x0;_0x4cc581<_0x172d03[_0xac4a('0x61')][_0xac4a('0x46')];_0x4cc581+=0x1){_0x4cc581>0x0&&(_0x3e2575+='\x20'+_0x172d03[_0xac4a('0x62')]+'\x20');_0x3e2575+=_0x172d03[_0xac4a('0x61')][_0x4cc581][_0xac4a('0x63')]?_0x41cdb5(_0x172d03[_0xac4a('0x61')][_0x4cc581][_0xac4a('0x63')]):_0x172d03[_0xac4a('0x61')][_0x4cc581]['field']+'\x20'+_0x172d03['rules'][_0x4cc581][_0xac4a('0x65')]+(_0x37cb49(_0x172d03[_0xac4a('0x61')][_0x4cc581][_0xac4a('0x65')])?'\x20'+_0x172d03['rules'][_0x4cc581]['value']:'');}return _0x3e2575+')';};var _0x5de198={'where':{'id':_0x4f2d85[_0xac4a('0x50')]['id']}},_0x2b6773,_0x52df82,_0x59e82c,_0x216055,_0x52963c;_0x5de198=_['merge']({},_0x5de198,_0x4f2d85[_0xac4a('0x3e')]);return db[_0xac4a('0x41')][_0xac4a('0x4d')](_0x5de198)[_0xac4a('0x25')](function(_0x403a16){if(_0x403a16){_0x2b6773=_0x403a16;return _0x403a16[_0xac4a('0x66')]();}return null;})['then'](function(_0x25bf23){if(_0x25bf23){if(!_0x25bf23[_0xac4a('0x46')]){throw new db[(_0xac4a('0x67'))]['ValidationErrorItem'](_0xac4a('0x86'),0x193);}_0x52df82=_0x25bf23;return db[_0xac4a('0x68')][_0xac4a('0x42')]({'raw':!![]});}return null;})[_0xac4a('0x25')](function(_0x5bb911){if(_0x5bb911){_0x59e82c=_[_0xac4a('0x69')](_0x5bb911,'id');var _0x403f5a;var _0x3eae2f=squel[_0xac4a('0x6a')]();_0x3eae2f[_0xac4a('0x6b')](_0x2b6773[_0xac4a('0x6c')]);for(var _0x4a0cd9=0x0;_0x4a0cd9<_0x52df82['length'];_0x4a0cd9+=0x1){_0x403f5a=_0x52df82[_0x4a0cd9][_0xac4a('0x6d')]?_0x59e82c[_0x52df82[_0x4a0cd9][_0xac4a('0x6d')]][_0xac4a('0x6e')]:_0x52df82[_0x4a0cd9][_0xac4a('0x64')];_0x403f5a=_0x52df82[_0x4a0cd9][_0xac4a('0x6f')]?_[_0xac4a('0x70')](_0xcad25d[_0x52df82[_0x4a0cd9]['function']],'%s',_0x403f5a):_0x403f5a;_0x403f5a=_0x52df82[_0x4a0cd9][_0xac4a('0x71')]?_['replace'](_0xcd140e[_0x52df82[_0x4a0cd9][_0xac4a('0x71')]],'%s',_0x403f5a):_0x403f5a;if(_0x52df82[_0x4a0cd9]['groupBy']){_0x3eae2f[_0xac4a('0x63')](_0x403f5a);}_0x52df82[_0x4a0cd9][_0xac4a('0x72')]&&_0x3eae2f[_0xac4a('0x38')](_0x403f5a,_0x52df82[_0x4a0cd9][_0xac4a('0x72')]==='DESC'?![]:!![]);_0x3eae2f[_0xac4a('0x64')](_0x403f5a,_0x52df82[_0x4a0cd9][_0xac4a('0x88')]||_0x403f5a);}if(_0x2b6773[_0xac4a('0x73')]){_0x2b6773[_0xac4a('0x73')]=JSON[_0xac4a('0x78')](_0x2b6773['joins']);for(var _0x3dd60a=0x0;_0x3dd60a<_0x2b6773[_0xac4a('0x73')][_0xac4a('0x46')];_0x3dd60a+=0x1){if(_0x2b6773[_0xac4a('0x73')][_0x3dd60a][_0xac4a('0x2e')]&&_['includes'](_0x4301c3,_0x2b6773[_0xac4a('0x73')][_0x3dd60a][_0xac4a('0x2e')])&&_0x2b6773[_0xac4a('0x73')][_0x3dd60a][_0xac4a('0x74')]&&_0x2b6773[_0xac4a('0x73')][_0x3dd60a]['foreignTable']&&_0x2b6773['joins'][_0x3dd60a]['foreignKey']){_0x3eae2f[_0x2b6773['joins'][_0x3dd60a][_0xac4a('0x2e')]](_0x2b6773[_0xac4a('0x73')][_0x3dd60a][_0xac4a('0x75')],null,util[_0xac4a('0x71')](_0xac4a('0x76'),_0x2b6773['table'],_0x2b6773[_0xac4a('0x73')][_0x3dd60a][_0xac4a('0x74')],_0x2b6773['joins'][_0x3dd60a][_0xac4a('0x75')],_0x2b6773[_0xac4a('0x73')][_0x3dd60a][_0xac4a('0x8a')]));}}}if(_0x2b6773['conditions']){_0x2b6773[_0xac4a('0x77')]=JSON[_0xac4a('0x78')](_0x2b6773[_0xac4a('0x77')]);_0x3eae2f[_0xac4a('0x3a')](_0x41cdb5(_0x2b6773[_0xac4a('0x77')][_0xac4a('0x63')]));}_0x52963c=_0x3eae2f[_0xac4a('0x79')]();_0x3eae2f[_0xac4a('0x1d')](_0x63c30);_0x3eae2f[_0xac4a('0x1b')](0x0);logger['debug'](_0xac4a('0x7a'),_0x3eae2f[_0xac4a('0x7b')]());return dbH['sequelize'][_0xac4a('0x31')](_0x3eae2f['toString'](),{'type':dbH[_0xac4a('0x7c')][_0xac4a('0x7d')]['SELECT']});}})[_0xac4a('0x25')](function(){return{'sql':_0x52963c[_0xac4a('0x7b')]()};})[_0xac4a('0x25')](respondWithResult(_0x538cfd,null))[_0xac4a('0x44')](handleError(_0x538cfd,null));};
\ No newline at end of file
+var _0x1261=['rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','fs-extra','lodash','crypto','jsforce','desk.js','to-csv','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/utils','../../config/license/util','../../mysqldb','dbH','sendStatus','status','offset','limit','undefined','set','json','apply','reject','save','then','destroy','get','DefaultReports','UserProfileResource','error','name','index','AnalyticDefaultReport','rawAttributes','fieldName','type','key','model','query','keys','filters','attributes','intersection','fields','nolimit','sort','where','pick','filter','merge','map','VIRTUAL','count','include','findAll','rows','show','length','includeAll','options','find','catch','create','body','user','role','UserProfileSection','userProfileId','autoAssociation','params','preview','join','right_join','cross_join','SUM(%s)','COUNT(%s)','COUNT(DISTINCT\x20%s)','MAX(%s)','MIN(%s)','GROUP_CONCAT(%s)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)','SEC_TO_TIME(%s)','HOUR(%s)','ROUND(%s)','includes','IS\x20NULL','IS\x20EMPTY','IS\x20NOT\x20EMPTY','rules','operator','group','field','condition','getFields','ValidationErrorItem','Please\x20insert\x20at\x20least\x20one\x20field','AnalyticMetric','from','table','MetricId','metric','function','replace','format','groupBy','orderBy','DESC','alias','joins','parentKey','foreignTable','foreignKey','conditions','parse','Limited\x20Query:','toString','sequelize','QueryTypes','SELECT','left_join','AVG(%s)','DATE(%s)','value','keyBy','select','order','%s.%s\x20=\x20%s.%s','clone','web','fullPath','randomstring','generate','output','csv','default','AnalyticExtractedReport','cdr','.calldate\x20BETWEEN\x20?\x20AND\x20?','startDate','endDate','Run\x20Query:','../../components/export/','savename','COUNT(*)','run','runReport','UNIX_TIMESTAMP(%s)','IS\x20NOT\x20NULL','Sequelize','debug'];(function(_0x2dc840,_0x4a569e){var _0x2821a=function(_0x37705b){while(--_0x37705b){_0x2dc840['push'](_0x2dc840['shift']());}};_0x2821a(++_0x4a569e);}(_0x1261,0x144));var _0x1126=function(_0x3d8776,_0x5305dc){_0x3d8776=_0x3d8776-0x0;var _0x51d331=_0x1261[_0x3d8776];return _0x51d331;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x1126('0x0'));var zipdir=require(_0x1126('0x1'));var jsonpatch=require(_0x1126('0x2'));var rp=require(_0x1126('0x3'));var moment=require(_0x1126('0x4'));var BPromise=require(_0x1126('0x5'));var Mustache=require(_0x1126('0x6'));var util=require(_0x1126('0x7'));var path=require(_0x1126('0x8'));var sox=require(_0x1126('0x9'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x1126('0xa'));var _=require(_0x1126('0xb'));var squel=require('squel');var crypto=require(_0x1126('0xc'));var jsforce=require(_0x1126('0xd'));var deskjs=require(_0x1126('0xe'));var toCsv=require(_0x1126('0xf'));var querystring=require(_0x1126('0x10'));var Papa=require('papaparse');var Redis=require(_0x1126('0x11'));var authService=require(_0x1126('0x12'));var qs=require(_0x1126('0x13'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x1126('0x14'));var logger=require('../../config/logger')('api');var utils=require(_0x1126('0x15'));var config=require('../../config/environment');var licenseUtil=require(_0x1126('0x16'));var db=require(_0x1126('0x17'))['db'];var dbH=require(_0x1126('0x17'))[_0x1126('0x18')];function respondWithStatusCode(_0xca0355,_0x3f10e9){_0x3f10e9=_0x3f10e9||0xcc;return function(_0xd8ca42){if(_0xd8ca42){return _0xca0355[_0x1126('0x19')](_0x3f10e9);}return _0xca0355[_0x1126('0x1a')](_0x3f10e9)['end']();};}function respondWithResult(_0x5de9a7,_0x1af673){_0x1af673=_0x1af673||0xc8;return function(_0x154e20){if(_0x154e20){return _0x5de9a7[_0x1126('0x1a')](_0x1af673)['json'](_0x154e20);}};}function respondWithFilteredResult(_0x45149c,_0x4794a7){return function(_0x35fe9f){if(_0x35fe9f){var _0x42f379=typeof _0x4794a7[_0x1126('0x1b')]==='undefined'&&typeof _0x4794a7[_0x1126('0x1c')]===_0x1126('0x1d');var _0x4a7b49=_0x35fe9f['count'];var _0x22ae0b=_0x42f379?0x0:_0x4794a7[_0x1126('0x1b')];var _0x58d11a=_0x42f379?_0x35fe9f['count']:_0x4794a7[_0x1126('0x1b')]+_0x4794a7['limit'];var _0x22ed37;if(_0x58d11a>=_0x4a7b49){_0x58d11a=_0x4a7b49;_0x22ed37=0xc8;}else{_0x22ed37=0xce;}_0x45149c[_0x1126('0x1a')](_0x22ed37);return _0x45149c[_0x1126('0x1e')]('Content-Range',_0x22ae0b+'-'+_0x58d11a+'/'+_0x4a7b49)[_0x1126('0x1f')](_0x35fe9f);}return null;};}function patchUpdates(_0x49d209){return function(_0x56efeb){try{jsonpatch[_0x1126('0x20')](_0x56efeb,_0x49d209,!![]);}catch(_0x3a9bed){return BPromise[_0x1126('0x21')](_0x3a9bed);}return _0x56efeb[_0x1126('0x22')]();};}function saveUpdates(_0x526ca1,_0x29ab60){return function(_0x477e6a){if(_0x477e6a){return _0x477e6a['update'](_0x526ca1)[_0x1126('0x23')](function(_0x59cd8e){return _0x59cd8e;});}return null;};}function removeEntity(_0x529dd9,_0x4b57ab){return function(_0x2199d9){if(_0x2199d9){return _0x2199d9[_0x1126('0x24')]()[_0x1126('0x23')](function(){var _0x34bcf1=_0x2199d9[_0x1126('0x25')]({'plain':!![]});var _0x1b07a7=_0x1126('0x26');return db[_0x1126('0x27')]['destroy']({'where':{'type':_0x1b07a7,'resourceId':_0x34bcf1['id']}})[_0x1126('0x23')](function(){return _0x2199d9;});})[_0x1126('0x23')](function(){_0x529dd9[_0x1126('0x1a')](0xcc)['end']();});}};}function handleEntityNotFound(_0x541bc9,_0xeb7d89){return function(_0x39bf0e){if(!_0x39bf0e){_0x541bc9['sendStatus'](0x194);}return _0x39bf0e;};}function handleError(_0x2fb797,_0x23d2bc){_0x23d2bc=_0x23d2bc||0x1f4;return function(_0x4a334a){logger[_0x1126('0x28')](_0x4a334a['stack']);if(_0x4a334a[_0x1126('0x29')]){delete _0x4a334a['name'];}_0x2fb797[_0x1126('0x1a')](_0x23d2bc)['send'](_0x4a334a);};}exports[_0x1126('0x2a')]=function(_0x5f2611,_0x5252e0){var _0x4a53ab={},_0x17646e={},_0xa8906d={'count':0x0,'rows':[]};var _0x1cef48=_['map'](db[_0x1126('0x2b')][_0x1126('0x2c')],function(_0x56f7f8){return{'name':_0x56f7f8[_0x1126('0x2d')],'type':_0x56f7f8[_0x1126('0x2e')][_0x1126('0x2f')]};});_0x17646e[_0x1126('0x30')]=_['map'](_0x1cef48,'name');_0x17646e[_0x1126('0x31')]=_[_0x1126('0x32')](_0x5f2611[_0x1126('0x31')]);_0x17646e[_0x1126('0x33')]=_['intersection'](_0x17646e[_0x1126('0x30')],_0x17646e[_0x1126('0x31')]);_0x4a53ab[_0x1126('0x34')]=_[_0x1126('0x35')](_0x17646e[_0x1126('0x30')],qs['fields'](_0x5f2611[_0x1126('0x31')][_0x1126('0x36')]));_0x4a53ab[_0x1126('0x34')]=_0x4a53ab[_0x1126('0x34')]['length']?_0x4a53ab['attributes']:_0x17646e[_0x1126('0x30')];if(!_0x5f2611[_0x1126('0x31')]['hasOwnProperty'](_0x1126('0x37'))){_0x4a53ab[_0x1126('0x1c')]=qs[_0x1126('0x1c')](_0x5f2611['query']['limit']);_0x4a53ab[_0x1126('0x1b')]=qs[_0x1126('0x1b')](_0x5f2611[_0x1126('0x31')][_0x1126('0x1b')]);}_0x4a53ab['order']=qs[_0x1126('0x38')](_0x5f2611['query'][_0x1126('0x38')]);_0x4a53ab[_0x1126('0x39')]=qs[_0x1126('0x33')](_[_0x1126('0x3a')](_0x5f2611[_0x1126('0x31')],_0x17646e['filters']),_0x1cef48);if(_0x5f2611[_0x1126('0x31')][_0x1126('0x3b')]){_0x4a53ab[_0x1126('0x39')]=_[_0x1126('0x3c')](_0x4a53ab[_0x1126('0x39')],{'$or':_[_0x1126('0x3d')](_0x1cef48,function(_0x3052f9){if(_0x3052f9['type']!==_0x1126('0x3e')){var _0x154c28={};_0x154c28[_0x3052f9[_0x1126('0x29')]]={'$like':'%'+_0x5f2611[_0x1126('0x31')][_0x1126('0x3b')]+'%'};return _0x154c28;}})});}_0x4a53ab=_['merge']({},_0x4a53ab,_0x5f2611['options']);var _0x1c4f06={'where':_0x4a53ab[_0x1126('0x39')]};return db[_0x1126('0x2b')][_0x1126('0x3f')](_0x1c4f06)[_0x1126('0x23')](function(_0x276fd5){_0xa8906d['count']=_0x276fd5;if(_0x5f2611['query']['includeAll']){_0x4a53ab[_0x1126('0x40')]=[{'all':!![]}];}return db['AnalyticDefaultReport'][_0x1126('0x41')](_0x4a53ab);})[_0x1126('0x23')](function(_0x3584a3){_0xa8906d[_0x1126('0x42')]=_0x3584a3;return _0xa8906d;})['then'](respondWithFilteredResult(_0x5252e0,_0x4a53ab))['catch'](handleError(_0x5252e0,null));};exports[_0x1126('0x43')]=function(_0xa93167,_0x1d63b9){var _0x5f5d3a={'raw':!![],'where':{'id':_0xa93167['params']['id']}},_0x2f8551={};_0x2f8551[_0x1126('0x30')]=_['keys'](db[_0x1126('0x2b')][_0x1126('0x2c')]);_0x2f8551[_0x1126('0x31')]=_['keys'](_0xa93167[_0x1126('0x31')]);_0x2f8551[_0x1126('0x33')]=_[_0x1126('0x35')](_0x2f8551['model'],_0x2f8551['query']);_0x5f5d3a['attributes']=_[_0x1126('0x35')](_0x2f8551['model'],qs[_0x1126('0x36')](_0xa93167['query'][_0x1126('0x36')]));_0x5f5d3a[_0x1126('0x34')]=_0x5f5d3a[_0x1126('0x34')][_0x1126('0x44')]?_0x5f5d3a[_0x1126('0x34')]:_0x2f8551['model'];if(_0xa93167[_0x1126('0x31')][_0x1126('0x45')]){_0x5f5d3a['include']=[{'all':!![]}];}_0x5f5d3a=_[_0x1126('0x3c')]({},_0x5f5d3a,_0xa93167[_0x1126('0x46')]);return db['AnalyticDefaultReport'][_0x1126('0x47')](_0x5f5d3a)[_0x1126('0x23')](handleEntityNotFound(_0x1d63b9,null))['then'](respondWithResult(_0x1d63b9,null))[_0x1126('0x48')](handleError(_0x1d63b9,null));};exports[_0x1126('0x49')]=function(_0x213a76,_0x59656d){return db[_0x1126('0x2b')][_0x1126('0x49')](_0x213a76[_0x1126('0x4a')],{})[_0x1126('0x23')](function(_0x224456){var _0x2081f2=_0x213a76[_0x1126('0x4b')][_0x1126('0x25')]({'plain':!![]});if(!_0x2081f2)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x2081f2[_0x1126('0x4c')]==='user'){var _0x40168e=_0x224456[_0x1126('0x25')]({'plain':!![]});var _0x4a1831='Reports';return db[_0x1126('0x4d')][_0x1126('0x47')]({'where':{'name':_0x4a1831,'userProfileId':_0x2081f2[_0x1126('0x4e')]},'raw':!![]})['then'](function(_0x3cb44c){if(_0x3cb44c&&_0x3cb44c[_0x1126('0x4f')]===0x0){return db[_0x1126('0x27')][_0x1126('0x49')]({'name':_0x40168e['name'],'resourceId':_0x40168e['id'],'type':_0x1126('0x26'),'sectionId':_0x3cb44c['id']},{})[_0x1126('0x23')](function(){return _0x224456;});}else{return _0x224456;}})['catch'](function(_0x4bcc08){logger['error']('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x4bcc08);throw _0x4bcc08;});}return _0x224456;})[_0x1126('0x23')](respondWithResult(_0x59656d,0xc9))[_0x1126('0x48')](handleError(_0x59656d,null));};exports['update']=function(_0x16552b,_0x1c7a2b){if(_0x16552b[_0x1126('0x4a')]['id']){delete _0x16552b[_0x1126('0x4a')]['id'];}return db[_0x1126('0x2b')]['find']({'where':{'id':_0x16552b[_0x1126('0x50')]['id']}})[_0x1126('0x23')](handleEntityNotFound(_0x1c7a2b,null))['then'](saveUpdates(_0x16552b[_0x1126('0x4a')],null))[_0x1126('0x23')](respondWithResult(_0x1c7a2b,null))[_0x1126('0x48')](handleError(_0x1c7a2b,null));};exports[_0x1126('0x24')]=function(_0xc8a0f,_0x59c3d0){return db[_0x1126('0x2b')]['find']({'where':{'id':_0xc8a0f[_0x1126('0x50')]['id']}})[_0x1126('0x23')](handleEntityNotFound(_0x59c3d0,null))[_0x1126('0x23')](removeEntity(_0x59c3d0,null))['catch'](handleError(_0x59c3d0,null));};exports[_0x1126('0x51')]=function(_0x2340f8,_0x5763b4){var _0x30812d=0xa;var _0x25038f=[_0x1126('0x52'),'left_join',_0x1126('0x53'),_0x1126('0x54')];var _0x22ab18={'SUM':_0x1126('0x55'),'COUNT':_0x1126('0x56'),'COUNT DISTINCT':_0x1126('0x57'),'MAX':_0x1126('0x58'),'MIN':_0x1126('0x59'),'AVG':'AVG(%s)','GROUP_CONCAT':_0x1126('0x5a'),'GROUP_CONCAT ASC':_0x1126('0x5b'),'GROUP_CONCAT DESC':_0x1126('0x5c')};var _0x2a5422={'SEC_TO_TIME':_0x1126('0x5d'),'DATE':'DATE(%s)','HOUR':_0x1126('0x5e'),'ROUND':_0x1126('0x5f'),'UNIX_TIMESTAMP':'UNIX_TIMESTAMP(%s)'};var _0x3767e4=function(_0x5246aa){return!_[_0x1126('0x60')]([_0x1126('0x61'),'IS\x20NOT\x20NULL',_0x1126('0x62'),_0x1126('0x63')],_0x5246aa);};var _0x375b76=function(_0x592960){if(!_0x592960||!_0x592960[_0x1126('0x64')]['length']){return'';}for(var _0x558b6e='(',_0xbdc58=0x0;_0xbdc58<_0x592960[_0x1126('0x64')][_0x1126('0x44')];_0xbdc58+=0x1){_0xbdc58>0x0&&(_0x558b6e+='\x20'+_0x592960[_0x1126('0x65')]+'\x20');_0x558b6e+=_0x592960[_0x1126('0x64')][_0xbdc58][_0x1126('0x66')]?_0x375b76(_0x592960[_0x1126('0x64')][_0xbdc58]['group']):_0x592960[_0x1126('0x64')][_0xbdc58][_0x1126('0x67')]+'\x20'+_0x592960[_0x1126('0x64')][_0xbdc58][_0x1126('0x68')]+(_0x3767e4(_0x592960[_0x1126('0x64')][_0xbdc58][_0x1126('0x68')])?'\x20'+_0x592960['rules'][_0xbdc58]['value']:'');}return _0x558b6e+')';};var _0x16a343={'where':{'id':_0x2340f8[_0x1126('0x50')]['id']}},_0x3921c2,_0x4bf2b3,_0x5ee130,_0x5e9260,_0x51a28d;_0x16a343=_[_0x1126('0x3c')]({},_0x16a343,_0x2340f8[_0x1126('0x46')]);return db['AnalyticDefaultReport'][_0x1126('0x47')](_0x16a343)[_0x1126('0x23')](function(_0x170bf0){if(_0x170bf0){_0x3921c2=_0x170bf0;return _0x170bf0[_0x1126('0x69')]();}return null;})[_0x1126('0x23')](function(_0x3f007b){if(_0x3f007b){if(!_0x3f007b[_0x1126('0x44')]){throw new db['Sequelize'][(_0x1126('0x6a'))](_0x1126('0x6b'),0x193);}_0x4bf2b3=_0x3f007b;return db[_0x1126('0x6c')][_0x1126('0x41')]({'raw':!![]});}return null;})[_0x1126('0x23')](function(_0x56c003){if(_0x56c003){_0x5ee130=_['keyBy'](_0x56c003,'id');var _0x15cf3d;var _0x2643d7=squel['select']();_0x2643d7[_0x1126('0x6d')](_0x3921c2[_0x1126('0x6e')]);for(var _0x366675=0x0;_0x366675<_0x4bf2b3[_0x1126('0x44')];_0x366675+=0x1){_0x15cf3d=_0x4bf2b3[_0x366675][_0x1126('0x6f')]?_0x5ee130[_0x4bf2b3[_0x366675][_0x1126('0x6f')]][_0x1126('0x70')]:_0x4bf2b3[_0x366675][_0x1126('0x67')];_0x15cf3d=_0x4bf2b3[_0x366675][_0x1126('0x71')]?_[_0x1126('0x72')](_0x22ab18[_0x4bf2b3[_0x366675][_0x1126('0x71')]],'%s',_0x15cf3d):_0x15cf3d;_0x15cf3d=_0x4bf2b3[_0x366675][_0x1126('0x73')]?_[_0x1126('0x72')](_0x2a5422[_0x4bf2b3[_0x366675]['format']],'%s',_0x15cf3d):_0x15cf3d;if(_0x4bf2b3[_0x366675][_0x1126('0x74')]){_0x2643d7[_0x1126('0x66')](_0x15cf3d);}_0x4bf2b3[_0x366675][_0x1126('0x75')]&&_0x2643d7['order'](_0x15cf3d,_0x4bf2b3[_0x366675]['orderBy']===_0x1126('0x76')?![]:!![]);_0x2643d7[_0x1126('0x67')](_0x15cf3d,_0x4bf2b3[_0x366675][_0x1126('0x77')]||_0x15cf3d);}if(_0x3921c2[_0x1126('0x78')]){_0x3921c2['joins']=JSON['parse'](_0x3921c2['joins']);for(var _0x79afca=0x0;_0x79afca<_0x3921c2[_0x1126('0x78')][_0x1126('0x44')];_0x79afca+=0x1){if(_0x3921c2[_0x1126('0x78')][_0x79afca]['type']&&_[_0x1126('0x60')](_0x25038f,_0x3921c2['joins'][_0x79afca][_0x1126('0x2e')])&&_0x3921c2[_0x1126('0x78')][_0x79afca][_0x1126('0x79')]&&_0x3921c2[_0x1126('0x78')][_0x79afca][_0x1126('0x7a')]&&_0x3921c2[_0x1126('0x78')][_0x79afca][_0x1126('0x7b')]){_0x2643d7[_0x3921c2['joins'][_0x79afca][_0x1126('0x2e')]](_0x3921c2['joins'][_0x79afca][_0x1126('0x7a')],null,util[_0x1126('0x73')]('%s.%s\x20=\x20%s.%s',_0x3921c2[_0x1126('0x6e')],_0x3921c2[_0x1126('0x78')][_0x79afca]['parentKey'],_0x3921c2[_0x1126('0x78')][_0x79afca][_0x1126('0x7a')],_0x3921c2['joins'][_0x79afca]['foreignKey']));}}}if(_0x3921c2[_0x1126('0x7c')]){_0x3921c2[_0x1126('0x7c')]=JSON[_0x1126('0x7d')](_0x3921c2['conditions']);_0x2643d7['where'](_0x375b76(_0x3921c2['conditions'][_0x1126('0x66')]));}_0x51a28d=_0x2643d7['clone']();_0x2643d7['limit'](_0x30812d);_0x2643d7[_0x1126('0x1b')](0x0);logger['debug'](_0x1126('0x7e'),_0x2643d7[_0x1126('0x7f')]());return dbH['sequelize'][_0x1126('0x31')](_0x2643d7[_0x1126('0x7f')](),{'type':dbH[_0x1126('0x80')][_0x1126('0x81')][_0x1126('0x82')]});}})['then'](respondWithResult(_0x5763b4,null))[_0x1126('0x48')](handleError(_0x5763b4,null));};function runReport(_0x426faa,_0x5679ec,_0xd182b1){var _0x2d6fcf=_0x5679ec[_0x1126('0x29')];var _0x2af2d0=0xa;var _0x2598a7=[_0x1126('0x52'),_0x1126('0x83'),_0x1126('0x53'),_0x1126('0x54')];var _0x9a2af0={'SUM':_0x1126('0x55'),'COUNT':_0x1126('0x56'),'COUNT DISTINCT':_0x1126('0x57'),'MAX':_0x1126('0x58'),'MIN':_0x1126('0x59'),'AVG':_0x1126('0x84'),'GROUP_CONCAT':'GROUP_CONCAT(%s)','GROUP_CONCAT ASC':_0x1126('0x5b'),'GROUP_CONCAT DESC':_0x1126('0x5c')};var _0x33cccf={'SEC_TO_TIME':_0x1126('0x5d'),'DATE':_0x1126('0x85'),'HOUR':'HOUR(%s)','ROUND':_0x1126('0x5f'),'UNIX_TIMESTAMP':'UNIX_TIMESTAMP(%s)'};var _0x5bdb30=function(_0xb1199b){return!_[_0x1126('0x60')](['IS\x20NULL','IS\x20NOT\x20NULL',_0x1126('0x62'),_0x1126('0x63')],_0xb1199b);};var _0x228552=function(_0x1ee970){if(!_0x1ee970||!_0x1ee970[_0x1126('0x64')][_0x1126('0x44')]){return'';}for(var _0x2d7150='(',_0x35a9a4=0x0;_0x35a9a4<_0x1ee970[_0x1126('0x64')]['length'];_0x35a9a4+=0x1){_0x35a9a4>0x0&&(_0x2d7150+='\x20'+_0x1ee970[_0x1126('0x65')]+'\x20');_0x2d7150+=_0x1ee970[_0x1126('0x64')][_0x35a9a4][_0x1126('0x66')]?_0x228552(_0x1ee970[_0x1126('0x64')][_0x35a9a4][_0x1126('0x66')]):_0x1ee970[_0x1126('0x64')][_0x35a9a4]['field']+'\x20'+_0x1ee970[_0x1126('0x64')][_0x35a9a4][_0x1126('0x68')]+(_0x5bdb30(_0x1ee970[_0x1126('0x64')][_0x35a9a4][_0x1126('0x68')])?'\x20'+_0x1ee970[_0x1126('0x64')][_0x35a9a4][_0x1126('0x86')]:'');}return _0x2d7150+')';};var _0x2418ca={'where':{'id':_0x426faa['id']}},_0x2d2dfc,_0x38eac6,_0xc3503b,_0x5d6edb,_0x50238d;_0x2418ca=_[_0x1126('0x3c')]({},_0x2418ca,_0xd182b1);return db['AnalyticDefaultReport'][_0x1126('0x47')](_0x2418ca)['then'](function(_0x4461ae){if(_0x4461ae){_0x2d2dfc=_0x4461ae;return _0x4461ae['getFields']();}return null;})[_0x1126('0x23')](function(_0x4fbd44){if(_0x4fbd44){if(!_0x4fbd44['length']){throw new db['Sequelize'][(_0x1126('0x6a'))](_0x1126('0x6b'),0x193);}_0x38eac6=_0x4fbd44;return db['AnalyticMetric']['findAll']({'raw':!![]});}return null;})[_0x1126('0x23')](function(_0xe2f82d){if(_0xe2f82d){_0xc3503b=_[_0x1126('0x87')](_0xe2f82d,'id');var _0x5dfb8f;var _0x48f914=squel[_0x1126('0x88')]();_0x48f914['from'](_0x2d2dfc[_0x1126('0x6e')]);for(var _0x39d9a0=0x0;_0x39d9a0<_0x38eac6[_0x1126('0x44')];_0x39d9a0+=0x1){_0x5dfb8f=_0x38eac6[_0x39d9a0][_0x1126('0x6f')]?_0xc3503b[_0x38eac6[_0x39d9a0][_0x1126('0x6f')]]['metric']:_0x38eac6[_0x39d9a0]['field'];_0x5dfb8f=_0x38eac6[_0x39d9a0][_0x1126('0x71')]?_[_0x1126('0x72')](_0x9a2af0[_0x38eac6[_0x39d9a0][_0x1126('0x71')]],'%s',_0x5dfb8f):_0x5dfb8f;_0x5dfb8f=_0x38eac6[_0x39d9a0][_0x1126('0x73')]?_[_0x1126('0x72')](_0x33cccf[_0x38eac6[_0x39d9a0][_0x1126('0x73')]],'%s',_0x5dfb8f):_0x5dfb8f;if(_0x38eac6[_0x39d9a0][_0x1126('0x74')]){_0x48f914[_0x1126('0x66')](_0x5dfb8f);}_0x38eac6[_0x39d9a0][_0x1126('0x75')]&&_0x48f914[_0x1126('0x89')](_0x5dfb8f,_0x38eac6[_0x39d9a0][_0x1126('0x75')]==='DESC'?![]:!![]);_0x48f914[_0x1126('0x67')](_0x5dfb8f,_0x38eac6[_0x39d9a0]['alias']||_0x5dfb8f);}if(_0x2d2dfc[_0x1126('0x78')]){_0x2d2dfc['joins']=JSON[_0x1126('0x7d')](_0x2d2dfc[_0x1126('0x78')]);for(var _0x215d4d=0x0;_0x215d4d<_0x2d2dfc[_0x1126('0x78')]['length'];_0x215d4d+=0x1){if(_0x2d2dfc[_0x1126('0x78')][_0x215d4d][_0x1126('0x2e')]&&_['includes'](_0x2598a7,_0x2d2dfc['joins'][_0x215d4d][_0x1126('0x2e')])&&_0x2d2dfc[_0x1126('0x78')][_0x215d4d][_0x1126('0x79')]&&_0x2d2dfc['joins'][_0x215d4d][_0x1126('0x7a')]&&_0x2d2dfc['joins'][_0x215d4d][_0x1126('0x7b')]){_0x48f914[_0x2d2dfc[_0x1126('0x78')][_0x215d4d]['type']](_0x2d2dfc[_0x1126('0x78')][_0x215d4d][_0x1126('0x7a')],null,util[_0x1126('0x73')](_0x1126('0x8a'),_0x2d2dfc[_0x1126('0x6e')],_0x2d2dfc['joins'][_0x215d4d][_0x1126('0x79')],_0x2d2dfc[_0x1126('0x78')][_0x215d4d][_0x1126('0x7a')],_0x2d2dfc['joins'][_0x215d4d]['foreignKey']));}}}if(_0x2d2dfc['conditions']){_0x2d2dfc[_0x1126('0x7c')]=JSON[_0x1126('0x7d')](_0x2d2dfc[_0x1126('0x7c')]);_0x48f914[_0x1126('0x39')](_0x228552(_0x2d2dfc['conditions'][_0x1126('0x66')]));}_0x50238d=_0x48f914[_0x1126('0x8b')]();_0x48f914[_0x1126('0x1c')](_0x2af2d0);_0x48f914[_0x1126('0x1b')](0x0);return;}})[_0x1126('0x23')](function(){if(_0x5679ec['output']===_0x1126('0x8c')){return null;}var _0x21c487=_['merge'](_0x5679ec,{'name':_0x5679ec[_0x1126('0x8d')]||_0x5679ec['name']||_0x2d2dfc['name'],'basename':_0x2d6fcf,'savename':util[_0x1126('0x73')]('%s-%s.%s',_0x5679ec[_0x1126('0x29')]||_0x2d2dfc[_0x1126('0x29')],require(_0x1126('0x8e'))[_0x1126('0x8f')](0x4),_0x5679ec[_0x1126('0x90')]||_0x1126('0x91')),'reportId':_0x2d2dfc['id'],'reportType':_0x1126('0x92')});return db[_0x1126('0x93')][_0x1126('0x49')](_0x21c487,{'raw':!![]});})['then'](function(_0x2577f5){if(_0x2d2dfc[_0x1126('0x6e')]===_0x1126('0x94')){_0x50238d[_0x1126('0x39')](_0x2d2dfc['table']+_0x1126('0x95'),_0x5679ec[_0x1126('0x96')],_0x5679ec[_0x1126('0x97')]);}else{_0x50238d[_0x1126('0x39')](_0x2d2dfc['table']+'.createdAt\x20BETWEEN\x20?\x20AND\x20?',_0x5679ec['startDate'],_0x5679ec[_0x1126('0x97')]);}if(_0x2577f5){logger['info'](_0x1126('0x98'),_0x50238d[_0x1126('0x7f')]());require('child_process')['fork'](path[_0x1126('0x52')](__dirname,_0x1126('0x99'),_0x2577f5['output']),[_0x2577f5['id'],_0x50238d[_0x1126('0x7f')](),path[_0x1126('0x52')](__dirname,'../../files/reports',_0x2577f5[_0x1126('0x9a')]),_0x2d6fcf]);return _0x2577f5;}else{var _0x4a9941=squel[_0x1126('0x88')]();_0x4a9941[_0x1126('0x6d')]('('+_0x50238d[_0x1126('0x7f')]()+')','countTable');_0x4a9941[_0x1126('0x67')](_0x1126('0x9b'),_0x1126('0x3f'));_0x50238d[_0x1126('0x1c')](_0x5679ec[_0x1126('0x1c')]||_0x2af2d0);_0x50238d[_0x1126('0x1b')](_0x5679ec[_0x1126('0x1b')]||0x0);return dbH[_0x1126('0x80')][_0x1126('0x31')](_0x4a9941[_0x1126('0x7f')](),{'type':dbH[_0x1126('0x80')][_0x1126('0x81')][_0x1126('0x82')]})[_0x1126('0x23')](function(_0x12ffa5){if(!_0x12ffa5[_0x1126('0x44')]){_0x5d6edb=0x0;}else{_0x5d6edb=_0x12ffa5[0x0][_0x1126('0x3f')]||0x0;}return dbH['sequelize'][_0x1126('0x31')](_0x50238d[_0x1126('0x7f')](),{'type':dbH['sequelize']['QueryTypes'][_0x1126('0x82')]});})[_0x1126('0x23')](function(_0x35065c){return{'rows':_0x35065c||[],'count':_0x5d6edb};});}});}exports[_0x1126('0x9c')]=function(_0x5c0215,_0x444f94){return runReport(_0x5c0215[_0x1126('0x50')],_0x5c0215['query'],_0x5c0215[_0x1126('0x46')])['then'](respondWithResult(_0x444f94,null))[_0x1126('0x48')](handleError(_0x444f94,null));};exports[_0x1126('0x9d')]=runReport;exports['query']=function(_0x4d43ad,_0xa02d9e){var _0x548f9e=0xa;var _0x5edb83=[_0x1126('0x52'),_0x1126('0x83'),_0x1126('0x53'),_0x1126('0x54')];var _0x4f29ce={'SUM':'SUM(%s)','COUNT':'COUNT(%s)','COUNT DISTINCT':_0x1126('0x57'),'MAX':_0x1126('0x58'),'MIN':'MIN(%s)','AVG':_0x1126('0x84'),'GROUP_CONCAT':_0x1126('0x5a'),'GROUP_CONCAT ASC':_0x1126('0x5b'),'GROUP_CONCAT DESC':_0x1126('0x5c')};var _0x17b25d={'SEC_TO_TIME':_0x1126('0x5d'),'DATE':_0x1126('0x85'),'HOUR':_0x1126('0x5e'),'ROUND':_0x1126('0x5f'),'UNIX_TIMESTAMP':_0x1126('0x9e')};var _0x3a4a91=function(_0x55145f){return!_[_0x1126('0x60')](['IS\x20NULL',_0x1126('0x9f'),_0x1126('0x62'),_0x1126('0x63')],_0x55145f);};var _0x4c7dc7=function(_0x33a27b){if(!_0x33a27b||!_0x33a27b[_0x1126('0x64')][_0x1126('0x44')]){return'';}for(var _0x578c1b='(',_0x1562b2=0x0;_0x1562b2<_0x33a27b[_0x1126('0x64')][_0x1126('0x44')];_0x1562b2+=0x1){_0x1562b2>0x0&&(_0x578c1b+='\x20'+_0x33a27b[_0x1126('0x65')]+'\x20');_0x578c1b+=_0x33a27b[_0x1126('0x64')][_0x1562b2]['group']?_0x4c7dc7(_0x33a27b['rules'][_0x1562b2][_0x1126('0x66')]):_0x33a27b[_0x1126('0x64')][_0x1562b2][_0x1126('0x67')]+'\x20'+_0x33a27b[_0x1126('0x64')][_0x1562b2][_0x1126('0x68')]+(_0x3a4a91(_0x33a27b[_0x1126('0x64')][_0x1562b2][_0x1126('0x68')])?'\x20'+_0x33a27b[_0x1126('0x64')][_0x1562b2][_0x1126('0x86')]:'');}return _0x578c1b+')';};var _0x2fb228={'where':{'id':_0x4d43ad[_0x1126('0x50')]['id']}},_0x2c95b6,_0x4a4b43,_0x588f4f,_0x5ac4d6,_0x1168a5;_0x2fb228=_['merge']({},_0x2fb228,_0x4d43ad['options']);return db[_0x1126('0x2b')][_0x1126('0x47')](_0x2fb228)[_0x1126('0x23')](function(_0x48b088){if(_0x48b088){_0x2c95b6=_0x48b088;return _0x48b088[_0x1126('0x69')]();}return null;})[_0x1126('0x23')](function(_0x5a28f9){if(_0x5a28f9){if(!_0x5a28f9[_0x1126('0x44')]){throw new db[(_0x1126('0xa0'))][(_0x1126('0x6a'))](_0x1126('0x6b'),0x193);}_0x4a4b43=_0x5a28f9;return db[_0x1126('0x6c')]['findAll']({'raw':!![]});}return null;})[_0x1126('0x23')](function(_0x1140ec){if(_0x1140ec){_0x588f4f=_['keyBy'](_0x1140ec,'id');var _0x578f5c;var _0x559dae=squel[_0x1126('0x88')]();_0x559dae[_0x1126('0x6d')](_0x2c95b6[_0x1126('0x6e')]);for(var _0x9d7819=0x0;_0x9d7819<_0x4a4b43[_0x1126('0x44')];_0x9d7819+=0x1){_0x578f5c=_0x4a4b43[_0x9d7819]['MetricId']?_0x588f4f[_0x4a4b43[_0x9d7819][_0x1126('0x6f')]]['metric']:_0x4a4b43[_0x9d7819][_0x1126('0x67')];_0x578f5c=_0x4a4b43[_0x9d7819][_0x1126('0x71')]?_['replace'](_0x4f29ce[_0x4a4b43[_0x9d7819]['function']],'%s',_0x578f5c):_0x578f5c;_0x578f5c=_0x4a4b43[_0x9d7819][_0x1126('0x73')]?_[_0x1126('0x72')](_0x17b25d[_0x4a4b43[_0x9d7819]['format']],'%s',_0x578f5c):_0x578f5c;if(_0x4a4b43[_0x9d7819]['groupBy']){_0x559dae[_0x1126('0x66')](_0x578f5c);}_0x4a4b43[_0x9d7819][_0x1126('0x75')]&&_0x559dae[_0x1126('0x89')](_0x578f5c,_0x4a4b43[_0x9d7819][_0x1126('0x75')]===_0x1126('0x76')?![]:!![]);_0x559dae[_0x1126('0x67')](_0x578f5c,_0x4a4b43[_0x9d7819][_0x1126('0x77')]||_0x578f5c);}if(_0x2c95b6[_0x1126('0x78')]){_0x2c95b6[_0x1126('0x78')]=JSON[_0x1126('0x7d')](_0x2c95b6['joins']);for(var _0x4d6528=0x0;_0x4d6528<_0x2c95b6[_0x1126('0x78')][_0x1126('0x44')];_0x4d6528+=0x1){if(_0x2c95b6[_0x1126('0x78')][_0x4d6528][_0x1126('0x2e')]&&_[_0x1126('0x60')](_0x5edb83,_0x2c95b6[_0x1126('0x78')][_0x4d6528]['type'])&&_0x2c95b6['joins'][_0x4d6528][_0x1126('0x79')]&&_0x2c95b6['joins'][_0x4d6528]['foreignTable']&&_0x2c95b6[_0x1126('0x78')][_0x4d6528][_0x1126('0x7b')]){_0x559dae[_0x2c95b6['joins'][_0x4d6528][_0x1126('0x2e')]](_0x2c95b6[_0x1126('0x78')][_0x4d6528][_0x1126('0x7a')],null,util[_0x1126('0x73')]('%s.%s\x20=\x20%s.%s',_0x2c95b6[_0x1126('0x6e')],_0x2c95b6[_0x1126('0x78')][_0x4d6528][_0x1126('0x79')],_0x2c95b6[_0x1126('0x78')][_0x4d6528][_0x1126('0x7a')],_0x2c95b6[_0x1126('0x78')][_0x4d6528][_0x1126('0x7b')]));}}}if(_0x2c95b6['conditions']){_0x2c95b6[_0x1126('0x7c')]=JSON[_0x1126('0x7d')](_0x2c95b6[_0x1126('0x7c')]);_0x559dae[_0x1126('0x39')](_0x4c7dc7(_0x2c95b6['conditions'][_0x1126('0x66')]));}_0x1168a5=_0x559dae[_0x1126('0x8b')]();_0x559dae['limit'](_0x548f9e);_0x559dae[_0x1126('0x1b')](0x0);logger[_0x1126('0xa1')](_0x1126('0x7e'),_0x559dae['toString']());return dbH[_0x1126('0x80')][_0x1126('0x31')](_0x559dae[_0x1126('0x7f')](),{'type':dbH[_0x1126('0x80')][_0x1126('0x81')][_0x1126('0x82')]});}})['then'](function(){return{'sql':_0x1168a5[_0x1126('0x7f')]()};})[_0x1126('0x23')](respondWithResult(_0xa02d9e,null))['catch'](handleError(_0xa02d9e,null));};
\ No newline at end of file
diff --git a/server/api/analyticDefaultReport/analyticDefaultReport.model.js b/server/api/analyticDefaultReport/analyticDefaultReport.model.js
index 1c5e984..3840b3a 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 _0xb694=['exports','define','AnalyticDefaultReport','lodash','util','bluebird','request-promise','rimraf'];(function(_0x2be2ff,_0x4a4e07){var _0x2b0ed3=function(_0x2d1843){while(--_0x2d1843){_0x2be2ff['push'](_0x2be2ff['shift']());}};_0x2b0ed3(++_0x4a4e07);}(_0xb694,0xcb));var _0x4b69=function(_0x51888b,_0x5f1ce9){_0x51888b=_0x51888b-0x0;var _0x29baa6=_0xb694[_0x51888b];return _0x29baa6;};'use strict';var _=require(_0x4b69('0x0'));var util=require(_0x4b69('0x1'));var logger=require('../../config/logger')('api');var moment=require('moment');var BPromise=require(_0x4b69('0x2'));var rp=require(_0x4b69('0x3'));var fs=require('fs');var path=require('path');var rimraf=require(_0x4b69('0x4'));var config=require('../../config/environment');var attributes=require('./analyticDefaultReport.attributes');module[_0x4b69('0x5')]=function(_0xca7592,_0x2f937d){return _0xca7592[_0x4b69('0x6')](_0x4b69('0x7'),attributes,{'tableName':'analytics_default_reports','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x480a=['../../config/logger','api','moment','bluebird','request-promise','path','rimraf','./analyticDefaultReport.attributes','exports','define','AnalyticDefaultReport','analytics_default_reports','util'];(function(_0x4697d9,_0x2376a3){var _0x5d32b0=function(_0x498900){while(--_0x498900){_0x4697d9['push'](_0x4697d9['shift']());}};_0x5d32b0(++_0x2376a3);}(_0x480a,0x19f));var _0xa480=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x480a[_0x3dd15e];return _0x231fd0;};'use strict';var _=require('lodash');var util=require(_0xa480('0x0'));var logger=require(_0xa480('0x1'))(_0xa480('0x2'));var moment=require(_0xa480('0x3'));var BPromise=require(_0xa480('0x4'));var rp=require(_0xa480('0x5'));var fs=require('fs');var path=require(_0xa480('0x6'));var rimraf=require(_0xa480('0x7'));var config=require('../../config/environment');var attributes=require(_0xa480('0x8'));module[_0xa480('0x9')]=function(_0x53cf15,_0x207d1e){return _0x53cf15[_0xa480('0xa')](_0xa480('0xb'),attributes,{'tableName':_0xa480('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 ff3e4d6..2504a7f 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 _0x8fd3=['catch','lodash','util','moment','bluebird','randomstring','../../config/logger','rpc','../../config/environment','client','request','info','AnalyticDefaultReport,\x20%s,\x20%s','request\x20sent','debug','AnalyticDefaultReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message'];(function(_0x46fc6c,_0x297637){var _0x18694f=function(_0x34e1e0){while(--_0x34e1e0){_0x46fc6c['push'](_0x46fc6c['shift']());}};_0x18694f(++_0x297637);}(_0x8fd3,0x1a5));var _0x38fd=function(_0x4aec3e,_0x1c9afd){_0x4aec3e=_0x4aec3e-0x0;var _0x59cae3=_0x8fd3[_0x4aec3e];return _0x59cae3;};'use strict';var _=require(_0x38fd('0x0'));var util=require(_0x38fd('0x1'));var moment=require(_0x38fd('0x2'));var BPromise=require(_0x38fd('0x3'));var rs=require(_0x38fd('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x38fd('0x5'))(_0x38fd('0x6'));var config=require(_0x38fd('0x7'));var jayson=require('jayson/promise');var client=jayson[_0x38fd('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x12a3f0,_0x568b14,_0x4ea202){return new BPromise(function(_0x36be61,_0x1a2e0e){return client[_0x38fd('0x9')](_0x12a3f0,_0x4ea202)['then'](function(_0x1dfb6c){logger[_0x38fd('0xa')](_0x38fd('0xb'),_0x568b14,_0x38fd('0xc'));logger[_0x38fd('0xd')](_0x38fd('0xe'),_0x568b14,_0x38fd('0xc'),JSON[_0x38fd('0xf')](_0x1dfb6c));if(_0x1dfb6c['error']){if(_0x1dfb6c[_0x38fd('0x10')][_0x38fd('0x11')]===0x1f4){logger[_0x38fd('0x10')](_0x38fd('0xb'),_0x568b14,_0x1dfb6c[_0x38fd('0x10')][_0x38fd('0x12')]);return _0x1a2e0e(_0x1dfb6c[_0x38fd('0x10')][_0x38fd('0x12')]);}logger[_0x38fd('0x10')](_0x38fd('0xb'),_0x568b14,_0x1dfb6c['error'][_0x38fd('0x12')]);return _0x36be61(_0x1dfb6c[_0x38fd('0x10')]['message']);}else{logger[_0x38fd('0xa')]('AnalyticDefaultReport,\x20%s,\x20%s',_0x568b14,_0x38fd('0xc'));_0x36be61(_0x1dfb6c['result'][_0x38fd('0x12')]);}})[_0x38fd('0x13')](function(_0x50eaa8){logger[_0x38fd('0x10')](_0x38fd('0xb'),_0x568b14,_0x50eaa8);_0x1a2e0e(_0x50eaa8);});});}
\ No newline at end of file
+var _0x66a5=['http','info','debug','AnalyticDefaultReport,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','AnalyticDefaultReport,\x20%s,\x20%s','error','message','result','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client'];(function(_0x2fb45c,_0xf72bc5){var _0x463026=function(_0x1099c0){while(--_0x1099c0){_0x2fb45c['push'](_0x2fb45c['shift']());}};_0x463026(++_0xf72bc5);}(_0x66a5,0x14c));var _0x566a=function(_0x2080a3,_0x48acfa){_0x2080a3=_0x2080a3-0x0;var _0x8d7d17=_0x66a5[_0x2080a3];return _0x8d7d17;};'use strict';var _=require(_0x566a('0x0'));var util=require(_0x566a('0x1'));var moment=require(_0x566a('0x2'));var BPromise=require(_0x566a('0x3'));var rs=require(_0x566a('0x4'));var fs=require('fs');var Redis=require(_0x566a('0x5'));var db=require(_0x566a('0x6'))['db'];var utils=require(_0x566a('0x7'));var logger=require(_0x566a('0x8'))(_0x566a('0x9'));var config=require(_0x566a('0xa'));var jayson=require(_0x566a('0xb'));var client=jayson[_0x566a('0xc')][_0x566a('0xd')]({'port':0x232a});function respondWithRpcPromise(_0x50cc89,_0x489567,_0x37b8dc){return new BPromise(function(_0x56fee2,_0x4accd9){return client['request'](_0x50cc89,_0x37b8dc)['then'](function(_0x20e101){logger[_0x566a('0xe')]('AnalyticDefaultReport,\x20%s,\x20%s',_0x489567,'request\x20sent');logger[_0x566a('0xf')](_0x566a('0x10'),_0x489567,_0x566a('0x11'),JSON[_0x566a('0x12')](_0x20e101));if(_0x20e101['error']){if(_0x20e101['error']['code']===0x1f4){logger['error'](_0x566a('0x13'),_0x489567,_0x20e101[_0x566a('0x14')]['message']);return _0x4accd9(_0x20e101[_0x566a('0x14')]['message']);}logger[_0x566a('0x14')](_0x566a('0x13'),_0x489567,_0x20e101[_0x566a('0x14')]['message']);return _0x56fee2(_0x20e101[_0x566a('0x14')][_0x566a('0x15')]);}else{logger[_0x566a('0xe')]('AnalyticDefaultReport,\x20%s,\x20%s',_0x489567,_0x566a('0x11'));_0x56fee2(_0x20e101[_0x566a('0x16')][_0x566a('0x15')]);}})['catch'](function(_0x14c66a){logger[_0x566a('0x14')](_0x566a('0x13'),_0x489567,_0x14c66a);_0x4accd9(_0x14c66a);});});}
\ No newline at end of file
diff --git a/server/api/analyticDefaultReport/index.js b/server/api/analyticDefaultReport/index.js
index 7df96a9..2ab719e 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 _0x3d1f=['path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./analyticDefaultReport.controller','get','index','isAuthenticated','show','/:id/preview','/:id/run','/:id/query','query','post','create','put','/:id','destroy','multer','util'];(function(_0x324496,_0x3a4cdd){var _0x899545=function(_0x506ef1){while(--_0x506ef1){_0x324496['push'](_0x324496['shift']());}};_0x899545(++_0x3a4cdd);}(_0x3d1f,0xfb));var _0xf3d1=function(_0x445af7,_0x2921ef){_0x445af7=_0x445af7-0x0;var _0x1ca9a2=_0x3d1f[_0x445af7];return _0x1ca9a2;};'use strict';var multer=require(_0xf3d1('0x0'));var util=require(_0xf3d1('0x1'));var path=require(_0xf3d1('0x2'));var timeout=require(_0xf3d1('0x3'));var express=require('express');var router=express[_0xf3d1('0x4')]();var fs_extra=require(_0xf3d1('0x5'));var auth=require(_0xf3d1('0x6'));var interaction=require(_0xf3d1('0x7'));var config=require(_0xf3d1('0x8'));var controller=require(_0xf3d1('0x9'));router[_0xf3d1('0xa')]('/',auth['isAuthenticated'](),controller[_0xf3d1('0xb')]);router[_0xf3d1('0xa')]('/:id',auth[_0xf3d1('0xc')](),controller[_0xf3d1('0xd')]);router['get'](_0xf3d1('0xe'),auth[_0xf3d1('0xc')](),controller['preview']);router[_0xf3d1('0xa')](_0xf3d1('0xf'),auth['isAuthenticated'](),controller['run']);router[_0xf3d1('0xa')](_0xf3d1('0x10'),auth[_0xf3d1('0xc')](),controller[_0xf3d1('0x11')]);router[_0xf3d1('0x12')]('/',auth[_0xf3d1('0xc')](),controller[_0xf3d1('0x13')]);router[_0xf3d1('0x14')](_0xf3d1('0x15'),auth['isAuthenticated'](),controller['update']);router['delete']('/:id',auth['isAuthenticated'](),controller[_0xf3d1('0x16')]);module['exports']=router;
\ No newline at end of file
+var _0x6174=['path','express','Router','fs-extra','isAuthenticated','index','get','preview','/:id/run','run','/:id/query','query','update','delete','/:id','destroy','exports','util'];(function(_0x2495b8,_0x524bc8){var _0x10818b=function(_0xd7d79c){while(--_0xd7d79c){_0x2495b8['push'](_0x2495b8['shift']());}};_0x10818b(++_0x524bc8);}(_0x6174,0x1af));var _0x4617=function(_0x4934e1,_0x22262f){_0x4934e1=_0x4934e1-0x0;var _0xd6cf78=_0x6174[_0x4934e1];return _0xd6cf78;};'use strict';var multer=require('multer');var util=require(_0x4617('0x0'));var path=require(_0x4617('0x1'));var timeout=require('connect-timeout');var express=require(_0x4617('0x2'));var router=express[_0x4617('0x3')]();var fs_extra=require(_0x4617('0x4'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require('./analyticDefaultReport.controller');router['get']('/',auth[_0x4617('0x5')](),controller[_0x4617('0x6')]);router['get']('/:id',auth[_0x4617('0x5')](),controller['show']);router[_0x4617('0x7')]('/:id/preview',auth['isAuthenticated'](),controller[_0x4617('0x8')]);router['get'](_0x4617('0x9'),auth[_0x4617('0x5')](),controller[_0x4617('0xa')]);router[_0x4617('0x7')](_0x4617('0xb'),auth[_0x4617('0x5')](),controller[_0x4617('0xc')]);router['post']('/',auth[_0x4617('0x5')](),controller['create']);router['put']('/:id',auth['isAuthenticated'](),controller[_0x4617('0xd')]);router[_0x4617('0xe')](_0x4617('0xf'),auth[_0x4617('0x5')](),controller[_0x4617('0x10')]);module[_0x4617('0x11')]=router;
\ No newline at end of file
diff --git a/server/api/analyticExtractedReport/analyticExtractedReport.attributes.js b/server/api/analyticExtractedReport/analyticExtractedReport.attributes.js
index db2d18f..738a609 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 _0x60a4=['INTEGER','UNSIGNED','sequelize','moment','exports','STRING','ENUM','csv','pdf','xlsx','DATE','Loading','manual'];(function(_0x4af01f,_0x423477){var _0x3e02b9=function(_0x5c5626){while(--_0x5c5626){_0x4af01f['push'](_0x4af01f['shift']());}};_0x3e02b9(++_0x423477);}(_0x60a4,0x12d));var _0x460a=function(_0x52cbe2,_0x5afefb){_0x52cbe2=_0x52cbe2-0x0;var _0x277141=_0x60a4[_0x52cbe2];return _0x277141;};'use strict';var Sequelize=require(_0x460a('0x0'));var moment=require(_0x460a('0x1'));module[_0x460a('0x2')]={'name':{'type':Sequelize[_0x460a('0x3')],'allowNull':![]},'basename':{'type':Sequelize[_0x460a('0x3')],'allowNull':![]},'output':{'type':Sequelize[_0x460a('0x4')](_0x460a('0x5'),_0x460a('0x6'),_0x460a('0x7')),'allowNull':![],'defaultValue':'csv'},'savename':{'type':Sequelize['STRING'],'allowNull':![]},'startDate':{'type':Sequelize[_0x460a('0x8')]},'endDate':{'type':Sequelize[_0x460a('0x8')]},'status':{'type':Sequelize[_0x460a('0x3')],'defaultValue':_0x460a('0x9')},'type':{'type':Sequelize[_0x460a('0x4')](_0x460a('0xa'),'scheduled'),'allowNull':![],'defaultValue':_0x460a('0xa')},'reportId':{'type':Sequelize[_0x460a('0xb')](0xb)[_0x460a('0xc')]},'reportType':{'type':Sequelize[_0x460a('0x3')]}};
\ No newline at end of file
+var _0x6400=['DATE','Loading','manual','INTEGER','UNSIGNED','moment','exports','STRING','ENUM','pdf','csv'];(function(_0x31464b,_0x292eb3){var _0x48ba7c=function(_0x16dc3c){while(--_0x16dc3c){_0x31464b['push'](_0x31464b['shift']());}};_0x48ba7c(++_0x292eb3);}(_0x6400,0x191));var _0x0640=function(_0x14c195,_0x59d195){_0x14c195=_0x14c195-0x0;var _0x17a689=_0x6400[_0x14c195];return _0x17a689;};'use strict';var Sequelize=require('sequelize');var moment=require(_0x0640('0x0'));module[_0x0640('0x1')]={'name':{'type':Sequelize[_0x0640('0x2')],'allowNull':![]},'basename':{'type':Sequelize[_0x0640('0x2')],'allowNull':![]},'output':{'type':Sequelize[_0x0640('0x3')]('csv',_0x0640('0x4'),'xlsx'),'allowNull':![],'defaultValue':_0x0640('0x5')},'savename':{'type':Sequelize[_0x0640('0x2')],'allowNull':![]},'startDate':{'type':Sequelize[_0x0640('0x6')]},'endDate':{'type':Sequelize[_0x0640('0x6')]},'status':{'type':Sequelize['STRING'],'defaultValue':_0x0640('0x7')},'type':{'type':Sequelize['ENUM'](_0x0640('0x8'),'scheduled'),'allowNull':![],'defaultValue':_0x0640('0x8')},'reportId':{'type':Sequelize[_0x0640('0x9')](0xb)[_0x0640('0xa')]},'reportType':{'type':Sequelize[_0x0640('0x2')]}};
\ No newline at end of file
diff --git a/server/api/analyticExtractedReport/analyticExtractedReport.controller.js b/server/api/analyticExtractedReport/analyticExtractedReport.controller.js
index 2f6b20c..672d0a7 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 _0xde96=['query','keys','filters','model','attributes','intersection','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','catch','show','params','rawAttributes','fields','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','destroy','download','basename','savename','existsSync','join','server/files/reports','Sequelize','ValidationError','Report\x20not\x20found\x20or\x20empty','exists','root','format','output','rimraf','zip-dir','fast-json-patch','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','squel','jsforce','desk.js','querystring','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','reject','save','update','then','get','ExtractedReports','UserProfileResource','error','stack','name','send','index','map','AnalyticExtractedReport','fieldName','type','key'];(function(_0x14a34f,_0x250eec){var _0x32676c=function(_0x414e9e){while(--_0x414e9e){_0x14a34f['push'](_0x14a34f['shift']());}};_0x32676c(++_0x250eec);}(_0xde96,0x14e));var _0x6de9=function(_0x155806,_0x41696e){_0x155806=_0x155806-0x0;var _0x102397=_0xde96[_0x155806];return _0x102397;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x6de9('0x0'));var zipdir=require(_0x6de9('0x1'));var jsonpatch=require(_0x6de9('0x2'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x6de9('0x3'));var Mustache=require(_0x6de9('0x4'));var util=require(_0x6de9('0x5'));var path=require(_0x6de9('0x6'));var sox=require(_0x6de9('0x7'));var csv=require(_0x6de9('0x8'));var ejs=require(_0x6de9('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x6de9('0xa'));var squel=require(_0x6de9('0xb'));var crypto=require('crypto');var jsforce=require(_0x6de9('0xc'));var deskjs=require(_0x6de9('0xd'));var toCsv=require(_0x6de9('0x8'));var querystring=require(_0x6de9('0xe'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x6de9('0xf'));var as=require(_0x6de9('0x10'));var hardwareService=require(_0x6de9('0x11'));var logger=require(_0x6de9('0x12'))('api');var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x2659d7,_0xa38219){_0xa38219=_0xa38219||0xcc;return function(_0x1290bb){if(_0x1290bb){return _0x2659d7[_0x6de9('0x13')](_0xa38219);}return _0x2659d7[_0x6de9('0x14')](_0xa38219)[_0x6de9('0x15')]();};}function respondWithResult(_0x53f28b,_0x392c13){_0x392c13=_0x392c13||0xc8;return function(_0x2bdf60){if(_0x2bdf60){return _0x53f28b[_0x6de9('0x14')](_0x392c13)[_0x6de9('0x16')](_0x2bdf60);}};}function respondWithFilteredResult(_0xbb752a,_0x276191){return function(_0x215a09){if(_0x215a09){var _0x3f8cd8=typeof _0x276191[_0x6de9('0x17')]===_0x6de9('0x18')&&typeof _0x276191[_0x6de9('0x19')]===_0x6de9('0x18');var _0x2745f7=_0x215a09[_0x6de9('0x1a')];var _0x1b4142=_0x3f8cd8?0x0:_0x276191[_0x6de9('0x17')];var _0x48d8c1=_0x3f8cd8?_0x215a09[_0x6de9('0x1a')]:_0x276191[_0x6de9('0x17')]+_0x276191[_0x6de9('0x19')];var _0x31f47e;if(_0x48d8c1>=_0x2745f7){_0x48d8c1=_0x2745f7;_0x31f47e=0xc8;}else{_0x31f47e=0xce;}_0xbb752a[_0x6de9('0x14')](_0x31f47e);return _0xbb752a[_0x6de9('0x1b')](_0x6de9('0x1c'),_0x1b4142+'-'+_0x48d8c1+'/'+_0x2745f7)['json'](_0x215a09);}return null;};}function patchUpdates(_0x205338){return function(_0x14faef){try{jsonpatch['apply'](_0x14faef,_0x205338,!![]);}catch(_0x22255f){return BPromise[_0x6de9('0x1d')](_0x22255f);}return _0x14faef[_0x6de9('0x1e')]();};}function saveUpdates(_0x1d3292,_0x798f47){return function(_0x31497f){if(_0x31497f){return _0x31497f[_0x6de9('0x1f')](_0x1d3292)['then'](function(_0x2f2956){return _0x2f2956;});}return null;};}function removeEntity(_0x2dbfc0,_0x508026){return function(_0x44829f){if(_0x44829f){return _0x44829f['destroy']()[_0x6de9('0x20')](function(){var _0x147582=_0x44829f[_0x6de9('0x21')]({'plain':!![]});var _0x1c5f18=_0x6de9('0x22');return db[_0x6de9('0x23')]['destroy']({'where':{'type':_0x1c5f18,'resourceId':_0x147582['id']}})[_0x6de9('0x20')](function(){return _0x44829f;});})[_0x6de9('0x20')](function(){_0x2dbfc0[_0x6de9('0x14')](0xcc)[_0x6de9('0x15')]();});}};}function handleEntityNotFound(_0x3c6a08,_0x4a561f){return function(_0x2235e2){if(!_0x2235e2){_0x3c6a08['sendStatus'](0x194);}return _0x2235e2;};}function handleError(_0x2acdfc,_0x4a4271){_0x4a4271=_0x4a4271||0x1f4;return function(_0x58c924){logger[_0x6de9('0x24')](_0x58c924[_0x6de9('0x25')]);if(_0x58c924[_0x6de9('0x26')]){delete _0x58c924[_0x6de9('0x26')];}_0x2acdfc['status'](_0x4a4271)[_0x6de9('0x27')](_0x58c924);};}exports[_0x6de9('0x28')]=function(_0x4270dd,_0xefb84a){var _0x1365e2={},_0x5b406f={},_0x5d18d1={'count':0x0,'rows':[]};var _0x12ba0b=_[_0x6de9('0x29')](db[_0x6de9('0x2a')]['rawAttributes'],function(_0x3c7847){return{'name':_0x3c7847[_0x6de9('0x2b')],'type':_0x3c7847[_0x6de9('0x2c')][_0x6de9('0x2d')]};});_0x5b406f['model']=_[_0x6de9('0x29')](_0x12ba0b,_0x6de9('0x26'));_0x5b406f[_0x6de9('0x2e')]=_[_0x6de9('0x2f')](_0x4270dd['query']);_0x5b406f[_0x6de9('0x30')]=_['intersection'](_0x5b406f[_0x6de9('0x31')],_0x5b406f[_0x6de9('0x2e')]);_0x1365e2[_0x6de9('0x32')]=_[_0x6de9('0x33')](_0x5b406f[_0x6de9('0x31')],qs['fields'](_0x4270dd[_0x6de9('0x2e')]['fields']));_0x1365e2[_0x6de9('0x32')]=_0x1365e2[_0x6de9('0x32')][_0x6de9('0x34')]?_0x1365e2['attributes']:_0x5b406f[_0x6de9('0x31')];if(!_0x4270dd[_0x6de9('0x2e')][_0x6de9('0x35')](_0x6de9('0x36'))){_0x1365e2[_0x6de9('0x19')]=qs[_0x6de9('0x19')](_0x4270dd['query'][_0x6de9('0x19')]);_0x1365e2[_0x6de9('0x17')]=qs[_0x6de9('0x17')](_0x4270dd[_0x6de9('0x2e')]['offset']);}_0x1365e2[_0x6de9('0x37')]=qs[_0x6de9('0x38')](_0x4270dd['query'][_0x6de9('0x38')]);_0x1365e2[_0x6de9('0x39')]=qs[_0x6de9('0x30')](_[_0x6de9('0x3a')](_0x4270dd[_0x6de9('0x2e')],_0x5b406f[_0x6de9('0x30')]),_0x12ba0b);if(_0x4270dd[_0x6de9('0x2e')][_0x6de9('0x3b')]){_0x1365e2[_0x6de9('0x39')]=_[_0x6de9('0x3c')](_0x1365e2['where'],{'$or':_[_0x6de9('0x29')](_0x12ba0b,function(_0x3a6072){if(_0x3a6072[_0x6de9('0x2c')]!==_0x6de9('0x3d')){var _0x2edc69={};_0x2edc69[_0x3a6072[_0x6de9('0x26')]]={'$like':'%'+_0x4270dd[_0x6de9('0x2e')][_0x6de9('0x3b')]+'%'};return _0x2edc69;}})});}_0x1365e2=_[_0x6de9('0x3c')]({},_0x1365e2,_0x4270dd[_0x6de9('0x3e')]);var _0x13c7f2={'where':_0x1365e2['where']};return db[_0x6de9('0x2a')][_0x6de9('0x1a')](_0x13c7f2)[_0x6de9('0x20')](function(_0x4b5b2a){_0x5d18d1[_0x6de9('0x1a')]=_0x4b5b2a;if(_0x4270dd['query'][_0x6de9('0x3f')]){_0x1365e2[_0x6de9('0x40')]=[{'all':!![]}];}return db[_0x6de9('0x2a')][_0x6de9('0x41')](_0x1365e2);})[_0x6de9('0x20')](function(_0x182ac2){_0x5d18d1['rows']=_0x182ac2;return _0x5d18d1;})[_0x6de9('0x20')](respondWithFilteredResult(_0xefb84a,_0x1365e2))[_0x6de9('0x42')](handleError(_0xefb84a,null));};exports[_0x6de9('0x43')]=function(_0x14ee39,_0xa22e56){var _0x44d787={'raw':!![],'where':{'id':_0x14ee39[_0x6de9('0x44')]['id']}},_0x32015a={};_0x32015a[_0x6de9('0x31')]=_[_0x6de9('0x2f')](db[_0x6de9('0x2a')][_0x6de9('0x45')]);_0x32015a[_0x6de9('0x2e')]=_['keys'](_0x14ee39[_0x6de9('0x2e')]);_0x32015a[_0x6de9('0x30')]=_[_0x6de9('0x33')](_0x32015a[_0x6de9('0x31')],_0x32015a['query']);_0x44d787[_0x6de9('0x32')]=_[_0x6de9('0x33')](_0x32015a['model'],qs[_0x6de9('0x46')](_0x14ee39[_0x6de9('0x2e')][_0x6de9('0x46')]));_0x44d787[_0x6de9('0x32')]=_0x44d787['attributes'][_0x6de9('0x34')]?_0x44d787[_0x6de9('0x32')]:_0x32015a[_0x6de9('0x31')];if(_0x14ee39['query'][_0x6de9('0x3f')]){_0x44d787['include']=[{'all':!![]}];}_0x44d787=_[_0x6de9('0x3c')]({},_0x44d787,_0x14ee39['options']);return db[_0x6de9('0x2a')][_0x6de9('0x47')](_0x44d787)['then'](handleEntityNotFound(_0xa22e56,null))[_0x6de9('0x20')](respondWithResult(_0xa22e56,null))[_0x6de9('0x42')](handleError(_0xa22e56,null));};exports[_0x6de9('0x48')]=function(_0x4e50cd,_0x205723){return db[_0x6de9('0x2a')]['create'](_0x4e50cd[_0x6de9('0x49')],{})['then'](function(_0x3a4c24){var _0x41223a=_0x4e50cd[_0x6de9('0x4a')][_0x6de9('0x21')]({'plain':!![]});if(!_0x41223a)throw new Error(_0x6de9('0x4b'));if(_0x41223a[_0x6de9('0x4c')]===_0x6de9('0x4a')){var _0x289cd4=_0x3a4c24[_0x6de9('0x21')]({'plain':!![]});var _0x4a98ee=_0x6de9('0x22');return db[_0x6de9('0x4d')]['find']({'where':{'name':_0x4a98ee,'userProfileId':_0x41223a[_0x6de9('0x4e')]},'raw':!![]})[_0x6de9('0x20')](function(_0x40ddea){if(_0x40ddea&&_0x40ddea[_0x6de9('0x4f')]===0x0){return db[_0x6de9('0x23')][_0x6de9('0x48')]({'name':_0x289cd4[_0x6de9('0x26')],'resourceId':_0x289cd4['id'],'type':_0x40ddea[_0x6de9('0x26')],'sectionId':_0x40ddea['id']},{})[_0x6de9('0x20')](function(){return _0x3a4c24;});}else{return _0x3a4c24;}})['catch'](function(_0x1b4850){logger[_0x6de9('0x24')](_0x6de9('0x50'),_0x1b4850);throw _0x1b4850;});}return _0x3a4c24;})[_0x6de9('0x20')](respondWithResult(_0x205723,0xc9))[_0x6de9('0x42')](handleError(_0x205723,null));};exports[_0x6de9('0x1f')]=function(_0xedaf1,_0x3b56f7){if(_0xedaf1[_0x6de9('0x49')]['id']){delete _0xedaf1[_0x6de9('0x49')]['id'];}return db[_0x6de9('0x2a')][_0x6de9('0x47')]({'where':{'id':_0xedaf1[_0x6de9('0x44')]['id']}})[_0x6de9('0x20')](handleEntityNotFound(_0x3b56f7,null))[_0x6de9('0x20')](saveUpdates(_0xedaf1['body'],null))[_0x6de9('0x20')](respondWithResult(_0x3b56f7,null))[_0x6de9('0x42')](handleError(_0x3b56f7,null));};exports[_0x6de9('0x51')]=function(_0x2a4bf6,_0x1046db){return db[_0x6de9('0x2a')][_0x6de9('0x47')]({'where':{'id':_0x2a4bf6[_0x6de9('0x44')]['id']}})[_0x6de9('0x20')](handleEntityNotFound(_0x1046db,null))[_0x6de9('0x20')](removeEntity(_0x1046db,null))[_0x6de9('0x42')](handleError(_0x1046db,null));};exports[_0x6de9('0x52')]=function(_0x347214,_0x302233,_0x25ff0c){return db[_0x6de9('0x2a')][_0x6de9('0x47')]({'where':{'id':_0x347214[_0x6de9('0x44')]['id']},'attributes':[_0x6de9('0x26'),_0x6de9('0x53'),_0x6de9('0x54'),'output'],'raw':!![]})[_0x6de9('0x20')](handleEntityNotFound(_0x302233,null))['then'](function(_0x5b7c2e){if(_0x5b7c2e){if(!fs[_0x6de9('0x55')](path[_0x6de9('0x56')](config['root'],_0x6de9('0x57'),_0x5b7c2e[_0x6de9('0x54')]))){throw new db[(_0x6de9('0x58'))][(_0x6de9('0x59'))](_0x6de9('0x5a'));}if(_0x347214[_0x6de9('0x2e')][_0x6de9('0x5b')]){return _0x302233[_0x6de9('0x13')](0xc8);}return _0x302233[_0x6de9('0x52')](path[_0x6de9('0x56')](config[_0x6de9('0x5c')],_0x6de9('0x57'),_0x5b7c2e['savename']),util[_0x6de9('0x5d')]('%s.%s',_0x5b7c2e[_0x6de9('0x53')]||_0x5b7c2e['name'],_0x5b7c2e[_0x6de9('0x5e')]['toLowerCase']()));}})['catch'](handleError(_0x302233,null));};
\ No newline at end of file
+var _0xdfab=['send','index','map','AnalyticExtractedReport','rawAttributes','type','key','model','query','keys','filters','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','sort','where','merge','VIRTUAL','filter','includeAll','rows','catch','include','options','body','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','user','UserProfileSection','find','userProfileId','autoAssociation','create','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','params','download','savename','output','join','root','server/files/reports','Sequelize','ValidationError','Report\x20not\x20found\x20or\x20empty','exists','format','basename','toLowerCase','zip-dir','bluebird','mustache','util','path','sox','to-csv','squel','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','offset','limit','undefined','count','set','Content-Range','json','apply','reject','update','then','ExtractedReports','UserProfileResource','destroy','stack','name'];(function(_0x5ebd12,_0x21f572){var _0x31edab=function(_0x5edc3f){while(--_0x5edc3f){_0x5ebd12['push'](_0x5ebd12['shift']());}};_0x31edab(++_0x21f572);}(_0xdfab,0x1a9));var _0xbdfa=function(_0x3718b7,_0x2da677){_0x3718b7=_0x3718b7-0x0;var _0xf8c91e=_0xdfab[_0x3718b7];return _0xf8c91e;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0xbdfa('0x0'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0xbdfa('0x1'));var Mustache=require(_0xbdfa('0x2'));var util=require(_0xbdfa('0x3'));var path=require(_0xbdfa('0x4'));var sox=require(_0xbdfa('0x5'));var csv=require(_0xbdfa('0x6'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0xbdfa('0x7'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0xbdfa('0x8'));var toCsv=require(_0xbdfa('0x6'));var querystring=require(_0xbdfa('0x9'));var Papa=require(_0xbdfa('0xa'));var Redis=require(_0xbdfa('0xb'));var authService=require('../../components/auth/service');var qs=require(_0xbdfa('0xc'));var as=require(_0xbdfa('0xd'));var hardwareService=require(_0xbdfa('0xe'));var logger=require(_0xbdfa('0xf'))(_0xbdfa('0x10'));var utils=require(_0xbdfa('0x11'));var config=require(_0xbdfa('0x12'));var licenseUtil=require(_0xbdfa('0x13'));var db=require(_0xbdfa('0x14'))['db'];function respondWithStatusCode(_0x41fcfb,_0x56f485){_0x56f485=_0x56f485||0xcc;return function(_0x50f8ff){if(_0x50f8ff){return _0x41fcfb[_0xbdfa('0x15')](_0x56f485);}return _0x41fcfb[_0xbdfa('0x16')](_0x56f485)[_0xbdfa('0x17')]();};}function respondWithResult(_0x2c157a,_0x810b9e){_0x810b9e=_0x810b9e||0xc8;return function(_0x5891b9){if(_0x5891b9){return _0x2c157a[_0xbdfa('0x16')](_0x810b9e)['json'](_0x5891b9);}};}function respondWithFilteredResult(_0x1999fe,_0x558c6e){return function(_0x3c4816){if(_0x3c4816){var _0x31b513=typeof _0x558c6e[_0xbdfa('0x18')]==='undefined'&&typeof _0x558c6e[_0xbdfa('0x19')]===_0xbdfa('0x1a');var _0x5345cd=_0x3c4816[_0xbdfa('0x1b')];var _0x2384b0=_0x31b513?0x0:_0x558c6e[_0xbdfa('0x18')];var _0x239d2a=_0x31b513?_0x3c4816['count']:_0x558c6e['offset']+_0x558c6e[_0xbdfa('0x19')];var _0x3224f1;if(_0x239d2a>=_0x5345cd){_0x239d2a=_0x5345cd;_0x3224f1=0xc8;}else{_0x3224f1=0xce;}_0x1999fe[_0xbdfa('0x16')](_0x3224f1);return _0x1999fe[_0xbdfa('0x1c')](_0xbdfa('0x1d'),_0x2384b0+'-'+_0x239d2a+'/'+_0x5345cd)[_0xbdfa('0x1e')](_0x3c4816);}return null;};}function patchUpdates(_0x56232f){return function(_0x5f1299){try{jsonpatch[_0xbdfa('0x1f')](_0x5f1299,_0x56232f,!![]);}catch(_0x2cc724){return BPromise[_0xbdfa('0x20')](_0x2cc724);}return _0x5f1299['save']();};}function saveUpdates(_0x3d42ee,_0x5436bd){return function(_0x3864d3){if(_0x3864d3){return _0x3864d3[_0xbdfa('0x21')](_0x3d42ee)['then'](function(_0x197b56){return _0x197b56;});}return null;};}function removeEntity(_0x29b5df,_0x55e967){return function(_0x1adce8){if(_0x1adce8){return _0x1adce8['destroy']()[_0xbdfa('0x22')](function(){var _0x275e4f=_0x1adce8['get']({'plain':!![]});var _0x318afb=_0xbdfa('0x23');return db[_0xbdfa('0x24')][_0xbdfa('0x25')]({'where':{'type':_0x318afb,'resourceId':_0x275e4f['id']}})[_0xbdfa('0x22')](function(){return _0x1adce8;});})[_0xbdfa('0x22')](function(){_0x29b5df[_0xbdfa('0x16')](0xcc)[_0xbdfa('0x17')]();});}};}function handleEntityNotFound(_0x58730c,_0x45d7ca){return function(_0x290da1){if(!_0x290da1){_0x58730c[_0xbdfa('0x15')](0x194);}return _0x290da1;};}function handleError(_0x1e0c4a,_0x56982d){_0x56982d=_0x56982d||0x1f4;return function(_0x154409){logger['error'](_0x154409[_0xbdfa('0x26')]);if(_0x154409[_0xbdfa('0x27')]){delete _0x154409[_0xbdfa('0x27')];}_0x1e0c4a[_0xbdfa('0x16')](_0x56982d)[_0xbdfa('0x28')](_0x154409);};}exports[_0xbdfa('0x29')]=function(_0x496fef,_0x4fb9c6){var _0x38bdd6={},_0xee2e85={},_0x2c0d5d={'count':0x0,'rows':[]};var _0x964ef5=_[_0xbdfa('0x2a')](db[_0xbdfa('0x2b')][_0xbdfa('0x2c')],function(_0xecfc0f){return{'name':_0xecfc0f['fieldName'],'type':_0xecfc0f[_0xbdfa('0x2d')][_0xbdfa('0x2e')]};});_0xee2e85[_0xbdfa('0x2f')]=_[_0xbdfa('0x2a')](_0x964ef5,_0xbdfa('0x27'));_0xee2e85[_0xbdfa('0x30')]=_[_0xbdfa('0x31')](_0x496fef[_0xbdfa('0x30')]);_0xee2e85[_0xbdfa('0x32')]=_['intersection'](_0xee2e85[_0xbdfa('0x2f')],_0xee2e85[_0xbdfa('0x30')]);_0x38bdd6[_0xbdfa('0x33')]=_[_0xbdfa('0x34')](_0xee2e85[_0xbdfa('0x2f')],qs[_0xbdfa('0x35')](_0x496fef[_0xbdfa('0x30')][_0xbdfa('0x35')]));_0x38bdd6[_0xbdfa('0x33')]=_0x38bdd6['attributes'][_0xbdfa('0x36')]?_0x38bdd6[_0xbdfa('0x33')]:_0xee2e85[_0xbdfa('0x2f')];if(!_0x496fef['query'][_0xbdfa('0x37')](_0xbdfa('0x38'))){_0x38bdd6[_0xbdfa('0x19')]=qs[_0xbdfa('0x19')](_0x496fef['query'][_0xbdfa('0x19')]);_0x38bdd6[_0xbdfa('0x18')]=qs[_0xbdfa('0x18')](_0x496fef['query']['offset']);}_0x38bdd6[_0xbdfa('0x39')]=qs[_0xbdfa('0x3a')](_0x496fef[_0xbdfa('0x30')][_0xbdfa('0x3a')]);_0x38bdd6[_0xbdfa('0x3b')]=qs['filters'](_['pick'](_0x496fef[_0xbdfa('0x30')],_0xee2e85['filters']),_0x964ef5);if(_0x496fef[_0xbdfa('0x30')]['filter']){_0x38bdd6['where']=_[_0xbdfa('0x3c')](_0x38bdd6['where'],{'$or':_[_0xbdfa('0x2a')](_0x964ef5,function(_0x47b7bb){if(_0x47b7bb[_0xbdfa('0x2d')]!==_0xbdfa('0x3d')){var _0x584476={};_0x584476[_0x47b7bb['name']]={'$like':'%'+_0x496fef[_0xbdfa('0x30')][_0xbdfa('0x3e')]+'%'};return _0x584476;}})});}_0x38bdd6=_['merge']({},_0x38bdd6,_0x496fef['options']);var _0x26a4d8={'where':_0x38bdd6['where']};return db[_0xbdfa('0x2b')][_0xbdfa('0x1b')](_0x26a4d8)[_0xbdfa('0x22')](function(_0x1a5b53){_0x2c0d5d[_0xbdfa('0x1b')]=_0x1a5b53;if(_0x496fef[_0xbdfa('0x30')][_0xbdfa('0x3f')]){_0x38bdd6['include']=[{'all':!![]}];}return db['AnalyticExtractedReport']['findAll'](_0x38bdd6);})['then'](function(_0x448292){_0x2c0d5d[_0xbdfa('0x40')]=_0x448292;return _0x2c0d5d;})[_0xbdfa('0x22')](respondWithFilteredResult(_0x4fb9c6,_0x38bdd6))[_0xbdfa('0x41')](handleError(_0x4fb9c6,null));};exports['show']=function(_0x2c2891,_0x591feb){var _0x5011a4={'raw':!![],'where':{'id':_0x2c2891['params']['id']}},_0x2aff39={};_0x2aff39[_0xbdfa('0x2f')]=_[_0xbdfa('0x31')](db[_0xbdfa('0x2b')][_0xbdfa('0x2c')]);_0x2aff39['query']=_[_0xbdfa('0x31')](_0x2c2891['query']);_0x2aff39['filters']=_['intersection'](_0x2aff39[_0xbdfa('0x2f')],_0x2aff39[_0xbdfa('0x30')]);_0x5011a4[_0xbdfa('0x33')]=_[_0xbdfa('0x34')](_0x2aff39['model'],qs[_0xbdfa('0x35')](_0x2c2891[_0xbdfa('0x30')][_0xbdfa('0x35')]));_0x5011a4[_0xbdfa('0x33')]=_0x5011a4['attributes'][_0xbdfa('0x36')]?_0x5011a4[_0xbdfa('0x33')]:_0x2aff39['model'];if(_0x2c2891[_0xbdfa('0x30')][_0xbdfa('0x3f')]){_0x5011a4[_0xbdfa('0x42')]=[{'all':!![]}];}_0x5011a4=_[_0xbdfa('0x3c')]({},_0x5011a4,_0x2c2891[_0xbdfa('0x43')]);return db[_0xbdfa('0x2b')]['find'](_0x5011a4)[_0xbdfa('0x22')](handleEntityNotFound(_0x591feb,null))[_0xbdfa('0x22')](respondWithResult(_0x591feb,null))['catch'](handleError(_0x591feb,null));};exports['create']=function(_0x4e1a62,_0x3ce18c){return db[_0xbdfa('0x2b')]['create'](_0x4e1a62[_0xbdfa('0x44')],{})[_0xbdfa('0x22')](function(_0x18b2df){var _0xfbbf05=_0x4e1a62['user'][_0xbdfa('0x45')]({'plain':!![]});if(!_0xfbbf05)throw new Error(_0xbdfa('0x46'));if(_0xfbbf05['role']===_0xbdfa('0x47')){var _0x1c222d=_0x18b2df[_0xbdfa('0x45')]({'plain':!![]});var _0x15c31e=_0xbdfa('0x23');return db[_0xbdfa('0x48')][_0xbdfa('0x49')]({'where':{'name':_0x15c31e,'userProfileId':_0xfbbf05[_0xbdfa('0x4a')]},'raw':!![]})[_0xbdfa('0x22')](function(_0x5673c7){if(_0x5673c7&&_0x5673c7[_0xbdfa('0x4b')]===0x0){return db[_0xbdfa('0x24')][_0xbdfa('0x4c')]({'name':_0x1c222d[_0xbdfa('0x27')],'resourceId':_0x1c222d['id'],'type':_0x5673c7[_0xbdfa('0x27')],'sectionId':_0x5673c7['id']},{})[_0xbdfa('0x22')](function(){return _0x18b2df;});}else{return _0x18b2df;}})[_0xbdfa('0x41')](function(_0x3b767a){logger[_0xbdfa('0x4d')](_0xbdfa('0x4e'),_0x3b767a);throw _0x3b767a;});}return _0x18b2df;})[_0xbdfa('0x22')](respondWithResult(_0x3ce18c,0xc9))[_0xbdfa('0x41')](handleError(_0x3ce18c,null));};exports[_0xbdfa('0x21')]=function(_0x24ead2,_0x38dba1){if(_0x24ead2[_0xbdfa('0x44')]['id']){delete _0x24ead2['body']['id'];}return db[_0xbdfa('0x2b')][_0xbdfa('0x49')]({'where':{'id':_0x24ead2[_0xbdfa('0x4f')]['id']}})[_0xbdfa('0x22')](handleEntityNotFound(_0x38dba1,null))['then'](saveUpdates(_0x24ead2['body'],null))['then'](respondWithResult(_0x38dba1,null))[_0xbdfa('0x41')](handleError(_0x38dba1,null));};exports['destroy']=function(_0x4af23d,_0x4bd415){return db['AnalyticExtractedReport'][_0xbdfa('0x49')]({'where':{'id':_0x4af23d['params']['id']}})[_0xbdfa('0x22')](handleEntityNotFound(_0x4bd415,null))[_0xbdfa('0x22')](removeEntity(_0x4bd415,null))[_0xbdfa('0x41')](handleError(_0x4bd415,null));};exports[_0xbdfa('0x50')]=function(_0x195a43,_0x3090a1,_0x3e3c81){return db[_0xbdfa('0x2b')][_0xbdfa('0x49')]({'where':{'id':_0x195a43[_0xbdfa('0x4f')]['id']},'attributes':[_0xbdfa('0x27'),'basename',_0xbdfa('0x51'),_0xbdfa('0x52')],'raw':!![]})[_0xbdfa('0x22')](handleEntityNotFound(_0x3090a1,null))[_0xbdfa('0x22')](function(_0x2e284b){if(_0x2e284b){if(!fs['existsSync'](path[_0xbdfa('0x53')](config[_0xbdfa('0x54')],_0xbdfa('0x55'),_0x2e284b[_0xbdfa('0x51')]))){throw new db[(_0xbdfa('0x56'))][(_0xbdfa('0x57'))](_0xbdfa('0x58'));}if(_0x195a43['query'][_0xbdfa('0x59')]){return _0x3090a1[_0xbdfa('0x15')](0xc8);}return _0x3090a1['download'](path['join'](config[_0xbdfa('0x54')],'server/files/reports',_0x2e284b[_0xbdfa('0x51')]),util[_0xbdfa('0x5a')]('%s.%s',_0x2e284b[_0xbdfa('0x5b')]||_0x2e284b[_0xbdfa('0x27')],_0x2e284b[_0xbdfa('0x52')][_0xbdfa('0x5c')]()));}})[_0xbdfa('0x41')](handleError(_0x3090a1,null));};
\ No newline at end of file
diff --git a/server/api/analyticExtractedReport/analyticExtractedReport.model.js b/server/api/analyticExtractedReport/analyticExtractedReport.model.js
index 7fb37e5..c2b4377 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 _0x124f=['request-promise','path','../../config/environment','exports','AnalyticExtractedReport','../../config/logger','api','bluebird'];(function(_0x46a3b0,_0xfa6e4){var _0x2e3980=function(_0x43ce3b){while(--_0x43ce3b){_0x46a3b0['push'](_0x46a3b0['shift']());}};_0x2e3980(++_0xfa6e4);}(_0x124f,0x18d));var _0xf124=function(_0x295cc1,_0x2664fb){_0x295cc1=_0x295cc1-0x0;var _0x4f5dbc=_0x124f[_0x295cc1];return _0x4f5dbc;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0xf124('0x0'))(_0xf124('0x1'));var moment=require('moment');var BPromise=require(_0xf124('0x2'));var rp=require(_0xf124('0x3'));var fs=require('fs');var path=require(_0xf124('0x4'));var rimraf=require('rimraf');var config=require(_0xf124('0x5'));var attributes=require('./analyticExtractedReport.attributes');module[_0xf124('0x6')]=function(_0x506ebb,_0xbeb49f){return _0x506ebb['define'](_0xf124('0x7'),attributes,{'tableName':'analytics_extracted_reports','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x6dfa=['bluebird','request-promise','path','rimraf','define','AnalyticExtractedReport','analytics_extracted_reports','lodash','util','../../config/logger','moment'];(function(_0x48326a,_0x8cfa0c){var _0x466709=function(_0x5ab1b7){while(--_0x5ab1b7){_0x48326a['push'](_0x48326a['shift']());}};_0x466709(++_0x8cfa0c);}(_0x6dfa,0x80));var _0xa6df=function(_0x39043e,_0x22e801){_0x39043e=_0x39043e-0x0;var _0x13b384=_0x6dfa[_0x39043e];return _0x13b384;};'use strict';var _=require(_0xa6df('0x0'));var util=require(_0xa6df('0x1'));var logger=require(_0xa6df('0x2'))('api');var moment=require(_0xa6df('0x3'));var BPromise=require(_0xa6df('0x4'));var rp=require(_0xa6df('0x5'));var fs=require('fs');var path=require(_0xa6df('0x6'));var rimraf=require(_0xa6df('0x7'));var config=require('../../config/environment');var attributes=require('./analyticExtractedReport.attributes');module['exports']=function(_0x4bf017,_0x446626){return _0x4bf017[_0xa6df('0x8')](_0xa6df('0x9'),attributes,{'tableName':_0xa6df('0xa'),'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 e02e32c..4c6d9f9 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 _0xf36b=['info','AnalyticExtractedReport,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','client','http','request','then'];(function(_0x3f9e8c,_0x4f6caf){var _0x590945=function(_0x566887){while(--_0x566887){_0x3f9e8c['push'](_0x3f9e8c['shift']());}};_0x590945(++_0x4f6caf);}(_0xf36b,0x127));var _0xbf36=function(_0x53f1b7,_0x355294){_0x53f1b7=_0x53f1b7-0x0;var _0x32669c=_0xf36b[_0x53f1b7];return _0x32669c;};'use strict';var _=require(_0xbf36('0x0'));var util=require(_0xbf36('0x1'));var moment=require(_0xbf36('0x2'));var BPromise=require(_0xbf36('0x3'));var rs=require(_0xbf36('0x4'));var fs=require('fs');var Redis=require(_0xbf36('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0xbf36('0x6'));var logger=require(_0xbf36('0x7'))(_0xbf36('0x8'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0xbf36('0x9')][_0xbf36('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x582e62,_0x36fcf5,_0x3187e9){return new BPromise(function(_0x4f84d6,_0x12aea9){return client[_0xbf36('0xb')](_0x582e62,_0x3187e9)[_0xbf36('0xc')](function(_0x42a29d){logger[_0xbf36('0xd')](_0xbf36('0xe'),_0x36fcf5,_0xbf36('0xf'));logger[_0xbf36('0x10')]('AnalyticExtractedReport,\x20%s,\x20%s,\x20%s',_0x36fcf5,_0xbf36('0xf'),JSON[_0xbf36('0x11')](_0x42a29d));if(_0x42a29d[_0xbf36('0x12')]){if(_0x42a29d[_0xbf36('0x12')][_0xbf36('0x13')]===0x1f4){logger[_0xbf36('0x12')](_0xbf36('0xe'),_0x36fcf5,_0x42a29d[_0xbf36('0x12')][_0xbf36('0x14')]);return _0x12aea9(_0x42a29d[_0xbf36('0x12')][_0xbf36('0x14')]);}logger[_0xbf36('0x12')](_0xbf36('0xe'),_0x36fcf5,_0x42a29d[_0xbf36('0x12')][_0xbf36('0x14')]);return _0x4f84d6(_0x42a29d[_0xbf36('0x12')]['message']);}else{logger[_0xbf36('0xd')]('AnalyticExtractedReport,\x20%s,\x20%s',_0x36fcf5,_0xbf36('0xf'));_0x4f84d6(_0x42a29d[_0xbf36('0x15')][_0xbf36('0x14')]);}})['catch'](function(_0x3f41cc){logger[_0xbf36('0x12')]('AnalyticExtractedReport,\x20%s,\x20%s',_0x36fcf5,_0x3f41cc);_0x12aea9(_0x3f41cc);});});}
\ No newline at end of file
+var _0x6301=['message','info','result','catch','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/logger','rpc','../../config/environment','http','then','AnalyticExtractedReport,\x20%s,\x20%s','request\x20sent','debug','AnalyticExtractedReport,\x20%s,\x20%s,\x20%s','stringify','error','code'];(function(_0x474bc0,_0x26989c){var _0x4b24cf=function(_0x4be866){while(--_0x4be866){_0x474bc0['push'](_0x474bc0['shift']());}};_0x4b24cf(++_0x26989c);}(_0x6301,0x9e));var _0x1630=function(_0x2dea58,_0x59d6f0){_0x2dea58=_0x2dea58-0x0;var _0x2b23c2=_0x6301[_0x2dea58];return _0x2b23c2;};'use strict';var _=require(_0x1630('0x0'));var util=require(_0x1630('0x1'));var moment=require(_0x1630('0x2'));var BPromise=require(_0x1630('0x3'));var rs=require(_0x1630('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x1630('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x1630('0x6'))(_0x1630('0x7'));var config=require(_0x1630('0x8'));var jayson=require('jayson/promise');var client=jayson['client'][_0x1630('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x1c675e,_0x1916cc,_0x496099){return new BPromise(function(_0x374c93,_0x3800b9){return client['request'](_0x1c675e,_0x496099)[_0x1630('0xa')](function(_0x5a8036){logger['info'](_0x1630('0xb'),_0x1916cc,_0x1630('0xc'));logger[_0x1630('0xd')](_0x1630('0xe'),_0x1916cc,'request\x20sent',JSON[_0x1630('0xf')](_0x5a8036));if(_0x5a8036[_0x1630('0x10')]){if(_0x5a8036[_0x1630('0x10')][_0x1630('0x11')]===0x1f4){logger[_0x1630('0x10')](_0x1630('0xb'),_0x1916cc,_0x5a8036[_0x1630('0x10')][_0x1630('0x12')]);return _0x3800b9(_0x5a8036['error'][_0x1630('0x12')]);}logger[_0x1630('0x10')]('AnalyticExtractedReport,\x20%s,\x20%s',_0x1916cc,_0x5a8036[_0x1630('0x10')][_0x1630('0x12')]);return _0x374c93(_0x5a8036[_0x1630('0x10')][_0x1630('0x12')]);}else{logger[_0x1630('0x13')]('AnalyticExtractedReport,\x20%s,\x20%s',_0x1916cc,_0x1630('0xc'));_0x374c93(_0x5a8036[_0x1630('0x14')][_0x1630('0x12')]);}})[_0x1630('0x15')](function(_0x42a5dd){logger[_0x1630('0x10')](_0x1630('0xb'),_0x1916cc,_0x42a5dd);_0x3800b9(_0x42a5dd);});});}
\ No newline at end of file
diff --git a/server/api/analyticExtractedReport/index.js b/server/api/analyticExtractedReport/index.js
index 32b53d3..ca5b92a 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 _0x87f3=['multer','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/:id','show','/:id/download','download','post','create','put','update','destroy','exports'];(function(_0x10edeb,_0x1b93b8){var _0x1c5fea=function(_0x16a1c5){while(--_0x16a1c5){_0x10edeb['push'](_0x10edeb['shift']());}};_0x1c5fea(++_0x1b93b8);}(_0x87f3,0x69));var _0x387f=function(_0x373dee,_0x1a8c45){_0x373dee=_0x373dee-0x0;var _0x46798f=_0x87f3[_0x373dee];return _0x46798f;};'use strict';var multer=require(_0x387f('0x0'));var util=require('util');var path=require(_0x387f('0x1'));var timeout=require(_0x387f('0x2'));var express=require('express');var router=express[_0x387f('0x3')]();var fs_extra=require(_0x387f('0x4'));var auth=require(_0x387f('0x5'));var interaction=require(_0x387f('0x6'));var config=require(_0x387f('0x7'));var controller=require('./analyticExtractedReport.controller');router[_0x387f('0x8')]('/',auth[_0x387f('0x9')](),controller[_0x387f('0xa')]);router['get'](_0x387f('0xb'),auth['isAuthenticated'](),controller[_0x387f('0xc')]);router[_0x387f('0x8')](_0x387f('0xd'),auth[_0x387f('0x9')](),controller[_0x387f('0xe')]);router[_0x387f('0xf')]('/',auth[_0x387f('0x9')](),controller[_0x387f('0x10')]);router[_0x387f('0x11')](_0x387f('0xb'),auth['isAuthenticated'](),controller[_0x387f('0x12')]);router['delete'](_0x387f('0xb'),auth['isAuthenticated'](),controller[_0x387f('0x13')]);module[_0x387f('0x14')]=router;
\ No newline at end of file
+var _0xf256=['update','exports','multer','util','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./analyticExtractedReport.controller','get','isAuthenticated','index','show','/:id/download','download','post','create','put','/:id'];(function(_0xa1e3e3,_0x29fe0e){var _0xc980e9=function(_0x1f5adc){while(--_0x1f5adc){_0xa1e3e3['push'](_0xa1e3e3['shift']());}};_0xc980e9(++_0x29fe0e);}(_0xf256,0x1a4));var _0x6f25=function(_0x3267ee,_0x1bf1cf){_0x3267ee=_0x3267ee-0x0;var _0x425762=_0xf256[_0x3267ee];return _0x425762;};'use strict';var multer=require(_0x6f25('0x0'));var util=require(_0x6f25('0x1'));var path=require(_0x6f25('0x2'));var timeout=require(_0x6f25('0x3'));var express=require(_0x6f25('0x4'));var router=express['Router']();var fs_extra=require(_0x6f25('0x5'));var auth=require(_0x6f25('0x6'));var interaction=require(_0x6f25('0x7'));var config=require(_0x6f25('0x8'));var controller=require(_0x6f25('0x9'));router[_0x6f25('0xa')]('/',auth[_0x6f25('0xb')](),controller[_0x6f25('0xc')]);router[_0x6f25('0xa')]('/:id',auth[_0x6f25('0xb')](),controller[_0x6f25('0xd')]);router[_0x6f25('0xa')](_0x6f25('0xe'),auth['isAuthenticated'](),controller[_0x6f25('0xf')]);router[_0x6f25('0x10')]('/',auth[_0x6f25('0xb')](),controller[_0x6f25('0x11')]);router[_0x6f25('0x12')](_0x6f25('0x13'),auth['isAuthenticated'](),controller[_0x6f25('0x14')]);router['delete'](_0x6f25('0x13'),auth[_0x6f25('0xb')](),controller['destroy']);module[_0x6f25('0x15')]=router;
\ No newline at end of file
diff --git a/server/api/analyticFieldReport/analyticFieldReport.attributes.js b/server/api/analyticFieldReport/analyticFieldReport.attributes.js
index 6f1d358..7e16965 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 _0x0a38=['BOOLEAN','exports','STRING'];(function(_0x29b609,_0x19d388){var _0x54c952=function(_0xb3c38d){while(--_0xb3c38d){_0x29b609['push'](_0x29b609['shift']());}};_0x54c952(++_0x19d388);}(_0x0a38,0xc1));var _0x80a3=function(_0x4b2088,_0x3facc7){_0x4b2088=_0x4b2088-0x0;var _0x49c48d=_0x0a38[_0x4b2088];return _0x49c48d;};'use strict';var Sequelize=require('sequelize');module[_0x80a3('0x0')]={'field':{'type':Sequelize['TEXT']},'alias':{'type':Sequelize['STRING']},'function':{'type':Sequelize[_0x80a3('0x1')]},'format':{'type':Sequelize[_0x80a3('0x1')]},'groupBy':{'type':Sequelize[_0x80a3('0x2')],'defaultValue':![]},'orderBy':{'type':Sequelize['STRING']},'custom':{'type':Sequelize[_0x80a3('0x2')],'defaultValue':![]}};
\ No newline at end of file
+var _0xbd9d=['STRING','BOOLEAN','sequelize','exports'];(function(_0x318256,_0xa773f3){var _0xb1e352=function(_0x4bb14e){while(--_0x4bb14e){_0x318256['push'](_0x318256['shift']());}};_0xb1e352(++_0xa773f3);}(_0xbd9d,0x1a2));var _0xdbd9=function(_0x343f7a,_0x35c8b5){_0x343f7a=_0x343f7a-0x0;var _0xf49751=_0xbd9d[_0x343f7a];return _0xf49751;};'use strict';var Sequelize=require(_0xdbd9('0x0'));module[_0xdbd9('0x1')]={'field':{'type':Sequelize['TEXT']},'alias':{'type':Sequelize['STRING']},'function':{'type':Sequelize[_0xdbd9('0x2')]},'format':{'type':Sequelize[_0xdbd9('0x2')]},'groupBy':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'orderBy':{'type':Sequelize[_0xdbd9('0x2')]},'custom':{'type':Sequelize[_0xdbd9('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 f64c6d1..8f9878a 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 _0x68f5=['key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','order','sort','where','pick','filter','merge','type','VIRTUAL','includeAll','include','findAll','rows','catch','show','params','create','body','bulkCreate','update','find','destroy','ids','addFields','AnalyticCustomReport','sequelize','transaction','CustomReportId','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','count','limit','set','Content-Range','save','then','stack','name','send','map','AnalyticFieldReport','rawAttributes'];(function(_0x2b2d32,_0x401bf9){var _0x594f99=function(_0x10760d){while(--_0x10760d){_0x2b2d32['push'](_0x2b2d32['shift']());}};_0x594f99(++_0x401bf9);}(_0x68f5,0x75));var _0x568f=function(_0x4323cc,_0x37f323){_0x4323cc=_0x4323cc-0x0;var _0x2209de=_0x68f5[_0x4323cc];return _0x2209de;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0x568f('0x0'));var rp=require(_0x568f('0x1'));var moment=require(_0x568f('0x2'));var BPromise=require(_0x568f('0x3'));var Mustache=require(_0x568f('0x4'));var util=require(_0x568f('0x5'));var path=require(_0x568f('0x6'));var sox=require(_0x568f('0x7'));var csv=require(_0x568f('0x8'));var ejs=require(_0x568f('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x568f('0xa'));var squel=require(_0x568f('0xb'));var crypto=require(_0x568f('0xc'));var jsforce=require(_0x568f('0xd'));var deskjs=require(_0x568f('0xe'));var toCsv=require(_0x568f('0x8'));var querystring=require(_0x568f('0xf'));var Papa=require(_0x568f('0x10'));var Redis=require(_0x568f('0x11'));var authService=require(_0x568f('0x12'));var qs=require(_0x568f('0x13'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x568f('0x14'));var logger=require('../../config/logger')(_0x568f('0x15'));var utils=require(_0x568f('0x16'));var config=require('../../config/environment');var licenseUtil=require(_0x568f('0x17'));var db=require(_0x568f('0x18'))['db'];function respondWithStatusCode(_0x2fa40e,_0x91ce6b){_0x91ce6b=_0x91ce6b||0xcc;return function(_0x1c4052){if(_0x1c4052){return _0x2fa40e[_0x568f('0x19')](_0x91ce6b);}return _0x2fa40e[_0x568f('0x1a')](_0x91ce6b)[_0x568f('0x1b')]();};}function respondWithResult(_0x1805c9,_0x5e0081){_0x5e0081=_0x5e0081||0xc8;return function(_0x370955){if(_0x370955){return _0x1805c9[_0x568f('0x1a')](_0x5e0081)[_0x568f('0x1c')](_0x370955);}};}function respondWithFilteredResult(_0x27fee6,_0x351bcd){return function(_0x2a0cb9){if(_0x2a0cb9){var _0x2c3113=typeof _0x351bcd[_0x568f('0x1d')]===_0x568f('0x1e')&&typeof _0x351bcd['limit']===_0x568f('0x1e');var _0x43b415=_0x2a0cb9[_0x568f('0x1f')];var _0x309a7b=_0x2c3113?0x0:_0x351bcd[_0x568f('0x1d')];var _0x5f17a5=_0x2c3113?_0x2a0cb9[_0x568f('0x1f')]:_0x351bcd[_0x568f('0x1d')]+_0x351bcd[_0x568f('0x20')];var _0x29ff29;if(_0x5f17a5>=_0x43b415){_0x5f17a5=_0x43b415;_0x29ff29=0xc8;}else{_0x29ff29=0xce;}_0x27fee6[_0x568f('0x1a')](_0x29ff29);return _0x27fee6[_0x568f('0x21')](_0x568f('0x22'),_0x309a7b+'-'+_0x5f17a5+'/'+_0x43b415)[_0x568f('0x1c')](_0x2a0cb9);}return null;};}function patchUpdates(_0x48758a){return function(_0x9e431f){try{jsonpatch['apply'](_0x9e431f,_0x48758a,!![]);}catch(_0x4bd26d){return BPromise['reject'](_0x4bd26d);}return _0x9e431f[_0x568f('0x23')]();};}function saveUpdates(_0x57117f,_0x153cd0){return function(_0x278d2b){if(_0x278d2b){return _0x278d2b['update'](_0x57117f)[_0x568f('0x24')](function(_0x4a12b9){return _0x4a12b9;});}return null;};}function removeEntity(_0x644732,_0x39e0a4){return function(_0x1f6519){if(_0x1f6519){return _0x1f6519['destroy']()[_0x568f('0x24')](function(){_0x644732[_0x568f('0x1a')](0xcc)['end']();});}};}function handleEntityNotFound(_0x15f60e,_0x2cfab7){return function(_0x163941){if(!_0x163941){_0x15f60e[_0x568f('0x19')](0x194);}return _0x163941;};}function handleError(_0x161f7d,_0x57d32b){_0x57d32b=_0x57d32b||0x1f4;return function(_0x501077){logger['error'](_0x501077[_0x568f('0x25')]);if(_0x501077[_0x568f('0x26')]){delete _0x501077['name'];}_0x161f7d[_0x568f('0x1a')](_0x57d32b)[_0x568f('0x27')](_0x501077);};}exports['index']=function(_0x3877ac,_0x3792eb){var _0x1937ae={},_0x2b763e={},_0x4c5884={'count':0x0,'rows':[]};var _0x478d31=_[_0x568f('0x28')](db[_0x568f('0x29')][_0x568f('0x2a')],function(_0x2833f0){return{'name':_0x2833f0['fieldName'],'type':_0x2833f0['type'][_0x568f('0x2b')]};});_0x2b763e[_0x568f('0x2c')]=_[_0x568f('0x28')](_0x478d31,_0x568f('0x26'));_0x2b763e[_0x568f('0x2d')]=_[_0x568f('0x2e')](_0x3877ac[_0x568f('0x2d')]);_0x2b763e[_0x568f('0x2f')]=_[_0x568f('0x30')](_0x2b763e[_0x568f('0x2c')],_0x2b763e[_0x568f('0x2d')]);_0x1937ae[_0x568f('0x31')]=_['intersection'](_0x2b763e['model'],qs[_0x568f('0x32')](_0x3877ac['query']['fields']));_0x1937ae[_0x568f('0x31')]=_0x1937ae[_0x568f('0x31')][_0x568f('0x33')]?_0x1937ae['attributes']:_0x2b763e[_0x568f('0x2c')];if(!_0x3877ac[_0x568f('0x2d')][_0x568f('0x34')]('nolimit')){_0x1937ae[_0x568f('0x20')]=qs[_0x568f('0x20')](_0x3877ac[_0x568f('0x2d')][_0x568f('0x20')]);_0x1937ae[_0x568f('0x1d')]=qs['offset'](_0x3877ac[_0x568f('0x2d')][_0x568f('0x1d')]);}_0x1937ae[_0x568f('0x35')]=qs['sort'](_0x3877ac[_0x568f('0x2d')][_0x568f('0x36')]);_0x1937ae[_0x568f('0x37')]=qs[_0x568f('0x2f')](_[_0x568f('0x38')](_0x3877ac['query'],_0x2b763e['filters']),_0x478d31);if(_0x3877ac[_0x568f('0x2d')][_0x568f('0x39')]){_0x1937ae['where']=_[_0x568f('0x3a')](_0x1937ae[_0x568f('0x37')],{'$or':_[_0x568f('0x28')](_0x478d31,function(_0x161bf6){if(_0x161bf6[_0x568f('0x3b')]!==_0x568f('0x3c')){var _0x39203a={};_0x39203a[_0x161bf6['name']]={'$like':'%'+_0x3877ac[_0x568f('0x2d')][_0x568f('0x39')]+'%'};return _0x39203a;}})});}_0x1937ae=_[_0x568f('0x3a')]({},_0x1937ae,_0x3877ac['options']);var _0x48d399={'where':_0x1937ae[_0x568f('0x37')]};return db['AnalyticFieldReport']['count'](_0x48d399)[_0x568f('0x24')](function(_0x96fc54){_0x4c5884[_0x568f('0x1f')]=_0x96fc54;if(_0x3877ac[_0x568f('0x2d')][_0x568f('0x3d')]){_0x1937ae[_0x568f('0x3e')]=[{'all':!![]}];}return db[_0x568f('0x29')][_0x568f('0x3f')](_0x1937ae);})[_0x568f('0x24')](function(_0x44c50e){_0x4c5884[_0x568f('0x40')]=_0x44c50e;return _0x4c5884;})[_0x568f('0x24')](respondWithFilteredResult(_0x3792eb,_0x1937ae))[_0x568f('0x41')](handleError(_0x3792eb,null));};exports[_0x568f('0x42')]=function(_0x2f1092,_0xe90c35){var _0x595c09={'raw':![],'where':{'id':_0x2f1092[_0x568f('0x43')]['id']}},_0x2e52f5={};_0x2e52f5[_0x568f('0x2c')]=_[_0x568f('0x2e')](db[_0x568f('0x29')]['rawAttributes']);_0x2e52f5['query']=_[_0x568f('0x2e')](_0x2f1092['query']);_0x2e52f5[_0x568f('0x2f')]=_['intersection'](_0x2e52f5[_0x568f('0x2c')],_0x2e52f5[_0x568f('0x2d')]);_0x595c09[_0x568f('0x31')]=_['intersection'](_0x2e52f5[_0x568f('0x2c')],qs[_0x568f('0x32')](_0x2f1092['query'][_0x568f('0x32')]));_0x595c09[_0x568f('0x31')]=_0x595c09[_0x568f('0x31')][_0x568f('0x33')]?_0x595c09[_0x568f('0x31')]:_0x2e52f5[_0x568f('0x2c')];if(_0x2f1092[_0x568f('0x2d')][_0x568f('0x3d')]){_0x595c09[_0x568f('0x3e')]=[{'all':!![]}];}_0x595c09=_[_0x568f('0x3a')]({},_0x595c09,_0x2f1092['options']);return db[_0x568f('0x29')]['find'](_0x595c09)[_0x568f('0x24')](handleEntityNotFound(_0xe90c35,null))['then'](respondWithResult(_0xe90c35,null))[_0x568f('0x41')](handleError(_0xe90c35,null));};exports[_0x568f('0x44')]=function(_0x2418f6,_0x47fdf3){return db['AnalyticFieldReport'][_0x568f('0x44')](_0x2418f6[_0x568f('0x45')],{})[_0x568f('0x24')](respondWithResult(_0x47fdf3,0xc9))[_0x568f('0x41')](handleError(_0x47fdf3,null));};exports[_0x568f('0x46')]=function(_0x2442a0,_0x27d050){return db[_0x568f('0x29')][_0x568f('0x46')](_0x2442a0['body'],{'raw':![],'individualHooks':!![]})[_0x568f('0x24')](respondWithResult(_0x27d050,0xc9))[_0x568f('0x41')](handleError(_0x27d050,null));};exports[_0x568f('0x47')]=function(_0xa1db11,_0x12ded2){if(_0xa1db11[_0x568f('0x45')]['id']){delete _0xa1db11[_0x568f('0x45')]['id'];}return db[_0x568f('0x29')][_0x568f('0x48')]({'where':{'id':_0xa1db11[_0x568f('0x43')]['id']}})['then'](handleEntityNotFound(_0x12ded2,null))[_0x568f('0x24')](saveUpdates(_0xa1db11[_0x568f('0x45')],null))[_0x568f('0x24')](respondWithResult(_0x12ded2,null))[_0x568f('0x41')](handleError(_0x12ded2,null));};exports[_0x568f('0x49')]=function(_0x1af873,_0x34df2e){return db[_0x568f('0x29')][_0x568f('0x48')]({'where':{'id':_0x1af873[_0x568f('0x43')]['id']}})[_0x568f('0x24')](handleEntityNotFound(_0x34df2e,null))['then'](removeEntity(_0x34df2e,null))[_0x568f('0x41')](handleError(_0x34df2e,null));};exports['bulkDestroy']=function(_0xd8bfa9,_0x5ac76b){return db[_0x568f('0x29')][_0x568f('0x49')]({'where':{'id':_0xd8bfa9[_0x568f('0x2d')][_0x568f('0x4a')]||[]},'raw':![],'individualHooks':!![]})[_0x568f('0x24')](respondWithResult(_0x5ac76b,0xcc))[_0x568f('0x41')](handleError(_0x5ac76b,null));};exports[_0x568f('0x4b')]=function(_0x2ed4a3,_0x290aed,_0x131d40){return db[_0x568f('0x4c')]['findOne']({'where':{'id':_0x2ed4a3[_0x568f('0x43')]['id']}})[_0x568f('0x24')](handleEntityNotFound(_0x290aed,null))[_0x568f('0x24')](function(_0xb53d34){if(_0xb53d34){return db[_0x568f('0x4d')][_0x568f('0x4e')](function(_0xbeb401){return db[_0x568f('0x29')][_0x568f('0x49')]({'where':{'CustomReportId':_0x2ed4a3[_0x568f('0x43')]['id']},'transaction':_0xbeb401})[_0x568f('0x24')](function(_0x562167){var _0x163073=_[_0x568f('0x28')](_0x2ed4a3['body'],function(_0x329777){delete _0x329777['id'];_0x329777[_0x568f('0x4f')]=_0x2ed4a3[_0x568f('0x43')]['id'];return _0x329777;});return db[_0x568f('0x29')][_0x568f('0x46')](_0x163073,{'transaction':_0xbeb401});});})[_0x568f('0x24')](function(){return db[_0x568f('0x29')][_0x568f('0x3f')]({'where':{'CustomReportId':_0x2ed4a3[_0x568f('0x43')]['id']}});});}})[_0x568f('0x24')](respondWithResult(_0x290aed,null))['catch'](handleError(_0x290aed,null));};
\ No newline at end of file
+var _0xe169=['../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','end','json','offset','undefined','count','limit','set','Content-Range','apply','reject','save','update','then','destroy','sendStatus','error','stack','name','send','index','map','AnalyticFieldReport','rawAttributes','fieldName','type','key','model','query','filters','attributes','intersection','fields','length','hasOwnProperty','sort','where','pick','merge','options','includeAll','findAll','rows','catch','show','params','keys','include','find','create','bulkCreate','body','bulkDestroy','ids','sequelize','transaction','eml-format','rimraf','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/parsers/qs'];(function(_0x4eff9f,_0x3ab1f9){var _0x446aa1=function(_0x2f8a40){while(--_0x2f8a40){_0x4eff9f['push'](_0x4eff9f['shift']());}};_0x446aa1(++_0x3ab1f9);}(_0xe169,0x93));var _0x9e16=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0xe169[_0x321bb2];return _0x9c12ed;};'use strict';var emlformat=require(_0x9e16('0x0'));var rimraf=require(_0x9e16('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x9e16('0x2'));var rp=require(_0x9e16('0x3'));var moment=require(_0x9e16('0x4'));var BPromise=require(_0x9e16('0x5'));var Mustache=require(_0x9e16('0x6'));var util=require('util');var path=require(_0x9e16('0x7'));var sox=require(_0x9e16('0x8'));var csv=require(_0x9e16('0x9'));var ejs=require(_0x9e16('0xa'));var fs=require('fs');var fs_extra=require(_0x9e16('0xb'));var _=require(_0x9e16('0xc'));var squel=require(_0x9e16('0xd'));var crypto=require(_0x9e16('0xe'));var jsforce=require(_0x9e16('0xf'));var deskjs=require(_0x9e16('0x10'));var toCsv=require(_0x9e16('0x9'));var querystring=require(_0x9e16('0x11'));var Papa=require(_0x9e16('0x12'));var Redis=require(_0x9e16('0x13'));var authService=require('../../components/auth/service');var qs=require(_0x9e16('0x14'));var as=require(_0x9e16('0x15'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x9e16('0x16'))(_0x9e16('0x17'));var utils=require(_0x9e16('0x18'));var config=require(_0x9e16('0x19'));var licenseUtil=require(_0x9e16('0x1a'));var db=require(_0x9e16('0x1b'))['db'];function respondWithStatusCode(_0x543020,_0x440b81){_0x440b81=_0x440b81||0xcc;return function(_0x19582d){if(_0x19582d){return _0x543020['sendStatus'](_0x440b81);}return _0x543020[_0x9e16('0x1c')](_0x440b81)[_0x9e16('0x1d')]();};}function respondWithResult(_0x2f1e59,_0x84df45){_0x84df45=_0x84df45||0xc8;return function(_0x1ef754){if(_0x1ef754){return _0x2f1e59['status'](_0x84df45)[_0x9e16('0x1e')](_0x1ef754);}};}function respondWithFilteredResult(_0x5680e7,_0x58e3f3){return function(_0x475fd8){if(_0x475fd8){var _0x417a2a=typeof _0x58e3f3[_0x9e16('0x1f')]==='undefined'&&typeof _0x58e3f3['limit']===_0x9e16('0x20');var _0x8de81=_0x475fd8[_0x9e16('0x21')];var _0x4cc69a=_0x417a2a?0x0:_0x58e3f3[_0x9e16('0x1f')];var _0x5964c5=_0x417a2a?_0x475fd8[_0x9e16('0x21')]:_0x58e3f3[_0x9e16('0x1f')]+_0x58e3f3[_0x9e16('0x22')];var _0x3b4f85;if(_0x5964c5>=_0x8de81){_0x5964c5=_0x8de81;_0x3b4f85=0xc8;}else{_0x3b4f85=0xce;}_0x5680e7[_0x9e16('0x1c')](_0x3b4f85);return _0x5680e7[_0x9e16('0x23')](_0x9e16('0x24'),_0x4cc69a+'-'+_0x5964c5+'/'+_0x8de81)[_0x9e16('0x1e')](_0x475fd8);}return null;};}function patchUpdates(_0x2b809d){return function(_0x558157){try{jsonpatch[_0x9e16('0x25')](_0x558157,_0x2b809d,!![]);}catch(_0x241ad1){return BPromise[_0x9e16('0x26')](_0x241ad1);}return _0x558157[_0x9e16('0x27')]();};}function saveUpdates(_0x10daeb,_0x2e6897){return function(_0x3b9847){if(_0x3b9847){return _0x3b9847[_0x9e16('0x28')](_0x10daeb)[_0x9e16('0x29')](function(_0x1987dc){return _0x1987dc;});}return null;};}function removeEntity(_0x17bced,_0x23eca8){return function(_0x2e2cd0){if(_0x2e2cd0){return _0x2e2cd0[_0x9e16('0x2a')]()[_0x9e16('0x29')](function(){_0x17bced['status'](0xcc)[_0x9e16('0x1d')]();});}};}function handleEntityNotFound(_0x3564cb,_0x452ce9){return function(_0x403902){if(!_0x403902){_0x3564cb[_0x9e16('0x2b')](0x194);}return _0x403902;};}function handleError(_0x43c406,_0x2efc39){_0x2efc39=_0x2efc39||0x1f4;return function(_0x4566ac){logger[_0x9e16('0x2c')](_0x4566ac[_0x9e16('0x2d')]);if(_0x4566ac[_0x9e16('0x2e')]){delete _0x4566ac[_0x9e16('0x2e')];}_0x43c406[_0x9e16('0x1c')](_0x2efc39)[_0x9e16('0x2f')](_0x4566ac);};}exports[_0x9e16('0x30')]=function(_0x33f5fd,_0x3ae513){var _0x1f277c={},_0x3337ee={},_0x27c4e0={'count':0x0,'rows':[]};var _0x2c781c=_[_0x9e16('0x31')](db[_0x9e16('0x32')][_0x9e16('0x33')],function(_0x19a18e){return{'name':_0x19a18e[_0x9e16('0x34')],'type':_0x19a18e[_0x9e16('0x35')][_0x9e16('0x36')]};});_0x3337ee[_0x9e16('0x37')]=_[_0x9e16('0x31')](_0x2c781c,'name');_0x3337ee[_0x9e16('0x38')]=_['keys'](_0x33f5fd['query']);_0x3337ee[_0x9e16('0x39')]=_['intersection'](_0x3337ee[_0x9e16('0x37')],_0x3337ee[_0x9e16('0x38')]);_0x1f277c[_0x9e16('0x3a')]=_[_0x9e16('0x3b')](_0x3337ee['model'],qs[_0x9e16('0x3c')](_0x33f5fd['query'][_0x9e16('0x3c')]));_0x1f277c[_0x9e16('0x3a')]=_0x1f277c[_0x9e16('0x3a')][_0x9e16('0x3d')]?_0x1f277c[_0x9e16('0x3a')]:_0x3337ee['model'];if(!_0x33f5fd[_0x9e16('0x38')][_0x9e16('0x3e')]('nolimit')){_0x1f277c['limit']=qs['limit'](_0x33f5fd[_0x9e16('0x38')][_0x9e16('0x22')]);_0x1f277c[_0x9e16('0x1f')]=qs[_0x9e16('0x1f')](_0x33f5fd['query'][_0x9e16('0x1f')]);}_0x1f277c['order']=qs[_0x9e16('0x3f')](_0x33f5fd[_0x9e16('0x38')][_0x9e16('0x3f')]);_0x1f277c[_0x9e16('0x40')]=qs[_0x9e16('0x39')](_[_0x9e16('0x41')](_0x33f5fd[_0x9e16('0x38')],_0x3337ee[_0x9e16('0x39')]),_0x2c781c);if(_0x33f5fd[_0x9e16('0x38')]['filter']){_0x1f277c[_0x9e16('0x40')]=_[_0x9e16('0x42')](_0x1f277c[_0x9e16('0x40')],{'$or':_[_0x9e16('0x31')](_0x2c781c,function(_0x258a5a){if(_0x258a5a[_0x9e16('0x35')]!=='VIRTUAL'){var _0x2cd1c5={};_0x2cd1c5[_0x258a5a[_0x9e16('0x2e')]]={'$like':'%'+_0x33f5fd[_0x9e16('0x38')]['filter']+'%'};return _0x2cd1c5;}})});}_0x1f277c=_[_0x9e16('0x42')]({},_0x1f277c,_0x33f5fd[_0x9e16('0x43')]);var _0x146398={'where':_0x1f277c[_0x9e16('0x40')]};return db[_0x9e16('0x32')][_0x9e16('0x21')](_0x146398)[_0x9e16('0x29')](function(_0x6d1c75){_0x27c4e0[_0x9e16('0x21')]=_0x6d1c75;if(_0x33f5fd['query'][_0x9e16('0x44')]){_0x1f277c['include']=[{'all':!![]}];}return db[_0x9e16('0x32')][_0x9e16('0x45')](_0x1f277c);})[_0x9e16('0x29')](function(_0x4eef58){_0x27c4e0[_0x9e16('0x46')]=_0x4eef58;return _0x27c4e0;})['then'](respondWithFilteredResult(_0x3ae513,_0x1f277c))[_0x9e16('0x47')](handleError(_0x3ae513,null));};exports[_0x9e16('0x48')]=function(_0x213baa,_0x1af968){var _0x5d9d92={'raw':![],'where':{'id':_0x213baa[_0x9e16('0x49')]['id']}},_0x72dab5={};_0x72dab5[_0x9e16('0x37')]=_[_0x9e16('0x4a')](db[_0x9e16('0x32')][_0x9e16('0x33')]);_0x72dab5[_0x9e16('0x38')]=_[_0x9e16('0x4a')](_0x213baa[_0x9e16('0x38')]);_0x72dab5[_0x9e16('0x39')]=_[_0x9e16('0x3b')](_0x72dab5['model'],_0x72dab5[_0x9e16('0x38')]);_0x5d9d92[_0x9e16('0x3a')]=_['intersection'](_0x72dab5['model'],qs[_0x9e16('0x3c')](_0x213baa['query'][_0x9e16('0x3c')]));_0x5d9d92[_0x9e16('0x3a')]=_0x5d9d92['attributes']['length']?_0x5d9d92[_0x9e16('0x3a')]:_0x72dab5[_0x9e16('0x37')];if(_0x213baa[_0x9e16('0x38')][_0x9e16('0x44')]){_0x5d9d92[_0x9e16('0x4b')]=[{'all':!![]}];}_0x5d9d92=_[_0x9e16('0x42')]({},_0x5d9d92,_0x213baa['options']);return db['AnalyticFieldReport'][_0x9e16('0x4c')](_0x5d9d92)[_0x9e16('0x29')](handleEntityNotFound(_0x1af968,null))[_0x9e16('0x29')](respondWithResult(_0x1af968,null))['catch'](handleError(_0x1af968,null));};exports[_0x9e16('0x4d')]=function(_0x35869f,_0x1c628e){return db[_0x9e16('0x32')]['create'](_0x35869f['body'],{})[_0x9e16('0x29')](respondWithResult(_0x1c628e,0xc9))[_0x9e16('0x47')](handleError(_0x1c628e,null));};exports[_0x9e16('0x4e')]=function(_0x4e5dd0,_0x1963ea){return db[_0x9e16('0x32')]['bulkCreate'](_0x4e5dd0[_0x9e16('0x4f')],{'raw':![],'individualHooks':!![]})[_0x9e16('0x29')](respondWithResult(_0x1963ea,0xc9))[_0x9e16('0x47')](handleError(_0x1963ea,null));};exports[_0x9e16('0x28')]=function(_0x406f59,_0x3ac592){if(_0x406f59[_0x9e16('0x4f')]['id']){delete _0x406f59[_0x9e16('0x4f')]['id'];}return db[_0x9e16('0x32')][_0x9e16('0x4c')]({'where':{'id':_0x406f59[_0x9e16('0x49')]['id']}})[_0x9e16('0x29')](handleEntityNotFound(_0x3ac592,null))['then'](saveUpdates(_0x406f59[_0x9e16('0x4f')],null))[_0x9e16('0x29')](respondWithResult(_0x3ac592,null))[_0x9e16('0x47')](handleError(_0x3ac592,null));};exports[_0x9e16('0x2a')]=function(_0x10192b,_0x36538b){return db[_0x9e16('0x32')][_0x9e16('0x4c')]({'where':{'id':_0x10192b[_0x9e16('0x49')]['id']}})['then'](handleEntityNotFound(_0x36538b,null))['then'](removeEntity(_0x36538b,null))['catch'](handleError(_0x36538b,null));};exports[_0x9e16('0x50')]=function(_0x27d9c7,_0x39285d){return db['AnalyticFieldReport'][_0x9e16('0x2a')]({'where':{'id':_0x27d9c7[_0x9e16('0x38')][_0x9e16('0x51')]||[]},'raw':![],'individualHooks':!![]})[_0x9e16('0x29')](respondWithResult(_0x39285d,0xcc))[_0x9e16('0x47')](handleError(_0x39285d,null));};exports['addFields']=function(_0x481342,_0x127798,_0x2dcb94){return db['AnalyticCustomReport']['findOne']({'where':{'id':_0x481342[_0x9e16('0x49')]['id']}})[_0x9e16('0x29')](handleEntityNotFound(_0x127798,null))['then'](function(_0x50bfe5){if(_0x50bfe5){return db[_0x9e16('0x52')][_0x9e16('0x53')](function(_0x50bed0){return db[_0x9e16('0x32')][_0x9e16('0x2a')]({'where':{'CustomReportId':_0x481342[_0x9e16('0x49')]['id']},'transaction':_0x50bed0})[_0x9e16('0x29')](function(_0x4cf85a){var _0x726598=_[_0x9e16('0x31')](_0x481342[_0x9e16('0x4f')],function(_0x569b64){delete _0x569b64['id'];_0x569b64['CustomReportId']=_0x481342[_0x9e16('0x49')]['id'];return _0x569b64;});return db[_0x9e16('0x32')][_0x9e16('0x4e')](_0x726598,{'transaction':_0x50bed0});});})['then'](function(){return db[_0x9e16('0x32')][_0x9e16('0x45')]({'where':{'CustomReportId':_0x481342['params']['id']}});});}})['then'](respondWithResult(_0x127798,null))[_0x9e16('0x47')](handleError(_0x127798,null));};
\ No newline at end of file
diff --git a/server/api/analyticFieldReport/analyticFieldReport.model.js b/server/api/analyticFieldReport/analyticFieldReport.model.js
index f9868cb..bdd71d1 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 _0x5a93=['lodash','util','../../config/logger','api','bluebird','request-promise','path','rimraf','../../config/environment','./analyticFieldReport.attributes','exports','define','AnalyticFieldReport','analytics_report_fields'];(function(_0x3122c1,_0x21d826){var _0x2c280a=function(_0x20bec6){while(--_0x20bec6){_0x3122c1['push'](_0x3122c1['shift']());}};_0x2c280a(++_0x21d826);}(_0x5a93,0x17a));var _0x35a9=function(_0x13fa45,_0x3eecdc){_0x13fa45=_0x13fa45-0x0;var _0x5f2b91=_0x5a93[_0x13fa45];return _0x5f2b91;};'use strict';var _=require(_0x35a9('0x0'));var util=require(_0x35a9('0x1'));var logger=require(_0x35a9('0x2'))(_0x35a9('0x3'));var moment=require('moment');var BPromise=require(_0x35a9('0x4'));var rp=require(_0x35a9('0x5'));var fs=require('fs');var path=require(_0x35a9('0x6'));var rimraf=require(_0x35a9('0x7'));var config=require(_0x35a9('0x8'));var attributes=require(_0x35a9('0x9'));module[_0x35a9('0xa')]=function(_0x44bf7e,_0x5e25a4){return _0x44bf7e[_0x35a9('0xb')](_0x35a9('0xc'),attributes,{'tableName':_0x35a9('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x25b2=['define','analytics_report_fields','lodash','util','../../config/logger','api','request-promise','path','../../config/environment','./analyticFieldReport.attributes'];(function(_0x268c4c,_0x5cce8d){var _0x37e96e=function(_0x59d4c2){while(--_0x59d4c2){_0x268c4c['push'](_0x268c4c['shift']());}};_0x37e96e(++_0x5cce8d);}(_0x25b2,0x188));var _0x225b=function(_0x1ac595,_0x5d2081){_0x1ac595=_0x1ac595-0x0;var _0x455fff=_0x25b2[_0x1ac595];return _0x455fff;};'use strict';var _=require(_0x225b('0x0'));var util=require(_0x225b('0x1'));var logger=require(_0x225b('0x2'))(_0x225b('0x3'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x225b('0x4'));var fs=require('fs');var path=require(_0x225b('0x5'));var rimraf=require('rimraf');var config=require(_0x225b('0x6'));var attributes=require(_0x225b('0x7'));module['exports']=function(_0x2c9ace,_0x140397){return _0x2c9ace[_0x225b('0x8')]('AnalyticFieldReport',attributes,{'tableName':_0x225b('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
diff --git a/server/api/analyticFieldReport/analyticFieldReport.rpc.js b/server/api/analyticFieldReport/analyticFieldReport.rpc.js
index 3173d58..125b896 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 _0x6594=['client','http','request','then','info','AnalyticFieldReport,\x20%s,\x20%s','request\x20sent','debug','AnalyticFieldReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','util','moment','randomstring','ioredis','../../mysqldb','rpc','../../config/environment','jayson/promise'];(function(_0x96e3c9,_0x2078a6){var _0x581019=function(_0x4a070b){while(--_0x4a070b){_0x96e3c9['push'](_0x96e3c9['shift']());}};_0x581019(++_0x2078a6);}(_0x6594,0x100));var _0x4659=function(_0x547bb6,_0x2d6f27){_0x547bb6=_0x547bb6-0x0;var _0x1a9154=_0x6594[_0x547bb6];return _0x1a9154;};'use strict';var _=require('lodash');var util=require(_0x4659('0x0'));var moment=require(_0x4659('0x1'));var BPromise=require('bluebird');var rs=require(_0x4659('0x2'));var fs=require('fs');var Redis=require(_0x4659('0x3'));var db=require(_0x4659('0x4'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x4659('0x5'));var config=require(_0x4659('0x6'));var jayson=require(_0x4659('0x7'));var client=jayson[_0x4659('0x8')][_0x4659('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x16b1c3,_0x1bc8ab,_0x3f18e7){return new BPromise(function(_0x3734dc,_0x2955db){return client[_0x4659('0xa')](_0x16b1c3,_0x3f18e7)[_0x4659('0xb')](function(_0x1114bb){logger[_0x4659('0xc')](_0x4659('0xd'),_0x1bc8ab,_0x4659('0xe'));logger[_0x4659('0xf')](_0x4659('0x10'),_0x1bc8ab,_0x4659('0xe'),JSON[_0x4659('0x11')](_0x1114bb));if(_0x1114bb[_0x4659('0x12')]){if(_0x1114bb[_0x4659('0x12')][_0x4659('0x13')]===0x1f4){logger[_0x4659('0x12')](_0x4659('0xd'),_0x1bc8ab,_0x1114bb[_0x4659('0x12')][_0x4659('0x14')]);return _0x2955db(_0x1114bb[_0x4659('0x12')][_0x4659('0x14')]);}logger[_0x4659('0x12')](_0x4659('0xd'),_0x1bc8ab,_0x1114bb[_0x4659('0x12')]['message']);return _0x3734dc(_0x1114bb[_0x4659('0x12')][_0x4659('0x14')]);}else{logger[_0x4659('0xc')](_0x4659('0xd'),_0x1bc8ab,_0x4659('0xe'));_0x3734dc(_0x1114bb['result']['message']);}})[_0x4659('0x15')](function(_0x1918ea){logger[_0x4659('0x12')]('AnalyticFieldReport,\x20%s,\x20%s',_0x1bc8ab,_0x1918ea);_0x2955db(_0x1918ea);});});}
\ No newline at end of file
+var _0x91c2=['http','request','info','AnalyticFieldReport,\x20%s,\x20%s','request\x20sent','debug','AnalyticFieldReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client'];(function(_0x1f83a5,_0x59843f){var _0x45edf0=function(_0x431e25){while(--_0x431e25){_0x1f83a5['push'](_0x1f83a5['shift']());}};_0x45edf0(++_0x59843f);}(_0x91c2,0xb4));var _0x291c=function(_0x2323be,_0x222262){_0x2323be=_0x2323be-0x0;var _0x342eaf=_0x91c2[_0x2323be];return _0x342eaf;};'use strict';var _=require(_0x291c('0x0'));var util=require(_0x291c('0x1'));var moment=require(_0x291c('0x2'));var BPromise=require(_0x291c('0x3'));var rs=require(_0x291c('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x291c('0x5'))['db'];var utils=require(_0x291c('0x6'));var logger=require(_0x291c('0x7'))(_0x291c('0x8'));var config=require(_0x291c('0x9'));var jayson=require(_0x291c('0xa'));var client=jayson[_0x291c('0xb')][_0x291c('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x1206f4,_0x3ac8d2,_0xff1395){return new BPromise(function(_0x472017,_0x15887d){return client[_0x291c('0xd')](_0x1206f4,_0xff1395)['then'](function(_0x21e16f){logger[_0x291c('0xe')](_0x291c('0xf'),_0x3ac8d2,_0x291c('0x10'));logger[_0x291c('0x11')](_0x291c('0x12'),_0x3ac8d2,'request\x20sent',JSON[_0x291c('0x13')](_0x21e16f));if(_0x21e16f[_0x291c('0x14')]){if(_0x21e16f[_0x291c('0x14')][_0x291c('0x15')]===0x1f4){logger['error'](_0x291c('0xf'),_0x3ac8d2,_0x21e16f['error'][_0x291c('0x16')]);return _0x15887d(_0x21e16f[_0x291c('0x14')][_0x291c('0x16')]);}logger[_0x291c('0x14')]('AnalyticFieldReport,\x20%s,\x20%s',_0x3ac8d2,_0x21e16f[_0x291c('0x14')][_0x291c('0x16')]);return _0x472017(_0x21e16f[_0x291c('0x14')][_0x291c('0x16')]);}else{logger[_0x291c('0xe')](_0x291c('0xf'),_0x3ac8d2,_0x291c('0x10'));_0x472017(_0x21e16f[_0x291c('0x17')][_0x291c('0x16')]);}})['catch'](function(_0x5a274e){logger[_0x291c('0x14')]('AnalyticFieldReport,\x20%s,\x20%s',_0x3ac8d2,_0x5a274e);_0x15887d(_0x5a274e);});});}
\ No newline at end of file
diff --git a/server/api/analyticFieldReport/index.js b/server/api/analyticFieldReport/index.js
index 250e537..74cc944 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(_0x124d6c,_0x3f6654){var _0x3b4645=function(_0x206003){while(--_0x206003){_0x124d6c['push'](_0x124d6c['shift']());}};_0x3b4645(++_0x3f6654);}(_0xa9e0,0x123));var _0x0a9e=function(_0x298ed3,_0x4ab5e1){_0x298ed3=_0x298ed3-0x0;var _0x5aad28=_0xa9e0[_0x298ed3];return _0x5aad28;};'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(_0x27ac4b,_0x2fa555){var _0x1598a4=function(_0x26ceaa){while(--_0x26ceaa){_0x27ac4b['push'](_0x27ac4b['shift']());}};_0x1598a4(++_0x2fa555);}(_0xa9e0,0x123));var _0x0a9e=function(_0x491a7f,_0x28bb80){_0x491a7f=_0x491a7f-0x0;var _0x3d8f44=_0xa9e0[_0x491a7f];return _0x3d8f44;};'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 da6aab3..b081bb0 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 _0x4746=['name','TEXT','STRING','sequelize','exports'];(function(_0x30a956,_0x11222e){var _0x2ac17d=function(_0x3be1d2){while(--_0x3be1d2){_0x30a956['push'](_0x30a956['shift']());}};_0x2ac17d(++_0x11222e);}(_0x4746,0xc6));var _0x6474=function(_0x5c8736,_0x2a2a03){_0x5c8736=_0x5c8736-0x0;var _0x142bdb=_0x4746[_0x5c8736];return _0x142bdb;};'use strict';var Sequelize=require(_0x6474('0x0'));module[_0x6474('0x1')]={'name':{'type':Sequelize['STRING'],'allowNull':![],'unique':_0x6474('0x2')},'table':{'type':Sequelize['STRING']},'metric':{'type':Sequelize[_0x6474('0x3')]},'description':{'type':Sequelize[_0x6474('0x4')]}};
\ No newline at end of file
+var _0x3c1a=['STRING','name','TEXT','sequelize','exports'];(function(_0x4f08dd,_0x3784ec){var _0x3017ee=function(_0x7d95be){while(--_0x7d95be){_0x4f08dd['push'](_0x4f08dd['shift']());}};_0x3017ee(++_0x3784ec);}(_0x3c1a,0xda));var _0xa3c1=function(_0x1ae491,_0x5b83b9){_0x1ae491=_0x1ae491-0x0;var _0x4958a5=_0x3c1a[_0x1ae491];return _0x4958a5;};'use strict';var Sequelize=require(_0xa3c1('0x0'));module[_0xa3c1('0x1')]={'name':{'type':Sequelize[_0xa3c1('0x2')],'allowNull':![],'unique':_0xa3c1('0x3')},'table':{'type':Sequelize[_0xa3c1('0x2')]},'metric':{'type':Sequelize[_0xa3c1('0x4')]},'description':{'type':Sequelize[_0xa3c1('0x2')]}};
\ No newline at end of file
diff --git a/server/api/analyticMetric/analyticMetric.controller.js b/server/api/analyticMetric/analyticMetric.controller.js
index 4de2639..773bd67 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 _0x55ca=['../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','json','offset','undefined','limit','count','reject','update','then','get','Metrics','UserProfileResource','destroy','end','sendStatus','stack','name','send','index','map','rawAttributes','fieldName','type','key','model','query','keys','intersection','fields','attributes','length','nolimit','order','sort','where','pick','filter','merge','AnalyticMetric','findAll','catch','show','include','find','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','params','eml-format','rimraf','moment','bluebird','util','path','sox','to-csv','ejs','fs-extra','lodash','crypto','jsforce','querystring','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware'];(function(_0x13ee19,_0x1a8807){var _0x4f2fbe=function(_0x36d6d4){while(--_0x36d6d4){_0x13ee19['push'](_0x13ee19['shift']());}};_0x4f2fbe(++_0x1a8807);}(_0x55ca,0x126));var _0xa55c=function(_0xa63ea3,_0x4367ff){_0xa63ea3=_0xa63ea3-0x0;var _0x2aa5ff=_0x55ca[_0xa63ea3];return _0x2aa5ff;};'use strict';var emlformat=require(_0xa55c('0x0'));var rimraf=require(_0xa55c('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0xa55c('0x2'));var BPromise=require(_0xa55c('0x3'));var Mustache=require('mustache');var util=require(_0xa55c('0x4'));var path=require(_0xa55c('0x5'));var sox=require(_0xa55c('0x6'));var csv=require(_0xa55c('0x7'));var ejs=require(_0xa55c('0x8'));var fs=require('fs');var fs_extra=require(_0xa55c('0x9'));var _=require(_0xa55c('0xa'));var squel=require('squel');var crypto=require(_0xa55c('0xb'));var jsforce=require(_0xa55c('0xc'));var deskjs=require('desk.js');var toCsv=require(_0xa55c('0x7'));var querystring=require(_0xa55c('0xd'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0xa55c('0xe'));var qs=require(_0xa55c('0xf'));var as=require(_0xa55c('0x10'));var hardwareService=require(_0xa55c('0x11'));var logger=require(_0xa55c('0x12'))(_0xa55c('0x13'));var utils=require(_0xa55c('0x14'));var config=require(_0xa55c('0x15'));var licenseUtil=require(_0xa55c('0x16'));var db=require(_0xa55c('0x17'))['db'];function respondWithStatusCode(_0x5d47ff,_0x59d84a){_0x59d84a=_0x59d84a||0xcc;return function(_0x2a35be){if(_0x2a35be){return _0x5d47ff['sendStatus'](_0x59d84a);}return _0x5d47ff['status'](_0x59d84a)['end']();};}function respondWithResult(_0x18ee85,_0x3930e4){_0x3930e4=_0x3930e4||0xc8;return function(_0x462cd6){if(_0x462cd6){return _0x18ee85[_0xa55c('0x18')](_0x3930e4)[_0xa55c('0x19')](_0x462cd6);}};}function respondWithFilteredResult(_0x247e77,_0x4e0b2f){return function(_0x3ccf65){if(_0x3ccf65){var _0x3dcf4f=typeof _0x4e0b2f[_0xa55c('0x1a')]===_0xa55c('0x1b')&&typeof _0x4e0b2f[_0xa55c('0x1c')]===_0xa55c('0x1b');var _0x51590e=_0x3ccf65[_0xa55c('0x1d')];var _0x24783b=_0x3dcf4f?0x0:_0x4e0b2f['offset'];var _0x3d4c9e=_0x3dcf4f?_0x3ccf65[_0xa55c('0x1d')]:_0x4e0b2f[_0xa55c('0x1a')]+_0x4e0b2f[_0xa55c('0x1c')];var _0x23a1ae;if(_0x3d4c9e>=_0x51590e){_0x3d4c9e=_0x51590e;_0x23a1ae=0xc8;}else{_0x23a1ae=0xce;}_0x247e77[_0xa55c('0x18')](_0x23a1ae);return _0x247e77['set']('Content-Range',_0x24783b+'-'+_0x3d4c9e+'/'+_0x51590e)[_0xa55c('0x19')](_0x3ccf65);}return null;};}function patchUpdates(_0x3776ac){return function(_0xade4c4){try{jsonpatch['apply'](_0xade4c4,_0x3776ac,!![]);}catch(_0x383d92){return BPromise[_0xa55c('0x1e')](_0x383d92);}return _0xade4c4['save']();};}function saveUpdates(_0x187a87,_0x133096){return function(_0x940f28){if(_0x940f28){return _0x940f28[_0xa55c('0x1f')](_0x187a87)[_0xa55c('0x20')](function(_0x49ed04){return _0x49ed04;});}return null;};}function removeEntity(_0x1fc828,_0x504c24){return function(_0x5ba836){if(_0x5ba836){return _0x5ba836['destroy']()[_0xa55c('0x20')](function(){var _0x54b038=_0x5ba836[_0xa55c('0x21')]({'plain':!![]});var _0x190757=_0xa55c('0x22');return db[_0xa55c('0x23')][_0xa55c('0x24')]({'where':{'type':_0x190757,'resourceId':_0x54b038['id']}})[_0xa55c('0x20')](function(){return _0x5ba836;});})[_0xa55c('0x20')](function(){_0x1fc828[_0xa55c('0x18')](0xcc)[_0xa55c('0x25')]();});}};}function handleEntityNotFound(_0x3cd152,_0x1273d7){return function(_0x57f271){if(!_0x57f271){_0x3cd152[_0xa55c('0x26')](0x194);}return _0x57f271;};}function handleError(_0x28814f,_0x1c9f6b){_0x1c9f6b=_0x1c9f6b||0x1f4;return function(_0x906caa){logger['error'](_0x906caa[_0xa55c('0x27')]);if(_0x906caa[_0xa55c('0x28')]){delete _0x906caa[_0xa55c('0x28')];}_0x28814f[_0xa55c('0x18')](_0x1c9f6b)[_0xa55c('0x29')](_0x906caa);};}exports[_0xa55c('0x2a')]=function(_0x52d37f,_0x23e698){var _0x490b7d={},_0x35c9c2={},_0x1d730b={'count':0x0,'rows':[]};var _0x1cc53e=_[_0xa55c('0x2b')](db['AnalyticMetric'][_0xa55c('0x2c')],function(_0x2096ae){return{'name':_0x2096ae[_0xa55c('0x2d')],'type':_0x2096ae[_0xa55c('0x2e')][_0xa55c('0x2f')]};});_0x35c9c2[_0xa55c('0x30')]=_[_0xa55c('0x2b')](_0x1cc53e,_0xa55c('0x28'));_0x35c9c2[_0xa55c('0x31')]=_[_0xa55c('0x32')](_0x52d37f[_0xa55c('0x31')]);_0x35c9c2['filters']=_['intersection'](_0x35c9c2[_0xa55c('0x30')],_0x35c9c2[_0xa55c('0x31')]);_0x490b7d['attributes']=_[_0xa55c('0x33')](_0x35c9c2[_0xa55c('0x30')],qs[_0xa55c('0x34')](_0x52d37f[_0xa55c('0x31')][_0xa55c('0x34')]));_0x490b7d[_0xa55c('0x35')]=_0x490b7d[_0xa55c('0x35')][_0xa55c('0x36')]?_0x490b7d[_0xa55c('0x35')]:_0x35c9c2['model'];if(!_0x52d37f['query']['hasOwnProperty'](_0xa55c('0x37'))){_0x490b7d[_0xa55c('0x1c')]=qs[_0xa55c('0x1c')](_0x52d37f['query'][_0xa55c('0x1c')]);_0x490b7d['offset']=qs[_0xa55c('0x1a')](_0x52d37f['query'][_0xa55c('0x1a')]);}_0x490b7d[_0xa55c('0x38')]=qs[_0xa55c('0x39')](_0x52d37f['query'][_0xa55c('0x39')]);_0x490b7d[_0xa55c('0x3a')]=qs['filters'](_[_0xa55c('0x3b')](_0x52d37f[_0xa55c('0x31')],_0x35c9c2['filters']),_0x1cc53e);if(_0x52d37f['query'][_0xa55c('0x3c')]){_0x490b7d['where']=_[_0xa55c('0x3d')](_0x490b7d[_0xa55c('0x3a')],{'$or':_['map'](_0x1cc53e,function(_0x542d76){if(_0x542d76['type']!=='VIRTUAL'){var _0x3b3308={};_0x3b3308[_0x542d76[_0xa55c('0x28')]]={'$like':'%'+_0x52d37f[_0xa55c('0x31')][_0xa55c('0x3c')]+'%'};return _0x3b3308;}})});}_0x490b7d=_[_0xa55c('0x3d')]({},_0x490b7d,_0x52d37f['options']);var _0x3d52d8={'where':_0x490b7d[_0xa55c('0x3a')]};return db[_0xa55c('0x3e')][_0xa55c('0x1d')](_0x3d52d8)[_0xa55c('0x20')](function(_0x23cef5){_0x1d730b['count']=_0x23cef5;if(_0x52d37f[_0xa55c('0x31')]['includeAll']){_0x490b7d['include']=[{'all':!![]}];}return db[_0xa55c('0x3e')][_0xa55c('0x3f')](_0x490b7d);})['then'](function(_0x2bd98b){_0x1d730b['rows']=_0x2bd98b;return _0x1d730b;})['then'](respondWithFilteredResult(_0x23e698,_0x490b7d))[_0xa55c('0x40')](handleError(_0x23e698,null));};exports[_0xa55c('0x41')]=function(_0x1630ac,_0x540337){var _0x1b2708={'raw':!![],'where':{'id':_0x1630ac['params']['id']}},_0xd5a006={};_0xd5a006[_0xa55c('0x30')]=_['keys'](db[_0xa55c('0x3e')][_0xa55c('0x2c')]);_0xd5a006['query']=_[_0xa55c('0x32')](_0x1630ac[_0xa55c('0x31')]);_0xd5a006['filters']=_[_0xa55c('0x33')](_0xd5a006[_0xa55c('0x30')],_0xd5a006[_0xa55c('0x31')]);_0x1b2708['attributes']=_[_0xa55c('0x33')](_0xd5a006['model'],qs[_0xa55c('0x34')](_0x1630ac[_0xa55c('0x31')][_0xa55c('0x34')]));_0x1b2708['attributes']=_0x1b2708[_0xa55c('0x35')][_0xa55c('0x36')]?_0x1b2708['attributes']:_0xd5a006[_0xa55c('0x30')];if(_0x1630ac[_0xa55c('0x31')]['includeAll']){_0x1b2708[_0xa55c('0x42')]=[{'all':!![]}];}_0x1b2708=_[_0xa55c('0x3d')]({},_0x1b2708,_0x1630ac['options']);return db[_0xa55c('0x3e')][_0xa55c('0x43')](_0x1b2708)[_0xa55c('0x20')](handleEntityNotFound(_0x540337,null))[_0xa55c('0x20')](respondWithResult(_0x540337,null))['catch'](handleError(_0x540337,null));};exports[_0xa55c('0x44')]=function(_0x58a7ea,_0x2157d6){return db[_0xa55c('0x3e')][_0xa55c('0x44')](_0x58a7ea['body'],{})[_0xa55c('0x20')](function(_0x250b00){var _0x574fe9=_0x58a7ea[_0xa55c('0x45')][_0xa55c('0x21')]({'plain':!![]});if(!_0x574fe9)throw new Error(_0xa55c('0x46'));if(_0x574fe9[_0xa55c('0x47')]===_0xa55c('0x45')){var _0x1c84d9=_0x250b00[_0xa55c('0x21')]({'plain':!![]});var _0x129626=_0xa55c('0x22');return db[_0xa55c('0x48')]['find']({'where':{'name':_0x129626,'userProfileId':_0x574fe9[_0xa55c('0x49')]},'raw':!![]})[_0xa55c('0x20')](function(_0x216de8){if(_0x216de8&&_0x216de8['autoAssociation']===0x0){return db[_0xa55c('0x23')][_0xa55c('0x44')]({'name':_0x1c84d9['name'],'resourceId':_0x1c84d9['id'],'type':_0x216de8[_0xa55c('0x28')],'sectionId':_0x216de8['id']},{})['then'](function(){return _0x250b00;});}else{return _0x250b00;}})[_0xa55c('0x40')](function(_0x228df4){logger[_0xa55c('0x4a')](_0xa55c('0x4b'),_0x228df4);throw _0x228df4;});}return _0x250b00;})[_0xa55c('0x20')](respondWithResult(_0x2157d6,0xc9))['catch'](handleError(_0x2157d6,null));};exports[_0xa55c('0x1f')]=function(_0x4607ca,_0x4b85cc){if(_0x4607ca[_0xa55c('0x4c')]['id']){delete _0x4607ca[_0xa55c('0x4c')]['id'];}return db[_0xa55c('0x3e')][_0xa55c('0x43')]({'where':{'id':_0x4607ca['params']['id']}})['then'](handleEntityNotFound(_0x4b85cc,null))[_0xa55c('0x20')](saveUpdates(_0x4607ca[_0xa55c('0x4c')],null))[_0xa55c('0x20')](respondWithResult(_0x4b85cc,null))[_0xa55c('0x40')](handleError(_0x4b85cc,null));};exports['destroy']=function(_0x30c0c9,_0x5ce463){return db[_0xa55c('0x3e')][_0xa55c('0x43')]({'where':{'id':_0x30c0c9[_0xa55c('0x4d')]['id']}})[_0xa55c('0x20')](handleEntityNotFound(_0x5ce463,null))[_0xa55c('0x20')](removeEntity(_0x5ce463,null))['catch'](handleError(_0x5ce463,null));};
\ No newline at end of file
+var _0xd6d6=['includeAll','catch','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','find','userProfileId','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','params','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','sox','to-csv','fs-extra','lodash','squel','crypto','jsforce','desk.js','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../mysqldb','sendStatus','status','end','json','undefined','limit','offset','count','set','Content-Range','apply','reject','save','update','then','destroy','get','Metrics','error','stack','name','send','index','map','rawAttributes','fieldName','type','key','model','keys','query','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','filters','filter','merge','where','VIRTUAL','options','include','AnalyticMetric','rows','show'];(function(_0x446be5,_0x1c8c81){var _0x2a5872=function(_0x44f8ad){while(--_0x44f8ad){_0x446be5['push'](_0x446be5['shift']());}};_0x2a5872(++_0x1c8c81);}(_0xd6d6,0xbe));var _0x6d6d=function(_0x393216,_0x33465f){_0x393216=_0x393216-0x0;var _0x33bc7b=_0xd6d6[_0x393216];return _0x33bc7b;};'use strict';var emlformat=require(_0x6d6d('0x0'));var rimraf=require(_0x6d6d('0x1'));var zipdir=require(_0x6d6d('0x2'));var jsonpatch=require(_0x6d6d('0x3'));var rp=require('request-promise');var moment=require(_0x6d6d('0x4'));var BPromise=require(_0x6d6d('0x5'));var Mustache=require(_0x6d6d('0x6'));var util=require(_0x6d6d('0x7'));var path=require(_0x6d6d('0x8'));var sox=require(_0x6d6d('0x9'));var csv=require(_0x6d6d('0xa'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x6d6d('0xb'));var _=require(_0x6d6d('0xc'));var squel=require(_0x6d6d('0xd'));var crypto=require(_0x6d6d('0xe'));var jsforce=require(_0x6d6d('0xf'));var deskjs=require(_0x6d6d('0x10'));var toCsv=require(_0x6d6d('0xa'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x6d6d('0x11'));var authService=require(_0x6d6d('0x12'));var qs=require(_0x6d6d('0x13'));var as=require(_0x6d6d('0x14'));var hardwareService=require(_0x6d6d('0x15'));var logger=require('../../config/logger')(_0x6d6d('0x16'));var utils=require(_0x6d6d('0x17'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0x6d6d('0x18'))['db'];function respondWithStatusCode(_0x32146d,_0xe61c36){_0xe61c36=_0xe61c36||0xcc;return function(_0x3f8542){if(_0x3f8542){return _0x32146d[_0x6d6d('0x19')](_0xe61c36);}return _0x32146d[_0x6d6d('0x1a')](_0xe61c36)[_0x6d6d('0x1b')]();};}function respondWithResult(_0x2cb2dd,_0x5f4154){_0x5f4154=_0x5f4154||0xc8;return function(_0xd09ea7){if(_0xd09ea7){return _0x2cb2dd[_0x6d6d('0x1a')](_0x5f4154)[_0x6d6d('0x1c')](_0xd09ea7);}};}function respondWithFilteredResult(_0xa3b05d,_0x29cbd8){return function(_0x5d80c0){if(_0x5d80c0){var _0x2e6fdb=typeof _0x29cbd8['offset']===_0x6d6d('0x1d')&&typeof _0x29cbd8[_0x6d6d('0x1e')]===_0x6d6d('0x1d');var _0x4bb3d1=_0x5d80c0['count'];var _0x9e1e18=_0x2e6fdb?0x0:_0x29cbd8[_0x6d6d('0x1f')];var _0x2b59d4=_0x2e6fdb?_0x5d80c0[_0x6d6d('0x20')]:_0x29cbd8['offset']+_0x29cbd8['limit'];var _0x474873;if(_0x2b59d4>=_0x4bb3d1){_0x2b59d4=_0x4bb3d1;_0x474873=0xc8;}else{_0x474873=0xce;}_0xa3b05d['status'](_0x474873);return _0xa3b05d[_0x6d6d('0x21')](_0x6d6d('0x22'),_0x9e1e18+'-'+_0x2b59d4+'/'+_0x4bb3d1)[_0x6d6d('0x1c')](_0x5d80c0);}return null;};}function patchUpdates(_0x450352){return function(_0x40d35b){try{jsonpatch[_0x6d6d('0x23')](_0x40d35b,_0x450352,!![]);}catch(_0x164c67){return BPromise[_0x6d6d('0x24')](_0x164c67);}return _0x40d35b[_0x6d6d('0x25')]();};}function saveUpdates(_0x6f64e3,_0x24b10d){return function(_0x6e58e3){if(_0x6e58e3){return _0x6e58e3[_0x6d6d('0x26')](_0x6f64e3)[_0x6d6d('0x27')](function(_0x1f7f88){return _0x1f7f88;});}return null;};}function removeEntity(_0x25a02e,_0xced622){return function(_0x583b10){if(_0x583b10){return _0x583b10[_0x6d6d('0x28')]()[_0x6d6d('0x27')](function(){var _0x99f7d6=_0x583b10[_0x6d6d('0x29')]({'plain':!![]});var _0xf0df7f=_0x6d6d('0x2a');return db['UserProfileResource'][_0x6d6d('0x28')]({'where':{'type':_0xf0df7f,'resourceId':_0x99f7d6['id']}})[_0x6d6d('0x27')](function(){return _0x583b10;});})[_0x6d6d('0x27')](function(){_0x25a02e[_0x6d6d('0x1a')](0xcc)[_0x6d6d('0x1b')]();});}};}function handleEntityNotFound(_0x408f98,_0x3641fc){return function(_0x4a57a1){if(!_0x4a57a1){_0x408f98[_0x6d6d('0x19')](0x194);}return _0x4a57a1;};}function handleError(_0x9595d8,_0x51bd68){_0x51bd68=_0x51bd68||0x1f4;return function(_0x553645){logger[_0x6d6d('0x2b')](_0x553645[_0x6d6d('0x2c')]);if(_0x553645[_0x6d6d('0x2d')]){delete _0x553645['name'];}_0x9595d8[_0x6d6d('0x1a')](_0x51bd68)[_0x6d6d('0x2e')](_0x553645);};}exports[_0x6d6d('0x2f')]=function(_0x1c8340,_0x64d1f7){var _0x428c17={},_0xdda3f2={},_0x359cfd={'count':0x0,'rows':[]};var _0x6c4741=_[_0x6d6d('0x30')](db['AnalyticMetric'][_0x6d6d('0x31')],function(_0x4f1fc5){return{'name':_0x4f1fc5[_0x6d6d('0x32')],'type':_0x4f1fc5[_0x6d6d('0x33')][_0x6d6d('0x34')]};});_0xdda3f2[_0x6d6d('0x35')]=_['map'](_0x6c4741,_0x6d6d('0x2d'));_0xdda3f2['query']=_[_0x6d6d('0x36')](_0x1c8340[_0x6d6d('0x37')]);_0xdda3f2['filters']=_[_0x6d6d('0x38')](_0xdda3f2[_0x6d6d('0x35')],_0xdda3f2[_0x6d6d('0x37')]);_0x428c17[_0x6d6d('0x39')]=_[_0x6d6d('0x38')](_0xdda3f2[_0x6d6d('0x35')],qs[_0x6d6d('0x3a')](_0x1c8340[_0x6d6d('0x37')][_0x6d6d('0x3a')]));_0x428c17[_0x6d6d('0x39')]=_0x428c17[_0x6d6d('0x39')][_0x6d6d('0x3b')]?_0x428c17[_0x6d6d('0x39')]:_0xdda3f2[_0x6d6d('0x35')];if(!_0x1c8340['query'][_0x6d6d('0x3c')](_0x6d6d('0x3d'))){_0x428c17[_0x6d6d('0x1e')]=qs[_0x6d6d('0x1e')](_0x1c8340['query']['limit']);_0x428c17[_0x6d6d('0x1f')]=qs[_0x6d6d('0x1f')](_0x1c8340[_0x6d6d('0x37')]['offset']);}_0x428c17[_0x6d6d('0x3e')]=qs[_0x6d6d('0x3f')](_0x1c8340[_0x6d6d('0x37')][_0x6d6d('0x3f')]);_0x428c17['where']=qs['filters'](_['pick'](_0x1c8340[_0x6d6d('0x37')],_0xdda3f2[_0x6d6d('0x40')]),_0x6c4741);if(_0x1c8340[_0x6d6d('0x37')][_0x6d6d('0x41')]){_0x428c17['where']=_[_0x6d6d('0x42')](_0x428c17[_0x6d6d('0x43')],{'$or':_[_0x6d6d('0x30')](_0x6c4741,function(_0x3c6d23){if(_0x3c6d23[_0x6d6d('0x33')]!==_0x6d6d('0x44')){var _0x4b457d={};_0x4b457d[_0x3c6d23[_0x6d6d('0x2d')]]={'$like':'%'+_0x1c8340[_0x6d6d('0x37')][_0x6d6d('0x41')]+'%'};return _0x4b457d;}})});}_0x428c17=_[_0x6d6d('0x42')]({},_0x428c17,_0x1c8340[_0x6d6d('0x45')]);var _0x3e27b7={'where':_0x428c17[_0x6d6d('0x43')]};return db['AnalyticMetric'][_0x6d6d('0x20')](_0x3e27b7)[_0x6d6d('0x27')](function(_0x16e177){_0x359cfd[_0x6d6d('0x20')]=_0x16e177;if(_0x1c8340[_0x6d6d('0x37')]['includeAll']){_0x428c17[_0x6d6d('0x46')]=[{'all':!![]}];}return db[_0x6d6d('0x47')]['findAll'](_0x428c17);})[_0x6d6d('0x27')](function(_0x50dc17){_0x359cfd[_0x6d6d('0x48')]=_0x50dc17;return _0x359cfd;})[_0x6d6d('0x27')](respondWithFilteredResult(_0x64d1f7,_0x428c17))['catch'](handleError(_0x64d1f7,null));};exports[_0x6d6d('0x49')]=function(_0x3324ec,_0x252cbe){var _0x4041f3={'raw':!![],'where':{'id':_0x3324ec['params']['id']}},_0xf7ea0d={};_0xf7ea0d['model']=_[_0x6d6d('0x36')](db['AnalyticMetric']['rawAttributes']);_0xf7ea0d[_0x6d6d('0x37')]=_[_0x6d6d('0x36')](_0x3324ec[_0x6d6d('0x37')]);_0xf7ea0d['filters']=_[_0x6d6d('0x38')](_0xf7ea0d['model'],_0xf7ea0d[_0x6d6d('0x37')]);_0x4041f3[_0x6d6d('0x39')]=_[_0x6d6d('0x38')](_0xf7ea0d[_0x6d6d('0x35')],qs[_0x6d6d('0x3a')](_0x3324ec[_0x6d6d('0x37')][_0x6d6d('0x3a')]));_0x4041f3['attributes']=_0x4041f3[_0x6d6d('0x39')][_0x6d6d('0x3b')]?_0x4041f3[_0x6d6d('0x39')]:_0xf7ea0d[_0x6d6d('0x35')];if(_0x3324ec[_0x6d6d('0x37')][_0x6d6d('0x4a')]){_0x4041f3[_0x6d6d('0x46')]=[{'all':!![]}];}_0x4041f3=_[_0x6d6d('0x42')]({},_0x4041f3,_0x3324ec[_0x6d6d('0x45')]);return db['AnalyticMetric']['find'](_0x4041f3)[_0x6d6d('0x27')](handleEntityNotFound(_0x252cbe,null))[_0x6d6d('0x27')](respondWithResult(_0x252cbe,null))[_0x6d6d('0x4b')](handleError(_0x252cbe,null));};exports[_0x6d6d('0x4c')]=function(_0xe2a20e,_0x492834){return db[_0x6d6d('0x47')][_0x6d6d('0x4c')](_0xe2a20e[_0x6d6d('0x4d')],{})[_0x6d6d('0x27')](function(_0x2ee917){var _0x23c2db=_0xe2a20e[_0x6d6d('0x4e')][_0x6d6d('0x29')]({'plain':!![]});if(!_0x23c2db)throw new Error(_0x6d6d('0x4f'));if(_0x23c2db[_0x6d6d('0x50')]===_0x6d6d('0x4e')){var _0x175e26=_0x2ee917['get']({'plain':!![]});var _0x190786=_0x6d6d('0x2a');return db[_0x6d6d('0x51')][_0x6d6d('0x52')]({'where':{'name':_0x190786,'userProfileId':_0x23c2db[_0x6d6d('0x53')]},'raw':!![]})['then'](function(_0x38c307){if(_0x38c307&&_0x38c307[_0x6d6d('0x54')]===0x0){return db[_0x6d6d('0x55')]['create']({'name':_0x175e26['name'],'resourceId':_0x175e26['id'],'type':_0x38c307[_0x6d6d('0x2d')],'sectionId':_0x38c307['id']},{})['then'](function(){return _0x2ee917;});}else{return _0x2ee917;}})[_0x6d6d('0x4b')](function(_0x995fe2){logger[_0x6d6d('0x2b')](_0x6d6d('0x56'),_0x995fe2);throw _0x995fe2;});}return _0x2ee917;})[_0x6d6d('0x27')](respondWithResult(_0x492834,0xc9))[_0x6d6d('0x4b')](handleError(_0x492834,null));};exports[_0x6d6d('0x26')]=function(_0x26c23a,_0x1a8f33){if(_0x26c23a[_0x6d6d('0x4d')]['id']){delete _0x26c23a['body']['id'];}return db[_0x6d6d('0x47')][_0x6d6d('0x52')]({'where':{'id':_0x26c23a[_0x6d6d('0x57')]['id']}})[_0x6d6d('0x27')](handleEntityNotFound(_0x1a8f33,null))[_0x6d6d('0x27')](saveUpdates(_0x26c23a[_0x6d6d('0x4d')],null))[_0x6d6d('0x27')](respondWithResult(_0x1a8f33,null))['catch'](handleError(_0x1a8f33,null));};exports['destroy']=function(_0x3ad9b0,_0x122865){return db['AnalyticMetric'][_0x6d6d('0x52')]({'where':{'id':_0x3ad9b0[_0x6d6d('0x57')]['id']}})[_0x6d6d('0x27')](handleEntityNotFound(_0x122865,null))[_0x6d6d('0x27')](removeEntity(_0x122865,null))[_0x6d6d('0x4b')](handleError(_0x122865,null));};
\ No newline at end of file
diff --git a/server/api/analyticMetric/analyticMetric.model.js b/server/api/analyticMetric/analyticMetric.model.js
index 2c8e85e..1de85ae 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 _0x11e5=['path','../../config/environment','define','lodash','../../config/logger','api','bluebird','request-promise'];(function(_0x354e78,_0xa8c7d8){var _0x3f9cb2=function(_0x2bdff2){while(--_0x2bdff2){_0x354e78['push'](_0x354e78['shift']());}};_0x3f9cb2(++_0xa8c7d8);}(_0x11e5,0x8b));var _0x511e=function(_0x40f4cc,_0x432f55){_0x40f4cc=_0x40f4cc-0x0;var _0x458315=_0x11e5[_0x40f4cc];return _0x458315;};'use strict';var _=require(_0x511e('0x0'));var util=require('util');var logger=require(_0x511e('0x1'))(_0x511e('0x2'));var moment=require('moment');var BPromise=require(_0x511e('0x3'));var rp=require(_0x511e('0x4'));var fs=require('fs');var path=require(_0x511e('0x5'));var rimraf=require('rimraf');var config=require(_0x511e('0x6'));var attributes=require('./analyticMetric.attributes');module['exports']=function(_0x342539,_0x323f8c){return _0x342539[_0x511e('0x7')]('AnalyticMetric',attributes,{'tableName':'analytics_metrics','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x3c94=['bluebird','request-promise','path','rimraf','../../config/environment','./analyticMetric.attributes','exports','define','AnalyticMetric','analytics_metrics','lodash','util','../../config/logger','api','moment'];(function(_0x58029b,_0x4ce586){var _0x4b3678=function(_0x4934e5){while(--_0x4934e5){_0x58029b['push'](_0x58029b['shift']());}};_0x4b3678(++_0x4ce586);}(_0x3c94,0xcd));var _0x43c9=function(_0x11eb1f,_0x826f0b){_0x11eb1f=_0x11eb1f-0x0;var _0x2121e9=_0x3c94[_0x11eb1f];return _0x2121e9;};'use strict';var _=require(_0x43c9('0x0'));var util=require(_0x43c9('0x1'));var logger=require(_0x43c9('0x2'))(_0x43c9('0x3'));var moment=require(_0x43c9('0x4'));var BPromise=require(_0x43c9('0x5'));var rp=require(_0x43c9('0x6'));var fs=require('fs');var path=require(_0x43c9('0x7'));var rimraf=require(_0x43c9('0x8'));var config=require(_0x43c9('0x9'));var attributes=require(_0x43c9('0xa'));module[_0x43c9('0xb')]=function(_0x4fdfc2,_0x39c220){return _0x4fdfc2[_0x43c9('0xc')](_0x43c9('0xd'),attributes,{'tableName':_0x43c9('0xe'),'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 1b958f8..5ac6ca7 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 _0xbb20=['AnalyticMetric,\x20%s,\x20%s,\x20%s','stringify','error','code','AnalyticMetric,\x20%s,\x20%s','message','result','catch','util','moment','bluebird','randomstring','../../mysqldb','../../config/logger','../../config/environment','jayson/promise','client','request','then','info','request\x20sent','debug'];(function(_0x57392e,_0x2ba38b){var _0x1f2183=function(_0x2563ad){while(--_0x2563ad){_0x57392e['push'](_0x57392e['shift']());}};_0x1f2183(++_0x2ba38b);}(_0xbb20,0x152));var _0x0bb2=function(_0xbeea1c,_0x541820){_0xbeea1c=_0xbeea1c-0x0;var _0x294011=_0xbb20[_0xbeea1c];return _0x294011;};'use strict';var _=require('lodash');var util=require(_0x0bb2('0x0'));var moment=require(_0x0bb2('0x1'));var BPromise=require(_0x0bb2('0x2'));var rs=require(_0x0bb2('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x0bb2('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x0bb2('0x5'))('rpc');var config=require(_0x0bb2('0x6'));var jayson=require(_0x0bb2('0x7'));var client=jayson[_0x0bb2('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0xebdd98,_0x59ad45,_0x4b4fcc){return new BPromise(function(_0x5470ac,_0xf51477){return client[_0x0bb2('0x9')](_0xebdd98,_0x4b4fcc)[_0x0bb2('0xa')](function(_0x6e2381){logger[_0x0bb2('0xb')]('AnalyticMetric,\x20%s,\x20%s',_0x59ad45,_0x0bb2('0xc'));logger[_0x0bb2('0xd')](_0x0bb2('0xe'),_0x59ad45,_0x0bb2('0xc'),JSON[_0x0bb2('0xf')](_0x6e2381));if(_0x6e2381[_0x0bb2('0x10')]){if(_0x6e2381[_0x0bb2('0x10')][_0x0bb2('0x11')]===0x1f4){logger[_0x0bb2('0x10')](_0x0bb2('0x12'),_0x59ad45,_0x6e2381[_0x0bb2('0x10')][_0x0bb2('0x13')]);return _0xf51477(_0x6e2381['error'][_0x0bb2('0x13')]);}logger[_0x0bb2('0x10')](_0x0bb2('0x12'),_0x59ad45,_0x6e2381[_0x0bb2('0x10')][_0x0bb2('0x13')]);return _0x5470ac(_0x6e2381[_0x0bb2('0x10')]['message']);}else{logger[_0x0bb2('0xb')](_0x0bb2('0x12'),_0x59ad45,_0x0bb2('0xc'));_0x5470ac(_0x6e2381[_0x0bb2('0x14')][_0x0bb2('0x13')]);}})[_0x0bb2('0x15')](function(_0x5013bb){logger['error']('AnalyticMetric,\x20%s,\x20%s',_0x59ad45,_0x5013bb);_0xf51477(_0x5013bb);});});}
\ No newline at end of file
+var _0x9da1=['stringify','error','message','info','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','client','http','then','AnalyticMetric,\x20%s,\x20%s','request\x20sent','AnalyticMetric,\x20%s,\x20%s,\x20%s'];(function(_0x9df060,_0x253d33){var _0x338dfe=function(_0x17d9a5){while(--_0x17d9a5){_0x9df060['push'](_0x9df060['shift']());}};_0x338dfe(++_0x253d33);}(_0x9da1,0x98));var _0x19da=function(_0x385b70,_0x52974f){_0x385b70=_0x385b70-0x0;var _0x33e2ef=_0x9da1[_0x385b70];return _0x33e2ef;};'use strict';var _=require(_0x19da('0x0'));var util=require(_0x19da('0x1'));var moment=require(_0x19da('0x2'));var BPromise=require(_0x19da('0x3'));var rs=require(_0x19da('0x4'));var fs=require('fs');var Redis=require(_0x19da('0x5'));var db=require(_0x19da('0x6'))['db'];var utils=require(_0x19da('0x7'));var logger=require('../../config/logger')(_0x19da('0x8'));var config=require(_0x19da('0x9'));var jayson=require('jayson/promise');var client=jayson[_0x19da('0xa')][_0x19da('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x5c23c1,_0x1d226b,_0x280b3e){return new BPromise(function(_0x33debf,_0x295f43){return client['request'](_0x5c23c1,_0x280b3e)[_0x19da('0xc')](function(_0x85c76c){logger['info'](_0x19da('0xd'),_0x1d226b,_0x19da('0xe'));logger['debug'](_0x19da('0xf'),_0x1d226b,'request\x20sent',JSON[_0x19da('0x10')](_0x85c76c));if(_0x85c76c[_0x19da('0x11')]){if(_0x85c76c[_0x19da('0x11')]['code']===0x1f4){logger[_0x19da('0x11')](_0x19da('0xd'),_0x1d226b,_0x85c76c['error'][_0x19da('0x12')]);return _0x295f43(_0x85c76c[_0x19da('0x11')][_0x19da('0x12')]);}logger[_0x19da('0x11')]('AnalyticMetric,\x20%s,\x20%s',_0x1d226b,_0x85c76c['error'][_0x19da('0x12')]);return _0x33debf(_0x85c76c['error'][_0x19da('0x12')]);}else{logger[_0x19da('0x13')]('AnalyticMetric,\x20%s,\x20%s',_0x1d226b,_0x19da('0xe'));_0x33debf(_0x85c76c['result'][_0x19da('0x12')]);}})[_0x19da('0x14')](function(_0x2afec5){logger[_0x19da('0x11')](_0x19da('0xd'),_0x1d226b,_0x2afec5);_0x295f43(_0x2afec5);});});}
\ No newline at end of file
diff --git a/server/api/analyticMetric/index.js b/server/api/analyticMetric/index.js
index 2016510..fd1952d 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 _0xf13b=['multer','express','Router','fs-extra','../../components/auth/service','./analyticMetric.controller','get','index','isAuthenticated','show','create','put','/:id','update','destroy','exports'];(function(_0x33f5fd,_0x13c092){var _0x4f4546=function(_0x4cb466){while(--_0x4cb466){_0x33f5fd['push'](_0x33f5fd['shift']());}};_0x4f4546(++_0x13c092);}(_0xf13b,0x1f0));var _0xbf13=function(_0x2d43ea,_0x169e4c){_0x2d43ea=_0x2d43ea-0x0;var _0x432d99=_0xf13b[_0x2d43ea];return _0x432d99;};'use strict';var multer=require(_0xbf13('0x0'));var util=require('util');var path=require('path');var timeout=require('connect-timeout');var express=require(_0xbf13('0x1'));var router=express[_0xbf13('0x2')]();var fs_extra=require(_0xbf13('0x3'));var auth=require(_0xbf13('0x4'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0xbf13('0x5'));router[_0xbf13('0x6')]('/',auth['isAuthenticated'](),controller[_0xbf13('0x7')]);router[_0xbf13('0x6')]('/:id',auth[_0xbf13('0x8')](),controller[_0xbf13('0x9')]);router['post']('/',auth[_0xbf13('0x8')](),controller[_0xbf13('0xa')]);router[_0xbf13('0xb')](_0xbf13('0xc'),auth['isAuthenticated'](),controller[_0xbf13('0xd')]);router['delete'](_0xbf13('0xc'),auth['isAuthenticated'](),controller[_0xbf13('0xe')]);module[_0xbf13('0xf')]=router;
\ No newline at end of file
+var _0x41f2=['fs-extra','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/:id','show','post','update','delete','destroy','multer','util','connect-timeout','express','Router'];(function(_0x31678f,_0x4bd077){var _0x49d438=function(_0x5139d4){while(--_0x5139d4){_0x31678f['push'](_0x31678f['shift']());}};_0x49d438(++_0x4bd077);}(_0x41f2,0x14f));var _0x241f=function(_0xec1bf7,_0x4b5613){_0xec1bf7=_0xec1bf7-0x0;var _0x1f5431=_0x41f2[_0xec1bf7];return _0x1f5431;};'use strict';var multer=require(_0x241f('0x0'));var util=require(_0x241f('0x1'));var path=require('path');var timeout=require(_0x241f('0x2'));var express=require(_0x241f('0x3'));var router=express[_0x241f('0x4')]();var fs_extra=require(_0x241f('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0x241f('0x6'));var config=require(_0x241f('0x7'));var controller=require('./analyticMetric.controller');router[_0x241f('0x8')]('/',auth[_0x241f('0x9')](),controller[_0x241f('0xa')]);router[_0x241f('0x8')](_0x241f('0xb'),auth['isAuthenticated'](),controller[_0x241f('0xc')]);router[_0x241f('0xd')]('/',auth['isAuthenticated'](),controller['create']);router['put'](_0x241f('0xb'),auth['isAuthenticated'](),controller[_0x241f('0xe')]);router[_0x241f('0xf')](_0x241f('0xb'),auth['isAuthenticated'](),controller[_0x241f('0x10')]);module['exports']=router;
\ No newline at end of file
diff --git a/server/api/analyticTreeReport/analyticTreeReport.attributes.js b/server/api/analyticTreeReport/analyticTreeReport.attributes.js
index 8d3370c..279eeec 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 _0xe623=['exports','TEXT'];(function(_0x781f65,_0x1908bd){var _0x4b5514=function(_0x20298d){while(--_0x20298d){_0x781f65['push'](_0x781f65['shift']());}};_0x4b5514(++_0x1908bd);}(_0xe623,0x10a));var _0x3e62=function(_0x11005e,_0x20c3d2){_0x11005e=_0x11005e-0x0;var _0x29338f=_0xe623[_0x11005e];return _0x29338f;};'use strict';var Sequelize=require('sequelize');module[_0x3e62('0x0')]={'tree':{'type':Sequelize[_0x3e62('0x1')],'allowNull':![]}};
\ No newline at end of file
+var _0x5ce0=['exports'];(function(_0x271060,_0x3f86b1){var _0x40540b=function(_0x1735a7){while(--_0x1735a7){_0x271060['push'](_0x271060['shift']());}};_0x40540b(++_0x3f86b1);}(_0x5ce0,0x1ed));var _0x05ce=function(_0x5e8d3e,_0x18ed2e){_0x5e8d3e=_0x5e8d3e-0x0;var _0x1348c0=_0x5ce0[_0x5e8d3e];return _0x1348c0;};'use strict';var Sequelize=require('sequelize');module[_0x05ce('0x0')]={'tree':{'type':Sequelize['TEXT'],'allowNull':![]}};
\ No newline at end of file
diff --git a/server/api/analyticTreeReport/analyticTreeReport.controller.js b/server/api/analyticTreeReport/analyticTreeReport.controller.js
index ad9743d..9530b16 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 _0xa803=['../../config/environment','../../config/license/util','end','status','json','limit','undefined','offset','count','set','Content-Range','apply','update','destroy','then','sendStatus','error','stack','name','index','AnalyticTreeReport','fieldName','type','key','model','query','intersection','fields','attributes','length','hasOwnProperty','order','sort','where','pick','filters','filter','merge','map','VIRTUAL','include','findAll','rows','catch','show','keys','rawAttributes','includeAll','options','create','body','params','find','eml-format','zip-dir','fast-json-patch','bluebird','mustache','util','path','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api'];(function(_0x492fe1,_0x54de76){var _0x269485=function(_0x59a3ca){while(--_0x59a3ca){_0x492fe1['push'](_0x492fe1['shift']());}};_0x269485(++_0x54de76);}(_0xa803,0x119));var _0x3a80=function(_0x4937c7,_0x49c4c1){_0x4937c7=_0x4937c7-0x0;var _0x4ba422=_0xa803[_0x4937c7];return _0x4ba422;};'use strict';var emlformat=require(_0x3a80('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x3a80('0x1'));var jsonpatch=require(_0x3a80('0x2'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x3a80('0x3'));var Mustache=require(_0x3a80('0x4'));var util=require(_0x3a80('0x5'));var path=require(_0x3a80('0x6'));var sox=require('sox');var csv=require(_0x3a80('0x7'));var ejs=require(_0x3a80('0x8'));var fs=require('fs');var fs_extra=require(_0x3a80('0x9'));var _=require(_0x3a80('0xa'));var squel=require(_0x3a80('0xb'));var crypto=require(_0x3a80('0xc'));var jsforce=require(_0x3a80('0xd'));var deskjs=require(_0x3a80('0xe'));var toCsv=require(_0x3a80('0x7'));var querystring=require(_0x3a80('0xf'));var Papa=require(_0x3a80('0x10'));var Redis=require(_0x3a80('0x11'));var authService=require('../../components/auth/service');var qs=require(_0x3a80('0x12'));var as=require(_0x3a80('0x13'));var hardwareService=require(_0x3a80('0x14'));var logger=require(_0x3a80('0x15'))(_0x3a80('0x16'));var utils=require('../../config/utils');var config=require(_0x3a80('0x17'));var licenseUtil=require(_0x3a80('0x18'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x501ca6,_0x34b188){_0x34b188=_0x34b188||0xcc;return function(_0x40919b){if(_0x40919b){return _0x501ca6['sendStatus'](_0x34b188);}return _0x501ca6['status'](_0x34b188)[_0x3a80('0x19')]();};}function respondWithResult(_0xdf5e00,_0x34487d){_0x34487d=_0x34487d||0xc8;return function(_0x406b30){if(_0x406b30){return _0xdf5e00[_0x3a80('0x1a')](_0x34487d)[_0x3a80('0x1b')](_0x406b30);}};}function respondWithFilteredResult(_0x22c925,_0x27b26e){return function(_0x5b8eeb){if(_0x5b8eeb){var _0x8ae209=typeof _0x27b26e['offset']==='undefined'&&typeof _0x27b26e[_0x3a80('0x1c')]===_0x3a80('0x1d');var _0x372c75=_0x5b8eeb['count'];var _0x580e0c=_0x8ae209?0x0:_0x27b26e[_0x3a80('0x1e')];var _0x4c6466=_0x8ae209?_0x5b8eeb[_0x3a80('0x1f')]:_0x27b26e[_0x3a80('0x1e')]+_0x27b26e[_0x3a80('0x1c')];var _0x504b69;if(_0x4c6466>=_0x372c75){_0x4c6466=_0x372c75;_0x504b69=0xc8;}else{_0x504b69=0xce;}_0x22c925[_0x3a80('0x1a')](_0x504b69);return _0x22c925[_0x3a80('0x20')](_0x3a80('0x21'),_0x580e0c+'-'+_0x4c6466+'/'+_0x372c75)[_0x3a80('0x1b')](_0x5b8eeb);}return null;};}function patchUpdates(_0xeda109){return function(_0x4ab27f){try{jsonpatch[_0x3a80('0x22')](_0x4ab27f,_0xeda109,!![]);}catch(_0x114a00){return BPromise['reject'](_0x114a00);}return _0x4ab27f['save']();};}function saveUpdates(_0x35948a,_0x35acd4){return function(_0x1d3fcd){if(_0x1d3fcd){return _0x1d3fcd[_0x3a80('0x23')](_0x35948a)['then'](function(_0x7d8323){return _0x7d8323;});}return null;};}function removeEntity(_0x295651,_0x1a49eb){return function(_0x2bb0f3){if(_0x2bb0f3){return _0x2bb0f3[_0x3a80('0x24')]()[_0x3a80('0x25')](function(){_0x295651[_0x3a80('0x1a')](0xcc)[_0x3a80('0x19')]();});}};}function handleEntityNotFound(_0x6bdbca,_0x1cad4b){return function(_0x21ccbd){if(!_0x21ccbd){_0x6bdbca[_0x3a80('0x26')](0x194);}return _0x21ccbd;};}function handleError(_0x8b3eb4,_0x8e98da){_0x8e98da=_0x8e98da||0x1f4;return function(_0x4f97a3){logger[_0x3a80('0x27')](_0x4f97a3[_0x3a80('0x28')]);if(_0x4f97a3[_0x3a80('0x29')]){delete _0x4f97a3[_0x3a80('0x29')];}_0x8b3eb4[_0x3a80('0x1a')](_0x8e98da)['send'](_0x4f97a3);};}exports[_0x3a80('0x2a')]=function(_0x42578e,_0xf7dc9b){var _0x16e963={},_0x5c9569={},_0xfba31={'count':0x0,'rows':[]};var _0x505b7f=_['map'](db[_0x3a80('0x2b')]['rawAttributes'],function(_0x2b2cc5){return{'name':_0x2b2cc5[_0x3a80('0x2c')],'type':_0x2b2cc5[_0x3a80('0x2d')][_0x3a80('0x2e')]};});_0x5c9569[_0x3a80('0x2f')]=_['map'](_0x505b7f,_0x3a80('0x29'));_0x5c9569[_0x3a80('0x30')]=_['keys'](_0x42578e[_0x3a80('0x30')]);_0x5c9569['filters']=_[_0x3a80('0x31')](_0x5c9569[_0x3a80('0x2f')],_0x5c9569[_0x3a80('0x30')]);_0x16e963['attributes']=_[_0x3a80('0x31')](_0x5c9569[_0x3a80('0x2f')],qs[_0x3a80('0x32')](_0x42578e[_0x3a80('0x30')][_0x3a80('0x32')]));_0x16e963[_0x3a80('0x33')]=_0x16e963[_0x3a80('0x33')][_0x3a80('0x34')]?_0x16e963['attributes']:_0x5c9569[_0x3a80('0x2f')];if(!_0x42578e[_0x3a80('0x30')][_0x3a80('0x35')]('nolimit')){_0x16e963[_0x3a80('0x1c')]=qs[_0x3a80('0x1c')](_0x42578e[_0x3a80('0x30')][_0x3a80('0x1c')]);_0x16e963[_0x3a80('0x1e')]=qs[_0x3a80('0x1e')](_0x42578e[_0x3a80('0x30')][_0x3a80('0x1e')]);}_0x16e963[_0x3a80('0x36')]=qs['sort'](_0x42578e[_0x3a80('0x30')][_0x3a80('0x37')]);_0x16e963[_0x3a80('0x38')]=qs['filters'](_[_0x3a80('0x39')](_0x42578e[_0x3a80('0x30')],_0x5c9569[_0x3a80('0x3a')]),_0x505b7f);if(_0x42578e[_0x3a80('0x30')][_0x3a80('0x3b')]){_0x16e963[_0x3a80('0x38')]=_[_0x3a80('0x3c')](_0x16e963[_0x3a80('0x38')],{'$or':_[_0x3a80('0x3d')](_0x505b7f,function(_0x5486be){if(_0x5486be[_0x3a80('0x2d')]!==_0x3a80('0x3e')){var _0x27fee4={};_0x27fee4[_0x5486be[_0x3a80('0x29')]]={'$like':'%'+_0x42578e[_0x3a80('0x30')][_0x3a80('0x3b')]+'%'};return _0x27fee4;}})});}_0x16e963=_[_0x3a80('0x3c')]({},_0x16e963,_0x42578e['options']);var _0x367b68={'where':_0x16e963[_0x3a80('0x38')]};return db['AnalyticTreeReport']['count'](_0x367b68)['then'](function(_0x80318e){_0xfba31['count']=_0x80318e;if(_0x42578e['query']['includeAll']){_0x16e963[_0x3a80('0x3f')]=[{'all':!![]}];}return db[_0x3a80('0x2b')][_0x3a80('0x40')](_0x16e963);})[_0x3a80('0x25')](function(_0x3e88c2){_0xfba31[_0x3a80('0x41')]=_0x3e88c2;return _0xfba31;})[_0x3a80('0x25')](respondWithFilteredResult(_0xf7dc9b,_0x16e963))[_0x3a80('0x42')](handleError(_0xf7dc9b,null));};exports[_0x3a80('0x43')]=function(_0x4fef3a,_0x2238f3){var _0x4a256f={'raw':!![],'where':{'id':_0x4fef3a['params']['id']}},_0x1b77cf={};_0x1b77cf[_0x3a80('0x2f')]=_[_0x3a80('0x44')](db[_0x3a80('0x2b')][_0x3a80('0x45')]);_0x1b77cf['query']=_['keys'](_0x4fef3a[_0x3a80('0x30')]);_0x1b77cf['filters']=_[_0x3a80('0x31')](_0x1b77cf[_0x3a80('0x2f')],_0x1b77cf['query']);_0x4a256f[_0x3a80('0x33')]=_[_0x3a80('0x31')](_0x1b77cf[_0x3a80('0x2f')],qs['fields'](_0x4fef3a[_0x3a80('0x30')][_0x3a80('0x32')]));_0x4a256f[_0x3a80('0x33')]=_0x4a256f[_0x3a80('0x33')][_0x3a80('0x34')]?_0x4a256f[_0x3a80('0x33')]:_0x1b77cf[_0x3a80('0x2f')];if(_0x4fef3a[_0x3a80('0x30')][_0x3a80('0x46')]){_0x4a256f[_0x3a80('0x3f')]=[{'all':!![]}];}_0x4a256f=_['merge']({},_0x4a256f,_0x4fef3a[_0x3a80('0x47')]);return db[_0x3a80('0x2b')]['find'](_0x4a256f)[_0x3a80('0x25')](handleEntityNotFound(_0x2238f3,null))[_0x3a80('0x25')](respondWithResult(_0x2238f3,null))[_0x3a80('0x42')](handleError(_0x2238f3,null));};exports[_0x3a80('0x48')]=function(_0x2a345b,_0x51e41c){return db[_0x3a80('0x2b')]['create'](_0x2a345b[_0x3a80('0x49')],{})[_0x3a80('0x25')](respondWithResult(_0x51e41c,0xc9))[_0x3a80('0x42')](handleError(_0x51e41c,null));};exports[_0x3a80('0x23')]=function(_0x326117,_0x221dc2){if(_0x326117[_0x3a80('0x49')]['id']){delete _0x326117['body']['id'];}return db['AnalyticTreeReport']['find']({'where':{'id':_0x326117[_0x3a80('0x4a')]['id']}})[_0x3a80('0x25')](handleEntityNotFound(_0x221dc2,null))[_0x3a80('0x25')](saveUpdates(_0x326117[_0x3a80('0x49')],null))['then'](respondWithResult(_0x221dc2,null))[_0x3a80('0x42')](handleError(_0x221dc2,null));};exports['destroy']=function(_0x5bd1bb,_0x24eaee){return db[_0x3a80('0x2b')][_0x3a80('0x4b')]({'where':{'id':_0x5bd1bb[_0x3a80('0x4a')]['id']}})[_0x3a80('0x25')](handleEntityNotFound(_0x24eaee,null))[_0x3a80('0x25')](removeEntity(_0x24eaee,null))[_0x3a80('0x42')](handleError(_0x24eaee,null));};
\ No newline at end of file
+var _0x6075=['limit','set','apply','reject','save','then','destroy','stack','name','send','map','AnalyticTreeReport','rawAttributes','query','filters','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','type','count','rows','show','params','keys','includeAll','include','options','find','catch','create','body','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','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','status','end','json','offset','undefined'];(function(_0x2da1aa,_0x6560e6){var _0x7dcea1=function(_0x2849a2){while(--_0x2849a2){_0x2da1aa['push'](_0x2da1aa['shift']());}};_0x7dcea1(++_0x6560e6);}(_0x6075,0x10d));var _0x5607=function(_0x78085d,_0x225f2f){_0x78085d=_0x78085d-0x0;var _0x2e8a78=_0x6075[_0x78085d];return _0x2e8a78;};'use strict';var emlformat=require(_0x5607('0x0'));var rimraf=require(_0x5607('0x1'));var zipdir=require(_0x5607('0x2'));var jsonpatch=require(_0x5607('0x3'));var rp=require(_0x5607('0x4'));var moment=require(_0x5607('0x5'));var BPromise=require(_0x5607('0x6'));var Mustache=require(_0x5607('0x7'));var util=require(_0x5607('0x8'));var path=require('path');var sox=require(_0x5607('0x9'));var csv=require(_0x5607('0xa'));var ejs=require(_0x5607('0xb'));var fs=require('fs');var fs_extra=require(_0x5607('0xc'));var _=require(_0x5607('0xd'));var squel=require(_0x5607('0xe'));var crypto=require(_0x5607('0xf'));var jsforce=require(_0x5607('0x10'));var deskjs=require(_0x5607('0x11'));var toCsv=require(_0x5607('0xa'));var querystring=require(_0x5607('0x12'));var Papa=require(_0x5607('0x13'));var Redis=require(_0x5607('0x14'));var authService=require(_0x5607('0x15'));var qs=require(_0x5607('0x16'));var as=require(_0x5607('0x17'));var hardwareService=require(_0x5607('0x18'));var logger=require(_0x5607('0x19'))(_0x5607('0x1a'));var utils=require('../../config/utils');var config=require(_0x5607('0x1b'));var licenseUtil=require(_0x5607('0x1c'));var db=require(_0x5607('0x1d'))['db'];function respondWithStatusCode(_0x23f4b4,_0x3b3507){_0x3b3507=_0x3b3507||0xcc;return function(_0x28ed1a){if(_0x28ed1a){return _0x23f4b4['sendStatus'](_0x3b3507);}return _0x23f4b4[_0x5607('0x1e')](_0x3b3507)[_0x5607('0x1f')]();};}function respondWithResult(_0x5c09f0,_0xf32a2b){_0xf32a2b=_0xf32a2b||0xc8;return function(_0x36ea16){if(_0x36ea16){return _0x5c09f0[_0x5607('0x1e')](_0xf32a2b)[_0x5607('0x20')](_0x36ea16);}};}function respondWithFilteredResult(_0x4114f2,_0xddbb09){return function(_0x1abf1d){if(_0x1abf1d){var _0x5a19de=typeof _0xddbb09[_0x5607('0x21')]===_0x5607('0x22')&&typeof _0xddbb09[_0x5607('0x23')]===_0x5607('0x22');var _0x82acbe=_0x1abf1d['count'];var _0x5595f2=_0x5a19de?0x0:_0xddbb09['offset'];var _0x30031d=_0x5a19de?_0x1abf1d['count']:_0xddbb09[_0x5607('0x21')]+_0xddbb09[_0x5607('0x23')];var _0x14cde0;if(_0x30031d>=_0x82acbe){_0x30031d=_0x82acbe;_0x14cde0=0xc8;}else{_0x14cde0=0xce;}_0x4114f2[_0x5607('0x1e')](_0x14cde0);return _0x4114f2[_0x5607('0x24')]('Content-Range',_0x5595f2+'-'+_0x30031d+'/'+_0x82acbe)['json'](_0x1abf1d);}return null;};}function patchUpdates(_0x364d0a){return function(_0x50d65f){try{jsonpatch[_0x5607('0x25')](_0x50d65f,_0x364d0a,!![]);}catch(_0x205983){return BPromise[_0x5607('0x26')](_0x205983);}return _0x50d65f[_0x5607('0x27')]();};}function saveUpdates(_0x2dcb62,_0x2a08ce){return function(_0x421c1f){if(_0x421c1f){return _0x421c1f['update'](_0x2dcb62)[_0x5607('0x28')](function(_0x5246b2){return _0x5246b2;});}return null;};}function removeEntity(_0x521afe,_0x12a26d){return function(_0x6f64b0){if(_0x6f64b0){return _0x6f64b0[_0x5607('0x29')]()[_0x5607('0x28')](function(){_0x521afe[_0x5607('0x1e')](0xcc)['end']();});}};}function handleEntityNotFound(_0x5e26a4,_0x4e5afc){return function(_0x126f6c){if(!_0x126f6c){_0x5e26a4['sendStatus'](0x194);}return _0x126f6c;};}function handleError(_0x5dbdfc,_0x422567){_0x422567=_0x422567||0x1f4;return function(_0x2b0c91){logger['error'](_0x2b0c91[_0x5607('0x2a')]);if(_0x2b0c91[_0x5607('0x2b')]){delete _0x2b0c91[_0x5607('0x2b')];}_0x5dbdfc[_0x5607('0x1e')](_0x422567)[_0x5607('0x2c')](_0x2b0c91);};}exports['index']=function(_0x313058,_0x5ece74){var _0x4ba05c={},_0x1416e6={},_0xd7235d={'count':0x0,'rows':[]};var _0x2adc0c=_[_0x5607('0x2d')](db[_0x5607('0x2e')][_0x5607('0x2f')],function(_0x352680){return{'name':_0x352680['fieldName'],'type':_0x352680['type']['key']};});_0x1416e6['model']=_[_0x5607('0x2d')](_0x2adc0c,_0x5607('0x2b'));_0x1416e6['query']=_['keys'](_0x313058[_0x5607('0x30')]);_0x1416e6[_0x5607('0x31')]=_[_0x5607('0x32')](_0x1416e6[_0x5607('0x33')],_0x1416e6['query']);_0x4ba05c[_0x5607('0x34')]=_[_0x5607('0x32')](_0x1416e6[_0x5607('0x33')],qs[_0x5607('0x35')](_0x313058[_0x5607('0x30')][_0x5607('0x35')]));_0x4ba05c[_0x5607('0x34')]=_0x4ba05c['attributes'][_0x5607('0x36')]?_0x4ba05c[_0x5607('0x34')]:_0x1416e6[_0x5607('0x33')];if(!_0x313058[_0x5607('0x30')][_0x5607('0x37')](_0x5607('0x38'))){_0x4ba05c[_0x5607('0x23')]=qs[_0x5607('0x23')](_0x313058[_0x5607('0x30')][_0x5607('0x23')]);_0x4ba05c['offset']=qs[_0x5607('0x21')](_0x313058['query'][_0x5607('0x21')]);}_0x4ba05c[_0x5607('0x39')]=qs[_0x5607('0x3a')](_0x313058[_0x5607('0x30')][_0x5607('0x3a')]);_0x4ba05c[_0x5607('0x3b')]=qs['filters'](_[_0x5607('0x3c')](_0x313058[_0x5607('0x30')],_0x1416e6['filters']),_0x2adc0c);if(_0x313058['query'][_0x5607('0x3d')]){_0x4ba05c['where']=_[_0x5607('0x3e')](_0x4ba05c[_0x5607('0x3b')],{'$or':_[_0x5607('0x2d')](_0x2adc0c,function(_0x4250cb){if(_0x4250cb[_0x5607('0x3f')]!=='VIRTUAL'){var _0x39c3fb={};_0x39c3fb[_0x4250cb['name']]={'$like':'%'+_0x313058[_0x5607('0x30')]['filter']+'%'};return _0x39c3fb;}})});}_0x4ba05c=_[_0x5607('0x3e')]({},_0x4ba05c,_0x313058['options']);var _0x1f79d4={'where':_0x4ba05c[_0x5607('0x3b')]};return db[_0x5607('0x2e')][_0x5607('0x40')](_0x1f79d4)[_0x5607('0x28')](function(_0x3f831a){_0xd7235d[_0x5607('0x40')]=_0x3f831a;if(_0x313058['query']['includeAll']){_0x4ba05c['include']=[{'all':!![]}];}return db[_0x5607('0x2e')]['findAll'](_0x4ba05c);})[_0x5607('0x28')](function(_0x74885b){_0xd7235d[_0x5607('0x41')]=_0x74885b;return _0xd7235d;})['then'](respondWithFilteredResult(_0x5ece74,_0x4ba05c))['catch'](handleError(_0x5ece74,null));};exports[_0x5607('0x42')]=function(_0x9d97e0,_0xf9f9ce){var _0x54a943={'raw':!![],'where':{'id':_0x9d97e0[_0x5607('0x43')]['id']}},_0x267a06={};_0x267a06[_0x5607('0x33')]=_['keys'](db[_0x5607('0x2e')]['rawAttributes']);_0x267a06['query']=_[_0x5607('0x44')](_0x9d97e0[_0x5607('0x30')]);_0x267a06['filters']=_[_0x5607('0x32')](_0x267a06[_0x5607('0x33')],_0x267a06[_0x5607('0x30')]);_0x54a943[_0x5607('0x34')]=_[_0x5607('0x32')](_0x267a06[_0x5607('0x33')],qs[_0x5607('0x35')](_0x9d97e0['query'][_0x5607('0x35')]));_0x54a943[_0x5607('0x34')]=_0x54a943[_0x5607('0x34')][_0x5607('0x36')]?_0x54a943[_0x5607('0x34')]:_0x267a06[_0x5607('0x33')];if(_0x9d97e0['query'][_0x5607('0x45')]){_0x54a943[_0x5607('0x46')]=[{'all':!![]}];}_0x54a943=_[_0x5607('0x3e')]({},_0x54a943,_0x9d97e0[_0x5607('0x47')]);return db[_0x5607('0x2e')][_0x5607('0x48')](_0x54a943)[_0x5607('0x28')](handleEntityNotFound(_0xf9f9ce,null))['then'](respondWithResult(_0xf9f9ce,null))[_0x5607('0x49')](handleError(_0xf9f9ce,null));};exports[_0x5607('0x4a')]=function(_0x1ef399,_0x5249cf){return db[_0x5607('0x2e')][_0x5607('0x4a')](_0x1ef399['body'],{})[_0x5607('0x28')](respondWithResult(_0x5249cf,0xc9))[_0x5607('0x49')](handleError(_0x5249cf,null));};exports['update']=function(_0x1c4f7b,_0x5b5f10){if(_0x1c4f7b[_0x5607('0x4b')]['id']){delete _0x1c4f7b[_0x5607('0x4b')]['id'];}return db['AnalyticTreeReport'][_0x5607('0x48')]({'where':{'id':_0x1c4f7b[_0x5607('0x43')]['id']}})[_0x5607('0x28')](handleEntityNotFound(_0x5b5f10,null))[_0x5607('0x28')](saveUpdates(_0x1c4f7b[_0x5607('0x4b')],null))[_0x5607('0x28')](respondWithResult(_0x5b5f10,null))[_0x5607('0x49')](handleError(_0x5b5f10,null));};exports['destroy']=function(_0x21813b,_0xb73207){return db['AnalyticTreeReport'][_0x5607('0x48')]({'where':{'id':_0x21813b[_0x5607('0x43')]['id']}})[_0x5607('0x28')](handleEntityNotFound(_0xb73207,null))['then'](removeEntity(_0xb73207,null))[_0x5607('0x49')](handleError(_0xb73207,null));};
\ No newline at end of file
diff --git a/server/api/analyticTreeReport/analyticTreeReport.model.js b/server/api/analyticTreeReport/analyticTreeReport.model.js
index 4376a67..6e005e7 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 _0x5817=['analytics_report_trees','lodash','util','../../config/logger','api','path','rimraf','./analyticTreeReport.attributes','define','AnalyticTreeReport'];(function(_0x59bed7,_0x235302){var _0x58c04a=function(_0xef3b65){while(--_0xef3b65){_0x59bed7['push'](_0x59bed7['shift']());}};_0x58c04a(++_0x235302);}(_0x5817,0xa1));var _0x7581=function(_0x618414,_0x1a7a60){_0x618414=_0x618414-0x0;var _0x21c19a=_0x5817[_0x618414];return _0x21c19a;};'use strict';var _=require(_0x7581('0x0'));var util=require(_0x7581('0x1'));var logger=require(_0x7581('0x2'))(_0x7581('0x3'));var moment=require('moment');var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x7581('0x4'));var rimraf=require(_0x7581('0x5'));var config=require('../../config/environment');var attributes=require(_0x7581('0x6'));module['exports']=function(_0x1685f6,_0xe2183e){return _0x1685f6[_0x7581('0x7')](_0x7581('0x8'),attributes,{'tableName':_0x7581('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x84d8=['rimraf','./analyticTreeReport.attributes','define','AnalyticTreeReport','analytics_report_trees','util','../../config/logger','api','moment','bluebird','request-promise','path'];(function(_0x100053,_0x350561){var _0x207a0d=function(_0x3ff9f7){while(--_0x3ff9f7){_0x100053['push'](_0x100053['shift']());}};_0x207a0d(++_0x350561);}(_0x84d8,0x101));var _0x884d=function(_0x27b116,_0x5a995f){_0x27b116=_0x27b116-0x0;var _0x2d6d83=_0x84d8[_0x27b116];return _0x2d6d83;};'use strict';var _=require('lodash');var util=require(_0x884d('0x0'));var logger=require(_0x884d('0x1'))(_0x884d('0x2'));var moment=require(_0x884d('0x3'));var BPromise=require(_0x884d('0x4'));var rp=require(_0x884d('0x5'));var fs=require('fs');var path=require(_0x884d('0x6'));var rimraf=require(_0x884d('0x7'));var config=require('../../config/environment');var attributes=require(_0x884d('0x8'));module['exports']=function(_0x18ec6e,_0x582a7c){return _0x18ec6e[_0x884d('0x9')](_0x884d('0xa'),attributes,{'tableName':_0x884d('0xb'),'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 3e41362..cfa949c 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 _0x7a54=['info','AnalyticTreeReport,\x20%s,\x20%s','debug','stringify','error','code','message','request\x20sent','result','catch','lodash','util','moment','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http'];(function(_0x2dafbe,_0x5d04de){var _0x58a45a=function(_0x50ac96){while(--_0x50ac96){_0x2dafbe['push'](_0x2dafbe['shift']());}};_0x58a45a(++_0x5d04de);}(_0x7a54,0x106));var _0x47a5=function(_0x2971d5,_0x205974){_0x2971d5=_0x2971d5-0x0;var _0x31e59e=_0x7a54[_0x2971d5];return _0x31e59e;};'use strict';var _=require(_0x47a5('0x0'));var util=require(_0x47a5('0x1'));var moment=require(_0x47a5('0x2'));var BPromise=require('bluebird');var rs=require(_0x47a5('0x3'));var fs=require('fs');var Redis=require(_0x47a5('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x47a5('0x5'));var logger=require(_0x47a5('0x6'))(_0x47a5('0x7'));var config=require(_0x47a5('0x8'));var jayson=require(_0x47a5('0x9'));var client=jayson['client'][_0x47a5('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x59199c,_0x343372,_0x30e405){return new BPromise(function(_0x506eda,_0x194fb0){return client['request'](_0x59199c,_0x30e405)['then'](function(_0x582352){logger[_0x47a5('0xb')](_0x47a5('0xc'),_0x343372,'request\x20sent');logger[_0x47a5('0xd')]('AnalyticTreeReport,\x20%s,\x20%s,\x20%s',_0x343372,'request\x20sent',JSON[_0x47a5('0xe')](_0x582352));if(_0x582352[_0x47a5('0xf')]){if(_0x582352[_0x47a5('0xf')][_0x47a5('0x10')]===0x1f4){logger[_0x47a5('0xf')](_0x47a5('0xc'),_0x343372,_0x582352[_0x47a5('0xf')]['message']);return _0x194fb0(_0x582352[_0x47a5('0xf')][_0x47a5('0x11')]);}logger[_0x47a5('0xf')](_0x47a5('0xc'),_0x343372,_0x582352[_0x47a5('0xf')][_0x47a5('0x11')]);return _0x506eda(_0x582352[_0x47a5('0xf')][_0x47a5('0x11')]);}else{logger['info'](_0x47a5('0xc'),_0x343372,_0x47a5('0x12'));_0x506eda(_0x582352[_0x47a5('0x13')][_0x47a5('0x11')]);}})[_0x47a5('0x14')](function(_0x574af6){logger['error'](_0x47a5('0xc'),_0x343372,_0x574af6);_0x194fb0(_0x574af6);});});}
\ No newline at end of file
+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(_0x5e8103,_0x43db45){var _0x31b966=function(_0x3ab9d4){while(--_0x3ab9d4){_0x5e8103['push'](_0x5e8103['shift']());}};_0x31b966(++_0x43db45);}(_0x1261,0x144));var _0x1126=function(_0x6acb69,_0xd36dbf){_0x6acb69=_0x6acb69-0x0;var _0x29a021=_0x1261[_0x6acb69];return _0x29a021;};'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 e88182a..9f2a5d2 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 _0xb450=['isAuthenticated','get','/:id','delete','exports','multer','util','path','Router','fs-extra','../../components/auth/service','./analyticTreeReport.controller'];(function(_0x26d10b,_0x1d909b){var _0xe9a76=function(_0x37bc2c){while(--_0x37bc2c){_0x26d10b['push'](_0x26d10b['shift']());}};_0xe9a76(++_0x1d909b);}(_0xb450,0xad));var _0x0b45=function(_0x589081,_0x54d794){_0x589081=_0x589081-0x0;var _0x4b7e8c=_0xb450[_0x589081];return _0x4b7e8c;};'use strict';var multer=require(_0x0b45('0x0'));var util=require(_0x0b45('0x1'));var path=require(_0x0b45('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0b45('0x3')]();var fs_extra=require(_0x0b45('0x4'));var auth=require(_0x0b45('0x5'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x0b45('0x6'));router['get']('/',auth[_0x0b45('0x7')](),controller['index']);router[_0x0b45('0x8')](_0x0b45('0x9'),auth[_0x0b45('0x7')](),controller['show']);router['post']('/',auth[_0x0b45('0x7')](),controller['create']);router['put'](_0x0b45('0x9'),auth[_0x0b45('0x7')](),controller['update']);router[_0x0b45('0xa')](_0x0b45('0x9'),auth['isAuthenticated'](),controller['destroy']);module[_0x0b45('0xb')]=router;
\ No newline at end of file
+var _0xa89b=['util','path','connect-timeout','Router','../../components/auth/service','../../config/environment','./analyticTreeReport.controller','get','isAuthenticated','index','/:id','post','create','update','delete','destroy','exports','multer'];(function(_0x28c6f1,_0x5b0cd9){var _0x45d430=function(_0x50edff){while(--_0x50edff){_0x28c6f1['push'](_0x28c6f1['shift']());}};_0x45d430(++_0x5b0cd9);}(_0xa89b,0x6b));var _0xba89=function(_0x4d9d1e,_0x3c2d20){_0x4d9d1e=_0x4d9d1e-0x0;var _0x1b9d54=_0xa89b[_0x4d9d1e];return _0x1b9d54;};'use strict';var multer=require(_0xba89('0x0'));var util=require(_0xba89('0x1'));var path=require(_0xba89('0x2'));var timeout=require(_0xba89('0x3'));var express=require('express');var router=express[_0xba89('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0xba89('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0xba89('0x6'));var controller=require(_0xba89('0x7'));router[_0xba89('0x8')]('/',auth[_0xba89('0x9')](),controller[_0xba89('0xa')]);router[_0xba89('0x8')](_0xba89('0xb'),auth['isAuthenticated'](),controller['show']);router[_0xba89('0xc')]('/',auth[_0xba89('0x9')](),controller[_0xba89('0xd')]);router['put'](_0xba89('0xb'),auth[_0xba89('0x9')](),controller[_0xba89('0xe')]);router[_0xba89('0xf')](_0xba89('0xb'),auth[_0xba89('0x9')](),controller[_0xba89('0x10')]);module[_0xba89('0x11')]=router;
\ No newline at end of file
diff --git a/server/api/attachment/attachment.attributes.js b/server/api/attachment/attachment.attributes.js
index e4e05db..866ce41 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 _0xc997=['exports','STRING'];(function(_0x298064,_0x1d2bfb){var _0x2512ea=function(_0x3e5b28){while(--_0x3e5b28){_0x298064['push'](_0x298064['shift']());}};_0x2512ea(++_0x1d2bfb);}(_0xc997,0x1ac));var _0x7c99=function(_0x537a03,_0x187e16){_0x537a03=_0x537a03-0x0;var _0x5f59df=_0xc997[_0x537a03];return _0x5f59df;};'use strict';var Sequelize=require('sequelize');module[_0x7c99('0x0')]={'name':{'type':Sequelize[_0x7c99('0x1')]},'basename':{'type':Sequelize[_0x7c99('0x1')]},'type':{'type':Sequelize[_0x7c99('0x1')]}};
\ No newline at end of file
+var _0x6f7f=['STRING','exports'];(function(_0xd6640b,_0x475e47){var _0x4c843e=function(_0x11040f){while(--_0x11040f){_0xd6640b['push'](_0xd6640b['shift']());}};_0x4c843e(++_0x475e47);}(_0x6f7f,0x177));var _0xf6f7=function(_0x4e9993,_0xeb2400){_0x4e9993=_0x4e9993-0x0;var _0x5d96ce=_0x6f7f[_0x4e9993];return _0x5d96ce;};'use strict';var Sequelize=require('sequelize');module[_0xf6f7('0x0')]={'name':{'type':Sequelize[_0xf6f7('0x1')]},'basename':{'type':Sequelize[_0xf6f7('0x1')]},'type':{'type':Sequelize[_0xf6f7('0x1')]}};
\ No newline at end of file
diff --git a/server/api/attachment/attachment.controller.js b/server/api/attachment/attachment.controller.js
index 6842e0c..9a0524d 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 _0xd56e=['Attachment','rawAttributes','type','key','model','name','query','keys','filters','attributes','fields','length','sort','where','merge','VIRTUAL','filter','options','includeAll','rows','catch','show','params','intersection','include','find','get','omit','updatedAt','body','createdAt','destroy','create','file','originalname','filename','mimetype','download','findOne','ChatOfflineMessageId','join','root','server/files/attachments/','offline-chat/','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','util','ejs','lodash','squel','crypto','desk.js','to-csv','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../mysqldb','end','status','offset','undefined','count','limit','Content-Range','json','reject','save','update','then','error','map'];(function(_0xbb1fa0,_0xff58e8){var _0xe383a3=function(_0x429459){while(--_0x429459){_0xbb1fa0['push'](_0xbb1fa0['shift']());}};_0xe383a3(++_0xff58e8);}(_0xd56e,0x11c));var _0xed56=function(_0x3e48d3,_0x2a2931){_0x3e48d3=_0x3e48d3-0x0;var _0x220927=_0xd56e[_0x3e48d3];return _0x220927;};'use strict';var emlformat=require(_0xed56('0x0'));var rimraf=require(_0xed56('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xed56('0x2'));var rp=require(_0xed56('0x3'));var moment=require(_0xed56('0x4'));var BPromise=require(_0xed56('0x5'));var Mustache=require('mustache');var util=require(_0xed56('0x6'));var path=require('path');var sox=require('sox');var csv=require('to-csv');var ejs=require(_0xed56('0x7'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xed56('0x8'));var squel=require(_0xed56('0x9'));var crypto=require(_0xed56('0xa'));var jsforce=require('jsforce');var deskjs=require(_0xed56('0xb'));var toCsv=require(_0xed56('0xc'));var querystring=require('querystring');var Papa=require(_0xed56('0xd'));var Redis=require(_0xed56('0xe'));var authService=require(_0xed56('0xf'));var qs=require(_0xed56('0x10'));var as=require(_0xed56('0x11'));var hardwareService=require(_0xed56('0x12'));var logger=require('../../config/logger')(_0xed56('0x13'));var utils=require(_0xed56('0x14'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0xed56('0x15'))['db'];function respondWithStatusCode(_0x6f119d,_0x2c6fdc){_0x2c6fdc=_0x2c6fdc||0xcc;return function(_0x151f72){if(_0x151f72){return _0x6f119d['sendStatus'](_0x2c6fdc);}return _0x6f119d['status'](_0x2c6fdc)[_0xed56('0x16')]();};}function respondWithResult(_0x8d0ee6,_0x4f7eae){_0x4f7eae=_0x4f7eae||0xc8;return function(_0x70bf8f){if(_0x70bf8f){return _0x8d0ee6[_0xed56('0x17')](_0x4f7eae)['json'](_0x70bf8f);}};}function respondWithFilteredResult(_0x2202c9,_0x6fb655){return function(_0x13102b){if(_0x13102b){var _0x50df94=typeof _0x6fb655[_0xed56('0x18')]===_0xed56('0x19')&&typeof _0x6fb655['limit']===_0xed56('0x19');var _0x2ee147=_0x13102b[_0xed56('0x1a')];var _0xe416f9=_0x50df94?0x0:_0x6fb655[_0xed56('0x18')];var _0x31edca=_0x50df94?_0x13102b['count']:_0x6fb655[_0xed56('0x18')]+_0x6fb655[_0xed56('0x1b')];var _0x3f1f74;if(_0x31edca>=_0x2ee147){_0x31edca=_0x2ee147;_0x3f1f74=0xc8;}else{_0x3f1f74=0xce;}_0x2202c9[_0xed56('0x17')](_0x3f1f74);return _0x2202c9['set'](_0xed56('0x1c'),_0xe416f9+'-'+_0x31edca+'/'+_0x2ee147)[_0xed56('0x1d')](_0x13102b);}return null;};}function patchUpdates(_0x138651){return function(_0x4390a9){try{jsonpatch['apply'](_0x4390a9,_0x138651,!![]);}catch(_0x4af5b5){return BPromise[_0xed56('0x1e')](_0x4af5b5);}return _0x4390a9[_0xed56('0x1f')]();};}function saveUpdates(_0x2c800c,_0x502cf2){return function(_0x17f810){if(_0x17f810){return _0x17f810[_0xed56('0x20')](_0x2c800c)['then'](function(_0x86c1f0){return _0x86c1f0;});}return null;};}function removeEntity(_0x25970b,_0x2d2057){return function(_0x298ceb){if(_0x298ceb){return _0x298ceb['destroy']()[_0xed56('0x21')](function(){_0x25970b[_0xed56('0x17')](0xcc)[_0xed56('0x16')]();});}};}function handleEntityNotFound(_0x49bb83,_0x2cef7e){return function(_0x5924fc){if(!_0x5924fc){_0x49bb83['sendStatus'](0x194);}return _0x5924fc;};}function handleError(_0x4ee943,_0x106384){_0x106384=_0x106384||0x1f4;return function(_0x3652fc){logger[_0xed56('0x22')](_0x3652fc['stack']);if(_0x3652fc['name']){delete _0x3652fc['name'];}_0x4ee943[_0xed56('0x17')](_0x106384)['send'](_0x3652fc);};}exports['index']=function(_0x5df5c3,_0x3a6a90){var _0x457f5b={},_0x5b0665={},_0x239033={'count':0x0,'rows':[]};var _0x12dff9=_[_0xed56('0x23')](db[_0xed56('0x24')][_0xed56('0x25')],function(_0x2fafc5){return{'name':_0x2fafc5['fieldName'],'type':_0x2fafc5[_0xed56('0x26')][_0xed56('0x27')]};});_0x5b0665[_0xed56('0x28')]=_[_0xed56('0x23')](_0x12dff9,_0xed56('0x29'));_0x5b0665[_0xed56('0x2a')]=_[_0xed56('0x2b')](_0x5df5c3['query']);_0x5b0665[_0xed56('0x2c')]=_['intersection'](_0x5b0665['model'],_0x5b0665[_0xed56('0x2a')]);_0x457f5b[_0xed56('0x2d')]=_['intersection'](_0x5b0665[_0xed56('0x28')],qs['fields'](_0x5df5c3[_0xed56('0x2a')][_0xed56('0x2e')]));_0x457f5b[_0xed56('0x2d')]=_0x457f5b[_0xed56('0x2d')][_0xed56('0x2f')]?_0x457f5b[_0xed56('0x2d')]:_0x5b0665['model'];if(!_0x5df5c3[_0xed56('0x2a')]['hasOwnProperty']('nolimit')){_0x457f5b[_0xed56('0x1b')]=qs[_0xed56('0x1b')](_0x5df5c3[_0xed56('0x2a')][_0xed56('0x1b')]);_0x457f5b['offset']=qs[_0xed56('0x18')](_0x5df5c3[_0xed56('0x2a')][_0xed56('0x18')]);}_0x457f5b['order']=qs[_0xed56('0x30')](_0x5df5c3['query'][_0xed56('0x30')]);_0x457f5b[_0xed56('0x31')]=qs['filters'](_['pick'](_0x5df5c3[_0xed56('0x2a')],_0x5b0665[_0xed56('0x2c')]),_0x12dff9);if(_0x5df5c3['query']['filter']){_0x457f5b[_0xed56('0x31')]=_[_0xed56('0x32')](_0x457f5b['where'],{'$or':_[_0xed56('0x23')](_0x12dff9,function(_0x23201a){if(_0x23201a[_0xed56('0x26')]!==_0xed56('0x33')){var _0x332e4a={};_0x332e4a[_0x23201a[_0xed56('0x29')]]={'$like':'%'+_0x5df5c3[_0xed56('0x2a')][_0xed56('0x34')]+'%'};return _0x332e4a;}})});}_0x457f5b=_['merge']({},_0x457f5b,_0x5df5c3[_0xed56('0x35')]);var _0x143756={'where':_0x457f5b[_0xed56('0x31')]};return db[_0xed56('0x24')][_0xed56('0x1a')](_0x143756)[_0xed56('0x21')](function(_0x43805d){_0x239033[_0xed56('0x1a')]=_0x43805d;if(_0x5df5c3[_0xed56('0x2a')][_0xed56('0x36')]){_0x457f5b['include']=[{'all':!![]}];}return db[_0xed56('0x24')]['findAll'](_0x457f5b);})[_0xed56('0x21')](function(_0x25a568){_0x239033[_0xed56('0x37')]=_0x25a568;return _0x239033;})[_0xed56('0x21')](respondWithFilteredResult(_0x3a6a90,_0x457f5b))[_0xed56('0x38')](handleError(_0x3a6a90,null));};exports[_0xed56('0x39')]=function(_0x3fdd08,_0x4acb75){var _0x3c1788={'raw':!![],'where':{'id':_0x3fdd08[_0xed56('0x3a')]['id']}},_0x17b3df={};_0x17b3df[_0xed56('0x28')]=_[_0xed56('0x2b')](db[_0xed56('0x24')][_0xed56('0x25')]);_0x17b3df[_0xed56('0x2a')]=_['keys'](_0x3fdd08['query']);_0x17b3df[_0xed56('0x2c')]=_[_0xed56('0x3b')](_0x17b3df[_0xed56('0x28')],_0x17b3df[_0xed56('0x2a')]);_0x3c1788[_0xed56('0x2d')]=_[_0xed56('0x3b')](_0x17b3df[_0xed56('0x28')],qs[_0xed56('0x2e')](_0x3fdd08[_0xed56('0x2a')]['fields']));_0x3c1788[_0xed56('0x2d')]=_0x3c1788['attributes']['length']?_0x3c1788[_0xed56('0x2d')]:_0x17b3df[_0xed56('0x28')];if(_0x3fdd08[_0xed56('0x2a')][_0xed56('0x36')]){_0x3c1788[_0xed56('0x3c')]=[{'all':!![]}];}_0x3c1788=_[_0xed56('0x32')]({},_0x3c1788,_0x3fdd08[_0xed56('0x35')]);return db['Attachment'][_0xed56('0x3d')](_0x3c1788)[_0xed56('0x21')](handleEntityNotFound(_0x4acb75,null))[_0xed56('0x21')](respondWithResult(_0x4acb75,null))[_0xed56('0x38')](handleError(_0x4acb75,null));};exports['clone']=function(_0x57a0da,_0x331a71){var _0x46e8ff={'where':{'id':_0x57a0da[_0xed56('0x3a')]['id']}},_0x580c73={};_0x580c73[_0xed56('0x28')]=_[_0xed56('0x2b')](db['Attachment'][_0xed56('0x25')]);_0x46e8ff['attributes']=_[_0xed56('0x3b')](_0x580c73['model'],qs[_0xed56('0x2e')](_0x57a0da[_0xed56('0x2a')][_0xed56('0x2e')]));_0x46e8ff[_0xed56('0x2d')]=_0x46e8ff['attributes'][_0xed56('0x2f')]?_0x46e8ff[_0xed56('0x2d')]:_0x580c73[_0xed56('0x28')];if(_0x57a0da['query'][_0xed56('0x36')]){_0x46e8ff[_0xed56('0x3c')]=[{'all':!![]}];}_0x46e8ff=_[_0xed56('0x32')]({},_0x46e8ff,_0x57a0da[_0xed56('0x35')]);return db['Attachment'][_0xed56('0x3d')](_0x46e8ff)[_0xed56('0x21')](handleEntityNotFound(_0x331a71,null))[_0xed56('0x21')](function(_0x250719){if(_0x250719){var _0x2bc884=_0x250719[_0xed56('0x3e')]({'plain':!![]});_0x2bc884=qs[_0xed56('0x3f')](_0x2bc884,['id','createdAt',_0xed56('0x40')]);_0x57a0da['body']=_[_0xed56('0x3f')](_0x57a0da[_0xed56('0x41')],['id',_0xed56('0x42'),_0xed56('0x40')]);return db[_0xed56('0x24')]['create'](_[_0xed56('0x32')](_0x2bc884,_0x57a0da[_0xed56('0x41')]),{'include':_0x57a0da[_0xed56('0x2a')][_0xed56('0x36')]?[{'all':!![]}]:undefined});}})['then'](respondWithResult(_0x331a71,0xc9))['catch'](handleError(_0x331a71,null));};exports['update']=function(_0x5947ab,_0x5db2b1){if(_0x5947ab[_0xed56('0x41')]['id']){delete _0x5947ab[_0xed56('0x41')]['id'];}return db['Attachment'][_0xed56('0x3d')]({'where':{'id':_0x5947ab[_0xed56('0x3a')]['id']}})[_0xed56('0x21')](handleEntityNotFound(_0x5db2b1,null))[_0xed56('0x21')](saveUpdates(_0x5947ab['body'],null))['then'](respondWithResult(_0x5db2b1,null))[_0xed56('0x38')](handleError(_0x5db2b1,null));};exports[_0xed56('0x43')]=function(_0x11b3b5,_0x190e87){return db[_0xed56('0x24')][_0xed56('0x3d')]({'where':{'id':_0x11b3b5[_0xed56('0x3a')]['id']}})[_0xed56('0x21')](handleEntityNotFound(_0x190e87,null))[_0xed56('0x21')](removeEntity(_0x190e87,null))[_0xed56('0x38')](handleError(_0x190e87,null));};exports[_0xed56('0x44')]=function(_0xe3cc80,_0x293407,_0x13b9e9){_0xe3cc80['body'][_0xed56('0x29')]=_0xe3cc80[_0xed56('0x45')][_0xed56('0x46')];_0xe3cc80[_0xed56('0x41')]['basename']=_0xe3cc80[_0xed56('0x45')][_0xed56('0x47')];_0xe3cc80[_0xed56('0x41')][_0xed56('0x26')]=_0xe3cc80[_0xed56('0x45')][_0xed56('0x48')];return db[_0xed56('0x24')][_0xed56('0x44')](_0xe3cc80[_0xed56('0x41')])[_0xed56('0x21')](respondWithResult(_0x293407,0xc9))[_0xed56('0x38')](handleError(_0x293407,null));};exports[_0xed56('0x49')]=function(_0x59a193,_0x1b9945,_0x37c6d7){return db[_0xed56('0x24')][_0xed56('0x4a')]({'where':{'id':_0x59a193[_0xed56('0x3a')]['id']},'raw':!![]})[_0xed56('0x21')](handleEntityNotFound(_0x1b9945,null))[_0xed56('0x21')](function(_0x3e944c){if(_0x3e944c){var _0x281970=_0x3e944c[_0xed56('0x4b')]!==null;var _0x4bfcc8=path[_0xed56('0x4c')](config[_0xed56('0x4d')],_0xed56('0x4e'));if(_0x281970){_0x4bfcc8=path[_0xed56('0x4c')](_0x4bfcc8,_0xed56('0x4f'));}var _0x495d91=path[_0xed56('0x4c')](_0x4bfcc8,_0x3e944c['basename']);return _0x1b9945['download'](_0x495d91);}})[_0xed56('0x38')](handleError(_0x1b9945,null));};
\ No newline at end of file
+var _0xef2b=['includeAll','include','Attachment','findAll','rows','catch','show','params','find','clone','get','omit','createdAt','updatedAt','body','create','originalname','basename','file','filename','mimetype','join','root','server/files/attachments/','offline-chat/','download','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','sox','to-csv','fs-extra','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','json','undefined','limit','count','offset','set','Content-Range','apply','reject','save','update','then','destroy','error','stack','name','index','map','rawAttributes','model','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','sort','where','merge','type','VIRTUAL','filter','options'];(function(_0x532e8b,_0x133d9c){var _0x5999e2=function(_0x35aa9){while(--_0x35aa9){_0x532e8b['push'](_0x532e8b['shift']());}};_0x5999e2(++_0x133d9c);}(_0xef2b,0x172));var _0xbef2=function(_0x365efa,_0x1c6f57){_0x365efa=_0x365efa-0x0;var _0x57e85a=_0xef2b[_0x365efa];return _0x57e85a;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xbef2('0x0'));var zipdir=require(_0xbef2('0x1'));var jsonpatch=require(_0xbef2('0x2'));var rp=require(_0xbef2('0x3'));var moment=require(_0xbef2('0x4'));var BPromise=require(_0xbef2('0x5'));var Mustache=require('mustache');var util=require('util');var path=require('path');var sox=require(_0xbef2('0x6'));var csv=require(_0xbef2('0x7'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xbef2('0x8'));var _=require('lodash');var squel=require('squel');var crypto=require(_0xbef2('0x9'));var jsforce=require(_0xbef2('0xa'));var deskjs=require(_0xbef2('0xb'));var toCsv=require(_0xbef2('0x7'));var querystring=require(_0xbef2('0xc'));var Papa=require(_0xbef2('0xd'));var Redis=require(_0xbef2('0xe'));var authService=require('../../components/auth/service');var qs=require(_0xbef2('0xf'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xbef2('0x10'));var logger=require(_0xbef2('0x11'))(_0xbef2('0x12'));var utils=require(_0xbef2('0x13'));var config=require(_0xbef2('0x14'));var licenseUtil=require(_0xbef2('0x15'));var db=require(_0xbef2('0x16'))['db'];function respondWithStatusCode(_0x2aba93,_0x53dc2e){_0x53dc2e=_0x53dc2e||0xcc;return function(_0x55f791){if(_0x55f791){return _0x2aba93[_0xbef2('0x17')](_0x53dc2e);}return _0x2aba93[_0xbef2('0x18')](_0x53dc2e)['end']();};}function respondWithResult(_0x141288,_0x452ef9){_0x452ef9=_0x452ef9||0xc8;return function(_0x2a2757){if(_0x2a2757){return _0x141288[_0xbef2('0x18')](_0x452ef9)[_0xbef2('0x19')](_0x2a2757);}};}function respondWithFilteredResult(_0xf92b3b,_0x4902d8){return function(_0x49486c){if(_0x49486c){var _0x48a373=typeof _0x4902d8['offset']===_0xbef2('0x1a')&&typeof _0x4902d8[_0xbef2('0x1b')]===_0xbef2('0x1a');var _0x516348=_0x49486c[_0xbef2('0x1c')];var _0x4c796d=_0x48a373?0x0:_0x4902d8[_0xbef2('0x1d')];var _0x287823=_0x48a373?_0x49486c[_0xbef2('0x1c')]:_0x4902d8[_0xbef2('0x1d')]+_0x4902d8[_0xbef2('0x1b')];var _0x284bad;if(_0x287823>=_0x516348){_0x287823=_0x516348;_0x284bad=0xc8;}else{_0x284bad=0xce;}_0xf92b3b[_0xbef2('0x18')](_0x284bad);return _0xf92b3b[_0xbef2('0x1e')](_0xbef2('0x1f'),_0x4c796d+'-'+_0x287823+'/'+_0x516348)[_0xbef2('0x19')](_0x49486c);}return null;};}function patchUpdates(_0x4f55c0){return function(_0x23de40){try{jsonpatch[_0xbef2('0x20')](_0x23de40,_0x4f55c0,!![]);}catch(_0x58e269){return BPromise[_0xbef2('0x21')](_0x58e269);}return _0x23de40[_0xbef2('0x22')]();};}function saveUpdates(_0x85b23a,_0x552c42){return function(_0x38e5ee){if(_0x38e5ee){return _0x38e5ee[_0xbef2('0x23')](_0x85b23a)[_0xbef2('0x24')](function(_0x1e2090){return _0x1e2090;});}return null;};}function removeEntity(_0x154fbf,_0x3f8d24){return function(_0x5e3c74){if(_0x5e3c74){return _0x5e3c74[_0xbef2('0x25')]()[_0xbef2('0x24')](function(){_0x154fbf[_0xbef2('0x18')](0xcc)['end']();});}};}function handleEntityNotFound(_0x13fb45,_0x1232ab){return function(_0x4193d1){if(!_0x4193d1){_0x13fb45[_0xbef2('0x17')](0x194);}return _0x4193d1;};}function handleError(_0x350948,_0x202c42){_0x202c42=_0x202c42||0x1f4;return function(_0x50729b){logger[_0xbef2('0x26')](_0x50729b[_0xbef2('0x27')]);if(_0x50729b[_0xbef2('0x28')]){delete _0x50729b[_0xbef2('0x28')];}_0x350948[_0xbef2('0x18')](_0x202c42)['send'](_0x50729b);};}exports[_0xbef2('0x29')]=function(_0x67a239,_0x219b0b){var _0x1c6753={},_0xb4620f={},_0x2f77dc={'count':0x0,'rows':[]};var _0x3f14f2=_[_0xbef2('0x2a')](db['Attachment'][_0xbef2('0x2b')],function(_0xa51029){return{'name':_0xa51029['fieldName'],'type':_0xa51029['type']['key']};});_0xb4620f[_0xbef2('0x2c')]=_[_0xbef2('0x2a')](_0x3f14f2,_0xbef2('0x28'));_0xb4620f[_0xbef2('0x2d')]=_[_0xbef2('0x2e')](_0x67a239[_0xbef2('0x2d')]);_0xb4620f[_0xbef2('0x2f')]=_[_0xbef2('0x30')](_0xb4620f[_0xbef2('0x2c')],_0xb4620f['query']);_0x1c6753['attributes']=_[_0xbef2('0x30')](_0xb4620f[_0xbef2('0x2c')],qs[_0xbef2('0x31')](_0x67a239[_0xbef2('0x2d')][_0xbef2('0x31')]));_0x1c6753['attributes']=_0x1c6753[_0xbef2('0x32')][_0xbef2('0x33')]?_0x1c6753[_0xbef2('0x32')]:_0xb4620f[_0xbef2('0x2c')];if(!_0x67a239[_0xbef2('0x2d')][_0xbef2('0x34')]('nolimit')){_0x1c6753[_0xbef2('0x1b')]=qs[_0xbef2('0x1b')](_0x67a239[_0xbef2('0x2d')][_0xbef2('0x1b')]);_0x1c6753['offset']=qs['offset'](_0x67a239[_0xbef2('0x2d')][_0xbef2('0x1d')]);}_0x1c6753['order']=qs['sort'](_0x67a239[_0xbef2('0x2d')][_0xbef2('0x35')]);_0x1c6753[_0xbef2('0x36')]=qs[_0xbef2('0x2f')](_['pick'](_0x67a239[_0xbef2('0x2d')],_0xb4620f['filters']),_0x3f14f2);if(_0x67a239[_0xbef2('0x2d')]['filter']){_0x1c6753[_0xbef2('0x36')]=_[_0xbef2('0x37')](_0x1c6753[_0xbef2('0x36')],{'$or':_[_0xbef2('0x2a')](_0x3f14f2,function(_0xdccc6){if(_0xdccc6[_0xbef2('0x38')]!==_0xbef2('0x39')){var _0x5785cd={};_0x5785cd[_0xdccc6['name']]={'$like':'%'+_0x67a239[_0xbef2('0x2d')][_0xbef2('0x3a')]+'%'};return _0x5785cd;}})});}_0x1c6753=_[_0xbef2('0x37')]({},_0x1c6753,_0x67a239[_0xbef2('0x3b')]);var _0x452339={'where':_0x1c6753[_0xbef2('0x36')]};return db['Attachment'][_0xbef2('0x1c')](_0x452339)[_0xbef2('0x24')](function(_0x267b86){_0x2f77dc[_0xbef2('0x1c')]=_0x267b86;if(_0x67a239['query'][_0xbef2('0x3c')]){_0x1c6753[_0xbef2('0x3d')]=[{'all':!![]}];}return db[_0xbef2('0x3e')][_0xbef2('0x3f')](_0x1c6753);})[_0xbef2('0x24')](function(_0x5b70ca){_0x2f77dc[_0xbef2('0x40')]=_0x5b70ca;return _0x2f77dc;})[_0xbef2('0x24')](respondWithFilteredResult(_0x219b0b,_0x1c6753))[_0xbef2('0x41')](handleError(_0x219b0b,null));};exports[_0xbef2('0x42')]=function(_0x2ff648,_0x368a41){var _0x5c26fa={'raw':!![],'where':{'id':_0x2ff648[_0xbef2('0x43')]['id']}},_0xa67aed={};_0xa67aed[_0xbef2('0x2c')]=_['keys'](db[_0xbef2('0x3e')][_0xbef2('0x2b')]);_0xa67aed['query']=_[_0xbef2('0x2e')](_0x2ff648[_0xbef2('0x2d')]);_0xa67aed['filters']=_[_0xbef2('0x30')](_0xa67aed[_0xbef2('0x2c')],_0xa67aed[_0xbef2('0x2d')]);_0x5c26fa[_0xbef2('0x32')]=_['intersection'](_0xa67aed[_0xbef2('0x2c')],qs[_0xbef2('0x31')](_0x2ff648[_0xbef2('0x2d')][_0xbef2('0x31')]));_0x5c26fa[_0xbef2('0x32')]=_0x5c26fa[_0xbef2('0x32')][_0xbef2('0x33')]?_0x5c26fa[_0xbef2('0x32')]:_0xa67aed['model'];if(_0x2ff648[_0xbef2('0x2d')]['includeAll']){_0x5c26fa[_0xbef2('0x3d')]=[{'all':!![]}];}_0x5c26fa=_[_0xbef2('0x37')]({},_0x5c26fa,_0x2ff648[_0xbef2('0x3b')]);return db[_0xbef2('0x3e')][_0xbef2('0x44')](_0x5c26fa)['then'](handleEntityNotFound(_0x368a41,null))[_0xbef2('0x24')](respondWithResult(_0x368a41,null))[_0xbef2('0x41')](handleError(_0x368a41,null));};exports[_0xbef2('0x45')]=function(_0x538b7c,_0x3505ec){var _0xc48daf={'where':{'id':_0x538b7c['params']['id']}},_0x55dfe3={};_0x55dfe3[_0xbef2('0x2c')]=_['keys'](db[_0xbef2('0x3e')][_0xbef2('0x2b')]);_0xc48daf[_0xbef2('0x32')]=_[_0xbef2('0x30')](_0x55dfe3[_0xbef2('0x2c')],qs[_0xbef2('0x31')](_0x538b7c[_0xbef2('0x2d')][_0xbef2('0x31')]));_0xc48daf['attributes']=_0xc48daf[_0xbef2('0x32')]['length']?_0xc48daf[_0xbef2('0x32')]:_0x55dfe3['model'];if(_0x538b7c[_0xbef2('0x2d')][_0xbef2('0x3c')]){_0xc48daf[_0xbef2('0x3d')]=[{'all':!![]}];}_0xc48daf=_[_0xbef2('0x37')]({},_0xc48daf,_0x538b7c[_0xbef2('0x3b')]);return db[_0xbef2('0x3e')]['find'](_0xc48daf)[_0xbef2('0x24')](handleEntityNotFound(_0x3505ec,null))[_0xbef2('0x24')](function(_0x93143a){if(_0x93143a){var _0x137528=_0x93143a[_0xbef2('0x46')]({'plain':!![]});_0x137528=qs[_0xbef2('0x47')](_0x137528,['id',_0xbef2('0x48'),_0xbef2('0x49')]);_0x538b7c[_0xbef2('0x4a')]=_[_0xbef2('0x47')](_0x538b7c[_0xbef2('0x4a')],['id',_0xbef2('0x48'),_0xbef2('0x49')]);return db[_0xbef2('0x3e')][_0xbef2('0x4b')](_[_0xbef2('0x37')](_0x137528,_0x538b7c[_0xbef2('0x4a')]),{'include':_0x538b7c[_0xbef2('0x2d')][_0xbef2('0x3c')]?[{'all':!![]}]:undefined});}})['then'](respondWithResult(_0x3505ec,0xc9))[_0xbef2('0x41')](handleError(_0x3505ec,null));};exports[_0xbef2('0x23')]=function(_0x1a874d,_0x2bd018){if(_0x1a874d[_0xbef2('0x4a')]['id']){delete _0x1a874d[_0xbef2('0x4a')]['id'];}return db[_0xbef2('0x3e')][_0xbef2('0x44')]({'where':{'id':_0x1a874d[_0xbef2('0x43')]['id']}})[_0xbef2('0x24')](handleEntityNotFound(_0x2bd018,null))[_0xbef2('0x24')](saveUpdates(_0x1a874d[_0xbef2('0x4a')],null))[_0xbef2('0x24')](respondWithResult(_0x2bd018,null))[_0xbef2('0x41')](handleError(_0x2bd018,null));};exports['destroy']=function(_0xdbe9fa,_0xcc0232){return db['Attachment'][_0xbef2('0x44')]({'where':{'id':_0xdbe9fa['params']['id']}})[_0xbef2('0x24')](handleEntityNotFound(_0xcc0232,null))['then'](removeEntity(_0xcc0232,null))['catch'](handleError(_0xcc0232,null));};exports[_0xbef2('0x4b')]=function(_0x14d2ee,_0x5d2ae3,_0x3ccc6b){_0x14d2ee[_0xbef2('0x4a')][_0xbef2('0x28')]=_0x14d2ee['file'][_0xbef2('0x4c')];_0x14d2ee['body'][_0xbef2('0x4d')]=_0x14d2ee[_0xbef2('0x4e')][_0xbef2('0x4f')];_0x14d2ee[_0xbef2('0x4a')][_0xbef2('0x38')]=_0x14d2ee[_0xbef2('0x4e')][_0xbef2('0x50')];return db[_0xbef2('0x3e')][_0xbef2('0x4b')](_0x14d2ee['body'])['then'](respondWithResult(_0x5d2ae3,0xc9))[_0xbef2('0x41')](handleError(_0x5d2ae3,null));};exports['download']=function(_0x18630b,_0x3f7675,_0x3ebe8b){return db[_0xbef2('0x3e')]['findOne']({'where':{'id':_0x18630b[_0xbef2('0x43')]['id']},'raw':!![]})[_0xbef2('0x24')](handleEntityNotFound(_0x3f7675,null))[_0xbef2('0x24')](function(_0x37e092){if(_0x37e092){var _0x4fe047=_0x37e092['ChatOfflineMessageId']!==null;var _0x3cd44e=path[_0xbef2('0x51')](config[_0xbef2('0x52')],_0xbef2('0x53'));if(_0x4fe047){_0x3cd44e=path[_0xbef2('0x51')](_0x3cd44e,_0xbef2('0x54'));}var _0x49aaf5=path[_0xbef2('0x51')](_0x3cd44e,_0x37e092[_0xbef2('0x4d')]);return _0x3f7675[_0xbef2('0x55')](_0x49aaf5);}})[_0xbef2('0x41')](handleError(_0x3f7675,null));};
\ No newline at end of file
diff --git a/server/api/attachment/attachment.model.js b/server/api/attachment/attachment.model.js
index d773852..0e3e7de 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 _0x6ff0=['lodash','util','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./attachment.attributes','exports','define','Attachment','attachments'];(function(_0x27cfaf,_0x125bff){var _0x38490f=function(_0x334cf0){while(--_0x334cf0){_0x27cfaf['push'](_0x27cfaf['shift']());}};_0x38490f(++_0x125bff);}(_0x6ff0,0x16c));var _0x06ff=function(_0x2308d7,_0xb501ad){_0x2308d7=_0x2308d7-0x0;var _0x480907=_0x6ff0[_0x2308d7];return _0x480907;};'use strict';var _=require(_0x06ff('0x0'));var util=require(_0x06ff('0x1'));var logger=require('../../config/logger')(_0x06ff('0x2'));var moment=require(_0x06ff('0x3'));var BPromise=require(_0x06ff('0x4'));var rp=require(_0x06ff('0x5'));var fs=require('fs');var path=require(_0x06ff('0x6'));var rimraf=require(_0x06ff('0x7'));var config=require(_0x06ff('0x8'));var attributes=require(_0x06ff('0x9'));module[_0x06ff('0xa')]=function(_0x1f1fa0,_0x79af3c){return _0x1f1fa0[_0x06ff('0xb')](_0x06ff('0xc'),attributes,{'tableName':_0x06ff('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x59e9=['attachments','lodash','api','moment','path','rimraf','../../config/environment','exports','Attachment'];(function(_0x2055a7,_0x415a4c){var _0x42a14d=function(_0x83139b){while(--_0x83139b){_0x2055a7['push'](_0x2055a7['shift']());}};_0x42a14d(++_0x415a4c);}(_0x59e9,0xb5));var _0x959e=function(_0x4a22f7,_0x2f1324){_0x4a22f7=_0x4a22f7-0x0;var _0xba429=_0x59e9[_0x4a22f7];return _0xba429;};'use strict';var _=require(_0x959e('0x0'));var util=require('util');var logger=require('../../config/logger')(_0x959e('0x1'));var moment=require(_0x959e('0x2'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x959e('0x3'));var rimraf=require(_0x959e('0x4'));var config=require(_0x959e('0x5'));var attributes=require('./attachment.attributes');module[_0x959e('0x6')]=function(_0x1a56e2,_0x5308a1){return _0x1a56e2['define'](_0x959e('0x7'),attributes,{'tableName':_0x959e('0x8'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
diff --git a/server/api/attachment/attachment.rpc.js b/server/api/attachment/attachment.rpc.js
index ccc70dc..cd3c7f5 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 _0xa588=['debug','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','then','info','Attachment,\x20%s,\x20%s','request\x20sent','Attachment,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','CreateAttachment','create','body','options','raw'];(function(_0x57db49,_0x288094){var _0xd0636f=function(_0x227787){while(--_0x227787){_0x57db49['push'](_0x57db49['shift']());}};_0xd0636f(++_0x288094);}(_0xa588,0xe1));var _0x8a58=function(_0x47397f,_0x45ba05){_0x47397f=_0x47397f-0x0;var _0xba5ff1=_0xa588[_0x47397f];return _0xba5ff1;};'use strict';var _=require('lodash');var util=require(_0x8a58('0x0'));var moment=require(_0x8a58('0x1'));var BPromise=require(_0x8a58('0x2'));var rs=require(_0x8a58('0x3'));var fs=require('fs');var Redis=require(_0x8a58('0x4'));var db=require(_0x8a58('0x5'))['db'];var utils=require(_0x8a58('0x6'));var logger=require(_0x8a58('0x7'))(_0x8a58('0x8'));var config=require('../../config/environment');var jayson=require(_0x8a58('0x9'));var client=jayson[_0x8a58('0xa')][_0x8a58('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x35d5ad,_0xe0af18,_0x140f99){return new BPromise(function(_0x77b421,_0x585376){return client['request'](_0x35d5ad,_0x140f99)[_0x8a58('0xc')](function(_0x39a20e){logger[_0x8a58('0xd')](_0x8a58('0xe'),_0xe0af18,_0x8a58('0xf'));logger['debug'](_0x8a58('0x10'),_0xe0af18,_0x8a58('0xf'),JSON[_0x8a58('0x11')](_0x39a20e));if(_0x39a20e[_0x8a58('0x12')]){if(_0x39a20e['error']['code']===0x1f4){logger[_0x8a58('0x12')]('Attachment,\x20%s,\x20%s',_0xe0af18,_0x39a20e[_0x8a58('0x12')][_0x8a58('0x13')]);return _0x585376(_0x39a20e['error'][_0x8a58('0x13')]);}logger[_0x8a58('0x12')]('Attachment,\x20%s,\x20%s',_0xe0af18,_0x39a20e[_0x8a58('0x12')][_0x8a58('0x13')]);return _0x77b421(_0x39a20e['error'][_0x8a58('0x13')]);}else{logger[_0x8a58('0xd')](_0x8a58('0xe'),_0xe0af18,_0x8a58('0xf'));_0x77b421(_0x39a20e[_0x8a58('0x14')][_0x8a58('0x13')]);}})[_0x8a58('0x15')](function(_0x49ee0e){logger['error'](_0x8a58('0xe'),_0xe0af18,_0x49ee0e);_0x585376(_0x49ee0e);});});}exports[_0x8a58('0x16')]=function(_0x18a14d){var _0x4b5012=this;return new Promise(function(_0x282f2d,_0xe73eb9){return db['Attachment'][_0x8a58('0x17')](_0x18a14d[_0x8a58('0x18')],{'raw':_0x18a14d[_0x8a58('0x19')]?_0x18a14d[_0x8a58('0x19')][_0x8a58('0x1a')]===undefined?!![]:![]:!![]})[_0x8a58('0xc')](function(_0x284bb8){logger[_0x8a58('0xd')](_0x8a58('0x16'),_0x18a14d);logger[_0x8a58('0x1b')](_0x8a58('0x16'),_0x18a14d,JSON[_0x8a58('0x11')](_0x284bb8));_0x282f2d(_0x284bb8);})[_0x8a58('0x15')](function(_0x34adb8){logger['error'](_0x8a58('0x16'),_0x34adb8[_0x8a58('0x13')],_0x18a14d);_0xe73eb9(_0x4b5012[_0x8a58('0x12')](0x1f4,_0x34adb8[_0x8a58('0x13')]));});});};
\ No newline at end of file
+var _0x19ea=['CreateAttachment','create','options','raw','lodash','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/environment','jayson/promise','client','http','request','then','info','Attachment,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','catch'];(function(_0x49fbd0,_0x58d2f5){var _0x45bfb4=function(_0x500c93){while(--_0x500c93){_0x49fbd0['push'](_0x49fbd0['shift']());}};_0x45bfb4(++_0x58d2f5);}(_0x19ea,0xfe));var _0xa19e=function(_0x386c3e,_0x44a375){_0x386c3e=_0x386c3e-0x0;var _0x4b8e13=_0x19ea[_0x386c3e];return _0x4b8e13;};'use strict';var _=require(_0xa19e('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0xa19e('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xa19e('0x2'));var db=require(_0xa19e('0x3'))['db'];var utils=require(_0xa19e('0x4'));var logger=require('../../config/logger')('rpc');var config=require(_0xa19e('0x5'));var jayson=require(_0xa19e('0x6'));var client=jayson[_0xa19e('0x7')][_0xa19e('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x1087e7,_0x30fd4a,_0x336e23){return new BPromise(function(_0x1867cb,_0x44e468){return client[_0xa19e('0x9')](_0x1087e7,_0x336e23)[_0xa19e('0xa')](function(_0x59b907){logger[_0xa19e('0xb')](_0xa19e('0xc'),_0x30fd4a,_0xa19e('0xd'));logger[_0xa19e('0xe')]('Attachment,\x20%s,\x20%s,\x20%s',_0x30fd4a,_0xa19e('0xd'),JSON[_0xa19e('0xf')](_0x59b907));if(_0x59b907[_0xa19e('0x10')]){if(_0x59b907['error'][_0xa19e('0x11')]===0x1f4){logger[_0xa19e('0x10')](_0xa19e('0xc'),_0x30fd4a,_0x59b907[_0xa19e('0x10')][_0xa19e('0x12')]);return _0x44e468(_0x59b907['error'][_0xa19e('0x12')]);}logger[_0xa19e('0x10')](_0xa19e('0xc'),_0x30fd4a,_0x59b907[_0xa19e('0x10')][_0xa19e('0x12')]);return _0x1867cb(_0x59b907[_0xa19e('0x10')][_0xa19e('0x12')]);}else{logger[_0xa19e('0xb')](_0xa19e('0xc'),_0x30fd4a,_0xa19e('0xd'));_0x1867cb(_0x59b907[_0xa19e('0x13')]['message']);}})[_0xa19e('0x14')](function(_0x34066a){logger[_0xa19e('0x10')](_0xa19e('0xc'),_0x30fd4a,_0x34066a);_0x44e468(_0x34066a);});});}exports[_0xa19e('0x15')]=function(_0x38e398){var _0x1f37c4=this;return new Promise(function(_0x530a75,_0xd3e0ff){return db['Attachment'][_0xa19e('0x16')](_0x38e398['body'],{'raw':_0x38e398['options']?_0x38e398[_0xa19e('0x17')][_0xa19e('0x18')]===undefined?!![]:![]:!![]})['then'](function(_0x1cb9f9){logger[_0xa19e('0xb')](_0xa19e('0x15'),_0x38e398);logger[_0xa19e('0xe')]('CreateAttachment',_0x38e398,JSON[_0xa19e('0xf')](_0x1cb9f9));_0x530a75(_0x1cb9f9);})[_0xa19e('0x14')](function(_0x105874){logger[_0xa19e('0x10')](_0xa19e('0x15'),_0x105874[_0xa19e('0x12')],_0x38e398);_0xd3e0ff(_0x1f37c4[_0xa19e('0x10')](0x1f4,_0x105874[_0xa19e('0x12')]));});});};
\ No newline at end of file
diff --git a/server/api/attachment/index.js b/server/api/attachment/index.js
index 11c57c6..d3b16cb 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 _0x5f66=['fs-extra','../../components/auth/service','../../config/environment','get','isAuthenticated','/:id','show','/:id/download','/:id/clone','clone','diskStorage','root','format','%s-%s','now','originalname','replace','post','single','file','create','delete','destroy','exports','util','connect-timeout','express','Router'];(function(_0x20e7e3,_0x1529be){var _0x14b9de=function(_0xa82925){while(--_0xa82925){_0x20e7e3['push'](_0x20e7e3['shift']());}};_0x14b9de(++_0x1529be);}(_0x5f66,0x1a0));var _0x65f6=function(_0x2f5ac5,_0x1ee939){_0x2f5ac5=_0x2f5ac5-0x0;var _0x37c9a8=_0x5f66[_0x2f5ac5];return _0x37c9a8;};'use strict';var multer=require('multer');var util=require(_0x65f6('0x0'));var path=require('path');var timeout=require(_0x65f6('0x1'));var express=require(_0x65f6('0x2'));var router=express[_0x65f6('0x3')]();var fs_extra=require(_0x65f6('0x4'));var auth=require(_0x65f6('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x65f6('0x6'));var controller=require('./attachment.controller');router[_0x65f6('0x7')]('/',auth[_0x65f6('0x8')](),controller['index']);router['get'](_0x65f6('0x9'),auth[_0x65f6('0x8')](),controller[_0x65f6('0xa')]);router[_0x65f6('0x7')](_0x65f6('0xb'),auth[_0x65f6('0x8')](),controller['download']);router['post'](_0x65f6('0xc'),auth[_0x65f6('0x8')](),controller[_0x65f6('0xd')]);var upload=multer({'storage':multer[_0x65f6('0xe')]({'destination':function(_0x50d26d,_0x41a7fd,_0x571436){_0x571436(null,path['join'](config[_0x65f6('0xf')],'server/files/attachments/'));},'filename':function(_0x419819,_0x4862a5,_0x2f964a){_0x2f964a(null,util[_0x65f6('0x10')](_0x65f6('0x11'),Date[_0x65f6('0x12')](),_0x4862a5[_0x65f6('0x13')][_0x65f6('0x14')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-')));}})});router[_0x65f6('0x15')]('/',upload[_0x65f6('0x16')](_0x65f6('0x17')),controller[_0x65f6('0x18')]);router['put'](_0x65f6('0x9'),auth['isAuthenticated'](),controller['update']);router[_0x65f6('0x19')](_0x65f6('0x9'),auth[_0x65f6('0x8')](),controller[_0x65f6('0x1a')]);module[_0x65f6('0x1b')]=router;
\ No newline at end of file
+var _0xdb28=['path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','/:id','show','/:id/download','download','/:id/clone','clone','join','root','server/files/attachments/','%s-%s','now','originalname','replace','post','single','file','create','put','update','delete','destroy','exports','multer','util'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xdb28,0x106));var _0x8db2=function(_0xe41c53,_0x8e24a){_0xe41c53=_0xe41c53-0x0;var _0x336b0c=_0xdb28[_0xe41c53];return _0x336b0c;};'use strict';var multer=require(_0x8db2('0x0'));var util=require(_0x8db2('0x1'));var path=require(_0x8db2('0x2'));var timeout=require(_0x8db2('0x3'));var express=require('express');var router=express[_0x8db2('0x4')]();var fs_extra=require(_0x8db2('0x5'));var auth=require(_0x8db2('0x6'));var interaction=require(_0x8db2('0x7'));var config=require(_0x8db2('0x8'));var controller=require('./attachment.controller');router[_0x8db2('0x9')]('/',auth[_0x8db2('0xa')](),controller['index']);router['get'](_0x8db2('0xb'),auth[_0x8db2('0xa')](),controller[_0x8db2('0xc')]);router[_0x8db2('0x9')](_0x8db2('0xd'),auth[_0x8db2('0xa')](),controller[_0x8db2('0xe')]);router['post'](_0x8db2('0xf'),auth[_0x8db2('0xa')](),controller[_0x8db2('0x10')]);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x1d9371,_0x150942,_0x576475){_0x576475(null,path[_0x8db2('0x11')](config[_0x8db2('0x12')],_0x8db2('0x13')));},'filename':function(_0x204f49,_0x37d017,_0x559fb1){_0x559fb1(null,util['format'](_0x8db2('0x14'),Date[_0x8db2('0x15')](),_0x37d017[_0x8db2('0x16')][_0x8db2('0x17')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-')));}})});router[_0x8db2('0x18')]('/',upload[_0x8db2('0x19')](_0x8db2('0x1a')),controller[_0x8db2('0x1b')]);router[_0x8db2('0x1c')](_0x8db2('0xb'),auth['isAuthenticated'](),controller[_0x8db2('0x1d')]);router[_0x8db2('0x1e')]('/:id',auth[_0x8db2('0xa')](),controller[_0x8db2('0x1f')]);module[_0x8db2('0x20')]=router;
\ No newline at end of file
diff --git a/server/api/authGoogle/authGoogle.controller.js b/server/api/authGoogle/authGoogle.controller.js
index 6312b62..e37a2a2 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 _0xc818=['passport-google-oauth20','Strategy','../../mysqldb','../../config/environment','../../components/auth/service','../../config/utils','google','/login','profile','callback','use','clientID','clientSecret','callbackURL','Setting','allowedLoginAttempts','blockDuration','then','User','map','value','admin','user','agent','disabled','Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.','blocked','blockedAt','add','minutes','getLicense','catch','lodash','passport'];(function(_0x39d544,_0x35c14f){var _0x5a5ff2=function(_0x2271fb){while(--_0x2271fb){_0x39d544['push'](_0x39d544['shift']());}};_0x5a5ff2(++_0x35c14f);}(_0xc818,0x86));var _0x8c81=function(_0x6a3be8,_0x3cfef3){_0x6a3be8=_0x6a3be8-0x0;var _0x5d041b=_0xc818[_0x6a3be8];return _0x5d041b;};'use strict';var _=require(_0x8c81('0x0'));var passport=require(_0x8c81('0x1'));var GoogleStrategy=require(_0x8c81('0x2'))[_0x8c81('0x3')];var moment=require('moment');var db=require(_0x8c81('0x4'))['db'];var config=require(_0x8c81('0x5'));var signToken=require(_0x8c81('0x6'))['signToken'];var utils=require(_0x8c81('0x7'));exports['login']=passport['authenticate'](_0x8c81('0x8'),{'failureRedirect':_0x8c81('0x9'),'scope':[_0x8c81('0xa'),'email'],'session':![]});exports[_0x8c81('0xb')]=passport['authenticate'](_0x8c81('0x8'),{'failureRedirect':_0x8c81('0x9'),'session':![]});passport[_0x8c81('0xc')](new GoogleStrategy({'clientID':config[_0x8c81('0x8')]?config[_0x8c81('0x8')][_0x8c81('0xd')]:'id','clientSecret':config[_0x8c81('0x8')]?config['google'][_0x8c81('0xe')]:'secret','callbackURL':config['google']?config['google'][_0x8c81('0xf')]:''},function(_0xff8bf6,_0x2c3007,_0x449941,_0x1c63be){var _0x1993d0,_0x1081b5;return db[_0x8c81('0x10')]['findOne']({'where':{'id':0x1},'attributes':[_0x8c81('0x11'),_0x8c81('0x12')],'raw':!![]})[_0x8c81('0x13')](function(_0x5cd9ed){_0x1993d0=_0x5cd9ed;return db[_0x8c81('0x14')]['find']({'where':{'email':_[_0x8c81('0x15')](_0x449941['emails'],_0x8c81('0x16')),'role':{'$or':[_0x8c81('0x17'),_0x8c81('0x18'),_0x8c81('0x19')]}}});})[_0x8c81('0x13')](function(_0x110c2a){_0x1081b5=_0x110c2a;if(_0x1081b5){if(_0x1081b5[_0x8c81('0x1a')]){return _0x1c63be(_0x8c81('0x1b'));}else if(_0x1993d0['blockDuration']>0x0){if(_0x1081b5[_0x8c81('0x1c')]){if(moment(_0x1081b5[_0x8c81('0x1d')])[_0x8c81('0x1e')](_0x1993d0[_0x8c81('0x12')],_0x8c81('0x1f'))>moment()){return _0x1c63be('Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.');}else{return utils['clearBlockUser'](_0x1081b5,0x0,![],null)[_0x8c81('0x13')](function(){return utils[_0x8c81('0x20')](_0x1081b5);})['then'](function(){return _0x1c63be(null,_0x1081b5);});}}else{return utils[_0x8c81('0x20')](_0x1081b5)[_0x8c81('0x13')](function(){return _0x1c63be(null,_0x1081b5);});}}else{return utils[_0x8c81('0x20')](_0x1081b5)[_0x8c81('0x13')](function(){return _0x1c63be(null,_0x1081b5);});}}return _0x1c63be(_0x8c81('0x1b'));})[_0x8c81('0x21')](function(_0x4b1a56){_0x1c63be(_0x4b1a56);});}));
\ No newline at end of file
+var _0x7edf=['passport','Strategy','moment','../../mysqldb','../../config/environment','../../config/utils','login','google','/login','profile','email','callback','use','clientID','clientSecret','secret','callbackURL','Setting','allowedLoginAttempts','then','User','find','map','emails','user','agent','Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.','blockDuration','blocked','blockedAt','add','minutes','getLicense','catch','lodash'];(function(_0x58f245,_0x3e4f31){var _0x1f0cfb=function(_0x515942){while(--_0x515942){_0x58f245['push'](_0x58f245['shift']());}};_0x1f0cfb(++_0x3e4f31);}(_0x7edf,0x15d));var _0xf7ed=function(_0x3b19ea,_0x518b6b){_0x3b19ea=_0x3b19ea-0x0;var _0x40ece9=_0x7edf[_0x3b19ea];return _0x40ece9;};'use strict';var _=require(_0xf7ed('0x0'));var passport=require(_0xf7ed('0x1'));var GoogleStrategy=require('passport-google-oauth20')[_0xf7ed('0x2')];var moment=require(_0xf7ed('0x3'));var db=require(_0xf7ed('0x4'))['db'];var config=require(_0xf7ed('0x5'));var signToken=require('../../components/auth/service')['signToken'];var utils=require(_0xf7ed('0x6'));exports[_0xf7ed('0x7')]=passport['authenticate'](_0xf7ed('0x8'),{'failureRedirect':_0xf7ed('0x9'),'scope':[_0xf7ed('0xa'),_0xf7ed('0xb')],'session':![]});exports[_0xf7ed('0xc')]=passport['authenticate']('google',{'failureRedirect':_0xf7ed('0x9'),'session':![]});passport[_0xf7ed('0xd')](new GoogleStrategy({'clientID':config[_0xf7ed('0x8')]?config[_0xf7ed('0x8')][_0xf7ed('0xe')]:'id','clientSecret':config['google']?config['google'][_0xf7ed('0xf')]:_0xf7ed('0x10'),'callbackURL':config[_0xf7ed('0x8')]?config[_0xf7ed('0x8')][_0xf7ed('0x11')]:''},function(_0x548fc9,_0x57182b,_0x5b8517,_0x43f24c){var _0x4200c0,_0x2cf742;return db[_0xf7ed('0x12')]['findOne']({'where':{'id':0x1},'attributes':[_0xf7ed('0x13'),'blockDuration'],'raw':!![]})[_0xf7ed('0x14')](function(_0x289a67){_0x4200c0=_0x289a67;return db[_0xf7ed('0x15')][_0xf7ed('0x16')]({'where':{'email':_[_0xf7ed('0x17')](_0x5b8517[_0xf7ed('0x18')],'value'),'role':{'$or':['admin',_0xf7ed('0x19'),_0xf7ed('0x1a')]}}});})['then'](function(_0x2e1932){_0x2cf742=_0x2e1932;if(_0x2cf742){if(_0x2cf742['disabled']){return _0x43f24c(_0xf7ed('0x1b'));}else if(_0x4200c0[_0xf7ed('0x1c')]>0x0){if(_0x2cf742[_0xf7ed('0x1d')]){if(moment(_0x2cf742[_0xf7ed('0x1e')])[_0xf7ed('0x1f')](_0x4200c0[_0xf7ed('0x1c')],_0xf7ed('0x20'))>moment()){return _0x43f24c('Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.');}else{return utils['clearBlockUser'](_0x2cf742,0x0,![],null)[_0xf7ed('0x14')](function(){return utils[_0xf7ed('0x21')](_0x2cf742);})[_0xf7ed('0x14')](function(){return _0x43f24c(null,_0x2cf742);});}}else{return utils[_0xf7ed('0x21')](_0x2cf742)['then'](function(){return _0x43f24c(null,_0x2cf742);});}}else{return utils[_0xf7ed('0x21')](_0x2cf742)[_0xf7ed('0x14')](function(){return _0x43f24c(null,_0x2cf742);});}}return _0x43f24c(_0xf7ed('0x1b'));})[_0xf7ed('0x22')](function(_0xab873e){_0x43f24c(_0xab873e);});}));
\ No newline at end of file
diff --git a/server/api/authGoogle/index.js b/server/api/authGoogle/index.js
index 6db8eea..c2f44f2 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 _0x362a=['Router','./authGoogle.controller','../user/user.controller.js','../../components/auth/service','get','login','/callback','callback','isMiddleware','setTokenCookie','exports','express','passport'];(function(_0x3d25e6,_0x2e55a3){var _0x3639c0=function(_0x2ac5a4){while(--_0x2ac5a4){_0x3d25e6['push'](_0x3d25e6['shift']());}};_0x3639c0(++_0x2e55a3);}(_0x362a,0x102));var _0xa362=function(_0x14d233,_0x4289f7){_0x14d233=_0x14d233-0x0;var _0x2d4c76=_0x362a[_0x14d233];return _0x2d4c76;};'use strict';var express=require(_0xa362('0x0'));var passport=require(_0xa362('0x1'));var router=express[_0xa362('0x2')]();var controller=require(_0xa362('0x3'));var userController=require(_0xa362('0x4'));var authService=require(_0xa362('0x5'));router[_0xa362('0x6')]('/',controller[_0xa362('0x7')]);router[_0xa362('0x6')](_0xa362('0x8'),controller[_0xa362('0x9')],authService[_0xa362('0xa')],userController['login'],authService[_0xa362('0xb')]);module[_0xa362('0xc')]=router;
\ No newline at end of file
+var _0x9efb=['callback','isMiddleware','setTokenCookie','passport','Router','../user/user.controller.js','../../components/auth/service','login','get','/callback'];(function(_0x40aaa4,_0x3b22f4){var _0x4e21e5=function(_0x35d2f3){while(--_0x35d2f3){_0x40aaa4['push'](_0x40aaa4['shift']());}};_0x4e21e5(++_0x3b22f4);}(_0x9efb,0x143));var _0xb9ef=function(_0x4ddbae,_0x3d2e5c){_0x4ddbae=_0x4ddbae-0x0;var _0x587ffb=_0x9efb[_0x4ddbae];return _0x587ffb;};'use strict';var express=require('express');var passport=require(_0xb9ef('0x0'));var router=express[_0xb9ef('0x1')]();var controller=require('./authGoogle.controller');var userController=require(_0xb9ef('0x2'));var authService=require(_0xb9ef('0x3'));router['get']('/',controller[_0xb9ef('0x4')]);router[_0xb9ef('0x5')](_0xb9ef('0x6'),controller[_0xb9ef('0x7')],authService[_0xb9ef('0x8')],userController[_0xb9ef('0x4')],authService[_0xb9ef('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 3cc7245..5631973 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 _0xc343=['Email\x20parameter\x20is\x20missing','generate','trim','toLowerCase','User','find','The\x20user\x20is\x20blocked.\x20Please\x20contact\x20the\x20administrator.','resetPasswordToken','now','save','xCally\x20Motion\x20Password\x20Reset','You\x20are\x20receiving\x20this\x20because\x20you\x20(or\x20someone\x20else)\x20have\x20requested\x20the\x20reset\x20of\x20the\x20password\x20for\x20your\x20account.\x0a\x0a','Please\x20click\x20on\x20the\x20following\x20link,\x20or\x20paste\x20this\x20into\x20your\x20browser\x20to\x20complete\x20the\x20process:\x0a\x0a','headers','/reset/','If\x20you\x20did\x20not\x20request\x20this,\x20please\x20ignore\x20this\x20email\x20and\x20your\x20password\x20will\x20remain\x20unchanged.\x0a','status','Reset\x20Email\x20sent!','params','token','securePassword','enforcePasswordHistory','passwordHistoryLimit','validatePasswordPattern','previousPasswords','Password\x20reset!','use','util','passport-local','Strategy','jayson/promise','moment','../../mysqldb','../../components/auth/service','../../config/utils','client','http','Setting','findOne','allowedLoginAttempts','then','password','salt','role','disabled','loginAttempts','admin','agent','name','Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.','authenticate','blocked','blockedAt','add','blockDuration','minutes','clearBlockUser','getLicense','catch','MailAccount','email','Unable\x20to\x20find\x20a\x20configured\x20SMTP\x20service!','Smtp','service','host','port','secure','authentication','auth','user','pass','merge','format','\x22%s\x22\x20<%s>','SendMail','error','message','stringify','send','login','Something\x20went\x20wrong,\x20please\x20try\x20again.','signToken','json','online','forgot','body'];(function(_0xa06e80,_0x552e22){var _0x3729f8=function(_0x22d078){while(--_0x22d078){_0xa06e80['push'](_0xa06e80['shift']());}};_0x3729f8(++_0x552e22);}(_0xc343,0x173));var _0x3c34=function(_0x309d68,_0x971dd1){_0x309d68=_0x309d68-0x0;var _0x2c6801=_0xc343[_0x309d68];return _0x2c6801;};'use strict';var util=require(_0x3c34('0x0'));var passport=require('passport');var LocalStrategy=require(_0x3c34('0x1'))[_0x3c34('0x2')];var jayson=require(_0x3c34('0x3'));var _=require('lodash');var rs=require('randomstring');var moment=require(_0x3c34('0x4'));var db=require(_0x3c34('0x5'))['db'];var authService=require(_0x3c34('0x6'));var utils=require(_0x3c34('0x7'));var client=jayson[_0x3c34('0x8')][_0x3c34('0x9')]({'port':0x232b});function localAuthenticate(_0x401457,_0x2b12df,_0x9b457,_0x3d7335){var _0x351315,_0x1e98c3;return db[_0x3c34('0xa')][_0x3c34('0xb')]({'where':{'id':0x1},'attributes':[_0x3c34('0xc'),'blockDuration'],'raw':!![]})[_0x3c34('0xd')](function(_0x519a26){_0x351315=_0x519a26;return _0x401457[_0x3c34('0xb')]({'attributes':['id','name',_0x3c34('0xe'),_0x3c34('0xf'),_0x3c34('0x10'),_0x3c34('0x11'),'blocked','blockedAt',_0x3c34('0x12')],'where':{'name':_0x2b12df,'role':{'$or':[_0x3c34('0x13'),'user',_0x3c34('0x14')]}}});})[_0x3c34('0xd')](function(_0x50b90d){if(!_0x50b90d||_0x50b90d&&_0x50b90d[_0x3c34('0x15')]!==_0x2b12df){throw new Error(_0x3c34('0x16'));}else{_0x1e98c3=_0x50b90d;return _0x1e98c3;}})[_0x3c34('0xd')](function(){_0x1e98c3[_0x3c34('0x17')](_0x9b457,function(_0x236ffc,_0x277539){var _0x1ab6d9=_0x1e98c3['loginAttempts']+0x1;if(_0x236ffc){return _0x3d7335(_0x236ffc);}else if(!_0x277539){if(_0x1e98c3[_0x3c34('0x11')]){return _0x3d7335(null,![],{'message':_0x3c34('0x16')});}else if(_0x351315[_0x3c34('0xc')]>0x0){if(_0x1e98c3[_0x3c34('0x18')]){if(_0x351315['blockDuration']>0x0){if(moment(_0x1e98c3[_0x3c34('0x19')])[_0x3c34('0x1a')](_0x351315[_0x3c34('0x1b')],_0x3c34('0x1c'))>moment()){return _0x3d7335(null,![],{'message':_0x3c34('0x16')});}else{return utils[_0x3c34('0x1d')](_0x1e98c3,_0x1ab6d9,![],null)[_0x3c34('0xd')](function(){return _0x3d7335(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});});}}else{return _0x3d7335(null,![],{'message':_0x3c34('0x16')});}}else{if(_0x1ab6d9>=_0x351315[_0x3c34('0xc')]){return utils[_0x3c34('0x1d')](_0x1e98c3,0x0,!![],moment())['then'](function(){return _0x3d7335(null,![],{'message':_0x3c34('0x16')});});}else{return utils[_0x3c34('0x1d')](_0x1e98c3,_0x1ab6d9,![],null)[_0x3c34('0xd')](function(){return _0x3d7335(null,![],{'message':_0x3c34('0x16')});});}}}else{return _0x3d7335(null,![],{'message':_0x3c34('0x16')});}}else{if(_0x1e98c3[_0x3c34('0x11')]){return _0x3d7335(null,![],{'message':_0x3c34('0x16')});}else if(_0x351315[_0x3c34('0xc')]>0x0){if(_0x1e98c3[_0x3c34('0x18')]){if(_0x351315[_0x3c34('0x1b')]>0x0){if(moment(_0x1e98c3[_0x3c34('0x19')])[_0x3c34('0x1a')](_0x351315['blockDuration'],_0x3c34('0x1c'))>moment()){return _0x3d7335(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});}else{return utils[_0x3c34('0x1d')](_0x1e98c3,0x0,![],null)[_0x3c34('0xd')](function(){return utils[_0x3c34('0x1e')](_0x1e98c3);})[_0x3c34('0xd')](function(){return _0x3d7335(null,_0x1e98c3);});}}else{return _0x3d7335(null,![],{'message':_0x3c34('0x16')});}}else{return utils[_0x3c34('0x1d')](_0x1e98c3,0x0,![],null)[_0x3c34('0xd')](function(){return utils[_0x3c34('0x1e')](_0x1e98c3);})['then'](function(){return _0x3d7335(null,_0x1e98c3);})[_0x3c34('0x1f')](function(_0x1e3764){return _0x3d7335(null,![],_0x1e3764);});}}else{if(_0x1e98c3[_0x3c34('0x18')]){return _0x3d7335(null,![],{'message':_0x3c34('0x16')});}else{return utils['getLicense'](_0x1e98c3)[_0x3c34('0xd')](function(){return _0x3d7335(null,_0x1e98c3);});}}}});})['catch'](function(_0x5892b0){return _0x3d7335(null,![],_0x5892b0);});}function sendServiceMail(_0x48ba00){return db[_0x3c34('0x20')]['find']({'where':{'service':!![]},'attributes':['id','name',_0x3c34('0x21')],'include':[{'model':db['MailServerOut'],'as':'Smtp'}]})['then'](function(_0x5ef622){if(!_0x5ef622){throw new Error(_0x3c34('0x22'));}var _0x431b7c={'tls':{'rejectUnauthorized':![]}};if(_0x5ef622[_0x3c34('0x23')]['service']){_0x431b7c[_0x3c34('0x24')]=_0x5ef622[_0x3c34('0x23')][_0x3c34('0x24')];}else{_0x431b7c[_0x3c34('0x25')]=_0x5ef622['Smtp'][_0x3c34('0x25')];_0x431b7c[_0x3c34('0x26')]=_0x5ef622['Smtp']['port'];_0x431b7c[_0x3c34('0x27')]=_0x5ef622[_0x3c34('0x23')][_0x3c34('0x27')];}if(_0x5ef622[_0x3c34('0x23')][_0x3c34('0x28')]){_0x431b7c[_0x3c34('0x29')]={'user':_0x5ef622[_0x3c34('0x23')][_0x3c34('0x2a')],'pass':_0x5ef622[_0x3c34('0x23')][_0x3c34('0x2b')]};}var _0x51187a={'account':_0x431b7c,'message':_[_0x3c34('0x2c')]({'from':util[_0x3c34('0x2d')](_0x3c34('0x2e'),_0x5ef622[_0x3c34('0x15')],_0x5ef622[_0x3c34('0x21')]||_0x5ef622[_0x3c34('0x23')][_0x3c34('0x2a')])},_0x48ba00)};return client['request'](_0x3c34('0x2f'),_0x51187a);})['then'](function(_0x454019){if(_0x454019['error']){throw new Error(util[_0x3c34('0x2d')]('SendMail\x20error:\x20%s.\x20Please\x20contact\x20your\x20Administrator!',_0x454019[_0x3c34('0x30')][_0x3c34('0x31')]||JSON[_0x3c34('0x32')](_0x454019[_0x3c34('0x30')])));}return!![];});}function handleError(_0x4e791d,_0x1cee5f,_0x517ed5){return _0x4e791d['status'](_0x1cee5f||0x1f4)[_0x3c34('0x33')]({'message':_0x517ed5?_0x517ed5['message']||_0x517ed5:''});}exports[_0x3c34('0x34')]=function(_0x219481,_0x30c311,_0x20f93b){passport['authenticate']('local',function(_0x59db30,_0x13d19b,_0x249832){var _0xfd3dad=_0x59db30||_0x249832;if(_0xfd3dad){return handleError(_0x30c311,0x191,_0xfd3dad);}if(!_0x13d19b){return handleError(_0x30c311,0x194,{'message':_0x3c34('0x35')});}else{var _0x536bf8={'payload':{'id':_0x13d19b['id'],'role':_0x13d19b['role']},'options':{'expiresIn':0x15180}};return authService[_0x3c34('0x36')](_0x536bf8)[_0x3c34('0xd')](function(_0x1e7c08){_0x30c311[_0x3c34('0x37')]({'id':_0x13d19b['id'],'token':_0x1e7c08,'statusCall':'','isAlreadyLogged':_0x13d19b[_0x3c34('0x38')]});});}})(_0x219481,_0x30c311,_0x20f93b);};exports[_0x3c34('0x39')]=function(_0x56ae4d,_0x32913f,_0x875eb2){if(!_0x56ae4d[_0x3c34('0x3a')][_0x3c34('0x21')]){return handleError(_0x32913f,0x1f4,{'message':_0x3c34('0x3b')});}var _0x1fdd75=rs[_0x3c34('0x3c')]();_0x56ae4d[_0x3c34('0x3a')][_0x3c34('0x21')]=_0x56ae4d[_0x3c34('0x3a')]['email'][_0x3c34('0x3d')]()[_0x3c34('0x3e')]();var _0x25432f;return db[_0x3c34('0xa')][_0x3c34('0xb')]({'where':{'id':0x1},'attributes':['allowedLoginAttempts','blockDuration'],'raw':!![]})[_0x3c34('0xd')](function(_0x566f8c){_0x25432f=_0x566f8c;return db[_0x3c34('0x3f')][_0x3c34('0x40')]({'where':{'email':_0x56ae4d[_0x3c34('0x3a')][_0x3c34('0x21')]}});})[_0x3c34('0xd')](function(_0x3abfd8){if(!_0x3abfd8){throw new Error('This\x20email\x20is\x20not\x20registered.');}if(_0x3abfd8['disabled']){throw new Error('The\x20user\x20is\x20disabled.\x20Please\x20contact\x20the\x20administrator.');}if(_0x3abfd8[_0x3c34('0x18')]){if(moment(_0x3abfd8[_0x3c34('0x19')])[_0x3c34('0x1a')](_0x25432f[_0x3c34('0x1b')],_0x3c34('0x1c'))>moment()){throw new Error(_0x3c34('0x41'));}else{_0x3abfd8['blocked']=![];_0x3abfd8[_0x3c34('0x19')]=null;}}_0x3abfd8[_0x3c34('0x42')]=_0x1fdd75;_0x3abfd8['resetPasswordExpires']=Date[_0x3c34('0x43')]()+0x36ee80;return _0x3abfd8[_0x3c34('0x44')]();})[_0x3c34('0xd')](function(){return sendServiceMail({'to':_0x56ae4d[_0x3c34('0x3a')][_0x3c34('0x21')],'subject':_0x3c34('0x45'),'text':_0x3c34('0x46')+_0x3c34('0x47')+'https://'+_0x56ae4d[_0x3c34('0x48')][_0x3c34('0x25')]+_0x3c34('0x49')+_0x1fdd75+'\x0a\x0a'+_0x3c34('0x4a')});})[_0x3c34('0xd')](function(){_0x32913f[_0x3c34('0x4b')](0xc8)[_0x3c34('0x33')]({'message':_0x3c34('0x4c')});})[_0x3c34('0x1f')](function(_0x348c74){return handleError(_0x32913f,0x1f4,_0x348c74);});};exports['reset']=function(_0x283243,_0x4631d8,_0x2913f7){return db['User'][_0x3c34('0x40')]({'where':{'resetPasswordToken':_0x283243[_0x3c34('0x4d')][_0x3c34('0x4e')],'resetPasswordExpires':{'$gt':Date[_0x3c34('0x43')]()}}})[_0x3c34('0xd')](function(_0x393a67){if(!_0x393a67){throw new Error('Password\x20reset\x20token\x20is\x20invalid\x20or\x20has\x20expired.');}return db[_0x3c34('0xa')][_0x3c34('0xb')]({'attributes':['id',_0x3c34('0x4f'),_0x3c34('0x50'),_0x3c34('0x51')]})['then'](function(_0x21334c){if(_0x21334c[_0x3c34('0x4f')])authService[_0x3c34('0x52')](_0x283243['body'][_0x3c34('0xe')]);if(!_0x21334c[_0x3c34('0x50')]||!_0x393a67['previousPasswords'])return _0x393a67;authService['validatePasswordHistory'](_0x283243['body'][_0x3c34('0xe')],_0x393a67[_0x3c34('0x53')],_0x21334c['passwordHistoryLimit']);return _0x393a67;})[_0x3c34('0xd')](function(){_0x393a67['password']=_0x283243[_0x3c34('0x3a')][_0x3c34('0xe')];_0x393a67[_0x3c34('0x42')]=null;_0x393a67['resetPasswordExpires']=null;return _0x393a67[_0x3c34('0x44')]();});})[_0x3c34('0xd')](function(){_0x4631d8[_0x3c34('0x4b')](0xc8)[_0x3c34('0x33')]({'message':_0x3c34('0x54')});})[_0x3c34('0x1f')](function(_0x193d8c){return handleError(_0x4631d8,0x1f4,_0x193d8c);});};passport[_0x3c34('0x55')](new LocalStrategy({'usernameField':_0x3c34('0x15'),'passwordField':_0x3c34('0xe')},function(_0x439c75,_0x46aa36,_0x43739b){return localAuthenticate(db[_0x3c34('0x3f')],_0x439c75,_0x46aa36,_0x43739b);}));
\ No newline at end of file
+var _0x99fc=['This\x20email\x20is\x20not\x20registered.','The\x20user\x20is\x20disabled.\x20Please\x20contact\x20the\x20administrator.','The\x20user\x20is\x20blocked.\x20Please\x20contact\x20the\x20administrator.','resetPasswordExpires','now','save','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','Reset\x20Email\x20sent!','Password\x20reset\x20token\x20is\x20invalid\x20or\x20has\x20expired.','securePassword','enforcePasswordHistory','passwordHistoryLimit','previousPasswords','resetPasswordToken','Password\x20reset!','use','util','Strategy','jayson/promise','lodash','../../mysqldb','../../components/auth/service','../../config/utils','client','http','findOne','allowedLoginAttempts','blockDuration','then','name','password','salt','role','blockedAt','loginAttempts','admin','user','agent','Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.','authenticate','disabled','blocked','add','minutes','clearBlockUser','getLicense','catch','MailAccount','find','Smtp','Unable\x20to\x20find\x20a\x20configured\x20SMTP\x20service!','host','port','secure','authentication','merge','format','\x22%s\x22\x20<%s>','request','SendMail','error','SendMail\x20error:\x20%s.\x20Please\x20contact\x20your\x20Administrator!','message','stringify','status','send','login','local','Something\x20went\x20wrong,\x20please\x20try\x20again.','json','forgot','email','generate','body','trim','Setting','User'];(function(_0x108437,_0xc01413){var _0x101be0=function(_0x1ec318){while(--_0x1ec318){_0x108437['push'](_0x108437['shift']());}};_0x101be0(++_0xc01413);}(_0x99fc,0x153));var _0xc99f=function(_0x63b24a,_0x23b365){_0x63b24a=_0x63b24a-0x0;var _0x32c345=_0x99fc[_0x63b24a];return _0x32c345;};'use strict';var util=require(_0xc99f('0x0'));var passport=require('passport');var LocalStrategy=require('passport-local')[_0xc99f('0x1')];var jayson=require(_0xc99f('0x2'));var _=require(_0xc99f('0x3'));var rs=require('randomstring');var moment=require('moment');var db=require(_0xc99f('0x4'))['db'];var authService=require(_0xc99f('0x5'));var utils=require(_0xc99f('0x6'));var client=jayson[_0xc99f('0x7')][_0xc99f('0x8')]({'port':0x232b});function localAuthenticate(_0x5592fb,_0x10fbf4,_0x1073c0,_0x13667b){var _0x3559a6,_0x36afc6;return db['Setting'][_0xc99f('0x9')]({'where':{'id':0x1},'attributes':[_0xc99f('0xa'),_0xc99f('0xb')],'raw':!![]})[_0xc99f('0xc')](function(_0x5b8e64){_0x3559a6=_0x5b8e64;return _0x5592fb['findOne']({'attributes':['id',_0xc99f('0xd'),_0xc99f('0xe'),_0xc99f('0xf'),_0xc99f('0x10'),'disabled','blocked',_0xc99f('0x11'),_0xc99f('0x12')],'where':{'name':_0x10fbf4,'role':{'$or':[_0xc99f('0x13'),_0xc99f('0x14'),_0xc99f('0x15')]}}});})['then'](function(_0x5c351c){if(!_0x5c351c||_0x5c351c&&_0x5c351c[_0xc99f('0xd')]!==_0x10fbf4){throw new Error(_0xc99f('0x16'));}else{_0x36afc6=_0x5c351c;return _0x36afc6;}})['then'](function(){_0x36afc6[_0xc99f('0x17')](_0x1073c0,function(_0x3e9392,_0xe2b94e){var _0x288f42=_0x36afc6['loginAttempts']+0x1;if(_0x3e9392){return _0x13667b(_0x3e9392);}else if(!_0xe2b94e){if(_0x36afc6[_0xc99f('0x18')]){return _0x13667b(null,![],{'message':_0xc99f('0x16')});}else if(_0x3559a6[_0xc99f('0xa')]>0x0){if(_0x36afc6[_0xc99f('0x19')]){if(_0x3559a6[_0xc99f('0xb')]>0x0){if(moment(_0x36afc6['blockedAt'])[_0xc99f('0x1a')](_0x3559a6['blockDuration'],_0xc99f('0x1b'))>moment()){return _0x13667b(null,![],{'message':_0xc99f('0x16')});}else{return utils['clearBlockUser'](_0x36afc6,_0x288f42,![],null)[_0xc99f('0xc')](function(){return _0x13667b(null,![],{'message':_0xc99f('0x16')});});}}else{return _0x13667b(null,![],{'message':_0xc99f('0x16')});}}else{if(_0x288f42>=_0x3559a6[_0xc99f('0xa')]){return utils['clearBlockUser'](_0x36afc6,0x0,!![],moment())[_0xc99f('0xc')](function(){return _0x13667b(null,![],{'message':_0xc99f('0x16')});});}else{return utils[_0xc99f('0x1c')](_0x36afc6,_0x288f42,![],null)[_0xc99f('0xc')](function(){return _0x13667b(null,![],{'message':_0xc99f('0x16')});});}}}else{return _0x13667b(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});}}else{if(_0x36afc6[_0xc99f('0x18')]){return _0x13667b(null,![],{'message':_0xc99f('0x16')});}else if(_0x3559a6[_0xc99f('0xa')]>0x0){if(_0x36afc6[_0xc99f('0x19')]){if(_0x3559a6[_0xc99f('0xb')]>0x0){if(moment(_0x36afc6[_0xc99f('0x11')])[_0xc99f('0x1a')](_0x3559a6[_0xc99f('0xb')],_0xc99f('0x1b'))>moment()){return _0x13667b(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});}else{return utils[_0xc99f('0x1c')](_0x36afc6,0x0,![],null)[_0xc99f('0xc')](function(){return utils[_0xc99f('0x1d')](_0x36afc6);})[_0xc99f('0xc')](function(){return _0x13667b(null,_0x36afc6);});}}else{return _0x13667b(null,![],{'message':_0xc99f('0x16')});}}else{return utils[_0xc99f('0x1c')](_0x36afc6,0x0,![],null)[_0xc99f('0xc')](function(){return utils[_0xc99f('0x1d')](_0x36afc6);})[_0xc99f('0xc')](function(){return _0x13667b(null,_0x36afc6);})[_0xc99f('0x1e')](function(_0x35baf1){return _0x13667b(null,![],_0x35baf1);});}}else{if(_0x36afc6['blocked']){return _0x13667b(null,![],{'message':_0xc99f('0x16')});}else{return utils[_0xc99f('0x1d')](_0x36afc6)[_0xc99f('0xc')](function(){return _0x13667b(null,_0x36afc6);});}}}});})[_0xc99f('0x1e')](function(_0x5e89ea){return _0x13667b(null,![],_0x5e89ea);});}function sendServiceMail(_0x4f6ab3){return db[_0xc99f('0x1f')][_0xc99f('0x20')]({'where':{'service':!![]},'attributes':['id',_0xc99f('0xd'),'email'],'include':[{'model':db['MailServerOut'],'as':_0xc99f('0x21')}]})[_0xc99f('0xc')](function(_0x11a9dd){if(!_0x11a9dd){throw new Error(_0xc99f('0x22'));}var _0x57a0d6={'tls':{'rejectUnauthorized':![]}};if(_0x11a9dd['Smtp']['service']){_0x57a0d6['service']=_0x11a9dd['Smtp']['service'];}else{_0x57a0d6[_0xc99f('0x23')]=_0x11a9dd[_0xc99f('0x21')][_0xc99f('0x23')];_0x57a0d6[_0xc99f('0x24')]=_0x11a9dd[_0xc99f('0x21')]['port'];_0x57a0d6['secure']=_0x11a9dd['Smtp'][_0xc99f('0x25')];}if(_0x11a9dd[_0xc99f('0x21')][_0xc99f('0x26')]){_0x57a0d6['auth']={'user':_0x11a9dd[_0xc99f('0x21')][_0xc99f('0x14')],'pass':_0x11a9dd[_0xc99f('0x21')]['pass']};}var _0x345b25={'account':_0x57a0d6,'message':_[_0xc99f('0x27')]({'from':util[_0xc99f('0x28')](_0xc99f('0x29'),_0x11a9dd[_0xc99f('0xd')],_0x11a9dd['email']||_0x11a9dd[_0xc99f('0x21')][_0xc99f('0x14')])},_0x4f6ab3)};return client[_0xc99f('0x2a')](_0xc99f('0x2b'),_0x345b25);})[_0xc99f('0xc')](function(_0x707ef4){if(_0x707ef4[_0xc99f('0x2c')]){throw new Error(util[_0xc99f('0x28')](_0xc99f('0x2d'),_0x707ef4[_0xc99f('0x2c')][_0xc99f('0x2e')]||JSON[_0xc99f('0x2f')](_0x707ef4[_0xc99f('0x2c')])));}return!![];});}function handleError(_0x44650c,_0xab2f69,_0xb6773){return _0x44650c[_0xc99f('0x30')](_0xab2f69||0x1f4)[_0xc99f('0x31')]({'message':_0xb6773?_0xb6773['message']||_0xb6773:''});}exports[_0xc99f('0x32')]=function(_0x55ac2b,_0x14be3a,_0x5311c6){passport[_0xc99f('0x17')](_0xc99f('0x33'),function(_0x314c73,_0x4a6fb8,_0x142267){var _0x59e328=_0x314c73||_0x142267;if(_0x59e328){return handleError(_0x14be3a,0x191,_0x59e328);}if(!_0x4a6fb8){return handleError(_0x14be3a,0x194,{'message':_0xc99f('0x34')});}else{var _0x5ddfe4={'payload':{'id':_0x4a6fb8['id'],'role':_0x4a6fb8[_0xc99f('0x10')]},'options':{'expiresIn':0x15180}};return authService['signToken'](_0x5ddfe4)[_0xc99f('0xc')](function(_0x1856b1){_0x14be3a[_0xc99f('0x35')]({'id':_0x4a6fb8['id'],'token':_0x1856b1,'statusCall':'','isAlreadyLogged':_0x4a6fb8['online']});});}})(_0x55ac2b,_0x14be3a,_0x5311c6);};exports[_0xc99f('0x36')]=function(_0x21fa57,_0x1d10d7,_0x248bbd){if(!_0x21fa57['body'][_0xc99f('0x37')]){return handleError(_0x1d10d7,0x1f4,{'message':'Email\x20parameter\x20is\x20missing'});}var _0x276e9c=rs[_0xc99f('0x38')]();_0x21fa57[_0xc99f('0x39')][_0xc99f('0x37')]=_0x21fa57[_0xc99f('0x39')][_0xc99f('0x37')][_0xc99f('0x3a')]()['toLowerCase']();var _0x111eca;return db[_0xc99f('0x3b')][_0xc99f('0x9')]({'where':{'id':0x1},'attributes':[_0xc99f('0xa'),'blockDuration'],'raw':!![]})[_0xc99f('0xc')](function(_0x5669a1){_0x111eca=_0x5669a1;return db[_0xc99f('0x3c')][_0xc99f('0x20')]({'where':{'email':_0x21fa57[_0xc99f('0x39')][_0xc99f('0x37')]}});})['then'](function(_0x3d7d86){if(!_0x3d7d86){throw new Error(_0xc99f('0x3d'));}if(_0x3d7d86['disabled']){throw new Error(_0xc99f('0x3e'));}if(_0x3d7d86['blocked']){if(moment(_0x3d7d86['blockedAt'])[_0xc99f('0x1a')](_0x111eca['blockDuration'],_0xc99f('0x1b'))>moment()){throw new Error(_0xc99f('0x3f'));}else{_0x3d7d86[_0xc99f('0x19')]=![];_0x3d7d86[_0xc99f('0x11')]=null;}}_0x3d7d86['resetPasswordToken']=_0x276e9c;_0x3d7d86[_0xc99f('0x40')]=Date[_0xc99f('0x41')]()+0x36ee80;return _0x3d7d86[_0xc99f('0x42')]();})['then'](function(){return sendServiceMail({'to':_0x21fa57['body'][_0xc99f('0x37')],'subject':'xCally\x20Motion\x20Password\x20Reset','text':'You\x20are\x20receiving\x20this\x20because\x20you\x20(or\x20someone\x20else)\x20have\x20requested\x20the\x20reset\x20of\x20the\x20password\x20for\x20your\x20account.\x0a\x0a'+_0xc99f('0x43')+_0xc99f('0x44')+_0x21fa57[_0xc99f('0x45')][_0xc99f('0x23')]+'/reset/'+_0x276e9c+'\x0a\x0a'+_0xc99f('0x46')});})['then'](function(){_0x1d10d7[_0xc99f('0x30')](0xc8)[_0xc99f('0x31')]({'message':_0xc99f('0x47')});})[_0xc99f('0x1e')](function(_0x386394){return handleError(_0x1d10d7,0x1f4,_0x386394);});};exports['reset']=function(_0x5e3ec8,_0x4be730,_0x248dd1){return db[_0xc99f('0x3c')][_0xc99f('0x20')]({'where':{'resetPasswordToken':_0x5e3ec8['params']['token'],'resetPasswordExpires':{'$gt':Date[_0xc99f('0x41')]()}}})[_0xc99f('0xc')](function(_0x33473b){if(!_0x33473b){throw new Error(_0xc99f('0x48'));}return db['Setting'][_0xc99f('0x9')]({'attributes':['id',_0xc99f('0x49'),_0xc99f('0x4a'),_0xc99f('0x4b')]})['then'](function(_0x5c6887){if(_0x5c6887['securePassword'])authService['validatePasswordPattern'](_0x5e3ec8['body']['password']);if(!_0x5c6887[_0xc99f('0x4a')]||!_0x33473b[_0xc99f('0x4c')])return _0x33473b;authService['validatePasswordHistory'](_0x5e3ec8[_0xc99f('0x39')]['password'],_0x33473b['previousPasswords'],_0x5c6887[_0xc99f('0x4b')]);return _0x33473b;})['then'](function(){_0x33473b['password']=_0x5e3ec8['body']['password'];_0x33473b[_0xc99f('0x4d')]=null;_0x33473b[_0xc99f('0x40')]=null;return _0x33473b['save']();});})['then'](function(){_0x4be730[_0xc99f('0x30')](0xc8)[_0xc99f('0x31')]({'message':_0xc99f('0x4e')});})[_0xc99f('0x1e')](function(_0xb4507a){return handleError(_0x4be730,0x1f4,_0xb4507a);});};passport[_0xc99f('0x4f')](new LocalStrategy({'usernameField':_0xc99f('0xd'),'passwordField':_0xc99f('0xe')},function(_0x41405a,_0x5b2a7e,_0x73da5d){return localAuthenticate(db[_0xc99f('0x3c')],_0x41405a,_0x5b2a7e,_0x73da5d);}));
\ No newline at end of file
diff --git a/server/api/authLocal/index.js b/server/api/authLocal/index.js
index a6388ba..8621ccb 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 _0xe5e6=['forgot','/reset/:token','reset','express','./authLocal.controller','post','/forgot'];(function(_0x1e1bd9,_0x5d2e0c){var _0x28ea77=function(_0x359f98){while(--_0x359f98){_0x1e1bd9['push'](_0x1e1bd9['shift']());}};_0x28ea77(++_0x5d2e0c);}(_0xe5e6,0x168));var _0x6e5e=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0xe5e6[_0x321bb2];return _0x9c12ed;};'use strict';var express=require(_0x6e5e('0x0'));var router=express['Router']();var controller=require(_0x6e5e('0x1'));router['post']('/',controller['login']);router[_0x6e5e('0x2')](_0x6e5e('0x3'),controller[_0x6e5e('0x4')]);router[_0x6e5e('0x2')](_0x6e5e('0x5'),controller[_0x6e5e('0x6')]);module['exports']=router;
\ No newline at end of file
+var _0xe4e8=['./authLocal.controller','post','login','forgot','/reset/:token','reset','exports','express'];(function(_0x356a22,_0x241023){var _0x3b9add=function(_0x22fc24){while(--_0x22fc24){_0x356a22['push'](_0x356a22['shift']());}};_0x3b9add(++_0x241023);}(_0xe4e8,0xef));var _0x8e4e=function(_0xf2fcc,_0x388aed){_0xf2fcc=_0xf2fcc-0x0;var _0x37fa69=_0xe4e8[_0xf2fcc];return _0x37fa69;};'use strict';var express=require(_0x8e4e('0x0'));var router=express['Router']();var controller=require(_0x8e4e('0x1'));router[_0x8e4e('0x2')]('/',controller[_0x8e4e('0x3')]);router['post']('/forgot',controller[_0x8e4e('0x4')]);router[_0x8e4e('0x2')](_0x8e4e('0x5'),controller[_0x8e4e('0x6')]);module[_0x8e4e('0x7')]=router;
\ No newline at end of file
diff --git a/server/api/automation/automation.attributes.js b/server/api/automation/automation.attributes.js
index 7d8878d..b0f9a97 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 _0x7f59=['STRING','INTEGER','sequelize','exports'];(function(_0x3adf4e,_0x26d25f){var _0x4dc28b=function(_0x38d031){while(--_0x38d031){_0x3adf4e['push'](_0x3adf4e['shift']());}};_0x4dc28b(++_0x26d25f);}(_0x7f59,0xba));var _0x97f5=function(_0x51ab0a,_0x2c6928){_0x51ab0a=_0x51ab0a-0x0;var _0x35d20e=_0x7f59[_0x51ab0a];return _0x35d20e;};'use strict';var Sequelize=require(_0x97f5('0x0'));module[_0x97f5('0x1')]={'name':{'type':Sequelize[_0x97f5('0x2')],'allowNull':![]},'channel':{'type':Sequelize['STRING']},'description':{'type':Sequelize['STRING']},'status':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'timeout':{'type':Sequelize[_0x97f5('0x3')],'defaultValue':0xa}};
\ No newline at end of file
+var _0xd044=['BOOLEAN','INTEGER','sequelize','STRING'];(function(_0x2bcddb,_0x3eaf37){var _0x12a9e8=function(_0xeeb678){while(--_0xeeb678){_0x2bcddb['push'](_0x2bcddb['shift']());}};_0x12a9e8(++_0x3eaf37);}(_0xd044,0x13e));var _0x4d04=function(_0x3869c8,_0x2ff137){_0x3869c8=_0x3869c8-0x0;var _0x4caf60=_0xd044[_0x3869c8];return _0x4caf60;};'use strict';var Sequelize=require(_0x4d04('0x0'));module['exports']={'name':{'type':Sequelize[_0x4d04('0x1')],'allowNull':![]},'channel':{'type':Sequelize['STRING']},'description':{'type':Sequelize['STRING']},'status':{'type':Sequelize[_0x4d04('0x2')],'defaultValue':![]},'timeout':{'type':Sequelize[_0x4d04('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 08e83c2..26b79da 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 _0xa9cb=['attributes','intersection','fields','query','length','hasOwnProperty','nolimit','order','sort','pick','filter','where','merge','VIRTUAL','options','includeAll','findAll','rows','catch','show','params','rawAttributes','include','find','create','body','addConditions','Condition','ids','omit','getConditions','findOne','addActions','Action','getActions','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','mustache','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','undefined','limit','offset','count','set','Content-Range','apply','reject','update','then','destroy','name','send','index','map','Automation','type','model','keys','filters'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0xa9cb,0x125));var _0xba9c=function(_0x5b644e,_0x2e5e07){_0x5b644e=_0x5b644e-0x0;var _0x49c6bf=_0xa9cb[_0x5b644e];return _0x49c6bf;};'use strict';var emlformat=require(_0xba9c('0x0'));var rimraf=require(_0xba9c('0x1'));var zipdir=require(_0xba9c('0x2'));var jsonpatch=require(_0xba9c('0x3'));var rp=require(_0xba9c('0x4'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0xba9c('0x5'));var util=require('util');var path=require(_0xba9c('0x6'));var sox=require(_0xba9c('0x7'));var csv=require(_0xba9c('0x8'));var ejs=require(_0xba9c('0x9'));var fs=require('fs');var fs_extra=require(_0xba9c('0xa'));var _=require(_0xba9c('0xb'));var squel=require(_0xba9c('0xc'));var crypto=require(_0xba9c('0xd'));var jsforce=require(_0xba9c('0xe'));var deskjs=require(_0xba9c('0xf'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0xba9c('0x10'));var Redis=require(_0xba9c('0x11'));var authService=require(_0xba9c('0x12'));var qs=require(_0xba9c('0x13'));var as=require(_0xba9c('0x14'));var hardwareService=require(_0xba9c('0x15'));var logger=require(_0xba9c('0x16'))(_0xba9c('0x17'));var utils=require(_0xba9c('0x18'));var config=require(_0xba9c('0x19'));var licenseUtil=require(_0xba9c('0x1a'));var db=require(_0xba9c('0x1b'))['db'];function respondWithStatusCode(_0x36020f,_0x366c3f){_0x366c3f=_0x366c3f||0xcc;return function(_0x1bf2fe){if(_0x1bf2fe){return _0x36020f[_0xba9c('0x1c')](_0x366c3f);}return _0x36020f[_0xba9c('0x1d')](_0x366c3f)[_0xba9c('0x1e')]();};}function respondWithResult(_0x16587e,_0x1b5b04){_0x1b5b04=_0x1b5b04||0xc8;return function(_0x5bcd30){if(_0x5bcd30){return _0x16587e[_0xba9c('0x1d')](_0x1b5b04)['json'](_0x5bcd30);}};}function respondWithFilteredResult(_0x4f0cb,_0x13db57){return function(_0x30eccb){if(_0x30eccb){var _0x9e2848=typeof _0x13db57['offset']===_0xba9c('0x1f')&&typeof _0x13db57[_0xba9c('0x20')]===_0xba9c('0x1f');var _0x210475=_0x30eccb['count'];var _0x265046=_0x9e2848?0x0:_0x13db57[_0xba9c('0x21')];var _0x2404ec=_0x9e2848?_0x30eccb[_0xba9c('0x22')]:_0x13db57[_0xba9c('0x21')]+_0x13db57[_0xba9c('0x20')];var _0x1b7ebe;if(_0x2404ec>=_0x210475){_0x2404ec=_0x210475;_0x1b7ebe=0xc8;}else{_0x1b7ebe=0xce;}_0x4f0cb[_0xba9c('0x1d')](_0x1b7ebe);return _0x4f0cb[_0xba9c('0x23')](_0xba9c('0x24'),_0x265046+'-'+_0x2404ec+'/'+_0x210475)['json'](_0x30eccb);}return null;};}function patchUpdates(_0x49904d){return function(_0x37406c){try{jsonpatch[_0xba9c('0x25')](_0x37406c,_0x49904d,!![]);}catch(_0x41ed7e){return BPromise[_0xba9c('0x26')](_0x41ed7e);}return _0x37406c['save']();};}function saveUpdates(_0x1c02e5,_0x5d863b){return function(_0x24ddc6){if(_0x24ddc6){return _0x24ddc6[_0xba9c('0x27')](_0x1c02e5)[_0xba9c('0x28')](function(_0x42d49a){return _0x42d49a;});}return null;};}function removeEntity(_0x2b829a,_0x5e1cd3){return function(_0x444a4c){if(_0x444a4c){return _0x444a4c[_0xba9c('0x29')]()[_0xba9c('0x28')](function(){_0x2b829a[_0xba9c('0x1d')](0xcc)[_0xba9c('0x1e')]();});}};}function handleEntityNotFound(_0xb676c2,_0xdd90d2){return function(_0x1912db){if(!_0x1912db){_0xb676c2[_0xba9c('0x1c')](0x194);}return _0x1912db;};}function handleError(_0x3664c4,_0x52e9e1){_0x52e9e1=_0x52e9e1||0x1f4;return function(_0x499bc9){logger['error'](_0x499bc9['stack']);if(_0x499bc9[_0xba9c('0x2a')]){delete _0x499bc9[_0xba9c('0x2a')];}_0x3664c4[_0xba9c('0x1d')](_0x52e9e1)[_0xba9c('0x2b')](_0x499bc9);};}exports[_0xba9c('0x2c')]=function(_0x3b3d01,_0x545ac5){var _0x2f3118={},_0x4b1597={},_0x47a7a0={'count':0x0,'rows':[]};var _0x46be5f=_[_0xba9c('0x2d')](db[_0xba9c('0x2e')]['rawAttributes'],function(_0xd7b73e){return{'name':_0xd7b73e['fieldName'],'type':_0xd7b73e[_0xba9c('0x2f')]['key']};});_0x4b1597[_0xba9c('0x30')]=_[_0xba9c('0x2d')](_0x46be5f,_0xba9c('0x2a'));_0x4b1597['query']=_[_0xba9c('0x31')](_0x3b3d01['query']);_0x4b1597[_0xba9c('0x32')]=_['intersection'](_0x4b1597['model'],_0x4b1597['query']);_0x2f3118[_0xba9c('0x33')]=_[_0xba9c('0x34')](_0x4b1597[_0xba9c('0x30')],qs[_0xba9c('0x35')](_0x3b3d01[_0xba9c('0x36')][_0xba9c('0x35')]));_0x2f3118[_0xba9c('0x33')]=_0x2f3118[_0xba9c('0x33')][_0xba9c('0x37')]?_0x2f3118[_0xba9c('0x33')]:_0x4b1597[_0xba9c('0x30')];if(!_0x3b3d01[_0xba9c('0x36')][_0xba9c('0x38')](_0xba9c('0x39'))){_0x2f3118[_0xba9c('0x20')]=qs['limit'](_0x3b3d01['query'][_0xba9c('0x20')]);_0x2f3118[_0xba9c('0x21')]=qs[_0xba9c('0x21')](_0x3b3d01['query'][_0xba9c('0x21')]);}_0x2f3118[_0xba9c('0x3a')]=qs[_0xba9c('0x3b')](_0x3b3d01[_0xba9c('0x36')]['sort']);_0x2f3118['where']=qs[_0xba9c('0x32')](_[_0xba9c('0x3c')](_0x3b3d01[_0xba9c('0x36')],_0x4b1597[_0xba9c('0x32')]),_0x46be5f);if(_0x3b3d01['query'][_0xba9c('0x3d')]){_0x2f3118[_0xba9c('0x3e')]=_[_0xba9c('0x3f')](_0x2f3118[_0xba9c('0x3e')],{'$or':_[_0xba9c('0x2d')](_0x46be5f,function(_0x4089f9){if(_0x4089f9[_0xba9c('0x2f')]!==_0xba9c('0x40')){var _0x427734={};_0x427734[_0x4089f9['name']]={'$like':'%'+_0x3b3d01[_0xba9c('0x36')][_0xba9c('0x3d')]+'%'};return _0x427734;}})});}_0x2f3118=_['merge']({},_0x2f3118,_0x3b3d01[_0xba9c('0x41')]);var _0x4975fc={'where':_0x2f3118['where']};return db[_0xba9c('0x2e')]['count'](_0x4975fc)[_0xba9c('0x28')](function(_0x2f123d){_0x47a7a0[_0xba9c('0x22')]=_0x2f123d;if(_0x3b3d01[_0xba9c('0x36')][_0xba9c('0x42')]){_0x2f3118['include']=[{'all':!![]}];}return db['Automation'][_0xba9c('0x43')](_0x2f3118);})['then'](function(_0x48d8cd){_0x47a7a0[_0xba9c('0x44')]=_0x48d8cd;return _0x47a7a0;})[_0xba9c('0x28')](respondWithFilteredResult(_0x545ac5,_0x2f3118))[_0xba9c('0x45')](handleError(_0x545ac5,null));};exports[_0xba9c('0x46')]=function(_0x3dd37a,_0x3ee490){var _0x813e39={'raw':![],'where':{'id':_0x3dd37a[_0xba9c('0x47')]['id']}},_0x5f5a73={};_0x5f5a73[_0xba9c('0x30')]=_[_0xba9c('0x31')](db[_0xba9c('0x2e')][_0xba9c('0x48')]);_0x5f5a73[_0xba9c('0x36')]=_[_0xba9c('0x31')](_0x3dd37a[_0xba9c('0x36')]);_0x5f5a73[_0xba9c('0x32')]=_[_0xba9c('0x34')](_0x5f5a73[_0xba9c('0x30')],_0x5f5a73[_0xba9c('0x36')]);_0x813e39['attributes']=_[_0xba9c('0x34')](_0x5f5a73[_0xba9c('0x30')],qs[_0xba9c('0x35')](_0x3dd37a[_0xba9c('0x36')][_0xba9c('0x35')]));_0x813e39[_0xba9c('0x33')]=_0x813e39[_0xba9c('0x33')][_0xba9c('0x37')]?_0x813e39['attributes']:_0x5f5a73['model'];if(_0x3dd37a[_0xba9c('0x36')][_0xba9c('0x42')]){_0x813e39[_0xba9c('0x49')]=[{'all':!![]}];}_0x813e39=_[_0xba9c('0x3f')]({},_0x813e39,_0x3dd37a[_0xba9c('0x41')]);return db[_0xba9c('0x2e')][_0xba9c('0x4a')](_0x813e39)[_0xba9c('0x28')](handleEntityNotFound(_0x3ee490,null))[_0xba9c('0x28')](respondWithResult(_0x3ee490,null))[_0xba9c('0x45')](handleError(_0x3ee490,null));};exports[_0xba9c('0x4b')]=function(_0x4071d2,_0x4229a6){return db[_0xba9c('0x2e')][_0xba9c('0x4b')](_0x4071d2[_0xba9c('0x4c')],{})[_0xba9c('0x28')](respondWithResult(_0x4229a6,0xc9))[_0xba9c('0x45')](handleError(_0x4229a6,null));};exports[_0xba9c('0x27')]=function(_0x332fb4,_0x52d4f1){if(_0x332fb4[_0xba9c('0x4c')]['id']){delete _0x332fb4[_0xba9c('0x4c')]['id'];}return db[_0xba9c('0x2e')]['find']({'where':{'id':_0x332fb4[_0xba9c('0x47')]['id']}})[_0xba9c('0x28')](handleEntityNotFound(_0x52d4f1,null))[_0xba9c('0x28')](saveUpdates(_0x332fb4[_0xba9c('0x4c')],null))['then'](respondWithResult(_0x52d4f1,null))[_0xba9c('0x45')](handleError(_0x52d4f1,null));};exports['destroy']=function(_0x2ec21f,_0x2aa91b){return db[_0xba9c('0x2e')][_0xba9c('0x4a')]({'where':{'id':_0x2ec21f['params']['id']}})[_0xba9c('0x28')](handleEntityNotFound(_0x2aa91b,null))[_0xba9c('0x28')](removeEntity(_0x2aa91b,null))[_0xba9c('0x45')](handleError(_0x2aa91b,null));};exports[_0xba9c('0x4d')]=function(_0x1d9512,_0x335815,_0x6c7fbe){return db[_0xba9c('0x4e')][_0xba9c('0x4a')]({'where':{'id':_0x1d9512[_0xba9c('0x47')]['id']}})['then'](handleEntityNotFound(_0x335815,null))[_0xba9c('0x28')](function(_0x5bb3fa){if(_0x5bb3fa){return _0x5bb3fa[_0xba9c('0x4d')](_0x1d9512[_0xba9c('0x4c')][_0xba9c('0x4f')],_[_0xba9c('0x50')](_0x1d9512[_0xba9c('0x4c')],[_0xba9c('0x4f'),'id'])||{});}})[_0xba9c('0x28')](respondWithResult(_0x335815,null))['catch'](handleError(_0x335815,null));};exports[_0xba9c('0x51')]=function(_0x18d649,_0x34f64d,_0x1ec6c4){var _0x4fddd9={};var _0x4c645c={};var _0x1bcbbf;var _0x58be28;return db[_0xba9c('0x2e')][_0xba9c('0x52')]({'where':{'id':_0x18d649['params']['id']}})[_0xba9c('0x28')](handleEntityNotFound(_0x34f64d,null))['then'](function(_0x288768){if(_0x288768){_0x1bcbbf=_0x288768;_0x4c645c[_0xba9c('0x30')]=_[_0xba9c('0x31')](db[_0xba9c('0x4e')][_0xba9c('0x48')]);_0x4c645c[_0xba9c('0x36')]=_['keys'](_0x18d649[_0xba9c('0x36')]);_0x4c645c[_0xba9c('0x32')]=_[_0xba9c('0x34')](_0x4c645c[_0xba9c('0x30')],_0x4c645c[_0xba9c('0x36')]);_0x4fddd9[_0xba9c('0x33')]=_['intersection'](_0x4c645c[_0xba9c('0x30')],qs['fields'](_0x18d649[_0xba9c('0x36')][_0xba9c('0x35')]));_0x4fddd9[_0xba9c('0x33')]=_0x4fddd9['attributes'][_0xba9c('0x37')]?_0x4fddd9[_0xba9c('0x33')]:_0x4c645c[_0xba9c('0x30')];_0x4fddd9[_0xba9c('0x3a')]=qs[_0xba9c('0x3b')](_0x18d649[_0xba9c('0x36')][_0xba9c('0x3b')]);_0x4fddd9[_0xba9c('0x3e')]=qs[_0xba9c('0x32')](_[_0xba9c('0x3c')](_0x18d649['query'],_0x4c645c[_0xba9c('0x32')]));if(_0x18d649[_0xba9c('0x36')][_0xba9c('0x3d')]){_0x4fddd9[_0xba9c('0x3e')]=_[_0xba9c('0x3f')](_0x4fddd9[_0xba9c('0x3e')],{'$or':_[_0xba9c('0x2d')](_0x4fddd9[_0xba9c('0x33')],function(_0x506e80){var _0x1d4f59={};_0x1d4f59[_0x506e80]={'$like':'%'+_0x18d649[_0xba9c('0x36')][_0xba9c('0x3d')]+'%'};return _0x1d4f59;})});}_0x4fddd9=_[_0xba9c('0x3f')]({},_0x4fddd9,_0x18d649[_0xba9c('0x41')]);return _0x1bcbbf[_0xba9c('0x51')](_0x4fddd9);}})['then'](function(_0x5267e3){if(_0x5267e3){_0x58be28=_0x5267e3[_0xba9c('0x37')];if(!_0x18d649[_0xba9c('0x36')]['hasOwnProperty'](_0xba9c('0x39'))){_0x4fddd9[_0xba9c('0x20')]=qs[_0xba9c('0x20')](_0x18d649[_0xba9c('0x36')][_0xba9c('0x20')]);_0x4fddd9[_0xba9c('0x21')]=qs[_0xba9c('0x21')](_0x18d649[_0xba9c('0x36')][_0xba9c('0x21')]);}return _0x1bcbbf[_0xba9c('0x51')](_0x4fddd9);}})[_0xba9c('0x28')](function(_0x2cada8){if(_0x2cada8){return _0x2cada8?{'count':_0x58be28,'rows':_0x2cada8}:null;}})[_0xba9c('0x28')](respondWithResult(_0x34f64d,null))['catch'](handleError(_0x34f64d,null));};exports[_0xba9c('0x53')]=function(_0x489d5b,_0x53aba2,_0x9f4e31){return db[_0xba9c('0x54')][_0xba9c('0x4a')]({'where':{'id':_0x489d5b['params']['id']}})[_0xba9c('0x28')](handleEntityNotFound(_0x53aba2,null))['then'](function(_0x31e963){if(_0x31e963){return _0x31e963[_0xba9c('0x53')](_0x489d5b[_0xba9c('0x4c')][_0xba9c('0x4f')],_[_0xba9c('0x50')](_0x489d5b[_0xba9c('0x4c')],['ids','id'])||{});}})[_0xba9c('0x28')](respondWithResult(_0x53aba2,null))[_0xba9c('0x45')](handleError(_0x53aba2,null));};exports[_0xba9c('0x55')]=function(_0x672bc3,_0x12cb5e,_0x358832){var _0x157396={};var _0x48f1b5={};var _0x5474e5;var _0x5842b5;return db[_0xba9c('0x2e')][_0xba9c('0x52')]({'where':{'id':_0x672bc3[_0xba9c('0x47')]['id']}})[_0xba9c('0x28')](handleEntityNotFound(_0x12cb5e,null))[_0xba9c('0x28')](function(_0x5dad59){if(_0x5dad59){_0x5474e5=_0x5dad59;_0x48f1b5[_0xba9c('0x30')]=_[_0xba9c('0x31')](db['Action'][_0xba9c('0x48')]);_0x48f1b5['query']=_['keys'](_0x672bc3[_0xba9c('0x36')]);_0x48f1b5[_0xba9c('0x32')]=_[_0xba9c('0x34')](_0x48f1b5['model'],_0x48f1b5[_0xba9c('0x36')]);_0x157396[_0xba9c('0x33')]=_[_0xba9c('0x34')](_0x48f1b5[_0xba9c('0x30')],qs[_0xba9c('0x35')](_0x672bc3[_0xba9c('0x36')][_0xba9c('0x35')]));_0x157396['attributes']=_0x157396[_0xba9c('0x33')][_0xba9c('0x37')]?_0x157396['attributes']:_0x48f1b5[_0xba9c('0x30')];_0x157396[_0xba9c('0x3a')]=qs[_0xba9c('0x3b')](_0x672bc3[_0xba9c('0x36')][_0xba9c('0x3b')]);_0x157396[_0xba9c('0x3e')]=qs[_0xba9c('0x32')](_['pick'](_0x672bc3[_0xba9c('0x36')],_0x48f1b5[_0xba9c('0x32')]));if(_0x672bc3['query'][_0xba9c('0x3d')]){_0x157396['where']=_[_0xba9c('0x3f')](_0x157396[_0xba9c('0x3e')],{'$or':_[_0xba9c('0x2d')](_0x157396[_0xba9c('0x33')],function(_0xdb922a){var _0x2d1d21={};_0x2d1d21[_0xdb922a]={'$like':'%'+_0x672bc3[_0xba9c('0x36')][_0xba9c('0x3d')]+'%'};return _0x2d1d21;})});}_0x157396=_[_0xba9c('0x3f')]({},_0x157396,_0x672bc3[_0xba9c('0x41')]);return _0x5474e5[_0xba9c('0x55')](_0x157396);}})[_0xba9c('0x28')](function(_0x20f1ad){if(_0x20f1ad){_0x5842b5=_0x20f1ad[_0xba9c('0x37')];if(!_0x672bc3[_0xba9c('0x36')][_0xba9c('0x38')]('nolimit')){_0x157396[_0xba9c('0x20')]=qs[_0xba9c('0x20')](_0x672bc3['query']['limit']);_0x157396[_0xba9c('0x21')]=qs[_0xba9c('0x21')](_0x672bc3[_0xba9c('0x36')][_0xba9c('0x21')]);}return _0x5474e5['getActions'](_0x157396);}})['then'](function(_0x6f57b5){if(_0x6f57b5){return _0x6f57b5?{'count':_0x5842b5,'rows':_0x6f57b5}:null;}})['then'](respondWithResult(_0x12cb5e,null))['catch'](handleError(_0x12cb5e,null));};
\ No newline at end of file
+var _0x42ed=['index','map','Automation','rawAttributes','type','model','filters','query','attributes','intersection','fields','length','hasOwnProperty','order','sort','where','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','catch','params','keys','find','create','body','addConditions','Condition','ids','omit','getConditions','findOne','addActions','Action','getActions','nolimit','rimraf','zip-dir','fast-json-patch','request-promise','moment','util','path','to-csv','fs-extra','lodash','crypto','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','end','offset','undefined','limit','count','json','apply','reject','update','then','destroy','error','stack','name','send'];(function(_0x27c4f2,_0x5d7982){var _0x49be99=function(_0x228d67){while(--_0x228d67){_0x27c4f2['push'](_0x27c4f2['shift']());}};_0x49be99(++_0x5d7982);}(_0x42ed,0x11e));var _0xd42e=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x42ed[_0x3dd15e];return _0x231fd0;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xd42e('0x0'));var zipdir=require(_0xd42e('0x1'));var jsonpatch=require(_0xd42e('0x2'));var rp=require(_0xd42e('0x3'));var moment=require(_0xd42e('0x4'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0xd42e('0x5'));var path=require(_0xd42e('0x6'));var sox=require('sox');var csv=require(_0xd42e('0x7'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xd42e('0x8'));var _=require(_0xd42e('0x9'));var squel=require('squel');var crypto=require(_0xd42e('0xa'));var jsforce=require(_0xd42e('0xb'));var deskjs=require(_0xd42e('0xc'));var toCsv=require('to-csv');var querystring=require(_0xd42e('0xd'));var Papa=require(_0xd42e('0xe'));var Redis=require('ioredis');var authService=require(_0xd42e('0xf'));var qs=require(_0xd42e('0x10'));var as=require(_0xd42e('0x11'));var hardwareService=require(_0xd42e('0x12'));var logger=require(_0xd42e('0x13'))(_0xd42e('0x14'));var utils=require(_0xd42e('0x15'));var config=require(_0xd42e('0x16'));var licenseUtil=require(_0xd42e('0x17'));var db=require(_0xd42e('0x18'))['db'];function respondWithStatusCode(_0x4504de,_0x1cfa21){_0x1cfa21=_0x1cfa21||0xcc;return function(_0x3ed605){if(_0x3ed605){return _0x4504de[_0xd42e('0x19')](_0x1cfa21);}return _0x4504de[_0xd42e('0x1a')](_0x1cfa21)[_0xd42e('0x1b')]();};}function respondWithResult(_0x149e4c,_0x2f54eb){_0x2f54eb=_0x2f54eb||0xc8;return function(_0x3d3886){if(_0x3d3886){return _0x149e4c[_0xd42e('0x1a')](_0x2f54eb)['json'](_0x3d3886);}};}function respondWithFilteredResult(_0x3cc090,_0x4d880e){return function(_0x336f1e){if(_0x336f1e){var _0x441411=typeof _0x4d880e[_0xd42e('0x1c')]===_0xd42e('0x1d')&&typeof _0x4d880e[_0xd42e('0x1e')]===_0xd42e('0x1d');var _0x10366d=_0x336f1e[_0xd42e('0x1f')];var _0x50e11e=_0x441411?0x0:_0x4d880e['offset'];var _0x3ac42d=_0x441411?_0x336f1e[_0xd42e('0x1f')]:_0x4d880e[_0xd42e('0x1c')]+_0x4d880e['limit'];var _0x403b59;if(_0x3ac42d>=_0x10366d){_0x3ac42d=_0x10366d;_0x403b59=0xc8;}else{_0x403b59=0xce;}_0x3cc090[_0xd42e('0x1a')](_0x403b59);return _0x3cc090['set']('Content-Range',_0x50e11e+'-'+_0x3ac42d+'/'+_0x10366d)[_0xd42e('0x20')](_0x336f1e);}return null;};}function patchUpdates(_0x59ce72){return function(_0x35ffe2){try{jsonpatch[_0xd42e('0x21')](_0x35ffe2,_0x59ce72,!![]);}catch(_0x474190){return BPromise[_0xd42e('0x22')](_0x474190);}return _0x35ffe2['save']();};}function saveUpdates(_0xfaf1db,_0x18646c){return function(_0x35ffcc){if(_0x35ffcc){return _0x35ffcc[_0xd42e('0x23')](_0xfaf1db)[_0xd42e('0x24')](function(_0x375e17){return _0x375e17;});}return null;};}function removeEntity(_0x24abc4,_0x51fcb5){return function(_0x36358c){if(_0x36358c){return _0x36358c[_0xd42e('0x25')]()[_0xd42e('0x24')](function(){_0x24abc4['status'](0xcc)[_0xd42e('0x1b')]();});}};}function handleEntityNotFound(_0x38fe3c,_0x27eedf){return function(_0xb32b9e){if(!_0xb32b9e){_0x38fe3c[_0xd42e('0x19')](0x194);}return _0xb32b9e;};}function handleError(_0x5ece60,_0x5b238e){_0x5b238e=_0x5b238e||0x1f4;return function(_0x34b835){logger[_0xd42e('0x26')](_0x34b835[_0xd42e('0x27')]);if(_0x34b835[_0xd42e('0x28')]){delete _0x34b835[_0xd42e('0x28')];}_0x5ece60[_0xd42e('0x1a')](_0x5b238e)[_0xd42e('0x29')](_0x34b835);};}exports[_0xd42e('0x2a')]=function(_0x4b01fa,_0x789483){var _0x19e108={},_0x40425b={},_0x4ab021={'count':0x0,'rows':[]};var _0x3af461=_[_0xd42e('0x2b')](db[_0xd42e('0x2c')][_0xd42e('0x2d')],function(_0x2daea5){return{'name':_0x2daea5['fieldName'],'type':_0x2daea5[_0xd42e('0x2e')]['key']};});_0x40425b[_0xd42e('0x2f')]=_[_0xd42e('0x2b')](_0x3af461,_0xd42e('0x28'));_0x40425b['query']=_['keys'](_0x4b01fa['query']);_0x40425b[_0xd42e('0x30')]=_['intersection'](_0x40425b[_0xd42e('0x2f')],_0x40425b[_0xd42e('0x31')]);_0x19e108[_0xd42e('0x32')]=_[_0xd42e('0x33')](_0x40425b[_0xd42e('0x2f')],qs[_0xd42e('0x34')](_0x4b01fa['query'][_0xd42e('0x34')]));_0x19e108[_0xd42e('0x32')]=_0x19e108['attributes'][_0xd42e('0x35')]?_0x19e108[_0xd42e('0x32')]:_0x40425b[_0xd42e('0x2f')];if(!_0x4b01fa[_0xd42e('0x31')][_0xd42e('0x36')]('nolimit')){_0x19e108[_0xd42e('0x1e')]=qs[_0xd42e('0x1e')](_0x4b01fa[_0xd42e('0x31')][_0xd42e('0x1e')]);_0x19e108[_0xd42e('0x1c')]=qs[_0xd42e('0x1c')](_0x4b01fa[_0xd42e('0x31')][_0xd42e('0x1c')]);}_0x19e108[_0xd42e('0x37')]=qs[_0xd42e('0x38')](_0x4b01fa['query'][_0xd42e('0x38')]);_0x19e108[_0xd42e('0x39')]=qs[_0xd42e('0x30')](_['pick'](_0x4b01fa[_0xd42e('0x31')],_0x40425b[_0xd42e('0x30')]),_0x3af461);if(_0x4b01fa[_0xd42e('0x31')][_0xd42e('0x3a')]){_0x19e108[_0xd42e('0x39')]=_[_0xd42e('0x3b')](_0x19e108[_0xd42e('0x39')],{'$or':_[_0xd42e('0x2b')](_0x3af461,function(_0x379c0f){if(_0x379c0f[_0xd42e('0x2e')]!==_0xd42e('0x3c')){var _0x2cd7d2={};_0x2cd7d2[_0x379c0f[_0xd42e('0x28')]]={'$like':'%'+_0x4b01fa[_0xd42e('0x31')]['filter']+'%'};return _0x2cd7d2;}})});}_0x19e108=_[_0xd42e('0x3b')]({},_0x19e108,_0x4b01fa[_0xd42e('0x3d')]);var _0x55de5b={'where':_0x19e108[_0xd42e('0x39')]};return db[_0xd42e('0x2c')]['count'](_0x55de5b)['then'](function(_0x27c18f){_0x4ab021[_0xd42e('0x1f')]=_0x27c18f;if(_0x4b01fa[_0xd42e('0x31')][_0xd42e('0x3e')]){_0x19e108[_0xd42e('0x3f')]=[{'all':!![]}];}return db[_0xd42e('0x2c')][_0xd42e('0x40')](_0x19e108);})['then'](function(_0x13a4f7){_0x4ab021[_0xd42e('0x41')]=_0x13a4f7;return _0x4ab021;})[_0xd42e('0x24')](respondWithFilteredResult(_0x789483,_0x19e108))[_0xd42e('0x42')](handleError(_0x789483,null));};exports['show']=function(_0x21c26f,_0xcc1a97){var _0x59c1c1={'raw':![],'where':{'id':_0x21c26f[_0xd42e('0x43')]['id']}},_0x237818={};_0x237818['model']=_[_0xd42e('0x44')](db[_0xd42e('0x2c')]['rawAttributes']);_0x237818[_0xd42e('0x31')]=_[_0xd42e('0x44')](_0x21c26f[_0xd42e('0x31')]);_0x237818[_0xd42e('0x30')]=_['intersection'](_0x237818[_0xd42e('0x2f')],_0x237818[_0xd42e('0x31')]);_0x59c1c1[_0xd42e('0x32')]=_[_0xd42e('0x33')](_0x237818[_0xd42e('0x2f')],qs[_0xd42e('0x34')](_0x21c26f[_0xd42e('0x31')]['fields']));_0x59c1c1['attributes']=_0x59c1c1[_0xd42e('0x32')][_0xd42e('0x35')]?_0x59c1c1['attributes']:_0x237818['model'];if(_0x21c26f['query'][_0xd42e('0x3e')]){_0x59c1c1['include']=[{'all':!![]}];}_0x59c1c1=_['merge']({},_0x59c1c1,_0x21c26f[_0xd42e('0x3d')]);return db['Automation'][_0xd42e('0x45')](_0x59c1c1)[_0xd42e('0x24')](handleEntityNotFound(_0xcc1a97,null))[_0xd42e('0x24')](respondWithResult(_0xcc1a97,null))[_0xd42e('0x42')](handleError(_0xcc1a97,null));};exports['create']=function(_0x49262c,_0x611906){return db[_0xd42e('0x2c')][_0xd42e('0x46')](_0x49262c[_0xd42e('0x47')],{})['then'](respondWithResult(_0x611906,0xc9))['catch'](handleError(_0x611906,null));};exports['update']=function(_0x1ed8bf,_0x32ee1f){if(_0x1ed8bf['body']['id']){delete _0x1ed8bf[_0xd42e('0x47')]['id'];}return db[_0xd42e('0x2c')]['find']({'where':{'id':_0x1ed8bf['params']['id']}})['then'](handleEntityNotFound(_0x32ee1f,null))[_0xd42e('0x24')](saveUpdates(_0x1ed8bf[_0xd42e('0x47')],null))[_0xd42e('0x24')](respondWithResult(_0x32ee1f,null))[_0xd42e('0x42')](handleError(_0x32ee1f,null));};exports[_0xd42e('0x25')]=function(_0x28ce0e,_0x5eebba){return db[_0xd42e('0x2c')][_0xd42e('0x45')]({'where':{'id':_0x28ce0e[_0xd42e('0x43')]['id']}})['then'](handleEntityNotFound(_0x5eebba,null))[_0xd42e('0x24')](removeEntity(_0x5eebba,null))['catch'](handleError(_0x5eebba,null));};exports[_0xd42e('0x48')]=function(_0x225ecb,_0x752349,_0x19202d){return db[_0xd42e('0x49')][_0xd42e('0x45')]({'where':{'id':_0x225ecb[_0xd42e('0x43')]['id']}})[_0xd42e('0x24')](handleEntityNotFound(_0x752349,null))['then'](function(_0x21ef23){if(_0x21ef23){return _0x21ef23[_0xd42e('0x48')](_0x225ecb['body'][_0xd42e('0x4a')],_[_0xd42e('0x4b')](_0x225ecb[_0xd42e('0x47')],[_0xd42e('0x4a'),'id'])||{});}})[_0xd42e('0x24')](respondWithResult(_0x752349,null))[_0xd42e('0x42')](handleError(_0x752349,null));};exports[_0xd42e('0x4c')]=function(_0x540b06,_0x21c4b7,_0x43b9f6){var _0x54e7e2={};var _0x3351fc={};var _0x17655c;var _0x1aec84;return db[_0xd42e('0x2c')][_0xd42e('0x4d')]({'where':{'id':_0x540b06[_0xd42e('0x43')]['id']}})[_0xd42e('0x24')](handleEntityNotFound(_0x21c4b7,null))[_0xd42e('0x24')](function(_0x5135c1){if(_0x5135c1){_0x17655c=_0x5135c1;_0x3351fc[_0xd42e('0x2f')]=_[_0xd42e('0x44')](db[_0xd42e('0x49')]['rawAttributes']);_0x3351fc[_0xd42e('0x31')]=_['keys'](_0x540b06['query']);_0x3351fc[_0xd42e('0x30')]=_[_0xd42e('0x33')](_0x3351fc[_0xd42e('0x2f')],_0x3351fc['query']);_0x54e7e2[_0xd42e('0x32')]=_[_0xd42e('0x33')](_0x3351fc['model'],qs[_0xd42e('0x34')](_0x540b06[_0xd42e('0x31')][_0xd42e('0x34')]));_0x54e7e2[_0xd42e('0x32')]=_0x54e7e2[_0xd42e('0x32')]['length']?_0x54e7e2[_0xd42e('0x32')]:_0x3351fc['model'];_0x54e7e2[_0xd42e('0x37')]=qs[_0xd42e('0x38')](_0x540b06[_0xd42e('0x31')][_0xd42e('0x38')]);_0x54e7e2[_0xd42e('0x39')]=qs[_0xd42e('0x30')](_['pick'](_0x540b06[_0xd42e('0x31')],_0x3351fc['filters']));if(_0x540b06[_0xd42e('0x31')][_0xd42e('0x3a')]){_0x54e7e2[_0xd42e('0x39')]=_[_0xd42e('0x3b')](_0x54e7e2['where'],{'$or':_[_0xd42e('0x2b')](_0x54e7e2[_0xd42e('0x32')],function(_0x4e8406){var _0x5cf2f0={};_0x5cf2f0[_0x4e8406]={'$like':'%'+_0x540b06[_0xd42e('0x31')]['filter']+'%'};return _0x5cf2f0;})});}_0x54e7e2=_[_0xd42e('0x3b')]({},_0x54e7e2,_0x540b06[_0xd42e('0x3d')]);return _0x17655c[_0xd42e('0x4c')](_0x54e7e2);}})[_0xd42e('0x24')](function(_0x88fa44){if(_0x88fa44){_0x1aec84=_0x88fa44[_0xd42e('0x35')];if(!_0x540b06['query'][_0xd42e('0x36')]('nolimit')){_0x54e7e2[_0xd42e('0x1e')]=qs[_0xd42e('0x1e')](_0x540b06[_0xd42e('0x31')]['limit']);_0x54e7e2[_0xd42e('0x1c')]=qs[_0xd42e('0x1c')](_0x540b06[_0xd42e('0x31')]['offset']);}return _0x17655c['getConditions'](_0x54e7e2);}})[_0xd42e('0x24')](function(_0x2f9d11){if(_0x2f9d11){return _0x2f9d11?{'count':_0x1aec84,'rows':_0x2f9d11}:null;}})[_0xd42e('0x24')](respondWithResult(_0x21c4b7,null))['catch'](handleError(_0x21c4b7,null));};exports[_0xd42e('0x4e')]=function(_0x5588cf,_0x2d6c85,_0x2c3de1){return db[_0xd42e('0x4f')][_0xd42e('0x45')]({'where':{'id':_0x5588cf['params']['id']}})[_0xd42e('0x24')](handleEntityNotFound(_0x2d6c85,null))[_0xd42e('0x24')](function(_0x2b0957){if(_0x2b0957){return _0x2b0957[_0xd42e('0x4e')](_0x5588cf[_0xd42e('0x47')][_0xd42e('0x4a')],_['omit'](_0x5588cf[_0xd42e('0x47')],[_0xd42e('0x4a'),'id'])||{});}})[_0xd42e('0x24')](respondWithResult(_0x2d6c85,null))[_0xd42e('0x42')](handleError(_0x2d6c85,null));};exports[_0xd42e('0x50')]=function(_0xb3497,_0x4e205c,_0xdda171){var _0xfa514a={};var _0x24e3e0={};var _0x287d6e;var _0x3ffc88;return db[_0xd42e('0x2c')]['findOne']({'where':{'id':_0xb3497[_0xd42e('0x43')]['id']}})['then'](handleEntityNotFound(_0x4e205c,null))['then'](function(_0x21734b){if(_0x21734b){_0x287d6e=_0x21734b;_0x24e3e0[_0xd42e('0x2f')]=_[_0xd42e('0x44')](db[_0xd42e('0x4f')][_0xd42e('0x2d')]);_0x24e3e0[_0xd42e('0x31')]=_[_0xd42e('0x44')](_0xb3497[_0xd42e('0x31')]);_0x24e3e0[_0xd42e('0x30')]=_[_0xd42e('0x33')](_0x24e3e0[_0xd42e('0x2f')],_0x24e3e0[_0xd42e('0x31')]);_0xfa514a[_0xd42e('0x32')]=_[_0xd42e('0x33')](_0x24e3e0[_0xd42e('0x2f')],qs[_0xd42e('0x34')](_0xb3497[_0xd42e('0x31')][_0xd42e('0x34')]));_0xfa514a[_0xd42e('0x32')]=_0xfa514a[_0xd42e('0x32')][_0xd42e('0x35')]?_0xfa514a[_0xd42e('0x32')]:_0x24e3e0[_0xd42e('0x2f')];_0xfa514a[_0xd42e('0x37')]=qs[_0xd42e('0x38')](_0xb3497['query'][_0xd42e('0x38')]);_0xfa514a[_0xd42e('0x39')]=qs['filters'](_['pick'](_0xb3497[_0xd42e('0x31')],_0x24e3e0[_0xd42e('0x30')]));if(_0xb3497[_0xd42e('0x31')][_0xd42e('0x3a')]){_0xfa514a[_0xd42e('0x39')]=_[_0xd42e('0x3b')](_0xfa514a['where'],{'$or':_[_0xd42e('0x2b')](_0xfa514a[_0xd42e('0x32')],function(_0x18ce9c){var _0x3ba5de={};_0x3ba5de[_0x18ce9c]={'$like':'%'+_0xb3497[_0xd42e('0x31')][_0xd42e('0x3a')]+'%'};return _0x3ba5de;})});}_0xfa514a=_['merge']({},_0xfa514a,_0xb3497[_0xd42e('0x3d')]);return _0x287d6e['getActions'](_0xfa514a);}})[_0xd42e('0x24')](function(_0x451ce2){if(_0x451ce2){_0x3ffc88=_0x451ce2[_0xd42e('0x35')];if(!_0xb3497[_0xd42e('0x31')][_0xd42e('0x36')](_0xd42e('0x51'))){_0xfa514a['limit']=qs[_0xd42e('0x1e')](_0xb3497['query'][_0xd42e('0x1e')]);_0xfa514a[_0xd42e('0x1c')]=qs[_0xd42e('0x1c')](_0xb3497[_0xd42e('0x31')]['offset']);}return _0x287d6e[_0xd42e('0x50')](_0xfa514a);}})['then'](function(_0x534665){if(_0x534665){return _0x534665?{'count':_0x3ffc88,'rows':_0x534665}:null;}})[_0xd42e('0x24')](respondWithResult(_0x4e205c,null))['catch'](handleError(_0x4e205c,null));};
\ No newline at end of file
diff --git a/server/api/automation/automation.model.js b/server/api/automation/automation.model.js
index e70e0b4..74c4225 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 _0x46cd=['rimraf','../../config/environment','./automation.attributes','exports','define','Automation','tools_automations','lodash','util','../../config/logger','moment','request-promise','path'];(function(_0x32e4de,_0x7da1c5){var _0x51ba2a=function(_0x2a7322){while(--_0x2a7322){_0x32e4de['push'](_0x32e4de['shift']());}};_0x51ba2a(++_0x7da1c5);}(_0x46cd,0xd7));var _0xd46c=function(_0x616290,_0x280b7f){_0x616290=_0x616290-0x0;var _0x453879=_0x46cd[_0x616290];return _0x453879;};'use strict';var _=require(_0xd46c('0x0'));var util=require(_0xd46c('0x1'));var logger=require(_0xd46c('0x2'))('api');var moment=require(_0xd46c('0x3'));var BPromise=require('bluebird');var rp=require(_0xd46c('0x4'));var fs=require('fs');var path=require(_0xd46c('0x5'));var rimraf=require(_0xd46c('0x6'));var config=require(_0xd46c('0x7'));var attributes=require(_0xd46c('0x8'));module[_0xd46c('0x9')]=function(_0xdb3d5a,_0x576568){return _0xdb3d5a[_0xd46c('0xa')](_0xd46c('0xb'),attributes,{'tableName':_0xd46c('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x76b6=['util','../../config/logger','api','moment','path','rimraf','../../config/environment','exports','define','Automation','tools_automations','lodash'];(function(_0xa77cc9,_0x3df827){var _0x55d0d5=function(_0x5a2a39){while(--_0x5a2a39){_0xa77cc9['push'](_0xa77cc9['shift']());}};_0x55d0d5(++_0x3df827);}(_0x76b6,0x173));var _0x676b=function(_0x25878e,_0x5b4169){_0x25878e=_0x25878e-0x0;var _0x284151=_0x76b6[_0x25878e];return _0x284151;};'use strict';var _=require(_0x676b('0x0'));var util=require(_0x676b('0x1'));var logger=require(_0x676b('0x2'))(_0x676b('0x3'));var moment=require(_0x676b('0x4'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x676b('0x5'));var rimraf=require(_0x676b('0x6'));var config=require(_0x676b('0x7'));var attributes=require('./automation.attributes');module[_0x676b('0x8')]=function(_0x34d3dc,_0x4ce692){return _0x34d3dc[_0x676b('0x9')](_0x676b('0xa'),attributes,{'tableName':_0x676b('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
diff --git a/server/api/automation/automation.rpc.js b/server/api/automation/automation.rpc.js
index ad0a486..0136c65 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 _0x86c0=['Automation,\x20%s,\x20%s,\x20%s','stringify','error','code','Automation,\x20%s,\x20%s','message','info','result','lodash','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','request','then','request\x20sent','debug'];(function(_0x476bf4,_0x2a3755){var _0x788ffe=function(_0x13fa11){while(--_0x13fa11){_0x476bf4['push'](_0x476bf4['shift']());}};_0x788ffe(++_0x2a3755);}(_0x86c0,0x133));var _0x086c=function(_0x5d4205,_0x135eaa){_0x5d4205=_0x5d4205-0x0;var _0x3ff943=_0x86c0[_0x5d4205];return _0x3ff943;};'use strict';var _=require(_0x086c('0x0'));var util=require('util');var moment=require(_0x086c('0x1'));var BPromise=require(_0x086c('0x2'));var rs=require(_0x086c('0x3'));var fs=require('fs');var Redis=require(_0x086c('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x086c('0x5'));var logger=require(_0x086c('0x6'))(_0x086c('0x7'));var config=require(_0x086c('0x8'));var jayson=require('jayson/promise');var client=jayson[_0x086c('0x9')][_0x086c('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x2e27a8,_0x387428,_0x117df9){return new BPromise(function(_0x25e437,_0x52b942){return client[_0x086c('0xb')](_0x2e27a8,_0x117df9)[_0x086c('0xc')](function(_0xa1b79a){logger['info']('Automation,\x20%s,\x20%s',_0x387428,_0x086c('0xd'));logger[_0x086c('0xe')](_0x086c('0xf'),_0x387428,_0x086c('0xd'),JSON[_0x086c('0x10')](_0xa1b79a));if(_0xa1b79a['error']){if(_0xa1b79a[_0x086c('0x11')][_0x086c('0x12')]===0x1f4){logger[_0x086c('0x11')](_0x086c('0x13'),_0x387428,_0xa1b79a['error']['message']);return _0x52b942(_0xa1b79a[_0x086c('0x11')]['message']);}logger[_0x086c('0x11')](_0x086c('0x13'),_0x387428,_0xa1b79a['error'][_0x086c('0x14')]);return _0x25e437(_0xa1b79a[_0x086c('0x11')][_0x086c('0x14')]);}else{logger[_0x086c('0x15')]('Automation,\x20%s,\x20%s',_0x387428,_0x086c('0xd'));_0x25e437(_0xa1b79a[_0x086c('0x16')][_0x086c('0x14')]);}})['catch'](function(_0x34e74f){logger[_0x086c('0x11')](_0x086c('0x13'),_0x387428,_0x34e74f);_0x52b942(_0x34e74f);});});}
\ No newline at end of file
+var _0x6c00=['rpc','../../config/environment','jayson/promise','client','http','request','then','info','Automation,\x20%s,\x20%s','request\x20sent','debug','Automation,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils'];(function(_0x5dd853,_0x562937){var _0x2b172f=function(_0x56b80f){while(--_0x56b80f){_0x5dd853['push'](_0x5dd853['shift']());}};_0x2b172f(++_0x562937);}(_0x6c00,0x1a9));var _0x06c0=function(_0x473738,_0x15ea31){_0x473738=_0x473738-0x0;var _0x1df4ae=_0x6c00[_0x473738];return _0x1df4ae;};'use strict';var _=require(_0x06c0('0x0'));var util=require(_0x06c0('0x1'));var moment=require(_0x06c0('0x2'));var BPromise=require('bluebird');var rs=require(_0x06c0('0x3'));var fs=require('fs');var Redis=require(_0x06c0('0x4'));var db=require(_0x06c0('0x5'))['db'];var utils=require(_0x06c0('0x6'));var logger=require('../../config/logger')(_0x06c0('0x7'));var config=require(_0x06c0('0x8'));var jayson=require(_0x06c0('0x9'));var client=jayson[_0x06c0('0xa')][_0x06c0('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x5978d1,_0x5a686f,_0x46f544){return new BPromise(function(_0x257556,_0x5f2ac0){return client[_0x06c0('0xc')](_0x5978d1,_0x46f544)[_0x06c0('0xd')](function(_0x2c1f22){logger[_0x06c0('0xe')](_0x06c0('0xf'),_0x5a686f,_0x06c0('0x10'));logger[_0x06c0('0x11')](_0x06c0('0x12'),_0x5a686f,_0x06c0('0x10'),JSON[_0x06c0('0x13')](_0x2c1f22));if(_0x2c1f22[_0x06c0('0x14')]){if(_0x2c1f22['error']['code']===0x1f4){logger[_0x06c0('0x14')](_0x06c0('0xf'),_0x5a686f,_0x2c1f22[_0x06c0('0x14')][_0x06c0('0x15')]);return _0x5f2ac0(_0x2c1f22[_0x06c0('0x14')]['message']);}logger['error'](_0x06c0('0xf'),_0x5a686f,_0x2c1f22[_0x06c0('0x14')][_0x06c0('0x15')]);return _0x257556(_0x2c1f22[_0x06c0('0x14')][_0x06c0('0x15')]);}else{logger[_0x06c0('0xe')](_0x06c0('0xf'),_0x5a686f,'request\x20sent');_0x257556(_0x2c1f22[_0x06c0('0x16')][_0x06c0('0x15')]);}})[_0x06c0('0x17')](function(_0x2dd969){logger[_0x06c0('0x14')]('Automation,\x20%s,\x20%s',_0x5a686f,_0x2dd969);_0x5f2ac0(_0x2dd969);});});}
\ No newline at end of file
diff --git a/server/api/automation/index.js b/server/api/automation/index.js
index a8b7a98..11cc512 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 _0x207d=['./automation.controller','get','isAuthenticated','index','/:id','show','/:id/conditions','/:id/actions','create','post','addActions','put','update','delete','destroy','exports','multer','util','path','connect-timeout','Router','../../components/auth/service','../../components/interaction/service'];(function(_0x14e67a,_0x2f62a3){var _0x2e53be=function(_0x5d27ea){while(--_0x5d27ea){_0x14e67a['push'](_0x14e67a['shift']());}};_0x2e53be(++_0x2f62a3);}(_0x207d,0x10d));var _0xd207=function(_0x2a29de,_0x1acca3){_0x2a29de=_0x2a29de-0x0;var _0x1e31f3=_0x207d[_0x2a29de];return _0x1e31f3;};'use strict';var multer=require(_0xd207('0x0'));var util=require(_0xd207('0x1'));var path=require(_0xd207('0x2'));var timeout=require(_0xd207('0x3'));var express=require('express');var router=express[_0xd207('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0xd207('0x5'));var interaction=require(_0xd207('0x6'));var config=require('../../config/environment');var controller=require(_0xd207('0x7'));router[_0xd207('0x8')]('/',auth[_0xd207('0x9')](),controller[_0xd207('0xa')]);router[_0xd207('0x8')](_0xd207('0xb'),auth[_0xd207('0x9')](),controller[_0xd207('0xc')]);router[_0xd207('0x8')](_0xd207('0xd'),auth[_0xd207('0x9')](),controller['getConditions']);router[_0xd207('0x8')](_0xd207('0xe'),auth[_0xd207('0x9')](),controller['getActions']);router['post']('/',auth[_0xd207('0x9')](),controller[_0xd207('0xf')]);router[_0xd207('0x10')]('/:id/conditions',auth[_0xd207('0x9')](),controller['addConditions']);router['post']('/:id/actions',auth[_0xd207('0x9')](),controller[_0xd207('0x11')]);router[_0xd207('0x12')](_0xd207('0xb'),auth[_0xd207('0x9')](),controller[_0xd207('0x13')]);router[_0xd207('0x14')](_0xd207('0xb'),auth[_0xd207('0x9')](),controller[_0xd207('0x15')]);module[_0xd207('0x16')]=router;
\ No newline at end of file
+var _0x26ed=['fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./automation.controller','get','isAuthenticated','/:id','show','getConditions','/:id/actions','post','create','/:id/conditions','addConditions','addActions','put','update','delete','destroy','exports','multer','path','connect-timeout','Router'];(function(_0x711bc2,_0x43a478){var _0x34fa5d=function(_0x5b3f2c){while(--_0x5b3f2c){_0x711bc2['push'](_0x711bc2['shift']());}};_0x34fa5d(++_0x43a478);}(_0x26ed,0x1f0));var _0xd26e=function(_0x26ac27,_0x574b86){_0x26ac27=_0x26ac27-0x0;var _0x44a599=_0x26ed[_0x26ac27];return _0x44a599;};'use strict';var multer=require(_0xd26e('0x0'));var util=require('util');var path=require(_0xd26e('0x1'));var timeout=require(_0xd26e('0x2'));var express=require('express');var router=express[_0xd26e('0x3')]();var fs_extra=require(_0xd26e('0x4'));var auth=require(_0xd26e('0x5'));var interaction=require(_0xd26e('0x6'));var config=require(_0xd26e('0x7'));var controller=require(_0xd26e('0x8'));router[_0xd26e('0x9')]('/',auth[_0xd26e('0xa')](),controller['index']);router[_0xd26e('0x9')](_0xd26e('0xb'),auth[_0xd26e('0xa')](),controller[_0xd26e('0xc')]);router[_0xd26e('0x9')]('/:id/conditions',auth[_0xd26e('0xa')](),controller[_0xd26e('0xd')]);router[_0xd26e('0x9')](_0xd26e('0xe'),auth[_0xd26e('0xa')](),controller['getActions']);router[_0xd26e('0xf')]('/',auth['isAuthenticated'](),controller[_0xd26e('0x10')]);router[_0xd26e('0xf')](_0xd26e('0x11'),auth['isAuthenticated'](),controller[_0xd26e('0x12')]);router[_0xd26e('0xf')](_0xd26e('0xe'),auth[_0xd26e('0xa')](),controller[_0xd26e('0x13')]);router[_0xd26e('0x14')](_0xd26e('0xb'),auth[_0xd26e('0xa')](),controller[_0xd26e('0x15')]);router[_0xd26e('0x16')](_0xd26e('0xb'),auth[_0xd26e('0xa')](),controller[_0xd26e('0x17')]);module[_0xd26e('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 08215f1..068014f 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 _0x2838=['07:00-22:00,*,*,*','always','never','onlyIfOpen','Active/Disactive\x20AMD','#AMD\x20Initial\x20Silence','#AMD\x20Greeting','#AMD\x20After\x20Greeting\x20Silence','#AMD\x20Total\x20Analysis\x20Time','#AMD\x20Min\x20Word\x20Length','#AMD\x20Between\x20Words\x20Silence','#AMD\x20Maximum\x20Word\x20Length','DESC','ASC','Cut\x20Digit\x20(min:1,\x20max:15)','#NoSuchNumber\x20Retry\x20(min:1,\x20max:999)','NoSuchNumber\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','STRING','name','ivr','BOOLEAN','Active/Disactive\x20Campaign','UNSIGNED','Max\x20200\x20calls.','#Congestion\x20Retry\x20(min:1,\x20max:999)','INTEGER','Congestion\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','Busy\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#NoAnswer\x20Retry\x20(min:1,\x20max:999)','NoAnswer\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Global\x20Max\x20Retry\x20(min:1,\x20max:999)'];(function(_0x383dbb,_0x17d41b){var _0x6e8bde=function(_0x2740f1){while(--_0x2740f1){_0x383dbb['push'](_0x383dbb['shift']());}};_0x6e8bde(++_0x17d41b);}(_0x2838,0x146));var _0x8283=function(_0x1aa0e7,_0x498fbd){_0x1aa0e7=_0x1aa0e7-0x0;var _0x55f771=_0x2838[_0x1aa0e7];return _0x55f771;};'use strict';var Sequelize=require(_0x8283('0x0'));module[_0x8283('0x1')]={'name':{'type':Sequelize[_0x8283('0x2')],'unique':_0x8283('0x3'),'allowNull':![],'validate':{'is':/[A-Za-z0-9._\\+*!-]+/,'notEmpty':!![]}},'type':{'type':Sequelize['ENUM'](_0x8283('0x4')),'allowNull':![],'defaultValue':'ivr'},'description':{'type':Sequelize[_0x8283('0x2')]},'active':{'type':Sequelize[_0x8283('0x5')],'defaultValue':0x0,'comment':_0x8283('0x6')},'limitCalls':{'type':Sequelize['INTEGER'](0x4)[_0x8283('0x7')],'defaultValue':0x1e,'validate':{'min':0x1,'max':0xc8},'comment':_0x8283('0x8')},'dialOriginateCallerIdName':{'type':Sequelize[_0x8283('0x2')]},'dialOriginateCallerIdNumber':{'type':Sequelize['STRING']},'dialOriginateTimeout':{'type':Sequelize['INTEGER'](0x3)[_0x8283('0x7')],'defaultValue':0x1e,'validate':{'min':0x1,'max':0x3e7},'comment':'Originate\x20Timeout\x20Seconds\x20(min:1,\x20max:999)'},'dialCongestionMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0x8283('0x7')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x8283('0x9')},'dialCongestionRetryFrequency':{'type':Sequelize[_0x8283('0xa')](0x5)[_0x8283('0x7')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x8283('0xb')},'dialBusyMaxRetry':{'type':Sequelize[_0x8283('0xa')](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#Busy\x20Retry\x20(min:1,\x20max:999)'},'dialBusyRetryFrequency':{'type':Sequelize[_0x8283('0xa')](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x8283('0xc')},'dialNoAnswerMaxRetry':{'type':Sequelize[_0x8283('0xa')](0x3)['UNSIGNED'],'defaultValue':0x3,'comment':_0x8283('0xd')},'dialNoAnswerRetryFrequency':{'type':Sequelize['INTEGER'](0x5)[_0x8283('0x7')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x8283('0xe')},'dialGlobalMaxRetry':{'type':Sequelize[_0x8283('0xa')](0x3)[_0x8283('0x7')],'validate':{'min':0x1,'max':0x3e7},'defaultValue':0x4,'comment':_0x8283('0xf')},'dialTimezone':{'type':Sequelize['STRING'],'defaultValue':null},'dialGlobalInterval':{'type':Sequelize['STRING'],'defaultValue':_0x8283('0x10')},'dialCheckDuplicateType':{'type':Sequelize['ENUM'](_0x8283('0x11'),_0x8283('0x12'),_0x8283('0x13')),'defaultValue':_0x8283('0x11')},'dialAMDActive':{'type':Sequelize[_0x8283('0x5')],'defaultValue':0x0,'comment':_0x8283('0x14')},'dialAMDInitialSilence':{'type':Sequelize[_0x8283('0xa')](0x9)[_0x8283('0x7')],'defaultValue':0x9c4,'validate':{'min':0x0},'comment':_0x8283('0x15')},'dialAMDGreeting':{'type':Sequelize[_0x8283('0xa')](0x9)[_0x8283('0x7')],'defaultValue':0x5dc,'validate':{'min':0x0},'comment':_0x8283('0x16')},'dialAMDAfterGreetingSilence':{'type':Sequelize[_0x8283('0xa')](0x9)[_0x8283('0x7')],'defaultValue':0x320,'validate':{'min':0x0},'comment':_0x8283('0x17')},'dialAMDTotalAnalysisTime':{'type':Sequelize[_0x8283('0xa')](0x9)['UNSIGNED'],'defaultValue':0x1388,'validate':{'min':0x0},'comment':_0x8283('0x18')},'dialAMDMinWordLength':{'type':Sequelize[_0x8283('0xa')](0x9)['UNSIGNED'],'defaultValue':0x64,'validate':{'min':0x0},'comment':_0x8283('0x19')},'dialAMDBetweenWordsSilence':{'type':Sequelize[_0x8283('0xa')](0x9)[_0x8283('0x7')],'defaultValue':0x32,'validate':{'min':0x0},'comment':_0x8283('0x1a')},'dialAMDMaximumNumberOfWords':{'type':Sequelize[_0x8283('0xa')](0x9)[_0x8283('0x7')],'defaultValue':0x3,'validate':{'min':0x0},'comment':'#AMD\x20Maximum\x20Number\x20Of\x20Words'},'dialAMDSilenceThreshold':{'type':Sequelize[_0x8283('0xa')](0x5)[_0x8283('0x7')],'validate':{'min':0x0,'max':0x7fff},'defaultValue':0x100,'comment':'#AMD\x20Silence\x20Threshold\x20(min:0,\x20max:32767)'},'dialAMDMaximumWordLength':{'type':Sequelize[_0x8283('0xa')](0x9)['UNSIGNED'],'defaultValue':0x1388,'validate':{'min':0x0},'comment':_0x8283('0x1b')},'dialOrderByScheduledAt':{'type':Sequelize['ENUM'](_0x8283('0x1c'),_0x8283('0x1d')),'defaultValue':_0x8283('0x1c')},'dialPrefix':{'type':Sequelize['STRING'],'defaultValue':null},'dialRandomLastDigitCallerIdNumber':{'type':Sequelize[_0x8283('0xa')](0x3)[_0x8283('0x7')],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':'Random\x20Last\x20Digit\x20(min:1,\x20max:15)'},'dialCutDigit':{'type':Sequelize['INTEGER'](0x3)[_0x8283('0x7')],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':_0x8283('0x1e')},'dialNoSuchNumberMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0x8283('0x7')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x8283('0x1f')},'dialNoSuchNumberRetryFrequency':{'type':Sequelize['INTEGER'](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x8283('0x20')},'dialDropMaxRetry':{'type':Sequelize[_0x8283('0xa')](0x3)[_0x8283('0x7')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#Drop\x20Retry\x20(min:1,\x20max:999)'},'dialDropRetryFrequency':{'type':Sequelize[_0x8283('0xa')](0x5)[_0x8283('0x7')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'Drop\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialAbandonedMaxRetry':{'type':Sequelize[_0x8283('0xa')](0x3)[_0x8283('0x7')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x8283('0x21')},'dialAbandonedRetryFrequency':{'type':Sequelize[_0x8283('0xa')](0x5)[_0x8283('0x7')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x8283('0x22')},'dialMachineMaxRetry':{'type':Sequelize[_0x8283('0xa')](0x3)[_0x8283('0x7')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x8283('0x23')},'dialMachineRetryFrequency':{'type':Sequelize[_0x8283('0xa')](0x5)[_0x8283('0x7')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x8283('0x24')},'dialAgentRejectMaxRetry':{'type':Sequelize[_0x8283('0xa')](0x3)[_0x8283('0x7')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x8283('0x25')},'dialAgentRejectRetryFrequency':{'type':Sequelize[_0x8283('0xa')](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
+var _0x6b68=['INTEGER','#Congestion\x20Retry\x20(min:1,\x20max:999)','Congestion\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','Busy\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#NoAnswer\x20Retry\x20(min:1,\x20max:999)','always','never','Active/Disactive\x20AMD','#AMD\x20Initial\x20Silence','#AMD\x20Greeting','#AMD\x20After\x20Greeting\x20Silence','#AMD\x20Total\x20Analysis\x20Time','#AMD\x20Min\x20Word\x20Length','#AMD\x20Maximum\x20Number\x20Of\x20Words','#AMD\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)','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','STRING','ENUM','ivr','BOOLEAN','Active/Disactive\x20Campaign','UNSIGNED','Max\x20200\x20calls.','Originate\x20Timeout\x20Seconds\x20(min:1,\x20max:999)'];(function(_0x221418,_0x92a8bf){var _0x475b33=function(_0x394578){while(--_0x394578){_0x221418['push'](_0x221418['shift']());}};_0x475b33(++_0x92a8bf);}(_0x6b68,0x1be));var _0x86b6=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x6b68[_0x3dd15e];return _0x231fd0;};'use strict';var Sequelize=require(_0x86b6('0x0'));module[_0x86b6('0x1')]={'name':{'type':Sequelize[_0x86b6('0x2')],'unique':'name','allowNull':![],'validate':{'is':/[A-Za-z0-9._\\+*!-]+/,'notEmpty':!![]}},'type':{'type':Sequelize[_0x86b6('0x3')]('ivr'),'allowNull':![],'defaultValue':_0x86b6('0x4')},'description':{'type':Sequelize['STRING']},'active':{'type':Sequelize[_0x86b6('0x5')],'defaultValue':0x0,'comment':_0x86b6('0x6')},'limitCalls':{'type':Sequelize['INTEGER'](0x4)[_0x86b6('0x7')],'defaultValue':0x1e,'validate':{'min':0x1,'max':0xc8},'comment':_0x86b6('0x8')},'dialOriginateCallerIdName':{'type':Sequelize[_0x86b6('0x2')]},'dialOriginateCallerIdNumber':{'type':Sequelize[_0x86b6('0x2')]},'dialOriginateTimeout':{'type':Sequelize['INTEGER'](0x3)[_0x86b6('0x7')],'defaultValue':0x1e,'validate':{'min':0x1,'max':0x3e7},'comment':_0x86b6('0x9')},'dialCongestionMaxRetry':{'type':Sequelize[_0x86b6('0xa')](0x3)[_0x86b6('0x7')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x86b6('0xb')},'dialCongestionRetryFrequency':{'type':Sequelize[_0x86b6('0xa')](0x5)[_0x86b6('0x7')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x86b6('0xc')},'dialBusyMaxRetry':{'type':Sequelize[_0x86b6('0xa')](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#Busy\x20Retry\x20(min:1,\x20max:999)'},'dialBusyRetryFrequency':{'type':Sequelize[_0x86b6('0xa')](0x5)[_0x86b6('0x7')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x86b6('0xd')},'dialNoAnswerMaxRetry':{'type':Sequelize[_0x86b6('0xa')](0x3)[_0x86b6('0x7')],'defaultValue':0x3,'comment':_0x86b6('0xe')},'dialNoAnswerRetryFrequency':{'type':Sequelize[_0x86b6('0xa')](0x5)[_0x86b6('0x7')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'NoAnswer\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialGlobalMaxRetry':{'type':Sequelize[_0x86b6('0xa')](0x3)[_0x86b6('0x7')],'validate':{'min':0x1,'max':0x3e7},'defaultValue':0x4,'comment':'#Global\x20Max\x20Retry\x20(min:1,\x20max:999)'},'dialTimezone':{'type':Sequelize[_0x86b6('0x2')],'defaultValue':null},'dialGlobalInterval':{'type':Sequelize['STRING'],'defaultValue':'07:00-22:00,*,*,*'},'dialCheckDuplicateType':{'type':Sequelize[_0x86b6('0x3')](_0x86b6('0xf'),_0x86b6('0x10'),'onlyIfOpen'),'defaultValue':_0x86b6('0xf')},'dialAMDActive':{'type':Sequelize[_0x86b6('0x5')],'defaultValue':0x0,'comment':_0x86b6('0x11')},'dialAMDInitialSilence':{'type':Sequelize[_0x86b6('0xa')](0x9)['UNSIGNED'],'defaultValue':0x9c4,'validate':{'min':0x0},'comment':_0x86b6('0x12')},'dialAMDGreeting':{'type':Sequelize[_0x86b6('0xa')](0x9)[_0x86b6('0x7')],'defaultValue':0x5dc,'validate':{'min':0x0},'comment':_0x86b6('0x13')},'dialAMDAfterGreetingSilence':{'type':Sequelize['INTEGER'](0x9)[_0x86b6('0x7')],'defaultValue':0x320,'validate':{'min':0x0},'comment':_0x86b6('0x14')},'dialAMDTotalAnalysisTime':{'type':Sequelize['INTEGER'](0x9)[_0x86b6('0x7')],'defaultValue':0x1388,'validate':{'min':0x0},'comment':_0x86b6('0x15')},'dialAMDMinWordLength':{'type':Sequelize[_0x86b6('0xa')](0x9)[_0x86b6('0x7')],'defaultValue':0x64,'validate':{'min':0x0},'comment':_0x86b6('0x16')},'dialAMDBetweenWordsSilence':{'type':Sequelize[_0x86b6('0xa')](0x9)['UNSIGNED'],'defaultValue':0x32,'validate':{'min':0x0},'comment':'#AMD\x20Between\x20Words\x20Silence'},'dialAMDMaximumNumberOfWords':{'type':Sequelize['INTEGER'](0x9)[_0x86b6('0x7')],'defaultValue':0x3,'validate':{'min':0x0},'comment':_0x86b6('0x17')},'dialAMDSilenceThreshold':{'type':Sequelize['INTEGER'](0x5)['UNSIGNED'],'validate':{'min':0x0,'max':0x7fff},'defaultValue':0x100,'comment':_0x86b6('0x18')},'dialAMDMaximumWordLength':{'type':Sequelize[_0x86b6('0xa')](0x9)['UNSIGNED'],'defaultValue':0x1388,'validate':{'min':0x0},'comment':_0x86b6('0x19')},'dialOrderByScheduledAt':{'type':Sequelize[_0x86b6('0x3')](_0x86b6('0x1a'),_0x86b6('0x1b')),'defaultValue':_0x86b6('0x1a')},'dialPrefix':{'type':Sequelize[_0x86b6('0x2')],'defaultValue':null},'dialRandomLastDigitCallerIdNumber':{'type':Sequelize[_0x86b6('0xa')](0x3)[_0x86b6('0x7')],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':_0x86b6('0x1c')},'dialCutDigit':{'type':Sequelize['INTEGER'](0x3)[_0x86b6('0x7')],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':_0x86b6('0x1d')},'dialNoSuchNumberMaxRetry':{'type':Sequelize[_0x86b6('0xa')](0x3)[_0x86b6('0x7')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x86b6('0x1e')},'dialNoSuchNumberRetryFrequency':{'type':Sequelize[_0x86b6('0xa')](0x5)[_0x86b6('0x7')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x86b6('0x1f')},'dialDropMaxRetry':{'type':Sequelize[_0x86b6('0xa')](0x3)[_0x86b6('0x7')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x86b6('0x20')},'dialDropRetryFrequency':{'type':Sequelize[_0x86b6('0xa')](0x5)[_0x86b6('0x7')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'Drop\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialAbandonedMaxRetry':{'type':Sequelize[_0x86b6('0xa')](0x3)[_0x86b6('0x7')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x86b6('0x21')},'dialAbandonedRetryFrequency':{'type':Sequelize[_0x86b6('0xa')](0x5)[_0x86b6('0x7')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x86b6('0x22')},'dialMachineMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0x86b6('0x7')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x86b6('0x23')},'dialMachineRetryFrequency':{'type':Sequelize['INTEGER'](0x5)[_0x86b6('0x7')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x86b6('0x24')},'dialAgentRejectMaxRetry':{'type':Sequelize[_0x86b6('0xa')](0x3)[_0x86b6('0x7')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x86b6('0x25')},'dialAgentRejectRetryFrequency':{'type':Sequelize[_0x86b6('0xa')](0x5)[_0x86b6('0x7')],'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 7d6fcb6..dc044f6 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 _0x3f8c=['IvrCampaigns','UserProfileResource','destroy','error','stack','name','index','map','Campaign','rawAttributes','fieldName','type','key','query','keys','model','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filters','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','show','find','catch','create','body','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','user','UserProfileSection','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','clone','omit','updatedAt','role','userProfileId','params','getHoppers','CmHopper','getHopperHistories','CmHopperHistory','getHopperFinals','findOne','CampaignId','CmHopperFinal','getHopperBlacks','CmHopperBlack','getLists','addLists','format','YYYY-MM-DD\x20HH:mm:ss','ids','spread','dialCheckDuplicateType','always','into','cm_hopper','phone','scheduledAt','ContactId','ListId','createdAt','select','field','NOW()','CmListId','toString','from','cm_contacts','deletedAt\x20IS\x20NULL','phone\x20IS\x20NOT\x20NULL','phone\x20NOT\x20IN\x20(?)','COALESCE(calleridnum,\x27\x27)','cm_hopper_final','CampaignId\x20=\x20?','COALESCE(phone,\x27\x27)','onlyIfOpen','insert','fromQuery','ListId\x20=\x20?','cm_hopper_additional_phones','cmHopperId','h.id','ci.OrderBY','OrderBy','cm_contact_has_items','join','h.ListId\x20=\x20?','h.CampaignId=?','h.createdAt\x20=\x20?','push','sequelize','all','removeLists','getBlackLists','addBlackLists','cm_hopper_black','removeBlackLists','zip-dir','fast-json-patch','request-promise','moment','to-csv','ejs','fs-extra','lodash','squel','crypto','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','limit','count','Content-Range','reject','save','update','then'];(function(_0x4cfcbf,_0x7804a2){var _0x152d90=function(_0x17e3af){while(--_0x17e3af){_0x4cfcbf['push'](_0x4cfcbf['shift']());}};_0x152d90(++_0x7804a2);}(_0x3f8c,0x104));var _0xc3f8=function(_0x44bf69,_0x34269d){_0x44bf69=_0x44bf69-0x0;var _0x2c9cb6=_0x3f8c[_0x44bf69];return _0x2c9cb6;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0xc3f8('0x0'));var jsonpatch=require(_0xc3f8('0x1'));var rp=require(_0xc3f8('0x2'));var moment=require(_0xc3f8('0x3'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require('util');var path=require('path');var sox=require('sox');var csv=require(_0xc3f8('0x4'));var ejs=require(_0xc3f8('0x5'));var fs=require('fs');var fs_extra=require(_0xc3f8('0x6'));var _=require(_0xc3f8('0x7'));var squel=require(_0xc3f8('0x8'));var crypto=require(_0xc3f8('0x9'));var jsforce=require('jsforce');var deskjs=require(_0xc3f8('0xa'));var toCsv=require(_0xc3f8('0x4'));var querystring=require(_0xc3f8('0xb'));var Papa=require(_0xc3f8('0xc'));var Redis=require(_0xc3f8('0xd'));var authService=require(_0xc3f8('0xe'));var qs=require(_0xc3f8('0xf'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xc3f8('0x10'));var logger=require(_0xc3f8('0x11'))(_0xc3f8('0x12'));var utils=require(_0xc3f8('0x13'));var config=require('../../config/environment');var licenseUtil=require(_0xc3f8('0x14'));var db=require(_0xc3f8('0x15'))['db'];function respondWithStatusCode(_0x256e3d,_0x155c80){_0x155c80=_0x155c80||0xcc;return function(_0x511763){if(_0x511763){return _0x256e3d[_0xc3f8('0x16')](_0x155c80);}return _0x256e3d[_0xc3f8('0x17')](_0x155c80)[_0xc3f8('0x18')]();};}function respondWithResult(_0x44632a,_0x6155e9){_0x6155e9=_0x6155e9||0xc8;return function(_0x47754c){if(_0x47754c){return _0x44632a[_0xc3f8('0x17')](_0x6155e9)[_0xc3f8('0x19')](_0x47754c);}};}function respondWithFilteredResult(_0x12b141,_0x2fd8e8){return function(_0x3cb28a){if(_0x3cb28a){var _0x2a9f64=typeof _0x2fd8e8[_0xc3f8('0x1a')]==='undefined'&&typeof _0x2fd8e8[_0xc3f8('0x1b')]==='undefined';var _0x51807b=_0x3cb28a[_0xc3f8('0x1c')];var _0x2e7c0f=_0x2a9f64?0x0:_0x2fd8e8[_0xc3f8('0x1a')];var _0xb4ab67=_0x2a9f64?_0x3cb28a['count']:_0x2fd8e8[_0xc3f8('0x1a')]+_0x2fd8e8[_0xc3f8('0x1b')];var _0x5df6f9;if(_0xb4ab67>=_0x51807b){_0xb4ab67=_0x51807b;_0x5df6f9=0xc8;}else{_0x5df6f9=0xce;}_0x12b141[_0xc3f8('0x17')](_0x5df6f9);return _0x12b141['set'](_0xc3f8('0x1d'),_0x2e7c0f+'-'+_0xb4ab67+'/'+_0x51807b)[_0xc3f8('0x19')](_0x3cb28a);}return null;};}function patchUpdates(_0x3b2e98){return function(_0x53ada5){try{jsonpatch['apply'](_0x53ada5,_0x3b2e98,!![]);}catch(_0x113cd2){return BPromise[_0xc3f8('0x1e')](_0x113cd2);}return _0x53ada5[_0xc3f8('0x1f')]();};}function saveUpdates(_0x25a4c7,_0x6522e9){return function(_0x251bf7){if(_0x251bf7){return _0x251bf7[_0xc3f8('0x20')](_0x25a4c7)[_0xc3f8('0x21')](function(_0x49aeea){return _0x49aeea;});}return null;};}function removeEntity(_0x571f92,_0x4b83f0){return function(_0x2559a4){if(_0x2559a4){return _0x2559a4['destroy']()[_0xc3f8('0x21')](function(){var _0x3f196d=_0x2559a4['get']({'plain':!![]});var _0x4569c2=_0xc3f8('0x22');return db[_0xc3f8('0x23')][_0xc3f8('0x24')]({'where':{'type':_0x4569c2,'resourceId':_0x3f196d['id']}})[_0xc3f8('0x21')](function(){return _0x2559a4;});})[_0xc3f8('0x21')](function(){_0x571f92[_0xc3f8('0x17')](0xcc)[_0xc3f8('0x18')]();});}};}function handleEntityNotFound(_0x21b002,_0xbea3b8){return function(_0x22c8e6){if(!_0x22c8e6){_0x21b002[_0xc3f8('0x16')](0x194);}return _0x22c8e6;};}function handleError(_0x238ff5,_0x429fd8){_0x429fd8=_0x429fd8||0x1f4;return function(_0x59e4dd){logger[_0xc3f8('0x25')](_0x59e4dd[_0xc3f8('0x26')]);if(_0x59e4dd[_0xc3f8('0x27')]){delete _0x59e4dd['name'];}_0x238ff5[_0xc3f8('0x17')](_0x429fd8)['send'](_0x59e4dd);};}exports[_0xc3f8('0x28')]=function(_0x32343e,_0x47ab53){var _0x48b32e={},_0x21a225={},_0x25df65={'count':0x0,'rows':[]};var _0xd32b09=_[_0xc3f8('0x29')](db[_0xc3f8('0x2a')][_0xc3f8('0x2b')],function(_0x680047){return{'name':_0x680047[_0xc3f8('0x2c')],'type':_0x680047[_0xc3f8('0x2d')][_0xc3f8('0x2e')]};});_0x21a225['model']=_[_0xc3f8('0x29')](_0xd32b09,_0xc3f8('0x27'));_0x21a225[_0xc3f8('0x2f')]=_[_0xc3f8('0x30')](_0x32343e[_0xc3f8('0x2f')]);_0x21a225['filters']=_['intersection'](_0x21a225[_0xc3f8('0x31')],_0x21a225[_0xc3f8('0x2f')]);_0x48b32e[_0xc3f8('0x32')]=_[_0xc3f8('0x33')](_0x21a225[_0xc3f8('0x31')],qs['fields'](_0x32343e[_0xc3f8('0x2f')][_0xc3f8('0x34')]));_0x48b32e[_0xc3f8('0x32')]=_0x48b32e['attributes'][_0xc3f8('0x35')]?_0x48b32e[_0xc3f8('0x32')]:_0x21a225[_0xc3f8('0x31')];if(!_0x32343e['query'][_0xc3f8('0x36')](_0xc3f8('0x37'))){_0x48b32e['limit']=qs[_0xc3f8('0x1b')](_0x32343e[_0xc3f8('0x2f')][_0xc3f8('0x1b')]);_0x48b32e[_0xc3f8('0x1a')]=qs[_0xc3f8('0x1a')](_0x32343e[_0xc3f8('0x2f')]['offset']);}_0x48b32e[_0xc3f8('0x38')]=qs[_0xc3f8('0x39')](_0x32343e[_0xc3f8('0x2f')][_0xc3f8('0x39')]);_0x48b32e[_0xc3f8('0x3a')]=qs['filters'](_[_0xc3f8('0x3b')](_0x32343e[_0xc3f8('0x2f')],_0x21a225[_0xc3f8('0x3c')]),_0xd32b09);if(_0x32343e['query'][_0xc3f8('0x3d')]){_0x48b32e[_0xc3f8('0x3a')]=_[_0xc3f8('0x3e')](_0x48b32e[_0xc3f8('0x3a')],{'$or':_['map'](_0xd32b09,function(_0x306182){if(_0x306182[_0xc3f8('0x2d')]!==_0xc3f8('0x3f')){var _0x37b104={};_0x37b104[_0x306182['name']]={'$like':'%'+_0x32343e[_0xc3f8('0x2f')]['filter']+'%'};return _0x37b104;}})});}_0x48b32e=_['merge']({},_0x48b32e,_0x32343e[_0xc3f8('0x40')]);var _0x1f3aef={'where':_0x48b32e[_0xc3f8('0x3a')]};return db[_0xc3f8('0x2a')]['count'](_0x1f3aef)['then'](function(_0x361a85){_0x25df65[_0xc3f8('0x1c')]=_0x361a85;if(_0x32343e[_0xc3f8('0x2f')][_0xc3f8('0x41')]){_0x48b32e[_0xc3f8('0x42')]=[{'all':!![]}];}return db[_0xc3f8('0x2a')][_0xc3f8('0x43')](_0x48b32e);})[_0xc3f8('0x21')](function(_0x13d8dc){_0x25df65[_0xc3f8('0x44')]=_0x13d8dc;return _0x25df65;})[_0xc3f8('0x21')](respondWithFilteredResult(_0x47ab53,_0x48b32e))['catch'](handleError(_0x47ab53,null));};exports[_0xc3f8('0x45')]=function(_0x22e9b3,_0x4b327f){var _0x1aff20={'raw':![],'where':{'id':_0x22e9b3['params']['id']}},_0x172f1a={};_0x172f1a[_0xc3f8('0x31')]=_[_0xc3f8('0x30')](db[_0xc3f8('0x2a')][_0xc3f8('0x2b')]);_0x172f1a[_0xc3f8('0x2f')]=_[_0xc3f8('0x30')](_0x22e9b3[_0xc3f8('0x2f')]);_0x172f1a[_0xc3f8('0x3c')]=_[_0xc3f8('0x33')](_0x172f1a[_0xc3f8('0x31')],_0x172f1a[_0xc3f8('0x2f')]);_0x1aff20['attributes']=_[_0xc3f8('0x33')](_0x172f1a[_0xc3f8('0x31')],qs['fields'](_0x22e9b3[_0xc3f8('0x2f')][_0xc3f8('0x34')]));_0x1aff20[_0xc3f8('0x32')]=_0x1aff20[_0xc3f8('0x32')]['length']?_0x1aff20['attributes']:_0x172f1a[_0xc3f8('0x31')];if(_0x22e9b3[_0xc3f8('0x2f')][_0xc3f8('0x41')]){_0x1aff20['include']=[{'all':!![]}];}_0x1aff20=_[_0xc3f8('0x3e')]({},_0x1aff20,_0x22e9b3[_0xc3f8('0x40')]);return db[_0xc3f8('0x2a')][_0xc3f8('0x46')](_0x1aff20)[_0xc3f8('0x21')](handleEntityNotFound(_0x4b327f,null))['then'](respondWithResult(_0x4b327f,null))[_0xc3f8('0x47')](handleError(_0x4b327f,null));};exports[_0xc3f8('0x48')]=function(_0x5961ab,_0x1becae){return db[_0xc3f8('0x2a')][_0xc3f8('0x48')](_0x5961ab[_0xc3f8('0x49')],{})[_0xc3f8('0x21')](function(_0x3045bc){var _0x1ca7c9=_0x5961ab['user'][_0xc3f8('0x4a')]({'plain':!![]});if(!_0x1ca7c9)throw new Error(_0xc3f8('0x4b'));if(_0x1ca7c9['role']===_0xc3f8('0x4c')){var _0x2e9f93=_0x3045bc[_0xc3f8('0x4a')]({'plain':!![]});var _0x33e5c5=_0xc3f8('0x22');return db[_0xc3f8('0x4d')][_0xc3f8('0x46')]({'where':{'name':_0x33e5c5,'userProfileId':_0x1ca7c9['userProfileId']},'raw':!![]})[_0xc3f8('0x21')](function(_0x2c6999){if(_0x2c6999&&_0x2c6999[_0xc3f8('0x4e')]===0x0){return db[_0xc3f8('0x23')][_0xc3f8('0x48')]({'name':_0x2e9f93[_0xc3f8('0x27')],'resourceId':_0x2e9f93['id'],'type':_0x2c6999[_0xc3f8('0x27')],'sectionId':_0x2c6999['id']},{})[_0xc3f8('0x21')](function(){return _0x3045bc;});}else{return _0x3045bc;}})['catch'](function(_0x51249a){logger[_0xc3f8('0x25')](_0xc3f8('0x4f'),_0x51249a);throw _0x51249a;});}return _0x3045bc;})['then'](respondWithResult(_0x1becae,0xc9))['catch'](handleError(_0x1becae,null));};exports[_0xc3f8('0x50')]=function(_0x4b4adb,_0x1b1e13){var _0xf1e0a6={'where':{'id':_0x4b4adb['params']['id']}},_0x1d95f5={};_0x1d95f5[_0xc3f8('0x31')]=_['keys'](db['Campaign'][_0xc3f8('0x2b')]);_0xf1e0a6['attributes']=_[_0xc3f8('0x33')](_0x1d95f5[_0xc3f8('0x31')],qs[_0xc3f8('0x34')](_0x4b4adb['query'][_0xc3f8('0x34')]));_0xf1e0a6[_0xc3f8('0x32')]=_0xf1e0a6[_0xc3f8('0x32')][_0xc3f8('0x35')]?_0xf1e0a6[_0xc3f8('0x32')]:_0x1d95f5['model'];if(_0x4b4adb['query'][_0xc3f8('0x41')]){_0xf1e0a6[_0xc3f8('0x42')]=[{'all':!![]}];}_0xf1e0a6=_[_0xc3f8('0x3e')]({},_0xf1e0a6,_0x4b4adb[_0xc3f8('0x40')]);return db[_0xc3f8('0x2a')]['find'](_0xf1e0a6)[_0xc3f8('0x21')](handleEntityNotFound(_0x1b1e13,null))['then'](function(_0x21dfc8){if(_0x21dfc8){var _0x337029=_0x21dfc8[_0xc3f8('0x4a')]({'plain':!![]});_0x337029=qs[_0xc3f8('0x51')](_0x337029,['id','createdAt',_0xc3f8('0x52')]);_0x4b4adb['body']=_['omit'](_0x4b4adb['body'],['id','createdAt',_0xc3f8('0x52')]);return db[_0xc3f8('0x2a')][_0xc3f8('0x48')](_[_0xc3f8('0x3e')](_0x337029,_0x4b4adb[_0xc3f8('0x49')]),{'include':_0x4b4adb[_0xc3f8('0x2f')][_0xc3f8('0x41')]?[{'all':!![]}]:undefined})[_0xc3f8('0x21')](function(_0x5250df){var _0x84e1a2=_0x4b4adb[_0xc3f8('0x4c')][_0xc3f8('0x4a')]({'plain':!![]});if(!_0x84e1a2)throw new Error(_0xc3f8('0x4b'));if(_0x84e1a2[_0xc3f8('0x53')]==='user'){var _0x19aded=_0x5250df[_0xc3f8('0x4a')]({'plain':!![]});var _0x30c90f=_0xc3f8('0x22');return db[_0xc3f8('0x4d')]['find']({'where':{'name':_0x30c90f,'userProfileId':_0x84e1a2[_0xc3f8('0x54')]},'raw':!![]})[_0xc3f8('0x21')](function(_0x42b255){if(_0x42b255&&_0x42b255[_0xc3f8('0x4e')]===0x0){return db[_0xc3f8('0x23')][_0xc3f8('0x48')]({'name':_0x19aded['name'],'resourceId':_0x19aded['id'],'type':_0x42b255[_0xc3f8('0x27')],'sectionId':_0x42b255['id']},{})[_0xc3f8('0x21')](function(){return _0x5250df;});}else{return _0x5250df;}})[_0xc3f8('0x47')](function(_0x5e3f96){logger[_0xc3f8('0x25')](_0xc3f8('0x4f'),_0x5e3f96);throw _0x5e3f96;});}return _0x5250df;});}})['then'](respondWithResult(_0x1b1e13,0xc9))['catch'](handleError(_0x1b1e13,null));};exports[_0xc3f8('0x20')]=function(_0x2c7ab9,_0x4a1e61){if(_0x2c7ab9[_0xc3f8('0x49')]['id']){delete _0x2c7ab9[_0xc3f8('0x49')]['id'];}return db[_0xc3f8('0x2a')][_0xc3f8('0x46')]({'where':{'id':_0x2c7ab9[_0xc3f8('0x55')]['id']}})[_0xc3f8('0x21')](handleEntityNotFound(_0x4a1e61,null))[_0xc3f8('0x21')](saveUpdates(_0x2c7ab9[_0xc3f8('0x49')],null))['then'](respondWithResult(_0x4a1e61,null))['catch'](handleError(_0x4a1e61,null));};exports[_0xc3f8('0x24')]=function(_0x5cd8b4,_0x4a1cf5){return db['Campaign']['find']({'where':{'id':_0x5cd8b4['params']['id']}})[_0xc3f8('0x21')](handleEntityNotFound(_0x4a1cf5,null))[_0xc3f8('0x21')](removeEntity(_0x4a1cf5,null))[_0xc3f8('0x47')](handleError(_0x4a1cf5,null));};exports[_0xc3f8('0x56')]=function(_0x4dd44f,_0x18a398,_0x2d0b58){var _0x5d6208={'raw':!![],'where':{}};var _0x3b9b47={};var _0x273faf={'count':0x0,'rows':[]};return db[_0xc3f8('0x2a')]['findOne']({'where':{'id':_0x4dd44f[_0xc3f8('0x55')]['id']}})['then'](handleEntityNotFound(_0x18a398,null))['then'](function(_0x4935ae){if(_0x4935ae){_0x3b9b47[_0xc3f8('0x31')]=_[_0xc3f8('0x30')](db['CmHopper'][_0xc3f8('0x2b')]);_0x3b9b47[_0xc3f8('0x2f')]=_['keys'](_0x4dd44f[_0xc3f8('0x2f')]);_0x3b9b47[_0xc3f8('0x3c')]=_['intersection'](_0x3b9b47[_0xc3f8('0x31')],_0x3b9b47['query']);_0x5d6208[_0xc3f8('0x32')]=_[_0xc3f8('0x33')](_0x3b9b47['model'],qs['fields'](_0x4dd44f[_0xc3f8('0x2f')][_0xc3f8('0x34')]));_0x5d6208['attributes']=_0x5d6208[_0xc3f8('0x32')]['length']?_0x5d6208[_0xc3f8('0x32')]:_0x3b9b47['model'];if(!_0x4dd44f[_0xc3f8('0x2f')][_0xc3f8('0x36')](_0xc3f8('0x37'))){_0x5d6208[_0xc3f8('0x1b')]=qs[_0xc3f8('0x1b')](_0x4dd44f[_0xc3f8('0x2f')][_0xc3f8('0x1b')]);_0x5d6208[_0xc3f8('0x1a')]=qs[_0xc3f8('0x1a')](_0x4dd44f['query'][_0xc3f8('0x1a')]);}_0x5d6208[_0xc3f8('0x38')]=qs[_0xc3f8('0x39')](_0x4dd44f[_0xc3f8('0x2f')][_0xc3f8('0x39')]);_0x5d6208['where']=qs[_0xc3f8('0x3c')](_[_0xc3f8('0x3b')](_0x4dd44f[_0xc3f8('0x2f')],_0x3b9b47[_0xc3f8('0x3c')]));_0x5d6208[_0xc3f8('0x3a')]['CampaignId']=_0x4935ae['id'];if(_0x4dd44f[_0xc3f8('0x2f')][_0xc3f8('0x3d')]){_0x5d6208[_0xc3f8('0x3a')]=_['merge'](_0x5d6208['where'],{'$or':_[_0xc3f8('0x29')](_0x5d6208[_0xc3f8('0x32')],function(_0x1a9c33){var _0x34158f={};_0x34158f[_0x1a9c33]={'$like':'%'+_0x4dd44f['query'][_0xc3f8('0x3d')]+'%'};return _0x34158f;})});}_0x5d6208=_[_0xc3f8('0x3e')]({},_0x5d6208,_0x4dd44f[_0xc3f8('0x40')]);return db['CmHopper'][_0xc3f8('0x1c')]({'where':_0x5d6208[_0xc3f8('0x3a')]})['then'](function(_0x478d21){_0x273faf[_0xc3f8('0x1c')]=_0x478d21;if(_0x4dd44f[_0xc3f8('0x2f')]['includeAll']){_0x5d6208[_0xc3f8('0x42')]=[{'all':!![]}];}return db[_0xc3f8('0x57')]['findAll'](_0x5d6208);})[_0xc3f8('0x21')](function(_0x5f2d86){_0x273faf[_0xc3f8('0x44')]=_0x5f2d86;return _0x273faf;});}})['then'](respondWithFilteredResult(_0x18a398,_0x5d6208))[_0xc3f8('0x47')](handleError(_0x18a398,null));};exports[_0xc3f8('0x58')]=function(_0x2fafd7,_0x1d4abf,_0x2de860){var _0x1a5cc9={'raw':!![],'where':{}};var _0x34af4a={};var _0x18cc23={'count':0x0,'rows':[]};return db[_0xc3f8('0x2a')]['findOne']({'where':{'id':_0x2fafd7['params']['id']}})[_0xc3f8('0x21')](handleEntityNotFound(_0x1d4abf,null))['then'](function(_0xa2b49d){if(_0xa2b49d){_0x34af4a[_0xc3f8('0x31')]=_[_0xc3f8('0x30')](db[_0xc3f8('0x59')]['rawAttributes']);_0x34af4a[_0xc3f8('0x2f')]=_[_0xc3f8('0x30')](_0x2fafd7[_0xc3f8('0x2f')]);_0x34af4a[_0xc3f8('0x3c')]=_[_0xc3f8('0x33')](_0x34af4a[_0xc3f8('0x31')],_0x34af4a[_0xc3f8('0x2f')]);_0x1a5cc9[_0xc3f8('0x32')]=_[_0xc3f8('0x33')](_0x34af4a['model'],qs['fields'](_0x2fafd7[_0xc3f8('0x2f')][_0xc3f8('0x34')]));_0x1a5cc9[_0xc3f8('0x32')]=_0x1a5cc9['attributes'][_0xc3f8('0x35')]?_0x1a5cc9['attributes']:_0x34af4a[_0xc3f8('0x31')];if(!_0x2fafd7['query'][_0xc3f8('0x36')](_0xc3f8('0x37'))){_0x1a5cc9[_0xc3f8('0x1b')]=qs[_0xc3f8('0x1b')](_0x2fafd7[_0xc3f8('0x2f')][_0xc3f8('0x1b')]);_0x1a5cc9[_0xc3f8('0x1a')]=qs[_0xc3f8('0x1a')](_0x2fafd7['query'][_0xc3f8('0x1a')]);}_0x1a5cc9[_0xc3f8('0x38')]=qs[_0xc3f8('0x39')](_0x2fafd7[_0xc3f8('0x2f')][_0xc3f8('0x39')]);_0x1a5cc9['where']=qs[_0xc3f8('0x3c')](_[_0xc3f8('0x3b')](_0x2fafd7[_0xc3f8('0x2f')],_0x34af4a[_0xc3f8('0x3c')]));_0x1a5cc9['where']['CampaignId']=_0xa2b49d['id'];if(_0x2fafd7[_0xc3f8('0x2f')][_0xc3f8('0x3d')]){_0x1a5cc9['where']=_['merge'](_0x1a5cc9['where'],{'$or':_[_0xc3f8('0x29')](_0x1a5cc9['attributes'],function(_0x2a4b80){var _0x31b48d={};_0x31b48d[_0x2a4b80]={'$like':'%'+_0x2fafd7[_0xc3f8('0x2f')][_0xc3f8('0x3d')]+'%'};return _0x31b48d;})});}_0x1a5cc9=_[_0xc3f8('0x3e')]({},_0x1a5cc9,_0x2fafd7[_0xc3f8('0x40')]);return db[_0xc3f8('0x59')]['count']({'where':_0x1a5cc9['where']})['then'](function(_0x4ea284){_0x18cc23[_0xc3f8('0x1c')]=_0x4ea284;if(_0x2fafd7['query'][_0xc3f8('0x41')]){_0x1a5cc9[_0xc3f8('0x42')]=[{'all':!![]}];}return db[_0xc3f8('0x59')]['findAll'](_0x1a5cc9);})[_0xc3f8('0x21')](function(_0x12bb93){_0x18cc23['rows']=_0x12bb93;return _0x18cc23;});}})[_0xc3f8('0x21')](respondWithFilteredResult(_0x1d4abf,_0x1a5cc9))[_0xc3f8('0x47')](handleError(_0x1d4abf,null));};exports[_0xc3f8('0x5a')]=function(_0x501b02,_0x3314fc,_0x426074){var _0x2acc92={'raw':!![],'where':{}};var _0x5a2197={};var _0x1704e5={'count':0x0,'rows':[]};return db[_0xc3f8('0x2a')][_0xc3f8('0x5b')]({'where':{'id':_0x501b02[_0xc3f8('0x55')]['id']}})[_0xc3f8('0x21')](handleEntityNotFound(_0x3314fc,null))[_0xc3f8('0x21')](function(_0x481112){if(_0x481112){_0x5a2197[_0xc3f8('0x31')]=_[_0xc3f8('0x30')](db['CmHopperFinal'][_0xc3f8('0x2b')]);_0x5a2197[_0xc3f8('0x2f')]=_['keys'](_0x501b02[_0xc3f8('0x2f')]);_0x5a2197[_0xc3f8('0x3c')]=_[_0xc3f8('0x33')](_0x5a2197['model'],_0x5a2197['query']);_0x2acc92[_0xc3f8('0x32')]=_['intersection'](_0x5a2197[_0xc3f8('0x31')],qs[_0xc3f8('0x34')](_0x501b02[_0xc3f8('0x2f')]['fields']));_0x2acc92[_0xc3f8('0x32')]=_0x2acc92[_0xc3f8('0x32')][_0xc3f8('0x35')]?_0x2acc92[_0xc3f8('0x32')]:_0x5a2197[_0xc3f8('0x31')];if(!_0x501b02[_0xc3f8('0x2f')]['hasOwnProperty'](_0xc3f8('0x37'))){_0x2acc92[_0xc3f8('0x1b')]=qs[_0xc3f8('0x1b')](_0x501b02[_0xc3f8('0x2f')][_0xc3f8('0x1b')]);_0x2acc92['offset']=qs[_0xc3f8('0x1a')](_0x501b02[_0xc3f8('0x2f')][_0xc3f8('0x1a')]);}_0x2acc92['order']=qs[_0xc3f8('0x39')](_0x501b02[_0xc3f8('0x2f')][_0xc3f8('0x39')]);_0x2acc92[_0xc3f8('0x3a')]=qs[_0xc3f8('0x3c')](_['pick'](_0x501b02[_0xc3f8('0x2f')],_0x5a2197[_0xc3f8('0x3c')]));_0x2acc92[_0xc3f8('0x3a')][_0xc3f8('0x5c')]=_0x481112['id'];if(_0x501b02[_0xc3f8('0x2f')][_0xc3f8('0x3d')]){_0x2acc92[_0xc3f8('0x3a')]=_[_0xc3f8('0x3e')](_0x2acc92[_0xc3f8('0x3a')],{'$or':_[_0xc3f8('0x29')](_0x2acc92[_0xc3f8('0x32')],function(_0x50a6e0){var _0x55e2ee={};_0x55e2ee[_0x50a6e0]={'$like':'%'+_0x501b02[_0xc3f8('0x2f')]['filter']+'%'};return _0x55e2ee;})});}_0x2acc92=_['merge']({},_0x2acc92,_0x501b02[_0xc3f8('0x40')]);return db[_0xc3f8('0x5d')][_0xc3f8('0x1c')]({'where':_0x2acc92[_0xc3f8('0x3a')]})['then'](function(_0x2dad3f){_0x1704e5[_0xc3f8('0x1c')]=_0x2dad3f;if(_0x501b02['query'][_0xc3f8('0x41')]){_0x2acc92[_0xc3f8('0x42')]=[{'all':!![]}];}return db['CmHopperFinal']['findAll'](_0x2acc92);})['then'](function(_0x1426ea){_0x1704e5[_0xc3f8('0x44')]=_0x1426ea;return _0x1704e5;});}})[_0xc3f8('0x21')](respondWithFilteredResult(_0x3314fc,_0x2acc92))[_0xc3f8('0x47')](handleError(_0x3314fc,null));};exports[_0xc3f8('0x5e')]=function(_0xefe62a,_0x1c77df,_0x15e1f3){var _0x1ebbe1={'raw':!![],'where':{}};var _0x4c55ae={};var _0x49a936={'count':0x0,'rows':[]};return db[_0xc3f8('0x2a')][_0xc3f8('0x5b')]({'where':{'id':_0xefe62a[_0xc3f8('0x55')]['id']}})[_0xc3f8('0x21')](handleEntityNotFound(_0x1c77df,null))[_0xc3f8('0x21')](function(_0x21fe09){if(_0x21fe09){_0x4c55ae[_0xc3f8('0x31')]=_[_0xc3f8('0x30')](db[_0xc3f8('0x5f')]['rawAttributes']);_0x4c55ae[_0xc3f8('0x2f')]=_['keys'](_0xefe62a['query']);_0x4c55ae[_0xc3f8('0x3c')]=_[_0xc3f8('0x33')](_0x4c55ae[_0xc3f8('0x31')],_0x4c55ae[_0xc3f8('0x2f')]);_0x1ebbe1[_0xc3f8('0x32')]=_[_0xc3f8('0x33')](_0x4c55ae['model'],qs[_0xc3f8('0x34')](_0xefe62a[_0xc3f8('0x2f')][_0xc3f8('0x34')]));_0x1ebbe1['attributes']=_0x1ebbe1['attributes'][_0xc3f8('0x35')]?_0x1ebbe1[_0xc3f8('0x32')]:_0x4c55ae['model'];if(!_0xefe62a[_0xc3f8('0x2f')][_0xc3f8('0x36')]('nolimit')){_0x1ebbe1[_0xc3f8('0x1b')]=qs[_0xc3f8('0x1b')](_0xefe62a[_0xc3f8('0x2f')][_0xc3f8('0x1b')]);_0x1ebbe1[_0xc3f8('0x1a')]=qs['offset'](_0xefe62a[_0xc3f8('0x2f')]['offset']);}_0x1ebbe1[_0xc3f8('0x38')]=qs[_0xc3f8('0x39')](_0xefe62a['query'][_0xc3f8('0x39')]);_0x1ebbe1[_0xc3f8('0x3a')]=qs[_0xc3f8('0x3c')](_[_0xc3f8('0x3b')](_0xefe62a[_0xc3f8('0x2f')],_0x4c55ae[_0xc3f8('0x3c')]));_0x1ebbe1[_0xc3f8('0x3a')][_0xc3f8('0x5c')]=_0x21fe09['id'];if(_0xefe62a[_0xc3f8('0x2f')][_0xc3f8('0x3d')]){_0x1ebbe1[_0xc3f8('0x3a')]=_[_0xc3f8('0x3e')](_0x1ebbe1[_0xc3f8('0x3a')],{'$or':_[_0xc3f8('0x29')](_0x1ebbe1[_0xc3f8('0x32')],function(_0x5085cf){var _0x31d6da={};_0x31d6da[_0x5085cf]={'$like':'%'+_0xefe62a[_0xc3f8('0x2f')][_0xc3f8('0x3d')]+'%'};return _0x31d6da;})});}_0x1ebbe1=_['merge']({},_0x1ebbe1,_0xefe62a[_0xc3f8('0x40')]);return db[_0xc3f8('0x5f')]['count']({'where':_0x1ebbe1[_0xc3f8('0x3a')]})['then'](function(_0x2ef6e5){_0x49a936['count']=_0x2ef6e5;if(_0xefe62a[_0xc3f8('0x2f')][_0xc3f8('0x41')]){_0x1ebbe1[_0xc3f8('0x42')]=[{'all':!![]}];}return db['CmHopperBlack'][_0xc3f8('0x43')](_0x1ebbe1);})[_0xc3f8('0x21')](function(_0x276108){_0x49a936[_0xc3f8('0x44')]=_0x276108;return _0x49a936;});}})[_0xc3f8('0x21')](respondWithFilteredResult(_0x1c77df,_0x1ebbe1))[_0xc3f8('0x47')](handleError(_0x1c77df,null));};exports[_0xc3f8('0x60')]=function(_0x4af05a,_0x1e1adf,_0xa7e06){var _0x103ded={};var _0x3e87d7={};var _0x349dd9;var _0x4337be;return db[_0xc3f8('0x2a')][_0xc3f8('0x5b')]({'where':{'id':_0x4af05a[_0xc3f8('0x55')]['id']}})[_0xc3f8('0x21')](handleEntityNotFound(_0x1e1adf,null))[_0xc3f8('0x21')](function(_0x24f12f){if(_0x24f12f){_0x349dd9=_0x24f12f;_0x3e87d7[_0xc3f8('0x31')]=_[_0xc3f8('0x30')](db['CmList'][_0xc3f8('0x2b')]);_0x3e87d7['query']=_[_0xc3f8('0x30')](_0x4af05a['query']);_0x3e87d7['filters']=_[_0xc3f8('0x33')](_0x3e87d7[_0xc3f8('0x31')],_0x3e87d7[_0xc3f8('0x2f')]);_0x103ded['attributes']=_['intersection'](_0x3e87d7[_0xc3f8('0x31')],qs[_0xc3f8('0x34')](_0x4af05a[_0xc3f8('0x2f')][_0xc3f8('0x34')]));_0x103ded[_0xc3f8('0x32')]=_0x103ded['attributes'][_0xc3f8('0x35')]?_0x103ded[_0xc3f8('0x32')]:_0x3e87d7[_0xc3f8('0x31')];_0x103ded['order']=qs['sort'](_0x4af05a[_0xc3f8('0x2f')]['sort']);_0x103ded['where']=qs['filters'](_[_0xc3f8('0x3b')](_0x4af05a[_0xc3f8('0x2f')],_0x3e87d7[_0xc3f8('0x3c')]));if(_0x4af05a[_0xc3f8('0x2f')]['filter']){_0x103ded[_0xc3f8('0x3a')]=_[_0xc3f8('0x3e')](_0x103ded[_0xc3f8('0x3a')],{'$or':_['map'](_0x103ded[_0xc3f8('0x32')],function(_0x21b8ed){var _0x165d27={};_0x165d27[_0x21b8ed]={'$like':'%'+_0x4af05a[_0xc3f8('0x2f')][_0xc3f8('0x3d')]+'%'};return _0x165d27;})});}_0x103ded=_['merge']({},_0x103ded,_0x4af05a[_0xc3f8('0x40')]);return _0x349dd9[_0xc3f8('0x60')](_0x103ded);}})[_0xc3f8('0x21')](function(_0x194b4a){if(_0x194b4a){_0x4337be=_0x194b4a[_0xc3f8('0x35')];if(!_0x4af05a[_0xc3f8('0x2f')]['hasOwnProperty'](_0xc3f8('0x37'))){_0x103ded[_0xc3f8('0x1b')]=qs['limit'](_0x4af05a[_0xc3f8('0x2f')][_0xc3f8('0x1b')]);_0x103ded[_0xc3f8('0x1a')]=qs['offset'](_0x4af05a[_0xc3f8('0x2f')]['offset']);}return _0x349dd9[_0xc3f8('0x60')](_0x103ded);}})[_0xc3f8('0x21')](function(_0x6139a6){if(_0x6139a6){return _0x6139a6?{'count':_0x4337be,'rows':_0x6139a6}:null;}})[_0xc3f8('0x21')](respondWithResult(_0x1e1adf,null))[_0xc3f8('0x47')](handleError(_0x1e1adf,null));};exports[_0xc3f8('0x61')]=function(_0x10cfbe,_0x1376e4,_0x2c9b71){var _0x2049f0,_0x3aa0c2;var _0x215ae9=[];var _0x1c6d52=moment()[_0xc3f8('0x62')](_0xc3f8('0x63'));return db[_0xc3f8('0x2a')]['find']({'where':{'id':_0x10cfbe[_0xc3f8('0x55')]['id']}})[_0xc3f8('0x21')](handleEntityNotFound(_0x1376e4,null))[_0xc3f8('0x21')](function(_0x3a53a9){if(_0x3a53a9){_0x3aa0c2=_0x3a53a9;return _0x3a53a9[_0xc3f8('0x61')](_0x10cfbe['body'][_0xc3f8('0x64')],_[_0xc3f8('0x51')](_0x10cfbe[_0xc3f8('0x49')],[_0xc3f8('0x64'),'id'])||{});}return null;})[_0xc3f8('0x65')](function(_0xb31d99){var _0x161637;var _0x5a8090;_0x2049f0=_0xb31d99||[];var _0x254bf9=[];if(_0xb31d99){for(var _0x5bde4a=0x0;_0x5bde4a<_0xb31d99['length'];_0x5bde4a+=0x1){var _0x28db21=_0xb31d99[_0x5bde4a][_0xc3f8('0x4a')]({'plain':!![]});_0x3aa0c2[_0xc3f8('0x66')]=_0x10cfbe[_0xc3f8('0x49')][_0xc3f8('0x66')]?_0x10cfbe['body'][_0xc3f8('0x66')]:_0x3aa0c2['dialCheckDuplicateType'];switch(_0x3aa0c2[_0xc3f8('0x66')]){case _0xc3f8('0x67'):_0x161637=squel['insert']()[_0xc3f8('0x68')](_0xc3f8('0x69'))['fromQuery']([_0xc3f8('0x6a'),_0xc3f8('0x6b'),_0xc3f8('0x6c'),_0xc3f8('0x6d'),_0xc3f8('0x5c'),_0xc3f8('0x6e'),_0xc3f8('0x52')],squel[_0xc3f8('0x6f')]()[_0xc3f8('0x70')](_0xc3f8('0x6a'),_0xc3f8('0x6a'))['field'](_0xc3f8('0x71'),'scheduledAt')[_0xc3f8('0x70')]('id','ContactId')[_0xc3f8('0x70')](_0x28db21[_0xc3f8('0x72')]['toString'](),'ListId')['field'](_0x10cfbe[_0xc3f8('0x55')]['id'][_0xc3f8('0x73')](),_0xc3f8('0x5c'))[_0xc3f8('0x70')]('\x27'+_0x1c6d52+'\x27',_0xc3f8('0x6e'))[_0xc3f8('0x70')]('\x27'+_0x1c6d52+'\x27',_0xc3f8('0x52'))[_0xc3f8('0x74')](_0xc3f8('0x75'))[_0xc3f8('0x3a')](_0xc3f8('0x76'))[_0xc3f8('0x3a')]('ListId\x20=\x20?',_0x28db21[_0xc3f8('0x72')][_0xc3f8('0x73')]())[_0xc3f8('0x3a')](_0xc3f8('0x77'))[_0xc3f8('0x3a')](_0xc3f8('0x78'),squel[_0xc3f8('0x6f')]()[_0xc3f8('0x70')](_0xc3f8('0x79'))['from'](_0xc3f8('0x7a'))[_0xc3f8('0x3a')](_0xc3f8('0x7b'),_0x10cfbe[_0xc3f8('0x55')]['id'][_0xc3f8('0x73')]()))[_0xc3f8('0x3a')](_0xc3f8('0x78'),squel[_0xc3f8('0x6f')]()[_0xc3f8('0x70')](_0xc3f8('0x7c'))[_0xc3f8('0x74')](_0xc3f8('0x69'))[_0xc3f8('0x3a')](_0xc3f8('0x7b'),_0x10cfbe[_0xc3f8('0x55')]['id'][_0xc3f8('0x73')]())))[_0xc3f8('0x73')]();break;case _0xc3f8('0x7d'):_0x161637=squel[_0xc3f8('0x7e')]()[_0xc3f8('0x68')](_0xc3f8('0x69'))[_0xc3f8('0x7f')](['phone','scheduledAt','ContactId',_0xc3f8('0x6d'),_0xc3f8('0x5c'),_0xc3f8('0x6e'),'updatedAt'],squel['select']()['field'](_0xc3f8('0x6a'),_0xc3f8('0x6a'))[_0xc3f8('0x70')](_0xc3f8('0x71'),_0xc3f8('0x6b'))['field']('id','ContactId')[_0xc3f8('0x70')](_0x28db21['CmListId']['toString'](),_0xc3f8('0x6d'))[_0xc3f8('0x70')](_0x10cfbe['params']['id']['toString'](),_0xc3f8('0x5c'))[_0xc3f8('0x70')]('\x27'+_0x1c6d52+'\x27',_0xc3f8('0x6e'))[_0xc3f8('0x70')]('\x27'+_0x1c6d52+'\x27','updatedAt')[_0xc3f8('0x74')](_0xc3f8('0x75'))[_0xc3f8('0x3a')](_0xc3f8('0x76'))[_0xc3f8('0x3a')]('ListId\x20=\x20?',_0x28db21[_0xc3f8('0x72')][_0xc3f8('0x73')]())[_0xc3f8('0x3a')](_0xc3f8('0x77'))[_0xc3f8('0x3a')]('phone\x20NOT\x20IN\x20(?)',squel[_0xc3f8('0x6f')]()[_0xc3f8('0x70')]('COALESCE(phone,\x27\x27)')['from'](_0xc3f8('0x69'))[_0xc3f8('0x3a')](_0xc3f8('0x7b'),_0x10cfbe[_0xc3f8('0x55')]['id'][_0xc3f8('0x73')]())))['toString']();break;default:_0x161637=squel[_0xc3f8('0x7e')]()['into']('cm_hopper')[_0xc3f8('0x7f')]([_0xc3f8('0x6a'),_0xc3f8('0x6b'),_0xc3f8('0x6c'),_0xc3f8('0x6d'),_0xc3f8('0x5c'),_0xc3f8('0x6e'),_0xc3f8('0x52')],squel[_0xc3f8('0x6f')]()['field'](_0xc3f8('0x6a'),_0xc3f8('0x6a'))[_0xc3f8('0x70')]('NOW()',_0xc3f8('0x6b'))[_0xc3f8('0x70')]('id',_0xc3f8('0x6c'))[_0xc3f8('0x70')](_0x28db21[_0xc3f8('0x72')][_0xc3f8('0x73')](),'ListId')['field'](_0x10cfbe[_0xc3f8('0x55')]['id']['toString'](),_0xc3f8('0x5c'))[_0xc3f8('0x70')]('\x27'+_0x1c6d52+'\x27',_0xc3f8('0x6e'))['field']('\x27'+_0x1c6d52+'\x27','updatedAt')[_0xc3f8('0x74')](_0xc3f8('0x75'))[_0xc3f8('0x3a')](_0xc3f8('0x76'))[_0xc3f8('0x3a')](_0xc3f8('0x80'),_0x28db21['CmListId'][_0xc3f8('0x73')]())[_0xc3f8('0x3a')](_0xc3f8('0x77')))['toString']();}_0x5a8090=squel[_0xc3f8('0x7e')]()[_0xc3f8('0x68')](_0xc3f8('0x81'))['fromQuery']([_0xc3f8('0x82'),'scheduledAt',_0xc3f8('0x6a'),'OrderBy',_0xc3f8('0x6e'),_0xc3f8('0x52')],squel[_0xc3f8('0x6f')]()[_0xc3f8('0x70')](_0xc3f8('0x83'),'id')['field'](_0xc3f8('0x71'),_0xc3f8('0x6b'))[_0xc3f8('0x70')]('ci.item',_0xc3f8('0x6a'))[_0xc3f8('0x70')](_0xc3f8('0x84'),_0xc3f8('0x85'))[_0xc3f8('0x70')]('\x27'+_0x1c6d52+'\x27',_0xc3f8('0x6e'))['field']('\x27'+_0x1c6d52+'\x27','updatedAt')[_0xc3f8('0x74')](_0xc3f8('0x86'),'ci')[_0xc3f8('0x87')](_0xc3f8('0x69'),'h','h.ContactId\x20=\x20ci.CmContactId')[_0xc3f8('0x3a')](_0xc3f8('0x88'),_0x28db21[_0xc3f8('0x72')]['toString']())[_0xc3f8('0x3a')](_0xc3f8('0x89'),_0x10cfbe[_0xc3f8('0x55')]['id'][_0xc3f8('0x73')]())[_0xc3f8('0x3a')](_0xc3f8('0x8a'),_0x1c6d52))[_0xc3f8('0x73')]();_0x254bf9[_0xc3f8('0x8b')](db[_0xc3f8('0x8c')]['query'](_0x161637));_0x215ae9[_0xc3f8('0x8b')](db[_0xc3f8('0x8c')][_0xc3f8('0x2f')](_0x5a8090));}return BPromise[_0xc3f8('0x8d')](_0x254bf9);}})[_0xc3f8('0x21')](function(){return BPromise[_0xc3f8('0x8d')](_0x215ae9);})['then'](function(){return _0x2049f0;})['then'](respondWithResult(_0x1376e4,null))[_0xc3f8('0x47')](handleError(_0x1376e4,null));};exports['removeLists']=function(_0x3e4819,_0x932db6,_0xae1cee){return db[_0xc3f8('0x2a')][_0xc3f8('0x46')]({'where':{'id':_0x3e4819['params']['id']}})['then'](handleEntityNotFound(_0x932db6,null))[_0xc3f8('0x21')](function(_0x1b449c){if(_0x1b449c){return _0x1b449c[_0xc3f8('0x8e')](_0x3e4819[_0xc3f8('0x2f')][_0xc3f8('0x64')]);}})[_0xc3f8('0x21')](function(_0x8122fd){if(_0x8122fd){return db[_0xc3f8('0x57')]['destroy']({'where':{'ListId':_0x3e4819[_0xc3f8('0x2f')][_0xc3f8('0x64')],'CampaignId':_0x3e4819[_0xc3f8('0x55')]['id']}})[_0xc3f8('0x21')](function(){return _0x8122fd;});}})['then'](respondWithStatusCode(_0x932db6,null))[_0xc3f8('0x47')](handleError(_0x932db6,null));};exports[_0xc3f8('0x8f')]=function(_0x522759,_0x2eeb45,_0x4da608){var _0x59c31a={};var _0x1c3b72={};var _0x5b0e13;var _0x10bd96;return db[_0xc3f8('0x2a')]['findOne']({'where':{'id':_0x522759['params']['id']}})['then'](handleEntityNotFound(_0x2eeb45,null))[_0xc3f8('0x21')](function(_0x4e01b7){if(_0x4e01b7){_0x5b0e13=_0x4e01b7;_0x1c3b72['model']=_[_0xc3f8('0x30')](db['CmList']['rawAttributes']);_0x1c3b72[_0xc3f8('0x2f')]=_[_0xc3f8('0x30')](_0x522759[_0xc3f8('0x2f')]);_0x1c3b72[_0xc3f8('0x3c')]=_['intersection'](_0x1c3b72[_0xc3f8('0x31')],_0x1c3b72[_0xc3f8('0x2f')]);_0x59c31a[_0xc3f8('0x32')]=_[_0xc3f8('0x33')](_0x1c3b72[_0xc3f8('0x31')],qs[_0xc3f8('0x34')](_0x522759[_0xc3f8('0x2f')][_0xc3f8('0x34')]));_0x59c31a[_0xc3f8('0x32')]=_0x59c31a[_0xc3f8('0x32')]['length']?_0x59c31a[_0xc3f8('0x32')]:_0x1c3b72[_0xc3f8('0x31')];_0x59c31a[_0xc3f8('0x38')]=qs[_0xc3f8('0x39')](_0x522759[_0xc3f8('0x2f')]['sort']);_0x59c31a[_0xc3f8('0x3a')]=qs[_0xc3f8('0x3c')](_[_0xc3f8('0x3b')](_0x522759['query'],_0x1c3b72[_0xc3f8('0x3c')]));if(_0x522759[_0xc3f8('0x2f')]['filter']){_0x59c31a[_0xc3f8('0x3a')]=_[_0xc3f8('0x3e')](_0x59c31a[_0xc3f8('0x3a')],{'$or':_[_0xc3f8('0x29')](_0x59c31a[_0xc3f8('0x32')],function(_0x2f1709){var _0x3cc8d4={};_0x3cc8d4[_0x2f1709]={'$like':'%'+_0x522759[_0xc3f8('0x2f')][_0xc3f8('0x3d')]+'%'};return _0x3cc8d4;})});}_0x59c31a=_['merge']({},_0x59c31a,_0x522759[_0xc3f8('0x40')]);return _0x5b0e13[_0xc3f8('0x8f')](_0x59c31a);}})[_0xc3f8('0x21')](function(_0x492b9e){if(_0x492b9e){_0x10bd96=_0x492b9e['length'];if(!_0x522759[_0xc3f8('0x2f')][_0xc3f8('0x36')](_0xc3f8('0x37'))){_0x59c31a[_0xc3f8('0x1b')]=qs[_0xc3f8('0x1b')](_0x522759[_0xc3f8('0x2f')][_0xc3f8('0x1b')]);_0x59c31a[_0xc3f8('0x1a')]=qs[_0xc3f8('0x1a')](_0x522759[_0xc3f8('0x2f')][_0xc3f8('0x1a')]);}return _0x5b0e13[_0xc3f8('0x8f')](_0x59c31a);}})['then'](function(_0x3796d1){if(_0x3796d1){return _0x3796d1?{'count':_0x10bd96,'rows':_0x3796d1}:null;}})[_0xc3f8('0x21')](respondWithResult(_0x2eeb45,null))[_0xc3f8('0x47')](handleError(_0x2eeb45,null));};exports[_0xc3f8('0x90')]=function(_0x27c888,_0x14bf38,_0x12986b){var _0x3fc6fc,_0x3642be;var _0x545b5a=[];var _0x4d921b=moment()[_0xc3f8('0x62')](_0xc3f8('0x63'));return db[_0xc3f8('0x2a')][_0xc3f8('0x46')]({'where':{'id':_0x27c888[_0xc3f8('0x55')]['id']}})[_0xc3f8('0x21')](handleEntityNotFound(_0x14bf38,null))[_0xc3f8('0x21')](function(_0x2a36a9){if(_0x2a36a9){_0x3642be=_0x2a36a9;return _0x2a36a9[_0xc3f8('0x90')](_0x27c888['body'][_0xc3f8('0x64')],_['omit'](_0x27c888['body'],[_0xc3f8('0x64'),'id'])||{});}return null;})['spread'](function(_0x49d71a){var _0x4fd1bb;var _0x4558f8;_0x3fc6fc=_0x49d71a||[];var _0x53d8d1=[];if(_0x49d71a){for(var _0x22a9e2=0x0;_0x22a9e2<_0x49d71a[_0xc3f8('0x35')];_0x22a9e2+=0x1){var _0x50f6a0=_0x49d71a[_0x22a9e2][_0xc3f8('0x4a')]({'plain':!![]});_0x4fd1bb=squel[_0xc3f8('0x7e')]()[_0xc3f8('0x68')](_0xc3f8('0x91'))['fromQuery']([_0xc3f8('0x6a'),_0xc3f8('0x6c'),_0xc3f8('0x6d'),_0xc3f8('0x5c'),'createdAt',_0xc3f8('0x52')],squel[_0xc3f8('0x6f')]()['field'](_0xc3f8('0x6a'),_0xc3f8('0x6a'))[_0xc3f8('0x70')]('id',_0xc3f8('0x6c'))[_0xc3f8('0x70')](_0x50f6a0[_0xc3f8('0x72')][_0xc3f8('0x73')](),_0xc3f8('0x6d'))[_0xc3f8('0x70')](_0x27c888[_0xc3f8('0x55')]['id'][_0xc3f8('0x73')](),_0xc3f8('0x5c'))['field'](_0xc3f8('0x71'),_0xc3f8('0x6e'))['field'](_0xc3f8('0x71'),_0xc3f8('0x52'))[_0xc3f8('0x74')](_0xc3f8('0x75'))['where'](_0xc3f8('0x76'))['where'](_0xc3f8('0x80'),_0x50f6a0[_0xc3f8('0x72')][_0xc3f8('0x73')]())[_0xc3f8('0x3a')](_0xc3f8('0x77')))[_0xc3f8('0x73')]();_0x53d8d1[_0xc3f8('0x8b')](db[_0xc3f8('0x8c')][_0xc3f8('0x2f')](_0x4fd1bb));}return BPromise[_0xc3f8('0x8d')](_0x53d8d1);}})[_0xc3f8('0x21')](function(){return _0x3fc6fc;})[_0xc3f8('0x21')](respondWithResult(_0x14bf38,null))[_0xc3f8('0x47')](handleError(_0x14bf38,null));};exports['removeBlackLists']=function(_0x312f3b,_0x36f4dd,_0x34a23a){return db[_0xc3f8('0x2a')][_0xc3f8('0x46')]({'where':{'id':_0x312f3b[_0xc3f8('0x55')]['id']}})['then'](handleEntityNotFound(_0x36f4dd,null))['then'](function(_0x13ff81){if(_0x13ff81){return _0x13ff81[_0xc3f8('0x92')](_0x312f3b[_0xc3f8('0x2f')][_0xc3f8('0x64')]);}})[_0xc3f8('0x21')](function(_0x3c480c){if(_0x3c480c){return db[_0xc3f8('0x5f')][_0xc3f8('0x24')]({'where':{'ListId':_0x312f3b[_0xc3f8('0x2f')][_0xc3f8('0x64')],'CampaignId':_0x312f3b['params']['id']}})[_0xc3f8('0x21')](function(){return _0x3c480c;});}})['then'](respondWithStatusCode(_0x36f4dd,null))[_0xc3f8('0x47')](handleError(_0x36f4dd,null));};
\ No newline at end of file
+var _0x5cfa=['h.ListId\x20=\x20?','h.createdAt\x20=\x20?','push','sequelize','all','removeLists','getBlackLists','addBlackLists','YYYY-MM-DD\x20HH:mm:ss','cm_hopper_black','removeBlackLists','eml-format','zip-dir','path','sox','ejs','fs-extra','lodash','crypto','jsforce','desk.js','to-csv','querystring','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','end','offset','undefined','limit','count','set','Content-Range','reject','save','then','destroy','error','stack','name','send','map','Campaign','rawAttributes','fieldName','type','key','model','query','filters','intersection','attributes','fields','length','hasOwnProperty','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','params','keys','find','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','userProfileId','autoAssociation','UserProfileResource','create','clone','omit','createdAt','updatedAt','body','role','IvrCampaigns','UserProfileSection','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','getHoppers','findOne','nolimit','CmHopper','getHopperHistories','getHopperFinals','CampaignId','CmHopperFinal','getHopperBlacks','CmHopperBlack','getLists','CmList','format','addLists','ids','spread','dialCheckDuplicateType','always','insert','into','cm_hopper','fromQuery','phone','ContactId','select','field','NOW()','scheduledAt','toString','from','deletedAt\x20IS\x20NULL','ListId\x20=\x20?','phone\x20IS\x20NOT\x20NULL','cm_hopper_final','CampaignId\x20=\x20?','COALESCE(phone,\x27\x27)','onlyIfOpen','ListId','phone\x20NOT\x20IN\x20(?)','cm_contacts','cm_hopper_additional_phones','OrderBy','h.id','ci.item','ci.OrderBY','cm_contact_has_items','join','h.ContactId\x20=\x20ci.CmContactId'];(function(_0x548599,_0x2fd2b7){var _0x43d782=function(_0x565796){while(--_0x565796){_0x548599['push'](_0x548599['shift']());}};_0x43d782(++_0x2fd2b7);}(_0x5cfa,0x12b));var _0xa5cf=function(_0x194758,_0x459a4d){_0x194758=_0x194758-0x0;var _0x12a66c=_0x5cfa[_0x194758];return _0x12a66c;};'use strict';var emlformat=require(_0xa5cf('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xa5cf('0x1'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require('moment');var BPromise=require('bluebird');var Mustache=require('mustache');var util=require('util');var path=require(_0xa5cf('0x2'));var sox=require(_0xa5cf('0x3'));var csv=require('to-csv');var ejs=require(_0xa5cf('0x4'));var fs=require('fs');var fs_extra=require(_0xa5cf('0x5'));var _=require(_0xa5cf('0x6'));var squel=require('squel');var crypto=require(_0xa5cf('0x7'));var jsforce=require(_0xa5cf('0x8'));var deskjs=require(_0xa5cf('0x9'));var toCsv=require(_0xa5cf('0xa'));var querystring=require(_0xa5cf('0xb'));var Papa=require('papaparse');var Redis=require(_0xa5cf('0xc'));var authService=require(_0xa5cf('0xd'));var qs=require('../../components/parsers/qs');var as=require(_0xa5cf('0xe'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xa5cf('0xf'))(_0xa5cf('0x10'));var utils=require(_0xa5cf('0x11'));var config=require('../../config/environment');var licenseUtil=require(_0xa5cf('0x12'));var db=require(_0xa5cf('0x13'))['db'];function respondWithStatusCode(_0x546a22,_0x190031){_0x190031=_0x190031||0xcc;return function(_0x3337f6){if(_0x3337f6){return _0x546a22[_0xa5cf('0x14')](_0x190031);}return _0x546a22[_0xa5cf('0x15')](_0x190031)[_0xa5cf('0x16')]();};}function respondWithResult(_0x4a3ffa,_0x534869){_0x534869=_0x534869||0xc8;return function(_0x5d27a){if(_0x5d27a){return _0x4a3ffa[_0xa5cf('0x15')](_0x534869)['json'](_0x5d27a);}};}function respondWithFilteredResult(_0x219855,_0x487638){return function(_0x24a88f){if(_0x24a88f){var _0x5edcea=typeof _0x487638[_0xa5cf('0x17')]===_0xa5cf('0x18')&&typeof _0x487638[_0xa5cf('0x19')]==='undefined';var _0xdce774=_0x24a88f[_0xa5cf('0x1a')];var _0x5aac64=_0x5edcea?0x0:_0x487638['offset'];var _0x50eb98=_0x5edcea?_0x24a88f[_0xa5cf('0x1a')]:_0x487638['offset']+_0x487638[_0xa5cf('0x19')];var _0x4b21d2;if(_0x50eb98>=_0xdce774){_0x50eb98=_0xdce774;_0x4b21d2=0xc8;}else{_0x4b21d2=0xce;}_0x219855[_0xa5cf('0x15')](_0x4b21d2);return _0x219855[_0xa5cf('0x1b')](_0xa5cf('0x1c'),_0x5aac64+'-'+_0x50eb98+'/'+_0xdce774)['json'](_0x24a88f);}return null;};}function patchUpdates(_0x2a9813){return function(_0x28a755){try{jsonpatch['apply'](_0x28a755,_0x2a9813,!![]);}catch(_0xdca3e0){return BPromise[_0xa5cf('0x1d')](_0xdca3e0);}return _0x28a755[_0xa5cf('0x1e')]();};}function saveUpdates(_0x14b7f4,_0x5abc36){return function(_0x4770f4){if(_0x4770f4){return _0x4770f4['update'](_0x14b7f4)[_0xa5cf('0x1f')](function(_0x281ed3){return _0x281ed3;});}return null;};}function removeEntity(_0x5a6cca,_0x4400ed){return function(_0x163c53){if(_0x163c53){return _0x163c53['destroy']()[_0xa5cf('0x1f')](function(){var _0xbe1480=_0x163c53['get']({'plain':!![]});var _0x50bc52='IvrCampaigns';return db['UserProfileResource'][_0xa5cf('0x20')]({'where':{'type':_0x50bc52,'resourceId':_0xbe1480['id']}})[_0xa5cf('0x1f')](function(){return _0x163c53;});})[_0xa5cf('0x1f')](function(){_0x5a6cca['status'](0xcc)[_0xa5cf('0x16')]();});}};}function handleEntityNotFound(_0x2b73a4,_0x541c46){return function(_0x550241){if(!_0x550241){_0x2b73a4[_0xa5cf('0x14')](0x194);}return _0x550241;};}function handleError(_0x116f03,_0x24f3c8){_0x24f3c8=_0x24f3c8||0x1f4;return function(_0x38420d){logger[_0xa5cf('0x21')](_0x38420d[_0xa5cf('0x22')]);if(_0x38420d[_0xa5cf('0x23')]){delete _0x38420d[_0xa5cf('0x23')];}_0x116f03[_0xa5cf('0x15')](_0x24f3c8)[_0xa5cf('0x24')](_0x38420d);};}exports['index']=function(_0xacd01,_0x115e9e){var _0x5efa7c={},_0x58dea1={},_0x414f10={'count':0x0,'rows':[]};var _0x5d259d=_[_0xa5cf('0x25')](db[_0xa5cf('0x26')][_0xa5cf('0x27')],function(_0x203680){return{'name':_0x203680[_0xa5cf('0x28')],'type':_0x203680[_0xa5cf('0x29')][_0xa5cf('0x2a')]};});_0x58dea1[_0xa5cf('0x2b')]=_[_0xa5cf('0x25')](_0x5d259d,'name');_0x58dea1[_0xa5cf('0x2c')]=_['keys'](_0xacd01[_0xa5cf('0x2c')]);_0x58dea1[_0xa5cf('0x2d')]=_[_0xa5cf('0x2e')](_0x58dea1[_0xa5cf('0x2b')],_0x58dea1[_0xa5cf('0x2c')]);_0x5efa7c[_0xa5cf('0x2f')]=_[_0xa5cf('0x2e')](_0x58dea1['model'],qs[_0xa5cf('0x30')](_0xacd01[_0xa5cf('0x2c')][_0xa5cf('0x30')]));_0x5efa7c['attributes']=_0x5efa7c['attributes'][_0xa5cf('0x31')]?_0x5efa7c[_0xa5cf('0x2f')]:_0x58dea1[_0xa5cf('0x2b')];if(!_0xacd01[_0xa5cf('0x2c')][_0xa5cf('0x32')]('nolimit')){_0x5efa7c[_0xa5cf('0x19')]=qs[_0xa5cf('0x19')](_0xacd01['query']['limit']);_0x5efa7c[_0xa5cf('0x17')]=qs['offset'](_0xacd01[_0xa5cf('0x2c')][_0xa5cf('0x17')]);}_0x5efa7c[_0xa5cf('0x33')]=qs['sort'](_0xacd01[_0xa5cf('0x2c')][_0xa5cf('0x34')]);_0x5efa7c[_0xa5cf('0x35')]=qs[_0xa5cf('0x2d')](_[_0xa5cf('0x36')](_0xacd01['query'],_0x58dea1[_0xa5cf('0x2d')]),_0x5d259d);if(_0xacd01[_0xa5cf('0x2c')][_0xa5cf('0x37')]){_0x5efa7c[_0xa5cf('0x35')]=_[_0xa5cf('0x38')](_0x5efa7c[_0xa5cf('0x35')],{'$or':_[_0xa5cf('0x25')](_0x5d259d,function(_0x5b26c9){if(_0x5b26c9[_0xa5cf('0x29')]!==_0xa5cf('0x39')){var _0x52b905={};_0x52b905[_0x5b26c9[_0xa5cf('0x23')]]={'$like':'%'+_0xacd01['query']['filter']+'%'};return _0x52b905;}})});}_0x5efa7c=_[_0xa5cf('0x38')]({},_0x5efa7c,_0xacd01[_0xa5cf('0x3a')]);var _0x398a70={'where':_0x5efa7c['where']};return db[_0xa5cf('0x26')][_0xa5cf('0x1a')](_0x398a70)[_0xa5cf('0x1f')](function(_0x5b3c33){_0x414f10[_0xa5cf('0x1a')]=_0x5b3c33;if(_0xacd01['query'][_0xa5cf('0x3b')]){_0x5efa7c[_0xa5cf('0x3c')]=[{'all':!![]}];}return db['Campaign'][_0xa5cf('0x3d')](_0x5efa7c);})[_0xa5cf('0x1f')](function(_0x2bf8dd){_0x414f10[_0xa5cf('0x3e')]=_0x2bf8dd;return _0x414f10;})['then'](respondWithFilteredResult(_0x115e9e,_0x5efa7c))[_0xa5cf('0x3f')](handleError(_0x115e9e,null));};exports[_0xa5cf('0x40')]=function(_0x33a168,_0x468181){var _0x1ff094={'raw':![],'where':{'id':_0x33a168[_0xa5cf('0x41')]['id']}},_0x2d905a={};_0x2d905a[_0xa5cf('0x2b')]=_['keys'](db[_0xa5cf('0x26')][_0xa5cf('0x27')]);_0x2d905a[_0xa5cf('0x2c')]=_[_0xa5cf('0x42')](_0x33a168[_0xa5cf('0x2c')]);_0x2d905a['filters']=_['intersection'](_0x2d905a[_0xa5cf('0x2b')],_0x2d905a[_0xa5cf('0x2c')]);_0x1ff094['attributes']=_[_0xa5cf('0x2e')](_0x2d905a['model'],qs['fields'](_0x33a168[_0xa5cf('0x2c')][_0xa5cf('0x30')]));_0x1ff094[_0xa5cf('0x2f')]=_0x1ff094[_0xa5cf('0x2f')][_0xa5cf('0x31')]?_0x1ff094[_0xa5cf('0x2f')]:_0x2d905a[_0xa5cf('0x2b')];if(_0x33a168[_0xa5cf('0x2c')][_0xa5cf('0x3b')]){_0x1ff094[_0xa5cf('0x3c')]=[{'all':!![]}];}_0x1ff094=_[_0xa5cf('0x38')]({},_0x1ff094,_0x33a168[_0xa5cf('0x3a')]);return db[_0xa5cf('0x26')][_0xa5cf('0x43')](_0x1ff094)[_0xa5cf('0x1f')](handleEntityNotFound(_0x468181,null))[_0xa5cf('0x1f')](respondWithResult(_0x468181,null))[_0xa5cf('0x3f')](handleError(_0x468181,null));};exports['create']=function(_0x5d2f43,_0x408b19){return db['Campaign']['create'](_0x5d2f43['body'],{})[_0xa5cf('0x1f')](function(_0x1403e0){var _0x133856=_0x5d2f43[_0xa5cf('0x44')][_0xa5cf('0x45')]({'plain':!![]});if(!_0x133856)throw new Error(_0xa5cf('0x46'));if(_0x133856['role']===_0xa5cf('0x44')){var _0x79d97=_0x1403e0[_0xa5cf('0x45')]({'plain':!![]});var _0x5bc3c1='IvrCampaigns';return db['UserProfileSection'][_0xa5cf('0x43')]({'where':{'name':_0x5bc3c1,'userProfileId':_0x133856[_0xa5cf('0x47')]},'raw':!![]})[_0xa5cf('0x1f')](function(_0x3a6b7a){if(_0x3a6b7a&&_0x3a6b7a[_0xa5cf('0x48')]===0x0){return db[_0xa5cf('0x49')][_0xa5cf('0x4a')]({'name':_0x79d97[_0xa5cf('0x23')],'resourceId':_0x79d97['id'],'type':_0x3a6b7a[_0xa5cf('0x23')],'sectionId':_0x3a6b7a['id']},{})[_0xa5cf('0x1f')](function(){return _0x1403e0;});}else{return _0x1403e0;}})['catch'](function(_0x33d56d){logger[_0xa5cf('0x21')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x33d56d);throw _0x33d56d;});}return _0x1403e0;})[_0xa5cf('0x1f')](respondWithResult(_0x408b19,0xc9))[_0xa5cf('0x3f')](handleError(_0x408b19,null));};exports[_0xa5cf('0x4b')]=function(_0x2f76e0,_0x1a7a26){var _0x2a0dae={'where':{'id':_0x2f76e0[_0xa5cf('0x41')]['id']}},_0x2d14c5={};_0x2d14c5[_0xa5cf('0x2b')]=_[_0xa5cf('0x42')](db[_0xa5cf('0x26')][_0xa5cf('0x27')]);_0x2a0dae['attributes']=_[_0xa5cf('0x2e')](_0x2d14c5[_0xa5cf('0x2b')],qs['fields'](_0x2f76e0['query'][_0xa5cf('0x30')]));_0x2a0dae[_0xa5cf('0x2f')]=_0x2a0dae[_0xa5cf('0x2f')]['length']?_0x2a0dae[_0xa5cf('0x2f')]:_0x2d14c5['model'];if(_0x2f76e0[_0xa5cf('0x2c')][_0xa5cf('0x3b')]){_0x2a0dae[_0xa5cf('0x3c')]=[{'all':!![]}];}_0x2a0dae=_[_0xa5cf('0x38')]({},_0x2a0dae,_0x2f76e0[_0xa5cf('0x3a')]);return db[_0xa5cf('0x26')]['find'](_0x2a0dae)[_0xa5cf('0x1f')](handleEntityNotFound(_0x1a7a26,null))['then'](function(_0x69569){if(_0x69569){var _0xf3406c=_0x69569[_0xa5cf('0x45')]({'plain':!![]});_0xf3406c=qs[_0xa5cf('0x4c')](_0xf3406c,['id',_0xa5cf('0x4d'),_0xa5cf('0x4e')]);_0x2f76e0['body']=_[_0xa5cf('0x4c')](_0x2f76e0[_0xa5cf('0x4f')],['id',_0xa5cf('0x4d'),_0xa5cf('0x4e')]);return db[_0xa5cf('0x26')][_0xa5cf('0x4a')](_[_0xa5cf('0x38')](_0xf3406c,_0x2f76e0[_0xa5cf('0x4f')]),{'include':_0x2f76e0[_0xa5cf('0x2c')]['includeAll']?[{'all':!![]}]:undefined})['then'](function(_0x3c5f65){var _0x5befbd=_0x2f76e0[_0xa5cf('0x44')][_0xa5cf('0x45')]({'plain':!![]});if(!_0x5befbd)throw new Error(_0xa5cf('0x46'));if(_0x5befbd[_0xa5cf('0x50')]===_0xa5cf('0x44')){var _0x1d2270=_0x3c5f65[_0xa5cf('0x45')]({'plain':!![]});var _0x34ddeb=_0xa5cf('0x51');return db[_0xa5cf('0x52')][_0xa5cf('0x43')]({'where':{'name':_0x34ddeb,'userProfileId':_0x5befbd[_0xa5cf('0x47')]},'raw':!![]})[_0xa5cf('0x1f')](function(_0x52071c){if(_0x52071c&&_0x52071c[_0xa5cf('0x48')]===0x0){return db[_0xa5cf('0x49')][_0xa5cf('0x4a')]({'name':_0x1d2270[_0xa5cf('0x23')],'resourceId':_0x1d2270['id'],'type':_0x52071c[_0xa5cf('0x23')],'sectionId':_0x52071c['id']},{})[_0xa5cf('0x1f')](function(){return _0x3c5f65;});}else{return _0x3c5f65;}})[_0xa5cf('0x3f')](function(_0x5652e8){logger['error'](_0xa5cf('0x53'),_0x5652e8);throw _0x5652e8;});}return _0x3c5f65;});}})[_0xa5cf('0x1f')](respondWithResult(_0x1a7a26,0xc9))['catch'](handleError(_0x1a7a26,null));};exports[_0xa5cf('0x54')]=function(_0x4f2361,_0x17ee01){if(_0x4f2361[_0xa5cf('0x4f')]['id']){delete _0x4f2361[_0xa5cf('0x4f')]['id'];}return db[_0xa5cf('0x26')][_0xa5cf('0x43')]({'where':{'id':_0x4f2361[_0xa5cf('0x41')]['id']}})[_0xa5cf('0x1f')](handleEntityNotFound(_0x17ee01,null))[_0xa5cf('0x1f')](saveUpdates(_0x4f2361['body'],null))['then'](respondWithResult(_0x17ee01,null))[_0xa5cf('0x3f')](handleError(_0x17ee01,null));};exports[_0xa5cf('0x20')]=function(_0x3dcbca,_0x2d5b91){return db[_0xa5cf('0x26')]['find']({'where':{'id':_0x3dcbca[_0xa5cf('0x41')]['id']}})['then'](handleEntityNotFound(_0x2d5b91,null))[_0xa5cf('0x1f')](removeEntity(_0x2d5b91,null))[_0xa5cf('0x3f')](handleError(_0x2d5b91,null));};exports[_0xa5cf('0x55')]=function(_0x1be1cd,_0x334742,_0x101e7c){var _0x2f8316={'raw':!![],'where':{}};var _0xa62e80={};var _0x48f2d0={'count':0x0,'rows':[]};return db[_0xa5cf('0x26')][_0xa5cf('0x56')]({'where':{'id':_0x1be1cd[_0xa5cf('0x41')]['id']}})[_0xa5cf('0x1f')](handleEntityNotFound(_0x334742,null))[_0xa5cf('0x1f')](function(_0x35f873){if(_0x35f873){_0xa62e80['model']=_[_0xa5cf('0x42')](db['CmHopper'][_0xa5cf('0x27')]);_0xa62e80[_0xa5cf('0x2c')]=_[_0xa5cf('0x42')](_0x1be1cd[_0xa5cf('0x2c')]);_0xa62e80[_0xa5cf('0x2d')]=_[_0xa5cf('0x2e')](_0xa62e80[_0xa5cf('0x2b')],_0xa62e80[_0xa5cf('0x2c')]);_0x2f8316[_0xa5cf('0x2f')]=_[_0xa5cf('0x2e')](_0xa62e80['model'],qs['fields'](_0x1be1cd[_0xa5cf('0x2c')]['fields']));_0x2f8316[_0xa5cf('0x2f')]=_0x2f8316['attributes'][_0xa5cf('0x31')]?_0x2f8316['attributes']:_0xa62e80[_0xa5cf('0x2b')];if(!_0x1be1cd[_0xa5cf('0x2c')][_0xa5cf('0x32')](_0xa5cf('0x57'))){_0x2f8316[_0xa5cf('0x19')]=qs[_0xa5cf('0x19')](_0x1be1cd[_0xa5cf('0x2c')][_0xa5cf('0x19')]);_0x2f8316['offset']=qs[_0xa5cf('0x17')](_0x1be1cd[_0xa5cf('0x2c')][_0xa5cf('0x17')]);}_0x2f8316['order']=qs[_0xa5cf('0x34')](_0x1be1cd['query'][_0xa5cf('0x34')]);_0x2f8316[_0xa5cf('0x35')]=qs[_0xa5cf('0x2d')](_[_0xa5cf('0x36')](_0x1be1cd['query'],_0xa62e80[_0xa5cf('0x2d')]));_0x2f8316['where']['CampaignId']=_0x35f873['id'];if(_0x1be1cd[_0xa5cf('0x2c')][_0xa5cf('0x37')]){_0x2f8316['where']=_[_0xa5cf('0x38')](_0x2f8316['where'],{'$or':_[_0xa5cf('0x25')](_0x2f8316[_0xa5cf('0x2f')],function(_0x2880e5){var _0x11dafc={};_0x11dafc[_0x2880e5]={'$like':'%'+_0x1be1cd['query'][_0xa5cf('0x37')]+'%'};return _0x11dafc;})});}_0x2f8316=_[_0xa5cf('0x38')]({},_0x2f8316,_0x1be1cd[_0xa5cf('0x3a')]);return db['CmHopper']['count']({'where':_0x2f8316[_0xa5cf('0x35')]})[_0xa5cf('0x1f')](function(_0x41c31b){_0x48f2d0[_0xa5cf('0x1a')]=_0x41c31b;if(_0x1be1cd[_0xa5cf('0x2c')]['includeAll']){_0x2f8316['include']=[{'all':!![]}];}return db[_0xa5cf('0x58')][_0xa5cf('0x3d')](_0x2f8316);})[_0xa5cf('0x1f')](function(_0x258457){_0x48f2d0[_0xa5cf('0x3e')]=_0x258457;return _0x48f2d0;});}})['then'](respondWithFilteredResult(_0x334742,_0x2f8316))[_0xa5cf('0x3f')](handleError(_0x334742,null));};exports[_0xa5cf('0x59')]=function(_0x2a9e13,_0x37ea50,_0x257856){var _0x39d71b={'raw':!![],'where':{}};var _0x4a0f88={};var _0x585094={'count':0x0,'rows':[]};return db['Campaign'][_0xa5cf('0x56')]({'where':{'id':_0x2a9e13[_0xa5cf('0x41')]['id']}})[_0xa5cf('0x1f')](handleEntityNotFound(_0x37ea50,null))['then'](function(_0x329a97){if(_0x329a97){_0x4a0f88[_0xa5cf('0x2b')]=_[_0xa5cf('0x42')](db['CmHopperHistory']['rawAttributes']);_0x4a0f88[_0xa5cf('0x2c')]=_['keys'](_0x2a9e13[_0xa5cf('0x2c')]);_0x4a0f88['filters']=_[_0xa5cf('0x2e')](_0x4a0f88[_0xa5cf('0x2b')],_0x4a0f88['query']);_0x39d71b['attributes']=_[_0xa5cf('0x2e')](_0x4a0f88[_0xa5cf('0x2b')],qs[_0xa5cf('0x30')](_0x2a9e13[_0xa5cf('0x2c')][_0xa5cf('0x30')]));_0x39d71b[_0xa5cf('0x2f')]=_0x39d71b['attributes'][_0xa5cf('0x31')]?_0x39d71b[_0xa5cf('0x2f')]:_0x4a0f88['model'];if(!_0x2a9e13['query'][_0xa5cf('0x32')](_0xa5cf('0x57'))){_0x39d71b['limit']=qs[_0xa5cf('0x19')](_0x2a9e13['query'][_0xa5cf('0x19')]);_0x39d71b[_0xa5cf('0x17')]=qs[_0xa5cf('0x17')](_0x2a9e13[_0xa5cf('0x2c')][_0xa5cf('0x17')]);}_0x39d71b[_0xa5cf('0x33')]=qs[_0xa5cf('0x34')](_0x2a9e13[_0xa5cf('0x2c')][_0xa5cf('0x34')]);_0x39d71b['where']=qs[_0xa5cf('0x2d')](_['pick'](_0x2a9e13['query'],_0x4a0f88[_0xa5cf('0x2d')]));_0x39d71b[_0xa5cf('0x35')]['CampaignId']=_0x329a97['id'];if(_0x2a9e13[_0xa5cf('0x2c')][_0xa5cf('0x37')]){_0x39d71b[_0xa5cf('0x35')]=_[_0xa5cf('0x38')](_0x39d71b[_0xa5cf('0x35')],{'$or':_['map'](_0x39d71b[_0xa5cf('0x2f')],function(_0x309cd1){var _0x12f823={};_0x12f823[_0x309cd1]={'$like':'%'+_0x2a9e13[_0xa5cf('0x2c')]['filter']+'%'};return _0x12f823;})});}_0x39d71b=_[_0xa5cf('0x38')]({},_0x39d71b,_0x2a9e13[_0xa5cf('0x3a')]);return db['CmHopperHistory'][_0xa5cf('0x1a')]({'where':_0x39d71b[_0xa5cf('0x35')]})[_0xa5cf('0x1f')](function(_0x2d9c61){_0x585094[_0xa5cf('0x1a')]=_0x2d9c61;if(_0x2a9e13[_0xa5cf('0x2c')][_0xa5cf('0x3b')]){_0x39d71b[_0xa5cf('0x3c')]=[{'all':!![]}];}return db['CmHopperHistory'][_0xa5cf('0x3d')](_0x39d71b);})[_0xa5cf('0x1f')](function(_0x562f72){_0x585094[_0xa5cf('0x3e')]=_0x562f72;return _0x585094;});}})[_0xa5cf('0x1f')](respondWithFilteredResult(_0x37ea50,_0x39d71b))['catch'](handleError(_0x37ea50,null));};exports[_0xa5cf('0x5a')]=function(_0x1d0deb,_0x27b667,_0x171edc){var _0x20047b={'raw':!![],'where':{}};var _0x56a80d={};var _0x4f3aff={'count':0x0,'rows':[]};return db[_0xa5cf('0x26')][_0xa5cf('0x56')]({'where':{'id':_0x1d0deb[_0xa5cf('0x41')]['id']}})['then'](handleEntityNotFound(_0x27b667,null))[_0xa5cf('0x1f')](function(_0x23112e){if(_0x23112e){_0x56a80d[_0xa5cf('0x2b')]=_[_0xa5cf('0x42')](db['CmHopperFinal'][_0xa5cf('0x27')]);_0x56a80d['query']=_[_0xa5cf('0x42')](_0x1d0deb['query']);_0x56a80d['filters']=_[_0xa5cf('0x2e')](_0x56a80d[_0xa5cf('0x2b')],_0x56a80d['query']);_0x20047b[_0xa5cf('0x2f')]=_[_0xa5cf('0x2e')](_0x56a80d[_0xa5cf('0x2b')],qs[_0xa5cf('0x30')](_0x1d0deb[_0xa5cf('0x2c')]['fields']));_0x20047b[_0xa5cf('0x2f')]=_0x20047b['attributes']['length']?_0x20047b[_0xa5cf('0x2f')]:_0x56a80d['model'];if(!_0x1d0deb[_0xa5cf('0x2c')][_0xa5cf('0x32')](_0xa5cf('0x57'))){_0x20047b[_0xa5cf('0x19')]=qs[_0xa5cf('0x19')](_0x1d0deb[_0xa5cf('0x2c')][_0xa5cf('0x19')]);_0x20047b[_0xa5cf('0x17')]=qs[_0xa5cf('0x17')](_0x1d0deb[_0xa5cf('0x2c')][_0xa5cf('0x17')]);}_0x20047b['order']=qs['sort'](_0x1d0deb['query'][_0xa5cf('0x34')]);_0x20047b['where']=qs['filters'](_[_0xa5cf('0x36')](_0x1d0deb[_0xa5cf('0x2c')],_0x56a80d[_0xa5cf('0x2d')]));_0x20047b['where'][_0xa5cf('0x5b')]=_0x23112e['id'];if(_0x1d0deb['query'][_0xa5cf('0x37')]){_0x20047b[_0xa5cf('0x35')]=_['merge'](_0x20047b['where'],{'$or':_[_0xa5cf('0x25')](_0x20047b['attributes'],function(_0x100c55){var _0x48eaf3={};_0x48eaf3[_0x100c55]={'$like':'%'+_0x1d0deb[_0xa5cf('0x2c')]['filter']+'%'};return _0x48eaf3;})});}_0x20047b=_[_0xa5cf('0x38')]({},_0x20047b,_0x1d0deb[_0xa5cf('0x3a')]);return db[_0xa5cf('0x5c')][_0xa5cf('0x1a')]({'where':_0x20047b[_0xa5cf('0x35')]})[_0xa5cf('0x1f')](function(_0x9976d0){_0x4f3aff['count']=_0x9976d0;if(_0x1d0deb[_0xa5cf('0x2c')][_0xa5cf('0x3b')]){_0x20047b['include']=[{'all':!![]}];}return db[_0xa5cf('0x5c')][_0xa5cf('0x3d')](_0x20047b);})['then'](function(_0x19291c){_0x4f3aff[_0xa5cf('0x3e')]=_0x19291c;return _0x4f3aff;});}})[_0xa5cf('0x1f')](respondWithFilteredResult(_0x27b667,_0x20047b))[_0xa5cf('0x3f')](handleError(_0x27b667,null));};exports[_0xa5cf('0x5d')]=function(_0x4af373,_0x5db072,_0x1bffb1){var _0x318e6d={'raw':!![],'where':{}};var _0x5d5e78={};var _0x101dbf={'count':0x0,'rows':[]};return db[_0xa5cf('0x26')][_0xa5cf('0x56')]({'where':{'id':_0x4af373[_0xa5cf('0x41')]['id']}})[_0xa5cf('0x1f')](handleEntityNotFound(_0x5db072,null))['then'](function(_0x362acb){if(_0x362acb){_0x5d5e78['model']=_[_0xa5cf('0x42')](db['CmHopperBlack'][_0xa5cf('0x27')]);_0x5d5e78['query']=_[_0xa5cf('0x42')](_0x4af373['query']);_0x5d5e78[_0xa5cf('0x2d')]=_[_0xa5cf('0x2e')](_0x5d5e78['model'],_0x5d5e78['query']);_0x318e6d[_0xa5cf('0x2f')]=_[_0xa5cf('0x2e')](_0x5d5e78[_0xa5cf('0x2b')],qs[_0xa5cf('0x30')](_0x4af373['query']['fields']));_0x318e6d[_0xa5cf('0x2f')]=_0x318e6d[_0xa5cf('0x2f')][_0xa5cf('0x31')]?_0x318e6d['attributes']:_0x5d5e78[_0xa5cf('0x2b')];if(!_0x4af373[_0xa5cf('0x2c')][_0xa5cf('0x32')](_0xa5cf('0x57'))){_0x318e6d[_0xa5cf('0x19')]=qs[_0xa5cf('0x19')](_0x4af373[_0xa5cf('0x2c')][_0xa5cf('0x19')]);_0x318e6d['offset']=qs['offset'](_0x4af373[_0xa5cf('0x2c')][_0xa5cf('0x17')]);}_0x318e6d[_0xa5cf('0x33')]=qs[_0xa5cf('0x34')](_0x4af373[_0xa5cf('0x2c')][_0xa5cf('0x34')]);_0x318e6d['where']=qs[_0xa5cf('0x2d')](_['pick'](_0x4af373['query'],_0x5d5e78[_0xa5cf('0x2d')]));_0x318e6d[_0xa5cf('0x35')][_0xa5cf('0x5b')]=_0x362acb['id'];if(_0x4af373['query']['filter']){_0x318e6d[_0xa5cf('0x35')]=_['merge'](_0x318e6d['where'],{'$or':_[_0xa5cf('0x25')](_0x318e6d['attributes'],function(_0x7a6a17){var _0x656758={};_0x656758[_0x7a6a17]={'$like':'%'+_0x4af373['query'][_0xa5cf('0x37')]+'%'};return _0x656758;})});}_0x318e6d=_[_0xa5cf('0x38')]({},_0x318e6d,_0x4af373[_0xa5cf('0x3a')]);return db[_0xa5cf('0x5e')][_0xa5cf('0x1a')]({'where':_0x318e6d[_0xa5cf('0x35')]})[_0xa5cf('0x1f')](function(_0x206bb5){_0x101dbf[_0xa5cf('0x1a')]=_0x206bb5;if(_0x4af373['query']['includeAll']){_0x318e6d[_0xa5cf('0x3c')]=[{'all':!![]}];}return db[_0xa5cf('0x5e')][_0xa5cf('0x3d')](_0x318e6d);})[_0xa5cf('0x1f')](function(_0x502ba7){_0x101dbf[_0xa5cf('0x3e')]=_0x502ba7;return _0x101dbf;});}})[_0xa5cf('0x1f')](respondWithFilteredResult(_0x5db072,_0x318e6d))[_0xa5cf('0x3f')](handleError(_0x5db072,null));};exports[_0xa5cf('0x5f')]=function(_0x3e08d5,_0x5c31cd,_0x42e741){var _0x47d2d8={};var _0x43f7f={};var _0x222787;var _0x1d65ce;return db[_0xa5cf('0x26')][_0xa5cf('0x56')]({'where':{'id':_0x3e08d5[_0xa5cf('0x41')]['id']}})[_0xa5cf('0x1f')](handleEntityNotFound(_0x5c31cd,null))[_0xa5cf('0x1f')](function(_0x4f1ae0){if(_0x4f1ae0){_0x222787=_0x4f1ae0;_0x43f7f[_0xa5cf('0x2b')]=_['keys'](db[_0xa5cf('0x60')][_0xa5cf('0x27')]);_0x43f7f[_0xa5cf('0x2c')]=_[_0xa5cf('0x42')](_0x3e08d5['query']);_0x43f7f[_0xa5cf('0x2d')]=_[_0xa5cf('0x2e')](_0x43f7f[_0xa5cf('0x2b')],_0x43f7f[_0xa5cf('0x2c')]);_0x47d2d8['attributes']=_[_0xa5cf('0x2e')](_0x43f7f[_0xa5cf('0x2b')],qs[_0xa5cf('0x30')](_0x3e08d5[_0xa5cf('0x2c')]['fields']));_0x47d2d8[_0xa5cf('0x2f')]=_0x47d2d8[_0xa5cf('0x2f')][_0xa5cf('0x31')]?_0x47d2d8[_0xa5cf('0x2f')]:_0x43f7f[_0xa5cf('0x2b')];_0x47d2d8[_0xa5cf('0x33')]=qs[_0xa5cf('0x34')](_0x3e08d5['query'][_0xa5cf('0x34')]);_0x47d2d8[_0xa5cf('0x35')]=qs[_0xa5cf('0x2d')](_[_0xa5cf('0x36')](_0x3e08d5['query'],_0x43f7f['filters']));if(_0x3e08d5[_0xa5cf('0x2c')][_0xa5cf('0x37')]){_0x47d2d8[_0xa5cf('0x35')]=_['merge'](_0x47d2d8['where'],{'$or':_[_0xa5cf('0x25')](_0x47d2d8[_0xa5cf('0x2f')],function(_0x52c091){var _0x221c9e={};_0x221c9e[_0x52c091]={'$like':'%'+_0x3e08d5['query']['filter']+'%'};return _0x221c9e;})});}_0x47d2d8=_[_0xa5cf('0x38')]({},_0x47d2d8,_0x3e08d5[_0xa5cf('0x3a')]);return _0x222787['getLists'](_0x47d2d8);}})[_0xa5cf('0x1f')](function(_0x266864){if(_0x266864){_0x1d65ce=_0x266864[_0xa5cf('0x31')];if(!_0x3e08d5[_0xa5cf('0x2c')][_0xa5cf('0x32')](_0xa5cf('0x57'))){_0x47d2d8['limit']=qs[_0xa5cf('0x19')](_0x3e08d5[_0xa5cf('0x2c')][_0xa5cf('0x19')]);_0x47d2d8[_0xa5cf('0x17')]=qs['offset'](_0x3e08d5[_0xa5cf('0x2c')]['offset']);}return _0x222787[_0xa5cf('0x5f')](_0x47d2d8);}})['then'](function(_0x35f352){if(_0x35f352){return _0x35f352?{'count':_0x1d65ce,'rows':_0x35f352}:null;}})[_0xa5cf('0x1f')](respondWithResult(_0x5c31cd,null))[_0xa5cf('0x3f')](handleError(_0x5c31cd,null));};exports['addLists']=function(_0x40cb1f,_0x282023,_0x34e2d8){var _0x6da95a,_0x5c8511;var _0x3a6485=[];var _0x4af1df=moment()[_0xa5cf('0x61')]('YYYY-MM-DD\x20HH:mm:ss');return db[_0xa5cf('0x26')]['find']({'where':{'id':_0x40cb1f[_0xa5cf('0x41')]['id']}})['then'](handleEntityNotFound(_0x282023,null))['then'](function(_0x36a9a1){if(_0x36a9a1){_0x5c8511=_0x36a9a1;return _0x36a9a1[_0xa5cf('0x62')](_0x40cb1f[_0xa5cf('0x4f')][_0xa5cf('0x63')],_['omit'](_0x40cb1f[_0xa5cf('0x4f')],[_0xa5cf('0x63'),'id'])||{});}return null;})[_0xa5cf('0x64')](function(_0x458978){var _0x493a2a;var _0x5ba7c4;_0x6da95a=_0x458978||[];var _0x54bc0a=[];if(_0x458978){for(var _0x1d5b50=0x0;_0x1d5b50<_0x458978[_0xa5cf('0x31')];_0x1d5b50+=0x1){var _0x4762c8=_0x458978[_0x1d5b50]['get']({'plain':!![]});_0x5c8511[_0xa5cf('0x65')]=_0x40cb1f[_0xa5cf('0x4f')]['dialCheckDuplicateType']?_0x40cb1f[_0xa5cf('0x4f')][_0xa5cf('0x65')]:_0x5c8511[_0xa5cf('0x65')];switch(_0x5c8511[_0xa5cf('0x65')]){case _0xa5cf('0x66'):_0x493a2a=squel[_0xa5cf('0x67')]()[_0xa5cf('0x68')](_0xa5cf('0x69'))[_0xa5cf('0x6a')]([_0xa5cf('0x6b'),'scheduledAt',_0xa5cf('0x6c'),'ListId',_0xa5cf('0x5b'),_0xa5cf('0x4d'),_0xa5cf('0x4e')],squel[_0xa5cf('0x6d')]()[_0xa5cf('0x6e')](_0xa5cf('0x6b'),_0xa5cf('0x6b'))[_0xa5cf('0x6e')](_0xa5cf('0x6f'),_0xa5cf('0x70'))[_0xa5cf('0x6e')]('id',_0xa5cf('0x6c'))[_0xa5cf('0x6e')](_0x4762c8['CmListId']['toString'](),'ListId')[_0xa5cf('0x6e')](_0x40cb1f[_0xa5cf('0x41')]['id'][_0xa5cf('0x71')](),_0xa5cf('0x5b'))['field']('\x27'+_0x4af1df+'\x27',_0xa5cf('0x4d'))['field']('\x27'+_0x4af1df+'\x27',_0xa5cf('0x4e'))[_0xa5cf('0x72')]('cm_contacts')['where'](_0xa5cf('0x73'))[_0xa5cf('0x35')](_0xa5cf('0x74'),_0x4762c8['CmListId'][_0xa5cf('0x71')]())['where'](_0xa5cf('0x75'))[_0xa5cf('0x35')]('phone\x20NOT\x20IN\x20(?)',squel[_0xa5cf('0x6d')]()['field']('COALESCE(calleridnum,\x27\x27)')['from'](_0xa5cf('0x76'))['where'](_0xa5cf('0x77'),_0x40cb1f[_0xa5cf('0x41')]['id']['toString']()))['where']('phone\x20NOT\x20IN\x20(?)',squel[_0xa5cf('0x6d')]()[_0xa5cf('0x6e')](_0xa5cf('0x78'))['from']('cm_hopper')[_0xa5cf('0x35')](_0xa5cf('0x77'),_0x40cb1f[_0xa5cf('0x41')]['id']['toString']())))[_0xa5cf('0x71')]();break;case _0xa5cf('0x79'):_0x493a2a=squel[_0xa5cf('0x67')]()['into'](_0xa5cf('0x69'))[_0xa5cf('0x6a')](['phone','scheduledAt',_0xa5cf('0x6c'),'ListId',_0xa5cf('0x5b'),_0xa5cf('0x4d'),_0xa5cf('0x4e')],squel[_0xa5cf('0x6d')]()[_0xa5cf('0x6e')](_0xa5cf('0x6b'),_0xa5cf('0x6b'))[_0xa5cf('0x6e')](_0xa5cf('0x6f'),'scheduledAt')[_0xa5cf('0x6e')]('id',_0xa5cf('0x6c'))[_0xa5cf('0x6e')](_0x4762c8['CmListId'][_0xa5cf('0x71')](),_0xa5cf('0x7a'))[_0xa5cf('0x6e')](_0x40cb1f[_0xa5cf('0x41')]['id'][_0xa5cf('0x71')](),'CampaignId')[_0xa5cf('0x6e')]('\x27'+_0x4af1df+'\x27',_0xa5cf('0x4d'))['field']('\x27'+_0x4af1df+'\x27',_0xa5cf('0x4e'))[_0xa5cf('0x72')]('cm_contacts')['where'](_0xa5cf('0x73'))[_0xa5cf('0x35')](_0xa5cf('0x74'),_0x4762c8['CmListId'][_0xa5cf('0x71')]())[_0xa5cf('0x35')]('phone\x20IS\x20NOT\x20NULL')['where'](_0xa5cf('0x7b'),squel[_0xa5cf('0x6d')]()[_0xa5cf('0x6e')](_0xa5cf('0x78'))['from']('cm_hopper')[_0xa5cf('0x35')](_0xa5cf('0x77'),_0x40cb1f[_0xa5cf('0x41')]['id']['toString']())))[_0xa5cf('0x71')]();break;default:_0x493a2a=squel[_0xa5cf('0x67')]()[_0xa5cf('0x68')](_0xa5cf('0x69'))[_0xa5cf('0x6a')](['phone',_0xa5cf('0x70'),_0xa5cf('0x6c'),'ListId',_0xa5cf('0x5b'),_0xa5cf('0x4d'),_0xa5cf('0x4e')],squel['select']()[_0xa5cf('0x6e')](_0xa5cf('0x6b'),'phone')[_0xa5cf('0x6e')](_0xa5cf('0x6f'),_0xa5cf('0x70'))[_0xa5cf('0x6e')]('id',_0xa5cf('0x6c'))[_0xa5cf('0x6e')](_0x4762c8['CmListId'][_0xa5cf('0x71')](),_0xa5cf('0x7a'))[_0xa5cf('0x6e')](_0x40cb1f[_0xa5cf('0x41')]['id'][_0xa5cf('0x71')](),_0xa5cf('0x5b'))[_0xa5cf('0x6e')]('\x27'+_0x4af1df+'\x27',_0xa5cf('0x4d'))[_0xa5cf('0x6e')]('\x27'+_0x4af1df+'\x27',_0xa5cf('0x4e'))[_0xa5cf('0x72')](_0xa5cf('0x7c'))[_0xa5cf('0x35')](_0xa5cf('0x73'))[_0xa5cf('0x35')](_0xa5cf('0x74'),_0x4762c8['CmListId'][_0xa5cf('0x71')]())[_0xa5cf('0x35')](_0xa5cf('0x75')))['toString']();}_0x5ba7c4=squel[_0xa5cf('0x67')]()[_0xa5cf('0x68')](_0xa5cf('0x7d'))[_0xa5cf('0x6a')](['cmHopperId','scheduledAt',_0xa5cf('0x6b'),_0xa5cf('0x7e'),_0xa5cf('0x4d'),_0xa5cf('0x4e')],squel[_0xa5cf('0x6d')]()[_0xa5cf('0x6e')](_0xa5cf('0x7f'),'id')[_0xa5cf('0x6e')]('NOW()',_0xa5cf('0x70'))['field'](_0xa5cf('0x80'),'phone')[_0xa5cf('0x6e')](_0xa5cf('0x81'),'OrderBy')[_0xa5cf('0x6e')]('\x27'+_0x4af1df+'\x27',_0xa5cf('0x4d'))[_0xa5cf('0x6e')]('\x27'+_0x4af1df+'\x27',_0xa5cf('0x4e'))[_0xa5cf('0x72')](_0xa5cf('0x82'),'ci')[_0xa5cf('0x83')](_0xa5cf('0x69'),'h',_0xa5cf('0x84'))['where'](_0xa5cf('0x85'),_0x4762c8['CmListId']['toString']())[_0xa5cf('0x35')]('h.CampaignId=?',_0x40cb1f[_0xa5cf('0x41')]['id'][_0xa5cf('0x71')]())['where'](_0xa5cf('0x86'),_0x4af1df))['toString']();_0x54bc0a[_0xa5cf('0x87')](db[_0xa5cf('0x88')][_0xa5cf('0x2c')](_0x493a2a));_0x3a6485['push'](db[_0xa5cf('0x88')][_0xa5cf('0x2c')](_0x5ba7c4));}return BPromise[_0xa5cf('0x89')](_0x54bc0a);}})['then'](function(){return BPromise[_0xa5cf('0x89')](_0x3a6485);})[_0xa5cf('0x1f')](function(){return _0x6da95a;})[_0xa5cf('0x1f')](respondWithResult(_0x282023,null))['catch'](handleError(_0x282023,null));};exports[_0xa5cf('0x8a')]=function(_0x84c92a,_0x432718,_0x3a4c30){return db[_0xa5cf('0x26')][_0xa5cf('0x43')]({'where':{'id':_0x84c92a['params']['id']}})[_0xa5cf('0x1f')](handleEntityNotFound(_0x432718,null))[_0xa5cf('0x1f')](function(_0x3c67b1){if(_0x3c67b1){return _0x3c67b1['removeLists'](_0x84c92a[_0xa5cf('0x2c')][_0xa5cf('0x63')]);}})['then'](function(_0x2d80dc){if(_0x2d80dc){return db[_0xa5cf('0x58')][_0xa5cf('0x20')]({'where':{'ListId':_0x84c92a['query']['ids'],'CampaignId':_0x84c92a[_0xa5cf('0x41')]['id']}})['then'](function(){return _0x2d80dc;});}})[_0xa5cf('0x1f')](respondWithStatusCode(_0x432718,null))[_0xa5cf('0x3f')](handleError(_0x432718,null));};exports['getBlackLists']=function(_0x3e0836,_0x4b1c4d,_0x54f6c9){var _0x1dd071={};var _0x367c2b={};var _0x583a10;var _0x54f106;return db['Campaign'][_0xa5cf('0x56')]({'where':{'id':_0x3e0836[_0xa5cf('0x41')]['id']}})['then'](handleEntityNotFound(_0x4b1c4d,null))['then'](function(_0x3f01f5){if(_0x3f01f5){_0x583a10=_0x3f01f5;_0x367c2b[_0xa5cf('0x2b')]=_[_0xa5cf('0x42')](db[_0xa5cf('0x60')][_0xa5cf('0x27')]);_0x367c2b[_0xa5cf('0x2c')]=_[_0xa5cf('0x42')](_0x3e0836[_0xa5cf('0x2c')]);_0x367c2b[_0xa5cf('0x2d')]=_[_0xa5cf('0x2e')](_0x367c2b['model'],_0x367c2b[_0xa5cf('0x2c')]);_0x1dd071['attributes']=_['intersection'](_0x367c2b['model'],qs[_0xa5cf('0x30')](_0x3e0836[_0xa5cf('0x2c')][_0xa5cf('0x30')]));_0x1dd071['attributes']=_0x1dd071[_0xa5cf('0x2f')][_0xa5cf('0x31')]?_0x1dd071[_0xa5cf('0x2f')]:_0x367c2b[_0xa5cf('0x2b')];_0x1dd071['order']=qs['sort'](_0x3e0836[_0xa5cf('0x2c')][_0xa5cf('0x34')]);_0x1dd071[_0xa5cf('0x35')]=qs[_0xa5cf('0x2d')](_[_0xa5cf('0x36')](_0x3e0836[_0xa5cf('0x2c')],_0x367c2b[_0xa5cf('0x2d')]));if(_0x3e0836[_0xa5cf('0x2c')][_0xa5cf('0x37')]){_0x1dd071[_0xa5cf('0x35')]=_[_0xa5cf('0x38')](_0x1dd071[_0xa5cf('0x35')],{'$or':_['map'](_0x1dd071[_0xa5cf('0x2f')],function(_0x2600ed){var _0x5d6a3a={};_0x5d6a3a[_0x2600ed]={'$like':'%'+_0x3e0836[_0xa5cf('0x2c')][_0xa5cf('0x37')]+'%'};return _0x5d6a3a;})});}_0x1dd071=_['merge']({},_0x1dd071,_0x3e0836[_0xa5cf('0x3a')]);return _0x583a10[_0xa5cf('0x8b')](_0x1dd071);}})[_0xa5cf('0x1f')](function(_0x285dc6){if(_0x285dc6){_0x54f106=_0x285dc6['length'];if(!_0x3e0836['query'][_0xa5cf('0x32')]('nolimit')){_0x1dd071[_0xa5cf('0x19')]=qs[_0xa5cf('0x19')](_0x3e0836[_0xa5cf('0x2c')][_0xa5cf('0x19')]);_0x1dd071[_0xa5cf('0x17')]=qs[_0xa5cf('0x17')](_0x3e0836[_0xa5cf('0x2c')]['offset']);}return _0x583a10[_0xa5cf('0x8b')](_0x1dd071);}})[_0xa5cf('0x1f')](function(_0x293d75){if(_0x293d75){return _0x293d75?{'count':_0x54f106,'rows':_0x293d75}:null;}})[_0xa5cf('0x1f')](respondWithResult(_0x4b1c4d,null))['catch'](handleError(_0x4b1c4d,null));};exports[_0xa5cf('0x8c')]=function(_0x478ab8,_0xa7f1b9,_0x5c6dde){var _0x10c6f0,_0x31500e;var _0x5083c3=[];var _0x4c73d9=moment()[_0xa5cf('0x61')](_0xa5cf('0x8d'));return db[_0xa5cf('0x26')][_0xa5cf('0x43')]({'where':{'id':_0x478ab8[_0xa5cf('0x41')]['id']}})[_0xa5cf('0x1f')](handleEntityNotFound(_0xa7f1b9,null))[_0xa5cf('0x1f')](function(_0x186cfd){if(_0x186cfd){_0x31500e=_0x186cfd;return _0x186cfd[_0xa5cf('0x8c')](_0x478ab8[_0xa5cf('0x4f')]['ids'],_[_0xa5cf('0x4c')](_0x478ab8['body'],[_0xa5cf('0x63'),'id'])||{});}return null;})[_0xa5cf('0x64')](function(_0x229874){var _0x132ee3;var _0x199849;_0x10c6f0=_0x229874||[];var _0x1b87d6=[];if(_0x229874){for(var _0x5150dc=0x0;_0x5150dc<_0x229874['length'];_0x5150dc+=0x1){var _0x4f8473=_0x229874[_0x5150dc][_0xa5cf('0x45')]({'plain':!![]});_0x132ee3=squel[_0xa5cf('0x67')]()[_0xa5cf('0x68')](_0xa5cf('0x8e'))[_0xa5cf('0x6a')]([_0xa5cf('0x6b'),_0xa5cf('0x6c'),_0xa5cf('0x7a'),_0xa5cf('0x5b'),_0xa5cf('0x4d'),_0xa5cf('0x4e')],squel[_0xa5cf('0x6d')]()[_0xa5cf('0x6e')](_0xa5cf('0x6b'),_0xa5cf('0x6b'))[_0xa5cf('0x6e')]('id',_0xa5cf('0x6c'))[_0xa5cf('0x6e')](_0x4f8473['CmListId'][_0xa5cf('0x71')](),_0xa5cf('0x7a'))[_0xa5cf('0x6e')](_0x478ab8[_0xa5cf('0x41')]['id']['toString'](),_0xa5cf('0x5b'))['field'](_0xa5cf('0x6f'),'createdAt')['field']('NOW()',_0xa5cf('0x4e'))[_0xa5cf('0x72')](_0xa5cf('0x7c'))[_0xa5cf('0x35')](_0xa5cf('0x73'))[_0xa5cf('0x35')](_0xa5cf('0x74'),_0x4f8473['CmListId'][_0xa5cf('0x71')]())[_0xa5cf('0x35')](_0xa5cf('0x75')))[_0xa5cf('0x71')]();_0x1b87d6['push'](db[_0xa5cf('0x88')][_0xa5cf('0x2c')](_0x132ee3));}return BPromise[_0xa5cf('0x89')](_0x1b87d6);}})[_0xa5cf('0x1f')](function(){return _0x10c6f0;})['then'](respondWithResult(_0xa7f1b9,null))[_0xa5cf('0x3f')](handleError(_0xa7f1b9,null));};exports[_0xa5cf('0x8f')]=function(_0x1ec7a1,_0xf42767,_0x8f418){return db[_0xa5cf('0x26')][_0xa5cf('0x43')]({'where':{'id':_0x1ec7a1[_0xa5cf('0x41')]['id']}})[_0xa5cf('0x1f')](handleEntityNotFound(_0xf42767,null))[_0xa5cf('0x1f')](function(_0x32b905){if(_0x32b905){return _0x32b905['removeBlackLists'](_0x1ec7a1[_0xa5cf('0x2c')][_0xa5cf('0x63')]);}})[_0xa5cf('0x1f')](function(_0x430280){if(_0x430280){return db[_0xa5cf('0x5e')][_0xa5cf('0x20')]({'where':{'ListId':_0x1ec7a1[_0xa5cf('0x2c')][_0xa5cf('0x63')],'CampaignId':_0x1ec7a1[_0xa5cf('0x41')]['id']}})[_0xa5cf('0x1f')](function(){return _0x430280;});}})['then'](respondWithStatusCode(_0xf42767,null))[_0xa5cf('0x3f')](handleError(_0xf42767,null));};
\ No newline at end of file
diff --git a/server/api/campaign/campaign.model.js b/server/api/campaign/campaign.model.js
index 422f1bb..6f34574 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(_0x402671,_0x5bb553){var _0x326991=function(_0xa2f254){while(--_0xa2f254){_0x402671['push'](_0x402671['shift']());}};_0x326991(++_0x5bb553);}(_0x7a54,0x106));var _0x47a5=function(_0x52ae53,_0x4fb4f0){_0x52ae53=_0x52ae53-0x0;var _0x229f86=_0x7a54[_0x52ae53];return _0x229f86;};'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 _0x7a54=['../../config/logger','moment','bluebird','path','rimraf','../../config/environment','./campaign.attributes','exports','Campaign','campaigns','lodash','util'];(function(_0xf34895,_0x21fb70){var _0x143f44=function(_0x2e7730){while(--_0x2e7730){_0xf34895['push'](_0xf34895['shift']());}};_0x143f44(++_0x21fb70);}(_0x7a54,0x106));var _0x47a5=function(_0x371f27,_0x289070){_0x371f27=_0x371f27-0x0;var _0x2b97b2=_0x7a54[_0x371f27];return _0x2b97b2;};'use strict';var _=require(_0x47a5('0x0'));var util=require(_0x47a5('0x1'));var logger=require(_0x47a5('0x2'))('api');var moment=require(_0x47a5('0x3'));var BPromise=require(_0x47a5('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x47a5('0x5'));var rimraf=require(_0x47a5('0x6'));var config=require(_0x47a5('0x7'));var attributes=require(_0x47a5('0x8'));module[_0x47a5('0x9')]=function(_0x545a97,_0x3d5629){return _0x545a97['define'](_0x47a5('0xa'),attributes,{'tableName':_0x47a5('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
diff --git a/server/api/campaign/campaign.rpc.js b/server/api/campaign/campaign.rpc.js
index a8870d8..e4694ab 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 _0x9ef8=['util','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','client','http','request','then','info','Campaign,\x20%s,\x20%s','request\x20sent','Campaign,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','GetCampaign','Campaign','findAll','options','raw','where','attributes','limit','include','model','map','debug','lodash'];(function(_0x1035c1,_0x2d8583){var _0x308d67=function(_0x58ddb6){while(--_0x58ddb6){_0x1035c1['push'](_0x1035c1['shift']());}};_0x308d67(++_0x2d8583);}(_0x9ef8,0x17f));var _0x89ef=function(_0x2b91c5,_0x3b6db5){_0x2b91c5=_0x2b91c5-0x0;var _0xbd5531=_0x9ef8[_0x2b91c5];return _0xbd5531;};'use strict';var _=require(_0x89ef('0x0'));var util=require(_0x89ef('0x1'));var moment=require('moment');var BPromise=require(_0x89ef('0x2'));var rs=require(_0x89ef('0x3'));var fs=require('fs');var Redis=require(_0x89ef('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x89ef('0x5'));var logger=require(_0x89ef('0x6'))('rpc');var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x89ef('0x7')][_0x89ef('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x24439e,_0x90b5bf,_0x46c0da){return new BPromise(function(_0x373288,_0x16e8c3){return client[_0x89ef('0x9')](_0x24439e,_0x46c0da)[_0x89ef('0xa')](function(_0x5683b6){logger[_0x89ef('0xb')](_0x89ef('0xc'),_0x90b5bf,_0x89ef('0xd'));logger['debug'](_0x89ef('0xe'),_0x90b5bf,_0x89ef('0xd'),JSON[_0x89ef('0xf')](_0x5683b6));if(_0x5683b6[_0x89ef('0x10')]){if(_0x5683b6[_0x89ef('0x10')]['code']===0x1f4){logger[_0x89ef('0x10')]('Campaign,\x20%s,\x20%s',_0x90b5bf,_0x5683b6[_0x89ef('0x10')][_0x89ef('0x11')]);return _0x16e8c3(_0x5683b6['error'][_0x89ef('0x11')]);}logger[_0x89ef('0x10')](_0x89ef('0xc'),_0x90b5bf,_0x5683b6[_0x89ef('0x10')][_0x89ef('0x11')]);return _0x373288(_0x5683b6['error'][_0x89ef('0x11')]);}else{logger['info']('Campaign,\x20%s,\x20%s',_0x90b5bf,_0x89ef('0xd'));_0x373288(_0x5683b6[_0x89ef('0x12')]['message']);}})[_0x89ef('0x13')](function(_0x490877){logger[_0x89ef('0x10')]('Campaign,\x20%s,\x20%s',_0x90b5bf,_0x490877);_0x16e8c3(_0x490877);});});}exports[_0x89ef('0x14')]=function(_0x2c5f51){var _0x2aa140=this;return new Promise(function(_0x1189d7,_0x5e3aed){return db[_0x89ef('0x15')][_0x89ef('0x16')]({'raw':_0x2c5f51[_0x89ef('0x17')]?_0x2c5f51[_0x89ef('0x17')][_0x89ef('0x18')]===undefined?!![]:![]:!![],'where':_0x2c5f51[_0x89ef('0x17')]?_0x2c5f51[_0x89ef('0x17')][_0x89ef('0x19')]||null:null,'attributes':_0x2c5f51[_0x89ef('0x17')]?_0x2c5f51[_0x89ef('0x17')][_0x89ef('0x1a')]||null:null,'limit':_0x2c5f51[_0x89ef('0x17')]?_0x2c5f51[_0x89ef('0x17')][_0x89ef('0x1b')]||null:null,'include':_0x2c5f51[_0x89ef('0x17')]?_0x2c5f51[_0x89ef('0x17')][_0x89ef('0x1c')]?_['map'](_0x2c5f51['options']['include'],function(_0x5c9242){return{'model':db[_0x5c9242[_0x89ef('0x1d')]],'as':_0x5c9242['as'],'attributes':_0x5c9242[_0x89ef('0x1a')],'include':_0x5c9242['include']?_['map'](_0x5c9242[_0x89ef('0x1c')],function(_0x10bb22){return{'model':db[_0x10bb22['model']],'as':_0x10bb22['as'],'attributes':_0x10bb22['attributes'],'include':_0x10bb22[_0x89ef('0x1c')]?_[_0x89ef('0x1e')](_0x10bb22[_0x89ef('0x1c')],function(_0x3efb34){return{'model':db[_0x3efb34[_0x89ef('0x1d')]],'as':_0x3efb34['as'],'attributes':_0x3efb34[_0x89ef('0x1a')]};}):[]};}):[]};}):[]:[]})[_0x89ef('0xa')](function(_0x5e8108){logger[_0x89ef('0xb')](_0x89ef('0x14'),_0x2c5f51);logger[_0x89ef('0x1f')](_0x89ef('0x14'),_0x2c5f51,JSON['stringify'](_0x5e8108));_0x1189d7(_0x5e8108);})['catch'](function(_0x51245a){logger[_0x89ef('0x10')](_0x89ef('0x14'),_0x51245a['message'],_0x2c5f51);_0x5e3aed(_0x2aa140[_0x89ef('0x10')](0x1f4,_0x51245a[_0x89ef('0x11')]));});});};
\ No newline at end of file
+var _0x4c6d=['info','Campaign,\x20%s,\x20%s','debug','Campaign,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','message','result','catch','GetCampaign','Campaign','findAll','options','raw','where','limit','include','map','model','attributes','then','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','http','request'];(function(_0x578f2a,_0x2dfe78){var _0xb77346=function(_0x5ebd29){while(--_0x5ebd29){_0x578f2a['push'](_0x578f2a['shift']());}};_0xb77346(++_0x2dfe78);}(_0x4c6d,0x1d0));var _0xd4c6=function(_0x47bba1,_0x250bac){_0x47bba1=_0x47bba1-0x0;var _0x587c23=_0x4c6d[_0x47bba1];return _0x587c23;};'use strict';var _=require(_0xd4c6('0x0'));var util=require(_0xd4c6('0x1'));var moment=require(_0xd4c6('0x2'));var BPromise=require(_0xd4c6('0x3'));var rs=require(_0xd4c6('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xd4c6('0x5'))['db'];var utils=require(_0xd4c6('0x6'));var logger=require(_0xd4c6('0x7'))('rpc');var config=require(_0xd4c6('0x8'));var jayson=require(_0xd4c6('0x9'));var client=jayson['client'][_0xd4c6('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x316314,_0x4329e3,_0x5d4fce){return new BPromise(function(_0x440ee3,_0x19ce1c){return client[_0xd4c6('0xb')](_0x316314,_0x5d4fce)['then'](function(_0xe2f90b){logger[_0xd4c6('0xc')](_0xd4c6('0xd'),_0x4329e3,'request\x20sent');logger[_0xd4c6('0xe')](_0xd4c6('0xf'),_0x4329e3,_0xd4c6('0x10'),JSON[_0xd4c6('0x11')](_0xe2f90b));if(_0xe2f90b[_0xd4c6('0x12')]){if(_0xe2f90b[_0xd4c6('0x12')]['code']===0x1f4){logger['error'](_0xd4c6('0xd'),_0x4329e3,_0xe2f90b['error'][_0xd4c6('0x13')]);return _0x19ce1c(_0xe2f90b[_0xd4c6('0x12')][_0xd4c6('0x13')]);}logger[_0xd4c6('0x12')](_0xd4c6('0xd'),_0x4329e3,_0xe2f90b[_0xd4c6('0x12')][_0xd4c6('0x13')]);return _0x440ee3(_0xe2f90b['error']['message']);}else{logger[_0xd4c6('0xc')](_0xd4c6('0xd'),_0x4329e3,_0xd4c6('0x10'));_0x440ee3(_0xe2f90b[_0xd4c6('0x14')][_0xd4c6('0x13')]);}})[_0xd4c6('0x15')](function(_0xe52075){logger['error'](_0xd4c6('0xd'),_0x4329e3,_0xe52075);_0x19ce1c(_0xe52075);});});}exports[_0xd4c6('0x16')]=function(_0x23a16f){var _0x2c97b=this;return new Promise(function(_0x31f328,_0x54e0a5){return db[_0xd4c6('0x17')][_0xd4c6('0x18')]({'raw':_0x23a16f[_0xd4c6('0x19')]?_0x23a16f['options'][_0xd4c6('0x1a')]===undefined?!![]:![]:!![],'where':_0x23a16f[_0xd4c6('0x19')]?_0x23a16f[_0xd4c6('0x19')][_0xd4c6('0x1b')]||null:null,'attributes':_0x23a16f['options']?_0x23a16f[_0xd4c6('0x19')]['attributes']||null:null,'limit':_0x23a16f[_0xd4c6('0x19')]?_0x23a16f[_0xd4c6('0x19')][_0xd4c6('0x1c')]||null:null,'include':_0x23a16f[_0xd4c6('0x19')]?_0x23a16f[_0xd4c6('0x19')][_0xd4c6('0x1d')]?_[_0xd4c6('0x1e')](_0x23a16f[_0xd4c6('0x19')][_0xd4c6('0x1d')],function(_0x466330){return{'model':db[_0x466330[_0xd4c6('0x1f')]],'as':_0x466330['as'],'attributes':_0x466330[_0xd4c6('0x20')],'include':_0x466330['include']?_['map'](_0x466330[_0xd4c6('0x1d')],function(_0x2febbf){return{'model':db[_0x2febbf['model']],'as':_0x2febbf['as'],'attributes':_0x2febbf[_0xd4c6('0x20')],'include':_0x2febbf[_0xd4c6('0x1d')]?_[_0xd4c6('0x1e')](_0x2febbf['include'],function(_0x35b50c){return{'model':db[_0x35b50c[_0xd4c6('0x1f')]],'as':_0x35b50c['as'],'attributes':_0x35b50c['attributes']};}):[]};}):[]};}):[]:[]})[_0xd4c6('0x21')](function(_0x8ce066){logger[_0xd4c6('0xc')]('GetCampaign',_0x23a16f);logger[_0xd4c6('0xe')](_0xd4c6('0x16'),_0x23a16f,JSON[_0xd4c6('0x11')](_0x8ce066));_0x31f328(_0x8ce066);})[_0xd4c6('0x15')](function(_0x2e8c34){logger[_0xd4c6('0x12')](_0xd4c6('0x16'),_0x2e8c34[_0xd4c6('0x13')],_0x23a16f);_0x54e0a5(_0x2c97b[_0xd4c6('0x12')](0x1f4,_0x2e8c34[_0xd4c6('0x13')]));});});};
\ No newline at end of file
diff --git a/server/api/campaign/index.js b/server/api/campaign/index.js
index ca23f10..8c1383c 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 _0x4092=['Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/:id','show','/:id/hoppers','getHoppers','getHopperHistories','/:id/hopper_black','/:id/lists','/:id/blacklists','create','post','/:id/clone','clone','addBlackLists','put','delete','removeBlackLists','exports','util','path','connect-timeout','express'];(function(_0x53b611,_0x2912fa){var _0x5649aa=function(_0x18b222){while(--_0x18b222){_0x53b611['push'](_0x53b611['shift']());}};_0x5649aa(++_0x2912fa);}(_0x4092,0x1af));var _0x2409=function(_0xea4f3a,_0x46d2e6){_0xea4f3a=_0xea4f3a-0x0;var _0x88e3dd=_0x4092[_0xea4f3a];return _0x88e3dd;};'use strict';var multer=require('multer');var util=require(_0x2409('0x0'));var path=require(_0x2409('0x1'));var timeout=require(_0x2409('0x2'));var express=require(_0x2409('0x3'));var router=express[_0x2409('0x4')]();var fs_extra=require(_0x2409('0x5'));var auth=require(_0x2409('0x6'));var interaction=require(_0x2409('0x7'));var config=require(_0x2409('0x8'));var controller=require('./campaign.controller');router[_0x2409('0x9')]('/',auth[_0x2409('0xa')](),controller[_0x2409('0xb')]);router['get'](_0x2409('0xc'),auth[_0x2409('0xa')](),controller[_0x2409('0xd')]);router[_0x2409('0x9')](_0x2409('0xe'),auth[_0x2409('0xa')](),controller[_0x2409('0xf')]);router['get']('/:id/hopper_histories',auth[_0x2409('0xa')](),controller[_0x2409('0x10')]);router['get']('/:id/hopper_finals',auth[_0x2409('0xa')](),controller['getHopperFinals']);router[_0x2409('0x9')](_0x2409('0x11'),auth[_0x2409('0xa')](),controller['getHopperBlacks']);router['get'](_0x2409('0x12'),auth[_0x2409('0xa')](),controller['getLists']);router['get'](_0x2409('0x13'),auth[_0x2409('0xa')](),controller['getBlackLists']);router['post']('/',auth['isAuthenticated'](),controller[_0x2409('0x14')]);router[_0x2409('0x15')](_0x2409('0x16'),auth[_0x2409('0xa')](),controller[_0x2409('0x17')]);router[_0x2409('0x15')]('/:id/lists',auth['isAuthenticated'](),controller['addLists']);router[_0x2409('0x15')](_0x2409('0x13'),auth[_0x2409('0xa')](),controller[_0x2409('0x18')]);router[_0x2409('0x19')](_0x2409('0xc'),auth['isAuthenticated'](),controller['update']);router[_0x2409('0x1a')](_0x2409('0xc'),auth['isAuthenticated'](),controller['destroy']);router[_0x2409('0x1a')](_0x2409('0x12'),auth['isAuthenticated'](),controller['removeLists']);router[_0x2409('0x1a')](_0x2409('0x13'),auth[_0x2409('0xa')](),controller[_0x2409('0x1b')]);module[_0x2409('0x1c')]=router;
\ No newline at end of file
+var _0x82c0=['../../config/environment','./campaign.controller','isAuthenticated','/:id','show','/:id/hoppers','getHoppers','get','/:id/hopper_histories','getHopperHistories','/:id/hopper_finals','getHopperFinals','/:id/hopper_black','/:id/lists','/:id/blacklists','getBlackLists','post','create','/:id/clone','clone','addLists','addBlackLists','put','update','delete','destroy','removeLists','exports','multer','util','connect-timeout','express','Router','fs-extra'];(function(_0xbf8b4d,_0xdf0650){var _0x1f6800=function(_0x553442){while(--_0x553442){_0xbf8b4d['push'](_0xbf8b4d['shift']());}};_0x1f6800(++_0xdf0650);}(_0x82c0,0xe8));var _0x082c=function(_0x4793d6,_0x71e3c){_0x4793d6=_0x4793d6-0x0;var _0x222dea=_0x82c0[_0x4793d6];return _0x222dea;};'use strict';var multer=require(_0x082c('0x0'));var util=require(_0x082c('0x1'));var path=require('path');var timeout=require(_0x082c('0x2'));var express=require(_0x082c('0x3'));var router=express[_0x082c('0x4')]();var fs_extra=require(_0x082c('0x5'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x082c('0x6'));var controller=require(_0x082c('0x7'));router['get']('/',auth[_0x082c('0x8')](),controller['index']);router['get'](_0x082c('0x9'),auth[_0x082c('0x8')](),controller[_0x082c('0xa')]);router['get'](_0x082c('0xb'),auth[_0x082c('0x8')](),controller[_0x082c('0xc')]);router[_0x082c('0xd')](_0x082c('0xe'),auth['isAuthenticated'](),controller[_0x082c('0xf')]);router[_0x082c('0xd')](_0x082c('0x10'),auth['isAuthenticated'](),controller[_0x082c('0x11')]);router['get'](_0x082c('0x12'),auth[_0x082c('0x8')](),controller['getHopperBlacks']);router['get'](_0x082c('0x13'),auth[_0x082c('0x8')](),controller['getLists']);router[_0x082c('0xd')](_0x082c('0x14'),auth[_0x082c('0x8')](),controller[_0x082c('0x15')]);router[_0x082c('0x16')]('/',auth['isAuthenticated'](),controller[_0x082c('0x17')]);router[_0x082c('0x16')](_0x082c('0x18'),auth['isAuthenticated'](),controller[_0x082c('0x19')]);router[_0x082c('0x16')](_0x082c('0x13'),auth[_0x082c('0x8')](),controller[_0x082c('0x1a')]);router[_0x082c('0x16')](_0x082c('0x14'),auth[_0x082c('0x8')](),controller[_0x082c('0x1b')]);router[_0x082c('0x1c')]('/:id',auth[_0x082c('0x8')](),controller[_0x082c('0x1d')]);router[_0x082c('0x1e')](_0x082c('0x9'),auth[_0x082c('0x8')](),controller[_0x082c('0x1f')]);router[_0x082c('0x1e')]('/:id/lists',auth[_0x082c('0x8')](),controller[_0x082c('0x20')]);router[_0x082c('0x1e')](_0x082c('0x14'),auth[_0x082c('0x8')](),controller['removeBlackLists']);module[_0x082c('0x21')]=router;
\ No newline at end of file
diff --git a/server/api/cannedAnswer/cannedAnswer.attributes.js b/server/api/cannedAnswer/cannedAnswer.attributes.js
index 0a21017..0f40605 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 _0x51a8=['exports','STRING','getDataValue','sequelize'];(function(_0x40a045,_0x516f0e){var _0x1a687c=function(_0x48c9fe){while(--_0x48c9fe){_0x40a045['push'](_0x40a045['shift']());}};_0x1a687c(++_0x516f0e);}(_0x51a8,0x1db));var _0x851a=function(_0x424c67,_0x2fd19b){_0x424c67=_0x424c67-0x0;var _0x509b9a=_0x51a8[_0x424c67];return _0x509b9a;};'use strict';var Sequelize=require(_0x851a('0x0'));module[_0x851a('0x1')]={'key':{'type':Sequelize[_0x851a('0x2')],'allowNull':![]},'value':{'type':Sequelize['TEXT'],'allowNull':![]},'description':{'type':Sequelize['STRING']},'name':{'type':Sequelize['VIRTUAL'],'get':function(){return this[_0x851a('0x3')]('key');}}};
\ No newline at end of file
+var _0xff2c=['exports','STRING','TEXT','VIRTUAL'];(function(_0x145954,_0x2fc62e){var _0x325e48=function(_0x1d4a50){while(--_0x1d4a50){_0x145954['push'](_0x145954['shift']());}};_0x325e48(++_0x2fc62e);}(_0xff2c,0x68));var _0xcff2=function(_0x3d34da,_0x3abcc1){_0x3d34da=_0x3d34da-0x0;var _0xcf6af8=_0xff2c[_0x3d34da];return _0xcf6af8;};'use strict';var Sequelize=require('sequelize');module[_0xcff2('0x0')]={'key':{'type':Sequelize[_0xcff2('0x1')],'allowNull':![]},'value':{'type':Sequelize[_0xcff2('0x2')],'allowNull':![]},'description':{'type':Sequelize['STRING']},'name':{'type':Sequelize[_0xcff2('0x3')],'get':function(){return this['getDataValue']('key');}}};
\ No newline at end of file
diff --git a/server/api/cannedAnswer/cannedAnswer.controller.js b/server/api/cannedAnswer/cannedAnswer.controller.js
index 7546936..3360f69 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 _0xdc77=['sendStatus','status','json','limit','undefined','offset','count','set','Content-Range','apply','reject','save','then','destroy','get','CannedAnswers','UserProfileResource','end','error','stack','send','index','CannedAnswer','rawAttributes','type','key','model','map','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','sort','where','filter','merge','include','findAll','catch','show','params','includeAll','options','find','update','body','create','MailAccountId','SmsAccountId','OpenchannelAccountId','ChatWebsiteId','Sequelize','ValidationError','The\x20inserted\x20key\x20already\x20exists.','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','name','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','rimraf','zip-dir','fast-json-patch','moment','util','path','sox','ejs','squel','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb'];(function(_0x2dafbe,_0x5d04de){var _0x58a45a=function(_0x50ac96){while(--_0x50ac96){_0x2dafbe['push'](_0x2dafbe['shift']());}};_0x58a45a(++_0x5d04de);}(_0xdc77,0xed));var _0x7dc7=function(_0x278495,_0x264281){_0x278495=_0x278495-0x0;var _0x229a4a=_0xdc77[_0x278495];return _0x229a4a;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x7dc7('0x0'));var zipdir=require(_0x7dc7('0x1'));var jsonpatch=require(_0x7dc7('0x2'));var rp=require('request-promise');var moment=require(_0x7dc7('0x3'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x7dc7('0x4'));var path=require(_0x7dc7('0x5'));var sox=require(_0x7dc7('0x6'));var csv=require('to-csv');var ejs=require(_0x7dc7('0x7'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0x7dc7('0x8'));var crypto=require('crypto');var jsforce=require(_0x7dc7('0x9'));var deskjs=require(_0x7dc7('0xa'));var toCsv=require('to-csv');var querystring=require(_0x7dc7('0xb'));var Papa=require('papaparse');var Redis=require(_0x7dc7('0xc'));var authService=require(_0x7dc7('0xd'));var qs=require(_0x7dc7('0xe'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x7dc7('0xf'));var logger=require(_0x7dc7('0x10'))(_0x7dc7('0x11'));var utils=require('../../config/utils');var config=require(_0x7dc7('0x12'));var licenseUtil=require(_0x7dc7('0x13'));var db=require(_0x7dc7('0x14'))['db'];function respondWithStatusCode(_0x2d758d,_0x404fb){_0x404fb=_0x404fb||0xcc;return function(_0x984aa5){if(_0x984aa5){return _0x2d758d[_0x7dc7('0x15')](_0x404fb);}return _0x2d758d['status'](_0x404fb)['end']();};}function respondWithResult(_0x235261,_0x305b82){_0x305b82=_0x305b82||0xc8;return function(_0xa5688e){if(_0xa5688e){return _0x235261[_0x7dc7('0x16')](_0x305b82)[_0x7dc7('0x17')](_0xa5688e);}};}function respondWithFilteredResult(_0x1b0831,_0x2fe5d2){return function(_0x59c3b4){if(_0x59c3b4){var _0x261cfa=typeof _0x2fe5d2['offset']==='undefined'&&typeof _0x2fe5d2[_0x7dc7('0x18')]===_0x7dc7('0x19');var _0x16c4dc=_0x59c3b4['count'];var _0x473a03=_0x261cfa?0x0:_0x2fe5d2[_0x7dc7('0x1a')];var _0x2972e6=_0x261cfa?_0x59c3b4[_0x7dc7('0x1b')]:_0x2fe5d2[_0x7dc7('0x1a')]+_0x2fe5d2[_0x7dc7('0x18')];var _0x14e49a;if(_0x2972e6>=_0x16c4dc){_0x2972e6=_0x16c4dc;_0x14e49a=0xc8;}else{_0x14e49a=0xce;}_0x1b0831[_0x7dc7('0x16')](_0x14e49a);return _0x1b0831[_0x7dc7('0x1c')](_0x7dc7('0x1d'),_0x473a03+'-'+_0x2972e6+'/'+_0x16c4dc)[_0x7dc7('0x17')](_0x59c3b4);}return null;};}function patchUpdates(_0xdecb31){return function(_0x4881f4){try{jsonpatch[_0x7dc7('0x1e')](_0x4881f4,_0xdecb31,!![]);}catch(_0x5705cb){return BPromise[_0x7dc7('0x1f')](_0x5705cb);}return _0x4881f4[_0x7dc7('0x20')]();};}function saveUpdates(_0x26f99d,_0x53f2f5){return function(_0x4616bf){if(_0x4616bf){return _0x4616bf['update'](_0x26f99d)[_0x7dc7('0x21')](function(_0x1c0627){return _0x1c0627;});}return null;};}function removeEntity(_0x20333d,_0x19628b){return function(_0xbbdcc3){if(_0xbbdcc3){return _0xbbdcc3[_0x7dc7('0x22')]()[_0x7dc7('0x21')](function(){var _0xfff274=_0xbbdcc3[_0x7dc7('0x23')]({'plain':!![]});var _0x123a36=_0x7dc7('0x24');return db[_0x7dc7('0x25')][_0x7dc7('0x22')]({'where':{'type':_0x123a36,'resourceId':_0xfff274['id']}})[_0x7dc7('0x21')](function(){return _0xbbdcc3;});})[_0x7dc7('0x21')](function(){_0x20333d[_0x7dc7('0x16')](0xcc)[_0x7dc7('0x26')]();});}};}function handleEntityNotFound(_0xd3c24b,_0x3b511d){return function(_0x423a23){if(!_0x423a23){_0xd3c24b[_0x7dc7('0x15')](0x194);}return _0x423a23;};}function handleError(_0x2c5983,_0x38b7c2){_0x38b7c2=_0x38b7c2||0x1f4;return function(_0x3144f1){logger[_0x7dc7('0x27')](_0x3144f1[_0x7dc7('0x28')]);if(_0x3144f1['name']){delete _0x3144f1['name'];}_0x2c5983['status'](_0x38b7c2)[_0x7dc7('0x29')](_0x3144f1);};}exports[_0x7dc7('0x2a')]=function(_0x3ba0e0,_0xfbd198){var _0x2974c4={},_0x715c31={},_0x54de13={'count':0x0,'rows':[]};var _0x344aa5=_['map'](db[_0x7dc7('0x2b')][_0x7dc7('0x2c')],function(_0x1e5431){return{'name':_0x1e5431['fieldName'],'type':_0x1e5431[_0x7dc7('0x2d')][_0x7dc7('0x2e')]};});_0x715c31[_0x7dc7('0x2f')]=_[_0x7dc7('0x30')](_0x344aa5,'name');_0x715c31[_0x7dc7('0x31')]=_[_0x7dc7('0x32')](_0x3ba0e0[_0x7dc7('0x31')]);_0x715c31[_0x7dc7('0x33')]=_[_0x7dc7('0x34')](_0x715c31[_0x7dc7('0x2f')],_0x715c31[_0x7dc7('0x31')]);_0x2974c4['attributes']=_[_0x7dc7('0x34')](_0x715c31[_0x7dc7('0x2f')],qs[_0x7dc7('0x35')](_0x3ba0e0[_0x7dc7('0x31')]['fields']));_0x2974c4[_0x7dc7('0x36')]=_0x2974c4['attributes'][_0x7dc7('0x37')]?_0x2974c4[_0x7dc7('0x36')]:_0x715c31['model'];if(!_0x3ba0e0['query'][_0x7dc7('0x38')]('nolimit')){_0x2974c4[_0x7dc7('0x18')]=qs[_0x7dc7('0x18')](_0x3ba0e0['query']['limit']);_0x2974c4[_0x7dc7('0x1a')]=qs[_0x7dc7('0x1a')](_0x3ba0e0[_0x7dc7('0x31')][_0x7dc7('0x1a')]);}_0x2974c4['order']=qs[_0x7dc7('0x39')](_0x3ba0e0['query'][_0x7dc7('0x39')]);_0x2974c4[_0x7dc7('0x3a')]=qs[_0x7dc7('0x33')](_['pick'](_0x3ba0e0[_0x7dc7('0x31')],_0x715c31['filters']),_0x344aa5);if(_0x3ba0e0[_0x7dc7('0x31')][_0x7dc7('0x3b')]){_0x2974c4['where']=_[_0x7dc7('0x3c')](_0x2974c4[_0x7dc7('0x3a')],{'$or':[{'key':{'$like':'%'+_0x3ba0e0[_0x7dc7('0x31')][_0x7dc7('0x3b')]+'%'}},{'value':{'$like':'%'+_0x3ba0e0[_0x7dc7('0x31')][_0x7dc7('0x3b')]+'%'}}]});}_0x2974c4=_[_0x7dc7('0x3c')]({},_0x2974c4,_0x3ba0e0['options']);var _0x5898bc={'where':_0x2974c4[_0x7dc7('0x3a')]};return db[_0x7dc7('0x2b')][_0x7dc7('0x1b')](_0x5898bc)['then'](function(_0x4f8687){_0x54de13['count']=_0x4f8687;if(_0x3ba0e0['query']['includeAll']){_0x2974c4[_0x7dc7('0x3d')]=[{'all':!![]}];}return db[_0x7dc7('0x2b')][_0x7dc7('0x3e')](_0x2974c4);})['then'](function(_0x1bc21c){_0x54de13['rows']=_0x1bc21c;return _0x54de13;})[_0x7dc7('0x21')](respondWithFilteredResult(_0xfbd198,_0x2974c4))[_0x7dc7('0x3f')](handleError(_0xfbd198,null));};exports[_0x7dc7('0x40')]=function(_0x252506,_0x53558b){var _0x42b503={'raw':!![],'where':{'id':_0x252506[_0x7dc7('0x41')]['id']}},_0x3dbc6b={};_0x3dbc6b[_0x7dc7('0x2f')]=_[_0x7dc7('0x32')](db['CannedAnswer']['rawAttributes']);_0x3dbc6b[_0x7dc7('0x31')]=_['keys'](_0x252506[_0x7dc7('0x31')]);_0x3dbc6b[_0x7dc7('0x33')]=_[_0x7dc7('0x34')](_0x3dbc6b['model'],_0x3dbc6b['query']);_0x42b503[_0x7dc7('0x36')]=_[_0x7dc7('0x34')](_0x3dbc6b[_0x7dc7('0x2f')],qs[_0x7dc7('0x35')](_0x252506[_0x7dc7('0x31')][_0x7dc7('0x35')]));_0x42b503[_0x7dc7('0x36')]=_0x42b503[_0x7dc7('0x36')]['length']?_0x42b503[_0x7dc7('0x36')]:_0x3dbc6b['model'];if(_0x252506['query'][_0x7dc7('0x42')]){_0x42b503[_0x7dc7('0x3d')]=[{'all':!![]}];}_0x42b503=_[_0x7dc7('0x3c')]({},_0x42b503,_0x252506[_0x7dc7('0x43')]);return db[_0x7dc7('0x2b')][_0x7dc7('0x44')](_0x42b503)[_0x7dc7('0x21')](handleEntityNotFound(_0x53558b,null))[_0x7dc7('0x21')](respondWithResult(_0x53558b,null))[_0x7dc7('0x3f')](handleError(_0x53558b,null));};exports[_0x7dc7('0x45')]=function(_0x63d4b9,_0x41721c){if(_0x63d4b9[_0x7dc7('0x46')]['id']){delete _0x63d4b9[_0x7dc7('0x46')]['id'];}return db[_0x7dc7('0x2b')][_0x7dc7('0x44')]({'where':{'id':_0x63d4b9['params']['id']}})[_0x7dc7('0x21')](handleEntityNotFound(_0x41721c,null))[_0x7dc7('0x21')](saveUpdates(_0x63d4b9[_0x7dc7('0x46')],null))[_0x7dc7('0x21')](respondWithResult(_0x41721c,null))['catch'](handleError(_0x41721c,null));};exports[_0x7dc7('0x22')]=function(_0x3c00fc,_0x2d2a06){return db[_0x7dc7('0x2b')]['find']({'where':{'id':_0x3c00fc[_0x7dc7('0x41')]['id']}})[_0x7dc7('0x21')](handleEntityNotFound(_0x2d2a06,null))[_0x7dc7('0x21')](removeEntity(_0x2d2a06,null))[_0x7dc7('0x3f')](handleError(_0x2d2a06,null));};exports[_0x7dc7('0x47')]=function(_0x17167b,_0x36ed69){var _0x24677e={'key':_0x17167b[_0x7dc7('0x46')][_0x7dc7('0x2e')]};if(_0x17167b[_0x7dc7('0x46')][_0x7dc7('0x48')]){_0x24677e[_0x7dc7('0x48')]=_0x17167b[_0x7dc7('0x46')]['MailAccountId'];}else if(_0x17167b[_0x7dc7('0x46')]['SmsAccountId']){_0x24677e[_0x7dc7('0x49')]=_0x17167b[_0x7dc7('0x46')][_0x7dc7('0x49')];}else if(_0x17167b[_0x7dc7('0x46')][_0x7dc7('0x4a')]){_0x24677e[_0x7dc7('0x4a')]=_0x17167b[_0x7dc7('0x46')][_0x7dc7('0x4a')];}else if(_0x17167b['body'][_0x7dc7('0x4b')]){_0x24677e['ChatWebsiteId']=_0x17167b['body'][_0x7dc7('0x4b')];}return db['CannedAnswer'][_0x7dc7('0x44')]({'where':_0x24677e})[_0x7dc7('0x21')](function(_0x5b9937){if(_0x5b9937){throw new db[(_0x7dc7('0x4c'))][(_0x7dc7('0x4d'))](_0x7dc7('0x4e'));}return db[_0x7dc7('0x2b')][_0x7dc7('0x47')](_0x17167b[_0x7dc7('0x46')]);})['then'](function(_0x36d043){var _0x4ef93a=_0x17167b[_0x7dc7('0x4f')][_0x7dc7('0x23')]({'plain':!![]});if(!_0x4ef93a)throw new Error(_0x7dc7('0x50'));if(_0x4ef93a[_0x7dc7('0x51')]===_0x7dc7('0x4f')){var _0x3811b0=_0x36d043[_0x7dc7('0x23')]({'plain':!![]});return db[_0x7dc7('0x52')][_0x7dc7('0x44')]({'where':{'name':_0x7dc7('0x24'),'userProfileId':_0x4ef93a[_0x7dc7('0x53')]},'raw':!![]})['then'](function(_0x3b7f63){if(_0x3b7f63&&_0x3b7f63['autoAssociation']===0x0){return db[_0x7dc7('0x25')][_0x7dc7('0x47')]({'name':_0x3811b0[_0x7dc7('0x54')],'resourceId':_0x3811b0['id'],'type':_0x3b7f63[_0x7dc7('0x54')],'sectionId':_0x3b7f63['id']},{})[_0x7dc7('0x21')](function(){return _0x36d043;});}else{return _0x36d043;}})[_0x7dc7('0x3f')](function(_0x49738b){logger[_0x7dc7('0x27')](_0x7dc7('0x55'),_0x49738b);throw _0x49738b;});}return _0x36d043;})[_0x7dc7('0x21')](respondWithResult(_0x36ed69,0xc9))[_0x7dc7('0x3f')](handleError(_0x36ed69,null));};
\ No newline at end of file
+var _0xb2a2=['key','MailAccountId','SmsAccountId','OpenchannelAccountId','ChatWebsiteId','Sequelize','ValidationError','The\x20inserted\x20key\x20already\x20exists.','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','error','eml-format','rimraf','zip-dir','moment','mustache','sox','to-csv','ejs','lodash','squel','crypto','jsforce','../../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','limit','undefined','count','set','apply','reject','update','get','CannedAnswers','UserProfileResource','destroy','then','end','name','send','index','map','rawAttributes','fieldName','type','model','query','keys','intersection','fields','attributes','length','hasOwnProperty','sort','where','filters','pick','filter','merge','options','CannedAnswer','includeAll','findAll','rows','show','params','include','find','catch','body','create'];(function(_0x3bb7eb,_0x184c53){var _0x247ba2=function(_0x2cea5c){while(--_0x2cea5c){_0x3bb7eb['push'](_0x3bb7eb['shift']());}};_0x247ba2(++_0x184c53);}(_0xb2a2,0x64));var _0x2b2a=function(_0x45cc86,_0x3427d5){_0x45cc86=_0x45cc86-0x0;var _0x30c203=_0xb2a2[_0x45cc86];return _0x30c203;};'use strict';var emlformat=require(_0x2b2a('0x0'));var rimraf=require(_0x2b2a('0x1'));var zipdir=require(_0x2b2a('0x2'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x2b2a('0x3'));var BPromise=require('bluebird');var Mustache=require(_0x2b2a('0x4'));var util=require('util');var path=require('path');var sox=require(_0x2b2a('0x5'));var csv=require(_0x2b2a('0x6'));var ejs=require(_0x2b2a('0x7'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x2b2a('0x8'));var squel=require(_0x2b2a('0x9'));var crypto=require(_0x2b2a('0xa'));var jsforce=require(_0x2b2a('0xb'));var deskjs=require('desk.js');var toCsv=require(_0x2b2a('0x6'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x2b2a('0xc'));var qs=require(_0x2b2a('0xd'));var as=require(_0x2b2a('0xe'));var hardwareService=require(_0x2b2a('0xf'));var logger=require(_0x2b2a('0x10'))(_0x2b2a('0x11'));var utils=require(_0x2b2a('0x12'));var config=require(_0x2b2a('0x13'));var licenseUtil=require(_0x2b2a('0x14'));var db=require(_0x2b2a('0x15'))['db'];function respondWithStatusCode(_0x1bacec,_0x522c33){_0x522c33=_0x522c33||0xcc;return function(_0x4b90c4){if(_0x4b90c4){return _0x1bacec[_0x2b2a('0x16')](_0x522c33);}return _0x1bacec[_0x2b2a('0x17')](_0x522c33)['end']();};}function respondWithResult(_0x1ec4c1,_0x76ede9){_0x76ede9=_0x76ede9||0xc8;return function(_0x3a5068){if(_0x3a5068){return _0x1ec4c1[_0x2b2a('0x17')](_0x76ede9)[_0x2b2a('0x18')](_0x3a5068);}};}function respondWithFilteredResult(_0x777579,_0x413e67){return function(_0x586cf4){if(_0x586cf4){var _0x332cf3=typeof _0x413e67[_0x2b2a('0x19')]==='undefined'&&typeof _0x413e67[_0x2b2a('0x1a')]===_0x2b2a('0x1b');var _0x3855ac=_0x586cf4[_0x2b2a('0x1c')];var _0x3fefea=_0x332cf3?0x0:_0x413e67['offset'];var _0x34c489=_0x332cf3?_0x586cf4['count']:_0x413e67[_0x2b2a('0x19')]+_0x413e67[_0x2b2a('0x1a')];var _0x58951c;if(_0x34c489>=_0x3855ac){_0x34c489=_0x3855ac;_0x58951c=0xc8;}else{_0x58951c=0xce;}_0x777579['status'](_0x58951c);return _0x777579[_0x2b2a('0x1d')]('Content-Range',_0x3fefea+'-'+_0x34c489+'/'+_0x3855ac)['json'](_0x586cf4);}return null;};}function patchUpdates(_0x157afa){return function(_0x176dd6){try{jsonpatch[_0x2b2a('0x1e')](_0x176dd6,_0x157afa,!![]);}catch(_0x1db4fc){return BPromise[_0x2b2a('0x1f')](_0x1db4fc);}return _0x176dd6['save']();};}function saveUpdates(_0x9eaa98,_0x23520f){return function(_0x13134f){if(_0x13134f){return _0x13134f[_0x2b2a('0x20')](_0x9eaa98)['then'](function(_0x106a7f){return _0x106a7f;});}return null;};}function removeEntity(_0x10618e,_0x2528f3){return function(_0xb8481c){if(_0xb8481c){return _0xb8481c['destroy']()['then'](function(){var _0x4dfcc2=_0xb8481c[_0x2b2a('0x21')]({'plain':!![]});var _0x5211cb=_0x2b2a('0x22');return db[_0x2b2a('0x23')][_0x2b2a('0x24')]({'where':{'type':_0x5211cb,'resourceId':_0x4dfcc2['id']}})['then'](function(){return _0xb8481c;});})[_0x2b2a('0x25')](function(){_0x10618e[_0x2b2a('0x17')](0xcc)[_0x2b2a('0x26')]();});}};}function handleEntityNotFound(_0x891a0b,_0x15fd6c){return function(_0x592150){if(!_0x592150){_0x891a0b['sendStatus'](0x194);}return _0x592150;};}function handleError(_0x4cc1ce,_0x4cd5d3){_0x4cd5d3=_0x4cd5d3||0x1f4;return function(_0x1f132c){logger['error'](_0x1f132c['stack']);if(_0x1f132c['name']){delete _0x1f132c[_0x2b2a('0x27')];}_0x4cc1ce[_0x2b2a('0x17')](_0x4cd5d3)[_0x2b2a('0x28')](_0x1f132c);};}exports[_0x2b2a('0x29')]=function(_0x3f87d9,_0x132320){var _0x39289e={},_0x30151a={},_0x3b2a04={'count':0x0,'rows':[]};var _0x200c10=_[_0x2b2a('0x2a')](db['CannedAnswer'][_0x2b2a('0x2b')],function(_0x503955){return{'name':_0x503955[_0x2b2a('0x2c')],'type':_0x503955[_0x2b2a('0x2d')]['key']};});_0x30151a[_0x2b2a('0x2e')]=_[_0x2b2a('0x2a')](_0x200c10,'name');_0x30151a[_0x2b2a('0x2f')]=_[_0x2b2a('0x30')](_0x3f87d9['query']);_0x30151a['filters']=_[_0x2b2a('0x31')](_0x30151a[_0x2b2a('0x2e')],_0x30151a[_0x2b2a('0x2f')]);_0x39289e['attributes']=_[_0x2b2a('0x31')](_0x30151a['model'],qs[_0x2b2a('0x32')](_0x3f87d9[_0x2b2a('0x2f')][_0x2b2a('0x32')]));_0x39289e[_0x2b2a('0x33')]=_0x39289e['attributes'][_0x2b2a('0x34')]?_0x39289e['attributes']:_0x30151a['model'];if(!_0x3f87d9[_0x2b2a('0x2f')][_0x2b2a('0x35')]('nolimit')){_0x39289e['limit']=qs[_0x2b2a('0x1a')](_0x3f87d9[_0x2b2a('0x2f')][_0x2b2a('0x1a')]);_0x39289e[_0x2b2a('0x19')]=qs[_0x2b2a('0x19')](_0x3f87d9['query'][_0x2b2a('0x19')]);}_0x39289e['order']=qs[_0x2b2a('0x36')](_0x3f87d9['query'][_0x2b2a('0x36')]);_0x39289e[_0x2b2a('0x37')]=qs[_0x2b2a('0x38')](_[_0x2b2a('0x39')](_0x3f87d9['query'],_0x30151a[_0x2b2a('0x38')]),_0x200c10);if(_0x3f87d9['query'][_0x2b2a('0x3a')]){_0x39289e[_0x2b2a('0x37')]=_[_0x2b2a('0x3b')](_0x39289e['where'],{'$or':[{'key':{'$like':'%'+_0x3f87d9[_0x2b2a('0x2f')][_0x2b2a('0x3a')]+'%'}},{'value':{'$like':'%'+_0x3f87d9[_0x2b2a('0x2f')][_0x2b2a('0x3a')]+'%'}}]});}_0x39289e=_['merge']({},_0x39289e,_0x3f87d9[_0x2b2a('0x3c')]);var _0x4b3fd9={'where':_0x39289e[_0x2b2a('0x37')]};return db[_0x2b2a('0x3d')]['count'](_0x4b3fd9)['then'](function(_0x239a9b){_0x3b2a04[_0x2b2a('0x1c')]=_0x239a9b;if(_0x3f87d9['query'][_0x2b2a('0x3e')]){_0x39289e['include']=[{'all':!![]}];}return db['CannedAnswer'][_0x2b2a('0x3f')](_0x39289e);})[_0x2b2a('0x25')](function(_0x1dc997){_0x3b2a04[_0x2b2a('0x40')]=_0x1dc997;return _0x3b2a04;})[_0x2b2a('0x25')](respondWithFilteredResult(_0x132320,_0x39289e))['catch'](handleError(_0x132320,null));};exports[_0x2b2a('0x41')]=function(_0x229243,_0x279098){var _0x409bac={'raw':!![],'where':{'id':_0x229243[_0x2b2a('0x42')]['id']}},_0x1f5ee5={};_0x1f5ee5['model']=_[_0x2b2a('0x30')](db[_0x2b2a('0x3d')][_0x2b2a('0x2b')]);_0x1f5ee5[_0x2b2a('0x2f')]=_[_0x2b2a('0x30')](_0x229243[_0x2b2a('0x2f')]);_0x1f5ee5[_0x2b2a('0x38')]=_[_0x2b2a('0x31')](_0x1f5ee5[_0x2b2a('0x2e')],_0x1f5ee5[_0x2b2a('0x2f')]);_0x409bac[_0x2b2a('0x33')]=_[_0x2b2a('0x31')](_0x1f5ee5[_0x2b2a('0x2e')],qs[_0x2b2a('0x32')](_0x229243[_0x2b2a('0x2f')][_0x2b2a('0x32')]));_0x409bac['attributes']=_0x409bac['attributes'][_0x2b2a('0x34')]?_0x409bac['attributes']:_0x1f5ee5[_0x2b2a('0x2e')];if(_0x229243[_0x2b2a('0x2f')]['includeAll']){_0x409bac[_0x2b2a('0x43')]=[{'all':!![]}];}_0x409bac=_[_0x2b2a('0x3b')]({},_0x409bac,_0x229243[_0x2b2a('0x3c')]);return db[_0x2b2a('0x3d')][_0x2b2a('0x44')](_0x409bac)[_0x2b2a('0x25')](handleEntityNotFound(_0x279098,null))[_0x2b2a('0x25')](respondWithResult(_0x279098,null))[_0x2b2a('0x45')](handleError(_0x279098,null));};exports[_0x2b2a('0x20')]=function(_0x4f24af,_0x3604da){if(_0x4f24af[_0x2b2a('0x46')]['id']){delete _0x4f24af[_0x2b2a('0x46')]['id'];}return db[_0x2b2a('0x3d')][_0x2b2a('0x44')]({'where':{'id':_0x4f24af[_0x2b2a('0x42')]['id']}})['then'](handleEntityNotFound(_0x3604da,null))[_0x2b2a('0x25')](saveUpdates(_0x4f24af[_0x2b2a('0x46')],null))[_0x2b2a('0x25')](respondWithResult(_0x3604da,null))[_0x2b2a('0x45')](handleError(_0x3604da,null));};exports['destroy']=function(_0x5b44a9,_0x3ee99b){return db[_0x2b2a('0x3d')][_0x2b2a('0x44')]({'where':{'id':_0x5b44a9[_0x2b2a('0x42')]['id']}})['then'](handleEntityNotFound(_0x3ee99b,null))[_0x2b2a('0x25')](removeEntity(_0x3ee99b,null))[_0x2b2a('0x45')](handleError(_0x3ee99b,null));};exports[_0x2b2a('0x47')]=function(_0x39a0a2,_0x436f5e){var _0x2fe612={'key':_0x39a0a2['body'][_0x2b2a('0x48')]};if(_0x39a0a2[_0x2b2a('0x46')]['MailAccountId']){_0x2fe612[_0x2b2a('0x49')]=_0x39a0a2[_0x2b2a('0x46')]['MailAccountId'];}else if(_0x39a0a2['body'][_0x2b2a('0x4a')]){_0x2fe612[_0x2b2a('0x4a')]=_0x39a0a2[_0x2b2a('0x46')][_0x2b2a('0x4a')];}else if(_0x39a0a2[_0x2b2a('0x46')][_0x2b2a('0x4b')]){_0x2fe612['OpenchannelAccountId']=_0x39a0a2[_0x2b2a('0x46')][_0x2b2a('0x4b')];}else if(_0x39a0a2['body']['ChatWebsiteId']){_0x2fe612[_0x2b2a('0x4c')]=_0x39a0a2[_0x2b2a('0x46')][_0x2b2a('0x4c')];}return db[_0x2b2a('0x3d')][_0x2b2a('0x44')]({'where':_0x2fe612})[_0x2b2a('0x25')](function(_0x5dc395){if(_0x5dc395){throw new db[(_0x2b2a('0x4d'))][(_0x2b2a('0x4e'))](_0x2b2a('0x4f'));}return db[_0x2b2a('0x3d')][_0x2b2a('0x47')](_0x39a0a2['body']);})[_0x2b2a('0x25')](function(_0x267fe9){var _0x53a0a2=_0x39a0a2[_0x2b2a('0x50')][_0x2b2a('0x21')]({'plain':!![]});if(!_0x53a0a2)throw new Error(_0x2b2a('0x51'));if(_0x53a0a2[_0x2b2a('0x52')]===_0x2b2a('0x50')){var _0x4766d6=_0x267fe9[_0x2b2a('0x21')]({'plain':!![]});return db[_0x2b2a('0x53')][_0x2b2a('0x44')]({'where':{'name':_0x2b2a('0x22'),'userProfileId':_0x53a0a2[_0x2b2a('0x54')]},'raw':!![]})[_0x2b2a('0x25')](function(_0x392687){if(_0x392687&&_0x392687['autoAssociation']===0x0){return db['UserProfileResource'][_0x2b2a('0x47')]({'name':_0x4766d6[_0x2b2a('0x27')],'resourceId':_0x4766d6['id'],'type':_0x392687['name'],'sectionId':_0x392687['id']},{})[_0x2b2a('0x25')](function(){return _0x267fe9;});}else{return _0x267fe9;}})[_0x2b2a('0x45')](function(_0x4de668){logger[_0x2b2a('0x55')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x4de668);throw _0x4de668;});}return _0x267fe9;})[_0x2b2a('0x25')](respondWithResult(_0x436f5e,0xc9))[_0x2b2a('0x45')](handleError(_0x436f5e,null));};
\ No newline at end of file
diff --git a/server/api/cannedAnswer/cannedAnswer.model.js b/server/api/cannedAnswer/cannedAnswer.model.js
index ad56356..b6b01ea 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 _0xaebe=['path','rimraf','./cannedAnswer.attributes','exports','define','tools_canned_answers','lodash','util','../../config/logger','bluebird','request-promise'];(function(_0x18ab2a,_0x4debcd){var _0x16dcee=function(_0x10107a){while(--_0x10107a){_0x18ab2a['push'](_0x18ab2a['shift']());}};_0x16dcee(++_0x4debcd);}(_0xaebe,0xed));var _0xeaeb=function(_0x2e4aa2,_0x11956a){_0x2e4aa2=_0x2e4aa2-0x0;var _0x5e6092=_0xaebe[_0x2e4aa2];return _0x5e6092;};'use strict';var _=require(_0xeaeb('0x0'));var util=require(_0xeaeb('0x1'));var logger=require(_0xeaeb('0x2'))('api');var moment=require('moment');var BPromise=require(_0xeaeb('0x3'));var rp=require(_0xeaeb('0x4'));var fs=require('fs');var path=require(_0xeaeb('0x5'));var rimraf=require(_0xeaeb('0x6'));var config=require('../../config/environment');var attributes=require(_0xeaeb('0x7'));module[_0xeaeb('0x8')]=function(_0x2d542c,_0x1a1a6c){return _0x2d542c[_0xeaeb('0x9')]('CannedAnswer',attributes,{'tableName':_0xeaeb('0xa'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':'utf8mb4','collate':'utf8mb4_unicode_ci'});};
\ No newline at end of file
+var _0x1044=['path','../../config/environment','./cannedAnswer.attributes','exports','define','CannedAnswer','tools_canned_answers','lodash','util','../../config/logger','api','request-promise'];(function(_0x29cfb1,_0x25382b){var _0x3b0e0c=function(_0x53a654){while(--_0x53a654){_0x29cfb1['push'](_0x29cfb1['shift']());}};_0x3b0e0c(++_0x25382b);}(_0x1044,0x16f));var _0x4104=function(_0x2b4411,_0x2625ed){_0x2b4411=_0x2b4411-0x0;var _0x8e41ef=_0x1044[_0x2b4411];return _0x8e41ef;};'use strict';var _=require(_0x4104('0x0'));var util=require(_0x4104('0x1'));var logger=require(_0x4104('0x2'))(_0x4104('0x3'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x4104('0x4'));var fs=require('fs');var path=require(_0x4104('0x5'));var rimraf=require('rimraf');var config=require(_0x4104('0x6'));var attributes=require(_0x4104('0x7'));module[_0x4104('0x8')]=function(_0x45e726,_0xd70566){return _0x45e726[_0x4104('0x9')](_0x4104('0xa'),attributes,{'tableName':_0x4104('0xb'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':'utf8mb4','collate':'utf8mb4_unicode_ci'});};
\ No newline at end of file
diff --git a/server/api/cannedAnswer/cannedAnswer.rpc.js b/server/api/cannedAnswer/cannedAnswer.rpc.js
index 988bfc7..7b79775 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(_0x18d556,_0x4c8eea){var _0x2acef1=function(_0x4ed9f4){while(--_0x4ed9f4){_0x18d556['push'](_0x18d556['shift']());}};_0x2acef1(++_0x4c8eea);}(_0xa9e0,0x123));var _0x0a9e=function(_0x2a6809,_0x44edde){_0x2a6809=_0x2a6809-0x0;var _0x11c371=_0xa9e0[_0x2a6809];return _0x11c371;};'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(_0x593e14,_0x6ba693){var _0x234d7d=function(_0x3f66d6){while(--_0x3f66d6){_0x593e14['push'](_0x593e14['shift']());}};_0x234d7d(++_0x6ba693);}(_0xa9e0,0x123));var _0x0a9e=function(_0x2f3848,_0x48564d){_0x2f3848=_0x2f3848-0x0;var _0x102668=_0xa9e0[_0x2f3848];return _0x102668;};'use strict';var _=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var moment=require(_0x0a9e('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x0a9e('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x0a9e('0x4'));var logger=require(_0x0a9e('0x5'))(_0x0a9e('0x6'));var config=require(_0x0a9e('0x7'));var jayson=require(_0x0a9e('0x8'));var client=jayson['client'][_0x0a9e('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x441e3a,_0x2cc193,_0x5f41ea){return new BPromise(function(_0x503809,_0xe42b77){return client['request'](_0x441e3a,_0x5f41ea)['then'](function(_0x39753a){logger[_0x0a9e('0xa')](_0x0a9e('0xb'),_0x2cc193,_0x0a9e('0xc'));logger[_0x0a9e('0xd')](_0x0a9e('0xe'),_0x2cc193,'request\x20sent',JSON['stringify'](_0x39753a));if(_0x39753a['error']){if(_0x39753a['error'][_0x0a9e('0xf')]===0x1f4){logger[_0x0a9e('0x10')](_0x0a9e('0xb'),_0x2cc193,_0x39753a[_0x0a9e('0x10')][_0x0a9e('0x11')]);return _0xe42b77(_0x39753a[_0x0a9e('0x10')]['message']);}logger[_0x0a9e('0x10')](_0x0a9e('0xb'),_0x2cc193,_0x39753a[_0x0a9e('0x10')][_0x0a9e('0x11')]);return _0x503809(_0x39753a[_0x0a9e('0x10')][_0x0a9e('0x11')]);}else{logger['info'](_0x0a9e('0xb'),_0x2cc193,'request\x20sent');_0x503809(_0x39753a[_0x0a9e('0x12')]['message']);}})[_0x0a9e('0x13')](function(_0x12066b){logger['error'](_0x0a9e('0xb'),_0x2cc193,_0x12066b);_0xe42b77(_0x12066b);});});}
\ No newline at end of file
diff --git a/server/api/cannedAnswer/index.js b/server/api/cannedAnswer/index.js
index 3d724ee..3c167e7 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 _0x7894=['show','create','put','update','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment','get','isAuthenticated','index','/:id'];(function(_0x19e35c,_0x29cd1e){var _0x3e1fe8=function(_0x17258b){while(--_0x17258b){_0x19e35c['push'](_0x19e35c['shift']());}};_0x3e1fe8(++_0x29cd1e);}(_0x7894,0x1bf));var _0x4789=function(_0x1096f0,_0xb7c8a0){_0x1096f0=_0x1096f0-0x0;var _0x5286c8=_0x7894[_0x1096f0];return _0x5286c8;};'use strict';var multer=require(_0x4789('0x0'));var util=require(_0x4789('0x1'));var path=require(_0x4789('0x2'));var timeout=require(_0x4789('0x3'));var express=require(_0x4789('0x4'));var router=express[_0x4789('0x5')]();var fs_extra=require(_0x4789('0x6'));var auth=require(_0x4789('0x7'));var interaction=require('../../components/interaction/service');var config=require(_0x4789('0x8'));var controller=require('./cannedAnswer.controller');router[_0x4789('0x9')]('/',auth[_0x4789('0xa')](),controller[_0x4789('0xb')]);router[_0x4789('0x9')](_0x4789('0xc'),auth['isAuthenticated'](),controller[_0x4789('0xd')]);router['post']('/',auth[_0x4789('0xa')](),controller[_0x4789('0xe')]);router[_0x4789('0xf')]('/:id',auth[_0x4789('0xa')](),controller[_0x4789('0x10')]);router[_0x4789('0x11')](_0x4789('0xc'),auth['isAuthenticated'](),controller[_0x4789('0x12')]);module[_0x4789('0x13')]=router;
\ No newline at end of file
+var _0xd26d=['connect-timeout','express','Router','fs-extra','get','isAuthenticated','index','/:id','create','put','delete','exports','multer','util','path'];(function(_0x1a2160,_0x1c539a){var _0x32e2c0=function(_0x319331){while(--_0x319331){_0x1a2160['push'](_0x1a2160['shift']());}};_0x32e2c0(++_0x1c539a);}(_0xd26d,0x1bf));var _0xdd26=function(_0x4d8764,_0xd13d7b){_0x4d8764=_0x4d8764-0x0;var _0x4e0b49=_0xd26d[_0x4d8764];return _0x4e0b49;};'use strict';var multer=require(_0xdd26('0x0'));var util=require(_0xdd26('0x1'));var path=require(_0xdd26('0x2'));var timeout=require(_0xdd26('0x3'));var express=require(_0xdd26('0x4'));var router=express[_0xdd26('0x5')]();var fs_extra=require(_0xdd26('0x6'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require('./cannedAnswer.controller');router[_0xdd26('0x7')]('/',auth[_0xdd26('0x8')](),controller[_0xdd26('0x9')]);router[_0xdd26('0x7')](_0xdd26('0xa'),auth[_0xdd26('0x8')](),controller['show']);router['post']('/',auth[_0xdd26('0x8')](),controller[_0xdd26('0xb')]);router[_0xdd26('0xc')](_0xdd26('0xa'),auth[_0xdd26('0x8')](),controller['update']);router[_0xdd26('0xd')]('/:id',auth['isAuthenticated'](),controller['destroy']);module[_0xdd26('0xe')]=router;
\ No newline at end of file
diff --git a/server/api/cdr/cdr.attributes.js b/server/api/cdr/cdr.attributes.js
index 8588f17..17b9ee8 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 _0xd8b0=['INTEGER','sequelize','exports','STRING'];(function(_0x124ff4,_0x51c1b5){var _0x2c240a=function(_0x2633e0){while(--_0x2633e0){_0x124ff4['push'](_0x124ff4['shift']());}};_0x2c240a(++_0x51c1b5);}(_0xd8b0,0xad));var _0x0d8b=function(_0x122ef9,_0x451d2a){_0x122ef9=_0x122ef9-0x0;var _0x42fba0=_0xd8b0[_0x122ef9];return _0x42fba0;};'use strict';var Sequelize=require(_0x0d8b('0x0'));module[_0x0d8b('0x1')]={'calldate':{'type':Sequelize['DATE'],'allowNull':![],'defaultValue':'1970-01-01\x2000:00:01'},'clid':{'type':Sequelize['STRING']},'src':{'type':Sequelize[_0x0d8b('0x2')]},'dst':{'type':Sequelize[_0x0d8b('0x2')]},'dcontext':{'type':Sequelize[_0x0d8b('0x2')]},'channel':{'type':Sequelize[_0x0d8b('0x2')]},'dstchannel':{'type':Sequelize[_0x0d8b('0x2')]},'lastapp':{'type':Sequelize['STRING']},'lastdata':{'type':Sequelize['STRING']},'duration':{'type':Sequelize[_0x0d8b('0x3')],'allowNull':![],'defaultValue':0x0},'billsec':{'type':Sequelize[_0x0d8b('0x3')],'allowNull':![],'defaultValue':0x0},'disposition':{'type':Sequelize[_0x0d8b('0x2')]},'amaflags':{'type':Sequelize['INTEGER'],'allowNull':![],'defaultValue':0x0},'accountcode':{'type':Sequelize[_0x0d8b('0x2')]},'userfield':{'type':Sequelize[_0x0d8b('0x2')]},'uniqueid':{'type':Sequelize['STRING']},'linkedid':{'type':Sequelize[_0x0d8b('0x2')]},'sequence':{'type':Sequelize[_0x0d8b('0x2')]},'peeraccount':{'type':Sequelize[_0x0d8b('0x2')]},'type':{'type':Sequelize[_0x0d8b('0x2')]},'tag':{'type':Sequelize[_0x0d8b('0x2')]}};
\ No newline at end of file
+var _0xd240=['STRING','INTEGER','exports'];(function(_0x2c2dac,_0xecac14){var _0x5450c2=function(_0x45952a){while(--_0x45952a){_0x2c2dac['push'](_0x2c2dac['shift']());}};_0x5450c2(++_0xecac14);}(_0xd240,0x1c7));var _0x0d24=function(_0x1cea44,_0xf58a16){_0x1cea44=_0x1cea44-0x0;var _0x4d2e2e=_0xd240[_0x1cea44];return _0x4d2e2e;};'use strict';var Sequelize=require('sequelize');module[_0x0d24('0x0')]={'calldate':{'type':Sequelize['DATE'],'allowNull':![],'defaultValue':'1970-01-01\x2000:00:01'},'clid':{'type':Sequelize[_0x0d24('0x1')]},'src':{'type':Sequelize[_0x0d24('0x1')]},'dst':{'type':Sequelize[_0x0d24('0x1')]},'dcontext':{'type':Sequelize[_0x0d24('0x1')]},'channel':{'type':Sequelize[_0x0d24('0x1')]},'dstchannel':{'type':Sequelize[_0x0d24('0x1')]},'lastapp':{'type':Sequelize['STRING']},'lastdata':{'type':Sequelize['STRING']},'duration':{'type':Sequelize[_0x0d24('0x2')],'allowNull':![],'defaultValue':0x0},'billsec':{'type':Sequelize[_0x0d24('0x2')],'allowNull':![],'defaultValue':0x0},'disposition':{'type':Sequelize[_0x0d24('0x1')]},'amaflags':{'type':Sequelize[_0x0d24('0x2')],'allowNull':![],'defaultValue':0x0},'accountcode':{'type':Sequelize['STRING']},'userfield':{'type':Sequelize[_0x0d24('0x1')]},'uniqueid':{'type':Sequelize[_0x0d24('0x1')]},'linkedid':{'type':Sequelize[_0x0d24('0x1')]},'sequence':{'type':Sequelize[_0x0d24('0x1')]},'peeraccount':{'type':Sequelize[_0x0d24('0x1')]},'type':{'type':Sequelize[_0x0d24('0x1')]},'tag':{'type':Sequelize[_0x0d24('0x1')]}};
\ No newline at end of file
diff --git a/server/api/cdr/cdr.controller.js b/server/api/cdr/cdr.controller.js
index 0f01253..b7187ed 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 _0xfb65=['../../config/utils','../../config/environment','../../config/license/util','sendStatus','status','end','json','offset','limit','undefined','count','set','Content-Range','apply','save','update','then','destroy','error','stack','name','send','map','rawAttributes','type','key','model','query','filters','intersection','attributes','fields','length','nolimit','order','sort','where','pick','merge','VIRTUAL','filter','options','Cdr','includeAll','include','findAll','rows','catch','show','params','keys','find','create','body','describe','rimraf','zip-dir','request-promise','bluebird','mustache','util','path','sox','to-csv','lodash','squel','crypto','jsforce','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api'];(function(_0x1a2ef3,_0x21186c){var _0x34f4a4=function(_0x277126){while(--_0x277126){_0x1a2ef3['push'](_0x1a2ef3['shift']());}};_0x34f4a4(++_0x21186c);}(_0xfb65,0x82));var _0x5fb6=function(_0x2b1bb9,_0x3f85cc){_0x2b1bb9=_0x2b1bb9-0x0;var _0x59f401=_0xfb65[_0x2b1bb9];return _0x59f401;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x5fb6('0x0'));var zipdir=require(_0x5fb6('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0x5fb6('0x2'));var moment=require('moment');var BPromise=require(_0x5fb6('0x3'));var Mustache=require(_0x5fb6('0x4'));var util=require(_0x5fb6('0x5'));var path=require(_0x5fb6('0x6'));var sox=require(_0x5fb6('0x7'));var csv=require(_0x5fb6('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x5fb6('0x9'));var squel=require(_0x5fb6('0xa'));var crypto=require(_0x5fb6('0xb'));var jsforce=require(_0x5fb6('0xc'));var deskjs=require('desk.js');var toCsv=require(_0x5fb6('0x8'));var querystring=require(_0x5fb6('0xd'));var Papa=require(_0x5fb6('0xe'));var Redis=require(_0x5fb6('0xf'));var authService=require('../../components/auth/service');var qs=require(_0x5fb6('0x10'));var as=require(_0x5fb6('0x11'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x5fb6('0x12'))(_0x5fb6('0x13'));var utils=require(_0x5fb6('0x14'));var config=require(_0x5fb6('0x15'));var licenseUtil=require(_0x5fb6('0x16'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x1927d0,_0x15b296){_0x15b296=_0x15b296||0xcc;return function(_0x42285b){if(_0x42285b){return _0x1927d0[_0x5fb6('0x17')](_0x15b296);}return _0x1927d0[_0x5fb6('0x18')](_0x15b296)[_0x5fb6('0x19')]();};}function respondWithResult(_0x1a391f,_0x1ded21){_0x1ded21=_0x1ded21||0xc8;return function(_0x5e69c3){if(_0x5e69c3){return _0x1a391f['status'](_0x1ded21)[_0x5fb6('0x1a')](_0x5e69c3);}};}function respondWithFilteredResult(_0xfaea56,_0x58febe){return function(_0x1d57b1){if(_0x1d57b1){var _0x21ddd3=typeof _0x58febe[_0x5fb6('0x1b')]==='undefined'&&typeof _0x58febe[_0x5fb6('0x1c')]===_0x5fb6('0x1d');var _0x27bd8b=_0x1d57b1[_0x5fb6('0x1e')];var _0x167354=_0x21ddd3?0x0:_0x58febe[_0x5fb6('0x1b')];var _0x50bca8=_0x21ddd3?_0x1d57b1[_0x5fb6('0x1e')]:_0x58febe['offset']+_0x58febe[_0x5fb6('0x1c')];var _0x54c319;if(_0x50bca8>=_0x27bd8b){_0x50bca8=_0x27bd8b;_0x54c319=0xc8;}else{_0x54c319=0xce;}_0xfaea56[_0x5fb6('0x18')](_0x54c319);return _0xfaea56[_0x5fb6('0x1f')](_0x5fb6('0x20'),_0x167354+'-'+_0x50bca8+'/'+_0x27bd8b)[_0x5fb6('0x1a')](_0x1d57b1);}return null;};}function patchUpdates(_0x5885f1){return function(_0x418f58){try{jsonpatch[_0x5fb6('0x21')](_0x418f58,_0x5885f1,!![]);}catch(_0x50a414){return BPromise['reject'](_0x50a414);}return _0x418f58[_0x5fb6('0x22')]();};}function saveUpdates(_0x39ace4,_0x48a70e){return function(_0xdf1794){if(_0xdf1794){return _0xdf1794[_0x5fb6('0x23')](_0x39ace4)[_0x5fb6('0x24')](function(_0x36457e){return _0x36457e;});}return null;};}function removeEntity(_0x582f60,_0x2fca34){return function(_0x44aebe){if(_0x44aebe){return _0x44aebe[_0x5fb6('0x25')]()[_0x5fb6('0x24')](function(){_0x582f60[_0x5fb6('0x18')](0xcc)[_0x5fb6('0x19')]();});}};}function handleEntityNotFound(_0x4e2bff,_0x4cbdaf){return function(_0x298b44){if(!_0x298b44){_0x4e2bff[_0x5fb6('0x17')](0x194);}return _0x298b44;};}function handleError(_0x92f94d,_0x3ce22f){_0x3ce22f=_0x3ce22f||0x1f4;return function(_0x2731a3){logger[_0x5fb6('0x26')](_0x2731a3[_0x5fb6('0x27')]);if(_0x2731a3['name']){delete _0x2731a3[_0x5fb6('0x28')];}_0x92f94d[_0x5fb6('0x18')](_0x3ce22f)[_0x5fb6('0x29')](_0x2731a3);};}exports['index']=function(_0x2afc08,_0x1b4ae4){var _0x49a828={},_0x218428={},_0x408fd9={'count':0x0,'rows':[]};var _0x52afd7=_[_0x5fb6('0x2a')](db['Cdr'][_0x5fb6('0x2b')],function(_0x53dbeb){return{'name':_0x53dbeb['fieldName'],'type':_0x53dbeb[_0x5fb6('0x2c')][_0x5fb6('0x2d')]};});_0x218428[_0x5fb6('0x2e')]=_[_0x5fb6('0x2a')](_0x52afd7,_0x5fb6('0x28'));_0x218428[_0x5fb6('0x2f')]=_['keys'](_0x2afc08[_0x5fb6('0x2f')]);_0x218428[_0x5fb6('0x30')]=_[_0x5fb6('0x31')](_0x218428[_0x5fb6('0x2e')],_0x218428[_0x5fb6('0x2f')]);_0x49a828[_0x5fb6('0x32')]=_[_0x5fb6('0x31')](_0x218428[_0x5fb6('0x2e')],qs[_0x5fb6('0x33')](_0x2afc08[_0x5fb6('0x2f')][_0x5fb6('0x33')]));_0x49a828['attributes']=_0x49a828[_0x5fb6('0x32')][_0x5fb6('0x34')]?_0x49a828['attributes']:_0x218428[_0x5fb6('0x2e')];if(!_0x2afc08['query']['hasOwnProperty'](_0x5fb6('0x35'))){_0x49a828[_0x5fb6('0x1c')]=qs[_0x5fb6('0x1c')](_0x2afc08['query'][_0x5fb6('0x1c')]);_0x49a828['offset']=qs['offset'](_0x2afc08[_0x5fb6('0x2f')][_0x5fb6('0x1b')]);}_0x49a828[_0x5fb6('0x36')]=qs[_0x5fb6('0x37')](_0x2afc08[_0x5fb6('0x2f')][_0x5fb6('0x37')]);_0x49a828[_0x5fb6('0x38')]=qs[_0x5fb6('0x30')](_[_0x5fb6('0x39')](_0x2afc08[_0x5fb6('0x2f')],_0x218428[_0x5fb6('0x30')]),_0x52afd7);if(_0x2afc08[_0x5fb6('0x2f')]['filter']){_0x49a828[_0x5fb6('0x38')]=_[_0x5fb6('0x3a')](_0x49a828[_0x5fb6('0x38')],{'$or':_['map'](_0x52afd7,function(_0x1e83fc){if(_0x1e83fc['type']!==_0x5fb6('0x3b')){var _0x4bd9e5={};_0x4bd9e5[_0x1e83fc[_0x5fb6('0x28')]]={'$like':'%'+_0x2afc08[_0x5fb6('0x2f')][_0x5fb6('0x3c')]+'%'};return _0x4bd9e5;}})});}_0x49a828=_[_0x5fb6('0x3a')]({},_0x49a828,_0x2afc08[_0x5fb6('0x3d')]);var _0x59875a={'where':_0x49a828[_0x5fb6('0x38')]};return db[_0x5fb6('0x3e')][_0x5fb6('0x1e')](_0x59875a)[_0x5fb6('0x24')](function(_0x52e858){_0x408fd9[_0x5fb6('0x1e')]=_0x52e858;if(_0x2afc08[_0x5fb6('0x2f')][_0x5fb6('0x3f')]){_0x49a828[_0x5fb6('0x40')]=[{'all':!![]}];}return db[_0x5fb6('0x3e')][_0x5fb6('0x41')](_0x49a828);})['then'](function(_0x10c242){_0x408fd9[_0x5fb6('0x42')]=_0x10c242;return _0x408fd9;})[_0x5fb6('0x24')](respondWithFilteredResult(_0x1b4ae4,_0x49a828))[_0x5fb6('0x43')](handleError(_0x1b4ae4,null));};exports[_0x5fb6('0x44')]=function(_0x290e77,_0xd3245f){var _0x529c2d={'raw':!![],'where':{'id':_0x290e77[_0x5fb6('0x45')]['id']}},_0x2e3f97={};_0x2e3f97[_0x5fb6('0x2e')]=_['keys'](db[_0x5fb6('0x3e')]['rawAttributes']);_0x2e3f97[_0x5fb6('0x2f')]=_[_0x5fb6('0x46')](_0x290e77['query']);_0x2e3f97[_0x5fb6('0x30')]=_[_0x5fb6('0x31')](_0x2e3f97[_0x5fb6('0x2e')],_0x2e3f97['query']);_0x529c2d['attributes']=_[_0x5fb6('0x31')](_0x2e3f97[_0x5fb6('0x2e')],qs[_0x5fb6('0x33')](_0x290e77[_0x5fb6('0x2f')][_0x5fb6('0x33')]));_0x529c2d[_0x5fb6('0x32')]=_0x529c2d[_0x5fb6('0x32')][_0x5fb6('0x34')]?_0x529c2d[_0x5fb6('0x32')]:_0x2e3f97[_0x5fb6('0x2e')];if(_0x290e77[_0x5fb6('0x2f')]['includeAll']){_0x529c2d[_0x5fb6('0x40')]=[{'all':!![]}];}_0x529c2d=_['merge']({},_0x529c2d,_0x290e77['options']);return db[_0x5fb6('0x3e')][_0x5fb6('0x47')](_0x529c2d)[_0x5fb6('0x24')](handleEntityNotFound(_0xd3245f,null))[_0x5fb6('0x24')](respondWithResult(_0xd3245f,null))[_0x5fb6('0x43')](handleError(_0xd3245f,null));};exports[_0x5fb6('0x48')]=function(_0x45ba31,_0x5729a2){return db[_0x5fb6('0x3e')][_0x5fb6('0x48')](_0x45ba31['body'],{})[_0x5fb6('0x24')](respondWithResult(_0x5729a2,0xc9))[_0x5fb6('0x43')](handleError(_0x5729a2,null));};exports[_0x5fb6('0x23')]=function(_0x3fc547,_0x3b508a){if(_0x3fc547[_0x5fb6('0x49')]['id']){delete _0x3fc547[_0x5fb6('0x49')]['id'];}return db[_0x5fb6('0x3e')]['find']({'where':{'id':_0x3fc547[_0x5fb6('0x45')]['id']}})[_0x5fb6('0x24')](handleEntityNotFound(_0x3b508a,null))['then'](saveUpdates(_0x3fc547[_0x5fb6('0x49')],null))[_0x5fb6('0x24')](respondWithResult(_0x3b508a,null))[_0x5fb6('0x43')](handleError(_0x3b508a,null));};exports[_0x5fb6('0x25')]=function(_0x4bf156,_0x4bb943){return db[_0x5fb6('0x3e')][_0x5fb6('0x47')]({'where':{'id':_0x4bf156[_0x5fb6('0x45')]['id']}})['then'](handleEntityNotFound(_0x4bb943,null))[_0x5fb6('0x24')](removeEntity(_0x4bb943,null))['catch'](handleError(_0x4bb943,null));};exports[_0x5fb6('0x4a')]=function(_0x5eb7cf,_0xa949ae){return db[_0x5fb6('0x3e')][_0x5fb6('0x4a')]()['then'](respondWithResult(_0xa949ae,null))[_0x5fb6('0x43')](handleError(_0xa949ae,null));};
\ No newline at end of file
+var _0xa3e6=['offset','count','limit','Content-Range','apply','reject','save','update','then','destroy','error','stack','name','send','index','Cdr','fieldName','type','map','query','keys','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','sort','filters','pick','filter','merge','where','VIRTUAL','options','include','findAll','catch','params','rawAttributes','includeAll','find','create','body','describe','eml-format','zip-dir','request-promise','moment','bluebird','util','sox','to-csv','ejs','fs-extra','lodash','crypto','jsforce','querystring','../../components/auth/service','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json'];(function(_0x3fd5f8,_0x485d25){var _0x404870=function(_0x2aa84c){while(--_0x2aa84c){_0x3fd5f8['push'](_0x3fd5f8['shift']());}};_0x404870(++_0x485d25);}(_0xa3e6,0xbe));var _0x6a3e=function(_0x10cbd6,_0x40f843){_0x10cbd6=_0x10cbd6-0x0;var _0x51111c=_0xa3e6[_0x10cbd6];return _0x51111c;};'use strict';var emlformat=require(_0x6a3e('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x6a3e('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0x6a3e('0x2'));var moment=require(_0x6a3e('0x3'));var BPromise=require(_0x6a3e('0x4'));var Mustache=require('mustache');var util=require(_0x6a3e('0x5'));var path=require('path');var sox=require(_0x6a3e('0x6'));var csv=require(_0x6a3e('0x7'));var ejs=require(_0x6a3e('0x8'));var fs=require('fs');var fs_extra=require(_0x6a3e('0x9'));var _=require(_0x6a3e('0xa'));var squel=require('squel');var crypto=require(_0x6a3e('0xb'));var jsforce=require(_0x6a3e('0xc'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x6a3e('0xd'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x6a3e('0xe'));var qs=require('../../components/parsers/qs');var as=require(_0x6a3e('0xf'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x6a3e('0x10'))(_0x6a3e('0x11'));var utils=require(_0x6a3e('0x12'));var config=require(_0x6a3e('0x13'));var licenseUtil=require(_0x6a3e('0x14'));var db=require(_0x6a3e('0x15'))['db'];function respondWithStatusCode(_0x4a3a97,_0x27e169){_0x27e169=_0x27e169||0xcc;return function(_0x385c29){if(_0x385c29){return _0x4a3a97[_0x6a3e('0x16')](_0x27e169);}return _0x4a3a97[_0x6a3e('0x17')](_0x27e169)[_0x6a3e('0x18')]();};}function respondWithResult(_0x31aefa,_0x222f7c){_0x222f7c=_0x222f7c||0xc8;return function(_0x4bd05f){if(_0x4bd05f){return _0x31aefa[_0x6a3e('0x17')](_0x222f7c)[_0x6a3e('0x19')](_0x4bd05f);}};}function respondWithFilteredResult(_0x8ed74b,_0x2a62a8){return function(_0x500ccd){if(_0x500ccd){var _0x462b8d=typeof _0x2a62a8[_0x6a3e('0x1a')]==='undefined'&&typeof _0x2a62a8['limit']==='undefined';var _0x58b221=_0x500ccd['count'];var _0x3693a2=_0x462b8d?0x0:_0x2a62a8[_0x6a3e('0x1a')];var _0x31a190=_0x462b8d?_0x500ccd[_0x6a3e('0x1b')]:_0x2a62a8[_0x6a3e('0x1a')]+_0x2a62a8[_0x6a3e('0x1c')];var _0x1d6ccc;if(_0x31a190>=_0x58b221){_0x31a190=_0x58b221;_0x1d6ccc=0xc8;}else{_0x1d6ccc=0xce;}_0x8ed74b[_0x6a3e('0x17')](_0x1d6ccc);return _0x8ed74b['set'](_0x6a3e('0x1d'),_0x3693a2+'-'+_0x31a190+'/'+_0x58b221)['json'](_0x500ccd);}return null;};}function patchUpdates(_0xc0452f){return function(_0x5ae73b){try{jsonpatch[_0x6a3e('0x1e')](_0x5ae73b,_0xc0452f,!![]);}catch(_0x131d80){return BPromise[_0x6a3e('0x1f')](_0x131d80);}return _0x5ae73b[_0x6a3e('0x20')]();};}function saveUpdates(_0x58721c,_0x4f7507){return function(_0x215ac1){if(_0x215ac1){return _0x215ac1[_0x6a3e('0x21')](_0x58721c)[_0x6a3e('0x22')](function(_0x4687d0){return _0x4687d0;});}return null;};}function removeEntity(_0x4e5a25,_0x1ae966){return function(_0x21b5aa){if(_0x21b5aa){return _0x21b5aa[_0x6a3e('0x23')]()[_0x6a3e('0x22')](function(){_0x4e5a25[_0x6a3e('0x17')](0xcc)[_0x6a3e('0x18')]();});}};}function handleEntityNotFound(_0x359460,_0x83e681){return function(_0x25fc14){if(!_0x25fc14){_0x359460[_0x6a3e('0x16')](0x194);}return _0x25fc14;};}function handleError(_0x5b1ed9,_0x4ec834){_0x4ec834=_0x4ec834||0x1f4;return function(_0x150992){logger[_0x6a3e('0x24')](_0x150992[_0x6a3e('0x25')]);if(_0x150992[_0x6a3e('0x26')]){delete _0x150992[_0x6a3e('0x26')];}_0x5b1ed9[_0x6a3e('0x17')](_0x4ec834)[_0x6a3e('0x27')](_0x150992);};}exports[_0x6a3e('0x28')]=function(_0xd87198,_0x436169){var _0x3a831b={},_0x508a55={},_0x4eec67={'count':0x0,'rows':[]};var _0x2a2b2a=_['map'](db[_0x6a3e('0x29')]['rawAttributes'],function(_0x553fc5){return{'name':_0x553fc5[_0x6a3e('0x2a')],'type':_0x553fc5[_0x6a3e('0x2b')]['key']};});_0x508a55['model']=_[_0x6a3e('0x2c')](_0x2a2b2a,_0x6a3e('0x26'));_0x508a55[_0x6a3e('0x2d')]=_[_0x6a3e('0x2e')](_0xd87198['query']);_0x508a55['filters']=_[_0x6a3e('0x2f')](_0x508a55[_0x6a3e('0x30')],_0x508a55[_0x6a3e('0x2d')]);_0x3a831b[_0x6a3e('0x31')]=_['intersection'](_0x508a55[_0x6a3e('0x30')],qs[_0x6a3e('0x32')](_0xd87198['query']['fields']));_0x3a831b['attributes']=_0x3a831b[_0x6a3e('0x31')][_0x6a3e('0x33')]?_0x3a831b[_0x6a3e('0x31')]:_0x508a55[_0x6a3e('0x30')];if(!_0xd87198[_0x6a3e('0x2d')][_0x6a3e('0x34')](_0x6a3e('0x35'))){_0x3a831b[_0x6a3e('0x1c')]=qs[_0x6a3e('0x1c')](_0xd87198[_0x6a3e('0x2d')][_0x6a3e('0x1c')]);_0x3a831b[_0x6a3e('0x1a')]=qs[_0x6a3e('0x1a')](_0xd87198[_0x6a3e('0x2d')][_0x6a3e('0x1a')]);}_0x3a831b['order']=qs[_0x6a3e('0x36')](_0xd87198[_0x6a3e('0x2d')][_0x6a3e('0x36')]);_0x3a831b['where']=qs[_0x6a3e('0x37')](_[_0x6a3e('0x38')](_0xd87198['query'],_0x508a55[_0x6a3e('0x37')]),_0x2a2b2a);if(_0xd87198[_0x6a3e('0x2d')][_0x6a3e('0x39')]){_0x3a831b['where']=_[_0x6a3e('0x3a')](_0x3a831b[_0x6a3e('0x3b')],{'$or':_[_0x6a3e('0x2c')](_0x2a2b2a,function(_0x3e604c){if(_0x3e604c[_0x6a3e('0x2b')]!==_0x6a3e('0x3c')){var _0x5f4ff5={};_0x5f4ff5[_0x3e604c[_0x6a3e('0x26')]]={'$like':'%'+_0xd87198['query']['filter']+'%'};return _0x5f4ff5;}})});}_0x3a831b=_['merge']({},_0x3a831b,_0xd87198[_0x6a3e('0x3d')]);var _0x4bb1ba={'where':_0x3a831b[_0x6a3e('0x3b')]};return db[_0x6a3e('0x29')][_0x6a3e('0x1b')](_0x4bb1ba)[_0x6a3e('0x22')](function(_0xca83d2){_0x4eec67[_0x6a3e('0x1b')]=_0xca83d2;if(_0xd87198['query']['includeAll']){_0x3a831b[_0x6a3e('0x3e')]=[{'all':!![]}];}return db[_0x6a3e('0x29')][_0x6a3e('0x3f')](_0x3a831b);})[_0x6a3e('0x22')](function(_0x1dd524){_0x4eec67['rows']=_0x1dd524;return _0x4eec67;})[_0x6a3e('0x22')](respondWithFilteredResult(_0x436169,_0x3a831b))[_0x6a3e('0x40')](handleError(_0x436169,null));};exports['show']=function(_0x35c927,_0x417f8a){var _0x35c836={'raw':!![],'where':{'id':_0x35c927[_0x6a3e('0x41')]['id']}},_0x53ad48={};_0x53ad48[_0x6a3e('0x30')]=_[_0x6a3e('0x2e')](db[_0x6a3e('0x29')][_0x6a3e('0x42')]);_0x53ad48[_0x6a3e('0x2d')]=_['keys'](_0x35c927[_0x6a3e('0x2d')]);_0x53ad48[_0x6a3e('0x37')]=_[_0x6a3e('0x2f')](_0x53ad48['model'],_0x53ad48[_0x6a3e('0x2d')]);_0x35c836['attributes']=_['intersection'](_0x53ad48[_0x6a3e('0x30')],qs[_0x6a3e('0x32')](_0x35c927[_0x6a3e('0x2d')]['fields']));_0x35c836['attributes']=_0x35c836[_0x6a3e('0x31')][_0x6a3e('0x33')]?_0x35c836[_0x6a3e('0x31')]:_0x53ad48[_0x6a3e('0x30')];if(_0x35c927[_0x6a3e('0x2d')][_0x6a3e('0x43')]){_0x35c836['include']=[{'all':!![]}];}_0x35c836=_[_0x6a3e('0x3a')]({},_0x35c836,_0x35c927[_0x6a3e('0x3d')]);return db[_0x6a3e('0x29')][_0x6a3e('0x44')](_0x35c836)[_0x6a3e('0x22')](handleEntityNotFound(_0x417f8a,null))[_0x6a3e('0x22')](respondWithResult(_0x417f8a,null))[_0x6a3e('0x40')](handleError(_0x417f8a,null));};exports[_0x6a3e('0x45')]=function(_0x2d0685,_0x4d36e2){return db[_0x6a3e('0x29')][_0x6a3e('0x45')](_0x2d0685['body'],{})[_0x6a3e('0x22')](respondWithResult(_0x4d36e2,0xc9))['catch'](handleError(_0x4d36e2,null));};exports[_0x6a3e('0x21')]=function(_0x10cd8e,_0x28a3e9){if(_0x10cd8e['body']['id']){delete _0x10cd8e[_0x6a3e('0x46')]['id'];}return db[_0x6a3e('0x29')]['find']({'where':{'id':_0x10cd8e['params']['id']}})['then'](handleEntityNotFound(_0x28a3e9,null))[_0x6a3e('0x22')](saveUpdates(_0x10cd8e[_0x6a3e('0x46')],null))[_0x6a3e('0x22')](respondWithResult(_0x28a3e9,null))[_0x6a3e('0x40')](handleError(_0x28a3e9,null));};exports[_0x6a3e('0x23')]=function(_0x448e46,_0x404473){return db[_0x6a3e('0x29')][_0x6a3e('0x44')]({'where':{'id':_0x448e46[_0x6a3e('0x41')]['id']}})[_0x6a3e('0x22')](handleEntityNotFound(_0x404473,null))['then'](removeEntity(_0x404473,null))[_0x6a3e('0x40')](handleError(_0x404473,null));};exports[_0x6a3e('0x47')]=function(_0x3fabf8,_0x21ba7b){return db[_0x6a3e('0x29')]['describe']()[_0x6a3e('0x22')](respondWithResult(_0x21ba7b,null))['catch'](handleError(_0x21ba7b,null));};
\ No newline at end of file
diff --git a/server/api/cdr/cdr.model.js b/server/api/cdr/cdr.model.js
index de32c2c..624d738 100644
--- a/server/api/cdr/cdr.model.js
+++ b/server/api/cdr/cdr.model.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x7a54=['Cdr','cdr','accountcode','disposition','dst','src','uniqueid','lodash','util','../../config/logger','moment','bluebird','path','rimraf','../../config/environment','./cdr.attributes','exports'];(function(_0x3e6f07,_0x155ae7){var _0x2954ab=function(_0x275c8b){while(--_0x275c8b){_0x3e6f07['push'](_0x3e6f07['shift']());}};_0x2954ab(++_0x155ae7);}(_0x7a54,0x106));var _0x47a5=function(_0x24fe54,_0x2cda12){_0x24fe54=_0x24fe54-0x0;var _0x518051=_0x7a54[_0x24fe54];return _0x518051;};'use strict';var _=require(_0x47a5('0x0'));var util=require(_0x47a5('0x1'));var logger=require(_0x47a5('0x2'))('api');var moment=require(_0x47a5('0x3'));var BPromise=require(_0x47a5('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x47a5('0x5'));var rimraf=require(_0x47a5('0x6'));var config=require(_0x47a5('0x7'));var attributes=require(_0x47a5('0x8'));module[_0x47a5('0x9')]=function(_0x545a97,_0x3d5629){return _0x545a97['define'](_0x47a5('0xa'),attributes,{'tableName':_0x47a5('0xb'),'paranoid':![],'indexes':[{'name':'accountcode','fields':[_0x47a5('0xc')]},{'name':'calldate','fields':['calldate']},{'name':'disposition','fields':[_0x47a5('0xd')]},{'name':_0x47a5('0xe'),'fields':['dst']},{'name':_0x47a5('0xf'),'fields':['src']},{'name':'uniqueid','fields':[_0x47a5('0x10')]}],'timestamps':![]});};
\ No newline at end of file
+var _0x9957=['dst','src','uniqueid','lodash','util','../../config/logger','api','bluebird','request-promise','path','rimraf','./cdr.attributes','exports','define','Cdr','accountcode','calldate','disposition'];(function(_0x15f5b2,_0x41b6d6){var _0x5d9a5c=function(_0x212b79){while(--_0x212b79){_0x15f5b2['push'](_0x15f5b2['shift']());}};_0x5d9a5c(++_0x41b6d6);}(_0x9957,0x93));var _0x7995=function(_0x4cf98e,_0xba4b79){_0x4cf98e=_0x4cf98e-0x0;var _0x1623ac=_0x9957[_0x4cf98e];return _0x1623ac;};'use strict';var _=require(_0x7995('0x0'));var util=require(_0x7995('0x1'));var logger=require(_0x7995('0x2'))(_0x7995('0x3'));var moment=require('moment');var BPromise=require(_0x7995('0x4'));var rp=require(_0x7995('0x5'));var fs=require('fs');var path=require(_0x7995('0x6'));var rimraf=require(_0x7995('0x7'));var config=require('../../config/environment');var attributes=require(_0x7995('0x8'));module[_0x7995('0x9')]=function(_0x137b6b,_0x219534){return _0x137b6b[_0x7995('0xa')](_0x7995('0xb'),attributes,{'tableName':'cdr','paranoid':![],'indexes':[{'name':_0x7995('0xc'),'fields':[_0x7995('0xc')]},{'name':'calldate','fields':[_0x7995('0xd')]},{'name':_0x7995('0xe'),'fields':[_0x7995('0xe')]},{'name':_0x7995('0xf'),'fields':[_0x7995('0xf')]},{'name':_0x7995('0x10'),'fields':[_0x7995('0x10')]},{'name':'uniqueid','fields':[_0x7995('0x11')]}],'timestamps':![]});};
\ No newline at end of file
diff --git a/server/api/cdr/cdr.rpc.js b/server/api/cdr/cdr.rpc.js
index b52e72f..f644408 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 _0x0ab5=['request\x20sent','debug','Cdr,\x20%s,\x20%s,\x20%s','stringify','error','code','message','Cdr,\x20%s,\x20%s','result','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','rpc','../../config/environment','client','http','request','info'];(function(_0xa464c9,_0x7c86d8){var _0x3d73c4=function(_0x5c2056){while(--_0x5c2056){_0xa464c9['push'](_0xa464c9['shift']());}};_0x3d73c4(++_0x7c86d8);}(_0x0ab5,0xc6));var _0x50ab=function(_0x15407b,_0x4a30c7){_0x15407b=_0x15407b-0x0;var _0x46e21d=_0x0ab5[_0x15407b];return _0x46e21d;};'use strict';var _=require('lodash');var util=require(_0x50ab('0x0'));var moment=require(_0x50ab('0x1'));var BPromise=require(_0x50ab('0x2'));var rs=require(_0x50ab('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x50ab('0x4'))['db'];var utils=require(_0x50ab('0x5'));var logger=require('../../config/logger')(_0x50ab('0x6'));var config=require(_0x50ab('0x7'));var jayson=require('jayson/promise');var client=jayson[_0x50ab('0x8')][_0x50ab('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x20189d,_0x359fe3,_0x3a2272){return new BPromise(function(_0x10c0b2,_0x93dff4){return client[_0x50ab('0xa')](_0x20189d,_0x3a2272)['then'](function(_0x17f9a7){logger[_0x50ab('0xb')]('Cdr,\x20%s,\x20%s',_0x359fe3,_0x50ab('0xc'));logger[_0x50ab('0xd')](_0x50ab('0xe'),_0x359fe3,_0x50ab('0xc'),JSON[_0x50ab('0xf')](_0x17f9a7));if(_0x17f9a7[_0x50ab('0x10')]){if(_0x17f9a7['error'][_0x50ab('0x11')]===0x1f4){logger[_0x50ab('0x10')]('Cdr,\x20%s,\x20%s',_0x359fe3,_0x17f9a7[_0x50ab('0x10')][_0x50ab('0x12')]);return _0x93dff4(_0x17f9a7['error']['message']);}logger[_0x50ab('0x10')]('Cdr,\x20%s,\x20%s',_0x359fe3,_0x17f9a7['error'][_0x50ab('0x12')]);return _0x10c0b2(_0x17f9a7[_0x50ab('0x10')]['message']);}else{logger[_0x50ab('0xb')](_0x50ab('0x13'),_0x359fe3,_0x50ab('0xc'));_0x10c0b2(_0x17f9a7[_0x50ab('0x14')][_0x50ab('0x12')]);}})['catch'](function(_0x45e0b6){logger['error'](_0x50ab('0x13'),_0x359fe3,_0x45e0b6);_0x93dff4(_0x45e0b6);});});}
\ No newline at end of file
+var _0x702b=['message','catch','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','jayson/promise','client','http','request','then','info','Cdr,\x20%s,\x20%s','request\x20sent','debug','Cdr,\x20%s,\x20%s,\x20%s','stringify','error','code'];(function(_0x1582de,_0x784b2e){var _0x49dd27=function(_0x1a09ec){while(--_0x1a09ec){_0x1582de['push'](_0x1582de['shift']());}};_0x49dd27(++_0x784b2e);}(_0x702b,0x95));var _0xb702=function(_0x5042a4,_0xab0f0f){_0x5042a4=_0x5042a4-0x0;var _0x45d1c7=_0x702b[_0x5042a4];return _0x45d1c7;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0xb702('0x0'));var BPromise=require(_0xb702('0x1'));var rs=require(_0xb702('0x2'));var fs=require('fs');var Redis=require(_0xb702('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0xb702('0x4'));var logger=require(_0xb702('0x5'))('rpc');var config=require('../../config/environment');var jayson=require(_0xb702('0x6'));var client=jayson[_0xb702('0x7')][_0xb702('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x14f1f3,_0xa2ad98,_0x583da7){return new BPromise(function(_0x43f668,_0xa28c29){return client[_0xb702('0x9')](_0x14f1f3,_0x583da7)[_0xb702('0xa')](function(_0x353667){logger[_0xb702('0xb')](_0xb702('0xc'),_0xa2ad98,_0xb702('0xd'));logger[_0xb702('0xe')](_0xb702('0xf'),_0xa2ad98,_0xb702('0xd'),JSON[_0xb702('0x10')](_0x353667));if(_0x353667[_0xb702('0x11')]){if(_0x353667[_0xb702('0x11')][_0xb702('0x12')]===0x1f4){logger[_0xb702('0x11')](_0xb702('0xc'),_0xa2ad98,_0x353667['error']['message']);return _0xa28c29(_0x353667[_0xb702('0x11')][_0xb702('0x13')]);}logger['error'](_0xb702('0xc'),_0xa2ad98,_0x353667[_0xb702('0x11')][_0xb702('0x13')]);return _0x43f668(_0x353667[_0xb702('0x11')][_0xb702('0x13')]);}else{logger[_0xb702('0xb')](_0xb702('0xc'),_0xa2ad98,_0xb702('0xd'));_0x43f668(_0x353667['result'][_0xb702('0x13')]);}})[_0xb702('0x14')](function(_0x20031e){logger[_0xb702('0x11')](_0xb702('0xc'),_0xa2ad98,_0x20031e);_0xa28c29(_0x20031e);});});}
\ No newline at end of file
diff --git a/server/api/cdr/index.js b/server/api/cdr/index.js
index 0711486..96b2af3 100644
--- a/server/api/cdr/index.js
+++ b/server/api/cdr/index.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xd8b0=['destroy','exports','multer','util','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','isAuthenticated','index','get','describe','/:id','show','post','create','put','update'];(function(_0x457062,_0x1893df){var _0x4df1a9=function(_0x5b9652){while(--_0x5b9652){_0x457062['push'](_0x457062['shift']());}};_0x4df1a9(++_0x1893df);}(_0xd8b0,0xad));var _0x0d8b=function(_0x122ef9,_0x451d2a){_0x122ef9=_0x122ef9-0x0;var _0x42fba0=_0xd8b0[_0x122ef9];return _0x42fba0;};'use strict';var multer=require(_0x0d8b('0x0'));var util=require(_0x0d8b('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0d8b('0x2')]();var fs_extra=require(_0x0d8b('0x3'));var auth=require(_0x0d8b('0x4'));var interaction=require(_0x0d8b('0x5'));var config=require(_0x0d8b('0x6'));var controller=require('./cdr.controller');router['get']('/',auth[_0x0d8b('0x7')](),controller[_0x0d8b('0x8')]);router[_0x0d8b('0x9')]('/describe',auth[_0x0d8b('0x7')](),controller[_0x0d8b('0xa')]);router['get'](_0x0d8b('0xb'),auth[_0x0d8b('0x7')](),controller[_0x0d8b('0xc')]);router[_0x0d8b('0xd')]('/',auth[_0x0d8b('0x7')](),controller[_0x0d8b('0xe')]);router[_0x0d8b('0xf')](_0x0d8b('0xb'),auth['isAuthenticated'](),controller[_0x0d8b('0x10')]);router['delete'](_0x0d8b('0xb'),auth[_0x0d8b('0x7')](),controller[_0x0d8b('0x11')]);module[_0x0d8b('0x12')]=router;
\ No newline at end of file
+var _0xd8b0=['destroy','exports','multer','util','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','isAuthenticated','index','get','describe','/:id','show','post','create','put','update'];(function(_0x5c1cdc,_0x322014){var _0x2e8317=function(_0x2e9dfa){while(--_0x2e9dfa){_0x5c1cdc['push'](_0x5c1cdc['shift']());}};_0x2e8317(++_0x322014);}(_0xd8b0,0xad));var _0x0d8b=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xd8b0[_0x20a584];return _0x4b41a8;};'use strict';var multer=require(_0x0d8b('0x0'));var util=require(_0x0d8b('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0d8b('0x2')]();var fs_extra=require(_0x0d8b('0x3'));var auth=require(_0x0d8b('0x4'));var interaction=require(_0x0d8b('0x5'));var config=require(_0x0d8b('0x6'));var controller=require('./cdr.controller');router['get']('/',auth[_0x0d8b('0x7')](),controller[_0x0d8b('0x8')]);router[_0x0d8b('0x9')]('/describe',auth[_0x0d8b('0x7')](),controller[_0x0d8b('0xa')]);router['get'](_0x0d8b('0xb'),auth[_0x0d8b('0x7')](),controller[_0x0d8b('0xc')]);router[_0x0d8b('0xd')]('/',auth[_0x0d8b('0x7')](),controller[_0x0d8b('0xe')]);router[_0x0d8b('0xf')](_0x0d8b('0xb'),auth['isAuthenticated'](),controller[_0x0d8b('0x10')]);router['delete'](_0x0d8b('0xb'),auth[_0x0d8b('0x7')](),controller[_0x0d8b('0x11')]);module[_0x0d8b('0x12')]=router;
\ No newline at end of file
diff --git a/server/api/chatApplication/chatApplication.attributes.js b/server/api/chatApplication/chatApplication.attributes.js
index 78ccdc9..3c8a445 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 _0x1f2b=['*,*,*,*','sequelize','STRING','noop','TEXT'];(function(_0x22a217,_0x5daf6d){var _0x5a208b=function(_0x1331d9){while(--_0x1331d9){_0x22a217['push'](_0x22a217['shift']());}};_0x5a208b(++_0x5daf6d);}(_0x1f2b,0x182));var _0xb1f2=function(_0x3e7bd4,_0x5ec934){_0x3e7bd4=_0x3e7bd4-0x0;var _0x3b4224=_0x1f2b[_0x3e7bd4];return _0x3b4224;};'use strict';var Sequelize=require(_0xb1f2('0x0'));module['exports']={'priority':{'type':Sequelize['INTEGER'],'allowNull':![]},'app':{'type':Sequelize[_0xb1f2('0x1')],'allowNull':![],'defaultValue':_0xb1f2('0x2')},'appdata':{'type':Sequelize[_0xb1f2('0x3')]()},'description':{'type':Sequelize[_0xb1f2('0x1')]},'interval':{'type':Sequelize[_0xb1f2('0x1')],'defaultValue':_0xb1f2('0x4')}};
\ No newline at end of file
+var _0xdb45=['exports','INTEGER','STRING','noop','TEXT','*,*,*,*','sequelize'];(function(_0x26acf0,_0x34a834){var _0x31d06f=function(_0x51a397){while(--_0x51a397){_0x26acf0['push'](_0x26acf0['shift']());}};_0x31d06f(++_0x34a834);}(_0xdb45,0x110));var _0x5db4=function(_0xdb6228,_0x370bd2){_0xdb6228=_0xdb6228-0x0;var _0x7d09b1=_0xdb45[_0xdb6228];return _0x7d09b1;};'use strict';var Sequelize=require(_0x5db4('0x0'));module[_0x5db4('0x1')]={'priority':{'type':Sequelize[_0x5db4('0x2')],'allowNull':![]},'app':{'type':Sequelize[_0x5db4('0x3')],'allowNull':![],'defaultValue':_0x5db4('0x4')},'appdata':{'type':Sequelize[_0x5db4('0x5')]()},'description':{'type':Sequelize[_0x5db4('0x3')]},'interval':{'type':Sequelize[_0x5db4('0x3')],'defaultValue':_0x5db4('0x6')}};
\ No newline at end of file
diff --git a/server/api/chatApplication/chatApplication.controller.js b/server/api/chatApplication/chatApplication.controller.js
index 28fbd49..a6af128 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 _0x7382=['save','then','destroy','error','stack','name','send','show','params','ChatApplication','rawAttributes','query','filters','intersection','model','attributes','fields','length','includeAll','include','merge','options','find','catch','update','body','rimraf','request-promise','bluebird','util','path','to-csv','ejs','fs-extra','lodash','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','count','limit','set','Content-Range','apply','reject'];(function(_0x47c5bf,_0x45977e){var _0x11b779=function(_0x1bd585){while(--_0x1bd585){_0x47c5bf['push'](_0x47c5bf['shift']());}};_0x11b779(++_0x45977e);}(_0x7382,0x1f2));var _0x2738=function(_0x4dfbe8,_0x1bee42){_0x4dfbe8=_0x4dfbe8-0x0;var _0x2a2a44=_0x7382[_0x4dfbe8];return _0x2a2a44;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x2738('0x0'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x2738('0x1'));var moment=require('moment');var BPromise=require(_0x2738('0x2'));var Mustache=require('mustache');var util=require(_0x2738('0x3'));var path=require(_0x2738('0x4'));var sox=require('sox');var csv=require(_0x2738('0x5'));var ejs=require(_0x2738('0x6'));var fs=require('fs');var fs_extra=require(_0x2738('0x7'));var _=require(_0x2738('0x8'));var squel=require('squel');var crypto=require(_0x2738('0x9'));var jsforce=require(_0x2738('0xa'));var deskjs=require(_0x2738('0xb'));var toCsv=require(_0x2738('0x5'));var querystring=require(_0x2738('0xc'));var Papa=require('papaparse');var Redis=require(_0x2738('0xd'));var authService=require(_0x2738('0xe'));var qs=require(_0x2738('0xf'));var as=require(_0x2738('0x10'));var hardwareService=require(_0x2738('0x11'));var logger=require('../../config/logger')('api');var utils=require('../../config/utils');var config=require(_0x2738('0x12'));var licenseUtil=require(_0x2738('0x13'));var db=require(_0x2738('0x14'))['db'];function respondWithStatusCode(_0x46072b,_0x263b48){_0x263b48=_0x263b48||0xcc;return function(_0x41b111){if(_0x41b111){return _0x46072b[_0x2738('0x15')](_0x263b48);}return _0x46072b[_0x2738('0x16')](_0x263b48)[_0x2738('0x17')]();};}function respondWithResult(_0x1506fe,_0x4584f8){_0x4584f8=_0x4584f8||0xc8;return function(_0x1d2de7){if(_0x1d2de7){return _0x1506fe['status'](_0x4584f8)[_0x2738('0x18')](_0x1d2de7);}};}function respondWithFilteredResult(_0x2db43f,_0x547823){return function(_0x4cde16){if(_0x4cde16){var _0x1542b6=typeof _0x547823[_0x2738('0x19')]===_0x2738('0x1a')&&typeof _0x547823['limit']===_0x2738('0x1a');var _0x1f3962=_0x4cde16[_0x2738('0x1b')];var _0x2ab61b=_0x1542b6?0x0:_0x547823[_0x2738('0x19')];var _0x4a0f1e=_0x1542b6?_0x4cde16[_0x2738('0x1b')]:_0x547823[_0x2738('0x19')]+_0x547823[_0x2738('0x1c')];var _0x1d5cb1;if(_0x4a0f1e>=_0x1f3962){_0x4a0f1e=_0x1f3962;_0x1d5cb1=0xc8;}else{_0x1d5cb1=0xce;}_0x2db43f[_0x2738('0x16')](_0x1d5cb1);return _0x2db43f[_0x2738('0x1d')](_0x2738('0x1e'),_0x2ab61b+'-'+_0x4a0f1e+'/'+_0x1f3962)[_0x2738('0x18')](_0x4cde16);}return null;};}function patchUpdates(_0x2dcc5e){return function(_0x514e45){try{jsonpatch[_0x2738('0x1f')](_0x514e45,_0x2dcc5e,!![]);}catch(_0x52c7df){return BPromise[_0x2738('0x20')](_0x52c7df);}return _0x514e45[_0x2738('0x21')]();};}function saveUpdates(_0x264a56,_0x36b4bb){return function(_0x532cb8){if(_0x532cb8){return _0x532cb8['update'](_0x264a56)[_0x2738('0x22')](function(_0xae5515){return _0xae5515;});}return null;};}function removeEntity(_0x1637bb,_0x476c38){return function(_0x509c92){if(_0x509c92){return _0x509c92[_0x2738('0x23')]()[_0x2738('0x22')](function(){_0x1637bb[_0x2738('0x16')](0xcc)[_0x2738('0x17')]();});}};}function handleEntityNotFound(_0x4b4c15,_0x4bb15e){return function(_0x5b7fd0){if(!_0x5b7fd0){_0x4b4c15[_0x2738('0x15')](0x194);}return _0x5b7fd0;};}function handleError(_0x37f176,_0x536d42){_0x536d42=_0x536d42||0x1f4;return function(_0x2f0002){logger[_0x2738('0x24')](_0x2f0002[_0x2738('0x25')]);if(_0x2f0002['name']){delete _0x2f0002[_0x2738('0x26')];}_0x37f176[_0x2738('0x16')](_0x536d42)[_0x2738('0x27')](_0x2f0002);};}exports[_0x2738('0x28')]=function(_0xbfa426,_0x263ebd){var _0x13343a={'raw':!![],'where':{'id':_0xbfa426[_0x2738('0x29')]['id']}},_0x390d2d={};_0x390d2d['model']=_['keys'](db[_0x2738('0x2a')][_0x2738('0x2b')]);_0x390d2d['query']=_['keys'](_0xbfa426[_0x2738('0x2c')]);_0x390d2d[_0x2738('0x2d')]=_[_0x2738('0x2e')](_0x390d2d[_0x2738('0x2f')],_0x390d2d[_0x2738('0x2c')]);_0x13343a[_0x2738('0x30')]=_[_0x2738('0x2e')](_0x390d2d[_0x2738('0x2f')],qs[_0x2738('0x31')](_0xbfa426['query']['fields']));_0x13343a[_0x2738('0x30')]=_0x13343a[_0x2738('0x30')][_0x2738('0x32')]?_0x13343a[_0x2738('0x30')]:_0x390d2d[_0x2738('0x2f')];if(_0xbfa426['query'][_0x2738('0x33')]){_0x13343a[_0x2738('0x34')]=[{'all':!![]}];}_0x13343a=_[_0x2738('0x35')]({},_0x13343a,_0xbfa426[_0x2738('0x36')]);return db[_0x2738('0x2a')][_0x2738('0x37')](_0x13343a)[_0x2738('0x22')](handleEntityNotFound(_0x263ebd,null))[_0x2738('0x22')](respondWithResult(_0x263ebd,null))[_0x2738('0x38')](handleError(_0x263ebd,null));};exports[_0x2738('0x39')]=function(_0x19d49d,_0x20e02a){if(_0x19d49d[_0x2738('0x3a')]['id']){delete _0x19d49d[_0x2738('0x3a')]['id'];}return db[_0x2738('0x2a')][_0x2738('0x37')]({'where':{'id':_0x19d49d[_0x2738('0x29')]['id']}})[_0x2738('0x22')](handleEntityNotFound(_0x20e02a,null))[_0x2738('0x22')](saveUpdates(_0x19d49d[_0x2738('0x3a')],null))[_0x2738('0x22')](respondWithResult(_0x20e02a,null))[_0x2738('0x38')](handleError(_0x20e02a,null));};exports[_0x2738('0x23')]=function(_0x53084c,_0x10e729){return db[_0x2738('0x2a')][_0x2738('0x37')]({'where':{'id':_0x53084c[_0x2738('0x29')]['id']}})[_0x2738('0x22')](handleEntityNotFound(_0x10e729,null))[_0x2738('0x22')](removeEntity(_0x10e729,null))[_0x2738('0x38')](handleError(_0x10e729,null));};
\ No newline at end of file
+var _0xbdb7=['update','error','stack','name','send','show','params','model','keys','ChatApplication','query','filters','intersection','attributes','length','includeAll','merge','find','then','body','catch','destroy','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','fs-extra','lodash','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../mysqldb','end','json','offset','undefined','limit','count','status','set','Content-Range','apply','save'];(function(_0x4e6ae6,_0x49dba6){var _0x23c108=function(_0x1bc103){while(--_0x1bc103){_0x4e6ae6['push'](_0x4e6ae6['shift']());}};_0x23c108(++_0x49dba6);}(_0xbdb7,0x12e));var _0x7bdb=function(_0x59b9d3,_0x384472){_0x59b9d3=_0x59b9d3-0x0;var _0x171163=_0xbdb7[_0x59b9d3];return _0x171163;};'use strict';var emlformat=require(_0x7bdb('0x0'));var rimraf=require(_0x7bdb('0x1'));var zipdir=require(_0x7bdb('0x2'));var jsonpatch=require(_0x7bdb('0x3'));var rp=require(_0x7bdb('0x4'));var moment=require(_0x7bdb('0x5'));var BPromise=require(_0x7bdb('0x6'));var Mustache=require(_0x7bdb('0x7'));var util=require(_0x7bdb('0x8'));var path=require('path');var sox=require(_0x7bdb('0x9'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x7bdb('0xa'));var _=require(_0x7bdb('0xb'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x7bdb('0xc'));var deskjs=require(_0x7bdb('0xd'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x7bdb('0xe'));var Redis=require(_0x7bdb('0xf'));var authService=require(_0x7bdb('0x10'));var qs=require(_0x7bdb('0x11'));var as=require(_0x7bdb('0x12'));var hardwareService=require(_0x7bdb('0x13'));var logger=require(_0x7bdb('0x14'))(_0x7bdb('0x15'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0x7bdb('0x16'))['db'];function respondWithStatusCode(_0x25e3cb,_0x496613){_0x496613=_0x496613||0xcc;return function(_0x8d74ff){if(_0x8d74ff){return _0x25e3cb['sendStatus'](_0x496613);}return _0x25e3cb['status'](_0x496613)[_0x7bdb('0x17')]();};}function respondWithResult(_0x46dd4a,_0x4fd91a){_0x4fd91a=_0x4fd91a||0xc8;return function(_0x50eeca){if(_0x50eeca){return _0x46dd4a['status'](_0x4fd91a)[_0x7bdb('0x18')](_0x50eeca);}};}function respondWithFilteredResult(_0x195b2e,_0xe9919f){return function(_0x25d417){if(_0x25d417){var _0x31c909=typeof _0xe9919f[_0x7bdb('0x19')]===_0x7bdb('0x1a')&&typeof _0xe9919f[_0x7bdb('0x1b')]==='undefined';var _0x1c5750=_0x25d417[_0x7bdb('0x1c')];var _0x5723f4=_0x31c909?0x0:_0xe9919f[_0x7bdb('0x19')];var _0x4ffd4b=_0x31c909?_0x25d417[_0x7bdb('0x1c')]:_0xe9919f[_0x7bdb('0x19')]+_0xe9919f['limit'];var _0x3e5f8e;if(_0x4ffd4b>=_0x1c5750){_0x4ffd4b=_0x1c5750;_0x3e5f8e=0xc8;}else{_0x3e5f8e=0xce;}_0x195b2e[_0x7bdb('0x1d')](_0x3e5f8e);return _0x195b2e[_0x7bdb('0x1e')](_0x7bdb('0x1f'),_0x5723f4+'-'+_0x4ffd4b+'/'+_0x1c5750)[_0x7bdb('0x18')](_0x25d417);}return null;};}function patchUpdates(_0x5bfc35){return function(_0x49f353){try{jsonpatch[_0x7bdb('0x20')](_0x49f353,_0x5bfc35,!![]);}catch(_0xcb25f2){return BPromise['reject'](_0xcb25f2);}return _0x49f353[_0x7bdb('0x21')]();};}function saveUpdates(_0x118ea1,_0x346c72){return function(_0x3f53e7){if(_0x3f53e7){return _0x3f53e7[_0x7bdb('0x22')](_0x118ea1)['then'](function(_0x1d37ac){return _0x1d37ac;});}return null;};}function removeEntity(_0xdad53d,_0x40c447){return function(_0x3a456f){if(_0x3a456f){return _0x3a456f['destroy']()['then'](function(){_0xdad53d[_0x7bdb('0x1d')](0xcc)['end']();});}};}function handleEntityNotFound(_0x47abaf,_0x4a9e02){return function(_0x2abef6){if(!_0x2abef6){_0x47abaf['sendStatus'](0x194);}return _0x2abef6;};}function handleError(_0x2b14bc,_0x72ba69){_0x72ba69=_0x72ba69||0x1f4;return function(_0x3ec129){logger[_0x7bdb('0x23')](_0x3ec129[_0x7bdb('0x24')]);if(_0x3ec129['name']){delete _0x3ec129[_0x7bdb('0x25')];}_0x2b14bc[_0x7bdb('0x1d')](_0x72ba69)[_0x7bdb('0x26')](_0x3ec129);};}exports[_0x7bdb('0x27')]=function(_0x371e8a,_0x2e8e65){var _0x1e9996={'raw':!![],'where':{'id':_0x371e8a[_0x7bdb('0x28')]['id']}},_0xd2d7be={};_0xd2d7be[_0x7bdb('0x29')]=_[_0x7bdb('0x2a')](db[_0x7bdb('0x2b')]['rawAttributes']);_0xd2d7be[_0x7bdb('0x2c')]=_[_0x7bdb('0x2a')](_0x371e8a[_0x7bdb('0x2c')]);_0xd2d7be[_0x7bdb('0x2d')]=_[_0x7bdb('0x2e')](_0xd2d7be['model'],_0xd2d7be[_0x7bdb('0x2c')]);_0x1e9996[_0x7bdb('0x2f')]=_[_0x7bdb('0x2e')](_0xd2d7be[_0x7bdb('0x29')],qs['fields'](_0x371e8a['query']['fields']));_0x1e9996[_0x7bdb('0x2f')]=_0x1e9996['attributes'][_0x7bdb('0x30')]?_0x1e9996['attributes']:_0xd2d7be[_0x7bdb('0x29')];if(_0x371e8a[_0x7bdb('0x2c')][_0x7bdb('0x31')]){_0x1e9996['include']=[{'all':!![]}];}_0x1e9996=_[_0x7bdb('0x32')]({},_0x1e9996,_0x371e8a['options']);return db['ChatApplication'][_0x7bdb('0x33')](_0x1e9996)['then'](handleEntityNotFound(_0x2e8e65,null))[_0x7bdb('0x34')](respondWithResult(_0x2e8e65,null))['catch'](handleError(_0x2e8e65,null));};exports['update']=function(_0x206c26,_0x353b26){if(_0x206c26[_0x7bdb('0x35')]['id']){delete _0x206c26[_0x7bdb('0x35')]['id'];}return db[_0x7bdb('0x2b')][_0x7bdb('0x33')]({'where':{'id':_0x206c26['params']['id']}})[_0x7bdb('0x34')](handleEntityNotFound(_0x353b26,null))[_0x7bdb('0x34')](saveUpdates(_0x206c26[_0x7bdb('0x35')],null))[_0x7bdb('0x34')](respondWithResult(_0x353b26,null))[_0x7bdb('0x36')](handleError(_0x353b26,null));};exports[_0x7bdb('0x37')]=function(_0x228340,_0x2587af){return db[_0x7bdb('0x2b')]['find']({'where':{'id':_0x228340['params']['id']}})[_0x7bdb('0x34')](handleEntityNotFound(_0x2587af,null))[_0x7bdb('0x34')](removeEntity(_0x2587af,null))[_0x7bdb('0x36')](handleError(_0x2587af,null));};
\ No newline at end of file
diff --git a/server/api/chatApplication/chatApplication.model.js b/server/api/chatApplication/chatApplication.model.js
index 8af963e..1f53bfc 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 _0xc964=['bluebird','path','../../config/environment','./chatApplication.attributes','exports','define','ChatApplication','utf8mb4','utf8mb4_unicode_ci','lodash','util','api','moment'];(function(_0x3efdaa,_0x236adf){var _0x1848f7=function(_0x4f0c23){while(--_0x4f0c23){_0x3efdaa['push'](_0x3efdaa['shift']());}};_0x1848f7(++_0x236adf);}(_0xc964,0x7e));var _0x4c96=function(_0x468fbf,_0x385efe){_0x468fbf=_0x468fbf-0x0;var _0x4a7892=_0xc964[_0x468fbf];return _0x4a7892;};'use strict';var _=require(_0x4c96('0x0'));var util=require(_0x4c96('0x1'));var logger=require('../../config/logger')(_0x4c96('0x2'));var moment=require(_0x4c96('0x3'));var BPromise=require(_0x4c96('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x4c96('0x5'));var rimraf=require('rimraf');var config=require(_0x4c96('0x6'));var attributes=require(_0x4c96('0x7'));module[_0x4c96('0x8')]=function(_0x2f6461,_0x45bb27){return _0x2f6461[_0x4c96('0x9')](_0x4c96('0xa'),attributes,{'tableName':'chat_applications','paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x4c96('0xb'),'collate':_0x4c96('0xc')});};
\ No newline at end of file
+var _0x7aa2=['../../config/logger','api','moment','bluebird','request-promise','rimraf','../../config/environment','./chatApplication.attributes','define','ChatApplication','chat_applications','utf8mb4','lodash','util'];(function(_0x157773,_0x1e7c8a){var _0x23ee38=function(_0x152598){while(--_0x152598){_0x157773['push'](_0x157773['shift']());}};_0x23ee38(++_0x1e7c8a);}(_0x7aa2,0x132));var _0x27aa=function(_0x534f7c,_0x3eb489){_0x534f7c=_0x534f7c-0x0;var _0x5c3e22=_0x7aa2[_0x534f7c];return _0x5c3e22;};'use strict';var _=require(_0x27aa('0x0'));var util=require(_0x27aa('0x1'));var logger=require(_0x27aa('0x2'))(_0x27aa('0x3'));var moment=require(_0x27aa('0x4'));var BPromise=require(_0x27aa('0x5'));var rp=require(_0x27aa('0x6'));var fs=require('fs');var path=require('path');var rimraf=require(_0x27aa('0x7'));var config=require(_0x27aa('0x8'));var attributes=require(_0x27aa('0x9'));module['exports']=function(_0x2eb905,_0x29fcb7){return _0x2eb905[_0x27aa('0xa')](_0x27aa('0xb'),attributes,{'tableName':_0x27aa('0xc'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x27aa('0xd'),'collate':'utf8mb4_unicode_ci'});};
\ No newline at end of file
diff --git a/server/api/chatApplication/chatApplication.rpc.js b/server/api/chatApplication/chatApplication.rpc.js
index d6eaec7..67e1fcc 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 _0x4568=['lodash','moment','bluebird','randomstring','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','http','info','ChatApplication,\x20%s,\x20%s','request\x20sent','debug','ChatApplication,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch'];(function(_0x38c7d8,_0x253557){var _0x266426=function(_0x2f727b){while(--_0x2f727b){_0x38c7d8['push'](_0x38c7d8['shift']());}};_0x266426(++_0x253557);}(_0x4568,0x154));var _0x8456=function(_0xbf8ebe,_0x3b69a5){_0xbf8ebe=_0xbf8ebe-0x0;var _0x1e25e8=_0x4568[_0xbf8ebe];return _0x1e25e8;};'use strict';var _=require(_0x8456('0x0'));var util=require('util');var moment=require(_0x8456('0x1'));var BPromise=require(_0x8456('0x2'));var rs=require(_0x8456('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x8456('0x4'))['db'];var utils=require(_0x8456('0x5'));var logger=require('../../config/logger')(_0x8456('0x6'));var config=require(_0x8456('0x7'));var jayson=require(_0x8456('0x8'));var client=jayson['client'][_0x8456('0x9')]({'port':0x232a});function respondWithRpcPromise(_0xf78b1f,_0x473539,_0x3165ac){return new BPromise(function(_0xc2732,_0x493c63){return client['request'](_0xf78b1f,_0x3165ac)['then'](function(_0x3c89e7){logger[_0x8456('0xa')](_0x8456('0xb'),_0x473539,_0x8456('0xc'));logger[_0x8456('0xd')](_0x8456('0xe'),_0x473539,'request\x20sent',JSON[_0x8456('0xf')](_0x3c89e7));if(_0x3c89e7[_0x8456('0x10')]){if(_0x3c89e7[_0x8456('0x10')]['code']===0x1f4){logger[_0x8456('0x10')](_0x8456('0xb'),_0x473539,_0x3c89e7[_0x8456('0x10')]['message']);return _0x493c63(_0x3c89e7[_0x8456('0x10')][_0x8456('0x11')]);}logger[_0x8456('0x10')]('ChatApplication,\x20%s,\x20%s',_0x473539,_0x3c89e7[_0x8456('0x10')][_0x8456('0x11')]);return _0xc2732(_0x3c89e7[_0x8456('0x10')][_0x8456('0x11')]);}else{logger['info'](_0x8456('0xb'),_0x473539,_0x8456('0xc'));_0xc2732(_0x3c89e7[_0x8456('0x12')][_0x8456('0x11')]);}})[_0x8456('0x13')](function(_0x4745f3){logger[_0x8456('0x10')]('ChatApplication,\x20%s,\x20%s',_0x473539,_0x4745f3);_0x493c63(_0x4745f3);});});}
\ No newline at end of file
+var _0xb9c3=['../../config/logger','jayson/promise','client','http','request','info','ChatApplication,\x20%s,\x20%s','debug','ChatApplication,\x20%s,\x20%s,\x20%s','stringify','error','code','message','request\x20sent','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils'];(function(_0x18f382,_0x520b90){var _0x1354c3=function(_0x32c2af){while(--_0x32c2af){_0x18f382['push'](_0x18f382['shift']());}};_0x1354c3(++_0x520b90);}(_0xb9c3,0x15e));var _0x3b9c=function(_0x423590,_0x62eb9e){_0x423590=_0x423590-0x0;var _0x5f5417=_0xb9c3[_0x423590];return _0x5f5417;};'use strict';var _=require(_0x3b9c('0x0'));var util=require(_0x3b9c('0x1'));var moment=require(_0x3b9c('0x2'));var BPromise=require(_0x3b9c('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x3b9c('0x4'));var db=require(_0x3b9c('0x5'))['db'];var utils=require(_0x3b9c('0x6'));var logger=require(_0x3b9c('0x7'))('rpc');var config=require('../../config/environment');var jayson=require(_0x3b9c('0x8'));var client=jayson[_0x3b9c('0x9')][_0x3b9c('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x2eedc0,_0x449d90,_0x55d572){return new BPromise(function(_0x1ee8ae,_0x4fa601){return client[_0x3b9c('0xb')](_0x2eedc0,_0x55d572)['then'](function(_0x363fc9){logger[_0x3b9c('0xc')](_0x3b9c('0xd'),_0x449d90,'request\x20sent');logger[_0x3b9c('0xe')](_0x3b9c('0xf'),_0x449d90,'request\x20sent',JSON[_0x3b9c('0x10')](_0x363fc9));if(_0x363fc9[_0x3b9c('0x11')]){if(_0x363fc9[_0x3b9c('0x11')][_0x3b9c('0x12')]===0x1f4){logger[_0x3b9c('0x11')]('ChatApplication,\x20%s,\x20%s',_0x449d90,_0x363fc9[_0x3b9c('0x11')][_0x3b9c('0x13')]);return _0x4fa601(_0x363fc9[_0x3b9c('0x11')][_0x3b9c('0x13')]);}logger[_0x3b9c('0x11')](_0x3b9c('0xd'),_0x449d90,_0x363fc9[_0x3b9c('0x11')][_0x3b9c('0x13')]);return _0x1ee8ae(_0x363fc9['error']['message']);}else{logger[_0x3b9c('0xc')](_0x3b9c('0xd'),_0x449d90,_0x3b9c('0x14'));_0x1ee8ae(_0x363fc9['result']['message']);}})['catch'](function(_0x1e3841){logger[_0x3b9c('0x11')](_0x3b9c('0xd'),_0x449d90,_0x1e3841);_0x4fa601(_0x1e3841);});});}
\ No newline at end of file
diff --git a/server/api/chatApplication/index.js b/server/api/chatApplication/index.js
index f332bdb..f4601f2 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 _0xdad1=['delete','exports','multer','path','connect-timeout','Router','../../components/auth/service','../../components/interaction/service','./chatApplication.controller','get','/:id','isAuthenticated','show','put','update'];(function(_0x278e3c,_0x1c9cfd){var _0x3e2d9b=function(_0x34d928){while(--_0x34d928){_0x278e3c['push'](_0x278e3c['shift']());}};_0x3e2d9b(++_0x1c9cfd);}(_0xdad1,0xb6));var _0x1dad=function(_0x1ceaed,_0x2cac3d){_0x1ceaed=_0x1ceaed-0x0;var _0x1d9dd0=_0xdad1[_0x1ceaed];return _0x1d9dd0;};'use strict';var multer=require(_0x1dad('0x0'));var util=require('util');var path=require(_0x1dad('0x1'));var timeout=require(_0x1dad('0x2'));var express=require('express');var router=express[_0x1dad('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x1dad('0x4'));var interaction=require(_0x1dad('0x5'));var config=require('../../config/environment');var controller=require(_0x1dad('0x6'));router[_0x1dad('0x7')](_0x1dad('0x8'),auth[_0x1dad('0x9')](),controller[_0x1dad('0xa')]);router[_0x1dad('0xb')](_0x1dad('0x8'),auth[_0x1dad('0x9')](),controller[_0x1dad('0xc')]);router[_0x1dad('0xd')](_0x1dad('0x8'),auth[_0x1dad('0x9')](),controller['destroy']);module[_0x1dad('0xe')]=router;
\ No newline at end of file
+var _0x2fb2=['delete','exports','multer','util','connect-timeout','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatApplication.controller','get','/:id','put','isAuthenticated','update'];(function(_0x261b6d,_0x24a00f){var _0x224e30=function(_0x5c2ef8){while(--_0x5c2ef8){_0x261b6d['push'](_0x261b6d['shift']());}};_0x224e30(++_0x24a00f);}(_0x2fb2,0x89));var _0x22fb=function(_0x47719b,_0x1f88bd){_0x47719b=_0x47719b-0x0;var _0xfe13df=_0x2fb2[_0x47719b];return _0xfe13df;};'use strict';var multer=require(_0x22fb('0x0'));var util=require(_0x22fb('0x1'));var path=require('path');var timeout=require(_0x22fb('0x2'));var express=require('express');var router=express[_0x22fb('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x22fb('0x4'));var interaction=require(_0x22fb('0x5'));var config=require(_0x22fb('0x6'));var controller=require(_0x22fb('0x7'));router[_0x22fb('0x8')](_0x22fb('0x9'),auth['isAuthenticated'](),controller['show']);router[_0x22fb('0xa')]('/:id',auth[_0x22fb('0xb')](),controller[_0x22fb('0xc')]);router[_0x22fb('0xd')](_0x22fb('0x9'),auth[_0x22fb('0xb')](),controller['destroy']);module[_0x22fb('0xe')]=router;
\ No newline at end of file
diff --git a/server/api/chatGroup/chatGroup.attributes.js b/server/api/chatGroup/chatGroup.attributes.js
index c012cf3..dff50b8 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 _0x242e=['STRING','sequelize'];(function(_0x2e46d1,_0x38899a){var _0xd9f1c1=function(_0x3d66fa){while(--_0x3d66fa){_0x2e46d1['push'](_0x2e46d1['shift']());}};_0xd9f1c1(++_0x38899a);}(_0x242e,0x12f));var _0xe242=function(_0x59ee6f,_0x450239){_0x59ee6f=_0x59ee6f-0x0;var _0x4c0979=_0x242e[_0x59ee6f];return _0x4c0979;};'use strict';var Sequelize=require(_0xe242('0x0'));module['exports']={'name':{'type':Sequelize[_0xe242('0x1')],'allowNull':![]},'description':{'type':Sequelize[_0xe242('0x1')]},'write':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]}};
\ No newline at end of file
+var _0xccd1=['STRING','BOOLEAN','sequelize','exports'];(function(_0x217a49,_0x2b1903){var _0x46872c=function(_0x58ef3a){while(--_0x58ef3a){_0x217a49['push'](_0x217a49['shift']());}};_0x46872c(++_0x2b1903);}(_0xccd1,0x66));var _0x1ccd=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xccd1[_0x3dd15e];return _0x231fd0;};'use strict';var Sequelize=require(_0x1ccd('0x0'));module[_0x1ccd('0x1')]={'name':{'type':Sequelize[_0x1ccd('0x2')],'allowNull':![]},'description':{'type':Sequelize[_0x1ccd('0x2')]},'write':{'type':Sequelize[_0x1ccd('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 a344857..562a9ea 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 _0x48f8=['options','includeAll','include','rows','catch','show','params','find','create','body','describe','getUnread','ChatInternalMessage','user','addMembers','ids','omit','findOne','order','getMembers','nolimit','removeMembers','addMessage','ChatGroupId','$gte','format','getMessages','eml-format','zip-dir','fast-json-patch','request-promise','bluebird','util','path','sox','to-csv','ejs','lodash','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','../../mysqldb','redis','sendStatus','end','status','json','offset','undefined','limit','count','Content-Range','apply','reject','update','then','destroy','error','name','send','index','map','ChatGroup','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','sort','where','pick','filter','VIRTUAL','merge'];(function(_0x37ef93,_0x8b26a6){var _0xa47012=function(_0x4c2ad8){while(--_0x4c2ad8){_0x37ef93['push'](_0x37ef93['shift']());}};_0xa47012(++_0x8b26a6);}(_0x48f8,0x18f));var _0x848f=function(_0x106d51,_0x2eb27c){_0x106d51=_0x106d51-0x0;var _0x1924b9=_0x48f8[_0x106d51];return _0x1924b9;};'use strict';var emlformat=require(_0x848f('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x848f('0x1'));var jsonpatch=require(_0x848f('0x2'));var rp=require(_0x848f('0x3'));var moment=require('moment');var BPromise=require(_0x848f('0x4'));var Mustache=require('mustache');var util=require(_0x848f('0x5'));var path=require(_0x848f('0x6'));var sox=require(_0x848f('0x7'));var csv=require(_0x848f('0x8'));var ejs=require(_0x848f('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x848f('0xa'));var squel=require('squel');var crypto=require(_0x848f('0xb'));var jsforce=require(_0x848f('0xc'));var deskjs=require(_0x848f('0xd'));var toCsv=require(_0x848f('0x8'));var querystring=require(_0x848f('0xe'));var Papa=require(_0x848f('0xf'));var Redis=require(_0x848f('0x10'));var authService=require(_0x848f('0x11'));var qs=require(_0x848f('0x12'));var as=require(_0x848f('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x848f('0x14'))(_0x848f('0x15'));var utils=require(_0x848f('0x16'));var config=require(_0x848f('0x17'));var licenseUtil=require(_0x848f('0x18'));var db=require(_0x848f('0x19'))['db'];config['redis']=_['defaults'](config[_0x848f('0x1a')],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x848f('0x1a')]));require('./chatGroup.socket')['register'](socket);function respondWithStatusCode(_0xdbc693,_0x2b6546){_0x2b6546=_0x2b6546||0xcc;return function(_0x17cbe3){if(_0x17cbe3){return _0xdbc693[_0x848f('0x1b')](_0x2b6546);}return _0xdbc693['status'](_0x2b6546)[_0x848f('0x1c')]();};}function respondWithResult(_0x57ae7b,_0x240c98){_0x240c98=_0x240c98||0xc8;return function(_0x5009cc){if(_0x5009cc){return _0x57ae7b[_0x848f('0x1d')](_0x240c98)[_0x848f('0x1e')](_0x5009cc);}};}function respondWithFilteredResult(_0x674dd2,_0x324a93){return function(_0x497cc3){if(_0x497cc3){var _0x3771b3=typeof _0x324a93[_0x848f('0x1f')]===_0x848f('0x20')&&typeof _0x324a93[_0x848f('0x21')]===_0x848f('0x20');var _0x2f79fd=_0x497cc3[_0x848f('0x22')];var _0x53081e=_0x3771b3?0x0:_0x324a93['offset'];var _0x5d88e0=_0x3771b3?_0x497cc3[_0x848f('0x22')]:_0x324a93['offset']+_0x324a93['limit'];var _0x4d5667;if(_0x5d88e0>=_0x2f79fd){_0x5d88e0=_0x2f79fd;_0x4d5667=0xc8;}else{_0x4d5667=0xce;}_0x674dd2[_0x848f('0x1d')](_0x4d5667);return _0x674dd2['set'](_0x848f('0x23'),_0x53081e+'-'+_0x5d88e0+'/'+_0x2f79fd)['json'](_0x497cc3);}return null;};}function patchUpdates(_0x51817e){return function(_0x3db3c7){try{jsonpatch[_0x848f('0x24')](_0x3db3c7,_0x51817e,!![]);}catch(_0x4e5976){return BPromise[_0x848f('0x25')](_0x4e5976);}return _0x3db3c7['save']();};}function saveUpdates(_0x389fbe,_0x3fa759){return function(_0x23917a){if(_0x23917a){return _0x23917a[_0x848f('0x26')](_0x389fbe)[_0x848f('0x27')](function(_0x1772ce){return _0x1772ce;});}return null;};}function removeEntity(_0x2e3d70,_0x115f6e){return function(_0x3a0328){if(_0x3a0328){return _0x3a0328[_0x848f('0x28')]()[_0x848f('0x27')](function(){_0x2e3d70[_0x848f('0x1d')](0xcc)['end']();});}};}function handleEntityNotFound(_0x3313b7,_0x5de048){return function(_0x19815c){if(!_0x19815c){_0x3313b7[_0x848f('0x1b')](0x194);}return _0x19815c;};}function handleError(_0x32c0a3,_0x535e35){_0x535e35=_0x535e35||0x1f4;return function(_0x457265){logger[_0x848f('0x29')](_0x457265['stack']);if(_0x457265[_0x848f('0x2a')]){delete _0x457265['name'];}_0x32c0a3['status'](_0x535e35)[_0x848f('0x2b')](_0x457265);};}exports[_0x848f('0x2c')]=function(_0x1b3950,_0x1a3d46){var _0x39884f={},_0x1d2892={},_0x90f1ce={'count':0x0,'rows':[]};var _0x4f5741=_[_0x848f('0x2d')](db[_0x848f('0x2e')][_0x848f('0x2f')],function(_0x54cec9){return{'name':_0x54cec9[_0x848f('0x30')],'type':_0x54cec9[_0x848f('0x31')][_0x848f('0x32')]};});_0x1d2892[_0x848f('0x33')]=_[_0x848f('0x2d')](_0x4f5741,_0x848f('0x2a'));_0x1d2892[_0x848f('0x34')]=_[_0x848f('0x35')](_0x1b3950[_0x848f('0x34')]);_0x1d2892[_0x848f('0x36')]=_[_0x848f('0x37')](_0x1d2892[_0x848f('0x33')],_0x1d2892[_0x848f('0x34')]);_0x39884f[_0x848f('0x38')]=_[_0x848f('0x37')](_0x1d2892[_0x848f('0x33')],qs['fields'](_0x1b3950[_0x848f('0x34')][_0x848f('0x39')]));_0x39884f[_0x848f('0x38')]=_0x39884f[_0x848f('0x38')][_0x848f('0x3a')]?_0x39884f[_0x848f('0x38')]:_0x1d2892[_0x848f('0x33')];if(!_0x1b3950[_0x848f('0x34')][_0x848f('0x3b')]('nolimit')){_0x39884f[_0x848f('0x21')]=qs['limit'](_0x1b3950[_0x848f('0x34')][_0x848f('0x21')]);_0x39884f[_0x848f('0x1f')]=qs[_0x848f('0x1f')](_0x1b3950[_0x848f('0x34')]['offset']);}_0x39884f['order']=qs['sort'](_0x1b3950[_0x848f('0x34')][_0x848f('0x3c')]);_0x39884f[_0x848f('0x3d')]=qs[_0x848f('0x36')](_[_0x848f('0x3e')](_0x1b3950[_0x848f('0x34')],_0x1d2892['filters']),_0x4f5741);if(_0x1b3950[_0x848f('0x34')][_0x848f('0x3f')]){_0x39884f[_0x848f('0x3d')]=_['merge'](_0x39884f[_0x848f('0x3d')],{'$or':_[_0x848f('0x2d')](_0x4f5741,function(_0x4aff69){if(_0x4aff69[_0x848f('0x31')]!==_0x848f('0x40')){var _0x11f6b3={};_0x11f6b3[_0x4aff69['name']]={'$like':'%'+_0x1b3950[_0x848f('0x34')][_0x848f('0x3f')]+'%'};return _0x11f6b3;}})});}_0x39884f=_[_0x848f('0x41')]({},_0x39884f,_0x1b3950[_0x848f('0x42')]);var _0x5bf0f1={'where':_0x39884f[_0x848f('0x3d')]};return db[_0x848f('0x2e')][_0x848f('0x22')](_0x5bf0f1)[_0x848f('0x27')](function(_0x387c33){_0x90f1ce['count']=_0x387c33;if(_0x1b3950[_0x848f('0x34')][_0x848f('0x43')]){_0x39884f[_0x848f('0x44')]=[{'all':!![]}];}return db[_0x848f('0x2e')]['findAll'](_0x39884f);})[_0x848f('0x27')](function(_0x215a0f){_0x90f1ce[_0x848f('0x45')]=_0x215a0f;return _0x90f1ce;})['then'](respondWithFilteredResult(_0x1a3d46,_0x39884f))[_0x848f('0x46')](handleError(_0x1a3d46,null));};exports[_0x848f('0x47')]=function(_0x34ea88,_0x398333){var _0x3c1de3={'raw':!![],'where':{'id':_0x34ea88[_0x848f('0x48')]['id']}},_0x2c15e5={};_0x2c15e5[_0x848f('0x33')]=_[_0x848f('0x35')](db[_0x848f('0x2e')][_0x848f('0x2f')]);_0x2c15e5['query']=_[_0x848f('0x35')](_0x34ea88[_0x848f('0x34')]);_0x2c15e5[_0x848f('0x36')]=_[_0x848f('0x37')](_0x2c15e5[_0x848f('0x33')],_0x2c15e5['query']);_0x3c1de3[_0x848f('0x38')]=_[_0x848f('0x37')](_0x2c15e5[_0x848f('0x33')],qs[_0x848f('0x39')](_0x34ea88[_0x848f('0x34')][_0x848f('0x39')]));_0x3c1de3[_0x848f('0x38')]=_0x3c1de3['attributes'][_0x848f('0x3a')]?_0x3c1de3[_0x848f('0x38')]:_0x2c15e5[_0x848f('0x33')];if(_0x34ea88['query'][_0x848f('0x43')]){_0x3c1de3[_0x848f('0x44')]=[{'all':!![]}];}_0x3c1de3=_[_0x848f('0x41')]({},_0x3c1de3,_0x34ea88[_0x848f('0x42')]);return db[_0x848f('0x2e')][_0x848f('0x49')](_0x3c1de3)['then'](handleEntityNotFound(_0x398333,null))[_0x848f('0x27')](respondWithResult(_0x398333,null))[_0x848f('0x46')](handleError(_0x398333,null));};exports[_0x848f('0x4a')]=function(_0x168f81,_0x110f91){return db['ChatGroup']['create'](_0x168f81[_0x848f('0x4b')],{})[_0x848f('0x27')](respondWithResult(_0x110f91,0xc9))[_0x848f('0x46')](handleError(_0x110f91,null));};exports['update']=function(_0x3d28d2,_0x561141){if(_0x3d28d2[_0x848f('0x4b')]['id']){delete _0x3d28d2[_0x848f('0x4b')]['id'];}return db[_0x848f('0x2e')][_0x848f('0x49')]({'where':{'id':_0x3d28d2[_0x848f('0x48')]['id']}})[_0x848f('0x27')](handleEntityNotFound(_0x561141,null))['then'](saveUpdates(_0x3d28d2['body'],null))['then'](respondWithResult(_0x561141,null))['catch'](handleError(_0x561141,null));};exports[_0x848f('0x28')]=function(_0x24dc45,_0x3d1505){return db[_0x848f('0x2e')]['find']({'where':{'id':_0x24dc45[_0x848f('0x48')]['id']}})[_0x848f('0x27')](handleEntityNotFound(_0x3d1505,null))['then'](removeEntity(_0x3d1505,null))[_0x848f('0x46')](handleError(_0x3d1505,null));};exports[_0x848f('0x4c')]=function(_0x23631d,_0x317bf8){return db[_0x848f('0x2e')][_0x848f('0x4c')]()[_0x848f('0x27')](respondWithResult(_0x317bf8,null))[_0x848f('0x46')](handleError(_0x317bf8,null));};exports[_0x848f('0x4d')]=function(_0x5d4b61,_0x5dad98,_0x4d400a){return db[_0x848f('0x4e')][_0x848f('0x22')]({'where':{'ChatGroupId':_0x5d4b61['params']['id'],'ToId':_0x5d4b61[_0x848f('0x4f')]['id'],'read':![]}})[_0x848f('0x27')](function(_0x5dccb1){return{'id':_['toInteger'](_0x5d4b61[_0x848f('0x48')]['id']),'count':_0x5dccb1};})['then'](respondWithResult(_0x5dad98,null))[_0x848f('0x46')](handleError(_0x5dad98,null));};exports[_0x848f('0x50')]=function(_0x3c1309,_0x1bac0a,_0x18d391){return db[_0x848f('0x2e')][_0x848f('0x49')]({'where':{'id':_0x3c1309[_0x848f('0x48')]['id']}})[_0x848f('0x27')](handleEntityNotFound(_0x1bac0a,null))[_0x848f('0x27')](function(_0x27074c){if(_0x27074c){return _0x27074c[_0x848f('0x50')](_0x3c1309[_0x848f('0x4b')][_0x848f('0x51')],_[_0x848f('0x52')](_0x3c1309['body'],[_0x848f('0x51'),'id'])||{});}})[_0x848f('0x27')](respondWithResult(_0x1bac0a,null))['catch'](handleError(_0x1bac0a,null));};exports['getMembers']=function(_0x313477,_0x374ae5,_0xa387e3){var _0x1c596f={};var _0x29c6a5={};var _0x377361;var _0x3a93b6;return db[_0x848f('0x2e')][_0x848f('0x53')]({'where':{'id':_0x313477[_0x848f('0x48')]['id']}})[_0x848f('0x27')](handleEntityNotFound(_0x374ae5,null))[_0x848f('0x27')](function(_0x2667d2){if(_0x2667d2){_0x377361=_0x2667d2;_0x29c6a5[_0x848f('0x33')]=_[_0x848f('0x35')](db['User'][_0x848f('0x2f')]);_0x29c6a5['query']=_[_0x848f('0x35')](_0x313477['query']);_0x29c6a5[_0x848f('0x36')]=_[_0x848f('0x37')](_0x29c6a5[_0x848f('0x33')],_0x29c6a5['query']);_0x1c596f[_0x848f('0x38')]=_[_0x848f('0x37')](_0x29c6a5[_0x848f('0x33')],qs['fields'](_0x313477[_0x848f('0x34')][_0x848f('0x39')]));_0x1c596f[_0x848f('0x38')]=_0x1c596f[_0x848f('0x38')][_0x848f('0x3a')]?_0x1c596f['attributes']:_0x29c6a5['model'];_0x1c596f[_0x848f('0x54')]=qs[_0x848f('0x3c')](_0x313477['query'][_0x848f('0x3c')]);_0x1c596f['where']=qs[_0x848f('0x36')](_[_0x848f('0x3e')](_0x313477[_0x848f('0x34')],_0x29c6a5['filters']));if(_0x313477[_0x848f('0x34')]['filter']){_0x1c596f['where']=_[_0x848f('0x41')](_0x1c596f[_0x848f('0x3d')],{'$or':_[_0x848f('0x2d')](_0x1c596f[_0x848f('0x38')],function(_0x103eef){var _0x3d481f={};_0x3d481f[_0x103eef]={'$like':'%'+_0x313477[_0x848f('0x34')]['filter']+'%'};return _0x3d481f;})});}_0x1c596f=_[_0x848f('0x41')]({},_0x1c596f,_0x313477[_0x848f('0x42')]);return _0x377361[_0x848f('0x55')](_0x1c596f);}})[_0x848f('0x27')](function(_0x1dc500){if(_0x1dc500){_0x3a93b6=_0x1dc500[_0x848f('0x3a')];if(!_0x313477[_0x848f('0x34')]['hasOwnProperty'](_0x848f('0x56'))){_0x1c596f[_0x848f('0x21')]=qs['limit'](_0x313477[_0x848f('0x34')][_0x848f('0x21')]);_0x1c596f[_0x848f('0x1f')]=qs[_0x848f('0x1f')](_0x313477[_0x848f('0x34')][_0x848f('0x1f')]);}return _0x377361[_0x848f('0x55')](_0x1c596f);}})[_0x848f('0x27')](function(_0x26071d){if(_0x26071d){return _0x26071d?{'count':_0x3a93b6,'rows':_0x26071d}:null;}})[_0x848f('0x27')](respondWithResult(_0x374ae5,null))[_0x848f('0x46')](handleError(_0x374ae5,null));};exports[_0x848f('0x57')]=function(_0x209da5,_0x72e699,_0x55d719){return db['ChatGroup'][_0x848f('0x49')]({'where':{'id':_0x209da5[_0x848f('0x48')]['id']}})[_0x848f('0x27')](handleEntityNotFound(_0x72e699,null))[_0x848f('0x27')](function(_0x2c6466){if(_0x2c6466){return _0x2c6466[_0x848f('0x57')](_0x209da5[_0x848f('0x34')]['ids']);}})[_0x848f('0x27')](respondWithStatusCode(_0x72e699,null))[_0x848f('0x46')](handleError(_0x72e699,null));};exports[_0x848f('0x58')]=function(_0x439b6d,_0x1d70d8,_0x4be3a6){if(_0x439b6d[_0x848f('0x4b')]['id']){delete _0x439b6d['body']['id'];}return db['ChatGroup']['find']({'where':{'id':_0x439b6d[_0x848f('0x48')]['id']}})['then'](handleEntityNotFound(_0x1d70d8,null))['then'](function(_0x29d974){if(_0x29d974){_0x439b6d[_0x848f('0x4b')][_0x848f('0x59')]=_0x29d974['id'];return db[_0x848f('0x4e')]['create'](_0x439b6d[_0x848f('0x4b')]);}})[_0x848f('0x27')](respondWithResult(_0x1d70d8,null))[_0x848f('0x46')](handleError(_0x1d70d8,null));};exports['getMessages']=function(_0x118418,_0x4898bf,_0x2f4caf){var _0x1cc371={};var _0x4929ff={};var _0x1901af;var _0x25ec71;return db[_0x848f('0x2e')][_0x848f('0x53')]({'where':{'id':_0x118418[_0x848f('0x48')]['id']}})[_0x848f('0x27')](handleEntityNotFound(_0x4898bf,null))[_0x848f('0x27')](function(_0x2d61fb){if(_0x2d61fb){_0x1901af=_0x2d61fb;_0x4929ff['model']=_['keys'](db[_0x848f('0x4e')][_0x848f('0x2f')]);_0x4929ff[_0x848f('0x34')]=_[_0x848f('0x35')](_0x118418[_0x848f('0x34')]);_0x4929ff[_0x848f('0x36')]=_[_0x848f('0x37')](_0x4929ff[_0x848f('0x33')],_0x4929ff['query']);_0x1cc371[_0x848f('0x38')]=_['intersection'](_0x4929ff[_0x848f('0x33')],qs['fields'](_0x118418[_0x848f('0x34')][_0x848f('0x39')]));_0x1cc371[_0x848f('0x38')]=_0x1cc371[_0x848f('0x38')]['length']?_0x1cc371[_0x848f('0x38')]:_0x4929ff[_0x848f('0x33')];_0x1cc371[_0x848f('0x54')]=qs[_0x848f('0x3c')](_0x118418[_0x848f('0x34')][_0x848f('0x3c')]);_0x1cc371[_0x848f('0x3d')]=qs[_0x848f('0x36')](_[_0x848f('0x3e')](_0x118418[_0x848f('0x34')],_0x4929ff[_0x848f('0x36')]));if(_0x118418[_0x848f('0x34')]['filter']){_0x1cc371[_0x848f('0x3d')]=_[_0x848f('0x41')](_0x1cc371[_0x848f('0x3d')],{'$or':_[_0x848f('0x2d')](_0x1cc371[_0x848f('0x38')],function(_0x50db42){var _0x210f91={};_0x210f91[_0x50db42]={'$like':'%'+_0x118418['query'][_0x848f('0x3f')]+'%'};return _0x210f91;})});}if(_0x118418['query'][_0x848f('0x5a')]){var _0xcb52af=_0x118418[_0x848f('0x34')][_0x848f('0x5a')]['split'](',');var _0xfc31fc={};_0xfc31fc[_0xcb52af[0x0]]={'$gte':moment(_0xcb52af[0x1])[_0x848f('0x5b')]('YYYY-MM-DD\x20HH:mm:ss')};_0x1cc371[_0x848f('0x3d')]=_['merge'](_0x1cc371['where'],_0xfc31fc);}_0x1cc371=_[_0x848f('0x41')]({},_0x1cc371,_0x118418[_0x848f('0x42')]);return _0x1901af[_0x848f('0x5c')](_0x1cc371);}})[_0x848f('0x27')](function(_0x59133a){if(_0x59133a){_0x25ec71=_0x59133a[_0x848f('0x3a')];if(!_0x118418[_0x848f('0x34')][_0x848f('0x3b')](_0x848f('0x56'))){_0x1cc371['limit']=qs['limit'](_0x118418[_0x848f('0x34')][_0x848f('0x21')]);_0x1cc371[_0x848f('0x1f')]=qs[_0x848f('0x1f')](_0x118418['query'][_0x848f('0x1f')]);}return _0x1901af[_0x848f('0x5c')](_0x1cc371);}})[_0x848f('0x27')](function(_0x28eaee){if(_0x28eaee){return _0x28eaee?{'count':_0x25ec71,'rows':_0x28eaee}:null;}})[_0x848f('0x27')](respondWithResult(_0x4898bf,null))[_0x848f('0x46')](handleError(_0x4898bf,null));};
\ No newline at end of file
+var _0xd7c2=['end','json','undefined','limit','count','offset','set','Content-Range','apply','reject','save','update','then','destroy','stack','name','send','index','map','ChatGroup','rawAttributes','fieldName','type','key','model','keys','intersection','query','attributes','length','nolimit','order','sort','filters','pick','filter','where','merge','VIRTUAL','includeAll','include','findAll','catch','show','params','fields','options','find','create','body','describe','getUnread','ChatInternalMessage','user','addMembers','ids','omit','getMembers','User','removeMembers','addMessage','ChatGroupId','getMessages','findOne','$gte','split','format','YYYY-MM-DD\x20HH:mm:ss','hasOwnProperty','rimraf','zip-dir','request-promise','mustache','util','sox','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','to-csv','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','api','../../config/environment','../../mysqldb','redis','localhost','socket.io-emitter','./chatGroup.socket','sendStatus','status'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xd7c2,0x105));var _0x2d7c=function(_0x4a4b3c,_0x42f623){_0x4a4b3c=_0x4a4b3c-0x0;var _0x126a63=_0xd7c2[_0x4a4b3c];return _0x126a63;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x2d7c('0x0'));var zipdir=require(_0x2d7c('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0x2d7c('0x2'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x2d7c('0x3'));var util=require(_0x2d7c('0x4'));var path=require('path');var sox=require(_0x2d7c('0x5'));var csv=require('to-csv');var ejs=require(_0x2d7c('0x6'));var fs=require('fs');var fs_extra=require(_0x2d7c('0x7'));var _=require(_0x2d7c('0x8'));var squel=require(_0x2d7c('0x9'));var crypto=require(_0x2d7c('0xa'));var jsforce=require(_0x2d7c('0xb'));var deskjs=require(_0x2d7c('0xc'));var toCsv=require(_0x2d7c('0xd'));var querystring=require('querystring');var Papa=require(_0x2d7c('0xe'));var Redis=require(_0x2d7c('0xf'));var authService=require('../../components/auth/service');var qs=require(_0x2d7c('0x10'));var as=require(_0x2d7c('0x11'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x2d7c('0x12'));var utils=require('../../config/utils');var config=require(_0x2d7c('0x13'));var licenseUtil=require('../../config/license/util');var db=require(_0x2d7c('0x14'))['db'];config[_0x2d7c('0x15')]=_['defaults'](config['redis'],{'host':_0x2d7c('0x16'),'port':0x18eb});var socket=require(_0x2d7c('0x17'))(new Redis(config[_0x2d7c('0x15')]));require(_0x2d7c('0x18'))['register'](socket);function respondWithStatusCode(_0x42302d,_0x31c612){_0x31c612=_0x31c612||0xcc;return function(_0x3ac978){if(_0x3ac978){return _0x42302d[_0x2d7c('0x19')](_0x31c612);}return _0x42302d[_0x2d7c('0x1a')](_0x31c612)[_0x2d7c('0x1b')]();};}function respondWithResult(_0x18cbbe,_0x2f34ae){_0x2f34ae=_0x2f34ae||0xc8;return function(_0x56b7a1){if(_0x56b7a1){return _0x18cbbe['status'](_0x2f34ae)[_0x2d7c('0x1c')](_0x56b7a1);}};}function respondWithFilteredResult(_0x292701,_0x511e3f){return function(_0x2215e3){if(_0x2215e3){var _0x563de2=typeof _0x511e3f['offset']===_0x2d7c('0x1d')&&typeof _0x511e3f[_0x2d7c('0x1e')]===_0x2d7c('0x1d');var _0xf7aa14=_0x2215e3[_0x2d7c('0x1f')];var _0x15aa4e=_0x563de2?0x0:_0x511e3f['offset'];var _0x40b48f=_0x563de2?_0x2215e3['count']:_0x511e3f[_0x2d7c('0x20')]+_0x511e3f[_0x2d7c('0x1e')];var _0x52d4a4;if(_0x40b48f>=_0xf7aa14){_0x40b48f=_0xf7aa14;_0x52d4a4=0xc8;}else{_0x52d4a4=0xce;}_0x292701['status'](_0x52d4a4);return _0x292701[_0x2d7c('0x21')](_0x2d7c('0x22'),_0x15aa4e+'-'+_0x40b48f+'/'+_0xf7aa14)[_0x2d7c('0x1c')](_0x2215e3);}return null;};}function patchUpdates(_0x330fd5){return function(_0x559b7d){try{jsonpatch[_0x2d7c('0x23')](_0x559b7d,_0x330fd5,!![]);}catch(_0xdf57a4){return BPromise[_0x2d7c('0x24')](_0xdf57a4);}return _0x559b7d[_0x2d7c('0x25')]();};}function saveUpdates(_0x26a29d,_0x32ad72){return function(_0x4e034c){if(_0x4e034c){return _0x4e034c[_0x2d7c('0x26')](_0x26a29d)[_0x2d7c('0x27')](function(_0x393c5e){return _0x393c5e;});}return null;};}function removeEntity(_0x2bfc1c,_0x2fcdde){return function(_0x4d6ffa){if(_0x4d6ffa){return _0x4d6ffa[_0x2d7c('0x28')]()['then'](function(){_0x2bfc1c[_0x2d7c('0x1a')](0xcc)[_0x2d7c('0x1b')]();});}};}function handleEntityNotFound(_0x4db89f,_0x5b6556){return function(_0x18ab36){if(!_0x18ab36){_0x4db89f[_0x2d7c('0x19')](0x194);}return _0x18ab36;};}function handleError(_0x292c3f,_0x5e3d1b){_0x5e3d1b=_0x5e3d1b||0x1f4;return function(_0x227596){logger['error'](_0x227596[_0x2d7c('0x29')]);if(_0x227596[_0x2d7c('0x2a')]){delete _0x227596[_0x2d7c('0x2a')];}_0x292c3f['status'](_0x5e3d1b)[_0x2d7c('0x2b')](_0x227596);};}exports[_0x2d7c('0x2c')]=function(_0x2fcc1a,_0x30a8fa){var _0x4035e5={},_0x3d3b1a={},_0x1696b5={'count':0x0,'rows':[]};var _0x305ba0=_[_0x2d7c('0x2d')](db[_0x2d7c('0x2e')][_0x2d7c('0x2f')],function(_0xe13a1f){return{'name':_0xe13a1f[_0x2d7c('0x30')],'type':_0xe13a1f[_0x2d7c('0x31')][_0x2d7c('0x32')]};});_0x3d3b1a[_0x2d7c('0x33')]=_[_0x2d7c('0x2d')](_0x305ba0,_0x2d7c('0x2a'));_0x3d3b1a['query']=_[_0x2d7c('0x34')](_0x2fcc1a['query']);_0x3d3b1a['filters']=_['intersection'](_0x3d3b1a[_0x2d7c('0x33')],_0x3d3b1a['query']);_0x4035e5['attributes']=_[_0x2d7c('0x35')](_0x3d3b1a[_0x2d7c('0x33')],qs['fields'](_0x2fcc1a[_0x2d7c('0x36')]['fields']));_0x4035e5[_0x2d7c('0x37')]=_0x4035e5[_0x2d7c('0x37')][_0x2d7c('0x38')]?_0x4035e5['attributes']:_0x3d3b1a[_0x2d7c('0x33')];if(!_0x2fcc1a[_0x2d7c('0x36')]['hasOwnProperty'](_0x2d7c('0x39'))){_0x4035e5['limit']=qs[_0x2d7c('0x1e')](_0x2fcc1a[_0x2d7c('0x36')]['limit']);_0x4035e5[_0x2d7c('0x20')]=qs[_0x2d7c('0x20')](_0x2fcc1a['query']['offset']);}_0x4035e5[_0x2d7c('0x3a')]=qs[_0x2d7c('0x3b')](_0x2fcc1a['query'][_0x2d7c('0x3b')]);_0x4035e5['where']=qs[_0x2d7c('0x3c')](_[_0x2d7c('0x3d')](_0x2fcc1a[_0x2d7c('0x36')],_0x3d3b1a[_0x2d7c('0x3c')]),_0x305ba0);if(_0x2fcc1a['query'][_0x2d7c('0x3e')]){_0x4035e5[_0x2d7c('0x3f')]=_[_0x2d7c('0x40')](_0x4035e5[_0x2d7c('0x3f')],{'$or':_['map'](_0x305ba0,function(_0x174932){if(_0x174932[_0x2d7c('0x31')]!==_0x2d7c('0x41')){var _0x227aa0={};_0x227aa0[_0x174932[_0x2d7c('0x2a')]]={'$like':'%'+_0x2fcc1a[_0x2d7c('0x36')][_0x2d7c('0x3e')]+'%'};return _0x227aa0;}})});}_0x4035e5=_['merge']({},_0x4035e5,_0x2fcc1a['options']);var _0x40a460={'where':_0x4035e5[_0x2d7c('0x3f')]};return db['ChatGroup'][_0x2d7c('0x1f')](_0x40a460)[_0x2d7c('0x27')](function(_0x4b571d){_0x1696b5['count']=_0x4b571d;if(_0x2fcc1a['query'][_0x2d7c('0x42')]){_0x4035e5[_0x2d7c('0x43')]=[{'all':!![]}];}return db[_0x2d7c('0x2e')][_0x2d7c('0x44')](_0x4035e5);})['then'](function(_0x3d8fb2){_0x1696b5['rows']=_0x3d8fb2;return _0x1696b5;})[_0x2d7c('0x27')](respondWithFilteredResult(_0x30a8fa,_0x4035e5))[_0x2d7c('0x45')](handleError(_0x30a8fa,null));};exports[_0x2d7c('0x46')]=function(_0x48a5e5,_0x1b150e){var _0x8e768c={'raw':!![],'where':{'id':_0x48a5e5[_0x2d7c('0x47')]['id']}},_0x33272f={};_0x33272f[_0x2d7c('0x33')]=_[_0x2d7c('0x34')](db[_0x2d7c('0x2e')][_0x2d7c('0x2f')]);_0x33272f[_0x2d7c('0x36')]=_[_0x2d7c('0x34')](_0x48a5e5[_0x2d7c('0x36')]);_0x33272f[_0x2d7c('0x3c')]=_[_0x2d7c('0x35')](_0x33272f[_0x2d7c('0x33')],_0x33272f['query']);_0x8e768c[_0x2d7c('0x37')]=_[_0x2d7c('0x35')](_0x33272f[_0x2d7c('0x33')],qs[_0x2d7c('0x48')](_0x48a5e5[_0x2d7c('0x36')][_0x2d7c('0x48')]));_0x8e768c['attributes']=_0x8e768c[_0x2d7c('0x37')][_0x2d7c('0x38')]?_0x8e768c[_0x2d7c('0x37')]:_0x33272f[_0x2d7c('0x33')];if(_0x48a5e5[_0x2d7c('0x36')][_0x2d7c('0x42')]){_0x8e768c[_0x2d7c('0x43')]=[{'all':!![]}];}_0x8e768c=_['merge']({},_0x8e768c,_0x48a5e5[_0x2d7c('0x49')]);return db['ChatGroup'][_0x2d7c('0x4a')](_0x8e768c)[_0x2d7c('0x27')](handleEntityNotFound(_0x1b150e,null))[_0x2d7c('0x27')](respondWithResult(_0x1b150e,null))[_0x2d7c('0x45')](handleError(_0x1b150e,null));};exports[_0x2d7c('0x4b')]=function(_0x227b84,_0x2db43d){return db['ChatGroup'][_0x2d7c('0x4b')](_0x227b84[_0x2d7c('0x4c')],{})[_0x2d7c('0x27')](respondWithResult(_0x2db43d,0xc9))[_0x2d7c('0x45')](handleError(_0x2db43d,null));};exports[_0x2d7c('0x26')]=function(_0x9feefa,_0x41bcd7){if(_0x9feefa[_0x2d7c('0x4c')]['id']){delete _0x9feefa[_0x2d7c('0x4c')]['id'];}return db['ChatGroup'][_0x2d7c('0x4a')]({'where':{'id':_0x9feefa[_0x2d7c('0x47')]['id']}})[_0x2d7c('0x27')](handleEntityNotFound(_0x41bcd7,null))['then'](saveUpdates(_0x9feefa[_0x2d7c('0x4c')],null))['then'](respondWithResult(_0x41bcd7,null))[_0x2d7c('0x45')](handleError(_0x41bcd7,null));};exports[_0x2d7c('0x28')]=function(_0x1b4c7a,_0xbee5d){return db['ChatGroup'][_0x2d7c('0x4a')]({'where':{'id':_0x1b4c7a[_0x2d7c('0x47')]['id']}})[_0x2d7c('0x27')](handleEntityNotFound(_0xbee5d,null))['then'](removeEntity(_0xbee5d,null))['catch'](handleError(_0xbee5d,null));};exports[_0x2d7c('0x4d')]=function(_0x36f9f8,_0x50e5ee){return db[_0x2d7c('0x2e')]['describe']()[_0x2d7c('0x27')](respondWithResult(_0x50e5ee,null))[_0x2d7c('0x45')](handleError(_0x50e5ee,null));};exports[_0x2d7c('0x4e')]=function(_0x49149f,_0x29713f,_0x2a65b3){return db[_0x2d7c('0x4f')][_0x2d7c('0x1f')]({'where':{'ChatGroupId':_0x49149f[_0x2d7c('0x47')]['id'],'ToId':_0x49149f[_0x2d7c('0x50')]['id'],'read':![]}})['then'](function(_0x298c4d){return{'id':_['toInteger'](_0x49149f[_0x2d7c('0x47')]['id']),'count':_0x298c4d};})[_0x2d7c('0x27')](respondWithResult(_0x29713f,null))['catch'](handleError(_0x29713f,null));};exports[_0x2d7c('0x51')]=function(_0x50caca,_0x6e3662,_0x4d83a3){return db[_0x2d7c('0x2e')][_0x2d7c('0x4a')]({'where':{'id':_0x50caca['params']['id']}})[_0x2d7c('0x27')](handleEntityNotFound(_0x6e3662,null))[_0x2d7c('0x27')](function(_0x5ae6e1){if(_0x5ae6e1){return _0x5ae6e1[_0x2d7c('0x51')](_0x50caca[_0x2d7c('0x4c')][_0x2d7c('0x52')],_[_0x2d7c('0x53')](_0x50caca['body'],[_0x2d7c('0x52'),'id'])||{});}})['then'](respondWithResult(_0x6e3662,null))[_0x2d7c('0x45')](handleError(_0x6e3662,null));};exports[_0x2d7c('0x54')]=function(_0x18ddce,_0x48e0bc,_0x4e2dda){var _0x3f2e28={};var _0x26ff6e={};var _0x441711;var _0x13519a;return db[_0x2d7c('0x2e')]['findOne']({'where':{'id':_0x18ddce['params']['id']}})['then'](handleEntityNotFound(_0x48e0bc,null))['then'](function(_0x587053){if(_0x587053){_0x441711=_0x587053;_0x26ff6e['model']=_['keys'](db[_0x2d7c('0x55')][_0x2d7c('0x2f')]);_0x26ff6e['query']=_[_0x2d7c('0x34')](_0x18ddce[_0x2d7c('0x36')]);_0x26ff6e['filters']=_['intersection'](_0x26ff6e[_0x2d7c('0x33')],_0x26ff6e[_0x2d7c('0x36')]);_0x3f2e28[_0x2d7c('0x37')]=_[_0x2d7c('0x35')](_0x26ff6e['model'],qs[_0x2d7c('0x48')](_0x18ddce[_0x2d7c('0x36')][_0x2d7c('0x48')]));_0x3f2e28[_0x2d7c('0x37')]=_0x3f2e28['attributes'][_0x2d7c('0x38')]?_0x3f2e28[_0x2d7c('0x37')]:_0x26ff6e[_0x2d7c('0x33')];_0x3f2e28['order']=qs[_0x2d7c('0x3b')](_0x18ddce[_0x2d7c('0x36')]['sort']);_0x3f2e28['where']=qs[_0x2d7c('0x3c')](_[_0x2d7c('0x3d')](_0x18ddce[_0x2d7c('0x36')],_0x26ff6e[_0x2d7c('0x3c')]));if(_0x18ddce['query'][_0x2d7c('0x3e')]){_0x3f2e28[_0x2d7c('0x3f')]=_[_0x2d7c('0x40')](_0x3f2e28[_0x2d7c('0x3f')],{'$or':_[_0x2d7c('0x2d')](_0x3f2e28['attributes'],function(_0x447904){var _0xb2f777={};_0xb2f777[_0x447904]={'$like':'%'+_0x18ddce['query'][_0x2d7c('0x3e')]+'%'};return _0xb2f777;})});}_0x3f2e28=_[_0x2d7c('0x40')]({},_0x3f2e28,_0x18ddce[_0x2d7c('0x49')]);return _0x441711[_0x2d7c('0x54')](_0x3f2e28);}})[_0x2d7c('0x27')](function(_0x20e631){if(_0x20e631){_0x13519a=_0x20e631[_0x2d7c('0x38')];if(!_0x18ddce[_0x2d7c('0x36')]['hasOwnProperty'](_0x2d7c('0x39'))){_0x3f2e28[_0x2d7c('0x1e')]=qs[_0x2d7c('0x1e')](_0x18ddce[_0x2d7c('0x36')][_0x2d7c('0x1e')]);_0x3f2e28[_0x2d7c('0x20')]=qs[_0x2d7c('0x20')](_0x18ddce[_0x2d7c('0x36')][_0x2d7c('0x20')]);}return _0x441711[_0x2d7c('0x54')](_0x3f2e28);}})['then'](function(_0x230267){if(_0x230267){return _0x230267?{'count':_0x13519a,'rows':_0x230267}:null;}})[_0x2d7c('0x27')](respondWithResult(_0x48e0bc,null))[_0x2d7c('0x45')](handleError(_0x48e0bc,null));};exports[_0x2d7c('0x56')]=function(_0x20a110,_0x790227,_0x5d4ba3){return db[_0x2d7c('0x2e')]['find']({'where':{'id':_0x20a110[_0x2d7c('0x47')]['id']}})[_0x2d7c('0x27')](handleEntityNotFound(_0x790227,null))['then'](function(_0x4d8c7c){if(_0x4d8c7c){return _0x4d8c7c['removeMembers'](_0x20a110[_0x2d7c('0x36')][_0x2d7c('0x52')]);}})[_0x2d7c('0x27')](respondWithStatusCode(_0x790227,null))[_0x2d7c('0x45')](handleError(_0x790227,null));};exports[_0x2d7c('0x57')]=function(_0x5364d4,_0x19ffc2,_0x168083){if(_0x5364d4['body']['id']){delete _0x5364d4['body']['id'];}return db[_0x2d7c('0x2e')]['find']({'where':{'id':_0x5364d4[_0x2d7c('0x47')]['id']}})[_0x2d7c('0x27')](handleEntityNotFound(_0x19ffc2,null))['then'](function(_0x5ebd39){if(_0x5ebd39){_0x5364d4[_0x2d7c('0x4c')][_0x2d7c('0x58')]=_0x5ebd39['id'];return db['ChatInternalMessage'][_0x2d7c('0x4b')](_0x5364d4['body']);}})[_0x2d7c('0x27')](respondWithResult(_0x19ffc2,null))[_0x2d7c('0x45')](handleError(_0x19ffc2,null));};exports[_0x2d7c('0x59')]=function(_0x798f0f,_0x1d4a23,_0x17ed2f){var _0x1f9beb={};var _0xa63c89={};var _0x16294c;var _0x205b5d;return db['ChatGroup'][_0x2d7c('0x5a')]({'where':{'id':_0x798f0f[_0x2d7c('0x47')]['id']}})[_0x2d7c('0x27')](handleEntityNotFound(_0x1d4a23,null))[_0x2d7c('0x27')](function(_0x2effbc){if(_0x2effbc){_0x16294c=_0x2effbc;_0xa63c89[_0x2d7c('0x33')]=_['keys'](db[_0x2d7c('0x4f')]['rawAttributes']);_0xa63c89[_0x2d7c('0x36')]=_[_0x2d7c('0x34')](_0x798f0f[_0x2d7c('0x36')]);_0xa63c89['filters']=_['intersection'](_0xa63c89[_0x2d7c('0x33')],_0xa63c89[_0x2d7c('0x36')]);_0x1f9beb[_0x2d7c('0x37')]=_['intersection'](_0xa63c89['model'],qs[_0x2d7c('0x48')](_0x798f0f['query']['fields']));_0x1f9beb[_0x2d7c('0x37')]=_0x1f9beb['attributes'][_0x2d7c('0x38')]?_0x1f9beb['attributes']:_0xa63c89[_0x2d7c('0x33')];_0x1f9beb[_0x2d7c('0x3a')]=qs[_0x2d7c('0x3b')](_0x798f0f[_0x2d7c('0x36')][_0x2d7c('0x3b')]);_0x1f9beb[_0x2d7c('0x3f')]=qs[_0x2d7c('0x3c')](_[_0x2d7c('0x3d')](_0x798f0f[_0x2d7c('0x36')],_0xa63c89[_0x2d7c('0x3c')]));if(_0x798f0f[_0x2d7c('0x36')]['filter']){_0x1f9beb[_0x2d7c('0x3f')]=_[_0x2d7c('0x40')](_0x1f9beb[_0x2d7c('0x3f')],{'$or':_[_0x2d7c('0x2d')](_0x1f9beb[_0x2d7c('0x37')],function(_0x34406d){var _0x367fe0={};_0x367fe0[_0x34406d]={'$like':'%'+_0x798f0f[_0x2d7c('0x36')][_0x2d7c('0x3e')]+'%'};return _0x367fe0;})});}if(_0x798f0f['query'][_0x2d7c('0x5b')]){var _0x1a71b0=_0x798f0f[_0x2d7c('0x36')][_0x2d7c('0x5b')][_0x2d7c('0x5c')](',');var _0x38e0b7={};_0x38e0b7[_0x1a71b0[0x0]]={'$gte':moment(_0x1a71b0[0x1])[_0x2d7c('0x5d')](_0x2d7c('0x5e'))};_0x1f9beb[_0x2d7c('0x3f')]=_['merge'](_0x1f9beb[_0x2d7c('0x3f')],_0x38e0b7);}_0x1f9beb=_[_0x2d7c('0x40')]({},_0x1f9beb,_0x798f0f['options']);return _0x16294c[_0x2d7c('0x59')](_0x1f9beb);}})[_0x2d7c('0x27')](function(_0x275e81){if(_0x275e81){_0x205b5d=_0x275e81[_0x2d7c('0x38')];if(!_0x798f0f['query'][_0x2d7c('0x5f')](_0x2d7c('0x39'))){_0x1f9beb[_0x2d7c('0x1e')]=qs[_0x2d7c('0x1e')](_0x798f0f[_0x2d7c('0x36')][_0x2d7c('0x1e')]);_0x1f9beb[_0x2d7c('0x20')]=qs[_0x2d7c('0x20')](_0x798f0f['query'][_0x2d7c('0x20')]);}return _0x16294c[_0x2d7c('0x59')](_0x1f9beb);}})[_0x2d7c('0x27')](function(_0x1b82b3){if(_0x1b82b3){return _0x1b82b3?{'count':_0x205b5d,'rows':_0x1b82b3}:null;}})['then'](respondWithResult(_0x1d4a23,null))[_0x2d7c('0x45')](handleError(_0x1d4a23,null));};
\ No newline at end of file
diff --git a/server/api/chatGroup/chatGroup.events.js b/server/api/chatGroup/chatGroup.events.js
index dd1165e..df899ef 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 _0x1d63=['hook','exports','events','../../mysqldb','ChatGroup','setMaxListeners','save','remove','emit'];(function(_0x2ae881,_0x1d223a){var _0x572d1e=function(_0x4b0229){while(--_0x4b0229){_0x2ae881['push'](_0x2ae881['shift']());}};_0x572d1e(++_0x1d223a);}(_0x1d63,0xa4));var _0x31d6=function(_0x165c9d,_0xedb680){_0x165c9d=_0x165c9d-0x0;var _0x294ab1=_0x1d63[_0x165c9d];return _0x294ab1;};'use strict';var EventEmitter=require(_0x31d6('0x0'));var ChatGroup=require(_0x31d6('0x1'))['db'][_0x31d6('0x2')];var ChatGroupEvents=new EventEmitter();ChatGroupEvents[_0x31d6('0x3')](0x0);var events={'afterCreate':_0x31d6('0x4'),'afterUpdate':'update','afterDestroy':_0x31d6('0x5')};function emitEvent(_0x44ebb1){return function(_0x27c1c8,_0xe4dc8b,_0x3e83c7){ChatGroupEvents[_0x31d6('0x6')](_0x44ebb1+':'+_0x27c1c8['id'],_0x27c1c8);ChatGroupEvents[_0x31d6('0x6')](_0x44ebb1,_0x27c1c8);_0x3e83c7(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];ChatGroup[_0x31d6('0x7')](e,emitEvent(event));}}module[_0x31d6('0x8')]=ChatGroupEvents;
\ No newline at end of file
+var _0x1342=['setMaxListeners','save','update','remove','emit','hasOwnProperty','exports','../../mysqldb','ChatGroup'];(function(_0x2503aa,_0x4ea0db){var _0x44f5e2=function(_0x49ca0d){while(--_0x49ca0d){_0x2503aa['push'](_0x2503aa['shift']());}};_0x44f5e2(++_0x4ea0db);}(_0x1342,0xdf));var _0x2134=function(_0x5bc0c9,_0x114157){_0x5bc0c9=_0x5bc0c9-0x0;var _0x360a78=_0x1342[_0x5bc0c9];return _0x360a78;};'use strict';var EventEmitter=require('events');var ChatGroup=require(_0x2134('0x0'))['db'][_0x2134('0x1')];var ChatGroupEvents=new EventEmitter();ChatGroupEvents[_0x2134('0x2')](0x0);var events={'afterCreate':_0x2134('0x3'),'afterUpdate':_0x2134('0x4'),'afterDestroy':_0x2134('0x5')};function emitEvent(_0x546366){return function(_0x38d110,_0x1c2628,_0x116825){ChatGroupEvents[_0x2134('0x6')](_0x546366+':'+_0x38d110['id'],_0x38d110);ChatGroupEvents['emit'](_0x546366,_0x38d110);_0x116825(null);};}for(var e in events){if(events[_0x2134('0x7')](e)){var event=events[e];ChatGroup['hook'](e,emitEvent(event));}}module[_0x2134('0x8')]=ChatGroupEvents;
\ No newline at end of file
diff --git a/server/api/chatGroup/chatGroup.model.js b/server/api/chatGroup/chatGroup.model.js
index 0ebda9a..fdcacc4 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 _0xe3ec=['moment','path','rimraf','../../config/environment','./chatGroup.attributes','define','ChatGroup','chat_groups','util','api'];(function(_0x200b50,_0x4cf547){var _0x58e759=function(_0x5cbb73){while(--_0x5cbb73){_0x200b50['push'](_0x200b50['shift']());}};_0x58e759(++_0x4cf547);}(_0xe3ec,0x1a2));var _0xce3e=function(_0x50b087,_0x29e612){_0x50b087=_0x50b087-0x0;var _0x4d4d94=_0xe3ec[_0x50b087];return _0x4d4d94;};'use strict';var _=require('lodash');var util=require(_0xce3e('0x0'));var logger=require('../../config/logger')(_0xce3e('0x1'));var moment=require(_0xce3e('0x2'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0xce3e('0x3'));var rimraf=require(_0xce3e('0x4'));var config=require(_0xce3e('0x5'));var attributes=require(_0xce3e('0x6'));module['exports']=function(_0x4508db,_0x5282b3){return _0x4508db[_0xce3e('0x7')](_0xce3e('0x8'),attributes,{'tableName':_0xce3e('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xb1d8=['./chatGroup.attributes','exports','define','chat_groups','lodash','api','moment','request-promise','path','rimraf'];(function(_0x3430aa,_0x57cd92){var _0x2ac5c=function(_0x3068dd){while(--_0x3068dd){_0x3430aa['push'](_0x3430aa['shift']());}};_0x2ac5c(++_0x57cd92);}(_0xb1d8,0x1bc));var _0x8b1d=function(_0x10411a,_0x3e47d3){_0x10411a=_0x10411a-0x0;var _0x358c23=_0xb1d8[_0x10411a];return _0x358c23;};'use strict';var _=require(_0x8b1d('0x0'));var util=require('util');var logger=require('../../config/logger')(_0x8b1d('0x1'));var moment=require(_0x8b1d('0x2'));var BPromise=require('bluebird');var rp=require(_0x8b1d('0x3'));var fs=require('fs');var path=require(_0x8b1d('0x4'));var rimraf=require(_0x8b1d('0x5'));var config=require('../../config/environment');var attributes=require(_0x8b1d('0x6'));module[_0x8b1d('0x7')]=function(_0x344b07,_0x53b802){return _0x344b07[_0x8b1d('0x8')]('ChatGroup',attributes,{'tableName':_0x8b1d('0x9'),'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 9c3707b..f1e0896 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 _0x7217=['then','info','ChatGroup,\x20%s,\x20%s','request\x20sent','ChatGroup,\x20%s,\x20%s,\x20%s','error','code','message','catch','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','./chatGroup.socket','register','request'];(function(_0x455150,_0x274121){var _0x12ca9c=function(_0x47eb22){while(--_0x47eb22){_0x455150['push'](_0x455150['shift']());}};_0x12ca9c(++_0x274121);}(_0x7217,0x19e));var _0x7721=function(_0x2b10c6,_0x185590){_0x2b10c6=_0x2b10c6-0x0;var _0x3789d2=_0x7217[_0x2b10c6];return _0x3789d2;};'use strict';var _=require(_0x7721('0x0'));var util=require('util');var moment=require(_0x7721('0x1'));var BPromise=require(_0x7721('0x2'));var rs=require(_0x7721('0x3'));var fs=require('fs');var Redis=require(_0x7721('0x4'));var db=require(_0x7721('0x5'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x7721('0x6'));var config=require(_0x7721('0x7'));var jayson=require(_0x7721('0x8'));var client=jayson[_0x7721('0x9')][_0x7721('0xa')]({'port':0x232a});config[_0x7721('0xb')]=_[_0x7721('0xc')](config[_0x7721('0xb')],{'host':_0x7721('0xd'),'port':0x18eb});var socket=require(_0x7721('0xe'))(new Redis(config[_0x7721('0xb')]));require(_0x7721('0xf'))[_0x7721('0x10')](socket);function respondWithRpcPromise(_0x138740,_0x2c3986,_0x578d59){return new BPromise(function(_0x461d1a,_0x29bc8f){return client[_0x7721('0x11')](_0x138740,_0x578d59)[_0x7721('0x12')](function(_0xa8977c){logger[_0x7721('0x13')](_0x7721('0x14'),_0x2c3986,_0x7721('0x15'));logger['debug'](_0x7721('0x16'),_0x2c3986,_0x7721('0x15'),JSON['stringify'](_0xa8977c));if(_0xa8977c[_0x7721('0x17')]){if(_0xa8977c[_0x7721('0x17')][_0x7721('0x18')]===0x1f4){logger[_0x7721('0x17')]('ChatGroup,\x20%s,\x20%s',_0x2c3986,_0xa8977c[_0x7721('0x17')][_0x7721('0x19')]);return _0x29bc8f(_0xa8977c['error']['message']);}logger['error'](_0x7721('0x14'),_0x2c3986,_0xa8977c[_0x7721('0x17')][_0x7721('0x19')]);return _0x461d1a(_0xa8977c[_0x7721('0x17')]['message']);}else{logger[_0x7721('0x13')]('ChatGroup,\x20%s,\x20%s',_0x2c3986,_0x7721('0x15'));_0x461d1a(_0xa8977c['result'][_0x7721('0x19')]);}})[_0x7721('0x1a')](function(_0x3ab5a5){logger[_0x7721('0x17')](_0x7721('0x14'),_0x2c3986,_0x3ab5a5);_0x29bc8f(_0x3ab5a5);});});}
\ No newline at end of file
+var _0x3c70=['defaults','localhost','socket.io-emitter','register','request','then','info','debug','ChatGroup,\x20%s,\x20%s,\x20%s','stringify','error','code','message','ChatGroup,\x20%s,\x20%s','request\x20sent','result','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','http','redis'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x3c70,0x10c));var _0x03c7=function(_0x34021d,_0x753aa6){_0x34021d=_0x34021d-0x0;var _0x16597b=_0x3c70[_0x34021d];return _0x16597b;};'use strict';var _=require(_0x03c7('0x0'));var util=require(_0x03c7('0x1'));var moment=require(_0x03c7('0x2'));var BPromise=require('bluebird');var rs=require(_0x03c7('0x3'));var fs=require('fs');var Redis=require(_0x03c7('0x4'));var db=require(_0x03c7('0x5'))['db'];var utils=require(_0x03c7('0x6'));var logger=require(_0x03c7('0x7'))(_0x03c7('0x8'));var config=require('../../config/environment');var jayson=require(_0x03c7('0x9'));var client=jayson['client'][_0x03c7('0xa')]({'port':0x232a});config[_0x03c7('0xb')]=_[_0x03c7('0xc')](config['redis'],{'host':_0x03c7('0xd'),'port':0x18eb});var socket=require(_0x03c7('0xe'))(new Redis(config[_0x03c7('0xb')]));require('./chatGroup.socket')[_0x03c7('0xf')](socket);function respondWithRpcPromise(_0x48c3f7,_0x103052,_0x20c6c8){return new BPromise(function(_0x57c8fb,_0x856199){return client[_0x03c7('0x10')](_0x48c3f7,_0x20c6c8)[_0x03c7('0x11')](function(_0xf98747){logger[_0x03c7('0x12')]('ChatGroup,\x20%s,\x20%s',_0x103052,'request\x20sent');logger[_0x03c7('0x13')](_0x03c7('0x14'),_0x103052,'request\x20sent',JSON[_0x03c7('0x15')](_0xf98747));if(_0xf98747[_0x03c7('0x16')]){if(_0xf98747[_0x03c7('0x16')][_0x03c7('0x17')]===0x1f4){logger[_0x03c7('0x16')]('ChatGroup,\x20%s,\x20%s',_0x103052,_0xf98747[_0x03c7('0x16')]['message']);return _0x856199(_0xf98747[_0x03c7('0x16')][_0x03c7('0x18')]);}logger['error'](_0x03c7('0x19'),_0x103052,_0xf98747[_0x03c7('0x16')][_0x03c7('0x18')]);return _0x57c8fb(_0xf98747['error'][_0x03c7('0x18')]);}else{logger[_0x03c7('0x12')](_0x03c7('0x19'),_0x103052,_0x03c7('0x1a'));_0x57c8fb(_0xf98747[_0x03c7('0x1b')][_0x03c7('0x18')]);}})['catch'](function(_0x571108){logger[_0x03c7('0x16')](_0x03c7('0x19'),_0x103052,_0x571108);_0x856199(_0x571108);});});}
\ No newline at end of file
diff --git a/server/api/chatGroup/chatGroup.socket.js b/server/api/chatGroup/chatGroup.socket.js
index d37b7df..8b2af28 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 _0x5910=['removeListener','register','length','chatGroup:','./chatGroup.events','remove','update','emit'];(function(_0x97ade9,_0x568fad){var _0x171e11=function(_0x1d280a){while(--_0x1d280a){_0x97ade9['push'](_0x97ade9['shift']());}};_0x171e11(++_0x568fad);}(_0x5910,0x12c));var _0x0591=function(_0x1f0398,_0x4a96ef){_0x1f0398=_0x1f0398-0x0;var _0x1c35cd=_0x5910[_0x1f0398];return _0x1c35cd;};'use strict';var ChatGroupEvents=require(_0x0591('0x0'));var events=['save',_0x0591('0x1'),_0x0591('0x2')];function createListener(_0x15644e,_0xb4dd9f){return function(_0x4b499d){_0xb4dd9f[_0x0591('0x3')](_0x15644e,_0x4b499d);};}function removeListener(_0x58936a,_0xc0de1f){return function(){ChatGroupEvents[_0x0591('0x4')](_0x58936a,_0xc0de1f);};}exports[_0x0591('0x5')]=function(_0x58e506){for(var _0xaa8e8f=0x0,_0x2247aa=events[_0x0591('0x6')];_0xaa8e8f<_0x2247aa;_0xaa8e8f++){var _0x1c0a63=events[_0xaa8e8f];var _0x3babfb=createListener(_0x0591('0x7')+_0x1c0a63,_0x58e506);ChatGroupEvents['on'](_0x1c0a63,_0x3babfb);}};
\ No newline at end of file
+var _0x91b7=['length','chatGroup:','save','update','removeListener','register'];(function(_0x36591d,_0x110f4d){var _0xa0b3f6=function(_0x206b02){while(--_0x206b02){_0x36591d['push'](_0x36591d['shift']());}};_0xa0b3f6(++_0x110f4d);}(_0x91b7,0x8c));var _0x791b=function(_0x245d40,_0x455ece){_0x245d40=_0x245d40-0x0;var _0x245534=_0x91b7[_0x245d40];return _0x245534;};'use strict';var ChatGroupEvents=require('./chatGroup.events');var events=[_0x791b('0x0'),'remove',_0x791b('0x1')];function createListener(_0xde7c42,_0x2ecd6c){return function(_0x128808){_0x2ecd6c['emit'](_0xde7c42,_0x128808);};}function removeListener(_0xea6bb2,_0x42bff6){return function(){ChatGroupEvents[_0x791b('0x2')](_0xea6bb2,_0x42bff6);};}exports[_0x791b('0x3')]=function(_0x1aabc0){for(var _0x25cfd8=0x0,_0x22231e=events[_0x791b('0x4')];_0x25cfd8<_0x22231e;_0x25cfd8++){var _0x4c45b7=events[_0x25cfd8];var _0x35a17b=createListener(_0x791b('0x5')+_0x4c45b7,_0x1aabc0);ChatGroupEvents['on'](_0x4c45b7,_0x35a17b);}};
\ No newline at end of file
diff --git a/server/api/chatGroup/index.js b/server/api/chatGroup/index.js
index e83e449..d1d1921 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 _0x0144=['describe','/:id','isAuthenticated','show','/:id/unread','getUnread','/:id/members','getMembers','getMessages','post','/:id/messages','put','delete','destroy','removeMembers','exports','multer','connect-timeout','fs-extra','../../config/environment','./chatGroup.controller','get','index','/describe'];(function(_0x40a545,_0x5a2595){var _0x5888da=function(_0x3d3e6c){while(--_0x3d3e6c){_0x40a545['push'](_0x40a545['shift']());}};_0x5888da(++_0x5a2595);}(_0x0144,0xb8));var _0x4014=function(_0x1e2321,_0x3ae1c5){_0x1e2321=_0x1e2321-0x0;var _0x1d346d=_0x0144[_0x1e2321];return _0x1d346d;};'use strict';var multer=require(_0x4014('0x0'));var util=require('util');var path=require('path');var timeout=require(_0x4014('0x1'));var express=require('express');var router=express['Router']();var fs_extra=require(_0x4014('0x2'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x4014('0x3'));var controller=require(_0x4014('0x4'));router[_0x4014('0x5')]('/',auth['isAuthenticated'](),controller[_0x4014('0x6')]);router[_0x4014('0x5')](_0x4014('0x7'),auth['isAuthenticated'](),controller[_0x4014('0x8')]);router['get'](_0x4014('0x9'),auth[_0x4014('0xa')](),controller[_0x4014('0xb')]);router['get'](_0x4014('0xc'),auth['isAuthenticated'](),controller[_0x4014('0xd')]);router['get'](_0x4014('0xe'),auth['isAuthenticated'](),controller[_0x4014('0xf')]);router['get']('/:id/messages',auth['isAuthenticated'](),controller[_0x4014('0x10')]);router['post']('/',auth['isAuthenticated'](),controller['create']);router[_0x4014('0x11')](_0x4014('0xe'),auth[_0x4014('0xa')](),controller['addMembers']);router[_0x4014('0x11')](_0x4014('0x12'),auth['isAuthenticated'](),controller['addMessage']);router[_0x4014('0x13')](_0x4014('0x9'),auth['isAuthenticated'](),controller['update']);router[_0x4014('0x14')](_0x4014('0x9'),auth[_0x4014('0xa')](),controller[_0x4014('0x15')]);router['delete']('/:id/members',auth[_0x4014('0xa')](),controller[_0x4014('0x16')]);module[_0x4014('0x17')]=router;
\ No newline at end of file
+var _0xd0d8=['path','connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment','./chatGroup.controller','get','isAuthenticated','index','describe','/:id','/:id/unread','getUnread','/:id/members','getMembers','/:id/messages','getMessages','create','post','addMembers','put','update','delete','destroy','removeMembers','multer','util'];(function(_0x3feee9,_0x33769a){var _0x2315aa=function(_0x19881f){while(--_0x19881f){_0x3feee9['push'](_0x3feee9['shift']());}};_0x2315aa(++_0x33769a);}(_0xd0d8,0x177));var _0x8d0d=function(_0x37dbf3,_0x4ad77d){_0x37dbf3=_0x37dbf3-0x0;var _0x1cda9b=_0xd0d8[_0x37dbf3];return _0x1cda9b;};'use strict';var multer=require(_0x8d0d('0x0'));var util=require(_0x8d0d('0x1'));var path=require(_0x8d0d('0x2'));var timeout=require(_0x8d0d('0x3'));var express=require(_0x8d0d('0x4'));var router=express[_0x8d0d('0x5')]();var fs_extra=require(_0x8d0d('0x6'));var auth=require('../../components/auth/service');var interaction=require(_0x8d0d('0x7'));var config=require(_0x8d0d('0x8'));var controller=require(_0x8d0d('0x9'));router[_0x8d0d('0xa')]('/',auth[_0x8d0d('0xb')](),controller[_0x8d0d('0xc')]);router[_0x8d0d('0xa')]('/describe',auth[_0x8d0d('0xb')](),controller[_0x8d0d('0xd')]);router['get'](_0x8d0d('0xe'),auth[_0x8d0d('0xb')](),controller['show']);router['get'](_0x8d0d('0xf'),auth[_0x8d0d('0xb')](),controller[_0x8d0d('0x10')]);router[_0x8d0d('0xa')](_0x8d0d('0x11'),auth[_0x8d0d('0xb')](),controller[_0x8d0d('0x12')]);router[_0x8d0d('0xa')](_0x8d0d('0x13'),auth[_0x8d0d('0xb')](),controller[_0x8d0d('0x14')]);router['post']('/',auth[_0x8d0d('0xb')](),controller[_0x8d0d('0x15')]);router[_0x8d0d('0x16')]('/:id/members',auth[_0x8d0d('0xb')](),controller[_0x8d0d('0x17')]);router['post'](_0x8d0d('0x13'),auth[_0x8d0d('0xb')](),controller['addMessage']);router[_0x8d0d('0x18')](_0x8d0d('0xe'),auth['isAuthenticated'](),controller[_0x8d0d('0x19')]);router[_0x8d0d('0x1a')](_0x8d0d('0xe'),auth['isAuthenticated'](),controller[_0x8d0d('0x1b')]);router[_0x8d0d('0x1a')](_0x8d0d('0x11'),auth[_0x8d0d('0xb')](),controller[_0x8d0d('0x1c')]);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 d1d45cf..7c2df0c 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 _0x7df3=['BOOLEAN','sequelize','exports','INTEGER','star','TEXT','STRING','DATE','ENUM'];(function(_0x28be71,_0x1a660d){var _0x369de0=function(_0x259ec9){while(--_0x259ec9){_0x28be71['push'](_0x28be71['shift']());}};_0x369de0(++_0x1a660d);}(_0x7df3,0x1cc));var _0x37df=function(_0x4154a6,_0x2c0b8e){_0x4154a6=_0x4154a6-0x0;var _0x3b2786=_0x7df3[_0x4154a6];return _0x3b2786;};'use strict';var Sequelize=require(_0x37df('0x0'));module[_0x37df('0x1')]={'closed':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'ratingValue':{'type':Sequelize[_0x37df('0x2')]},'ratingType':{'type':Sequelize['ENUM'](_0x37df('0x3'),'thumb'),'defaultValue':_0x37df('0x3')},'ratingMessage':{'type':Sequelize['TEXT']},'pathTranscript':{'type':Sequelize[_0x37df('0x4')]},'mailTranscript':{'type':Sequelize[_0x37df('0x5')],'validate':{'isEmail':!![]}},'closedAt':{'type':Sequelize[_0x37df('0x6')]},'disposition':{'type':Sequelize[_0x37df('0x5')]},'secondDisposition':{'type':Sequelize[_0x37df('0x5')]},'thirdDisposition':{'type':Sequelize[_0x37df('0x5')]},'note':{'type':Sequelize['STRING']},'browserName':{'type':Sequelize['STRING']},'browserVersion':{'type':Sequelize['STRING']},'osName':{'type':Sequelize[_0x37df('0x5')]},'osVersion':{'type':Sequelize[_0x37df('0x5')]},'deviceModel':{'type':Sequelize[_0x37df('0x5')]},'deviceVendor':{'type':Sequelize[_0x37df('0x5')]},'deviceType':{'type':Sequelize['STRING']},'referer':{'type':Sequelize[_0x37df('0x4')]},'customerIp':{'type':Sequelize[_0x37df('0x5')]},'formData':{'type':Sequelize[_0x37df('0x4')]('long')},'read1stAt':{'type':Sequelize[_0x37df('0x6')]},'lastMsgAt':{'type':Sequelize[_0x37df('0x6')]},'lastMsgDirection':{'type':Sequelize[_0x37df('0x7')]('in','out'),'defaultValue':'in','allowNull':![]},'closeReason':{'type':Sequelize[_0x37df('0x5')]},'customerPort':{'type':Sequelize[_0x37df('0x5')]},'vidaooSessionId':{'type':Sequelize[_0x37df('0x4')]},'autoreplyExecuted':{'type':Sequelize[_0x37df('0x8')],'defaultValue':![]}};
\ No newline at end of file
+var _0x793b=['INTEGER','ENUM','thumb','star','STRING','DATE','TEXT','long','out','sequelize','exports','BOOLEAN'];(function(_0x439d59,_0x11ccdf){var _0x3670c7=function(_0x11cfcb){while(--_0x11cfcb){_0x439d59['push'](_0x439d59['shift']());}};_0x3670c7(++_0x11ccdf);}(_0x793b,0x189));var _0xb793=function(_0x19f44e,_0x3a56c3){_0x19f44e=_0x19f44e-0x0;var _0x585647=_0x793b[_0x19f44e];return _0x585647;};'use strict';var Sequelize=require(_0xb793('0x0'));module[_0xb793('0x1')]={'closed':{'type':Sequelize[_0xb793('0x2')],'defaultValue':![]},'ratingValue':{'type':Sequelize[_0xb793('0x3')]},'ratingType':{'type':Sequelize[_0xb793('0x4')]('star',_0xb793('0x5')),'defaultValue':_0xb793('0x6')},'ratingMessage':{'type':Sequelize['TEXT']},'pathTranscript':{'type':Sequelize['TEXT']},'mailTranscript':{'type':Sequelize[_0xb793('0x7')],'validate':{'isEmail':!![]}},'closedAt':{'type':Sequelize[_0xb793('0x8')]},'disposition':{'type':Sequelize[_0xb793('0x7')]},'secondDisposition':{'type':Sequelize[_0xb793('0x7')]},'thirdDisposition':{'type':Sequelize[_0xb793('0x7')]},'note':{'type':Sequelize[_0xb793('0x7')]},'browserName':{'type':Sequelize[_0xb793('0x7')]},'browserVersion':{'type':Sequelize[_0xb793('0x7')]},'osName':{'type':Sequelize[_0xb793('0x7')]},'osVersion':{'type':Sequelize[_0xb793('0x7')]},'deviceModel':{'type':Sequelize[_0xb793('0x7')]},'deviceVendor':{'type':Sequelize[_0xb793('0x7')]},'deviceType':{'type':Sequelize[_0xb793('0x7')]},'referer':{'type':Sequelize[_0xb793('0x9')]},'customerIp':{'type':Sequelize['STRING']},'formData':{'type':Sequelize[_0xb793('0x9')](_0xb793('0xa'))},'read1stAt':{'type':Sequelize['DATE']},'lastMsgAt':{'type':Sequelize['DATE']},'lastMsgDirection':{'type':Sequelize[_0xb793('0x4')]('in',_0xb793('0xb')),'defaultValue':'in','allowNull':![]},'closeReason':{'type':Sequelize['STRING']},'customerPort':{'type':Sequelize[_0xb793('0x7')]},'vidaooSessionId':{'type':Sequelize[_0xb793('0x9')]},'autoreplyExecuted':{'type':Sequelize['BOOLEAN'],'defaultValue':![]}};
\ No newline at end of file
diff --git a/server/api/chatInteraction/chatInteraction.controller.js b/server/api/chatInteraction/chatInteraction.controller.js
index c6b913d..ec19a5c 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 _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(_0x38d23e,_0x5e4cd6){var _0x55a3eb=function(_0x27eb8c){while(--_0x27eb8c){_0x38d23e['push'](_0x38d23e['shift']());}};_0x55a3eb(++_0x5e4cd6);}(_0xef0f,0x168));var _0xfef0=function(_0x5d7926,_0x10895a){_0x5d7926=_0x5d7926-0x0;var _0x66fbfc=_0xef0f[_0x5d7926];return _0x66fbfc;};'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
+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(_0x4792c8,_0x5158a1){var _0x35edb1=function(_0x2472d3){while(--_0x2472d3){_0x4792c8['push'](_0x4792c8['shift']());}};_0x35edb1(++_0x5158a1);}(_0xb10b,0x12a));var _0xbb10=function(_0x35485a,_0x91cdd4){_0x35485a=_0x35485a-0x0;var _0x5148e6=_0xb10b[_0x35485a];return _0x5148e6;};'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
diff --git a/server/api/chatInteraction/chatInteraction.events.js b/server/api/chatInteraction/chatInteraction.events.js
index 3ff63ab..03fe6e2 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 _0x7536=['Users','map','unreadMessages','emit','catch','hook','exports','events','../../mysqldb','ChatInteraction','ChatMessage','setMaxListeners','save','update','remove','getUsers','then','setDataValue'];(function(_0xbd08b4,_0x4790ed){var _0x314f1e=function(_0x161589){while(--_0x161589){_0xbd08b4['push'](_0xbd08b4['shift']());}};_0x314f1e(++_0x4790ed);}(_0x7536,0x97));var _0x6753=function(_0x4e6eb2,_0x16a451){_0x4e6eb2=_0x4e6eb2-0x0;var _0x4e0c1c=_0x7536[_0x4e6eb2];return _0x4e0c1c;};'use strict';var EventEmitter=require(_0x6753('0x0'));var ChatInteraction=require(_0x6753('0x1'))['db'][_0x6753('0x2')];var ChatMessage=require(_0x6753('0x1'))['db'][_0x6753('0x3')];var ChatInteractionEvents=new EventEmitter();ChatInteractionEvents[_0x6753('0x4')](0x0);var events={'afterCreate':_0x6753('0x5'),'afterUpdate':_0x6753('0x6'),'afterDestroy':_0x6753('0x7')};function emitEvent(_0x3b20ff){return function(_0x1a902d,_0x4651a1,_0x282b86){_0x1a902d[_0x6753('0x8')]({'attributes':['id'],'raw':!![]})[_0x6753('0x9')](function(_0x1a88d8){_0x1a902d[_0x6753('0xa')](_0x6753('0xb'),_0x1a88d8[_0x6753('0xc')](function(_0x3f3377){return{'id':_0x3f3377['id']};}));return ChatMessage['findAll']({'where':{'ChatInteractionId':_0x1a902d['id'],'direction':'in','read':![]},'raw':!![]});})['then'](function(_0x2382ae){_0x1a902d[_0x6753('0xa')](_0x6753('0xd'),_0x2382ae['length']);ChatInteractionEvents[_0x6753('0xe')](_0x3b20ff+':'+_0x1a902d['id'],_0x1a902d);ChatInteractionEvents[_0x6753('0xe')](_0x3b20ff,_0x1a902d);_0x282b86(null);})[_0x6753('0xf')](_0x282b86(null));};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];ChatInteraction[_0x6753('0x10')](e,emitEvent(event));}}module[_0x6753('0x11')]=ChatInteractionEvents;
\ No newline at end of file
+var _0x34b5=['remove','then','Users','setDataValue','unreadMessages','length','emit','catch','hasOwnProperty','hook','exports','events','../../mysqldb','ChatInteraction','ChatMessage','setMaxListeners','update'];(function(_0x5ecadc,_0x1cf9f1){var _0x565037=function(_0x22908b){while(--_0x22908b){_0x5ecadc['push'](_0x5ecadc['shift']());}};_0x565037(++_0x1cf9f1);}(_0x34b5,0x181));var _0x534b=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x34b5[_0x3dd15e];return _0x231fd0;};'use strict';var EventEmitter=require(_0x534b('0x0'));var ChatInteraction=require(_0x534b('0x1'))['db'][_0x534b('0x2')];var ChatMessage=require(_0x534b('0x1'))['db'][_0x534b('0x3')];var ChatInteractionEvents=new EventEmitter();ChatInteractionEvents[_0x534b('0x4')](0x0);var events={'afterCreate':'save','afterUpdate':_0x534b('0x5'),'afterDestroy':_0x534b('0x6')};function emitEvent(_0x574b80){return function(_0x12c182,_0x38707c,_0x171e14){_0x12c182['getUsers']({'attributes':['id'],'raw':!![]})[_0x534b('0x7')](function(_0x500d0f){_0x12c182['setDataValue'](_0x534b('0x8'),_0x500d0f['map'](function(_0x301a6a){return{'id':_0x301a6a['id']};}));return ChatMessage['findAll']({'where':{'ChatInteractionId':_0x12c182['id'],'direction':'in','read':![]},'raw':!![]});})[_0x534b('0x7')](function(_0xd6afeb){_0x12c182[_0x534b('0x9')](_0x534b('0xa'),_0xd6afeb[_0x534b('0xb')]);ChatInteractionEvents['emit'](_0x574b80+':'+_0x12c182['id'],_0x12c182);ChatInteractionEvents[_0x534b('0xc')](_0x574b80,_0x12c182);_0x171e14(null);})[_0x534b('0xd')](_0x171e14(null));};}for(var e in events){if(events[_0x534b('0xe')](e)){var event=events[e];ChatInteraction[_0x534b('0xf')](e,emitEvent(event));}}module[_0x534b('0x10')]=ChatInteractionEvents;
\ No newline at end of file
diff --git a/server/api/chatInteraction/chatInteraction.model.js b/server/api/chatInteraction/chatInteraction.model.js
index 5b8e98f..c5166f6 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 _0x76ec=['changed','closedAt','format','YYYY-MM-DD\x20HH:mm:ss','utf8mb4','utf8mb4_unicode_ci','lodash','util','../../config/logger','bluebird','path','rimraf','../../config/environment','./chatInteraction.attributes','define','ChatInteraction','chat_interactions'];(function(_0x40a1fd,_0x2e0977){var _0x496317=function(_0x17e189){while(--_0x17e189){_0x40a1fd['push'](_0x40a1fd['shift']());}};_0x496317(++_0x2e0977);}(_0x76ec,0x7d));var _0xc76e=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x76ec[_0x20a584];return _0x4b41a8;};'use strict';var _=require(_0xc76e('0x0'));var util=require(_0xc76e('0x1'));var logger=require(_0xc76e('0x2'))('api');var moment=require('moment');var BPromise=require(_0xc76e('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xc76e('0x4'));var rimraf=require(_0xc76e('0x5'));var config=require(_0xc76e('0x6'));var attributes=require(_0xc76e('0x7'));module['exports']=function(_0x30632d,_0x12b151){return _0x30632d[_0xc76e('0x8')](_0xc76e('0x9'),attributes,{'tableName':_0xc76e('0xa'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x335a07,_0x1624a4,_0x2ae79d){if(_0x335a07[_0xc76e('0xb')]('closed')){_0x335a07[_0xc76e('0xc')]=moment()[_0xc76e('0xd')](_0xc76e('0xe'));}_0x2ae79d(null,_0x335a07);}},'charset':_0xc76e('0xf'),'collate':_0xc76e('0x10')});};
\ No newline at end of file
+var _0x1bc3=['utf8mb4','utf8mb4_unicode_ci','lodash','util','../../config/logger','api','bluebird','request-promise','path','rimraf','../../config/environment','exports','ChatInteraction','chat_interactions','changed','closed','format'];(function(_0x18847a,_0xd6898e){var _0x5b68ca=function(_0xf333b){while(--_0xf333b){_0x18847a['push'](_0x18847a['shift']());}};_0x5b68ca(++_0xd6898e);}(_0x1bc3,0x123));var _0x31bc=function(_0x3b544e,_0x31a861){_0x3b544e=_0x3b544e-0x0;var _0x2a09b1=_0x1bc3[_0x3b544e];return _0x2a09b1;};'use strict';var _=require(_0x31bc('0x0'));var util=require(_0x31bc('0x1'));var logger=require(_0x31bc('0x2'))(_0x31bc('0x3'));var moment=require('moment');var BPromise=require(_0x31bc('0x4'));var rp=require(_0x31bc('0x5'));var fs=require('fs');var path=require(_0x31bc('0x6'));var rimraf=require(_0x31bc('0x7'));var config=require(_0x31bc('0x8'));var attributes=require('./chatInteraction.attributes');module[_0x31bc('0x9')]=function(_0x2b7d27,_0xf9215f){return _0x2b7d27['define'](_0x31bc('0xa'),attributes,{'tableName':_0x31bc('0xb'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0xc5b5d1,_0x4fff4a,_0x3de363){if(_0xc5b5d1[_0x31bc('0xc')](_0x31bc('0xd'))){_0xc5b5d1['closedAt']=moment()[_0x31bc('0xe')]('YYYY-MM-DD\x20HH:mm:ss');}_0x3de363(null,_0xc5b5d1);}},'charset':_0x31bc('0xf'),'collate':_0x31bc('0x10')});};
\ No newline at end of file
diff --git a/server/api/chatInteraction/chatInteraction.rpc.js b/server/api/chatInteraction/chatInteraction.rpc.js
index b1ca528..3c78583 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 _0x5672=['body','omit','spread','AddTags','lodash','util','moment','ioredis','../../mysqldb','../../config/logger','../../config/environment','defaults','redis','localhost','socket.io-emitter','./chatInteraction.socket','register','request','info','ChatInteraction,\x20%s,\x20%s','debug','request\x20sent','stringify','error','message','result','catch','UpdateChatInteraction','ChatInteraction','update','options','raw','where','then','AddTagsToChatInteraction','find','addTags'];(function(_0x40eba3,_0x37c878){var _0x1131e6=function(_0x23c09f){while(--_0x23c09f){_0x40eba3['push'](_0x40eba3['shift']());}};_0x1131e6(++_0x37c878);}(_0x5672,0x19b));var _0x2567=function(_0x77d310,_0x2b2fe7){_0x77d310=_0x77d310-0x0;var _0x2cdce4=_0x5672[_0x77d310];return _0x2cdce4;};'use strict';var _=require(_0x2567('0x0'));var util=require(_0x2567('0x1'));var moment=require(_0x2567('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x2567('0x3'));var db=require(_0x2567('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x2567('0x5'))('rpc');var config=require(_0x2567('0x6'));var jayson=require('jayson/promise');var client=jayson['client']['http']({'port':0x232a});config['redis']=_[_0x2567('0x7')](config[_0x2567('0x8')],{'host':_0x2567('0x9'),'port':0x18eb});var socket=require(_0x2567('0xa'))(new Redis(config['redis']));require(_0x2567('0xb'))[_0x2567('0xc')](socket);function respondWithRpcPromise(_0x661c0e,_0x3e2291,_0x57dedc){return new BPromise(function(_0x23dd83,_0x39582a){return client[_0x2567('0xd')](_0x661c0e,_0x57dedc)['then'](function(_0x4100a9){logger[_0x2567('0xe')](_0x2567('0xf'),_0x3e2291,'request\x20sent');logger[_0x2567('0x10')]('ChatInteraction,\x20%s,\x20%s,\x20%s',_0x3e2291,_0x2567('0x11'),JSON[_0x2567('0x12')](_0x4100a9));if(_0x4100a9['error']){if(_0x4100a9[_0x2567('0x13')]['code']===0x1f4){logger['error'](_0x2567('0xf'),_0x3e2291,_0x4100a9[_0x2567('0x13')][_0x2567('0x14')]);return _0x39582a(_0x4100a9[_0x2567('0x13')]['message']);}logger[_0x2567('0x13')](_0x2567('0xf'),_0x3e2291,_0x4100a9[_0x2567('0x13')][_0x2567('0x14')]);return _0x23dd83(_0x4100a9['error'][_0x2567('0x14')]);}else{logger['info'](_0x2567('0xf'),_0x3e2291,'request\x20sent');_0x23dd83(_0x4100a9[_0x2567('0x15')]['message']);}})[_0x2567('0x16')](function(_0x5d6b22){logger[_0x2567('0x13')](_0x2567('0xf'),_0x3e2291,_0x5d6b22);_0x39582a(_0x5d6b22);});});}exports[_0x2567('0x17')]=function(_0x43f9b8){var _0x40a27c=this;return new Promise(function(_0x4b55be,_0x4d72d6){return db[_0x2567('0x18')][_0x2567('0x19')](_0x43f9b8['body'],{'raw':_0x43f9b8[_0x2567('0x1a')]?_0x43f9b8[_0x2567('0x1a')][_0x2567('0x1b')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x43f9b8['options']?_0x43f9b8[_0x2567('0x1a')][_0x2567('0x1c')]||null:null,'attributes':_0x43f9b8[_0x2567('0x1a')]?_0x43f9b8[_0x2567('0x1a')]['attributes']||null:null,'limit':_0x43f9b8['options']?_0x43f9b8[_0x2567('0x1a')]['limit']||null:null})[_0x2567('0x1d')](function(_0x23cd27){logger[_0x2567('0xe')](_0x2567('0x17'),_0x43f9b8);logger[_0x2567('0x10')](_0x2567('0x17'),_0x43f9b8,JSON['stringify'](_0x23cd27));_0x4b55be(_0x23cd27);})[_0x2567('0x16')](function(_0x4b2909){logger[_0x2567('0x13')](_0x2567('0x17'),_0x4b2909[_0x2567('0x14')],_0x43f9b8);_0x4d72d6(_0x40a27c[_0x2567('0x13')](0x1f4,_0x4b2909[_0x2567('0x14')]));});});};exports[_0x2567('0x1e')]=function(_0x3c1cd4){return new Promise(function(_0x49d000,_0x4f071b){return db[_0x2567('0x18')][_0x2567('0x1f')]({'where':_0x3c1cd4[_0x2567('0x1a')]?_0x3c1cd4['options'][_0x2567('0x1c')]||null:null})[_0x2567('0x1d')](function(_0x112a67){if(_0x112a67){return _0x112a67[_0x2567('0x20')](_0x3c1cd4[_0x2567('0x21')]['ids'],_[_0x2567('0x22')](_0x3c1cd4[_0x2567('0x21')],['ids','id'])||{});}})[_0x2567('0x23')](function(_0x1a1745){logger['info'](_0x2567('0x24'),_0x3c1cd4);logger['debug'](_0x2567('0x24'),_0x3c1cd4,JSON['stringify'](_0x1a1745));_0x49d000(_0x1a1745);})[_0x2567('0x16')](function(_0x323ee4){logger['error'](_0x2567('0x24'),_0x323ee4['message'],_0x3c1cd4);_0x4f071b(_this[_0x2567('0x13')](0x1f4,_0x323ee4['message']));});});};
\ No newline at end of file
+var _0x5b33=['register','then','info','ChatInteraction,\x20%s,\x20%s','debug','request\x20sent','stringify','error','code','message','result','catch','ChatInteraction','update','body','options','where','attributes','UpdateChatInteraction','find','addTags','ids','AddTags','lodash','util','randomstring','ioredis','../../config/logger','rpc','../../config/environment','redis','defaults','localhost','socket.io-emitter','./chatInteraction.socket'];(function(_0x1de1e1,_0x436a29){var _0x16e853=function(_0x1fbc6d){while(--_0x1fbc6d){_0x1de1e1['push'](_0x1de1e1['shift']());}};_0x16e853(++_0x436a29);}(_0x5b33,0x152));var _0x35b3=function(_0x385fd1,_0x427ec3){_0x385fd1=_0x385fd1-0x0;var _0x402c49=_0x5b33[_0x385fd1];return _0x402c49;};'use strict';var _=require(_0x35b3('0x0'));var util=require(_0x35b3('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x35b3('0x2'));var fs=require('fs');var Redis=require(_0x35b3('0x3'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x35b3('0x4'))(_0x35b3('0x5'));var config=require(_0x35b3('0x6'));var jayson=require('jayson/promise');var client=jayson['client']['http']({'port':0x232a});config[_0x35b3('0x7')]=_[_0x35b3('0x8')](config[_0x35b3('0x7')],{'host':_0x35b3('0x9'),'port':0x18eb});var socket=require(_0x35b3('0xa'))(new Redis(config[_0x35b3('0x7')]));require(_0x35b3('0xb'))[_0x35b3('0xc')](socket);function respondWithRpcPromise(_0x7e0c60,_0x304c8e,_0x154df8){return new BPromise(function(_0xf08393,_0x204696){return client['request'](_0x7e0c60,_0x154df8)[_0x35b3('0xd')](function(_0x3d6150){logger[_0x35b3('0xe')](_0x35b3('0xf'),_0x304c8e,'request\x20sent');logger[_0x35b3('0x10')]('ChatInteraction,\x20%s,\x20%s,\x20%s',_0x304c8e,_0x35b3('0x11'),JSON[_0x35b3('0x12')](_0x3d6150));if(_0x3d6150[_0x35b3('0x13')]){if(_0x3d6150[_0x35b3('0x13')][_0x35b3('0x14')]===0x1f4){logger[_0x35b3('0x13')](_0x35b3('0xf'),_0x304c8e,_0x3d6150[_0x35b3('0x13')][_0x35b3('0x15')]);return _0x204696(_0x3d6150[_0x35b3('0x13')][_0x35b3('0x15')]);}logger[_0x35b3('0x13')](_0x35b3('0xf'),_0x304c8e,_0x3d6150[_0x35b3('0x13')][_0x35b3('0x15')]);return _0xf08393(_0x3d6150['error']['message']);}else{logger['info'](_0x35b3('0xf'),_0x304c8e,_0x35b3('0x11'));_0xf08393(_0x3d6150[_0x35b3('0x16')][_0x35b3('0x15')]);}})[_0x35b3('0x17')](function(_0x4cf1c4){logger[_0x35b3('0x13')](_0x35b3('0xf'),_0x304c8e,_0x4cf1c4);_0x204696(_0x4cf1c4);});});}exports['UpdateChatInteraction']=function(_0x2af4f7){var _0xe88ba6=this;return new Promise(function(_0xd9917a,_0x2e11ea){return db[_0x35b3('0x18')][_0x35b3('0x19')](_0x2af4f7[_0x35b3('0x1a')],{'raw':_0x2af4f7[_0x35b3('0x1b')]?_0x2af4f7[_0x35b3('0x1b')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x2af4f7[_0x35b3('0x1b')]?_0x2af4f7['options'][_0x35b3('0x1c')]||null:null,'attributes':_0x2af4f7[_0x35b3('0x1b')]?_0x2af4f7[_0x35b3('0x1b')][_0x35b3('0x1d')]||null:null,'limit':_0x2af4f7[_0x35b3('0x1b')]?_0x2af4f7['options']['limit']||null:null})['then'](function(_0x4286c5){logger['info'](_0x35b3('0x1e'),_0x2af4f7);logger[_0x35b3('0x10')](_0x35b3('0x1e'),_0x2af4f7,JSON['stringify'](_0x4286c5));_0xd9917a(_0x4286c5);})['catch'](function(_0x26314d){logger['error'](_0x35b3('0x1e'),_0x26314d['message'],_0x2af4f7);_0x2e11ea(_0xe88ba6[_0x35b3('0x13')](0x1f4,_0x26314d[_0x35b3('0x15')]));});});};exports['AddTagsToChatInteraction']=function(_0x1b4739){return new Promise(function(_0x45e09f,_0x637b24){return db[_0x35b3('0x18')][_0x35b3('0x1f')]({'where':_0x1b4739['options']?_0x1b4739[_0x35b3('0x1b')][_0x35b3('0x1c')]||null:null})[_0x35b3('0xd')](function(_0x4a9dbb){if(_0x4a9dbb){return _0x4a9dbb[_0x35b3('0x20')](_0x1b4739['body']['ids'],_['omit'](_0x1b4739[_0x35b3('0x1a')],[_0x35b3('0x21'),'id'])||{});}})['spread'](function(_0x1f66e4){logger['info']('AddTags',_0x1b4739);logger[_0x35b3('0x10')](_0x35b3('0x22'),_0x1b4739,JSON[_0x35b3('0x12')](_0x1f66e4));_0x45e09f(_0x1f66e4);})[_0x35b3('0x17')](function(_0x38e22c){logger['error'](_0x35b3('0x22'),_0x38e22c[_0x35b3('0x15')],_0x1b4739);_0x637b24(_this[_0x35b3('0x13')](0x1f4,_0x38e22c[_0x35b3('0x15')]));});});};
\ No newline at end of file
diff --git a/server/api/chatInteraction/chatInteraction.socket.js b/server/api/chatInteraction/chatInteraction.socket.js
index 8307dd8..45a1059 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 _0x6bbe=['length','chatInteraction:','./chatInteraction.events','save','update','emit','removeListener','register'];(function(_0x5c7995,_0x55727f){var _0x1bf482=function(_0x3fd79c){while(--_0x3fd79c){_0x5c7995['push'](_0x5c7995['shift']());}};_0x1bf482(++_0x55727f);}(_0x6bbe,0x172));var _0xe6bb=function(_0x4b16b5,_0x2405c6){_0x4b16b5=_0x4b16b5-0x0;var _0x498d87=_0x6bbe[_0x4b16b5];return _0x498d87;};'use strict';var ChatInteractionEvents=require(_0xe6bb('0x0'));var events=[_0xe6bb('0x1'),'remove',_0xe6bb('0x2')];function createListener(_0x3c3ca0,_0xde9621){return function(_0x4f0622){_0xde9621[_0xe6bb('0x3')](_0x3c3ca0,_0x4f0622);};}function removeListener(_0x410cc9,_0x38d8d0){return function(){ChatInteractionEvents[_0xe6bb('0x4')](_0x410cc9,_0x38d8d0);};}exports[_0xe6bb('0x5')]=function(_0x3742d0){for(var _0x2c74d8=0x0,_0x2fef59=events[_0xe6bb('0x6')];_0x2c74d8<_0x2fef59;_0x2c74d8++){var _0x21bbdd=events[_0x2c74d8];var _0xfe720b=createListener(_0xe6bb('0x7')+_0x21bbdd,_0x3742d0);ChatInteractionEvents['on'](_0x21bbdd,_0xfe720b);}};
\ No newline at end of file
+var _0x3232=['./chatInteraction.events','remove','update','emit'];(function(_0x3ed194,_0x1467d1){var _0x29ac97=function(_0x19a525){while(--_0x19a525){_0x3ed194['push'](_0x3ed194['shift']());}};_0x29ac97(++_0x1467d1);}(_0x3232,0x178));var _0x2323=function(_0x411add,_0x1aed38){_0x411add=_0x411add-0x0;var _0x238242=_0x3232[_0x411add];return _0x238242;};'use strict';var ChatInteractionEvents=require(_0x2323('0x0'));var events=['save',_0x2323('0x1'),_0x2323('0x2')];function createListener(_0x174541,_0x31a1a9){return function(_0x2a1ba8){_0x31a1a9[_0x2323('0x3')](_0x174541,_0x2a1ba8);};}function removeListener(_0x1a03ea,_0x1d402a){return function(){ChatInteractionEvents['removeListener'](_0x1a03ea,_0x1d402a);};}exports['register']=function(_0x29400b){for(var _0x532845=0x0,_0x480298=events['length'];_0x532845<_0x480298;_0x532845++){var _0x164728=events[_0x532845];var _0x279aa8=createListener('chatInteraction:'+_0x164728,_0x29400b);ChatInteractionEvents['on'](_0x164728,_0x279aa8);}};
\ No newline at end of file
diff --git a/server/api/chatInteraction/index.js b/server/api/chatInteraction/index.js
index fec7bc5..7e7629b 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 _0x651d=['chatinteraction:addtags','addTags','put','tracked','chatinteraction:update','update','customUpdate','/:id/abandon','abandon','/:id/close','delete','chatinteraction:destroy','destroy','multer','util','path','connect-timeout','express','Router','fs-extra','../../config/environment','./chatInteraction.controller','get','isAuthenticated','index','describe','/:id','isChatInteractionAuthorized','show','/:id/attachment_download','attachmentDownload','/:id/messages','getMessages','/:id/my_messages','getMyMessages','/:id/download','download','create','post','/:id/vidaoo','createVidaooSession','diskStorage','join','root','format','now','originalname','/:id/attachment_upload','single','file','/:id/tags','chat'];(function(_0x104662,_0x53a7a7){var _0x19cba7=function(_0x5a76c0){while(--_0x5a76c0){_0x104662['push'](_0x104662['shift']());}};_0x19cba7(++_0x53a7a7);}(_0x651d,0x111));var _0xd651=function(_0x5756c6,_0x58290a){_0x5756c6=_0x5756c6-0x0;var _0x4b5806=_0x651d[_0x5756c6];return _0x4b5806;};'use strict';var multer=require(_0xd651('0x0'));var util=require(_0xd651('0x1'));var path=require(_0xd651('0x2'));var timeout=require(_0xd651('0x3'));var express=require(_0xd651('0x4'));var router=express[_0xd651('0x5')]();var fs_extra=require(_0xd651('0x6'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0xd651('0x7'));var controller=require(_0xd651('0x8'));router[_0xd651('0x9')]('/',auth[_0xd651('0xa')](),controller[_0xd651('0xb')]);router['get']('/describe',auth['isAuthenticated'](),controller[_0xd651('0xc')]);router['get'](_0xd651('0xd'),auth[_0xd651('0xe')](),controller[_0xd651('0xf')]);router[_0xd651('0x9')](_0xd651('0x10'),auth['isChatInteractionAuthorized'](),controller[_0xd651('0x11')]);router[_0xd651('0x9')](_0xd651('0x12'),auth['isAuthenticated'](),controller[_0xd651('0x13')]);router[_0xd651('0x9')](_0xd651('0x14'),auth[_0xd651('0xe')](),controller[_0xd651('0x15')]);router['get'](_0xd651('0x16'),auth[_0xd651('0xa')](),controller[_0xd651('0x17')]);router['post']('/',auth[_0xd651('0xa')](),controller[_0xd651('0x18')]);router[_0xd651('0x19')](_0xd651('0x1a'),auth[_0xd651('0xa')](),controller[_0xd651('0x1b')]);var upload=multer({'storage':multer[_0xd651('0x1c')]({'destination':function(_0x34cdd4,_0x1cf519,_0x417f5a){_0x417f5a(null,path[_0xd651('0x1d')](config[_0xd651('0x1e')],'server/files/attachments/'));},'filename':function(_0x33c610,_0x42eab1,_0x26e244){_0x26e244(null,util[_0xd651('0x1f')]('%s-%s',Date[_0xd651('0x20')](),_0x42eab1[_0xd651('0x21')]['replace'](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-')));}})});router[_0xd651('0x19')](_0xd651('0x22'),upload[_0xd651('0x23')](_0xd651('0x24')),controller['attachmentUpload']);router['post'](_0xd651('0x12'),auth[_0xd651('0xe')](),controller['addMessage']);router[_0xd651('0x19')](_0xd651('0x25'),auth[_0xd651('0xa')](),interaction['tracked'](_0xd651('0x26'),_0xd651('0x27')),controller[_0xd651('0x28')]);router[_0xd651('0x29')]('/:id',auth[_0xd651('0xa')](),interaction[_0xd651('0x2a')](_0xd651('0x26'),_0xd651('0x2b')),controller[_0xd651('0x2c')]);router[_0xd651('0x29')]('/:id/custom_update',controller[_0xd651('0x2d')]);router[_0xd651('0x29')](_0xd651('0x2e'),auth['isChatInteractionAuthorized'](),controller[_0xd651('0x2f')]);router['put'](_0xd651('0x30'),controller['close']);router[_0xd651('0x31')](_0xd651('0xd'),auth[_0xd651('0xa')](),interaction[_0xd651('0x2a')](_0xd651('0x26'),_0xd651('0x32')),controller[_0xd651('0x33')]);router['delete'](_0xd651('0x25'),auth['isAuthenticated'](),controller['removeTags']);module['exports']=router;
\ No newline at end of file
+var _0x919f=['/:id/my_messages','/:id/download','download','post','create','/:id/vidaoo','createVidaooSession','diskStorage','root','server/files/attachments/','%s-%s','now','originalname','/:id/attachment_upload','single','file','attachmentUpload','addMessage','chat','addTags','/:id','tracked','chatinteraction:update','update','put','/:id/custom_update','customUpdate','/:id/abandon','abandon','/:id/close','close','delete','chatinteraction:destroy','destroy','/:id/tags','removeTags','exports','util','path','connect-timeout','../../components/auth/service','../../config/environment','./chatInteraction.controller','get','isAuthenticated','index','/describe','describe','isChatInteractionAuthorized','show','attachmentDownload','/:id/messages','getMessages'];(function(_0xe36921,_0xdf33a5){var _0x10cf35=function(_0x25f94a){while(--_0x25f94a){_0xe36921['push'](_0xe36921['shift']());}};_0x10cf35(++_0xdf33a5);}(_0x919f,0xf9));var _0xf919=function(_0x141736,_0x3d0aa9){_0x141736=_0x141736-0x0;var _0x137537=_0x919f[_0x141736];return _0x137537;};'use strict';var multer=require('multer');var util=require(_0xf919('0x0'));var path=require(_0xf919('0x1'));var timeout=require(_0xf919('0x2'));var express=require('express');var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0xf919('0x3'));var interaction=require('../../components/interaction/service');var config=require(_0xf919('0x4'));var controller=require(_0xf919('0x5'));router[_0xf919('0x6')]('/',auth[_0xf919('0x7')](),controller[_0xf919('0x8')]);router['get'](_0xf919('0x9'),auth['isAuthenticated'](),controller[_0xf919('0xa')]);router['get']('/:id',auth[_0xf919('0xb')](),controller[_0xf919('0xc')]);router[_0xf919('0x6')]('/:id/attachment_download',auth[_0xf919('0xb')](),controller[_0xf919('0xd')]);router[_0xf919('0x6')](_0xf919('0xe'),auth['isAuthenticated'](),controller[_0xf919('0xf')]);router['get'](_0xf919('0x10'),auth['isChatInteractionAuthorized'](),controller['getMyMessages']);router[_0xf919('0x6')](_0xf919('0x11'),auth[_0xf919('0x7')](),controller[_0xf919('0x12')]);router[_0xf919('0x13')]('/',auth[_0xf919('0x7')](),controller[_0xf919('0x14')]);router[_0xf919('0x13')](_0xf919('0x15'),auth[_0xf919('0x7')](),controller[_0xf919('0x16')]);var upload=multer({'storage':multer[_0xf919('0x17')]({'destination':function(_0x5d28f5,_0x2a8b96,_0xa58228){_0xa58228(null,path['join'](config[_0xf919('0x18')],_0xf919('0x19')));},'filename':function(_0x38425a,_0x289b7c,_0x438839){_0x438839(null,util['format'](_0xf919('0x1a'),Date[_0xf919('0x1b')](),_0x289b7c[_0xf919('0x1c')]['replace'](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-')));}})});router['post'](_0xf919('0x1d'),upload[_0xf919('0x1e')](_0xf919('0x1f')),controller[_0xf919('0x20')]);router[_0xf919('0x13')](_0xf919('0xe'),auth[_0xf919('0xb')](),controller[_0xf919('0x21')]);router[_0xf919('0x13')]('/:id/tags',auth['isAuthenticated'](),interaction['tracked'](_0xf919('0x22'),'chatinteraction:addtags'),controller[_0xf919('0x23')]);router['put'](_0xf919('0x24'),auth[_0xf919('0x7')](),interaction[_0xf919('0x25')]('chat',_0xf919('0x26')),controller[_0xf919('0x27')]);router[_0xf919('0x28')](_0xf919('0x29'),controller[_0xf919('0x2a')]);router[_0xf919('0x28')](_0xf919('0x2b'),auth['isChatInteractionAuthorized'](),controller[_0xf919('0x2c')]);router['put'](_0xf919('0x2d'),controller[_0xf919('0x2e')]);router[_0xf919('0x2f')](_0xf919('0x24'),auth[_0xf919('0x7')](),interaction['tracked'](_0xf919('0x22'),_0xf919('0x30')),controller[_0xf919('0x31')]);router[_0xf919('0x2f')](_0xf919('0x32'),auth['isAuthenticated'](),controller[_0xf919('0x33')]);module[_0xf919('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 c36f9ab..e9790a1 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 _0x5ab6=['INTEGER','sequelize','TEXT','medium'];(function(_0x8c43de,_0x90ff31){var _0xa6591b=function(_0x469716){while(--_0x469716){_0x8c43de['push'](_0x8c43de['shift']());}};_0xa6591b(++_0x90ff31);}(_0x5ab6,0x19d));var _0x65ab=function(_0x6d4970,_0x4dae29){_0x6d4970=_0x6d4970-0x0;var _0x3597e3=_0x5ab6[_0x6d4970];return _0x3597e3;};'use strict';var Sequelize=require(_0x65ab('0x0'));module['exports']={'body':{'type':Sequelize[_0x65ab('0x1')](_0x65ab('0x2')),'allowNull':![]},'read':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'ChatInternalMessageId':{'type':Sequelize[_0x65ab('0x3')]}};
\ No newline at end of file
+var _0x0c8d=['medium','INTEGER','exports','TEXT'];(function(_0x5ad6c2,_0x929061){var _0x403f1f=function(_0x448605){while(--_0x448605){_0x5ad6c2['push'](_0x5ad6c2['shift']());}};_0x403f1f(++_0x929061);}(_0x0c8d,0x17e));var _0xd0c8=function(_0x2e4e19,_0x493b50){_0x2e4e19=_0x2e4e19-0x0;var _0x9ba20b=_0x0c8d[_0x2e4e19];return _0x9ba20b;};'use strict';var Sequelize=require('sequelize');module[_0xd0c8('0x0')]={'body':{'type':Sequelize[_0xd0c8('0x1')](_0xd0c8('0x2')),'allowNull':![]},'read':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'ChatInternalMessageId':{'type':Sequelize[_0xd0c8('0x3')]}};
\ No newline at end of file
diff --git a/server/api/chatInternalMessage/chatInternalMessage.controller.js b/server/api/chatInternalMessage/chatInternalMessage.controller.js
index 252801f..385a4d3 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 _0x3e43=['fieldName','type','model','query','keys','filters','attributes','fields','length','hasOwnProperty','nolimit','order','sort','filter','merge','where','VIRTUAL','options','includeAll','findAll','catch','show','params','include','create','body','find','describe','get','messages','lastMessageAt','lastMessage','format','YYYY-MM-DD\x20HH:mm:ss','agent','admin','user','fullname','role','userpic','internal','online','lastLoginAt','allowmessenger','showWebBar','-online','VoiceQueue','VoiceQueues','Unable\x20to\x20retrieve\x20the\x20current\x20user','Agents','userProfileId','autoAssociation','UserProfileResource','isEmpty','resourceId','push','createdAt','FromId','ToId','read','-createdAt','all','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','localhost','socket.io-emitter','register','status','json','limit','count','offset','set','Content-Range','apply','reject','save','update','then','destroy','end','sendStatus','error','stack','name','send','map','ChatInternalMessage','rawAttributes'];(function(_0x2d7eae,_0x484361){var _0x208af1=function(_0x2ef19c){while(--_0x2ef19c){_0x2d7eae['push'](_0x2d7eae['shift']());}};_0x208af1(++_0x484361);}(_0x3e43,0x19d));var _0x33e4=function(_0x55f8b4,_0x43f30d){_0x55f8b4=_0x55f8b4-0x0;var _0x2475f9=_0x3e43[_0x55f8b4];return _0x2475f9;};'use strict';var emlformat=require(_0x33e4('0x0'));var rimraf=require(_0x33e4('0x1'));var zipdir=require(_0x33e4('0x2'));var jsonpatch=require(_0x33e4('0x3'));var rp=require('request-promise');var moment=require(_0x33e4('0x4'));var BPromise=require(_0x33e4('0x5'));var Mustache=require(_0x33e4('0x6'));var util=require(_0x33e4('0x7'));var path=require('path');var sox=require(_0x33e4('0x8'));var csv=require(_0x33e4('0x9'));var ejs=require(_0x33e4('0xa'));var fs=require('fs');var fs_extra=require(_0x33e4('0xb'));var _=require(_0x33e4('0xc'));var squel=require(_0x33e4('0xd'));var crypto=require(_0x33e4('0xe'));var jsforce=require(_0x33e4('0xf'));var deskjs=require(_0x33e4('0x10'));var toCsv=require('to-csv');var querystring=require(_0x33e4('0x11'));var Papa=require(_0x33e4('0x12'));var Redis=require(_0x33e4('0x13'));var authService=require('../../components/auth/service');var qs=require(_0x33e4('0x14'));var as=require(_0x33e4('0x15'));var hardwareService=require(_0x33e4('0x16'));var logger=require(_0x33e4('0x17'))(_0x33e4('0x18'));var utils=require('../../config/utils');var config=require(_0x33e4('0x19'));var licenseUtil=require(_0x33e4('0x1a'));var db=require(_0x33e4('0x1b'))['db'];config[_0x33e4('0x1c')]=_[_0x33e4('0x1d')](config['redis'],{'host':_0x33e4('0x1e'),'port':0x18eb});var socket=require(_0x33e4('0x1f'))(new Redis(config[_0x33e4('0x1c')]));require('./chatInternalMessage.socket')[_0x33e4('0x20')](socket);function respondWithStatusCode(_0x32a2a2,_0x430abc){_0x430abc=_0x430abc||0xcc;return function(_0x3b084e){if(_0x3b084e){return _0x32a2a2['sendStatus'](_0x430abc);}return _0x32a2a2[_0x33e4('0x21')](_0x430abc)['end']();};}function respondWithResult(_0x519e25,_0x49c91f){_0x49c91f=_0x49c91f||0xc8;return function(_0x2470bc){if(_0x2470bc){return _0x519e25[_0x33e4('0x21')](_0x49c91f)[_0x33e4('0x22')](_0x2470bc);}};}function respondWithFilteredResult(_0x139e2e,_0xf1628){return function(_0x56e305){if(_0x56e305){var _0x5129a3=typeof _0xf1628['offset']==='undefined'&&typeof _0xf1628[_0x33e4('0x23')]==='undefined';var _0x19eb4c=_0x56e305[_0x33e4('0x24')];var _0xd251e8=_0x5129a3?0x0:_0xf1628['offset'];var _0x53c3b8=_0x5129a3?_0x56e305[_0x33e4('0x24')]:_0xf1628[_0x33e4('0x25')]+_0xf1628['limit'];var _0x55ceca;if(_0x53c3b8>=_0x19eb4c){_0x53c3b8=_0x19eb4c;_0x55ceca=0xc8;}else{_0x55ceca=0xce;}_0x139e2e[_0x33e4('0x21')](_0x55ceca);return _0x139e2e[_0x33e4('0x26')](_0x33e4('0x27'),_0xd251e8+'-'+_0x53c3b8+'/'+_0x19eb4c)[_0x33e4('0x22')](_0x56e305);}return null;};}function patchUpdates(_0x59fc4a){return function(_0x82a9f6){try{jsonpatch[_0x33e4('0x28')](_0x82a9f6,_0x59fc4a,!![]);}catch(_0x846a34){return BPromise[_0x33e4('0x29')](_0x846a34);}return _0x82a9f6[_0x33e4('0x2a')]();};}function saveUpdates(_0x2977e1,_0x5223ac){return function(_0x50ecfb){if(_0x50ecfb){return _0x50ecfb[_0x33e4('0x2b')](_0x2977e1)[_0x33e4('0x2c')](function(_0x385a33){return _0x385a33;});}return null;};}function removeEntity(_0x253540,_0x47ed14){return function(_0xde7b86){if(_0xde7b86){return _0xde7b86[_0x33e4('0x2d')]()[_0x33e4('0x2c')](function(){_0x253540['status'](0xcc)[_0x33e4('0x2e')]();});}};}function handleEntityNotFound(_0x509847,_0x5b7e54){return function(_0x540e7f){if(!_0x540e7f){_0x509847[_0x33e4('0x2f')](0x194);}return _0x540e7f;};}function handleError(_0x46be70,_0x520b26){_0x520b26=_0x520b26||0x1f4;return function(_0x38102c){logger[_0x33e4('0x30')](_0x38102c[_0x33e4('0x31')]);if(_0x38102c[_0x33e4('0x32')]){delete _0x38102c[_0x33e4('0x32')];}_0x46be70['status'](_0x520b26)[_0x33e4('0x33')](_0x38102c);};}exports['index']=function(_0x412c45,_0x3c6a70){var _0x15f297={},_0x95ab89={},_0x267278={'count':0x0,'rows':[]};var _0x4a45e3=_[_0x33e4('0x34')](db[_0x33e4('0x35')][_0x33e4('0x36')],function(_0x3178b0){return{'name':_0x3178b0[_0x33e4('0x37')],'type':_0x3178b0[_0x33e4('0x38')]['key']};});_0x95ab89[_0x33e4('0x39')]=_[_0x33e4('0x34')](_0x4a45e3,_0x33e4('0x32'));_0x95ab89[_0x33e4('0x3a')]=_[_0x33e4('0x3b')](_0x412c45[_0x33e4('0x3a')]);_0x95ab89[_0x33e4('0x3c')]=_['intersection'](_0x95ab89[_0x33e4('0x39')],_0x95ab89['query']);_0x15f297[_0x33e4('0x3d')]=_['intersection'](_0x95ab89['model'],qs[_0x33e4('0x3e')](_0x412c45[_0x33e4('0x3a')][_0x33e4('0x3e')]));_0x15f297[_0x33e4('0x3d')]=_0x15f297[_0x33e4('0x3d')][_0x33e4('0x3f')]?_0x15f297['attributes']:_0x95ab89['model'];if(!_0x412c45[_0x33e4('0x3a')][_0x33e4('0x40')](_0x33e4('0x41'))){_0x15f297[_0x33e4('0x23')]=qs[_0x33e4('0x23')](_0x412c45['query'][_0x33e4('0x23')]);_0x15f297[_0x33e4('0x25')]=qs[_0x33e4('0x25')](_0x412c45['query'][_0x33e4('0x25')]);}_0x15f297[_0x33e4('0x42')]=qs[_0x33e4('0x43')](_0x412c45[_0x33e4('0x3a')]['sort']);_0x15f297['where']=qs['filters'](_['pick'](_0x412c45[_0x33e4('0x3a')],_0x95ab89[_0x33e4('0x3c')]),_0x4a45e3);if(_0x412c45['query'][_0x33e4('0x44')]){_0x15f297['where']=_[_0x33e4('0x45')](_0x15f297[_0x33e4('0x46')],{'$or':_[_0x33e4('0x34')](_0x4a45e3,function(_0x52c088){if(_0x52c088[_0x33e4('0x38')]!==_0x33e4('0x47')){var _0x3c5db0={};_0x3c5db0[_0x52c088[_0x33e4('0x32')]]={'$like':'%'+_0x412c45[_0x33e4('0x3a')][_0x33e4('0x44')]+'%'};return _0x3c5db0;}})});}_0x15f297=_[_0x33e4('0x45')]({},_0x15f297,_0x412c45[_0x33e4('0x48')]);var _0x5ba6c0={'where':_0x15f297['where']};return db[_0x33e4('0x35')]['count'](_0x5ba6c0)['then'](function(_0x211638){_0x267278[_0x33e4('0x24')]=_0x211638;if(_0x412c45['query'][_0x33e4('0x49')]){_0x15f297['include']=[{'all':!![]}];}return db[_0x33e4('0x35')][_0x33e4('0x4a')](_0x15f297);})[_0x33e4('0x2c')](function(_0x36d244){_0x267278['rows']=_0x36d244;return _0x267278;})[_0x33e4('0x2c')](respondWithFilteredResult(_0x3c6a70,_0x15f297))[_0x33e4('0x4b')](handleError(_0x3c6a70,null));};exports[_0x33e4('0x4c')]=function(_0x7c4b22,_0x4271b8){var _0x85c72a={'raw':!![],'where':{'id':_0x7c4b22[_0x33e4('0x4d')]['id']}},_0x25362e={};_0x25362e[_0x33e4('0x39')]=_['keys'](db[_0x33e4('0x35')][_0x33e4('0x36')]);_0x25362e[_0x33e4('0x3a')]=_['keys'](_0x7c4b22[_0x33e4('0x3a')]);_0x25362e[_0x33e4('0x3c')]=_['intersection'](_0x25362e['model'],_0x25362e[_0x33e4('0x3a')]);_0x85c72a['attributes']=_['intersection'](_0x25362e['model'],qs[_0x33e4('0x3e')](_0x7c4b22[_0x33e4('0x3a')][_0x33e4('0x3e')]));_0x85c72a[_0x33e4('0x3d')]=_0x85c72a[_0x33e4('0x3d')]['length']?_0x85c72a['attributes']:_0x25362e['model'];if(_0x7c4b22[_0x33e4('0x3a')]['includeAll']){_0x85c72a[_0x33e4('0x4e')]=[{'all':!![]}];}_0x85c72a=_[_0x33e4('0x45')]({},_0x85c72a,_0x7c4b22[_0x33e4('0x48')]);return db[_0x33e4('0x35')]['find'](_0x85c72a)[_0x33e4('0x2c')](handleEntityNotFound(_0x4271b8,null))[_0x33e4('0x2c')](respondWithResult(_0x4271b8,null))['catch'](handleError(_0x4271b8,null));};exports[_0x33e4('0x4f')]=function(_0x3fccfb,_0x5dab6f){return db[_0x33e4('0x35')]['create'](_0x3fccfb[_0x33e4('0x50')],{})[_0x33e4('0x2c')](respondWithResult(_0x5dab6f,0xc9))[_0x33e4('0x4b')](handleError(_0x5dab6f,null));};exports[_0x33e4('0x2b')]=function(_0x743c09,_0x461eb4){if(_0x743c09[_0x33e4('0x50')]['id']){delete _0x743c09[_0x33e4('0x50')]['id'];}return db['ChatInternalMessage'][_0x33e4('0x51')]({'where':{'id':_0x743c09[_0x33e4('0x4d')]['id']}})[_0x33e4('0x2c')](handleEntityNotFound(_0x461eb4,null))[_0x33e4('0x2c')](saveUpdates(_0x743c09[_0x33e4('0x50')],null))[_0x33e4('0x2c')](respondWithResult(_0x461eb4,null))[_0x33e4('0x4b')](handleError(_0x461eb4,null));};exports['destroy']=function(_0x248f38,_0xadfc09){return db[_0x33e4('0x35')][_0x33e4('0x51')]({'where':{'id':_0x248f38['params']['id']}})[_0x33e4('0x2c')](handleEntityNotFound(_0xadfc09,null))[_0x33e4('0x2c')](removeEntity(_0xadfc09,null))[_0x33e4('0x4b')](handleError(_0xadfc09,null));};exports[_0x33e4('0x52')]=function(_0x15b56c,_0x545ea3){return db[_0x33e4('0x35')][_0x33e4('0x52')]()['then'](respondWithResult(_0x545ea3,null))['catch'](handleError(_0x545ea3,null));};function wrapUser(_0x363543){return function(_0x343f47){var _0x3934af=_0x363543[_0x33e4('0x53')]({'plain':!![]});_0x3934af[_0x33e4('0x54')]=[];if(_0x343f47){_0x3934af[_0x33e4('0x55')]=_0x343f47['createdAt'];_0x3934af[_0x33e4('0x56')]=_0x343f47;}else{_0x3934af[_0x33e4('0x55')]=moment(0x0)[_0x33e4('0x57')](_0x33e4('0x58'));_0x3934af['lastMessage']={};}return _0x3934af;};}exports['getUsers']=function(_0x362b2f,_0x2cd79d,_0xd5a425){var _0x55feee=[];return db['User']['findAll']({'where':{'role':[_0x33e4('0x59'),_0x33e4('0x5a'),_0x33e4('0x5b')]},'attributes':['id',_0x33e4('0x5c'),_0x33e4('0x32'),_0x33e4('0x5d'),_0x33e4('0x5e'),_0x33e4('0x5f'),_0x33e4('0x60'),_0x33e4('0x61'),_0x33e4('0x62'),_0x33e4('0x63')],'order':qs[_0x33e4('0x43')](_0x33e4('0x64')),'include':[{'model':db[_0x33e4('0x65')],'as':_0x33e4('0x66'),'attributes':['id',_0x33e4('0x32'),_0x33e4('0x38')],'through':{'attributes':[]}}]})[_0x33e4('0x2c')](function(_0x5f409e){if(_0x5f409e){var _0x15acf3=_0x362b2f[_0x33e4('0x5b')][_0x33e4('0x53')]({'plain':!![]});if(!_0x15acf3)throw new Error(_0x33e4('0x67'));if(_0x15acf3[_0x33e4('0x5d')]===_0x33e4('0x5b')){return db['UserProfileSection']['find']({'where':{'name':_0x33e4('0x68'),'userProfileId':_0x15acf3[_0x33e4('0x69')]},'raw':!![]})[_0x33e4('0x2c')](function(_0x29a81a){if(_0x29a81a){if(_0x29a81a[_0x33e4('0x6a')]===0x0){return db[_0x33e4('0x6b')][_0x33e4('0x4a')]({'where':{'sectionId':_0x29a81a['id']},'raw':!![]})[_0x33e4('0x2c')](function(_0x4a53af){var _0x29a79a=[];if(_[_0x33e4('0x6c')](_0x4a53af)){_0x29a79a=_['filter'](_0x5f409e,function(_0x168ad7){if(_0x168ad7['role']!==_0x33e4('0x59')){return _0x168ad7;}});return _0x29a79a;}else{for(var _0x1bd0f9=0x0;_0x1bd0f9<_0x5f409e['length'];_0x1bd0f9++){var _0x18b277=_0x5f409e[_0x1bd0f9];if(_0x18b277['role']===_0x33e4('0x59')){var _0x4e35d3=_[_0x33e4('0x51')](_0x4a53af,function(_0xb66aae){return _0xb66aae[_0x33e4('0x6d')]===_0x18b277['id'];});if(_0x4e35d3)_0x29a79a[_0x33e4('0x6e')](_0x18b277);}else{_0x29a79a['push'](_0x18b277);}}return _0x29a79a;}});}else{return _0x5f409e;}}else{var _0x26821a=_[_0x33e4('0x44')](_0x5f409e,function(_0x54eefb){if(_0x54eefb[_0x33e4('0x5d')]!==_0x33e4('0x59')){return _0x54eefb;}});return _0x26821a;}});}else{return _0x5f409e;}}})[_0x33e4('0x2c')](function(_0x626a22){var _0x5ac75e=[];if(_0x626a22){_0x55feee=_0x626a22;for(var _0x3e884b=0x0;_0x3e884b<_0x626a22[_0x33e4('0x3f')];_0x3e884b+=0x1){_0x55feee[_0x3e884b][_0x33e4('0x54')]=[];_0x5ac75e[_0x33e4('0x6e')](db[_0x33e4('0x35')][_0x33e4('0x51')]({'where':{'FromId':[_0x362b2f[_0x33e4('0x5b')]['id'],_0x626a22[_0x3e884b]['id']],'ToId':[_0x362b2f[_0x33e4('0x5b')]['id'],_0x626a22[_0x3e884b]['id']],'ChatGroupId':null},'attributes':['id',_0x33e4('0x6f'),_0x33e4('0x70'),_0x33e4('0x71'),_0x33e4('0x72'),_0x33e4('0x50')],'order':qs['sort'](_0x33e4('0x73')),'limit':0x1,'offset':0x0,'raw':!![]})[_0x33e4('0x2c')](wrapUser(_0x626a22[_0x3e884b])));}return BPromise[_0x33e4('0x74')](_0x5ac75e);}return[];})[_0x33e4('0x2c')](function(_0x6296f2){return{'rows':_0x6296f2,'count':_0x6296f2[_0x33e4('0x3f')]};})[_0x33e4('0x2c')](respondWithResult(_0x2cd79d,null))['catch'](handleError(_0x2cd79d,null));};
\ No newline at end of file
+var _0x4269=['nolimit','sort','where','merge','filter','includeAll','findAll','rows','catch','show','params','keys','find','create','body','describe','get','createdAt','lastMessage','lastMessageAt','format','YYYY-MM-DD\x20HH:mm:ss','getUsers','User','agent','admin','user','fullname','role','allowmessenger','showWebBar','-online','VoiceQueue','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','Agents','userProfileId','autoAssociation','UserProfileResource','isEmpty','resourceId','push','messages','FromId','ToId','read','-createdAt','all','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/environment','../../config/license/util','../../mysqldb','localhost','socket.io-emitter','./chatInternalMessage.socket','sendStatus','status','json','undefined','limit','count','offset','set','Content-Range','reject','save','update','then','destroy','stack','name','send','index','ChatInternalMessage','rawAttributes','type','key','model','map','query','filters','intersection','attributes','fields','length','hasOwnProperty'];(function(_0x34f1f9,_0x1343d0){var _0x4c28dd=function(_0x8d623d){while(--_0x8d623d){_0x34f1f9['push'](_0x34f1f9['shift']());}};_0x4c28dd(++_0x1343d0);}(_0x4269,0x10a));var _0x9426=function(_0xa1dc2c,_0x6d230d){_0xa1dc2c=_0xa1dc2c-0x0;var _0x4caf06=_0x4269[_0xa1dc2c];return _0x4caf06;};'use strict';var emlformat=require(_0x9426('0x0'));var rimraf=require(_0x9426('0x1'));var zipdir=require(_0x9426('0x2'));var jsonpatch=require(_0x9426('0x3'));var rp=require(_0x9426('0x4'));var moment=require(_0x9426('0x5'));var BPromise=require(_0x9426('0x6'));var Mustache=require('mustache');var util=require(_0x9426('0x7'));var path=require(_0x9426('0x8'));var sox=require(_0x9426('0x9'));var csv=require(_0x9426('0xa'));var ejs=require(_0x9426('0xb'));var fs=require('fs');var fs_extra=require(_0x9426('0xc'));var _=require(_0x9426('0xd'));var squel=require(_0x9426('0xe'));var crypto=require(_0x9426('0xf'));var jsforce=require(_0x9426('0x10'));var deskjs=require(_0x9426('0x11'));var toCsv=require(_0x9426('0xa'));var querystring=require(_0x9426('0x12'));var Papa=require(_0x9426('0x13'));var Redis=require(_0x9426('0x14'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0x9426('0x15'));var hardwareService=require(_0x9426('0x16'));var logger=require(_0x9426('0x17'))('api');var utils=require('../../config/utils');var config=require(_0x9426('0x18'));var licenseUtil=require(_0x9426('0x19'));var db=require(_0x9426('0x1a'))['db'];config['redis']=_['defaults'](config['redis'],{'host':_0x9426('0x1b'),'port':0x18eb});var socket=require(_0x9426('0x1c'))(new Redis(config['redis']));require(_0x9426('0x1d'))['register'](socket);function respondWithStatusCode(_0x279848,_0x29461a){_0x29461a=_0x29461a||0xcc;return function(_0x5c86b3){if(_0x5c86b3){return _0x279848[_0x9426('0x1e')](_0x29461a);}return _0x279848['status'](_0x29461a)['end']();};}function respondWithResult(_0x3ee37d,_0x1aa2a3){_0x1aa2a3=_0x1aa2a3||0xc8;return function(_0xf9332){if(_0xf9332){return _0x3ee37d[_0x9426('0x1f')](_0x1aa2a3)[_0x9426('0x20')](_0xf9332);}};}function respondWithFilteredResult(_0x54777b,_0x3357dc){return function(_0x5e7622){if(_0x5e7622){var _0x132756=typeof _0x3357dc['offset']===_0x9426('0x21')&&typeof _0x3357dc[_0x9426('0x22')]==='undefined';var _0xdc9b63=_0x5e7622[_0x9426('0x23')];var _0x279edf=_0x132756?0x0:_0x3357dc[_0x9426('0x24')];var _0x5dd204=_0x132756?_0x5e7622[_0x9426('0x23')]:_0x3357dc[_0x9426('0x24')]+_0x3357dc[_0x9426('0x22')];var _0x5589a3;if(_0x5dd204>=_0xdc9b63){_0x5dd204=_0xdc9b63;_0x5589a3=0xc8;}else{_0x5589a3=0xce;}_0x54777b['status'](_0x5589a3);return _0x54777b[_0x9426('0x25')](_0x9426('0x26'),_0x279edf+'-'+_0x5dd204+'/'+_0xdc9b63)['json'](_0x5e7622);}return null;};}function patchUpdates(_0x3f8af5){return function(_0x1d9495){try{jsonpatch['apply'](_0x1d9495,_0x3f8af5,!![]);}catch(_0x4942a4){return BPromise[_0x9426('0x27')](_0x4942a4);}return _0x1d9495[_0x9426('0x28')]();};}function saveUpdates(_0x5230f1,_0x4a5b00){return function(_0x4623c1){if(_0x4623c1){return _0x4623c1[_0x9426('0x29')](_0x5230f1)[_0x9426('0x2a')](function(_0x31c7e8){return _0x31c7e8;});}return null;};}function removeEntity(_0x69babb,_0x3192c0){return function(_0xdc4e0d){if(_0xdc4e0d){return _0xdc4e0d[_0x9426('0x2b')]()['then'](function(){_0x69babb[_0x9426('0x1f')](0xcc)['end']();});}};}function handleEntityNotFound(_0x36797b,_0x205e20){return function(_0x583018){if(!_0x583018){_0x36797b['sendStatus'](0x194);}return _0x583018;};}function handleError(_0x35deca,_0x1e0e98){_0x1e0e98=_0x1e0e98||0x1f4;return function(_0x104fab){logger['error'](_0x104fab[_0x9426('0x2c')]);if(_0x104fab[_0x9426('0x2d')]){delete _0x104fab[_0x9426('0x2d')];}_0x35deca[_0x9426('0x1f')](_0x1e0e98)[_0x9426('0x2e')](_0x104fab);};}exports[_0x9426('0x2f')]=function(_0x34fa6b,_0x2e4068){var _0x19deaa={},_0x46e2b3={},_0x571c13={'count':0x0,'rows':[]};var _0x1a3a9d=_['map'](db[_0x9426('0x30')][_0x9426('0x31')],function(_0x281f3d){return{'name':_0x281f3d['fieldName'],'type':_0x281f3d[_0x9426('0x32')][_0x9426('0x33')]};});_0x46e2b3[_0x9426('0x34')]=_[_0x9426('0x35')](_0x1a3a9d,_0x9426('0x2d'));_0x46e2b3[_0x9426('0x36')]=_['keys'](_0x34fa6b[_0x9426('0x36')]);_0x46e2b3[_0x9426('0x37')]=_[_0x9426('0x38')](_0x46e2b3[_0x9426('0x34')],_0x46e2b3[_0x9426('0x36')]);_0x19deaa[_0x9426('0x39')]=_['intersection'](_0x46e2b3[_0x9426('0x34')],qs[_0x9426('0x3a')](_0x34fa6b['query'][_0x9426('0x3a')]));_0x19deaa[_0x9426('0x39')]=_0x19deaa[_0x9426('0x39')][_0x9426('0x3b')]?_0x19deaa[_0x9426('0x39')]:_0x46e2b3[_0x9426('0x34')];if(!_0x34fa6b['query'][_0x9426('0x3c')](_0x9426('0x3d'))){_0x19deaa[_0x9426('0x22')]=qs[_0x9426('0x22')](_0x34fa6b[_0x9426('0x36')][_0x9426('0x22')]);_0x19deaa[_0x9426('0x24')]=qs[_0x9426('0x24')](_0x34fa6b[_0x9426('0x36')][_0x9426('0x24')]);}_0x19deaa['order']=qs[_0x9426('0x3e')](_0x34fa6b['query'][_0x9426('0x3e')]);_0x19deaa[_0x9426('0x3f')]=qs[_0x9426('0x37')](_['pick'](_0x34fa6b['query'],_0x46e2b3[_0x9426('0x37')]),_0x1a3a9d);if(_0x34fa6b[_0x9426('0x36')]['filter']){_0x19deaa[_0x9426('0x3f')]=_[_0x9426('0x40')](_0x19deaa[_0x9426('0x3f')],{'$or':_[_0x9426('0x35')](_0x1a3a9d,function(_0x367945){if(_0x367945[_0x9426('0x32')]!=='VIRTUAL'){var _0x8452d5={};_0x8452d5[_0x367945[_0x9426('0x2d')]]={'$like':'%'+_0x34fa6b[_0x9426('0x36')][_0x9426('0x41')]+'%'};return _0x8452d5;}})});}_0x19deaa=_[_0x9426('0x40')]({},_0x19deaa,_0x34fa6b['options']);var _0x9b3e2d={'where':_0x19deaa[_0x9426('0x3f')]};return db[_0x9426('0x30')][_0x9426('0x23')](_0x9b3e2d)[_0x9426('0x2a')](function(_0x4f2a4a){_0x571c13[_0x9426('0x23')]=_0x4f2a4a;if(_0x34fa6b[_0x9426('0x36')][_0x9426('0x42')]){_0x19deaa['include']=[{'all':!![]}];}return db['ChatInternalMessage'][_0x9426('0x43')](_0x19deaa);})[_0x9426('0x2a')](function(_0x46cb3a){_0x571c13[_0x9426('0x44')]=_0x46cb3a;return _0x571c13;})['then'](respondWithFilteredResult(_0x2e4068,_0x19deaa))[_0x9426('0x45')](handleError(_0x2e4068,null));};exports[_0x9426('0x46')]=function(_0x2d3399,_0x451dec){var _0x446dea={'raw':!![],'where':{'id':_0x2d3399[_0x9426('0x47')]['id']}},_0x15c86d={};_0x15c86d[_0x9426('0x34')]=_[_0x9426('0x48')](db[_0x9426('0x30')][_0x9426('0x31')]);_0x15c86d[_0x9426('0x36')]=_[_0x9426('0x48')](_0x2d3399[_0x9426('0x36')]);_0x15c86d['filters']=_[_0x9426('0x38')](_0x15c86d[_0x9426('0x34')],_0x15c86d[_0x9426('0x36')]);_0x446dea[_0x9426('0x39')]=_['intersection'](_0x15c86d['model'],qs[_0x9426('0x3a')](_0x2d3399[_0x9426('0x36')]['fields']));_0x446dea[_0x9426('0x39')]=_0x446dea[_0x9426('0x39')][_0x9426('0x3b')]?_0x446dea['attributes']:_0x15c86d[_0x9426('0x34')];if(_0x2d3399[_0x9426('0x36')][_0x9426('0x42')]){_0x446dea['include']=[{'all':!![]}];}_0x446dea=_[_0x9426('0x40')]({},_0x446dea,_0x2d3399['options']);return db[_0x9426('0x30')][_0x9426('0x49')](_0x446dea)['then'](handleEntityNotFound(_0x451dec,null))[_0x9426('0x2a')](respondWithResult(_0x451dec,null))[_0x9426('0x45')](handleError(_0x451dec,null));};exports['create']=function(_0x55e8b8,_0x3434f9){return db[_0x9426('0x30')][_0x9426('0x4a')](_0x55e8b8[_0x9426('0x4b')],{})['then'](respondWithResult(_0x3434f9,0xc9))[_0x9426('0x45')](handleError(_0x3434f9,null));};exports['update']=function(_0x166fb0,_0x431c40){if(_0x166fb0[_0x9426('0x4b')]['id']){delete _0x166fb0[_0x9426('0x4b')]['id'];}return db[_0x9426('0x30')]['find']({'where':{'id':_0x166fb0[_0x9426('0x47')]['id']}})[_0x9426('0x2a')](handleEntityNotFound(_0x431c40,null))[_0x9426('0x2a')](saveUpdates(_0x166fb0[_0x9426('0x4b')],null))[_0x9426('0x2a')](respondWithResult(_0x431c40,null))[_0x9426('0x45')](handleError(_0x431c40,null));};exports[_0x9426('0x2b')]=function(_0x28b692,_0x46241d){return db[_0x9426('0x30')][_0x9426('0x49')]({'where':{'id':_0x28b692[_0x9426('0x47')]['id']}})[_0x9426('0x2a')](handleEntityNotFound(_0x46241d,null))[_0x9426('0x2a')](removeEntity(_0x46241d,null))[_0x9426('0x45')](handleError(_0x46241d,null));};exports[_0x9426('0x4c')]=function(_0x31cff7,_0x2e4931){return db['ChatInternalMessage'][_0x9426('0x4c')]()[_0x9426('0x2a')](respondWithResult(_0x2e4931,null))[_0x9426('0x45')](handleError(_0x2e4931,null));};function wrapUser(_0x4b7e22){return function(_0x47d69){var _0x5678cf=_0x4b7e22[_0x9426('0x4d')]({'plain':!![]});_0x5678cf['messages']=[];if(_0x47d69){_0x5678cf['lastMessageAt']=_0x47d69[_0x9426('0x4e')];_0x5678cf[_0x9426('0x4f')]=_0x47d69;}else{_0x5678cf[_0x9426('0x50')]=moment(0x0)[_0x9426('0x51')](_0x9426('0x52'));_0x5678cf[_0x9426('0x4f')]={};}return _0x5678cf;};}exports[_0x9426('0x53')]=function(_0x20b6ca,_0x371e2b,_0xf04584){var _0x39fc17=[];return db[_0x9426('0x54')][_0x9426('0x43')]({'where':{'role':[_0x9426('0x55'),_0x9426('0x56'),_0x9426('0x57')]},'attributes':['id',_0x9426('0x58'),_0x9426('0x2d'),_0x9426('0x59'),'userpic','internal','online','lastLoginAt',_0x9426('0x5a'),_0x9426('0x5b')],'order':qs['sort'](_0x9426('0x5c')),'include':[{'model':db[_0x9426('0x5d')],'as':'VoiceQueues','attributes':['id',_0x9426('0x2d'),'type'],'through':{'attributes':[]}}]})[_0x9426('0x2a')](function(_0x1db3be){if(_0x1db3be){var _0x2c2c03=_0x20b6ca['user']['get']({'plain':!![]});if(!_0x2c2c03)throw new Error(_0x9426('0x5e'));if(_0x2c2c03[_0x9426('0x59')]===_0x9426('0x57')){return db[_0x9426('0x5f')][_0x9426('0x49')]({'where':{'name':_0x9426('0x60'),'userProfileId':_0x2c2c03[_0x9426('0x61')]},'raw':!![]})[_0x9426('0x2a')](function(_0x267209){if(_0x267209){if(_0x267209[_0x9426('0x62')]===0x0){return db[_0x9426('0x63')][_0x9426('0x43')]({'where':{'sectionId':_0x267209['id']},'raw':!![]})[_0x9426('0x2a')](function(_0x474981){var _0x427812=[];if(_[_0x9426('0x64')](_0x474981)){_0x427812=_[_0x9426('0x41')](_0x1db3be,function(_0x2ca010){if(_0x2ca010[_0x9426('0x59')]!==_0x9426('0x55')){return _0x2ca010;}});return _0x427812;}else{for(var _0x3a1319=0x0;_0x3a1319<_0x1db3be[_0x9426('0x3b')];_0x3a1319++){var _0x26cab3=_0x1db3be[_0x3a1319];if(_0x26cab3[_0x9426('0x59')]==='agent'){var _0x4613fd=_[_0x9426('0x49')](_0x474981,function(_0x129c05){return _0x129c05[_0x9426('0x65')]===_0x26cab3['id'];});if(_0x4613fd)_0x427812[_0x9426('0x66')](_0x26cab3);}else{_0x427812[_0x9426('0x66')](_0x26cab3);}}return _0x427812;}});}else{return _0x1db3be;}}else{var _0x4c5053=_[_0x9426('0x41')](_0x1db3be,function(_0x1b0d24){if(_0x1b0d24[_0x9426('0x59')]!==_0x9426('0x55')){return _0x1b0d24;}});return _0x4c5053;}});}else{return _0x1db3be;}}})[_0x9426('0x2a')](function(_0x50155f){var _0x16e236=[];if(_0x50155f){_0x39fc17=_0x50155f;for(var _0x3a6ec=0x0;_0x3a6ec<_0x50155f[_0x9426('0x3b')];_0x3a6ec+=0x1){_0x39fc17[_0x3a6ec][_0x9426('0x67')]=[];_0x16e236[_0x9426('0x66')](db['ChatInternalMessage'][_0x9426('0x49')]({'where':{'FromId':[_0x20b6ca[_0x9426('0x57')]['id'],_0x50155f[_0x3a6ec]['id']],'ToId':[_0x20b6ca['user']['id'],_0x50155f[_0x3a6ec]['id']],'ChatGroupId':null},'attributes':['id','createdAt',_0x9426('0x68'),_0x9426('0x69'),_0x9426('0x6a'),_0x9426('0x4b')],'order':qs[_0x9426('0x3e')](_0x9426('0x6b')),'limit':0x1,'offset':0x0,'raw':!![]})[_0x9426('0x2a')](wrapUser(_0x50155f[_0x3a6ec])));}return BPromise[_0x9426('0x6c')](_0x16e236);}return[];})['then'](function(_0x5e6eb2){return{'rows':_0x5e6eb2,'count':_0x5e6eb2[_0x9426('0x3b')]};})['then'](respondWithResult(_0x371e2b,null))[_0x9426('0x45')](handleError(_0x371e2b,null));};
\ No newline at end of file
diff --git a/server/api/chatInternalMessage/chatInternalMessage.events.js b/server/api/chatInternalMessage/chatInternalMessage.events.js
index 744f3b4..03d2288 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 _0x326b=['save','update','emit','hasOwnProperty','hook','exports','events','../../mysqldb','ChatInternalMessage','setMaxListeners'];(function(_0x340aa5,_0x2d5553){var _0x3a5b7f=function(_0x23758f){while(--_0x23758f){_0x340aa5['push'](_0x340aa5['shift']());}};_0x3a5b7f(++_0x2d5553);}(_0x326b,0x1dc));var _0xb326=function(_0x16d411,_0x5e0970){_0x16d411=_0x16d411-0x0;var _0x20336d=_0x326b[_0x16d411];return _0x20336d;};'use strict';var EventEmitter=require(_0xb326('0x0'));var ChatInternalMessage=require(_0xb326('0x1'))['db'][_0xb326('0x2')];var ChatInternalMessageEvents=new EventEmitter();ChatInternalMessageEvents[_0xb326('0x3')](0x0);var events={'afterCreate':_0xb326('0x4'),'afterUpdate':_0xb326('0x5'),'afterDestroy':'remove'};function emitEvent(_0x3fdbc2){return function(_0x50e112,_0x217543,_0x51ffb8){ChatInternalMessageEvents[_0xb326('0x6')](_0x3fdbc2+':'+_0x50e112['id'],_0x50e112);ChatInternalMessageEvents['emit'](_0x3fdbc2,_0x50e112);_0x51ffb8(null);};}for(var e in events){if(events[_0xb326('0x7')](e)){var event=events[e];ChatInternalMessage[_0xb326('0x8')](e,emitEvent(event));}}module[_0xb326('0x9')]=ChatInternalMessageEvents;
\ No newline at end of file
+var _0xc8d2=['setMaxListeners','save','remove','emit','hasOwnProperty','hook','exports','events','../../mysqldb','ChatInternalMessage'];(function(_0x434351,_0x1ab289){var _0x3df67f=function(_0x2f31a0){while(--_0x2f31a0){_0x434351['push'](_0x434351['shift']());}};_0x3df67f(++_0x1ab289);}(_0xc8d2,0xf7));var _0x2c8d=function(_0x1ee367,_0x2e5568){_0x1ee367=_0x1ee367-0x0;var _0x5b51bc=_0xc8d2[_0x1ee367];return _0x5b51bc;};'use strict';var EventEmitter=require(_0x2c8d('0x0'));var ChatInternalMessage=require(_0x2c8d('0x1'))['db'][_0x2c8d('0x2')];var ChatInternalMessageEvents=new EventEmitter();ChatInternalMessageEvents[_0x2c8d('0x3')](0x0);var events={'afterCreate':_0x2c8d('0x4'),'afterUpdate':'update','afterDestroy':_0x2c8d('0x5')};function emitEvent(_0x3b4c6e){return function(_0xc23346,_0x1fe7a7,_0x38f2f9){ChatInternalMessageEvents['emit'](_0x3b4c6e+':'+_0xc23346['id'],_0xc23346);ChatInternalMessageEvents[_0x2c8d('0x6')](_0x3b4c6e,_0xc23346);_0x38f2f9(null);};}for(var e in events){if(events[_0x2c8d('0x7')](e)){var event=events[e];ChatInternalMessage[_0x2c8d('0x8')](e,emitEvent(event));}}module[_0x2c8d('0x9')]=ChatInternalMessageEvents;
\ No newline at end of file
diff --git a/server/api/chatInternalMessage/chatInternalMessage.model.js b/server/api/chatInternalMessage/chatInternalMessage.model.js
index 7a0c0b5..3172ddd 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 _0xc101=['rimraf','../../config/environment','./chatInternalMessage.attributes','exports','define','chat_internal_messages','utf8mb4_unicode_ci','util','../../config/logger','moment','bluebird','path'];(function(_0x41be79,_0x51393e){var _0x37ffca=function(_0x4a6d78){while(--_0x4a6d78){_0x41be79['push'](_0x41be79['shift']());}};_0x37ffca(++_0x51393e);}(_0xc101,0x1f3));var _0x1c10=function(_0x3e91a9,_0x53c466){_0x3e91a9=_0x3e91a9-0x0;var _0x25c9ad=_0xc101[_0x3e91a9];return _0x25c9ad;};'use strict';var _=require('lodash');var util=require(_0x1c10('0x0'));var logger=require(_0x1c10('0x1'))('api');var moment=require(_0x1c10('0x2'));var BPromise=require(_0x1c10('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x1c10('0x4'));var rimraf=require(_0x1c10('0x5'));var config=require(_0x1c10('0x6'));var attributes=require(_0x1c10('0x7'));module[_0x1c10('0x8')]=function(_0x259de2,_0x3f9418){return _0x259de2[_0x1c10('0x9')]('ChatInternalMessage',attributes,{'tableName':_0x1c10('0xa'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':'utf8mb4','collate':_0x1c10('0xb')});};
\ No newline at end of file
+var _0x930f=['./chatInternalMessage.attributes','exports','define','ChatInternalMessage','chat_internal_messages','utf8mb4','lodash','api','moment','rimraf','../../config/environment'];(function(_0x5f4db8,_0x50de79){var _0x558cec=function(_0x585309){while(--_0x585309){_0x5f4db8['push'](_0x5f4db8['shift']());}};_0x558cec(++_0x50de79);}(_0x930f,0x1a8));var _0xf930=function(_0x360c70,_0x546df5){_0x360c70=_0x360c70-0x0;var _0xa5adc8=_0x930f[_0x360c70];return _0xa5adc8;};'use strict';var _=require(_0xf930('0x0'));var util=require('util');var logger=require('../../config/logger')(_0xf930('0x1'));var moment=require(_0xf930('0x2'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0xf930('0x3'));var config=require(_0xf930('0x4'));var attributes=require(_0xf930('0x5'));module[_0xf930('0x6')]=function(_0x24a83d,_0x441f44){return _0x24a83d[_0xf930('0x7')](_0xf930('0x8'),attributes,{'tableName':_0xf930('0x9'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0xf930('0xa'),'collate':'utf8mb4_unicode_ci'});};
\ No newline at end of file
diff --git a/server/api/chatInternalMessage/chatInternalMessage.rpc.js b/server/api/chatInternalMessage/chatInternalMessage.rpc.js
index bd4b1f6..527d41b 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 _0x57b8=['message','result','catch','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','./chatInternalMessage.socket','register','request','then','info','ChatInternalMessage,\x20%s,\x20%s','request\x20sent','debug','ChatInternalMessage,\x20%s,\x20%s,\x20%s','error'];(function(_0x93b411,_0x4263ca){var _0x14ce11=function(_0x3f71c4){while(--_0x3f71c4){_0x93b411['push'](_0x93b411['shift']());}};_0x14ce11(++_0x4263ca);}(_0x57b8,0x17c));var _0x857b=function(_0x49f3cc,_0x46f3e0){_0x49f3cc=_0x49f3cc-0x0;var _0x499553=_0x57b8[_0x49f3cc];return _0x499553;};'use strict';var _=require(_0x857b('0x0'));var util=require(_0x857b('0x1'));var moment=require(_0x857b('0x2'));var BPromise=require(_0x857b('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x857b('0x4'));var db=require(_0x857b('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x857b('0x6'))(_0x857b('0x7'));var config=require(_0x857b('0x8'));var jayson=require(_0x857b('0x9'));var client=jayson[_0x857b('0xa')][_0x857b('0xb')]({'port':0x232a});config[_0x857b('0xc')]=_[_0x857b('0xd')](config[_0x857b('0xc')],{'host':_0x857b('0xe'),'port':0x18eb});var socket=require(_0x857b('0xf'))(new Redis(config['redis']));require(_0x857b('0x10'))[_0x857b('0x11')](socket);function respondWithRpcPromise(_0x5167fe,_0x4cd93b,_0x31f976){return new BPromise(function(_0x3710be,_0x1e994b){return client[_0x857b('0x12')](_0x5167fe,_0x31f976)[_0x857b('0x13')](function(_0x39a5be){logger[_0x857b('0x14')](_0x857b('0x15'),_0x4cd93b,_0x857b('0x16'));logger[_0x857b('0x17')](_0x857b('0x18'),_0x4cd93b,_0x857b('0x16'),JSON['stringify'](_0x39a5be));if(_0x39a5be[_0x857b('0x19')]){if(_0x39a5be['error']['code']===0x1f4){logger[_0x857b('0x19')](_0x857b('0x15'),_0x4cd93b,_0x39a5be['error'][_0x857b('0x1a')]);return _0x1e994b(_0x39a5be[_0x857b('0x19')][_0x857b('0x1a')]);}logger['error'](_0x857b('0x15'),_0x4cd93b,_0x39a5be[_0x857b('0x19')][_0x857b('0x1a')]);return _0x3710be(_0x39a5be[_0x857b('0x19')][_0x857b('0x1a')]);}else{logger[_0x857b('0x14')](_0x857b('0x15'),_0x4cd93b,_0x857b('0x16'));_0x3710be(_0x39a5be[_0x857b('0x1b')][_0x857b('0x1a')]);}})[_0x857b('0x1c')](function(_0x5938f4){logger[_0x857b('0x19')]('ChatInternalMessage,\x20%s,\x20%s',_0x4cd93b,_0x5938f4);_0x1e994b(_0x5938f4);});});}
\ No newline at end of file
+var _0x6a5c=['localhost','register','then','info','request\x20sent','debug','ChatInternalMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','message','ChatInternalMessage,\x20%s,\x20%s','result','util','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','redis','defaults'];(function(_0x3e705b,_0x461287){var _0x111d59=function(_0x4b5f2b){while(--_0x4b5f2b){_0x3e705b['push'](_0x3e705b['shift']());}};_0x111d59(++_0x461287);}(_0x6a5c,0x9d));var _0xc6a5=function(_0x5c16ad,_0x24312a){_0x5c16ad=_0x5c16ad-0x0;var _0xf9d36e=_0x6a5c[_0x5c16ad];return _0xf9d36e;};'use strict';var _=require('lodash');var util=require(_0xc6a5('0x0'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0xc6a5('0x1'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xc6a5('0x2'))['db'];var utils=require(_0xc6a5('0x3'));var logger=require(_0xc6a5('0x4'))(_0xc6a5('0x5'));var config=require(_0xc6a5('0x6'));var jayson=require(_0xc6a5('0x7'));var client=jayson[_0xc6a5('0x8')]['http']({'port':0x232a});config[_0xc6a5('0x9')]=_[_0xc6a5('0xa')](config['redis'],{'host':_0xc6a5('0xb'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require('./chatInternalMessage.socket')[_0xc6a5('0xc')](socket);function respondWithRpcPromise(_0x25a9a7,_0x343355,_0x20c0cf){return new BPromise(function(_0x45f517,_0x25d88a){return client['request'](_0x25a9a7,_0x20c0cf)[_0xc6a5('0xd')](function(_0x3e1165){logger[_0xc6a5('0xe')]('ChatInternalMessage,\x20%s,\x20%s',_0x343355,_0xc6a5('0xf'));logger[_0xc6a5('0x10')](_0xc6a5('0x11'),_0x343355,_0xc6a5('0xf'),JSON[_0xc6a5('0x12')](_0x3e1165));if(_0x3e1165['error']){if(_0x3e1165[_0xc6a5('0x13')][_0xc6a5('0x14')]===0x1f4){logger[_0xc6a5('0x13')]('ChatInternalMessage,\x20%s,\x20%s',_0x343355,_0x3e1165['error']['message']);return _0x25d88a(_0x3e1165['error'][_0xc6a5('0x15')]);}logger['error'](_0xc6a5('0x16'),_0x343355,_0x3e1165[_0xc6a5('0x13')][_0xc6a5('0x15')]);return _0x45f517(_0x3e1165[_0xc6a5('0x13')][_0xc6a5('0x15')]);}else{logger['info'](_0xc6a5('0x16'),_0x343355,_0xc6a5('0xf'));_0x45f517(_0x3e1165[_0xc6a5('0x17')][_0xc6a5('0x15')]);}})['catch'](function(_0x2efade){logger[_0xc6a5('0x13')](_0xc6a5('0x16'),_0x343355,_0x2efade);_0x25d88a(_0x2efade);});});}
\ No newline at end of file
diff --git a/server/api/chatInternalMessage/chatInternalMessage.socket.js b/server/api/chatInternalMessage/chatInternalMessage.socket.js
index bc9fe12..6fdcbc7 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 _0xb6af=['register','length','chatInternalMessage:','./chatInternalMessage.events','save','update','emit','removeListener'];(function(_0x5a636f,_0x3fec2b){var _0x6a8cfb=function(_0x20e6ca){while(--_0x20e6ca){_0x5a636f['push'](_0x5a636f['shift']());}};_0x6a8cfb(++_0x3fec2b);}(_0xb6af,0x7b));var _0xfb6a=function(_0x176317,_0x4897b3){_0x176317=_0x176317-0x0;var _0xef2759=_0xb6af[_0x176317];return _0xef2759;};'use strict';var ChatInternalMessageEvents=require(_0xfb6a('0x0'));var events=[_0xfb6a('0x1'),'remove',_0xfb6a('0x2')];function createListener(_0x8d95b5,_0x16c3fc){return function(_0x24ba0c){_0x16c3fc[_0xfb6a('0x3')](_0x8d95b5,_0x24ba0c);};}function removeListener(_0xd2980,_0x3cdf5a){return function(){ChatInternalMessageEvents[_0xfb6a('0x4')](_0xd2980,_0x3cdf5a);};}exports[_0xfb6a('0x5')]=function(_0x2e00e0){for(var _0x30fe14=0x0,_0x48e55a=events[_0xfb6a('0x6')];_0x30fe14<_0x48e55a;_0x30fe14++){var _0x42ce82=events[_0x30fe14];var _0x5648c7=createListener(_0xfb6a('0x7')+_0x42ce82,_0x2e00e0);ChatInternalMessageEvents['on'](_0x42ce82,_0x5648c7);}};
\ No newline at end of file
+var _0x27de=['./chatInternalMessage.events','remove','removeListener','register','length','chatInternalMessage:'];(function(_0x179560,_0x4090a1){var _0x46413e=function(_0x1653f1){while(--_0x1653f1){_0x179560['push'](_0x179560['shift']());}};_0x46413e(++_0x4090a1);}(_0x27de,0x1c8));var _0xe27d=function(_0x23e5d6,_0x581445){_0x23e5d6=_0x23e5d6-0x0;var _0x51d225=_0x27de[_0x23e5d6];return _0x51d225;};'use strict';var ChatInternalMessageEvents=require(_0xe27d('0x0'));var events=['save',_0xe27d('0x1'),'update'];function createListener(_0x14c527,_0x3a7f6b){return function(_0x2da084){_0x3a7f6b['emit'](_0x14c527,_0x2da084);};}function removeListener(_0x3f4d,_0x27c708){return function(){ChatInternalMessageEvents[_0xe27d('0x2')](_0x3f4d,_0x27c708);};}exports[_0xe27d('0x3')]=function(_0x1d5be0){for(var _0x40fd9d=0x0,_0x511d9d=events[_0xe27d('0x4')];_0x40fd9d<_0x511d9d;_0x40fd9d++){var _0x127d29=events[_0x40fd9d];var _0x355ccb=createListener(_0xe27d('0x5')+_0x127d29,_0x1d5be0);ChatInternalMessageEvents['on'](_0x127d29,_0x355ccb);}};
\ No newline at end of file
diff --git a/server/api/chatInternalMessage/index.js b/server/api/chatInternalMessage/index.js
index d1f2a39..3a03c27 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 _0x5607=['getUsers','/:id','show','post','create','put','update','delete','destroy','exports','multer','util','connect-timeout','fs-extra','../../config/environment','./chatInternalMessage.controller','get','/describe','isAuthenticated','describe'];(function(_0x257642,_0x270a80){var _0x3d813b=function(_0x2a1c8a){while(--_0x2a1c8a){_0x257642['push'](_0x257642['shift']());}};_0x3d813b(++_0x270a80);}(_0x5607,0x186));var _0x7560=function(_0x1d69e1,_0x450840){_0x1d69e1=_0x1d69e1-0x0;var _0x23f4e1=_0x5607[_0x1d69e1];return _0x23f4e1;};'use strict';var multer=require(_0x7560('0x0'));var util=require(_0x7560('0x1'));var path=require('path');var timeout=require(_0x7560('0x2'));var express=require('express');var router=express['Router']();var fs_extra=require(_0x7560('0x3'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x7560('0x4'));var controller=require(_0x7560('0x5'));router['get']('/',auth['isAuthenticated'](),controller['index']);router[_0x7560('0x6')](_0x7560('0x7'),auth[_0x7560('0x8')](),controller[_0x7560('0x9')]);router[_0x7560('0x6')]('/users',auth[_0x7560('0x8')](),controller[_0x7560('0xa')]);router[_0x7560('0x6')](_0x7560('0xb'),auth['isAuthenticated'](),controller[_0x7560('0xc')]);router[_0x7560('0xd')]('/',auth[_0x7560('0x8')](),controller[_0x7560('0xe')]);router[_0x7560('0xf')](_0x7560('0xb'),controller[_0x7560('0x10')]);router[_0x7560('0x11')]('/:id',auth[_0x7560('0x8')](),controller[_0x7560('0x12')]);module[_0x7560('0x13')]=router;
\ No newline at end of file
+var _0x6f0b=['path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/describe','describe','/users','getUsers','show','post','create','put','/:id','update','delete','destroy','exports','multer','util'];(function(_0x40e41e,_0x3d30e7){var _0x18b70c=function(_0x2b4b66){while(--_0x2b4b66){_0x40e41e['push'](_0x40e41e['shift']());}};_0x18b70c(++_0x3d30e7);}(_0x6f0b,0x94));var _0xb6f0=function(_0x31b3d5,_0x488d43){_0x31b3d5=_0x31b3d5-0x0;var _0x274a25=_0x6f0b[_0x31b3d5];return _0x274a25;};'use strict';var multer=require(_0xb6f0('0x0'));var util=require(_0xb6f0('0x1'));var path=require(_0xb6f0('0x2'));var timeout=require('connect-timeout');var express=require(_0xb6f0('0x3'));var router=express[_0xb6f0('0x4')]();var fs_extra=require(_0xb6f0('0x5'));var auth=require(_0xb6f0('0x6'));var interaction=require(_0xb6f0('0x7'));var config=require(_0xb6f0('0x8'));var controller=require('./chatInternalMessage.controller');router[_0xb6f0('0x9')]('/',auth[_0xb6f0('0xa')](),controller[_0xb6f0('0xb')]);router[_0xb6f0('0x9')](_0xb6f0('0xc'),auth[_0xb6f0('0xa')](),controller[_0xb6f0('0xd')]);router[_0xb6f0('0x9')](_0xb6f0('0xe'),auth[_0xb6f0('0xa')](),controller[_0xb6f0('0xf')]);router[_0xb6f0('0x9')]('/:id',auth[_0xb6f0('0xa')](),controller[_0xb6f0('0x10')]);router[_0xb6f0('0x11')]('/',auth[_0xb6f0('0xa')](),controller[_0xb6f0('0x12')]);router[_0xb6f0('0x13')](_0xb6f0('0x14'),controller[_0xb6f0('0x15')]);router[_0xb6f0('0x16')](_0xb6f0('0x14'),auth['isAuthenticated'](),controller[_0xb6f0('0x17')]);module[_0xb6f0('0x18')]=router;
\ No newline at end of file
diff --git a/server/api/chatMessage/chatMessage.attributes.js b/server/api/chatMessage/chatMessage.attributes.js
index af6dbb0..5e660e0 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 _0x97e6=['out','DATE','sequelize','TEXT','medium','BOOLEAN','ENUM'];(function(_0x5e9b18,_0x3874b4){var _0x2f342b=function(_0x17808f){while(--_0x17808f){_0x5e9b18['push'](_0x5e9b18['shift']());}};_0x2f342b(++_0x3874b4);}(_0x97e6,0x159));var _0x697e=function(_0x2c9d95,_0xcc4c3){_0x2c9d95=_0x2c9d95-0x0;var _0x1b9a2e=_0x97e6[_0x2c9d95];return _0x1b9a2e;};'use strict';var Sequelize=require(_0x697e('0x0'));module['exports']={'body':{'type':Sequelize[_0x697e('0x1')](_0x697e('0x2')),'allowNull':![]},'read':{'type':Sequelize[_0x697e('0x3')],'defaultValue':![]},'secret':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'direction':{'type':Sequelize[_0x697e('0x4')]('in',_0x697e('0x5')),'defaultValue':'out','allowNull':![]},'readAt':{'type':Sequelize[_0x697e('0x6')]},'providerName':{'type':Sequelize['STRING']},'providerResponse':{'type':Sequelize[_0x697e('0x1')]}};
\ No newline at end of file
+var _0x574d=['out','DATE','STRING','sequelize','exports','TEXT','medium','BOOLEAN','ENUM'];(function(_0x167cc1,_0x56ef5a){var _0x10bc4b=function(_0xd6a255){while(--_0xd6a255){_0x167cc1['push'](_0x167cc1['shift']());}};_0x10bc4b(++_0x56ef5a);}(_0x574d,0xc0));var _0xd574=function(_0x565ed7,_0x398228){_0x565ed7=_0x565ed7-0x0;var _0x183ad7=_0x574d[_0x565ed7];return _0x183ad7;};'use strict';var Sequelize=require(_0xd574('0x0'));module[_0xd574('0x1')]={'body':{'type':Sequelize[_0xd574('0x2')](_0xd574('0x3')),'allowNull':![]},'read':{'type':Sequelize[_0xd574('0x4')],'defaultValue':![]},'secret':{'type':Sequelize[_0xd574('0x4')],'defaultValue':![]},'direction':{'type':Sequelize[_0xd574('0x5')]('in','out'),'defaultValue':_0xd574('0x6'),'allowNull':![]},'readAt':{'type':Sequelize[_0xd574('0x7')]},'providerName':{'type':Sequelize[_0xd574('0x8')]},'providerResponse':{'type':Sequelize[_0xd574('0x2')]}};
\ No newline at end of file
diff --git a/server/api/chatMessage/chatMessage.controller.js b/server/api/chatMessage/chatMessage.controller.js
index 3a4fa2f..de0e93f 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(_0x2b3661,_0x1842ac){var _0xb12ecb=function(_0x127636){while(--_0x127636){_0x2b3661['push'](_0x2b3661['shift']());}};_0xb12ecb(++_0x1842ac);}(_0xa9e0,0x123));var _0x0a9e=function(_0x1b349a,_0x22222c){_0x1b349a=_0x1b349a-0x0;var _0x5d1f7c=_0xa9e0[_0x1b349a];return _0x5d1f7c;};'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(_0x389882,_0x30c7b5){var _0x3ee355=function(_0x1d6205){while(--_0x1d6205){_0x389882['push'](_0x389882['shift']());}};_0x3ee355(++_0x30c7b5);}(_0xa9e0,0x123));var _0x0a9e=function(_0x19e35c,_0x29cd1e){_0x19e35c=_0x19e35c-0x0;var _0x3e1fe8=_0xa9e0[_0x19e35c];return _0x3e1fe8;};'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 e620e94..3ded6dd 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 _0xfd47=['emit','hook','exports','../../mysqldb','ChatMessage','setMaxListeners','save','update','remove'];(function(_0x3bbd7a,_0x45f9ac){var _0x27e32f=function(_0x3f3831){while(--_0x3f3831){_0x3bbd7a['push'](_0x3bbd7a['shift']());}};_0x27e32f(++_0x45f9ac);}(_0xfd47,0x9c));var _0x7fd4=function(_0x2ad3b5,_0x5ab1c4){_0x2ad3b5=_0x2ad3b5-0x0;var _0x281301=_0xfd47[_0x2ad3b5];return _0x281301;};'use strict';var EventEmitter=require('events');var ChatMessage=require(_0x7fd4('0x0'))['db'][_0x7fd4('0x1')];var ChatMessageEvents=new EventEmitter();ChatMessageEvents[_0x7fd4('0x2')](0x0);var events={'afterCreate':_0x7fd4('0x3'),'afterUpdate':_0x7fd4('0x4'),'afterDestroy':_0x7fd4('0x5')};function emitEvent(_0x453773){return function(_0x243ce9,_0x4b3e58,_0xff8b4c){ChatMessageEvents[_0x7fd4('0x6')](_0x453773+':'+_0x243ce9['id'],_0x243ce9);ChatMessageEvents[_0x7fd4('0x6')](_0x453773,_0x243ce9);_0xff8b4c(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];ChatMessage[_0x7fd4('0x7')](e,emitEvent(event));}}module[_0x7fd4('0x8')]=ChatMessageEvents;
\ No newline at end of file
+var _0x7990=['ChatMessage','setMaxListeners','save','remove','emit','hasOwnProperty','hook','exports','events','../../mysqldb'];(function(_0x407997,_0x416ff3){var _0x49b030=function(_0x5a3a14){while(--_0x5a3a14){_0x407997['push'](_0x407997['shift']());}};_0x49b030(++_0x416ff3);}(_0x7990,0x9e));var _0x0799=function(_0xce283a,_0x1b2518){_0xce283a=_0xce283a-0x0;var _0xaecfcb=_0x7990[_0xce283a];return _0xaecfcb;};'use strict';var EventEmitter=require(_0x0799('0x0'));var ChatMessage=require(_0x0799('0x1'))['db'][_0x0799('0x2')];var ChatMessageEvents=new EventEmitter();ChatMessageEvents[_0x0799('0x3')](0x0);var events={'afterCreate':_0x0799('0x4'),'afterUpdate':'update','afterDestroy':_0x0799('0x5')};function emitEvent(_0x4a6a1c){return function(_0x41e0ca,_0x72726f,_0x3a0906){ChatMessageEvents[_0x0799('0x6')](_0x4a6a1c+':'+_0x41e0ca['id'],_0x41e0ca);ChatMessageEvents[_0x0799('0x6')](_0x4a6a1c,_0x41e0ca);_0x3a0906(null);};}for(var e in events){if(events[_0x0799('0x7')](e)){var event=events[e];ChatMessage[_0x0799('0x8')](e,emitEvent(event));}}module[_0x0799('0x9')]=ChatMessageEvents;
\ No newline at end of file
diff --git a/server/api/chatMessage/chatMessage.model.js b/server/api/chatMessage/chatMessage.model.js
index 7beb15b..51d70c8 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 _0x3fc6=['ChatInteraction','findOne','ChatInteractionId','then','update','catch','utf8mb4','lodash','util','../../config/logger','moment','bluebird','request-promise','path','rimraf','../../config/environment','define','chat_messages','fti_chat_messages','FULLTEXT','models','get','direction','toLowerCase','out','secret'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x3fc6,0x159));var _0x63fc=function(_0x5a421e,_0x18f21){_0x5a421e=_0x5a421e-0x0;var _0x2a0ea0=_0x3fc6[_0x5a421e];return _0x2a0ea0;};'use strict';var _=require(_0x63fc('0x0'));var util=require(_0x63fc('0x1'));var logger=require(_0x63fc('0x2'))('api');var moment=require(_0x63fc('0x3'));var BPromise=require(_0x63fc('0x4'));var rp=require(_0x63fc('0x5'));var fs=require('fs');var path=require(_0x63fc('0x6'));var rimraf=require(_0x63fc('0x7'));var config=require(_0x63fc('0x8'));var attributes=require('./chatMessage.attributes');module['exports']=function(_0xdb65b8,_0x7d24f){return _0xdb65b8[_0x63fc('0x9')]('ChatMessage',attributes,{'tableName':_0x63fc('0xa'),'paranoid':![],'indexes':[{'name':_0x63fc('0xb'),'fields':['body'],'type':_0x63fc('0xc')}],'timestamps':!![],'hooks':{'afterCreate':function(_0x28a180,_0x231e48,_0x21866b){var _0xef7fb2=_0xdb65b8[_0x63fc('0xd')];var _0x17cf03=_0x28a180[_0x63fc('0xe')]({'plain':!![]});if(_0x17cf03[_0x63fc('0xf')][_0x63fc('0x10')]()==='in'||_0x17cf03['direction'][_0x63fc('0x10')]()===_0x63fc('0x11')&&!_0x17cf03[_0x63fc('0x12')]&&!_['isNil'](_0x17cf03['UserId'])){_0xef7fb2[_0x63fc('0x13')][_0x63fc('0x14')]({'where':{'id':_0x17cf03[_0x63fc('0x15')]}})[_0x63fc('0x16')](function(_0xed9cc1){if(_0xed9cc1){_0xed9cc1[_0x63fc('0x17')]({'lastMsgAt':_0x17cf03['createdAt'],'lastMsgDirection':_0x17cf03[_0x63fc('0xf')][_0x63fc('0x10')]()});}})[_0x63fc('0x18')](function(_0x337192){console['error'](_0x337192);});}_0x21866b();}},'charset':_0x63fc('0x19'),'collate':'utf8mb4_unicode_ci'});};
\ No newline at end of file
+var _0x3865=['request-promise','rimraf','../../config/environment','./chatMessage.attributes','exports','define','ChatMessage','chat_messages','fti_chat_messages','body','FULLTEXT','get','direction','toLowerCase','out','secret','isNil','UserId','ChatInteraction','findOne','ChatInteractionId','then','update','createdAt','catch','utf8mb4','utf8mb4_unicode_ci','lodash','../../config/logger','moment','bluebird'];(function(_0xb27e40,_0x459db1){var _0x27a960=function(_0x478c11){while(--_0x478c11){_0xb27e40['push'](_0xb27e40['shift']());}};_0x27a960(++_0x459db1);}(_0x3865,0x151));var _0x5386=function(_0x1d3322,_0xe09f15){_0x1d3322=_0x1d3322-0x0;var _0x4c1e15=_0x3865[_0x1d3322];return _0x4c1e15;};'use strict';var _=require(_0x5386('0x0'));var util=require('util');var logger=require(_0x5386('0x1'))('api');var moment=require(_0x5386('0x2'));var BPromise=require(_0x5386('0x3'));var rp=require(_0x5386('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x5386('0x5'));var config=require(_0x5386('0x6'));var attributes=require(_0x5386('0x7'));module[_0x5386('0x8')]=function(_0x39d40c,_0x57a6d3){return _0x39d40c[_0x5386('0x9')](_0x5386('0xa'),attributes,{'tableName':_0x5386('0xb'),'paranoid':![],'indexes':[{'name':_0x5386('0xc'),'fields':[_0x5386('0xd')],'type':_0x5386('0xe')}],'timestamps':!![],'hooks':{'afterCreate':function(_0x45ed7a,_0x1b2cf1,_0x4a6c1a){var _0x39a9c6=_0x39d40c['models'];var _0x44951b=_0x45ed7a[_0x5386('0xf')]({'plain':!![]});if(_0x44951b[_0x5386('0x10')][_0x5386('0x11')]()==='in'||_0x44951b[_0x5386('0x10')][_0x5386('0x11')]()===_0x5386('0x12')&&!_0x44951b[_0x5386('0x13')]&&!_[_0x5386('0x14')](_0x44951b[_0x5386('0x15')])){_0x39a9c6[_0x5386('0x16')][_0x5386('0x17')]({'where':{'id':_0x44951b[_0x5386('0x18')]}})[_0x5386('0x19')](function(_0x4463c2){if(_0x4463c2){_0x4463c2[_0x5386('0x1a')]({'lastMsgAt':_0x44951b[_0x5386('0x1b')],'lastMsgDirection':_0x44951b['direction'][_0x5386('0x11')]()});}})[_0x5386('0x1c')](function(_0x3ce77e){console['error'](_0x3ce77e);});}_0x4a6c1a();}},'charset':_0x5386('0x1d'),'collate':_0x5386('0x1e')});};
\ No newline at end of file
diff --git a/server/api/chatMessage/chatMessage.rpc.js b/server/api/chatMessage/chatMessage.rpc.js
index a241554..82bb0d5 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 _0xfb00=['bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','./chatMessage.socket','request','then','info','ChatMessage,\x20%s,\x20%s','request\x20sent','debug','ChatMessage,\x20%s,\x20%s,\x20%s','error','message','result','catch','CreateChatMessage','ChatMessage','create','body','options','raw','stringify','util','moment'];(function(_0xe5b349,_0x5f06e4){var _0x26b0ad=function(_0x1a97f1){while(--_0x1a97f1){_0xe5b349['push'](_0xe5b349['shift']());}};_0x26b0ad(++_0x5f06e4);}(_0xfb00,0x8a));var _0x0fb0=function(_0xcfd89f,_0x106e8f){_0xcfd89f=_0xcfd89f-0x0;var _0x59acd4=_0xfb00[_0xcfd89f];return _0x59acd4;};'use strict';var _=require('lodash');var util=require(_0x0fb0('0x0'));var moment=require(_0x0fb0('0x1'));var BPromise=require(_0x0fb0('0x2'));var rs=require(_0x0fb0('0x3'));var fs=require('fs');var Redis=require(_0x0fb0('0x4'));var db=require(_0x0fb0('0x5'))['db'];var utils=require(_0x0fb0('0x6'));var logger=require(_0x0fb0('0x7'))('rpc');var config=require(_0x0fb0('0x8'));var jayson=require(_0x0fb0('0x9'));var client=jayson[_0x0fb0('0xa')][_0x0fb0('0xb')]({'port':0x232a});config[_0x0fb0('0xc')]=_[_0x0fb0('0xd')](config['redis'],{'host':_0x0fb0('0xe'),'port':0x18eb});var socket=require(_0x0fb0('0xf'))(new Redis(config[_0x0fb0('0xc')]));require(_0x0fb0('0x10'))['register'](socket);function respondWithRpcPromise(_0x30d7da,_0x3f2bc2,_0x1b932e){return new BPromise(function(_0x50a29c,_0x6a0ed4){return client[_0x0fb0('0x11')](_0x30d7da,_0x1b932e)[_0x0fb0('0x12')](function(_0x11e7c4){logger[_0x0fb0('0x13')](_0x0fb0('0x14'),_0x3f2bc2,_0x0fb0('0x15'));logger[_0x0fb0('0x16')](_0x0fb0('0x17'),_0x3f2bc2,'request\x20sent',JSON['stringify'](_0x11e7c4));if(_0x11e7c4[_0x0fb0('0x18')]){if(_0x11e7c4[_0x0fb0('0x18')]['code']===0x1f4){logger[_0x0fb0('0x18')](_0x0fb0('0x14'),_0x3f2bc2,_0x11e7c4[_0x0fb0('0x18')][_0x0fb0('0x19')]);return _0x6a0ed4(_0x11e7c4['error'][_0x0fb0('0x19')]);}logger['error'](_0x0fb0('0x14'),_0x3f2bc2,_0x11e7c4[_0x0fb0('0x18')][_0x0fb0('0x19')]);return _0x50a29c(_0x11e7c4[_0x0fb0('0x18')]['message']);}else{logger['info'](_0x0fb0('0x14'),_0x3f2bc2,'request\x20sent');_0x50a29c(_0x11e7c4[_0x0fb0('0x1a')][_0x0fb0('0x19')]);}})[_0x0fb0('0x1b')](function(_0x36639a){logger['error'](_0x0fb0('0x14'),_0x3f2bc2,_0x36639a);_0x6a0ed4(_0x36639a);});});}exports[_0x0fb0('0x1c')]=function(_0x27a77f){var _0x1394e5=this;return new Promise(function(_0x314228,_0x16028b){return db[_0x0fb0('0x1d')][_0x0fb0('0x1e')](_0x27a77f[_0x0fb0('0x1f')],{'raw':_0x27a77f[_0x0fb0('0x20')]?_0x27a77f[_0x0fb0('0x20')][_0x0fb0('0x21')]===undefined?!![]:![]:!![]})['then'](function(_0x3063e0){logger[_0x0fb0('0x13')](_0x0fb0('0x1c'),_0x27a77f);logger['debug'](_0x0fb0('0x1c'),_0x27a77f,JSON[_0x0fb0('0x22')](_0x3063e0));_0x314228(_0x3063e0);})[_0x0fb0('0x1b')](function(_0x56fc6b){logger[_0x0fb0('0x18')](_0x0fb0('0x1c'),_0x56fc6b[_0x0fb0('0x19')],_0x27a77f);_0x16028b(_0x1394e5[_0x0fb0('0x18')](0x1f4,_0x56fc6b[_0x0fb0('0x19')]));});});};
\ No newline at end of file
+var _0xb8f5=['options','then','stringify','lodash','util','moment','bluebird','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','./chatMessage.socket','register','request','info','request\x20sent','debug','ChatMessage,\x20%s,\x20%s,\x20%s','error','code','ChatMessage,\x20%s,\x20%s','message','result','catch','CreateChatMessage','ChatMessage','body'];(function(_0x44b6f8,_0x302591){var _0x32b459=function(_0x4dc28a){while(--_0x4dc28a){_0x44b6f8['push'](_0x44b6f8['shift']());}};_0x32b459(++_0x302591);}(_0xb8f5,0x1a7));var _0x5b8f=function(_0x1501ee,_0x1043b4){_0x1501ee=_0x1501ee-0x0;var _0x302c8d=_0xb8f5[_0x1501ee];return _0x302c8d;};'use strict';var _=require(_0x5b8f('0x0'));var util=require(_0x5b8f('0x1'));var moment=require(_0x5b8f('0x2'));var BPromise=require(_0x5b8f('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x5b8f('0x4'))['db'];var utils=require(_0x5b8f('0x5'));var logger=require(_0x5b8f('0x6'))(_0x5b8f('0x7'));var config=require(_0x5b8f('0x8'));var jayson=require(_0x5b8f('0x9'));var client=jayson[_0x5b8f('0xa')][_0x5b8f('0xb')]({'port':0x232a});config[_0x5b8f('0xc')]=_[_0x5b8f('0xd')](config[_0x5b8f('0xc')],{'host':_0x5b8f('0xe'),'port':0x18eb});var socket=require(_0x5b8f('0xf'))(new Redis(config[_0x5b8f('0xc')]));require(_0x5b8f('0x10'))[_0x5b8f('0x11')](socket);function respondWithRpcPromise(_0x40907a,_0x5e0f6b,_0x2eef82){return new BPromise(function(_0x38e195,_0xc39a46){return client[_0x5b8f('0x12')](_0x40907a,_0x2eef82)['then'](function(_0xde19ac){logger[_0x5b8f('0x13')]('ChatMessage,\x20%s,\x20%s',_0x5e0f6b,_0x5b8f('0x14'));logger[_0x5b8f('0x15')](_0x5b8f('0x16'),_0x5e0f6b,'request\x20sent',JSON['stringify'](_0xde19ac));if(_0xde19ac['error']){if(_0xde19ac[_0x5b8f('0x17')][_0x5b8f('0x18')]===0x1f4){logger[_0x5b8f('0x17')](_0x5b8f('0x19'),_0x5e0f6b,_0xde19ac[_0x5b8f('0x17')][_0x5b8f('0x1a')]);return _0xc39a46(_0xde19ac[_0x5b8f('0x17')]['message']);}logger[_0x5b8f('0x17')](_0x5b8f('0x19'),_0x5e0f6b,_0xde19ac[_0x5b8f('0x17')][_0x5b8f('0x1a')]);return _0x38e195(_0xde19ac[_0x5b8f('0x17')][_0x5b8f('0x1a')]);}else{logger[_0x5b8f('0x13')](_0x5b8f('0x19'),_0x5e0f6b,_0x5b8f('0x14'));_0x38e195(_0xde19ac[_0x5b8f('0x1b')][_0x5b8f('0x1a')]);}})[_0x5b8f('0x1c')](function(_0x5efbff){logger[_0x5b8f('0x17')](_0x5b8f('0x19'),_0x5e0f6b,_0x5efbff);_0xc39a46(_0x5efbff);});});}exports[_0x5b8f('0x1d')]=function(_0x47bd71){var _0x160e56=this;return new Promise(function(_0xac88f9,_0x189f99){return db[_0x5b8f('0x1e')]['create'](_0x47bd71[_0x5b8f('0x1f')],{'raw':_0x47bd71[_0x5b8f('0x20')]?_0x47bd71[_0x5b8f('0x20')]['raw']===undefined?!![]:![]:!![]})[_0x5b8f('0x21')](function(_0x418b8b){logger[_0x5b8f('0x13')]('CreateChatMessage',_0x47bd71);logger['debug'](_0x5b8f('0x1d'),_0x47bd71,JSON[_0x5b8f('0x22')](_0x418b8b));_0xac88f9(_0x418b8b);})['catch'](function(_0x24785a){logger['error'](_0x5b8f('0x1d'),_0x24785a[_0x5b8f('0x1a')],_0x47bd71);_0x189f99(_0x160e56[_0x5b8f('0x17')](0x1f4,_0x24785a[_0x5b8f('0x1a')]));});});};
\ No newline at end of file
diff --git a/server/api/chatMessage/chatMessage.socket.js b/server/api/chatMessage/chatMessage.socket.js
index cbfb5fb..c256286 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 _0x2f2e=['emit','length','save','remove'];(function(_0x2112d4,_0x3c863c){var _0x434972=function(_0x477020){while(--_0x477020){_0x2112d4['push'](_0x2112d4['shift']());}};_0x434972(++_0x3c863c);}(_0x2f2e,0x146));var _0xe2f2=function(_0x358c86,_0x38a8a2){_0x358c86=_0x358c86-0x0;var _0x52edc5=_0x2f2e[_0x358c86];return _0x52edc5;};'use strict';var ChatMessageEvents=require('./chatMessage.events');var events=[_0xe2f2('0x0'),_0xe2f2('0x1'),'update'];function createListener(_0xc8150e,_0x5c1823){return function(_0x1d89ba){_0x5c1823[_0xe2f2('0x2')](_0xc8150e,_0x1d89ba);};}function removeListener(_0x2da048,_0x14543c){return function(){ChatMessageEvents['removeListener'](_0x2da048,_0x14543c);};}exports['register']=function(_0x5b202f){for(var _0x3dca30=0x0,_0x23f7a8=events[_0xe2f2('0x3')];_0x3dca30<_0x23f7a8;_0x3dca30++){var _0xc44c89=events[_0x3dca30];var _0x48111c=createListener('chatMessage:'+_0xc44c89,_0x5b202f);ChatMessageEvents['on'](_0xc44c89,_0x48111c);}};
\ No newline at end of file
+var _0x1d7e=['remove','update','emit','removeListener','register','length','save'];(function(_0x5cc753,_0x50d3b6){var _0x12b9ea=function(_0x3eb26b){while(--_0x3eb26b){_0x5cc753['push'](_0x5cc753['shift']());}};_0x12b9ea(++_0x50d3b6);}(_0x1d7e,0x7d));var _0xe1d7=function(_0x4243a3,_0x447337){_0x4243a3=_0x4243a3-0x0;var _0x1b2a33=_0x1d7e[_0x4243a3];return _0x1b2a33;};'use strict';var ChatMessageEvents=require('./chatMessage.events');var events=[_0xe1d7('0x0'),_0xe1d7('0x1'),_0xe1d7('0x2')];function createListener(_0x47c24f,_0x141274){return function(_0x4c39bd){_0x141274[_0xe1d7('0x3')](_0x47c24f,_0x4c39bd);};}function removeListener(_0x118bc6,_0x354906){return function(){ChatMessageEvents[_0xe1d7('0x4')](_0x118bc6,_0x354906);};}exports[_0xe1d7('0x5')]=function(_0x4058fe){for(var _0x252026=0x0,_0x867e5=events[_0xe1d7('0x6')];_0x252026<_0x867e5;_0x252026++){var _0x439ffd=events[_0x252026];var _0x3f1859=createListener('chatMessage:'+_0x439ffd,_0x4058fe);ChatMessageEvents['on'](_0x439ffd,_0x3f1859);}};
\ No newline at end of file
diff --git a/server/api/chatMessage/index.js b/server/api/chatMessage/index.js
index c346ad7..4252bbb 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 _0xff53=['../../config/environment','./chatMessage.controller','get','isAuthenticated','index','/describe','describe','/:id','post','tracked','chat','chatmessage:create','put','update','/:id/accept','/:id/reject','delete','exports','multer','util','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service'];(function(_0x10896c,_0x4f833a){var _0xd9ab0a=function(_0x5945fb){while(--_0x5945fb){_0x10896c['push'](_0x10896c['shift']());}};_0xd9ab0a(++_0x4f833a);}(_0xff53,0x116));var _0x3ff5=function(_0xdfc45b,_0x16abfc){_0xdfc45b=_0xdfc45b-0x0;var _0x2c2f2d=_0xff53[_0xdfc45b];return _0x2c2f2d;};'use strict';var multer=require(_0x3ff5('0x0'));var util=require(_0x3ff5('0x1'));var path=require(_0x3ff5('0x2'));var timeout=require(_0x3ff5('0x3'));var express=require(_0x3ff5('0x4'));var router=express['Router']();var fs_extra=require(_0x3ff5('0x5'));var auth=require(_0x3ff5('0x6'));var interaction=require(_0x3ff5('0x7'));var config=require(_0x3ff5('0x8'));var controller=require(_0x3ff5('0x9'));router[_0x3ff5('0xa')]('/',auth[_0x3ff5('0xb')](),controller[_0x3ff5('0xc')]);router[_0x3ff5('0xa')](_0x3ff5('0xd'),auth[_0x3ff5('0xb')](),controller[_0x3ff5('0xe')]);router[_0x3ff5('0xa')](_0x3ff5('0xf'),auth[_0x3ff5('0xb')](),controller['show']);router[_0x3ff5('0x10')]('/',auth[_0x3ff5('0xb')](),interaction[_0x3ff5('0x11')](_0x3ff5('0x12'),_0x3ff5('0x13')),controller['create']);router[_0x3ff5('0x14')](_0x3ff5('0xf'),controller[_0x3ff5('0x15')]);router[_0x3ff5('0x14')](_0x3ff5('0x16'),auth[_0x3ff5('0xb')](),controller['accept']);router[_0x3ff5('0x14')](_0x3ff5('0x17'),auth[_0x3ff5('0xb')](),controller['reject']);router[_0x3ff5('0x18')](_0x3ff5('0xf'),auth[_0x3ff5('0xb')](),controller['destroy']);module[_0x3ff5('0x19')]=router;
\ No newline at end of file
+var _0xfc99=['isAuthenticated','index','describe','show','post','chatmessage:create','create','/:id','put','/:id/accept','accept','/:id/reject','reject','delete','destroy','exports','multer','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get'];(function(_0x2d0979,_0x5f1cfa){var _0x19b80f=function(_0xe16ffe){while(--_0xe16ffe){_0x2d0979['push'](_0x2d0979['shift']());}};_0x19b80f(++_0x5f1cfa);}(_0xfc99,0x196));var _0x9fc9=function(_0x410b5c,_0x5261dc){_0x410b5c=_0x410b5c-0x0;var _0x4709b4=_0xfc99[_0x410b5c];return _0x4709b4;};'use strict';var multer=require(_0x9fc9('0x0'));var util=require('util');var path=require(_0x9fc9('0x1'));var timeout=require(_0x9fc9('0x2'));var express=require(_0x9fc9('0x3'));var router=express[_0x9fc9('0x4')]();var fs_extra=require(_0x9fc9('0x5'));var auth=require(_0x9fc9('0x6'));var interaction=require(_0x9fc9('0x7'));var config=require(_0x9fc9('0x8'));var controller=require('./chatMessage.controller');router[_0x9fc9('0x9')]('/',auth[_0x9fc9('0xa')](),controller[_0x9fc9('0xb')]);router['get']('/describe',auth[_0x9fc9('0xa')](),controller[_0x9fc9('0xc')]);router['get']('/:id',auth[_0x9fc9('0xa')](),controller[_0x9fc9('0xd')]);router[_0x9fc9('0xe')]('/',auth[_0x9fc9('0xa')](),interaction['tracked']('chat',_0x9fc9('0xf')),controller[_0x9fc9('0x10')]);router['put'](_0x9fc9('0x11'),controller['update']);router[_0x9fc9('0x12')](_0x9fc9('0x13'),auth[_0x9fc9('0xa')](),controller[_0x9fc9('0x14')]);router[_0x9fc9('0x12')](_0x9fc9('0x15'),auth[_0x9fc9('0xa')](),controller[_0x9fc9('0x16')]);router[_0x9fc9('0x17')]('/:id',auth[_0x9fc9('0xa')](),controller[_0x9fc9('0x18')]);module[_0x9fc9('0x19')]=router;
\ No newline at end of file
diff --git a/server/api/chatOfflineMessage/chatOfflineMessage.attributes.js b/server/api/chatOfflineMessage/chatOfflineMessage.attributes.js
index fcee613..bb74b59 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 _0xf071=['TEXT','medium','sequelize'];(function(_0x3a00e0,_0x1454ef){var _0x261259=function(_0x3f3d7e){while(--_0x3f3d7e){_0x3a00e0['push'](_0x3a00e0['shift']());}};_0x261259(++_0x1454ef);}(_0xf071,0x146));var _0x1f07=function(_0xc97c28,_0x286191){_0xc97c28=_0xc97c28-0x0;var _0x5a6aec=_0xf071[_0xc97c28];return _0x5a6aec;};'use strict';var Sequelize=require(_0x1f07('0x0'));module['exports']={'body':{'type':Sequelize[_0x1f07('0x1')](_0x1f07('0x2')),'allowNull':![]}};
\ No newline at end of file
+var _0x1adb=['sequelize','exports','TEXT'];(function(_0x34091b,_0x2e0627){var _0xb63a0a=function(_0x17885e){while(--_0x17885e){_0x34091b['push'](_0x34091b['shift']());}};_0xb63a0a(++_0x2e0627);}(_0x1adb,0x19e));var _0xb1ad=function(_0x42cae2,_0x284ef8){_0x42cae2=_0x42cae2-0x0;var _0x5f256f=_0x1adb[_0x42cae2];return _0x5f256f;};'use strict';var Sequelize=require(_0xb1ad('0x0'));module[_0xb1ad('0x1')]={'body':{'type':Sequelize[_0xb1ad('0x2')]('medium'),'allowNull':![]}};
\ No newline at end of file
diff --git a/server/api/chatOfflineMessage/chatOfflineMessage.controller.js b/server/api/chatOfflineMessage/chatOfflineMessage.controller.js
index 5eefe67..0afe654 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(_0x13ea00,_0x12f610){var _0x1f7347=function(_0x34ae63){while(--_0x34ae63){_0x13ea00['push'](_0x13ea00['shift']());}};_0x1f7347(++_0x12f610);}(_0x7a54,0x106));var _0x47a5=function(_0xd822f3,_0x489dd9){_0xd822f3=_0xd822f3-0x0;var _0x13ec6a=_0x7a54[_0xd822f3];return _0x13ec6a;};'use strict';var emlformat=require(_0x47a5('0x0'));var rimraf=require(_0x47a5('0x1'));var zipdir=require(_0x47a5('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x47a5('0x3'));var moment=require(_0x47a5('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x47a5('0x5'));var util=require(_0x47a5('0x6'));var path=require(_0x47a5('0x7'));var sox=require(_0x47a5('0x8'));var csv=require(_0x47a5('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x47a5('0xa'));var _=require('lodash');var squel=require(_0x47a5('0xb'));var crypto=require(_0x47a5('0xc'));var jsforce=require('jsforce');var deskjs=require(_0x47a5('0xd'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x47a5('0xe'));var authService=require(_0x47a5('0xf'));var qs=require('../../components/parsers/qs');var as=require(_0x47a5('0x10'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x47a5('0x11'));var utils=require(_0x47a5('0x12'));var config=require(_0x47a5('0x13'));var licenseUtil=require(_0x47a5('0x14'));var db=require(_0x47a5('0x15'))['db'];function respondWithStatusCode(_0xd308b8,_0x1eae59){_0x1eae59=_0x1eae59||0xcc;return function(_0x5beb89){if(_0x5beb89){return _0xd308b8[_0x47a5('0x16')](_0x1eae59);}return _0xd308b8[_0x47a5('0x17')](_0x1eae59)[_0x47a5('0x18')]();};}function respondWithResult(_0x711793,_0x139f25){_0x139f25=_0x139f25||0xc8;return function(_0x620ee9){if(_0x620ee9){return _0x711793[_0x47a5('0x17')](_0x139f25)[_0x47a5('0x19')](_0x620ee9);}};}function respondWithFilteredResult(_0x4e99a8,_0x362359){return function(_0x11faf5){if(_0x11faf5){var _0x3b001e=typeof _0x362359[_0x47a5('0x1a')]===_0x47a5('0x1b')&&typeof _0x362359['limit']==='undefined';var _0x138bc0=_0x11faf5['count'];var _0x5247fd=_0x3b001e?0x0:_0x362359[_0x47a5('0x1a')];var _0xaf70a6=_0x3b001e?_0x11faf5[_0x47a5('0x1c')]:_0x362359[_0x47a5('0x1a')]+_0x362359[_0x47a5('0x1d')];var _0x12b98e;if(_0xaf70a6>=_0x138bc0){_0xaf70a6=_0x138bc0;_0x12b98e=0xc8;}else{_0x12b98e=0xce;}_0x4e99a8[_0x47a5('0x17')](_0x12b98e);return _0x4e99a8[_0x47a5('0x1e')](_0x47a5('0x1f'),_0x5247fd+'-'+_0xaf70a6+'/'+_0x138bc0)['json'](_0x11faf5);}return null;};}function patchUpdates(_0x1570bc){return function(_0xf160ba){try{jsonpatch['apply'](_0xf160ba,_0x1570bc,!![]);}catch(_0x2b0360){return BPromise[_0x47a5('0x20')](_0x2b0360);}return _0xf160ba[_0x47a5('0x21')]();};}function saveUpdates(_0x4c5910,_0xb8ae6c){return function(_0x2f142b){if(_0x2f142b){return _0x2f142b[_0x47a5('0x22')](_0x4c5910)[_0x47a5('0x23')](function(_0x5ef1b1){return _0x5ef1b1;});}return null;};}function removeEntity(_0xe2dea9,_0x385687){return function(_0x513981){if(_0x513981){return _0x513981[_0x47a5('0x24')]()[_0x47a5('0x23')](function(){_0xe2dea9[_0x47a5('0x17')](0xcc)[_0x47a5('0x18')]();});}};}function handleEntityNotFound(_0x3abd6a,_0x50bf17){return function(_0x53078a){if(!_0x53078a){_0x3abd6a[_0x47a5('0x16')](0x194);}return _0x53078a;};}function handleError(_0x5686db,_0x1ea9c8){_0x1ea9c8=_0x1ea9c8||0x1f4;return function(_0x5b6c4e){logger[_0x47a5('0x25')](_0x5b6c4e[_0x47a5('0x26')]);if(_0x5b6c4e[_0x47a5('0x27')]){delete _0x5b6c4e[_0x47a5('0x27')];}_0x5686db[_0x47a5('0x17')](_0x1ea9c8)[_0x47a5('0x28')](_0x5b6c4e);};}exports[_0x47a5('0x29')]=function(_0x136b14,_0x16631f){var _0x361bfa={},_0x1127f8={},_0x11a4fa={'count':0x0,'rows':[]};var _0x3ad507=_['map'](db[_0x47a5('0x2a')]['rawAttributes'],function(_0x2ef875){return{'name':_0x2ef875[_0x47a5('0x2b')],'type':_0x2ef875[_0x47a5('0x2c')]['key']};});_0x1127f8[_0x47a5('0x2d')]=_[_0x47a5('0x2e')](_0x3ad507,_0x47a5('0x27'));_0x1127f8[_0x47a5('0x2f')]=_['keys'](_0x136b14['query']);_0x1127f8[_0x47a5('0x30')]=_[_0x47a5('0x31')](_0x1127f8['model'],_0x1127f8['query']);_0x361bfa[_0x47a5('0x32')]=_[_0x47a5('0x31')](_0x1127f8['model'],qs[_0x47a5('0x33')](_0x136b14['query'][_0x47a5('0x33')]));_0x361bfa[_0x47a5('0x32')]=_0x361bfa['attributes']['length']?_0x361bfa[_0x47a5('0x32')]:_0x1127f8['model'];if(!_0x136b14[_0x47a5('0x2f')][_0x47a5('0x34')](_0x47a5('0x35'))){_0x361bfa['limit']=qs[_0x47a5('0x1d')](_0x136b14['query']['limit']);_0x361bfa[_0x47a5('0x1a')]=qs['offset'](_0x136b14[_0x47a5('0x2f')]['offset']);}_0x361bfa[_0x47a5('0x36')]=qs[_0x47a5('0x37')](_0x136b14[_0x47a5('0x2f')][_0x47a5('0x37')]);_0x361bfa[_0x47a5('0x38')]=qs[_0x47a5('0x30')](_[_0x47a5('0x39')](_0x136b14[_0x47a5('0x2f')],_0x1127f8[_0x47a5('0x30')]),_0x3ad507);if(_0x136b14['query'][_0x47a5('0x3a')]){_0x361bfa[_0x47a5('0x38')]=_['merge'](_0x361bfa[_0x47a5('0x38')],{'$or':_[_0x47a5('0x2e')](_0x3ad507,function(_0x1d4348){if(_0x1d4348['type']!==_0x47a5('0x3b')){var _0x10f660={};_0x10f660[_0x1d4348['name']]={'$like':'%'+_0x136b14[_0x47a5('0x2f')][_0x47a5('0x3a')]+'%'};return _0x10f660;}})});}_0x361bfa=_['merge']({},_0x361bfa,_0x136b14['options']);var _0x5ebd8c={'where':_0x361bfa[_0x47a5('0x38')]};return db['ChatOfflineMessage'][_0x47a5('0x1c')](_0x5ebd8c)[_0x47a5('0x23')](function(_0x301a85){_0x11a4fa[_0x47a5('0x1c')]=_0x301a85;if(_0x136b14[_0x47a5('0x2f')][_0x47a5('0x3c')]){_0x361bfa[_0x47a5('0x3d')]=[{'all':!![]}];}return db[_0x47a5('0x2a')][_0x47a5('0x3e')](_0x361bfa);})[_0x47a5('0x23')](function(_0x280500){_0x11a4fa[_0x47a5('0x3f')]=_0x280500;return _0x11a4fa;})[_0x47a5('0x23')](respondWithFilteredResult(_0x16631f,_0x361bfa))['catch'](handleError(_0x16631f,null));};exports[_0x47a5('0x40')]=function(_0x1c36fa,_0x331474){var _0x23bd8d={'raw':!![],'where':{'id':_0x1c36fa[_0x47a5('0x41')]['id']}},_0x586f4f={};_0x586f4f['model']=_['keys'](db['ChatOfflineMessage']['rawAttributes']);_0x586f4f[_0x47a5('0x2f')]=_['keys'](_0x1c36fa[_0x47a5('0x2f')]);_0x586f4f[_0x47a5('0x30')]=_[_0x47a5('0x31')](_0x586f4f['model'],_0x586f4f[_0x47a5('0x2f')]);_0x23bd8d[_0x47a5('0x32')]=_['intersection'](_0x586f4f['model'],qs[_0x47a5('0x33')](_0x1c36fa['query'][_0x47a5('0x33')]));_0x23bd8d[_0x47a5('0x32')]=_0x23bd8d[_0x47a5('0x32')][_0x47a5('0x42')]?_0x23bd8d[_0x47a5('0x32')]:_0x586f4f[_0x47a5('0x2d')];if(_0x1c36fa[_0x47a5('0x2f')][_0x47a5('0x3c')]){_0x23bd8d[_0x47a5('0x3d')]=[{'all':!![]}];}_0x23bd8d=_[_0x47a5('0x43')]({},_0x23bd8d,_0x1c36fa[_0x47a5('0x44')]);return db[_0x47a5('0x2a')][_0x47a5('0x45')](_0x23bd8d)[_0x47a5('0x23')](handleEntityNotFound(_0x331474,null))[_0x47a5('0x23')](respondWithResult(_0x331474,null))[_0x47a5('0x46')](handleError(_0x331474,null));};exports['create']=function(_0x2d38de,_0x23bb04){return db['ChatOfflineMessage']['create'](_0x2d38de[_0x47a5('0x47')],{})['then'](respondWithResult(_0x23bb04,0xc9))[_0x47a5('0x46')](handleError(_0x23bb04,null));};exports[_0x47a5('0x22')]=function(_0x54c35f,_0x4f62d3){if(_0x54c35f[_0x47a5('0x47')]['id']){delete _0x54c35f['body']['id'];}return db[_0x47a5('0x2a')][_0x47a5('0x45')]({'where':{'id':_0x54c35f[_0x47a5('0x41')]['id']}})[_0x47a5('0x23')](handleEntityNotFound(_0x4f62d3,null))[_0x47a5('0x23')](saveUpdates(_0x54c35f[_0x47a5('0x47')],null))[_0x47a5('0x23')](respondWithResult(_0x4f62d3,null))['catch'](handleError(_0x4f62d3,null));};exports['destroy']=function(_0x2dd1db,_0x411230){return db[_0x47a5('0x48')][_0x47a5('0x3e')]({'where':{'ChatOfflineMessageId':_0x2dd1db[_0x47a5('0x41')]['id']},'raw':!![]})[_0x47a5('0x23')](function(_0x249de5){_0x249de5['forEach'](function(_0x45cca5){var _0x1c9a62=path[_0x47a5('0x49')](config['root'],_0x47a5('0x4a'),'files',_0x47a5('0x4b'),_0x47a5('0x4c'),_0x45cca5[_0x47a5('0x4d')]);var _0xf03bd5=fs['existsSync'](_0x1c9a62);if(_0xf03bd5)fs_extra[_0x47a5('0x4e')](_0x1c9a62);});})[_0x47a5('0x23')](function(){return db[_0x47a5('0x2a')][_0x47a5('0x45')]({'where':{'id':_0x2dd1db[_0x47a5('0x41')]['id']},'individualHooks':!![]});})[_0x47a5('0x23')](handleEntityNotFound(_0x411230,null))[_0x47a5('0x23')](removeEntity(_0x411230,null))['catch'](handleError(_0x411230,null));};exports[_0x47a5('0x4f')]=function(_0x43721b,_0x187d7e){return db[_0x47a5('0x2a')][_0x47a5('0x4f')]()[_0x47a5('0x23')](respondWithResult(_0x187d7e,null))['catch'](handleError(_0x187d7e,null));};
\ No newline at end of file
+var _0x7a54=['filter','VIRTUAL','includeAll','include','findAll','rows','show','params','length','merge','options','find','catch','body','Attachment','join','server','attachments','offline-chat','basename','remove','describe','eml-format','rimraf','zip-dir','request-promise','moment','mustache','util','path','sox','to-csv','fs-extra','squel','crypto','desk.js','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','count','limit','set','Content-Range','reject','save','update','then','destroy','error','stack','name','send','index','ChatOfflineMessage','fieldName','type','model','map','query','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','where','pick'];(function(_0x1abb09,_0x18ee91){var _0xea1c07=function(_0x38f42c){while(--_0x38f42c){_0x1abb09['push'](_0x1abb09['shift']());}};_0xea1c07(++_0x18ee91);}(_0x7a54,0x106));var _0x47a5=function(_0x3fede3,_0x1bb537){_0x3fede3=_0x3fede3-0x0;var _0x13e285=_0x7a54[_0x3fede3];return _0x13e285;};'use strict';var emlformat=require(_0x47a5('0x0'));var rimraf=require(_0x47a5('0x1'));var zipdir=require(_0x47a5('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x47a5('0x3'));var moment=require(_0x47a5('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x47a5('0x5'));var util=require(_0x47a5('0x6'));var path=require(_0x47a5('0x7'));var sox=require(_0x47a5('0x8'));var csv=require(_0x47a5('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x47a5('0xa'));var _=require('lodash');var squel=require(_0x47a5('0xb'));var crypto=require(_0x47a5('0xc'));var jsforce=require('jsforce');var deskjs=require(_0x47a5('0xd'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x47a5('0xe'));var authService=require(_0x47a5('0xf'));var qs=require('../../components/parsers/qs');var as=require(_0x47a5('0x10'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x47a5('0x11'));var utils=require(_0x47a5('0x12'));var config=require(_0x47a5('0x13'));var licenseUtil=require(_0x47a5('0x14'));var db=require(_0x47a5('0x15'))['db'];function respondWithStatusCode(_0xd308b8,_0x1eae59){_0x1eae59=_0x1eae59||0xcc;return function(_0x5beb89){if(_0x5beb89){return _0xd308b8[_0x47a5('0x16')](_0x1eae59);}return _0xd308b8[_0x47a5('0x17')](_0x1eae59)[_0x47a5('0x18')]();};}function respondWithResult(_0x711793,_0x139f25){_0x139f25=_0x139f25||0xc8;return function(_0x620ee9){if(_0x620ee9){return _0x711793[_0x47a5('0x17')](_0x139f25)[_0x47a5('0x19')](_0x620ee9);}};}function respondWithFilteredResult(_0x4e99a8,_0x362359){return function(_0x11faf5){if(_0x11faf5){var _0x3b001e=typeof _0x362359[_0x47a5('0x1a')]===_0x47a5('0x1b')&&typeof _0x362359['limit']==='undefined';var _0x138bc0=_0x11faf5['count'];var _0x5247fd=_0x3b001e?0x0:_0x362359[_0x47a5('0x1a')];var _0xaf70a6=_0x3b001e?_0x11faf5[_0x47a5('0x1c')]:_0x362359[_0x47a5('0x1a')]+_0x362359[_0x47a5('0x1d')];var _0x12b98e;if(_0xaf70a6>=_0x138bc0){_0xaf70a6=_0x138bc0;_0x12b98e=0xc8;}else{_0x12b98e=0xce;}_0x4e99a8[_0x47a5('0x17')](_0x12b98e);return _0x4e99a8[_0x47a5('0x1e')](_0x47a5('0x1f'),_0x5247fd+'-'+_0xaf70a6+'/'+_0x138bc0)['json'](_0x11faf5);}return null;};}function patchUpdates(_0x1570bc){return function(_0xf160ba){try{jsonpatch['apply'](_0xf160ba,_0x1570bc,!![]);}catch(_0x2b0360){return BPromise[_0x47a5('0x20')](_0x2b0360);}return _0xf160ba[_0x47a5('0x21')]();};}function saveUpdates(_0x4c5910,_0xb8ae6c){return function(_0x2f142b){if(_0x2f142b){return _0x2f142b[_0x47a5('0x22')](_0x4c5910)[_0x47a5('0x23')](function(_0x5ef1b1){return _0x5ef1b1;});}return null;};}function removeEntity(_0xe2dea9,_0x385687){return function(_0x513981){if(_0x513981){return _0x513981[_0x47a5('0x24')]()[_0x47a5('0x23')](function(){_0xe2dea9[_0x47a5('0x17')](0xcc)[_0x47a5('0x18')]();});}};}function handleEntityNotFound(_0x3abd6a,_0x50bf17){return function(_0x53078a){if(!_0x53078a){_0x3abd6a[_0x47a5('0x16')](0x194);}return _0x53078a;};}function handleError(_0x5686db,_0x1ea9c8){_0x1ea9c8=_0x1ea9c8||0x1f4;return function(_0x5b6c4e){logger[_0x47a5('0x25')](_0x5b6c4e[_0x47a5('0x26')]);if(_0x5b6c4e[_0x47a5('0x27')]){delete _0x5b6c4e[_0x47a5('0x27')];}_0x5686db[_0x47a5('0x17')](_0x1ea9c8)[_0x47a5('0x28')](_0x5b6c4e);};}exports[_0x47a5('0x29')]=function(_0x136b14,_0x16631f){var _0x361bfa={},_0x1127f8={},_0x11a4fa={'count':0x0,'rows':[]};var _0x3ad507=_['map'](db[_0x47a5('0x2a')]['rawAttributes'],function(_0x2ef875){return{'name':_0x2ef875[_0x47a5('0x2b')],'type':_0x2ef875[_0x47a5('0x2c')]['key']};});_0x1127f8[_0x47a5('0x2d')]=_[_0x47a5('0x2e')](_0x3ad507,_0x47a5('0x27'));_0x1127f8[_0x47a5('0x2f')]=_['keys'](_0x136b14['query']);_0x1127f8[_0x47a5('0x30')]=_[_0x47a5('0x31')](_0x1127f8['model'],_0x1127f8['query']);_0x361bfa[_0x47a5('0x32')]=_[_0x47a5('0x31')](_0x1127f8['model'],qs[_0x47a5('0x33')](_0x136b14['query'][_0x47a5('0x33')]));_0x361bfa[_0x47a5('0x32')]=_0x361bfa['attributes']['length']?_0x361bfa[_0x47a5('0x32')]:_0x1127f8['model'];if(!_0x136b14[_0x47a5('0x2f')][_0x47a5('0x34')](_0x47a5('0x35'))){_0x361bfa['limit']=qs[_0x47a5('0x1d')](_0x136b14['query']['limit']);_0x361bfa[_0x47a5('0x1a')]=qs['offset'](_0x136b14[_0x47a5('0x2f')]['offset']);}_0x361bfa[_0x47a5('0x36')]=qs[_0x47a5('0x37')](_0x136b14[_0x47a5('0x2f')][_0x47a5('0x37')]);_0x361bfa[_0x47a5('0x38')]=qs[_0x47a5('0x30')](_[_0x47a5('0x39')](_0x136b14[_0x47a5('0x2f')],_0x1127f8[_0x47a5('0x30')]),_0x3ad507);if(_0x136b14['query'][_0x47a5('0x3a')]){_0x361bfa[_0x47a5('0x38')]=_['merge'](_0x361bfa[_0x47a5('0x38')],{'$or':_[_0x47a5('0x2e')](_0x3ad507,function(_0x1d4348){if(_0x1d4348['type']!==_0x47a5('0x3b')){var _0x10f660={};_0x10f660[_0x1d4348['name']]={'$like':'%'+_0x136b14[_0x47a5('0x2f')][_0x47a5('0x3a')]+'%'};return _0x10f660;}})});}_0x361bfa=_['merge']({},_0x361bfa,_0x136b14['options']);var _0x5ebd8c={'where':_0x361bfa[_0x47a5('0x38')]};return db['ChatOfflineMessage'][_0x47a5('0x1c')](_0x5ebd8c)[_0x47a5('0x23')](function(_0x301a85){_0x11a4fa[_0x47a5('0x1c')]=_0x301a85;if(_0x136b14[_0x47a5('0x2f')][_0x47a5('0x3c')]){_0x361bfa[_0x47a5('0x3d')]=[{'all':!![]}];}return db[_0x47a5('0x2a')][_0x47a5('0x3e')](_0x361bfa);})[_0x47a5('0x23')](function(_0x280500){_0x11a4fa[_0x47a5('0x3f')]=_0x280500;return _0x11a4fa;})[_0x47a5('0x23')](respondWithFilteredResult(_0x16631f,_0x361bfa))['catch'](handleError(_0x16631f,null));};exports[_0x47a5('0x40')]=function(_0x1c36fa,_0x331474){var _0x23bd8d={'raw':!![],'where':{'id':_0x1c36fa[_0x47a5('0x41')]['id']}},_0x586f4f={};_0x586f4f['model']=_['keys'](db['ChatOfflineMessage']['rawAttributes']);_0x586f4f[_0x47a5('0x2f')]=_['keys'](_0x1c36fa[_0x47a5('0x2f')]);_0x586f4f[_0x47a5('0x30')]=_[_0x47a5('0x31')](_0x586f4f['model'],_0x586f4f[_0x47a5('0x2f')]);_0x23bd8d[_0x47a5('0x32')]=_['intersection'](_0x586f4f['model'],qs[_0x47a5('0x33')](_0x1c36fa['query'][_0x47a5('0x33')]));_0x23bd8d[_0x47a5('0x32')]=_0x23bd8d[_0x47a5('0x32')][_0x47a5('0x42')]?_0x23bd8d[_0x47a5('0x32')]:_0x586f4f[_0x47a5('0x2d')];if(_0x1c36fa[_0x47a5('0x2f')][_0x47a5('0x3c')]){_0x23bd8d[_0x47a5('0x3d')]=[{'all':!![]}];}_0x23bd8d=_[_0x47a5('0x43')]({},_0x23bd8d,_0x1c36fa[_0x47a5('0x44')]);return db[_0x47a5('0x2a')][_0x47a5('0x45')](_0x23bd8d)[_0x47a5('0x23')](handleEntityNotFound(_0x331474,null))[_0x47a5('0x23')](respondWithResult(_0x331474,null))[_0x47a5('0x46')](handleError(_0x331474,null));};exports['create']=function(_0x2d38de,_0x23bb04){return db['ChatOfflineMessage']['create'](_0x2d38de[_0x47a5('0x47')],{})['then'](respondWithResult(_0x23bb04,0xc9))[_0x47a5('0x46')](handleError(_0x23bb04,null));};exports[_0x47a5('0x22')]=function(_0x54c35f,_0x4f62d3){if(_0x54c35f[_0x47a5('0x47')]['id']){delete _0x54c35f['body']['id'];}return db[_0x47a5('0x2a')][_0x47a5('0x45')]({'where':{'id':_0x54c35f[_0x47a5('0x41')]['id']}})[_0x47a5('0x23')](handleEntityNotFound(_0x4f62d3,null))[_0x47a5('0x23')](saveUpdates(_0x54c35f[_0x47a5('0x47')],null))[_0x47a5('0x23')](respondWithResult(_0x4f62d3,null))['catch'](handleError(_0x4f62d3,null));};exports['destroy']=function(_0x2dd1db,_0x411230){return db[_0x47a5('0x48')][_0x47a5('0x3e')]({'where':{'ChatOfflineMessageId':_0x2dd1db[_0x47a5('0x41')]['id']},'raw':!![]})[_0x47a5('0x23')](function(_0x249de5){_0x249de5['forEach'](function(_0x45cca5){var _0x1c9a62=path[_0x47a5('0x49')](config['root'],_0x47a5('0x4a'),'files',_0x47a5('0x4b'),_0x47a5('0x4c'),_0x45cca5[_0x47a5('0x4d')]);var _0xf03bd5=fs['existsSync'](_0x1c9a62);if(_0xf03bd5)fs_extra[_0x47a5('0x4e')](_0x1c9a62);});})[_0x47a5('0x23')](function(){return db[_0x47a5('0x2a')][_0x47a5('0x45')]({'where':{'id':_0x2dd1db[_0x47a5('0x41')]['id']},'individualHooks':!![]});})[_0x47a5('0x23')](handleEntityNotFound(_0x411230,null))[_0x47a5('0x23')](removeEntity(_0x411230,null))['catch'](handleError(_0x411230,null));};exports[_0x47a5('0x4f')]=function(_0x43721b,_0x187d7e){return db[_0x47a5('0x2a')][_0x47a5('0x4f')]()[_0x47a5('0x23')](respondWithResult(_0x187d7e,null))['catch'](handleError(_0x187d7e,null));};
\ No newline at end of file
diff --git a/server/api/chatOfflineMessage/chatOfflineMessage.model.js b/server/api/chatOfflineMessage/chatOfflineMessage.model.js
index 3f78588..48f646d 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 _0x1351=['moment','bluebird','../../config/environment','./chatOfflineMessage.attributes','exports','define','ChatOfflineMessage','chat_offline_messages','utf8mb4','utf8mb4_unicode_ci','lodash','util','../../config/logger','api'];(function(_0x503790,_0x525c78){var _0x388092=function(_0x2ab2b8){while(--_0x2ab2b8){_0x503790['push'](_0x503790['shift']());}};_0x388092(++_0x525c78);}(_0x1351,0x7a));var _0x1135=function(_0xca66c5,_0x45c6f3){_0xca66c5=_0xca66c5-0x0;var _0x2ad2ad=_0x1351[_0xca66c5];return _0x2ad2ad;};'use strict';var _=require(_0x1135('0x0'));var util=require(_0x1135('0x1'));var logger=require(_0x1135('0x2'))(_0x1135('0x3'));var moment=require(_0x1135('0x4'));var BPromise=require(_0x1135('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x1135('0x6'));var attributes=require(_0x1135('0x7'));module[_0x1135('0x8')]=function(_0x1b79e2,_0x4b88c8){return _0x1b79e2[_0x1135('0x9')](_0x1135('0xa'),attributes,{'tableName':_0x1135('0xb'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x1135('0xc'),'collate':_0x1135('0xd')});};
\ No newline at end of file
+var _0x3617=['chat_offline_messages','utf8mb4','utf8mb4_unicode_ci','util','../../config/logger','api','moment','bluebird','path','../../config/environment','./chatOfflineMessage.attributes','exports','define','ChatOfflineMessage'];(function(_0x2e0443,_0x7e5974){var _0x52d450=function(_0x3a9985){while(--_0x3a9985){_0x2e0443['push'](_0x2e0443['shift']());}};_0x52d450(++_0x7e5974);}(_0x3617,0x18b));var _0x7361=function(_0x58acea,_0x5a9ec4){_0x58acea=_0x58acea-0x0;var _0x453242=_0x3617[_0x58acea];return _0x453242;};'use strict';var _=require('lodash');var util=require(_0x7361('0x0'));var logger=require(_0x7361('0x1'))(_0x7361('0x2'));var moment=require(_0x7361('0x3'));var BPromise=require(_0x7361('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x7361('0x5'));var rimraf=require('rimraf');var config=require(_0x7361('0x6'));var attributes=require(_0x7361('0x7'));module[_0x7361('0x8')]=function(_0x4305c8,_0x1fc493){return _0x4305c8[_0x7361('0x9')](_0x7361('0xa'),attributes,{'tableName':_0x7361('0xb'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x7361('0xc'),'collate':_0x7361('0xd')});};
\ No newline at end of file
diff --git a/server/api/chatOfflineMessage/chatOfflineMessage.rpc.js b/server/api/chatOfflineMessage/chatOfflineMessage.rpc.js
index 7884a72..16be0c7 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 _0x3713=['client','http','request','then','info','ChatOfflineMessage,\x20%s,\x20%s','request\x20sent','debug','ChatOfflineMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','../../config/environment','jayson/promise'];(function(_0xf7b253,_0x2de075){var _0x413798=function(_0x3420fc){while(--_0x3420fc){_0xf7b253['push'](_0xf7b253['shift']());}};_0x413798(++_0x2de075);}(_0x3713,0xe7));var _0x3371=function(_0x821dba,_0x569953){_0x821dba=_0x821dba-0x0;var _0x1a4dac=_0x3713[_0x821dba];return _0x1a4dac;};'use strict';var _=require(_0x3371('0x0'));var util=require('util');var moment=require(_0x3371('0x1'));var BPromise=require(_0x3371('0x2'));var rs=require(_0x3371('0x3'));var fs=require('fs');var Redis=require(_0x3371('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x3371('0x5'));var logger=require(_0x3371('0x6'))('rpc');var config=require(_0x3371('0x7'));var jayson=require(_0x3371('0x8'));var client=jayson[_0x3371('0x9')][_0x3371('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x26bf23,_0xd2e5fa,_0x8342ed){return new BPromise(function(_0x26f18e,_0x506a72){return client[_0x3371('0xb')](_0x26bf23,_0x8342ed)[_0x3371('0xc')](function(_0x45f661){logger[_0x3371('0xd')](_0x3371('0xe'),_0xd2e5fa,_0x3371('0xf'));logger[_0x3371('0x10')](_0x3371('0x11'),_0xd2e5fa,'request\x20sent',JSON[_0x3371('0x12')](_0x45f661));if(_0x45f661[_0x3371('0x13')]){if(_0x45f661[_0x3371('0x13')][_0x3371('0x14')]===0x1f4){logger[_0x3371('0x13')](_0x3371('0xe'),_0xd2e5fa,_0x45f661[_0x3371('0x13')][_0x3371('0x15')]);return _0x506a72(_0x45f661[_0x3371('0x13')][_0x3371('0x15')]);}logger[_0x3371('0x13')](_0x3371('0xe'),_0xd2e5fa,_0x45f661['error']['message']);return _0x26f18e(_0x45f661[_0x3371('0x13')][_0x3371('0x15')]);}else{logger[_0x3371('0xd')]('ChatOfflineMessage,\x20%s,\x20%s',_0xd2e5fa,_0x3371('0xf'));_0x26f18e(_0x45f661[_0x3371('0x16')]['message']);}})[_0x3371('0x17')](function(_0x1b3ce7){logger[_0x3371('0x13')](_0x3371('0xe'),_0xd2e5fa,_0x1b3ce7);_0x506a72(_0x1b3ce7);});});}
\ No newline at end of file
+var _0xe157=['request\x20sent','debug','ChatOfflineMessage,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','lodash','util','moment','bluebird','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','info','ChatOfflineMessage,\x20%s,\x20%s'];(function(_0x465028,_0x4570ac){var _0xb783d4=function(_0x5458c5){while(--_0x5458c5){_0x465028['push'](_0x465028['shift']());}};_0xb783d4(++_0x4570ac);}(_0xe157,0x13c));var _0x7e15=function(_0x5100a6,_0x553dac){_0x5100a6=_0x5100a6-0x0;var _0x5dbc50=_0xe157[_0x5100a6];return _0x5dbc50;};'use strict';var _=require(_0x7e15('0x0'));var util=require(_0x7e15('0x1'));var moment=require(_0x7e15('0x2'));var BPromise=require(_0x7e15('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x7e15('0x4'));var logger=require(_0x7e15('0x5'))(_0x7e15('0x6'));var config=require(_0x7e15('0x7'));var jayson=require(_0x7e15('0x8'));var client=jayson[_0x7e15('0x9')][_0x7e15('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x324e63,_0x59b98b,_0x2bf5e2){return new BPromise(function(_0x3532cb,_0x26dc90){return client[_0x7e15('0xb')](_0x324e63,_0x2bf5e2)['then'](function(_0x5b2935){logger[_0x7e15('0xc')](_0x7e15('0xd'),_0x59b98b,_0x7e15('0xe'));logger[_0x7e15('0xf')](_0x7e15('0x10'),_0x59b98b,_0x7e15('0xe'),JSON[_0x7e15('0x11')](_0x5b2935));if(_0x5b2935['error']){if(_0x5b2935['error']['code']===0x1f4){logger[_0x7e15('0x12')]('ChatOfflineMessage,\x20%s,\x20%s',_0x59b98b,_0x5b2935[_0x7e15('0x12')][_0x7e15('0x13')]);return _0x26dc90(_0x5b2935['error'][_0x7e15('0x13')]);}logger[_0x7e15('0x12')]('ChatOfflineMessage,\x20%s,\x20%s',_0x59b98b,_0x5b2935['error'][_0x7e15('0x13')]);return _0x3532cb(_0x5b2935[_0x7e15('0x12')][_0x7e15('0x13')]);}else{logger['info'](_0x7e15('0xd'),_0x59b98b,'request\x20sent');_0x3532cb(_0x5b2935[_0x7e15('0x14')][_0x7e15('0x13')]);}})[_0x7e15('0x15')](function(_0x5bb544){logger['error'](_0x7e15('0xd'),_0x59b98b,_0x5bb544);_0x26dc90(_0x5bb544);});});}
\ No newline at end of file
diff --git a/server/api/chatOfflineMessage/index.js b/server/api/chatOfflineMessage/index.js
index 52e5b42..40d14c8 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 _0xe729=['express','fs-extra','../../components/auth/service','../../config/environment','get','isAuthenticated','index','/describe','create','update','delete','/:id','exports','multer','util','path'];(function(_0x53f7b6,_0x16ffbe){var _0x1aeb7e=function(_0x54e835){while(--_0x54e835){_0x53f7b6['push'](_0x53f7b6['shift']());}};_0x1aeb7e(++_0x16ffbe);}(_0xe729,0x19d));var _0x9e72=function(_0x4830ef,_0x12b408){_0x4830ef=_0x4830ef-0x0;var _0x350dae=_0xe729[_0x4830ef];return _0x350dae;};'use strict';var multer=require(_0x9e72('0x0'));var util=require(_0x9e72('0x1'));var path=require(_0x9e72('0x2'));var timeout=require('connect-timeout');var express=require(_0x9e72('0x3'));var router=express['Router']();var fs_extra=require(_0x9e72('0x4'));var auth=require(_0x9e72('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x9e72('0x6'));var controller=require('./chatOfflineMessage.controller');router[_0x9e72('0x7')]('/',auth[_0x9e72('0x8')](),controller[_0x9e72('0x9')]);router[_0x9e72('0x7')](_0x9e72('0xa'),auth[_0x9e72('0x8')](),controller['describe']);router[_0x9e72('0x7')]('/:id',auth['isAuthenticated'](),controller['show']);router['post']('/',auth[_0x9e72('0x8')](),controller[_0x9e72('0xb')]);router['put']('/:id',auth[_0x9e72('0x8')](),controller[_0x9e72('0xc')]);router[_0x9e72('0xd')](_0x9e72('0xe'),auth['isAuthenticated'](),controller['destroy']);module[_0x9e72('0xf')]=router;
\ No newline at end of file
+var _0xeac6=['put','delete','destroy','exports','multer','util','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatOfflineMessage.controller','get','isAuthenticated','index','describe','/:id','show','post'];(function(_0x99868f,_0xbdb8e7){var _0x27a71b=function(_0x41feca){while(--_0x41feca){_0x99868f['push'](_0x99868f['shift']());}};_0x27a71b(++_0xbdb8e7);}(_0xeac6,0xe0));var _0x6eac=function(_0x439184,_0x2ab98d){_0x439184=_0x439184-0x0;var _0x4d733b=_0xeac6[_0x439184];return _0x4d733b;};'use strict';var multer=require(_0x6eac('0x0'));var util=require(_0x6eac('0x1'));var path=require('path');var timeout=require(_0x6eac('0x2'));var express=require(_0x6eac('0x3'));var router=express['Router']();var fs_extra=require(_0x6eac('0x4'));var auth=require(_0x6eac('0x5'));var interaction=require(_0x6eac('0x6'));var config=require(_0x6eac('0x7'));var controller=require(_0x6eac('0x8'));router[_0x6eac('0x9')]('/',auth[_0x6eac('0xa')](),controller[_0x6eac('0xb')]);router[_0x6eac('0x9')]('/describe',auth['isAuthenticated'](),controller[_0x6eac('0xc')]);router[_0x6eac('0x9')](_0x6eac('0xd'),auth[_0x6eac('0xa')](),controller[_0x6eac('0xe')]);router[_0x6eac('0xf')]('/',auth[_0x6eac('0xa')](),controller['create']);router[_0x6eac('0x10')]('/:id',auth[_0x6eac('0xa')](),controller['update']);router[_0x6eac('0x11')](_0x6eac('0xd'),auth[_0x6eac('0xa')](),controller[_0x6eac('0x12')]);module[_0x6eac('0x13')]=router;
\ No newline at end of file
diff --git a/server/api/chatProactiveAction/chatProactiveAction.attributes.js b/server/api/chatProactiveAction/chatProactiveAction.attributes.js
index eea4ff7..7455e74 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 _0xbf20=['timeout','INTEGER','sequelize','exports','STRING','ENUM','mouseOver'];(function(_0x384eb1,_0xef2c1f){var _0x12cd33=function(_0x59d08d){while(--_0x59d08d){_0x384eb1['push'](_0x384eb1['shift']());}};_0x12cd33(++_0xef2c1f);}(_0xbf20,0xcd));var _0x0bf2=function(_0x5e9bc0,_0x5a8e4e){_0x5e9bc0=_0x5e9bc0-0x0;var _0x294555=_0xbf20[_0x5e9bc0];return _0x294555;};'use strict';var Sequelize=require(_0x0bf2('0x0'));module[_0x0bf2('0x1')]={'name':{'type':Sequelize[_0x0bf2('0x2')],'allowNull':![]},'type':{'type':Sequelize[_0x0bf2('0x3')](_0x0bf2('0x4'),_0x0bf2('0x5')),'defaultValue':'mouseOver'},'selector':{'type':Sequelize[_0x0bf2('0x2')]},'timeout':{'type':Sequelize[_0x0bf2('0x6')]}};
\ No newline at end of file
+var _0x88d5=['INTEGER','sequelize','exports','STRING','ENUM','mouseOver'];(function(_0xdea41a,_0x552987){var _0x15d0d8=function(_0x1e0d0b){while(--_0x1e0d0b){_0xdea41a['push'](_0xdea41a['shift']());}};_0x15d0d8(++_0x552987);}(_0x88d5,0x127));var _0x588d=function(_0x8ee873,_0x35651b){_0x8ee873=_0x8ee873-0x0;var _0x18dc06=_0x88d5[_0x8ee873];return _0x18dc06;};'use strict';var Sequelize=require(_0x588d('0x0'));module[_0x588d('0x1')]={'name':{'type':Sequelize[_0x588d('0x2')],'allowNull':![]},'type':{'type':Sequelize[_0x588d('0x3')](_0x588d('0x4'),'timeout'),'defaultValue':'mouseOver'},'selector':{'type':Sequelize[_0x588d('0x2')]},'timeout':{'type':Sequelize[_0x588d('0x5')]}};
\ No newline at end of file
diff --git a/server/api/chatProactiveAction/chatProactiveAction.controller.js b/server/api/chatProactiveAction/chatProactiveAction.controller.js
index c1f1c56..02640b1 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 _0x308a=['ejs','fs-extra','lodash','jsforce','desk.js','querystring','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','../../config/environment','../../config/license/util','../../mysqldb','status','end','offset','limit','undefined','count','set','Content-Range','json','apply','reject','save','then','destroy','sendStatus','error','stack','name','send','show','params','model','keys','ChatProactiveAction','rawAttributes','query','filters','attributes','intersection','fields','length','includeAll','include','options','find','catch','create','update','body','eml-format','zip-dir','fast-json-patch','request-promise','moment','util','path','sox','to-csv'];(function(_0x3da612,_0x332456){var _0x1a9d1d=function(_0x5ca0d0){while(--_0x5ca0d0){_0x3da612['push'](_0x3da612['shift']());}};_0x1a9d1d(++_0x332456);}(_0x308a,0x71));var _0xa308=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0x308a[_0x321bb2];return _0x9c12ed;};'use strict';var emlformat=require(_0xa308('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xa308('0x1'));var jsonpatch=require(_0xa308('0x2'));var rp=require(_0xa308('0x3'));var moment=require(_0xa308('0x4'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0xa308('0x5'));var path=require(_0xa308('0x6'));var sox=require(_0xa308('0x7'));var csv=require(_0xa308('0x8'));var ejs=require(_0xa308('0x9'));var fs=require('fs');var fs_extra=require(_0xa308('0xa'));var _=require(_0xa308('0xb'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0xa308('0xc'));var deskjs=require(_0xa308('0xd'));var toCsv=require('to-csv');var querystring=require(_0xa308('0xe'));var Papa=require('papaparse');var Redis=require(_0xa308('0xf'));var authService=require('../../components/auth/service');var qs=require(_0xa308('0x10'));var as=require(_0xa308('0x11'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xa308('0x12'))('api');var utils=require('../../config/utils');var config=require(_0xa308('0x13'));var licenseUtil=require(_0xa308('0x14'));var db=require(_0xa308('0x15'))['db'];function respondWithStatusCode(_0x36b6eb,_0x224599){_0x224599=_0x224599||0xcc;return function(_0x4577ca){if(_0x4577ca){return _0x36b6eb['sendStatus'](_0x224599);}return _0x36b6eb[_0xa308('0x16')](_0x224599)[_0xa308('0x17')]();};}function respondWithResult(_0x80ee50,_0x32d57e){_0x32d57e=_0x32d57e||0xc8;return function(_0x39b04c){if(_0x39b04c){return _0x80ee50['status'](_0x32d57e)['json'](_0x39b04c);}};}function respondWithFilteredResult(_0x558c31,_0x1ba897){return function(_0x31193e){if(_0x31193e){var _0x178c33=typeof _0x1ba897[_0xa308('0x18')]==='undefined'&&typeof _0x1ba897[_0xa308('0x19')]===_0xa308('0x1a');var _0x1a94ba=_0x31193e[_0xa308('0x1b')];var _0x309ac0=_0x178c33?0x0:_0x1ba897[_0xa308('0x18')];var _0x4d6ab9=_0x178c33?_0x31193e[_0xa308('0x1b')]:_0x1ba897[_0xa308('0x18')]+_0x1ba897[_0xa308('0x19')];var _0x5408b1;if(_0x4d6ab9>=_0x1a94ba){_0x4d6ab9=_0x1a94ba;_0x5408b1=0xc8;}else{_0x5408b1=0xce;}_0x558c31[_0xa308('0x16')](_0x5408b1);return _0x558c31[_0xa308('0x1c')](_0xa308('0x1d'),_0x309ac0+'-'+_0x4d6ab9+'/'+_0x1a94ba)[_0xa308('0x1e')](_0x31193e);}return null;};}function patchUpdates(_0x1312aa){return function(_0x2e1d96){try{jsonpatch[_0xa308('0x1f')](_0x2e1d96,_0x1312aa,!![]);}catch(_0x57cec3){return BPromise[_0xa308('0x20')](_0x57cec3);}return _0x2e1d96[_0xa308('0x21')]();};}function saveUpdates(_0x167a27,_0x1588d0){return function(_0x31eb17){if(_0x31eb17){return _0x31eb17['update'](_0x167a27)[_0xa308('0x22')](function(_0x3acb1c){return _0x3acb1c;});}return null;};}function removeEntity(_0x1c5a22,_0x18ec9a){return function(_0x5dbbbf){if(_0x5dbbbf){return _0x5dbbbf[_0xa308('0x23')]()[_0xa308('0x22')](function(){_0x1c5a22[_0xa308('0x16')](0xcc)['end']();});}};}function handleEntityNotFound(_0x1ed1a2,_0x5f3995){return function(_0x557a11){if(!_0x557a11){_0x1ed1a2[_0xa308('0x24')](0x194);}return _0x557a11;};}function handleError(_0x54bfc4,_0x592364){_0x592364=_0x592364||0x1f4;return function(_0x192597){logger[_0xa308('0x25')](_0x192597[_0xa308('0x26')]);if(_0x192597['name']){delete _0x192597[_0xa308('0x27')];}_0x54bfc4[_0xa308('0x16')](_0x592364)[_0xa308('0x28')](_0x192597);};}exports[_0xa308('0x29')]=function(_0x15666f,_0x1f49f2){var _0x5814eb={'raw':!![],'where':{'id':_0x15666f[_0xa308('0x2a')]['id']}},_0x1f9db4={};_0x1f9db4[_0xa308('0x2b')]=_[_0xa308('0x2c')](db[_0xa308('0x2d')][_0xa308('0x2e')]);_0x1f9db4['query']=_[_0xa308('0x2c')](_0x15666f[_0xa308('0x2f')]);_0x1f9db4[_0xa308('0x30')]=_['intersection'](_0x1f9db4[_0xa308('0x2b')],_0x1f9db4['query']);_0x5814eb[_0xa308('0x31')]=_[_0xa308('0x32')](_0x1f9db4[_0xa308('0x2b')],qs[_0xa308('0x33')](_0x15666f['query'][_0xa308('0x33')]));_0x5814eb[_0xa308('0x31')]=_0x5814eb[_0xa308('0x31')][_0xa308('0x34')]?_0x5814eb['attributes']:_0x1f9db4['model'];if(_0x15666f[_0xa308('0x2f')][_0xa308('0x35')]){_0x5814eb[_0xa308('0x36')]=[{'all':!![]}];}_0x5814eb=_['merge']({},_0x5814eb,_0x15666f[_0xa308('0x37')]);return db['ChatProactiveAction'][_0xa308('0x38')](_0x5814eb)[_0xa308('0x22')](handleEntityNotFound(_0x1f49f2,null))[_0xa308('0x22')](respondWithResult(_0x1f49f2,null))[_0xa308('0x39')](handleError(_0x1f49f2,null));};exports[_0xa308('0x3a')]=function(_0x101ed6,_0x4940bf){return db[_0xa308('0x2d')]['create'](_0x101ed6['body'],{})[_0xa308('0x22')](respondWithResult(_0x4940bf,0xc9))['catch'](handleError(_0x4940bf,null));};exports[_0xa308('0x3b')]=function(_0x3b8cc8,_0x1eac26){if(_0x3b8cc8['body']['id']){delete _0x3b8cc8[_0xa308('0x3c')]['id'];}return db[_0xa308('0x2d')][_0xa308('0x38')]({'where':{'id':_0x3b8cc8[_0xa308('0x2a')]['id']}})[_0xa308('0x22')](handleEntityNotFound(_0x1eac26,null))[_0xa308('0x22')](saveUpdates(_0x3b8cc8[_0xa308('0x3c')],null))[_0xa308('0x22')](respondWithResult(_0x1eac26,null))[_0xa308('0x39')](handleError(_0x1eac26,null));};exports['destroy']=function(_0x501def,_0x1ea9d1){return db['ChatProactiveAction']['find']({'where':{'id':_0x501def[_0xa308('0x2a')]['id']}})[_0xa308('0x22')](handleEntityNotFound(_0x1ea9d1,null))[_0xa308('0x22')](removeEntity(_0x1ea9d1,null))[_0xa308('0x39')](handleError(_0x1ea9d1,null));};
\ No newline at end of file
+var _0x1052=['intersection','model','attributes','fields','length','include','merge','create','body','destroy','find','catch','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','to-csv','fs-extra','lodash','crypto','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','apply','reject','update','then','error','stack','name','send','params','ChatProactiveAction','rawAttributes','query','keys','filters'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x1052,0xf4));var _0x2105=function(_0x9894ff,_0x9256ba){_0x9894ff=_0x9894ff-0x0;var _0x462988=_0x1052[_0x9894ff];return _0x462988;};'use strict';var emlformat=require(_0x2105('0x0'));var rimraf=require(_0x2105('0x1'));var zipdir=require(_0x2105('0x2'));var jsonpatch=require(_0x2105('0x3'));var rp=require(_0x2105('0x4'));var moment=require(_0x2105('0x5'));var BPromise=require(_0x2105('0x6'));var Mustache=require(_0x2105('0x7'));var util=require(_0x2105('0x8'));var path=require('path');var sox=require('sox');var csv=require(_0x2105('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x2105('0xa'));var _=require(_0x2105('0xb'));var squel=require('squel');var crypto=require(_0x2105('0xc'));var jsforce=require(_0x2105('0xd'));var deskjs=require(_0x2105('0xe'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x2105('0xf'));var Redis=require(_0x2105('0x10'));var authService=require(_0x2105('0x11'));var qs=require('../../components/parsers/qs');var as=require(_0x2105('0x12'));var hardwareService=require(_0x2105('0x13'));var logger=require(_0x2105('0x14'))(_0x2105('0x15'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0x2105('0x16'));var db=require(_0x2105('0x17'))['db'];function respondWithStatusCode(_0x462fc3,_0x16e9ff){_0x16e9ff=_0x16e9ff||0xcc;return function(_0x983ad){if(_0x983ad){return _0x462fc3[_0x2105('0x18')](_0x16e9ff);}return _0x462fc3[_0x2105('0x19')](_0x16e9ff)[_0x2105('0x1a')]();};}function respondWithResult(_0x190e9d,_0x15af88){_0x15af88=_0x15af88||0xc8;return function(_0x59c7c5){if(_0x59c7c5){return _0x190e9d[_0x2105('0x19')](_0x15af88)[_0x2105('0x1b')](_0x59c7c5);}};}function respondWithFilteredResult(_0x1a3fa3,_0x25e0c7){return function(_0x576c51){if(_0x576c51){var _0x42526b=typeof _0x25e0c7[_0x2105('0x1c')]===_0x2105('0x1d')&&typeof _0x25e0c7[_0x2105('0x1e')]===_0x2105('0x1d');var _0x499942=_0x576c51[_0x2105('0x1f')];var _0x1afa9d=_0x42526b?0x0:_0x25e0c7['offset'];var _0x3c8402=_0x42526b?_0x576c51[_0x2105('0x1f')]:_0x25e0c7[_0x2105('0x1c')]+_0x25e0c7[_0x2105('0x1e')];var _0x21c4d4;if(_0x3c8402>=_0x499942){_0x3c8402=_0x499942;_0x21c4d4=0xc8;}else{_0x21c4d4=0xce;}_0x1a3fa3[_0x2105('0x19')](_0x21c4d4);return _0x1a3fa3['set']('Content-Range',_0x1afa9d+'-'+_0x3c8402+'/'+_0x499942)[_0x2105('0x1b')](_0x576c51);}return null;};}function patchUpdates(_0x31cc0c){return function(_0x359abd){try{jsonpatch[_0x2105('0x20')](_0x359abd,_0x31cc0c,!![]);}catch(_0x206906){return BPromise[_0x2105('0x21')](_0x206906);}return _0x359abd['save']();};}function saveUpdates(_0x11d067,_0x33d8ea){return function(_0x5b00fc){if(_0x5b00fc){return _0x5b00fc[_0x2105('0x22')](_0x11d067)[_0x2105('0x23')](function(_0x172c91){return _0x172c91;});}return null;};}function removeEntity(_0xc99047,_0x5de51d){return function(_0x4200d2){if(_0x4200d2){return _0x4200d2['destroy']()['then'](function(){_0xc99047[_0x2105('0x19')](0xcc)[_0x2105('0x1a')]();});}};}function handleEntityNotFound(_0x25eb8c,_0x124a22){return function(_0x531f14){if(!_0x531f14){_0x25eb8c[_0x2105('0x18')](0x194);}return _0x531f14;};}function handleError(_0x2ce9b5,_0x31da07){_0x31da07=_0x31da07||0x1f4;return function(_0x3a4af1){logger[_0x2105('0x24')](_0x3a4af1[_0x2105('0x25')]);if(_0x3a4af1[_0x2105('0x26')]){delete _0x3a4af1[_0x2105('0x26')];}_0x2ce9b5['status'](_0x31da07)[_0x2105('0x27')](_0x3a4af1);};}exports['show']=function(_0x20a564,_0x1c1df3){var _0x110973={'raw':!![],'where':{'id':_0x20a564[_0x2105('0x28')]['id']}},_0x2deb12={};_0x2deb12['model']=_['keys'](db[_0x2105('0x29')][_0x2105('0x2a')]);_0x2deb12[_0x2105('0x2b')]=_[_0x2105('0x2c')](_0x20a564[_0x2105('0x2b')]);_0x2deb12[_0x2105('0x2d')]=_[_0x2105('0x2e')](_0x2deb12[_0x2105('0x2f')],_0x2deb12['query']);_0x110973[_0x2105('0x30')]=_[_0x2105('0x2e')](_0x2deb12[_0x2105('0x2f')],qs['fields'](_0x20a564['query'][_0x2105('0x31')]));_0x110973[_0x2105('0x30')]=_0x110973[_0x2105('0x30')][_0x2105('0x32')]?_0x110973[_0x2105('0x30')]:_0x2deb12['model'];if(_0x20a564['query']['includeAll']){_0x110973[_0x2105('0x33')]=[{'all':!![]}];}_0x110973=_[_0x2105('0x34')]({},_0x110973,_0x20a564['options']);return db['ChatProactiveAction']['find'](_0x110973)[_0x2105('0x23')](handleEntityNotFound(_0x1c1df3,null))[_0x2105('0x23')](respondWithResult(_0x1c1df3,null))['catch'](handleError(_0x1c1df3,null));};exports[_0x2105('0x35')]=function(_0x8394cd,_0x2eb5e9){return db['ChatProactiveAction'][_0x2105('0x35')](_0x8394cd[_0x2105('0x36')],{})[_0x2105('0x23')](respondWithResult(_0x2eb5e9,0xc9))['catch'](handleError(_0x2eb5e9,null));};exports[_0x2105('0x22')]=function(_0x40f13a,_0x5cc639){if(_0x40f13a[_0x2105('0x36')]['id']){delete _0x40f13a[_0x2105('0x36')]['id'];}return db[_0x2105('0x29')]['find']({'where':{'id':_0x40f13a[_0x2105('0x28')]['id']}})[_0x2105('0x23')](handleEntityNotFound(_0x5cc639,null))[_0x2105('0x23')](saveUpdates(_0x40f13a[_0x2105('0x36')],null))[_0x2105('0x23')](respondWithResult(_0x5cc639,null))['catch'](handleError(_0x5cc639,null));};exports[_0x2105('0x37')]=function(_0x1d987e,_0x4b6fe1){return db[_0x2105('0x29')][_0x2105('0x38')]({'where':{'id':_0x1d987e[_0x2105('0x28')]['id']}})[_0x2105('0x23')](handleEntityNotFound(_0x4b6fe1,null))[_0x2105('0x23')](removeEntity(_0x4b6fe1,null))[_0x2105('0x39')](handleError(_0x4b6fe1,null));};
\ No newline at end of file
diff --git a/server/api/chatProactiveAction/chatProactiveAction.model.js b/server/api/chatProactiveAction/chatProactiveAction.model.js
index 237adc0..dbf1009 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 _0x8361=['util','bluebird','path','rimraf','../../config/environment','./chatProactiveAction.attributes','chat_proactive_actions'];(function(_0x25ec19,_0x385cd5){var _0x173b68=function(_0x49052f){while(--_0x49052f){_0x25ec19['push'](_0x25ec19['shift']());}};_0x173b68(++_0x385cd5);}(_0x8361,0xd9));var _0x1836=function(_0x82129b,_0x484ae9){_0x82129b=_0x82129b-0x0;var _0x2ae5dc=_0x8361[_0x82129b];return _0x2ae5dc;};'use strict';var _=require('lodash');var util=require(_0x1836('0x0'));var logger=require('../../config/logger')('api');var moment=require('moment');var BPromise=require(_0x1836('0x1'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x1836('0x2'));var rimraf=require(_0x1836('0x3'));var config=require(_0x1836('0x4'));var attributes=require(_0x1836('0x5'));module['exports']=function(_0x4b344b,_0x4146f9){return _0x4b344b['define']('ChatProactiveAction',attributes,{'tableName':_0x1836('0x6'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xd2de=['api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./chatProactiveAction.attributes','exports','define','ChatProactiveAction','chat_proactive_actions','lodash','util','../../config/logger'];(function(_0x3ff39a,_0x34513b){var _0x3c1858=function(_0x9b8969){while(--_0x9b8969){_0x3ff39a['push'](_0x3ff39a['shift']());}};_0x3c1858(++_0x34513b);}(_0xd2de,0x1ec));var _0xed2d=function(_0xa73c1f,_0x3c3b65){_0xa73c1f=_0xa73c1f-0x0;var _0x50a1db=_0xd2de[_0xa73c1f];return _0x50a1db;};'use strict';var _=require(_0xed2d('0x0'));var util=require(_0xed2d('0x1'));var logger=require(_0xed2d('0x2'))(_0xed2d('0x3'));var moment=require(_0xed2d('0x4'));var BPromise=require(_0xed2d('0x5'));var rp=require(_0xed2d('0x6'));var fs=require('fs');var path=require(_0xed2d('0x7'));var rimraf=require(_0xed2d('0x8'));var config=require(_0xed2d('0x9'));var attributes=require(_0xed2d('0xa'));module[_0xed2d('0xb')]=function(_0x448c3b,_0x223c52){return _0x448c3b[_0xed2d('0xc')](_0xed2d('0xd'),attributes,{'tableName':_0xed2d('0xe'),'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 df8924f..e6da660 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 _0xd80e=['error','code','message','info','result','catch','lodash','util','moment','bluebird','randomstring','../../config/utils','../../config/logger','../../config/environment','jayson/promise','http','request','then','ChatProactiveAction,\x20%s,\x20%s','ChatProactiveAction,\x20%s,\x20%s,\x20%s'];(function(_0x3c84a4,_0x1a2471){var _0x521c7f=function(_0x5a18a3){while(--_0x5a18a3){_0x3c84a4['push'](_0x3c84a4['shift']());}};_0x521c7f(++_0x1a2471);}(_0xd80e,0xf6));var _0xed80=function(_0x2a448c,_0x488f3f){_0x2a448c=_0x2a448c-0x0;var _0x2c04ee=_0xd80e[_0x2a448c];return _0x2c04ee;};'use strict';var _=require(_0xed80('0x0'));var util=require(_0xed80('0x1'));var moment=require(_0xed80('0x2'));var BPromise=require(_0xed80('0x3'));var rs=require(_0xed80('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0xed80('0x5'));var logger=require(_0xed80('0x6'))('rpc');var config=require(_0xed80('0x7'));var jayson=require(_0xed80('0x8'));var client=jayson['client'][_0xed80('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x9ae150,_0x3041d2,_0x841e23){return new BPromise(function(_0x28d15e,_0x10eaf2){return client[_0xed80('0xa')](_0x9ae150,_0x841e23)[_0xed80('0xb')](function(_0x3f2668){logger['info'](_0xed80('0xc'),_0x3041d2,'request\x20sent');logger['debug'](_0xed80('0xd'),_0x3041d2,'request\x20sent',JSON['stringify'](_0x3f2668));if(_0x3f2668['error']){if(_0x3f2668[_0xed80('0xe')][_0xed80('0xf')]===0x1f4){logger[_0xed80('0xe')]('ChatProactiveAction,\x20%s,\x20%s',_0x3041d2,_0x3f2668['error'][_0xed80('0x10')]);return _0x10eaf2(_0x3f2668[_0xed80('0xe')]['message']);}logger[_0xed80('0xe')]('ChatProactiveAction,\x20%s,\x20%s',_0x3041d2,_0x3f2668[_0xed80('0xe')]['message']);return _0x28d15e(_0x3f2668[_0xed80('0xe')][_0xed80('0x10')]);}else{logger[_0xed80('0x11')](_0xed80('0xc'),_0x3041d2,'request\x20sent');_0x28d15e(_0x3f2668[_0xed80('0x12')]['message']);}})[_0xed80('0x13')](function(_0x378754){logger[_0xed80('0xe')](_0xed80('0xc'),_0x3041d2,_0x378754);_0x10eaf2(_0x378754);});});}
\ No newline at end of file
+var _0x6c41=['jayson/promise','client','http','request','info','ChatProactiveAction,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','catch','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc'];(function(_0x1664bc,_0x59f652){var _0x148d6e=function(_0x507448){while(--_0x507448){_0x1664bc['push'](_0x1664bc['shift']());}};_0x148d6e(++_0x59f652);}(_0x6c41,0x1c6));var _0x16c4=function(_0x49d41c,_0x2bdc35){_0x49d41c=_0x49d41c-0x0;var _0xb64c5f=_0x6c41[_0x49d41c];return _0xb64c5f;};'use strict';var _=require('lodash');var util=require(_0x16c4('0x0'));var moment=require(_0x16c4('0x1'));var BPromise=require(_0x16c4('0x2'));var rs=require(_0x16c4('0x3'));var fs=require('fs');var Redis=require(_0x16c4('0x4'));var db=require(_0x16c4('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x16c4('0x6'))(_0x16c4('0x7'));var config=require('../../config/environment');var jayson=require(_0x16c4('0x8'));var client=jayson[_0x16c4('0x9')][_0x16c4('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x347546,_0x8ba811,_0x15e218){return new BPromise(function(_0x5eacec,_0x5a4d00){return client[_0x16c4('0xb')](_0x347546,_0x15e218)['then'](function(_0x3a4075){logger[_0x16c4('0xc')](_0x16c4('0xd'),_0x8ba811,_0x16c4('0xe'));logger[_0x16c4('0xf')]('ChatProactiveAction,\x20%s,\x20%s,\x20%s',_0x8ba811,_0x16c4('0xe'),JSON[_0x16c4('0x10')](_0x3a4075));if(_0x3a4075[_0x16c4('0x11')]){if(_0x3a4075['error'][_0x16c4('0x12')]===0x1f4){logger[_0x16c4('0x11')]('ChatProactiveAction,\x20%s,\x20%s',_0x8ba811,_0x3a4075['error'][_0x16c4('0x13')]);return _0x5a4d00(_0x3a4075['error'][_0x16c4('0x13')]);}logger[_0x16c4('0x11')]('ChatProactiveAction,\x20%s,\x20%s',_0x8ba811,_0x3a4075['error'][_0x16c4('0x13')]);return _0x5eacec(_0x3a4075[_0x16c4('0x11')][_0x16c4('0x13')]);}else{logger[_0x16c4('0xc')](_0x16c4('0xd'),_0x8ba811,'request\x20sent');_0x5eacec(_0x3a4075[_0x16c4('0x14')]['message']);}})[_0x16c4('0x15')](function(_0x586134){logger['error'](_0x16c4('0xd'),_0x8ba811,_0x586134);_0x5a4d00(_0x586134);});});}
\ No newline at end of file
diff --git a/server/api/chatProactiveAction/index.js b/server/api/chatProactiveAction/index.js
index 5b09a08..e3a6dd0 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 _0x24ca=['../../components/interaction/service','../../config/environment','./chatProactiveAction.controller','get','/:id','isAuthenticated','show','post','put','delete','destroy','exports','multer','path','connect-timeout','express','fs-extra','../../components/auth/service'];(function(_0x4f8718,_0x524b54){var _0x751503=function(_0x53451f){while(--_0x53451f){_0x4f8718['push'](_0x4f8718['shift']());}};_0x751503(++_0x524b54);}(_0x24ca,0x1bc));var _0xa24c=function(_0x18ab2a,_0x4debcd){_0x18ab2a=_0x18ab2a-0x0;var _0x16dcee=_0x24ca[_0x18ab2a];return _0x16dcee;};'use strict';var multer=require(_0xa24c('0x0'));var util=require('util');var path=require(_0xa24c('0x1'));var timeout=require(_0xa24c('0x2'));var express=require(_0xa24c('0x3'));var router=express['Router']();var fs_extra=require(_0xa24c('0x4'));var auth=require(_0xa24c('0x5'));var interaction=require(_0xa24c('0x6'));var config=require(_0xa24c('0x7'));var controller=require(_0xa24c('0x8'));router[_0xa24c('0x9')](_0xa24c('0xa'),auth[_0xa24c('0xb')](),controller[_0xa24c('0xc')]);router[_0xa24c('0xd')]('/',auth[_0xa24c('0xb')](),controller['create']);router[_0xa24c('0xe')](_0xa24c('0xa'),auth[_0xa24c('0xb')](),controller['update']);router[_0xa24c('0xf')](_0xa24c('0xa'),auth[_0xa24c('0xb')](),controller[_0xa24c('0x10')]);module[_0xa24c('0x11')]=router;
\ No newline at end of file
+var _0x425d=['multer','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./chatProactiveAction.controller','get','/:id','isAuthenticated','show','post','create','put','update','delete','destroy','exports'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x425d,0x1e0));var _0xd425=function(_0x5e6c43,_0x132a12){_0x5e6c43=_0x5e6c43-0x0;var _0x23d90e=_0x425d[_0x5e6c43];return _0x23d90e;};'use strict';var multer=require(_0xd425('0x0'));var util=require('util');var path=require(_0xd425('0x1'));var timeout=require(_0xd425('0x2'));var express=require(_0xd425('0x3'));var router=express[_0xd425('0x4')]();var fs_extra=require(_0xd425('0x5'));var auth=require(_0xd425('0x6'));var interaction=require(_0xd425('0x7'));var config=require('../../config/environment');var controller=require(_0xd425('0x8'));router[_0xd425('0x9')](_0xd425('0xa'),auth[_0xd425('0xb')](),controller[_0xd425('0xc')]);router[_0xd425('0xd')]('/',auth['isAuthenticated'](),controller[_0xd425('0xe')]);router[_0xd425('0xf')](_0xd425('0xa'),auth[_0xd425('0xb')](),controller[_0xd425('0x10')]);router[_0xd425('0x11')](_0xd425('0xa'),auth[_0xd425('0xb')](),controller[_0xd425('0x12')]);module[_0xd425('0x13')]=router;
\ No newline at end of file
diff --git a/server/api/chatQueue/chatQueue.attributes.js b/server/api/chatQueue/chatQueue.attributes.js
index 50db3a4..5b59f0a 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 _0xcb38=['beepall','sequelize','exports','name','STRING','INTEGER','ENUM','rrmemory'];(function(_0x5d80de,_0x2cf15d){var _0x1c7556=function(_0x5bd806){while(--_0x5bd806){_0x5d80de['push'](_0x5d80de['shift']());}};_0x1c7556(++_0x2cf15d);}(_0xcb38,0x71));var _0x8cb3=function(_0x4e998d,_0x145397){_0x4e998d=_0x4e998d-0x0;var _0x5e8a44=_0xcb38[_0x4e998d];return _0x5e8a44;};'use strict';var Sequelize=require(_0x8cb3('0x0'));module[_0x8cb3('0x1')]={'name':{'type':Sequelize['STRING'],'unique':_0x8cb3('0x2'),'allowNull':![],'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize[_0x8cb3('0x3')]},'timeout':{'type':Sequelize[_0x8cb3('0x4')],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0x8cb3('0x5')](_0x8cb3('0x6'),_0x8cb3('0x7'),'roundrobin')}};
\ No newline at end of file
+var _0x0059=['INTEGER','rrmemory','roundrobin','exports','STRING','name'];(function(_0x44454f,_0x4bfbe8){var _0x475150=function(_0x1cde13){while(--_0x1cde13){_0x44454f['push'](_0x44454f['shift']());}};_0x475150(++_0x4bfbe8);}(_0x0059,0xdb));var _0x9005=function(_0x4fde08,_0x463a36){_0x4fde08=_0x4fde08-0x0;var _0x12e725=_0x0059[_0x4fde08];return _0x12e725;};'use strict';var Sequelize=require('sequelize');module[_0x9005('0x0')]={'name':{'type':Sequelize[_0x9005('0x1')],'unique':_0x9005('0x2'),'allowNull':![],'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize[_0x9005('0x1')]},'timeout':{'type':Sequelize[_0x9005('0x3')],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize['ENUM'](_0x9005('0x4'),'beepall',_0x9005('0x5'))}};
\ No newline at end of file
diff --git a/server/api/chatQueue/chatQueue.controller.js b/server/api/chatQueue/chatQueue.controller.js
index 09bce5a..3bc14ea 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 _0x79d7=['catch','sendStatus','status','undefined','count','offset','limit','set','json','apply','save','update','destroy','get','name','send','index','map','ChatQueue','rawAttributes','fieldName','key','model','keys','query','filters','attributes','intersection','fields','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','type','VIRTUAL','options','includeAll','include','findAll','rows','show','length','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','autoAssociation','UserProfileResource','params','describe','getMembers','findOne','ChatQueueId','UserChatQueue','User','findAndCountAll','UserId','agent','chatPause','updatedAt','createdAt','format','SIP','getTeams','Team','addTeams','ids','Agents','online','flatMap','transaction','each','forEach','emit','userChatQueue:save','removeTeams','field','tq.TeamId','from','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','ChatQueueId\x20=\x20?','ut.UserId\x20=\x20?','push','sequelize','QueryTypes','SELECT','every','TeamId','includes','all','union','compact','value','removeAgents','userChatQueue:remove','addAgents','spread','isArray','getAgents','rimraf','request-promise','moment','mustache','path','sox','to-csv','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','localhost','socket.io-emitter','./chatQueue.socket','register','request','then','info','ChatQueue,\x20%s,\x20%s','debug','ChatQueue,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result'];(function(_0x306186,_0x5db739){var _0x27c782=function(_0x9c5c16){while(--_0x9c5c16){_0x306186['push'](_0x306186['shift']());}};_0x27c782(++_0x5db739);}(_0x79d7,0x18c));var _0x779d=function(_0x4f9b18,_0x2cb5ca){_0x4f9b18=_0x4f9b18-0x0;var _0x29f20c=_0x79d7[_0x4f9b18];return _0x29f20c;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x779d('0x0'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x779d('0x1'));var moment=require(_0x779d('0x2'));var BPromise=require('bluebird');var Mustache=require(_0x779d('0x3'));var util=require('util');var path=require(_0x779d('0x4'));var sox=require(_0x779d('0x5'));var csv=require(_0x779d('0x6'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x779d('0x7'));var _=require(_0x779d('0x8'));var squel=require(_0x779d('0x9'));var crypto=require(_0x779d('0xa'));var jsforce=require(_0x779d('0xb'));var deskjs=require(_0x779d('0xc'));var toCsv=require(_0x779d('0x6'));var querystring=require(_0x779d('0xd'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x779d('0xe'));var qs=require(_0x779d('0xf'));var as=require(_0x779d('0x10'));var hardwareService=require(_0x779d('0x11'));var logger=require(_0x779d('0x12'))('api');var utils=require(_0x779d('0x13'));var config=require(_0x779d('0x14'));var licenseUtil=require(_0x779d('0x15'));var db=require(_0x779d('0x16'))['db'];config['redis']=_['defaults'](config['redis'],{'host':_0x779d('0x17'),'port':0x18eb});var socket=require(_0x779d('0x18'))(new Redis(config['redis']));require(_0x779d('0x19'))[_0x779d('0x1a')](socket);var jayson=require('jayson/promise');var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x2ed7a5,_0x3fb8df,_0x2cfe06,_0xfa4390){return new BPromise(function(_0x459fb7,_0xd7c43a){var _0x115f53=_0xfa4390||client;return _0x115f53[_0x779d('0x1b')](_0x2ed7a5,_0x2cfe06)[_0x779d('0x1c')](function(_0x167207){logger[_0x779d('0x1d')](_0x779d('0x1e'),_0x3fb8df,'request\x20sent');logger[_0x779d('0x1f')](_0x779d('0x20'),_0x3fb8df,_0x779d('0x21'),JSON[_0x779d('0x22')](_0x167207));if(_0x167207['error']){if(_0x167207[_0x779d('0x23')][_0x779d('0x24')]===0x1f4){logger['error'](_0x779d('0x1e'),_0x3fb8df,_0x167207[_0x779d('0x23')][_0x779d('0x25')]);return _0xd7c43a(_0x167207[_0x779d('0x23')]['message']);}logger[_0x779d('0x23')](_0x779d('0x1e'),_0x3fb8df,_0x167207[_0x779d('0x23')]['message']);return _0x459fb7(_0x167207[_0x779d('0x23')][_0x779d('0x25')]);}else{logger[_0x779d('0x1d')](_0x779d('0x1e'),_0x3fb8df,_0x779d('0x21'));_0x459fb7(_0x167207[_0x779d('0x26')]['message']);}})[_0x779d('0x27')](function(_0x5ca74b){logger['error'](_0x779d('0x1e'),_0x3fb8df,_0x5ca74b);_0xd7c43a(_0x5ca74b);});});}function respondWithStatusCode(_0x22d1a4,_0x3e52c0){_0x3e52c0=_0x3e52c0||0xcc;return function(_0x190236){if(_0x190236){return _0x22d1a4[_0x779d('0x28')](_0x3e52c0);}return _0x22d1a4[_0x779d('0x29')](_0x3e52c0)['end']();};}function respondWithResult(_0xaa4afb,_0xd313b){_0xd313b=_0xd313b||0xc8;return function(_0x125c7d){if(_0x125c7d){return _0xaa4afb['status'](_0xd313b)['json'](_0x125c7d);}};}function respondWithFilteredResult(_0x47e74e,_0x54843c){return function(_0x5d0b77){if(_0x5d0b77){var _0x2c51ac=typeof _0x54843c['offset']==='undefined'&&typeof _0x54843c['limit']===_0x779d('0x2a');var _0x124c37=_0x5d0b77[_0x779d('0x2b')];var _0x592c3c=_0x2c51ac?0x0:_0x54843c[_0x779d('0x2c')];var _0x19bc1c=_0x2c51ac?_0x5d0b77[_0x779d('0x2b')]:_0x54843c[_0x779d('0x2c')]+_0x54843c[_0x779d('0x2d')];var _0x49f237;if(_0x19bc1c>=_0x124c37){_0x19bc1c=_0x124c37;_0x49f237=0xc8;}else{_0x49f237=0xce;}_0x47e74e['status'](_0x49f237);return _0x47e74e[_0x779d('0x2e')]('Content-Range',_0x592c3c+'-'+_0x19bc1c+'/'+_0x124c37)[_0x779d('0x2f')](_0x5d0b77);}return null;};}function patchUpdates(_0x1973f4){return function(_0x111234){try{jsonpatch[_0x779d('0x30')](_0x111234,_0x1973f4,!![]);}catch(_0xc8e940){return BPromise['reject'](_0xc8e940);}return _0x111234[_0x779d('0x31')]();};}function saveUpdates(_0x4e950d,_0x22d3c3){return function(_0xea1106){if(_0xea1106){return _0xea1106[_0x779d('0x32')](_0x4e950d)[_0x779d('0x1c')](function(_0x4ccbe5){return _0x4ccbe5;});}return null;};}function removeEntity(_0x3bb208,_0x5f39cd){return function(_0x2335a1){if(_0x2335a1){return _0x2335a1[_0x779d('0x33')]()['then'](function(){var _0x58b4bf=_0x2335a1[_0x779d('0x34')]({'plain':!![]});var _0x32141a='ChatQueues';return db['UserProfileResource']['destroy']({'where':{'type':_0x32141a,'resourceId':_0x58b4bf['id']}})[_0x779d('0x1c')](function(){return _0x2335a1;});})[_0x779d('0x1c')](function(){_0x3bb208[_0x779d('0x29')](0xcc)['end']();});}};}function handleEntityNotFound(_0x1df56e,_0x595e6f){return function(_0xfa213d){if(!_0xfa213d){_0x1df56e[_0x779d('0x28')](0x194);}return _0xfa213d;};}function handleError(_0x1a3b16,_0x2d0004){_0x2d0004=_0x2d0004||0x1f4;return function(_0x521641){logger[_0x779d('0x23')](_0x521641['stack']);if(_0x521641['name']){delete _0x521641[_0x779d('0x35')];}_0x1a3b16[_0x779d('0x29')](_0x2d0004)[_0x779d('0x36')](_0x521641);};}exports[_0x779d('0x37')]=function(_0x729251,_0xf576aa){var _0x5e5aea={},_0x208dbd={},_0x2cbe3f={'count':0x0,'rows':[]};var _0x442e97=_[_0x779d('0x38')](db[_0x779d('0x39')][_0x779d('0x3a')],function(_0x3de56c){return{'name':_0x3de56c[_0x779d('0x3b')],'type':_0x3de56c['type'][_0x779d('0x3c')]};});_0x208dbd[_0x779d('0x3d')]=_[_0x779d('0x38')](_0x442e97,_0x779d('0x35'));_0x208dbd['query']=_[_0x779d('0x3e')](_0x729251[_0x779d('0x3f')]);_0x208dbd[_0x779d('0x40')]=_['intersection'](_0x208dbd[_0x779d('0x3d')],_0x208dbd[_0x779d('0x3f')]);_0x5e5aea[_0x779d('0x41')]=_[_0x779d('0x42')](_0x208dbd['model'],qs['fields'](_0x729251['query'][_0x779d('0x43')]));_0x5e5aea[_0x779d('0x41')]=_0x5e5aea[_0x779d('0x41')]['length']?_0x5e5aea[_0x779d('0x41')]:_0x208dbd[_0x779d('0x3d')];if(!_0x729251[_0x779d('0x3f')][_0x779d('0x44')](_0x779d('0x45'))){_0x5e5aea[_0x779d('0x2d')]=qs[_0x779d('0x2d')](_0x729251['query']['limit']);_0x5e5aea['offset']=qs[_0x779d('0x2c')](_0x729251['query']['offset']);}_0x5e5aea[_0x779d('0x46')]=qs[_0x779d('0x47')](_0x729251[_0x779d('0x3f')]['sort']);_0x5e5aea[_0x779d('0x48')]=qs['filters'](_[_0x779d('0x49')](_0x729251['query'],_0x208dbd['filters']),_0x442e97);if(_0x729251[_0x779d('0x3f')][_0x779d('0x4a')]){_0x5e5aea[_0x779d('0x48')]=_[_0x779d('0x4b')](_0x5e5aea['where'],{'$or':_[_0x779d('0x38')](_0x442e97,function(_0x39f015){if(_0x39f015[_0x779d('0x4c')]!==_0x779d('0x4d')){var _0xd0441c={};_0xd0441c[_0x39f015[_0x779d('0x35')]]={'$like':'%'+_0x729251['query']['filter']+'%'};return _0xd0441c;}})});}_0x5e5aea=_[_0x779d('0x4b')]({},_0x5e5aea,_0x729251[_0x779d('0x4e')]);var _0xf61041={'where':_0x5e5aea[_0x779d('0x48')]};return db[_0x779d('0x39')]['count'](_0xf61041)[_0x779d('0x1c')](function(_0x20ae88){_0x2cbe3f[_0x779d('0x2b')]=_0x20ae88;if(_0x729251[_0x779d('0x3f')][_0x779d('0x4f')]){_0x5e5aea[_0x779d('0x50')]=[{'all':!![]}];}return db[_0x779d('0x39')][_0x779d('0x51')](_0x5e5aea);})[_0x779d('0x1c')](function(_0x298448){_0x2cbe3f[_0x779d('0x52')]=_0x298448;return _0x2cbe3f;})[_0x779d('0x1c')](respondWithFilteredResult(_0xf576aa,_0x5e5aea))[_0x779d('0x27')](handleError(_0xf576aa,null));};exports[_0x779d('0x53')]=function(_0x4a8b71,_0x5654b4){var _0x42934f={'raw':!![],'where':{'id':_0x4a8b71['params']['id']}},_0x333f84={};_0x333f84[_0x779d('0x3d')]=_['keys'](db[_0x779d('0x39')][_0x779d('0x3a')]);_0x333f84[_0x779d('0x3f')]=_['keys'](_0x4a8b71[_0x779d('0x3f')]);_0x333f84['filters']=_['intersection'](_0x333f84[_0x779d('0x3d')],_0x333f84['query']);_0x42934f[_0x779d('0x41')]=_[_0x779d('0x42')](_0x333f84[_0x779d('0x3d')],qs['fields'](_0x4a8b71[_0x779d('0x3f')]['fields']));_0x42934f['attributes']=_0x42934f[_0x779d('0x41')][_0x779d('0x54')]?_0x42934f[_0x779d('0x41')]:_0x333f84[_0x779d('0x3d')];if(_0x4a8b71[_0x779d('0x3f')][_0x779d('0x4f')]){_0x42934f[_0x779d('0x50')]=[{'all':!![]}];}_0x42934f=_[_0x779d('0x4b')]({},_0x42934f,_0x4a8b71[_0x779d('0x4e')]);return db[_0x779d('0x39')][_0x779d('0x55')](_0x42934f)[_0x779d('0x1c')](handleEntityNotFound(_0x5654b4,null))[_0x779d('0x1c')](respondWithResult(_0x5654b4,null))[_0x779d('0x27')](handleError(_0x5654b4,null));};exports[_0x779d('0x56')]=function(_0x18eae7,_0x2bcfbe){return db[_0x779d('0x39')]['create'](_0x18eae7[_0x779d('0x57')],{})[_0x779d('0x1c')](function(_0x176ba2){var _0x189db9=_0x18eae7[_0x779d('0x58')][_0x779d('0x34')]({'plain':!![]});if(!_0x189db9)throw new Error(_0x779d('0x59'));if(_0x189db9['role']===_0x779d('0x58')){var _0x5ebb84=_0x176ba2['get']({'plain':!![]});var _0x5d1087='ChatQueues';return db[_0x779d('0x5a')]['find']({'where':{'name':_0x5d1087,'userProfileId':_0x189db9['userProfileId']},'raw':!![]})['then'](function(_0x42b8a7){if(_0x42b8a7&&_0x42b8a7[_0x779d('0x5b')]===0x0){return db[_0x779d('0x5c')][_0x779d('0x56')]({'name':_0x5ebb84[_0x779d('0x35')],'resourceId':_0x5ebb84['id'],'type':_0x42b8a7['name'],'sectionId':_0x42b8a7['id']},{})[_0x779d('0x1c')](function(){return _0x176ba2;});}else{return _0x176ba2;}})[_0x779d('0x27')](function(_0x2c8976){logger['error']('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x2c8976);throw _0x2c8976;});}return _0x176ba2;})[_0x779d('0x1c')](respondWithResult(_0x2bcfbe,0xc9))[_0x779d('0x27')](handleError(_0x2bcfbe,null));};exports[_0x779d('0x32')]=function(_0x3919eb,_0x287bdd){if(_0x3919eb[_0x779d('0x57')]['id']){delete _0x3919eb[_0x779d('0x57')]['id'];}return db[_0x779d('0x39')]['find']({'where':{'id':_0x3919eb[_0x779d('0x5d')]['id']}})[_0x779d('0x1c')](handleEntityNotFound(_0x287bdd,null))['then'](saveUpdates(_0x3919eb[_0x779d('0x57')],null))[_0x779d('0x1c')](respondWithResult(_0x287bdd,null))[_0x779d('0x27')](handleError(_0x287bdd,null));};exports['destroy']=function(_0x62ecfb,_0x1aaa08){return db[_0x779d('0x39')][_0x779d('0x55')]({'where':{'id':_0x62ecfb['params']['id']}})['then'](handleEntityNotFound(_0x1aaa08,null))['then'](removeEntity(_0x1aaa08,null))['catch'](handleError(_0x1aaa08,null));};exports[_0x779d('0x5e')]=function(_0x49bccc,_0x4f232b){return db[_0x779d('0x39')]['describe']()[_0x779d('0x1c')](respondWithResult(_0x4f232b,null))['catch'](handleError(_0x4f232b,null));};exports[_0x779d('0x5f')]=function(_0xc09cbd,_0xf18e27,_0x2031f9){var _0x598058={'raw':!![],'where':{}},_0x42d6d1={},_0x579a39;return db['ChatQueue'][_0x779d('0x60')]({'where':{'id':_0xc09cbd[_0x779d('0x5d')]['id']}})[_0x779d('0x1c')](handleEntityNotFound(_0xf18e27,null))['then'](function(_0x2970aa){if(_0x2970aa){_0x579a39=_0x2970aa[_0x779d('0x34')]({'plain':!![]});_0x42d6d1['model']=_[_0x779d('0x3e')](db['UserChatQueue']['rawAttributes']);_0x42d6d1['query']=_[_0x779d('0x3e')](_0xc09cbd[_0x779d('0x3f')]);_0x42d6d1[_0x779d('0x40')]=_[_0x779d('0x42')](_0x42d6d1['model'],_0x42d6d1[_0x779d('0x3f')]);_0x598058[_0x779d('0x41')]=_[_0x779d('0x42')](_0x42d6d1['model'],qs['fields'](_0xc09cbd['query'][_0x779d('0x43')]));_0x598058[_0x779d('0x41')]=_0x598058[_0x779d('0x41')][_0x779d('0x54')]?_0x598058[_0x779d('0x41')]:_0x42d6d1[_0x779d('0x3d')];if(!_0xc09cbd[_0x779d('0x3f')][_0x779d('0x44')](_0x779d('0x45'))){_0x598058['limit']=qs[_0x779d('0x2d')](_0xc09cbd[_0x779d('0x3f')]['limit']);_0x598058['offset']=qs[_0x779d('0x2c')](_0xc09cbd[_0x779d('0x3f')][_0x779d('0x2c')]);}_0x598058[_0x779d('0x46')]=qs['sort'](_0xc09cbd[_0x779d('0x3f')][_0x779d('0x47')]);_0x598058['where']=qs[_0x779d('0x40')](_[_0x779d('0x49')](_0xc09cbd[_0x779d('0x3f')],_0x42d6d1[_0x779d('0x40')]));_0x598058['where'][_0x779d('0x61')]=_0x2970aa['id'];if(_0xc09cbd[_0x779d('0x3f')][_0x779d('0x4a')]){_0x598058['where']=_['merge'](_0x598058[_0x779d('0x48')],{'$or':_['map'](_0x598058['attributes'],function(_0x5569ed){var _0x25a597={};_0x25a597[_0x5569ed]={'$like':'%'+_0xc09cbd[_0x779d('0x3f')]['filter']+'%'};return _0x25a597;})});}_0x598058=_[_0x779d('0x4b')]({},_0x598058,_0xc09cbd['options']);return db[_0x779d('0x62')][_0x779d('0x51')](_0x598058);}})[_0x779d('0x1c')](function(_0x2fe516){if(_0x2fe516){return db[_0x779d('0x63')][_0x779d('0x64')]({'where':{'id':_['map'](_0x2fe516,_0x779d('0x65')),'role':_0x779d('0x66')},'attributes':['id','name',_0x779d('0x67'),_0x779d('0x68'),_0x779d('0x69')]});}})[_0x779d('0x1c')](function(_0xde3c95){if(_0xde3c95){return{'count':_0xde3c95[_0x779d('0x2b')],'rows':_[_0x779d('0x38')](_0xde3c95['rows'],function(_0x2b89be){return{'membername':_0x2b89be[_0x779d('0x35')],'UserId':_0x2b89be['id'],'queue_name':_0x579a39['name'],'ChatQueueId':_0x579a39['id'],'interface':util[_0x779d('0x6a')]('%s/%s',_0x779d('0x6b'),_0x2b89be[_0x779d('0x35')]),'penalty':0x0,'paused':_0x2b89be[_0x779d('0x67')],'createdAt':_0x2b89be['createdAt'],'updatedAt':_0x2b89be[_0x779d('0x68')]};})};}else{return{'count':0x0,'rows':[]};}})[_0x779d('0x1c')](respondWithFilteredResult(_0xf18e27,_0x598058))[_0x779d('0x27')](handleError(_0xf18e27,null));};exports[_0x779d('0x6c')]=function(_0x3f5f64,_0x20c201,_0x370cf8){var _0x300974={};var _0x2e92ed={};var _0x45e96f;var _0x1c0a58;return db['ChatQueue']['findOne']({'where':{'id':_0x3f5f64[_0x779d('0x5d')]['id']}})[_0x779d('0x1c')](handleEntityNotFound(_0x20c201,null))[_0x779d('0x1c')](function(_0x462999){if(_0x462999){_0x45e96f=_0x462999;_0x2e92ed[_0x779d('0x3d')]=_[_0x779d('0x3e')](db[_0x779d('0x6d')][_0x779d('0x3a')]);_0x2e92ed[_0x779d('0x3f')]=_[_0x779d('0x3e')](_0x3f5f64[_0x779d('0x3f')]);_0x2e92ed[_0x779d('0x40')]=_[_0x779d('0x42')](_0x2e92ed[_0x779d('0x3d')],_0x2e92ed['query']);_0x300974[_0x779d('0x41')]=_[_0x779d('0x42')](_0x2e92ed[_0x779d('0x3d')],qs[_0x779d('0x43')](_0x3f5f64[_0x779d('0x3f')][_0x779d('0x43')]));_0x300974[_0x779d('0x41')]=_0x300974[_0x779d('0x41')]['length']?_0x300974['attributes']:_0x2e92ed[_0x779d('0x3d')];_0x300974['order']=qs[_0x779d('0x47')](_0x3f5f64[_0x779d('0x3f')][_0x779d('0x47')]);_0x300974[_0x779d('0x48')]=qs[_0x779d('0x40')](_[_0x779d('0x49')](_0x3f5f64[_0x779d('0x3f')],_0x2e92ed[_0x779d('0x40')]));if(_0x3f5f64[_0x779d('0x3f')][_0x779d('0x4a')]){_0x300974[_0x779d('0x48')]=_[_0x779d('0x4b')](_0x300974[_0x779d('0x48')],{'$or':_[_0x779d('0x38')](_0x300974[_0x779d('0x41')],function(_0x1f498a){var _0x378eea={};_0x378eea[_0x1f498a]={'$like':'%'+_0x3f5f64[_0x779d('0x3f')][_0x779d('0x4a')]+'%'};return _0x378eea;})});}_0x300974=_[_0x779d('0x4b')]({},_0x300974,_0x3f5f64[_0x779d('0x4e')]);return _0x45e96f[_0x779d('0x6c')](_0x300974);}})[_0x779d('0x1c')](function(_0x4aac4c){if(_0x4aac4c){_0x1c0a58=_0x4aac4c[_0x779d('0x54')];if(!_0x3f5f64[_0x779d('0x3f')][_0x779d('0x44')]('nolimit')){_0x300974[_0x779d('0x2d')]=qs[_0x779d('0x2d')](_0x3f5f64[_0x779d('0x3f')][_0x779d('0x2d')]);_0x300974[_0x779d('0x2c')]=qs['offset'](_0x3f5f64[_0x779d('0x3f')][_0x779d('0x2c')]);}return _0x45e96f[_0x779d('0x6c')](_0x300974);}})[_0x779d('0x1c')](function(_0x448717){if(_0x448717){return _0x448717?{'count':_0x1c0a58,'rows':_0x448717}:null;}})['then'](respondWithResult(_0x20c201,null))[_0x779d('0x27')](handleError(_0x20c201,null));};exports[_0x779d('0x6e')]=function(_0x56021c,_0x1ba2b7,_0x182322){var _0x3b5199=_0x56021c['body'][_0x779d('0x6f')];return db[_0x779d('0x6d')][_0x779d('0x51')]({'where':{'id':_0x3b5199},'attributes':['id'],'include':[{'model':db[_0x779d('0x63')],'as':_0x779d('0x70'),'attributes':['id',_0x779d('0x35'),_0x779d('0x71'),'voicePause','interface'],'raw':!![]}]})['then'](function(_0x412da7){if(_0x412da7){var _0x5143ab=_[_0x779d('0x72')](_0x412da7,function(_0x12bc63){var _0x5a2fe2=_0x12bc63[_0x779d('0x34')]({'plain':!![]});return _0x5a2fe2[_0x779d('0x70')];});return db[_0x779d('0x39')]['find']({'where':{'id':_0x56021c[_0x779d('0x5d')]['id']}})[_0x779d('0x1c')](function(_0x52ced5){return db['sequelize'][_0x779d('0x73')](function(_0x306783){return _0x52ced5[_0x779d('0x6e')](_0x3b5199,{'transaction':_0x306783})[_0x779d('0x1c')](function(){return BPromise[_0x779d('0x74')](_0x5143ab,function(_0x1cbe45){return db[_0x779d('0x62')]['findOrCreate']({'where':{'UserId':_0x1cbe45['id'],'ChatQueueId':_0x56021c[_0x779d('0x5d')]['id']},'transaction':_0x306783});});})[_0x779d('0x1c')](function(){_0x5143ab[_0x779d('0x75')](function(_0x7ead9d){socket[_0x779d('0x76')](_0x779d('0x77'),{'UserId':_0x7ead9d['id'],'ChatQueueId':_0x52ced5['id']});});});});});}})[_0x779d('0x1c')](respondWithStatusCode(_0x1ba2b7,null))[_0x779d('0x27')](handleError(_0x1ba2b7,null));};exports[_0x779d('0x78')]=function(_0x24bfd6,_0x206dd8,_0x27282b){return db[_0x779d('0x6d')]['findAll']({'where':{'id':_0x24bfd6[_0x779d('0x3f')]['ids']},'attributes':['id'],'include':[{'model':db['User'],'as':_0x779d('0x70'),'attributes':['id'],'raw':!![]}]})[_0x779d('0x1c')](handleEntityNotFound(_0x206dd8,null))[_0x779d('0x1c')](function(_0x185c98){var _0x2e7fc1=_[_0x779d('0x38')](_0x185c98,'id');var _0x5f105a=[];var _0x115d1a=[];var _0x123a84=squel['select']();_0x123a84[_0x779d('0x79')](_0x779d('0x7a'))[_0x779d('0x7b')]('team_has_chat_queues','tq')['join'](_0x779d('0x7c'),'ut',_0x779d('0x7d'))['where'](_0x779d('0x7e'),_0x24bfd6['params']['id']);for(var _0x3a4e27=0x0;_0x3a4e27<_0x185c98['length'];_0x3a4e27+=0x1){let _0x3dfb63=_0x185c98[_0x3a4e27];for(var _0x55c2f1=0x0;_0x55c2f1<_0x3dfb63[_0x779d('0x70')][_0x779d('0x54')];_0x55c2f1+=0x1){let _0x264669=_0x3dfb63[_0x779d('0x70')][_0x55c2f1];var _0x52ba76=_0x123a84['clone']();_0x52ba76[_0x779d('0x48')](_0x779d('0x7f'),_0x264669['id']);_0x115d1a[_0x779d('0x80')](db[_0x779d('0x81')][_0x779d('0x3f')](_0x52ba76['toString'](),{'type':db[_0x779d('0x81')][_0x779d('0x82')][_0x779d('0x83')]})['then'](function(_0x35d201){if(_0x35d201[_0x779d('0x54')]===0x1){return _0x264669['id'];}else{var _0x214e7a=_[_0x779d('0x84')](_['map'](_0x35d201,_0x779d('0x85')),function(_0x117835){return _[_0x779d('0x86')](_0x2e7fc1,_0x117835);});if(_0x214e7a){return _0x264669['id'];}}}));}}return BPromise[_0x779d('0x87')](_0x115d1a)['then'](function(_0x77f3f){_0x5f105a=_(_0x5f105a)[_0x779d('0x88')](_0x77f3f)[_0x779d('0x89')]()[_0x779d('0x8a')]();return db['ChatQueue'][_0x779d('0x55')]({'where':{'id':_0x24bfd6['params']['id']}})[_0x779d('0x1c')](function(_0x380ad2){return db[_0x779d('0x81')][_0x779d('0x73')](function(_0x19b645){return _0x380ad2[_0x779d('0x78')](_0x24bfd6[_0x779d('0x3f')]['ids'],{'transaction':_0x19b645})['then'](function(){if(!_['isEmpty'](_0x5f105a)){return _0x380ad2[_0x779d('0x8b')](_0x5f105a,{'transaction':_0x19b645});}})[_0x779d('0x1c')](function(){_0x5f105a['forEach'](function(_0x4e2fab){socket['emit'](_0x779d('0x8c'),{'UserId':_0x4e2fab,'ChatQueueId':_0x380ad2['id']});});});});});});})[_0x779d('0x1c')](respondWithStatusCode(_0x206dd8,null))[_0x779d('0x27')](handleError(_0x206dd8,null));};exports[_0x779d('0x8d')]=function(_0x271cfb,_0x2aca7e,_0x15fb1d){return db[_0x779d('0x39')][_0x779d('0x55')]({'where':{'id':_0x271cfb[_0x779d('0x5d')]['id']}})[_0x779d('0x1c')](handleEntityNotFound(_0x2aca7e,null))[_0x779d('0x1c')](function(_0x519a62){if(_0x519a62){return _0x519a62['addAgents'](_0x271cfb[_0x779d('0x57')][_0x779d('0x6f')],_['omit'](_0x271cfb[_0x779d('0x57')],['ids','id'])||{})[_0x779d('0x8e')](function(_0x243db1){for(var _0x3fb08b=0x0;_0x3fb08b<_0x271cfb[_0x779d('0x57')][_0x779d('0x6f')][_0x779d('0x54')];_0x3fb08b+=0x1){socket['emit']('userChatQueue:save',{'UserId':Number(_0x271cfb[_0x779d('0x57')][_0x779d('0x6f')][_0x3fb08b]),'ChatQueueId':Number(_0x271cfb['params']['id'])});}return _0x243db1;});}})[_0x779d('0x1c')](respondWithResult(_0x2aca7e,null))[_0x779d('0x27')](handleError(_0x2aca7e,null));};exports['removeAgents']=function(_0x437535,_0x5adba8,_0x28ee49){return db[_0x779d('0x39')]['find']({'where':{'id':_0x437535[_0x779d('0x5d')]['id']}})[_0x779d('0x1c')](handleEntityNotFound(_0x5adba8,null))[_0x779d('0x1c')](function(_0x2c60dc){if(_0x2c60dc){return _0x2c60dc[_0x779d('0x8b')](_0x437535[_0x779d('0x3f')][_0x779d('0x6f')])[_0x779d('0x1c')](function(){if(_[_0x779d('0x8f')](_0x437535[_0x779d('0x3f')]['ids'])){for(var _0x1cdacb=0x0;_0x1cdacb<_0x437535[_0x779d('0x3f')][_0x779d('0x6f')][_0x779d('0x54')];_0x1cdacb+=0x1){socket[_0x779d('0x76')](_0x779d('0x8c'),{'UserId':Number(_0x437535[_0x779d('0x3f')][_0x779d('0x6f')][_0x1cdacb]),'ChatQueueId':Number(_0x437535[_0x779d('0x5d')]['id'])});}}else{socket[_0x779d('0x76')]('userChatQueue:remove',{'UserId':Number(_0x437535[_0x779d('0x3f')][_0x779d('0x6f')]),'ChatQueueId':Number(_0x437535[_0x779d('0x5d')]['id'])});}});}})[_0x779d('0x1c')](respondWithStatusCode(_0x5adba8,null))['catch'](handleError(_0x5adba8,null));};exports['getAgents']=function(_0x27484f,_0x49948d,_0x5ccf89){var _0x2d364e={};var _0x34daf3={};var _0x5a992a;var _0x57eecc;return db[_0x779d('0x39')][_0x779d('0x60')]({'where':{'id':_0x27484f[_0x779d('0x5d')]['id']}})[_0x779d('0x1c')](handleEntityNotFound(_0x49948d,null))[_0x779d('0x1c')](function(_0xdd9b3a){if(_0xdd9b3a){_0x5a992a=_0xdd9b3a;_0x34daf3[_0x779d('0x3d')]=_['keys'](db[_0x779d('0x63')][_0x779d('0x3a')]);_0x34daf3[_0x779d('0x3f')]=_[_0x779d('0x3e')](_0x27484f[_0x779d('0x3f')]);_0x34daf3['filters']=_[_0x779d('0x42')](_0x34daf3[_0x779d('0x3d')],_0x34daf3['query']);_0x2d364e[_0x779d('0x41')]=_[_0x779d('0x42')](_0x34daf3['model'],qs[_0x779d('0x43')](_0x27484f[_0x779d('0x3f')]['fields']));_0x2d364e[_0x779d('0x41')]=_0x2d364e[_0x779d('0x41')]['length']?_0x2d364e[_0x779d('0x41')]:_0x34daf3[_0x779d('0x3d')];_0x2d364e[_0x779d('0x46')]=qs['sort'](_0x27484f[_0x779d('0x3f')][_0x779d('0x47')]);_0x2d364e[_0x779d('0x48')]=qs[_0x779d('0x40')](_[_0x779d('0x49')](_0x27484f[_0x779d('0x3f')],_0x34daf3[_0x779d('0x40')]));if(_0x27484f['query'][_0x779d('0x4a')]){_0x2d364e['where']=_['merge'](_0x2d364e['where'],{'$or':_[_0x779d('0x38')](_0x2d364e[_0x779d('0x41')],function(_0x1d900e){var _0x3f4716={};_0x3f4716[_0x1d900e]={'$like':'%'+_0x27484f[_0x779d('0x3f')][_0x779d('0x4a')]+'%'};return _0x3f4716;})});}_0x2d364e=_['merge']({},_0x2d364e,_0x27484f['options']);return _0x5a992a[_0x779d('0x90')](_0x2d364e);}})[_0x779d('0x1c')](function(_0xeee092){if(_0xeee092){_0x57eecc=_0xeee092[_0x779d('0x54')];if(!_0x27484f[_0x779d('0x3f')][_0x779d('0x44')](_0x779d('0x45'))){_0x2d364e[_0x779d('0x2d')]=qs[_0x779d('0x2d')](_0x27484f[_0x779d('0x3f')]['limit']);_0x2d364e[_0x779d('0x2c')]=qs['offset'](_0x27484f[_0x779d('0x3f')]['offset']);}return _0x5a992a[_0x779d('0x90')](_0x2d364e);}})['then'](function(_0x21cadf){if(_0x21cadf){return _0x21cadf?{'count':_0x57eecc,'rows':_0x21cadf}:null;}})[_0x779d('0x1c')](respondWithResult(_0x49948d,null))[_0x779d('0x27')](handleError(_0x49948d,null));};
\ No newline at end of file
+var _0x4cc4=['voicePause','sequelize','transaction','findOrCreate','forEach','userChatQueue:save','select','tq.TeamId','join','user_has_teams','ut.UserId\x20=\x20?','push','QueryTypes','SELECT','TeamId','union','compact','value','removeTeams','removeAgents','emit','userChatQueue:remove','addAgents','omit','isArray','getAgents','eml-format','rimraf','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','crypto','jsforce','desk.js','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','localhost','socket.io-emitter','./chatQueue.socket','register','client','http','request','info','ChatQueue,\x20%s,\x20%s','request\x20sent','ChatQueue,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','sendStatus','status','undefined','limit','count','offset','set','Content-Range','json','reject','save','update','then','get','destroy','end','stack','name','send','map','fieldName','key','keys','query','filters','intersection','model','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','type','options','ChatQueue','include','findAll','rows','show','params','rawAttributes','includeAll','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','ChatQueues','UserProfileSection','find','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','describe','ChatQueueId','UserChatQueue','User','UserId','chatPause','updatedAt','createdAt','format','%s/%s','SIP','getTeams','findOne','Team','addTeams','ids','Agents','online'];(function(_0x123155,_0x27038d){var _0x9cb7d2=function(_0x51dd82){while(--_0x51dd82){_0x123155['push'](_0x123155['shift']());}};_0x9cb7d2(++_0x27038d);}(_0x4cc4,0x1d0));var _0x44cc=function(_0x21ac1a,_0x558076){_0x21ac1a=_0x21ac1a-0x0;var _0x131fb3=_0x4cc4[_0x21ac1a];return _0x131fb3;};'use strict';var emlformat=require(_0x44cc('0x0'));var rimraf=require(_0x44cc('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x44cc('0x2'));var moment=require(_0x44cc('0x3'));var BPromise=require(_0x44cc('0x4'));var Mustache=require(_0x44cc('0x5'));var util=require(_0x44cc('0x6'));var path=require(_0x44cc('0x7'));var sox=require(_0x44cc('0x8'));var csv=require(_0x44cc('0x9'));var ejs=require(_0x44cc('0xa'));var fs=require('fs');var fs_extra=require(_0x44cc('0xb'));var _=require(_0x44cc('0xc'));var squel=require('squel');var crypto=require(_0x44cc('0xd'));var jsforce=require(_0x44cc('0xe'));var deskjs=require(_0x44cc('0xf'));var toCsv=require(_0x44cc('0x9'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x44cc('0x10'));var authService=require(_0x44cc('0x11'));var qs=require(_0x44cc('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x44cc('0x13'));var logger=require(_0x44cc('0x14'))(_0x44cc('0x15'));var utils=require(_0x44cc('0x16'));var config=require(_0x44cc('0x17'));var licenseUtil=require(_0x44cc('0x18'));var db=require(_0x44cc('0x19'))['db'];config[_0x44cc('0x1a')]=_['defaults'](config[_0x44cc('0x1a')],{'host':_0x44cc('0x1b'),'port':0x18eb});var socket=require(_0x44cc('0x1c'))(new Redis(config[_0x44cc('0x1a')]));require(_0x44cc('0x1d'))[_0x44cc('0x1e')](socket);var jayson=require('jayson/promise');var client=jayson[_0x44cc('0x1f')][_0x44cc('0x20')]({'port':0x232a});function respondWithRpcPromise(_0x2932d3,_0x51e82c,_0x11cb24,_0x2e1c66){return new BPromise(function(_0x40cf8a,_0x23e388){var _0x16e09c=_0x2e1c66||client;return _0x16e09c[_0x44cc('0x21')](_0x2932d3,_0x11cb24)['then'](function(_0x575346){logger[_0x44cc('0x22')](_0x44cc('0x23'),_0x51e82c,_0x44cc('0x24'));logger['debug'](_0x44cc('0x25'),_0x51e82c,_0x44cc('0x24'),JSON['stringify'](_0x575346));if(_0x575346[_0x44cc('0x26')]){if(_0x575346['error'][_0x44cc('0x27')]===0x1f4){logger['error'](_0x44cc('0x23'),_0x51e82c,_0x575346[_0x44cc('0x26')][_0x44cc('0x28')]);return _0x23e388(_0x575346['error'][_0x44cc('0x28')]);}logger[_0x44cc('0x26')](_0x44cc('0x23'),_0x51e82c,_0x575346['error'][_0x44cc('0x28')]);return _0x40cf8a(_0x575346['error'][_0x44cc('0x28')]);}else{logger['info'](_0x44cc('0x23'),_0x51e82c,'request\x20sent');_0x40cf8a(_0x575346[_0x44cc('0x29')][_0x44cc('0x28')]);}})[_0x44cc('0x2a')](function(_0x1d9176){logger[_0x44cc('0x26')](_0x44cc('0x23'),_0x51e82c,_0x1d9176);_0x23e388(_0x1d9176);});});}function respondWithStatusCode(_0x3cc8f6,_0x404f4d){_0x404f4d=_0x404f4d||0xcc;return function(_0xff2d5e){if(_0xff2d5e){return _0x3cc8f6[_0x44cc('0x2b')](_0x404f4d);}return _0x3cc8f6[_0x44cc('0x2c')](_0x404f4d)['end']();};}function respondWithResult(_0x2caaba,_0x5f4311){_0x5f4311=_0x5f4311||0xc8;return function(_0x227a93){if(_0x227a93){return _0x2caaba[_0x44cc('0x2c')](_0x5f4311)['json'](_0x227a93);}};}function respondWithFilteredResult(_0x5041b7,_0x1053e7){return function(_0x3f9d56){if(_0x3f9d56){var _0xd4d3e2=typeof _0x1053e7['offset']===_0x44cc('0x2d')&&typeof _0x1053e7[_0x44cc('0x2e')]===_0x44cc('0x2d');var _0x2e45c4=_0x3f9d56[_0x44cc('0x2f')];var _0x362ab1=_0xd4d3e2?0x0:_0x1053e7['offset'];var _0x1a35da=_0xd4d3e2?_0x3f9d56[_0x44cc('0x2f')]:_0x1053e7[_0x44cc('0x30')]+_0x1053e7[_0x44cc('0x2e')];var _0x45fdc3;if(_0x1a35da>=_0x2e45c4){_0x1a35da=_0x2e45c4;_0x45fdc3=0xc8;}else{_0x45fdc3=0xce;}_0x5041b7['status'](_0x45fdc3);return _0x5041b7[_0x44cc('0x31')](_0x44cc('0x32'),_0x362ab1+'-'+_0x1a35da+'/'+_0x2e45c4)[_0x44cc('0x33')](_0x3f9d56);}return null;};}function patchUpdates(_0x4a4c6a){return function(_0x1d459e){try{jsonpatch['apply'](_0x1d459e,_0x4a4c6a,!![]);}catch(_0x338a1a){return BPromise[_0x44cc('0x34')](_0x338a1a);}return _0x1d459e[_0x44cc('0x35')]();};}function saveUpdates(_0x3084b0,_0x350057){return function(_0x4d196b){if(_0x4d196b){return _0x4d196b[_0x44cc('0x36')](_0x3084b0)[_0x44cc('0x37')](function(_0x22ff66){return _0x22ff66;});}return null;};}function removeEntity(_0xae6de5,_0xc79919){return function(_0x2007bb){if(_0x2007bb){return _0x2007bb['destroy']()[_0x44cc('0x37')](function(){var _0x51926e=_0x2007bb[_0x44cc('0x38')]({'plain':!![]});var _0x3c5496='ChatQueues';return db['UserProfileResource'][_0x44cc('0x39')]({'where':{'type':_0x3c5496,'resourceId':_0x51926e['id']}})[_0x44cc('0x37')](function(){return _0x2007bb;});})['then'](function(){_0xae6de5['status'](0xcc)[_0x44cc('0x3a')]();});}};}function handleEntityNotFound(_0x317d76,_0x4841ce){return function(_0x26a04b){if(!_0x26a04b){_0x317d76[_0x44cc('0x2b')](0x194);}return _0x26a04b;};}function handleError(_0x4bda34,_0x534a00){_0x534a00=_0x534a00||0x1f4;return function(_0x4ed7ca){logger['error'](_0x4ed7ca[_0x44cc('0x3b')]);if(_0x4ed7ca[_0x44cc('0x3c')]){delete _0x4ed7ca[_0x44cc('0x3c')];}_0x4bda34[_0x44cc('0x2c')](_0x534a00)[_0x44cc('0x3d')](_0x4ed7ca);};}exports['index']=function(_0x4a742f,_0x2a78c7){var _0x45bff3={},_0x3c56ef={},_0x50dc6c={'count':0x0,'rows':[]};var _0x110d13=_[_0x44cc('0x3e')](db['ChatQueue']['rawAttributes'],function(_0x2e21b9){return{'name':_0x2e21b9[_0x44cc('0x3f')],'type':_0x2e21b9['type'][_0x44cc('0x40')]};});_0x3c56ef['model']=_[_0x44cc('0x3e')](_0x110d13,_0x44cc('0x3c'));_0x3c56ef['query']=_[_0x44cc('0x41')](_0x4a742f[_0x44cc('0x42')]);_0x3c56ef[_0x44cc('0x43')]=_[_0x44cc('0x44')](_0x3c56ef[_0x44cc('0x45')],_0x3c56ef['query']);_0x45bff3['attributes']=_[_0x44cc('0x44')](_0x3c56ef[_0x44cc('0x45')],qs[_0x44cc('0x46')](_0x4a742f['query']['fields']));_0x45bff3[_0x44cc('0x47')]=_0x45bff3[_0x44cc('0x47')][_0x44cc('0x48')]?_0x45bff3[_0x44cc('0x47')]:_0x3c56ef['model'];if(!_0x4a742f[_0x44cc('0x42')][_0x44cc('0x49')](_0x44cc('0x4a'))){_0x45bff3[_0x44cc('0x2e')]=qs['limit'](_0x4a742f[_0x44cc('0x42')]['limit']);_0x45bff3[_0x44cc('0x30')]=qs[_0x44cc('0x30')](_0x4a742f[_0x44cc('0x42')]['offset']);}_0x45bff3[_0x44cc('0x4b')]=qs[_0x44cc('0x4c')](_0x4a742f[_0x44cc('0x42')][_0x44cc('0x4c')]);_0x45bff3[_0x44cc('0x4d')]=qs[_0x44cc('0x43')](_[_0x44cc('0x4e')](_0x4a742f[_0x44cc('0x42')],_0x3c56ef[_0x44cc('0x43')]),_0x110d13);if(_0x4a742f['query'][_0x44cc('0x4f')]){_0x45bff3['where']=_[_0x44cc('0x50')](_0x45bff3[_0x44cc('0x4d')],{'$or':_[_0x44cc('0x3e')](_0x110d13,function(_0x499968){if(_0x499968[_0x44cc('0x51')]!=='VIRTUAL'){var _0x415bba={};_0x415bba[_0x499968[_0x44cc('0x3c')]]={'$like':'%'+_0x4a742f[_0x44cc('0x42')]['filter']+'%'};return _0x415bba;}})});}_0x45bff3=_[_0x44cc('0x50')]({},_0x45bff3,_0x4a742f[_0x44cc('0x52')]);var _0x37cccf={'where':_0x45bff3[_0x44cc('0x4d')]};return db[_0x44cc('0x53')][_0x44cc('0x2f')](_0x37cccf)['then'](function(_0x45ce87){_0x50dc6c['count']=_0x45ce87;if(_0x4a742f[_0x44cc('0x42')]['includeAll']){_0x45bff3[_0x44cc('0x54')]=[{'all':!![]}];}return db[_0x44cc('0x53')][_0x44cc('0x55')](_0x45bff3);})[_0x44cc('0x37')](function(_0x5070c6){_0x50dc6c[_0x44cc('0x56')]=_0x5070c6;return _0x50dc6c;})['then'](respondWithFilteredResult(_0x2a78c7,_0x45bff3))['catch'](handleError(_0x2a78c7,null));};exports[_0x44cc('0x57')]=function(_0xd840b2,_0x634450){var _0xf71c3b={'raw':!![],'where':{'id':_0xd840b2[_0x44cc('0x58')]['id']}},_0x250c15={};_0x250c15['model']=_[_0x44cc('0x41')](db[_0x44cc('0x53')][_0x44cc('0x59')]);_0x250c15[_0x44cc('0x42')]=_[_0x44cc('0x41')](_0xd840b2['query']);_0x250c15[_0x44cc('0x43')]=_[_0x44cc('0x44')](_0x250c15[_0x44cc('0x45')],_0x250c15[_0x44cc('0x42')]);_0xf71c3b[_0x44cc('0x47')]=_['intersection'](_0x250c15[_0x44cc('0x45')],qs[_0x44cc('0x46')](_0xd840b2['query'][_0x44cc('0x46')]));_0xf71c3b['attributes']=_0xf71c3b[_0x44cc('0x47')][_0x44cc('0x48')]?_0xf71c3b[_0x44cc('0x47')]:_0x250c15[_0x44cc('0x45')];if(_0xd840b2['query'][_0x44cc('0x5a')]){_0xf71c3b['include']=[{'all':!![]}];}_0xf71c3b=_[_0x44cc('0x50')]({},_0xf71c3b,_0xd840b2[_0x44cc('0x52')]);return db[_0x44cc('0x53')]['find'](_0xf71c3b)[_0x44cc('0x37')](handleEntityNotFound(_0x634450,null))[_0x44cc('0x37')](respondWithResult(_0x634450,null))[_0x44cc('0x2a')](handleError(_0x634450,null));};exports['create']=function(_0x20bd6e,_0x3d6c86){return db[_0x44cc('0x53')][_0x44cc('0x5b')](_0x20bd6e[_0x44cc('0x5c')],{})[_0x44cc('0x37')](function(_0x4d8466){var _0x1b9ad9=_0x20bd6e['user'][_0x44cc('0x38')]({'plain':!![]});if(!_0x1b9ad9)throw new Error(_0x44cc('0x5d'));if(_0x1b9ad9[_0x44cc('0x5e')]===_0x44cc('0x5f')){var _0x20d7d4=_0x4d8466['get']({'plain':!![]});var _0x10df60=_0x44cc('0x60');return db[_0x44cc('0x61')][_0x44cc('0x62')]({'where':{'name':_0x10df60,'userProfileId':_0x1b9ad9['userProfileId']},'raw':!![]})[_0x44cc('0x37')](function(_0x12e9f9){if(_0x12e9f9&&_0x12e9f9[_0x44cc('0x63')]===0x0){return db[_0x44cc('0x64')]['create']({'name':_0x20d7d4[_0x44cc('0x3c')],'resourceId':_0x20d7d4['id'],'type':_0x12e9f9['name'],'sectionId':_0x12e9f9['id']},{})['then'](function(){return _0x4d8466;});}else{return _0x4d8466;}})['catch'](function(_0x247d7c){logger[_0x44cc('0x26')](_0x44cc('0x65'),_0x247d7c);throw _0x247d7c;});}return _0x4d8466;})['then'](respondWithResult(_0x3d6c86,0xc9))[_0x44cc('0x2a')](handleError(_0x3d6c86,null));};exports[_0x44cc('0x36')]=function(_0x208351,_0x24761b){if(_0x208351['body']['id']){delete _0x208351[_0x44cc('0x5c')]['id'];}return db[_0x44cc('0x53')]['find']({'where':{'id':_0x208351['params']['id']}})[_0x44cc('0x37')](handleEntityNotFound(_0x24761b,null))[_0x44cc('0x37')](saveUpdates(_0x208351[_0x44cc('0x5c')],null))['then'](respondWithResult(_0x24761b,null))[_0x44cc('0x2a')](handleError(_0x24761b,null));};exports[_0x44cc('0x39')]=function(_0x5e9f13,_0x18111d){return db[_0x44cc('0x53')]['find']({'where':{'id':_0x5e9f13[_0x44cc('0x58')]['id']}})[_0x44cc('0x37')](handleEntityNotFound(_0x18111d,null))['then'](removeEntity(_0x18111d,null))[_0x44cc('0x2a')](handleError(_0x18111d,null));};exports[_0x44cc('0x66')]=function(_0x424731,_0x349373){return db[_0x44cc('0x53')][_0x44cc('0x66')]()[_0x44cc('0x37')](respondWithResult(_0x349373,null))[_0x44cc('0x2a')](handleError(_0x349373,null));};exports['getMembers']=function(_0x1f880e,_0x2da817,_0x127887){var _0x184e96={'raw':!![],'where':{}},_0x1afd80={},_0x484553;return db[_0x44cc('0x53')]['findOne']({'where':{'id':_0x1f880e[_0x44cc('0x58')]['id']}})[_0x44cc('0x37')](handleEntityNotFound(_0x2da817,null))[_0x44cc('0x37')](function(_0x2f9873){if(_0x2f9873){_0x484553=_0x2f9873['get']({'plain':!![]});_0x1afd80[_0x44cc('0x45')]=_[_0x44cc('0x41')](db['UserChatQueue'][_0x44cc('0x59')]);_0x1afd80[_0x44cc('0x42')]=_[_0x44cc('0x41')](_0x1f880e['query']);_0x1afd80[_0x44cc('0x43')]=_[_0x44cc('0x44')](_0x1afd80[_0x44cc('0x45')],_0x1afd80[_0x44cc('0x42')]);_0x184e96['attributes']=_[_0x44cc('0x44')](_0x1afd80['model'],qs[_0x44cc('0x46')](_0x1f880e[_0x44cc('0x42')][_0x44cc('0x46')]));_0x184e96[_0x44cc('0x47')]=_0x184e96[_0x44cc('0x47')][_0x44cc('0x48')]?_0x184e96[_0x44cc('0x47')]:_0x1afd80[_0x44cc('0x45')];if(!_0x1f880e['query'][_0x44cc('0x49')]('nolimit')){_0x184e96[_0x44cc('0x2e')]=qs[_0x44cc('0x2e')](_0x1f880e[_0x44cc('0x42')][_0x44cc('0x2e')]);_0x184e96['offset']=qs[_0x44cc('0x30')](_0x1f880e[_0x44cc('0x42')][_0x44cc('0x30')]);}_0x184e96[_0x44cc('0x4b')]=qs[_0x44cc('0x4c')](_0x1f880e[_0x44cc('0x42')]['sort']);_0x184e96[_0x44cc('0x4d')]=qs[_0x44cc('0x43')](_['pick'](_0x1f880e['query'],_0x1afd80[_0x44cc('0x43')]));_0x184e96[_0x44cc('0x4d')][_0x44cc('0x67')]=_0x2f9873['id'];if(_0x1f880e[_0x44cc('0x42')][_0x44cc('0x4f')]){_0x184e96[_0x44cc('0x4d')]=_[_0x44cc('0x50')](_0x184e96['where'],{'$or':_[_0x44cc('0x3e')](_0x184e96[_0x44cc('0x47')],function(_0x3bb1f1){var _0x2e580a={};_0x2e580a[_0x3bb1f1]={'$like':'%'+_0x1f880e['query']['filter']+'%'};return _0x2e580a;})});}_0x184e96=_[_0x44cc('0x50')]({},_0x184e96,_0x1f880e[_0x44cc('0x52')]);return db[_0x44cc('0x68')][_0x44cc('0x55')](_0x184e96);}})[_0x44cc('0x37')](function(_0x13a497){if(_0x13a497){return db[_0x44cc('0x69')]['findAndCountAll']({'where':{'id':_[_0x44cc('0x3e')](_0x13a497,_0x44cc('0x6a')),'role':'agent'},'attributes':['id','name',_0x44cc('0x6b'),_0x44cc('0x6c'),_0x44cc('0x6d')]});}})[_0x44cc('0x37')](function(_0x4f28b6){if(_0x4f28b6){return{'count':_0x4f28b6[_0x44cc('0x2f')],'rows':_[_0x44cc('0x3e')](_0x4f28b6['rows'],function(_0x587870){return{'membername':_0x587870[_0x44cc('0x3c')],'UserId':_0x587870['id'],'queue_name':_0x484553['name'],'ChatQueueId':_0x484553['id'],'interface':util[_0x44cc('0x6e')](_0x44cc('0x6f'),_0x44cc('0x70'),_0x587870['name']),'penalty':0x0,'paused':_0x587870['chatPause'],'createdAt':_0x587870[_0x44cc('0x6d')],'updatedAt':_0x587870[_0x44cc('0x6c')]};})};}else{return{'count':0x0,'rows':[]};}})[_0x44cc('0x37')](respondWithFilteredResult(_0x2da817,_0x184e96))['catch'](handleError(_0x2da817,null));};exports[_0x44cc('0x71')]=function(_0x3522e0,_0x445aeb,_0x2f6151){var _0x387471={};var _0x3689f9={};var _0x3eab21;var _0x73b06d;return db[_0x44cc('0x53')][_0x44cc('0x72')]({'where':{'id':_0x3522e0[_0x44cc('0x58')]['id']}})[_0x44cc('0x37')](handleEntityNotFound(_0x445aeb,null))[_0x44cc('0x37')](function(_0x5aaa88){if(_0x5aaa88){_0x3eab21=_0x5aaa88;_0x3689f9[_0x44cc('0x45')]=_[_0x44cc('0x41')](db[_0x44cc('0x73')][_0x44cc('0x59')]);_0x3689f9[_0x44cc('0x42')]=_[_0x44cc('0x41')](_0x3522e0[_0x44cc('0x42')]);_0x3689f9['filters']=_[_0x44cc('0x44')](_0x3689f9['model'],_0x3689f9[_0x44cc('0x42')]);_0x387471[_0x44cc('0x47')]=_[_0x44cc('0x44')](_0x3689f9[_0x44cc('0x45')],qs[_0x44cc('0x46')](_0x3522e0[_0x44cc('0x42')][_0x44cc('0x46')]));_0x387471['attributes']=_0x387471[_0x44cc('0x47')]['length']?_0x387471[_0x44cc('0x47')]:_0x3689f9['model'];_0x387471[_0x44cc('0x4b')]=qs['sort'](_0x3522e0[_0x44cc('0x42')][_0x44cc('0x4c')]);_0x387471[_0x44cc('0x4d')]=qs[_0x44cc('0x43')](_[_0x44cc('0x4e')](_0x3522e0[_0x44cc('0x42')],_0x3689f9[_0x44cc('0x43')]));if(_0x3522e0['query'][_0x44cc('0x4f')]){_0x387471[_0x44cc('0x4d')]=_[_0x44cc('0x50')](_0x387471[_0x44cc('0x4d')],{'$or':_[_0x44cc('0x3e')](_0x387471[_0x44cc('0x47')],function(_0x3b9e24){var _0x273df5={};_0x273df5[_0x3b9e24]={'$like':'%'+_0x3522e0[_0x44cc('0x42')][_0x44cc('0x4f')]+'%'};return _0x273df5;})});}_0x387471=_['merge']({},_0x387471,_0x3522e0[_0x44cc('0x52')]);return _0x3eab21['getTeams'](_0x387471);}})[_0x44cc('0x37')](function(_0x3f5929){if(_0x3f5929){_0x73b06d=_0x3f5929['length'];if(!_0x3522e0[_0x44cc('0x42')][_0x44cc('0x49')](_0x44cc('0x4a'))){_0x387471[_0x44cc('0x2e')]=qs[_0x44cc('0x2e')](_0x3522e0['query'][_0x44cc('0x2e')]);_0x387471['offset']=qs[_0x44cc('0x30')](_0x3522e0['query'][_0x44cc('0x30')]);}return _0x3eab21[_0x44cc('0x71')](_0x387471);}})[_0x44cc('0x37')](function(_0x40f5ae){if(_0x40f5ae){return _0x40f5ae?{'count':_0x73b06d,'rows':_0x40f5ae}:null;}})[_0x44cc('0x37')](respondWithResult(_0x445aeb,null))['catch'](handleError(_0x445aeb,null));};exports[_0x44cc('0x74')]=function(_0x277731,_0x42b679,_0x3fa342){var _0x536605=_0x277731[_0x44cc('0x5c')][_0x44cc('0x75')];return db[_0x44cc('0x73')][_0x44cc('0x55')]({'where':{'id':_0x536605},'attributes':['id'],'include':[{'model':db[_0x44cc('0x69')],'as':_0x44cc('0x76'),'attributes':['id','name',_0x44cc('0x77'),_0x44cc('0x78'),'interface'],'raw':!![]}]})[_0x44cc('0x37')](function(_0x228f1a){if(_0x228f1a){var _0x3bb4df=_['flatMap'](_0x228f1a,function(_0xf3b6dc){var _0x251a3d=_0xf3b6dc['get']({'plain':!![]});return _0x251a3d[_0x44cc('0x76')];});return db[_0x44cc('0x53')][_0x44cc('0x62')]({'where':{'id':_0x277731[_0x44cc('0x58')]['id']}})['then'](function(_0x27477e){return db[_0x44cc('0x79')][_0x44cc('0x7a')](function(_0x2f5d5b){return _0x27477e[_0x44cc('0x74')](_0x536605,{'transaction':_0x2f5d5b})[_0x44cc('0x37')](function(){return BPromise['each'](_0x3bb4df,function(_0x4de780){return db['UserChatQueue'][_0x44cc('0x7b')]({'where':{'UserId':_0x4de780['id'],'ChatQueueId':_0x277731[_0x44cc('0x58')]['id']},'transaction':_0x2f5d5b});});})['then'](function(){_0x3bb4df[_0x44cc('0x7c')](function(_0x5d9bb8){socket['emit'](_0x44cc('0x7d'),{'UserId':_0x5d9bb8['id'],'ChatQueueId':_0x27477e['id']});});});});});}})['then'](respondWithStatusCode(_0x42b679,null))['catch'](handleError(_0x42b679,null));};exports['removeTeams']=function(_0x3511af,_0x378c1b,_0x34d079){return db['Team'][_0x44cc('0x55')]({'where':{'id':_0x3511af[_0x44cc('0x42')][_0x44cc('0x75')]},'attributes':['id'],'include':[{'model':db[_0x44cc('0x69')],'as':_0x44cc('0x76'),'attributes':['id'],'raw':!![]}]})[_0x44cc('0x37')](handleEntityNotFound(_0x378c1b,null))[_0x44cc('0x37')](function(_0x1f4067){var _0x5e5314=_[_0x44cc('0x3e')](_0x1f4067,'id');var _0x4425ee=[];var _0x1f8dbc=[];var _0x3b3d91=squel[_0x44cc('0x7e')]();_0x3b3d91['field'](_0x44cc('0x7f'))['from']('team_has_chat_queues','tq')[_0x44cc('0x80')](_0x44cc('0x81'),'ut','ut.TeamId\x20=\x20tq.TeamId')[_0x44cc('0x4d')]('ChatQueueId\x20=\x20?',_0x3511af[_0x44cc('0x58')]['id']);for(var _0x3b4586=0x0;_0x3b4586<_0x1f4067['length'];_0x3b4586+=0x1){let _0x21f105=_0x1f4067[_0x3b4586];for(var _0x56ca63=0x0;_0x56ca63<_0x21f105[_0x44cc('0x76')]['length'];_0x56ca63+=0x1){let _0x169c26=_0x21f105[_0x44cc('0x76')][_0x56ca63];var _0x57bdfd=_0x3b3d91['clone']();_0x57bdfd['where'](_0x44cc('0x82'),_0x169c26['id']);_0x1f8dbc[_0x44cc('0x83')](db['sequelize'][_0x44cc('0x42')](_0x57bdfd['toString'](),{'type':db[_0x44cc('0x79')][_0x44cc('0x84')][_0x44cc('0x85')]})[_0x44cc('0x37')](function(_0x20ae2b){if(_0x20ae2b[_0x44cc('0x48')]===0x1){return _0x169c26['id'];}else{var _0x280ad3=_['every'](_[_0x44cc('0x3e')](_0x20ae2b,_0x44cc('0x86')),function(_0x1edea0){return _['includes'](_0x5e5314,_0x1edea0);});if(_0x280ad3){return _0x169c26['id'];}}}));}}return BPromise['all'](_0x1f8dbc)[_0x44cc('0x37')](function(_0x3f6ade){_0x4425ee=_(_0x4425ee)[_0x44cc('0x87')](_0x3f6ade)[_0x44cc('0x88')]()[_0x44cc('0x89')]();return db['ChatQueue'][_0x44cc('0x62')]({'where':{'id':_0x3511af[_0x44cc('0x58')]['id']}})[_0x44cc('0x37')](function(_0x4a9a37){return db[_0x44cc('0x79')][_0x44cc('0x7a')](function(_0x2c22a8){return _0x4a9a37[_0x44cc('0x8a')](_0x3511af['query'][_0x44cc('0x75')],{'transaction':_0x2c22a8})[_0x44cc('0x37')](function(){if(!_['isEmpty'](_0x4425ee)){return _0x4a9a37[_0x44cc('0x8b')](_0x4425ee,{'transaction':_0x2c22a8});}})[_0x44cc('0x37')](function(){_0x4425ee[_0x44cc('0x7c')](function(_0x5edbc5){socket[_0x44cc('0x8c')](_0x44cc('0x8d'),{'UserId':_0x5edbc5,'ChatQueueId':_0x4a9a37['id']});});});});});});})[_0x44cc('0x37')](respondWithStatusCode(_0x378c1b,null))['catch'](handleError(_0x378c1b,null));};exports[_0x44cc('0x8e')]=function(_0x529eca,_0x1b58f8,_0x84f7d4){return db[_0x44cc('0x53')][_0x44cc('0x62')]({'where':{'id':_0x529eca[_0x44cc('0x58')]['id']}})[_0x44cc('0x37')](handleEntityNotFound(_0x1b58f8,null))['then'](function(_0x24bad9){if(_0x24bad9){return _0x24bad9['addAgents'](_0x529eca[_0x44cc('0x5c')][_0x44cc('0x75')],_[_0x44cc('0x8f')](_0x529eca['body'],[_0x44cc('0x75'),'id'])||{})['spread'](function(_0x31f66f){for(var _0x2085fb=0x0;_0x2085fb<_0x529eca[_0x44cc('0x5c')][_0x44cc('0x75')][_0x44cc('0x48')];_0x2085fb+=0x1){socket[_0x44cc('0x8c')](_0x44cc('0x7d'),{'UserId':Number(_0x529eca[_0x44cc('0x5c')][_0x44cc('0x75')][_0x2085fb]),'ChatQueueId':Number(_0x529eca[_0x44cc('0x58')]['id'])});}return _0x31f66f;});}})[_0x44cc('0x37')](respondWithResult(_0x1b58f8,null))['catch'](handleError(_0x1b58f8,null));};exports[_0x44cc('0x8b')]=function(_0x16bca4,_0x57025d,_0x5edcff){return db['ChatQueue'][_0x44cc('0x62')]({'where':{'id':_0x16bca4[_0x44cc('0x58')]['id']}})[_0x44cc('0x37')](handleEntityNotFound(_0x57025d,null))[_0x44cc('0x37')](function(_0xa18d59){if(_0xa18d59){return _0xa18d59[_0x44cc('0x8b')](_0x16bca4['query']['ids'])[_0x44cc('0x37')](function(){if(_[_0x44cc('0x90')](_0x16bca4[_0x44cc('0x42')][_0x44cc('0x75')])){for(var _0x4b1784=0x0;_0x4b1784<_0x16bca4[_0x44cc('0x42')][_0x44cc('0x75')][_0x44cc('0x48')];_0x4b1784+=0x1){socket[_0x44cc('0x8c')](_0x44cc('0x8d'),{'UserId':Number(_0x16bca4[_0x44cc('0x42')][_0x44cc('0x75')][_0x4b1784]),'ChatQueueId':Number(_0x16bca4[_0x44cc('0x58')]['id'])});}}else{socket[_0x44cc('0x8c')](_0x44cc('0x8d'),{'UserId':Number(_0x16bca4[_0x44cc('0x42')][_0x44cc('0x75')]),'ChatQueueId':Number(_0x16bca4['params']['id'])});}});}})[_0x44cc('0x37')](respondWithStatusCode(_0x57025d,null))[_0x44cc('0x2a')](handleError(_0x57025d,null));};exports[_0x44cc('0x91')]=function(_0x1b3da0,_0x56281c,_0x9d0efa){var _0x1cc770={};var _0x725d83={};var _0x589539;var _0x2cb9f7;return db['ChatQueue'][_0x44cc('0x72')]({'where':{'id':_0x1b3da0[_0x44cc('0x58')]['id']}})[_0x44cc('0x37')](handleEntityNotFound(_0x56281c,null))[_0x44cc('0x37')](function(_0x4adb5e){if(_0x4adb5e){_0x589539=_0x4adb5e;_0x725d83['model']=_[_0x44cc('0x41')](db[_0x44cc('0x69')][_0x44cc('0x59')]);_0x725d83[_0x44cc('0x42')]=_[_0x44cc('0x41')](_0x1b3da0[_0x44cc('0x42')]);_0x725d83[_0x44cc('0x43')]=_[_0x44cc('0x44')](_0x725d83[_0x44cc('0x45')],_0x725d83[_0x44cc('0x42')]);_0x1cc770[_0x44cc('0x47')]=_['intersection'](_0x725d83['model'],qs[_0x44cc('0x46')](_0x1b3da0[_0x44cc('0x42')][_0x44cc('0x46')]));_0x1cc770[_0x44cc('0x47')]=_0x1cc770[_0x44cc('0x47')][_0x44cc('0x48')]?_0x1cc770['attributes']:_0x725d83[_0x44cc('0x45')];_0x1cc770[_0x44cc('0x4b')]=qs[_0x44cc('0x4c')](_0x1b3da0[_0x44cc('0x42')]['sort']);_0x1cc770[_0x44cc('0x4d')]=qs[_0x44cc('0x43')](_[_0x44cc('0x4e')](_0x1b3da0['query'],_0x725d83[_0x44cc('0x43')]));if(_0x1b3da0[_0x44cc('0x42')][_0x44cc('0x4f')]){_0x1cc770[_0x44cc('0x4d')]=_[_0x44cc('0x50')](_0x1cc770['where'],{'$or':_[_0x44cc('0x3e')](_0x1cc770['attributes'],function(_0x4523a1){var _0x51f912={};_0x51f912[_0x4523a1]={'$like':'%'+_0x1b3da0[_0x44cc('0x42')][_0x44cc('0x4f')]+'%'};return _0x51f912;})});}_0x1cc770=_[_0x44cc('0x50')]({},_0x1cc770,_0x1b3da0[_0x44cc('0x52')]);return _0x589539[_0x44cc('0x91')](_0x1cc770);}})['then'](function(_0x509e25){if(_0x509e25){_0x2cb9f7=_0x509e25['length'];if(!_0x1b3da0[_0x44cc('0x42')]['hasOwnProperty'](_0x44cc('0x4a'))){_0x1cc770['limit']=qs['limit'](_0x1b3da0[_0x44cc('0x42')][_0x44cc('0x2e')]);_0x1cc770[_0x44cc('0x30')]=qs[_0x44cc('0x30')](_0x1b3da0[_0x44cc('0x42')][_0x44cc('0x30')]);}return _0x589539['getAgents'](_0x1cc770);}})['then'](function(_0x5157b6){if(_0x5157b6){return _0x5157b6?{'count':_0x2cb9f7,'rows':_0x5157b6}:null;}})[_0x44cc('0x37')](respondWithResult(_0x56281c,null))['catch'](handleError(_0x56281c,null));};
\ No newline at end of file
diff --git a/server/api/chatQueue/chatQueue.events.js b/server/api/chatQueue/chatQueue.events.js
index 34c3984..b6d20aa 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 _0x45d1=['events','../../mysqldb','setMaxListeners','save','remove','emit','hasOwnProperty','hook','exports'];(function(_0x5a8480,_0xfc8036){var _0x1abdd0=function(_0x2099af){while(--_0x2099af){_0x5a8480['push'](_0x5a8480['shift']());}};_0x1abdd0(++_0xfc8036);}(_0x45d1,0x1cb));var _0x145d=function(_0x5cf90e,_0x5df405){_0x5cf90e=_0x5cf90e-0x0;var _0xae958d=_0x45d1[_0x5cf90e];return _0xae958d;};'use strict';var EventEmitter=require(_0x145d('0x0'));var ChatQueue=require(_0x145d('0x1'))['db']['ChatQueue'];var ChatQueueEvents=new EventEmitter();ChatQueueEvents[_0x145d('0x2')](0x0);var events={'afterCreate':_0x145d('0x3'),'afterUpdate':'update','afterDestroy':_0x145d('0x4')};function emitEvent(_0x55eb4e){return function(_0x3076c2,_0x327cd3,_0x407d84){ChatQueueEvents[_0x145d('0x5')](_0x55eb4e+':'+_0x3076c2['id'],_0x3076c2);ChatQueueEvents[_0x145d('0x5')](_0x55eb4e,_0x3076c2);_0x407d84(null);};}for(var e in events){if(events[_0x145d('0x6')](e)){var event=events[e];ChatQueue[_0x145d('0x7')](e,emitEvent(event));}}module[_0x145d('0x8')]=ChatQueueEvents;
\ No newline at end of file
+var _0x117c=['update','emit','exports','../../mysqldb','setMaxListeners'];(function(_0x326eee,_0x5e5d39){var _0x592ea7=function(_0x47b807){while(--_0x47b807){_0x326eee['push'](_0x326eee['shift']());}};_0x592ea7(++_0x5e5d39);}(_0x117c,0x8f));var _0xc117=function(_0x105045,_0x2e471e){_0x105045=_0x105045-0x0;var _0x2487d0=_0x117c[_0x105045];return _0x2487d0;};'use strict';var EventEmitter=require('events');var ChatQueue=require(_0xc117('0x0'))['db']['ChatQueue'];var ChatQueueEvents=new EventEmitter();ChatQueueEvents[_0xc117('0x1')](0x0);var events={'afterCreate':'save','afterUpdate':_0xc117('0x2'),'afterDestroy':'remove'};function emitEvent(_0x8b9a2){return function(_0x3b4523,_0x4df175,_0x3edcab){ChatQueueEvents['emit'](_0x8b9a2+':'+_0x3b4523['id'],_0x3b4523);ChatQueueEvents[_0xc117('0x3')](_0x8b9a2,_0x3b4523);_0x3edcab(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];ChatQueue['hook'](e,emitEvent(event));}}module[_0xc117('0x4')]=ChatQueueEvents;
\ No newline at end of file
diff --git a/server/api/chatQueue/chatQueue.model.js b/server/api/chatQueue/chatQueue.model.js
index 0680134..0e7f2ef 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 _0xd1d5=['bluebird','path','rimraf','../../config/environment','define','ChatQueue','chat_queues','util','../../config/logger','api','moment'];(function(_0x346737,_0x3e6081){var _0x1ade2e=function(_0x15e50e){while(--_0x15e50e){_0x346737['push'](_0x346737['shift']());}};_0x1ade2e(++_0x3e6081);}(_0xd1d5,0x96));var _0x5d1d=function(_0x13b8f3,_0x442821){_0x13b8f3=_0x13b8f3-0x0;var _0x1a6d06=_0xd1d5[_0x13b8f3];return _0x1a6d06;};'use strict';var _=require('lodash');var util=require(_0x5d1d('0x0'));var logger=require(_0x5d1d('0x1'))(_0x5d1d('0x2'));var moment=require(_0x5d1d('0x3'));var BPromise=require(_0x5d1d('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x5d1d('0x5'));var rimraf=require(_0x5d1d('0x6'));var config=require(_0x5d1d('0x7'));var attributes=require('./chatQueue.attributes');module['exports']=function(_0x30d5f7,_0x2bdba5){return _0x30d5f7[_0x5d1d('0x8')](_0x5d1d('0x9'),attributes,{'tableName':_0x5d1d('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x4570=['ChatQueue','lodash','util','moment','bluebird','request-promise','path','rimraf','../../config/environment','define'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x4570,0x137));var _0x0457=function(_0x56ab11,_0x14cba4){_0x56ab11=_0x56ab11-0x0;var _0x5f3bba=_0x4570[_0x56ab11];return _0x5f3bba;};'use strict';var _=require(_0x0457('0x0'));var util=require(_0x0457('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0x0457('0x2'));var BPromise=require(_0x0457('0x3'));var rp=require(_0x0457('0x4'));var fs=require('fs');var path=require(_0x0457('0x5'));var rimraf=require(_0x0457('0x6'));var config=require(_0x0457('0x7'));var attributes=require('./chatQueue.attributes');module['exports']=function(_0x195e8a,_0x48618f){return _0x195e8a[_0x0457('0x8')](_0x0457('0x9'),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 d3f9683..e6e38d7 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 _0x3eaf=['options','raw','where','include','model','attributes','map','GetChatQueue','find','ShowChatQueue','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','jayson/promise','http','redis','defaults','localhost','./chatQueue.socket','then','info','request\x20sent','debug','ChatQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','ChatQueue,\x20%s,\x20%s','message','result','catch','ChatQueue','findAll'];(function(_0x166b45,_0x55f458){var _0x2ed348=function(_0x233a9a){while(--_0x233a9a){_0x166b45['push'](_0x166b45['shift']());}};_0x2ed348(++_0x55f458);}(_0x3eaf,0x190));var _0xf3ea=function(_0x4f2ebb,_0x2843e8){_0x4f2ebb=_0x4f2ebb-0x0;var _0x31a724=_0x3eaf[_0x4f2ebb];return _0x31a724;};'use strict';var _=require(_0xf3ea('0x0'));var util=require(_0xf3ea('0x1'));var moment=require(_0xf3ea('0x2'));var BPromise=require(_0xf3ea('0x3'));var rs=require(_0xf3ea('0x4'));var fs=require('fs');var Redis=require(_0xf3ea('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0xf3ea('0x6'));var logger=require(_0xf3ea('0x7'))(_0xf3ea('0x8'));var config=require('../../config/environment');var jayson=require(_0xf3ea('0x9'));var client=jayson['client'][_0xf3ea('0xa')]({'port':0x232a});config[_0xf3ea('0xb')]=_[_0xf3ea('0xc')](config['redis'],{'host':_0xf3ea('0xd'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xf3ea('0xb')]));require(_0xf3ea('0xe'))['register'](socket);function respondWithRpcPromise(_0x1c62d3,_0x4c98aa,_0x21a505){return new BPromise(function(_0x1f2825,_0x585092){return client['request'](_0x1c62d3,_0x21a505)[_0xf3ea('0xf')](function(_0x446f7c){logger[_0xf3ea('0x10')]('ChatQueue,\x20%s,\x20%s',_0x4c98aa,_0xf3ea('0x11'));logger[_0xf3ea('0x12')](_0xf3ea('0x13'),_0x4c98aa,'request\x20sent',JSON[_0xf3ea('0x14')](_0x446f7c));if(_0x446f7c[_0xf3ea('0x15')]){if(_0x446f7c[_0xf3ea('0x15')][_0xf3ea('0x16')]===0x1f4){logger[_0xf3ea('0x15')](_0xf3ea('0x17'),_0x4c98aa,_0x446f7c[_0xf3ea('0x15')][_0xf3ea('0x18')]);return _0x585092(_0x446f7c['error'][_0xf3ea('0x18')]);}logger['error'](_0xf3ea('0x17'),_0x4c98aa,_0x446f7c[_0xf3ea('0x15')]['message']);return _0x1f2825(_0x446f7c[_0xf3ea('0x15')][_0xf3ea('0x18')]);}else{logger[_0xf3ea('0x10')](_0xf3ea('0x17'),_0x4c98aa,'request\x20sent');_0x1f2825(_0x446f7c[_0xf3ea('0x19')][_0xf3ea('0x18')]);}})[_0xf3ea('0x1a')](function(_0x16bff3){logger[_0xf3ea('0x15')]('ChatQueue,\x20%s,\x20%s',_0x4c98aa,_0x16bff3);_0x585092(_0x16bff3);});});}exports['GetChatQueue']=function(_0x23c030){var _0x69546=this;return new Promise(function(_0x4d7f46,_0x2c7419){return db[_0xf3ea('0x1b')][_0xf3ea('0x1c')]({'raw':_0x23c030[_0xf3ea('0x1d')]?_0x23c030[_0xf3ea('0x1d')][_0xf3ea('0x1e')]===undefined?!![]:![]:!![],'where':_0x23c030[_0xf3ea('0x1d')]?_0x23c030[_0xf3ea('0x1d')][_0xf3ea('0x1f')]||null:null,'attributes':_0x23c030[_0xf3ea('0x1d')]?_0x23c030[_0xf3ea('0x1d')]['attributes']||null:null,'limit':_0x23c030[_0xf3ea('0x1d')]?_0x23c030[_0xf3ea('0x1d')]['limit']||null:null,'include':_0x23c030['options']?_0x23c030['options'][_0xf3ea('0x20')]?_['map'](_0x23c030[_0xf3ea('0x1d')][_0xf3ea('0x20')],function(_0x4ea971){return{'model':db[_0x4ea971[_0xf3ea('0x21')]],'as':_0x4ea971['as'],'attributes':_0x4ea971[_0xf3ea('0x22')],'include':_0x4ea971[_0xf3ea('0x20')]?_[_0xf3ea('0x23')](_0x4ea971[_0xf3ea('0x20')],function(_0x5b91e9){return{'model':db[_0x5b91e9['model']],'as':_0x5b91e9['as'],'attributes':_0x5b91e9['attributes'],'include':_0x5b91e9['include']?_[_0xf3ea('0x23')](_0x5b91e9[_0xf3ea('0x20')],function(_0x120232){return{'model':db[_0x120232[_0xf3ea('0x21')]],'as':_0x120232['as'],'attributes':_0x120232[_0xf3ea('0x22')]};}):[]};}):[]};}):[]:[]})[_0xf3ea('0xf')](function(_0x3c2cdb){logger[_0xf3ea('0x10')]('GetChatQueue',_0x23c030);logger[_0xf3ea('0x12')](_0xf3ea('0x24'),_0x23c030,JSON[_0xf3ea('0x14')](_0x3c2cdb));_0x4d7f46(_0x3c2cdb);})[_0xf3ea('0x1a')](function(_0x9c5d48){logger[_0xf3ea('0x15')](_0xf3ea('0x24'),_0x9c5d48[_0xf3ea('0x18')],_0x23c030);_0x2c7419(_0x69546[_0xf3ea('0x15')](0x1f4,_0x9c5d48[_0xf3ea('0x18')]));});});};exports['ShowChatQueue']=function(_0x4a6093){var _0x18f0a8=this;return new Promise(function(_0x299ff8,_0x457629){return db[_0xf3ea('0x1b')][_0xf3ea('0x25')]({'raw':_0x4a6093[_0xf3ea('0x1d')]?_0x4a6093[_0xf3ea('0x1d')][_0xf3ea('0x1e')]===undefined?!![]:![]:!![],'where':_0x4a6093[_0xf3ea('0x1d')]?_0x4a6093['options'][_0xf3ea('0x1f')]||null:null,'attributes':_0x4a6093[_0xf3ea('0x1d')]?_0x4a6093[_0xf3ea('0x1d')][_0xf3ea('0x22')]||null:null,'include':_0x4a6093[_0xf3ea('0x1d')]?_0x4a6093[_0xf3ea('0x1d')][_0xf3ea('0x20')]?_[_0xf3ea('0x23')](_0x4a6093[_0xf3ea('0x1d')][_0xf3ea('0x20')],function(_0x2186ba){return{'model':db[_0x2186ba[_0xf3ea('0x21')]],'as':_0x2186ba['as'],'attributes':_0x2186ba[_0xf3ea('0x22')],'include':_0x2186ba[_0xf3ea('0x20')]?_[_0xf3ea('0x23')](_0x2186ba['include'],function(_0x4b73e8){return{'model':db[_0x4b73e8[_0xf3ea('0x21')]],'as':_0x4b73e8['as'],'attributes':_0x4b73e8[_0xf3ea('0x22')],'include':_0x4b73e8[_0xf3ea('0x20')]?_['map'](_0x4b73e8[_0xf3ea('0x20')],function(_0x51589d){return{'model':db[_0x51589d[_0xf3ea('0x21')]],'as':_0x51589d['as'],'attributes':_0x51589d['attributes']};}):[]};}):[]};}):[]:[]})[_0xf3ea('0xf')](function(_0x59fa88){logger[_0xf3ea('0x10')](_0xf3ea('0x26'),_0x4a6093);logger[_0xf3ea('0x12')](_0xf3ea('0x26'),_0x4a6093,JSON[_0xf3ea('0x14')](_0x59fa88));_0x299ff8(_0x59fa88);})[_0xf3ea('0x1a')](function(_0x44a599){logger[_0xf3ea('0x15')](_0xf3ea('0x26'),_0x44a599[_0xf3ea('0x18')],_0x4a6093);_0x457629(_0x18f0a8[_0xf3ea('0x15')](0x1f4,_0x44a599['message']));});});};
\ No newline at end of file
+var _0xbc1d=['./chatQueue.socket','then','info','debug','ChatQueue,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','code','error','message','ChatQueue,\x20%s,\x20%s','ChatQueue','findAll','options','raw','where','limit','include','map','model','attributes','GetChatQueue','catch','ShowChatQueue','find','lodash','util','moment','randomstring','ioredis','../../config/utils','../../config/logger','../../config/environment','client','http','redis','defaults','localhost','socket.io-emitter'];(function(_0x52e571,_0x4a11a3){var _0x4c79a3=function(_0x5675ce){while(--_0x5675ce){_0x52e571['push'](_0x52e571['shift']());}};_0x4c79a3(++_0x4a11a3);}(_0xbc1d,0x12a));var _0xdbc1=function(_0x22bdd3,_0x552e50){_0x22bdd3=_0x22bdd3-0x0;var _0x44d9d9=_0xbc1d[_0x22bdd3];return _0x44d9d9;};'use strict';var _=require(_0xdbc1('0x0'));var util=require(_0xdbc1('0x1'));var moment=require(_0xdbc1('0x2'));var BPromise=require('bluebird');var rs=require(_0xdbc1('0x3'));var fs=require('fs');var Redis=require(_0xdbc1('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0xdbc1('0x5'));var logger=require(_0xdbc1('0x6'))('rpc');var config=require(_0xdbc1('0x7'));var jayson=require('jayson/promise');var client=jayson[_0xdbc1('0x8')][_0xdbc1('0x9')]({'port':0x232a});config[_0xdbc1('0xa')]=_[_0xdbc1('0xb')](config[_0xdbc1('0xa')],{'host':_0xdbc1('0xc'),'port':0x18eb});var socket=require(_0xdbc1('0xd'))(new Redis(config[_0xdbc1('0xa')]));require(_0xdbc1('0xe'))['register'](socket);function respondWithRpcPromise(_0x15b13d,_0xf98500,_0x1cae43){return new BPromise(function(_0x1bc86f,_0x503a02){return client['request'](_0x15b13d,_0x1cae43)[_0xdbc1('0xf')](function(_0x39cbfd){logger[_0xdbc1('0x10')]('ChatQueue,\x20%s,\x20%s',_0xf98500,'request\x20sent');logger[_0xdbc1('0x11')](_0xdbc1('0x12'),_0xf98500,_0xdbc1('0x13'),JSON[_0xdbc1('0x14')](_0x39cbfd));if(_0x39cbfd['error']){if(_0x39cbfd['error'][_0xdbc1('0x15')]===0x1f4){logger[_0xdbc1('0x16')]('ChatQueue,\x20%s,\x20%s',_0xf98500,_0x39cbfd[_0xdbc1('0x16')]['message']);return _0x503a02(_0x39cbfd[_0xdbc1('0x16')]['message']);}logger['error']('ChatQueue,\x20%s,\x20%s',_0xf98500,_0x39cbfd[_0xdbc1('0x16')][_0xdbc1('0x17')]);return _0x1bc86f(_0x39cbfd[_0xdbc1('0x16')]['message']);}else{logger[_0xdbc1('0x10')](_0xdbc1('0x18'),_0xf98500,_0xdbc1('0x13'));_0x1bc86f(_0x39cbfd['result'][_0xdbc1('0x17')]);}})['catch'](function(_0x3a8962){logger[_0xdbc1('0x16')](_0xdbc1('0x18'),_0xf98500,_0x3a8962);_0x503a02(_0x3a8962);});});}exports['GetChatQueue']=function(_0x8fffbc){var _0x30a75e=this;return new Promise(function(_0x59f948,_0x5b21c0){return db[_0xdbc1('0x19')][_0xdbc1('0x1a')]({'raw':_0x8fffbc[_0xdbc1('0x1b')]?_0x8fffbc[_0xdbc1('0x1b')][_0xdbc1('0x1c')]===undefined?!![]:![]:!![],'where':_0x8fffbc[_0xdbc1('0x1b')]?_0x8fffbc[_0xdbc1('0x1b')][_0xdbc1('0x1d')]||null:null,'attributes':_0x8fffbc[_0xdbc1('0x1b')]?_0x8fffbc[_0xdbc1('0x1b')]['attributes']||null:null,'limit':_0x8fffbc[_0xdbc1('0x1b')]?_0x8fffbc[_0xdbc1('0x1b')][_0xdbc1('0x1e')]||null:null,'include':_0x8fffbc[_0xdbc1('0x1b')]?_0x8fffbc[_0xdbc1('0x1b')][_0xdbc1('0x1f')]?_[_0xdbc1('0x20')](_0x8fffbc[_0xdbc1('0x1b')][_0xdbc1('0x1f')],function(_0x1b28f9){return{'model':db[_0x1b28f9[_0xdbc1('0x21')]],'as':_0x1b28f9['as'],'attributes':_0x1b28f9[_0xdbc1('0x22')],'include':_0x1b28f9[_0xdbc1('0x1f')]?_[_0xdbc1('0x20')](_0x1b28f9[_0xdbc1('0x1f')],function(_0x4c33ca){return{'model':db[_0x4c33ca[_0xdbc1('0x21')]],'as':_0x4c33ca['as'],'attributes':_0x4c33ca[_0xdbc1('0x22')],'include':_0x4c33ca['include']?_['map'](_0x4c33ca['include'],function(_0x55c07c){return{'model':db[_0x55c07c['model']],'as':_0x55c07c['as'],'attributes':_0x55c07c[_0xdbc1('0x22')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x1a8d84){logger[_0xdbc1('0x10')](_0xdbc1('0x23'),_0x8fffbc);logger[_0xdbc1('0x11')](_0xdbc1('0x23'),_0x8fffbc,JSON[_0xdbc1('0x14')](_0x1a8d84));_0x59f948(_0x1a8d84);})[_0xdbc1('0x24')](function(_0x3a04e2){logger[_0xdbc1('0x16')](_0xdbc1('0x23'),_0x3a04e2['message'],_0x8fffbc);_0x5b21c0(_0x30a75e[_0xdbc1('0x16')](0x1f4,_0x3a04e2[_0xdbc1('0x17')]));});});};exports[_0xdbc1('0x25')]=function(_0x2e28e2){var _0xe2a0cb=this;return new Promise(function(_0x5dabf3,_0xa6399){return db[_0xdbc1('0x19')][_0xdbc1('0x26')]({'raw':_0x2e28e2[_0xdbc1('0x1b')]?_0x2e28e2[_0xdbc1('0x1b')][_0xdbc1('0x1c')]===undefined?!![]:![]:!![],'where':_0x2e28e2[_0xdbc1('0x1b')]?_0x2e28e2[_0xdbc1('0x1b')][_0xdbc1('0x1d')]||null:null,'attributes':_0x2e28e2[_0xdbc1('0x1b')]?_0x2e28e2['options'][_0xdbc1('0x22')]||null:null,'include':_0x2e28e2[_0xdbc1('0x1b')]?_0x2e28e2[_0xdbc1('0x1b')]['include']?_[_0xdbc1('0x20')](_0x2e28e2[_0xdbc1('0x1b')][_0xdbc1('0x1f')],function(_0x47271c){return{'model':db[_0x47271c[_0xdbc1('0x21')]],'as':_0x47271c['as'],'attributes':_0x47271c['attributes'],'include':_0x47271c[_0xdbc1('0x1f')]?_['map'](_0x47271c[_0xdbc1('0x1f')],function(_0x27b7c9){return{'model':db[_0x27b7c9['model']],'as':_0x27b7c9['as'],'attributes':_0x27b7c9[_0xdbc1('0x22')],'include':_0x27b7c9[_0xdbc1('0x1f')]?_[_0xdbc1('0x20')](_0x27b7c9['include'],function(_0x4607ea){return{'model':db[_0x4607ea['model']],'as':_0x4607ea['as'],'attributes':_0x4607ea[_0xdbc1('0x22')]};}):[]};}):[]};}):[]:[]})[_0xdbc1('0xf')](function(_0xca82cb){logger[_0xdbc1('0x10')]('ShowChatQueue',_0x2e28e2);logger[_0xdbc1('0x11')](_0xdbc1('0x25'),_0x2e28e2,JSON['stringify'](_0xca82cb));_0x5dabf3(_0xca82cb);})['catch'](function(_0x3af038){logger[_0xdbc1('0x16')](_0xdbc1('0x25'),_0x3af038[_0xdbc1('0x17')],_0x2e28e2);_0xa6399(_0xe2a0cb[_0xdbc1('0x16')](0x1f4,_0x3af038[_0xdbc1('0x17')]));});});};
\ No newline at end of file
diff --git a/server/api/chatQueue/chatQueue.socket.js b/server/api/chatQueue/chatQueue.socket.js
index 322feba..0b46dbe 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 _0x0bde=['save','update','emit','removeListener','register','length','chatQueue:'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x0bde,0xe7));var _0xe0bd=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0x0bde[_0x321bb2];return _0x9c12ed;};'use strict';var ChatQueueEvents=require('./chatQueue.events');var events=[_0xe0bd('0x0'),'remove',_0xe0bd('0x1')];function createListener(_0x3dc984,_0x1d8922){return function(_0x1e198a){_0x1d8922[_0xe0bd('0x2')](_0x3dc984,_0x1e198a);};}function removeListener(_0x5541b9,_0x34df88){return function(){ChatQueueEvents[_0xe0bd('0x3')](_0x5541b9,_0x34df88);};}exports[_0xe0bd('0x4')]=function(_0x3b712a){for(var _0x22bfd1=0x0,_0x26393f=events[_0xe0bd('0x5')];_0x22bfd1<_0x26393f;_0x22bfd1++){var _0x491dc7=events[_0x22bfd1];var _0x40b36a=createListener(_0xe0bd('0x6')+_0x491dc7,_0x3b712a);ChatQueueEvents['on'](_0x491dc7,_0x40b36a);}};
\ No newline at end of file
+var _0xb66c=['chatQueue:','./chatQueue.events','remove','removeListener','register','length'];(function(_0x2bc3f4,_0x470b26){var _0x14ac53=function(_0x5121bd){while(--_0x5121bd){_0x2bc3f4['push'](_0x2bc3f4['shift']());}};_0x14ac53(++_0x470b26);}(_0xb66c,0x175));var _0xcb66=function(_0x2330d1,_0x428eab){_0x2330d1=_0x2330d1-0x0;var _0x268702=_0xb66c[_0x2330d1];return _0x268702;};'use strict';var ChatQueueEvents=require(_0xcb66('0x0'));var events=['save',_0xcb66('0x1'),'update'];function createListener(_0x2afcb8,_0x24ea13){return function(_0xf7ccc5){_0x24ea13['emit'](_0x2afcb8,_0xf7ccc5);};}function removeListener(_0x35d439,_0x386241){return function(){ChatQueueEvents[_0xcb66('0x2')](_0x35d439,_0x386241);};}exports[_0xcb66('0x3')]=function(_0x5d766d){for(var _0x518163=0x0,_0x19adf5=events[_0xcb66('0x4')];_0x518163<_0x19adf5;_0x518163++){var _0xa3993=events[_0x518163];var _0x439f3d=createListener(_0xcb66('0x5')+_0xa3993,_0x5d766d);ChatQueueEvents['on'](_0xa3993,_0x439f3d);}};
\ No newline at end of file
diff --git a/server/api/chatQueue/index.js b/server/api/chatQueue/index.js
index 4e30efd..3e12ed7 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 _0x5fc3=['update','delete','destroy','removeTeams','removeAgents','exports','multer','util','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment','./chatQueue.controller','get','isAuthenticated','describe','/:id','show','getMembers','/:id/teams','/:id/users','post','create','addTeams','put'];(function(_0x1035c1,_0x2d8583){var _0x308d67=function(_0x58ddb6){while(--_0x58ddb6){_0x1035c1['push'](_0x1035c1['shift']());}};_0x308d67(++_0x2d8583);}(_0x5fc3,0xa8));var _0x35fc=function(_0x5e8c32,_0x1b1f3f){_0x5e8c32=_0x5e8c32-0x0;var _0x595f7b=_0x5fc3[_0x5e8c32];return _0x595f7b;};'use strict';var multer=require(_0x35fc('0x0'));var util=require(_0x35fc('0x1'));var path=require('path');var timeout=require(_0x35fc('0x2'));var express=require(_0x35fc('0x3'));var router=express[_0x35fc('0x4')]();var fs_extra=require(_0x35fc('0x5'));var auth=require(_0x35fc('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0x35fc('0x7'));var controller=require(_0x35fc('0x8'));router[_0x35fc('0x9')]('/',auth['isAuthenticated'](),controller['index']);router[_0x35fc('0x9')]('/describe',auth[_0x35fc('0xa')](),controller[_0x35fc('0xb')]);router[_0x35fc('0x9')](_0x35fc('0xc'),auth[_0x35fc('0xa')](),controller[_0x35fc('0xd')]);router[_0x35fc('0x9')]('/:id/members',auth[_0x35fc('0xa')](),controller[_0x35fc('0xe')]);router['get'](_0x35fc('0xf'),auth[_0x35fc('0xa')](),controller['getTeams']);router[_0x35fc('0x9')](_0x35fc('0x10'),auth['isAuthenticated'](),controller['getAgents']);router[_0x35fc('0x11')]('/',auth['isAuthenticated'](),controller[_0x35fc('0x12')]);router[_0x35fc('0x11')](_0x35fc('0xf'),auth[_0x35fc('0xa')](),controller[_0x35fc('0x13')]);router['post']('/:id/users',auth['isAuthenticated'](),controller['addAgents']);router[_0x35fc('0x14')](_0x35fc('0xc'),auth[_0x35fc('0xa')](),controller[_0x35fc('0x15')]);router[_0x35fc('0x16')](_0x35fc('0xc'),auth['isAuthenticated'](),controller[_0x35fc('0x17')]);router[_0x35fc('0x16')]('/:id/teams',auth[_0x35fc('0xa')](),controller[_0x35fc('0x18')]);router[_0x35fc('0x16')]('/:id/users',auth[_0x35fc('0xa')](),controller[_0x35fc('0x19')]);module[_0x35fc('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(_0x3eb022,_0x1dc091){var _0x23662e=function(_0x3fd40f){while(--_0x3fd40f){_0x3eb022['push'](_0x3eb022['shift']());}};_0x23662e(++_0x1dc091);}(_0xe14b,0x93));var _0xbe14=function(_0x14e394,_0x4afb12){_0x14e394=_0x14e394-0x0;var _0x1e0af1=_0xe14b[_0x14e394];return _0x1e0af1;};'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 e3dd748..eea6772 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 _0x52be=['moment','sequelize','STRING','DATE'];(function(_0x25b4a7,_0x33e75b){var _0x2e5b69=function(_0x7d4843){while(--_0x7d4843){_0x25b4a7['push'](_0x25b4a7['shift']());}};_0x2e5b69(++_0x33e75b);}(_0x52be,0xc4));var _0xe52b=function(_0x34f8ba,_0x2bb6a8){_0x34f8ba=_0x34f8ba-0x0;var _0xa5ed05=_0x52be[_0x34f8ba];return _0xa5ed05;};'use strict';var moment=require(_0xe52b('0x0'));var Sequelize=require(_0xe52b('0x1'));module['exports']={'uniqueid':{'type':Sequelize[_0xe52b('0x2')],'allowNull':![]},'from':{'type':Sequelize[_0xe52b('0x2')]},'joinAt':{'type':Sequelize[_0xe52b('0x3')]},'leaveAt':{'type':Sequelize[_0xe52b('0x3')]},'acceptAt':{'type':Sequelize[_0xe52b('0x3')]},'exitAt':{'type':Sequelize[_0xe52b('0x3')]},'reason':{'type':Sequelize[_0xe52b('0x2')]}};
\ No newline at end of file
+var _0x31dc=['moment','sequelize','exports','STRING','DATE'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x31dc,0xc3));var _0xc31d=function(_0x326c7f,_0x2b17d0){_0x326c7f=_0x326c7f-0x0;var _0x1a1795=_0x31dc[_0x326c7f];return _0x1a1795;};'use strict';var moment=require(_0xc31d('0x0'));var Sequelize=require(_0xc31d('0x1'));module[_0xc31d('0x2')]={'uniqueid':{'type':Sequelize[_0xc31d('0x3')],'allowNull':![]},'from':{'type':Sequelize['STRING']},'joinAt':{'type':Sequelize['DATE']},'leaveAt':{'type':Sequelize['DATE']},'acceptAt':{'type':Sequelize[_0xc31d('0x4')]},'exitAt':{'type':Sequelize['DATE']},'reason':{'type':Sequelize[_0xc31d('0x3')]}};
\ No newline at end of file
diff --git a/server/api/chatQueueReport/chatQueueReport.controller.js b/server/api/chatQueueReport/chatQueueReport.controller.js
index 0f7cb9d..61a2c33 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 _0x9e2e=['zip-dir','request-promise','mustache','util','path','sox','to-csv','ejs','fs-extra','squel','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../config/environment','sendStatus','status','end','offset','undefined','limit','count','Content-Range','json','apply','reject','save','update','then','destroy','error','stack','name','send','index','map','ChatQueueReport','rawAttributes','fieldName','type','key','model','query','keys','intersection','attributes','fields','sort','where','pick','filter','VIRTUAL','merge','options','includeAll','include','findAll','catch','show','params','filters','length','find','body','describe','eml-format','rimraf'];(function(_0xd2d531,_0x19de07){var _0x70346=function(_0x136e8b){while(--_0x136e8b){_0xd2d531['push'](_0xd2d531['shift']());}};_0x70346(++_0x19de07);}(_0x9e2e,0xd6));var _0xe9e2=function(_0x414212,_0xce2258){_0x414212=_0x414212-0x0;var _0x97dfa2=_0x9e2e[_0x414212];return _0x97dfa2;};'use strict';var emlformat=require(_0xe9e2('0x0'));var rimraf=require(_0xe9e2('0x1'));var zipdir=require(_0xe9e2('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xe9e2('0x3'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0xe9e2('0x4'));var util=require(_0xe9e2('0x5'));var path=require(_0xe9e2('0x6'));var sox=require(_0xe9e2('0x7'));var csv=require(_0xe9e2('0x8'));var ejs=require(_0xe9e2('0x9'));var fs=require('fs');var fs_extra=require(_0xe9e2('0xa'));var _=require('lodash');var squel=require(_0xe9e2('0xb'));var crypto=require('crypto');var jsforce=require(_0xe9e2('0xc'));var deskjs=require(_0xe9e2('0xd'));var toCsv=require('to-csv');var querystring=require(_0xe9e2('0xe'));var Papa=require(_0xe9e2('0xf'));var Redis=require('ioredis');var authService=require(_0xe9e2('0x10'));var qs=require(_0xe9e2('0x11'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0xe9e2('0x12'))(_0xe9e2('0x13'));var utils=require(_0xe9e2('0x14'));var config=require(_0xe9e2('0x15'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x1b6493,_0xc13a68){_0xc13a68=_0xc13a68||0xcc;return function(_0x116686){if(_0x116686){return _0x1b6493[_0xe9e2('0x16')](_0xc13a68);}return _0x1b6493[_0xe9e2('0x17')](_0xc13a68)[_0xe9e2('0x18')]();};}function respondWithResult(_0x41ea08,_0x1ba905){_0x1ba905=_0x1ba905||0xc8;return function(_0xc67cb1){if(_0xc67cb1){return _0x41ea08[_0xe9e2('0x17')](_0x1ba905)['json'](_0xc67cb1);}};}function respondWithFilteredResult(_0x5ae5ff,_0x117e38){return function(_0x590974){if(_0x590974){var _0x533e9e=typeof _0x117e38[_0xe9e2('0x19')]===_0xe9e2('0x1a')&&typeof _0x117e38[_0xe9e2('0x1b')]===_0xe9e2('0x1a');var _0x20da8e=_0x590974[_0xe9e2('0x1c')];var _0x5f3fc8=_0x533e9e?0x0:_0x117e38[_0xe9e2('0x19')];var _0x2094fc=_0x533e9e?_0x590974[_0xe9e2('0x1c')]:_0x117e38['offset']+_0x117e38[_0xe9e2('0x1b')];var _0x2e7fd0;if(_0x2094fc>=_0x20da8e){_0x2094fc=_0x20da8e;_0x2e7fd0=0xc8;}else{_0x2e7fd0=0xce;}_0x5ae5ff[_0xe9e2('0x17')](_0x2e7fd0);return _0x5ae5ff['set'](_0xe9e2('0x1d'),_0x5f3fc8+'-'+_0x2094fc+'/'+_0x20da8e)[_0xe9e2('0x1e')](_0x590974);}return null;};}function patchUpdates(_0x6d8193){return function(_0x5057f6){try{jsonpatch[_0xe9e2('0x1f')](_0x5057f6,_0x6d8193,!![]);}catch(_0x36c8a3){return BPromise[_0xe9e2('0x20')](_0x36c8a3);}return _0x5057f6[_0xe9e2('0x21')]();};}function saveUpdates(_0x5bb286,_0x183680){return function(_0x1655fe){if(_0x1655fe){return _0x1655fe[_0xe9e2('0x22')](_0x5bb286)[_0xe9e2('0x23')](function(_0x38fb40){return _0x38fb40;});}return null;};}function removeEntity(_0x518328,_0x26ce3d){return function(_0x26239c){if(_0x26239c){return _0x26239c[_0xe9e2('0x24')]()[_0xe9e2('0x23')](function(){_0x518328[_0xe9e2('0x17')](0xcc)[_0xe9e2('0x18')]();});}};}function handleEntityNotFound(_0x2a3d69,_0x274468){return function(_0x313b09){if(!_0x313b09){_0x2a3d69[_0xe9e2('0x16')](0x194);}return _0x313b09;};}function handleError(_0x2fac3e,_0x4d4343){_0x4d4343=_0x4d4343||0x1f4;return function(_0x43445d){logger[_0xe9e2('0x25')](_0x43445d[_0xe9e2('0x26')]);if(_0x43445d[_0xe9e2('0x27')]){delete _0x43445d['name'];}_0x2fac3e[_0xe9e2('0x17')](_0x4d4343)[_0xe9e2('0x28')](_0x43445d);};}exports[_0xe9e2('0x29')]=function(_0x39c4a9,_0x257a3a){var _0x4fc1ce={},_0x4cf43f={},_0x39df15={'count':0x0,'rows':[]};var _0x242319=_[_0xe9e2('0x2a')](db[_0xe9e2('0x2b')][_0xe9e2('0x2c')],function(_0x42b8ca){return{'name':_0x42b8ca[_0xe9e2('0x2d')],'type':_0x42b8ca[_0xe9e2('0x2e')][_0xe9e2('0x2f')]};});_0x4cf43f[_0xe9e2('0x30')]=_[_0xe9e2('0x2a')](_0x242319,_0xe9e2('0x27'));_0x4cf43f[_0xe9e2('0x31')]=_[_0xe9e2('0x32')](_0x39c4a9['query']);_0x4cf43f['filters']=_[_0xe9e2('0x33')](_0x4cf43f[_0xe9e2('0x30')],_0x4cf43f['query']);_0x4fc1ce[_0xe9e2('0x34')]=_[_0xe9e2('0x33')](_0x4cf43f[_0xe9e2('0x30')],qs['fields'](_0x39c4a9[_0xe9e2('0x31')][_0xe9e2('0x35')]));_0x4fc1ce[_0xe9e2('0x34')]=_0x4fc1ce[_0xe9e2('0x34')]['length']?_0x4fc1ce[_0xe9e2('0x34')]:_0x4cf43f[_0xe9e2('0x30')];if(!_0x39c4a9[_0xe9e2('0x31')]['hasOwnProperty']('nolimit')){_0x4fc1ce[_0xe9e2('0x1b')]=qs[_0xe9e2('0x1b')](_0x39c4a9[_0xe9e2('0x31')][_0xe9e2('0x1b')]);_0x4fc1ce[_0xe9e2('0x19')]=qs[_0xe9e2('0x19')](_0x39c4a9[_0xe9e2('0x31')]['offset']);}_0x4fc1ce['order']=qs[_0xe9e2('0x36')](_0x39c4a9['query'][_0xe9e2('0x36')]);_0x4fc1ce[_0xe9e2('0x37')]=qs['filters'](_[_0xe9e2('0x38')](_0x39c4a9[_0xe9e2('0x31')],_0x4cf43f['filters']),_0x242319);if(_0x39c4a9[_0xe9e2('0x31')][_0xe9e2('0x39')]){_0x4fc1ce['where']=_['merge'](_0x4fc1ce[_0xe9e2('0x37')],{'$or':_[_0xe9e2('0x2a')](_0x242319,function(_0x24ed93){if(_0x24ed93['type']!==_0xe9e2('0x3a')){var _0x4f9970={};_0x4f9970[_0x24ed93[_0xe9e2('0x27')]]={'$like':'%'+_0x39c4a9[_0xe9e2('0x31')][_0xe9e2('0x39')]+'%'};return _0x4f9970;}})});}_0x4fc1ce=_[_0xe9e2('0x3b')]({},_0x4fc1ce,_0x39c4a9[_0xe9e2('0x3c')]);var _0x1c687d={'where':_0x4fc1ce[_0xe9e2('0x37')]};return db[_0xe9e2('0x2b')]['count'](_0x1c687d)['then'](function(_0x269068){_0x39df15[_0xe9e2('0x1c')]=_0x269068;if(_0x39c4a9[_0xe9e2('0x31')][_0xe9e2('0x3d')]){_0x4fc1ce[_0xe9e2('0x3e')]=[{'all':!![]}];}return db['ChatQueueReport'][_0xe9e2('0x3f')](_0x4fc1ce);})['then'](function(_0x1fe966){_0x39df15['rows']=_0x1fe966;return _0x39df15;})[_0xe9e2('0x23')](respondWithFilteredResult(_0x257a3a,_0x4fc1ce))[_0xe9e2('0x40')](handleError(_0x257a3a,null));};exports[_0xe9e2('0x41')]=function(_0x5275bb,_0x33e750){var _0x40d34b={'raw':!![],'where':{'id':_0x5275bb[_0xe9e2('0x42')]['id']}},_0x22092e={};_0x22092e[_0xe9e2('0x30')]=_[_0xe9e2('0x32')](db['ChatQueueReport']['rawAttributes']);_0x22092e[_0xe9e2('0x31')]=_[_0xe9e2('0x32')](_0x5275bb[_0xe9e2('0x31')]);_0x22092e[_0xe9e2('0x43')]=_[_0xe9e2('0x33')](_0x22092e[_0xe9e2('0x30')],_0x22092e['query']);_0x40d34b[_0xe9e2('0x34')]=_['intersection'](_0x22092e['model'],qs[_0xe9e2('0x35')](_0x5275bb[_0xe9e2('0x31')]['fields']));_0x40d34b['attributes']=_0x40d34b[_0xe9e2('0x34')][_0xe9e2('0x44')]?_0x40d34b['attributes']:_0x22092e['model'];if(_0x5275bb[_0xe9e2('0x31')][_0xe9e2('0x3d')]){_0x40d34b[_0xe9e2('0x3e')]=[{'all':!![]}];}_0x40d34b=_[_0xe9e2('0x3b')]({},_0x40d34b,_0x5275bb[_0xe9e2('0x3c')]);return db['ChatQueueReport'][_0xe9e2('0x45')](_0x40d34b)[_0xe9e2('0x23')](handleEntityNotFound(_0x33e750,null))[_0xe9e2('0x23')](respondWithResult(_0x33e750,null))[_0xe9e2('0x40')](handleError(_0x33e750,null));};exports['create']=function(_0x1ab0ee,_0x176c73){return db['ChatQueueReport']['create'](_0x1ab0ee[_0xe9e2('0x46')],{})[_0xe9e2('0x23')](respondWithResult(_0x176c73,0xc9))[_0xe9e2('0x40')](handleError(_0x176c73,null));};exports[_0xe9e2('0x22')]=function(_0x1be3ba,_0x502381){if(_0x1be3ba[_0xe9e2('0x46')]['id']){delete _0x1be3ba[_0xe9e2('0x46')]['id'];}return db[_0xe9e2('0x2b')][_0xe9e2('0x45')]({'where':{'id':_0x1be3ba[_0xe9e2('0x42')]['id']}})['then'](handleEntityNotFound(_0x502381,null))['then'](saveUpdates(_0x1be3ba[_0xe9e2('0x46')],null))[_0xe9e2('0x23')](respondWithResult(_0x502381,null))[_0xe9e2('0x40')](handleError(_0x502381,null));};exports['destroy']=function(_0x1ca157,_0x209af0){return db[_0xe9e2('0x2b')]['find']({'where':{'id':_0x1ca157[_0xe9e2('0x42')]['id']}})[_0xe9e2('0x23')](handleEntityNotFound(_0x209af0,null))[_0xe9e2('0x23')](removeEntity(_0x209af0,null))[_0xe9e2('0x40')](handleError(_0x209af0,null));};exports['describe']=function(_0x25e832,_0x3732e7){return db[_0xe9e2('0x2b')][_0xe9e2('0x47')]()[_0xe9e2('0x23')](respondWithResult(_0x3732e7,null))[_0xe9e2('0x40')](handleError(_0x3732e7,null));};
\ No newline at end of file
+var _0xb3f9=['count','set','Content-Range','apply','reject','save','then','destroy','end','error','stack','name','send','map','rawAttributes','fieldName','type','key','model','keys','intersection','query','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filters','pick','filter','merge','ChatQueueReport','includeAll','findAll','show','params','include','options','find','create','body','catch','update','describe','eml-format','rimraf','request-promise','bluebird','mustache','util','path','sox','to-csv','lodash','squel','jsforce','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','json','offset','undefined','limit'];(function(_0x2e13f7,_0x979ba5){var _0x50d053=function(_0x406de3){while(--_0x406de3){_0x2e13f7['push'](_0x2e13f7['shift']());}};_0x50d053(++_0x979ba5);}(_0xb3f9,0x7a));var _0x9b3f=function(_0x1d2173,_0x2c1fd6){_0x1d2173=_0x1d2173-0x0;var _0x49f028=_0xb3f9[_0x1d2173];return _0x49f028;};'use strict';var emlformat=require(_0x9b3f('0x0'));var rimraf=require(_0x9b3f('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x9b3f('0x2'));var moment=require('moment');var BPromise=require(_0x9b3f('0x3'));var Mustache=require(_0x9b3f('0x4'));var util=require(_0x9b3f('0x5'));var path=require(_0x9b3f('0x6'));var sox=require(_0x9b3f('0x7'));var csv=require(_0x9b3f('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x9b3f('0x9'));var squel=require(_0x9b3f('0xa'));var crypto=require('crypto');var jsforce=require(_0x9b3f('0xb'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x9b3f('0xc'));var Redis=require('ioredis');var authService=require(_0x9b3f('0xd'));var qs=require(_0x9b3f('0xe'));var as=require(_0x9b3f('0xf'));var hardwareService=require(_0x9b3f('0x10'));var logger=require(_0x9b3f('0x11'))('api');var utils=require(_0x9b3f('0x12'));var config=require(_0x9b3f('0x13'));var licenseUtil=require(_0x9b3f('0x14'));var db=require(_0x9b3f('0x15'))['db'];function respondWithStatusCode(_0x1ce80f,_0x310b83){_0x310b83=_0x310b83||0xcc;return function(_0x35554e){if(_0x35554e){return _0x1ce80f[_0x9b3f('0x16')](_0x310b83);}return _0x1ce80f['status'](_0x310b83)['end']();};}function respondWithResult(_0x56f676,_0x2f9d90){_0x2f9d90=_0x2f9d90||0xc8;return function(_0x27dab5){if(_0x27dab5){return _0x56f676[_0x9b3f('0x17')](_0x2f9d90)[_0x9b3f('0x18')](_0x27dab5);}};}function respondWithFilteredResult(_0x52310c,_0x4aa66a){return function(_0x49c0ac){if(_0x49c0ac){var _0x34fb19=typeof _0x4aa66a[_0x9b3f('0x19')]===_0x9b3f('0x1a')&&typeof _0x4aa66a[_0x9b3f('0x1b')]===_0x9b3f('0x1a');var _0x2cdc7c=_0x49c0ac['count'];var _0x579c32=_0x34fb19?0x0:_0x4aa66a[_0x9b3f('0x19')];var _0x235434=_0x34fb19?_0x49c0ac[_0x9b3f('0x1c')]:_0x4aa66a[_0x9b3f('0x19')]+_0x4aa66a[_0x9b3f('0x1b')];var _0x297fa8;if(_0x235434>=_0x2cdc7c){_0x235434=_0x2cdc7c;_0x297fa8=0xc8;}else{_0x297fa8=0xce;}_0x52310c[_0x9b3f('0x17')](_0x297fa8);return _0x52310c[_0x9b3f('0x1d')](_0x9b3f('0x1e'),_0x579c32+'-'+_0x235434+'/'+_0x2cdc7c)[_0x9b3f('0x18')](_0x49c0ac);}return null;};}function patchUpdates(_0xa4883e){return function(_0x1cb346){try{jsonpatch[_0x9b3f('0x1f')](_0x1cb346,_0xa4883e,!![]);}catch(_0x1218c0){return BPromise[_0x9b3f('0x20')](_0x1218c0);}return _0x1cb346[_0x9b3f('0x21')]();};}function saveUpdates(_0x1d5c43,_0x5195e9){return function(_0x3360d6){if(_0x3360d6){return _0x3360d6['update'](_0x1d5c43)[_0x9b3f('0x22')](function(_0x4db496){return _0x4db496;});}return null;};}function removeEntity(_0x4704dd,_0x5d075f){return function(_0x3c9d8d){if(_0x3c9d8d){return _0x3c9d8d[_0x9b3f('0x23')]()[_0x9b3f('0x22')](function(){_0x4704dd['status'](0xcc)[_0x9b3f('0x24')]();});}};}function handleEntityNotFound(_0x483eb3,_0x325c74){return function(_0x526355){if(!_0x526355){_0x483eb3[_0x9b3f('0x16')](0x194);}return _0x526355;};}function handleError(_0x32aa3e,_0x51014e){_0x51014e=_0x51014e||0x1f4;return function(_0x248c9d){logger[_0x9b3f('0x25')](_0x248c9d[_0x9b3f('0x26')]);if(_0x248c9d[_0x9b3f('0x27')]){delete _0x248c9d['name'];}_0x32aa3e['status'](_0x51014e)[_0x9b3f('0x28')](_0x248c9d);};}exports['index']=function(_0x377d0e,_0x4a0d60){var _0x1059b1={},_0x128542={},_0x35f2dd={'count':0x0,'rows':[]};var _0x1c89d3=_[_0x9b3f('0x29')](db['ChatQueueReport'][_0x9b3f('0x2a')],function(_0x38dd12){return{'name':_0x38dd12[_0x9b3f('0x2b')],'type':_0x38dd12[_0x9b3f('0x2c')][_0x9b3f('0x2d')]};});_0x128542[_0x9b3f('0x2e')]=_[_0x9b3f('0x29')](_0x1c89d3,'name');_0x128542['query']=_[_0x9b3f('0x2f')](_0x377d0e['query']);_0x128542['filters']=_[_0x9b3f('0x30')](_0x128542['model'],_0x128542[_0x9b3f('0x31')]);_0x1059b1[_0x9b3f('0x32')]=_[_0x9b3f('0x30')](_0x128542[_0x9b3f('0x2e')],qs[_0x9b3f('0x33')](_0x377d0e['query'][_0x9b3f('0x33')]));_0x1059b1[_0x9b3f('0x32')]=_0x1059b1[_0x9b3f('0x32')][_0x9b3f('0x34')]?_0x1059b1[_0x9b3f('0x32')]:_0x128542[_0x9b3f('0x2e')];if(!_0x377d0e['query'][_0x9b3f('0x35')](_0x9b3f('0x36'))){_0x1059b1[_0x9b3f('0x1b')]=qs['limit'](_0x377d0e[_0x9b3f('0x31')][_0x9b3f('0x1b')]);_0x1059b1[_0x9b3f('0x19')]=qs[_0x9b3f('0x19')](_0x377d0e[_0x9b3f('0x31')][_0x9b3f('0x19')]);}_0x1059b1[_0x9b3f('0x37')]=qs[_0x9b3f('0x38')](_0x377d0e[_0x9b3f('0x31')][_0x9b3f('0x38')]);_0x1059b1[_0x9b3f('0x39')]=qs[_0x9b3f('0x3a')](_[_0x9b3f('0x3b')](_0x377d0e[_0x9b3f('0x31')],_0x128542[_0x9b3f('0x3a')]),_0x1c89d3);if(_0x377d0e['query'][_0x9b3f('0x3c')]){_0x1059b1[_0x9b3f('0x39')]=_[_0x9b3f('0x3d')](_0x1059b1[_0x9b3f('0x39')],{'$or':_[_0x9b3f('0x29')](_0x1c89d3,function(_0x1d08b5){if(_0x1d08b5[_0x9b3f('0x2c')]!=='VIRTUAL'){var _0x1c2154={};_0x1c2154[_0x1d08b5[_0x9b3f('0x27')]]={'$like':'%'+_0x377d0e['query'][_0x9b3f('0x3c')]+'%'};return _0x1c2154;}})});}_0x1059b1=_[_0x9b3f('0x3d')]({},_0x1059b1,_0x377d0e['options']);var _0x13b6c4={'where':_0x1059b1[_0x9b3f('0x39')]};return db[_0x9b3f('0x3e')]['count'](_0x13b6c4)[_0x9b3f('0x22')](function(_0xb34c29){_0x35f2dd[_0x9b3f('0x1c')]=_0xb34c29;if(_0x377d0e[_0x9b3f('0x31')][_0x9b3f('0x3f')]){_0x1059b1['include']=[{'all':!![]}];}return db['ChatQueueReport'][_0x9b3f('0x40')](_0x1059b1);})[_0x9b3f('0x22')](function(_0x54e5bc){_0x35f2dd['rows']=_0x54e5bc;return _0x35f2dd;})[_0x9b3f('0x22')](respondWithFilteredResult(_0x4a0d60,_0x1059b1))['catch'](handleError(_0x4a0d60,null));};exports[_0x9b3f('0x41')]=function(_0x547fdc,_0x8f9971){var _0x4ae4c1={'raw':!![],'where':{'id':_0x547fdc[_0x9b3f('0x42')]['id']}},_0x4eb8fe={};_0x4eb8fe[_0x9b3f('0x2e')]=_[_0x9b3f('0x2f')](db[_0x9b3f('0x3e')]['rawAttributes']);_0x4eb8fe['query']=_[_0x9b3f('0x2f')](_0x547fdc['query']);_0x4eb8fe[_0x9b3f('0x3a')]=_[_0x9b3f('0x30')](_0x4eb8fe['model'],_0x4eb8fe[_0x9b3f('0x31')]);_0x4ae4c1[_0x9b3f('0x32')]=_[_0x9b3f('0x30')](_0x4eb8fe[_0x9b3f('0x2e')],qs['fields'](_0x547fdc[_0x9b3f('0x31')][_0x9b3f('0x33')]));_0x4ae4c1[_0x9b3f('0x32')]=_0x4ae4c1[_0x9b3f('0x32')][_0x9b3f('0x34')]?_0x4ae4c1['attributes']:_0x4eb8fe[_0x9b3f('0x2e')];if(_0x547fdc[_0x9b3f('0x31')]['includeAll']){_0x4ae4c1[_0x9b3f('0x43')]=[{'all':!![]}];}_0x4ae4c1=_[_0x9b3f('0x3d')]({},_0x4ae4c1,_0x547fdc[_0x9b3f('0x44')]);return db[_0x9b3f('0x3e')][_0x9b3f('0x45')](_0x4ae4c1)[_0x9b3f('0x22')](handleEntityNotFound(_0x8f9971,null))[_0x9b3f('0x22')](respondWithResult(_0x8f9971,null))['catch'](handleError(_0x8f9971,null));};exports[_0x9b3f('0x46')]=function(_0x3bc2c9,_0x420d6f){return db[_0x9b3f('0x3e')][_0x9b3f('0x46')](_0x3bc2c9[_0x9b3f('0x47')],{})[_0x9b3f('0x22')](respondWithResult(_0x420d6f,0xc9))[_0x9b3f('0x48')](handleError(_0x420d6f,null));};exports[_0x9b3f('0x49')]=function(_0x51dd3d,_0x24d3cd){if(_0x51dd3d['body']['id']){delete _0x51dd3d[_0x9b3f('0x47')]['id'];}return db[_0x9b3f('0x3e')][_0x9b3f('0x45')]({'where':{'id':_0x51dd3d[_0x9b3f('0x42')]['id']}})['then'](handleEntityNotFound(_0x24d3cd,null))[_0x9b3f('0x22')](saveUpdates(_0x51dd3d[_0x9b3f('0x47')],null))[_0x9b3f('0x22')](respondWithResult(_0x24d3cd,null))[_0x9b3f('0x48')](handleError(_0x24d3cd,null));};exports['destroy']=function(_0x571f57,_0x4eede7){return db['ChatQueueReport'][_0x9b3f('0x45')]({'where':{'id':_0x571f57[_0x9b3f('0x42')]['id']}})[_0x9b3f('0x22')](handleEntityNotFound(_0x4eede7,null))[_0x9b3f('0x22')](removeEntity(_0x4eede7,null))[_0x9b3f('0x48')](handleError(_0x4eede7,null));};exports['describe']=function(_0x1799bd,_0x48ac1f){return db[_0x9b3f('0x3e')][_0x9b3f('0x4a')]()['then'](respondWithResult(_0x48ac1f,null))[_0x9b3f('0x48')](handleError(_0x48ac1f,null));};
\ No newline at end of file
diff --git a/server/api/chatQueueReport/chatQueueReport.model.js b/server/api/chatQueueReport/chatQueueReport.model.js
index b1914c0..30dffde 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 _0xbaf0=['define','ChatQueueReport','report_chat_queue','uniqueid','util','../../config/logger','api','moment','bluebird','request-promise','rimraf','../../config/environment','./chatQueueReport.attributes','exports'];(function(_0x14c5cc,_0xbebb70){var _0x33096f=function(_0x73aea6){while(--_0x73aea6){_0x14c5cc['push'](_0x14c5cc['shift']());}};_0x33096f(++_0xbebb70);}(_0xbaf0,0x12a));var _0x0baf=function(_0x19e35c,_0x29cd1e){_0x19e35c=_0x19e35c-0x0;var _0x3e1fe8=_0xbaf0[_0x19e35c];return _0x3e1fe8;};'use strict';var _=require('lodash');var util=require(_0x0baf('0x0'));var logger=require(_0x0baf('0x1'))(_0x0baf('0x2'));var moment=require(_0x0baf('0x3'));var BPromise=require(_0x0baf('0x4'));var rp=require(_0x0baf('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x0baf('0x6'));var config=require(_0x0baf('0x7'));var attributes=require(_0x0baf('0x8'));module[_0x0baf('0x9')]=function(_0xe4c3c4,_0x335e24){return _0xe4c3c4[_0x0baf('0xa')](_0x0baf('0xb'),attributes,{'tableName':_0x0baf('0xc'),'paranoid':![],'indexes':[{'name':'uniqueid','fields':[_0x0baf('0xd')]}],'timestamps':!![]});};
\ No newline at end of file
+var _0xb10b=['../../config/logger','api','moment','request-promise','path','rimraf','../../config/environment','./chatQueueReport.attributes','exports','define','report_chat_queue','uniqueid','lodash'];(function(_0x465147,_0x240ccd){var _0x5449b5=function(_0x3d7dce){while(--_0x3d7dce){_0x465147['push'](_0x465147['shift']());}};_0x5449b5(++_0x240ccd);}(_0xb10b,0x12a));var _0xbb10=function(_0x34e0dd,_0x1bd86f){_0x34e0dd=_0x34e0dd-0x0;var _0x505d0c=_0xb10b[_0x34e0dd];return _0x505d0c;};'use strict';var _=require(_0xbb10('0x0'));var util=require('util');var logger=require(_0xbb10('0x1'))(_0xbb10('0x2'));var moment=require(_0xbb10('0x3'));var BPromise=require('bluebird');var rp=require(_0xbb10('0x4'));var fs=require('fs');var path=require(_0xbb10('0x5'));var rimraf=require(_0xbb10('0x6'));var config=require(_0xbb10('0x7'));var attributes=require(_0xbb10('0x8'));module[_0xbb10('0x9')]=function(_0x481979,_0x328583){return _0x481979[_0xbb10('0xa')]('ChatQueueReport',attributes,{'tableName':_0xbb10('0xb'),'paranoid':![],'indexes':[{'name':_0xbb10('0xc'),'fields':[_0xbb10('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 67a8fd4..2cc9826 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 _0x4d41=['message','CreateChatQueueReport','create','body','options','update','raw','where','attributes','UpdateChatQueueReport','lodash','moment','randomstring','ioredis','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','request','then','info','ChatQueueReport,\x20%s,\x20%s','debug','request\x20sent','stringify','error','code'];(function(_0x4e0f38,_0x221eda){var _0x2a42b4=function(_0x5ab9d2){while(--_0x5ab9d2){_0x4e0f38['push'](_0x4e0f38['shift']());}};_0x2a42b4(++_0x221eda);}(_0x4d41,0x1a0));var _0x14d4=function(_0x493503,_0x351993){_0x493503=_0x493503-0x0;var _0x1986d0=_0x4d41[_0x493503];return _0x1986d0;};'use strict';var _=require(_0x14d4('0x0'));var util=require('util');var moment=require(_0x14d4('0x1'));var BPromise=require('bluebird');var rs=require(_0x14d4('0x2'));var fs=require('fs');var Redis=require(_0x14d4('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x14d4('0x4'));var logger=require(_0x14d4('0x5'))('rpc');var config=require(_0x14d4('0x6'));var jayson=require(_0x14d4('0x7'));var client=jayson[_0x14d4('0x8')][_0x14d4('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x3880ad,_0x10db52,_0x5afc24){return new BPromise(function(_0x211701,_0x1d345d){return client[_0x14d4('0xa')](_0x3880ad,_0x5afc24)[_0x14d4('0xb')](function(_0x57c107){logger[_0x14d4('0xc')](_0x14d4('0xd'),_0x10db52,'request\x20sent');logger[_0x14d4('0xe')]('ChatQueueReport,\x20%s,\x20%s,\x20%s',_0x10db52,_0x14d4('0xf'),JSON[_0x14d4('0x10')](_0x57c107));if(_0x57c107[_0x14d4('0x11')]){if(_0x57c107['error'][_0x14d4('0x12')]===0x1f4){logger[_0x14d4('0x11')]('ChatQueueReport,\x20%s,\x20%s',_0x10db52,_0x57c107['error'][_0x14d4('0x13')]);return _0x1d345d(_0x57c107[_0x14d4('0x11')][_0x14d4('0x13')]);}logger['error'](_0x14d4('0xd'),_0x10db52,_0x57c107[_0x14d4('0x11')][_0x14d4('0x13')]);return _0x211701(_0x57c107[_0x14d4('0x11')]['message']);}else{logger[_0x14d4('0xc')](_0x14d4('0xd'),_0x10db52,_0x14d4('0xf'));_0x211701(_0x57c107['result'][_0x14d4('0x13')]);}})['catch'](function(_0x21072b){logger[_0x14d4('0x11')]('ChatQueueReport,\x20%s,\x20%s',_0x10db52,_0x21072b);_0x1d345d(_0x21072b);});});}exports[_0x14d4('0x14')]=function(_0x4be7ed){var _0x3adaa1=this;return new Promise(function(_0x4544bb,_0x4b4be4){return db['ChatQueueReport'][_0x14d4('0x15')](_0x4be7ed[_0x14d4('0x16')],{'raw':_0x4be7ed['options']?_0x4be7ed[_0x14d4('0x17')]['raw']===undefined?!![]:![]:!![]})[_0x14d4('0xb')](function(_0x6535e8){logger['info'](_0x14d4('0x14'),_0x4be7ed);logger['debug'](_0x14d4('0x14'),_0x4be7ed,JSON[_0x14d4('0x10')](_0x6535e8));_0x4544bb(_0x6535e8);})['catch'](function(_0x157c1d){logger[_0x14d4('0x11')](_0x14d4('0x14'),_0x157c1d[_0x14d4('0x13')],_0x4be7ed);_0x4b4be4(_0x3adaa1['error'](0x1f4,_0x157c1d[_0x14d4('0x13')]));});});};exports['UpdateChatQueueReport']=function(_0x598773){var _0x2f0c0c=this;return new Promise(function(_0xd3d24e,_0x543c58){return db['ChatQueueReport'][_0x14d4('0x18')](_0x598773[_0x14d4('0x16')],{'raw':_0x598773[_0x14d4('0x17')]?_0x598773[_0x14d4('0x17')][_0x14d4('0x19')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x598773['options']?_0x598773[_0x14d4('0x17')][_0x14d4('0x1a')]||null:null,'attributes':_0x598773[_0x14d4('0x17')]?_0x598773['options'][_0x14d4('0x1b')]||null:null,'limit':_0x598773[_0x14d4('0x17')]?_0x598773[_0x14d4('0x17')]['limit']||null:null})['then'](function(_0x37ebca){logger[_0x14d4('0xc')](_0x14d4('0x1c'),_0x598773);logger[_0x14d4('0xe')]('UpdateChatQueueReport',_0x598773,JSON[_0x14d4('0x10')](_0x37ebca));_0xd3d24e(_0x37ebca);})['catch'](function(_0x5a84a0){logger['error']('UpdateChatQueueReport',_0x5a84a0[_0x14d4('0x13')],_0x598773);_0x543c58(_0x2f0c0c[_0x14d4('0x11')](0x1f4,_0x5a84a0['message']));});});};
\ No newline at end of file
+var _0xb602=['result','catch','CreateChatQueueReport','ChatQueueReport','create','options','raw','then','UpdateChatQueueReport','update','body','where','limit','lodash','util','moment','bluebird','../../config/utils','../../config/environment','client','http','request','ChatQueueReport,\x20%s,\x20%s','debug','stringify','error','code','message','info','request\x20sent'];(function(_0x4e676e,_0x2a7c6d){var _0x336a3c=function(_0x4767c4){while(--_0x4767c4){_0x4e676e['push'](_0x4e676e['shift']());}};_0x336a3c(++_0x2a7c6d);}(_0xb602,0x175));var _0x2b60=function(_0x5192eb,_0x565daf){_0x5192eb=_0x5192eb-0x0;var _0xb0b6f7=_0xb602[_0x5192eb];return _0xb0b6f7;};'use strict';var _=require(_0x2b60('0x0'));var util=require(_0x2b60('0x1'));var moment=require(_0x2b60('0x2'));var BPromise=require(_0x2b60('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x2b60('0x4'));var logger=require('../../config/logger')('rpc');var config=require(_0x2b60('0x5'));var jayson=require('jayson/promise');var client=jayson[_0x2b60('0x6')][_0x2b60('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x272982,_0x149e5d,_0x43420e){return new BPromise(function(_0x2b54bf,_0x25de9f){return client[_0x2b60('0x8')](_0x272982,_0x43420e)['then'](function(_0x1dff91){logger['info'](_0x2b60('0x9'),_0x149e5d,'request\x20sent');logger[_0x2b60('0xa')]('ChatQueueReport,\x20%s,\x20%s,\x20%s',_0x149e5d,'request\x20sent',JSON[_0x2b60('0xb')](_0x1dff91));if(_0x1dff91['error']){if(_0x1dff91[_0x2b60('0xc')][_0x2b60('0xd')]===0x1f4){logger[_0x2b60('0xc')](_0x2b60('0x9'),_0x149e5d,_0x1dff91[_0x2b60('0xc')]['message']);return _0x25de9f(_0x1dff91[_0x2b60('0xc')]['message']);}logger[_0x2b60('0xc')](_0x2b60('0x9'),_0x149e5d,_0x1dff91['error'][_0x2b60('0xe')]);return _0x2b54bf(_0x1dff91['error'][_0x2b60('0xe')]);}else{logger[_0x2b60('0xf')](_0x2b60('0x9'),_0x149e5d,_0x2b60('0x10'));_0x2b54bf(_0x1dff91[_0x2b60('0x11')][_0x2b60('0xe')]);}})[_0x2b60('0x12')](function(_0x208575){logger[_0x2b60('0xc')](_0x2b60('0x9'),_0x149e5d,_0x208575);_0x25de9f(_0x208575);});});}exports[_0x2b60('0x13')]=function(_0xf2daa0){var _0x2e4779=this;return new Promise(function(_0xa9dde4,_0x4ec5fd){return db[_0x2b60('0x14')][_0x2b60('0x15')](_0xf2daa0['body'],{'raw':_0xf2daa0['options']?_0xf2daa0[_0x2b60('0x16')][_0x2b60('0x17')]===undefined?!![]:![]:!![]})[_0x2b60('0x18')](function(_0x3aaa93){logger['info'](_0x2b60('0x13'),_0xf2daa0);logger[_0x2b60('0xa')]('CreateChatQueueReport',_0xf2daa0,JSON[_0x2b60('0xb')](_0x3aaa93));_0xa9dde4(_0x3aaa93);})['catch'](function(_0x304cfd){logger[_0x2b60('0xc')](_0x2b60('0x13'),_0x304cfd[_0x2b60('0xe')],_0xf2daa0);_0x4ec5fd(_0x2e4779['error'](0x1f4,_0x304cfd['message']));});});};exports[_0x2b60('0x19')]=function(_0x16208e){var _0x5b7c2d=this;return new Promise(function(_0x4f4caa,_0x1f498c){return db[_0x2b60('0x14')][_0x2b60('0x1a')](_0x16208e[_0x2b60('0x1b')],{'raw':_0x16208e['options']?_0x16208e[_0x2b60('0x16')][_0x2b60('0x17')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x16208e['options']?_0x16208e['options'][_0x2b60('0x1c')]||null:null,'attributes':_0x16208e['options']?_0x16208e[_0x2b60('0x16')]['attributes']||null:null,'limit':_0x16208e[_0x2b60('0x16')]?_0x16208e['options'][_0x2b60('0x1d')]||null:null})[_0x2b60('0x18')](function(_0x89c5cd){logger[_0x2b60('0xf')]('UpdateChatQueueReport',_0x16208e);logger['debug']('UpdateChatQueueReport',_0x16208e,JSON[_0x2b60('0xb')](_0x89c5cd));_0x4f4caa(_0x89c5cd);})[_0x2b60('0x12')](function(_0x80e676){logger[_0x2b60('0xc')](_0x2b60('0x19'),_0x80e676[_0x2b60('0xe')],_0x16208e);_0x1f498c(_0x5b7c2d[_0x2b60('0xc')](0x1f4,_0x80e676[_0x2b60('0xe')]));});});};
\ No newline at end of file
diff --git a/server/api/chatQueueReport/index.js b/server/api/chatQueueReport/index.js
index 6220ece..774eb8b 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 _0x125b=['get','isAuthenticated','index','/describe','describe','create','put','/:id','update','delete','destroy','exports','multer','util','connect-timeout','Router','../../components/auth/service','../../config/environment','./chatQueueReport.controller'];(function(_0x4ba0ba,_0x399518){var _0x2a5dcf=function(_0x303226){while(--_0x303226){_0x4ba0ba['push'](_0x4ba0ba['shift']());}};_0x2a5dcf(++_0x399518);}(_0x125b,0x91));var _0xb125=function(_0x39f097,_0x17116b){_0x39f097=_0x39f097-0x0;var _0x544f6a=_0x125b[_0x39f097];return _0x544f6a;};'use strict';var multer=require(_0xb125('0x0'));var util=require(_0xb125('0x1'));var path=require('path');var timeout=require(_0xb125('0x2'));var express=require('express');var router=express[_0xb125('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0xb125('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0xb125('0x5'));var controller=require(_0xb125('0x6'));router[_0xb125('0x7')]('/',auth[_0xb125('0x8')](),controller[_0xb125('0x9')]);router['get'](_0xb125('0xa'),auth[_0xb125('0x8')](),controller[_0xb125('0xb')]);router[_0xb125('0x7')]('/:id',auth[_0xb125('0x8')](),controller['show']);router['post']('/',auth[_0xb125('0x8')](),controller[_0xb125('0xc')]);router[_0xb125('0xd')](_0xb125('0xe'),auth[_0xb125('0x8')](),controller[_0xb125('0xf')]);router[_0xb125('0x10')](_0xb125('0xe'),auth[_0xb125('0x8')](),controller[_0xb125('0x11')]);module[_0xb125('0x12')]=router;
\ No newline at end of file
+var _0xa69e=['path','express','Router','fs-extra','../../components/auth/service','../../config/environment','./chatQueueReport.controller','get','isAuthenticated','index','/:id','show','post','put','destroy','multer','util'];(function(_0x158f93,_0x6fba75){var _0x3dfeb4=function(_0x288b08){while(--_0x288b08){_0x158f93['push'](_0x158f93['shift']());}};_0x3dfeb4(++_0x6fba75);}(_0xa69e,0x130));var _0xea69=function(_0xe0b8f9,_0x5853ad){_0xe0b8f9=_0xe0b8f9-0x0;var _0x54fe4a=_0xa69e[_0xe0b8f9];return _0x54fe4a;};'use strict';var multer=require(_0xea69('0x0'));var util=require(_0xea69('0x1'));var path=require(_0xea69('0x2'));var timeout=require('connect-timeout');var express=require(_0xea69('0x3'));var router=express[_0xea69('0x4')]();var fs_extra=require(_0xea69('0x5'));var auth=require(_0xea69('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0xea69('0x7'));var controller=require(_0xea69('0x8'));router[_0xea69('0x9')]('/',auth[_0xea69('0xa')](),controller[_0xea69('0xb')]);router[_0xea69('0x9')]('/describe',auth['isAuthenticated'](),controller['describe']);router['get'](_0xea69('0xc'),auth[_0xea69('0xa')](),controller[_0xea69('0xd')]);router[_0xea69('0xe')]('/',auth['isAuthenticated'](),controller['create']);router[_0xea69('0xf')](_0xea69('0xc'),auth[_0xea69('0xa')](),controller['update']);router['delete'](_0xea69('0xc'),auth[_0xea69('0xa')](),controller[_0xea69('0x10')]);module['exports']=router;
\ No newline at end of file
diff --git a/server/api/chatTransferReport/chatTransferReport.attributes.js b/server/api/chatTransferReport/chatTransferReport.attributes.js
index 0d6f931..06de1a5 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 _0xb43b=['DATE','NOW','moment','sequelize','STRING','ENUM','account','queue'];(function(_0xf2662b,_0x4d8f41){var _0x257dc7=function(_0x46b1d1){while(--_0x46b1d1){_0xf2662b['push'](_0xf2662b['shift']());}};_0x257dc7(++_0x4d8f41);}(_0xb43b,0x1b2));var _0xbb43=function(_0x10f363,_0x37c87a){_0x10f363=_0x10f363-0x0;var _0x2e8b9a=_0xb43b[_0x10f363];return _0x2e8b9a;};'use strict';var moment=require(_0xbb43('0x0'));var Sequelize=require(_0xbb43('0x1'));module['exports']={'uniqueid':{'type':Sequelize[_0xbb43('0x2')],'allowNull':![]},'type':{'type':Sequelize[_0xbb43('0x3')](_0xbb43('0x4'),'agent',_0xbb43('0x5')),'allowNull':![],'defaultValue':_0xbb43('0x5')},'transferredAt':{'type':Sequelize[_0xbb43('0x6')],'allowNull':![],'defaultValue':Sequelize[_0xbb43('0x7')]}};
\ No newline at end of file
+var _0xedd9=['account','agent','queue','NOW','sequelize','exports','STRING','ENUM'];(function(_0x29eb8c,_0x3a9eec){var _0x558e65=function(_0x416c37){while(--_0x416c37){_0x29eb8c['push'](_0x29eb8c['shift']());}};_0x558e65(++_0x3a9eec);}(_0xedd9,0xfc));var _0x9edd=function(_0x31344e,_0xc1b9c){_0x31344e=_0x31344e-0x0;var _0x2afddd=_0xedd9[_0x31344e];return _0x2afddd;};'use strict';var moment=require('moment');var Sequelize=require(_0x9edd('0x0'));module[_0x9edd('0x1')]={'uniqueid':{'type':Sequelize[_0x9edd('0x2')],'allowNull':![]},'type':{'type':Sequelize[_0x9edd('0x3')](_0x9edd('0x4'),_0x9edd('0x5'),_0x9edd('0x6')),'allowNull':![],'defaultValue':_0x9edd('0x6')},'transferredAt':{'type':Sequelize['DATE'],'allowNull':![],'defaultValue':Sequelize[_0x9edd('0x7')]}};
\ No newline at end of file
diff --git a/server/api/chatTransferReport/chatTransferReport.controller.js b/server/api/chatTransferReport/chatTransferReport.controller.js
index d34473a..3150b15 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 _0x0904=['includeAll','include','findAll','rows','show','find','catch','create','body','params','describe','eml-format','zip-dir','fast-json-patch','request-promise','util','to-csv','ejs','fs-extra','squel','crypto','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','reject','update','then','destroy','stack','name','send','index','ChatTransferReport','rawAttributes','fieldName','type','key','map','query','keys','filters','intersection','model','attributes','fields','hasOwnProperty','nolimit','order','sort','where','filter','merge','VIRTUAL','options'];(function(_0x2338fa,_0x80579a){var _0x42df9b=function(_0x13fe56){while(--_0x13fe56){_0x2338fa['push'](_0x2338fa['shift']());}};_0x42df9b(++_0x80579a);}(_0x0904,0x182));var _0x4090=function(_0x1e0a4a,_0x55752e){_0x1e0a4a=_0x1e0a4a-0x0;var _0x352afd=_0x0904[_0x1e0a4a];return _0x352afd;};'use strict';var emlformat=require(_0x4090('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x4090('0x1'));var jsonpatch=require(_0x4090('0x2'));var rp=require(_0x4090('0x3'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x4090('0x4'));var path=require('path');var sox=require('sox');var csv=require(_0x4090('0x5'));var ejs=require(_0x4090('0x6'));var fs=require('fs');var fs_extra=require(_0x4090('0x7'));var _=require('lodash');var squel=require(_0x4090('0x8'));var crypto=require(_0x4090('0x9'));var jsforce=require(_0x4090('0xa'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x4090('0xb'));var Papa=require(_0x4090('0xc'));var Redis=require(_0x4090('0xd'));var authService=require(_0x4090('0xe'));var qs=require(_0x4090('0xf'));var as=require(_0x4090('0x10'));var hardwareService=require(_0x4090('0x11'));var logger=require(_0x4090('0x12'))(_0x4090('0x13'));var utils=require(_0x4090('0x14'));var config=require(_0x4090('0x15'));var licenseUtil=require(_0x4090('0x16'));var db=require(_0x4090('0x17'))['db'];function respondWithStatusCode(_0x82d5e4,_0x2d04a7){_0x2d04a7=_0x2d04a7||0xcc;return function(_0x44b07d){if(_0x44b07d){return _0x82d5e4[_0x4090('0x18')](_0x2d04a7);}return _0x82d5e4[_0x4090('0x19')](_0x2d04a7)[_0x4090('0x1a')]();};}function respondWithResult(_0x2382e5,_0x1b3b8d){_0x1b3b8d=_0x1b3b8d||0xc8;return function(_0x9852ad){if(_0x9852ad){return _0x2382e5[_0x4090('0x19')](_0x1b3b8d)[_0x4090('0x1b')](_0x9852ad);}};}function respondWithFilteredResult(_0x4485fc,_0x3164c2){return function(_0x50a0c4){if(_0x50a0c4){var _0x413626=typeof _0x3164c2[_0x4090('0x1c')]===_0x4090('0x1d')&&typeof _0x3164c2[_0x4090('0x1e')]===_0x4090('0x1d');var _0x4c06ed=_0x50a0c4['count'];var _0x4588ea=_0x413626?0x0:_0x3164c2[_0x4090('0x1c')];var _0x51f940=_0x413626?_0x50a0c4[_0x4090('0x1f')]:_0x3164c2[_0x4090('0x1c')]+_0x3164c2[_0x4090('0x1e')];var _0x17bbf7;if(_0x51f940>=_0x4c06ed){_0x51f940=_0x4c06ed;_0x17bbf7=0xc8;}else{_0x17bbf7=0xce;}_0x4485fc['status'](_0x17bbf7);return _0x4485fc[_0x4090('0x20')](_0x4090('0x21'),_0x4588ea+'-'+_0x51f940+'/'+_0x4c06ed)[_0x4090('0x1b')](_0x50a0c4);}return null;};}function patchUpdates(_0x348b2c){return function(_0x523fc2){try{jsonpatch['apply'](_0x523fc2,_0x348b2c,!![]);}catch(_0xa7654d){return BPromise[_0x4090('0x22')](_0xa7654d);}return _0x523fc2['save']();};}function saveUpdates(_0x4b06ca,_0x1dfe29){return function(_0x22ee53){if(_0x22ee53){return _0x22ee53[_0x4090('0x23')](_0x4b06ca)[_0x4090('0x24')](function(_0x13e1ce){return _0x13e1ce;});}return null;};}function removeEntity(_0x31b7c4,_0x20c6e7){return function(_0x21764f){if(_0x21764f){return _0x21764f[_0x4090('0x25')]()[_0x4090('0x24')](function(){_0x31b7c4[_0x4090('0x19')](0xcc)[_0x4090('0x1a')]();});}};}function handleEntityNotFound(_0x5c4550,_0x87e904){return function(_0xe5f7e6){if(!_0xe5f7e6){_0x5c4550[_0x4090('0x18')](0x194);}return _0xe5f7e6;};}function handleError(_0x4f5d57,_0x34e4fd){_0x34e4fd=_0x34e4fd||0x1f4;return function(_0x2ea073){logger['error'](_0x2ea073[_0x4090('0x26')]);if(_0x2ea073[_0x4090('0x27')]){delete _0x2ea073[_0x4090('0x27')];}_0x4f5d57[_0x4090('0x19')](_0x34e4fd)[_0x4090('0x28')](_0x2ea073);};}exports[_0x4090('0x29')]=function(_0x6c1861,_0x2fa9fc){var _0x5a6706={},_0x2817d2={},_0x594781={'count':0x0,'rows':[]};var _0x27e637=_['map'](db[_0x4090('0x2a')][_0x4090('0x2b')],function(_0x51be4e){return{'name':_0x51be4e[_0x4090('0x2c')],'type':_0x51be4e[_0x4090('0x2d')][_0x4090('0x2e')]};});_0x2817d2['model']=_[_0x4090('0x2f')](_0x27e637,_0x4090('0x27'));_0x2817d2[_0x4090('0x30')]=_[_0x4090('0x31')](_0x6c1861[_0x4090('0x30')]);_0x2817d2[_0x4090('0x32')]=_[_0x4090('0x33')](_0x2817d2[_0x4090('0x34')],_0x2817d2[_0x4090('0x30')]);_0x5a6706[_0x4090('0x35')]=_[_0x4090('0x33')](_0x2817d2[_0x4090('0x34')],qs[_0x4090('0x36')](_0x6c1861[_0x4090('0x30')]['fields']));_0x5a6706[_0x4090('0x35')]=_0x5a6706[_0x4090('0x35')]['length']?_0x5a6706['attributes']:_0x2817d2[_0x4090('0x34')];if(!_0x6c1861['query'][_0x4090('0x37')](_0x4090('0x38'))){_0x5a6706[_0x4090('0x1e')]=qs[_0x4090('0x1e')](_0x6c1861['query']['limit']);_0x5a6706['offset']=qs[_0x4090('0x1c')](_0x6c1861[_0x4090('0x30')][_0x4090('0x1c')]);}_0x5a6706[_0x4090('0x39')]=qs['sort'](_0x6c1861[_0x4090('0x30')][_0x4090('0x3a')]);_0x5a6706[_0x4090('0x3b')]=qs['filters'](_['pick'](_0x6c1861['query'],_0x2817d2['filters']),_0x27e637);if(_0x6c1861['query'][_0x4090('0x3c')]){_0x5a6706[_0x4090('0x3b')]=_[_0x4090('0x3d')](_0x5a6706[_0x4090('0x3b')],{'$or':_[_0x4090('0x2f')](_0x27e637,function(_0x5c234a){if(_0x5c234a[_0x4090('0x2d')]!==_0x4090('0x3e')){var _0x724d4d={};_0x724d4d[_0x5c234a[_0x4090('0x27')]]={'$like':'%'+_0x6c1861['query']['filter']+'%'};return _0x724d4d;}})});}_0x5a6706=_[_0x4090('0x3d')]({},_0x5a6706,_0x6c1861[_0x4090('0x3f')]);var _0x23ee77={'where':_0x5a6706['where']};return db[_0x4090('0x2a')][_0x4090('0x1f')](_0x23ee77)[_0x4090('0x24')](function(_0x588fe2){_0x594781[_0x4090('0x1f')]=_0x588fe2;if(_0x6c1861[_0x4090('0x30')][_0x4090('0x40')]){_0x5a6706[_0x4090('0x41')]=[{'all':!![]}];}return db['ChatTransferReport'][_0x4090('0x42')](_0x5a6706);})[_0x4090('0x24')](function(_0x5d9773){_0x594781[_0x4090('0x43')]=_0x5d9773;return _0x594781;})[_0x4090('0x24')](respondWithFilteredResult(_0x2fa9fc,_0x5a6706))['catch'](handleError(_0x2fa9fc,null));};exports[_0x4090('0x44')]=function(_0x1ae243,_0x17f388){var _0x4332fc={'raw':!![],'where':{'id':_0x1ae243['params']['id']}},_0x486f7e={};_0x486f7e[_0x4090('0x34')]=_['keys'](db[_0x4090('0x2a')]['rawAttributes']);_0x486f7e[_0x4090('0x30')]=_[_0x4090('0x31')](_0x1ae243[_0x4090('0x30')]);_0x486f7e[_0x4090('0x32')]=_[_0x4090('0x33')](_0x486f7e['model'],_0x486f7e['query']);_0x4332fc[_0x4090('0x35')]=_['intersection'](_0x486f7e[_0x4090('0x34')],qs[_0x4090('0x36')](_0x1ae243[_0x4090('0x30')][_0x4090('0x36')]));_0x4332fc[_0x4090('0x35')]=_0x4332fc[_0x4090('0x35')]['length']?_0x4332fc[_0x4090('0x35')]:_0x486f7e[_0x4090('0x34')];if(_0x1ae243[_0x4090('0x30')][_0x4090('0x40')]){_0x4332fc[_0x4090('0x41')]=[{'all':!![]}];}_0x4332fc=_['merge']({},_0x4332fc,_0x1ae243['options']);return db[_0x4090('0x2a')][_0x4090('0x45')](_0x4332fc)[_0x4090('0x24')](handleEntityNotFound(_0x17f388,null))[_0x4090('0x24')](respondWithResult(_0x17f388,null))[_0x4090('0x46')](handleError(_0x17f388,null));};exports['create']=function(_0x3ebca1,_0x5312ca){return db['ChatTransferReport'][_0x4090('0x47')](_0x3ebca1['body'],{})[_0x4090('0x24')](respondWithResult(_0x5312ca,0xc9))[_0x4090('0x46')](handleError(_0x5312ca,null));};exports[_0x4090('0x23')]=function(_0x517a01,_0x1c7168){if(_0x517a01[_0x4090('0x48')]['id']){delete _0x517a01[_0x4090('0x48')]['id'];}return db[_0x4090('0x2a')][_0x4090('0x45')]({'where':{'id':_0x517a01['params']['id']}})[_0x4090('0x24')](handleEntityNotFound(_0x1c7168,null))[_0x4090('0x24')](saveUpdates(_0x517a01[_0x4090('0x48')],null))['then'](respondWithResult(_0x1c7168,null))[_0x4090('0x46')](handleError(_0x1c7168,null));};exports[_0x4090('0x25')]=function(_0x315db5,_0x4399c9){return db[_0x4090('0x2a')][_0x4090('0x45')]({'where':{'id':_0x315db5[_0x4090('0x49')]['id']}})[_0x4090('0x24')](handleEntityNotFound(_0x4399c9,null))[_0x4090('0x24')](removeEntity(_0x4399c9,null))[_0x4090('0x46')](handleError(_0x4399c9,null));};exports['describe']=function(_0xc47278,_0x39f03d){return db[_0x4090('0x2a')][_0x4090('0x4a')]()[_0x4090('0x24')](respondWithResult(_0x39f03d,null))['catch'](handleError(_0x39f03d,null));};
\ No newline at end of file
+var _0xcd0f=['fast-json-patch','request-promise','moment','bluebird','util','path','ejs','lodash','squel','crypto','jsforce','desk.js','to-csv','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/license/util','../../mysqldb','end','json','undefined','count','offset','limit','status','Content-Range','apply','reject','save','update','then','destroy','error','stack','name','send','index','map','ChatTransferReport','rawAttributes','fieldName','type','key','query','intersection','model','attributes','fields','length','hasOwnProperty','order','sort','where','filters','merge','VIRTUAL','filter','options','include','findAll','rows','catch','show','params','keys','create','body','find','describe','eml-format','rimraf','zip-dir'];(function(_0x4a96ca,_0x13754e){var _0x2aed48=function(_0x361330){while(--_0x361330){_0x4a96ca['push'](_0x4a96ca['shift']());}};_0x2aed48(++_0x13754e);}(_0xcd0f,0x131));var _0xfcd0=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0xcd0f[_0x14add3];return _0x4a174f;};'use strict';var emlformat=require(_0xfcd0('0x0'));var rimraf=require(_0xfcd0('0x1'));var zipdir=require(_0xfcd0('0x2'));var jsonpatch=require(_0xfcd0('0x3'));var rp=require(_0xfcd0('0x4'));var moment=require(_0xfcd0('0x5'));var BPromise=require(_0xfcd0('0x6'));var Mustache=require('mustache');var util=require(_0xfcd0('0x7'));var path=require(_0xfcd0('0x8'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0xfcd0('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xfcd0('0xa'));var squel=require(_0xfcd0('0xb'));var crypto=require(_0xfcd0('0xc'));var jsforce=require(_0xfcd0('0xd'));var deskjs=require(_0xfcd0('0xe'));var toCsv=require(_0xfcd0('0xf'));var querystring=require(_0xfcd0('0x10'));var Papa=require(_0xfcd0('0x11'));var Redis=require('ioredis');var authService=require(_0xfcd0('0x12'));var qs=require(_0xfcd0('0x13'));var as=require(_0xfcd0('0x14'));var hardwareService=require(_0xfcd0('0x15'));var logger=require(_0xfcd0('0x16'))('api');var utils=require(_0xfcd0('0x17'));var config=require('../../config/environment');var licenseUtil=require(_0xfcd0('0x18'));var db=require(_0xfcd0('0x19'))['db'];function respondWithStatusCode(_0x587b90,_0x1a89b0){_0x1a89b0=_0x1a89b0||0xcc;return function(_0x20a1fc){if(_0x20a1fc){return _0x587b90['sendStatus'](_0x1a89b0);}return _0x587b90['status'](_0x1a89b0)[_0xfcd0('0x1a')]();};}function respondWithResult(_0x3b4101,_0x203fa1){_0x203fa1=_0x203fa1||0xc8;return function(_0x33ad0a){if(_0x33ad0a){return _0x3b4101['status'](_0x203fa1)[_0xfcd0('0x1b')](_0x33ad0a);}};}function respondWithFilteredResult(_0x35a1e0,_0x3082aa){return function(_0xf98d13){if(_0xf98d13){var _0x2203e8=typeof _0x3082aa['offset']===_0xfcd0('0x1c')&&typeof _0x3082aa['limit']===_0xfcd0('0x1c');var _0x1018b0=_0xf98d13[_0xfcd0('0x1d')];var _0xa17afa=_0x2203e8?0x0:_0x3082aa['offset'];var _0x5e9f2c=_0x2203e8?_0xf98d13[_0xfcd0('0x1d')]:_0x3082aa[_0xfcd0('0x1e')]+_0x3082aa[_0xfcd0('0x1f')];var _0x61feef;if(_0x5e9f2c>=_0x1018b0){_0x5e9f2c=_0x1018b0;_0x61feef=0xc8;}else{_0x61feef=0xce;}_0x35a1e0[_0xfcd0('0x20')](_0x61feef);return _0x35a1e0['set'](_0xfcd0('0x21'),_0xa17afa+'-'+_0x5e9f2c+'/'+_0x1018b0)[_0xfcd0('0x1b')](_0xf98d13);}return null;};}function patchUpdates(_0x3072af){return function(_0x148d15){try{jsonpatch[_0xfcd0('0x22')](_0x148d15,_0x3072af,!![]);}catch(_0x1784bc){return BPromise[_0xfcd0('0x23')](_0x1784bc);}return _0x148d15[_0xfcd0('0x24')]();};}function saveUpdates(_0x165cdb,_0x3015f3){return function(_0xfb48f2){if(_0xfb48f2){return _0xfb48f2[_0xfcd0('0x25')](_0x165cdb)[_0xfcd0('0x26')](function(_0x446b93){return _0x446b93;});}return null;};}function removeEntity(_0x2f342e,_0x2b8c80){return function(_0x38c910){if(_0x38c910){return _0x38c910[_0xfcd0('0x27')]()[_0xfcd0('0x26')](function(){_0x2f342e[_0xfcd0('0x20')](0xcc)[_0xfcd0('0x1a')]();});}};}function handleEntityNotFound(_0x1b4b8a,_0x256b37){return function(_0xe1bb86){if(!_0xe1bb86){_0x1b4b8a['sendStatus'](0x194);}return _0xe1bb86;};}function handleError(_0x28a209,_0x108404){_0x108404=_0x108404||0x1f4;return function(_0x55ca3c){logger[_0xfcd0('0x28')](_0x55ca3c[_0xfcd0('0x29')]);if(_0x55ca3c[_0xfcd0('0x2a')]){delete _0x55ca3c[_0xfcd0('0x2a')];}_0x28a209['status'](_0x108404)[_0xfcd0('0x2b')](_0x55ca3c);};}exports[_0xfcd0('0x2c')]=function(_0x308ceb,_0xf51b2a){var _0x4ba02a={},_0x44d2dc={},_0x1b3fc2={'count':0x0,'rows':[]};var _0x15f639=_[_0xfcd0('0x2d')](db[_0xfcd0('0x2e')][_0xfcd0('0x2f')],function(_0x2cb76f){return{'name':_0x2cb76f[_0xfcd0('0x30')],'type':_0x2cb76f[_0xfcd0('0x31')][_0xfcd0('0x32')]};});_0x44d2dc['model']=_[_0xfcd0('0x2d')](_0x15f639,_0xfcd0('0x2a'));_0x44d2dc['query']=_['keys'](_0x308ceb[_0xfcd0('0x33')]);_0x44d2dc['filters']=_[_0xfcd0('0x34')](_0x44d2dc[_0xfcd0('0x35')],_0x44d2dc[_0xfcd0('0x33')]);_0x4ba02a[_0xfcd0('0x36')]=_[_0xfcd0('0x34')](_0x44d2dc['model'],qs[_0xfcd0('0x37')](_0x308ceb[_0xfcd0('0x33')]['fields']));_0x4ba02a['attributes']=_0x4ba02a[_0xfcd0('0x36')][_0xfcd0('0x38')]?_0x4ba02a[_0xfcd0('0x36')]:_0x44d2dc[_0xfcd0('0x35')];if(!_0x308ceb[_0xfcd0('0x33')][_0xfcd0('0x39')]('nolimit')){_0x4ba02a['limit']=qs['limit'](_0x308ceb['query']['limit']);_0x4ba02a[_0xfcd0('0x1e')]=qs[_0xfcd0('0x1e')](_0x308ceb[_0xfcd0('0x33')][_0xfcd0('0x1e')]);}_0x4ba02a[_0xfcd0('0x3a')]=qs[_0xfcd0('0x3b')](_0x308ceb['query'][_0xfcd0('0x3b')]);_0x4ba02a[_0xfcd0('0x3c')]=qs['filters'](_['pick'](_0x308ceb['query'],_0x44d2dc[_0xfcd0('0x3d')]),_0x15f639);if(_0x308ceb[_0xfcd0('0x33')]['filter']){_0x4ba02a[_0xfcd0('0x3c')]=_[_0xfcd0('0x3e')](_0x4ba02a[_0xfcd0('0x3c')],{'$or':_['map'](_0x15f639,function(_0x54aca8){if(_0x54aca8[_0xfcd0('0x31')]!==_0xfcd0('0x3f')){var _0x2e84f7={};_0x2e84f7[_0x54aca8['name']]={'$like':'%'+_0x308ceb[_0xfcd0('0x33')][_0xfcd0('0x40')]+'%'};return _0x2e84f7;}})});}_0x4ba02a=_[_0xfcd0('0x3e')]({},_0x4ba02a,_0x308ceb[_0xfcd0('0x41')]);var _0x1b12fe={'where':_0x4ba02a[_0xfcd0('0x3c')]};return db[_0xfcd0('0x2e')][_0xfcd0('0x1d')](_0x1b12fe)['then'](function(_0x1c10ac){_0x1b3fc2[_0xfcd0('0x1d')]=_0x1c10ac;if(_0x308ceb[_0xfcd0('0x33')]['includeAll']){_0x4ba02a[_0xfcd0('0x42')]=[{'all':!![]}];}return db[_0xfcd0('0x2e')][_0xfcd0('0x43')](_0x4ba02a);})[_0xfcd0('0x26')](function(_0xbc2455){_0x1b3fc2[_0xfcd0('0x44')]=_0xbc2455;return _0x1b3fc2;})['then'](respondWithFilteredResult(_0xf51b2a,_0x4ba02a))[_0xfcd0('0x45')](handleError(_0xf51b2a,null));};exports[_0xfcd0('0x46')]=function(_0xdad990,_0x2c11de){var _0xa4f368={'raw':!![],'where':{'id':_0xdad990[_0xfcd0('0x47')]['id']}},_0x19cc7b={};_0x19cc7b[_0xfcd0('0x35')]=_[_0xfcd0('0x48')](db['ChatTransferReport']['rawAttributes']);_0x19cc7b['query']=_[_0xfcd0('0x48')](_0xdad990[_0xfcd0('0x33')]);_0x19cc7b[_0xfcd0('0x3d')]=_[_0xfcd0('0x34')](_0x19cc7b[_0xfcd0('0x35')],_0x19cc7b['query']);_0xa4f368[_0xfcd0('0x36')]=_[_0xfcd0('0x34')](_0x19cc7b[_0xfcd0('0x35')],qs[_0xfcd0('0x37')](_0xdad990[_0xfcd0('0x33')][_0xfcd0('0x37')]));_0xa4f368[_0xfcd0('0x36')]=_0xa4f368[_0xfcd0('0x36')][_0xfcd0('0x38')]?_0xa4f368[_0xfcd0('0x36')]:_0x19cc7b['model'];if(_0xdad990[_0xfcd0('0x33')]['includeAll']){_0xa4f368[_0xfcd0('0x42')]=[{'all':!![]}];}_0xa4f368=_[_0xfcd0('0x3e')]({},_0xa4f368,_0xdad990[_0xfcd0('0x41')]);return db[_0xfcd0('0x2e')]['find'](_0xa4f368)[_0xfcd0('0x26')](handleEntityNotFound(_0x2c11de,null))[_0xfcd0('0x26')](respondWithResult(_0x2c11de,null))[_0xfcd0('0x45')](handleError(_0x2c11de,null));};exports['create']=function(_0x52cfc8,_0x2fc021){return db[_0xfcd0('0x2e')][_0xfcd0('0x49')](_0x52cfc8[_0xfcd0('0x4a')],{})[_0xfcd0('0x26')](respondWithResult(_0x2fc021,0xc9))['catch'](handleError(_0x2fc021,null));};exports[_0xfcd0('0x25')]=function(_0x52d2b5,_0xd60d20){if(_0x52d2b5[_0xfcd0('0x4a')]['id']){delete _0x52d2b5[_0xfcd0('0x4a')]['id'];}return db['ChatTransferReport'][_0xfcd0('0x4b')]({'where':{'id':_0x52d2b5[_0xfcd0('0x47')]['id']}})[_0xfcd0('0x26')](handleEntityNotFound(_0xd60d20,null))[_0xfcd0('0x26')](saveUpdates(_0x52d2b5[_0xfcd0('0x4a')],null))[_0xfcd0('0x26')](respondWithResult(_0xd60d20,null))[_0xfcd0('0x45')](handleError(_0xd60d20,null));};exports[_0xfcd0('0x27')]=function(_0x151f87,_0x4fe1cf){return db[_0xfcd0('0x2e')][_0xfcd0('0x4b')]({'where':{'id':_0x151f87[_0xfcd0('0x47')]['id']}})['then'](handleEntityNotFound(_0x4fe1cf,null))[_0xfcd0('0x26')](removeEntity(_0x4fe1cf,null))[_0xfcd0('0x45')](handleError(_0x4fe1cf,null));};exports[_0xfcd0('0x4c')]=function(_0x5b65e7,_0x2c2dcb){return db[_0xfcd0('0x2e')][_0xfcd0('0x4c')]()['then'](respondWithResult(_0x2c2dcb,null))[_0xfcd0('0x45')](handleError(_0x2c2dcb,null));};
\ No newline at end of file
diff --git a/server/api/chatTransferReport/chatTransferReport.model.js b/server/api/chatTransferReport/chatTransferReport.model.js
index 0e493c1..8a153e6 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 _0x82db=['../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./chatTransferReport.attributes','exports','define','ChatTransferReport','report_chat_transfer','uniqueid','lodash','util'];(function(_0x10f6b0,_0x48c9b8){var _0x61feee=function(_0x67196a){while(--_0x67196a){_0x10f6b0['push'](_0x10f6b0['shift']());}};_0x61feee(++_0x48c9b8);}(_0x82db,0xee));var _0xb82d=function(_0x31185a,_0xd5eddd){_0x31185a=_0x31185a-0x0;var _0x7458fb=_0x82db[_0x31185a];return _0x7458fb;};'use strict';var _=require(_0xb82d('0x0'));var util=require(_0xb82d('0x1'));var logger=require(_0xb82d('0x2'))(_0xb82d('0x3'));var moment=require(_0xb82d('0x4'));var BPromise=require(_0xb82d('0x5'));var rp=require(_0xb82d('0x6'));var fs=require('fs');var path=require(_0xb82d('0x7'));var rimraf=require(_0xb82d('0x8'));var config=require(_0xb82d('0x9'));var attributes=require(_0xb82d('0xa'));module[_0xb82d('0xb')]=function(_0x4af15b,_0x2b2d0e){return _0x4af15b[_0xb82d('0xc')](_0xb82d('0xd'),attributes,{'tableName':_0xb82d('0xe'),'paranoid':![],'indexes':[{'name':_0xb82d('0xf'),'fields':[_0xb82d('0xf')]}],'timestamps':!![]});};
\ No newline at end of file
+var _0x9d5a=['util','../../config/logger','moment','bluebird','path','rimraf','exports','define','ChatTransferReport','report_chat_transfer','uniqueid'];(function(_0x16e73a,_0x146629){var _0x187aa1=function(_0x26eb2f){while(--_0x26eb2f){_0x16e73a['push'](_0x16e73a['shift']());}};_0x187aa1(++_0x146629);}(_0x9d5a,0x129));var _0xa9d5=function(_0x421c11,_0xcf7560){_0x421c11=_0x421c11-0x0;var _0x317709=_0x9d5a[_0x421c11];return _0x317709;};'use strict';var _=require('lodash');var util=require(_0xa9d5('0x0'));var logger=require(_0xa9d5('0x1'))('api');var moment=require(_0xa9d5('0x2'));var BPromise=require(_0xa9d5('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xa9d5('0x4'));var rimraf=require(_0xa9d5('0x5'));var config=require('../../config/environment');var attributes=require('./chatTransferReport.attributes');module[_0xa9d5('0x6')]=function(_0x125421,_0x5e9151){return _0x125421[_0xa9d5('0x7')](_0xa9d5('0x8'),attributes,{'tableName':_0xa9d5('0x9'),'paranoid':![],'indexes':[{'name':_0xa9d5('0xa'),'fields':[_0xa9d5('0xa')]}],'timestamps':!![]});};
\ No newline at end of file
diff --git a/server/api/chatTransferReport/chatTransferReport.rpc.js b/server/api/chatTransferReport/chatTransferReport.rpc.js
index 713cb5c..a368795 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 _0xc372=['error','message','catch','lodash','util','moment','bluebird','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','info','ChatTransferReport,\x20%s,\x20%s','request\x20sent','ChatTransferReport,\x20%s,\x20%s,\x20%s'];(function(_0xbab8d5,_0x45ae45){var _0x274ce6=function(_0x16b1cc){while(--_0x16b1cc){_0xbab8d5['push'](_0xbab8d5['shift']());}};_0x274ce6(++_0x45ae45);}(_0xc372,0xdf));var _0x2c37=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xc372[_0x20a584];return _0x4b41a8;};'use strict';var _=require(_0x2c37('0x0'));var util=require(_0x2c37('0x1'));var moment=require(_0x2c37('0x2'));var BPromise=require(_0x2c37('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x2c37('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x2c37('0x5'));var logger=require(_0x2c37('0x6'))(_0x2c37('0x7'));var config=require(_0x2c37('0x8'));var jayson=require(_0x2c37('0x9'));var client=jayson[_0x2c37('0xa')][_0x2c37('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x45472f,_0x9a023e,_0x43e438){return new BPromise(function(_0x318a4e,_0x354a77){return client[_0x2c37('0xc')](_0x45472f,_0x43e438)['then'](function(_0x35ffcd){logger[_0x2c37('0xd')](_0x2c37('0xe'),_0x9a023e,_0x2c37('0xf'));logger['debug'](_0x2c37('0x10'),_0x9a023e,_0x2c37('0xf'),JSON['stringify'](_0x35ffcd));if(_0x35ffcd[_0x2c37('0x11')]){if(_0x35ffcd[_0x2c37('0x11')]['code']===0x1f4){logger[_0x2c37('0x11')](_0x2c37('0xe'),_0x9a023e,_0x35ffcd[_0x2c37('0x11')][_0x2c37('0x12')]);return _0x354a77(_0x35ffcd[_0x2c37('0x11')]['message']);}logger[_0x2c37('0x11')](_0x2c37('0xe'),_0x9a023e,_0x35ffcd['error']['message']);return _0x318a4e(_0x35ffcd[_0x2c37('0x11')][_0x2c37('0x12')]);}else{logger['info'](_0x2c37('0xe'),_0x9a023e,_0x2c37('0xf'));_0x318a4e(_0x35ffcd['result']['message']);}})[_0x2c37('0x13')](function(_0x1f4d9c){logger['error'](_0x2c37('0xe'),_0x9a023e,_0x1f4d9c);_0x354a77(_0x1f4d9c);});});}
\ No newline at end of file
+var _0xa036=['request\x20sent','debug','stringify','error','code','message','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','client','request','then','info','ChatTransferReport,\x20%s,\x20%s'];(function(_0x2641f9,_0x26715f){var _0x585741=function(_0x2d1462){while(--_0x2d1462){_0x2641f9['push'](_0x2641f9['shift']());}};_0x585741(++_0x26715f);}(_0xa036,0x1b6));var _0x6a03=function(_0xb26409,_0x298d50){_0xb26409=_0xb26409-0x0;var _0x5394eb=_0xa036[_0xb26409];return _0x5394eb;};'use strict';var _=require('lodash');var util=require(_0x6a03('0x0'));var moment=require(_0x6a03('0x1'));var BPromise=require(_0x6a03('0x2'));var rs=require(_0x6a03('0x3'));var fs=require('fs');var Redis=require(_0x6a03('0x4'));var db=require(_0x6a03('0x5'))['db'];var utils=require(_0x6a03('0x6'));var logger=require('../../config/logger')('rpc');var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x6a03('0x7')]['http']({'port':0x232a});function respondWithRpcPromise(_0x5cbfca,_0x226c5c,_0x15645f){return new BPromise(function(_0xab4adf,_0x256707){return client[_0x6a03('0x8')](_0x5cbfca,_0x15645f)[_0x6a03('0x9')](function(_0xf508da){logger[_0x6a03('0xa')](_0x6a03('0xb'),_0x226c5c,_0x6a03('0xc'));logger[_0x6a03('0xd')]('ChatTransferReport,\x20%s,\x20%s,\x20%s',_0x226c5c,'request\x20sent',JSON[_0x6a03('0xe')](_0xf508da));if(_0xf508da['error']){if(_0xf508da[_0x6a03('0xf')][_0x6a03('0x10')]===0x1f4){logger[_0x6a03('0xf')](_0x6a03('0xb'),_0x226c5c,_0xf508da[_0x6a03('0xf')][_0x6a03('0x11')]);return _0x256707(_0xf508da['error'][_0x6a03('0x11')]);}logger[_0x6a03('0xf')](_0x6a03('0xb'),_0x226c5c,_0xf508da[_0x6a03('0xf')][_0x6a03('0x11')]);return _0xab4adf(_0xf508da[_0x6a03('0xf')][_0x6a03('0x11')]);}else{logger[_0x6a03('0xa')](_0x6a03('0xb'),_0x226c5c,'request\x20sent');_0xab4adf(_0xf508da['result'][_0x6a03('0x11')]);}})['catch'](function(_0x293115){logger[_0x6a03('0xf')](_0x6a03('0xb'),_0x226c5c,_0x293115);_0x256707(_0x293115);});});}
\ No newline at end of file
diff --git a/server/api/chatTransferReport/index.js b/server/api/chatTransferReport/index.js
index 07a48e4..ae82da9 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 _0x9d57=['path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatTransferReport.controller','get','isAuthenticated','index','/describe','describe','/:id','show','post','create','update','delete','destroy','exports','multer'];(function(_0x55097b,_0x14beb7){var _0x5b90ae=function(_0x58d82d){while(--_0x58d82d){_0x55097b['push'](_0x55097b['shift']());}};_0x5b90ae(++_0x14beb7);}(_0x9d57,0x158));var _0x79d5=function(_0x4de566,_0x504ac0){_0x4de566=_0x4de566-0x0;var _0x47837b=_0x9d57[_0x4de566];return _0x47837b;};'use strict';var multer=require(_0x79d5('0x0'));var util=require('util');var path=require(_0x79d5('0x1'));var timeout=require(_0x79d5('0x2'));var express=require(_0x79d5('0x3'));var router=express[_0x79d5('0x4')]();var fs_extra=require(_0x79d5('0x5'));var auth=require(_0x79d5('0x6'));var interaction=require(_0x79d5('0x7'));var config=require(_0x79d5('0x8'));var controller=require(_0x79d5('0x9'));router[_0x79d5('0xa')]('/',auth[_0x79d5('0xb')](),controller[_0x79d5('0xc')]);router['get'](_0x79d5('0xd'),auth[_0x79d5('0xb')](),controller[_0x79d5('0xe')]);router[_0x79d5('0xa')](_0x79d5('0xf'),auth[_0x79d5('0xb')](),controller[_0x79d5('0x10')]);router[_0x79d5('0x11')]('/',auth[_0x79d5('0xb')](),controller[_0x79d5('0x12')]);router['put'](_0x79d5('0xf'),auth['isAuthenticated'](),controller[_0x79d5('0x13')]);router[_0x79d5('0x14')]('/:id',auth['isAuthenticated'](),controller[_0x79d5('0x15')]);module[_0x79d5('0x16')]=router;
\ No newline at end of file
+var _0x9922=['exports','multer','util','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','./chatTransferReport.controller','get','isAuthenticated','index','/describe','/:id','post','create','put','update','destroy'];(function(_0x3be473,_0x2cc94b){var _0x3787ea=function(_0x3a448f){while(--_0x3a448f){_0x3be473['push'](_0x3be473['shift']());}};_0x3787ea(++_0x2cc94b);}(_0x9922,0x1c9));var _0x2992=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x9922[_0x3dd15e];return _0x231fd0;};'use strict';var multer=require(_0x2992('0x0'));var util=require(_0x2992('0x1'));var path=require('path');var timeout=require(_0x2992('0x2'));var express=require(_0x2992('0x3'));var router=express[_0x2992('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x2992('0x5'));var interaction=require(_0x2992('0x6'));var config=require('../../config/environment');var controller=require(_0x2992('0x7'));router[_0x2992('0x8')]('/',auth[_0x2992('0x9')](),controller[_0x2992('0xa')]);router[_0x2992('0x8')](_0x2992('0xb'),auth[_0x2992('0x9')](),controller['describe']);router[_0x2992('0x8')](_0x2992('0xc'),auth[_0x2992('0x9')](),controller['show']);router[_0x2992('0xd')]('/',auth[_0x2992('0x9')](),controller[_0x2992('0xe')]);router[_0x2992('0xf')]('/:id',auth[_0x2992('0x9')](),controller[_0x2992('0x10')]);router['delete'](_0x2992('0xc'),auth[_0x2992('0x9')](),controller[_0x2992('0x11')]);module[_0x2992('0x12')]=router;
\ No newline at end of file
diff --git a/server/api/chatWebsite/chatWebsite.attributes.js b/server/api/chatWebsite/chatWebsite.attributes.js
index 25c955d..da7b43d 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 _0x3ea4=['offlineForm','All\x20of\x20our\x20agents\x20are\x20busy\x20at\x20this\x20time.\x20Your\x20chat\x20is\x20very\x20important\x20to\x20us.','New\x20offline\x20message\x20from\x20websiteName','You\x20received\x20a\x20new\x20offline\x20message\x20from\x20websiteName.\x20Here\x20you\x20can\x20find\x20the\x20details\x20of\x20the\x20request:','Your\x20request\x20has\x20not\x20been\x20processed.','Skip','Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}','website_alias','bottom_right','alternate','#fafafa','System','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','mandatoryDispositionPauseId','mandatoryDisposition','Meeting\x20generated\x20for\x20interaction\x20#{{interaction.id}}\x20by\x20{{agent.name}}','randomstring','exports','STRING','address','email','#011F6A','BOOLEAN','ENUM','rounded','squared','We\x20are\x20here!','Chat','Send','Contact\x20us','INTEGER','TEXT','Form\x20properly\x20submitted','Form\x20submission\x20error','Type\x20a\x20message','Feedback','star','thumb','input','name','getDataValue','onlineForm','parse','setDataValue','stringify','Comments','Leave\x20your\x20comments'];(function(_0x1a2974,_0xfba559){var _0x31f214=function(_0x1c2d58){while(--_0x1c2d58){_0x1a2974['push'](_0x1a2974['shift']());}};_0x31f214(++_0xfba559);}(_0x3ea4,0xcc));var _0x43ea=function(_0x59ee91,_0x5ca1ef){_0x59ee91=_0x59ee91-0x0;var _0x51b0b7=_0x3ea4[_0x59ee91];return _0x51b0b7;};'use strict';var Sequelize=require('sequelize');var rs=require(_0x43ea('0x0'));module[_0x43ea('0x1')]={'name':{'type':Sequelize[_0x43ea('0x2')],'allowNull':![]},'address':{'type':Sequelize[_0x43ea('0x2')],'allowNull':![],'unique':_0x43ea('0x3')},'description':{'type':Sequelize[_0x43ea('0x2')]},'mapKey':{'type':Sequelize['STRING'],'defaultValue':'email'},'mapKeyOffline':{'type':Sequelize[_0x43ea('0x2')],'defaultValue':_0x43ea('0x4')},'key':{'type':Sequelize['STRING'],'allowNull':![]},'agentAlias':{'type':Sequelize[_0x43ea('0x2')],'defaultValue':'Agent'},'customerAlias':{'type':Sequelize[_0x43ea('0x2')],'defaultValue':'Me'},'color':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0x43ea('0x5'),'validate':{'notEmpty':!![]}},'color_button':{'type':Sequelize[_0x43ea('0x2')],'allowNull':![],'defaultValue':'#011F6A','validate':{'notEmpty':!![]}},'textColor':{'type':Sequelize[_0x43ea('0x2')],'allowNull':![],'defaultValue':'#ffffff','validate':{'notEmpty':!![]}},'fontSize':{'type':Sequelize['INTEGER'],'defaultValue':0xf},'remote':{'type':Sequelize[_0x43ea('0x2')]},'animation':{'type':Sequelize[_0x43ea('0x6')],'defaultValue':!![]},'header_shape':{'type':Sequelize[_0x43ea('0x7')](_0x43ea('0x8'),_0x43ea('0x9')),'defaultValue':'rounded'},'header_online':{'type':Sequelize[_0x43ea('0x2')],'defaultValue':_0x43ea('0xa')},'start_chat_button':{'type':Sequelize[_0x43ea('0x2')],'defaultValue':_0x43ea('0xb')},'offline_chat_button':{'type':Sequelize['STRING'],'defaultValue':_0x43ea('0xc')},'header_offline':{'type':Sequelize[_0x43ea('0x2')],'defaultValue':_0x43ea('0xd')},'download_transcript':{'type':Sequelize[_0x43ea('0x6')],'defaultValue':!![]},'timeout':{'type':Sequelize[_0x43ea('0xe')],'defaultValue':0x0},'whiteLabel':{'type':Sequelize[_0x43ea('0x2')],'defaultValue':'Powered\x20by\x20xCALLY'},'defaultWhiteLabel':{'type':Sequelize[_0x43ea('0x6')],'defaultValue':!![]},'sitepic':{'type':Sequelize[_0x43ea('0xf')]},'closingQuestion':{'type':Sequelize[_0x43ea('0x2')],'defaultValue':'Do\x20you\x20want\x20to\x20close\x20the\x20interaction?'},'formSubmitSuccessMessage':{'type':Sequelize[_0x43ea('0x2')],'defaultValue':_0x43ea('0x10')},'formSubmitFailureMessage':{'type':Sequelize[_0x43ea('0x2')],'defaultValue':_0x43ea('0x11')},'noteTitle':{'type':Sequelize['STRING'],'defaultValue':'Note'},'placeholderMessage':{'type':Sequelize[_0x43ea('0x2')],'defaultValue':_0x43ea('0x12')},'closingMessage':{'type':Sequelize[_0x43ea('0x2')],'defaultValue':'Thanks\x20you\x20for\x20your\x20time!'},'closingMessageButton':{'type':Sequelize[_0x43ea('0x2')],'defaultValue':_0x43ea('0xc')},'skipMessageButton':{'type':Sequelize['STRING'],'defaultValue':'Skip'},'conditionAgreement':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'enableRating':{'type':Sequelize[_0x43ea('0x6')],'defaultValue':![]},'enableFeedback':{'type':Sequelize[_0x43ea('0x6')],'defaultValue':![]},'enableSendButton':{'type':Sequelize[_0x43ea('0x6')],'defaultValue':![]},'feedbackTitle':{'type':Sequelize[_0x43ea('0x2')],'defaultValue':_0x43ea('0x13')},'ratingType':{'type':Sequelize[_0x43ea('0x7')](_0x43ea('0x14'),_0x43ea('0x15')),'defaultValue':_0x43ea('0x14')},'ratingStarsNumber':{'type':Sequelize[_0x43ea('0xe')],'defaultValue':0x5},'onlineForm':{'type':Sequelize[_0x43ea('0xf')],'defaultValue':function(){return JSON['stringify']({'items':[{'type':_0x43ea('0x16'),'variable':null,'config':{'placeholder':'name','type':'text','required':!![]},'props':{'title':_0x43ea('0x17'),'helpText':''}},{'type':_0x43ea('0x16'),'props':{'title':_0x43ea('0x4'),'helpText':''},'config':{'required':!![],'placeholder':_0x43ea('0x4'),'type':_0x43ea('0x4')},'variable':null}],'fromKey':0x1});},'get':function(){return this[_0x43ea('0x18')](_0x43ea('0x19'))?JSON[_0x43ea('0x1a')](this[_0x43ea('0x18')](_0x43ea('0x19'))):{};},'set':function(_0x1ed4af){return this[_0x43ea('0x1b')]('onlineForm',JSON[_0x43ea('0x1c')](_0x1ed4af));}},'offlineForm':{'type':Sequelize['TEXT'],'defaultValue':function(){return JSON[_0x43ea('0x1c')]({'items':[{'type':_0x43ea('0x16'),'props':{'title':_0x43ea('0x4'),'helpText':''},'config':{'required':!![],'placeholder':_0x43ea('0x4'),'type':'email'},'variable':null},{'type':'textarea','config':{'placeholder':_0x43ea('0x1d')},'props':{'title':_0x43ea('0x1d'),'helpText':_0x43ea('0x1e')}}],'fromKey':0x0});},'get':function(){return this[_0x43ea('0x18')]('offlineForm')?JSON[_0x43ea('0x1a')](this[_0x43ea('0x18')](_0x43ea('0x1f'))):{};},'set':function(_0x1a99a1){return this[_0x43ea('0x1b')]('offlineForm',JSON['stringify'](_0x1a99a1));}},'token':{'type':Sequelize[_0x43ea('0x2')],'defaultValue':function(){return rs['generate']();}},'autoclose':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'enableCustomerWriting':{'type':Sequelize[_0x43ea('0x6')],'defaultValue':![]},'forwardTranscript':{'type':Sequelize[_0x43ea('0x6')],'defaultValue':![]},'forwardTranscriptMessage':{'type':Sequelize[_0x43ea('0x2')]},'forwardOffline':{'type':Sequelize[_0x43ea('0x6')],'defaultValue':![]},'forwardOfflineAddress':{'type':Sequelize[_0x43ea('0x2')]},'waitingTitle':{'type':Sequelize['STRING'],'defaultValue':_0x43ea('0x20')},'waitingMessage':{'type':Sequelize[_0x43ea('0x2')],'defaultValue':'Please\x20hold\x20and\x20we\x20will\x20answer\x20your\x20request\x20as\x20soon\x20as\x20possible.'},'offlineMessageSubject':{'type':Sequelize[_0x43ea('0x2')],'defaultValue':_0x43ea('0x21')},'offlineMessageBody':{'type':Sequelize[_0x43ea('0x2')],'defaultValue':_0x43ea('0x22')},'enableUnmanagedNote':{'type':Sequelize[_0x43ea('0x6')],'defaultValue':!![]},'unmanagedMessage':{'type':Sequelize[_0x43ea('0x2')],'defaultValue':_0x43ea('0x23')},'skipUnmanaged':{'type':Sequelize['STRING'],'defaultValue':_0x43ea('0x24')},'sendUnmanaged':{'type':Sequelize['STRING'],'defaultValue':'Send'},'enableCustomerAttachment':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'enableCustomerCheckmarks':{'type':Sequelize[_0x43ea('0x6')],'defaultValue':![]},'agentAvatar':{'type':Sequelize[_0x43ea('0xf')]},'showAgentAvatar':{'type':Sequelize[_0x43ea('0x6')],'defaultValue':![]},'timezone':{'type':Sequelize['STRING']},'notificationTemplate':{'type':Sequelize['TEXT'],'defaultValue':function(){return _0x43ea('0x25');}},'notificationSound':{'type':Sequelize[_0x43ea('0x6')],'defaultValue':!![]},'notificationShake':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'hideWhenOffline':{'type':Sequelize[_0x43ea('0x6')],'defaultValue':![]},'agentIdentifier':{'type':Sequelize[_0x43ea('0x2')],'defaultValue':_0x43ea('0x26')},'waitForTheAssignedAgent':{'type':Sequelize[_0x43ea('0xe')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'alignment':{'type':Sequelize['STRING'],'defaultValue':_0x43ea('0x27')},'verticalAlignment':{'type':Sequelize[_0x43ea('0xe')],'defaultValue':0x1e},'messagesAlignment':{'type':Sequelize['STRING'],'defaultValue':_0x43ea('0x28')},'defaultTitle':{'type':Sequelize['STRING']},'customerAvatar':{'type':Sequelize[_0x43ea('0xf')]},'showCustomerAvatar':{'type':Sequelize[_0x43ea('0x6')],'defaultValue':![]},'messageFontSize':{'type':Sequelize[_0x43ea('0xe')],'defaultValue':0xc},'backgroundColor':{'type':Sequelize[_0x43ea('0x2')],'allowNull':![],'defaultValue':_0x43ea('0x29'),'validate':{'notEmpty':!![]}},'queueTransfer':{'type':Sequelize[_0x43ea('0x6')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0x43ea('0xe')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0x43ea('0x6')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0x43ea('0xe')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'systemAlias':{'type':Sequelize['STRING'],'defaultValue':_0x43ea('0x2a')},'systemAvatar':{'type':Sequelize['TEXT']},'mandatoryDispositionPauseId':{'type':Sequelize[_0x43ea('0xe')],'comment':'Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled'},'mandatoryDisposition':{'type':Sequelize[_0x43ea('0x6')],'defaultValue':![],'comment':_0x43ea('0x2b'),'set':function(_0x3f0e2a){if(!_0x3f0e2a)this[_0x43ea('0x1b')](_0x43ea('0x2c'),null);this['setDataValue'](_0x43ea('0x2d'),_0x3f0e2a);}},'vidaooEscalation':{'type':Sequelize[_0x43ea('0x6')],'defaultValue':![]},'vidaooApiKey':{'type':Sequelize[_0x43ea('0x2')]},'vidaooTopic':{'type':Sequelize[_0x43ea('0x2')],'allowNull':![],'defaultValue':'Generated\x20by\x20XCALLY\x20Motion'},'vidaooNote':{'type':Sequelize[_0x43ea('0x2')],'defaultValue':function(){return _0x43ea('0x2e');}},'vidaooMetadata':{'type':Sequelize[_0x43ea('0xf')],'defaultValue':null},'openNewInteraction':{'type':Sequelize[_0x43ea('0x6')],'defaultValue':![],'allowNull':!![]},'subjectOffline':{'type':Sequelize[_0x43ea('0xf')]}};
\ No newline at end of file
+var _0xfbf4=['Please\x20hold\x20and\x20we\x20will\x20answer\x20your\x20request\x20as\x20soon\x20as\x20possible.','You\x20received\x20a\x20new\x20offline\x20message\x20from\x20websiteName.\x20Here\x20you\x20can\x20find\x20the\x20details\x20of\x20the\x20request:','Your\x20request\x20has\x20not\x20been\x20processed.','Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}','website_alias','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','randomstring','STRING','email','#011F6A','#ffffff','BOOLEAN','rounded','Chat','Send','Contact\x20us','INTEGER','TEXT','Form\x20properly\x20submitted','Form\x20submission\x20error','Note','Type\x20a\x20message','Thanks\x20you\x20for\x20your\x20time!','Skip','Feedback','star','thumb','stringify','input','name','text','getDataValue','onlineForm','parse','setDataValue','Comments','offlineForm','All\x20of\x20our\x20agents\x20are\x20busy\x20at\x20this\x20time.\x20Your\x20chat\x20is\x20very\x20important\x20to\x20us.'];(function(_0x492e7e,_0x5d6d3f){var _0x523154=function(_0x32d138){while(--_0x32d138){_0x492e7e['push'](_0x492e7e['shift']());}};_0x523154(++_0x5d6d3f);}(_0xfbf4,0x121));var _0x4fbf=function(_0x5b9ad5,_0x1b8ed6){_0x5b9ad5=_0x5b9ad5-0x0;var _0x40338e=_0xfbf4[_0x5b9ad5];return _0x40338e;};'use strict';var Sequelize=require(_0x4fbf('0x0'));var rs=require(_0x4fbf('0x1'));module['exports']={'name':{'type':Sequelize[_0x4fbf('0x2')],'allowNull':![]},'address':{'type':Sequelize[_0x4fbf('0x2')],'allowNull':![],'unique':'address'},'description':{'type':Sequelize[_0x4fbf('0x2')]},'mapKey':{'type':Sequelize[_0x4fbf('0x2')],'defaultValue':_0x4fbf('0x3')},'mapKeyOffline':{'type':Sequelize[_0x4fbf('0x2')],'defaultValue':'email'},'key':{'type':Sequelize[_0x4fbf('0x2')],'allowNull':![]},'agentAlias':{'type':Sequelize[_0x4fbf('0x2')],'defaultValue':'Agent'},'customerAlias':{'type':Sequelize[_0x4fbf('0x2')],'defaultValue':'Me'},'color':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0x4fbf('0x4'),'validate':{'notEmpty':!![]}},'color_button':{'type':Sequelize[_0x4fbf('0x2')],'allowNull':![],'defaultValue':'#011F6A','validate':{'notEmpty':!![]}},'textColor':{'type':Sequelize[_0x4fbf('0x2')],'allowNull':![],'defaultValue':_0x4fbf('0x5'),'validate':{'notEmpty':!![]}},'fontSize':{'type':Sequelize['INTEGER'],'defaultValue':0xf},'remote':{'type':Sequelize[_0x4fbf('0x2')]},'animation':{'type':Sequelize[_0x4fbf('0x6')],'defaultValue':!![]},'header_shape':{'type':Sequelize['ENUM'](_0x4fbf('0x7'),'squared'),'defaultValue':_0x4fbf('0x7')},'header_online':{'type':Sequelize['STRING'],'defaultValue':'We\x20are\x20here!'},'start_chat_button':{'type':Sequelize[_0x4fbf('0x2')],'defaultValue':_0x4fbf('0x8')},'offline_chat_button':{'type':Sequelize['STRING'],'defaultValue':_0x4fbf('0x9')},'header_offline':{'type':Sequelize[_0x4fbf('0x2')],'defaultValue':_0x4fbf('0xa')},'download_transcript':{'type':Sequelize[_0x4fbf('0x6')],'defaultValue':!![]},'timeout':{'type':Sequelize[_0x4fbf('0xb')],'defaultValue':0x0},'whiteLabel':{'type':Sequelize['STRING'],'defaultValue':'Powered\x20by\x20xCALLY'},'defaultWhiteLabel':{'type':Sequelize[_0x4fbf('0x6')],'defaultValue':!![]},'sitepic':{'type':Sequelize[_0x4fbf('0xc')]},'closingQuestion':{'type':Sequelize[_0x4fbf('0x2')],'defaultValue':'Do\x20you\x20want\x20to\x20close\x20the\x20interaction?'},'formSubmitSuccessMessage':{'type':Sequelize[_0x4fbf('0x2')],'defaultValue':_0x4fbf('0xd')},'formSubmitFailureMessage':{'type':Sequelize['STRING'],'defaultValue':_0x4fbf('0xe')},'noteTitle':{'type':Sequelize[_0x4fbf('0x2')],'defaultValue':_0x4fbf('0xf')},'placeholderMessage':{'type':Sequelize['STRING'],'defaultValue':_0x4fbf('0x10')},'closingMessage':{'type':Sequelize['STRING'],'defaultValue':_0x4fbf('0x11')},'closingMessageButton':{'type':Sequelize[_0x4fbf('0x2')],'defaultValue':'Send'},'skipMessageButton':{'type':Sequelize[_0x4fbf('0x2')],'defaultValue':_0x4fbf('0x12')},'conditionAgreement':{'type':Sequelize[_0x4fbf('0x6')],'defaultValue':![]},'enableRating':{'type':Sequelize[_0x4fbf('0x6')],'defaultValue':![]},'enableFeedback':{'type':Sequelize[_0x4fbf('0x6')],'defaultValue':![]},'enableSendButton':{'type':Sequelize[_0x4fbf('0x6')],'defaultValue':![]},'feedbackTitle':{'type':Sequelize['STRING'],'defaultValue':_0x4fbf('0x13')},'ratingType':{'type':Sequelize['ENUM'](_0x4fbf('0x14'),_0x4fbf('0x15')),'defaultValue':_0x4fbf('0x14')},'ratingStarsNumber':{'type':Sequelize[_0x4fbf('0xb')],'defaultValue':0x5},'onlineForm':{'type':Sequelize[_0x4fbf('0xc')],'defaultValue':function(){return JSON[_0x4fbf('0x16')]({'items':[{'type':_0x4fbf('0x17'),'variable':null,'config':{'placeholder':_0x4fbf('0x18'),'type':_0x4fbf('0x19'),'required':!![]},'props':{'title':_0x4fbf('0x18'),'helpText':''}},{'type':_0x4fbf('0x17'),'props':{'title':_0x4fbf('0x3'),'helpText':''},'config':{'required':!![],'placeholder':_0x4fbf('0x3'),'type':_0x4fbf('0x3')},'variable':null}],'fromKey':0x1});},'get':function(){return this[_0x4fbf('0x1a')](_0x4fbf('0x1b'))?JSON[_0x4fbf('0x1c')](this['getDataValue'](_0x4fbf('0x1b'))):{};},'set':function(_0x830295){return this[_0x4fbf('0x1d')]('onlineForm',JSON[_0x4fbf('0x16')](_0x830295));}},'offlineForm':{'type':Sequelize[_0x4fbf('0xc')],'defaultValue':function(){return JSON[_0x4fbf('0x16')]({'items':[{'type':_0x4fbf('0x17'),'props':{'title':'email','helpText':''},'config':{'required':!![],'placeholder':_0x4fbf('0x3'),'type':_0x4fbf('0x3')},'variable':null},{'type':'textarea','config':{'placeholder':_0x4fbf('0x1e')},'props':{'title':_0x4fbf('0x1e'),'helpText':'Leave\x20your\x20comments'}}],'fromKey':0x0});},'get':function(){return this[_0x4fbf('0x1a')](_0x4fbf('0x1f'))?JSON['parse'](this[_0x4fbf('0x1a')](_0x4fbf('0x1f'))):{};},'set':function(_0x27196f){return this[_0x4fbf('0x1d')](_0x4fbf('0x1f'),JSON['stringify'](_0x27196f));}},'token':{'type':Sequelize[_0x4fbf('0x2')],'defaultValue':function(){return rs['generate']();}},'autoclose':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'enableCustomerWriting':{'type':Sequelize[_0x4fbf('0x6')],'defaultValue':![]},'forwardTranscript':{'type':Sequelize[_0x4fbf('0x6')],'defaultValue':![]},'forwardTranscriptMessage':{'type':Sequelize[_0x4fbf('0x2')]},'forwardOffline':{'type':Sequelize[_0x4fbf('0x6')],'defaultValue':![]},'forwardOfflineAddress':{'type':Sequelize['STRING']},'waitingTitle':{'type':Sequelize['STRING'],'defaultValue':_0x4fbf('0x20')},'waitingMessage':{'type':Sequelize['STRING'],'defaultValue':_0x4fbf('0x21')},'offlineMessageSubject':{'type':Sequelize['STRING'],'defaultValue':'New\x20offline\x20message\x20from\x20websiteName'},'offlineMessageBody':{'type':Sequelize[_0x4fbf('0x2')],'defaultValue':_0x4fbf('0x22')},'enableUnmanagedNote':{'type':Sequelize[_0x4fbf('0x6')],'defaultValue':!![]},'unmanagedMessage':{'type':Sequelize[_0x4fbf('0x2')],'defaultValue':_0x4fbf('0x23')},'skipUnmanaged':{'type':Sequelize[_0x4fbf('0x2')],'defaultValue':_0x4fbf('0x12')},'sendUnmanaged':{'type':Sequelize[_0x4fbf('0x2')],'defaultValue':_0x4fbf('0x9')},'enableCustomerAttachment':{'type':Sequelize[_0x4fbf('0x6')],'defaultValue':![]},'enableCustomerCheckmarks':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'agentAvatar':{'type':Sequelize['TEXT']},'showAgentAvatar':{'type':Sequelize[_0x4fbf('0x6')],'defaultValue':![]},'timezone':{'type':Sequelize[_0x4fbf('0x2')]},'notificationTemplate':{'type':Sequelize['TEXT'],'defaultValue':function(){return _0x4fbf('0x24');}},'notificationSound':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'notificationShake':{'type':Sequelize[_0x4fbf('0x6')],'defaultValue':![]},'hideWhenOffline':{'type':Sequelize[_0x4fbf('0x6')],'defaultValue':![]},'agentIdentifier':{'type':Sequelize['STRING'],'defaultValue':_0x4fbf('0x25')},'waitForTheAssignedAgent':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'alignment':{'type':Sequelize[_0x4fbf('0x2')],'defaultValue':'bottom_right'},'verticalAlignment':{'type':Sequelize[_0x4fbf('0xb')],'defaultValue':0x1e},'messagesAlignment':{'type':Sequelize['STRING'],'defaultValue':_0x4fbf('0x26')},'defaultTitle':{'type':Sequelize['STRING']},'customerAvatar':{'type':Sequelize['TEXT']},'showCustomerAvatar':{'type':Sequelize[_0x4fbf('0x6')],'defaultValue':![]},'messageFontSize':{'type':Sequelize[_0x4fbf('0xb')],'defaultValue':0xc},'backgroundColor':{'type':Sequelize[_0x4fbf('0x2')],'allowNull':![],'defaultValue':_0x4fbf('0x27'),'validate':{'notEmpty':!![]}},'queueTransfer':{'type':Sequelize[_0x4fbf('0x6')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0x4fbf('0xb')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0x4fbf('0x6')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'systemAlias':{'type':Sequelize['STRING'],'defaultValue':'System'},'systemAvatar':{'type':Sequelize['TEXT']},'mandatoryDispositionPauseId':{'type':Sequelize[_0x4fbf('0xb')],'comment':_0x4fbf('0x28')},'mandatoryDisposition':{'type':Sequelize[_0x4fbf('0x6')],'defaultValue':![],'comment':_0x4fbf('0x29'),'set':function(_0x14ac36){if(!_0x14ac36)this[_0x4fbf('0x1d')](_0x4fbf('0x2a'),null);this['setDataValue'](_0x4fbf('0x2b'),_0x14ac36);}},'vidaooEscalation':{'type':Sequelize[_0x4fbf('0x6')],'defaultValue':![]},'vidaooApiKey':{'type':Sequelize['STRING']},'vidaooTopic':{'type':Sequelize[_0x4fbf('0x2')],'allowNull':![],'defaultValue':_0x4fbf('0x2c')},'vidaooNote':{'type':Sequelize['STRING'],'defaultValue':function(){return _0x4fbf('0x2d');}},'vidaooMetadata':{'type':Sequelize[_0x4fbf('0xc')],'defaultValue':null},'openNewInteraction':{'type':Sequelize['BOOLEAN'],'defaultValue':![],'allowNull':!![]},'subjectOffline':{'type':Sequelize[_0x4fbf('0xc')]}};
\ No newline at end of file
diff --git a/server/api/chatWebsite/chatWebsite.controller.js b/server/api/chatWebsite/chatWebsite.controller.js
index 51355f2..9127adb 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 _0x03fe=['x-real-ip','connection','remoteAddress','referer','replace','alignment','color','color_button','addApplications','transaction','getApplications','addProactiveActions','chatProactiveAction','ChatProactiveAction','online','false','onlineForm','items','fromKey','Attachment','Attachments','addAgents','emit','removeAgents','isArray','userChatWebsite:remove','getAgents','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','socket.io-emitter','./chatWebsite.socket','register','jayson/promise','client','http','request','then','info','request\x20sent','debug','ChatWebsite,\x20%s,\x20%s,\x20%s','stringify','error','code','message','ChatWebsite,\x20%s,\x20%s','result','sendStatus','status','json','offset','undefined','limit','count','set','Content-Range','apply','save','update','ChatWebsites','destroy','end','name','index','mandatoryDispositionPause','map','ChatWebsite','rawAttributes','fieldName','key','model','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','where','pick','type','VIRTUAL','filter','merge','options','includeAll','include','rows','catch','show','params','Pause','keys','find','create','body','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','autoAssociation','UserProfileResource','describe','ChatWebsiteId','Disposition','findOne','sort','removeDispositions','addAnswer','CannedAnswer','order','findAll','removeAnswers','ids','sitepic','file','filename','addAvatar','agentAvatar','customerAvatar','addSystemAvatar','getLogo','join','getLicense','custom','root','server/files/images/logos/','download','server/files/images/avatars/default_avatar.png','isNil','existsSync','getCustomerAvatar','server/files/images/avatars/customer_avatar.png','showCustomerAvatar','server/files/images/avatars/','getSystemAvatar','server/files/images/avatars/system_avatar.png','systemAvatar','notify','user-agent-parser','setUA','headers','user-agent','getResult','chat','Sequelize','ValidationError','no\x20available\x20attributes','difference','createdAt','updatedAt','ListId','from\x20is\x20mandatory','body\x20is\x20mandatory\x20and\x20not\x20empty','mapKey','mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','includes','mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','from','CmList','CmContact','Contacts','DESC','ChatApplication','Applications','List','account','list','orderBy','applications','priority','contact','customerIp','cf-connecting-ip','first','x-forwarded-for','split','firstName','lastName','x-real-port','browser','version','%s\x20%s','unknown','format','device','vendor','%s\x20%s\x20%s','threadId','ChatInteraction','externalUrl','ContactId','interaction','spread','messageId','created','autoclose','push','close','unmanaged','*,*,*,*','ChatMessage','AttachmentId','UserId','User','unshift','agent','forcedOwnership','Start','startRouting','EventManager','offline','CompanyId','send','mapKeyOffline','mapKeyOffline\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','mapKeyOffline\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','MailAccount','findOrCreate','readFileSync','server/files/templates/chatOfflineMessage.ejs','utf8','render','toPairs','offlineMessageBody','ChatOfflineMessage','originalname','server','files','attachments','offline-chat','basename','openNewInteraction','sequelize','bulkCreate','MailServerOut','Smtp','forwardOffline','forwardOfflineAddress','service','host','port','secure','pass','SendMail','\x22%s\x22\x20<%s>','email','offlineMessageSubject','MailAccountId','mimetype','subjectOffline','NotifyMailAccount','remove','Could\x20not\x20remove\x20attachment\x20file','addInteraction','omit','getInteractions','Contact','Owner','fullname','Tag','Tags','tag','Command','getSnippet','timezone','iftime\x20%s,%s','interval','iftime\x20%s','[%s][INTERVAL][%s]\x20%s\x20%s\x20(%s)','ONLINE','OFFLINE','inspect','No\x20timezone','Interval','Intervals','getProactiveActions','virtual','License','all','some','server/files/chat/iframe.ejs','remote'];(function(_0x946d1f,_0x1cf238){var _0x546e1b=function(_0x180ea1){while(--_0x180ea1){_0x946d1f['push'](_0x946d1f['shift']());}};_0x546e1b(++_0x1cf238);}(_0x03fe,0x154));var _0xe03f=function(_0x5719dc,_0x4bab45){_0x5719dc=_0x5719dc-0x0;var _0x4349d0=_0x03fe[_0x5719dc];return _0x4349d0;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xe03f('0x0'));var zipdir=require(_0xe03f('0x1'));var jsonpatch=require(_0xe03f('0x2'));var rp=require(_0xe03f('0x3'));var moment=require(_0xe03f('0x4'));var BPromise=require(_0xe03f('0x5'));var Mustache=require(_0xe03f('0x6'));var util=require(_0xe03f('0x7'));var path=require(_0xe03f('0x8'));var sox=require('sox');var csv=require(_0xe03f('0x9'));var ejs=require(_0xe03f('0xa'));var fs=require('fs');var fs_extra=require(_0xe03f('0xb'));var _=require(_0xe03f('0xc'));var squel=require(_0xe03f('0xd'));var crypto=require(_0xe03f('0xe'));var jsforce=require(_0xe03f('0xf'));var deskjs=require(_0xe03f('0x10'));var toCsv=require(_0xe03f('0x9'));var querystring=require(_0xe03f('0x11'));var Papa=require(_0xe03f('0x12'));var Redis=require('ioredis');var authService=require(_0xe03f('0x13'));var qs=require(_0xe03f('0x14'));var as=require(_0xe03f('0x15'));var hardwareService=require(_0xe03f('0x16'));var logger=require('../../config/logger')(_0xe03f('0x17'));var utils=require(_0xe03f('0x18'));var config=require(_0xe03f('0x19'));var licenseUtil=require(_0xe03f('0x1a'));var db=require(_0xe03f('0x1b'))['db'];config[_0xe03f('0x1c')]=_[_0xe03f('0x1d')](config[_0xe03f('0x1c')],{'host':'localhost','port':0x18eb});var socket=require(_0xe03f('0x1e'))(new Redis(config['redis']));require(_0xe03f('0x1f'))[_0xe03f('0x20')](socket);var jayson=require(_0xe03f('0x21'));var client=jayson['client']['http']({'port':0x232c});var client9002=jayson[_0xe03f('0x22')][_0xe03f('0x23')]({'port':0x232a});var client9003=jayson[_0xe03f('0x22')]['http']({'port':0x232b});var client9001=jayson[_0xe03f('0x22')][_0xe03f('0x23')]({'port':0x2329});function respondWithRpcPromise(_0xcba94c,_0x585916,_0x72b466,_0x5abdd3){return new BPromise(function(_0x2a57da,_0x4887a2){var _0x12b570=_0x5abdd3||client;return _0x12b570[_0xe03f('0x24')](_0xcba94c,_0x72b466)[_0xe03f('0x25')](function(_0x501388){logger[_0xe03f('0x26')]('ChatWebsite,\x20%s,\x20%s',_0x585916,_0xe03f('0x27'));logger[_0xe03f('0x28')](_0xe03f('0x29'),_0x585916,'request\x20sent',JSON[_0xe03f('0x2a')](_0x501388));if(_0x501388[_0xe03f('0x2b')]){if(_0x501388[_0xe03f('0x2b')][_0xe03f('0x2c')]===0x1f4){logger[_0xe03f('0x2b')]('ChatWebsite,\x20%s,\x20%s',_0x585916,_0x501388[_0xe03f('0x2b')]['message']);return _0x4887a2(_0x501388['error'][_0xe03f('0x2d')]);}logger['error'](_0xe03f('0x2e'),_0x585916,_0x501388[_0xe03f('0x2b')][_0xe03f('0x2d')]);return _0x2a57da(_0x501388[_0xe03f('0x2b')][_0xe03f('0x2d')]);}else{logger[_0xe03f('0x26')](_0xe03f('0x2e'),_0x585916,_0xe03f('0x27'));_0x2a57da(_0x501388[_0xe03f('0x2f')][_0xe03f('0x2d')]);}})['catch'](function(_0x468dae){logger['error'](_0xe03f('0x2e'),_0x585916,_0x468dae);_0x4887a2(_0x468dae);});});}function respondWithStatusCode(_0x3eb2b8,_0x1efbe9){_0x1efbe9=_0x1efbe9||0xcc;return function(_0x1cea86){if(_0x1cea86){return _0x3eb2b8[_0xe03f('0x30')](_0x1efbe9);}return _0x3eb2b8[_0xe03f('0x31')](_0x1efbe9)['end']();};}function respondWithResult(_0x36f881,_0x108f6b){_0x108f6b=_0x108f6b||0xc8;return function(_0x378d71){if(_0x378d71){return _0x36f881[_0xe03f('0x31')](_0x108f6b)[_0xe03f('0x32')](_0x378d71);}};}function respondWithFilteredResult(_0xd6413,_0x2fdfd8){return function(_0x25af93){if(_0x25af93){var _0x3a9190=typeof _0x2fdfd8[_0xe03f('0x33')]===_0xe03f('0x34')&&typeof _0x2fdfd8[_0xe03f('0x35')]===_0xe03f('0x34');var _0x106925=_0x25af93[_0xe03f('0x36')];var _0x191a41=_0x3a9190?0x0:_0x2fdfd8['offset'];var _0x553bf3=_0x3a9190?_0x25af93[_0xe03f('0x36')]:_0x2fdfd8[_0xe03f('0x33')]+_0x2fdfd8['limit'];var _0x20d324;if(_0x553bf3>=_0x106925){_0x553bf3=_0x106925;_0x20d324=0xc8;}else{_0x20d324=0xce;}_0xd6413[_0xe03f('0x31')](_0x20d324);return _0xd6413[_0xe03f('0x37')](_0xe03f('0x38'),_0x191a41+'-'+_0x553bf3+'/'+_0x106925)[_0xe03f('0x32')](_0x25af93);}return null;};}function patchUpdates(_0x48b5ad){return function(_0x3fe2c2){try{jsonpatch[_0xe03f('0x39')](_0x3fe2c2,_0x48b5ad,!![]);}catch(_0x355ff5){return BPromise['reject'](_0x355ff5);}return _0x3fe2c2[_0xe03f('0x3a')]();};}function saveUpdates(_0x3b616f,_0x3ca58f){return function(_0x573c8e){if(_0x573c8e){return _0x573c8e[_0xe03f('0x3b')](_0x3b616f)[_0xe03f('0x25')](function(_0x1e9849){return _0x1e9849;});}return null;};}function removeEntity(_0x1f21f3,_0x19fc7d){return function(_0x2edbb3){if(_0x2edbb3){return _0x2edbb3['destroy']()[_0xe03f('0x25')](function(){var _0x182050=_0x2edbb3['get']({'plain':!![]});var _0x1329b9=_0xe03f('0x3c');return db['UserProfileResource'][_0xe03f('0x3d')]({'where':{'type':_0x1329b9,'resourceId':_0x182050['id']}})['then'](function(){return _0x2edbb3;});})['then'](function(){_0x1f21f3[_0xe03f('0x31')](0xcc)[_0xe03f('0x3e')]();});}};}function handleEntityNotFound(_0x168b80,_0x4c49ce){return function(_0x37b6cf){if(!_0x37b6cf){_0x168b80[_0xe03f('0x30')](0x194);}return _0x37b6cf;};}function handleError(_0x1fc0c3,_0xb90aa3){_0xb90aa3=_0xb90aa3||0x1f4;return function(_0x285074){logger['error'](_0x285074['stack']);if(_0x285074['name']){delete _0x285074[_0xe03f('0x3f')];}_0x1fc0c3[_0xe03f('0x31')](_0xb90aa3)['send'](_0x285074);};}exports[_0xe03f('0x40')]=function(_0x85e20f,_0x468e3a){var _0x1b484b={'include':[{'model':db['Pause'],'as':_0xe03f('0x41')}]},_0x558fa2={},_0x23ca5a={'count':0x0,'rows':[]};var _0x5abd60=_[_0xe03f('0x42')](db[_0xe03f('0x43')][_0xe03f('0x44')],function(_0x33fd70){return{'name':_0x33fd70[_0xe03f('0x45')],'type':_0x33fd70['type'][_0xe03f('0x46')]};});_0x558fa2[_0xe03f('0x47')]=_[_0xe03f('0x42')](_0x5abd60,_0xe03f('0x3f'));_0x558fa2['query']=_['keys'](_0x85e20f[_0xe03f('0x48')]);_0x558fa2[_0xe03f('0x49')]=_[_0xe03f('0x4a')](_0x558fa2[_0xe03f('0x47')],_0x558fa2[_0xe03f('0x48')]);_0x1b484b[_0xe03f('0x4b')]=_['intersection'](_0x558fa2[_0xe03f('0x47')],qs[_0xe03f('0x4c')](_0x85e20f[_0xe03f('0x48')][_0xe03f('0x4c')]));_0x1b484b['attributes']=_0x1b484b[_0xe03f('0x4b')][_0xe03f('0x4d')]?_0x1b484b['attributes']:_0x558fa2['model'];if(!_0x85e20f['query'][_0xe03f('0x4e')](_0xe03f('0x4f'))){_0x1b484b[_0xe03f('0x35')]=qs['limit'](_0x85e20f['query']['limit']);_0x1b484b['offset']=qs['offset'](_0x85e20f[_0xe03f('0x48')][_0xe03f('0x33')]);}_0x1b484b['order']=qs['sort'](_0x85e20f['query']['sort']);_0x1b484b[_0xe03f('0x50')]=qs[_0xe03f('0x49')](_[_0xe03f('0x51')](_0x85e20f[_0xe03f('0x48')],_0x558fa2[_0xe03f('0x49')]),_0x5abd60);if(_0x85e20f[_0xe03f('0x48')]['filter']){_0x1b484b['where']=_['merge'](_0x1b484b[_0xe03f('0x50')],{'$or':_[_0xe03f('0x42')](_0x5abd60,function(_0x4888ef){if(_0x4888ef[_0xe03f('0x52')]!==_0xe03f('0x53')){var _0x6b4dca={};_0x6b4dca[_0x4888ef[_0xe03f('0x3f')]]={'$like':'%'+_0x85e20f[_0xe03f('0x48')][_0xe03f('0x54')]+'%'};return _0x6b4dca;}})});}_0x1b484b=_[_0xe03f('0x55')]({},_0x1b484b,_0x85e20f[_0xe03f('0x56')]);var _0xeee97c={'where':_0x1b484b[_0xe03f('0x50')]};return db[_0xe03f('0x43')][_0xe03f('0x36')](_0xeee97c)['then'](function(_0x52e9cd){_0x23ca5a[_0xe03f('0x36')]=_0x52e9cd;if(_0x85e20f[_0xe03f('0x48')][_0xe03f('0x57')]){_0x1b484b[_0xe03f('0x58')]=[{'all':!![]}];}return db[_0xe03f('0x43')]['findAll'](_0x1b484b);})[_0xe03f('0x25')](function(_0x5ae653){_0x23ca5a[_0xe03f('0x59')]=_0x5ae653;return _0x23ca5a;})[_0xe03f('0x25')](respondWithFilteredResult(_0x468e3a,_0x1b484b))[_0xe03f('0x5a')](handleError(_0x468e3a,null));};exports[_0xe03f('0x5b')]=function(_0x1d6e7f,_0x4d974c){var _0x11d486={'raw':![],'where':{'id':_0x1d6e7f[_0xe03f('0x5c')]['id']},'include':[{'model':db[_0xe03f('0x5d')],'as':'mandatoryDispositionPause'}]},_0x15d53b={};_0x15d53b[_0xe03f('0x47')]=_[_0xe03f('0x5e')](db[_0xe03f('0x43')][_0xe03f('0x44')]);_0x15d53b[_0xe03f('0x48')]=_[_0xe03f('0x5e')](_0x1d6e7f['query']);_0x15d53b[_0xe03f('0x49')]=_[_0xe03f('0x4a')](_0x15d53b[_0xe03f('0x47')],_0x15d53b[_0xe03f('0x48')]);_0x11d486[_0xe03f('0x4b')]=_[_0xe03f('0x4a')](_0x15d53b[_0xe03f('0x47')],qs['fields'](_0x1d6e7f[_0xe03f('0x48')]['fields']));_0x11d486[_0xe03f('0x4b')]=_0x11d486[_0xe03f('0x4b')][_0xe03f('0x4d')]?_0x11d486[_0xe03f('0x4b')]:_0x15d53b['model'];if(_0x1d6e7f['query'][_0xe03f('0x57')]){_0x11d486[_0xe03f('0x58')]=[{'all':!![]}];}_0x11d486=_[_0xe03f('0x55')]({},_0x11d486,_0x1d6e7f[_0xe03f('0x56')]);return db['ChatWebsite'][_0xe03f('0x5f')](_0x11d486)['then'](handleEntityNotFound(_0x4d974c,null))[_0xe03f('0x25')](respondWithResult(_0x4d974c,null))['catch'](handleError(_0x4d974c,null));};exports[_0xe03f('0x60')]=function(_0xa19092,_0x3370e9){return db[_0xe03f('0x43')][_0xe03f('0x60')](_0xa19092[_0xe03f('0x61')],{})[_0xe03f('0x25')](function(_0x91863f){var _0x96d233=_0xa19092[_0xe03f('0x62')][_0xe03f('0x63')]({'plain':!![]});if(!_0x96d233)throw new Error(_0xe03f('0x64'));if(_0x96d233[_0xe03f('0x65')]===_0xe03f('0x62')){var _0x2b6035=_0x91863f['get']({'plain':!![]});var _0x13e843=_0xe03f('0x3c');return db[_0xe03f('0x66')][_0xe03f('0x5f')]({'where':{'name':_0x13e843,'userProfileId':_0x96d233['userProfileId']},'raw':!![]})[_0xe03f('0x25')](function(_0x438f05){if(_0x438f05&&_0x438f05[_0xe03f('0x67')]===0x0){return db[_0xe03f('0x68')]['create']({'name':_0x2b6035[_0xe03f('0x3f')],'resourceId':_0x2b6035['id'],'type':_0x438f05[_0xe03f('0x3f')],'sectionId':_0x438f05['id']},{})['then'](function(){return _0x91863f;});}else{return _0x91863f;}})['catch'](function(_0x131d29){logger[_0xe03f('0x2b')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x131d29);throw _0x131d29;});}return _0x91863f;})['then'](respondWithResult(_0x3370e9,0xc9))[_0xe03f('0x5a')](handleError(_0x3370e9,null));};exports['update']=function(_0x3eba41,_0x35b6dd){if(_0x3eba41[_0xe03f('0x61')]['id']){delete _0x3eba41[_0xe03f('0x61')]['id'];}return db['ChatWebsite'][_0xe03f('0x5f')]({'where':{'id':_0x3eba41[_0xe03f('0x5c')]['id']},'include':[{'model':db[_0xe03f('0x5d')],'as':_0xe03f('0x41')}]})['then'](handleEntityNotFound(_0x35b6dd,null))[_0xe03f('0x25')](saveUpdates(_0x3eba41[_0xe03f('0x61')],null))[_0xe03f('0x25')](respondWithResult(_0x35b6dd,null))[_0xe03f('0x5a')](handleError(_0x35b6dd,null));};exports[_0xe03f('0x3d')]=function(_0x5dcb1c,_0x5d2e8e){return db[_0xe03f('0x43')]['find']({'where':{'id':_0x5dcb1c[_0xe03f('0x5c')]['id']}})[_0xe03f('0x25')](handleEntityNotFound(_0x5d2e8e,null))[_0xe03f('0x25')](removeEntity(_0x5d2e8e,null))['catch'](handleError(_0x5d2e8e,null));};exports[_0xe03f('0x69')]=function(_0x2266af,_0x216f3a){return db['ChatWebsite']['describe']()[_0xe03f('0x25')](respondWithResult(_0x216f3a,null))['catch'](handleError(_0x216f3a,null));};exports['addDisposition']=function(_0x5b93c8,_0x374f9a,_0x395d89){if(_0x5b93c8[_0xe03f('0x61')]['id']){delete _0x5b93c8[_0xe03f('0x61')]['id'];}return db['ChatWebsite']['find']({'where':{'id':_0x5b93c8['params']['id']}})['then'](handleEntityNotFound(_0x374f9a,null))[_0xe03f('0x25')](function(_0x289099){if(_0x289099){_0x5b93c8[_0xe03f('0x61')][_0xe03f('0x6a')]=_0x289099['id'];return db[_0xe03f('0x6b')][_0xe03f('0x60')](_0x5b93c8[_0xe03f('0x61')]);}})[_0xe03f('0x25')](respondWithResult(_0x374f9a,null))['catch'](handleError(_0x374f9a,null));};exports['getDispositions']=function(_0x4dd18d,_0x4ea623,_0x347ed8){var _0x59f28c={'raw':![],'where':{}};var _0xd0f594={};var _0x3b66ff={'count':0x0,'rows':[]};return db[_0xe03f('0x43')][_0xe03f('0x6c')]({'where':{'id':_0x4dd18d['params']['id']}})[_0xe03f('0x25')](handleEntityNotFound(_0x4ea623,null))[_0xe03f('0x25')](function(_0x2dc9ed){if(_0x2dc9ed){_0xd0f594['model']=_['keys'](db[_0xe03f('0x6b')]['rawAttributes']);_0xd0f594[_0xe03f('0x48')]=_[_0xe03f('0x5e')](_0x4dd18d[_0xe03f('0x48')]);_0xd0f594[_0xe03f('0x49')]=_['intersection'](_0xd0f594['model'],_0xd0f594[_0xe03f('0x48')]);_0x59f28c[_0xe03f('0x4b')]=_[_0xe03f('0x4a')](_0xd0f594[_0xe03f('0x47')],qs[_0xe03f('0x4c')](_0x4dd18d[_0xe03f('0x48')]['fields']));_0x59f28c[_0xe03f('0x4b')]=_0x59f28c['attributes'][_0xe03f('0x4d')]?_0x59f28c['attributes']:_0xd0f594[_0xe03f('0x47')];if(!_0x4dd18d[_0xe03f('0x48')][_0xe03f('0x4e')](_0xe03f('0x4f'))){_0x59f28c[_0xe03f('0x35')]=qs[_0xe03f('0x35')](_0x4dd18d[_0xe03f('0x48')][_0xe03f('0x35')]);_0x59f28c[_0xe03f('0x33')]=qs[_0xe03f('0x33')](_0x4dd18d[_0xe03f('0x48')][_0xe03f('0x33')]);}_0x59f28c['order']=qs[_0xe03f('0x6d')](_0x4dd18d['query']['sort']);_0x59f28c[_0xe03f('0x50')]=qs['filters'](_[_0xe03f('0x51')](_0x4dd18d[_0xe03f('0x48')],_0xd0f594[_0xe03f('0x49')]));_0x59f28c[_0xe03f('0x50')][_0xe03f('0x6a')]=_0x2dc9ed['id'];if(_0x4dd18d[_0xe03f('0x48')][_0xe03f('0x54')]){_0x59f28c[_0xe03f('0x50')]=_[_0xe03f('0x55')](_0x59f28c[_0xe03f('0x50')],{'$or':_[_0xe03f('0x42')](_0x59f28c[_0xe03f('0x4b')],function(_0x2eb9db){var _0x510437={};_0x510437[_0x2eb9db]={'$like':'%'+_0x4dd18d[_0xe03f('0x48')][_0xe03f('0x54')]+'%'};return _0x510437;})});}_0x59f28c=_['merge']({},_0x59f28c,_0x4dd18d[_0xe03f('0x56')]);return db['Disposition'][_0xe03f('0x36')]({'where':_0x59f28c[_0xe03f('0x50')]})[_0xe03f('0x25')](function(_0x2ad7ee){_0x3b66ff['count']=_0x2ad7ee;if(_0x4dd18d[_0xe03f('0x48')][_0xe03f('0x57')]){_0x59f28c['include']=[{'all':!![]}];}return db[_0xe03f('0x6b')]['findAll'](_0x59f28c);})['then'](function(_0x2fef60){_0x3b66ff[_0xe03f('0x59')]=_0x2fef60;return _0x3b66ff;});}})[_0xe03f('0x25')](respondWithFilteredResult(_0x4ea623,_0x59f28c))['catch'](handleError(_0x4ea623,null));};exports[_0xe03f('0x6e')]=function(_0x44f703,_0x13b774,_0x2dd2b2){return db[_0xe03f('0x43')][_0xe03f('0x5f')]({'where':{'id':_0x44f703[_0xe03f('0x5c')]['id']}})['then'](handleEntityNotFound(_0x13b774,null))[_0xe03f('0x25')](function(_0x4dfafa){if(_0x4dfafa){return _0x4dfafa['removeDispositions'](_0x44f703['query']['ids']);}})[_0xe03f('0x25')](respondWithStatusCode(_0x13b774,null))[_0xe03f('0x5a')](handleError(_0x13b774,null));};exports[_0xe03f('0x6f')]=function(_0x22ec7e,_0x390055,_0x5de7d4){if(_0x22ec7e[_0xe03f('0x61')]['id']){delete _0x22ec7e[_0xe03f('0x61')]['id'];}return db['ChatWebsite'][_0xe03f('0x5f')]({'where':{'id':_0x22ec7e['params']['id']}})[_0xe03f('0x25')](handleEntityNotFound(_0x390055,null))[_0xe03f('0x25')](function(_0x13d928){if(_0x13d928){_0x22ec7e[_0xe03f('0x61')][_0xe03f('0x6a')]=_0x13d928['id'];return db[_0xe03f('0x70')][_0xe03f('0x60')](_0x22ec7e[_0xe03f('0x61')]);}})[_0xe03f('0x25')](respondWithResult(_0x390055,null))[_0xe03f('0x5a')](handleError(_0x390055,null));};exports['getAnswers']=function(_0x5c1cbd,_0x22a4e2,_0x2ac303){var _0x9cb54b={'raw':![],'where':{}};var _0x2a22d2={};var _0x59a8df={'count':0x0,'rows':[]};return db[_0xe03f('0x43')]['findOne']({'where':{'id':_0x5c1cbd[_0xe03f('0x5c')]['id']}})[_0xe03f('0x25')](handleEntityNotFound(_0x22a4e2,null))[_0xe03f('0x25')](function(_0x167295){if(_0x167295){_0x2a22d2[_0xe03f('0x47')]=_[_0xe03f('0x5e')](db[_0xe03f('0x70')][_0xe03f('0x44')]);_0x2a22d2[_0xe03f('0x48')]=_['keys'](_0x5c1cbd[_0xe03f('0x48')]);_0x2a22d2[_0xe03f('0x49')]=_[_0xe03f('0x4a')](_0x2a22d2[_0xe03f('0x47')],_0x2a22d2[_0xe03f('0x48')]);_0x9cb54b[_0xe03f('0x4b')]=_['intersection'](_0x2a22d2[_0xe03f('0x47')],qs[_0xe03f('0x4c')](_0x5c1cbd[_0xe03f('0x48')][_0xe03f('0x4c')]));_0x9cb54b[_0xe03f('0x4b')]=_0x9cb54b[_0xe03f('0x4b')]['length']?_0x9cb54b[_0xe03f('0x4b')]:_0x2a22d2[_0xe03f('0x47')];if(!_0x5c1cbd['query'][_0xe03f('0x4e')]('nolimit')){_0x9cb54b['limit']=qs['limit'](_0x5c1cbd['query'][_0xe03f('0x35')]);_0x9cb54b['offset']=qs['offset'](_0x5c1cbd[_0xe03f('0x48')][_0xe03f('0x33')]);}_0x9cb54b[_0xe03f('0x71')]=qs['sort'](_0x5c1cbd[_0xe03f('0x48')][_0xe03f('0x6d')]);_0x9cb54b[_0xe03f('0x50')]=qs[_0xe03f('0x49')](_[_0xe03f('0x51')](_0x5c1cbd[_0xe03f('0x48')],_0x2a22d2[_0xe03f('0x49')]));_0x9cb54b['where'][_0xe03f('0x6a')]=_0x167295['id'];if(_0x5c1cbd[_0xe03f('0x48')][_0xe03f('0x54')]){_0x9cb54b['where']=_[_0xe03f('0x55')](_0x9cb54b[_0xe03f('0x50')],{'$or':_['map'](_0x9cb54b[_0xe03f('0x4b')],function(_0x5190a2){var _0x3b790b={};_0x3b790b[_0x5190a2]={'$like':'%'+_0x5c1cbd[_0xe03f('0x48')][_0xe03f('0x54')]+'%'};return _0x3b790b;})});}_0x9cb54b=_['merge']({},_0x9cb54b,_0x5c1cbd['options']);return db[_0xe03f('0x70')][_0xe03f('0x36')]({'where':_0x9cb54b[_0xe03f('0x50')]})[_0xe03f('0x25')](function(_0x19c83a){_0x59a8df[_0xe03f('0x36')]=_0x19c83a;if(_0x5c1cbd[_0xe03f('0x48')][_0xe03f('0x57')]){_0x9cb54b['include']=[{'all':!![]}];}return db[_0xe03f('0x70')][_0xe03f('0x72')](_0x9cb54b);})[_0xe03f('0x25')](function(_0x489e58){_0x59a8df['rows']=_0x489e58;return _0x59a8df;});}})[_0xe03f('0x25')](respondWithFilteredResult(_0x22a4e2,_0x9cb54b))[_0xe03f('0x5a')](handleError(_0x22a4e2,null));};exports[_0xe03f('0x73')]=function(_0x35ad8c,_0x1d5bc1,_0x4ddf71){return db[_0xe03f('0x43')][_0xe03f('0x5f')]({'where':{'id':_0x35ad8c['params']['id']}})[_0xe03f('0x25')](handleEntityNotFound(_0x1d5bc1,null))[_0xe03f('0x25')](function(_0xbcc8b7){if(_0xbcc8b7){return _0xbcc8b7[_0xe03f('0x73')](_0x35ad8c[_0xe03f('0x48')][_0xe03f('0x74')]);}})[_0xe03f('0x25')](respondWithStatusCode(_0x1d5bc1,null))[_0xe03f('0x5a')](handleError(_0x1d5bc1,null));};exports['addLogo']=function(_0x22922b,_0x49ff47,_0x28368d){_0x22922b[_0xe03f('0x61')][_0xe03f('0x75')]=_0x22922b[_0xe03f('0x76')][_0xe03f('0x77')];return db[_0xe03f('0x43')][_0xe03f('0x5f')]({'where':{'id':_0x22922b[_0xe03f('0x5c')]['id']}})[_0xe03f('0x25')](handleEntityNotFound(_0x49ff47,null))[_0xe03f('0x25')](saveUpdates(_0x22922b[_0xe03f('0x61')],null))['then'](respondWithResult(_0x49ff47,null))[_0xe03f('0x5a')](handleError(_0x49ff47,null));};exports[_0xe03f('0x78')]=function(_0x32e65b,_0x3067c1,_0x27e38b){_0x32e65b[_0xe03f('0x61')][_0xe03f('0x79')]=_0x32e65b['file'][_0xe03f('0x77')];return db['ChatWebsite'][_0xe03f('0x5f')]({'where':{'id':_0x32e65b[_0xe03f('0x5c')]['id']}})['then'](handleEntityNotFound(_0x3067c1,null))[_0xe03f('0x25')](saveUpdates(_0x32e65b['body'],null))['then'](respondWithResult(_0x3067c1,null))[_0xe03f('0x5a')](handleError(_0x3067c1,null));};exports['addCustomerAvatar']=function(_0x299295,_0x35acd1,_0x1202ca){_0x299295[_0xe03f('0x61')][_0xe03f('0x7a')]=_0x299295[_0xe03f('0x76')][_0xe03f('0x77')];return db[_0xe03f('0x43')][_0xe03f('0x5f')]({'where':{'id':_0x299295[_0xe03f('0x5c')]['id']}})['then'](handleEntityNotFound(_0x35acd1,null))['then'](saveUpdates(_0x299295[_0xe03f('0x61')],null))[_0xe03f('0x25')](respondWithResult(_0x35acd1,null))[_0xe03f('0x5a')](handleError(_0x35acd1,null));};exports[_0xe03f('0x7b')]=function(_0x1b076b,_0x1ed334,_0x462432){_0x1b076b[_0xe03f('0x61')]['systemAvatar']=_0x1b076b[_0xe03f('0x76')][_0xe03f('0x77')];return db['ChatWebsite']['find']({'where':{'id':_0x1b076b[_0xe03f('0x5c')]['id']}})[_0xe03f('0x25')](handleEntityNotFound(_0x1ed334,null))[_0xe03f('0x25')](saveUpdates(_0x1b076b[_0xe03f('0x61')],null))[_0xe03f('0x25')](respondWithResult(_0x1ed334,null))[_0xe03f('0x5a')](handleError(_0x1ed334,null));};exports[_0xe03f('0x7c')]=function(_0x47695c,_0x1df6ca,_0x58fdbc){var _0x2d76a5=path[_0xe03f('0x7d')](config['root'],'server/files/images/logos/default_logo.svg');var _0x3e2115={'where':{'id':_0x47695c[_0xe03f('0x5c')]['id']},'attributes':['id',_0xe03f('0x75')],'raw':!![]};var _0x192ba4=![];return require(_0xe03f('0x1a'))[_0xe03f('0x7e')]()['then'](function(_0x5c188d){if(_0x5c188d){_0x192ba4=_0x5c188d[_0xe03f('0x7f')];}})[_0xe03f('0x25')](function(){return db[_0xe03f('0x43')][_0xe03f('0x5f')](_0x3e2115);})['then'](handleEntityNotFound(_0x1df6ca,null))[_0xe03f('0x25')](function(_0x305581){if(_0x305581){if(!_['isNil'](_0x305581[_0xe03f('0x75')])){if(fs['existsSync'](path[_0xe03f('0x7d')](config[_0xe03f('0x80')],_0xe03f('0x81'),_0x305581[_0xe03f('0x75')]))&&_0x192ba4){_0x2d76a5=path[_0xe03f('0x7d')](config['root'],_0xe03f('0x81'),_0x305581[_0xe03f('0x75')]);}}return _0x1df6ca[_0xe03f('0x82')](_0x2d76a5);}})[_0xe03f('0x5a')](handleError(_0x1df6ca,null));};exports['getAvatar']=function(_0x32b902,_0x147df1,_0x2dccee){var _0xb9839f=path[_0xe03f('0x7d')](config[_0xe03f('0x80')],_0xe03f('0x83'));var _0x1fcb96={'where':{'id':_0x32b902['params']['id']},'attributes':['id',_0xe03f('0x79')],'raw':!![]};return db['ChatWebsite'][_0xe03f('0x5f')](_0x1fcb96)[_0xe03f('0x25')](handleEntityNotFound(_0x147df1,null))[_0xe03f('0x25')](function(_0x4995bc){if(_0x4995bc){if(!_[_0xe03f('0x84')](_0x4995bc['agentAvatar'])){if(fs[_0xe03f('0x85')](path[_0xe03f('0x7d')](config[_0xe03f('0x80')],'server/files/images/avatars/',_0x4995bc['agentAvatar']))){_0xb9839f=path['join'](config[_0xe03f('0x80')],'server/files/images/avatars/',_0x4995bc[_0xe03f('0x79')]);}}return _0x147df1[_0xe03f('0x82')](_0xb9839f);}})[_0xe03f('0x5a')](handleError(_0x147df1,null));};exports[_0xe03f('0x86')]=function(_0x22d3b3,_0x8acddb,_0x5729cd){var _0x1d94ba=path['join'](config[_0xe03f('0x80')],_0xe03f('0x87'));var _0x3ece64={'where':{'id':_0x22d3b3[_0xe03f('0x5c')]['id']},'attributes':['id','customerAvatar',_0xe03f('0x88')],'raw':!![]};return db[_0xe03f('0x43')]['find'](_0x3ece64)[_0xe03f('0x25')](handleEntityNotFound(_0x8acddb,null))[_0xe03f('0x25')](function(_0x5ee5a4){if(_0x5ee5a4){if(!_[_0xe03f('0x84')](_0x5ee5a4[_0xe03f('0x7a')])){if(fs[_0xe03f('0x85')](path[_0xe03f('0x7d')](config[_0xe03f('0x80')],_0xe03f('0x89'),_0x5ee5a4[_0xe03f('0x7a')]))&&_0x5ee5a4[_0xe03f('0x88')]){_0x1d94ba=path['join'](config[_0xe03f('0x80')],_0xe03f('0x89'),_0x5ee5a4['customerAvatar']);}}return _0x8acddb[_0xe03f('0x82')](_0x1d94ba);}})[_0xe03f('0x5a')](handleError(_0x8acddb,null));};exports[_0xe03f('0x8a')]=function(_0x4c703e,_0x54855d,_0x380e39){var _0x2af139=path[_0xe03f('0x7d')](config['root'],_0xe03f('0x8b'));var _0x41a4eb={'where':{'id':_0x4c703e[_0xe03f('0x5c')]['id']},'attributes':['id','systemAvatar'],'raw':!![]};return db[_0xe03f('0x43')][_0xe03f('0x5f')](_0x41a4eb)['then'](handleEntityNotFound(_0x54855d,null))[_0xe03f('0x25')](function(_0x3ebfc4){if(_0x3ebfc4){if(!_[_0xe03f('0x84')](_0x3ebfc4[_0xe03f('0x8c')])){if(fs['existsSync'](path[_0xe03f('0x7d')](config[_0xe03f('0x80')],_0xe03f('0x89'),_0x3ebfc4['systemAvatar']))){_0x2af139=path['join'](config['root'],_0xe03f('0x89'),_0x3ebfc4['systemAvatar']);}}return _0x54855d['download'](_0x2af139);}})[_0xe03f('0x5a')](handleError(_0x54855d,null));};exports[_0xe03f('0x8d')]=function(_0x26efd1,_0x78f64b,_0x2cf515){var _0x32c47c=require(_0xe03f('0x8e'));var _0x8e3598=new _0x32c47c();var _0x1a6b09=_0x8e3598[_0xe03f('0x8f')](_0x26efd1[_0xe03f('0x90')][_0xe03f('0x91')])[_0xe03f('0x92')]();var _0x42776c={'body':_0x26efd1[_0xe03f('0x61')],'channel':_0xe03f('0x93')};var _0x3f1083=[];var _0x296f98=[];var _0x565643={};var _0x7616f5=![];return db['CmContact']['describe']()[_0xe03f('0x25')](function(_0x4d6db2){if(!_0x4d6db2){throw new db[(_0xe03f('0x94'))][(_0xe03f('0x95'))](_0xe03f('0x96'));}_0x3f1083=_[_0xe03f('0x97')](_['keys'](_0x4d6db2),[_0xe03f('0x98'),_0xe03f('0x99')]);_0x296f98=_[_0xe03f('0x97')](_[_0xe03f('0x5e')](_0x4d6db2),['createdAt','updatedAt','CompanyId',_0xe03f('0x9a')]);if(_0x26efd1[_0xe03f('0x61')]['id']){delete _0x26efd1[_0xe03f('0x61')]['id'];}if(_[_0xe03f('0x84')](_0x26efd1[_0xe03f('0x61')]['from'])){throw new db['Sequelize'][(_0xe03f('0x95'))](_0xe03f('0x9b'));}if(_[_0xe03f('0x84')](_0x26efd1[_0xe03f('0x61')]['body'])||_0x26efd1[_0xe03f('0x61')][_0xe03f('0x61')]===''){throw new db[(_0xe03f('0x94'))][(_0xe03f('0x95'))](_0xe03f('0x9c'));}if(_[_0xe03f('0x84')](_0x26efd1[_0xe03f('0x61')][_0xe03f('0x9d')])){throw new db[(_0xe03f('0x94'))][(_0xe03f('0x95'))](_0xe03f('0x9e')+_0x296f98);}if(!_[_0xe03f('0x9f')](_0x296f98,_0x26efd1['body'][_0xe03f('0x9d')])){throw new db[(_0xe03f('0x94'))][(_0xe03f('0x95'))](_0xe03f('0xa0')+_0x296f98);}_0x565643[_0x26efd1[_0xe03f('0x61')]['mapKey']]=_0x26efd1[_0xe03f('0x61')][_0xe03f('0xa1')];})['then'](function(){return db[_0xe03f('0x43')][_0xe03f('0x5f')]({'where':{'id':_0x26efd1['params']['id']},'include':[{'model':db[_0xe03f('0xa2')],'as':'List','include':[{'model':db[_0xe03f('0xa3')],'as':_0xe03f('0xa4'),'where':_0x565643,'limit':0x1,'order':[[_0xe03f('0x99'),_0xe03f('0xa5')]]}]},{'model':db[_0xe03f('0xa6')],'as':_0xe03f('0xa7')}]});})[_0xe03f('0x25')](handleEntityNotFound(_0x78f64b,null))[_0xe03f('0x25')](function(_0x109d13){if(_0x109d13&&_0x109d13[_0xe03f('0xa8')]){_0x42776c[_0xe03f('0xa9')]=_0x109d13;_0x42776c['applications']=_0x109d13[_0xe03f('0xa7')];_0x42776c[_0xe03f('0xaa')]=_0x109d13[_0xe03f('0xa8')];_0x42776c['applications']=_[_0xe03f('0xab')](_0x42776c[_0xe03f('0xac')],[_0xe03f('0xad')],['asc']);if(_0x42776c['account']['Applications']){delete _0x42776c['account'][_0xe03f('0xa7')];}if(_0x42776c[_0xe03f('0xa9')][_0xe03f('0xa8')]&&_0x42776c['account']['List'][_0xe03f('0xa4')][_0xe03f('0x4d')]){return _0x42776c['account'][_0xe03f('0xa8')][_0xe03f('0xa4')][0x0];}var _0x24e495=_[_0xe03f('0x1d')](_0x26efd1[_0xe03f('0x61')],{'firstName':_0x26efd1[_0xe03f('0x61')][_0xe03f('0xa1')],'ListId':_0x109d13['ListId']});_0x24e495[_0x26efd1[_0xe03f('0x61')][_0xe03f('0x9d')]]=_0x26efd1[_0xe03f('0x61')][_0xe03f('0xa1')];return db[_0xe03f('0xa3')][_0xe03f('0x60')](_0x24e495,{'fields':_0x3f1083,'raw':!![]});}})[_0xe03f('0x25')](handleEntityNotFound(_0x78f64b,null))[_0xe03f('0x25')](function(_0x17e3a2){_0x42776c[_0xe03f('0xae')]=_0x17e3a2;var _0x4fa634=_0x26efd1[_0xe03f('0x61')][_0xe03f('0xaf')];if(_0x26efd1[_0xe03f('0x90')][_0xe03f('0xb0')]){_0x4fa634=_0x26efd1[_0xe03f('0x90')][_0xe03f('0xb0')];}else if(_0x26efd1[_0xe03f('0x90')]['x-forwarded-for']){_0x4fa634=_[_0xe03f('0xb1')](_0x26efd1['headers'][_0xe03f('0xb2')][_0xe03f('0xb3')](','));}if(_0x17e3a2){var _0x217f05={'ContactId':_0x17e3a2['id'],'ChatWebsiteId':_0x26efd1[_0xe03f('0x5c')]['id'],'from':(_0x17e3a2[_0xe03f('0xb4')]||'')+'\x20'+(_0x17e3a2[_0xe03f('0xb5')]||''),'customerIp':_0x4fa634,'customerPort':_0x26efd1[_0xe03f('0x90')][_0xe03f('0xb6')]?_0x26efd1[_0xe03f('0x90')]['x-real-port']:null,'referer':_0x26efd1['body']['referer'],'browserName':_0x1a6b09['browser'][_0xe03f('0x3f')]&&_0x1a6b09[_0xe03f('0xb7')][_0xe03f('0xb8')]?util['format'](_0xe03f('0xb9'),_0x1a6b09[_0xe03f('0xb7')][_0xe03f('0x3f')],_0x1a6b09['browser'][_0xe03f('0xb8')]):'unknown','browserVersion':_0x1a6b09['browser'][_0xe03f('0xb8')]||_0xe03f('0xba'),'osName':util[_0xe03f('0xbb')](_0xe03f('0xb9'),_0x1a6b09['os'][_0xe03f('0x3f')],_0x1a6b09['os']['version']),'osVersion':_0x1a6b09['os'][_0xe03f('0xb8')],'deviceModel':_0x1a6b09['device'][_0xe03f('0x47')]&&_0x1a6b09[_0xe03f('0xbc')][_0xe03f('0xbd')]?util[_0xe03f('0xbb')](_0xe03f('0xbe'),_0x1a6b09['device'][_0xe03f('0x47')],_0x1a6b09[_0xe03f('0xbc')]['vendor'],_0x1a6b09[_0xe03f('0xbc')]['type']):null,'deviceVendor':_0x1a6b09['device'][_0xe03f('0xbd')],'deviceType':_0x1a6b09[_0xe03f('0xbc')][_0xe03f('0x52')],'formData':JSON[_0xe03f('0x2a')](_0x26efd1['body'])};var _0x1cfbba={'ChatWebsiteId':_0x26efd1[_0xe03f('0x5c')]['id'],'closed':![]};if(_0x26efd1[_0xe03f('0x61')][_0xe03f('0xbf')]){_0x1cfbba[_0xe03f('0xbf')]=_0x26efd1[_0xe03f('0x61')][_0xe03f('0xbf')];return db[_0xe03f('0xc0')][_0xe03f('0x5f')]({'where':_0x1cfbba})[_0xe03f('0x25')](function(_0x3d1d80){if(_0x3d1d80){return[_0x3d1d80,![]];}_0x217f05[_0xe03f('0xbf')]=_0x26efd1[_0xe03f('0x61')]['threadId'];_0x217f05[_0xe03f('0xc1')]=_0x26efd1[_0xe03f('0x61')][_0xe03f('0xc1')];return db[_0xe03f('0xc0')][_0xe03f('0x60')](_0x217f05)[_0xe03f('0x25')](function(_0x4a4791){return[_0x4a4791,!![]];});});}_0x1cfbba[_0xe03f('0xc2')]=_0x17e3a2['id'];if(_0x26efd1[_0xe03f('0x61')][_0xe03f('0xc3')]&&_0x26efd1[_0xe03f('0x61')]['interaction']['id']){_0x1cfbba['id']=_0x26efd1[_0xe03f('0x61')]['interaction']['id'];return db[_0xe03f('0xc0')]['find']({'where':_0x1cfbba})['then'](function(_0x560cfd){if(_0x560cfd){return[_0x560cfd,![]];}return db[_0xe03f('0xc0')]['create'](_0x217f05)[_0xe03f('0x25')](function(_0x5cc169){return[_0x5cc169,!![]];});});}return db[_0xe03f('0xc0')][_0xe03f('0x60')](_0x217f05)[_0xe03f('0x25')](function(_0x1fa4bd){return[_0x1fa4bd,!![]];});}})[_0xe03f('0xc4')](function(_0x4d7c36,_0x27240a){if(_0x4d7c36){_0x7616f5=_0x27240a;if(!_0x27240a){var _0x32646f={'from':(_0x42776c[_0xe03f('0xae')][_0xe03f('0xb4')]||'')+'\x20'+(_0x42776c[_0xe03f('0xae')][_0xe03f('0xb5')]||'')};if(_0x26efd1[_0xe03f('0x61')][_0xe03f('0xbf')]&&_0x26efd1[_0xe03f('0x61')]['messageId']&&_0x26efd1['body'][_0xe03f('0xbf')]!=_0x26efd1[_0xe03f('0x61')][_0xe03f('0xc5')]){_0x32646f['threadId']=_0x26efd1[_0xe03f('0x61')][_0xe03f('0xc5')];}return _0x4d7c36[_0xe03f('0x3b')](_0x32646f);}else{return _0x4d7c36;}}})[_0xe03f('0x25')](function(_0x3873aa){_0x42776c[_0xe03f('0xc3')]=_0x3873aa[_0xe03f('0x63')]({'plain':!![]});_0x42776c[_0xe03f('0xc3')][_0xe03f('0xc6')]=_0x7616f5;if(_0x42776c[_0xe03f('0xc3')][_0xe03f('0xc6')]){if(_0x42776c[_0xe03f('0xa9')][_0xe03f('0xc7')]){_0x42776c['applications'][_0xe03f('0xc8')]({'id':0x0,'priority':_0x42776c[_0xe03f('0xac')][_0xe03f('0x4d')]+0x1,'app':_0xe03f('0xc9'),'appdata':_0xe03f('0xca'),'interval':_0xe03f('0xcb')});}}return db[_0xe03f('0xcc')][_0xe03f('0x60')]({'body':_0x26efd1[_0xe03f('0x61')]['body'],'ChatWebsiteId':_0x26efd1['params']['id'],'ChatInteractionId':_0x3873aa['id'],'direction':'in','ContactId':_0x42776c[_0xe03f('0xae')]['id'],'AttachmentId':_0x26efd1[_0xe03f('0x61')][_0xe03f('0xcd')]});})['then'](function(_0x24b284){_0x42776c['message']=_0x24b284;if(_0x42776c[_0xe03f('0xc3')][_0xe03f('0xce')]){return db[_0xe03f('0xcf')]['find']({'attributes':['id',_0xe03f('0x3f')],'where':{'id':_0x42776c['interaction'][_0xe03f('0xce')]}})[_0xe03f('0x25')](function(_0x38e13a){if(_0x38e13a){_0x42776c[_0xe03f('0xac')][_0xe03f('0xd0')]({'id':0x0,'priority':0x0,'app':_0xe03f('0xd1'),'appdata':_0x38e13a['name']+','+(_0x42776c[_0xe03f('0xa9')]['waitForTheAssignedAgent']||0xa),'interval':_0xe03f('0xcb')});_0x42776c[_0xe03f('0xd2')]=!![];}return respondWithRpcPromise(_0xe03f('0xd3'),_0xe03f('0xd4'),_0x42776c);});}return respondWithRpcPromise(_0xe03f('0xd3'),_0xe03f('0xd4'),_0x42776c);})[_0xe03f('0x25')](function(_0x49bed6){respondWithRpcPromise(_0xe03f('0xd5'),_0xe03f('0xd5'),{'event':_0xe03f('0x8d'),'message':_0x49bed6},client9002);return _0x49bed6;})['then'](respondWithResult(_0x78f64b,null))[_0xe03f('0x5a')](handleError(_0x78f64b,null));};exports[_0xe03f('0xd6')]=function(_0x450aba,_0x1d059b,_0x540fe2){var _0x2d14f6,_0x1f748c,_0x136b0c;var _0x6908a7=[];var _0x4d9830=[];var _0x1aad51={};var _0x2473fc=_0x450aba['files']||[];var _0x19e37b=[];var _0x33511d;return db[_0xe03f('0xa3')][_0xe03f('0x69')]()['then'](function(_0x5a5d14){if(!_0x5a5d14){throw new db['Sequelize'][(_0xe03f('0x95'))](_0xe03f('0x96'));}_0x4d9830=_[_0xe03f('0x97')](_[_0xe03f('0x5e')](_0x5a5d14),[_0xe03f('0x98'),'updatedAt']);_0x6908a7=_['difference'](_['keys'](_0x5a5d14),[_0xe03f('0x98'),_0xe03f('0x99'),_0xe03f('0xd7'),_0xe03f('0x9a')]);if(_0x450aba[_0xe03f('0x61')]['id']){delete _0x450aba[_0xe03f('0x61')]['id'];}if(_[_0xe03f('0x84')](_0x450aba[_0xe03f('0x61')][_0xe03f('0xa1')])){throw _0x1d059b[_0xe03f('0x31')](0x1f4)[_0xe03f('0xd8')](new db[(_0xe03f('0x94'))]['ValidationError']('from\x20is\x20mandatory'));}if(_['isNil'](_0x450aba['body'][_0xe03f('0x61')])||_0x450aba['body'][_0xe03f('0x61')]===''){throw _0x1d059b[_0xe03f('0x31')](0x1f4)['send'](new db[(_0xe03f('0x94'))][(_0xe03f('0x95'))](_0xe03f('0x9c')));}if(_[_0xe03f('0x84')](_0x450aba[_0xe03f('0x61')][_0xe03f('0xd9')])){throw _0x1d059b['status'](0x1f4)[_0xe03f('0xd8')](new db['Sequelize'][(_0xe03f('0x95'))](_0xe03f('0xda')+_0x6908a7));}if(!_[_0xe03f('0x9f')](_0x6908a7,_0x450aba[_0xe03f('0x61')][_0xe03f('0xd9')])){throw _0x1d059b[_0xe03f('0x31')](0x1f4)[_0xe03f('0xd8')](new db[(_0xe03f('0x94'))][(_0xe03f('0x95'))](_0xe03f('0xdb')+_0x6908a7));}_0x1aad51[_0x450aba[_0xe03f('0x61')]['mapKeyOffline']]=_0x450aba[_0xe03f('0x61')][_0xe03f('0xa1')];})[_0xe03f('0x25')](function(){return db['ChatWebsite']['find']({'where':{'id':_0x450aba['params']['id']},'include':[{'model':db[_0xe03f('0xa2')],'as':_0xe03f('0xa8')},{'model':db[_0xe03f('0xdc')],'as':_0xe03f('0xdc')}]});})[_0xe03f('0x25')](handleEntityNotFound(_0x1d059b,null))[_0xe03f('0x25')](function(_0x34c4c2){if(_0x34c4c2&&_0x34c4c2[_0xe03f('0xa8')]){_0x1f748c=_0x34c4c2;var _0x4fe45e=_[_0xe03f('0x1d')](_0x450aba[_0xe03f('0x61')],{'firstName':_0x450aba['body']['from'],'phone':_0x450aba[_0xe03f('0x61')][_0xe03f('0xa1')],'ListId':_0x34c4c2[_0xe03f('0x9a')]});_0x4fe45e[_0x450aba['body'][_0xe03f('0xd9')]]=_0x450aba['body'][_0xe03f('0xa1')];return db[_0xe03f('0xa3')][_0xe03f('0xdd')]({'where':_0x1aad51,'defaults':_0x4fe45e});}})[_0xe03f('0xc4')](function(_0x47b147){if(_0x47b147){_0x136b0c=_0x47b147;var _0x2d80c4=fs[_0xe03f('0xde')](path[_0xe03f('0x7d')](config[_0xe03f('0x80')],_0xe03f('0xdf')),_0xe03f('0xe0'));var _0x43a02f=ejs[_0xe03f('0xe1')](_0x2d80c4,{'body':_[_0xe03f('0xe2')](_0x450aba[_0xe03f('0x61')][_0xe03f('0x61')]),'bodyTitle':_0x1f748c[_0xe03f('0xe3')]});return db[_0xe03f('0xe4')][_0xe03f('0x60')]({'body':_0x43a02f,'ContactId':_0x47b147['id'],'ChatWebsiteId':_0x1f748c['id']});}})[_0xe03f('0x25')](function(_0x26ebed){_0x33511d=_0x26ebed;if(_0x2473fc[_0xe03f('0x4d')]){var _0x4fdb29=_0x2473fc['map'](function(_0xe2d2d0){return{'name':_0xe2d2d0[_0xe03f('0xe5')],'basename':_0xe2d2d0[_0xe03f('0x77')],'type':_0xe2d2d0['mimetype'],'ChatOfflineMessageId':_0x26ebed['id']};});_0x19e37b=_0x4fdb29['map'](_0x5132f7=>{var _0x2b4286={'filename':_0x5132f7['name'],'path':path['join'](config[_0xe03f('0x80')],_0xe03f('0xe6'),_0xe03f('0xe7'),_0xe03f('0xe8'),_0xe03f('0xe9'),_0x5132f7[_0xe03f('0xea')])};return _0x2b4286;});if(!_0x1f748c[_0xe03f('0xeb')]){return db[_0xe03f('0xec')]['transaction'](function(_0x57278c){return db['Attachment'][_0xe03f('0xed')](_0x4fdb29,{'transaction':_0x57278c});});}}})['then'](function(){if(_0x33511d){_0x2d14f6=_0x33511d;return db[_0xe03f('0xdc')][_0xe03f('0x6c')]({'where':{'active':!![]},'include':[{'model':db[_0xe03f('0xee')],'as':_0xe03f('0xef'),'raw':!![]}]});}})['then'](function(_0x406494){if(_0x406494&&_0x406494[_0xe03f('0xef')]&&_0x1f748c[_0xe03f('0xf0')]&&_0x1f748c[_0xe03f('0xf1')]){var _0x9ca17a={'tls':{'rejectUnauthorized':![]}};if(_0x406494[_0xe03f('0xef')][_0xe03f('0xf2')]){_0x9ca17a[_0xe03f('0xf2')]=_0x406494[_0xe03f('0xef')][_0xe03f('0xf2')];}else{_0x9ca17a['host']=_0x406494[_0xe03f('0xef')][_0xe03f('0xf3')];_0x9ca17a[_0xe03f('0xf4')]=_0x406494[_0xe03f('0xef')][_0xe03f('0xf4')];_0x9ca17a[_0xe03f('0xf5')]=_0x406494[_0xe03f('0xef')]['secure'];}if(_0x406494['Smtp']['authentication']){_0x9ca17a['auth']={'user':_0x406494['Smtp']['user'],'pass':_0x406494[_0xe03f('0xef')][_0xe03f('0xf6')]};}return respondWithRpcPromise(_0xe03f('0xf7'),'sendMail',{'account':_0x9ca17a,'message':{'from':util[_0xe03f('0xbb')](_0xe03f('0xf8'),_0x406494[_0xe03f('0x3f')],_0x406494[_0xe03f('0xf9')]||_0x406494[_0xe03f('0xef')][_0xe03f('0x62')]),'to':_0x1f748c['forwardOfflineAddress'],'subject':_0x1f748c[_0xe03f('0xfa')],'html':_0x2d14f6[_0xe03f('0x61')],'attachments':_0x19e37b}},client9003)[_0xe03f('0x25')](function(){return _0x2d14f6;})[_0xe03f('0x5a')](function(_0x3c6d9d){console[_0xe03f('0x2b')](_0x3c6d9d);});}})[_0xe03f('0x25')](function(){if(_0x1f748c&&_0x1f748c[_0xe03f('0xeb')]&&_0x1f748c[_0xe03f('0xfb')]){var _0x3a65da=[];if(_0x2473fc[_0xe03f('0x4d')]){_0x3a65da=_0x2473fc['map'](function(_0xb7c74e){return{'name':_0xb7c74e[_0xe03f('0xe5')],'basename':_0xb7c74e[_0xe03f('0x77')],'type':_0xb7c74e[_0xe03f('0xfc')],'ChatOfflineMessageId':_0x33511d['id']};});}var _0x289887;if(!_['isNil'](_0x1f748c[_0xe03f('0xfd')])){var _0x2b1b31=_[_0xe03f('0x42')](_0x450aba[_0xe03f('0x61')],function(_0x36e1ff){return _0x36e1ff;});var _0x352a95=_['toPairsIn'](_0x2b1b31)[0x0];var _0x55b9a3=_['mapValues'](_0x352a95,function(_0x48b903){return _0x48b903;});_0x289887=_0x55b9a3[0x1][_0x1f748c[_0xe03f('0xfd')]];}var _0x273a31={'from':_0x136b0c[_0xe03f('0xf9')],'firstName':_0x136b0c[_0xe03f('0xb4')],'lastName':_0x136b0c[_0xe03f('0xb5')],'mapKey':'email','message':{'from':_0x136b0c[_0xe03f('0xf9')],'to':_0x1f748c[_0xe03f('0xdc')]['email'],'cc':'','subject':_[_0xe03f('0x84')](_0x289887)?_0x1f748c[_0xe03f('0xfa')]:_0x289887,'messageId':'','sentAt':new Date(),'attach':_0x3a65da[_0xe03f('0x4d')],'attachments':_0x3a65da,'originChannel':'Chat','ChatWebsiteId':_0x1f748c['id'],'ChatOfflineMessageId':_0x2d14f6['id'],'originTo':_0x1f748c[_0xe03f('0xdc')]['email']},'body':_0x2d14f6[_0xe03f('0x61')]};var _0x1c7126={'account':{'id':_0x1f748c['MailAccountId']},'body':_0x273a31,'log':'NotifyMailAccount'};return respondWithRpcPromise(_0xe03f('0xfe'),'notifyMail',_0x1c7126,client9001)[_0xe03f('0x25')](function(){return _0x2d14f6;})[_0xe03f('0x5a')](function(_0x5d667c){console[_0xe03f('0x2b')](_0x5d667c);});}return;})[_0xe03f('0x25')](function(){if(_0x2d14f6){return _0x2d14f6;}})[_0xe03f('0x25')](respondWithResult(_0x1d059b,null))['catch'](function(_0x2a887d){console[_0xe03f('0x2b')](_0xe03f('0x5a'),_0x2a887d);for(var _0x1c68a3 of _0x2473fc){var _0x4925b8=path[_0xe03f('0x7d')](config[_0xe03f('0x80')],'server',_0xe03f('0xe7'),_0xe03f('0xe8'),_0xe03f('0xe9'),_0x1c68a3['filename']);fs_extra[_0xe03f('0xff')](_0x4925b8)[_0xe03f('0x5a')](function(_0x223186){console['error'](_0xe03f('0x100'),_0x4925b8,_0x223186);});}});};exports['addInteraction']=function(_0x52767d,_0x17ea1e,_0x162ffd){return db[_0xe03f('0xc0')][_0xe03f('0x5f')]({'where':{'id':_0x52767d[_0xe03f('0x5c')]['id']}})[_0xe03f('0x25')](handleEntityNotFound(_0x17ea1e,null))[_0xe03f('0x25')](function(_0x304043){if(_0x304043){return _0x304043[_0xe03f('0x101')](_0x52767d['body'][_0xe03f('0x74')],_[_0xe03f('0x102')](_0x52767d[_0xe03f('0x61')],[_0xe03f('0x74'),'id'])||{});}})[_0xe03f('0x25')](respondWithResult(_0x17ea1e,null))['catch'](handleError(_0x17ea1e,null));};exports[_0xe03f('0x103')]=function(_0x5acac2,_0x265407,_0x87b17b){var _0x15b145={'raw':![],'where':{}};var _0x42767f={};var _0x47b755={'count':0x0,'rows':[]};return db[_0xe03f('0x43')]['findOne']({'where':{'id':_0x5acac2[_0xe03f('0x5c')]['id']}})[_0xe03f('0x25')](handleEntityNotFound(_0x265407,null))[_0xe03f('0x25')](function(_0x5791c5){if(_0x5791c5){_0x42767f[_0xe03f('0x47')]=_[_0xe03f('0x5e')](db[_0xe03f('0xc0')][_0xe03f('0x44')]);_0x42767f[_0xe03f('0x48')]=_[_0xe03f('0x5e')](_0x5acac2['query']);_0x42767f[_0xe03f('0x49')]=_[_0xe03f('0x4a')](_0x42767f[_0xe03f('0x47')],_0x42767f['query']);_0x15b145[_0xe03f('0x4b')]=_[_0xe03f('0x4a')](_0x42767f[_0xe03f('0x47')],qs[_0xe03f('0x4c')](_0x5acac2[_0xe03f('0x48')][_0xe03f('0x4c')]));_0x15b145['attributes']=_0x15b145[_0xe03f('0x4b')][_0xe03f('0x4d')]?_0x15b145[_0xe03f('0x4b')]:_0x42767f[_0xe03f('0x47')];if(!_0x5acac2['query'][_0xe03f('0x4e')](_0xe03f('0x4f'))){_0x15b145[_0xe03f('0x35')]=qs[_0xe03f('0x35')](_0x5acac2['query'][_0xe03f('0x35')]);_0x15b145[_0xe03f('0x33')]=qs[_0xe03f('0x33')](_0x5acac2[_0xe03f('0x48')][_0xe03f('0x33')]);}_0x15b145[_0xe03f('0x71')]=qs[_0xe03f('0x6d')](_0x5acac2[_0xe03f('0x48')][_0xe03f('0x6d')]);_0x15b145[_0xe03f('0x50')]=qs[_0xe03f('0x49')](_['pick'](_0x5acac2['query'],_0x42767f[_0xe03f('0x49')]));_0x15b145[_0xe03f('0x50')][_0xe03f('0x6a')]=_0x5791c5['id'];if(_0x5acac2[_0xe03f('0x48')][_0xe03f('0x54')]){_0x15b145[_0xe03f('0x50')]=_[_0xe03f('0x55')](_0x15b145[_0xe03f('0x50')],{'$or':_[_0xe03f('0x42')](_0x15b145['attributes'],function(_0x80cc58){var _0x350384={};_0x350384[_0x80cc58]={'$like':'%'+_0x5acac2['query'][_0xe03f('0x54')]+'%'};return _0x350384;})});}_0x15b145=_['merge']({},_0x15b145,_0x5acac2[_0xe03f('0x56')]);return db['ChatInteraction']['count']({'where':_0x15b145[_0xe03f('0x50')]})[_0xe03f('0x25')](function(_0x2e8c26){_0x47b755['count']=_0x2e8c26;if(_0x5acac2[_0xe03f('0x48')][_0xe03f('0x57')]){_0x15b145[_0xe03f('0x58')]=[{'model':db[_0xe03f('0xa3')],'as':_0xe03f('0x104'),'required':![]},{'model':db[_0xe03f('0xcf')],'as':_0xe03f('0x105'),'attributes':[_0xe03f('0x3f'),_0xe03f('0x106'),'internal'],'required':![]},{'model':db[_0xe03f('0x107')],'as':_0xe03f('0x108'),'attributes':['id',_0xe03f('0x3f'),'color'],'where':_0x5acac2['query'][_0xe03f('0x109')]?{'id':_0x5acac2[_0xe03f('0x48')][_0xe03f('0x109')]}:undefined,'required':_0x5acac2[_0xe03f('0x48')][_0xe03f('0x109')]?!![]:![]}];}return db[_0xe03f('0xc0')][_0xe03f('0x72')](_0x15b145);})['then'](function(_0x5ab1d7){_0x47b755[_0xe03f('0x59')]=_0x5ab1d7;return _0x47b755;});}})[_0xe03f('0x25')](respondWithFilteredResult(_0x265407,_0x15b145))[_0xe03f('0x5a')](handleError(_0x265407,null));};function iftimePromise(_0x223b1f,_0xcf091a){return respondWithRpcPromise(_0xe03f('0x10a'),_0xe03f('0x10b'),{'command':_0xcf091a[_0xe03f('0x10c')]?util[_0xe03f('0xbb')](_0xe03f('0x10d'),_0x223b1f[_0xe03f('0x10e')],_0xcf091a['timezone']):util[_0xe03f('0xbb')](_0xe03f('0x10f'),_0x223b1f[_0xe03f('0x10e')])},client9002)['then'](function(_0x217789){var _0x254444=_0x217789&&_0x217789['indexOf']('true')>=0x0?!![]:![];logger[_0xe03f('0x26')](_0xe03f('0x110'),_0xcf091a['id'],_0x223b1f['id'],_0x223b1f[_0xe03f('0x10e')],_0x254444?_0xe03f('0x111'):_0xe03f('0x112'),_0xcf091a[_0xe03f('0x10c')]?_0xcf091a[_0xe03f('0x10c')]:'No\x20timezone');return _0x254444;})['catch'](function(_0x17e5a8){logger[_0xe03f('0x2b')](_0xe03f('0x110'),_0xcf091a['id'],_0x223b1f['id'],_0x223b1f['interval'],util[_0xe03f('0x113')](_0x17e5a8,{'showHidden':![],'depth':null}),_0xcf091a['timezone']?_0xcf091a[_0xe03f('0x10c')]:_0xe03f('0x114'));return![];});}exports[_0xe03f('0x10b')]=function(_0x40fe22,_0x5c8b12,_0x1f48ba){var _0x23a1d6=0x0;var _0x24024e=0x0;var _0x2da007=![];var _0x548430;var _0x25fb65;return db['ChatWebsite'][_0xe03f('0x5f')]({'where':{'id':_0x40fe22['params']['id']},'include':[{'model':db[_0xe03f('0x115')],'as':_0xe03f('0x115'),'include':[{'model':db[_0xe03f('0x115')],'as':_0xe03f('0x116'),'attributes':['id',_0xe03f('0x10e')],'raw':!![]}]}]})[_0xe03f('0x25')](handleEntityNotFound(_0x5c8b12,null))[_0xe03f('0x25')](function(_0x9d39cb){if(_0x9d39cb){_0x548430=_0x9d39cb;return _0x9d39cb[_0xe03f('0x117')]({'raw':!![]});}})['then'](function(_0x3a6833){if(_0x548430){if(_0x3a6833){_0x25fb65=_0x3a6833;}}return require(_0xe03f('0x1a'))[_0xe03f('0x7e')]();})['then'](function(_0x2f5738){if(_0x2f5738){_0x24024e=_0x2f5738[_0xe03f('0x118')];_0x2da007=_0x2f5738[_0xe03f('0x7f')];}})['then'](function(){return db[_0xe03f('0xc0')]['count']({'where':{'closed':![]}});})[_0xe03f('0x25')](function(_0xc5fd6){_0x23a1d6=_0xc5fd6;if(_0x24024e&&_0xc5fd6>_0x24024e){return db[_0xe03f('0x119')]['findOne']({'where':{'id':0x1}})['then'](function(_0x4eb2fe){if(_0x4eb2fe){_0x4eb2fe['increment']('chatLicenseExceeded');}});}})[_0xe03f('0x25')](function(){if(_0x548430[_0xe03f('0x115')]&&_0x548430[_0xe03f('0x115')][_0xe03f('0x116')]){var _0x5a41d5=[];for(var _0x3592da=0x0;_0x3592da<_0x548430[_0xe03f('0x115')][_0xe03f('0x116')][_0xe03f('0x4d')];_0x3592da++){var _0x487656=_0x548430[_0xe03f('0x115')][_0xe03f('0x116')][_0x3592da][_0xe03f('0x63')]({'plain':!![]});_0x5a41d5[_0xe03f('0xc8')](iftimePromise(_0x487656,_0x548430));}return BPromise[_0xe03f('0x11a')](_0x5a41d5)[_0xe03f('0x25')](function(_0x1fa1b6){return _[_0xe03f('0x11b')](_0x1fa1b6);});}else{return!![];}})['then'](function(_0x203f4a){var _0xa9147b=fs[_0xe03f('0xde')](path[_0xe03f('0x7d')](config[_0xe03f('0x80')],_0xe03f('0x11c')),_0xe03f('0xe0'));var _0x3a8030={'remote':_0x548430[_0xe03f('0x11d')],'query':querystring[_0xe03f('0x2a')](_[_0xe03f('0x55')](_0x548430[_0xe03f('0x63')]({'plain':!![]}),{'customerIp':_0x40fe22[_0xe03f('0x90')][_0xe03f('0xb2')]||_0x40fe22[_0xe03f('0x90')][_0xe03f('0x11e')]||_0x40fe22[_0xe03f('0x11f')][_0xe03f('0x120')]||_0x40fe22['ip'],'referer':_0x40fe22['headers'][_0xe03f('0x121')],'openedInteractions':_0x23a1d6,'maxInteractions':_0x24024e,'virtual':_0x2da007['virtual'],'online':_0x203f4a,'custom':_0x2da007}))[_0xe03f('0x122')](/'/g,'\x5c\x27')};_0x5c8b12[_0xe03f('0xd8')](ejs['render'](Mustache[_0xe03f('0xe1')](_0xa9147b,_0x3a8030),{'proactiveActions':_0x25fb65,'alignment':_0x548430[_0xe03f('0x123')],'verticalAlignment':_0x548430['verticalAlignment'],'div_color':_0x548430[_0xe03f('0x124')],'text_color':_0x548430['textColor'],'button_color':_0x548430[_0xe03f('0x125')],'background_color':_0x548430['backgroundColor']}));})[_0xe03f('0x5a')](handleError(_0x5c8b12,null));};exports[_0xe03f('0x126')]=function(_0x4358a9,_0x1173dc,_0x2ecbca){return db[_0xe03f('0x43')][_0xe03f('0x6c')]({'where':{'id':_0x4358a9['params']['id']}})[_0xe03f('0x25')](handleEntityNotFound(_0x1173dc,null))[_0xe03f('0x25')](function(_0x49a215){if(_0x49a215){return db['sequelize'][_0xe03f('0x127')](function(_0x3a8b1f){return db[_0xe03f('0xa6')][_0xe03f('0x3d')]({'where':{'ChatWebsiteId':_0x4358a9[_0xe03f('0x5c')]['id']},'transaction':_0x3a8b1f})[_0xe03f('0x25')](function(_0x194a16){var _0x4d606e=_[_0xe03f('0x42')](_0x4358a9[_0xe03f('0x61')],function(_0x171bbd){_0x171bbd['ChatWebsiteId']=_0x4358a9[_0xe03f('0x5c')]['id'];return _0x171bbd;});return db[_0xe03f('0xa6')]['bulkCreate'](_0x4d606e,{'transaction':_0x3a8b1f});});})['then'](function(){return db[_0xe03f('0xa6')]['findAndCountAll']({'where':{'ChatWebsiteId':_0x4358a9[_0xe03f('0x5c')]['id']},'order':_0xe03f('0xad')});});}})[_0xe03f('0x25')](respondWithResult(_0x1173dc,null))[_0xe03f('0x5a')](handleError(_0x1173dc,null));};exports[_0xe03f('0x128')]=function(_0x4362cc,_0x409a97,_0x4e0235){var _0x39ed6f={};var _0x3a9dcf={};var _0xb5b9b9;var _0x4f2091;return db['ChatWebsite'][_0xe03f('0x6c')]({'where':{'id':_0x4362cc[_0xe03f('0x5c')]['id']}})[_0xe03f('0x25')](handleEntityNotFound(_0x409a97,null))[_0xe03f('0x25')](function(_0x489246){if(_0x489246){_0xb5b9b9=_0x489246;_0x3a9dcf[_0xe03f('0x47')]=_[_0xe03f('0x5e')](db[_0xe03f('0xa6')]['rawAttributes']);_0x3a9dcf[_0xe03f('0x48')]=_[_0xe03f('0x5e')](_0x4362cc['query']);_0x3a9dcf[_0xe03f('0x49')]=_['intersection'](_0x3a9dcf[_0xe03f('0x47')],_0x3a9dcf[_0xe03f('0x48')]);_0x39ed6f['attributes']=_[_0xe03f('0x4a')](_0x3a9dcf[_0xe03f('0x47')],qs[_0xe03f('0x4c')](_0x4362cc[_0xe03f('0x48')][_0xe03f('0x4c')]));_0x39ed6f[_0xe03f('0x4b')]=_0x39ed6f[_0xe03f('0x4b')][_0xe03f('0x4d')]?_0x39ed6f[_0xe03f('0x4b')]:_0x3a9dcf['model'];_0x39ed6f[_0xe03f('0x71')]=qs[_0xe03f('0x6d')](_0x4362cc['query'][_0xe03f('0x6d')]);_0x39ed6f[_0xe03f('0x50')]=qs['filters'](_['pick'](_0x4362cc[_0xe03f('0x48')],_0x3a9dcf[_0xe03f('0x49')]));if(_0x4362cc[_0xe03f('0x48')][_0xe03f('0x54')]){_0x39ed6f[_0xe03f('0x50')]=_['merge'](_0x39ed6f['where'],{'$or':_['map'](_0x39ed6f['attributes'],function(_0x41bf11){var _0xab4684={};_0xab4684[_0x41bf11]={'$like':'%'+_0x4362cc[_0xe03f('0x48')]['filter']+'%'};return _0xab4684;})});}_0x39ed6f=_[_0xe03f('0x55')]({},_0x39ed6f,_0x4362cc[_0xe03f('0x56')]);return _0xb5b9b9[_0xe03f('0x128')](_0x39ed6f);}})[_0xe03f('0x25')](function(_0x22678c){if(_0x22678c){_0x4f2091=_0x22678c[_0xe03f('0x4d')];if(!_0x4362cc[_0xe03f('0x48')]['hasOwnProperty'](_0xe03f('0x4f'))){_0x39ed6f['limit']=qs['limit'](_0x4362cc[_0xe03f('0x48')][_0xe03f('0x35')]);_0x39ed6f[_0xe03f('0x33')]=qs[_0xe03f('0x33')](_0x4362cc[_0xe03f('0x48')][_0xe03f('0x33')]);}return _0xb5b9b9[_0xe03f('0x128')](_0x39ed6f);}})['then'](function(_0x1c5ee0){if(_0x1c5ee0){return _0x1c5ee0?{'count':_0x4f2091,'rows':_0x1c5ee0}:null;}})['then'](respondWithResult(_0x409a97,null))[_0xe03f('0x5a')](handleError(_0x409a97,null));};exports[_0xe03f('0x129')]=function(_0x389486,_0xa828db,_0x2a794f){return db[_0xe03f('0x12a')]['find']({'where':{'id':_0x389486[_0xe03f('0x5c')]['id']}})[_0xe03f('0x25')](handleEntityNotFound(_0xa828db,null))[_0xe03f('0x25')](function(_0x5b4cab){if(_0x5b4cab){return _0x5b4cab[_0xe03f('0x129')](_0x389486[_0xe03f('0x61')][_0xe03f('0x74')],_[_0xe03f('0x102')](_0x389486[_0xe03f('0x61')],[_0xe03f('0x74'),'id'])||{});}})[_0xe03f('0x25')](respondWithResult(_0xa828db,null))['catch'](handleError(_0xa828db,null));};exports['getProactiveActions']=function(_0x5066d4,_0x3d7204,_0x3ff2f6){var _0x470881={};var _0x128f43={};var _0x3cf889;var _0x30030c;return db[_0xe03f('0x43')][_0xe03f('0x6c')]({'where':{'id':_0x5066d4[_0xe03f('0x5c')]['id']}})[_0xe03f('0x25')](handleEntityNotFound(_0x3d7204,null))[_0xe03f('0x25')](function(_0x212904){if(_0x212904){_0x3cf889=_0x212904;_0x128f43[_0xe03f('0x47')]=_[_0xe03f('0x5e')](db[_0xe03f('0x12b')][_0xe03f('0x44')]);_0x128f43[_0xe03f('0x48')]=_[_0xe03f('0x5e')](_0x5066d4[_0xe03f('0x48')]);_0x128f43[_0xe03f('0x49')]=_[_0xe03f('0x4a')](_0x128f43['model'],_0x128f43['query']);_0x470881['attributes']=_['intersection'](_0x128f43['model'],qs['fields'](_0x5066d4[_0xe03f('0x48')][_0xe03f('0x4c')]));_0x470881[_0xe03f('0x4b')]=_0x470881[_0xe03f('0x4b')][_0xe03f('0x4d')]?_0x470881['attributes']:_0x128f43['model'];_0x470881[_0xe03f('0x71')]=qs['sort'](_0x5066d4[_0xe03f('0x48')][_0xe03f('0x6d')]);_0x470881['where']=qs[_0xe03f('0x49')](_[_0xe03f('0x51')](_0x5066d4[_0xe03f('0x48')],_0x128f43['filters']));if(_0x5066d4[_0xe03f('0x48')][_0xe03f('0x54')]){_0x470881[_0xe03f('0x50')]=_['merge'](_0x470881[_0xe03f('0x50')],{'$or':_['map'](_0x470881[_0xe03f('0x4b')],function(_0x585664){var _0x64a56d={};_0x64a56d[_0x585664]={'$like':'%'+_0x5066d4[_0xe03f('0x48')][_0xe03f('0x54')]+'%'};return _0x64a56d;})});}_0x470881=_[_0xe03f('0x55')]({},_0x470881,_0x5066d4[_0xe03f('0x56')]);return _0x3cf889[_0xe03f('0x117')](_0x470881);}})[_0xe03f('0x25')](function(_0x21ab8b){if(_0x21ab8b){_0x30030c=_0x21ab8b[_0xe03f('0x4d')];if(!_0x5066d4[_0xe03f('0x48')]['hasOwnProperty'](_0xe03f('0x4f'))){_0x470881[_0xe03f('0x35')]=qs['limit'](_0x5066d4[_0xe03f('0x48')]['limit']);_0x470881[_0xe03f('0x33')]=qs['offset'](_0x5066d4[_0xe03f('0x48')][_0xe03f('0x33')]);}return _0x3cf889[_0xe03f('0x117')](_0x470881);}})['then'](function(_0x131b15){if(_0x131b15){return _0x131b15?{'count':_0x30030c,'rows':_0x131b15}:null;}})[_0xe03f('0x25')](respondWithResult(_0x3d7204,null))[_0xe03f('0x5a')](handleError(_0x3d7204,null));};exports['getFields']=function(_0x28cbb9,_0x2bf131,_0x474e06){var _0x5ca8b2=_0x28cbb9[_0xe03f('0x48')][_0xe03f('0x12c')]===_0xe03f('0x12d')?'offlineForm':_0xe03f('0x12e');return db[_0xe03f('0x43')][_0xe03f('0x5f')]({'attributes':['id',_0x5ca8b2],'where':{'id':_0x28cbb9['params']['id']}})[_0xe03f('0x25')](handleEntityNotFound(_0x2bf131,null))['then'](function(_0x12bf11){if(_0x12bf11){var _0x35af04=_0x12bf11[_0x5ca8b2];var _0x1c0179=_0x35af04&&_0x35af04[_0xe03f('0x12f')]?_0x35af04[_0xe03f('0x12f')]:[];_0x2bf131[_0xe03f('0xd8')]({'fromKey':_[_0xe03f('0x84')](_0x35af04[_0xe03f('0x130')])?undefined:_0x35af04[_0xe03f('0x130')],'count':_0x1c0179[_0xe03f('0x4d')],'rows':_0x1c0179});}})[_0xe03f('0x5a')](handleError(_0x2bf131,null));};exports['getOfflineMessages']=function(_0x5ab8dc,_0x1d34e6,_0x2dc7ee){var _0x298b5e={'raw':![],'where':{}};var _0x3dbdf1={};var _0x3a2d24={'count':0x0,'rows':[]};return db[_0xe03f('0x43')][_0xe03f('0x6c')]({'where':{'id':_0x5ab8dc[_0xe03f('0x5c')]['id']}})['then'](handleEntityNotFound(_0x1d34e6,null))[_0xe03f('0x25')](function(_0x1b01ce){if(_0x1b01ce){_0x3dbdf1[_0xe03f('0x47')]=_[_0xe03f('0x5e')](db[_0xe03f('0xe4')][_0xe03f('0x44')]);_0x3dbdf1[_0xe03f('0x48')]=_['keys'](_0x5ab8dc[_0xe03f('0x48')]);_0x3dbdf1[_0xe03f('0x49')]=_[_0xe03f('0x4a')](_0x3dbdf1[_0xe03f('0x47')],_0x3dbdf1[_0xe03f('0x48')]);_0x298b5e[_0xe03f('0x4b')]=_[_0xe03f('0x4a')](_0x3dbdf1['model'],qs[_0xe03f('0x4c')](_0x5ab8dc[_0xe03f('0x48')][_0xe03f('0x4c')]));_0x298b5e[_0xe03f('0x4b')]=_0x298b5e['attributes']['length']?_0x298b5e[_0xe03f('0x4b')]:_0x3dbdf1[_0xe03f('0x47')];if(!_0x5ab8dc['query']['hasOwnProperty'](_0xe03f('0x4f'))){_0x298b5e[_0xe03f('0x35')]=qs[_0xe03f('0x35')](_0x5ab8dc[_0xe03f('0x48')][_0xe03f('0x35')]);_0x298b5e[_0xe03f('0x33')]=qs[_0xe03f('0x33')](_0x5ab8dc[_0xe03f('0x48')][_0xe03f('0x33')]);}_0x298b5e['order']=qs['sort'](_0x5ab8dc[_0xe03f('0x48')][_0xe03f('0x6d')]);_0x298b5e[_0xe03f('0x50')]=qs[_0xe03f('0x49')](_['pick'](_0x5ab8dc['query'],_0x3dbdf1['filters']));_0x298b5e[_0xe03f('0x50')][_0xe03f('0x6a')]=_0x1b01ce['id'];if(_0x5ab8dc[_0xe03f('0x48')][_0xe03f('0x54')]){_0x298b5e[_0xe03f('0x50')]=_[_0xe03f('0x55')](_0x298b5e[_0xe03f('0x50')],{'$or':_[_0xe03f('0x42')](_0x298b5e['attributes'],function(_0x31b5cc){var _0xfd7ff9={};_0xfd7ff9[_0x31b5cc]={'$like':'%'+_0x5ab8dc[_0xe03f('0x48')]['filter']+'%'};return _0xfd7ff9;})});}_0x298b5e=_['merge']({},_0x298b5e,_0x5ab8dc['options']);return db['ChatOfflineMessage'][_0xe03f('0x36')]({'where':_0x298b5e['where']})[_0xe03f('0x25')](function(_0x569229){_0x3a2d24[_0xe03f('0x36')]=_0x569229;if(_0x5ab8dc[_0xe03f('0x48')][_0xe03f('0x57')]){_0x298b5e['include']=[{'all':!![]}];}else{_0x298b5e[_0xe03f('0x58')]=[{'model':db['CmContact'],'as':_0xe03f('0x104'),'required':![]},{'model':db[_0xe03f('0x131')],'as':_0xe03f('0x132'),'required':![]}];}return db[_0xe03f('0xe4')][_0xe03f('0x72')](_0x298b5e);})[_0xe03f('0x25')](function(_0x23456b){_0x3a2d24[_0xe03f('0x59')]=_0x23456b;return _0x3a2d24;});}})['then'](respondWithFilteredResult(_0x1d34e6,_0x298b5e))[_0xe03f('0x5a')](handleError(_0x1d34e6,null));};exports['addAgents']=function(_0x5d9dd6,_0xc7e928,_0x3e7691){return db['ChatWebsite'][_0xe03f('0x5f')]({'where':{'id':_0x5d9dd6[_0xe03f('0x5c')]['id']}})[_0xe03f('0x25')](handleEntityNotFound(_0xc7e928,null))['then'](function(_0x2dc8c5){if(_0x2dc8c5){return _0x2dc8c5[_0xe03f('0x133')](_0x5d9dd6[_0xe03f('0x61')][_0xe03f('0x74')],_[_0xe03f('0x102')](_0x5d9dd6[_0xe03f('0x61')],[_0xe03f('0x74'),'id'])||{})[_0xe03f('0xc4')](function(_0x2a3492){for(var _0x20eeac=0x0;_0x20eeac<_0x5d9dd6[_0xe03f('0x61')]['ids'][_0xe03f('0x4d')];_0x20eeac+=0x1){socket[_0xe03f('0x134')]('userChatWebsite:save',{'UserId':Number(_0x5d9dd6[_0xe03f('0x61')][_0xe03f('0x74')][_0x20eeac]),'ChatWebsiteId':Number(_0x5d9dd6['params']['id'])});}return _0x2a3492;});}})['then'](respondWithResult(_0xc7e928,null))['catch'](handleError(_0xc7e928,null));};exports['removeAgents']=function(_0x3e92ae,_0x661f36,_0x2a6f0d){return db[_0xe03f('0x43')][_0xe03f('0x5f')]({'where':{'id':_0x3e92ae[_0xe03f('0x5c')]['id']}})['then'](handleEntityNotFound(_0x661f36,null))[_0xe03f('0x25')](function(_0x56e55e){if(_0x56e55e){return _0x56e55e[_0xe03f('0x135')](_0x3e92ae[_0xe03f('0x48')][_0xe03f('0x74')])['then'](function(){if(_[_0xe03f('0x136')](_0x3e92ae[_0xe03f('0x48')]['ids'])){for(var _0x245d34=0x0;_0x245d34<_0x3e92ae[_0xe03f('0x48')][_0xe03f('0x74')][_0xe03f('0x4d')];_0x245d34+=0x1){socket[_0xe03f('0x134')](_0xe03f('0x137'),{'UserId':Number(_0x3e92ae[_0xe03f('0x48')][_0xe03f('0x74')][_0x245d34]),'ChatWebsiteId':Number(_0x3e92ae[_0xe03f('0x5c')]['id'])});}}else{socket['emit'](_0xe03f('0x137'),{'UserId':Number(_0x3e92ae['query'][_0xe03f('0x74')]),'ChatWebsiteId':Number(_0x3e92ae[_0xe03f('0x5c')]['id'])});}});}})[_0xe03f('0x25')](respondWithStatusCode(_0x661f36,null))[_0xe03f('0x5a')](handleError(_0x661f36,null));};exports[_0xe03f('0x138')]=function(_0x382112,_0x1a30cc,_0x40e7ff){var _0x3a0830={};var _0x32e764={};var _0x14bbb2;var _0x5d1776;return db[_0xe03f('0x43')][_0xe03f('0x6c')]({'where':{'id':_0x382112[_0xe03f('0x5c')]['id']}})[_0xe03f('0x25')](handleEntityNotFound(_0x1a30cc,null))[_0xe03f('0x25')](function(_0x4c0cc6){if(_0x4c0cc6){_0x14bbb2=_0x4c0cc6;_0x32e764['model']=_[_0xe03f('0x5e')](db[_0xe03f('0xcf')][_0xe03f('0x44')]);_0x32e764[_0xe03f('0x48')]=_[_0xe03f('0x5e')](_0x382112[_0xe03f('0x48')]);_0x32e764[_0xe03f('0x49')]=_[_0xe03f('0x4a')](_0x32e764[_0xe03f('0x47')],_0x32e764['query']);_0x3a0830[_0xe03f('0x4b')]=_['intersection'](_0x32e764[_0xe03f('0x47')],qs[_0xe03f('0x4c')](_0x382112[_0xe03f('0x48')][_0xe03f('0x4c')]));_0x3a0830[_0xe03f('0x4b')]=_0x3a0830[_0xe03f('0x4b')]['length']?_0x3a0830['attributes']:_0x32e764[_0xe03f('0x47')];_0x3a0830[_0xe03f('0x71')]=qs[_0xe03f('0x6d')](_0x382112['query'][_0xe03f('0x6d')]);_0x3a0830[_0xe03f('0x50')]=qs[_0xe03f('0x49')](_[_0xe03f('0x51')](_0x382112[_0xe03f('0x48')],_0x32e764['filters']));if(_0x382112[_0xe03f('0x48')]['filter']){_0x3a0830[_0xe03f('0x50')]=_[_0xe03f('0x55')](_0x3a0830[_0xe03f('0x50')],{'$or':_['map'](_0x3a0830[_0xe03f('0x4b')],function(_0x338d23){var _0x21a7e9={};_0x21a7e9[_0x338d23]={'$like':'%'+_0x382112[_0xe03f('0x48')]['filter']+'%'};return _0x21a7e9;})});}_0x3a0830=_[_0xe03f('0x55')]({},_0x3a0830,_0x382112[_0xe03f('0x56')]);return _0x14bbb2[_0xe03f('0x138')](_0x3a0830);}})['then'](function(_0x3277da){if(_0x3277da){_0x5d1776=_0x3277da['length'];if(!_0x382112['query']['hasOwnProperty'](_0xe03f('0x4f'))){_0x3a0830[_0xe03f('0x35')]=qs[_0xe03f('0x35')](_0x382112[_0xe03f('0x48')]['limit']);_0x3a0830['offset']=qs[_0xe03f('0x33')](_0x382112[_0xe03f('0x48')][_0xe03f('0x33')]);}return _0x14bbb2[_0xe03f('0x138')](_0x3a0830);}})[_0xe03f('0x25')](function(_0x3831b9){if(_0x3831b9){return _0x3831b9?{'count':_0x5d1776,'rows':_0x3831b9}:null;}})[_0xe03f('0x25')](respondWithResult(_0x1a30cc,null))[_0xe03f('0x5a')](handleError(_0x1a30cc,null));};
\ No newline at end of file
+var _0x4934=['getCustomerAvatar','server/files/images/avatars/customer_avatar.png','customerAvatar','showCustomerAvatar','getSystemAvatar','notify','user-agent-parser','setUA','user-agent','getResult','CmContact','ValidationError','no\x20available\x20attributes','difference','createdAt','updatedAt','CompanyId','Sequelize','from\x20is\x20mandatory','body\x20is\x20mandatory\x20and\x20not\x20empty','mapKey','mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','includes','CmList','Contacts','DESC','ChatApplication','Applications','List','account','list','applications','priority','asc','ListId','contact','headers','cf-connecting-ip','x-forwarded-for','first','split','firstName','lastName','x-real-port','referer','browser','version','unknown','format','device','vendor','%s\x20%s\x20%s','threadId','externalUrl','ContactId','interaction','ChatInteraction','spread','messageId','autoclose','push','close','unmanaged','*,*,*,*','ChatMessage','AttachmentId','UserId','unshift','agent','waitForTheAssignedAgent','forcedOwnership','Start','startRouting','EventManager','offline','files','from','send','mapKeyOffline\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','mapKeyOffline\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','mapKeyOffline','MailAccount','findOrCreate','server/files/templates/chatOfflineMessage.ejs','toPairs','offlineMessageBody','originalname','mimetype','server','attachments','offline-chat','openNewInteraction','transaction','Attachment','MailServerOut','Smtp','forwardOfflineAddress','service','host','port','secure','authentication','pass','sendMail','\x22%s\x22\x20<%s>','email','offlineMessageSubject','MailAccountId','subjectOffline','mapValues','Chat','NotifyMailAccount','notifyMail','remove','Could\x20not\x20remove\x20attachment\x20file','addInteraction','Contact','Owner','internal','Tag','Tags','tag','Command','getSnippet','timezone','iftime\x20%s,%s','interval','indexOf','ONLINE','OFFLINE','No\x20timezone','[%s][INTERVAL][%s]\x20%s\x20%s\x20(%s)','Interval','Intervals','getProactiveActions','virtual','chatLicenseExceeded','all','some','readFileSync','utf8','x-real-ip','connection','remoteAddress','replace','render','color','textColor','addApplications','getApplications','addProactiveActions','omit','ChatProactiveAction','online','false','offlineForm','items','fromKey','getOfflineMessages','ChatOfflineMessage','Attachments','addAgents','emit','userChatWebsite:save','removeAgents','userChatWebsite:remove','getAgents','User','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','util','sox','ejs','fs-extra','lodash','squel','crypto','querystring','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/license/util','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./chatWebsite.socket','register','client','http','request','then','info','ChatWebsite,\x20%s,\x20%s','request\x20sent','debug','ChatWebsite,\x20%s,\x20%s,\x20%s','stringify','error','message','result','status','end','json','undefined','offset','count','limit','set','Content-Range','apply','reject','update','destroy','get','ChatWebsites','UserProfileResource','sendStatus','stack','name','index','Pause','mandatoryDispositionPause','map','ChatWebsite','fieldName','type','key','query','keys','filters','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','sort','filter','where','merge','VIRTUAL','includeAll','rows','catch','show','rawAttributes','options','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','find','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','params','describe','addDisposition','ChatWebsiteId','Disposition','getDispositions','order','pick','include','findAll','removeDispositions','ids','addAnswer','getAnswers','findOne','CannedAnswer','removeAnswers','addLogo','sitepic','file','filename','addAvatar','addCustomerAvatar','addSystemAvatar','systemAvatar','getLogo','join','getLicense','custom','isNil','existsSync','root','getAvatar','agentAvatar','server/files/images/avatars/','download'];(function(_0xd20b50,_0x49b5b3){var _0xe4ecc7=function(_0x2caebd){while(--_0x2caebd){_0xd20b50['push'](_0xd20b50['shift']());}};_0xe4ecc7(++_0x49b5b3);}(_0x4934,0x1d4));var _0x4493=function(_0x4e1e1e,_0x3998bd){_0x4e1e1e=_0x4e1e1e-0x0;var _0x2a0d75=_0x4934[_0x4e1e1e];return _0x2a0d75;};'use strict';var emlformat=require(_0x4493('0x0'));var rimraf=require(_0x4493('0x1'));var zipdir=require(_0x4493('0x2'));var jsonpatch=require(_0x4493('0x3'));var rp=require('request-promise');var moment=require(_0x4493('0x4'));var BPromise=require(_0x4493('0x5'));var Mustache=require('mustache');var util=require(_0x4493('0x6'));var path=require('path');var sox=require(_0x4493('0x7'));var csv=require('to-csv');var ejs=require(_0x4493('0x8'));var fs=require('fs');var fs_extra=require(_0x4493('0x9'));var _=require(_0x4493('0xa'));var squel=require(_0x4493('0xb'));var crypto=require(_0x4493('0xc'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x4493('0xd'));var Papa=require('papaparse');var Redis=require(_0x4493('0xe'));var authService=require(_0x4493('0xf'));var qs=require('../../components/parsers/qs');var as=require(_0x4493('0x10'));var hardwareService=require(_0x4493('0x11'));var logger=require('../../config/logger')(_0x4493('0x12'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0x4493('0x13'));var db=require(_0x4493('0x14'))['db'];config[_0x4493('0x15')]=_[_0x4493('0x16')](config[_0x4493('0x15')],{'host':_0x4493('0x17'),'port':0x18eb});var socket=require(_0x4493('0x18'))(new Redis(config[_0x4493('0x15')]));require(_0x4493('0x19'))[_0x4493('0x1a')](socket);var jayson=require('jayson/promise');var client=jayson[_0x4493('0x1b')][_0x4493('0x1c')]({'port':0x232c});var client9002=jayson[_0x4493('0x1b')]['http']({'port':0x232a});var client9003=jayson[_0x4493('0x1b')][_0x4493('0x1c')]({'port':0x232b});var client9001=jayson['client'][_0x4493('0x1c')]({'port':0x2329});function respondWithRpcPromise(_0x42b6d8,_0x5b14d6,_0x57b1f8,_0x5d4ea3){return new BPromise(function(_0x128753,_0x137f86){var _0x39125e=_0x5d4ea3||client;return _0x39125e[_0x4493('0x1d')](_0x42b6d8,_0x57b1f8)[_0x4493('0x1e')](function(_0x4f94aa){logger[_0x4493('0x1f')](_0x4493('0x20'),_0x5b14d6,_0x4493('0x21'));logger[_0x4493('0x22')](_0x4493('0x23'),_0x5b14d6,_0x4493('0x21'),JSON[_0x4493('0x24')](_0x4f94aa));if(_0x4f94aa['error']){if(_0x4f94aa[_0x4493('0x25')]['code']===0x1f4){logger[_0x4493('0x25')](_0x4493('0x20'),_0x5b14d6,_0x4f94aa[_0x4493('0x25')][_0x4493('0x26')]);return _0x137f86(_0x4f94aa[_0x4493('0x25')][_0x4493('0x26')]);}logger[_0x4493('0x25')](_0x4493('0x20'),_0x5b14d6,_0x4f94aa['error']['message']);return _0x128753(_0x4f94aa[_0x4493('0x25')][_0x4493('0x26')]);}else{logger[_0x4493('0x1f')]('ChatWebsite,\x20%s,\x20%s',_0x5b14d6,'request\x20sent');_0x128753(_0x4f94aa[_0x4493('0x27')][_0x4493('0x26')]);}})['catch'](function(_0x1dc530){logger[_0x4493('0x25')](_0x4493('0x20'),_0x5b14d6,_0x1dc530);_0x137f86(_0x1dc530);});});}function respondWithStatusCode(_0x2e0828,_0x541094){_0x541094=_0x541094||0xcc;return function(_0x1d0d0c){if(_0x1d0d0c){return _0x2e0828['sendStatus'](_0x541094);}return _0x2e0828[_0x4493('0x28')](_0x541094)[_0x4493('0x29')]();};}function respondWithResult(_0x50b60c,_0x36b40c){_0x36b40c=_0x36b40c||0xc8;return function(_0x2369c2){if(_0x2369c2){return _0x50b60c[_0x4493('0x28')](_0x36b40c)[_0x4493('0x2a')](_0x2369c2);}};}function respondWithFilteredResult(_0x19ad27,_0x118249){return function(_0x1b6991){if(_0x1b6991){var _0x30af2c=typeof _0x118249['offset']==='undefined'&&typeof _0x118249['limit']===_0x4493('0x2b');var _0x4ccbfe=_0x1b6991['count'];var _0x321992=_0x30af2c?0x0:_0x118249[_0x4493('0x2c')];var _0x2cf7a0=_0x30af2c?_0x1b6991[_0x4493('0x2d')]:_0x118249[_0x4493('0x2c')]+_0x118249[_0x4493('0x2e')];var _0x4c87b1;if(_0x2cf7a0>=_0x4ccbfe){_0x2cf7a0=_0x4ccbfe;_0x4c87b1=0xc8;}else{_0x4c87b1=0xce;}_0x19ad27[_0x4493('0x28')](_0x4c87b1);return _0x19ad27[_0x4493('0x2f')](_0x4493('0x30'),_0x321992+'-'+_0x2cf7a0+'/'+_0x4ccbfe)[_0x4493('0x2a')](_0x1b6991);}return null;};}function patchUpdates(_0x1b981b){return function(_0x339e3f){try{jsonpatch[_0x4493('0x31')](_0x339e3f,_0x1b981b,!![]);}catch(_0x58e26f){return BPromise[_0x4493('0x32')](_0x58e26f);}return _0x339e3f['save']();};}function saveUpdates(_0x57c0e3,_0x14c1da){return function(_0x4cf197){if(_0x4cf197){return _0x4cf197[_0x4493('0x33')](_0x57c0e3)[_0x4493('0x1e')](function(_0x233ccc){return _0x233ccc;});}return null;};}function removeEntity(_0x280e26,_0x22713e){return function(_0x5e705d){if(_0x5e705d){return _0x5e705d[_0x4493('0x34')]()[_0x4493('0x1e')](function(){var _0x15748d=_0x5e705d[_0x4493('0x35')]({'plain':!![]});var _0x4daa38=_0x4493('0x36');return db[_0x4493('0x37')]['destroy']({'where':{'type':_0x4daa38,'resourceId':_0x15748d['id']}})[_0x4493('0x1e')](function(){return _0x5e705d;});})['then'](function(){_0x280e26[_0x4493('0x28')](0xcc)['end']();});}};}function handleEntityNotFound(_0x47777a,_0x46882f){return function(_0x207db4){if(!_0x207db4){_0x47777a[_0x4493('0x38')](0x194);}return _0x207db4;};}function handleError(_0x328250,_0x4c5e51){_0x4c5e51=_0x4c5e51||0x1f4;return function(_0x4ed468){logger[_0x4493('0x25')](_0x4ed468[_0x4493('0x39')]);if(_0x4ed468[_0x4493('0x3a')]){delete _0x4ed468[_0x4493('0x3a')];}_0x328250[_0x4493('0x28')](_0x4c5e51)['send'](_0x4ed468);};}exports[_0x4493('0x3b')]=function(_0x1d3ce9,_0x44796a){var _0x4c5ac9={'include':[{'model':db[_0x4493('0x3c')],'as':_0x4493('0x3d')}]},_0x33d1f9={},_0x2c8246={'count':0x0,'rows':[]};var _0x1c069a=_[_0x4493('0x3e')](db[_0x4493('0x3f')]['rawAttributes'],function(_0x15e876){return{'name':_0x15e876[_0x4493('0x40')],'type':_0x15e876[_0x4493('0x41')][_0x4493('0x42')]};});_0x33d1f9['model']=_['map'](_0x1c069a,_0x4493('0x3a'));_0x33d1f9[_0x4493('0x43')]=_[_0x4493('0x44')](_0x1d3ce9['query']);_0x33d1f9[_0x4493('0x45')]=_[_0x4493('0x46')](_0x33d1f9[_0x4493('0x47')],_0x33d1f9[_0x4493('0x43')]);_0x4c5ac9[_0x4493('0x48')]=_[_0x4493('0x46')](_0x33d1f9[_0x4493('0x47')],qs[_0x4493('0x49')](_0x1d3ce9[_0x4493('0x43')][_0x4493('0x49')]));_0x4c5ac9[_0x4493('0x48')]=_0x4c5ac9[_0x4493('0x48')][_0x4493('0x4a')]?_0x4c5ac9['attributes']:_0x33d1f9[_0x4493('0x47')];if(!_0x1d3ce9[_0x4493('0x43')][_0x4493('0x4b')](_0x4493('0x4c'))){_0x4c5ac9[_0x4493('0x2e')]=qs['limit'](_0x1d3ce9[_0x4493('0x43')][_0x4493('0x2e')]);_0x4c5ac9[_0x4493('0x2c')]=qs[_0x4493('0x2c')](_0x1d3ce9[_0x4493('0x43')][_0x4493('0x2c')]);}_0x4c5ac9['order']=qs['sort'](_0x1d3ce9[_0x4493('0x43')][_0x4493('0x4d')]);_0x4c5ac9['where']=qs[_0x4493('0x45')](_['pick'](_0x1d3ce9[_0x4493('0x43')],_0x33d1f9[_0x4493('0x45')]),_0x1c069a);if(_0x1d3ce9[_0x4493('0x43')][_0x4493('0x4e')]){_0x4c5ac9[_0x4493('0x4f')]=_[_0x4493('0x50')](_0x4c5ac9['where'],{'$or':_[_0x4493('0x3e')](_0x1c069a,function(_0x97be76){if(_0x97be76[_0x4493('0x41')]!==_0x4493('0x51')){var _0x2d2ce6={};_0x2d2ce6[_0x97be76['name']]={'$like':'%'+_0x1d3ce9['query'][_0x4493('0x4e')]+'%'};return _0x2d2ce6;}})});}_0x4c5ac9=_[_0x4493('0x50')]({},_0x4c5ac9,_0x1d3ce9['options']);var _0x59f30f={'where':_0x4c5ac9['where']};return db['ChatWebsite'][_0x4493('0x2d')](_0x59f30f)['then'](function(_0x32f8c6){_0x2c8246['count']=_0x32f8c6;if(_0x1d3ce9[_0x4493('0x43')][_0x4493('0x52')]){_0x4c5ac9['include']=[{'all':!![]}];}return db[_0x4493('0x3f')]['findAll'](_0x4c5ac9);})[_0x4493('0x1e')](function(_0x83806c){_0x2c8246[_0x4493('0x53')]=_0x83806c;return _0x2c8246;})['then'](respondWithFilteredResult(_0x44796a,_0x4c5ac9))[_0x4493('0x54')](handleError(_0x44796a,null));};exports[_0x4493('0x55')]=function(_0x4e993d,_0x399f70){var _0x1a837b={'raw':![],'where':{'id':_0x4e993d['params']['id']},'include':[{'model':db[_0x4493('0x3c')],'as':'mandatoryDispositionPause'}]},_0x494936={};_0x494936[_0x4493('0x47')]=_[_0x4493('0x44')](db[_0x4493('0x3f')][_0x4493('0x56')]);_0x494936[_0x4493('0x43')]=_['keys'](_0x4e993d[_0x4493('0x43')]);_0x494936[_0x4493('0x45')]=_['intersection'](_0x494936[_0x4493('0x47')],_0x494936[_0x4493('0x43')]);_0x1a837b[_0x4493('0x48')]=_[_0x4493('0x46')](_0x494936[_0x4493('0x47')],qs[_0x4493('0x49')](_0x4e993d[_0x4493('0x43')][_0x4493('0x49')]));_0x1a837b[_0x4493('0x48')]=_0x1a837b[_0x4493('0x48')][_0x4493('0x4a')]?_0x1a837b[_0x4493('0x48')]:_0x494936[_0x4493('0x47')];if(_0x4e993d[_0x4493('0x43')][_0x4493('0x52')]){_0x1a837b['include']=[{'all':!![]}];}_0x1a837b=_[_0x4493('0x50')]({},_0x1a837b,_0x4e993d[_0x4493('0x57')]);return db[_0x4493('0x3f')]['find'](_0x1a837b)[_0x4493('0x1e')](handleEntityNotFound(_0x399f70,null))[_0x4493('0x1e')](respondWithResult(_0x399f70,null))['catch'](handleError(_0x399f70,null));};exports['create']=function(_0x4aaf6e,_0xee6e1d){return db[_0x4493('0x3f')][_0x4493('0x58')](_0x4aaf6e[_0x4493('0x59')],{})['then'](function(_0x4a34ba){var _0x3f9b3b=_0x4aaf6e[_0x4493('0x5a')]['get']({'plain':!![]});if(!_0x3f9b3b)throw new Error(_0x4493('0x5b'));if(_0x3f9b3b[_0x4493('0x5c')]===_0x4493('0x5a')){var _0x9e6252=_0x4a34ba[_0x4493('0x35')]({'plain':!![]});var _0x3e86d2=_0x4493('0x36');return db['UserProfileSection'][_0x4493('0x5d')]({'where':{'name':_0x3e86d2,'userProfileId':_0x3f9b3b['userProfileId']},'raw':!![]})[_0x4493('0x1e')](function(_0x1ce337){if(_0x1ce337&&_0x1ce337[_0x4493('0x5e')]===0x0){return db[_0x4493('0x37')][_0x4493('0x58')]({'name':_0x9e6252[_0x4493('0x3a')],'resourceId':_0x9e6252['id'],'type':_0x1ce337[_0x4493('0x3a')],'sectionId':_0x1ce337['id']},{})['then'](function(){return _0x4a34ba;});}else{return _0x4a34ba;}})[_0x4493('0x54')](function(_0x45c291){logger[_0x4493('0x25')](_0x4493('0x5f'),_0x45c291);throw _0x45c291;});}return _0x4a34ba;})['then'](respondWithResult(_0xee6e1d,0xc9))[_0x4493('0x54')](handleError(_0xee6e1d,null));};exports[_0x4493('0x33')]=function(_0x4041d5,_0x17b3f9){if(_0x4041d5['body']['id']){delete _0x4041d5['body']['id'];}return db[_0x4493('0x3f')][_0x4493('0x5d')]({'where':{'id':_0x4041d5[_0x4493('0x60')]['id']},'include':[{'model':db[_0x4493('0x3c')],'as':_0x4493('0x3d')}]})['then'](handleEntityNotFound(_0x17b3f9,null))[_0x4493('0x1e')](saveUpdates(_0x4041d5['body'],null))[_0x4493('0x1e')](respondWithResult(_0x17b3f9,null))[_0x4493('0x54')](handleError(_0x17b3f9,null));};exports[_0x4493('0x34')]=function(_0x1e9fc7,_0x22def1){return db[_0x4493('0x3f')][_0x4493('0x5d')]({'where':{'id':_0x1e9fc7['params']['id']}})['then'](handleEntityNotFound(_0x22def1,null))['then'](removeEntity(_0x22def1,null))[_0x4493('0x54')](handleError(_0x22def1,null));};exports['describe']=function(_0x2ce5b0,_0x235b24){return db[_0x4493('0x3f')][_0x4493('0x61')]()[_0x4493('0x1e')](respondWithResult(_0x235b24,null))[_0x4493('0x54')](handleError(_0x235b24,null));};exports[_0x4493('0x62')]=function(_0x100d0f,_0x3ef378,_0x4cb8d5){if(_0x100d0f[_0x4493('0x59')]['id']){delete _0x100d0f[_0x4493('0x59')]['id'];}return db[_0x4493('0x3f')]['find']({'where':{'id':_0x100d0f[_0x4493('0x60')]['id']}})['then'](handleEntityNotFound(_0x3ef378,null))[_0x4493('0x1e')](function(_0x5055e9){if(_0x5055e9){_0x100d0f[_0x4493('0x59')][_0x4493('0x63')]=_0x5055e9['id'];return db[_0x4493('0x64')]['create'](_0x100d0f[_0x4493('0x59')]);}})[_0x4493('0x1e')](respondWithResult(_0x3ef378,null))[_0x4493('0x54')](handleError(_0x3ef378,null));};exports[_0x4493('0x65')]=function(_0x9c0fb5,_0x11a3e3,_0x114f87){var _0x5cbd6c={'raw':![],'where':{}};var _0x5abfd4={};var _0x27ddf0={'count':0x0,'rows':[]};return db[_0x4493('0x3f')]['findOne']({'where':{'id':_0x9c0fb5[_0x4493('0x60')]['id']}})[_0x4493('0x1e')](handleEntityNotFound(_0x11a3e3,null))[_0x4493('0x1e')](function(_0x3c4b72){if(_0x3c4b72){_0x5abfd4[_0x4493('0x47')]=_[_0x4493('0x44')](db[_0x4493('0x64')]['rawAttributes']);_0x5abfd4[_0x4493('0x43')]=_[_0x4493('0x44')](_0x9c0fb5[_0x4493('0x43')]);_0x5abfd4['filters']=_[_0x4493('0x46')](_0x5abfd4['model'],_0x5abfd4[_0x4493('0x43')]);_0x5cbd6c[_0x4493('0x48')]=_[_0x4493('0x46')](_0x5abfd4[_0x4493('0x47')],qs[_0x4493('0x49')](_0x9c0fb5['query'][_0x4493('0x49')]));_0x5cbd6c['attributes']=_0x5cbd6c['attributes'][_0x4493('0x4a')]?_0x5cbd6c[_0x4493('0x48')]:_0x5abfd4[_0x4493('0x47')];if(!_0x9c0fb5['query']['hasOwnProperty'](_0x4493('0x4c'))){_0x5cbd6c[_0x4493('0x2e')]=qs['limit'](_0x9c0fb5[_0x4493('0x43')][_0x4493('0x2e')]);_0x5cbd6c['offset']=qs[_0x4493('0x2c')](_0x9c0fb5[_0x4493('0x43')]['offset']);}_0x5cbd6c[_0x4493('0x66')]=qs[_0x4493('0x4d')](_0x9c0fb5['query'][_0x4493('0x4d')]);_0x5cbd6c[_0x4493('0x4f')]=qs['filters'](_[_0x4493('0x67')](_0x9c0fb5[_0x4493('0x43')],_0x5abfd4[_0x4493('0x45')]));_0x5cbd6c[_0x4493('0x4f')][_0x4493('0x63')]=_0x3c4b72['id'];if(_0x9c0fb5[_0x4493('0x43')][_0x4493('0x4e')]){_0x5cbd6c[_0x4493('0x4f')]=_['merge'](_0x5cbd6c[_0x4493('0x4f')],{'$or':_['map'](_0x5cbd6c['attributes'],function(_0x1bd4bb){var _0x30f574={};_0x30f574[_0x1bd4bb]={'$like':'%'+_0x9c0fb5[_0x4493('0x43')][_0x4493('0x4e')]+'%'};return _0x30f574;})});}_0x5cbd6c=_[_0x4493('0x50')]({},_0x5cbd6c,_0x9c0fb5['options']);return db[_0x4493('0x64')][_0x4493('0x2d')]({'where':_0x5cbd6c[_0x4493('0x4f')]})[_0x4493('0x1e')](function(_0x582961){_0x27ddf0[_0x4493('0x2d')]=_0x582961;if(_0x9c0fb5[_0x4493('0x43')][_0x4493('0x52')]){_0x5cbd6c[_0x4493('0x68')]=[{'all':!![]}];}return db[_0x4493('0x64')][_0x4493('0x69')](_0x5cbd6c);})[_0x4493('0x1e')](function(_0x74c4){_0x27ddf0[_0x4493('0x53')]=_0x74c4;return _0x27ddf0;});}})[_0x4493('0x1e')](respondWithFilteredResult(_0x11a3e3,_0x5cbd6c))[_0x4493('0x54')](handleError(_0x11a3e3,null));};exports[_0x4493('0x6a')]=function(_0x1eec00,_0x18c25b,_0xcc3f49){return db[_0x4493('0x3f')][_0x4493('0x5d')]({'where':{'id':_0x1eec00['params']['id']}})[_0x4493('0x1e')](handleEntityNotFound(_0x18c25b,null))[_0x4493('0x1e')](function(_0x1699ab){if(_0x1699ab){return _0x1699ab['removeDispositions'](_0x1eec00['query'][_0x4493('0x6b')]);}})['then'](respondWithStatusCode(_0x18c25b,null))['catch'](handleError(_0x18c25b,null));};exports[_0x4493('0x6c')]=function(_0x1e7002,_0x2d0d84,_0xc31872){if(_0x1e7002['body']['id']){delete _0x1e7002[_0x4493('0x59')]['id'];}return db[_0x4493('0x3f')]['find']({'where':{'id':_0x1e7002[_0x4493('0x60')]['id']}})['then'](handleEntityNotFound(_0x2d0d84,null))['then'](function(_0x4913a9){if(_0x4913a9){_0x1e7002['body'][_0x4493('0x63')]=_0x4913a9['id'];return db['CannedAnswer']['create'](_0x1e7002[_0x4493('0x59')]);}})[_0x4493('0x1e')](respondWithResult(_0x2d0d84,null))[_0x4493('0x54')](handleError(_0x2d0d84,null));};exports[_0x4493('0x6d')]=function(_0x42f851,_0x209c42,_0x417d30){var _0xc77914={'raw':![],'where':{}};var _0x2d9c9b={};var _0x31e291={'count':0x0,'rows':[]};return db[_0x4493('0x3f')][_0x4493('0x6e')]({'where':{'id':_0x42f851[_0x4493('0x60')]['id']}})[_0x4493('0x1e')](handleEntityNotFound(_0x209c42,null))[_0x4493('0x1e')](function(_0x140fc2){if(_0x140fc2){_0x2d9c9b[_0x4493('0x47')]=_[_0x4493('0x44')](db[_0x4493('0x6f')]['rawAttributes']);_0x2d9c9b[_0x4493('0x43')]=_[_0x4493('0x44')](_0x42f851[_0x4493('0x43')]);_0x2d9c9b['filters']=_[_0x4493('0x46')](_0x2d9c9b[_0x4493('0x47')],_0x2d9c9b[_0x4493('0x43')]);_0xc77914[_0x4493('0x48')]=_[_0x4493('0x46')](_0x2d9c9b['model'],qs[_0x4493('0x49')](_0x42f851[_0x4493('0x43')]['fields']));_0xc77914[_0x4493('0x48')]=_0xc77914[_0x4493('0x48')][_0x4493('0x4a')]?_0xc77914[_0x4493('0x48')]:_0x2d9c9b['model'];if(!_0x42f851['query'][_0x4493('0x4b')](_0x4493('0x4c'))){_0xc77914[_0x4493('0x2e')]=qs[_0x4493('0x2e')](_0x42f851['query'][_0x4493('0x2e')]);_0xc77914[_0x4493('0x2c')]=qs[_0x4493('0x2c')](_0x42f851[_0x4493('0x43')][_0x4493('0x2c')]);}_0xc77914['order']=qs[_0x4493('0x4d')](_0x42f851['query'][_0x4493('0x4d')]);_0xc77914[_0x4493('0x4f')]=qs[_0x4493('0x45')](_[_0x4493('0x67')](_0x42f851[_0x4493('0x43')],_0x2d9c9b[_0x4493('0x45')]));_0xc77914[_0x4493('0x4f')][_0x4493('0x63')]=_0x140fc2['id'];if(_0x42f851[_0x4493('0x43')][_0x4493('0x4e')]){_0xc77914[_0x4493('0x4f')]=_['merge'](_0xc77914[_0x4493('0x4f')],{'$or':_[_0x4493('0x3e')](_0xc77914[_0x4493('0x48')],function(_0x3b9f9b){var _0x50fcb4={};_0x50fcb4[_0x3b9f9b]={'$like':'%'+_0x42f851['query'][_0x4493('0x4e')]+'%'};return _0x50fcb4;})});}_0xc77914=_[_0x4493('0x50')]({},_0xc77914,_0x42f851[_0x4493('0x57')]);return db[_0x4493('0x6f')][_0x4493('0x2d')]({'where':_0xc77914[_0x4493('0x4f')]})[_0x4493('0x1e')](function(_0x523094){_0x31e291[_0x4493('0x2d')]=_0x523094;if(_0x42f851[_0x4493('0x43')][_0x4493('0x52')]){_0xc77914[_0x4493('0x68')]=[{'all':!![]}];}return db[_0x4493('0x6f')][_0x4493('0x69')](_0xc77914);})[_0x4493('0x1e')](function(_0x2d5920){_0x31e291[_0x4493('0x53')]=_0x2d5920;return _0x31e291;});}})[_0x4493('0x1e')](respondWithFilteredResult(_0x209c42,_0xc77914))[_0x4493('0x54')](handleError(_0x209c42,null));};exports[_0x4493('0x70')]=function(_0xf8012e,_0x3d88b9,_0x1665cf){return db[_0x4493('0x3f')]['find']({'where':{'id':_0xf8012e[_0x4493('0x60')]['id']}})[_0x4493('0x1e')](handleEntityNotFound(_0x3d88b9,null))[_0x4493('0x1e')](function(_0x3245f1){if(_0x3245f1){return _0x3245f1[_0x4493('0x70')](_0xf8012e['query'][_0x4493('0x6b')]);}})['then'](respondWithStatusCode(_0x3d88b9,null))[_0x4493('0x54')](handleError(_0x3d88b9,null));};exports[_0x4493('0x71')]=function(_0x124086,_0x510f96,_0x207c36){_0x124086[_0x4493('0x59')][_0x4493('0x72')]=_0x124086[_0x4493('0x73')][_0x4493('0x74')];return db[_0x4493('0x3f')][_0x4493('0x5d')]({'where':{'id':_0x124086[_0x4493('0x60')]['id']}})['then'](handleEntityNotFound(_0x510f96,null))[_0x4493('0x1e')](saveUpdates(_0x124086[_0x4493('0x59')],null))[_0x4493('0x1e')](respondWithResult(_0x510f96,null))[_0x4493('0x54')](handleError(_0x510f96,null));};exports[_0x4493('0x75')]=function(_0x5e8916,_0x426fd9,_0x59094e){_0x5e8916['body']['agentAvatar']=_0x5e8916[_0x4493('0x73')][_0x4493('0x74')];return db[_0x4493('0x3f')][_0x4493('0x5d')]({'where':{'id':_0x5e8916[_0x4493('0x60')]['id']}})[_0x4493('0x1e')](handleEntityNotFound(_0x426fd9,null))[_0x4493('0x1e')](saveUpdates(_0x5e8916[_0x4493('0x59')],null))['then'](respondWithResult(_0x426fd9,null))[_0x4493('0x54')](handleError(_0x426fd9,null));};exports[_0x4493('0x76')]=function(_0x359305,_0x300060,_0xc066d1){_0x359305['body']['customerAvatar']=_0x359305[_0x4493('0x73')][_0x4493('0x74')];return db['ChatWebsite'][_0x4493('0x5d')]({'where':{'id':_0x359305[_0x4493('0x60')]['id']}})[_0x4493('0x1e')](handleEntityNotFound(_0x300060,null))[_0x4493('0x1e')](saveUpdates(_0x359305[_0x4493('0x59')],null))['then'](respondWithResult(_0x300060,null))['catch'](handleError(_0x300060,null));};exports[_0x4493('0x77')]=function(_0x1e8ec0,_0xd3bfff,_0x4f6405){_0x1e8ec0['body'][_0x4493('0x78')]=_0x1e8ec0['file'][_0x4493('0x74')];return db[_0x4493('0x3f')][_0x4493('0x5d')]({'where':{'id':_0x1e8ec0[_0x4493('0x60')]['id']}})['then'](handleEntityNotFound(_0xd3bfff,null))[_0x4493('0x1e')](saveUpdates(_0x1e8ec0[_0x4493('0x59')],null))[_0x4493('0x1e')](respondWithResult(_0xd3bfff,null))[_0x4493('0x54')](handleError(_0xd3bfff,null));};exports[_0x4493('0x79')]=function(_0x2c0906,_0x202bc7,_0x59fabe){var _0x54e2b9=path[_0x4493('0x7a')](config['root'],'server/files/images/logos/default_logo.svg');var _0x13c876={'where':{'id':_0x2c0906['params']['id']},'attributes':['id',_0x4493('0x72')],'raw':!![]};var _0x2a4b9c=![];return require(_0x4493('0x13'))[_0x4493('0x7b')]()[_0x4493('0x1e')](function(_0x49b464){if(_0x49b464){_0x2a4b9c=_0x49b464[_0x4493('0x7c')];}})[_0x4493('0x1e')](function(){return db[_0x4493('0x3f')][_0x4493('0x5d')](_0x13c876);})[_0x4493('0x1e')](handleEntityNotFound(_0x202bc7,null))['then'](function(_0x5696d5){if(_0x5696d5){if(!_[_0x4493('0x7d')](_0x5696d5[_0x4493('0x72')])){if(fs[_0x4493('0x7e')](path[_0x4493('0x7a')](config[_0x4493('0x7f')],'server/files/images/logos/',_0x5696d5[_0x4493('0x72')]))&&_0x2a4b9c){_0x54e2b9=path[_0x4493('0x7a')](config[_0x4493('0x7f')],'server/files/images/logos/',_0x5696d5['sitepic']);}}return _0x202bc7['download'](_0x54e2b9);}})[_0x4493('0x54')](handleError(_0x202bc7,null));};exports[_0x4493('0x80')]=function(_0x106dc9,_0x1a27c3,_0x1f4e6a){var _0x407433=path['join'](config[_0x4493('0x7f')],'server/files/images/avatars/default_avatar.png');var _0x31d603={'where':{'id':_0x106dc9['params']['id']},'attributes':['id',_0x4493('0x81')],'raw':!![]};return db[_0x4493('0x3f')][_0x4493('0x5d')](_0x31d603)[_0x4493('0x1e')](handleEntityNotFound(_0x1a27c3,null))[_0x4493('0x1e')](function(_0x55153b){if(_0x55153b){if(!_[_0x4493('0x7d')](_0x55153b['agentAvatar'])){if(fs[_0x4493('0x7e')](path[_0x4493('0x7a')](config[_0x4493('0x7f')],_0x4493('0x82'),_0x55153b[_0x4493('0x81')]))){_0x407433=path[_0x4493('0x7a')](config[_0x4493('0x7f')],_0x4493('0x82'),_0x55153b[_0x4493('0x81')]);}}return _0x1a27c3[_0x4493('0x83')](_0x407433);}})['catch'](handleError(_0x1a27c3,null));};exports[_0x4493('0x84')]=function(_0x3b26d6,_0x566f95,_0x56e427){var _0x267dfc=path['join'](config['root'],_0x4493('0x85'));var _0x4d0e97={'where':{'id':_0x3b26d6[_0x4493('0x60')]['id']},'attributes':['id',_0x4493('0x86'),_0x4493('0x87')],'raw':!![]};return db['ChatWebsite'][_0x4493('0x5d')](_0x4d0e97)[_0x4493('0x1e')](handleEntityNotFound(_0x566f95,null))[_0x4493('0x1e')](function(_0x30f0c1){if(_0x30f0c1){if(!_[_0x4493('0x7d')](_0x30f0c1['customerAvatar'])){if(fs[_0x4493('0x7e')](path[_0x4493('0x7a')](config[_0x4493('0x7f')],_0x4493('0x82'),_0x30f0c1['customerAvatar']))&&_0x30f0c1[_0x4493('0x87')]){_0x267dfc=path[_0x4493('0x7a')](config['root'],'server/files/images/avatars/',_0x30f0c1['customerAvatar']);}}return _0x566f95[_0x4493('0x83')](_0x267dfc);}})['catch'](handleError(_0x566f95,null));};exports[_0x4493('0x88')]=function(_0x512c81,_0x439980,_0x2ba6c5){var _0x2810be=path[_0x4493('0x7a')](config[_0x4493('0x7f')],'server/files/images/avatars/system_avatar.png');var _0x2feb15={'where':{'id':_0x512c81[_0x4493('0x60')]['id']},'attributes':['id',_0x4493('0x78')],'raw':!![]};return db[_0x4493('0x3f')][_0x4493('0x5d')](_0x2feb15)[_0x4493('0x1e')](handleEntityNotFound(_0x439980,null))[_0x4493('0x1e')](function(_0x4a1604){if(_0x4a1604){if(!_[_0x4493('0x7d')](_0x4a1604['systemAvatar'])){if(fs[_0x4493('0x7e')](path['join'](config[_0x4493('0x7f')],_0x4493('0x82'),_0x4a1604['systemAvatar']))){_0x2810be=path[_0x4493('0x7a')](config[_0x4493('0x7f')],_0x4493('0x82'),_0x4a1604[_0x4493('0x78')]);}}return _0x439980[_0x4493('0x83')](_0x2810be);}})[_0x4493('0x54')](handleError(_0x439980,null));};exports[_0x4493('0x89')]=function(_0x35998b,_0x2f2481,_0x405737){var _0x850445=require(_0x4493('0x8a'));var _0x4e1d70=new _0x850445();var _0x1f532d=_0x4e1d70[_0x4493('0x8b')](_0x35998b['headers'][_0x4493('0x8c')])[_0x4493('0x8d')]();var _0x49711c={'body':_0x35998b[_0x4493('0x59')],'channel':'chat'};var _0x51d4e7=[];var _0x29ba78=[];var _0x3c907c={};var _0x4f41cf=![];return db[_0x4493('0x8e')][_0x4493('0x61')]()[_0x4493('0x1e')](function(_0x1ec2ae){if(!_0x1ec2ae){throw new db['Sequelize'][(_0x4493('0x8f'))](_0x4493('0x90'));}_0x51d4e7=_[_0x4493('0x91')](_[_0x4493('0x44')](_0x1ec2ae),[_0x4493('0x92'),_0x4493('0x93')]);_0x29ba78=_['difference'](_[_0x4493('0x44')](_0x1ec2ae),[_0x4493('0x92'),_0x4493('0x93'),_0x4493('0x94'),'ListId']);if(_0x35998b['body']['id']){delete _0x35998b[_0x4493('0x59')]['id'];}if(_[_0x4493('0x7d')](_0x35998b[_0x4493('0x59')]['from'])){throw new db[(_0x4493('0x95'))][(_0x4493('0x8f'))](_0x4493('0x96'));}if(_['isNil'](_0x35998b[_0x4493('0x59')][_0x4493('0x59')])||_0x35998b[_0x4493('0x59')][_0x4493('0x59')]===''){throw new db[(_0x4493('0x95'))][(_0x4493('0x8f'))](_0x4493('0x97'));}if(_['isNil'](_0x35998b[_0x4493('0x59')][_0x4493('0x98')])){throw new db['Sequelize'][(_0x4493('0x8f'))](_0x4493('0x99')+_0x29ba78);}if(!_[_0x4493('0x9a')](_0x29ba78,_0x35998b[_0x4493('0x59')][_0x4493('0x98')])){throw new db[(_0x4493('0x95'))][(_0x4493('0x8f'))]('mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20'+_0x29ba78);}_0x3c907c[_0x35998b['body'][_0x4493('0x98')]]=_0x35998b[_0x4493('0x59')]['from'];})[_0x4493('0x1e')](function(){return db[_0x4493('0x3f')][_0x4493('0x5d')]({'where':{'id':_0x35998b[_0x4493('0x60')]['id']},'include':[{'model':db[_0x4493('0x9b')],'as':'List','include':[{'model':db['CmContact'],'as':_0x4493('0x9c'),'where':_0x3c907c,'limit':0x1,'order':[[_0x4493('0x93'),_0x4493('0x9d')]]}]},{'model':db[_0x4493('0x9e')],'as':_0x4493('0x9f')}]});})[_0x4493('0x1e')](handleEntityNotFound(_0x2f2481,null))[_0x4493('0x1e')](function(_0xdd4371){if(_0xdd4371&&_0xdd4371[_0x4493('0xa0')]){_0x49711c[_0x4493('0xa1')]=_0xdd4371;_0x49711c['applications']=_0xdd4371[_0x4493('0x9f')];_0x49711c[_0x4493('0xa2')]=_0xdd4371[_0x4493('0xa0')];_0x49711c[_0x4493('0xa3')]=_['orderBy'](_0x49711c[_0x4493('0xa3')],[_0x4493('0xa4')],[_0x4493('0xa5')]);if(_0x49711c[_0x4493('0xa1')]['Applications']){delete _0x49711c[_0x4493('0xa1')]['Applications'];}if(_0x49711c[_0x4493('0xa1')][_0x4493('0xa0')]&&_0x49711c[_0x4493('0xa1')]['List'][_0x4493('0x9c')][_0x4493('0x4a')]){return _0x49711c[_0x4493('0xa1')][_0x4493('0xa0')][_0x4493('0x9c')][0x0];}var _0x3d941a=_['defaults'](_0x35998b[_0x4493('0x59')],{'firstName':_0x35998b[_0x4493('0x59')]['from'],'ListId':_0xdd4371[_0x4493('0xa6')]});_0x3d941a[_0x35998b[_0x4493('0x59')][_0x4493('0x98')]]=_0x35998b[_0x4493('0x59')]['from'];return db[_0x4493('0x8e')][_0x4493('0x58')](_0x3d941a,{'fields':_0x51d4e7,'raw':!![]});}})[_0x4493('0x1e')](handleEntityNotFound(_0x2f2481,null))[_0x4493('0x1e')](function(_0x4b4b86){_0x49711c[_0x4493('0xa7')]=_0x4b4b86;var _0x481857=_0x35998b[_0x4493('0x59')]['customerIp'];if(_0x35998b[_0x4493('0xa8')][_0x4493('0xa9')]){_0x481857=_0x35998b[_0x4493('0xa8')][_0x4493('0xa9')];}else if(_0x35998b[_0x4493('0xa8')][_0x4493('0xaa')]){_0x481857=_[_0x4493('0xab')](_0x35998b['headers'][_0x4493('0xaa')][_0x4493('0xac')](','));}if(_0x4b4b86){var _0x59b35c={'ContactId':_0x4b4b86['id'],'ChatWebsiteId':_0x35998b[_0x4493('0x60')]['id'],'from':(_0x4b4b86[_0x4493('0xad')]||'')+'\x20'+(_0x4b4b86[_0x4493('0xae')]||''),'customerIp':_0x481857,'customerPort':_0x35998b[_0x4493('0xa8')][_0x4493('0xaf')]?_0x35998b[_0x4493('0xa8')]['x-real-port']:null,'referer':_0x35998b[_0x4493('0x59')][_0x4493('0xb0')],'browserName':_0x1f532d[_0x4493('0xb1')][_0x4493('0x3a')]&&_0x1f532d[_0x4493('0xb1')][_0x4493('0xb2')]?util['format']('%s\x20%s',_0x1f532d[_0x4493('0xb1')][_0x4493('0x3a')],_0x1f532d[_0x4493('0xb1')][_0x4493('0xb2')]):'unknown','browserVersion':_0x1f532d[_0x4493('0xb1')][_0x4493('0xb2')]||_0x4493('0xb3'),'osName':util[_0x4493('0xb4')]('%s\x20%s',_0x1f532d['os'][_0x4493('0x3a')],_0x1f532d['os'][_0x4493('0xb2')]),'osVersion':_0x1f532d['os']['version'],'deviceModel':_0x1f532d[_0x4493('0xb5')][_0x4493('0x47')]&&_0x1f532d[_0x4493('0xb5')][_0x4493('0xb6')]?util[_0x4493('0xb4')](_0x4493('0xb7'),_0x1f532d[_0x4493('0xb5')][_0x4493('0x47')],_0x1f532d[_0x4493('0xb5')][_0x4493('0xb6')],_0x1f532d[_0x4493('0xb5')][_0x4493('0x41')]):null,'deviceVendor':_0x1f532d[_0x4493('0xb5')][_0x4493('0xb6')],'deviceType':_0x1f532d[_0x4493('0xb5')]['type'],'formData':JSON[_0x4493('0x24')](_0x35998b[_0x4493('0x59')])};var _0x26cc61={'ChatWebsiteId':_0x35998b[_0x4493('0x60')]['id'],'closed':![]};if(_0x35998b['body'][_0x4493('0xb8')]){_0x26cc61[_0x4493('0xb8')]=_0x35998b[_0x4493('0x59')]['threadId'];return db['ChatInteraction'][_0x4493('0x5d')]({'where':_0x26cc61})[_0x4493('0x1e')](function(_0x59a318){if(_0x59a318){return[_0x59a318,![]];}_0x59b35c['threadId']=_0x35998b[_0x4493('0x59')][_0x4493('0xb8')];_0x59b35c[_0x4493('0xb9')]=_0x35998b[_0x4493('0x59')]['externalUrl'];return db['ChatInteraction'][_0x4493('0x58')](_0x59b35c)[_0x4493('0x1e')](function(_0x3de2d8){return[_0x3de2d8,!![]];});});}_0x26cc61[_0x4493('0xba')]=_0x4b4b86['id'];if(_0x35998b['body'][_0x4493('0xbb')]&&_0x35998b[_0x4493('0x59')][_0x4493('0xbb')]['id']){_0x26cc61['id']=_0x35998b[_0x4493('0x59')][_0x4493('0xbb')]['id'];return db['ChatInteraction']['find']({'where':_0x26cc61})[_0x4493('0x1e')](function(_0x1a3b43){if(_0x1a3b43){return[_0x1a3b43,![]];}return db[_0x4493('0xbc')][_0x4493('0x58')](_0x59b35c)[_0x4493('0x1e')](function(_0x5298dd){return[_0x5298dd,!![]];});});}return db['ChatInteraction'][_0x4493('0x58')](_0x59b35c)['then'](function(_0x5ed383){return[_0x5ed383,!![]];});}})[_0x4493('0xbd')](function(_0x29ddd9,_0x2c1219){if(_0x29ddd9){_0x4f41cf=_0x2c1219;if(!_0x2c1219){var _0x11f85f={'from':(_0x49711c[_0x4493('0xa7')][_0x4493('0xad')]||'')+'\x20'+(_0x49711c[_0x4493('0xa7')][_0x4493('0xae')]||'')};if(_0x35998b[_0x4493('0x59')][_0x4493('0xb8')]&&_0x35998b['body'][_0x4493('0xbe')]&&_0x35998b[_0x4493('0x59')][_0x4493('0xb8')]!=_0x35998b[_0x4493('0x59')][_0x4493('0xbe')]){_0x11f85f[_0x4493('0xb8')]=_0x35998b[_0x4493('0x59')]['messageId'];}return _0x29ddd9['update'](_0x11f85f);}else{return _0x29ddd9;}}})[_0x4493('0x1e')](function(_0x1709f7){_0x49711c[_0x4493('0xbb')]=_0x1709f7[_0x4493('0x35')]({'plain':!![]});_0x49711c['interaction']['created']=_0x4f41cf;if(_0x49711c[_0x4493('0xbb')]['created']){if(_0x49711c['account'][_0x4493('0xbf')]){_0x49711c[_0x4493('0xa3')][_0x4493('0xc0')]({'id':0x0,'priority':_0x49711c[_0x4493('0xa3')]['length']+0x1,'app':_0x4493('0xc1'),'appdata':_0x4493('0xc2'),'interval':_0x4493('0xc3')});}}return db[_0x4493('0xc4')]['create']({'body':_0x35998b[_0x4493('0x59')][_0x4493('0x59')],'ChatWebsiteId':_0x35998b['params']['id'],'ChatInteractionId':_0x1709f7['id'],'direction':'in','ContactId':_0x49711c[_0x4493('0xa7')]['id'],'AttachmentId':_0x35998b[_0x4493('0x59')][_0x4493('0xc5')]});})[_0x4493('0x1e')](function(_0x3a9481){_0x49711c[_0x4493('0x26')]=_0x3a9481;if(_0x49711c[_0x4493('0xbb')][_0x4493('0xc6')]){return db['User'][_0x4493('0x5d')]({'attributes':['id',_0x4493('0x3a')],'where':{'id':_0x49711c['interaction'][_0x4493('0xc6')]}})[_0x4493('0x1e')](function(_0x51b21f){if(_0x51b21f){_0x49711c[_0x4493('0xa3')][_0x4493('0xc7')]({'id':0x0,'priority':0x0,'app':_0x4493('0xc8'),'appdata':_0x51b21f[_0x4493('0x3a')]+','+(_0x49711c['account'][_0x4493('0xc9')]||0xa),'interval':_0x4493('0xc3')});_0x49711c[_0x4493('0xca')]=!![];}return respondWithRpcPromise(_0x4493('0xcb'),_0x4493('0xcc'),_0x49711c);});}return respondWithRpcPromise(_0x4493('0xcb'),_0x4493('0xcc'),_0x49711c);})[_0x4493('0x1e')](function(_0xe1aa75){respondWithRpcPromise(_0x4493('0xcd'),_0x4493('0xcd'),{'event':'notify','message':_0xe1aa75},client9002);return _0xe1aa75;})[_0x4493('0x1e')](respondWithResult(_0x2f2481,null))[_0x4493('0x54')](handleError(_0x2f2481,null));};exports[_0x4493('0xce')]=function(_0x445dd3,_0x298d63,_0x543c8f){var _0x11c0ac,_0x198fb8,_0xdefe99;var _0x129d00=[];var _0x569478=[];var _0xbd85f7={};var _0x55dcb8=_0x445dd3[_0x4493('0xcf')]||[];var _0x3b86ca=[];var _0x2a4431;return db[_0x4493('0x8e')][_0x4493('0x61')]()['then'](function(_0xf551cd){if(!_0xf551cd){throw new db[(_0x4493('0x95'))][(_0x4493('0x8f'))]('no\x20available\x20attributes');}_0x569478=_[_0x4493('0x91')](_[_0x4493('0x44')](_0xf551cd),[_0x4493('0x92'),_0x4493('0x93')]);_0x129d00=_['difference'](_[_0x4493('0x44')](_0xf551cd),[_0x4493('0x92'),_0x4493('0x93'),'CompanyId',_0x4493('0xa6')]);if(_0x445dd3[_0x4493('0x59')]['id']){delete _0x445dd3[_0x4493('0x59')]['id'];}if(_[_0x4493('0x7d')](_0x445dd3[_0x4493('0x59')][_0x4493('0xd0')])){throw _0x298d63[_0x4493('0x28')](0x1f4)[_0x4493('0xd1')](new db['Sequelize'][(_0x4493('0x8f'))]('from\x20is\x20mandatory'));}if(_[_0x4493('0x7d')](_0x445dd3[_0x4493('0x59')][_0x4493('0x59')])||_0x445dd3[_0x4493('0x59')]['body']===''){throw _0x298d63[_0x4493('0x28')](0x1f4)['send'](new db[(_0x4493('0x95'))][(_0x4493('0x8f'))]('body\x20is\x20mandatory\x20and\x20not\x20empty'));}if(_[_0x4493('0x7d')](_0x445dd3['body']['mapKeyOffline'])){throw _0x298d63[_0x4493('0x28')](0x1f4)['send'](new db[(_0x4493('0x95'))][(_0x4493('0x8f'))](_0x4493('0xd2')+_0x129d00));}if(!_['includes'](_0x129d00,_0x445dd3['body']['mapKeyOffline'])){throw _0x298d63[_0x4493('0x28')](0x1f4)[_0x4493('0xd1')](new db[(_0x4493('0x95'))][(_0x4493('0x8f'))](_0x4493('0xd3')+_0x129d00));}_0xbd85f7[_0x445dd3['body'][_0x4493('0xd4')]]=_0x445dd3[_0x4493('0x59')]['from'];})['then'](function(){return db[_0x4493('0x3f')][_0x4493('0x5d')]({'where':{'id':_0x445dd3['params']['id']},'include':[{'model':db[_0x4493('0x9b')],'as':_0x4493('0xa0')},{'model':db[_0x4493('0xd5')],'as':'MailAccount'}]});})[_0x4493('0x1e')](handleEntityNotFound(_0x298d63,null))[_0x4493('0x1e')](function(_0x486e01){if(_0x486e01&&_0x486e01[_0x4493('0xa0')]){_0x198fb8=_0x486e01;var _0x5a30ce=_[_0x4493('0x16')](_0x445dd3[_0x4493('0x59')],{'firstName':_0x445dd3['body']['from'],'phone':_0x445dd3['body'][_0x4493('0xd0')],'ListId':_0x486e01[_0x4493('0xa6')]});_0x5a30ce[_0x445dd3[_0x4493('0x59')][_0x4493('0xd4')]]=_0x445dd3['body'][_0x4493('0xd0')];return db[_0x4493('0x8e')][_0x4493('0xd6')]({'where':_0xbd85f7,'defaults':_0x5a30ce});}})[_0x4493('0xbd')](function(_0x283af0){if(_0x283af0){_0xdefe99=_0x283af0;var _0x44eb33=fs['readFileSync'](path[_0x4493('0x7a')](config[_0x4493('0x7f')],_0x4493('0xd7')),'utf8');var _0x563b43=ejs['render'](_0x44eb33,{'body':_[_0x4493('0xd8')](_0x445dd3[_0x4493('0x59')]['body']),'bodyTitle':_0x198fb8[_0x4493('0xd9')]});return db['ChatOfflineMessage'][_0x4493('0x58')]({'body':_0x563b43,'ContactId':_0x283af0['id'],'ChatWebsiteId':_0x198fb8['id']});}})[_0x4493('0x1e')](function(_0x20f2b1){_0x2a4431=_0x20f2b1;if(_0x55dcb8[_0x4493('0x4a')]){var _0x35d343=_0x55dcb8[_0x4493('0x3e')](function(_0x2b819b){return{'name':_0x2b819b[_0x4493('0xda')],'basename':_0x2b819b[_0x4493('0x74')],'type':_0x2b819b[_0x4493('0xdb')],'ChatOfflineMessageId':_0x20f2b1['id']};});_0x3b86ca=_0x35d343[_0x4493('0x3e')](_0x259a80=>{var _0x534ced={'filename':_0x259a80['name'],'path':path['join'](config['root'],_0x4493('0xdc'),_0x4493('0xcf'),_0x4493('0xdd'),_0x4493('0xde'),_0x259a80['basename'])};return _0x534ced;});if(!_0x198fb8[_0x4493('0xdf')]){return db['sequelize'][_0x4493('0xe0')](function(_0x140ca0){return db[_0x4493('0xe1')]['bulkCreate'](_0x35d343,{'transaction':_0x140ca0});});}}})[_0x4493('0x1e')](function(){if(_0x2a4431){_0x11c0ac=_0x2a4431;return db['MailAccount']['findOne']({'where':{'active':!![]},'include':[{'model':db[_0x4493('0xe2')],'as':_0x4493('0xe3'),'raw':!![]}]});}})['then'](function(_0x49e113){if(_0x49e113&&_0x49e113[_0x4493('0xe3')]&&_0x198fb8['forwardOffline']&&_0x198fb8[_0x4493('0xe4')]){var _0x2c390a={'tls':{'rejectUnauthorized':![]}};if(_0x49e113[_0x4493('0xe3')][_0x4493('0xe5')]){_0x2c390a['service']=_0x49e113[_0x4493('0xe3')]['service'];}else{_0x2c390a[_0x4493('0xe6')]=_0x49e113[_0x4493('0xe3')][_0x4493('0xe6')];_0x2c390a['port']=_0x49e113[_0x4493('0xe3')][_0x4493('0xe7')];_0x2c390a['secure']=_0x49e113[_0x4493('0xe3')][_0x4493('0xe8')];}if(_0x49e113[_0x4493('0xe3')][_0x4493('0xe9')]){_0x2c390a['auth']={'user':_0x49e113[_0x4493('0xe3')][_0x4493('0x5a')],'pass':_0x49e113[_0x4493('0xe3')][_0x4493('0xea')]};}return respondWithRpcPromise('SendMail',_0x4493('0xeb'),{'account':_0x2c390a,'message':{'from':util[_0x4493('0xb4')](_0x4493('0xec'),_0x49e113[_0x4493('0x3a')],_0x49e113[_0x4493('0xed')]||_0x49e113[_0x4493('0xe3')][_0x4493('0x5a')]),'to':_0x198fb8[_0x4493('0xe4')],'subject':_0x198fb8[_0x4493('0xee')],'html':_0x11c0ac[_0x4493('0x59')],'attachments':_0x3b86ca}},client9003)[_0x4493('0x1e')](function(){return _0x11c0ac;})[_0x4493('0x54')](function(_0x3334f4){console['error'](_0x3334f4);});}})[_0x4493('0x1e')](function(){if(_0x198fb8&&_0x198fb8[_0x4493('0xdf')]&&_0x198fb8[_0x4493('0xef')]){var _0x1e691e=[];if(_0x55dcb8[_0x4493('0x4a')]){_0x1e691e=_0x55dcb8['map'](function(_0x543a83){return{'name':_0x543a83[_0x4493('0xda')],'basename':_0x543a83['filename'],'type':_0x543a83[_0x4493('0xdb')],'ChatOfflineMessageId':_0x2a4431['id']};});}var _0x3e1b3b;if(!_[_0x4493('0x7d')](_0x198fb8[_0x4493('0xf0')])){var _0x3ac82b=_[_0x4493('0x3e')](_0x445dd3[_0x4493('0x59')],function(_0x30edb6){return _0x30edb6;});var _0x2c6bb3=_['toPairsIn'](_0x3ac82b)[0x0];var _0x39c827=_[_0x4493('0xf1')](_0x2c6bb3,function(_0x122cbd){return _0x122cbd;});_0x3e1b3b=_0x39c827[0x1][_0x198fb8[_0x4493('0xf0')]];}var _0x2a6d30={'from':_0xdefe99[_0x4493('0xed')],'firstName':_0xdefe99[_0x4493('0xad')],'lastName':_0xdefe99[_0x4493('0xae')],'mapKey':_0x4493('0xed'),'message':{'from':_0xdefe99[_0x4493('0xed')],'to':_0x198fb8['MailAccount'][_0x4493('0xed')],'cc':'','subject':_[_0x4493('0x7d')](_0x3e1b3b)?_0x198fb8[_0x4493('0xee')]:_0x3e1b3b,'messageId':'','sentAt':new Date(),'attach':_0x1e691e[_0x4493('0x4a')],'attachments':_0x1e691e,'originChannel':_0x4493('0xf2'),'ChatWebsiteId':_0x198fb8['id'],'ChatOfflineMessageId':_0x11c0ac['id'],'originTo':_0x198fb8[_0x4493('0xd5')][_0x4493('0xed')]},'body':_0x11c0ac['body']};var _0x16f937={'account':{'id':_0x198fb8[_0x4493('0xef')]},'body':_0x2a6d30,'log':_0x4493('0xf3')};return respondWithRpcPromise(_0x4493('0xf3'),_0x4493('0xf4'),_0x16f937,client9001)[_0x4493('0x1e')](function(){return _0x11c0ac;})['catch'](function(_0x4cc76c){console[_0x4493('0x25')](_0x4cc76c);});}return;})['then'](function(){if(_0x11c0ac){return _0x11c0ac;}})[_0x4493('0x1e')](respondWithResult(_0x298d63,null))[_0x4493('0x54')](function(_0x124129){console['error'](_0x4493('0x54'),_0x124129);for(var _0xaa2009 of _0x55dcb8){var _0x38364d=path[_0x4493('0x7a')](config['root'],'server','files',_0x4493('0xdd'),_0x4493('0xde'),_0xaa2009[_0x4493('0x74')]);fs_extra[_0x4493('0xf5')](_0x38364d)[_0x4493('0x54')](function(_0x344b3e){console[_0x4493('0x25')](_0x4493('0xf6'),_0x38364d,_0x344b3e);});}});};exports[_0x4493('0xf7')]=function(_0x59607c,_0x385217,_0x31013d){return db[_0x4493('0xbc')][_0x4493('0x5d')]({'where':{'id':_0x59607c[_0x4493('0x60')]['id']}})[_0x4493('0x1e')](handleEntityNotFound(_0x385217,null))[_0x4493('0x1e')](function(_0x4a77f2){if(_0x4a77f2){return _0x4a77f2[_0x4493('0xf7')](_0x59607c['body'][_0x4493('0x6b')],_['omit'](_0x59607c['body'],['ids','id'])||{});}})['then'](respondWithResult(_0x385217,null))[_0x4493('0x54')](handleError(_0x385217,null));};exports['getInteractions']=function(_0xe1a392,_0xa7ec71,_0x927282){var _0x4d6a10={'raw':![],'where':{}};var _0x43ac95={};var _0x42adda={'count':0x0,'rows':[]};return db[_0x4493('0x3f')][_0x4493('0x6e')]({'where':{'id':_0xe1a392[_0x4493('0x60')]['id']}})[_0x4493('0x1e')](handleEntityNotFound(_0xa7ec71,null))['then'](function(_0x361056){if(_0x361056){_0x43ac95['model']=_[_0x4493('0x44')](db['ChatInteraction']['rawAttributes']);_0x43ac95[_0x4493('0x43')]=_[_0x4493('0x44')](_0xe1a392[_0x4493('0x43')]);_0x43ac95['filters']=_[_0x4493('0x46')](_0x43ac95['model'],_0x43ac95[_0x4493('0x43')]);_0x4d6a10[_0x4493('0x48')]=_[_0x4493('0x46')](_0x43ac95['model'],qs['fields'](_0xe1a392[_0x4493('0x43')]['fields']));_0x4d6a10[_0x4493('0x48')]=_0x4d6a10[_0x4493('0x48')]['length']?_0x4d6a10[_0x4493('0x48')]:_0x43ac95['model'];if(!_0xe1a392['query'][_0x4493('0x4b')]('nolimit')){_0x4d6a10[_0x4493('0x2e')]=qs['limit'](_0xe1a392[_0x4493('0x43')][_0x4493('0x2e')]);_0x4d6a10['offset']=qs[_0x4493('0x2c')](_0xe1a392[_0x4493('0x43')][_0x4493('0x2c')]);}_0x4d6a10[_0x4493('0x66')]=qs['sort'](_0xe1a392[_0x4493('0x43')][_0x4493('0x4d')]);_0x4d6a10[_0x4493('0x4f')]=qs[_0x4493('0x45')](_[_0x4493('0x67')](_0xe1a392[_0x4493('0x43')],_0x43ac95[_0x4493('0x45')]));_0x4d6a10[_0x4493('0x4f')][_0x4493('0x63')]=_0x361056['id'];if(_0xe1a392[_0x4493('0x43')]['filter']){_0x4d6a10['where']=_[_0x4493('0x50')](_0x4d6a10[_0x4493('0x4f')],{'$or':_['map'](_0x4d6a10['attributes'],function(_0x4cc3c8){var _0xce28cb={};_0xce28cb[_0x4cc3c8]={'$like':'%'+_0xe1a392['query'][_0x4493('0x4e')]+'%'};return _0xce28cb;})});}_0x4d6a10=_[_0x4493('0x50')]({},_0x4d6a10,_0xe1a392['options']);return db[_0x4493('0xbc')][_0x4493('0x2d')]({'where':_0x4d6a10['where']})[_0x4493('0x1e')](function(_0xa29064){_0x42adda[_0x4493('0x2d')]=_0xa29064;if(_0xe1a392['query'][_0x4493('0x52')]){_0x4d6a10[_0x4493('0x68')]=[{'model':db[_0x4493('0x8e')],'as':_0x4493('0xf8'),'required':![]},{'model':db['User'],'as':_0x4493('0xf9'),'attributes':[_0x4493('0x3a'),'fullname',_0x4493('0xfa')],'required':![]},{'model':db[_0x4493('0xfb')],'as':_0x4493('0xfc'),'attributes':['id',_0x4493('0x3a'),'color'],'where':_0xe1a392['query'][_0x4493('0xfd')]?{'id':_0xe1a392[_0x4493('0x43')][_0x4493('0xfd')]}:undefined,'required':_0xe1a392[_0x4493('0x43')][_0x4493('0xfd')]?!![]:![]}];}return db[_0x4493('0xbc')][_0x4493('0x69')](_0x4d6a10);})[_0x4493('0x1e')](function(_0x3ebfe3){_0x42adda['rows']=_0x3ebfe3;return _0x42adda;});}})['then'](respondWithFilteredResult(_0xa7ec71,_0x4d6a10))['catch'](handleError(_0xa7ec71,null));};function iftimePromise(_0x10f636,_0x1ac14d){return respondWithRpcPromise(_0x4493('0xfe'),_0x4493('0xff'),{'command':_0x1ac14d[_0x4493('0x100')]?util['format'](_0x4493('0x101'),_0x10f636[_0x4493('0x102')],_0x1ac14d[_0x4493('0x100')]):util[_0x4493('0xb4')]('iftime\x20%s',_0x10f636[_0x4493('0x102')])},client9002)[_0x4493('0x1e')](function(_0x3b4ff4){var _0x24ddb1=_0x3b4ff4&&_0x3b4ff4[_0x4493('0x103')]('true')>=0x0?!![]:![];logger['info']('[%s][INTERVAL][%s]\x20%s\x20%s\x20(%s)',_0x1ac14d['id'],_0x10f636['id'],_0x10f636[_0x4493('0x102')],_0x24ddb1?_0x4493('0x104'):_0x4493('0x105'),_0x1ac14d[_0x4493('0x100')]?_0x1ac14d[_0x4493('0x100')]:_0x4493('0x106'));return _0x24ddb1;})[_0x4493('0x54')](function(_0x64174a){logger[_0x4493('0x25')](_0x4493('0x107'),_0x1ac14d['id'],_0x10f636['id'],_0x10f636['interval'],util['inspect'](_0x64174a,{'showHidden':![],'depth':null}),_0x1ac14d['timezone']?_0x1ac14d['timezone']:_0x4493('0x106'));return![];});}exports[_0x4493('0xff')]=function(_0x45bb5d,_0x2044b2,_0x5d5adf){var _0x156e7e=0x0;var _0x38389c=0x0;var _0x1ec030=![];var _0x39cf94;var _0x5e3fea;return db[_0x4493('0x3f')][_0x4493('0x5d')]({'where':{'id':_0x45bb5d[_0x4493('0x60')]['id']},'include':[{'model':db[_0x4493('0x108')],'as':_0x4493('0x108'),'include':[{'model':db[_0x4493('0x108')],'as':_0x4493('0x109'),'attributes':['id',_0x4493('0x102')],'raw':!![]}]}]})[_0x4493('0x1e')](handleEntityNotFound(_0x2044b2,null))[_0x4493('0x1e')](function(_0x1bf150){if(_0x1bf150){_0x39cf94=_0x1bf150;return _0x1bf150[_0x4493('0x10a')]({'raw':!![]});}})['then'](function(_0x164bb4){if(_0x39cf94){if(_0x164bb4){_0x5e3fea=_0x164bb4;}}return require(_0x4493('0x13'))[_0x4493('0x7b')]();})['then'](function(_0x3bd387){if(_0x3bd387){_0x38389c=_0x3bd387[_0x4493('0x10b')];_0x1ec030=_0x3bd387[_0x4493('0x7c')];}})[_0x4493('0x1e')](function(){return db[_0x4493('0xbc')][_0x4493('0x2d')]({'where':{'closed':![]}});})[_0x4493('0x1e')](function(_0x21ee92){_0x156e7e=_0x21ee92;if(_0x38389c&&_0x21ee92>_0x38389c){return db['License'][_0x4493('0x6e')]({'where':{'id':0x1}})[_0x4493('0x1e')](function(_0x5d9f70){if(_0x5d9f70){_0x5d9f70['increment'](_0x4493('0x10c'));}});}})[_0x4493('0x1e')](function(){if(_0x39cf94[_0x4493('0x108')]&&_0x39cf94[_0x4493('0x108')]['Intervals']){var _0x45f490=[];for(var _0x4b7d21=0x0;_0x4b7d21<_0x39cf94[_0x4493('0x108')][_0x4493('0x109')][_0x4493('0x4a')];_0x4b7d21++){var _0x3f7faa=_0x39cf94[_0x4493('0x108')]['Intervals'][_0x4b7d21][_0x4493('0x35')]({'plain':!![]});_0x45f490[_0x4493('0xc0')](iftimePromise(_0x3f7faa,_0x39cf94));}return BPromise[_0x4493('0x10d')](_0x45f490)[_0x4493('0x1e')](function(_0xa6b66b){return _[_0x4493('0x10e')](_0xa6b66b);});}else{return!![];}})[_0x4493('0x1e')](function(_0x27dcc6){var _0x2efcb7=fs[_0x4493('0x10f')](path['join'](config[_0x4493('0x7f')],'server/files/chat/iframe.ejs'),_0x4493('0x110'));var _0x146db6={'remote':_0x39cf94['remote'],'query':querystring[_0x4493('0x24')](_[_0x4493('0x50')](_0x39cf94['get']({'plain':!![]}),{'customerIp':_0x45bb5d['headers'][_0x4493('0xaa')]||_0x45bb5d[_0x4493('0xa8')][_0x4493('0x111')]||_0x45bb5d[_0x4493('0x112')][_0x4493('0x113')]||_0x45bb5d['ip'],'referer':_0x45bb5d[_0x4493('0xa8')][_0x4493('0xb0')],'openedInteractions':_0x156e7e,'maxInteractions':_0x38389c,'virtual':_0x1ec030['virtual'],'online':_0x27dcc6,'custom':_0x1ec030}))[_0x4493('0x114')](/'/g,'\x5c\x27')};_0x2044b2[_0x4493('0xd1')](ejs[_0x4493('0x115')](Mustache['render'](_0x2efcb7,_0x146db6),{'proactiveActions':_0x5e3fea,'alignment':_0x39cf94['alignment'],'verticalAlignment':_0x39cf94['verticalAlignment'],'div_color':_0x39cf94[_0x4493('0x116')],'text_color':_0x39cf94[_0x4493('0x117')],'button_color':_0x39cf94['color_button'],'background_color':_0x39cf94['backgroundColor']}));})[_0x4493('0x54')](handleError(_0x2044b2,null));};exports[_0x4493('0x118')]=function(_0x35d42b,_0x302a0b,_0x4846b2){return db[_0x4493('0x3f')][_0x4493('0x6e')]({'where':{'id':_0x35d42b[_0x4493('0x60')]['id']}})['then'](handleEntityNotFound(_0x302a0b,null))[_0x4493('0x1e')](function(_0x97a057){if(_0x97a057){return db['sequelize'][_0x4493('0xe0')](function(_0x21cd5c){return db['ChatApplication'][_0x4493('0x34')]({'where':{'ChatWebsiteId':_0x35d42b[_0x4493('0x60')]['id']},'transaction':_0x21cd5c})['then'](function(_0x511724){var _0x405147=_['map'](_0x35d42b[_0x4493('0x59')],function(_0x4f4967){_0x4f4967[_0x4493('0x63')]=_0x35d42b[_0x4493('0x60')]['id'];return _0x4f4967;});return db[_0x4493('0x9e')]['bulkCreate'](_0x405147,{'transaction':_0x21cd5c});});})[_0x4493('0x1e')](function(){return db[_0x4493('0x9e')]['findAndCountAll']({'where':{'ChatWebsiteId':_0x35d42b[_0x4493('0x60')]['id']},'order':'priority'});});}})[_0x4493('0x1e')](respondWithResult(_0x302a0b,null))[_0x4493('0x54')](handleError(_0x302a0b,null));};exports[_0x4493('0x119')]=function(_0x16272f,_0xd82e53,_0x308f95){var _0x5e235f={};var _0x229d89={};var _0x46581e;var _0x183ff4;return db[_0x4493('0x3f')][_0x4493('0x6e')]({'where':{'id':_0x16272f[_0x4493('0x60')]['id']}})[_0x4493('0x1e')](handleEntityNotFound(_0xd82e53,null))[_0x4493('0x1e')](function(_0x403535){if(_0x403535){_0x46581e=_0x403535;_0x229d89[_0x4493('0x47')]=_[_0x4493('0x44')](db[_0x4493('0x9e')][_0x4493('0x56')]);_0x229d89['query']=_[_0x4493('0x44')](_0x16272f[_0x4493('0x43')]);_0x229d89[_0x4493('0x45')]=_[_0x4493('0x46')](_0x229d89['model'],_0x229d89['query']);_0x5e235f[_0x4493('0x48')]=_[_0x4493('0x46')](_0x229d89[_0x4493('0x47')],qs['fields'](_0x16272f['query'][_0x4493('0x49')]));_0x5e235f[_0x4493('0x48')]=_0x5e235f['attributes']['length']?_0x5e235f[_0x4493('0x48')]:_0x229d89[_0x4493('0x47')];_0x5e235f[_0x4493('0x66')]=qs[_0x4493('0x4d')](_0x16272f['query'][_0x4493('0x4d')]);_0x5e235f[_0x4493('0x4f')]=qs[_0x4493('0x45')](_[_0x4493('0x67')](_0x16272f['query'],_0x229d89[_0x4493('0x45')]));if(_0x16272f['query'][_0x4493('0x4e')]){_0x5e235f[_0x4493('0x4f')]=_[_0x4493('0x50')](_0x5e235f[_0x4493('0x4f')],{'$or':_[_0x4493('0x3e')](_0x5e235f[_0x4493('0x48')],function(_0x388d59){var _0x52d00e={};_0x52d00e[_0x388d59]={'$like':'%'+_0x16272f['query'][_0x4493('0x4e')]+'%'};return _0x52d00e;})});}_0x5e235f=_[_0x4493('0x50')]({},_0x5e235f,_0x16272f['options']);return _0x46581e[_0x4493('0x119')](_0x5e235f);}})[_0x4493('0x1e')](function(_0x14bc86){if(_0x14bc86){_0x183ff4=_0x14bc86[_0x4493('0x4a')];if(!_0x16272f[_0x4493('0x43')][_0x4493('0x4b')]('nolimit')){_0x5e235f[_0x4493('0x2e')]=qs[_0x4493('0x2e')](_0x16272f[_0x4493('0x43')][_0x4493('0x2e')]);_0x5e235f['offset']=qs[_0x4493('0x2c')](_0x16272f['query'][_0x4493('0x2c')]);}return _0x46581e['getApplications'](_0x5e235f);}})[_0x4493('0x1e')](function(_0x334754){if(_0x334754){return _0x334754?{'count':_0x183ff4,'rows':_0x334754}:null;}})[_0x4493('0x1e')](respondWithResult(_0xd82e53,null))[_0x4493('0x54')](handleError(_0xd82e53,null));};exports['addProactiveActions']=function(_0x30d517,_0x2c3439,_0x2930b5){return db['chatProactiveAction']['find']({'where':{'id':_0x30d517[_0x4493('0x60')]['id']}})[_0x4493('0x1e')](handleEntityNotFound(_0x2c3439,null))[_0x4493('0x1e')](function(_0x30d337){if(_0x30d337){return _0x30d337[_0x4493('0x11a')](_0x30d517[_0x4493('0x59')][_0x4493('0x6b')],_[_0x4493('0x11b')](_0x30d517['body'],['ids','id'])||{});}})[_0x4493('0x1e')](respondWithResult(_0x2c3439,null))[_0x4493('0x54')](handleError(_0x2c3439,null));};exports[_0x4493('0x10a')]=function(_0x35b30f,_0x545741,_0x5852d2){var _0xd810c6={};var _0x8ae4a0={};var _0x25d7ea;var _0x2a7add;return db[_0x4493('0x3f')][_0x4493('0x6e')]({'where':{'id':_0x35b30f[_0x4493('0x60')]['id']}})[_0x4493('0x1e')](handleEntityNotFound(_0x545741,null))[_0x4493('0x1e')](function(_0x11f92a){if(_0x11f92a){_0x25d7ea=_0x11f92a;_0x8ae4a0['model']=_[_0x4493('0x44')](db[_0x4493('0x11c')][_0x4493('0x56')]);_0x8ae4a0[_0x4493('0x43')]=_[_0x4493('0x44')](_0x35b30f[_0x4493('0x43')]);_0x8ae4a0[_0x4493('0x45')]=_[_0x4493('0x46')](_0x8ae4a0[_0x4493('0x47')],_0x8ae4a0[_0x4493('0x43')]);_0xd810c6[_0x4493('0x48')]=_[_0x4493('0x46')](_0x8ae4a0[_0x4493('0x47')],qs[_0x4493('0x49')](_0x35b30f[_0x4493('0x43')][_0x4493('0x49')]));_0xd810c6[_0x4493('0x48')]=_0xd810c6[_0x4493('0x48')]['length']?_0xd810c6['attributes']:_0x8ae4a0[_0x4493('0x47')];_0xd810c6[_0x4493('0x66')]=qs[_0x4493('0x4d')](_0x35b30f[_0x4493('0x43')][_0x4493('0x4d')]);_0xd810c6[_0x4493('0x4f')]=qs['filters'](_[_0x4493('0x67')](_0x35b30f['query'],_0x8ae4a0[_0x4493('0x45')]));if(_0x35b30f['query']['filter']){_0xd810c6[_0x4493('0x4f')]=_[_0x4493('0x50')](_0xd810c6[_0x4493('0x4f')],{'$or':_[_0x4493('0x3e')](_0xd810c6[_0x4493('0x48')],function(_0x49ae79){var _0x443164={};_0x443164[_0x49ae79]={'$like':'%'+_0x35b30f[_0x4493('0x43')]['filter']+'%'};return _0x443164;})});}_0xd810c6=_['merge']({},_0xd810c6,_0x35b30f[_0x4493('0x57')]);return _0x25d7ea[_0x4493('0x10a')](_0xd810c6);}})[_0x4493('0x1e')](function(_0x13b91f){if(_0x13b91f){_0x2a7add=_0x13b91f[_0x4493('0x4a')];if(!_0x35b30f[_0x4493('0x43')][_0x4493('0x4b')]('nolimit')){_0xd810c6['limit']=qs['limit'](_0x35b30f[_0x4493('0x43')][_0x4493('0x2e')]);_0xd810c6[_0x4493('0x2c')]=qs[_0x4493('0x2c')](_0x35b30f[_0x4493('0x43')][_0x4493('0x2c')]);}return _0x25d7ea[_0x4493('0x10a')](_0xd810c6);}})[_0x4493('0x1e')](function(_0x25c7d5){if(_0x25c7d5){return _0x25c7d5?{'count':_0x2a7add,'rows':_0x25c7d5}:null;}})['then'](respondWithResult(_0x545741,null))[_0x4493('0x54')](handleError(_0x545741,null));};exports['getFields']=function(_0x342c28,_0x2f8bb9,_0x82b760){var _0x3a9a99=_0x342c28['query'][_0x4493('0x11d')]===_0x4493('0x11e')?_0x4493('0x11f'):'onlineForm';return db[_0x4493('0x3f')][_0x4493('0x5d')]({'attributes':['id',_0x3a9a99],'where':{'id':_0x342c28['params']['id']}})['then'](handleEntityNotFound(_0x2f8bb9,null))[_0x4493('0x1e')](function(_0xb3fe8c){if(_0xb3fe8c){var _0x30ff8a=_0xb3fe8c[_0x3a9a99];var _0x4948d0=_0x30ff8a&&_0x30ff8a[_0x4493('0x120')]?_0x30ff8a[_0x4493('0x120')]:[];_0x2f8bb9[_0x4493('0xd1')]({'fromKey':_[_0x4493('0x7d')](_0x30ff8a[_0x4493('0x121')])?undefined:_0x30ff8a[_0x4493('0x121')],'count':_0x4948d0['length'],'rows':_0x4948d0});}})['catch'](handleError(_0x2f8bb9,null));};exports[_0x4493('0x122')]=function(_0x24f900,_0x68475c,_0x3fd38a){var _0x1da422={'raw':![],'where':{}};var _0x1597ad={};var _0x2faf06={'count':0x0,'rows':[]};return db[_0x4493('0x3f')]['findOne']({'where':{'id':_0x24f900[_0x4493('0x60')]['id']}})['then'](handleEntityNotFound(_0x68475c,null))[_0x4493('0x1e')](function(_0x52f928){if(_0x52f928){_0x1597ad[_0x4493('0x47')]=_['keys'](db[_0x4493('0x123')][_0x4493('0x56')]);_0x1597ad[_0x4493('0x43')]=_[_0x4493('0x44')](_0x24f900['query']);_0x1597ad[_0x4493('0x45')]=_[_0x4493('0x46')](_0x1597ad['model'],_0x1597ad['query']);_0x1da422[_0x4493('0x48')]=_[_0x4493('0x46')](_0x1597ad[_0x4493('0x47')],qs['fields'](_0x24f900[_0x4493('0x43')][_0x4493('0x49')]));_0x1da422[_0x4493('0x48')]=_0x1da422[_0x4493('0x48')][_0x4493('0x4a')]?_0x1da422['attributes']:_0x1597ad[_0x4493('0x47')];if(!_0x24f900[_0x4493('0x43')][_0x4493('0x4b')]('nolimit')){_0x1da422['limit']=qs[_0x4493('0x2e')](_0x24f900[_0x4493('0x43')][_0x4493('0x2e')]);_0x1da422[_0x4493('0x2c')]=qs['offset'](_0x24f900[_0x4493('0x43')][_0x4493('0x2c')]);}_0x1da422[_0x4493('0x66')]=qs[_0x4493('0x4d')](_0x24f900['query'][_0x4493('0x4d')]);_0x1da422[_0x4493('0x4f')]=qs[_0x4493('0x45')](_[_0x4493('0x67')](_0x24f900[_0x4493('0x43')],_0x1597ad[_0x4493('0x45')]));_0x1da422[_0x4493('0x4f')][_0x4493('0x63')]=_0x52f928['id'];if(_0x24f900[_0x4493('0x43')]['filter']){_0x1da422[_0x4493('0x4f')]=_[_0x4493('0x50')](_0x1da422[_0x4493('0x4f')],{'$or':_[_0x4493('0x3e')](_0x1da422[_0x4493('0x48')],function(_0x50cc2e){var _0x5abab2={};_0x5abab2[_0x50cc2e]={'$like':'%'+_0x24f900[_0x4493('0x43')][_0x4493('0x4e')]+'%'};return _0x5abab2;})});}_0x1da422=_[_0x4493('0x50')]({},_0x1da422,_0x24f900[_0x4493('0x57')]);return db[_0x4493('0x123')][_0x4493('0x2d')]({'where':_0x1da422[_0x4493('0x4f')]})['then'](function(_0x1abc69){_0x2faf06[_0x4493('0x2d')]=_0x1abc69;if(_0x24f900[_0x4493('0x43')][_0x4493('0x52')]){_0x1da422[_0x4493('0x68')]=[{'all':!![]}];}else{_0x1da422['include']=[{'model':db[_0x4493('0x8e')],'as':'Contact','required':![]},{'model':db[_0x4493('0xe1')],'as':_0x4493('0x124'),'required':![]}];}return db[_0x4493('0x123')][_0x4493('0x69')](_0x1da422);})['then'](function(_0xc31292){_0x2faf06['rows']=_0xc31292;return _0x2faf06;});}})[_0x4493('0x1e')](respondWithFilteredResult(_0x68475c,_0x1da422))[_0x4493('0x54')](handleError(_0x68475c,null));};exports['addAgents']=function(_0x3a235f,_0x5da3cd,_0x4b73a6){return db[_0x4493('0x3f')][_0x4493('0x5d')]({'where':{'id':_0x3a235f['params']['id']}})['then'](handleEntityNotFound(_0x5da3cd,null))[_0x4493('0x1e')](function(_0x48eb58){if(_0x48eb58){return _0x48eb58[_0x4493('0x125')](_0x3a235f[_0x4493('0x59')][_0x4493('0x6b')],_['omit'](_0x3a235f['body'],['ids','id'])||{})[_0x4493('0xbd')](function(_0x1a440f){for(var _0x2ad9fd=0x0;_0x2ad9fd<_0x3a235f['body'][_0x4493('0x6b')][_0x4493('0x4a')];_0x2ad9fd+=0x1){socket[_0x4493('0x126')](_0x4493('0x127'),{'UserId':Number(_0x3a235f['body']['ids'][_0x2ad9fd]),'ChatWebsiteId':Number(_0x3a235f[_0x4493('0x60')]['id'])});}return _0x1a440f;});}})['then'](respondWithResult(_0x5da3cd,null))['catch'](handleError(_0x5da3cd,null));};exports[_0x4493('0x128')]=function(_0x3c03fb,_0x16c1ae,_0x59e98d){return db['ChatWebsite'][_0x4493('0x5d')]({'where':{'id':_0x3c03fb['params']['id']}})[_0x4493('0x1e')](handleEntityNotFound(_0x16c1ae,null))[_0x4493('0x1e')](function(_0x52979a){if(_0x52979a){return _0x52979a[_0x4493('0x128')](_0x3c03fb[_0x4493('0x43')][_0x4493('0x6b')])[_0x4493('0x1e')](function(){if(_['isArray'](_0x3c03fb['query'][_0x4493('0x6b')])){for(var _0x573277=0x0;_0x573277<_0x3c03fb[_0x4493('0x43')]['ids']['length'];_0x573277+=0x1){socket[_0x4493('0x126')](_0x4493('0x129'),{'UserId':Number(_0x3c03fb[_0x4493('0x43')]['ids'][_0x573277]),'ChatWebsiteId':Number(_0x3c03fb[_0x4493('0x60')]['id'])});}}else{socket[_0x4493('0x126')](_0x4493('0x129'),{'UserId':Number(_0x3c03fb['query'][_0x4493('0x6b')]),'ChatWebsiteId':Number(_0x3c03fb[_0x4493('0x60')]['id'])});}});}})[_0x4493('0x1e')](respondWithStatusCode(_0x16c1ae,null))[_0x4493('0x54')](handleError(_0x16c1ae,null));};exports[_0x4493('0x12a')]=function(_0x315740,_0x23c6c2,_0x438d13){var _0x5189bc={};var _0x16c2a6={};var _0x297a10;var _0x47d5ad;return db[_0x4493('0x3f')][_0x4493('0x6e')]({'where':{'id':_0x315740[_0x4493('0x60')]['id']}})[_0x4493('0x1e')](handleEntityNotFound(_0x23c6c2,null))[_0x4493('0x1e')](function(_0x54fd6e){if(_0x54fd6e){_0x297a10=_0x54fd6e;_0x16c2a6[_0x4493('0x47')]=_['keys'](db[_0x4493('0x12b')][_0x4493('0x56')]);_0x16c2a6[_0x4493('0x43')]=_[_0x4493('0x44')](_0x315740[_0x4493('0x43')]);_0x16c2a6[_0x4493('0x45')]=_['intersection'](_0x16c2a6[_0x4493('0x47')],_0x16c2a6[_0x4493('0x43')]);_0x5189bc[_0x4493('0x48')]=_[_0x4493('0x46')](_0x16c2a6[_0x4493('0x47')],qs[_0x4493('0x49')](_0x315740['query'][_0x4493('0x49')]));_0x5189bc[_0x4493('0x48')]=_0x5189bc[_0x4493('0x48')][_0x4493('0x4a')]?_0x5189bc[_0x4493('0x48')]:_0x16c2a6[_0x4493('0x47')];_0x5189bc[_0x4493('0x66')]=qs['sort'](_0x315740['query'][_0x4493('0x4d')]);_0x5189bc[_0x4493('0x4f')]=qs['filters'](_['pick'](_0x315740['query'],_0x16c2a6[_0x4493('0x45')]));if(_0x315740[_0x4493('0x43')][_0x4493('0x4e')]){_0x5189bc['where']=_['merge'](_0x5189bc[_0x4493('0x4f')],{'$or':_[_0x4493('0x3e')](_0x5189bc[_0x4493('0x48')],function(_0x437fbc){var _0x13a892={};_0x13a892[_0x437fbc]={'$like':'%'+_0x315740[_0x4493('0x43')][_0x4493('0x4e')]+'%'};return _0x13a892;})});}_0x5189bc=_[_0x4493('0x50')]({},_0x5189bc,_0x315740[_0x4493('0x57')]);return _0x297a10[_0x4493('0x12a')](_0x5189bc);}})[_0x4493('0x1e')](function(_0x44224e){if(_0x44224e){_0x47d5ad=_0x44224e['length'];if(!_0x315740[_0x4493('0x43')][_0x4493('0x4b')]('nolimit')){_0x5189bc['limit']=qs[_0x4493('0x2e')](_0x315740[_0x4493('0x43')]['limit']);_0x5189bc[_0x4493('0x2c')]=qs[_0x4493('0x2c')](_0x315740[_0x4493('0x43')][_0x4493('0x2c')]);}return _0x297a10['getAgents'](_0x5189bc);}})[_0x4493('0x1e')](function(_0x49b825){if(_0x49b825){return _0x49b825?{'count':_0x47d5ad,'rows':_0x49b825}:null;}})[_0x4493('0x1e')](respondWithResult(_0x23c6c2,null))[_0x4493('0x54')](handleError(_0x23c6c2,null));};
\ No newline at end of file
diff --git a/server/api/chatWebsite/chatWebsite.events.js b/server/api/chatWebsite/chatWebsite.events.js
index 1970e30..a5b99b4 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 _0x9865=['hasOwnProperty','hook','events','../../mysqldb','ChatWebsite','setMaxListeners','save','update','remove','emit'];(function(_0x51020b,_0x38c2c7){var _0x371e47=function(_0x2a538f){while(--_0x2a538f){_0x51020b['push'](_0x51020b['shift']());}};_0x371e47(++_0x38c2c7);}(_0x9865,0x1ba));var _0x5986=function(_0x5c9274,_0x4e849b){_0x5c9274=_0x5c9274-0x0;var _0x1ef7d3=_0x9865[_0x5c9274];return _0x1ef7d3;};'use strict';var EventEmitter=require(_0x5986('0x0'));var ChatWebsite=require(_0x5986('0x1'))['db'][_0x5986('0x2')];var ChatWebsiteEvents=new EventEmitter();ChatWebsiteEvents[_0x5986('0x3')](0x0);var events={'afterCreate':_0x5986('0x4'),'afterUpdate':_0x5986('0x5'),'afterDestroy':_0x5986('0x6')};function emitEvent(_0x12c471){return function(_0x236420,_0xef2d15,_0x5b7602){ChatWebsiteEvents[_0x5986('0x7')](_0x12c471+':'+_0x236420['id'],_0x236420);ChatWebsiteEvents[_0x5986('0x7')](_0x12c471,_0x236420);_0x5b7602(null);};}for(var e in events){if(events[_0x5986('0x8')](e)){var event=events[e];ChatWebsite[_0x5986('0x9')](e,emitEvent(event));}}module['exports']=ChatWebsiteEvents;
\ No newline at end of file
+var _0x8c25=['ChatWebsite','setMaxListeners','save','update','emit','hasOwnProperty','events','../../mysqldb'];(function(_0x2cdde7,_0x7221c1){var _0x12f5de=function(_0x322df6){while(--_0x322df6){_0x2cdde7['push'](_0x2cdde7['shift']());}};_0x12f5de(++_0x7221c1);}(_0x8c25,0x15e));var _0x58c2=function(_0x3d4bfa,_0x2f6b73){_0x3d4bfa=_0x3d4bfa-0x0;var _0x40ece9=_0x8c25[_0x3d4bfa];return _0x40ece9;};'use strict';var EventEmitter=require(_0x58c2('0x0'));var ChatWebsite=require(_0x58c2('0x1'))['db'][_0x58c2('0x2')];var ChatWebsiteEvents=new EventEmitter();ChatWebsiteEvents[_0x58c2('0x3')](0x0);var events={'afterCreate':_0x58c2('0x4'),'afterUpdate':_0x58c2('0x5'),'afterDestroy':'remove'};function emitEvent(_0x2808d9){return function(_0x4b834a,_0x5e7500,_0x491a1c){ChatWebsiteEvents[_0x58c2('0x6')](_0x2808d9+':'+_0x4b834a['id'],_0x4b834a);ChatWebsiteEvents['emit'](_0x2808d9,_0x4b834a);_0x491a1c(null);};}for(var e in events){if(events[_0x58c2('0x7')](e)){var event=events[e];ChatWebsite['hook'](e,emitEvent(event));}}module['exports']=ChatWebsiteEvents;
\ No newline at end of file
diff --git a/server/api/chatWebsite/chatWebsite.model.js b/server/api/chatWebsite/chatWebsite.model.js
index a87e7c5..e06b3e5 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 _0xb1e3=['define','ChatWebsite','chat_websites','util','api','moment','bluebird','request-promise','rimraf','exports'];(function(_0x5c43cf,_0x297c45){var _0x56a800=function(_0x1f1b3e){while(--_0x1f1b3e){_0x5c43cf['push'](_0x5c43cf['shift']());}};_0x56a800(++_0x297c45);}(_0xb1e3,0x1bb));var _0x3b1e=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xb1e3[_0x3dd15e];return _0x231fd0;};'use strict';var _=require('lodash');var util=require(_0x3b1e('0x0'));var logger=require('../../config/logger')(_0x3b1e('0x1'));var moment=require(_0x3b1e('0x2'));var BPromise=require(_0x3b1e('0x3'));var rp=require(_0x3b1e('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x3b1e('0x5'));var config=require('../../config/environment');var attributes=require('./chatWebsite.attributes');module[_0x3b1e('0x6')]=function(_0xa635e6,_0x20b1b2){return _0xa635e6[_0x3b1e('0x7')](_0x3b1e('0x8'),attributes,{'tableName':_0x3b1e('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xec2a=['./chatWebsite.attributes','exports','define','ChatWebsite','chat_websites','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path'];(function(_0x590712,_0x21ed3c){var _0xb7b99f=function(_0x5a7319){while(--_0x5a7319){_0x590712['push'](_0x590712['shift']());}};_0xb7b99f(++_0x21ed3c);}(_0xec2a,0x18b));var _0xaec2=function(_0xa4a9b3,_0x3b271c){_0xa4a9b3=_0xa4a9b3-0x0;var _0xb7a49e=_0xec2a[_0xa4a9b3];return _0xb7a49e;};'use strict';var _=require(_0xaec2('0x0'));var util=require(_0xaec2('0x1'));var logger=require(_0xaec2('0x2'))(_0xaec2('0x3'));var moment=require(_0xaec2('0x4'));var BPromise=require(_0xaec2('0x5'));var rp=require(_0xaec2('0x6'));var fs=require('fs');var path=require(_0xaec2('0x7'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0xaec2('0x8'));module[_0xaec2('0x9')]=function(_0x1b3b1e,_0x2143d1){return _0x1b3b1e[_0xaec2('0xa')](_0xaec2('0xb'),attributes,{'tableName':_0xaec2('0xc'),'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 0310558..2575d94 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 _0x40e6=['debug','ChatWebsite,\x20%s,\x20%s,\x20%s','stringify','error','code','message','ChatWebsite,\x20%s,\x20%s','result','catch','util','moment','bluebird','randomstring','../../mysqldb','rpc','../../config/environment','http','defaults','redis','./chatWebsite.socket','register','request','info','request\x20sent'];(function(_0x2fdf82,_0x322e7c){var _0x2382f5=function(_0x4d6951){while(--_0x4d6951){_0x2fdf82['push'](_0x2fdf82['shift']());}};_0x2382f5(++_0x322e7c);}(_0x40e6,0xe1));var _0x640e=function(_0xbd77c1,_0x50b969){_0xbd77c1=_0xbd77c1-0x0;var _0x47fa83=_0x40e6[_0xbd77c1];return _0x47fa83;};'use strict';var _=require('lodash');var util=require(_0x640e('0x0'));var moment=require(_0x640e('0x1'));var BPromise=require(_0x640e('0x2'));var rs=require(_0x640e('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x640e('0x4'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x640e('0x5'));var config=require(_0x640e('0x6'));var jayson=require('jayson/promise');var client=jayson['client'][_0x640e('0x7')]({'port':0x232a});config['redis']=_[_0x640e('0x8')](config['redis'],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x640e('0x9')]));require(_0x640e('0xa'))[_0x640e('0xb')](socket);function respondWithRpcPromise(_0x32d64d,_0x57599b,_0x4248f6){return new BPromise(function(_0x151492,_0x79cfac){return client[_0x640e('0xc')](_0x32d64d,_0x4248f6)['then'](function(_0x3099b6){logger[_0x640e('0xd')]('ChatWebsite,\x20%s,\x20%s',_0x57599b,_0x640e('0xe'));logger[_0x640e('0xf')](_0x640e('0x10'),_0x57599b,_0x640e('0xe'),JSON[_0x640e('0x11')](_0x3099b6));if(_0x3099b6[_0x640e('0x12')]){if(_0x3099b6['error'][_0x640e('0x13')]===0x1f4){logger['error']('ChatWebsite,\x20%s,\x20%s',_0x57599b,_0x3099b6['error'][_0x640e('0x14')]);return _0x79cfac(_0x3099b6[_0x640e('0x12')][_0x640e('0x14')]);}logger[_0x640e('0x12')](_0x640e('0x15'),_0x57599b,_0x3099b6['error']['message']);return _0x151492(_0x3099b6[_0x640e('0x12')]['message']);}else{logger[_0x640e('0xd')](_0x640e('0x15'),_0x57599b,'request\x20sent');_0x151492(_0x3099b6[_0x640e('0x16')][_0x640e('0x14')]);}})[_0x640e('0x17')](function(_0x217a02){logger[_0x640e('0x12')](_0x640e('0x15'),_0x57599b,_0x217a02);_0x79cfac(_0x217a02);});});}
\ No newline at end of file
+var _0x01b9=['client','defaults','redis','localhost','socket.io-emitter','./chatWebsite.socket','register','request','info','ChatWebsite,\x20%s,\x20%s','request\x20sent','ChatWebsite,\x20%s,\x20%s,\x20%s','error','message','result','lodash','util','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment'];(function(_0x4c2f17,_0x5c6821){var _0x20919e=function(_0x31eef7){while(--_0x31eef7){_0x4c2f17['push'](_0x4c2f17['shift']());}};_0x20919e(++_0x5c6821);}(_0x01b9,0xb0));var _0x901b=function(_0x15658c,_0xa256f5){_0x15658c=_0x15658c-0x0;var _0x50b27a=_0x01b9[_0x15658c];return _0x50b27a;};'use strict';var _=require(_0x901b('0x0'));var util=require(_0x901b('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x901b('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x901b('0x3'))['db'];var utils=require(_0x901b('0x4'));var logger=require(_0x901b('0x5'))(_0x901b('0x6'));var config=require(_0x901b('0x7'));var jayson=require('jayson/promise');var client=jayson[_0x901b('0x8')]['http']({'port':0x232a});config['redis']=_[_0x901b('0x9')](config[_0x901b('0xa')],{'host':_0x901b('0xb'),'port':0x18eb});var socket=require(_0x901b('0xc'))(new Redis(config[_0x901b('0xa')]));require(_0x901b('0xd'))[_0x901b('0xe')](socket);function respondWithRpcPromise(_0x52d33e,_0x28498c,_0x13ddf5){return new BPromise(function(_0x2b3d9c,_0x497b50){return client[_0x901b('0xf')](_0x52d33e,_0x13ddf5)['then'](function(_0x216a4f){logger[_0x901b('0x10')](_0x901b('0x11'),_0x28498c,_0x901b('0x12'));logger['debug'](_0x901b('0x13'),_0x28498c,'request\x20sent',JSON['stringify'](_0x216a4f));if(_0x216a4f[_0x901b('0x14')]){if(_0x216a4f[_0x901b('0x14')]['code']===0x1f4){logger[_0x901b('0x14')]('ChatWebsite,\x20%s,\x20%s',_0x28498c,_0x216a4f[_0x901b('0x14')][_0x901b('0x15')]);return _0x497b50(_0x216a4f[_0x901b('0x14')]['message']);}logger[_0x901b('0x14')](_0x901b('0x11'),_0x28498c,_0x216a4f[_0x901b('0x14')]['message']);return _0x2b3d9c(_0x216a4f[_0x901b('0x14')]['message']);}else{logger[_0x901b('0x10')](_0x901b('0x11'),_0x28498c,_0x901b('0x12'));_0x2b3d9c(_0x216a4f[_0x901b('0x16')][_0x901b('0x15')]);}})['catch'](function(_0x42d1fc){logger[_0x901b('0x14')](_0x901b('0x11'),_0x28498c,_0x42d1fc);_0x497b50(_0x42d1fc);});});}
\ No newline at end of file
diff --git a/server/api/chatWebsite/chatWebsite.socket.js b/server/api/chatWebsite/chatWebsite.socket.js
index c6c11c0..51c8ec4 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 _0x6b1d=['register','length','chatWebsite:','./chatWebsite.events','remove','removeListener'];(function(_0x121033,_0x4d1215){var _0x5751af=function(_0x260c8c){while(--_0x260c8c){_0x121033['push'](_0x121033['shift']());}};_0x5751af(++_0x4d1215);}(_0x6b1d,0xe7));var _0xd6b1=function(_0xd3b0ac,_0x2f5065){_0xd3b0ac=_0xd3b0ac-0x0;var _0x3d773e=_0x6b1d[_0xd3b0ac];return _0x3d773e;};'use strict';var ChatWebsiteEvents=require(_0xd6b1('0x0'));var events=['save',_0xd6b1('0x1'),'update'];function createListener(_0x1f16c4,_0x584cdc){return function(_0x20561a){_0x584cdc['emit'](_0x1f16c4,_0x20561a);};}function removeListener(_0x1306b9,_0x62f5b4){return function(){ChatWebsiteEvents[_0xd6b1('0x2')](_0x1306b9,_0x62f5b4);};}exports[_0xd6b1('0x3')]=function(_0x54cf64){for(var _0x46ea5b=0x0,_0x197c82=events[_0xd6b1('0x4')];_0x46ea5b<_0x197c82;_0x46ea5b++){var _0x4dd836=events[_0x46ea5b];var _0x44c6e5=createListener(_0xd6b1('0x5')+_0x4dd836,_0x54cf64);ChatWebsiteEvents['on'](_0x4dd836,_0x44c6e5);}};
\ No newline at end of file
+var _0x0d9b=['chatWebsite:','./chatWebsite.events','remove','update','emit','removeListener','register','length'];(function(_0xfb7a8d,_0x25b597){var _0x695fcf=function(_0x36321c){while(--_0x36321c){_0xfb7a8d['push'](_0xfb7a8d['shift']());}};_0x695fcf(++_0x25b597);}(_0x0d9b,0x151));var _0xb0d9=function(_0x5060ac,_0x46cf92){_0x5060ac=_0x5060ac-0x0;var _0x496f54=_0x0d9b[_0x5060ac];return _0x496f54;};'use strict';var ChatWebsiteEvents=require(_0xb0d9('0x0'));var events=['save',_0xb0d9('0x1'),_0xb0d9('0x2')];function createListener(_0x972098,_0x9b4d47){return function(_0x1825b9){_0x9b4d47[_0xb0d9('0x3')](_0x972098,_0x1825b9);};}function removeListener(_0x333919,_0x15b3ac){return function(){ChatWebsiteEvents[_0xb0d9('0x4')](_0x333919,_0x15b3ac);};}exports[_0xb0d9('0x5')]=function(_0x2ccfd8){for(var _0x340b47=0x0,_0x555eba=events[_0xb0d9('0x6')];_0x340b47<_0x555eba;_0x340b47++){var _0x5b1a02=events[_0x340b47];var _0x3b53fa=createListener(_0xb0d9('0x7')+_0x5b1a02,_0x2ccfd8);ChatWebsiteEvents['on'](_0x5b1a02,_0x3b53fa);}};
\ No newline at end of file
diff --git a/server/api/chatWebsite/index.js b/server/api/chatWebsite/index.js
index 4efac45..d62c7a5 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 _0xcb59=['/:id/offline','any','offline','addInteraction','addApplications','/:id/proactive_actions','addAgents','put','/:id','update','delete','destroy','removeDispositions','removeAnswers','removeAgents','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatWebsite.controller','get','isAuthenticated','index','/describe','describe','show','/:id/dispositions','getDispositions','/:id/logo','/:id/avatar','getAvatar','getCustomerAvatar','/:id/system_avatar','getInteractions','/:id/snippet','getSnippet','/:id/applications','/:id/fields','/:id/offline_messages','getOfflineMessages','/:id/users','getAgents','post','create','addDisposition','/:id/canned_answers','addAnswer','diskStorage','root','format','%s-%s','now','originalname','file','addLogo','join','server/files/images/avatars/','single','addAvatar','/:id/customer_avatar','addCustomerAvatar','addSystemAvatar','/:id/notify','notify','server/files','ensureDir','replace'];(function(_0x8b9b45,_0x555425){var _0x5254f1=function(_0x3980a5){while(--_0x3980a5){_0x8b9b45['push'](_0x8b9b45['shift']());}};_0x5254f1(++_0x555425);}(_0xcb59,0x138));var _0x9cb5=function(_0x7a18fb,_0x3242fb){_0x7a18fb=_0x7a18fb-0x0;var _0x412cc6=_0xcb59[_0x7a18fb];return _0x412cc6;};'use strict';var multer=require(_0x9cb5('0x0'));var util=require(_0x9cb5('0x1'));var path=require(_0x9cb5('0x2'));var timeout=require(_0x9cb5('0x3'));var express=require(_0x9cb5('0x4'));var router=express[_0x9cb5('0x5')]();var fs_extra=require(_0x9cb5('0x6'));var auth=require(_0x9cb5('0x7'));var interaction=require(_0x9cb5('0x8'));var config=require(_0x9cb5('0x9'));var controller=require(_0x9cb5('0xa'));router[_0x9cb5('0xb')]('/',auth[_0x9cb5('0xc')](),controller[_0x9cb5('0xd')]);router['get'](_0x9cb5('0xe'),auth[_0x9cb5('0xc')](),controller[_0x9cb5('0xf')]);router[_0x9cb5('0xb')]('/:id',auth[_0x9cb5('0xc')](),controller[_0x9cb5('0x10')]);router['get'](_0x9cb5('0x11'),auth[_0x9cb5('0xc')](),controller[_0x9cb5('0x12')]);router['get']('/:id/canned_answers',auth[_0x9cb5('0xc')](),controller['getAnswers']);router['get'](_0x9cb5('0x13'),controller['getLogo']);router[_0x9cb5('0xb')](_0x9cb5('0x14'),controller[_0x9cb5('0x15')]);router[_0x9cb5('0xb')]('/:id/customer_avatar',controller[_0x9cb5('0x16')]);router[_0x9cb5('0xb')](_0x9cb5('0x17'),controller['getSystemAvatar']);router[_0x9cb5('0xb')]('/:id/interactions',auth[_0x9cb5('0xc')](),controller[_0x9cb5('0x18')]);router[_0x9cb5('0xb')](_0x9cb5('0x19'),controller[_0x9cb5('0x1a')]);router[_0x9cb5('0xb')](_0x9cb5('0x1b'),auth['isAuthenticated'](),controller['getApplications']);router[_0x9cb5('0xb')]('/:id/proactive_actions',auth[_0x9cb5('0xc')](),controller['getProactiveActions']);router['get'](_0x9cb5('0x1c'),controller['getFields']);router['get'](_0x9cb5('0x1d'),auth[_0x9cb5('0xc')](),controller[_0x9cb5('0x1e')]);router[_0x9cb5('0xb')](_0x9cb5('0x1f'),auth[_0x9cb5('0xc')](),controller[_0x9cb5('0x20')]);router[_0x9cb5('0x21')]('/',auth['isAuthenticated'](),controller[_0x9cb5('0x22')]);router[_0x9cb5('0x21')](_0x9cb5('0x11'),auth[_0x9cb5('0xc')](),controller[_0x9cb5('0x23')]);router[_0x9cb5('0x21')](_0x9cb5('0x24'),auth['isAuthenticated'](),controller[_0x9cb5('0x25')]);var upload=multer({'storage':multer[_0x9cb5('0x26')]({'destination':function(_0x96e9eb,_0x57fa14,_0x2efddf){_0x2efddf(null,path['join'](config[_0x9cb5('0x27')],'server/files/images/logos/'));},'filename':function(_0x3f0026,_0x314234,_0x55fe67){_0x55fe67(null,util[_0x9cb5('0x28')](_0x9cb5('0x29'),Date[_0x9cb5('0x2a')](),_0x314234[_0x9cb5('0x2b')]));}})});router['post'](_0x9cb5('0x13'),upload['single'](_0x9cb5('0x2c')),controller[_0x9cb5('0x2d')]);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x2aa798,_0x364c65,_0x186479){_0x186479(null,path[_0x9cb5('0x2e')](config['root'],_0x9cb5('0x2f')));},'filename':function(_0x2ea038,_0x4ba820,_0x3cc181){_0x3cc181(null,util['format'](_0x9cb5('0x29'),Date['now'](),_0x4ba820[_0x9cb5('0x2b')]));}})});router[_0x9cb5('0x21')]('/:id/avatar',upload[_0x9cb5('0x30')](_0x9cb5('0x2c')),controller[_0x9cb5('0x31')]);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x4026df,_0x1efaa5,_0x59f10c){_0x59f10c(null,path[_0x9cb5('0x2e')](config[_0x9cb5('0x27')],_0x9cb5('0x2f')));},'filename':function(_0x2dd49c,_0x297dfc,_0x4aa9af){_0x4aa9af(null,util[_0x9cb5('0x28')](_0x9cb5('0x29'),Date[_0x9cb5('0x2a')](),_0x297dfc[_0x9cb5('0x2b')]));}})});router['post'](_0x9cb5('0x32'),upload['single'](_0x9cb5('0x2c')),controller[_0x9cb5('0x33')]);var upload=multer({'storage':multer[_0x9cb5('0x26')]({'destination':function(_0x388c70,_0x1eba73,_0x44107f){_0x44107f(null,path[_0x9cb5('0x2e')](config[_0x9cb5('0x27')],'server/files/images/avatars/'));},'filename':function(_0x2ef953,_0x421c78,_0x258efb){_0x258efb(null,util[_0x9cb5('0x28')](_0x9cb5('0x29'),Date['now'](),_0x421c78[_0x9cb5('0x2b')]));}})});router[_0x9cb5('0x21')](_0x9cb5('0x17'),upload[_0x9cb5('0x30')](_0x9cb5('0x2c')),controller[_0x9cb5('0x34')]);router['post'](_0x9cb5('0x35'),controller[_0x9cb5('0x36')]);const offlineUploadMulter=multer({'storage':multer[_0x9cb5('0x26')]({'destination':function(_0x5081ab,_0x446f37,_0x3c0d4c){const _0x39f879=path[_0x9cb5('0x2e')](config[_0x9cb5('0x27')],_0x9cb5('0x37'),'attachments','offline-chat');fs_extra[_0x9cb5('0x38')](_0x39f879,function(){_0x3c0d4c(null,_0x39f879);});},'filename':function(_0x59bcb0,_0x577da3,_0x3a99ae){const _0x206a1f=_0x577da3[_0x9cb5('0x2b')][_0x9cb5('0x39')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');const _0x2cc1e7=path['extname'](_0x206a1f);const _0x3ddb80=Date[_0x9cb5('0x2a')]()+'-'+_0x206a1f[_0x9cb5('0x39')](_0x2cc1e7,'')+_0x2cc1e7;_0x3a99ae(null,_0x3ddb80);}})});router[_0x9cb5('0x21')](_0x9cb5('0x3a'),offlineUploadMulter[_0x9cb5('0x3b')](),controller[_0x9cb5('0x3c')]);router['post']('/:id/interactions',auth[_0x9cb5('0xc')](),controller[_0x9cb5('0x3d')]);router[_0x9cb5('0x21')](_0x9cb5('0x1b'),auth[_0x9cb5('0xc')](),controller[_0x9cb5('0x3e')]);router[_0x9cb5('0x21')](_0x9cb5('0x3f'),auth[_0x9cb5('0xc')](),controller['addProactiveActions']);router['post'](_0x9cb5('0x1f'),auth[_0x9cb5('0xc')](),controller[_0x9cb5('0x40')]);router[_0x9cb5('0x41')](_0x9cb5('0x42'),auth[_0x9cb5('0xc')](),controller[_0x9cb5('0x43')]);router[_0x9cb5('0x44')](_0x9cb5('0x42'),auth[_0x9cb5('0xc')](),controller[_0x9cb5('0x45')]);router['delete']('/:id/dispositions',auth[_0x9cb5('0xc')](),controller[_0x9cb5('0x46')]);router[_0x9cb5('0x44')](_0x9cb5('0x24'),auth['isAuthenticated'](),controller[_0x9cb5('0x47')]);router[_0x9cb5('0x44')](_0x9cb5('0x1f'),auth[_0x9cb5('0xc')](),controller[_0x9cb5('0x48')]);module[_0x9cb5('0x49')]=router;
\ No newline at end of file
+var _0xa32c=['getInteractions','/:id/snippet','getSnippet','/:id/applications','getApplications','/:id/proactive_actions','getProactiveActions','/:id/fields','/:id/offline_messages','getOfflineMessages','getAgents','post','create','addDisposition','join','root','server/files/images/logos/','%s-%s','file','addLogo','diskStorage','server/files/images/avatars/','format','now','originalname','addAvatar','single','addSystemAvatar','/:id/notify','notify','server/files','attachments','offline-chat','ensureDir','extname','replace','/:id/offline','offline','addInteraction','/:id/users','addAgents','put','/:id','update','delete','removeDispositions','removeAnswers','removeAgents','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment','get','/describe','isAuthenticated','describe','show','/:id/dispositions','/:id/canned_answers','getAnswers','/:id/logo','getLogo','/:id/avatar','getAvatar','getCustomerAvatar','/:id/system_avatar','getSystemAvatar','/:id/interactions'];(function(_0x3acdb6,_0x378a8b){var _0x89bf51=function(_0x4fb7bc){while(--_0x4fb7bc){_0x3acdb6['push'](_0x3acdb6['shift']());}};_0x89bf51(++_0x378a8b);}(_0xa32c,0x10f));var _0xca32=function(_0x397e5f,_0x454c8f){_0x397e5f=_0x397e5f-0x0;var _0x5302b8=_0xa32c[_0x397e5f];return _0x5302b8;};'use strict';var multer=require(_0xca32('0x0'));var util=require(_0xca32('0x1'));var path=require(_0xca32('0x2'));var timeout=require(_0xca32('0x3'));var express=require(_0xca32('0x4'));var router=express[_0xca32('0x5')]();var fs_extra=require(_0xca32('0x6'));var auth=require('../../components/auth/service');var interaction=require(_0xca32('0x7'));var config=require(_0xca32('0x8'));var controller=require('./chatWebsite.controller');router[_0xca32('0x9')]('/',auth['isAuthenticated'](),controller['index']);router[_0xca32('0x9')](_0xca32('0xa'),auth[_0xca32('0xb')](),controller[_0xca32('0xc')]);router[_0xca32('0x9')]('/:id',auth[_0xca32('0xb')](),controller[_0xca32('0xd')]);router[_0xca32('0x9')](_0xca32('0xe'),auth['isAuthenticated'](),controller['getDispositions']);router[_0xca32('0x9')](_0xca32('0xf'),auth[_0xca32('0xb')](),controller[_0xca32('0x10')]);router['get'](_0xca32('0x11'),controller[_0xca32('0x12')]);router[_0xca32('0x9')](_0xca32('0x13'),controller[_0xca32('0x14')]);router[_0xca32('0x9')]('/:id/customer_avatar',controller[_0xca32('0x15')]);router[_0xca32('0x9')](_0xca32('0x16'),controller[_0xca32('0x17')]);router[_0xca32('0x9')](_0xca32('0x18'),auth[_0xca32('0xb')](),controller[_0xca32('0x19')]);router[_0xca32('0x9')](_0xca32('0x1a'),controller[_0xca32('0x1b')]);router['get'](_0xca32('0x1c'),auth[_0xca32('0xb')](),controller[_0xca32('0x1d')]);router['get'](_0xca32('0x1e'),auth[_0xca32('0xb')](),controller[_0xca32('0x1f')]);router[_0xca32('0x9')](_0xca32('0x20'),controller['getFields']);router['get'](_0xca32('0x21'),auth[_0xca32('0xb')](),controller[_0xca32('0x22')]);router[_0xca32('0x9')]('/:id/users',auth[_0xca32('0xb')](),controller[_0xca32('0x23')]);router[_0xca32('0x24')]('/',auth[_0xca32('0xb')](),controller[_0xca32('0x25')]);router[_0xca32('0x24')]('/:id/dispositions',auth['isAuthenticated'](),controller[_0xca32('0x26')]);router['post']('/:id/canned_answers',auth[_0xca32('0xb')](),controller['addAnswer']);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x3d29fb,_0x272127,_0x57d141){_0x57d141(null,path[_0xca32('0x27')](config[_0xca32('0x28')],_0xca32('0x29')));},'filename':function(_0x332e7c,_0x414856,_0x25ab7a){_0x25ab7a(null,util['format'](_0xca32('0x2a'),Date['now'](),_0x414856['originalname']));}})});router[_0xca32('0x24')](_0xca32('0x11'),upload['single'](_0xca32('0x2b')),controller[_0xca32('0x2c')]);var upload=multer({'storage':multer[_0xca32('0x2d')]({'destination':function(_0x1b858d,_0x410546,_0x4c5c58){_0x4c5c58(null,path[_0xca32('0x27')](config[_0xca32('0x28')],_0xca32('0x2e')));},'filename':function(_0x21c129,_0x3d83bb,_0x1cfbbf){_0x1cfbbf(null,util[_0xca32('0x2f')](_0xca32('0x2a'),Date[_0xca32('0x30')](),_0x3d83bb[_0xca32('0x31')]));}})});router[_0xca32('0x24')](_0xca32('0x13'),upload['single'](_0xca32('0x2b')),controller[_0xca32('0x32')]);var upload=multer({'storage':multer[_0xca32('0x2d')]({'destination':function(_0x33b735,_0x319953,_0x1413a2){_0x1413a2(null,path[_0xca32('0x27')](config[_0xca32('0x28')],_0xca32('0x2e')));},'filename':function(_0x2815b5,_0xcc7212,_0x3dc5ec){_0x3dc5ec(null,util['format'](_0xca32('0x2a'),Date[_0xca32('0x30')](),_0xcc7212[_0xca32('0x31')]));}})});router[_0xca32('0x24')]('/:id/customer_avatar',upload[_0xca32('0x33')](_0xca32('0x2b')),controller['addCustomerAvatar']);var upload=multer({'storage':multer[_0xca32('0x2d')]({'destination':function(_0x3574ba,_0x1f9700,_0xec9209){_0xec9209(null,path[_0xca32('0x27')](config['root'],_0xca32('0x2e')));},'filename':function(_0x1f7e6e,_0x3b7eb4,_0x10ded6){_0x10ded6(null,util[_0xca32('0x2f')]('%s-%s',Date[_0xca32('0x30')](),_0x3b7eb4[_0xca32('0x31')]));}})});router[_0xca32('0x24')](_0xca32('0x16'),upload['single'](_0xca32('0x2b')),controller[_0xca32('0x34')]);router[_0xca32('0x24')](_0xca32('0x35'),controller[_0xca32('0x36')]);const offlineUploadMulter=multer({'storage':multer['diskStorage']({'destination':function(_0x5045d2,_0x207f75,_0x2feb0d){const _0x1b346d=path[_0xca32('0x27')](config[_0xca32('0x28')],_0xca32('0x37'),_0xca32('0x38'),_0xca32('0x39'));fs_extra[_0xca32('0x3a')](_0x1b346d,function(){_0x2feb0d(null,_0x1b346d);});},'filename':function(_0x48bc33,_0x8cfb2a,_0x5db00e){const _0x55574f=_0x8cfb2a[_0xca32('0x31')]['replace'](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');const _0x2f5454=path[_0xca32('0x3b')](_0x55574f);const _0x4ee146=Date['now']()+'-'+_0x55574f[_0xca32('0x3c')](_0x2f5454,'')+_0x2f5454;_0x5db00e(null,_0x4ee146);}})});router[_0xca32('0x24')](_0xca32('0x3d'),offlineUploadMulter['any'](),controller[_0xca32('0x3e')]);router['post'](_0xca32('0x18'),auth[_0xca32('0xb')](),controller[_0xca32('0x3f')]);router[_0xca32('0x24')](_0xca32('0x1c'),auth[_0xca32('0xb')](),controller['addApplications']);router['post'](_0xca32('0x1e'),auth['isAuthenticated'](),controller['addProactiveActions']);router[_0xca32('0x24')](_0xca32('0x40'),auth['isAuthenticated'](),controller[_0xca32('0x41')]);router[_0xca32('0x42')](_0xca32('0x43'),auth[_0xca32('0xb')](),controller[_0xca32('0x44')]);router[_0xca32('0x45')](_0xca32('0x43'),auth[_0xca32('0xb')](),controller['destroy']);router['delete'](_0xca32('0xe'),auth[_0xca32('0xb')](),controller[_0xca32('0x46')]);router['delete'](_0xca32('0xf'),auth[_0xca32('0xb')](),controller[_0xca32('0x47')]);router['delete'](_0xca32('0x40'),auth[_0xca32('0xb')](),controller[_0xca32('0x48')]);module[_0xca32('0x49')]=router;
\ No newline at end of file
diff --git a/server/api/cloudProvider/cloudProvider.attributes.js b/server/api/cloudProvider/cloudProvider.attributes.js
index 926287f..7885275 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 _0xd8a5=['sequelize','STRING','ENUM','Google'];(function(_0x47ad1a,_0x467d68){var _0x586211=function(_0x169364){while(--_0x169364){_0x47ad1a['push'](_0x47ad1a['shift']());}};_0x586211(++_0x467d68);}(_0xd8a5,0x160));var _0x5d8a=function(_0x616db3,_0x1d982f){_0x616db3=_0x616db3-0x0;var _0x5315e7=_0xd8a5[_0x616db3];return _0x5315e7;};'use strict';var Sequelize=require(_0x5d8a('0x0'));module['exports']={'name':{'type':Sequelize[_0x5d8a('0x1')],'allowNull':![],'validate':{'notEmpty':!![]}},'service':{'type':Sequelize[_0x5d8a('0x2')]('AmazonAWS',_0x5d8a('0x3')),'allowNull':![],'validate':{'notEmpty':!![]}},'data1':{'type':Sequelize[_0x5d8a('0x1')]},'data2':{'type':Sequelize[_0x5d8a('0x1')]}};
\ No newline at end of file
+var _0x042a=['AmazonAWS','sequelize','STRING','ENUM'];(function(_0x1c3386,_0x2868c0){var _0x2cc8e9=function(_0x556aa2){while(--_0x556aa2){_0x1c3386['push'](_0x1c3386['shift']());}};_0x2cc8e9(++_0x2868c0);}(_0x042a,0x1d9));var _0xa042=function(_0x217f51,_0x185d87){_0x217f51=_0x217f51-0x0;var _0x19473b=_0x042a[_0x217f51];return _0x19473b;};'use strict';var Sequelize=require(_0xa042('0x0'));module['exports']={'name':{'type':Sequelize[_0xa042('0x1')],'allowNull':![],'validate':{'notEmpty':!![]}},'service':{'type':Sequelize[_0xa042('0x2')](_0xa042('0x3'),'Google'),'allowNull':![],'validate':{'notEmpty':!![]}},'data1':{'type':Sequelize[_0xa042('0x1')]},'data2':{'type':Sequelize[_0xa042('0x1')]}};
\ No newline at end of file
diff --git a/server/api/cloudProvider/cloudProvider.controller.js b/server/api/cloudProvider/cloudProvider.controller.js
index 4e5816b..9507c5d 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 _0x5f66=['update','catch','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','path','to-csv','ejs','squel','crypto','jsforce','desk.js','querystring','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/license/util','sendStatus','status','end','json','undefined','limit','count','offset','Content-Range','apply','reject','save','destroy','then','error','name','send','index','map','CloudProvider','rawAttributes','fieldName','model','keys','query','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','filter','merge','type','VIRTUAL','includeAll','include','findAll','rows','show','params','find','create','body'];(function(_0x12646b,_0x5d7539){var _0x1b244f=function(_0x4fd6ad){while(--_0x4fd6ad){_0x12646b['push'](_0x12646b['shift']());}};_0x1b244f(++_0x5d7539);}(_0x5f66,0x1a0));var _0x65f6=function(_0x126558,_0x143c9a){_0x126558=_0x126558-0x0;var _0x1f6d14=_0x5f66[_0x126558];return _0x1f6d14;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x65f6('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0x65f6('0x1'));var rp=require(_0x65f6('0x2'));var moment=require(_0x65f6('0x3'));var BPromise=require(_0x65f6('0x4'));var Mustache=require(_0x65f6('0x5'));var util=require('util');var path=require(_0x65f6('0x6'));var sox=require('sox');var csv=require(_0x65f6('0x7'));var ejs=require(_0x65f6('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0x65f6('0x9'));var crypto=require(_0x65f6('0xa'));var jsforce=require(_0x65f6('0xb'));var deskjs=require(_0x65f6('0xc'));var toCsv=require(_0x65f6('0x7'));var querystring=require(_0x65f6('0xd'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x65f6('0xe'));var qs=require(_0x65f6('0xf'));var as=require(_0x65f6('0x10'));var hardwareService=require(_0x65f6('0x11'));var logger=require('../../config/logger')(_0x65f6('0x12'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0x65f6('0x13'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x419819,_0x4862a5){_0x4862a5=_0x4862a5||0xcc;return function(_0x2f964a){if(_0x2f964a){return _0x419819[_0x65f6('0x14')](_0x4862a5);}return _0x419819[_0x65f6('0x15')](_0x4862a5)[_0x65f6('0x16')]();};}function respondWithResult(_0x369f96,_0x1d29fd){_0x1d29fd=_0x1d29fd||0xc8;return function(_0x44144b){if(_0x44144b){return _0x369f96[_0x65f6('0x15')](_0x1d29fd)[_0x65f6('0x17')](_0x44144b);}};}function respondWithFilteredResult(_0x3440af,_0x59154e){return function(_0x19b9ff){if(_0x19b9ff){var _0x49a913=typeof _0x59154e['offset']===_0x65f6('0x18')&&typeof _0x59154e[_0x65f6('0x19')]===_0x65f6('0x18');var _0x1c955c=_0x19b9ff[_0x65f6('0x1a')];var _0x1f974c=_0x49a913?0x0:_0x59154e[_0x65f6('0x1b')];var _0x18380e=_0x49a913?_0x19b9ff['count']:_0x59154e['offset']+_0x59154e[_0x65f6('0x19')];var _0x5b4055;if(_0x18380e>=_0x1c955c){_0x18380e=_0x1c955c;_0x5b4055=0xc8;}else{_0x5b4055=0xce;}_0x3440af['status'](_0x5b4055);return _0x3440af['set'](_0x65f6('0x1c'),_0x1f974c+'-'+_0x18380e+'/'+_0x1c955c)[_0x65f6('0x17')](_0x19b9ff);}return null;};}function patchUpdates(_0x5114a4){return function(_0x39e19f){try{jsonpatch[_0x65f6('0x1d')](_0x39e19f,_0x5114a4,!![]);}catch(_0xbee6a4){return BPromise[_0x65f6('0x1e')](_0xbee6a4);}return _0x39e19f[_0x65f6('0x1f')]();};}function saveUpdates(_0xc139c2,_0x581374){return function(_0x197a49){if(_0x197a49){return _0x197a49['update'](_0xc139c2)['then'](function(_0x212247){return _0x212247;});}return null;};}function removeEntity(_0xd173f4,_0x524e42){return function(_0x1eeaaa){if(_0x1eeaaa){return _0x1eeaaa[_0x65f6('0x20')]()[_0x65f6('0x21')](function(){_0xd173f4[_0x65f6('0x15')](0xcc)['end']();});}};}function handleEntityNotFound(_0x9d7bb0,_0x59ea32){return function(_0x20a161){if(!_0x20a161){_0x9d7bb0['sendStatus'](0x194);}return _0x20a161;};}function handleError(_0x5cb131,_0x4fde2f){_0x4fde2f=_0x4fde2f||0x1f4;return function(_0x29abdb){logger[_0x65f6('0x22')](_0x29abdb['stack']);if(_0x29abdb[_0x65f6('0x23')]){delete _0x29abdb[_0x65f6('0x23')];}_0x5cb131['status'](_0x4fde2f)[_0x65f6('0x24')](_0x29abdb);};}exports[_0x65f6('0x25')]=function(_0x28d0df,_0x559330){var _0x4ac04b={},_0x488d36={},_0x266cfe={'count':0x0,'rows':[]};var _0x3c032f=_[_0x65f6('0x26')](db[_0x65f6('0x27')][_0x65f6('0x28')],function(_0x14a387){return{'name':_0x14a387[_0x65f6('0x29')],'type':_0x14a387['type']['key']};});_0x488d36[_0x65f6('0x2a')]=_[_0x65f6('0x26')](_0x3c032f,'name');_0x488d36['query']=_[_0x65f6('0x2b')](_0x28d0df[_0x65f6('0x2c')]);_0x488d36[_0x65f6('0x2d')]=_[_0x65f6('0x2e')](_0x488d36[_0x65f6('0x2a')],_0x488d36[_0x65f6('0x2c')]);_0x4ac04b['attributes']=_[_0x65f6('0x2e')](_0x488d36[_0x65f6('0x2a')],qs[_0x65f6('0x2f')](_0x28d0df['query'][_0x65f6('0x2f')]));_0x4ac04b[_0x65f6('0x30')]=_0x4ac04b[_0x65f6('0x30')][_0x65f6('0x31')]?_0x4ac04b[_0x65f6('0x30')]:_0x488d36[_0x65f6('0x2a')];if(!_0x28d0df['query'][_0x65f6('0x32')](_0x65f6('0x33'))){_0x4ac04b['limit']=qs[_0x65f6('0x19')](_0x28d0df['query'][_0x65f6('0x19')]);_0x4ac04b['offset']=qs[_0x65f6('0x1b')](_0x28d0df[_0x65f6('0x2c')]['offset']);}_0x4ac04b[_0x65f6('0x34')]=qs[_0x65f6('0x35')](_0x28d0df[_0x65f6('0x2c')]['sort']);_0x4ac04b['where']=qs[_0x65f6('0x2d')](_['pick'](_0x28d0df[_0x65f6('0x2c')],_0x488d36['filters']),_0x3c032f);if(_0x28d0df[_0x65f6('0x2c')][_0x65f6('0x36')]){_0x4ac04b['where']=_[_0x65f6('0x37')](_0x4ac04b['where'],{'$or':_['map'](_0x3c032f,function(_0x71b16b){if(_0x71b16b[_0x65f6('0x38')]!==_0x65f6('0x39')){var _0x313be5={};_0x313be5[_0x71b16b[_0x65f6('0x23')]]={'$like':'%'+_0x28d0df[_0x65f6('0x2c')][_0x65f6('0x36')]+'%'};return _0x313be5;}})});}_0x4ac04b=_[_0x65f6('0x37')]({},_0x4ac04b,_0x28d0df['options']);var _0x3aa254={'where':_0x4ac04b['where']};return db[_0x65f6('0x27')][_0x65f6('0x1a')](_0x3aa254)[_0x65f6('0x21')](function(_0x2ea7f7){_0x266cfe['count']=_0x2ea7f7;if(_0x28d0df[_0x65f6('0x2c')][_0x65f6('0x3a')]){_0x4ac04b[_0x65f6('0x3b')]=[{'all':!![]}];}return db[_0x65f6('0x27')][_0x65f6('0x3c')](_0x4ac04b);})[_0x65f6('0x21')](function(_0xed4c96){_0x266cfe[_0x65f6('0x3d')]=_0xed4c96;return _0x266cfe;})[_0x65f6('0x21')](respondWithFilteredResult(_0x559330,_0x4ac04b))['catch'](handleError(_0x559330,null));};exports[_0x65f6('0x3e')]=function(_0x400ed2,_0x377ae5){var _0x181798={'raw':!![],'where':{'id':_0x400ed2[_0x65f6('0x3f')]['id']}},_0x83e2d9={};_0x83e2d9[_0x65f6('0x2a')]=_[_0x65f6('0x2b')](db[_0x65f6('0x27')][_0x65f6('0x28')]);_0x83e2d9[_0x65f6('0x2c')]=_[_0x65f6('0x2b')](_0x400ed2[_0x65f6('0x2c')]);_0x83e2d9[_0x65f6('0x2d')]=_[_0x65f6('0x2e')](_0x83e2d9[_0x65f6('0x2a')],_0x83e2d9['query']);_0x181798[_0x65f6('0x30')]=_[_0x65f6('0x2e')](_0x83e2d9[_0x65f6('0x2a')],qs[_0x65f6('0x2f')](_0x400ed2['query'][_0x65f6('0x2f')]));_0x181798[_0x65f6('0x30')]=_0x181798[_0x65f6('0x30')]['length']?_0x181798[_0x65f6('0x30')]:_0x83e2d9[_0x65f6('0x2a')];if(_0x400ed2[_0x65f6('0x2c')][_0x65f6('0x3a')]){_0x181798['include']=[{'all':!![]}];}_0x181798=_[_0x65f6('0x37')]({},_0x181798,_0x400ed2['options']);return db[_0x65f6('0x27')][_0x65f6('0x40')](_0x181798)['then'](handleEntityNotFound(_0x377ae5,null))[_0x65f6('0x21')](respondWithResult(_0x377ae5,null))['catch'](handleError(_0x377ae5,null));};exports[_0x65f6('0x41')]=function(_0x4d9b76,_0x2d1706){return db[_0x65f6('0x27')][_0x65f6('0x41')](_0x4d9b76[_0x65f6('0x42')],{})['then'](respondWithResult(_0x2d1706,0xc9))['catch'](handleError(_0x2d1706,null));};exports[_0x65f6('0x43')]=function(_0x15d3ba,_0x3b647a){if(_0x15d3ba[_0x65f6('0x42')]['id']){delete _0x15d3ba[_0x65f6('0x42')]['id'];}return db[_0x65f6('0x27')][_0x65f6('0x40')]({'where':{'id':_0x15d3ba[_0x65f6('0x3f')]['id']}})[_0x65f6('0x21')](handleEntityNotFound(_0x3b647a,null))['then'](saveUpdates(_0x15d3ba[_0x65f6('0x42')],null))[_0x65f6('0x21')](respondWithResult(_0x3b647a,null))[_0x65f6('0x44')](handleError(_0x3b647a,null));};exports['destroy']=function(_0x47e749,_0x42d453){return db['CloudProvider'][_0x65f6('0x40')]({'where':{'id':_0x47e749[_0x65f6('0x3f')]['id']}})['then'](handleEntityNotFound(_0x42d453,null))[_0x65f6('0x21')](removeEntity(_0x42d453,null))['catch'](handleError(_0x42d453,null));};
\ No newline at end of file
+var _0x7a54=['offset','undefined','count','limit','set','Content-Range','reject','save','update','then','destroy','error','stack','name','send','index','CloudProvider','fieldName','type','model','map','query','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','where','pick','filter','VIRTUAL','includeAll','include','findAll','rows','show','params','length','merge','options','find','catch','body','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'];(function(_0x2adca1,_0x3d2a48){var _0x586415=function(_0x1c19c5){while(--_0x1c19c5){_0x2adca1['push'](_0x2adca1['shift']());}};_0x586415(++_0x3d2a48);}(_0x7a54,0x106));var _0x47a5=function(_0x1f9ef2,_0x598bf9){_0x1f9ef2=_0x1f9ef2-0x0;var _0x17a4d3=_0x7a54[_0x1f9ef2];return _0x17a4d3;};'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['CloudProvider'][_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['CloudProvider']['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['CloudProvider']['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('0x2a')][_0x47a5('0x45')]({'where':{'id':_0x2dd1db[_0x47a5('0x41')]['id']}})[_0x47a5('0x23')](handleEntityNotFound(_0x411230,null))[_0x47a5('0x23')](removeEntity(_0x411230,null))['catch'](handleError(_0x411230,null));};
\ No newline at end of file
diff --git a/server/api/cloudProvider/cloudProvider.model.js b/server/api/cloudProvider/cloudProvider.model.js
index fce78af..5341454 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 _0x36ce=['CloudProvider','cloud_providers','util','../../config/logger','api','path','rimraf','./cloudProvider.attributes','define'];(function(_0x3f9631,_0x51ffcb){var _0x242d84=function(_0xfcd4f7){while(--_0xfcd4f7){_0x3f9631['push'](_0x3f9631['shift']());}};_0x242d84(++_0x51ffcb);}(_0x36ce,0xa4));var _0xe36c=function(_0x1ab8f9,_0x57f54e){_0x1ab8f9=_0x1ab8f9-0x0;var _0x3da929=_0x36ce[_0x1ab8f9];return _0x3da929;};'use strict';var _=require('lodash');var util=require(_0xe36c('0x0'));var logger=require(_0xe36c('0x1'))(_0xe36c('0x2'));var moment=require('moment');var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0xe36c('0x3'));var rimraf=require(_0xe36c('0x4'));var config=require('../../config/environment');var attributes=require(_0xe36c('0x5'));module['exports']=function(_0x2e29ce,_0x3c9c12){return _0x2e29ce[_0xe36c('0x6')](_0xe36c('0x7'),attributes,{'tableName':_0xe36c('0x8'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x13cd=['moment','bluebird','request-promise','rimraf','../../config/environment','./cloudProvider.attributes','exports','define','CloudProvider','../../config/logger','api'];(function(_0x3e3cc1,_0x31f8a5){var _0x411645=function(_0x54126d){while(--_0x54126d){_0x3e3cc1['push'](_0x3e3cc1['shift']());}};_0x411645(++_0x31f8a5);}(_0x13cd,0xb9));var _0xd13c=function(_0x20cbd4,_0x932828){_0x20cbd4=_0x20cbd4-0x0;var _0x52c55c=_0x13cd[_0x20cbd4];return _0x52c55c;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0xd13c('0x0'))(_0xd13c('0x1'));var moment=require(_0xd13c('0x2'));var BPromise=require(_0xd13c('0x3'));var rp=require(_0xd13c('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0xd13c('0x5'));var config=require(_0xd13c('0x6'));var attributes=require(_0xd13c('0x7'));module[_0xd13c('0x8')]=function(_0xad8643,_0x529499){return _0xad8643[_0xd13c('0x9')](_0xd13c('0xa'),attributes,{'tableName':'cloud_providers','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
diff --git a/server/api/cloudProvider/cloudProvider.rpc.js b/server/api/cloudProvider/cloudProvider.rpc.js
index c697fde..05aff18 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 _0x5853=['then','info','CloudProvider,\x20%s,\x20%s','request\x20sent','CloudProvider,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request'];(function(_0x46698a,_0x8de1e4){var _0x356db0=function(_0x19e83c){while(--_0x19e83c){_0x46698a['push'](_0x46698a['shift']());}};_0x356db0(++_0x8de1e4);}(_0x5853,0x113));var _0x3585=function(_0x2bf1d6,_0x410efd){_0x2bf1d6=_0x2bf1d6-0x0;var _0x1be08a=_0x5853[_0x2bf1d6];return _0x1be08a;};'use strict';var _=require(_0x3585('0x0'));var util=require(_0x3585('0x1'));var moment=require(_0x3585('0x2'));var BPromise=require(_0x3585('0x3'));var rs=require(_0x3585('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x3585('0x5'))['db'];var utils=require(_0x3585('0x6'));var logger=require(_0x3585('0x7'))(_0x3585('0x8'));var config=require(_0x3585('0x9'));var jayson=require(_0x3585('0xa'));var client=jayson['client'][_0x3585('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x48b3ff,_0x5d8c2d,_0x1a97fd){return new BPromise(function(_0x5e78f3,_0x5910ab){return client[_0x3585('0xc')](_0x48b3ff,_0x1a97fd)[_0x3585('0xd')](function(_0x2febe8){logger[_0x3585('0xe')](_0x3585('0xf'),_0x5d8c2d,_0x3585('0x10'));logger['debug'](_0x3585('0x11'),_0x5d8c2d,_0x3585('0x10'),JSON[_0x3585('0x12')](_0x2febe8));if(_0x2febe8[_0x3585('0x13')]){if(_0x2febe8[_0x3585('0x13')][_0x3585('0x14')]===0x1f4){logger[_0x3585('0x13')]('CloudProvider,\x20%s,\x20%s',_0x5d8c2d,_0x2febe8[_0x3585('0x13')]['message']);return _0x5910ab(_0x2febe8['error']['message']);}logger['error'](_0x3585('0xf'),_0x5d8c2d,_0x2febe8['error'][_0x3585('0x15')]);return _0x5e78f3(_0x2febe8[_0x3585('0x13')]['message']);}else{logger[_0x3585('0xe')](_0x3585('0xf'),_0x5d8c2d,'request\x20sent');_0x5e78f3(_0x2febe8[_0x3585('0x16')][_0x3585('0x15')]);}})[_0x3585('0x17')](function(_0x2beae5){logger[_0x3585('0x13')]('CloudProvider,\x20%s,\x20%s',_0x5d8c2d,_0x2beae5);_0x5910ab(_0x2beae5);});});}
\ No newline at end of file
+var _0x794b=['CloudProvider,\x20%s,\x20%s','request\x20sent','debug','CloudProvider,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','lodash','util','bluebird','randomstring','../../config/utils','../../config/logger','jayson/promise','client','http','request','then','info'];(function(_0x2a6824,_0x44c0b7){var _0x49920d=function(_0x5b2678){while(--_0x5b2678){_0x2a6824['push'](_0x2a6824['shift']());}};_0x49920d(++_0x44c0b7);}(_0x794b,0x1c2));var _0xb794=function(_0x51af96,_0x42104c){_0x51af96=_0x51af96-0x0;var _0x2bb16b=_0x794b[_0x51af96];return _0x2bb16b;};'use strict';var _=require(_0xb794('0x0'));var util=require(_0xb794('0x1'));var moment=require('moment');var BPromise=require(_0xb794('0x2'));var rs=require(_0xb794('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0xb794('0x4'));var logger=require(_0xb794('0x5'))('rpc');var config=require('../../config/environment');var jayson=require(_0xb794('0x6'));var client=jayson[_0xb794('0x7')][_0xb794('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x20e4d4,_0x231206,_0x340863){return new BPromise(function(_0x5d099b,_0x30f03f){return client[_0xb794('0x9')](_0x20e4d4,_0x340863)[_0xb794('0xa')](function(_0xc3dde7){logger[_0xb794('0xb')](_0xb794('0xc'),_0x231206,_0xb794('0xd'));logger[_0xb794('0xe')](_0xb794('0xf'),_0x231206,_0xb794('0xd'),JSON[_0xb794('0x10')](_0xc3dde7));if(_0xc3dde7[_0xb794('0x11')]){if(_0xc3dde7[_0xb794('0x11')][_0xb794('0x12')]===0x1f4){logger[_0xb794('0x11')](_0xb794('0xc'),_0x231206,_0xc3dde7[_0xb794('0x11')][_0xb794('0x13')]);return _0x30f03f(_0xc3dde7[_0xb794('0x11')][_0xb794('0x13')]);}logger[_0xb794('0x11')]('CloudProvider,\x20%s,\x20%s',_0x231206,_0xc3dde7[_0xb794('0x11')][_0xb794('0x13')]);return _0x5d099b(_0xc3dde7[_0xb794('0x11')][_0xb794('0x13')]);}else{logger[_0xb794('0xb')](_0xb794('0xc'),_0x231206,'request\x20sent');_0x5d099b(_0xc3dde7[_0xb794('0x14')][_0xb794('0x13')]);}})['catch'](function(_0x408766){logger[_0xb794('0x11')]('CloudProvider,\x20%s,\x20%s',_0x231206,_0x408766);_0x30f03f(_0x408766);});});}
\ No newline at end of file
diff --git a/server/api/cloudProvider/index.js b/server/api/cloudProvider/index.js
index 633a7ff..1177db1 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 _0xf590=['fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./cloudProvider.controller','get','index','/:id','show','post','create','put','isAuthenticated','delete','multer','path','express','Router'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xf590,0x1e2));var _0x0f59=function(_0x36c87d,_0x2ab247){_0x36c87d=_0x36c87d-0x0;var _0x54dc55=_0xf590[_0x36c87d];return _0x54dc55;};'use strict';var multer=require(_0x0f59('0x0'));var util=require('util');var path=require(_0x0f59('0x1'));var timeout=require('connect-timeout');var express=require(_0x0f59('0x2'));var router=express[_0x0f59('0x3')]();var fs_extra=require(_0x0f59('0x4'));var auth=require(_0x0f59('0x5'));var interaction=require(_0x0f59('0x6'));var config=require(_0x0f59('0x7'));var controller=require(_0x0f59('0x8'));router[_0x0f59('0x9')]('/',auth['isAuthenticated'](),controller[_0x0f59('0xa')]);router[_0x0f59('0x9')](_0x0f59('0xb'),auth['isAuthenticated'](),controller[_0x0f59('0xc')]);router[_0x0f59('0xd')]('/',auth['isAuthenticated'](),controller[_0x0f59('0xe')]);router[_0x0f59('0xf')](_0x0f59('0xb'),auth[_0x0f59('0x10')](),controller['update']);router[_0x0f59('0x11')](_0x0f59('0xb'),auth[_0x0f59('0x10')](),controller['destroy']);module['exports']=router;
\ No newline at end of file
+var _0xa76e=['Router','../../components/auth/service','../../components/interaction/service','../../config/environment','get','index','/:id','isAuthenticated','create','put','update','delete','destroy','exports','util','path'];(function(_0x1c8df6,_0x149c27){var _0x5a2b1f=function(_0x2494cc){while(--_0x2494cc){_0x1c8df6['push'](_0x1c8df6['shift']());}};_0x5a2b1f(++_0x149c27);}(_0xa76e,0xfe));var _0xea76=function(_0x18f152,_0x41585a){_0x18f152=_0x18f152-0x0;var _0xa10b34=_0xa76e[_0x18f152];return _0xa10b34;};'use strict';var multer=require('multer');var util=require(_0xea76('0x0'));var path=require(_0xea76('0x1'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0xea76('0x2')]();var fs_extra=require('fs-extra');var auth=require(_0xea76('0x3'));var interaction=require(_0xea76('0x4'));var config=require(_0xea76('0x5'));var controller=require('./cloudProvider.controller');router[_0xea76('0x6')]('/',auth['isAuthenticated'](),controller[_0xea76('0x7')]);router['get'](_0xea76('0x8'),auth[_0xea76('0x9')](),controller['show']);router['post']('/',auth[_0xea76('0x9')](),controller[_0xea76('0xa')]);router[_0xea76('0xb')](_0xea76('0x8'),auth['isAuthenticated'](),controller[_0xea76('0xc')]);router[_0xea76('0xd')](_0xea76('0x8'),auth['isAuthenticated'](),controller[_0xea76('0xe')]);module[_0xea76('0xf')]=router;
\ No newline at end of file
diff --git a/server/api/cmCompany/cmCompany.attributes.js b/server/api/cmCompany/cmCompany.attributes.js
index 3f7508d..5030a85 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 _0xef2e=['exports','STRING','name'];(function(_0x4c73ac,_0x46b73c){var _0x9839ee=function(_0x2076fb){while(--_0x2076fb){_0x4c73ac['push'](_0x4c73ac['shift']());}};_0x9839ee(++_0x46b73c);}(_0xef2e,0x141));var _0xeef2=function(_0x3246b4,_0x401153){_0x3246b4=_0x3246b4-0x0;var _0x34b3d7=_0xef2e[_0x3246b4];return _0x34b3d7;};'use strict';var Sequelize=require('sequelize');module[_0xeef2('0x0')]={'name':{'type':Sequelize[_0xeef2('0x1')],'unique':_0xeef2('0x2'),'allowNull':![],'validate':{'notEmpty':!![]}},'vat':{'type':Sequelize[_0xeef2('0x1')]},'companyId':{'type':Sequelize[_0xeef2('0x1')]},'website':{'type':Sequelize[_0xeef2('0x1')]},'phone':{'type':Sequelize[_0xeef2('0x1')]},'fax':{'type':Sequelize[_0xeef2('0x1')]},'type':{'type':Sequelize[_0xeef2('0x1')]},'street':{'type':Sequelize['STRING']},'postalCode':{'type':Sequelize[_0xeef2('0x1')]},'city':{'type':Sequelize[_0xeef2('0x1')]},'country':{'type':Sequelize[_0xeef2('0x1')]},'email':{'type':Sequelize['STRING'],'validate':{'isEmail':!![]}},'emailDomain':{'type':Sequelize[_0xeef2('0x1')]},'sStreet':{'type':Sequelize['STRING']},'sPostalCode':{'type':Sequelize[_0xeef2('0x1')]},'sCity':{'type':Sequelize[_0xeef2('0x1')]},'sCountry':{'type':Sequelize[_0xeef2('0x1')]},'description':{'type':Sequelize[_0xeef2('0x1')]}};
\ No newline at end of file
+var _0x201c=['STRING','name','sequelize','exports'];(function(_0x3ab164,_0x2fa5e9){var _0x39565e=function(_0x40dfe8){while(--_0x40dfe8){_0x3ab164['push'](_0x3ab164['shift']());}};_0x39565e(++_0x2fa5e9);}(_0x201c,0x17a));var _0xc201=function(_0x353e0f,_0x4eb49b){_0x353e0f=_0x353e0f-0x0;var _0x140b47=_0x201c[_0x353e0f];return _0x140b47;};'use strict';var Sequelize=require(_0xc201('0x0'));module[_0xc201('0x1')]={'name':{'type':Sequelize[_0xc201('0x2')],'unique':_0xc201('0x3'),'allowNull':![],'validate':{'notEmpty':!![]}},'vat':{'type':Sequelize[_0xc201('0x2')]},'companyId':{'type':Sequelize[_0xc201('0x2')]},'website':{'type':Sequelize['STRING']},'phone':{'type':Sequelize[_0xc201('0x2')]},'fax':{'type':Sequelize['STRING']},'type':{'type':Sequelize[_0xc201('0x2')]},'street':{'type':Sequelize[_0xc201('0x2')]},'postalCode':{'type':Sequelize['STRING']},'city':{'type':Sequelize[_0xc201('0x2')]},'country':{'type':Sequelize[_0xc201('0x2')]},'email':{'type':Sequelize['STRING'],'validate':{'isEmail':!![]}},'emailDomain':{'type':Sequelize['STRING']},'sStreet':{'type':Sequelize[_0xc201('0x2')]},'sPostalCode':{'type':Sequelize['STRING']},'sCity':{'type':Sequelize[_0xc201('0x2')]},'sCountry':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0xc201('0x2')]}};
\ No newline at end of file
diff --git a/server/api/cmCompany/cmCompany.controller.js b/server/api/cmCompany/cmCompany.controller.js
index 3090173..0fe4db1 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 _0xe1d9=['includeAll','findAll','rows','catch','show','params','rawAttributes','include','find','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','addContacts','CmContact','ids','getContacts','order','nolimit','eml-format','zip-dir','moment','bluebird','mustache','util','sox','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','undefined','limit','count','offset','set','reject','destroy','then','get','Companies','UserProfileResource','stack','name','send','index','CmCompany','describe','model','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','sort','where','pick','filter','merge','map','options'];(function(_0x1b1bd5,_0xf50a3){var _0x12bf17=function(_0x5a1a9f){while(--_0x5a1a9f){_0x1b1bd5['push'](_0x1b1bd5['shift']());}};_0x12bf17(++_0xf50a3);}(_0xe1d9,0x1db));var _0x9e1d=function(_0x41e2b9,_0x3270cc){_0x41e2b9=_0x41e2b9-0x0;var _0x3ca389=_0xe1d9[_0x41e2b9];return _0x3ca389;};'use strict';var emlformat=require(_0x9e1d('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x9e1d('0x1'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x9e1d('0x2'));var BPromise=require(_0x9e1d('0x3'));var Mustache=require(_0x9e1d('0x4'));var util=require(_0x9e1d('0x5'));var path=require('path');var sox=require(_0x9e1d('0x6'));var csv=require('to-csv');var ejs=require(_0x9e1d('0x7'));var fs=require('fs');var fs_extra=require(_0x9e1d('0x8'));var _=require(_0x9e1d('0x9'));var squel=require(_0x9e1d('0xa'));var crypto=require(_0x9e1d('0xb'));var jsforce=require(_0x9e1d('0xc'));var deskjs=require(_0x9e1d('0xd'));var toCsv=require(_0x9e1d('0xe'));var querystring=require(_0x9e1d('0xf'));var Papa=require(_0x9e1d('0x10'));var Redis=require(_0x9e1d('0x11'));var authService=require(_0x9e1d('0x12'));var qs=require(_0x9e1d('0x13'));var as=require(_0x9e1d('0x14'));var hardwareService=require(_0x9e1d('0x15'));var logger=require(_0x9e1d('0x16'))(_0x9e1d('0x17'));var utils=require(_0x9e1d('0x18'));var config=require(_0x9e1d('0x19'));var licenseUtil=require(_0x9e1d('0x1a'));var db=require(_0x9e1d('0x1b'))['db'];function respondWithStatusCode(_0x56a0cb,_0xfbfe22){_0xfbfe22=_0xfbfe22||0xcc;return function(_0x58fea5){if(_0x58fea5){return _0x56a0cb[_0x9e1d('0x1c')](_0xfbfe22);}return _0x56a0cb[_0x9e1d('0x1d')](_0xfbfe22)[_0x9e1d('0x1e')]();};}function respondWithResult(_0x2b9485,_0x4f7e95){_0x4f7e95=_0x4f7e95||0xc8;return function(_0x24ebcc){if(_0x24ebcc){return _0x2b9485[_0x9e1d('0x1d')](_0x4f7e95)[_0x9e1d('0x1f')](_0x24ebcc);}};}function respondWithFilteredResult(_0x8393a7,_0x2c0904){return function(_0x3bb149){if(_0x3bb149){var _0x5c290d=typeof _0x2c0904['offset']===_0x9e1d('0x20')&&typeof _0x2c0904[_0x9e1d('0x21')]===_0x9e1d('0x20');var _0x432918=_0x3bb149[_0x9e1d('0x22')];var _0x34bc7d=_0x5c290d?0x0:_0x2c0904[_0x9e1d('0x23')];var _0x5aa2b7=_0x5c290d?_0x3bb149[_0x9e1d('0x22')]:_0x2c0904[_0x9e1d('0x23')]+_0x2c0904[_0x9e1d('0x21')];var _0x3a480a;if(_0x5aa2b7>=_0x432918){_0x5aa2b7=_0x432918;_0x3a480a=0xc8;}else{_0x3a480a=0xce;}_0x8393a7[_0x9e1d('0x1d')](_0x3a480a);return _0x8393a7[_0x9e1d('0x24')]('Content-Range',_0x34bc7d+'-'+_0x5aa2b7+'/'+_0x432918)[_0x9e1d('0x1f')](_0x3bb149);}return null;};}function patchUpdates(_0x18dfe9){return function(_0x117469){try{jsonpatch['apply'](_0x117469,_0x18dfe9,!![]);}catch(_0x410e0a){return BPromise[_0x9e1d('0x25')](_0x410e0a);}return _0x117469['save']();};}function saveUpdates(_0x304ef8,_0x7ea22e){return function(_0x3ed631){if(_0x3ed631){return _0x3ed631['update'](_0x304ef8)['then'](function(_0x1cd08){return _0x1cd08;});}return null;};}function removeEntity(_0x15d7c1,_0x4bb710){return function(_0x566bc4){if(_0x566bc4){return _0x566bc4[_0x9e1d('0x26')]()[_0x9e1d('0x27')](function(){var _0x14427d=_0x566bc4[_0x9e1d('0x28')]({'plain':!![]});var _0x1b76bb=_0x9e1d('0x29');return db[_0x9e1d('0x2a')][_0x9e1d('0x26')]({'where':{'type':_0x1b76bb,'resourceId':_0x14427d['id']}})['then'](function(){return _0x566bc4;});})['then'](function(){_0x15d7c1[_0x9e1d('0x1d')](0xcc)[_0x9e1d('0x1e')]();});}};}function handleEntityNotFound(_0x264e2d,_0x224482){return function(_0x1a9e7d){if(!_0x1a9e7d){_0x264e2d[_0x9e1d('0x1c')](0x194);}return _0x1a9e7d;};}function handleError(_0x4c81d0,_0x265a19){_0x265a19=_0x265a19||0x1f4;return function(_0x4d00a3){logger['error'](_0x4d00a3[_0x9e1d('0x2b')]);if(_0x4d00a3[_0x9e1d('0x2c')]){delete _0x4d00a3[_0x9e1d('0x2c')];}_0x4c81d0[_0x9e1d('0x1d')](_0x265a19)[_0x9e1d('0x2d')](_0x4d00a3);};}exports[_0x9e1d('0x2e')]=function(_0x3a91b2,_0x4790fe){var _0x231814={},_0x2c27fa={},_0x26e083={'count':0x0,'rows':[]};return db[_0x9e1d('0x2f')][_0x9e1d('0x30')]()[_0x9e1d('0x27')](function(_0x3e6212){_0x2c27fa[_0x9e1d('0x31')]=_[_0x9e1d('0x32')](_0x3e6212);_0x2c27fa[_0x9e1d('0x33')]=_[_0x9e1d('0x32')](_0x3a91b2['query']);_0x2c27fa[_0x9e1d('0x34')]=_[_0x9e1d('0x35')](_0x2c27fa['model'],_0x2c27fa[_0x9e1d('0x33')]);_0x231814[_0x9e1d('0x36')]=_[_0x9e1d('0x35')](_0x2c27fa[_0x9e1d('0x31')],qs[_0x9e1d('0x37')](_0x3a91b2[_0x9e1d('0x33')]['fields']));_0x231814[_0x9e1d('0x36')]=_0x231814['attributes'][_0x9e1d('0x38')]?_0x231814['attributes']:_0x2c27fa[_0x9e1d('0x31')];if(!_0x3a91b2[_0x9e1d('0x33')][_0x9e1d('0x39')]('nolimit')){_0x231814['limit']=qs[_0x9e1d('0x21')](_0x3a91b2[_0x9e1d('0x33')][_0x9e1d('0x21')]);_0x231814[_0x9e1d('0x23')]=qs[_0x9e1d('0x23')](_0x3a91b2[_0x9e1d('0x33')][_0x9e1d('0x23')]);}_0x231814['order']=qs[_0x9e1d('0x3a')](_0x3a91b2[_0x9e1d('0x33')][_0x9e1d('0x3a')]);_0x231814[_0x9e1d('0x3b')]=qs[_0x9e1d('0x34')](_[_0x9e1d('0x3c')](_0x3a91b2[_0x9e1d('0x33')],_0x2c27fa[_0x9e1d('0x34')]),_0x3e6212);if(_0x3a91b2[_0x9e1d('0x33')][_0x9e1d('0x3d')]){_0x231814['where']=_[_0x9e1d('0x3e')](_0x231814[_0x9e1d('0x3b')],{'$or':_[_0x9e1d('0x3f')](_0x231814['attributes'],function(_0x20718a){var _0x51d0e9={};_0x51d0e9[_0x20718a]={'$like':'%'+_0x3a91b2[_0x9e1d('0x33')]['filter']+'%'};return _0x51d0e9;})});}_0x231814=_[_0x9e1d('0x3e')]({},_0x231814,_0x3a91b2[_0x9e1d('0x40')]);var _0x3d4bf8={'where':_0x231814[_0x9e1d('0x3b')]};return db[_0x9e1d('0x2f')][_0x9e1d('0x22')](_0x3d4bf8)[_0x9e1d('0x27')](function(_0x38e36e){_0x26e083[_0x9e1d('0x22')]=_0x38e36e;if(_0x3a91b2[_0x9e1d('0x33')][_0x9e1d('0x41')]){_0x231814['include']=[{'all':!![]}];}return db['CmCompany'][_0x9e1d('0x42')](_0x231814);})[_0x9e1d('0x27')](function(_0x3ad340){_0x26e083[_0x9e1d('0x43')]=_0x3ad340;return _0x26e083;})[_0x9e1d('0x27')](respondWithFilteredResult(_0x4790fe,_0x231814))[_0x9e1d('0x44')](handleError(_0x4790fe,null));})[_0x9e1d('0x44')](handleError(_0x4790fe,null));};exports[_0x9e1d('0x45')]=function(_0x4aa159,_0x405178){var _0x17ca87={'raw':![],'where':{'id':_0x4aa159[_0x9e1d('0x46')]['id']}},_0x325cd2={};_0x325cd2['model']=_[_0x9e1d('0x32')](db[_0x9e1d('0x2f')][_0x9e1d('0x47')]);_0x325cd2[_0x9e1d('0x33')]=_[_0x9e1d('0x32')](_0x4aa159[_0x9e1d('0x33')]);_0x325cd2['filters']=_[_0x9e1d('0x35')](_0x325cd2[_0x9e1d('0x31')],_0x325cd2[_0x9e1d('0x33')]);_0x17ca87['attributes']=_[_0x9e1d('0x35')](_0x325cd2[_0x9e1d('0x31')],qs['fields'](_0x4aa159[_0x9e1d('0x33')][_0x9e1d('0x37')]));_0x17ca87['attributes']=_0x17ca87[_0x9e1d('0x36')][_0x9e1d('0x38')]?_0x17ca87[_0x9e1d('0x36')]:_0x325cd2[_0x9e1d('0x31')];if(_0x4aa159[_0x9e1d('0x33')]['includeAll']){_0x17ca87[_0x9e1d('0x48')]=[{'all':!![]}];}_0x17ca87=_[_0x9e1d('0x3e')]({},_0x17ca87,_0x4aa159[_0x9e1d('0x40')]);return db[_0x9e1d('0x2f')][_0x9e1d('0x49')](_0x17ca87)['then'](handleEntityNotFound(_0x405178,null))['then'](respondWithResult(_0x405178,null))[_0x9e1d('0x44')](handleError(_0x405178,null));};exports[_0x9e1d('0x4a')]=function(_0x13b191,_0x45c4f8){return db[_0x9e1d('0x2f')][_0x9e1d('0x4a')](_0x13b191['body'],{})['then'](function(_0x557049){var _0x135ab7=_0x13b191[_0x9e1d('0x4b')]['get']({'plain':!![]});if(!_0x135ab7)throw new Error(_0x9e1d('0x4c'));if(_0x135ab7[_0x9e1d('0x4d')]===_0x9e1d('0x4b')){var _0xd220f4=_0x557049[_0x9e1d('0x28')]({'plain':!![]});var _0x5d10f8='Companies';return db[_0x9e1d('0x4e')]['find']({'where':{'name':_0x5d10f8,'userProfileId':_0x135ab7[_0x9e1d('0x4f')]},'raw':!![]})[_0x9e1d('0x27')](function(_0x3f6489){if(_0x3f6489&&_0x3f6489[_0x9e1d('0x50')]===0x0){return db[_0x9e1d('0x2a')][_0x9e1d('0x4a')]({'name':_0xd220f4[_0x9e1d('0x2c')],'resourceId':_0xd220f4['id'],'type':_0x3f6489['name'],'sectionId':_0x3f6489['id']},{})[_0x9e1d('0x27')](function(){return _0x557049;});}else{return _0x557049;}})[_0x9e1d('0x44')](function(_0x59a6de){logger[_0x9e1d('0x51')](_0x9e1d('0x52'),_0x59a6de);throw _0x59a6de;});}return _0x557049;})['then'](respondWithResult(_0x45c4f8,0xc9))[_0x9e1d('0x44')](handleError(_0x45c4f8,null));};exports['update']=function(_0x67ebec,_0x3d522d){if(_0x67ebec[_0x9e1d('0x53')]['id']){delete _0x67ebec[_0x9e1d('0x53')]['id'];}return db[_0x9e1d('0x2f')][_0x9e1d('0x49')]({'where':{'id':_0x67ebec[_0x9e1d('0x46')]['id']}})[_0x9e1d('0x27')](handleEntityNotFound(_0x3d522d,null))[_0x9e1d('0x27')](saveUpdates(_0x67ebec['body'],null))[_0x9e1d('0x27')](respondWithResult(_0x3d522d,null))['catch'](handleError(_0x3d522d,null));};exports['destroy']=function(_0x2b5316,_0x5c76a6){return db[_0x9e1d('0x2f')]['find']({'where':{'id':_0x2b5316['params']['id']}})[_0x9e1d('0x27')](handleEntityNotFound(_0x5c76a6,null))[_0x9e1d('0x27')](removeEntity(_0x5c76a6,null))[_0x9e1d('0x44')](handleError(_0x5c76a6,null));};exports[_0x9e1d('0x30')]=function(_0x105d4b,_0x252de2){return db[_0x9e1d('0x2f')][_0x9e1d('0x30')]()[_0x9e1d('0x27')](respondWithResult(_0x252de2,null))[_0x9e1d('0x44')](handleError(_0x252de2,null));};exports[_0x9e1d('0x54')]=function(_0x57c8c9,_0x573a2f,_0x535c42){return db[_0x9e1d('0x55')][_0x9e1d('0x49')]({'where':{'id':_0x57c8c9[_0x9e1d('0x46')]['id']}})[_0x9e1d('0x27')](handleEntityNotFound(_0x573a2f,null))[_0x9e1d('0x27')](function(_0x31fb62){if(_0x31fb62){return _0x31fb62[_0x9e1d('0x54')](_0x57c8c9[_0x9e1d('0x53')][_0x9e1d('0x56')],_['omit'](_0x57c8c9['body'],[_0x9e1d('0x56'),'id'])||{});}})[_0x9e1d('0x27')](respondWithResult(_0x573a2f,null))[_0x9e1d('0x44')](handleError(_0x573a2f,null));};exports[_0x9e1d('0x57')]=function(_0x4eec69,_0x7c7ecc,_0x141fff){var _0x3f9658={};var _0x546cc5={};var _0x2c8659;var _0x134ee1;return db[_0x9e1d('0x2f')]['findOne']({'where':{'id':_0x4eec69[_0x9e1d('0x46')]['id']}})[_0x9e1d('0x27')](handleEntityNotFound(_0x7c7ecc,null))[_0x9e1d('0x27')](function(_0x1384b9){if(_0x1384b9){_0x2c8659=_0x1384b9;_0x546cc5[_0x9e1d('0x31')]=_['keys'](db[_0x9e1d('0x55')]['rawAttributes']);_0x546cc5[_0x9e1d('0x33')]=_['keys'](_0x4eec69[_0x9e1d('0x33')]);_0x546cc5['filters']=_['intersection'](_0x546cc5[_0x9e1d('0x31')],_0x546cc5['query']);_0x3f9658[_0x9e1d('0x36')]=_['intersection'](_0x546cc5[_0x9e1d('0x31')],qs[_0x9e1d('0x37')](_0x4eec69[_0x9e1d('0x33')][_0x9e1d('0x37')]));_0x3f9658[_0x9e1d('0x36')]=_0x3f9658[_0x9e1d('0x36')][_0x9e1d('0x38')]?_0x3f9658[_0x9e1d('0x36')]:_0x546cc5['model'];_0x3f9658[_0x9e1d('0x58')]=qs[_0x9e1d('0x3a')](_0x4eec69['query'][_0x9e1d('0x3a')]);_0x3f9658[_0x9e1d('0x3b')]=qs[_0x9e1d('0x34')](_[_0x9e1d('0x3c')](_0x4eec69['query'],_0x546cc5['filters']));if(_0x4eec69['query'][_0x9e1d('0x3d')]){_0x3f9658['where']=_['merge'](_0x3f9658['where'],{'$or':_[_0x9e1d('0x3f')](_0x3f9658['attributes'],function(_0x312298){var _0x197551={};_0x197551[_0x312298]={'$like':'%'+_0x4eec69[_0x9e1d('0x33')][_0x9e1d('0x3d')]+'%'};return _0x197551;})});}_0x3f9658=_['merge']({},_0x3f9658,_0x4eec69['options']);return _0x2c8659[_0x9e1d('0x57')](_0x3f9658);}})[_0x9e1d('0x27')](function(_0x2f708e){if(_0x2f708e){_0x134ee1=_0x2f708e[_0x9e1d('0x38')];if(!_0x4eec69[_0x9e1d('0x33')][_0x9e1d('0x39')](_0x9e1d('0x59'))){_0x3f9658['limit']=qs[_0x9e1d('0x21')](_0x4eec69[_0x9e1d('0x33')][_0x9e1d('0x21')]);_0x3f9658[_0x9e1d('0x23')]=qs[_0x9e1d('0x23')](_0x4eec69['query'][_0x9e1d('0x23')]);}return _0x2c8659[_0x9e1d('0x57')](_0x3f9658);}})[_0x9e1d('0x27')](function(_0x2a2a1c){if(_0x2a2a1c){return _0x2a2a1c?{'count':_0x134ee1,'rows':_0x2a2a1c}:null;}})[_0x9e1d('0x27')](respondWithResult(_0x7c7ecc,null))[_0x9e1d('0x44')](handleError(_0x7c7ecc,null));};
\ No newline at end of file
+var _0x2273=['pick','filter','merge','map','options','includeAll','rows','catch','show','rawAttributes','include','find','create','body','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','params','addContacts','omit','getContacts','CmContact','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/advancedSearch','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','end','status','json','undefined','limit','count','offset','set','Content-Range','apply','reject','save','destroy','then','Companies','sendStatus','error','stack','name','send','index','CmCompany','describe','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where'];(function(_0x561e7b,_0x4bcd2e){var _0x5851ed=function(_0x4513de){while(--_0x4513de){_0x561e7b['push'](_0x561e7b['shift']());}};_0x5851ed(++_0x4bcd2e);}(_0x2273,0x1d2));var _0x3227=function(_0x164a97,_0x2dd205){_0x164a97=_0x164a97-0x0;var _0x1ec236=_0x2273[_0x164a97];return _0x1ec236;};'use strict';var emlformat=require(_0x3227('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x3227('0x1'));var jsonpatch=require(_0x3227('0x2'));var rp=require(_0x3227('0x3'));var moment=require(_0x3227('0x4'));var BPromise=require(_0x3227('0x5'));var Mustache=require(_0x3227('0x6'));var util=require(_0x3227('0x7'));var path=require(_0x3227('0x8'));var sox=require(_0x3227('0x9'));var csv=require(_0x3227('0xa'));var ejs=require(_0x3227('0xb'));var fs=require('fs');var fs_extra=require(_0x3227('0xc'));var _=require('lodash');var squel=require(_0x3227('0xd'));var crypto=require(_0x3227('0xe'));var jsforce=require(_0x3227('0xf'));var deskjs=require(_0x3227('0x10'));var toCsv=require(_0x3227('0xa'));var querystring=require(_0x3227('0x11'));var Papa=require(_0x3227('0x12'));var Redis=require('ioredis');var authService=require(_0x3227('0x13'));var qs=require('../../components/parsers/qs');var as=require(_0x3227('0x14'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x3227('0x15'))('api');var utils=require(_0x3227('0x16'));var config=require(_0x3227('0x17'));var licenseUtil=require(_0x3227('0x18'));var db=require(_0x3227('0x19'))['db'];function respondWithStatusCode(_0x115ebe,_0xf68960){_0xf68960=_0xf68960||0xcc;return function(_0x804240){if(_0x804240){return _0x115ebe['sendStatus'](_0xf68960);}return _0x115ebe['status'](_0xf68960)[_0x3227('0x1a')]();};}function respondWithResult(_0x38e998,_0x5d4d9f){_0x5d4d9f=_0x5d4d9f||0xc8;return function(_0xb7dbd2){if(_0xb7dbd2){return _0x38e998[_0x3227('0x1b')](_0x5d4d9f)[_0x3227('0x1c')](_0xb7dbd2);}};}function respondWithFilteredResult(_0x2bbb7f,_0xb880c2){return function(_0xa0dfea){if(_0xa0dfea){var _0x40306e=typeof _0xb880c2['offset']===_0x3227('0x1d')&&typeof _0xb880c2[_0x3227('0x1e')]===_0x3227('0x1d');var _0xc59b15=_0xa0dfea[_0x3227('0x1f')];var _0x32ceca=_0x40306e?0x0:_0xb880c2[_0x3227('0x20')];var _0x48f8e5=_0x40306e?_0xa0dfea[_0x3227('0x1f')]:_0xb880c2['offset']+_0xb880c2[_0x3227('0x1e')];var _0x345723;if(_0x48f8e5>=_0xc59b15){_0x48f8e5=_0xc59b15;_0x345723=0xc8;}else{_0x345723=0xce;}_0x2bbb7f[_0x3227('0x1b')](_0x345723);return _0x2bbb7f[_0x3227('0x21')](_0x3227('0x22'),_0x32ceca+'-'+_0x48f8e5+'/'+_0xc59b15)[_0x3227('0x1c')](_0xa0dfea);}return null;};}function patchUpdates(_0x34e632){return function(_0x303afe){try{jsonpatch[_0x3227('0x23')](_0x303afe,_0x34e632,!![]);}catch(_0x8aef16){return BPromise[_0x3227('0x24')](_0x8aef16);}return _0x303afe[_0x3227('0x25')]();};}function saveUpdates(_0x278b98,_0x431029){return function(_0x31d553){if(_0x31d553){return _0x31d553['update'](_0x278b98)['then'](function(_0x37fd0c){return _0x37fd0c;});}return null;};}function removeEntity(_0x15d12a,_0x221f98){return function(_0x505eac){if(_0x505eac){return _0x505eac[_0x3227('0x26')]()[_0x3227('0x27')](function(){var _0xdcfeda=_0x505eac['get']({'plain':!![]});var _0x1b58de=_0x3227('0x28');return db['UserProfileResource'][_0x3227('0x26')]({'where':{'type':_0x1b58de,'resourceId':_0xdcfeda['id']}})[_0x3227('0x27')](function(){return _0x505eac;});})['then'](function(){_0x15d12a['status'](0xcc)[_0x3227('0x1a')]();});}};}function handleEntityNotFound(_0x5b4295,_0x527b9d){return function(_0x7e6b41){if(!_0x7e6b41){_0x5b4295[_0x3227('0x29')](0x194);}return _0x7e6b41;};}function handleError(_0x3e0bd5,_0x41b9a2){_0x41b9a2=_0x41b9a2||0x1f4;return function(_0x2ba150){logger[_0x3227('0x2a')](_0x2ba150[_0x3227('0x2b')]);if(_0x2ba150['name']){delete _0x2ba150[_0x3227('0x2c')];}_0x3e0bd5[_0x3227('0x1b')](_0x41b9a2)[_0x3227('0x2d')](_0x2ba150);};}exports[_0x3227('0x2e')]=function(_0x3d766f,_0x44fbd5){var _0x480780={},_0xac83e0={},_0x3be91b={'count':0x0,'rows':[]};return db[_0x3227('0x2f')][_0x3227('0x30')]()['then'](function(_0x3ded4c){_0xac83e0[_0x3227('0x31')]=_['keys'](_0x3ded4c);_0xac83e0[_0x3227('0x32')]=_[_0x3227('0x33')](_0x3d766f['query']);_0xac83e0[_0x3227('0x34')]=_[_0x3227('0x35')](_0xac83e0[_0x3227('0x31')],_0xac83e0[_0x3227('0x32')]);_0x480780[_0x3227('0x36')]=_['intersection'](_0xac83e0[_0x3227('0x31')],qs[_0x3227('0x37')](_0x3d766f['query'][_0x3227('0x37')]));_0x480780[_0x3227('0x36')]=_0x480780[_0x3227('0x36')][_0x3227('0x38')]?_0x480780[_0x3227('0x36')]:_0xac83e0[_0x3227('0x31')];if(!_0x3d766f[_0x3227('0x32')][_0x3227('0x39')](_0x3227('0x3a'))){_0x480780[_0x3227('0x1e')]=qs['limit'](_0x3d766f[_0x3227('0x32')]['limit']);_0x480780[_0x3227('0x20')]=qs[_0x3227('0x20')](_0x3d766f[_0x3227('0x32')]['offset']);}_0x480780[_0x3227('0x3b')]=qs[_0x3227('0x3c')](_0x3d766f[_0x3227('0x32')][_0x3227('0x3c')]);_0x480780[_0x3227('0x3d')]=qs[_0x3227('0x34')](_[_0x3227('0x3e')](_0x3d766f[_0x3227('0x32')],_0xac83e0['filters']),_0x3ded4c);if(_0x3d766f['query'][_0x3227('0x3f')]){_0x480780[_0x3227('0x3d')]=_[_0x3227('0x40')](_0x480780[_0x3227('0x3d')],{'$or':_[_0x3227('0x41')](_0x480780[_0x3227('0x36')],function(_0x443fcc){var _0x1ec477={};_0x1ec477[_0x443fcc]={'$like':'%'+_0x3d766f[_0x3227('0x32')][_0x3227('0x3f')]+'%'};return _0x1ec477;})});}_0x480780=_[_0x3227('0x40')]({},_0x480780,_0x3d766f[_0x3227('0x42')]);var _0x49bfeb={'where':_0x480780[_0x3227('0x3d')]};return db[_0x3227('0x2f')][_0x3227('0x1f')](_0x49bfeb)[_0x3227('0x27')](function(_0x6b5f55){_0x3be91b[_0x3227('0x1f')]=_0x6b5f55;if(_0x3d766f[_0x3227('0x32')][_0x3227('0x43')]){_0x480780['include']=[{'all':!![]}];}return db[_0x3227('0x2f')]['findAll'](_0x480780);})['then'](function(_0x5ad8ab){_0x3be91b[_0x3227('0x44')]=_0x5ad8ab;return _0x3be91b;})[_0x3227('0x27')](respondWithFilteredResult(_0x44fbd5,_0x480780))['catch'](handleError(_0x44fbd5,null));})[_0x3227('0x45')](handleError(_0x44fbd5,null));};exports[_0x3227('0x46')]=function(_0x3b7096,_0xdb7877){var _0xcbe0a0={'raw':![],'where':{'id':_0x3b7096['params']['id']}},_0x2b76a7={};_0x2b76a7['model']=_['keys'](db[_0x3227('0x2f')][_0x3227('0x47')]);_0x2b76a7[_0x3227('0x32')]=_[_0x3227('0x33')](_0x3b7096[_0x3227('0x32')]);_0x2b76a7[_0x3227('0x34')]=_[_0x3227('0x35')](_0x2b76a7[_0x3227('0x31')],_0x2b76a7[_0x3227('0x32')]);_0xcbe0a0[_0x3227('0x36')]=_[_0x3227('0x35')](_0x2b76a7[_0x3227('0x31')],qs[_0x3227('0x37')](_0x3b7096['query'][_0x3227('0x37')]));_0xcbe0a0[_0x3227('0x36')]=_0xcbe0a0[_0x3227('0x36')][_0x3227('0x38')]?_0xcbe0a0[_0x3227('0x36')]:_0x2b76a7['model'];if(_0x3b7096[_0x3227('0x32')]['includeAll']){_0xcbe0a0[_0x3227('0x48')]=[{'all':!![]}];}_0xcbe0a0=_['merge']({},_0xcbe0a0,_0x3b7096[_0x3227('0x42')]);return db[_0x3227('0x2f')][_0x3227('0x49')](_0xcbe0a0)[_0x3227('0x27')](handleEntityNotFound(_0xdb7877,null))[_0x3227('0x27')](respondWithResult(_0xdb7877,null))[_0x3227('0x45')](handleError(_0xdb7877,null));};exports[_0x3227('0x4a')]=function(_0xaae089,_0x1f1ad9){return db[_0x3227('0x2f')][_0x3227('0x4a')](_0xaae089[_0x3227('0x4b')],{})[_0x3227('0x27')](function(_0x127c70){var _0x5bb4ce=_0xaae089[_0x3227('0x4c')][_0x3227('0x4d')]({'plain':!![]});if(!_0x5bb4ce)throw new Error(_0x3227('0x4e'));if(_0x5bb4ce['role']==='user'){var _0x3b118b=_0x127c70['get']({'plain':!![]});var _0x43c02d=_0x3227('0x28');return db['UserProfileSection']['find']({'where':{'name':_0x43c02d,'userProfileId':_0x5bb4ce[_0x3227('0x4f')]},'raw':!![]})[_0x3227('0x27')](function(_0x48d47b){if(_0x48d47b&&_0x48d47b[_0x3227('0x50')]===0x0){return db['UserProfileResource']['create']({'name':_0x3b118b[_0x3227('0x2c')],'resourceId':_0x3b118b['id'],'type':_0x48d47b['name'],'sectionId':_0x48d47b['id']},{})[_0x3227('0x27')](function(){return _0x127c70;});}else{return _0x127c70;}})[_0x3227('0x45')](function(_0x101386){logger[_0x3227('0x2a')](_0x3227('0x51'),_0x101386);throw _0x101386;});}return _0x127c70;})['then'](respondWithResult(_0x1f1ad9,0xc9))[_0x3227('0x45')](handleError(_0x1f1ad9,null));};exports[_0x3227('0x52')]=function(_0x346153,_0xb05a1a){if(_0x346153[_0x3227('0x4b')]['id']){delete _0x346153[_0x3227('0x4b')]['id'];}return db['CmCompany'][_0x3227('0x49')]({'where':{'id':_0x346153[_0x3227('0x53')]['id']}})[_0x3227('0x27')](handleEntityNotFound(_0xb05a1a,null))[_0x3227('0x27')](saveUpdates(_0x346153[_0x3227('0x4b')],null))['then'](respondWithResult(_0xb05a1a,null))[_0x3227('0x45')](handleError(_0xb05a1a,null));};exports[_0x3227('0x26')]=function(_0x5874c3,_0x5d6d3d){return db['CmCompany'][_0x3227('0x49')]({'where':{'id':_0x5874c3[_0x3227('0x53')]['id']}})[_0x3227('0x27')](handleEntityNotFound(_0x5d6d3d,null))[_0x3227('0x27')](removeEntity(_0x5d6d3d,null))[_0x3227('0x45')](handleError(_0x5d6d3d,null));};exports['describe']=function(_0x1b2f6f,_0x2b0337){return db[_0x3227('0x2f')][_0x3227('0x30')]()[_0x3227('0x27')](respondWithResult(_0x2b0337,null))[_0x3227('0x45')](handleError(_0x2b0337,null));};exports[_0x3227('0x54')]=function(_0x118e26,_0xdd2d85,_0x5cea4d){return db['CmContact']['find']({'where':{'id':_0x118e26[_0x3227('0x53')]['id']}})[_0x3227('0x27')](handleEntityNotFound(_0xdd2d85,null))[_0x3227('0x27')](function(_0x48bbad){if(_0x48bbad){return _0x48bbad['addContacts'](_0x118e26[_0x3227('0x4b')]['ids'],_[_0x3227('0x55')](_0x118e26[_0x3227('0x4b')],['ids','id'])||{});}})[_0x3227('0x27')](respondWithResult(_0xdd2d85,null))[_0x3227('0x45')](handleError(_0xdd2d85,null));};exports[_0x3227('0x56')]=function(_0x19af6f,_0x45fc96,_0x375357){var _0x5f5f0b={};var _0x27c5cf={};var _0x164741;var _0x26f484;return db[_0x3227('0x2f')]['findOne']({'where':{'id':_0x19af6f[_0x3227('0x53')]['id']}})[_0x3227('0x27')](handleEntityNotFound(_0x45fc96,null))[_0x3227('0x27')](function(_0x48999){if(_0x48999){_0x164741=_0x48999;_0x27c5cf['model']=_[_0x3227('0x33')](db[_0x3227('0x57')][_0x3227('0x47')]);_0x27c5cf['query']=_[_0x3227('0x33')](_0x19af6f[_0x3227('0x32')]);_0x27c5cf[_0x3227('0x34')]=_[_0x3227('0x35')](_0x27c5cf[_0x3227('0x31')],_0x27c5cf[_0x3227('0x32')]);_0x5f5f0b['attributes']=_['intersection'](_0x27c5cf[_0x3227('0x31')],qs[_0x3227('0x37')](_0x19af6f[_0x3227('0x32')]['fields']));_0x5f5f0b[_0x3227('0x36')]=_0x5f5f0b[_0x3227('0x36')][_0x3227('0x38')]?_0x5f5f0b[_0x3227('0x36')]:_0x27c5cf[_0x3227('0x31')];_0x5f5f0b[_0x3227('0x3b')]=qs[_0x3227('0x3c')](_0x19af6f[_0x3227('0x32')][_0x3227('0x3c')]);_0x5f5f0b[_0x3227('0x3d')]=qs[_0x3227('0x34')](_['pick'](_0x19af6f[_0x3227('0x32')],_0x27c5cf[_0x3227('0x34')]));if(_0x19af6f['query'][_0x3227('0x3f')]){_0x5f5f0b[_0x3227('0x3d')]=_['merge'](_0x5f5f0b[_0x3227('0x3d')],{'$or':_[_0x3227('0x41')](_0x5f5f0b['attributes'],function(_0x4613d9){var _0x27960b={};_0x27960b[_0x4613d9]={'$like':'%'+_0x19af6f[_0x3227('0x32')][_0x3227('0x3f')]+'%'};return _0x27960b;})});}_0x5f5f0b=_[_0x3227('0x40')]({},_0x5f5f0b,_0x19af6f[_0x3227('0x42')]);return _0x164741[_0x3227('0x56')](_0x5f5f0b);}})[_0x3227('0x27')](function(_0x278e0d){if(_0x278e0d){_0x26f484=_0x278e0d[_0x3227('0x38')];if(!_0x19af6f[_0x3227('0x32')]['hasOwnProperty'](_0x3227('0x3a'))){_0x5f5f0b[_0x3227('0x1e')]=qs[_0x3227('0x1e')](_0x19af6f['query'][_0x3227('0x1e')]);_0x5f5f0b['offset']=qs[_0x3227('0x20')](_0x19af6f[_0x3227('0x32')][_0x3227('0x20')]);}return _0x164741[_0x3227('0x56')](_0x5f5f0b);}})[_0x3227('0x27')](function(_0x5de8cf){if(_0x5de8cf){return _0x5de8cf?{'count':_0x26f484,'rows':_0x5de8cf}:null;}})['then'](respondWithResult(_0x45fc96,null))[_0x3227('0x45')](handleError(_0x45fc96,null));};
\ No newline at end of file
diff --git a/server/api/cmCompany/cmCompany.model.js b/server/api/cmCompany/cmCompany.model.js
index cfb0373..30f15b0 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 _0x7628=['path','rimraf','../../config/environment','./cmCompany.attributes','define','CmCompany','cm_companies','lodash','api','moment','request-promise'];(function(_0x2d8128,_0x525a80){var _0x5b9feb=function(_0x2c294b){while(--_0x2c294b){_0x2d8128['push'](_0x2d8128['shift']());}};_0x5b9feb(++_0x525a80);}(_0x7628,0x17d));var _0x8762=function(_0x5c4274,_0x400429){_0x5c4274=_0x5c4274-0x0;var _0x582abd=_0x7628[_0x5c4274];return _0x582abd;};'use strict';var _=require(_0x8762('0x0'));var util=require('util');var logger=require('../../config/logger')(_0x8762('0x1'));var moment=require(_0x8762('0x2'));var BPromise=require('bluebird');var rp=require(_0x8762('0x3'));var fs=require('fs');var path=require(_0x8762('0x4'));var rimraf=require(_0x8762('0x5'));var config=require(_0x8762('0x6'));var attributes=require(_0x8762('0x7'));module['exports']=function(_0x21344f,_0x1b813e){return _0x21344f[_0x8762('0x8')](_0x8762('0x9'),attributes,{'tableName':_0x8762('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x802a=['bluebird','request-promise','rimraf','../../config/environment','./cmCompany.attributes','exports','define','CmCompany','cm_companies','util','api','moment'];(function(_0x95f62f,_0x3c9f6){var _0x133311=function(_0x2288f6){while(--_0x2288f6){_0x95f62f['push'](_0x95f62f['shift']());}};_0x133311(++_0x3c9f6);}(_0x802a,0x1d1));var _0xa802=function(_0x12fc8d,_0x19ee33){_0x12fc8d=_0x12fc8d-0x0;var _0x3f9d04=_0x802a[_0x12fc8d];return _0x3f9d04;};'use strict';var _=require('lodash');var util=require(_0xa802('0x0'));var logger=require('../../config/logger')(_0xa802('0x1'));var moment=require(_0xa802('0x2'));var BPromise=require(_0xa802('0x3'));var rp=require(_0xa802('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0xa802('0x5'));var config=require(_0xa802('0x6'));var attributes=require(_0xa802('0x7'));module[_0xa802('0x8')]=function(_0x2b28a9,_0x26da7c){return _0x2b28a9[_0xa802('0x9')](_0xa802('0xa'),attributes,{'tableName':_0xa802('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 284d249..773264b 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 _0xe677=['jayson/promise','client','http','then','info','CmCompany,\x20%s,\x20%s','request\x20sent','debug','CmCompany,\x20%s,\x20%s,\x20%s','stringify','error','message','catch','lodash','util','bluebird','../../mysqldb','../../config/utils','rpc','../../config/environment'];(function(_0x59f3c8,_0x269e43){var _0x320c2f=function(_0x2c22a5){while(--_0x2c22a5){_0x59f3c8['push'](_0x59f3c8['shift']());}};_0x320c2f(++_0x269e43);}(_0xe677,0xc1));var _0x7e67=function(_0x1e4a8e,_0x18022b){_0x1e4a8e=_0x1e4a8e-0x0;var _0x5408f9=_0xe677[_0x1e4a8e];return _0x5408f9;};'use strict';var _=require(_0x7e67('0x0'));var util=require(_0x7e67('0x1'));var moment=require('moment');var BPromise=require(_0x7e67('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x7e67('0x3'))['db'];var utils=require(_0x7e67('0x4'));var logger=require('../../config/logger')(_0x7e67('0x5'));var config=require(_0x7e67('0x6'));var jayson=require(_0x7e67('0x7'));var client=jayson[_0x7e67('0x8')][_0x7e67('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x4d4116,_0x5efe32,_0x52121e){return new BPromise(function(_0x34fc31,_0xaec077){return client['request'](_0x4d4116,_0x52121e)[_0x7e67('0xa')](function(_0x276730){logger[_0x7e67('0xb')](_0x7e67('0xc'),_0x5efe32,_0x7e67('0xd'));logger[_0x7e67('0xe')](_0x7e67('0xf'),_0x5efe32,_0x7e67('0xd'),JSON[_0x7e67('0x10')](_0x276730));if(_0x276730['error']){if(_0x276730[_0x7e67('0x11')]['code']===0x1f4){logger[_0x7e67('0x11')](_0x7e67('0xc'),_0x5efe32,_0x276730[_0x7e67('0x11')][_0x7e67('0x12')]);return _0xaec077(_0x276730['error'][_0x7e67('0x12')]);}logger[_0x7e67('0x11')]('CmCompany,\x20%s,\x20%s',_0x5efe32,_0x276730[_0x7e67('0x11')]['message']);return _0x34fc31(_0x276730[_0x7e67('0x11')]['message']);}else{logger[_0x7e67('0xb')](_0x7e67('0xc'),_0x5efe32,_0x7e67('0xd'));_0x34fc31(_0x276730['result'][_0x7e67('0x12')]);}})[_0x7e67('0x13')](function(_0x2f47d5){logger[_0x7e67('0x11')](_0x7e67('0xc'),_0x5efe32,_0x2f47d5);_0xaec077(_0x2f47d5);});});}
\ No newline at end of file
+var _0x78b5=['request\x20sent','stringify','error','code','message','CmCompany,\x20%s,\x20%s','result','lodash','randomstring','ioredis','../../config/utils','rpc','../../config/environment','jayson/promise','client','then','info','debug','CmCompany,\x20%s,\x20%s,\x20%s'];(function(_0x3ef8f7,_0x35359a){var _0x3b097e=function(_0x189c92){while(--_0x189c92){_0x3ef8f7['push'](_0x3ef8f7['shift']());}};_0x3b097e(++_0x35359a);}(_0x78b5,0x66));var _0x578b=function(_0x2f8805,_0x471690){_0x2f8805=_0x2f8805-0x0;var _0x1c74c9=_0x78b5[_0x2f8805];return _0x1c74c9;};'use strict';var _=require(_0x578b('0x0'));var util=require('util');var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x578b('0x1'));var fs=require('fs');var Redis=require(_0x578b('0x2'));var db=require('../../mysqldb')['db'];var utils=require(_0x578b('0x3'));var logger=require('../../config/logger')(_0x578b('0x4'));var config=require(_0x578b('0x5'));var jayson=require(_0x578b('0x6'));var client=jayson[_0x578b('0x7')]['http']({'port':0x232a});function respondWithRpcPromise(_0x5874da,_0xf8c70e,_0x2d8da1){return new BPromise(function(_0x1f5b2f,_0x373378){return client['request'](_0x5874da,_0x2d8da1)[_0x578b('0x8')](function(_0x883dc7){logger[_0x578b('0x9')]('CmCompany,\x20%s,\x20%s',_0xf8c70e,'request\x20sent');logger[_0x578b('0xa')](_0x578b('0xb'),_0xf8c70e,_0x578b('0xc'),JSON[_0x578b('0xd')](_0x883dc7));if(_0x883dc7[_0x578b('0xe')]){if(_0x883dc7[_0x578b('0xe')][_0x578b('0xf')]===0x1f4){logger[_0x578b('0xe')]('CmCompany,\x20%s,\x20%s',_0xf8c70e,_0x883dc7['error'][_0x578b('0x10')]);return _0x373378(_0x883dc7[_0x578b('0xe')][_0x578b('0x10')]);}logger[_0x578b('0xe')](_0x578b('0x11'),_0xf8c70e,_0x883dc7[_0x578b('0xe')]['message']);return _0x1f5b2f(_0x883dc7[_0x578b('0xe')]['message']);}else{logger[_0x578b('0x9')]('CmCompany,\x20%s,\x20%s',_0xf8c70e,_0x578b('0xc'));_0x1f5b2f(_0x883dc7[_0x578b('0x12')][_0x578b('0x10')]);}})['catch'](function(_0x24b26c){logger[_0x578b('0xe')](_0x578b('0x11'),_0xf8c70e,_0x24b26c);_0x373378(_0x24b26c);});});}
\ No newline at end of file
diff --git a/server/api/cmCompany/index.js b/server/api/cmCompany/index.js
index 67cb91a..13dc377 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 _0x637f=['show','/:id/contacts','getContacts','post','put','update','delete','destroy','exports','multer','util','connect-timeout','Router','fs-extra','../../components/interaction/service','../../config/environment','./cmCompany.controller','get','isAuthenticated','/:id'];(function(_0x166742,_0x55520c){var _0xb7814a=function(_0x18feaf){while(--_0x18feaf){_0x166742['push'](_0x166742['shift']());}};_0xb7814a(++_0x55520c);}(_0x637f,0x10d));var _0xf637=function(_0x5a9397,_0x2e444c){_0x5a9397=_0x5a9397-0x0;var _0x5b89be=_0x637f[_0x5a9397];return _0x5b89be;};'use strict';var multer=require(_0xf637('0x0'));var util=require(_0xf637('0x1'));var path=require('path');var timeout=require(_0xf637('0x2'));var express=require('express');var router=express[_0xf637('0x3')]();var fs_extra=require(_0xf637('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0xf637('0x5'));var config=require(_0xf637('0x6'));var controller=require(_0xf637('0x7'));router[_0xf637('0x8')]('/',auth[_0xf637('0x9')](),controller['index']);router[_0xf637('0x8')]('/describe',auth[_0xf637('0x9')](),controller['describe']);router[_0xf637('0x8')](_0xf637('0xa'),auth[_0xf637('0x9')](),controller[_0xf637('0xb')]);router[_0xf637('0x8')](_0xf637('0xc'),auth[_0xf637('0x9')](),controller[_0xf637('0xd')]);router['post']('/',auth['isAuthenticated'](),controller['create']);router[_0xf637('0xe')]('/:id/contacts',auth['isAuthenticated'](),controller['addContacts']);router[_0xf637('0xf')](_0xf637('0xa'),auth['isAuthenticated'](),controller[_0xf637('0x10')]);router[_0xf637('0x11')]('/:id',auth['isAuthenticated'](),controller[_0xf637('0x12')]);module[_0xf637('0x13')]=router;
\ No newline at end of file
+var _0x991a=['post','/:id/contacts','addContacts','put','/:id','delete','destroy','exports','multer','util','path','express','fs-extra','../../components/interaction/service','../../config/environment','./cmCompany.controller','get','index','isAuthenticated','show','getContacts'];(function(_0x3e00e9,_0x491e31){var _0x375c58=function(_0x35b975){while(--_0x35b975){_0x3e00e9['push'](_0x3e00e9['shift']());}};_0x375c58(++_0x491e31);}(_0x991a,0x1c1));var _0xa991=function(_0x32a2b4,_0x5e5ee4){_0x32a2b4=_0x32a2b4-0x0;var _0x27a084=_0x991a[_0x32a2b4];return _0x27a084;};'use strict';var multer=require(_0xa991('0x0'));var util=require(_0xa991('0x1'));var path=require(_0xa991('0x2'));var timeout=require('connect-timeout');var express=require(_0xa991('0x3'));var router=express['Router']();var fs_extra=require(_0xa991('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0xa991('0x5'));var config=require(_0xa991('0x6'));var controller=require(_0xa991('0x7'));router[_0xa991('0x8')]('/',auth['isAuthenticated'](),controller[_0xa991('0x9')]);router['get']('/describe',auth[_0xa991('0xa')](),controller['describe']);router[_0xa991('0x8')]('/:id',auth[_0xa991('0xa')](),controller[_0xa991('0xb')]);router['get']('/:id/contacts',auth[_0xa991('0xa')](),controller[_0xa991('0xc')]);router[_0xa991('0xd')]('/',auth[_0xa991('0xa')](),controller['create']);router[_0xa991('0xd')](_0xa991('0xe'),auth[_0xa991('0xa')](),controller[_0xa991('0xf')]);router[_0xa991('0x10')](_0xa991('0x11'),auth[_0xa991('0xa')](),controller['update']);router[_0xa991('0x12')](_0xa991('0x11'),auth[_0xa991('0xa')](),controller[_0xa991('0x13')]);module[_0xa991('0x14')]=router;
\ No newline at end of file
diff --git a/server/api/cmContact/cmContact.attributes.js b/server/api/cmContact/cmContact.attributes.js
index cde4539..4cba4dd 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 _0x66f4=['STRING','INTEGER','UNSIGNED','DATE','NOW','sequelize','exports'];(function(_0x32f7d7,_0x54231b){var _0x133d09=function(_0x41a7ab){while(--_0x41a7ab){_0x32f7d7['push'](_0x32f7d7['shift']());}};_0x133d09(++_0x54231b);}(_0x66f4,0xb4));var _0x466f=function(_0x171981,_0x3e8305){_0x171981=_0x171981-0x0;var _0x5d5e56=_0x66f4[_0x171981];return _0x5d5e56;};'use strict';var _=require('lodash');var Sequelize=require(_0x466f('0x0'));module[_0x466f('0x1')]={'firstName':{'type':Sequelize[_0x466f('0x2')],'allowNull':![]},'lastName':{'type':Sequelize[_0x466f('0x2')]},'street':{'type':Sequelize[_0x466f('0x2')]},'postalCode':{'type':Sequelize[_0x466f('0x2')]},'city':{'type':Sequelize[_0x466f('0x2')]},'country':{'type':Sequelize[_0x466f('0x2')]},'dateOfBirth':{'type':Sequelize[_0x466f('0x2')]},'description':{'type':Sequelize['TEXT']},'phone':{'type':Sequelize[_0x466f('0x2')]},'mobile':{'type':Sequelize[_0x466f('0x2')]},'fax':{'type':Sequelize[_0x466f('0x2')]},'email':{'type':Sequelize[_0x466f('0x2')]},'url':{'type':Sequelize['STRING']},'facebook':{'type':Sequelize[_0x466f('0x2')]},'fb_data':{'type':Sequelize[_0x466f('0x2')]},'twitter':{'type':Sequelize[_0x466f('0x2')]},'skype':{'type':Sequelize[_0x466f('0x2')]},'teams':{'type':Sequelize[_0x466f('0x2')]},'viber':{'type':Sequelize[_0x466f('0x2')]},'line':{'type':Sequelize['STRING']},'wechat':{'type':Sequelize[_0x466f('0x2')]},'telegram':{'type':Sequelize[_0x466f('0x2')]},'UserId':{'type':Sequelize['INTEGER']},'AdditionalPhones':{'type':Sequelize[_0x466f('0x2')]},'priority':{'type':Sequelize[_0x466f('0x3')](0x2)[_0x466f('0x4')],'defaultValue':0x2,'validate':{'min':0x0,'max':0x4}},'scheduledat':{'type':Sequelize[_0x466f('0x5')],'defaultValue':Sequelize[_0x466f('0x6')]}};
\ No newline at end of file
+var _0xf698=['STRING','INTEGER','UNSIGNED','NOW','lodash','sequelize'];(function(_0xa6b91b,_0x2139b4){var _0x2987d7=function(_0x188983){while(--_0x188983){_0xa6b91b['push'](_0xa6b91b['shift']());}};_0x2987d7(++_0x2139b4);}(_0xf698,0x1de));var _0x8f69=function(_0x47e549,_0x2e53d6){_0x47e549=_0x47e549-0x0;var _0x251374=_0xf698[_0x47e549];return _0x251374;};'use strict';var _=require(_0x8f69('0x0'));var Sequelize=require(_0x8f69('0x1'));module['exports']={'firstName':{'type':Sequelize[_0x8f69('0x2')],'allowNull':![]},'lastName':{'type':Sequelize[_0x8f69('0x2')]},'street':{'type':Sequelize['STRING']},'postalCode':{'type':Sequelize[_0x8f69('0x2')]},'city':{'type':Sequelize[_0x8f69('0x2')]},'country':{'type':Sequelize[_0x8f69('0x2')]},'dateOfBirth':{'type':Sequelize[_0x8f69('0x2')]},'description':{'type':Sequelize['TEXT']},'phone':{'type':Sequelize[_0x8f69('0x2')]},'mobile':{'type':Sequelize['STRING']},'fax':{'type':Sequelize['STRING']},'email':{'type':Sequelize['STRING']},'url':{'type':Sequelize[_0x8f69('0x2')]},'facebook':{'type':Sequelize[_0x8f69('0x2')]},'fb_data':{'type':Sequelize[_0x8f69('0x2')]},'twitter':{'type':Sequelize[_0x8f69('0x2')]},'skype':{'type':Sequelize[_0x8f69('0x2')]},'teams':{'type':Sequelize[_0x8f69('0x2')]},'viber':{'type':Sequelize[_0x8f69('0x2')]},'line':{'type':Sequelize[_0x8f69('0x2')]},'wechat':{'type':Sequelize[_0x8f69('0x2')]},'telegram':{'type':Sequelize[_0x8f69('0x2')]},'UserId':{'type':Sequelize[_0x8f69('0x3')]},'AdditionalPhones':{'type':Sequelize[_0x8f69('0x2')]},'priority':{'type':Sequelize['INTEGER'](0x2)[_0x8f69('0x4')],'defaultValue':0x2,'validate':{'min':0x0,'max':0x4}},'scheduledat':{'type':Sequelize['DATE'],'defaultValue':Sequelize[_0x8f69('0x5')]}};
\ No newline at end of file
diff --git a/server/api/cmContact/cmContact.controller.js b/server/api/cmContact/cmContact.controller.js
index b66d61e..f16279a 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 _0xb58b=['TagIds','Tags','rows','catch','params','describe','tags','columnName','displayName','findAll','alias','values','merge','body','get','mergeWith','info','[CmContact][merge]\x20to\x20%s\x20from\x20%s','CmHopper','[CmContact][merge][destroy][CmHopper],\x20%s','[CmContact][merge][destroy][CmHopperBlack],\x20%s','ChatInteraction','ChatMessage','ChatOfflineMessage','MailInteraction','MailMessage','SmsInteraction','FaxInteraction','OpenchannelMessage','CmContactHasItem','CmHopperFinal','CmHopperHistory','ReportAgentPreview','ChatQueueReport','MailQueueReport','OpenchannelQueueReport','SmsQueueReport','JscriptySessionReport','WhatsappInteraction','WhatsappMessage','create','additionalPhones','bulkCreate','each','duplicates','$or','findOrCreate','show','Phones','ContactItemType','ItemType','literal','`Phones.ItemType`.OrderBy','log','$and','format','cf_%d','omit','table','setFields','id\x20=\x20?','toParam','text','phone','getTags','setTags','ids','setAdditionalPhones','all','items','item_types','isNil','ItemTypeId','description','PHONE','CmHopperAdditionalPhone','item','OrderBy','CmHopperId','ItemType.OrderBy','getAdditionalPhones','`ItemType`.OrderBy','duplicateAdditionalPhones','fromContactId','CmContactId','rescheduleAdditionalPhones','hopperId','getHoppers','ContactId','options','includeAll','include','getHopperHistories','rawAttributes','getHopperFinals','getJscriptySessions','No\x20ListId\x20specified','No\x20association\x20keys\x20specified!','No\x20association\x20values\x20specified!','socket_timestamp','binding_keys','Incorrect\x20binding\x20parameters\x20passed!','zipObject','firstName','join','root','file','chmodSync','child_process','fork','../../components/import/cm/csv','binding_values','File\x20uploaded\x20correctly!','createReadStream','parse','meta','import','No\x20phone\x20column\x20specified','binding','No\x20firstName\x20column\x20specified','Unable\x20to\x20synchronize\x20socket,\x20no\x20timestamp\x20passed','stringify','start\x20child\x20process\x20correctly!','exit','error\x20child\x20process','pid','importUpdates','../../components/import/cm/csvUpdates','message','getJourney','mail','chat','sms','fax','whatsapp','voice','channel','toLowerCase','Invalid\x20channel','range','isValid','Invalid\x20date\x20for\x20range\x20from\x20filter','Invalid\x20date\x20for\x20range\x20to\x20filter','destination','callerid','starttime','endtime','note','createdAt','userDisposition','userSecondDisposition','userThirdDisposition','UserId','fullname','startCase','Website','closed','secondDisposition','thirdDisposition','Account','Owner','browserName','customerIp','osName','ratingMessage','ratingType','ratingValue','referer','substatus','openchannel','threadId','Interaction','findAndCountAll','flatten','sortBy','reverse','rimraf','zip-dir','fast-json-patch','moment','bluebird','util','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','redis','defaults','localhost','socket.io-emitter','./cmContact.socket','register','end','offset','limit','undefined','count','status','set','Content-Range','json','save','update','then','destroy','sendStatus','error','stack','name','send','index','CmContact','keys','length','startsWith','cf_','push','CmCustomField','findOne','fieldType','filters','intersection','query','attributes','model','fields','nolimit','order','sort','pick','field','color','from','select','cm_contacts','cm_user_has_contacts','left_join','cm_contact_has_tags','ct.CmContactId\x20=\x20c.id','tools_tags','t.id\x20=\x20ct.TagId','where','c.deletedAt\x20IS\x20NULL','expr','search','sqlOperator','conditions','find','Tag','split','forEach','union','and','value','dateOfBirth','datetime','castTo','DATE','buildExpression','type','start','map','hasOwnProperty','Contact','isEmpty','ListId','concat','CONCAT_WS(\x27\x20\x27,\x20c.firstName,\x20c.lastName,\x20c.email)\x20LIKE\x20?','\x20=\x20?','tag','isArray','CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','filter','replace','MATCH\x20(c.firstName,\x20c.lastName,\x20c.phone,\x20c.mobile,\x20c.fax,\x20c.email)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','isNumeric','c.id\x20LIKE\x20?','c.phone\x20LIKE\x20?','c.fax\x20LIKE\x20?','c.email\x20LIKE\x20?','c.firstName\x20LIKE\x20?','group','c.id','SELECT','clone','DESC','having','t.id\x20IN\x20?','user','role','agent','some','User','getLists','c.ListId\x20IS\x20NULL','c.ListId\x20IN\x20?','sequelize','toString','keyBy','c.firstName','c.phone','c.fax','c.email','c.ListId','c.createdAt','c.deletedAt','c.CompanyId'];(function(_0x4774ab,_0x192e64){var _0x208d54=function(_0x2fcb6e){while(--_0x2fcb6e){_0x4774ab['push'](_0x4774ab['shift']());}};_0x208d54(++_0x192e64);}(_0xb58b,0x1f1));var _0xbb58=function(_0x536b3e,_0x2c63c9){_0x536b3e=_0x536b3e-0x0;var _0xd725c5=_0xb58b[_0x536b3e];return _0xd725c5;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xbb58('0x0'));var zipdir=require(_0xbb58('0x1'));var jsonpatch=require(_0xbb58('0x2'));var rp=require('request-promise');var moment=require(_0xbb58('0x3'));var BPromise=require(_0xbb58('0x4'));var Mustache=require('mustache');var util=require(_0xbb58('0x5'));var path=require('path');var sox=require(_0xbb58('0x6'));var csv=require(_0xbb58('0x7'));var ejs=require(_0xbb58('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xbb58('0x9'));var squel=require(_0xbb58('0xa'));var crypto=require(_0xbb58('0xb'));var jsforce=require(_0xbb58('0xc'));var deskjs=require(_0xbb58('0xd'));var toCsv=require(_0xbb58('0x7'));var querystring=require(_0xbb58('0xe'));var Papa=require(_0xbb58('0xf'));var Redis=require(_0xbb58('0x10'));var authService=require(_0xbb58('0x11'));var qs=require(_0xbb58('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xbb58('0x13'));var logger=require('../../config/logger')(_0xbb58('0x14'));var utils=require(_0xbb58('0x15'));var config=require(_0xbb58('0x16'));var licenseUtil=require(_0xbb58('0x17'));var db=require('../../mysqldb')['db'];config[_0xbb58('0x18')]=_[_0xbb58('0x19')](config['redis'],{'host':_0xbb58('0x1a'),'port':0x18eb});var socket=require(_0xbb58('0x1b'))(new Redis(config[_0xbb58('0x18')]));require(_0xbb58('0x1c'))[_0xbb58('0x1d')](socket);function respondWithStatusCode(_0x58245f,_0x110944){_0x110944=_0x110944||0xcc;return function(_0x23fd15){if(_0x23fd15){return _0x58245f['sendStatus'](_0x110944);}return _0x58245f['status'](_0x110944)[_0xbb58('0x1e')]();};}function respondWithResult(_0x445b1f,_0x38d69a){_0x38d69a=_0x38d69a||0xc8;return function(_0x47c927){if(_0x47c927){return _0x445b1f['status'](_0x38d69a)['json'](_0x47c927);}};}function respondWithFilteredResult(_0x55156e,_0x28637b){return function(_0x3134ea){if(_0x3134ea){var _0x48f3e0=typeof _0x28637b[_0xbb58('0x1f')]==='undefined'&&typeof _0x28637b[_0xbb58('0x20')]===_0xbb58('0x21');var _0x3c33d9=_0x3134ea[_0xbb58('0x22')];var _0x3d961a=_0x48f3e0?0x0:_0x28637b[_0xbb58('0x1f')];var _0x32d694=_0x48f3e0?_0x3134ea['count']:_0x28637b[_0xbb58('0x1f')]+_0x28637b[_0xbb58('0x20')];var _0x3e64fe;if(_0x32d694>=_0x3c33d9){_0x32d694=_0x3c33d9;_0x3e64fe=0xc8;}else{_0x3e64fe=0xce;}_0x55156e[_0xbb58('0x23')](_0x3e64fe);return _0x55156e[_0xbb58('0x24')](_0xbb58('0x25'),_0x3d961a+'-'+_0x32d694+'/'+_0x3c33d9)[_0xbb58('0x26')](_0x3134ea);}return null;};}function patchUpdates(_0x350be7){return function(_0x27bbec){try{jsonpatch['apply'](_0x27bbec,_0x350be7,!![]);}catch(_0x27806d){return BPromise['reject'](_0x27806d);}return _0x27bbec[_0xbb58('0x27')]();};}function saveUpdates(_0x287822,_0x152f22){return function(_0x3e215c){if(_0x3e215c){return _0x3e215c[_0xbb58('0x28')](_0x287822)[_0xbb58('0x29')](function(_0x2d556a){return _0x2d556a;});}return null;};}function removeEntity(_0x15e4c5,_0x4e0303){return function(_0x283dff){if(_0x283dff){return _0x283dff[_0xbb58('0x2a')]()[_0xbb58('0x29')](function(){_0x15e4c5[_0xbb58('0x23')](0xcc)[_0xbb58('0x1e')]();});}};}function handleEntityNotFound(_0x521d0c,_0x3608dc){return function(_0x2ce7c3){if(!_0x2ce7c3){_0x521d0c[_0xbb58('0x2b')](0x194);}return _0x2ce7c3;};}function handleError(_0x2d5b39,_0xf6687e){_0xf6687e=_0xf6687e||0x1f4;return function(_0x28b3a3){logger[_0xbb58('0x2c')](_0x28b3a3[_0xbb58('0x2d')]);if(_0x28b3a3[_0xbb58('0x2e')]){delete _0x28b3a3['name'];}_0x2d5b39[_0xbb58('0x23')](_0xf6687e)[_0xbb58('0x2f')](_0x28b3a3);};}exports[_0xbb58('0x30')]=function(_0x3c9cee,_0x3304b9){var _0x9d379f={},_0x1ba526={},_0x643e0e={'count':0x0,'rows':[]};return db[_0xbb58('0x31')]['describe']()[_0xbb58('0x29')](function(_0x22329b){var _0x3edc34=[];for(var _0x3a1e46=0x0;_0x3a1e46
','Attachments','Title','Data','gmail','imap.gmail.com','yahoo','imap.mail.yahoo.com','hotmail','outlook.office365.com','127.0.0.1','randomstring','path','util','email','../../../config/environment','head','address','anonymous','generate','value','name','split','length','slice','join','Anonymous','pop','isEmpty','@xcally.com','html','test','includes','\x20[Attachment:\x20','\x20]','body','textAsHtml'];(function(_0x6eba65,_0x1c4afa){var _0x4fe862=function(_0x51cd30){while(--_0x51cd30){_0x6eba65['push'](_0x6eba65['shift']());}};_0x4fe862(++_0x1c4afa);}(_0x1a85,0x178));var _0x51a8=function(_0x52fd3d,_0x3af718){_0x52fd3d=_0x52fd3d-0x0;var _0x49b06d=_0x1a85[_0x52fd3d];return _0x49b06d;};'use strict';var _=require('lodash');var moment=require('moment');var random=require(_0x51a8('0x0'));var fs=require('fs');var path=require(_0x51a8('0x1'));var util=require(_0x51a8('0x2'));var tnef=require('node-tnef');var logger=require('../../../config/logger')(_0x51a8('0x3'));var config=require(_0x51a8('0x4'));function getAddress(_0x99e371){var _0x48a21b=_[_0x51a8('0x5')](_0x99e371['value']);return _0x48a21b&&_0x48a21b[_0x51a8('0x6')]?_0x48a21b['address']:_0x51a8('0x7')+random[_0x51a8('0x8')](0x6)+'@xcally.com';}function getFirstName(_0x228c64){var _0x513685=_['head'](_0x228c64[_0x51a8('0x9')]);if(_0x513685&&_0x513685[_0x51a8('0xa')]){var _0x1a476d=_0x513685[_0x51a8('0xa')][_0x51a8('0xb')](/\s+/);return _0x1a476d[_0x51a8('0xc')]?_0x1a476d[_0x51a8('0xd')](0x0,-0x1)[_0x51a8('0xe')]('\x20'):_0x513685[_0x51a8('0xa')];}return _0x51a8('0xf');}function getLastName(_0xc7c203){var _0xc46d7=_[_0x51a8('0x5')](_0xc7c203[_0x51a8('0x9')]);if(_0xc46d7&&_0xc46d7[_0x51a8('0xa')]){var _0x2e1629=_0xc46d7[_0x51a8('0xa')]['split'](/\s+/);return _0x2e1629[_0x51a8('0xc')]>0x1?_0x2e1629[_0x51a8('0x10')]():'';}return'';}function getMails(_0xaec066,_0x50d992){var _0xf4eb6e='';for(var _0x547d40=0x0;_0x547d40<_0x50d992[_0x51a8('0x9')][_0x51a8('0xc')];_0x547d40+=0x1){if(_0x50d992[_0x51a8('0x9')][_0x547d40][_0x51a8('0x6')]!==_0xaec066){if(!_[_0x51a8('0x11')](_0xf4eb6e)){_0xf4eb6e+=',';}_0xf4eb6e+=_0x50d992[_0x51a8('0x9')][_0x547d40][_0x51a8('0xa')]||_0x50d992['value'][_0x547d40][_0x51a8('0x6')]||'';_0xf4eb6e+='\x20<';_0xf4eb6e+=_0x50d992[_0x51a8('0x9')][_0x547d40][_0x51a8('0x6')]?_0x50d992[_0x51a8('0x9')][_0x547d40][_0x51a8('0x6')]:_0x51a8('0x7')+random['generate'](0x6)+_0x51a8('0x12');_0xf4eb6e+='>';}}return _0xf4eb6e;}function parseEmail(_0x3b7e7e,_0x2217ce,_0x2f2681){if(_0x2217ce[_0x51a8('0x13')]){var _0x3bc044=/