From 91058c28792f2e4e3ce5b2c549cdc652f4bd103d Mon Sep 17 00:00:00 2001
From: support
Date: Tue, 17 Jan 2023 17:34:13 +0000
Subject: [PATCH] Built motion from commit c0cdc9d8.|2.6.28
---
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 +-
.../authActiveDirectory.controller.js | 2 +-
server/api/authActiveDirectory/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.events.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 +-
.../chatWebsite/helpers/wildcard-expressions.js | 2 +-
server/api/chatWebsite/index.js | 2 +-
server/api/client-side-logs.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.oauth.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/mailInteractionHasTag/index.js | 2 +-
.../mailInteractionHasTag.controller.js | 2 +-
.../mailInteractionHasTag/mailInteractionHasTag.js | 2 +-
.../mailInteractionHasTag.model.js | 2 +-
server/api/mailMessage/index.js | 2 +-
server/api/mailMessage/mailMessage.attributes.js | 2 +-
server/api/mailMessage/mailMessage.controller.js | 2 +-
server/api/mailMessage/mailMessage.events.js | 2 +-
server/api/mailMessage/mailMessage.model.js | 2 +-
server/api/mailMessage/mailMessage.rpc.js | 2 +-
server/api/mailMessage/mailMessage.socket.js | 2 +-
server/api/mailQueue/index.js | 2 +-
server/api/mailQueue/mailQueue.attributes.js | 2 +-
server/api/mailQueue/mailQueue.controller.js | 2 +-
server/api/mailQueue/mailQueue.events.js | 2 +-
server/api/mailQueue/mailQueue.model.js | 2 +-
server/api/mailQueue/mailQueue.rpc.js | 2 +-
server/api/mailQueue/mailQueue.socket.js | 2 +-
server/api/mailQueueReport/index.js | 2 +-
.../mailQueueReport/mailQueueReport.attributes.js | 2 +-
.../mailQueueReport/mailQueueReport.controller.js | 2 +-
.../api/mailQueueReport/mailQueueReport.model.js | 2 +-
server/api/mailQueueReport/mailQueueReport.rpc.js | 2 +-
server/api/mailServerIn/index.js | 2 +-
server/api/mailServerIn/mailServerIn.attributes.js | 2 +-
server/api/mailServerIn/mailServerIn.model.js | 2 +-
server/api/mailServerIn/mailServerIn.rpc.js | 2 +-
server/api/mailServerOut/index.js | 2 +-
.../api/mailServerOut/mailServerOut.attributes.js | 2 +-
.../api/mailServerOut/mailServerOut.controller.js | 2 +-
server/api/mailServerOut/mailServerOut.model.js | 2 +-
server/api/mailServerOut/mailServerOut.rpc.js | 2 +-
server/api/mailSubstatus/index.js | 2 +-
.../api/mailSubstatus/mailSubstatus.attributes.js | 2 +-
.../api/mailSubstatus/mailSubstatus.controller.js | 2 +-
server/api/mailSubstatus/mailSubstatus.events.js | 2 +-
server/api/mailSubstatus/mailSubstatus.model.js | 2 +-
server/api/mailSubstatus/mailSubstatus.rpc.js | 2 +-
server/api/mailTransferReport/index.js | 2 +-
.../mailTransferReport.attributes.js | 2 +-
.../mailTransferReport.controller.js | 2 +-
.../mailTransferReport/mailTransferReport.model.js | 2 +-
.../mailTransferReport/mailTransferReport.rpc.js | 2 +-
server/api/memberReport/index.js | 2 +-
server/api/memberReport/memberReport.attributes.js | 2 +-
server/api/memberReport/memberReport.controller.js | 2 +-
server/api/memberReport/memberReport.model.js | 2 +-
server/api/memberReport/memberReport.rpc.js | 2 +-
server/api/migration/index.js | 2 +-
server/api/migration/migration.attributes.js | 2 +-
server/api/migration/migration.controller.js | 2 +-
server/api/migration/migration.model.js | 2 +-
server/api/migration/migration.rpc.js | 2 +-
server/api/network/index.js | 2 +-
server/api/network/network.attributes.js | 2 +-
server/api/network/network.controller.js | 2 +-
server/api/network/network.model.js | 2 +-
server/api/network/network.rpc.js | 2 +-
server/api/openchannelAccount/index.js | 2 +-
.../openchannelAccount.attributes.js | 2 +-
.../openchannelAccount.controller.js | 2 +-
.../openchannelAccount.events.js | 2 +-
.../openchannelAccount/openchannelAccount.model.js | 2 +-
.../openchannelAccount/openchannelAccount.rpc.js | 2 +-
.../openchannelAccount.socket.js | 2 +-
server/api/openchannelApplication/index.js | 2 +-
.../openchannelApplication.attributes.js | 2 +-
.../openchannelApplication.controller.js | 2 +-
.../openchannelApplication.model.js | 2 +-
.../openchannelApplication.rpc.js | 2 +-
server/api/openchannelInteraction/index.js | 2 +-
.../openchannelInteraction.attributes.js | 2 +-
.../openchannelInteraction.controller.js | 2 +-
.../openchannelInteraction.events.js | 2 +-
.../openchannelInteraction.model.js | 2 +-
.../openchannelInteraction.rpc.js | 2 +-
.../openchannelInteraction.socket.js | 2 +-
server/api/openchannelMessage/index.js | 2 +-
.../openchannelMessage.attributes.js | 2 +-
.../openchannelMessage.controller.js | 2 +-
.../openchannelMessage.events.js | 2 +-
.../openchannelMessage/openchannelMessage.model.js | 2 +-
.../openchannelMessage/openchannelMessage.rpc.js | 2 +-
.../openchannelMessage.socket.js | 2 +-
server/api/openchannelQueue/index.js | 2 +-
.../openchannelQueue.attributes.js | 2 +-
.../openchannelQueue.controller.js | 2 +-
.../openchannelQueue/openchannelQueue.events.js | 2 +-
.../api/openchannelQueue/openchannelQueue.model.js | 2 +-
.../api/openchannelQueue/openchannelQueue.rpc.js | 2 +-
.../openchannelQueue/openchannelQueue.socket.js | 2 +-
server/api/openchannelQueueReport/index.js | 2 +-
.../openchannelQueueReport.attributes.js | 2 +-
.../openchannelQueueReport.controller.js | 2 +-
.../openchannelQueueReport.model.js | 2 +-
.../openchannelQueueReport.rpc.js | 2 +-
server/api/openchannelTransferReport/index.js | 2 +-
.../openchannelTransferReport.attributes.js | 2 +-
.../openchannelTransferReport.controller.js | 2 +-
.../openchannelTransferReport.model.js | 2 +-
.../openchannelTransferReport.rpc.js | 2 +-
server/api/pause/index.js | 2 +-
server/api/pause/pause.attributes.js | 2 +-
server/api/pause/pause.controller.js | 2 +-
server/api/pause/pause.model.js | 2 +-
server/api/pause/pause.rpc.js | 2 +-
server/api/plugin/index.js | 2 +-
server/api/plugin/plugin.attributes.js | 2 +-
server/api/plugin/plugin.controller.js | 2 +-
server/api/plugin/plugin.events.js | 2 +-
server/api/plugin/plugin.model.js | 2 +-
server/api/plugin/plugin.rpc.js | 2 +-
server/api/plugin/plugin.socket.js | 2 +-
server/api/pm2/index.js | 2 +-
server/api/pm2/pm2.controller.js | 2 +-
server/api/realtime/index.js | 2 +-
server/api/realtime/realtime.controller.js | 2 +-
server/api/reportAgentPreview/index.js | 2 +-
.../reportAgentPreview.attributes.js | 2 +-
.../reportAgentPreview/reportAgentPreview.model.js | 2 +-
.../reportAgentPreview/reportAgentPreview.rpc.js | 2 +-
server/api/rpc/index.js | 2 +-
server/api/rpc/rpc.controller.js | 2 +-
server/api/schedule/index.js | 2 +-
server/api/schedule/schedule.attributes.js | 2 +-
server/api/schedule/schedule.controller.js | 2 +-
server/api/schedule/schedule.model.js | 2 +-
server/api/schedule/schedule.rpc.js | 2 +-
server/api/screenRecording/index.js | 2 +-
.../screenRecording/screenRecording.attributes.js | 2 +-
.../screenRecording/screenRecording.controller.js | 2 +-
.../api/screenRecording/screenRecording.model.js | 2 +-
server/api/screenRecording/screenRecording.rpc.js | 2 +-
server/api/setting/index.js | 2 +-
server/api/setting/setting.attributes.js | 2 +-
server/api/setting/setting.controller.js | 2 +-
server/api/setting/setting.model.js | 2 +-
server/api/setting/setting.rpc.js | 2 +-
server/api/smsAccount/index.js | 2 +-
server/api/smsAccount/smsAccount.attributes.js | 2 +-
server/api/smsAccount/smsAccount.controller.js | 2 +-
server/api/smsAccount/smsAccount.events.js | 2 +-
server/api/smsAccount/smsAccount.model.js | 2 +-
server/api/smsAccount/smsAccount.rpc.js | 2 +-
server/api/smsAccount/smsAccount.socket.js | 2 +-
server/api/smsApplication/index.js | 2 +-
.../smsApplication/smsApplication.attributes.js | 2 +-
.../smsApplication/smsApplication.controller.js | 2 +-
server/api/smsApplication/smsApplication.model.js | 2 +-
server/api/smsApplication/smsApplication.rpc.js | 2 +-
server/api/smsInteraction/index.js | 2 +-
.../smsInteraction/smsInteraction.attributes.js | 2 +-
.../smsInteraction/smsInteraction.controller.js | 2 +-
server/api/smsInteraction/smsInteraction.events.js | 2 +-
server/api/smsInteraction/smsInteraction.model.js | 2 +-
server/api/smsInteraction/smsInteraction.rpc.js | 2 +-
server/api/smsInteraction/smsInteraction.socket.js | 2 +-
server/api/smsMessage/index.js | 2 +-
server/api/smsMessage/smsMessage.attributes.js | 2 +-
server/api/smsMessage/smsMessage.controller.js | 2 +-
server/api/smsMessage/smsMessage.events.js | 2 +-
server/api/smsMessage/smsMessage.model.js | 2 +-
server/api/smsMessage/smsMessage.rpc.js | 2 +-
server/api/smsMessage/smsMessage.socket.js | 2 +-
server/api/smsQueue/index.js | 2 +-
server/api/smsQueue/smsQueue.attributes.js | 2 +-
server/api/smsQueue/smsQueue.controller.js | 2 +-
server/api/smsQueue/smsQueue.events.js | 2 +-
server/api/smsQueue/smsQueue.model.js | 2 +-
server/api/smsQueue/smsQueue.rpc.js | 2 +-
server/api/smsQueue/smsQueue.socket.js | 2 +-
server/api/smsQueueReport/index.js | 2 +-
.../smsQueueReport/smsQueueReport.attributes.js | 2 +-
.../smsQueueReport/smsQueueReport.controller.js | 2 +-
server/api/smsQueueReport/smsQueueReport.model.js | 2 +-
server/api/smsQueueReport/smsQueueReport.rpc.js | 2 +-
server/api/smsTransferReport/index.js | 2 +-
.../smsTransferReport.attributes.js | 2 +-
.../smsTransferReport.controller.js | 2 +-
.../smsTransferReport/smsTransferReport.model.js | 2 +-
.../api/smsTransferReport/smsTransferReport.rpc.js | 2 +-
server/api/sound/index.js | 2 +-
server/api/sound/sound.attributes.js | 2 +-
server/api/sound/sound.controller.js | 2 +-
server/api/sound/sound.model.js | 2 +-
server/api/sound/sound.rpc.js | 2 +-
server/api/squareMessage/index.js | 2 +-
.../api/squareMessage/squareMessage.attributes.js | 2 +-
.../api/squareMessage/squareMessage.controller.js | 2 +-
server/api/squareMessage/squareMessage.model.js | 2 +-
server/api/squareMessage/squareMessage.rpc.js | 2 +-
server/api/squareOdbc/index.js | 2 +-
server/api/squareOdbc/squareOdbc.attributes.js | 2 +-
server/api/squareOdbc/squareOdbc.controller.js | 2 +-
server/api/squareOdbc/squareOdbc.model.js | 2 +-
server/api/squareOdbc/squareOdbc.rpc.js | 2 +-
server/api/squareProject/index.js | 2 +-
.../api/squareProject/squareProject.attributes.js | 2 +-
.../api/squareProject/squareProject.controller.js | 2 +-
server/api/squareProject/squareProject.events.js | 2 +-
server/api/squareProject/squareProject.model.js | 2 +-
server/api/squareProject/squareProject.rpc.js | 2 +-
server/api/squareProject/squareProject.socket.js | 2 +-
server/api/squareRecording/index.js | 2 +-
.../squareRecording/squareRecording.attributes.js | 2 +-
.../squareRecording/squareRecording.controller.js | 2 +-
.../api/squareRecording/squareRecording.model.js | 2 +-
server/api/squareRecording/squareRecording.rpc.js | 2 +-
server/api/squareReport/index.js | 2 +-
server/api/squareReport/squareReport.attributes.js | 2 +-
server/api/squareReport/squareReport.controller.js | 2 +-
server/api/squareReport/squareReport.model.js | 2 +-
server/api/squareReport/squareReport.rpc.js | 2 +-
server/api/squareReportDetail/index.js | 2 +-
.../squareReportDetail.attributes.js | 2 +-
.../squareReportDetail.controller.js | 2 +-
.../squareReportDetail/squareReportDetail.model.js | 2 +-
.../squareReportDetail/squareReportDetail.rpc.js | 2 +-
server/api/system/index.js | 2 +-
server/api/system/system.controller.js | 2 +-
server/api/tag/index.js | 2 +-
server/api/tag/tag.attributes.js | 2 +-
server/api/tag/tag.controller.js | 2 +-
server/api/tag/tag.model.js | 2 +-
server/api/tag/tag.rpc.js | 2 +-
server/api/team/index.js | 2 +-
server/api/team/team.attributes.js | 2 +-
server/api/team/team.controller.js | 2 +-
server/api/team/team.events.js | 2 +-
server/api/team/team.model.js | 2 +-
server/api/team/team.rpc.js | 2 +-
server/api/team/team.socket.js | 2 +-
.../teamVoicePrefix/teamVoicePrefix.attributes.js | 2 +-
.../api/teamVoicePrefix/teamVoicePrefix.model.js | 2 +-
server/api/teamVoiceQueue/index.js | 2 +-
.../teamVoiceQueue/teamVoiceQueue.attributes.js | 2 +-
server/api/teamVoiceQueue/teamVoiceQueue.model.js | 2 +-
server/api/teamVoiceQueue/teamVoiceQueue.rpc.js | 2 +-
server/api/template/index.js | 2 +-
server/api/template/template.attributes.js | 2 +-
server/api/template/template.controller.js | 2 +-
server/api/template/template.model.js | 2 +-
server/api/template/template.rpc.js | 2 +-
server/api/trigger/index.js | 2 +-
server/api/trigger/trigger.attributes.js | 2 +-
server/api/trigger/trigger.controller.js | 2 +-
server/api/trigger/trigger.model.js | 2 +-
server/api/trigger/trigger.rpc.js | 2 +-
server/api/trunk/index.js | 2 +-
server/api/trunk/trunk.attributes.js | 2 +-
server/api/trunk/trunk.controller.js | 2 +-
server/api/trunk/trunk.model.js | 2 +-
server/api/trunk/trunk.rpc.js | 2 +-
server/api/user-setting/index.js | 2 +-
server/api/user-setting/user-setting.attributes.js | 2 +-
server/api/user-setting/user-setting.controller.js | 2 +-
server/api/user-setting/user-setting.events.js | 2 +-
server/api/user-setting/user-setting.model.js | 2 +-
server/api/user-setting/user-setting.socket.js | 2 +-
server/api/user/index.js | 2 +-
server/api/user/user.attributes.js | 2 +-
server/api/user/user.controller.js | 2 +-
server/api/user/user.events.js | 2 +-
server/api/user/user.model.js | 2 +-
server/api/user/user.rpc.js | 2 +-
server/api/user/user.socket.js | 2 +-
server/api/userChatQueue/index.js | 2 +-
.../api/userChatQueue/userChatQueue.attributes.js | 2 +-
server/api/userChatQueue/userChatQueue.model.js | 2 +-
server/api/userChatQueue/userChatQueue.rpc.js | 2 +-
server/api/userFaxQueue/index.js | 2 +-
server/api/userFaxQueue/userFaxQueue.attributes.js | 2 +-
server/api/userFaxQueue/userFaxQueue.model.js | 2 +-
server/api/userFaxQueue/userFaxQueue.rpc.js | 2 +-
server/api/userMailQueue/index.js | 2 +-
.../api/userMailQueue/userMailQueue.attributes.js | 2 +-
server/api/userMailQueue/userMailQueue.model.js | 2 +-
server/api/userMailQueue/userMailQueue.rpc.js | 2 +-
server/api/userNotification/index.js | 2 +-
.../userNotification.attributes.js | 2 +-
.../userNotification.controller.js | 2 +-
.../userNotification/userNotification.events.js | 2 +-
.../api/userNotification/userNotification.model.js | 2 +-
.../api/userNotification/userNotification.rpc.js | 2 +-
.../userNotification/userNotification.socket.js | 2 +-
server/api/userOpenchannelQueue/index.js | 2 +-
.../userOpenchannelQueue.attributes.js | 2 +-
.../userOpenchannelQueue.model.js | 2 +-
.../userOpenchannelQueue.rpc.js | 2 +-
server/api/userProfile/index.js | 2 +-
server/api/userProfile/userProfile.attributes.js | 2 +-
server/api/userProfile/userProfile.controller.js | 2 +-
server/api/userProfile/userProfile.events.js | 2 +-
server/api/userProfile/userProfile.model.js | 2 +-
server/api/userProfile/userProfile.rpc.js | 2 +-
server/api/userProfile/userProfile.socket.js | 2 +-
server/api/userProfileResource/index.js | 2 +-
.../userProfileResource.attributes.js | 2 +-
.../userProfileResource.controller.js | 2 +-
.../userProfileResource.model.js | 2 +-
.../userProfileResource/userProfileResource.rpc.js | 2 +-
server/api/userProfileSection/index.js | 2 +-
.../userProfileSection.attributes.js | 2 +-
.../userProfileSection.controller.js | 2 +-
.../userProfileSection/userProfileSection.model.js | 2 +-
.../userProfileSection/userProfileSection.rpc.js | 2 +-
server/api/userSmsQueue/index.js | 2 +-
server/api/userSmsQueue/userSmsQueue.attributes.js | 2 +-
server/api/userSmsQueue/userSmsQueue.model.js | 2 +-
server/api/userSmsQueue/userSmsQueue.rpc.js | 2 +-
.../userVoicePrefix/userVoicePrefix.attributes.js | 2 +-
.../api/userVoicePrefix/userVoicePrefix.model.js | 2 +-
server/api/userVoiceQueue/index.js | 2 +-
.../userVoiceQueue/userVoiceQueue.attributes.js | 2 +-
server/api/userVoiceQueue/userVoiceQueue.model.js | 2 +-
server/api/userVoiceQueue/userVoiceQueue.rpc.js | 2 +-
server/api/userVoiceQueueRt/index.js | 2 +-
.../userVoiceQueueRt.attributes.js | 2 +-
.../userVoiceQueueRt/userVoiceQueueRt.events.js | 2 +-
.../api/userVoiceQueueRt/userVoiceQueueRt.model.js | 2 +-
.../api/userVoiceQueueRt/userVoiceQueueRt.rpc.js | 2 +-
.../userVoiceQueueRt/userVoiceQueueRt.socket.js | 2 +-
server/api/userWhatsappQueue/index.js | 2 +-
.../userWhatsappQueue.attributes.js | 2 +-
.../userWhatsappQueue/userWhatsappQueue.model.js | 2 +-
.../api/userWhatsappQueue/userWhatsappQueue.rpc.js | 2 +-
server/api/variable/index.js | 2 +-
server/api/variable/variable.attributes.js | 2 +-
server/api/variable/variable.controller.js | 2 +-
server/api/variable/variable.model.js | 2 +-
server/api/variable/variable.rpc.js | 2 +-
server/api/version/index.js | 2 +-
server/api/version/version.controller.js | 2 +-
server/api/voiceAgentReport/index.js | 2 +-
.../voiceAgentReport.attributes.js | 2 +-
.../voiceAgentReport.controller.js | 2 +-
.../api/voiceAgentReport/voiceAgentReport.model.js | 2 +-
.../api/voiceAgentReport/voiceAgentReport.rpc.js | 2 +-
server/api/voiceCallReport/index.js | 2 +-
.../voiceCallReport/voiceCallReport.attributes.js | 2 +-
.../voiceCallReport/voiceCallReport.controller.js | 2 +-
.../api/voiceCallReport/voiceCallReport.model.js | 2 +-
server/api/voiceCallReport/voiceCallReport.rpc.js | 2 +-
server/api/voiceChanSpy/index.js | 2 +-
server/api/voiceChanSpy/voiceChanSpy.attributes.js | 2 +-
server/api/voiceChanSpy/voiceChanSpy.controller.js | 2 +-
server/api/voiceChanSpy/voiceChanSpy.model.js | 2 +-
server/api/voiceChanSpy/voiceChanSpy.rpc.js | 2 +-
server/api/voiceContext/index.js | 2 +-
server/api/voiceContext/voiceContext.attributes.js | 2 +-
server/api/voiceContext/voiceContext.controller.js | 2 +-
server/api/voiceContext/voiceContext.model.js | 2 +-
server/api/voiceContext/voiceContext.rpc.js | 2 +-
server/api/voiceDialReport/index.js | 2 +-
.../voiceDialReport/voiceDialReport.attributes.js | 2 +-
.../voiceDialReport/voiceDialReport.controller.js | 2 +-
.../api/voiceDialReport/voiceDialReport.model.js | 2 +-
server/api/voiceDialReport/voiceDialReport.rpc.js | 2 +-
server/api/voiceExtension/index.js | 2 +-
.../voiceExtension/voiceExtension.attributes.js | 2 +-
.../voiceExtension/voiceExtension.controller.js | 2 +-
server/api/voiceExtension/voiceExtension.events.js | 2 +-
server/api/voiceExtension/voiceExtension.model.js | 2 +-
server/api/voiceExtension/voiceExtension.rpc.js | 2 +-
server/api/voiceExtension/voiceExtension.socket.js | 2 +-
server/api/voiceMail/index.js | 2 +-
server/api/voiceMail/voiceMail.attributes.js | 2 +-
server/api/voiceMail/voiceMail.controller.js | 2 +-
server/api/voiceMail/voiceMail.model.js | 2 +-
server/api/voiceMail/voiceMail.rpc.js | 2 +-
server/api/voiceMailMessage/index.js | 2 +-
.../voiceMailMessage.attributes.js | 2 +-
.../voiceMailMessage.controller.js | 2 +-
.../api/voiceMailMessage/voiceMailMessage.model.js | 2 +-
.../api/voiceMailMessage/voiceMailMessage.rpc.js | 2 +-
server/api/voiceMusicOnHold/index.js | 2 +-
.../voiceMusicOnHold.attributes.js | 2 +-
.../voiceMusicOnHold.controller.js | 2 +-
.../api/voiceMusicOnHold/voiceMusicOnHold.model.js | 2 +-
.../api/voiceMusicOnHold/voiceMusicOnHold.rpc.js | 2 +-
server/api/voicePrefix/index.js | 2 +-
server/api/voicePrefix/voicePrefix.attributes.js | 2 +-
server/api/voicePrefix/voicePrefix.controller.js | 2 +-
server/api/voicePrefix/voicePrefix.events.js | 2 +-
server/api/voicePrefix/voicePrefix.model.js | 2 +-
server/api/voicePrefix/voicePrefix.rpc.js | 2 +-
server/api/voicePrefix/voicePrefix.socket.js | 2 +-
server/api/voiceQueue/index.js | 2 +-
server/api/voiceQueue/voiceQueue.attributes.js | 2 +-
server/api/voiceQueue/voiceQueue.controller.js | 2 +-
server/api/voiceQueue/voiceQueue.events.js | 2 +-
server/api/voiceQueue/voiceQueue.model.js | 2 +-
server/api/voiceQueue/voiceQueue.rpc.js | 2 +-
server/api/voiceQueue/voiceQueue.socket.js | 2 +-
server/api/voiceQueueReport/index.js | 2 +-
.../voiceQueueReport.attributes.js | 2 +-
.../voiceQueueReport.controller.js | 2 +-
.../voiceQueueReport/voiceQueueReport.events.js | 2 +-
.../api/voiceQueueReport/voiceQueueReport.model.js | 2 +-
.../api/voiceQueueReport/voiceQueueReport.rpc.js | 2 +-
.../voiceQueueReport/voiceQueueReport.socket.js | 2 +-
server/api/voiceQueuesLog/index.js | 2 +-
.../voiceQueuesLog/voiceQueuesLog.attributes.js | 2 +-
.../voiceQueuesLog/voiceQueuesLog.controller.js | 2 +-
server/api/voiceQueuesLog/voiceQueuesLog.model.js | 2 +-
server/api/voiceQueuesLog/voiceQueuesLog.rpc.js | 2 +-
server/api/voiceRecording/index.js | 2 +-
.../voiceRecording/voiceRecording.attributes.js | 2 +-
.../voiceRecording/voiceRecording.controller.js | 2 +-
server/api/voiceRecording/voiceRecording.model.js | 2 +-
server/api/voiceRecording/voiceRecording.rpc.js | 2 +-
server/api/voiceTransferReport/index.js | 2 +-
.../voiceTransferReport.attributes.js | 2 +-
.../voiceTransferReport.controller.js | 2 +-
.../voiceTransferReport.model.js | 2 +-
.../voiceTransferReport/voiceTransferReport.rpc.js | 2 +-
server/api/webbar/index.js | 2 +-
server/api/webbar/webbar.controller.js | 2 +-
server/api/whatsappAccount/index.js | 2 +-
.../whatsappAccount/whatsappAccount.attributes.js | 2 +-
.../whatsappAccount/whatsappAccount.controller.js | 2 +-
.../api/whatsappAccount/whatsappAccount.events.js | 2 +-
.../api/whatsappAccount/whatsappAccount.model.js | 2 +-
server/api/whatsappAccount/whatsappAccount.rpc.js | 2 +-
.../api/whatsappAccount/whatsappAccount.socket.js | 2 +-
server/api/whatsappApplication/index.js | 2 +-
.../whatsappApplication.attributes.js | 2 +-
.../whatsappApplication.controller.js | 2 +-
.../whatsappApplication.model.js | 2 +-
.../whatsappApplication/whatsappApplication.rpc.js | 2 +-
server/api/whatsappInteraction/index.js | 2 +-
.../whatsappInteraction.attributes.js | 2 +-
.../whatsappInteraction.controller.js | 2 +-
.../whatsappInteraction.events.js | 2 +-
.../whatsappInteraction.model.js | 2 +-
.../whatsappInteraction/whatsappInteraction.rpc.js | 2 +-
.../whatsappInteraction.socket.js | 2 +-
server/api/whatsappMessage/index.js | 2 +-
.../whatsappMessage/whatsappMessage.attributes.js | 2 +-
.../whatsappMessage/whatsappMessage.controller.js | 2 +-
.../api/whatsappMessage/whatsappMessage.events.js | 2 +-
.../api/whatsappMessage/whatsappMessage.model.js | 2 +-
server/api/whatsappMessage/whatsappMessage.rpc.js | 2 +-
.../api/whatsappMessage/whatsappMessage.socket.js | 2 +-
server/api/whatsappQueue/index.js | 2 +-
.../api/whatsappQueue/whatsappQueue.attributes.js | 2 +-
.../api/whatsappQueue/whatsappQueue.controller.js | 2 +-
server/api/whatsappQueue/whatsappQueue.events.js | 2 +-
server/api/whatsappQueue/whatsappQueue.model.js | 2 +-
server/api/whatsappQueue/whatsappQueue.rpc.js | 2 +-
server/api/whatsappQueue/whatsappQueue.socket.js | 2 +-
server/api/whatsappQueueReport/index.js | 2 +-
.../whatsappQueueReport.attributes.js | 2 +-
.../whatsappQueueReport.controller.js | 2 +-
.../whatsappQueueReport.model.js | 2 +-
.../whatsappQueueReport/whatsappQueueReport.rpc.js | 2 +-
server/api/whatsappTransferReport/index.js | 2 +-
.../whatsappTransferReport.attributes.js | 2 +-
.../whatsappTransferReport.controller.js | 2 +-
.../whatsappTransferReport.model.js | 2 +-
.../whatsappTransferReport.rpc.js | 2 +-
server/app.js | 2 +-
server/components/auth/service.js | 2 +-
server/components/contacts/index.js | 2 +-
server/components/contacts/sql-utils.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/interaction/sql-utils.js | 2 +-
.../components/interaction/update-interaction.js | 2 +-
server/components/interaction/utils.js | 2 +-
server/components/license/service.js | 2 +-
server/components/parsers/advancedSearch.js | 2 +-
server/components/parsers/qs.js | 2 +-
server/components/realtime/agents.js | 2 +-
server/components/realtime/queues.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/cloud-provider.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/api.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/events.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/project.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/index.js | 2 +-
server/services/ami/dialer/models/action.js | 2 +-
server/services/ami/dialer/models/agentComplete.js | 2 +-
server/services/ami/dialer/models/final.js | 2 +-
server/services/ami/dialer/models/hangup.js | 2 +-
server/services/ami/dialer/models/history.js | 2 +-
.../ami/dialer/models/queueCallerAbandon.js | 2 +-
server/services/ami/dialer/utils/hopper.js | 2 +-
server/services/ami/dialer/utils/index.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/voiceQueueSummary.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/realtime/utils.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/interval.js | 2 +-
server/services/ami/rpc/memberReport.js | 2 +-
server/services/ami/rpc/setting.js | 2 +-
server/services/ami/rpc/template.js | 2 +-
server/services/ami/rpc/trigger.js | 2 +-
server/services/ami/rpc/trunk.js | 2 +-
server/services/ami/rpc/user.js | 2 +-
server/services/ami/rpc/voiceAgentReport.js | 2 +-
server/services/ami/rpc/voiceCallReport.js | 2 +-
server/services/ami/rpc/voiceDialReport.js | 2 +-
server/services/ami/rpc/voiceExtension.js | 2 +-
server/services/ami/rpc/voiceQueue.js | 2 +-
server/services/ami/rpc/voiceQueueReport.js | 2 +-
server/services/ami/rpc/voiceQueueRt.js | 2 +-
server/services/ami/rpc/voiceRecording.js | 2 +-
server/services/ami/rpc/voiceTransferReport.js | 2 +-
server/services/ami/server/index.js | 2 +-
server/services/ami/trigger/cmContact/index.js | 2 +-
server/services/ami/trigger/index.js | 2 +-
server/services/ami/trigger/integration/desk.js | 2 +-
.../ami/trigger/integration/dynamics365.js | 2 +-
.../services/ami/trigger/integration/freshdesk.js | 2 +-
.../services/ami/trigger/integration/freshsales.js | 2 +-
server/services/ami/trigger/integration/index.js | 2 +-
.../services/ami/trigger/integration/salesforce.js | 2 +-
.../services/ami/trigger/integration/servicenow.js | 2 +-
.../services/ami/trigger/integration/sugarcrm.js | 2 +-
server/services/ami/trigger/integration/util.js | 2 +-
server/services/ami/trigger/integration/vtiger.js | 2 +-
server/services/ami/trigger/integration/zendesk.js | 2 +-
server/services/ami/trigger/integration/zoho.js | 2 +-
server/services/ami/trigger/script/index.js | 2 +-
server/services/ami/trigger/urlforward/index.js | 2 +-
server/services/email/client.js | 2 +-
server/services/email/index.js | 2 +-
server/services/email/lib/email.js | 2 +-
server/services/email/lib/imap.js | 2 +-
server/services/email/lib/smtp.js | 2 +-
server/services/email/lib/utils.js | 2 +-
server/services/email/model/mailAccount.js | 2 +-
server/services/email/realtime/index.js | 2 +-
server/services/email/rpc/mailAccount.js | 2 +-
server/services/email/rpc/setting.js | 2 +-
server/services/email/server/index.js | 2 +-
server/services/express/index.js | 2 +-
server/services/routing/client.js | 2 +-
server/services/routing/index.js | 2 +-
server/services/routing/lib/rule-engine.js | 2 +-
server/services/routing/mailRpc/index.js | 2 +-
server/services/routing/model/agent.js | 2 +-
server/services/routing/model/chatQueue.js | 2 +-
server/services/routing/model/faxQueue.js | 2 +-
server/services/routing/model/interval.js | 2 +-
server/services/routing/model/mailQueue.js | 2 +-
server/services/routing/model/openchannelQueue.js | 2 +-
server/services/routing/model/smsQueue.js | 2 +-
server/services/routing/model/whatsappQueue.js | 2 +-
server/services/routing/realtime/index.js | 2 +-
server/services/routing/rpc/chatInteraction.js | 2 +-
server/services/routing/rpc/chatMessage.js | 2 +-
server/services/routing/rpc/chatQueue.js | 2 +-
server/services/routing/rpc/chatQueueReport.js | 2 +-
server/services/routing/rpc/faxInteraction.js | 2 +-
server/services/routing/rpc/faxMessage.js | 2 +-
server/services/routing/rpc/faxQueue.js | 2 +-
server/services/routing/rpc/faxQueueReport.js | 2 +-
server/services/routing/rpc/interval.js | 2 +-
server/services/routing/rpc/mailInteraction.js | 2 +-
server/services/routing/rpc/mailMessage.js | 2 +-
server/services/routing/rpc/mailQueue.js | 2 +-
server/services/routing/rpc/mailQueueReport.js | 2 +-
.../services/routing/rpc/openchannelInteraction.js | 2 +-
server/services/routing/rpc/openchannelMessage.js | 2 +-
server/services/routing/rpc/openchannelQueue.js | 2 +-
.../services/routing/rpc/openchannelQueueReport.js | 2 +-
server/services/routing/rpc/smsInteraction.js | 2 +-
server/services/routing/rpc/smsMessage.js | 2 +-
server/services/routing/rpc/smsQueue.js | 2 +-
server/services/routing/rpc/smsQueueReport.js | 2 +-
server/services/routing/rpc/user.js | 2 +-
server/services/routing/rpc/whatsappInteraction.js | 2 +-
server/services/routing/rpc/whatsappMessage.js | 2 +-
server/services/routing/rpc/whatsappQueue.js | 2 +-
server/services/routing/rpc/whatsappQueueReport.js | 2 +-
.../services/routing/server/applications/agent.js | 2 +-
.../routing/server/applications/amazonlex.js | 2 +-
.../routing/server/applications/autoreply.js | 2 +-
.../services/routing/server/applications/close.js | 2 +-
.../routing/server/applications/dialogflow.js | 2 +-
.../routing/server/applications/dialogflowV2.js | 2 +-
.../services/routing/server/applications/gotoif.js | 2 +-
.../services/routing/server/applications/gotop.js | 2 +-
.../routing/server/applications/message.js | 2 +-
.../services/routing/server/applications/noop.js | 2 +-
.../services/routing/server/applications/queue.js | 2 +-
.../routing/server/applications/strategy/agent.js | 2 +-
.../server/applications/strategy/beepall.js | 2 +-
.../routing/server/applications/strategy/index.js | 2 +-
.../server/applications/strategy/rrmemory.js | 2 +-
.../routing/server/applications/strategy/util.js | 2 +-
.../services/routing/server/applications/system.js | 2 +-
server/services/routing/server/applications/tag.js | 2 +-
.../services/routing/server/applications/tvox.js | 2 +-
.../services/routing/server/applications/utils.js | 2 +-
server/services/routing/server/index.js | 2 +-
server/services/routing/server/interval.js | 2 +-
server/services/xdr/agents.controller.js | 2 +-
server/services/xdr/calls.controller.js | 2 +-
server/services/xdr/core.controller.js | 2 +-
server/services/xdr/dials.controller.js | 2 +-
server/services/xdr/index.js | 2 +-
server/services/xdr/members.controller.js | 2 +-
server/services/xdr/queues.controller.js | 2 +-
server/services/xdr/recordings.controller.js | 2 +-
server/services/xdr/transfers.controller.js | 2 +-
server/services/xdr/utils.js | 2 +-
server/utils/client-side-logger.js | 2 +-
server/utils/iftime.js | 2 +-
server/utils/loggers.js | 2 +-
server/utils/mask-sensitive-data.js | 2 +-
server/utils/misc.js | 2 +-
server/utils/safe-template.js | 2 +-
server/utils/update-app-config.js | 2 +-
1209 files changed, 1209 insertions(+), 1209 deletions(-)
diff --git a/apidoc/api_project.js b/apidoc/api_project.js
index 760aae1..9009f87 100644
--- a/apidoc/api_project.js
+++ b/apidoc/api_project.js
@@ -17,7 +17,7 @@ define({
"apidoc": "0.3.0",
"generator": {
"name": "apidoc",
- "time": "2023-01-17T15:08:59.349Z",
+ "time": "2023-01-17T17:26:35.591Z",
"url": "http://apidocjs.com",
"version": "0.24.0"
}
diff --git a/apidoc/api_project.json b/apidoc/api_project.json
index 77e428d..c75dc53 100644
--- a/apidoc/api_project.json
+++ b/apidoc/api_project.json
@@ -17,7 +17,7 @@
"apidoc": "0.3.0",
"generator": {
"name": "apidoc",
- "time": "2023-01-17T15:08:59.349Z",
+ "time": "2023-01-17T17:26:35.591Z",
"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 419cc3d..baa2a73 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 _0x1b19=['urlForward[headers],\x20browser[wsindowHeight]','TEXT','sequelize','exports','VIRTUAL','getDataValue','action','contactManager','motionbar','jscripty','urlForward','browser','bot','script','Allowed\x20values:\x20contactManager,\x20integration,\x20motionbar,\x20jscripty,\x20urlForward,\x20browser,\x20bot,\x20script','jscripty[ProjectId],\x20browser[type(0=Popup,1=CTI\x20URL)],\x20contactManager[ListId],\x20urlForward[type(GET,POST,PUT,DELETE)],\x20script[info],\x20integration[intName(desk,dynamics365,freshdesk,freshsales,salesforce,sugarcrm,vtiger,zendesk,zoho)],\x20motionbar[type(0=Popup,1=CTI\x20URL,2=WinApp)]','STRING','contactManager[searchFields],\x20script[script],\x20integration[ConfigurationId],\x20motionbar[NULL,eventVariables(0=No,1=Yes),WinAppArguments],\x20browser[NULL,eventVariables(0=No,1=Yes)]','browser[location(0=NewTab,1=NewWindow,2=MotionTab)],\x20contactManager[autoCreateField]','urlForward[timeout],\x20browser[windowWidth],\x20contactManager[ignoreDialerContactId]'];(function(_0x4e69e1,_0x1c8207){var _0x4a30f3=function(_0x322aea){while(--_0x322aea){_0x4e69e1['push'](_0x4e69e1['shift']());}};_0x4a30f3(++_0x1c8207);}(_0x1b19,0x142));var _0x91b1=function(_0x50cfe9,_0x3d3a4b){_0x50cfe9=_0x50cfe9-0x0;var _0x1bd502=_0x1b19[_0x50cfe9];return _0x1bd502;};'use strict';var Sequelize=require(_0x91b1('0x0'));module[_0x91b1('0x1')]={'name':{'type':Sequelize[_0x91b1('0x2')],'get':function(_0x2d1bdd){return this[_0x91b1('0x3')](_0x91b1('0x4'));}},'action':{'type':Sequelize['STRING'],'allowNull':![],'validate':{'isIn':{'args':[[_0x91b1('0x5'),'integration',_0x91b1('0x6'),_0x91b1('0x7'),_0x91b1('0x8'),_0x91b1('0x9'),_0x91b1('0xa'),_0x91b1('0xb')]],'msg':_0x91b1('0xc')}},'comment':_0x91b1('0xc')},'data1':{'type':Sequelize['STRING'](0x1000),'comment':_0x91b1('0xd')},'data2':{'type':Sequelize[_0x91b1('0xe')](0x1000),'comment':'contactManager[autoCreate(0=No,1=Yes)],\x20urlForward[URL],\x20script[type],\x20integration[AccountId],\x20motionbar[TemplateId,URL,WinAppPath],\x20browser[TemplateId,URL]'},'data3':{'type':Sequelize[_0x91b1('0xe')](0x1000),'comment':_0x91b1('0xf')},'data4':{'type':Sequelize[_0x91b1('0xe')](0x1000),'comments':_0x91b1('0x10')},'data5':{'type':Sequelize[_0x91b1('0xe')](0x1000),'comments':_0x91b1('0x11')},'data6':{'type':Sequelize['STRING'],'comments':_0x91b1('0x12')},'data7':{'type':Sequelize[_0x91b1('0x13')],'comments':'urlForward[body]'}};
\ No newline at end of file
+var _0x1ac3=['Allowed\x20values:\x20contactManager,\x20integration,\x20motionbar,\x20jscripty,\x20urlForward,\x20browser,\x20bot,\x20script','contactManager[searchFields],\x20script[script],\x20integration[ConfigurationId],\x20motionbar[NULL,eventVariables(0=No,1=Yes),WinAppArguments],\x20browser[NULL,eventVariables(0=No,1=Yes)]','browser[location(0=NewTab,1=NewWindow,2=MotionTab)],\x20contactManager[autoCreateField]','urlForward[headers],\x20browser[wsindowHeight]','TEXT','urlForward[body]','sequelize','exports','VIRTUAL','getDataValue','STRING','contactManager','integration','jscripty','browser','bot','script'];(function(_0x40a045,_0x516f0e){var _0x1a687c=function(_0x48c9fe){while(--_0x48c9fe){_0x40a045['push'](_0x40a045['shift']());}};_0x1a687c(++_0x516f0e);}(_0x1ac3,0x17c));var _0x31ac=function(_0x55f8b4,_0x43f30d){_0x55f8b4=_0x55f8b4-0x0;var _0x2475f9=_0x1ac3[_0x55f8b4];return _0x2475f9;};'use strict';var Sequelize=require(_0x31ac('0x0'));module[_0x31ac('0x1')]={'name':{'type':Sequelize[_0x31ac('0x2')],'get':function(_0x2be3b7){return this[_0x31ac('0x3')]('action');}},'action':{'type':Sequelize[_0x31ac('0x4')],'allowNull':![],'validate':{'isIn':{'args':[[_0x31ac('0x5'),_0x31ac('0x6'),'motionbar',_0x31ac('0x7'),'urlForward',_0x31ac('0x8'),_0x31ac('0x9'),_0x31ac('0xa')]],'msg':_0x31ac('0xb')}},'comment':_0x31ac('0xb')},'data1':{'type':Sequelize[_0x31ac('0x4')](0x1000),'comment':'jscripty[ProjectId],\x20browser[type(0=Popup,1=CTI\x20URL)],\x20contactManager[ListId],\x20urlForward[type(GET,POST,PUT,DELETE)],\x20script[info],\x20integration[intName(desk,dynamics365,freshdesk,freshsales,salesforce,sugarcrm,vtiger,zendesk,zoho)],\x20motionbar[type(0=Popup,1=CTI\x20URL,2=WinApp)]'},'data2':{'type':Sequelize[_0x31ac('0x4')](0x1000),'comment':'contactManager[autoCreate(0=No,1=Yes)],\x20urlForward[URL],\x20script[type],\x20integration[AccountId],\x20motionbar[TemplateId,URL,WinAppPath],\x20browser[TemplateId,URL]'},'data3':{'type':Sequelize[_0x31ac('0x4')](0x1000),'comment':_0x31ac('0xc')},'data4':{'type':Sequelize[_0x31ac('0x4')](0x1000),'comments':_0x31ac('0xd')},'data5':{'type':Sequelize['STRING'](0x1000),'comments':'urlForward[timeout],\x20browser[windowWidth],\x20contactManager[ignoreDialerContactId]'},'data6':{'type':Sequelize[_0x31ac('0x4')],'comments':_0x31ac('0xe')},'data7':{'type':Sequelize[_0x31ac('0xf')],'comments':_0x31ac('0x10')}};
\ No newline at end of file
diff --git a/server/api/action/action.controller.js b/server/api/action/action.controller.js
index 461a54e..f031bae 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 _0x7528=['send','update','body','Action','find','params','catch','zip-dir','fast-json-patch','bluebird','mustache','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../mysqldb','sendStatus','status','end','offset','undefined','limit','count','Content-Range','apply','reject','save','then','destroy','error','name'];(function(_0x5971f8,_0x4348b8){var _0x159e78=function(_0x540565){while(--_0x540565){_0x5971f8['push'](_0x5971f8['shift']());}};_0x159e78(++_0x4348b8);}(_0x7528,0xd9));var _0x8752=function(_0x11c72b,_0x8ca977){_0x11c72b=_0x11c72b-0x0;var _0x488f26=_0x7528[_0x11c72b];return _0x488f26;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x8752('0x0'));var jsonpatch=require(_0x8752('0x1'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x8752('0x2'));var Mustache=require(_0x8752('0x3'));var util=require('util');var path=require(_0x8752('0x4'));var sox=require(_0x8752('0x5'));var csv=require(_0x8752('0x6'));var ejs=require(_0x8752('0x7'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x8752('0x8'));var squel=require(_0x8752('0x9'));var crypto=require(_0x8752('0xa'));var jsforce=require(_0x8752('0xb'));var deskjs=require('desk.js');var toCsv=require(_0x8752('0x6'));var querystring=require('querystring');var Papa=require(_0x8752('0xc'));var Redis=require(_0x8752('0xd'));var authService=require(_0x8752('0xe'));var qs=require(_0x8752('0xf'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x8752('0x10'));var logger=require(_0x8752('0x11'))(_0x8752('0x12'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0x8752('0x13'))['db'];function respondWithStatusCode(_0x461481,_0x206dd9){_0x206dd9=_0x206dd9||0xcc;return function(_0x11b768){if(_0x11b768){return _0x461481[_0x8752('0x14')](_0x206dd9);}return _0x461481[_0x8752('0x15')](_0x206dd9)[_0x8752('0x16')]();};}function respondWithResult(_0x34c198,_0xd7bbca){_0xd7bbca=_0xd7bbca||0xc8;return function(_0x2a1b84){if(_0x2a1b84){return _0x34c198['status'](_0xd7bbca)['json'](_0x2a1b84);}};}function respondWithFilteredResult(_0x18780d,_0x76d9b7){return function(_0x47bf46){if(_0x47bf46){var _0xc82707=typeof _0x76d9b7[_0x8752('0x17')]===_0x8752('0x18')&&typeof _0x76d9b7[_0x8752('0x19')]===_0x8752('0x18');var _0x46af54=_0x47bf46[_0x8752('0x1a')];var _0x3a864d=_0xc82707?0x0:_0x76d9b7[_0x8752('0x17')];var _0x1886d5=_0xc82707?_0x47bf46[_0x8752('0x1a')]:_0x76d9b7[_0x8752('0x17')]+_0x76d9b7[_0x8752('0x19')];var _0x172bc2;if(_0x1886d5>=_0x46af54){_0x1886d5=_0x46af54;_0x172bc2=0xc8;}else{_0x172bc2=0xce;}_0x18780d[_0x8752('0x15')](_0x172bc2);return _0x18780d['set'](_0x8752('0x1b'),_0x3a864d+'-'+_0x1886d5+'/'+_0x46af54)['json'](_0x47bf46);}return null;};}function patchUpdates(_0x1bf19b){return function(_0x17e665){try{jsonpatch[_0x8752('0x1c')](_0x17e665,_0x1bf19b,!![]);}catch(_0x51aea5){return BPromise[_0x8752('0x1d')](_0x51aea5);}return _0x17e665[_0x8752('0x1e')]();};}function saveUpdates(_0xa49c28,_0x2327bc){return function(_0x2ae4ab){if(_0x2ae4ab){return _0x2ae4ab['update'](_0xa49c28)[_0x8752('0x1f')](function(_0x247aa0){return _0x247aa0;});}return null;};}function removeEntity(_0xc7711,_0x2bd52d){return function(_0x14bf67){if(_0x14bf67){return _0x14bf67[_0x8752('0x20')]()[_0x8752('0x1f')](function(){_0xc7711['status'](0xcc)[_0x8752('0x16')]();});}};}function handleEntityNotFound(_0x5ea197,_0x21526a){return function(_0x3d153a){if(!_0x3d153a){_0x5ea197['sendStatus'](0x194);}return _0x3d153a;};}function handleError(_0x55e6c6,_0x29681e){_0x29681e=_0x29681e||0x1f4;return function(_0x2db8f7){logger[_0x8752('0x21')](_0x2db8f7['stack']);if(_0x2db8f7['name']){delete _0x2db8f7[_0x8752('0x22')];}_0x55e6c6[_0x8752('0x15')](_0x29681e)[_0x8752('0x23')](_0x2db8f7);};}exports[_0x8752('0x24')]=function(_0x3de12f,_0x4ee74a){if(_0x3de12f[_0x8752('0x25')]['id']){delete _0x3de12f[_0x8752('0x25')]['id'];}return db[_0x8752('0x26')][_0x8752('0x27')]({'where':{'id':_0x3de12f[_0x8752('0x28')]['id']}})[_0x8752('0x1f')](handleEntityNotFound(_0x4ee74a,null))[_0x8752('0x1f')](saveUpdates(_0x3de12f['body'],null))[_0x8752('0x1f')](respondWithResult(_0x4ee74a,null))[_0x8752('0x29')](handleError(_0x4ee74a,null));};exports[_0x8752('0x20')]=function(_0x4a1958,_0x4af751){return db[_0x8752('0x26')][_0x8752('0x27')]({'where':{'id':_0x4a1958[_0x8752('0x28')]['id']}})['then'](handleEntityNotFound(_0x4af751,null))[_0x8752('0x1f')](removeEntity(_0x4af751,null))['catch'](handleError(_0x4af751,null));};
\ No newline at end of file
+var _0x1668=['rimraf','fast-json-patch','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','jsforce','querystring','ioredis','../../components/auth/service','../../config/license/hardware','api','../../config/utils','../../config/license/util','end','status','json','offset','undefined','limit','count','set','Content-Range','reject','save','then','destroy','sendStatus','stack','name','update','body','find','params','Action','eml-format'];(function(_0x55f53,_0x3d9ad0){var _0x50ec49=function(_0x561bca){while(--_0x561bca){_0x55f53['push'](_0x55f53['shift']());}};_0x50ec49(++_0x3d9ad0);}(_0x1668,0xfb));var _0x8166=function(_0x3770f6,_0x54236a){_0x3770f6=_0x3770f6-0x0;var _0x440a98=_0x1668[_0x3770f6];return _0x440a98;};'use strict';var emlformat=require(_0x8166('0x0'));var rimraf=require(_0x8166('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x8166('0x2'));var rp=require('request-promise');var moment=require(_0x8166('0x3'));var BPromise=require(_0x8166('0x4'));var Mustache=require(_0x8166('0x5'));var util=require(_0x8166('0x6'));var path=require(_0x8166('0x7'));var sox=require(_0x8166('0x8'));var csv=require(_0x8166('0x9'));var ejs=require(_0x8166('0xa'));var fs=require('fs');var fs_extra=require(_0x8166('0xb'));var _=require(_0x8166('0xc'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x8166('0xd'));var deskjs=require('desk.js');var toCsv=require(_0x8166('0x9'));var querystring=require(_0x8166('0xe'));var Papa=require('papaparse');var Redis=require(_0x8166('0xf'));var authService=require(_0x8166('0x10'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x8166('0x11'));var logger=require('../../config/logger')(_0x8166('0x12'));var utils=require(_0x8166('0x13'));var config=require('../../config/environment');var licenseUtil=require(_0x8166('0x14'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x2bbea5,_0x591359){_0x591359=_0x591359||0xcc;return function(_0x3d52d0){if(_0x3d52d0){return _0x2bbea5['sendStatus'](_0x591359);}return _0x2bbea5['status'](_0x591359)[_0x8166('0x15')]();};}function respondWithResult(_0x3712f0,_0x487598){_0x487598=_0x487598||0xc8;return function(_0x5df2ae){if(_0x5df2ae){return _0x3712f0[_0x8166('0x16')](_0x487598)[_0x8166('0x17')](_0x5df2ae);}};}function respondWithFilteredResult(_0x136294,_0xad3a8a){return function(_0x7f233e){if(_0x7f233e){var _0x53bdb8=typeof _0xad3a8a[_0x8166('0x18')]===_0x8166('0x19')&&typeof _0xad3a8a[_0x8166('0x1a')]===_0x8166('0x19');var _0x49c3eb=_0x7f233e[_0x8166('0x1b')];var _0x544e19=_0x53bdb8?0x0:_0xad3a8a[_0x8166('0x18')];var _0x23a29c=_0x53bdb8?_0x7f233e['count']:_0xad3a8a[_0x8166('0x18')]+_0xad3a8a[_0x8166('0x1a')];var _0x253f4d;if(_0x23a29c>=_0x49c3eb){_0x23a29c=_0x49c3eb;_0x253f4d=0xc8;}else{_0x253f4d=0xce;}_0x136294['status'](_0x253f4d);return _0x136294[_0x8166('0x1c')](_0x8166('0x1d'),_0x544e19+'-'+_0x23a29c+'/'+_0x49c3eb)[_0x8166('0x17')](_0x7f233e);}return null;};}function patchUpdates(_0x52d6e0){return function(_0x4be767){try{jsonpatch['apply'](_0x4be767,_0x52d6e0,!![]);}catch(_0x2fecae){return BPromise[_0x8166('0x1e')](_0x2fecae);}return _0x4be767[_0x8166('0x1f')]();};}function saveUpdates(_0x169a41,_0x2d3208){return function(_0x4f91e8){if(_0x4f91e8){return _0x4f91e8['update'](_0x169a41)[_0x8166('0x20')](function(_0x4ed564){return _0x4ed564;});}return null;};}function removeEntity(_0x2a1269,_0x541f20){return function(_0x31fa0b){if(_0x31fa0b){return _0x31fa0b[_0x8166('0x21')]()['then'](function(){_0x2a1269[_0x8166('0x16')](0xcc)[_0x8166('0x15')]();});}};}function handleEntityNotFound(_0x17b536,_0x2425d2){return function(_0x4fe428){if(!_0x4fe428){_0x17b536[_0x8166('0x22')](0x194);}return _0x4fe428;};}function handleError(_0x2524e2,_0x422ca7){_0x422ca7=_0x422ca7||0x1f4;return function(_0x513361){logger['error'](_0x513361[_0x8166('0x23')]);if(_0x513361[_0x8166('0x24')]){delete _0x513361[_0x8166('0x24')];}_0x2524e2[_0x8166('0x16')](_0x422ca7)['send'](_0x513361);};}exports[_0x8166('0x25')]=function(_0x1bc30a,_0x254458){if(_0x1bc30a['body']['id']){delete _0x1bc30a[_0x8166('0x26')]['id'];}return db['Action'][_0x8166('0x27')]({'where':{'id':_0x1bc30a[_0x8166('0x28')]['id']}})[_0x8166('0x20')](handleEntityNotFound(_0x254458,null))[_0x8166('0x20')](saveUpdates(_0x1bc30a[_0x8166('0x26')],null))[_0x8166('0x20')](respondWithResult(_0x254458,null))['catch'](handleError(_0x254458,null));};exports[_0x8166('0x21')]=function(_0x303ae3,_0x2aa98b){return db[_0x8166('0x29')][_0x8166('0x27')]({'where':{'id':_0x303ae3[_0x8166('0x28')]['id']}})[_0x8166('0x20')](handleEntityNotFound(_0x2aa98b,null))[_0x8166('0x20')](removeEntity(_0x2aa98b,null))['catch'](handleError(_0x2aa98b,null));};
\ No newline at end of file
diff --git a/server/api/action/action.model.js b/server/api/action/action.model.js
index 16cb933..9d97be2 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 _0x2d65=['exports','define','tools_actions','lodash','util','api','bluebird','request-promise','path','rimraf','./action.attributes'];(function(_0x16e0f5,_0x4ec0f3){var _0x4839d5=function(_0x296b8f){while(--_0x296b8f){_0x16e0f5['push'](_0x16e0f5['shift']());}};_0x4839d5(++_0x4ec0f3);}(_0x2d65,0x1f2));var _0x52d6=function(_0x457e76,_0x358d00){_0x457e76=_0x457e76-0x0;var _0x46e847=_0x2d65[_0x457e76];return _0x46e847;};'use strict';var _=require(_0x52d6('0x0'));var util=require(_0x52d6('0x1'));var logger=require('../../config/logger')(_0x52d6('0x2'));var moment=require('moment');var BPromise=require(_0x52d6('0x3'));var rp=require(_0x52d6('0x4'));var fs=require('fs');var path=require(_0x52d6('0x5'));var rimraf=require(_0x52d6('0x6'));var config=require('../../config/environment');var attributes=require(_0x52d6('0x7'));module[_0x52d6('0x8')]=function(_0x15aa48,_0x3d3acc){return _0x15aa48[_0x52d6('0x9')]('Action',attributes,{'tableName':_0x52d6('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x444e=['rimraf','../../config/environment','./action.attributes','exports','define','Action','tools_actions','lodash','util','../../config/logger','api','bluebird','path'];(function(_0x5ed29c,_0x2bf85b){var _0x24654c=function(_0x2af753){while(--_0x2af753){_0x5ed29c['push'](_0x5ed29c['shift']());}};_0x24654c(++_0x2bf85b);}(_0x444e,0x180));var _0xe444=function(_0x5a6b08,_0xb8a98e){_0x5a6b08=_0x5a6b08-0x0;var _0x30dbc2=_0x444e[_0x5a6b08];return _0x30dbc2;};'use strict';var _=require(_0xe444('0x0'));var util=require(_0xe444('0x1'));var logger=require(_0xe444('0x2'))(_0xe444('0x3'));var moment=require('moment');var BPromise=require(_0xe444('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xe444('0x5'));var rimraf=require(_0xe444('0x6'));var config=require(_0xe444('0x7'));var attributes=require(_0xe444('0x8'));module[_0xe444('0x9')]=function(_0x5991c8,_0x271d9b){return _0x5991c8[_0xe444('0xa')](_0xe444('0xb'),attributes,{'tableName':_0xe444('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
diff --git a/server/api/action/action.rpc.js b/server/api/action/action.rpc.js
index f4f4181..de9c8ac 100644
--- a/server/api/action/action.rpc.js
+++ b/server/api/action/action.rpc.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x7217=['stringify','error','code','message','result','catch','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','rpc','../../config/environment','jayson/promise','client','http','request','then','info','Action,\x20%s,\x20%s','debug','Action,\x20%s,\x20%s,\x20%s','request\x20sent'];(function(_0x455c6c,_0x1e78b7){var _0x488242=function(_0x3e8fb0){while(--_0x3e8fb0){_0x455c6c['push'](_0x455c6c['shift']());}};_0x488242(++_0x1e78b7);}(_0x7217,0x19e));var _0x7721=function(_0x3a6efd,_0x2a5102){_0x3a6efd=_0x3a6efd-0x0;var _0x487b9a=_0x7217[_0x3a6efd];return _0x487b9a;};'use strict';var _=require(_0x7721('0x0'));var util=require('util');var moment=require(_0x7721('0x1'));var BPromise=require(_0x7721('0x2'));var rs=require(_0x7721('0x3'));var fs=require('fs');var Redis=require(_0x7721('0x4'));var db=require(_0x7721('0x5'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x7721('0x6'));var config=require(_0x7721('0x7'));var jayson=require(_0x7721('0x8'));var client=jayson[_0x7721('0x9')][_0x7721('0xa')]({'port':0x232a});function respondWithRpcPromise(_0xf7ff37,_0x18ab6b,_0x21f680){return new BPromise(function(_0x225610,_0x2f99ed){return client[_0x7721('0xb')](_0xf7ff37,_0x21f680)[_0x7721('0xc')](function(_0xfa8835){logger[_0x7721('0xd')](_0x7721('0xe'),_0x18ab6b,'request\x20sent');logger[_0x7721('0xf')](_0x7721('0x10'),_0x18ab6b,_0x7721('0x11'),JSON[_0x7721('0x12')](_0xfa8835));if(_0xfa8835[_0x7721('0x13')]){if(_0xfa8835[_0x7721('0x13')][_0x7721('0x14')]===0x1f4){logger[_0x7721('0x13')]('Action,\x20%s,\x20%s',_0x18ab6b,_0xfa8835[_0x7721('0x13')][_0x7721('0x15')]);return _0x2f99ed(_0xfa8835['error'][_0x7721('0x15')]);}logger[_0x7721('0x13')](_0x7721('0xe'),_0x18ab6b,_0xfa8835[_0x7721('0x13')]['message']);return _0x225610(_0xfa8835[_0x7721('0x13')][_0x7721('0x15')]);}else{logger['info']('Action,\x20%s,\x20%s',_0x18ab6b,'request\x20sent');_0x225610(_0xfa8835[_0x7721('0x16')][_0x7721('0x15')]);}})[_0x7721('0x17')](function(_0x32550d){logger['error'](_0x7721('0xe'),_0x18ab6b,_0x32550d);_0x2f99ed(_0x32550d);});});}
\ No newline at end of file
+var _0x53ec=['error','message','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','rpc','../../config/environment','client','request','then','info','Action,\x20%s,\x20%s','request\x20sent','debug','stringify','code'];(function(_0x1ccdf7,_0x215d5a){var _0x52a0ae=function(_0x40324a){while(--_0x40324a){_0x1ccdf7['push'](_0x1ccdf7['shift']());}};_0x52a0ae(++_0x215d5a);}(_0x53ec,0x192));var _0xc53e=function(_0x414f67,_0x861aed){_0x414f67=_0x414f67-0x0;var _0x338537=_0x53ec[_0x414f67];return _0x338537;};'use strict';var _=require(_0xc53e('0x0'));var util=require(_0xc53e('0x1'));var moment=require(_0xc53e('0x2'));var BPromise=require(_0xc53e('0x3'));var rs=require(_0xc53e('0x4'));var fs=require('fs');var Redis=require(_0xc53e('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0xc53e('0x6'));var logger=require('../../config/logger')(_0xc53e('0x7'));var config=require(_0xc53e('0x8'));var jayson=require('jayson/promise');var client=jayson[_0xc53e('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x41a9e8,_0x2de88b,_0x5d3b28){return new BPromise(function(_0x1616ac,_0x1ac6c0){return client[_0xc53e('0xa')](_0x41a9e8,_0x5d3b28)[_0xc53e('0xb')](function(_0xd9612){logger[_0xc53e('0xc')](_0xc53e('0xd'),_0x2de88b,_0xc53e('0xe'));logger[_0xc53e('0xf')]('Action,\x20%s,\x20%s,\x20%s',_0x2de88b,'request\x20sent',JSON[_0xc53e('0x10')](_0xd9612));if(_0xd9612['error']){if(_0xd9612['error'][_0xc53e('0x11')]===0x1f4){logger[_0xc53e('0x12')](_0xc53e('0xd'),_0x2de88b,_0xd9612[_0xc53e('0x12')]['message']);return _0x1ac6c0(_0xd9612['error'][_0xc53e('0x13')]);}logger[_0xc53e('0x12')](_0xc53e('0xd'),_0x2de88b,_0xd9612[_0xc53e('0x12')][_0xc53e('0x13')]);return _0x1616ac(_0xd9612[_0xc53e('0x12')][_0xc53e('0x13')]);}else{logger[_0xc53e('0xc')](_0xc53e('0xd'),_0x2de88b,_0xc53e('0xe'));_0x1616ac(_0xd9612['result'][_0xc53e('0x13')]);}})[_0xc53e('0x14')](function(_0x535cd4){logger[_0xc53e('0x12')](_0xc53e('0xd'),_0x2de88b,_0x535cd4);_0x1ac6c0(_0x535cd4);});});}
\ No newline at end of file
diff --git a/server/api/action/index.js b/server/api/action/index.js
index 7988c79..109588b 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 _0xfd69=['./action.controller','put','/:id','isAuthenticated','update','exports','util','path','express','Router','fs-extra','../../components/interaction/service'];(function(_0x504d86,_0x4c45da){var _0x78226f=function(_0x4a58f4){while(--_0x4a58f4){_0x504d86['push'](_0x504d86['shift']());}};_0x78226f(++_0x4c45da);}(_0xfd69,0x156));var _0x9fd6=function(_0x3b00b4,_0x413db0){_0x3b00b4=_0x3b00b4-0x0;var _0x1f83a4=_0xfd69[_0x3b00b4];return _0x1f83a4;};'use strict';var multer=require('multer');var util=require(_0x9fd6('0x0'));var path=require(_0x9fd6('0x1'));var timeout=require('connect-timeout');var express=require(_0x9fd6('0x2'));var router=express[_0x9fd6('0x3')]();var fs_extra=require(_0x9fd6('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0x9fd6('0x5'));var config=require('../../config/environment');var controller=require(_0x9fd6('0x6'));router[_0x9fd6('0x7')](_0x9fd6('0x8'),auth[_0x9fd6('0x9')](),controller[_0x9fd6('0xa')]);router['delete']('/:id',auth['isAuthenticated'](),controller['destroy']);module[_0x9fd6('0xb')]=router;
\ No newline at end of file
+var _0xd9b4=['util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','put','/:id','isAuthenticated','update','delete','multer'];(function(_0x57b54c,_0x54ce0d){var _0x59cc19=function(_0xa33bc6){while(--_0xa33bc6){_0x57b54c['push'](_0x57b54c['shift']());}};_0x59cc19(++_0x54ce0d);}(_0xd9b4,0x6f));var _0x4d9b=function(_0x5ccf18,_0x5d96d3){_0x5ccf18=_0x5ccf18-0x0;var _0xc33d73=_0xd9b4[_0x5ccf18];return _0xc33d73;};'use strict';var multer=require(_0x4d9b('0x0'));var util=require(_0x4d9b('0x1'));var path=require(_0x4d9b('0x2'));var timeout=require(_0x4d9b('0x3'));var express=require(_0x4d9b('0x4'));var router=express[_0x4d9b('0x5')]();var fs_extra=require(_0x4d9b('0x6'));var auth=require(_0x4d9b('0x7'));var interaction=require(_0x4d9b('0x8'));var config=require('../../config/environment');var controller=require('./action.controller');router[_0x4d9b('0x9')](_0x4d9b('0xa'),auth[_0x4d9b('0xb')](),controller[_0x4d9b('0xc')]);router[_0x4d9b('0xd')]('/:id',auth[_0x4d9b('0xb')](),controller['destroy']);module['exports']=router;
\ No newline at end of file
diff --git a/server/api/analyticCustomReport/analyticCustomReport.attributes.js b/server/api/analyticCustomReport/analyticCustomReport.attributes.js
index f33e0e9..329a74b 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 _0xae24=['sequelize','STRING'];(function(_0x971634,_0x560d92){var _0x591972=function(_0x53f5b1){while(--_0x53f5b1){_0x971634['push'](_0x971634['shift']());}};_0x591972(++_0x560d92);}(_0xae24,0x182));var _0x4ae2=function(_0xee7c56,_0x3b4b23){_0xee7c56=_0xee7c56-0x0;var _0x367971=_0xae24[_0xee7c56];return _0x367971;};'use strict';var Sequelize=require(_0x4ae2('0x0'));module['exports']={'name':{'type':Sequelize[_0x4ae2('0x1')],'allowNull':![]},'description':{'type':Sequelize['STRING']},'parent':{'type':Sequelize[_0x4ae2('0x1')]},'table':{'type':Sequelize[_0x4ae2('0x1')]},'conditions':{'type':Sequelize['TEXT']},'joins':{'type':Sequelize['TEXT']}};
\ No newline at end of file
+var _0xee14=['STRING','TEXT'];(function(_0x31824a,_0x423ed6){var _0x7f5c89=function(_0x17589e){while(--_0x17589e){_0x31824a['push'](_0x31824a['shift']());}};_0x7f5c89(++_0x423ed6);}(_0xee14,0x13a));var _0x4ee1=function(_0x97b20c,_0x2125c6){_0x97b20c=_0x97b20c-0x0;var _0x44fed2=_0xee14[_0x97b20c];return _0x44fed2;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize[_0x4ee1('0x0')],'allowNull':![]},'description':{'type':Sequelize[_0x4ee1('0x0')]},'parent':{'type':Sequelize[_0x4ee1('0x0')]},'table':{'type':Sequelize[_0x4ee1('0x0')]},'conditions':{'type':Sequelize[_0x4ee1('0x1')]},'joins':{'type':Sequelize[_0x4ee1('0x1')]}};
\ No newline at end of file
diff --git a/server/api/analyticCustomReport/analyticCustomReport.controller.js b/server/api/analyticCustomReport/analyticCustomReport.controller.js
index 3d44c0f..b4ab3a8 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 _0x94c9=['pick','filter','VIRTUAL','merge','options','count','includeAll','findAll','rows','catch','show','rawAttributes','include','create','body','user','role','find','params','preview','left_join','right_join','SUM(%s)','COUNT(%s)','COUNT(DISTINCT\x20%s)','MAX(%s)','MIN(%s)','AVG(%s)','GROUP_CONCAT(%s)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)','SEC_TO_TIME(%s)','DATE(%s)','HOUR(%s)','ROUND(%s)','UNIX_TIMESTAMP(%s)','includes','IS\x20NULL','IS\x20NOT\x20NULL','IS\x20EMPTY','IS\x20NOT\x20EMPTY','group','rules','field','condition','getFields','Sequelize','ValidationErrorItem','AnalyticMetric','keyBy','select','from','table','MetricId','function','format','replace','groupBy','orderBy','order','DESC','alias','joins','parentKey','foreignTable','foreignKey','conditions','parse','clone','debug','Limited\x20Query:','toString','sequelize','SELECT','join','Please\x20insert\x20at\x20least\x20one\x20field','web','%s-%s.%s','randomstring','generate','output','csv','custom','AnalyticExtractedReport','cdr','startDate','endDate','.createdAt\x20BETWEEN\x20?\x20AND\x20?','info','child_process','../../components/export/','../../files/reports','savename','countTable','COUNT(*)','run','runReport','operator','%s.%s\x20=\x20%s.%s','eml-format','rimraf','zip-dir','request-promise','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','desk.js','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','dbH','status','end','offset','undefined','limit','set','Content-Range','json','apply','reject','save','update','then','destroy','get','CustomReports','UserProfileResource','error','name','send','index','map','AnalyticCustomReport','fieldName','type','key','model','query','keys','intersection','fields','attributes','length','nolimit','sort','where','filters'];(function(_0x2d0bfd,_0x2ba336){var _0x4d806c=function(_0x47938d){while(--_0x47938d){_0x2d0bfd['push'](_0x2d0bfd['shift']());}};_0x4d806c(++_0x2ba336);}(_0x94c9,0x1a7));var _0x994c=function(_0x3cc575,_0x3e8ae6){_0x3cc575=_0x3cc575-0x0;var _0x276e6b=_0x94c9[_0x3cc575];return _0x276e6b;};'use strict';var emlformat=require(_0x994c('0x0'));var rimraf=require(_0x994c('0x1'));var zipdir=require(_0x994c('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x994c('0x3'));var moment=require('moment');var BPromise=require(_0x994c('0x4'));var Mustache=require(_0x994c('0x5'));var util=require(_0x994c('0x6'));var path=require(_0x994c('0x7'));var sox=require(_0x994c('0x8'));var csv=require(_0x994c('0x9'));var ejs=require(_0x994c('0xa'));var fs=require('fs');var fs_extra=require(_0x994c('0xb'));var _=require(_0x994c('0xc'));var squel=require(_0x994c('0xd'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x994c('0xe'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x994c('0xf'));var Redis=require(_0x994c('0x10'));var authService=require('../../components/auth/service');var qs=require(_0x994c('0x11'));var as=require(_0x994c('0x12'));var hardwareService=require(_0x994c('0x13'));var logger=require(_0x994c('0x14'))(_0x994c('0x15'));var utils=require(_0x994c('0x16'));var config=require(_0x994c('0x17'));var licenseUtil=require('../../config/license/util');var db=require(_0x994c('0x18'))['db'];var dbH=require(_0x994c('0x18'))[_0x994c('0x19')];function respondWithStatusCode(_0x14a6e3,_0x5c1383){_0x5c1383=_0x5c1383||0xcc;return function(_0x4cadf7){if(_0x4cadf7){return _0x14a6e3['sendStatus'](_0x5c1383);}return _0x14a6e3[_0x994c('0x1a')](_0x5c1383)[_0x994c('0x1b')]();};}function respondWithResult(_0x48a799,_0x218af3){_0x218af3=_0x218af3||0xc8;return function(_0x30e52e){if(_0x30e52e){return _0x48a799[_0x994c('0x1a')](_0x218af3)['json'](_0x30e52e);}};}function respondWithFilteredResult(_0x56965c,_0x3d55e5){return function(_0x49d510){if(_0x49d510){var _0x4fa2ab=typeof _0x3d55e5[_0x994c('0x1c')]===_0x994c('0x1d')&&typeof _0x3d55e5['limit']===_0x994c('0x1d');var _0x2f0640=_0x49d510['count'];var _0x536b4b=_0x4fa2ab?0x0:_0x3d55e5['offset'];var _0x158d13=_0x4fa2ab?_0x49d510['count']:_0x3d55e5[_0x994c('0x1c')]+_0x3d55e5[_0x994c('0x1e')];var _0x218077;if(_0x158d13>=_0x2f0640){_0x158d13=_0x2f0640;_0x218077=0xc8;}else{_0x218077=0xce;}_0x56965c[_0x994c('0x1a')](_0x218077);return _0x56965c[_0x994c('0x1f')](_0x994c('0x20'),_0x536b4b+'-'+_0x158d13+'/'+_0x2f0640)[_0x994c('0x21')](_0x49d510);}return null;};}function patchUpdates(_0x5833f6){return function(_0x2cb1b5){try{jsonpatch[_0x994c('0x22')](_0x2cb1b5,_0x5833f6,!![]);}catch(_0x5efae7){return BPromise[_0x994c('0x23')](_0x5efae7);}return _0x2cb1b5[_0x994c('0x24')]();};}function saveUpdates(_0x87be60,_0xa8417f){return function(_0x4b25e6){if(_0x4b25e6){return _0x4b25e6[_0x994c('0x25')](_0x87be60)[_0x994c('0x26')](function(_0x2d6a77){return _0x2d6a77;});}return null;};}function removeEntity(_0x999b85,_0x5808f7){return function(_0x434b58){if(_0x434b58){return _0x434b58[_0x994c('0x27')]()['then'](function(){var _0x2d890d=_0x434b58[_0x994c('0x28')]({'plain':!![]});var _0x343268=_0x994c('0x29');return db[_0x994c('0x2a')][_0x994c('0x27')]({'where':{'type':_0x343268,'resourceId':_0x2d890d['id']}})[_0x994c('0x26')](function(){return _0x434b58;});})[_0x994c('0x26')](function(){_0x999b85[_0x994c('0x1a')](0xcc)[_0x994c('0x1b')]();});}};}function handleEntityNotFound(_0x5b265c,_0x5d35d2){return function(_0x28a213){if(!_0x28a213){_0x5b265c['sendStatus'](0x194);}return _0x28a213;};}function handleError(_0x1122a1,_0x2985ff){_0x2985ff=_0x2985ff||0x1f4;return function(_0xf15830){logger[_0x994c('0x2b')](_0xf15830['stack']);if(_0xf15830['name']){delete _0xf15830[_0x994c('0x2c')];}_0x1122a1[_0x994c('0x1a')](_0x2985ff)[_0x994c('0x2d')](_0xf15830);};}exports[_0x994c('0x2e')]=function(_0x15e06f,_0x39d291){var _0xaf5343={},_0x268cbe={},_0x49c3c6={'count':0x0,'rows':[]};var _0x1f9cfe=_[_0x994c('0x2f')](db[_0x994c('0x30')]['rawAttributes'],function(_0x26ef10){return{'name':_0x26ef10[_0x994c('0x31')],'type':_0x26ef10[_0x994c('0x32')][_0x994c('0x33')]};});_0x268cbe[_0x994c('0x34')]=_[_0x994c('0x2f')](_0x1f9cfe,_0x994c('0x2c'));_0x268cbe[_0x994c('0x35')]=_[_0x994c('0x36')](_0x15e06f[_0x994c('0x35')]);_0x268cbe['filters']=_[_0x994c('0x37')](_0x268cbe['model'],_0x268cbe[_0x994c('0x35')]);_0xaf5343['attributes']=_['intersection'](_0x268cbe[_0x994c('0x34')],qs[_0x994c('0x38')](_0x15e06f[_0x994c('0x35')][_0x994c('0x38')]));_0xaf5343[_0x994c('0x39')]=_0xaf5343[_0x994c('0x39')][_0x994c('0x3a')]?_0xaf5343[_0x994c('0x39')]:_0x268cbe[_0x994c('0x34')];if(!_0x15e06f[_0x994c('0x35')]['hasOwnProperty'](_0x994c('0x3b'))){_0xaf5343[_0x994c('0x1e')]=qs[_0x994c('0x1e')](_0x15e06f[_0x994c('0x35')][_0x994c('0x1e')]);_0xaf5343[_0x994c('0x1c')]=qs[_0x994c('0x1c')](_0x15e06f['query'][_0x994c('0x1c')]);}_0xaf5343['order']=qs[_0x994c('0x3c')](_0x15e06f[_0x994c('0x35')]['sort']);_0xaf5343[_0x994c('0x3d')]=qs[_0x994c('0x3e')](_[_0x994c('0x3f')](_0x15e06f[_0x994c('0x35')],_0x268cbe[_0x994c('0x3e')]),_0x1f9cfe);if(_0x15e06f[_0x994c('0x35')][_0x994c('0x40')]){_0xaf5343[_0x994c('0x3d')]=_['merge'](_0xaf5343[_0x994c('0x3d')],{'$or':_[_0x994c('0x2f')](_0x1f9cfe,function(_0x2c694f){if(_0x2c694f[_0x994c('0x32')]!==_0x994c('0x41')){var _0x25bb9b={};_0x25bb9b[_0x2c694f['name']]={'$like':'%'+_0x15e06f[_0x994c('0x35')][_0x994c('0x40')]+'%'};return _0x25bb9b;}})});}_0xaf5343=_[_0x994c('0x42')]({},_0xaf5343,_0x15e06f[_0x994c('0x43')]);var _0x2713c8={'where':_0xaf5343[_0x994c('0x3d')]};return db['AnalyticCustomReport'][_0x994c('0x44')](_0x2713c8)['then'](function(_0x1b77ab){_0x49c3c6[_0x994c('0x44')]=_0x1b77ab;if(_0x15e06f[_0x994c('0x35')][_0x994c('0x45')]){_0xaf5343['include']=[{'all':!![]}];}return db[_0x994c('0x30')][_0x994c('0x46')](_0xaf5343);})[_0x994c('0x26')](function(_0x1bcebd){_0x49c3c6[_0x994c('0x47')]=_0x1bcebd;return _0x49c3c6;})[_0x994c('0x26')](respondWithFilteredResult(_0x39d291,_0xaf5343))[_0x994c('0x48')](handleError(_0x39d291,null));};exports[_0x994c('0x49')]=function(_0x101e85,_0x4cd941){var _0x51a363={'raw':![],'where':{'id':_0x101e85['params']['id']}},_0x5caaef={};_0x5caaef[_0x994c('0x34')]=_[_0x994c('0x36')](db[_0x994c('0x30')][_0x994c('0x4a')]);_0x5caaef[_0x994c('0x35')]=_[_0x994c('0x36')](_0x101e85[_0x994c('0x35')]);_0x5caaef[_0x994c('0x3e')]=_['intersection'](_0x5caaef[_0x994c('0x34')],_0x5caaef[_0x994c('0x35')]);_0x51a363['attributes']=_['intersection'](_0x5caaef[_0x994c('0x34')],qs[_0x994c('0x38')](_0x101e85[_0x994c('0x35')][_0x994c('0x38')]));_0x51a363[_0x994c('0x39')]=_0x51a363[_0x994c('0x39')]['length']?_0x51a363[_0x994c('0x39')]:_0x5caaef[_0x994c('0x34')];if(_0x101e85[_0x994c('0x35')][_0x994c('0x45')]){_0x51a363[_0x994c('0x4b')]=[{'all':!![]}];}_0x51a363=_[_0x994c('0x42')]({},_0x51a363,_0x101e85[_0x994c('0x43')]);return db['AnalyticCustomReport']['find'](_0x51a363)['then'](handleEntityNotFound(_0x4cd941,null))['then'](respondWithResult(_0x4cd941,null))[_0x994c('0x48')](handleError(_0x4cd941,null));};exports['create']=function(_0xfe85a4,_0x20c953){return db[_0x994c('0x30')][_0x994c('0x4c')](_0xfe85a4[_0x994c('0x4d')],{})[_0x994c('0x26')](function(_0x4e88bd){var _0x2a9360=_0xfe85a4[_0x994c('0x4e')][_0x994c('0x28')]({'plain':!![]});if(!_0x2a9360)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x2a9360[_0x994c('0x4f')]===_0x994c('0x4e')){var _0x9b67fe=_0x4e88bd['get']({'plain':!![]});var _0x37f422='Reports';return db['UserProfileSection'][_0x994c('0x50')]({'where':{'name':_0x37f422,'userProfileId':_0x2a9360['userProfileId']},'raw':!![]})[_0x994c('0x26')](function(_0x13703e){if(_0x13703e&&_0x13703e['autoAssociation']===0x0){return db[_0x994c('0x2a')][_0x994c('0x4c')]({'name':_0x9b67fe[_0x994c('0x2c')],'resourceId':_0x9b67fe['id'],'type':'CustomReports','sectionId':_0x13703e['id']},{})['then'](function(){return _0x4e88bd;});}else{return _0x4e88bd;}})[_0x994c('0x48')](function(_0x149525){logger['error']('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x149525);throw _0x149525;});}return _0x4e88bd;})['then'](respondWithResult(_0x20c953,0xc9))[_0x994c('0x48')](handleError(_0x20c953,null));};exports['update']=function(_0x3b4c72,_0x28b424){if(_0x3b4c72[_0x994c('0x4d')]['id']){delete _0x3b4c72[_0x994c('0x4d')]['id'];}return db[_0x994c('0x30')][_0x994c('0x50')]({'where':{'id':_0x3b4c72[_0x994c('0x51')]['id']}})[_0x994c('0x26')](handleEntityNotFound(_0x28b424,null))[_0x994c('0x26')](saveUpdates(_0x3b4c72[_0x994c('0x4d')],null))['then'](respondWithResult(_0x28b424,null))[_0x994c('0x48')](handleError(_0x28b424,null));};exports[_0x994c('0x27')]=function(_0x5085b9,_0x1e0edc){return db['AnalyticCustomReport'][_0x994c('0x50')]({'where':{'id':_0x5085b9[_0x994c('0x51')]['id']}})[_0x994c('0x26')](handleEntityNotFound(_0x1e0edc,null))[_0x994c('0x26')](removeEntity(_0x1e0edc,null))['catch'](handleError(_0x1e0edc,null));};exports[_0x994c('0x52')]=function(_0x2640ce,_0x5e3807){var _0x4b73cb=0xa;var _0x1a0b0f=['join',_0x994c('0x53'),_0x994c('0x54'),'cross_join'];var _0x23111b={'SUM':_0x994c('0x55'),'COUNT':_0x994c('0x56'),'COUNT DISTINCT':_0x994c('0x57'),'MAX':_0x994c('0x58'),'MIN':_0x994c('0x59'),'AVG':_0x994c('0x5a'),'GROUP_CONCAT':_0x994c('0x5b'),'GROUP_CONCAT ASC':_0x994c('0x5c'),'GROUP_CONCAT DESC':_0x994c('0x5d')};var _0x23c18e={'SEC_TO_TIME':_0x994c('0x5e'),'DATE':_0x994c('0x5f'),'HOUR':_0x994c('0x60'),'ROUND':_0x994c('0x61'),'UNIX_TIMESTAMP':_0x994c('0x62')};var _0x51a005=function(_0x17fedc){return!_[_0x994c('0x63')]([_0x994c('0x64'),_0x994c('0x65'),_0x994c('0x66'),_0x994c('0x67')],_0x17fedc);};var _0x140a66=function(_0x22986b){if(!_0x22986b||!_0x22986b['rules'][_0x994c('0x3a')]){return'';}for(var _0x3a2831='(',_0x53d0b6=0x0;_0x53d0b6<_0x22986b['rules'][_0x994c('0x3a')];_0x53d0b6+=0x1){_0x53d0b6>0x0&&(_0x3a2831+='\x20'+_0x22986b['operator']+'\x20');_0x3a2831+=_0x22986b['rules'][_0x53d0b6][_0x994c('0x68')]?_0x140a66(_0x22986b[_0x994c('0x69')][_0x53d0b6][_0x994c('0x68')]):_0x22986b[_0x994c('0x69')][_0x53d0b6][_0x994c('0x6a')]+'\x20'+_0x22986b[_0x994c('0x69')][_0x53d0b6][_0x994c('0x6b')]+(_0x51a005(_0x22986b[_0x994c('0x69')][_0x53d0b6][_0x994c('0x6b')])?'\x20'+_0x22986b[_0x994c('0x69')][_0x53d0b6]['value']:'');}return _0x3a2831+')';};var _0xc8d654={'where':{'id':_0x2640ce[_0x994c('0x51')]['id']}},_0x47cd86,_0x414210,_0x578b03,_0x92aa1,_0x192b6e;_0xc8d654=_[_0x994c('0x42')]({},_0xc8d654,_0x2640ce[_0x994c('0x43')]);return db[_0x994c('0x30')][_0x994c('0x50')](_0xc8d654)[_0x994c('0x26')](function(_0xb4f83f){if(_0xb4f83f){_0x47cd86=_0xb4f83f;return _0xb4f83f[_0x994c('0x6c')]();}return null;})[_0x994c('0x26')](function(_0x130500){if(_0x130500){if(!_0x130500[_0x994c('0x3a')]){throw new db[(_0x994c('0x6d'))][(_0x994c('0x6e'))]('Please\x20insert\x20at\x20least\x20one\x20field',0x193);}_0x414210=_0x130500;return db[_0x994c('0x6f')][_0x994c('0x46')]({'raw':!![]});}return null;})[_0x994c('0x26')](function(_0x23aec3){if(_0x23aec3){_0x578b03=_[_0x994c('0x70')](_0x23aec3,'id');var _0x125ef0;var _0x4834e6=squel[_0x994c('0x71')]();_0x4834e6[_0x994c('0x72')](_0x47cd86[_0x994c('0x73')]);for(var _0x39469d=0x0;_0x39469d<_0x414210[_0x994c('0x3a')];_0x39469d+=0x1){_0x125ef0=_0x414210[_0x39469d][_0x994c('0x74')]?_0x578b03[_0x414210[_0x39469d][_0x994c('0x74')]]['metric']:_0x414210[_0x39469d][_0x994c('0x6a')];_0x125ef0=_0x414210[_0x39469d][_0x994c('0x75')]?_['replace'](_0x23111b[_0x414210[_0x39469d][_0x994c('0x75')]],'%s',_0x125ef0):_0x125ef0;_0x125ef0=_0x414210[_0x39469d][_0x994c('0x76')]?_[_0x994c('0x77')](_0x23c18e[_0x414210[_0x39469d][_0x994c('0x76')]],'%s',_0x125ef0):_0x125ef0;if(_0x414210[_0x39469d][_0x994c('0x78')]){_0x4834e6[_0x994c('0x68')](_0x125ef0);}_0x414210[_0x39469d][_0x994c('0x79')]&&_0x4834e6[_0x994c('0x7a')](_0x125ef0,_0x414210[_0x39469d]['orderBy']===_0x994c('0x7b')?![]:!![]);_0x4834e6[_0x994c('0x6a')](_0x125ef0,_0x414210[_0x39469d][_0x994c('0x7c')]||_0x125ef0);}if(_0x47cd86[_0x994c('0x7d')]){_0x47cd86[_0x994c('0x7d')]=JSON['parse'](_0x47cd86[_0x994c('0x7d')]);for(var _0x2ef87c=0x0;_0x2ef87c<_0x47cd86[_0x994c('0x7d')][_0x994c('0x3a')];_0x2ef87c+=0x1){if(_0x47cd86[_0x994c('0x7d')][_0x2ef87c][_0x994c('0x32')]&&_[_0x994c('0x63')](_0x1a0b0f,_0x47cd86['joins'][_0x2ef87c][_0x994c('0x32')])&&_0x47cd86[_0x994c('0x7d')][_0x2ef87c][_0x994c('0x7e')]&&_0x47cd86['joins'][_0x2ef87c][_0x994c('0x7f')]&&_0x47cd86[_0x994c('0x7d')][_0x2ef87c][_0x994c('0x80')]){_0x4834e6[_0x47cd86[_0x994c('0x7d')][_0x2ef87c][_0x994c('0x32')]](_0x47cd86[_0x994c('0x7d')][_0x2ef87c]['foreignTable'],null,util[_0x994c('0x76')]('%s.%s\x20=\x20%s.%s',_0x47cd86[_0x994c('0x73')],_0x47cd86['joins'][_0x2ef87c][_0x994c('0x7e')],_0x47cd86['joins'][_0x2ef87c][_0x994c('0x7f')],_0x47cd86[_0x994c('0x7d')][_0x2ef87c]['foreignKey']));}}}if(_0x47cd86[_0x994c('0x81')]){_0x47cd86[_0x994c('0x81')]=JSON[_0x994c('0x82')](_0x47cd86[_0x994c('0x81')]);_0x4834e6[_0x994c('0x3d')](_0x140a66(_0x47cd86[_0x994c('0x81')]['group']));}_0x192b6e=_0x4834e6[_0x994c('0x83')]();_0x4834e6[_0x994c('0x1e')](_0x4b73cb);_0x4834e6[_0x994c('0x1c')](0x0);logger[_0x994c('0x84')](_0x994c('0x85'),_0x4834e6[_0x994c('0x86')]());return dbH[_0x994c('0x87')][_0x994c('0x35')](_0x4834e6['toString'](),{'type':dbH['sequelize']['QueryTypes'][_0x994c('0x88')]});}})['then'](respondWithResult(_0x5e3807,null))[_0x994c('0x48')](handleError(_0x5e3807,null));};function runReport(_0x4cb2e0,_0x264568,_0x1db0c8){var _0x11bf24=_0x264568[_0x994c('0x2c')];var _0x97df2b=0xa;var _0x25db9c=[_0x994c('0x89'),_0x994c('0x53'),'right_join','cross_join'];var _0x2657a6={'SUM':_0x994c('0x55'),'COUNT':_0x994c('0x56'),'COUNT DISTINCT':_0x994c('0x57'),'MAX':_0x994c('0x58'),'MIN':_0x994c('0x59'),'AVG':_0x994c('0x5a'),'GROUP_CONCAT':'GROUP_CONCAT(%s)','GROUP_CONCAT ASC':_0x994c('0x5c'),'GROUP_CONCAT DESC':_0x994c('0x5d')};var _0x284149={'SEC_TO_TIME':_0x994c('0x5e'),'DATE':_0x994c('0x5f'),'HOUR':_0x994c('0x60'),'ROUND':_0x994c('0x61'),'UNIX_TIMESTAMP':_0x994c('0x62')};var _0xe88654=function(_0x98bdb){return!_['includes']([_0x994c('0x64'),_0x994c('0x65'),_0x994c('0x66'),_0x994c('0x67')],_0x98bdb);};var _0x561245=function(_0xf9872b){if(!_0xf9872b||!_0xf9872b['rules']['length']){return'';}for(var _0x559f37='(',_0x430966=0x0;_0x430966<_0xf9872b[_0x994c('0x69')][_0x994c('0x3a')];_0x430966+=0x1){_0x430966>0x0&&(_0x559f37+='\x20'+_0xf9872b['operator']+'\x20');_0x559f37+=_0xf9872b[_0x994c('0x69')][_0x430966][_0x994c('0x68')]?_0x561245(_0xf9872b[_0x994c('0x69')][_0x430966][_0x994c('0x68')]):_0xf9872b[_0x994c('0x69')][_0x430966]['field']+'\x20'+_0xf9872b['rules'][_0x430966][_0x994c('0x6b')]+(_0xe88654(_0xf9872b[_0x994c('0x69')][_0x430966][_0x994c('0x6b')])?'\x20'+_0xf9872b[_0x994c('0x69')][_0x430966]['value']:'');}return _0x559f37+')';};var _0x136975={'where':{'id':_0x4cb2e0['id']}},_0x415398,_0x2fcd54,_0x4f0399,_0x4680c1,_0x3c45d5;_0x136975=_[_0x994c('0x42')]({},_0x136975,_0x1db0c8);return db[_0x994c('0x30')]['find'](_0x136975)['then'](function(_0x412332){if(_0x412332){_0x415398=_0x412332;return _0x412332[_0x994c('0x6c')]();}return null;})[_0x994c('0x26')](function(_0x360fa4){if(_0x360fa4){if(!_0x360fa4[_0x994c('0x3a')]){throw new db[(_0x994c('0x6d'))][(_0x994c('0x6e'))](_0x994c('0x8a'),0x193);}_0x2fcd54=_0x360fa4;return db[_0x994c('0x6f')][_0x994c('0x46')]({'raw':!![]});}return null;})['then'](function(_0x46b495){if(_0x46b495){_0x4f0399=_[_0x994c('0x70')](_0x46b495,'id');var _0x3508b9;var _0x380a45=squel['select']();_0x380a45['from'](_0x415398[_0x994c('0x73')]);for(var _0x50caf6=0x0;_0x50caf6<_0x2fcd54[_0x994c('0x3a')];_0x50caf6+=0x1){_0x3508b9=_0x2fcd54[_0x50caf6]['MetricId']?_0x4f0399[_0x2fcd54[_0x50caf6][_0x994c('0x74')]]['metric']:_0x2fcd54[_0x50caf6]['field'];_0x3508b9=_0x2fcd54[_0x50caf6]['function']?_['replace'](_0x2657a6[_0x2fcd54[_0x50caf6][_0x994c('0x75')]],'%s',_0x3508b9):_0x3508b9;_0x3508b9=_0x2fcd54[_0x50caf6][_0x994c('0x76')]?_['replace'](_0x284149[_0x2fcd54[_0x50caf6][_0x994c('0x76')]],'%s',_0x3508b9):_0x3508b9;if(_0x2fcd54[_0x50caf6]['groupBy']){_0x380a45[_0x994c('0x68')](_0x3508b9);}_0x2fcd54[_0x50caf6][_0x994c('0x79')]&&_0x380a45[_0x994c('0x7a')](_0x3508b9,_0x2fcd54[_0x50caf6][_0x994c('0x79')]==='DESC'?![]:!![]);_0x380a45[_0x994c('0x6a')](_0x3508b9,_0x2fcd54[_0x50caf6][_0x994c('0x7c')]||_0x3508b9);}if(_0x415398[_0x994c('0x7d')]){_0x415398[_0x994c('0x7d')]=JSON['parse'](_0x415398[_0x994c('0x7d')]);for(var _0x50f1ac=0x0;_0x50f1ac<_0x415398[_0x994c('0x7d')][_0x994c('0x3a')];_0x50f1ac+=0x1){if(_0x415398[_0x994c('0x7d')][_0x50f1ac]['type']&&_[_0x994c('0x63')](_0x25db9c,_0x415398[_0x994c('0x7d')][_0x50f1ac][_0x994c('0x32')])&&_0x415398['joins'][_0x50f1ac][_0x994c('0x7e')]&&_0x415398[_0x994c('0x7d')][_0x50f1ac]['foreignTable']&&_0x415398[_0x994c('0x7d')][_0x50f1ac][_0x994c('0x80')]){_0x380a45[_0x415398[_0x994c('0x7d')][_0x50f1ac][_0x994c('0x32')]](_0x415398[_0x994c('0x7d')][_0x50f1ac][_0x994c('0x7f')],null,util['format']('%s.%s\x20=\x20%s.%s',_0x415398[_0x994c('0x73')],_0x415398[_0x994c('0x7d')][_0x50f1ac][_0x994c('0x7e')],_0x415398[_0x994c('0x7d')][_0x50f1ac][_0x994c('0x7f')],_0x415398['joins'][_0x50f1ac][_0x994c('0x80')]));}}}if(_0x415398[_0x994c('0x81')]){_0x415398[_0x994c('0x81')]=JSON[_0x994c('0x82')](_0x415398[_0x994c('0x81')]);_0x380a45[_0x994c('0x3d')](_0x561245(_0x415398[_0x994c('0x81')][_0x994c('0x68')]));}_0x3c45d5=_0x380a45['clone']();_0x380a45[_0x994c('0x1e')](_0x97df2b);_0x380a45['offset'](0x0);return;}})[_0x994c('0x26')](function(){if(_0x264568['output']===_0x994c('0x8b')){return null;}var _0x21b728=_[_0x994c('0x42')](_0x264568,{'name':_0x264568['fullPath']||_0x264568[_0x994c('0x2c')]||_0x415398[_0x994c('0x2c')],'basename':_0x11bf24,'savename':util[_0x994c('0x76')](_0x994c('0x8c'),_0x264568[_0x994c('0x2c')]||_0x415398[_0x994c('0x2c')],require(_0x994c('0x8d'))[_0x994c('0x8e')](0x4),_0x264568[_0x994c('0x8f')]||_0x994c('0x90')),'reportId':_0x415398['id'],'reportType':_0x994c('0x91')});return db[_0x994c('0x92')][_0x994c('0x4c')](_0x21b728,{'raw':!![]});})[_0x994c('0x26')](function(_0x1bad63){if(_0x415398['table']===_0x994c('0x93')){_0x3c45d5[_0x994c('0x3d')](_0x415398[_0x994c('0x73')]+'.calldate\x20BETWEEN\x20?\x20AND\x20?',_0x264568[_0x994c('0x94')],_0x264568[_0x994c('0x95')]);}else{_0x3c45d5[_0x994c('0x3d')](_0x415398['table']+_0x994c('0x96'),_0x264568[_0x994c('0x94')],_0x264568[_0x994c('0x95')]);}if(_0x1bad63){logger[_0x994c('0x97')]('Run\x20Query:',_0x3c45d5[_0x994c('0x86')]());require(_0x994c('0x98'))['fork'](path[_0x994c('0x89')](__dirname,_0x994c('0x99'),_0x1bad63[_0x994c('0x8f')]),[_0x1bad63['id'],_0x3c45d5['toString'](),path['join'](__dirname,_0x994c('0x9a'),_0x1bad63[_0x994c('0x9b')]),_0x11bf24]);return _0x1bad63;}else{var _0x4eaf96=squel['select']();_0x4eaf96[_0x994c('0x72')]('('+_0x3c45d5[_0x994c('0x86')]()+')',_0x994c('0x9c'));_0x4eaf96['field'](_0x994c('0x9d'),_0x994c('0x44'));_0x3c45d5[_0x994c('0x1e')](_0x264568[_0x994c('0x1e')]||_0x97df2b);_0x3c45d5[_0x994c('0x1c')](_0x264568['offset']||0x0);return dbH[_0x994c('0x87')][_0x994c('0x35')](_0x4eaf96[_0x994c('0x86')](),{'type':dbH['sequelize']['QueryTypes'][_0x994c('0x88')]})[_0x994c('0x26')](function(_0x3ae4ff){if(!_0x3ae4ff[_0x994c('0x3a')]){_0x4680c1=0x0;}else{_0x4680c1=_0x3ae4ff[0x0]['count']||0x0;}return dbH['sequelize'][_0x994c('0x35')](_0x3c45d5[_0x994c('0x86')](),{'type':dbH[_0x994c('0x87')]['QueryTypes'][_0x994c('0x88')]});})['then'](function(_0x1e9802){return{'rows':_0x1e9802||[],'count':_0x4680c1};});}});}exports[_0x994c('0x9e')]=function(_0x316804,_0x4ad2cf){return runReport(_0x316804[_0x994c('0x51')],_0x316804['query'],_0x316804['options'])['then'](respondWithResult(_0x4ad2cf,null))[_0x994c('0x48')](handleError(_0x4ad2cf,null));};exports[_0x994c('0x9f')]=runReport;exports[_0x994c('0x35')]=function(_0x141e4f,_0x2c1e53){var _0x30f23e=0xa;var _0x53a014=[_0x994c('0x89'),'left_join',_0x994c('0x54'),'cross_join'];var _0x3d6539={'SUM':_0x994c('0x55'),'COUNT':_0x994c('0x56'),'COUNT DISTINCT':'COUNT(DISTINCT\x20%s)','MAX':_0x994c('0x58'),'MIN':'MIN(%s)','AVG':_0x994c('0x5a'),'GROUP_CONCAT':'GROUP_CONCAT(%s)','GROUP_CONCAT ASC':_0x994c('0x5c'),'GROUP_CONCAT DESC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)'};var _0x22d56e={'SEC_TO_TIME':_0x994c('0x5e'),'DATE':_0x994c('0x5f'),'HOUR':_0x994c('0x60'),'ROUND':_0x994c('0x61'),'UNIX_TIMESTAMP':_0x994c('0x62')};var _0x38c958=function(_0x1d1950){return!_[_0x994c('0x63')]([_0x994c('0x64'),'IS\x20NOT\x20NULL',_0x994c('0x66'),_0x994c('0x67')],_0x1d1950);};var _0x2c340a=function(_0x5d73af){if(!_0x5d73af||!_0x5d73af['rules'][_0x994c('0x3a')]){return'';}for(var _0x2d7101='(',_0xa1a78d=0x0;_0xa1a78d<_0x5d73af[_0x994c('0x69')]['length'];_0xa1a78d+=0x1){_0xa1a78d>0x0&&(_0x2d7101+='\x20'+_0x5d73af[_0x994c('0xa0')]+'\x20');_0x2d7101+=_0x5d73af[_0x994c('0x69')][_0xa1a78d][_0x994c('0x68')]?_0x2c340a(_0x5d73af[_0x994c('0x69')][_0xa1a78d]['group']):_0x5d73af[_0x994c('0x69')][_0xa1a78d][_0x994c('0x6a')]+'\x20'+_0x5d73af[_0x994c('0x69')][_0xa1a78d][_0x994c('0x6b')]+(_0x38c958(_0x5d73af[_0x994c('0x69')][_0xa1a78d][_0x994c('0x6b')])?'\x20'+_0x5d73af[_0x994c('0x69')][_0xa1a78d]['value']:'');}return _0x2d7101+')';};var _0xfe9640={'where':{'id':_0x141e4f['params']['id']}},_0x30acda,_0x1f5ec4,_0x6acf79,_0x22cc49,_0x39f26b;_0xfe9640=_[_0x994c('0x42')]({},_0xfe9640,_0x141e4f['options']);return db[_0x994c('0x30')][_0x994c('0x50')](_0xfe9640)[_0x994c('0x26')](function(_0x17429c){if(_0x17429c){_0x30acda=_0x17429c;return _0x17429c[_0x994c('0x6c')]();}return null;})[_0x994c('0x26')](function(_0x1f7a70){if(_0x1f7a70){if(!_0x1f7a70[_0x994c('0x3a')]){throw new db[(_0x994c('0x6d'))][(_0x994c('0x6e'))]('Please\x20insert\x20at\x20least\x20one\x20field',0x193);}_0x1f5ec4=_0x1f7a70;return db[_0x994c('0x6f')][_0x994c('0x46')]({'raw':!![]});}return null;})['then'](function(_0x506938){if(_0x506938){_0x6acf79=_[_0x994c('0x70')](_0x506938,'id');var _0x146b1e;var _0x2cfe95=squel['select']();_0x2cfe95[_0x994c('0x72')](_0x30acda[_0x994c('0x73')]);for(var _0x5a9798=0x0;_0x5a9798<_0x1f5ec4[_0x994c('0x3a')];_0x5a9798+=0x1){_0x146b1e=_0x1f5ec4[_0x5a9798][_0x994c('0x74')]?_0x6acf79[_0x1f5ec4[_0x5a9798]['MetricId']]['metric']:_0x1f5ec4[_0x5a9798][_0x994c('0x6a')];_0x146b1e=_0x1f5ec4[_0x5a9798][_0x994c('0x75')]?_[_0x994c('0x77')](_0x3d6539[_0x1f5ec4[_0x5a9798][_0x994c('0x75')]],'%s',_0x146b1e):_0x146b1e;_0x146b1e=_0x1f5ec4[_0x5a9798][_0x994c('0x76')]?_[_0x994c('0x77')](_0x22d56e[_0x1f5ec4[_0x5a9798]['format']],'%s',_0x146b1e):_0x146b1e;if(_0x1f5ec4[_0x5a9798][_0x994c('0x78')]){_0x2cfe95['group'](_0x146b1e);}_0x1f5ec4[_0x5a9798]['orderBy']&&_0x2cfe95[_0x994c('0x7a')](_0x146b1e,_0x1f5ec4[_0x5a9798][_0x994c('0x79')]==='DESC'?![]:!![]);_0x2cfe95[_0x994c('0x6a')](_0x146b1e,_0x1f5ec4[_0x5a9798][_0x994c('0x7c')]||_0x146b1e);}if(_0x30acda[_0x994c('0x7d')]){_0x30acda[_0x994c('0x7d')]=JSON[_0x994c('0x82')](_0x30acda[_0x994c('0x7d')]);for(var _0x50e942=0x0;_0x50e942<_0x30acda['joins']['length'];_0x50e942+=0x1){if(_0x30acda['joins'][_0x50e942][_0x994c('0x32')]&&_[_0x994c('0x63')](_0x53a014,_0x30acda['joins'][_0x50e942][_0x994c('0x32')])&&_0x30acda['joins'][_0x50e942][_0x994c('0x7e')]&&_0x30acda['joins'][_0x50e942][_0x994c('0x7f')]&&_0x30acda[_0x994c('0x7d')][_0x50e942]['foreignKey']){_0x2cfe95[_0x30acda[_0x994c('0x7d')][_0x50e942]['type']](_0x30acda[_0x994c('0x7d')][_0x50e942][_0x994c('0x7f')],null,util[_0x994c('0x76')](_0x994c('0xa1'),_0x30acda[_0x994c('0x73')],_0x30acda[_0x994c('0x7d')][_0x50e942][_0x994c('0x7e')],_0x30acda[_0x994c('0x7d')][_0x50e942][_0x994c('0x7f')],_0x30acda[_0x994c('0x7d')][_0x50e942]['foreignKey']));}}}if(_0x30acda['conditions']){_0x30acda[_0x994c('0x81')]=JSON[_0x994c('0x82')](_0x30acda[_0x994c('0x81')]);_0x2cfe95[_0x994c('0x3d')](_0x2c340a(_0x30acda[_0x994c('0x81')][_0x994c('0x68')]));}_0x39f26b=_0x2cfe95[_0x994c('0x83')]();_0x2cfe95['limit'](_0x30f23e);_0x2cfe95[_0x994c('0x1c')](0x0);logger[_0x994c('0x84')](_0x994c('0x85'),_0x2cfe95[_0x994c('0x86')]());return dbH[_0x994c('0x87')]['query'](_0x2cfe95[_0x994c('0x86')](),{'type':dbH[_0x994c('0x87')]['QueryTypes']['SELECT']});}})[_0x994c('0x26')](function(){return{'sql':_0x39f26b[_0x994c('0x86')]()};})['then'](respondWithResult(_0x2c1e53,null))[_0x994c('0x48')](handleError(_0x2c1e53,null));};
\ No newline at end of file
+var _0x5292=['UserProfileSection','find','userProfileId','autoAssociation','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','preview','join','cross_join','COUNT(%s)','MAX(%s)','MIN(%s)','AVG(%s)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)','SEC_TO_TIME(%s)','ROUND(%s)','UNIX_TIMESTAMP(%s)','includes','IS\x20NULL','IS\x20EMPTY','IS\x20NOT\x20EMPTY','operator','rules','group','field','condition','value','getFields','Sequelize','Please\x20insert\x20at\x20least\x20one\x20field','AnalyticMetric','keyBy','from','table','MetricId','metric','replace','function','format','groupBy','orderBy','DESC','joins','parentKey','foreignKey','foreignTable','%s.%s\x20=\x20%s.%s','conditions','parse','clone','debug','Limited\x20Query:','toString','sequelize','QueryTypes','right_join','COUNT(DISTINCT\x20%s)','GROUP_CONCAT(%s)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','DATE(%s)','HOUR(%s)','IS\x20NOT\x20NULL','merge','ValidationErrorItem','select','alias','output','web','fullPath','%s-%s.%s','generate','csv','custom','AnalyticExtractedReport','create','.calldate\x20BETWEEN\x20?\x20AND\x20?','startDate','.createdAt\x20BETWEEN\x20?\x20AND\x20?','endDate','info','Run\x20Query:','child_process','fork','../../components/export/','../../files/reports','savename','COUNT(*)','SELECT','runReport','left_join','SUM(%s)','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../mysqldb','dbH','sendStatus','end','offset','undefined','count','limit','status','set','Content-Range','json','apply','save','then','destroy','get','CustomReports','UserProfileResource','stack','name','index','map','rawAttributes','fieldName','type','model','query','keys','filters','attributes','intersection','fields','length','nolimit','order','sort','where','pick','filter','VIRTUAL','options','AnalyticCustomReport','includeAll','include','findAll','rows','catch','show','params','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','Reports'];(function(_0x58afd5,_0x534a48){var _0x3e503b=function(_0x27ba44){while(--_0x27ba44){_0x58afd5['push'](_0x58afd5['shift']());}};_0x3e503b(++_0x534a48);}(_0x5292,0x105));var _0x2529=function(_0x8051d7,_0x263ba9){_0x8051d7=_0x8051d7-0x0;var _0x3fb835=_0x5292[_0x8051d7];return _0x3fb835;};'use strict';var emlformat=require(_0x2529('0x0'));var rimraf=require(_0x2529('0x1'));var zipdir=require(_0x2529('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x2529('0x3'));var moment=require(_0x2529('0x4'));var BPromise=require(_0x2529('0x5'));var Mustache=require(_0x2529('0x6'));var util=require(_0x2529('0x7'));var path=require(_0x2529('0x8'));var sox=require(_0x2529('0x9'));var csv=require(_0x2529('0xa'));var ejs=require(_0x2529('0xb'));var fs=require('fs');var fs_extra=require(_0x2529('0xc'));var _=require(_0x2529('0xd'));var squel=require(_0x2529('0xe'));var crypto=require('crypto');var jsforce=require(_0x2529('0xf'));var deskjs=require(_0x2529('0x10'));var toCsv=require(_0x2529('0xa'));var querystring=require(_0x2529('0x11'));var Papa=require(_0x2529('0x12'));var Redis=require(_0x2529('0x13'));var authService=require(_0x2529('0x14'));var qs=require('../../components/parsers/qs');var as=require(_0x2529('0x15'));var hardwareService=require(_0x2529('0x16'));var logger=require(_0x2529('0x17'))('api');var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0x2529('0x18'))['db'];var dbH=require(_0x2529('0x18'))[_0x2529('0x19')];function respondWithStatusCode(_0x597ae1,_0x4e0d8f){_0x4e0d8f=_0x4e0d8f||0xcc;return function(_0x3c4a8b){if(_0x3c4a8b){return _0x597ae1[_0x2529('0x1a')](_0x4e0d8f);}return _0x597ae1['status'](_0x4e0d8f)[_0x2529('0x1b')]();};}function respondWithResult(_0x5bdf46,_0x40f6b4){_0x40f6b4=_0x40f6b4||0xc8;return function(_0x34bf27){if(_0x34bf27){return _0x5bdf46['status'](_0x40f6b4)['json'](_0x34bf27);}};}function respondWithFilteredResult(_0x2ac5f6,_0x4a81c3){return function(_0x30ca6c){if(_0x30ca6c){var _0x4ebc59=typeof _0x4a81c3[_0x2529('0x1c')]===_0x2529('0x1d')&&typeof _0x4a81c3['limit']==='undefined';var _0x223ccd=_0x30ca6c['count'];var _0x270429=_0x4ebc59?0x0:_0x4a81c3[_0x2529('0x1c')];var _0x1166f2=_0x4ebc59?_0x30ca6c[_0x2529('0x1e')]:_0x4a81c3['offset']+_0x4a81c3[_0x2529('0x1f')];var _0x3f688a;if(_0x1166f2>=_0x223ccd){_0x1166f2=_0x223ccd;_0x3f688a=0xc8;}else{_0x3f688a=0xce;}_0x2ac5f6[_0x2529('0x20')](_0x3f688a);return _0x2ac5f6[_0x2529('0x21')](_0x2529('0x22'),_0x270429+'-'+_0x1166f2+'/'+_0x223ccd)[_0x2529('0x23')](_0x30ca6c);}return null;};}function patchUpdates(_0x9f8f92){return function(_0x3fa315){try{jsonpatch[_0x2529('0x24')](_0x3fa315,_0x9f8f92,!![]);}catch(_0x5e8009){return BPromise['reject'](_0x5e8009);}return _0x3fa315[_0x2529('0x25')]();};}function saveUpdates(_0x43312b,_0x2f6b61){return function(_0x218603){if(_0x218603){return _0x218603['update'](_0x43312b)[_0x2529('0x26')](function(_0x74066b){return _0x74066b;});}return null;};}function removeEntity(_0x1eca6b,_0x1d5414){return function(_0x307c04){if(_0x307c04){return _0x307c04[_0x2529('0x27')]()['then'](function(){var _0x43f6f9=_0x307c04[_0x2529('0x28')]({'plain':!![]});var _0x38cc6c=_0x2529('0x29');return db[_0x2529('0x2a')][_0x2529('0x27')]({'where':{'type':_0x38cc6c,'resourceId':_0x43f6f9['id']}})['then'](function(){return _0x307c04;});})[_0x2529('0x26')](function(){_0x1eca6b[_0x2529('0x20')](0xcc)[_0x2529('0x1b')]();});}};}function handleEntityNotFound(_0xf04ce9,_0x354fe9){return function(_0x9e3d9b){if(!_0x9e3d9b){_0xf04ce9['sendStatus'](0x194);}return _0x9e3d9b;};}function handleError(_0x2f9923,_0x2c32e4){_0x2c32e4=_0x2c32e4||0x1f4;return function(_0x5ed0ff){logger['error'](_0x5ed0ff[_0x2529('0x2b')]);if(_0x5ed0ff[_0x2529('0x2c')]){delete _0x5ed0ff['name'];}_0x2f9923[_0x2529('0x20')](_0x2c32e4)['send'](_0x5ed0ff);};}exports[_0x2529('0x2d')]=function(_0x2174ff,_0x3e73c5){var _0x2ba771={},_0x123962={},_0x268b8e={'count':0x0,'rows':[]};var _0x5f052f=_[_0x2529('0x2e')](db['AnalyticCustomReport'][_0x2529('0x2f')],function(_0x56d34d){return{'name':_0x56d34d[_0x2529('0x30')],'type':_0x56d34d[_0x2529('0x31')]['key']};});_0x123962[_0x2529('0x32')]=_['map'](_0x5f052f,_0x2529('0x2c'));_0x123962[_0x2529('0x33')]=_[_0x2529('0x34')](_0x2174ff[_0x2529('0x33')]);_0x123962[_0x2529('0x35')]=_['intersection'](_0x123962[_0x2529('0x32')],_0x123962[_0x2529('0x33')]);_0x2ba771[_0x2529('0x36')]=_[_0x2529('0x37')](_0x123962[_0x2529('0x32')],qs[_0x2529('0x38')](_0x2174ff['query'][_0x2529('0x38')]));_0x2ba771[_0x2529('0x36')]=_0x2ba771[_0x2529('0x36')][_0x2529('0x39')]?_0x2ba771[_0x2529('0x36')]:_0x123962[_0x2529('0x32')];if(!_0x2174ff['query']['hasOwnProperty'](_0x2529('0x3a'))){_0x2ba771[_0x2529('0x1f')]=qs[_0x2529('0x1f')](_0x2174ff[_0x2529('0x33')][_0x2529('0x1f')]);_0x2ba771[_0x2529('0x1c')]=qs[_0x2529('0x1c')](_0x2174ff[_0x2529('0x33')][_0x2529('0x1c')]);}_0x2ba771[_0x2529('0x3b')]=qs['sort'](_0x2174ff[_0x2529('0x33')][_0x2529('0x3c')]);_0x2ba771[_0x2529('0x3d')]=qs[_0x2529('0x35')](_[_0x2529('0x3e')](_0x2174ff['query'],_0x123962[_0x2529('0x35')]),_0x5f052f);if(_0x2174ff['query'][_0x2529('0x3f')]){_0x2ba771['where']=_['merge'](_0x2ba771[_0x2529('0x3d')],{'$or':_['map'](_0x5f052f,function(_0x5c621c){if(_0x5c621c[_0x2529('0x31')]!==_0x2529('0x40')){var _0x427184={};_0x427184[_0x5c621c['name']]={'$like':'%'+_0x2174ff[_0x2529('0x33')][_0x2529('0x3f')]+'%'};return _0x427184;}})});}_0x2ba771=_['merge']({},_0x2ba771,_0x2174ff[_0x2529('0x41')]);var _0x304110={'where':_0x2ba771[_0x2529('0x3d')]};return db[_0x2529('0x42')][_0x2529('0x1e')](_0x304110)[_0x2529('0x26')](function(_0x5af23d){_0x268b8e[_0x2529('0x1e')]=_0x5af23d;if(_0x2174ff[_0x2529('0x33')][_0x2529('0x43')]){_0x2ba771[_0x2529('0x44')]=[{'all':!![]}];}return db[_0x2529('0x42')][_0x2529('0x45')](_0x2ba771);})[_0x2529('0x26')](function(_0x4a53eb){_0x268b8e[_0x2529('0x46')]=_0x4a53eb;return _0x268b8e;})[_0x2529('0x26')](respondWithFilteredResult(_0x3e73c5,_0x2ba771))[_0x2529('0x47')](handleError(_0x3e73c5,null));};exports[_0x2529('0x48')]=function(_0x4fa47b,_0x36c7eb){var _0x5a57c6={'raw':![],'where':{'id':_0x4fa47b[_0x2529('0x49')]['id']}},_0xc6260e={};_0xc6260e[_0x2529('0x32')]=_[_0x2529('0x34')](db[_0x2529('0x42')][_0x2529('0x2f')]);_0xc6260e[_0x2529('0x33')]=_[_0x2529('0x34')](_0x4fa47b[_0x2529('0x33')]);_0xc6260e[_0x2529('0x35')]=_[_0x2529('0x37')](_0xc6260e[_0x2529('0x32')],_0xc6260e[_0x2529('0x33')]);_0x5a57c6[_0x2529('0x36')]=_['intersection'](_0xc6260e[_0x2529('0x32')],qs[_0x2529('0x38')](_0x4fa47b['query']['fields']));_0x5a57c6['attributes']=_0x5a57c6[_0x2529('0x36')]['length']?_0x5a57c6[_0x2529('0x36')]:_0xc6260e[_0x2529('0x32')];if(_0x4fa47b[_0x2529('0x33')][_0x2529('0x43')]){_0x5a57c6[_0x2529('0x44')]=[{'all':!![]}];}_0x5a57c6=_['merge']({},_0x5a57c6,_0x4fa47b['options']);return db[_0x2529('0x42')]['find'](_0x5a57c6)[_0x2529('0x26')](handleEntityNotFound(_0x36c7eb,null))[_0x2529('0x26')](respondWithResult(_0x36c7eb,null))['catch'](handleError(_0x36c7eb,null));};exports['create']=function(_0x303069,_0x1466eb){return db[_0x2529('0x42')]['create'](_0x303069[_0x2529('0x4a')],{})[_0x2529('0x26')](function(_0x1eec0f){var _0x3feec7=_0x303069[_0x2529('0x4b')][_0x2529('0x28')]({'plain':!![]});if(!_0x3feec7)throw new Error(_0x2529('0x4c'));if(_0x3feec7[_0x2529('0x4d')]===_0x2529('0x4b')){var _0x7bd364=_0x1eec0f[_0x2529('0x28')]({'plain':!![]});var _0x4fc51e=_0x2529('0x4e');return db[_0x2529('0x4f')][_0x2529('0x50')]({'where':{'name':_0x4fc51e,'userProfileId':_0x3feec7[_0x2529('0x51')]},'raw':!![]})['then'](function(_0x30c825){if(_0x30c825&&_0x30c825[_0x2529('0x52')]===0x0){return db[_0x2529('0x2a')]['create']({'name':_0x7bd364[_0x2529('0x2c')],'resourceId':_0x7bd364['id'],'type':'CustomReports','sectionId':_0x30c825['id']},{})[_0x2529('0x26')](function(){return _0x1eec0f;});}else{return _0x1eec0f;}})[_0x2529('0x47')](function(_0x269821){logger[_0x2529('0x53')](_0x2529('0x54'),_0x269821);throw _0x269821;});}return _0x1eec0f;})[_0x2529('0x26')](respondWithResult(_0x1466eb,0xc9))[_0x2529('0x47')](handleError(_0x1466eb,null));};exports['update']=function(_0x5abbd1,_0x136eb4){if(_0x5abbd1[_0x2529('0x4a')]['id']){delete _0x5abbd1[_0x2529('0x4a')]['id'];}return db['AnalyticCustomReport'][_0x2529('0x50')]({'where':{'id':_0x5abbd1[_0x2529('0x49')]['id']}})[_0x2529('0x26')](handleEntityNotFound(_0x136eb4,null))[_0x2529('0x26')](saveUpdates(_0x5abbd1[_0x2529('0x4a')],null))[_0x2529('0x26')](respondWithResult(_0x136eb4,null))[_0x2529('0x47')](handleError(_0x136eb4,null));};exports[_0x2529('0x27')]=function(_0x5edf9c,_0x1194cf){return db[_0x2529('0x42')][_0x2529('0x50')]({'where':{'id':_0x5edf9c[_0x2529('0x49')]['id']}})['then'](handleEntityNotFound(_0x1194cf,null))['then'](removeEntity(_0x1194cf,null))[_0x2529('0x47')](handleError(_0x1194cf,null));};exports[_0x2529('0x55')]=function(_0x55733a,_0x2f78e6){var _0x5412f9=0xa;var _0x3ee888=[_0x2529('0x56'),'left_join','right_join',_0x2529('0x57')];var _0x57093f={'SUM':'SUM(%s)','COUNT':_0x2529('0x58'),'COUNT DISTINCT':'COUNT(DISTINCT\x20%s)','MAX':_0x2529('0x59'),'MIN':_0x2529('0x5a'),'AVG':_0x2529('0x5b'),'GROUP_CONCAT':'GROUP_CONCAT(%s)','GROUP_CONCAT ASC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT DESC':_0x2529('0x5c')};var _0x144e57={'SEC_TO_TIME':_0x2529('0x5d'),'DATE':'DATE(%s)','HOUR':'HOUR(%s)','ROUND':_0x2529('0x5e'),'UNIX_TIMESTAMP':_0x2529('0x5f')};var _0x258ab5=function(_0x3ed085){return!_[_0x2529('0x60')]([_0x2529('0x61'),'IS\x20NOT\x20NULL',_0x2529('0x62'),_0x2529('0x63')],_0x3ed085);};var _0x41119b=function(_0x4318c2){if(!_0x4318c2||!_0x4318c2['rules']['length']){return'';}for(var _0x21ed36='(',_0x3f5e38=0x0;_0x3f5e38<_0x4318c2['rules']['length'];_0x3f5e38+=0x1){_0x3f5e38>0x0&&(_0x21ed36+='\x20'+_0x4318c2[_0x2529('0x64')]+'\x20');_0x21ed36+=_0x4318c2[_0x2529('0x65')][_0x3f5e38][_0x2529('0x66')]?_0x41119b(_0x4318c2[_0x2529('0x65')][_0x3f5e38]['group']):_0x4318c2[_0x2529('0x65')][_0x3f5e38][_0x2529('0x67')]+'\x20'+_0x4318c2[_0x2529('0x65')][_0x3f5e38][_0x2529('0x68')]+(_0x258ab5(_0x4318c2[_0x2529('0x65')][_0x3f5e38]['condition'])?'\x20'+_0x4318c2[_0x2529('0x65')][_0x3f5e38][_0x2529('0x69')]:'');}return _0x21ed36+')';};var _0x59cf66={'where':{'id':_0x55733a[_0x2529('0x49')]['id']}},_0x589782,_0x31a4f3,_0x303607,_0x5f0a85,_0x5ce4b1;_0x59cf66=_['merge']({},_0x59cf66,_0x55733a[_0x2529('0x41')]);return db[_0x2529('0x42')][_0x2529('0x50')](_0x59cf66)['then'](function(_0x397cc3){if(_0x397cc3){_0x589782=_0x397cc3;return _0x397cc3[_0x2529('0x6a')]();}return null;})[_0x2529('0x26')](function(_0x3ac507){if(_0x3ac507){if(!_0x3ac507[_0x2529('0x39')]){throw new db[(_0x2529('0x6b'))]['ValidationErrorItem'](_0x2529('0x6c'),0x193);}_0x31a4f3=_0x3ac507;return db[_0x2529('0x6d')][_0x2529('0x45')]({'raw':!![]});}return null;})[_0x2529('0x26')](function(_0x21b4e1){if(_0x21b4e1){_0x303607=_[_0x2529('0x6e')](_0x21b4e1,'id');var _0x119937;var _0x280d5f=squel['select']();_0x280d5f[_0x2529('0x6f')](_0x589782[_0x2529('0x70')]);for(var _0x566de1=0x0;_0x566de1<_0x31a4f3[_0x2529('0x39')];_0x566de1+=0x1){_0x119937=_0x31a4f3[_0x566de1][_0x2529('0x71')]?_0x303607[_0x31a4f3[_0x566de1][_0x2529('0x71')]][_0x2529('0x72')]:_0x31a4f3[_0x566de1][_0x2529('0x67')];_0x119937=_0x31a4f3[_0x566de1]['function']?_[_0x2529('0x73')](_0x57093f[_0x31a4f3[_0x566de1][_0x2529('0x74')]],'%s',_0x119937):_0x119937;_0x119937=_0x31a4f3[_0x566de1][_0x2529('0x75')]?_['replace'](_0x144e57[_0x31a4f3[_0x566de1][_0x2529('0x75')]],'%s',_0x119937):_0x119937;if(_0x31a4f3[_0x566de1][_0x2529('0x76')]){_0x280d5f[_0x2529('0x66')](_0x119937);}_0x31a4f3[_0x566de1]['orderBy']&&_0x280d5f[_0x2529('0x3b')](_0x119937,_0x31a4f3[_0x566de1][_0x2529('0x77')]===_0x2529('0x78')?![]:!![]);_0x280d5f['field'](_0x119937,_0x31a4f3[_0x566de1]['alias']||_0x119937);}if(_0x589782['joins']){_0x589782[_0x2529('0x79')]=JSON['parse'](_0x589782['joins']);for(var _0x3651c5=0x0;_0x3651c5<_0x589782['joins']['length'];_0x3651c5+=0x1){if(_0x589782['joins'][_0x3651c5][_0x2529('0x31')]&&_[_0x2529('0x60')](_0x3ee888,_0x589782[_0x2529('0x79')][_0x3651c5][_0x2529('0x31')])&&_0x589782[_0x2529('0x79')][_0x3651c5][_0x2529('0x7a')]&&_0x589782[_0x2529('0x79')][_0x3651c5]['foreignTable']&&_0x589782[_0x2529('0x79')][_0x3651c5][_0x2529('0x7b')]){_0x280d5f[_0x589782['joins'][_0x3651c5]['type']](_0x589782[_0x2529('0x79')][_0x3651c5][_0x2529('0x7c')],null,util[_0x2529('0x75')](_0x2529('0x7d'),_0x589782[_0x2529('0x70')],_0x589782[_0x2529('0x79')][_0x3651c5]['parentKey'],_0x589782['joins'][_0x3651c5][_0x2529('0x7c')],_0x589782[_0x2529('0x79')][_0x3651c5][_0x2529('0x7b')]));}}}if(_0x589782['conditions']){_0x589782[_0x2529('0x7e')]=JSON[_0x2529('0x7f')](_0x589782[_0x2529('0x7e')]);_0x280d5f[_0x2529('0x3d')](_0x41119b(_0x589782[_0x2529('0x7e')]['group']));}_0x5ce4b1=_0x280d5f[_0x2529('0x80')]();_0x280d5f[_0x2529('0x1f')](_0x5412f9);_0x280d5f[_0x2529('0x1c')](0x0);logger[_0x2529('0x81')](_0x2529('0x82'),_0x280d5f[_0x2529('0x83')]());return dbH['sequelize'][_0x2529('0x33')](_0x280d5f['toString'](),{'type':dbH[_0x2529('0x84')][_0x2529('0x85')]['SELECT']});}})['then'](respondWithResult(_0x2f78e6,null))[_0x2529('0x47')](handleError(_0x2f78e6,null));};function runReport(_0x3d3daa,_0x159dbb,_0x4dc04d){var _0x2c8430=_0x159dbb[_0x2529('0x2c')];var _0x22d147=0xa;var _0x463bca=[_0x2529('0x56'),'left_join',_0x2529('0x86'),_0x2529('0x57')];var _0x3843a1={'SUM':'SUM(%s)','COUNT':_0x2529('0x58'),'COUNT DISTINCT':_0x2529('0x87'),'MAX':_0x2529('0x59'),'MIN':_0x2529('0x5a'),'AVG':'AVG(%s)','GROUP_CONCAT':_0x2529('0x88'),'GROUP_CONCAT ASC':_0x2529('0x89'),'GROUP_CONCAT DESC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)'};var _0x7eee87={'SEC_TO_TIME':_0x2529('0x5d'),'DATE':_0x2529('0x8a'),'HOUR':_0x2529('0x8b'),'ROUND':_0x2529('0x5e'),'UNIX_TIMESTAMP':_0x2529('0x5f')};var _0x21f9c1=function(_0x2c5f3f){return!_[_0x2529('0x60')](['IS\x20NULL',_0x2529('0x8c'),_0x2529('0x62'),_0x2529('0x63')],_0x2c5f3f);};var _0x2267fc=function(_0x40b22b){if(!_0x40b22b||!_0x40b22b[_0x2529('0x65')]['length']){return'';}for(var _0x21375c='(',_0x41eefc=0x0;_0x41eefc<_0x40b22b[_0x2529('0x65')]['length'];_0x41eefc+=0x1){_0x41eefc>0x0&&(_0x21375c+='\x20'+_0x40b22b[_0x2529('0x64')]+'\x20');_0x21375c+=_0x40b22b[_0x2529('0x65')][_0x41eefc][_0x2529('0x66')]?_0x2267fc(_0x40b22b[_0x2529('0x65')][_0x41eefc][_0x2529('0x66')]):_0x40b22b['rules'][_0x41eefc][_0x2529('0x67')]+'\x20'+_0x40b22b[_0x2529('0x65')][_0x41eefc][_0x2529('0x68')]+(_0x21f9c1(_0x40b22b[_0x2529('0x65')][_0x41eefc][_0x2529('0x68')])?'\x20'+_0x40b22b[_0x2529('0x65')][_0x41eefc][_0x2529('0x69')]:'');}return _0x21375c+')';};var _0x461c79={'where':{'id':_0x3d3daa['id']}},_0x1de417,_0x400b82,_0x31a624,_0x1c29c5,_0x4a6992;_0x461c79=_[_0x2529('0x8d')]({},_0x461c79,_0x4dc04d);return db[_0x2529('0x42')][_0x2529('0x50')](_0x461c79)[_0x2529('0x26')](function(_0x33876b){if(_0x33876b){_0x1de417=_0x33876b;return _0x33876b['getFields']();}return null;})[_0x2529('0x26')](function(_0x1cbb18){if(_0x1cbb18){if(!_0x1cbb18[_0x2529('0x39')]){throw new db[(_0x2529('0x6b'))][(_0x2529('0x8e'))](_0x2529('0x6c'),0x193);}_0x400b82=_0x1cbb18;return db[_0x2529('0x6d')]['findAll']({'raw':!![]});}return null;})[_0x2529('0x26')](function(_0x8cb2b7){if(_0x8cb2b7){_0x31a624=_[_0x2529('0x6e')](_0x8cb2b7,'id');var _0xa5a61;var _0x165f8d=squel[_0x2529('0x8f')]();_0x165f8d[_0x2529('0x6f')](_0x1de417[_0x2529('0x70')]);for(var _0x505a5c=0x0;_0x505a5c<_0x400b82[_0x2529('0x39')];_0x505a5c+=0x1){_0xa5a61=_0x400b82[_0x505a5c][_0x2529('0x71')]?_0x31a624[_0x400b82[_0x505a5c][_0x2529('0x71')]][_0x2529('0x72')]:_0x400b82[_0x505a5c][_0x2529('0x67')];_0xa5a61=_0x400b82[_0x505a5c]['function']?_[_0x2529('0x73')](_0x3843a1[_0x400b82[_0x505a5c]['function']],'%s',_0xa5a61):_0xa5a61;_0xa5a61=_0x400b82[_0x505a5c][_0x2529('0x75')]?_[_0x2529('0x73')](_0x7eee87[_0x400b82[_0x505a5c][_0x2529('0x75')]],'%s',_0xa5a61):_0xa5a61;if(_0x400b82[_0x505a5c][_0x2529('0x76')]){_0x165f8d['group'](_0xa5a61);}_0x400b82[_0x505a5c][_0x2529('0x77')]&&_0x165f8d[_0x2529('0x3b')](_0xa5a61,_0x400b82[_0x505a5c][_0x2529('0x77')]===_0x2529('0x78')?![]:!![]);_0x165f8d['field'](_0xa5a61,_0x400b82[_0x505a5c][_0x2529('0x90')]||_0xa5a61);}if(_0x1de417[_0x2529('0x79')]){_0x1de417['joins']=JSON[_0x2529('0x7f')](_0x1de417[_0x2529('0x79')]);for(var _0xd53c1e=0x0;_0xd53c1e<_0x1de417['joins'][_0x2529('0x39')];_0xd53c1e+=0x1){if(_0x1de417[_0x2529('0x79')][_0xd53c1e][_0x2529('0x31')]&&_[_0x2529('0x60')](_0x463bca,_0x1de417[_0x2529('0x79')][_0xd53c1e][_0x2529('0x31')])&&_0x1de417[_0x2529('0x79')][_0xd53c1e]['parentKey']&&_0x1de417[_0x2529('0x79')][_0xd53c1e][_0x2529('0x7c')]&&_0x1de417[_0x2529('0x79')][_0xd53c1e][_0x2529('0x7b')]){_0x165f8d[_0x1de417[_0x2529('0x79')][_0xd53c1e][_0x2529('0x31')]](_0x1de417[_0x2529('0x79')][_0xd53c1e][_0x2529('0x7c')],null,util[_0x2529('0x75')](_0x2529('0x7d'),_0x1de417[_0x2529('0x70')],_0x1de417['joins'][_0xd53c1e][_0x2529('0x7a')],_0x1de417[_0x2529('0x79')][_0xd53c1e][_0x2529('0x7c')],_0x1de417[_0x2529('0x79')][_0xd53c1e][_0x2529('0x7b')]));}}}if(_0x1de417[_0x2529('0x7e')]){_0x1de417[_0x2529('0x7e')]=JSON[_0x2529('0x7f')](_0x1de417[_0x2529('0x7e')]);_0x165f8d[_0x2529('0x3d')](_0x2267fc(_0x1de417['conditions'][_0x2529('0x66')]));}_0x4a6992=_0x165f8d[_0x2529('0x80')]();_0x165f8d[_0x2529('0x1f')](_0x22d147);_0x165f8d['offset'](0x0);return;}})[_0x2529('0x26')](function(){if(_0x159dbb[_0x2529('0x91')]===_0x2529('0x92')){return null;}var _0x36a235=_[_0x2529('0x8d')](_0x159dbb,{'name':_0x159dbb[_0x2529('0x93')]||_0x159dbb['name']||_0x1de417[_0x2529('0x2c')],'basename':_0x2c8430,'savename':util[_0x2529('0x75')](_0x2529('0x94'),_0x159dbb[_0x2529('0x2c')]||_0x1de417['name'],require('randomstring')[_0x2529('0x95')](0x4),_0x159dbb[_0x2529('0x91')]||_0x2529('0x96')),'reportId':_0x1de417['id'],'reportType':_0x2529('0x97')});return db[_0x2529('0x98')][_0x2529('0x99')](_0x36a235,{'raw':!![]});})[_0x2529('0x26')](function(_0x2974ee){if(_0x1de417[_0x2529('0x70')]==='cdr'){_0x4a6992[_0x2529('0x3d')](_0x1de417[_0x2529('0x70')]+_0x2529('0x9a'),_0x159dbb[_0x2529('0x9b')],_0x159dbb['endDate']);}else{_0x4a6992[_0x2529('0x3d')](_0x1de417[_0x2529('0x70')]+_0x2529('0x9c'),_0x159dbb[_0x2529('0x9b')],_0x159dbb[_0x2529('0x9d')]);}if(_0x2974ee){logger[_0x2529('0x9e')](_0x2529('0x9f'),_0x4a6992[_0x2529('0x83')]());require(_0x2529('0xa0'))[_0x2529('0xa1')](path[_0x2529('0x56')](__dirname,_0x2529('0xa2'),_0x2974ee['output']),[_0x2974ee['id'],_0x4a6992[_0x2529('0x83')](),path['join'](__dirname,_0x2529('0xa3'),_0x2974ee[_0x2529('0xa4')]),_0x2c8430]);return _0x2974ee;}else{var _0x37491a=squel[_0x2529('0x8f')]();_0x37491a[_0x2529('0x6f')]('('+_0x4a6992[_0x2529('0x83')]()+')','countTable');_0x37491a['field'](_0x2529('0xa5'),_0x2529('0x1e'));_0x4a6992[_0x2529('0x1f')](_0x159dbb[_0x2529('0x1f')]||_0x22d147);_0x4a6992['offset'](_0x159dbb['offset']||0x0);return dbH['sequelize']['query'](_0x37491a[_0x2529('0x83')](),{'type':dbH[_0x2529('0x84')]['QueryTypes']['SELECT']})[_0x2529('0x26')](function(_0x1ae72e){if(!_0x1ae72e[_0x2529('0x39')]){_0x1c29c5=0x0;}else{_0x1c29c5=_0x1ae72e[0x0][_0x2529('0x1e')]||0x0;}return dbH[_0x2529('0x84')]['query'](_0x4a6992['toString'](),{'type':dbH[_0x2529('0x84')][_0x2529('0x85')][_0x2529('0xa6')]});})[_0x2529('0x26')](function(_0x2496a9){return{'rows':_0x2496a9||[],'count':_0x1c29c5};});}});}exports['run']=function(_0x5accd3,_0x1f4f94){return runReport(_0x5accd3[_0x2529('0x49')],_0x5accd3[_0x2529('0x33')],_0x5accd3[_0x2529('0x41')])[_0x2529('0x26')](respondWithResult(_0x1f4f94,null))[_0x2529('0x47')](handleError(_0x1f4f94,null));};exports[_0x2529('0xa7')]=runReport;exports[_0x2529('0x33')]=function(_0x10d943,_0x4c3da8){var _0x17bbf3=0xa;var _0x329928=[_0x2529('0x56'),_0x2529('0xa8'),_0x2529('0x86'),_0x2529('0x57')];var _0x145df3={'SUM':_0x2529('0xa9'),'COUNT':_0x2529('0x58'),'COUNT DISTINCT':_0x2529('0x87'),'MAX':_0x2529('0x59'),'MIN':_0x2529('0x5a'),'AVG':_0x2529('0x5b'),'GROUP_CONCAT':_0x2529('0x88'),'GROUP_CONCAT ASC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT DESC':_0x2529('0x5c')};var _0x1bb5e3={'SEC_TO_TIME':'SEC_TO_TIME(%s)','DATE':_0x2529('0x8a'),'HOUR':_0x2529('0x8b'),'ROUND':_0x2529('0x5e'),'UNIX_TIMESTAMP':_0x2529('0x5f')};var _0x802412=function(_0x135571){return!_['includes']([_0x2529('0x61'),_0x2529('0x8c'),'IS\x20EMPTY',_0x2529('0x63')],_0x135571);};var _0x5b288b=function(_0x34c249){if(!_0x34c249||!_0x34c249[_0x2529('0x65')][_0x2529('0x39')]){return'';}for(var _0x19aaea='(',_0xa7ec40=0x0;_0xa7ec40<_0x34c249[_0x2529('0x65')][_0x2529('0x39')];_0xa7ec40+=0x1){_0xa7ec40>0x0&&(_0x19aaea+='\x20'+_0x34c249[_0x2529('0x64')]+'\x20');_0x19aaea+=_0x34c249[_0x2529('0x65')][_0xa7ec40][_0x2529('0x66')]?_0x5b288b(_0x34c249['rules'][_0xa7ec40][_0x2529('0x66')]):_0x34c249[_0x2529('0x65')][_0xa7ec40][_0x2529('0x67')]+'\x20'+_0x34c249['rules'][_0xa7ec40][_0x2529('0x68')]+(_0x802412(_0x34c249[_0x2529('0x65')][_0xa7ec40][_0x2529('0x68')])?'\x20'+_0x34c249['rules'][_0xa7ec40]['value']:'');}return _0x19aaea+')';};var _0x45139c={'where':{'id':_0x10d943[_0x2529('0x49')]['id']}},_0x29f69e,_0x12bb7f,_0x1b3f35,_0x5e0086,_0x48259d;_0x45139c=_[_0x2529('0x8d')]({},_0x45139c,_0x10d943[_0x2529('0x41')]);return db[_0x2529('0x42')]['find'](_0x45139c)[_0x2529('0x26')](function(_0x435180){if(_0x435180){_0x29f69e=_0x435180;return _0x435180['getFields']();}return null;})[_0x2529('0x26')](function(_0x136009){if(_0x136009){if(!_0x136009['length']){throw new db[(_0x2529('0x6b'))][(_0x2529('0x8e'))]('Please\x20insert\x20at\x20least\x20one\x20field',0x193);}_0x12bb7f=_0x136009;return db[_0x2529('0x6d')][_0x2529('0x45')]({'raw':!![]});}return null;})[_0x2529('0x26')](function(_0x27f8fb){if(_0x27f8fb){_0x1b3f35=_[_0x2529('0x6e')](_0x27f8fb,'id');var _0x26ce6c;var _0xf60c93=squel[_0x2529('0x8f')]();_0xf60c93[_0x2529('0x6f')](_0x29f69e[_0x2529('0x70')]);for(var _0x19edde=0x0;_0x19edde<_0x12bb7f[_0x2529('0x39')];_0x19edde+=0x1){_0x26ce6c=_0x12bb7f[_0x19edde][_0x2529('0x71')]?_0x1b3f35[_0x12bb7f[_0x19edde][_0x2529('0x71')]][_0x2529('0x72')]:_0x12bb7f[_0x19edde][_0x2529('0x67')];_0x26ce6c=_0x12bb7f[_0x19edde]['function']?_[_0x2529('0x73')](_0x145df3[_0x12bb7f[_0x19edde][_0x2529('0x74')]],'%s',_0x26ce6c):_0x26ce6c;_0x26ce6c=_0x12bb7f[_0x19edde]['format']?_['replace'](_0x1bb5e3[_0x12bb7f[_0x19edde][_0x2529('0x75')]],'%s',_0x26ce6c):_0x26ce6c;if(_0x12bb7f[_0x19edde]['groupBy']){_0xf60c93[_0x2529('0x66')](_0x26ce6c);}_0x12bb7f[_0x19edde][_0x2529('0x77')]&&_0xf60c93['order'](_0x26ce6c,_0x12bb7f[_0x19edde][_0x2529('0x77')]===_0x2529('0x78')?![]:!![]);_0xf60c93[_0x2529('0x67')](_0x26ce6c,_0x12bb7f[_0x19edde][_0x2529('0x90')]||_0x26ce6c);}if(_0x29f69e[_0x2529('0x79')]){_0x29f69e['joins']=JSON[_0x2529('0x7f')](_0x29f69e[_0x2529('0x79')]);for(var _0x7fd6c=0x0;_0x7fd6c<_0x29f69e[_0x2529('0x79')]['length'];_0x7fd6c+=0x1){if(_0x29f69e[_0x2529('0x79')][_0x7fd6c]['type']&&_['includes'](_0x329928,_0x29f69e[_0x2529('0x79')][_0x7fd6c][_0x2529('0x31')])&&_0x29f69e[_0x2529('0x79')][_0x7fd6c][_0x2529('0x7a')]&&_0x29f69e[_0x2529('0x79')][_0x7fd6c]['foreignTable']&&_0x29f69e['joins'][_0x7fd6c]['foreignKey']){_0xf60c93[_0x29f69e[_0x2529('0x79')][_0x7fd6c][_0x2529('0x31')]](_0x29f69e[_0x2529('0x79')][_0x7fd6c][_0x2529('0x7c')],null,util[_0x2529('0x75')](_0x2529('0x7d'),_0x29f69e[_0x2529('0x70')],_0x29f69e['joins'][_0x7fd6c]['parentKey'],_0x29f69e[_0x2529('0x79')][_0x7fd6c][_0x2529('0x7c')],_0x29f69e[_0x2529('0x79')][_0x7fd6c][_0x2529('0x7b')]));}}}if(_0x29f69e[_0x2529('0x7e')]){_0x29f69e[_0x2529('0x7e')]=JSON['parse'](_0x29f69e[_0x2529('0x7e')]);_0xf60c93[_0x2529('0x3d')](_0x5b288b(_0x29f69e[_0x2529('0x7e')][_0x2529('0x66')]));}_0x48259d=_0xf60c93[_0x2529('0x80')]();_0xf60c93[_0x2529('0x1f')](_0x17bbf3);_0xf60c93[_0x2529('0x1c')](0x0);logger[_0x2529('0x81')](_0x2529('0x82'),_0xf60c93[_0x2529('0x83')]());return dbH[_0x2529('0x84')][_0x2529('0x33')](_0xf60c93['toString'](),{'type':dbH['sequelize']['QueryTypes']['SELECT']});}})['then'](function(){return{'sql':_0x48259d[_0x2529('0x83')]()};})['then'](respondWithResult(_0x4c3da8,null))[_0x2529('0x47')](handleError(_0x4c3da8,null));};
\ No newline at end of file
diff --git a/server/api/analyticCustomReport/analyticCustomReport.model.js b/server/api/analyticCustomReport/analyticCustomReport.model.js
index 2907a44..1c14434 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 _0x8f84=['../../config/logger','api','moment','bluebird','path','rimraf','exports','AnalyticCustomReport','analytics_custom_reports','lodash'];(function(_0x54d533,_0x8c00e1){var _0x230ad1=function(_0x49f417){while(--_0x49f417){_0x54d533['push'](_0x54d533['shift']());}};_0x230ad1(++_0x8c00e1);}(_0x8f84,0x77));var _0x48f8=function(_0x3cb051,_0x3aac86){_0x3cb051=_0x3cb051-0x0;var _0x21dd99=_0x8f84[_0x3cb051];return _0x21dd99;};'use strict';var _=require(_0x48f8('0x0'));var util=require('util');var logger=require(_0x48f8('0x1'))(_0x48f8('0x2'));var moment=require(_0x48f8('0x3'));var BPromise=require(_0x48f8('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x48f8('0x5'));var rimraf=require(_0x48f8('0x6'));var config=require('../../config/environment');var attributes=require('./analyticCustomReport.attributes');module[_0x48f8('0x7')]=function(_0x3d62e7,_0x4dfcf4){return _0x3d62e7['define'](_0x48f8('0x8'),attributes,{'tableName':_0x48f8('0x9'),'paranoid':!![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xe36c=['bluebird','request-promise','rimraf','../../config/environment','./analyticCustomReport.attributes','exports','define','AnalyticCustomReport','analytics_custom_reports','lodash','util','../../config/logger','api','moment'];(function(_0xce1b17,_0x2adbf0){var _0x456f0c=function(_0x711fc5){while(--_0x711fc5){_0xce1b17['push'](_0xce1b17['shift']());}};_0x456f0c(++_0x2adbf0);}(_0xe36c,0x12f));var _0xce36=function(_0x33f69e,_0x36d8fc){_0x33f69e=_0x33f69e-0x0;var _0x2294be=_0xe36c[_0x33f69e];return _0x2294be;};'use strict';var _=require(_0xce36('0x0'));var util=require(_0xce36('0x1'));var logger=require(_0xce36('0x2'))(_0xce36('0x3'));var moment=require(_0xce36('0x4'));var BPromise=require(_0xce36('0x5'));var rp=require(_0xce36('0x6'));var fs=require('fs');var path=require('path');var rimraf=require(_0xce36('0x7'));var config=require(_0xce36('0x8'));var attributes=require(_0xce36('0x9'));module[_0xce36('0xa')]=function(_0x2f73b7,_0x2aab05){return _0x2f73b7[_0xce36('0xb')](_0xce36('0xc'),attributes,{'tableName':_0xce36('0xd'),'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 95bbf7d..647e841 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 _0x0313=['AnalyticCustomReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','catch','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','../../config/environment','jayson/promise','client','http','request','then','AnalyticCustomReport,\x20%s,\x20%s','request\x20sent','debug'];(function(_0x32f560,_0x4d79db){var _0x37dbdf=function(_0xb84b41){while(--_0xb84b41){_0x32f560['push'](_0x32f560['shift']());}};_0x37dbdf(++_0x4d79db);}(_0x0313,0x128));var _0x3031=function(_0x81c98a,_0x2f7dd6){_0x81c98a=_0x81c98a-0x0;var _0x2d5c09=_0x0313[_0x81c98a];return _0x2d5c09;};'use strict';var _=require('lodash');var util=require(_0x3031('0x0'));var moment=require(_0x3031('0x1'));var BPromise=require(_0x3031('0x2'));var rs=require(_0x3031('0x3'));var fs=require('fs');var Redis=require(_0x3031('0x4'));var db=require(_0x3031('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x3031('0x6'))('rpc');var config=require(_0x3031('0x7'));var jayson=require(_0x3031('0x8'));var client=jayson[_0x3031('0x9')][_0x3031('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x157010,_0x309602,_0x67441d){return new BPromise(function(_0x1441be,_0x2439cc){return client[_0x3031('0xb')](_0x157010,_0x67441d)[_0x3031('0xc')](function(_0x3dda16){logger['info'](_0x3031('0xd'),_0x309602,_0x3031('0xe'));logger[_0x3031('0xf')](_0x3031('0x10'),_0x309602,_0x3031('0xe'),JSON[_0x3031('0x11')](_0x3dda16));if(_0x3dda16[_0x3031('0x12')]){if(_0x3dda16[_0x3031('0x12')][_0x3031('0x13')]===0x1f4){logger['error'](_0x3031('0xd'),_0x309602,_0x3dda16['error'][_0x3031('0x14')]);return _0x2439cc(_0x3dda16['error'][_0x3031('0x14')]);}logger['error'](_0x3031('0xd'),_0x309602,_0x3dda16[_0x3031('0x12')]['message']);return _0x1441be(_0x3dda16['error'][_0x3031('0x14')]);}else{logger[_0x3031('0x15')]('AnalyticCustomReport,\x20%s,\x20%s',_0x309602,_0x3031('0xe'));_0x1441be(_0x3dda16[_0x3031('0x16')][_0x3031('0x14')]);}})[_0x3031('0x17')](function(_0x1a1744){logger[_0x3031('0x12')](_0x3031('0xd'),_0x309602,_0x1a1744);_0x2439cc(_0x1a1744);});});}
\ No newline at end of file
+var _0xaec4=['util','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/environment','http','info','AnalyticCustomReport,\x20%s,\x20%s','request\x20sent','debug','AnalyticCustomReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result'];(function(_0xbef04,_0x2973e){var _0x4ca48f=function(_0x17d428){while(--_0x17d428){_0xbef04['push'](_0xbef04['shift']());}};_0x4ca48f(++_0x2973e);}(_0xaec4,0xbb));var _0x4aec=function(_0x1facfa,_0x1acf7d){_0x1facfa=_0x1facfa-0x0;var _0x9ec701=_0xaec4[_0x1facfa];return _0x9ec701;};'use strict';var _=require('lodash');var util=require(_0x4aec('0x0'));var moment=require('moment');var BPromise=require(_0x4aec('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x4aec('0x2'));var db=require(_0x4aec('0x3'))['db'];var utils=require(_0x4aec('0x4'));var logger=require('../../config/logger')('rpc');var config=require(_0x4aec('0x5'));var jayson=require('jayson/promise');var client=jayson['client'][_0x4aec('0x6')]({'port':0x232a});function respondWithRpcPromise(_0x4f3938,_0x350d03,_0x416a7d){return new BPromise(function(_0xf8a192,_0xe65772){return client['request'](_0x4f3938,_0x416a7d)['then'](function(_0x136c1e){logger[_0x4aec('0x7')](_0x4aec('0x8'),_0x350d03,_0x4aec('0x9'));logger[_0x4aec('0xa')](_0x4aec('0xb'),_0x350d03,_0x4aec('0x9'),JSON[_0x4aec('0xc')](_0x136c1e));if(_0x136c1e[_0x4aec('0xd')]){if(_0x136c1e[_0x4aec('0xd')][_0x4aec('0xe')]===0x1f4){logger[_0x4aec('0xd')]('AnalyticCustomReport,\x20%s,\x20%s',_0x350d03,_0x136c1e['error'][_0x4aec('0xf')]);return _0xe65772(_0x136c1e[_0x4aec('0xd')][_0x4aec('0xf')]);}logger[_0x4aec('0xd')](_0x4aec('0x8'),_0x350d03,_0x136c1e[_0x4aec('0xd')][_0x4aec('0xf')]);return _0xf8a192(_0x136c1e[_0x4aec('0xd')]['message']);}else{logger[_0x4aec('0x7')]('AnalyticCustomReport,\x20%s,\x20%s',_0x350d03,_0x4aec('0x9'));_0xf8a192(_0x136c1e[_0x4aec('0x10')]['message']);}})['catch'](function(_0x50bc75){logger[_0x4aec('0xd')](_0x4aec('0x8'),_0x350d03,_0x50bc75);_0xe65772(_0x50bc75);});});}
\ No newline at end of file
diff --git a/server/api/analyticCustomReport/index.js b/server/api/analyticCustomReport/index.js
index b520d76..a4b29c6 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 _0xbb80=['run','/:id/query','post','create','put','destroy','exports','multer','util','connect-timeout','express','fs-extra','../../components/interaction/service','../../config/environment','./analyticCustomReport.controller','get','index','/:id','/:id/preview','isAuthenticated','preview','/:id/run'];(function(_0x516a58,_0x55347f){var _0x3527f3=function(_0x2b521b){while(--_0x2b521b){_0x516a58['push'](_0x516a58['shift']());}};_0x3527f3(++_0x55347f);}(_0xbb80,0x1eb));var _0x0bb8=function(_0x38c0b2,_0x6a67a5){_0x38c0b2=_0x38c0b2-0x0;var _0x283c00=_0xbb80[_0x38c0b2];return _0x283c00;};'use strict';var multer=require(_0x0bb8('0x0'));var util=require(_0x0bb8('0x1'));var path=require('path');var timeout=require(_0x0bb8('0x2'));var express=require(_0x0bb8('0x3'));var router=express['Router']();var fs_extra=require(_0x0bb8('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0x0bb8('0x5'));var config=require(_0x0bb8('0x6'));var controller=require(_0x0bb8('0x7'));router[_0x0bb8('0x8')]('/',auth['isAuthenticated'](),controller[_0x0bb8('0x9')]);router[_0x0bb8('0x8')](_0x0bb8('0xa'),auth['isAuthenticated'](),controller['show']);router[_0x0bb8('0x8')](_0x0bb8('0xb'),auth[_0x0bb8('0xc')](),controller[_0x0bb8('0xd')]);router[_0x0bb8('0x8')](_0x0bb8('0xe'),auth[_0x0bb8('0xc')](),controller[_0x0bb8('0xf')]);router[_0x0bb8('0x8')](_0x0bb8('0x10'),auth['isAuthenticated'](),controller['query']);router[_0x0bb8('0x11')]('/',auth[_0x0bb8('0xc')](),controller[_0x0bb8('0x12')]);router[_0x0bb8('0x13')](_0x0bb8('0xa'),auth[_0x0bb8('0xc')](),controller['update']);router['delete'](_0x0bb8('0xa'),auth['isAuthenticated'](),controller[_0x0bb8('0x14')]);module[_0x0bb8('0x15')]=router;
\ No newline at end of file
+var _0x7c09=['isAuthenticated','/:id','show','/:id/preview','preview','/:id/query','post','create','update','delete','destroy','exports','multer','path','connect-timeout','express','Router','../../components/interaction/service','get'];(function(_0x57a11a,_0x3ed00a){var _0x231aa5=function(_0x54a485){while(--_0x54a485){_0x57a11a['push'](_0x57a11a['shift']());}};_0x231aa5(++_0x3ed00a);}(_0x7c09,0x1ae));var _0x97c0=function(_0x157773,_0x51e296){_0x157773=_0x157773-0x0;var _0xd20327=_0x7c09[_0x157773];return _0xd20327;};'use strict';var multer=require(_0x97c0('0x0'));var util=require('util');var path=require(_0x97c0('0x1'));var timeout=require(_0x97c0('0x2'));var express=require(_0x97c0('0x3'));var router=express[_0x97c0('0x4')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0x97c0('0x5'));var config=require('../../config/environment');var controller=require('./analyticCustomReport.controller');router[_0x97c0('0x6')]('/',auth[_0x97c0('0x7')](),controller['index']);router[_0x97c0('0x6')](_0x97c0('0x8'),auth['isAuthenticated'](),controller[_0x97c0('0x9')]);router[_0x97c0('0x6')](_0x97c0('0xa'),auth[_0x97c0('0x7')](),controller[_0x97c0('0xb')]);router[_0x97c0('0x6')]('/:id/run',auth[_0x97c0('0x7')](),controller['run']);router[_0x97c0('0x6')](_0x97c0('0xc'),auth[_0x97c0('0x7')](),controller['query']);router[_0x97c0('0xd')]('/',auth[_0x97c0('0x7')](),controller[_0x97c0('0xe')]);router['put'](_0x97c0('0x8'),auth[_0x97c0('0x7')](),controller[_0x97c0('0xf')]);router[_0x97c0('0x10')](_0x97c0('0x8'),auth[_0x97c0('0x7')](),controller[_0x97c0('0x11')]);module[_0x97c0('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 853ab40..55fa30f 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 _0xda19=['exports','STRING','TEXT'];(function(_0x5b012b,_0x45be7a){var _0x11f221=function(_0x5aa9aa){while(--_0x5aa9aa){_0x5b012b['push'](_0x5b012b['shift']());}};_0x11f221(++_0x45be7a);}(_0xda19,0xd5));var _0x9da1=function(_0x391a4f,_0x591b29){_0x391a4f=_0x391a4f-0x0;var _0x172065=_0xda19[_0x391a4f];return _0x172065;};'use strict';var Sequelize=require('sequelize');module[_0x9da1('0x0')]={'name':{'type':Sequelize[_0x9da1('0x1')],'allowNull':![]},'description':{'type':Sequelize['STRING']},'parent':{'type':Sequelize[_0x9da1('0x1')]},'table':{'type':Sequelize['STRING']},'conditions':{'type':Sequelize[_0x9da1('0x2')]},'joins':{'type':Sequelize['TEXT']}};
\ No newline at end of file
+var _0xdbf5=['exports','STRING','TEXT'];(function(_0x448fcf,_0x259661){var _0xc90ab6=function(_0x143f8b){while(--_0x143f8b){_0x448fcf['push'](_0x448fcf['shift']());}};_0xc90ab6(++_0x259661);}(_0xdbf5,0x18c));var _0x5dbf=function(_0x13e33e,_0x55e658){_0x13e33e=_0x13e33e-0x0;var _0x4908dd=_0xdbf5[_0x13e33e];return _0x4908dd;};'use strict';var Sequelize=require('sequelize');module[_0x5dbf('0x0')]={'name':{'type':Sequelize['STRING'],'allowNull':![]},'description':{'type':Sequelize['STRING']},'parent':{'type':Sequelize[_0x5dbf('0x1')]},'table':{'type':Sequelize[_0x5dbf('0x1')]},'conditions':{'type':Sequelize[_0x5dbf('0x2')]},'joins':{'type':Sequelize[_0x5dbf('0x2')]}};
\ No newline at end of file
diff --git a/server/api/analyticDefaultReport/analyticDefaultReport.controller.js b/server/api/analyticDefaultReport/analyticDefaultReport.controller.js
index 9cd7ef8..e552859 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 _0x1967=['conditions','clone','debug','Limited\x20Query:','toString','sequelize','QueryTypes','SELECT','SUM(%s)','GROUP_CONCAT(%s)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','IS\x20NOT\x20NULL','table','web','%s-%s.%s','randomstring','output','default','AnalyticExtractedReport','cdr','.calldate\x20BETWEEN\x20?\x20AND\x20?','startDate','endDate','.createdAt\x20BETWEEN\x20?\x20AND\x20?','info','fork','../../components/export/','../../files/reports','savename','countTable','COUNT(*)','runReport','select','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','ejs','fs-extra','lodash','squel','crypto','jsforce','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','dbH','sendStatus','status','end','json','offset','undefined','limit','count','Content-Range','reject','update','then','destroy','get','stack','name','send','index','map','AnalyticDefaultReport','rawAttributes','fieldName','type','key','model','keys','filters','intersection','query','attributes','fields','length','hasOwnProperty','nolimit','order','sort','pick','where','merge','VIRTUAL','filter','options','includeAll','findAll','rows','show','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','Reports','UserProfileSection','find','userProfileId','autoAssociation','UserProfileResource','DefaultReports','catch','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','params','join','left_join','right_join','cross_join','COUNT(%s)','COUNT(DISTINCT\x20%s)','MAX(%s)','MIN(%s)','AVG(%s)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)','SEC_TO_TIME(%s)','DATE(%s)','HOUR(%s)','ROUND(%s)','UNIX_TIMESTAMP(%s)','includes','IS\x20NULL','IS\x20EMPTY','IS\x20NOT\x20EMPTY','rules','operator','group','field','condition','value','getFields','ValidationErrorItem','Please\x20insert\x20at\x20least\x20one\x20field','AnalyticMetric','keyBy','from','MetricId','metric','function','replace','format','groupBy','orderBy','DESC','alias','joins','parse','foreignTable','%s.%s\x20=\x20%s.%s','parentKey','foreignKey'];(function(_0x16f668,_0x41806c){var _0x264307=function(_0x4c3706){while(--_0x4c3706){_0x16f668['push'](_0x16f668['shift']());}};_0x264307(++_0x41806c);}(_0x1967,0x173));var _0x7196=function(_0x4256ec,_0x289a7){_0x4256ec=_0x4256ec-0x0;var _0xcc560b=_0x1967[_0x4256ec];return _0xcc560b;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x7196('0x0'));var zipdir=require(_0x7196('0x1'));var jsonpatch=require(_0x7196('0x2'));var rp=require(_0x7196('0x3'));var moment=require(_0x7196('0x4'));var BPromise=require(_0x7196('0x5'));var Mustache=require(_0x7196('0x6'));var util=require(_0x7196('0x7'));var path=require(_0x7196('0x8'));var sox=require(_0x7196('0x9'));var csv=require('to-csv');var ejs=require(_0x7196('0xa'));var fs=require('fs');var fs_extra=require(_0x7196('0xb'));var _=require(_0x7196('0xc'));var squel=require(_0x7196('0xd'));var crypto=require(_0x7196('0xe'));var jsforce=require(_0x7196('0xf'));var deskjs=require('desk.js');var toCsv=require(_0x7196('0x10'));var querystring=require(_0x7196('0x11'));var Papa=require(_0x7196('0x12'));var Redis=require(_0x7196('0x13'));var authService=require(_0x7196('0x14'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x7196('0x15'));var logger=require(_0x7196('0x16'))(_0x7196('0x17'));var utils=require(_0x7196('0x18'));var config=require(_0x7196('0x19'));var licenseUtil=require(_0x7196('0x1a'));var db=require(_0x7196('0x1b'))['db'];var dbH=require(_0x7196('0x1b'))[_0x7196('0x1c')];function respondWithStatusCode(_0xba707b,_0x154101){_0x154101=_0x154101||0xcc;return function(_0x4e8c4c){if(_0x4e8c4c){return _0xba707b[_0x7196('0x1d')](_0x154101);}return _0xba707b[_0x7196('0x1e')](_0x154101)[_0x7196('0x1f')]();};}function respondWithResult(_0xf098c1,_0x511aa1){_0x511aa1=_0x511aa1||0xc8;return function(_0x31c778){if(_0x31c778){return _0xf098c1['status'](_0x511aa1)[_0x7196('0x20')](_0x31c778);}};}function respondWithFilteredResult(_0x2590a6,_0xf7e97){return function(_0x3ed1ad){if(_0x3ed1ad){var _0x12dce7=typeof _0xf7e97[_0x7196('0x21')]===_0x7196('0x22')&&typeof _0xf7e97[_0x7196('0x23')]===_0x7196('0x22');var _0x32fe2b=_0x3ed1ad[_0x7196('0x24')];var _0x5b716a=_0x12dce7?0x0:_0xf7e97['offset'];var _0x448f13=_0x12dce7?_0x3ed1ad[_0x7196('0x24')]:_0xf7e97[_0x7196('0x21')]+_0xf7e97['limit'];var _0x39b944;if(_0x448f13>=_0x32fe2b){_0x448f13=_0x32fe2b;_0x39b944=0xc8;}else{_0x39b944=0xce;}_0x2590a6['status'](_0x39b944);return _0x2590a6['set'](_0x7196('0x25'),_0x5b716a+'-'+_0x448f13+'/'+_0x32fe2b)[_0x7196('0x20')](_0x3ed1ad);}return null;};}function patchUpdates(_0x8dee9d){return function(_0x4ddf78){try{jsonpatch['apply'](_0x4ddf78,_0x8dee9d,!![]);}catch(_0x38d291){return BPromise[_0x7196('0x26')](_0x38d291);}return _0x4ddf78['save']();};}function saveUpdates(_0x18649b,_0x27ff84){return function(_0x6e22e5){if(_0x6e22e5){return _0x6e22e5[_0x7196('0x27')](_0x18649b)[_0x7196('0x28')](function(_0x549f34){return _0x549f34;});}return null;};}function removeEntity(_0x3f8178,_0x520d01){return function(_0x3ce9a0){if(_0x3ce9a0){return _0x3ce9a0[_0x7196('0x29')]()[_0x7196('0x28')](function(){var _0xa69810=_0x3ce9a0[_0x7196('0x2a')]({'plain':!![]});var _0x43f6a2='DefaultReports';return db['UserProfileResource'][_0x7196('0x29')]({'where':{'type':_0x43f6a2,'resourceId':_0xa69810['id']}})[_0x7196('0x28')](function(){return _0x3ce9a0;});})[_0x7196('0x28')](function(){_0x3f8178['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x41cfd2,_0x162cfc){return function(_0x675e64){if(!_0x675e64){_0x41cfd2['sendStatus'](0x194);}return _0x675e64;};}function handleError(_0x35eef9,_0x4ecea1){_0x4ecea1=_0x4ecea1||0x1f4;return function(_0x4fd339){logger['error'](_0x4fd339[_0x7196('0x2b')]);if(_0x4fd339[_0x7196('0x2c')]){delete _0x4fd339[_0x7196('0x2c')];}_0x35eef9['status'](_0x4ecea1)[_0x7196('0x2d')](_0x4fd339);};}exports[_0x7196('0x2e')]=function(_0x2f9583,_0xf999e9){var _0x50c386={},_0x39710d={},_0x429160={'count':0x0,'rows':[]};var _0xd07f22=_[_0x7196('0x2f')](db[_0x7196('0x30')][_0x7196('0x31')],function(_0x15c5f0){return{'name':_0x15c5f0[_0x7196('0x32')],'type':_0x15c5f0[_0x7196('0x33')][_0x7196('0x34')]};});_0x39710d[_0x7196('0x35')]=_['map'](_0xd07f22,_0x7196('0x2c'));_0x39710d['query']=_[_0x7196('0x36')](_0x2f9583['query']);_0x39710d[_0x7196('0x37')]=_[_0x7196('0x38')](_0x39710d['model'],_0x39710d[_0x7196('0x39')]);_0x50c386[_0x7196('0x3a')]=_[_0x7196('0x38')](_0x39710d[_0x7196('0x35')],qs[_0x7196('0x3b')](_0x2f9583['query'][_0x7196('0x3b')]));_0x50c386[_0x7196('0x3a')]=_0x50c386[_0x7196('0x3a')][_0x7196('0x3c')]?_0x50c386[_0x7196('0x3a')]:_0x39710d[_0x7196('0x35')];if(!_0x2f9583['query'][_0x7196('0x3d')](_0x7196('0x3e'))){_0x50c386[_0x7196('0x23')]=qs['limit'](_0x2f9583[_0x7196('0x39')][_0x7196('0x23')]);_0x50c386[_0x7196('0x21')]=qs[_0x7196('0x21')](_0x2f9583[_0x7196('0x39')][_0x7196('0x21')]);}_0x50c386[_0x7196('0x3f')]=qs[_0x7196('0x40')](_0x2f9583[_0x7196('0x39')][_0x7196('0x40')]);_0x50c386['where']=qs[_0x7196('0x37')](_[_0x7196('0x41')](_0x2f9583['query'],_0x39710d[_0x7196('0x37')]),_0xd07f22);if(_0x2f9583['query']['filter']){_0x50c386[_0x7196('0x42')]=_[_0x7196('0x43')](_0x50c386['where'],{'$or':_['map'](_0xd07f22,function(_0x1bad95){if(_0x1bad95[_0x7196('0x33')]!==_0x7196('0x44')){var _0x4c2341={};_0x4c2341[_0x1bad95[_0x7196('0x2c')]]={'$like':'%'+_0x2f9583[_0x7196('0x39')][_0x7196('0x45')]+'%'};return _0x4c2341;}})});}_0x50c386=_[_0x7196('0x43')]({},_0x50c386,_0x2f9583[_0x7196('0x46')]);var _0x428d76={'where':_0x50c386[_0x7196('0x42')]};return db[_0x7196('0x30')]['count'](_0x428d76)[_0x7196('0x28')](function(_0xa852e1){_0x429160['count']=_0xa852e1;if(_0x2f9583[_0x7196('0x39')][_0x7196('0x47')]){_0x50c386['include']=[{'all':!![]}];}return db[_0x7196('0x30')][_0x7196('0x48')](_0x50c386);})[_0x7196('0x28')](function(_0x5749e2){_0x429160[_0x7196('0x49')]=_0x5749e2;return _0x429160;})[_0x7196('0x28')](respondWithFilteredResult(_0xf999e9,_0x50c386))['catch'](handleError(_0xf999e9,null));};exports[_0x7196('0x4a')]=function(_0x1a7052,_0x4f0c6c){var _0x335e6f={'raw':!![],'where':{'id':_0x1a7052['params']['id']}},_0x53a5e6={};_0x53a5e6['model']=_['keys'](db['AnalyticDefaultReport'][_0x7196('0x31')]);_0x53a5e6['query']=_[_0x7196('0x36')](_0x1a7052[_0x7196('0x39')]);_0x53a5e6[_0x7196('0x37')]=_[_0x7196('0x38')](_0x53a5e6['model'],_0x53a5e6[_0x7196('0x39')]);_0x335e6f['attributes']=_[_0x7196('0x38')](_0x53a5e6[_0x7196('0x35')],qs[_0x7196('0x3b')](_0x1a7052['query'][_0x7196('0x3b')]));_0x335e6f[_0x7196('0x3a')]=_0x335e6f[_0x7196('0x3a')]['length']?_0x335e6f['attributes']:_0x53a5e6[_0x7196('0x35')];if(_0x1a7052['query'][_0x7196('0x47')]){_0x335e6f['include']=[{'all':!![]}];}_0x335e6f=_['merge']({},_0x335e6f,_0x1a7052[_0x7196('0x46')]);return db['AnalyticDefaultReport']['find'](_0x335e6f)['then'](handleEntityNotFound(_0x4f0c6c,null))[_0x7196('0x28')](respondWithResult(_0x4f0c6c,null))['catch'](handleError(_0x4f0c6c,null));};exports['create']=function(_0x28591e,_0x182c8b){return db[_0x7196('0x30')][_0x7196('0x4b')](_0x28591e['body'],{})[_0x7196('0x28')](function(_0x564688){var _0x36844f=_0x28591e[_0x7196('0x4c')]['get']({'plain':!![]});if(!_0x36844f)throw new Error(_0x7196('0x4d'));if(_0x36844f[_0x7196('0x4e')]===_0x7196('0x4c')){var _0x4fa18f=_0x564688[_0x7196('0x2a')]({'plain':!![]});var _0x5d51aa=_0x7196('0x4f');return db[_0x7196('0x50')][_0x7196('0x51')]({'where':{'name':_0x5d51aa,'userProfileId':_0x36844f[_0x7196('0x52')]},'raw':!![]})[_0x7196('0x28')](function(_0x19733a){if(_0x19733a&&_0x19733a[_0x7196('0x53')]===0x0){return db[_0x7196('0x54')]['create']({'name':_0x4fa18f['name'],'resourceId':_0x4fa18f['id'],'type':_0x7196('0x55'),'sectionId':_0x19733a['id']},{})[_0x7196('0x28')](function(){return _0x564688;});}else{return _0x564688;}})[_0x7196('0x56')](function(_0xe4b032){logger['error'](_0x7196('0x57'),_0xe4b032);throw _0xe4b032;});}return _0x564688;})[_0x7196('0x28')](respondWithResult(_0x182c8b,0xc9))[_0x7196('0x56')](handleError(_0x182c8b,null));};exports[_0x7196('0x27')]=function(_0x9fcfd4,_0x3177c2){if(_0x9fcfd4[_0x7196('0x58')]['id']){delete _0x9fcfd4[_0x7196('0x58')]['id'];}return db[_0x7196('0x30')][_0x7196('0x51')]({'where':{'id':_0x9fcfd4[_0x7196('0x59')]['id']}})['then'](handleEntityNotFound(_0x3177c2,null))[_0x7196('0x28')](saveUpdates(_0x9fcfd4[_0x7196('0x58')],null))[_0x7196('0x28')](respondWithResult(_0x3177c2,null))['catch'](handleError(_0x3177c2,null));};exports[_0x7196('0x29')]=function(_0x5ca1ca,_0x34407d){return db[_0x7196('0x30')][_0x7196('0x51')]({'where':{'id':_0x5ca1ca[_0x7196('0x59')]['id']}})[_0x7196('0x28')](handleEntityNotFound(_0x34407d,null))['then'](removeEntity(_0x34407d,null))[_0x7196('0x56')](handleError(_0x34407d,null));};exports['preview']=function(_0x4be36d,_0x5b9824){var _0x1bc358=0xa;var _0x3be180=[_0x7196('0x5a'),_0x7196('0x5b'),_0x7196('0x5c'),_0x7196('0x5d')];var _0x2d8b3d={'SUM':'SUM(%s)','COUNT':_0x7196('0x5e'),'COUNT DISTINCT':_0x7196('0x5f'),'MAX':_0x7196('0x60'),'MIN':_0x7196('0x61'),'AVG':_0x7196('0x62'),'GROUP_CONCAT':'GROUP_CONCAT(%s)','GROUP_CONCAT ASC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT DESC':_0x7196('0x63')};var _0x1c7eb2={'SEC_TO_TIME':_0x7196('0x64'),'DATE':_0x7196('0x65'),'HOUR':_0x7196('0x66'),'ROUND':_0x7196('0x67'),'UNIX_TIMESTAMP':_0x7196('0x68')};var _0x43ee13=function(_0x13e9d0){return!_[_0x7196('0x69')]([_0x7196('0x6a'),'IS\x20NOT\x20NULL',_0x7196('0x6b'),_0x7196('0x6c')],_0x13e9d0);};var _0x27d5d7=function(_0x33f43b){if(!_0x33f43b||!_0x33f43b['rules'][_0x7196('0x3c')]){return'';}for(var _0x204c3a='(',_0x1f3acc=0x0;_0x1f3acc<_0x33f43b[_0x7196('0x6d')][_0x7196('0x3c')];_0x1f3acc+=0x1){_0x1f3acc>0x0&&(_0x204c3a+='\x20'+_0x33f43b[_0x7196('0x6e')]+'\x20');_0x204c3a+=_0x33f43b[_0x7196('0x6d')][_0x1f3acc]['group']?_0x27d5d7(_0x33f43b[_0x7196('0x6d')][_0x1f3acc][_0x7196('0x6f')]):_0x33f43b[_0x7196('0x6d')][_0x1f3acc][_0x7196('0x70')]+'\x20'+_0x33f43b['rules'][_0x1f3acc][_0x7196('0x71')]+(_0x43ee13(_0x33f43b[_0x7196('0x6d')][_0x1f3acc][_0x7196('0x71')])?'\x20'+_0x33f43b[_0x7196('0x6d')][_0x1f3acc][_0x7196('0x72')]:'');}return _0x204c3a+')';};var _0x37c6be={'where':{'id':_0x4be36d['params']['id']}},_0x57065,_0x517dfb,_0x56b2eb,_0x56955e,_0x72f6f1;_0x37c6be=_[_0x7196('0x43')]({},_0x37c6be,_0x4be36d[_0x7196('0x46')]);return db[_0x7196('0x30')][_0x7196('0x51')](_0x37c6be)[_0x7196('0x28')](function(_0x30d44f){if(_0x30d44f){_0x57065=_0x30d44f;return _0x30d44f[_0x7196('0x73')]();}return null;})[_0x7196('0x28')](function(_0x3881a5){if(_0x3881a5){if(!_0x3881a5['length']){throw new db['Sequelize'][(_0x7196('0x74'))](_0x7196('0x75'),0x193);}_0x517dfb=_0x3881a5;return db[_0x7196('0x76')][_0x7196('0x48')]({'raw':!![]});}return null;})[_0x7196('0x28')](function(_0x45e21f){if(_0x45e21f){_0x56b2eb=_[_0x7196('0x77')](_0x45e21f,'id');var _0x2f36f8;var _0x4cc5e3=squel['select']();_0x4cc5e3[_0x7196('0x78')](_0x57065['table']);for(var _0x30d114=0x0;_0x30d114<_0x517dfb['length'];_0x30d114+=0x1){_0x2f36f8=_0x517dfb[_0x30d114][_0x7196('0x79')]?_0x56b2eb[_0x517dfb[_0x30d114][_0x7196('0x79')]][_0x7196('0x7a')]:_0x517dfb[_0x30d114][_0x7196('0x70')];_0x2f36f8=_0x517dfb[_0x30d114]['function']?_['replace'](_0x2d8b3d[_0x517dfb[_0x30d114][_0x7196('0x7b')]],'%s',_0x2f36f8):_0x2f36f8;_0x2f36f8=_0x517dfb[_0x30d114]['format']?_[_0x7196('0x7c')](_0x1c7eb2[_0x517dfb[_0x30d114][_0x7196('0x7d')]],'%s',_0x2f36f8):_0x2f36f8;if(_0x517dfb[_0x30d114][_0x7196('0x7e')]){_0x4cc5e3[_0x7196('0x6f')](_0x2f36f8);}_0x517dfb[_0x30d114][_0x7196('0x7f')]&&_0x4cc5e3[_0x7196('0x3f')](_0x2f36f8,_0x517dfb[_0x30d114]['orderBy']===_0x7196('0x80')?![]:!![]);_0x4cc5e3[_0x7196('0x70')](_0x2f36f8,_0x517dfb[_0x30d114][_0x7196('0x81')]||_0x2f36f8);}if(_0x57065[_0x7196('0x82')]){_0x57065[_0x7196('0x82')]=JSON[_0x7196('0x83')](_0x57065[_0x7196('0x82')]);for(var _0x473c0e=0x0;_0x473c0e<_0x57065[_0x7196('0x82')][_0x7196('0x3c')];_0x473c0e+=0x1){if(_0x57065[_0x7196('0x82')][_0x473c0e][_0x7196('0x33')]&&_['includes'](_0x3be180,_0x57065[_0x7196('0x82')][_0x473c0e][_0x7196('0x33')])&&_0x57065['joins'][_0x473c0e]['parentKey']&&_0x57065[_0x7196('0x82')][_0x473c0e][_0x7196('0x84')]&&_0x57065[_0x7196('0x82')][_0x473c0e]['foreignKey']){_0x4cc5e3[_0x57065[_0x7196('0x82')][_0x473c0e]['type']](_0x57065[_0x7196('0x82')][_0x473c0e][_0x7196('0x84')],null,util['format'](_0x7196('0x85'),_0x57065['table'],_0x57065['joins'][_0x473c0e][_0x7196('0x86')],_0x57065[_0x7196('0x82')][_0x473c0e][_0x7196('0x84')],_0x57065['joins'][_0x473c0e][_0x7196('0x87')]));}}}if(_0x57065['conditions']){_0x57065[_0x7196('0x88')]=JSON[_0x7196('0x83')](_0x57065[_0x7196('0x88')]);_0x4cc5e3[_0x7196('0x42')](_0x27d5d7(_0x57065[_0x7196('0x88')]['group']));}_0x72f6f1=_0x4cc5e3[_0x7196('0x89')]();_0x4cc5e3[_0x7196('0x23')](_0x1bc358);_0x4cc5e3[_0x7196('0x21')](0x0);logger[_0x7196('0x8a')](_0x7196('0x8b'),_0x4cc5e3[_0x7196('0x8c')]());return dbH[_0x7196('0x8d')][_0x7196('0x39')](_0x4cc5e3['toString'](),{'type':dbH[_0x7196('0x8d')][_0x7196('0x8e')][_0x7196('0x8f')]});}})[_0x7196('0x28')](respondWithResult(_0x5b9824,null))['catch'](handleError(_0x5b9824,null));};function runReport(_0x1364f5,_0x2cb53c,_0x4fe2cb){var _0x2e4807=_0x2cb53c['name'];var _0xd6d8cf=0xa;var _0x5318c1=[_0x7196('0x5a'),_0x7196('0x5b'),'right_join',_0x7196('0x5d')];var _0x2b52c0={'SUM':_0x7196('0x90'),'COUNT':'COUNT(%s)','COUNT DISTINCT':'COUNT(DISTINCT\x20%s)','MAX':_0x7196('0x60'),'MIN':'MIN(%s)','AVG':'AVG(%s)','GROUP_CONCAT':_0x7196('0x91'),'GROUP_CONCAT ASC':_0x7196('0x92'),'GROUP_CONCAT DESC':_0x7196('0x63')};var _0x509c4a={'SEC_TO_TIME':_0x7196('0x64'),'DATE':_0x7196('0x65'),'HOUR':_0x7196('0x66'),'ROUND':_0x7196('0x67'),'UNIX_TIMESTAMP':_0x7196('0x68')};var _0x26048c=function(_0x1a4d17){return!_[_0x7196('0x69')]([_0x7196('0x6a'),_0x7196('0x93'),_0x7196('0x6b'),'IS\x20NOT\x20EMPTY'],_0x1a4d17);};var _0x5acff1=function(_0x32ab6c){if(!_0x32ab6c||!_0x32ab6c['rules']['length']){return'';}for(var _0x2bfdc4='(',_0x1604fa=0x0;_0x1604fa<_0x32ab6c[_0x7196('0x6d')][_0x7196('0x3c')];_0x1604fa+=0x1){_0x1604fa>0x0&&(_0x2bfdc4+='\x20'+_0x32ab6c['operator']+'\x20');_0x2bfdc4+=_0x32ab6c['rules'][_0x1604fa][_0x7196('0x6f')]?_0x5acff1(_0x32ab6c[_0x7196('0x6d')][_0x1604fa][_0x7196('0x6f')]):_0x32ab6c[_0x7196('0x6d')][_0x1604fa]['field']+'\x20'+_0x32ab6c[_0x7196('0x6d')][_0x1604fa]['condition']+(_0x26048c(_0x32ab6c['rules'][_0x1604fa][_0x7196('0x71')])?'\x20'+_0x32ab6c[_0x7196('0x6d')][_0x1604fa][_0x7196('0x72')]:'');}return _0x2bfdc4+')';};var _0x494418={'where':{'id':_0x1364f5['id']}},_0x400aa5,_0x40d4c3,_0x1824e2,_0x30c54b,_0x10712f;_0x494418=_[_0x7196('0x43')]({},_0x494418,_0x4fe2cb);return db[_0x7196('0x30')][_0x7196('0x51')](_0x494418)['then'](function(_0x9bd2ea){if(_0x9bd2ea){_0x400aa5=_0x9bd2ea;return _0x9bd2ea[_0x7196('0x73')]();}return null;})[_0x7196('0x28')](function(_0x408760){if(_0x408760){if(!_0x408760[_0x7196('0x3c')]){throw new db['Sequelize'][(_0x7196('0x74'))](_0x7196('0x75'),0x193);}_0x40d4c3=_0x408760;return db[_0x7196('0x76')]['findAll']({'raw':!![]});}return null;})[_0x7196('0x28')](function(_0x4b98de){if(_0x4b98de){_0x1824e2=_['keyBy'](_0x4b98de,'id');var _0x1dcf93;var _0x25d323=squel['select']();_0x25d323[_0x7196('0x78')](_0x400aa5[_0x7196('0x94')]);for(var _0x48ceda=0x0;_0x48ceda<_0x40d4c3[_0x7196('0x3c')];_0x48ceda+=0x1){_0x1dcf93=_0x40d4c3[_0x48ceda][_0x7196('0x79')]?_0x1824e2[_0x40d4c3[_0x48ceda][_0x7196('0x79')]][_0x7196('0x7a')]:_0x40d4c3[_0x48ceda][_0x7196('0x70')];_0x1dcf93=_0x40d4c3[_0x48ceda][_0x7196('0x7b')]?_['replace'](_0x2b52c0[_0x40d4c3[_0x48ceda][_0x7196('0x7b')]],'%s',_0x1dcf93):_0x1dcf93;_0x1dcf93=_0x40d4c3[_0x48ceda][_0x7196('0x7d')]?_[_0x7196('0x7c')](_0x509c4a[_0x40d4c3[_0x48ceda]['format']],'%s',_0x1dcf93):_0x1dcf93;if(_0x40d4c3[_0x48ceda]['groupBy']){_0x25d323['group'](_0x1dcf93);}_0x40d4c3[_0x48ceda][_0x7196('0x7f')]&&_0x25d323[_0x7196('0x3f')](_0x1dcf93,_0x40d4c3[_0x48ceda][_0x7196('0x7f')]==='DESC'?![]:!![]);_0x25d323[_0x7196('0x70')](_0x1dcf93,_0x40d4c3[_0x48ceda]['alias']||_0x1dcf93);}if(_0x400aa5[_0x7196('0x82')]){_0x400aa5['joins']=JSON[_0x7196('0x83')](_0x400aa5[_0x7196('0x82')]);for(var _0x33d5bf=0x0;_0x33d5bf<_0x400aa5[_0x7196('0x82')][_0x7196('0x3c')];_0x33d5bf+=0x1){if(_0x400aa5[_0x7196('0x82')][_0x33d5bf][_0x7196('0x33')]&&_['includes'](_0x5318c1,_0x400aa5[_0x7196('0x82')][_0x33d5bf]['type'])&&_0x400aa5['joins'][_0x33d5bf]['parentKey']&&_0x400aa5['joins'][_0x33d5bf]['foreignTable']&&_0x400aa5[_0x7196('0x82')][_0x33d5bf][_0x7196('0x87')]){_0x25d323[_0x400aa5[_0x7196('0x82')][_0x33d5bf]['type']](_0x400aa5[_0x7196('0x82')][_0x33d5bf]['foreignTable'],null,util['format']('%s.%s\x20=\x20%s.%s',_0x400aa5[_0x7196('0x94')],_0x400aa5['joins'][_0x33d5bf][_0x7196('0x86')],_0x400aa5[_0x7196('0x82')][_0x33d5bf][_0x7196('0x84')],_0x400aa5[_0x7196('0x82')][_0x33d5bf][_0x7196('0x87')]));}}}if(_0x400aa5[_0x7196('0x88')]){_0x400aa5[_0x7196('0x88')]=JSON[_0x7196('0x83')](_0x400aa5['conditions']);_0x25d323[_0x7196('0x42')](_0x5acff1(_0x400aa5[_0x7196('0x88')][_0x7196('0x6f')]));}_0x10712f=_0x25d323['clone']();_0x25d323[_0x7196('0x23')](_0xd6d8cf);_0x25d323[_0x7196('0x21')](0x0);return;}})[_0x7196('0x28')](function(){if(_0x2cb53c['output']===_0x7196('0x95')){return null;}var _0x46a563=_[_0x7196('0x43')](_0x2cb53c,{'name':_0x2cb53c['fullPath']||_0x2cb53c[_0x7196('0x2c')]||_0x400aa5[_0x7196('0x2c')],'basename':_0x2e4807,'savename':util['format'](_0x7196('0x96'),_0x2cb53c['name']||_0x400aa5[_0x7196('0x2c')],require(_0x7196('0x97'))['generate'](0x4),_0x2cb53c[_0x7196('0x98')]||'csv'),'reportId':_0x400aa5['id'],'reportType':_0x7196('0x99')});return db[_0x7196('0x9a')][_0x7196('0x4b')](_0x46a563,{'raw':!![]});})['then'](function(_0xd9619d){if(_0x400aa5[_0x7196('0x94')]===_0x7196('0x9b')){_0x10712f[_0x7196('0x42')](_0x400aa5['table']+_0x7196('0x9c'),_0x2cb53c[_0x7196('0x9d')],_0x2cb53c[_0x7196('0x9e')]);}else{_0x10712f['where'](_0x400aa5['table']+_0x7196('0x9f'),_0x2cb53c[_0x7196('0x9d')],_0x2cb53c[_0x7196('0x9e')]);}if(_0xd9619d){logger[_0x7196('0xa0')]('Run\x20Query:',_0x10712f[_0x7196('0x8c')]());require('child_process')[_0x7196('0xa1')](path['join'](__dirname,_0x7196('0xa2'),_0xd9619d[_0x7196('0x98')]),[_0xd9619d['id'],_0x10712f[_0x7196('0x8c')](),path[_0x7196('0x5a')](__dirname,_0x7196('0xa3'),_0xd9619d[_0x7196('0xa4')]),_0x2e4807]);return _0xd9619d;}else{var _0x342fb1=squel['select']();_0x342fb1[_0x7196('0x78')]('('+_0x10712f[_0x7196('0x8c')]()+')',_0x7196('0xa5'));_0x342fb1[_0x7196('0x70')](_0x7196('0xa6'),_0x7196('0x24'));_0x10712f[_0x7196('0x23')](_0x2cb53c[_0x7196('0x23')]||_0xd6d8cf);_0x10712f['offset'](_0x2cb53c[_0x7196('0x21')]||0x0);return dbH[_0x7196('0x8d')]['query'](_0x342fb1[_0x7196('0x8c')](),{'type':dbH[_0x7196('0x8d')]['QueryTypes'][_0x7196('0x8f')]})[_0x7196('0x28')](function(_0xdf1ede){if(!_0xdf1ede[_0x7196('0x3c')]){_0x30c54b=0x0;}else{_0x30c54b=_0xdf1ede[0x0]['count']||0x0;}return dbH['sequelize'][_0x7196('0x39')](_0x10712f['toString'](),{'type':dbH[_0x7196('0x8d')][_0x7196('0x8e')][_0x7196('0x8f')]});})[_0x7196('0x28')](function(_0x2df80a){return{'rows':_0x2df80a||[],'count':_0x30c54b};});}});}exports['run']=function(_0x392e74,_0x17ba6d){return runReport(_0x392e74[_0x7196('0x59')],_0x392e74[_0x7196('0x39')],_0x392e74[_0x7196('0x46')])[_0x7196('0x28')](respondWithResult(_0x17ba6d,null))[_0x7196('0x56')](handleError(_0x17ba6d,null));};exports[_0x7196('0xa7')]=runReport;exports[_0x7196('0x39')]=function(_0x5a3c87,_0x58fb86){var _0x51da79=0xa;var _0x144613=[_0x7196('0x5a'),_0x7196('0x5b'),_0x7196('0x5c'),_0x7196('0x5d')];var _0x9055af={'SUM':_0x7196('0x90'),'COUNT':_0x7196('0x5e'),'COUNT DISTINCT':'COUNT(DISTINCT\x20%s)','MAX':'MAX(%s)','MIN':'MIN(%s)','AVG':'AVG(%s)','GROUP_CONCAT':_0x7196('0x91'),'GROUP_CONCAT ASC':_0x7196('0x92'),'GROUP_CONCAT DESC':_0x7196('0x63')};var _0xab9595={'SEC_TO_TIME':_0x7196('0x64'),'DATE':_0x7196('0x65'),'HOUR':'HOUR(%s)','ROUND':_0x7196('0x67'),'UNIX_TIMESTAMP':'UNIX_TIMESTAMP(%s)'};var _0x5236a0=function(_0x520fe8){return!_['includes'](['IS\x20NULL',_0x7196('0x93'),'IS\x20EMPTY',_0x7196('0x6c')],_0x520fe8);};var _0x425a57=function(_0x302728){if(!_0x302728||!_0x302728[_0x7196('0x6d')][_0x7196('0x3c')]){return'';}for(var _0x14492e='(',_0x58df43=0x0;_0x58df43<_0x302728[_0x7196('0x6d')][_0x7196('0x3c')];_0x58df43+=0x1){_0x58df43>0x0&&(_0x14492e+='\x20'+_0x302728[_0x7196('0x6e')]+'\x20');_0x14492e+=_0x302728['rules'][_0x58df43][_0x7196('0x6f')]?_0x425a57(_0x302728[_0x7196('0x6d')][_0x58df43][_0x7196('0x6f')]):_0x302728['rules'][_0x58df43]['field']+'\x20'+_0x302728[_0x7196('0x6d')][_0x58df43][_0x7196('0x71')]+(_0x5236a0(_0x302728[_0x7196('0x6d')][_0x58df43][_0x7196('0x71')])?'\x20'+_0x302728[_0x7196('0x6d')][_0x58df43][_0x7196('0x72')]:'');}return _0x14492e+')';};var _0x1a8a5a={'where':{'id':_0x5a3c87[_0x7196('0x59')]['id']}},_0x2944e5,_0x3f9385,_0xbd94ef,_0x5d2a56,_0x2fb552;_0x1a8a5a=_['merge']({},_0x1a8a5a,_0x5a3c87[_0x7196('0x46')]);return db[_0x7196('0x30')]['find'](_0x1a8a5a)[_0x7196('0x28')](function(_0x386259){if(_0x386259){_0x2944e5=_0x386259;return _0x386259[_0x7196('0x73')]();}return null;})[_0x7196('0x28')](function(_0x1e7a64){if(_0x1e7a64){if(!_0x1e7a64[_0x7196('0x3c')]){throw new db['Sequelize']['ValidationErrorItem'](_0x7196('0x75'),0x193);}_0x3f9385=_0x1e7a64;return db['AnalyticMetric'][_0x7196('0x48')]({'raw':!![]});}return null;})[_0x7196('0x28')](function(_0x30db09){if(_0x30db09){_0xbd94ef=_['keyBy'](_0x30db09,'id');var _0x4729e1;var _0x66e1e6=squel[_0x7196('0xa8')]();_0x66e1e6[_0x7196('0x78')](_0x2944e5[_0x7196('0x94')]);for(var _0x1e2105=0x0;_0x1e2105<_0x3f9385[_0x7196('0x3c')];_0x1e2105+=0x1){_0x4729e1=_0x3f9385[_0x1e2105][_0x7196('0x79')]?_0xbd94ef[_0x3f9385[_0x1e2105][_0x7196('0x79')]]['metric']:_0x3f9385[_0x1e2105][_0x7196('0x70')];_0x4729e1=_0x3f9385[_0x1e2105][_0x7196('0x7b')]?_[_0x7196('0x7c')](_0x9055af[_0x3f9385[_0x1e2105][_0x7196('0x7b')]],'%s',_0x4729e1):_0x4729e1;_0x4729e1=_0x3f9385[_0x1e2105][_0x7196('0x7d')]?_[_0x7196('0x7c')](_0xab9595[_0x3f9385[_0x1e2105]['format']],'%s',_0x4729e1):_0x4729e1;if(_0x3f9385[_0x1e2105][_0x7196('0x7e')]){_0x66e1e6['group'](_0x4729e1);}_0x3f9385[_0x1e2105][_0x7196('0x7f')]&&_0x66e1e6[_0x7196('0x3f')](_0x4729e1,_0x3f9385[_0x1e2105][_0x7196('0x7f')]==='DESC'?![]:!![]);_0x66e1e6['field'](_0x4729e1,_0x3f9385[_0x1e2105][_0x7196('0x81')]||_0x4729e1);}if(_0x2944e5[_0x7196('0x82')]){_0x2944e5[_0x7196('0x82')]=JSON[_0x7196('0x83')](_0x2944e5[_0x7196('0x82')]);for(var _0x220315=0x0;_0x220315<_0x2944e5[_0x7196('0x82')][_0x7196('0x3c')];_0x220315+=0x1){if(_0x2944e5['joins'][_0x220315][_0x7196('0x33')]&&_[_0x7196('0x69')](_0x144613,_0x2944e5['joins'][_0x220315][_0x7196('0x33')])&&_0x2944e5[_0x7196('0x82')][_0x220315][_0x7196('0x86')]&&_0x2944e5['joins'][_0x220315][_0x7196('0x84')]&&_0x2944e5[_0x7196('0x82')][_0x220315][_0x7196('0x87')]){_0x66e1e6[_0x2944e5[_0x7196('0x82')][_0x220315][_0x7196('0x33')]](_0x2944e5['joins'][_0x220315]['foreignTable'],null,util[_0x7196('0x7d')](_0x7196('0x85'),_0x2944e5[_0x7196('0x94')],_0x2944e5[_0x7196('0x82')][_0x220315][_0x7196('0x86')],_0x2944e5[_0x7196('0x82')][_0x220315]['foreignTable'],_0x2944e5[_0x7196('0x82')][_0x220315][_0x7196('0x87')]));}}}if(_0x2944e5[_0x7196('0x88')]){_0x2944e5[_0x7196('0x88')]=JSON['parse'](_0x2944e5[_0x7196('0x88')]);_0x66e1e6[_0x7196('0x42')](_0x425a57(_0x2944e5[_0x7196('0x88')][_0x7196('0x6f')]));}_0x2fb552=_0x66e1e6[_0x7196('0x89')]();_0x66e1e6[_0x7196('0x23')](_0x51da79);_0x66e1e6[_0x7196('0x21')](0x0);logger[_0x7196('0x8a')](_0x7196('0x8b'),_0x66e1e6[_0x7196('0x8c')]());return dbH[_0x7196('0x8d')][_0x7196('0x39')](_0x66e1e6['toString'](),{'type':dbH[_0x7196('0x8d')]['QueryTypes'][_0x7196('0x8f')]});}})['then'](function(){return{'sql':_0x2fb552[_0x7196('0x8c')]()};})['then'](respondWithResult(_0x58fb86,null))[_0x7196('0x56')](handleError(_0x58fb86,null));};
\ No newline at end of file
+var _0x0295=['default','AnalyticExtractedReport','cdr','.calldate\x20BETWEEN\x20?\x20AND\x20?','startDate','.createdAt\x20BETWEEN\x20?\x20AND\x20?','endDate','info','Run\x20Query:','fork','../../files/reports','COUNT(*)','SELECT','run','runReport','MAX(%s)','eml-format','fast-json-patch','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','desk.js','querystring','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','save','update','then','get','UserProfileResource','destroy','error','name','send','index','map','AnalyticDefaultReport','rawAttributes','type','model','query','keys','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filters','pick','filter','merge','VIRTUAL','includeAll','include','rows','catch','show','params','options','find','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','Reports','UserProfileSection','autoAssociation','DefaultReports','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','preview','join','left_join','right_join','cross_join','SUM(%s)','COUNT(%s)','MIN(%s)','AVG(%s)','GROUP_CONCAT(%s)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','SEC_TO_TIME(%s)','DATE(%s)','HOUR(%s)','ROUND(%s)','UNIX_TIMESTAMP(%s)','includes','IS\x20NULL','IS\x20NOT\x20NULL','IS\x20NOT\x20EMPTY','rules','field','condition','value','Sequelize','ValidationErrorItem','AnalyticMetric','keyBy','from','table','MetricId','metric','function','format','groupBy','orderBy','DESC','alias','joins','parse','parentKey','foreignTable','foreignKey','%s.%s\x20=\x20%s.%s','conditions','group','clone','debug','Limited\x20Query:','sequelize','toString','QueryTypes','COUNT(DISTINCT\x20%s)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)','IS\x20EMPTY','operator','getFields','findAll','select','replace','output','web','%s-%s.%s','randomstring','generate','csv'];(function(_0x381bce,_0x2bb6d2){var _0x31ee41=function(_0x2852c4){while(--_0x2852c4){_0x381bce['push'](_0x381bce['shift']());}};_0x31ee41(++_0x2bb6d2);}(_0x0295,0x1f0));var _0x5029=function(_0x48ecd2,_0x481ad3){_0x48ecd2=_0x48ecd2-0x0;var _0x5a4457=_0x0295[_0x48ecd2];return _0x5a4457;};'use strict';var emlformat=require(_0x5029('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0x5029('0x1'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x5029('0x2'));var Mustache=require(_0x5029('0x3'));var util=require(_0x5029('0x4'));var path=require(_0x5029('0x5'));var sox=require(_0x5029('0x6'));var csv=require(_0x5029('0x7'));var ejs=require(_0x5029('0x8'));var fs=require('fs');var fs_extra=require(_0x5029('0x9'));var _=require(_0x5029('0xa'));var squel=require('squel');var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x5029('0xb'));var toCsv=require('to-csv');var querystring=require(_0x5029('0xc'));var Papa=require('papaparse');var Redis=require(_0x5029('0xd'));var authService=require('../../components/auth/service');var qs=require(_0x5029('0xe'));var as=require(_0x5029('0xf'));var hardwareService=require(_0x5029('0x10'));var logger=require('../../config/logger')(_0x5029('0x11'));var utils=require(_0x5029('0x12'));var config=require(_0x5029('0x13'));var licenseUtil=require('../../config/license/util');var db=require(_0x5029('0x14'))['db'];var dbH=require(_0x5029('0x14'))['dbH'];function respondWithStatusCode(_0x4fa22d,_0x49f836){_0x49f836=_0x49f836||0xcc;return function(_0x4aebb6){if(_0x4aebb6){return _0x4fa22d[_0x5029('0x15')](_0x49f836);}return _0x4fa22d[_0x5029('0x16')](_0x49f836)[_0x5029('0x17')]();};}function respondWithResult(_0x434630,_0x2c0b33){_0x2c0b33=_0x2c0b33||0xc8;return function(_0x11c24b){if(_0x11c24b){return _0x434630[_0x5029('0x16')](_0x2c0b33)[_0x5029('0x18')](_0x11c24b);}};}function respondWithFilteredResult(_0x10bf55,_0x326923){return function(_0x457c73){if(_0x457c73){var _0x353cba=typeof _0x326923[_0x5029('0x19')]===_0x5029('0x1a')&&typeof _0x326923[_0x5029('0x1b')]==='undefined';var _0x1ed567=_0x457c73[_0x5029('0x1c')];var _0x35de81=_0x353cba?0x0:_0x326923[_0x5029('0x19')];var _0x8cea01=_0x353cba?_0x457c73[_0x5029('0x1c')]:_0x326923[_0x5029('0x19')]+_0x326923['limit'];var _0x226a5c;if(_0x8cea01>=_0x1ed567){_0x8cea01=_0x1ed567;_0x226a5c=0xc8;}else{_0x226a5c=0xce;}_0x10bf55['status'](_0x226a5c);return _0x10bf55[_0x5029('0x1d')](_0x5029('0x1e'),_0x35de81+'-'+_0x8cea01+'/'+_0x1ed567)[_0x5029('0x18')](_0x457c73);}return null;};}function patchUpdates(_0x3cf0fb){return function(_0x4b5854){try{jsonpatch['apply'](_0x4b5854,_0x3cf0fb,!![]);}catch(_0x4c9184){return BPromise['reject'](_0x4c9184);}return _0x4b5854[_0x5029('0x1f')]();};}function saveUpdates(_0x853a34,_0x1eb228){return function(_0x2bbbcb){if(_0x2bbbcb){return _0x2bbbcb[_0x5029('0x20')](_0x853a34)[_0x5029('0x21')](function(_0x125c26){return _0x125c26;});}return null;};}function removeEntity(_0x356dac,_0x3e857d){return function(_0x4ceaae){if(_0x4ceaae){return _0x4ceaae['destroy']()['then'](function(){var _0x588d90=_0x4ceaae[_0x5029('0x22')]({'plain':!![]});var _0x51093c='DefaultReports';return db[_0x5029('0x23')][_0x5029('0x24')]({'where':{'type':_0x51093c,'resourceId':_0x588d90['id']}})[_0x5029('0x21')](function(){return _0x4ceaae;});})['then'](function(){_0x356dac[_0x5029('0x16')](0xcc)[_0x5029('0x17')]();});}};}function handleEntityNotFound(_0x5e45c4,_0x2b6d99){return function(_0x31f0a0){if(!_0x31f0a0){_0x5e45c4[_0x5029('0x15')](0x194);}return _0x31f0a0;};}function handleError(_0x4a24b9,_0x32da06){_0x32da06=_0x32da06||0x1f4;return function(_0x251f99){logger[_0x5029('0x25')](_0x251f99['stack']);if(_0x251f99[_0x5029('0x26')]){delete _0x251f99[_0x5029('0x26')];}_0x4a24b9['status'](_0x32da06)[_0x5029('0x27')](_0x251f99);};}exports[_0x5029('0x28')]=function(_0x4434ff,_0x1c3dd9){var _0x196830={},_0x2a1ed6={},_0x44255a={'count':0x0,'rows':[]};var _0x465153=_[_0x5029('0x29')](db[_0x5029('0x2a')][_0x5029('0x2b')],function(_0x4519c8){return{'name':_0x4519c8['fieldName'],'type':_0x4519c8[_0x5029('0x2c')]['key']};});_0x2a1ed6[_0x5029('0x2d')]=_['map'](_0x465153,'name');_0x2a1ed6[_0x5029('0x2e')]=_[_0x5029('0x2f')](_0x4434ff[_0x5029('0x2e')]);_0x2a1ed6['filters']=_[_0x5029('0x30')](_0x2a1ed6[_0x5029('0x2d')],_0x2a1ed6[_0x5029('0x2e')]);_0x196830[_0x5029('0x31')]=_[_0x5029('0x30')](_0x2a1ed6[_0x5029('0x2d')],qs[_0x5029('0x32')](_0x4434ff[_0x5029('0x2e')][_0x5029('0x32')]));_0x196830['attributes']=_0x196830[_0x5029('0x31')][_0x5029('0x33')]?_0x196830[_0x5029('0x31')]:_0x2a1ed6[_0x5029('0x2d')];if(!_0x4434ff['query'][_0x5029('0x34')](_0x5029('0x35'))){_0x196830[_0x5029('0x1b')]=qs['limit'](_0x4434ff['query'][_0x5029('0x1b')]);_0x196830[_0x5029('0x19')]=qs['offset'](_0x4434ff['query'][_0x5029('0x19')]);}_0x196830[_0x5029('0x36')]=qs[_0x5029('0x37')](_0x4434ff[_0x5029('0x2e')][_0x5029('0x37')]);_0x196830[_0x5029('0x38')]=qs[_0x5029('0x39')](_[_0x5029('0x3a')](_0x4434ff[_0x5029('0x2e')],_0x2a1ed6[_0x5029('0x39')]),_0x465153);if(_0x4434ff[_0x5029('0x2e')][_0x5029('0x3b')]){_0x196830[_0x5029('0x38')]=_[_0x5029('0x3c')](_0x196830['where'],{'$or':_['map'](_0x465153,function(_0x73797c){if(_0x73797c[_0x5029('0x2c')]!==_0x5029('0x3d')){var _0x48c9eb={};_0x48c9eb[_0x73797c[_0x5029('0x26')]]={'$like':'%'+_0x4434ff[_0x5029('0x2e')]['filter']+'%'};return _0x48c9eb;}})});}_0x196830=_[_0x5029('0x3c')]({},_0x196830,_0x4434ff['options']);var _0x506f0d={'where':_0x196830['where']};return db[_0x5029('0x2a')][_0x5029('0x1c')](_0x506f0d)[_0x5029('0x21')](function(_0x78768){_0x44255a[_0x5029('0x1c')]=_0x78768;if(_0x4434ff[_0x5029('0x2e')][_0x5029('0x3e')]){_0x196830[_0x5029('0x3f')]=[{'all':!![]}];}return db[_0x5029('0x2a')]['findAll'](_0x196830);})[_0x5029('0x21')](function(_0x236455){_0x44255a[_0x5029('0x40')]=_0x236455;return _0x44255a;})[_0x5029('0x21')](respondWithFilteredResult(_0x1c3dd9,_0x196830))[_0x5029('0x41')](handleError(_0x1c3dd9,null));};exports[_0x5029('0x42')]=function(_0x5658a7,_0x259db8){var _0xa1580a={'raw':!![],'where':{'id':_0x5658a7[_0x5029('0x43')]['id']}},_0x9434ed={};_0x9434ed[_0x5029('0x2d')]=_['keys'](db[_0x5029('0x2a')][_0x5029('0x2b')]);_0x9434ed[_0x5029('0x2e')]=_[_0x5029('0x2f')](_0x5658a7[_0x5029('0x2e')]);_0x9434ed[_0x5029('0x39')]=_[_0x5029('0x30')](_0x9434ed[_0x5029('0x2d')],_0x9434ed[_0x5029('0x2e')]);_0xa1580a['attributes']=_[_0x5029('0x30')](_0x9434ed[_0x5029('0x2d')],qs[_0x5029('0x32')](_0x5658a7[_0x5029('0x2e')]['fields']));_0xa1580a['attributes']=_0xa1580a[_0x5029('0x31')][_0x5029('0x33')]?_0xa1580a[_0x5029('0x31')]:_0x9434ed[_0x5029('0x2d')];if(_0x5658a7[_0x5029('0x2e')][_0x5029('0x3e')]){_0xa1580a[_0x5029('0x3f')]=[{'all':!![]}];}_0xa1580a=_[_0x5029('0x3c')]({},_0xa1580a,_0x5658a7[_0x5029('0x44')]);return db[_0x5029('0x2a')][_0x5029('0x45')](_0xa1580a)[_0x5029('0x21')](handleEntityNotFound(_0x259db8,null))[_0x5029('0x21')](respondWithResult(_0x259db8,null))[_0x5029('0x41')](handleError(_0x259db8,null));};exports[_0x5029('0x46')]=function(_0x175cc0,_0x10fc07){return db[_0x5029('0x2a')][_0x5029('0x46')](_0x175cc0[_0x5029('0x47')],{})[_0x5029('0x21')](function(_0x489457){var _0x1069c4=_0x175cc0['user'][_0x5029('0x22')]({'plain':!![]});if(!_0x1069c4)throw new Error(_0x5029('0x48'));if(_0x1069c4['role']==='user'){var _0x319bff=_0x489457['get']({'plain':!![]});var _0x4aaa43=_0x5029('0x49');return db[_0x5029('0x4a')][_0x5029('0x45')]({'where':{'name':_0x4aaa43,'userProfileId':_0x1069c4['userProfileId']},'raw':!![]})['then'](function(_0x1510bb){if(_0x1510bb&&_0x1510bb[_0x5029('0x4b')]===0x0){return db['UserProfileResource'][_0x5029('0x46')]({'name':_0x319bff['name'],'resourceId':_0x319bff['id'],'type':_0x5029('0x4c'),'sectionId':_0x1510bb['id']},{})['then'](function(){return _0x489457;});}else{return _0x489457;}})[_0x5029('0x41')](function(_0x27e1c0){logger[_0x5029('0x25')](_0x5029('0x4d'),_0x27e1c0);throw _0x27e1c0;});}return _0x489457;})[_0x5029('0x21')](respondWithResult(_0x10fc07,0xc9))[_0x5029('0x41')](handleError(_0x10fc07,null));};exports[_0x5029('0x20')]=function(_0xa25013,_0x586936){if(_0xa25013[_0x5029('0x47')]['id']){delete _0xa25013['body']['id'];}return db[_0x5029('0x2a')][_0x5029('0x45')]({'where':{'id':_0xa25013['params']['id']}})[_0x5029('0x21')](handleEntityNotFound(_0x586936,null))['then'](saveUpdates(_0xa25013['body'],null))['then'](respondWithResult(_0x586936,null))[_0x5029('0x41')](handleError(_0x586936,null));};exports['destroy']=function(_0x49d1db,_0x353ae4){return db[_0x5029('0x2a')]['find']({'where':{'id':_0x49d1db[_0x5029('0x43')]['id']}})['then'](handleEntityNotFound(_0x353ae4,null))['then'](removeEntity(_0x353ae4,null))[_0x5029('0x41')](handleError(_0x353ae4,null));};exports[_0x5029('0x4e')]=function(_0x81e39c,_0x448273){var _0x164179=0xa;var _0x4e8d9f=[_0x5029('0x4f'),_0x5029('0x50'),_0x5029('0x51'),_0x5029('0x52')];var _0x4dca54={'SUM':_0x5029('0x53'),'COUNT':_0x5029('0x54'),'COUNT DISTINCT':'COUNT(DISTINCT\x20%s)','MAX':'MAX(%s)','MIN':_0x5029('0x55'),'AVG':_0x5029('0x56'),'GROUP_CONCAT':_0x5029('0x57'),'GROUP_CONCAT ASC':_0x5029('0x58'),'GROUP_CONCAT DESC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)'};var _0x4208ab={'SEC_TO_TIME':_0x5029('0x59'),'DATE':_0x5029('0x5a'),'HOUR':_0x5029('0x5b'),'ROUND':_0x5029('0x5c'),'UNIX_TIMESTAMP':_0x5029('0x5d')};var _0x59a718=function(_0x560324){return!_[_0x5029('0x5e')]([_0x5029('0x5f'),_0x5029('0x60'),'IS\x20EMPTY',_0x5029('0x61')],_0x560324);};var _0x2d439a=function(_0x105638){if(!_0x105638||!_0x105638[_0x5029('0x62')][_0x5029('0x33')]){return'';}for(var _0x5264c6='(',_0x2ec5d0=0x0;_0x2ec5d0<_0x105638[_0x5029('0x62')][_0x5029('0x33')];_0x2ec5d0+=0x1){_0x2ec5d0>0x0&&(_0x5264c6+='\x20'+_0x105638['operator']+'\x20');_0x5264c6+=_0x105638[_0x5029('0x62')][_0x2ec5d0]['group']?_0x2d439a(_0x105638[_0x5029('0x62')][_0x2ec5d0]['group']):_0x105638[_0x5029('0x62')][_0x2ec5d0][_0x5029('0x63')]+'\x20'+_0x105638[_0x5029('0x62')][_0x2ec5d0][_0x5029('0x64')]+(_0x59a718(_0x105638[_0x5029('0x62')][_0x2ec5d0][_0x5029('0x64')])?'\x20'+_0x105638['rules'][_0x2ec5d0][_0x5029('0x65')]:'');}return _0x5264c6+')';};var _0x19220d={'where':{'id':_0x81e39c['params']['id']}},_0x1ff8df,_0x151562,_0x389700,_0x506f74,_0x13ca47;_0x19220d=_[_0x5029('0x3c')]({},_0x19220d,_0x81e39c['options']);return db[_0x5029('0x2a')]['find'](_0x19220d)[_0x5029('0x21')](function(_0x54daf9){if(_0x54daf9){_0x1ff8df=_0x54daf9;return _0x54daf9['getFields']();}return null;})[_0x5029('0x21')](function(_0x575f09){if(_0x575f09){if(!_0x575f09[_0x5029('0x33')]){throw new db[(_0x5029('0x66'))][(_0x5029('0x67'))]('Please\x20insert\x20at\x20least\x20one\x20field',0x193);}_0x151562=_0x575f09;return db[_0x5029('0x68')]['findAll']({'raw':!![]});}return null;})[_0x5029('0x21')](function(_0x255dfb){if(_0x255dfb){_0x389700=_[_0x5029('0x69')](_0x255dfb,'id');var _0x1cca02;var _0x1deed7=squel['select']();_0x1deed7[_0x5029('0x6a')](_0x1ff8df[_0x5029('0x6b')]);for(var _0x5890ac=0x0;_0x5890ac<_0x151562[_0x5029('0x33')];_0x5890ac+=0x1){_0x1cca02=_0x151562[_0x5890ac][_0x5029('0x6c')]?_0x389700[_0x151562[_0x5890ac][_0x5029('0x6c')]][_0x5029('0x6d')]:_0x151562[_0x5890ac][_0x5029('0x63')];_0x1cca02=_0x151562[_0x5890ac][_0x5029('0x6e')]?_['replace'](_0x4dca54[_0x151562[_0x5890ac]['function']],'%s',_0x1cca02):_0x1cca02;_0x1cca02=_0x151562[_0x5890ac][_0x5029('0x6f')]?_['replace'](_0x4208ab[_0x151562[_0x5890ac][_0x5029('0x6f')]],'%s',_0x1cca02):_0x1cca02;if(_0x151562[_0x5890ac][_0x5029('0x70')]){_0x1deed7['group'](_0x1cca02);}_0x151562[_0x5890ac][_0x5029('0x71')]&&_0x1deed7['order'](_0x1cca02,_0x151562[_0x5890ac]['orderBy']===_0x5029('0x72')?![]:!![]);_0x1deed7[_0x5029('0x63')](_0x1cca02,_0x151562[_0x5890ac][_0x5029('0x73')]||_0x1cca02);}if(_0x1ff8df[_0x5029('0x74')]){_0x1ff8df['joins']=JSON[_0x5029('0x75')](_0x1ff8df[_0x5029('0x74')]);for(var _0x4a2ce8=0x0;_0x4a2ce8<_0x1ff8df[_0x5029('0x74')][_0x5029('0x33')];_0x4a2ce8+=0x1){if(_0x1ff8df['joins'][_0x4a2ce8]['type']&&_['includes'](_0x4e8d9f,_0x1ff8df[_0x5029('0x74')][_0x4a2ce8][_0x5029('0x2c')])&&_0x1ff8df[_0x5029('0x74')][_0x4a2ce8][_0x5029('0x76')]&&_0x1ff8df[_0x5029('0x74')][_0x4a2ce8][_0x5029('0x77')]&&_0x1ff8df[_0x5029('0x74')][_0x4a2ce8][_0x5029('0x78')]){_0x1deed7[_0x1ff8df[_0x5029('0x74')][_0x4a2ce8]['type']](_0x1ff8df['joins'][_0x4a2ce8][_0x5029('0x77')],null,util[_0x5029('0x6f')](_0x5029('0x79'),_0x1ff8df[_0x5029('0x6b')],_0x1ff8df[_0x5029('0x74')][_0x4a2ce8][_0x5029('0x76')],_0x1ff8df[_0x5029('0x74')][_0x4a2ce8]['foreignTable'],_0x1ff8df[_0x5029('0x74')][_0x4a2ce8][_0x5029('0x78')]));}}}if(_0x1ff8df[_0x5029('0x7a')]){_0x1ff8df['conditions']=JSON[_0x5029('0x75')](_0x1ff8df[_0x5029('0x7a')]);_0x1deed7[_0x5029('0x38')](_0x2d439a(_0x1ff8df['conditions'][_0x5029('0x7b')]));}_0x13ca47=_0x1deed7[_0x5029('0x7c')]();_0x1deed7[_0x5029('0x1b')](_0x164179);_0x1deed7['offset'](0x0);logger[_0x5029('0x7d')](_0x5029('0x7e'),_0x1deed7['toString']());return dbH[_0x5029('0x7f')][_0x5029('0x2e')](_0x1deed7[_0x5029('0x80')](),{'type':dbH[_0x5029('0x7f')][_0x5029('0x81')]['SELECT']});}})[_0x5029('0x21')](respondWithResult(_0x448273,null))[_0x5029('0x41')](handleError(_0x448273,null));};function runReport(_0x426d70,_0xe6ac28,_0x153cdc){var _0x5e7f50=_0xe6ac28[_0x5029('0x26')];var _0x202c51=0xa;var _0x344203=['join',_0x5029('0x50'),_0x5029('0x51'),_0x5029('0x52')];var _0x3e47bd={'SUM':_0x5029('0x53'),'COUNT':_0x5029('0x54'),'COUNT DISTINCT':_0x5029('0x82'),'MAX':'MAX(%s)','MIN':_0x5029('0x55'),'AVG':_0x5029('0x56'),'GROUP_CONCAT':_0x5029('0x57'),'GROUP_CONCAT ASC':_0x5029('0x58'),'GROUP_CONCAT DESC':_0x5029('0x83')};var _0x4c40d1={'SEC_TO_TIME':_0x5029('0x59'),'DATE':_0x5029('0x5a'),'HOUR':_0x5029('0x5b'),'ROUND':'ROUND(%s)','UNIX_TIMESTAMP':_0x5029('0x5d')};var _0x41e2d8=function(_0x51098a){return!_['includes'](['IS\x20NULL',_0x5029('0x60'),_0x5029('0x84'),_0x5029('0x61')],_0x51098a);};var _0x4007c8=function(_0x3dc05a){if(!_0x3dc05a||!_0x3dc05a['rules'][_0x5029('0x33')]){return'';}for(var _0x2e4782='(',_0x2c0540=0x0;_0x2c0540<_0x3dc05a['rules']['length'];_0x2c0540+=0x1){_0x2c0540>0x0&&(_0x2e4782+='\x20'+_0x3dc05a[_0x5029('0x85')]+'\x20');_0x2e4782+=_0x3dc05a[_0x5029('0x62')][_0x2c0540][_0x5029('0x7b')]?_0x4007c8(_0x3dc05a[_0x5029('0x62')][_0x2c0540]['group']):_0x3dc05a[_0x5029('0x62')][_0x2c0540][_0x5029('0x63')]+'\x20'+_0x3dc05a[_0x5029('0x62')][_0x2c0540][_0x5029('0x64')]+(_0x41e2d8(_0x3dc05a[_0x5029('0x62')][_0x2c0540][_0x5029('0x64')])?'\x20'+_0x3dc05a[_0x5029('0x62')][_0x2c0540][_0x5029('0x65')]:'');}return _0x2e4782+')';};var _0x5aecc2={'where':{'id':_0x426d70['id']}},_0x159450,_0x556c7a,_0x48bbe2,_0x3e3150,_0x533ee2;_0x5aecc2=_[_0x5029('0x3c')]({},_0x5aecc2,_0x153cdc);return db[_0x5029('0x2a')][_0x5029('0x45')](_0x5aecc2)[_0x5029('0x21')](function(_0x1b6f4c){if(_0x1b6f4c){_0x159450=_0x1b6f4c;return _0x1b6f4c[_0x5029('0x86')]();}return null;})[_0x5029('0x21')](function(_0x1d6092){if(_0x1d6092){if(!_0x1d6092['length']){throw new db['Sequelize'][(_0x5029('0x67'))]('Please\x20insert\x20at\x20least\x20one\x20field',0x193);}_0x556c7a=_0x1d6092;return db['AnalyticMetric'][_0x5029('0x87')]({'raw':!![]});}return null;})['then'](function(_0x4b25ed){if(_0x4b25ed){_0x48bbe2=_[_0x5029('0x69')](_0x4b25ed,'id');var _0xb8da0b;var _0x13e07e=squel[_0x5029('0x88')]();_0x13e07e[_0x5029('0x6a')](_0x159450['table']);for(var _0x38c02a=0x0;_0x38c02a<_0x556c7a[_0x5029('0x33')];_0x38c02a+=0x1){_0xb8da0b=_0x556c7a[_0x38c02a][_0x5029('0x6c')]?_0x48bbe2[_0x556c7a[_0x38c02a]['MetricId']][_0x5029('0x6d')]:_0x556c7a[_0x38c02a][_0x5029('0x63')];_0xb8da0b=_0x556c7a[_0x38c02a][_0x5029('0x6e')]?_[_0x5029('0x89')](_0x3e47bd[_0x556c7a[_0x38c02a][_0x5029('0x6e')]],'%s',_0xb8da0b):_0xb8da0b;_0xb8da0b=_0x556c7a[_0x38c02a]['format']?_['replace'](_0x4c40d1[_0x556c7a[_0x38c02a][_0x5029('0x6f')]],'%s',_0xb8da0b):_0xb8da0b;if(_0x556c7a[_0x38c02a][_0x5029('0x70')]){_0x13e07e['group'](_0xb8da0b);}_0x556c7a[_0x38c02a][_0x5029('0x71')]&&_0x13e07e[_0x5029('0x36')](_0xb8da0b,_0x556c7a[_0x38c02a][_0x5029('0x71')]===_0x5029('0x72')?![]:!![]);_0x13e07e[_0x5029('0x63')](_0xb8da0b,_0x556c7a[_0x38c02a][_0x5029('0x73')]||_0xb8da0b);}if(_0x159450[_0x5029('0x74')]){_0x159450[_0x5029('0x74')]=JSON['parse'](_0x159450['joins']);for(var _0x4243c3=0x0;_0x4243c3<_0x159450['joins'][_0x5029('0x33')];_0x4243c3+=0x1){if(_0x159450['joins'][_0x4243c3][_0x5029('0x2c')]&&_[_0x5029('0x5e')](_0x344203,_0x159450[_0x5029('0x74')][_0x4243c3]['type'])&&_0x159450[_0x5029('0x74')][_0x4243c3][_0x5029('0x76')]&&_0x159450[_0x5029('0x74')][_0x4243c3]['foreignTable']&&_0x159450[_0x5029('0x74')][_0x4243c3][_0x5029('0x78')]){_0x13e07e[_0x159450[_0x5029('0x74')][_0x4243c3][_0x5029('0x2c')]](_0x159450[_0x5029('0x74')][_0x4243c3][_0x5029('0x77')],null,util[_0x5029('0x6f')](_0x5029('0x79'),_0x159450[_0x5029('0x6b')],_0x159450[_0x5029('0x74')][_0x4243c3][_0x5029('0x76')],_0x159450[_0x5029('0x74')][_0x4243c3][_0x5029('0x77')],_0x159450[_0x5029('0x74')][_0x4243c3][_0x5029('0x78')]));}}}if(_0x159450[_0x5029('0x7a')]){_0x159450[_0x5029('0x7a')]=JSON[_0x5029('0x75')](_0x159450['conditions']);_0x13e07e[_0x5029('0x38')](_0x4007c8(_0x159450[_0x5029('0x7a')][_0x5029('0x7b')]));}_0x533ee2=_0x13e07e[_0x5029('0x7c')]();_0x13e07e[_0x5029('0x1b')](_0x202c51);_0x13e07e['offset'](0x0);return;}})[_0x5029('0x21')](function(){if(_0xe6ac28[_0x5029('0x8a')]===_0x5029('0x8b')){return null;}var _0xf7729c=_[_0x5029('0x3c')](_0xe6ac28,{'name':_0xe6ac28['fullPath']||_0xe6ac28[_0x5029('0x26')]||_0x159450[_0x5029('0x26')],'basename':_0x5e7f50,'savename':util[_0x5029('0x6f')](_0x5029('0x8c'),_0xe6ac28[_0x5029('0x26')]||_0x159450['name'],require(_0x5029('0x8d'))[_0x5029('0x8e')](0x4),_0xe6ac28[_0x5029('0x8a')]||_0x5029('0x8f')),'reportId':_0x159450['id'],'reportType':_0x5029('0x90')});return db[_0x5029('0x91')][_0x5029('0x46')](_0xf7729c,{'raw':!![]});})[_0x5029('0x21')](function(_0x4a7535){if(_0x159450['table']===_0x5029('0x92')){_0x533ee2[_0x5029('0x38')](_0x159450[_0x5029('0x6b')]+_0x5029('0x93'),_0xe6ac28[_0x5029('0x94')],_0xe6ac28['endDate']);}else{_0x533ee2[_0x5029('0x38')](_0x159450['table']+_0x5029('0x95'),_0xe6ac28[_0x5029('0x94')],_0xe6ac28[_0x5029('0x96')]);}if(_0x4a7535){logger[_0x5029('0x97')](_0x5029('0x98'),_0x533ee2[_0x5029('0x80')]());require('child_process')[_0x5029('0x99')](path[_0x5029('0x4f')](__dirname,'../../components/export/',_0x4a7535[_0x5029('0x8a')]),[_0x4a7535['id'],_0x533ee2[_0x5029('0x80')](),path['join'](__dirname,_0x5029('0x9a'),_0x4a7535['savename']),_0x5e7f50]);return _0x4a7535;}else{var _0x54c0f3=squel['select']();_0x54c0f3['from']('('+_0x533ee2[_0x5029('0x80')]()+')','countTable');_0x54c0f3[_0x5029('0x63')](_0x5029('0x9b'),'count');_0x533ee2[_0x5029('0x1b')](_0xe6ac28[_0x5029('0x1b')]||_0x202c51);_0x533ee2['offset'](_0xe6ac28[_0x5029('0x19')]||0x0);return dbH[_0x5029('0x7f')]['query'](_0x54c0f3[_0x5029('0x80')](),{'type':dbH[_0x5029('0x7f')]['QueryTypes'][_0x5029('0x9c')]})[_0x5029('0x21')](function(_0x17c755){if(!_0x17c755[_0x5029('0x33')]){_0x3e3150=0x0;}else{_0x3e3150=_0x17c755[0x0][_0x5029('0x1c')]||0x0;}return dbH[_0x5029('0x7f')]['query'](_0x533ee2[_0x5029('0x80')](),{'type':dbH['sequelize'][_0x5029('0x81')][_0x5029('0x9c')]});})[_0x5029('0x21')](function(_0x3ebe00){return{'rows':_0x3ebe00||[],'count':_0x3e3150};});}});}exports[_0x5029('0x9d')]=function(_0x2138cc,_0x331af8){return runReport(_0x2138cc[_0x5029('0x43')],_0x2138cc[_0x5029('0x2e')],_0x2138cc[_0x5029('0x44')])[_0x5029('0x21')](respondWithResult(_0x331af8,null))[_0x5029('0x41')](handleError(_0x331af8,null));};exports[_0x5029('0x9e')]=runReport;exports[_0x5029('0x2e')]=function(_0x9de076,_0x2ac88e){var _0x55ee4f=0xa;var _0x1fa9eb=[_0x5029('0x4f'),_0x5029('0x50'),_0x5029('0x51'),_0x5029('0x52')];var _0x405d47={'SUM':'SUM(%s)','COUNT':_0x5029('0x54'),'COUNT DISTINCT':_0x5029('0x82'),'MAX':_0x5029('0x9f'),'MIN':_0x5029('0x55'),'AVG':_0x5029('0x56'),'GROUP_CONCAT':'GROUP_CONCAT(%s)','GROUP_CONCAT ASC':_0x5029('0x58'),'GROUP_CONCAT DESC':_0x5029('0x83')};var _0x29c3a2={'SEC_TO_TIME':_0x5029('0x59'),'DATE':_0x5029('0x5a'),'HOUR':_0x5029('0x5b'),'ROUND':_0x5029('0x5c'),'UNIX_TIMESTAMP':_0x5029('0x5d')};var _0xb39e9d=function(_0x124c5e){return!_['includes']([_0x5029('0x5f'),'IS\x20NOT\x20NULL',_0x5029('0x84'),_0x5029('0x61')],_0x124c5e);};var _0x120acc=function(_0x21bb22){if(!_0x21bb22||!_0x21bb22['rules'][_0x5029('0x33')]){return'';}for(var _0x339112='(',_0x5d7c1a=0x0;_0x5d7c1a<_0x21bb22[_0x5029('0x62')][_0x5029('0x33')];_0x5d7c1a+=0x1){_0x5d7c1a>0x0&&(_0x339112+='\x20'+_0x21bb22['operator']+'\x20');_0x339112+=_0x21bb22[_0x5029('0x62')][_0x5d7c1a][_0x5029('0x7b')]?_0x120acc(_0x21bb22['rules'][_0x5d7c1a]['group']):_0x21bb22[_0x5029('0x62')][_0x5d7c1a]['field']+'\x20'+_0x21bb22['rules'][_0x5d7c1a][_0x5029('0x64')]+(_0xb39e9d(_0x21bb22['rules'][_0x5d7c1a][_0x5029('0x64')])?'\x20'+_0x21bb22[_0x5029('0x62')][_0x5d7c1a]['value']:'');}return _0x339112+')';};var _0x327299={'where':{'id':_0x9de076['params']['id']}},_0x3463cc,_0x590cc2,_0x3ac39a,_0x37c47b,_0x62e4af;_0x327299=_[_0x5029('0x3c')]({},_0x327299,_0x9de076['options']);return db[_0x5029('0x2a')][_0x5029('0x45')](_0x327299)[_0x5029('0x21')](function(_0x5e7ec8){if(_0x5e7ec8){_0x3463cc=_0x5e7ec8;return _0x5e7ec8[_0x5029('0x86')]();}return null;})[_0x5029('0x21')](function(_0x5aa480){if(_0x5aa480){if(!_0x5aa480[_0x5029('0x33')]){throw new db[(_0x5029('0x66'))]['ValidationErrorItem']('Please\x20insert\x20at\x20least\x20one\x20field',0x193);}_0x590cc2=_0x5aa480;return db[_0x5029('0x68')][_0x5029('0x87')]({'raw':!![]});}return null;})['then'](function(_0x5842a5){if(_0x5842a5){_0x3ac39a=_['keyBy'](_0x5842a5,'id');var _0x313bdb;var _0x1d38e0=squel[_0x5029('0x88')]();_0x1d38e0['from'](_0x3463cc[_0x5029('0x6b')]);for(var _0x581237=0x0;_0x581237<_0x590cc2[_0x5029('0x33')];_0x581237+=0x1){_0x313bdb=_0x590cc2[_0x581237]['MetricId']?_0x3ac39a[_0x590cc2[_0x581237]['MetricId']]['metric']:_0x590cc2[_0x581237]['field'];_0x313bdb=_0x590cc2[_0x581237][_0x5029('0x6e')]?_[_0x5029('0x89')](_0x405d47[_0x590cc2[_0x581237][_0x5029('0x6e')]],'%s',_0x313bdb):_0x313bdb;_0x313bdb=_0x590cc2[_0x581237][_0x5029('0x6f')]?_[_0x5029('0x89')](_0x29c3a2[_0x590cc2[_0x581237]['format']],'%s',_0x313bdb):_0x313bdb;if(_0x590cc2[_0x581237][_0x5029('0x70')]){_0x1d38e0[_0x5029('0x7b')](_0x313bdb);}_0x590cc2[_0x581237][_0x5029('0x71')]&&_0x1d38e0[_0x5029('0x36')](_0x313bdb,_0x590cc2[_0x581237][_0x5029('0x71')]===_0x5029('0x72')?![]:!![]);_0x1d38e0['field'](_0x313bdb,_0x590cc2[_0x581237][_0x5029('0x73')]||_0x313bdb);}if(_0x3463cc[_0x5029('0x74')]){_0x3463cc[_0x5029('0x74')]=JSON['parse'](_0x3463cc['joins']);for(var _0xd05bc9=0x0;_0xd05bc9<_0x3463cc[_0x5029('0x74')][_0x5029('0x33')];_0xd05bc9+=0x1){if(_0x3463cc[_0x5029('0x74')][_0xd05bc9][_0x5029('0x2c')]&&_[_0x5029('0x5e')](_0x1fa9eb,_0x3463cc[_0x5029('0x74')][_0xd05bc9][_0x5029('0x2c')])&&_0x3463cc['joins'][_0xd05bc9][_0x5029('0x76')]&&_0x3463cc[_0x5029('0x74')][_0xd05bc9][_0x5029('0x77')]&&_0x3463cc['joins'][_0xd05bc9][_0x5029('0x78')]){_0x1d38e0[_0x3463cc['joins'][_0xd05bc9][_0x5029('0x2c')]](_0x3463cc[_0x5029('0x74')][_0xd05bc9][_0x5029('0x77')],null,util[_0x5029('0x6f')](_0x5029('0x79'),_0x3463cc[_0x5029('0x6b')],_0x3463cc[_0x5029('0x74')][_0xd05bc9][_0x5029('0x76')],_0x3463cc['joins'][_0xd05bc9]['foreignTable'],_0x3463cc['joins'][_0xd05bc9][_0x5029('0x78')]));}}}if(_0x3463cc[_0x5029('0x7a')]){_0x3463cc[_0x5029('0x7a')]=JSON[_0x5029('0x75')](_0x3463cc[_0x5029('0x7a')]);_0x1d38e0['where'](_0x120acc(_0x3463cc[_0x5029('0x7a')][_0x5029('0x7b')]));}_0x62e4af=_0x1d38e0[_0x5029('0x7c')]();_0x1d38e0[_0x5029('0x1b')](_0x55ee4f);_0x1d38e0[_0x5029('0x19')](0x0);logger['debug'](_0x5029('0x7e'),_0x1d38e0[_0x5029('0x80')]());return dbH[_0x5029('0x7f')][_0x5029('0x2e')](_0x1d38e0[_0x5029('0x80')](),{'type':dbH[_0x5029('0x7f')][_0x5029('0x81')][_0x5029('0x9c')]});}})[_0x5029('0x21')](function(){return{'sql':_0x62e4af[_0x5029('0x80')]()};})[_0x5029('0x21')](respondWithResult(_0x2ac88e,null))[_0x5029('0x41')](handleError(_0x2ac88e,null));};
\ No newline at end of file
diff --git a/server/api/analyticDefaultReport/analyticDefaultReport.model.js b/server/api/analyticDefaultReport/analyticDefaultReport.model.js
index b46e833..0e03ee6 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 _0x3a7d=['api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./analyticDefaultReport.attributes','exports','define','analytics_default_reports','lodash'];(function(_0x43a1b8,_0x1c90c8){var _0x324ecc=function(_0x53a93b){while(--_0x53a93b){_0x43a1b8['push'](_0x43a1b8['shift']());}};_0x324ecc(++_0x1c90c8);}(_0x3a7d,0x14f));var _0xd3a7=function(_0x485f2c,_0x431e8a){_0x485f2c=_0x485f2c-0x0;var _0x202011=_0x3a7d[_0x485f2c];return _0x202011;};'use strict';var _=require(_0xd3a7('0x0'));var util=require('util');var logger=require('../../config/logger')(_0xd3a7('0x1'));var moment=require(_0xd3a7('0x2'));var BPromise=require(_0xd3a7('0x3'));var rp=require(_0xd3a7('0x4'));var fs=require('fs');var path=require(_0xd3a7('0x5'));var rimraf=require(_0xd3a7('0x6'));var config=require(_0xd3a7('0x7'));var attributes=require(_0xd3a7('0x8'));module[_0xd3a7('0x9')]=function(_0x25753e,_0xa5ea22){return _0x25753e[_0xd3a7('0xa')]('AnalyticDefaultReport',attributes,{'tableName':_0xd3a7('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x008b=['path','rimraf','./analyticDefaultReport.attributes','exports','analytics_default_reports','lodash','api','bluebird','request-promise'];(function(_0x39f4bd,_0x1faae1){var _0x481c79=function(_0x14add9){while(--_0x14add9){_0x39f4bd['push'](_0x39f4bd['shift']());}};_0x481c79(++_0x1faae1);}(_0x008b,0x1d0));var _0xb008=function(_0x32f08e,_0x53860c){_0x32f08e=_0x32f08e-0x0;var _0x1300e5=_0x008b[_0x32f08e];return _0x1300e5;};'use strict';var _=require(_0xb008('0x0'));var util=require('util');var logger=require('../../config/logger')(_0xb008('0x1'));var moment=require('moment');var BPromise=require(_0xb008('0x2'));var rp=require(_0xb008('0x3'));var fs=require('fs');var path=require(_0xb008('0x4'));var rimraf=require(_0xb008('0x5'));var config=require('../../config/environment');var attributes=require(_0xb008('0x6'));module[_0xb008('0x7')]=function(_0x568633,_0x1c097b){return _0x568633['define']('AnalyticDefaultReport',attributes,{'tableName':_0xb008('0x8'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
diff --git a/server/api/analyticDefaultReport/analyticDefaultReport.rpc.js b/server/api/analyticDefaultReport/analyticDefaultReport.rpc.js
index d148ece..d5c6f6f 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 _0x8505=['message','result','catch','lodash','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','AnalyticDefaultReport,\x20%s,\x20%s','request\x20sent','debug','AnalyticDefaultReport,\x20%s,\x20%s,\x20%s','error'];(function(_0x2dde16,_0x14532e){var _0x2fb0f9=function(_0x329a6b){while(--_0x329a6b){_0x2dde16['push'](_0x2dde16['shift']());}};_0x2fb0f9(++_0x14532e);}(_0x8505,0x117));var _0x5850=function(_0x1f4f08,_0x16a037){_0x1f4f08=_0x1f4f08-0x0;var _0x44701c=_0x8505[_0x1f4f08];return _0x44701c;};'use strict';var _=require(_0x5850('0x0'));var util=require('util');var moment=require(_0x5850('0x1'));var BPromise=require('bluebird');var rs=require(_0x5850('0x2'));var fs=require('fs');var Redis=require(_0x5850('0x3'));var db=require(_0x5850('0x4'))['db'];var utils=require(_0x5850('0x5'));var logger=require(_0x5850('0x6'))(_0x5850('0x7'));var config=require(_0x5850('0x8'));var jayson=require(_0x5850('0x9'));var client=jayson[_0x5850('0xa')][_0x5850('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x575b70,_0xa1ca82,_0x2f805c){return new BPromise(function(_0x49f78b,_0x2f28ba){return client[_0x5850('0xc')](_0x575b70,_0x2f805c)[_0x5850('0xd')](function(_0x2f558d){logger[_0x5850('0xe')](_0x5850('0xf'),_0xa1ca82,_0x5850('0x10'));logger[_0x5850('0x11')](_0x5850('0x12'),_0xa1ca82,_0x5850('0x10'),JSON['stringify'](_0x2f558d));if(_0x2f558d['error']){if(_0x2f558d['error']['code']===0x1f4){logger[_0x5850('0x13')](_0x5850('0xf'),_0xa1ca82,_0x2f558d[_0x5850('0x13')][_0x5850('0x14')]);return _0x2f28ba(_0x2f558d[_0x5850('0x13')][_0x5850('0x14')]);}logger[_0x5850('0x13')](_0x5850('0xf'),_0xa1ca82,_0x2f558d['error'][_0x5850('0x14')]);return _0x49f78b(_0x2f558d[_0x5850('0x13')][_0x5850('0x14')]);}else{logger[_0x5850('0xe')]('AnalyticDefaultReport,\x20%s,\x20%s',_0xa1ca82,_0x5850('0x10'));_0x49f78b(_0x2f558d[_0x5850('0x15')]['message']);}})[_0x5850('0x16')](function(_0x242696){logger[_0x5850('0x13')](_0x5850('0xf'),_0xa1ca82,_0x242696);_0x2f28ba(_0x242696);});});}
\ No newline at end of file
+var _0xd95c=['stringify','code','error','message','result','catch','lodash','moment','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','request','then','info','AnalyticDefaultReport,\x20%s,\x20%s','request\x20sent','AnalyticDefaultReport,\x20%s,\x20%s,\x20%s'];(function(_0xbed841,_0x407544){var _0x3bb7f9=function(_0x43ba41){while(--_0x43ba41){_0xbed841['push'](_0xbed841['shift']());}};_0x3bb7f9(++_0x407544);}(_0xd95c,0x15f));var _0xcd95=function(_0x4de87a,_0x51097f){_0x4de87a=_0x4de87a-0x0;var _0x59e1b8=_0xd95c[_0x4de87a];return _0x59e1b8;};'use strict';var _=require(_0xcd95('0x0'));var util=require('util');var moment=require(_0xcd95('0x1'));var BPromise=require('bluebird');var rs=require(_0xcd95('0x2'));var fs=require('fs');var Redis=require(_0xcd95('0x3'));var db=require(_0xcd95('0x4'))['db'];var utils=require(_0xcd95('0x5'));var logger=require('../../config/logger')(_0xcd95('0x6'));var config=require(_0xcd95('0x7'));var jayson=require(_0xcd95('0x8'));var client=jayson[_0xcd95('0x9')][_0xcd95('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x387d69,_0x1ae510,_0x16cd52){return new BPromise(function(_0x2aebe9,_0x655d87){return client[_0xcd95('0xb')](_0x387d69,_0x16cd52)[_0xcd95('0xc')](function(_0x8696aa){logger[_0xcd95('0xd')](_0xcd95('0xe'),_0x1ae510,_0xcd95('0xf'));logger['debug'](_0xcd95('0x10'),_0x1ae510,'request\x20sent',JSON[_0xcd95('0x11')](_0x8696aa));if(_0x8696aa['error']){if(_0x8696aa['error'][_0xcd95('0x12')]===0x1f4){logger['error'](_0xcd95('0xe'),_0x1ae510,_0x8696aa[_0xcd95('0x13')][_0xcd95('0x14')]);return _0x655d87(_0x8696aa['error'][_0xcd95('0x14')]);}logger[_0xcd95('0x13')](_0xcd95('0xe'),_0x1ae510,_0x8696aa[_0xcd95('0x13')]['message']);return _0x2aebe9(_0x8696aa[_0xcd95('0x13')]['message']);}else{logger[_0xcd95('0xd')]('AnalyticDefaultReport,\x20%s,\x20%s',_0x1ae510,_0xcd95('0xf'));_0x2aebe9(_0x8696aa[_0xcd95('0x15')][_0xcd95('0x14')]);}})[_0xcd95('0x16')](function(_0xc8125){logger[_0xcd95('0x13')](_0xcd95('0xe'),_0x1ae510,_0xc8125);_0x655d87(_0xc8125);});});}
\ No newline at end of file
diff --git a/server/api/analyticDefaultReport/index.js b/server/api/analyticDefaultReport/index.js
index b2e17d4..ada6d14 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 _0x18e9=['put','update','delete','destroy','exports','multer','util','path','connect-timeout','express','fs-extra','../../components/auth/service','../../config/environment','get','isAuthenticated','index','/:id','/:id/preview','preview','/:id/run','run','/:id/query','post','create'];(function(_0x1ced7c,_0x7c55ad){var _0x511fb1=function(_0x41d0e7){while(--_0x41d0e7){_0x1ced7c['push'](_0x1ced7c['shift']());}};_0x511fb1(++_0x7c55ad);}(_0x18e9,0x1e5));var _0x918e=function(_0x34325b,_0x5e5afe){_0x34325b=_0x34325b-0x0;var _0x3da348=_0x18e9[_0x34325b];return _0x3da348;};'use strict';var multer=require(_0x918e('0x0'));var util=require(_0x918e('0x1'));var path=require(_0x918e('0x2'));var timeout=require(_0x918e('0x3'));var express=require(_0x918e('0x4'));var router=express['Router']();var fs_extra=require(_0x918e('0x5'));var auth=require(_0x918e('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0x918e('0x7'));var controller=require('./analyticDefaultReport.controller');router[_0x918e('0x8')]('/',auth[_0x918e('0x9')](),controller[_0x918e('0xa')]);router['get'](_0x918e('0xb'),auth[_0x918e('0x9')](),controller['show']);router[_0x918e('0x8')](_0x918e('0xc'),auth[_0x918e('0x9')](),controller[_0x918e('0xd')]);router[_0x918e('0x8')](_0x918e('0xe'),auth[_0x918e('0x9')](),controller[_0x918e('0xf')]);router['get'](_0x918e('0x10'),auth[_0x918e('0x9')](),controller['query']);router[_0x918e('0x11')]('/',auth['isAuthenticated'](),controller[_0x918e('0x12')]);router[_0x918e('0x13')]('/:id',auth[_0x918e('0x9')](),controller[_0x918e('0x14')]);router[_0x918e('0x15')](_0x918e('0xb'),auth[_0x918e('0x9')](),controller[_0x918e('0x16')]);module[_0x918e('0x17')]=router;
\ No newline at end of file
+var _0xb1ef=['./analyticDefaultReport.controller','isAuthenticated','index','get','/:id','/:id/preview','preview','/:id/run','run','/:id/query','query','post','create','put','update','destroy','exports','multer','util','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment'];(function(_0x5634d2,_0x40ec38){var _0x4150b5=function(_0x44ceef){while(--_0x44ceef){_0x5634d2['push'](_0x5634d2['shift']());}};_0x4150b5(++_0x40ec38);}(_0xb1ef,0x93));var _0xfb1e=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xb1ef[_0x20a584];return _0x4b41a8;};'use strict';var multer=require(_0xfb1e('0x0'));var util=require(_0xfb1e('0x1'));var path=require('path');var timeout=require(_0xfb1e('0x2'));var express=require(_0xfb1e('0x3'));var router=express[_0xfb1e('0x4')]();var fs_extra=require(_0xfb1e('0x5'));var auth=require(_0xfb1e('0x6'));var interaction=require(_0xfb1e('0x7'));var config=require(_0xfb1e('0x8'));var controller=require(_0xfb1e('0x9'));router['get']('/',auth[_0xfb1e('0xa')](),controller[_0xfb1e('0xb')]);router[_0xfb1e('0xc')](_0xfb1e('0xd'),auth['isAuthenticated'](),controller['show']);router[_0xfb1e('0xc')](_0xfb1e('0xe'),auth[_0xfb1e('0xa')](),controller[_0xfb1e('0xf')]);router[_0xfb1e('0xc')](_0xfb1e('0x10'),auth[_0xfb1e('0xa')](),controller[_0xfb1e('0x11')]);router['get'](_0xfb1e('0x12'),auth[_0xfb1e('0xa')](),controller[_0xfb1e('0x13')]);router[_0xfb1e('0x14')]('/',auth[_0xfb1e('0xa')](),controller[_0xfb1e('0x15')]);router[_0xfb1e('0x16')]('/:id',auth[_0xfb1e('0xa')](),controller[_0xfb1e('0x17')]);router['delete'](_0xfb1e('0xd'),auth[_0xfb1e('0xa')](),controller[_0xfb1e('0x18')]);module[_0xfb1e('0x19')]=router;
\ No newline at end of file
diff --git a/server/api/analyticExtractedReport/analyticExtractedReport.attributes.js b/server/api/analyticExtractedReport/analyticExtractedReport.attributes.js
index 949f3ac..2b5a5d1 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 _0x0ffc=['xlsx','DATE','Loading','ENUM','manual','scheduled','INTEGER','sequelize','exports','STRING','pdf'];(function(_0x405bed,_0x2376c7){var _0x497d26=function(_0x575eb7){while(--_0x575eb7){_0x405bed['push'](_0x405bed['shift']());}};_0x497d26(++_0x2376c7);}(_0x0ffc,0x193));var _0xc0ff=function(_0x52efad,_0x567969){_0x52efad=_0x52efad-0x0;var _0x7681be=_0x0ffc[_0x52efad];return _0x7681be;};'use strict';var Sequelize=require(_0xc0ff('0x0'));var moment=require('moment');module[_0xc0ff('0x1')]={'name':{'type':Sequelize['STRING'],'allowNull':![]},'basename':{'type':Sequelize[_0xc0ff('0x2')],'allowNull':![]},'output':{'type':Sequelize['ENUM']('csv',_0xc0ff('0x3'),_0xc0ff('0x4')),'allowNull':![],'defaultValue':'csv'},'savename':{'type':Sequelize[_0xc0ff('0x2')],'allowNull':![]},'startDate':{'type':Sequelize[_0xc0ff('0x5')]},'endDate':{'type':Sequelize[_0xc0ff('0x5')]},'status':{'type':Sequelize[_0xc0ff('0x2')],'defaultValue':_0xc0ff('0x6')},'type':{'type':Sequelize[_0xc0ff('0x7')](_0xc0ff('0x8'),_0xc0ff('0x9')),'allowNull':![],'defaultValue':'manual'},'reportId':{'type':Sequelize[_0xc0ff('0xa')](0xb)['UNSIGNED']},'reportType':{'type':Sequelize[_0xc0ff('0x2')]}};
\ No newline at end of file
+var _0x5fb0=['DATE','Loading','manual','scheduled','INTEGER','UNSIGNED','sequelize','moment','STRING','ENUM','csv','xlsx'];(function(_0xce06d0,_0xe944b9){var _0x360347=function(_0x565311){while(--_0x565311){_0xce06d0['push'](_0xce06d0['shift']());}};_0x360347(++_0xe944b9);}(_0x5fb0,0x10e));var _0x05fb=function(_0x1b0165,_0x33a8c0){_0x1b0165=_0x1b0165-0x0;var _0x80ea5c=_0x5fb0[_0x1b0165];return _0x80ea5c;};'use strict';var Sequelize=require(_0x05fb('0x0'));var moment=require(_0x05fb('0x1'));module['exports']={'name':{'type':Sequelize['STRING'],'allowNull':![]},'basename':{'type':Sequelize[_0x05fb('0x2')],'allowNull':![]},'output':{'type':Sequelize[_0x05fb('0x3')](_0x05fb('0x4'),'pdf',_0x05fb('0x5')),'allowNull':![],'defaultValue':_0x05fb('0x4')},'savename':{'type':Sequelize['STRING'],'allowNull':![]},'startDate':{'type':Sequelize['DATE']},'endDate':{'type':Sequelize[_0x05fb('0x6')]},'status':{'type':Sequelize['STRING'],'defaultValue':_0x05fb('0x7')},'type':{'type':Sequelize[_0x05fb('0x3')](_0x05fb('0x8'),_0x05fb('0x9')),'allowNull':![],'defaultValue':_0x05fb('0x8')},'reportId':{'type':Sequelize[_0x05fb('0xa')](0xb)[_0x05fb('0xb')]},'reportType':{'type':Sequelize[_0x05fb('0x2')]}};
\ No newline at end of file
diff --git a/server/api/analyticExtractedReport/analyticExtractedReport.controller.js b/server/api/analyticExtractedReport/analyticExtractedReport.controller.js
index 545c7fa..2d8400d 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 _0xe521=['set','Content-Range','reject','save','update','then','destroy','get','ExtractedReports','UserProfileResource','end','error','name','send','AnalyticExtractedReport','fieldName','model','map','keys','query','intersection','attributes','fields','hasOwnProperty','nolimit','sort','where','filters','pick','filter','merge','type','includeAll','include','findAll','catch','show','params','rawAttributes','length','options','find','create','body','user','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','download','basename','savename','output','existsSync','Sequelize','ValidationError','Report\x20not\x20found\x20or\x20empty','exists','join','root','server/files/reports','toLowerCase','eml-format','rimraf','moment','mustache','path','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','json','offset','undefined','limit','count'];(function(_0x4b7b9b,_0xa4aff9){var _0x3be710=function(_0x5b64fa){while(--_0x5b64fa){_0x4b7b9b['push'](_0x4b7b9b['shift']());}};_0x3be710(++_0xa4aff9);}(_0xe521,0x9a));var _0x1e52=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xe521[_0x3dd15e];return _0x231fd0;};'use strict';var emlformat=require(_0x1e52('0x0'));var rimraf=require(_0x1e52('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x1e52('0x2'));var BPromise=require('bluebird');var Mustache=require(_0x1e52('0x3'));var util=require('util');var path=require(_0x1e52('0x4'));var sox=require('sox');var csv=require(_0x1e52('0x5'));var ejs=require(_0x1e52('0x6'));var fs=require('fs');var fs_extra=require(_0x1e52('0x7'));var _=require(_0x1e52('0x8'));var squel=require(_0x1e52('0x9'));var crypto=require('crypto');var jsforce=require(_0x1e52('0xa'));var deskjs=require(_0x1e52('0xb'));var toCsv=require('to-csv');var querystring=require(_0x1e52('0xc'));var Papa=require(_0x1e52('0xd'));var Redis=require(_0x1e52('0xe'));var authService=require('../../components/auth/service');var qs=require(_0x1e52('0xf'));var as=require(_0x1e52('0x10'));var hardwareService=require(_0x1e52('0x11'));var logger=require(_0x1e52('0x12'))(_0x1e52('0x13'));var utils=require(_0x1e52('0x14'));var config=require('../../config/environment');var licenseUtil=require(_0x1e52('0x15'));var db=require(_0x1e52('0x16'))['db'];function respondWithStatusCode(_0x558ec4,_0x3dd8bb){_0x3dd8bb=_0x3dd8bb||0xcc;return function(_0x24700){if(_0x24700){return _0x558ec4[_0x1e52('0x17')](_0x3dd8bb);}return _0x558ec4[_0x1e52('0x18')](_0x3dd8bb)['end']();};}function respondWithResult(_0x127633,_0x16a8cf){_0x16a8cf=_0x16a8cf||0xc8;return function(_0xdc2b72){if(_0xdc2b72){return _0x127633[_0x1e52('0x18')](_0x16a8cf)[_0x1e52('0x19')](_0xdc2b72);}};}function respondWithFilteredResult(_0x22a779,_0x59f310){return function(_0x4c0505){if(_0x4c0505){var _0x1e8b0f=typeof _0x59f310[_0x1e52('0x1a')]===_0x1e52('0x1b')&&typeof _0x59f310[_0x1e52('0x1c')]===_0x1e52('0x1b');var _0x16747c=_0x4c0505[_0x1e52('0x1d')];var _0x11f9ab=_0x1e8b0f?0x0:_0x59f310[_0x1e52('0x1a')];var _0x2970c5=_0x1e8b0f?_0x4c0505['count']:_0x59f310[_0x1e52('0x1a')]+_0x59f310[_0x1e52('0x1c')];var _0x28b431;if(_0x2970c5>=_0x16747c){_0x2970c5=_0x16747c;_0x28b431=0xc8;}else{_0x28b431=0xce;}_0x22a779[_0x1e52('0x18')](_0x28b431);return _0x22a779[_0x1e52('0x1e')](_0x1e52('0x1f'),_0x11f9ab+'-'+_0x2970c5+'/'+_0x16747c)[_0x1e52('0x19')](_0x4c0505);}return null;};}function patchUpdates(_0x7e6f4d){return function(_0x44d98c){try{jsonpatch['apply'](_0x44d98c,_0x7e6f4d,!![]);}catch(_0x13d292){return BPromise[_0x1e52('0x20')](_0x13d292);}return _0x44d98c[_0x1e52('0x21')]();};}function saveUpdates(_0x283afd,_0x41e5f3){return function(_0x3b56f2){if(_0x3b56f2){return _0x3b56f2[_0x1e52('0x22')](_0x283afd)[_0x1e52('0x23')](function(_0x48246d){return _0x48246d;});}return null;};}function removeEntity(_0x486174,_0x13ad92){return function(_0x1230bf){if(_0x1230bf){return _0x1230bf[_0x1e52('0x24')]()[_0x1e52('0x23')](function(){var _0x1b3328=_0x1230bf[_0x1e52('0x25')]({'plain':!![]});var _0x1a8718=_0x1e52('0x26');return db[_0x1e52('0x27')][_0x1e52('0x24')]({'where':{'type':_0x1a8718,'resourceId':_0x1b3328['id']}})['then'](function(){return _0x1230bf;});})[_0x1e52('0x23')](function(){_0x486174['status'](0xcc)[_0x1e52('0x28')]();});}};}function handleEntityNotFound(_0x12b70e,_0xcf692e){return function(_0x4781d8){if(!_0x4781d8){_0x12b70e[_0x1e52('0x17')](0x194);}return _0x4781d8;};}function handleError(_0x27a465,_0x1e0e60){_0x1e0e60=_0x1e0e60||0x1f4;return function(_0x228fd7){logger[_0x1e52('0x29')](_0x228fd7['stack']);if(_0x228fd7['name']){delete _0x228fd7[_0x1e52('0x2a')];}_0x27a465[_0x1e52('0x18')](_0x1e0e60)[_0x1e52('0x2b')](_0x228fd7);};}exports['index']=function(_0x42145f,_0x4ed76d){var _0x142c29={},_0x3302c9={},_0x1755b7={'count':0x0,'rows':[]};var _0x30acb3=_['map'](db[_0x1e52('0x2c')]['rawAttributes'],function(_0x23356b){return{'name':_0x23356b[_0x1e52('0x2d')],'type':_0x23356b['type']['key']};});_0x3302c9[_0x1e52('0x2e')]=_[_0x1e52('0x2f')](_0x30acb3,_0x1e52('0x2a'));_0x3302c9['query']=_[_0x1e52('0x30')](_0x42145f[_0x1e52('0x31')]);_0x3302c9['filters']=_[_0x1e52('0x32')](_0x3302c9['model'],_0x3302c9[_0x1e52('0x31')]);_0x142c29[_0x1e52('0x33')]=_[_0x1e52('0x32')](_0x3302c9[_0x1e52('0x2e')],qs[_0x1e52('0x34')](_0x42145f[_0x1e52('0x31')]['fields']));_0x142c29[_0x1e52('0x33')]=_0x142c29[_0x1e52('0x33')]['length']?_0x142c29[_0x1e52('0x33')]:_0x3302c9[_0x1e52('0x2e')];if(!_0x42145f[_0x1e52('0x31')][_0x1e52('0x35')](_0x1e52('0x36'))){_0x142c29['limit']=qs[_0x1e52('0x1c')](_0x42145f[_0x1e52('0x31')][_0x1e52('0x1c')]);_0x142c29[_0x1e52('0x1a')]=qs[_0x1e52('0x1a')](_0x42145f[_0x1e52('0x31')][_0x1e52('0x1a')]);}_0x142c29['order']=qs[_0x1e52('0x37')](_0x42145f[_0x1e52('0x31')][_0x1e52('0x37')]);_0x142c29[_0x1e52('0x38')]=qs[_0x1e52('0x39')](_[_0x1e52('0x3a')](_0x42145f[_0x1e52('0x31')],_0x3302c9['filters']),_0x30acb3);if(_0x42145f[_0x1e52('0x31')][_0x1e52('0x3b')]){_0x142c29[_0x1e52('0x38')]=_[_0x1e52('0x3c')](_0x142c29['where'],{'$or':_[_0x1e52('0x2f')](_0x30acb3,function(_0x5807b2){if(_0x5807b2[_0x1e52('0x3d')]!=='VIRTUAL'){var _0x232109={};_0x232109[_0x5807b2[_0x1e52('0x2a')]]={'$like':'%'+_0x42145f[_0x1e52('0x31')]['filter']+'%'};return _0x232109;}})});}_0x142c29=_[_0x1e52('0x3c')]({},_0x142c29,_0x42145f['options']);var _0xe48fd0={'where':_0x142c29['where']};return db['AnalyticExtractedReport'][_0x1e52('0x1d')](_0xe48fd0)[_0x1e52('0x23')](function(_0x2cbf88){_0x1755b7[_0x1e52('0x1d')]=_0x2cbf88;if(_0x42145f[_0x1e52('0x31')][_0x1e52('0x3e')]){_0x142c29[_0x1e52('0x3f')]=[{'all':!![]}];}return db[_0x1e52('0x2c')][_0x1e52('0x40')](_0x142c29);})[_0x1e52('0x23')](function(_0x3be5eb){_0x1755b7['rows']=_0x3be5eb;return _0x1755b7;})[_0x1e52('0x23')](respondWithFilteredResult(_0x4ed76d,_0x142c29))[_0x1e52('0x41')](handleError(_0x4ed76d,null));};exports[_0x1e52('0x42')]=function(_0x16f393,_0x5e06ed){var _0x4c5b3f={'raw':!![],'where':{'id':_0x16f393[_0x1e52('0x43')]['id']}},_0x3409c0={};_0x3409c0[_0x1e52('0x2e')]=_[_0x1e52('0x30')](db[_0x1e52('0x2c')][_0x1e52('0x44')]);_0x3409c0[_0x1e52('0x31')]=_[_0x1e52('0x30')](_0x16f393['query']);_0x3409c0[_0x1e52('0x39')]=_[_0x1e52('0x32')](_0x3409c0[_0x1e52('0x2e')],_0x3409c0['query']);_0x4c5b3f[_0x1e52('0x33')]=_['intersection'](_0x3409c0[_0x1e52('0x2e')],qs[_0x1e52('0x34')](_0x16f393['query'][_0x1e52('0x34')]));_0x4c5b3f['attributes']=_0x4c5b3f[_0x1e52('0x33')][_0x1e52('0x45')]?_0x4c5b3f['attributes']:_0x3409c0[_0x1e52('0x2e')];if(_0x16f393['query'][_0x1e52('0x3e')]){_0x4c5b3f['include']=[{'all':!![]}];}_0x4c5b3f=_[_0x1e52('0x3c')]({},_0x4c5b3f,_0x16f393[_0x1e52('0x46')]);return db[_0x1e52('0x2c')][_0x1e52('0x47')](_0x4c5b3f)[_0x1e52('0x23')](handleEntityNotFound(_0x5e06ed,null))[_0x1e52('0x23')](respondWithResult(_0x5e06ed,null))[_0x1e52('0x41')](handleError(_0x5e06ed,null));};exports[_0x1e52('0x48')]=function(_0x52e3fe,_0x402c63){return db['AnalyticExtractedReport'][_0x1e52('0x48')](_0x52e3fe[_0x1e52('0x49')],{})[_0x1e52('0x23')](function(_0x5565e1){var _0x31d0a1=_0x52e3fe[_0x1e52('0x4a')][_0x1e52('0x25')]({'plain':!![]});if(!_0x31d0a1)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x31d0a1['role']===_0x1e52('0x4a')){var _0x44aae5=_0x5565e1[_0x1e52('0x25')]({'plain':!![]});var _0x17b56a=_0x1e52('0x26');return db[_0x1e52('0x4b')][_0x1e52('0x47')]({'where':{'name':_0x17b56a,'userProfileId':_0x31d0a1[_0x1e52('0x4c')]},'raw':!![]})['then'](function(_0x13b899){if(_0x13b899&&_0x13b899[_0x1e52('0x4d')]===0x0){return db['UserProfileResource'][_0x1e52('0x48')]({'name':_0x44aae5[_0x1e52('0x2a')],'resourceId':_0x44aae5['id'],'type':_0x13b899[_0x1e52('0x2a')],'sectionId':_0x13b899['id']},{})[_0x1e52('0x23')](function(){return _0x5565e1;});}else{return _0x5565e1;}})[_0x1e52('0x41')](function(_0x3676ed){logger['error'](_0x1e52('0x4e'),_0x3676ed);throw _0x3676ed;});}return _0x5565e1;})[_0x1e52('0x23')](respondWithResult(_0x402c63,0xc9))[_0x1e52('0x41')](handleError(_0x402c63,null));};exports[_0x1e52('0x22')]=function(_0x405a77,_0x10a39a){if(_0x405a77[_0x1e52('0x49')]['id']){delete _0x405a77[_0x1e52('0x49')]['id'];}return db['AnalyticExtractedReport']['find']({'where':{'id':_0x405a77[_0x1e52('0x43')]['id']}})[_0x1e52('0x23')](handleEntityNotFound(_0x10a39a,null))[_0x1e52('0x23')](saveUpdates(_0x405a77[_0x1e52('0x49')],null))[_0x1e52('0x23')](respondWithResult(_0x10a39a,null))[_0x1e52('0x41')](handleError(_0x10a39a,null));};exports['destroy']=function(_0x396e72,_0x5dea94){return db[_0x1e52('0x2c')][_0x1e52('0x47')]({'where':{'id':_0x396e72['params']['id']}})[_0x1e52('0x23')](handleEntityNotFound(_0x5dea94,null))[_0x1e52('0x23')](removeEntity(_0x5dea94,null))[_0x1e52('0x41')](handleError(_0x5dea94,null));};exports[_0x1e52('0x4f')]=function(_0x2007ed,_0x33d8a8,_0x27e214){return db[_0x1e52('0x2c')]['find']({'where':{'id':_0x2007ed[_0x1e52('0x43')]['id']},'attributes':['name',_0x1e52('0x50'),_0x1e52('0x51'),_0x1e52('0x52')],'raw':!![]})[_0x1e52('0x23')](handleEntityNotFound(_0x33d8a8,null))[_0x1e52('0x23')](function(_0x4fcf72){if(_0x4fcf72){if(!fs[_0x1e52('0x53')](path['join'](config['root'],'server/files/reports',_0x4fcf72[_0x1e52('0x51')]))){throw new db[(_0x1e52('0x54'))][(_0x1e52('0x55'))](_0x1e52('0x56'));}if(_0x2007ed[_0x1e52('0x31')][_0x1e52('0x57')]){return _0x33d8a8['sendStatus'](0xc8);}return _0x33d8a8[_0x1e52('0x4f')](path[_0x1e52('0x58')](config[_0x1e52('0x59')],_0x1e52('0x5a'),_0x4fcf72[_0x1e52('0x51')]),util['format']('%s.%s',_0x4fcf72[_0x1e52('0x50')]||_0x4fcf72[_0x1e52('0x2a')],_0x4fcf72[_0x1e52('0x52')][_0x1e52('0x5b')]()));}})[_0x1e52('0x41')](handleError(_0x33d8a8,null));};
\ No newline at end of file
+var _0x9c77=['querystring','papaparse','../../components/parsers/qs','../../config/license/hardware','../../config/logger','../../config/license/util','../../mysqldb','sendStatus','status','end','offset','undefined','limit','count','set','Content-Range','json','apply','reject','save','update','then','destroy','get','ExtractedReports','error','stack','name','send','map','AnalyticExtractedReport','fieldName','type','key','filters','intersection','model','query','attributes','fields','length','nolimit','order','sort','where','pick','merge','filter','options','include','rows','catch','show','params','rawAttributes','keys','includeAll','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','basename','savename','output','existsSync','root','server/files/reports','Sequelize','ValidationError','exists','download','join','%s.%s','toLowerCase','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','util','path','fs-extra','lodash','squel','desk.js','to-csv'];(function(_0x3cd077,_0x55b90f){var _0x5b5b52=function(_0x38ce8b){while(--_0x38ce8b){_0x3cd077['push'](_0x3cd077['shift']());}};_0x5b5b52(++_0x55b90f);}(_0x9c77,0x10a));var _0x79c7=function(_0x48e0ea,_0x5e9c7d){_0x48e0ea=_0x48e0ea-0x0;var _0x97946d=_0x9c77[_0x48e0ea];return _0x97946d;};'use strict';var emlformat=require(_0x79c7('0x0'));var rimraf=require(_0x79c7('0x1'));var zipdir=require(_0x79c7('0x2'));var jsonpatch=require(_0x79c7('0x3'));var rp=require(_0x79c7('0x4'));var moment=require('moment');var BPromise=require(_0x79c7('0x5'));var Mustache=require('mustache');var util=require(_0x79c7('0x6'));var path=require(_0x79c7('0x7'));var sox=require('sox');var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x79c7('0x8'));var _=require(_0x79c7('0x9'));var squel=require(_0x79c7('0xa'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x79c7('0xb'));var toCsv=require(_0x79c7('0xc'));var querystring=require(_0x79c7('0xd'));var Papa=require(_0x79c7('0xe'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x79c7('0xf'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x79c7('0x10'));var logger=require(_0x79c7('0x11'))('api');var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0x79c7('0x12'));var db=require(_0x79c7('0x13'))['db'];function respondWithStatusCode(_0x3775e3,_0x51e248){_0x51e248=_0x51e248||0xcc;return function(_0x2ac515){if(_0x2ac515){return _0x3775e3[_0x79c7('0x14')](_0x51e248);}return _0x3775e3[_0x79c7('0x15')](_0x51e248)[_0x79c7('0x16')]();};}function respondWithResult(_0x5611e5,_0x5b1a6a){_0x5b1a6a=_0x5b1a6a||0xc8;return function(_0x529e1a){if(_0x529e1a){return _0x5611e5[_0x79c7('0x15')](_0x5b1a6a)['json'](_0x529e1a);}};}function respondWithFilteredResult(_0x404c69,_0x5690b4){return function(_0x58d20e){if(_0x58d20e){var _0x49ff26=typeof _0x5690b4[_0x79c7('0x17')]===_0x79c7('0x18')&&typeof _0x5690b4[_0x79c7('0x19')]===_0x79c7('0x18');var _0x3b093b=_0x58d20e[_0x79c7('0x1a')];var _0x8f489a=_0x49ff26?0x0:_0x5690b4[_0x79c7('0x17')];var _0x22cede=_0x49ff26?_0x58d20e['count']:_0x5690b4[_0x79c7('0x17')]+_0x5690b4['limit'];var _0x1743e5;if(_0x22cede>=_0x3b093b){_0x22cede=_0x3b093b;_0x1743e5=0xc8;}else{_0x1743e5=0xce;}_0x404c69['status'](_0x1743e5);return _0x404c69[_0x79c7('0x1b')](_0x79c7('0x1c'),_0x8f489a+'-'+_0x22cede+'/'+_0x3b093b)[_0x79c7('0x1d')](_0x58d20e);}return null;};}function patchUpdates(_0x51fff7){return function(_0x540beb){try{jsonpatch[_0x79c7('0x1e')](_0x540beb,_0x51fff7,!![]);}catch(_0x13c055){return BPromise[_0x79c7('0x1f')](_0x13c055);}return _0x540beb[_0x79c7('0x20')]();};}function saveUpdates(_0x2cbc43,_0x4d188c){return function(_0x3fe716){if(_0x3fe716){return _0x3fe716[_0x79c7('0x21')](_0x2cbc43)[_0x79c7('0x22')](function(_0x4a59e6){return _0x4a59e6;});}return null;};}function removeEntity(_0x72c01e,_0x417086){return function(_0x66ca3d){if(_0x66ca3d){return _0x66ca3d[_0x79c7('0x23')]()['then'](function(){var _0x2d9c67=_0x66ca3d[_0x79c7('0x24')]({'plain':!![]});var _0x37b73f=_0x79c7('0x25');return db['UserProfileResource'][_0x79c7('0x23')]({'where':{'type':_0x37b73f,'resourceId':_0x2d9c67['id']}})[_0x79c7('0x22')](function(){return _0x66ca3d;});})[_0x79c7('0x22')](function(){_0x72c01e[_0x79c7('0x15')](0xcc)[_0x79c7('0x16')]();});}};}function handleEntityNotFound(_0x6d6f35,_0x3d64d3){return function(_0x392ed8){if(!_0x392ed8){_0x6d6f35['sendStatus'](0x194);}return _0x392ed8;};}function handleError(_0x18bb1c,_0x2d52d6){_0x2d52d6=_0x2d52d6||0x1f4;return function(_0x2faaad){logger[_0x79c7('0x26')](_0x2faaad[_0x79c7('0x27')]);if(_0x2faaad[_0x79c7('0x28')]){delete _0x2faaad[_0x79c7('0x28')];}_0x18bb1c[_0x79c7('0x15')](_0x2d52d6)[_0x79c7('0x29')](_0x2faaad);};}exports['index']=function(_0x538c0d,_0x461103){var _0x29d2ad={},_0x4ba4ec={},_0x268098={'count':0x0,'rows':[]};var _0x5dd42b=_[_0x79c7('0x2a')](db[_0x79c7('0x2b')]['rawAttributes'],function(_0x1be7ca){return{'name':_0x1be7ca[_0x79c7('0x2c')],'type':_0x1be7ca[_0x79c7('0x2d')][_0x79c7('0x2e')]};});_0x4ba4ec['model']=_[_0x79c7('0x2a')](_0x5dd42b,_0x79c7('0x28'));_0x4ba4ec['query']=_['keys'](_0x538c0d['query']);_0x4ba4ec[_0x79c7('0x2f')]=_[_0x79c7('0x30')](_0x4ba4ec[_0x79c7('0x31')],_0x4ba4ec[_0x79c7('0x32')]);_0x29d2ad[_0x79c7('0x33')]=_[_0x79c7('0x30')](_0x4ba4ec[_0x79c7('0x31')],qs[_0x79c7('0x34')](_0x538c0d[_0x79c7('0x32')][_0x79c7('0x34')]));_0x29d2ad[_0x79c7('0x33')]=_0x29d2ad[_0x79c7('0x33')][_0x79c7('0x35')]?_0x29d2ad[_0x79c7('0x33')]:_0x4ba4ec[_0x79c7('0x31')];if(!_0x538c0d[_0x79c7('0x32')]['hasOwnProperty'](_0x79c7('0x36'))){_0x29d2ad['limit']=qs[_0x79c7('0x19')](_0x538c0d[_0x79c7('0x32')]['limit']);_0x29d2ad[_0x79c7('0x17')]=qs[_0x79c7('0x17')](_0x538c0d[_0x79c7('0x32')]['offset']);}_0x29d2ad[_0x79c7('0x37')]=qs[_0x79c7('0x38')](_0x538c0d[_0x79c7('0x32')][_0x79c7('0x38')]);_0x29d2ad[_0x79c7('0x39')]=qs[_0x79c7('0x2f')](_[_0x79c7('0x3a')](_0x538c0d[_0x79c7('0x32')],_0x4ba4ec['filters']),_0x5dd42b);if(_0x538c0d[_0x79c7('0x32')]['filter']){_0x29d2ad[_0x79c7('0x39')]=_[_0x79c7('0x3b')](_0x29d2ad['where'],{'$or':_[_0x79c7('0x2a')](_0x5dd42b,function(_0x136132){if(_0x136132[_0x79c7('0x2d')]!=='VIRTUAL'){var _0x452fbb={};_0x452fbb[_0x136132[_0x79c7('0x28')]]={'$like':'%'+_0x538c0d[_0x79c7('0x32')][_0x79c7('0x3c')]+'%'};return _0x452fbb;}})});}_0x29d2ad=_[_0x79c7('0x3b')]({},_0x29d2ad,_0x538c0d[_0x79c7('0x3d')]);var _0x47904f={'where':_0x29d2ad[_0x79c7('0x39')]};return db[_0x79c7('0x2b')][_0x79c7('0x1a')](_0x47904f)[_0x79c7('0x22')](function(_0x2ec0fd){_0x268098[_0x79c7('0x1a')]=_0x2ec0fd;if(_0x538c0d[_0x79c7('0x32')]['includeAll']){_0x29d2ad[_0x79c7('0x3e')]=[{'all':!![]}];}return db[_0x79c7('0x2b')]['findAll'](_0x29d2ad);})['then'](function(_0x1f0c2f){_0x268098[_0x79c7('0x3f')]=_0x1f0c2f;return _0x268098;})[_0x79c7('0x22')](respondWithFilteredResult(_0x461103,_0x29d2ad))[_0x79c7('0x40')](handleError(_0x461103,null));};exports[_0x79c7('0x41')]=function(_0x1243b4,_0x8fd221){var _0x25727a={'raw':!![],'where':{'id':_0x1243b4[_0x79c7('0x42')]['id']}},_0x1ae284={};_0x1ae284[_0x79c7('0x31')]=_['keys'](db[_0x79c7('0x2b')][_0x79c7('0x43')]);_0x1ae284[_0x79c7('0x32')]=_[_0x79c7('0x44')](_0x1243b4[_0x79c7('0x32')]);_0x1ae284[_0x79c7('0x2f')]=_[_0x79c7('0x30')](_0x1ae284[_0x79c7('0x31')],_0x1ae284[_0x79c7('0x32')]);_0x25727a[_0x79c7('0x33')]=_[_0x79c7('0x30')](_0x1ae284[_0x79c7('0x31')],qs[_0x79c7('0x34')](_0x1243b4['query'][_0x79c7('0x34')]));_0x25727a['attributes']=_0x25727a['attributes']['length']?_0x25727a[_0x79c7('0x33')]:_0x1ae284[_0x79c7('0x31')];if(_0x1243b4[_0x79c7('0x32')][_0x79c7('0x45')]){_0x25727a[_0x79c7('0x3e')]=[{'all':!![]}];}_0x25727a=_[_0x79c7('0x3b')]({},_0x25727a,_0x1243b4['options']);return db['AnalyticExtractedReport'][_0x79c7('0x46')](_0x25727a)[_0x79c7('0x22')](handleEntityNotFound(_0x8fd221,null))['then'](respondWithResult(_0x8fd221,null))[_0x79c7('0x40')](handleError(_0x8fd221,null));};exports[_0x79c7('0x47')]=function(_0x4a6241,_0x51f1ff){return db[_0x79c7('0x2b')]['create'](_0x4a6241[_0x79c7('0x48')],{})[_0x79c7('0x22')](function(_0x2128e0){var _0x1d0098=_0x4a6241[_0x79c7('0x49')][_0x79c7('0x24')]({'plain':!![]});if(!_0x1d0098)throw new Error(_0x79c7('0x4a'));if(_0x1d0098[_0x79c7('0x4b')]===_0x79c7('0x49')){var _0x353829=_0x2128e0[_0x79c7('0x24')]({'plain':!![]});var _0x10ed6f='ExtractedReports';return db[_0x79c7('0x4c')][_0x79c7('0x46')]({'where':{'name':_0x10ed6f,'userProfileId':_0x1d0098[_0x79c7('0x4d')]},'raw':!![]})['then'](function(_0x330c97){if(_0x330c97&&_0x330c97['autoAssociation']===0x0){return db[_0x79c7('0x4e')][_0x79c7('0x47')]({'name':_0x353829[_0x79c7('0x28')],'resourceId':_0x353829['id'],'type':_0x330c97[_0x79c7('0x28')],'sectionId':_0x330c97['id']},{})[_0x79c7('0x22')](function(){return _0x2128e0;});}else{return _0x2128e0;}})[_0x79c7('0x40')](function(_0x46bed0){logger[_0x79c7('0x26')](_0x79c7('0x4f'),_0x46bed0);throw _0x46bed0;});}return _0x2128e0;})[_0x79c7('0x22')](respondWithResult(_0x51f1ff,0xc9))[_0x79c7('0x40')](handleError(_0x51f1ff,null));};exports[_0x79c7('0x21')]=function(_0x3f68c7,_0x528db2){if(_0x3f68c7[_0x79c7('0x48')]['id']){delete _0x3f68c7['body']['id'];}return db[_0x79c7('0x2b')][_0x79c7('0x46')]({'where':{'id':_0x3f68c7[_0x79c7('0x42')]['id']}})[_0x79c7('0x22')](handleEntityNotFound(_0x528db2,null))[_0x79c7('0x22')](saveUpdates(_0x3f68c7[_0x79c7('0x48')],null))[_0x79c7('0x22')](respondWithResult(_0x528db2,null))[_0x79c7('0x40')](handleError(_0x528db2,null));};exports['destroy']=function(_0x4b5042,_0x3a456f){return db[_0x79c7('0x2b')]['find']({'where':{'id':_0x4b5042[_0x79c7('0x42')]['id']}})[_0x79c7('0x22')](handleEntityNotFound(_0x3a456f,null))[_0x79c7('0x22')](removeEntity(_0x3a456f,null))[_0x79c7('0x40')](handleError(_0x3a456f,null));};exports['download']=function(_0x3681ad,_0x336bb3,_0x3181eb){return db[_0x79c7('0x2b')][_0x79c7('0x46')]({'where':{'id':_0x3681ad[_0x79c7('0x42')]['id']},'attributes':[_0x79c7('0x28'),_0x79c7('0x50'),_0x79c7('0x51'),_0x79c7('0x52')],'raw':!![]})[_0x79c7('0x22')](handleEntityNotFound(_0x336bb3,null))[_0x79c7('0x22')](function(_0xb06e0f){if(_0xb06e0f){if(!fs[_0x79c7('0x53')](path['join'](config[_0x79c7('0x54')],_0x79c7('0x55'),_0xb06e0f[_0x79c7('0x51')]))){throw new db[(_0x79c7('0x56'))][(_0x79c7('0x57'))]('Report\x20not\x20found\x20or\x20empty');}if(_0x3681ad[_0x79c7('0x32')][_0x79c7('0x58')]){return _0x336bb3['sendStatus'](0xc8);}return _0x336bb3[_0x79c7('0x59')](path[_0x79c7('0x5a')](config[_0x79c7('0x54')],_0x79c7('0x55'),_0xb06e0f[_0x79c7('0x51')]),util['format'](_0x79c7('0x5b'),_0xb06e0f[_0x79c7('0x50')]||_0xb06e0f[_0x79c7('0x28')],_0xb06e0f[_0x79c7('0x52')][_0x79c7('0x5c')]()));}})['catch'](handleError(_0x336bb3,null));};
\ No newline at end of file
diff --git a/server/api/analyticExtractedReport/analyticExtractedReport.model.js b/server/api/analyticExtractedReport/analyticExtractedReport.model.js
index 3425ad8..63f30de 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 _0xec6f=['define','AnalyticExtractedReport','analytics_extracted_reports','lodash','util','api','bluebird','rimraf','exports'];(function(_0x2ce8da,_0x96274c){var _0x1d378f=function(_0x4db209){while(--_0x4db209){_0x2ce8da['push'](_0x2ce8da['shift']());}};_0x1d378f(++_0x96274c);}(_0xec6f,0x135));var _0xfec6=function(_0x40baf1,_0x39a1e3){_0x40baf1=_0x40baf1-0x0;var _0x293477=_0xec6f[_0x40baf1];return _0x293477;};'use strict';var _=require(_0xfec6('0x0'));var util=require(_0xfec6('0x1'));var logger=require('../../config/logger')(_0xfec6('0x2'));var moment=require('moment');var BPromise=require(_0xfec6('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0xfec6('0x4'));var config=require('../../config/environment');var attributes=require('./analyticExtractedReport.attributes');module[_0xfec6('0x5')]=function(_0x4b6406,_0x4cb08d){return _0x4b6406[_0xfec6('0x6')](_0xfec6('0x7'),attributes,{'tableName':_0xfec6('0x8'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xe2c2=['util','../../config/logger','api','bluebird','path','../../config/environment','exports','AnalyticExtractedReport','lodash'];(function(_0x1a16e7,_0x114313){var _0x34e33a=function(_0x326653){while(--_0x326653){_0x1a16e7['push'](_0x1a16e7['shift']());}};_0x34e33a(++_0x114313);}(_0xe2c2,0x1ca));var _0x2e2c=function(_0x4f4a5a,_0x11c859){_0x4f4a5a=_0x4f4a5a-0x0;var _0x5d6c4b=_0xe2c2[_0x4f4a5a];return _0x5d6c4b;};'use strict';var _=require(_0x2e2c('0x0'));var util=require(_0x2e2c('0x1'));var logger=require(_0x2e2c('0x2'))(_0x2e2c('0x3'));var moment=require('moment');var BPromise=require(_0x2e2c('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x2e2c('0x5'));var rimraf=require('rimraf');var config=require(_0x2e2c('0x6'));var attributes=require('./analyticExtractedReport.attributes');module[_0x2e2c('0x7')]=function(_0x5c86fd,_0x33cb3c){return _0x5c86fd['define'](_0x2e2c('0x8'),attributes,{'tableName':'analytics_extracted_reports','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
diff --git a/server/api/analyticExtractedReport/analyticExtractedReport.rpc.js b/server/api/analyticExtractedReport/analyticExtractedReport.rpc.js
index 1aa774e..7a123f6 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 _0x3818=['request','then','info','AnalyticExtractedReport,\x20%s,\x20%s','debug','AnalyticExtractedReport,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http'];(function(_0x5ca353,_0x21eb37){var _0x4f2fe5=function(_0x14cd1b){while(--_0x14cd1b){_0x5ca353['push'](_0x5ca353['shift']());}};_0x4f2fe5(++_0x21eb37);}(_0x3818,0xaf));var _0x8381=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x3818[_0x20a584];return _0x4b41a8;};'use strict';var _=require(_0x8381('0x0'));var util=require(_0x8381('0x1'));var moment=require(_0x8381('0x2'));var BPromise=require(_0x8381('0x3'));var rs=require(_0x8381('0x4'));var fs=require('fs');var Redis=require(_0x8381('0x5'));var db=require(_0x8381('0x6'))['db'];var utils=require(_0x8381('0x7'));var logger=require(_0x8381('0x8'))(_0x8381('0x9'));var config=require(_0x8381('0xa'));var jayson=require(_0x8381('0xb'));var client=jayson[_0x8381('0xc')][_0x8381('0xd')]({'port':0x232a});function respondWithRpcPromise(_0x3fcd05,_0x5d4673,_0x3734c){return new BPromise(function(_0x1f26de,_0x5ef1de){return client[_0x8381('0xe')](_0x3fcd05,_0x3734c)[_0x8381('0xf')](function(_0x19bd2d){logger[_0x8381('0x10')](_0x8381('0x11'),_0x5d4673,'request\x20sent');logger[_0x8381('0x12')](_0x8381('0x13'),_0x5d4673,_0x8381('0x14'),JSON[_0x8381('0x15')](_0x19bd2d));if(_0x19bd2d[_0x8381('0x16')]){if(_0x19bd2d[_0x8381('0x16')][_0x8381('0x17')]===0x1f4){logger[_0x8381('0x16')](_0x8381('0x11'),_0x5d4673,_0x19bd2d[_0x8381('0x16')][_0x8381('0x18')]);return _0x5ef1de(_0x19bd2d[_0x8381('0x16')][_0x8381('0x18')]);}logger[_0x8381('0x16')](_0x8381('0x11'),_0x5d4673,_0x19bd2d[_0x8381('0x16')]['message']);return _0x1f26de(_0x19bd2d[_0x8381('0x16')][_0x8381('0x18')]);}else{logger[_0x8381('0x10')]('AnalyticExtractedReport,\x20%s,\x20%s',_0x5d4673,_0x8381('0x14'));_0x1f26de(_0x19bd2d[_0x8381('0x19')][_0x8381('0x18')]);}})[_0x8381('0x1a')](function(_0x5245da){logger[_0x8381('0x16')](_0x8381('0x11'),_0x5d4673,_0x5245da);_0x5ef1de(_0x5245da);});});}
\ No newline at end of file
+var _0xefa1=['code','AnalyticExtractedReport,\x20%s,\x20%s','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','rpc','../../config/environment','jayson/promise','request','then','info','request\x20sent','debug','AnalyticExtractedReport,\x20%s,\x20%s,\x20%s','stringify','error'];(function(_0x2acec0,_0x42a0f2){var _0x2ca97e=function(_0x522776){while(--_0x522776){_0x2acec0['push'](_0x2acec0['shift']());}};_0x2ca97e(++_0x42a0f2);}(_0xefa1,0x175));var _0x1efa=function(_0x1b3012,_0x7b0828){_0x1b3012=_0x1b3012-0x0;var _0x4e3e4f=_0xefa1[_0x1b3012];return _0x4e3e4f;};'use strict';var _=require(_0x1efa('0x0'));var util=require(_0x1efa('0x1'));var moment=require(_0x1efa('0x2'));var BPromise=require(_0x1efa('0x3'));var rs=require(_0x1efa('0x4'));var fs=require('fs');var Redis=require(_0x1efa('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0x1efa('0x6'));var logger=require('../../config/logger')(_0x1efa('0x7'));var config=require(_0x1efa('0x8'));var jayson=require(_0x1efa('0x9'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x342bac,_0x1c5266,_0x58411e){return new BPromise(function(_0x28c8b3,_0x46c91e){return client[_0x1efa('0xa')](_0x342bac,_0x58411e)[_0x1efa('0xb')](function(_0x366285){logger[_0x1efa('0xc')]('AnalyticExtractedReport,\x20%s,\x20%s',_0x1c5266,_0x1efa('0xd'));logger[_0x1efa('0xe')](_0x1efa('0xf'),_0x1c5266,_0x1efa('0xd'),JSON[_0x1efa('0x10')](_0x366285));if(_0x366285['error']){if(_0x366285[_0x1efa('0x11')][_0x1efa('0x12')]===0x1f4){logger[_0x1efa('0x11')](_0x1efa('0x13'),_0x1c5266,_0x366285[_0x1efa('0x11')]['message']);return _0x46c91e(_0x366285['error'][_0x1efa('0x14')]);}logger['error'](_0x1efa('0x13'),_0x1c5266,_0x366285['error'][_0x1efa('0x14')]);return _0x28c8b3(_0x366285['error'][_0x1efa('0x14')]);}else{logger['info'](_0x1efa('0x13'),_0x1c5266,_0x1efa('0xd'));_0x28c8b3(_0x366285[_0x1efa('0x15')][_0x1efa('0x14')]);}})[_0x1efa('0x16')](function(_0x90f9b2){logger['error'](_0x1efa('0x13'),_0x1c5266,_0x90f9b2);_0x46c91e(_0x90f9b2);});});}
\ No newline at end of file
diff --git a/server/api/analyticExtractedReport/index.js b/server/api/analyticExtractedReport/index.js
index 2327232..4f0d649 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 _0xb0a6=['../../components/interaction/service','../../config/environment','./analyticExtractedReport.controller','get','isAuthenticated','/:id','show','/:id/download','download','post','create','put','update','delete','destroy','multer','util','path','express','Router','fs-extra','../../components/auth/service'];(function(_0x3dfb56,_0xfe844d){var _0x5e6e1b=function(_0x4e002f){while(--_0x4e002f){_0x3dfb56['push'](_0x3dfb56['shift']());}};_0x5e6e1b(++_0xfe844d);}(_0xb0a6,0x1c7));var _0x6b0a=function(_0x4943e9,_0xbd7b82){_0x4943e9=_0x4943e9-0x0;var _0x36b919=_0xb0a6[_0x4943e9];return _0x36b919;};'use strict';var multer=require(_0x6b0a('0x0'));var util=require(_0x6b0a('0x1'));var path=require(_0x6b0a('0x2'));var timeout=require('connect-timeout');var express=require(_0x6b0a('0x3'));var router=express[_0x6b0a('0x4')]();var fs_extra=require(_0x6b0a('0x5'));var auth=require(_0x6b0a('0x6'));var interaction=require(_0x6b0a('0x7'));var config=require(_0x6b0a('0x8'));var controller=require(_0x6b0a('0x9'));router[_0x6b0a('0xa')]('/',auth[_0x6b0a('0xb')](),controller['index']);router[_0x6b0a('0xa')](_0x6b0a('0xc'),auth[_0x6b0a('0xb')](),controller[_0x6b0a('0xd')]);router['get'](_0x6b0a('0xe'),auth[_0x6b0a('0xb')](),controller[_0x6b0a('0xf')]);router[_0x6b0a('0x10')]('/',auth[_0x6b0a('0xb')](),controller[_0x6b0a('0x11')]);router[_0x6b0a('0x12')](_0x6b0a('0xc'),auth[_0x6b0a('0xb')](),controller[_0x6b0a('0x13')]);router[_0x6b0a('0x14')](_0x6b0a('0xc'),auth[_0x6b0a('0xb')](),controller[_0x6b0a('0x15')]);module['exports']=router;
\ No newline at end of file
+var _0x55f6=['show','/:id/download','download','post','create','update','delete','destroy','exports','multer','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./analyticExtractedReport.controller','get','isAuthenticated','index','/:id'];(function(_0x57b54c,_0x54ce0d){var _0x59cc19=function(_0xa33bc6){while(--_0xa33bc6){_0x57b54c['push'](_0x57b54c['shift']());}};_0x59cc19(++_0x54ce0d);}(_0x55f6,0xb9));var _0x655f=function(_0xb06354,_0x464d11){_0xb06354=_0xb06354-0x0;var _0x44da6c=_0x55f6[_0xb06354];return _0x44da6c;};'use strict';var multer=require(_0x655f('0x0'));var util=require('util');var path=require(_0x655f('0x1'));var timeout=require(_0x655f('0x2'));var express=require(_0x655f('0x3'));var router=express[_0x655f('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x655f('0x5'));var interaction=require(_0x655f('0x6'));var config=require(_0x655f('0x7'));var controller=require(_0x655f('0x8'));router[_0x655f('0x9')]('/',auth[_0x655f('0xa')](),controller[_0x655f('0xb')]);router[_0x655f('0x9')](_0x655f('0xc'),auth[_0x655f('0xa')](),controller[_0x655f('0xd')]);router[_0x655f('0x9')](_0x655f('0xe'),auth[_0x655f('0xa')](),controller[_0x655f('0xf')]);router[_0x655f('0x10')]('/',auth[_0x655f('0xa')](),controller[_0x655f('0x11')]);router['put'](_0x655f('0xc'),auth[_0x655f('0xa')](),controller[_0x655f('0x12')]);router[_0x655f('0x13')](_0x655f('0xc'),auth[_0x655f('0xa')](),controller[_0x655f('0x14')]);module[_0x655f('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 8b32506..2a7e0ce 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 _0xc5c0=['BOOLEAN','exports','TEXT','STRING'];(function(_0x5209c7,_0x361cd7){var _0x26f1aa=function(_0x482715){while(--_0x482715){_0x5209c7['push'](_0x5209c7['shift']());}};_0x26f1aa(++_0x361cd7);}(_0xc5c0,0x131));var _0x0c5c=function(_0x19ea40,_0x47bdef){_0x19ea40=_0x19ea40-0x0;var _0x275449=_0xc5c0[_0x19ea40];return _0x275449;};'use strict';var Sequelize=require('sequelize');module[_0x0c5c('0x0')]={'field':{'type':Sequelize[_0x0c5c('0x1')]},'alias':{'type':Sequelize[_0x0c5c('0x2')]},'function':{'type':Sequelize[_0x0c5c('0x2')]},'format':{'type':Sequelize[_0x0c5c('0x2')]},'groupBy':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'orderBy':{'type':Sequelize[_0x0c5c('0x2')]},'custom':{'type':Sequelize[_0x0c5c('0x3')],'defaultValue':![]}};
\ No newline at end of file
+var _0x5b23=['exports','TEXT','STRING','BOOLEAN','sequelize'];(function(_0x42f5d7,_0x10cfe8){var _0x5e6e68=function(_0x21cd86){while(--_0x21cd86){_0x42f5d7['push'](_0x42f5d7['shift']());}};_0x5e6e68(++_0x10cfe8);}(_0x5b23,0x1f3));var _0x35b2=function(_0x4da28f,_0x164324){_0x4da28f=_0x4da28f-0x0;var _0xe49192=_0x5b23[_0x4da28f];return _0xe49192;};'use strict';var Sequelize=require(_0x35b2('0x0'));module[_0x35b2('0x1')]={'field':{'type':Sequelize[_0x35b2('0x2')]},'alias':{'type':Sequelize[_0x35b2('0x3')]},'function':{'type':Sequelize[_0x35b2('0x3')]},'format':{'type':Sequelize['STRING']},'groupBy':{'type':Sequelize[_0x35b2('0x4')],'defaultValue':![]},'orderBy':{'type':Sequelize[_0x35b2('0x3')]},'custom':{'type':Sequelize[_0x35b2('0x4')],'defaultValue':![]}};
\ No newline at end of file
diff --git a/server/api/analyticFieldReport/analyticFieldReport.controller.js b/server/api/analyticFieldReport/analyticFieldReport.controller.js
index 80446b6..39a6ed7 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 _0x2b35=['keys','filters','intersection','model','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','type','VIRTUAL','AnalyticFieldReport','includeAll','include','findAll','rows','catch','show','params','options','create','body','bulkCreate','find','bulkDestroy','ids','addFields','AnalyticCustomReport','findOne','sequelize','transaction','CustomReportId','zip-dir','request-promise','moment','bluebird','mustache','util','path','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','limit','undefined','offset','count','set','Content-Range','apply','reject','update','then','destroy','name','send','index','rawAttributes','fieldName','key','map','query'];(function(_0x14eac5,_0x5d7549){var _0x223eb6=function(_0x892d56){while(--_0x892d56){_0x14eac5['push'](_0x14eac5['shift']());}};_0x223eb6(++_0x5d7549);}(_0x2b35,0x17e));var _0x52b3=function(_0x7d04cd,_0x4769a0){_0x7d04cd=_0x7d04cd-0x0;var _0x5d211f=_0x2b35[_0x7d04cd];return _0x5d211f;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x52b3('0x0'));var jsonpatch=require('fast-json-patch');var rp=require(_0x52b3('0x1'));var moment=require(_0x52b3('0x2'));var BPromise=require(_0x52b3('0x3'));var Mustache=require(_0x52b3('0x4'));var util=require(_0x52b3('0x5'));var path=require(_0x52b3('0x6'));var sox=require('sox');var csv=require(_0x52b3('0x7'));var ejs=require(_0x52b3('0x8'));var fs=require('fs');var fs_extra=require(_0x52b3('0x9'));var _=require(_0x52b3('0xa'));var squel=require(_0x52b3('0xb'));var crypto=require(_0x52b3('0xc'));var jsforce=require(_0x52b3('0xd'));var deskjs=require(_0x52b3('0xe'));var toCsv=require(_0x52b3('0x7'));var querystring=require(_0x52b3('0xf'));var Papa=require(_0x52b3('0x10'));var Redis=require(_0x52b3('0x11'));var authService=require(_0x52b3('0x12'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x52b3('0x13'));var logger=require(_0x52b3('0x14'))(_0x52b3('0x15'));var utils=require(_0x52b3('0x16'));var config=require(_0x52b3('0x17'));var licenseUtil=require('../../config/license/util');var db=require(_0x52b3('0x18'))['db'];function respondWithStatusCode(_0x19b552,_0x59861a){_0x59861a=_0x59861a||0xcc;return function(_0x28b637){if(_0x28b637){return _0x19b552[_0x52b3('0x19')](_0x59861a);}return _0x19b552[_0x52b3('0x1a')](_0x59861a)[_0x52b3('0x1b')]();};}function respondWithResult(_0x4de285,_0x2ce0e9){_0x2ce0e9=_0x2ce0e9||0xc8;return function(_0x577dff){if(_0x577dff){return _0x4de285['status'](_0x2ce0e9)[_0x52b3('0x1c')](_0x577dff);}};}function respondWithFilteredResult(_0x51b20d,_0x570754){return function(_0xbc305b){if(_0xbc305b){var _0x3d3840=typeof _0x570754['offset']==='undefined'&&typeof _0x570754[_0x52b3('0x1d')]===_0x52b3('0x1e');var _0x3253f0=_0xbc305b['count'];var _0x287658=_0x3d3840?0x0:_0x570754[_0x52b3('0x1f')];var _0x10980c=_0x3d3840?_0xbc305b[_0x52b3('0x20')]:_0x570754[_0x52b3('0x1f')]+_0x570754['limit'];var _0x45f821;if(_0x10980c>=_0x3253f0){_0x10980c=_0x3253f0;_0x45f821=0xc8;}else{_0x45f821=0xce;}_0x51b20d[_0x52b3('0x1a')](_0x45f821);return _0x51b20d[_0x52b3('0x21')](_0x52b3('0x22'),_0x287658+'-'+_0x10980c+'/'+_0x3253f0)[_0x52b3('0x1c')](_0xbc305b);}return null;};}function patchUpdates(_0x59586e){return function(_0xe8484d){try{jsonpatch[_0x52b3('0x23')](_0xe8484d,_0x59586e,!![]);}catch(_0x58f3c2){return BPromise[_0x52b3('0x24')](_0x58f3c2);}return _0xe8484d['save']();};}function saveUpdates(_0x3fba87,_0xc90a46){return function(_0x1f5a76){if(_0x1f5a76){return _0x1f5a76[_0x52b3('0x25')](_0x3fba87)[_0x52b3('0x26')](function(_0x35232f){return _0x35232f;});}return null;};}function removeEntity(_0x5a9a32,_0x23dcc1){return function(_0x1ba249){if(_0x1ba249){return _0x1ba249[_0x52b3('0x27')]()[_0x52b3('0x26')](function(){_0x5a9a32['status'](0xcc)[_0x52b3('0x1b')]();});}};}function handleEntityNotFound(_0x1cdfb5,_0x4a2aea){return function(_0x2465c8){if(!_0x2465c8){_0x1cdfb5[_0x52b3('0x19')](0x194);}return _0x2465c8;};}function handleError(_0x12fa3a,_0x1a6954){_0x1a6954=_0x1a6954||0x1f4;return function(_0xc53219){logger['error'](_0xc53219['stack']);if(_0xc53219['name']){delete _0xc53219[_0x52b3('0x28')];}_0x12fa3a[_0x52b3('0x1a')](_0x1a6954)[_0x52b3('0x29')](_0xc53219);};}exports[_0x52b3('0x2a')]=function(_0x5ebfc5,_0x4e027e){var _0x2f2cde={},_0x130d64={},_0x2d5f1a={'count':0x0,'rows':[]};var _0x2c0636=_['map'](db['AnalyticFieldReport'][_0x52b3('0x2b')],function(_0x503c9e){return{'name':_0x503c9e[_0x52b3('0x2c')],'type':_0x503c9e['type'][_0x52b3('0x2d')]};});_0x130d64['model']=_[_0x52b3('0x2e')](_0x2c0636,_0x52b3('0x28'));_0x130d64[_0x52b3('0x2f')]=_[_0x52b3('0x30')](_0x5ebfc5[_0x52b3('0x2f')]);_0x130d64[_0x52b3('0x31')]=_[_0x52b3('0x32')](_0x130d64['model'],_0x130d64[_0x52b3('0x2f')]);_0x2f2cde['attributes']=_[_0x52b3('0x32')](_0x130d64[_0x52b3('0x33')],qs[_0x52b3('0x34')](_0x5ebfc5[_0x52b3('0x2f')][_0x52b3('0x34')]));_0x2f2cde[_0x52b3('0x35')]=_0x2f2cde[_0x52b3('0x35')][_0x52b3('0x36')]?_0x2f2cde[_0x52b3('0x35')]:_0x130d64['model'];if(!_0x5ebfc5['query'][_0x52b3('0x37')](_0x52b3('0x38'))){_0x2f2cde[_0x52b3('0x1d')]=qs['limit'](_0x5ebfc5[_0x52b3('0x2f')]['limit']);_0x2f2cde[_0x52b3('0x1f')]=qs[_0x52b3('0x1f')](_0x5ebfc5[_0x52b3('0x2f')][_0x52b3('0x1f')]);}_0x2f2cde[_0x52b3('0x39')]=qs[_0x52b3('0x3a')](_0x5ebfc5[_0x52b3('0x2f')][_0x52b3('0x3a')]);_0x2f2cde[_0x52b3('0x3b')]=qs[_0x52b3('0x31')](_[_0x52b3('0x3c')](_0x5ebfc5[_0x52b3('0x2f')],_0x130d64[_0x52b3('0x31')]),_0x2c0636);if(_0x5ebfc5[_0x52b3('0x2f')][_0x52b3('0x3d')]){_0x2f2cde[_0x52b3('0x3b')]=_[_0x52b3('0x3e')](_0x2f2cde[_0x52b3('0x3b')],{'$or':_[_0x52b3('0x2e')](_0x2c0636,function(_0x3ce1ee){if(_0x3ce1ee[_0x52b3('0x3f')]!==_0x52b3('0x40')){var _0x16dc1e={};_0x16dc1e[_0x3ce1ee[_0x52b3('0x28')]]={'$like':'%'+_0x5ebfc5[_0x52b3('0x2f')]['filter']+'%'};return _0x16dc1e;}})});}_0x2f2cde=_[_0x52b3('0x3e')]({},_0x2f2cde,_0x5ebfc5['options']);var _0x3345c4={'where':_0x2f2cde[_0x52b3('0x3b')]};return db[_0x52b3('0x41')][_0x52b3('0x20')](_0x3345c4)[_0x52b3('0x26')](function(_0x4623e1){_0x2d5f1a[_0x52b3('0x20')]=_0x4623e1;if(_0x5ebfc5[_0x52b3('0x2f')][_0x52b3('0x42')]){_0x2f2cde[_0x52b3('0x43')]=[{'all':!![]}];}return db[_0x52b3('0x41')][_0x52b3('0x44')](_0x2f2cde);})[_0x52b3('0x26')](function(_0x482087){_0x2d5f1a[_0x52b3('0x45')]=_0x482087;return _0x2d5f1a;})[_0x52b3('0x26')](respondWithFilteredResult(_0x4e027e,_0x2f2cde))[_0x52b3('0x46')](handleError(_0x4e027e,null));};exports[_0x52b3('0x47')]=function(_0x1d07bb,_0x66681d){var _0x6fb6c3={'raw':![],'where':{'id':_0x1d07bb[_0x52b3('0x48')]['id']}},_0x5e7894={};_0x5e7894[_0x52b3('0x33')]=_[_0x52b3('0x30')](db[_0x52b3('0x41')]['rawAttributes']);_0x5e7894[_0x52b3('0x2f')]=_[_0x52b3('0x30')](_0x1d07bb[_0x52b3('0x2f')]);_0x5e7894[_0x52b3('0x31')]=_[_0x52b3('0x32')](_0x5e7894[_0x52b3('0x33')],_0x5e7894[_0x52b3('0x2f')]);_0x6fb6c3[_0x52b3('0x35')]=_[_0x52b3('0x32')](_0x5e7894[_0x52b3('0x33')],qs[_0x52b3('0x34')](_0x1d07bb['query'][_0x52b3('0x34')]));_0x6fb6c3[_0x52b3('0x35')]=_0x6fb6c3[_0x52b3('0x35')][_0x52b3('0x36')]?_0x6fb6c3[_0x52b3('0x35')]:_0x5e7894[_0x52b3('0x33')];if(_0x1d07bb[_0x52b3('0x2f')][_0x52b3('0x42')]){_0x6fb6c3[_0x52b3('0x43')]=[{'all':!![]}];}_0x6fb6c3=_[_0x52b3('0x3e')]({},_0x6fb6c3,_0x1d07bb[_0x52b3('0x49')]);return db[_0x52b3('0x41')]['find'](_0x6fb6c3)[_0x52b3('0x26')](handleEntityNotFound(_0x66681d,null))[_0x52b3('0x26')](respondWithResult(_0x66681d,null))[_0x52b3('0x46')](handleError(_0x66681d,null));};exports[_0x52b3('0x4a')]=function(_0x314fe,_0x13723d){return db['AnalyticFieldReport'][_0x52b3('0x4a')](_0x314fe[_0x52b3('0x4b')],{})[_0x52b3('0x26')](respondWithResult(_0x13723d,0xc9))['catch'](handleError(_0x13723d,null));};exports[_0x52b3('0x4c')]=function(_0x2b0b7b,_0x20f432){return db[_0x52b3('0x41')][_0x52b3('0x4c')](_0x2b0b7b[_0x52b3('0x4b')],{'raw':![],'individualHooks':!![]})[_0x52b3('0x26')](respondWithResult(_0x20f432,0xc9))[_0x52b3('0x46')](handleError(_0x20f432,null));};exports[_0x52b3('0x25')]=function(_0x4ac1ef,_0x12031f){if(_0x4ac1ef['body']['id']){delete _0x4ac1ef[_0x52b3('0x4b')]['id'];}return db[_0x52b3('0x41')][_0x52b3('0x4d')]({'where':{'id':_0x4ac1ef[_0x52b3('0x48')]['id']}})[_0x52b3('0x26')](handleEntityNotFound(_0x12031f,null))[_0x52b3('0x26')](saveUpdates(_0x4ac1ef[_0x52b3('0x4b')],null))['then'](respondWithResult(_0x12031f,null))[_0x52b3('0x46')](handleError(_0x12031f,null));};exports['destroy']=function(_0x2fcf3a,_0x412d13){return db[_0x52b3('0x41')][_0x52b3('0x4d')]({'where':{'id':_0x2fcf3a['params']['id']}})[_0x52b3('0x26')](handleEntityNotFound(_0x412d13,null))['then'](removeEntity(_0x412d13,null))[_0x52b3('0x46')](handleError(_0x412d13,null));};exports[_0x52b3('0x4e')]=function(_0x2e3e02,_0x34b79a){return db[_0x52b3('0x41')]['destroy']({'where':{'id':_0x2e3e02[_0x52b3('0x2f')][_0x52b3('0x4f')]||[]},'raw':![],'individualHooks':!![]})['then'](respondWithResult(_0x34b79a,0xcc))[_0x52b3('0x46')](handleError(_0x34b79a,null));};exports[_0x52b3('0x50')]=function(_0x2764cb,_0x44862f,_0x16304c){return db[_0x52b3('0x51')][_0x52b3('0x52')]({'where':{'id':_0x2764cb[_0x52b3('0x48')]['id']}})[_0x52b3('0x26')](handleEntityNotFound(_0x44862f,null))[_0x52b3('0x26')](function(_0x30c538){if(_0x30c538){return db[_0x52b3('0x53')][_0x52b3('0x54')](function(_0x3ab51f){return db[_0x52b3('0x41')][_0x52b3('0x27')]({'where':{'CustomReportId':_0x2764cb[_0x52b3('0x48')]['id']},'transaction':_0x3ab51f})[_0x52b3('0x26')](function(_0x6b162a){var _0x41c2c9=_['map'](_0x2764cb[_0x52b3('0x4b')],function(_0x43515d){delete _0x43515d['id'];_0x43515d[_0x52b3('0x55')]=_0x2764cb['params']['id'];return _0x43515d;});return db[_0x52b3('0x41')][_0x52b3('0x4c')](_0x41c2c9,{'transaction':_0x3ab51f});});})['then'](function(){return db[_0x52b3('0x41')][_0x52b3('0x44')]({'where':{'CustomReportId':_0x2764cb['params']['id']}});});}})[_0x52b3('0x26')](respondWithResult(_0x44862f,null))[_0x52b3('0x46')](handleError(_0x44862f,null));};
\ No newline at end of file
+var _0xb222=['fields','includeAll','create','bulkCreate','body','find','params','addFields','AnalyticCustomReport','findOne','sequelize','transaction','CustomReportId','eml-format','rimraf','zip-dir','request-promise','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','querystring','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/environment','../../config/license/util','sendStatus','end','status','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','then','destroy','name','send','index','map','fieldName','model','query','keys','filters','attributes','length','hasOwnProperty','order','sort','where','pick','filter','merge','type','VIRTUAL','options','include','findAll','catch','show','AnalyticFieldReport','intersection'];(function(_0x16e0c8,_0x4861eb){var _0xe4b5af=function(_0x5248bc){while(--_0x5248bc){_0x16e0c8['push'](_0x16e0c8['shift']());}};_0xe4b5af(++_0x4861eb);}(_0xb222,0xab));var _0x2b22=function(_0x53ccae,_0x4002bc){_0x53ccae=_0x53ccae-0x0;var _0x1116be=_0xb222[_0x53ccae];return _0x1116be;};'use strict';var emlformat=require(_0x2b22('0x0'));var rimraf=require(_0x2b22('0x1'));var zipdir=require(_0x2b22('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x2b22('0x3'));var moment=require('moment');var BPromise=require(_0x2b22('0x4'));var Mustache=require(_0x2b22('0x5'));var util=require(_0x2b22('0x6'));var path=require(_0x2b22('0x7'));var sox=require(_0x2b22('0x8'));var csv=require(_0x2b22('0x9'));var ejs=require(_0x2b22('0xa'));var fs=require('fs');var fs_extra=require(_0x2b22('0xb'));var _=require(_0x2b22('0xc'));var squel=require(_0x2b22('0xd'));var crypto=require(_0x2b22('0xe'));var jsforce=require(_0x2b22('0xf'));var deskjs=require('desk.js');var toCsv=require(_0x2b22('0x9'));var querystring=require(_0x2b22('0x10'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x2b22('0x11'));var qs=require(_0x2b22('0x12'));var as=require(_0x2b22('0x13'));var hardwareService=require(_0x2b22('0x14'));var logger=require('../../config/logger')('api');var utils=require('../../config/utils');var config=require(_0x2b22('0x15'));var licenseUtil=require(_0x2b22('0x16'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x4f7eac,_0x15fb1c){_0x15fb1c=_0x15fb1c||0xcc;return function(_0xe8ab0a){if(_0xe8ab0a){return _0x4f7eac[_0x2b22('0x17')](_0x15fb1c);}return _0x4f7eac['status'](_0x15fb1c)[_0x2b22('0x18')]();};}function respondWithResult(_0x390a9e,_0x307816){_0x307816=_0x307816||0xc8;return function(_0x14e0c4){if(_0x14e0c4){return _0x390a9e[_0x2b22('0x19')](_0x307816)[_0x2b22('0x1a')](_0x14e0c4);}};}function respondWithFilteredResult(_0x3c76d0,_0xab189d){return function(_0x2278f1){if(_0x2278f1){var _0x3c9e56=typeof _0xab189d[_0x2b22('0x1b')]===_0x2b22('0x1c')&&typeof _0xab189d[_0x2b22('0x1d')]===_0x2b22('0x1c');var _0x3eaa27=_0x2278f1['count'];var _0x343784=_0x3c9e56?0x0:_0xab189d[_0x2b22('0x1b')];var _0x48c0fd=_0x3c9e56?_0x2278f1[_0x2b22('0x1e')]:_0xab189d[_0x2b22('0x1b')]+_0xab189d['limit'];var _0x9beb59;if(_0x48c0fd>=_0x3eaa27){_0x48c0fd=_0x3eaa27;_0x9beb59=0xc8;}else{_0x9beb59=0xce;}_0x3c76d0[_0x2b22('0x19')](_0x9beb59);return _0x3c76d0[_0x2b22('0x1f')](_0x2b22('0x20'),_0x343784+'-'+_0x48c0fd+'/'+_0x3eaa27)[_0x2b22('0x1a')](_0x2278f1);}return null;};}function patchUpdates(_0x3310a0){return function(_0x422c3b){try{jsonpatch[_0x2b22('0x21')](_0x422c3b,_0x3310a0,!![]);}catch(_0x412f5d){return BPromise[_0x2b22('0x22')](_0x412f5d);}return _0x422c3b[_0x2b22('0x23')]();};}function saveUpdates(_0x3e2bc2,_0xdfcc54){return function(_0x451941){if(_0x451941){return _0x451941[_0x2b22('0x24')](_0x3e2bc2)[_0x2b22('0x25')](function(_0x15025d){return _0x15025d;});}return null;};}function removeEntity(_0x275f22,_0x265cbc){return function(_0x47dafb){if(_0x47dafb){return _0x47dafb[_0x2b22('0x26')]()[_0x2b22('0x25')](function(){_0x275f22[_0x2b22('0x19')](0xcc)[_0x2b22('0x18')]();});}};}function handleEntityNotFound(_0x3e15bc,_0x5ac1df){return function(_0x4c5081){if(!_0x4c5081){_0x3e15bc[_0x2b22('0x17')](0x194);}return _0x4c5081;};}function handleError(_0xc6b643,_0x58be15){_0x58be15=_0x58be15||0x1f4;return function(_0x163864){logger['error'](_0x163864['stack']);if(_0x163864[_0x2b22('0x27')]){delete _0x163864[_0x2b22('0x27')];}_0xc6b643['status'](_0x58be15)[_0x2b22('0x28')](_0x163864);};}exports[_0x2b22('0x29')]=function(_0x2f5d6b,_0x52e456){var _0x4c5a69={},_0x555e01={},_0x2fb0b4={'count':0x0,'rows':[]};var _0x6e74cc=_[_0x2b22('0x2a')](db['AnalyticFieldReport']['rawAttributes'],function(_0xe252cd){return{'name':_0xe252cd[_0x2b22('0x2b')],'type':_0xe252cd['type']['key']};});_0x555e01[_0x2b22('0x2c')]=_['map'](_0x6e74cc,_0x2b22('0x27'));_0x555e01[_0x2b22('0x2d')]=_[_0x2b22('0x2e')](_0x2f5d6b[_0x2b22('0x2d')]);_0x555e01[_0x2b22('0x2f')]=_['intersection'](_0x555e01[_0x2b22('0x2c')],_0x555e01[_0x2b22('0x2d')]);_0x4c5a69[_0x2b22('0x30')]=_['intersection'](_0x555e01[_0x2b22('0x2c')],qs['fields'](_0x2f5d6b[_0x2b22('0x2d')]['fields']));_0x4c5a69[_0x2b22('0x30')]=_0x4c5a69['attributes'][_0x2b22('0x31')]?_0x4c5a69['attributes']:_0x555e01[_0x2b22('0x2c')];if(!_0x2f5d6b[_0x2b22('0x2d')][_0x2b22('0x32')]('nolimit')){_0x4c5a69[_0x2b22('0x1d')]=qs[_0x2b22('0x1d')](_0x2f5d6b['query'][_0x2b22('0x1d')]);_0x4c5a69[_0x2b22('0x1b')]=qs['offset'](_0x2f5d6b[_0x2b22('0x2d')]['offset']);}_0x4c5a69[_0x2b22('0x33')]=qs[_0x2b22('0x34')](_0x2f5d6b[_0x2b22('0x2d')]['sort']);_0x4c5a69[_0x2b22('0x35')]=qs[_0x2b22('0x2f')](_[_0x2b22('0x36')](_0x2f5d6b['query'],_0x555e01[_0x2b22('0x2f')]),_0x6e74cc);if(_0x2f5d6b[_0x2b22('0x2d')][_0x2b22('0x37')]){_0x4c5a69[_0x2b22('0x35')]=_[_0x2b22('0x38')](_0x4c5a69['where'],{'$or':_[_0x2b22('0x2a')](_0x6e74cc,function(_0x32413e){if(_0x32413e[_0x2b22('0x39')]!==_0x2b22('0x3a')){var _0x34d5db={};_0x34d5db[_0x32413e[_0x2b22('0x27')]]={'$like':'%'+_0x2f5d6b[_0x2b22('0x2d')]['filter']+'%'};return _0x34d5db;}})});}_0x4c5a69=_[_0x2b22('0x38')]({},_0x4c5a69,_0x2f5d6b[_0x2b22('0x3b')]);var _0x11ef1d={'where':_0x4c5a69[_0x2b22('0x35')]};return db['AnalyticFieldReport'][_0x2b22('0x1e')](_0x11ef1d)[_0x2b22('0x25')](function(_0x243a65){_0x2fb0b4[_0x2b22('0x1e')]=_0x243a65;if(_0x2f5d6b[_0x2b22('0x2d')]['includeAll']){_0x4c5a69[_0x2b22('0x3c')]=[{'all':!![]}];}return db['AnalyticFieldReport'][_0x2b22('0x3d')](_0x4c5a69);})[_0x2b22('0x25')](function(_0x4fa2e0){_0x2fb0b4['rows']=_0x4fa2e0;return _0x2fb0b4;})[_0x2b22('0x25')](respondWithFilteredResult(_0x52e456,_0x4c5a69))[_0x2b22('0x3e')](handleError(_0x52e456,null));};exports[_0x2b22('0x3f')]=function(_0x321de9,_0x2cb09a){var _0x21589e={'raw':![],'where':{'id':_0x321de9['params']['id']}},_0xa4aefd={};_0xa4aefd[_0x2b22('0x2c')]=_[_0x2b22('0x2e')](db[_0x2b22('0x40')]['rawAttributes']);_0xa4aefd[_0x2b22('0x2d')]=_[_0x2b22('0x2e')](_0x321de9[_0x2b22('0x2d')]);_0xa4aefd[_0x2b22('0x2f')]=_[_0x2b22('0x41')](_0xa4aefd[_0x2b22('0x2c')],_0xa4aefd[_0x2b22('0x2d')]);_0x21589e[_0x2b22('0x30')]=_[_0x2b22('0x41')](_0xa4aefd[_0x2b22('0x2c')],qs[_0x2b22('0x42')](_0x321de9[_0x2b22('0x2d')][_0x2b22('0x42')]));_0x21589e[_0x2b22('0x30')]=_0x21589e['attributes'][_0x2b22('0x31')]?_0x21589e[_0x2b22('0x30')]:_0xa4aefd['model'];if(_0x321de9[_0x2b22('0x2d')][_0x2b22('0x43')]){_0x21589e['include']=[{'all':!![]}];}_0x21589e=_[_0x2b22('0x38')]({},_0x21589e,_0x321de9['options']);return db[_0x2b22('0x40')]['find'](_0x21589e)['then'](handleEntityNotFound(_0x2cb09a,null))[_0x2b22('0x25')](respondWithResult(_0x2cb09a,null))[_0x2b22('0x3e')](handleError(_0x2cb09a,null));};exports['create']=function(_0x1b27d5,_0x37c53f){return db['AnalyticFieldReport'][_0x2b22('0x44')](_0x1b27d5['body'],{})[_0x2b22('0x25')](respondWithResult(_0x37c53f,0xc9))[_0x2b22('0x3e')](handleError(_0x37c53f,null));};exports[_0x2b22('0x45')]=function(_0x5721a8,_0x5595f6){return db[_0x2b22('0x40')]['bulkCreate'](_0x5721a8[_0x2b22('0x46')],{'raw':![],'individualHooks':!![]})[_0x2b22('0x25')](respondWithResult(_0x5595f6,0xc9))[_0x2b22('0x3e')](handleError(_0x5595f6,null));};exports[_0x2b22('0x24')]=function(_0x3f71f7,_0x48f8fe){if(_0x3f71f7[_0x2b22('0x46')]['id']){delete _0x3f71f7[_0x2b22('0x46')]['id'];}return db[_0x2b22('0x40')][_0x2b22('0x47')]({'where':{'id':_0x3f71f7[_0x2b22('0x48')]['id']}})['then'](handleEntityNotFound(_0x48f8fe,null))[_0x2b22('0x25')](saveUpdates(_0x3f71f7[_0x2b22('0x46')],null))[_0x2b22('0x25')](respondWithResult(_0x48f8fe,null))[_0x2b22('0x3e')](handleError(_0x48f8fe,null));};exports[_0x2b22('0x26')]=function(_0x540b5f,_0x7e0744){return db['AnalyticFieldReport'][_0x2b22('0x47')]({'where':{'id':_0x540b5f[_0x2b22('0x48')]['id']}})[_0x2b22('0x25')](handleEntityNotFound(_0x7e0744,null))['then'](removeEntity(_0x7e0744,null))[_0x2b22('0x3e')](handleError(_0x7e0744,null));};exports['bulkDestroy']=function(_0x3de931,_0x122386){return db['AnalyticFieldReport'][_0x2b22('0x26')]({'where':{'id':_0x3de931[_0x2b22('0x2d')]['ids']||[]},'raw':![],'individualHooks':!![]})[_0x2b22('0x25')](respondWithResult(_0x122386,0xcc))[_0x2b22('0x3e')](handleError(_0x122386,null));};exports[_0x2b22('0x49')]=function(_0x3c7009,_0x1c9b47,_0x3ca90a){return db[_0x2b22('0x4a')][_0x2b22('0x4b')]({'where':{'id':_0x3c7009[_0x2b22('0x48')]['id']}})['then'](handleEntityNotFound(_0x1c9b47,null))[_0x2b22('0x25')](function(_0x2fc5c1){if(_0x2fc5c1){return db[_0x2b22('0x4c')][_0x2b22('0x4d')](function(_0x80402f){return db['AnalyticFieldReport'][_0x2b22('0x26')]({'where':{'CustomReportId':_0x3c7009['params']['id']},'transaction':_0x80402f})['then'](function(_0x210c32){var _0x566e22=_[_0x2b22('0x2a')](_0x3c7009[_0x2b22('0x46')],function(_0x44c41a){delete _0x44c41a['id'];_0x44c41a[_0x2b22('0x4e')]=_0x3c7009[_0x2b22('0x48')]['id'];return _0x44c41a;});return db[_0x2b22('0x40')]['bulkCreate'](_0x566e22,{'transaction':_0x80402f});});})[_0x2b22('0x25')](function(){return db[_0x2b22('0x40')][_0x2b22('0x3d')]({'where':{'CustomReportId':_0x3c7009[_0x2b22('0x48')]['id']}});});}})[_0x2b22('0x25')](respondWithResult(_0x1c9b47,null))[_0x2b22('0x3e')](handleError(_0x1c9b47,null));};
\ No newline at end of file
diff --git a/server/api/analyticFieldReport/analyticFieldReport.model.js b/server/api/analyticFieldReport/analyticFieldReport.model.js
index 83e85f8..997be33 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 _0xc0bb=['moment','bluebird','request-promise','path','rimraf','../../config/environment','./analyticFieldReport.attributes','define','AnalyticFieldReport','analytics_report_fields','../../config/logger','api'];(function(_0x54757c,_0x12ad04){var _0x759b33=function(_0x265074){while(--_0x265074){_0x54757c['push'](_0x54757c['shift']());}};_0x759b33(++_0x12ad04);}(_0xc0bb,0x106));var _0xbc0b=function(_0xa9f50a,_0x1d3836){_0xa9f50a=_0xa9f50a-0x0;var _0x48d268=_0xc0bb[_0xa9f50a];return _0x48d268;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0xbc0b('0x0'))(_0xbc0b('0x1'));var moment=require(_0xbc0b('0x2'));var BPromise=require(_0xbc0b('0x3'));var rp=require(_0xbc0b('0x4'));var fs=require('fs');var path=require(_0xbc0b('0x5'));var rimraf=require(_0xbc0b('0x6'));var config=require(_0xbc0b('0x7'));var attributes=require(_0xbc0b('0x8'));module['exports']=function(_0x471792,_0x25606e){return _0x471792[_0xbc0b('0x9')](_0xbc0b('0xa'),attributes,{'tableName':_0xbc0b('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x1c7c=['moment','bluebird','path','rimraf','./analyticFieldReport.attributes','exports','analytics_report_fields','lodash','util','api'];(function(_0x584308,_0x1379b3){var _0x45865b=function(_0x145a82){while(--_0x145a82){_0x584308['push'](_0x584308['shift']());}};_0x45865b(++_0x1379b3);}(_0x1c7c,0x179));var _0xc1c7=function(_0x234cc3,_0x4795c6){_0x234cc3=_0x234cc3-0x0;var _0x166c3b=_0x1c7c[_0x234cc3];return _0x166c3b;};'use strict';var _=require(_0xc1c7('0x0'));var util=require(_0xc1c7('0x1'));var logger=require('../../config/logger')(_0xc1c7('0x2'));var moment=require(_0xc1c7('0x3'));var BPromise=require(_0xc1c7('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xc1c7('0x5'));var rimraf=require(_0xc1c7('0x6'));var config=require('../../config/environment');var attributes=require(_0xc1c7('0x7'));module[_0xc1c7('0x8')]=function(_0x52b83c,_0x3b66d4){return _0x52b83c['define']('AnalyticFieldReport',attributes,{'tableName':_0xc1c7('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 25d9b76..c4b76e8 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 _0xfc99=['lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','client','http','request','then','info','AnalyticFieldReport,\x20%s,\x20%s','request\x20sent','debug','AnalyticFieldReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch'];(function(_0x23468d,_0xd3028f){var _0x512762=function(_0x2854ff){while(--_0x2854ff){_0x23468d['push'](_0x23468d['shift']());}};_0x512762(++_0xd3028f);}(_0xfc99,0x1f4));var _0x9fc9=function(_0x1b9f4b,_0x54816c){_0x1b9f4b=_0x1b9f4b-0x0;var _0x4ab39d=_0xfc99[_0x1b9f4b];return _0x4ab39d;};'use strict';var _=require(_0x9fc9('0x0'));var util=require(_0x9fc9('0x1'));var moment=require(_0x9fc9('0x2'));var BPromise=require(_0x9fc9('0x3'));var rs=require(_0x9fc9('0x4'));var fs=require('fs');var Redis=require(_0x9fc9('0x5'));var db=require(_0x9fc9('0x6'))['db'];var utils=require(_0x9fc9('0x7'));var logger=require(_0x9fc9('0x8'))(_0x9fc9('0x9'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x9fc9('0xa')][_0x9fc9('0xb')]({'port':0x232a});function respondWithRpcPromise(_0xb1a43e,_0x5ef699,_0x1d00a4){return new BPromise(function(_0x1acd63,_0x55ea27){return client[_0x9fc9('0xc')](_0xb1a43e,_0x1d00a4)[_0x9fc9('0xd')](function(_0x5b3575){logger[_0x9fc9('0xe')](_0x9fc9('0xf'),_0x5ef699,_0x9fc9('0x10'));logger[_0x9fc9('0x11')](_0x9fc9('0x12'),_0x5ef699,_0x9fc9('0x10'),JSON[_0x9fc9('0x13')](_0x5b3575));if(_0x5b3575[_0x9fc9('0x14')]){if(_0x5b3575[_0x9fc9('0x14')][_0x9fc9('0x15')]===0x1f4){logger['error'](_0x9fc9('0xf'),_0x5ef699,_0x5b3575['error'][_0x9fc9('0x16')]);return _0x55ea27(_0x5b3575['error'][_0x9fc9('0x16')]);}logger['error'](_0x9fc9('0xf'),_0x5ef699,_0x5b3575['error'][_0x9fc9('0x16')]);return _0x1acd63(_0x5b3575[_0x9fc9('0x14')][_0x9fc9('0x16')]);}else{logger[_0x9fc9('0xe')](_0x9fc9('0xf'),_0x5ef699,'request\x20sent');_0x1acd63(_0x5b3575[_0x9fc9('0x17')]['message']);}})[_0x9fc9('0x18')](function(_0x317b3b){logger['error'](_0x9fc9('0xf'),_0x5ef699,_0x317b3b);_0x55ea27(_0x317b3b);});});}
\ No newline at end of file
+var _0xe7ab=['error','code','AnalyticFieldReport,\x20%s,\x20%s','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','http','then','info','request\x20sent','debug','AnalyticFieldReport,\x20%s,\x20%s,\x20%s','stringify'];(function(_0x2471a2,_0x3589cd){var _0x36b811=function(_0x213ace){while(--_0x213ace){_0x2471a2['push'](_0x2471a2['shift']());}};_0x36b811(++_0x3589cd);}(_0xe7ab,0x16e));var _0xbe7a=function(_0x53d0e6,_0x18ae2b){_0x53d0e6=_0x53d0e6-0x0;var _0x891140=_0xe7ab[_0x53d0e6];return _0x891140;};'use strict';var _=require(_0xbe7a('0x0'));var util=require(_0xbe7a('0x1'));var moment=require(_0xbe7a('0x2'));var BPromise=require(_0xbe7a('0x3'));var rs=require(_0xbe7a('0x4'));var fs=require('fs');var Redis=require(_0xbe7a('0x5'));var db=require(_0xbe7a('0x6'))['db'];var utils=require(_0xbe7a('0x7'));var logger=require(_0xbe7a('0x8'))(_0xbe7a('0x9'));var config=require(_0xbe7a('0xa'));var jayson=require('jayson/promise');var client=jayson['client'][_0xbe7a('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x207739,_0x201497,_0x820b05){return new BPromise(function(_0x36691,_0x446267){return client['request'](_0x207739,_0x820b05)[_0xbe7a('0xc')](function(_0x148935){logger[_0xbe7a('0xd')]('AnalyticFieldReport,\x20%s,\x20%s',_0x201497,_0xbe7a('0xe'));logger[_0xbe7a('0xf')](_0xbe7a('0x10'),_0x201497,'request\x20sent',JSON[_0xbe7a('0x11')](_0x148935));if(_0x148935[_0xbe7a('0x12')]){if(_0x148935[_0xbe7a('0x12')][_0xbe7a('0x13')]===0x1f4){logger[_0xbe7a('0x12')](_0xbe7a('0x14'),_0x201497,_0x148935[_0xbe7a('0x12')]['message']);return _0x446267(_0x148935[_0xbe7a('0x12')][_0xbe7a('0x15')]);}logger[_0xbe7a('0x12')](_0xbe7a('0x14'),_0x201497,_0x148935[_0xbe7a('0x12')]['message']);return _0x36691(_0x148935[_0xbe7a('0x12')][_0xbe7a('0x15')]);}else{logger[_0xbe7a('0xd')](_0xbe7a('0x14'),_0x201497,_0xbe7a('0xe'));_0x36691(_0x148935[_0xbe7a('0x16')][_0xbe7a('0x15')]);}})[_0xbe7a('0x17')](function(_0x4c4c15){logger[_0xbe7a('0x12')]('AnalyticFieldReport,\x20%s,\x20%s',_0x201497,_0x4c4c15);_0x446267(_0x4c4c15);});});}
\ No newline at end of file
diff --git a/server/api/analyticFieldReport/index.js b/server/api/analyticFieldReport/index.js
index b7bfdc6..8463a7b 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(_0x1a05ea,_0x4dc609){var _0x4ef29d=function(_0x721c64){while(--_0x721c64){_0x1a05ea['push'](_0x1a05ea['shift']());}};_0x4ef29d(++_0x4dc609);}(_0xa9e0,0x123));var _0x0a9e=function(_0x220dbb,_0x99328d){_0x220dbb=_0x220dbb-0x0;var _0x2b77de=_0xa9e0[_0x220dbb];return _0x2b77de;};'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(_0x180049,_0x4e8fda){var _0x56f80f=function(_0x16d579){while(--_0x16d579){_0x180049['push'](_0x180049['shift']());}};_0x56f80f(++_0x4e8fda);}(_0xa9e0,0x123));var _0x0a9e=function(_0x4fc9e6,_0xc51915){_0x4fc9e6=_0x4fc9e6-0x0;var _0x551d28=_0xa9e0[_0x4fc9e6];return _0x551d28;};'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 7718371..b45803d 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 _0x7980=['exports','STRING','name','sequelize'];(function(_0x2a76fb,_0x23b62a){var _0x41bc10=function(_0x2765e3){while(--_0x2765e3){_0x2a76fb['push'](_0x2a76fb['shift']());}};_0x41bc10(++_0x23b62a);}(_0x7980,0xab));var _0x0798=function(_0xbc7942,_0x566082){_0xbc7942=_0xbc7942-0x0;var _0x11fe77=_0x7980[_0xbc7942];return _0x11fe77;};'use strict';var Sequelize=require(_0x0798('0x0'));module[_0x0798('0x1')]={'name':{'type':Sequelize[_0x0798('0x2')],'allowNull':![],'unique':_0x0798('0x3')},'table':{'type':Sequelize[_0x0798('0x2')]},'metric':{'type':Sequelize['TEXT']},'description':{'type':Sequelize[_0x0798('0x2')]}};
\ No newline at end of file
+var _0x317b=['exports','name','STRING','sequelize'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x317b,0x1c7));var _0xb317=function(_0x1e5a1a,_0x2de0fd){_0x1e5a1a=_0x1e5a1a-0x0;var _0x582b4c=_0x317b[_0x1e5a1a];return _0x582b4c;};'use strict';var Sequelize=require(_0xb317('0x0'));module[_0xb317('0x1')]={'name':{'type':Sequelize['STRING'],'allowNull':![],'unique':_0xb317('0x2')},'table':{'type':Sequelize[_0xb317('0x3')]},'metric':{'type':Sequelize['TEXT']},'description':{'type':Sequelize[_0xb317('0x3')]}};
\ No newline at end of file
diff --git a/server/api/analyticMetric/analyticMetric.controller.js b/server/api/analyticMetric/analyticMetric.controller.js
index 31cdef5..ed85051 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 _0x3e74=['status','set','Content-Range','apply','save','update','then','destroy','get','Metrics','sendStatus','stack','name','send','index','map','AnalyticMetric','fieldName','type','key','model','query','keys','attributes','intersection','fields','hasOwnProperty','sort','where','filters','pick','merge','VIRTUAL','filter','include','findAll','rows','catch','params','rawAttributes','length','includeAll','create','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','UserProfileSection','find','userProfileId','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','eml-format','zip-dir','fast-json-patch','request-promise','mustache','path','sox','to-csv','ejs','fs-extra','squel','crypto','jsforce','desk.js','papaparse','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','../../config/utils','../../config/environment','../../mysqldb','end','json','undefined','limit','offset','count'];(function(_0x504501,_0x3de43a){var _0x5a6e4c=function(_0x2bd0f3){while(--_0x2bd0f3){_0x504501['push'](_0x504501['shift']());}};_0x5a6e4c(++_0x3de43a);}(_0x3e74,0x175));var _0x43e7=function(_0x5b10a9,_0x5d9193){_0x5b10a9=_0x5b10a9-0x0;var _0x14c4cd=_0x3e74[_0x5b10a9];return _0x14c4cd;};'use strict';var emlformat=require(_0x43e7('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x43e7('0x1'));var jsonpatch=require(_0x43e7('0x2'));var rp=require(_0x43e7('0x3'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x43e7('0x4'));var util=require('util');var path=require(_0x43e7('0x5'));var sox=require(_0x43e7('0x6'));var csv=require(_0x43e7('0x7'));var ejs=require(_0x43e7('0x8'));var fs=require('fs');var fs_extra=require(_0x43e7('0x9'));var _=require('lodash');var squel=require(_0x43e7('0xa'));var crypto=require(_0x43e7('0xb'));var jsforce=require(_0x43e7('0xc'));var deskjs=require(_0x43e7('0xd'));var toCsv=require(_0x43e7('0x7'));var querystring=require('querystring');var Papa=require(_0x43e7('0xe'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x43e7('0xf'));var as=require(_0x43e7('0x10'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x43e7('0x11'))('api');var utils=require(_0x43e7('0x12'));var config=require(_0x43e7('0x13'));var licenseUtil=require('../../config/license/util');var db=require(_0x43e7('0x14'))['db'];function respondWithStatusCode(_0xc960ea,_0x2718d3){_0x2718d3=_0x2718d3||0xcc;return function(_0x3bb83f){if(_0x3bb83f){return _0xc960ea['sendStatus'](_0x2718d3);}return _0xc960ea['status'](_0x2718d3)[_0x43e7('0x15')]();};}function respondWithResult(_0x21fdd3,_0x44b0bd){_0x44b0bd=_0x44b0bd||0xc8;return function(_0x51b974){if(_0x51b974){return _0x21fdd3['status'](_0x44b0bd)[_0x43e7('0x16')](_0x51b974);}};}function respondWithFilteredResult(_0x14c146,_0x203378){return function(_0x328445){if(_0x328445){var _0x4de324=typeof _0x203378['offset']===_0x43e7('0x17')&&typeof _0x203378[_0x43e7('0x18')]===_0x43e7('0x17');var _0x5d346f=_0x328445['count'];var _0x446986=_0x4de324?0x0:_0x203378[_0x43e7('0x19')];var _0x9037d3=_0x4de324?_0x328445[_0x43e7('0x1a')]:_0x203378[_0x43e7('0x19')]+_0x203378[_0x43e7('0x18')];var _0x619236;if(_0x9037d3>=_0x5d346f){_0x9037d3=_0x5d346f;_0x619236=0xc8;}else{_0x619236=0xce;}_0x14c146[_0x43e7('0x1b')](_0x619236);return _0x14c146[_0x43e7('0x1c')](_0x43e7('0x1d'),_0x446986+'-'+_0x9037d3+'/'+_0x5d346f)[_0x43e7('0x16')](_0x328445);}return null;};}function patchUpdates(_0x177ee1){return function(_0x4b5d64){try{jsonpatch[_0x43e7('0x1e')](_0x4b5d64,_0x177ee1,!![]);}catch(_0x3c6625){return BPromise['reject'](_0x3c6625);}return _0x4b5d64[_0x43e7('0x1f')]();};}function saveUpdates(_0x3e281e,_0x3945bb){return function(_0x28aacc){if(_0x28aacc){return _0x28aacc[_0x43e7('0x20')](_0x3e281e)[_0x43e7('0x21')](function(_0x54a9e7){return _0x54a9e7;});}return null;};}function removeEntity(_0x454359,_0x4eea52){return function(_0x4c9df3){if(_0x4c9df3){return _0x4c9df3[_0x43e7('0x22')]()[_0x43e7('0x21')](function(){var _0x4b2b9f=_0x4c9df3[_0x43e7('0x23')]({'plain':!![]});var _0x4ca5cf=_0x43e7('0x24');return db['UserProfileResource'][_0x43e7('0x22')]({'where':{'type':_0x4ca5cf,'resourceId':_0x4b2b9f['id']}})[_0x43e7('0x21')](function(){return _0x4c9df3;});})[_0x43e7('0x21')](function(){_0x454359[_0x43e7('0x1b')](0xcc)['end']();});}};}function handleEntityNotFound(_0x52b7b3,_0x805b54){return function(_0x501551){if(!_0x501551){_0x52b7b3[_0x43e7('0x25')](0x194);}return _0x501551;};}function handleError(_0x40dc8f,_0x3565cf){_0x3565cf=_0x3565cf||0x1f4;return function(_0xb1fc63){logger['error'](_0xb1fc63[_0x43e7('0x26')]);if(_0xb1fc63[_0x43e7('0x27')]){delete _0xb1fc63[_0x43e7('0x27')];}_0x40dc8f[_0x43e7('0x1b')](_0x3565cf)[_0x43e7('0x28')](_0xb1fc63);};}exports[_0x43e7('0x29')]=function(_0x2b85a5,_0x31b2a6){var _0x3bf475={},_0x35dbcd={},_0x17df44={'count':0x0,'rows':[]};var _0x19725a=_[_0x43e7('0x2a')](db[_0x43e7('0x2b')]['rawAttributes'],function(_0x238321){return{'name':_0x238321[_0x43e7('0x2c')],'type':_0x238321[_0x43e7('0x2d')][_0x43e7('0x2e')]};});_0x35dbcd[_0x43e7('0x2f')]=_['map'](_0x19725a,_0x43e7('0x27'));_0x35dbcd[_0x43e7('0x30')]=_[_0x43e7('0x31')](_0x2b85a5[_0x43e7('0x30')]);_0x35dbcd['filters']=_['intersection'](_0x35dbcd['model'],_0x35dbcd[_0x43e7('0x30')]);_0x3bf475[_0x43e7('0x32')]=_[_0x43e7('0x33')](_0x35dbcd[_0x43e7('0x2f')],qs[_0x43e7('0x34')](_0x2b85a5[_0x43e7('0x30')]['fields']));_0x3bf475['attributes']=_0x3bf475['attributes']['length']?_0x3bf475['attributes']:_0x35dbcd['model'];if(!_0x2b85a5['query'][_0x43e7('0x35')]('nolimit')){_0x3bf475[_0x43e7('0x18')]=qs[_0x43e7('0x18')](_0x2b85a5[_0x43e7('0x30')][_0x43e7('0x18')]);_0x3bf475[_0x43e7('0x19')]=qs[_0x43e7('0x19')](_0x2b85a5[_0x43e7('0x30')]['offset']);}_0x3bf475['order']=qs['sort'](_0x2b85a5[_0x43e7('0x30')][_0x43e7('0x36')]);_0x3bf475[_0x43e7('0x37')]=qs[_0x43e7('0x38')](_[_0x43e7('0x39')](_0x2b85a5[_0x43e7('0x30')],_0x35dbcd[_0x43e7('0x38')]),_0x19725a);if(_0x2b85a5[_0x43e7('0x30')]['filter']){_0x3bf475[_0x43e7('0x37')]=_[_0x43e7('0x3a')](_0x3bf475['where'],{'$or':_[_0x43e7('0x2a')](_0x19725a,function(_0x4c0c7a){if(_0x4c0c7a[_0x43e7('0x2d')]!==_0x43e7('0x3b')){var _0x1c6f45={};_0x1c6f45[_0x4c0c7a[_0x43e7('0x27')]]={'$like':'%'+_0x2b85a5[_0x43e7('0x30')][_0x43e7('0x3c')]+'%'};return _0x1c6f45;}})});}_0x3bf475=_['merge']({},_0x3bf475,_0x2b85a5['options']);var _0x30dfa9={'where':_0x3bf475[_0x43e7('0x37')]};return db[_0x43e7('0x2b')][_0x43e7('0x1a')](_0x30dfa9)[_0x43e7('0x21')](function(_0x4a4a85){_0x17df44[_0x43e7('0x1a')]=_0x4a4a85;if(_0x2b85a5[_0x43e7('0x30')]['includeAll']){_0x3bf475[_0x43e7('0x3d')]=[{'all':!![]}];}return db['AnalyticMetric'][_0x43e7('0x3e')](_0x3bf475);})['then'](function(_0x3d81ae){_0x17df44[_0x43e7('0x3f')]=_0x3d81ae;return _0x17df44;})[_0x43e7('0x21')](respondWithFilteredResult(_0x31b2a6,_0x3bf475))[_0x43e7('0x40')](handleError(_0x31b2a6,null));};exports['show']=function(_0x47d6a1,_0x103393){var _0x40c509={'raw':!![],'where':{'id':_0x47d6a1[_0x43e7('0x41')]['id']}},_0xe979b5={};_0xe979b5['model']=_['keys'](db['AnalyticMetric'][_0x43e7('0x42')]);_0xe979b5['query']=_[_0x43e7('0x31')](_0x47d6a1['query']);_0xe979b5['filters']=_[_0x43e7('0x33')](_0xe979b5['model'],_0xe979b5[_0x43e7('0x30')]);_0x40c509[_0x43e7('0x32')]=_[_0x43e7('0x33')](_0xe979b5[_0x43e7('0x2f')],qs['fields'](_0x47d6a1[_0x43e7('0x30')][_0x43e7('0x34')]));_0x40c509[_0x43e7('0x32')]=_0x40c509[_0x43e7('0x32')][_0x43e7('0x43')]?_0x40c509[_0x43e7('0x32')]:_0xe979b5['model'];if(_0x47d6a1['query'][_0x43e7('0x44')]){_0x40c509[_0x43e7('0x3d')]=[{'all':!![]}];}_0x40c509=_[_0x43e7('0x3a')]({},_0x40c509,_0x47d6a1['options']);return db['AnalyticMetric']['find'](_0x40c509)[_0x43e7('0x21')](handleEntityNotFound(_0x103393,null))[_0x43e7('0x21')](respondWithResult(_0x103393,null))['catch'](handleError(_0x103393,null));};exports[_0x43e7('0x45')]=function(_0x47686e,_0x3c96fe){return db['AnalyticMetric']['create'](_0x47686e['body'],{})['then'](function(_0x214e7e){var _0xe955fc=_0x47686e['user'][_0x43e7('0x23')]({'plain':!![]});if(!_0xe955fc)throw new Error(_0x43e7('0x46'));if(_0xe955fc[_0x43e7('0x47')]===_0x43e7('0x48')){var _0x4a0ce5=_0x214e7e[_0x43e7('0x23')]({'plain':!![]});var _0x483f20='Metrics';return db[_0x43e7('0x49')][_0x43e7('0x4a')]({'where':{'name':_0x483f20,'userProfileId':_0xe955fc[_0x43e7('0x4b')]},'raw':!![]})[_0x43e7('0x21')](function(_0x13503c){if(_0x13503c&&_0x13503c[_0x43e7('0x4c')]===0x0){return db[_0x43e7('0x4d')][_0x43e7('0x45')]({'name':_0x4a0ce5[_0x43e7('0x27')],'resourceId':_0x4a0ce5['id'],'type':_0x13503c[_0x43e7('0x27')],'sectionId':_0x13503c['id']},{})['then'](function(){return _0x214e7e;});}else{return _0x214e7e;}})[_0x43e7('0x40')](function(_0x46c910){logger['error'](_0x43e7('0x4e'),_0x46c910);throw _0x46c910;});}return _0x214e7e;})['then'](respondWithResult(_0x3c96fe,0xc9))[_0x43e7('0x40')](handleError(_0x3c96fe,null));};exports[_0x43e7('0x20')]=function(_0x34e2ec,_0x1f561f){if(_0x34e2ec[_0x43e7('0x4f')]['id']){delete _0x34e2ec['body']['id'];}return db['AnalyticMetric'][_0x43e7('0x4a')]({'where':{'id':_0x34e2ec[_0x43e7('0x41')]['id']}})[_0x43e7('0x21')](handleEntityNotFound(_0x1f561f,null))[_0x43e7('0x21')](saveUpdates(_0x34e2ec[_0x43e7('0x4f')],null))[_0x43e7('0x21')](respondWithResult(_0x1f561f,null))[_0x43e7('0x40')](handleError(_0x1f561f,null));};exports[_0x43e7('0x22')]=function(_0x26d86c,_0x24e758){return db[_0x43e7('0x2b')]['find']({'where':{'id':_0x26d86c[_0x43e7('0x41')]['id']}})[_0x43e7('0x21')](handleEntityNotFound(_0x24e758,null))['then'](removeEntity(_0x24e758,null))[_0x43e7('0x40')](handleError(_0x24e758,null));};
\ No newline at end of file
+var _0x9c5a=['update','then','get','Metrics','UserProfileResource','destroy','error','stack','name','send','AnalyticMetric','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','fields','attributes','hasOwnProperty','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','rows','catch','show','length','include','find','create','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','userProfileId','autoAssociation','body','params','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','util','path','to-csv','fs-extra','lodash','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','status','json','undefined','limit','count','offset','set','Content-Range','apply','save'];(function(_0x68b90b,_0xb8b06a){var _0x5220ec=function(_0x226484){while(--_0x226484){_0x68b90b['push'](_0x68b90b['shift']());}};_0x5220ec(++_0xb8b06a);}(_0x9c5a,0x1c3));var _0xa9c5=function(_0x42db6d,_0x5c11ce){_0x42db6d=_0x42db6d-0x0;var _0x9fd035=_0x9c5a[_0x42db6d];return _0x9fd035;};'use strict';var emlformat=require(_0xa9c5('0x0'));var rimraf=require(_0xa9c5('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xa9c5('0x2'));var rp=require(_0xa9c5('0x3'));var moment=require(_0xa9c5('0x4'));var BPromise=require(_0xa9c5('0x5'));var Mustache=require('mustache');var util=require(_0xa9c5('0x6'));var path=require(_0xa9c5('0x7'));var sox=require('sox');var csv=require(_0xa9c5('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xa9c5('0x9'));var _=require(_0xa9c5('0xa'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0xa9c5('0xb'));var deskjs=require(_0xa9c5('0xc'));var toCsv=require('to-csv');var querystring=require(_0xa9c5('0xd'));var Papa=require(_0xa9c5('0xe'));var Redis=require('ioredis');var authService=require(_0xa9c5('0xf'));var qs=require(_0xa9c5('0x10'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0xa9c5('0x11'))(_0xa9c5('0x12'));var utils=require(_0xa9c5('0x13'));var config=require(_0xa9c5('0x14'));var licenseUtil=require(_0xa9c5('0x15'));var db=require(_0xa9c5('0x16'))['db'];function respondWithStatusCode(_0x51c8d,_0x42d5cf){_0x42d5cf=_0x42d5cf||0xcc;return function(_0x3c5ac7){if(_0x3c5ac7){return _0x51c8d[_0xa9c5('0x17')](_0x42d5cf);}return _0x51c8d['status'](_0x42d5cf)[_0xa9c5('0x18')]();};}function respondWithResult(_0x1276d2,_0x7df76d){_0x7df76d=_0x7df76d||0xc8;return function(_0x3806c4){if(_0x3806c4){return _0x1276d2[_0xa9c5('0x19')](_0x7df76d)[_0xa9c5('0x1a')](_0x3806c4);}};}function respondWithFilteredResult(_0x251099,_0x40b001){return function(_0x19a43e){if(_0x19a43e){var _0xcf13f2=typeof _0x40b001['offset']===_0xa9c5('0x1b')&&typeof _0x40b001[_0xa9c5('0x1c')]===_0xa9c5('0x1b');var _0x55cce5=_0x19a43e[_0xa9c5('0x1d')];var _0x1142d9=_0xcf13f2?0x0:_0x40b001[_0xa9c5('0x1e')];var _0x3b8cf7=_0xcf13f2?_0x19a43e[_0xa9c5('0x1d')]:_0x40b001[_0xa9c5('0x1e')]+_0x40b001[_0xa9c5('0x1c')];var _0x1e5ce6;if(_0x3b8cf7>=_0x55cce5){_0x3b8cf7=_0x55cce5;_0x1e5ce6=0xc8;}else{_0x1e5ce6=0xce;}_0x251099[_0xa9c5('0x19')](_0x1e5ce6);return _0x251099[_0xa9c5('0x1f')](_0xa9c5('0x20'),_0x1142d9+'-'+_0x3b8cf7+'/'+_0x55cce5)[_0xa9c5('0x1a')](_0x19a43e);}return null;};}function patchUpdates(_0x54f8b9){return function(_0x1115ad){try{jsonpatch[_0xa9c5('0x21')](_0x1115ad,_0x54f8b9,!![]);}catch(_0x541c77){return BPromise['reject'](_0x541c77);}return _0x1115ad[_0xa9c5('0x22')]();};}function saveUpdates(_0x366f5c,_0x10b208){return function(_0x3b497a){if(_0x3b497a){return _0x3b497a[_0xa9c5('0x23')](_0x366f5c)[_0xa9c5('0x24')](function(_0x48e2cb){return _0x48e2cb;});}return null;};}function removeEntity(_0x4fa280,_0x3d4e1b){return function(_0x11d395){if(_0x11d395){return _0x11d395['destroy']()[_0xa9c5('0x24')](function(){var _0x424b4c=_0x11d395[_0xa9c5('0x25')]({'plain':!![]});var _0x32fc7d=_0xa9c5('0x26');return db[_0xa9c5('0x27')][_0xa9c5('0x28')]({'where':{'type':_0x32fc7d,'resourceId':_0x424b4c['id']}})['then'](function(){return _0x11d395;});})['then'](function(){_0x4fa280[_0xa9c5('0x19')](0xcc)['end']();});}};}function handleEntityNotFound(_0x1762ac,_0x830bad){return function(_0x4caefa){if(!_0x4caefa){_0x1762ac[_0xa9c5('0x17')](0x194);}return _0x4caefa;};}function handleError(_0x320dc0,_0x5f468b){_0x5f468b=_0x5f468b||0x1f4;return function(_0x413edf){logger[_0xa9c5('0x29')](_0x413edf[_0xa9c5('0x2a')]);if(_0x413edf[_0xa9c5('0x2b')]){delete _0x413edf[_0xa9c5('0x2b')];}_0x320dc0['status'](_0x5f468b)[_0xa9c5('0x2c')](_0x413edf);};}exports['index']=function(_0x3c3da7,_0x1ef388){var _0x2eeed1={},_0x541475={},_0xc6d0c1={'count':0x0,'rows':[]};var _0xbe29c5=_['map'](db[_0xa9c5('0x2d')][_0xa9c5('0x2e')],function(_0x431e07){return{'name':_0x431e07[_0xa9c5('0x2f')],'type':_0x431e07[_0xa9c5('0x30')][_0xa9c5('0x31')]};});_0x541475[_0xa9c5('0x32')]=_['map'](_0xbe29c5,_0xa9c5('0x2b'));_0x541475[_0xa9c5('0x33')]=_[_0xa9c5('0x34')](_0x3c3da7[_0xa9c5('0x33')]);_0x541475[_0xa9c5('0x35')]=_[_0xa9c5('0x36')](_0x541475[_0xa9c5('0x32')],_0x541475[_0xa9c5('0x33')]);_0x2eeed1['attributes']=_['intersection'](_0x541475[_0xa9c5('0x32')],qs[_0xa9c5('0x37')](_0x3c3da7[_0xa9c5('0x33')][_0xa9c5('0x37')]));_0x2eeed1[_0xa9c5('0x38')]=_0x2eeed1[_0xa9c5('0x38')]['length']?_0x2eeed1['attributes']:_0x541475['model'];if(!_0x3c3da7[_0xa9c5('0x33')][_0xa9c5('0x39')]('nolimit')){_0x2eeed1[_0xa9c5('0x1c')]=qs['limit'](_0x3c3da7[_0xa9c5('0x33')][_0xa9c5('0x1c')]);_0x2eeed1[_0xa9c5('0x1e')]=qs[_0xa9c5('0x1e')](_0x3c3da7['query'][_0xa9c5('0x1e')]);}_0x2eeed1[_0xa9c5('0x3a')]=qs[_0xa9c5('0x3b')](_0x3c3da7[_0xa9c5('0x33')][_0xa9c5('0x3b')]);_0x2eeed1[_0xa9c5('0x3c')]=qs[_0xa9c5('0x35')](_[_0xa9c5('0x3d')](_0x3c3da7['query'],_0x541475[_0xa9c5('0x35')]),_0xbe29c5);if(_0x3c3da7[_0xa9c5('0x33')][_0xa9c5('0x3e')]){_0x2eeed1[_0xa9c5('0x3c')]=_[_0xa9c5('0x3f')](_0x2eeed1[_0xa9c5('0x3c')],{'$or':_['map'](_0xbe29c5,function(_0x307736){if(_0x307736['type']!==_0xa9c5('0x40')){var _0x5c89e7={};_0x5c89e7[_0x307736[_0xa9c5('0x2b')]]={'$like':'%'+_0x3c3da7[_0xa9c5('0x33')][_0xa9c5('0x3e')]+'%'};return _0x5c89e7;}})});}_0x2eeed1=_['merge']({},_0x2eeed1,_0x3c3da7[_0xa9c5('0x41')]);var _0x1ddd72={'where':_0x2eeed1[_0xa9c5('0x3c')]};return db[_0xa9c5('0x2d')]['count'](_0x1ddd72)[_0xa9c5('0x24')](function(_0x97803f){_0xc6d0c1[_0xa9c5('0x1d')]=_0x97803f;if(_0x3c3da7[_0xa9c5('0x33')][_0xa9c5('0x42')]){_0x2eeed1['include']=[{'all':!![]}];}return db[_0xa9c5('0x2d')]['findAll'](_0x2eeed1);})[_0xa9c5('0x24')](function(_0x397614){_0xc6d0c1[_0xa9c5('0x43')]=_0x397614;return _0xc6d0c1;})[_0xa9c5('0x24')](respondWithFilteredResult(_0x1ef388,_0x2eeed1))[_0xa9c5('0x44')](handleError(_0x1ef388,null));};exports[_0xa9c5('0x45')]=function(_0xf35cb3,_0x3e8633){var _0x1f895a={'raw':!![],'where':{'id':_0xf35cb3['params']['id']}},_0xc28b1a={};_0xc28b1a[_0xa9c5('0x32')]=_[_0xa9c5('0x34')](db[_0xa9c5('0x2d')][_0xa9c5('0x2e')]);_0xc28b1a[_0xa9c5('0x33')]=_[_0xa9c5('0x34')](_0xf35cb3['query']);_0xc28b1a[_0xa9c5('0x35')]=_[_0xa9c5('0x36')](_0xc28b1a['model'],_0xc28b1a['query']);_0x1f895a['attributes']=_['intersection'](_0xc28b1a['model'],qs[_0xa9c5('0x37')](_0xf35cb3[_0xa9c5('0x33')][_0xa9c5('0x37')]));_0x1f895a[_0xa9c5('0x38')]=_0x1f895a[_0xa9c5('0x38')][_0xa9c5('0x46')]?_0x1f895a[_0xa9c5('0x38')]:_0xc28b1a[_0xa9c5('0x32')];if(_0xf35cb3[_0xa9c5('0x33')][_0xa9c5('0x42')]){_0x1f895a[_0xa9c5('0x47')]=[{'all':!![]}];}_0x1f895a=_[_0xa9c5('0x3f')]({},_0x1f895a,_0xf35cb3[_0xa9c5('0x41')]);return db['AnalyticMetric'][_0xa9c5('0x48')](_0x1f895a)['then'](handleEntityNotFound(_0x3e8633,null))[_0xa9c5('0x24')](respondWithResult(_0x3e8633,null))[_0xa9c5('0x44')](handleError(_0x3e8633,null));};exports['create']=function(_0x5cbd33,_0xf00970){return db[_0xa9c5('0x2d')][_0xa9c5('0x49')](_0x5cbd33['body'],{})['then'](function(_0x2333c4){var _0xd03cec=_0x5cbd33['user'][_0xa9c5('0x25')]({'plain':!![]});if(!_0xd03cec)throw new Error(_0xa9c5('0x4a'));if(_0xd03cec[_0xa9c5('0x4b')]===_0xa9c5('0x4c')){var _0x34020f=_0x2333c4[_0xa9c5('0x25')]({'plain':!![]});var _0x4b6fc9='Metrics';return db['UserProfileSection'][_0xa9c5('0x48')]({'where':{'name':_0x4b6fc9,'userProfileId':_0xd03cec[_0xa9c5('0x4d')]},'raw':!![]})[_0xa9c5('0x24')](function(_0xef4d2){if(_0xef4d2&&_0xef4d2[_0xa9c5('0x4e')]===0x0){return db[_0xa9c5('0x27')]['create']({'name':_0x34020f[_0xa9c5('0x2b')],'resourceId':_0x34020f['id'],'type':_0xef4d2[_0xa9c5('0x2b')],'sectionId':_0xef4d2['id']},{})[_0xa9c5('0x24')](function(){return _0x2333c4;});}else{return _0x2333c4;}})[_0xa9c5('0x44')](function(_0xa0b458){logger[_0xa9c5('0x29')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0xa0b458);throw _0xa0b458;});}return _0x2333c4;})['then'](respondWithResult(_0xf00970,0xc9))[_0xa9c5('0x44')](handleError(_0xf00970,null));};exports['update']=function(_0x1b158f,_0x5ea9b0){if(_0x1b158f[_0xa9c5('0x4f')]['id']){delete _0x1b158f[_0xa9c5('0x4f')]['id'];}return db[_0xa9c5('0x2d')]['find']({'where':{'id':_0x1b158f[_0xa9c5('0x50')]['id']}})[_0xa9c5('0x24')](handleEntityNotFound(_0x5ea9b0,null))[_0xa9c5('0x24')](saveUpdates(_0x1b158f[_0xa9c5('0x4f')],null))['then'](respondWithResult(_0x5ea9b0,null))['catch'](handleError(_0x5ea9b0,null));};exports[_0xa9c5('0x28')]=function(_0x2b66ee,_0x3205f2){return db['AnalyticMetric'][_0xa9c5('0x48')]({'where':{'id':_0x2b66ee[_0xa9c5('0x50')]['id']}})[_0xa9c5('0x24')](handleEntityNotFound(_0x3205f2,null))[_0xa9c5('0x24')](removeEntity(_0x3205f2,null))[_0xa9c5('0x44')](handleError(_0x3205f2,null));};
\ No newline at end of file
diff --git a/server/api/analyticMetric/analyticMetric.model.js b/server/api/analyticMetric/analyticMetric.model.js
index 20ce05e..30e1971 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 _0x9a96=['../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./analyticMetric.attributes','exports','define','AnalyticMetric','analytics_metrics','lodash','util'];(function(_0x4550fc,_0x327d3e){var _0x4e6e5a=function(_0x38c89e){while(--_0x38c89e){_0x4550fc['push'](_0x4550fc['shift']());}};_0x4e6e5a(++_0x327d3e);}(_0x9a96,0xd0));var _0x69a9=function(_0x4c4b71,_0x310603){_0x4c4b71=_0x4c4b71-0x0;var _0x173072=_0x9a96[_0x4c4b71];return _0x173072;};'use strict';var _=require(_0x69a9('0x0'));var util=require(_0x69a9('0x1'));var logger=require(_0x69a9('0x2'))(_0x69a9('0x3'));var moment=require(_0x69a9('0x4'));var BPromise=require(_0x69a9('0x5'));var rp=require(_0x69a9('0x6'));var fs=require('fs');var path=require(_0x69a9('0x7'));var rimraf=require(_0x69a9('0x8'));var config=require(_0x69a9('0x9'));var attributes=require(_0x69a9('0xa'));module[_0x69a9('0xb')]=function(_0x5a48bf,_0x245072){return _0x5a48bf[_0x69a9('0xc')](_0x69a9('0xd'),attributes,{'tableName':_0x69a9('0xe'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x82f8=['./analyticMetric.attributes','exports','define','AnalyticMetric','analytics_metrics','util','../../config/logger','moment','bluebird','request-promise','path','rimraf','../../config/environment'];(function(_0x2d2d81,_0x165e97){var _0x52520b=function(_0x1d0f29){while(--_0x1d0f29){_0x2d2d81['push'](_0x2d2d81['shift']());}};_0x52520b(++_0x165e97);}(_0x82f8,0x157));var _0x882f=function(_0x486bf4,_0x568cc0){_0x486bf4=_0x486bf4-0x0;var _0x48f1d6=_0x82f8[_0x486bf4];return _0x48f1d6;};'use strict';var _=require('lodash');var util=require(_0x882f('0x0'));var logger=require(_0x882f('0x1'))('api');var moment=require(_0x882f('0x2'));var BPromise=require(_0x882f('0x3'));var rp=require(_0x882f('0x4'));var fs=require('fs');var path=require(_0x882f('0x5'));var rimraf=require(_0x882f('0x6'));var config=require(_0x882f('0x7'));var attributes=require(_0x882f('0x8'));module[_0x882f('0x9')]=function(_0x4efdc9,_0x57fc29){return _0x4efdc9[_0x882f('0xa')](_0x882f('0xb'),attributes,{'tableName':_0x882f('0xc'),'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 2186ced..2b84cf5 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 _0x6064=['debug','stringify','error','code','message','catch','lodash','util','moment','randomstring','ioredis','rpc','../../config/environment','jayson/promise','client','http','info','AnalyticMetric,\x20%s,\x20%s','request\x20sent'];(function(_0x2ca2d0,_0x3ea8e4){var _0x521c23=function(_0x5b0731){while(--_0x5b0731){_0x2ca2d0['push'](_0x2ca2d0['shift']());}};_0x521c23(++_0x3ea8e4);}(_0x6064,0x15c));var _0x4606=function(_0x3fb45f,_0x35200b){_0x3fb45f=_0x3fb45f-0x0;var _0x1790f1=_0x6064[_0x3fb45f];return _0x1790f1;};'use strict';var _=require(_0x4606('0x0'));var util=require(_0x4606('0x1'));var moment=require(_0x4606('0x2'));var BPromise=require('bluebird');var rs=require(_0x4606('0x3'));var fs=require('fs');var Redis=require(_0x4606('0x4'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x4606('0x5'));var config=require(_0x4606('0x6'));var jayson=require(_0x4606('0x7'));var client=jayson[_0x4606('0x8')][_0x4606('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x2f7ac3,_0x5a9c84,_0x58cec6){return new BPromise(function(_0x3d3129,_0x54a61f){return client['request'](_0x2f7ac3,_0x58cec6)['then'](function(_0x193b6b){logger[_0x4606('0xa')](_0x4606('0xb'),_0x5a9c84,_0x4606('0xc'));logger[_0x4606('0xd')]('AnalyticMetric,\x20%s,\x20%s,\x20%s',_0x5a9c84,_0x4606('0xc'),JSON[_0x4606('0xe')](_0x193b6b));if(_0x193b6b[_0x4606('0xf')]){if(_0x193b6b['error'][_0x4606('0x10')]===0x1f4){logger[_0x4606('0xf')](_0x4606('0xb'),_0x5a9c84,_0x193b6b[_0x4606('0xf')][_0x4606('0x11')]);return _0x54a61f(_0x193b6b['error']['message']);}logger['error']('AnalyticMetric,\x20%s,\x20%s',_0x5a9c84,_0x193b6b[_0x4606('0xf')][_0x4606('0x11')]);return _0x3d3129(_0x193b6b[_0x4606('0xf')][_0x4606('0x11')]);}else{logger['info'](_0x4606('0xb'),_0x5a9c84,_0x4606('0xc'));_0x3d3129(_0x193b6b['result'][_0x4606('0x11')]);}})[_0x4606('0x12')](function(_0x555203){logger['error'](_0x4606('0xb'),_0x5a9c84,_0x555203);_0x54a61f(_0x555203);});});}
\ No newline at end of file
+var _0x1c76=['client','http','request','info','AnalyticMetric,\x20%s,\x20%s','request\x20sent','debug','AnalyticMetric,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','lodash','util','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise'];(function(_0x595e1f,_0x3c3c87){var _0x396b4d=function(_0x15f157){while(--_0x15f157){_0x595e1f['push'](_0x595e1f['shift']());}};_0x396b4d(++_0x3c3c87);}(_0x1c76,0x1d9));var _0x61c7=function(_0x5bf40f,_0x2a42a0){_0x5bf40f=_0x5bf40f-0x0;var _0x4358ae=_0x1c76[_0x5bf40f];return _0x4358ae;};'use strict';var _=require(_0x61c7('0x0'));var util=require(_0x61c7('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x61c7('0x2'));var fs=require('fs');var Redis=require(_0x61c7('0x3'));var db=require(_0x61c7('0x4'))['db'];var utils=require(_0x61c7('0x5'));var logger=require(_0x61c7('0x6'))(_0x61c7('0x7'));var config=require(_0x61c7('0x8'));var jayson=require(_0x61c7('0x9'));var client=jayson[_0x61c7('0xa')][_0x61c7('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x296a1a,_0x57b55e,_0x5370e3){return new BPromise(function(_0x3cfc0e,_0x394885){return client[_0x61c7('0xc')](_0x296a1a,_0x5370e3)['then'](function(_0x2754a0){logger[_0x61c7('0xd')](_0x61c7('0xe'),_0x57b55e,_0x61c7('0xf'));logger[_0x61c7('0x10')](_0x61c7('0x11'),_0x57b55e,_0x61c7('0xf'),JSON[_0x61c7('0x12')](_0x2754a0));if(_0x2754a0[_0x61c7('0x13')]){if(_0x2754a0[_0x61c7('0x13')]['code']===0x1f4){logger['error'](_0x61c7('0xe'),_0x57b55e,_0x2754a0[_0x61c7('0x13')][_0x61c7('0x14')]);return _0x394885(_0x2754a0[_0x61c7('0x13')][_0x61c7('0x14')]);}logger['error']('AnalyticMetric,\x20%s,\x20%s',_0x57b55e,_0x2754a0['error'][_0x61c7('0x14')]);return _0x3cfc0e(_0x2754a0[_0x61c7('0x13')][_0x61c7('0x14')]);}else{logger['info'](_0x61c7('0xe'),_0x57b55e,_0x61c7('0xf'));_0x3cfc0e(_0x2754a0[_0x61c7('0x15')]['message']);}})[_0x61c7('0x16')](function(_0x4d80a8){logger[_0x61c7('0x13')](_0x61c7('0xe'),_0x57b55e,_0x4d80a8);_0x394885(_0x4d80a8);});});}
\ No newline at end of file
diff --git a/server/api/analyticMetric/index.js b/server/api/analyticMetric/index.js
index fdb0a17..6482536 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 _0x4d49=['create','put','update','delete','destroy','exports','util','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./analyticMetric.controller','get','index','/:id','isAuthenticated','show','post'];(function(_0x27d4f8,_0x10575f){var _0x265bab=function(_0x2ba92e){while(--_0x2ba92e){_0x27d4f8['push'](_0x27d4f8['shift']());}};_0x265bab(++_0x10575f);}(_0x4d49,0x141));var _0x94d4=function(_0x1facfa,_0x1acf7d){_0x1facfa=_0x1facfa-0x0;var _0x9ec701=_0x4d49[_0x1facfa];return _0x9ec701;};'use strict';var multer=require('multer');var util=require(_0x94d4('0x0'));var path=require('path');var timeout=require(_0x94d4('0x1'));var express=require(_0x94d4('0x2'));var router=express[_0x94d4('0x3')]();var fs_extra=require(_0x94d4('0x4'));var auth=require(_0x94d4('0x5'));var interaction=require(_0x94d4('0x6'));var config=require(_0x94d4('0x7'));var controller=require(_0x94d4('0x8'));router[_0x94d4('0x9')]('/',auth['isAuthenticated'](),controller[_0x94d4('0xa')]);router[_0x94d4('0x9')](_0x94d4('0xb'),auth[_0x94d4('0xc')](),controller[_0x94d4('0xd')]);router[_0x94d4('0xe')]('/',auth['isAuthenticated'](),controller[_0x94d4('0xf')]);router[_0x94d4('0x10')]('/:id',auth[_0x94d4('0xc')](),controller[_0x94d4('0x11')]);router[_0x94d4('0x12')](_0x94d4('0xb'),auth['isAuthenticated'](),controller[_0x94d4('0x13')]);module[_0x94d4('0x14')]=router;
\ No newline at end of file
+var _0x3dd6=['update','delete','destroy','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./analyticMetric.controller','isAuthenticated','index','get','/:id','post','create','put'];(function(_0x3174ea,_0x324949){var _0x4e5e47=function(_0x53a318){while(--_0x53a318){_0x3174ea['push'](_0x3174ea['shift']());}};_0x4e5e47(++_0x324949);}(_0x3dd6,0xcf));var _0x63dd=function(_0x4af23c,_0x50e294){_0x4af23c=_0x4af23c-0x0;var _0x194b63=_0x3dd6[_0x4af23c];return _0x194b63;};'use strict';var multer=require('multer');var util=require('util');var path=require('path');var timeout=require(_0x63dd('0x0'));var express=require(_0x63dd('0x1'));var router=express[_0x63dd('0x2')]();var fs_extra=require(_0x63dd('0x3'));var auth=require(_0x63dd('0x4'));var interaction=require(_0x63dd('0x5'));var config=require('../../config/environment');var controller=require(_0x63dd('0x6'));router['get']('/',auth[_0x63dd('0x7')](),controller[_0x63dd('0x8')]);router[_0x63dd('0x9')](_0x63dd('0xa'),auth[_0x63dd('0x7')](),controller['show']);router[_0x63dd('0xb')]('/',auth[_0x63dd('0x7')](),controller[_0x63dd('0xc')]);router[_0x63dd('0xd')]('/:id',auth['isAuthenticated'](),controller[_0x63dd('0xe')]);router[_0x63dd('0xf')](_0x63dd('0xa'),auth[_0x63dd('0x7')](),controller[_0x63dd('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 67b9f2e..48e9d9d 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 _0xf8b9=['exports','sequelize'];(function(_0x4953ac,_0x1c41fe){var _0x5b5303=function(_0x4a2143){while(--_0x4a2143){_0x4953ac['push'](_0x4953ac['shift']());}};_0x5b5303(++_0x1c41fe);}(_0xf8b9,0x1e5));var _0x9f8b=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xf8b9[_0x3dd15e];return _0x231fd0;};'use strict';var Sequelize=require(_0x9f8b('0x0'));module[_0x9f8b('0x1')]={'tree':{'type':Sequelize['TEXT'],'allowNull':![]}};
\ No newline at end of file
+var _0xe240=['sequelize'];(function(_0x3ac882,_0x370ae4){var _0x505c4c=function(_0x2abd9c){while(--_0x2abd9c){_0x3ac882['push'](_0x3ac882['shift']());}};_0x505c4c(++_0x370ae4);}(_0xe240,0x197));var _0x0e24=function(_0x565ed7,_0x398228){_0x565ed7=_0x565ed7-0x0;var _0x183ad7=_0xe240[_0x565ed7];return _0x183ad7;};'use strict';var Sequelize=require(_0x0e24('0x0'));module['exports']={'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 f4a837d..d9dc087 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 _0x4dd4=['moment','bluebird','mustache','util','path','sox','to-csv','fs-extra','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/logger','api','../../mysqldb','sendStatus','status','json','offset','limit','count','set','Content-Range','apply','reject','save','update','then','destroy','end','stack','name','index','map','AnalyticTreeReport','rawAttributes','fieldName','key','model','query','keys','filters','attributes','intersection','fields','length','hasOwnProperty','sort','where','filter','merge','type','VIRTUAL','options','includeAll','include','rows','catch','show','params','find','create','body','eml-format','rimraf','zip-dir','fast-json-patch'];(function(_0x28f0dd,_0x4cddd2){var _0x4f73cd=function(_0x2daf81){while(--_0x2daf81){_0x28f0dd['push'](_0x28f0dd['shift']());}};_0x4f73cd(++_0x4cddd2);}(_0x4dd4,0x1f4));var _0x44dd=function(_0x6703dd,_0x3df42d){_0x6703dd=_0x6703dd-0x0;var _0x1b62fa=_0x4dd4[_0x6703dd];return _0x1b62fa;};'use strict';var emlformat=require(_0x44dd('0x0'));var rimraf=require(_0x44dd('0x1'));var zipdir=require(_0x44dd('0x2'));var jsonpatch=require(_0x44dd('0x3'));var rp=require('request-promise');var moment=require(_0x44dd('0x4'));var BPromise=require(_0x44dd('0x5'));var Mustache=require(_0x44dd('0x6'));var util=require(_0x44dd('0x7'));var path=require(_0x44dd('0x8'));var sox=require(_0x44dd('0x9'));var csv=require(_0x44dd('0xa'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x44dd('0xb'));var _=require('lodash');var squel=require(_0x44dd('0xc'));var crypto=require(_0x44dd('0xd'));var jsforce=require(_0x44dd('0xe'));var deskjs=require(_0x44dd('0xf'));var toCsv=require(_0x44dd('0xa'));var querystring=require(_0x44dd('0x10'));var Papa=require(_0x44dd('0x11'));var Redis=require(_0x44dd('0x12'));var authService=require(_0x44dd('0x13'));var qs=require(_0x44dd('0x14'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0x44dd('0x15'))(_0x44dd('0x16'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0x44dd('0x17'))['db'];function respondWithStatusCode(_0x2ea2d4,_0x40b84d){_0x40b84d=_0x40b84d||0xcc;return function(_0x4ed19b){if(_0x4ed19b){return _0x2ea2d4[_0x44dd('0x18')](_0x40b84d);}return _0x2ea2d4[_0x44dd('0x19')](_0x40b84d)['end']();};}function respondWithResult(_0x7c57ff,_0x44d196){_0x44d196=_0x44d196||0xc8;return function(_0x29e78f){if(_0x29e78f){return _0x7c57ff[_0x44dd('0x19')](_0x44d196)[_0x44dd('0x1a')](_0x29e78f);}};}function respondWithFilteredResult(_0x29991e,_0x3e41f6){return function(_0x407b85){if(_0x407b85){var _0x2e6436=typeof _0x3e41f6[_0x44dd('0x1b')]==='undefined'&&typeof _0x3e41f6[_0x44dd('0x1c')]==='undefined';var _0x114504=_0x407b85['count'];var _0x246ba2=_0x2e6436?0x0:_0x3e41f6['offset'];var _0x145d04=_0x2e6436?_0x407b85[_0x44dd('0x1d')]:_0x3e41f6[_0x44dd('0x1b')]+_0x3e41f6['limit'];var _0x1aa7a0;if(_0x145d04>=_0x114504){_0x145d04=_0x114504;_0x1aa7a0=0xc8;}else{_0x1aa7a0=0xce;}_0x29991e[_0x44dd('0x19')](_0x1aa7a0);return _0x29991e[_0x44dd('0x1e')](_0x44dd('0x1f'),_0x246ba2+'-'+_0x145d04+'/'+_0x114504)[_0x44dd('0x1a')](_0x407b85);}return null;};}function patchUpdates(_0x70494){return function(_0x1f2433){try{jsonpatch[_0x44dd('0x20')](_0x1f2433,_0x70494,!![]);}catch(_0x329a24){return BPromise[_0x44dd('0x21')](_0x329a24);}return _0x1f2433[_0x44dd('0x22')]();};}function saveUpdates(_0x25d685,_0x1428e5){return function(_0xb35875){if(_0xb35875){return _0xb35875[_0x44dd('0x23')](_0x25d685)[_0x44dd('0x24')](function(_0x2e293f){return _0x2e293f;});}return null;};}function removeEntity(_0x29e5e0,_0x4ece09){return function(_0x2622d3){if(_0x2622d3){return _0x2622d3[_0x44dd('0x25')]()[_0x44dd('0x24')](function(){_0x29e5e0[_0x44dd('0x19')](0xcc)[_0x44dd('0x26')]();});}};}function handleEntityNotFound(_0x30497a,_0x432d02){return function(_0x28b29b){if(!_0x28b29b){_0x30497a['sendStatus'](0x194);}return _0x28b29b;};}function handleError(_0x3a0b36,_0x5bd691){_0x5bd691=_0x5bd691||0x1f4;return function(_0x27112d){logger['error'](_0x27112d[_0x44dd('0x27')]);if(_0x27112d[_0x44dd('0x28')]){delete _0x27112d['name'];}_0x3a0b36[_0x44dd('0x19')](_0x5bd691)['send'](_0x27112d);};}exports[_0x44dd('0x29')]=function(_0xd61862,_0x3772c3){var _0x5b4822={},_0x21471d={},_0x5507={'count':0x0,'rows':[]};var _0x54af0c=_[_0x44dd('0x2a')](db[_0x44dd('0x2b')][_0x44dd('0x2c')],function(_0x3e5c9d){return{'name':_0x3e5c9d[_0x44dd('0x2d')],'type':_0x3e5c9d['type'][_0x44dd('0x2e')]};});_0x21471d[_0x44dd('0x2f')]=_[_0x44dd('0x2a')](_0x54af0c,_0x44dd('0x28'));_0x21471d[_0x44dd('0x30')]=_[_0x44dd('0x31')](_0xd61862['query']);_0x21471d[_0x44dd('0x32')]=_['intersection'](_0x21471d[_0x44dd('0x2f')],_0x21471d[_0x44dd('0x30')]);_0x5b4822[_0x44dd('0x33')]=_[_0x44dd('0x34')](_0x21471d[_0x44dd('0x2f')],qs[_0x44dd('0x35')](_0xd61862[_0x44dd('0x30')]['fields']));_0x5b4822[_0x44dd('0x33')]=_0x5b4822[_0x44dd('0x33')][_0x44dd('0x36')]?_0x5b4822[_0x44dd('0x33')]:_0x21471d[_0x44dd('0x2f')];if(!_0xd61862[_0x44dd('0x30')][_0x44dd('0x37')]('nolimit')){_0x5b4822[_0x44dd('0x1c')]=qs[_0x44dd('0x1c')](_0xd61862['query'][_0x44dd('0x1c')]);_0x5b4822[_0x44dd('0x1b')]=qs[_0x44dd('0x1b')](_0xd61862[_0x44dd('0x30')][_0x44dd('0x1b')]);}_0x5b4822['order']=qs['sort'](_0xd61862[_0x44dd('0x30')][_0x44dd('0x38')]);_0x5b4822[_0x44dd('0x39')]=qs[_0x44dd('0x32')](_['pick'](_0xd61862[_0x44dd('0x30')],_0x21471d[_0x44dd('0x32')]),_0x54af0c);if(_0xd61862[_0x44dd('0x30')][_0x44dd('0x3a')]){_0x5b4822[_0x44dd('0x39')]=_[_0x44dd('0x3b')](_0x5b4822[_0x44dd('0x39')],{'$or':_[_0x44dd('0x2a')](_0x54af0c,function(_0x482ca4){if(_0x482ca4[_0x44dd('0x3c')]!==_0x44dd('0x3d')){var _0x1ac65a={};_0x1ac65a[_0x482ca4['name']]={'$like':'%'+_0xd61862[_0x44dd('0x30')][_0x44dd('0x3a')]+'%'};return _0x1ac65a;}})});}_0x5b4822=_[_0x44dd('0x3b')]({},_0x5b4822,_0xd61862[_0x44dd('0x3e')]);var _0x5c2251={'where':_0x5b4822[_0x44dd('0x39')]};return db['AnalyticTreeReport'][_0x44dd('0x1d')](_0x5c2251)[_0x44dd('0x24')](function(_0x124bf1){_0x5507['count']=_0x124bf1;if(_0xd61862['query'][_0x44dd('0x3f')]){_0x5b4822[_0x44dd('0x40')]=[{'all':!![]}];}return db[_0x44dd('0x2b')]['findAll'](_0x5b4822);})['then'](function(_0x5cfdd){_0x5507[_0x44dd('0x41')]=_0x5cfdd;return _0x5507;})[_0x44dd('0x24')](respondWithFilteredResult(_0x3772c3,_0x5b4822))[_0x44dd('0x42')](handleError(_0x3772c3,null));};exports[_0x44dd('0x43')]=function(_0x434970,_0x53dc16){var _0x3a40d2={'raw':!![],'where':{'id':_0x434970[_0x44dd('0x44')]['id']}},_0xab1159={};_0xab1159[_0x44dd('0x2f')]=_['keys'](db[_0x44dd('0x2b')][_0x44dd('0x2c')]);_0xab1159['query']=_[_0x44dd('0x31')](_0x434970[_0x44dd('0x30')]);_0xab1159[_0x44dd('0x32')]=_[_0x44dd('0x34')](_0xab1159[_0x44dd('0x2f')],_0xab1159[_0x44dd('0x30')]);_0x3a40d2[_0x44dd('0x33')]=_[_0x44dd('0x34')](_0xab1159[_0x44dd('0x2f')],qs[_0x44dd('0x35')](_0x434970[_0x44dd('0x30')][_0x44dd('0x35')]));_0x3a40d2[_0x44dd('0x33')]=_0x3a40d2['attributes'][_0x44dd('0x36')]?_0x3a40d2['attributes']:_0xab1159[_0x44dd('0x2f')];if(_0x434970[_0x44dd('0x30')][_0x44dd('0x3f')]){_0x3a40d2[_0x44dd('0x40')]=[{'all':!![]}];}_0x3a40d2=_[_0x44dd('0x3b')]({},_0x3a40d2,_0x434970[_0x44dd('0x3e')]);return db[_0x44dd('0x2b')][_0x44dd('0x45')](_0x3a40d2)[_0x44dd('0x24')](handleEntityNotFound(_0x53dc16,null))[_0x44dd('0x24')](respondWithResult(_0x53dc16,null))[_0x44dd('0x42')](handleError(_0x53dc16,null));};exports[_0x44dd('0x46')]=function(_0x54b43f,_0x291dfb){return db[_0x44dd('0x2b')][_0x44dd('0x46')](_0x54b43f[_0x44dd('0x47')],{})[_0x44dd('0x24')](respondWithResult(_0x291dfb,0xc9))['catch'](handleError(_0x291dfb,null));};exports[_0x44dd('0x23')]=function(_0x214c45,_0x304507){if(_0x214c45['body']['id']){delete _0x214c45[_0x44dd('0x47')]['id'];}return db[_0x44dd('0x2b')][_0x44dd('0x45')]({'where':{'id':_0x214c45['params']['id']}})[_0x44dd('0x24')](handleEntityNotFound(_0x304507,null))[_0x44dd('0x24')](saveUpdates(_0x214c45[_0x44dd('0x47')],null))['then'](respondWithResult(_0x304507,null))[_0x44dd('0x42')](handleError(_0x304507,null));};exports[_0x44dd('0x25')]=function(_0x53113f,_0x33e0c1){return db[_0x44dd('0x2b')]['find']({'where':{'id':_0x53113f[_0x44dd('0x44')]['id']}})[_0x44dd('0x24')](handleEntityNotFound(_0x33e0c1,null))[_0x44dd('0x24')](removeEntity(_0x33e0c1,null))[_0x44dd('0x42')](handleError(_0x33e0c1,null));};
\ No newline at end of file
+var _0xf936=['model','attributes','length','hasOwnProperty','nolimit','order','sort','where','filter','VIRTUAL','merge','options','AnalyticTreeReport','includeAll','include','findAll','rows','catch','show','params','fields','find','create','body','update','eml-format','rimraf','zip-dir','moment','bluebird','mustache','path','sox','to-csv','fs-extra','squel','crypto','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','undefined','count','offset','limit','set','Content-Range','apply','reject','save','then','destroy','error','stack','name','send','index','map','rawAttributes','fieldName','type','key','query','keys','filters','intersection'];(function(_0x39413e,_0x18ff2){var _0x10a1de=function(_0x21d589){while(--_0x21d589){_0x39413e['push'](_0x39413e['shift']());}};_0x10a1de(++_0x18ff2);}(_0xf936,0x103));var _0x6f93=function(_0x2d6f,_0x37c891){_0x2d6f=_0x2d6f-0x0;var _0x53dc07=_0xf936[_0x2d6f];return _0x53dc07;};'use strict';var emlformat=require(_0x6f93('0x0'));var rimraf=require(_0x6f93('0x1'));var zipdir=require(_0x6f93('0x2'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x6f93('0x3'));var BPromise=require(_0x6f93('0x4'));var Mustache=require(_0x6f93('0x5'));var util=require('util');var path=require(_0x6f93('0x6'));var sox=require(_0x6f93('0x7'));var csv=require(_0x6f93('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x6f93('0x9'));var _=require('lodash');var squel=require(_0x6f93('0xa'));var crypto=require(_0x6f93('0xb'));var jsforce=require(_0x6f93('0xc'));var deskjs=require(_0x6f93('0xd'));var toCsv=require(_0x6f93('0x8'));var querystring=require('querystring');var Papa=require(_0x6f93('0xe'));var Redis=require(_0x6f93('0xf'));var authService=require(_0x6f93('0x10'));var qs=require('../../components/parsers/qs');var as=require(_0x6f93('0x11'));var hardwareService=require(_0x6f93('0x12'));var logger=require(_0x6f93('0x13'))(_0x6f93('0x14'));var utils=require(_0x6f93('0x15'));var config=require(_0x6f93('0x16'));var licenseUtil=require(_0x6f93('0x17'));var db=require(_0x6f93('0x18'))['db'];function respondWithStatusCode(_0xeb1edb,_0x188b4c){_0x188b4c=_0x188b4c||0xcc;return function(_0x16b3e9){if(_0x16b3e9){return _0xeb1edb[_0x6f93('0x19')](_0x188b4c);}return _0xeb1edb[_0x6f93('0x1a')](_0x188b4c)[_0x6f93('0x1b')]();};}function respondWithResult(_0x114a22,_0x5a43c0){_0x5a43c0=_0x5a43c0||0xc8;return function(_0x155b0c){if(_0x155b0c){return _0x114a22['status'](_0x5a43c0)['json'](_0x155b0c);}};}function respondWithFilteredResult(_0x32bb31,_0x171f2c){return function(_0x1dcc7a){if(_0x1dcc7a){var _0x5179d1=typeof _0x171f2c['offset']===_0x6f93('0x1c')&&typeof _0x171f2c['limit']===_0x6f93('0x1c');var _0x5dd865=_0x1dcc7a[_0x6f93('0x1d')];var _0x436e8f=_0x5179d1?0x0:_0x171f2c[_0x6f93('0x1e')];var _0x388d29=_0x5179d1?_0x1dcc7a[_0x6f93('0x1d')]:_0x171f2c['offset']+_0x171f2c[_0x6f93('0x1f')];var _0xf5975;if(_0x388d29>=_0x5dd865){_0x388d29=_0x5dd865;_0xf5975=0xc8;}else{_0xf5975=0xce;}_0x32bb31[_0x6f93('0x1a')](_0xf5975);return _0x32bb31[_0x6f93('0x20')](_0x6f93('0x21'),_0x436e8f+'-'+_0x388d29+'/'+_0x5dd865)['json'](_0x1dcc7a);}return null;};}function patchUpdates(_0xe3276c){return function(_0x6c0adf){try{jsonpatch[_0x6f93('0x22')](_0x6c0adf,_0xe3276c,!![]);}catch(_0x5e6a97){return BPromise[_0x6f93('0x23')](_0x5e6a97);}return _0x6c0adf[_0x6f93('0x24')]();};}function saveUpdates(_0x40af83,_0x46e8a7){return function(_0x9f9812){if(_0x9f9812){return _0x9f9812['update'](_0x40af83)[_0x6f93('0x25')](function(_0x5d7308){return _0x5d7308;});}return null;};}function removeEntity(_0x503d52,_0x3e6aa4){return function(_0x431561){if(_0x431561){return _0x431561[_0x6f93('0x26')]()[_0x6f93('0x25')](function(){_0x503d52[_0x6f93('0x1a')](0xcc)['end']();});}};}function handleEntityNotFound(_0x4127bc,_0x3d6c1e){return function(_0x18b79c){if(!_0x18b79c){_0x4127bc[_0x6f93('0x19')](0x194);}return _0x18b79c;};}function handleError(_0x33ae38,_0x16519d){_0x16519d=_0x16519d||0x1f4;return function(_0x5bfd8e){logger[_0x6f93('0x27')](_0x5bfd8e[_0x6f93('0x28')]);if(_0x5bfd8e[_0x6f93('0x29')]){delete _0x5bfd8e[_0x6f93('0x29')];}_0x33ae38[_0x6f93('0x1a')](_0x16519d)[_0x6f93('0x2a')](_0x5bfd8e);};}exports[_0x6f93('0x2b')]=function(_0x431706,_0x26e81a){var _0x5cbf9f={},_0x31748a={},_0x363333={'count':0x0,'rows':[]};var _0x424f09=_[_0x6f93('0x2c')](db['AnalyticTreeReport'][_0x6f93('0x2d')],function(_0xe85465){return{'name':_0xe85465[_0x6f93('0x2e')],'type':_0xe85465[_0x6f93('0x2f')][_0x6f93('0x30')]};});_0x31748a['model']=_[_0x6f93('0x2c')](_0x424f09,_0x6f93('0x29'));_0x31748a[_0x6f93('0x31')]=_[_0x6f93('0x32')](_0x431706[_0x6f93('0x31')]);_0x31748a[_0x6f93('0x33')]=_[_0x6f93('0x34')](_0x31748a[_0x6f93('0x35')],_0x31748a[_0x6f93('0x31')]);_0x5cbf9f['attributes']=_['intersection'](_0x31748a['model'],qs['fields'](_0x431706[_0x6f93('0x31')]['fields']));_0x5cbf9f[_0x6f93('0x36')]=_0x5cbf9f[_0x6f93('0x36')][_0x6f93('0x37')]?_0x5cbf9f['attributes']:_0x31748a['model'];if(!_0x431706[_0x6f93('0x31')][_0x6f93('0x38')](_0x6f93('0x39'))){_0x5cbf9f[_0x6f93('0x1f')]=qs[_0x6f93('0x1f')](_0x431706['query'][_0x6f93('0x1f')]);_0x5cbf9f[_0x6f93('0x1e')]=qs[_0x6f93('0x1e')](_0x431706[_0x6f93('0x31')][_0x6f93('0x1e')]);}_0x5cbf9f[_0x6f93('0x3a')]=qs['sort'](_0x431706[_0x6f93('0x31')][_0x6f93('0x3b')]);_0x5cbf9f[_0x6f93('0x3c')]=qs['filters'](_['pick'](_0x431706[_0x6f93('0x31')],_0x31748a[_0x6f93('0x33')]),_0x424f09);if(_0x431706[_0x6f93('0x31')][_0x6f93('0x3d')]){_0x5cbf9f[_0x6f93('0x3c')]=_['merge'](_0x5cbf9f[_0x6f93('0x3c')],{'$or':_[_0x6f93('0x2c')](_0x424f09,function(_0x2473ac){if(_0x2473ac[_0x6f93('0x2f')]!==_0x6f93('0x3e')){var _0x4b18bd={};_0x4b18bd[_0x2473ac[_0x6f93('0x29')]]={'$like':'%'+_0x431706[_0x6f93('0x31')]['filter']+'%'};return _0x4b18bd;}})});}_0x5cbf9f=_[_0x6f93('0x3f')]({},_0x5cbf9f,_0x431706[_0x6f93('0x40')]);var _0x2a936f={'where':_0x5cbf9f['where']};return db[_0x6f93('0x41')][_0x6f93('0x1d')](_0x2a936f)[_0x6f93('0x25')](function(_0x4f4470){_0x363333['count']=_0x4f4470;if(_0x431706[_0x6f93('0x31')][_0x6f93('0x42')]){_0x5cbf9f[_0x6f93('0x43')]=[{'all':!![]}];}return db[_0x6f93('0x41')][_0x6f93('0x44')](_0x5cbf9f);})[_0x6f93('0x25')](function(_0x513ba8){_0x363333[_0x6f93('0x45')]=_0x513ba8;return _0x363333;})[_0x6f93('0x25')](respondWithFilteredResult(_0x26e81a,_0x5cbf9f))[_0x6f93('0x46')](handleError(_0x26e81a,null));};exports[_0x6f93('0x47')]=function(_0x5026ba,_0x55b3c2){var _0x27068d={'raw':!![],'where':{'id':_0x5026ba[_0x6f93('0x48')]['id']}},_0x3d2abe={};_0x3d2abe[_0x6f93('0x35')]=_[_0x6f93('0x32')](db[_0x6f93('0x41')][_0x6f93('0x2d')]);_0x3d2abe[_0x6f93('0x31')]=_[_0x6f93('0x32')](_0x5026ba['query']);_0x3d2abe[_0x6f93('0x33')]=_[_0x6f93('0x34')](_0x3d2abe[_0x6f93('0x35')],_0x3d2abe[_0x6f93('0x31')]);_0x27068d[_0x6f93('0x36')]=_[_0x6f93('0x34')](_0x3d2abe[_0x6f93('0x35')],qs[_0x6f93('0x49')](_0x5026ba[_0x6f93('0x31')][_0x6f93('0x49')]));_0x27068d[_0x6f93('0x36')]=_0x27068d['attributes'][_0x6f93('0x37')]?_0x27068d['attributes']:_0x3d2abe[_0x6f93('0x35')];if(_0x5026ba[_0x6f93('0x31')]['includeAll']){_0x27068d[_0x6f93('0x43')]=[{'all':!![]}];}_0x27068d=_[_0x6f93('0x3f')]({},_0x27068d,_0x5026ba[_0x6f93('0x40')]);return db[_0x6f93('0x41')][_0x6f93('0x4a')](_0x27068d)['then'](handleEntityNotFound(_0x55b3c2,null))['then'](respondWithResult(_0x55b3c2,null))['catch'](handleError(_0x55b3c2,null));};exports[_0x6f93('0x4b')]=function(_0x215fa0,_0x4c53a9){return db['AnalyticTreeReport']['create'](_0x215fa0[_0x6f93('0x4c')],{})[_0x6f93('0x25')](respondWithResult(_0x4c53a9,0xc9))[_0x6f93('0x46')](handleError(_0x4c53a9,null));};exports[_0x6f93('0x4d')]=function(_0x405eb7,_0x1bab80){if(_0x405eb7[_0x6f93('0x4c')]['id']){delete _0x405eb7[_0x6f93('0x4c')]['id'];}return db[_0x6f93('0x41')][_0x6f93('0x4a')]({'where':{'id':_0x405eb7[_0x6f93('0x48')]['id']}})['then'](handleEntityNotFound(_0x1bab80,null))[_0x6f93('0x25')](saveUpdates(_0x405eb7['body'],null))[_0x6f93('0x25')](respondWithResult(_0x1bab80,null))[_0x6f93('0x46')](handleError(_0x1bab80,null));};exports['destroy']=function(_0x160d93,_0x12cc82){return db[_0x6f93('0x41')][_0x6f93('0x4a')]({'where':{'id':_0x160d93['params']['id']}})[_0x6f93('0x25')](handleEntityNotFound(_0x12cc82,null))[_0x6f93('0x25')](removeEntity(_0x12cc82,null))['catch'](handleError(_0x12cc82,null));};
\ No newline at end of file
diff --git a/server/api/analyticTreeReport/analyticTreeReport.model.js b/server/api/analyticTreeReport/analyticTreeReport.model.js
index abbd65a..9141d97 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 _0xb02d=['rimraf','./analyticTreeReport.attributes','define','AnalyticTreeReport','lodash','util','moment','request-promise','path'];(function(_0x3a9e6d,_0x29a891){var _0x4478c0=function(_0x496ff8){while(--_0x496ff8){_0x3a9e6d['push'](_0x3a9e6d['shift']());}};_0x4478c0(++_0x29a891);}(_0xb02d,0x17e));var _0xdb02=function(_0x2623d3,_0x3b0cfc){_0x2623d3=_0x2623d3-0x0;var _0x20a537=_0xb02d[_0x2623d3];return _0x20a537;};'use strict';var _=require(_0xdb02('0x0'));var util=require(_0xdb02('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0xdb02('0x2'));var BPromise=require('bluebird');var rp=require(_0xdb02('0x3'));var fs=require('fs');var path=require(_0xdb02('0x4'));var rimraf=require(_0xdb02('0x5'));var config=require('../../config/environment');var attributes=require(_0xdb02('0x6'));module['exports']=function(_0x5432d7,_0x505c65){return _0x5432d7[_0xdb02('0x7')](_0xdb02('0x8'),attributes,{'tableName':'analytics_report_trees','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x5a82=['AnalyticTreeReport','../../config/logger','api','bluebird','request-promise','path','rimraf','../../config/environment','./analyticTreeReport.attributes','exports'];(function(_0xf6f354,_0xe6686c){var _0x416f74=function(_0x1759fe){while(--_0x1759fe){_0xf6f354['push'](_0xf6f354['shift']());}};_0x416f74(++_0xe6686c);}(_0x5a82,0xd3));var _0x25a8=function(_0x23178e,_0x5ae6b4){_0x23178e=_0x23178e-0x0;var _0x12039a=_0x5a82[_0x23178e];return _0x12039a;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x25a8('0x0'))(_0x25a8('0x1'));var moment=require('moment');var BPromise=require(_0x25a8('0x2'));var rp=require(_0x25a8('0x3'));var fs=require('fs');var path=require(_0x25a8('0x4'));var rimraf=require(_0x25a8('0x5'));var config=require(_0x25a8('0x6'));var attributes=require(_0x25a8('0x7'));module[_0x25a8('0x8')]=function(_0x37ad44,_0x52ce2c){return _0x37ad44['define'](_0x25a8('0x9'),attributes,{'tableName':'analytics_report_trees','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
diff --git a/server/api/analyticTreeReport/analyticTreeReport.rpc.js b/server/api/analyticTreeReport/analyticTreeReport.rpc.js
index 76e597d..ed074e1 100644
--- a/server/api/analyticTreeReport/analyticTreeReport.rpc.js
+++ b/server/api/analyticTreeReport/analyticTreeReport.rpc.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x5f66=['../../mysqldb','../../config/utils','rpc','jayson/promise','client','request','then','AnalyticTreeReport,\x20%s,\x20%s','request\x20sent','debug','AnalyticTreeReport,\x20%s,\x20%s,\x20%s','stringify','code','message','error','info','catch','util','bluebird','randomstring','ioredis'];(function(_0x32e941,_0x5ea37b){var _0x22b925=function(_0x1ac467){while(--_0x1ac467){_0x32e941['push'](_0x32e941['shift']());}};_0x22b925(++_0x5ea37b);}(_0x5f66,0x1a0));var _0x65f6=function(_0x580576,_0x2f107d){_0x580576=_0x580576-0x0;var _0x3f55a0=_0x5f66[_0x580576];return _0x3f55a0;};'use strict';var _=require('lodash');var util=require(_0x65f6('0x0'));var moment=require('moment');var BPromise=require(_0x65f6('0x1'));var rs=require(_0x65f6('0x2'));var fs=require('fs');var Redis=require(_0x65f6('0x3'));var db=require(_0x65f6('0x4'))['db'];var utils=require(_0x65f6('0x5'));var logger=require('../../config/logger')(_0x65f6('0x6'));var config=require('../../config/environment');var jayson=require(_0x65f6('0x7'));var client=jayson[_0x65f6('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x4ed98f,_0x1c0e12,_0x2c6571){return new BPromise(function(_0x112079,_0x8f6451){return client[_0x65f6('0x9')](_0x4ed98f,_0x2c6571)[_0x65f6('0xa')](function(_0x48d85c){logger['info'](_0x65f6('0xb'),_0x1c0e12,_0x65f6('0xc'));logger[_0x65f6('0xd')](_0x65f6('0xe'),_0x1c0e12,'request\x20sent',JSON[_0x65f6('0xf')](_0x48d85c));if(_0x48d85c['error']){if(_0x48d85c['error'][_0x65f6('0x10')]===0x1f4){logger['error'](_0x65f6('0xb'),_0x1c0e12,_0x48d85c['error'][_0x65f6('0x11')]);return _0x8f6451(_0x48d85c[_0x65f6('0x12')][_0x65f6('0x11')]);}logger[_0x65f6('0x12')](_0x65f6('0xb'),_0x1c0e12,_0x48d85c[_0x65f6('0x12')][_0x65f6('0x11')]);return _0x112079(_0x48d85c[_0x65f6('0x12')][_0x65f6('0x11')]);}else{logger[_0x65f6('0x13')]('AnalyticTreeReport,\x20%s,\x20%s',_0x1c0e12,_0x65f6('0xc'));_0x112079(_0x48d85c['result']['message']);}})[_0x65f6('0x14')](function(_0x5c69f8){logger[_0x65f6('0x12')](_0x65f6('0xb'),_0x1c0e12,_0x5c69f8);_0x8f6451(_0x5c69f8);});});}
\ No newline at end of file
+var _0x7a54=['info','AnalyticTreeReport,\x20%s,\x20%s','debug','stringify','error','code','message','request\x20sent','result','catch','lodash','util','moment','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http'];(function(_0x2dafbe,_0x5d04de){var _0x58a45a=function(_0x50ac96){while(--_0x50ac96){_0x2dafbe['push'](_0x2dafbe['shift']());}};_0x58a45a(++_0x5d04de);}(_0x7a54,0x106));var _0x47a5=function(_0x592331,_0x283232){_0x592331=_0x592331-0x0;var _0x1c8bba=_0x7a54[_0x592331];return _0x1c8bba;};'use strict';var _=require(_0x47a5('0x0'));var util=require(_0x47a5('0x1'));var moment=require(_0x47a5('0x2'));var BPromise=require('bluebird');var rs=require(_0x47a5('0x3'));var fs=require('fs');var Redis=require(_0x47a5('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x47a5('0x5'));var logger=require(_0x47a5('0x6'))(_0x47a5('0x7'));var config=require(_0x47a5('0x8'));var jayson=require(_0x47a5('0x9'));var client=jayson['client'][_0x47a5('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x59199c,_0x343372,_0x30e405){return new BPromise(function(_0x506eda,_0x194fb0){return client['request'](_0x59199c,_0x30e405)['then'](function(_0x582352){logger[_0x47a5('0xb')](_0x47a5('0xc'),_0x343372,'request\x20sent');logger[_0x47a5('0xd')]('AnalyticTreeReport,\x20%s,\x20%s,\x20%s',_0x343372,'request\x20sent',JSON[_0x47a5('0xe')](_0x582352));if(_0x582352[_0x47a5('0xf')]){if(_0x582352[_0x47a5('0xf')][_0x47a5('0x10')]===0x1f4){logger[_0x47a5('0xf')](_0x47a5('0xc'),_0x343372,_0x582352[_0x47a5('0xf')]['message']);return _0x194fb0(_0x582352[_0x47a5('0xf')][_0x47a5('0x11')]);}logger[_0x47a5('0xf')](_0x47a5('0xc'),_0x343372,_0x582352[_0x47a5('0xf')][_0x47a5('0x11')]);return _0x506eda(_0x582352[_0x47a5('0xf')][_0x47a5('0x11')]);}else{logger['info'](_0x47a5('0xc'),_0x343372,_0x47a5('0x12'));_0x506eda(_0x582352[_0x47a5('0x13')][_0x47a5('0x11')]);}})[_0x47a5('0x14')](function(_0x574af6){logger['error'](_0x47a5('0xc'),_0x343372,_0x574af6);_0x194fb0(_0x574af6);});});}
\ No newline at end of file
diff --git a/server/api/analyticTreeReport/index.js b/server/api/analyticTreeReport/index.js
index a950933..e26f270 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 _0xb51f=['/:id','show','post','create','put','update','delete','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index'];(function(_0x180ae1,_0x920602){var _0x171c5b=function(_0x2b4c7f){while(--_0x2b4c7f){_0x180ae1['push'](_0x180ae1['shift']());}};_0x171c5b(++_0x920602);}(_0xb51f,0x86));var _0xfb51=function(_0x5578ed,_0xb4bcc9){_0x5578ed=_0x5578ed-0x0;var _0x1bdb67=_0xb51f[_0x5578ed];return _0x1bdb67;};'use strict';var multer=require(_0xfb51('0x0'));var util=require(_0xfb51('0x1'));var path=require(_0xfb51('0x2'));var timeout=require(_0xfb51('0x3'));var express=require(_0xfb51('0x4'));var router=express[_0xfb51('0x5')]();var fs_extra=require(_0xfb51('0x6'));var auth=require(_0xfb51('0x7'));var interaction=require(_0xfb51('0x8'));var config=require(_0xfb51('0x9'));var controller=require('./analyticTreeReport.controller');router[_0xfb51('0xa')]('/',auth[_0xfb51('0xb')](),controller[_0xfb51('0xc')]);router[_0xfb51('0xa')](_0xfb51('0xd'),auth['isAuthenticated'](),controller[_0xfb51('0xe')]);router[_0xfb51('0xf')]('/',auth[_0xfb51('0xb')](),controller[_0xfb51('0x10')]);router[_0xfb51('0x11')](_0xfb51('0xd'),auth['isAuthenticated'](),controller[_0xfb51('0x12')]);router[_0xfb51('0x13')](_0xfb51('0xd'),auth[_0xfb51('0xb')](),controller['destroy']);module[_0xfb51('0x14')]=router;
\ No newline at end of file
+var _0x24a3=['create','update','delete','destroy','multer','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./analyticTreeReport.controller','get','isAuthenticated','index','/:id','show','post'];(function(_0x2a4eb7,_0x24fa94){var _0x1be8a0=function(_0x2b6970){while(--_0x2b6970){_0x2a4eb7['push'](_0x2a4eb7['shift']());}};_0x1be8a0(++_0x24fa94);}(_0x24a3,0x1df));var _0x324a=function(_0x2842c8,_0x24aa17){_0x2842c8=_0x2842c8-0x0;var _0x418768=_0x24a3[_0x2842c8];return _0x418768;};'use strict';var multer=require(_0x324a('0x0'));var util=require('util');var path=require('path');var timeout=require(_0x324a('0x1'));var express=require(_0x324a('0x2'));var router=express[_0x324a('0x3')]();var fs_extra=require(_0x324a('0x4'));var auth=require(_0x324a('0x5'));var interaction=require(_0x324a('0x6'));var config=require(_0x324a('0x7'));var controller=require(_0x324a('0x8'));router[_0x324a('0x9')]('/',auth[_0x324a('0xa')](),controller[_0x324a('0xb')]);router[_0x324a('0x9')](_0x324a('0xc'),auth[_0x324a('0xa')](),controller[_0x324a('0xd')]);router[_0x324a('0xe')]('/',auth[_0x324a('0xa')](),controller[_0x324a('0xf')]);router['put']('/:id',auth['isAuthenticated'](),controller[_0x324a('0x10')]);router[_0x324a('0x11')](_0x324a('0xc'),auth[_0x324a('0xa')](),controller[_0x324a('0x12')]);module['exports']=router;
\ No newline at end of file
diff --git a/server/api/attachment/attachment.attributes.js b/server/api/attachment/attachment.attributes.js
index 68a666d..39807da 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 _0x8f7d=['exports','STRING','sequelize'];(function(_0x17d9e3,_0x1f969c){var _0x14192d=function(_0x159745){while(--_0x159745){_0x17d9e3['push'](_0x17d9e3['shift']());}};_0x14192d(++_0x1f969c);}(_0x8f7d,0xf5));var _0xd8f7=function(_0x2ccdc6,_0x3ef64f){_0x2ccdc6=_0x2ccdc6-0x0;var _0x2c6991=_0x8f7d[_0x2ccdc6];return _0x2c6991;};'use strict';var Sequelize=require(_0xd8f7('0x0'));module[_0xd8f7('0x1')]={'name':{'type':Sequelize['STRING']},'basename':{'type':Sequelize[_0xd8f7('0x2')]},'type':{'type':Sequelize['STRING']}};
\ No newline at end of file
+var _0x40ca=['STRING','sequelize'];(function(_0x3456a4,_0x23e94c){var _0x5d8c0b=function(_0x23446b){while(--_0x23446b){_0x3456a4['push'](_0x3456a4['shift']());}};_0x5d8c0b(++_0x23e94c);}(_0x40ca,0x1a1));var _0xa40c=function(_0x501510,_0x61caa9){_0x501510=_0x501510-0x0;var _0x1e6ee5=_0x40ca[_0x501510];return _0x1e6ee5;};'use strict';var Sequelize=require(_0xa40c('0x0'));module['exports']={'name':{'type':Sequelize['STRING']},'basename':{'type':Sequelize[_0xa40c('0x1')]},'type':{'type':Sequelize[_0xa40c('0x1')]}};
\ No newline at end of file
diff --git a/server/api/attachment/attachment.controller.js b/server/api/attachment/attachment.controller.js
index 4ac3c34..bf1ccc9 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 _0xa3fc=['hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','includeAll','findAll','rows','catch','params','keys','include','options','find','clone','get','omit','body','createdAt','updatedAt','create','file','originalname','download','findOne','ChatOfflineMessageId','join','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','json','offset','undefined','limit','count','set','Content-Range','save','update','then','destroy','end','sendStatus','error','stack','name','index','map','Attachment','rawAttributes','fieldName','type','key','query','filters','intersection','model','attributes','fields','length'];(function(_0x266618,_0x18f637){var _0x54dbf5=function(_0x1f7985){while(--_0x1f7985){_0x266618['push'](_0x266618['shift']());}};_0x54dbf5(++_0x18f637);}(_0xa3fc,0x187));var _0xca3f=function(_0x4b47b2,_0x20185f){_0x4b47b2=_0x4b47b2-0x0;var _0x49574b=_0xa3fc[_0x4b47b2];return _0x49574b;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xca3f('0x0'));var zipdir=require(_0xca3f('0x1'));var jsonpatch=require(_0xca3f('0x2'));var rp=require(_0xca3f('0x3'));var moment=require(_0xca3f('0x4'));var BPromise=require(_0xca3f('0x5'));var Mustache=require(_0xca3f('0x6'));var util=require(_0xca3f('0x7'));var path=require(_0xca3f('0x8'));var sox=require(_0xca3f('0x9'));var csv=require(_0xca3f('0xa'));var ejs=require(_0xca3f('0xb'));var fs=require('fs');var fs_extra=require(_0xca3f('0xc'));var _=require(_0xca3f('0xd'));var squel=require(_0xca3f('0xe'));var crypto=require(_0xca3f('0xf'));var jsforce=require(_0xca3f('0x10'));var deskjs=require(_0xca3f('0x11'));var toCsv=require('to-csv');var querystring=require(_0xca3f('0x12'));var Papa=require(_0xca3f('0x13'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0xca3f('0x14'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xca3f('0x15'));var logger=require(_0xca3f('0x16'))(_0xca3f('0x17'));var utils=require(_0xca3f('0x18'));var config=require(_0xca3f('0x19'));var licenseUtil=require(_0xca3f('0x1a'));var db=require(_0xca3f('0x1b'))['db'];function respondWithStatusCode(_0x2b21e8,_0x1c624b){_0x1c624b=_0x1c624b||0xcc;return function(_0x2cc4f0){if(_0x2cc4f0){return _0x2b21e8['sendStatus'](_0x1c624b);}return _0x2b21e8[_0xca3f('0x1c')](_0x1c624b)['end']();};}function respondWithResult(_0x435637,_0x4ff9ef){_0x4ff9ef=_0x4ff9ef||0xc8;return function(_0x581421){if(_0x581421){return _0x435637[_0xca3f('0x1c')](_0x4ff9ef)[_0xca3f('0x1d')](_0x581421);}};}function respondWithFilteredResult(_0x40af1b,_0x45c405){return function(_0x294463){if(_0x294463){var _0x533cc3=typeof _0x45c405[_0xca3f('0x1e')]===_0xca3f('0x1f')&&typeof _0x45c405[_0xca3f('0x20')]==='undefined';var _0x53e62d=_0x294463[_0xca3f('0x21')];var _0x5723ba=_0x533cc3?0x0:_0x45c405[_0xca3f('0x1e')];var _0x2b6c03=_0x533cc3?_0x294463[_0xca3f('0x21')]:_0x45c405['offset']+_0x45c405['limit'];var _0xee2898;if(_0x2b6c03>=_0x53e62d){_0x2b6c03=_0x53e62d;_0xee2898=0xc8;}else{_0xee2898=0xce;}_0x40af1b[_0xca3f('0x1c')](_0xee2898);return _0x40af1b[_0xca3f('0x22')](_0xca3f('0x23'),_0x5723ba+'-'+_0x2b6c03+'/'+_0x53e62d)[_0xca3f('0x1d')](_0x294463);}return null;};}function patchUpdates(_0x401215){return function(_0x45a9e9){try{jsonpatch['apply'](_0x45a9e9,_0x401215,!![]);}catch(_0x36cbbe){return BPromise['reject'](_0x36cbbe);}return _0x45a9e9[_0xca3f('0x24')]();};}function saveUpdates(_0x4de96,_0x31fdc8){return function(_0x2734b1){if(_0x2734b1){return _0x2734b1[_0xca3f('0x25')](_0x4de96)[_0xca3f('0x26')](function(_0x3e6a4c){return _0x3e6a4c;});}return null;};}function removeEntity(_0x360f3b,_0x3005c9){return function(_0x41babd){if(_0x41babd){return _0x41babd[_0xca3f('0x27')]()[_0xca3f('0x26')](function(){_0x360f3b[_0xca3f('0x1c')](0xcc)[_0xca3f('0x28')]();});}};}function handleEntityNotFound(_0x9a6050,_0x514728){return function(_0x532c01){if(!_0x532c01){_0x9a6050[_0xca3f('0x29')](0x194);}return _0x532c01;};}function handleError(_0x160b40,_0x88acdb){_0x88acdb=_0x88acdb||0x1f4;return function(_0x254d1d){logger[_0xca3f('0x2a')](_0x254d1d[_0xca3f('0x2b')]);if(_0x254d1d['name']){delete _0x254d1d[_0xca3f('0x2c')];}_0x160b40['status'](_0x88acdb)['send'](_0x254d1d);};}exports[_0xca3f('0x2d')]=function(_0x57f3e4,_0x207145){var _0x3ae11f={},_0x33bc1b={},_0x303563={'count':0x0,'rows':[]};var _0x1e84f4=_[_0xca3f('0x2e')](db[_0xca3f('0x2f')][_0xca3f('0x30')],function(_0x128a87){return{'name':_0x128a87[_0xca3f('0x31')],'type':_0x128a87[_0xca3f('0x32')][_0xca3f('0x33')]};});_0x33bc1b['model']=_['map'](_0x1e84f4,_0xca3f('0x2c'));_0x33bc1b['query']=_['keys'](_0x57f3e4[_0xca3f('0x34')]);_0x33bc1b[_0xca3f('0x35')]=_[_0xca3f('0x36')](_0x33bc1b[_0xca3f('0x37')],_0x33bc1b[_0xca3f('0x34')]);_0x3ae11f[_0xca3f('0x38')]=_[_0xca3f('0x36')](_0x33bc1b['model'],qs[_0xca3f('0x39')](_0x57f3e4[_0xca3f('0x34')][_0xca3f('0x39')]));_0x3ae11f['attributes']=_0x3ae11f[_0xca3f('0x38')][_0xca3f('0x3a')]?_0x3ae11f[_0xca3f('0x38')]:_0x33bc1b[_0xca3f('0x37')];if(!_0x57f3e4[_0xca3f('0x34')][_0xca3f('0x3b')](_0xca3f('0x3c'))){_0x3ae11f[_0xca3f('0x20')]=qs['limit'](_0x57f3e4[_0xca3f('0x34')][_0xca3f('0x20')]);_0x3ae11f[_0xca3f('0x1e')]=qs[_0xca3f('0x1e')](_0x57f3e4[_0xca3f('0x34')]['offset']);}_0x3ae11f[_0xca3f('0x3d')]=qs[_0xca3f('0x3e')](_0x57f3e4[_0xca3f('0x34')][_0xca3f('0x3e')]);_0x3ae11f[_0xca3f('0x3f')]=qs[_0xca3f('0x35')](_[_0xca3f('0x40')](_0x57f3e4[_0xca3f('0x34')],_0x33bc1b[_0xca3f('0x35')]),_0x1e84f4);if(_0x57f3e4[_0xca3f('0x34')][_0xca3f('0x41')]){_0x3ae11f[_0xca3f('0x3f')]=_[_0xca3f('0x42')](_0x3ae11f[_0xca3f('0x3f')],{'$or':_[_0xca3f('0x2e')](_0x1e84f4,function(_0x588fbd){if(_0x588fbd['type']!==_0xca3f('0x43')){var _0x4f1a6d={};_0x4f1a6d[_0x588fbd[_0xca3f('0x2c')]]={'$like':'%'+_0x57f3e4[_0xca3f('0x34')][_0xca3f('0x41')]+'%'};return _0x4f1a6d;}})});}_0x3ae11f=_['merge']({},_0x3ae11f,_0x57f3e4['options']);var _0x28c32e={'where':_0x3ae11f[_0xca3f('0x3f')]};return db[_0xca3f('0x2f')][_0xca3f('0x21')](_0x28c32e)[_0xca3f('0x26')](function(_0x49d597){_0x303563[_0xca3f('0x21')]=_0x49d597;if(_0x57f3e4[_0xca3f('0x34')][_0xca3f('0x44')]){_0x3ae11f['include']=[{'all':!![]}];}return db[_0xca3f('0x2f')][_0xca3f('0x45')](_0x3ae11f);})[_0xca3f('0x26')](function(_0x4cb430){_0x303563[_0xca3f('0x46')]=_0x4cb430;return _0x303563;})[_0xca3f('0x26')](respondWithFilteredResult(_0x207145,_0x3ae11f))[_0xca3f('0x47')](handleError(_0x207145,null));};exports['show']=function(_0x3e9f48,_0x1a91f3){var _0x2dc8dc={'raw':!![],'where':{'id':_0x3e9f48[_0xca3f('0x48')]['id']}},_0x1b897c={};_0x1b897c[_0xca3f('0x37')]=_[_0xca3f('0x49')](db['Attachment'][_0xca3f('0x30')]);_0x1b897c[_0xca3f('0x34')]=_[_0xca3f('0x49')](_0x3e9f48[_0xca3f('0x34')]);_0x1b897c[_0xca3f('0x35')]=_['intersection'](_0x1b897c[_0xca3f('0x37')],_0x1b897c[_0xca3f('0x34')]);_0x2dc8dc[_0xca3f('0x38')]=_['intersection'](_0x1b897c[_0xca3f('0x37')],qs[_0xca3f('0x39')](_0x3e9f48[_0xca3f('0x34')][_0xca3f('0x39')]));_0x2dc8dc['attributes']=_0x2dc8dc[_0xca3f('0x38')]['length']?_0x2dc8dc[_0xca3f('0x38')]:_0x1b897c[_0xca3f('0x37')];if(_0x3e9f48['query'][_0xca3f('0x44')]){_0x2dc8dc[_0xca3f('0x4a')]=[{'all':!![]}];}_0x2dc8dc=_[_0xca3f('0x42')]({},_0x2dc8dc,_0x3e9f48[_0xca3f('0x4b')]);return db['Attachment'][_0xca3f('0x4c')](_0x2dc8dc)[_0xca3f('0x26')](handleEntityNotFound(_0x1a91f3,null))['then'](respondWithResult(_0x1a91f3,null))[_0xca3f('0x47')](handleError(_0x1a91f3,null));};exports[_0xca3f('0x4d')]=function(_0x2f22e2,_0x27bc5c){var _0x14f68d={'where':{'id':_0x2f22e2[_0xca3f('0x48')]['id']}},_0x54b1b4={};_0x54b1b4[_0xca3f('0x37')]=_[_0xca3f('0x49')](db[_0xca3f('0x2f')][_0xca3f('0x30')]);_0x14f68d['attributes']=_[_0xca3f('0x36')](_0x54b1b4[_0xca3f('0x37')],qs[_0xca3f('0x39')](_0x2f22e2['query'][_0xca3f('0x39')]));_0x14f68d[_0xca3f('0x38')]=_0x14f68d[_0xca3f('0x38')][_0xca3f('0x3a')]?_0x14f68d['attributes']:_0x54b1b4[_0xca3f('0x37')];if(_0x2f22e2[_0xca3f('0x34')][_0xca3f('0x44')]){_0x14f68d[_0xca3f('0x4a')]=[{'all':!![]}];}_0x14f68d=_[_0xca3f('0x42')]({},_0x14f68d,_0x2f22e2[_0xca3f('0x4b')]);return db['Attachment'][_0xca3f('0x4c')](_0x14f68d)[_0xca3f('0x26')](handleEntityNotFound(_0x27bc5c,null))[_0xca3f('0x26')](function(_0x3f8dfb){if(_0x3f8dfb){var _0x4967f1=_0x3f8dfb[_0xca3f('0x4e')]({'plain':!![]});_0x4967f1=qs['omit'](_0x4967f1,['id','createdAt','updatedAt']);_0x2f22e2['body']=_[_0xca3f('0x4f')](_0x2f22e2[_0xca3f('0x50')],['id',_0xca3f('0x51'),_0xca3f('0x52')]);return db[_0xca3f('0x2f')]['create'](_[_0xca3f('0x42')](_0x4967f1,_0x2f22e2[_0xca3f('0x50')]),{'include':_0x2f22e2[_0xca3f('0x34')]['includeAll']?[{'all':!![]}]:undefined});}})['then'](respondWithResult(_0x27bc5c,0xc9))['catch'](handleError(_0x27bc5c,null));};exports[_0xca3f('0x25')]=function(_0x51142b,_0x16bca1){if(_0x51142b[_0xca3f('0x50')]['id']){delete _0x51142b['body']['id'];}return db[_0xca3f('0x2f')]['find']({'where':{'id':_0x51142b[_0xca3f('0x48')]['id']}})[_0xca3f('0x26')](handleEntityNotFound(_0x16bca1,null))['then'](saveUpdates(_0x51142b[_0xca3f('0x50')],null))['then'](respondWithResult(_0x16bca1,null))[_0xca3f('0x47')](handleError(_0x16bca1,null));};exports[_0xca3f('0x27')]=function(_0x568b58,_0x4b4f2c){return db[_0xca3f('0x2f')][_0xca3f('0x4c')]({'where':{'id':_0x568b58[_0xca3f('0x48')]['id']}})[_0xca3f('0x26')](handleEntityNotFound(_0x4b4f2c,null))[_0xca3f('0x26')](removeEntity(_0x4b4f2c,null))[_0xca3f('0x47')](handleError(_0x4b4f2c,null));};exports[_0xca3f('0x53')]=function(_0x141ded,_0x7a7490,_0x27f6d7){_0x141ded[_0xca3f('0x50')][_0xca3f('0x2c')]=_0x141ded[_0xca3f('0x54')][_0xca3f('0x55')];_0x141ded['body']['basename']=_0x141ded['file']['filename'];_0x141ded[_0xca3f('0x50')][_0xca3f('0x32')]=_0x141ded['file']['mimetype'];return db['Attachment'][_0xca3f('0x53')](_0x141ded[_0xca3f('0x50')])[_0xca3f('0x26')](respondWithResult(_0x7a7490,0xc9))['catch'](handleError(_0x7a7490,null));};exports[_0xca3f('0x56')]=function(_0x5d3f2f,_0x3e3bb8,_0x15c9b6){return db[_0xca3f('0x2f')][_0xca3f('0x57')]({'where':{'id':_0x5d3f2f['params']['id']},'raw':!![]})[_0xca3f('0x26')](handleEntityNotFound(_0x3e3bb8,null))[_0xca3f('0x26')](function(_0x48bde4){if(_0x48bde4){var _0x29ac05=_0x48bde4[_0xca3f('0x58')]!==null;var _0x32412b=path[_0xca3f('0x59')](config['root'],'server/files/attachments/');if(_0x29ac05){_0x32412b=path[_0xca3f('0x59')](_0x32412b,'offline-chat/');}var _0x227787=path[_0xca3f('0x59')](_0x32412b,_0x48bde4['basename']);return _0x3e3bb8[_0xca3f('0x56')](_0x227787);}})[_0xca3f('0x47')](handleError(_0x3e3bb8,null));};
\ No newline at end of file
+var _0x1e02=['query','model','attributes','intersection','fields','length','hasOwnProperty','nolimit','sort','where','filters','pick','filter','merge','VIRTUAL','options','Attachment','includeAll','include','findAll','catch','show','keys','find','clone','params','omit','createdAt','updatedAt','body','create','destroy','file','originalname','basename','filename','download','findOne','ChatOfflineMessageId','join','root','offline-chat/','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','to-csv','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','offset','undefined','count','limit','set','apply','reject','save','then','error','stack','name','send','map','rawAttributes','type','key'];(function(_0x520407,_0x24a4ce){var _0x45f7a1=function(_0x57ea00){while(--_0x57ea00){_0x520407['push'](_0x520407['shift']());}};_0x45f7a1(++_0x24a4ce);}(_0x1e02,0x85));var _0x21e0=function(_0x3889e3,_0x3ba538){_0x3889e3=_0x3889e3-0x0;var _0x5f0a22=_0x1e02[_0x3889e3];return _0x5f0a22;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x21e0('0x0'));var jsonpatch=require(_0x21e0('0x1'));var rp=require(_0x21e0('0x2'));var moment=require(_0x21e0('0x3'));var BPromise=require(_0x21e0('0x4'));var Mustache=require(_0x21e0('0x5'));var util=require(_0x21e0('0x6'));var path=require(_0x21e0('0x7'));var sox=require(_0x21e0('0x8'));var csv=require('to-csv');var ejs=require(_0x21e0('0x9'));var fs=require('fs');var fs_extra=require(_0x21e0('0xa'));var _=require(_0x21e0('0xb'));var squel=require(_0x21e0('0xc'));var crypto=require(_0x21e0('0xd'));var jsforce=require(_0x21e0('0xe'));var deskjs=require(_0x21e0('0xf'));var toCsv=require(_0x21e0('0x10'));var querystring=require('querystring');var Papa=require(_0x21e0('0x11'));var Redis=require(_0x21e0('0x12'));var authService=require(_0x21e0('0x13'));var qs=require(_0x21e0('0x14'));var as=require(_0x21e0('0x15'));var hardwareService=require(_0x21e0('0x16'));var logger=require(_0x21e0('0x17'))(_0x21e0('0x18'));var utils=require(_0x21e0('0x19'));var config=require(_0x21e0('0x1a'));var licenseUtil=require('../../config/license/util');var db=require(_0x21e0('0x1b'))['db'];function respondWithStatusCode(_0x171e9b,_0x3510f0){_0x3510f0=_0x3510f0||0xcc;return function(_0x1f9663){if(_0x1f9663){return _0x171e9b[_0x21e0('0x1c')](_0x3510f0);}return _0x171e9b[_0x21e0('0x1d')](_0x3510f0)[_0x21e0('0x1e')]();};}function respondWithResult(_0x30044f,_0x3da023){_0x3da023=_0x3da023||0xc8;return function(_0x87634c){if(_0x87634c){return _0x30044f[_0x21e0('0x1d')](_0x3da023)[_0x21e0('0x1f')](_0x87634c);}};}function respondWithFilteredResult(_0x376c83,_0x1f0555){return function(_0x3ce049){if(_0x3ce049){var _0x5e25bf=typeof _0x1f0555[_0x21e0('0x20')]===_0x21e0('0x21')&&typeof _0x1f0555['limit']===_0x21e0('0x21');var _0x41d268=_0x3ce049[_0x21e0('0x22')];var _0x1225d5=_0x5e25bf?0x0:_0x1f0555[_0x21e0('0x20')];var _0x507a2c=_0x5e25bf?_0x3ce049[_0x21e0('0x22')]:_0x1f0555['offset']+_0x1f0555[_0x21e0('0x23')];var _0x5c63f5;if(_0x507a2c>=_0x41d268){_0x507a2c=_0x41d268;_0x5c63f5=0xc8;}else{_0x5c63f5=0xce;}_0x376c83['status'](_0x5c63f5);return _0x376c83[_0x21e0('0x24')]('Content-Range',_0x1225d5+'-'+_0x507a2c+'/'+_0x41d268)[_0x21e0('0x1f')](_0x3ce049);}return null;};}function patchUpdates(_0x1e9c1f){return function(_0xb29dd1){try{jsonpatch[_0x21e0('0x25')](_0xb29dd1,_0x1e9c1f,!![]);}catch(_0x211f42){return BPromise[_0x21e0('0x26')](_0x211f42);}return _0xb29dd1[_0x21e0('0x27')]();};}function saveUpdates(_0x20a419,_0x1fa516){return function(_0x5eb5da){if(_0x5eb5da){return _0x5eb5da['update'](_0x20a419)[_0x21e0('0x28')](function(_0x4a01b9){return _0x4a01b9;});}return null;};}function removeEntity(_0x5cbac1,_0x2ed7fa){return function(_0x2b0f9a){if(_0x2b0f9a){return _0x2b0f9a['destroy']()[_0x21e0('0x28')](function(){_0x5cbac1[_0x21e0('0x1d')](0xcc)[_0x21e0('0x1e')]();});}};}function handleEntityNotFound(_0x12cb89,_0x1f92c3){return function(_0xf20223){if(!_0xf20223){_0x12cb89[_0x21e0('0x1c')](0x194);}return _0xf20223;};}function handleError(_0x5c3a10,_0x3dba72){_0x3dba72=_0x3dba72||0x1f4;return function(_0x4fd810){logger[_0x21e0('0x29')](_0x4fd810[_0x21e0('0x2a')]);if(_0x4fd810['name']){delete _0x4fd810[_0x21e0('0x2b')];}_0x5c3a10[_0x21e0('0x1d')](_0x3dba72)[_0x21e0('0x2c')](_0x4fd810);};}exports['index']=function(_0x587384,_0x2c9e80){var _0x5e4d11={},_0xab9858={},_0x3ccedf={'count':0x0,'rows':[]};var _0x32d2b5=_[_0x21e0('0x2d')](db['Attachment'][_0x21e0('0x2e')],function(_0x40a01b){return{'name':_0x40a01b['fieldName'],'type':_0x40a01b[_0x21e0('0x2f')][_0x21e0('0x30')]};});_0xab9858['model']=_[_0x21e0('0x2d')](_0x32d2b5,_0x21e0('0x2b'));_0xab9858[_0x21e0('0x31')]=_['keys'](_0x587384[_0x21e0('0x31')]);_0xab9858['filters']=_['intersection'](_0xab9858[_0x21e0('0x32')],_0xab9858[_0x21e0('0x31')]);_0x5e4d11[_0x21e0('0x33')]=_[_0x21e0('0x34')](_0xab9858['model'],qs[_0x21e0('0x35')](_0x587384['query'][_0x21e0('0x35')]));_0x5e4d11[_0x21e0('0x33')]=_0x5e4d11[_0x21e0('0x33')][_0x21e0('0x36')]?_0x5e4d11[_0x21e0('0x33')]:_0xab9858[_0x21e0('0x32')];if(!_0x587384[_0x21e0('0x31')][_0x21e0('0x37')](_0x21e0('0x38'))){_0x5e4d11['limit']=qs[_0x21e0('0x23')](_0x587384['query'][_0x21e0('0x23')]);_0x5e4d11['offset']=qs[_0x21e0('0x20')](_0x587384['query']['offset']);}_0x5e4d11['order']=qs[_0x21e0('0x39')](_0x587384['query'][_0x21e0('0x39')]);_0x5e4d11[_0x21e0('0x3a')]=qs[_0x21e0('0x3b')](_[_0x21e0('0x3c')](_0x587384[_0x21e0('0x31')],_0xab9858[_0x21e0('0x3b')]),_0x32d2b5);if(_0x587384[_0x21e0('0x31')][_0x21e0('0x3d')]){_0x5e4d11[_0x21e0('0x3a')]=_[_0x21e0('0x3e')](_0x5e4d11[_0x21e0('0x3a')],{'$or':_[_0x21e0('0x2d')](_0x32d2b5,function(_0x4871bd){if(_0x4871bd[_0x21e0('0x2f')]!==_0x21e0('0x3f')){var _0x2ecf72={};_0x2ecf72[_0x4871bd[_0x21e0('0x2b')]]={'$like':'%'+_0x587384[_0x21e0('0x31')][_0x21e0('0x3d')]+'%'};return _0x2ecf72;}})});}_0x5e4d11=_[_0x21e0('0x3e')]({},_0x5e4d11,_0x587384[_0x21e0('0x40')]);var _0x2d671b={'where':_0x5e4d11['where']};return db[_0x21e0('0x41')][_0x21e0('0x22')](_0x2d671b)[_0x21e0('0x28')](function(_0x1d1ef0){_0x3ccedf[_0x21e0('0x22')]=_0x1d1ef0;if(_0x587384[_0x21e0('0x31')][_0x21e0('0x42')]){_0x5e4d11[_0x21e0('0x43')]=[{'all':!![]}];}return db[_0x21e0('0x41')][_0x21e0('0x44')](_0x5e4d11);})[_0x21e0('0x28')](function(_0x4bd8a2){_0x3ccedf['rows']=_0x4bd8a2;return _0x3ccedf;})['then'](respondWithFilteredResult(_0x2c9e80,_0x5e4d11))[_0x21e0('0x45')](handleError(_0x2c9e80,null));};exports[_0x21e0('0x46')]=function(_0x2d0487,_0x467a94){var _0x341753={'raw':!![],'where':{'id':_0x2d0487['params']['id']}},_0x5eea39={};_0x5eea39[_0x21e0('0x32')]=_['keys'](db[_0x21e0('0x41')]['rawAttributes']);_0x5eea39[_0x21e0('0x31')]=_[_0x21e0('0x47')](_0x2d0487[_0x21e0('0x31')]);_0x5eea39[_0x21e0('0x3b')]=_[_0x21e0('0x34')](_0x5eea39[_0x21e0('0x32')],_0x5eea39[_0x21e0('0x31')]);_0x341753[_0x21e0('0x33')]=_['intersection'](_0x5eea39[_0x21e0('0x32')],qs['fields'](_0x2d0487[_0x21e0('0x31')][_0x21e0('0x35')]));_0x341753[_0x21e0('0x33')]=_0x341753['attributes']['length']?_0x341753[_0x21e0('0x33')]:_0x5eea39['model'];if(_0x2d0487['query'][_0x21e0('0x42')]){_0x341753['include']=[{'all':!![]}];}_0x341753=_[_0x21e0('0x3e')]({},_0x341753,_0x2d0487[_0x21e0('0x40')]);return db[_0x21e0('0x41')][_0x21e0('0x48')](_0x341753)['then'](handleEntityNotFound(_0x467a94,null))[_0x21e0('0x28')](respondWithResult(_0x467a94,null))[_0x21e0('0x45')](handleError(_0x467a94,null));};exports[_0x21e0('0x49')]=function(_0x56e75e,_0x480192){var _0x273da9={'where':{'id':_0x56e75e[_0x21e0('0x4a')]['id']}},_0x407b53={};_0x407b53[_0x21e0('0x32')]=_['keys'](db['Attachment'][_0x21e0('0x2e')]);_0x273da9[_0x21e0('0x33')]=_[_0x21e0('0x34')](_0x407b53['model'],qs[_0x21e0('0x35')](_0x56e75e[_0x21e0('0x31')]['fields']));_0x273da9[_0x21e0('0x33')]=_0x273da9[_0x21e0('0x33')][_0x21e0('0x36')]?_0x273da9[_0x21e0('0x33')]:_0x407b53[_0x21e0('0x32')];if(_0x56e75e[_0x21e0('0x31')][_0x21e0('0x42')]){_0x273da9['include']=[{'all':!![]}];}_0x273da9=_[_0x21e0('0x3e')]({},_0x273da9,_0x56e75e[_0x21e0('0x40')]);return db['Attachment'][_0x21e0('0x48')](_0x273da9)['then'](handleEntityNotFound(_0x480192,null))[_0x21e0('0x28')](function(_0x9b9925){if(_0x9b9925){var _0x2970db=_0x9b9925['get']({'plain':!![]});_0x2970db=qs[_0x21e0('0x4b')](_0x2970db,['id',_0x21e0('0x4c'),_0x21e0('0x4d')]);_0x56e75e[_0x21e0('0x4e')]=_['omit'](_0x56e75e[_0x21e0('0x4e')],['id',_0x21e0('0x4c'),_0x21e0('0x4d')]);return db['Attachment'][_0x21e0('0x4f')](_[_0x21e0('0x3e')](_0x2970db,_0x56e75e[_0x21e0('0x4e')]),{'include':_0x56e75e['query']['includeAll']?[{'all':!![]}]:undefined});}})[_0x21e0('0x28')](respondWithResult(_0x480192,0xc9))[_0x21e0('0x45')](handleError(_0x480192,null));};exports['update']=function(_0x4a6701,_0x193920){if(_0x4a6701[_0x21e0('0x4e')]['id']){delete _0x4a6701[_0x21e0('0x4e')]['id'];}return db[_0x21e0('0x41')][_0x21e0('0x48')]({'where':{'id':_0x4a6701[_0x21e0('0x4a')]['id']}})[_0x21e0('0x28')](handleEntityNotFound(_0x193920,null))[_0x21e0('0x28')](saveUpdates(_0x4a6701[_0x21e0('0x4e')],null))[_0x21e0('0x28')](respondWithResult(_0x193920,null))['catch'](handleError(_0x193920,null));};exports[_0x21e0('0x50')]=function(_0x46c2d8,_0x3885a1){return db[_0x21e0('0x41')]['find']({'where':{'id':_0x46c2d8['params']['id']}})[_0x21e0('0x28')](handleEntityNotFound(_0x3885a1,null))[_0x21e0('0x28')](removeEntity(_0x3885a1,null))['catch'](handleError(_0x3885a1,null));};exports['create']=function(_0x58b493,_0x15cf2f,_0x10a48d){_0x58b493[_0x21e0('0x4e')][_0x21e0('0x2b')]=_0x58b493[_0x21e0('0x51')][_0x21e0('0x52')];_0x58b493[_0x21e0('0x4e')][_0x21e0('0x53')]=_0x58b493['file'][_0x21e0('0x54')];_0x58b493['body'][_0x21e0('0x2f')]=_0x58b493['file']['mimetype'];return db[_0x21e0('0x41')][_0x21e0('0x4f')](_0x58b493['body'])[_0x21e0('0x28')](respondWithResult(_0x15cf2f,0xc9))[_0x21e0('0x45')](handleError(_0x15cf2f,null));};exports[_0x21e0('0x55')]=function(_0x1ed141,_0x12fef2,_0x33b90c){return db[_0x21e0('0x41')][_0x21e0('0x56')]({'where':{'id':_0x1ed141[_0x21e0('0x4a')]['id']},'raw':!![]})[_0x21e0('0x28')](handleEntityNotFound(_0x12fef2,null))[_0x21e0('0x28')](function(_0x525da3){if(_0x525da3){var _0x5cd0ee=_0x525da3[_0x21e0('0x57')]!==null;var _0x2af57a=path[_0x21e0('0x58')](config[_0x21e0('0x59')],'server/files/attachments/');if(_0x5cd0ee){_0x2af57a=path[_0x21e0('0x58')](_0x2af57a,_0x21e0('0x5a'));}var _0x3473ce=path[_0x21e0('0x58')](_0x2af57a,_0x525da3[_0x21e0('0x53')]);return _0x12fef2['download'](_0x3473ce);}})[_0x21e0('0x45')](handleError(_0x12fef2,null));};
\ No newline at end of file
diff --git a/server/api/attachment/attachment.model.js b/server/api/attachment/attachment.model.js
index 0eb2c2e..d697d29 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 _0x230b=['exports','define','Attachment','attachments','util','../../config/logger','api','moment','request-promise','path','rimraf','../../config/environment','./attachment.attributes'];(function(_0x167f65,_0x1612f9){var _0x241eb5=function(_0x3144cd){while(--_0x3144cd){_0x167f65['push'](_0x167f65['shift']());}};_0x241eb5(++_0x1612f9);}(_0x230b,0xba));var _0xb230=function(_0x314d7d,_0xe5783a){_0x314d7d=_0x314d7d-0x0;var _0x2689f6=_0x230b[_0x314d7d];return _0x2689f6;};'use strict';var _=require('lodash');var util=require(_0xb230('0x0'));var logger=require(_0xb230('0x1'))(_0xb230('0x2'));var moment=require(_0xb230('0x3'));var BPromise=require('bluebird');var rp=require(_0xb230('0x4'));var fs=require('fs');var path=require(_0xb230('0x5'));var rimraf=require(_0xb230('0x6'));var config=require(_0xb230('0x7'));var attributes=require(_0xb230('0x8'));module[_0xb230('0x9')]=function(_0x47fa4d,_0x3967f6){return _0x47fa4d[_0xb230('0xa')](_0xb230('0xb'),attributes,{'tableName':_0xb230('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x170c=['request-promise','path','rimraf','../../config/environment','./attachment.attributes','exports','define','Attachment','attachments','lodash','util','bluebird'];(function(_0x29949e,_0x7666c3){var _0x116dbf=function(_0x58f0d6){while(--_0x58f0d6){_0x29949e['push'](_0x29949e['shift']());}};_0x116dbf(++_0x7666c3);}(_0x170c,0x17d));var _0xc170=function(_0x4d585b,_0x12034f){_0x4d585b=_0x4d585b-0x0;var _0xfa0820=_0x170c[_0x4d585b];return _0xfa0820;};'use strict';var _=require(_0xc170('0x0'));var util=require(_0xc170('0x1'));var logger=require('../../config/logger')('api');var moment=require('moment');var BPromise=require(_0xc170('0x2'));var rp=require(_0xc170('0x3'));var fs=require('fs');var path=require(_0xc170('0x4'));var rimraf=require(_0xc170('0x5'));var config=require(_0xc170('0x6'));var attributes=require(_0xc170('0x7'));module[_0xc170('0x8')]=function(_0x50f727,_0x261845){return _0x50f727[_0xc170('0x9')](_0xc170('0xa'),attributes,{'tableName':_0xc170('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
diff --git a/server/api/attachment/attachment.rpc.js b/server/api/attachment/attachment.rpc.js
index ab465ba..39e7f87 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 _0xffe1=['message','result','catch','Attachment','create','body','options','raw','CreateAttachment','lodash','util','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','client','http','then','info','Attachment,\x20%s,\x20%s','debug','Attachment,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code'];(function(_0x591c14,_0x3ef13b){var _0x4cafd7=function(_0x5f5298){while(--_0x5f5298){_0x591c14['push'](_0x591c14['shift']());}};_0x4cafd7(++_0x3ef13b);}(_0xffe1,0x175));var _0x1ffe=function(_0x46de05,_0x3a411d){_0x46de05=_0x46de05-0x0;var _0x2c3fef=_0xffe1[_0x46de05];return _0x2c3fef;};'use strict';var _=require(_0x1ffe('0x0'));var util=require(_0x1ffe('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x1ffe('0x2'));var fs=require('fs');var Redis=require(_0x1ffe('0x3'));var db=require(_0x1ffe('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x1ffe('0x5'))(_0x1ffe('0x6'));var config=require(_0x1ffe('0x7'));var jayson=require('jayson/promise');var client=jayson[_0x1ffe('0x8')][_0x1ffe('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x6bc1ed,_0x26e370,_0xb34112){return new BPromise(function(_0x8eee2b,_0x4d2a28){return client['request'](_0x6bc1ed,_0xb34112)[_0x1ffe('0xa')](function(_0x13556e){logger[_0x1ffe('0xb')](_0x1ffe('0xc'),_0x26e370,'request\x20sent');logger[_0x1ffe('0xd')](_0x1ffe('0xe'),_0x26e370,_0x1ffe('0xf'),JSON[_0x1ffe('0x10')](_0x13556e));if(_0x13556e[_0x1ffe('0x11')]){if(_0x13556e[_0x1ffe('0x11')][_0x1ffe('0x12')]===0x1f4){logger[_0x1ffe('0x11')]('Attachment,\x20%s,\x20%s',_0x26e370,_0x13556e[_0x1ffe('0x11')][_0x1ffe('0x13')]);return _0x4d2a28(_0x13556e['error'][_0x1ffe('0x13')]);}logger[_0x1ffe('0x11')](_0x1ffe('0xc'),_0x26e370,_0x13556e[_0x1ffe('0x11')][_0x1ffe('0x13')]);return _0x8eee2b(_0x13556e['error'][_0x1ffe('0x13')]);}else{logger[_0x1ffe('0xb')](_0x1ffe('0xc'),_0x26e370,'request\x20sent');_0x8eee2b(_0x13556e[_0x1ffe('0x14')]['message']);}})[_0x1ffe('0x15')](function(_0x565922){logger[_0x1ffe('0x11')](_0x1ffe('0xc'),_0x26e370,_0x565922);_0x4d2a28(_0x565922);});});}exports['CreateAttachment']=function(_0x561670){var _0x4dbd7f=this;return new Promise(function(_0x42b92c,_0x21950f){return db[_0x1ffe('0x16')][_0x1ffe('0x17')](_0x561670[_0x1ffe('0x18')],{'raw':_0x561670[_0x1ffe('0x19')]?_0x561670[_0x1ffe('0x19')][_0x1ffe('0x1a')]===undefined?!![]:![]:!![]})[_0x1ffe('0xa')](function(_0x38f189){logger[_0x1ffe('0xb')](_0x1ffe('0x1b'),_0x561670);logger['debug']('CreateAttachment',_0x561670,JSON[_0x1ffe('0x10')](_0x38f189));_0x42b92c(_0x38f189);})[_0x1ffe('0x15')](function(_0x95071c){logger['error']('CreateAttachment',_0x95071c[_0x1ffe('0x13')],_0x561670);_0x21950f(_0x4dbd7f[_0x1ffe('0x11')](0x1f4,_0x95071c[_0x1ffe('0x13')]));});});};
\ No newline at end of file
+var _0xd52a=['../../config/logger','rpc','../../config/environment','request','Attachment,\x20%s,\x20%s','debug','Attachment,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','message','info','result','catch','CreateAttachment','create','options','raw','util','bluebird','randomstring','ioredis','../../config/utils'];(function(_0x1d6fc6,_0x857c7){var _0x595a5a=function(_0x26ee91){while(--_0x26ee91){_0x1d6fc6['push'](_0x1d6fc6['shift']());}};_0x595a5a(++_0x857c7);}(_0xd52a,0xca));var _0xad52=function(_0x2bd0e1,_0x4666a6){_0x2bd0e1=_0x2bd0e1-0x0;var _0x4482eb=_0xd52a[_0x2bd0e1];return _0x4482eb;};'use strict';var _=require('lodash');var util=require(_0xad52('0x0'));var moment=require('moment');var BPromise=require(_0xad52('0x1'));var rs=require(_0xad52('0x2'));var fs=require('fs');var Redis=require(_0xad52('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0xad52('0x4'));var logger=require(_0xad52('0x5'))(_0xad52('0x6'));var config=require(_0xad52('0x7'));var jayson=require('jayson/promise');var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x1ad70b,_0x55f7a7,_0x23fc23){return new BPromise(function(_0x4bbff0,_0x192ba5){return client[_0xad52('0x8')](_0x1ad70b,_0x23fc23)['then'](function(_0x39c078){logger['info'](_0xad52('0x9'),_0x55f7a7,'request\x20sent');logger[_0xad52('0xa')](_0xad52('0xb'),_0x55f7a7,_0xad52('0xc'),JSON[_0xad52('0xd')](_0x39c078));if(_0x39c078['error']){if(_0x39c078['error']['code']===0x1f4){logger[_0xad52('0xe')](_0xad52('0x9'),_0x55f7a7,_0x39c078[_0xad52('0xe')][_0xad52('0xf')]);return _0x192ba5(_0x39c078[_0xad52('0xe')][_0xad52('0xf')]);}logger[_0xad52('0xe')](_0xad52('0x9'),_0x55f7a7,_0x39c078[_0xad52('0xe')]['message']);return _0x4bbff0(_0x39c078[_0xad52('0xe')][_0xad52('0xf')]);}else{logger[_0xad52('0x10')](_0xad52('0x9'),_0x55f7a7,_0xad52('0xc'));_0x4bbff0(_0x39c078[_0xad52('0x11')][_0xad52('0xf')]);}})[_0xad52('0x12')](function(_0x450099){logger['error']('Attachment,\x20%s,\x20%s',_0x55f7a7,_0x450099);_0x192ba5(_0x450099);});});}exports[_0xad52('0x13')]=function(_0x39128c){var _0x351440=this;return new Promise(function(_0x1c19e9,_0x33da89){return db['Attachment'][_0xad52('0x14')](_0x39128c['body'],{'raw':_0x39128c[_0xad52('0x15')]?_0x39128c[_0xad52('0x15')][_0xad52('0x16')]===undefined?!![]:![]:!![]})['then'](function(_0x24fb52){logger['info'](_0xad52('0x13'),_0x39128c);logger[_0xad52('0xa')](_0xad52('0x13'),_0x39128c,JSON[_0xad52('0xd')](_0x24fb52));_0x1c19e9(_0x24fb52);})[_0xad52('0x12')](function(_0x2f1526){logger['error'](_0xad52('0x13'),_0x2f1526['message'],_0x39128c);_0x33da89(_0x351440[_0xad52('0xe')](0x1f4,_0x2f1526[_0xad52('0xf')]));});});};
\ No newline at end of file
diff --git a/server/api/attachment/index.js b/server/api/attachment/index.js
index 7ada540..35563c4 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 _0x2032=['./attachment.controller','get','isAuthenticated','index','/:id','show','download','/:id/clone','clone','root','server/files/attachments/','now','post','single','file','create','put','update','delete','destroy','exports','util','path','connect-timeout','Router','fs-extra','../../components/interaction/service','../../config/environment'];(function(_0x59ac2c,_0x27ed47){var _0x1437b2=function(_0x3e9f0b){while(--_0x3e9f0b){_0x59ac2c['push'](_0x59ac2c['shift']());}};_0x1437b2(++_0x27ed47);}(_0x2032,0xd9));var _0x2203=function(_0x18ef2b,_0x42873b){_0x18ef2b=_0x18ef2b-0x0;var _0x359d9d=_0x2032[_0x18ef2b];return _0x359d9d;};'use strict';var multer=require('multer');var util=require(_0x2203('0x0'));var path=require(_0x2203('0x1'));var timeout=require(_0x2203('0x2'));var express=require('express');var router=express[_0x2203('0x3')]();var fs_extra=require(_0x2203('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0x2203('0x5'));var config=require(_0x2203('0x6'));var controller=require(_0x2203('0x7'));router[_0x2203('0x8')]('/',auth[_0x2203('0x9')](),controller[_0x2203('0xa')]);router[_0x2203('0x8')](_0x2203('0xb'),auth[_0x2203('0x9')](),controller[_0x2203('0xc')]);router[_0x2203('0x8')]('/:id/download',auth['isAuthenticated'](),controller[_0x2203('0xd')]);router['post'](_0x2203('0xe'),auth[_0x2203('0x9')](),controller[_0x2203('0xf')]);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x849049,_0x4a6832,_0x3f690a){_0x3f690a(null,path['join'](config[_0x2203('0x10')],_0x2203('0x11')));},'filename':function(_0x4b9376,_0x583bc7,_0x585c76){_0x585c76(null,util['format']('%s-%s',Date[_0x2203('0x12')](),_0x583bc7['originalname']['replace'](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-')));}})});router[_0x2203('0x13')]('/',upload[_0x2203('0x14')](_0x2203('0x15')),controller[_0x2203('0x16')]);router[_0x2203('0x17')](_0x2203('0xb'),auth[_0x2203('0x9')](),controller[_0x2203('0x18')]);router[_0x2203('0x19')](_0x2203('0xb'),auth['isAuthenticated'](),controller[_0x2203('0x1a')]);module[_0x2203('0x1b')]=router;
\ No newline at end of file
+var _0xadb5=['root','format','%s-%s','originalname','replace','file','put','update','delete','destroy','exports','util','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/:id','show','/:id/download','download','post','/:id/clone'];(function(_0x4c0da3,_0x2fabd1){var _0xd68cda=function(_0x17a074){while(--_0x17a074){_0x4c0da3['push'](_0x4c0da3['shift']());}};_0xd68cda(++_0x2fabd1);}(_0xadb5,0xad));var _0x5adb=function(_0x3c61fc,_0x1e4ed9){_0x3c61fc=_0x3c61fc-0x0;var _0x379fae=_0xadb5[_0x3c61fc];return _0x379fae;};'use strict';var multer=require('multer');var util=require(_0x5adb('0x0'));var path=require('path');var timeout=require(_0x5adb('0x1'));var express=require(_0x5adb('0x2'));var router=express[_0x5adb('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x5adb('0x4'));var interaction=require(_0x5adb('0x5'));var config=require(_0x5adb('0x6'));var controller=require('./attachment.controller');router[_0x5adb('0x7')]('/',auth[_0x5adb('0x8')](),controller[_0x5adb('0x9')]);router[_0x5adb('0x7')](_0x5adb('0xa'),auth[_0x5adb('0x8')](),controller[_0x5adb('0xb')]);router[_0x5adb('0x7')](_0x5adb('0xc'),auth[_0x5adb('0x8')](),controller[_0x5adb('0xd')]);router[_0x5adb('0xe')](_0x5adb('0xf'),auth[_0x5adb('0x8')](),controller['clone']);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x1a8f66,_0x1ea238,_0x82e67e){_0x82e67e(null,path['join'](config[_0x5adb('0x10')],'server/files/attachments/'));},'filename':function(_0x2a0b70,_0x5433bf,_0x8cfcc6){_0x8cfcc6(null,util[_0x5adb('0x11')](_0x5adb('0x12'),Date['now'](),_0x5433bf[_0x5adb('0x13')][_0x5adb('0x14')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-')));}})});router[_0x5adb('0xe')]('/',upload['single'](_0x5adb('0x15')),controller['create']);router[_0x5adb('0x16')](_0x5adb('0xa'),auth[_0x5adb('0x8')](),controller[_0x5adb('0x17')]);router[_0x5adb('0x18')](_0x5adb('0xa'),auth[_0x5adb('0x8')](),controller[_0x5adb('0x19')]);module[_0x5adb('0x1a')]=router;
\ No newline at end of file
diff --git a/server/api/authActiveDirectory/authActiveDirectory.controller.js b/server/api/authActiveDirectory/authActiveDirectory.controller.js
index 2dbc4b8..14a522a 100644
--- a/server/api/authActiveDirectory/authActiveDirectory.controller.js
+++ b/server/api/authActiveDirectory/authActiveDirectory.controller.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x1bb0=['blocked','blockedAt','online','admin','user','add','minutes','getLicense','catch','login','authenticate','ad-login','Something\x20went\x20wrong,\x20please\x20try\x20again.','signToken','json','use','User','passport','Strategy','moment','activedirectory2','bluebird','util','../../mysqldb','../../components/auth/service','../../config/utils','api','activedirectory','undefined','baseDN','url','domain','error','Error\x20authenticate\x20%s:\x20%s','inspect','Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.','Error\x20authenticate\x20%s:\x20Wrong\x20credentials','Setting','findOne','adSsoEnabled','blockDuration','then','name','password','salt','role'];(function(_0x3aa7fa,_0x2390ae){var _0x13fc86=function(_0x21d33e){while(--_0x21d33e){_0x3aa7fa['push'](_0x3aa7fa['shift']());}};_0x13fc86(++_0x2390ae);}(_0x1bb0,0xc9));var _0x01bb=function(_0x4acc11,_0xe2f74f){_0x4acc11=_0x4acc11-0x0;var _0x2db26d=_0x1bb0[_0x4acc11];return _0x2db26d;};'use strict';var passport=require(_0x01bb('0x0'));var LocalStrategy=require('passport-local')[_0x01bb('0x1')];var moment=require(_0x01bb('0x2'));var ActiveDirectory=require(_0x01bb('0x3'));var BPromise=require(_0x01bb('0x4'));var util=require(_0x01bb('0x5'));var db=require(_0x01bb('0x6'))['db'];var authService=require(_0x01bb('0x7'));var utils=require(_0x01bb('0x8'));var config=require('../../config/environment');var logger=require('../../config/logger')(_0x01bb('0x9'));function isActiveDirectoryConfigured(_0x41ce0a){var _0x39510a=![];if(typeof _0x41ce0a[_0x01bb('0xa')]!==_0x01bb('0xb')){_0x39510a=_0x41ce0a['activedirectory'][_0x01bb('0xc')]&&_0x41ce0a['activedirectory'][_0x01bb('0xd')]&&_0x41ce0a[_0x01bb('0xa')][_0x01bb('0xe')];}return _0x39510a;}function adAuthenticate(_0x5e6252,_0x4cf991,_0x40dca3){return new BPromise(function(_0x159c6b,_0xc22278){try{var _0x29101a=new ActiveDirectory(_0x5e6252);_0x29101a['authenticate'](_0x4cf991,_0x40dca3,function(_0x312116,_0x15d25f){if(_0x312116){logger[_0x01bb('0xf')](_0x01bb('0x10'),_0x4cf991,util[_0x01bb('0x11')](_0x312116,{'showHidden':![],'depth':null}));_0xc22278(_0x01bb('0x12'));}else if(!_0x15d25f){logger[_0x01bb('0xf')](_0x01bb('0x13'),_0x4cf991);_0xc22278(_0x01bb('0x12'));}else{_0x159c6b(_0x15d25f);}});}catch(_0x323099){_0xc22278(_0x323099);}});}function ActiveDirectoryAuthenticate(_0x44b3d4,_0x2f4731,_0x441a6a,_0x14cb7b){var _0x4fc00f,_0x5dbcda;if(!isActiveDirectoryConfigured(config)){logger[_0x01bb('0xf')]('Error\x20authenticate\x20%s:\x20Active\x20Directory\x20not\x20configured',_0x2f4731);return _0x14cb7b(null,![],{'message':_0x01bb('0x12')});}return db[_0x01bb('0x14')][_0x01bb('0x15')]({'where':{'id':0x1},'attributes':[_0x01bb('0x16'),_0x01bb('0x17')],'raw':!![]})[_0x01bb('0x18')](function(_0x549e3e){_0x4fc00f=_0x549e3e;if(!_0x4fc00f[_0x01bb('0x16')]){logger[_0x01bb('0xf')]('Error\x20authenticate\x20%s:\x20Active\x20Directory\x20not\x20enabled',_0x2f4731);throw new Error(_0x01bb('0x12'));}return _0x44b3d4[_0x01bb('0x15')]({'attributes':['id',_0x01bb('0x19'),_0x01bb('0x1a'),_0x01bb('0x1b'),_0x01bb('0x1c'),'disabled',_0x01bb('0x1d'),_0x01bb('0x1e'),_0x01bb('0x1f')],'where':{'name':_0x2f4731,'role':{'$or':[_0x01bb('0x20'),_0x01bb('0x21'),'agent']},'adSsoEnabled':!![]}});})['then'](function(_0x5318a4){if(!_0x5318a4||_0x5318a4&&_0x5318a4['name']!==_0x2f4731){throw new Error(_0x01bb('0x12'));}_0x5dbcda=_0x5318a4;var _0x56331e=_0x5dbcda[_0x01bb('0x19')]+'@'+config[_0x01bb('0xa')][_0x01bb('0xe')];return adAuthenticate(config['activedirectory'],_0x56331e,_0x441a6a);})[_0x01bb('0x18')](function(_0x1aa1c7){if(_0x5dbcda['disabled']){throw new Error('Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.');}if(_0x4fc00f[_0x01bb('0x17')]>0x0){if(_0x5dbcda[_0x01bb('0x1d')]){if(moment(_0x5dbcda['blockedAt'])[_0x01bb('0x22')](_0x4fc00f[_0x01bb('0x17')],_0x01bb('0x23'))>moment()){throw new Error(_0x01bb('0x12'));}return utils['clearBlockUser'](_0x5dbcda,0x0,![],null)['then'](function(){return utils[_0x01bb('0x24')](_0x5dbcda);})[_0x01bb('0x18')](function(){return _0x14cb7b(null,_0x5dbcda);});}else{return utils[_0x01bb('0x24')](_0x5dbcda)[_0x01bb('0x18')](function(){return _0x14cb7b(null,_0x5dbcda);});}}else{return utils[_0x01bb('0x24')](_0x5dbcda)['then'](function(){return _0x14cb7b(null,_0x5dbcda);});}})[_0x01bb('0x25')](function(_0x3c49fc){return _0x14cb7b(null,![],_0x3c49fc);});}function handleError(_0xeb80ab,_0x2baccd,_0x330887){return _0xeb80ab['status'](_0x2baccd||0x1f4)['send']({'message':_0x330887?_0x330887['message']||_0x330887:''});}exports[_0x01bb('0x26')]=function(_0x36a655,_0x3e424b,_0x4c2b7a){passport[_0x01bb('0x27')](_0x01bb('0x28'),function(_0x434dc5,_0x3dc422,_0x2386ca){var _0x326073=_0x434dc5||_0x2386ca;if(_0x326073){return handleError(_0x3e424b,0x191,_0x326073);}if(!_0x3dc422){return handleError(_0x3e424b,0x194,{'message':_0x01bb('0x29')});}else{var _0x724e7a={'payload':{'id':_0x3dc422['id'],'role':_0x3dc422[_0x01bb('0x1c')]},'options':{'expiresIn':0x15180}};return authService[_0x01bb('0x2a')](_0x724e7a)['then'](function(_0x5922ca){_0x3e424b[_0x01bb('0x2b')]({'id':_0x3dc422['id'],'token':_0x5922ca,'statusCall':'','isAlreadyLogged':_0x3dc422[_0x01bb('0x1f')]});});}})(_0x36a655,_0x3e424b,_0x4c2b7a);};passport[_0x01bb('0x2c')](_0x01bb('0x28'),new LocalStrategy({'usernameField':_0x01bb('0x19'),'passwordField':_0x01bb('0x1a')},function(_0x264c3c,_0x5a8338,_0x3b894b){return ActiveDirectoryAuthenticate(db[_0x01bb('0x2d')],_0x264c3c,_0x5a8338,_0x3b894b);}));
\ No newline at end of file
+var _0x6684=['passport','passport-local','Strategy','activedirectory2','bluebird','util','../../components/auth/service','../../config/utils','../../config/environment','../../config/logger','api','activedirectory','undefined','url','domain','authenticate','error','Error\x20authenticate\x20%s:\x20%s','inspect','Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.','Setting','findOne','adSsoEnabled','blockDuration','then','Error\x20authenticate\x20%s:\x20Active\x20Directory\x20not\x20enabled','salt','role','disabled','blocked','blockedAt','online','user','agent','name','add','minutes','clearBlockUser','getLicense','catch','status','send','message','login','Something\x20went\x20wrong,\x20please\x20try\x20again.','signToken','use','ad-login','password','User'];(function(_0x1d4449,_0x495153){var _0x4dcde3=function(_0x36d549){while(--_0x36d549){_0x1d4449['push'](_0x1d4449['shift']());}};_0x4dcde3(++_0x495153);}(_0x6684,0x64));var _0x4668=function(_0x4067ac,_0x363603){_0x4067ac=_0x4067ac-0x0;var _0x53d74d=_0x6684[_0x4067ac];return _0x53d74d;};'use strict';var passport=require(_0x4668('0x0'));var LocalStrategy=require(_0x4668('0x1'))[_0x4668('0x2')];var moment=require('moment');var ActiveDirectory=require(_0x4668('0x3'));var BPromise=require(_0x4668('0x4'));var util=require(_0x4668('0x5'));var db=require('../../mysqldb')['db'];var authService=require(_0x4668('0x6'));var utils=require(_0x4668('0x7'));var config=require(_0x4668('0x8'));var logger=require(_0x4668('0x9'))(_0x4668('0xa'));function isActiveDirectoryConfigured(_0x20ad61){var _0x106cfb=![];if(typeof _0x20ad61[_0x4668('0xb')]!==_0x4668('0xc')){_0x106cfb=_0x20ad61[_0x4668('0xb')]['baseDN']&&_0x20ad61['activedirectory'][_0x4668('0xd')]&&_0x20ad61[_0x4668('0xb')][_0x4668('0xe')];}return _0x106cfb;}function adAuthenticate(_0x193285,_0x16394b,_0xf6b85a){return new BPromise(function(_0x14bcd4,_0x4502b5){try{var _0x5849e1=new ActiveDirectory(_0x193285);_0x5849e1[_0x4668('0xf')](_0x16394b,_0xf6b85a,function(_0x14f1ad,_0x5df0dc){if(_0x14f1ad){logger[_0x4668('0x10')](_0x4668('0x11'),_0x16394b,util[_0x4668('0x12')](_0x14f1ad,{'showHidden':![],'depth':null}));_0x4502b5(_0x4668('0x13'));}else if(!_0x5df0dc){logger[_0x4668('0x10')]('Error\x20authenticate\x20%s:\x20Wrong\x20credentials',_0x16394b);_0x4502b5(_0x4668('0x13'));}else{_0x14bcd4(_0x5df0dc);}});}catch(_0x2d39bb){_0x4502b5(_0x2d39bb);}});}function ActiveDirectoryAuthenticate(_0x158dc8,_0x1f7901,_0x54a779,_0x29ee06){var _0x2df177,_0x241963;if(!isActiveDirectoryConfigured(config)){logger[_0x4668('0x10')]('Error\x20authenticate\x20%s:\x20Active\x20Directory\x20not\x20configured',_0x1f7901);return _0x29ee06(null,![],{'message':_0x4668('0x13')});}return db[_0x4668('0x14')][_0x4668('0x15')]({'where':{'id':0x1},'attributes':[_0x4668('0x16'),_0x4668('0x17')],'raw':!![]})[_0x4668('0x18')](function(_0x5a5589){_0x2df177=_0x5a5589;if(!_0x2df177['adSsoEnabled']){logger['error'](_0x4668('0x19'),_0x1f7901);throw new Error(_0x4668('0x13'));}return _0x158dc8[_0x4668('0x15')]({'attributes':['id','name','password',_0x4668('0x1a'),_0x4668('0x1b'),_0x4668('0x1c'),_0x4668('0x1d'),_0x4668('0x1e'),_0x4668('0x1f')],'where':{'name':_0x1f7901,'role':{'$or':['admin',_0x4668('0x20'),_0x4668('0x21')]},'adSsoEnabled':!![]}});})[_0x4668('0x18')](function(_0x5ba48b){if(!_0x5ba48b||_0x5ba48b&&_0x5ba48b[_0x4668('0x22')]!==_0x1f7901){throw new Error(_0x4668('0x13'));}_0x241963=_0x5ba48b;var _0x100e3c=_0x241963[_0x4668('0x22')]+'@'+config[_0x4668('0xb')][_0x4668('0xe')];return adAuthenticate(config['activedirectory'],_0x100e3c,_0x54a779);})['then'](function(_0x253e16){if(_0x241963[_0x4668('0x1c')]){throw new Error(_0x4668('0x13'));}if(_0x2df177[_0x4668('0x17')]>0x0){if(_0x241963[_0x4668('0x1d')]){if(moment(_0x241963[_0x4668('0x1e')])[_0x4668('0x23')](_0x2df177[_0x4668('0x17')],_0x4668('0x24'))>moment()){throw new Error(_0x4668('0x13'));}return utils[_0x4668('0x25')](_0x241963,0x0,![],null)['then'](function(){return utils[_0x4668('0x26')](_0x241963);})['then'](function(){return _0x29ee06(null,_0x241963);});}else{return utils[_0x4668('0x26')](_0x241963)[_0x4668('0x18')](function(){return _0x29ee06(null,_0x241963);});}}else{return utils[_0x4668('0x26')](_0x241963)[_0x4668('0x18')](function(){return _0x29ee06(null,_0x241963);});}})[_0x4668('0x27')](function(_0x13bff1){return _0x29ee06(null,![],_0x13bff1);});}function handleError(_0x19e107,_0x1b619e,_0x517cd5){return _0x19e107[_0x4668('0x28')](_0x1b619e||0x1f4)[_0x4668('0x29')]({'message':_0x517cd5?_0x517cd5[_0x4668('0x2a')]||_0x517cd5:''});}exports[_0x4668('0x2b')]=function(_0x37364c,_0x48d602,_0x4efa16){passport[_0x4668('0xf')]('ad-login',function(_0x4fca33,_0x2a3e14,_0x503135){var _0x65586=_0x4fca33||_0x503135;if(_0x65586){return handleError(_0x48d602,0x191,_0x65586);}if(!_0x2a3e14){return handleError(_0x48d602,0x194,{'message':_0x4668('0x2c')});}else{var _0x27f891={'payload':{'id':_0x2a3e14['id'],'role':_0x2a3e14[_0x4668('0x1b')]},'options':{'expiresIn':0x15180}};return authService[_0x4668('0x2d')](_0x27f891)['then'](function(_0x16cd04){_0x48d602['json']({'id':_0x2a3e14['id'],'token':_0x16cd04,'statusCall':'','isAlreadyLogged':_0x2a3e14['online']});});}})(_0x37364c,_0x48d602,_0x4efa16);};passport[_0x4668('0x2e')](_0x4668('0x2f'),new LocalStrategy({'usernameField':'name','passwordField':_0x4668('0x30')},function(_0x593f6e,_0x531809,_0x52d730){return ActiveDirectoryAuthenticate(db[_0x4668('0x31')],_0x593f6e,_0x531809,_0x52d730);}));
\ No newline at end of file
diff --git a/server/api/authActiveDirectory/index.js b/server/api/authActiveDirectory/index.js
index 3aad1fd..ea7ba30 100644
--- a/server/api/authActiveDirectory/index.js
+++ b/server/api/authActiveDirectory/index.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x5579=['login','exports','Router','post'];(function(_0x6f1a87,_0x5d5bcf){var _0x2495c7=function(_0x1c6733){while(--_0x1c6733){_0x6f1a87['push'](_0x6f1a87['shift']());}};_0x2495c7(++_0x5d5bcf);}(_0x5579,0x8e));var _0x9557=function(_0x211070,_0x35f484){_0x211070=_0x211070-0x0;var _0x5f36b9=_0x5579[_0x211070];return _0x5f36b9;};'use strict';var express=require('express');var router=express[_0x9557('0x0')]();var controller=require('./authActiveDirectory.controller');router[_0x9557('0x1')]('/',controller[_0x9557('0x2')]);module[_0x9557('0x3')]=router;
\ No newline at end of file
+var _0xa6ea=['exports','Router','./authActiveDirectory.controller','post','login'];(function(_0x2aea9e,_0x1f587f){var _0x430b92=function(_0x416c37){while(--_0x416c37){_0x2aea9e['push'](_0x2aea9e['shift']());}};_0x430b92(++_0x1f587f);}(_0xa6ea,0xb0));var _0xaa6e=function(_0x395bae,_0x4708e2){_0x395bae=_0x395bae-0x0;var _0x1d658e=_0xa6ea[_0x395bae];return _0x1d658e;};'use strict';var express=require('express');var router=express[_0xaa6e('0x0')]();var controller=require(_0xaa6e('0x1'));router[_0xaa6e('0x2')]('/',controller[_0xaa6e('0x3')]);module[_0xaa6e('0x4')]=router;
\ No newline at end of file
diff --git a/server/api/authGoogle/authGoogle.controller.js b/server/api/authGoogle/authGoogle.controller.js
index 14b3495..e0339ae 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 _0x7a54=['blockedAt','add','minutes','clearBlockUser','getLicense','catch','lodash','passport','passport-google-oauth20','moment','../../mysqldb','../../config/utils','login','authenticate','google','/login','email','use','secret','callbackURL','findOne','allowedLoginAttempts','blockDuration','then','User','find','map','value','admin','user','agent','Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'];(function(_0xefd519,_0xc62635){var _0x4bb882=function(_0x37e0a1){while(--_0x37e0a1){_0xefd519['push'](_0xefd519['shift']());}};_0x4bb882(++_0xc62635);}(_0x7a54,0x106));var _0x47a5=function(_0x42b749,_0x188528){_0x42b749=_0x42b749-0x0;var _0x2c06ab=_0x7a54[_0x42b749];return _0x2c06ab;};'use strict';var _=require(_0x47a5('0x0'));var passport=require(_0x47a5('0x1'));var GoogleStrategy=require(_0x47a5('0x2'))['Strategy'];var moment=require(_0x47a5('0x3'));var db=require(_0x47a5('0x4'))['db'];var config=require('../../config/environment');var utils=require(_0x47a5('0x5'));exports[_0x47a5('0x6')]=passport[_0x47a5('0x7')](_0x47a5('0x8'),{'failureRedirect':_0x47a5('0x9'),'scope':['profile',_0x47a5('0xa')],'session':![]});exports['callback']=passport[_0x47a5('0x7')](_0x47a5('0x8'),{'failureRedirect':'/login','session':![]});passport[_0x47a5('0xb')](new GoogleStrategy({'clientID':config['google']?config['google']['clientID']:'id','clientSecret':config[_0x47a5('0x8')]?config[_0x47a5('0x8')]['clientSecret']:_0x47a5('0xc'),'callbackURL':config['google']?config['google'][_0x47a5('0xd')]:''},function(_0x69e4d4,_0x2f399b,_0x250fad,_0xd612dd){var _0xd308b8,_0x1eae59;return db['Setting'][_0x47a5('0xe')]({'where':{'id':0x1},'attributes':[_0x47a5('0xf'),_0x47a5('0x10')],'raw':!![]})[_0x47a5('0x11')](function(_0x139f25){_0xd308b8=_0x139f25;return db[_0x47a5('0x12')][_0x47a5('0x13')]({'where':{'email':_[_0x47a5('0x14')](_0x250fad['emails'],_0x47a5('0x15')),'role':{'$or':[_0x47a5('0x16'),_0x47a5('0x17'),_0x47a5('0x18')]}}});})[_0x47a5('0x11')](function(_0x574af6){_0x1eae59=_0x574af6;if(_0x1eae59){if(_0x1eae59['disabled']){return _0xd612dd(_0x47a5('0x19'));}else if(_0xd308b8['blockDuration']>0x0){if(_0x1eae59['blocked']){if(moment(_0x1eae59[_0x47a5('0x1a')])[_0x47a5('0x1b')](_0xd308b8[_0x47a5('0x10')],_0x47a5('0x1c'))>moment()){return _0xd612dd(_0x47a5('0x19'));}else{return utils[_0x47a5('0x1d')](_0x1eae59,0x0,![],null)[_0x47a5('0x11')](function(){return utils[_0x47a5('0x1e')](_0x1eae59);})[_0x47a5('0x11')](function(){return _0xd612dd(null,_0x1eae59);});}}else{return utils['getLicense'](_0x1eae59)[_0x47a5('0x11')](function(){return _0xd612dd(null,_0x1eae59);});}}else{return utils[_0x47a5('0x1e')](_0x1eae59)['then'](function(){return _0xd612dd(null,_0x1eae59);});}}return _0xd612dd(_0x47a5('0x19'));})[_0x47a5('0x1f')](function(_0x36874d){_0xd612dd(_0x36874d);});}));
\ No newline at end of file
+var _0x9957=['../../config/environment','../../config/utils','login','google','/login','profile','email','callback','authenticate','use','clientID','clientSecret','secret','callbackURL','Setting','findOne','allowedLoginAttempts','User','find','map','emails','value','admin','user','then','disabled','Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.','blockDuration','blocked','blockedAt','add','getLicense','catch','lodash','passport','passport-google-oauth20','Strategy','../../mysqldb'];(function(_0x3b6027,_0x100fea){var _0x3a9e70=function(_0x44bb5b){while(--_0x44bb5b){_0x3b6027['push'](_0x3b6027['shift']());}};_0x3a9e70(++_0x100fea);}(_0x9957,0x93));var _0x7995=function(_0x1ac595,_0x5d2081){_0x1ac595=_0x1ac595-0x0;var _0x455fff=_0x9957[_0x1ac595];return _0x455fff;};'use strict';var _=require(_0x7995('0x0'));var passport=require(_0x7995('0x1'));var GoogleStrategy=require(_0x7995('0x2'))[_0x7995('0x3')];var moment=require('moment');var db=require(_0x7995('0x4'))['db'];var config=require(_0x7995('0x5'));var utils=require(_0x7995('0x6'));exports[_0x7995('0x7')]=passport['authenticate'](_0x7995('0x8'),{'failureRedirect':_0x7995('0x9'),'scope':[_0x7995('0xa'),_0x7995('0xb')],'session':![]});exports[_0x7995('0xc')]=passport[_0x7995('0xd')]('google',{'failureRedirect':_0x7995('0x9'),'session':![]});passport[_0x7995('0xe')](new GoogleStrategy({'clientID':config['google']?config[_0x7995('0x8')][_0x7995('0xf')]:'id','clientSecret':config[_0x7995('0x8')]?config[_0x7995('0x8')][_0x7995('0x10')]:_0x7995('0x11'),'callbackURL':config[_0x7995('0x8')]?config['google'][_0x7995('0x12')]:''},function(_0x41c652,_0x581f22,_0xb0c872,_0x2cb37a){var _0x19a27e,_0x385f00;return db[_0x7995('0x13')][_0x7995('0x14')]({'where':{'id':0x1},'attributes':[_0x7995('0x15'),'blockDuration'],'raw':!![]})['then'](function(_0x2b4e94){_0x19a27e=_0x2b4e94;return db[_0x7995('0x16')][_0x7995('0x17')]({'where':{'email':_[_0x7995('0x18')](_0xb0c872[_0x7995('0x19')],_0x7995('0x1a')),'role':{'$or':[_0x7995('0x1b'),_0x7995('0x1c'),'agent']}}});})[_0x7995('0x1d')](function(_0x565d97){_0x385f00=_0x565d97;if(_0x385f00){if(_0x385f00[_0x7995('0x1e')]){return _0x2cb37a(_0x7995('0x1f'));}else if(_0x19a27e[_0x7995('0x20')]>0x0){if(_0x385f00[_0x7995('0x21')]){if(moment(_0x385f00[_0x7995('0x22')])[_0x7995('0x23')](_0x19a27e['blockDuration'],'minutes')>moment()){return _0x2cb37a(_0x7995('0x1f'));}else{return utils['clearBlockUser'](_0x385f00,0x0,![],null)['then'](function(){return utils[_0x7995('0x24')](_0x385f00);})[_0x7995('0x1d')](function(){return _0x2cb37a(null,_0x385f00);});}}else{return utils['getLicense'](_0x385f00)[_0x7995('0x1d')](function(){return _0x2cb37a(null,_0x385f00);});}}else{return utils['getLicense'](_0x385f00)['then'](function(){return _0x2cb37a(null,_0x385f00);});}}return _0x2cb37a(_0x7995('0x1f'));})[_0x7995('0x25')](function(_0x350fd9){_0x2cb37a(_0x350fd9);});}));
\ No newline at end of file
diff --git a/server/api/authGoogle/index.js b/server/api/authGoogle/index.js
index 2347e94..40d1380 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 _0xba34=['setTokenCookie','exports','express','passport','Router','./authGoogle.controller','../user/user.controller.js','login','get','/callback','callback'];(function(_0x3ce3c,_0x319337){var _0x55a2c9=function(_0x1568d0){while(--_0x1568d0){_0x3ce3c['push'](_0x3ce3c['shift']());}};_0x55a2c9(++_0x319337);}(_0xba34,0xb2));var _0x4ba3=function(_0x272c6d,_0x58e5bd){_0x272c6d=_0x272c6d-0x0;var _0x5659ef=_0xba34[_0x272c6d];return _0x5659ef;};'use strict';var express=require(_0x4ba3('0x0'));var passport=require(_0x4ba3('0x1'));var router=express[_0x4ba3('0x2')]();var controller=require(_0x4ba3('0x3'));var userController=require(_0x4ba3('0x4'));var authService=require('../../components/auth/service');router['get']('/',controller[_0x4ba3('0x5')]);router[_0x4ba3('0x6')](_0x4ba3('0x7'),controller[_0x4ba3('0x8')],authService['isMiddleware'],userController['login'],authService[_0x4ba3('0x9')]);module[_0x4ba3('0xa')]=router;
\ No newline at end of file
+var _0xc8c3=['isMiddleware','express','passport','Router','../../components/auth/service','get','login','callback'];(function(_0x4c3851,_0xbebbfd){var _0x43a1e2=function(_0x271b9f){while(--_0x271b9f){_0x4c3851['push'](_0x4c3851['shift']());}};_0x43a1e2(++_0xbebbfd);}(_0xc8c3,0x1c1));var _0x3c8c=function(_0x4c3070,_0xc2fb4c){_0x4c3070=_0x4c3070-0x0;var _0x536a44=_0xc8c3[_0x4c3070];return _0x536a44;};'use strict';var express=require(_0x3c8c('0x0'));var passport=require(_0x3c8c('0x1'));var router=express[_0x3c8c('0x2')]();var controller=require('./authGoogle.controller');var userController=require('../user/user.controller.js');var authService=require(_0x3c8c('0x3'));router[_0x3c8c('0x4')]('/',controller[_0x3c8c('0x5')]);router['get']('/callback',controller[_0x3c8c('0x6')],authService[_0x3c8c('0x7')],userController[_0x3c8c('0x5')],authService['setTokenCookie']);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 6033e24..9e00839 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 _0x6081=['\x22%s\x22\x20<%s>','email','SendMail','error','format','SendMail\x20error:\x20%s.\x20Please\x20contact\x20your\x20Administrator!','message','stringify','status','send','local-login','Something\x20went\x20wrong,\x20please\x20try\x20again.','signToken','online','forgot','body','trim','toLowerCase','User','find','This\x20email\x20is\x20not\x20registered.','The\x20user\x20is\x20disabled.\x20Please\x20contact\x20the\x20administrator.','The\x20user\x20is\x20blocked.\x20Please\x20contact\x20the\x20administrator.','resetPasswordExpires','now','save','Please\x20click\x20on\x20the\x20following\x20link,\x20or\x20paste\x20this\x20into\x20your\x20browser\x20to\x20complete\x20the\x20process:\x0a\x0a','headers','/reset/','If\x20you\x20did\x20not\x20request\x20this,\x20please\x20ignore\x20this\x20email\x20and\x20your\x20password\x20will\x20remain\x20unchanged.\x0a','Reset\x20Email\x20sent!','reset','token','Password\x20reset\x20token\x20is\x20invalid\x20or\x20has\x20expired.','securePassword','validatePasswordPattern','enforcePasswordHistory','previousPasswords','passwordHistoryLimit','Password\x20reset!','use','util','passport','passport-local','Strategy','randomstring','moment','../../mysqldb','../../components/auth/service','../../config/utils','client','http','Setting','findOne','blockDuration','then','name','password','salt','disabled','blocked','blockedAt','loginAttempts','user','agent','authenticate','Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.','allowedLoginAttempts','clearBlockUser','add','minutes','getLicense','catch','MailServerOut','Smtp','CloudProvider','merge'];(function(_0x36ec43,_0x4449e7){var _0x3af915=function(_0x509e6b){while(--_0x509e6b){_0x36ec43['push'](_0x36ec43['shift']());}};_0x3af915(++_0x4449e7);}(_0x6081,0x76));var _0x1608=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x6081[_0x14add3];return _0x4a174f;};'use strict';var util=require(_0x1608('0x0'));var passport=require(_0x1608('0x1'));var LocalStrategy=require(_0x1608('0x2'))[_0x1608('0x3')];var jayson=require('jayson/promise');var _=require('lodash');var rs=require(_0x1608('0x4'));var moment=require(_0x1608('0x5'));var db=require(_0x1608('0x6'))['db'];var authService=require(_0x1608('0x7'));var utils=require(_0x1608('0x8'));var client=jayson[_0x1608('0x9')][_0x1608('0xa')]({'port':0x232b});function localAuthenticate(_0x42b14a,_0x5599aa,_0x58b21f,_0x1a7cb){var _0x5d0ea7,_0x5e0b20;return db[_0x1608('0xb')][_0x1608('0xc')]({'where':{'id':0x1},'attributes':['allowedLoginAttempts',_0x1608('0xd')],'raw':!![]})[_0x1608('0xe')](function(_0x22e372){_0x5d0ea7=_0x22e372;return _0x42b14a[_0x1608('0xc')]({'attributes':['id',_0x1608('0xf'),_0x1608('0x10'),_0x1608('0x11'),'role',_0x1608('0x12'),_0x1608('0x13'),_0x1608('0x14'),_0x1608('0x15')],'where':{'name':_0x5599aa,'role':{'$or':['admin',_0x1608('0x16'),_0x1608('0x17')]}}});})[_0x1608('0xe')](function(_0x2b2b85){if(!_0x2b2b85||_0x2b2b85&&_0x2b2b85[_0x1608('0xf')]!==_0x5599aa){throw new Error('Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.');}else{_0x5e0b20=_0x2b2b85;return _0x5e0b20;}})[_0x1608('0xe')](function(){_0x5e0b20[_0x1608('0x18')](_0x58b21f,function(_0x42fbf1,_0x264c96){var _0x3c8f03=_0x5e0b20['loginAttempts']+0x1;if(_0x42fbf1){return _0x1a7cb(_0x42fbf1);}else if(!_0x264c96){if(_0x5e0b20[_0x1608('0x12')]){return _0x1a7cb(null,![],{'message':_0x1608('0x19')});}else if(_0x5d0ea7[_0x1608('0x1a')]>0x0){if(_0x5e0b20['blocked']){if(_0x5d0ea7[_0x1608('0xd')]>0x0){if(moment(_0x5e0b20[_0x1608('0x14')])['add'](_0x5d0ea7[_0x1608('0xd')],'minutes')>moment()){return _0x1a7cb(null,![],{'message':_0x1608('0x19')});}else{return utils['clearBlockUser'](_0x5e0b20,_0x3c8f03,![],null)[_0x1608('0xe')](function(){return _0x1a7cb(null,![],{'message':_0x1608('0x19')});});}}else{return _0x1a7cb(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});}}else{if(_0x3c8f03>=_0x5d0ea7['allowedLoginAttempts']){return utils[_0x1608('0x1b')](_0x5e0b20,0x0,!![],moment())[_0x1608('0xe')](function(){return _0x1a7cb(null,![],{'message':_0x1608('0x19')});});}else{return utils['clearBlockUser'](_0x5e0b20,_0x3c8f03,![],null)['then'](function(){return _0x1a7cb(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});});}}}else{return _0x1a7cb(null,![],{'message':_0x1608('0x19')});}}else{if(_0x5e0b20[_0x1608('0x12')]){return _0x1a7cb(null,![],{'message':_0x1608('0x19')});}else if(_0x5d0ea7['allowedLoginAttempts']>0x0){if(_0x5e0b20[_0x1608('0x13')]){if(_0x5d0ea7[_0x1608('0xd')]>0x0){if(moment(_0x5e0b20[_0x1608('0x14')])[_0x1608('0x1c')](_0x5d0ea7['blockDuration'],_0x1608('0x1d'))>moment()){return _0x1a7cb(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});}else{return utils[_0x1608('0x1b')](_0x5e0b20,0x0,![],null)[_0x1608('0xe')](function(){return utils[_0x1608('0x1e')](_0x5e0b20);})[_0x1608('0xe')](function(){return _0x1a7cb(null,_0x5e0b20);});}}else{return _0x1a7cb(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});}}else{return utils['clearBlockUser'](_0x5e0b20,0x0,![],null)[_0x1608('0xe')](function(){return utils[_0x1608('0x1e')](_0x5e0b20);})[_0x1608('0xe')](function(){return _0x1a7cb(null,_0x5e0b20);})[_0x1608('0x1f')](function(_0x4ce897){return _0x1a7cb(null,![],_0x4ce897);});}}else{if(_0x5e0b20[_0x1608('0x13')]){return _0x1a7cb(null,![],{'message':_0x1608('0x19')});}else{return utils[_0x1608('0x1e')](_0x5e0b20)[_0x1608('0xe')](function(){return _0x1a7cb(null,_0x5e0b20);});}}}});})[_0x1608('0x1f')](function(_0x361a08){return _0x1a7cb(null,![],_0x361a08);});}function sendServiceMail(_0x1787d5){return db['MailAccount']['find']({'where':{'service':!![]},'attributes':['id',_0x1608('0xf'),'email'],'include':[{'model':db[_0x1608('0x20')],'as':_0x1608('0x21'),'include':[{'model':db['CloudProvider'],'as':_0x1608('0x22')}]}]})[_0x1608('0xe')](function(_0x52a91a){if(!_0x52a91a){throw new Error('Unable\x20to\x20find\x20a\x20configured\x20SMTP\x20service!');}var _0x45d47d=_0x52a91a['getSmtpOptions']();var _0x14a4a7={'account':_0x45d47d,'message':_[_0x1608('0x23')]({'from':util['format'](_0x1608('0x24'),_0x52a91a['name'],_0x52a91a[_0x1608('0x25')]||_0x52a91a[_0x1608('0x21')][_0x1608('0x16')])},_0x1787d5)};return client['request'](_0x1608('0x26'),_0x14a4a7);})['then'](function(_0x11ba70){if(_0x11ba70[_0x1608('0x27')]){throw new Error(util[_0x1608('0x28')](_0x1608('0x29'),_0x11ba70[_0x1608('0x27')][_0x1608('0x2a')]||JSON[_0x1608('0x2b')](_0x11ba70[_0x1608('0x27')])));}return!![];});}function handleError(_0x1ef030,_0xa17340,_0x3718b9){return _0x1ef030[_0x1608('0x2c')](_0xa17340||0x1f4)[_0x1608('0x2d')]({'message':_0x3718b9?_0x3718b9['message']||_0x3718b9:''});}exports['login']=function(_0x44a4cc,_0x53078f,_0x134f5c){passport[_0x1608('0x18')](_0x1608('0x2e'),function(_0x1325f8,_0x43f507,_0x59b9ce){var _0x1ca5e8=_0x1325f8||_0x59b9ce;if(_0x1ca5e8){return handleError(_0x53078f,0x191,_0x1ca5e8);}if(!_0x43f507){return handleError(_0x53078f,0x194,{'message':_0x1608('0x2f')});}else{var _0x200029={'payload':{'id':_0x43f507['id'],'role':_0x43f507['role']},'options':{'expiresIn':0x15180}};return authService[_0x1608('0x30')](_0x200029)[_0x1608('0xe')](function(_0x3420a6){_0x53078f['json']({'id':_0x43f507['id'],'token':_0x3420a6,'statusCall':'','isAlreadyLogged':_0x43f507[_0x1608('0x31')]});});}})(_0x44a4cc,_0x53078f,_0x134f5c);};exports[_0x1608('0x32')]=function(_0x1512e9,_0x300993){if(!_0x1512e9[_0x1608('0x33')][_0x1608('0x25')]){return handleError(_0x300993,0x1f4,{'message':'Email\x20parameter\x20is\x20missing'});}var _0x512058=rs['generate']();_0x1512e9[_0x1608('0x33')][_0x1608('0x25')]=_0x1512e9[_0x1608('0x33')]['email'][_0x1608('0x34')]()[_0x1608('0x35')]();var _0x41d6c9;return db[_0x1608('0xb')]['findOne']({'where':{'id':0x1},'attributes':[_0x1608('0x1a'),_0x1608('0xd')],'raw':!![]})[_0x1608('0xe')](function(_0x1ea317){_0x41d6c9=_0x1ea317;return db[_0x1608('0x36')][_0x1608('0x37')]({'where':{'email':_0x1512e9[_0x1608('0x33')][_0x1608('0x25')]}});})[_0x1608('0xe')](function(_0x3296a3){if(!_0x3296a3){throw new Error(_0x1608('0x38'));}if(_0x3296a3[_0x1608('0x12')]){throw new Error(_0x1608('0x39'));}if(_0x3296a3[_0x1608('0x13')]){if(moment(_0x3296a3[_0x1608('0x14')])['add'](_0x41d6c9[_0x1608('0xd')],_0x1608('0x1d'))>moment()){throw new Error(_0x1608('0x3a'));}else{_0x3296a3['blocked']=![];_0x3296a3['blockedAt']=null;}}_0x3296a3['resetPasswordToken']=_0x512058;_0x3296a3[_0x1608('0x3b')]=Date[_0x1608('0x3c')]()+0x36ee80;return _0x3296a3[_0x1608('0x3d')]();})[_0x1608('0xe')](function(){return sendServiceMail({'to':_0x1512e9[_0x1608('0x33')][_0x1608('0x25')],'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'+_0x1608('0x3e')+'https://'+_0x1512e9[_0x1608('0x3f')]['host']+_0x1608('0x40')+_0x512058+'\x0a\x0a'+_0x1608('0x41')});})['then'](function(){_0x300993[_0x1608('0x2c')](0xc8)['send']({'message':_0x1608('0x42')});})[_0x1608('0x1f')](function(_0x219850){return handleError(_0x300993,0x1f4,_0x219850);});};exports[_0x1608('0x43')]=function(_0x196e22,_0x2dc33f){return db[_0x1608('0x36')][_0x1608('0x37')]({'where':{'resetPasswordToken':_0x196e22['params'][_0x1608('0x44')],'resetPasswordExpires':{'$gt':Date[_0x1608('0x3c')]()}}})[_0x1608('0xe')](function(_0x2110f6){if(!_0x2110f6){throw new Error(_0x1608('0x45'));}return db[_0x1608('0xb')]['findOne']({'attributes':['id',_0x1608('0x46'),'enforcePasswordHistory','passwordHistoryLimit']})[_0x1608('0xe')](function(_0x272df6){if(_0x272df6[_0x1608('0x46')])authService[_0x1608('0x47')](_0x196e22[_0x1608('0x33')][_0x1608('0x10')]);if(!_0x272df6[_0x1608('0x48')]||!_0x2110f6[_0x1608('0x49')])return _0x2110f6;authService['validatePasswordHistory'](_0x196e22['body'][_0x1608('0x10')],_0x2110f6[_0x1608('0x49')],_0x272df6[_0x1608('0x4a')]);return _0x2110f6;})[_0x1608('0xe')](function(){_0x2110f6[_0x1608('0x10')]=_0x196e22['body'][_0x1608('0x10')];_0x2110f6['resetPasswordToken']=null;_0x2110f6['resetPasswordExpires']=null;return _0x2110f6[_0x1608('0x3d')]();});})[_0x1608('0xe')](function(){_0x2dc33f['status'](0xc8)[_0x1608('0x2d')]({'message':_0x1608('0x4b')});})['catch'](function(_0x1a0112){return handleError(_0x2dc33f,0x1f4,_0x1a0112);});};passport[_0x1608('0x4c')](_0x1608('0x2e'),new LocalStrategy({'usernameField':'name','passwordField':'password'},function(_0x15c9ae,_0x555025,_0x33f3f9){return localAuthenticate(db['User'],_0x15c9ae,_0x555025,_0x33f3f9);}));
\ No newline at end of file
+var _0x6a1e=['passport-local','jayson/promise','randomstring','moment','../../components/auth/service','client','http','Setting','findOne','allowedLoginAttempts','blockDuration','then','name','password','salt','role','disabled','blocked','blockedAt','admin','user','agent','Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.','authenticate','loginAttempts','clearBlockUser','minutes','getLicense','catch','MailAccount','MailServerOut','Smtp','CloudProvider','Unable\x20to\x20find\x20a\x20configured\x20SMTP\x20service!','getSmtpOptions','format','\x22%s\x22\x20<%s>','error','SendMail\x20error:\x20%s.\x20Please\x20contact\x20your\x20Administrator!','status','send','message','login','local-login','signToken','json','online','forgot','Email\x20parameter\x20is\x20missing','generate','body','email','trim','toLowerCase','User','find','This\x20email\x20is\x20not\x20registered.','The\x20user\x20is\x20disabled.\x20Please\x20contact\x20the\x20administrator.','The\x20user\x20is\x20blocked.\x20Please\x20contact\x20the\x20administrator.','resetPasswordToken','resetPasswordExpires','now','save','xCally\x20Motion\x20Password\x20Reset','You\x20are\x20receiving\x20this\x20because\x20you\x20(or\x20someone\x20else)\x20have\x20requested\x20the\x20reset\x20of\x20the\x20password\x20for\x20your\x20account.\x0a\x0a','https://','headers','host','/reset/','If\x20you\x20did\x20not\x20request\x20this,\x20please\x20ignore\x20this\x20email\x20and\x20your\x20password\x20will\x20remain\x20unchanged.\x0a','Reset\x20Email\x20sent!','reset','params','Password\x20reset\x20token\x20is\x20invalid\x20or\x20has\x20expired.','securePassword','enforcePasswordHistory','validatePasswordPattern','previousPasswords','passwordHistoryLimit','use','util'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x6a1e,0xf2));var _0xe6a1=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x6a1e[_0x3dd15e];return _0x231fd0;};'use strict';var util=require(_0xe6a1('0x0'));var passport=require('passport');var LocalStrategy=require(_0xe6a1('0x1'))['Strategy'];var jayson=require(_0xe6a1('0x2'));var _=require('lodash');var rs=require(_0xe6a1('0x3'));var moment=require(_0xe6a1('0x4'));var db=require('../../mysqldb')['db'];var authService=require(_0xe6a1('0x5'));var utils=require('../../config/utils');var client=jayson[_0xe6a1('0x6')][_0xe6a1('0x7')]({'port':0x232b});function localAuthenticate(_0x161353,_0x1510c6,_0x199117,_0x5eb3f5){var _0x253c1c,_0x263db3;return db[_0xe6a1('0x8')][_0xe6a1('0x9')]({'where':{'id':0x1},'attributes':[_0xe6a1('0xa'),_0xe6a1('0xb')],'raw':!![]})[_0xe6a1('0xc')](function(_0x3de1f9){_0x253c1c=_0x3de1f9;return _0x161353[_0xe6a1('0x9')]({'attributes':['id',_0xe6a1('0xd'),_0xe6a1('0xe'),_0xe6a1('0xf'),_0xe6a1('0x10'),_0xe6a1('0x11'),_0xe6a1('0x12'),_0xe6a1('0x13'),'loginAttempts'],'where':{'name':_0x1510c6,'role':{'$or':[_0xe6a1('0x14'),_0xe6a1('0x15'),_0xe6a1('0x16')]}}});})[_0xe6a1('0xc')](function(_0x5a1023){if(!_0x5a1023||_0x5a1023&&_0x5a1023[_0xe6a1('0xd')]!==_0x1510c6){throw new Error(_0xe6a1('0x17'));}else{_0x263db3=_0x5a1023;return _0x263db3;}})[_0xe6a1('0xc')](function(){_0x263db3[_0xe6a1('0x18')](_0x199117,function(_0x1d4aba,_0x1c027b){var _0x3770f3=_0x263db3[_0xe6a1('0x19')]+0x1;if(_0x1d4aba){return _0x5eb3f5(_0x1d4aba);}else if(!_0x1c027b){if(_0x263db3['disabled']){return _0x5eb3f5(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});}else if(_0x253c1c[_0xe6a1('0xa')]>0x0){if(_0x263db3['blocked']){if(_0x253c1c['blockDuration']>0x0){if(moment(_0x263db3[_0xe6a1('0x13')])['add'](_0x253c1c[_0xe6a1('0xb')],'minutes')>moment()){return _0x5eb3f5(null,![],{'message':_0xe6a1('0x17')});}else{return utils[_0xe6a1('0x1a')](_0x263db3,_0x3770f3,![],null)['then'](function(){return _0x5eb3f5(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});});}}else{return _0x5eb3f5(null,![],{'message':_0xe6a1('0x17')});}}else{if(_0x3770f3>=_0x253c1c[_0xe6a1('0xa')]){return utils[_0xe6a1('0x1a')](_0x263db3,0x0,!![],moment())[_0xe6a1('0xc')](function(){return _0x5eb3f5(null,![],{'message':_0xe6a1('0x17')});});}else{return utils[_0xe6a1('0x1a')](_0x263db3,_0x3770f3,![],null)[_0xe6a1('0xc')](function(){return _0x5eb3f5(null,![],{'message':_0xe6a1('0x17')});});}}}else{return _0x5eb3f5(null,![],{'message':_0xe6a1('0x17')});}}else{if(_0x263db3[_0xe6a1('0x11')]){return _0x5eb3f5(null,![],{'message':_0xe6a1('0x17')});}else if(_0x253c1c[_0xe6a1('0xa')]>0x0){if(_0x263db3['blocked']){if(_0x253c1c[_0xe6a1('0xb')]>0x0){if(moment(_0x263db3[_0xe6a1('0x13')])['add'](_0x253c1c[_0xe6a1('0xb')],_0xe6a1('0x1b'))>moment()){return _0x5eb3f5(null,![],{'message':_0xe6a1('0x17')});}else{return utils[_0xe6a1('0x1a')](_0x263db3,0x0,![],null)[_0xe6a1('0xc')](function(){return utils[_0xe6a1('0x1c')](_0x263db3);})[_0xe6a1('0xc')](function(){return _0x5eb3f5(null,_0x263db3);});}}else{return _0x5eb3f5(null,![],{'message':_0xe6a1('0x17')});}}else{return utils[_0xe6a1('0x1a')](_0x263db3,0x0,![],null)[_0xe6a1('0xc')](function(){return utils['getLicense'](_0x263db3);})[_0xe6a1('0xc')](function(){return _0x5eb3f5(null,_0x263db3);})['catch'](function(_0x4340de){return _0x5eb3f5(null,![],_0x4340de);});}}else{if(_0x263db3[_0xe6a1('0x12')]){return _0x5eb3f5(null,![],{'message':_0xe6a1('0x17')});}else{return utils[_0xe6a1('0x1c')](_0x263db3)[_0xe6a1('0xc')](function(){return _0x5eb3f5(null,_0x263db3);});}}}});})[_0xe6a1('0x1d')](function(_0x2f4987){return _0x5eb3f5(null,![],_0x2f4987);});}function sendServiceMail(_0x293b3f){return db[_0xe6a1('0x1e')]['find']({'where':{'service':!![]},'attributes':['id','name','email'],'include':[{'model':db[_0xe6a1('0x1f')],'as':_0xe6a1('0x20'),'include':[{'model':db['CloudProvider'],'as':_0xe6a1('0x21')}]}]})[_0xe6a1('0xc')](function(_0x2c29f6){if(!_0x2c29f6){throw new Error(_0xe6a1('0x22'));}var _0xb897a1=_0x2c29f6[_0xe6a1('0x23')]();var _0x251eb1={'account':_0xb897a1,'message':_['merge']({'from':util[_0xe6a1('0x24')](_0xe6a1('0x25'),_0x2c29f6[_0xe6a1('0xd')],_0x2c29f6['email']||_0x2c29f6[_0xe6a1('0x20')][_0xe6a1('0x15')])},_0x293b3f)};return client['request']('SendMail',_0x251eb1);})[_0xe6a1('0xc')](function(_0xf778fd){if(_0xf778fd[_0xe6a1('0x26')]){throw new Error(util[_0xe6a1('0x24')](_0xe6a1('0x27'),_0xf778fd[_0xe6a1('0x26')]['message']||JSON['stringify'](_0xf778fd['error'])));}return!![];});}function handleError(_0x88e00c,_0x240a22,_0x4ad68a){return _0x88e00c[_0xe6a1('0x28')](_0x240a22||0x1f4)[_0xe6a1('0x29')]({'message':_0x4ad68a?_0x4ad68a[_0xe6a1('0x2a')]||_0x4ad68a:''});}exports[_0xe6a1('0x2b')]=function(_0xaa8f2c,_0x5292ad,_0x3e655d){passport[_0xe6a1('0x18')](_0xe6a1('0x2c'),function(_0x2a24a6,_0x40611a,_0xe6cbf3){var _0x53e102=_0x2a24a6||_0xe6cbf3;if(_0x53e102){return handleError(_0x5292ad,0x191,_0x53e102);}if(!_0x40611a){return handleError(_0x5292ad,0x194,{'message':'Something\x20went\x20wrong,\x20please\x20try\x20again.'});}else{var _0x57607f={'payload':{'id':_0x40611a['id'],'role':_0x40611a[_0xe6a1('0x10')]},'options':{'expiresIn':0x15180}};return authService[_0xe6a1('0x2d')](_0x57607f)['then'](function(_0x4a078f){_0x5292ad[_0xe6a1('0x2e')]({'id':_0x40611a['id'],'token':_0x4a078f,'statusCall':'','isAlreadyLogged':_0x40611a[_0xe6a1('0x2f')]});});}})(_0xaa8f2c,_0x5292ad,_0x3e655d);};exports[_0xe6a1('0x30')]=function(_0x136a32,_0x36c7f1){if(!_0x136a32['body']['email']){return handleError(_0x36c7f1,0x1f4,{'message':_0xe6a1('0x31')});}var _0x5799f4=rs[_0xe6a1('0x32')]();_0x136a32[_0xe6a1('0x33')][_0xe6a1('0x34')]=_0x136a32[_0xe6a1('0x33')]['email'][_0xe6a1('0x35')]()[_0xe6a1('0x36')]();var _0x48c8b0;return db[_0xe6a1('0x8')][_0xe6a1('0x9')]({'where':{'id':0x1},'attributes':['allowedLoginAttempts',_0xe6a1('0xb')],'raw':!![]})[_0xe6a1('0xc')](function(_0x288039){_0x48c8b0=_0x288039;return db[_0xe6a1('0x37')][_0xe6a1('0x38')]({'where':{'email':_0x136a32[_0xe6a1('0x33')][_0xe6a1('0x34')]}});})[_0xe6a1('0xc')](function(_0xc40c5){if(!_0xc40c5){throw new Error(_0xe6a1('0x39'));}if(_0xc40c5[_0xe6a1('0x11')]){throw new Error(_0xe6a1('0x3a'));}if(_0xc40c5[_0xe6a1('0x12')]){if(moment(_0xc40c5[_0xe6a1('0x13')])['add'](_0x48c8b0[_0xe6a1('0xb')],'minutes')>moment()){throw new Error(_0xe6a1('0x3b'));}else{_0xc40c5[_0xe6a1('0x12')]=![];_0xc40c5['blockedAt']=null;}}_0xc40c5[_0xe6a1('0x3c')]=_0x5799f4;_0xc40c5[_0xe6a1('0x3d')]=Date[_0xe6a1('0x3e')]()+0x36ee80;return _0xc40c5[_0xe6a1('0x3f')]();})['then'](function(){return sendServiceMail({'to':_0x136a32[_0xe6a1('0x33')][_0xe6a1('0x34')],'subject':_0xe6a1('0x40'),'text':_0xe6a1('0x41')+'Please\x20click\x20on\x20the\x20following\x20link,\x20or\x20paste\x20this\x20into\x20your\x20browser\x20to\x20complete\x20the\x20process:\x0a\x0a'+_0xe6a1('0x42')+_0x136a32[_0xe6a1('0x43')][_0xe6a1('0x44')]+_0xe6a1('0x45')+_0x5799f4+'\x0a\x0a'+_0xe6a1('0x46')});})[_0xe6a1('0xc')](function(){_0x36c7f1[_0xe6a1('0x28')](0xc8)[_0xe6a1('0x29')]({'message':_0xe6a1('0x47')});})[_0xe6a1('0x1d')](function(_0x9a9d23){return handleError(_0x36c7f1,0x1f4,_0x9a9d23);});};exports[_0xe6a1('0x48')]=function(_0x45e2e7,_0x12b9be){return db[_0xe6a1('0x37')][_0xe6a1('0x38')]({'where':{'resetPasswordToken':_0x45e2e7[_0xe6a1('0x49')]['token'],'resetPasswordExpires':{'$gt':Date['now']()}}})[_0xe6a1('0xc')](function(_0x34d642){if(!_0x34d642){throw new Error(_0xe6a1('0x4a'));}return db['Setting'][_0xe6a1('0x9')]({'attributes':['id',_0xe6a1('0x4b'),_0xe6a1('0x4c'),'passwordHistoryLimit']})[_0xe6a1('0xc')](function(_0xf32fa9){if(_0xf32fa9[_0xe6a1('0x4b')])authService[_0xe6a1('0x4d')](_0x45e2e7[_0xe6a1('0x33')]['password']);if(!_0xf32fa9['enforcePasswordHistory']||!_0x34d642[_0xe6a1('0x4e')])return _0x34d642;authService['validatePasswordHistory'](_0x45e2e7[_0xe6a1('0x33')]['password'],_0x34d642['previousPasswords'],_0xf32fa9[_0xe6a1('0x4f')]);return _0x34d642;})[_0xe6a1('0xc')](function(){_0x34d642[_0xe6a1('0xe')]=_0x45e2e7[_0xe6a1('0x33')][_0xe6a1('0xe')];_0x34d642[_0xe6a1('0x3c')]=null;_0x34d642[_0xe6a1('0x3d')]=null;return _0x34d642[_0xe6a1('0x3f')]();});})[_0xe6a1('0xc')](function(){_0x12b9be[_0xe6a1('0x28')](0xc8)[_0xe6a1('0x29')]({'message':'Password\x20reset!'});})[_0xe6a1('0x1d')](function(_0x200399){return handleError(_0x12b9be,0x1f4,_0x200399);});};passport[_0xe6a1('0x50')]('local-login',new LocalStrategy({'usernameField':_0xe6a1('0xd'),'passwordField':_0xe6a1('0xe')},function(_0x3fe888,_0x2b7841,_0x23d82c){return localAuthenticate(db[_0xe6a1('0x37')],_0x3fe888,_0x2b7841,_0x23d82c);}));
\ No newline at end of file
diff --git a/server/api/authLocal/index.js b/server/api/authLocal/index.js
index 7069543..f4e94a5 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 _0xac4d=['post','login','/forgot','/reset/:token','reset','exports','express','Router'];(function(_0x561e27,_0xe63bf0){var _0x5c91fb=function(_0x5e2661){while(--_0x5e2661){_0x561e27['push'](_0x561e27['shift']());}};_0x5c91fb(++_0xe63bf0);}(_0xac4d,0x19e));var _0xdac4=function(_0xa464c9,_0x7c86d8){_0xa464c9=_0xa464c9-0x0;var _0x3d73c4=_0xac4d[_0xa464c9];return _0x3d73c4;};'use strict';var express=require(_0xdac4('0x0'));var router=express[_0xdac4('0x1')]();var controller=require('./authLocal.controller');router[_0xdac4('0x2')]('/',controller[_0xdac4('0x3')]);router[_0xdac4('0x2')](_0xdac4('0x4'),controller['forgot']);router[_0xdac4('0x2')](_0xdac4('0x5'),controller[_0xdac4('0x6')]);module[_0xdac4('0x7')]=router;
\ No newline at end of file
+var _0x6ff2=['/forgot','forgot','/reset/:token','reset','express','Router','./authLocal.controller','post','login'];(function(_0x20f3bb,_0x3c59ae){var _0x247001=function(_0x537ad3){while(--_0x537ad3){_0x20f3bb['push'](_0x20f3bb['shift']());}};_0x247001(++_0x3c59ae);}(_0x6ff2,0x163));var _0x26ff=function(_0x894607,_0x4e9f66){_0x894607=_0x894607-0x0;var _0x5face3=_0x6ff2[_0x894607];return _0x5face3;};'use strict';var express=require(_0x26ff('0x0'));var router=express[_0x26ff('0x1')]();var controller=require(_0x26ff('0x2'));router[_0x26ff('0x3')]('/',controller[_0x26ff('0x4')]);router[_0x26ff('0x3')](_0x26ff('0x5'),controller[_0x26ff('0x6')]);router[_0x26ff('0x3')](_0x26ff('0x7'),controller[_0x26ff('0x8')]);module['exports']=router;
\ No newline at end of file
diff --git a/server/api/automation/automation.attributes.js b/server/api/automation/automation.attributes.js
index 030f798..7a917b9 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 _0xd175=['sequelize','exports','STRING','BOOLEAN','INTEGER'];(function(_0x30faee,_0x1c3794){var _0x3a90ab=function(_0x11129b){while(--_0x11129b){_0x30faee['push'](_0x30faee['shift']());}};_0x3a90ab(++_0x1c3794);}(_0xd175,0xbe));var _0x5d17=function(_0x477d58,_0x154115){_0x477d58=_0x477d58-0x0;var _0x72c330=_0xd175[_0x477d58];return _0x72c330;};'use strict';var Sequelize=require(_0x5d17('0x0'));module[_0x5d17('0x1')]={'name':{'type':Sequelize[_0x5d17('0x2')],'allowNull':![]},'channel':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0x5d17('0x2')]},'status':{'type':Sequelize[_0x5d17('0x3')],'defaultValue':![]},'timeout':{'type':Sequelize[_0x5d17('0x4')],'defaultValue':0xa}};
\ No newline at end of file
+var _0xc9a3=['exports','STRING','BOOLEAN','INTEGER','sequelize'];(function(_0x534783,_0x26f7a8){var _0x1501a6=function(_0x31d148){while(--_0x31d148){_0x534783['push'](_0x534783['shift']());}};_0x1501a6(++_0x26f7a8);}(_0xc9a3,0x95));var _0x3c9a=function(_0x580e19,_0x5e5615){_0x580e19=_0x580e19-0x0;var _0x5a9247=_0xc9a3[_0x580e19];return _0x5a9247;};'use strict';var Sequelize=require(_0x3c9a('0x0'));module[_0x3c9a('0x1')]={'name':{'type':Sequelize['STRING'],'allowNull':![]},'channel':{'type':Sequelize[_0x3c9a('0x2')]},'description':{'type':Sequelize[_0x3c9a('0x2')]},'status':{'type':Sequelize[_0x3c9a('0x3')],'defaultValue':![]},'timeout':{'type':Sequelize[_0x3c9a('0x4')],'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 e33186e..206952b 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 _0x13c0=['querystring','papaparse','ioredis','../../components/auth/service','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','status','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','then','destroy','name','index','map','Automation','rawAttributes','key','model','query','keys','intersection','attributes','length','hasOwnProperty','nolimit','sort','where','filters','pick','filter','merge','VIRTUAL','options','includeAll','findAll','rows','catch','show','fields','include','body','find','params','addConditions','Condition','ids','getConditions','findOne','order','Action','omit','getActions','eml-format','rimraf','request-promise','moment','bluebird','mustache','util','path','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js'];(function(_0x45ea93,_0x5c86d5){var _0x1eaf65=function(_0x47a7db){while(--_0x47a7db){_0x45ea93['push'](_0x45ea93['shift']());}};_0x1eaf65(++_0x5c86d5);}(_0x13c0,0x93));var _0x013c=function(_0x264e7f,_0x4b8f91){_0x264e7f=_0x264e7f-0x0;var _0x173e6e=_0x13c0[_0x264e7f];return _0x173e6e;};'use strict';var emlformat=require(_0x013c('0x0'));var rimraf=require(_0x013c('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x013c('0x2'));var moment=require(_0x013c('0x3'));var BPromise=require(_0x013c('0x4'));var Mustache=require(_0x013c('0x5'));var util=require(_0x013c('0x6'));var path=require(_0x013c('0x7'));var sox=require('sox');var csv=require(_0x013c('0x8'));var ejs=require(_0x013c('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x013c('0xa'));var squel=require(_0x013c('0xb'));var crypto=require(_0x013c('0xc'));var jsforce=require(_0x013c('0xd'));var deskjs=require(_0x013c('0xe'));var toCsv=require(_0x013c('0x8'));var querystring=require(_0x013c('0xf'));var Papa=require(_0x013c('0x10'));var Redis=require(_0x013c('0x11'));var authService=require(_0x013c('0x12'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x013c('0x13'));var logger=require(_0x013c('0x14'))('api');var utils=require(_0x013c('0x15'));var config=require(_0x013c('0x16'));var licenseUtil=require(_0x013c('0x17'));var db=require(_0x013c('0x18'))['db'];function respondWithStatusCode(_0x3e1605,_0x396406){_0x396406=_0x396406||0xcc;return function(_0x47b215){if(_0x47b215){return _0x3e1605[_0x013c('0x19')](_0x396406);}return _0x3e1605['status'](_0x396406)[_0x013c('0x1a')]();};}function respondWithResult(_0x16133c,_0x48742b){_0x48742b=_0x48742b||0xc8;return function(_0x19363e){if(_0x19363e){return _0x16133c[_0x013c('0x1b')](_0x48742b)['json'](_0x19363e);}};}function respondWithFilteredResult(_0x53b1b4,_0x433b14){return function(_0x507213){if(_0x507213){var _0x1019e4=typeof _0x433b14[_0x013c('0x1c')]===_0x013c('0x1d')&&typeof _0x433b14[_0x013c('0x1e')]===_0x013c('0x1d');var _0x43721b=_0x507213[_0x013c('0x1f')];var _0x1c51d5=_0x1019e4?0x0:_0x433b14['offset'];var _0x3feea6=_0x1019e4?_0x507213[_0x013c('0x1f')]:_0x433b14[_0x013c('0x1c')]+_0x433b14[_0x013c('0x1e')];var _0x5d57a2;if(_0x3feea6>=_0x43721b){_0x3feea6=_0x43721b;_0x5d57a2=0xc8;}else{_0x5d57a2=0xce;}_0x53b1b4[_0x013c('0x1b')](_0x5d57a2);return _0x53b1b4[_0x013c('0x20')](_0x013c('0x21'),_0x1c51d5+'-'+_0x3feea6+'/'+_0x43721b)['json'](_0x507213);}return null;};}function patchUpdates(_0x4ed8cb){return function(_0x17456d){try{jsonpatch[_0x013c('0x22')](_0x17456d,_0x4ed8cb,!![]);}catch(_0x504bc3){return BPromise[_0x013c('0x23')](_0x504bc3);}return _0x17456d[_0x013c('0x24')]();};}function saveUpdates(_0x1f7b67,_0xb6246){return function(_0x5f00a6){if(_0x5f00a6){return _0x5f00a6[_0x013c('0x25')](_0x1f7b67)[_0x013c('0x26')](function(_0x103bc0){return _0x103bc0;});}return null;};}function removeEntity(_0x216526,_0x509f77){return function(_0x58ef60){if(_0x58ef60){return _0x58ef60[_0x013c('0x27')]()[_0x013c('0x26')](function(){_0x216526[_0x013c('0x1b')](0xcc)[_0x013c('0x1a')]();});}};}function handleEntityNotFound(_0x2cbd5b,_0x2dfe93){return function(_0x55bc27){if(!_0x55bc27){_0x2cbd5b['sendStatus'](0x194);}return _0x55bc27;};}function handleError(_0x54fdfb,_0x1706f9){_0x1706f9=_0x1706f9||0x1f4;return function(_0x47e4c6){logger['error'](_0x47e4c6['stack']);if(_0x47e4c6[_0x013c('0x28')]){delete _0x47e4c6['name'];}_0x54fdfb[_0x013c('0x1b')](_0x1706f9)['send'](_0x47e4c6);};}exports[_0x013c('0x29')]=function(_0x203e86,_0x279c6e){var _0x5d4fce={},_0x3f31a6={},_0x4e6a83={'count':0x0,'rows':[]};var _0x3ff805=_[_0x013c('0x2a')](db[_0x013c('0x2b')][_0x013c('0x2c')],function(_0x4986d1){return{'name':_0x4986d1['fieldName'],'type':_0x4986d1['type'][_0x013c('0x2d')]};});_0x3f31a6[_0x013c('0x2e')]=_['map'](_0x3ff805,_0x013c('0x28'));_0x3f31a6[_0x013c('0x2f')]=_[_0x013c('0x30')](_0x203e86[_0x013c('0x2f')]);_0x3f31a6['filters']=_[_0x013c('0x31')](_0x3f31a6['model'],_0x3f31a6['query']);_0x5d4fce[_0x013c('0x32')]=_[_0x013c('0x31')](_0x3f31a6[_0x013c('0x2e')],qs['fields'](_0x203e86[_0x013c('0x2f')]['fields']));_0x5d4fce['attributes']=_0x5d4fce[_0x013c('0x32')][_0x013c('0x33')]?_0x5d4fce[_0x013c('0x32')]:_0x3f31a6[_0x013c('0x2e')];if(!_0x203e86[_0x013c('0x2f')][_0x013c('0x34')](_0x013c('0x35'))){_0x5d4fce[_0x013c('0x1e')]=qs[_0x013c('0x1e')](_0x203e86[_0x013c('0x2f')][_0x013c('0x1e')]);_0x5d4fce[_0x013c('0x1c')]=qs['offset'](_0x203e86[_0x013c('0x2f')][_0x013c('0x1c')]);}_0x5d4fce['order']=qs[_0x013c('0x36')](_0x203e86[_0x013c('0x2f')][_0x013c('0x36')]);_0x5d4fce[_0x013c('0x37')]=qs[_0x013c('0x38')](_[_0x013c('0x39')](_0x203e86[_0x013c('0x2f')],_0x3f31a6['filters']),_0x3ff805);if(_0x203e86[_0x013c('0x2f')][_0x013c('0x3a')]){_0x5d4fce[_0x013c('0x37')]=_[_0x013c('0x3b')](_0x5d4fce[_0x013c('0x37')],{'$or':_[_0x013c('0x2a')](_0x3ff805,function(_0x2c2590){if(_0x2c2590['type']!==_0x013c('0x3c')){var _0x589209={};_0x589209[_0x2c2590[_0x013c('0x28')]]={'$like':'%'+_0x203e86[_0x013c('0x2f')][_0x013c('0x3a')]+'%'};return _0x589209;}})});}_0x5d4fce=_[_0x013c('0x3b')]({},_0x5d4fce,_0x203e86[_0x013c('0x3d')]);var _0x2fa37a={'where':_0x5d4fce[_0x013c('0x37')]};return db['Automation']['count'](_0x2fa37a)[_0x013c('0x26')](function(_0x5214d7){_0x4e6a83[_0x013c('0x1f')]=_0x5214d7;if(_0x203e86[_0x013c('0x2f')][_0x013c('0x3e')]){_0x5d4fce['include']=[{'all':!![]}];}return db[_0x013c('0x2b')][_0x013c('0x3f')](_0x5d4fce);})[_0x013c('0x26')](function(_0x72cdd4){_0x4e6a83[_0x013c('0x40')]=_0x72cdd4;return _0x4e6a83;})[_0x013c('0x26')](respondWithFilteredResult(_0x279c6e,_0x5d4fce))[_0x013c('0x41')](handleError(_0x279c6e,null));};exports[_0x013c('0x42')]=function(_0x8d05,_0x24e448){var _0x3a8675={'raw':![],'where':{'id':_0x8d05['params']['id']}},_0x5a22f6={};_0x5a22f6[_0x013c('0x2e')]=_[_0x013c('0x30')](db['Automation'][_0x013c('0x2c')]);_0x5a22f6['query']=_[_0x013c('0x30')](_0x8d05[_0x013c('0x2f')]);_0x5a22f6[_0x013c('0x38')]=_[_0x013c('0x31')](_0x5a22f6[_0x013c('0x2e')],_0x5a22f6['query']);_0x3a8675['attributes']=_[_0x013c('0x31')](_0x5a22f6[_0x013c('0x2e')],qs[_0x013c('0x43')](_0x8d05[_0x013c('0x2f')][_0x013c('0x43')]));_0x3a8675[_0x013c('0x32')]=_0x3a8675[_0x013c('0x32')][_0x013c('0x33')]?_0x3a8675['attributes']:_0x5a22f6[_0x013c('0x2e')];if(_0x8d05[_0x013c('0x2f')][_0x013c('0x3e')]){_0x3a8675[_0x013c('0x44')]=[{'all':!![]}];}_0x3a8675=_[_0x013c('0x3b')]({},_0x3a8675,_0x8d05[_0x013c('0x3d')]);return db[_0x013c('0x2b')]['find'](_0x3a8675)[_0x013c('0x26')](handleEntityNotFound(_0x24e448,null))[_0x013c('0x26')](respondWithResult(_0x24e448,null))[_0x013c('0x41')](handleError(_0x24e448,null));};exports['create']=function(_0x466a5a,_0x43d990){return db['Automation']['create'](_0x466a5a[_0x013c('0x45')],{})[_0x013c('0x26')](respondWithResult(_0x43d990,0xc9))['catch'](handleError(_0x43d990,null));};exports['update']=function(_0x512d1d,_0x11ae7a){if(_0x512d1d[_0x013c('0x45')]['id']){delete _0x512d1d[_0x013c('0x45')]['id'];}return db[_0x013c('0x2b')][_0x013c('0x46')]({'where':{'id':_0x512d1d[_0x013c('0x47')]['id']}})[_0x013c('0x26')](handleEntityNotFound(_0x11ae7a,null))[_0x013c('0x26')](saveUpdates(_0x512d1d[_0x013c('0x45')],null))[_0x013c('0x26')](respondWithResult(_0x11ae7a,null))[_0x013c('0x41')](handleError(_0x11ae7a,null));};exports[_0x013c('0x27')]=function(_0x1a7466,_0x58175c){return db['Automation']['find']({'where':{'id':_0x1a7466['params']['id']}})[_0x013c('0x26')](handleEntityNotFound(_0x58175c,null))[_0x013c('0x26')](removeEntity(_0x58175c,null))[_0x013c('0x41')](handleError(_0x58175c,null));};exports[_0x013c('0x48')]=function(_0x37882d,_0x2816b5,_0xb98a86){return db[_0x013c('0x49')][_0x013c('0x46')]({'where':{'id':_0x37882d['params']['id']}})[_0x013c('0x26')](handleEntityNotFound(_0x2816b5,null))['then'](function(_0x533ca7){if(_0x533ca7){return _0x533ca7[_0x013c('0x48')](_0x37882d[_0x013c('0x45')][_0x013c('0x4a')],_['omit'](_0x37882d[_0x013c('0x45')],[_0x013c('0x4a'),'id'])||{});}})['then'](respondWithResult(_0x2816b5,null))['catch'](handleError(_0x2816b5,null));};exports[_0x013c('0x4b')]=function(_0x49e69f,_0x2dcb9a,_0x25ca22){var _0x4f7875={};var _0x2c61c4={};var _0x37837f;var _0x57e319;return db[_0x013c('0x2b')][_0x013c('0x4c')]({'where':{'id':_0x49e69f['params']['id']}})[_0x013c('0x26')](handleEntityNotFound(_0x2dcb9a,null))[_0x013c('0x26')](function(_0x4f565b){if(_0x4f565b){_0x37837f=_0x4f565b;_0x2c61c4[_0x013c('0x2e')]=_[_0x013c('0x30')](db[_0x013c('0x49')]['rawAttributes']);_0x2c61c4['query']=_[_0x013c('0x30')](_0x49e69f[_0x013c('0x2f')]);_0x2c61c4[_0x013c('0x38')]=_['intersection'](_0x2c61c4['model'],_0x2c61c4['query']);_0x4f7875['attributes']=_['intersection'](_0x2c61c4[_0x013c('0x2e')],qs['fields'](_0x49e69f['query'][_0x013c('0x43')]));_0x4f7875[_0x013c('0x32')]=_0x4f7875[_0x013c('0x32')][_0x013c('0x33')]?_0x4f7875[_0x013c('0x32')]:_0x2c61c4['model'];_0x4f7875[_0x013c('0x4d')]=qs[_0x013c('0x36')](_0x49e69f[_0x013c('0x2f')][_0x013c('0x36')]);_0x4f7875['where']=qs[_0x013c('0x38')](_[_0x013c('0x39')](_0x49e69f['query'],_0x2c61c4[_0x013c('0x38')]));if(_0x49e69f[_0x013c('0x2f')][_0x013c('0x3a')]){_0x4f7875[_0x013c('0x37')]=_[_0x013c('0x3b')](_0x4f7875['where'],{'$or':_[_0x013c('0x2a')](_0x4f7875[_0x013c('0x32')],function(_0x39d104){var _0x11cc64={};_0x11cc64[_0x39d104]={'$like':'%'+_0x49e69f[_0x013c('0x2f')][_0x013c('0x3a')]+'%'};return _0x11cc64;})});}_0x4f7875=_[_0x013c('0x3b')]({},_0x4f7875,_0x49e69f[_0x013c('0x3d')]);return _0x37837f[_0x013c('0x4b')](_0x4f7875);}})['then'](function(_0x4c3ffd){if(_0x4c3ffd){_0x57e319=_0x4c3ffd['length'];if(!_0x49e69f[_0x013c('0x2f')]['hasOwnProperty'](_0x013c('0x35'))){_0x4f7875[_0x013c('0x1e')]=qs[_0x013c('0x1e')](_0x49e69f[_0x013c('0x2f')][_0x013c('0x1e')]);_0x4f7875[_0x013c('0x1c')]=qs[_0x013c('0x1c')](_0x49e69f[_0x013c('0x2f')][_0x013c('0x1c')]);}return _0x37837f[_0x013c('0x4b')](_0x4f7875);}})[_0x013c('0x26')](function(_0x43a55b){if(_0x43a55b){return _0x43a55b?{'count':_0x57e319,'rows':_0x43a55b}:null;}})[_0x013c('0x26')](respondWithResult(_0x2dcb9a,null))['catch'](handleError(_0x2dcb9a,null));};exports['addActions']=function(_0x59f52e,_0x1d6437,_0x57159a){return db[_0x013c('0x4e')][_0x013c('0x46')]({'where':{'id':_0x59f52e[_0x013c('0x47')]['id']}})[_0x013c('0x26')](handleEntityNotFound(_0x1d6437,null))[_0x013c('0x26')](function(_0x2118f8){if(_0x2118f8){return _0x2118f8['addActions'](_0x59f52e[_0x013c('0x45')]['ids'],_[_0x013c('0x4f')](_0x59f52e[_0x013c('0x45')],[_0x013c('0x4a'),'id'])||{});}})[_0x013c('0x26')](respondWithResult(_0x1d6437,null))['catch'](handleError(_0x1d6437,null));};exports[_0x013c('0x50')]=function(_0x340179,_0xd86e8e,_0x257bd0){var _0x26e3b6={};var _0x39d11a={};var _0x363565;var _0x245056;return db[_0x013c('0x2b')]['findOne']({'where':{'id':_0x340179['params']['id']}})[_0x013c('0x26')](handleEntityNotFound(_0xd86e8e,null))[_0x013c('0x26')](function(_0x5a910f){if(_0x5a910f){_0x363565=_0x5a910f;_0x39d11a[_0x013c('0x2e')]=_[_0x013c('0x30')](db[_0x013c('0x4e')][_0x013c('0x2c')]);_0x39d11a[_0x013c('0x2f')]=_['keys'](_0x340179[_0x013c('0x2f')]);_0x39d11a[_0x013c('0x38')]=_[_0x013c('0x31')](_0x39d11a[_0x013c('0x2e')],_0x39d11a[_0x013c('0x2f')]);_0x26e3b6[_0x013c('0x32')]=_[_0x013c('0x31')](_0x39d11a[_0x013c('0x2e')],qs[_0x013c('0x43')](_0x340179['query']['fields']));_0x26e3b6[_0x013c('0x32')]=_0x26e3b6[_0x013c('0x32')][_0x013c('0x33')]?_0x26e3b6[_0x013c('0x32')]:_0x39d11a[_0x013c('0x2e')];_0x26e3b6[_0x013c('0x4d')]=qs['sort'](_0x340179[_0x013c('0x2f')][_0x013c('0x36')]);_0x26e3b6[_0x013c('0x37')]=qs[_0x013c('0x38')](_[_0x013c('0x39')](_0x340179['query'],_0x39d11a['filters']));if(_0x340179[_0x013c('0x2f')][_0x013c('0x3a')]){_0x26e3b6[_0x013c('0x37')]=_[_0x013c('0x3b')](_0x26e3b6['where'],{'$or':_['map'](_0x26e3b6['attributes'],function(_0x4bbe23){var _0x4a33c0={};_0x4a33c0[_0x4bbe23]={'$like':'%'+_0x340179[_0x013c('0x2f')]['filter']+'%'};return _0x4a33c0;})});}_0x26e3b6=_[_0x013c('0x3b')]({},_0x26e3b6,_0x340179[_0x013c('0x3d')]);return _0x363565['getActions'](_0x26e3b6);}})[_0x013c('0x26')](function(_0x462d46){if(_0x462d46){_0x245056=_0x462d46[_0x013c('0x33')];if(!_0x340179[_0x013c('0x2f')]['hasOwnProperty']('nolimit')){_0x26e3b6[_0x013c('0x1e')]=qs['limit'](_0x340179[_0x013c('0x2f')][_0x013c('0x1e')]);_0x26e3b6[_0x013c('0x1c')]=qs[_0x013c('0x1c')](_0x340179[_0x013c('0x2f')]['offset']);}return _0x363565['getActions'](_0x26e3b6);}})['then'](function(_0x58fc0e){if(_0x58fc0e){return _0x58fc0e?{'count':_0x245056,'rows':_0x58fc0e}:null;}})['then'](respondWithResult(_0xd86e8e,null))[_0x013c('0x41')](handleError(_0xd86e8e,null));};
\ No newline at end of file
+var _0x305d=['fields','attributes','length','hasOwnProperty','order','sort','where','VIRTUAL','filter','merge','options','includeAll','include','rows','show','params','find','catch','create','body','update','destroy','addConditions','Condition','omit','getConditions','nolimit','Action','addActions','ids','getActions','findOne','pick','eml-format','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','sox','to-csv','fs-extra','lodash','crypto','jsforce','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../mysqldb','sendStatus','status','end','json','offset','undefined','count','limit','set','Content-Range','reject','save','then','error','stack','name','send','index','Automation','rawAttributes','fieldName','type','key','model','map','query','keys','filters','intersection'];(function(_0x473738,_0x15ea31){var _0x1df4ae=function(_0x417a72){while(--_0x417a72){_0x473738['push'](_0x473738['shift']());}};_0x1df4ae(++_0x15ea31);}(_0x305d,0xc9));var _0xd305=function(_0x29f587,_0x839db3){_0x29f587=_0x29f587-0x0;var _0x2f84e0=_0x305d[_0x29f587];return _0x2f84e0;};'use strict';var emlformat=require(_0xd305('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xd305('0x1'));var jsonpatch=require(_0xd305('0x2'));var rp=require(_0xd305('0x3'));var moment=require(_0xd305('0x4'));var BPromise=require('bluebird');var Mustache=require(_0xd305('0x5'));var util=require(_0xd305('0x6'));var path=require(_0xd305('0x7'));var sox=require(_0xd305('0x8'));var csv=require(_0xd305('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xd305('0xa'));var _=require(_0xd305('0xb'));var squel=require('squel');var crypto=require(_0xd305('0xc'));var jsforce=require(_0xd305('0xd'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0xd305('0xe'));var Papa=require(_0xd305('0xf'));var Redis=require(_0xd305('0x10'));var authService=require('../../components/auth/service');var qs=require(_0xd305('0x11'));var as=require(_0xd305('0x12'));var hardwareService=require(_0xd305('0x13'));var logger=require(_0xd305('0x14'))('api');var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0xd305('0x15'))['db'];function respondWithStatusCode(_0xb5e75a,_0x589ad4){_0x589ad4=_0x589ad4||0xcc;return function(_0x5ed25e){if(_0x5ed25e){return _0xb5e75a[_0xd305('0x16')](_0x589ad4);}return _0xb5e75a[_0xd305('0x17')](_0x589ad4)[_0xd305('0x18')]();};}function respondWithResult(_0x297e23,_0x4ab0c3){_0x4ab0c3=_0x4ab0c3||0xc8;return function(_0x55b36c){if(_0x55b36c){return _0x297e23['status'](_0x4ab0c3)[_0xd305('0x19')](_0x55b36c);}};}function respondWithFilteredResult(_0x154056,_0x39a95c){return function(_0x30a694){if(_0x30a694){var _0x1f9eb1=typeof _0x39a95c[_0xd305('0x1a')]===_0xd305('0x1b')&&typeof _0x39a95c['limit']===_0xd305('0x1b');var _0xca2bb2=_0x30a694[_0xd305('0x1c')];var _0x3a37e7=_0x1f9eb1?0x0:_0x39a95c[_0xd305('0x1a')];var _0xeed8db=_0x1f9eb1?_0x30a694['count']:_0x39a95c[_0xd305('0x1a')]+_0x39a95c[_0xd305('0x1d')];var _0x410a6f;if(_0xeed8db>=_0xca2bb2){_0xeed8db=_0xca2bb2;_0x410a6f=0xc8;}else{_0x410a6f=0xce;}_0x154056[_0xd305('0x17')](_0x410a6f);return _0x154056[_0xd305('0x1e')](_0xd305('0x1f'),_0x3a37e7+'-'+_0xeed8db+'/'+_0xca2bb2)['json'](_0x30a694);}return null;};}function patchUpdates(_0x10ec97){return function(_0x1095db){try{jsonpatch['apply'](_0x1095db,_0x10ec97,!![]);}catch(_0x4ade67){return BPromise[_0xd305('0x20')](_0x4ade67);}return _0x1095db[_0xd305('0x21')]();};}function saveUpdates(_0x4af413,_0x30f4a6){return function(_0x34cf04){if(_0x34cf04){return _0x34cf04['update'](_0x4af413)['then'](function(_0x33eff4){return _0x33eff4;});}return null;};}function removeEntity(_0x1fc339,_0x313bb0){return function(_0x1b8ae5){if(_0x1b8ae5){return _0x1b8ae5['destroy']()[_0xd305('0x22')](function(){_0x1fc339[_0xd305('0x17')](0xcc)['end']();});}};}function handleEntityNotFound(_0x3b7cdd,_0x2a992c){return function(_0x34e24b){if(!_0x34e24b){_0x3b7cdd[_0xd305('0x16')](0x194);}return _0x34e24b;};}function handleError(_0xbc29d1,_0x1ecd18){_0x1ecd18=_0x1ecd18||0x1f4;return function(_0x6b2aa){logger[_0xd305('0x23')](_0x6b2aa[_0xd305('0x24')]);if(_0x6b2aa[_0xd305('0x25')]){delete _0x6b2aa[_0xd305('0x25')];}_0xbc29d1[_0xd305('0x17')](_0x1ecd18)[_0xd305('0x26')](_0x6b2aa);};}exports[_0xd305('0x27')]=function(_0x553a6a,_0xbcf0b1){var _0x4f1702={},_0x16f917={},_0x3cb5f9={'count':0x0,'rows':[]};var _0x499ac5=_['map'](db[_0xd305('0x28')][_0xd305('0x29')],function(_0x34ebc1){return{'name':_0x34ebc1[_0xd305('0x2a')],'type':_0x34ebc1[_0xd305('0x2b')][_0xd305('0x2c')]};});_0x16f917[_0xd305('0x2d')]=_[_0xd305('0x2e')](_0x499ac5,_0xd305('0x25'));_0x16f917[_0xd305('0x2f')]=_[_0xd305('0x30')](_0x553a6a[_0xd305('0x2f')]);_0x16f917[_0xd305('0x31')]=_[_0xd305('0x32')](_0x16f917[_0xd305('0x2d')],_0x16f917[_0xd305('0x2f')]);_0x4f1702['attributes']=_['intersection'](_0x16f917['model'],qs[_0xd305('0x33')](_0x553a6a['query'][_0xd305('0x33')]));_0x4f1702[_0xd305('0x34')]=_0x4f1702[_0xd305('0x34')][_0xd305('0x35')]?_0x4f1702[_0xd305('0x34')]:_0x16f917[_0xd305('0x2d')];if(!_0x553a6a[_0xd305('0x2f')][_0xd305('0x36')]('nolimit')){_0x4f1702[_0xd305('0x1d')]=qs['limit'](_0x553a6a['query']['limit']);_0x4f1702[_0xd305('0x1a')]=qs[_0xd305('0x1a')](_0x553a6a['query'][_0xd305('0x1a')]);}_0x4f1702[_0xd305('0x37')]=qs[_0xd305('0x38')](_0x553a6a[_0xd305('0x2f')][_0xd305('0x38')]);_0x4f1702['where']=qs[_0xd305('0x31')](_['pick'](_0x553a6a['query'],_0x16f917[_0xd305('0x31')]),_0x499ac5);if(_0x553a6a[_0xd305('0x2f')]['filter']){_0x4f1702[_0xd305('0x39')]=_['merge'](_0x4f1702[_0xd305('0x39')],{'$or':_[_0xd305('0x2e')](_0x499ac5,function(_0x1f02be){if(_0x1f02be[_0xd305('0x2b')]!==_0xd305('0x3a')){var _0x2a9a42={};_0x2a9a42[_0x1f02be['name']]={'$like':'%'+_0x553a6a['query'][_0xd305('0x3b')]+'%'};return _0x2a9a42;}})});}_0x4f1702=_[_0xd305('0x3c')]({},_0x4f1702,_0x553a6a[_0xd305('0x3d')]);var _0x1d9ae0={'where':_0x4f1702[_0xd305('0x39')]};return db['Automation'][_0xd305('0x1c')](_0x1d9ae0)[_0xd305('0x22')](function(_0xfdfb89){_0x3cb5f9[_0xd305('0x1c')]=_0xfdfb89;if(_0x553a6a['query'][_0xd305('0x3e')]){_0x4f1702[_0xd305('0x3f')]=[{'all':!![]}];}return db[_0xd305('0x28')]['findAll'](_0x4f1702);})[_0xd305('0x22')](function(_0x3c8517){_0x3cb5f9[_0xd305('0x40')]=_0x3c8517;return _0x3cb5f9;})[_0xd305('0x22')](respondWithFilteredResult(_0xbcf0b1,_0x4f1702))['catch'](handleError(_0xbcf0b1,null));};exports[_0xd305('0x41')]=function(_0x2ed57a,_0x1e8e9c){var _0x5712b4={'raw':![],'where':{'id':_0x2ed57a[_0xd305('0x42')]['id']}},_0x87311f={};_0x87311f[_0xd305('0x2d')]=_[_0xd305('0x30')](db[_0xd305('0x28')][_0xd305('0x29')]);_0x87311f[_0xd305('0x2f')]=_[_0xd305('0x30')](_0x2ed57a['query']);_0x87311f['filters']=_['intersection'](_0x87311f[_0xd305('0x2d')],_0x87311f[_0xd305('0x2f')]);_0x5712b4[_0xd305('0x34')]=_[_0xd305('0x32')](_0x87311f[_0xd305('0x2d')],qs[_0xd305('0x33')](_0x2ed57a[_0xd305('0x2f')]['fields']));_0x5712b4['attributes']=_0x5712b4[_0xd305('0x34')][_0xd305('0x35')]?_0x5712b4[_0xd305('0x34')]:_0x87311f['model'];if(_0x2ed57a[_0xd305('0x2f')]['includeAll']){_0x5712b4[_0xd305('0x3f')]=[{'all':!![]}];}_0x5712b4=_['merge']({},_0x5712b4,_0x2ed57a[_0xd305('0x3d')]);return db[_0xd305('0x28')][_0xd305('0x43')](_0x5712b4)[_0xd305('0x22')](handleEntityNotFound(_0x1e8e9c,null))[_0xd305('0x22')](respondWithResult(_0x1e8e9c,null))[_0xd305('0x44')](handleError(_0x1e8e9c,null));};exports['create']=function(_0x18d1a0,_0x1acbad){return db[_0xd305('0x28')][_0xd305('0x45')](_0x18d1a0[_0xd305('0x46')],{})['then'](respondWithResult(_0x1acbad,0xc9))[_0xd305('0x44')](handleError(_0x1acbad,null));};exports[_0xd305('0x47')]=function(_0x339310,_0x42f847){if(_0x339310[_0xd305('0x46')]['id']){delete _0x339310[_0xd305('0x46')]['id'];}return db[_0xd305('0x28')][_0xd305('0x43')]({'where':{'id':_0x339310['params']['id']}})['then'](handleEntityNotFound(_0x42f847,null))['then'](saveUpdates(_0x339310['body'],null))[_0xd305('0x22')](respondWithResult(_0x42f847,null))[_0xd305('0x44')](handleError(_0x42f847,null));};exports[_0xd305('0x48')]=function(_0x32fc6b,_0x4df0dc){return db[_0xd305('0x28')][_0xd305('0x43')]({'where':{'id':_0x32fc6b[_0xd305('0x42')]['id']}})[_0xd305('0x22')](handleEntityNotFound(_0x4df0dc,null))[_0xd305('0x22')](removeEntity(_0x4df0dc,null))['catch'](handleError(_0x4df0dc,null));};exports[_0xd305('0x49')]=function(_0x8986a0,_0x585a64,_0x8bbe71){return db[_0xd305('0x4a')]['find']({'where':{'id':_0x8986a0[_0xd305('0x42')]['id']}})[_0xd305('0x22')](handleEntityNotFound(_0x585a64,null))[_0xd305('0x22')](function(_0x6a9c60){if(_0x6a9c60){return _0x6a9c60[_0xd305('0x49')](_0x8986a0[_0xd305('0x46')]['ids'],_[_0xd305('0x4b')](_0x8986a0[_0xd305('0x46')],['ids','id'])||{});}})[_0xd305('0x22')](respondWithResult(_0x585a64,null))['catch'](handleError(_0x585a64,null));};exports[_0xd305('0x4c')]=function(_0x2bab03,_0x3678b8,_0x187ea1){var _0xf044ad={};var _0x3621f6={};var _0x46d604;var _0x28f820;return db[_0xd305('0x28')]['findOne']({'where':{'id':_0x2bab03[_0xd305('0x42')]['id']}})[_0xd305('0x22')](handleEntityNotFound(_0x3678b8,null))[_0xd305('0x22')](function(_0x48d1b6){if(_0x48d1b6){_0x46d604=_0x48d1b6;_0x3621f6['model']=_[_0xd305('0x30')](db[_0xd305('0x4a')][_0xd305('0x29')]);_0x3621f6['query']=_[_0xd305('0x30')](_0x2bab03[_0xd305('0x2f')]);_0x3621f6[_0xd305('0x31')]=_[_0xd305('0x32')](_0x3621f6[_0xd305('0x2d')],_0x3621f6[_0xd305('0x2f')]);_0xf044ad['attributes']=_[_0xd305('0x32')](_0x3621f6[_0xd305('0x2d')],qs[_0xd305('0x33')](_0x2bab03[_0xd305('0x2f')][_0xd305('0x33')]));_0xf044ad['attributes']=_0xf044ad[_0xd305('0x34')][_0xd305('0x35')]?_0xf044ad['attributes']:_0x3621f6['model'];_0xf044ad['order']=qs[_0xd305('0x38')](_0x2bab03[_0xd305('0x2f')][_0xd305('0x38')]);_0xf044ad['where']=qs[_0xd305('0x31')](_['pick'](_0x2bab03[_0xd305('0x2f')],_0x3621f6['filters']));if(_0x2bab03[_0xd305('0x2f')][_0xd305('0x3b')]){_0xf044ad['where']=_[_0xd305('0x3c')](_0xf044ad[_0xd305('0x39')],{'$or':_[_0xd305('0x2e')](_0xf044ad[_0xd305('0x34')],function(_0x1557e0){var _0x24cc3e={};_0x24cc3e[_0x1557e0]={'$like':'%'+_0x2bab03[_0xd305('0x2f')][_0xd305('0x3b')]+'%'};return _0x24cc3e;})});}_0xf044ad=_[_0xd305('0x3c')]({},_0xf044ad,_0x2bab03[_0xd305('0x3d')]);return _0x46d604[_0xd305('0x4c')](_0xf044ad);}})[_0xd305('0x22')](function(_0x528b7d){if(_0x528b7d){_0x28f820=_0x528b7d[_0xd305('0x35')];if(!_0x2bab03['query'][_0xd305('0x36')](_0xd305('0x4d'))){_0xf044ad[_0xd305('0x1d')]=qs[_0xd305('0x1d')](_0x2bab03[_0xd305('0x2f')][_0xd305('0x1d')]);_0xf044ad[_0xd305('0x1a')]=qs[_0xd305('0x1a')](_0x2bab03[_0xd305('0x2f')][_0xd305('0x1a')]);}return _0x46d604['getConditions'](_0xf044ad);}})[_0xd305('0x22')](function(_0x8c007d){if(_0x8c007d){return _0x8c007d?{'count':_0x28f820,'rows':_0x8c007d}:null;}})[_0xd305('0x22')](respondWithResult(_0x3678b8,null))[_0xd305('0x44')](handleError(_0x3678b8,null));};exports['addActions']=function(_0x32fb5c,_0x5b1d26,_0x3d64cb){return db[_0xd305('0x4e')]['find']({'where':{'id':_0x32fb5c[_0xd305('0x42')]['id']}})['then'](handleEntityNotFound(_0x5b1d26,null))[_0xd305('0x22')](function(_0x4a94df){if(_0x4a94df){return _0x4a94df[_0xd305('0x4f')](_0x32fb5c[_0xd305('0x46')][_0xd305('0x50')],_[_0xd305('0x4b')](_0x32fb5c[_0xd305('0x46')],['ids','id'])||{});}})[_0xd305('0x22')](respondWithResult(_0x5b1d26,null))[_0xd305('0x44')](handleError(_0x5b1d26,null));};exports[_0xd305('0x51')]=function(_0x1d08fb,_0x22580c,_0x33bfee){var _0xff4232={};var _0x42f6ae={};var _0x30b566;var _0x58a2b0;return db['Automation'][_0xd305('0x52')]({'where':{'id':_0x1d08fb[_0xd305('0x42')]['id']}})[_0xd305('0x22')](handleEntityNotFound(_0x22580c,null))[_0xd305('0x22')](function(_0x19386d){if(_0x19386d){_0x30b566=_0x19386d;_0x42f6ae[_0xd305('0x2d')]=_[_0xd305('0x30')](db[_0xd305('0x4e')][_0xd305('0x29')]);_0x42f6ae[_0xd305('0x2f')]=_[_0xd305('0x30')](_0x1d08fb['query']);_0x42f6ae['filters']=_[_0xd305('0x32')](_0x42f6ae[_0xd305('0x2d')],_0x42f6ae[_0xd305('0x2f')]);_0xff4232[_0xd305('0x34')]=_[_0xd305('0x32')](_0x42f6ae[_0xd305('0x2d')],qs[_0xd305('0x33')](_0x1d08fb[_0xd305('0x2f')][_0xd305('0x33')]));_0xff4232[_0xd305('0x34')]=_0xff4232[_0xd305('0x34')][_0xd305('0x35')]?_0xff4232[_0xd305('0x34')]:_0x42f6ae[_0xd305('0x2d')];_0xff4232[_0xd305('0x37')]=qs['sort'](_0x1d08fb['query'][_0xd305('0x38')]);_0xff4232[_0xd305('0x39')]=qs[_0xd305('0x31')](_[_0xd305('0x53')](_0x1d08fb[_0xd305('0x2f')],_0x42f6ae['filters']));if(_0x1d08fb[_0xd305('0x2f')][_0xd305('0x3b')]){_0xff4232[_0xd305('0x39')]=_[_0xd305('0x3c')](_0xff4232[_0xd305('0x39')],{'$or':_['map'](_0xff4232[_0xd305('0x34')],function(_0x3b37fe){var _0x36cbf5={};_0x36cbf5[_0x3b37fe]={'$like':'%'+_0x1d08fb[_0xd305('0x2f')]['filter']+'%'};return _0x36cbf5;})});}_0xff4232=_['merge']({},_0xff4232,_0x1d08fb['options']);return _0x30b566[_0xd305('0x51')](_0xff4232);}})[_0xd305('0x22')](function(_0x177ba4){if(_0x177ba4){_0x58a2b0=_0x177ba4['length'];if(!_0x1d08fb[_0xd305('0x2f')][_0xd305('0x36')](_0xd305('0x4d'))){_0xff4232[_0xd305('0x1d')]=qs['limit'](_0x1d08fb[_0xd305('0x2f')][_0xd305('0x1d')]);_0xff4232['offset']=qs[_0xd305('0x1a')](_0x1d08fb['query'][_0xd305('0x1a')]);}return _0x30b566['getActions'](_0xff4232);}})[_0xd305('0x22')](function(_0x10f417){if(_0x10f417){return _0x10f417?{'count':_0x58a2b0,'rows':_0x10f417}:null;}})[_0xd305('0x22')](respondWithResult(_0x22580c,null))[_0xd305('0x44')](handleError(_0x22580c,null));};
\ No newline at end of file
diff --git a/server/api/automation/automation.model.js b/server/api/automation/automation.model.js
index 3e3cac0..8f41746 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 _0x2135=['tools_automations','lodash','util','../../config/logger','api','moment','bluebird','request-promise','rimraf','../../config/environment','./automation.attributes','define','Automation'];(function(_0x3d3ae9,_0x334c52){var _0x31b364=function(_0x6aa61c){while(--_0x6aa61c){_0x3d3ae9['push'](_0x3d3ae9['shift']());}};_0x31b364(++_0x334c52);}(_0x2135,0x11f));var _0x5213=function(_0x347a3c,_0x7ca6a7){_0x347a3c=_0x347a3c-0x0;var _0x4395b4=_0x2135[_0x347a3c];return _0x4395b4;};'use strict';var _=require(_0x5213('0x0'));var util=require(_0x5213('0x1'));var logger=require(_0x5213('0x2'))(_0x5213('0x3'));var moment=require(_0x5213('0x4'));var BPromise=require(_0x5213('0x5'));var rp=require(_0x5213('0x6'));var fs=require('fs');var path=require('path');var rimraf=require(_0x5213('0x7'));var config=require(_0x5213('0x8'));var attributes=require(_0x5213('0x9'));module['exports']=function(_0x3b86f9,_0x3ff830){return _0x3b86f9[_0x5213('0xa')](_0x5213('0xb'),attributes,{'tableName':_0x5213('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x46c5=['moment','bluebird','path','rimraf','../../config/environment','./automation.attributes','define','lodash','../../config/logger','api'];(function(_0x2b2856,_0x5a00af){var _0x167582=function(_0x2b4468){while(--_0x2b4468){_0x2b2856['push'](_0x2b2856['shift']());}};_0x167582(++_0x5a00af);}(_0x46c5,0x6b));var _0x546c=function(_0x5e9dd6,_0x5286b1){_0x5e9dd6=_0x5e9dd6-0x0;var _0x3266a7=_0x46c5[_0x5e9dd6];return _0x3266a7;};'use strict';var _=require(_0x546c('0x0'));var util=require('util');var logger=require(_0x546c('0x1'))(_0x546c('0x2'));var moment=require(_0x546c('0x3'));var BPromise=require(_0x546c('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x546c('0x5'));var rimraf=require(_0x546c('0x6'));var config=require(_0x546c('0x7'));var attributes=require(_0x546c('0x8'));module['exports']=function(_0x198979,_0x216ff1){return _0x198979[_0x546c('0x9')]('Automation',attributes,{'tableName':'tools_automations','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
diff --git a/server/api/automation/automation.rpc.js b/server/api/automation/automation.rpc.js
index 6d7610d..475dd76 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 _0xa958=['ioredis','../../mysqldb','../../config/utils','../../config/environment','jayson/promise','client','http','request','then','info','Automation,\x20%s,\x20%s','request\x20sent','Automation,\x20%s,\x20%s,\x20%s','error','message','lodash','moment','bluebird','randomstring'];(function(_0x27f972,_0x37dc34){var _0xd73923=function(_0x4ed563){while(--_0x4ed563){_0x27f972['push'](_0x27f972['shift']());}};_0xd73923(++_0x37dc34);}(_0xa958,0x94));var _0x8a95=function(_0x55f8b4,_0x43f30d){_0x55f8b4=_0x55f8b4-0x0;var _0x2475f9=_0xa958[_0x55f8b4];return _0x2475f9;};'use strict';var _=require(_0x8a95('0x0'));var util=require('util');var moment=require(_0x8a95('0x1'));var BPromise=require(_0x8a95('0x2'));var rs=require(_0x8a95('0x3'));var fs=require('fs');var Redis=require(_0x8a95('0x4'));var db=require(_0x8a95('0x5'))['db'];var utils=require(_0x8a95('0x6'));var logger=require('../../config/logger')('rpc');var config=require(_0x8a95('0x7'));var jayson=require(_0x8a95('0x8'));var client=jayson[_0x8a95('0x9')][_0x8a95('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x387db4,_0xdd54e1,_0x161f00){return new BPromise(function(_0x49287d,_0xe03b31){return client[_0x8a95('0xb')](_0x387db4,_0x161f00)[_0x8a95('0xc')](function(_0x240b22){logger[_0x8a95('0xd')](_0x8a95('0xe'),_0xdd54e1,_0x8a95('0xf'));logger['debug'](_0x8a95('0x10'),_0xdd54e1,_0x8a95('0xf'),JSON['stringify'](_0x240b22));if(_0x240b22[_0x8a95('0x11')]){if(_0x240b22['error']['code']===0x1f4){logger[_0x8a95('0x11')]('Automation,\x20%s,\x20%s',_0xdd54e1,_0x240b22[_0x8a95('0x11')][_0x8a95('0x12')]);return _0xe03b31(_0x240b22['error'][_0x8a95('0x12')]);}logger[_0x8a95('0x11')]('Automation,\x20%s,\x20%s',_0xdd54e1,_0x240b22[_0x8a95('0x11')][_0x8a95('0x12')]);return _0x49287d(_0x240b22[_0x8a95('0x11')][_0x8a95('0x12')]);}else{logger[_0x8a95('0xd')](_0x8a95('0xe'),_0xdd54e1,_0x8a95('0xf'));_0x49287d(_0x240b22['result'][_0x8a95('0x12')]);}})['catch'](function(_0x334b18){logger['error'](_0x8a95('0xe'),_0xdd54e1,_0x334b18);_0xe03b31(_0x334b18);});});}
\ No newline at end of file
+var _0x75b6=['result','catch','lodash','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','jayson/promise','http','request','then','info','Automation,\x20%s,\x20%s','request\x20sent','debug','Automation,\x20%s,\x20%s,\x20%s','stringify','error','code','message'];(function(_0x3d4b69,_0x36e918){var _0x2fde5e=function(_0x1a4e39){while(--_0x1a4e39){_0x3d4b69['push'](_0x3d4b69['shift']());}};_0x2fde5e(++_0x36e918);}(_0x75b6,0x1a4));var _0x675b=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x75b6[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0x675b('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0x675b('0x1'));var rs=require(_0x675b('0x2'));var fs=require('fs');var Redis=require(_0x675b('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x675b('0x4'));var logger=require(_0x675b('0x5'))(_0x675b('0x6'));var config=require('../../config/environment');var jayson=require(_0x675b('0x7'));var client=jayson['client'][_0x675b('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x3a7a7a,_0x3f34b8,_0x556239){return new BPromise(function(_0x1bff7d,_0x4f55d4){return client[_0x675b('0x9')](_0x3a7a7a,_0x556239)[_0x675b('0xa')](function(_0x24cf1c){logger[_0x675b('0xb')](_0x675b('0xc'),_0x3f34b8,_0x675b('0xd'));logger[_0x675b('0xe')](_0x675b('0xf'),_0x3f34b8,_0x675b('0xd'),JSON[_0x675b('0x10')](_0x24cf1c));if(_0x24cf1c['error']){if(_0x24cf1c[_0x675b('0x11')][_0x675b('0x12')]===0x1f4){logger[_0x675b('0x11')](_0x675b('0xc'),_0x3f34b8,_0x24cf1c['error']['message']);return _0x4f55d4(_0x24cf1c['error']['message']);}logger['error'](_0x675b('0xc'),_0x3f34b8,_0x24cf1c['error']['message']);return _0x1bff7d(_0x24cf1c[_0x675b('0x11')][_0x675b('0x13')]);}else{logger[_0x675b('0xb')](_0x675b('0xc'),_0x3f34b8,'request\x20sent');_0x1bff7d(_0x24cf1c[_0x675b('0x14')][_0x675b('0x13')]);}})[_0x675b('0x15')](function(_0x17c3fc){logger[_0x675b('0x11')](_0x675b('0xc'),_0x3f34b8,_0x17c3fc);_0x4f55d4(_0x17c3fc);});});}
\ No newline at end of file
diff --git a/server/api/automation/index.js b/server/api/automation/index.js
index 7dd3b64..abe443d 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 _0x58f4=['post','create','/:id/conditions','addConditions','addActions','/:id','update','destroy','exports','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./automation.controller','get','isAuthenticated','show','getConditions','/:id/actions','getActions'];(function(_0x557783,_0x16d8bb){var _0x728269=function(_0x10402b){while(--_0x10402b){_0x557783['push'](_0x557783['shift']());}};_0x728269(++_0x16d8bb);}(_0x58f4,0x1b2));var _0x458f=function(_0x8d8c0,_0xd3dd86){_0x8d8c0=_0x8d8c0-0x0;var _0xff1b13=_0x58f4[_0x8d8c0];return _0xff1b13;};'use strict';var multer=require('multer');var util=require(_0x458f('0x0'));var path=require(_0x458f('0x1'));var timeout=require(_0x458f('0x2'));var express=require(_0x458f('0x3'));var router=express[_0x458f('0x4')]();var fs_extra=require(_0x458f('0x5'));var auth=require(_0x458f('0x6'));var interaction=require(_0x458f('0x7'));var config=require(_0x458f('0x8'));var controller=require(_0x458f('0x9'));router[_0x458f('0xa')]('/',auth[_0x458f('0xb')](),controller['index']);router['get']('/:id',auth['isAuthenticated'](),controller[_0x458f('0xc')]);router[_0x458f('0xa')]('/:id/conditions',auth[_0x458f('0xb')](),controller[_0x458f('0xd')]);router[_0x458f('0xa')](_0x458f('0xe'),auth[_0x458f('0xb')](),controller[_0x458f('0xf')]);router[_0x458f('0x10')]('/',auth['isAuthenticated'](),controller[_0x458f('0x11')]);router[_0x458f('0x10')](_0x458f('0x12'),auth[_0x458f('0xb')](),controller[_0x458f('0x13')]);router[_0x458f('0x10')](_0x458f('0xe'),auth[_0x458f('0xb')](),controller[_0x458f('0x14')]);router['put'](_0x458f('0x15'),auth[_0x458f('0xb')](),controller[_0x458f('0x16')]);router['delete'](_0x458f('0x15'),auth['isAuthenticated'](),controller[_0x458f('0x17')]);module[_0x458f('0x18')]=router;
\ No newline at end of file
+var _0xb7cf=['show','/:id/conditions','getConditions','/:id/actions','getActions','create','post','addConditions','put','update','delete','destroy','exports','multer','util','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./automation.controller','get','isAuthenticated','index','/:id'];(function(_0x7097e8,_0x53e913){var _0x212772=function(_0x862906){while(--_0x862906){_0x7097e8['push'](_0x7097e8['shift']());}};_0x212772(++_0x53e913);}(_0xb7cf,0xca));var _0xfb7c=function(_0x18894b,_0xb20093){_0x18894b=_0x18894b-0x0;var _0x4b3230=_0xb7cf[_0x18894b];return _0x4b3230;};'use strict';var multer=require(_0xfb7c('0x0'));var util=require(_0xfb7c('0x1'));var path=require(_0xfb7c('0x2'));var timeout=require(_0xfb7c('0x3'));var express=require(_0xfb7c('0x4'));var router=express['Router']();var fs_extra=require(_0xfb7c('0x5'));var auth=require(_0xfb7c('0x6'));var interaction=require(_0xfb7c('0x7'));var config=require(_0xfb7c('0x8'));var controller=require(_0xfb7c('0x9'));router[_0xfb7c('0xa')]('/',auth[_0xfb7c('0xb')](),controller[_0xfb7c('0xc')]);router[_0xfb7c('0xa')](_0xfb7c('0xd'),auth[_0xfb7c('0xb')](),controller[_0xfb7c('0xe')]);router[_0xfb7c('0xa')](_0xfb7c('0xf'),auth['isAuthenticated'](),controller[_0xfb7c('0x10')]);router[_0xfb7c('0xa')](_0xfb7c('0x11'),auth['isAuthenticated'](),controller[_0xfb7c('0x12')]);router['post']('/',auth['isAuthenticated'](),controller[_0xfb7c('0x13')]);router[_0xfb7c('0x14')](_0xfb7c('0xf'),auth[_0xfb7c('0xb')](),controller[_0xfb7c('0x15')]);router[_0xfb7c('0x14')](_0xfb7c('0x11'),auth[_0xfb7c('0xb')](),controller['addActions']);router[_0xfb7c('0x16')](_0xfb7c('0xd'),auth['isAuthenticated'](),controller[_0xfb7c('0x17')]);router[_0xfb7c('0x18')](_0xfb7c('0xd'),auth[_0xfb7c('0xb')](),controller[_0xfb7c('0x19')]);module[_0xfb7c('0x1a')]=router;
\ No newline at end of file
diff --git a/server/api/campaign/campaign.attributes.js b/server/api/campaign/campaign.attributes.js
index 804218c..35832d3 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 _0xd0cd=['Max\x20200\x20calls.','Originate\x20Timeout\x20Seconds\x20(min:1,\x20max:999)','#Congestion\x20Retry\x20(min:1,\x20max:999)','Busy\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#NoAnswer\x20Retry\x20(min:1,\x20max:999)','NoAnswer\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Global\x20Max\x20Retry\x20(min:1,\x20max:999)','ENUM','never','onlyIfOpen','always','#AMD\x20Initial\x20Silence','#AMD\x20Greeting','#AMD\x20After\x20Greeting\x20Silence','#AMD\x20Total\x20Analysis\x20Time','#AMD\x20Min\x20Word\x20Length','#AMD\x20Between\x20Words\x20Silence','#AMD\x20Maximum\x20Number\x20Of\x20Words','#AMD\x20Silence\x20Threshold\x20(min:0,\x20max:32767)','#AMD\x20Maximum\x20Word\x20Length','DESC','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\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#AgentReject\x20Retry\x20(min:1,\x20max:999)','AgentReject\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','sequelize','exports','STRING','name','ivr','BOOLEAN','Active/Disactive\x20Campaign','INTEGER','UNSIGNED'];(function(_0x416cf3,_0x53bf9){var _0x32a97a=function(_0x457e79){while(--_0x457e79){_0x416cf3['push'](_0x416cf3['shift']());}};_0x32a97a(++_0x53bf9);}(_0xd0cd,0xe7));var _0xdd0c=function(_0xd6aad,_0x3fd78e){_0xd6aad=_0xd6aad-0x0;var _0x1109e6=_0xd0cd[_0xd6aad];return _0x1109e6;};'use strict';var Sequelize=require(_0xdd0c('0x0'));module[_0xdd0c('0x1')]={'name':{'type':Sequelize[_0xdd0c('0x2')],'unique':_0xdd0c('0x3'),'allowNull':![],'validate':{'is':/[A-Za-z0-9._\\+*!-]+/,'notEmpty':!![]}},'type':{'type':Sequelize['ENUM'](_0xdd0c('0x4')),'allowNull':![],'defaultValue':_0xdd0c('0x4')},'description':{'type':Sequelize[_0xdd0c('0x2')]},'active':{'type':Sequelize[_0xdd0c('0x5')],'defaultValue':0x0,'comment':_0xdd0c('0x6')},'limitCalls':{'type':Sequelize[_0xdd0c('0x7')](0x4)[_0xdd0c('0x8')],'defaultValue':0x1e,'validate':{'min':0x1,'max':0xc8},'comment':_0xdd0c('0x9')},'dialOriginateCallerIdName':{'type':Sequelize['STRING']},'dialOriginateCallerIdNumber':{'type':Sequelize['STRING']},'dialOriginateTimeout':{'type':Sequelize[_0xdd0c('0x7')](0x3)[_0xdd0c('0x8')],'defaultValue':0x1e,'validate':{'min':0x1,'max':0x3e7},'comment':_0xdd0c('0xa')},'dialCongestionMaxRetry':{'type':Sequelize['INTEGER'](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xdd0c('0xb')},'dialCongestionRetryFrequency':{'type':Sequelize[_0xdd0c('0x7')](0x5)[_0xdd0c('0x8')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'Congestion\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialBusyMaxRetry':{'type':Sequelize[_0xdd0c('0x7')](0x3)[_0xdd0c('0x8')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#Busy\x20Retry\x20(min:1,\x20max:999)'},'dialBusyRetryFrequency':{'type':Sequelize[_0xdd0c('0x7')](0x5)[_0xdd0c('0x8')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xdd0c('0xc')},'dialNoAnswerMaxRetry':{'type':Sequelize[_0xdd0c('0x7')](0x3)['UNSIGNED'],'defaultValue':0x3,'comment':_0xdd0c('0xd')},'dialNoAnswerRetryFrequency':{'type':Sequelize[_0xdd0c('0x7')](0x5)[_0xdd0c('0x8')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xdd0c('0xe')},'dialGlobalMaxRetry':{'type':Sequelize[_0xdd0c('0x7')](0x3)[_0xdd0c('0x8')],'validate':{'min':0x1,'max':0x3e7},'defaultValue':0x4,'comment':_0xdd0c('0xf')},'dialTimezone':{'type':Sequelize[_0xdd0c('0x2')],'defaultValue':null},'dialGlobalInterval':{'type':Sequelize[_0xdd0c('0x2')],'defaultValue':'07:00-22:00,*,*,*'},'dialCheckDuplicateType':{'type':Sequelize[_0xdd0c('0x10')]('always',_0xdd0c('0x11'),_0xdd0c('0x12')),'defaultValue':_0xdd0c('0x13')},'dialAMDActive':{'type':Sequelize[_0xdd0c('0x5')],'defaultValue':0x0,'comment':'Active/Disactive\x20AMD'},'dialAMDInitialSilence':{'type':Sequelize['INTEGER'](0x9)[_0xdd0c('0x8')],'defaultValue':0x9c4,'validate':{'min':0x0},'comment':_0xdd0c('0x14')},'dialAMDGreeting':{'type':Sequelize[_0xdd0c('0x7')](0x9)['UNSIGNED'],'defaultValue':0x5dc,'validate':{'min':0x0},'comment':_0xdd0c('0x15')},'dialAMDAfterGreetingSilence':{'type':Sequelize[_0xdd0c('0x7')](0x9)[_0xdd0c('0x8')],'defaultValue':0x320,'validate':{'min':0x0},'comment':_0xdd0c('0x16')},'dialAMDTotalAnalysisTime':{'type':Sequelize[_0xdd0c('0x7')](0x9)[_0xdd0c('0x8')],'defaultValue':0x1388,'validate':{'min':0x0},'comment':_0xdd0c('0x17')},'dialAMDMinWordLength':{'type':Sequelize[_0xdd0c('0x7')](0x9)[_0xdd0c('0x8')],'defaultValue':0x64,'validate':{'min':0x0},'comment':_0xdd0c('0x18')},'dialAMDBetweenWordsSilence':{'type':Sequelize[_0xdd0c('0x7')](0x9)[_0xdd0c('0x8')],'defaultValue':0x32,'validate':{'min':0x0},'comment':_0xdd0c('0x19')},'dialAMDMaximumNumberOfWords':{'type':Sequelize['INTEGER'](0x9)[_0xdd0c('0x8')],'defaultValue':0x3,'validate':{'min':0x0},'comment':_0xdd0c('0x1a')},'dialAMDSilenceThreshold':{'type':Sequelize['INTEGER'](0x5)['UNSIGNED'],'validate':{'min':0x0,'max':0x7fff},'defaultValue':0x100,'comment':_0xdd0c('0x1b')},'dialAMDMaximumWordLength':{'type':Sequelize['INTEGER'](0x9)[_0xdd0c('0x8')],'defaultValue':0x1388,'validate':{'min':0x0},'comment':_0xdd0c('0x1c')},'dialOrderByScheduledAt':{'type':Sequelize[_0xdd0c('0x10')]('DESC','ASC'),'defaultValue':_0xdd0c('0x1d')},'dialPrefix':{'type':Sequelize[_0xdd0c('0x2')],'defaultValue':null},'dialRandomLastDigitCallerIdNumber':{'type':Sequelize['INTEGER'](0x3)[_0xdd0c('0x8')],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':_0xdd0c('0x1e')},'dialCutDigit':{'type':Sequelize[_0xdd0c('0x7')](0x3)[_0xdd0c('0x8')],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':_0xdd0c('0x1f')},'dialNoSuchNumberMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0xdd0c('0x8')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xdd0c('0x20')},'dialNoSuchNumberRetryFrequency':{'type':Sequelize[_0xdd0c('0x7')](0x5)[_0xdd0c('0x8')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xdd0c('0x21')},'dialDropMaxRetry':{'type':Sequelize[_0xdd0c('0x7')](0x3)[_0xdd0c('0x8')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xdd0c('0x22')},'dialDropRetryFrequency':{'type':Sequelize[_0xdd0c('0x7')](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'Drop\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialAbandonedMaxRetry':{'type':Sequelize[_0xdd0c('0x7')](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xdd0c('0x23')},'dialAbandonedRetryFrequency':{'type':Sequelize[_0xdd0c('0x7')](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xdd0c('0x24')},'dialMachineMaxRetry':{'type':Sequelize['INTEGER'](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#Machine\x20Retry\x20(min:1,\x20max:999)'},'dialMachineRetryFrequency':{'type':Sequelize[_0xdd0c('0x7')](0x5)[_0xdd0c('0x8')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xdd0c('0x25')},'dialAgentRejectMaxRetry':{'type':Sequelize[_0xdd0c('0x7')](0x3)[_0xdd0c('0x8')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xdd0c('0x26')},'dialAgentRejectRetryFrequency':{'type':Sequelize[_0xdd0c('0x7')](0x5)[_0xdd0c('0x8')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xdd0c('0x27')}};
\ No newline at end of file
+var _0x18cb=['#AgentReject\x20Retry\x20(min:1,\x20max:999)','AgentReject\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','sequelize','exports','STRING','name','ENUM','ivr','BOOLEAN','Active/Disactive\x20Campaign','INTEGER','Max\x20200\x20calls.','UNSIGNED','Originate\x20Timeout\x20Seconds\x20(min:1,\x20max:999)','#Congestion\x20Retry\x20(min:1,\x20max:999)','Congestion\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#NoAnswer\x20Retry\x20(min:1,\x20max:999)','07:00-22:00,*,*,*','always','never','onlyIfOpen','Active/Disactive\x20AMD','#AMD\x20Initial\x20Silence','#AMD\x20Greeting','#AMD\x20Total\x20Analysis\x20Time','#AMD\x20Min\x20Word\x20Length','#AMD\x20Between\x20Words\x20Silence','#AMD\x20Maximum\x20Number\x20Of\x20Words','#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\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','Machine\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'];(function(_0x4b7869,_0x58b7ae){var _0x5546a0=function(_0x35caca){while(--_0x35caca){_0x4b7869['push'](_0x4b7869['shift']());}};_0x5546a0(++_0x58b7ae);}(_0x18cb,0xe6));var _0xb18c=function(_0x1970ea,_0x350f30){_0x1970ea=_0x1970ea-0x0;var _0x15b654=_0x18cb[_0x1970ea];return _0x15b654;};'use strict';var Sequelize=require(_0xb18c('0x0'));module[_0xb18c('0x1')]={'name':{'type':Sequelize[_0xb18c('0x2')],'unique':_0xb18c('0x3'),'allowNull':![],'validate':{'is':/[A-Za-z0-9._\\+*!-]+/,'notEmpty':!![]}},'type':{'type':Sequelize[_0xb18c('0x4')](_0xb18c('0x5')),'allowNull':![],'defaultValue':'ivr'},'description':{'type':Sequelize[_0xb18c('0x2')]},'active':{'type':Sequelize[_0xb18c('0x6')],'defaultValue':0x0,'comment':_0xb18c('0x7')},'limitCalls':{'type':Sequelize[_0xb18c('0x8')](0x4)['UNSIGNED'],'defaultValue':0x1e,'validate':{'min':0x1,'max':0xc8},'comment':_0xb18c('0x9')},'dialOriginateCallerIdName':{'type':Sequelize[_0xb18c('0x2')]},'dialOriginateCallerIdNumber':{'type':Sequelize[_0xb18c('0x2')]},'dialOriginateTimeout':{'type':Sequelize[_0xb18c('0x8')](0x3)[_0xb18c('0xa')],'defaultValue':0x1e,'validate':{'min':0x1,'max':0x3e7},'comment':_0xb18c('0xb')},'dialCongestionMaxRetry':{'type':Sequelize[_0xb18c('0x8')](0x3)[_0xb18c('0xa')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xb18c('0xc')},'dialCongestionRetryFrequency':{'type':Sequelize['INTEGER'](0x5)[_0xb18c('0xa')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xb18c('0xd')},'dialBusyMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0xb18c('0xa')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#Busy\x20Retry\x20(min:1,\x20max:999)'},'dialBusyRetryFrequency':{'type':Sequelize['INTEGER'](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'Busy\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialNoAnswerMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0xb18c('0xa')],'defaultValue':0x3,'comment':_0xb18c('0xe')},'dialNoAnswerRetryFrequency':{'type':Sequelize[_0xb18c('0x8')](0x5)[_0xb18c('0xa')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'NoAnswer\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialGlobalMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0xb18c('0xa')],'validate':{'min':0x1,'max':0x3e7},'defaultValue':0x4,'comment':'#Global\x20Max\x20Retry\x20(min:1,\x20max:999)'},'dialTimezone':{'type':Sequelize[_0xb18c('0x2')],'defaultValue':null},'dialGlobalInterval':{'type':Sequelize[_0xb18c('0x2')],'defaultValue':_0xb18c('0xf')},'dialCheckDuplicateType':{'type':Sequelize[_0xb18c('0x4')](_0xb18c('0x10'),_0xb18c('0x11'),_0xb18c('0x12')),'defaultValue':_0xb18c('0x10')},'dialAMDActive':{'type':Sequelize['BOOLEAN'],'defaultValue':0x0,'comment':_0xb18c('0x13')},'dialAMDInitialSilence':{'type':Sequelize[_0xb18c('0x8')](0x9)['UNSIGNED'],'defaultValue':0x9c4,'validate':{'min':0x0},'comment':_0xb18c('0x14')},'dialAMDGreeting':{'type':Sequelize['INTEGER'](0x9)[_0xb18c('0xa')],'defaultValue':0x5dc,'validate':{'min':0x0},'comment':_0xb18c('0x15')},'dialAMDAfterGreetingSilence':{'type':Sequelize[_0xb18c('0x8')](0x9)[_0xb18c('0xa')],'defaultValue':0x320,'validate':{'min':0x0},'comment':'#AMD\x20After\x20Greeting\x20Silence'},'dialAMDTotalAnalysisTime':{'type':Sequelize['INTEGER'](0x9)[_0xb18c('0xa')],'defaultValue':0x1388,'validate':{'min':0x0},'comment':_0xb18c('0x16')},'dialAMDMinWordLength':{'type':Sequelize[_0xb18c('0x8')](0x9)[_0xb18c('0xa')],'defaultValue':0x64,'validate':{'min':0x0},'comment':_0xb18c('0x17')},'dialAMDBetweenWordsSilence':{'type':Sequelize['INTEGER'](0x9)[_0xb18c('0xa')],'defaultValue':0x32,'validate':{'min':0x0},'comment':_0xb18c('0x18')},'dialAMDMaximumNumberOfWords':{'type':Sequelize[_0xb18c('0x8')](0x9)[_0xb18c('0xa')],'defaultValue':0x3,'validate':{'min':0x0},'comment':_0xb18c('0x19')},'dialAMDSilenceThreshold':{'type':Sequelize[_0xb18c('0x8')](0x5)[_0xb18c('0xa')],'validate':{'min':0x0,'max':0x7fff},'defaultValue':0x100,'comment':'#AMD\x20Silence\x20Threshold\x20(min:0,\x20max:32767)'},'dialAMDMaximumWordLength':{'type':Sequelize['INTEGER'](0x9)[_0xb18c('0xa')],'defaultValue':0x1388,'validate':{'min':0x0},'comment':_0xb18c('0x1a')},'dialOrderByScheduledAt':{'type':Sequelize['ENUM'](_0xb18c('0x1b'),_0xb18c('0x1c')),'defaultValue':_0xb18c('0x1b')},'dialPrefix':{'type':Sequelize[_0xb18c('0x2')],'defaultValue':null},'dialRandomLastDigitCallerIdNumber':{'type':Sequelize[_0xb18c('0x8')](0x3)[_0xb18c('0xa')],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':_0xb18c('0x1d')},'dialCutDigit':{'type':Sequelize[_0xb18c('0x8')](0x3)[_0xb18c('0xa')],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':_0xb18c('0x1e')},'dialNoSuchNumberMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0xb18c('0xa')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xb18c('0x1f')},'dialNoSuchNumberRetryFrequency':{'type':Sequelize[_0xb18c('0x8')](0x5)[_0xb18c('0xa')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xb18c('0x20')},'dialDropMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0xb18c('0xa')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xb18c('0x21')},'dialDropRetryFrequency':{'type':Sequelize[_0xb18c('0x8')](0x5)[_0xb18c('0xa')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'Drop\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialAbandonedMaxRetry':{'type':Sequelize[_0xb18c('0x8')](0x3)[_0xb18c('0xa')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#Abandoned\x20Retry\x20(min:1,\x20max:999)'},'dialAbandonedRetryFrequency':{'type':Sequelize['INTEGER'](0x5)[_0xb18c('0xa')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xb18c('0x22')},'dialMachineMaxRetry':{'type':Sequelize[_0xb18c('0x8')](0x3)[_0xb18c('0xa')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#Machine\x20Retry\x20(min:1,\x20max:999)'},'dialMachineRetryFrequency':{'type':Sequelize[_0xb18c('0x8')](0x5)[_0xb18c('0xa')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xb18c('0x23')},'dialAgentRejectMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0xb18c('0xa')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xb18c('0x24')},'dialAgentRejectRetryFrequency':{'type':Sequelize[_0xb18c('0x8')](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xb18c('0x25')}};
\ No newline at end of file
diff --git a/server/api/campaign/campaign.controller.js b/server/api/campaign/campaign.controller.js
index 4ca48e7..f9e9710 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 _0x7a4f=['VIRTUAL','options','includeAll','include','findAll','show','params','length','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','error','clone','omit','createdAt','updatedAt','catch','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','getHoppers','findOne','CmHopper','nolimit','CampaignId','filter','rows','getHopperHistories','CmHopperHistory','CmHopperFinal','getHopperBlacks','CmHopperBlack','getLists','CmList','addLists','format','YYYY-MM-DD\x20HH:mm:ss','ids','spread','dialCheckDuplicateType','insert','into','cm_hopper','fromQuery','scheduledAt','ContactId','select','phone','field','NOW()','ListId','toString','from','deletedAt\x20IS\x20NULL','CmListId','phone\x20IS\x20NOT\x20NULL','phone\x20NOT\x20IN\x20(?)','COALESCE(calleridnum,\x27\x27)','cm_hopper_final','CampaignId\x20=\x20?','onlyIfOpen','ListId\x20=\x20?','COALESCE(phone,\x27\x27)','cm_contacts','cm_hopper_additional_phones','cmHopperId','OrderBy','ci.item','ci.OrderBY','h.ContactId\x20=\x20ci.CmContactId','h.ListId\x20=\x20?','h.CampaignId=?','h.createdAt\x20=\x20?','push','sequelize','removeLists','getBlackLists','addBlackLists','all','removeBlackLists','rimraf','zip-dir','request-promise','moment','bluebird','mustache','path','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/environment','../../config/license/util','sendStatus','status','end','json','offset','undefined','count','limit','Content-Range','apply','reject','update','then','destroy','get','IvrCampaigns','UserProfileResource','stack','name','send','index','map','Campaign','rawAttributes','fieldName','model','query','keys','filters','intersection','attributes','fields','hasOwnProperty','order','sort','where','pick','merge','type'];(function(_0x454b10,_0x5a15a5){var _0x50252c=function(_0x5b7326){while(--_0x5b7326){_0x454b10['push'](_0x454b10['shift']());}};_0x50252c(++_0x5a15a5);}(_0x7a4f,0x17a));var _0xf7a4=function(_0x87239,_0x38c793){_0x87239=_0x87239-0x0;var _0x53af1e=_0x7a4f[_0x87239];return _0x53af1e;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xf7a4('0x0'));var zipdir=require(_0xf7a4('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0xf7a4('0x2'));var moment=require(_0xf7a4('0x3'));var BPromise=require(_0xf7a4('0x4'));var Mustache=require(_0xf7a4('0x5'));var util=require('util');var path=require(_0xf7a4('0x6'));var sox=require('sox');var csv=require(_0xf7a4('0x7'));var ejs=require(_0xf7a4('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xf7a4('0x9'));var squel=require(_0xf7a4('0xa'));var crypto=require(_0xf7a4('0xb'));var jsforce=require(_0xf7a4('0xc'));var deskjs=require(_0xf7a4('0xd'));var toCsv=require(_0xf7a4('0x7'));var querystring=require(_0xf7a4('0xe'));var Papa=require(_0xf7a4('0xf'));var Redis=require(_0xf7a4('0x10'));var authService=require(_0xf7a4('0x11'));var qs=require(_0xf7a4('0x12'));var as=require(_0xf7a4('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xf7a4('0x14'))(_0xf7a4('0x15'));var utils=require('../../config/utils');var config=require(_0xf7a4('0x16'));var licenseUtil=require(_0xf7a4('0x17'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x19a322,_0x204eb1){_0x204eb1=_0x204eb1||0xcc;return function(_0x10ec23){if(_0x10ec23){return _0x19a322[_0xf7a4('0x18')](_0x204eb1);}return _0x19a322[_0xf7a4('0x19')](_0x204eb1)[_0xf7a4('0x1a')]();};}function respondWithResult(_0x3b7d8c,_0x262e47){_0x262e47=_0x262e47||0xc8;return function(_0x3cca90){if(_0x3cca90){return _0x3b7d8c['status'](_0x262e47)[_0xf7a4('0x1b')](_0x3cca90);}};}function respondWithFilteredResult(_0x3fe552,_0x4cda4a){return function(_0x2a772c){if(_0x2a772c){var _0x4de2eb=typeof _0x4cda4a[_0xf7a4('0x1c')]===_0xf7a4('0x1d')&&typeof _0x4cda4a['limit']==='undefined';var _0x17e52f=_0x2a772c['count'];var _0x3d8f93=_0x4de2eb?0x0:_0x4cda4a['offset'];var _0xd2cd6f=_0x4de2eb?_0x2a772c[_0xf7a4('0x1e')]:_0x4cda4a[_0xf7a4('0x1c')]+_0x4cda4a[_0xf7a4('0x1f')];var _0x25a82a;if(_0xd2cd6f>=_0x17e52f){_0xd2cd6f=_0x17e52f;_0x25a82a=0xc8;}else{_0x25a82a=0xce;}_0x3fe552[_0xf7a4('0x19')](_0x25a82a);return _0x3fe552['set'](_0xf7a4('0x20'),_0x3d8f93+'-'+_0xd2cd6f+'/'+_0x17e52f)[_0xf7a4('0x1b')](_0x2a772c);}return null;};}function patchUpdates(_0x484677){return function(_0x42e04f){try{jsonpatch[_0xf7a4('0x21')](_0x42e04f,_0x484677,!![]);}catch(_0x4621b0){return BPromise[_0xf7a4('0x22')](_0x4621b0);}return _0x42e04f['save']();};}function saveUpdates(_0x3d757f,_0x5336bf){return function(_0x46cdac){if(_0x46cdac){return _0x46cdac[_0xf7a4('0x23')](_0x3d757f)[_0xf7a4('0x24')](function(_0x299eb7){return _0x299eb7;});}return null;};}function removeEntity(_0x2a36c6,_0x299a04){return function(_0x4be70d){if(_0x4be70d){return _0x4be70d[_0xf7a4('0x25')]()['then'](function(){var _0x340ba4=_0x4be70d[_0xf7a4('0x26')]({'plain':!![]});var _0x5e3298=_0xf7a4('0x27');return db[_0xf7a4('0x28')][_0xf7a4('0x25')]({'where':{'type':_0x5e3298,'resourceId':_0x340ba4['id']}})[_0xf7a4('0x24')](function(){return _0x4be70d;});})[_0xf7a4('0x24')](function(){_0x2a36c6[_0xf7a4('0x19')](0xcc)['end']();});}};}function handleEntityNotFound(_0x4cb135,_0x30225d){return function(_0x4984f5){if(!_0x4984f5){_0x4cb135['sendStatus'](0x194);}return _0x4984f5;};}function handleError(_0x1e242c,_0x5e8409){_0x5e8409=_0x5e8409||0x1f4;return function(_0xeef2d5){logger['error'](_0xeef2d5[_0xf7a4('0x29')]);if(_0xeef2d5[_0xf7a4('0x2a')]){delete _0xeef2d5['name'];}_0x1e242c[_0xf7a4('0x19')](_0x5e8409)[_0xf7a4('0x2b')](_0xeef2d5);};}exports[_0xf7a4('0x2c')]=function(_0x164c7e,_0x5aa202){var _0xe87462={},_0x1eea08={},_0x45c1ae={'count':0x0,'rows':[]};var _0x211849=_[_0xf7a4('0x2d')](db[_0xf7a4('0x2e')][_0xf7a4('0x2f')],function(_0x2746a5){return{'name':_0x2746a5[_0xf7a4('0x30')],'type':_0x2746a5['type']['key']};});_0x1eea08[_0xf7a4('0x31')]=_[_0xf7a4('0x2d')](_0x211849,_0xf7a4('0x2a'));_0x1eea08[_0xf7a4('0x32')]=_[_0xf7a4('0x33')](_0x164c7e[_0xf7a4('0x32')]);_0x1eea08[_0xf7a4('0x34')]=_[_0xf7a4('0x35')](_0x1eea08[_0xf7a4('0x31')],_0x1eea08[_0xf7a4('0x32')]);_0xe87462[_0xf7a4('0x36')]=_['intersection'](_0x1eea08[_0xf7a4('0x31')],qs[_0xf7a4('0x37')](_0x164c7e[_0xf7a4('0x32')][_0xf7a4('0x37')]));_0xe87462[_0xf7a4('0x36')]=_0xe87462[_0xf7a4('0x36')]['length']?_0xe87462[_0xf7a4('0x36')]:_0x1eea08[_0xf7a4('0x31')];if(!_0x164c7e[_0xf7a4('0x32')][_0xf7a4('0x38')]('nolimit')){_0xe87462[_0xf7a4('0x1f')]=qs[_0xf7a4('0x1f')](_0x164c7e[_0xf7a4('0x32')][_0xf7a4('0x1f')]);_0xe87462[_0xf7a4('0x1c')]=qs[_0xf7a4('0x1c')](_0x164c7e['query']['offset']);}_0xe87462[_0xf7a4('0x39')]=qs['sort'](_0x164c7e[_0xf7a4('0x32')][_0xf7a4('0x3a')]);_0xe87462[_0xf7a4('0x3b')]=qs[_0xf7a4('0x34')](_[_0xf7a4('0x3c')](_0x164c7e[_0xf7a4('0x32')],_0x1eea08[_0xf7a4('0x34')]),_0x211849);if(_0x164c7e[_0xf7a4('0x32')]['filter']){_0xe87462[_0xf7a4('0x3b')]=_[_0xf7a4('0x3d')](_0xe87462['where'],{'$or':_['map'](_0x211849,function(_0x2eb70c){if(_0x2eb70c[_0xf7a4('0x3e')]!==_0xf7a4('0x3f')){var _0x8664b9={};_0x8664b9[_0x2eb70c['name']]={'$like':'%'+_0x164c7e[_0xf7a4('0x32')]['filter']+'%'};return _0x8664b9;}})});}_0xe87462=_[_0xf7a4('0x3d')]({},_0xe87462,_0x164c7e[_0xf7a4('0x40')]);var _0x14012f={'where':_0xe87462[_0xf7a4('0x3b')]};return db['Campaign'][_0xf7a4('0x1e')](_0x14012f)[_0xf7a4('0x24')](function(_0x316bdc){_0x45c1ae['count']=_0x316bdc;if(_0x164c7e[_0xf7a4('0x32')][_0xf7a4('0x41')]){_0xe87462[_0xf7a4('0x42')]=[{'all':!![]}];}return db['Campaign'][_0xf7a4('0x43')](_0xe87462);})[_0xf7a4('0x24')](function(_0x33ba2f){_0x45c1ae['rows']=_0x33ba2f;return _0x45c1ae;})[_0xf7a4('0x24')](respondWithFilteredResult(_0x5aa202,_0xe87462))['catch'](handleError(_0x5aa202,null));};exports[_0xf7a4('0x44')]=function(_0xdb0d63,_0xdcbb01){var _0x1317de={'raw':![],'where':{'id':_0xdb0d63[_0xf7a4('0x45')]['id']}},_0x3d3a00={};_0x3d3a00[_0xf7a4('0x31')]=_[_0xf7a4('0x33')](db[_0xf7a4('0x2e')][_0xf7a4('0x2f')]);_0x3d3a00['query']=_[_0xf7a4('0x33')](_0xdb0d63[_0xf7a4('0x32')]);_0x3d3a00[_0xf7a4('0x34')]=_['intersection'](_0x3d3a00[_0xf7a4('0x31')],_0x3d3a00['query']);_0x1317de[_0xf7a4('0x36')]=_['intersection'](_0x3d3a00[_0xf7a4('0x31')],qs[_0xf7a4('0x37')](_0xdb0d63[_0xf7a4('0x32')][_0xf7a4('0x37')]));_0x1317de[_0xf7a4('0x36')]=_0x1317de['attributes'][_0xf7a4('0x46')]?_0x1317de[_0xf7a4('0x36')]:_0x3d3a00[_0xf7a4('0x31')];if(_0xdb0d63[_0xf7a4('0x32')][_0xf7a4('0x41')]){_0x1317de[_0xf7a4('0x42')]=[{'all':!![]}];}_0x1317de=_[_0xf7a4('0x3d')]({},_0x1317de,_0xdb0d63[_0xf7a4('0x40')]);return db[_0xf7a4('0x2e')][_0xf7a4('0x47')](_0x1317de)[_0xf7a4('0x24')](handleEntityNotFound(_0xdcbb01,null))[_0xf7a4('0x24')](respondWithResult(_0xdcbb01,null))['catch'](handleError(_0xdcbb01,null));};exports[_0xf7a4('0x48')]=function(_0x1c8a8c,_0x2c3159){return db['Campaign'][_0xf7a4('0x48')](_0x1c8a8c[_0xf7a4('0x49')],{})['then'](function(_0x36928f){var _0x55b752=_0x1c8a8c[_0xf7a4('0x4a')][_0xf7a4('0x26')]({'plain':!![]});if(!_0x55b752)throw new Error(_0xf7a4('0x4b'));if(_0x55b752[_0xf7a4('0x4c')]===_0xf7a4('0x4a')){var _0x2b4d9e=_0x36928f['get']({'plain':!![]});var _0x5407e6=_0xf7a4('0x27');return db[_0xf7a4('0x4d')][_0xf7a4('0x47')]({'where':{'name':_0x5407e6,'userProfileId':_0x55b752[_0xf7a4('0x4e')]},'raw':!![]})['then'](function(_0x4134c3){if(_0x4134c3&&_0x4134c3[_0xf7a4('0x4f')]===0x0){return db[_0xf7a4('0x28')][_0xf7a4('0x48')]({'name':_0x2b4d9e[_0xf7a4('0x2a')],'resourceId':_0x2b4d9e['id'],'type':_0x4134c3[_0xf7a4('0x2a')],'sectionId':_0x4134c3['id']},{})[_0xf7a4('0x24')](function(){return _0x36928f;});}else{return _0x36928f;}})['catch'](function(_0x3dee42){logger[_0xf7a4('0x50')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x3dee42);throw _0x3dee42;});}return _0x36928f;})[_0xf7a4('0x24')](respondWithResult(_0x2c3159,0xc9))['catch'](handleError(_0x2c3159,null));};exports[_0xf7a4('0x51')]=function(_0x3d7346,_0x1f40dd){var _0x3727b8={'where':{'id':_0x3d7346[_0xf7a4('0x45')]['id']}},_0x5c1ce5={};_0x5c1ce5['model']=_[_0xf7a4('0x33')](db['Campaign']['rawAttributes']);_0x3727b8[_0xf7a4('0x36')]=_[_0xf7a4('0x35')](_0x5c1ce5['model'],qs[_0xf7a4('0x37')](_0x3d7346[_0xf7a4('0x32')][_0xf7a4('0x37')]));_0x3727b8[_0xf7a4('0x36')]=_0x3727b8[_0xf7a4('0x36')][_0xf7a4('0x46')]?_0x3727b8[_0xf7a4('0x36')]:_0x5c1ce5[_0xf7a4('0x31')];if(_0x3d7346[_0xf7a4('0x32')]['includeAll']){_0x3727b8[_0xf7a4('0x42')]=[{'all':!![]}];}_0x3727b8=_[_0xf7a4('0x3d')]({},_0x3727b8,_0x3d7346[_0xf7a4('0x40')]);return db[_0xf7a4('0x2e')][_0xf7a4('0x47')](_0x3727b8)['then'](handleEntityNotFound(_0x1f40dd,null))[_0xf7a4('0x24')](function(_0x4fb4df){if(_0x4fb4df){var _0x2d5c8e=_0x4fb4df[_0xf7a4('0x26')]({'plain':!![]});_0x2d5c8e=qs[_0xf7a4('0x52')](_0x2d5c8e,['id','createdAt','updatedAt']);_0x3d7346[_0xf7a4('0x49')]=_['omit'](_0x3d7346[_0xf7a4('0x49')],['id',_0xf7a4('0x53'),_0xf7a4('0x54')]);return db[_0xf7a4('0x2e')][_0xf7a4('0x48')](_[_0xf7a4('0x3d')](_0x2d5c8e,_0x3d7346['body']),{'include':_0x3d7346[_0xf7a4('0x32')][_0xf7a4('0x41')]?[{'all':!![]}]:undefined})[_0xf7a4('0x24')](function(_0x2e7ff7){var _0x11e3a6=_0x3d7346['user'][_0xf7a4('0x26')]({'plain':!![]});if(!_0x11e3a6)throw new Error(_0xf7a4('0x4b'));if(_0x11e3a6[_0xf7a4('0x4c')]===_0xf7a4('0x4a')){var _0xe83e1=_0x2e7ff7[_0xf7a4('0x26')]({'plain':!![]});var _0x233d83=_0xf7a4('0x27');return db[_0xf7a4('0x4d')][_0xf7a4('0x47')]({'where':{'name':_0x233d83,'userProfileId':_0x11e3a6[_0xf7a4('0x4e')]},'raw':!![]})[_0xf7a4('0x24')](function(_0x18cd5a){if(_0x18cd5a&&_0x18cd5a[_0xf7a4('0x4f')]===0x0){return db[_0xf7a4('0x28')]['create']({'name':_0xe83e1[_0xf7a4('0x2a')],'resourceId':_0xe83e1['id'],'type':_0x18cd5a[_0xf7a4('0x2a')],'sectionId':_0x18cd5a['id']},{})['then'](function(){return _0x2e7ff7;});}else{return _0x2e7ff7;}})[_0xf7a4('0x55')](function(_0x316341){logger[_0xf7a4('0x50')](_0xf7a4('0x56'),_0x316341);throw _0x316341;});}return _0x2e7ff7;});}})[_0xf7a4('0x24')](respondWithResult(_0x1f40dd,0xc9))[_0xf7a4('0x55')](handleError(_0x1f40dd,null));};exports[_0xf7a4('0x23')]=function(_0x14a119,_0x6299cd){if(_0x14a119['body']['id']){delete _0x14a119[_0xf7a4('0x49')]['id'];}return db['Campaign'][_0xf7a4('0x47')]({'where':{'id':_0x14a119[_0xf7a4('0x45')]['id']}})[_0xf7a4('0x24')](handleEntityNotFound(_0x6299cd,null))[_0xf7a4('0x24')](saveUpdates(_0x14a119[_0xf7a4('0x49')],null))[_0xf7a4('0x24')](respondWithResult(_0x6299cd,null))[_0xf7a4('0x55')](handleError(_0x6299cd,null));};exports[_0xf7a4('0x25')]=function(_0x33baa7,_0x573814){return db['Campaign']['find']({'where':{'id':_0x33baa7[_0xf7a4('0x45')]['id']}})[_0xf7a4('0x24')](handleEntityNotFound(_0x573814,null))['then'](removeEntity(_0x573814,null))[_0xf7a4('0x55')](handleError(_0x573814,null));};exports[_0xf7a4('0x57')]=function(_0xf39857,_0x170143,_0xfa2968){var _0x4d9827={'raw':!![],'where':{}};var _0x58e263={};var _0x5e0fee={'count':0x0,'rows':[]};return db[_0xf7a4('0x2e')][_0xf7a4('0x58')]({'where':{'id':_0xf39857['params']['id']}})[_0xf7a4('0x24')](handleEntityNotFound(_0x170143,null))[_0xf7a4('0x24')](function(_0x5aa328){if(_0x5aa328){_0x58e263[_0xf7a4('0x31')]=_[_0xf7a4('0x33')](db[_0xf7a4('0x59')][_0xf7a4('0x2f')]);_0x58e263[_0xf7a4('0x32')]=_[_0xf7a4('0x33')](_0xf39857['query']);_0x58e263[_0xf7a4('0x34')]=_[_0xf7a4('0x35')](_0x58e263[_0xf7a4('0x31')],_0x58e263['query']);_0x4d9827[_0xf7a4('0x36')]=_[_0xf7a4('0x35')](_0x58e263[_0xf7a4('0x31')],qs['fields'](_0xf39857[_0xf7a4('0x32')][_0xf7a4('0x37')]));_0x4d9827[_0xf7a4('0x36')]=_0x4d9827[_0xf7a4('0x36')][_0xf7a4('0x46')]?_0x4d9827[_0xf7a4('0x36')]:_0x58e263['model'];if(!_0xf39857[_0xf7a4('0x32')][_0xf7a4('0x38')](_0xf7a4('0x5a'))){_0x4d9827['limit']=qs[_0xf7a4('0x1f')](_0xf39857['query'][_0xf7a4('0x1f')]);_0x4d9827['offset']=qs['offset'](_0xf39857[_0xf7a4('0x32')][_0xf7a4('0x1c')]);}_0x4d9827['order']=qs[_0xf7a4('0x3a')](_0xf39857[_0xf7a4('0x32')][_0xf7a4('0x3a')]);_0x4d9827[_0xf7a4('0x3b')]=qs['filters'](_[_0xf7a4('0x3c')](_0xf39857['query'],_0x58e263[_0xf7a4('0x34')]));_0x4d9827[_0xf7a4('0x3b')][_0xf7a4('0x5b')]=_0x5aa328['id'];if(_0xf39857['query'][_0xf7a4('0x5c')]){_0x4d9827[_0xf7a4('0x3b')]=_[_0xf7a4('0x3d')](_0x4d9827[_0xf7a4('0x3b')],{'$or':_[_0xf7a4('0x2d')](_0x4d9827['attributes'],function(_0x594ac8){var _0x248f15={};_0x248f15[_0x594ac8]={'$like':'%'+_0xf39857[_0xf7a4('0x32')][_0xf7a4('0x5c')]+'%'};return _0x248f15;})});}_0x4d9827=_[_0xf7a4('0x3d')]({},_0x4d9827,_0xf39857['options']);return db[_0xf7a4('0x59')][_0xf7a4('0x1e')]({'where':_0x4d9827[_0xf7a4('0x3b')]})[_0xf7a4('0x24')](function(_0x519e39){_0x5e0fee[_0xf7a4('0x1e')]=_0x519e39;if(_0xf39857[_0xf7a4('0x32')]['includeAll']){_0x4d9827[_0xf7a4('0x42')]=[{'all':!![]}];}return db[_0xf7a4('0x59')]['findAll'](_0x4d9827);})[_0xf7a4('0x24')](function(_0x42943e){_0x5e0fee[_0xf7a4('0x5d')]=_0x42943e;return _0x5e0fee;});}})[_0xf7a4('0x24')](respondWithFilteredResult(_0x170143,_0x4d9827))[_0xf7a4('0x55')](handleError(_0x170143,null));};exports[_0xf7a4('0x5e')]=function(_0x3873b9,_0x3b6911,_0x2eb988){var _0x11efc4={'raw':!![],'where':{}};var _0x14c964={};var _0x5bb70e={'count':0x0,'rows':[]};return db['Campaign'][_0xf7a4('0x58')]({'where':{'id':_0x3873b9[_0xf7a4('0x45')]['id']}})['then'](handleEntityNotFound(_0x3b6911,null))['then'](function(_0x197d2f){if(_0x197d2f){_0x14c964[_0xf7a4('0x31')]=_[_0xf7a4('0x33')](db[_0xf7a4('0x5f')][_0xf7a4('0x2f')]);_0x14c964[_0xf7a4('0x32')]=_[_0xf7a4('0x33')](_0x3873b9[_0xf7a4('0x32')]);_0x14c964[_0xf7a4('0x34')]=_[_0xf7a4('0x35')](_0x14c964[_0xf7a4('0x31')],_0x14c964['query']);_0x11efc4[_0xf7a4('0x36')]=_[_0xf7a4('0x35')](_0x14c964[_0xf7a4('0x31')],qs['fields'](_0x3873b9['query']['fields']));_0x11efc4[_0xf7a4('0x36')]=_0x11efc4[_0xf7a4('0x36')][_0xf7a4('0x46')]?_0x11efc4[_0xf7a4('0x36')]:_0x14c964[_0xf7a4('0x31')];if(!_0x3873b9[_0xf7a4('0x32')][_0xf7a4('0x38')](_0xf7a4('0x5a'))){_0x11efc4[_0xf7a4('0x1f')]=qs[_0xf7a4('0x1f')](_0x3873b9[_0xf7a4('0x32')]['limit']);_0x11efc4[_0xf7a4('0x1c')]=qs[_0xf7a4('0x1c')](_0x3873b9[_0xf7a4('0x32')][_0xf7a4('0x1c')]);}_0x11efc4['order']=qs[_0xf7a4('0x3a')](_0x3873b9['query']['sort']);_0x11efc4[_0xf7a4('0x3b')]=qs['filters'](_[_0xf7a4('0x3c')](_0x3873b9[_0xf7a4('0x32')],_0x14c964[_0xf7a4('0x34')]));_0x11efc4['where'][_0xf7a4('0x5b')]=_0x197d2f['id'];if(_0x3873b9[_0xf7a4('0x32')][_0xf7a4('0x5c')]){_0x11efc4[_0xf7a4('0x3b')]=_[_0xf7a4('0x3d')](_0x11efc4['where'],{'$or':_['map'](_0x11efc4[_0xf7a4('0x36')],function(_0x44e080){var _0x1be72c={};_0x1be72c[_0x44e080]={'$like':'%'+_0x3873b9['query'][_0xf7a4('0x5c')]+'%'};return _0x1be72c;})});}_0x11efc4=_[_0xf7a4('0x3d')]({},_0x11efc4,_0x3873b9['options']);return db['CmHopperHistory']['count']({'where':_0x11efc4[_0xf7a4('0x3b')]})[_0xf7a4('0x24')](function(_0x4e91c5){_0x5bb70e['count']=_0x4e91c5;if(_0x3873b9[_0xf7a4('0x32')][_0xf7a4('0x41')]){_0x11efc4[_0xf7a4('0x42')]=[{'all':!![]}];}return db[_0xf7a4('0x5f')][_0xf7a4('0x43')](_0x11efc4);})[_0xf7a4('0x24')](function(_0xd811f7){_0x5bb70e[_0xf7a4('0x5d')]=_0xd811f7;return _0x5bb70e;});}})['then'](respondWithFilteredResult(_0x3b6911,_0x11efc4))[_0xf7a4('0x55')](handleError(_0x3b6911,null));};exports['getHopperFinals']=function(_0x99f87a,_0x1a5ed2,_0x1beb94){var _0x46a706={'raw':!![],'where':{}};var _0xb185f0={};var _0x28da97={'count':0x0,'rows':[]};return db[_0xf7a4('0x2e')][_0xf7a4('0x58')]({'where':{'id':_0x99f87a[_0xf7a4('0x45')]['id']}})[_0xf7a4('0x24')](handleEntityNotFound(_0x1a5ed2,null))['then'](function(_0x41ac0e){if(_0x41ac0e){_0xb185f0[_0xf7a4('0x31')]=_[_0xf7a4('0x33')](db[_0xf7a4('0x60')][_0xf7a4('0x2f')]);_0xb185f0[_0xf7a4('0x32')]=_[_0xf7a4('0x33')](_0x99f87a['query']);_0xb185f0['filters']=_['intersection'](_0xb185f0[_0xf7a4('0x31')],_0xb185f0[_0xf7a4('0x32')]);_0x46a706[_0xf7a4('0x36')]=_['intersection'](_0xb185f0['model'],qs[_0xf7a4('0x37')](_0x99f87a[_0xf7a4('0x32')][_0xf7a4('0x37')]));_0x46a706[_0xf7a4('0x36')]=_0x46a706['attributes'][_0xf7a4('0x46')]?_0x46a706[_0xf7a4('0x36')]:_0xb185f0['model'];if(!_0x99f87a[_0xf7a4('0x32')]['hasOwnProperty']('nolimit')){_0x46a706['limit']=qs[_0xf7a4('0x1f')](_0x99f87a[_0xf7a4('0x32')][_0xf7a4('0x1f')]);_0x46a706[_0xf7a4('0x1c')]=qs[_0xf7a4('0x1c')](_0x99f87a[_0xf7a4('0x32')][_0xf7a4('0x1c')]);}_0x46a706[_0xf7a4('0x39')]=qs['sort'](_0x99f87a[_0xf7a4('0x32')][_0xf7a4('0x3a')]);_0x46a706[_0xf7a4('0x3b')]=qs[_0xf7a4('0x34')](_[_0xf7a4('0x3c')](_0x99f87a['query'],_0xb185f0[_0xf7a4('0x34')]));_0x46a706[_0xf7a4('0x3b')][_0xf7a4('0x5b')]=_0x41ac0e['id'];if(_0x99f87a[_0xf7a4('0x32')][_0xf7a4('0x5c')]){_0x46a706[_0xf7a4('0x3b')]=_[_0xf7a4('0x3d')](_0x46a706['where'],{'$or':_[_0xf7a4('0x2d')](_0x46a706[_0xf7a4('0x36')],function(_0x4ab676){var _0x5c0f30={};_0x5c0f30[_0x4ab676]={'$like':'%'+_0x99f87a[_0xf7a4('0x32')][_0xf7a4('0x5c')]+'%'};return _0x5c0f30;})});}_0x46a706=_[_0xf7a4('0x3d')]({},_0x46a706,_0x99f87a[_0xf7a4('0x40')]);return db['CmHopperFinal'][_0xf7a4('0x1e')]({'where':_0x46a706['where']})['then'](function(_0x55e89c){_0x28da97[_0xf7a4('0x1e')]=_0x55e89c;if(_0x99f87a[_0xf7a4('0x32')][_0xf7a4('0x41')]){_0x46a706[_0xf7a4('0x42')]=[{'all':!![]}];}return db[_0xf7a4('0x60')][_0xf7a4('0x43')](_0x46a706);})[_0xf7a4('0x24')](function(_0x2506a9){_0x28da97[_0xf7a4('0x5d')]=_0x2506a9;return _0x28da97;});}})[_0xf7a4('0x24')](respondWithFilteredResult(_0x1a5ed2,_0x46a706))[_0xf7a4('0x55')](handleError(_0x1a5ed2,null));};exports[_0xf7a4('0x61')]=function(_0x3def56,_0x5af253,_0x1a988f){var _0x56433f={'raw':!![],'where':{}};var _0x103ca4={};var _0x83b95a={'count':0x0,'rows':[]};return db[_0xf7a4('0x2e')][_0xf7a4('0x58')]({'where':{'id':_0x3def56[_0xf7a4('0x45')]['id']}})[_0xf7a4('0x24')](handleEntityNotFound(_0x5af253,null))['then'](function(_0x5ea086){if(_0x5ea086){_0x103ca4['model']=_[_0xf7a4('0x33')](db[_0xf7a4('0x62')][_0xf7a4('0x2f')]);_0x103ca4['query']=_[_0xf7a4('0x33')](_0x3def56['query']);_0x103ca4[_0xf7a4('0x34')]=_[_0xf7a4('0x35')](_0x103ca4[_0xf7a4('0x31')],_0x103ca4[_0xf7a4('0x32')]);_0x56433f[_0xf7a4('0x36')]=_[_0xf7a4('0x35')](_0x103ca4[_0xf7a4('0x31')],qs['fields'](_0x3def56['query'][_0xf7a4('0x37')]));_0x56433f[_0xf7a4('0x36')]=_0x56433f[_0xf7a4('0x36')]['length']?_0x56433f[_0xf7a4('0x36')]:_0x103ca4[_0xf7a4('0x31')];if(!_0x3def56[_0xf7a4('0x32')][_0xf7a4('0x38')](_0xf7a4('0x5a'))){_0x56433f[_0xf7a4('0x1f')]=qs[_0xf7a4('0x1f')](_0x3def56['query']['limit']);_0x56433f[_0xf7a4('0x1c')]=qs[_0xf7a4('0x1c')](_0x3def56[_0xf7a4('0x32')][_0xf7a4('0x1c')]);}_0x56433f[_0xf7a4('0x39')]=qs[_0xf7a4('0x3a')](_0x3def56[_0xf7a4('0x32')][_0xf7a4('0x3a')]);_0x56433f[_0xf7a4('0x3b')]=qs[_0xf7a4('0x34')](_[_0xf7a4('0x3c')](_0x3def56[_0xf7a4('0x32')],_0x103ca4[_0xf7a4('0x34')]));_0x56433f[_0xf7a4('0x3b')][_0xf7a4('0x5b')]=_0x5ea086['id'];if(_0x3def56[_0xf7a4('0x32')]['filter']){_0x56433f[_0xf7a4('0x3b')]=_[_0xf7a4('0x3d')](_0x56433f[_0xf7a4('0x3b')],{'$or':_[_0xf7a4('0x2d')](_0x56433f[_0xf7a4('0x36')],function(_0x413335){var _0x349139={};_0x349139[_0x413335]={'$like':'%'+_0x3def56[_0xf7a4('0x32')][_0xf7a4('0x5c')]+'%'};return _0x349139;})});}_0x56433f=_[_0xf7a4('0x3d')]({},_0x56433f,_0x3def56['options']);return db[_0xf7a4('0x62')][_0xf7a4('0x1e')]({'where':_0x56433f[_0xf7a4('0x3b')]})[_0xf7a4('0x24')](function(_0x3e8a07){_0x83b95a[_0xf7a4('0x1e')]=_0x3e8a07;if(_0x3def56[_0xf7a4('0x32')][_0xf7a4('0x41')]){_0x56433f[_0xf7a4('0x42')]=[{'all':!![]}];}return db[_0xf7a4('0x62')]['findAll'](_0x56433f);})[_0xf7a4('0x24')](function(_0x4f144b){_0x83b95a['rows']=_0x4f144b;return _0x83b95a;});}})[_0xf7a4('0x24')](respondWithFilteredResult(_0x5af253,_0x56433f))[_0xf7a4('0x55')](handleError(_0x5af253,null));};exports[_0xf7a4('0x63')]=function(_0x1165bf,_0x407598,_0x518b19){var _0x920e99={};var _0x17dcb7={};var _0x15c071;var _0x96644b;return db[_0xf7a4('0x2e')]['findOne']({'where':{'id':_0x1165bf[_0xf7a4('0x45')]['id']}})[_0xf7a4('0x24')](handleEntityNotFound(_0x407598,null))['then'](function(_0xda6941){if(_0xda6941){_0x15c071=_0xda6941;_0x17dcb7[_0xf7a4('0x31')]=_['keys'](db[_0xf7a4('0x64')][_0xf7a4('0x2f')]);_0x17dcb7['query']=_[_0xf7a4('0x33')](_0x1165bf[_0xf7a4('0x32')]);_0x17dcb7[_0xf7a4('0x34')]=_[_0xf7a4('0x35')](_0x17dcb7[_0xf7a4('0x31')],_0x17dcb7[_0xf7a4('0x32')]);_0x920e99[_0xf7a4('0x36')]=_[_0xf7a4('0x35')](_0x17dcb7[_0xf7a4('0x31')],qs[_0xf7a4('0x37')](_0x1165bf[_0xf7a4('0x32')][_0xf7a4('0x37')]));_0x920e99['attributes']=_0x920e99[_0xf7a4('0x36')][_0xf7a4('0x46')]?_0x920e99[_0xf7a4('0x36')]:_0x17dcb7[_0xf7a4('0x31')];_0x920e99[_0xf7a4('0x39')]=qs[_0xf7a4('0x3a')](_0x1165bf[_0xf7a4('0x32')][_0xf7a4('0x3a')]);_0x920e99[_0xf7a4('0x3b')]=qs[_0xf7a4('0x34')](_[_0xf7a4('0x3c')](_0x1165bf[_0xf7a4('0x32')],_0x17dcb7[_0xf7a4('0x34')]));if(_0x1165bf[_0xf7a4('0x32')]['filter']){_0x920e99[_0xf7a4('0x3b')]=_[_0xf7a4('0x3d')](_0x920e99['where'],{'$or':_[_0xf7a4('0x2d')](_0x920e99['attributes'],function(_0x2a83ea){var _0xed458f={};_0xed458f[_0x2a83ea]={'$like':'%'+_0x1165bf[_0xf7a4('0x32')][_0xf7a4('0x5c')]+'%'};return _0xed458f;})});}_0x920e99=_[_0xf7a4('0x3d')]({},_0x920e99,_0x1165bf['options']);return _0x15c071[_0xf7a4('0x63')](_0x920e99);}})['then'](function(_0x41a01a){if(_0x41a01a){_0x96644b=_0x41a01a[_0xf7a4('0x46')];if(!_0x1165bf[_0xf7a4('0x32')][_0xf7a4('0x38')]('nolimit')){_0x920e99[_0xf7a4('0x1f')]=qs[_0xf7a4('0x1f')](_0x1165bf['query'][_0xf7a4('0x1f')]);_0x920e99[_0xf7a4('0x1c')]=qs[_0xf7a4('0x1c')](_0x1165bf[_0xf7a4('0x32')]['offset']);}return _0x15c071[_0xf7a4('0x63')](_0x920e99);}})[_0xf7a4('0x24')](function(_0x47f953){if(_0x47f953){return _0x47f953?{'count':_0x96644b,'rows':_0x47f953}:null;}})[_0xf7a4('0x24')](respondWithResult(_0x407598,null))['catch'](handleError(_0x407598,null));};exports[_0xf7a4('0x65')]=function(_0x5b6e2b,_0x4a1ca9,_0x56d611){var _0x50f382,_0x41cb93;var _0xc3a1b0=[];var _0xbe17b7=moment()[_0xf7a4('0x66')](_0xf7a4('0x67'));return db[_0xf7a4('0x2e')][_0xf7a4('0x47')]({'where':{'id':_0x5b6e2b['params']['id']}})[_0xf7a4('0x24')](handleEntityNotFound(_0x4a1ca9,null))[_0xf7a4('0x24')](function(_0x2dc6cf){if(_0x2dc6cf){_0x41cb93=_0x2dc6cf;return _0x2dc6cf['addLists'](_0x5b6e2b['body'][_0xf7a4('0x68')],_['omit'](_0x5b6e2b['body'],[_0xf7a4('0x68'),'id'])||{});}return null;})[_0xf7a4('0x69')](function(_0x3dcaa5){var _0x557765;var _0x545995;_0x50f382=_0x3dcaa5||[];var _0x32a465=[];if(_0x3dcaa5){for(var _0x4db7d3=0x0;_0x4db7d3<_0x3dcaa5[_0xf7a4('0x46')];_0x4db7d3+=0x1){var _0x59f148=_0x3dcaa5[_0x4db7d3]['get']({'plain':!![]});_0x41cb93[_0xf7a4('0x6a')]=_0x5b6e2b[_0xf7a4('0x49')][_0xf7a4('0x6a')]?_0x5b6e2b['body'][_0xf7a4('0x6a')]:_0x41cb93['dialCheckDuplicateType'];switch(_0x41cb93[_0xf7a4('0x6a')]){case'always':_0x557765=squel[_0xf7a4('0x6b')]()[_0xf7a4('0x6c')](_0xf7a4('0x6d'))[_0xf7a4('0x6e')](['phone',_0xf7a4('0x6f'),_0xf7a4('0x70'),'ListId',_0xf7a4('0x5b'),_0xf7a4('0x53'),'updatedAt'],squel[_0xf7a4('0x71')]()['field']('phone',_0xf7a4('0x72'))[_0xf7a4('0x73')](_0xf7a4('0x74'),'scheduledAt')[_0xf7a4('0x73')]('id','ContactId')[_0xf7a4('0x73')](_0x59f148['CmListId']['toString'](),_0xf7a4('0x75'))[_0xf7a4('0x73')](_0x5b6e2b[_0xf7a4('0x45')]['id'][_0xf7a4('0x76')](),'CampaignId')[_0xf7a4('0x73')]('\x27'+_0xbe17b7+'\x27','createdAt')[_0xf7a4('0x73')]('\x27'+_0xbe17b7+'\x27','updatedAt')[_0xf7a4('0x77')]('cm_contacts')[_0xf7a4('0x3b')](_0xf7a4('0x78'))[_0xf7a4('0x3b')]('ListId\x20=\x20?',_0x59f148[_0xf7a4('0x79')][_0xf7a4('0x76')]())[_0xf7a4('0x3b')](_0xf7a4('0x7a'))[_0xf7a4('0x3b')](_0xf7a4('0x7b'),squel[_0xf7a4('0x71')]()[_0xf7a4('0x73')](_0xf7a4('0x7c'))[_0xf7a4('0x77')](_0xf7a4('0x7d'))['where'](_0xf7a4('0x7e'),_0x5b6e2b[_0xf7a4('0x45')]['id'][_0xf7a4('0x76')]()))[_0xf7a4('0x3b')]('phone\x20NOT\x20IN\x20(?)',squel[_0xf7a4('0x71')]()[_0xf7a4('0x73')]('COALESCE(phone,\x27\x27)')[_0xf7a4('0x77')](_0xf7a4('0x6d'))[_0xf7a4('0x3b')](_0xf7a4('0x7e'),_0x5b6e2b[_0xf7a4('0x45')]['id'][_0xf7a4('0x76')]())))[_0xf7a4('0x76')]();break;case _0xf7a4('0x7f'):_0x557765=squel[_0xf7a4('0x6b')]()[_0xf7a4('0x6c')](_0xf7a4('0x6d'))['fromQuery'](['phone',_0xf7a4('0x6f'),'ContactId','ListId',_0xf7a4('0x5b'),_0xf7a4('0x53'),_0xf7a4('0x54')],squel[_0xf7a4('0x71')]()[_0xf7a4('0x73')](_0xf7a4('0x72'),_0xf7a4('0x72'))[_0xf7a4('0x73')](_0xf7a4('0x74'),_0xf7a4('0x6f'))['field']('id','ContactId')[_0xf7a4('0x73')](_0x59f148[_0xf7a4('0x79')][_0xf7a4('0x76')](),_0xf7a4('0x75'))[_0xf7a4('0x73')](_0x5b6e2b[_0xf7a4('0x45')]['id'][_0xf7a4('0x76')](),_0xf7a4('0x5b'))[_0xf7a4('0x73')]('\x27'+_0xbe17b7+'\x27',_0xf7a4('0x53'))[_0xf7a4('0x73')]('\x27'+_0xbe17b7+'\x27',_0xf7a4('0x54'))['from']('cm_contacts')[_0xf7a4('0x3b')]('deletedAt\x20IS\x20NULL')[_0xf7a4('0x3b')](_0xf7a4('0x80'),_0x59f148[_0xf7a4('0x79')][_0xf7a4('0x76')]())['where'](_0xf7a4('0x7a'))[_0xf7a4('0x3b')](_0xf7a4('0x7b'),squel['select']()['field'](_0xf7a4('0x81'))[_0xf7a4('0x77')](_0xf7a4('0x6d'))[_0xf7a4('0x3b')]('CampaignId\x20=\x20?',_0x5b6e2b[_0xf7a4('0x45')]['id'][_0xf7a4('0x76')]())))[_0xf7a4('0x76')]();break;default:_0x557765=squel[_0xf7a4('0x6b')]()[_0xf7a4('0x6c')]('cm_hopper')[_0xf7a4('0x6e')](['phone',_0xf7a4('0x6f'),_0xf7a4('0x70'),_0xf7a4('0x75'),'CampaignId',_0xf7a4('0x53'),_0xf7a4('0x54')],squel[_0xf7a4('0x71')]()[_0xf7a4('0x73')](_0xf7a4('0x72'),_0xf7a4('0x72'))[_0xf7a4('0x73')](_0xf7a4('0x74'),_0xf7a4('0x6f'))['field']('id',_0xf7a4('0x70'))[_0xf7a4('0x73')](_0x59f148['CmListId']['toString'](),'ListId')[_0xf7a4('0x73')](_0x5b6e2b['params']['id']['toString'](),_0xf7a4('0x5b'))[_0xf7a4('0x73')]('\x27'+_0xbe17b7+'\x27',_0xf7a4('0x53'))[_0xf7a4('0x73')]('\x27'+_0xbe17b7+'\x27',_0xf7a4('0x54'))[_0xf7a4('0x77')](_0xf7a4('0x82'))[_0xf7a4('0x3b')](_0xf7a4('0x78'))[_0xf7a4('0x3b')]('ListId\x20=\x20?',_0x59f148[_0xf7a4('0x79')][_0xf7a4('0x76')]())[_0xf7a4('0x3b')]('phone\x20IS\x20NOT\x20NULL'))[_0xf7a4('0x76')]();}_0x545995=squel[_0xf7a4('0x6b')]()[_0xf7a4('0x6c')](_0xf7a4('0x83'))[_0xf7a4('0x6e')]([_0xf7a4('0x84'),_0xf7a4('0x6f'),_0xf7a4('0x72'),_0xf7a4('0x85'),_0xf7a4('0x53'),_0xf7a4('0x54')],squel['select']()[_0xf7a4('0x73')]('h.id','id')[_0xf7a4('0x73')](_0xf7a4('0x74'),_0xf7a4('0x6f'))[_0xf7a4('0x73')](_0xf7a4('0x86'),_0xf7a4('0x72'))['field'](_0xf7a4('0x87'),_0xf7a4('0x85'))['field']('\x27'+_0xbe17b7+'\x27',_0xf7a4('0x53'))[_0xf7a4('0x73')]('\x27'+_0xbe17b7+'\x27',_0xf7a4('0x54'))[_0xf7a4('0x77')]('cm_contact_has_items','ci')['join'](_0xf7a4('0x6d'),'h',_0xf7a4('0x88'))['where'](_0xf7a4('0x89'),_0x59f148[_0xf7a4('0x79')][_0xf7a4('0x76')]())[_0xf7a4('0x3b')](_0xf7a4('0x8a'),_0x5b6e2b[_0xf7a4('0x45')]['id'][_0xf7a4('0x76')]())['where'](_0xf7a4('0x8b'),_0xbe17b7))['toString']();_0x32a465[_0xf7a4('0x8c')](db[_0xf7a4('0x8d')][_0xf7a4('0x32')](_0x557765));_0xc3a1b0[_0xf7a4('0x8c')](db[_0xf7a4('0x8d')][_0xf7a4('0x32')](_0x545995));}return BPromise['all'](_0x32a465);}})[_0xf7a4('0x24')](function(){return BPromise['all'](_0xc3a1b0);})[_0xf7a4('0x24')](function(){return _0x50f382;})[_0xf7a4('0x24')](respondWithResult(_0x4a1ca9,null))[_0xf7a4('0x55')](handleError(_0x4a1ca9,null));};exports[_0xf7a4('0x8e')]=function(_0x42f6c7,_0x402585,_0x5b4e7f){return db[_0xf7a4('0x2e')]['find']({'where':{'id':_0x42f6c7[_0xf7a4('0x45')]['id']}})['then'](handleEntityNotFound(_0x402585,null))[_0xf7a4('0x24')](function(_0x6fa15a){if(_0x6fa15a){return _0x6fa15a['removeLists'](_0x42f6c7[_0xf7a4('0x32')]['ids']);}})[_0xf7a4('0x24')](function(_0x19cca7){if(_0x19cca7){return db[_0xf7a4('0x59')][_0xf7a4('0x25')]({'where':{'ListId':_0x42f6c7['query']['ids'],'CampaignId':_0x42f6c7[_0xf7a4('0x45')]['id']}})[_0xf7a4('0x24')](function(){return _0x19cca7;});}})['then'](respondWithStatusCode(_0x402585,null))['catch'](handleError(_0x402585,null));};exports[_0xf7a4('0x8f')]=function(_0x19879e,_0xa8754,_0xcc0e1f){var _0x508d51={};var _0xc5d471={};var _0x4d5b04;var _0x2db325;return db[_0xf7a4('0x2e')][_0xf7a4('0x58')]({'where':{'id':_0x19879e[_0xf7a4('0x45')]['id']}})['then'](handleEntityNotFound(_0xa8754,null))[_0xf7a4('0x24')](function(_0xbe2821){if(_0xbe2821){_0x4d5b04=_0xbe2821;_0xc5d471[_0xf7a4('0x31')]=_['keys'](db[_0xf7a4('0x64')][_0xf7a4('0x2f')]);_0xc5d471[_0xf7a4('0x32')]=_[_0xf7a4('0x33')](_0x19879e['query']);_0xc5d471[_0xf7a4('0x34')]=_[_0xf7a4('0x35')](_0xc5d471[_0xf7a4('0x31')],_0xc5d471[_0xf7a4('0x32')]);_0x508d51[_0xf7a4('0x36')]=_[_0xf7a4('0x35')](_0xc5d471[_0xf7a4('0x31')],qs[_0xf7a4('0x37')](_0x19879e['query']['fields']));_0x508d51[_0xf7a4('0x36')]=_0x508d51[_0xf7a4('0x36')]['length']?_0x508d51[_0xf7a4('0x36')]:_0xc5d471['model'];_0x508d51[_0xf7a4('0x39')]=qs[_0xf7a4('0x3a')](_0x19879e['query'][_0xf7a4('0x3a')]);_0x508d51[_0xf7a4('0x3b')]=qs[_0xf7a4('0x34')](_[_0xf7a4('0x3c')](_0x19879e[_0xf7a4('0x32')],_0xc5d471[_0xf7a4('0x34')]));if(_0x19879e[_0xf7a4('0x32')]['filter']){_0x508d51[_0xf7a4('0x3b')]=_[_0xf7a4('0x3d')](_0x508d51['where'],{'$or':_[_0xf7a4('0x2d')](_0x508d51['attributes'],function(_0x2263cf){var _0x12e8b3={};_0x12e8b3[_0x2263cf]={'$like':'%'+_0x19879e[_0xf7a4('0x32')]['filter']+'%'};return _0x12e8b3;})});}_0x508d51=_[_0xf7a4('0x3d')]({},_0x508d51,_0x19879e[_0xf7a4('0x40')]);return _0x4d5b04['getBlackLists'](_0x508d51);}})[_0xf7a4('0x24')](function(_0x594014){if(_0x594014){_0x2db325=_0x594014[_0xf7a4('0x46')];if(!_0x19879e['query'][_0xf7a4('0x38')](_0xf7a4('0x5a'))){_0x508d51[_0xf7a4('0x1f')]=qs['limit'](_0x19879e[_0xf7a4('0x32')][_0xf7a4('0x1f')]);_0x508d51[_0xf7a4('0x1c')]=qs[_0xf7a4('0x1c')](_0x19879e[_0xf7a4('0x32')][_0xf7a4('0x1c')]);}return _0x4d5b04[_0xf7a4('0x8f')](_0x508d51);}})[_0xf7a4('0x24')](function(_0x56379b){if(_0x56379b){return _0x56379b?{'count':_0x2db325,'rows':_0x56379b}:null;}})[_0xf7a4('0x24')](respondWithResult(_0xa8754,null))['catch'](handleError(_0xa8754,null));};exports[_0xf7a4('0x90')]=function(_0x5a842d,_0x1c7a84,_0x505abd){var _0x3f3cea,_0x5e704c;var _0x24984c=[];var _0x5f21f5=moment()[_0xf7a4('0x66')](_0xf7a4('0x67'));return db['Campaign']['find']({'where':{'id':_0x5a842d[_0xf7a4('0x45')]['id']}})[_0xf7a4('0x24')](handleEntityNotFound(_0x1c7a84,null))[_0xf7a4('0x24')](function(_0x733067){if(_0x733067){_0x5e704c=_0x733067;return _0x733067['addBlackLists'](_0x5a842d[_0xf7a4('0x49')][_0xf7a4('0x68')],_[_0xf7a4('0x52')](_0x5a842d[_0xf7a4('0x49')],[_0xf7a4('0x68'),'id'])||{});}return null;})[_0xf7a4('0x69')](function(_0xafc57e){var _0x2f9b6b;var _0x408358;_0x3f3cea=_0xafc57e||[];var _0xfdc4bb=[];if(_0xafc57e){for(var _0x2240db=0x0;_0x2240db<_0xafc57e[_0xf7a4('0x46')];_0x2240db+=0x1){var _0x569228=_0xafc57e[_0x2240db]['get']({'plain':!![]});_0x2f9b6b=squel[_0xf7a4('0x6b')]()[_0xf7a4('0x6c')]('cm_hopper_black')[_0xf7a4('0x6e')]([_0xf7a4('0x72'),'ContactId','ListId',_0xf7a4('0x5b'),'createdAt',_0xf7a4('0x54')],squel[_0xf7a4('0x71')]()[_0xf7a4('0x73')](_0xf7a4('0x72'),'phone')['field']('id',_0xf7a4('0x70'))[_0xf7a4('0x73')](_0x569228[_0xf7a4('0x79')]['toString'](),_0xf7a4('0x75'))['field'](_0x5a842d['params']['id']['toString'](),_0xf7a4('0x5b'))[_0xf7a4('0x73')]('NOW()',_0xf7a4('0x53'))[_0xf7a4('0x73')]('NOW()',_0xf7a4('0x54'))[_0xf7a4('0x77')]('cm_contacts')[_0xf7a4('0x3b')](_0xf7a4('0x78'))[_0xf7a4('0x3b')](_0xf7a4('0x80'),_0x569228[_0xf7a4('0x79')][_0xf7a4('0x76')]())[_0xf7a4('0x3b')](_0xf7a4('0x7a')))[_0xf7a4('0x76')]();_0xfdc4bb[_0xf7a4('0x8c')](db['sequelize'][_0xf7a4('0x32')](_0x2f9b6b));}return BPromise[_0xf7a4('0x91')](_0xfdc4bb);}})[_0xf7a4('0x24')](function(){return _0x3f3cea;})[_0xf7a4('0x24')](respondWithResult(_0x1c7a84,null))['catch'](handleError(_0x1c7a84,null));};exports['removeBlackLists']=function(_0x54b2fb,_0x4f2dcb,_0x59016f){return db[_0xf7a4('0x2e')][_0xf7a4('0x47')]({'where':{'id':_0x54b2fb['params']['id']}})[_0xf7a4('0x24')](handleEntityNotFound(_0x4f2dcb,null))['then'](function(_0x373eb6){if(_0x373eb6){return _0x373eb6[_0xf7a4('0x92')](_0x54b2fb[_0xf7a4('0x32')][_0xf7a4('0x68')]);}})[_0xf7a4('0x24')](function(_0x540512){if(_0x540512){return db[_0xf7a4('0x62')][_0xf7a4('0x25')]({'where':{'ListId':_0x54b2fb[_0xf7a4('0x32')]['ids'],'CampaignId':_0x54b2fb[_0xf7a4('0x45')]['id']}})[_0xf7a4('0x24')](function(){return _0x540512;});}})[_0xf7a4('0x24')](respondWithStatusCode(_0x4f2dcb,null))[_0xf7a4('0x55')](handleError(_0x4f2dcb,null));};
\ No newline at end of file
+var _0xccbf=['into','cm_hopper','fromQuery','phone','scheduledAt','ListId','select','field','NOW()','ContactId','CmListId','toString','cm_contacts','deletedAt\x20IS\x20NULL','phone\x20IS\x20NOT\x20NULL','phone\x20NOT\x20IN\x20(?)','COALESCE(calleridnum,\x27\x27)','from','cm_hopper_final','COALESCE(phone,\x27\x27)','CampaignId\x20=\x20?','onlyIfOpen','ListId\x20=\x20?','cm_hopper_additional_phones','cmHopperId','OrderBy','h.id','ci.item','ci.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','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/license/util','../../mysqldb','status','end','json','offset','undefined','count','set','apply','reject','save','update','destroy','get','IvrCampaigns','UserProfileResource','then','sendStatus','error','stack','name','send','index','Campaign','rawAttributes','fieldName','type','key','model','map','query','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','limit','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','show','params','keys','find','body','user','role','UserProfileSection','userProfileId','autoAssociation','create','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','catch','clone','omit','updatedAt','createdAt','Unable\x20to\x20retrieve\x20the\x20current\x20user','CmHopper','CampaignId','getHopperHistories','findOne','CmHopperHistory','order','getHopperFinals','CmHopperFinal','getHopperBlacks','CmHopperBlack','getLists','CmList','format','YYYY-MM-DD\x20HH:mm:ss','addLists','ids','spread','dialCheckDuplicateType','always','insert'];(function(_0x3f938e,_0x4b1e51){var _0x280e4f=function(_0xde6f93){while(--_0xde6f93){_0x3f938e['push'](_0x3f938e['shift']());}};_0x280e4f(++_0x4b1e51);}(_0xccbf,0x1ef));var _0xfccb=function(_0x58bc55,_0x373933){_0x58bc55=_0x58bc55-0x0;var _0x110c3d=_0xccbf[_0x58bc55];return _0x110c3d;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0xfccb('0x0'));var jsonpatch=require(_0xfccb('0x1'));var rp=require('request-promise');var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0xfccb('0x2'));var util=require(_0xfccb('0x3'));var path=require(_0xfccb('0x4'));var sox=require(_0xfccb('0x5'));var csv=require(_0xfccb('0x6'));var ejs=require(_0xfccb('0x7'));var fs=require('fs');var fs_extra=require(_0xfccb('0x8'));var _=require(_0xfccb('0x9'));var squel=require(_0xfccb('0xa'));var crypto=require(_0xfccb('0xb'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0xfccb('0x6'));var querystring=require('querystring');var Papa=require(_0xfccb('0xc'));var Redis=require(_0xfccb('0xd'));var authService=require(_0xfccb('0xe'));var qs=require(_0xfccb('0xf'));var as=require(_0xfccb('0x10'));var hardwareService=require(_0xfccb('0x11'));var logger=require(_0xfccb('0x12'))('api');var utils=require(_0xfccb('0x13'));var config=require('../../config/environment');var licenseUtil=require(_0xfccb('0x14'));var db=require(_0xfccb('0x15'))['db'];function respondWithStatusCode(_0x294290,_0x6347e){_0x6347e=_0x6347e||0xcc;return function(_0x3feeb8){if(_0x3feeb8){return _0x294290['sendStatus'](_0x6347e);}return _0x294290[_0xfccb('0x16')](_0x6347e)[_0xfccb('0x17')]();};}function respondWithResult(_0x4dbc25,_0x24b877){_0x24b877=_0x24b877||0xc8;return function(_0x1ac34f){if(_0x1ac34f){return _0x4dbc25[_0xfccb('0x16')](_0x24b877)[_0xfccb('0x18')](_0x1ac34f);}};}function respondWithFilteredResult(_0x3ec8f6,_0x4b982c){return function(_0x45f2dc){if(_0x45f2dc){var _0x2c1cdb=typeof _0x4b982c[_0xfccb('0x19')]===_0xfccb('0x1a')&&typeof _0x4b982c['limit']===_0xfccb('0x1a');var _0xa7dde9=_0x45f2dc[_0xfccb('0x1b')];var _0x3ccfaf=_0x2c1cdb?0x0:_0x4b982c[_0xfccb('0x19')];var _0x44bc94=_0x2c1cdb?_0x45f2dc['count']:_0x4b982c[_0xfccb('0x19')]+_0x4b982c['limit'];var _0x2d1282;if(_0x44bc94>=_0xa7dde9){_0x44bc94=_0xa7dde9;_0x2d1282=0xc8;}else{_0x2d1282=0xce;}_0x3ec8f6[_0xfccb('0x16')](_0x2d1282);return _0x3ec8f6[_0xfccb('0x1c')]('Content-Range',_0x3ccfaf+'-'+_0x44bc94+'/'+_0xa7dde9)[_0xfccb('0x18')](_0x45f2dc);}return null;};}function patchUpdates(_0x385272){return function(_0x46c59a){try{jsonpatch[_0xfccb('0x1d')](_0x46c59a,_0x385272,!![]);}catch(_0x121b20){return BPromise[_0xfccb('0x1e')](_0x121b20);}return _0x46c59a[_0xfccb('0x1f')]();};}function saveUpdates(_0x587fe2,_0x5beeef){return function(_0x2baa04){if(_0x2baa04){return _0x2baa04[_0xfccb('0x20')](_0x587fe2)['then'](function(_0x35679f){return _0x35679f;});}return null;};}function removeEntity(_0x23c395,_0x343f15){return function(_0x2087c6){if(_0x2087c6){return _0x2087c6[_0xfccb('0x21')]()['then'](function(){var _0x3a86ed=_0x2087c6[_0xfccb('0x22')]({'plain':!![]});var _0x29e1f9=_0xfccb('0x23');return db[_0xfccb('0x24')][_0xfccb('0x21')]({'where':{'type':_0x29e1f9,'resourceId':_0x3a86ed['id']}})['then'](function(){return _0x2087c6;});})[_0xfccb('0x25')](function(){_0x23c395[_0xfccb('0x16')](0xcc)['end']();});}};}function handleEntityNotFound(_0x29e5fa,_0x4edf31){return function(_0x2e9e0a){if(!_0x2e9e0a){_0x29e5fa[_0xfccb('0x26')](0x194);}return _0x2e9e0a;};}function handleError(_0x6ba751,_0x2dc7d1){_0x2dc7d1=_0x2dc7d1||0x1f4;return function(_0x54834f){logger[_0xfccb('0x27')](_0x54834f[_0xfccb('0x28')]);if(_0x54834f['name']){delete _0x54834f[_0xfccb('0x29')];}_0x6ba751[_0xfccb('0x16')](_0x2dc7d1)[_0xfccb('0x2a')](_0x54834f);};}exports[_0xfccb('0x2b')]=function(_0x5314b8,_0x3d7e72){var _0x26f6df={},_0xf35e06={},_0x3286f1={'count':0x0,'rows':[]};var _0x301e0b=_['map'](db[_0xfccb('0x2c')][_0xfccb('0x2d')],function(_0x30493f){return{'name':_0x30493f[_0xfccb('0x2e')],'type':_0x30493f[_0xfccb('0x2f')][_0xfccb('0x30')]};});_0xf35e06[_0xfccb('0x31')]=_[_0xfccb('0x32')](_0x301e0b,_0xfccb('0x29'));_0xf35e06[_0xfccb('0x33')]=_['keys'](_0x5314b8[_0xfccb('0x33')]);_0xf35e06[_0xfccb('0x34')]=_[_0xfccb('0x35')](_0xf35e06[_0xfccb('0x31')],_0xf35e06[_0xfccb('0x33')]);_0x26f6df['attributes']=_[_0xfccb('0x35')](_0xf35e06[_0xfccb('0x31')],qs[_0xfccb('0x36')](_0x5314b8[_0xfccb('0x33')][_0xfccb('0x36')]));_0x26f6df['attributes']=_0x26f6df[_0xfccb('0x37')][_0xfccb('0x38')]?_0x26f6df[_0xfccb('0x37')]:_0xf35e06[_0xfccb('0x31')];if(!_0x5314b8[_0xfccb('0x33')][_0xfccb('0x39')](_0xfccb('0x3a'))){_0x26f6df[_0xfccb('0x3b')]=qs[_0xfccb('0x3b')](_0x5314b8[_0xfccb('0x33')][_0xfccb('0x3b')]);_0x26f6df[_0xfccb('0x19')]=qs[_0xfccb('0x19')](_0x5314b8[_0xfccb('0x33')][_0xfccb('0x19')]);}_0x26f6df['order']=qs[_0xfccb('0x3c')](_0x5314b8[_0xfccb('0x33')][_0xfccb('0x3c')]);_0x26f6df[_0xfccb('0x3d')]=qs[_0xfccb('0x34')](_[_0xfccb('0x3e')](_0x5314b8[_0xfccb('0x33')],_0xf35e06['filters']),_0x301e0b);if(_0x5314b8[_0xfccb('0x33')][_0xfccb('0x3f')]){_0x26f6df[_0xfccb('0x3d')]=_[_0xfccb('0x40')](_0x26f6df[_0xfccb('0x3d')],{'$or':_['map'](_0x301e0b,function(_0x2fb449){if(_0x2fb449[_0xfccb('0x2f')]!==_0xfccb('0x41')){var _0x231e27={};_0x231e27[_0x2fb449[_0xfccb('0x29')]]={'$like':'%'+_0x5314b8[_0xfccb('0x33')][_0xfccb('0x3f')]+'%'};return _0x231e27;}})});}_0x26f6df=_[_0xfccb('0x40')]({},_0x26f6df,_0x5314b8[_0xfccb('0x42')]);var _0x6b7a4b={'where':_0x26f6df[_0xfccb('0x3d')]};return db[_0xfccb('0x2c')][_0xfccb('0x1b')](_0x6b7a4b)[_0xfccb('0x25')](function(_0x300eb5){_0x3286f1[_0xfccb('0x1b')]=_0x300eb5;if(_0x5314b8['query'][_0xfccb('0x43')]){_0x26f6df[_0xfccb('0x44')]=[{'all':!![]}];}return db[_0xfccb('0x2c')][_0xfccb('0x45')](_0x26f6df);})['then'](function(_0x16da43){_0x3286f1[_0xfccb('0x46')]=_0x16da43;return _0x3286f1;})[_0xfccb('0x25')](respondWithFilteredResult(_0x3d7e72,_0x26f6df))['catch'](handleError(_0x3d7e72,null));};exports[_0xfccb('0x47')]=function(_0x51cc89,_0x3a6409){var _0x450a82={'raw':![],'where':{'id':_0x51cc89[_0xfccb('0x48')]['id']}},_0x4c1229={};_0x4c1229[_0xfccb('0x31')]=_[_0xfccb('0x49')](db[_0xfccb('0x2c')][_0xfccb('0x2d')]);_0x4c1229[_0xfccb('0x33')]=_[_0xfccb('0x49')](_0x51cc89[_0xfccb('0x33')]);_0x4c1229[_0xfccb('0x34')]=_[_0xfccb('0x35')](_0x4c1229['model'],_0x4c1229[_0xfccb('0x33')]);_0x450a82[_0xfccb('0x37')]=_[_0xfccb('0x35')](_0x4c1229['model'],qs[_0xfccb('0x36')](_0x51cc89[_0xfccb('0x33')][_0xfccb('0x36')]));_0x450a82[_0xfccb('0x37')]=_0x450a82[_0xfccb('0x37')]['length']?_0x450a82[_0xfccb('0x37')]:_0x4c1229['model'];if(_0x51cc89[_0xfccb('0x33')]['includeAll']){_0x450a82[_0xfccb('0x44')]=[{'all':!![]}];}_0x450a82=_['merge']({},_0x450a82,_0x51cc89[_0xfccb('0x42')]);return db[_0xfccb('0x2c')][_0xfccb('0x4a')](_0x450a82)['then'](handleEntityNotFound(_0x3a6409,null))[_0xfccb('0x25')](respondWithResult(_0x3a6409,null))['catch'](handleError(_0x3a6409,null));};exports['create']=function(_0x1dd08b,_0x7bb37c){return db[_0xfccb('0x2c')]['create'](_0x1dd08b[_0xfccb('0x4b')],{})[_0xfccb('0x25')](function(_0x467afe){var _0x11951a=_0x1dd08b[_0xfccb('0x4c')]['get']({'plain':!![]});if(!_0x11951a)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x11951a[_0xfccb('0x4d')]===_0xfccb('0x4c')){var _0x503c22=_0x467afe[_0xfccb('0x22')]({'plain':!![]});var _0x5045b5=_0xfccb('0x23');return db[_0xfccb('0x4e')][_0xfccb('0x4a')]({'where':{'name':_0x5045b5,'userProfileId':_0x11951a[_0xfccb('0x4f')]},'raw':!![]})[_0xfccb('0x25')](function(_0x237642){if(_0x237642&&_0x237642[_0xfccb('0x50')]===0x0){return db['UserProfileResource'][_0xfccb('0x51')]({'name':_0x503c22['name'],'resourceId':_0x503c22['id'],'type':_0x237642['name'],'sectionId':_0x237642['id']},{})[_0xfccb('0x25')](function(){return _0x467afe;});}else{return _0x467afe;}})['catch'](function(_0x3d86ef){logger['error'](_0xfccb('0x52'),_0x3d86ef);throw _0x3d86ef;});}return _0x467afe;})[_0xfccb('0x25')](respondWithResult(_0x7bb37c,0xc9))[_0xfccb('0x53')](handleError(_0x7bb37c,null));};exports[_0xfccb('0x54')]=function(_0x1d0dad,_0xea2af8){var _0x3a6530={'where':{'id':_0x1d0dad[_0xfccb('0x48')]['id']}},_0x4188c4={};_0x4188c4['model']=_[_0xfccb('0x49')](db[_0xfccb('0x2c')][_0xfccb('0x2d')]);_0x3a6530['attributes']=_[_0xfccb('0x35')](_0x4188c4[_0xfccb('0x31')],qs[_0xfccb('0x36')](_0x1d0dad[_0xfccb('0x33')]['fields']));_0x3a6530[_0xfccb('0x37')]=_0x3a6530['attributes'][_0xfccb('0x38')]?_0x3a6530[_0xfccb('0x37')]:_0x4188c4['model'];if(_0x1d0dad['query'][_0xfccb('0x43')]){_0x3a6530['include']=[{'all':!![]}];}_0x3a6530=_[_0xfccb('0x40')]({},_0x3a6530,_0x1d0dad[_0xfccb('0x42')]);return db[_0xfccb('0x2c')]['find'](_0x3a6530)[_0xfccb('0x25')](handleEntityNotFound(_0xea2af8,null))['then'](function(_0x1497bd){if(_0x1497bd){var _0x3e7319=_0x1497bd[_0xfccb('0x22')]({'plain':!![]});_0x3e7319=qs[_0xfccb('0x55')](_0x3e7319,['id','createdAt',_0xfccb('0x56')]);_0x1d0dad[_0xfccb('0x4b')]=_[_0xfccb('0x55')](_0x1d0dad[_0xfccb('0x4b')],['id',_0xfccb('0x57'),_0xfccb('0x56')]);return db['Campaign'][_0xfccb('0x51')](_[_0xfccb('0x40')](_0x3e7319,_0x1d0dad[_0xfccb('0x4b')]),{'include':_0x1d0dad[_0xfccb('0x33')]['includeAll']?[{'all':!![]}]:undefined})[_0xfccb('0x25')](function(_0x3f82f9){var _0x6c1e39=_0x1d0dad[_0xfccb('0x4c')][_0xfccb('0x22')]({'plain':!![]});if(!_0x6c1e39)throw new Error(_0xfccb('0x58'));if(_0x6c1e39['role']===_0xfccb('0x4c')){var _0x3db3e4=_0x3f82f9[_0xfccb('0x22')]({'plain':!![]});var _0x5d19eb='IvrCampaigns';return db['UserProfileSection']['find']({'where':{'name':_0x5d19eb,'userProfileId':_0x6c1e39[_0xfccb('0x4f')]},'raw':!![]})[_0xfccb('0x25')](function(_0x52251a){if(_0x52251a&&_0x52251a[_0xfccb('0x50')]===0x0){return db['UserProfileResource'][_0xfccb('0x51')]({'name':_0x3db3e4[_0xfccb('0x29')],'resourceId':_0x3db3e4['id'],'type':_0x52251a[_0xfccb('0x29')],'sectionId':_0x52251a['id']},{})['then'](function(){return _0x3f82f9;});}else{return _0x3f82f9;}})[_0xfccb('0x53')](function(_0x302b4b){logger[_0xfccb('0x27')](_0xfccb('0x52'),_0x302b4b);throw _0x302b4b;});}return _0x3f82f9;});}})['then'](respondWithResult(_0xea2af8,0xc9))['catch'](handleError(_0xea2af8,null));};exports[_0xfccb('0x20')]=function(_0x5df317,_0xdb6347){if(_0x5df317[_0xfccb('0x4b')]['id']){delete _0x5df317[_0xfccb('0x4b')]['id'];}return db[_0xfccb('0x2c')][_0xfccb('0x4a')]({'where':{'id':_0x5df317['params']['id']}})[_0xfccb('0x25')](handleEntityNotFound(_0xdb6347,null))[_0xfccb('0x25')](saveUpdates(_0x5df317[_0xfccb('0x4b')],null))['then'](respondWithResult(_0xdb6347,null))['catch'](handleError(_0xdb6347,null));};exports[_0xfccb('0x21')]=function(_0x347ed7,_0x121d6c){return db[_0xfccb('0x2c')]['find']({'where':{'id':_0x347ed7[_0xfccb('0x48')]['id']}})[_0xfccb('0x25')](handleEntityNotFound(_0x121d6c,null))['then'](removeEntity(_0x121d6c,null))[_0xfccb('0x53')](handleError(_0x121d6c,null));};exports['getHoppers']=function(_0x2c8fd9,_0x45dd06,_0x2749ae){var _0x4fad84={'raw':!![],'where':{}};var _0x1d03e8={};var _0x2924e4={'count':0x0,'rows':[]};return db['Campaign']['findOne']({'where':{'id':_0x2c8fd9[_0xfccb('0x48')]['id']}})['then'](handleEntityNotFound(_0x45dd06,null))[_0xfccb('0x25')](function(_0x153075){if(_0x153075){_0x1d03e8['model']=_[_0xfccb('0x49')](db[_0xfccb('0x59')][_0xfccb('0x2d')]);_0x1d03e8[_0xfccb('0x33')]=_['keys'](_0x2c8fd9[_0xfccb('0x33')]);_0x1d03e8['filters']=_[_0xfccb('0x35')](_0x1d03e8[_0xfccb('0x31')],_0x1d03e8[_0xfccb('0x33')]);_0x4fad84['attributes']=_[_0xfccb('0x35')](_0x1d03e8[_0xfccb('0x31')],qs[_0xfccb('0x36')](_0x2c8fd9[_0xfccb('0x33')][_0xfccb('0x36')]));_0x4fad84[_0xfccb('0x37')]=_0x4fad84[_0xfccb('0x37')]['length']?_0x4fad84[_0xfccb('0x37')]:_0x1d03e8['model'];if(!_0x2c8fd9[_0xfccb('0x33')]['hasOwnProperty'](_0xfccb('0x3a'))){_0x4fad84[_0xfccb('0x3b')]=qs[_0xfccb('0x3b')](_0x2c8fd9[_0xfccb('0x33')]['limit']);_0x4fad84['offset']=qs[_0xfccb('0x19')](_0x2c8fd9['query']['offset']);}_0x4fad84['order']=qs[_0xfccb('0x3c')](_0x2c8fd9['query'][_0xfccb('0x3c')]);_0x4fad84['where']=qs[_0xfccb('0x34')](_[_0xfccb('0x3e')](_0x2c8fd9[_0xfccb('0x33')],_0x1d03e8[_0xfccb('0x34')]));_0x4fad84[_0xfccb('0x3d')][_0xfccb('0x5a')]=_0x153075['id'];if(_0x2c8fd9[_0xfccb('0x33')]['filter']){_0x4fad84[_0xfccb('0x3d')]=_['merge'](_0x4fad84[_0xfccb('0x3d')],{'$or':_[_0xfccb('0x32')](_0x4fad84[_0xfccb('0x37')],function(_0x5e7fc3){var _0x5c7838={};_0x5c7838[_0x5e7fc3]={'$like':'%'+_0x2c8fd9[_0xfccb('0x33')][_0xfccb('0x3f')]+'%'};return _0x5c7838;})});}_0x4fad84=_[_0xfccb('0x40')]({},_0x4fad84,_0x2c8fd9[_0xfccb('0x42')]);return db[_0xfccb('0x59')][_0xfccb('0x1b')]({'where':_0x4fad84[_0xfccb('0x3d')]})[_0xfccb('0x25')](function(_0x452d7a){_0x2924e4[_0xfccb('0x1b')]=_0x452d7a;if(_0x2c8fd9[_0xfccb('0x33')][_0xfccb('0x43')]){_0x4fad84[_0xfccb('0x44')]=[{'all':!![]}];}return db['CmHopper'][_0xfccb('0x45')](_0x4fad84);})[_0xfccb('0x25')](function(_0x2ab1cc){_0x2924e4[_0xfccb('0x46')]=_0x2ab1cc;return _0x2924e4;});}})[_0xfccb('0x25')](respondWithFilteredResult(_0x45dd06,_0x4fad84))[_0xfccb('0x53')](handleError(_0x45dd06,null));};exports[_0xfccb('0x5b')]=function(_0x363c1e,_0x5c0779,_0x4a6f51){var _0x35c6dd={'raw':!![],'where':{}};var _0x1961a0={};var _0x38d94c={'count':0x0,'rows':[]};return db[_0xfccb('0x2c')][_0xfccb('0x5c')]({'where':{'id':_0x363c1e[_0xfccb('0x48')]['id']}})[_0xfccb('0x25')](handleEntityNotFound(_0x5c0779,null))['then'](function(_0x1b5961){if(_0x1b5961){_0x1961a0[_0xfccb('0x31')]=_[_0xfccb('0x49')](db[_0xfccb('0x5d')][_0xfccb('0x2d')]);_0x1961a0['query']=_[_0xfccb('0x49')](_0x363c1e[_0xfccb('0x33')]);_0x1961a0[_0xfccb('0x34')]=_[_0xfccb('0x35')](_0x1961a0['model'],_0x1961a0[_0xfccb('0x33')]);_0x35c6dd[_0xfccb('0x37')]=_['intersection'](_0x1961a0[_0xfccb('0x31')],qs['fields'](_0x363c1e[_0xfccb('0x33')]['fields']));_0x35c6dd['attributes']=_0x35c6dd['attributes']['length']?_0x35c6dd[_0xfccb('0x37')]:_0x1961a0[_0xfccb('0x31')];if(!_0x363c1e[_0xfccb('0x33')][_0xfccb('0x39')](_0xfccb('0x3a'))){_0x35c6dd['limit']=qs[_0xfccb('0x3b')](_0x363c1e[_0xfccb('0x33')][_0xfccb('0x3b')]);_0x35c6dd[_0xfccb('0x19')]=qs['offset'](_0x363c1e[_0xfccb('0x33')][_0xfccb('0x19')]);}_0x35c6dd[_0xfccb('0x5e')]=qs[_0xfccb('0x3c')](_0x363c1e['query'][_0xfccb('0x3c')]);_0x35c6dd[_0xfccb('0x3d')]=qs['filters'](_[_0xfccb('0x3e')](_0x363c1e[_0xfccb('0x33')],_0x1961a0[_0xfccb('0x34')]));_0x35c6dd[_0xfccb('0x3d')]['CampaignId']=_0x1b5961['id'];if(_0x363c1e[_0xfccb('0x33')][_0xfccb('0x3f')]){_0x35c6dd[_0xfccb('0x3d')]=_[_0xfccb('0x40')](_0x35c6dd[_0xfccb('0x3d')],{'$or':_[_0xfccb('0x32')](_0x35c6dd[_0xfccb('0x37')],function(_0x3b949b){var _0x1afb9e={};_0x1afb9e[_0x3b949b]={'$like':'%'+_0x363c1e[_0xfccb('0x33')][_0xfccb('0x3f')]+'%'};return _0x1afb9e;})});}_0x35c6dd=_[_0xfccb('0x40')]({},_0x35c6dd,_0x363c1e['options']);return db[_0xfccb('0x5d')][_0xfccb('0x1b')]({'where':_0x35c6dd['where']})[_0xfccb('0x25')](function(_0x5783d6){_0x38d94c['count']=_0x5783d6;if(_0x363c1e[_0xfccb('0x33')][_0xfccb('0x43')]){_0x35c6dd[_0xfccb('0x44')]=[{'all':!![]}];}return db['CmHopperHistory']['findAll'](_0x35c6dd);})[_0xfccb('0x25')](function(_0x3de35e){_0x38d94c[_0xfccb('0x46')]=_0x3de35e;return _0x38d94c;});}})[_0xfccb('0x25')](respondWithFilteredResult(_0x5c0779,_0x35c6dd))['catch'](handleError(_0x5c0779,null));};exports[_0xfccb('0x5f')]=function(_0x4b8674,_0x4aeec8,_0x579a8e){var _0x37fd9f={'raw':!![],'where':{}};var _0x5d2f4a={};var _0x4b8b6f={'count':0x0,'rows':[]};return db[_0xfccb('0x2c')]['findOne']({'where':{'id':_0x4b8674[_0xfccb('0x48')]['id']}})[_0xfccb('0x25')](handleEntityNotFound(_0x4aeec8,null))[_0xfccb('0x25')](function(_0x910d55){if(_0x910d55){_0x5d2f4a[_0xfccb('0x31')]=_[_0xfccb('0x49')](db['CmHopperFinal'][_0xfccb('0x2d')]);_0x5d2f4a['query']=_[_0xfccb('0x49')](_0x4b8674[_0xfccb('0x33')]);_0x5d2f4a[_0xfccb('0x34')]=_[_0xfccb('0x35')](_0x5d2f4a[_0xfccb('0x31')],_0x5d2f4a['query']);_0x37fd9f[_0xfccb('0x37')]=_[_0xfccb('0x35')](_0x5d2f4a[_0xfccb('0x31')],qs[_0xfccb('0x36')](_0x4b8674[_0xfccb('0x33')][_0xfccb('0x36')]));_0x37fd9f['attributes']=_0x37fd9f[_0xfccb('0x37')][_0xfccb('0x38')]?_0x37fd9f[_0xfccb('0x37')]:_0x5d2f4a[_0xfccb('0x31')];if(!_0x4b8674['query']['hasOwnProperty'](_0xfccb('0x3a'))){_0x37fd9f[_0xfccb('0x3b')]=qs[_0xfccb('0x3b')](_0x4b8674[_0xfccb('0x33')][_0xfccb('0x3b')]);_0x37fd9f[_0xfccb('0x19')]=qs[_0xfccb('0x19')](_0x4b8674[_0xfccb('0x33')][_0xfccb('0x19')]);}_0x37fd9f['order']=qs[_0xfccb('0x3c')](_0x4b8674[_0xfccb('0x33')]['sort']);_0x37fd9f[_0xfccb('0x3d')]=qs[_0xfccb('0x34')](_[_0xfccb('0x3e')](_0x4b8674[_0xfccb('0x33')],_0x5d2f4a[_0xfccb('0x34')]));_0x37fd9f['where']['CampaignId']=_0x910d55['id'];if(_0x4b8674[_0xfccb('0x33')][_0xfccb('0x3f')]){_0x37fd9f[_0xfccb('0x3d')]=_[_0xfccb('0x40')](_0x37fd9f[_0xfccb('0x3d')],{'$or':_[_0xfccb('0x32')](_0x37fd9f[_0xfccb('0x37')],function(_0x56a9c2){var _0xe5c83c={};_0xe5c83c[_0x56a9c2]={'$like':'%'+_0x4b8674[_0xfccb('0x33')][_0xfccb('0x3f')]+'%'};return _0xe5c83c;})});}_0x37fd9f=_[_0xfccb('0x40')]({},_0x37fd9f,_0x4b8674['options']);return db[_0xfccb('0x60')][_0xfccb('0x1b')]({'where':_0x37fd9f['where']})[_0xfccb('0x25')](function(_0x1f5192){_0x4b8b6f[_0xfccb('0x1b')]=_0x1f5192;if(_0x4b8674['query']['includeAll']){_0x37fd9f[_0xfccb('0x44')]=[{'all':!![]}];}return db[_0xfccb('0x60')][_0xfccb('0x45')](_0x37fd9f);})[_0xfccb('0x25')](function(_0x4a6911){_0x4b8b6f[_0xfccb('0x46')]=_0x4a6911;return _0x4b8b6f;});}})[_0xfccb('0x25')](respondWithFilteredResult(_0x4aeec8,_0x37fd9f))[_0xfccb('0x53')](handleError(_0x4aeec8,null));};exports[_0xfccb('0x61')]=function(_0x531d94,_0x4c62b2,_0xd710de){var _0x12708a={'raw':!![],'where':{}};var _0x9179f3={};var _0x4904cd={'count':0x0,'rows':[]};return db[_0xfccb('0x2c')][_0xfccb('0x5c')]({'where':{'id':_0x531d94[_0xfccb('0x48')]['id']}})['then'](handleEntityNotFound(_0x4c62b2,null))[_0xfccb('0x25')](function(_0x23e62d){if(_0x23e62d){_0x9179f3[_0xfccb('0x31')]=_['keys'](db[_0xfccb('0x62')]['rawAttributes']);_0x9179f3[_0xfccb('0x33')]=_[_0xfccb('0x49')](_0x531d94[_0xfccb('0x33')]);_0x9179f3['filters']=_[_0xfccb('0x35')](_0x9179f3[_0xfccb('0x31')],_0x9179f3['query']);_0x12708a[_0xfccb('0x37')]=_[_0xfccb('0x35')](_0x9179f3[_0xfccb('0x31')],qs[_0xfccb('0x36')](_0x531d94[_0xfccb('0x33')][_0xfccb('0x36')]));_0x12708a[_0xfccb('0x37')]=_0x12708a[_0xfccb('0x37')][_0xfccb('0x38')]?_0x12708a['attributes']:_0x9179f3[_0xfccb('0x31')];if(!_0x531d94[_0xfccb('0x33')][_0xfccb('0x39')]('nolimit')){_0x12708a[_0xfccb('0x3b')]=qs[_0xfccb('0x3b')](_0x531d94[_0xfccb('0x33')][_0xfccb('0x3b')]);_0x12708a[_0xfccb('0x19')]=qs[_0xfccb('0x19')](_0x531d94[_0xfccb('0x33')][_0xfccb('0x19')]);}_0x12708a[_0xfccb('0x5e')]=qs[_0xfccb('0x3c')](_0x531d94[_0xfccb('0x33')]['sort']);_0x12708a[_0xfccb('0x3d')]=qs[_0xfccb('0x34')](_['pick'](_0x531d94[_0xfccb('0x33')],_0x9179f3['filters']));_0x12708a[_0xfccb('0x3d')][_0xfccb('0x5a')]=_0x23e62d['id'];if(_0x531d94[_0xfccb('0x33')][_0xfccb('0x3f')]){_0x12708a[_0xfccb('0x3d')]=_[_0xfccb('0x40')](_0x12708a[_0xfccb('0x3d')],{'$or':_[_0xfccb('0x32')](_0x12708a['attributes'],function(_0x133c0c){var _0x2c6bc4={};_0x2c6bc4[_0x133c0c]={'$like':'%'+_0x531d94[_0xfccb('0x33')][_0xfccb('0x3f')]+'%'};return _0x2c6bc4;})});}_0x12708a=_[_0xfccb('0x40')]({},_0x12708a,_0x531d94[_0xfccb('0x42')]);return db['CmHopperBlack'][_0xfccb('0x1b')]({'where':_0x12708a[_0xfccb('0x3d')]})[_0xfccb('0x25')](function(_0x46c3f1){_0x4904cd[_0xfccb('0x1b')]=_0x46c3f1;if(_0x531d94[_0xfccb('0x33')][_0xfccb('0x43')]){_0x12708a[_0xfccb('0x44')]=[{'all':!![]}];}return db[_0xfccb('0x62')][_0xfccb('0x45')](_0x12708a);})['then'](function(_0x53a013){_0x4904cd[_0xfccb('0x46')]=_0x53a013;return _0x4904cd;});}})[_0xfccb('0x25')](respondWithFilteredResult(_0x4c62b2,_0x12708a))[_0xfccb('0x53')](handleError(_0x4c62b2,null));};exports[_0xfccb('0x63')]=function(_0x41d3c7,_0x35e71c,_0x4e4042){var _0x14f60e={};var _0x3bee00={};var _0x8c4c08;var _0x332e15;return db['Campaign'][_0xfccb('0x5c')]({'where':{'id':_0x41d3c7[_0xfccb('0x48')]['id']}})[_0xfccb('0x25')](handleEntityNotFound(_0x35e71c,null))[_0xfccb('0x25')](function(_0x2812cf){if(_0x2812cf){_0x8c4c08=_0x2812cf;_0x3bee00[_0xfccb('0x31')]=_[_0xfccb('0x49')](db[_0xfccb('0x64')][_0xfccb('0x2d')]);_0x3bee00['query']=_['keys'](_0x41d3c7[_0xfccb('0x33')]);_0x3bee00['filters']=_['intersection'](_0x3bee00[_0xfccb('0x31')],_0x3bee00[_0xfccb('0x33')]);_0x14f60e[_0xfccb('0x37')]=_[_0xfccb('0x35')](_0x3bee00[_0xfccb('0x31')],qs[_0xfccb('0x36')](_0x41d3c7[_0xfccb('0x33')]['fields']));_0x14f60e[_0xfccb('0x37')]=_0x14f60e[_0xfccb('0x37')][_0xfccb('0x38')]?_0x14f60e['attributes']:_0x3bee00[_0xfccb('0x31')];_0x14f60e['order']=qs[_0xfccb('0x3c')](_0x41d3c7[_0xfccb('0x33')]['sort']);_0x14f60e['where']=qs[_0xfccb('0x34')](_[_0xfccb('0x3e')](_0x41d3c7['query'],_0x3bee00['filters']));if(_0x41d3c7['query'][_0xfccb('0x3f')]){_0x14f60e['where']=_['merge'](_0x14f60e[_0xfccb('0x3d')],{'$or':_[_0xfccb('0x32')](_0x14f60e[_0xfccb('0x37')],function(_0x20a5d5){var _0xc2c5ba={};_0xc2c5ba[_0x20a5d5]={'$like':'%'+_0x41d3c7[_0xfccb('0x33')]['filter']+'%'};return _0xc2c5ba;})});}_0x14f60e=_[_0xfccb('0x40')]({},_0x14f60e,_0x41d3c7[_0xfccb('0x42')]);return _0x8c4c08[_0xfccb('0x63')](_0x14f60e);}})[_0xfccb('0x25')](function(_0x2aae0e){if(_0x2aae0e){_0x332e15=_0x2aae0e[_0xfccb('0x38')];if(!_0x41d3c7[_0xfccb('0x33')][_0xfccb('0x39')](_0xfccb('0x3a'))){_0x14f60e[_0xfccb('0x3b')]=qs[_0xfccb('0x3b')](_0x41d3c7[_0xfccb('0x33')][_0xfccb('0x3b')]);_0x14f60e['offset']=qs[_0xfccb('0x19')](_0x41d3c7[_0xfccb('0x33')][_0xfccb('0x19')]);}return _0x8c4c08[_0xfccb('0x63')](_0x14f60e);}})[_0xfccb('0x25')](function(_0x32728){if(_0x32728){return _0x32728?{'count':_0x332e15,'rows':_0x32728}:null;}})[_0xfccb('0x25')](respondWithResult(_0x35e71c,null))[_0xfccb('0x53')](handleError(_0x35e71c,null));};exports['addLists']=function(_0x5d7f8b,_0x215d9a,_0x7e7bfa){var _0x3f7418,_0x4b7648;var _0x5a1e31=[];var _0x1503ee=moment()[_0xfccb('0x65')](_0xfccb('0x66'));return db[_0xfccb('0x2c')][_0xfccb('0x4a')]({'where':{'id':_0x5d7f8b['params']['id']}})[_0xfccb('0x25')](handleEntityNotFound(_0x215d9a,null))[_0xfccb('0x25')](function(_0x58cc17){if(_0x58cc17){_0x4b7648=_0x58cc17;return _0x58cc17[_0xfccb('0x67')](_0x5d7f8b[_0xfccb('0x4b')][_0xfccb('0x68')],_['omit'](_0x5d7f8b[_0xfccb('0x4b')],[_0xfccb('0x68'),'id'])||{});}return null;})[_0xfccb('0x69')](function(_0x1b1543){var _0xcbc0c;var _0x48f195;_0x3f7418=_0x1b1543||[];var _0x1dcfe3=[];if(_0x1b1543){for(var _0x12edbc=0x0;_0x12edbc<_0x1b1543['length'];_0x12edbc+=0x1){var _0x2ec9b0=_0x1b1543[_0x12edbc][_0xfccb('0x22')]({'plain':!![]});_0x4b7648[_0xfccb('0x6a')]=_0x5d7f8b['body'][_0xfccb('0x6a')]?_0x5d7f8b['body'][_0xfccb('0x6a')]:_0x4b7648['dialCheckDuplicateType'];switch(_0x4b7648[_0xfccb('0x6a')]){case _0xfccb('0x6b'):_0xcbc0c=squel[_0xfccb('0x6c')]()[_0xfccb('0x6d')](_0xfccb('0x6e'))[_0xfccb('0x6f')]([_0xfccb('0x70'),_0xfccb('0x71'),'ContactId',_0xfccb('0x72'),_0xfccb('0x5a'),_0xfccb('0x57'),_0xfccb('0x56')],squel[_0xfccb('0x73')]()[_0xfccb('0x74')](_0xfccb('0x70'),_0xfccb('0x70'))[_0xfccb('0x74')](_0xfccb('0x75'),_0xfccb('0x71'))['field']('id',_0xfccb('0x76'))['field'](_0x2ec9b0[_0xfccb('0x77')][_0xfccb('0x78')](),_0xfccb('0x72'))[_0xfccb('0x74')](_0x5d7f8b[_0xfccb('0x48')]['id']['toString'](),_0xfccb('0x5a'))[_0xfccb('0x74')]('\x27'+_0x1503ee+'\x27','createdAt')['field']('\x27'+_0x1503ee+'\x27','updatedAt')['from'](_0xfccb('0x79'))[_0xfccb('0x3d')](_0xfccb('0x7a'))[_0xfccb('0x3d')]('ListId\x20=\x20?',_0x2ec9b0[_0xfccb('0x77')][_0xfccb('0x78')]())[_0xfccb('0x3d')](_0xfccb('0x7b'))[_0xfccb('0x3d')](_0xfccb('0x7c'),squel['select']()[_0xfccb('0x74')](_0xfccb('0x7d'))[_0xfccb('0x7e')](_0xfccb('0x7f'))[_0xfccb('0x3d')]('CampaignId\x20=\x20?',_0x5d7f8b['params']['id'][_0xfccb('0x78')]()))[_0xfccb('0x3d')]('phone\x20NOT\x20IN\x20(?)',squel[_0xfccb('0x73')]()[_0xfccb('0x74')](_0xfccb('0x80'))['from'](_0xfccb('0x6e'))[_0xfccb('0x3d')](_0xfccb('0x81'),_0x5d7f8b[_0xfccb('0x48')]['id']['toString']())))['toString']();break;case _0xfccb('0x82'):_0xcbc0c=squel[_0xfccb('0x6c')]()[_0xfccb('0x6d')](_0xfccb('0x6e'))[_0xfccb('0x6f')]([_0xfccb('0x70'),_0xfccb('0x71'),'ContactId',_0xfccb('0x72'),_0xfccb('0x5a'),'createdAt','updatedAt'],squel['select']()['field']('phone','phone')[_0xfccb('0x74')]('NOW()',_0xfccb('0x71'))['field']('id','ContactId')['field'](_0x2ec9b0['CmListId']['toString'](),_0xfccb('0x72'))[_0xfccb('0x74')](_0x5d7f8b[_0xfccb('0x48')]['id'][_0xfccb('0x78')](),_0xfccb('0x5a'))[_0xfccb('0x74')]('\x27'+_0x1503ee+'\x27',_0xfccb('0x57'))[_0xfccb('0x74')]('\x27'+_0x1503ee+'\x27',_0xfccb('0x56'))[_0xfccb('0x7e')](_0xfccb('0x79'))[_0xfccb('0x3d')](_0xfccb('0x7a'))['where'](_0xfccb('0x83'),_0x2ec9b0[_0xfccb('0x77')][_0xfccb('0x78')]())[_0xfccb('0x3d')](_0xfccb('0x7b'))[_0xfccb('0x3d')](_0xfccb('0x7c'),squel['select']()[_0xfccb('0x74')](_0xfccb('0x80'))[_0xfccb('0x7e')](_0xfccb('0x6e'))[_0xfccb('0x3d')](_0xfccb('0x81'),_0x5d7f8b[_0xfccb('0x48')]['id'][_0xfccb('0x78')]())))[_0xfccb('0x78')]();break;default:_0xcbc0c=squel[_0xfccb('0x6c')]()['into'](_0xfccb('0x6e'))[_0xfccb('0x6f')]([_0xfccb('0x70'),'scheduledAt',_0xfccb('0x76'),_0xfccb('0x72'),_0xfccb('0x5a'),_0xfccb('0x57'),'updatedAt'],squel[_0xfccb('0x73')]()[_0xfccb('0x74')](_0xfccb('0x70'),'phone')['field'](_0xfccb('0x75'),'scheduledAt')[_0xfccb('0x74')]('id','ContactId')[_0xfccb('0x74')](_0x2ec9b0[_0xfccb('0x77')][_0xfccb('0x78')](),_0xfccb('0x72'))[_0xfccb('0x74')](_0x5d7f8b['params']['id'][_0xfccb('0x78')](),'CampaignId')[_0xfccb('0x74')]('\x27'+_0x1503ee+'\x27',_0xfccb('0x57'))[_0xfccb('0x74')]('\x27'+_0x1503ee+'\x27',_0xfccb('0x56'))[_0xfccb('0x7e')](_0xfccb('0x79'))[_0xfccb('0x3d')](_0xfccb('0x7a'))[_0xfccb('0x3d')](_0xfccb('0x83'),_0x2ec9b0[_0xfccb('0x77')][_0xfccb('0x78')]())[_0xfccb('0x3d')](_0xfccb('0x7b')))[_0xfccb('0x78')]();}_0x48f195=squel['insert']()[_0xfccb('0x6d')](_0xfccb('0x84'))['fromQuery']([_0xfccb('0x85'),_0xfccb('0x71'),_0xfccb('0x70'),_0xfccb('0x86'),_0xfccb('0x57'),_0xfccb('0x56')],squel[_0xfccb('0x73')]()['field'](_0xfccb('0x87'),'id')['field'](_0xfccb('0x75'),_0xfccb('0x71'))[_0xfccb('0x74')](_0xfccb('0x88'),_0xfccb('0x70'))[_0xfccb('0x74')](_0xfccb('0x89'),_0xfccb('0x86'))['field']('\x27'+_0x1503ee+'\x27',_0xfccb('0x57'))['field']('\x27'+_0x1503ee+'\x27','updatedAt')[_0xfccb('0x7e')](_0xfccb('0x8a'),'ci')[_0xfccb('0x8b')]('cm_hopper','h','h.ContactId\x20=\x20ci.CmContactId')[_0xfccb('0x3d')](_0xfccb('0x8c'),_0x2ec9b0['CmListId'][_0xfccb('0x78')]())['where'](_0xfccb('0x8d'),_0x5d7f8b['params']['id'][_0xfccb('0x78')]())[_0xfccb('0x3d')](_0xfccb('0x8e'),_0x1503ee))['toString']();_0x1dcfe3[_0xfccb('0x8f')](db[_0xfccb('0x90')][_0xfccb('0x33')](_0xcbc0c));_0x5a1e31[_0xfccb('0x8f')](db[_0xfccb('0x90')][_0xfccb('0x33')](_0x48f195));}return BPromise[_0xfccb('0x91')](_0x1dcfe3);}})['then'](function(){return BPromise[_0xfccb('0x91')](_0x5a1e31);})[_0xfccb('0x25')](function(){return _0x3f7418;})[_0xfccb('0x25')](respondWithResult(_0x215d9a,null))[_0xfccb('0x53')](handleError(_0x215d9a,null));};exports[_0xfccb('0x92')]=function(_0x29fbc5,_0x14e165,_0x33d546){return db[_0xfccb('0x2c')][_0xfccb('0x4a')]({'where':{'id':_0x29fbc5['params']['id']}})['then'](handleEntityNotFound(_0x14e165,null))['then'](function(_0x50cb49){if(_0x50cb49){return _0x50cb49[_0xfccb('0x92')](_0x29fbc5['query']['ids']);}})[_0xfccb('0x25')](function(_0x1851ff){if(_0x1851ff){return db[_0xfccb('0x59')]['destroy']({'where':{'ListId':_0x29fbc5[_0xfccb('0x33')][_0xfccb('0x68')],'CampaignId':_0x29fbc5['params']['id']}})['then'](function(){return _0x1851ff;});}})[_0xfccb('0x25')](respondWithStatusCode(_0x14e165,null))['catch'](handleError(_0x14e165,null));};exports[_0xfccb('0x93')]=function(_0x4bec17,_0x14d110,_0x124445){var _0x2842a6={};var _0x1d776e={};var _0x13455a;var _0x1f374b;return db[_0xfccb('0x2c')]['findOne']({'where':{'id':_0x4bec17['params']['id']}})[_0xfccb('0x25')](handleEntityNotFound(_0x14d110,null))[_0xfccb('0x25')](function(_0x1c4c9f){if(_0x1c4c9f){_0x13455a=_0x1c4c9f;_0x1d776e[_0xfccb('0x31')]=_[_0xfccb('0x49')](db[_0xfccb('0x64')][_0xfccb('0x2d')]);_0x1d776e[_0xfccb('0x33')]=_['keys'](_0x4bec17[_0xfccb('0x33')]);_0x1d776e[_0xfccb('0x34')]=_[_0xfccb('0x35')](_0x1d776e['model'],_0x1d776e[_0xfccb('0x33')]);_0x2842a6[_0xfccb('0x37')]=_[_0xfccb('0x35')](_0x1d776e['model'],qs[_0xfccb('0x36')](_0x4bec17[_0xfccb('0x33')]['fields']));_0x2842a6[_0xfccb('0x37')]=_0x2842a6[_0xfccb('0x37')]['length']?_0x2842a6[_0xfccb('0x37')]:_0x1d776e[_0xfccb('0x31')];_0x2842a6[_0xfccb('0x5e')]=qs[_0xfccb('0x3c')](_0x4bec17[_0xfccb('0x33')][_0xfccb('0x3c')]);_0x2842a6['where']=qs[_0xfccb('0x34')](_[_0xfccb('0x3e')](_0x4bec17[_0xfccb('0x33')],_0x1d776e[_0xfccb('0x34')]));if(_0x4bec17[_0xfccb('0x33')]['filter']){_0x2842a6[_0xfccb('0x3d')]=_[_0xfccb('0x40')](_0x2842a6[_0xfccb('0x3d')],{'$or':_[_0xfccb('0x32')](_0x2842a6[_0xfccb('0x37')],function(_0x1855f3){var _0x2dc8a1={};_0x2dc8a1[_0x1855f3]={'$like':'%'+_0x4bec17[_0xfccb('0x33')][_0xfccb('0x3f')]+'%'};return _0x2dc8a1;})});}_0x2842a6=_[_0xfccb('0x40')]({},_0x2842a6,_0x4bec17['options']);return _0x13455a[_0xfccb('0x93')](_0x2842a6);}})[_0xfccb('0x25')](function(_0x184a8d){if(_0x184a8d){_0x1f374b=_0x184a8d[_0xfccb('0x38')];if(!_0x4bec17[_0xfccb('0x33')][_0xfccb('0x39')](_0xfccb('0x3a'))){_0x2842a6['limit']=qs['limit'](_0x4bec17[_0xfccb('0x33')][_0xfccb('0x3b')]);_0x2842a6[_0xfccb('0x19')]=qs[_0xfccb('0x19')](_0x4bec17[_0xfccb('0x33')][_0xfccb('0x19')]);}return _0x13455a[_0xfccb('0x93')](_0x2842a6);}})['then'](function(_0x137e3a){if(_0x137e3a){return _0x137e3a?{'count':_0x1f374b,'rows':_0x137e3a}:null;}})['then'](respondWithResult(_0x14d110,null))[_0xfccb('0x53')](handleError(_0x14d110,null));};exports[_0xfccb('0x94')]=function(_0x1ba756,_0x9b28d1,_0x2ca0fe){var _0x54e402,_0x5d595e;var _0x115be7=[];var _0x39005e=moment()[_0xfccb('0x65')](_0xfccb('0x66'));return db[_0xfccb('0x2c')][_0xfccb('0x4a')]({'where':{'id':_0x1ba756['params']['id']}})['then'](handleEntityNotFound(_0x9b28d1,null))['then'](function(_0x135ef1){if(_0x135ef1){_0x5d595e=_0x135ef1;return _0x135ef1[_0xfccb('0x94')](_0x1ba756[_0xfccb('0x4b')][_0xfccb('0x68')],_[_0xfccb('0x55')](_0x1ba756[_0xfccb('0x4b')],[_0xfccb('0x68'),'id'])||{});}return null;})[_0xfccb('0x69')](function(_0x56f0ed){var _0x14ad3a;var _0x29e6d8;_0x54e402=_0x56f0ed||[];var _0x35baae=[];if(_0x56f0ed){for(var _0x4b5d97=0x0;_0x4b5d97<_0x56f0ed['length'];_0x4b5d97+=0x1){var _0xa91494=_0x56f0ed[_0x4b5d97][_0xfccb('0x22')]({'plain':!![]});_0x14ad3a=squel[_0xfccb('0x6c')]()['into'](_0xfccb('0x95'))['fromQuery']([_0xfccb('0x70'),'ContactId',_0xfccb('0x72'),'CampaignId','createdAt',_0xfccb('0x56')],squel[_0xfccb('0x73')]()['field'](_0xfccb('0x70'),_0xfccb('0x70'))[_0xfccb('0x74')]('id','ContactId')[_0xfccb('0x74')](_0xa91494[_0xfccb('0x77')]['toString'](),_0xfccb('0x72'))[_0xfccb('0x74')](_0x1ba756['params']['id'][_0xfccb('0x78')](),_0xfccb('0x5a'))[_0xfccb('0x74')]('NOW()','createdAt')[_0xfccb('0x74')](_0xfccb('0x75'),_0xfccb('0x56'))[_0xfccb('0x7e')](_0xfccb('0x79'))[_0xfccb('0x3d')](_0xfccb('0x7a'))[_0xfccb('0x3d')](_0xfccb('0x83'),_0xa91494[_0xfccb('0x77')][_0xfccb('0x78')]())['where']('phone\x20IS\x20NOT\x20NULL'))['toString']();_0x35baae['push'](db['sequelize'][_0xfccb('0x33')](_0x14ad3a));}return BPromise[_0xfccb('0x91')](_0x35baae);}})[_0xfccb('0x25')](function(){return _0x54e402;})[_0xfccb('0x25')](respondWithResult(_0x9b28d1,null))[_0xfccb('0x53')](handleError(_0x9b28d1,null));};exports[_0xfccb('0x96')]=function(_0x3eecd3,_0x1492ae,_0x55d87a){return db['Campaign'][_0xfccb('0x4a')]({'where':{'id':_0x3eecd3[_0xfccb('0x48')]['id']}})[_0xfccb('0x25')](handleEntityNotFound(_0x1492ae,null))[_0xfccb('0x25')](function(_0x2444fd){if(_0x2444fd){return _0x2444fd[_0xfccb('0x96')](_0x3eecd3[_0xfccb('0x33')][_0xfccb('0x68')]);}})[_0xfccb('0x25')](function(_0x4a6c52){if(_0x4a6c52){return db['CmHopperBlack']['destroy']({'where':{'ListId':_0x3eecd3[_0xfccb('0x33')][_0xfccb('0x68')],'CampaignId':_0x3eecd3[_0xfccb('0x48')]['id']}})[_0xfccb('0x25')](function(){return _0x4a6c52;});}})[_0xfccb('0x25')](respondWithStatusCode(_0x1492ae,null))[_0xfccb('0x53')](handleError(_0x1492ae,null));};
\ No newline at end of file
diff --git a/server/api/campaign/campaign.model.js b/server/api/campaign/campaign.model.js
index ad5b338..0b5325b 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(_0x504dee,_0x3cefd3){var _0x3fb6c0=function(_0x188524){while(--_0x188524){_0x504dee['push'](_0x504dee['shift']());}};_0x3fb6c0(++_0x3cefd3);}(_0x7a54,0x106));var _0x47a5=function(_0x546555,_0x2344d4){_0x546555=_0x546555-0x0;var _0x24c347=_0x7a54[_0x546555];return _0x24c347;};'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(_0x51d26e,_0x5bc3ae){var _0x10c10a=function(_0x21a675){while(--_0x21a675){_0x51d26e['push'](_0x51d26e['shift']());}};_0x10c10a(++_0x5bc3ae);}(_0x7a54,0x106));var _0x47a5=function(_0x567a7f,_0x49da2f){_0x567a7f=_0x567a7f-0x0;var _0x1305cf=_0x7a54[_0x567a7f];return _0x1305cf;};'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 ba5fd60..e0b1159 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 _0xacfe=['where','attributes','limit','map','include','model','then','GetCampaign','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','Campaign,\x20%s,\x20%s','request\x20sent','debug','Campaign,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','catch','findAll','options','raw'];(function(_0x5f3f88,_0x562baf){var _0xd08119=function(_0x42dbf7){while(--_0x42dbf7){_0x5f3f88['push'](_0x5f3f88['shift']());}};_0xd08119(++_0x562baf);}(_0xacfe,0xfd));var _0xeacf=function(_0x15bc81,_0x4d4f77){_0x15bc81=_0x15bc81-0x0;var _0x59440e=_0xacfe[_0x15bc81];return _0x59440e;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0xeacf('0x0'));var BPromise=require(_0xeacf('0x1'));var rs=require(_0xeacf('0x2'));var fs=require('fs');var Redis=require(_0xeacf('0x3'));var db=require(_0xeacf('0x4'))['db'];var utils=require(_0xeacf('0x5'));var logger=require(_0xeacf('0x6'))(_0xeacf('0x7'));var config=require(_0xeacf('0x8'));var jayson=require(_0xeacf('0x9'));var client=jayson[_0xeacf('0xa')][_0xeacf('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x13cba2,_0x5eb516,_0x411634){return new BPromise(function(_0xce0437,_0x17b21c){return client[_0xeacf('0xc')](_0x13cba2,_0x411634)['then'](function(_0xfe344){logger['info'](_0xeacf('0xd'),_0x5eb516,_0xeacf('0xe'));logger[_0xeacf('0xf')](_0xeacf('0x10'),_0x5eb516,_0xeacf('0xe'),JSON[_0xeacf('0x11')](_0xfe344));if(_0xfe344[_0xeacf('0x12')]){if(_0xfe344[_0xeacf('0x12')][_0xeacf('0x13')]===0x1f4){logger[_0xeacf('0x12')]('Campaign,\x20%s,\x20%s',_0x5eb516,_0xfe344[_0xeacf('0x12')][_0xeacf('0x14')]);return _0x17b21c(_0xfe344[_0xeacf('0x12')][_0xeacf('0x14')]);}logger['error'](_0xeacf('0xd'),_0x5eb516,_0xfe344[_0xeacf('0x12')][_0xeacf('0x14')]);return _0xce0437(_0xfe344['error']['message']);}else{logger[_0xeacf('0x15')](_0xeacf('0xd'),_0x5eb516,'request\x20sent');_0xce0437(_0xfe344[_0xeacf('0x16')]['message']);}})[_0xeacf('0x17')](function(_0x1df080){logger['error'](_0xeacf('0xd'),_0x5eb516,_0x1df080);_0x17b21c(_0x1df080);});});}exports['GetCampaign']=function(_0x650730){var _0xe87314=this;return new Promise(function(_0x18de20,_0x118932){return db['Campaign'][_0xeacf('0x18')]({'raw':_0x650730['options']?_0x650730[_0xeacf('0x19')][_0xeacf('0x1a')]===undefined?!![]:![]:!![],'where':_0x650730[_0xeacf('0x19')]?_0x650730['options'][_0xeacf('0x1b')]||null:null,'attributes':_0x650730[_0xeacf('0x19')]?_0x650730[_0xeacf('0x19')][_0xeacf('0x1c')]||null:null,'limit':_0x650730[_0xeacf('0x19')]?_0x650730[_0xeacf('0x19')][_0xeacf('0x1d')]||null:null,'include':_0x650730[_0xeacf('0x19')]?_0x650730[_0xeacf('0x19')]['include']?_[_0xeacf('0x1e')](_0x650730[_0xeacf('0x19')][_0xeacf('0x1f')],function(_0x35338b){return{'model':db[_0x35338b[_0xeacf('0x20')]],'as':_0x35338b['as'],'attributes':_0x35338b[_0xeacf('0x1c')],'include':_0x35338b[_0xeacf('0x1f')]?_['map'](_0x35338b['include'],function(_0x4332b7){return{'model':db[_0x4332b7[_0xeacf('0x20')]],'as':_0x4332b7['as'],'attributes':_0x4332b7['attributes'],'include':_0x4332b7[_0xeacf('0x1f')]?_[_0xeacf('0x1e')](_0x4332b7[_0xeacf('0x1f')],function(_0x1e368a){return{'model':db[_0x1e368a['model']],'as':_0x1e368a['as'],'attributes':_0x1e368a[_0xeacf('0x1c')]};}):[]};}):[]};}):[]:[]})[_0xeacf('0x21')](function(_0x4c161e){logger[_0xeacf('0x15')](_0xeacf('0x22'),_0x650730);logger[_0xeacf('0xf')](_0xeacf('0x22'),_0x650730,JSON['stringify'](_0x4c161e));_0x18de20(_0x4c161e);})[_0xeacf('0x17')](function(_0x1d375a){logger['error']('GetCampaign',_0x1d375a['message'],_0x650730);_0x118932(_0xe87314['error'](0x1f4,_0x1d375a[_0xeacf('0x14')]));});});};
\ No newline at end of file
+var _0x7764=['../../mysqldb','../../config/utils','../../config/logger','rpc','client','http','request','info','Campaign,\x20%s,\x20%s','request\x20sent','debug','Campaign,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','GetCampaign','Campaign','findAll','options','raw','attributes','limit','map','include','model','then','lodash','util','moment','bluebird','randomstring','ioredis'];(function(_0x35b195,_0x8893d5){var _0x2433bf=function(_0x22be07){while(--_0x22be07){_0x35b195['push'](_0x35b195['shift']());}};_0x2433bf(++_0x8893d5);}(_0x7764,0xa4));var _0x4776=function(_0x1385dc,_0x2c7fd7){_0x1385dc=_0x1385dc-0x0;var _0x2f6469=_0x7764[_0x1385dc];return _0x2f6469;};'use strict';var _=require(_0x4776('0x0'));var util=require(_0x4776('0x1'));var moment=require(_0x4776('0x2'));var BPromise=require(_0x4776('0x3'));var rs=require(_0x4776('0x4'));var fs=require('fs');var Redis=require(_0x4776('0x5'));var db=require(_0x4776('0x6'))['db'];var utils=require(_0x4776('0x7'));var logger=require(_0x4776('0x8'))(_0x4776('0x9'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x4776('0xa')][_0x4776('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x52f59e,_0x1f9a45,_0x2b61c7){return new BPromise(function(_0x4fcbcc,_0x53f976){return client[_0x4776('0xc')](_0x52f59e,_0x2b61c7)['then'](function(_0x35bf06){logger[_0x4776('0xd')](_0x4776('0xe'),_0x1f9a45,_0x4776('0xf'));logger[_0x4776('0x10')](_0x4776('0x11'),_0x1f9a45,_0x4776('0xf'),JSON[_0x4776('0x12')](_0x35bf06));if(_0x35bf06[_0x4776('0x13')]){if(_0x35bf06[_0x4776('0x13')][_0x4776('0x14')]===0x1f4){logger[_0x4776('0x13')](_0x4776('0xe'),_0x1f9a45,_0x35bf06[_0x4776('0x13')][_0x4776('0x15')]);return _0x53f976(_0x35bf06[_0x4776('0x13')]['message']);}logger['error'](_0x4776('0xe'),_0x1f9a45,_0x35bf06[_0x4776('0x13')][_0x4776('0x15')]);return _0x4fcbcc(_0x35bf06[_0x4776('0x13')][_0x4776('0x15')]);}else{logger[_0x4776('0xd')](_0x4776('0xe'),_0x1f9a45,_0x4776('0xf'));_0x4fcbcc(_0x35bf06[_0x4776('0x16')][_0x4776('0x15')]);}})['catch'](function(_0x46fec7){logger['error'](_0x4776('0xe'),_0x1f9a45,_0x46fec7);_0x53f976(_0x46fec7);});});}exports[_0x4776('0x17')]=function(_0x2366da){var _0xed81b5=this;return new Promise(function(_0xb5c938,_0x4b5f50){return db[_0x4776('0x18')][_0x4776('0x19')]({'raw':_0x2366da['options']?_0x2366da[_0x4776('0x1a')][_0x4776('0x1b')]===undefined?!![]:![]:!![],'where':_0x2366da[_0x4776('0x1a')]?_0x2366da[_0x4776('0x1a')]['where']||null:null,'attributes':_0x2366da[_0x4776('0x1a')]?_0x2366da[_0x4776('0x1a')][_0x4776('0x1c')]||null:null,'limit':_0x2366da[_0x4776('0x1a')]?_0x2366da['options'][_0x4776('0x1d')]||null:null,'include':_0x2366da[_0x4776('0x1a')]?_0x2366da[_0x4776('0x1a')]['include']?_[_0x4776('0x1e')](_0x2366da[_0x4776('0x1a')][_0x4776('0x1f')],function(_0x54f3de){return{'model':db[_0x54f3de['model']],'as':_0x54f3de['as'],'attributes':_0x54f3de['attributes'],'include':_0x54f3de[_0x4776('0x1f')]?_[_0x4776('0x1e')](_0x54f3de[_0x4776('0x1f')],function(_0xdfe443){return{'model':db[_0xdfe443[_0x4776('0x20')]],'as':_0xdfe443['as'],'attributes':_0xdfe443[_0x4776('0x1c')],'include':_0xdfe443[_0x4776('0x1f')]?_['map'](_0xdfe443[_0x4776('0x1f')],function(_0x1de3d1){return{'model':db[_0x1de3d1['model']],'as':_0x1de3d1['as'],'attributes':_0x1de3d1[_0x4776('0x1c')]};}):[]};}):[]};}):[]:[]})[_0x4776('0x21')](function(_0x4b8aeb){logger[_0x4776('0xd')](_0x4776('0x17'),_0x2366da);logger[_0x4776('0x10')](_0x4776('0x17'),_0x2366da,JSON[_0x4776('0x12')](_0x4b8aeb));_0xb5c938(_0x4b8aeb);})['catch'](function(_0x4bfd4b){logger[_0x4776('0x13')](_0x4776('0x17'),_0x4bfd4b[_0x4776('0x15')],_0x2366da);_0x4b5f50(_0xed81b5['error'](0x1f4,_0x4bfd4b[_0x4776('0x15')]));});});};
\ No newline at end of file
diff --git a/server/api/campaign/index.js b/server/api/campaign/index.js
index 85094b1..129dafd 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 _0x141a=['getHopperFinals','/:id/hopper_black','getHopperBlacks','/:id/lists','/:id/blacklists','post','create','/:id/clone','addBlackLists','put','update','delete','destroy','removeLists','removeBlackLists','multer','util','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./campaign.controller','get','isAuthenticated','/:id','show','/:id/hoppers','getHoppers','/:id/hopper_histories','getHopperHistories','/:id/hopper_finals'];(function(_0xee397d,_0x5cf526){var _0x1ec970=function(_0x4c2771){while(--_0x4c2771){_0xee397d['push'](_0xee397d['shift']());}};_0x1ec970(++_0x5cf526);}(_0x141a,0xfd));var _0xa141=function(_0x1e797a,_0x2ef1be){_0x1e797a=_0x1e797a-0x0;var _0x3ffe38=_0x141a[_0x1e797a];return _0x3ffe38;};'use strict';var multer=require(_0xa141('0x0'));var util=require(_0xa141('0x1'));var path=require('path');var timeout=require(_0xa141('0x2'));var express=require(_0xa141('0x3'));var router=express[_0xa141('0x4')]();var fs_extra=require(_0xa141('0x5'));var auth=require(_0xa141('0x6'));var interaction=require(_0xa141('0x7'));var config=require(_0xa141('0x8'));var controller=require(_0xa141('0x9'));router[_0xa141('0xa')]('/',auth[_0xa141('0xb')](),controller['index']);router[_0xa141('0xa')](_0xa141('0xc'),auth[_0xa141('0xb')](),controller[_0xa141('0xd')]);router['get'](_0xa141('0xe'),auth[_0xa141('0xb')](),controller[_0xa141('0xf')]);router[_0xa141('0xa')](_0xa141('0x10'),auth[_0xa141('0xb')](),controller[_0xa141('0x11')]);router[_0xa141('0xa')](_0xa141('0x12'),auth['isAuthenticated'](),controller[_0xa141('0x13')]);router[_0xa141('0xa')](_0xa141('0x14'),auth[_0xa141('0xb')](),controller[_0xa141('0x15')]);router['get'](_0xa141('0x16'),auth['isAuthenticated'](),controller['getLists']);router[_0xa141('0xa')](_0xa141('0x17'),auth[_0xa141('0xb')](),controller['getBlackLists']);router[_0xa141('0x18')]('/',auth['isAuthenticated'](),controller[_0xa141('0x19')]);router['post'](_0xa141('0x1a'),auth[_0xa141('0xb')](),controller['clone']);router['post'](_0xa141('0x16'),auth[_0xa141('0xb')](),controller['addLists']);router['post'](_0xa141('0x17'),auth['isAuthenticated'](),controller[_0xa141('0x1b')]);router[_0xa141('0x1c')](_0xa141('0xc'),auth['isAuthenticated'](),controller[_0xa141('0x1d')]);router[_0xa141('0x1e')](_0xa141('0xc'),auth['isAuthenticated'](),controller[_0xa141('0x1f')]);router[_0xa141('0x1e')](_0xa141('0x16'),auth[_0xa141('0xb')](),controller[_0xa141('0x20')]);router[_0xa141('0x1e')](_0xa141('0x17'),auth[_0xa141('0xb')](),controller[_0xa141('0x21')]);module['exports']=router;
\ No newline at end of file
+var _0x954d=['clone','addLists','addBlackLists','put','update','destroy','removeLists','delete','removeBlackLists','exports','connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment','./campaign.controller','get','/:id','show','/:id/hoppers','isAuthenticated','getHoppers','/:id/hopper_histories','getHopperHistories','/:id/hopper_finals','/:id/hopper_black','getHopperBlacks','/:id/lists','getLists','/:id/blacklists','post','/:id/clone'];(function(_0x466af7,_0x2f7551){var _0x348c96=function(_0x2d7477){while(--_0x2d7477){_0x466af7['push'](_0x466af7['shift']());}};_0x348c96(++_0x2f7551);}(_0x954d,0x196));var _0xd954=function(_0x20a68a,_0x54502e){_0x20a68a=_0x20a68a-0x0;var _0x56c5d4=_0x954d[_0x20a68a];return _0x56c5d4;};'use strict';var multer=require('multer');var util=require('util');var path=require('path');var timeout=require(_0xd954('0x0'));var express=require(_0xd954('0x1'));var router=express[_0xd954('0x2')]();var fs_extra=require(_0xd954('0x3'));var auth=require('../../components/auth/service');var interaction=require(_0xd954('0x4'));var config=require(_0xd954('0x5'));var controller=require(_0xd954('0x6'));router['get']('/',auth['isAuthenticated'](),controller['index']);router[_0xd954('0x7')](_0xd954('0x8'),auth['isAuthenticated'](),controller[_0xd954('0x9')]);router[_0xd954('0x7')](_0xd954('0xa'),auth[_0xd954('0xb')](),controller[_0xd954('0xc')]);router[_0xd954('0x7')](_0xd954('0xd'),auth['isAuthenticated'](),controller[_0xd954('0xe')]);router[_0xd954('0x7')](_0xd954('0xf'),auth['isAuthenticated'](),controller['getHopperFinals']);router['get'](_0xd954('0x10'),auth[_0xd954('0xb')](),controller[_0xd954('0x11')]);router[_0xd954('0x7')](_0xd954('0x12'),auth[_0xd954('0xb')](),controller[_0xd954('0x13')]);router[_0xd954('0x7')](_0xd954('0x14'),auth[_0xd954('0xb')](),controller['getBlackLists']);router[_0xd954('0x15')]('/',auth[_0xd954('0xb')](),controller['create']);router[_0xd954('0x15')](_0xd954('0x16'),auth['isAuthenticated'](),controller[_0xd954('0x17')]);router[_0xd954('0x15')]('/:id/lists',auth[_0xd954('0xb')](),controller[_0xd954('0x18')]);router[_0xd954('0x15')]('/:id/blacklists',auth[_0xd954('0xb')](),controller[_0xd954('0x19')]);router[_0xd954('0x1a')](_0xd954('0x8'),auth[_0xd954('0xb')](),controller[_0xd954('0x1b')]);router['delete'](_0xd954('0x8'),auth[_0xd954('0xb')](),controller[_0xd954('0x1c')]);router['delete'](_0xd954('0x12'),auth[_0xd954('0xb')](),controller[_0xd954('0x1d')]);router[_0xd954('0x1e')](_0xd954('0x14'),auth[_0xd954('0xb')](),controller[_0xd954('0x1f')]);module[_0xd954('0x20')]=router;
\ No newline at end of file
diff --git a/server/api/cannedAnswer/cannedAnswer.attributes.js b/server/api/cannedAnswer/cannedAnswer.attributes.js
index e236220..2ffaf8c 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 _0x2f99=['STRING','TEXT','VIRTUAL','getDataValue','sequelize'];(function(_0x23d946,_0x4e3420){var _0x4699be=function(_0x54ea70){while(--_0x54ea70){_0x23d946['push'](_0x23d946['shift']());}};_0x4699be(++_0x4e3420);}(_0x2f99,0x1f3));var _0x92f9=function(_0x137d0a,_0x5e2ba2){_0x137d0a=_0x137d0a-0x0;var _0x3d4f4e=_0x2f99[_0x137d0a];return _0x3d4f4e;};'use strict';var Sequelize=require(_0x92f9('0x0'));module['exports']={'key':{'type':Sequelize[_0x92f9('0x1')],'allowNull':![]},'value':{'type':Sequelize[_0x92f9('0x2')],'length':'medium','allowNull':![]},'description':{'type':Sequelize[_0x92f9('0x1')]},'name':{'type':Sequelize[_0x92f9('0x3')],'get':function(){return this[_0x92f9('0x4')]('key');}}};
\ No newline at end of file
+var _0x084f=['exports','STRING','medium','VIRTUAL','getDataValue','key','sequelize'];(function(_0x4db94d,_0x4b1865){var _0x17139a=function(_0x40a123){while(--_0x40a123){_0x4db94d['push'](_0x4db94d['shift']());}};_0x17139a(++_0x4b1865);}(_0x084f,0x1aa));var _0xf084=function(_0x4e9628,_0x250573){_0x4e9628=_0x4e9628-0x0;var _0x27bc8c=_0x084f[_0x4e9628];return _0x27bc8c;};'use strict';var Sequelize=require(_0xf084('0x0'));module[_0xf084('0x1')]={'key':{'type':Sequelize[_0xf084('0x2')],'allowNull':![]},'value':{'type':Sequelize['TEXT'],'length':_0xf084('0x3'),'allowNull':![]},'description':{'type':Sequelize[_0xf084('0x2')]},'name':{'type':Sequelize[_0xf084('0x4')],'get':function(){return this[_0xf084('0x5')](_0xf084('0x6'));}}};
\ No newline at end of file
diff --git a/server/api/cannedAnswer/cannedAnswer.controller.js b/server/api/cannedAnswer/cannedAnswer.controller.js
index e531769..3699bec 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 _0x1bac=['Sequelize','ValidationError','The\x20inserted\x20key\x20already\x20exists.','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','eml-format','rimraf','fast-json-patch','request-promise','moment','mustache','util','to-csv','ejs','fs-extra','crypto','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','end','json','limit','undefined','offset','count','set','apply','reject','save','update','then','destroy','get','CannedAnswers','UserProfileResource','error','name','send','index','CannedAnswer','fieldName','type','model','map','query','filters','intersection','attributes','fields','length','hasOwnProperty','order','sort','where','pick','filter','merge','findAll','show','params','keys','rawAttributes','includeAll','include','find','catch','body','create','key','MailAccountId','SmsAccountId','OpenchannelAccountId','ChatWebsiteId'];(function(_0x28aea5,_0x3bb12e){var _0x6a55f9=function(_0xf6ece8){while(--_0xf6ece8){_0x28aea5['push'](_0x28aea5['shift']());}};_0x6a55f9(++_0x3bb12e);}(_0x1bac,0x1bc));var _0xc1ba=function(_0x11f93c,_0x55ef26){_0x11f93c=_0x11f93c-0x0;var _0x4cb995=_0x1bac[_0x11f93c];return _0x4cb995;};'use strict';var emlformat=require(_0xc1ba('0x0'));var rimraf=require(_0xc1ba('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xc1ba('0x2'));var rp=require(_0xc1ba('0x3'));var moment=require(_0xc1ba('0x4'));var BPromise=require('bluebird');var Mustache=require(_0xc1ba('0x5'));var util=require(_0xc1ba('0x6'));var path=require('path');var sox=require('sox');var csv=require(_0xc1ba('0x7'));var ejs=require(_0xc1ba('0x8'));var fs=require('fs');var fs_extra=require(_0xc1ba('0x9'));var _=require('lodash');var squel=require('squel');var crypto=require(_0xc1ba('0xa'));var jsforce=require('jsforce');var deskjs=require(_0xc1ba('0xb'));var toCsv=require(_0xc1ba('0x7'));var querystring=require(_0xc1ba('0xc'));var Papa=require(_0xc1ba('0xd'));var Redis=require(_0xc1ba('0xe'));var authService=require('../../components/auth/service');var qs=require(_0xc1ba('0xf'));var as=require(_0xc1ba('0x10'));var hardwareService=require(_0xc1ba('0x11'));var logger=require('../../config/logger')(_0xc1ba('0x12'));var utils=require(_0xc1ba('0x13'));var config=require('../../config/environment');var licenseUtil=require(_0xc1ba('0x14'));var db=require(_0xc1ba('0x15'))['db'];function respondWithStatusCode(_0x55cab7,_0x310576){_0x310576=_0x310576||0xcc;return function(_0x1f428c){if(_0x1f428c){return _0x55cab7[_0xc1ba('0x16')](_0x310576);}return _0x55cab7[_0xc1ba('0x17')](_0x310576)[_0xc1ba('0x18')]();};}function respondWithResult(_0x6e28c1,_0x2031f3){_0x2031f3=_0x2031f3||0xc8;return function(_0x1111e4){if(_0x1111e4){return _0x6e28c1['status'](_0x2031f3)[_0xc1ba('0x19')](_0x1111e4);}};}function respondWithFilteredResult(_0x43cda1,_0x375d89){return function(_0x3309b4){if(_0x3309b4){var _0x243dd0=typeof _0x375d89['offset']==='undefined'&&typeof _0x375d89[_0xc1ba('0x1a')]===_0xc1ba('0x1b');var _0x5674e5=_0x3309b4['count'];var _0x35878e=_0x243dd0?0x0:_0x375d89[_0xc1ba('0x1c')];var _0x2ba3d9=_0x243dd0?_0x3309b4[_0xc1ba('0x1d')]:_0x375d89[_0xc1ba('0x1c')]+_0x375d89[_0xc1ba('0x1a')];var _0x2932c2;if(_0x2ba3d9>=_0x5674e5){_0x2ba3d9=_0x5674e5;_0x2932c2=0xc8;}else{_0x2932c2=0xce;}_0x43cda1['status'](_0x2932c2);return _0x43cda1[_0xc1ba('0x1e')]('Content-Range',_0x35878e+'-'+_0x2ba3d9+'/'+_0x5674e5)[_0xc1ba('0x19')](_0x3309b4);}return null;};}function patchUpdates(_0x848b1){return function(_0x15bd12){try{jsonpatch[_0xc1ba('0x1f')](_0x15bd12,_0x848b1,!![]);}catch(_0x4384b1){return BPromise[_0xc1ba('0x20')](_0x4384b1);}return _0x15bd12[_0xc1ba('0x21')]();};}function saveUpdates(_0x2b7c3d,_0x2ff22f){return function(_0x3fda38){if(_0x3fda38){return _0x3fda38[_0xc1ba('0x22')](_0x2b7c3d)[_0xc1ba('0x23')](function(_0x3d24dd){return _0x3d24dd;});}return null;};}function removeEntity(_0x95fdf2,_0x4b9a8d){return function(_0x301d76){if(_0x301d76){return _0x301d76[_0xc1ba('0x24')]()[_0xc1ba('0x23')](function(){var _0x38e98d=_0x301d76[_0xc1ba('0x25')]({'plain':!![]});var _0x31c620=_0xc1ba('0x26');return db[_0xc1ba('0x27')][_0xc1ba('0x24')]({'where':{'type':_0x31c620,'resourceId':_0x38e98d['id']}})['then'](function(){return _0x301d76;});})[_0xc1ba('0x23')](function(){_0x95fdf2[_0xc1ba('0x17')](0xcc)['end']();});}};}function handleEntityNotFound(_0x46baad,_0x33b05c){return function(_0x23ea95){if(!_0x23ea95){_0x46baad[_0xc1ba('0x16')](0x194);}return _0x23ea95;};}function handleError(_0x1a381a,_0x3811ba){_0x3811ba=_0x3811ba||0x1f4;return function(_0x3f8d4c){logger[_0xc1ba('0x28')](_0x3f8d4c['stack']);if(_0x3f8d4c['name']){delete _0x3f8d4c[_0xc1ba('0x29')];}_0x1a381a[_0xc1ba('0x17')](_0x3811ba)[_0xc1ba('0x2a')](_0x3f8d4c);};}exports[_0xc1ba('0x2b')]=function(_0x2c5b04,_0x116b3b){var _0x283ae9={},_0x54ea08={},_0x5c5b41={'count':0x0,'rows':[]};var _0x65930d=_['map'](db[_0xc1ba('0x2c')]['rawAttributes'],function(_0x1a4fb9){return{'name':_0x1a4fb9[_0xc1ba('0x2d')],'type':_0x1a4fb9[_0xc1ba('0x2e')]['key']};});_0x54ea08[_0xc1ba('0x2f')]=_[_0xc1ba('0x30')](_0x65930d,_0xc1ba('0x29'));_0x54ea08[_0xc1ba('0x31')]=_['keys'](_0x2c5b04[_0xc1ba('0x31')]);_0x54ea08[_0xc1ba('0x32')]=_[_0xc1ba('0x33')](_0x54ea08[_0xc1ba('0x2f')],_0x54ea08[_0xc1ba('0x31')]);_0x283ae9[_0xc1ba('0x34')]=_[_0xc1ba('0x33')](_0x54ea08[_0xc1ba('0x2f')],qs['fields'](_0x2c5b04[_0xc1ba('0x31')][_0xc1ba('0x35')]));_0x283ae9[_0xc1ba('0x34')]=_0x283ae9[_0xc1ba('0x34')][_0xc1ba('0x36')]?_0x283ae9['attributes']:_0x54ea08[_0xc1ba('0x2f')];if(!_0x2c5b04[_0xc1ba('0x31')][_0xc1ba('0x37')]('nolimit')){_0x283ae9[_0xc1ba('0x1a')]=qs[_0xc1ba('0x1a')](_0x2c5b04['query'][_0xc1ba('0x1a')]);_0x283ae9[_0xc1ba('0x1c')]=qs[_0xc1ba('0x1c')](_0x2c5b04['query']['offset']);}_0x283ae9[_0xc1ba('0x38')]=qs[_0xc1ba('0x39')](_0x2c5b04[_0xc1ba('0x31')][_0xc1ba('0x39')]);_0x283ae9[_0xc1ba('0x3a')]=qs[_0xc1ba('0x32')](_[_0xc1ba('0x3b')](_0x2c5b04['query'],_0x54ea08[_0xc1ba('0x32')]),_0x65930d);if(_0x2c5b04[_0xc1ba('0x31')][_0xc1ba('0x3c')]){_0x283ae9[_0xc1ba('0x3a')]=_[_0xc1ba('0x3d')](_0x283ae9[_0xc1ba('0x3a')],{'$or':[{'key':{'$like':'%'+_0x2c5b04[_0xc1ba('0x31')][_0xc1ba('0x3c')]+'%'}},{'value':{'$like':'%'+_0x2c5b04[_0xc1ba('0x31')][_0xc1ba('0x3c')]+'%'}}]});}_0x283ae9=_[_0xc1ba('0x3d')]({},_0x283ae9,_0x2c5b04['options']);var _0x1d329f={'where':_0x283ae9[_0xc1ba('0x3a')]};return db['CannedAnswer'][_0xc1ba('0x1d')](_0x1d329f)['then'](function(_0x58e9dd){_0x5c5b41[_0xc1ba('0x1d')]=_0x58e9dd;if(_0x2c5b04['query']['includeAll']){_0x283ae9['include']=[{'all':!![]}];}return db['CannedAnswer'][_0xc1ba('0x3e')](_0x283ae9);})[_0xc1ba('0x23')](function(_0x152ba8){_0x5c5b41['rows']=_0x152ba8;return _0x5c5b41;})[_0xc1ba('0x23')](respondWithFilteredResult(_0x116b3b,_0x283ae9))['catch'](handleError(_0x116b3b,null));};exports[_0xc1ba('0x3f')]=function(_0x3906aa,_0x1295bf){var _0x13f5bd={'raw':!![],'where':{'id':_0x3906aa[_0xc1ba('0x40')]['id']}},_0x27826e={};_0x27826e[_0xc1ba('0x2f')]=_[_0xc1ba('0x41')](db[_0xc1ba('0x2c')][_0xc1ba('0x42')]);_0x27826e[_0xc1ba('0x31')]=_['keys'](_0x3906aa[_0xc1ba('0x31')]);_0x27826e[_0xc1ba('0x32')]=_[_0xc1ba('0x33')](_0x27826e[_0xc1ba('0x2f')],_0x27826e[_0xc1ba('0x31')]);_0x13f5bd[_0xc1ba('0x34')]=_[_0xc1ba('0x33')](_0x27826e[_0xc1ba('0x2f')],qs['fields'](_0x3906aa[_0xc1ba('0x31')][_0xc1ba('0x35')]));_0x13f5bd[_0xc1ba('0x34')]=_0x13f5bd[_0xc1ba('0x34')]['length']?_0x13f5bd['attributes']:_0x27826e['model'];if(_0x3906aa['query'][_0xc1ba('0x43')]){_0x13f5bd[_0xc1ba('0x44')]=[{'all':!![]}];}_0x13f5bd=_[_0xc1ba('0x3d')]({},_0x13f5bd,_0x3906aa['options']);return db[_0xc1ba('0x2c')][_0xc1ba('0x45')](_0x13f5bd)[_0xc1ba('0x23')](handleEntityNotFound(_0x1295bf,null))[_0xc1ba('0x23')](respondWithResult(_0x1295bf,null))[_0xc1ba('0x46')](handleError(_0x1295bf,null));};exports['update']=function(_0x2614e5,_0x4fd2f8){if(_0x2614e5[_0xc1ba('0x47')]['id']){delete _0x2614e5[_0xc1ba('0x47')]['id'];}return db[_0xc1ba('0x2c')][_0xc1ba('0x45')]({'where':{'id':_0x2614e5[_0xc1ba('0x40')]['id']}})[_0xc1ba('0x23')](handleEntityNotFound(_0x4fd2f8,null))[_0xc1ba('0x23')](saveUpdates(_0x2614e5[_0xc1ba('0x47')],null))['then'](respondWithResult(_0x4fd2f8,null))['catch'](handleError(_0x4fd2f8,null));};exports[_0xc1ba('0x24')]=function(_0x3d9993,_0x1f7fc0){return db['CannedAnswer']['find']({'where':{'id':_0x3d9993[_0xc1ba('0x40')]['id']}})[_0xc1ba('0x23')](handleEntityNotFound(_0x1f7fc0,null))[_0xc1ba('0x23')](removeEntity(_0x1f7fc0,null))[_0xc1ba('0x46')](handleError(_0x1f7fc0,null));};exports[_0xc1ba('0x48')]=function(_0x55c1df,_0x228d46){var _0x52b57c={'key':_0x55c1df[_0xc1ba('0x47')][_0xc1ba('0x49')]};if(_0x55c1df[_0xc1ba('0x47')]['MailAccountId']){_0x52b57c[_0xc1ba('0x4a')]=_0x55c1df[_0xc1ba('0x47')][_0xc1ba('0x4a')];}else if(_0x55c1df[_0xc1ba('0x47')][_0xc1ba('0x4b')]){_0x52b57c[_0xc1ba('0x4b')]=_0x55c1df[_0xc1ba('0x47')]['SmsAccountId'];}else if(_0x55c1df[_0xc1ba('0x47')][_0xc1ba('0x4c')]){_0x52b57c[_0xc1ba('0x4c')]=_0x55c1df[_0xc1ba('0x47')]['OpenchannelAccountId'];}else if(_0x55c1df[_0xc1ba('0x47')][_0xc1ba('0x4d')]){_0x52b57c[_0xc1ba('0x4d')]=_0x55c1df[_0xc1ba('0x47')]['ChatWebsiteId'];}return db['CannedAnswer']['find']({'where':_0x52b57c})[_0xc1ba('0x23')](function(_0x58895c){if(_0x58895c){throw new db[(_0xc1ba('0x4e'))][(_0xc1ba('0x4f'))](_0xc1ba('0x50'));}return db[_0xc1ba('0x2c')]['create'](_0x55c1df[_0xc1ba('0x47')]);})[_0xc1ba('0x23')](function(_0x58f972){var _0x363dcc=_0x55c1df[_0xc1ba('0x51')][_0xc1ba('0x25')]({'plain':!![]});if(!_0x363dcc)throw new Error(_0xc1ba('0x52'));if(_0x363dcc[_0xc1ba('0x53')]===_0xc1ba('0x51')){var _0x54b157=_0x58f972[_0xc1ba('0x25')]({'plain':!![]});return db[_0xc1ba('0x54')][_0xc1ba('0x45')]({'where':{'name':_0xc1ba('0x26'),'userProfileId':_0x363dcc[_0xc1ba('0x55')]},'raw':!![]})['then'](function(_0x21175a){if(_0x21175a&&_0x21175a['autoAssociation']===0x0){return db[_0xc1ba('0x27')][_0xc1ba('0x48')]({'name':_0x54b157[_0xc1ba('0x29')],'resourceId':_0x54b157['id'],'type':_0x21175a['name'],'sectionId':_0x21175a['id']},{})[_0xc1ba('0x23')](function(){return _0x58f972;});}else{return _0x58f972;}})['catch'](function(_0x3bd68b){logger[_0xc1ba('0x28')](_0xc1ba('0x56'),_0x3bd68b);throw _0x3bd68b;});}return _0x58f972;})['then'](respondWithResult(_0x228d46,0xc9))[_0xc1ba('0x46')](handleError(_0x228d46,null));};
\ No newline at end of file
+var _0xed24=['api','../../config/utils','../../config/environment','../../config/license/util','sendStatus','status','json','offset','undefined','limit','count','set','Content-Range','apply','save','update','then','destroy','get','UserProfileResource','end','error','stack','name','send','index','map','CannedAnswer','rawAttributes','fieldName','type','keys','query','filters','intersection','model','attributes','fields','length','nolimit','order','sort','where','pick','filter','merge','options','includeAll','include','findAll','rows','catch','show','params','find','body','create','key','MailAccountId','SmsAccountId','OpenchannelAccountId','ChatWebsiteId','Sequelize','The\x20inserted\x20key\x20already\x20exists.','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','CannedAnswers','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','eml-format','zip-dir','fast-json-patch','moment','bluebird','mustache','util','sox','to-csv','ejs','fs-extra','lodash','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware'];(function(_0x2fbf2c,_0xb5a8f9){var _0x132005=function(_0xaa95bb){while(--_0xaa95bb){_0x2fbf2c['push'](_0x2fbf2c['shift']());}};_0x132005(++_0xb5a8f9);}(_0xed24,0x1b7));var _0x4ed2=function(_0x3f08ed,_0x2a6344){_0x3f08ed=_0x3f08ed-0x0;var _0x24ad2f=_0xed24[_0x3f08ed];return _0x24ad2f;};'use strict';var emlformat=require(_0x4ed2('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x4ed2('0x1'));var jsonpatch=require(_0x4ed2('0x2'));var rp=require('request-promise');var moment=require(_0x4ed2('0x3'));var BPromise=require(_0x4ed2('0x4'));var Mustache=require(_0x4ed2('0x5'));var util=require(_0x4ed2('0x6'));var path=require('path');var sox=require(_0x4ed2('0x7'));var csv=require(_0x4ed2('0x8'));var ejs=require(_0x4ed2('0x9'));var fs=require('fs');var fs_extra=require(_0x4ed2('0xa'));var _=require(_0x4ed2('0xb'));var squel=require('squel');var crypto=require(_0x4ed2('0xc'));var jsforce=require(_0x4ed2('0xd'));var deskjs=require(_0x4ed2('0xe'));var toCsv=require('to-csv');var querystring=require(_0x4ed2('0xf'));var Papa=require(_0x4ed2('0x10'));var Redis=require(_0x4ed2('0x11'));var authService=require('../../components/auth/service');var qs=require(_0x4ed2('0x12'));var as=require(_0x4ed2('0x13'));var hardwareService=require(_0x4ed2('0x14'));var logger=require('../../config/logger')(_0x4ed2('0x15'));var utils=require(_0x4ed2('0x16'));var config=require(_0x4ed2('0x17'));var licenseUtil=require(_0x4ed2('0x18'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x4804fe,_0x27b604){_0x27b604=_0x27b604||0xcc;return function(_0x3bfd17){if(_0x3bfd17){return _0x4804fe[_0x4ed2('0x19')](_0x27b604);}return _0x4804fe[_0x4ed2('0x1a')](_0x27b604)['end']();};}function respondWithResult(_0x50fc8b,_0x354ae9){_0x354ae9=_0x354ae9||0xc8;return function(_0x3d79d8){if(_0x3d79d8){return _0x50fc8b['status'](_0x354ae9)[_0x4ed2('0x1b')](_0x3d79d8);}};}function respondWithFilteredResult(_0x9e6737,_0x59c846){return function(_0x1eedbf){if(_0x1eedbf){var _0x55dd15=typeof _0x59c846[_0x4ed2('0x1c')]===_0x4ed2('0x1d')&&typeof _0x59c846[_0x4ed2('0x1e')]===_0x4ed2('0x1d');var _0x378c2c=_0x1eedbf['count'];var _0x2b0b60=_0x55dd15?0x0:_0x59c846['offset'];var _0x31493f=_0x55dd15?_0x1eedbf[_0x4ed2('0x1f')]:_0x59c846[_0x4ed2('0x1c')]+_0x59c846[_0x4ed2('0x1e')];var _0xddb89;if(_0x31493f>=_0x378c2c){_0x31493f=_0x378c2c;_0xddb89=0xc8;}else{_0xddb89=0xce;}_0x9e6737[_0x4ed2('0x1a')](_0xddb89);return _0x9e6737[_0x4ed2('0x20')](_0x4ed2('0x21'),_0x2b0b60+'-'+_0x31493f+'/'+_0x378c2c)[_0x4ed2('0x1b')](_0x1eedbf);}return null;};}function patchUpdates(_0x37a18c){return function(_0x57706e){try{jsonpatch[_0x4ed2('0x22')](_0x57706e,_0x37a18c,!![]);}catch(_0x36f976){return BPromise['reject'](_0x36f976);}return _0x57706e[_0x4ed2('0x23')]();};}function saveUpdates(_0x4f0e67,_0x1a777e){return function(_0xd0baa2){if(_0xd0baa2){return _0xd0baa2[_0x4ed2('0x24')](_0x4f0e67)[_0x4ed2('0x25')](function(_0x4b56cb){return _0x4b56cb;});}return null;};}function removeEntity(_0x23a36a,_0x2055a4){return function(_0x39a00e){if(_0x39a00e){return _0x39a00e[_0x4ed2('0x26')]()['then'](function(){var _0x5851f0=_0x39a00e[_0x4ed2('0x27')]({'plain':!![]});var _0xef3ef2='CannedAnswers';return db[_0x4ed2('0x28')]['destroy']({'where':{'type':_0xef3ef2,'resourceId':_0x5851f0['id']}})[_0x4ed2('0x25')](function(){return _0x39a00e;});})['then'](function(){_0x23a36a['status'](0xcc)[_0x4ed2('0x29')]();});}};}function handleEntityNotFound(_0x22deeb,_0x5a402c){return function(_0x16434a){if(!_0x16434a){_0x22deeb[_0x4ed2('0x19')](0x194);}return _0x16434a;};}function handleError(_0x4d97e5,_0x2716c4){_0x2716c4=_0x2716c4||0x1f4;return function(_0x545acf){logger[_0x4ed2('0x2a')](_0x545acf[_0x4ed2('0x2b')]);if(_0x545acf['name']){delete _0x545acf[_0x4ed2('0x2c')];}_0x4d97e5['status'](_0x2716c4)[_0x4ed2('0x2d')](_0x545acf);};}exports[_0x4ed2('0x2e')]=function(_0x290ebe,_0x55b390){var _0x5688e4={},_0x408556={},_0x54d4a1={'count':0x0,'rows':[]};var _0x4133b1=_[_0x4ed2('0x2f')](db[_0x4ed2('0x30')][_0x4ed2('0x31')],function(_0x36c87f){return{'name':_0x36c87f[_0x4ed2('0x32')],'type':_0x36c87f[_0x4ed2('0x33')]['key']};});_0x408556['model']=_[_0x4ed2('0x2f')](_0x4133b1,_0x4ed2('0x2c'));_0x408556['query']=_[_0x4ed2('0x34')](_0x290ebe[_0x4ed2('0x35')]);_0x408556[_0x4ed2('0x36')]=_[_0x4ed2('0x37')](_0x408556[_0x4ed2('0x38')],_0x408556[_0x4ed2('0x35')]);_0x5688e4[_0x4ed2('0x39')]=_[_0x4ed2('0x37')](_0x408556['model'],qs[_0x4ed2('0x3a')](_0x290ebe['query']['fields']));_0x5688e4['attributes']=_0x5688e4['attributes'][_0x4ed2('0x3b')]?_0x5688e4['attributes']:_0x408556[_0x4ed2('0x38')];if(!_0x290ebe[_0x4ed2('0x35')]['hasOwnProperty'](_0x4ed2('0x3c'))){_0x5688e4[_0x4ed2('0x1e')]=qs[_0x4ed2('0x1e')](_0x290ebe['query'][_0x4ed2('0x1e')]);_0x5688e4['offset']=qs[_0x4ed2('0x1c')](_0x290ebe[_0x4ed2('0x35')]['offset']);}_0x5688e4[_0x4ed2('0x3d')]=qs['sort'](_0x290ebe[_0x4ed2('0x35')][_0x4ed2('0x3e')]);_0x5688e4[_0x4ed2('0x3f')]=qs[_0x4ed2('0x36')](_[_0x4ed2('0x40')](_0x290ebe['query'],_0x408556[_0x4ed2('0x36')]),_0x4133b1);if(_0x290ebe[_0x4ed2('0x35')][_0x4ed2('0x41')]){_0x5688e4['where']=_['merge'](_0x5688e4[_0x4ed2('0x3f')],{'$or':[{'key':{'$like':'%'+_0x290ebe[_0x4ed2('0x35')][_0x4ed2('0x41')]+'%'}},{'value':{'$like':'%'+_0x290ebe[_0x4ed2('0x35')]['filter']+'%'}}]});}_0x5688e4=_[_0x4ed2('0x42')]({},_0x5688e4,_0x290ebe[_0x4ed2('0x43')]);var _0x19fdf5={'where':_0x5688e4['where']};return db[_0x4ed2('0x30')][_0x4ed2('0x1f')](_0x19fdf5)[_0x4ed2('0x25')](function(_0x85e22){_0x54d4a1[_0x4ed2('0x1f')]=_0x85e22;if(_0x290ebe[_0x4ed2('0x35')][_0x4ed2('0x44')]){_0x5688e4[_0x4ed2('0x45')]=[{'all':!![]}];}return db['CannedAnswer'][_0x4ed2('0x46')](_0x5688e4);})[_0x4ed2('0x25')](function(_0x1c2fe5){_0x54d4a1[_0x4ed2('0x47')]=_0x1c2fe5;return _0x54d4a1;})[_0x4ed2('0x25')](respondWithFilteredResult(_0x55b390,_0x5688e4))[_0x4ed2('0x48')](handleError(_0x55b390,null));};exports[_0x4ed2('0x49')]=function(_0x31a3c2,_0x5cdfac){var _0x42fb37={'raw':!![],'where':{'id':_0x31a3c2[_0x4ed2('0x4a')]['id']}},_0x43271a={};_0x43271a[_0x4ed2('0x38')]=_[_0x4ed2('0x34')](db[_0x4ed2('0x30')][_0x4ed2('0x31')]);_0x43271a[_0x4ed2('0x35')]=_[_0x4ed2('0x34')](_0x31a3c2[_0x4ed2('0x35')]);_0x43271a[_0x4ed2('0x36')]=_[_0x4ed2('0x37')](_0x43271a[_0x4ed2('0x38')],_0x43271a[_0x4ed2('0x35')]);_0x42fb37[_0x4ed2('0x39')]=_[_0x4ed2('0x37')](_0x43271a['model'],qs['fields'](_0x31a3c2[_0x4ed2('0x35')]['fields']));_0x42fb37[_0x4ed2('0x39')]=_0x42fb37[_0x4ed2('0x39')][_0x4ed2('0x3b')]?_0x42fb37['attributes']:_0x43271a[_0x4ed2('0x38')];if(_0x31a3c2[_0x4ed2('0x35')]['includeAll']){_0x42fb37[_0x4ed2('0x45')]=[{'all':!![]}];}_0x42fb37=_[_0x4ed2('0x42')]({},_0x42fb37,_0x31a3c2[_0x4ed2('0x43')]);return db['CannedAnswer'][_0x4ed2('0x4b')](_0x42fb37)[_0x4ed2('0x25')](handleEntityNotFound(_0x5cdfac,null))[_0x4ed2('0x25')](respondWithResult(_0x5cdfac,null))[_0x4ed2('0x48')](handleError(_0x5cdfac,null));};exports['update']=function(_0x1f1eae,_0x424da7){if(_0x1f1eae[_0x4ed2('0x4c')]['id']){delete _0x1f1eae[_0x4ed2('0x4c')]['id'];}return db[_0x4ed2('0x30')][_0x4ed2('0x4b')]({'where':{'id':_0x1f1eae[_0x4ed2('0x4a')]['id']}})[_0x4ed2('0x25')](handleEntityNotFound(_0x424da7,null))['then'](saveUpdates(_0x1f1eae[_0x4ed2('0x4c')],null))[_0x4ed2('0x25')](respondWithResult(_0x424da7,null))[_0x4ed2('0x48')](handleError(_0x424da7,null));};exports[_0x4ed2('0x26')]=function(_0x28dfab,_0x157390){return db[_0x4ed2('0x30')][_0x4ed2('0x4b')]({'where':{'id':_0x28dfab[_0x4ed2('0x4a')]['id']}})[_0x4ed2('0x25')](handleEntityNotFound(_0x157390,null))['then'](removeEntity(_0x157390,null))['catch'](handleError(_0x157390,null));};exports[_0x4ed2('0x4d')]=function(_0x374fca,_0x7bb765){var _0x3fa17c={'key':_0x374fca[_0x4ed2('0x4c')][_0x4ed2('0x4e')]};if(_0x374fca['body'][_0x4ed2('0x4f')]){_0x3fa17c['MailAccountId']=_0x374fca[_0x4ed2('0x4c')][_0x4ed2('0x4f')];}else if(_0x374fca['body']['SmsAccountId']){_0x3fa17c[_0x4ed2('0x50')]=_0x374fca[_0x4ed2('0x4c')][_0x4ed2('0x50')];}else if(_0x374fca[_0x4ed2('0x4c')]['OpenchannelAccountId']){_0x3fa17c[_0x4ed2('0x51')]=_0x374fca[_0x4ed2('0x4c')][_0x4ed2('0x51')];}else if(_0x374fca['body'][_0x4ed2('0x52')]){_0x3fa17c[_0x4ed2('0x52')]=_0x374fca[_0x4ed2('0x4c')][_0x4ed2('0x52')];}return db[_0x4ed2('0x30')][_0x4ed2('0x4b')]({'where':_0x3fa17c})[_0x4ed2('0x25')](function(_0x403ea8){if(_0x403ea8){throw new db[(_0x4ed2('0x53'))]['ValidationError'](_0x4ed2('0x54'));}return db['CannedAnswer'][_0x4ed2('0x4d')](_0x374fca[_0x4ed2('0x4c')]);})[_0x4ed2('0x25')](function(_0x577233){var _0x55de57=_0x374fca[_0x4ed2('0x55')][_0x4ed2('0x27')]({'plain':!![]});if(!_0x55de57)throw new Error(_0x4ed2('0x56'));if(_0x55de57['role']==='user'){var _0x1f521b=_0x577233['get']({'plain':!![]});return db[_0x4ed2('0x57')][_0x4ed2('0x4b')]({'where':{'name':_0x4ed2('0x58'),'userProfileId':_0x55de57[_0x4ed2('0x59')]},'raw':!![]})[_0x4ed2('0x25')](function(_0x10ba5c){if(_0x10ba5c&&_0x10ba5c[_0x4ed2('0x5a')]===0x0){return db[_0x4ed2('0x28')]['create']({'name':_0x1f521b['name'],'resourceId':_0x1f521b['id'],'type':_0x10ba5c[_0x4ed2('0x2c')],'sectionId':_0x10ba5c['id']},{})['then'](function(){return _0x577233;});}else{return _0x577233;}})[_0x4ed2('0x48')](function(_0xa6cbdb){logger[_0x4ed2('0x2a')](_0x4ed2('0x5b'),_0xa6cbdb);throw _0xa6cbdb;});}return _0x577233;})[_0x4ed2('0x25')](respondWithResult(_0x7bb765,0xc9))[_0x4ed2('0x48')](handleError(_0x7bb765,null));};
\ No newline at end of file
diff --git a/server/api/cannedAnswer/cannedAnswer.model.js b/server/api/cannedAnswer/cannedAnswer.model.js
index d5e1e53..b42e91c 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 _0x3107=['rimraf','../../config/environment','./cannedAnswer.attributes','exports','define','CannedAnswer','utf8mb4','utf8mb4_unicode_ci','../../config/logger','api','bluebird','path'];(function(_0x459c7d,_0x1771b5){var _0x2e676f=function(_0x1e31e0){while(--_0x1e31e0){_0x459c7d['push'](_0x459c7d['shift']());}};_0x2e676f(++_0x1771b5);}(_0x3107,0x1b8));var _0x7310=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x3107[_0x3dd15e];return _0x231fd0;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x7310('0x0'))(_0x7310('0x1'));var moment=require('moment');var BPromise=require(_0x7310('0x2'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x7310('0x3'));var rimraf=require(_0x7310('0x4'));var config=require(_0x7310('0x5'));var attributes=require(_0x7310('0x6'));module[_0x7310('0x7')]=function(_0x11338c,_0xcb315f){return _0x11338c[_0x7310('0x8')](_0x7310('0x9'),attributes,{'tableName':'tools_canned_answers','paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x7310('0xa'),'collate':_0x7310('0xb')});};
\ No newline at end of file
+var _0x17b9=['util','bluebird','rimraf','../../config/environment','./cannedAnswer.attributes','exports','CannedAnswer','tools_canned_answers','utf8mb4_unicode_ci','lodash'];(function(_0xba1760,_0x191969){var _0x1f3143=function(_0x5aa807){while(--_0x5aa807){_0xba1760['push'](_0xba1760['shift']());}};_0x1f3143(++_0x191969);}(_0x17b9,0x8b));var _0x917b=function(_0x1282f0,_0x1579d2){_0x1282f0=_0x1282f0-0x0;var _0x51ee8d=_0x17b9[_0x1282f0];return _0x51ee8d;};'use strict';var _=require(_0x917b('0x0'));var util=require(_0x917b('0x1'));var logger=require('../../config/logger')('api');var moment=require('moment');var BPromise=require(_0x917b('0x2'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x917b('0x3'));var config=require(_0x917b('0x4'));var attributes=require(_0x917b('0x5'));module[_0x917b('0x6')]=function(_0x2c1d89,_0x847984){return _0x2c1d89['define'](_0x917b('0x7'),attributes,{'tableName':_0x917b('0x8'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':'utf8mb4','collate':_0x917b('0x9')});};
\ No newline at end of file
diff --git a/server/api/cannedAnswer/cannedAnswer.rpc.js b/server/api/cannedAnswer/cannedAnswer.rpc.js
index 4dda639..cc306c0 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(_0x1d719e,_0x3fa907){var _0x3ecf44=function(_0x21bc37){while(--_0x21bc37){_0x1d719e['push'](_0x1d719e['shift']());}};_0x3ecf44(++_0x3fa907);}(_0xa9e0,0x123));var _0x0a9e=function(_0xf50820,_0x56f041){_0xf50820=_0xf50820-0x0;var _0x2a9b10=_0xa9e0[_0xf50820];return _0x2a9b10;};'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(_0x4d09ec,_0x2b7267){var _0x285698=function(_0xa3bd89){while(--_0xa3bd89){_0x4d09ec['push'](_0x4d09ec['shift']());}};_0x285698(++_0x2b7267);}(_0xa9e0,0x123));var _0x0a9e=function(_0x47a7d0,_0x4e182d){_0x47a7d0=_0x47a7d0-0x0;var _0xb9bd08=_0xa9e0[_0x47a7d0];return _0xb9bd08;};'use strict';var _=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var moment=require(_0x0a9e('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x0a9e('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x0a9e('0x4'));var logger=require(_0x0a9e('0x5'))(_0x0a9e('0x6'));var config=require(_0x0a9e('0x7'));var jayson=require(_0x0a9e('0x8'));var client=jayson['client'][_0x0a9e('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x441e3a,_0x2cc193,_0x5f41ea){return new BPromise(function(_0x503809,_0xe42b77){return client['request'](_0x441e3a,_0x5f41ea)['then'](function(_0x39753a){logger[_0x0a9e('0xa')](_0x0a9e('0xb'),_0x2cc193,_0x0a9e('0xc'));logger[_0x0a9e('0xd')](_0x0a9e('0xe'),_0x2cc193,'request\x20sent',JSON['stringify'](_0x39753a));if(_0x39753a['error']){if(_0x39753a['error'][_0x0a9e('0xf')]===0x1f4){logger[_0x0a9e('0x10')](_0x0a9e('0xb'),_0x2cc193,_0x39753a[_0x0a9e('0x10')][_0x0a9e('0x11')]);return _0xe42b77(_0x39753a[_0x0a9e('0x10')]['message']);}logger[_0x0a9e('0x10')](_0x0a9e('0xb'),_0x2cc193,_0x39753a[_0x0a9e('0x10')][_0x0a9e('0x11')]);return _0x503809(_0x39753a[_0x0a9e('0x10')][_0x0a9e('0x11')]);}else{logger['info'](_0x0a9e('0xb'),_0x2cc193,'request\x20sent');_0x503809(_0x39753a[_0x0a9e('0x12')]['message']);}})[_0x0a9e('0x13')](function(_0x12066b){logger['error'](_0x0a9e('0xb'),_0x2cc193,_0x12066b);_0xe42b77(_0x12066b);});});}
\ No newline at end of file
diff --git a/server/api/cannedAnswer/index.js b/server/api/cannedAnswer/index.js
index 86354e0..de5b74d 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 _0x150d=['../../components/interaction/service','../../config/environment','./cannedAnswer.controller','get','isAuthenticated','create','put','update','/:id','exports','multer','path','express','Router','fs-extra','../../components/auth/service'];(function(_0x4f7e2b,_0x591c7a){var _0xcbf189=function(_0x3ec217){while(--_0x3ec217){_0x4f7e2b['push'](_0x4f7e2b['shift']());}};_0xcbf189(++_0x591c7a);}(_0x150d,0xca));var _0xd150=function(_0x3a4f18,_0x1af741){_0x3a4f18=_0x3a4f18-0x0;var _0x4c20fc=_0x150d[_0x3a4f18];return _0x4c20fc;};'use strict';var multer=require(_0xd150('0x0'));var util=require('util');var path=require(_0xd150('0x1'));var timeout=require('connect-timeout');var express=require(_0xd150('0x2'));var router=express[_0xd150('0x3')]();var fs_extra=require(_0xd150('0x4'));var auth=require(_0xd150('0x5'));var interaction=require(_0xd150('0x6'));var config=require(_0xd150('0x7'));var controller=require(_0xd150('0x8'));router[_0xd150('0x9')]('/',auth[_0xd150('0xa')](),controller['index']);router['get']('/:id',auth[_0xd150('0xa')](),controller['show']);router['post']('/',auth[_0xd150('0xa')](),controller[_0xd150('0xb')]);router[_0xd150('0xc')]('/:id',auth['isAuthenticated'](),controller[_0xd150('0xd')]);router['delete'](_0xd150('0xe'),auth['isAuthenticated'](),controller['destroy']);module[_0xd150('0xf')]=router;
\ No newline at end of file
+var _0x46e5=['path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/:id','show','post','put','update','delete','destroy','exports','multer','util'];(function(_0x24358b,_0x23394b){var _0x44515c=function(_0x3872a4){while(--_0x3872a4){_0x24358b['push'](_0x24358b['shift']());}};_0x44515c(++_0x23394b);}(_0x46e5,0x102));var _0x546e=function(_0x138b14,_0x23e2dd){_0x138b14=_0x138b14-0x0;var _0x156961=_0x46e5[_0x138b14];return _0x156961;};'use strict';var multer=require(_0x546e('0x0'));var util=require(_0x546e('0x1'));var path=require(_0x546e('0x2'));var timeout=require(_0x546e('0x3'));var express=require(_0x546e('0x4'));var router=express[_0x546e('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0x546e('0x6'));var interaction=require(_0x546e('0x7'));var config=require(_0x546e('0x8'));var controller=require('./cannedAnswer.controller');router[_0x546e('0x9')]('/',auth[_0x546e('0xa')](),controller[_0x546e('0xb')]);router['get'](_0x546e('0xc'),auth[_0x546e('0xa')](),controller[_0x546e('0xd')]);router[_0x546e('0xe')]('/',auth[_0x546e('0xa')](),controller['create']);router[_0x546e('0xf')](_0x546e('0xc'),auth[_0x546e('0xa')](),controller[_0x546e('0x10')]);router[_0x546e('0x11')]('/:id',auth[_0x546e('0xa')](),controller[_0x546e('0x12')]);module[_0x546e('0x13')]=router;
\ No newline at end of file
diff --git a/server/api/cdr/cdr.attributes.js b/server/api/cdr/cdr.attributes.js
index 4c70f53..078205f 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 _0x82fa=['DATE','1970-01-01\x2000:00:01','STRING','INTEGER','sequelize','exports'];(function(_0x596b95,_0x42fd0f){var _0x38ac99=function(_0x3372f0){while(--_0x3372f0){_0x596b95['push'](_0x596b95['shift']());}};_0x38ac99(++_0x42fd0f);}(_0x82fa,0x1cc));var _0xa82f=function(_0x6a5b44,_0x29fd9e){_0x6a5b44=_0x6a5b44-0x0;var _0x33a0e9=_0x82fa[_0x6a5b44];return _0x33a0e9;};'use strict';var Sequelize=require(_0xa82f('0x0'));module[_0xa82f('0x1')]={'calldate':{'type':Sequelize[_0xa82f('0x2')],'allowNull':![],'defaultValue':_0xa82f('0x3')},'clid':{'type':Sequelize['STRING']},'src':{'type':Sequelize['STRING']},'dst':{'type':Sequelize['STRING']},'dcontext':{'type':Sequelize[_0xa82f('0x4')]},'channel':{'type':Sequelize[_0xa82f('0x4')]},'dstchannel':{'type':Sequelize[_0xa82f('0x4')]},'lastapp':{'type':Sequelize[_0xa82f('0x4')]},'lastdata':{'type':Sequelize[_0xa82f('0x4')]},'duration':{'type':Sequelize[_0xa82f('0x5')],'allowNull':![],'defaultValue':0x0},'billsec':{'type':Sequelize[_0xa82f('0x5')],'allowNull':![],'defaultValue':0x0},'disposition':{'type':Sequelize[_0xa82f('0x4')]},'amaflags':{'type':Sequelize[_0xa82f('0x5')],'allowNull':![],'defaultValue':0x0},'accountcode':{'type':Sequelize[_0xa82f('0x4')]},'userfield':{'type':Sequelize[_0xa82f('0x4')]},'uniqueid':{'type':Sequelize['STRING']},'linkedid':{'type':Sequelize['STRING']},'sequence':{'type':Sequelize[_0xa82f('0x4')]},'peeraccount':{'type':Sequelize[_0xa82f('0x4')]},'type':{'type':Sequelize[_0xa82f('0x4')]},'tag':{'type':Sequelize[_0xa82f('0x4')]}};
\ No newline at end of file
+var _0x34ab=['INTEGER','sequelize','exports','DATE','1970-01-01\x2000:00:01','STRING'];(function(_0x3e7439,_0x51c10e){var _0x51d5d1=function(_0x332172){while(--_0x332172){_0x3e7439['push'](_0x3e7439['shift']());}};_0x51d5d1(++_0x51c10e);}(_0x34ab,0x169));var _0xb34a=function(_0x53abe5,_0x33a9e5){_0x53abe5=_0x53abe5-0x0;var _0xc1c37e=_0x34ab[_0x53abe5];return _0xc1c37e;};'use strict';var Sequelize=require(_0xb34a('0x0'));module[_0xb34a('0x1')]={'calldate':{'type':Sequelize[_0xb34a('0x2')],'allowNull':![],'defaultValue':_0xb34a('0x3')},'clid':{'type':Sequelize[_0xb34a('0x4')]},'src':{'type':Sequelize[_0xb34a('0x4')]},'dst':{'type':Sequelize[_0xb34a('0x4')]},'dcontext':{'type':Sequelize[_0xb34a('0x4')]},'channel':{'type':Sequelize['STRING']},'dstchannel':{'type':Sequelize['STRING']},'lastapp':{'type':Sequelize[_0xb34a('0x4')]},'lastdata':{'type':Sequelize[_0xb34a('0x4')]},'duration':{'type':Sequelize[_0xb34a('0x5')],'allowNull':![],'defaultValue':0x0},'billsec':{'type':Sequelize['INTEGER'],'allowNull':![],'defaultValue':0x0},'disposition':{'type':Sequelize[_0xb34a('0x4')]},'amaflags':{'type':Sequelize[_0xb34a('0x5')],'allowNull':![],'defaultValue':0x0},'accountcode':{'type':Sequelize[_0xb34a('0x4')]},'userfield':{'type':Sequelize[_0xb34a('0x4')]},'uniqueid':{'type':Sequelize[_0xb34a('0x4')]},'linkedid':{'type':Sequelize[_0xb34a('0x4')]},'sequence':{'type':Sequelize[_0xb34a('0x4')]},'peeraccount':{'type':Sequelize[_0xb34a('0x4')]},'type':{'type':Sequelize[_0xb34a('0x4')]},'tag':{'type':Sequelize['STRING']}};
\ No newline at end of file
diff --git a/server/api/cdr/cdr.controller.js b/server/api/cdr/cdr.controller.js
index 9a88014..5dae8df 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 _0x4006=['findAll','catch','show','keys','include','find','create','body','update','params','describe','rimraf','zip-dir','fast-json-patch','request-promise','mustache','path','ejs','lodash','squel','crypto','jsforce','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','offset','undefined','limit','count','set','json','apply','reject','save','then','destroy','end','error','stack','name','index','Cdr','rawAttributes','fieldName','type','model','map','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','pick','filter','where','merge','options','includeAll'];(function(_0x32708a,_0x2f186c){var _0xa8fd72=function(_0xc78df1){while(--_0xc78df1){_0x32708a['push'](_0x32708a['shift']());}};_0xa8fd72(++_0x2f186c);}(_0x4006,0x1c7));var _0x6400=function(_0x5e2f79,_0x7c1ce8){_0x5e2f79=_0x5e2f79-0x0;var _0x5d0100=_0x4006[_0x5e2f79];return _0x5d0100;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x6400('0x0'));var zipdir=require(_0x6400('0x1'));var jsonpatch=require(_0x6400('0x2'));var rp=require(_0x6400('0x3'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x6400('0x4'));var util=require('util');var path=require(_0x6400('0x5'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x6400('0x6'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x6400('0x7'));var squel=require(_0x6400('0x8'));var crypto=require(_0x6400('0x9'));var jsforce=require(_0x6400('0xa'));var deskjs=require('desk.js');var toCsv=require(_0x6400('0xb'));var querystring=require(_0x6400('0xc'));var Papa=require(_0x6400('0xd'));var Redis=require(_0x6400('0xe'));var authService=require(_0x6400('0xf'));var qs=require(_0x6400('0x10'));var as=require(_0x6400('0x11'));var hardwareService=require(_0x6400('0x12'));var logger=require(_0x6400('0x13'))(_0x6400('0x14'));var utils=require(_0x6400('0x15'));var config=require('../../config/environment');var licenseUtil=require(_0x6400('0x16'));var db=require(_0x6400('0x17'))['db'];function respondWithStatusCode(_0x230c94,_0x36bf00){_0x36bf00=_0x36bf00||0xcc;return function(_0x5a6d31){if(_0x5a6d31){return _0x230c94[_0x6400('0x18')](_0x36bf00);}return _0x230c94[_0x6400('0x19')](_0x36bf00)['end']();};}function respondWithResult(_0x4f8133,_0x559312){_0x559312=_0x559312||0xc8;return function(_0x268f93){if(_0x268f93){return _0x4f8133[_0x6400('0x19')](_0x559312)['json'](_0x268f93);}};}function respondWithFilteredResult(_0x191696,_0x4ae3ea){return function(_0x28eb67){if(_0x28eb67){var _0x5a0c1c=typeof _0x4ae3ea[_0x6400('0x1a')]===_0x6400('0x1b')&&typeof _0x4ae3ea[_0x6400('0x1c')]===_0x6400('0x1b');var _0x49d412=_0x28eb67[_0x6400('0x1d')];var _0x14c036=_0x5a0c1c?0x0:_0x4ae3ea[_0x6400('0x1a')];var _0x50524f=_0x5a0c1c?_0x28eb67[_0x6400('0x1d')]:_0x4ae3ea[_0x6400('0x1a')]+_0x4ae3ea['limit'];var _0x36a8f5;if(_0x50524f>=_0x49d412){_0x50524f=_0x49d412;_0x36a8f5=0xc8;}else{_0x36a8f5=0xce;}_0x191696[_0x6400('0x19')](_0x36a8f5);return _0x191696[_0x6400('0x1e')]('Content-Range',_0x14c036+'-'+_0x50524f+'/'+_0x49d412)[_0x6400('0x1f')](_0x28eb67);}return null;};}function patchUpdates(_0x23c1cd){return function(_0x325bde){try{jsonpatch[_0x6400('0x20')](_0x325bde,_0x23c1cd,!![]);}catch(_0x1c8b72){return BPromise[_0x6400('0x21')](_0x1c8b72);}return _0x325bde[_0x6400('0x22')]();};}function saveUpdates(_0x171e39,_0x22eb63){return function(_0x212f0f){if(_0x212f0f){return _0x212f0f['update'](_0x171e39)[_0x6400('0x23')](function(_0x50c29e){return _0x50c29e;});}return null;};}function removeEntity(_0x589b7c,_0x257d80){return function(_0xb79c62){if(_0xb79c62){return _0xb79c62[_0x6400('0x24')]()[_0x6400('0x23')](function(){_0x589b7c['status'](0xcc)[_0x6400('0x25')]();});}};}function handleEntityNotFound(_0x56d9e6,_0x1acff2){return function(_0x506732){if(!_0x506732){_0x56d9e6[_0x6400('0x18')](0x194);}return _0x506732;};}function handleError(_0x246433,_0x577156){_0x577156=_0x577156||0x1f4;return function(_0x434550){logger[_0x6400('0x26')](_0x434550[_0x6400('0x27')]);if(_0x434550['name']){delete _0x434550[_0x6400('0x28')];}_0x246433['status'](_0x577156)['send'](_0x434550);};}exports[_0x6400('0x29')]=function(_0x4bb214,_0x234670){var _0x197b9d={},_0x50f5e9={},_0x452a2c={'count':0x0,'rows':[]};var _0x52eba1=_['map'](db[_0x6400('0x2a')][_0x6400('0x2b')],function(_0x10005a){return{'name':_0x10005a[_0x6400('0x2c')],'type':_0x10005a[_0x6400('0x2d')]['key']};});_0x50f5e9[_0x6400('0x2e')]=_[_0x6400('0x2f')](_0x52eba1,_0x6400('0x28'));_0x50f5e9[_0x6400('0x30')]=_['keys'](_0x4bb214[_0x6400('0x30')]);_0x50f5e9[_0x6400('0x31')]=_[_0x6400('0x32')](_0x50f5e9['model'],_0x50f5e9[_0x6400('0x30')]);_0x197b9d[_0x6400('0x33')]=_[_0x6400('0x32')](_0x50f5e9[_0x6400('0x2e')],qs['fields'](_0x4bb214[_0x6400('0x30')][_0x6400('0x34')]));_0x197b9d['attributes']=_0x197b9d[_0x6400('0x33')][_0x6400('0x35')]?_0x197b9d['attributes']:_0x50f5e9['model'];if(!_0x4bb214[_0x6400('0x30')][_0x6400('0x36')](_0x6400('0x37'))){_0x197b9d['limit']=qs['limit'](_0x4bb214['query'][_0x6400('0x1c')]);_0x197b9d[_0x6400('0x1a')]=qs[_0x6400('0x1a')](_0x4bb214[_0x6400('0x30')][_0x6400('0x1a')]);}_0x197b9d['order']=qs[_0x6400('0x38')](_0x4bb214[_0x6400('0x30')]['sort']);_0x197b9d['where']=qs[_0x6400('0x31')](_[_0x6400('0x39')](_0x4bb214[_0x6400('0x30')],_0x50f5e9['filters']),_0x52eba1);if(_0x4bb214[_0x6400('0x30')][_0x6400('0x3a')]){_0x197b9d[_0x6400('0x3b')]=_['merge'](_0x197b9d[_0x6400('0x3b')],{'$or':_[_0x6400('0x2f')](_0x52eba1,function(_0xd824bf){if(_0xd824bf['type']!=='VIRTUAL'){var _0x5a0973={};_0x5a0973[_0xd824bf[_0x6400('0x28')]]={'$like':'%'+_0x4bb214['query']['filter']+'%'};return _0x5a0973;}})});}_0x197b9d=_[_0x6400('0x3c')]({},_0x197b9d,_0x4bb214[_0x6400('0x3d')]);var _0x565942={'where':_0x197b9d[_0x6400('0x3b')]};return db[_0x6400('0x2a')][_0x6400('0x1d')](_0x565942)['then'](function(_0x9536e5){_0x452a2c[_0x6400('0x1d')]=_0x9536e5;if(_0x4bb214[_0x6400('0x30')][_0x6400('0x3e')]){_0x197b9d['include']=[{'all':!![]}];}return db['Cdr'][_0x6400('0x3f')](_0x197b9d);})[_0x6400('0x23')](function(_0x1bf820){_0x452a2c['rows']=_0x1bf820;return _0x452a2c;})[_0x6400('0x23')](respondWithFilteredResult(_0x234670,_0x197b9d))[_0x6400('0x40')](handleError(_0x234670,null));};exports[_0x6400('0x41')]=function(_0xe50c96,_0x3069f0){var _0x557133={'raw':!![],'where':{'id':_0xe50c96['params']['id']}},_0x24d0c7={};_0x24d0c7[_0x6400('0x2e')]=_[_0x6400('0x42')](db[_0x6400('0x2a')][_0x6400('0x2b')]);_0x24d0c7['query']=_[_0x6400('0x42')](_0xe50c96[_0x6400('0x30')]);_0x24d0c7[_0x6400('0x31')]=_[_0x6400('0x32')](_0x24d0c7['model'],_0x24d0c7[_0x6400('0x30')]);_0x557133['attributes']=_[_0x6400('0x32')](_0x24d0c7['model'],qs[_0x6400('0x34')](_0xe50c96[_0x6400('0x30')][_0x6400('0x34')]));_0x557133['attributes']=_0x557133[_0x6400('0x33')]['length']?_0x557133[_0x6400('0x33')]:_0x24d0c7[_0x6400('0x2e')];if(_0xe50c96[_0x6400('0x30')][_0x6400('0x3e')]){_0x557133[_0x6400('0x43')]=[{'all':!![]}];}_0x557133=_[_0x6400('0x3c')]({},_0x557133,_0xe50c96[_0x6400('0x3d')]);return db[_0x6400('0x2a')][_0x6400('0x44')](_0x557133)[_0x6400('0x23')](handleEntityNotFound(_0x3069f0,null))[_0x6400('0x23')](respondWithResult(_0x3069f0,null))['catch'](handleError(_0x3069f0,null));};exports[_0x6400('0x45')]=function(_0x3340c7,_0x59a8f2){return db['Cdr'][_0x6400('0x45')](_0x3340c7[_0x6400('0x46')],{})[_0x6400('0x23')](respondWithResult(_0x59a8f2,0xc9))['catch'](handleError(_0x59a8f2,null));};exports[_0x6400('0x47')]=function(_0x54cbfb,_0x518ee4){if(_0x54cbfb['body']['id']){delete _0x54cbfb[_0x6400('0x46')]['id'];}return db[_0x6400('0x2a')]['find']({'where':{'id':_0x54cbfb[_0x6400('0x48')]['id']}})[_0x6400('0x23')](handleEntityNotFound(_0x518ee4,null))['then'](saveUpdates(_0x54cbfb['body'],null))[_0x6400('0x23')](respondWithResult(_0x518ee4,null))[_0x6400('0x40')](handleError(_0x518ee4,null));};exports['destroy']=function(_0x3421b5,_0x205233){return db[_0x6400('0x2a')][_0x6400('0x44')]({'where':{'id':_0x3421b5[_0x6400('0x48')]['id']}})[_0x6400('0x23')](handleEntityNotFound(_0x205233,null))[_0x6400('0x23')](removeEntity(_0x205233,null))['catch'](handleError(_0x205233,null));};exports[_0x6400('0x49')]=function(_0x801179,_0x6905bb){return db[_0x6400('0x2a')][_0x6400('0x49')]()[_0x6400('0x23')](respondWithResult(_0x6905bb,null))[_0x6400('0x40')](handleError(_0x6905bb,null));};
\ No newline at end of file
+var _0x814b=['undefined','limit','count','Content-Range','apply','reject','save','update','then','destroy','error','stack','name','send','index','map','rawAttributes','fieldName','model','query','keys','intersection','attributes','fields','length','hasOwnProperty','sort','where','filters','pick','filter','merge','options','Cdr','includeAll','include','findAll','catch','params','find','create','body','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','sox','to-csv','ejs','lodash','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset'];(function(_0xdf19e1,_0x42f160){var _0x1f4379=function(_0x130a4c){while(--_0x130a4c){_0xdf19e1['push'](_0xdf19e1['shift']());}};_0x1f4379(++_0x42f160);}(_0x814b,0x1a2));var _0xb814=function(_0x467488,_0x38c7ae){_0x467488=_0x467488-0x0;var _0x56107f=_0x814b[_0x467488];return _0x56107f;};'use strict';var emlformat=require(_0xb814('0x0'));var rimraf=require(_0xb814('0x1'));var zipdir=require(_0xb814('0x2'));var jsonpatch=require(_0xb814('0x3'));var rp=require(_0xb814('0x4'));var moment=require(_0xb814('0x5'));var BPromise=require('bluebird');var Mustache=require(_0xb814('0x6'));var util=require(_0xb814('0x7'));var path=require(_0xb814('0x8'));var sox=require(_0xb814('0x9'));var csv=require(_0xb814('0xa'));var ejs=require(_0xb814('0xb'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xb814('0xc'));var squel=require(_0xb814('0xd'));var crypto=require('crypto');var jsforce=require(_0xb814('0xe'));var deskjs=require(_0xb814('0xf'));var toCsv=require(_0xb814('0xa'));var querystring=require(_0xb814('0x10'));var Papa=require(_0xb814('0x11'));var Redis=require(_0xb814('0x12'));var authService=require(_0xb814('0x13'));var qs=require(_0xb814('0x14'));var as=require(_0xb814('0x15'));var hardwareService=require(_0xb814('0x16'));var logger=require(_0xb814('0x17'))('api');var utils=require(_0xb814('0x18'));var config=require('../../config/environment');var licenseUtil=require(_0xb814('0x19'));var db=require(_0xb814('0x1a'))['db'];function respondWithStatusCode(_0x35b10d,_0x2cc46b){_0x2cc46b=_0x2cc46b||0xcc;return function(_0x2ce718){if(_0x2ce718){return _0x35b10d[_0xb814('0x1b')](_0x2cc46b);}return _0x35b10d[_0xb814('0x1c')](_0x2cc46b)[_0xb814('0x1d')]();};}function respondWithResult(_0xa0a2e5,_0x2ab627){_0x2ab627=_0x2ab627||0xc8;return function(_0x3f4881){if(_0x3f4881){return _0xa0a2e5[_0xb814('0x1c')](_0x2ab627)[_0xb814('0x1e')](_0x3f4881);}};}function respondWithFilteredResult(_0x39bfcf,_0x303aca){return function(_0x3a71d6){if(_0x3a71d6){var _0x45e0d0=typeof _0x303aca[_0xb814('0x1f')]===_0xb814('0x20')&&typeof _0x303aca[_0xb814('0x21')]===_0xb814('0x20');var _0x48c9df=_0x3a71d6[_0xb814('0x22')];var _0x55ba16=_0x45e0d0?0x0:_0x303aca[_0xb814('0x1f')];var _0xfac75b=_0x45e0d0?_0x3a71d6['count']:_0x303aca['offset']+_0x303aca['limit'];var _0x399b43;if(_0xfac75b>=_0x48c9df){_0xfac75b=_0x48c9df;_0x399b43=0xc8;}else{_0x399b43=0xce;}_0x39bfcf['status'](_0x399b43);return _0x39bfcf['set'](_0xb814('0x23'),_0x55ba16+'-'+_0xfac75b+'/'+_0x48c9df)[_0xb814('0x1e')](_0x3a71d6);}return null;};}function patchUpdates(_0x25b6b6){return function(_0x4e139e){try{jsonpatch[_0xb814('0x24')](_0x4e139e,_0x25b6b6,!![]);}catch(_0x531032){return BPromise[_0xb814('0x25')](_0x531032);}return _0x4e139e[_0xb814('0x26')]();};}function saveUpdates(_0x3b267e,_0x470e81){return function(_0x27352e){if(_0x27352e){return _0x27352e[_0xb814('0x27')](_0x3b267e)[_0xb814('0x28')](function(_0x594470){return _0x594470;});}return null;};}function removeEntity(_0x2ead86,_0x52b7a3){return function(_0x3f81d0){if(_0x3f81d0){return _0x3f81d0[_0xb814('0x29')]()[_0xb814('0x28')](function(){_0x2ead86[_0xb814('0x1c')](0xcc)[_0xb814('0x1d')]();});}};}function handleEntityNotFound(_0xb9e57d,_0x3d836c){return function(_0x5755ea){if(!_0x5755ea){_0xb9e57d[_0xb814('0x1b')](0x194);}return _0x5755ea;};}function handleError(_0xc0ef66,_0x1c2625){_0x1c2625=_0x1c2625||0x1f4;return function(_0x349394){logger[_0xb814('0x2a')](_0x349394[_0xb814('0x2b')]);if(_0x349394[_0xb814('0x2c')]){delete _0x349394[_0xb814('0x2c')];}_0xc0ef66['status'](_0x1c2625)[_0xb814('0x2d')](_0x349394);};}exports[_0xb814('0x2e')]=function(_0x52ed64,_0x9008b2){var _0x37d24d={},_0x530744={},_0x499f22={'count':0x0,'rows':[]};var _0x20577b=_[_0xb814('0x2f')](db['Cdr'][_0xb814('0x30')],function(_0x526610){return{'name':_0x526610[_0xb814('0x31')],'type':_0x526610['type']['key']};});_0x530744[_0xb814('0x32')]=_['map'](_0x20577b,_0xb814('0x2c'));_0x530744[_0xb814('0x33')]=_[_0xb814('0x34')](_0x52ed64['query']);_0x530744['filters']=_[_0xb814('0x35')](_0x530744[_0xb814('0x32')],_0x530744['query']);_0x37d24d[_0xb814('0x36')]=_[_0xb814('0x35')](_0x530744[_0xb814('0x32')],qs[_0xb814('0x37')](_0x52ed64[_0xb814('0x33')][_0xb814('0x37')]));_0x37d24d[_0xb814('0x36')]=_0x37d24d['attributes'][_0xb814('0x38')]?_0x37d24d[_0xb814('0x36')]:_0x530744[_0xb814('0x32')];if(!_0x52ed64[_0xb814('0x33')][_0xb814('0x39')]('nolimit')){_0x37d24d[_0xb814('0x21')]=qs['limit'](_0x52ed64[_0xb814('0x33')][_0xb814('0x21')]);_0x37d24d[_0xb814('0x1f')]=qs['offset'](_0x52ed64[_0xb814('0x33')][_0xb814('0x1f')]);}_0x37d24d['order']=qs[_0xb814('0x3a')](_0x52ed64[_0xb814('0x33')][_0xb814('0x3a')]);_0x37d24d[_0xb814('0x3b')]=qs[_0xb814('0x3c')](_[_0xb814('0x3d')](_0x52ed64['query'],_0x530744[_0xb814('0x3c')]),_0x20577b);if(_0x52ed64['query'][_0xb814('0x3e')]){_0x37d24d['where']=_[_0xb814('0x3f')](_0x37d24d['where'],{'$or':_[_0xb814('0x2f')](_0x20577b,function(_0x26675a){if(_0x26675a['type']!=='VIRTUAL'){var _0x5dd6bc={};_0x5dd6bc[_0x26675a['name']]={'$like':'%'+_0x52ed64[_0xb814('0x33')][_0xb814('0x3e')]+'%'};return _0x5dd6bc;}})});}_0x37d24d=_[_0xb814('0x3f')]({},_0x37d24d,_0x52ed64[_0xb814('0x40')]);var _0x51cdba={'where':_0x37d24d['where']};return db[_0xb814('0x41')]['count'](_0x51cdba)[_0xb814('0x28')](function(_0x1098eb){_0x499f22[_0xb814('0x22')]=_0x1098eb;if(_0x52ed64[_0xb814('0x33')][_0xb814('0x42')]){_0x37d24d[_0xb814('0x43')]=[{'all':!![]}];}return db[_0xb814('0x41')][_0xb814('0x44')](_0x37d24d);})[_0xb814('0x28')](function(_0x4b6ff8){_0x499f22['rows']=_0x4b6ff8;return _0x499f22;})['then'](respondWithFilteredResult(_0x9008b2,_0x37d24d))[_0xb814('0x45')](handleError(_0x9008b2,null));};exports['show']=function(_0x29416a,_0x580171){var _0x411723={'raw':!![],'where':{'id':_0x29416a[_0xb814('0x46')]['id']}},_0x44ff56={};_0x44ff56[_0xb814('0x32')]=_['keys'](db[_0xb814('0x41')][_0xb814('0x30')]);_0x44ff56[_0xb814('0x33')]=_[_0xb814('0x34')](_0x29416a[_0xb814('0x33')]);_0x44ff56[_0xb814('0x3c')]=_['intersection'](_0x44ff56[_0xb814('0x32')],_0x44ff56[_0xb814('0x33')]);_0x411723[_0xb814('0x36')]=_[_0xb814('0x35')](_0x44ff56[_0xb814('0x32')],qs[_0xb814('0x37')](_0x29416a[_0xb814('0x33')]['fields']));_0x411723['attributes']=_0x411723[_0xb814('0x36')][_0xb814('0x38')]?_0x411723[_0xb814('0x36')]:_0x44ff56[_0xb814('0x32')];if(_0x29416a[_0xb814('0x33')][_0xb814('0x42')]){_0x411723[_0xb814('0x43')]=[{'all':!![]}];}_0x411723=_[_0xb814('0x3f')]({},_0x411723,_0x29416a[_0xb814('0x40')]);return db[_0xb814('0x41')][_0xb814('0x47')](_0x411723)['then'](handleEntityNotFound(_0x580171,null))[_0xb814('0x28')](respondWithResult(_0x580171,null))[_0xb814('0x45')](handleError(_0x580171,null));};exports['create']=function(_0x338e80,_0x55234d){return db[_0xb814('0x41')][_0xb814('0x48')](_0x338e80[_0xb814('0x49')],{})[_0xb814('0x28')](respondWithResult(_0x55234d,0xc9))[_0xb814('0x45')](handleError(_0x55234d,null));};exports[_0xb814('0x27')]=function(_0x2cc806,_0x45480e){if(_0x2cc806[_0xb814('0x49')]['id']){delete _0x2cc806[_0xb814('0x49')]['id'];}return db['Cdr']['find']({'where':{'id':_0x2cc806[_0xb814('0x46')]['id']}})[_0xb814('0x28')](handleEntityNotFound(_0x45480e,null))[_0xb814('0x28')](saveUpdates(_0x2cc806[_0xb814('0x49')],null))[_0xb814('0x28')](respondWithResult(_0x45480e,null))[_0xb814('0x45')](handleError(_0x45480e,null));};exports[_0xb814('0x29')]=function(_0x4a4f9a,_0x26fd0b){return db[_0xb814('0x41')][_0xb814('0x47')]({'where':{'id':_0x4a4f9a['params']['id']}})[_0xb814('0x28')](handleEntityNotFound(_0x26fd0b,null))['then'](removeEntity(_0x26fd0b,null))[_0xb814('0x45')](handleError(_0x26fd0b,null));};exports['describe']=function(_0x403872,_0x3cf8f8){return db['Cdr'][_0xb814('0x4a')]()[_0xb814('0x28')](respondWithResult(_0x3cf8f8,null))[_0xb814('0x45')](handleError(_0x3cf8f8,null));};
\ No newline at end of file
diff --git a/server/api/cdr/cdr.model.js b/server/api/cdr/cdr.model.js
index 5032abe..0f73d3b 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(_0x5ab037,_0x49d448){var _0x1f82e3=function(_0x250b00){while(--_0x250b00){_0x5ab037['push'](_0x5ab037['shift']());}};_0x1f82e3(++_0x49d448);}(_0x7a54,0x106));var _0x47a5=function(_0x49ce75,_0x4dd94c){_0x49ce75=_0x49ce75-0x0;var _0x1897d5=_0x7a54[_0x49ce75];return _0x1897d5;};'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 _0x7a54=['Cdr','cdr','accountcode','disposition','dst','src','uniqueid','lodash','util','../../config/logger','moment','bluebird','path','rimraf','../../config/environment','./cdr.attributes','exports'];(function(_0x40f923,_0x2cd776){var _0x2b43cf=function(_0x366a3a){while(--_0x366a3a){_0x40f923['push'](_0x40f923['shift']());}};_0x2b43cf(++_0x2cd776);}(_0x7a54,0x106));var _0x47a5=function(_0x4e8097,_0x38e265){_0x4e8097=_0x4e8097-0x0;var _0x424e76=_0x7a54[_0x4e8097];return _0x424e76;};'use strict';var _=require(_0x47a5('0x0'));var util=require(_0x47a5('0x1'));var logger=require(_0x47a5('0x2'))('api');var moment=require(_0x47a5('0x3'));var BPromise=require(_0x47a5('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x47a5('0x5'));var rimraf=require(_0x47a5('0x6'));var config=require(_0x47a5('0x7'));var attributes=require(_0x47a5('0x8'));module[_0x47a5('0x9')]=function(_0x545a97,_0x3d5629){return _0x545a97['define'](_0x47a5('0xa'),attributes,{'tableName':_0x47a5('0xb'),'paranoid':![],'indexes':[{'name':'accountcode','fields':[_0x47a5('0xc')]},{'name':'calldate','fields':['calldate']},{'name':'disposition','fields':[_0x47a5('0xd')]},{'name':_0x47a5('0xe'),'fields':['dst']},{'name':_0x47a5('0xf'),'fields':['src']},{'name':'uniqueid','fields':[_0x47a5('0x10')]}],'timestamps':![]});};
\ No newline at end of file
diff --git a/server/api/cdr/cdr.rpc.js b/server/api/cdr/cdr.rpc.js
index 789a895..b2342ab 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 _0x340f=['ioredis','../../config/logger','../../config/environment','jayson/promise','client','http','request','info','Cdr,\x20%s,\x20%s','request\x20sent','debug','Cdr,\x20%s,\x20%s,\x20%s','code','message','error','result','catch','lodash','util','moment','bluebird','randomstring'];(function(_0x41b369,_0x29e21f){var _0x2af633=function(_0x588c87){while(--_0x588c87){_0x41b369['push'](_0x41b369['shift']());}};_0x2af633(++_0x29e21f);}(_0x340f,0x171));var _0xf340=function(_0x539ff,_0x3bdd68){_0x539ff=_0x539ff-0x0;var _0x3e3cf1=_0x340f[_0x539ff];return _0x3e3cf1;};'use strict';var _=require(_0xf340('0x0'));var util=require(_0xf340('0x1'));var moment=require(_0xf340('0x2'));var BPromise=require(_0xf340('0x3'));var rs=require(_0xf340('0x4'));var fs=require('fs');var Redis=require(_0xf340('0x5'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0xf340('0x6'))('rpc');var config=require(_0xf340('0x7'));var jayson=require(_0xf340('0x8'));var client=jayson[_0xf340('0x9')][_0xf340('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x54ee6b,_0x505a7e,_0x5d4fd8){return new BPromise(function(_0x169204,_0x10f59b){return client[_0xf340('0xb')](_0x54ee6b,_0x5d4fd8)['then'](function(_0x37f02d){logger[_0xf340('0xc')](_0xf340('0xd'),_0x505a7e,_0xf340('0xe'));logger[_0xf340('0xf')](_0xf340('0x10'),_0x505a7e,_0xf340('0xe'),JSON['stringify'](_0x37f02d));if(_0x37f02d['error']){if(_0x37f02d['error'][_0xf340('0x11')]===0x1f4){logger['error'](_0xf340('0xd'),_0x505a7e,_0x37f02d['error']['message']);return _0x10f59b(_0x37f02d['error'][_0xf340('0x12')]);}logger[_0xf340('0x13')](_0xf340('0xd'),_0x505a7e,_0x37f02d[_0xf340('0x13')][_0xf340('0x12')]);return _0x169204(_0x37f02d['error'][_0xf340('0x12')]);}else{logger[_0xf340('0xc')]('Cdr,\x20%s,\x20%s',_0x505a7e,'request\x20sent');_0x169204(_0x37f02d[_0xf340('0x14')][_0xf340('0x12')]);}})[_0xf340('0x15')](function(_0x1d4ce7){logger[_0xf340('0x13')](_0xf340('0xd'),_0x505a7e,_0x1d4ce7);_0x10f59b(_0x1d4ce7);});});}
\ No newline at end of file
+var _0xbea2=['then','info','Cdr,\x20%s,\x20%s','request\x20sent','stringify','code','error','message','result','catch','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request'];(function(_0x3d010a,_0x578986){var _0x1b6c57=function(_0x4401f3){while(--_0x4401f3){_0x3d010a['push'](_0x3d010a['shift']());}};_0x1b6c57(++_0x578986);}(_0xbea2,0xca));var _0x2bea=function(_0x14e91c,_0x3af54e){_0x14e91c=_0x14e91c-0x0;var _0x36609e=_0xbea2[_0x14e91c];return _0x36609e;};'use strict';var _=require(_0x2bea('0x0'));var util=require(_0x2bea('0x1'));var moment=require('moment');var BPromise=require(_0x2bea('0x2'));var rs=require(_0x2bea('0x3'));var fs=require('fs');var Redis=require(_0x2bea('0x4'));var db=require(_0x2bea('0x5'))['db'];var utils=require(_0x2bea('0x6'));var logger=require(_0x2bea('0x7'))(_0x2bea('0x8'));var config=require(_0x2bea('0x9'));var jayson=require(_0x2bea('0xa'));var client=jayson[_0x2bea('0xb')][_0x2bea('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x2a4884,_0x4058c8,_0x82cd64){return new BPromise(function(_0x3a2ded,_0x5061eb){return client[_0x2bea('0xd')](_0x2a4884,_0x82cd64)[_0x2bea('0xe')](function(_0x207e1e){logger[_0x2bea('0xf')](_0x2bea('0x10'),_0x4058c8,_0x2bea('0x11'));logger['debug']('Cdr,\x20%s,\x20%s,\x20%s',_0x4058c8,_0x2bea('0x11'),JSON[_0x2bea('0x12')](_0x207e1e));if(_0x207e1e['error']){if(_0x207e1e['error'][_0x2bea('0x13')]===0x1f4){logger[_0x2bea('0x14')](_0x2bea('0x10'),_0x4058c8,_0x207e1e[_0x2bea('0x14')]['message']);return _0x5061eb(_0x207e1e[_0x2bea('0x14')][_0x2bea('0x15')]);}logger[_0x2bea('0x14')]('Cdr,\x20%s,\x20%s',_0x4058c8,_0x207e1e['error'][_0x2bea('0x15')]);return _0x3a2ded(_0x207e1e['error']['message']);}else{logger[_0x2bea('0xf')](_0x2bea('0x10'),_0x4058c8,_0x2bea('0x11'));_0x3a2ded(_0x207e1e[_0x2bea('0x16')][_0x2bea('0x15')]);}})[_0x2bea('0x17')](function(_0x24644b){logger[_0x2bea('0x14')](_0x2bea('0x10'),_0x4058c8,_0x24644b);_0x5061eb(_0x24644b);});});}
\ No newline at end of file
diff --git a/server/api/cdr/index.js b/server/api/cdr/index.js
index 5542b6f..a2e2f06 100644
--- a/server/api/cdr/index.js
+++ b/server/api/cdr/index.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xa9e0=['isAuthenticated','create','put','/:id','destroy','exports','multer','util','path','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./cdr.controller','get','index','/describe','show','post'];(function(_0x119cd8,_0x556b73){var _0x7072a3=function(_0x5908d1){while(--_0x5908d1){_0x119cd8['push'](_0x119cd8['shift']());}};_0x7072a3(++_0x556b73);}(_0xa9e0,0x123));var _0x0a9e=function(_0x110c3d,_0x12ee06){_0x110c3d=_0x110c3d-0x0;var _0x226d67=_0xa9e0[_0x110c3d];return _0x226d67;};'use strict';var multer=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var path=require(_0x0a9e('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0a9e('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x0a9e('0x4'));var interaction=require(_0x0a9e('0x5'));var config=require(_0x0a9e('0x6'));var controller=require(_0x0a9e('0x7'));router[_0x0a9e('0x8')]('/',auth['isAuthenticated'](),controller[_0x0a9e('0x9')]);router[_0x0a9e('0x8')](_0x0a9e('0xa'),auth['isAuthenticated'](),controller['describe']);router[_0x0a9e('0x8')]('/:id',auth['isAuthenticated'](),controller[_0x0a9e('0xb')]);router[_0x0a9e('0xc')]('/',auth[_0x0a9e('0xd')](),controller[_0x0a9e('0xe')]);router[_0x0a9e('0xf')](_0x0a9e('0x10'),auth['isAuthenticated'](),controller['update']);router['delete']('/:id',auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x11')]);module[_0x0a9e('0x12')]=router;
\ No newline at end of file
+var _0xd8b0=['destroy','exports','multer','util','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','isAuthenticated','index','get','describe','/:id','show','post','create','put','update'];(function(_0x22c393,_0x1f2389){var _0x161580=function(_0x3bd765){while(--_0x3bd765){_0x22c393['push'](_0x22c393['shift']());}};_0x161580(++_0x1f2389);}(_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 41e268e..3e1d06a 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 _0x5ac3=['STRING','*,*,*,*','sequelize','INTEGER','noop','TEXT'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x5ac3,0xce));var _0x35ac=function(_0x551463,_0x197e90){_0x551463=_0x551463-0x0;var _0x4d38f6=_0x5ac3[_0x551463];return _0x4d38f6;};'use strict';var Sequelize=require(_0x35ac('0x0'));module['exports']={'priority':{'type':Sequelize[_0x35ac('0x1')],'allowNull':![]},'app':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0x35ac('0x2')},'appdata':{'type':Sequelize[_0x35ac('0x3')]()},'description':{'type':Sequelize[_0x35ac('0x4')]},'interval':{'type':Sequelize[_0x35ac('0x4')],'defaultValue':_0x35ac('0x5')}};
\ No newline at end of file
+var _0xfb69=['INTEGER','STRING','sequelize'];(function(_0x3fc209,_0x83e34){var _0x3fd3d=function(_0x73319e){while(--_0x73319e){_0x3fc209['push'](_0x3fc209['shift']());}};_0x3fd3d(++_0x83e34);}(_0xfb69,0x113));var _0x9fb6=function(_0x125580,_0x641673){_0x125580=_0x125580-0x0;var _0x23954a=_0xfb69[_0x125580];return _0x23954a;};'use strict';var Sequelize=require(_0x9fb6('0x0'));module['exports']={'priority':{'type':Sequelize[_0x9fb6('0x1')],'allowNull':![]},'app':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':'noop'},'appdata':{'type':Sequelize['TEXT']()},'description':{'type':Sequelize['STRING']},'interval':{'type':Sequelize[_0x9fb6('0x2')],'defaultValue':'*,*,*,*'}};
\ No newline at end of file
diff --git a/server/api/chatApplication/chatApplication.controller.js b/server/api/chatApplication/chatApplication.controller.js
index 48af967..2904ba2 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 _0x2cae=['keys','ChatApplication','rawAttributes','query','filters','intersection','fields','attributes','includeAll','include','merge','options','find','catch','body','eml-format','rimraf','request-promise','moment','mustache','util','path','sox','ejs','fs-extra','squel','jsforce','desk.js','to-csv','querystring','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','sendStatus','status','json','offset','limit','count','set','apply','reject','save','update','then','destroy','end','error','stack','name','send','show','params','model'];(function(_0x89b6b9,_0x1d271e){var _0x294d7b=function(_0x2c54fd){while(--_0x2c54fd){_0x89b6b9['push'](_0x89b6b9['shift']());}};_0x294d7b(++_0x1d271e);}(_0x2cae,0x16b));var _0xe2ca=function(_0x22f8ab,_0x15d8ff){_0x22f8ab=_0x22f8ab-0x0;var _0x2a70e5=_0x2cae[_0x22f8ab];return _0x2a70e5;};'use strict';var emlformat=require(_0xe2ca('0x0'));var rimraf=require(_0xe2ca('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0xe2ca('0x2'));var moment=require(_0xe2ca('0x3'));var BPromise=require('bluebird');var Mustache=require(_0xe2ca('0x4'));var util=require(_0xe2ca('0x5'));var path=require(_0xe2ca('0x6'));var sox=require(_0xe2ca('0x7'));var csv=require('to-csv');var ejs=require(_0xe2ca('0x8'));var fs=require('fs');var fs_extra=require(_0xe2ca('0x9'));var _=require('lodash');var squel=require(_0xe2ca('0xa'));var crypto=require('crypto');var jsforce=require(_0xe2ca('0xb'));var deskjs=require(_0xe2ca('0xc'));var toCsv=require(_0xe2ca('0xd'));var querystring=require(_0xe2ca('0xe'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0xe2ca('0xf'));var hardwareService=require(_0xe2ca('0x10'));var logger=require(_0xe2ca('0x11'))(_0xe2ca('0x12'));var utils=require(_0xe2ca('0x13'));var config=require(_0xe2ca('0x14'));var licenseUtil=require(_0xe2ca('0x15'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x1138ee,_0x2773cc){_0x2773cc=_0x2773cc||0xcc;return function(_0x199237){if(_0x199237){return _0x1138ee[_0xe2ca('0x16')](_0x2773cc);}return _0x1138ee[_0xe2ca('0x17')](_0x2773cc)['end']();};}function respondWithResult(_0x31f283,_0x3cfcc9){_0x3cfcc9=_0x3cfcc9||0xc8;return function(_0x27c3ad){if(_0x27c3ad){return _0x31f283[_0xe2ca('0x17')](_0x3cfcc9)[_0xe2ca('0x18')](_0x27c3ad);}};}function respondWithFilteredResult(_0x3a9612,_0x1c1514){return function(_0x29cdcf){if(_0x29cdcf){var _0x326340=typeof _0x1c1514[_0xe2ca('0x19')]==='undefined'&&typeof _0x1c1514[_0xe2ca('0x1a')]==='undefined';var _0x4ca8fd=_0x29cdcf[_0xe2ca('0x1b')];var _0x18cd42=_0x326340?0x0:_0x1c1514['offset'];var _0x393c23=_0x326340?_0x29cdcf[_0xe2ca('0x1b')]:_0x1c1514[_0xe2ca('0x19')]+_0x1c1514['limit'];var _0x4380fb;if(_0x393c23>=_0x4ca8fd){_0x393c23=_0x4ca8fd;_0x4380fb=0xc8;}else{_0x4380fb=0xce;}_0x3a9612[_0xe2ca('0x17')](_0x4380fb);return _0x3a9612[_0xe2ca('0x1c')]('Content-Range',_0x18cd42+'-'+_0x393c23+'/'+_0x4ca8fd)[_0xe2ca('0x18')](_0x29cdcf);}return null;};}function patchUpdates(_0x56b574){return function(_0x16f418){try{jsonpatch[_0xe2ca('0x1d')](_0x16f418,_0x56b574,!![]);}catch(_0x60d8e8){return BPromise[_0xe2ca('0x1e')](_0x60d8e8);}return _0x16f418[_0xe2ca('0x1f')]();};}function saveUpdates(_0x1b98d8,_0x50af69){return function(_0x1a1522){if(_0x1a1522){return _0x1a1522[_0xe2ca('0x20')](_0x1b98d8)[_0xe2ca('0x21')](function(_0x2ca129){return _0x2ca129;});}return null;};}function removeEntity(_0x18a6c6,_0x2772b5){return function(_0xa1fa2b){if(_0xa1fa2b){return _0xa1fa2b[_0xe2ca('0x22')]()[_0xe2ca('0x21')](function(){_0x18a6c6['status'](0xcc)[_0xe2ca('0x23')]();});}};}function handleEntityNotFound(_0x272bb3,_0x3f3d6e){return function(_0xc52f5e){if(!_0xc52f5e){_0x272bb3[_0xe2ca('0x16')](0x194);}return _0xc52f5e;};}function handleError(_0x4b2a2e,_0x524b6c){_0x524b6c=_0x524b6c||0x1f4;return function(_0x20ac37){logger[_0xe2ca('0x24')](_0x20ac37[_0xe2ca('0x25')]);if(_0x20ac37[_0xe2ca('0x26')]){delete _0x20ac37[_0xe2ca('0x26')];}_0x4b2a2e[_0xe2ca('0x17')](_0x524b6c)[_0xe2ca('0x27')](_0x20ac37);};}exports[_0xe2ca('0x28')]=function(_0x565e9b,_0x5df46f){var _0x333665={'raw':!![],'where':{'id':_0x565e9b[_0xe2ca('0x29')]['id']}},_0x300d0e={};_0x300d0e[_0xe2ca('0x2a')]=_[_0xe2ca('0x2b')](db[_0xe2ca('0x2c')][_0xe2ca('0x2d')]);_0x300d0e[_0xe2ca('0x2e')]=_[_0xe2ca('0x2b')](_0x565e9b[_0xe2ca('0x2e')]);_0x300d0e[_0xe2ca('0x2f')]=_[_0xe2ca('0x30')](_0x300d0e[_0xe2ca('0x2a')],_0x300d0e[_0xe2ca('0x2e')]);_0x333665['attributes']=_[_0xe2ca('0x30')](_0x300d0e[_0xe2ca('0x2a')],qs[_0xe2ca('0x31')](_0x565e9b[_0xe2ca('0x2e')][_0xe2ca('0x31')]));_0x333665[_0xe2ca('0x32')]=_0x333665[_0xe2ca('0x32')]['length']?_0x333665['attributes']:_0x300d0e['model'];if(_0x565e9b[_0xe2ca('0x2e')][_0xe2ca('0x33')]){_0x333665[_0xe2ca('0x34')]=[{'all':!![]}];}_0x333665=_[_0xe2ca('0x35')]({},_0x333665,_0x565e9b[_0xe2ca('0x36')]);return db['ChatApplication'][_0xe2ca('0x37')](_0x333665)[_0xe2ca('0x21')](handleEntityNotFound(_0x5df46f,null))['then'](respondWithResult(_0x5df46f,null))[_0xe2ca('0x38')](handleError(_0x5df46f,null));};exports[_0xe2ca('0x20')]=function(_0x21d7bf,_0x48b0f8){if(_0x21d7bf[_0xe2ca('0x39')]['id']){delete _0x21d7bf[_0xe2ca('0x39')]['id'];}return db[_0xe2ca('0x2c')]['find']({'where':{'id':_0x21d7bf[_0xe2ca('0x29')]['id']}})['then'](handleEntityNotFound(_0x48b0f8,null))[_0xe2ca('0x21')](saveUpdates(_0x21d7bf['body'],null))['then'](respondWithResult(_0x48b0f8,null))[_0xe2ca('0x38')](handleError(_0x48b0f8,null));};exports[_0xe2ca('0x22')]=function(_0x2dbf5e,_0x57e784){return db[_0xe2ca('0x2c')][_0xe2ca('0x37')]({'where':{'id':_0x2dbf5e[_0xe2ca('0x29')]['id']}})[_0xe2ca('0x21')](handleEntityNotFound(_0x57e784,null))['then'](removeEntity(_0x57e784,null))['catch'](handleError(_0x57e784,null));};
\ No newline at end of file
+var _0x6836=['stack','name','send','show','params','keys','ChatApplication','query','filters','model','attributes','intersection','fields','length','includeAll','include','merge','options','find','body','catch','eml-format','rimraf','zip-dir','request-promise','bluebird','util','sox','to-csv','ejs','fs-extra','squel','crypto','jsforce','desk.js','querystring','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','status','offset','undefined','limit','count','set','Content-Range','json','apply','reject','save','update','then','destroy','error'];(function(_0x2e3b30,_0x31b2c0){var _0x3811a0=function(_0x190460){while(--_0x190460){_0x2e3b30['push'](_0x2e3b30['shift']());}};_0x3811a0(++_0x31b2c0);}(_0x6836,0x1c0));var _0x6683=function(_0x13ea00,_0x12f610){_0x13ea00=_0x13ea00-0x0;var _0x1f7347=_0x6836[_0x13ea00];return _0x1f7347;};'use strict';var emlformat=require(_0x6683('0x0'));var rimraf=require(_0x6683('0x1'));var zipdir=require(_0x6683('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x6683('0x3'));var moment=require('moment');var BPromise=require(_0x6683('0x4'));var Mustache=require('mustache');var util=require(_0x6683('0x5'));var path=require('path');var sox=require(_0x6683('0x6'));var csv=require(_0x6683('0x7'));var ejs=require(_0x6683('0x8'));var fs=require('fs');var fs_extra=require(_0x6683('0x9'));var _=require('lodash');var squel=require(_0x6683('0xa'));var crypto=require(_0x6683('0xb'));var jsforce=require(_0x6683('0xc'));var deskjs=require(_0x6683('0xd'));var toCsv=require(_0x6683('0x7'));var querystring=require(_0x6683('0xe'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x6683('0xf'));var qs=require(_0x6683('0x10'));var as=require(_0x6683('0x11'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x6683('0x12'))('api');var utils=require(_0x6683('0x13'));var config=require(_0x6683('0x14'));var licenseUtil=require(_0x6683('0x15'));var db=require(_0x6683('0x16'))['db'];function respondWithStatusCode(_0x3479a3,_0x205647){_0x205647=_0x205647||0xcc;return function(_0x4181e2){if(_0x4181e2){return _0x3479a3[_0x6683('0x17')](_0x205647);}return _0x3479a3['status'](_0x205647)[_0x6683('0x18')]();};}function respondWithResult(_0x1bf449,_0x4ccb6){_0x4ccb6=_0x4ccb6||0xc8;return function(_0x28985f){if(_0x28985f){return _0x1bf449[_0x6683('0x19')](_0x4ccb6)['json'](_0x28985f);}};}function respondWithFilteredResult(_0x2a6c74,_0x44e850){return function(_0x3df040){if(_0x3df040){var _0x11fdef=typeof _0x44e850[_0x6683('0x1a')]===_0x6683('0x1b')&&typeof _0x44e850[_0x6683('0x1c')]===_0x6683('0x1b');var _0x47466b=_0x3df040[_0x6683('0x1d')];var _0x4cad41=_0x11fdef?0x0:_0x44e850[_0x6683('0x1a')];var _0x1be466=_0x11fdef?_0x3df040[_0x6683('0x1d')]:_0x44e850[_0x6683('0x1a')]+_0x44e850['limit'];var _0x2dabc1;if(_0x1be466>=_0x47466b){_0x1be466=_0x47466b;_0x2dabc1=0xc8;}else{_0x2dabc1=0xce;}_0x2a6c74[_0x6683('0x19')](_0x2dabc1);return _0x2a6c74[_0x6683('0x1e')](_0x6683('0x1f'),_0x4cad41+'-'+_0x1be466+'/'+_0x47466b)[_0x6683('0x20')](_0x3df040);}return null;};}function patchUpdates(_0x2d3775){return function(_0x1fa733){try{jsonpatch[_0x6683('0x21')](_0x1fa733,_0x2d3775,!![]);}catch(_0x1978a9){return BPromise[_0x6683('0x22')](_0x1978a9);}return _0x1fa733[_0x6683('0x23')]();};}function saveUpdates(_0x248177,_0x34680f){return function(_0x3b63e7){if(_0x3b63e7){return _0x3b63e7[_0x6683('0x24')](_0x248177)[_0x6683('0x25')](function(_0x55aeb3){return _0x55aeb3;});}return null;};}function removeEntity(_0x12ce3f,_0x33cdd3){return function(_0x49c1ce){if(_0x49c1ce){return _0x49c1ce[_0x6683('0x26')]()[_0x6683('0x25')](function(){_0x12ce3f[_0x6683('0x19')](0xcc)['end']();});}};}function handleEntityNotFound(_0x3b005e,_0x2a2243){return function(_0x43879e){if(!_0x43879e){_0x3b005e[_0x6683('0x17')](0x194);}return _0x43879e;};}function handleError(_0x507b67,_0x1e9c1e){_0x1e9c1e=_0x1e9c1e||0x1f4;return function(_0x40959d){logger[_0x6683('0x27')](_0x40959d[_0x6683('0x28')]);if(_0x40959d['name']){delete _0x40959d[_0x6683('0x29')];}_0x507b67[_0x6683('0x19')](_0x1e9c1e)[_0x6683('0x2a')](_0x40959d);};}exports[_0x6683('0x2b')]=function(_0x1cf62b,_0x1bb6e0){var _0x343f4e={'raw':!![],'where':{'id':_0x1cf62b[_0x6683('0x2c')]['id']}},_0xda3a48={};_0xda3a48['model']=_[_0x6683('0x2d')](db[_0x6683('0x2e')]['rawAttributes']);_0xda3a48[_0x6683('0x2f')]=_[_0x6683('0x2d')](_0x1cf62b['query']);_0xda3a48[_0x6683('0x30')]=_['intersection'](_0xda3a48[_0x6683('0x31')],_0xda3a48[_0x6683('0x2f')]);_0x343f4e[_0x6683('0x32')]=_[_0x6683('0x33')](_0xda3a48['model'],qs[_0x6683('0x34')](_0x1cf62b[_0x6683('0x2f')][_0x6683('0x34')]));_0x343f4e[_0x6683('0x32')]=_0x343f4e[_0x6683('0x32')][_0x6683('0x35')]?_0x343f4e[_0x6683('0x32')]:_0xda3a48[_0x6683('0x31')];if(_0x1cf62b[_0x6683('0x2f')][_0x6683('0x36')]){_0x343f4e[_0x6683('0x37')]=[{'all':!![]}];}_0x343f4e=_[_0x6683('0x38')]({},_0x343f4e,_0x1cf62b[_0x6683('0x39')]);return db[_0x6683('0x2e')][_0x6683('0x3a')](_0x343f4e)['then'](handleEntityNotFound(_0x1bb6e0,null))[_0x6683('0x25')](respondWithResult(_0x1bb6e0,null))['catch'](handleError(_0x1bb6e0,null));};exports['update']=function(_0x2b8188,_0x27ad02){if(_0x2b8188[_0x6683('0x3b')]['id']){delete _0x2b8188[_0x6683('0x3b')]['id'];}return db[_0x6683('0x2e')][_0x6683('0x3a')]({'where':{'id':_0x2b8188[_0x6683('0x2c')]['id']}})[_0x6683('0x25')](handleEntityNotFound(_0x27ad02,null))['then'](saveUpdates(_0x2b8188[_0x6683('0x3b')],null))[_0x6683('0x25')](respondWithResult(_0x27ad02,null))[_0x6683('0x3c')](handleError(_0x27ad02,null));};exports['destroy']=function(_0x4f572b,_0x2bd212){return db['ChatApplication'][_0x6683('0x3a')]({'where':{'id':_0x4f572b[_0x6683('0x2c')]['id']}})['then'](handleEntityNotFound(_0x2bd212,null))[_0x6683('0x25')](removeEntity(_0x2bd212,null))[_0x6683('0x3c')](handleError(_0x2bd212,null));};
\ No newline at end of file
diff --git a/server/api/chatApplication/chatApplication.model.js b/server/api/chatApplication/chatApplication.model.js
index bb89672..b8873a4 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 _0x4946=['request-promise','../../config/environment','exports','define','utf8mb4','utf8mb4_unicode_ci','lodash','util','api'];(function(_0x341cbf,_0x52be4a){var _0x3ebf74=function(_0x2943bd){while(--_0x2943bd){_0x341cbf['push'](_0x341cbf['shift']());}};_0x3ebf74(++_0x52be4a);}(_0x4946,0x1b6));var _0x6494=function(_0x40f451,_0x4bbff8){_0x40f451=_0x40f451-0x0;var _0x4c09b3=_0x4946[_0x40f451];return _0x4c09b3;};'use strict';var _=require(_0x6494('0x0'));var util=require(_0x6494('0x1'));var logger=require('../../config/logger')(_0x6494('0x2'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x6494('0x3'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x6494('0x4'));var attributes=require('./chatApplication.attributes');module[_0x6494('0x5')]=function(_0x54e930,_0x3cb2bc){return _0x54e930[_0x6494('0x6')]('ChatApplication',attributes,{'tableName':'chat_applications','paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x6494('0x7'),'collate':_0x6494('0x8')});};
\ No newline at end of file
+var _0x9f8b=['api','request-promise','path','rimraf','../../config/environment','./chatApplication.attributes','exports','define','ChatApplication','chat_applications','utf8mb4','util','../../config/logger'];(function(_0xd65c06,_0x33ce28){var _0x419849=function(_0x39f056){while(--_0x39f056){_0xd65c06['push'](_0xd65c06['shift']());}};_0x419849(++_0x33ce28);}(_0x9f8b,0x9a));var _0xb9f8=function(_0x48a96f,_0x530059){_0x48a96f=_0x48a96f-0x0;var _0x3ff3ef=_0x9f8b[_0x48a96f];return _0x3ff3ef;};'use strict';var _=require('lodash');var util=require(_0xb9f8('0x0'));var logger=require(_0xb9f8('0x1'))(_0xb9f8('0x2'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0xb9f8('0x3'));var fs=require('fs');var path=require(_0xb9f8('0x4'));var rimraf=require(_0xb9f8('0x5'));var config=require(_0xb9f8('0x6'));var attributes=require(_0xb9f8('0x7'));module[_0xb9f8('0x8')]=function(_0x7a983b,_0x9c53b3){return _0x7a983b[_0xb9f8('0x9')](_0xb9f8('0xa'),attributes,{'tableName':_0xb9f8('0xb'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0xb9f8('0xc'),'collate':'utf8mb4_unicode_ci'});};
\ No newline at end of file
diff --git a/server/api/chatApplication/chatApplication.rpc.js b/server/api/chatApplication/chatApplication.rpc.js
index f36fc99..f45cc97 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 _0x102d=['bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','then','info','ChatApplication,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','catch','lodash','util','moment'];(function(_0x434339,_0x2abf5e){var _0x507ca6=function(_0x23770a){while(--_0x23770a){_0x434339['push'](_0x434339['shift']());}};_0x507ca6(++_0x2abf5e);}(_0x102d,0x1dd));var _0xd102=function(_0x41498e,_0xe11de7){_0x41498e=_0x41498e-0x0;var _0x2496e2=_0x102d[_0x41498e];return _0x2496e2;};'use strict';var _=require(_0xd102('0x0'));var util=require(_0xd102('0x1'));var moment=require(_0xd102('0x2'));var BPromise=require(_0xd102('0x3'));var rs=require(_0xd102('0x4'));var fs=require('fs');var Redis=require(_0xd102('0x5'));var db=require(_0xd102('0x6'))['db'];var utils=require(_0xd102('0x7'));var logger=require(_0xd102('0x8'))(_0xd102('0x9'));var config=require(_0xd102('0xa'));var jayson=require(_0xd102('0xb'));var client=jayson[_0xd102('0xc')]['http']({'port':0x232a});function respondWithRpcPromise(_0x174b3b,_0x266c1e,_0x3ab5a6){return new BPromise(function(_0x339698,_0x1e37b2){return client['request'](_0x174b3b,_0x3ab5a6)[_0xd102('0xd')](function(_0x5ca006){logger[_0xd102('0xe')](_0xd102('0xf'),_0x266c1e,_0xd102('0x10'));logger[_0xd102('0x11')]('ChatApplication,\x20%s,\x20%s,\x20%s',_0x266c1e,'request\x20sent',JSON[_0xd102('0x12')](_0x5ca006));if(_0x5ca006[_0xd102('0x13')]){if(_0x5ca006['error'][_0xd102('0x14')]===0x1f4){logger['error'](_0xd102('0xf'),_0x266c1e,_0x5ca006['error'][_0xd102('0x15')]);return _0x1e37b2(_0x5ca006[_0xd102('0x13')]['message']);}logger['error'](_0xd102('0xf'),_0x266c1e,_0x5ca006[_0xd102('0x13')][_0xd102('0x15')]);return _0x339698(_0x5ca006[_0xd102('0x13')][_0xd102('0x15')]);}else{logger['info'](_0xd102('0xf'),_0x266c1e,'request\x20sent');_0x339698(_0x5ca006[_0xd102('0x16')][_0xd102('0x15')]);}})[_0xd102('0x17')](function(_0x2cfd88){logger[_0xd102('0x13')]('ChatApplication,\x20%s,\x20%s',_0x266c1e,_0x2cfd88);_0x1e37b2(_0x2cfd88);});});}
\ No newline at end of file
+var _0x75bd=['rpc','../../config/environment','client','http','request','then','request\x20sent','debug','stringify','error','code','ChatApplication,\x20%s,\x20%s','message','info','catch','util','bluebird','randomstring','../../mysqldb'];(function(_0x4746cc,_0xe1e47d){var _0x51b5ad=function(_0x3acadc){while(--_0x3acadc){_0x4746cc['push'](_0x4746cc['shift']());}};_0x51b5ad(++_0xe1e47d);}(_0x75bd,0x119));var _0xd75b=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x75bd[_0x14add3];return _0x4a174f;};'use strict';var _=require('lodash');var util=require(_0xd75b('0x0'));var moment=require('moment');var BPromise=require(_0xd75b('0x1'));var rs=require(_0xd75b('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xd75b('0x3'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0xd75b('0x4'));var config=require(_0xd75b('0x5'));var jayson=require('jayson/promise');var client=jayson[_0xd75b('0x6')][_0xd75b('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x3a403d,_0x3d024b,_0x470b18){return new BPromise(function(_0x16c78a,_0x103f4b){return client[_0xd75b('0x8')](_0x3a403d,_0x470b18)[_0xd75b('0x9')](function(_0x4fd9b6){logger['info']('ChatApplication,\x20%s,\x20%s',_0x3d024b,_0xd75b('0xa'));logger[_0xd75b('0xb')]('ChatApplication,\x20%s,\x20%s,\x20%s',_0x3d024b,_0xd75b('0xa'),JSON[_0xd75b('0xc')](_0x4fd9b6));if(_0x4fd9b6['error']){if(_0x4fd9b6[_0xd75b('0xd')][_0xd75b('0xe')]===0x1f4){logger['error'](_0xd75b('0xf'),_0x3d024b,_0x4fd9b6[_0xd75b('0xd')][_0xd75b('0x10')]);return _0x103f4b(_0x4fd9b6[_0xd75b('0xd')][_0xd75b('0x10')]);}logger[_0xd75b('0xd')](_0xd75b('0xf'),_0x3d024b,_0x4fd9b6[_0xd75b('0xd')][_0xd75b('0x10')]);return _0x16c78a(_0x4fd9b6[_0xd75b('0xd')][_0xd75b('0x10')]);}else{logger[_0xd75b('0x11')](_0xd75b('0xf'),_0x3d024b,_0xd75b('0xa'));_0x16c78a(_0x4fd9b6['result'][_0xd75b('0x10')]);}})[_0xd75b('0x12')](function(_0x2fd927){logger['error'](_0xd75b('0xf'),_0x3d024b,_0x2fd927);_0x103f4b(_0x2fd927);});});}
\ No newline at end of file
diff --git a/server/api/chatApplication/index.js b/server/api/chatApplication/index.js
index e310a0c..d2f09ca 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 _0x44b8=['Router','fs-extra','../../components/auth/service','../../config/environment','./chatApplication.controller','get','/:id','isAuthenticated','show','put','update','delete','destroy','util','express'];(function(_0x397e5f,_0x454c8f){var _0x5302b8=function(_0x1a29ef){while(--_0x1a29ef){_0x397e5f['push'](_0x397e5f['shift']());}};_0x5302b8(++_0x454c8f);}(_0x44b8,0x175));var _0x844b=function(_0x3b1351,_0x5c61eb){_0x3b1351=_0x3b1351-0x0;var _0x535cb7=_0x44b8[_0x3b1351];return _0x535cb7;};'use strict';var multer=require('multer');var util=require(_0x844b('0x0'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0x844b('0x1'));var router=express[_0x844b('0x2')]();var fs_extra=require(_0x844b('0x3'));var auth=require(_0x844b('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0x844b('0x5'));var controller=require(_0x844b('0x6'));router[_0x844b('0x7')](_0x844b('0x8'),auth[_0x844b('0x9')](),controller[_0x844b('0xa')]);router[_0x844b('0xb')]('/:id',auth[_0x844b('0x9')](),controller[_0x844b('0xc')]);router[_0x844b('0xd')](_0x844b('0x8'),auth['isAuthenticated'](),controller[_0x844b('0xe')]);module['exports']=router;
\ No newline at end of file
+var _0xdd10=['isAuthenticated','destroy','exports','multer','util','path','express','fs-extra','../../components/auth/service','../../config/environment','./chatApplication.controller','get','show','/:id','update','delete'];(function(_0x44731a,_0x3417bb){var _0x5541bd=function(_0x26d125){while(--_0x26d125){_0x44731a['push'](_0x44731a['shift']());}};_0x5541bd(++_0x3417bb);}(_0xdd10,0x123));var _0x0dd1=function(_0x1f5ab3,_0x15259c){_0x1f5ab3=_0x1f5ab3-0x0;var _0x12cff0=_0xdd10[_0x1f5ab3];return _0x12cff0;};'use strict';var multer=require(_0x0dd1('0x0'));var util=require(_0x0dd1('0x1'));var path=require(_0x0dd1('0x2'));var timeout=require('connect-timeout');var express=require(_0x0dd1('0x3'));var router=express['Router']();var fs_extra=require(_0x0dd1('0x4'));var auth=require(_0x0dd1('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x0dd1('0x6'));var controller=require(_0x0dd1('0x7'));router[_0x0dd1('0x8')]('/:id',auth['isAuthenticated'](),controller[_0x0dd1('0x9')]);router['put'](_0x0dd1('0xa'),auth['isAuthenticated'](),controller[_0x0dd1('0xb')]);router[_0x0dd1('0xc')](_0x0dd1('0xa'),auth[_0x0dd1('0xd')](),controller[_0x0dd1('0xe')]);module[_0x0dd1('0xf')]=router;
\ No newline at end of file
diff --git a/server/api/chatGroup/chatGroup.attributes.js b/server/api/chatGroup/chatGroup.attributes.js
index 7ba1954..4b99bae 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 _0x11e5=['STRING','sequelize'];(function(_0x38ced4,_0x24263f){var _0x547c07=function(_0x279fc4){while(--_0x279fc4){_0x38ced4['push'](_0x38ced4['shift']());}};_0x547c07(++_0x24263f);}(_0x11e5,0x8b));var _0x511e=function(_0x40f5e0,_0x254544){_0x40f5e0=_0x40f5e0-0x0;var _0x54e0eb=_0x11e5[_0x40f5e0];return _0x54e0eb;};'use strict';var Sequelize=require(_0x511e('0x0'));module['exports']={'name':{'type':Sequelize[_0x511e('0x1')],'allowNull':![]},'description':{'type':Sequelize[_0x511e('0x1')]},'write':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]}};
\ No newline at end of file
+var _0xee00=['BOOLEAN','sequelize','exports','STRING'];(function(_0x2c5dd5,_0x5308de){var _0x4b76db=function(_0x3cff23){while(--_0x3cff23){_0x2c5dd5['push'](_0x2c5dd5['shift']());}};_0x4b76db(++_0x5308de);}(_0xee00,0xd5));var _0x0ee0=function(_0x26c8b5,_0x46f969){_0x26c8b5=_0x26c8b5-0x0;var _0x257d19=_0xee00[_0x26c8b5];return _0x257d19;};'use strict';var Sequelize=require(_0x0ee0('0x0'));module[_0x0ee0('0x1')]={'name':{'type':Sequelize[_0x0ee0('0x2')],'allowNull':![]},'description':{'type':Sequelize[_0x0ee0('0x2')]},'write':{'type':Sequelize[_0x0ee0('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 a031301..d9f22e8 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 _0xbbba=['desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','redis','localhost','socket.io-emitter','./chatGroup.socket','register','sendStatus','status','json','offset','undefined','count','set','Content-Range','apply','save','update','destroy','then','error','name','send','index','map','ChatGroup','rawAttributes','fieldName','type','model','keys','query','intersection','attributes','length','nolimit','limit','order','sort','pick','filter','where','merge','VIRTUAL','options','includeAll','findAll','rows','catch','params','include','find','create','body','describe','ChatInternalMessage','user','addMembers','ids','getMembers','User','fields','filters','hasOwnProperty','removeMembers','addMessage','getMessages','findOne','$gte','split','YYYY-MM-DD\x20HH:mm:ss','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','sox','to-csv','ejs','lodash','squel','jsforce'];(function(_0x4145f0,_0x193417){var _0x5d58bd=function(_0x4ffe92){while(--_0x4ffe92){_0x4145f0['push'](_0x4145f0['shift']());}};_0x5d58bd(++_0x193417);}(_0xbbba,0xad));var _0xabbb=function(_0x301ca3,_0x4233c5){_0x301ca3=_0x301ca3-0x0;var _0x131292=_0xbbba[_0x301ca3];return _0x131292;};'use strict';var emlformat=require(_0xabbb('0x0'));var rimraf=require(_0xabbb('0x1'));var zipdir=require(_0xabbb('0x2'));var jsonpatch=require(_0xabbb('0x3'));var rp=require(_0xabbb('0x4'));var moment=require(_0xabbb('0x5'));var BPromise=require('bluebird');var Mustache=require(_0xabbb('0x6'));var util=require(_0xabbb('0x7'));var path=require(_0xabbb('0x8'));var sox=require(_0xabbb('0x9'));var csv=require(_0xabbb('0xa'));var ejs=require(_0xabbb('0xb'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xabbb('0xc'));var squel=require(_0xabbb('0xd'));var crypto=require('crypto');var jsforce=require(_0xabbb('0xe'));var deskjs=require(_0xabbb('0xf'));var toCsv=require('to-csv');var querystring=require(_0xabbb('0x10'));var Papa=require(_0xabbb('0x11'));var Redis=require('ioredis');var authService=require(_0xabbb('0x12'));var qs=require(_0xabbb('0x13'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0xabbb('0x14'))(_0xabbb('0x15'));var utils=require('../../config/utils');var config=require(_0xabbb('0x16'));var licenseUtil=require(_0xabbb('0x17'));var db=require(_0xabbb('0x18'))['db'];config[_0xabbb('0x19')]=_['defaults'](config['redis'],{'host':_0xabbb('0x1a'),'port':0x18eb});var socket=require(_0xabbb('0x1b'))(new Redis(config[_0xabbb('0x19')]));require(_0xabbb('0x1c'))[_0xabbb('0x1d')](socket);function respondWithStatusCode(_0x4490ab,_0x3f4bd9){_0x3f4bd9=_0x3f4bd9||0xcc;return function(_0x4c048c){if(_0x4c048c){return _0x4490ab[_0xabbb('0x1e')](_0x3f4bd9);}return _0x4490ab[_0xabbb('0x1f')](_0x3f4bd9)['end']();};}function respondWithResult(_0x35e933,_0x26ac18){_0x26ac18=_0x26ac18||0xc8;return function(_0x43533c){if(_0x43533c){return _0x35e933[_0xabbb('0x1f')](_0x26ac18)[_0xabbb('0x20')](_0x43533c);}};}function respondWithFilteredResult(_0x3fe69a,_0x35215b){return function(_0x23daaf){if(_0x23daaf){var _0x1933d7=typeof _0x35215b[_0xabbb('0x21')]==='undefined'&&typeof _0x35215b['limit']===_0xabbb('0x22');var _0x1bfeb4=_0x23daaf[_0xabbb('0x23')];var _0x2c8882=_0x1933d7?0x0:_0x35215b[_0xabbb('0x21')];var _0x50e698=_0x1933d7?_0x23daaf[_0xabbb('0x23')]:_0x35215b[_0xabbb('0x21')]+_0x35215b['limit'];var _0x557faf;if(_0x50e698>=_0x1bfeb4){_0x50e698=_0x1bfeb4;_0x557faf=0xc8;}else{_0x557faf=0xce;}_0x3fe69a['status'](_0x557faf);return _0x3fe69a[_0xabbb('0x24')](_0xabbb('0x25'),_0x2c8882+'-'+_0x50e698+'/'+_0x1bfeb4)['json'](_0x23daaf);}return null;};}function patchUpdates(_0x1202d6){return function(_0x384f64){try{jsonpatch[_0xabbb('0x26')](_0x384f64,_0x1202d6,!![]);}catch(_0xdf2f53){return BPromise['reject'](_0xdf2f53);}return _0x384f64[_0xabbb('0x27')]();};}function saveUpdates(_0x1f44c7,_0x3fdaf4){return function(_0x201d13){if(_0x201d13){return _0x201d13[_0xabbb('0x28')](_0x1f44c7)['then'](function(_0x12bdbe){return _0x12bdbe;});}return null;};}function removeEntity(_0x305b5f,_0x47a018){return function(_0x235a1d){if(_0x235a1d){return _0x235a1d[_0xabbb('0x29')]()[_0xabbb('0x2a')](function(){_0x305b5f[_0xabbb('0x1f')](0xcc)['end']();});}};}function handleEntityNotFound(_0x26dad9,_0x5e30c1){return function(_0x295b59){if(!_0x295b59){_0x26dad9[_0xabbb('0x1e')](0x194);}return _0x295b59;};}function handleError(_0x2e731e,_0x25f7ec){_0x25f7ec=_0x25f7ec||0x1f4;return function(_0x29f099){logger[_0xabbb('0x2b')](_0x29f099['stack']);if(_0x29f099['name']){delete _0x29f099[_0xabbb('0x2c')];}_0x2e731e[_0xabbb('0x1f')](_0x25f7ec)[_0xabbb('0x2d')](_0x29f099);};}exports[_0xabbb('0x2e')]=function(_0x49d093,_0x371661){var _0x2af959={},_0x1c8415={},_0x585960={'count':0x0,'rows':[]};var _0x2eb04c=_[_0xabbb('0x2f')](db[_0xabbb('0x30')][_0xabbb('0x31')],function(_0x3f5672){return{'name':_0x3f5672[_0xabbb('0x32')],'type':_0x3f5672[_0xabbb('0x33')]['key']};});_0x1c8415[_0xabbb('0x34')]=_['map'](_0x2eb04c,_0xabbb('0x2c'));_0x1c8415['query']=_[_0xabbb('0x35')](_0x49d093[_0xabbb('0x36')]);_0x1c8415['filters']=_[_0xabbb('0x37')](_0x1c8415[_0xabbb('0x34')],_0x1c8415[_0xabbb('0x36')]);_0x2af959[_0xabbb('0x38')]=_[_0xabbb('0x37')](_0x1c8415[_0xabbb('0x34')],qs['fields'](_0x49d093[_0xabbb('0x36')]['fields']));_0x2af959[_0xabbb('0x38')]=_0x2af959[_0xabbb('0x38')][_0xabbb('0x39')]?_0x2af959[_0xabbb('0x38')]:_0x1c8415['model'];if(!_0x49d093[_0xabbb('0x36')]['hasOwnProperty'](_0xabbb('0x3a'))){_0x2af959[_0xabbb('0x3b')]=qs[_0xabbb('0x3b')](_0x49d093[_0xabbb('0x36')][_0xabbb('0x3b')]);_0x2af959['offset']=qs[_0xabbb('0x21')](_0x49d093[_0xabbb('0x36')]['offset']);}_0x2af959[_0xabbb('0x3c')]=qs[_0xabbb('0x3d')](_0x49d093[_0xabbb('0x36')][_0xabbb('0x3d')]);_0x2af959['where']=qs['filters'](_[_0xabbb('0x3e')](_0x49d093[_0xabbb('0x36')],_0x1c8415['filters']),_0x2eb04c);if(_0x49d093[_0xabbb('0x36')][_0xabbb('0x3f')]){_0x2af959[_0xabbb('0x40')]=_[_0xabbb('0x41')](_0x2af959[_0xabbb('0x40')],{'$or':_['map'](_0x2eb04c,function(_0x3a1d90){if(_0x3a1d90[_0xabbb('0x33')]!==_0xabbb('0x42')){var _0x14b305={};_0x14b305[_0x3a1d90['name']]={'$like':'%'+_0x49d093[_0xabbb('0x36')][_0xabbb('0x3f')]+'%'};return _0x14b305;}})});}_0x2af959=_[_0xabbb('0x41')]({},_0x2af959,_0x49d093[_0xabbb('0x43')]);var _0x55092a={'where':_0x2af959[_0xabbb('0x40')]};return db[_0xabbb('0x30')][_0xabbb('0x23')](_0x55092a)[_0xabbb('0x2a')](function(_0x5f89b8){_0x585960['count']=_0x5f89b8;if(_0x49d093[_0xabbb('0x36')][_0xabbb('0x44')]){_0x2af959['include']=[{'all':!![]}];}return db[_0xabbb('0x30')][_0xabbb('0x45')](_0x2af959);})['then'](function(_0x470d09){_0x585960[_0xabbb('0x46')]=_0x470d09;return _0x585960;})[_0xabbb('0x2a')](respondWithFilteredResult(_0x371661,_0x2af959))[_0xabbb('0x47')](handleError(_0x371661,null));};exports['show']=function(_0x103c4e,_0x2ba581){var _0x31ddd9={'raw':!![],'where':{'id':_0x103c4e[_0xabbb('0x48')]['id']}},_0x3e6a79={};_0x3e6a79[_0xabbb('0x34')]=_[_0xabbb('0x35')](db[_0xabbb('0x30')][_0xabbb('0x31')]);_0x3e6a79[_0xabbb('0x36')]=_[_0xabbb('0x35')](_0x103c4e[_0xabbb('0x36')]);_0x3e6a79['filters']=_[_0xabbb('0x37')](_0x3e6a79[_0xabbb('0x34')],_0x3e6a79[_0xabbb('0x36')]);_0x31ddd9[_0xabbb('0x38')]=_['intersection'](_0x3e6a79[_0xabbb('0x34')],qs['fields'](_0x103c4e[_0xabbb('0x36')]['fields']));_0x31ddd9['attributes']=_0x31ddd9[_0xabbb('0x38')][_0xabbb('0x39')]?_0x31ddd9[_0xabbb('0x38')]:_0x3e6a79['model'];if(_0x103c4e['query'][_0xabbb('0x44')]){_0x31ddd9[_0xabbb('0x49')]=[{'all':!![]}];}_0x31ddd9=_['merge']({},_0x31ddd9,_0x103c4e[_0xabbb('0x43')]);return db['ChatGroup'][_0xabbb('0x4a')](_0x31ddd9)[_0xabbb('0x2a')](handleEntityNotFound(_0x2ba581,null))[_0xabbb('0x2a')](respondWithResult(_0x2ba581,null))['catch'](handleError(_0x2ba581,null));};exports[_0xabbb('0x4b')]=function(_0x250e64,_0x2b6c01){return db[_0xabbb('0x30')][_0xabbb('0x4b')](_0x250e64['body'],{})[_0xabbb('0x2a')](respondWithResult(_0x2b6c01,0xc9))[_0xabbb('0x47')](handleError(_0x2b6c01,null));};exports[_0xabbb('0x28')]=function(_0x3cf782,_0x507597){if(_0x3cf782[_0xabbb('0x4c')]['id']){delete _0x3cf782['body']['id'];}return db[_0xabbb('0x30')][_0xabbb('0x4a')]({'where':{'id':_0x3cf782['params']['id']}})[_0xabbb('0x2a')](handleEntityNotFound(_0x507597,null))[_0xabbb('0x2a')](saveUpdates(_0x3cf782[_0xabbb('0x4c')],null))[_0xabbb('0x2a')](respondWithResult(_0x507597,null))[_0xabbb('0x47')](handleError(_0x507597,null));};exports[_0xabbb('0x29')]=function(_0x2a25f3,_0x273e6e){return db[_0xabbb('0x30')][_0xabbb('0x4a')]({'where':{'id':_0x2a25f3[_0xabbb('0x48')]['id']}})[_0xabbb('0x2a')](handleEntityNotFound(_0x273e6e,null))[_0xabbb('0x2a')](removeEntity(_0x273e6e,null))[_0xabbb('0x47')](handleError(_0x273e6e,null));};exports[_0xabbb('0x4d')]=function(_0x5e04bd,_0x120304){return db[_0xabbb('0x30')]['describe']()[_0xabbb('0x2a')](respondWithResult(_0x120304,null))['catch'](handleError(_0x120304,null));};exports['getUnread']=function(_0x557955,_0x1f3f74,_0x1ff3b1){return db[_0xabbb('0x4e')]['count']({'where':{'ChatGroupId':_0x557955['params']['id'],'ToId':_0x557955[_0xabbb('0x4f')]['id'],'read':![]}})[_0xabbb('0x2a')](function(_0x23eee8){return{'id':_['toInteger'](_0x557955['params']['id']),'count':_0x23eee8};})[_0xabbb('0x2a')](respondWithResult(_0x1f3f74,null))['catch'](handleError(_0x1f3f74,null));};exports[_0xabbb('0x50')]=function(_0x849d91,_0x3d6b36,_0x560765){return db['ChatGroup'][_0xabbb('0x4a')]({'where':{'id':_0x849d91[_0xabbb('0x48')]['id']}})['then'](handleEntityNotFound(_0x3d6b36,null))[_0xabbb('0x2a')](function(_0x4b4e64){if(_0x4b4e64){return _0x4b4e64['addMembers'](_0x849d91[_0xabbb('0x4c')][_0xabbb('0x51')],_['omit'](_0x849d91['body'],[_0xabbb('0x51'),'id'])||{});}})[_0xabbb('0x2a')](respondWithResult(_0x3d6b36,null))[_0xabbb('0x47')](handleError(_0x3d6b36,null));};exports[_0xabbb('0x52')]=function(_0x586ba9,_0x5153c0,_0xbac6ea){var _0x48b6ff={};var _0x259fbb={};var _0x12680c;var _0x20ec39;return db[_0xabbb('0x30')]['findOne']({'where':{'id':_0x586ba9[_0xabbb('0x48')]['id']}})['then'](handleEntityNotFound(_0x5153c0,null))['then'](function(_0x260878){if(_0x260878){_0x12680c=_0x260878;_0x259fbb[_0xabbb('0x34')]=_[_0xabbb('0x35')](db[_0xabbb('0x53')]['rawAttributes']);_0x259fbb['query']=_[_0xabbb('0x35')](_0x586ba9[_0xabbb('0x36')]);_0x259fbb['filters']=_[_0xabbb('0x37')](_0x259fbb[_0xabbb('0x34')],_0x259fbb[_0xabbb('0x36')]);_0x48b6ff[_0xabbb('0x38')]=_[_0xabbb('0x37')](_0x259fbb[_0xabbb('0x34')],qs[_0xabbb('0x54')](_0x586ba9[_0xabbb('0x36')][_0xabbb('0x54')]));_0x48b6ff[_0xabbb('0x38')]=_0x48b6ff['attributes']['length']?_0x48b6ff[_0xabbb('0x38')]:_0x259fbb[_0xabbb('0x34')];_0x48b6ff[_0xabbb('0x3c')]=qs[_0xabbb('0x3d')](_0x586ba9[_0xabbb('0x36')][_0xabbb('0x3d')]);_0x48b6ff[_0xabbb('0x40')]=qs['filters'](_[_0xabbb('0x3e')](_0x586ba9['query'],_0x259fbb[_0xabbb('0x55')]));if(_0x586ba9[_0xabbb('0x36')]['filter']){_0x48b6ff['where']=_['merge'](_0x48b6ff[_0xabbb('0x40')],{'$or':_[_0xabbb('0x2f')](_0x48b6ff[_0xabbb('0x38')],function(_0xca1f3e){var _0x3be164={};_0x3be164[_0xca1f3e]={'$like':'%'+_0x586ba9[_0xabbb('0x36')][_0xabbb('0x3f')]+'%'};return _0x3be164;})});}_0x48b6ff=_[_0xabbb('0x41')]({},_0x48b6ff,_0x586ba9[_0xabbb('0x43')]);return _0x12680c[_0xabbb('0x52')](_0x48b6ff);}})['then'](function(_0x5ad26e){if(_0x5ad26e){_0x20ec39=_0x5ad26e['length'];if(!_0x586ba9[_0xabbb('0x36')][_0xabbb('0x56')](_0xabbb('0x3a'))){_0x48b6ff[_0xabbb('0x3b')]=qs['limit'](_0x586ba9[_0xabbb('0x36')]['limit']);_0x48b6ff['offset']=qs[_0xabbb('0x21')](_0x586ba9[_0xabbb('0x36')]['offset']);}return _0x12680c[_0xabbb('0x52')](_0x48b6ff);}})[_0xabbb('0x2a')](function(_0x73a072){if(_0x73a072){return _0x73a072?{'count':_0x20ec39,'rows':_0x73a072}:null;}})[_0xabbb('0x2a')](respondWithResult(_0x5153c0,null))[_0xabbb('0x47')](handleError(_0x5153c0,null));};exports[_0xabbb('0x57')]=function(_0x31afbb,_0x1f7dca,_0x3809f3){return db['ChatGroup']['find']({'where':{'id':_0x31afbb[_0xabbb('0x48')]['id']}})[_0xabbb('0x2a')](handleEntityNotFound(_0x1f7dca,null))[_0xabbb('0x2a')](function(_0x237f07){if(_0x237f07){return _0x237f07['removeMembers'](_0x31afbb[_0xabbb('0x36')]['ids']);}})[_0xabbb('0x2a')](respondWithStatusCode(_0x1f7dca,null))[_0xabbb('0x47')](handleError(_0x1f7dca,null));};exports[_0xabbb('0x58')]=function(_0x1be6a2,_0xe01aa7,_0x5b02d5){if(_0x1be6a2['body']['id']){delete _0x1be6a2[_0xabbb('0x4c')]['id'];}return db[_0xabbb('0x30')][_0xabbb('0x4a')]({'where':{'id':_0x1be6a2[_0xabbb('0x48')]['id']}})[_0xabbb('0x2a')](handleEntityNotFound(_0xe01aa7,null))['then'](function(_0x45839c){if(_0x45839c){_0x1be6a2[_0xabbb('0x4c')]['ChatGroupId']=_0x45839c['id'];return db[_0xabbb('0x4e')][_0xabbb('0x4b')](_0x1be6a2[_0xabbb('0x4c')]);}})[_0xabbb('0x2a')](respondWithResult(_0xe01aa7,null))['catch'](handleError(_0xe01aa7,null));};exports[_0xabbb('0x59')]=function(_0x6de080,_0x2a5723,_0x6fc117){var _0x65cc0e={};var _0x3fe720={};var _0x8e598f;var _0x47cb86;return db['ChatGroup'][_0xabbb('0x5a')]({'where':{'id':_0x6de080[_0xabbb('0x48')]['id']}})[_0xabbb('0x2a')](handleEntityNotFound(_0x2a5723,null))[_0xabbb('0x2a')](function(_0x5d9f6c){if(_0x5d9f6c){_0x8e598f=_0x5d9f6c;_0x3fe720[_0xabbb('0x34')]=_['keys'](db[_0xabbb('0x4e')]['rawAttributes']);_0x3fe720[_0xabbb('0x36')]=_['keys'](_0x6de080['query']);_0x3fe720[_0xabbb('0x55')]=_['intersection'](_0x3fe720[_0xabbb('0x34')],_0x3fe720[_0xabbb('0x36')]);_0x65cc0e[_0xabbb('0x38')]=_['intersection'](_0x3fe720[_0xabbb('0x34')],qs[_0xabbb('0x54')](_0x6de080['query'][_0xabbb('0x54')]));_0x65cc0e[_0xabbb('0x38')]=_0x65cc0e[_0xabbb('0x38')][_0xabbb('0x39')]?_0x65cc0e[_0xabbb('0x38')]:_0x3fe720[_0xabbb('0x34')];_0x65cc0e[_0xabbb('0x3c')]=qs[_0xabbb('0x3d')](_0x6de080[_0xabbb('0x36')][_0xabbb('0x3d')]);_0x65cc0e[_0xabbb('0x40')]=qs[_0xabbb('0x55')](_['pick'](_0x6de080[_0xabbb('0x36')],_0x3fe720[_0xabbb('0x55')]));if(_0x6de080[_0xabbb('0x36')][_0xabbb('0x3f')]){_0x65cc0e[_0xabbb('0x40')]=_[_0xabbb('0x41')](_0x65cc0e[_0xabbb('0x40')],{'$or':_['map'](_0x65cc0e[_0xabbb('0x38')],function(_0x1499d6){var _0x36235a={};_0x36235a[_0x1499d6]={'$like':'%'+_0x6de080[_0xabbb('0x36')][_0xabbb('0x3f')]+'%'};return _0x36235a;})});}if(_0x6de080[_0xabbb('0x36')][_0xabbb('0x5b')]){var _0x4c4dd9=_0x6de080[_0xabbb('0x36')][_0xabbb('0x5b')][_0xabbb('0x5c')](',');var _0x35362e={};_0x35362e[_0x4c4dd9[0x0]]={'$gte':moment(_0x4c4dd9[0x1])['format'](_0xabbb('0x5d'))};_0x65cc0e[_0xabbb('0x40')]=_['merge'](_0x65cc0e[_0xabbb('0x40')],_0x35362e);}_0x65cc0e=_[_0xabbb('0x41')]({},_0x65cc0e,_0x6de080[_0xabbb('0x43')]);return _0x8e598f[_0xabbb('0x59')](_0x65cc0e);}})[_0xabbb('0x2a')](function(_0x43a47b){if(_0x43a47b){_0x47cb86=_0x43a47b[_0xabbb('0x39')];if(!_0x6de080[_0xabbb('0x36')][_0xabbb('0x56')](_0xabbb('0x3a'))){_0x65cc0e[_0xabbb('0x3b')]=qs[_0xabbb('0x3b')](_0x6de080[_0xabbb('0x36')][_0xabbb('0x3b')]);_0x65cc0e[_0xabbb('0x21')]=qs[_0xabbb('0x21')](_0x6de080[_0xabbb('0x36')][_0xabbb('0x21')]);}return _0x8e598f[_0xabbb('0x59')](_0x65cc0e);}})['then'](function(_0x1b339e){if(_0x1b339e){return _0x1b339e?{'count':_0x47cb86,'rows':_0x1b339e}:null;}})[_0xabbb('0x2a')](respondWithResult(_0x2a5723,null))[_0xabbb('0x47')](handleError(_0x2a5723,null));};
\ No newline at end of file
+var _0x204a=['undefined','limit','count','set','Content-Range','apply','reject','save','update','then','destroy','error','stack','send','map','ChatGroup','rawAttributes','fieldName','type','key','model','name','query','keys','filters','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','VIRTUAL','merge','options','includeAll','include','findAll','show','params','find','catch','create','body','describe','getUnread','ChatInternalMessage','toInteger','addMembers','ids','omit','getMembers','findOne','User','removeMembers','addMessage','ChatGroupId','getMessages','$gte','format','zip-dir','fast-json-patch','request-promise','moment','bluebird','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','redis','defaults','localhost','socket.io-emitter','./chatGroup.socket','sendStatus','status','end','json','offset'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x204a,0x100));var _0xa204=function(_0x39364f,_0x16a94d){_0x39364f=_0x39364f-0x0;var _0x2725c8=_0x204a[_0x39364f];return _0x2725c8;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0xa204('0x0'));var jsonpatch=require(_0xa204('0x1'));var rp=require(_0xa204('0x2'));var moment=require(_0xa204('0x3'));var BPromise=require(_0xa204('0x4'));var Mustache=require('mustache');var util=require('util');var path=require('path');var sox=require(_0xa204('0x5'));var csv=require(_0xa204('0x6'));var ejs=require(_0xa204('0x7'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xa204('0x8'));var squel=require(_0xa204('0x9'));var crypto=require(_0xa204('0xa'));var jsforce=require(_0xa204('0xb'));var deskjs=require(_0xa204('0xc'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0xa204('0xd'));var Redis=require(_0xa204('0xe'));var authService=require(_0xa204('0xf'));var qs=require(_0xa204('0x10'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xa204('0x11'));var logger=require(_0xa204('0x12'))('api');var utils=require(_0xa204('0x13'));var config=require(_0xa204('0x14'));var licenseUtil=require(_0xa204('0x15'));var db=require('../../mysqldb')['db'];config[_0xa204('0x16')]=_[_0xa204('0x17')](config[_0xa204('0x16')],{'host':_0xa204('0x18'),'port':0x18eb});var socket=require(_0xa204('0x19'))(new Redis(config[_0xa204('0x16')]));require(_0xa204('0x1a'))['register'](socket);function respondWithStatusCode(_0x1bd94,_0x1e00d4){_0x1e00d4=_0x1e00d4||0xcc;return function(_0x28a03b){if(_0x28a03b){return _0x1bd94[_0xa204('0x1b')](_0x1e00d4);}return _0x1bd94[_0xa204('0x1c')](_0x1e00d4)[_0xa204('0x1d')]();};}function respondWithResult(_0x242a6a,_0x5da322){_0x5da322=_0x5da322||0xc8;return function(_0x1fe92d){if(_0x1fe92d){return _0x242a6a['status'](_0x5da322)[_0xa204('0x1e')](_0x1fe92d);}};}function respondWithFilteredResult(_0x9afb4f,_0x5ac79b){return function(_0x145bd9){if(_0x145bd9){var _0x3126db=typeof _0x5ac79b[_0xa204('0x1f')]===_0xa204('0x20')&&typeof _0x5ac79b[_0xa204('0x21')]===_0xa204('0x20');var _0x2625d3=_0x145bd9[_0xa204('0x22')];var _0x4cb6b1=_0x3126db?0x0:_0x5ac79b[_0xa204('0x1f')];var _0x280cc6=_0x3126db?_0x145bd9[_0xa204('0x22')]:_0x5ac79b[_0xa204('0x1f')]+_0x5ac79b[_0xa204('0x21')];var _0xf10f9c;if(_0x280cc6>=_0x2625d3){_0x280cc6=_0x2625d3;_0xf10f9c=0xc8;}else{_0xf10f9c=0xce;}_0x9afb4f[_0xa204('0x1c')](_0xf10f9c);return _0x9afb4f[_0xa204('0x23')](_0xa204('0x24'),_0x4cb6b1+'-'+_0x280cc6+'/'+_0x2625d3)['json'](_0x145bd9);}return null;};}function patchUpdates(_0x265402){return function(_0x3e75d9){try{jsonpatch[_0xa204('0x25')](_0x3e75d9,_0x265402,!![]);}catch(_0x51d5f7){return BPromise[_0xa204('0x26')](_0x51d5f7);}return _0x3e75d9[_0xa204('0x27')]();};}function saveUpdates(_0x5f1d65,_0x561800){return function(_0x417473){if(_0x417473){return _0x417473[_0xa204('0x28')](_0x5f1d65)[_0xa204('0x29')](function(_0x2e5ed3){return _0x2e5ed3;});}return null;};}function removeEntity(_0x4eea6c,_0x37daf6){return function(_0x459310){if(_0x459310){return _0x459310[_0xa204('0x2a')]()[_0xa204('0x29')](function(){_0x4eea6c[_0xa204('0x1c')](0xcc)[_0xa204('0x1d')]();});}};}function handleEntityNotFound(_0x2ced45,_0x122a39){return function(_0x4ac3ac){if(!_0x4ac3ac){_0x2ced45[_0xa204('0x1b')](0x194);}return _0x4ac3ac;};}function handleError(_0x9b4d9f,_0x5dd31b){_0x5dd31b=_0x5dd31b||0x1f4;return function(_0x4f764a){logger[_0xa204('0x2b')](_0x4f764a[_0xa204('0x2c')]);if(_0x4f764a['name']){delete _0x4f764a['name'];}_0x9b4d9f[_0xa204('0x1c')](_0x5dd31b)[_0xa204('0x2d')](_0x4f764a);};}exports['index']=function(_0x5b712c,_0x6c7b5e){var _0x20a775={},_0x4c0f98={},_0x48e8c7={'count':0x0,'rows':[]};var _0x54dc2f=_[_0xa204('0x2e')](db[_0xa204('0x2f')][_0xa204('0x30')],function(_0x463acd){return{'name':_0x463acd[_0xa204('0x31')],'type':_0x463acd[_0xa204('0x32')][_0xa204('0x33')]};});_0x4c0f98[_0xa204('0x34')]=_[_0xa204('0x2e')](_0x54dc2f,_0xa204('0x35'));_0x4c0f98[_0xa204('0x36')]=_[_0xa204('0x37')](_0x5b712c['query']);_0x4c0f98[_0xa204('0x38')]=_['intersection'](_0x4c0f98[_0xa204('0x34')],_0x4c0f98['query']);_0x20a775[_0xa204('0x39')]=_[_0xa204('0x3a')](_0x4c0f98[_0xa204('0x34')],qs[_0xa204('0x3b')](_0x5b712c[_0xa204('0x36')]['fields']));_0x20a775[_0xa204('0x39')]=_0x20a775[_0xa204('0x39')][_0xa204('0x3c')]?_0x20a775[_0xa204('0x39')]:_0x4c0f98['model'];if(!_0x5b712c[_0xa204('0x36')][_0xa204('0x3d')](_0xa204('0x3e'))){_0x20a775[_0xa204('0x21')]=qs[_0xa204('0x21')](_0x5b712c[_0xa204('0x36')]['limit']);_0x20a775[_0xa204('0x1f')]=qs[_0xa204('0x1f')](_0x5b712c[_0xa204('0x36')]['offset']);}_0x20a775[_0xa204('0x3f')]=qs[_0xa204('0x40')](_0x5b712c['query'][_0xa204('0x40')]);_0x20a775[_0xa204('0x41')]=qs[_0xa204('0x38')](_[_0xa204('0x42')](_0x5b712c[_0xa204('0x36')],_0x4c0f98[_0xa204('0x38')]),_0x54dc2f);if(_0x5b712c[_0xa204('0x36')][_0xa204('0x43')]){_0x20a775[_0xa204('0x41')]=_['merge'](_0x20a775[_0xa204('0x41')],{'$or':_[_0xa204('0x2e')](_0x54dc2f,function(_0x211d65){if(_0x211d65[_0xa204('0x32')]!==_0xa204('0x44')){var _0x469b4f={};_0x469b4f[_0x211d65[_0xa204('0x35')]]={'$like':'%'+_0x5b712c[_0xa204('0x36')]['filter']+'%'};return _0x469b4f;}})});}_0x20a775=_[_0xa204('0x45')]({},_0x20a775,_0x5b712c[_0xa204('0x46')]);var _0x4e24c1={'where':_0x20a775[_0xa204('0x41')]};return db[_0xa204('0x2f')]['count'](_0x4e24c1)[_0xa204('0x29')](function(_0x2d8d0d){_0x48e8c7[_0xa204('0x22')]=_0x2d8d0d;if(_0x5b712c['query'][_0xa204('0x47')]){_0x20a775[_0xa204('0x48')]=[{'all':!![]}];}return db['ChatGroup'][_0xa204('0x49')](_0x20a775);})[_0xa204('0x29')](function(_0x1f8a85){_0x48e8c7['rows']=_0x1f8a85;return _0x48e8c7;})['then'](respondWithFilteredResult(_0x6c7b5e,_0x20a775))['catch'](handleError(_0x6c7b5e,null));};exports[_0xa204('0x4a')]=function(_0x29765b,_0x268dd5){var _0x11bbcb={'raw':!![],'where':{'id':_0x29765b[_0xa204('0x4b')]['id']}},_0x1f298a={};_0x1f298a['model']=_['keys'](db[_0xa204('0x2f')][_0xa204('0x30')]);_0x1f298a[_0xa204('0x36')]=_['keys'](_0x29765b[_0xa204('0x36')]);_0x1f298a[_0xa204('0x38')]=_[_0xa204('0x3a')](_0x1f298a[_0xa204('0x34')],_0x1f298a[_0xa204('0x36')]);_0x11bbcb[_0xa204('0x39')]=_[_0xa204('0x3a')](_0x1f298a[_0xa204('0x34')],qs[_0xa204('0x3b')](_0x29765b[_0xa204('0x36')][_0xa204('0x3b')]));_0x11bbcb['attributes']=_0x11bbcb[_0xa204('0x39')][_0xa204('0x3c')]?_0x11bbcb[_0xa204('0x39')]:_0x1f298a[_0xa204('0x34')];if(_0x29765b['query']['includeAll']){_0x11bbcb['include']=[{'all':!![]}];}_0x11bbcb=_['merge']({},_0x11bbcb,_0x29765b[_0xa204('0x46')]);return db[_0xa204('0x2f')][_0xa204('0x4c')](_0x11bbcb)[_0xa204('0x29')](handleEntityNotFound(_0x268dd5,null))[_0xa204('0x29')](respondWithResult(_0x268dd5,null))[_0xa204('0x4d')](handleError(_0x268dd5,null));};exports[_0xa204('0x4e')]=function(_0xb1a3a0,_0x3f258a){return db['ChatGroup']['create'](_0xb1a3a0[_0xa204('0x4f')],{})[_0xa204('0x29')](respondWithResult(_0x3f258a,0xc9))[_0xa204('0x4d')](handleError(_0x3f258a,null));};exports[_0xa204('0x28')]=function(_0x165c5f,_0x3de32c){if(_0x165c5f[_0xa204('0x4f')]['id']){delete _0x165c5f['body']['id'];}return db[_0xa204('0x2f')]['find']({'where':{'id':_0x165c5f[_0xa204('0x4b')]['id']}})[_0xa204('0x29')](handleEntityNotFound(_0x3de32c,null))[_0xa204('0x29')](saveUpdates(_0x165c5f[_0xa204('0x4f')],null))[_0xa204('0x29')](respondWithResult(_0x3de32c,null))[_0xa204('0x4d')](handleError(_0x3de32c,null));};exports['destroy']=function(_0x5c2219,_0x28707f){return db[_0xa204('0x2f')]['find']({'where':{'id':_0x5c2219['params']['id']}})[_0xa204('0x29')](handleEntityNotFound(_0x28707f,null))['then'](removeEntity(_0x28707f,null))['catch'](handleError(_0x28707f,null));};exports[_0xa204('0x50')]=function(_0x1af238,_0x5d68fd){return db['ChatGroup'][_0xa204('0x50')]()['then'](respondWithResult(_0x5d68fd,null))[_0xa204('0x4d')](handleError(_0x5d68fd,null));};exports[_0xa204('0x51')]=function(_0x4b9d7a,_0x373367,_0xff10a8){return db[_0xa204('0x52')][_0xa204('0x22')]({'where':{'ChatGroupId':_0x4b9d7a['params']['id'],'ToId':_0x4b9d7a['user']['id'],'read':![]}})[_0xa204('0x29')](function(_0x2dafd5){return{'id':_[_0xa204('0x53')](_0x4b9d7a[_0xa204('0x4b')]['id']),'count':_0x2dafd5};})['then'](respondWithResult(_0x373367,null))[_0xa204('0x4d')](handleError(_0x373367,null));};exports[_0xa204('0x54')]=function(_0x683796,_0x243c5b,_0x4a70a4){return db[_0xa204('0x2f')]['find']({'where':{'id':_0x683796[_0xa204('0x4b')]['id']}})[_0xa204('0x29')](handleEntityNotFound(_0x243c5b,null))[_0xa204('0x29')](function(_0x18d731){if(_0x18d731){return _0x18d731['addMembers'](_0x683796['body'][_0xa204('0x55')],_[_0xa204('0x56')](_0x683796[_0xa204('0x4f')],[_0xa204('0x55'),'id'])||{});}})[_0xa204('0x29')](respondWithResult(_0x243c5b,null))[_0xa204('0x4d')](handleError(_0x243c5b,null));};exports[_0xa204('0x57')]=function(_0x3dd42c,_0x4142b6,_0x543bb0){var _0x236e48={};var _0x4cb59a={};var _0x533d76;var _0x2d44ee;return db[_0xa204('0x2f')][_0xa204('0x58')]({'where':{'id':_0x3dd42c[_0xa204('0x4b')]['id']}})[_0xa204('0x29')](handleEntityNotFound(_0x4142b6,null))['then'](function(_0x45a6a2){if(_0x45a6a2){_0x533d76=_0x45a6a2;_0x4cb59a[_0xa204('0x34')]=_[_0xa204('0x37')](db[_0xa204('0x59')][_0xa204('0x30')]);_0x4cb59a[_0xa204('0x36')]=_[_0xa204('0x37')](_0x3dd42c[_0xa204('0x36')]);_0x4cb59a[_0xa204('0x38')]=_[_0xa204('0x3a')](_0x4cb59a[_0xa204('0x34')],_0x4cb59a[_0xa204('0x36')]);_0x236e48[_0xa204('0x39')]=_[_0xa204('0x3a')](_0x4cb59a[_0xa204('0x34')],qs[_0xa204('0x3b')](_0x3dd42c[_0xa204('0x36')][_0xa204('0x3b')]));_0x236e48[_0xa204('0x39')]=_0x236e48[_0xa204('0x39')][_0xa204('0x3c')]?_0x236e48[_0xa204('0x39')]:_0x4cb59a[_0xa204('0x34')];_0x236e48[_0xa204('0x3f')]=qs[_0xa204('0x40')](_0x3dd42c[_0xa204('0x36')][_0xa204('0x40')]);_0x236e48['where']=qs[_0xa204('0x38')](_['pick'](_0x3dd42c['query'],_0x4cb59a['filters']));if(_0x3dd42c[_0xa204('0x36')][_0xa204('0x43')]){_0x236e48['where']=_[_0xa204('0x45')](_0x236e48[_0xa204('0x41')],{'$or':_[_0xa204('0x2e')](_0x236e48[_0xa204('0x39')],function(_0xa27ddb){var _0x504621={};_0x504621[_0xa27ddb]={'$like':'%'+_0x3dd42c['query'][_0xa204('0x43')]+'%'};return _0x504621;})});}_0x236e48=_['merge']({},_0x236e48,_0x3dd42c[_0xa204('0x46')]);return _0x533d76[_0xa204('0x57')](_0x236e48);}})[_0xa204('0x29')](function(_0x24565a){if(_0x24565a){_0x2d44ee=_0x24565a[_0xa204('0x3c')];if(!_0x3dd42c[_0xa204('0x36')][_0xa204('0x3d')](_0xa204('0x3e'))){_0x236e48['limit']=qs[_0xa204('0x21')](_0x3dd42c['query'][_0xa204('0x21')]);_0x236e48[_0xa204('0x1f')]=qs[_0xa204('0x1f')](_0x3dd42c[_0xa204('0x36')][_0xa204('0x1f')]);}return _0x533d76[_0xa204('0x57')](_0x236e48);}})[_0xa204('0x29')](function(_0x55192e){if(_0x55192e){return _0x55192e?{'count':_0x2d44ee,'rows':_0x55192e}:null;}})[_0xa204('0x29')](respondWithResult(_0x4142b6,null))[_0xa204('0x4d')](handleError(_0x4142b6,null));};exports[_0xa204('0x5a')]=function(_0x31fa06,_0x381c24,_0x8bd0f7){return db['ChatGroup']['find']({'where':{'id':_0x31fa06['params']['id']}})[_0xa204('0x29')](handleEntityNotFound(_0x381c24,null))[_0xa204('0x29')](function(_0x2adc1b){if(_0x2adc1b){return _0x2adc1b[_0xa204('0x5a')](_0x31fa06[_0xa204('0x36')]['ids']);}})[_0xa204('0x29')](respondWithStatusCode(_0x381c24,null))['catch'](handleError(_0x381c24,null));};exports[_0xa204('0x5b')]=function(_0xfc4ba1,_0x56b858,_0x4b93e2){if(_0xfc4ba1['body']['id']){delete _0xfc4ba1[_0xa204('0x4f')]['id'];}return db['ChatGroup']['find']({'where':{'id':_0xfc4ba1[_0xa204('0x4b')]['id']}})[_0xa204('0x29')](handleEntityNotFound(_0x56b858,null))[_0xa204('0x29')](function(_0x30a933){if(_0x30a933){_0xfc4ba1['body'][_0xa204('0x5c')]=_0x30a933['id'];return db[_0xa204('0x52')][_0xa204('0x4e')](_0xfc4ba1['body']);}})['then'](respondWithResult(_0x56b858,null))[_0xa204('0x4d')](handleError(_0x56b858,null));};exports[_0xa204('0x5d')]=function(_0x3d3a03,_0x4fa12f,_0x211edd){var _0x3dae31={};var _0x3a0e92={};var _0xa8b1bc;var _0x186f90;return db[_0xa204('0x2f')]['findOne']({'where':{'id':_0x3d3a03[_0xa204('0x4b')]['id']}})[_0xa204('0x29')](handleEntityNotFound(_0x4fa12f,null))['then'](function(_0x3a9292){if(_0x3a9292){_0xa8b1bc=_0x3a9292;_0x3a0e92[_0xa204('0x34')]=_[_0xa204('0x37')](db[_0xa204('0x52')][_0xa204('0x30')]);_0x3a0e92[_0xa204('0x36')]=_[_0xa204('0x37')](_0x3d3a03[_0xa204('0x36')]);_0x3a0e92[_0xa204('0x38')]=_[_0xa204('0x3a')](_0x3a0e92[_0xa204('0x34')],_0x3a0e92[_0xa204('0x36')]);_0x3dae31[_0xa204('0x39')]=_[_0xa204('0x3a')](_0x3a0e92[_0xa204('0x34')],qs['fields'](_0x3d3a03['query'][_0xa204('0x3b')]));_0x3dae31[_0xa204('0x39')]=_0x3dae31[_0xa204('0x39')]['length']?_0x3dae31[_0xa204('0x39')]:_0x3a0e92['model'];_0x3dae31[_0xa204('0x3f')]=qs[_0xa204('0x40')](_0x3d3a03[_0xa204('0x36')]['sort']);_0x3dae31[_0xa204('0x41')]=qs[_0xa204('0x38')](_[_0xa204('0x42')](_0x3d3a03['query'],_0x3a0e92['filters']));if(_0x3d3a03['query']['filter']){_0x3dae31['where']=_['merge'](_0x3dae31[_0xa204('0x41')],{'$or':_[_0xa204('0x2e')](_0x3dae31['attributes'],function(_0x1a3668){var _0x324ca7={};_0x324ca7[_0x1a3668]={'$like':'%'+_0x3d3a03[_0xa204('0x36')]['filter']+'%'};return _0x324ca7;})});}if(_0x3d3a03[_0xa204('0x36')][_0xa204('0x5e')]){var _0x2b9bc8=_0x3d3a03[_0xa204('0x36')][_0xa204('0x5e')]['split'](',');var _0x39ce1b={};_0x39ce1b[_0x2b9bc8[0x0]]={'$gte':moment(_0x2b9bc8[0x1])[_0xa204('0x5f')]('YYYY-MM-DD\x20HH:mm:ss')};_0x3dae31[_0xa204('0x41')]=_[_0xa204('0x45')](_0x3dae31['where'],_0x39ce1b);}_0x3dae31=_['merge']({},_0x3dae31,_0x3d3a03[_0xa204('0x46')]);return _0xa8b1bc['getMessages'](_0x3dae31);}})[_0xa204('0x29')](function(_0x204874){if(_0x204874){_0x186f90=_0x204874[_0xa204('0x3c')];if(!_0x3d3a03[_0xa204('0x36')][_0xa204('0x3d')]('nolimit')){_0x3dae31['limit']=qs[_0xa204('0x21')](_0x3d3a03[_0xa204('0x36')][_0xa204('0x21')]);_0x3dae31[_0xa204('0x1f')]=qs[_0xa204('0x1f')](_0x3d3a03[_0xa204('0x36')]['offset']);}return _0xa8b1bc['getMessages'](_0x3dae31);}})['then'](function(_0x22a143){if(_0x22a143){return _0x22a143?{'count':_0x186f90,'rows':_0x22a143}:null;}})[_0xa204('0x29')](respondWithResult(_0x4fa12f,null))[_0xa204('0x4d')](handleError(_0x4fa12f,null));};
\ No newline at end of file
diff --git a/server/api/chatGroup/chatGroup.events.js b/server/api/chatGroup/chatGroup.events.js
index 8b17a4c..e7c12d4 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 _0xef96=['emit','hasOwnProperty','exports','events','../../mysqldb','ChatGroup','setMaxListeners','save','update'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0xef96,0x162));var _0x6ef9=function(_0x208b03,_0x82774f){_0x208b03=_0x208b03-0x0;var _0x332d98=_0xef96[_0x208b03];return _0x332d98;};'use strict';var EventEmitter=require(_0x6ef9('0x0'));var ChatGroup=require(_0x6ef9('0x1'))['db'][_0x6ef9('0x2')];var ChatGroupEvents=new EventEmitter();ChatGroupEvents[_0x6ef9('0x3')](0x0);var events={'afterCreate':_0x6ef9('0x4'),'afterUpdate':_0x6ef9('0x5'),'afterDestroy':'remove'};function emitEvent(_0x55b811){return function(_0x1eb2c2,_0x5391ed,_0x500b0c){ChatGroupEvents[_0x6ef9('0x6')](_0x55b811+':'+_0x1eb2c2['id'],_0x1eb2c2);ChatGroupEvents[_0x6ef9('0x6')](_0x55b811,_0x1eb2c2);_0x500b0c(null);};}for(var e in events){if(events[_0x6ef9('0x7')](e)){var event=events[e];ChatGroup['hook'](e,emitEvent(event));}}module[_0x6ef9('0x8')]=ChatGroupEvents;
\ No newline at end of file
+var _0xede6=['update','remove','emit','hook','exports','../../mysqldb','ChatGroup','setMaxListeners','save'];(function(_0x4f4ea8,_0x6a0f4c){var _0x573a6c=function(_0x53104d){while(--_0x53104d){_0x4f4ea8['push'](_0x4f4ea8['shift']());}};_0x573a6c(++_0x6a0f4c);}(_0xede6,0x10a));var _0x6ede=function(_0x37c22c,_0x28a70d){_0x37c22c=_0x37c22c-0x0;var _0x119d79=_0xede6[_0x37c22c];return _0x119d79;};'use strict';var EventEmitter=require('events');var ChatGroup=require(_0x6ede('0x0'))['db'][_0x6ede('0x1')];var ChatGroupEvents=new EventEmitter();ChatGroupEvents[_0x6ede('0x2')](0x0);var events={'afterCreate':_0x6ede('0x3'),'afterUpdate':_0x6ede('0x4'),'afterDestroy':_0x6ede('0x5')};function emitEvent(_0x147fbe){return function(_0x226cef,_0x306b56,_0x22c6cd){ChatGroupEvents[_0x6ede('0x6')](_0x147fbe+':'+_0x226cef['id'],_0x226cef);ChatGroupEvents[_0x6ede('0x6')](_0x147fbe,_0x226cef);_0x22c6cd(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];ChatGroup[_0x6ede('0x7')](e,emitEvent(event));}}module[_0x6ede('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 249619c..645d428 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 _0x8d34=['util','../../config/logger','api','request-promise','path','rimraf','../../config/environment','define','chat_groups','lodash'];(function(_0x121b1a,_0x42fdb7){var _0x2d89a6=function(_0x1b6027){while(--_0x1b6027){_0x121b1a['push'](_0x121b1a['shift']());}};_0x2d89a6(++_0x42fdb7);}(_0x8d34,0x6d));var _0x48d3=function(_0x451353,_0x19710b){_0x451353=_0x451353-0x0;var _0x102315=_0x8d34[_0x451353];return _0x102315;};'use strict';var _=require(_0x48d3('0x0'));var util=require(_0x48d3('0x1'));var logger=require(_0x48d3('0x2'))(_0x48d3('0x3'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x48d3('0x4'));var fs=require('fs');var path=require(_0x48d3('0x5'));var rimraf=require(_0x48d3('0x6'));var config=require(_0x48d3('0x7'));var attributes=require('./chatGroup.attributes');module['exports']=function(_0x1b6607,_0x128537){return _0x1b6607[_0x48d3('0x8')]('ChatGroup',attributes,{'tableName':_0x48d3('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x3454=['util','../../config/logger','api','bluebird','request-promise','path','rimraf','../../config/environment','./chatGroup.attributes','exports','define','chat_groups'];(function(_0x38eb42,_0x46ae11){var _0x44a86f=function(_0x42c1d5){while(--_0x42c1d5){_0x38eb42['push'](_0x38eb42['shift']());}};_0x44a86f(++_0x46ae11);}(_0x3454,0x144));var _0x4345=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x3454[_0x14add3];return _0x4a174f;};'use strict';var _=require('lodash');var util=require(_0x4345('0x0'));var logger=require(_0x4345('0x1'))(_0x4345('0x2'));var moment=require('moment');var BPromise=require(_0x4345('0x3'));var rp=require(_0x4345('0x4'));var fs=require('fs');var path=require(_0x4345('0x5'));var rimraf=require(_0x4345('0x6'));var config=require(_0x4345('0x7'));var attributes=require(_0x4345('0x8'));module[_0x4345('0x9')]=function(_0x1d091a,_0x9e3be7){return _0x1d091a[_0x4345('0xa')]('ChatGroup',attributes,{'tableName':_0x4345('0xb'),'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 2e29ddf..e540d0f 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 _0x31e7=['ChatGroup,\x20%s,\x20%s','request\x20sent','debug','ChatGroup,\x20%s,\x20%s,\x20%s','error','message','result','catch','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','defaults','redis','localhost','socket.io-emitter','./chatGroup.socket','register','request','then','info'];(function(_0x9ceba5,_0x303b5a){var _0x4c4071=function(_0x47739a){while(--_0x47739a){_0x9ceba5['push'](_0x9ceba5['shift']());}};_0x4c4071(++_0x303b5a);}(_0x31e7,0x74));var _0x731e=function(_0x409f0c,_0x14ca22){_0x409f0c=_0x409f0c-0x0;var _0x20fc6d=_0x31e7[_0x409f0c];return _0x20fc6d;};'use strict';var _=require('lodash');var util=require(_0x731e('0x0'));var moment=require('moment');var BPromise=require(_0x731e('0x1'));var rs=require(_0x731e('0x2'));var fs=require('fs');var Redis=require(_0x731e('0x3'));var db=require(_0x731e('0x4'))['db'];var utils=require(_0x731e('0x5'));var logger=require(_0x731e('0x6'))(_0x731e('0x7'));var config=require(_0x731e('0x8'));var jayson=require('jayson/promise');var client=jayson[_0x731e('0x9')]['http']({'port':0x232a});config['redis']=_[_0x731e('0xa')](config[_0x731e('0xb')],{'host':_0x731e('0xc'),'port':0x18eb});var socket=require(_0x731e('0xd'))(new Redis(config[_0x731e('0xb')]));require(_0x731e('0xe'))[_0x731e('0xf')](socket);function respondWithRpcPromise(_0x5ed856,_0x56896a,_0x4e5784){return new BPromise(function(_0x3b4e6f,_0x1966c9){return client[_0x731e('0x10')](_0x5ed856,_0x4e5784)[_0x731e('0x11')](function(_0x2db10e){logger[_0x731e('0x12')](_0x731e('0x13'),_0x56896a,_0x731e('0x14'));logger[_0x731e('0x15')](_0x731e('0x16'),_0x56896a,_0x731e('0x14'),JSON['stringify'](_0x2db10e));if(_0x2db10e[_0x731e('0x17')]){if(_0x2db10e[_0x731e('0x17')]['code']===0x1f4){logger['error']('ChatGroup,\x20%s,\x20%s',_0x56896a,_0x2db10e[_0x731e('0x17')][_0x731e('0x18')]);return _0x1966c9(_0x2db10e[_0x731e('0x17')][_0x731e('0x18')]);}logger[_0x731e('0x17')](_0x731e('0x13'),_0x56896a,_0x2db10e[_0x731e('0x17')][_0x731e('0x18')]);return _0x3b4e6f(_0x2db10e['error'][_0x731e('0x18')]);}else{logger[_0x731e('0x12')](_0x731e('0x13'),_0x56896a,'request\x20sent');_0x3b4e6f(_0x2db10e[_0x731e('0x19')]['message']);}})[_0x731e('0x1a')](function(_0x1a3ab9){logger['error'](_0x731e('0x13'),_0x56896a,_0x1a3ab9);_0x1966c9(_0x1a3ab9);});});}
\ No newline at end of file
+var _0xac5c=['register','request','then','info','ChatGroup,\x20%s,\x20%s','debug','stringify','error','code','message','request\x20sent','lodash','util','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','defaults','redis','socket.io-emitter','./chatGroup.socket'];(function(_0xff855,_0x2dc5e2){var _0x4a7d45=function(_0xf207a0){while(--_0xf207a0){_0xff855['push'](_0xff855['shift']());}};_0x4a7d45(++_0x2dc5e2);}(_0xac5c,0x10f));var _0xcac5=function(_0x1c95e2,_0x75edfa){_0x1c95e2=_0x1c95e2-0x0;var _0x50cb45=_0xac5c[_0x1c95e2];return _0x50cb45;};'use strict';var _=require(_0xcac5('0x0'));var util=require(_0xcac5('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0xcac5('0x2'));var fs=require('fs');var Redis=require(_0xcac5('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0xcac5('0x4'));var logger=require(_0xcac5('0x5'))(_0xcac5('0x6'));var config=require(_0xcac5('0x7'));var jayson=require(_0xcac5('0x8'));var client=jayson[_0xcac5('0x9')][_0xcac5('0xa')]({'port':0x232a});config['redis']=_[_0xcac5('0xb')](config[_0xcac5('0xc')],{'host':'localhost','port':0x18eb});var socket=require(_0xcac5('0xd'))(new Redis(config[_0xcac5('0xc')]));require(_0xcac5('0xe'))[_0xcac5('0xf')](socket);function respondWithRpcPromise(_0x2366e0,_0x4a3746,_0x33ceb1){return new BPromise(function(_0x18f165,_0x43c506){return client[_0xcac5('0x10')](_0x2366e0,_0x33ceb1)[_0xcac5('0x11')](function(_0x58a4c5){logger[_0xcac5('0x12')](_0xcac5('0x13'),_0x4a3746,'request\x20sent');logger[_0xcac5('0x14')]('ChatGroup,\x20%s,\x20%s,\x20%s',_0x4a3746,'request\x20sent',JSON[_0xcac5('0x15')](_0x58a4c5));if(_0x58a4c5[_0xcac5('0x16')]){if(_0x58a4c5[_0xcac5('0x16')][_0xcac5('0x17')]===0x1f4){logger['error']('ChatGroup,\x20%s,\x20%s',_0x4a3746,_0x58a4c5[_0xcac5('0x16')]['message']);return _0x43c506(_0x58a4c5[_0xcac5('0x16')][_0xcac5('0x18')]);}logger[_0xcac5('0x16')]('ChatGroup,\x20%s,\x20%s',_0x4a3746,_0x58a4c5[_0xcac5('0x16')]['message']);return _0x18f165(_0x58a4c5[_0xcac5('0x16')][_0xcac5('0x18')]);}else{logger[_0xcac5('0x12')]('ChatGroup,\x20%s,\x20%s',_0x4a3746,_0xcac5('0x19'));_0x18f165(_0x58a4c5['result']['message']);}})['catch'](function(_0x37136e){logger[_0xcac5('0x16')](_0xcac5('0x13'),_0x4a3746,_0x37136e);_0x43c506(_0x37136e);});});}
\ No newline at end of file
diff --git a/server/api/chatGroup/chatGroup.socket.js b/server/api/chatGroup/chatGroup.socket.js
index c179b4a..e5176c7 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 _0xb0c7=['length','chatGroup:','./chatGroup.events','save','update','emit','removeListener','register'];(function(_0x5a80a4,_0x654934){var _0x2b311a=function(_0xf8b990){while(--_0xf8b990){_0x5a80a4['push'](_0x5a80a4['shift']());}};_0x2b311a(++_0x654934);}(_0xb0c7,0xca));var _0x7b0c=function(_0x481bdf,_0x231538){_0x481bdf=_0x481bdf-0x0;var _0x281a12=_0xb0c7[_0x481bdf];return _0x281a12;};'use strict';var ChatGroupEvents=require(_0x7b0c('0x0'));var events=[_0x7b0c('0x1'),'remove',_0x7b0c('0x2')];function createListener(_0x302a70,_0x4052e4){return function(_0x151105){_0x4052e4[_0x7b0c('0x3')](_0x302a70,_0x151105);};}function removeListener(_0x1fa30a,_0x349fa5){return function(){ChatGroupEvents[_0x7b0c('0x4')](_0x1fa30a,_0x349fa5);};}exports[_0x7b0c('0x5')]=function(_0x3e8959){for(var _0x2fbd90=0x0,_0x4bb343=events[_0x7b0c('0x6')];_0x2fbd90<_0x4bb343;_0x2fbd90++){var _0x11569e=events[_0x2fbd90];var _0x295842=createListener(_0x7b0c('0x7')+_0x11569e,_0x3e8959);ChatGroupEvents['on'](_0x11569e,_0x295842);}};
\ No newline at end of file
+var _0x9c0c=['save','remove','update','emit','removeListener','length','chatGroup:'];(function(_0x14be9e,_0x44e984){var _0x11fd99=function(_0x26cd70){while(--_0x26cd70){_0x14be9e['push'](_0x14be9e['shift']());}};_0x11fd99(++_0x44e984);}(_0x9c0c,0x8c));var _0xc9c0=function(_0x54ccd7,_0x3bc3ce){_0x54ccd7=_0x54ccd7-0x0;var _0x4e667b=_0x9c0c[_0x54ccd7];return _0x4e667b;};'use strict';var ChatGroupEvents=require('./chatGroup.events');var events=[_0xc9c0('0x0'),_0xc9c0('0x1'),_0xc9c0('0x2')];function createListener(_0x361b75,_0x1ff62e){return function(_0x5998ac){_0x1ff62e[_0xc9c0('0x3')](_0x361b75,_0x5998ac);};}function removeListener(_0x80349,_0xfb0afd){return function(){ChatGroupEvents[_0xc9c0('0x4')](_0x80349,_0xfb0afd);};}exports['register']=function(_0x453a8a){for(var _0x4ea789=0x0,_0x81826d=events[_0xc9c0('0x5')];_0x4ea789<_0x81826d;_0x4ea789++){var _0x3b7c74=events[_0x4ea789];var _0x1a2963=createListener(_0xc9c0('0x6')+_0x3b7c74,_0x453a8a);ChatGroupEvents['on'](_0x3b7c74,_0x1a2963);}};
\ No newline at end of file
diff --git a/server/api/chatGroup/index.js b/server/api/chatGroup/index.js
index 5ea875a..85c18e0 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 _0x63c2=['./chatGroup.controller','get','isAuthenticated','index','/describe','describe','/:id','show','/:id/unread','/:id/members','getMembers','/:id/messages','getMessages','post','create','addMembers','put','update','delete','exports','connect-timeout','express','Router','fs-extra','../../config/environment'];(function(_0x416b32,_0x569f90){var _0x3bf318=function(_0x124310){while(--_0x124310){_0x416b32['push'](_0x416b32['shift']());}};_0x3bf318(++_0x569f90);}(_0x63c2,0xf5));var _0x263c=function(_0x122096,_0x60c295){_0x122096=_0x122096-0x0;var _0x3d1966=_0x63c2[_0x122096];return _0x3d1966;};'use strict';var multer=require('multer');var util=require('util');var path=require('path');var timeout=require(_0x263c('0x0'));var express=require(_0x263c('0x1'));var router=express[_0x263c('0x2')]();var fs_extra=require(_0x263c('0x3'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x263c('0x4'));var controller=require(_0x263c('0x5'));router[_0x263c('0x6')]('/',auth[_0x263c('0x7')](),controller[_0x263c('0x8')]);router['get'](_0x263c('0x9'),auth['isAuthenticated'](),controller[_0x263c('0xa')]);router[_0x263c('0x6')](_0x263c('0xb'),auth[_0x263c('0x7')](),controller[_0x263c('0xc')]);router['get'](_0x263c('0xd'),auth[_0x263c('0x7')](),controller['getUnread']);router[_0x263c('0x6')](_0x263c('0xe'),auth[_0x263c('0x7')](),controller[_0x263c('0xf')]);router[_0x263c('0x6')](_0x263c('0x10'),auth[_0x263c('0x7')](),controller[_0x263c('0x11')]);router[_0x263c('0x12')]('/',auth[_0x263c('0x7')](),controller[_0x263c('0x13')]);router[_0x263c('0x12')](_0x263c('0xe'),auth['isAuthenticated'](),controller[_0x263c('0x14')]);router[_0x263c('0x12')](_0x263c('0x10'),auth['isAuthenticated'](),controller['addMessage']);router[_0x263c('0x15')](_0x263c('0xb'),auth[_0x263c('0x7')](),controller[_0x263c('0x16')]);router['delete'](_0x263c('0xb'),auth['isAuthenticated'](),controller['destroy']);router[_0x263c('0x17')](_0x263c('0xe'),auth[_0x263c('0x7')](),controller['removeMembers']);module[_0x263c('0x18')]=router;
\ No newline at end of file
+var _0x55a4=['describe','/:id','/:id/unread','getUnread','/:id/members','getMessages','post','create','/:id/messages','put','delete','destroy','removeMembers','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment','get','isAuthenticated','/describe'];(function(_0x2a2f87,_0x24b69f){var _0x652089=function(_0x75e52d){while(--_0x75e52d){_0x2a2f87['push'](_0x2a2f87['shift']());}};_0x652089(++_0x24b69f);}(_0x55a4,0x19d));var _0x455a=function(_0x2ed03b,_0x93378f){_0x2ed03b=_0x2ed03b-0x0;var _0x2646bc=_0x55a4[_0x2ed03b];return _0x2646bc;};'use strict';var multer=require(_0x455a('0x0'));var util=require(_0x455a('0x1'));var path=require(_0x455a('0x2'));var timeout=require(_0x455a('0x3'));var express=require(_0x455a('0x4'));var router=express[_0x455a('0x5')]();var fs_extra=require(_0x455a('0x6'));var auth=require(_0x455a('0x7'));var interaction=require('../../components/interaction/service');var config=require(_0x455a('0x8'));var controller=require('./chatGroup.controller');router[_0x455a('0x9')]('/',auth[_0x455a('0xa')](),controller['index']);router[_0x455a('0x9')](_0x455a('0xb'),auth['isAuthenticated'](),controller[_0x455a('0xc')]);router['get'](_0x455a('0xd'),auth['isAuthenticated'](),controller['show']);router['get'](_0x455a('0xe'),auth['isAuthenticated'](),controller[_0x455a('0xf')]);router[_0x455a('0x9')](_0x455a('0x10'),auth[_0x455a('0xa')](),controller['getMembers']);router['get']('/:id/messages',auth['isAuthenticated'](),controller[_0x455a('0x11')]);router[_0x455a('0x12')]('/',auth['isAuthenticated'](),controller[_0x455a('0x13')]);router['post']('/:id/members',auth['isAuthenticated'](),controller['addMembers']);router[_0x455a('0x12')](_0x455a('0x14'),auth[_0x455a('0xa')](),controller['addMessage']);router[_0x455a('0x15')](_0x455a('0xd'),auth['isAuthenticated'](),controller['update']);router[_0x455a('0x16')](_0x455a('0xd'),auth[_0x455a('0xa')](),controller[_0x455a('0x17')]);router[_0x455a('0x16')](_0x455a('0x10'),auth[_0x455a('0xa')](),controller[_0x455a('0x18')]);module['exports']=router;
\ No newline at end of file
diff --git a/server/api/chatInteraction/chatInteraction.attributes.js b/server/api/chatInteraction/chatInteraction.attributes.js
index 3a9f652..d63aeb2 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 _0x9fac=['BOOLEAN','sequelize','exports','INTEGER','ENUM','star','thumb','STRING','DATE','TEXT','out'];(function(_0x511dd6,_0x5d294d){var _0x39f16b=function(_0x150692){while(--_0x150692){_0x511dd6['push'](_0x511dd6['shift']());}};_0x39f16b(++_0x5d294d);}(_0x9fac,0x109));var _0xc9fa=function(_0x4c79e6,_0x208f40){_0x4c79e6=_0x4c79e6-0x0;var _0x29715b=_0x9fac[_0x4c79e6];return _0x29715b;};'use strict';var Sequelize=require(_0xc9fa('0x0'));module[_0xc9fa('0x1')]={'closed':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'ratingValue':{'type':Sequelize[_0xc9fa('0x2')]},'ratingType':{'type':Sequelize[_0xc9fa('0x3')](_0xc9fa('0x4'),_0xc9fa('0x5')),'defaultValue':_0xc9fa('0x4')},'ratingMessage':{'type':Sequelize['TEXT']},'pathTranscript':{'type':Sequelize['TEXT']},'mailTranscript':{'type':Sequelize[_0xc9fa('0x6')],'validate':{'isEmail':!![]}},'closedAt':{'type':Sequelize[_0xc9fa('0x7')]},'disposition':{'type':Sequelize[_0xc9fa('0x6')]},'secondDisposition':{'type':Sequelize['STRING']},'thirdDisposition':{'type':Sequelize['STRING']},'note':{'type':Sequelize[_0xc9fa('0x6')]},'browserName':{'type':Sequelize[_0xc9fa('0x6')]},'browserVersion':{'type':Sequelize[_0xc9fa('0x6')]},'osName':{'type':Sequelize[_0xc9fa('0x6')]},'osVersion':{'type':Sequelize[_0xc9fa('0x6')]},'deviceModel':{'type':Sequelize['STRING']},'deviceVendor':{'type':Sequelize[_0xc9fa('0x6')]},'deviceType':{'type':Sequelize['STRING']},'referer':{'type':Sequelize[_0xc9fa('0x8')]},'customerIp':{'type':Sequelize[_0xc9fa('0x6')]},'formData':{'type':Sequelize[_0xc9fa('0x8')]('long')},'read1stAt':{'type':Sequelize[_0xc9fa('0x7')]},'lastMsgAt':{'type':Sequelize[_0xc9fa('0x7')]},'lastMsgDirection':{'type':Sequelize['ENUM']('in',_0xc9fa('0x9')),'defaultValue':'in','allowNull':![]},'closeReason':{'type':Sequelize[_0xc9fa('0x6')]},'customerPort':{'type':Sequelize[_0xc9fa('0x6')]},'vidaooSessionId':{'type':Sequelize[_0xc9fa('0x8')]},'autoreplyExecuted':{'type':Sequelize[_0xc9fa('0xa')],'defaultValue':![]},'queueId':{'type':Sequelize[_0xc9fa('0x2')]}};
\ No newline at end of file
+var _0x99ec=['BOOLEAN','INTEGER','ENUM','thumb','star','STRING','DATE','TEXT','long','exports'];(function(_0x4ff524,_0x3bb234){var _0x2e0f9f=function(_0x29e675){while(--_0x29e675){_0x4ff524['push'](_0x4ff524['shift']());}};_0x2e0f9f(++_0x3bb234);}(_0x99ec,0x171));var _0xc99e=function(_0x5101b8,_0xe57d1d){_0x5101b8=_0x5101b8-0x0;var _0x4644e0=_0x99ec[_0x5101b8];return _0x4644e0;};'use strict';var Sequelize=require('sequelize');module[_0xc99e('0x0')]={'closed':{'type':Sequelize[_0xc99e('0x1')],'defaultValue':![]},'ratingValue':{'type':Sequelize[_0xc99e('0x2')]},'ratingType':{'type':Sequelize[_0xc99e('0x3')]('star',_0xc99e('0x4')),'defaultValue':_0xc99e('0x5')},'ratingMessage':{'type':Sequelize['TEXT']},'pathTranscript':{'type':Sequelize['TEXT']},'mailTranscript':{'type':Sequelize[_0xc99e('0x6')],'validate':{'isEmail':!![]}},'closedAt':{'type':Sequelize[_0xc99e('0x7')]},'disposition':{'type':Sequelize[_0xc99e('0x6')]},'secondDisposition':{'type':Sequelize[_0xc99e('0x6')]},'thirdDisposition':{'type':Sequelize[_0xc99e('0x6')]},'note':{'type':Sequelize[_0xc99e('0x6')]},'browserName':{'type':Sequelize[_0xc99e('0x6')]},'browserVersion':{'type':Sequelize[_0xc99e('0x6')]},'osName':{'type':Sequelize[_0xc99e('0x6')]},'osVersion':{'type':Sequelize[_0xc99e('0x6')]},'deviceModel':{'type':Sequelize[_0xc99e('0x6')]},'deviceVendor':{'type':Sequelize[_0xc99e('0x6')]},'deviceType':{'type':Sequelize[_0xc99e('0x6')]},'referer':{'type':Sequelize[_0xc99e('0x8')]},'customerIp':{'type':Sequelize[_0xc99e('0x6')]},'formData':{'type':Sequelize[_0xc99e('0x8')](_0xc99e('0x9'))},'read1stAt':{'type':Sequelize[_0xc99e('0x7')]},'lastMsgAt':{'type':Sequelize[_0xc99e('0x7')]},'lastMsgDirection':{'type':Sequelize['ENUM']('in','out'),'defaultValue':'in','allowNull':![]},'closeReason':{'type':Sequelize['STRING']},'customerPort':{'type':Sequelize['STRING']},'vidaooSessionId':{'type':Sequelize[_0xc99e('0x8')]},'autoreplyExecuted':{'type':Sequelize[_0xc99e('0x1')],'defaultValue':![]},'queueId':{'type':Sequelize[_0xc99e('0x2')]}};
\ No newline at end of file
diff --git a/server/api/chatInteraction/chatInteraction.controller.js b/server/api/chatInteraction/chatInteraction.controller.js
index eef641d..92dcaa6 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 _0xbecb=['downloadInteraction.ejs','createPdfFromHTML','rimraf','request-promise','bluebird','mustache','util','path','ejs','lodash','ioredis','../../components/interaction/service','../../components/export/pdf','../../config/logger','api','../../config/environment','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./chatInteraction.socket','jayson/promise','client','http','then','ChatInteraction,\x20%s,\x20%s','debug','request\x20sent','stringify','error','code','message','info','result','catch','status','end','json','offset','undefined','count','set','destroy','stack','name','send','render','merge','body','contact','agent','interaction','account','index','map','ChatInteraction','rawAttributes','fieldName','key','chat','query','user','show','model','keys','filters','intersection','attributes','fields','length','includeAll','include','find','create','params','createVidaooSession','findOne','ChatWebsiteId','vidaooEscalation','vidaooTopic','vidaooNote','email','POST','https://api-vidaoo.xcally.com/api/v1/meetings','vidaooApiKey','isNull','follow','vidaooMetadata','parse','Sequelize','ValidationError','Error\x20in\x20Vidaoo\x20configuration','join_url','ChatMessage','Unable\x20to\x20create\x20Vidaoo\x20session','updateAttributes','Contact','abandon','entity\x20not\x20found','sendStatus','UserId','update','closed','disposition','attachmentUpload','originalname','basename','file','filename','type','mimetype','Attachment','attachId','ChatOfflineMessageId','join','root','server/files/attachments/','offline-chat/','download','close','mailTranscript','server/files/chat/upload/','format','transcript-%s.txt','now','pathTranscript','Messages','User','ChatWebsite','CmContact','ContactId','%s%d','agentAlias','System','customer','Visitor','alias','fullname','agent_fullname','[%s]\x20%s:\x20%s\x0a','createdAt','MM/DD/YYYY\x20HH:mm:ss','direction','secret','appendFileSync','MailAccount','Smtp','CloudProvider','getSmtpOptions','SendMail','\x22%s\x22\x20<%s>','Mail\x20Transcript','Hi\x20%s,\x20attached\x20you\x20can\x20find\x20your\x20transcript\x20file.\x20\x0a\x0aRegards.\x20\x0a\x0a','addMessage','ids','omit','getMessages','hasOwnProperty','nolimit','limit','sort','where','ChatInteractionId','filter','$gte','split','YYYY-MM-DD\x20HH:mm:ss','findAll','rows','getMyMessages','pick','options','includeAgent','push','addTags','setTags','spread','color','removeTags','unix','toString','server','files','tmp','transcript-%d-%s.zip','lastName','attachments','read','Account','Owner','get','mkdirSync','Chat','N.A.','browserName','osName','referer','customerIp','customerPort','tail','existsSync','createReadStream','pipe','out','value','renderFile','views'];(function(_0x7f3494,_0xa02e71){var _0x1ace3a=function(_0x2259b5){while(--_0x2259b5){_0x7f3494['push'](_0x7f3494['shift']());}};_0x1ace3a(++_0xa02e71);}(_0xbecb,0x1a2));var _0xbbec=function(_0x5f1391,_0x19c132){_0x5f1391=_0x5f1391-0x0;var _0x50ebe3=_0xbecb[_0x5f1391];return _0x50ebe3;};'use strict';var rimraf=require(_0xbbec('0x0'));var zipdir=require('zip-dir');var rp=require(_0xbbec('0x1'));var moment=require('moment');var BPromise=require(_0xbbec('0x2'));var Mustache=require(_0xbbec('0x3'));var util=require(_0xbbec('0x4'));var path=require(_0xbbec('0x5'));var ejs=require(_0xbbec('0x6'));var fs=require('fs');var _=require(_0xbbec('0x7'));var Redis=require(_0xbbec('0x8'));var interaction=require(_0xbbec('0x9'));var qs=require('../../components/parsers/qs');var pdf=require(_0xbbec('0xa'));var logger=require(_0xbbec('0xb'))(_0xbbec('0xc'));var config=require(_0xbbec('0xd'));var db=require(_0xbbec('0xe'))['db'];config[_0xbbec('0xf')]=_[_0xbbec('0x10')](config[_0xbbec('0xf')],{'host':_0xbbec('0x11'),'port':0x18eb});var socket=require(_0xbbec('0x12'))(new Redis(config['redis']));require(_0xbbec('0x13'))['register'](socket);var jayson=require(_0xbbec('0x14'));var client=jayson[_0xbbec('0x15')][_0xbbec('0x16')]({'port':0x232b});var client9004=jayson[_0xbbec('0x15')][_0xbbec('0x16')]({'port':0x232c});function respondWithRpcPromise(_0x1e3a65,_0x58aa08,_0x14805c,_0x23c5c8){return new BPromise(function(_0x1d7192,_0x3408f3){var _0x4e2a00=_0x23c5c8||client;return _0x4e2a00['request'](_0x1e3a65,_0x14805c)[_0xbbec('0x17')](function(_0x3d4701){logger['info'](_0xbbec('0x18'),_0x58aa08,'request\x20sent');logger[_0xbbec('0x19')]('ChatInteraction,\x20%s,\x20%s,\x20%s',_0x58aa08,_0xbbec('0x1a'),JSON[_0xbbec('0x1b')](_0x3d4701));if(_0x3d4701[_0xbbec('0x1c')]){if(_0x3d4701[_0xbbec('0x1c')][_0xbbec('0x1d')]===0x1f4){logger[_0xbbec('0x1c')](_0xbbec('0x18'),_0x58aa08,_0x3d4701[_0xbbec('0x1c')][_0xbbec('0x1e')]);return _0x3408f3(_0x3d4701[_0xbbec('0x1c')]['message']);}logger['error'](_0xbbec('0x18'),_0x58aa08,_0x3d4701[_0xbbec('0x1c')]['message']);return _0x1d7192(_0x3d4701['error'][_0xbbec('0x1e')]);}else{logger[_0xbbec('0x1f')](_0xbbec('0x18'),_0x58aa08,'request\x20sent');_0x1d7192(_0x3d4701[_0xbbec('0x20')]['message']);}})[_0xbbec('0x21')](function(_0x64df63){logger[_0xbbec('0x1c')](_0xbbec('0x18'),_0x58aa08,_0x64df63);_0x3408f3(_0x64df63);});});}function respondWithStatusCode(_0x2e9ac0,_0xd7ae7e){_0xd7ae7e=_0xd7ae7e||0xcc;return function(_0x8e6a50){if(_0x8e6a50){return _0x2e9ac0['sendStatus'](_0xd7ae7e);}return _0x2e9ac0[_0xbbec('0x22')](_0xd7ae7e)[_0xbbec('0x23')]();};}function respondWithResult(_0x3ff931,_0x31583c){_0x31583c=_0x31583c||0xc8;return function(_0x32789a){if(_0x32789a){return _0x3ff931['status'](_0x31583c)[_0xbbec('0x24')](_0x32789a);}};}function respondWithFilteredResult(_0x19983b,_0x54aec3){return function(_0x2a46b9){if(_0x2a46b9){var _0x55703a=typeof _0x54aec3[_0xbbec('0x25')]===_0xbbec('0x26')&&typeof _0x54aec3['limit']==='undefined';var _0x39f393=_0x2a46b9[_0xbbec('0x27')];var _0x21aeda=_0x55703a?0x0:_0x54aec3[_0xbbec('0x25')];var _0x4f1773=_0x55703a?_0x2a46b9['count']:_0x54aec3[_0xbbec('0x25')]+_0x54aec3['limit'];var _0xdcb6c7;if(_0x4f1773>=_0x39f393){_0x4f1773=_0x39f393;_0xdcb6c7=0xc8;}else{_0xdcb6c7=0xce;}_0x19983b[_0xbbec('0x22')](_0xdcb6c7);return _0x19983b[_0xbbec('0x28')]('Content-Range',_0x21aeda+'-'+_0x4f1773+'/'+_0x39f393)[_0xbbec('0x24')](_0x2a46b9);}return null;};}function saveUpdates(_0x4757c1){return function(_0x3c4c81){if(_0x3c4c81){return _0x3c4c81['update'](_0x4757c1)[_0xbbec('0x17')](function(_0x790264){return _0x790264;});}return null;};}function removeEntity(_0x5050f1){return function(_0x1ae7a8){if(_0x1ae7a8){return _0x1ae7a8[_0xbbec('0x29')]()['then'](function(){_0x5050f1[_0xbbec('0x22')](0xcc)['end']();});}};}function handleEntityNotFound(_0x561110){return function(_0x2e5319){if(!_0x2e5319){_0x561110['sendStatus'](0x194);}return _0x2e5319;};}function handleError(_0x2fe9a4,_0x48fe52){_0x48fe52=_0x48fe52||0x1f4;return function(_0x2a3f75){logger[_0xbbec('0x1c')](_0x2a3f75[_0xbbec('0x2a')]);if(_0x2a3f75[_0xbbec('0x2b')]){delete _0x2a3f75[_0xbbec('0x2b')];}_0x2fe9a4[_0xbbec('0x22')](_0x48fe52)[_0xbbec('0x2c')](_0x2a3f75);};}function getMustacheRender(_0x22c8bf,_0x3ea3ad){return Mustache[_0xbbec('0x2d')](_0x22c8bf,_[_0xbbec('0x2e')](_0x3ea3ad[_0xbbec('0x2f')],{'contact':_0x3ea3ad[_0xbbec('0x30')],'message':_0x3ea3ad[_0xbbec('0x1e')],'agent':_0x3ea3ad[_0xbbec('0x31')],'interaction':_0x3ea3ad[_0xbbec('0x32')],'account':_0x3ea3ad[_0xbbec('0x33')]}))||'';}exports[_0xbbec('0x34')]=function(_0x587ca9,_0x391d6){var _0x4ea069={};var _0x2b75fb=_[_0xbbec('0x35')](db[_0xbbec('0x36')][_0xbbec('0x37')],function(_0x235fb8){return{'name':_0x235fb8[_0xbbec('0x38')],'type':_0x235fb8['type'][_0xbbec('0x39')]};});_0x4ea069=qs['getOptions'](_0x2b75fb,_0x587ca9);return interaction['findAll'](_0xbbec('0x3a'),_0x587ca9[_0xbbec('0x3b')],_0x587ca9[_0xbbec('0x3c')],_0x4ea069,_0x2b75fb)[_0xbbec('0x17')](respondWithFilteredResult(_0x391d6,_0x4ea069))[_0xbbec('0x21')](handleError(_0x391d6,null));};exports[_0xbbec('0x3d')]=function(_0x359c1b,_0xdaf275){var _0x2b382d={'raw':![],'where':{'id':_0x359c1b['params']['id']}},_0x47a77e={};_0x47a77e[_0xbbec('0x3e')]=_[_0xbbec('0x3f')](db[_0xbbec('0x36')][_0xbbec('0x37')]);_0x47a77e[_0xbbec('0x3b')]=_[_0xbbec('0x3f')](_0x359c1b[_0xbbec('0x3b')]);_0x47a77e[_0xbbec('0x40')]=_[_0xbbec('0x41')](_0x47a77e[_0xbbec('0x3e')],_0x47a77e[_0xbbec('0x3b')]);_0x2b382d[_0xbbec('0x42')]=_[_0xbbec('0x41')](_0x47a77e[_0xbbec('0x3e')],qs['fields'](_0x359c1b[_0xbbec('0x3b')][_0xbbec('0x43')]));_0x2b382d[_0xbbec('0x42')]=_0x2b382d['attributes'][_0xbbec('0x44')]?_0x2b382d[_0xbbec('0x42')]:_0x47a77e[_0xbbec('0x3e')];if(_0x359c1b['query'][_0xbbec('0x45')]){_0x2b382d[_0xbbec('0x46')]=[{'all':!![]}];}_0x2b382d=_[_0xbbec('0x2e')]({},_0x2b382d,_0x359c1b['options']);return db[_0xbbec('0x36')][_0xbbec('0x47')](_0x2b382d)[_0xbbec('0x17')](handleEntityNotFound(_0xdaf275,null))[_0xbbec('0x17')](respondWithResult(_0xdaf275,null))['catch'](handleError(_0xdaf275,null));};exports[_0xbbec('0x48')]=function(_0xd0a4e2,_0x4e4553){return db[_0xbbec('0x36')]['create'](_0xd0a4e2[_0xbbec('0x2f')],{})[_0xbbec('0x17')](respondWithResult(_0x4e4553,0xc9))[_0xbbec('0x21')](handleError(_0x4e4553,null));};exports['update']=function(_0x331f4f,_0x84c525){if(_0x331f4f['body']['id']){delete _0x331f4f[_0xbbec('0x2f')]['id'];}return db[_0xbbec('0x36')][_0xbbec('0x47')]({'where':{'id':_0x331f4f[_0xbbec('0x49')]['id']}})[_0xbbec('0x17')](handleEntityNotFound(_0x84c525,null))[_0xbbec('0x17')](saveUpdates(_0x331f4f[_0xbbec('0x2f')],null))[_0xbbec('0x17')](respondWithResult(_0x84c525,null))[_0xbbec('0x21')](handleError(_0x84c525,null));};exports[_0xbbec('0x29')]=function(_0x375328,_0x4ef950){return db[_0xbbec('0x36')][_0xbbec('0x47')]({'where':{'id':_0x375328['params']['id']}})[_0xbbec('0x17')](handleEntityNotFound(_0x4ef950,null))[_0xbbec('0x17')](removeEntity(_0x4ef950,null))[_0xbbec('0x21')](handleError(_0x4ef950,null));};exports['describe']=function(_0x40b86b,_0x1c24fe){return db[_0xbbec('0x36')]['describe']()[_0xbbec('0x17')](respondWithResult(_0x1c24fe,null))[_0xbbec('0x21')](handleError(_0x1c24fe,null));};exports[_0xbbec('0x4a')]=function(_0x4832ef,_0xe75a67){var _0x343ed6=_0x4832ef[_0xbbec('0x49')]['id'];var _0x157ac4;var _0x4fb1cc;var _0x1e086b;return db[_0xbbec('0x36')][_0xbbec('0x4b')]({'where':{'id':_0x343ed6}})[_0xbbec('0x17')](function(_0x2c6ade){_0x157ac4=_0x2c6ade;return db['ChatWebsite']['findOne']({'where':{'id':_0x2c6ade[_0xbbec('0x4c')]},'attributes':['id','vidaooApiKey',_0xbbec('0x4d'),_0xbbec('0x4e'),_0xbbec('0x4f'),'vidaooMetadata'],'raw':!![]});})[_0xbbec('0x17')](function(_0x3b0d14){if(_0x3b0d14&&_0x3b0d14['vidaooApiKey']&&_0x3b0d14[_0xbbec('0x4d')]){_0x4fb1cc=_0x3b0d14;var _0x3c9d28={'interaction':{'id':_0x343ed6},'agent':{'id':_0x4832ef[_0xbbec('0x3c')]['id'],'name':_0x4832ef['user'][_0xbbec('0x2b')],'fullname':_0x4832ef[_0xbbec('0x3c')]['fullname'],'email':_0x4832ef['user'][_0xbbec('0x50')]},'contact':_0x4832ef[_0xbbec('0x2f')]['contact'],'account':_0x4832ef['body'][_0xbbec('0x33')]};var _0x5caffd={'rejectUnauthorized':![],'method':_0xbbec('0x51'),'url':_0xbbec('0x52'),'headers':{'X-APIKEY':_0x3b0d14[_0xbbec('0x53')]},'body':{'duration':null,'scheduledAt':null,'participants':[_0x4832ef[_0xbbec('0x3c')]['email']],'buttons':null,'topic':_0x4fb1cc[_0xbbec('0x4e')],'note':_[_0xbbec('0x54')](_0x4fb1cc[_0xbbec('0x4f')])?null:getMustacheRender(_0x4fb1cc['vidaooNote'],_0x3c9d28),'metadata':null},'redirect':_0xbbec('0x55'),'json':!![]};try{if(!_[_0xbbec('0x54')](_0x4fb1cc[_0xbbec('0x56')])){var _0x39101a=getMustacheRender(_0x4fb1cc[_0xbbec('0x56')],_0x3c9d28);var _0x501bfc=JSON[_0xbbec('0x57')](_0x39101a);_0x5caffd['body']['metadata']=_0x501bfc;}}catch(_0x2453bf){throw new db[(_0xbbec('0x58'))]['ValidationError']('Error\x20in\x20conversion\x20vidaooMetadata');}return rp(_0x5caffd);}else{throw new db[(_0xbbec('0x58'))][(_0xbbec('0x59'))](_0xbbec('0x5a'));}})[_0xbbec('0x17')](function(_0x185c8f){_0x1e086b=_0x185c8f;if(_0x1e086b['id']){var _0x1c8cee={'body':_0x1e086b[_0xbbec('0x5b')],'ChatWebsiteId':_0x4fb1cc['id'],'ChatInteractionId':_0x157ac4['id'],'direction':'out','UserId':_0x4832ef[_0xbbec('0x3c')]['id']};return db[_0xbbec('0x5c')][_0xbbec('0x48')](_0x1c8cee,{});}else{throw new db['Sequelize']['ValidationError'](_0xbbec('0x5d'));}})[_0xbbec('0x17')](function(){return _0x157ac4[_0xbbec('0x5e')]({'vidaooSessionId':_0x1e086b['id']});})[_0xbbec('0x17')](respondWithResult(_0xe75a67,null))[_0xbbec('0x21')](handleError(_0xe75a67,null));};exports['customUpdate']=function(_0xbdd718,_0x67e312){if(_0xbdd718['body']['id']){delete _0xbdd718['body']['id'];}return db[_0xbbec('0x36')][_0xbbec('0x47')]({'where':{'id':_0xbdd718[_0xbbec('0x49')]['id']},'include':[{'model':db['CmContact'],'as':_0xbbec('0x5f')}]})['then'](handleEntityNotFound(_0x67e312,null))['then'](saveUpdates(_0xbdd718[_0xbbec('0x2f')],null))[_0xbbec('0x17')](respondWithResult(_0x67e312,null))[_0xbbec('0x21')](handleError(_0x67e312,null));};exports[_0xbbec('0x60')]=function(_0x34d51f,_0xe65d0f){if(_0x34d51f[_0xbbec('0x2f')]['id']){delete _0x34d51f[_0xbbec('0x2f')]['id'];}return db[_0xbbec('0x36')][_0xbbec('0x47')]({'where':{'id':_0x34d51f[_0xbbec('0x49')]['id']}})[_0xbbec('0x17')](function(_0x2b73b4){if(!_0x2b73b4){logger[_0xbbec('0x1c')]('abandonInteraction,\x20%s,\x20%s,\x20%s',_0xbbec('0x60'),0x194,_0xbbec('0x61'));_0xe65d0f[_0xbbec('0x62')](0x194);}else{if(_0x2b73b4[_0xbbec('0x63')]){throw new db[(_0xbbec('0x58'))][(_0xbbec('0x59'))]('Interaction\x20already\x20assigned');}}return _0x2b73b4;})[_0xbbec('0x17')](function(_0x16b58d){if(_0x16b58d){return _0x16b58d[_0xbbec('0x64')]({'closed':_0x34d51f[_0xbbec('0x2f')][_0xbbec('0x65')],'disposition':_0x34d51f[_0xbbec('0x2f')][_0xbbec('0x66')]})['then'](function(_0x35e4ee){return _0x35e4ee;});}})['then'](function(){return respondWithRpcPromise('AbandonInteraction',_0xbbec('0x60'),_0x34d51f[_0xbbec('0x2f')],client9004);})['then'](respondWithResult(_0xe65d0f,null))[_0xbbec('0x21')](handleError(_0xe65d0f,null));};exports[_0xbbec('0x67')]=function(_0x4810d8,_0x2d6823){_0x4810d8[_0xbbec('0x2f')][_0xbbec('0x2b')]=_0x4810d8['file'][_0xbbec('0x68')];_0x4810d8[_0xbbec('0x2f')][_0xbbec('0x69')]=_0x4810d8[_0xbbec('0x6a')][_0xbbec('0x6b')];_0x4810d8['body'][_0xbbec('0x6c')]=_0x4810d8[_0xbbec('0x6a')][_0xbbec('0x6d')];return db[_0xbbec('0x6e')]['create'](_0x4810d8['body'])[_0xbbec('0x17')](respondWithResult(_0x2d6823,0xc9))[_0xbbec('0x21')](handleError(_0x2d6823,null));};exports['attachmentDownload']=function(_0x3f1d0c,_0x3d1469){return db[_0xbbec('0x36')][_0xbbec('0x4b')]({'where':{'id':_0x3f1d0c['params']['id']},'raw':!![]})[_0xbbec('0x17')](handleEntityNotFound(_0x3d1469,null))[_0xbbec('0x17')](function(_0x16fd28){if(_0x16fd28){if(_0x16fd28['closed']){return _0x3d1469[_0xbbec('0x22')](0x193)[_0xbbec('0x24')]({'status':0x193,'message':'Unauthorized'});}return db['Attachment'][_0xbbec('0x4b')]({'where':{'id':_0x3f1d0c['query'][_0xbbec('0x6f')]},'raw':!![]})[_0xbbec('0x17')](handleEntityNotFound(_0x3d1469,null));}})[_0xbbec('0x17')](function(_0x3c011a){if(_0x3c011a){var _0x4c5ff1=_0x3c011a[_0xbbec('0x70')]!==null;var _0x3fdfd8=path[_0xbbec('0x71')](config[_0xbbec('0x72')],_0xbbec('0x73'));if(_0x4c5ff1){_0x3fdfd8=path[_0xbbec('0x71')](_0x3fdfd8,_0xbbec('0x74'));}var _0x196d10=path[_0xbbec('0x71')](_0x3fdfd8,_0x3c011a[_0xbbec('0x69')]);return _0x3d1469[_0xbbec('0x75')](_0x196d10);}})[_0xbbec('0x21')](handleError(_0x3d1469,null));};exports[_0xbbec('0x76')]=function(_0x3838fc,_0x333376){var _0x5f2ef0=null;var _0x115023=null;var _0x4073d9=null;if(_0x3838fc['body']['id']){delete _0x3838fc[_0xbbec('0x2f')]['id'];}if(_0x3838fc[_0xbbec('0x2f')][_0xbbec('0x77')]){_0x4073d9=path[_0xbbec('0x71')](config[_0xbbec('0x72')],_0xbbec('0x78'),util[_0xbbec('0x79')](_0xbbec('0x7a'),Date[_0xbbec('0x7b')]()));_0x3838fc[_0xbbec('0x2f')][_0xbbec('0x7c')]=_0x4073d9;}return db[_0xbbec('0x36')][_0xbbec('0x47')]({'where':{'id':_0x3838fc[_0xbbec('0x49')]['id']},'include':[{'model':db[_0xbbec('0x5c')],'as':_0xbbec('0x7d'),'include':[{'model':db['User'],'as':_0xbbec('0x7e')}]}]})[_0xbbec('0x17')](handleEntityNotFound(_0x333376,null))[_0xbbec('0x17')](saveUpdates(_0x3838fc[_0xbbec('0x2f')],null))[_0xbbec('0x17')](function(_0x491bba){if(_0x491bba){_0x5f2ef0=_0x491bba;return db[_0xbbec('0x7f')][_0xbbec('0x47')]({'where':{'id':_0x5f2ef0[_0xbbec('0x4c')]}});}})[_0xbbec('0x17')](function(_0x2b9fca){if(_0x2b9fca){_0x115023=_0x2b9fca;return db[_0xbbec('0x80')]['find']({'where':{'id':_0x5f2ef0[_0xbbec('0x81')]}});}})[_0xbbec('0x17')](function(_0x10c992){if(_0x10c992){if(_0x4073d9){var _0x48e3dd=null;for(var _0x47d797=0x1;_0x47d797<_0x5f2ef0[_0xbbec('0x7d')][_0xbbec('0x44')];++_0x47d797){_0x48e3dd=_0x5f2ef0[_0xbbec('0x7d')][_0x47d797];var _0x296622=_0x48e3dd[_0xbbec('0x63')]?util[_0xbbec('0x79')](_0xbbec('0x82'),_0x115023[_0xbbec('0x83')],_0x48e3dd[_0xbbec('0x63')]):_0xbbec('0x84');var _0x57850e=_0x3838fc['body'][_0xbbec('0x85')]||util[_0xbbec('0x79')](_0xbbec('0x82'),_0xbbec('0x86'),_0x48e3dd['ContactId']);switch(_0x115023['agentIdentifier']){case'website_alias':_0x296622=_0x48e3dd['UserId']?util['format'](_0xbbec('0x82'),_0x115023[_0xbbec('0x83')],_0x48e3dd[_0xbbec('0x63')]):_0xbbec('0x84');break;case'agent_alias':_0x296622=_0x48e3dd[_0xbbec('0x63')]?_0x48e3dd[_0xbbec('0x7e')][_0xbbec('0x87')]||_0x48e3dd[_0xbbec('0x7e')][_0xbbec('0x88')]:_0xbbec('0x84');break;case _0xbbec('0x89'):_0x296622=_0x48e3dd['UserId']?_0x48e3dd[_0xbbec('0x7e')][_0xbbec('0x88')]:'System';break;default:_0x296622=_0x48e3dd[_0xbbec('0x63')]?util[_0xbbec('0x79')](_0xbbec('0x82'),_0x115023['agentAlias'],_0x48e3dd[_0xbbec('0x63')]):_0xbbec('0x84');}var _0x129cad=util[_0xbbec('0x79')](_0xbbec('0x8a'),moment(_0x48e3dd[_0xbbec('0x8b')])[_0xbbec('0x79')](_0xbbec('0x8c')),_0x48e3dd[_0xbbec('0x8d')]==='in'?_0x57850e:_0x296622,_0x48e3dd[_0xbbec('0x2f')]);if(!_0x48e3dd[_0xbbec('0x8e')]){fs[_0xbbec('0x8f')](_0x4073d9,_0x129cad);}}return db[_0xbbec('0x90')][_0xbbec('0x4b')]({'where':{'service':!![]},'include':[{'model':db['MailServerOut'],'as':_0xbbec('0x91'),'raw':!![],'include':[{'model':db[_0xbbec('0x92')],'as':_0xbbec('0x92'),'raw':!![]}]}]});}}})[_0xbbec('0x17')](function(_0x4f49ab){if(!_0x4f49ab||!_0x4f49ab[_0xbbec('0x91')]||!_0x3838fc[_0xbbec('0x2f')])return _0x5f2ef0;var _0x51e0c9=_0x4f49ab[_0xbbec('0x93')]();return respondWithRpcPromise(_0xbbec('0x94'),'sendMail',{'account':_0x51e0c9,'message':{'from':util[_0xbbec('0x79')](_0xbbec('0x95'),_0x4f49ab['name'],_0x4f49ab[_0xbbec('0x50')]||_0x4f49ab[_0xbbec('0x91')][_0xbbec('0x3c')]),'to':_0x3838fc[_0xbbec('0x2f')][_0xbbec('0x77')],'subject':_0xbbec('0x96'),'text':util['format'](_0xbbec('0x97'),_0x3838fc['body'][_0xbbec('0x77')]),'attachments':[{'path':_0x4073d9}]}})[_0xbbec('0x17')](function(){return _0x5f2ef0;})[_0xbbec('0x21')](function(_0x51a6e2){logger['error'](_0x51a6e2);});})[_0xbbec('0x17')](respondWithStatusCode(_0x333376,0xc8))[_0xbbec('0x21')](handleError(_0x333376,null));};exports[_0xbbec('0x98')]=function(_0x3106f4,_0x4f24d2){return db[_0xbbec('0x5c')]['find']({'where':{'id':_0x3106f4[_0xbbec('0x49')]['id']}})[_0xbbec('0x17')](handleEntityNotFound(_0x4f24d2,null))[_0xbbec('0x17')](function(_0x493e2b){if(_0x493e2b){return _0x493e2b[_0xbbec('0x98')](_0x3106f4['body'][_0xbbec('0x99')],_[_0xbbec('0x9a')](_0x3106f4[_0xbbec('0x2f')],['ids','id'])||{});}})[_0xbbec('0x17')](respondWithResult(_0x4f24d2,null))[_0xbbec('0x21')](handleError(_0x4f24d2,null));};exports[_0xbbec('0x9b')]=function(_0x550a4d,_0x40982c){var _0x1c0c00={'raw':![],'where':{}};var _0x4ca62a={};var _0x3227a1={'count':0x0,'rows':[]};return db[_0xbbec('0x36')]['findOne']({'where':{'id':_0x550a4d[_0xbbec('0x49')]['id']}})['then'](handleEntityNotFound(_0x40982c,null))[_0xbbec('0x17')](function(_0x590902){if(_0x590902){_0x4ca62a[_0xbbec('0x3e')]=_['keys'](db[_0xbbec('0x5c')][_0xbbec('0x37')]);_0x4ca62a[_0xbbec('0x3b')]=_[_0xbbec('0x3f')](_0x550a4d[_0xbbec('0x3b')]);_0x4ca62a[_0xbbec('0x40')]=_['intersection'](_0x4ca62a[_0xbbec('0x3e')],_0x4ca62a[_0xbbec('0x3b')]);_0x1c0c00[_0xbbec('0x42')]=_[_0xbbec('0x41')](_0x4ca62a[_0xbbec('0x3e')],qs[_0xbbec('0x43')](_0x550a4d[_0xbbec('0x3b')][_0xbbec('0x43')]));_0x1c0c00['attributes']=_0x1c0c00['attributes']['length']?_0x1c0c00[_0xbbec('0x42')]:_0x4ca62a[_0xbbec('0x3e')];if(!_0x550a4d[_0xbbec('0x3b')][_0xbbec('0x9c')](_0xbbec('0x9d'))){_0x1c0c00['limit']=qs[_0xbbec('0x9e')](_0x550a4d[_0xbbec('0x3b')][_0xbbec('0x9e')]);_0x1c0c00[_0xbbec('0x25')]=qs[_0xbbec('0x25')](_0x550a4d[_0xbbec('0x3b')]['offset']);}_0x1c0c00['order']=qs[_0xbbec('0x9f')](_0x550a4d[_0xbbec('0x3b')][_0xbbec('0x9f')]);_0x1c0c00[_0xbbec('0xa0')]=qs['filters'](_['pick'](_0x550a4d[_0xbbec('0x3b')],_0x4ca62a[_0xbbec('0x40')]));_0x1c0c00[_0xbbec('0xa0')][_0xbbec('0xa1')]=_0x590902['id'];if(_0x550a4d[_0xbbec('0x3b')][_0xbbec('0xa2')]){_0x1c0c00[_0xbbec('0xa0')]=_[_0xbbec('0x2e')](_0x1c0c00[_0xbbec('0xa0')],{'$or':_[_0xbbec('0x35')](_0x1c0c00[_0xbbec('0x42')],function(_0x1b89e0){var _0x24514e={};_0x24514e[_0x1b89e0]={'$like':'%'+_0x550a4d[_0xbbec('0x3b')][_0xbbec('0xa2')]+'%'};return _0x24514e;})});}if(_0x550a4d[_0xbbec('0x3b')][_0xbbec('0xa3')]){var _0x3ad17f=_0x550a4d[_0xbbec('0x3b')][_0xbbec('0xa3')][_0xbbec('0xa4')](',');var _0x48c864={};_0x48c864[_0x3ad17f[0x0]]={'$gte':moment(_0x3ad17f[0x1])[_0xbbec('0x79')](_0xbbec('0xa5'))};_0x1c0c00[_0xbbec('0xa0')]=_[_0xbbec('0x2e')](_0x1c0c00[_0xbbec('0xa0')],_0x48c864);}_0x1c0c00=_[_0xbbec('0x2e')]({},_0x1c0c00,_0x550a4d['options']);return db[_0xbbec('0x5c')][_0xbbec('0x27')]({'where':_0x1c0c00[_0xbbec('0xa0')]})['then'](function(_0x5a28bc){_0x3227a1[_0xbbec('0x27')]=_0x5a28bc;if(_0x550a4d['query'][_0xbbec('0x45')]){_0x1c0c00['include']=[{'all':!![]}];}return db[_0xbbec('0x5c')][_0xbbec('0xa6')](_0x1c0c00);})['then'](function(_0x5798fb){_0x3227a1[_0xbbec('0xa7')]=_0x5798fb;return _0x3227a1;});}})['then'](respondWithFilteredResult(_0x40982c,_0x1c0c00))['catch'](handleError(_0x40982c,null));};exports[_0xbbec('0xa8')]=function(_0x26c33e,_0x3a5607){var _0x42f6c3={'where':{}},_0x432e45={},_0x29a63e={'count':0x0,'rows':[]};return db['ChatInteraction'][_0xbbec('0x4b')]({'where':{'id':_0x26c33e[_0xbbec('0x49')]['id']}})['then'](handleEntityNotFound(_0x3a5607,null))[_0xbbec('0x17')](function(_0x54f723){if(_0x54f723){_0x432e45['model']=_[_0xbbec('0x3f')](db[_0xbbec('0x5c')][_0xbbec('0x37')]);_0x432e45['query']=_[_0xbbec('0x3f')](_0x26c33e[_0xbbec('0x3b')]);_0x432e45['filters']=_[_0xbbec('0x41')](_0x432e45[_0xbbec('0x3e')],_0x432e45[_0xbbec('0x3b')]);_0x42f6c3[_0xbbec('0x42')]=_[_0xbbec('0x41')](_0x432e45[_0xbbec('0x3e')],qs[_0xbbec('0x43')](_0x26c33e[_0xbbec('0x3b')]['fields']));_0x42f6c3[_0xbbec('0x42')]=_0x42f6c3['attributes'][_0xbbec('0x44')]?_0x42f6c3[_0xbbec('0x42')]:_0x432e45[_0xbbec('0x3e')];if(!_0x26c33e[_0xbbec('0x3b')][_0xbbec('0x9c')]('nolimit')){_0x42f6c3[_0xbbec('0x9e')]=qs['limit'](_0x26c33e[_0xbbec('0x3b')][_0xbbec('0x9e')]);_0x42f6c3[_0xbbec('0x25')]=qs[_0xbbec('0x25')](_0x26c33e[_0xbbec('0x3b')][_0xbbec('0x25')]);}_0x42f6c3['order']=qs['sort'](_0x26c33e[_0xbbec('0x3b')]['sort']);_0x42f6c3[_0xbbec('0xa0')]=qs[_0xbbec('0x40')](_[_0xbbec('0xa9')](_0x26c33e['query'],_0x432e45[_0xbbec('0x40')]));_0x42f6c3[_0xbbec('0xa0')][_0xbbec('0xa1')]=_0x54f723['id'];if(_0x26c33e[_0xbbec('0x3b')][_0xbbec('0xa2')]){_0x42f6c3[_0xbbec('0xa0')]=_['merge'](_0x42f6c3[_0xbbec('0xa0')],{'$or':_['map'](_0x42f6c3[_0xbbec('0x42')],function(_0x677bc8){var _0x15dd21={};_0x15dd21[_0x677bc8]={'$like':'%'+_0x26c33e[_0xbbec('0x3b')][_0xbbec('0xa2')]+'%'};return _0x15dd21;})});}_0x42f6c3[_0xbbec('0xa0')][_0xbbec('0x8e')]=![];if(_0x26c33e[_0xbbec('0x3b')]['id']){_0x42f6c3[_0xbbec('0xa0')]['id']={'$gt':_0x26c33e[_0xbbec('0x3b')]['id']};}_0x42f6c3=_[_0xbbec('0x2e')]({},_0x42f6c3,_0x26c33e[_0xbbec('0xaa')]);return db[_0xbbec('0x5c')][_0xbbec('0x27')]({'where':_0x42f6c3[_0xbbec('0xa0')]})['then'](function(_0x5b310d){_0x29a63e[_0xbbec('0x27')]=_0x5b310d;_0x42f6c3[_0xbbec('0x46')]=[];if(_0x26c33e[_0xbbec('0x3b')][_0xbbec('0xab')]){_0x42f6c3[_0xbbec('0x46')][_0xbbec('0xac')]({'model':db[_0xbbec('0x7e')],'as':_0xbbec('0x7e'),'attributes':['id','fullname',_0xbbec('0x87')]});}if(_0x26c33e[_0xbbec('0x3b')]['includeAll']){_0x42f6c3['include']=[{'all':!![]}];}return db[_0xbbec('0x5c')][_0xbbec('0xa6')](_0x42f6c3);})[_0xbbec('0x17')](function(_0x42b3cd){_0x29a63e[_0xbbec('0xa7')]=_0x42b3cd;return _0x29a63e;});}})[_0xbbec('0x17')](respondWithFilteredResult(_0x3a5607,_0x42f6c3))[_0xbbec('0x21')](handleError(_0x3a5607,null));};exports[_0xbbec('0xad')]=function(_0x3046b1,_0x103d0e){return db['ChatInteraction'][_0xbbec('0x47')]({'where':{'id':_0x3046b1[_0xbbec('0x49')]['id']}})['then'](handleEntityNotFound(_0x103d0e,null))[_0xbbec('0x17')](function(_0x406f6a){if(_0x406f6a){return _0x406f6a[_0xbbec('0xae')](_0x3046b1[_0xbbec('0x2f')]['ids'],_[_0xbbec('0x9a')](_0x3046b1[_0xbbec('0x2f')],[_0xbbec('0x99'),'id'])||{})[_0xbbec('0xaf')](function(){return db['Tag'][_0xbbec('0xa6')]({'attributes':['id',_0xbbec('0x2b'),_0xbbec('0xb0')],'where':{'id':_0x3046b1[_0xbbec('0x2f')][_0xbbec('0x99')]}});})['then'](function(_0x2c384f){socket['emit']('chatInteractionTags:save',{'id':Number(_0x3046b1['params']['id']),'tags':_0x2c384f||[]});return{'id':Number(_0x3046b1[_0xbbec('0x49')]['id']),'tags':_0x2c384f||[]};});}})[_0xbbec('0x17')](respondWithResult(_0x103d0e,null))[_0xbbec('0x21')](handleError(_0x103d0e,null));};exports[_0xbbec('0xb1')]=function(_0x950df8,_0x233f43){return db['ChatInteraction'][_0xbbec('0x47')]({'where':{'id':_0x950df8[_0xbbec('0x49')]['id']}})[_0xbbec('0x17')](handleEntityNotFound(_0x233f43,null))[_0xbbec('0x17')](function(_0x476a0b){if(_0x476a0b){return _0x476a0b[_0xbbec('0xb1')](_0x950df8[_0xbbec('0x3b')][_0xbbec('0x99')]);}})[_0xbbec('0x17')](respondWithStatusCode(_0x233f43,null))[_0xbbec('0x21')](handleError(_0x233f43,null));};exports[_0xbbec('0x75')]=function(_0x4e4219,_0x3ee3b9){var _0x4d94d4=moment()[_0xbbec('0xb2')]()[_0xbbec('0xb3')]();var _0xa683dc=path[_0xbbec('0x71')](config[_0xbbec('0x72')],_0xbbec('0xb4'),_0xbbec('0xb5'),_0xbbec('0xb6'));var _0x30dbb3=path['join'](config[_0xbbec('0x72')],_0xbbec('0xb4'),_0xbbec('0xb5'),'attachments');var _0x2479bd=path[_0xbbec('0x71')](_0xa683dc,_0x4d94d4);var _0x34d09c=util[_0xbbec('0x79')](_0xbbec('0xb7'),_0x4e4219['params']['id'],_0x4d94d4);var _0xd2a4e0=path[_0xbbec('0x71')](_0xa683dc,_0x34d09c);var _0x2d2e2c=[];_0x2d2e2c[_0xbbec('0xac')]({'model':db[_0xbbec('0x7e')],'as':'User','attributes':['id',_0xbbec('0x88')],'raw':!![]});_0x2d2e2c['push']({'model':db[_0xbbec('0x80')],'as':_0xbbec('0x5f'),'attributes':['id','firstName',_0xbbec('0xb8')],'raw':!![]});if(_0x4e4219[_0xbbec('0x3b')][_0xbbec('0xb9')]){_0x2d2e2c[_0xbbec('0xac')]({'model':db[_0xbbec('0x6e')],'as':_0xbbec('0x6e'),'raw':!![]});}var _0x44c156=[{'model':db[_0xbbec('0x5c')],'as':'Messages','attributes':['id',_0xbbec('0x2f'),'createdAt','direction',_0xbbec('0x8e'),_0xbbec('0xba')],'include':_0x2d2e2c}];_0x44c156['push']({'model':db[_0xbbec('0x7f')],'as':_0xbbec('0xbb'),'attributes':['id',_0xbbec('0x2b')]});_0x44c156[_0xbbec('0xac')]({'model':db[_0xbbec('0x7e')],'as':_0xbbec('0xbc'),'attributes':['id',_0xbbec('0x88')]});return db[_0xbbec('0x36')][_0xbbec('0x47')]({'where':{'id':_0x4e4219[_0xbbec('0x49')]['id']},'include':_0x44c156})[_0xbbec('0x17')](handleEntityNotFound(_0x3ee3b9,null))[_0xbbec('0x17')](function(_0x2adf99){if(_0x2adf99){var _0x4a3dd1=_0x2adf99[_0xbbec('0xbd')]({'plain':!![]});fs[_0xbbec('0xbe')](_0x2479bd);var _0x598aad={'channel':_0xbbec('0xbf'),'account':_0x4a3dd1[_0xbbec('0xbb')][_0xbbec('0x2b')],'agent':_0x4a3dd1[_0xbbec('0xbc')]?_0x4a3dd1[_0xbbec('0xbc')][_0xbbec('0x88')]:_0xbbec('0xc0'),'createdAt':moment(_0x4a3dd1['createdAt'])[_0xbbec('0x79')](_0xbbec('0xa5'))['toString'](),'closedAt':_0x4a3dd1[_0xbbec('0x65')]?moment(_0x4a3dd1['closedAt'])[_0xbbec('0x79')]('YYYY-MM-DD\x20HH:mm:ss')[_0xbbec('0xb3')]():'','disposition':_0x4a3dd1[_0xbbec('0x66')],'chatInfo':{'browser':_0x4a3dd1[_0xbbec('0xc1')],'os':_0x4a3dd1[_0xbbec('0xc2')],'referer':_0x4a3dd1[_0xbbec('0xc3')],'customerIp':_0x4a3dd1[_0xbbec('0xc4')],'customerPort':_0x4a3dd1[_0xbbec('0xc5')]?_0x4a3dd1[_0xbbec('0xc5')]:_0xbbec('0xc0')},'messages':_(_0x4a3dd1[_0xbbec('0x7d')])[_0xbbec('0xc6')]()[_0xbbec('0xa2')]({'secret':![]})[_0xbbec('0x35')](function(_0x248b48){if(_0x248b48[_0xbbec('0x6e')]){var _0x4212b7=path['join'](_0x30dbb3,_0x248b48['Attachment']['basename']);if(fs[_0xbbec('0xc7')](_0x4212b7)){fs[_0xbbec('0xc8')](_0x4212b7)[_0xbbec('0xc9')](fs['createWriteStream'](path['join'](_0x2479bd,_0x248b48[_0xbbec('0x6e')]['basename'])));}}return{'date':moment(_0x248b48[_0xbbec('0x8b')])[_0xbbec('0x79')]('YYYY-MM-DD\x20HH:mm:ss')[_0xbbec('0xb3')](),'sender':_0x248b48['direction']===_0xbbec('0xca')?_0x248b48[_0xbbec('0x7e')]?_0x248b48['User'][_0xbbec('0x88')]:_0xbbec('0x84'):_0x248b48[_0xbbec('0x5f')]['firstName']+(_0x248b48[_0xbbec('0x5f')][_0xbbec('0xb8')]?'\x20'+_0x248b48['Contact'][_0xbbec('0xb8')]:''),'body':_0x248b48['Attachment']?_0x248b48[_0xbbec('0x6e')][_0xbbec('0x69')]:_0x248b48['body'],'direction':_0x248b48[_0xbbec('0x8d')]===_0xbbec('0xca')?'A':'C','secret':_0x248b48[_0xbbec('0x8e')],'read':_0x248b48['read'],'attachment':_0x248b48[_0xbbec('0x6e')]};})[_0xbbec('0xcb')]()};return ejs[_0xbbec('0xcc')](path['join'](config[_0xbbec('0x72')],_0xbbec('0xb4'),_0xbbec('0xcd'),_0xbbec('0xce')),{'interaction':_0x598aad})[_0xbbec('0x17')](function(_0x160619){var _0x41b01c=path[_0xbbec('0x71')](_0x2479bd,'transcript-'+_0x4a3dd1['id']+'-'+_0x4d94d4+'.pdf');var _0x1ecf0f={'path':_0x41b01c,'channel':_0xbbec('0xbf'),'interactionId':_0x4a3dd1['id']};return pdf[_0xbbec('0xcf')](_0x160619,_0x1ecf0f);})[_0xbbec('0x17')](function(){return new Promise(function(_0x44f768,_0x355195){zipdir(_0x2479bd,{'saveTo':_0xd2a4e0},function(_0x4d502f,_0x43e65c){if(_0x4d502f)return _0x355195(_0x4d502f);return _0x44f768(_0x43e65c);});})[_0xbbec('0x17')](function(){return new BPromise(function(_0x5fe8f,_0x3a21b8){rimraf(_0x2479bd,function(_0x43886d){if(_0x43886d)_0x3a21b8(_0x43886d);return _0x5fe8f();});});})[_0xbbec('0x17')](function(){return _0x3ee3b9[_0xbbec('0x75')](_0xd2a4e0,_0x34d09c,function(_0xc7fbf5){if(_0xc7fbf5){logger[_0xbbec('0x1c')]('err',_0xc7fbf5);}else{fs['unlinkSync'](_0xd2a4e0);}});});});}else{return _0x3ee3b9[_0xbbec('0x62')](0xc8);}})[_0xbbec('0x21')](handleError(_0x3ee3b9,null));};
\ No newline at end of file
+var _0xd6a8=['secret','appendFileSync','MailServerOut','Smtp','CloudProvider','getSmtpOptions','SendMail','sendMail','\x22%s\x22\x20<%s>','Mail\x20Transcript','Hi\x20%s,\x20attached\x20you\x20can\x20find\x20your\x20transcript\x20file.\x20\x0a\x0aRegards.\x20\x0a\x0a','addMessage','ids','getMessages','nolimit','sort','where','pick','ChatInteractionId','filter','$gte','YYYY-MM-DD\x20HH:mm:ss','rows','getMyMessages','options','includeAgent','push','alias','addTags','setTags','omit','Tag','emit','removeTags','toString','server','files','tmp','attachments','firstName','read','Account','Owner','Chat','browserName','referer','N.A.','createReadStream','pipe','createWriteStream','lastName','value','renderFile','views','downloadInteraction.ejs','transcript-','.pdf','createPdfFromHTML','err','unlinkSync','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','ejs','lodash','ioredis','../../components/interaction/service','../../components/parsers/qs','../../components/export/pdf','../../config/logger','api','../../config/environment','redis','defaults','./chatInteraction.socket','register','client','http','then','info','ChatInteraction,\x20%s,\x20%s','request\x20sent','debug','ChatInteraction,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','sendStatus','status','json','undefined','limit','count','offset','update','destroy','end','stack','name','merge','body','contact','agent','account','map','ChatInteraction','rawAttributes','fieldName','type','key','getOptions','findAll','chat','query','params','model','keys','filters','intersection','attributes','fields','length','includeAll','include','find','create','describe','createVidaooSession','findOne','ChatWebsite','ChatWebsiteId','vidaooApiKey','vidaooEscalation','vidaooNote','vidaooMetadata','user','fullname','email','https://api-vidaoo.xcally.com/api/v1/meetings','isNull','metadata','Sequelize','ValidationError','Error\x20in\x20Vidaoo\x20configuration','join_url','out','ChatMessage','Unable\x20to\x20create\x20Vidaoo\x20session','updateAttributes','customUpdate','Contact','abandonInteraction,\x20%s,\x20%s,\x20%s','entity\x20not\x20found','UserId','Interaction\x20already\x20assigned','closed','disposition','AbandonInteraction','abandon','attachmentUpload','originalname','basename','filename','mimetype','Attachment','attachmentDownload','Unauthorized','ChatOfflineMessageId','join','root','offline-chat/','download','close','mailTranscript','server/files/chat/upload/','format','now','pathTranscript','Messages','User','CmContact','ContactId','%s%d','agentAlias','System','customer','Visitor','agentIdentifier','agent_alias','agent_fullname','createdAt','MM/DD/YYYY\x20HH:mm:ss','direction'];(function(_0x16db8b,_0xca7d28){var _0x5ba017=function(_0x35b933){while(--_0x35b933){_0x16db8b['push'](_0x16db8b['shift']());}};_0x5ba017(++_0xca7d28);}(_0xd6a8,0x104));var _0x8d6a=function(_0x806639,_0x4e66d1){_0x806639=_0x806639-0x0;var _0x2c99c0=_0xd6a8[_0x806639];return _0x2c99c0;};'use strict';var rimraf=require(_0x8d6a('0x0'));var zipdir=require(_0x8d6a('0x1'));var rp=require(_0x8d6a('0x2'));var moment=require(_0x8d6a('0x3'));var BPromise=require(_0x8d6a('0x4'));var Mustache=require(_0x8d6a('0x5'));var util=require(_0x8d6a('0x6'));var path=require('path');var ejs=require(_0x8d6a('0x7'));var fs=require('fs');var _=require(_0x8d6a('0x8'));var Redis=require(_0x8d6a('0x9'));var interaction=require(_0x8d6a('0xa'));var qs=require(_0x8d6a('0xb'));var pdf=require(_0x8d6a('0xc'));var logger=require(_0x8d6a('0xd'))(_0x8d6a('0xe'));var config=require(_0x8d6a('0xf'));var db=require('../../mysqldb')['db'];config[_0x8d6a('0x10')]=_[_0x8d6a('0x11')](config['redis'],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x8d6a('0x10')]));require(_0x8d6a('0x12'))[_0x8d6a('0x13')](socket);var jayson=require('jayson/promise');var client=jayson[_0x8d6a('0x14')][_0x8d6a('0x15')]({'port':0x232b});var client9004=jayson[_0x8d6a('0x14')][_0x8d6a('0x15')]({'port':0x232c});function respondWithRpcPromise(_0x1bc985,_0x41316e,_0x449772,_0x3aa064){return new BPromise(function(_0x23b177,_0x3b03cb){var _0x1987a1=_0x3aa064||client;return _0x1987a1['request'](_0x1bc985,_0x449772)[_0x8d6a('0x16')](function(_0x2bf477){logger[_0x8d6a('0x17')](_0x8d6a('0x18'),_0x41316e,_0x8d6a('0x19'));logger[_0x8d6a('0x1a')](_0x8d6a('0x1b'),_0x41316e,'request\x20sent',JSON[_0x8d6a('0x1c')](_0x2bf477));if(_0x2bf477[_0x8d6a('0x1d')]){if(_0x2bf477[_0x8d6a('0x1d')][_0x8d6a('0x1e')]===0x1f4){logger[_0x8d6a('0x1d')]('ChatInteraction,\x20%s,\x20%s',_0x41316e,_0x2bf477['error']['message']);return _0x3b03cb(_0x2bf477[_0x8d6a('0x1d')][_0x8d6a('0x1f')]);}logger['error'](_0x8d6a('0x18'),_0x41316e,_0x2bf477['error'][_0x8d6a('0x1f')]);return _0x23b177(_0x2bf477[_0x8d6a('0x1d')][_0x8d6a('0x1f')]);}else{logger[_0x8d6a('0x17')](_0x8d6a('0x18'),_0x41316e,_0x8d6a('0x19'));_0x23b177(_0x2bf477[_0x8d6a('0x20')][_0x8d6a('0x1f')]);}})[_0x8d6a('0x21')](function(_0x47db33){logger[_0x8d6a('0x1d')](_0x8d6a('0x18'),_0x41316e,_0x47db33);_0x3b03cb(_0x47db33);});});}function respondWithStatusCode(_0x5b576c,_0x25d02d){_0x25d02d=_0x25d02d||0xcc;return function(_0x783a6b){if(_0x783a6b){return _0x5b576c[_0x8d6a('0x22')](_0x25d02d);}return _0x5b576c[_0x8d6a('0x23')](_0x25d02d)['end']();};}function respondWithResult(_0x50610c,_0x14d3da){_0x14d3da=_0x14d3da||0xc8;return function(_0x272b61){if(_0x272b61){return _0x50610c['status'](_0x14d3da)[_0x8d6a('0x24')](_0x272b61);}};}function respondWithFilteredResult(_0x1d736d,_0x334555){return function(_0x7f5374){if(_0x7f5374){var _0x357159=typeof _0x334555['offset']===_0x8d6a('0x25')&&typeof _0x334555[_0x8d6a('0x26')]===_0x8d6a('0x25');var _0x3befae=_0x7f5374[_0x8d6a('0x27')];var _0x18d4b3=_0x357159?0x0:_0x334555[_0x8d6a('0x28')];var _0x4a33c5=_0x357159?_0x7f5374[_0x8d6a('0x27')]:_0x334555['offset']+_0x334555['limit'];var _0x13143d;if(_0x4a33c5>=_0x3befae){_0x4a33c5=_0x3befae;_0x13143d=0xc8;}else{_0x13143d=0xce;}_0x1d736d[_0x8d6a('0x23')](_0x13143d);return _0x1d736d['set']('Content-Range',_0x18d4b3+'-'+_0x4a33c5+'/'+_0x3befae)[_0x8d6a('0x24')](_0x7f5374);}return null;};}function saveUpdates(_0xab4786){return function(_0x1bdd7d){if(_0x1bdd7d){return _0x1bdd7d[_0x8d6a('0x29')](_0xab4786)[_0x8d6a('0x16')](function(_0x30cc25){return _0x30cc25;});}return null;};}function removeEntity(_0x224d55){return function(_0x1d1ab3){if(_0x1d1ab3){return _0x1d1ab3[_0x8d6a('0x2a')]()[_0x8d6a('0x16')](function(){_0x224d55[_0x8d6a('0x23')](0xcc)[_0x8d6a('0x2b')]();});}};}function handleEntityNotFound(_0x45550e){return function(_0x168727){if(!_0x168727){_0x45550e[_0x8d6a('0x22')](0x194);}return _0x168727;};}function handleError(_0xf4a341,_0x67e11d){_0x67e11d=_0x67e11d||0x1f4;return function(_0x495763){logger[_0x8d6a('0x1d')](_0x495763[_0x8d6a('0x2c')]);if(_0x495763[_0x8d6a('0x2d')]){delete _0x495763['name'];}_0xf4a341[_0x8d6a('0x23')](_0x67e11d)['send'](_0x495763);};}function getMustacheRender(_0x1c10b3,_0x272eb5){return Mustache['render'](_0x1c10b3,_[_0x8d6a('0x2e')](_0x272eb5[_0x8d6a('0x2f')],{'contact':_0x272eb5[_0x8d6a('0x30')],'message':_0x272eb5[_0x8d6a('0x1f')],'agent':_0x272eb5[_0x8d6a('0x31')],'interaction':_0x272eb5['interaction'],'account':_0x272eb5[_0x8d6a('0x32')]}))||'';}exports['index']=function(_0x3086d6,_0x25be80){var _0x149b3a={};var _0x47c5e8=_[_0x8d6a('0x33')](db[_0x8d6a('0x34')][_0x8d6a('0x35')],function(_0x23c071){return{'name':_0x23c071[_0x8d6a('0x36')],'type':_0x23c071[_0x8d6a('0x37')][_0x8d6a('0x38')]};});_0x149b3a=qs[_0x8d6a('0x39')](_0x47c5e8,_0x3086d6);return interaction[_0x8d6a('0x3a')](_0x8d6a('0x3b'),_0x3086d6[_0x8d6a('0x3c')],_0x3086d6['user'],_0x149b3a,_0x47c5e8)['then'](respondWithFilteredResult(_0x25be80,_0x149b3a))[_0x8d6a('0x21')](handleError(_0x25be80,null));};exports['show']=function(_0x3408c0,_0x2d9015){var _0x25f8fa={'raw':![],'where':{'id':_0x3408c0[_0x8d6a('0x3d')]['id']}},_0x2a4627={};_0x2a4627[_0x8d6a('0x3e')]=_[_0x8d6a('0x3f')](db[_0x8d6a('0x34')]['rawAttributes']);_0x2a4627['query']=_[_0x8d6a('0x3f')](_0x3408c0[_0x8d6a('0x3c')]);_0x2a4627[_0x8d6a('0x40')]=_[_0x8d6a('0x41')](_0x2a4627[_0x8d6a('0x3e')],_0x2a4627['query']);_0x25f8fa[_0x8d6a('0x42')]=_[_0x8d6a('0x41')](_0x2a4627['model'],qs['fields'](_0x3408c0[_0x8d6a('0x3c')][_0x8d6a('0x43')]));_0x25f8fa[_0x8d6a('0x42')]=_0x25f8fa[_0x8d6a('0x42')][_0x8d6a('0x44')]?_0x25f8fa['attributes']:_0x2a4627['model'];if(_0x3408c0[_0x8d6a('0x3c')][_0x8d6a('0x45')]){_0x25f8fa[_0x8d6a('0x46')]=[{'all':!![]}];}_0x25f8fa=_[_0x8d6a('0x2e')]({},_0x25f8fa,_0x3408c0['options']);return db[_0x8d6a('0x34')][_0x8d6a('0x47')](_0x25f8fa)[_0x8d6a('0x16')](handleEntityNotFound(_0x2d9015,null))[_0x8d6a('0x16')](respondWithResult(_0x2d9015,null))[_0x8d6a('0x21')](handleError(_0x2d9015,null));};exports[_0x8d6a('0x48')]=function(_0x407abf,_0x4c1fef){return db[_0x8d6a('0x34')][_0x8d6a('0x48')](_0x407abf['body'],{})[_0x8d6a('0x16')](respondWithResult(_0x4c1fef,0xc9))[_0x8d6a('0x21')](handleError(_0x4c1fef,null));};exports[_0x8d6a('0x29')]=function(_0x5d620c,_0x2eeccc){if(_0x5d620c[_0x8d6a('0x2f')]['id']){delete _0x5d620c[_0x8d6a('0x2f')]['id'];}return db[_0x8d6a('0x34')][_0x8d6a('0x47')]({'where':{'id':_0x5d620c[_0x8d6a('0x3d')]['id']}})[_0x8d6a('0x16')](handleEntityNotFound(_0x2eeccc,null))['then'](saveUpdates(_0x5d620c[_0x8d6a('0x2f')],null))[_0x8d6a('0x16')](respondWithResult(_0x2eeccc,null))['catch'](handleError(_0x2eeccc,null));};exports[_0x8d6a('0x2a')]=function(_0x388a03,_0x5abd93){return db[_0x8d6a('0x34')][_0x8d6a('0x47')]({'where':{'id':_0x388a03[_0x8d6a('0x3d')]['id']}})['then'](handleEntityNotFound(_0x5abd93,null))[_0x8d6a('0x16')](removeEntity(_0x5abd93,null))[_0x8d6a('0x21')](handleError(_0x5abd93,null));};exports[_0x8d6a('0x49')]=function(_0x3f8814,_0x929f40){return db[_0x8d6a('0x34')]['describe']()[_0x8d6a('0x16')](respondWithResult(_0x929f40,null))[_0x8d6a('0x21')](handleError(_0x929f40,null));};exports[_0x8d6a('0x4a')]=function(_0xf651d3,_0x3f5dc4){var _0x4b90fa=_0xf651d3[_0x8d6a('0x3d')]['id'];var _0x34f240;var _0x91eed9;var _0x2eb57d;return db[_0x8d6a('0x34')][_0x8d6a('0x4b')]({'where':{'id':_0x4b90fa}})[_0x8d6a('0x16')](function(_0x46a825){_0x34f240=_0x46a825;return db[_0x8d6a('0x4c')][_0x8d6a('0x4b')]({'where':{'id':_0x46a825[_0x8d6a('0x4d')]},'attributes':['id',_0x8d6a('0x4e'),_0x8d6a('0x4f'),'vidaooTopic',_0x8d6a('0x50'),_0x8d6a('0x51')],'raw':!![]});})[_0x8d6a('0x16')](function(_0x1a34ad){if(_0x1a34ad&&_0x1a34ad[_0x8d6a('0x4e')]&&_0x1a34ad[_0x8d6a('0x4f')]){_0x91eed9=_0x1a34ad;var _0x5a5d3b={'interaction':{'id':_0x4b90fa},'agent':{'id':_0xf651d3[_0x8d6a('0x52')]['id'],'name':_0xf651d3['user']['name'],'fullname':_0xf651d3[_0x8d6a('0x52')][_0x8d6a('0x53')],'email':_0xf651d3[_0x8d6a('0x52')][_0x8d6a('0x54')]},'contact':_0xf651d3[_0x8d6a('0x2f')][_0x8d6a('0x30')],'account':_0xf651d3[_0x8d6a('0x2f')][_0x8d6a('0x32')]};var _0xe1b000={'rejectUnauthorized':![],'method':'POST','url':_0x8d6a('0x55'),'headers':{'X-APIKEY':_0x1a34ad[_0x8d6a('0x4e')]},'body':{'duration':null,'scheduledAt':null,'participants':[_0xf651d3[_0x8d6a('0x52')][_0x8d6a('0x54')]],'buttons':null,'topic':_0x91eed9['vidaooTopic'],'note':_[_0x8d6a('0x56')](_0x91eed9[_0x8d6a('0x50')])?null:getMustacheRender(_0x91eed9['vidaooNote'],_0x5a5d3b),'metadata':null},'redirect':'follow','json':!![]};try{if(!_[_0x8d6a('0x56')](_0x91eed9[_0x8d6a('0x51')])){var _0x54f03c=getMustacheRender(_0x91eed9[_0x8d6a('0x51')],_0x5a5d3b);var _0x1c5a6d=JSON['parse'](_0x54f03c);_0xe1b000['body'][_0x8d6a('0x57')]=_0x1c5a6d;}}catch(_0x1754d1){throw new db['Sequelize']['ValidationError']('Error\x20in\x20conversion\x20vidaooMetadata');}return rp(_0xe1b000);}else{throw new db[(_0x8d6a('0x58'))][(_0x8d6a('0x59'))](_0x8d6a('0x5a'));}})[_0x8d6a('0x16')](function(_0x3f45be){_0x2eb57d=_0x3f45be;if(_0x2eb57d['id']){var _0x4aafd0={'body':_0x2eb57d[_0x8d6a('0x5b')],'ChatWebsiteId':_0x91eed9['id'],'ChatInteractionId':_0x34f240['id'],'direction':_0x8d6a('0x5c'),'UserId':_0xf651d3[_0x8d6a('0x52')]['id']};return db[_0x8d6a('0x5d')][_0x8d6a('0x48')](_0x4aafd0,{});}else{throw new db[(_0x8d6a('0x58'))]['ValidationError'](_0x8d6a('0x5e'));}})[_0x8d6a('0x16')](function(){return _0x34f240[_0x8d6a('0x5f')]({'vidaooSessionId':_0x2eb57d['id']});})[_0x8d6a('0x16')](respondWithResult(_0x3f5dc4,null))[_0x8d6a('0x21')](handleError(_0x3f5dc4,null));};exports[_0x8d6a('0x60')]=function(_0x2540ce,_0x3fab02){if(_0x2540ce[_0x8d6a('0x2f')]['id']){delete _0x2540ce[_0x8d6a('0x2f')]['id'];}return db['ChatInteraction'][_0x8d6a('0x47')]({'where':{'id':_0x2540ce[_0x8d6a('0x3d')]['id']},'include':[{'model':db['CmContact'],'as':_0x8d6a('0x61')}]})['then'](handleEntityNotFound(_0x3fab02,null))[_0x8d6a('0x16')](saveUpdates(_0x2540ce[_0x8d6a('0x2f')],null))[_0x8d6a('0x16')](respondWithResult(_0x3fab02,null))[_0x8d6a('0x21')](handleError(_0x3fab02,null));};exports['abandon']=function(_0x507f56,_0x1a371f){if(_0x507f56[_0x8d6a('0x2f')]['id']){delete _0x507f56[_0x8d6a('0x2f')]['id'];}return db[_0x8d6a('0x34')][_0x8d6a('0x47')]({'where':{'id':_0x507f56['params']['id']}})['then'](function(_0x3e5a17){if(!_0x3e5a17){logger[_0x8d6a('0x1d')](_0x8d6a('0x62'),'abandon',0x194,_0x8d6a('0x63'));_0x1a371f['sendStatus'](0x194);}else{if(_0x3e5a17[_0x8d6a('0x64')]){throw new db['Sequelize'][(_0x8d6a('0x59'))](_0x8d6a('0x65'));}}return _0x3e5a17;})[_0x8d6a('0x16')](function(_0x4d0470){if(_0x4d0470){return _0x4d0470[_0x8d6a('0x29')]({'closed':_0x507f56[_0x8d6a('0x2f')][_0x8d6a('0x66')],'disposition':_0x507f56[_0x8d6a('0x2f')][_0x8d6a('0x67')]})[_0x8d6a('0x16')](function(_0x7bd077){return _0x7bd077;});}})[_0x8d6a('0x16')](function(){return respondWithRpcPromise(_0x8d6a('0x68'),_0x8d6a('0x69'),_0x507f56[_0x8d6a('0x2f')],client9004);})['then'](respondWithResult(_0x1a371f,null))[_0x8d6a('0x21')](handleError(_0x1a371f,null));};exports[_0x8d6a('0x6a')]=function(_0x56d4ab,_0x48342c){_0x56d4ab['body'][_0x8d6a('0x2d')]=_0x56d4ab['file'][_0x8d6a('0x6b')];_0x56d4ab[_0x8d6a('0x2f')][_0x8d6a('0x6c')]=_0x56d4ab['file'][_0x8d6a('0x6d')];_0x56d4ab[_0x8d6a('0x2f')][_0x8d6a('0x37')]=_0x56d4ab['file'][_0x8d6a('0x6e')];return db[_0x8d6a('0x6f')][_0x8d6a('0x48')](_0x56d4ab[_0x8d6a('0x2f')])[_0x8d6a('0x16')](respondWithResult(_0x48342c,0xc9))[_0x8d6a('0x21')](handleError(_0x48342c,null));};exports[_0x8d6a('0x70')]=function(_0x1ffcb7,_0x2e6e3f){return db['ChatInteraction'][_0x8d6a('0x4b')]({'where':{'id':_0x1ffcb7[_0x8d6a('0x3d')]['id']},'raw':!![]})[_0x8d6a('0x16')](handleEntityNotFound(_0x2e6e3f,null))['then'](function(_0x273de1){if(_0x273de1){if(_0x273de1[_0x8d6a('0x66')]){return _0x2e6e3f['status'](0x193)['json']({'status':0x193,'message':_0x8d6a('0x71')});}return db[_0x8d6a('0x6f')][_0x8d6a('0x4b')]({'where':{'id':_0x1ffcb7[_0x8d6a('0x3c')]['attachId']},'raw':!![]})[_0x8d6a('0x16')](handleEntityNotFound(_0x2e6e3f,null));}})[_0x8d6a('0x16')](function(_0xfca71f){if(_0xfca71f){var _0x1a40af=_0xfca71f[_0x8d6a('0x72')]!==null;var _0x7e2006=path[_0x8d6a('0x73')](config[_0x8d6a('0x74')],'server/files/attachments/');if(_0x1a40af){_0x7e2006=path[_0x8d6a('0x73')](_0x7e2006,_0x8d6a('0x75'));}var _0x11aac7=path['join'](_0x7e2006,_0xfca71f['basename']);return _0x2e6e3f[_0x8d6a('0x76')](_0x11aac7);}})[_0x8d6a('0x21')](handleError(_0x2e6e3f,null));};exports[_0x8d6a('0x77')]=function(_0x519346,_0x1375d1){var _0x48a687=null;var _0x5b6c42=null;var _0xdd0de9=null;if(_0x519346[_0x8d6a('0x2f')]['id']){delete _0x519346[_0x8d6a('0x2f')]['id'];}if(_0x519346[_0x8d6a('0x2f')][_0x8d6a('0x78')]){_0xdd0de9=path['join'](config[_0x8d6a('0x74')],_0x8d6a('0x79'),util[_0x8d6a('0x7a')]('transcript-%s.txt',Date[_0x8d6a('0x7b')]()));_0x519346[_0x8d6a('0x2f')][_0x8d6a('0x7c')]=_0xdd0de9;}return db[_0x8d6a('0x34')][_0x8d6a('0x47')]({'where':{'id':_0x519346['params']['id']},'include':[{'model':db[_0x8d6a('0x5d')],'as':_0x8d6a('0x7d'),'include':[{'model':db[_0x8d6a('0x7e')],'as':'User'}]}]})[_0x8d6a('0x16')](handleEntityNotFound(_0x1375d1,null))[_0x8d6a('0x16')](saveUpdates(_0x519346['body'],null))[_0x8d6a('0x16')](function(_0x34490c){if(_0x34490c){_0x48a687=_0x34490c;return db[_0x8d6a('0x4c')][_0x8d6a('0x47')]({'where':{'id':_0x48a687['ChatWebsiteId']}});}})['then'](function(_0x3a6e07){if(_0x3a6e07){_0x5b6c42=_0x3a6e07;return db[_0x8d6a('0x7f')][_0x8d6a('0x47')]({'where':{'id':_0x48a687[_0x8d6a('0x80')]}});}})[_0x8d6a('0x16')](function(_0x240bac){if(_0x240bac){if(_0xdd0de9){var _0x1af333=null;for(var _0xdbc3f=0x1;_0xdbc3f<_0x48a687[_0x8d6a('0x7d')]['length'];++_0xdbc3f){_0x1af333=_0x48a687[_0x8d6a('0x7d')][_0xdbc3f];var _0xd5e069=_0x1af333[_0x8d6a('0x64')]?util[_0x8d6a('0x7a')](_0x8d6a('0x81'),_0x5b6c42[_0x8d6a('0x82')],_0x1af333['UserId']):_0x8d6a('0x83');var _0x3e00ba=_0x519346[_0x8d6a('0x2f')][_0x8d6a('0x84')]||util['format'](_0x8d6a('0x81'),_0x8d6a('0x85'),_0x1af333['ContactId']);switch(_0x5b6c42[_0x8d6a('0x86')]){case'website_alias':_0xd5e069=_0x1af333[_0x8d6a('0x64')]?util[_0x8d6a('0x7a')](_0x8d6a('0x81'),_0x5b6c42[_0x8d6a('0x82')],_0x1af333[_0x8d6a('0x64')]):_0x8d6a('0x83');break;case _0x8d6a('0x87'):_0xd5e069=_0x1af333['UserId']?_0x1af333[_0x8d6a('0x7e')]['alias']||_0x1af333[_0x8d6a('0x7e')]['fullname']:'System';break;case _0x8d6a('0x88'):_0xd5e069=_0x1af333[_0x8d6a('0x64')]?_0x1af333[_0x8d6a('0x7e')][_0x8d6a('0x53')]:_0x8d6a('0x83');break;default:_0xd5e069=_0x1af333[_0x8d6a('0x64')]?util['format'](_0x8d6a('0x81'),_0x5b6c42['agentAlias'],_0x1af333[_0x8d6a('0x64')]):'System';}var _0x42e4ec=util['format']('[%s]\x20%s:\x20%s\x0a',moment(_0x1af333[_0x8d6a('0x89')])[_0x8d6a('0x7a')](_0x8d6a('0x8a')),_0x1af333[_0x8d6a('0x8b')]==='in'?_0x3e00ba:_0xd5e069,_0x1af333[_0x8d6a('0x2f')]);if(!_0x1af333[_0x8d6a('0x8c')]){fs[_0x8d6a('0x8d')](_0xdd0de9,_0x42e4ec);}}return db['MailAccount']['findOne']({'where':{'service':!![]},'include':[{'model':db[_0x8d6a('0x8e')],'as':_0x8d6a('0x8f'),'raw':!![],'include':[{'model':db[_0x8d6a('0x90')],'as':_0x8d6a('0x90'),'raw':!![]}]}]});}}})['then'](function(_0x212588){if(!_0x212588||!_0x212588[_0x8d6a('0x8f')]||!_0x519346[_0x8d6a('0x2f')])return _0x48a687;var _0x29cd99=_0x212588[_0x8d6a('0x91')]();return respondWithRpcPromise(_0x8d6a('0x92'),_0x8d6a('0x93'),{'account':_0x29cd99,'message':{'from':util[_0x8d6a('0x7a')](_0x8d6a('0x94'),_0x212588['name'],_0x212588[_0x8d6a('0x54')]||_0x212588[_0x8d6a('0x8f')][_0x8d6a('0x52')]),'to':_0x519346[_0x8d6a('0x2f')][_0x8d6a('0x78')],'subject':_0x8d6a('0x95'),'text':util[_0x8d6a('0x7a')](_0x8d6a('0x96'),_0x519346[_0x8d6a('0x2f')][_0x8d6a('0x78')]),'attachments':[{'path':_0xdd0de9}]}})[_0x8d6a('0x16')](function(){return _0x48a687;})[_0x8d6a('0x21')](function(_0x528e55){logger[_0x8d6a('0x1d')](_0x528e55);});})[_0x8d6a('0x16')](respondWithStatusCode(_0x1375d1,0xc8))[_0x8d6a('0x21')](handleError(_0x1375d1,null));};exports['addMessage']=function(_0x8f37a6,_0x22f18e){return db[_0x8d6a('0x5d')]['find']({'where':{'id':_0x8f37a6[_0x8d6a('0x3d')]['id']}})[_0x8d6a('0x16')](handleEntityNotFound(_0x22f18e,null))[_0x8d6a('0x16')](function(_0x4f1984){if(_0x4f1984){return _0x4f1984[_0x8d6a('0x97')](_0x8f37a6[_0x8d6a('0x2f')][_0x8d6a('0x98')],_['omit'](_0x8f37a6[_0x8d6a('0x2f')],[_0x8d6a('0x98'),'id'])||{});}})[_0x8d6a('0x16')](respondWithResult(_0x22f18e,null))[_0x8d6a('0x21')](handleError(_0x22f18e,null));};exports[_0x8d6a('0x99')]=function(_0x44aa55,_0xf9ea87){var _0x25a131={'raw':![],'where':{}};var _0x4c4851={};var _0xf853b7={'count':0x0,'rows':[]};return db[_0x8d6a('0x34')][_0x8d6a('0x4b')]({'where':{'id':_0x44aa55['params']['id']}})[_0x8d6a('0x16')](handleEntityNotFound(_0xf9ea87,null))[_0x8d6a('0x16')](function(_0x110868){if(_0x110868){_0x4c4851[_0x8d6a('0x3e')]=_[_0x8d6a('0x3f')](db[_0x8d6a('0x5d')][_0x8d6a('0x35')]);_0x4c4851['query']=_[_0x8d6a('0x3f')](_0x44aa55[_0x8d6a('0x3c')]);_0x4c4851['filters']=_[_0x8d6a('0x41')](_0x4c4851['model'],_0x4c4851[_0x8d6a('0x3c')]);_0x25a131[_0x8d6a('0x42')]=_[_0x8d6a('0x41')](_0x4c4851[_0x8d6a('0x3e')],qs['fields'](_0x44aa55[_0x8d6a('0x3c')]['fields']));_0x25a131[_0x8d6a('0x42')]=_0x25a131['attributes'][_0x8d6a('0x44')]?_0x25a131[_0x8d6a('0x42')]:_0x4c4851['model'];if(!_0x44aa55[_0x8d6a('0x3c')]['hasOwnProperty'](_0x8d6a('0x9a'))){_0x25a131['limit']=qs['limit'](_0x44aa55['query']['limit']);_0x25a131[_0x8d6a('0x28')]=qs['offset'](_0x44aa55[_0x8d6a('0x3c')]['offset']);}_0x25a131['order']=qs[_0x8d6a('0x9b')](_0x44aa55[_0x8d6a('0x3c')][_0x8d6a('0x9b')]);_0x25a131[_0x8d6a('0x9c')]=qs['filters'](_[_0x8d6a('0x9d')](_0x44aa55[_0x8d6a('0x3c')],_0x4c4851['filters']));_0x25a131['where'][_0x8d6a('0x9e')]=_0x110868['id'];if(_0x44aa55['query'][_0x8d6a('0x9f')]){_0x25a131[_0x8d6a('0x9c')]=_[_0x8d6a('0x2e')](_0x25a131[_0x8d6a('0x9c')],{'$or':_[_0x8d6a('0x33')](_0x25a131['attributes'],function(_0xba86f9){var _0x5d4ffa={};_0x5d4ffa[_0xba86f9]={'$like':'%'+_0x44aa55[_0x8d6a('0x3c')]['filter']+'%'};return _0x5d4ffa;})});}if(_0x44aa55[_0x8d6a('0x3c')][_0x8d6a('0xa0')]){var _0x29e33e=_0x44aa55[_0x8d6a('0x3c')][_0x8d6a('0xa0')]['split'](',');var _0x4237a4={};_0x4237a4[_0x29e33e[0x0]]={'$gte':moment(_0x29e33e[0x1])[_0x8d6a('0x7a')](_0x8d6a('0xa1'))};_0x25a131[_0x8d6a('0x9c')]=_[_0x8d6a('0x2e')](_0x25a131['where'],_0x4237a4);}_0x25a131=_[_0x8d6a('0x2e')]({},_0x25a131,_0x44aa55['options']);return db[_0x8d6a('0x5d')][_0x8d6a('0x27')]({'where':_0x25a131[_0x8d6a('0x9c')]})['then'](function(_0x3d9467){_0xf853b7[_0x8d6a('0x27')]=_0x3d9467;if(_0x44aa55[_0x8d6a('0x3c')][_0x8d6a('0x45')]){_0x25a131['include']=[{'all':!![]}];}return db[_0x8d6a('0x5d')][_0x8d6a('0x3a')](_0x25a131);})[_0x8d6a('0x16')](function(_0x310cd9){_0xf853b7[_0x8d6a('0xa2')]=_0x310cd9;return _0xf853b7;});}})[_0x8d6a('0x16')](respondWithFilteredResult(_0xf9ea87,_0x25a131))[_0x8d6a('0x21')](handleError(_0xf9ea87,null));};exports[_0x8d6a('0xa3')]=function(_0x4b4560,_0x3307c3){var _0xdb1498={'where':{}},_0x1d69c6={},_0x3a6ca9={'count':0x0,'rows':[]};return db[_0x8d6a('0x34')][_0x8d6a('0x4b')]({'where':{'id':_0x4b4560[_0x8d6a('0x3d')]['id']}})[_0x8d6a('0x16')](handleEntityNotFound(_0x3307c3,null))[_0x8d6a('0x16')](function(_0x3cb9fa){if(_0x3cb9fa){_0x1d69c6[_0x8d6a('0x3e')]=_[_0x8d6a('0x3f')](db['ChatMessage'][_0x8d6a('0x35')]);_0x1d69c6[_0x8d6a('0x3c')]=_[_0x8d6a('0x3f')](_0x4b4560[_0x8d6a('0x3c')]);_0x1d69c6[_0x8d6a('0x40')]=_[_0x8d6a('0x41')](_0x1d69c6[_0x8d6a('0x3e')],_0x1d69c6[_0x8d6a('0x3c')]);_0xdb1498['attributes']=_[_0x8d6a('0x41')](_0x1d69c6[_0x8d6a('0x3e')],qs[_0x8d6a('0x43')](_0x4b4560[_0x8d6a('0x3c')][_0x8d6a('0x43')]));_0xdb1498[_0x8d6a('0x42')]=_0xdb1498[_0x8d6a('0x42')][_0x8d6a('0x44')]?_0xdb1498[_0x8d6a('0x42')]:_0x1d69c6[_0x8d6a('0x3e')];if(!_0x4b4560[_0x8d6a('0x3c')]['hasOwnProperty'](_0x8d6a('0x9a'))){_0xdb1498[_0x8d6a('0x26')]=qs[_0x8d6a('0x26')](_0x4b4560[_0x8d6a('0x3c')][_0x8d6a('0x26')]);_0xdb1498[_0x8d6a('0x28')]=qs[_0x8d6a('0x28')](_0x4b4560[_0x8d6a('0x3c')]['offset']);}_0xdb1498['order']=qs[_0x8d6a('0x9b')](_0x4b4560[_0x8d6a('0x3c')][_0x8d6a('0x9b')]);_0xdb1498[_0x8d6a('0x9c')]=qs[_0x8d6a('0x40')](_[_0x8d6a('0x9d')](_0x4b4560[_0x8d6a('0x3c')],_0x1d69c6[_0x8d6a('0x40')]));_0xdb1498['where'][_0x8d6a('0x9e')]=_0x3cb9fa['id'];if(_0x4b4560[_0x8d6a('0x3c')][_0x8d6a('0x9f')]){_0xdb1498[_0x8d6a('0x9c')]=_['merge'](_0xdb1498['where'],{'$or':_['map'](_0xdb1498[_0x8d6a('0x42')],function(_0x15493a){var _0x56073f={};_0x56073f[_0x15493a]={'$like':'%'+_0x4b4560[_0x8d6a('0x3c')]['filter']+'%'};return _0x56073f;})});}_0xdb1498[_0x8d6a('0x9c')][_0x8d6a('0x8c')]=![];if(_0x4b4560['query']['id']){_0xdb1498[_0x8d6a('0x9c')]['id']={'$gt':_0x4b4560[_0x8d6a('0x3c')]['id']};}_0xdb1498=_['merge']({},_0xdb1498,_0x4b4560[_0x8d6a('0xa4')]);return db['ChatMessage']['count']({'where':_0xdb1498['where']})['then'](function(_0x21fb79){_0x3a6ca9[_0x8d6a('0x27')]=_0x21fb79;_0xdb1498['include']=[];if(_0x4b4560['query'][_0x8d6a('0xa5')]){_0xdb1498[_0x8d6a('0x46')][_0x8d6a('0xa6')]({'model':db[_0x8d6a('0x7e')],'as':_0x8d6a('0x7e'),'attributes':['id',_0x8d6a('0x53'),_0x8d6a('0xa7')]});}if(_0x4b4560[_0x8d6a('0x3c')][_0x8d6a('0x45')]){_0xdb1498[_0x8d6a('0x46')]=[{'all':!![]}];}return db[_0x8d6a('0x5d')][_0x8d6a('0x3a')](_0xdb1498);})[_0x8d6a('0x16')](function(_0x5eb818){_0x3a6ca9['rows']=_0x5eb818;return _0x3a6ca9;});}})[_0x8d6a('0x16')](respondWithFilteredResult(_0x3307c3,_0xdb1498))[_0x8d6a('0x21')](handleError(_0x3307c3,null));};exports[_0x8d6a('0xa8')]=function(_0x4c20c7,_0x110a3e){return db[_0x8d6a('0x34')][_0x8d6a('0x47')]({'where':{'id':_0x4c20c7['params']['id']}})[_0x8d6a('0x16')](handleEntityNotFound(_0x110a3e,null))['then'](function(_0x224960){if(_0x224960){return _0x224960[_0x8d6a('0xa9')](_0x4c20c7[_0x8d6a('0x2f')][_0x8d6a('0x98')],_[_0x8d6a('0xaa')](_0x4c20c7[_0x8d6a('0x2f')],[_0x8d6a('0x98'),'id'])||{})['spread'](function(){return db[_0x8d6a('0xab')]['findAll']({'attributes':['id',_0x8d6a('0x2d'),'color'],'where':{'id':_0x4c20c7[_0x8d6a('0x2f')][_0x8d6a('0x98')]}});})[_0x8d6a('0x16')](function(_0x39962c){socket[_0x8d6a('0xac')]('chatInteractionTags:save',{'id':Number(_0x4c20c7[_0x8d6a('0x3d')]['id']),'tags':_0x39962c||[]});return{'id':Number(_0x4c20c7['params']['id']),'tags':_0x39962c||[]};});}})['then'](respondWithResult(_0x110a3e,null))[_0x8d6a('0x21')](handleError(_0x110a3e,null));};exports[_0x8d6a('0xad')]=function(_0x5dc93b,_0x580419){return db[_0x8d6a('0x34')][_0x8d6a('0x47')]({'where':{'id':_0x5dc93b[_0x8d6a('0x3d')]['id']}})[_0x8d6a('0x16')](handleEntityNotFound(_0x580419,null))[_0x8d6a('0x16')](function(_0x26743a){if(_0x26743a){return _0x26743a['removeTags'](_0x5dc93b[_0x8d6a('0x3c')]['ids']);}})['then'](respondWithStatusCode(_0x580419,null))[_0x8d6a('0x21')](handleError(_0x580419,null));};exports[_0x8d6a('0x76')]=function(_0x52c16d,_0x27c3b4){var _0x1628d6=moment()['unix']()[_0x8d6a('0xae')]();var _0x470841=path[_0x8d6a('0x73')](config['root'],_0x8d6a('0xaf'),_0x8d6a('0xb0'),_0x8d6a('0xb1'));var _0x22b2a3=path[_0x8d6a('0x73')](config[_0x8d6a('0x74')],'server','files',_0x8d6a('0xb2'));var _0x5b0211=path['join'](_0x470841,_0x1628d6);var _0x19330f=util[_0x8d6a('0x7a')]('transcript-%d-%s.zip',_0x52c16d['params']['id'],_0x1628d6);var _0x15445e=path['join'](_0x470841,_0x19330f);var _0x128d52=[];_0x128d52[_0x8d6a('0xa6')]({'model':db[_0x8d6a('0x7e')],'as':_0x8d6a('0x7e'),'attributes':['id','fullname'],'raw':!![]});_0x128d52['push']({'model':db[_0x8d6a('0x7f')],'as':_0x8d6a('0x61'),'attributes':['id',_0x8d6a('0xb3'),'lastName'],'raw':!![]});if(_0x52c16d[_0x8d6a('0x3c')][_0x8d6a('0xb2')]){_0x128d52['push']({'model':db[_0x8d6a('0x6f')],'as':'Attachment','raw':!![]});}var _0x439ce8=[{'model':db['ChatMessage'],'as':'Messages','attributes':['id',_0x8d6a('0x2f'),'createdAt',_0x8d6a('0x8b'),_0x8d6a('0x8c'),_0x8d6a('0xb4')],'include':_0x128d52}];_0x439ce8['push']({'model':db[_0x8d6a('0x4c')],'as':_0x8d6a('0xb5'),'attributes':['id','name']});_0x439ce8[_0x8d6a('0xa6')]({'model':db[_0x8d6a('0x7e')],'as':_0x8d6a('0xb6'),'attributes':['id',_0x8d6a('0x53')]});return db[_0x8d6a('0x34')][_0x8d6a('0x47')]({'where':{'id':_0x52c16d[_0x8d6a('0x3d')]['id']},'include':_0x439ce8})[_0x8d6a('0x16')](handleEntityNotFound(_0x27c3b4,null))[_0x8d6a('0x16')](function(_0x192093){if(_0x192093){var _0x129528=_0x192093['get']({'plain':!![]});fs['mkdirSync'](_0x5b0211);var _0x5620f3={'channel':_0x8d6a('0xb7'),'account':_0x129528[_0x8d6a('0xb5')]['name'],'agent':_0x129528[_0x8d6a('0xb6')]?_0x129528[_0x8d6a('0xb6')]['fullname']:'N.A.','createdAt':moment(_0x129528[_0x8d6a('0x89')])['format'](_0x8d6a('0xa1'))[_0x8d6a('0xae')](),'closedAt':_0x129528[_0x8d6a('0x66')]?moment(_0x129528['closedAt'])[_0x8d6a('0x7a')](_0x8d6a('0xa1'))[_0x8d6a('0xae')]():'','disposition':_0x129528[_0x8d6a('0x67')],'chatInfo':{'browser':_0x129528[_0x8d6a('0xb8')],'os':_0x129528['osName'],'referer':_0x129528[_0x8d6a('0xb9')],'customerIp':_0x129528['customerIp'],'customerPort':_0x129528['customerPort']?_0x129528['customerPort']:_0x8d6a('0xba')},'messages':_(_0x129528[_0x8d6a('0x7d')])['tail']()['filter']({'secret':![]})[_0x8d6a('0x33')](function(_0x392b1c){if(_0x392b1c[_0x8d6a('0x6f')]){var _0x2ba28c=path['join'](_0x22b2a3,_0x392b1c[_0x8d6a('0x6f')]['basename']);if(fs['existsSync'](_0x2ba28c)){fs[_0x8d6a('0xbb')](_0x2ba28c)[_0x8d6a('0xbc')](fs[_0x8d6a('0xbd')](path[_0x8d6a('0x73')](_0x5b0211,_0x392b1c['Attachment']['basename'])));}}return{'date':moment(_0x392b1c[_0x8d6a('0x89')])[_0x8d6a('0x7a')](_0x8d6a('0xa1'))['toString'](),'sender':_0x392b1c['direction']==='out'?_0x392b1c['User']?_0x392b1c[_0x8d6a('0x7e')]['fullname']:_0x8d6a('0x83'):_0x392b1c[_0x8d6a('0x61')][_0x8d6a('0xb3')]+(_0x392b1c[_0x8d6a('0x61')][_0x8d6a('0xbe')]?'\x20'+_0x392b1c[_0x8d6a('0x61')]['lastName']:''),'body':_0x392b1c[_0x8d6a('0x6f')]?_0x392b1c[_0x8d6a('0x6f')]['basename']:_0x392b1c[_0x8d6a('0x2f')],'direction':_0x392b1c[_0x8d6a('0x8b')]===_0x8d6a('0x5c')?'A':'C','secret':_0x392b1c[_0x8d6a('0x8c')],'read':_0x392b1c[_0x8d6a('0xb4')],'attachment':_0x392b1c['Attachment']};})[_0x8d6a('0xbf')]()};return ejs[_0x8d6a('0xc0')](path[_0x8d6a('0x73')](config[_0x8d6a('0x74')],'server',_0x8d6a('0xc1'),_0x8d6a('0xc2')),{'interaction':_0x5620f3})['then'](function(_0xb953e5){var _0x15722a=path[_0x8d6a('0x73')](_0x5b0211,_0x8d6a('0xc3')+_0x129528['id']+'-'+_0x1628d6+_0x8d6a('0xc4'));var _0x408965={'path':_0x15722a,'channel':'Chat','interactionId':_0x129528['id']};return pdf[_0x8d6a('0xc5')](_0xb953e5,_0x408965);})[_0x8d6a('0x16')](function(){return new Promise(function(_0x57fd69,_0x373556){zipdir(_0x5b0211,{'saveTo':_0x15445e},function(_0x10644e,_0x33430a){if(_0x10644e)return _0x373556(_0x10644e);return _0x57fd69(_0x33430a);});})['then'](function(){return new BPromise(function(_0x5c9b20,_0x18baa5){rimraf(_0x5b0211,function(_0x1a75b6){if(_0x1a75b6)_0x18baa5(_0x1a75b6);return _0x5c9b20();});});})[_0x8d6a('0x16')](function(){return _0x27c3b4['download'](_0x15445e,_0x19330f,function(_0x4df17d){if(_0x4df17d){logger[_0x8d6a('0x1d')](_0x8d6a('0xc6'),_0x4df17d);}else{fs[_0x8d6a('0xc7')](_0x15445e);}});});});}else{return _0x27c3b4[_0x8d6a('0x22')](0xc8);}})[_0x8d6a('0x21')](handleError(_0x27c3b4,null));};
\ No newline at end of file
diff --git a/server/api/chatInteraction/chatInteraction.events.js b/server/api/chatInteraction/chatInteraction.events.js
index 5c518c8..b18679e 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 _0x0427=['getUsers','then','setDataValue','Users','map','emit','catch','hasOwnProperty','hook','events','../../mysqldb','ChatInteraction','ChatMessage','setMaxListeners','remove'];(function(_0x2dec86,_0x16cc68){var _0x496a2c=function(_0x16415c){while(--_0x16415c){_0x2dec86['push'](_0x2dec86['shift']());}};_0x496a2c(++_0x16cc68);}(_0x0427,0x162));var _0x7042=function(_0x240eaf,_0x52caf9){_0x240eaf=_0x240eaf-0x0;var _0x31415e=_0x0427[_0x240eaf];return _0x31415e;};'use strict';var EventEmitter=require(_0x7042('0x0'));var ChatInteraction=require(_0x7042('0x1'))['db'][_0x7042('0x2')];var ChatMessage=require('../../mysqldb')['db'][_0x7042('0x3')];var ChatInteractionEvents=new EventEmitter();ChatInteractionEvents[_0x7042('0x4')](0x0);var events={'afterCreate':'save','afterUpdate':'update','afterDestroy':_0x7042('0x5')};function emitEvent(_0x3f026e){return function(_0x34214e,_0x54bc67,_0x56179b){_0x34214e[_0x7042('0x6')]({'attributes':['id'],'raw':!![]})[_0x7042('0x7')](function(_0x2a0dd3){_0x34214e[_0x7042('0x8')](_0x7042('0x9'),_0x2a0dd3[_0x7042('0xa')](function(_0x34be9c){return{'id':_0x34be9c['id']};}));return ChatMessage['findAll']({'where':{'ChatInteractionId':_0x34214e['id'],'direction':'in','read':![]},'raw':!![]});})[_0x7042('0x7')](function(_0xe3ebae){_0x34214e[_0x7042('0x8')]('unreadMessages',_0xe3ebae['length']);ChatInteractionEvents[_0x7042('0xb')](_0x3f026e+':'+_0x34214e['id'],_0x34214e);ChatInteractionEvents['emit'](_0x3f026e,_0x34214e);_0x56179b(null);})[_0x7042('0xc')](_0x56179b(null));};}for(var e in events){if(events[_0x7042('0xd')](e)){var event=events[e];ChatInteraction[_0x7042('0xe')](e,emitEvent(event));}}module['exports']=ChatInteractionEvents;
\ No newline at end of file
+var _0x42a3=['map','findAll','setDataValue','unreadMessages','length','emit','catch','../../mysqldb','ChatInteraction','ChatMessage','setMaxListeners','save','then'];(function(_0x5d33fb,_0x5bf99e){var _0x11733a=function(_0x10b543){while(--_0x10b543){_0x5d33fb['push'](_0x5d33fb['shift']());}};_0x11733a(++_0x5bf99e);}(_0x42a3,0x173));var _0x342a=function(_0x4f13b9,_0x50cdb9){_0x4f13b9=_0x4f13b9-0x0;var _0x524c26=_0x42a3[_0x4f13b9];return _0x524c26;};'use strict';var EventEmitter=require('events');var ChatInteraction=require(_0x342a('0x0'))['db'][_0x342a('0x1')];var ChatMessage=require(_0x342a('0x0'))['db'][_0x342a('0x2')];var ChatInteractionEvents=new EventEmitter();ChatInteractionEvents[_0x342a('0x3')](0x0);var events={'afterCreate':_0x342a('0x4'),'afterUpdate':'update','afterDestroy':'remove'};function emitEvent(_0x46c6ed){return function(_0x574c5d,_0x417af1,_0x5761b8){_0x574c5d['getUsers']({'attributes':['id'],'raw':!![]})[_0x342a('0x5')](function(_0x28d6fb){_0x574c5d['setDataValue']('Users',_0x28d6fb[_0x342a('0x6')](function(_0x5aca33){return{'id':_0x5aca33['id']};}));return ChatMessage[_0x342a('0x7')]({'where':{'ChatInteractionId':_0x574c5d['id'],'direction':'in','read':![]},'raw':!![]});})[_0x342a('0x5')](function(_0x316fda){_0x574c5d[_0x342a('0x8')](_0x342a('0x9'),_0x316fda[_0x342a('0xa')]);ChatInteractionEvents[_0x342a('0xb')](_0x46c6ed+':'+_0x574c5d['id'],_0x574c5d);ChatInteractionEvents[_0x342a('0xb')](_0x46c6ed,_0x574c5d);_0x5761b8(null);})[_0x342a('0xc')](_0x5761b8(null));};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];ChatInteraction['hook'](e,emitEvent(event));}}module['exports']=ChatInteractionEvents;
\ No newline at end of file
diff --git a/server/api/chatInteraction/chatInteraction.model.js b/server/api/chatInteraction/chatInteraction.model.js
index e0f422a..b6522b9 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 _0x983e=['closedAt','YYYY-MM-DD\x20HH:mm:ss','utf8mb4','utf8mb4_unicode_ci','lodash','util','api','moment','bluebird','rimraf','../../config/environment','./chatInteraction.attributes','changed','closed'];(function(_0x1a0f96,_0x53d358){var _0x39a842=function(_0x35926b){while(--_0x35926b){_0x1a0f96['push'](_0x1a0f96['shift']());}};_0x39a842(++_0x53d358);}(_0x983e,0x1a8));var _0xe983=function(_0x2ef032,_0x11d73f){_0x2ef032=_0x2ef032-0x0;var _0x151588=_0x983e[_0x2ef032];return _0x151588;};'use strict';var _=require(_0xe983('0x0'));var util=require(_0xe983('0x1'));var logger=require('../../config/logger')(_0xe983('0x2'));var moment=require(_0xe983('0x3'));var BPromise=require(_0xe983('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0xe983('0x5'));var config=require(_0xe983('0x6'));var attributes=require(_0xe983('0x7'));module['exports']=function(_0x274de9,_0x23d732){return _0x274de9['define']('ChatInteraction',attributes,{'tableName':'chat_interactions','paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x473b3b,_0x5668e4,_0x4725dd){if(_0x473b3b[_0xe983('0x8')](_0xe983('0x9'))){_0x473b3b[_0xe983('0xa')]=moment()['format'](_0xe983('0xb'));}_0x4725dd(null,_0x473b3b);}},'charset':_0xe983('0xc'),'collate':_0xe983('0xd')});};
\ No newline at end of file
+var _0xe73b=['YYYY-MM-DD\x20HH:mm:ss','utf8mb4','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','../../config/environment','./chatInteraction.attributes','exports','define','chat_interactions','changed','closed','closedAt','format'];(function(_0xa464c9,_0x7c86d8){var _0x3d73c4=function(_0x5c2056){while(--_0x5c2056){_0xa464c9['push'](_0xa464c9['shift']());}};_0x3d73c4(++_0x7c86d8);}(_0xe73b,0x17e));var _0xbe73=function(_0x79c6de,_0x10de94){_0x79c6de=_0x79c6de-0x0;var _0x321a56=_0xe73b[_0x79c6de];return _0x321a56;};'use strict';var _=require(_0xbe73('0x0'));var util=require(_0xbe73('0x1'));var logger=require(_0xbe73('0x2'))(_0xbe73('0x3'));var moment=require(_0xbe73('0x4'));var BPromise=require(_0xbe73('0x5'));var rp=require(_0xbe73('0x6'));var fs=require('fs');var path=require(_0xbe73('0x7'));var rimraf=require('rimraf');var config=require(_0xbe73('0x8'));var attributes=require(_0xbe73('0x9'));module[_0xbe73('0xa')]=function(_0x943d51,_0x56cc46){return _0x943d51[_0xbe73('0xb')]('ChatInteraction',attributes,{'tableName':_0xbe73('0xc'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x80c887,_0x2f8869,_0x5c49c4){if(_0x80c887[_0xbe73('0xd')](_0xbe73('0xe'))){_0x80c887[_0xbe73('0xf')]=moment()[_0xbe73('0x10')](_0xbe73('0x11'));}_0x5c49c4(null,_0x80c887);}},'charset':_0xbe73('0x12'),'collate':'utf8mb4_unicode_ci'});};
\ No newline at end of file
diff --git a/server/api/chatInteraction/chatInteraction.rpc.js b/server/api/chatInteraction/chatInteraction.rpc.js
index 333f42d..921e941 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 _0x28df=['../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','socket.io-emitter','./chatInteraction.socket','then','info','ChatInteraction,\x20%s,\x20%s','request\x20sent','debug','ChatInteraction,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','ChatInteraction','body','options','raw','where','attributes','UpdateChatInteraction','AddTagsToChatInteraction','find','ids','omit','spread','AddTags','lodash','util','moment','bluebird','randomstring','../../config/utils'];(function(_0x1fc1f9,_0x454fb2){var _0x4987ca=function(_0x5e90dd){while(--_0x5e90dd){_0x1fc1f9['push'](_0x1fc1f9['shift']());}};_0x4987ca(++_0x454fb2);}(_0x28df,0x1e6));var _0xf28d=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x28df[_0x20a584];return _0x4b41a8;};'use strict';var _=require(_0xf28d('0x0'));var util=require(_0xf28d('0x1'));var moment=require(_0xf28d('0x2'));var BPromise=require(_0xf28d('0x3'));var rs=require(_0xf28d('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0xf28d('0x5'));var logger=require(_0xf28d('0x6'))(_0xf28d('0x7'));var config=require(_0xf28d('0x8'));var jayson=require(_0xf28d('0x9'));var client=jayson[_0xf28d('0xa')][_0xf28d('0xb')]({'port':0x232a});config[_0xf28d('0xc')]=_[_0xf28d('0xd')](config[_0xf28d('0xc')],{'host':'localhost','port':0x18eb});var socket=require(_0xf28d('0xe'))(new Redis(config[_0xf28d('0xc')]));require(_0xf28d('0xf'))['register'](socket);function respondWithRpcPromise(_0x56f63a,_0x568d81,_0x3fc874){return new BPromise(function(_0x2e3fc9,_0x3a0bf4){return client['request'](_0x56f63a,_0x3fc874)[_0xf28d('0x10')](function(_0x4e83f6){logger[_0xf28d('0x11')](_0xf28d('0x12'),_0x568d81,_0xf28d('0x13'));logger[_0xf28d('0x14')](_0xf28d('0x15'),_0x568d81,_0xf28d('0x13'),JSON[_0xf28d('0x16')](_0x4e83f6));if(_0x4e83f6[_0xf28d('0x17')]){if(_0x4e83f6[_0xf28d('0x17')][_0xf28d('0x18')]===0x1f4){logger[_0xf28d('0x17')](_0xf28d('0x12'),_0x568d81,_0x4e83f6['error'][_0xf28d('0x19')]);return _0x3a0bf4(_0x4e83f6['error'][_0xf28d('0x19')]);}logger[_0xf28d('0x17')](_0xf28d('0x12'),_0x568d81,_0x4e83f6[_0xf28d('0x17')][_0xf28d('0x19')]);return _0x2e3fc9(_0x4e83f6[_0xf28d('0x17')][_0xf28d('0x19')]);}else{logger[_0xf28d('0x11')](_0xf28d('0x12'),_0x568d81,'request\x20sent');_0x2e3fc9(_0x4e83f6[_0xf28d('0x1a')][_0xf28d('0x19')]);}})[_0xf28d('0x1b')](function(_0x4ce1af){logger[_0xf28d('0x17')](_0xf28d('0x12'),_0x568d81,_0x4ce1af);_0x3a0bf4(_0x4ce1af);});});}exports['UpdateChatInteraction']=function(_0x59c552){var _0x5e3279=this;return new Promise(function(_0x290c04,_0x124c2b){return db[_0xf28d('0x1c')]['update'](_0x59c552[_0xf28d('0x1d')],{'raw':_0x59c552['options']?_0x59c552[_0xf28d('0x1e')][_0xf28d('0x1f')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x59c552[_0xf28d('0x1e')]?_0x59c552[_0xf28d('0x1e')][_0xf28d('0x20')]||null:null,'attributes':_0x59c552[_0xf28d('0x1e')]?_0x59c552[_0xf28d('0x1e')][_0xf28d('0x21')]||null:null,'limit':_0x59c552[_0xf28d('0x1e')]?_0x59c552[_0xf28d('0x1e')]['limit']||null:null})['then'](function(_0xd21ff3){logger['info']('UpdateChatInteraction',_0x59c552);logger[_0xf28d('0x14')](_0xf28d('0x22'),_0x59c552,JSON[_0xf28d('0x16')](_0xd21ff3));_0x290c04(_0xd21ff3);})['catch'](function(_0xb65cea){logger['error']('UpdateChatInteraction',_0xb65cea[_0xf28d('0x19')],_0x59c552);_0x124c2b(_0x5e3279['error'](0x1f4,_0xb65cea[_0xf28d('0x19')]));});});};exports[_0xf28d('0x23')]=function(_0xa7e155){return new Promise(function(_0xeeea7d,_0x188f79){return db['ChatInteraction'][_0xf28d('0x24')]({'where':_0xa7e155[_0xf28d('0x1e')]?_0xa7e155[_0xf28d('0x1e')]['where']||null:null})[_0xf28d('0x10')](function(_0x24dea5){if(_0x24dea5){return _0x24dea5['addTags'](_0xa7e155[_0xf28d('0x1d')][_0xf28d('0x25')],_[_0xf28d('0x26')](_0xa7e155[_0xf28d('0x1d')],[_0xf28d('0x25'),'id'])||{});}})[_0xf28d('0x27')](function(_0x464fa4){logger[_0xf28d('0x11')]('AddTags',_0xa7e155);logger['debug'](_0xf28d('0x28'),_0xa7e155,JSON[_0xf28d('0x16')](_0x464fa4));_0xeeea7d(_0x464fa4);})[_0xf28d('0x1b')](function(_0x1aeab4){logger[_0xf28d('0x17')]('AddTags',_0x1aeab4[_0xf28d('0x19')],_0xa7e155);_0x188f79(_this[_0xf28d('0x17')](0x1f4,_0x1aeab4['message']));});});};
\ No newline at end of file
+var _0x7108=['error','code','ChatInteraction,\x20%s,\x20%s','message','UpdateChatInteraction','ChatInteraction','update','body','options','attributes','stringify','catch','AddTagsToChatInteraction','find','addTags','ids','omit','spread','AddTags','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','jayson/promise','http','redis','defaults','./chatInteraction.socket','register','request','then','info','request\x20sent','debug'];(function(_0x9e926a,_0x16a1c6){var _0x5b571a=function(_0xc18e03){while(--_0xc18e03){_0x9e926a['push'](_0x9e926a['shift']());}};_0x5b571a(++_0x16a1c6);}(_0x7108,0xab));var _0x8710=function(_0x490ff4,_0x1b149c){_0x490ff4=_0x490ff4-0x0;var _0x1b800b=_0x7108[_0x490ff4];return _0x1b800b;};'use strict';var _=require(_0x8710('0x0'));var util=require('util');var moment=require(_0x8710('0x1'));var BPromise=require(_0x8710('0x2'));var rs=require(_0x8710('0x3'));var fs=require('fs');var Redis=require(_0x8710('0x4'));var db=require(_0x8710('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x8710('0x6'))(_0x8710('0x7'));var config=require('../../config/environment');var jayson=require(_0x8710('0x8'));var client=jayson['client'][_0x8710('0x9')]({'port':0x232a});config[_0x8710('0xa')]=_[_0x8710('0xb')](config[_0x8710('0xa')],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x8710('0xa')]));require(_0x8710('0xc'))[_0x8710('0xd')](socket);function respondWithRpcPromise(_0x4c421a,_0x44a995,_0x37a196){return new BPromise(function(_0x4fc3e0,_0x2cde07){return client[_0x8710('0xe')](_0x4c421a,_0x37a196)[_0x8710('0xf')](function(_0x1cfd4a){logger[_0x8710('0x10')]('ChatInteraction,\x20%s,\x20%s',_0x44a995,_0x8710('0x11'));logger[_0x8710('0x12')]('ChatInteraction,\x20%s,\x20%s,\x20%s',_0x44a995,_0x8710('0x11'),JSON['stringify'](_0x1cfd4a));if(_0x1cfd4a[_0x8710('0x13')]){if(_0x1cfd4a[_0x8710('0x13')][_0x8710('0x14')]===0x1f4){logger[_0x8710('0x13')](_0x8710('0x15'),_0x44a995,_0x1cfd4a[_0x8710('0x13')][_0x8710('0x16')]);return _0x2cde07(_0x1cfd4a[_0x8710('0x13')][_0x8710('0x16')]);}logger['error'](_0x8710('0x15'),_0x44a995,_0x1cfd4a['error'][_0x8710('0x16')]);return _0x4fc3e0(_0x1cfd4a[_0x8710('0x13')][_0x8710('0x16')]);}else{logger[_0x8710('0x10')](_0x8710('0x15'),_0x44a995,_0x8710('0x11'));_0x4fc3e0(_0x1cfd4a['result'][_0x8710('0x16')]);}})['catch'](function(_0x4a788a){logger[_0x8710('0x13')]('ChatInteraction,\x20%s,\x20%s',_0x44a995,_0x4a788a);_0x2cde07(_0x4a788a);});});}exports[_0x8710('0x17')]=function(_0x4e572d){var _0x495f25=this;return new Promise(function(_0x4e2745,_0x2d8f8e){return db[_0x8710('0x18')][_0x8710('0x19')](_0x4e572d[_0x8710('0x1a')],{'raw':_0x4e572d[_0x8710('0x1b')]?_0x4e572d[_0x8710('0x1b')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x4e572d['options']?_0x4e572d[_0x8710('0x1b')]['where']||null:null,'attributes':_0x4e572d[_0x8710('0x1b')]?_0x4e572d[_0x8710('0x1b')][_0x8710('0x1c')]||null:null,'limit':_0x4e572d[_0x8710('0x1b')]?_0x4e572d['options']['limit']||null:null})[_0x8710('0xf')](function(_0x247bfa){logger[_0x8710('0x10')]('UpdateChatInteraction',_0x4e572d);logger['debug'](_0x8710('0x17'),_0x4e572d,JSON[_0x8710('0x1d')](_0x247bfa));_0x4e2745(_0x247bfa);})[_0x8710('0x1e')](function(_0x55976a){logger['error'](_0x8710('0x17'),_0x55976a[_0x8710('0x16')],_0x4e572d);_0x2d8f8e(_0x495f25[_0x8710('0x13')](0x1f4,_0x55976a[_0x8710('0x16')]));});});};exports[_0x8710('0x1f')]=function(_0x57eb7e){return new Promise(function(_0xa4b827,_0x4ce0a8){return db[_0x8710('0x18')][_0x8710('0x20')]({'where':_0x57eb7e['options']?_0x57eb7e[_0x8710('0x1b')]['where']||null:null})[_0x8710('0xf')](function(_0x2a7603){if(_0x2a7603){return _0x2a7603[_0x8710('0x21')](_0x57eb7e[_0x8710('0x1a')][_0x8710('0x22')],_[_0x8710('0x23')](_0x57eb7e[_0x8710('0x1a')],[_0x8710('0x22'),'id'])||{});}})[_0x8710('0x24')](function(_0x41a24d){logger[_0x8710('0x10')](_0x8710('0x25'),_0x57eb7e);logger[_0x8710('0x12')](_0x8710('0x25'),_0x57eb7e,JSON[_0x8710('0x1d')](_0x41a24d));_0xa4b827(_0x41a24d);})[_0x8710('0x1e')](function(_0x48172c){logger['error'](_0x8710('0x25'),_0x48172c['message'],_0x57eb7e);_0x4ce0a8(_this[_0x8710('0x13')](0x1f4,_0x48172c[_0x8710('0x16')]));});});};
\ No newline at end of file
diff --git a/server/api/chatInteraction/chatInteraction.socket.js b/server/api/chatInteraction/chatInteraction.socket.js
index ca22c89..3dc648d 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 _0xe096=['remove','update','emit','removeListener','./chatInteraction.events','save'];(function(_0x586ac4,_0x390b1b){var _0x2d7364=function(_0x5651d7){while(--_0x5651d7){_0x586ac4['push'](_0x586ac4['shift']());}};_0x2d7364(++_0x390b1b);}(_0xe096,0x13c));var _0x6e09=function(_0x15a634,_0x4feb86){_0x15a634=_0x15a634-0x0;var _0xf4f7a0=_0xe096[_0x15a634];return _0xf4f7a0;};'use strict';var ChatInteractionEvents=require(_0x6e09('0x0'));var events=[_0x6e09('0x1'),_0x6e09('0x2'),_0x6e09('0x3')];function createListener(_0x194614,_0x1379c5){return function(_0x498677){_0x1379c5[_0x6e09('0x4')](_0x194614,_0x498677);};}function removeListener(_0xc5fff6,_0x16feae){return function(){ChatInteractionEvents[_0x6e09('0x5')](_0xc5fff6,_0x16feae);};}exports['register']=function(_0x560b7c){for(var _0x5442ec=0x0,_0x19b334=events['length'];_0x5442ec<_0x19b334;_0x5442ec++){var _0x1aadcb=events[_0x5442ec];var _0x3f558e=createListener('chatInteraction:'+_0x1aadcb,_0x560b7c);ChatInteractionEvents['on'](_0x1aadcb,_0x3f558e);}};
\ No newline at end of file
+var _0x5a10=['save','remove','update','removeListener'];(function(_0x3bd60e,_0x2069b0){var _0x196c85=function(_0x51a82d){while(--_0x51a82d){_0x3bd60e['push'](_0x3bd60e['shift']());}};_0x196c85(++_0x2069b0);}(_0x5a10,0x1f4));var _0x05a1=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x5a10[_0x14add3];return _0x4a174f;};'use strict';var ChatInteractionEvents=require('./chatInteraction.events');var events=[_0x05a1('0x0'),_0x05a1('0x1'),_0x05a1('0x2')];function createListener(_0x2faedf,_0x360175){return function(_0x23c771){_0x360175['emit'](_0x2faedf,_0x23c771);};}function removeListener(_0x2ce32,_0x370ecb){return function(){ChatInteractionEvents[_0x05a1('0x3')](_0x2ce32,_0x370ecb);};}exports['register']=function(_0x598fb6){for(var _0x2b82a3=0x0,_0x5ab67c=events['length'];_0x2b82a3<_0x5ab67c;_0x2b82a3++){var _0x5e2092=events[_0x2b82a3];var _0x228756=createListener('chatInteraction:'+_0x5e2092,_0x598fb6);ChatInteractionEvents['on'](_0x5e2092,_0x228756);}};
\ No newline at end of file
diff --git a/server/api/chatInteraction/index.js b/server/api/chatInteraction/index.js
index 9aa6dbc..b5cc354 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 _0x88e8=['getMyMessages','/:id/download','post','create','/:id/vidaoo','createVidaooSession','diskStorage','join','server/files/attachments/','format','now','/:id/attachment_upload','single','file','attachmentUpload','/:id/tags','chatinteraction:addtags','addTags','put','tracked','chat','chatinteraction:update','/:id/custom_update','/:id/abandon','abandon','/:id/close','close','destroy','delete','removeTags','exports','multer','util','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatInteraction.controller','isAuthenticated','get','describe','/:id','show','isChatInteractionAuthorized','attachmentDownload','/:id/messages','getMessages','/:id/my_messages'];(function(_0x4c78e0,_0x389694){var _0x33ca4f=function(_0x16bfd2){while(--_0x16bfd2){_0x4c78e0['push'](_0x4c78e0['shift']());}};_0x33ca4f(++_0x389694);}(_0x88e8,0xe7));var _0x888e=function(_0x420fdd,_0x127224){_0x420fdd=_0x420fdd-0x0;var _0x116df3=_0x88e8[_0x420fdd];return _0x116df3;};'use strict';var multer=require(_0x888e('0x0'));var util=require(_0x888e('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0x888e('0x2'));var router=express[_0x888e('0x3')]();var fs_extra=require(_0x888e('0x4'));var auth=require(_0x888e('0x5'));var interaction=require(_0x888e('0x6'));var config=require(_0x888e('0x7'));var controller=require(_0x888e('0x8'));router['get']('/',auth[_0x888e('0x9')](),controller['index']);router[_0x888e('0xa')]('/describe',auth['isAuthenticated'](),controller[_0x888e('0xb')]);router[_0x888e('0xa')](_0x888e('0xc'),auth['isChatInteractionAuthorized'](),controller[_0x888e('0xd')]);router['get']('/:id/attachment_download',auth[_0x888e('0xe')](),controller[_0x888e('0xf')]);router[_0x888e('0xa')](_0x888e('0x10'),auth[_0x888e('0x9')](),controller[_0x888e('0x11')]);router[_0x888e('0xa')](_0x888e('0x12'),auth[_0x888e('0xe')](),controller[_0x888e('0x13')]);router[_0x888e('0xa')](_0x888e('0x14'),auth[_0x888e('0x9')](),controller['download']);router[_0x888e('0x15')]('/',auth[_0x888e('0x9')](),controller[_0x888e('0x16')]);router[_0x888e('0x15')](_0x888e('0x17'),auth[_0x888e('0x9')](),controller[_0x888e('0x18')]);var upload=multer({'storage':multer[_0x888e('0x19')]({'destination':function(_0x590b40,_0x299a39,_0x3427bc){_0x3427bc(null,path[_0x888e('0x1a')](config['root'],_0x888e('0x1b')));},'filename':function(_0x144cf7,_0x307400,_0x466169){_0x466169(null,util[_0x888e('0x1c')]('%s-%s',Date[_0x888e('0x1d')](),_0x307400['originalname']['replace'](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-')));}})});router[_0x888e('0x15')](_0x888e('0x1e'),upload[_0x888e('0x1f')](_0x888e('0x20')),controller[_0x888e('0x21')]);router['post'](_0x888e('0x10'),auth[_0x888e('0xe')](),controller['addMessage']);router[_0x888e('0x15')](_0x888e('0x22'),auth[_0x888e('0x9')](),interaction['tracked']('chat',_0x888e('0x23')),controller[_0x888e('0x24')]);router[_0x888e('0x25')](_0x888e('0xc'),auth[_0x888e('0x9')](),interaction[_0x888e('0x26')](_0x888e('0x27'),_0x888e('0x28')),controller['update']);router[_0x888e('0x25')](_0x888e('0x29'),controller['customUpdate']);router['put'](_0x888e('0x2a'),auth[_0x888e('0xe')](),controller[_0x888e('0x2b')]);router[_0x888e('0x25')](_0x888e('0x2c'),controller[_0x888e('0x2d')]);router['delete'](_0x888e('0xc'),auth[_0x888e('0x9')](),interaction['tracked'](_0x888e('0x27'),'chatinteraction:destroy'),controller[_0x888e('0x2e')]);router[_0x888e('0x2f')](_0x888e('0x22'),auth['isAuthenticated'](),controller[_0x888e('0x30')]);module[_0x888e('0x31')]=router;
\ No newline at end of file
+var _0x9502=['close','delete','chatinteraction:destroy','removeTags','exports','multer','util','connect-timeout','Router','fs-extra','./chatInteraction.controller','isAuthenticated','index','get','/describe','describe','isChatInteractionAuthorized','/:id/messages','getMessages','/:id/my_messages','getMyMessages','/:id/download','download','post','createVidaooSession','diskStorage','root','server/files/attachments/','format','%s-%s','originalname','replace','/:id/attachment_upload','single','file','attachmentUpload','/:id/tags','tracked','chat','chatinteraction:addtags','addTags','put','/:id','customUpdate','abandon','/:id/close'];(function(_0x121509,_0x1f9b95){var _0x418e32=function(_0x418fb9){while(--_0x418fb9){_0x121509['push'](_0x121509['shift']());}};_0x418e32(++_0x1f9b95);}(_0x9502,0x1d1));var _0x2950=function(_0x537881,_0x3555b0){_0x537881=_0x537881-0x0;var _0x19ef90=_0x9502[_0x537881];return _0x19ef90;};'use strict';var multer=require(_0x2950('0x0'));var util=require(_0x2950('0x1'));var path=require('path');var timeout=require(_0x2950('0x2'));var express=require('express');var router=express[_0x2950('0x3')]();var fs_extra=require(_0x2950('0x4'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x2950('0x5'));router['get']('/',auth[_0x2950('0x6')](),controller[_0x2950('0x7')]);router[_0x2950('0x8')](_0x2950('0x9'),auth[_0x2950('0x6')](),controller[_0x2950('0xa')]);router[_0x2950('0x8')]('/:id',auth[_0x2950('0xb')](),controller['show']);router[_0x2950('0x8')]('/:id/attachment_download',auth['isChatInteractionAuthorized'](),controller['attachmentDownload']);router[_0x2950('0x8')](_0x2950('0xc'),auth[_0x2950('0x6')](),controller[_0x2950('0xd')]);router[_0x2950('0x8')](_0x2950('0xe'),auth[_0x2950('0xb')](),controller[_0x2950('0xf')]);router[_0x2950('0x8')](_0x2950('0x10'),auth[_0x2950('0x6')](),controller[_0x2950('0x11')]);router[_0x2950('0x12')]('/',auth['isAuthenticated'](),controller['create']);router[_0x2950('0x12')]('/:id/vidaoo',auth[_0x2950('0x6')](),controller[_0x2950('0x13')]);var upload=multer({'storage':multer[_0x2950('0x14')]({'destination':function(_0x176b52,_0x5aa4f0,_0x362c05){_0x362c05(null,path['join'](config[_0x2950('0x15')],_0x2950('0x16')));},'filename':function(_0x5d3c9a,_0x32b67c,_0x1f86f0){_0x1f86f0(null,util[_0x2950('0x17')](_0x2950('0x18'),Date['now'](),_0x32b67c[_0x2950('0x19')][_0x2950('0x1a')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-')));}})});router['post'](_0x2950('0x1b'),upload[_0x2950('0x1c')](_0x2950('0x1d')),controller[_0x2950('0x1e')]);router['post'](_0x2950('0xc'),auth[_0x2950('0xb')](),controller['addMessage']);router[_0x2950('0x12')](_0x2950('0x1f'),auth['isAuthenticated'](),interaction[_0x2950('0x20')](_0x2950('0x21'),_0x2950('0x22')),controller[_0x2950('0x23')]);router[_0x2950('0x24')](_0x2950('0x25'),auth[_0x2950('0x6')](),interaction[_0x2950('0x20')](_0x2950('0x21'),'chatinteraction:update'),controller['update']);router[_0x2950('0x24')]('/:id/custom_update',controller[_0x2950('0x26')]);router[_0x2950('0x24')]('/:id/abandon',auth[_0x2950('0xb')](),controller[_0x2950('0x27')]);router[_0x2950('0x24')](_0x2950('0x28'),controller[_0x2950('0x29')]);router[_0x2950('0x2a')](_0x2950('0x25'),auth[_0x2950('0x6')](),interaction[_0x2950('0x20')]('chat',_0x2950('0x2b')),controller['destroy']);router[_0x2950('0x2a')](_0x2950('0x1f'),auth[_0x2950('0x6')](),controller[_0x2950('0x2c')]);module[_0x2950('0x2d')]=router;
\ No newline at end of file
diff --git a/server/api/chatInternalMessage/chatInternalMessage.attributes.js b/server/api/chatInternalMessage/chatInternalMessage.attributes.js
index 6a24f99..aec48dd 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 _0x5b37=['BOOLEAN','INTEGER','sequelize','exports','medium'];(function(_0x45671c,_0x2d5a15){var _0x8690ab=function(_0x44598f){while(--_0x44598f){_0x45671c['push'](_0x45671c['shift']());}};_0x8690ab(++_0x2d5a15);}(_0x5b37,0x106));var _0x75b3=function(_0x5db569,_0x25707b){_0x5db569=_0x5db569-0x0;var _0x247b44=_0x5b37[_0x5db569];return _0x247b44;};'use strict';var Sequelize=require(_0x75b3('0x0'));module[_0x75b3('0x1')]={'body':{'type':Sequelize['TEXT'](_0x75b3('0x2')),'allowNull':![]},'read':{'type':Sequelize[_0x75b3('0x3')],'defaultValue':![]},'ChatInternalMessageId':{'type':Sequelize[_0x75b3('0x4')]}};
\ No newline at end of file
+var _0x58fb=['BOOLEAN','sequelize','exports','TEXT','medium'];(function(_0x327995,_0x15ab91){var _0x540aa9=function(_0x4b08b5){while(--_0x4b08b5){_0x327995['push'](_0x327995['shift']());}};_0x540aa9(++_0x15ab91);}(_0x58fb,0x178));var _0xb58f=function(_0x49e246,_0x48b258){_0x49e246=_0x49e246-0x0;var _0x5d690d=_0x58fb[_0x49e246];return _0x5d690d;};'use strict';var Sequelize=require(_0xb58f('0x0'));module[_0xb58f('0x1')]={'body':{'type':Sequelize[_0xb58f('0x2')](_0xb58f('0x3')),'allowNull':![]},'read':{'type':Sequelize[_0xb58f('0x4')],'defaultValue':![]},'ChatInternalMessageId':{'type':Sequelize['INTEGER']}};
\ No newline at end of file
diff --git a/server/api/chatInternalMessage/chatInternalMessage.controller.js b/server/api/chatInternalMessage/chatInternalMessage.controller.js
index 570c36f..985bb50 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 _0x5cc9=['describe','get','messages','createdAt','lastMessage','lastMessageAt','format','getUsers','findAll','admin','user','fullname','role','userpic','internal','online','lastLoginAt','allowmessenger','showWebBar','-online','UserProfileSection','Agents','userProfileId','UserProfileResource','isEmpty','agent','resourceId','push','FromId','ToId','-createdAt','all','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','sox','to-csv','ejs','fs-extra','lodash','crypto','desk.js','querystring','ioredis','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','redis','defaults','localhost','./chatInternalMessage.socket','register','sendStatus','status','end','offset','undefined','limit','count','set','Content-Range','json','reject','save','update','destroy','then','stack','name','send','index','map','ChatInternalMessage','rawAttributes','fieldName','type','key','model','query','keys','attributes','intersection','fields','length','order','sort','where','filters','pick','filter','VIRTUAL','merge','options','includeAll','include','rows','catch','show','find','create','body','params'];(function(_0x33990e,_0x27b1f4){var _0x366423=function(_0x488cf4){while(--_0x488cf4){_0x33990e['push'](_0x33990e['shift']());}};_0x366423(++_0x27b1f4);}(_0x5cc9,0x16a));var _0x95cc=function(_0xe5ef5b,_0x428332){_0xe5ef5b=_0xe5ef5b-0x0;var _0x376b56=_0x5cc9[_0xe5ef5b];return _0x376b56;};'use strict';var emlformat=require(_0x95cc('0x0'));var rimraf=require(_0x95cc('0x1'));var zipdir=require(_0x95cc('0x2'));var jsonpatch=require(_0x95cc('0x3'));var rp=require(_0x95cc('0x4'));var moment=require(_0x95cc('0x5'));var BPromise=require('bluebird');var Mustache=require(_0x95cc('0x6'));var util=require(_0x95cc('0x7'));var path=require('path');var sox=require(_0x95cc('0x8'));var csv=require(_0x95cc('0x9'));var ejs=require(_0x95cc('0xa'));var fs=require('fs');var fs_extra=require(_0x95cc('0xb'));var _=require(_0x95cc('0xc'));var squel=require('squel');var crypto=require(_0x95cc('0xd'));var jsforce=require('jsforce');var deskjs=require(_0x95cc('0xe'));var toCsv=require(_0x95cc('0x9'));var querystring=require(_0x95cc('0xf'));var Papa=require('papaparse');var Redis=require(_0x95cc('0x10'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0x95cc('0x11'));var hardwareService=require(_0x95cc('0x12'));var logger=require(_0x95cc('0x13'))(_0x95cc('0x14'));var utils=require(_0x95cc('0x15'));var config=require(_0x95cc('0x16'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];config[_0x95cc('0x17')]=_[_0x95cc('0x18')](config['redis'],{'host':_0x95cc('0x19'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x95cc('0x17')]));require(_0x95cc('0x1a'))[_0x95cc('0x1b')](socket);function respondWithStatusCode(_0x25d508,_0x2112cc){_0x2112cc=_0x2112cc||0xcc;return function(_0x1eedbf){if(_0x1eedbf){return _0x25d508[_0x95cc('0x1c')](_0x2112cc);}return _0x25d508[_0x95cc('0x1d')](_0x2112cc)[_0x95cc('0x1e')]();};}function respondWithResult(_0x4bff06,_0x7304ab){_0x7304ab=_0x7304ab||0xc8;return function(_0x4a2428){if(_0x4a2428){return _0x4bff06[_0x95cc('0x1d')](_0x7304ab)['json'](_0x4a2428);}};}function respondWithFilteredResult(_0x1e6203,_0x2d4b10){return function(_0x6b0917){if(_0x6b0917){var _0x231b39=typeof _0x2d4b10[_0x95cc('0x1f')]===_0x95cc('0x20')&&typeof _0x2d4b10[_0x95cc('0x21')]===_0x95cc('0x20');var _0xb8192e=_0x6b0917[_0x95cc('0x22')];var _0x2276ac=_0x231b39?0x0:_0x2d4b10[_0x95cc('0x1f')];var _0x1eb2a7=_0x231b39?_0x6b0917[_0x95cc('0x22')]:_0x2d4b10[_0x95cc('0x1f')]+_0x2d4b10[_0x95cc('0x21')];var _0x4ea406;if(_0x1eb2a7>=_0xb8192e){_0x1eb2a7=_0xb8192e;_0x4ea406=0xc8;}else{_0x4ea406=0xce;}_0x1e6203[_0x95cc('0x1d')](_0x4ea406);return _0x1e6203[_0x95cc('0x23')](_0x95cc('0x24'),_0x2276ac+'-'+_0x1eb2a7+'/'+_0xb8192e)[_0x95cc('0x25')](_0x6b0917);}return null;};}function patchUpdates(_0x345511){return function(_0xe2d034){try{jsonpatch['apply'](_0xe2d034,_0x345511,!![]);}catch(_0x3552bc){return BPromise[_0x95cc('0x26')](_0x3552bc);}return _0xe2d034[_0x95cc('0x27')]();};}function saveUpdates(_0x282866,_0xe3265a){return function(_0x2e6801){if(_0x2e6801){return _0x2e6801[_0x95cc('0x28')](_0x282866)['then'](function(_0x2fa5a5){return _0x2fa5a5;});}return null;};}function removeEntity(_0x99710d,_0x1e2876){return function(_0x25c56c){if(_0x25c56c){return _0x25c56c[_0x95cc('0x29')]()[_0x95cc('0x2a')](function(){_0x99710d[_0x95cc('0x1d')](0xcc)['end']();});}};}function handleEntityNotFound(_0x4d0b6a,_0x5b8c6f){return function(_0x1ed7d5){if(!_0x1ed7d5){_0x4d0b6a[_0x95cc('0x1c')](0x194);}return _0x1ed7d5;};}function handleError(_0x165e9e,_0x549a86){_0x549a86=_0x549a86||0x1f4;return function(_0x12a0e5){logger['error'](_0x12a0e5[_0x95cc('0x2b')]);if(_0x12a0e5[_0x95cc('0x2c')]){delete _0x12a0e5[_0x95cc('0x2c')];}_0x165e9e[_0x95cc('0x1d')](_0x549a86)[_0x95cc('0x2d')](_0x12a0e5);};}exports[_0x95cc('0x2e')]=function(_0xbd98d7,_0x2d3c22){var _0x18124b={},_0x65b551={},_0x3e1fe2={'count':0x0,'rows':[]};var _0x28fb63=_[_0x95cc('0x2f')](db[_0x95cc('0x30')][_0x95cc('0x31')],function(_0x5f4f25){return{'name':_0x5f4f25[_0x95cc('0x32')],'type':_0x5f4f25[_0x95cc('0x33')][_0x95cc('0x34')]};});_0x65b551[_0x95cc('0x35')]=_[_0x95cc('0x2f')](_0x28fb63,_0x95cc('0x2c'));_0x65b551[_0x95cc('0x36')]=_[_0x95cc('0x37')](_0xbd98d7[_0x95cc('0x36')]);_0x65b551['filters']=_['intersection'](_0x65b551[_0x95cc('0x35')],_0x65b551[_0x95cc('0x36')]);_0x18124b[_0x95cc('0x38')]=_[_0x95cc('0x39')](_0x65b551[_0x95cc('0x35')],qs[_0x95cc('0x3a')](_0xbd98d7[_0x95cc('0x36')][_0x95cc('0x3a')]));_0x18124b[_0x95cc('0x38')]=_0x18124b[_0x95cc('0x38')][_0x95cc('0x3b')]?_0x18124b[_0x95cc('0x38')]:_0x65b551[_0x95cc('0x35')];if(!_0xbd98d7['query']['hasOwnProperty']('nolimit')){_0x18124b[_0x95cc('0x21')]=qs[_0x95cc('0x21')](_0xbd98d7[_0x95cc('0x36')][_0x95cc('0x21')]);_0x18124b[_0x95cc('0x1f')]=qs[_0x95cc('0x1f')](_0xbd98d7[_0x95cc('0x36')][_0x95cc('0x1f')]);}_0x18124b[_0x95cc('0x3c')]=qs[_0x95cc('0x3d')](_0xbd98d7[_0x95cc('0x36')][_0x95cc('0x3d')]);_0x18124b[_0x95cc('0x3e')]=qs[_0x95cc('0x3f')](_[_0x95cc('0x40')](_0xbd98d7[_0x95cc('0x36')],_0x65b551[_0x95cc('0x3f')]),_0x28fb63);if(_0xbd98d7[_0x95cc('0x36')][_0x95cc('0x41')]){_0x18124b[_0x95cc('0x3e')]=_['merge'](_0x18124b[_0x95cc('0x3e')],{'$or':_[_0x95cc('0x2f')](_0x28fb63,function(_0x3365f4){if(_0x3365f4[_0x95cc('0x33')]!==_0x95cc('0x42')){var _0x4aa44f={};_0x4aa44f[_0x3365f4[_0x95cc('0x2c')]]={'$like':'%'+_0xbd98d7[_0x95cc('0x36')][_0x95cc('0x41')]+'%'};return _0x4aa44f;}})});}_0x18124b=_[_0x95cc('0x43')]({},_0x18124b,_0xbd98d7[_0x95cc('0x44')]);var _0x4df8a2={'where':_0x18124b['where']};return db[_0x95cc('0x30')]['count'](_0x4df8a2)[_0x95cc('0x2a')](function(_0x36449a){_0x3e1fe2[_0x95cc('0x22')]=_0x36449a;if(_0xbd98d7[_0x95cc('0x36')][_0x95cc('0x45')]){_0x18124b[_0x95cc('0x46')]=[{'all':!![]}];}return db[_0x95cc('0x30')]['findAll'](_0x18124b);})['then'](function(_0x56f623){_0x3e1fe2[_0x95cc('0x47')]=_0x56f623;return _0x3e1fe2;})[_0x95cc('0x2a')](respondWithFilteredResult(_0x2d3c22,_0x18124b))[_0x95cc('0x48')](handleError(_0x2d3c22,null));};exports[_0x95cc('0x49')]=function(_0x4d8dda,_0x33e076){var _0x203dd6={'raw':!![],'where':{'id':_0x4d8dda['params']['id']}},_0x109f84={};_0x109f84['model']=_[_0x95cc('0x37')](db[_0x95cc('0x30')][_0x95cc('0x31')]);_0x109f84[_0x95cc('0x36')]=_[_0x95cc('0x37')](_0x4d8dda[_0x95cc('0x36')]);_0x109f84[_0x95cc('0x3f')]=_[_0x95cc('0x39')](_0x109f84[_0x95cc('0x35')],_0x109f84['query']);_0x203dd6[_0x95cc('0x38')]=_[_0x95cc('0x39')](_0x109f84['model'],qs[_0x95cc('0x3a')](_0x4d8dda['query']['fields']));_0x203dd6[_0x95cc('0x38')]=_0x203dd6[_0x95cc('0x38')][_0x95cc('0x3b')]?_0x203dd6[_0x95cc('0x38')]:_0x109f84[_0x95cc('0x35')];if(_0x4d8dda[_0x95cc('0x36')][_0x95cc('0x45')]){_0x203dd6[_0x95cc('0x46')]=[{'all':!![]}];}_0x203dd6=_[_0x95cc('0x43')]({},_0x203dd6,_0x4d8dda['options']);return db[_0x95cc('0x30')][_0x95cc('0x4a')](_0x203dd6)[_0x95cc('0x2a')](handleEntityNotFound(_0x33e076,null))[_0x95cc('0x2a')](respondWithResult(_0x33e076,null))[_0x95cc('0x48')](handleError(_0x33e076,null));};exports[_0x95cc('0x4b')]=function(_0x1a591d,_0x51e81b){return db[_0x95cc('0x30')][_0x95cc('0x4b')](_0x1a591d[_0x95cc('0x4c')],{})['then'](respondWithResult(_0x51e81b,0xc9))['catch'](handleError(_0x51e81b,null));};exports[_0x95cc('0x28')]=function(_0x523516,_0x37cc0c){if(_0x523516['body']['id']){delete _0x523516[_0x95cc('0x4c')]['id'];}return db[_0x95cc('0x30')][_0x95cc('0x4a')]({'where':{'id':_0x523516[_0x95cc('0x4d')]['id']}})['then'](handleEntityNotFound(_0x37cc0c,null))[_0x95cc('0x2a')](saveUpdates(_0x523516['body'],null))[_0x95cc('0x2a')](respondWithResult(_0x37cc0c,null))[_0x95cc('0x48')](handleError(_0x37cc0c,null));};exports[_0x95cc('0x29')]=function(_0x381965,_0x55dc0b){return db[_0x95cc('0x30')][_0x95cc('0x4a')]({'where':{'id':_0x381965[_0x95cc('0x4d')]['id']}})['then'](handleEntityNotFound(_0x55dc0b,null))[_0x95cc('0x2a')](removeEntity(_0x55dc0b,null))[_0x95cc('0x48')](handleError(_0x55dc0b,null));};exports[_0x95cc('0x4e')]=function(_0x311f06,_0x118c2a){return db[_0x95cc('0x30')][_0x95cc('0x4e')]()[_0x95cc('0x2a')](respondWithResult(_0x118c2a,null))[_0x95cc('0x48')](handleError(_0x118c2a,null));};function wrapUser(_0x3fc946){return function(_0x337a75){var _0x1aae3f=_0x3fc946[_0x95cc('0x4f')]({'plain':!![]});_0x1aae3f[_0x95cc('0x50')]=[];if(_0x337a75){_0x1aae3f['lastMessageAt']=_0x337a75[_0x95cc('0x51')];_0x1aae3f[_0x95cc('0x52')]=_0x337a75;}else{_0x1aae3f[_0x95cc('0x53')]=moment(0x0)[_0x95cc('0x54')]('YYYY-MM-DD\x20HH:mm:ss');_0x1aae3f['lastMessage']={};}return _0x1aae3f;};}exports[_0x95cc('0x55')]=function(_0x1df6bb,_0x2345d9,_0x10b582){var _0x436c2b=[];return db['User'][_0x95cc('0x56')]({'where':{'role':['agent',_0x95cc('0x57'),_0x95cc('0x58')]},'attributes':['id',_0x95cc('0x59'),'name',_0x95cc('0x5a'),_0x95cc('0x5b'),_0x95cc('0x5c'),_0x95cc('0x5d'),_0x95cc('0x5e'),_0x95cc('0x5f'),_0x95cc('0x60')],'order':qs[_0x95cc('0x3d')](_0x95cc('0x61')),'include':[{'model':db['VoiceQueue'],'as':'VoiceQueues','attributes':['id',_0x95cc('0x2c'),'type'],'through':{'attributes':[]}}]})['then'](function(_0x2d8940){if(_0x2d8940){var _0x280945=_0x1df6bb[_0x95cc('0x58')]['get']({'plain':!![]});if(!_0x280945)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x280945['role']===_0x95cc('0x58')){return db[_0x95cc('0x62')][_0x95cc('0x4a')]({'where':{'name':_0x95cc('0x63'),'userProfileId':_0x280945[_0x95cc('0x64')]},'raw':!![]})[_0x95cc('0x2a')](function(_0x598134){if(_0x598134){if(_0x598134['autoAssociation']===0x0){return db[_0x95cc('0x65')][_0x95cc('0x56')]({'where':{'sectionId':_0x598134['id']},'raw':!![]})['then'](function(_0x1c2261){var _0x15a3c2=[];if(_[_0x95cc('0x66')](_0x1c2261)){_0x15a3c2=_[_0x95cc('0x41')](_0x2d8940,function(_0x505395){if(_0x505395['role']!=='agent'){return _0x505395;}});return _0x15a3c2;}else{for(var _0x1a5f2f=0x0;_0x1a5f2f<_0x2d8940[_0x95cc('0x3b')];_0x1a5f2f++){var _0x41aa93=_0x2d8940[_0x1a5f2f];if(_0x41aa93[_0x95cc('0x5a')]===_0x95cc('0x67')){var _0x2b13ac=_[_0x95cc('0x4a')](_0x1c2261,function(_0x3d0a37){return _0x3d0a37[_0x95cc('0x68')]===_0x41aa93['id'];});if(_0x2b13ac)_0x15a3c2['push'](_0x41aa93);}else{_0x15a3c2['push'](_0x41aa93);}}return _0x15a3c2;}});}else{return _0x2d8940;}}else{var _0x4b8ef0=_['filter'](_0x2d8940,function(_0x1a4f1d){if(_0x1a4f1d['role']!=='agent'){return _0x1a4f1d;}});return _0x4b8ef0;}});}else{return _0x2d8940;}}})[_0x95cc('0x2a')](function(_0x393c26){var _0x14b7d6=[];if(_0x393c26){_0x436c2b=_0x393c26;for(var _0x126a79=0x0;_0x126a79<_0x393c26['length'];_0x126a79+=0x1){_0x436c2b[_0x126a79][_0x95cc('0x50')]=[];_0x14b7d6[_0x95cc('0x69')](db[_0x95cc('0x30')][_0x95cc('0x4a')]({'where':{'FromId':[_0x1df6bb['user']['id'],_0x393c26[_0x126a79]['id']],'ToId':[_0x1df6bb[_0x95cc('0x58')]['id'],_0x393c26[_0x126a79]['id']],'ChatGroupId':null},'attributes':['id',_0x95cc('0x51'),_0x95cc('0x6a'),_0x95cc('0x6b'),'read',_0x95cc('0x4c')],'order':qs['sort'](_0x95cc('0x6c')),'limit':0x1,'offset':0x0,'raw':!![]})[_0x95cc('0x2a')](wrapUser(_0x393c26[_0x126a79])));}return BPromise[_0x95cc('0x6d')](_0x14b7d6);}return[];})['then'](function(_0x170593){return{'rows':_0x170593,'count':_0x170593['length']};})[_0x95cc('0x2a')](respondWithResult(_0x2345d9,null))['catch'](handleError(_0x2345d9,null));};
\ No newline at end of file
+var _0x038a=['format','YYYY-MM-DD\x20HH:mm:ss','lastMessage','getUsers','User','agent','admin','fullname','internal','online','lastLoginAt','-online','VoiceQueue','VoiceQueues','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','Agents','userProfileId','UserProfileResource','isEmpty','resourceId','length','FromId','-createdAt','all','eml-format','rimraf','zip-dir','request-promise','bluebird','util','path','sox','ejs','fs-extra','lodash','crypto','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','localhost','socket.io-emitter','register','status','end','offset','undefined','limit','count','apply','reject','save','update','then','destroy','sendStatus','error','stack','name','send','index','ChatInternalMessage','rawAttributes','type','key','model','map','keys','filters','intersection','query','attributes','fields','hasOwnProperty','nolimit','order','sort','where','pick','filter','VIRTUAL','options','include','findAll','rows','catch','show','params','includeAll','merge','find','create','body','describe','get','messages','createdAt','lastMessageAt'];(function(_0x1de3c4,_0x5e7331){var _0x29f90=function(_0x203f45){while(--_0x203f45){_0x1de3c4['push'](_0x1de3c4['shift']());}};_0x29f90(++_0x5e7331);}(_0x038a,0x1df));var _0xa038=function(_0x49052b,_0x3ba709){_0x49052b=_0x49052b-0x0;var _0x48c045=_0x038a[_0x49052b];return _0x48c045;};'use strict';var emlformat=require(_0xa038('0x0'));var rimraf=require(_0xa038('0x1'));var zipdir=require(_0xa038('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xa038('0x3'));var moment=require('moment');var BPromise=require(_0xa038('0x4'));var Mustache=require('mustache');var util=require(_0xa038('0x5'));var path=require(_0xa038('0x6'));var sox=require(_0xa038('0x7'));var csv=require('to-csv');var ejs=require(_0xa038('0x8'));var fs=require('fs');var fs_extra=require(_0xa038('0x9'));var _=require(_0xa038('0xa'));var squel=require('squel');var crypto=require(_0xa038('0xb'));var jsforce=require(_0xa038('0xc'));var deskjs=require(_0xa038('0xd'));var toCsv=require(_0xa038('0xe'));var querystring=require(_0xa038('0xf'));var Papa=require(_0xa038('0x10'));var Redis=require(_0xa038('0x11'));var authService=require(_0xa038('0x12'));var qs=require('../../components/parsers/qs');var as=require(_0xa038('0x13'));var hardwareService=require(_0xa038('0x14'));var logger=require(_0xa038('0x15'))('api');var utils=require(_0xa038('0x16'));var config=require(_0xa038('0x17'));var licenseUtil=require(_0xa038('0x18'));var db=require(_0xa038('0x19'))['db'];config[_0xa038('0x1a')]=_[_0xa038('0x1b')](config[_0xa038('0x1a')],{'host':_0xa038('0x1c'),'port':0x18eb});var socket=require(_0xa038('0x1d'))(new Redis(config[_0xa038('0x1a')]));require('./chatInternalMessage.socket')[_0xa038('0x1e')](socket);function respondWithStatusCode(_0x32e39e,_0xc49f3c){_0xc49f3c=_0xc49f3c||0xcc;return function(_0x47ba1a){if(_0x47ba1a){return _0x32e39e['sendStatus'](_0xc49f3c);}return _0x32e39e[_0xa038('0x1f')](_0xc49f3c)[_0xa038('0x20')]();};}function respondWithResult(_0x23b616,_0x50dae2){_0x50dae2=_0x50dae2||0xc8;return function(_0x406e1f){if(_0x406e1f){return _0x23b616[_0xa038('0x1f')](_0x50dae2)['json'](_0x406e1f);}};}function respondWithFilteredResult(_0x182ddf,_0x37b520){return function(_0x4e9574){if(_0x4e9574){var _0xb45a7f=typeof _0x37b520[_0xa038('0x21')]===_0xa038('0x22')&&typeof _0x37b520[_0xa038('0x23')]==='undefined';var _0x5b633e=_0x4e9574[_0xa038('0x24')];var _0x192e42=_0xb45a7f?0x0:_0x37b520['offset'];var _0xef672d=_0xb45a7f?_0x4e9574[_0xa038('0x24')]:_0x37b520[_0xa038('0x21')]+_0x37b520[_0xa038('0x23')];var _0x142e89;if(_0xef672d>=_0x5b633e){_0xef672d=_0x5b633e;_0x142e89=0xc8;}else{_0x142e89=0xce;}_0x182ddf[_0xa038('0x1f')](_0x142e89);return _0x182ddf['set']('Content-Range',_0x192e42+'-'+_0xef672d+'/'+_0x5b633e)['json'](_0x4e9574);}return null;};}function patchUpdates(_0x437999){return function(_0x49d26c){try{jsonpatch[_0xa038('0x25')](_0x49d26c,_0x437999,!![]);}catch(_0x2b6e56){return BPromise[_0xa038('0x26')](_0x2b6e56);}return _0x49d26c[_0xa038('0x27')]();};}function saveUpdates(_0x302c75,_0x2b5c6d){return function(_0x1147c0){if(_0x1147c0){return _0x1147c0[_0xa038('0x28')](_0x302c75)[_0xa038('0x29')](function(_0x4d679a){return _0x4d679a;});}return null;};}function removeEntity(_0x5c4e5e,_0x2dd227){return function(_0xaa7068){if(_0xaa7068){return _0xaa7068[_0xa038('0x2a')]()[_0xa038('0x29')](function(){_0x5c4e5e[_0xa038('0x1f')](0xcc)[_0xa038('0x20')]();});}};}function handleEntityNotFound(_0x47a677,_0x4a1f37){return function(_0x21979c){if(!_0x21979c){_0x47a677[_0xa038('0x2b')](0x194);}return _0x21979c;};}function handleError(_0x2dbabd,_0x3e9f7d){_0x3e9f7d=_0x3e9f7d||0x1f4;return function(_0xae0b40){logger[_0xa038('0x2c')](_0xae0b40[_0xa038('0x2d')]);if(_0xae0b40['name']){delete _0xae0b40[_0xa038('0x2e')];}_0x2dbabd['status'](_0x3e9f7d)[_0xa038('0x2f')](_0xae0b40);};}exports[_0xa038('0x30')]=function(_0x33e6fb,_0x7bd836){var _0xe66002={},_0x4dd000={},_0x127e82={'count':0x0,'rows':[]};var _0x1015e0=_['map'](db[_0xa038('0x31')][_0xa038('0x32')],function(_0x56bfb6){return{'name':_0x56bfb6['fieldName'],'type':_0x56bfb6[_0xa038('0x33')][_0xa038('0x34')]};});_0x4dd000[_0xa038('0x35')]=_[_0xa038('0x36')](_0x1015e0,_0xa038('0x2e'));_0x4dd000['query']=_[_0xa038('0x37')](_0x33e6fb['query']);_0x4dd000[_0xa038('0x38')]=_[_0xa038('0x39')](_0x4dd000[_0xa038('0x35')],_0x4dd000[_0xa038('0x3a')]);_0xe66002[_0xa038('0x3b')]=_['intersection'](_0x4dd000[_0xa038('0x35')],qs[_0xa038('0x3c')](_0x33e6fb[_0xa038('0x3a')][_0xa038('0x3c')]));_0xe66002[_0xa038('0x3b')]=_0xe66002[_0xa038('0x3b')]['length']?_0xe66002[_0xa038('0x3b')]:_0x4dd000[_0xa038('0x35')];if(!_0x33e6fb[_0xa038('0x3a')][_0xa038('0x3d')](_0xa038('0x3e'))){_0xe66002[_0xa038('0x23')]=qs[_0xa038('0x23')](_0x33e6fb[_0xa038('0x3a')][_0xa038('0x23')]);_0xe66002[_0xa038('0x21')]=qs[_0xa038('0x21')](_0x33e6fb[_0xa038('0x3a')][_0xa038('0x21')]);}_0xe66002[_0xa038('0x3f')]=qs['sort'](_0x33e6fb[_0xa038('0x3a')][_0xa038('0x40')]);_0xe66002[_0xa038('0x41')]=qs[_0xa038('0x38')](_[_0xa038('0x42')](_0x33e6fb[_0xa038('0x3a')],_0x4dd000[_0xa038('0x38')]),_0x1015e0);if(_0x33e6fb[_0xa038('0x3a')][_0xa038('0x43')]){_0xe66002[_0xa038('0x41')]=_['merge'](_0xe66002[_0xa038('0x41')],{'$or':_[_0xa038('0x36')](_0x1015e0,function(_0x3ff2f6){if(_0x3ff2f6[_0xa038('0x33')]!==_0xa038('0x44')){var _0x5b4b8c={};_0x5b4b8c[_0x3ff2f6[_0xa038('0x2e')]]={'$like':'%'+_0x33e6fb[_0xa038('0x3a')]['filter']+'%'};return _0x5b4b8c;}})});}_0xe66002=_['merge']({},_0xe66002,_0x33e6fb[_0xa038('0x45')]);var _0x58e496={'where':_0xe66002['where']};return db[_0xa038('0x31')]['count'](_0x58e496)['then'](function(_0x4ac28b){_0x127e82[_0xa038('0x24')]=_0x4ac28b;if(_0x33e6fb[_0xa038('0x3a')]['includeAll']){_0xe66002[_0xa038('0x46')]=[{'all':!![]}];}return db[_0xa038('0x31')][_0xa038('0x47')](_0xe66002);})[_0xa038('0x29')](function(_0x39c9f3){_0x127e82[_0xa038('0x48')]=_0x39c9f3;return _0x127e82;})[_0xa038('0x29')](respondWithFilteredResult(_0x7bd836,_0xe66002))[_0xa038('0x49')](handleError(_0x7bd836,null));};exports[_0xa038('0x4a')]=function(_0xf2ff9f,_0x32fe1b){var _0x3ec38e={'raw':!![],'where':{'id':_0xf2ff9f[_0xa038('0x4b')]['id']}},_0x36bb4c={};_0x36bb4c[_0xa038('0x35')]=_['keys'](db[_0xa038('0x31')][_0xa038('0x32')]);_0x36bb4c[_0xa038('0x3a')]=_[_0xa038('0x37')](_0xf2ff9f[_0xa038('0x3a')]);_0x36bb4c[_0xa038('0x38')]=_[_0xa038('0x39')](_0x36bb4c[_0xa038('0x35')],_0x36bb4c[_0xa038('0x3a')]);_0x3ec38e[_0xa038('0x3b')]=_[_0xa038('0x39')](_0x36bb4c[_0xa038('0x35')],qs['fields'](_0xf2ff9f[_0xa038('0x3a')][_0xa038('0x3c')]));_0x3ec38e[_0xa038('0x3b')]=_0x3ec38e[_0xa038('0x3b')]['length']?_0x3ec38e[_0xa038('0x3b')]:_0x36bb4c['model'];if(_0xf2ff9f[_0xa038('0x3a')][_0xa038('0x4c')]){_0x3ec38e[_0xa038('0x46')]=[{'all':!![]}];}_0x3ec38e=_[_0xa038('0x4d')]({},_0x3ec38e,_0xf2ff9f[_0xa038('0x45')]);return db[_0xa038('0x31')][_0xa038('0x4e')](_0x3ec38e)['then'](handleEntityNotFound(_0x32fe1b,null))[_0xa038('0x29')](respondWithResult(_0x32fe1b,null))['catch'](handleError(_0x32fe1b,null));};exports[_0xa038('0x4f')]=function(_0x1ec3dc,_0xcf252b){return db[_0xa038('0x31')][_0xa038('0x4f')](_0x1ec3dc['body'],{})[_0xa038('0x29')](respondWithResult(_0xcf252b,0xc9))[_0xa038('0x49')](handleError(_0xcf252b,null));};exports[_0xa038('0x28')]=function(_0x460895,_0x909911){if(_0x460895[_0xa038('0x50')]['id']){delete _0x460895[_0xa038('0x50')]['id'];}return db['ChatInternalMessage'][_0xa038('0x4e')]({'where':{'id':_0x460895['params']['id']}})['then'](handleEntityNotFound(_0x909911,null))[_0xa038('0x29')](saveUpdates(_0x460895[_0xa038('0x50')],null))[_0xa038('0x29')](respondWithResult(_0x909911,null))[_0xa038('0x49')](handleError(_0x909911,null));};exports['destroy']=function(_0x1d49ea,_0x188913){return db[_0xa038('0x31')]['find']({'where':{'id':_0x1d49ea[_0xa038('0x4b')]['id']}})[_0xa038('0x29')](handleEntityNotFound(_0x188913,null))['then'](removeEntity(_0x188913,null))[_0xa038('0x49')](handleError(_0x188913,null));};exports[_0xa038('0x51')]=function(_0x513dde,_0x4959a0){return db[_0xa038('0x31')]['describe']()[_0xa038('0x29')](respondWithResult(_0x4959a0,null))[_0xa038('0x49')](handleError(_0x4959a0,null));};function wrapUser(_0x342fd8){return function(_0x2f08e9){var _0xd6263a=_0x342fd8[_0xa038('0x52')]({'plain':!![]});_0xd6263a[_0xa038('0x53')]=[];if(_0x2f08e9){_0xd6263a['lastMessageAt']=_0x2f08e9[_0xa038('0x54')];_0xd6263a['lastMessage']=_0x2f08e9;}else{_0xd6263a[_0xa038('0x55')]=moment(0x0)[_0xa038('0x56')](_0xa038('0x57'));_0xd6263a[_0xa038('0x58')]={};}return _0xd6263a;};}exports[_0xa038('0x59')]=function(_0x495eac,_0x3a681b,_0x740479){var _0x2c181f=[];return db[_0xa038('0x5a')]['findAll']({'where':{'role':[_0xa038('0x5b'),_0xa038('0x5c'),'user']},'attributes':['id',_0xa038('0x5d'),'name','role','userpic',_0xa038('0x5e'),_0xa038('0x5f'),_0xa038('0x60'),'allowmessenger','showWebBar'],'order':qs['sort'](_0xa038('0x61')),'include':[{'model':db[_0xa038('0x62')],'as':_0xa038('0x63'),'attributes':['id',_0xa038('0x2e'),_0xa038('0x33')],'through':{'attributes':[]}}]})[_0xa038('0x29')](function(_0x3bb6f8){if(_0x3bb6f8){var _0x4b6770=_0x495eac[_0xa038('0x64')][_0xa038('0x52')]({'plain':!![]});if(!_0x4b6770)throw new Error(_0xa038('0x65'));if(_0x4b6770[_0xa038('0x66')]===_0xa038('0x64')){return db[_0xa038('0x67')]['find']({'where':{'name':_0xa038('0x68'),'userProfileId':_0x4b6770[_0xa038('0x69')]},'raw':!![]})[_0xa038('0x29')](function(_0x14668f){if(_0x14668f){if(_0x14668f['autoAssociation']===0x0){return db[_0xa038('0x6a')][_0xa038('0x47')]({'where':{'sectionId':_0x14668f['id']},'raw':!![]})[_0xa038('0x29')](function(_0x283081){var _0x48b53=[];if(_[_0xa038('0x6b')](_0x283081)){_0x48b53=_[_0xa038('0x43')](_0x3bb6f8,function(_0xc3d5e6){if(_0xc3d5e6['role']!==_0xa038('0x5b')){return _0xc3d5e6;}});return _0x48b53;}else{for(var _0x42b605=0x0;_0x42b605<_0x3bb6f8['length'];_0x42b605++){var _0x46cb1e=_0x3bb6f8[_0x42b605];if(_0x46cb1e[_0xa038('0x66')]===_0xa038('0x5b')){var _0x434588=_['find'](_0x283081,function(_0x48a71c){return _0x48a71c[_0xa038('0x6c')]===_0x46cb1e['id'];});if(_0x434588)_0x48b53['push'](_0x46cb1e);}else{_0x48b53['push'](_0x46cb1e);}}return _0x48b53;}});}else{return _0x3bb6f8;}}else{var _0x4262a2=_[_0xa038('0x43')](_0x3bb6f8,function(_0x19bffc){if(_0x19bffc[_0xa038('0x66')]!==_0xa038('0x5b')){return _0x19bffc;}});return _0x4262a2;}});}else{return _0x3bb6f8;}}})['then'](function(_0x3921e2){var _0x27920b=[];if(_0x3921e2){_0x2c181f=_0x3921e2;for(var _0x32fa55=0x0;_0x32fa55<_0x3921e2[_0xa038('0x6d')];_0x32fa55+=0x1){_0x2c181f[_0x32fa55][_0xa038('0x53')]=[];_0x27920b['push'](db[_0xa038('0x31')][_0xa038('0x4e')]({'where':{'FromId':[_0x495eac['user']['id'],_0x3921e2[_0x32fa55]['id']],'ToId':[_0x495eac[_0xa038('0x64')]['id'],_0x3921e2[_0x32fa55]['id']],'ChatGroupId':null},'attributes':['id',_0xa038('0x54'),_0xa038('0x6e'),'ToId','read',_0xa038('0x50')],'order':qs[_0xa038('0x40')](_0xa038('0x6f')),'limit':0x1,'offset':0x0,'raw':!![]})[_0xa038('0x29')](wrapUser(_0x3921e2[_0x32fa55])));}return BPromise[_0xa038('0x70')](_0x27920b);}return[];})[_0xa038('0x29')](function(_0x1e0bd2){return{'rows':_0x1e0bd2,'count':_0x1e0bd2[_0xa038('0x6d')]};})[_0xa038('0x29')](respondWithResult(_0x3a681b,null))['catch'](handleError(_0x3a681b,null));};
\ No newline at end of file
diff --git a/server/api/chatInternalMessage/chatInternalMessage.events.js b/server/api/chatInternalMessage/chatInternalMessage.events.js
index 5476994..2822570 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 _0x2fa7=['events','ChatInternalMessage','setMaxListeners','save','update','remove','emit','exports'];(function(_0x4a4d6b,_0x3306de){var _0x17d85e=function(_0x2dd1a1){while(--_0x2dd1a1){_0x4a4d6b['push'](_0x4a4d6b['shift']());}};_0x17d85e(++_0x3306de);}(_0x2fa7,0xe0));var _0x72fa=function(_0x82cd19,_0x525c63){_0x82cd19=_0x82cd19-0x0;var _0x1cebcc=_0x2fa7[_0x82cd19];return _0x1cebcc;};'use strict';var EventEmitter=require(_0x72fa('0x0'));var ChatInternalMessage=require('../../mysqldb')['db'][_0x72fa('0x1')];var ChatInternalMessageEvents=new EventEmitter();ChatInternalMessageEvents[_0x72fa('0x2')](0x0);var events={'afterCreate':_0x72fa('0x3'),'afterUpdate':_0x72fa('0x4'),'afterDestroy':_0x72fa('0x5')};function emitEvent(_0x3e7e22){return function(_0x3ac74e,_0x287cd1,_0x385932){ChatInternalMessageEvents[_0x72fa('0x6')](_0x3e7e22+':'+_0x3ac74e['id'],_0x3ac74e);ChatInternalMessageEvents[_0x72fa('0x6')](_0x3e7e22,_0x3ac74e);_0x385932(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];ChatInternalMessage['hook'](e,emitEvent(event));}}module[_0x72fa('0x7')]=ChatInternalMessageEvents;
\ No newline at end of file
+var _0x327b=['remove','hasOwnProperty','exports','events','../../mysqldb','ChatInternalMessage','save','update'];(function(_0x8b9e62,_0x173b44){var _0x31a9a0=function(_0x5cacf7){while(--_0x5cacf7){_0x8b9e62['push'](_0x8b9e62['shift']());}};_0x31a9a0(++_0x173b44);}(_0x327b,0xfb));var _0xb327=function(_0x2235bf,_0x3a06a7){_0x2235bf=_0x2235bf-0x0;var _0x4c3a64=_0x327b[_0x2235bf];return _0x4c3a64;};'use strict';var EventEmitter=require(_0xb327('0x0'));var ChatInternalMessage=require(_0xb327('0x1'))['db'][_0xb327('0x2')];var ChatInternalMessageEvents=new EventEmitter();ChatInternalMessageEvents['setMaxListeners'](0x0);var events={'afterCreate':_0xb327('0x3'),'afterUpdate':_0xb327('0x4'),'afterDestroy':_0xb327('0x5')};function emitEvent(_0x478352){return function(_0x423e90,_0x520185,_0x5b7c49){ChatInternalMessageEvents['emit'](_0x478352+':'+_0x423e90['id'],_0x423e90);ChatInternalMessageEvents['emit'](_0x478352,_0x423e90);_0x5b7c49(null);};}for(var e in events){if(events[_0xb327('0x6')](e)){var event=events[e];ChatInternalMessage['hook'](e,emitEvent(event));}}module[_0xb327('0x7')]=ChatInternalMessageEvents;
\ No newline at end of file
diff --git a/server/api/chatInternalMessage/chatInternalMessage.model.js b/server/api/chatInternalMessage/chatInternalMessage.model.js
index 6f72428..3919bda 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 _0xcf06=['request-promise','path','rimraf','define','ChatInternalMessage','chat_internal_messages','utf8mb4','utf8mb4_unicode_ci','lodash','util','../../config/logger','api','moment'];(function(_0x432682,_0x253044){var _0x463d05=function(_0xa73403){while(--_0xa73403){_0x432682['push'](_0x432682['shift']());}};_0x463d05(++_0x253044);}(_0xcf06,0xd8));var _0x6cf0=function(_0x5aa2e2,_0x44c8ee){_0x5aa2e2=_0x5aa2e2-0x0;var _0x392dc3=_0xcf06[_0x5aa2e2];return _0x392dc3;};'use strict';var _=require(_0x6cf0('0x0'));var util=require(_0x6cf0('0x1'));var logger=require(_0x6cf0('0x2'))(_0x6cf0('0x3'));var moment=require(_0x6cf0('0x4'));var BPromise=require('bluebird');var rp=require(_0x6cf0('0x5'));var fs=require('fs');var path=require(_0x6cf0('0x6'));var rimraf=require(_0x6cf0('0x7'));var config=require('../../config/environment');var attributes=require('./chatInternalMessage.attributes');module['exports']=function(_0x55d1d7,_0x1aecba){return _0x55d1d7[_0x6cf0('0x8')](_0x6cf0('0x9'),attributes,{'tableName':_0x6cf0('0xa'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x6cf0('0xb'),'collate':_0x6cf0('0xc')});};
\ No newline at end of file
+var _0x8f5c=['../../config/logger','api','bluebird','request-promise','rimraf','../../config/environment','./chatInternalMessage.attributes','exports','define','chat_internal_messages','utf8mb4','utf8mb4_unicode_ci'];(function(_0x6ad3b3,_0xafae37){var _0x5ef3d7=function(_0x5af1ab){while(--_0x5af1ab){_0x6ad3b3['push'](_0x6ad3b3['shift']());}};_0x5ef3d7(++_0xafae37);}(_0x8f5c,0x9c));var _0xc8f5=function(_0x1f99a0,_0x50b73d){_0x1f99a0=_0x1f99a0-0x0;var _0x1e0849=_0x8f5c[_0x1f99a0];return _0x1e0849;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0xc8f5('0x0'))(_0xc8f5('0x1'));var moment=require('moment');var BPromise=require(_0xc8f5('0x2'));var rp=require(_0xc8f5('0x3'));var fs=require('fs');var path=require('path');var rimraf=require(_0xc8f5('0x4'));var config=require(_0xc8f5('0x5'));var attributes=require(_0xc8f5('0x6'));module[_0xc8f5('0x7')]=function(_0x3aa043,_0x45c807){return _0x3aa043[_0xc8f5('0x8')]('ChatInternalMessage',attributes,{'tableName':_0xc8f5('0x9'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0xc8f5('0xa'),'collate':_0xc8f5('0xb')});};
\ No newline at end of file
diff --git a/server/api/chatInternalMessage/chatInternalMessage.rpc.js b/server/api/chatInternalMessage/chatInternalMessage.rpc.js
index ccd2d59..3c2d1ea 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 _0x223c=['ChatInternalMessage,\x20%s,\x20%s','debug','ChatInternalMessage,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','message','result','catch','lodash','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','defaults','localhost','socket.io-emitter','./chatInternalMessage.socket','register','request','info'];(function(_0x5b644e,_0x2e5e07){var _0x49c6bf=function(_0x3032d9){while(--_0x3032d9){_0x5b644e['push'](_0x5b644e['shift']());}};_0x49c6bf(++_0x2e5e07);}(_0x223c,0x1c9));var _0xc223=function(_0x2dafbe,_0x5d04de){_0x2dafbe=_0x2dafbe-0x0;var _0x58a45a=_0x223c[_0x2dafbe];return _0x58a45a;};'use strict';var _=require(_0xc223('0x0'));var util=require('util');var moment=require(_0xc223('0x1'));var BPromise=require(_0xc223('0x2'));var rs=require(_0xc223('0x3'));var fs=require('fs');var Redis=require(_0xc223('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0xc223('0x5'));var logger=require(_0xc223('0x6'))(_0xc223('0x7'));var config=require(_0xc223('0x8'));var jayson=require(_0xc223('0x9'));var client=jayson[_0xc223('0xa')][_0xc223('0xb')]({'port':0x232a});config['redis']=_[_0xc223('0xc')](config['redis'],{'host':_0xc223('0xd'),'port':0x18eb});var socket=require(_0xc223('0xe'))(new Redis(config['redis']));require(_0xc223('0xf'))[_0xc223('0x10')](socket);function respondWithRpcPromise(_0x21564e,_0xc4d363,_0x5a0015){return new BPromise(function(_0x594681,_0x504903){return client[_0xc223('0x11')](_0x21564e,_0x5a0015)['then'](function(_0x5590bc){logger[_0xc223('0x12')](_0xc223('0x13'),_0xc4d363,'request\x20sent');logger[_0xc223('0x14')](_0xc223('0x15'),_0xc4d363,_0xc223('0x16'),JSON[_0xc223('0x17')](_0x5590bc));if(_0x5590bc[_0xc223('0x18')]){if(_0x5590bc[_0xc223('0x18')]['code']===0x1f4){logger[_0xc223('0x18')](_0xc223('0x13'),_0xc4d363,_0x5590bc[_0xc223('0x18')][_0xc223('0x19')]);return _0x504903(_0x5590bc['error']['message']);}logger[_0xc223('0x18')](_0xc223('0x13'),_0xc4d363,_0x5590bc[_0xc223('0x18')][_0xc223('0x19')]);return _0x594681(_0x5590bc[_0xc223('0x18')][_0xc223('0x19')]);}else{logger[_0xc223('0x12')](_0xc223('0x13'),_0xc4d363,_0xc223('0x16'));_0x594681(_0x5590bc[_0xc223('0x1a')][_0xc223('0x19')]);}})[_0xc223('0x1b')](function(_0x50a586){logger[_0xc223('0x18')](_0xc223('0x13'),_0xc4d363,_0x50a586);_0x504903(_0x50a586);});});}
\ No newline at end of file
+var _0x6302=['ChatInternalMessage,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','catch','lodash','util','moment','randomstring','ioredis','../../config/utils','../../config/logger','../../config/environment','client','http','defaults','redis','localhost','socket.io-emitter','request','then','info'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x6302,0x6c));var _0x2630=function(_0x4b37b0,_0x4ebbd1){_0x4b37b0=_0x4b37b0-0x0;var _0x44c4a6=_0x6302[_0x4b37b0];return _0x44c4a6;};'use strict';var _=require(_0x2630('0x0'));var util=require(_0x2630('0x1'));var moment=require(_0x2630('0x2'));var BPromise=require('bluebird');var rs=require(_0x2630('0x3'));var fs=require('fs');var Redis=require(_0x2630('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x2630('0x5'));var logger=require(_0x2630('0x6'))('rpc');var config=require(_0x2630('0x7'));var jayson=require('jayson/promise');var client=jayson[_0x2630('0x8')][_0x2630('0x9')]({'port':0x232a});config['redis']=_[_0x2630('0xa')](config[_0x2630('0xb')],{'host':_0x2630('0xc'),'port':0x18eb});var socket=require(_0x2630('0xd'))(new Redis(config[_0x2630('0xb')]));require('./chatInternalMessage.socket')['register'](socket);function respondWithRpcPromise(_0x4c9b52,_0x5947d7,_0x12356c){return new BPromise(function(_0x3002b0,_0xb15d0d){return client[_0x2630('0xe')](_0x4c9b52,_0x12356c)[_0x2630('0xf')](function(_0x2b39c3){logger[_0x2630('0x10')](_0x2630('0x11'),_0x5947d7,_0x2630('0x12'));logger[_0x2630('0x13')]('ChatInternalMessage,\x20%s,\x20%s,\x20%s',_0x5947d7,_0x2630('0x12'),JSON[_0x2630('0x14')](_0x2b39c3));if(_0x2b39c3[_0x2630('0x15')]){if(_0x2b39c3[_0x2630('0x15')][_0x2630('0x16')]===0x1f4){logger[_0x2630('0x15')](_0x2630('0x11'),_0x5947d7,_0x2b39c3[_0x2630('0x15')][_0x2630('0x17')]);return _0xb15d0d(_0x2b39c3[_0x2630('0x15')]['message']);}logger[_0x2630('0x15')]('ChatInternalMessage,\x20%s,\x20%s',_0x5947d7,_0x2b39c3[_0x2630('0x15')][_0x2630('0x17')]);return _0x3002b0(_0x2b39c3[_0x2630('0x15')][_0x2630('0x17')]);}else{logger[_0x2630('0x10')](_0x2630('0x11'),_0x5947d7,_0x2630('0x12'));_0x3002b0(_0x2b39c3['result'][_0x2630('0x17')]);}})[_0x2630('0x18')](function(_0x38e68a){logger[_0x2630('0x15')](_0x2630('0x11'),_0x5947d7,_0x38e68a);_0xb15d0d(_0x38e68a);});});}
\ No newline at end of file
diff --git a/server/api/chatInternalMessage/chatInternalMessage.socket.js b/server/api/chatInternalMessage/chatInternalMessage.socket.js
index 9b262b0..9c1c697 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 _0x7712=['length','chatInternalMessage:','update','emit'];(function(_0x1c2a1e,_0x1da05c){var _0x3a3cd9=function(_0x30cb87){while(--_0x30cb87){_0x1c2a1e['push'](_0x1c2a1e['shift']());}};_0x3a3cd9(++_0x1da05c);}(_0x7712,0x1de));var _0x2771=function(_0x1facfa,_0x1acf7d){_0x1facfa=_0x1facfa-0x0;var _0x9ec701=_0x7712[_0x1facfa];return _0x9ec701;};'use strict';var ChatInternalMessageEvents=require('./chatInternalMessage.events');var events=['save','remove',_0x2771('0x0')];function createListener(_0x43c5cf,_0x154435){return function(_0xcbaf81){_0x154435[_0x2771('0x1')](_0x43c5cf,_0xcbaf81);};}function removeListener(_0x39212d,_0x2ef251){return function(){ChatInternalMessageEvents['removeListener'](_0x39212d,_0x2ef251);};}exports['register']=function(_0xebc9f){for(var _0x1e2eef=0x0,_0x56c633=events[_0x2771('0x2')];_0x1e2eef<_0x56c633;_0x1e2eef++){var _0xaf608=events[_0x1e2eef];var _0x59e10c=createListener(_0x2771('0x3')+_0xaf608,_0xebc9f);ChatInternalMessageEvents['on'](_0xaf608,_0x59e10c);}};
\ No newline at end of file
+var _0xeb4e=['removeListener','chatInternalMessage:','./chatInternalMessage.events','update','emit'];(function(_0x236d24,_0x29e80a){var _0x1574cf=function(_0x5d1dad){while(--_0x5d1dad){_0x236d24['push'](_0x236d24['shift']());}};_0x1574cf(++_0x29e80a);}(_0xeb4e,0x1c4));var _0xeeb4=function(_0x42245d,_0x51758f){_0x42245d=_0x42245d-0x0;var _0x4b211a=_0xeb4e[_0x42245d];return _0x4b211a;};'use strict';var ChatInternalMessageEvents=require(_0xeeb4('0x0'));var events=['save','remove',_0xeeb4('0x1')];function createListener(_0x31c8f2,_0xfe6e67){return function(_0x151506){_0xfe6e67[_0xeeb4('0x2')](_0x31c8f2,_0x151506);};}function removeListener(_0x5dbafb,_0x10017a){return function(){ChatInternalMessageEvents[_0xeeb4('0x3')](_0x5dbafb,_0x10017a);};}exports['register']=function(_0x41ac68){for(var _0x237358=0x0,_0x5d8723=events['length'];_0x237358<_0x5d8723;_0x237358++){var _0xad229a=events[_0x237358];var _0x136ee2=createListener(_0xeeb4('0x4')+_0xad229a,_0x41ac68);ChatInternalMessageEvents['on'](_0xad229a,_0x136ee2);}};
\ No newline at end of file
diff --git a/server/api/chatInternalMessage/index.js b/server/api/chatInternalMessage/index.js
index 2867130..82eefab 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 _0xdcbf=['get','isAuthenticated','index','/describe','describe','/users','/:id','show','create','put','update','delete','destroy','exports','multer','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatInternalMessage.controller'];(function(_0x5f5413,_0x49a1f6){var _0x33bff8=function(_0x1e17c9){while(--_0x1e17c9){_0x5f5413['push'](_0x5f5413['shift']());}};_0x33bff8(++_0x49a1f6);}(_0xdcbf,0xce));var _0xfdcb=function(_0x6131cd,_0x4c26a1){_0x6131cd=_0x6131cd-0x0;var _0x47e916=_0xdcbf[_0x6131cd];return _0x47e916;};'use strict';var multer=require(_0xfdcb('0x0'));var util=require(_0xfdcb('0x1'));var path=require(_0xfdcb('0x2'));var timeout=require(_0xfdcb('0x3'));var express=require('express');var router=express[_0xfdcb('0x4')]();var fs_extra=require(_0xfdcb('0x5'));var auth=require(_0xfdcb('0x6'));var interaction=require(_0xfdcb('0x7'));var config=require(_0xfdcb('0x8'));var controller=require(_0xfdcb('0x9'));router[_0xfdcb('0xa')]('/',auth[_0xfdcb('0xb')](),controller[_0xfdcb('0xc')]);router['get'](_0xfdcb('0xd'),auth[_0xfdcb('0xb')](),controller[_0xfdcb('0xe')]);router[_0xfdcb('0xa')](_0xfdcb('0xf'),auth[_0xfdcb('0xb')](),controller['getUsers']);router[_0xfdcb('0xa')](_0xfdcb('0x10'),auth['isAuthenticated'](),controller[_0xfdcb('0x11')]);router['post']('/',auth[_0xfdcb('0xb')](),controller[_0xfdcb('0x12')]);router[_0xfdcb('0x13')]('/:id',controller[_0xfdcb('0x14')]);router[_0xfdcb('0x15')](_0xfdcb('0x10'),auth[_0xfdcb('0xb')](),controller[_0xfdcb('0x16')]);module[_0xfdcb('0x17')]=router;
\ No newline at end of file
+var _0x05ef=['/users','getUsers','/:id','show','post','create','update','delete','exports','multer','util','path','express','Router','fs-extra','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/describe','describe'];(function(_0x3740fe,_0x6c543c){var _0x55492b=function(_0x1f851f){while(--_0x1f851f){_0x3740fe['push'](_0x3740fe['shift']());}};_0x55492b(++_0x6c543c);}(_0x05ef,0xb9));var _0xf05e=function(_0x21549c,_0x6d64d1){_0x21549c=_0x21549c-0x0;var _0x426cbd=_0x05ef[_0x21549c];return _0x426cbd;};'use strict';var multer=require(_0xf05e('0x0'));var util=require(_0xf05e('0x1'));var path=require(_0xf05e('0x2'));var timeout=require('connect-timeout');var express=require(_0xf05e('0x3'));var router=express[_0xf05e('0x4')]();var fs_extra=require(_0xf05e('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0xf05e('0x6'));var config=require(_0xf05e('0x7'));var controller=require('./chatInternalMessage.controller');router[_0xf05e('0x8')]('/',auth[_0xf05e('0x9')](),controller[_0xf05e('0xa')]);router['get'](_0xf05e('0xb'),auth[_0xf05e('0x9')](),controller[_0xf05e('0xc')]);router['get'](_0xf05e('0xd'),auth[_0xf05e('0x9')](),controller[_0xf05e('0xe')]);router[_0xf05e('0x8')](_0xf05e('0xf'),auth[_0xf05e('0x9')](),controller[_0xf05e('0x10')]);router[_0xf05e('0x11')]('/',auth['isAuthenticated'](),controller[_0xf05e('0x12')]);router['put'](_0xf05e('0xf'),controller[_0xf05e('0x13')]);router[_0xf05e('0x14')](_0xf05e('0xf'),auth[_0xf05e('0x9')](),controller['destroy']);module[_0xf05e('0x15')]=router;
\ No newline at end of file
diff --git a/server/api/chatMessage/chatMessage.attributes.js b/server/api/chatMessage/chatMessage.attributes.js
index c56e0ab..2c01293 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 _0xaf4c=['out','DATE','STRING','exports','TEXT','BOOLEAN','ENUM'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xaf4c,0x1ed));var _0xcaf4=function(_0x3892f6,_0x58318e){_0x3892f6=_0x3892f6-0x0;var _0x14735c=_0xaf4c[_0x3892f6];return _0x14735c;};'use strict';var Sequelize=require('sequelize');module[_0xcaf4('0x0')]={'body':{'type':Sequelize[_0xcaf4('0x1')]('medium'),'allowNull':![]},'read':{'type':Sequelize[_0xcaf4('0x2')],'defaultValue':![]},'secret':{'type':Sequelize[_0xcaf4('0x2')],'defaultValue':![]},'direction':{'type':Sequelize[_0xcaf4('0x3')]('in','out'),'defaultValue':_0xcaf4('0x4'),'allowNull':![]},'readAt':{'type':Sequelize[_0xcaf4('0x5')]},'providerName':{'type':Sequelize[_0xcaf4('0x6')]},'providerResponse':{'type':Sequelize['TEXT']}};
\ No newline at end of file
+var _0xbb59=['TEXT','BOOLEAN','ENUM','out','DATE','sequelize','exports'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xbb59,0xec));var _0x9bb5=function(_0x27f85f,_0x30e981){_0x27f85f=_0x27f85f-0x0;var _0x32d00e=_0xbb59[_0x27f85f];return _0x32d00e;};'use strict';var Sequelize=require(_0x9bb5('0x0'));module[_0x9bb5('0x1')]={'body':{'type':Sequelize[_0x9bb5('0x2')]('medium'),'allowNull':![]},'read':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'secret':{'type':Sequelize[_0x9bb5('0x3')],'defaultValue':![]},'direction':{'type':Sequelize[_0x9bb5('0x4')]('in',_0x9bb5('0x5')),'defaultValue':_0x9bb5('0x5'),'allowNull':![]},'readAt':{'type':Sequelize[_0x9bb5('0x6')]},'providerName':{'type':Sequelize['STRING']},'providerResponse':{'type':Sequelize[_0x9bb5('0x2')]}};
\ No newline at end of file
diff --git a/server/api/chatMessage/chatMessage.controller.js b/server/api/chatMessage/chatMessage.controller.js
index 5fcebb2..ba51078 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 _0x0c3c=['offset','undefined','limit','count','set','apply','reject','update','destroy','stack','name','send','index','map','ChatMessage','rawAttributes','fieldName','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','order','sort','where','pick','filter','type','VIRTUAL','merge','options','includeAll','include','findAll','show','params','find','create','body','describe','../../config/logger','accept','read','readAt','format','YYYY-MM-DD\x20HH:mm:ss','user','UserId','ChatInteraction','ChatInteractionId','read1stAt','interaction','get','[CHATMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','null','AcceptMessage','acceptMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','Sequelize','User','agent','email','internal','channel','event','EventManager','acceptmessage','parse','formData','chat-interactions','chat','[CHATMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','role','rejectMessage','ContactId','QueryTypes','SELECT','contact','fullname','interface','SIP/%s','motionChannel','rejectmessage','eml-format','rimraf','fast-json-patch','request-promise','bluebird','mustache','path','sox','to-csv','ejs','squel','crypto','jsforce','desk.js','querystring','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','defaults','redis','localhost','socket.io-emitter','./chatMessage.socket','client','http','request','then','info','request\x20sent','debug','stringify','error','code','ChatMessage,\x20%s,\x20%s','message','result','catch','sendStatus','status','end','json'];(function(_0x3a2e28,_0x137ef6){var _0x2d378c=function(_0x130079){while(--_0x130079){_0x3a2e28['push'](_0x3a2e28['shift']());}};_0x2d378c(++_0x137ef6);}(_0x0c3c,0xdd));var _0xc0c3=function(_0x8fa4bc,_0x5cd2af){_0x8fa4bc=_0x8fa4bc-0x0;var _0x35b6a7=_0x0c3c[_0x8fa4bc];return _0x35b6a7;};'use strict';var emlformat=require(_0xc0c3('0x0'));var rimraf=require(_0xc0c3('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xc0c3('0x2'));var rp=require(_0xc0c3('0x3'));var moment=require('moment');var BPromise=require(_0xc0c3('0x4'));var Mustache=require(_0xc0c3('0x5'));var util=require('util');var path=require(_0xc0c3('0x6'));var sox=require(_0xc0c3('0x7'));var csv=require(_0xc0c3('0x8'));var ejs=require(_0xc0c3('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0xc0c3('0xa'));var crypto=require(_0xc0c3('0xb'));var jsforce=require(_0xc0c3('0xc'));var deskjs=require(_0xc0c3('0xd'));var toCsv=require('to-csv');var querystring=require(_0xc0c3('0xe'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0xc0c3('0xf'));var qs=require(_0xc0c3('0x10'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xc0c3('0x11'));var logger=require('../../config/logger')(_0xc0c3('0x12'));var utils=require(_0xc0c3('0x13'));var config=require(_0xc0c3('0x14'));var licenseUtil=require(_0xc0c3('0x15'));var db=require('../../mysqldb')['db'];config['redis']=_[_0xc0c3('0x16')](config[_0xc0c3('0x17')],{'host':_0xc0c3('0x18'),'port':0x18eb});var socket=require(_0xc0c3('0x19'))(new Redis(config[_0xc0c3('0x17')]));require(_0xc0c3('0x1a'))['register'](socket);var jayson=require('jayson/promise');var client=jayson[_0xc0c3('0x1b')][_0xc0c3('0x1c')]({'port':0x232c});var client9002=jayson[_0xc0c3('0x1b')][_0xc0c3('0x1c')]({'port':0x232a});function respondWithRpcPromise(_0x3294dd,_0x42ff68,_0x4eb32d,_0x191316){return new BPromise(function(_0xac3572,_0x1061c4){var _0x21d24d=_0x191316||client;return _0x21d24d[_0xc0c3('0x1d')](_0x3294dd,_0x4eb32d)[_0xc0c3('0x1e')](function(_0x5a961a){logger[_0xc0c3('0x1f')]('ChatMessage,\x20%s,\x20%s',_0x42ff68,_0xc0c3('0x20'));logger[_0xc0c3('0x21')]('ChatMessage,\x20%s,\x20%s,\x20%s',_0x42ff68,'request\x20sent',JSON[_0xc0c3('0x22')](_0x5a961a));if(_0x5a961a[_0xc0c3('0x23')]){if(_0x5a961a[_0xc0c3('0x23')][_0xc0c3('0x24')]===0x1f4){logger['error'](_0xc0c3('0x25'),_0x42ff68,_0x5a961a[_0xc0c3('0x23')][_0xc0c3('0x26')]);return _0x1061c4(_0x5a961a['error'][_0xc0c3('0x26')]);}logger[_0xc0c3('0x23')]('ChatMessage,\x20%s,\x20%s',_0x42ff68,_0x5a961a['error']['message']);return _0xac3572(_0x5a961a[_0xc0c3('0x23')][_0xc0c3('0x26')]);}else{logger['info'](_0xc0c3('0x25'),_0x42ff68,_0xc0c3('0x20'));_0xac3572(_0x5a961a[_0xc0c3('0x27')][_0xc0c3('0x26')]);}})[_0xc0c3('0x28')](function(_0x5ee9e3){logger[_0xc0c3('0x23')]('ChatMessage,\x20%s,\x20%s',_0x42ff68,_0x5ee9e3);_0x1061c4(_0x5ee9e3);});});}function respondWithStatusCode(_0x312c80,_0x25174a){_0x25174a=_0x25174a||0xcc;return function(_0x38583b){if(_0x38583b){return _0x312c80[_0xc0c3('0x29')](_0x25174a);}return _0x312c80[_0xc0c3('0x2a')](_0x25174a)[_0xc0c3('0x2b')]();};}function respondWithResult(_0x3a4c0c,_0x5d412b){_0x5d412b=_0x5d412b||0xc8;return function(_0x4d82dc){if(_0x4d82dc){return _0x3a4c0c['status'](_0x5d412b)[_0xc0c3('0x2c')](_0x4d82dc);}};}function respondWithFilteredResult(_0x358e03,_0x5af9ff){return function(_0x3e36e0){if(_0x3e36e0){var _0x2c2575=typeof _0x5af9ff[_0xc0c3('0x2d')]===_0xc0c3('0x2e')&&typeof _0x5af9ff[_0xc0c3('0x2f')]===_0xc0c3('0x2e');var _0x24e4d7=_0x3e36e0['count'];var _0x2eb570=_0x2c2575?0x0:_0x5af9ff[_0xc0c3('0x2d')];var _0x28dcb6=_0x2c2575?_0x3e36e0[_0xc0c3('0x30')]:_0x5af9ff['offset']+_0x5af9ff[_0xc0c3('0x2f')];var _0x422ac8;if(_0x28dcb6>=_0x24e4d7){_0x28dcb6=_0x24e4d7;_0x422ac8=0xc8;}else{_0x422ac8=0xce;}_0x358e03[_0xc0c3('0x2a')](_0x422ac8);return _0x358e03[_0xc0c3('0x31')]('Content-Range',_0x2eb570+'-'+_0x28dcb6+'/'+_0x24e4d7)['json'](_0x3e36e0);}return null;};}function patchUpdates(_0x333116){return function(_0xc18c90){try{jsonpatch[_0xc0c3('0x32')](_0xc18c90,_0x333116,!![]);}catch(_0x359856){return BPromise[_0xc0c3('0x33')](_0x359856);}return _0xc18c90['save']();};}function saveUpdates(_0x2a7f3c,_0x1d09b3){return function(_0x3f99f8){if(_0x3f99f8){return _0x3f99f8[_0xc0c3('0x34')](_0x2a7f3c)['then'](function(_0x5c423d){return _0x5c423d;});}return null;};}function removeEntity(_0x313c8a,_0x31d449){return function(_0x51ad3e){if(_0x51ad3e){return _0x51ad3e[_0xc0c3('0x35')]()[_0xc0c3('0x1e')](function(){_0x313c8a[_0xc0c3('0x2a')](0xcc)['end']();});}};}function handleEntityNotFound(_0x2e71a2,_0x3f24c2){return function(_0x52b1d7){if(!_0x52b1d7){_0x2e71a2['sendStatus'](0x194);}return _0x52b1d7;};}function handleError(_0x1a4e53,_0xe2b996){_0xe2b996=_0xe2b996||0x1f4;return function(_0x92d9c4){logger['error'](_0x92d9c4[_0xc0c3('0x36')]);if(_0x92d9c4[_0xc0c3('0x37')]){delete _0x92d9c4[_0xc0c3('0x37')];}_0x1a4e53[_0xc0c3('0x2a')](_0xe2b996)[_0xc0c3('0x38')](_0x92d9c4);};}exports[_0xc0c3('0x39')]=function(_0x183fb2,_0x2dfcaf){var _0x2206be={},_0x1a1f04={},_0x970d0a={'count':0x0,'rows':[]};var _0x151c3d=_[_0xc0c3('0x3a')](db[_0xc0c3('0x3b')][_0xc0c3('0x3c')],function(_0x5e025d){return{'name':_0x5e025d[_0xc0c3('0x3d')],'type':_0x5e025d['type'][_0xc0c3('0x3e')]};});_0x1a1f04[_0xc0c3('0x3f')]=_[_0xc0c3('0x3a')](_0x151c3d,'name');_0x1a1f04[_0xc0c3('0x40')]=_[_0xc0c3('0x41')](_0x183fb2['query']);_0x1a1f04[_0xc0c3('0x42')]=_[_0xc0c3('0x43')](_0x1a1f04[_0xc0c3('0x3f')],_0x1a1f04[_0xc0c3('0x40')]);_0x2206be[_0xc0c3('0x44')]=_['intersection'](_0x1a1f04[_0xc0c3('0x3f')],qs['fields'](_0x183fb2['query'][_0xc0c3('0x45')]));_0x2206be[_0xc0c3('0x44')]=_0x2206be[_0xc0c3('0x44')][_0xc0c3('0x46')]?_0x2206be[_0xc0c3('0x44')]:_0x1a1f04[_0xc0c3('0x3f')];if(!_0x183fb2[_0xc0c3('0x40')][_0xc0c3('0x47')]('nolimit')){_0x2206be[_0xc0c3('0x2f')]=qs[_0xc0c3('0x2f')](_0x183fb2[_0xc0c3('0x40')]['limit']);_0x2206be['offset']=qs[_0xc0c3('0x2d')](_0x183fb2['query']['offset']);}_0x2206be[_0xc0c3('0x48')]=qs[_0xc0c3('0x49')](_0x183fb2[_0xc0c3('0x40')][_0xc0c3('0x49')]);_0x2206be[_0xc0c3('0x4a')]=qs[_0xc0c3('0x42')](_[_0xc0c3('0x4b')](_0x183fb2[_0xc0c3('0x40')],_0x1a1f04[_0xc0c3('0x42')]),_0x151c3d);if(_0x183fb2['query'][_0xc0c3('0x4c')]){_0x2206be['where']=_['merge'](_0x2206be[_0xc0c3('0x4a')],{'$or':_['map'](_0x151c3d,function(_0x52d469){if(_0x52d469[_0xc0c3('0x4d')]!==_0xc0c3('0x4e')){var _0x4ef923={};_0x4ef923[_0x52d469[_0xc0c3('0x37')]]={'$like':'%'+_0x183fb2[_0xc0c3('0x40')][_0xc0c3('0x4c')]+'%'};return _0x4ef923;}})});}_0x2206be=_[_0xc0c3('0x4f')]({},_0x2206be,_0x183fb2[_0xc0c3('0x50')]);var _0x4d060c={'where':_0x2206be['where']};return db[_0xc0c3('0x3b')][_0xc0c3('0x30')](_0x4d060c)['then'](function(_0x3f2796){_0x970d0a[_0xc0c3('0x30')]=_0x3f2796;if(_0x183fb2[_0xc0c3('0x40')][_0xc0c3('0x51')]){_0x2206be[_0xc0c3('0x52')]=[{'all':!![]}];}return db[_0xc0c3('0x3b')][_0xc0c3('0x53')](_0x2206be);})[_0xc0c3('0x1e')](function(_0x4f5126){_0x970d0a['rows']=_0x4f5126;return _0x970d0a;})[_0xc0c3('0x1e')](respondWithFilteredResult(_0x2dfcaf,_0x2206be))[_0xc0c3('0x28')](handleError(_0x2dfcaf,null));};exports[_0xc0c3('0x54')]=function(_0x156270,_0x14295e){var _0x8974ca={'raw':!![],'where':{'id':_0x156270[_0xc0c3('0x55')]['id']}},_0x8a904b={};_0x8a904b['model']=_[_0xc0c3('0x41')](db[_0xc0c3('0x3b')]['rawAttributes']);_0x8a904b[_0xc0c3('0x40')]=_[_0xc0c3('0x41')](_0x156270[_0xc0c3('0x40')]);_0x8a904b['filters']=_[_0xc0c3('0x43')](_0x8a904b[_0xc0c3('0x3f')],_0x8a904b['query']);_0x8974ca['attributes']=_[_0xc0c3('0x43')](_0x8a904b[_0xc0c3('0x3f')],qs[_0xc0c3('0x45')](_0x156270[_0xc0c3('0x40')]['fields']));_0x8974ca['attributes']=_0x8974ca[_0xc0c3('0x44')][_0xc0c3('0x46')]?_0x8974ca['attributes']:_0x8a904b['model'];if(_0x156270[_0xc0c3('0x40')]['includeAll']){_0x8974ca[_0xc0c3('0x52')]=[{'all':!![]}];}_0x8974ca=_[_0xc0c3('0x4f')]({},_0x8974ca,_0x156270[_0xc0c3('0x50')]);return db[_0xc0c3('0x3b')][_0xc0c3('0x56')](_0x8974ca)['then'](handleEntityNotFound(_0x14295e,null))[_0xc0c3('0x1e')](respondWithResult(_0x14295e,null))[_0xc0c3('0x28')](handleError(_0x14295e,null));};exports['create']=function(_0x382a46,_0x799041){return db[_0xc0c3('0x3b')][_0xc0c3('0x57')](_0x382a46[_0xc0c3('0x58')],{})[_0xc0c3('0x1e')](respondWithResult(_0x799041,0xc9))[_0xc0c3('0x28')](handleError(_0x799041,null));};exports[_0xc0c3('0x34')]=function(_0x2f6c0f,_0x4f1d7d){if(_0x2f6c0f[_0xc0c3('0x58')]['id']){delete _0x2f6c0f[_0xc0c3('0x58')]['id'];}return db['ChatMessage']['find']({'where':{'id':_0x2f6c0f['params']['id']}})[_0xc0c3('0x1e')](handleEntityNotFound(_0x4f1d7d,null))['then'](saveUpdates(_0x2f6c0f['body'],null))['then'](respondWithResult(_0x4f1d7d,null))[_0xc0c3('0x28')](handleError(_0x4f1d7d,null));};exports[_0xc0c3('0x35')]=function(_0x55073a,_0xa3dcd1){return db[_0xc0c3('0x3b')][_0xc0c3('0x56')]({'where':{'id':_0x55073a[_0xc0c3('0x55')]['id']}})[_0xc0c3('0x1e')](handleEntityNotFound(_0xa3dcd1,null))[_0xc0c3('0x1e')](removeEntity(_0xa3dcd1,null))[_0xc0c3('0x28')](handleError(_0xa3dcd1,null));};exports[_0xc0c3('0x59')]=function(_0x339b87,_0x26a138){return db[_0xc0c3('0x3b')]['describe']()[_0xc0c3('0x1e')](respondWithResult(_0x26a138,null))[_0xc0c3('0x28')](handleError(_0x26a138,null));};var interaction_log=require(_0xc0c3('0x5a'))('chat-interactions');exports[_0xc0c3('0x5b')]=function(_0x1ae522,_0x4418be,_0x107914){var _0x28a0f0={'agent':{},'channel':'chat'};if(_0x1ae522['body']['id']){delete _0x1ae522[_0xc0c3('0x58')]['id'];}_0x1ae522[_0xc0c3('0x58')][_0xc0c3('0x5c')]=!![];_0x1ae522[_0xc0c3('0x58')][_0xc0c3('0x5d')]=moment()[_0xc0c3('0x5e')](_0xc0c3('0x5f'));_0x1ae522[_0xc0c3('0x58')]['UserId']=_0x1ae522[_0xc0c3('0x58')]['UserId']||_0x1ae522[_0xc0c3('0x60')]['id'];_0x28a0f0['agent']['id']=_0x1ae522[_0xc0c3('0x58')][_0xc0c3('0x61')];return db[_0xc0c3('0x3b')]['find']({'where':{'id':_0x1ae522['params']['id'],'UserId':null}})['then'](handleEntityNotFound(_0x4418be,null))[_0xc0c3('0x1e')](saveUpdates(_0x1ae522[_0xc0c3('0x58')],null))[_0xc0c3('0x1e')](function(_0x45301e){if(_0x45301e){_0x28a0f0[_0xc0c3('0x26')]=_0x45301e['get']({'plain':!![]});return db[_0xc0c3('0x62')][_0xc0c3('0x56')]({'where':{'id':_0x45301e[_0xc0c3('0x63')]}});}return null;})['then'](handleEntityNotFound(_0x4418be,null))['then'](function(_0x26d8a9){if(_0x26d8a9){return _0x26d8a9[_0xc0c3('0x34')]({'UserId':_0x1ae522['body'][_0xc0c3('0x61')],'read1stAt':_['isNil'](_0x26d8a9[_0xc0c3('0x64')])?moment()[_0xc0c3('0x5e')](_0xc0c3('0x5f')):undefined});}return null;})[_0xc0c3('0x1e')](function(_0x190f3f){if(_0x190f3f){_0x28a0f0[_0xc0c3('0x65')]=_0x190f3f[_0xc0c3('0x66')]({'plain':!![]});interaction_log[_0xc0c3('0x1f')](_0xc0c3('0x67'),_0x1ae522['user']['id'],_0x1ae522[_0xc0c3('0x60')][_0xc0c3('0x37')],_0x1ae522[_0xc0c3('0x60')]['role'],_0x28a0f0[_0xc0c3('0x65')]['id'],_0x1ae522['body']?JSON['stringify'](_0x1ae522[_0xc0c3('0x58')]):_0xc0c3('0x68'));return respondWithRpcPromise(_0xc0c3('0x69'),_0xc0c3('0x6a'),_0x28a0f0);}return null;})[_0xc0c3('0x1e')](function(_0x3b0fae){var _0x511ba3=_0xc0c3('0x6b')+_0x3b0fae['message']['ContactId'];return db['sequelize'][_0xc0c3('0x40')](_0x511ba3,{'type':db[_0xc0c3('0x6c')]['QueryTypes']['SELECT'],'raw':!![]})[_0xc0c3('0x1e')](function(_0x278b95){return _0x278b95;});})[_0xc0c3('0x1e')](function(_0x56accd){if(_0x56accd){_0x28a0f0[_0xc0c3('0x26')]['contact']=_0x56accd[0x0];if(!_0x1ae522['body'][_0xc0c3('0x61')])return;return db[_0xc0c3('0x6d')][_0xc0c3('0x56')]({'where':{'id':_0x1ae522[_0xc0c3('0x58')][_0xc0c3('0x61')],'role':_0xc0c3('0x6e')},'attributes':['id',_0xc0c3('0x37'),'fullname',_0xc0c3('0x6f'),_0xc0c3('0x70')],'raw':!![]});}return null;})[_0xc0c3('0x1e')](function(_0x12c936){if(!_0x12c936)return null;_0x28a0f0[_0xc0c3('0x26')][_0xc0c3('0x6e')]=_0x12c936;return _0x28a0f0;})[_0xc0c3('0x1e')](function(_0x23fe08){if(_0x23fe08){if(_0x1ae522[_0xc0c3('0x58')]['manual']){_0x28a0f0['message']['interface']=util[_0xc0c3('0x5e')]('SIP/%s',_0x1ae522[_0xc0c3('0x60')][_0xc0c3('0x37')]);_0x28a0f0[_0xc0c3('0x26')][_0xc0c3('0x71')]=_0x28a0f0[_0xc0c3('0x71')];_0x28a0f0[_0xc0c3('0x26')]['motionChannel']=_0x28a0f0[_0xc0c3('0x71')];_0x28a0f0['message'][_0xc0c3('0x72')]=_0xc0c3('0x5b');return respondWithRpcPromise(_0xc0c3('0x73'),_0xc0c3('0x73'),{'event':_0xc0c3('0x74'),'message':_[_0xc0c3('0x4f')](_0x28a0f0['message'],JSON[_0xc0c3('0x75')](_0x28a0f0[_0xc0c3('0x65')][_0xc0c3('0x76')]))},client9002)[_0xc0c3('0x1e')](function(){return _0x28a0f0;});}return _0x28a0f0;}return null;})[_0xc0c3('0x1e')](respondWithResult(_0x4418be,null))['catch'](handleError(_0x4418be,null));};var interaction_log=require(_0xc0c3('0x5a'))(_0xc0c3('0x77'));exports[_0xc0c3('0x33')]=function(_0x4913c7,_0x3640d2,_0x1e513d){var _0x44b57f={'agent':{},'channel':_0xc0c3('0x78')};if(_0x4913c7[_0xc0c3('0x58')]['id']){delete _0x4913c7['body']['id'];}_0x4913c7[_0xc0c3('0x58')]['UserId']=_0x4913c7['body']['UserId']||_0x4913c7['user']['id'];_0x44b57f[_0xc0c3('0x6e')]['id']=_0x4913c7[_0xc0c3('0x58')][_0xc0c3('0x61')];return db['ChatMessage'][_0xc0c3('0x56')]({'where':{'id':_0x4913c7[_0xc0c3('0x55')]['id'],'UserId':null}})['then'](handleEntityNotFound(_0x3640d2,null))[_0xc0c3('0x1e')](function(_0x2db76d){if(_0x2db76d){_0x44b57f[_0xc0c3('0x26')]=_0x2db76d[_0xc0c3('0x66')]({'plain':!![]});return db[_0xc0c3('0x62')][_0xc0c3('0x56')]({'where':{'id':_0x2db76d[_0xc0c3('0x63')]}});}return null;})[_0xc0c3('0x1e')](handleEntityNotFound(_0x3640d2,null))[_0xc0c3('0x1e')](function(_0x1ea2cc){if(_0x1ea2cc){_0x44b57f[_0xc0c3('0x65')]=_0x1ea2cc[_0xc0c3('0x66')]({'plain':!![]});interaction_log[_0xc0c3('0x1f')](_0xc0c3('0x79'),_0x4913c7[_0xc0c3('0x60')]['id'],_0x4913c7[_0xc0c3('0x60')][_0xc0c3('0x37')],_0x4913c7[_0xc0c3('0x60')][_0xc0c3('0x7a')],_0x44b57f[_0xc0c3('0x65')]['id'],_0x4913c7[_0xc0c3('0x58')]?JSON[_0xc0c3('0x22')](_0x4913c7[_0xc0c3('0x58')]):'null');return respondWithRpcPromise('RejectMessage',_0xc0c3('0x7b'),_0x44b57f);}return null;})[_0xc0c3('0x1e')](function(_0xed26eb){var _0x428c65=_0xc0c3('0x6b')+_0xed26eb[_0xc0c3('0x26')][_0xc0c3('0x7c')];return db['sequelize']['query'](_0x428c65,{'type':db['Sequelize'][_0xc0c3('0x7d')][_0xc0c3('0x7e')],'raw':!![]})[_0xc0c3('0x1e')](function(_0x4860b2){return _0x4860b2;});})['then'](function(_0x3ba500){if(_0x3ba500){_0x44b57f[_0xc0c3('0x26')][_0xc0c3('0x7f')]=_0x3ba500[0x0];if(!_0x4913c7[_0xc0c3('0x58')][_0xc0c3('0x61')])return;return db[_0xc0c3('0x6d')]['find']({'where':{'id':_0x4913c7[_0xc0c3('0x58')][_0xc0c3('0x61')],'role':_0xc0c3('0x6e')},'attributes':['id',_0xc0c3('0x37'),_0xc0c3('0x80'),_0xc0c3('0x6f'),_0xc0c3('0x70')],'raw':!![]});}return null;})[_0xc0c3('0x1e')](function(_0x1e98ef){if(!_0x1e98ef)return null;_0x44b57f['message'][_0xc0c3('0x6e')]=_0x1e98ef;return _0x44b57f;})['then'](function(_0x2f2409){if(_0x2f2409){_0x2f2409['message'][_0xc0c3('0x81')]=util['format'](_0xc0c3('0x82'),_0x4913c7[_0xc0c3('0x60')][_0xc0c3('0x37')]);_0x2f2409[_0xc0c3('0x26')]['channel']=_0x44b57f['channel'];_0x2f2409[_0xc0c3('0x26')][_0xc0c3('0x83')]=_0x44b57f[_0xc0c3('0x71')];_0x2f2409[_0xc0c3('0x26')][_0xc0c3('0x72')]='reject';respondWithRpcPromise(_0xc0c3('0x73'),_0xc0c3('0x73'),{'event':_0xc0c3('0x84'),'message':_[_0xc0c3('0x4f')](_0x44b57f['message'],JSON[_0xc0c3('0x75')](_0x44b57f['interaction'][_0xc0c3('0x76')]))},client9002);return _0x44b57f;}return null;})['then'](respondWithResult(_0x3640d2,null))[_0xc0c3('0x28')](handleError(_0x3640d2,null));};
\ No newline at end of file
+var _0x14d5=['sequelize','Sequelize','QueryTypes','SELECT','contact','fullname','email','interface','SIP/%s','channel','motionChannel','event','EventManager','parse','formData','chat','null','RejectMessage','rejectMessage','rejectmessage','eml-format','rimraf','fast-json-patch','request-promise','bluebird','mustache','util','path','to-csv','lodash','squel','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/logger','../../config/utils','../../config/license/util','../../mysqldb','redis','defaults','localhost','./chatMessage.socket','register','jayson/promise','client','http','request','then','info','stringify','error','code','ChatMessage,\x20%s,\x20%s','message','request\x20sent','result','catch','sendStatus','status','end','json','offset','limit','undefined','count','Content-Range','reject','update','destroy','stack','name','index','map','rawAttributes','model','query','keys','filters','intersection','attributes','fields','length','nolimit','order','sort','where','filter','merge','type','VIRTUAL','options','findAll','rows','show','include','find','ChatMessage','create','body','params','describe','chat-interactions','read','readAt','format','YYYY-MM-DD\x20HH:mm:ss','UserId','agent','get','ChatInteraction','ChatInteractionId','isNil','read1stAt','interaction','user','role','acceptMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','ContactId'];(function(_0x46e363,_0x45d7e2){var _0x3fb059=function(_0x5e6274){while(--_0x5e6274){_0x46e363['push'](_0x46e363['shift']());}};_0x3fb059(++_0x45d7e2);}(_0x14d5,0x8e));var _0x514d=function(_0x568f96,_0x32d489){_0x568f96=_0x568f96-0x0;var _0x5a053a=_0x14d5[_0x568f96];return _0x5a053a;};'use strict';var emlformat=require(_0x514d('0x0'));var rimraf=require(_0x514d('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x514d('0x2'));var rp=require(_0x514d('0x3'));var moment=require('moment');var BPromise=require(_0x514d('0x4'));var Mustache=require(_0x514d('0x5'));var util=require(_0x514d('0x6'));var path=require(_0x514d('0x7'));var sox=require('sox');var csv=require(_0x514d('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x514d('0x9'));var squel=require(_0x514d('0xa'));var crypto=require('crypto');var jsforce=require(_0x514d('0xb'));var deskjs=require(_0x514d('0xc'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x514d('0xd'));var Redis=require(_0x514d('0xe'));var authService=require(_0x514d('0xf'));var qs=require(_0x514d('0x10'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0x514d('0x11'))('api');var utils=require(_0x514d('0x12'));var config=require('../../config/environment');var licenseUtil=require(_0x514d('0x13'));var db=require(_0x514d('0x14'))['db'];config[_0x514d('0x15')]=_[_0x514d('0x16')](config['redis'],{'host':_0x514d('0x17'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x514d('0x15')]));require(_0x514d('0x18'))[_0x514d('0x19')](socket);var jayson=require(_0x514d('0x1a'));var client=jayson[_0x514d('0x1b')]['http']({'port':0x232c});var client9002=jayson['client'][_0x514d('0x1c')]({'port':0x232a});function respondWithRpcPromise(_0x3e5b2a,_0x18fd9c,_0x40e523,_0x2dc407){return new BPromise(function(_0x39c222,_0x26af24){var _0x2bf064=_0x2dc407||client;return _0x2bf064[_0x514d('0x1d')](_0x3e5b2a,_0x40e523)[_0x514d('0x1e')](function(_0x411538){logger[_0x514d('0x1f')]('ChatMessage,\x20%s,\x20%s',_0x18fd9c,'request\x20sent');logger['debug']('ChatMessage,\x20%s,\x20%s,\x20%s',_0x18fd9c,'request\x20sent',JSON[_0x514d('0x20')](_0x411538));if(_0x411538[_0x514d('0x21')]){if(_0x411538[_0x514d('0x21')][_0x514d('0x22')]===0x1f4){logger[_0x514d('0x21')](_0x514d('0x23'),_0x18fd9c,_0x411538[_0x514d('0x21')][_0x514d('0x24')]);return _0x26af24(_0x411538['error']['message']);}logger[_0x514d('0x21')](_0x514d('0x23'),_0x18fd9c,_0x411538['error']['message']);return _0x39c222(_0x411538[_0x514d('0x21')][_0x514d('0x24')]);}else{logger['info'](_0x514d('0x23'),_0x18fd9c,_0x514d('0x25'));_0x39c222(_0x411538[_0x514d('0x26')]['message']);}})[_0x514d('0x27')](function(_0x1638b3){logger[_0x514d('0x21')](_0x514d('0x23'),_0x18fd9c,_0x1638b3);_0x26af24(_0x1638b3);});});}function respondWithStatusCode(_0x8b04a5,_0x33abd2){_0x33abd2=_0x33abd2||0xcc;return function(_0x17dd06){if(_0x17dd06){return _0x8b04a5[_0x514d('0x28')](_0x33abd2);}return _0x8b04a5[_0x514d('0x29')](_0x33abd2)[_0x514d('0x2a')]();};}function respondWithResult(_0x58708e,_0x26a7a6){_0x26a7a6=_0x26a7a6||0xc8;return function(_0x36d011){if(_0x36d011){return _0x58708e['status'](_0x26a7a6)[_0x514d('0x2b')](_0x36d011);}};}function respondWithFilteredResult(_0x2c38c3,_0x4cd80a){return function(_0x1789c2){if(_0x1789c2){var _0x3201df=typeof _0x4cd80a[_0x514d('0x2c')]==='undefined'&&typeof _0x4cd80a[_0x514d('0x2d')]===_0x514d('0x2e');var _0x3e8a6e=_0x1789c2[_0x514d('0x2f')];var _0x38b66e=_0x3201df?0x0:_0x4cd80a[_0x514d('0x2c')];var _0x525e8f=_0x3201df?_0x1789c2[_0x514d('0x2f')]:_0x4cd80a[_0x514d('0x2c')]+_0x4cd80a[_0x514d('0x2d')];var _0x5895b5;if(_0x525e8f>=_0x3e8a6e){_0x525e8f=_0x3e8a6e;_0x5895b5=0xc8;}else{_0x5895b5=0xce;}_0x2c38c3[_0x514d('0x29')](_0x5895b5);return _0x2c38c3['set'](_0x514d('0x30'),_0x38b66e+'-'+_0x525e8f+'/'+_0x3e8a6e)['json'](_0x1789c2);}return null;};}function patchUpdates(_0x1c2659){return function(_0x547f9b){try{jsonpatch['apply'](_0x547f9b,_0x1c2659,!![]);}catch(_0x29d4ab){return BPromise[_0x514d('0x31')](_0x29d4ab);}return _0x547f9b['save']();};}function saveUpdates(_0x3a815c,_0x289594){return function(_0x484217){if(_0x484217){return _0x484217[_0x514d('0x32')](_0x3a815c)['then'](function(_0x762e93){return _0x762e93;});}return null;};}function removeEntity(_0x33f509,_0x8cab35){return function(_0x14a1b7){if(_0x14a1b7){return _0x14a1b7[_0x514d('0x33')]()['then'](function(){_0x33f509['status'](0xcc)[_0x514d('0x2a')]();});}};}function handleEntityNotFound(_0x36d244,_0x6fcae3){return function(_0xdcef2a){if(!_0xdcef2a){_0x36d244[_0x514d('0x28')](0x194);}return _0xdcef2a;};}function handleError(_0x19d6ec,_0x3d158d){_0x3d158d=_0x3d158d||0x1f4;return function(_0x14e36c){logger['error'](_0x14e36c[_0x514d('0x34')]);if(_0x14e36c[_0x514d('0x35')]){delete _0x14e36c[_0x514d('0x35')];}_0x19d6ec[_0x514d('0x29')](_0x3d158d)['send'](_0x14e36c);};}exports[_0x514d('0x36')]=function(_0x23a0b9,_0x4ee3a7){var _0x373bbd={},_0x4f5c69={},_0x442c8f={'count':0x0,'rows':[]};var _0x411b6b=_[_0x514d('0x37')](db['ChatMessage'][_0x514d('0x38')],function(_0x27a1f7){return{'name':_0x27a1f7['fieldName'],'type':_0x27a1f7['type']['key']};});_0x4f5c69[_0x514d('0x39')]=_[_0x514d('0x37')](_0x411b6b,'name');_0x4f5c69[_0x514d('0x3a')]=_[_0x514d('0x3b')](_0x23a0b9[_0x514d('0x3a')]);_0x4f5c69[_0x514d('0x3c')]=_[_0x514d('0x3d')](_0x4f5c69[_0x514d('0x39')],_0x4f5c69['query']);_0x373bbd[_0x514d('0x3e')]=_[_0x514d('0x3d')](_0x4f5c69[_0x514d('0x39')],qs['fields'](_0x23a0b9[_0x514d('0x3a')][_0x514d('0x3f')]));_0x373bbd[_0x514d('0x3e')]=_0x373bbd[_0x514d('0x3e')][_0x514d('0x40')]?_0x373bbd[_0x514d('0x3e')]:_0x4f5c69[_0x514d('0x39')];if(!_0x23a0b9['query']['hasOwnProperty'](_0x514d('0x41'))){_0x373bbd[_0x514d('0x2d')]=qs['limit'](_0x23a0b9[_0x514d('0x3a')][_0x514d('0x2d')]);_0x373bbd[_0x514d('0x2c')]=qs[_0x514d('0x2c')](_0x23a0b9['query'][_0x514d('0x2c')]);}_0x373bbd[_0x514d('0x42')]=qs[_0x514d('0x43')](_0x23a0b9[_0x514d('0x3a')]['sort']);_0x373bbd[_0x514d('0x44')]=qs[_0x514d('0x3c')](_['pick'](_0x23a0b9[_0x514d('0x3a')],_0x4f5c69[_0x514d('0x3c')]),_0x411b6b);if(_0x23a0b9[_0x514d('0x3a')][_0x514d('0x45')]){_0x373bbd[_0x514d('0x44')]=_[_0x514d('0x46')](_0x373bbd['where'],{'$or':_[_0x514d('0x37')](_0x411b6b,function(_0x27db0c){if(_0x27db0c[_0x514d('0x47')]!==_0x514d('0x48')){var _0xa82d5d={};_0xa82d5d[_0x27db0c[_0x514d('0x35')]]={'$like':'%'+_0x23a0b9[_0x514d('0x3a')]['filter']+'%'};return _0xa82d5d;}})});}_0x373bbd=_[_0x514d('0x46')]({},_0x373bbd,_0x23a0b9[_0x514d('0x49')]);var _0x24d62a={'where':_0x373bbd[_0x514d('0x44')]};return db['ChatMessage'][_0x514d('0x2f')](_0x24d62a)[_0x514d('0x1e')](function(_0x5e5c51){_0x442c8f[_0x514d('0x2f')]=_0x5e5c51;if(_0x23a0b9[_0x514d('0x3a')]['includeAll']){_0x373bbd['include']=[{'all':!![]}];}return db['ChatMessage'][_0x514d('0x4a')](_0x373bbd);})[_0x514d('0x1e')](function(_0x2fd55a){_0x442c8f[_0x514d('0x4b')]=_0x2fd55a;return _0x442c8f;})['then'](respondWithFilteredResult(_0x4ee3a7,_0x373bbd))[_0x514d('0x27')](handleError(_0x4ee3a7,null));};exports[_0x514d('0x4c')]=function(_0x3b6397,_0xb59be){var _0x277210={'raw':!![],'where':{'id':_0x3b6397['params']['id']}},_0xaa7800={};_0xaa7800[_0x514d('0x39')]=_[_0x514d('0x3b')](db['ChatMessage'][_0x514d('0x38')]);_0xaa7800[_0x514d('0x3a')]=_[_0x514d('0x3b')](_0x3b6397[_0x514d('0x3a')]);_0xaa7800['filters']=_[_0x514d('0x3d')](_0xaa7800[_0x514d('0x39')],_0xaa7800[_0x514d('0x3a')]);_0x277210[_0x514d('0x3e')]=_[_0x514d('0x3d')](_0xaa7800['model'],qs['fields'](_0x3b6397[_0x514d('0x3a')][_0x514d('0x3f')]));_0x277210[_0x514d('0x3e')]=_0x277210[_0x514d('0x3e')][_0x514d('0x40')]?_0x277210[_0x514d('0x3e')]:_0xaa7800[_0x514d('0x39')];if(_0x3b6397[_0x514d('0x3a')]['includeAll']){_0x277210[_0x514d('0x4d')]=[{'all':!![]}];}_0x277210=_[_0x514d('0x46')]({},_0x277210,_0x3b6397[_0x514d('0x49')]);return db['ChatMessage'][_0x514d('0x4e')](_0x277210)[_0x514d('0x1e')](handleEntityNotFound(_0xb59be,null))[_0x514d('0x1e')](respondWithResult(_0xb59be,null))[_0x514d('0x27')](handleError(_0xb59be,null));};exports['create']=function(_0xaad23b,_0x66d192){return db[_0x514d('0x4f')][_0x514d('0x50')](_0xaad23b[_0x514d('0x51')],{})[_0x514d('0x1e')](respondWithResult(_0x66d192,0xc9))['catch'](handleError(_0x66d192,null));};exports[_0x514d('0x32')]=function(_0x29f5a0,_0x1d9c7a){if(_0x29f5a0['body']['id']){delete _0x29f5a0[_0x514d('0x51')]['id'];}return db[_0x514d('0x4f')][_0x514d('0x4e')]({'where':{'id':_0x29f5a0[_0x514d('0x52')]['id']}})['then'](handleEntityNotFound(_0x1d9c7a,null))['then'](saveUpdates(_0x29f5a0[_0x514d('0x51')],null))[_0x514d('0x1e')](respondWithResult(_0x1d9c7a,null))[_0x514d('0x27')](handleError(_0x1d9c7a,null));};exports[_0x514d('0x33')]=function(_0x304740,_0x177685){return db['ChatMessage'][_0x514d('0x4e')]({'where':{'id':_0x304740[_0x514d('0x52')]['id']}})[_0x514d('0x1e')](handleEntityNotFound(_0x177685,null))[_0x514d('0x1e')](removeEntity(_0x177685,null))[_0x514d('0x27')](handleError(_0x177685,null));};exports[_0x514d('0x53')]=function(_0x534e96,_0x29e244){return db[_0x514d('0x4f')][_0x514d('0x53')]()[_0x514d('0x1e')](respondWithResult(_0x29e244,null))[_0x514d('0x27')](handleError(_0x29e244,null));};var interaction_log=require(_0x514d('0x11'))(_0x514d('0x54'));exports['accept']=function(_0x223693,_0x583cef,_0x36e2ed){var _0x483fab={'agent':{},'channel':'chat'};if(_0x223693[_0x514d('0x51')]['id']){delete _0x223693[_0x514d('0x51')]['id'];}_0x223693[_0x514d('0x51')][_0x514d('0x55')]=!![];_0x223693['body'][_0x514d('0x56')]=moment()[_0x514d('0x57')](_0x514d('0x58'));_0x223693[_0x514d('0x51')][_0x514d('0x59')]=_0x223693[_0x514d('0x51')][_0x514d('0x59')]||_0x223693['user']['id'];_0x483fab[_0x514d('0x5a')]['id']=_0x223693[_0x514d('0x51')][_0x514d('0x59')];return db[_0x514d('0x4f')]['find']({'where':{'id':_0x223693[_0x514d('0x52')]['id'],'UserId':null}})[_0x514d('0x1e')](handleEntityNotFound(_0x583cef,null))[_0x514d('0x1e')](saveUpdates(_0x223693[_0x514d('0x51')],null))[_0x514d('0x1e')](function(_0x47cf85){if(_0x47cf85){_0x483fab[_0x514d('0x24')]=_0x47cf85[_0x514d('0x5b')]({'plain':!![]});return db[_0x514d('0x5c')][_0x514d('0x4e')]({'where':{'id':_0x47cf85[_0x514d('0x5d')]}});}return null;})[_0x514d('0x1e')](handleEntityNotFound(_0x583cef,null))[_0x514d('0x1e')](function(_0x154f41){if(_0x154f41){return _0x154f41[_0x514d('0x32')]({'UserId':_0x223693[_0x514d('0x51')]['UserId'],'read1stAt':_[_0x514d('0x5e')](_0x154f41[_0x514d('0x5f')])?moment()['format'](_0x514d('0x58')):undefined});}return null;})['then'](function(_0x557cce){if(_0x557cce){_0x483fab[_0x514d('0x60')]=_0x557cce[_0x514d('0x5b')]({'plain':!![]});interaction_log[_0x514d('0x1f')]('[CHATMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s',_0x223693[_0x514d('0x61')]['id'],_0x223693[_0x514d('0x61')][_0x514d('0x35')],_0x223693[_0x514d('0x61')][_0x514d('0x62')],_0x483fab[_0x514d('0x60')]['id'],_0x223693[_0x514d('0x51')]?JSON[_0x514d('0x20')](_0x223693[_0x514d('0x51')]):'null');return respondWithRpcPromise('AcceptMessage',_0x514d('0x63'),_0x483fab);}return null;})[_0x514d('0x1e')](function(_0xcba53c){var _0x1aa819=_0x514d('0x64')+_0xcba53c[_0x514d('0x24')][_0x514d('0x65')];return db[_0x514d('0x66')][_0x514d('0x3a')](_0x1aa819,{'type':db[_0x514d('0x67')][_0x514d('0x68')][_0x514d('0x69')],'raw':!![]})[_0x514d('0x1e')](function(_0x42bbb2){return _0x42bbb2;});})[_0x514d('0x1e')](function(_0x345ce0){if(_0x345ce0){_0x483fab['message'][_0x514d('0x6a')]=_0x345ce0[0x0];if(!_0x223693['body']['UserId'])return;return db['User'][_0x514d('0x4e')]({'where':{'id':_0x223693[_0x514d('0x51')][_0x514d('0x59')],'role':_0x514d('0x5a')},'attributes':['id',_0x514d('0x35'),_0x514d('0x6b'),_0x514d('0x6c'),'internal'],'raw':!![]});}return null;})[_0x514d('0x1e')](function(_0x34bd85){if(!_0x34bd85)return null;_0x483fab[_0x514d('0x24')][_0x514d('0x5a')]=_0x34bd85;return _0x483fab;})[_0x514d('0x1e')](function(_0x52839a){if(_0x52839a){if(_0x223693[_0x514d('0x51')]['manual']){_0x483fab[_0x514d('0x24')][_0x514d('0x6d')]=util[_0x514d('0x57')](_0x514d('0x6e'),_0x223693[_0x514d('0x61')]['name']);_0x483fab[_0x514d('0x24')][_0x514d('0x6f')]=_0x483fab[_0x514d('0x6f')];_0x483fab[_0x514d('0x24')][_0x514d('0x70')]=_0x483fab['channel'];_0x483fab['message'][_0x514d('0x71')]='accept';return respondWithRpcPromise('EventManager',_0x514d('0x72'),{'event':'acceptmessage','message':_[_0x514d('0x46')](_0x483fab[_0x514d('0x24')],JSON[_0x514d('0x73')](_0x483fab[_0x514d('0x60')][_0x514d('0x74')]))},client9002)[_0x514d('0x1e')](function(){return _0x483fab;});}return _0x483fab;}return null;})[_0x514d('0x1e')](respondWithResult(_0x583cef,null))[_0x514d('0x27')](handleError(_0x583cef,null));};var interaction_log=require(_0x514d('0x11'))(_0x514d('0x54'));exports[_0x514d('0x31')]=function(_0x660d6f,_0x3725d5,_0x15c2c1){var _0x2a7084={'agent':{},'channel':_0x514d('0x75')};if(_0x660d6f[_0x514d('0x51')]['id']){delete _0x660d6f[_0x514d('0x51')]['id'];}_0x660d6f[_0x514d('0x51')][_0x514d('0x59')]=_0x660d6f[_0x514d('0x51')]['UserId']||_0x660d6f[_0x514d('0x61')]['id'];_0x2a7084[_0x514d('0x5a')]['id']=_0x660d6f['body'][_0x514d('0x59')];return db[_0x514d('0x4f')][_0x514d('0x4e')]({'where':{'id':_0x660d6f['params']['id'],'UserId':null}})[_0x514d('0x1e')](handleEntityNotFound(_0x3725d5,null))[_0x514d('0x1e')](function(_0x47fa73){if(_0x47fa73){_0x2a7084[_0x514d('0x24')]=_0x47fa73[_0x514d('0x5b')]({'plain':!![]});return db[_0x514d('0x5c')][_0x514d('0x4e')]({'where':{'id':_0x47fa73[_0x514d('0x5d')]}});}return null;})[_0x514d('0x1e')](handleEntityNotFound(_0x3725d5,null))[_0x514d('0x1e')](function(_0xde82cf){if(_0xde82cf){_0x2a7084[_0x514d('0x60')]=_0xde82cf[_0x514d('0x5b')]({'plain':!![]});interaction_log[_0x514d('0x1f')]('[CHATMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s',_0x660d6f['user']['id'],_0x660d6f[_0x514d('0x61')]['name'],_0x660d6f[_0x514d('0x61')][_0x514d('0x62')],_0x2a7084['interaction']['id'],_0x660d6f[_0x514d('0x51')]?JSON[_0x514d('0x20')](_0x660d6f[_0x514d('0x51')]):_0x514d('0x76'));return respondWithRpcPromise(_0x514d('0x77'),_0x514d('0x78'),_0x2a7084);}return null;})['then'](function(_0xa573be){var _0x1e8fe8=_0x514d('0x64')+_0xa573be[_0x514d('0x24')]['ContactId'];return db[_0x514d('0x66')][_0x514d('0x3a')](_0x1e8fe8,{'type':db['Sequelize'][_0x514d('0x68')][_0x514d('0x69')],'raw':!![]})[_0x514d('0x1e')](function(_0x58efdc){return _0x58efdc;});})[_0x514d('0x1e')](function(_0x321d77){if(_0x321d77){_0x2a7084['message'][_0x514d('0x6a')]=_0x321d77[0x0];if(!_0x660d6f[_0x514d('0x51')][_0x514d('0x59')])return;return db['User']['find']({'where':{'id':_0x660d6f[_0x514d('0x51')][_0x514d('0x59')],'role':'agent'},'attributes':['id',_0x514d('0x35'),_0x514d('0x6b'),_0x514d('0x6c'),'internal'],'raw':!![]});}return null;})[_0x514d('0x1e')](function(_0x3169ab){if(!_0x3169ab)return null;_0x2a7084[_0x514d('0x24')][_0x514d('0x5a')]=_0x3169ab;return _0x2a7084;})[_0x514d('0x1e')](function(_0x56ccbf){if(_0x56ccbf){_0x56ccbf[_0x514d('0x24')][_0x514d('0x6d')]=util[_0x514d('0x57')](_0x514d('0x6e'),_0x660d6f[_0x514d('0x61')][_0x514d('0x35')]);_0x56ccbf['message'][_0x514d('0x6f')]=_0x2a7084[_0x514d('0x6f')];_0x56ccbf[_0x514d('0x24')][_0x514d('0x70')]=_0x2a7084[_0x514d('0x6f')];_0x56ccbf['message'][_0x514d('0x71')]=_0x514d('0x31');respondWithRpcPromise('EventManager',_0x514d('0x72'),{'event':_0x514d('0x79'),'message':_[_0x514d('0x46')](_0x2a7084[_0x514d('0x24')],JSON[_0x514d('0x73')](_0x2a7084[_0x514d('0x60')][_0x514d('0x74')]))},client9002);return _0x2a7084;}return null;})['then'](respondWithResult(_0x3725d5,null))[_0x514d('0x27')](handleError(_0x3725d5,null));};
\ No newline at end of file
diff --git a/server/api/chatMessage/chatMessage.events.js b/server/api/chatMessage/chatMessage.events.js
index dafd405..edb7a6e 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 _0x5566=['setMaxListeners','save','update','remove','emit','hasOwnProperty','hook','exports','events','../../mysqldb'];(function(_0x169e53,_0x46be55){var _0x252bb3=function(_0x521e7a){while(--_0x521e7a){_0x169e53['push'](_0x169e53['shift']());}};_0x252bb3(++_0x46be55);}(_0x5566,0x1c0));var _0x6556=function(_0x18f4d3,_0x4f77fe){_0x18f4d3=_0x18f4d3-0x0;var _0x447644=_0x5566[_0x18f4d3];return _0x447644;};'use strict';var EventEmitter=require(_0x6556('0x0'));var ChatMessage=require(_0x6556('0x1'))['db']['ChatMessage'];var ChatMessageEvents=new EventEmitter();ChatMessageEvents[_0x6556('0x2')](0x0);var events={'afterCreate':_0x6556('0x3'),'afterUpdate':_0x6556('0x4'),'afterDestroy':_0x6556('0x5')};function emitEvent(_0x3db240){return function(_0x1017ea,_0x534f2a,_0x3fb926){ChatMessageEvents[_0x6556('0x6')](_0x3db240+':'+_0x1017ea['id'],_0x1017ea);ChatMessageEvents[_0x6556('0x6')](_0x3db240,_0x1017ea);_0x3fb926(null);};}for(var e in events){if(events[_0x6556('0x7')](e)){var event=events[e];ChatMessage[_0x6556('0x8')](e,emitEvent(event));}}module[_0x6556('0x9')]=ChatMessageEvents;
\ No newline at end of file
+var _0x1cf6=['ChatMessage','setMaxListeners','save','remove','emit','hasOwnProperty','hook','events','../../mysqldb'];(function(_0x47966a,_0x193c68){var _0x13eab3=function(_0x229ece){while(--_0x229ece){_0x47966a['push'](_0x47966a['shift']());}};_0x13eab3(++_0x193c68);}(_0x1cf6,0x85));var _0x61cf=function(_0x29d355,_0x316079){_0x29d355=_0x29d355-0x0;var _0x41f956=_0x1cf6[_0x29d355];return _0x41f956;};'use strict';var EventEmitter=require(_0x61cf('0x0'));var ChatMessage=require(_0x61cf('0x1'))['db'][_0x61cf('0x2')];var ChatMessageEvents=new EventEmitter();ChatMessageEvents[_0x61cf('0x3')](0x0);var events={'afterCreate':_0x61cf('0x4'),'afterUpdate':'update','afterDestroy':_0x61cf('0x5')};function emitEvent(_0x4ef7c1){return function(_0x57d6c8,_0x161da3,_0x4deb19){ChatMessageEvents['emit'](_0x4ef7c1+':'+_0x57d6c8['id'],_0x57d6c8);ChatMessageEvents[_0x61cf('0x6')](_0x4ef7c1,_0x57d6c8);_0x4deb19(null);};}for(var e in events){if(events[_0x61cf('0x7')](e)){var event=events[e];ChatMessage[_0x61cf('0x8')](e,emitEvent(event));}}module['exports']=ChatMessageEvents;
\ No newline at end of file
diff --git a/server/api/chatMessage/chatMessage.model.js b/server/api/chatMessage/chatMessage.model.js
index d3b0779..586e5df 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 _0x7bfa=['./chatMessage.attributes','exports','define','ChatMessage','chat_messages','FULLTEXT','models','direction','toLowerCase','out','secret','isNil','UserId','ChatInteraction','ChatInteractionId','then','update','createdAt','utf8mb4','utf8mb4_unicode_ci','lodash','api','moment','request-promise','path','rimraf','../../config/environment'];(function(_0x1a8385,_0x2be4bc){var _0x125b1d=function(_0x40cc77){while(--_0x40cc77){_0x1a8385['push'](_0x1a8385['shift']());}};_0x125b1d(++_0x2be4bc);}(_0x7bfa,0x173));var _0xa7bf=function(_0x2abc3d,_0x48edca){_0x2abc3d=_0x2abc3d-0x0;var _0x252745=_0x7bfa[_0x2abc3d];return _0x252745;};'use strict';var _=require(_0xa7bf('0x0'));var util=require('util');var logger=require('../../config/logger')(_0xa7bf('0x1'));var moment=require(_0xa7bf('0x2'));var BPromise=require('bluebird');var rp=require(_0xa7bf('0x3'));var fs=require('fs');var path=require(_0xa7bf('0x4'));var rimraf=require(_0xa7bf('0x5'));var config=require(_0xa7bf('0x6'));var attributes=require(_0xa7bf('0x7'));module[_0xa7bf('0x8')]=function(_0x10c016,_0x36b622){return _0x10c016[_0xa7bf('0x9')](_0xa7bf('0xa'),attributes,{'tableName':_0xa7bf('0xb'),'paranoid':![],'indexes':[{'name':'fti_chat_messages','fields':['body'],'type':_0xa7bf('0xc')}],'timestamps':!![],'hooks':{'afterCreate':function(_0x40636e,_0x1475ca,_0x184f7d){var _0x341f8e=_0x10c016[_0xa7bf('0xd')];var _0x2f72c3=_0x40636e['get']({'plain':!![]});if(_0x2f72c3[_0xa7bf('0xe')][_0xa7bf('0xf')]()==='in'||_0x2f72c3['direction'][_0xa7bf('0xf')]()===_0xa7bf('0x10')&&!_0x2f72c3[_0xa7bf('0x11')]&&!_[_0xa7bf('0x12')](_0x2f72c3[_0xa7bf('0x13')])){_0x341f8e[_0xa7bf('0x14')]['findOne']({'where':{'id':_0x2f72c3[_0xa7bf('0x15')]}})[_0xa7bf('0x16')](function(_0x4d4274){if(_0x4d4274){_0x4d4274[_0xa7bf('0x17')]({'lastMsgAt':_0x2f72c3[_0xa7bf('0x18')],'lastMsgDirection':_0x2f72c3[_0xa7bf('0xe')][_0xa7bf('0xf')]()});}})['catch'](function(_0x111178){console['error'](_0x111178);});}_0x184f7d();}},'charset':_0xa7bf('0x19'),'collate':_0xa7bf('0x1a')});};
\ No newline at end of file
+var _0xb738=['utf8mb4','utf8mb4_unicode_ci','lodash','util','../../config/logger','api','request-promise','rimraf','../../config/environment','./chatMessage.attributes','exports','ChatMessage','fti_chat_messages','body','FULLTEXT','models','get','direction','toLowerCase','out','secret','isNil','ChatInteraction','ChatInteractionId','then','update','createdAt','catch'];(function(_0x512ab6,_0x2d910b){var _0xe05bd2=function(_0x43ae16){while(--_0x43ae16){_0x512ab6['push'](_0x512ab6['shift']());}};_0xe05bd2(++_0x2d910b);}(_0xb738,0x136));var _0x8b73=function(_0x40c043,_0x15ca6f){_0x40c043=_0x40c043-0x0;var _0x193fdb=_0xb738[_0x40c043];return _0x193fdb;};'use strict';var _=require(_0x8b73('0x0'));var util=require(_0x8b73('0x1'));var logger=require(_0x8b73('0x2'))(_0x8b73('0x3'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x8b73('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x8b73('0x5'));var config=require(_0x8b73('0x6'));var attributes=require(_0x8b73('0x7'));module[_0x8b73('0x8')]=function(_0x3919b0,_0x3d3750){return _0x3919b0['define'](_0x8b73('0x9'),attributes,{'tableName':'chat_messages','paranoid':![],'indexes':[{'name':_0x8b73('0xa'),'fields':[_0x8b73('0xb')],'type':_0x8b73('0xc')}],'timestamps':!![],'hooks':{'afterCreate':function(_0x3ed876,_0x41d053,_0x297285){var _0x341d30=_0x3919b0[_0x8b73('0xd')];var _0x50f0f4=_0x3ed876[_0x8b73('0xe')]({'plain':!![]});if(_0x50f0f4[_0x8b73('0xf')][_0x8b73('0x10')]()==='in'||_0x50f0f4[_0x8b73('0xf')]['toLowerCase']()===_0x8b73('0x11')&&!_0x50f0f4[_0x8b73('0x12')]&&!_[_0x8b73('0x13')](_0x50f0f4['UserId'])){_0x341d30[_0x8b73('0x14')]['findOne']({'where':{'id':_0x50f0f4[_0x8b73('0x15')]}})[_0x8b73('0x16')](function(_0x4af596){if(_0x4af596){_0x4af596[_0x8b73('0x17')]({'lastMsgAt':_0x50f0f4[_0x8b73('0x18')],'lastMsgDirection':_0x50f0f4[_0x8b73('0xf')]['toLowerCase']()});}})[_0x8b73('0x19')](function(_0xd3f7c9){console['error'](_0xd3f7c9);});}_0x297285();}},'charset':_0x8b73('0x1a'),'collate':_0x8b73('0x1b')});};
\ No newline at end of file
diff --git a/server/api/chatMessage/chatMessage.rpc.js b/server/api/chatMessage/chatMessage.rpc.js
index 8e5eca2..273d535 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 _0x4db1=['then','lodash','util','moment','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','./chatMessage.socket','register','request','ChatMessage,\x20%s,\x20%s','request\x20sent','ChatMessage,\x20%s,\x20%s,\x20%s','stringify','error','message','info','result','catch','CreateChatMessage','ChatMessage','create','options','raw'];(function(_0xedbbb7,_0x5c6217){var _0x1302fa=function(_0x5f4daa){while(--_0x5f4daa){_0xedbbb7['push'](_0xedbbb7['shift']());}};_0x1302fa(++_0x5c6217);}(_0x4db1,0xa6));var _0x14db=function(_0x386c3e,_0x44a375){_0x386c3e=_0x386c3e-0x0;var _0x4b8e13=_0x4db1[_0x386c3e];return _0x4b8e13;};'use strict';var _=require(_0x14db('0x0'));var util=require(_0x14db('0x1'));var moment=require(_0x14db('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x14db('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x14db('0x4'));var logger=require(_0x14db('0x5'))(_0x14db('0x6'));var config=require(_0x14db('0x7'));var jayson=require(_0x14db('0x8'));var client=jayson[_0x14db('0x9')][_0x14db('0xa')]({'port':0x232a});config[_0x14db('0xb')]=_[_0x14db('0xc')](config[_0x14db('0xb')],{'host':_0x14db('0xd'),'port':0x18eb});var socket=require(_0x14db('0xe'))(new Redis(config['redis']));require(_0x14db('0xf'))[_0x14db('0x10')](socket);function respondWithRpcPromise(_0x1c5043,_0x2ef0a3,_0x4ccff2){return new BPromise(function(_0x45db4e,_0x2db338){return client[_0x14db('0x11')](_0x1c5043,_0x4ccff2)['then'](function(_0x272422){logger['info'](_0x14db('0x12'),_0x2ef0a3,_0x14db('0x13'));logger['debug'](_0x14db('0x14'),_0x2ef0a3,_0x14db('0x13'),JSON[_0x14db('0x15')](_0x272422));if(_0x272422[_0x14db('0x16')]){if(_0x272422[_0x14db('0x16')]['code']===0x1f4){logger[_0x14db('0x16')]('ChatMessage,\x20%s,\x20%s',_0x2ef0a3,_0x272422[_0x14db('0x16')][_0x14db('0x17')]);return _0x2db338(_0x272422[_0x14db('0x16')]['message']);}logger[_0x14db('0x16')](_0x14db('0x12'),_0x2ef0a3,_0x272422[_0x14db('0x16')]['message']);return _0x45db4e(_0x272422[_0x14db('0x16')][_0x14db('0x17')]);}else{logger[_0x14db('0x18')](_0x14db('0x12'),_0x2ef0a3,_0x14db('0x13'));_0x45db4e(_0x272422[_0x14db('0x19')]['message']);}})[_0x14db('0x1a')](function(_0x24dc34){logger['error'](_0x14db('0x12'),_0x2ef0a3,_0x24dc34);_0x2db338(_0x24dc34);});});}exports[_0x14db('0x1b')]=function(_0x218875){var _0x2a1694=this;return new Promise(function(_0x41faf8,_0x41a4c9){return db[_0x14db('0x1c')][_0x14db('0x1d')](_0x218875['body'],{'raw':_0x218875[_0x14db('0x1e')]?_0x218875[_0x14db('0x1e')][_0x14db('0x1f')]===undefined?!![]:![]:!![]})[_0x14db('0x20')](function(_0x4d84a2){logger[_0x14db('0x18')]('CreateChatMessage',_0x218875);logger['debug']('CreateChatMessage',_0x218875,JSON[_0x14db('0x15')](_0x4d84a2));_0x41faf8(_0x4d84a2);})['catch'](function(_0x3ee23d){logger[_0x14db('0x16')]('CreateChatMessage',_0x3ee23d['message'],_0x218875);_0x41a4c9(_0x2a1694[_0x14db('0x16')](0x1f4,_0x3ee23d[_0x14db('0x17')]));});});};
\ No newline at end of file
+var _0xe766=['bluebird','randomstring','ioredis','../../config/logger','rpc','../../config/environment','jayson/promise','http','redis','defaults','localhost','socket.io-emitter','./chatMessage.socket','request','then','ChatMessage,\x20%s,\x20%s','request\x20sent','debug','stringify','code','error','message','info','catch','CreateChatMessage','create','options','raw','util','moment'];(function(_0x21ed84,_0x25975c){var _0x1cbcf0=function(_0x3cc646){while(--_0x3cc646){_0x21ed84['push'](_0x21ed84['shift']());}};_0x1cbcf0(++_0x25975c);}(_0xe766,0x10c));var _0x6e76=function(_0x3a412f,_0x1634db){_0x3a412f=_0x3a412f-0x0;var _0x41ddbf=_0xe766[_0x3a412f];return _0x41ddbf;};'use strict';var _=require('lodash');var util=require(_0x6e76('0x0'));var moment=require(_0x6e76('0x1'));var BPromise=require(_0x6e76('0x2'));var rs=require(_0x6e76('0x3'));var fs=require('fs');var Redis=require(_0x6e76('0x4'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x6e76('0x5'))(_0x6e76('0x6'));var config=require(_0x6e76('0x7'));var jayson=require(_0x6e76('0x8'));var client=jayson['client'][_0x6e76('0x9')]({'port':0x232a});config[_0x6e76('0xa')]=_[_0x6e76('0xb')](config[_0x6e76('0xa')],{'host':_0x6e76('0xc'),'port':0x18eb});var socket=require(_0x6e76('0xd'))(new Redis(config[_0x6e76('0xa')]));require(_0x6e76('0xe'))['register'](socket);function respondWithRpcPromise(_0x53c5d6,_0x37582c,_0x5ccb12){return new BPromise(function(_0x228d59,_0x2e1eb6){return client[_0x6e76('0xf')](_0x53c5d6,_0x5ccb12)[_0x6e76('0x10')](function(_0x5806ae){logger['info'](_0x6e76('0x11'),_0x37582c,_0x6e76('0x12'));logger[_0x6e76('0x13')]('ChatMessage,\x20%s,\x20%s,\x20%s',_0x37582c,_0x6e76('0x12'),JSON[_0x6e76('0x14')](_0x5806ae));if(_0x5806ae['error']){if(_0x5806ae['error'][_0x6e76('0x15')]===0x1f4){logger[_0x6e76('0x16')]('ChatMessage,\x20%s,\x20%s',_0x37582c,_0x5806ae[_0x6e76('0x16')][_0x6e76('0x17')]);return _0x2e1eb6(_0x5806ae[_0x6e76('0x16')][_0x6e76('0x17')]);}logger[_0x6e76('0x16')](_0x6e76('0x11'),_0x37582c,_0x5806ae['error']['message']);return _0x228d59(_0x5806ae[_0x6e76('0x16')][_0x6e76('0x17')]);}else{logger[_0x6e76('0x18')](_0x6e76('0x11'),_0x37582c,_0x6e76('0x12'));_0x228d59(_0x5806ae['result'][_0x6e76('0x17')]);}})[_0x6e76('0x19')](function(_0x195203){logger[_0x6e76('0x16')]('ChatMessage,\x20%s,\x20%s',_0x37582c,_0x195203);_0x2e1eb6(_0x195203);});});}exports[_0x6e76('0x1a')]=function(_0x11f481){var _0x475539=this;return new Promise(function(_0x425341,_0x3ecc45){return db['ChatMessage'][_0x6e76('0x1b')](_0x11f481['body'],{'raw':_0x11f481['options']?_0x11f481[_0x6e76('0x1c')][_0x6e76('0x1d')]===undefined?!![]:![]:!![]})['then'](function(_0x427a5e){logger[_0x6e76('0x18')](_0x6e76('0x1a'),_0x11f481);logger['debug'](_0x6e76('0x1a'),_0x11f481,JSON[_0x6e76('0x14')](_0x427a5e));_0x425341(_0x427a5e);})['catch'](function(_0x1cd2a8){logger[_0x6e76('0x16')](_0x6e76('0x1a'),_0x1cd2a8['message'],_0x11f481);_0x3ecc45(_0x475539['error'](0x1f4,_0x1cd2a8['message']));});});};
\ No newline at end of file
diff --git a/server/api/chatMessage/chatMessage.socket.js b/server/api/chatMessage/chatMessage.socket.js
index cb15ba9..df7baa6 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 _0x14f5=['update','emit','removeListener','register','length','chatMessage:','save'];(function(_0x12b4d4,_0x2134e9){var _0x32604e=function(_0x32a791){while(--_0x32a791){_0x12b4d4['push'](_0x12b4d4['shift']());}};_0x32604e(++_0x2134e9);}(_0x14f5,0xae));var _0x514f=function(_0x56c688,_0x4a2b0a){_0x56c688=_0x56c688-0x0;var _0x4f738a=_0x14f5[_0x56c688];return _0x4f738a;};'use strict';var ChatMessageEvents=require('./chatMessage.events');var events=[_0x514f('0x0'),'remove',_0x514f('0x1')];function createListener(_0x2e8eb2,_0x12d5e2){return function(_0x5281a3){_0x12d5e2[_0x514f('0x2')](_0x2e8eb2,_0x5281a3);};}function removeListener(_0x2443e8,_0x483c2a){return function(){ChatMessageEvents[_0x514f('0x3')](_0x2443e8,_0x483c2a);};}exports[_0x514f('0x4')]=function(_0xc2ca56){for(var _0x434452=0x0,_0x463985=events[_0x514f('0x5')];_0x434452<_0x463985;_0x434452++){var _0xdb9614=events[_0x434452];var _0x4a5497=createListener(_0x514f('0x6')+_0xdb9614,_0xc2ca56);ChatMessageEvents['on'](_0xdb9614,_0x4a5497);}};
\ No newline at end of file
+var _0x1d7e=['remove','update','emit','removeListener','register','length','save'];(function(_0x3aebec,_0xb9c023){var _0x5ab0e=function(_0xd7a4a8){while(--_0xd7a4a8){_0x3aebec['push'](_0x3aebec['shift']());}};_0x5ab0e(++_0xb9c023);}(_0x1d7e,0x7d));var _0xe1d7=function(_0x513aa5,_0x1fba79){_0x513aa5=_0x513aa5-0x0;var _0x1a1a7c=_0x1d7e[_0x513aa5];return _0x1a1a7c;};'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 045fe72..447dc33 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 _0xf25e=['chatmessage:create','create','put','update','/:id/accept','accept','/:id/reject','reject','destroy','exports','multer','util','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment','get','isAuthenticated','index','describe','/:id','post','tracked','chat'];(function(_0x3b4de2,_0x525d6b){var _0x530dfa=function(_0x562763){while(--_0x562763){_0x3b4de2['push'](_0x3b4de2['shift']());}};_0x530dfa(++_0x525d6b);}(_0xf25e,0x190));var _0xef25=function(_0x22ee74,_0x474a39){_0x22ee74=_0x22ee74-0x0;var _0x12fe56=_0xf25e[_0x22ee74];return _0x12fe56;};'use strict';var multer=require(_0xef25('0x0'));var util=require(_0xef25('0x1'));var path=require('path');var timeout=require(_0xef25('0x2'));var express=require(_0xef25('0x3'));var router=express[_0xef25('0x4')]();var fs_extra=require(_0xef25('0x5'));var auth=require(_0xef25('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0xef25('0x7'));var controller=require('./chatMessage.controller');router[_0xef25('0x8')]('/',auth[_0xef25('0x9')](),controller[_0xef25('0xa')]);router[_0xef25('0x8')]('/describe',auth['isAuthenticated'](),controller[_0xef25('0xb')]);router[_0xef25('0x8')](_0xef25('0xc'),auth[_0xef25('0x9')](),controller['show']);router[_0xef25('0xd')]('/',auth[_0xef25('0x9')](),interaction[_0xef25('0xe')](_0xef25('0xf'),_0xef25('0x10')),controller[_0xef25('0x11')]);router[_0xef25('0x12')]('/:id',controller[_0xef25('0x13')]);router[_0xef25('0x12')](_0xef25('0x14'),auth[_0xef25('0x9')](),controller[_0xef25('0x15')]);router[_0xef25('0x12')](_0xef25('0x16'),auth[_0xef25('0x9')](),controller[_0xef25('0x17')]);router['delete'](_0xef25('0xc'),auth[_0xef25('0x9')](),controller[_0xef25('0x18')]);module[_0xef25('0x19')]=router;
\ No newline at end of file
+var _0xc747=['exports','multer','util','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatMessage.controller','isAuthenticated','index','get','/describe','describe','/:id','show','post','chat','chatmessage:create','update','put','/:id/accept','/:id/reject','reject','destroy'];(function(_0x2a1b33,_0x409f50){var _0x4c50e7=function(_0x13e16d){while(--_0x13e16d){_0x2a1b33['push'](_0x2a1b33['shift']());}};_0x4c50e7(++_0x409f50);}(_0xc747,0x153));var _0x7c74=function(_0x590a0c,_0xab1f66){_0x590a0c=_0x590a0c-0x0;var _0x32add4=_0xc747[_0x590a0c];return _0x32add4;};'use strict';var multer=require(_0x7c74('0x0'));var util=require(_0x7c74('0x1'));var path=require('path');var timeout=require(_0x7c74('0x2'));var express=require('express');var router=express[_0x7c74('0x3')]();var fs_extra=require(_0x7c74('0x4'));var auth=require(_0x7c74('0x5'));var interaction=require(_0x7c74('0x6'));var config=require(_0x7c74('0x7'));var controller=require(_0x7c74('0x8'));router['get']('/',auth[_0x7c74('0x9')](),controller[_0x7c74('0xa')]);router[_0x7c74('0xb')](_0x7c74('0xc'),auth['isAuthenticated'](),controller[_0x7c74('0xd')]);router['get'](_0x7c74('0xe'),auth[_0x7c74('0x9')](),controller[_0x7c74('0xf')]);router[_0x7c74('0x10')]('/',auth[_0x7c74('0x9')](),interaction['tracked'](_0x7c74('0x11'),_0x7c74('0x12')),controller['create']);router['put'](_0x7c74('0xe'),controller[_0x7c74('0x13')]);router[_0x7c74('0x14')](_0x7c74('0x15'),auth[_0x7c74('0x9')](),controller['accept']);router['put'](_0x7c74('0x16'),auth[_0x7c74('0x9')](),controller[_0x7c74('0x17')]);router['delete'](_0x7c74('0xe'),auth[_0x7c74('0x9')](),controller[_0x7c74('0x18')]);module[_0x7c74('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 07f8956..944b3c3 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 _0x2032=['medium','exports','TEXT'];(function(_0x528c5b,_0x124692){var _0x398f8b=function(_0x58084f){while(--_0x58084f){_0x528c5b['push'](_0x528c5b['shift']());}};_0x398f8b(++_0x124692);}(_0x2032,0xd9));var _0x2203=function(_0x4c1cb1,_0x3dac88){_0x4c1cb1=_0x4c1cb1-0x0;var _0x59b658=_0x2032[_0x4c1cb1];return _0x59b658;};'use strict';var Sequelize=require('sequelize');module[_0x2203('0x0')]={'body':{'type':Sequelize[_0x2203('0x1')](_0x2203('0x2')),'allowNull':![]},'plainBody':{'type':Sequelize['TEXT'](_0x2203('0x2')),'allowNull':![]}};
\ No newline at end of file
+var _0xadb5=['medium','TEXT','exports'];(function(_0x8193d9,_0x40bdd2){var _0x3b34bb=function(_0x188110){while(--_0x188110){_0x8193d9['push'](_0x8193d9['shift']());}};_0x3b34bb(++_0x40bdd2);}(_0xadb5,0xad));var _0x5adb=function(_0x1ac55c,_0x4e14e3){_0x1ac55c=_0x1ac55c-0x0;var _0x3551af=_0xadb5[_0x1ac55c];return _0x3551af;};'use strict';var Sequelize=require('sequelize');module[_0x5adb('0x0')]={'body':{'type':Sequelize['TEXT'](_0x5adb('0x1')),'allowNull':![]},'plainBody':{'type':Sequelize[_0x5adb('0x2')](_0x5adb('0x1')),'allowNull':![]}};
\ No newline at end of file
diff --git a/server/api/chatOfflineMessage/chatOfflineMessage.controller.js b/server/api/chatOfflineMessage/chatOfflineMessage.controller.js
index 4d237d2..3e55e62 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(_0xd1d19a,_0x1933f0){var _0x52a79d=function(_0x5199e2){while(--_0x5199e2){_0xd1d19a['push'](_0xd1d19a['shift']());}};_0x52a79d(++_0x1933f0);}(_0x7a54,0x106));var _0x47a5=function(_0x5c235e,_0x1591cf){_0x5c235e=_0x5c235e-0x0;var _0x363cc8=_0x7a54[_0x5c235e];return _0x363cc8;};'use strict';var emlformat=require(_0x47a5('0x0'));var rimraf=require(_0x47a5('0x1'));var zipdir=require(_0x47a5('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x47a5('0x3'));var moment=require(_0x47a5('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x47a5('0x5'));var util=require(_0x47a5('0x6'));var path=require(_0x47a5('0x7'));var sox=require(_0x47a5('0x8'));var csv=require(_0x47a5('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x47a5('0xa'));var _=require('lodash');var squel=require(_0x47a5('0xb'));var crypto=require(_0x47a5('0xc'));var jsforce=require('jsforce');var deskjs=require(_0x47a5('0xd'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x47a5('0xe'));var authService=require(_0x47a5('0xf'));var qs=require('../../components/parsers/qs');var as=require(_0x47a5('0x10'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x47a5('0x11'));var utils=require(_0x47a5('0x12'));var config=require(_0x47a5('0x13'));var licenseUtil=require(_0x47a5('0x14'));var db=require(_0x47a5('0x15'))['db'];function respondWithStatusCode(_0xd308b8,_0x1eae59){_0x1eae59=_0x1eae59||0xcc;return function(_0x5beb89){if(_0x5beb89){return _0xd308b8[_0x47a5('0x16')](_0x1eae59);}return _0xd308b8[_0x47a5('0x17')](_0x1eae59)[_0x47a5('0x18')]();};}function respondWithResult(_0x711793,_0x139f25){_0x139f25=_0x139f25||0xc8;return function(_0x620ee9){if(_0x620ee9){return _0x711793[_0x47a5('0x17')](_0x139f25)[_0x47a5('0x19')](_0x620ee9);}};}function respondWithFilteredResult(_0x4e99a8,_0x362359){return function(_0x11faf5){if(_0x11faf5){var _0x3b001e=typeof _0x362359[_0x47a5('0x1a')]===_0x47a5('0x1b')&&typeof _0x362359['limit']==='undefined';var _0x138bc0=_0x11faf5['count'];var _0x5247fd=_0x3b001e?0x0:_0x362359[_0x47a5('0x1a')];var _0xaf70a6=_0x3b001e?_0x11faf5[_0x47a5('0x1c')]:_0x362359[_0x47a5('0x1a')]+_0x362359[_0x47a5('0x1d')];var _0x12b98e;if(_0xaf70a6>=_0x138bc0){_0xaf70a6=_0x138bc0;_0x12b98e=0xc8;}else{_0x12b98e=0xce;}_0x4e99a8[_0x47a5('0x17')](_0x12b98e);return _0x4e99a8[_0x47a5('0x1e')](_0x47a5('0x1f'),_0x5247fd+'-'+_0xaf70a6+'/'+_0x138bc0)['json'](_0x11faf5);}return null;};}function patchUpdates(_0x1570bc){return function(_0xf160ba){try{jsonpatch['apply'](_0xf160ba,_0x1570bc,!![]);}catch(_0x2b0360){return BPromise[_0x47a5('0x20')](_0x2b0360);}return _0xf160ba[_0x47a5('0x21')]();};}function saveUpdates(_0x4c5910,_0xb8ae6c){return function(_0x2f142b){if(_0x2f142b){return _0x2f142b[_0x47a5('0x22')](_0x4c5910)[_0x47a5('0x23')](function(_0x5ef1b1){return _0x5ef1b1;});}return null;};}function removeEntity(_0xe2dea9,_0x385687){return function(_0x513981){if(_0x513981){return _0x513981[_0x47a5('0x24')]()[_0x47a5('0x23')](function(){_0xe2dea9[_0x47a5('0x17')](0xcc)[_0x47a5('0x18')]();});}};}function handleEntityNotFound(_0x3abd6a,_0x50bf17){return function(_0x53078a){if(!_0x53078a){_0x3abd6a[_0x47a5('0x16')](0x194);}return _0x53078a;};}function handleError(_0x5686db,_0x1ea9c8){_0x1ea9c8=_0x1ea9c8||0x1f4;return function(_0x5b6c4e){logger[_0x47a5('0x25')](_0x5b6c4e[_0x47a5('0x26')]);if(_0x5b6c4e[_0x47a5('0x27')]){delete _0x5b6c4e[_0x47a5('0x27')];}_0x5686db[_0x47a5('0x17')](_0x1ea9c8)[_0x47a5('0x28')](_0x5b6c4e);};}exports[_0x47a5('0x29')]=function(_0x136b14,_0x16631f){var _0x361bfa={},_0x1127f8={},_0x11a4fa={'count':0x0,'rows':[]};var _0x3ad507=_['map'](db[_0x47a5('0x2a')]['rawAttributes'],function(_0x2ef875){return{'name':_0x2ef875[_0x47a5('0x2b')],'type':_0x2ef875[_0x47a5('0x2c')]['key']};});_0x1127f8[_0x47a5('0x2d')]=_[_0x47a5('0x2e')](_0x3ad507,_0x47a5('0x27'));_0x1127f8[_0x47a5('0x2f')]=_['keys'](_0x136b14['query']);_0x1127f8[_0x47a5('0x30')]=_[_0x47a5('0x31')](_0x1127f8['model'],_0x1127f8['query']);_0x361bfa[_0x47a5('0x32')]=_[_0x47a5('0x31')](_0x1127f8['model'],qs[_0x47a5('0x33')](_0x136b14['query'][_0x47a5('0x33')]));_0x361bfa[_0x47a5('0x32')]=_0x361bfa['attributes']['length']?_0x361bfa[_0x47a5('0x32')]:_0x1127f8['model'];if(!_0x136b14[_0x47a5('0x2f')][_0x47a5('0x34')](_0x47a5('0x35'))){_0x361bfa['limit']=qs[_0x47a5('0x1d')](_0x136b14['query']['limit']);_0x361bfa[_0x47a5('0x1a')]=qs['offset'](_0x136b14[_0x47a5('0x2f')]['offset']);}_0x361bfa[_0x47a5('0x36')]=qs[_0x47a5('0x37')](_0x136b14[_0x47a5('0x2f')][_0x47a5('0x37')]);_0x361bfa[_0x47a5('0x38')]=qs[_0x47a5('0x30')](_[_0x47a5('0x39')](_0x136b14[_0x47a5('0x2f')],_0x1127f8[_0x47a5('0x30')]),_0x3ad507);if(_0x136b14['query'][_0x47a5('0x3a')]){_0x361bfa[_0x47a5('0x38')]=_['merge'](_0x361bfa[_0x47a5('0x38')],{'$or':_[_0x47a5('0x2e')](_0x3ad507,function(_0x1d4348){if(_0x1d4348['type']!==_0x47a5('0x3b')){var _0x10f660={};_0x10f660[_0x1d4348['name']]={'$like':'%'+_0x136b14[_0x47a5('0x2f')][_0x47a5('0x3a')]+'%'};return _0x10f660;}})});}_0x361bfa=_['merge']({},_0x361bfa,_0x136b14['options']);var _0x5ebd8c={'where':_0x361bfa[_0x47a5('0x38')]};return db['ChatOfflineMessage'][_0x47a5('0x1c')](_0x5ebd8c)[_0x47a5('0x23')](function(_0x301a85){_0x11a4fa[_0x47a5('0x1c')]=_0x301a85;if(_0x136b14[_0x47a5('0x2f')][_0x47a5('0x3c')]){_0x361bfa[_0x47a5('0x3d')]=[{'all':!![]}];}return db[_0x47a5('0x2a')][_0x47a5('0x3e')](_0x361bfa);})[_0x47a5('0x23')](function(_0x280500){_0x11a4fa[_0x47a5('0x3f')]=_0x280500;return _0x11a4fa;})[_0x47a5('0x23')](respondWithFilteredResult(_0x16631f,_0x361bfa))['catch'](handleError(_0x16631f,null));};exports[_0x47a5('0x40')]=function(_0x1c36fa,_0x331474){var _0x23bd8d={'raw':!![],'where':{'id':_0x1c36fa[_0x47a5('0x41')]['id']}},_0x586f4f={};_0x586f4f['model']=_['keys'](db['ChatOfflineMessage']['rawAttributes']);_0x586f4f[_0x47a5('0x2f')]=_['keys'](_0x1c36fa[_0x47a5('0x2f')]);_0x586f4f[_0x47a5('0x30')]=_[_0x47a5('0x31')](_0x586f4f['model'],_0x586f4f[_0x47a5('0x2f')]);_0x23bd8d[_0x47a5('0x32')]=_['intersection'](_0x586f4f['model'],qs[_0x47a5('0x33')](_0x1c36fa['query'][_0x47a5('0x33')]));_0x23bd8d[_0x47a5('0x32')]=_0x23bd8d[_0x47a5('0x32')][_0x47a5('0x42')]?_0x23bd8d[_0x47a5('0x32')]:_0x586f4f[_0x47a5('0x2d')];if(_0x1c36fa[_0x47a5('0x2f')][_0x47a5('0x3c')]){_0x23bd8d[_0x47a5('0x3d')]=[{'all':!![]}];}_0x23bd8d=_[_0x47a5('0x43')]({},_0x23bd8d,_0x1c36fa[_0x47a5('0x44')]);return db[_0x47a5('0x2a')][_0x47a5('0x45')](_0x23bd8d)[_0x47a5('0x23')](handleEntityNotFound(_0x331474,null))[_0x47a5('0x23')](respondWithResult(_0x331474,null))[_0x47a5('0x46')](handleError(_0x331474,null));};exports['create']=function(_0x2d38de,_0x23bb04){return db['ChatOfflineMessage']['create'](_0x2d38de[_0x47a5('0x47')],{})['then'](respondWithResult(_0x23bb04,0xc9))[_0x47a5('0x46')](handleError(_0x23bb04,null));};exports[_0x47a5('0x22')]=function(_0x54c35f,_0x4f62d3){if(_0x54c35f[_0x47a5('0x47')]['id']){delete _0x54c35f['body']['id'];}return db[_0x47a5('0x2a')][_0x47a5('0x45')]({'where':{'id':_0x54c35f[_0x47a5('0x41')]['id']}})[_0x47a5('0x23')](handleEntityNotFound(_0x4f62d3,null))[_0x47a5('0x23')](saveUpdates(_0x54c35f[_0x47a5('0x47')],null))[_0x47a5('0x23')](respondWithResult(_0x4f62d3,null))['catch'](handleError(_0x4f62d3,null));};exports['destroy']=function(_0x2dd1db,_0x411230){return db[_0x47a5('0x48')][_0x47a5('0x3e')]({'where':{'ChatOfflineMessageId':_0x2dd1db[_0x47a5('0x41')]['id']},'raw':!![]})[_0x47a5('0x23')](function(_0x249de5){_0x249de5['forEach'](function(_0x45cca5){var _0x1c9a62=path[_0x47a5('0x49')](config['root'],_0x47a5('0x4a'),'files',_0x47a5('0x4b'),_0x47a5('0x4c'),_0x45cca5[_0x47a5('0x4d')]);var _0xf03bd5=fs['existsSync'](_0x1c9a62);if(_0xf03bd5)fs_extra[_0x47a5('0x4e')](_0x1c9a62);});})[_0x47a5('0x23')](function(){return db[_0x47a5('0x2a')][_0x47a5('0x45')]({'where':{'id':_0x2dd1db[_0x47a5('0x41')]['id']},'individualHooks':!![]});})[_0x47a5('0x23')](handleEntityNotFound(_0x411230,null))[_0x47a5('0x23')](removeEntity(_0x411230,null))['catch'](handleError(_0x411230,null));};exports[_0x47a5('0x4f')]=function(_0x43721b,_0x187d7e){return db[_0x47a5('0x2a')][_0x47a5('0x4f')]()[_0x47a5('0x23')](respondWithResult(_0x187d7e,null))['catch'](handleError(_0x187d7e,null));};
\ No newline at end of file
+var _0x9957=['sendStatus','status','json','undefined','count','offset','limit','set','Content-Range','reject','save','then','destroy','error','name','send','index','fieldName','type','key','model','map','keys','filters','intersection','query','attributes','fields','length','hasOwnProperty','nolimit','sort','where','filter','merge','VIRTUAL','options','ChatOfflineMessage','findAll','rows','show','rawAttributes','includeAll','include','find','create','catch','body','params','Attachment','forEach','join','root','server','files','attachments','basename','existsSync','remove','describe','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/license/util','../../mysqldb'];(function(_0xf17032,_0x4e536a){var _0x40cd3b=function(_0x520fb4){while(--_0x520fb4){_0xf17032['push'](_0xf17032['shift']());}};_0x40cd3b(++_0x4e536a);}(_0x9957,0x93));var _0x7995=function(_0x6c993a,_0x5ea3ab){_0x6c993a=_0x6c993a-0x0;var _0x27f547=_0x9957[_0x6c993a];return _0x27f547;};'use strict';var emlformat=require(_0x7995('0x0'));var rimraf=require(_0x7995('0x1'));var zipdir=require(_0x7995('0x2'));var jsonpatch=require(_0x7995('0x3'));var rp=require('request-promise');var moment=require(_0x7995('0x4'));var BPromise=require(_0x7995('0x5'));var Mustache=require(_0x7995('0x6'));var util=require(_0x7995('0x7'));var path=require('path');var sox=require(_0x7995('0x8'));var csv=require(_0x7995('0x9'));var ejs=require(_0x7995('0xa'));var fs=require('fs');var fs_extra=require(_0x7995('0xb'));var _=require(_0x7995('0xc'));var squel=require(_0x7995('0xd'));var crypto=require('crypto');var jsforce=require(_0x7995('0xe'));var deskjs=require(_0x7995('0xf'));var toCsv=require('to-csv');var querystring=require(_0x7995('0x10'));var Papa=require(_0x7995('0x11'));var Redis=require(_0x7995('0x12'));var authService=require(_0x7995('0x13'));var qs=require(_0x7995('0x14'));var as=require(_0x7995('0x15'));var hardwareService=require(_0x7995('0x16'));var logger=require('../../config/logger')(_0x7995('0x17'));var utils=require(_0x7995('0x18'));var config=require('../../config/environment');var licenseUtil=require(_0x7995('0x19'));var db=require(_0x7995('0x1a'))['db'];function respondWithStatusCode(_0x19a27e,_0x385f00){_0x385f00=_0x385f00||0xcc;return function(_0x281576){if(_0x281576){return _0x19a27e[_0x7995('0x1b')](_0x385f00);}return _0x19a27e[_0x7995('0x1c')](_0x385f00)['end']();};}function respondWithResult(_0x58f5ad,_0x2b4e94){_0x2b4e94=_0x2b4e94||0xc8;return function(_0x2233dd){if(_0x2233dd){return _0x58f5ad[_0x7995('0x1c')](_0x2b4e94)[_0x7995('0x1d')](_0x2233dd);}};}function respondWithFilteredResult(_0x3f1d3e,_0x1a5310){return function(_0x2202ce){if(_0x2202ce){var _0x41cbf0=typeof _0x1a5310['offset']===_0x7995('0x1e')&&typeof _0x1a5310['limit']===_0x7995('0x1e');var _0x37f297=_0x2202ce[_0x7995('0x1f')];var _0x291317=_0x41cbf0?0x0:_0x1a5310[_0x7995('0x20')];var _0x37a7d4=_0x41cbf0?_0x2202ce['count']:_0x1a5310['offset']+_0x1a5310[_0x7995('0x21')];var _0x5e6f90;if(_0x37a7d4>=_0x37f297){_0x37a7d4=_0x37f297;_0x5e6f90=0xc8;}else{_0x5e6f90=0xce;}_0x3f1d3e['status'](_0x5e6f90);return _0x3f1d3e[_0x7995('0x22')](_0x7995('0x23'),_0x291317+'-'+_0x37a7d4+'/'+_0x37f297)['json'](_0x2202ce);}return null;};}function patchUpdates(_0x3a9b54){return function(_0x51f276){try{jsonpatch['apply'](_0x51f276,_0x3a9b54,!![]);}catch(_0x3e4c54){return BPromise[_0x7995('0x24')](_0x3e4c54);}return _0x51f276[_0x7995('0x25')]();};}function saveUpdates(_0x1a8568,_0x460924){return function(_0x1c278a){if(_0x1c278a){return _0x1c278a['update'](_0x1a8568)[_0x7995('0x26')](function(_0x46ee4b){return _0x46ee4b;});}return null;};}function removeEntity(_0x204507,_0x285437){return function(_0x563799){if(_0x563799){return _0x563799[_0x7995('0x27')]()[_0x7995('0x26')](function(){_0x204507[_0x7995('0x1c')](0xcc)['end']();});}};}function handleEntityNotFound(_0x39df42,_0x34e70c){return function(_0x401dc3){if(!_0x401dc3){_0x39df42[_0x7995('0x1b')](0x194);}return _0x401dc3;};}function handleError(_0x3a3fcf,_0x2a307e){_0x2a307e=_0x2a307e||0x1f4;return function(_0x56691a){logger[_0x7995('0x28')](_0x56691a['stack']);if(_0x56691a[_0x7995('0x29')]){delete _0x56691a[_0x7995('0x29')];}_0x3a3fcf[_0x7995('0x1c')](_0x2a307e)[_0x7995('0x2a')](_0x56691a);};}exports[_0x7995('0x2b')]=function(_0x4b6f99,_0x9b2a15){var _0x514445={},_0x456a28={},_0x3250e0={'count':0x0,'rows':[]};var _0x4253e5=_['map'](db['ChatOfflineMessage']['rawAttributes'],function(_0x3573be){return{'name':_0x3573be[_0x7995('0x2c')],'type':_0x3573be[_0x7995('0x2d')][_0x7995('0x2e')]};});_0x456a28[_0x7995('0x2f')]=_[_0x7995('0x30')](_0x4253e5,'name');_0x456a28['query']=_[_0x7995('0x31')](_0x4b6f99['query']);_0x456a28[_0x7995('0x32')]=_[_0x7995('0x33')](_0x456a28[_0x7995('0x2f')],_0x456a28[_0x7995('0x34')]);_0x514445[_0x7995('0x35')]=_['intersection'](_0x456a28[_0x7995('0x2f')],qs[_0x7995('0x36')](_0x4b6f99['query']['fields']));_0x514445['attributes']=_0x514445[_0x7995('0x35')][_0x7995('0x37')]?_0x514445['attributes']:_0x456a28[_0x7995('0x2f')];if(!_0x4b6f99['query'][_0x7995('0x38')](_0x7995('0x39'))){_0x514445[_0x7995('0x21')]=qs['limit'](_0x4b6f99['query'][_0x7995('0x21')]);_0x514445['offset']=qs['offset'](_0x4b6f99[_0x7995('0x34')][_0x7995('0x20')]);}_0x514445['order']=qs[_0x7995('0x3a')](_0x4b6f99[_0x7995('0x34')][_0x7995('0x3a')]);_0x514445[_0x7995('0x3b')]=qs[_0x7995('0x32')](_['pick'](_0x4b6f99[_0x7995('0x34')],_0x456a28[_0x7995('0x32')]),_0x4253e5);if(_0x4b6f99[_0x7995('0x34')][_0x7995('0x3c')]){_0x514445['where']=_[_0x7995('0x3d')](_0x514445[_0x7995('0x3b')],{'$or':_[_0x7995('0x30')](_0x4253e5,function(_0xe5ea43){if(_0xe5ea43[_0x7995('0x2d')]!==_0x7995('0x3e')){var _0x5688a1={};_0x5688a1[_0xe5ea43[_0x7995('0x29')]]={'$like':'%'+_0x4b6f99[_0x7995('0x34')][_0x7995('0x3c')]+'%'};return _0x5688a1;}})});}_0x514445=_[_0x7995('0x3d')]({},_0x514445,_0x4b6f99[_0x7995('0x3f')]);var _0x298fc2={'where':_0x514445[_0x7995('0x3b')]};return db[_0x7995('0x40')][_0x7995('0x1f')](_0x298fc2)[_0x7995('0x26')](function(_0x6fe77b){_0x3250e0[_0x7995('0x1f')]=_0x6fe77b;if(_0x4b6f99[_0x7995('0x34')]['includeAll']){_0x514445['include']=[{'all':!![]}];}return db[_0x7995('0x40')][_0x7995('0x41')](_0x514445);})['then'](function(_0x4b0855){_0x3250e0[_0x7995('0x42')]=_0x4b0855;return _0x3250e0;})['then'](respondWithFilteredResult(_0x9b2a15,_0x514445))['catch'](handleError(_0x9b2a15,null));};exports[_0x7995('0x43')]=function(_0x36e28b,_0x35c8ff){var _0x576b96={'raw':!![],'where':{'id':_0x36e28b['params']['id']}},_0x46ac4f={};_0x46ac4f[_0x7995('0x2f')]=_['keys'](db['ChatOfflineMessage'][_0x7995('0x44')]);_0x46ac4f[_0x7995('0x34')]=_[_0x7995('0x31')](_0x36e28b[_0x7995('0x34')]);_0x46ac4f['filters']=_[_0x7995('0x33')](_0x46ac4f[_0x7995('0x2f')],_0x46ac4f[_0x7995('0x34')]);_0x576b96[_0x7995('0x35')]=_['intersection'](_0x46ac4f['model'],qs[_0x7995('0x36')](_0x36e28b['query'][_0x7995('0x36')]));_0x576b96['attributes']=_0x576b96[_0x7995('0x35')]['length']?_0x576b96[_0x7995('0x35')]:_0x46ac4f[_0x7995('0x2f')];if(_0x36e28b['query'][_0x7995('0x45')]){_0x576b96[_0x7995('0x46')]=[{'all':!![]}];}_0x576b96=_[_0x7995('0x3d')]({},_0x576b96,_0x36e28b[_0x7995('0x3f')]);return db['ChatOfflineMessage'][_0x7995('0x47')](_0x576b96)[_0x7995('0x26')](handleEntityNotFound(_0x35c8ff,null))[_0x7995('0x26')](respondWithResult(_0x35c8ff,null))['catch'](handleError(_0x35c8ff,null));};exports[_0x7995('0x48')]=function(_0x44f516,_0x511567){return db[_0x7995('0x40')][_0x7995('0x48')](_0x44f516['body'],{})[_0x7995('0x26')](respondWithResult(_0x511567,0xc9))[_0x7995('0x49')](handleError(_0x511567,null));};exports['update']=function(_0x3d1dbb,_0x5843ba){if(_0x3d1dbb[_0x7995('0x4a')]['id']){delete _0x3d1dbb[_0x7995('0x4a')]['id'];}return db[_0x7995('0x40')][_0x7995('0x47')]({'where':{'id':_0x3d1dbb[_0x7995('0x4b')]['id']}})[_0x7995('0x26')](handleEntityNotFound(_0x5843ba,null))[_0x7995('0x26')](saveUpdates(_0x3d1dbb['body'],null))[_0x7995('0x26')](respondWithResult(_0x5843ba,null))[_0x7995('0x49')](handleError(_0x5843ba,null));};exports[_0x7995('0x27')]=function(_0x4ffc8a,_0x19da63){return db[_0x7995('0x4c')][_0x7995('0x41')]({'where':{'ChatOfflineMessageId':_0x4ffc8a['params']['id']},'raw':!![]})['then'](function(_0x5a592e){_0x5a592e[_0x7995('0x4d')](function(_0x1fd1ca){var _0x4cf5db=path[_0x7995('0x4e')](config[_0x7995('0x4f')],_0x7995('0x50'),_0x7995('0x51'),_0x7995('0x52'),'offline-chat',_0x1fd1ca[_0x7995('0x53')]);var _0x4ab09f=fs[_0x7995('0x54')](_0x4cf5db);if(_0x4ab09f)fs_extra[_0x7995('0x55')](_0x4cf5db);});})[_0x7995('0x26')](function(){return db['ChatOfflineMessage']['find']({'where':{'id':_0x4ffc8a['params']['id']},'individualHooks':!![]});})['then'](handleEntityNotFound(_0x19da63,null))[_0x7995('0x26')](removeEntity(_0x19da63,null))[_0x7995('0x49')](handleError(_0x19da63,null));};exports[_0x7995('0x56')]=function(_0x150261,_0x1d957e){return db[_0x7995('0x40')][_0x7995('0x56')]()[_0x7995('0x26')](respondWithResult(_0x1d957e,null))[_0x7995('0x49')](handleError(_0x1d957e,null));};
\ No newline at end of file
diff --git a/server/api/chatOfflineMessage/chatOfflineMessage.events.js b/server/api/chatOfflineMessage/chatOfflineMessage.events.js
index 4d351ac..451f81a 100644
--- a/server/api/chatOfflineMessage/chatOfflineMessage.events.js
+++ b/server/api/chatOfflineMessage/chatOfflineMessage.events.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x171b=['events','../../mysqldb','setMaxListeners','save','update','emit','hook','exports'];(function(_0x49ea3c,_0x20f164){var _0x2efc9a=function(_0x2da1ad){while(--_0x2da1ad){_0x49ea3c['push'](_0x49ea3c['shift']());}};_0x2efc9a(++_0x20f164);}(_0x171b,0xf8));var _0xb171=function(_0x5bc1a3,_0x20b93c){_0x5bc1a3=_0x5bc1a3-0x0;var _0x337754=_0x171b[_0x5bc1a3];return _0x337754;};'use strict';var EventEmitter=require(_0xb171('0x0'));var ChatOfflineMessage=require(_0xb171('0x1'))['db']['ChatOfflineMessage'];var ChatOfflineMessageEvents=new EventEmitter();ChatOfflineMessageEvents[_0xb171('0x2')](0x0);var events={'afterCreate':_0xb171('0x3'),'afterUpdate':_0xb171('0x4'),'afterDestroy':'remove'};function emitEvent(_0x33cb7e){return function(_0x4ad3fd,_0x82a4cc,_0x5f5be9){ChatOfflineMessageEvents[_0xb171('0x5')](_0x33cb7e+':'+_0x4ad3fd['id'],_0x4ad3fd);ChatOfflineMessageEvents['emit'](_0x33cb7e,_0x4ad3fd);_0x5f5be9(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];ChatOfflineMessage[_0xb171('0x6')](e,emitEvent(event));}}module[_0xb171('0x7')]=ChatOfflineMessageEvents;
\ No newline at end of file
+var _0xef96=['emit','hasOwnProperty','exports','events','../../mysqldb','ChatOfflineMessage','setMaxListeners','save','update'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0xef96,0x162));var _0x6ef9=function(_0x319f4c,_0x58fd05){_0x319f4c=_0x319f4c-0x0;var _0x8a89c=_0xef96[_0x319f4c];return _0x8a89c;};'use strict';var EventEmitter=require(_0x6ef9('0x0'));var ChatOfflineMessage=require(_0x6ef9('0x1'))['db'][_0x6ef9('0x2')];var ChatOfflineMessageEvents=new EventEmitter();ChatOfflineMessageEvents[_0x6ef9('0x3')](0x0);var events={'afterCreate':_0x6ef9('0x4'),'afterUpdate':_0x6ef9('0x5'),'afterDestroy':'remove'};function emitEvent(_0x55b811){return function(_0x1eb2c2,_0x5391ed,_0x500b0c){ChatOfflineMessageEvents[_0x6ef9('0x6')](_0x55b811+':'+_0x1eb2c2['id'],_0x1eb2c2);ChatOfflineMessageEvents[_0x6ef9('0x6')](_0x55b811,_0x1eb2c2);_0x500b0c(null);};}for(var e in events){if(events[_0x6ef9('0x7')](e)){var event=events[e];ChatOfflineMessage['hook'](e,emitEvent(event));}}module[_0x6ef9('0x8')]=ChatOfflineMessageEvents;
\ No newline at end of file
diff --git a/server/api/chatOfflineMessage/chatOfflineMessage.model.js b/server/api/chatOfflineMessage/chatOfflineMessage.model.js
index 97dfe36..7f26c88 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 _0x5504=['define','ChatOfflineMessage','utf8mb4','utf8mb4_unicode_ci','./chatOfflineMessage.attributes','exports'];(function(_0xc87d08,_0x59c9be){var _0x30a714=function(_0x437c0d){while(--_0x437c0d){_0xc87d08['push'](_0xc87d08['shift']());}};_0x30a714(++_0x59c9be);}(_0x5504,0x7c));var _0x4550=function(_0x51cc1d,_0xaa88ae){_0x51cc1d=_0x51cc1d-0x0;var _0x2eb9f2=_0x5504[_0x51cc1d];return _0x2eb9f2;};'use strict';var attributes=require(_0x4550('0x0'));module[_0x4550('0x1')]=function(_0x497c8d){return _0x497c8d[_0x4550('0x2')](_0x4550('0x3'),attributes,{'tableName':'chat_offline_messages','paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x4550('0x4'),'collate':_0x4550('0x5')});};
\ No newline at end of file
+var _0x9217=['utf8mb4_unicode_ci','./chatOfflineMessage.attributes','exports','ChatOfflineMessage','chat_offline_messages','utf8mb4'];(function(_0x3c11f9,_0x16ecae){var _0x34cd4c=function(_0x25301d){while(--_0x25301d){_0x3c11f9['push'](_0x3c11f9['shift']());}};_0x34cd4c(++_0x16ecae);}(_0x9217,0x199));var _0x7921=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x9217[_0x3dd15e];return _0x231fd0;};'use strict';var attributes=require(_0x7921('0x0'));module[_0x7921('0x1')]=function(_0xa1cb71){return _0xa1cb71['define'](_0x7921('0x2'),attributes,{'tableName':_0x7921('0x3'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x7921('0x4'),'collate':_0x7921('0x5')});};
\ No newline at end of file
diff --git a/server/api/chatOfflineMessage/chatOfflineMessage.rpc.js b/server/api/chatOfflineMessage/chatOfflineMessage.rpc.js
index 2082b2b..f175648 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 _0xe1b7=['code','message','result','lodash','moment','bluebird','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','ChatOfflineMessage,\x20%s,\x20%s','request\x20sent','ChatOfflineMessage,\x20%s,\x20%s,\x20%s','stringify','error'];(function(_0x310504,_0x26ad95){var _0x5b36d0=function(_0x253f28){while(--_0x253f28){_0x310504['push'](_0x310504['shift']());}};_0x5b36d0(++_0x26ad95);}(_0xe1b7,0x1bb));var _0x7e1b=function(_0x428667,_0x27483f){_0x428667=_0x428667-0x0;var _0x58bd18=_0xe1b7[_0x428667];return _0x58bd18;};'use strict';var _=require(_0x7e1b('0x0'));var util=require('util');var moment=require(_0x7e1b('0x1'));var BPromise=require(_0x7e1b('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x7e1b('0x3'))['db'];var utils=require(_0x7e1b('0x4'));var logger=require(_0x7e1b('0x5'))(_0x7e1b('0x6'));var config=require(_0x7e1b('0x7'));var jayson=require(_0x7e1b('0x8'));var client=jayson[_0x7e1b('0x9')][_0x7e1b('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x46a4e7,_0x3abe2b,_0x217eca){return new BPromise(function(_0x3e5c53,_0x5a47aa){return client[_0x7e1b('0xb')](_0x46a4e7,_0x217eca)[_0x7e1b('0xc')](function(_0x4d9b2e){logger[_0x7e1b('0xd')](_0x7e1b('0xe'),_0x3abe2b,_0x7e1b('0xf'));logger['debug'](_0x7e1b('0x10'),_0x3abe2b,_0x7e1b('0xf'),JSON[_0x7e1b('0x11')](_0x4d9b2e));if(_0x4d9b2e['error']){if(_0x4d9b2e[_0x7e1b('0x12')][_0x7e1b('0x13')]===0x1f4){logger['error']('ChatOfflineMessage,\x20%s,\x20%s',_0x3abe2b,_0x4d9b2e['error'][_0x7e1b('0x14')]);return _0x5a47aa(_0x4d9b2e[_0x7e1b('0x12')][_0x7e1b('0x14')]);}logger[_0x7e1b('0x12')](_0x7e1b('0xe'),_0x3abe2b,_0x4d9b2e[_0x7e1b('0x12')]['message']);return _0x3e5c53(_0x4d9b2e[_0x7e1b('0x12')][_0x7e1b('0x14')]);}else{logger['info'](_0x7e1b('0xe'),_0x3abe2b,'request\x20sent');_0x3e5c53(_0x4d9b2e[_0x7e1b('0x15')][_0x7e1b('0x14')]);}})['catch'](function(_0xa485e9){logger[_0x7e1b('0x12')]('ChatOfflineMessage,\x20%s,\x20%s',_0x3abe2b,_0xa485e9);_0x5a47aa(_0xa485e9);});});}
\ No newline at end of file
+var _0x4172=['then','info','request\x20sent','debug','ChatOfflineMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','ChatOfflineMessage,\x20%s,\x20%s','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','rpc','../../config/environment','jayson/promise','client','http'];(function(_0x280c4b,_0xfe785d){var _0x2a5e90=function(_0x37db79){while(--_0x37db79){_0x280c4b['push'](_0x280c4b['shift']());}};_0x2a5e90(++_0xfe785d);}(_0x4172,0x1aa));var _0x2417=function(_0x2e8c2b,_0x4005f0){_0x2e8c2b=_0x2e8c2b-0x0;var _0x429a18=_0x4172[_0x2e8c2b];return _0x429a18;};'use strict';var _=require(_0x2417('0x0'));var util=require('util');var moment=require(_0x2417('0x1'));var BPromise=require(_0x2417('0x2'));var rs=require(_0x2417('0x3'));var fs=require('fs');var Redis=require(_0x2417('0x4'));var db=require(_0x2417('0x5'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x2417('0x6'));var config=require(_0x2417('0x7'));var jayson=require(_0x2417('0x8'));var client=jayson[_0x2417('0x9')][_0x2417('0xa')]({'port':0x232a});function respondWithRpcPromise(_0xd4e1d7,_0x13fa88,_0x51544c){return new BPromise(function(_0x396f4a,_0x10d611){return client['request'](_0xd4e1d7,_0x51544c)[_0x2417('0xb')](function(_0x6ecde2){logger[_0x2417('0xc')]('ChatOfflineMessage,\x20%s,\x20%s',_0x13fa88,_0x2417('0xd'));logger[_0x2417('0xe')](_0x2417('0xf'),_0x13fa88,_0x2417('0xd'),JSON[_0x2417('0x10')](_0x6ecde2));if(_0x6ecde2['error']){if(_0x6ecde2[_0x2417('0x11')][_0x2417('0x12')]===0x1f4){logger[_0x2417('0x11')]('ChatOfflineMessage,\x20%s,\x20%s',_0x13fa88,_0x6ecde2['error']['message']);return _0x10d611(_0x6ecde2['error'][_0x2417('0x13')]);}logger['error']('ChatOfflineMessage,\x20%s,\x20%s',_0x13fa88,_0x6ecde2[_0x2417('0x11')][_0x2417('0x13')]);return _0x396f4a(_0x6ecde2[_0x2417('0x11')]['message']);}else{logger['info']('ChatOfflineMessage,\x20%s,\x20%s',_0x13fa88,_0x2417('0xd'));_0x396f4a(_0x6ecde2[_0x2417('0x14')][_0x2417('0x13')]);}})[_0x2417('0x15')](function(_0x25da4c){logger[_0x2417('0x11')](_0x2417('0x16'),_0x13fa88,_0x25da4c);_0x10d611(_0x25da4c);});});}
\ No newline at end of file
diff --git a/server/api/chatOfflineMessage/index.js b/server/api/chatOfflineMessage/index.js
index 6bff90f..79cde0b 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 _0xae87=['/:id','destroy','exports','multer','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatOfflineMessage.controller','index','isAuthenticated','describe','get','create','put','update'];(function(_0x2ecd4a,_0x2ef18c){var _0x4b71a1=function(_0x3eb3e1){while(--_0x3eb3e1){_0x2ecd4a['push'](_0x2ecd4a['shift']());}};_0x4b71a1(++_0x2ef18c);}(_0xae87,0xa5));var _0x7ae8=function(_0x2f1114,_0x4561f1){_0x2f1114=_0x2f1114-0x0;var _0x2fe856=_0xae87[_0x2f1114];return _0x2fe856;};'use strict';var multer=require(_0x7ae8('0x0'));var util=require('util');var path=require('path');var timeout=require(_0x7ae8('0x1'));var express=require('express');var router=express[_0x7ae8('0x2')]();var fs_extra=require(_0x7ae8('0x3'));var auth=require(_0x7ae8('0x4'));var interaction=require(_0x7ae8('0x5'));var config=require(_0x7ae8('0x6'));var controller=require(_0x7ae8('0x7'));router['get']('/',auth['isAuthenticated'](),controller[_0x7ae8('0x8')]);router['get']('/describe',auth[_0x7ae8('0x9')](),controller[_0x7ae8('0xa')]);router[_0x7ae8('0xb')]('/:id',auth[_0x7ae8('0x9')](),controller['show']);router['post']('/',auth['isAuthenticated'](),controller[_0x7ae8('0xc')]);router[_0x7ae8('0xd')]('/:id',auth[_0x7ae8('0x9')](),controller[_0x7ae8('0xe')]);router['delete'](_0x7ae8('0xf'),auth[_0x7ae8('0x9')](),controller[_0x7ae8('0x10')]);module[_0x7ae8('0x11')]=router;
\ No newline at end of file
+var _0xc5f6=['exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/describe','describe','/:id','show','post','create','put','delete','destroy'];(function(_0x53a7b0,_0x531322){var _0x231c90=function(_0x41046f){while(--_0x41046f){_0x53a7b0['push'](_0x53a7b0['shift']());}};_0x231c90(++_0x531322);}(_0xc5f6,0x171));var _0x6c5f=function(_0x2a63e2,_0x27ec00){_0x2a63e2=_0x2a63e2-0x0;var _0x4a354b=_0xc5f6[_0x2a63e2];return _0x4a354b;};'use strict';var multer=require(_0x6c5f('0x0'));var util=require(_0x6c5f('0x1'));var path=require(_0x6c5f('0x2'));var timeout=require(_0x6c5f('0x3'));var express=require(_0x6c5f('0x4'));var router=express[_0x6c5f('0x5')]();var fs_extra=require(_0x6c5f('0x6'));var auth=require(_0x6c5f('0x7'));var interaction=require(_0x6c5f('0x8'));var config=require(_0x6c5f('0x9'));var controller=require('./chatOfflineMessage.controller');router[_0x6c5f('0xa')]('/',auth[_0x6c5f('0xb')](),controller[_0x6c5f('0xc')]);router[_0x6c5f('0xa')](_0x6c5f('0xd'),auth[_0x6c5f('0xb')](),controller[_0x6c5f('0xe')]);router[_0x6c5f('0xa')](_0x6c5f('0xf'),auth[_0x6c5f('0xb')](),controller[_0x6c5f('0x10')]);router[_0x6c5f('0x11')]('/',auth[_0x6c5f('0xb')](),controller[_0x6c5f('0x12')]);router[_0x6c5f('0x13')](_0x6c5f('0xf'),auth[_0x6c5f('0xb')](),controller['update']);router[_0x6c5f('0x14')](_0x6c5f('0xf'),auth[_0x6c5f('0xb')](),controller[_0x6c5f('0x15')]);module[_0x6c5f('0x16')]=router;
\ No newline at end of file
diff --git a/server/api/chatProactiveAction/chatProactiveAction.attributes.js b/server/api/chatProactiveAction/chatProactiveAction.attributes.js
index 09defd9..644f4dd 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 _0x6865=['timeout','INTEGER','STRING','ENUM','mouseOver'];(function(_0x54b002,_0x555180){var _0x31b253=function(_0x55bf81){while(--_0x55bf81){_0x54b002['push'](_0x54b002['shift']());}};_0x31b253(++_0x555180);}(_0x6865,0x142));var _0x5686=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x6865[_0x20a584];return _0x4b41a8;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize[_0x5686('0x0')],'allowNull':![]},'type':{'type':Sequelize[_0x5686('0x1')](_0x5686('0x2'),_0x5686('0x3')),'defaultValue':_0x5686('0x2')},'selector':{'type':Sequelize[_0x5686('0x0')]},'timeout':{'type':Sequelize[_0x5686('0x4')]}};
\ No newline at end of file
+var _0x9d27=['STRING','INTEGER','sequelize','exports','ENUM','mouseOver','timeout'];(function(_0x495585,_0x1e0250){var _0x51436a=function(_0x4e7429){while(--_0x4e7429){_0x495585['push'](_0x495585['shift']());}};_0x51436a(++_0x1e0250);}(_0x9d27,0x128));var _0x79d2=function(_0x50cb5c,_0x377a47){_0x50cb5c=_0x50cb5c-0x0;var _0x361ad4=_0x9d27[_0x50cb5c];return _0x361ad4;};'use strict';var Sequelize=require(_0x79d2('0x0'));module[_0x79d2('0x1')]={'name':{'type':Sequelize['STRING'],'allowNull':![]},'type':{'type':Sequelize[_0x79d2('0x2')](_0x79d2('0x3'),_0x79d2('0x4')),'defaultValue':_0x79d2('0x3')},'selector':{'type':Sequelize[_0x79d2('0x5')]},'timeout':{'type':Sequelize[_0x79d2('0x6')]}};
\ No newline at end of file
diff --git a/server/api/chatProactiveAction/chatProactiveAction.controller.js b/server/api/chatProactiveAction/chatProactiveAction.controller.js
index 7f440f3..5868a0c 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 _0xa348=['path','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','status','json','undefined','limit','count','offset','set','apply','reject','save','then','destroy','error','stack','send','show','params','model','ChatProactiveAction','query','keys','filters','intersection','fields','attributes','length','includeAll','include','options','catch','create','body','update','find','eml-format','zip-dir','bluebird','mustache','util'];(function(_0xea78ec,_0x308cfa){var _0xceb6c7=function(_0x115513){while(--_0x115513){_0xea78ec['push'](_0xea78ec['shift']());}};_0xceb6c7(++_0x308cfa);}(_0xa348,0xb2));var _0x8a34=function(_0x582a4e,_0x3af381){_0x582a4e=_0x582a4e-0x0;var _0x357cee=_0xa348[_0x582a4e];return _0x357cee;};'use strict';var emlformat=require(_0x8a34('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x8a34('0x1'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x8a34('0x2'));var Mustache=require(_0x8a34('0x3'));var util=require(_0x8a34('0x4'));var path=require(_0x8a34('0x5'));var sox=require(_0x8a34('0x6'));var csv=require(_0x8a34('0x7'));var ejs=require(_0x8a34('0x8'));var fs=require('fs');var fs_extra=require(_0x8a34('0x9'));var _=require(_0x8a34('0xa'));var squel=require(_0x8a34('0xb'));var crypto=require('crypto');var jsforce=require(_0x8a34('0xc'));var deskjs=require(_0x8a34('0xd'));var toCsv=require(_0x8a34('0x7'));var querystring=require(_0x8a34('0xe'));var Papa=require('papaparse');var Redis=require(_0x8a34('0xf'));var authService=require(_0x8a34('0x10'));var qs=require('../../components/parsers/qs');var as=require(_0x8a34('0x11'));var hardwareService=require(_0x8a34('0x12'));var logger=require(_0x8a34('0x13'))(_0x8a34('0x14'));var utils=require(_0x8a34('0x15'));var config=require(_0x8a34('0x16'));var licenseUtil=require(_0x8a34('0x17'));var db=require(_0x8a34('0x18'))['db'];function respondWithStatusCode(_0x51afe2,_0x59270e){_0x59270e=_0x59270e||0xcc;return function(_0x3849fa){if(_0x3849fa){return _0x51afe2[_0x8a34('0x19')](_0x59270e);}return _0x51afe2['status'](_0x59270e)[_0x8a34('0x1a')]();};}function respondWithResult(_0x10b84c,_0x25577a){_0x25577a=_0x25577a||0xc8;return function(_0x1573ad){if(_0x1573ad){return _0x10b84c[_0x8a34('0x1b')](_0x25577a)[_0x8a34('0x1c')](_0x1573ad);}};}function respondWithFilteredResult(_0x2ca994,_0x2f9e57){return function(_0x165bc2){if(_0x165bc2){var _0x390920=typeof _0x2f9e57['offset']===_0x8a34('0x1d')&&typeof _0x2f9e57[_0x8a34('0x1e')]==='undefined';var _0x541b72=_0x165bc2[_0x8a34('0x1f')];var _0x442e40=_0x390920?0x0:_0x2f9e57[_0x8a34('0x20')];var _0x4da529=_0x390920?_0x165bc2[_0x8a34('0x1f')]:_0x2f9e57['offset']+_0x2f9e57[_0x8a34('0x1e')];var _0x192ca0;if(_0x4da529>=_0x541b72){_0x4da529=_0x541b72;_0x192ca0=0xc8;}else{_0x192ca0=0xce;}_0x2ca994[_0x8a34('0x1b')](_0x192ca0);return _0x2ca994[_0x8a34('0x21')]('Content-Range',_0x442e40+'-'+_0x4da529+'/'+_0x541b72)[_0x8a34('0x1c')](_0x165bc2);}return null;};}function patchUpdates(_0x44e7ac){return function(_0x29e6a9){try{jsonpatch[_0x8a34('0x22')](_0x29e6a9,_0x44e7ac,!![]);}catch(_0x55718c){return BPromise[_0x8a34('0x23')](_0x55718c);}return _0x29e6a9[_0x8a34('0x24')]();};}function saveUpdates(_0x4219d9,_0x327072){return function(_0x1a11c3){if(_0x1a11c3){return _0x1a11c3['update'](_0x4219d9)[_0x8a34('0x25')](function(_0x48f36d){return _0x48f36d;});}return null;};}function removeEntity(_0x4ee6fe,_0x5dfc34){return function(_0x1c490a){if(_0x1c490a){return _0x1c490a[_0x8a34('0x26')]()['then'](function(){_0x4ee6fe[_0x8a34('0x1b')](0xcc)[_0x8a34('0x1a')]();});}};}function handleEntityNotFound(_0x386c6d,_0x2fc062){return function(_0x3339af){if(!_0x3339af){_0x386c6d['sendStatus'](0x194);}return _0x3339af;};}function handleError(_0x326642,_0x435461){_0x435461=_0x435461||0x1f4;return function(_0x118d31){logger[_0x8a34('0x27')](_0x118d31[_0x8a34('0x28')]);if(_0x118d31['name']){delete _0x118d31['name'];}_0x326642[_0x8a34('0x1b')](_0x435461)[_0x8a34('0x29')](_0x118d31);};}exports[_0x8a34('0x2a')]=function(_0x18e624,_0x550acc){var _0x3fbb7e={'raw':!![],'where':{'id':_0x18e624[_0x8a34('0x2b')]['id']}},_0x22c4f0={};_0x22c4f0[_0x8a34('0x2c')]=_['keys'](db[_0x8a34('0x2d')]['rawAttributes']);_0x22c4f0[_0x8a34('0x2e')]=_[_0x8a34('0x2f')](_0x18e624['query']);_0x22c4f0[_0x8a34('0x30')]=_[_0x8a34('0x31')](_0x22c4f0['model'],_0x22c4f0[_0x8a34('0x2e')]);_0x3fbb7e['attributes']=_[_0x8a34('0x31')](_0x22c4f0[_0x8a34('0x2c')],qs[_0x8a34('0x32')](_0x18e624['query']['fields']));_0x3fbb7e['attributes']=_0x3fbb7e[_0x8a34('0x33')][_0x8a34('0x34')]?_0x3fbb7e[_0x8a34('0x33')]:_0x22c4f0['model'];if(_0x18e624[_0x8a34('0x2e')][_0x8a34('0x35')]){_0x3fbb7e[_0x8a34('0x36')]=[{'all':!![]}];}_0x3fbb7e=_['merge']({},_0x3fbb7e,_0x18e624[_0x8a34('0x37')]);return db[_0x8a34('0x2d')]['find'](_0x3fbb7e)[_0x8a34('0x25')](handleEntityNotFound(_0x550acc,null))[_0x8a34('0x25')](respondWithResult(_0x550acc,null))[_0x8a34('0x38')](handleError(_0x550acc,null));};exports[_0x8a34('0x39')]=function(_0x488050,_0x4f08f6){return db['ChatProactiveAction'][_0x8a34('0x39')](_0x488050[_0x8a34('0x3a')],{})[_0x8a34('0x25')](respondWithResult(_0x4f08f6,0xc9))[_0x8a34('0x38')](handleError(_0x4f08f6,null));};exports[_0x8a34('0x3b')]=function(_0x24e45d,_0x1def69){if(_0x24e45d['body']['id']){delete _0x24e45d['body']['id'];}return db[_0x8a34('0x2d')][_0x8a34('0x3c')]({'where':{'id':_0x24e45d[_0x8a34('0x2b')]['id']}})[_0x8a34('0x25')](handleEntityNotFound(_0x1def69,null))[_0x8a34('0x25')](saveUpdates(_0x24e45d[_0x8a34('0x3a')],null))[_0x8a34('0x25')](respondWithResult(_0x1def69,null))[_0x8a34('0x38')](handleError(_0x1def69,null));};exports['destroy']=function(_0x33861f,_0x59f246){return db[_0x8a34('0x2d')][_0x8a34('0x3c')]({'where':{'id':_0x33861f[_0x8a34('0x2b')]['id']}})[_0x8a34('0x25')](handleEntityNotFound(_0x59f246,null))[_0x8a34('0x25')](removeEntity(_0x59f246,null))[_0x8a34('0x38')](handleError(_0x59f246,null));};
\ No newline at end of file
+var _0xeb0d=['../../components/parsers/advancedSearch','../../config/license/hardware','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','end','json','undefined','limit','count','offset','set','Content-Range','apply','reject','save','update','then','destroy','error','stack','name','send','show','params','model','ChatProactiveAction','keys','query','filters','intersection','attributes','fields','includeAll','include','merge','options','catch','create','body','find','eml-format','request-promise','moment','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','crypto','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs'];(function(_0x4d02ed,_0x1ef9f6){var _0x52c36b=function(_0x3ed56e){while(--_0x3ed56e){_0x4d02ed['push'](_0x4d02ed['shift']());}};_0x52c36b(++_0x1ef9f6);}(_0xeb0d,0xe2));var _0xdeb0=function(_0x18c2cc,_0x4c7ef7){_0x18c2cc=_0x18c2cc-0x0;var _0x16daa4=_0xeb0d[_0x18c2cc];return _0x16daa4;};'use strict';var emlformat=require(_0xdeb0('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0xdeb0('0x1'));var moment=require(_0xdeb0('0x2'));var BPromise=require('bluebird');var Mustache=require(_0xdeb0('0x3'));var util=require(_0xdeb0('0x4'));var path=require(_0xdeb0('0x5'));var sox=require(_0xdeb0('0x6'));var csv=require(_0xdeb0('0x7'));var ejs=require(_0xdeb0('0x8'));var fs=require('fs');var fs_extra=require(_0xdeb0('0x9'));var _=require(_0xdeb0('0xa'));var squel=require('squel');var crypto=require(_0xdeb0('0xb'));var jsforce=require(_0xdeb0('0xc'));var deskjs=require('desk.js');var toCsv=require(_0xdeb0('0x7'));var querystring=require(_0xdeb0('0xd'));var Papa=require(_0xdeb0('0xe'));var Redis=require(_0xdeb0('0xf'));var authService=require(_0xdeb0('0x10'));var qs=require(_0xdeb0('0x11'));var as=require(_0xdeb0('0x12'));var hardwareService=require(_0xdeb0('0x13'));var logger=require('../../config/logger')('api');var utils=require(_0xdeb0('0x14'));var config=require('../../config/environment');var licenseUtil=require(_0xdeb0('0x15'));var db=require(_0xdeb0('0x16'))['db'];function respondWithStatusCode(_0x30ef3a,_0x3cce39){_0x3cce39=_0x3cce39||0xcc;return function(_0xcf93dc){if(_0xcf93dc){return _0x30ef3a[_0xdeb0('0x17')](_0x3cce39);}return _0x30ef3a[_0xdeb0('0x18')](_0x3cce39)[_0xdeb0('0x19')]();};}function respondWithResult(_0x1f065c,_0x50e782){_0x50e782=_0x50e782||0xc8;return function(_0xf0995d){if(_0xf0995d){return _0x1f065c[_0xdeb0('0x18')](_0x50e782)[_0xdeb0('0x1a')](_0xf0995d);}};}function respondWithFilteredResult(_0x244001,_0x35fce3){return function(_0x55fab1){if(_0x55fab1){var _0x1510ce=typeof _0x35fce3['offset']===_0xdeb0('0x1b')&&typeof _0x35fce3[_0xdeb0('0x1c')]===_0xdeb0('0x1b');var _0x5c3c97=_0x55fab1[_0xdeb0('0x1d')];var _0x51e7ee=_0x1510ce?0x0:_0x35fce3[_0xdeb0('0x1e')];var _0x2b1efa=_0x1510ce?_0x55fab1[_0xdeb0('0x1d')]:_0x35fce3['offset']+_0x35fce3[_0xdeb0('0x1c')];var _0x5a44be;if(_0x2b1efa>=_0x5c3c97){_0x2b1efa=_0x5c3c97;_0x5a44be=0xc8;}else{_0x5a44be=0xce;}_0x244001[_0xdeb0('0x18')](_0x5a44be);return _0x244001[_0xdeb0('0x1f')](_0xdeb0('0x20'),_0x51e7ee+'-'+_0x2b1efa+'/'+_0x5c3c97)[_0xdeb0('0x1a')](_0x55fab1);}return null;};}function patchUpdates(_0x486f0d){return function(_0x2ba1ff){try{jsonpatch[_0xdeb0('0x21')](_0x2ba1ff,_0x486f0d,!![]);}catch(_0x2f6cac){return BPromise[_0xdeb0('0x22')](_0x2f6cac);}return _0x2ba1ff[_0xdeb0('0x23')]();};}function saveUpdates(_0x2a3ec4,_0x3173a2){return function(_0xd48473){if(_0xd48473){return _0xd48473[_0xdeb0('0x24')](_0x2a3ec4)[_0xdeb0('0x25')](function(_0x32cdf6){return _0x32cdf6;});}return null;};}function removeEntity(_0x5d7565,_0x566f1f){return function(_0x539652){if(_0x539652){return _0x539652[_0xdeb0('0x26')]()['then'](function(){_0x5d7565['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x38bd4d,_0xbfa9e8){return function(_0x2076c4){if(!_0x2076c4){_0x38bd4d[_0xdeb0('0x17')](0x194);}return _0x2076c4;};}function handleError(_0x3ae683,_0x2cd180){_0x2cd180=_0x2cd180||0x1f4;return function(_0x19456b){logger[_0xdeb0('0x27')](_0x19456b[_0xdeb0('0x28')]);if(_0x19456b[_0xdeb0('0x29')]){delete _0x19456b[_0xdeb0('0x29')];}_0x3ae683[_0xdeb0('0x18')](_0x2cd180)[_0xdeb0('0x2a')](_0x19456b);};}exports[_0xdeb0('0x2b')]=function(_0x8f5bb3,_0x224528){var _0x9ac567={'raw':!![],'where':{'id':_0x8f5bb3[_0xdeb0('0x2c')]['id']}},_0x59cc01={};_0x59cc01[_0xdeb0('0x2d')]=_['keys'](db[_0xdeb0('0x2e')]['rawAttributes']);_0x59cc01['query']=_[_0xdeb0('0x2f')](_0x8f5bb3[_0xdeb0('0x30')]);_0x59cc01[_0xdeb0('0x31')]=_[_0xdeb0('0x32')](_0x59cc01['model'],_0x59cc01[_0xdeb0('0x30')]);_0x9ac567[_0xdeb0('0x33')]=_[_0xdeb0('0x32')](_0x59cc01['model'],qs[_0xdeb0('0x34')](_0x8f5bb3['query'][_0xdeb0('0x34')]));_0x9ac567[_0xdeb0('0x33')]=_0x9ac567[_0xdeb0('0x33')]['length']?_0x9ac567[_0xdeb0('0x33')]:_0x59cc01['model'];if(_0x8f5bb3[_0xdeb0('0x30')][_0xdeb0('0x35')]){_0x9ac567[_0xdeb0('0x36')]=[{'all':!![]}];}_0x9ac567=_[_0xdeb0('0x37')]({},_0x9ac567,_0x8f5bb3[_0xdeb0('0x38')]);return db[_0xdeb0('0x2e')]['find'](_0x9ac567)[_0xdeb0('0x25')](handleEntityNotFound(_0x224528,null))[_0xdeb0('0x25')](respondWithResult(_0x224528,null))[_0xdeb0('0x39')](handleError(_0x224528,null));};exports['create']=function(_0x301f28,_0x634bea){return db['ChatProactiveAction'][_0xdeb0('0x3a')](_0x301f28[_0xdeb0('0x3b')],{})[_0xdeb0('0x25')](respondWithResult(_0x634bea,0xc9))[_0xdeb0('0x39')](handleError(_0x634bea,null));};exports[_0xdeb0('0x24')]=function(_0x15e6ae,_0x57297c){if(_0x15e6ae[_0xdeb0('0x3b')]['id']){delete _0x15e6ae[_0xdeb0('0x3b')]['id'];}return db[_0xdeb0('0x2e')][_0xdeb0('0x3c')]({'where':{'id':_0x15e6ae['params']['id']}})[_0xdeb0('0x25')](handleEntityNotFound(_0x57297c,null))['then'](saveUpdates(_0x15e6ae[_0xdeb0('0x3b')],null))[_0xdeb0('0x25')](respondWithResult(_0x57297c,null))[_0xdeb0('0x39')](handleError(_0x57297c,null));};exports[_0xdeb0('0x26')]=function(_0x5526e0,_0x23215f){return db[_0xdeb0('0x2e')][_0xdeb0('0x3c')]({'where':{'id':_0x5526e0[_0xdeb0('0x2c')]['id']}})[_0xdeb0('0x25')](handleEntityNotFound(_0x23215f,null))[_0xdeb0('0x25')](removeEntity(_0x23215f,null))[_0xdeb0('0x39')](handleError(_0x23215f,null));};
\ No newline at end of file
diff --git a/server/api/chatProactiveAction/chatProactiveAction.model.js b/server/api/chatProactiveAction/chatProactiveAction.model.js
index 50fe99f..74e9761 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 _0xde2a=['./chatProactiveAction.attributes','exports','define','ChatProactiveAction','lodash','util','../../config/logger','api'];(function(_0x53d17a,_0x27fee){var _0x3f5557=function(_0x1b4731){while(--_0x1b4731){_0x53d17a['push'](_0x53d17a['shift']());}};_0x3f5557(++_0x27fee);}(_0xde2a,0x164));var _0xade2=function(_0x5b8b97,_0x6b4dfa){_0x5b8b97=_0x5b8b97-0x0;var _0x1fdf84=_0xde2a[_0x5b8b97];return _0x1fdf84;};'use strict';var _=require(_0xade2('0x0'));var util=require(_0xade2('0x1'));var logger=require(_0xade2('0x2'))(_0xade2('0x3'));var moment=require('moment');var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0xade2('0x4'));module[_0xade2('0x5')]=function(_0x475e90,_0x2254e0){return _0x475e90[_0xade2('0x6')](_0xade2('0x7'),attributes,{'tableName':'chat_proactive_actions','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x30fc=['bluebird','request-promise','path','rimraf','../../config/environment','./chatProactiveAction.attributes','define','ChatProactiveAction','chat_proactive_actions','lodash','util','api','moment'];(function(_0x5cfa5a,_0x1d8e10){var _0x47b28c=function(_0x529fb2){while(--_0x529fb2){_0x5cfa5a['push'](_0x5cfa5a['shift']());}};_0x47b28c(++_0x1d8e10);}(_0x30fc,0xbf));var _0xc30f=function(_0x78f3a8,_0x4d9551){_0x78f3a8=_0x78f3a8-0x0;var _0x48af0d=_0x30fc[_0x78f3a8];return _0x48af0d;};'use strict';var _=require(_0xc30f('0x0'));var util=require(_0xc30f('0x1'));var logger=require('../../config/logger')(_0xc30f('0x2'));var moment=require(_0xc30f('0x3'));var BPromise=require(_0xc30f('0x4'));var rp=require(_0xc30f('0x5'));var fs=require('fs');var path=require(_0xc30f('0x6'));var rimraf=require(_0xc30f('0x7'));var config=require(_0xc30f('0x8'));var attributes=require(_0xc30f('0x9'));module['exports']=function(_0x58f840,_0x33030f){return _0x58f840[_0xc30f('0xa')](_0xc30f('0xb'),attributes,{'tableName':_0xc30f('0xc'),'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 28f5f82..83a7929 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 _0xe5ea=['../../config/environment','jayson/promise','client','http','request','then','info','ChatProactiveAction,\x20%s,\x20%s','ChatProactiveAction,\x20%s,\x20%s,\x20%s','request\x20sent','error','message','result','catch','lodash','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc'];(function(_0x4f758d,_0x39e109){var _0x2a9d1b=function(_0x522b17){while(--_0x522b17){_0x4f758d['push'](_0x4f758d['shift']());}};_0x2a9d1b(++_0x39e109);}(_0xe5ea,0x116));var _0xae5e=function(_0x17aa38,_0x429892){_0x17aa38=_0x17aa38-0x0;var _0x4a8cbb=_0xe5ea[_0x17aa38];return _0x4a8cbb;};'use strict';var _=require(_0xae5e('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0xae5e('0x1'));var rs=require(_0xae5e('0x2'));var fs=require('fs');var Redis=require(_0xae5e('0x3'));var db=require(_0xae5e('0x4'))['db'];var utils=require(_0xae5e('0x5'));var logger=require(_0xae5e('0x6'))(_0xae5e('0x7'));var config=require(_0xae5e('0x8'));var jayson=require(_0xae5e('0x9'));var client=jayson[_0xae5e('0xa')][_0xae5e('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x473e21,_0x356df2,_0x378b19){return new BPromise(function(_0x44abf1,_0x3e3915){return client[_0xae5e('0xc')](_0x473e21,_0x378b19)[_0xae5e('0xd')](function(_0x16f473){logger[_0xae5e('0xe')](_0xae5e('0xf'),_0x356df2,'request\x20sent');logger['debug'](_0xae5e('0x10'),_0x356df2,_0xae5e('0x11'),JSON['stringify'](_0x16f473));if(_0x16f473[_0xae5e('0x12')]){if(_0x16f473[_0xae5e('0x12')]['code']===0x1f4){logger[_0xae5e('0x12')](_0xae5e('0xf'),_0x356df2,_0x16f473[_0xae5e('0x12')][_0xae5e('0x13')]);return _0x3e3915(_0x16f473[_0xae5e('0x12')][_0xae5e('0x13')]);}logger[_0xae5e('0x12')]('ChatProactiveAction,\x20%s,\x20%s',_0x356df2,_0x16f473['error'][_0xae5e('0x13')]);return _0x44abf1(_0x16f473[_0xae5e('0x12')][_0xae5e('0x13')]);}else{logger[_0xae5e('0xe')]('ChatProactiveAction,\x20%s,\x20%s',_0x356df2,_0xae5e('0x11'));_0x44abf1(_0x16f473[_0xae5e('0x14')][_0xae5e('0x13')]);}})[_0xae5e('0x15')](function(_0xa5c4fc){logger[_0xae5e('0x12')](_0xae5e('0xf'),_0x356df2,_0xa5c4fc);_0x3e3915(_0xa5c4fc);});});}
\ No newline at end of file
+var _0x66e1=['message','request\x20sent','lodash','util','moment','bluebird','randomstring','../../mysqldb','client','http','request','then','info','ChatProactiveAction,\x20%s,\x20%s','debug','ChatProactiveAction,\x20%s,\x20%s,\x20%s','stringify','error','code'];(function(_0x5627e1,_0x1b2dbf){var _0x2f013f=function(_0x142015){while(--_0x142015){_0x5627e1['push'](_0x5627e1['shift']());}};_0x2f013f(++_0x1b2dbf);}(_0x66e1,0xd3));var _0x166e=function(_0x1ae31c,_0x8dcd2d){_0x1ae31c=_0x1ae31c-0x0;var _0x19519d=_0x66e1[_0x1ae31c];return _0x19519d;};'use strict';var _=require(_0x166e('0x0'));var util=require(_0x166e('0x1'));var moment=require(_0x166e('0x2'));var BPromise=require(_0x166e('0x3'));var rs=require(_0x166e('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x166e('0x5'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')('rpc');var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x166e('0x6')][_0x166e('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x32560f,_0x233017,_0x473b49){return new BPromise(function(_0x57db94,_0x5b61b4){return client[_0x166e('0x8')](_0x32560f,_0x473b49)[_0x166e('0x9')](function(_0x4717d9){logger[_0x166e('0xa')](_0x166e('0xb'),_0x233017,'request\x20sent');logger[_0x166e('0xc')](_0x166e('0xd'),_0x233017,'request\x20sent',JSON[_0x166e('0xe')](_0x4717d9));if(_0x4717d9['error']){if(_0x4717d9[_0x166e('0xf')][_0x166e('0x10')]===0x1f4){logger[_0x166e('0xf')](_0x166e('0xb'),_0x233017,_0x4717d9[_0x166e('0xf')][_0x166e('0x11')]);return _0x5b61b4(_0x4717d9[_0x166e('0xf')]['message']);}logger[_0x166e('0xf')]('ChatProactiveAction,\x20%s,\x20%s',_0x233017,_0x4717d9[_0x166e('0xf')][_0x166e('0x11')]);return _0x57db94(_0x4717d9[_0x166e('0xf')][_0x166e('0x11')]);}else{logger[_0x166e('0xa')]('ChatProactiveAction,\x20%s,\x20%s',_0x233017,_0x166e('0x12'));_0x57db94(_0x4717d9['result'][_0x166e('0x11')]);}})['catch'](function(_0x27398a){logger[_0x166e('0xf')]('ChatProactiveAction,\x20%s,\x20%s',_0x233017,_0x27398a);_0x5b61b4(_0x27398a);});});}
\ No newline at end of file
diff --git a/server/api/chatProactiveAction/index.js b/server/api/chatProactiveAction/index.js
index 27eb5e4..d99efbe 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 _0x3eea=['path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatProactiveAction.controller','get','/:id','post','create','update','isAuthenticated','destroy','multer'];(function(_0x5dd351,_0x19ebc5){var _0x1fbdba=function(_0x58297e){while(--_0x58297e){_0x5dd351['push'](_0x5dd351['shift']());}};_0x1fbdba(++_0x19ebc5);}(_0x3eea,0x1ca));var _0xa3ee=function(_0x4bb80d,_0x304b77){_0x4bb80d=_0x4bb80d-0x0;var _0x5caa9=_0x3eea[_0x4bb80d];return _0x5caa9;};'use strict';var multer=require(_0xa3ee('0x0'));var util=require('util');var path=require(_0xa3ee('0x1'));var timeout=require(_0xa3ee('0x2'));var express=require(_0xa3ee('0x3'));var router=express[_0xa3ee('0x4')]();var fs_extra=require(_0xa3ee('0x5'));var auth=require(_0xa3ee('0x6'));var interaction=require(_0xa3ee('0x7'));var config=require(_0xa3ee('0x8'));var controller=require(_0xa3ee('0x9'));router[_0xa3ee('0xa')](_0xa3ee('0xb'),auth['isAuthenticated'](),controller['show']);router[_0xa3ee('0xc')]('/',auth['isAuthenticated'](),controller[_0xa3ee('0xd')]);router['put'](_0xa3ee('0xb'),auth['isAuthenticated'](),controller[_0xa3ee('0xe')]);router['delete'](_0xa3ee('0xb'),auth[_0xa3ee('0xf')](),controller[_0xa3ee('0x10')]);module['exports']=router;
\ No newline at end of file
+var _0x3f8a=['/:id','isAuthenticated','show','post','create','put','update','destroy','exports','multer','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatProactiveAction.controller','get'];(function(_0x397d02,_0x20a1a0){var _0x2a2ae4=function(_0x12f013){while(--_0x12f013){_0x397d02['push'](_0x397d02['shift']());}};_0x2a2ae4(++_0x20a1a0);}(_0x3f8a,0x1d5));var _0xa3f8=function(_0x1fa3a9,_0x25a3f9){_0x1fa3a9=_0x1fa3a9-0x0;var _0x1e31ff=_0x3f8a[_0x1fa3a9];return _0x1e31ff;};'use strict';var multer=require(_0xa3f8('0x0'));var util=require(_0xa3f8('0x1'));var path=require(_0xa3f8('0x2'));var timeout=require(_0xa3f8('0x3'));var express=require('express');var router=express[_0xa3f8('0x4')]();var fs_extra=require(_0xa3f8('0x5'));var auth=require(_0xa3f8('0x6'));var interaction=require(_0xa3f8('0x7'));var config=require(_0xa3f8('0x8'));var controller=require(_0xa3f8('0x9'));router[_0xa3f8('0xa')](_0xa3f8('0xb'),auth[_0xa3f8('0xc')](),controller[_0xa3f8('0xd')]);router[_0xa3f8('0xe')]('/',auth[_0xa3f8('0xc')](),controller[_0xa3f8('0xf')]);router[_0xa3f8('0x10')](_0xa3f8('0xb'),auth[_0xa3f8('0xc')](),controller[_0xa3f8('0x11')]);router['delete'](_0xa3f8('0xb'),auth[_0xa3f8('0xc')](),controller[_0xa3f8('0x12')]);module[_0xa3f8('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 1df1ba0..2d71934 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 _0xf1b4=['name','INTEGER','ENUM','rrmemory','beepall','roundrobin','sequelize','exports','STRING'];(function(_0x5c0bed,_0x178478){var _0x603226=function(_0xe97300){while(--_0xe97300){_0x5c0bed['push'](_0x5c0bed['shift']());}};_0x603226(++_0x178478);}(_0xf1b4,0x1c8));var _0x4f1b=function(_0x3bfc09,_0x395372){_0x3bfc09=_0x3bfc09-0x0;var _0x56c17f=_0xf1b4[_0x3bfc09];return _0x56c17f;};'use strict';var Sequelize=require(_0x4f1b('0x0'));module[_0x4f1b('0x1')]={'name':{'type':Sequelize[_0x4f1b('0x2')],'unique':_0x4f1b('0x3'),'allowNull':![],'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize[_0x4f1b('0x2')]},'timeout':{'type':Sequelize[_0x4f1b('0x4')],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0x4f1b('0x5')](_0x4f1b('0x6'),_0x4f1b('0x7'),_0x4f1b('0x8'))}};
\ No newline at end of file
+var _0x2020=['name','STRING','INTEGER','ENUM','beepall','roundrobin','sequelize','exports'];(function(_0x3330ea,_0xa13041){var _0x239177=function(_0x3c5e62){while(--_0x3c5e62){_0x3330ea['push'](_0x3330ea['shift']());}};_0x239177(++_0xa13041);}(_0x2020,0x15e));var _0x0202=function(_0x4c24ef,_0x5558bb){_0x4c24ef=_0x4c24ef-0x0;var _0xdb7988=_0x2020[_0x4c24ef];return _0xdb7988;};'use strict';var Sequelize=require(_0x0202('0x0'));module[_0x0202('0x1')]={'name':{'type':Sequelize['STRING'],'unique':_0x0202('0x2'),'allowNull':![],'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize[_0x0202('0x3')]},'timeout':{'type':Sequelize[_0x0202('0x4')],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0x0202('0x5')]('rrmemory',_0x0202('0x6'),_0x0202('0x7'))}};
\ No newline at end of file
diff --git a/server/api/chatQueue/chatQueue.controller.js b/server/api/chatQueue/chatQueue.controller.js
index f99c398..7414095 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 _0x4fa7=['join','ut.TeamId\x20=\x20tq.TeamId','ChatQueueId\x20=\x20?','clone','ut.UserId\x20=\x20?','toString','SELECT','every','TeamId','includes','all','union','compact','value','isEmpty','removeAgents','userChatQueue:remove','addAgents','omit','isArray','getAgents','lodash','squel','../../components/parsers/qs','../../config/logger','api','../../config/environment','../../mysqldb','defaults','redis','localhost','socket.io-emitter','./chatQueue.socket','register','sendStatus','end','status','json','offset','undefined','limit','count','then','ChatQueues','UserProfileResource','destroy','error','stack','name','send','index','ChatQueue','rawAttributes','fieldName','type','key','getOptions','include','query','show','params','model','keys','intersection','fields','attributes','length','includeAll','merge','options','find','catch','create','body','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','autoAssociation','update','describe','getMembers','findOne','filters','nolimit','order','sort','where','ChatQueueId','filter','map','UserChatQueue','User','findAndCountAll','UserId','agent','chatPause','updatedAt','createdAt','format','SIP','getTeams','Team','pick','ids','findAll','online','Agents','sequelize','transaction','addTeams','each','findOrCreate','forEach','emit','userChatQueue:save','removeTeams','field'];(function(_0x137724,_0x1c9ab8){var _0x5eecc4=function(_0x2836da){while(--_0x2836da){_0x137724['push'](_0x137724['shift']());}};_0x5eecc4(++_0x1c9ab8);}(_0x4fa7,0x17a));var _0x74fa=function(_0x9e0cb3,_0x9cd497){_0x9e0cb3=_0x9e0cb3-0x0;var _0x5926b7=_0x4fa7[_0x9e0cb3];return _0x5926b7;};'use strict';var BPromise=require('bluebird');var util=require('util');var _=require(_0x74fa('0x0'));var squel=require(_0x74fa('0x1'));var Redis=require('ioredis');var qs=require(_0x74fa('0x2'));var logger=require(_0x74fa('0x3'))(_0x74fa('0x4'));var config=require(_0x74fa('0x5'));var db=require(_0x74fa('0x6'))['db'];config['redis']=_[_0x74fa('0x7')](config[_0x74fa('0x8')],{'host':_0x74fa('0x9'),'port':0x18eb});var socket=require(_0x74fa('0xa'))(new Redis(config[_0x74fa('0x8')]));require(_0x74fa('0xb'))[_0x74fa('0xc')](socket);function respondWithStatusCode(_0x3df2a6,_0x16d4bb){_0x16d4bb=_0x16d4bb||0xcc;return function(_0x11e296){if(_0x11e296){return _0x3df2a6[_0x74fa('0xd')](_0x16d4bb);}return _0x3df2a6['status'](_0x16d4bb)[_0x74fa('0xe')]();};}function respondWithResult(_0x18df78,_0x344fc1){_0x344fc1=_0x344fc1||0xc8;return function(_0x39d3ba){if(_0x39d3ba){return _0x18df78[_0x74fa('0xf')](_0x344fc1)[_0x74fa('0x10')](_0x39d3ba);}};}function respondWithFilteredResult(_0x1c04c4,_0x1c96d0){return function(_0x5326b7){if(_0x5326b7){var _0x5e098f=typeof _0x1c96d0[_0x74fa('0x11')]===_0x74fa('0x12')&&typeof _0x1c96d0[_0x74fa('0x13')]===_0x74fa('0x12');var _0x27a323=_0x5326b7[_0x74fa('0x14')];var _0x480d60=_0x5e098f?0x0:_0x1c96d0[_0x74fa('0x11')];var _0x421720=_0x5e098f?_0x5326b7[_0x74fa('0x14')]:_0x1c96d0[_0x74fa('0x11')]+_0x1c96d0[_0x74fa('0x13')];var _0x42680a;if(_0x421720>=_0x27a323){_0x421720=_0x27a323;_0x42680a=0xc8;}else{_0x42680a=0xce;}_0x1c04c4[_0x74fa('0xf')](_0x42680a);return _0x1c04c4['set']('Content-Range',_0x480d60+'-'+_0x421720+'/'+_0x27a323)[_0x74fa('0x10')](_0x5326b7);}return null;};}function saveUpdates(_0x3a1f02){return function(_0x5a0cf6){if(_0x5a0cf6){return _0x5a0cf6['update'](_0x3a1f02)[_0x74fa('0x15')](function(_0x31987e){return _0x31987e;});}return null;};}function removeEntity(_0x624efe){return function(_0x582f48){if(_0x582f48){return _0x582f48['destroy']()[_0x74fa('0x15')](function(){var _0x325674=_0x582f48['get']({'plain':!![]});var _0x15b1c1=_0x74fa('0x16');return db[_0x74fa('0x17')][_0x74fa('0x18')]({'where':{'type':_0x15b1c1,'resourceId':_0x325674['id']}})[_0x74fa('0x15')](function(){return _0x582f48;});})[_0x74fa('0x15')](function(){_0x624efe['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0xe66ee1){return function(_0x2d23e7){if(!_0x2d23e7){_0xe66ee1['sendStatus'](0x194);}return _0x2d23e7;};}function handleError(_0x4d95d3,_0x9f7266){_0x9f7266=_0x9f7266||0x1f4;return function(_0x4f9b19){logger[_0x74fa('0x19')](_0x4f9b19[_0x74fa('0x1a')]);if(_0x4f9b19[_0x74fa('0x1b')]){delete _0x4f9b19[_0x74fa('0x1b')];}_0x4d95d3[_0x74fa('0xf')](_0x9f7266)[_0x74fa('0x1c')](_0x4f9b19);};}exports[_0x74fa('0x1d')]=function(_0x3e9afb,_0x1bf5c4){var _0x429157={};var _0x32b747={'count':0x0,'rows':[]};var _0x3184a8=_['map'](db[_0x74fa('0x1e')][_0x74fa('0x1f')],function(_0x3b666f){return{'name':_0x3b666f[_0x74fa('0x20')],'type':_0x3b666f[_0x74fa('0x21')][_0x74fa('0x22')]};});_0x429157=qs[_0x74fa('0x23')](_0x3184a8,_0x3e9afb);var _0x47a56f={'where':_0x429157['where']};return db[_0x74fa('0x1e')][_0x74fa('0x14')](_0x47a56f)[_0x74fa('0x15')](function(_0x59f0a8){_0x32b747[_0x74fa('0x14')]=_0x59f0a8;_0x429157[_0x74fa('0x24')]=qs[_0x74fa('0x24')](_0x3e9afb[_0x74fa('0x25')]);return db[_0x74fa('0x1e')]['findAll'](_0x429157);})[_0x74fa('0x15')](function(_0x5eb13a){_0x32b747['rows']=_0x5eb13a;return _0x32b747;})[_0x74fa('0x15')](respondWithFilteredResult(_0x1bf5c4,_0x429157))['catch'](handleError(_0x1bf5c4,null));};exports[_0x74fa('0x26')]=function(_0x4f383a,_0x21fe88){var _0x12e9b5={'raw':!![],'where':{'id':_0x4f383a[_0x74fa('0x27')]['id']}},_0x86df7d={};_0x86df7d[_0x74fa('0x28')]=_['keys'](db[_0x74fa('0x1e')][_0x74fa('0x1f')]);_0x86df7d['query']=_[_0x74fa('0x29')](_0x4f383a['query']);_0x86df7d['filters']=_[_0x74fa('0x2a')](_0x86df7d[_0x74fa('0x28')],_0x86df7d[_0x74fa('0x25')]);_0x12e9b5['attributes']=_[_0x74fa('0x2a')](_0x86df7d['model'],qs[_0x74fa('0x2b')](_0x4f383a['query']['fields']));_0x12e9b5[_0x74fa('0x2c')]=_0x12e9b5[_0x74fa('0x2c')][_0x74fa('0x2d')]?_0x12e9b5[_0x74fa('0x2c')]:_0x86df7d[_0x74fa('0x28')];if(_0x4f383a[_0x74fa('0x25')][_0x74fa('0x2e')]){_0x12e9b5[_0x74fa('0x24')]=[{'all':!![]}];}_0x12e9b5=_[_0x74fa('0x2f')]({},_0x12e9b5,_0x4f383a[_0x74fa('0x30')]);return db['ChatQueue'][_0x74fa('0x31')](_0x12e9b5)[_0x74fa('0x15')](handleEntityNotFound(_0x21fe88,null))[_0x74fa('0x15')](respondWithResult(_0x21fe88,null))[_0x74fa('0x32')](handleError(_0x21fe88,null));};exports[_0x74fa('0x33')]=function(_0x2327a1,_0x5cbec2){return db[_0x74fa('0x1e')][_0x74fa('0x33')](_0x2327a1[_0x74fa('0x34')],{})[_0x74fa('0x15')](function(_0x3619a4){var _0x14c624=_0x2327a1[_0x74fa('0x35')][_0x74fa('0x36')]({'plain':!![]});if(!_0x14c624)throw new Error(_0x74fa('0x37'));if(_0x14c624[_0x74fa('0x38')]===_0x74fa('0x35')){var _0xe15db4=_0x3619a4[_0x74fa('0x36')]({'plain':!![]});var _0x32e559=_0x74fa('0x16');return db[_0x74fa('0x39')]['find']({'where':{'name':_0x32e559,'userProfileId':_0x14c624['userProfileId']},'raw':!![]})['then'](function(_0x2e462c){if(_0x2e462c&&_0x2e462c[_0x74fa('0x3a')]===0x0){return db['UserProfileResource']['create']({'name':_0xe15db4[_0x74fa('0x1b')],'resourceId':_0xe15db4['id'],'type':_0x2e462c['name'],'sectionId':_0x2e462c['id']},{})[_0x74fa('0x15')](function(){return _0x3619a4;});}else{return _0x3619a4;}})[_0x74fa('0x32')](function(_0x2f9f66){logger['error']('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x2f9f66);throw _0x2f9f66;});}return _0x3619a4;})['then'](respondWithResult(_0x5cbec2,0xc9))[_0x74fa('0x32')](handleError(_0x5cbec2,null));};exports[_0x74fa('0x3b')]=function(_0x363859,_0x2deedb){if(_0x363859[_0x74fa('0x34')]['id']){delete _0x363859[_0x74fa('0x34')]['id'];}return db['ChatQueue'][_0x74fa('0x31')]({'where':{'id':_0x363859[_0x74fa('0x27')]['id']}})[_0x74fa('0x15')](handleEntityNotFound(_0x2deedb,null))[_0x74fa('0x15')](saveUpdates(_0x363859[_0x74fa('0x34')],null))[_0x74fa('0x15')](respondWithResult(_0x2deedb,null))[_0x74fa('0x32')](handleError(_0x2deedb,null));};exports['destroy']=function(_0x4cd4e0,_0x22b223){return db[_0x74fa('0x1e')]['find']({'where':{'id':_0x4cd4e0[_0x74fa('0x27')]['id']}})[_0x74fa('0x15')](handleEntityNotFound(_0x22b223,null))[_0x74fa('0x15')](removeEntity(_0x22b223,null))[_0x74fa('0x32')](handleError(_0x22b223,null));};exports[_0x74fa('0x3c')]=function(_0x426b7e,_0x30343b){return db[_0x74fa('0x1e')]['describe']()[_0x74fa('0x15')](respondWithResult(_0x30343b,null))[_0x74fa('0x32')](handleError(_0x30343b,null));};exports[_0x74fa('0x3d')]=function(_0x1df4a5,_0x1da8e2){var _0x4c13cf={'raw':!![],'where':{}},_0x40b451={},_0x36a9a7;return db[_0x74fa('0x1e')][_0x74fa('0x3e')]({'where':{'id':_0x1df4a5[_0x74fa('0x27')]['id']}})[_0x74fa('0x15')](handleEntityNotFound(_0x1da8e2,null))[_0x74fa('0x15')](function(_0x4bb1bc){if(_0x4bb1bc){_0x36a9a7=_0x4bb1bc[_0x74fa('0x36')]({'plain':!![]});_0x40b451[_0x74fa('0x28')]=_[_0x74fa('0x29')](db['UserChatQueue'][_0x74fa('0x1f')]);_0x40b451[_0x74fa('0x25')]=_['keys'](_0x1df4a5[_0x74fa('0x25')]);_0x40b451[_0x74fa('0x3f')]=_['intersection'](_0x40b451[_0x74fa('0x28')],_0x40b451['query']);_0x4c13cf[_0x74fa('0x2c')]=_[_0x74fa('0x2a')](_0x40b451[_0x74fa('0x28')],qs[_0x74fa('0x2b')](_0x1df4a5[_0x74fa('0x25')][_0x74fa('0x2b')]));_0x4c13cf[_0x74fa('0x2c')]=_0x4c13cf[_0x74fa('0x2c')]['length']?_0x4c13cf[_0x74fa('0x2c')]:_0x40b451[_0x74fa('0x28')];if(!_0x1df4a5[_0x74fa('0x25')]['hasOwnProperty'](_0x74fa('0x40'))){_0x4c13cf['limit']=qs[_0x74fa('0x13')](_0x1df4a5[_0x74fa('0x25')]['limit']);_0x4c13cf[_0x74fa('0x11')]=qs['offset'](_0x1df4a5['query'][_0x74fa('0x11')]);}_0x4c13cf[_0x74fa('0x41')]=qs[_0x74fa('0x42')](_0x1df4a5[_0x74fa('0x25')][_0x74fa('0x42')]);_0x4c13cf[_0x74fa('0x43')]=qs['filters'](_['pick'](_0x1df4a5[_0x74fa('0x25')],_0x40b451[_0x74fa('0x3f')]));_0x4c13cf[_0x74fa('0x43')][_0x74fa('0x44')]=_0x4bb1bc['id'];if(_0x1df4a5['query'][_0x74fa('0x45')]){_0x4c13cf['where']=_['merge'](_0x4c13cf[_0x74fa('0x43')],{'$or':_[_0x74fa('0x46')](_0x4c13cf[_0x74fa('0x2c')],function(_0x47ae57){var _0x53d57b={};_0x53d57b[_0x47ae57]={'$like':'%'+_0x1df4a5[_0x74fa('0x25')]['filter']+'%'};return _0x53d57b;})});}_0x4c13cf=_['merge']({},_0x4c13cf,_0x1df4a5[_0x74fa('0x30')]);return db[_0x74fa('0x47')]['findAll'](_0x4c13cf);}})[_0x74fa('0x15')](function(_0xe5d84c){if(_0xe5d84c){return db[_0x74fa('0x48')][_0x74fa('0x49')]({'where':{'id':_[_0x74fa('0x46')](_0xe5d84c,_0x74fa('0x4a')),'role':_0x74fa('0x4b')},'attributes':['id',_0x74fa('0x1b'),_0x74fa('0x4c'),_0x74fa('0x4d'),_0x74fa('0x4e')]});}})[_0x74fa('0x15')](function(_0x37da15){if(_0x37da15){return{'count':_0x37da15[_0x74fa('0x14')],'rows':_[_0x74fa('0x46')](_0x37da15['rows'],function(_0xe8ea79){return{'membername':_0xe8ea79[_0x74fa('0x1b')],'UserId':_0xe8ea79['id'],'queue_name':_0x36a9a7[_0x74fa('0x1b')],'ChatQueueId':_0x36a9a7['id'],'interface':util[_0x74fa('0x4f')]('%s/%s',_0x74fa('0x50'),_0xe8ea79[_0x74fa('0x1b')]),'penalty':0x0,'paused':_0xe8ea79[_0x74fa('0x4c')],'createdAt':_0xe8ea79[_0x74fa('0x4e')],'updatedAt':_0xe8ea79[_0x74fa('0x4d')]};})};}else{return{'count':0x0,'rows':[]};}})[_0x74fa('0x15')](respondWithFilteredResult(_0x1da8e2,_0x4c13cf))['catch'](handleError(_0x1da8e2,null));};exports[_0x74fa('0x51')]=function(_0x410471,_0x2d6430){var _0xbb9d40={};var _0x1bf250={};var _0x467427;var _0x2c96cb;return db['ChatQueue'][_0x74fa('0x3e')]({'where':{'id':_0x410471[_0x74fa('0x27')]['id']}})[_0x74fa('0x15')](handleEntityNotFound(_0x2d6430,null))[_0x74fa('0x15')](function(_0x42b06b){if(_0x42b06b){_0x467427=_0x42b06b;_0x1bf250[_0x74fa('0x28')]=_[_0x74fa('0x29')](db[_0x74fa('0x52')][_0x74fa('0x1f')]);_0x1bf250[_0x74fa('0x25')]=_[_0x74fa('0x29')](_0x410471[_0x74fa('0x25')]);_0x1bf250['filters']=_[_0x74fa('0x2a')](_0x1bf250['model'],_0x1bf250[_0x74fa('0x25')]);_0xbb9d40[_0x74fa('0x2c')]=_[_0x74fa('0x2a')](_0x1bf250[_0x74fa('0x28')],qs['fields'](_0x410471[_0x74fa('0x25')][_0x74fa('0x2b')]));_0xbb9d40[_0x74fa('0x2c')]=_0xbb9d40[_0x74fa('0x2c')][_0x74fa('0x2d')]?_0xbb9d40['attributes']:_0x1bf250[_0x74fa('0x28')];_0xbb9d40['order']=qs[_0x74fa('0x42')](_0x410471[_0x74fa('0x25')][_0x74fa('0x42')]);_0xbb9d40[_0x74fa('0x43')]=qs[_0x74fa('0x3f')](_[_0x74fa('0x53')](_0x410471[_0x74fa('0x25')],_0x1bf250[_0x74fa('0x3f')]));if(_0x410471['query'][_0x74fa('0x45')]){_0xbb9d40['where']=_[_0x74fa('0x2f')](_0xbb9d40[_0x74fa('0x43')],{'$or':_[_0x74fa('0x46')](_0xbb9d40[_0x74fa('0x2c')],function(_0x506bd8){var _0x4e50bf={};_0x4e50bf[_0x506bd8]={'$like':'%'+_0x410471['query'][_0x74fa('0x45')]+'%'};return _0x4e50bf;})});}_0xbb9d40=_[_0x74fa('0x2f')]({},_0xbb9d40,_0x410471[_0x74fa('0x30')]);return _0x467427['getTeams'](_0xbb9d40);}})[_0x74fa('0x15')](function(_0xfae48b){if(_0xfae48b){_0x2c96cb=_0xfae48b['length'];if(!_0x410471[_0x74fa('0x25')]['hasOwnProperty'](_0x74fa('0x40'))){_0xbb9d40['limit']=qs['limit'](_0x410471['query'][_0x74fa('0x13')]);_0xbb9d40[_0x74fa('0x11')]=qs[_0x74fa('0x11')](_0x410471[_0x74fa('0x25')][_0x74fa('0x11')]);}return _0x467427['getTeams'](_0xbb9d40);}})[_0x74fa('0x15')](function(_0x26f691){if(_0x26f691){return _0x26f691?{'count':_0x2c96cb,'rows':_0x26f691}:null;}})[_0x74fa('0x15')](respondWithResult(_0x2d6430,null))[_0x74fa('0x32')](handleError(_0x2d6430,null));};exports['addTeams']=function(_0x803bda,_0x4afb0a){var _0xad2423=_0x803bda[_0x74fa('0x34')][_0x74fa('0x54')];return db[_0x74fa('0x52')][_0x74fa('0x55')]({'where':{'id':_0xad2423},'attributes':['id'],'include':[{'model':db[_0x74fa('0x48')],'as':'Agents','attributes':['id',_0x74fa('0x1b'),_0x74fa('0x56'),'voicePause','interface'],'raw':!![]}]})[_0x74fa('0x15')](function(_0x5c874e){if(_0x5c874e){var _0x16c3ee=_['flatMap'](_0x5c874e,function(_0x1d3a78){var _0x3fa448=_0x1d3a78[_0x74fa('0x36')]({'plain':!![]});return _0x3fa448[_0x74fa('0x57')];});return db[_0x74fa('0x1e')][_0x74fa('0x31')]({'where':{'id':_0x803bda[_0x74fa('0x27')]['id']}})[_0x74fa('0x15')](function(_0x3a1c7c){return db[_0x74fa('0x58')][_0x74fa('0x59')](function(_0x5bb368){return _0x3a1c7c[_0x74fa('0x5a')](_0xad2423,{'transaction':_0x5bb368})[_0x74fa('0x15')](function(){return BPromise[_0x74fa('0x5b')](_0x16c3ee,function(_0x22b1d7){return db['UserChatQueue'][_0x74fa('0x5c')]({'where':{'UserId':_0x22b1d7['id'],'ChatQueueId':_0x803bda['params']['id']},'transaction':_0x5bb368});});})[_0x74fa('0x15')](function(){_0x16c3ee[_0x74fa('0x5d')](function(_0xca1066){socket[_0x74fa('0x5e')](_0x74fa('0x5f'),{'UserId':_0xca1066['id'],'ChatQueueId':_0x3a1c7c['id']});});});});});}})[_0x74fa('0x15')](respondWithStatusCode(_0x4afb0a,null))[_0x74fa('0x32')](handleError(_0x4afb0a,null));};exports[_0x74fa('0x60')]=function(_0x54af26,_0x2ac93c){return db['Team'][_0x74fa('0x55')]({'where':{'id':_0x54af26[_0x74fa('0x25')][_0x74fa('0x54')]},'attributes':['id'],'include':[{'model':db[_0x74fa('0x48')],'as':'Agents','attributes':['id'],'raw':!![]}]})[_0x74fa('0x15')](handleEntityNotFound(_0x2ac93c,null))[_0x74fa('0x15')](function(_0xced71b){var _0x2c567c=_[_0x74fa('0x46')](_0xced71b,'id');var _0x4f748e=[];var _0x483db3=[];var _0x36912b=squel['select']();_0x36912b[_0x74fa('0x61')]('tq.TeamId')['from']('team_has_chat_queues','tq')[_0x74fa('0x62')]('user_has_teams','ut',_0x74fa('0x63'))[_0x74fa('0x43')](_0x74fa('0x64'),_0x54af26[_0x74fa('0x27')]['id']);for(var _0x10d455=0x0;_0x10d455<_0xced71b[_0x74fa('0x2d')];_0x10d455+=0x1){let _0x40d336=_0xced71b[_0x10d455];for(var _0xd93909=0x0;_0xd93909<_0x40d336[_0x74fa('0x57')][_0x74fa('0x2d')];_0xd93909+=0x1){let _0x1d8359=_0x40d336[_0x74fa('0x57')][_0xd93909];var _0x2897df=_0x36912b[_0x74fa('0x65')]();_0x2897df[_0x74fa('0x43')](_0x74fa('0x66'),_0x1d8359['id']);_0x483db3['push'](db[_0x74fa('0x58')]['query'](_0x2897df[_0x74fa('0x67')](),{'type':db[_0x74fa('0x58')]['QueryTypes'][_0x74fa('0x68')]})['then'](function(_0x3639ed){if(_0x3639ed[_0x74fa('0x2d')]===0x1){return _0x1d8359['id'];}else{var _0x3dd57a=_[_0x74fa('0x69')](_[_0x74fa('0x46')](_0x3639ed,_0x74fa('0x6a')),function(_0x31a9e5){return _[_0x74fa('0x6b')](_0x2c567c,_0x31a9e5);});if(_0x3dd57a){return _0x1d8359['id'];}}}));}}return BPromise[_0x74fa('0x6c')](_0x483db3)[_0x74fa('0x15')](function(_0x29e141){_0x4f748e=_(_0x4f748e)[_0x74fa('0x6d')](_0x29e141)[_0x74fa('0x6e')]()[_0x74fa('0x6f')]();return db[_0x74fa('0x1e')][_0x74fa('0x31')]({'where':{'id':_0x54af26[_0x74fa('0x27')]['id']}})[_0x74fa('0x15')](function(_0x264ea0){return db[_0x74fa('0x58')]['transaction'](function(_0x33a2a1){return _0x264ea0['removeTeams'](_0x54af26[_0x74fa('0x25')]['ids'],{'transaction':_0x33a2a1})['then'](function(){if(!_[_0x74fa('0x70')](_0x4f748e)){return _0x264ea0[_0x74fa('0x71')](_0x4f748e,{'transaction':_0x33a2a1});}})[_0x74fa('0x15')](function(){_0x4f748e[_0x74fa('0x5d')](function(_0x3b0f33){socket[_0x74fa('0x5e')](_0x74fa('0x72'),{'UserId':_0x3b0f33,'ChatQueueId':_0x264ea0['id']});});});});});});})[_0x74fa('0x15')](respondWithStatusCode(_0x2ac93c,null))[_0x74fa('0x32')](handleError(_0x2ac93c,null));};exports[_0x74fa('0x73')]=function(_0x5a536a,_0x5dff50){return db[_0x74fa('0x1e')][_0x74fa('0x31')]({'where':{'id':_0x5a536a[_0x74fa('0x27')]['id']}})[_0x74fa('0x15')](handleEntityNotFound(_0x5dff50,null))[_0x74fa('0x15')](function(_0x37a7c2){if(_0x37a7c2){return _0x37a7c2[_0x74fa('0x73')](_0x5a536a[_0x74fa('0x34')][_0x74fa('0x54')],_[_0x74fa('0x74')](_0x5a536a[_0x74fa('0x34')],[_0x74fa('0x54'),'id'])||{})['spread'](function(_0x106b5d){for(var _0x1a962f=0x0;_0x1a962f<_0x5a536a['body'][_0x74fa('0x54')]['length'];_0x1a962f+=0x1){socket['emit'](_0x74fa('0x5f'),{'UserId':Number(_0x5a536a[_0x74fa('0x34')][_0x74fa('0x54')][_0x1a962f]),'ChatQueueId':Number(_0x5a536a[_0x74fa('0x27')]['id'])});}return _0x106b5d;});}})[_0x74fa('0x15')](respondWithResult(_0x5dff50,null))[_0x74fa('0x32')](handleError(_0x5dff50,null));};exports[_0x74fa('0x71')]=function(_0x196211,_0x2540c6){return db['ChatQueue']['find']({'where':{'id':_0x196211[_0x74fa('0x27')]['id']}})[_0x74fa('0x15')](handleEntityNotFound(_0x2540c6,null))[_0x74fa('0x15')](function(_0x2c009c){if(_0x2c009c){return _0x2c009c[_0x74fa('0x71')](_0x196211[_0x74fa('0x25')][_0x74fa('0x54')])['then'](function(){if(_[_0x74fa('0x75')](_0x196211[_0x74fa('0x25')]['ids'])){for(var _0x54799e=0x0;_0x54799e<_0x196211[_0x74fa('0x25')][_0x74fa('0x54')][_0x74fa('0x2d')];_0x54799e+=0x1){socket[_0x74fa('0x5e')](_0x74fa('0x72'),{'UserId':Number(_0x196211[_0x74fa('0x25')][_0x74fa('0x54')][_0x54799e]),'ChatQueueId':Number(_0x196211[_0x74fa('0x27')]['id'])});}}else{socket[_0x74fa('0x5e')](_0x74fa('0x72'),{'UserId':Number(_0x196211[_0x74fa('0x25')][_0x74fa('0x54')]),'ChatQueueId':Number(_0x196211['params']['id'])});}});}})[_0x74fa('0x15')](respondWithStatusCode(_0x2540c6,null))['catch'](handleError(_0x2540c6,null));};exports[_0x74fa('0x76')]=function(_0x5baf46,_0xcab07b){var _0x53d668={};var _0x199da4={};var _0x4268ff;var _0x112e03;return db[_0x74fa('0x1e')][_0x74fa('0x3e')]({'where':{'id':_0x5baf46[_0x74fa('0x27')]['id']}})['then'](handleEntityNotFound(_0xcab07b,null))[_0x74fa('0x15')](function(_0x74e7bb){if(_0x74e7bb){_0x4268ff=_0x74e7bb;_0x199da4[_0x74fa('0x28')]=_[_0x74fa('0x29')](db[_0x74fa('0x48')][_0x74fa('0x1f')]);_0x199da4[_0x74fa('0x25')]=_[_0x74fa('0x29')](_0x5baf46[_0x74fa('0x25')]);_0x199da4[_0x74fa('0x3f')]=_[_0x74fa('0x2a')](_0x199da4[_0x74fa('0x28')],_0x199da4[_0x74fa('0x25')]);_0x53d668['attributes']=_['intersection'](_0x199da4['model'],qs['fields'](_0x5baf46[_0x74fa('0x25')]['fields']));_0x53d668[_0x74fa('0x2c')]=_0x53d668[_0x74fa('0x2c')][_0x74fa('0x2d')]?_0x53d668[_0x74fa('0x2c')]:_0x199da4[_0x74fa('0x28')];_0x53d668[_0x74fa('0x41')]=qs[_0x74fa('0x42')](_0x5baf46[_0x74fa('0x25')][_0x74fa('0x42')]);_0x53d668[_0x74fa('0x43')]=qs[_0x74fa('0x3f')](_[_0x74fa('0x53')](_0x5baf46[_0x74fa('0x25')],_0x199da4['filters']));if(_0x5baf46[_0x74fa('0x25')][_0x74fa('0x45')]){_0x53d668[_0x74fa('0x43')]=_['merge'](_0x53d668[_0x74fa('0x43')],{'$or':_[_0x74fa('0x46')](_0x53d668[_0x74fa('0x2c')],function(_0x325ac4){var _0x4b2536={};_0x4b2536[_0x325ac4]={'$like':'%'+_0x5baf46['query'][_0x74fa('0x45')]+'%'};return _0x4b2536;})});}_0x53d668=_['merge']({},_0x53d668,_0x5baf46[_0x74fa('0x30')]);return _0x4268ff[_0x74fa('0x76')](_0x53d668);}})[_0x74fa('0x15')](function(_0x1da341){if(_0x1da341){_0x112e03=_0x1da341[_0x74fa('0x2d')];if(!_0x5baf46[_0x74fa('0x25')]['hasOwnProperty'](_0x74fa('0x40'))){_0x53d668[_0x74fa('0x13')]=qs[_0x74fa('0x13')](_0x5baf46[_0x74fa('0x25')][_0x74fa('0x13')]);_0x53d668[_0x74fa('0x11')]=qs[_0x74fa('0x11')](_0x5baf46[_0x74fa('0x25')][_0x74fa('0x11')]);}return _0x4268ff[_0x74fa('0x76')](_0x53d668);}})['then'](function(_0x27149e){if(_0x27149e){return _0x27149e?{'count':_0x112e03,'rows':_0x27149e}:null;}})['then'](respondWithResult(_0xcab07b,null))[_0x74fa('0x32')](handleError(_0xcab07b,null));};
\ No newline at end of file
+var _0x2e8e=['query','rows','catch','show','params','model','keys','filters','intersection','attributes','fields','length','includeAll','merge','options','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','describe','getMembers','findOne','UserChatQueue','hasOwnProperty','sort','pick','ChatQueueId','filter','map','findAll','User','findAndCountAll','UserId','agent','updatedAt','createdAt','format','%s/%s','SIP','chatPause','Team','order','getTeams','nolimit','addTeams','ids','Agents','online','voicePause','interface','flatMap','transaction','removeTeams','select','field','tq.TeamId','from','team_has_chat_queues','join','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','ChatQueueId\x20=\x20?','clone','ut.UserId\x20=\x20?','sequelize','QueryTypes','SELECT','every','includes','all','compact','isEmpty','removeAgents','forEach','emit','userChatQueue:remove','addAgents','omit','getAgents','bluebird','util','lodash','squel','ioredis','../../config/logger','api','../../config/environment','../../mysqldb','defaults','localhost','socket.io-emitter','redis','./chatQueue.socket','sendStatus','status','end','json','offset','undefined','limit','count','set','update','destroy','then','get','UserProfileResource','stack','name','ChatQueue','rawAttributes','type','key','getOptions','where','include'];(function(_0x474d97,_0x5909ce){var _0x1edf25=function(_0x2831df){while(--_0x2831df){_0x474d97['push'](_0x474d97['shift']());}};_0x1edf25(++_0x5909ce);}(_0x2e8e,0x1bf));var _0xe2e8=function(_0x2f2360,_0x151089){_0x2f2360=_0x2f2360-0x0;var _0x1cc8d3=_0x2e8e[_0x2f2360];return _0x1cc8d3;};'use strict';var BPromise=require(_0xe2e8('0x0'));var util=require(_0xe2e8('0x1'));var _=require(_0xe2e8('0x2'));var squel=require(_0xe2e8('0x3'));var Redis=require(_0xe2e8('0x4'));var qs=require('../../components/parsers/qs');var logger=require(_0xe2e8('0x5'))(_0xe2e8('0x6'));var config=require(_0xe2e8('0x7'));var db=require(_0xe2e8('0x8'))['db'];config['redis']=_[_0xe2e8('0x9')](config['redis'],{'host':_0xe2e8('0xa'),'port':0x18eb});var socket=require(_0xe2e8('0xb'))(new Redis(config[_0xe2e8('0xc')]));require(_0xe2e8('0xd'))['register'](socket);function respondWithStatusCode(_0x2de20a,_0x143e84){_0x143e84=_0x143e84||0xcc;return function(_0x34aa0b){if(_0x34aa0b){return _0x2de20a[_0xe2e8('0xe')](_0x143e84);}return _0x2de20a[_0xe2e8('0xf')](_0x143e84)[_0xe2e8('0x10')]();};}function respondWithResult(_0xc6da14,_0x4eea8c){_0x4eea8c=_0x4eea8c||0xc8;return function(_0x225c19){if(_0x225c19){return _0xc6da14['status'](_0x4eea8c)[_0xe2e8('0x11')](_0x225c19);}};}function respondWithFilteredResult(_0x16120d,_0x251bdf){return function(_0x2158d5){if(_0x2158d5){var _0x150491=typeof _0x251bdf[_0xe2e8('0x12')]===_0xe2e8('0x13')&&typeof _0x251bdf[_0xe2e8('0x14')]===_0xe2e8('0x13');var _0x4e5f19=_0x2158d5[_0xe2e8('0x15')];var _0x3f9ec7=_0x150491?0x0:_0x251bdf[_0xe2e8('0x12')];var _0x3df402=_0x150491?_0x2158d5[_0xe2e8('0x15')]:_0x251bdf['offset']+_0x251bdf[_0xe2e8('0x14')];var _0x2b6405;if(_0x3df402>=_0x4e5f19){_0x3df402=_0x4e5f19;_0x2b6405=0xc8;}else{_0x2b6405=0xce;}_0x16120d['status'](_0x2b6405);return _0x16120d[_0xe2e8('0x16')]('Content-Range',_0x3f9ec7+'-'+_0x3df402+'/'+_0x4e5f19)[_0xe2e8('0x11')](_0x2158d5);}return null;};}function saveUpdates(_0x355669){return function(_0x11a09f){if(_0x11a09f){return _0x11a09f[_0xe2e8('0x17')](_0x355669)['then'](function(_0x437a84){return _0x437a84;});}return null;};}function removeEntity(_0x31f618){return function(_0x1410b0){if(_0x1410b0){return _0x1410b0[_0xe2e8('0x18')]()[_0xe2e8('0x19')](function(){var _0x364be2=_0x1410b0[_0xe2e8('0x1a')]({'plain':!![]});var _0x2ef8f9='ChatQueues';return db[_0xe2e8('0x1b')][_0xe2e8('0x18')]({'where':{'type':_0x2ef8f9,'resourceId':_0x364be2['id']}})[_0xe2e8('0x19')](function(){return _0x1410b0;});})[_0xe2e8('0x19')](function(){_0x31f618[_0xe2e8('0xf')](0xcc)['end']();});}};}function handleEntityNotFound(_0x2cdd13){return function(_0x186725){if(!_0x186725){_0x2cdd13[_0xe2e8('0xe')](0x194);}return _0x186725;};}function handleError(_0x5445fa,_0x5b9962){_0x5b9962=_0x5b9962||0x1f4;return function(_0x4d9c7a){logger['error'](_0x4d9c7a[_0xe2e8('0x1c')]);if(_0x4d9c7a[_0xe2e8('0x1d')]){delete _0x4d9c7a[_0xe2e8('0x1d')];}_0x5445fa['status'](_0x5b9962)['send'](_0x4d9c7a);};}exports['index']=function(_0xdd25d0,_0x261129){var _0x261b0a={};var _0x1a5667={'count':0x0,'rows':[]};var _0x1eafc2=_['map'](db[_0xe2e8('0x1e')][_0xe2e8('0x1f')],function(_0x2dbe12){return{'name':_0x2dbe12['fieldName'],'type':_0x2dbe12[_0xe2e8('0x20')][_0xe2e8('0x21')]};});_0x261b0a=qs[_0xe2e8('0x22')](_0x1eafc2,_0xdd25d0);var _0x15d13a={'where':_0x261b0a[_0xe2e8('0x23')]};return db[_0xe2e8('0x1e')][_0xe2e8('0x15')](_0x15d13a)[_0xe2e8('0x19')](function(_0x5997ab){_0x1a5667[_0xe2e8('0x15')]=_0x5997ab;_0x261b0a[_0xe2e8('0x24')]=qs[_0xe2e8('0x24')](_0xdd25d0[_0xe2e8('0x25')]);return db['ChatQueue']['findAll'](_0x261b0a);})['then'](function(_0x315b8a){_0x1a5667[_0xe2e8('0x26')]=_0x315b8a;return _0x1a5667;})[_0xe2e8('0x19')](respondWithFilteredResult(_0x261129,_0x261b0a))[_0xe2e8('0x27')](handleError(_0x261129,null));};exports[_0xe2e8('0x28')]=function(_0x301856,_0x37556b){var _0x4b14a3={'raw':!![],'where':{'id':_0x301856[_0xe2e8('0x29')]['id']}},_0x573bff={};_0x573bff[_0xe2e8('0x2a')]=_[_0xe2e8('0x2b')](db[_0xe2e8('0x1e')][_0xe2e8('0x1f')]);_0x573bff[_0xe2e8('0x25')]=_[_0xe2e8('0x2b')](_0x301856[_0xe2e8('0x25')]);_0x573bff[_0xe2e8('0x2c')]=_[_0xe2e8('0x2d')](_0x573bff['model'],_0x573bff['query']);_0x4b14a3[_0xe2e8('0x2e')]=_[_0xe2e8('0x2d')](_0x573bff['model'],qs[_0xe2e8('0x2f')](_0x301856[_0xe2e8('0x25')][_0xe2e8('0x2f')]));_0x4b14a3[_0xe2e8('0x2e')]=_0x4b14a3[_0xe2e8('0x2e')][_0xe2e8('0x30')]?_0x4b14a3[_0xe2e8('0x2e')]:_0x573bff[_0xe2e8('0x2a')];if(_0x301856[_0xe2e8('0x25')][_0xe2e8('0x31')]){_0x4b14a3['include']=[{'all':!![]}];}_0x4b14a3=_[_0xe2e8('0x32')]({},_0x4b14a3,_0x301856[_0xe2e8('0x33')]);return db[_0xe2e8('0x1e')][_0xe2e8('0x34')](_0x4b14a3)['then'](handleEntityNotFound(_0x37556b,null))[_0xe2e8('0x19')](respondWithResult(_0x37556b,null))[_0xe2e8('0x27')](handleError(_0x37556b,null));};exports[_0xe2e8('0x35')]=function(_0xee4ff9,_0x2d1ebd){return db[_0xe2e8('0x1e')]['create'](_0xee4ff9[_0xe2e8('0x36')],{})[_0xe2e8('0x19')](function(_0x40c884){var _0x4dc5d5=_0xee4ff9[_0xe2e8('0x37')][_0xe2e8('0x1a')]({'plain':!![]});if(!_0x4dc5d5)throw new Error(_0xe2e8('0x38'));if(_0x4dc5d5[_0xe2e8('0x39')]===_0xe2e8('0x37')){var _0x3d025d=_0x40c884[_0xe2e8('0x1a')]({'plain':!![]});var _0x5e990d='ChatQueues';return db[_0xe2e8('0x3a')][_0xe2e8('0x34')]({'where':{'name':_0x5e990d,'userProfileId':_0x4dc5d5['userProfileId']},'raw':!![]})[_0xe2e8('0x19')](function(_0x2d2ec1){if(_0x2d2ec1&&_0x2d2ec1[_0xe2e8('0x3b')]===0x0){return db[_0xe2e8('0x1b')]['create']({'name':_0x3d025d[_0xe2e8('0x1d')],'resourceId':_0x3d025d['id'],'type':_0x2d2ec1[_0xe2e8('0x1d')],'sectionId':_0x2d2ec1['id']},{})[_0xe2e8('0x19')](function(){return _0x40c884;});}else{return _0x40c884;}})[_0xe2e8('0x27')](function(_0x4cd596){logger['error'](_0xe2e8('0x3c'),_0x4cd596);throw _0x4cd596;});}return _0x40c884;})[_0xe2e8('0x19')](respondWithResult(_0x2d1ebd,0xc9))[_0xe2e8('0x27')](handleError(_0x2d1ebd,null));};exports[_0xe2e8('0x17')]=function(_0xac294e,_0x70190a){if(_0xac294e['body']['id']){delete _0xac294e['body']['id'];}return db[_0xe2e8('0x1e')][_0xe2e8('0x34')]({'where':{'id':_0xac294e[_0xe2e8('0x29')]['id']}})[_0xe2e8('0x19')](handleEntityNotFound(_0x70190a,null))['then'](saveUpdates(_0xac294e[_0xe2e8('0x36')],null))[_0xe2e8('0x19')](respondWithResult(_0x70190a,null))[_0xe2e8('0x27')](handleError(_0x70190a,null));};exports[_0xe2e8('0x18')]=function(_0xa52341,_0x371f74){return db[_0xe2e8('0x1e')]['find']({'where':{'id':_0xa52341['params']['id']}})['then'](handleEntityNotFound(_0x371f74,null))[_0xe2e8('0x19')](removeEntity(_0x371f74,null))[_0xe2e8('0x27')](handleError(_0x371f74,null));};exports[_0xe2e8('0x3d')]=function(_0x3fe9f3,_0x54aeda){return db['ChatQueue'][_0xe2e8('0x3d')]()[_0xe2e8('0x19')](respondWithResult(_0x54aeda,null))['catch'](handleError(_0x54aeda,null));};exports[_0xe2e8('0x3e')]=function(_0x5bf1d7,_0x239fb6){var _0x2e617b={'raw':!![],'where':{}},_0x29672f={},_0x3ba7ed;return db[_0xe2e8('0x1e')][_0xe2e8('0x3f')]({'where':{'id':_0x5bf1d7[_0xe2e8('0x29')]['id']}})[_0xe2e8('0x19')](handleEntityNotFound(_0x239fb6,null))['then'](function(_0x817a30){if(_0x817a30){_0x3ba7ed=_0x817a30[_0xe2e8('0x1a')]({'plain':!![]});_0x29672f[_0xe2e8('0x2a')]=_[_0xe2e8('0x2b')](db[_0xe2e8('0x40')][_0xe2e8('0x1f')]);_0x29672f[_0xe2e8('0x25')]=_['keys'](_0x5bf1d7[_0xe2e8('0x25')]);_0x29672f[_0xe2e8('0x2c')]=_[_0xe2e8('0x2d')](_0x29672f[_0xe2e8('0x2a')],_0x29672f['query']);_0x2e617b['attributes']=_[_0xe2e8('0x2d')](_0x29672f['model'],qs['fields'](_0x5bf1d7[_0xe2e8('0x25')][_0xe2e8('0x2f')]));_0x2e617b['attributes']=_0x2e617b[_0xe2e8('0x2e')][_0xe2e8('0x30')]?_0x2e617b[_0xe2e8('0x2e')]:_0x29672f[_0xe2e8('0x2a')];if(!_0x5bf1d7[_0xe2e8('0x25')][_0xe2e8('0x41')]('nolimit')){_0x2e617b[_0xe2e8('0x14')]=qs[_0xe2e8('0x14')](_0x5bf1d7[_0xe2e8('0x25')]['limit']);_0x2e617b[_0xe2e8('0x12')]=qs[_0xe2e8('0x12')](_0x5bf1d7[_0xe2e8('0x25')][_0xe2e8('0x12')]);}_0x2e617b['order']=qs[_0xe2e8('0x42')](_0x5bf1d7['query'][_0xe2e8('0x42')]);_0x2e617b[_0xe2e8('0x23')]=qs[_0xe2e8('0x2c')](_[_0xe2e8('0x43')](_0x5bf1d7[_0xe2e8('0x25')],_0x29672f['filters']));_0x2e617b['where'][_0xe2e8('0x44')]=_0x817a30['id'];if(_0x5bf1d7[_0xe2e8('0x25')][_0xe2e8('0x45')]){_0x2e617b[_0xe2e8('0x23')]=_[_0xe2e8('0x32')](_0x2e617b[_0xe2e8('0x23')],{'$or':_[_0xe2e8('0x46')](_0x2e617b[_0xe2e8('0x2e')],function(_0x404d8f){var _0x588063={};_0x588063[_0x404d8f]={'$like':'%'+_0x5bf1d7['query'][_0xe2e8('0x45')]+'%'};return _0x588063;})});}_0x2e617b=_[_0xe2e8('0x32')]({},_0x2e617b,_0x5bf1d7[_0xe2e8('0x33')]);return db[_0xe2e8('0x40')][_0xe2e8('0x47')](_0x2e617b);}})[_0xe2e8('0x19')](function(_0x5bc4f3){if(_0x5bc4f3){return db[_0xe2e8('0x48')][_0xe2e8('0x49')]({'where':{'id':_['map'](_0x5bc4f3,_0xe2e8('0x4a')),'role':_0xe2e8('0x4b')},'attributes':['id','name','chatPause',_0xe2e8('0x4c'),_0xe2e8('0x4d')]});}})[_0xe2e8('0x19')](function(_0x52b315){if(_0x52b315){return{'count':_0x52b315['count'],'rows':_[_0xe2e8('0x46')](_0x52b315[_0xe2e8('0x26')],function(_0x1446ae){return{'membername':_0x1446ae[_0xe2e8('0x1d')],'UserId':_0x1446ae['id'],'queue_name':_0x3ba7ed[_0xe2e8('0x1d')],'ChatQueueId':_0x3ba7ed['id'],'interface':util[_0xe2e8('0x4e')](_0xe2e8('0x4f'),_0xe2e8('0x50'),_0x1446ae[_0xe2e8('0x1d')]),'penalty':0x0,'paused':_0x1446ae[_0xe2e8('0x51')],'createdAt':_0x1446ae[_0xe2e8('0x4d')],'updatedAt':_0x1446ae[_0xe2e8('0x4c')]};})};}else{return{'count':0x0,'rows':[]};}})[_0xe2e8('0x19')](respondWithFilteredResult(_0x239fb6,_0x2e617b))['catch'](handleError(_0x239fb6,null));};exports['getTeams']=function(_0x10ef6c,_0x1a8aa3){var _0x9eb785={};var _0x25ff64={};var _0x45ccec;var _0x1c0697;return db[_0xe2e8('0x1e')][_0xe2e8('0x3f')]({'where':{'id':_0x10ef6c[_0xe2e8('0x29')]['id']}})[_0xe2e8('0x19')](handleEntityNotFound(_0x1a8aa3,null))[_0xe2e8('0x19')](function(_0x16a7ab){if(_0x16a7ab){_0x45ccec=_0x16a7ab;_0x25ff64[_0xe2e8('0x2a')]=_[_0xe2e8('0x2b')](db[_0xe2e8('0x52')][_0xe2e8('0x1f')]);_0x25ff64['query']=_[_0xe2e8('0x2b')](_0x10ef6c[_0xe2e8('0x25')]);_0x25ff64[_0xe2e8('0x2c')]=_[_0xe2e8('0x2d')](_0x25ff64['model'],_0x25ff64['query']);_0x9eb785[_0xe2e8('0x2e')]=_['intersection'](_0x25ff64[_0xe2e8('0x2a')],qs[_0xe2e8('0x2f')](_0x10ef6c[_0xe2e8('0x25')]['fields']));_0x9eb785[_0xe2e8('0x2e')]=_0x9eb785[_0xe2e8('0x2e')]['length']?_0x9eb785[_0xe2e8('0x2e')]:_0x25ff64[_0xe2e8('0x2a')];_0x9eb785[_0xe2e8('0x53')]=qs[_0xe2e8('0x42')](_0x10ef6c[_0xe2e8('0x25')][_0xe2e8('0x42')]);_0x9eb785['where']=qs[_0xe2e8('0x2c')](_[_0xe2e8('0x43')](_0x10ef6c[_0xe2e8('0x25')],_0x25ff64[_0xe2e8('0x2c')]));if(_0x10ef6c[_0xe2e8('0x25')][_0xe2e8('0x45')]){_0x9eb785['where']=_['merge'](_0x9eb785[_0xe2e8('0x23')],{'$or':_[_0xe2e8('0x46')](_0x9eb785['attributes'],function(_0x422763){var _0x5024f7={};_0x5024f7[_0x422763]={'$like':'%'+_0x10ef6c[_0xe2e8('0x25')][_0xe2e8('0x45')]+'%'};return _0x5024f7;})});}_0x9eb785=_['merge']({},_0x9eb785,_0x10ef6c[_0xe2e8('0x33')]);return _0x45ccec[_0xe2e8('0x54')](_0x9eb785);}})['then'](function(_0x536c01){if(_0x536c01){_0x1c0697=_0x536c01['length'];if(!_0x10ef6c[_0xe2e8('0x25')]['hasOwnProperty'](_0xe2e8('0x55'))){_0x9eb785['limit']=qs[_0xe2e8('0x14')](_0x10ef6c[_0xe2e8('0x25')][_0xe2e8('0x14')]);_0x9eb785[_0xe2e8('0x12')]=qs[_0xe2e8('0x12')](_0x10ef6c['query']['offset']);}return _0x45ccec['getTeams'](_0x9eb785);}})[_0xe2e8('0x19')](function(_0x1244d0){if(_0x1244d0){return _0x1244d0?{'count':_0x1c0697,'rows':_0x1244d0}:null;}})[_0xe2e8('0x19')](respondWithResult(_0x1a8aa3,null))[_0xe2e8('0x27')](handleError(_0x1a8aa3,null));};exports[_0xe2e8('0x56')]=function(_0x212368,_0x286447){var _0x18ced5=_0x212368[_0xe2e8('0x36')][_0xe2e8('0x57')];return db[_0xe2e8('0x52')][_0xe2e8('0x47')]({'where':{'id':_0x18ced5},'attributes':['id'],'include':[{'model':db['User'],'as':_0xe2e8('0x58'),'attributes':['id','name',_0xe2e8('0x59'),_0xe2e8('0x5a'),_0xe2e8('0x5b')],'raw':!![]}]})[_0xe2e8('0x19')](function(_0x4638e4){if(_0x4638e4){var _0x505773=_[_0xe2e8('0x5c')](_0x4638e4,function(_0x290902){var _0x1d963a=_0x290902[_0xe2e8('0x1a')]({'plain':!![]});return _0x1d963a['Agents'];});return db[_0xe2e8('0x1e')][_0xe2e8('0x34')]({'where':{'id':_0x212368['params']['id']}})['then'](function(_0x55344e){return db['sequelize'][_0xe2e8('0x5d')](function(_0x1a51b7){return _0x55344e[_0xe2e8('0x56')](_0x18ced5,{'transaction':_0x1a51b7})[_0xe2e8('0x19')](function(){return BPromise['each'](_0x505773,function(_0x5de459){return db[_0xe2e8('0x40')]['findOrCreate']({'where':{'UserId':_0x5de459['id'],'ChatQueueId':_0x212368[_0xe2e8('0x29')]['id']},'transaction':_0x1a51b7});});})['then'](function(){_0x505773['forEach'](function(_0x42bbbb){socket['emit']('userChatQueue:save',{'UserId':_0x42bbbb['id'],'ChatQueueId':_0x55344e['id']});});});});});}})['then'](respondWithStatusCode(_0x286447,null))[_0xe2e8('0x27')](handleError(_0x286447,null));};exports[_0xe2e8('0x5e')]=function(_0x451c52,_0x1df9d6){return db['Team'][_0xe2e8('0x47')]({'where':{'id':_0x451c52['query']['ids']},'attributes':['id'],'include':[{'model':db['User'],'as':'Agents','attributes':['id'],'raw':!![]}]})[_0xe2e8('0x19')](handleEntityNotFound(_0x1df9d6,null))[_0xe2e8('0x19')](function(_0x1ef956){var _0x3719dd=_['map'](_0x1ef956,'id');var _0x5cffdd=[];var _0xedcb69=[];var _0x5aa19e=squel[_0xe2e8('0x5f')]();_0x5aa19e[_0xe2e8('0x60')](_0xe2e8('0x61'))[_0xe2e8('0x62')](_0xe2e8('0x63'),'tq')[_0xe2e8('0x64')](_0xe2e8('0x65'),'ut',_0xe2e8('0x66'))[_0xe2e8('0x23')](_0xe2e8('0x67'),_0x451c52[_0xe2e8('0x29')]['id']);for(var _0x1a1363=0x0;_0x1a1363<_0x1ef956[_0xe2e8('0x30')];_0x1a1363+=0x1){let _0x1ea3c3=_0x1ef956[_0x1a1363];for(var _0x27398d=0x0;_0x27398d<_0x1ea3c3['Agents'][_0xe2e8('0x30')];_0x27398d+=0x1){let _0x38dd10=_0x1ea3c3[_0xe2e8('0x58')][_0x27398d];var _0x556681=_0x5aa19e[_0xe2e8('0x68')]();_0x556681[_0xe2e8('0x23')](_0xe2e8('0x69'),_0x38dd10['id']);_0xedcb69['push'](db['sequelize'][_0xe2e8('0x25')](_0x556681['toString'](),{'type':db[_0xe2e8('0x6a')][_0xe2e8('0x6b')][_0xe2e8('0x6c')]})[_0xe2e8('0x19')](function(_0x26858d){if(_0x26858d[_0xe2e8('0x30')]===0x1){return _0x38dd10['id'];}else{var _0x20f695=_[_0xe2e8('0x6d')](_[_0xe2e8('0x46')](_0x26858d,'TeamId'),function(_0x49db42){return _[_0xe2e8('0x6e')](_0x3719dd,_0x49db42);});if(_0x20f695){return _0x38dd10['id'];}}}));}}return BPromise[_0xe2e8('0x6f')](_0xedcb69)[_0xe2e8('0x19')](function(_0x14f7d1){_0x5cffdd=_(_0x5cffdd)['union'](_0x14f7d1)[_0xe2e8('0x70')]()['value']();return db['ChatQueue'][_0xe2e8('0x34')]({'where':{'id':_0x451c52[_0xe2e8('0x29')]['id']}})[_0xe2e8('0x19')](function(_0x45df6b){return db['sequelize']['transaction'](function(_0x830bdf){return _0x45df6b[_0xe2e8('0x5e')](_0x451c52[_0xe2e8('0x25')]['ids'],{'transaction':_0x830bdf})[_0xe2e8('0x19')](function(){if(!_[_0xe2e8('0x71')](_0x5cffdd)){return _0x45df6b[_0xe2e8('0x72')](_0x5cffdd,{'transaction':_0x830bdf});}})[_0xe2e8('0x19')](function(){_0x5cffdd[_0xe2e8('0x73')](function(_0x57ab66){socket[_0xe2e8('0x74')](_0xe2e8('0x75'),{'UserId':_0x57ab66,'ChatQueueId':_0x45df6b['id']});});});});});});})[_0xe2e8('0x19')](respondWithStatusCode(_0x1df9d6,null))[_0xe2e8('0x27')](handleError(_0x1df9d6,null));};exports[_0xe2e8('0x76')]=function(_0x15b5b0,_0x4b5f1e){return db[_0xe2e8('0x1e')][_0xe2e8('0x34')]({'where':{'id':_0x15b5b0[_0xe2e8('0x29')]['id']}})[_0xe2e8('0x19')](handleEntityNotFound(_0x4b5f1e,null))['then'](function(_0x1062f1){if(_0x1062f1){return _0x1062f1[_0xe2e8('0x76')](_0x15b5b0[_0xe2e8('0x36')][_0xe2e8('0x57')],_[_0xe2e8('0x77')](_0x15b5b0[_0xe2e8('0x36')],[_0xe2e8('0x57'),'id'])||{})['spread'](function(_0x5c35aa){for(var _0x53c75b=0x0;_0x53c75b<_0x15b5b0[_0xe2e8('0x36')][_0xe2e8('0x57')][_0xe2e8('0x30')];_0x53c75b+=0x1){socket[_0xe2e8('0x74')]('userChatQueue:save',{'UserId':Number(_0x15b5b0[_0xe2e8('0x36')][_0xe2e8('0x57')][_0x53c75b]),'ChatQueueId':Number(_0x15b5b0['params']['id'])});}return _0x5c35aa;});}})[_0xe2e8('0x19')](respondWithResult(_0x4b5f1e,null))['catch'](handleError(_0x4b5f1e,null));};exports['removeAgents']=function(_0x3673de,_0x2b0223){return db['ChatQueue'][_0xe2e8('0x34')]({'where':{'id':_0x3673de[_0xe2e8('0x29')]['id']}})[_0xe2e8('0x19')](handleEntityNotFound(_0x2b0223,null))['then'](function(_0x57fdf3){if(_0x57fdf3){return _0x57fdf3[_0xe2e8('0x72')](_0x3673de[_0xe2e8('0x25')][_0xe2e8('0x57')])['then'](function(){if(_['isArray'](_0x3673de[_0xe2e8('0x25')][_0xe2e8('0x57')])){for(var _0x42cba4=0x0;_0x42cba4<_0x3673de[_0xe2e8('0x25')][_0xe2e8('0x57')][_0xe2e8('0x30')];_0x42cba4+=0x1){socket[_0xe2e8('0x74')](_0xe2e8('0x75'),{'UserId':Number(_0x3673de[_0xe2e8('0x25')][_0xe2e8('0x57')][_0x42cba4]),'ChatQueueId':Number(_0x3673de['params']['id'])});}}else{socket[_0xe2e8('0x74')]('userChatQueue:remove',{'UserId':Number(_0x3673de[_0xe2e8('0x25')][_0xe2e8('0x57')]),'ChatQueueId':Number(_0x3673de['params']['id'])});}});}})['then'](respondWithStatusCode(_0x2b0223,null))['catch'](handleError(_0x2b0223,null));};exports['getAgents']=function(_0x4078b0,_0x23cdc7){var _0x508e9a={};var _0x5306b5={};var _0xfeef13;var _0x3b0b97;return db['ChatQueue'][_0xe2e8('0x3f')]({'where':{'id':_0x4078b0[_0xe2e8('0x29')]['id']}})['then'](handleEntityNotFound(_0x23cdc7,null))[_0xe2e8('0x19')](function(_0x21ea26){if(_0x21ea26){_0xfeef13=_0x21ea26;_0x5306b5['model']=_[_0xe2e8('0x2b')](db[_0xe2e8('0x48')][_0xe2e8('0x1f')]);_0x5306b5[_0xe2e8('0x25')]=_[_0xe2e8('0x2b')](_0x4078b0[_0xe2e8('0x25')]);_0x5306b5[_0xe2e8('0x2c')]=_[_0xe2e8('0x2d')](_0x5306b5[_0xe2e8('0x2a')],_0x5306b5[_0xe2e8('0x25')]);_0x508e9a[_0xe2e8('0x2e')]=_[_0xe2e8('0x2d')](_0x5306b5[_0xe2e8('0x2a')],qs[_0xe2e8('0x2f')](_0x4078b0[_0xe2e8('0x25')][_0xe2e8('0x2f')]));_0x508e9a['attributes']=_0x508e9a[_0xe2e8('0x2e')]['length']?_0x508e9a[_0xe2e8('0x2e')]:_0x5306b5[_0xe2e8('0x2a')];_0x508e9a[_0xe2e8('0x53')]=qs[_0xe2e8('0x42')](_0x4078b0[_0xe2e8('0x25')][_0xe2e8('0x42')]);_0x508e9a[_0xe2e8('0x23')]=qs['filters'](_[_0xe2e8('0x43')](_0x4078b0['query'],_0x5306b5[_0xe2e8('0x2c')]));if(_0x4078b0[_0xe2e8('0x25')][_0xe2e8('0x45')]){_0x508e9a['where']=_[_0xe2e8('0x32')](_0x508e9a[_0xe2e8('0x23')],{'$or':_[_0xe2e8('0x46')](_0x508e9a[_0xe2e8('0x2e')],function(_0x4b6114){var _0x36a201={};_0x36a201[_0x4b6114]={'$like':'%'+_0x4078b0[_0xe2e8('0x25')][_0xe2e8('0x45')]+'%'};return _0x36a201;})});}_0x508e9a=_[_0xe2e8('0x32')]({},_0x508e9a,_0x4078b0[_0xe2e8('0x33')]);return _0xfeef13[_0xe2e8('0x78')](_0x508e9a);}})[_0xe2e8('0x19')](function(_0x66755){if(_0x66755){_0x3b0b97=_0x66755[_0xe2e8('0x30')];if(!_0x4078b0['query']['hasOwnProperty'](_0xe2e8('0x55'))){_0x508e9a[_0xe2e8('0x14')]=qs[_0xe2e8('0x14')](_0x4078b0[_0xe2e8('0x25')][_0xe2e8('0x14')]);_0x508e9a[_0xe2e8('0x12')]=qs['offset'](_0x4078b0[_0xe2e8('0x25')][_0xe2e8('0x12')]);}return _0xfeef13[_0xe2e8('0x78')](_0x508e9a);}})[_0xe2e8('0x19')](function(_0xf511f2){if(_0xf511f2){return _0xf511f2?{'count':_0x3b0b97,'rows':_0xf511f2}:null;}})[_0xe2e8('0x19')](respondWithResult(_0x23cdc7,null))[_0xe2e8('0x27')](handleError(_0x23cdc7,null));};
\ No newline at end of file
diff --git a/server/api/chatQueue/chatQueue.events.js b/server/api/chatQueue/chatQueue.events.js
index 9612b41..d8973ea 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 _0x8d0e=['exports','events','../../mysqldb','ChatQueue','setMaxListeners','save','update','remove','hasOwnProperty','hook'];(function(_0x1dc69a,_0x386c1c){var _0x519cd8=function(_0x246ce2){while(--_0x246ce2){_0x1dc69a['push'](_0x1dc69a['shift']());}};_0x519cd8(++_0x386c1c);}(_0x8d0e,0x1d7));var _0xe8d0=function(_0x1d124b,_0x59572c){_0x1d124b=_0x1d124b-0x0;var _0x56d238=_0x8d0e[_0x1d124b];return _0x56d238;};'use strict';var EventEmitter=require(_0xe8d0('0x0'));var ChatQueue=require(_0xe8d0('0x1'))['db'][_0xe8d0('0x2')];var ChatQueueEvents=new EventEmitter();ChatQueueEvents[_0xe8d0('0x3')](0x0);var events={'afterCreate':_0xe8d0('0x4'),'afterUpdate':_0xe8d0('0x5'),'afterDestroy':_0xe8d0('0x6')};function emitEvent(_0x940176){return function(_0x32cee9,_0x579cb9,_0x39caa6){ChatQueueEvents['emit'](_0x940176+':'+_0x32cee9['id'],_0x32cee9);ChatQueueEvents['emit'](_0x940176,_0x32cee9);_0x39caa6(null);};}for(var e in events){if(events[_0xe8d0('0x7')](e)){var event=events[e];ChatQueue[_0xe8d0('0x8')](e,emitEvent(event));}}module[_0xe8d0('0x9')]=ChatQueueEvents;
\ No newline at end of file
+var _0x6959=['hasOwnProperty','exports','../../mysqldb','ChatQueue','setMaxListeners','update','remove','emit'];(function(_0x7dc7b6,_0xa43ae8){var _0x3357a4=function(_0x58682e){while(--_0x58682e){_0x7dc7b6['push'](_0x7dc7b6['shift']());}};_0x3357a4(++_0xa43ae8);}(_0x6959,0x9a));var _0x9695=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x6959[_0x20a584];return _0x4b41a8;};'use strict';var EventEmitter=require('events');var ChatQueue=require(_0x9695('0x0'))['db'][_0x9695('0x1')];var ChatQueueEvents=new EventEmitter();ChatQueueEvents[_0x9695('0x2')](0x0);var events={'afterCreate':'save','afterUpdate':_0x9695('0x3'),'afterDestroy':_0x9695('0x4')};function emitEvent(_0x47b632){return function(_0x17f7dd,_0x4eb47b,_0x4c745b){ChatQueueEvents[_0x9695('0x5')](_0x47b632+':'+_0x17f7dd['id'],_0x17f7dd);ChatQueueEvents[_0x9695('0x5')](_0x47b632,_0x17f7dd);_0x4c745b(null);};}for(var e in events){if(events[_0x9695('0x6')](e)){var event=events[e];ChatQueue['hook'](e,emitEvent(event));}}module[_0x9695('0x7')]=ChatQueueEvents;
\ No newline at end of file
diff --git a/server/api/chatQueue/chatQueue.model.js b/server/api/chatQueue/chatQueue.model.js
index cc9d337..c90b928 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 _0x2a80=['./chatQueue.attributes','define','ChatQueue','chat_queues','../../config/logger','moment','bluebird','../../config/environment'];(function(_0x3288e9,_0x5a0a54){var _0x59f919=function(_0x1ff08f){while(--_0x1ff08f){_0x3288e9['push'](_0x3288e9['shift']());}};_0x59f919(++_0x5a0a54);}(_0x2a80,0x194));var _0x02a8=function(_0x51a467,_0x59d69a){_0x51a467=_0x51a467-0x0;var _0x56458b=_0x2a80[_0x51a467];return _0x56458b;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x02a8('0x0'))('api');var moment=require(_0x02a8('0x1'));var BPromise=require(_0x02a8('0x2'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x02a8('0x3'));var attributes=require(_0x02a8('0x4'));module['exports']=function(_0x1b4b0a,_0x58654a){return _0x1b4b0a[_0x02a8('0x5')](_0x02a8('0x6'),attributes,{'tableName':_0x02a8('0x7'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x675d=['ChatQueue','chat_queues','lodash','../../config/logger','api','moment','bluebird','request-promise','path','../../config/environment','exports','define'];(function(_0x9add99,_0x3eda3b){var _0x482653=function(_0x3eeaa4){while(--_0x3eeaa4){_0x9add99['push'](_0x9add99['shift']());}};_0x482653(++_0x3eda3b);}(_0x675d,0x92));var _0xd675=function(_0x47f9bd,_0x12799d){_0x47f9bd=_0x47f9bd-0x0;var _0x24b9fe=_0x675d[_0x47f9bd];return _0x24b9fe;};'use strict';var _=require(_0xd675('0x0'));var util=require('util');var logger=require(_0xd675('0x1'))(_0xd675('0x2'));var moment=require(_0xd675('0x3'));var BPromise=require(_0xd675('0x4'));var rp=require(_0xd675('0x5'));var fs=require('fs');var path=require(_0xd675('0x6'));var rimraf=require('rimraf');var config=require(_0xd675('0x7'));var attributes=require('./chatQueue.attributes');module[_0xd675('0x8')]=function(_0xcd7263,_0x25aab9){return _0xcd7263[_0xd675('0x9')](_0xd675('0xa'),attributes,{'tableName':_0xd675('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
diff --git a/server/api/chatQueue/chatQueue.rpc.js b/server/api/chatQueue/chatQueue.rpc.js
index af4276d..ef0bc10 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 _0x8c28=['register','request','info','ChatQueue,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','catch','GetChatQueue','findAll','options','raw','where','limit','include','model','attributes','map','then','ChatQueue','find','ShowChatQueue','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','defaults','redis','localhost','socket.io-emitter','./chatQueue.socket'];(function(_0x3d17fb,_0x2aa8f2){var _0x5aa433=function(_0xd50c93){while(--_0xd50c93){_0x3d17fb['push'](_0x3d17fb['shift']());}};_0x5aa433(++_0x2aa8f2);}(_0x8c28,0x1c8));var _0x88c2=function(_0x103aaa,_0x46ac8a){_0x103aaa=_0x103aaa-0x0;var _0x26f127=_0x8c28[_0x103aaa];return _0x26f127;};'use strict';var _=require(_0x88c2('0x0'));var util=require(_0x88c2('0x1'));var moment=require(_0x88c2('0x2'));var BPromise=require(_0x88c2('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x88c2('0x4'));var db=require(_0x88c2('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x88c2('0x6'))(_0x88c2('0x7'));var config=require(_0x88c2('0x8'));var jayson=require(_0x88c2('0x9'));var client=jayson[_0x88c2('0xa')][_0x88c2('0xb')]({'port':0x232a});config['redis']=_[_0x88c2('0xc')](config[_0x88c2('0xd')],{'host':_0x88c2('0xe'),'port':0x18eb});var socket=require(_0x88c2('0xf'))(new Redis(config[_0x88c2('0xd')]));require(_0x88c2('0x10'))[_0x88c2('0x11')](socket);function respondWithRpcPromise(_0x22a76f,_0x2d4d53,_0x1624fc){return new BPromise(function(_0x31146e,_0x56aa98){return client[_0x88c2('0x12')](_0x22a76f,_0x1624fc)['then'](function(_0x17c1e5){logger[_0x88c2('0x13')](_0x88c2('0x14'),_0x2d4d53,_0x88c2('0x15'));logger[_0x88c2('0x16')]('ChatQueue,\x20%s,\x20%s,\x20%s',_0x2d4d53,_0x88c2('0x15'),JSON[_0x88c2('0x17')](_0x17c1e5));if(_0x17c1e5['error']){if(_0x17c1e5[_0x88c2('0x18')][_0x88c2('0x19')]===0x1f4){logger[_0x88c2('0x18')](_0x88c2('0x14'),_0x2d4d53,_0x17c1e5[_0x88c2('0x18')][_0x88c2('0x1a')]);return _0x56aa98(_0x17c1e5['error'][_0x88c2('0x1a')]);}logger[_0x88c2('0x18')]('ChatQueue,\x20%s,\x20%s',_0x2d4d53,_0x17c1e5[_0x88c2('0x18')][_0x88c2('0x1a')]);return _0x31146e(_0x17c1e5[_0x88c2('0x18')][_0x88c2('0x1a')]);}else{logger['info'](_0x88c2('0x14'),_0x2d4d53,_0x88c2('0x15'));_0x31146e(_0x17c1e5[_0x88c2('0x1b')][_0x88c2('0x1a')]);}})[_0x88c2('0x1c')](function(_0xd3e60c){logger['error'](_0x88c2('0x14'),_0x2d4d53,_0xd3e60c);_0x56aa98(_0xd3e60c);});});}exports[_0x88c2('0x1d')]=function(_0x419311){var _0x22cef4=this;return new Promise(function(_0x2e2ce4,_0x25e651){return db['ChatQueue'][_0x88c2('0x1e')]({'raw':_0x419311[_0x88c2('0x1f')]?_0x419311[_0x88c2('0x1f')][_0x88c2('0x20')]===undefined?!![]:![]:!![],'where':_0x419311['options']?_0x419311[_0x88c2('0x1f')][_0x88c2('0x21')]||null:null,'attributes':_0x419311[_0x88c2('0x1f')]?_0x419311[_0x88c2('0x1f')]['attributes']||null:null,'limit':_0x419311[_0x88c2('0x1f')]?_0x419311[_0x88c2('0x1f')][_0x88c2('0x22')]||null:null,'include':_0x419311[_0x88c2('0x1f')]?_0x419311[_0x88c2('0x1f')][_0x88c2('0x23')]?_['map'](_0x419311[_0x88c2('0x1f')][_0x88c2('0x23')],function(_0x2312fa){return{'model':db[_0x2312fa[_0x88c2('0x24')]],'as':_0x2312fa['as'],'attributes':_0x2312fa[_0x88c2('0x25')],'include':_0x2312fa[_0x88c2('0x23')]?_[_0x88c2('0x26')](_0x2312fa[_0x88c2('0x23')],function(_0x395a7f){return{'model':db[_0x395a7f[_0x88c2('0x24')]],'as':_0x395a7f['as'],'attributes':_0x395a7f[_0x88c2('0x25')],'include':_0x395a7f[_0x88c2('0x23')]?_[_0x88c2('0x26')](_0x395a7f[_0x88c2('0x23')],function(_0x29c39a){return{'model':db[_0x29c39a[_0x88c2('0x24')]],'as':_0x29c39a['as'],'attributes':_0x29c39a[_0x88c2('0x25')]};}):[]};}):[]};}):[]:[]})[_0x88c2('0x27')](function(_0x27c9dd){logger[_0x88c2('0x13')](_0x88c2('0x1d'),_0x419311);logger[_0x88c2('0x16')](_0x88c2('0x1d'),_0x419311,JSON['stringify'](_0x27c9dd));_0x2e2ce4(_0x27c9dd);})[_0x88c2('0x1c')](function(_0x492229){logger[_0x88c2('0x18')]('GetChatQueue',_0x492229[_0x88c2('0x1a')],_0x419311);_0x25e651(_0x22cef4[_0x88c2('0x18')](0x1f4,_0x492229[_0x88c2('0x1a')]));});});};exports['ShowChatQueue']=function(_0x526b79){var _0x1a3841=this;return new Promise(function(_0x500f7b,_0x34f7cb){return db[_0x88c2('0x28')][_0x88c2('0x29')]({'raw':_0x526b79[_0x88c2('0x1f')]?_0x526b79['options'][_0x88c2('0x20')]===undefined?!![]:![]:!![],'where':_0x526b79[_0x88c2('0x1f')]?_0x526b79[_0x88c2('0x1f')][_0x88c2('0x21')]||null:null,'attributes':_0x526b79[_0x88c2('0x1f')]?_0x526b79[_0x88c2('0x1f')][_0x88c2('0x25')]||null:null,'include':_0x526b79[_0x88c2('0x1f')]?_0x526b79[_0x88c2('0x1f')][_0x88c2('0x23')]?_[_0x88c2('0x26')](_0x526b79[_0x88c2('0x1f')][_0x88c2('0x23')],function(_0x2956d6){return{'model':db[_0x2956d6[_0x88c2('0x24')]],'as':_0x2956d6['as'],'attributes':_0x2956d6[_0x88c2('0x25')],'include':_0x2956d6[_0x88c2('0x23')]?_[_0x88c2('0x26')](_0x2956d6['include'],function(_0x2390e4){return{'model':db[_0x2390e4[_0x88c2('0x24')]],'as':_0x2390e4['as'],'attributes':_0x2390e4[_0x88c2('0x25')],'include':_0x2390e4[_0x88c2('0x23')]?_[_0x88c2('0x26')](_0x2390e4[_0x88c2('0x23')],function(_0x9f00ac){return{'model':db[_0x9f00ac[_0x88c2('0x24')]],'as':_0x9f00ac['as'],'attributes':_0x9f00ac['attributes']};}):[]};}):[]};}):[]:[]})['then'](function(_0x51bb0f){logger[_0x88c2('0x13')](_0x88c2('0x2a'),_0x526b79);logger['debug']('ShowChatQueue',_0x526b79,JSON['stringify'](_0x51bb0f));_0x500f7b(_0x51bb0f);})[_0x88c2('0x1c')](function(_0x5bd060){logger[_0x88c2('0x18')](_0x88c2('0x2a'),_0x5bd060['message'],_0x526b79);_0x34f7cb(_0x1a3841[_0x88c2('0x18')](0x1f4,_0x5bd060['message']));});});};
\ No newline at end of file
+var _0x6606=['ioredis','../../mysqldb','rpc','jayson/promise','client','http','redis','./chatQueue.socket','register','then','info','ChatQueue,\x20%s,\x20%s','debug','request\x20sent','stringify','error','code','message','result','ChatQueue','options','raw','where','attributes','limit','include','map','GetChatQueue','catch','ShowChatQueue','find','model','lodash','util','moment','bluebird','randomstring'];(function(_0x330414,_0x4f3207){var _0x99dbff=function(_0x166f85){while(--_0x166f85){_0x330414['push'](_0x330414['shift']());}};_0x99dbff(++_0x4f3207);}(_0x6606,0x6a));var _0x6660=function(_0x120bf3,_0x563252){_0x120bf3=_0x120bf3-0x0;var _0x244d0f=_0x6606[_0x120bf3];return _0x244d0f;};'use strict';var _=require(_0x6660('0x0'));var util=require(_0x6660('0x1'));var moment=require(_0x6660('0x2'));var BPromise=require(_0x6660('0x3'));var rs=require(_0x6660('0x4'));var fs=require('fs');var Redis=require(_0x6660('0x5'));var db=require(_0x6660('0x6'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x6660('0x7'));var config=require('../../config/environment');var jayson=require(_0x6660('0x8'));var client=jayson[_0x6660('0x9')][_0x6660('0xa')]({'port':0x232a});config[_0x6660('0xb')]=_['defaults'](config[_0x6660('0xb')],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x6660('0xb')]));require(_0x6660('0xc'))[_0x6660('0xd')](socket);function respondWithRpcPromise(_0x44224f,_0x487fb3,_0x57cb0e){return new BPromise(function(_0x5c1b85,_0x16d970){return client['request'](_0x44224f,_0x57cb0e)[_0x6660('0xe')](function(_0x168d2a){logger[_0x6660('0xf')](_0x6660('0x10'),_0x487fb3,'request\x20sent');logger[_0x6660('0x11')]('ChatQueue,\x20%s,\x20%s,\x20%s',_0x487fb3,_0x6660('0x12'),JSON[_0x6660('0x13')](_0x168d2a));if(_0x168d2a[_0x6660('0x14')]){if(_0x168d2a[_0x6660('0x14')][_0x6660('0x15')]===0x1f4){logger['error'](_0x6660('0x10'),_0x487fb3,_0x168d2a[_0x6660('0x14')][_0x6660('0x16')]);return _0x16d970(_0x168d2a[_0x6660('0x14')][_0x6660('0x16')]);}logger[_0x6660('0x14')](_0x6660('0x10'),_0x487fb3,_0x168d2a[_0x6660('0x14')]['message']);return _0x5c1b85(_0x168d2a[_0x6660('0x14')][_0x6660('0x16')]);}else{logger[_0x6660('0xf')](_0x6660('0x10'),_0x487fb3,_0x6660('0x12'));_0x5c1b85(_0x168d2a[_0x6660('0x17')][_0x6660('0x16')]);}})['catch'](function(_0x2ae651){logger[_0x6660('0x14')]('ChatQueue,\x20%s,\x20%s',_0x487fb3,_0x2ae651);_0x16d970(_0x2ae651);});});}exports['GetChatQueue']=function(_0x5e0a93){var _0x8ae2b8=this;return new Promise(function(_0x5be55f,_0x52afae){return db[_0x6660('0x18')]['findAll']({'raw':_0x5e0a93['options']?_0x5e0a93[_0x6660('0x19')][_0x6660('0x1a')]===undefined?!![]:![]:!![],'where':_0x5e0a93[_0x6660('0x19')]?_0x5e0a93[_0x6660('0x19')][_0x6660('0x1b')]||null:null,'attributes':_0x5e0a93[_0x6660('0x19')]?_0x5e0a93['options'][_0x6660('0x1c')]||null:null,'limit':_0x5e0a93[_0x6660('0x19')]?_0x5e0a93[_0x6660('0x19')][_0x6660('0x1d')]||null:null,'include':_0x5e0a93[_0x6660('0x19')]?_0x5e0a93['options'][_0x6660('0x1e')]?_[_0x6660('0x1f')](_0x5e0a93[_0x6660('0x19')]['include'],function(_0x5d4f39){return{'model':db[_0x5d4f39['model']],'as':_0x5d4f39['as'],'attributes':_0x5d4f39['attributes'],'include':_0x5d4f39['include']?_[_0x6660('0x1f')](_0x5d4f39['include'],function(_0x65ec94){return{'model':db[_0x65ec94['model']],'as':_0x65ec94['as'],'attributes':_0x65ec94[_0x6660('0x1c')],'include':_0x65ec94[_0x6660('0x1e')]?_['map'](_0x65ec94[_0x6660('0x1e')],function(_0x25be51){return{'model':db[_0x25be51['model']],'as':_0x25be51['as'],'attributes':_0x25be51[_0x6660('0x1c')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x245e4e){logger[_0x6660('0xf')](_0x6660('0x20'),_0x5e0a93);logger[_0x6660('0x11')]('GetChatQueue',_0x5e0a93,JSON[_0x6660('0x13')](_0x245e4e));_0x5be55f(_0x245e4e);})[_0x6660('0x21')](function(_0x24a9ba){logger[_0x6660('0x14')](_0x6660('0x20'),_0x24a9ba[_0x6660('0x16')],_0x5e0a93);_0x52afae(_0x8ae2b8[_0x6660('0x14')](0x1f4,_0x24a9ba[_0x6660('0x16')]));});});};exports[_0x6660('0x22')]=function(_0x40ec51){var _0xff544e=this;return new Promise(function(_0x2667e0,_0x33b3e2){return db[_0x6660('0x18')][_0x6660('0x23')]({'raw':_0x40ec51[_0x6660('0x19')]?_0x40ec51[_0x6660('0x19')][_0x6660('0x1a')]===undefined?!![]:![]:!![],'where':_0x40ec51[_0x6660('0x19')]?_0x40ec51[_0x6660('0x19')][_0x6660('0x1b')]||null:null,'attributes':_0x40ec51['options']?_0x40ec51[_0x6660('0x19')][_0x6660('0x1c')]||null:null,'include':_0x40ec51[_0x6660('0x19')]?_0x40ec51[_0x6660('0x19')][_0x6660('0x1e')]?_[_0x6660('0x1f')](_0x40ec51['options']['include'],function(_0x872a7d){return{'model':db[_0x872a7d[_0x6660('0x24')]],'as':_0x872a7d['as'],'attributes':_0x872a7d[_0x6660('0x1c')],'include':_0x872a7d[_0x6660('0x1e')]?_[_0x6660('0x1f')](_0x872a7d[_0x6660('0x1e')],function(_0x1f745b){return{'model':db[_0x1f745b[_0x6660('0x24')]],'as':_0x1f745b['as'],'attributes':_0x1f745b[_0x6660('0x1c')],'include':_0x1f745b['include']?_[_0x6660('0x1f')](_0x1f745b[_0x6660('0x1e')],function(_0x31e93f){return{'model':db[_0x31e93f[_0x6660('0x24')]],'as':_0x31e93f['as'],'attributes':_0x31e93f[_0x6660('0x1c')]};}):[]};}):[]};}):[]:[]})[_0x6660('0xe')](function(_0x4a42a0){logger[_0x6660('0xf')](_0x6660('0x22'),_0x40ec51);logger[_0x6660('0x11')]('ShowChatQueue',_0x40ec51,JSON[_0x6660('0x13')](_0x4a42a0));_0x2667e0(_0x4a42a0);})[_0x6660('0x21')](function(_0x4ab64f){logger['error'](_0x6660('0x22'),_0x4ab64f[_0x6660('0x16')],_0x40ec51);_0x33b3e2(_0xff544e[_0x6660('0x14')](0x1f4,_0x4ab64f[_0x6660('0x16')]));});});};
\ No newline at end of file
diff --git a/server/api/chatQueue/chatQueue.socket.js b/server/api/chatQueue/chatQueue.socket.js
index a6648ed..c11526b 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 _0x032e=['removeListener','register','length','chatQueue:','./chatQueue.events','remove','update','emit'];(function(_0xd58a14,_0xaaf1f7){var _0x5cffb8=function(_0x54f105){while(--_0x54f105){_0xd58a14['push'](_0xd58a14['shift']());}};_0x5cffb8(++_0xaaf1f7);}(_0x032e,0x124));var _0xe032=function(_0x3b380d,_0x4bf247){_0x3b380d=_0x3b380d-0x0;var _0x54502b=_0x032e[_0x3b380d];return _0x54502b;};'use strict';var ChatQueueEvents=require(_0xe032('0x0'));var events=['save',_0xe032('0x1'),_0xe032('0x2')];function createListener(_0x5ca562,_0x4afba2){return function(_0x45ab5b){_0x4afba2[_0xe032('0x3')](_0x5ca562,_0x45ab5b);};}function removeListener(_0x2f44f6,_0x1983cc){return function(){ChatQueueEvents[_0xe032('0x4')](_0x2f44f6,_0x1983cc);};}exports[_0xe032('0x5')]=function(_0x2ba8a0){for(var _0x33ad0b=0x0,_0x37432f=events[_0xe032('0x6')];_0x33ad0b<_0x37432f;_0x33ad0b++){var _0x3289b0=events[_0x33ad0b];var _0xd84027=createListener(_0xe032('0x7')+_0x3289b0,_0x2ba8a0);ChatQueueEvents['on'](_0x3289b0,_0xd84027);}};
\ No newline at end of file
+var _0xc368=['removeListener','register','length','chatQueue:','save','update','emit'];(function(_0x2dbed7,_0x2962d5){var _0x326efc=function(_0x1713b3){while(--_0x1713b3){_0x2dbed7['push'](_0x2dbed7['shift']());}};_0x326efc(++_0x2962d5);}(_0xc368,0x7b));var _0x8c36=function(_0xeed931,_0x234954){_0xeed931=_0xeed931-0x0;var _0x44de53=_0xc368[_0xeed931];return _0x44de53;};'use strict';var ChatQueueEvents=require('./chatQueue.events');var events=[_0x8c36('0x0'),'remove',_0x8c36('0x1')];function createListener(_0x17fa33,_0x20e697){return function(_0x2640c5){_0x20e697[_0x8c36('0x2')](_0x17fa33,_0x2640c5);};}function removeListener(_0x5d3b27,_0x3e9034){return function(){ChatQueueEvents[_0x8c36('0x3')](_0x5d3b27,_0x3e9034);};}exports[_0x8c36('0x4')]=function(_0x1d3660){for(var _0x5ebfc1=0x0,_0x554022=events[_0x8c36('0x5')];_0x5ebfc1<_0x554022;_0x5ebfc1++){var _0x384867=events[_0x5ebfc1];var _0x3e76be=createListener(_0x8c36('0x6')+_0x384867,_0x1d3660);ChatQueueEvents['on'](_0x384867,_0x3e76be);}};
\ No newline at end of file
diff --git a/server/api/chatQueue/index.js b/server/api/chatQueue/index.js
index 0151efa..125516d 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 _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(_0x7e3b11,_0x599592){var _0x3c0a85=function(_0x2d4057){while(--_0x2d4057){_0x7e3b11['push'](_0x7e3b11['shift']());}};_0x3c0a85(++_0x599592);}(_0xe14b,0x93));var _0xbe14=function(_0x40c467,_0x5b9a1e){_0x40c467=_0x40c467-0x0;var _0x4505e2=_0xe14b[_0x40c467];return _0x4505e2;};'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
+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(_0x1e7b16,_0x4607a1){var _0x37fadc=function(_0x1fc9ce){while(--_0x1fc9ce){_0x1e7b16['push'](_0x1e7b16['shift']());}};_0x37fadc(++_0x4607a1);}(_0x5fc3,0xa8));var _0x35fc=function(_0x3f0b30,_0x159bc8){_0x3f0b30=_0x3f0b30-0x0;var _0x2748a5=_0x5fc3[_0x3f0b30];return _0x2748a5;};'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
diff --git a/server/api/chatQueueReport/chatQueueReport.attributes.js b/server/api/chatQueueReport/chatQueueReport.attributes.js
index 4d3e776..c8fe2ef 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 _0xd781=['sequelize','STRING','DATE'];(function(_0x58e842,_0xea2e71){var _0x50424f=function(_0x4aa62b){while(--_0x4aa62b){_0x58e842['push'](_0x58e842['shift']());}};_0x50424f(++_0xea2e71);}(_0xd781,0x180));var _0x1d78=function(_0x5a0648,_0x4b812e){_0x5a0648=_0x5a0648-0x0;var _0x39a24f=_0xd781[_0x5a0648];return _0x39a24f;};'use strict';var moment=require('moment');var Sequelize=require(_0x1d78('0x0'));module['exports']={'uniqueid':{'type':Sequelize[_0x1d78('0x1')],'allowNull':![]},'from':{'type':Sequelize[_0x1d78('0x1')]},'joinAt':{'type':Sequelize[_0x1d78('0x2')]},'leaveAt':{'type':Sequelize['DATE']},'acceptAt':{'type':Sequelize[_0x1d78('0x2')]},'exitAt':{'type':Sequelize[_0x1d78('0x2')]},'reason':{'type':Sequelize[_0x1d78('0x1')]}};
\ No newline at end of file
+var _0xa995=['sequelize','exports','STRING','DATE'];(function(_0x40ac5e,_0x2de228){var _0x2839d6=function(_0x123d47){while(--_0x123d47){_0x40ac5e['push'](_0x40ac5e['shift']());}};_0x2839d6(++_0x2de228);}(_0xa995,0x144));var _0x5a99=function(_0x118e51,_0x3a92a3){_0x118e51=_0x118e51-0x0;var _0x40ed50=_0xa995[_0x118e51];return _0x40ed50;};'use strict';var moment=require('moment');var Sequelize=require(_0x5a99('0x0'));module[_0x5a99('0x1')]={'uniqueid':{'type':Sequelize['STRING'],'allowNull':![]},'from':{'type':Sequelize[_0x5a99('0x2')]},'joinAt':{'type':Sequelize[_0x5a99('0x3')]},'leaveAt':{'type':Sequelize[_0x5a99('0x3')]},'acceptAt':{'type':Sequelize[_0x5a99('0x3')]},'exitAt':{'type':Sequelize['DATE']},'reason':{'type':Sequelize[_0x5a99('0x2')]}};
\ No newline at end of file
diff --git a/server/api/chatQueueReport/chatQueueReport.controller.js b/server/api/chatQueueReport/chatQueueReport.controller.js
index 8e0b863..a5fe692 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 _0x0960=['offset','set','Content-Range','apply','reject','save','then','destroy','name','send','index','map','ChatQueueReport','fieldName','key','model','query','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filters','pick','type','VIRTUAL','filter','includeAll','include','rows','params','keys','rawAttributes','options','create','body','update','find','catch','describe','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/environment','../../mysqldb','sendStatus','status','json','undefined','limit','count'];(function(_0x22076d,_0x46afc1){var _0x4b1ffc=function(_0x53b118){while(--_0x53b118){_0x22076d['push'](_0x22076d['shift']());}};_0x4b1ffc(++_0x46afc1);}(_0x0960,0xc2));var _0x0096=function(_0x2f729e,_0x528b56){_0x2f729e=_0x2f729e-0x0;var _0x308707=_0x0960[_0x2f729e];return _0x308707;};'use strict';var emlformat=require(_0x0096('0x0'));var rimraf=require(_0x0096('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x0096('0x2'));var rp=require(_0x0096('0x3'));var moment=require(_0x0096('0x4'));var BPromise=require(_0x0096('0x5'));var Mustache=require(_0x0096('0x6'));var util=require(_0x0096('0x7'));var path=require(_0x0096('0x8'));var sox=require(_0x0096('0x9'));var csv=require(_0x0096('0xa'));var ejs=require(_0x0096('0xb'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x0096('0xc'));var squel=require('squel');var crypto=require(_0x0096('0xd'));var jsforce=require(_0x0096('0xe'));var deskjs=require(_0x0096('0xf'));var toCsv=require('to-csv');var querystring=require(_0x0096('0x10'));var Papa=require(_0x0096('0x11'));var Redis=require(_0x0096('0x12'));var authService=require(_0x0096('0x13'));var qs=require('../../components/parsers/qs');var as=require(_0x0096('0x14'));var hardwareService=require(_0x0096('0x15'));var logger=require('../../config/logger')(_0x0096('0x16'));var utils=require('../../config/utils');var config=require(_0x0096('0x17'));var licenseUtil=require('../../config/license/util');var db=require(_0x0096('0x18'))['db'];function respondWithStatusCode(_0x25011c,_0x55678a){_0x55678a=_0x55678a||0xcc;return function(_0x2be406){if(_0x2be406){return _0x25011c[_0x0096('0x19')](_0x55678a);}return _0x25011c['status'](_0x55678a)['end']();};}function respondWithResult(_0x753d99,_0x39b6f6){_0x39b6f6=_0x39b6f6||0xc8;return function(_0x407361){if(_0x407361){return _0x753d99[_0x0096('0x1a')](_0x39b6f6)[_0x0096('0x1b')](_0x407361);}};}function respondWithFilteredResult(_0x5c901f,_0x590c96){return function(_0x19db10){if(_0x19db10){var _0x50c804=typeof _0x590c96['offset']===_0x0096('0x1c')&&typeof _0x590c96[_0x0096('0x1d')]==='undefined';var _0x7afa5f=_0x19db10[_0x0096('0x1e')];var _0x5468e2=_0x50c804?0x0:_0x590c96[_0x0096('0x1f')];var _0x27462a=_0x50c804?_0x19db10[_0x0096('0x1e')]:_0x590c96[_0x0096('0x1f')]+_0x590c96[_0x0096('0x1d')];var _0x507463;if(_0x27462a>=_0x7afa5f){_0x27462a=_0x7afa5f;_0x507463=0xc8;}else{_0x507463=0xce;}_0x5c901f[_0x0096('0x1a')](_0x507463);return _0x5c901f[_0x0096('0x20')](_0x0096('0x21'),_0x5468e2+'-'+_0x27462a+'/'+_0x7afa5f)['json'](_0x19db10);}return null;};}function patchUpdates(_0x1f5aad){return function(_0xef7a81){try{jsonpatch[_0x0096('0x22')](_0xef7a81,_0x1f5aad,!![]);}catch(_0x4e6338){return BPromise[_0x0096('0x23')](_0x4e6338);}return _0xef7a81[_0x0096('0x24')]();};}function saveUpdates(_0x4ac6f0,_0x263951){return function(_0x29b2c2){if(_0x29b2c2){return _0x29b2c2['update'](_0x4ac6f0)[_0x0096('0x25')](function(_0xfb20d0){return _0xfb20d0;});}return null;};}function removeEntity(_0x1a8e0e,_0x5ee101){return function(_0x224748){if(_0x224748){return _0x224748[_0x0096('0x26')]()[_0x0096('0x25')](function(){_0x1a8e0e['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x569a7e,_0x2ea1df){return function(_0x1a6df7){if(!_0x1a6df7){_0x569a7e['sendStatus'](0x194);}return _0x1a6df7;};}function handleError(_0x47abff,_0x230d46){_0x230d46=_0x230d46||0x1f4;return function(_0x3eac07){logger['error'](_0x3eac07['stack']);if(_0x3eac07[_0x0096('0x27')]){delete _0x3eac07[_0x0096('0x27')];}_0x47abff['status'](_0x230d46)[_0x0096('0x28')](_0x3eac07);};}exports[_0x0096('0x29')]=function(_0x204002,_0x205b79){var _0x102346={},_0x48e20f={},_0x511806={'count':0x0,'rows':[]};var _0x3b842b=_[_0x0096('0x2a')](db[_0x0096('0x2b')]['rawAttributes'],function(_0x593074){return{'name':_0x593074[_0x0096('0x2c')],'type':_0x593074['type'][_0x0096('0x2d')]};});_0x48e20f[_0x0096('0x2e')]=_[_0x0096('0x2a')](_0x3b842b,_0x0096('0x27'));_0x48e20f['query']=_['keys'](_0x204002[_0x0096('0x2f')]);_0x48e20f['filters']=_[_0x0096('0x30')](_0x48e20f[_0x0096('0x2e')],_0x48e20f[_0x0096('0x2f')]);_0x102346[_0x0096('0x31')]=_[_0x0096('0x30')](_0x48e20f[_0x0096('0x2e')],qs[_0x0096('0x32')](_0x204002[_0x0096('0x2f')][_0x0096('0x32')]));_0x102346[_0x0096('0x31')]=_0x102346[_0x0096('0x31')][_0x0096('0x33')]?_0x102346['attributes']:_0x48e20f[_0x0096('0x2e')];if(!_0x204002[_0x0096('0x2f')][_0x0096('0x34')](_0x0096('0x35'))){_0x102346[_0x0096('0x1d')]=qs[_0x0096('0x1d')](_0x204002[_0x0096('0x2f')]['limit']);_0x102346[_0x0096('0x1f')]=qs[_0x0096('0x1f')](_0x204002[_0x0096('0x2f')][_0x0096('0x1f')]);}_0x102346[_0x0096('0x36')]=qs[_0x0096('0x37')](_0x204002[_0x0096('0x2f')][_0x0096('0x37')]);_0x102346[_0x0096('0x38')]=qs[_0x0096('0x39')](_[_0x0096('0x3a')](_0x204002[_0x0096('0x2f')],_0x48e20f['filters']),_0x3b842b);if(_0x204002[_0x0096('0x2f')]['filter']){_0x102346[_0x0096('0x38')]=_['merge'](_0x102346['where'],{'$or':_[_0x0096('0x2a')](_0x3b842b,function(_0x179496){if(_0x179496[_0x0096('0x3b')]!==_0x0096('0x3c')){var _0x157a61={};_0x157a61[_0x179496['name']]={'$like':'%'+_0x204002[_0x0096('0x2f')][_0x0096('0x3d')]+'%'};return _0x157a61;}})});}_0x102346=_['merge']({},_0x102346,_0x204002['options']);var _0x505ede={'where':_0x102346[_0x0096('0x38')]};return db[_0x0096('0x2b')][_0x0096('0x1e')](_0x505ede)[_0x0096('0x25')](function(_0x5722b6){_0x511806[_0x0096('0x1e')]=_0x5722b6;if(_0x204002[_0x0096('0x2f')][_0x0096('0x3e')]){_0x102346[_0x0096('0x3f')]=[{'all':!![]}];}return db[_0x0096('0x2b')]['findAll'](_0x102346);})[_0x0096('0x25')](function(_0x2dccba){_0x511806[_0x0096('0x40')]=_0x2dccba;return _0x511806;})[_0x0096('0x25')](respondWithFilteredResult(_0x205b79,_0x102346))['catch'](handleError(_0x205b79,null));};exports['show']=function(_0x4b4ab7,_0x12d010){var _0x543e14={'raw':!![],'where':{'id':_0x4b4ab7[_0x0096('0x41')]['id']}},_0x31f7c0={};_0x31f7c0[_0x0096('0x2e')]=_[_0x0096('0x42')](db['ChatQueueReport'][_0x0096('0x43')]);_0x31f7c0[_0x0096('0x2f')]=_[_0x0096('0x42')](_0x4b4ab7[_0x0096('0x2f')]);_0x31f7c0[_0x0096('0x39')]=_[_0x0096('0x30')](_0x31f7c0['model'],_0x31f7c0[_0x0096('0x2f')]);_0x543e14['attributes']=_[_0x0096('0x30')](_0x31f7c0[_0x0096('0x2e')],qs[_0x0096('0x32')](_0x4b4ab7['query'][_0x0096('0x32')]));_0x543e14[_0x0096('0x31')]=_0x543e14[_0x0096('0x31')]['length']?_0x543e14[_0x0096('0x31')]:_0x31f7c0[_0x0096('0x2e')];if(_0x4b4ab7['query'][_0x0096('0x3e')]){_0x543e14[_0x0096('0x3f')]=[{'all':!![]}];}_0x543e14=_['merge']({},_0x543e14,_0x4b4ab7[_0x0096('0x44')]);return db[_0x0096('0x2b')]['find'](_0x543e14)[_0x0096('0x25')](handleEntityNotFound(_0x12d010,null))[_0x0096('0x25')](respondWithResult(_0x12d010,null))['catch'](handleError(_0x12d010,null));};exports['create']=function(_0x34cc4d,_0x18baac){return db['ChatQueueReport'][_0x0096('0x45')](_0x34cc4d[_0x0096('0x46')],{})['then'](respondWithResult(_0x18baac,0xc9))['catch'](handleError(_0x18baac,null));};exports[_0x0096('0x47')]=function(_0x392ca0,_0x29993c){if(_0x392ca0[_0x0096('0x46')]['id']){delete _0x392ca0[_0x0096('0x46')]['id'];}return db[_0x0096('0x2b')][_0x0096('0x48')]({'where':{'id':_0x392ca0[_0x0096('0x41')]['id']}})[_0x0096('0x25')](handleEntityNotFound(_0x29993c,null))[_0x0096('0x25')](saveUpdates(_0x392ca0['body'],null))['then'](respondWithResult(_0x29993c,null))[_0x0096('0x49')](handleError(_0x29993c,null));};exports[_0x0096('0x26')]=function(_0x2f5f2f,_0x7fc578){return db[_0x0096('0x2b')]['find']({'where':{'id':_0x2f5f2f[_0x0096('0x41')]['id']}})[_0x0096('0x25')](handleEntityNotFound(_0x7fc578,null))[_0x0096('0x25')](removeEntity(_0x7fc578,null))[_0x0096('0x49')](handleError(_0x7fc578,null));};exports['describe']=function(_0x56a7c8,_0x425f60){return db[_0x0096('0x2b')][_0x0096('0x4a')]()[_0x0096('0x25')](respondWithResult(_0x425f60,null))[_0x0096('0x49')](handleError(_0x425f60,null));};
\ No newline at end of file
+var _0xaac4=['ChatQueueReport','rawAttributes','fieldName','model','map','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','type','VIRTUAL','options','findAll','catch','show','params','includeAll','create','body','update','find','describe','eml-format','rimraf','fast-json-patch','request-promise','moment','mustache','util','path','sox','to-csv','fs-extra','lodash','squel','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','status','offset','undefined','limit','set','Content-Range','json','apply','save','then','destroy','error','name','send','index'];(function(_0xf50820,_0x56f041){var _0x2a9b10=function(_0x33f0f4){while(--_0x33f0f4){_0xf50820['push'](_0xf50820['shift']());}};_0x2a9b10(++_0x56f041);}(_0xaac4,0x6c));var _0x4aac=function(_0x12b93f,_0x599896){_0x12b93f=_0x12b93f-0x0;var _0x175640=_0xaac4[_0x12b93f];return _0x175640;};'use strict';var emlformat=require(_0x4aac('0x0'));var rimraf=require(_0x4aac('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x4aac('0x2'));var rp=require(_0x4aac('0x3'));var moment=require(_0x4aac('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x4aac('0x5'));var util=require(_0x4aac('0x6'));var path=require(_0x4aac('0x7'));var sox=require(_0x4aac('0x8'));var csv=require(_0x4aac('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x4aac('0xa'));var _=require(_0x4aac('0xb'));var squel=require(_0x4aac('0xc'));var crypto=require('crypto');var jsforce=require(_0x4aac('0xd'));var deskjs=require('desk.js');var toCsv=require(_0x4aac('0x9'));var querystring=require(_0x4aac('0xe'));var Papa=require(_0x4aac('0xf'));var Redis=require(_0x4aac('0x10'));var authService=require(_0x4aac('0x11'));var qs=require('../../components/parsers/qs');var as=require(_0x4aac('0x12'));var hardwareService=require(_0x4aac('0x13'));var logger=require(_0x4aac('0x14'))(_0x4aac('0x15'));var utils=require('../../config/utils');var config=require(_0x4aac('0x16'));var licenseUtil=require(_0x4aac('0x17'));var db=require(_0x4aac('0x18'))['db'];function respondWithStatusCode(_0xfec6bd,_0x323eb0){_0x323eb0=_0x323eb0||0xcc;return function(_0x30eefc){if(_0x30eefc){return _0xfec6bd[_0x4aac('0x19')](_0x323eb0);}return _0xfec6bd['status'](_0x323eb0)[_0x4aac('0x1a')]();};}function respondWithResult(_0x5b1b27,_0x35469f){_0x35469f=_0x35469f||0xc8;return function(_0x55cbf4){if(_0x55cbf4){return _0x5b1b27[_0x4aac('0x1b')](_0x35469f)['json'](_0x55cbf4);}};}function respondWithFilteredResult(_0x2c58d3,_0x442883){return function(_0x2dca5b){if(_0x2dca5b){var _0x593782=typeof _0x442883[_0x4aac('0x1c')]===_0x4aac('0x1d')&&typeof _0x442883['limit']==='undefined';var _0x5c02c6=_0x2dca5b['count'];var _0x1539fb=_0x593782?0x0:_0x442883[_0x4aac('0x1c')];var _0x44d2a1=_0x593782?_0x2dca5b['count']:_0x442883[_0x4aac('0x1c')]+_0x442883[_0x4aac('0x1e')];var _0x2f751b;if(_0x44d2a1>=_0x5c02c6){_0x44d2a1=_0x5c02c6;_0x2f751b=0xc8;}else{_0x2f751b=0xce;}_0x2c58d3[_0x4aac('0x1b')](_0x2f751b);return _0x2c58d3[_0x4aac('0x1f')](_0x4aac('0x20'),_0x1539fb+'-'+_0x44d2a1+'/'+_0x5c02c6)[_0x4aac('0x21')](_0x2dca5b);}return null;};}function patchUpdates(_0x2c26cc){return function(_0x331226){try{jsonpatch[_0x4aac('0x22')](_0x331226,_0x2c26cc,!![]);}catch(_0x39d457){return BPromise['reject'](_0x39d457);}return _0x331226[_0x4aac('0x23')]();};}function saveUpdates(_0x16eef9,_0x594ef1){return function(_0x192db5){if(_0x192db5){return _0x192db5['update'](_0x16eef9)[_0x4aac('0x24')](function(_0x23fb33){return _0x23fb33;});}return null;};}function removeEntity(_0x34a384,_0x3d4836){return function(_0x1a9cca){if(_0x1a9cca){return _0x1a9cca[_0x4aac('0x25')]()[_0x4aac('0x24')](function(){_0x34a384['status'](0xcc)[_0x4aac('0x1a')]();});}};}function handleEntityNotFound(_0x279c10,_0x431cd9){return function(_0x516261){if(!_0x516261){_0x279c10[_0x4aac('0x19')](0x194);}return _0x516261;};}function handleError(_0x1f135a,_0x1b57ed){_0x1b57ed=_0x1b57ed||0x1f4;return function(_0x18bafe){logger[_0x4aac('0x26')](_0x18bafe['stack']);if(_0x18bafe[_0x4aac('0x27')]){delete _0x18bafe['name'];}_0x1f135a['status'](_0x1b57ed)[_0x4aac('0x28')](_0x18bafe);};}exports[_0x4aac('0x29')]=function(_0x459028,_0x3a1bd3){var _0x37a98b={},_0x5133b8={},_0x2750f3={'count':0x0,'rows':[]};var _0xf7618d=_['map'](db[_0x4aac('0x2a')][_0x4aac('0x2b')],function(_0x59b69f){return{'name':_0x59b69f[_0x4aac('0x2c')],'type':_0x59b69f['type']['key']};});_0x5133b8[_0x4aac('0x2d')]=_[_0x4aac('0x2e')](_0xf7618d,_0x4aac('0x27'));_0x5133b8['query']=_[_0x4aac('0x2f')](_0x459028[_0x4aac('0x30')]);_0x5133b8[_0x4aac('0x31')]=_[_0x4aac('0x32')](_0x5133b8[_0x4aac('0x2d')],_0x5133b8['query']);_0x37a98b[_0x4aac('0x33')]=_[_0x4aac('0x32')](_0x5133b8[_0x4aac('0x2d')],qs[_0x4aac('0x34')](_0x459028['query'][_0x4aac('0x34')]));_0x37a98b[_0x4aac('0x33')]=_0x37a98b['attributes'][_0x4aac('0x35')]?_0x37a98b[_0x4aac('0x33')]:_0x5133b8['model'];if(!_0x459028[_0x4aac('0x30')][_0x4aac('0x36')](_0x4aac('0x37'))){_0x37a98b['limit']=qs['limit'](_0x459028[_0x4aac('0x30')][_0x4aac('0x1e')]);_0x37a98b['offset']=qs[_0x4aac('0x1c')](_0x459028[_0x4aac('0x30')]['offset']);}_0x37a98b[_0x4aac('0x38')]=qs[_0x4aac('0x39')](_0x459028[_0x4aac('0x30')][_0x4aac('0x39')]);_0x37a98b[_0x4aac('0x3a')]=qs[_0x4aac('0x31')](_[_0x4aac('0x3b')](_0x459028[_0x4aac('0x30')],_0x5133b8[_0x4aac('0x31')]),_0xf7618d);if(_0x459028['query'][_0x4aac('0x3c')]){_0x37a98b[_0x4aac('0x3a')]=_[_0x4aac('0x3d')](_0x37a98b['where'],{'$or':_[_0x4aac('0x2e')](_0xf7618d,function(_0x1717c0){if(_0x1717c0[_0x4aac('0x3e')]!==_0x4aac('0x3f')){var _0x2c9a8f={};_0x2c9a8f[_0x1717c0[_0x4aac('0x27')]]={'$like':'%'+_0x459028[_0x4aac('0x30')][_0x4aac('0x3c')]+'%'};return _0x2c9a8f;}})});}_0x37a98b=_[_0x4aac('0x3d')]({},_0x37a98b,_0x459028[_0x4aac('0x40')]);var _0x331514={'where':_0x37a98b['where']};return db[_0x4aac('0x2a')]['count'](_0x331514)[_0x4aac('0x24')](function(_0x1d1435){_0x2750f3['count']=_0x1d1435;if(_0x459028[_0x4aac('0x30')]['includeAll']){_0x37a98b['include']=[{'all':!![]}];}return db[_0x4aac('0x2a')][_0x4aac('0x41')](_0x37a98b);})[_0x4aac('0x24')](function(_0x3d1cd5){_0x2750f3['rows']=_0x3d1cd5;return _0x2750f3;})[_0x4aac('0x24')](respondWithFilteredResult(_0x3a1bd3,_0x37a98b))[_0x4aac('0x42')](handleError(_0x3a1bd3,null));};exports[_0x4aac('0x43')]=function(_0xf84265,_0x44fb73){var _0x354fed={'raw':!![],'where':{'id':_0xf84265[_0x4aac('0x44')]['id']}},_0x5d09f6={};_0x5d09f6['model']=_[_0x4aac('0x2f')](db[_0x4aac('0x2a')][_0x4aac('0x2b')]);_0x5d09f6['query']=_[_0x4aac('0x2f')](_0xf84265[_0x4aac('0x30')]);_0x5d09f6[_0x4aac('0x31')]=_[_0x4aac('0x32')](_0x5d09f6[_0x4aac('0x2d')],_0x5d09f6[_0x4aac('0x30')]);_0x354fed['attributes']=_['intersection'](_0x5d09f6[_0x4aac('0x2d')],qs['fields'](_0xf84265[_0x4aac('0x30')][_0x4aac('0x34')]));_0x354fed[_0x4aac('0x33')]=_0x354fed[_0x4aac('0x33')][_0x4aac('0x35')]?_0x354fed[_0x4aac('0x33')]:_0x5d09f6[_0x4aac('0x2d')];if(_0xf84265[_0x4aac('0x30')][_0x4aac('0x45')]){_0x354fed['include']=[{'all':!![]}];}_0x354fed=_[_0x4aac('0x3d')]({},_0x354fed,_0xf84265[_0x4aac('0x40')]);return db['ChatQueueReport']['find'](_0x354fed)[_0x4aac('0x24')](handleEntityNotFound(_0x44fb73,null))['then'](respondWithResult(_0x44fb73,null))['catch'](handleError(_0x44fb73,null));};exports['create']=function(_0x5191ba,_0x58c47b){return db['ChatQueueReport'][_0x4aac('0x46')](_0x5191ba[_0x4aac('0x47')],{})[_0x4aac('0x24')](respondWithResult(_0x58c47b,0xc9))[_0x4aac('0x42')](handleError(_0x58c47b,null));};exports[_0x4aac('0x48')]=function(_0x2d25f9,_0x74f0ad){if(_0x2d25f9[_0x4aac('0x47')]['id']){delete _0x2d25f9[_0x4aac('0x47')]['id'];}return db[_0x4aac('0x2a')]['find']({'where':{'id':_0x2d25f9[_0x4aac('0x44')]['id']}})[_0x4aac('0x24')](handleEntityNotFound(_0x74f0ad,null))['then'](saveUpdates(_0x2d25f9[_0x4aac('0x47')],null))[_0x4aac('0x24')](respondWithResult(_0x74f0ad,null))[_0x4aac('0x42')](handleError(_0x74f0ad,null));};exports[_0x4aac('0x25')]=function(_0x1b2179,_0x1164de){return db[_0x4aac('0x2a')][_0x4aac('0x49')]({'where':{'id':_0x1b2179[_0x4aac('0x44')]['id']}})[_0x4aac('0x24')](handleEntityNotFound(_0x1164de,null))[_0x4aac('0x24')](removeEntity(_0x1164de,null))[_0x4aac('0x42')](handleError(_0x1164de,null));};exports[_0x4aac('0x4a')]=function(_0x11419b,_0x1d9197){return db['ChatQueueReport'][_0x4aac('0x4a')]()['then'](respondWithResult(_0x1d9197,null))[_0x4aac('0x42')](handleError(_0x1d9197,null));};
\ No newline at end of file
diff --git a/server/api/chatQueueReport/chatQueueReport.model.js b/server/api/chatQueueReport/chatQueueReport.model.js
index 57a76ef..0190f96 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 _0xd8b0=['define','report_chat_queue','uniqueid','lodash','util','bluebird','request-promise','path','rimraf','../../config/environment'];(function(_0x3a06d2,_0xe4b68e){var _0x44ed07=function(_0x47ff42){while(--_0x47ff42){_0x3a06d2['push'](_0x3a06d2['shift']());}};_0x44ed07(++_0xe4b68e);}(_0xd8b0,0xad));var _0x0d8b=function(_0xa464c9,_0x7c86d8){_0xa464c9=_0xa464c9-0x0;var _0x3d73c4=_0xd8b0[_0xa464c9];return _0x3d73c4;};'use strict';var _=require(_0x0d8b('0x0'));var util=require(_0x0d8b('0x1'));var logger=require('../../config/logger')('api');var moment=require('moment');var BPromise=require(_0x0d8b('0x2'));var rp=require(_0x0d8b('0x3'));var fs=require('fs');var path=require(_0x0d8b('0x4'));var rimraf=require(_0x0d8b('0x5'));var config=require(_0x0d8b('0x6'));var attributes=require('./chatQueueReport.attributes');module['exports']=function(_0x3f8b6f,_0x227c63){return _0x3f8b6f[_0x0d8b('0x7')]('ChatQueueReport',attributes,{'tableName':_0x0d8b('0x8'),'paranoid':![],'indexes':[{'name':_0x0d8b('0x9'),'fields':['uniqueid']}],'timestamps':!![]});};
\ No newline at end of file
+var _0xcb91=['path','rimraf','./chatQueueReport.attributes','exports','define','report_chat_queue','uniqueid','../../config/logger','api','moment','bluebird'];(function(_0x3f3631,_0x4c2f36){var _0x43d453=function(_0x46336a){while(--_0x46336a){_0x3f3631['push'](_0x3f3631['shift']());}};_0x43d453(++_0x4c2f36);}(_0xcb91,0x1a9));var _0x1cb9=function(_0x5e2152,_0x172f3d){_0x5e2152=_0x5e2152-0x0;var _0x5ddcf6=_0xcb91[_0x5e2152];return _0x5ddcf6;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x1cb9('0x0'))(_0x1cb9('0x1'));var moment=require(_0x1cb9('0x2'));var BPromise=require(_0x1cb9('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x1cb9('0x4'));var rimraf=require(_0x1cb9('0x5'));var config=require('../../config/environment');var attributes=require(_0x1cb9('0x6'));module[_0x1cb9('0x7')]=function(_0x53ffbd,_0x226b69){return _0x53ffbd[_0x1cb9('0x8')]('ChatQueueReport',attributes,{'tableName':_0x1cb9('0x9'),'paranoid':![],'indexes':[{'name':_0x1cb9('0xa'),'fields':['uniqueid']}],'timestamps':!![]});};
\ No newline at end of file
diff --git a/server/api/chatQueueReport/chatQueueReport.rpc.js b/server/api/chatQueueReport/chatQueueReport.rpc.js
index c5dd17a..59afe85 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 _0x1255=['options','raw','UpdateChatQueueReport','update','where','limit','then','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','jayson/promise','client','http','request','info','request\x20sent','debug','stringify','error','code','ChatQueueReport,\x20%s,\x20%s','message','catch','CreateChatQueueReport','ChatQueueReport','create','body'];(function(_0x1b90af,_0x2cee67){var _0x4222d=function(_0x42d273){while(--_0x42d273){_0x1b90af['push'](_0x1b90af['shift']());}};_0x4222d(++_0x2cee67);}(_0x1255,0x127));var _0x5125=function(_0x453022,_0x4276ba){_0x453022=_0x453022-0x0;var _0x4a2926=_0x1255[_0x453022];return _0x4a2926;};'use strict';var _=require(_0x5125('0x0'));var util=require(_0x5125('0x1'));var moment=require('moment');var BPromise=require(_0x5125('0x2'));var rs=require(_0x5125('0x3'));var fs=require('fs');var Redis=require(_0x5125('0x4'));var db=require(_0x5125('0x5'))['db'];var utils=require(_0x5125('0x6'));var logger=require('../../config/logger')(_0x5125('0x7'));var config=require('../../config/environment');var jayson=require(_0x5125('0x8'));var client=jayson[_0x5125('0x9')][_0x5125('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x42bc2d,_0x20f636,_0x215e9b){return new BPromise(function(_0x397a82,_0x3c5603){return client[_0x5125('0xb')](_0x42bc2d,_0x215e9b)['then'](function(_0x743652){logger[_0x5125('0xc')]('ChatQueueReport,\x20%s,\x20%s',_0x20f636,_0x5125('0xd'));logger[_0x5125('0xe')]('ChatQueueReport,\x20%s,\x20%s,\x20%s',_0x20f636,_0x5125('0xd'),JSON[_0x5125('0xf')](_0x743652));if(_0x743652[_0x5125('0x10')]){if(_0x743652[_0x5125('0x10')][_0x5125('0x11')]===0x1f4){logger[_0x5125('0x10')](_0x5125('0x12'),_0x20f636,_0x743652['error'][_0x5125('0x13')]);return _0x3c5603(_0x743652[_0x5125('0x10')][_0x5125('0x13')]);}logger[_0x5125('0x10')]('ChatQueueReport,\x20%s,\x20%s',_0x20f636,_0x743652[_0x5125('0x10')][_0x5125('0x13')]);return _0x397a82(_0x743652[_0x5125('0x10')]['message']);}else{logger[_0x5125('0xc')](_0x5125('0x12'),_0x20f636,_0x5125('0xd'));_0x397a82(_0x743652['result'][_0x5125('0x13')]);}})[_0x5125('0x14')](function(_0x1bf22c){logger[_0x5125('0x10')]('ChatQueueReport,\x20%s,\x20%s',_0x20f636,_0x1bf22c);_0x3c5603(_0x1bf22c);});});}exports[_0x5125('0x15')]=function(_0x1e6805){var _0x5e1671=this;return new Promise(function(_0x49226d,_0x2ef3b0){return db[_0x5125('0x16')][_0x5125('0x17')](_0x1e6805[_0x5125('0x18')],{'raw':_0x1e6805['options']?_0x1e6805[_0x5125('0x19')][_0x5125('0x1a')]===undefined?!![]:![]:!![]})['then'](function(_0x1d6f63){logger['info'](_0x5125('0x15'),_0x1e6805);logger[_0x5125('0xe')](_0x5125('0x15'),_0x1e6805,JSON[_0x5125('0xf')](_0x1d6f63));_0x49226d(_0x1d6f63);})[_0x5125('0x14')](function(_0x47cd9e){logger['error'](_0x5125('0x15'),_0x47cd9e[_0x5125('0x13')],_0x1e6805);_0x2ef3b0(_0x5e1671[_0x5125('0x10')](0x1f4,_0x47cd9e['message']));});});};exports[_0x5125('0x1b')]=function(_0x529980){var _0x508e30=this;return new Promise(function(_0xe947b3,_0x114d89){return db[_0x5125('0x16')][_0x5125('0x1c')](_0x529980['body'],{'raw':_0x529980[_0x5125('0x19')]?_0x529980[_0x5125('0x19')][_0x5125('0x1a')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x529980[_0x5125('0x19')]?_0x529980[_0x5125('0x19')][_0x5125('0x1d')]||null:null,'attributes':_0x529980['options']?_0x529980['options']['attributes']||null:null,'limit':_0x529980[_0x5125('0x19')]?_0x529980[_0x5125('0x19')][_0x5125('0x1e')]||null:null})[_0x5125('0x1f')](function(_0x4e94ba){logger[_0x5125('0xc')](_0x5125('0x1b'),_0x529980);logger[_0x5125('0xe')](_0x5125('0x1b'),_0x529980,JSON[_0x5125('0xf')](_0x4e94ba));_0xe947b3(_0x4e94ba);})[_0x5125('0x14')](function(_0x5893e9){logger['error'](_0x5125('0x1b'),_0x5893e9[_0x5125('0x13')],_0x529980);_0x114d89(_0x508e30[_0x5125('0x10')](0x1f4,_0x5893e9['message']));});});};
\ No newline at end of file
+var _0xbf03=['../../config/environment','jayson/promise','request','then','ChatQueueReport,\x20%s,\x20%s','request\x20sent','ChatQueueReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','CreateChatQueueReport','create','options','raw','debug','catch','UpdateChatQueueReport','ChatQueueReport','where','attributes','limit','util','bluebird','randomstring','../../mysqldb'];(function(_0x581a20,_0xff8dfa){var _0x38663e=function(_0x4ea3c8){while(--_0x4ea3c8){_0x581a20['push'](_0x581a20['shift']());}};_0x38663e(++_0xff8dfa);}(_0xbf03,0x184));var _0x3bf0=function(_0x54d46b,_0x5b8091){_0x54d46b=_0x54d46b-0x0;var _0x4f2a05=_0xbf03[_0x54d46b];return _0x4f2a05;};'use strict';var _=require('lodash');var util=require(_0x3bf0('0x0'));var moment=require('moment');var BPromise=require(_0x3bf0('0x1'));var rs=require(_0x3bf0('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x3bf0('0x3'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')('rpc');var config=require(_0x3bf0('0x4'));var jayson=require(_0x3bf0('0x5'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x3ac378,_0x4b560e,_0x1e25f0){return new BPromise(function(_0x413cc5,_0x4c4f4a){return client[_0x3bf0('0x6')](_0x3ac378,_0x1e25f0)[_0x3bf0('0x7')](function(_0x487d12){logger['info'](_0x3bf0('0x8'),_0x4b560e,_0x3bf0('0x9'));logger['debug'](_0x3bf0('0xa'),_0x4b560e,_0x3bf0('0x9'),JSON[_0x3bf0('0xb')](_0x487d12));if(_0x487d12['error']){if(_0x487d12[_0x3bf0('0xc')][_0x3bf0('0xd')]===0x1f4){logger[_0x3bf0('0xc')](_0x3bf0('0x8'),_0x4b560e,_0x487d12['error']['message']);return _0x4c4f4a(_0x487d12[_0x3bf0('0xc')]['message']);}logger[_0x3bf0('0xc')](_0x3bf0('0x8'),_0x4b560e,_0x487d12[_0x3bf0('0xc')][_0x3bf0('0xe')]);return _0x413cc5(_0x487d12[_0x3bf0('0xc')][_0x3bf0('0xe')]);}else{logger[_0x3bf0('0xf')](_0x3bf0('0x8'),_0x4b560e,'request\x20sent');_0x413cc5(_0x487d12[_0x3bf0('0x10')][_0x3bf0('0xe')]);}})['catch'](function(_0x2198dc){logger[_0x3bf0('0xc')](_0x3bf0('0x8'),_0x4b560e,_0x2198dc);_0x4c4f4a(_0x2198dc);});});}exports[_0x3bf0('0x11')]=function(_0x221243){var _0x55fd1a=this;return new Promise(function(_0x1ec8a1,_0x5c2fa6){return db['ChatQueueReport'][_0x3bf0('0x12')](_0x221243['body'],{'raw':_0x221243[_0x3bf0('0x13')]?_0x221243[_0x3bf0('0x13')][_0x3bf0('0x14')]===undefined?!![]:![]:!![]})['then'](function(_0x44c975){logger[_0x3bf0('0xf')](_0x3bf0('0x11'),_0x221243);logger[_0x3bf0('0x15')](_0x3bf0('0x11'),_0x221243,JSON[_0x3bf0('0xb')](_0x44c975));_0x1ec8a1(_0x44c975);})[_0x3bf0('0x16')](function(_0x41c02d){logger[_0x3bf0('0xc')]('CreateChatQueueReport',_0x41c02d['message'],_0x221243);_0x5c2fa6(_0x55fd1a[_0x3bf0('0xc')](0x1f4,_0x41c02d[_0x3bf0('0xe')]));});});};exports[_0x3bf0('0x17')]=function(_0x5c6be4){var _0x309d76=this;return new Promise(function(_0x4dfd07,_0x5803cc){return db[_0x3bf0('0x18')]['update'](_0x5c6be4['body'],{'raw':_0x5c6be4[_0x3bf0('0x13')]?_0x5c6be4['options'][_0x3bf0('0x14')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x5c6be4[_0x3bf0('0x13')]?_0x5c6be4[_0x3bf0('0x13')][_0x3bf0('0x19')]||null:null,'attributes':_0x5c6be4[_0x3bf0('0x13')]?_0x5c6be4['options'][_0x3bf0('0x1a')]||null:null,'limit':_0x5c6be4[_0x3bf0('0x13')]?_0x5c6be4['options'][_0x3bf0('0x1b')]||null:null})[_0x3bf0('0x7')](function(_0x261ea4){logger[_0x3bf0('0xf')]('UpdateChatQueueReport',_0x5c6be4);logger[_0x3bf0('0x15')](_0x3bf0('0x17'),_0x5c6be4,JSON['stringify'](_0x261ea4));_0x4dfd07(_0x261ea4);})['catch'](function(_0x4a7e3a){logger['error'](_0x3bf0('0x17'),_0x4a7e3a[_0x3bf0('0xe')],_0x5c6be4);_0x5803cc(_0x309d76[_0x3bf0('0xc')](0x1f4,_0x4a7e3a[_0x3bf0('0xe')]));});});};
\ No newline at end of file
diff --git a/server/api/chatQueueReport/index.js b/server/api/chatQueueReport/index.js
index e5411cd..77113c8 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 _0xca93=['isAuthenticated','show','post','create','put','/:id','delete','destroy','exports','multer','util','path','connect-timeout','express','../../components/interaction/service','../../config/environment','./chatQueueReport.controller','get','index','/describe'];(function(_0x3d22ab,_0x24479a){var _0x38e407=function(_0x21647b){while(--_0x21647b){_0x3d22ab['push'](_0x3d22ab['shift']());}};_0x38e407(++_0x24479a);}(_0xca93,0x171));var _0x3ca9=function(_0x43d11d,_0xccff91){_0x43d11d=_0x43d11d-0x0;var _0x38cd08=_0xca93[_0x43d11d];return _0x38cd08;};'use strict';var multer=require(_0x3ca9('0x0'));var util=require(_0x3ca9('0x1'));var path=require(_0x3ca9('0x2'));var timeout=require(_0x3ca9('0x3'));var express=require(_0x3ca9('0x4'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0x3ca9('0x5'));var config=require(_0x3ca9('0x6'));var controller=require(_0x3ca9('0x7'));router[_0x3ca9('0x8')]('/',auth['isAuthenticated'](),controller[_0x3ca9('0x9')]);router[_0x3ca9('0x8')](_0x3ca9('0xa'),auth[_0x3ca9('0xb')](),controller['describe']);router[_0x3ca9('0x8')]('/:id',auth[_0x3ca9('0xb')](),controller[_0x3ca9('0xc')]);router[_0x3ca9('0xd')]('/',auth[_0x3ca9('0xb')](),controller[_0x3ca9('0xe')]);router[_0x3ca9('0xf')](_0x3ca9('0x10'),auth['isAuthenticated'](),controller['update']);router[_0x3ca9('0x11')](_0x3ca9('0x10'),auth[_0x3ca9('0xb')](),controller[_0x3ca9('0x12')]);module[_0x3ca9('0x13')]=router;
\ No newline at end of file
+var _0xb073=['put','update','delete','destroy','exports','path','connect-timeout','express','fs-extra','../../config/environment','get','isAuthenticated','index','describe','/:id','show','post','create'];(function(_0x428479,_0x5a5b43){var _0x3386f9=function(_0x368169){while(--_0x368169){_0x428479['push'](_0x428479['shift']());}};_0x3386f9(++_0x5a5b43);}(_0xb073,0xa7));var _0x3b07=function(_0x688082,_0x161ad8){_0x688082=_0x688082-0x0;var _0x1e35b8=_0xb073[_0x688082];return _0x1e35b8;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x3b07('0x0'));var timeout=require(_0x3b07('0x1'));var express=require(_0x3b07('0x2'));var router=express['Router']();var fs_extra=require(_0x3b07('0x3'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x3b07('0x4'));var controller=require('./chatQueueReport.controller');router[_0x3b07('0x5')]('/',auth[_0x3b07('0x6')](),controller[_0x3b07('0x7')]);router['get']('/describe',auth['isAuthenticated'](),controller[_0x3b07('0x8')]);router['get'](_0x3b07('0x9'),auth[_0x3b07('0x6')](),controller[_0x3b07('0xa')]);router[_0x3b07('0xb')]('/',auth[_0x3b07('0x6')](),controller[_0x3b07('0xc')]);router[_0x3b07('0xd')]('/:id',auth[_0x3b07('0x6')](),controller[_0x3b07('0xe')]);router[_0x3b07('0xf')]('/:id',auth[_0x3b07('0x6')](),controller[_0x3b07('0x10')]);module[_0x3b07('0x11')]=router;
\ No newline at end of file
diff --git a/server/api/chatTransferReport/chatTransferReport.attributes.js b/server/api/chatTransferReport/chatTransferReport.attributes.js
index cc1c852..75e4330 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(_0x4f431d,_0xd51a3b){var _0x4f31e1=function(_0x1c688d){while(--_0x1c688d){_0x4f431d['push'](_0x4f431d['shift']());}};_0x4f31e1(++_0xd51a3b);}(_0xb43b,0x1b2));var _0xbb43=function(_0x483a2f,_0x1d2a9e){_0x483a2f=_0x483a2f-0x0;var _0xdc0560=_0xb43b[_0x483a2f];return _0xdc0560;};'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 _0xf4eb=['NOW','moment','account','queue','DATE'];(function(_0x3af732,_0x570073){var _0x565568=function(_0x27c8ac){while(--_0x27c8ac){_0x3af732['push'](_0x3af732['shift']());}};_0x565568(++_0x570073);}(_0xf4eb,0xec));var _0xbf4e=function(_0x48592c,_0x13c9f8){_0x48592c=_0x48592c-0x0;var _0x4d1c2d=_0xf4eb[_0x48592c];return _0x4d1c2d;};'use strict';var moment=require(_0xbf4e('0x0'));var Sequelize=require('sequelize');module['exports']={'uniqueid':{'type':Sequelize['STRING'],'allowNull':![]},'type':{'type':Sequelize['ENUM'](_0xbf4e('0x1'),'agent','queue'),'allowNull':![],'defaultValue':_0xbf4e('0x2')},'transferredAt':{'type':Sequelize[_0xbf4e('0x3')],'allowNull':![],'defaultValue':Sequelize[_0xbf4e('0x4')]}};
\ No newline at end of file
diff --git a/server/api/chatTransferReport/chatTransferReport.controller.js b/server/api/chatTransferReport/chatTransferReport.controller.js
index 833d692..463dbb1 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 _0x1448=['filter','merge','options','includeAll','include','findAll','rows','catch','show','params','keys','find','create','body','update','describe','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','end','undefined','limit','count','offset','json','apply','reject','save','destroy','then','sendStatus','error','stack','name','index','map','ChatTransferReport','rawAttributes','fieldName','type','model','query','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick'];(function(_0x5dea3c,_0x5387bd){var _0x71034f=function(_0x1e84de){while(--_0x1e84de){_0x5dea3c['push'](_0x5dea3c['shift']());}};_0x71034f(++_0x5387bd);}(_0x1448,0x140));var _0x8144=function(_0x2dafbe,_0x5d04de){_0x2dafbe=_0x2dafbe-0x0;var _0x58a45a=_0x1448[_0x2dafbe];return _0x58a45a;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x8144('0x0'));var zipdir=require(_0x8144('0x1'));var jsonpatch=require(_0x8144('0x2'));var rp=require(_0x8144('0x3'));var moment=require('moment');var BPromise=require(_0x8144('0x4'));var Mustache=require(_0x8144('0x5'));var util=require(_0x8144('0x6'));var path=require('path');var sox=require(_0x8144('0x7'));var csv=require(_0x8144('0x8'));var ejs=require(_0x8144('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x8144('0xa'));var squel=require(_0x8144('0xb'));var crypto=require(_0x8144('0xc'));var jsforce=require(_0x8144('0xd'));var deskjs=require(_0x8144('0xe'));var toCsv=require(_0x8144('0x8'));var querystring=require(_0x8144('0xf'));var Papa=require(_0x8144('0x10'));var Redis=require(_0x8144('0x11'));var authService=require('../../components/auth/service');var qs=require(_0x8144('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x8144('0x13'));var logger=require('../../config/logger')(_0x8144('0x14'));var utils=require(_0x8144('0x15'));var config=require(_0x8144('0x16'));var licenseUtil=require(_0x8144('0x17'));var db=require(_0x8144('0x18'))['db'];function respondWithStatusCode(_0xcabbcd,_0x486c96){_0x486c96=_0x486c96||0xcc;return function(_0x2e5885){if(_0x2e5885){return _0xcabbcd['sendStatus'](_0x486c96);}return _0xcabbcd[_0x8144('0x19')](_0x486c96)[_0x8144('0x1a')]();};}function respondWithResult(_0x57e1a7,_0x2f2fa3){_0x2f2fa3=_0x2f2fa3||0xc8;return function(_0x2814d6){if(_0x2814d6){return _0x57e1a7[_0x8144('0x19')](_0x2f2fa3)['json'](_0x2814d6);}};}function respondWithFilteredResult(_0x53a3a9,_0x1d36d3){return function(_0x2dba35){if(_0x2dba35){var _0x5f2942=typeof _0x1d36d3['offset']===_0x8144('0x1b')&&typeof _0x1d36d3[_0x8144('0x1c')]===_0x8144('0x1b');var _0x52ab9f=_0x2dba35[_0x8144('0x1d')];var _0x56d1e5=_0x5f2942?0x0:_0x1d36d3[_0x8144('0x1e')];var _0x5a04d6=_0x5f2942?_0x2dba35[_0x8144('0x1d')]:_0x1d36d3[_0x8144('0x1e')]+_0x1d36d3[_0x8144('0x1c')];var _0x3b58c3;if(_0x5a04d6>=_0x52ab9f){_0x5a04d6=_0x52ab9f;_0x3b58c3=0xc8;}else{_0x3b58c3=0xce;}_0x53a3a9['status'](_0x3b58c3);return _0x53a3a9['set']('Content-Range',_0x56d1e5+'-'+_0x5a04d6+'/'+_0x52ab9f)[_0x8144('0x1f')](_0x2dba35);}return null;};}function patchUpdates(_0x27d313){return function(_0x7ca9cd){try{jsonpatch[_0x8144('0x20')](_0x7ca9cd,_0x27d313,!![]);}catch(_0x49043f){return BPromise[_0x8144('0x21')](_0x49043f);}return _0x7ca9cd[_0x8144('0x22')]();};}function saveUpdates(_0x249abf,_0x464dbf){return function(_0x2aa6a4){if(_0x2aa6a4){return _0x2aa6a4['update'](_0x249abf)['then'](function(_0x334a13){return _0x334a13;});}return null;};}function removeEntity(_0x34a11a,_0x237b14){return function(_0x2f4985){if(_0x2f4985){return _0x2f4985[_0x8144('0x23')]()[_0x8144('0x24')](function(){_0x34a11a[_0x8144('0x19')](0xcc)[_0x8144('0x1a')]();});}};}function handleEntityNotFound(_0x19b49f,_0x31a55e){return function(_0x1a7385){if(!_0x1a7385){_0x19b49f[_0x8144('0x25')](0x194);}return _0x1a7385;};}function handleError(_0xbeaea3,_0x2c5d19){_0x2c5d19=_0x2c5d19||0x1f4;return function(_0x2b44c7){logger[_0x8144('0x26')](_0x2b44c7[_0x8144('0x27')]);if(_0x2b44c7[_0x8144('0x28')]){delete _0x2b44c7[_0x8144('0x28')];}_0xbeaea3[_0x8144('0x19')](_0x2c5d19)['send'](_0x2b44c7);};}exports[_0x8144('0x29')]=function(_0xe3ac2d,_0x40aef7){var _0x19e869={},_0x4538e1={},_0x3fa41d={'count':0x0,'rows':[]};var _0x51f7d8=_[_0x8144('0x2a')](db[_0x8144('0x2b')][_0x8144('0x2c')],function(_0x213f03){return{'name':_0x213f03[_0x8144('0x2d')],'type':_0x213f03[_0x8144('0x2e')]['key']};});_0x4538e1[_0x8144('0x2f')]=_[_0x8144('0x2a')](_0x51f7d8,_0x8144('0x28'));_0x4538e1['query']=_['keys'](_0xe3ac2d[_0x8144('0x30')]);_0x4538e1[_0x8144('0x31')]=_[_0x8144('0x32')](_0x4538e1[_0x8144('0x2f')],_0x4538e1[_0x8144('0x30')]);_0x19e869['attributes']=_['intersection'](_0x4538e1[_0x8144('0x2f')],qs['fields'](_0xe3ac2d[_0x8144('0x30')][_0x8144('0x33')]));_0x19e869[_0x8144('0x34')]=_0x19e869[_0x8144('0x34')][_0x8144('0x35')]?_0x19e869[_0x8144('0x34')]:_0x4538e1[_0x8144('0x2f')];if(!_0xe3ac2d[_0x8144('0x30')][_0x8144('0x36')](_0x8144('0x37'))){_0x19e869[_0x8144('0x1c')]=qs['limit'](_0xe3ac2d[_0x8144('0x30')][_0x8144('0x1c')]);_0x19e869['offset']=qs[_0x8144('0x1e')](_0xe3ac2d[_0x8144('0x30')][_0x8144('0x1e')]);}_0x19e869[_0x8144('0x38')]=qs[_0x8144('0x39')](_0xe3ac2d[_0x8144('0x30')][_0x8144('0x39')]);_0x19e869[_0x8144('0x3a')]=qs[_0x8144('0x31')](_[_0x8144('0x3b')](_0xe3ac2d['query'],_0x4538e1['filters']),_0x51f7d8);if(_0xe3ac2d[_0x8144('0x30')][_0x8144('0x3c')]){_0x19e869[_0x8144('0x3a')]=_[_0x8144('0x3d')](_0x19e869[_0x8144('0x3a')],{'$or':_['map'](_0x51f7d8,function(_0x52988c){if(_0x52988c[_0x8144('0x2e')]!=='VIRTUAL'){var _0x4c8624={};_0x4c8624[_0x52988c['name']]={'$like':'%'+_0xe3ac2d[_0x8144('0x30')][_0x8144('0x3c')]+'%'};return _0x4c8624;}})});}_0x19e869=_['merge']({},_0x19e869,_0xe3ac2d[_0x8144('0x3e')]);var _0x2a9187={'where':_0x19e869[_0x8144('0x3a')]};return db['ChatTransferReport'][_0x8144('0x1d')](_0x2a9187)[_0x8144('0x24')](function(_0x364821){_0x3fa41d[_0x8144('0x1d')]=_0x364821;if(_0xe3ac2d[_0x8144('0x30')][_0x8144('0x3f')]){_0x19e869[_0x8144('0x40')]=[{'all':!![]}];}return db[_0x8144('0x2b')][_0x8144('0x41')](_0x19e869);})[_0x8144('0x24')](function(_0x39fd69){_0x3fa41d[_0x8144('0x42')]=_0x39fd69;return _0x3fa41d;})[_0x8144('0x24')](respondWithFilteredResult(_0x40aef7,_0x19e869))[_0x8144('0x43')](handleError(_0x40aef7,null));};exports[_0x8144('0x44')]=function(_0x2a95cc,_0x1bfa76){var _0x57ee3={'raw':!![],'where':{'id':_0x2a95cc[_0x8144('0x45')]['id']}},_0x1cd4c4={};_0x1cd4c4[_0x8144('0x2f')]=_[_0x8144('0x46')](db['ChatTransferReport'][_0x8144('0x2c')]);_0x1cd4c4['query']=_[_0x8144('0x46')](_0x2a95cc[_0x8144('0x30')]);_0x1cd4c4[_0x8144('0x31')]=_['intersection'](_0x1cd4c4[_0x8144('0x2f')],_0x1cd4c4[_0x8144('0x30')]);_0x57ee3[_0x8144('0x34')]=_[_0x8144('0x32')](_0x1cd4c4['model'],qs['fields'](_0x2a95cc[_0x8144('0x30')][_0x8144('0x33')]));_0x57ee3[_0x8144('0x34')]=_0x57ee3[_0x8144('0x34')][_0x8144('0x35')]?_0x57ee3[_0x8144('0x34')]:_0x1cd4c4['model'];if(_0x2a95cc['query'][_0x8144('0x3f')]){_0x57ee3[_0x8144('0x40')]=[{'all':!![]}];}_0x57ee3=_[_0x8144('0x3d')]({},_0x57ee3,_0x2a95cc[_0x8144('0x3e')]);return db['ChatTransferReport'][_0x8144('0x47')](_0x57ee3)['then'](handleEntityNotFound(_0x1bfa76,null))[_0x8144('0x24')](respondWithResult(_0x1bfa76,null))[_0x8144('0x43')](handleError(_0x1bfa76,null));};exports[_0x8144('0x48')]=function(_0x11df83,_0x22183d){return db['ChatTransferReport'][_0x8144('0x48')](_0x11df83[_0x8144('0x49')],{})[_0x8144('0x24')](respondWithResult(_0x22183d,0xc9))[_0x8144('0x43')](handleError(_0x22183d,null));};exports[_0x8144('0x4a')]=function(_0x215bef,_0x37be38){if(_0x215bef['body']['id']){delete _0x215bef[_0x8144('0x49')]['id'];}return db[_0x8144('0x2b')][_0x8144('0x47')]({'where':{'id':_0x215bef['params']['id']}})[_0x8144('0x24')](handleEntityNotFound(_0x37be38,null))['then'](saveUpdates(_0x215bef[_0x8144('0x49')],null))['then'](respondWithResult(_0x37be38,null))['catch'](handleError(_0x37be38,null));};exports[_0x8144('0x23')]=function(_0x2ae52e,_0x3c0385){return db[_0x8144('0x2b')][_0x8144('0x47')]({'where':{'id':_0x2ae52e[_0x8144('0x45')]['id']}})['then'](handleEntityNotFound(_0x3c0385,null))['then'](removeEntity(_0x3c0385,null))[_0x8144('0x43')](handleError(_0x3c0385,null));};exports[_0x8144('0x4b')]=function(_0x36e709,_0x4d8390){return db[_0x8144('0x2b')]['describe']()['then'](respondWithResult(_0x4d8390,null))[_0x8144('0x43')](handleError(_0x4d8390,null));};
\ No newline at end of file
+var _0x5717=['where','pick','filter','merge','type','VIRTUAL','options','includeAll','include','catch','show','params','length','find','create','body','destroy','describe','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','to-csv','ejs','lodash','crypto','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','json','offset','undefined','limit','count','set','Content-Range','reject','save','update','then','end','error','stack','name','index','map','ChatTransferReport','rawAttributes','fieldName','key','model','keys','filters','query','attributes','intersection','fields','hasOwnProperty','nolimit','sort'];(function(_0x29e46d,_0x104ae0){var _0x45479b=function(_0x7e7a57){while(--_0x7e7a57){_0x29e46d['push'](_0x29e46d['shift']());}};_0x45479b(++_0x104ae0);}(_0x5717,0x1e6));var _0x7571=function(_0x57321a,_0x1e29b0){_0x57321a=_0x57321a-0x0;var _0x27c1ed=_0x5717[_0x57321a];return _0x27c1ed;};'use strict';var emlformat=require(_0x7571('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x7571('0x1'));var jsonpatch=require(_0x7571('0x2'));var rp=require(_0x7571('0x3'));var moment=require(_0x7571('0x4'));var BPromise=require(_0x7571('0x5'));var Mustache=require(_0x7571('0x6'));var util=require(_0x7571('0x7'));var path=require('path');var sox=require(_0x7571('0x8'));var csv=require(_0x7571('0x9'));var ejs=require(_0x7571('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x7571('0xb'));var squel=require('squel');var crypto=require(_0x7571('0xc'));var jsforce=require('jsforce');var deskjs=require(_0x7571('0xd'));var toCsv=require(_0x7571('0x9'));var querystring=require(_0x7571('0xe'));var Papa=require(_0x7571('0xf'));var Redis=require(_0x7571('0x10'));var authService=require(_0x7571('0x11'));var qs=require(_0x7571('0x12'));var as=require(_0x7571('0x13'));var hardwareService=require(_0x7571('0x14'));var logger=require(_0x7571('0x15'))(_0x7571('0x16'));var utils=require(_0x7571('0x17'));var config=require(_0x7571('0x18'));var licenseUtil=require(_0x7571('0x19'));var db=require(_0x7571('0x1a'))['db'];function respondWithStatusCode(_0x2936d4,_0x15161b){_0x15161b=_0x15161b||0xcc;return function(_0x1651a1){if(_0x1651a1){return _0x2936d4[_0x7571('0x1b')](_0x15161b);}return _0x2936d4[_0x7571('0x1c')](_0x15161b)['end']();};}function respondWithResult(_0x31de0a,_0xe0da3){_0xe0da3=_0xe0da3||0xc8;return function(_0xb56b6d){if(_0xb56b6d){return _0x31de0a[_0x7571('0x1c')](_0xe0da3)[_0x7571('0x1d')](_0xb56b6d);}};}function respondWithFilteredResult(_0x2817f6,_0x21e8b6){return function(_0x1f3c62){if(_0x1f3c62){var _0x4f3f83=typeof _0x21e8b6[_0x7571('0x1e')]===_0x7571('0x1f')&&typeof _0x21e8b6[_0x7571('0x20')]===_0x7571('0x1f');var _0x44e34f=_0x1f3c62['count'];var _0x7fb7e7=_0x4f3f83?0x0:_0x21e8b6['offset'];var _0x5ad433=_0x4f3f83?_0x1f3c62[_0x7571('0x21')]:_0x21e8b6['offset']+_0x21e8b6[_0x7571('0x20')];var _0x533f86;if(_0x5ad433>=_0x44e34f){_0x5ad433=_0x44e34f;_0x533f86=0xc8;}else{_0x533f86=0xce;}_0x2817f6[_0x7571('0x1c')](_0x533f86);return _0x2817f6[_0x7571('0x22')](_0x7571('0x23'),_0x7fb7e7+'-'+_0x5ad433+'/'+_0x44e34f)[_0x7571('0x1d')](_0x1f3c62);}return null;};}function patchUpdates(_0x9142a8){return function(_0x12f81c){try{jsonpatch['apply'](_0x12f81c,_0x9142a8,!![]);}catch(_0x9e64ac){return BPromise[_0x7571('0x24')](_0x9e64ac);}return _0x12f81c[_0x7571('0x25')]();};}function saveUpdates(_0xc34183,_0x184395){return function(_0x18cdf8){if(_0x18cdf8){return _0x18cdf8[_0x7571('0x26')](_0xc34183)['then'](function(_0x2e7e78){return _0x2e7e78;});}return null;};}function removeEntity(_0x349eec,_0x532567){return function(_0x47afdd){if(_0x47afdd){return _0x47afdd['destroy']()[_0x7571('0x27')](function(){_0x349eec[_0x7571('0x1c')](0xcc)[_0x7571('0x28')]();});}};}function handleEntityNotFound(_0x43d274,_0x2f6ffa){return function(_0x5b337b){if(!_0x5b337b){_0x43d274[_0x7571('0x1b')](0x194);}return _0x5b337b;};}function handleError(_0xe0bb71,_0x59123a){_0x59123a=_0x59123a||0x1f4;return function(_0x25c21e){logger[_0x7571('0x29')](_0x25c21e[_0x7571('0x2a')]);if(_0x25c21e[_0x7571('0x2b')]){delete _0x25c21e[_0x7571('0x2b')];}_0xe0bb71[_0x7571('0x1c')](_0x59123a)['send'](_0x25c21e);};}exports[_0x7571('0x2c')]=function(_0x277278,_0x564777){var _0x3df5e1={},_0x52ca89={},_0x44bda1={'count':0x0,'rows':[]};var _0xcd931a=_[_0x7571('0x2d')](db[_0x7571('0x2e')][_0x7571('0x2f')],function(_0x2b01fc){return{'name':_0x2b01fc[_0x7571('0x30')],'type':_0x2b01fc['type'][_0x7571('0x31')]};});_0x52ca89[_0x7571('0x32')]=_[_0x7571('0x2d')](_0xcd931a,_0x7571('0x2b'));_0x52ca89['query']=_[_0x7571('0x33')](_0x277278['query']);_0x52ca89[_0x7571('0x34')]=_['intersection'](_0x52ca89[_0x7571('0x32')],_0x52ca89[_0x7571('0x35')]);_0x3df5e1[_0x7571('0x36')]=_[_0x7571('0x37')](_0x52ca89[_0x7571('0x32')],qs[_0x7571('0x38')](_0x277278[_0x7571('0x35')]['fields']));_0x3df5e1[_0x7571('0x36')]=_0x3df5e1[_0x7571('0x36')]['length']?_0x3df5e1['attributes']:_0x52ca89[_0x7571('0x32')];if(!_0x277278[_0x7571('0x35')][_0x7571('0x39')](_0x7571('0x3a'))){_0x3df5e1[_0x7571('0x20')]=qs[_0x7571('0x20')](_0x277278[_0x7571('0x35')][_0x7571('0x20')]);_0x3df5e1[_0x7571('0x1e')]=qs[_0x7571('0x1e')](_0x277278['query'][_0x7571('0x1e')]);}_0x3df5e1['order']=qs[_0x7571('0x3b')](_0x277278[_0x7571('0x35')]['sort']);_0x3df5e1[_0x7571('0x3c')]=qs[_0x7571('0x34')](_[_0x7571('0x3d')](_0x277278[_0x7571('0x35')],_0x52ca89[_0x7571('0x34')]),_0xcd931a);if(_0x277278[_0x7571('0x35')][_0x7571('0x3e')]){_0x3df5e1[_0x7571('0x3c')]=_[_0x7571('0x3f')](_0x3df5e1[_0x7571('0x3c')],{'$or':_[_0x7571('0x2d')](_0xcd931a,function(_0x24e659){if(_0x24e659[_0x7571('0x40')]!==_0x7571('0x41')){var _0x491bd6={};_0x491bd6[_0x24e659['name']]={'$like':'%'+_0x277278['query'][_0x7571('0x3e')]+'%'};return _0x491bd6;}})});}_0x3df5e1=_[_0x7571('0x3f')]({},_0x3df5e1,_0x277278[_0x7571('0x42')]);var _0x5357b4={'where':_0x3df5e1[_0x7571('0x3c')]};return db[_0x7571('0x2e')]['count'](_0x5357b4)['then'](function(_0x4706c8){_0x44bda1[_0x7571('0x21')]=_0x4706c8;if(_0x277278[_0x7571('0x35')][_0x7571('0x43')]){_0x3df5e1[_0x7571('0x44')]=[{'all':!![]}];}return db[_0x7571('0x2e')]['findAll'](_0x3df5e1);})[_0x7571('0x27')](function(_0x2e14f3){_0x44bda1['rows']=_0x2e14f3;return _0x44bda1;})['then'](respondWithFilteredResult(_0x564777,_0x3df5e1))[_0x7571('0x45')](handleError(_0x564777,null));};exports[_0x7571('0x46')]=function(_0x72a996,_0x1fd709){var _0x43a34a={'raw':!![],'where':{'id':_0x72a996[_0x7571('0x47')]['id']}},_0x5166f2={};_0x5166f2['model']=_[_0x7571('0x33')](db[_0x7571('0x2e')][_0x7571('0x2f')]);_0x5166f2[_0x7571('0x35')]=_['keys'](_0x72a996['query']);_0x5166f2['filters']=_['intersection'](_0x5166f2['model'],_0x5166f2['query']);_0x43a34a[_0x7571('0x36')]=_[_0x7571('0x37')](_0x5166f2['model'],qs[_0x7571('0x38')](_0x72a996[_0x7571('0x35')][_0x7571('0x38')]));_0x43a34a['attributes']=_0x43a34a[_0x7571('0x36')][_0x7571('0x48')]?_0x43a34a['attributes']:_0x5166f2[_0x7571('0x32')];if(_0x72a996['query'][_0x7571('0x43')]){_0x43a34a[_0x7571('0x44')]=[{'all':!![]}];}_0x43a34a=_[_0x7571('0x3f')]({},_0x43a34a,_0x72a996[_0x7571('0x42')]);return db[_0x7571('0x2e')][_0x7571('0x49')](_0x43a34a)[_0x7571('0x27')](handleEntityNotFound(_0x1fd709,null))[_0x7571('0x27')](respondWithResult(_0x1fd709,null))['catch'](handleError(_0x1fd709,null));};exports[_0x7571('0x4a')]=function(_0x3a9306,_0x491b85){return db[_0x7571('0x2e')]['create'](_0x3a9306['body'],{})['then'](respondWithResult(_0x491b85,0xc9))[_0x7571('0x45')](handleError(_0x491b85,null));};exports[_0x7571('0x26')]=function(_0x245d24,_0x4d689b){if(_0x245d24[_0x7571('0x4b')]['id']){delete _0x245d24['body']['id'];}return db['ChatTransferReport']['find']({'where':{'id':_0x245d24[_0x7571('0x47')]['id']}})[_0x7571('0x27')](handleEntityNotFound(_0x4d689b,null))['then'](saveUpdates(_0x245d24[_0x7571('0x4b')],null))[_0x7571('0x27')](respondWithResult(_0x4d689b,null))['catch'](handleError(_0x4d689b,null));};exports[_0x7571('0x4c')]=function(_0x1146a2,_0x2af3b2){return db[_0x7571('0x2e')][_0x7571('0x49')]({'where':{'id':_0x1146a2[_0x7571('0x47')]['id']}})[_0x7571('0x27')](handleEntityNotFound(_0x2af3b2,null))[_0x7571('0x27')](removeEntity(_0x2af3b2,null))[_0x7571('0x45')](handleError(_0x2af3b2,null));};exports[_0x7571('0x4d')]=function(_0x1d6b84,_0x93b565){return db[_0x7571('0x2e')][_0x7571('0x4d')]()['then'](respondWithResult(_0x93b565,null))[_0x7571('0x45')](handleError(_0x93b565,null));};
\ No newline at end of file
diff --git a/server/api/chatTransferReport/chatTransferReport.model.js b/server/api/chatTransferReport/chatTransferReport.model.js
index 3ac0cb2..5c8b4dd 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 _0x9da4=['../../config/environment','./chatTransferReport.attributes','exports','define','ChatTransferReport','report_chat_transfer','uniqueid','lodash','../../config/logger','api','moment','bluebird','rimraf'];(function(_0x20c9b2,_0x55d7b1){var _0x2c6030=function(_0x10845f){while(--_0x10845f){_0x20c9b2['push'](_0x20c9b2['shift']());}};_0x2c6030(++_0x55d7b1);}(_0x9da4,0xfe));var _0x49da=function(_0x5e583c,_0x191b41){_0x5e583c=_0x5e583c-0x0;var _0x2b333a=_0x9da4[_0x5e583c];return _0x2b333a;};'use strict';var _=require(_0x49da('0x0'));var util=require('util');var logger=require(_0x49da('0x1'))(_0x49da('0x2'));var moment=require(_0x49da('0x3'));var BPromise=require(_0x49da('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x49da('0x5'));var config=require(_0x49da('0x6'));var attributes=require(_0x49da('0x7'));module[_0x49da('0x8')]=function(_0x209c35,_0x48f866){return _0x209c35[_0x49da('0x9')](_0x49da('0xa'),attributes,{'tableName':_0x49da('0xb'),'paranoid':![],'indexes':[{'name':_0x49da('0xc'),'fields':[_0x49da('0xc')]}],'timestamps':!![]});};
\ No newline at end of file
+var _0x536a=['moment','bluebird','rimraf','./chatTransferReport.attributes','define','uniqueid','lodash','util','../../config/logger','api'];(function(_0x26879c,_0x1eb426){var _0x5778eb=function(_0x329c73){while(--_0x329c73){_0x26879c['push'](_0x26879c['shift']());}};_0x5778eb(++_0x1eb426);}(_0x536a,0xc4));var _0xa536=function(_0x29a914,_0x28f274){_0x29a914=_0x29a914-0x0;var _0x4235f6=_0x536a[_0x29a914];return _0x4235f6;};'use strict';var _=require(_0xa536('0x0'));var util=require(_0xa536('0x1'));var logger=require(_0xa536('0x2'))(_0xa536('0x3'));var moment=require(_0xa536('0x4'));var BPromise=require(_0xa536('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0xa536('0x6'));var config=require('../../config/environment');var attributes=require(_0xa536('0x7'));module['exports']=function(_0x1c5810,_0x3c8aa5){return _0x1c5810[_0xa536('0x8')]('ChatTransferReport',attributes,{'tableName':'report_chat_transfer','paranoid':![],'indexes':[{'name':_0xa536('0x9'),'fields':['uniqueid']}],'timestamps':!![]});};
\ No newline at end of file
diff --git a/server/api/chatTransferReport/chatTransferReport.rpc.js b/server/api/chatTransferReport/chatTransferReport.rpc.js
index 240c0d7..b57e2e8 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 _0x93da=['util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','http','request','then','info','ChatTransferReport,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','catch','lodash'];(function(_0x45f951,_0x2750c8){var _0x24756c=function(_0x31c931){while(--_0x31c931){_0x45f951['push'](_0x45f951['shift']());}};_0x24756c(++_0x2750c8);}(_0x93da,0xb7));var _0xa93d=function(_0x487654,_0x1782aa){_0x487654=_0x487654-0x0;var _0x31b87a=_0x93da[_0x487654];return _0x31b87a;};'use strict';var _=require(_0xa93d('0x0'));var util=require(_0xa93d('0x1'));var moment=require(_0xa93d('0x2'));var BPromise=require('bluebird');var rs=require(_0xa93d('0x3'));var fs=require('fs');var Redis=require(_0xa93d('0x4'));var db=require(_0xa93d('0x5'))['db'];var utils=require(_0xa93d('0x6'));var logger=require(_0xa93d('0x7'))(_0xa93d('0x8'));var config=require(_0xa93d('0x9'));var jayson=require('jayson/promise');var client=jayson['client'][_0xa93d('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x2df133,_0x1941de,_0x47e1c2){return new BPromise(function(_0x59d214,_0x5d7d3b){return client[_0xa93d('0xb')](_0x2df133,_0x47e1c2)[_0xa93d('0xc')](function(_0x441ba7){logger[_0xa93d('0xd')](_0xa93d('0xe'),_0x1941de,_0xa93d('0xf'));logger[_0xa93d('0x10')]('ChatTransferReport,\x20%s,\x20%s,\x20%s',_0x1941de,_0xa93d('0xf'),JSON[_0xa93d('0x11')](_0x441ba7));if(_0x441ba7['error']){if(_0x441ba7[_0xa93d('0x12')][_0xa93d('0x13')]===0x1f4){logger[_0xa93d('0x12')](_0xa93d('0xe'),_0x1941de,_0x441ba7[_0xa93d('0x12')][_0xa93d('0x14')]);return _0x5d7d3b(_0x441ba7[_0xa93d('0x12')][_0xa93d('0x14')]);}logger[_0xa93d('0x12')](_0xa93d('0xe'),_0x1941de,_0x441ba7[_0xa93d('0x12')][_0xa93d('0x14')]);return _0x59d214(_0x441ba7[_0xa93d('0x12')][_0xa93d('0x14')]);}else{logger[_0xa93d('0xd')](_0xa93d('0xe'),_0x1941de,'request\x20sent');_0x59d214(_0x441ba7[_0xa93d('0x15')][_0xa93d('0x14')]);}})[_0xa93d('0x16')](function(_0x5eea27){logger[_0xa93d('0x12')](_0xa93d('0xe'),_0x1941de,_0x5eea27);_0x5d7d3b(_0x5eea27);});});}
\ No newline at end of file
+var _0x832b=['moment','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','http','then','info','ChatTransferReport,\x20%s,\x20%s','request\x20sent','debug','ChatTransferReport,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','lodash','util'];(function(_0x4907de,_0x5bbdc6){var _0x482054=function(_0x39ecf6){while(--_0x39ecf6){_0x4907de['push'](_0x4907de['shift']());}};_0x482054(++_0x5bbdc6);}(_0x832b,0x8a));var _0xb832=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x832b[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0xb832('0x0'));var util=require(_0xb832('0x1'));var moment=require(_0xb832('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xb832('0x3'));var db=require(_0xb832('0x4'))['db'];var utils=require(_0xb832('0x5'));var logger=require(_0xb832('0x6'))(_0xb832('0x7'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson['client'][_0xb832('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x1b4dbd,_0x26c2f8,_0x56f98a){return new BPromise(function(_0xe9feaa,_0x381c5e){return client['request'](_0x1b4dbd,_0x56f98a)[_0xb832('0x9')](function(_0x5e325f){logger[_0xb832('0xa')](_0xb832('0xb'),_0x26c2f8,_0xb832('0xc'));logger[_0xb832('0xd')](_0xb832('0xe'),_0x26c2f8,_0xb832('0xc'),JSON['stringify'](_0x5e325f));if(_0x5e325f['error']){if(_0x5e325f[_0xb832('0xf')][_0xb832('0x10')]===0x1f4){logger[_0xb832('0xf')](_0xb832('0xb'),_0x26c2f8,_0x5e325f[_0xb832('0xf')][_0xb832('0x11')]);return _0x381c5e(_0x5e325f['error'][_0xb832('0x11')]);}logger[_0xb832('0xf')](_0xb832('0xb'),_0x26c2f8,_0x5e325f[_0xb832('0xf')][_0xb832('0x11')]);return _0xe9feaa(_0x5e325f[_0xb832('0xf')][_0xb832('0x11')]);}else{logger[_0xb832('0xa')](_0xb832('0xb'),_0x26c2f8,_0xb832('0xc'));_0xe9feaa(_0x5e325f[_0xb832('0x12')][_0xb832('0x11')]);}})[_0xb832('0x13')](function(_0x159bff){logger['error'](_0xb832('0xb'),_0x26c2f8,_0x159bff);_0x381c5e(_0x159bff);});});}
\ No newline at end of file
diff --git a/server/api/chatTransferReport/index.js b/server/api/chatTransferReport/index.js
index 1ebeb8d..b21dd22 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 _0xe57c=['./chatTransferReport.controller','get','isAuthenticated','index','/describe','/:id','show','create','put','delete','destroy','exports','multer','util','connect-timeout','Router','../../components/auth/service','../../components/interaction/service','../../config/environment'];(function(_0x40220a,_0x22feb1){var _0x3903cc=function(_0x33a296){while(--_0x33a296){_0x40220a['push'](_0x40220a['shift']());}};_0x3903cc(++_0x22feb1);}(_0xe57c,0x91));var _0xce57=function(_0x4bbf1a,_0x338546){_0x4bbf1a=_0x4bbf1a-0x0;var _0x1c489a=_0xe57c[_0x4bbf1a];return _0x1c489a;};'use strict';var multer=require(_0xce57('0x0'));var util=require(_0xce57('0x1'));var path=require('path');var timeout=require(_0xce57('0x2'));var express=require('express');var router=express[_0xce57('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0xce57('0x4'));var interaction=require(_0xce57('0x5'));var config=require(_0xce57('0x6'));var controller=require(_0xce57('0x7'));router[_0xce57('0x8')]('/',auth[_0xce57('0x9')](),controller[_0xce57('0xa')]);router[_0xce57('0x8')](_0xce57('0xb'),auth[_0xce57('0x9')](),controller['describe']);router[_0xce57('0x8')](_0xce57('0xc'),auth[_0xce57('0x9')](),controller[_0xce57('0xd')]);router['post']('/',auth[_0xce57('0x9')](),controller[_0xce57('0xe')]);router[_0xce57('0xf')]('/:id',auth['isAuthenticated'](),controller['update']);router[_0xce57('0x10')]('/:id',auth[_0xce57('0x9')](),controller[_0xce57('0x11')]);module[_0xce57('0x12')]=router;
\ No newline at end of file
+var _0x30f8=['exports','multer','util','path','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatTransferReport.controller','get','isAuthenticated','index','/describe','describe','/:id','post','update','delete','destroy'];(function(_0x3e51e4,_0x9c5527){var _0x736e00=function(_0x139245){while(--_0x139245){_0x3e51e4['push'](_0x3e51e4['shift']());}};_0x736e00(++_0x9c5527);}(_0x30f8,0xb5));var _0x830f=function(_0x482dd9,_0x4ec5e5){_0x482dd9=_0x482dd9-0x0;var _0xbb957c=_0x30f8[_0x482dd9];return _0xbb957c;};'use strict';var multer=require(_0x830f('0x0'));var util=require(_0x830f('0x1'));var path=require(_0x830f('0x2'));var timeout=require('connect-timeout');var express=require(_0x830f('0x3'));var router=express[_0x830f('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x830f('0x5'));var interaction=require(_0x830f('0x6'));var config=require(_0x830f('0x7'));var controller=require(_0x830f('0x8'));router[_0x830f('0x9')]('/',auth[_0x830f('0xa')](),controller[_0x830f('0xb')]);router['get'](_0x830f('0xc'),auth['isAuthenticated'](),controller[_0x830f('0xd')]);router[_0x830f('0x9')](_0x830f('0xe'),auth[_0x830f('0xa')](),controller['show']);router[_0x830f('0xf')]('/',auth[_0x830f('0xa')](),controller['create']);router['put'](_0x830f('0xe'),auth[_0x830f('0xa')](),controller[_0x830f('0x10')]);router[_0x830f('0x11')](_0x830f('0xe'),auth['isAuthenticated'](),controller[_0x830f('0x12')]);module[_0x830f('0x13')]=router;
\ No newline at end of file
diff --git a/server/api/chatWebsite/chatWebsite.attributes.js b/server/api/chatWebsite/chatWebsite.attributes.js
index 6eaca4b..d543f74 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 _0xadc6=['Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','mandatoryDispositionPauseId','mandatoryDisposition','Generated\x20by\x20XCALLY\x20Motion','sequelize','randomstring','exports','STRING','address','Agent','#011F6A','#ffffff','INTEGER','BOOLEAN','ENUM','rounded','squared','We\x20are\x20here!','Chat','Contact\x20us','Powered\x20by\x20xCALLY','TEXT','Do\x20you\x20want\x20to\x20close\x20the\x20interaction?','Form\x20submission\x20error','Note','Type\x20a\x20message','Thanks\x20you\x20for\x20your\x20time!','Send','Skip','star','thumb','name','text','email','getDataValue','onlineForm','setDataValue','stringify','Comments','Leave\x20your\x20comments','offlineForm','generate','All\x20of\x20our\x20agents\x20are\x20busy\x20at\x20this\x20time.\x20Your\x20chat\x20is\x20very\x20important\x20to\x20us.','Please\x20hold\x20and\x20we\x20will\x20answer\x20your\x20request\x20as\x20soon\x20as\x20possible.','New\x20offline\x20message\x20from\x20websiteName','Your\x20request\x20has\x20not\x20been\x20processed.','Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}','website_alias','CHAT','alternate','#fafafa','System'];(function(_0x188e7e,_0xf6325c){var _0xf95a4f=function(_0x1455d2){while(--_0x1455d2){_0x188e7e['push'](_0x188e7e['shift']());}};_0xf95a4f(++_0xf6325c);}(_0xadc6,0x1d8));var _0x6adc=function(_0x18ab2a,_0x4debcd){_0x18ab2a=_0x18ab2a-0x0;var _0x16dcee=_0xadc6[_0x18ab2a];return _0x16dcee;};'use strict';var Sequelize=require(_0x6adc('0x0'));var rs=require(_0x6adc('0x1'));module[_0x6adc('0x2')]={'name':{'type':Sequelize[_0x6adc('0x3')],'allowNull':![]},'address':{'type':Sequelize[_0x6adc('0x3')],'allowNull':![],'unique':_0x6adc('0x4')},'description':{'type':Sequelize[_0x6adc('0x3')]},'mapKey':{'type':Sequelize[_0x6adc('0x3')],'defaultValue':'email'},'mapKeyOffline':{'type':Sequelize[_0x6adc('0x3')],'defaultValue':'email'},'key':{'type':Sequelize['STRING'],'allowNull':![]},'agentAlias':{'type':Sequelize[_0x6adc('0x3')],'defaultValue':_0x6adc('0x5')},'customerAlias':{'type':Sequelize[_0x6adc('0x3')],'defaultValue':'Me'},'color':{'type':Sequelize[_0x6adc('0x3')],'allowNull':![],'defaultValue':_0x6adc('0x6'),'validate':{'notEmpty':!![]}},'color_button':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0x6adc('0x6'),'validate':{'notEmpty':!![]}},'textColor':{'type':Sequelize[_0x6adc('0x3')],'allowNull':![],'defaultValue':_0x6adc('0x7'),'validate':{'notEmpty':!![]}},'textButtonColor':{'type':Sequelize[_0x6adc('0x3')],'allowNull':![],'defaultValue':_0x6adc('0x7'),'validate':{'notEmpty':!![]}},'fontSize':{'type':Sequelize[_0x6adc('0x8')],'defaultValue':0xf},'remote':{'type':Sequelize[_0x6adc('0x3')]},'animation':{'type':Sequelize[_0x6adc('0x9')],'defaultValue':!![]},'header_shape':{'type':Sequelize[_0x6adc('0xa')](_0x6adc('0xb'),_0x6adc('0xc')),'defaultValue':'rounded'},'header_online':{'type':Sequelize[_0x6adc('0x3')],'defaultValue':_0x6adc('0xd')},'start_chat_button':{'type':Sequelize[_0x6adc('0x3')],'defaultValue':_0x6adc('0xe')},'offline_chat_button':{'type':Sequelize['STRING'],'defaultValue':'Send'},'header_offline':{'type':Sequelize[_0x6adc('0x3')],'defaultValue':_0x6adc('0xf')},'download_transcript':{'type':Sequelize[_0x6adc('0x9')],'defaultValue':!![]},'timeout':{'type':Sequelize[_0x6adc('0x8')],'defaultValue':0x0},'whiteLabel':{'type':Sequelize[_0x6adc('0x3')],'defaultValue':_0x6adc('0x10')},'defaultWhiteLabel':{'type':Sequelize[_0x6adc('0x9')],'defaultValue':!![]},'sitepic':{'type':Sequelize[_0x6adc('0x11')]},'closingQuestion':{'type':Sequelize['STRING'],'defaultValue':_0x6adc('0x12')},'formSubmitSuccessMessage':{'type':Sequelize[_0x6adc('0x3')],'defaultValue':'Form\x20properly\x20submitted'},'formSubmitFailureMessage':{'type':Sequelize[_0x6adc('0x3')],'defaultValue':_0x6adc('0x13')},'noteTitle':{'type':Sequelize['STRING'],'defaultValue':_0x6adc('0x14')},'placeholderMessage':{'type':Sequelize[_0x6adc('0x3')],'defaultValue':_0x6adc('0x15')},'closingMessage':{'type':Sequelize[_0x6adc('0x3')],'defaultValue':_0x6adc('0x16')},'closingMessageButton':{'type':Sequelize[_0x6adc('0x3')],'defaultValue':_0x6adc('0x17')},'skipMessageButton':{'type':Sequelize[_0x6adc('0x3')],'defaultValue':_0x6adc('0x18')},'conditionAgreement':{'type':Sequelize[_0x6adc('0x9')],'defaultValue':![]},'enableRating':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'enableFeedback':{'type':Sequelize[_0x6adc('0x9')],'defaultValue':![]},'enableSendButton':{'type':Sequelize[_0x6adc('0x9')],'defaultValue':![]},'feedbackTitle':{'type':Sequelize[_0x6adc('0x3')],'defaultValue':'Feedback'},'ratingType':{'type':Sequelize['ENUM'](_0x6adc('0x19'),_0x6adc('0x1a')),'defaultValue':'star'},'ratingStarsNumber':{'type':Sequelize[_0x6adc('0x8')],'defaultValue':0x5},'onlineForm':{'type':Sequelize[_0x6adc('0x11')],'defaultValue':function(){return JSON['stringify']({'items':[{'type':'input','variable':null,'config':{'placeholder':_0x6adc('0x1b'),'type':_0x6adc('0x1c'),'required':!![]},'props':{'title':_0x6adc('0x1b'),'helpText':''}},{'type':'input','props':{'title':_0x6adc('0x1d'),'helpText':''},'config':{'required':!![],'placeholder':_0x6adc('0x1d'),'type':_0x6adc('0x1d')},'variable':null}],'fromKey':0x1});},'get':function(){return this[_0x6adc('0x1e')]('onlineForm')?JSON['parse'](this['getDataValue'](_0x6adc('0x1f'))):{};},'set':function(_0x372502){return this[_0x6adc('0x20')](_0x6adc('0x1f'),JSON[_0x6adc('0x21')](_0x372502));}},'offlineForm':{'type':Sequelize[_0x6adc('0x11')],'defaultValue':function(){return JSON[_0x6adc('0x21')]({'items':[{'type':'input','props':{'title':_0x6adc('0x1d'),'helpText':''},'config':{'required':!![],'placeholder':'email','type':_0x6adc('0x1d')},'variable':null},{'type':'textarea','config':{'placeholder':_0x6adc('0x22')},'props':{'title':_0x6adc('0x22'),'helpText':_0x6adc('0x23')}}],'fromKey':0x0});},'get':function(){return this[_0x6adc('0x1e')](_0x6adc('0x24'))?JSON['parse'](this['getDataValue'](_0x6adc('0x24'))):{};},'set':function(_0x4be586){return this[_0x6adc('0x20')]('offlineForm',JSON[_0x6adc('0x21')](_0x4be586));}},'token':{'type':Sequelize['STRING'],'defaultValue':function(){return rs[_0x6adc('0x25')]();}},'autoclose':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'enableCustomerWriting':{'type':Sequelize[_0x6adc('0x9')],'defaultValue':![]},'forwardTranscript':{'type':Sequelize[_0x6adc('0x9')],'defaultValue':![]},'forwardTranscriptMessage':{'type':Sequelize[_0x6adc('0x3')]},'forwardOffline':{'type':Sequelize[_0x6adc('0x9')],'defaultValue':![]},'forwardOfflineAddress':{'type':Sequelize[_0x6adc('0x3')]},'waitingTitle':{'type':Sequelize[_0x6adc('0x3')],'defaultValue':_0x6adc('0x26')},'waitingMessage':{'type':Sequelize[_0x6adc('0x3')],'defaultValue':_0x6adc('0x27')},'offlineMessageSubject':{'type':Sequelize[_0x6adc('0x3')],'defaultValue':_0x6adc('0x28')},'offlineMessageBody':{'type':Sequelize[_0x6adc('0x3')],'defaultValue':'You\x20received\x20a\x20new\x20offline\x20message\x20from\x20websiteName.\x20Here\x20you\x20can\x20find\x20the\x20details\x20of\x20the\x20request:'},'enableUnmanagedNote':{'type':Sequelize[_0x6adc('0x9')],'defaultValue':!![]},'unmanagedMessage':{'type':Sequelize[_0x6adc('0x3')],'defaultValue':_0x6adc('0x29')},'skipUnmanaged':{'type':Sequelize[_0x6adc('0x3')],'defaultValue':_0x6adc('0x18')},'sendUnmanaged':{'type':Sequelize[_0x6adc('0x3')],'defaultValue':_0x6adc('0x17')},'enableCustomerAttachment':{'type':Sequelize[_0x6adc('0x9')],'defaultValue':![]},'enableCustomerCheckmarks':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'agentAvatar':{'type':Sequelize[_0x6adc('0x11')]},'showAgentAvatar':{'type':Sequelize[_0x6adc('0x9')],'defaultValue':![]},'timezone':{'type':Sequelize['STRING']},'notificationTemplate':{'type':Sequelize[_0x6adc('0x11')],'defaultValue':function(){return _0x6adc('0x2a');}},'notificationSound':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'notificationShake':{'type':Sequelize[_0x6adc('0x9')],'defaultValue':![]},'hideWhenOffline':{'type':Sequelize[_0x6adc('0x9')],'defaultValue':![]},'agentIdentifier':{'type':Sequelize[_0x6adc('0x3')],'defaultValue':_0x6adc('0x2b')},'waitForTheAssignedAgent':{'type':Sequelize[_0x6adc('0x8')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'waitForTheAssignedQueue':{'type':Sequelize[_0x6adc('0x8')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'alignment':{'type':Sequelize[_0x6adc('0x3')],'defaultValue':'bottom_right'},'verticalAlignment':{'type':Sequelize[_0x6adc('0x8')],'defaultValue':0x1e},'labelText':{'type':Sequelize[_0x6adc('0x3')],'defaultValue':_0x6adc('0x2c')},'messagesAlignment':{'type':Sequelize[_0x6adc('0x3')],'defaultValue':_0x6adc('0x2d')},'defaultTitle':{'type':Sequelize['STRING']},'customerAvatar':{'type':Sequelize[_0x6adc('0x11')]},'showCustomerAvatar':{'type':Sequelize[_0x6adc('0x9')],'defaultValue':![]},'messageFontSize':{'type':Sequelize[_0x6adc('0x8')],'defaultValue':0xc},'backgroundColor':{'type':Sequelize[_0x6adc('0x3')],'allowNull':![],'defaultValue':_0x6adc('0x2e'),'validate':{'notEmpty':!![]}},'queueTransfer':{'type':Sequelize[_0x6adc('0x9')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0x6adc('0x9')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0x6adc('0x8')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'systemAlias':{'type':Sequelize[_0x6adc('0x3')],'defaultValue':_0x6adc('0x2f')},'systemAvatar':{'type':Sequelize['TEXT']},'mandatoryDispositionPauseId':{'type':Sequelize[_0x6adc('0x8')],'comment':_0x6adc('0x30')},'mandatoryDisposition':{'type':Sequelize[_0x6adc('0x9')],'defaultValue':![],'comment':'Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','set':function(_0x5b4343){if(!_0x5b4343)this[_0x6adc('0x20')](_0x6adc('0x31'),null);this[_0x6adc('0x20')](_0x6adc('0x32'),_0x5b4343);}},'vidaooEscalation':{'type':Sequelize[_0x6adc('0x9')],'defaultValue':![]},'vidaooApiKey':{'type':Sequelize[_0x6adc('0x3')]},'vidaooTopic':{'type':Sequelize[_0x6adc('0x3')],'allowNull':![],'defaultValue':_0x6adc('0x33')},'vidaooNote':{'type':Sequelize[_0x6adc('0x3')],'defaultValue':function(){return'Meeting\x20generated\x20for\x20interaction\x20#{{interaction.id}}\x20by\x20{{agent.name}}';}},'vidaooMetadata':{'type':Sequelize[_0x6adc('0x11')],'defaultValue':null},'openNewInteraction':{'type':Sequelize[_0x6adc('0x9')],'defaultValue':![],'allowNull':!![]},'subjectOffline':{'type':Sequelize[_0x6adc('0x11')]}};
\ No newline at end of file
+var _0xf3d8=['website_alias','bottom_right','CHAT','alternate','#fafafa','System','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','mandatoryDispositionPauseId','mandatoryDisposition','Generated\x20by\x20XCALLY\x20Motion','sequelize','STRING','address','email','Agent','#011F6A','#ffffff','INTEGER','BOOLEAN','rounded','squared','Chat','Send','Contact\x20us','Powered\x20by\x20xCALLY','Do\x20you\x20want\x20to\x20close\x20the\x20interaction?','Form\x20properly\x20submitted','Type\x20a\x20message','Thanks\x20you\x20for\x20your\x20time!','Skip','Feedback','star','thumb','TEXT','stringify','input','name','getDataValue','onlineForm','parse','setDataValue','textarea','Comments','Leave\x20your\x20comments','offlineForm','generate','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:','Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}'];(function(_0x501510,_0x61caa9){var _0x1e6ee5=function(_0x32845b){while(--_0x32845b){_0x501510['push'](_0x501510['shift']());}};_0x1e6ee5(++_0x61caa9);}(_0xf3d8,0x161));var _0x8f3d=function(_0x265003,_0xf0f023){_0x265003=_0x265003-0x0;var _0x33c743=_0xf3d8[_0x265003];return _0x33c743;};'use strict';var Sequelize=require(_0x8f3d('0x0'));var rs=require('randomstring');module['exports']={'name':{'type':Sequelize['STRING'],'allowNull':![]},'address':{'type':Sequelize[_0x8f3d('0x1')],'allowNull':![],'unique':_0x8f3d('0x2')},'description':{'type':Sequelize['STRING']},'mapKey':{'type':Sequelize[_0x8f3d('0x1')],'defaultValue':_0x8f3d('0x3')},'mapKeyOffline':{'type':Sequelize[_0x8f3d('0x1')],'defaultValue':'email'},'key':{'type':Sequelize['STRING'],'allowNull':![]},'agentAlias':{'type':Sequelize[_0x8f3d('0x1')],'defaultValue':_0x8f3d('0x4')},'customerAlias':{'type':Sequelize[_0x8f3d('0x1')],'defaultValue':'Me'},'color':{'type':Sequelize[_0x8f3d('0x1')],'allowNull':![],'defaultValue':_0x8f3d('0x5'),'validate':{'notEmpty':!![]}},'color_button':{'type':Sequelize[_0x8f3d('0x1')],'allowNull':![],'defaultValue':_0x8f3d('0x5'),'validate':{'notEmpty':!![]}},'textColor':{'type':Sequelize[_0x8f3d('0x1')],'allowNull':![],'defaultValue':_0x8f3d('0x6'),'validate':{'notEmpty':!![]}},'textButtonColor':{'type':Sequelize[_0x8f3d('0x1')],'allowNull':![],'defaultValue':_0x8f3d('0x6'),'validate':{'notEmpty':!![]}},'fontSize':{'type':Sequelize[_0x8f3d('0x7')],'defaultValue':0xf},'remote':{'type':Sequelize[_0x8f3d('0x1')]},'animation':{'type':Sequelize[_0x8f3d('0x8')],'defaultValue':!![]},'header_shape':{'type':Sequelize['ENUM'](_0x8f3d('0x9'),_0x8f3d('0xa')),'defaultValue':_0x8f3d('0x9')},'header_online':{'type':Sequelize[_0x8f3d('0x1')],'defaultValue':'We\x20are\x20here!'},'start_chat_button':{'type':Sequelize['STRING'],'defaultValue':_0x8f3d('0xb')},'offline_chat_button':{'type':Sequelize[_0x8f3d('0x1')],'defaultValue':_0x8f3d('0xc')},'header_offline':{'type':Sequelize[_0x8f3d('0x1')],'defaultValue':_0x8f3d('0xd')},'download_transcript':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'timeout':{'type':Sequelize[_0x8f3d('0x7')],'defaultValue':0x0},'whiteLabel':{'type':Sequelize[_0x8f3d('0x1')],'defaultValue':_0x8f3d('0xe')},'defaultWhiteLabel':{'type':Sequelize[_0x8f3d('0x8')],'defaultValue':!![]},'sitepic':{'type':Sequelize['TEXT']},'closingQuestion':{'type':Sequelize[_0x8f3d('0x1')],'defaultValue':_0x8f3d('0xf')},'formSubmitSuccessMessage':{'type':Sequelize[_0x8f3d('0x1')],'defaultValue':_0x8f3d('0x10')},'formSubmitFailureMessage':{'type':Sequelize[_0x8f3d('0x1')],'defaultValue':'Form\x20submission\x20error'},'noteTitle':{'type':Sequelize[_0x8f3d('0x1')],'defaultValue':'Note'},'placeholderMessage':{'type':Sequelize[_0x8f3d('0x1')],'defaultValue':_0x8f3d('0x11')},'closingMessage':{'type':Sequelize['STRING'],'defaultValue':_0x8f3d('0x12')},'closingMessageButton':{'type':Sequelize['STRING'],'defaultValue':_0x8f3d('0xc')},'skipMessageButton':{'type':Sequelize[_0x8f3d('0x1')],'defaultValue':_0x8f3d('0x13')},'conditionAgreement':{'type':Sequelize[_0x8f3d('0x8')],'defaultValue':![]},'enableRating':{'type':Sequelize[_0x8f3d('0x8')],'defaultValue':![]},'enableFeedback':{'type':Sequelize[_0x8f3d('0x8')],'defaultValue':![]},'enableSendButton':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'feedbackTitle':{'type':Sequelize[_0x8f3d('0x1')],'defaultValue':_0x8f3d('0x14')},'ratingType':{'type':Sequelize['ENUM'](_0x8f3d('0x15'),_0x8f3d('0x16')),'defaultValue':_0x8f3d('0x15')},'ratingStarsNumber':{'type':Sequelize[_0x8f3d('0x7')],'defaultValue':0x5},'onlineForm':{'type':Sequelize[_0x8f3d('0x17')],'defaultValue':function(){return JSON[_0x8f3d('0x18')]({'items':[{'type':_0x8f3d('0x19'),'variable':null,'config':{'placeholder':_0x8f3d('0x1a'),'type':'text','required':!![]},'props':{'title':_0x8f3d('0x1a'),'helpText':''}},{'type':'input','props':{'title':_0x8f3d('0x3'),'helpText':''},'config':{'required':!![],'placeholder':_0x8f3d('0x3'),'type':_0x8f3d('0x3')},'variable':null}],'fromKey':0x1});},'get':function(){return this[_0x8f3d('0x1b')](_0x8f3d('0x1c'))?JSON[_0x8f3d('0x1d')](this[_0x8f3d('0x1b')](_0x8f3d('0x1c'))):{};},'set':function(_0x399d6d){return this[_0x8f3d('0x1e')](_0x8f3d('0x1c'),JSON[_0x8f3d('0x18')](_0x399d6d));}},'offlineForm':{'type':Sequelize[_0x8f3d('0x17')],'defaultValue':function(){return JSON[_0x8f3d('0x18')]({'items':[{'type':_0x8f3d('0x19'),'props':{'title':_0x8f3d('0x3'),'helpText':''},'config':{'required':!![],'placeholder':'email','type':_0x8f3d('0x3')},'variable':null},{'type':_0x8f3d('0x1f'),'config':{'placeholder':_0x8f3d('0x20')},'props':{'title':_0x8f3d('0x20'),'helpText':_0x8f3d('0x21')}}],'fromKey':0x0});},'get':function(){return this[_0x8f3d('0x1b')](_0x8f3d('0x22'))?JSON[_0x8f3d('0x1d')](this[_0x8f3d('0x1b')](_0x8f3d('0x22'))):{};},'set':function(_0xc9e607){return this['setDataValue'](_0x8f3d('0x22'),JSON[_0x8f3d('0x18')](_0xc9e607));}},'token':{'type':Sequelize[_0x8f3d('0x1')],'defaultValue':function(){return rs[_0x8f3d('0x23')]();}},'autoclose':{'type':Sequelize[_0x8f3d('0x8')],'defaultValue':!![]},'enableCustomerWriting':{'type':Sequelize[_0x8f3d('0x8')],'defaultValue':![]},'forwardTranscript':{'type':Sequelize[_0x8f3d('0x8')],'defaultValue':![]},'forwardTranscriptMessage':{'type':Sequelize[_0x8f3d('0x1')]},'forwardOffline':{'type':Sequelize[_0x8f3d('0x8')],'defaultValue':![]},'forwardOfflineAddress':{'type':Sequelize['STRING']},'waitingTitle':{'type':Sequelize['STRING'],'defaultValue':'All\x20of\x20our\x20agents\x20are\x20busy\x20at\x20this\x20time.\x20Your\x20chat\x20is\x20very\x20important\x20to\x20us.'},'waitingMessage':{'type':Sequelize[_0x8f3d('0x1')],'defaultValue':_0x8f3d('0x24')},'offlineMessageSubject':{'type':Sequelize[_0x8f3d('0x1')],'defaultValue':'New\x20offline\x20message\x20from\x20websiteName'},'offlineMessageBody':{'type':Sequelize[_0x8f3d('0x1')],'defaultValue':_0x8f3d('0x25')},'enableUnmanagedNote':{'type':Sequelize[_0x8f3d('0x8')],'defaultValue':!![]},'unmanagedMessage':{'type':Sequelize[_0x8f3d('0x1')],'defaultValue':'Your\x20request\x20has\x20not\x20been\x20processed.'},'skipUnmanaged':{'type':Sequelize['STRING'],'defaultValue':_0x8f3d('0x13')},'sendUnmanaged':{'type':Sequelize[_0x8f3d('0x1')],'defaultValue':_0x8f3d('0xc')},'enableCustomerAttachment':{'type':Sequelize[_0x8f3d('0x8')],'defaultValue':![]},'enableCustomerCheckmarks':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'agentAvatar':{'type':Sequelize[_0x8f3d('0x17')]},'showAgentAvatar':{'type':Sequelize[_0x8f3d('0x8')],'defaultValue':![]},'timezone':{'type':Sequelize[_0x8f3d('0x1')]},'notificationTemplate':{'type':Sequelize[_0x8f3d('0x17')],'defaultValue':function(){return _0x8f3d('0x26');}},'notificationSound':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'notificationShake':{'type':Sequelize[_0x8f3d('0x8')],'defaultValue':![]},'hideWhenOffline':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'agentIdentifier':{'type':Sequelize['STRING'],'defaultValue':_0x8f3d('0x27')},'waitForTheAssignedAgent':{'type':Sequelize[_0x8f3d('0x7')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'waitForTheAssignedQueue':{'type':Sequelize[_0x8f3d('0x7')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'alignment':{'type':Sequelize[_0x8f3d('0x1')],'defaultValue':_0x8f3d('0x28')},'verticalAlignment':{'type':Sequelize[_0x8f3d('0x7')],'defaultValue':0x1e},'labelText':{'type':Sequelize['STRING'],'defaultValue':_0x8f3d('0x29')},'messagesAlignment':{'type':Sequelize[_0x8f3d('0x1')],'defaultValue':_0x8f3d('0x2a')},'defaultTitle':{'type':Sequelize[_0x8f3d('0x1')]},'customerAvatar':{'type':Sequelize['TEXT']},'showCustomerAvatar':{'type':Sequelize[_0x8f3d('0x8')],'defaultValue':![]},'messageFontSize':{'type':Sequelize['INTEGER'],'defaultValue':0xc},'backgroundColor':{'type':Sequelize[_0x8f3d('0x1')],'allowNull':![],'defaultValue':_0x8f3d('0x2b'),'validate':{'notEmpty':!![]}},'queueTransfer':{'type':Sequelize[_0x8f3d('0x8')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0x8f3d('0x7')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0x8f3d('0x8')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0x8f3d('0x7')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'systemAlias':{'type':Sequelize[_0x8f3d('0x1')],'defaultValue':_0x8f3d('0x2c')},'systemAvatar':{'type':Sequelize[_0x8f3d('0x17')]},'mandatoryDispositionPauseId':{'type':Sequelize['INTEGER'],'comment':_0x8f3d('0x2d')},'mandatoryDisposition':{'type':Sequelize['BOOLEAN'],'defaultValue':![],'comment':'Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','set':function(_0x15d4df){if(!_0x15d4df)this[_0x8f3d('0x1e')](_0x8f3d('0x2e'),null);this[_0x8f3d('0x1e')](_0x8f3d('0x2f'),_0x15d4df);}},'vidaooEscalation':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'vidaooApiKey':{'type':Sequelize['STRING']},'vidaooTopic':{'type':Sequelize[_0x8f3d('0x1')],'allowNull':![],'defaultValue':_0x8f3d('0x30')},'vidaooNote':{'type':Sequelize[_0x8f3d('0x1')],'defaultValue':function(){return'Meeting\x20generated\x20for\x20interaction\x20#{{interaction.id}}\x20by\x20{{agent.name}}';}},'vidaooMetadata':{'type':Sequelize[_0x8f3d('0x17')],'defaultValue':null},'openNewInteraction':{'type':Sequelize[_0x8f3d('0x8')],'defaultValue':![],'allowNull':!![]},'subjectOffline':{'type':Sequelize[_0x8f3d('0x17')]}};
\ No newline at end of file
diff --git a/server/api/chatWebsite/chatWebsite.controller.js b/server/api/chatWebsite/chatWebsite.controller.js
index 4da95e1..1234641 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 _0x5e55=['Contact','Owner','fullname','Tag','Tags','tag','getSnippet','increment','chatLicenseExceeded','timezone','ifTime','server/files/chat/iframe.ejs','3.9.0','origin','replace','remote','x-real-ip','remoteAddress','alignment','color','labelText','textColor','hideWhenOffline','IntervalId','addApplications','transaction','Transaction','ISOLATION_LEVELS','READ_COMMITTED','findAndCountAll','finally','getApplications','addProactiveActions','chatProactiveAction','getProactiveActions','ChatProactiveAction','online','offlineForm','onlineForm','items','fromKey','getOfflineMessages','Attachments','addAgents','emit','userChatWebsite:save','removeAgents','isArray','userChatWebsite:remove','getAgents','mustache','util','ejs','fs-extra','lodash','html-to-text','ioredis','../../components/parsers/qs','../../config/logger','../../config/environment','../../errors/api','APIOutOfIntervalError','handleError','APIConflictError','URL','redis','defaults','localhost','socket.io-emitter','http','client','request','then','info','ChatWebsite,\x20%s,\x20%s','request\x20sent','debug','ChatWebsite,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','sendStatus','status','offset','limit','undefined','count','Content-Range','json','update','destroy','get','ChatWebsites','UserProfileResource','end','stack','send','user-agent-parser','setUA','user-agent','customerIp','cf-connecting-ip','x-forwarded-for','split','firstName','lastName','x-real-port','referer','browser','name','version','format','%s\x20%s','unknown','model','device','vendor','%s\x20%s\x20%s','type','Pause','mandatoryDispositionPause','map','ChatWebsite','rawAttributes','fieldName','key','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','findAll','params','include','find','create','testWildcardValidity','address','\x22\x20is\x20not\x20a\x20valid\x20website\x20domain','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','describe','Disposition','order','ChatWebsiteId','rows','removeDispositions','ids','addAnswer','findOne','CannedAnswer','removeAnswers','addLogo','sitepic','file','filename','addAvatar','agentAvatar','addCustomerAvatar','customerAvatar','addSystemAvatar','systemAvatar','getLogo','join','root','server/files/images/logos/default_logo.svg','../../config/license/util','getLicense','custom','isNil','existsSync','server/files/images/logos/','getAvatar','server/files/images/avatars/','download','server/files/images/avatars/customer_avatar.png','showCustomerAvatar','getSystemAvatar','server/files/images/avatars/system_avatar.png','Interval','resolve','notify','chat','from','From\x20is\x20mandatory','mapKey','MapKey\x20is\x20mandatory','isEmpty','Body\x20is\x20mandatory','CmContact','No\x20available\x20attributes','updatedAt','includes','createdAt','Invalid\x20MapKey\x20parameter.\x20Allowed\x20values:\x20','CmList','List','DESC','ChatApplication','Intervals','interval','Chat\x20Website\x20with\x20id\x20%s\x20not\x20found','account','applications','orderBy','Applications','priority','asc','list','ListId','Contacts','contact','headers','threadId','closed','ChatInteraction','Writing\x20on\x20closed\x20interaction','externalUrl','ContactId','interaction','messageId','created','push','close','*,*,*,*','ChatMessage','AttachmentId','UserId','User','waitForTheAssignedAgent','forcedOwnership','queueId','unshift','waitForTheAssignedQueue','Start','startRouting','EventManager','files','Sequelize','ValidationError','difference','from\x20is\x20mandatory','body\x20is\x20mandatory\x20and\x20not\x20empty','mapKeyOffline','mapKeyOffline\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','MailAccount','spread','readFileSync','server/files/templates/chatOfflineMessage.ejs','utf8','render','offlineMessageBody','ChatOfflineMessage','fromString','originalname','mimetype','server','attachments','openNewInteraction','sequelize','Attachment','bulkCreate','MailServerOut','Smtp','CloudProvider','forwardOffline','forwardOfflineAddress','SendMail','\x22%s\x22\x20<%s>','email','MailAccountId','subjectOffline','toPairsIn','mapValues','Chat','NotifyMailAccount','offline-chat','Could\x20not\x20remove\x20attachment\x20file','addInteraction','omit','getInteractions'];(function(_0x41007d,_0x3a338e){var _0x51c71d=function(_0x4255d4){while(--_0x4255d4){_0x41007d['push'](_0x41007d['shift']());}};_0x51c71d(++_0x3a338e);}(_0x5e55,0x15e));var _0x55e5=function(_0x2de5a4,_0x1256d3){_0x2de5a4=_0x2de5a4-0x0;var _0x48a713=_0x5e55[_0x2de5a4];return _0x48a713;};'use strict';var Mustache=require(_0x55e5('0x0'));var util=require(_0x55e5('0x1'));var path=require('path');var ejs=require(_0x55e5('0x2'));var fs=require('fs');var fs_extra=require(_0x55e5('0x3'));var _=require(_0x55e5('0x4'));var querystring=require('querystring');var htmlToText=require(_0x55e5('0x5'));var Redis=require(_0x55e5('0x6'));var jayson=require('jayson/promise');var qs=require(_0x55e5('0x7'));var logger=require(_0x55e5('0x8'))('api');var config=require(_0x55e5('0x9'));var APIBadRequestError=require(_0x55e5('0xa'))['APIBadRequestError'];var APINotFoundError=require(_0x55e5('0xa'))['APINotFoundError'];var APIOutOfIntervalError=require(_0x55e5('0xa'))[_0x55e5('0xb')];var APIHandleError=require(_0x55e5('0xa'))[_0x55e5('0xc')];var APIConflictError=require(_0x55e5('0xa'))[_0x55e5('0xd')];var wildcardUtils=require('./helpers/wildcard-expressions');var URL=require('url')[_0x55e5('0xe')];var db=require('../../mysqldb')['db'];config[_0x55e5('0xf')]=_[_0x55e5('0x10')](config[_0x55e5('0xf')],{'host':_0x55e5('0x11'),'port':0x18eb});var socket=require(_0x55e5('0x12'))(new Redis(config[_0x55e5('0xf')]));require('./chatWebsite.socket')['register'](socket);var client=jayson['client'][_0x55e5('0x13')]({'port':0x232c});var client9002=jayson[_0x55e5('0x14')]['http']({'port':0x232a});var client9003=jayson[_0x55e5('0x14')][_0x55e5('0x13')]({'port':0x232b});var client9001=jayson[_0x55e5('0x14')]['http']({'port':0x2329});function respondWithRpcPromise(_0x419e5b,_0x318c96,_0x429af4,_0x151bda){return new Promise(function(_0x575d77,_0x4e7628){var _0x3c330c=_0x151bda||client;return _0x3c330c[_0x55e5('0x15')](_0x419e5b,_0x429af4)[_0x55e5('0x16')](function(_0x1c6b72){logger[_0x55e5('0x17')](_0x55e5('0x18'),_0x318c96,_0x55e5('0x19'));logger[_0x55e5('0x1a')](_0x55e5('0x1b'),_0x318c96,'request\x20sent',JSON[_0x55e5('0x1c')](_0x1c6b72));if(_0x1c6b72['error']){if(_0x1c6b72[_0x55e5('0x1d')][_0x55e5('0x1e')]===0x1f4){logger[_0x55e5('0x1d')](_0x55e5('0x18'),_0x318c96,_0x1c6b72[_0x55e5('0x1d')][_0x55e5('0x1f')]);return _0x4e7628(_0x1c6b72[_0x55e5('0x1d')][_0x55e5('0x1f')]);}logger[_0x55e5('0x1d')](_0x55e5('0x18'),_0x318c96,_0x1c6b72[_0x55e5('0x1d')][_0x55e5('0x1f')]);return _0x575d77(_0x1c6b72[_0x55e5('0x1d')]['message']);}else{logger['info'](_0x55e5('0x18'),_0x318c96,_0x55e5('0x19'));_0x575d77(_0x1c6b72[_0x55e5('0x20')][_0x55e5('0x1f')]);}})[_0x55e5('0x21')](function(_0x18c485){logger[_0x55e5('0x1d')](_0x55e5('0x18'),_0x318c96,_0x18c485);_0x4e7628(_0x18c485);});});}function respondWithStatusCode(_0x590957,_0x1f56fe){_0x1f56fe=_0x1f56fe||0xcc;return function(_0x1990a9){if(_0x1990a9){return _0x590957[_0x55e5('0x22')](_0x1f56fe);}return _0x590957[_0x55e5('0x23')](_0x1f56fe)['end']();};}function respondWithResult(_0x22dd85,_0x5651b0){_0x5651b0=_0x5651b0||0xc8;return function(_0x51269e){if(_0x51269e){return _0x22dd85[_0x55e5('0x23')](_0x5651b0)['json'](_0x51269e);}};}function respondWithFilteredResult(_0x28ba3b,_0x1a8412){return function(_0x45252b){if(_0x45252b){var _0x499081=typeof _0x1a8412[_0x55e5('0x24')]==='undefined'&&typeof _0x1a8412[_0x55e5('0x25')]===_0x55e5('0x26');var _0x1b1c39=_0x45252b[_0x55e5('0x27')];var _0x1492c8=_0x499081?0x0:_0x1a8412[_0x55e5('0x24')];var _0x1f11c8=_0x499081?_0x45252b[_0x55e5('0x27')]:_0x1a8412[_0x55e5('0x24')]+_0x1a8412['limit'];var _0x23e7bf;if(_0x1f11c8>=_0x1b1c39){_0x1f11c8=_0x1b1c39;_0x23e7bf=0xc8;}else{_0x23e7bf=0xce;}_0x28ba3b[_0x55e5('0x23')](_0x23e7bf);return _0x28ba3b['set'](_0x55e5('0x28'),_0x1492c8+'-'+_0x1f11c8+'/'+_0x1b1c39)[_0x55e5('0x29')](_0x45252b);}return null;};}function saveUpdates(_0x230b8e){return function(_0x2a5cf5){if(_0x2a5cf5){return _0x2a5cf5[_0x55e5('0x2a')](_0x230b8e)[_0x55e5('0x16')](function(_0x259942){return _0x259942;});}return null;};}function removeEntity(_0x45bb37){return function(_0x23aca5){if(_0x23aca5){return _0x23aca5[_0x55e5('0x2b')]()[_0x55e5('0x16')](function(){var _0x6851f2=_0x23aca5[_0x55e5('0x2c')]({'plain':!![]});var _0x45b87c=_0x55e5('0x2d');return db[_0x55e5('0x2e')][_0x55e5('0x2b')]({'where':{'type':_0x45b87c,'resourceId':_0x6851f2['id']}})[_0x55e5('0x16')](function(){return _0x23aca5;});})[_0x55e5('0x16')](function(){_0x45bb37[_0x55e5('0x23')](0xcc)[_0x55e5('0x2f')]();});}};}function handleEntityNotFound(_0x463105){return function(_0x1d858c){if(!_0x1d858c){_0x463105[_0x55e5('0x22')](0x194);}return _0x1d858c;};}function handleError(_0xba0900,_0x1cfaf3){_0x1cfaf3=_0x1cfaf3||0x1f4;return function(_0x597b34){logger[_0x55e5('0x1d')](_0x597b34[_0x55e5('0x30')]);if(_0x597b34['name']){delete _0x597b34['name'];}_0xba0900[_0x55e5('0x23')](_0x1cfaf3)[_0x55e5('0x31')](_0x597b34);};}function createInteractionObject(_0x15a7ca,_0x23ac06,_0x5766bb,_0x17e4dc){var _0x4b8c41=require(_0x55e5('0x32'));var _0x19753b=new _0x4b8c41();var _0x3e3c75=_0x19753b[_0x55e5('0x33')](_0x5766bb[_0x55e5('0x34')])['getResult']();var _0x32aa04=_0x23ac06[_0x55e5('0x35')];if(_0x5766bb[_0x55e5('0x36')]){_0x32aa04=_0x5766bb[_0x55e5('0x36')];}else if(_0x5766bb['x-forwarded-for']){_0x32aa04=_['first'](_0x5766bb[_0x55e5('0x37')][_0x55e5('0x38')](','));}return{'ContactId':_0x17e4dc['id'],'ChatWebsiteId':_0x15a7ca,'from':(_0x17e4dc[_0x55e5('0x39')]||'')+'\x20'+(_0x17e4dc[_0x55e5('0x3a')]||''),'customerIp':_0x32aa04,'customerPort':_0x5766bb[_0x55e5('0x3b')]?_0x5766bb[_0x55e5('0x3b')]:null,'referer':_0x23ac06[_0x55e5('0x3c')],'browserName':_0x3e3c75[_0x55e5('0x3d')][_0x55e5('0x3e')]&&_0x3e3c75[_0x55e5('0x3d')][_0x55e5('0x3f')]?util[_0x55e5('0x40')](_0x55e5('0x41'),_0x3e3c75[_0x55e5('0x3d')][_0x55e5('0x3e')],_0x3e3c75[_0x55e5('0x3d')][_0x55e5('0x3f')]):_0x55e5('0x42'),'browserVersion':_0x3e3c75[_0x55e5('0x3d')][_0x55e5('0x3f')]||_0x55e5('0x42'),'osName':util['format'](_0x55e5('0x41'),_0x3e3c75['os'][_0x55e5('0x3e')],_0x3e3c75['os'][_0x55e5('0x3f')]),'osVersion':_0x3e3c75['os'][_0x55e5('0x3f')],'deviceModel':_0x3e3c75['device'][_0x55e5('0x43')]&&_0x3e3c75[_0x55e5('0x44')][_0x55e5('0x45')]?util[_0x55e5('0x40')](_0x55e5('0x46'),_0x3e3c75[_0x55e5('0x44')]['model'],_0x3e3c75['device'][_0x55e5('0x45')],_0x3e3c75['device'][_0x55e5('0x47')]):null,'deviceVendor':_0x3e3c75['device'][_0x55e5('0x45')],'deviceType':_0x3e3c75[_0x55e5('0x44')][_0x55e5('0x47')],'formData':JSON['stringify'](_0x23ac06)};}exports['index']=function(_0xb306a8,_0x3d8570){var _0x16cd97={'include':[{'model':db[_0x55e5('0x48')],'as':_0x55e5('0x49')}]},_0x3f7cf7={},_0x13e88d={'count':0x0,'rows':[]};var _0x3d707e=_[_0x55e5('0x4a')](db[_0x55e5('0x4b')][_0x55e5('0x4c')],function(_0x5b5ba7){return{'name':_0x5b5ba7[_0x55e5('0x4d')],'type':_0x5b5ba7[_0x55e5('0x47')][_0x55e5('0x4e')]};});_0x3f7cf7[_0x55e5('0x43')]=_[_0x55e5('0x4a')](_0x3d707e,_0x55e5('0x3e'));_0x3f7cf7[_0x55e5('0x4f')]=_[_0x55e5('0x50')](_0xb306a8[_0x55e5('0x4f')]);_0x3f7cf7[_0x55e5('0x51')]=_[_0x55e5('0x52')](_0x3f7cf7['model'],_0x3f7cf7[_0x55e5('0x4f')]);_0x16cd97[_0x55e5('0x53')]=_[_0x55e5('0x52')](_0x3f7cf7[_0x55e5('0x43')],qs[_0x55e5('0x54')](_0xb306a8['query'][_0x55e5('0x54')]));_0x16cd97[_0x55e5('0x53')]=_0x16cd97['attributes'][_0x55e5('0x55')]?_0x16cd97[_0x55e5('0x53')]:_0x3f7cf7[_0x55e5('0x43')];if(!_0xb306a8['query'][_0x55e5('0x56')](_0x55e5('0x57'))){_0x16cd97['limit']=qs[_0x55e5('0x25')](_0xb306a8[_0x55e5('0x4f')][_0x55e5('0x25')]);_0x16cd97[_0x55e5('0x24')]=qs[_0x55e5('0x24')](_0xb306a8[_0x55e5('0x4f')]['offset']);}_0x16cd97['order']=qs[_0x55e5('0x58')](_0xb306a8['query'][_0x55e5('0x58')]);_0x16cd97[_0x55e5('0x59')]=qs[_0x55e5('0x51')](_[_0x55e5('0x5a')](_0xb306a8['query'],_0x3f7cf7['filters']),_0x3d707e);if(_0xb306a8[_0x55e5('0x4f')][_0x55e5('0x5b')]){_0x16cd97[_0x55e5('0x59')]=_[_0x55e5('0x5c')](_0x16cd97[_0x55e5('0x59')],{'$or':_[_0x55e5('0x4a')](_0x3d707e,function(_0x54a23b){if(_0x54a23b[_0x55e5('0x47')]!==_0x55e5('0x5d')){var _0x2e361f={};_0x2e361f[_0x54a23b['name']]={'$like':'%'+_0xb306a8[_0x55e5('0x4f')][_0x55e5('0x5b')]+'%'};return _0x2e361f;}})});}_0x16cd97=_[_0x55e5('0x5c')]({},_0x16cd97,_0xb306a8[_0x55e5('0x5e')]);var _0x37aaff={'where':_0x16cd97[_0x55e5('0x59')]};return db['ChatWebsite'][_0x55e5('0x27')](_0x37aaff)['then'](function(_0x172247){_0x13e88d[_0x55e5('0x27')]=_0x172247;if(_0xb306a8[_0x55e5('0x4f')][_0x55e5('0x5f')]){_0x16cd97['include']=[{'all':!![]}];}return db[_0x55e5('0x4b')][_0x55e5('0x60')](_0x16cd97);})[_0x55e5('0x16')](function(_0x4ca930){_0x13e88d['rows']=_0x4ca930;return _0x13e88d;})[_0x55e5('0x16')](respondWithFilteredResult(_0x3d8570,_0x16cd97))[_0x55e5('0x21')](handleError(_0x3d8570,null));};exports['show']=function(_0x5033fa,_0x459631){var _0xedd4e7={'raw':![],'where':{'id':_0x5033fa[_0x55e5('0x61')]['id']},'include':[{'model':db['Pause'],'as':'mandatoryDispositionPause'}]},_0xe90f3f={};_0xe90f3f[_0x55e5('0x43')]=_[_0x55e5('0x50')](db[_0x55e5('0x4b')][_0x55e5('0x4c')]);_0xe90f3f[_0x55e5('0x4f')]=_[_0x55e5('0x50')](_0x5033fa[_0x55e5('0x4f')]);_0xe90f3f[_0x55e5('0x51')]=_['intersection'](_0xe90f3f[_0x55e5('0x43')],_0xe90f3f[_0x55e5('0x4f')]);_0xedd4e7[_0x55e5('0x53')]=_[_0x55e5('0x52')](_0xe90f3f['model'],qs['fields'](_0x5033fa[_0x55e5('0x4f')]['fields']));_0xedd4e7[_0x55e5('0x53')]=_0xedd4e7[_0x55e5('0x53')]['length']?_0xedd4e7['attributes']:_0xe90f3f['model'];if(_0x5033fa[_0x55e5('0x4f')][_0x55e5('0x5f')]){_0xedd4e7[_0x55e5('0x62')]=[{'all':!![]}];}_0xedd4e7=_[_0x55e5('0x5c')]({},_0xedd4e7,_0x5033fa[_0x55e5('0x5e')]);return db[_0x55e5('0x4b')][_0x55e5('0x63')](_0xedd4e7)['then'](handleEntityNotFound(_0x459631,null))['then'](respondWithResult(_0x459631,null))['catch'](handleError(_0x459631,null));};exports[_0x55e5('0x64')]=function(_0x47b35b,_0x5a0efa){if(!wildcardUtils[_0x55e5('0x65')](_0x47b35b['body'][_0x55e5('0x66')])){return handleError(_0x5a0efa,null)(new APIBadRequestError('\x22'+_0x47b35b['body'][_0x55e5('0x66')]+_0x55e5('0x67')));}return db[_0x55e5('0x4b')][_0x55e5('0x64')](_0x47b35b[_0x55e5('0x68')],{})[_0x55e5('0x16')](function(_0x2e4e3e){var _0x8d4550=_0x47b35b['user'][_0x55e5('0x2c')]({'plain':!![]});if(!_0x8d4550)throw new Error(_0x55e5('0x69'));if(_0x8d4550[_0x55e5('0x6a')]==='user'){var _0x492e30=_0x2e4e3e[_0x55e5('0x2c')]({'plain':!![]});var _0x2125ce=_0x55e5('0x2d');return db[_0x55e5('0x6b')][_0x55e5('0x63')]({'where':{'name':_0x2125ce,'userProfileId':_0x8d4550['userProfileId']},'raw':!![]})['then'](function(_0x4d4a86){if(_0x4d4a86&&_0x4d4a86[_0x55e5('0x6c')]===0x0){return db[_0x55e5('0x2e')][_0x55e5('0x64')]({'name':_0x492e30[_0x55e5('0x3e')],'resourceId':_0x492e30['id'],'type':_0x4d4a86[_0x55e5('0x3e')],'sectionId':_0x4d4a86['id']},{})[_0x55e5('0x16')](function(){return _0x2e4e3e;});}else{return _0x2e4e3e;}})[_0x55e5('0x21')](function(_0x4c8060){logger['error'](_0x55e5('0x6d'),_0x4c8060);throw _0x4c8060;});}return _0x2e4e3e;})[_0x55e5('0x16')](respondWithResult(_0x5a0efa,0xc9))[_0x55e5('0x21')](handleError(_0x5a0efa,null));};exports[_0x55e5('0x2a')]=function(_0x42b9da,_0x19fb9c){if(!wildcardUtils[_0x55e5('0x65')](_0x42b9da[_0x55e5('0x68')]['address'])){return handleError(_0x19fb9c,null)(new APIBadRequestError('\x22'+_0x42b9da[_0x55e5('0x68')]['address']+_0x55e5('0x67')));}if(_0x42b9da[_0x55e5('0x68')]['id']){delete _0x42b9da[_0x55e5('0x68')]['id'];}return db[_0x55e5('0x4b')][_0x55e5('0x63')]({'where':{'id':_0x42b9da['params']['id']},'include':[{'model':db[_0x55e5('0x48')],'as':'mandatoryDispositionPause'}]})[_0x55e5('0x16')](handleEntityNotFound(_0x19fb9c,null))[_0x55e5('0x16')](saveUpdates(_0x42b9da['body'],null))['then'](respondWithResult(_0x19fb9c,null))[_0x55e5('0x21')](handleError(_0x19fb9c,null));};exports[_0x55e5('0x2b')]=function(_0x1b5db6,_0x3c6c62){return db[_0x55e5('0x4b')][_0x55e5('0x63')]({'where':{'id':_0x1b5db6['params']['id']}})[_0x55e5('0x16')](handleEntityNotFound(_0x3c6c62,null))[_0x55e5('0x16')](removeEntity(_0x3c6c62,null))[_0x55e5('0x21')](handleError(_0x3c6c62,null));};exports[_0x55e5('0x6e')]=function(_0x435163,_0x2fb63f){return db['ChatWebsite']['describe']()[_0x55e5('0x16')](respondWithResult(_0x2fb63f,null))[_0x55e5('0x21')](handleError(_0x2fb63f,null));};exports['addDisposition']=function(_0x530365,_0x53dc85){if(_0x530365['body']['id']){delete _0x530365[_0x55e5('0x68')]['id'];}return db[_0x55e5('0x4b')][_0x55e5('0x63')]({'where':{'id':_0x530365[_0x55e5('0x61')]['id']}})['then'](handleEntityNotFound(_0x53dc85,null))[_0x55e5('0x16')](function(_0x50303d){if(_0x50303d){_0x530365[_0x55e5('0x68')]['ChatWebsiteId']=_0x50303d['id'];return db[_0x55e5('0x6f')][_0x55e5('0x64')](_0x530365['body']);}})[_0x55e5('0x16')](respondWithResult(_0x53dc85,null))[_0x55e5('0x21')](handleError(_0x53dc85,null));};exports['getDispositions']=function(_0x3685cd,_0x5393d2){var _0x4b5ce2={'raw':![],'where':{}};var _0x2ece56={};var _0x546b86={'count':0x0,'rows':[]};return db[_0x55e5('0x4b')]['findOne']({'where':{'id':_0x3685cd[_0x55e5('0x61')]['id']}})[_0x55e5('0x16')](handleEntityNotFound(_0x5393d2,null))[_0x55e5('0x16')](function(_0xd02ac8){if(_0xd02ac8){_0x2ece56['model']=_[_0x55e5('0x50')](db[_0x55e5('0x6f')]['rawAttributes']);_0x2ece56[_0x55e5('0x4f')]=_[_0x55e5('0x50')](_0x3685cd[_0x55e5('0x4f')]);_0x2ece56[_0x55e5('0x51')]=_['intersection'](_0x2ece56['model'],_0x2ece56[_0x55e5('0x4f')]);_0x4b5ce2['attributes']=_[_0x55e5('0x52')](_0x2ece56[_0x55e5('0x43')],qs[_0x55e5('0x54')](_0x3685cd[_0x55e5('0x4f')][_0x55e5('0x54')]));_0x4b5ce2[_0x55e5('0x53')]=_0x4b5ce2['attributes'][_0x55e5('0x55')]?_0x4b5ce2[_0x55e5('0x53')]:_0x2ece56[_0x55e5('0x43')];if(!_0x3685cd[_0x55e5('0x4f')][_0x55e5('0x56')](_0x55e5('0x57'))){_0x4b5ce2[_0x55e5('0x25')]=qs[_0x55e5('0x25')](_0x3685cd[_0x55e5('0x4f')][_0x55e5('0x25')]);_0x4b5ce2['offset']=qs[_0x55e5('0x24')](_0x3685cd['query'][_0x55e5('0x24')]);}_0x4b5ce2[_0x55e5('0x70')]=qs[_0x55e5('0x58')](_0x3685cd[_0x55e5('0x4f')][_0x55e5('0x58')]);_0x4b5ce2[_0x55e5('0x59')]=qs[_0x55e5('0x51')](_['pick'](_0x3685cd[_0x55e5('0x4f')],_0x2ece56[_0x55e5('0x51')]));_0x4b5ce2['where'][_0x55e5('0x71')]=_0xd02ac8['id'];if(_0x3685cd[_0x55e5('0x4f')]['filter']){_0x4b5ce2[_0x55e5('0x59')]=_[_0x55e5('0x5c')](_0x4b5ce2[_0x55e5('0x59')],{'$or':_[_0x55e5('0x4a')](_0x4b5ce2[_0x55e5('0x53')],function(_0xe5de3b){var _0xf2c29c={};_0xf2c29c[_0xe5de3b]={'$like':'%'+_0x3685cd[_0x55e5('0x4f')][_0x55e5('0x5b')]+'%'};return _0xf2c29c;})});}_0x4b5ce2=_['merge']({},_0x4b5ce2,_0x3685cd[_0x55e5('0x5e')]);return db['Disposition'][_0x55e5('0x27')]({'where':_0x4b5ce2[_0x55e5('0x59')]})[_0x55e5('0x16')](function(_0x16a64d){_0x546b86[_0x55e5('0x27')]=_0x16a64d;if(_0x3685cd[_0x55e5('0x4f')]['includeAll']){_0x4b5ce2[_0x55e5('0x62')]=[{'all':!![]}];}return db['Disposition']['findAll'](_0x4b5ce2);})[_0x55e5('0x16')](function(_0x947a57){_0x546b86[_0x55e5('0x72')]=_0x947a57;return _0x546b86;});}})[_0x55e5('0x16')](respondWithFilteredResult(_0x5393d2,_0x4b5ce2))[_0x55e5('0x21')](handleError(_0x5393d2,null));};exports[_0x55e5('0x73')]=function(_0x302d7d,_0x1da52b){return db[_0x55e5('0x4b')]['find']({'where':{'id':_0x302d7d[_0x55e5('0x61')]['id']}})[_0x55e5('0x16')](handleEntityNotFound(_0x1da52b,null))[_0x55e5('0x16')](function(_0x2565cb){if(_0x2565cb){return _0x2565cb[_0x55e5('0x73')](_0x302d7d[_0x55e5('0x4f')][_0x55e5('0x74')]);}})['then'](respondWithStatusCode(_0x1da52b,null))[_0x55e5('0x21')](handleError(_0x1da52b,null));};exports[_0x55e5('0x75')]=function(_0x13efa7,_0x1570f3){if(_0x13efa7[_0x55e5('0x68')]['id']){delete _0x13efa7[_0x55e5('0x68')]['id'];}return db['ChatWebsite'][_0x55e5('0x63')]({'where':{'id':_0x13efa7[_0x55e5('0x61')]['id']}})[_0x55e5('0x16')](handleEntityNotFound(_0x1570f3,null))['then'](function(_0x2ac473){if(_0x2ac473){_0x13efa7[_0x55e5('0x68')][_0x55e5('0x71')]=_0x2ac473['id'];return db['CannedAnswer'][_0x55e5('0x64')](_0x13efa7[_0x55e5('0x68')]);}})['then'](respondWithResult(_0x1570f3,null))['catch'](handleError(_0x1570f3,null));};exports['getAnswers']=function(_0x538135,_0x10d74f){var _0x1647e1={'raw':![],'where':{}};var _0x34238b={};var _0x3e1ddd={'count':0x0,'rows':[]};return db[_0x55e5('0x4b')][_0x55e5('0x76')]({'where':{'id':_0x538135[_0x55e5('0x61')]['id']}})[_0x55e5('0x16')](handleEntityNotFound(_0x10d74f,null))[_0x55e5('0x16')](function(_0x3399d2){if(_0x3399d2){_0x34238b['model']=_['keys'](db['CannedAnswer'][_0x55e5('0x4c')]);_0x34238b[_0x55e5('0x4f')]=_[_0x55e5('0x50')](_0x538135[_0x55e5('0x4f')]);_0x34238b['filters']=_[_0x55e5('0x52')](_0x34238b[_0x55e5('0x43')],_0x34238b['query']);_0x1647e1[_0x55e5('0x53')]=_['intersection'](_0x34238b[_0x55e5('0x43')],qs[_0x55e5('0x54')](_0x538135[_0x55e5('0x4f')][_0x55e5('0x54')]));_0x1647e1[_0x55e5('0x53')]=_0x1647e1[_0x55e5('0x53')][_0x55e5('0x55')]?_0x1647e1['attributes']:_0x34238b[_0x55e5('0x43')];if(!_0x538135[_0x55e5('0x4f')]['hasOwnProperty'](_0x55e5('0x57'))){_0x1647e1[_0x55e5('0x25')]=qs['limit'](_0x538135['query'][_0x55e5('0x25')]);_0x1647e1['offset']=qs['offset'](_0x538135['query'][_0x55e5('0x24')]);}_0x1647e1[_0x55e5('0x70')]=qs[_0x55e5('0x58')](_0x538135[_0x55e5('0x4f')]['sort']);_0x1647e1[_0x55e5('0x59')]=qs[_0x55e5('0x51')](_[_0x55e5('0x5a')](_0x538135['query'],_0x34238b[_0x55e5('0x51')]));_0x1647e1[_0x55e5('0x59')][_0x55e5('0x71')]=_0x3399d2['id'];if(_0x538135[_0x55e5('0x4f')][_0x55e5('0x5b')]){_0x1647e1[_0x55e5('0x59')]=_['merge'](_0x1647e1[_0x55e5('0x59')],{'$or':_[_0x55e5('0x4a')](_0x1647e1['attributes'],function(_0x417a80){var _0x4996a4={};_0x4996a4[_0x417a80]={'$like':'%'+_0x538135[_0x55e5('0x4f')]['filter']+'%'};return _0x4996a4;})});}_0x1647e1=_['merge']({},_0x1647e1,_0x538135[_0x55e5('0x5e')]);return db['CannedAnswer'][_0x55e5('0x27')]({'where':_0x1647e1[_0x55e5('0x59')]})[_0x55e5('0x16')](function(_0x45c64e){_0x3e1ddd[_0x55e5('0x27')]=_0x45c64e;if(_0x538135[_0x55e5('0x4f')][_0x55e5('0x5f')]){_0x1647e1[_0x55e5('0x62')]=[{'all':!![]}];}return db[_0x55e5('0x77')]['findAll'](_0x1647e1);})[_0x55e5('0x16')](function(_0x2728ea){_0x3e1ddd[_0x55e5('0x72')]=_0x2728ea;return _0x3e1ddd;});}})[_0x55e5('0x16')](respondWithFilteredResult(_0x10d74f,_0x1647e1))[_0x55e5('0x21')](handleError(_0x10d74f,null));};exports[_0x55e5('0x78')]=function(_0xf6bdd3,_0x1d0bf6){return db[_0x55e5('0x4b')][_0x55e5('0x63')]({'where':{'id':_0xf6bdd3[_0x55e5('0x61')]['id']}})[_0x55e5('0x16')](handleEntityNotFound(_0x1d0bf6,null))['then'](function(_0x20fdae){if(_0x20fdae){return _0x20fdae[_0x55e5('0x78')](_0xf6bdd3[_0x55e5('0x4f')]['ids']);}})[_0x55e5('0x16')](respondWithStatusCode(_0x1d0bf6,null))[_0x55e5('0x21')](handleError(_0x1d0bf6,null));};exports[_0x55e5('0x79')]=function(_0x477ca0,_0x3827b9){_0x477ca0[_0x55e5('0x68')][_0x55e5('0x7a')]=_0x477ca0[_0x55e5('0x7b')][_0x55e5('0x7c')];return db[_0x55e5('0x4b')][_0x55e5('0x63')]({'where':{'id':_0x477ca0[_0x55e5('0x61')]['id']}})[_0x55e5('0x16')](handleEntityNotFound(_0x3827b9,null))[_0x55e5('0x16')](saveUpdates(_0x477ca0[_0x55e5('0x68')],null))['then'](respondWithResult(_0x3827b9,null))[_0x55e5('0x21')](handleError(_0x3827b9,null));};exports[_0x55e5('0x7d')]=function(_0x47ca47,_0x4712d6){_0x47ca47[_0x55e5('0x68')][_0x55e5('0x7e')]=_0x47ca47['file'][_0x55e5('0x7c')];return db['ChatWebsite']['find']({'where':{'id':_0x47ca47[_0x55e5('0x61')]['id']}})['then'](handleEntityNotFound(_0x4712d6,null))['then'](saveUpdates(_0x47ca47[_0x55e5('0x68')],null))[_0x55e5('0x16')](respondWithResult(_0x4712d6,null))[_0x55e5('0x21')](handleError(_0x4712d6,null));};exports[_0x55e5('0x7f')]=function(_0x40fd1e,_0x57477f){_0x40fd1e[_0x55e5('0x68')][_0x55e5('0x80')]=_0x40fd1e['file']['filename'];return db[_0x55e5('0x4b')][_0x55e5('0x63')]({'where':{'id':_0x40fd1e[_0x55e5('0x61')]['id']}})[_0x55e5('0x16')](handleEntityNotFound(_0x57477f,null))[_0x55e5('0x16')](saveUpdates(_0x40fd1e[_0x55e5('0x68')],null))[_0x55e5('0x16')](respondWithResult(_0x57477f,null))[_0x55e5('0x21')](handleError(_0x57477f,null));};exports[_0x55e5('0x81')]=function(_0x1c688a,_0x512a8c){_0x1c688a[_0x55e5('0x68')][_0x55e5('0x82')]=_0x1c688a[_0x55e5('0x7b')][_0x55e5('0x7c')];return db[_0x55e5('0x4b')][_0x55e5('0x63')]({'where':{'id':_0x1c688a[_0x55e5('0x61')]['id']}})[_0x55e5('0x16')](handleEntityNotFound(_0x512a8c,null))['then'](saveUpdates(_0x1c688a[_0x55e5('0x68')],null))['then'](respondWithResult(_0x512a8c,null))['catch'](handleError(_0x512a8c,null));};exports[_0x55e5('0x83')]=function(_0x1ef5cc,_0x29e60d){var _0x4968e6=path[_0x55e5('0x84')](config[_0x55e5('0x85')],_0x55e5('0x86'));var _0x1e1969={'where':{'id':_0x1ef5cc[_0x55e5('0x61')]['id']},'attributes':['id',_0x55e5('0x7a')],'raw':!![]};var _0x89b038=![];return require(_0x55e5('0x87'))[_0x55e5('0x88')]()['then'](function(_0x288868){if(_0x288868){_0x89b038=_0x288868[_0x55e5('0x89')];}})[_0x55e5('0x16')](function(){return db[_0x55e5('0x4b')][_0x55e5('0x63')](_0x1e1969);})[_0x55e5('0x16')](handleEntityNotFound(_0x29e60d,null))['then'](function(_0x3636a3){if(_0x3636a3){if(!_[_0x55e5('0x8a')](_0x3636a3['sitepic'])){if(fs[_0x55e5('0x8b')](path[_0x55e5('0x84')](config[_0x55e5('0x85')],'server/files/images/logos/',_0x3636a3[_0x55e5('0x7a')]))&&_0x89b038){_0x4968e6=path[_0x55e5('0x84')](config[_0x55e5('0x85')],_0x55e5('0x8c'),_0x3636a3['sitepic']);}}return _0x29e60d['download'](_0x4968e6);}})['catch'](handleError(_0x29e60d,null));};exports[_0x55e5('0x8d')]=function(_0x530ba4,_0x23df1a){var _0x4b70a4=path[_0x55e5('0x84')](config[_0x55e5('0x85')],'server/files/images/avatars/default_avatar.png');var _0x394de4={'where':{'id':_0x530ba4[_0x55e5('0x61')]['id']},'attributes':['id',_0x55e5('0x7e')],'raw':!![]};return db[_0x55e5('0x4b')][_0x55e5('0x63')](_0x394de4)[_0x55e5('0x16')](handleEntityNotFound(_0x23df1a,null))[_0x55e5('0x16')](function(_0x5d1143){if(_0x5d1143){if(!_[_0x55e5('0x8a')](_0x5d1143[_0x55e5('0x7e')])){if(fs[_0x55e5('0x8b')](path[_0x55e5('0x84')](config[_0x55e5('0x85')],_0x55e5('0x8e'),_0x5d1143['agentAvatar']))){_0x4b70a4=path['join'](config[_0x55e5('0x85')],_0x55e5('0x8e'),_0x5d1143[_0x55e5('0x7e')]);}}return _0x23df1a[_0x55e5('0x8f')](_0x4b70a4);}})[_0x55e5('0x21')](handleError(_0x23df1a,null));};exports['getCustomerAvatar']=function(_0x20adb8,_0x35fb31){var _0x17c490=path['join'](config[_0x55e5('0x85')],_0x55e5('0x90'));var _0x1eae1d={'where':{'id':_0x20adb8[_0x55e5('0x61')]['id']},'attributes':['id',_0x55e5('0x80'),_0x55e5('0x91')],'raw':!![]};return db['ChatWebsite'][_0x55e5('0x63')](_0x1eae1d)[_0x55e5('0x16')](handleEntityNotFound(_0x35fb31,null))[_0x55e5('0x16')](function(_0xf4fd89){if(_0xf4fd89){if(!_[_0x55e5('0x8a')](_0xf4fd89[_0x55e5('0x80')])){if(fs[_0x55e5('0x8b')](path[_0x55e5('0x84')](config['root'],'server/files/images/avatars/',_0xf4fd89[_0x55e5('0x80')]))&&_0xf4fd89[_0x55e5('0x91')]){_0x17c490=path[_0x55e5('0x84')](config[_0x55e5('0x85')],_0x55e5('0x8e'),_0xf4fd89[_0x55e5('0x80')]);}}return _0x35fb31[_0x55e5('0x8f')](_0x17c490);}})[_0x55e5('0x21')](handleError(_0x35fb31,null));};exports[_0x55e5('0x92')]=function(_0x1f55f7,_0x42d70d){var _0x247893=path[_0x55e5('0x84')](config[_0x55e5('0x85')],_0x55e5('0x93'));var _0x90e29b={'where':{'id':_0x1f55f7[_0x55e5('0x61')]['id']},'attributes':['id',_0x55e5('0x82')],'raw':!![]};return db[_0x55e5('0x4b')][_0x55e5('0x63')](_0x90e29b)[_0x55e5('0x16')](handleEntityNotFound(_0x42d70d,null))[_0x55e5('0x16')](function(_0x1aa746){if(_0x1aa746){if(!_[_0x55e5('0x8a')](_0x1aa746['systemAvatar'])){if(fs[_0x55e5('0x8b')](path['join'](config[_0x55e5('0x85')],_0x55e5('0x8e'),_0x1aa746['systemAvatar']))){_0x247893=path[_0x55e5('0x84')](config[_0x55e5('0x85')],_0x55e5('0x8e'),_0x1aa746[_0x55e5('0x82')]);}}return _0x42d70d[_0x55e5('0x8f')](_0x247893);}})['catch'](handleError(_0x42d70d,null));};function checkWebsiteInterval(_0x5dcc47){var _0x379ebf=_0x5dcc47[_0x55e5('0x94')];if(!_0x379ebf){return Promise[_0x55e5('0x95')](_0x5dcc47);}var _0x32e1c1=_0x5dcc47['timezone']||undefined;return _0x379ebf['ifTime'](_0x32e1c1)[_0x55e5('0x16')](function(_0x2eed07){if(!_0x2eed07){throw new APIOutOfIntervalError();}return _0x5dcc47;});}exports[_0x55e5('0x96')]=function(_0x4021f4,_0x597541){var _0x47f8c8={'body':_0x4021f4['body'],'channel':_0x55e5('0x97')};var _0x3e27fe=[];var _0x196fb4=[];var _0x5cc60f={};var _0x114b51=![];if(_0x4021f4[_0x55e5('0x68')]['id']){delete _0x4021f4[_0x55e5('0x68')]['id'];}if(_[_0x55e5('0x8a')](_0x4021f4['body'][_0x55e5('0x98')])){throw new APIBadRequestError(_0x55e5('0x99'));}if(_[_0x55e5('0x8a')](_0x4021f4[_0x55e5('0x68')][_0x55e5('0x9a')])){throw new APIBadRequestError(_0x55e5('0x9b'));}if(_[_0x55e5('0x9c')](_0x4021f4[_0x55e5('0x68')][_0x55e5('0x68')])){throw new APIBadRequestError(_0x55e5('0x9d'));}var _0x3d22ba=_0x4021f4['body']['customerIp']&&_0x4021f4[_0x55e5('0x68')][_0x55e5('0x3c')];return db[_0x55e5('0x9e')][_0x55e5('0x6e')]()[_0x55e5('0x16')](function(_0x35304f){if(!_0x35304f){throw new Error(_0x55e5('0x9f'));}_0x3e27fe=Object[_0x55e5('0x50')](_0x35304f)['filter'](function(_0x127a7b){return!['createdAt',_0x55e5('0xa0')][_0x55e5('0xa1')](_0x127a7b);});_0x196fb4=Object[_0x55e5('0x50')](_0x35304f)[_0x55e5('0x5b')](function(_0x5231b9){return![_0x55e5('0xa2'),'updatedAt','CompanyId','ListId'][_0x55e5('0xa1')](_0x5231b9);});if(!_[_0x55e5('0xa1')](_0x196fb4,_0x4021f4[_0x55e5('0x68')][_0x55e5('0x9a')])){throw new APIBadRequestError(_0x55e5('0xa3')+_0x196fb4[_0x55e5('0x84')](',\x20'));}_0x5cc60f[_0x4021f4[_0x55e5('0x68')][_0x55e5('0x9a')]]=_0x4021f4['body']['from'];})[_0x55e5('0x16')](function(){return db['ChatWebsite'][_0x55e5('0x63')]({'where':{'id':_0x4021f4[_0x55e5('0x61')]['id']},'include':[{'model':db[_0x55e5('0xa4')],'as':_0x55e5('0xa5'),'include':[{'model':db['CmContact'],'as':'Contacts','where':_0x5cc60f,'limit':0x1,'order':[[_0x55e5('0xa0'),_0x55e5('0xa6')]]}]},{'model':db[_0x55e5('0xa7')],'as':'Applications'},{'model':db[_0x55e5('0x94')],'as':_0x55e5('0x94'),'include':[{'model':db[_0x55e5('0x94')],'as':_0x55e5('0xa8'),'attributes':['id',_0x55e5('0xa9')],'raw':!![]}]}]});})[_0x55e5('0x16')](function(_0x59f3e5){if(!_0x59f3e5){throw new APINotFoundError(util['format'](_0x55e5('0xaa'),_0x4021f4[_0x55e5('0x61')]['id']));}if(_0x3d22ba){return checkWebsiteInterval(_0x59f3e5);}return _0x59f3e5;})[_0x55e5('0x16')](function(_0x3dc7c2){_0x47f8c8[_0x55e5('0xab')]=_0x3dc7c2;_0x47f8c8[_0x55e5('0xac')]=_[_0x55e5('0xad')](_0x3dc7c2[_0x55e5('0xae')],[_0x55e5('0xaf')],[_0x55e5('0xb0')]);if(_0x47f8c8[_0x55e5('0xab')][_0x55e5('0xae')]){delete _0x47f8c8['account'][_0x55e5('0xae')];}_0x47f8c8[_0x55e5('0xb1')]=_0x3dc7c2['List']||{'id':_0x3dc7c2[_0x55e5('0xb2')]};if(_0x47f8c8[_0x55e5('0xb1')]&&_0x47f8c8[_0x55e5('0xb1')][_0x55e5('0xb3')][_0x55e5('0x55')]){return _0x47f8c8[_0x55e5('0xb1')][_0x55e5('0xb3')][0x0];}var _0x4c703f=_[_0x55e5('0x10')](_0x4021f4[_0x55e5('0x68')],{'firstName':_0x4021f4[_0x55e5('0x68')][_0x55e5('0x98')],'ListId':_0x3dc7c2['ListId']});_0x4c703f[_0x4021f4[_0x55e5('0x68')][_0x55e5('0x9a')]]=_0x4021f4[_0x55e5('0x68')][_0x55e5('0x98')];return db['CmContact']['create'](_0x4c703f,{'fields':_0x3e27fe,'raw':!![]});})[_0x55e5('0x16')](function(_0x24bbca){_0x47f8c8[_0x55e5('0xb4')]=_0x24bbca;var _0x43b7a3=createInteractionObject(_0x4021f4[_0x55e5('0x61')]['id'],_0x4021f4[_0x55e5('0x68')],_0x4021f4[_0x55e5('0xb5')],_0x24bbca);var _0x28ecfd={'ChatWebsiteId':_0x4021f4[_0x55e5('0x61')]['id']};if(_0x4021f4[_0x55e5('0x68')][_0x55e5('0xb6')]){_0x28ecfd[_0x55e5('0xb6')]=_0x4021f4[_0x55e5('0x68')][_0x55e5('0xb6')];_0x28ecfd[_0x55e5('0xb7')]=![];return db[_0x55e5('0xb8')][_0x55e5('0x63')]({'where':_0x28ecfd})[_0x55e5('0x16')](function(_0x9953b){var _0x548dc2=_0x4021f4['body'][_0x55e5('0x35')]&&_0x4021f4[_0x55e5('0x68')][_0x55e5('0x3c')];if(_0x9953b){_0x114b51=!![];return _0x9953b;}else if(!_0x548dc2&&_0x9953b&&_0x9953b[_0x55e5('0xb7')]){throw new APIConflictError(_0x55e5('0xb9'));}_0x43b7a3['threadId']=_0x4021f4[_0x55e5('0x68')]['threadId'];_0x43b7a3[_0x55e5('0xba')]=_0x4021f4[_0x55e5('0x68')][_0x55e5('0xba')];return db[_0x55e5('0xb8')][_0x55e5('0x64')](_0x43b7a3);});}_0x28ecfd[_0x55e5('0xbb')]=_0x24bbca['id'];if(_0x4021f4[_0x55e5('0x68')]['interaction']&&_0x4021f4['body'][_0x55e5('0xbc')]['id']){_0x28ecfd['id']=_0x4021f4[_0x55e5('0x68')][_0x55e5('0xbc')]['id'];return db['ChatInteraction'][_0x55e5('0x63')]({'where':_0x28ecfd})[_0x55e5('0x16')](function(_0x4d9800){var _0x50f7ea=_0x4021f4[_0x55e5('0x68')][_0x55e5('0x35')]&&_0x4021f4[_0x55e5('0x68')][_0x55e5('0x3c')];if(!_0x50f7ea&&_0x4d9800&&_0x4d9800[_0x55e5('0xb7')]){throw new APIConflictError(_0x55e5('0xb9'));}else if(_0x4d9800){_0x114b51=!![];return _0x4d9800;}else{return db[_0x55e5('0xb8')][_0x55e5('0x64')](_0x43b7a3);}});}return db['ChatInteraction'][_0x55e5('0x64')](_0x43b7a3);})[_0x55e5('0x16')](function(_0x2d4d26){if(!_0x114b51){return _0x2d4d26;}var _0x59a0c3={'from':(_0x47f8c8['contact'][_0x55e5('0x39')]||'')+'\x20'+(_0x47f8c8[_0x55e5('0xb4')][_0x55e5('0x3a')]||'')};if(_0x4021f4[_0x55e5('0x68')][_0x55e5('0xb6')]&&_0x4021f4[_0x55e5('0x68')][_0x55e5('0xbd')]&&_0x4021f4[_0x55e5('0x68')]['threadId']!=_0x4021f4['body']['messageId']){_0x59a0c3[_0x55e5('0xb6')]=_0x4021f4[_0x55e5('0x68')]['messageId'];}return _0x2d4d26[_0x55e5('0x2a')](_0x59a0c3);})[_0x55e5('0x16')](function(_0x3136d1){_0x47f8c8['interaction']=_0x3136d1[_0x55e5('0x2c')]({'plain':!![]});_0x47f8c8[_0x55e5('0xbc')]['created']=!_0x114b51;if(_0x47f8c8['interaction'][_0x55e5('0xbe')]){if(_0x47f8c8[_0x55e5('0xab')]['autoclose']){_0x47f8c8[_0x55e5('0xac')][_0x55e5('0xbf')]({'id':0x0,'priority':_0x47f8c8[_0x55e5('0xac')][_0x55e5('0x55')]+0x1,'app':_0x55e5('0xc0'),'appdata':'unmanaged','interval':_0x55e5('0xc1')});}}return db[_0x55e5('0xc2')]['create']({'body':_0x4021f4[_0x55e5('0x68')][_0x55e5('0x68')],'ChatWebsiteId':_0x4021f4[_0x55e5('0x61')]['id'],'ChatInteractionId':_0x3136d1['id'],'direction':'in','ContactId':_0x47f8c8[_0x55e5('0xb4')]['id'],'AttachmentId':_0x4021f4[_0x55e5('0x68')][_0x55e5('0xc3')]});})[_0x55e5('0x16')](function(_0x2b5cfa){_0x47f8c8[_0x55e5('0x1f')]=_0x2b5cfa;if(!_0x47f8c8[_0x55e5('0xbc')][_0x55e5('0xc4')]){return;}return db[_0x55e5('0xc5')][_0x55e5('0x63')]({'attributes':['id',_0x55e5('0x3e')],'where':{'id':_0x47f8c8[_0x55e5('0xbc')]['UserId']}});})[_0x55e5('0x16')](function(_0x2c71ba){if(_0x2c71ba){_0x47f8c8[_0x55e5('0xac')]['unshift']({'id':0x0,'priority':0x0,'app':'agent','appdata':_0x2c71ba['name']+','+(_0x47f8c8[_0x55e5('0xab')][_0x55e5('0xc6')]||0xa),'interval':_0x55e5('0xc1')});_0x47f8c8[_0x55e5('0xc7')]=!![];}if(!_0x47f8c8[_0x55e5('0xbc')][_0x55e5('0xc8')]){return;}return db['ChatQueue'][_0x55e5('0x63')]({'attributes':['id','name'],'where':{'id':_0x47f8c8['interaction'][_0x55e5('0xc8')]}});})['then'](function(_0x48aeb2){if(_0x48aeb2){_0x47f8c8[_0x55e5('0xac')][_0x55e5('0xc9')]({'id':0x0,'priority':0x1,'app':'queue','appdata':_0x48aeb2[_0x55e5('0x3e')]+','+(_0x47f8c8[_0x55e5('0xab')][_0x55e5('0xca')]||0x12c),'interval':'*,*,*,*'});}return respondWithRpcPromise(_0x55e5('0xcb'),_0x55e5('0xcc'),_0x47f8c8);})['then'](function(_0x3eb572){respondWithRpcPromise(_0x55e5('0xcd'),_0x55e5('0xcd'),{'event':_0x55e5('0x96'),'message':_0x3eb572},client9002);return _0x3eb572;})[_0x55e5('0x16')](respondWithResult(_0x597541,null))[_0x55e5('0x21')](APIHandleError(_0x597541));};exports['offline']=function(_0x2c7aab,_0x270f41){var _0x4abdee,_0x58ede9,_0x1b5ccf;var _0x4bfee5=[];var _0xca0cdb={};var _0x499d64=_0x2c7aab[_0x55e5('0xce')]||[];var _0x1671d6=[];var _0xd9711c;return db['CmContact'][_0x55e5('0x6e')]()[_0x55e5('0x16')](function(_0x507386){if(!_0x507386){throw new db[(_0x55e5('0xcf'))][(_0x55e5('0xd0'))]('no\x20available\x20attributes');}_0x4bfee5=_[_0x55e5('0xd1')](_['keys'](_0x507386),[_0x55e5('0xa2'),_0x55e5('0xa0'),'CompanyId','ListId']);if(_0x2c7aab[_0x55e5('0x68')]['id']){delete _0x2c7aab[_0x55e5('0x68')]['id'];}if(_[_0x55e5('0x8a')](_0x2c7aab[_0x55e5('0x68')][_0x55e5('0x98')])){throw _0x270f41[_0x55e5('0x23')](0x1f4)['send'](new db['Sequelize'][(_0x55e5('0xd0'))](_0x55e5('0xd2')));}if(_[_0x55e5('0x8a')](_0x2c7aab['body'][_0x55e5('0x68')])||_0x2c7aab[_0x55e5('0x68')][_0x55e5('0x68')]===''){throw _0x270f41['status'](0x1f4)[_0x55e5('0x31')](new db['Sequelize'][(_0x55e5('0xd0'))](_0x55e5('0xd3')));}if(_[_0x55e5('0x8a')](_0x2c7aab[_0x55e5('0x68')][_0x55e5('0xd4')])){throw _0x270f41[_0x55e5('0x23')](0x1f4)[_0x55e5('0x31')](new db[(_0x55e5('0xcf'))]['ValidationError'](_0x55e5('0xd5')+_0x4bfee5));}if(!_[_0x55e5('0xa1')](_0x4bfee5,_0x2c7aab[_0x55e5('0x68')][_0x55e5('0xd4')])){throw _0x270f41['status'](0x1f4)[_0x55e5('0x31')](new db[(_0x55e5('0xcf'))]['ValidationError']('mapKeyOffline\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20'+_0x4bfee5));}_0xca0cdb[_0x2c7aab[_0x55e5('0x68')][_0x55e5('0xd4')]]=_0x2c7aab[_0x55e5('0x68')][_0x55e5('0x98')];})[_0x55e5('0x16')](function(){return db[_0x55e5('0x4b')][_0x55e5('0x63')]({'where':{'id':_0x2c7aab[_0x55e5('0x61')]['id']},'include':[{'model':db[_0x55e5('0xa4')],'as':'List'},{'model':db[_0x55e5('0xd6')],'as':'MailAccount'}]});})['then'](handleEntityNotFound(_0x270f41,null))['then'](function(_0x8801a5){if(_0x8801a5&&_0x8801a5['List']){_0x58ede9=_0x8801a5;var _0x2ec8c7=_['defaults'](_0x2c7aab[_0x55e5('0x68')],{'firstName':_0x2c7aab[_0x55e5('0x68')][_0x55e5('0x98')],'phone':_0x2c7aab[_0x55e5('0x68')][_0x55e5('0x98')],'ListId':_0x8801a5['ListId']});_0x2ec8c7[_0x2c7aab[_0x55e5('0x68')][_0x55e5('0xd4')]]=_0x2c7aab[_0x55e5('0x68')][_0x55e5('0x98')];return db['CmContact']['findOrCreate']({'where':_0xca0cdb,'defaults':_0x2ec8c7});}})[_0x55e5('0xd7')](function(_0x1e4b8f){if(_0x1e4b8f){_0x1b5ccf=_0x1e4b8f;var _0x6a5c09=fs[_0x55e5('0xd8')](path[_0x55e5('0x84')](config[_0x55e5('0x85')],_0x55e5('0xd9')),_0x55e5('0xda'));var _0x5e9b31=ejs[_0x55e5('0xdb')](_0x6a5c09,{'body':_['toPairs'](_0x2c7aab[_0x55e5('0x68')][_0x55e5('0x68')]),'bodyTitle':_0x58ede9[_0x55e5('0xdc')]});return db[_0x55e5('0xdd')][_0x55e5('0x64')]({'body':_0x5e9b31,'plainBody':htmlToText[_0x55e5('0xde')](_0x5e9b31),'ContactId':_0x1e4b8f['id'],'ChatWebsiteId':_0x58ede9['id']});}})[_0x55e5('0x16')](function(_0x30156e){_0xd9711c=_0x30156e;if(_0x499d64[_0x55e5('0x55')]){var _0x3bd17b=_0x499d64[_0x55e5('0x4a')](function(_0x5153a4){return{'name':_0x5153a4[_0x55e5('0xdf')],'basename':_0x5153a4[_0x55e5('0x7c')],'type':_0x5153a4[_0x55e5('0xe0')],'ChatOfflineMessageId':_0x30156e['id']};});_0x1671d6=_0x3bd17b['map'](_0x48b350=>{var _0x1c4c1c={'filename':_0x48b350['name'],'path':path['join'](config[_0x55e5('0x85')],_0x55e5('0xe1'),_0x55e5('0xce'),_0x55e5('0xe2'),'offline-chat',_0x48b350['basename'])};return _0x1c4c1c;});if(!_0x58ede9[_0x55e5('0xe3')]){return db[_0x55e5('0xe4')]['transaction'](function(_0x875d70){return db[_0x55e5('0xe5')][_0x55e5('0xe6')](_0x3bd17b,{'transaction':_0x875d70});});}}})['then'](function(){if(_0xd9711c){_0x4abdee=_0xd9711c;return db['MailAccount'][_0x55e5('0x76')]({'where':{'service':!![]},'include':[{'model':db[_0x55e5('0xe7')],'as':_0x55e5('0xe8'),'raw':!![],'include':[{'model':db[_0x55e5('0xe9')],'as':_0x55e5('0xe9'),'raw':!![]}]}]});}})['then'](function(_0x35e086){if(_0x35e086&&_0x35e086['Smtp']&&_0x58ede9[_0x55e5('0xea')]&&_0x58ede9[_0x55e5('0xeb')]){var _0x20147e=_0x35e086['getSmtpOptions']();return respondWithRpcPromise(_0x55e5('0xec'),'sendMail',{'account':_0x20147e,'message':{'from':util[_0x55e5('0x40')](_0x55e5('0xed'),_0x35e086[_0x55e5('0x3e')],_0x35e086[_0x55e5('0xee')]||_0x35e086[_0x55e5('0xe8')]['user']),'to':_0x58ede9[_0x55e5('0xeb')],'subject':_0x58ede9['offlineMessageSubject'],'html':_0x4abdee[_0x55e5('0x68')],'attachments':_0x1671d6}},client9003)[_0x55e5('0x16')](function(){return _0x4abdee;})['catch'](function(_0x1859cf){logger[_0x55e5('0x1d')](_0x1859cf);});}})['then'](function(){if(_0x58ede9&&_0x58ede9[_0x55e5('0xe3')]&&_0x58ede9[_0x55e5('0xef')]){var _0x28a745=[];if(_0x499d64[_0x55e5('0x55')]){_0x28a745=_0x499d64[_0x55e5('0x4a')](function(_0x5e7c97){return{'name':_0x5e7c97['originalname'],'basename':_0x5e7c97['filename'],'type':_0x5e7c97[_0x55e5('0xe0')],'ChatOfflineMessageId':_0xd9711c['id']};});}var _0x1b5623;if(!_[_0x55e5('0x8a')](_0x58ede9[_0x55e5('0xf0')])){var _0x157070=_[_0x55e5('0x4a')](_0x2c7aab[_0x55e5('0x68')],function(_0x46b51d){return _0x46b51d;});var _0x50a065=_[_0x55e5('0xf1')](_0x157070)[0x0];var _0x1e8a86=_[_0x55e5('0xf2')](_0x50a065,function(_0x50237c){return _0x50237c;});_0x1b5623=_0x1e8a86[0x1][_0x58ede9[_0x55e5('0xf0')]];}var _0x5d8d84={'from':_0x1b5ccf[_0x55e5('0xee')],'firstName':_0x1b5ccf[_0x55e5('0x39')],'lastName':_0x1b5ccf['lastName'],'mapKey':_0x55e5('0xee'),'message':{'from':_0x1b5ccf[_0x55e5('0xee')],'to':_0x58ede9[_0x55e5('0xd6')]['email'],'cc':'','subject':_[_0x55e5('0x8a')](_0x1b5623)?_0x58ede9['offlineMessageSubject']:_0x1b5623,'messageId':'','sentAt':new Date(),'attach':_0x28a745[_0x55e5('0x55')],'attachments':_0x28a745,'originChannel':_0x55e5('0xf3'),'ChatWebsiteId':_0x58ede9['id'],'ChatOfflineMessageId':_0x4abdee['id'],'originTo':_0x58ede9[_0x55e5('0xd6')][_0x55e5('0xee')]},'body':_0x4abdee[_0x55e5('0x68')]};var _0x2babf6={'account':{'id':_0x58ede9[_0x55e5('0xef')]},'body':_0x5d8d84,'log':_0x55e5('0xf4')};return respondWithRpcPromise(_0x55e5('0xf4'),'notifyMail',_0x2babf6,client9001)[_0x55e5('0x16')](function(){return _0x4abdee;})[_0x55e5('0x21')](function(_0x3ede48){logger[_0x55e5('0x1d')](_0x3ede48);});}return;})[_0x55e5('0x16')](function(){if(_0x4abdee){return _0x4abdee;}})[_0x55e5('0x16')](respondWithResult(_0x270f41,null))[_0x55e5('0x21')](function(){for(var _0x2c1f72 of _0x499d64){var _0x26ee1b=path[_0x55e5('0x84')](config[_0x55e5('0x85')],_0x55e5('0xe1'),'files',_0x55e5('0xe2'),_0x55e5('0xf5'),_0x2c1f72[_0x55e5('0x7c')]);fs_extra['remove'](_0x26ee1b)[_0x55e5('0x21')](function(_0x331794){logger[_0x55e5('0x1d')](_0x55e5('0xf6'),_0x26ee1b,_0x331794);});}});};exports[_0x55e5('0xf7')]=function(_0x4ca6b5,_0xdfc662){return db['ChatInteraction'][_0x55e5('0x63')]({'where':{'id':_0x4ca6b5[_0x55e5('0x61')]['id']}})[_0x55e5('0x16')](handleEntityNotFound(_0xdfc662,null))['then'](function(_0x43f4da){if(_0x43f4da){return _0x43f4da[_0x55e5('0xf7')](_0x4ca6b5['body']['ids'],_[_0x55e5('0xf8')](_0x4ca6b5[_0x55e5('0x68')],[_0x55e5('0x74'),'id'])||{});}})['then'](respondWithResult(_0xdfc662,null))[_0x55e5('0x21')](handleError(_0xdfc662,null));};exports[_0x55e5('0xf9')]=function(_0x4d582c,_0x5d3575){var _0x4e730e={'raw':![],'where':{}};var _0x2154da={};var _0x268133={'count':0x0,'rows':[]};return db['ChatWebsite'][_0x55e5('0x76')]({'where':{'id':_0x4d582c[_0x55e5('0x61')]['id']}})[_0x55e5('0x16')](handleEntityNotFound(_0x5d3575,null))['then'](function(_0xfcfd88){if(_0xfcfd88){_0x2154da[_0x55e5('0x43')]=_['keys'](db['ChatInteraction'][_0x55e5('0x4c')]);_0x2154da['query']=_['keys'](_0x4d582c[_0x55e5('0x4f')]);_0x2154da['filters']=_[_0x55e5('0x52')](_0x2154da[_0x55e5('0x43')],_0x2154da[_0x55e5('0x4f')]);_0x4e730e['attributes']=_['intersection'](_0x2154da[_0x55e5('0x43')],qs[_0x55e5('0x54')](_0x4d582c[_0x55e5('0x4f')][_0x55e5('0x54')]));_0x4e730e['attributes']=_0x4e730e[_0x55e5('0x53')][_0x55e5('0x55')]?_0x4e730e[_0x55e5('0x53')]:_0x2154da['model'];if(!_0x4d582c[_0x55e5('0x4f')][_0x55e5('0x56')](_0x55e5('0x57'))){_0x4e730e[_0x55e5('0x25')]=qs['limit'](_0x4d582c[_0x55e5('0x4f')]['limit']);_0x4e730e[_0x55e5('0x24')]=qs[_0x55e5('0x24')](_0x4d582c['query'][_0x55e5('0x24')]);}_0x4e730e['order']=qs['sort'](_0x4d582c['query'][_0x55e5('0x58')]);_0x4e730e[_0x55e5('0x59')]=qs[_0x55e5('0x51')](_[_0x55e5('0x5a')](_0x4d582c['query'],_0x2154da[_0x55e5('0x51')]));_0x4e730e[_0x55e5('0x59')][_0x55e5('0x71')]=_0xfcfd88['id'];if(_0x4d582c[_0x55e5('0x4f')][_0x55e5('0x5b')]){_0x4e730e[_0x55e5('0x59')]=_[_0x55e5('0x5c')](_0x4e730e[_0x55e5('0x59')],{'$or':_['map'](_0x4e730e[_0x55e5('0x53')],function(_0x3f1fba){var _0x3b19c8={};_0x3b19c8[_0x3f1fba]={'$like':'%'+_0x4d582c[_0x55e5('0x4f')]['filter']+'%'};return _0x3b19c8;})});}_0x4e730e=_[_0x55e5('0x5c')]({},_0x4e730e,_0x4d582c[_0x55e5('0x5e')]);return db['ChatInteraction']['count']({'where':_0x4e730e['where']})['then'](function(_0x1c376c){_0x268133[_0x55e5('0x27')]=_0x1c376c;if(_0x4d582c[_0x55e5('0x4f')]['includeAll']){_0x4e730e['include']=[{'model':db[_0x55e5('0x9e')],'as':_0x55e5('0xfa'),'required':![]},{'model':db[_0x55e5('0xc5')],'as':_0x55e5('0xfb'),'attributes':['name',_0x55e5('0xfc'),'internal'],'required':![]},{'model':db[_0x55e5('0xfd')],'as':_0x55e5('0xfe'),'attributes':['id',_0x55e5('0x3e'),'color'],'where':_0x4d582c[_0x55e5('0x4f')][_0x55e5('0xff')]?{'id':_0x4d582c[_0x55e5('0x4f')][_0x55e5('0xff')]}:undefined,'required':_0x4d582c[_0x55e5('0x4f')][_0x55e5('0xff')]?!![]:![]}];}return db[_0x55e5('0xb8')]['findAll'](_0x4e730e);})[_0x55e5('0x16')](function(_0x366bc5){_0x268133[_0x55e5('0x72')]=_0x366bc5;return _0x268133;});}})[_0x55e5('0x16')](respondWithFilteredResult(_0x5d3575,_0x4e730e))[_0x55e5('0x21')](handleError(_0x5d3575,null));};exports[_0x55e5('0x100')]=function(_0x370133,_0x578a6d){var _0x98f4f0=0x0;var _0x3117c1=0x0;var _0x1f54b9=![];var _0x2b4e86;var _0x17b29e;return db[_0x55e5('0x4b')]['find']({'where':{'id':_0x370133[_0x55e5('0x61')]['id']},'include':[{'model':db['Interval'],'as':_0x55e5('0x94'),'include':[{'model':db[_0x55e5('0x94')],'as':_0x55e5('0xa8'),'attributes':['id',_0x55e5('0xa9')]}]}]})['then'](handleEntityNotFound(_0x578a6d,null))['then'](function(_0x293aff){if(_0x293aff){_0x2b4e86=_0x293aff;return _0x293aff['getProactiveActions']({'raw':!![]});}})['then'](function(_0x4f8fe8){if(_0x2b4e86){if(_0x4f8fe8){_0x17b29e=_0x4f8fe8;}}return require(_0x55e5('0x87'))[_0x55e5('0x88')]();})['then'](function(_0x2060a5){if(_0x2060a5){_0x3117c1=_0x2060a5['virtual'];_0x1f54b9=_0x2060a5[_0x55e5('0x89')];}})[_0x55e5('0x16')](function(){return db[_0x55e5('0xb8')][_0x55e5('0x27')]({'where':{'closed':![]}});})[_0x55e5('0x16')](function(_0xdc60da){_0x98f4f0=_0xdc60da;if(_0x3117c1&&_0xdc60da>_0x3117c1){return db['License'][_0x55e5('0x76')]({'where':{'id':0x1}})[_0x55e5('0x16')](function(_0x4b7cc5){if(_0x4b7cc5){_0x4b7cc5[_0x55e5('0x101')](_0x55e5('0x102'));}});}})[_0x55e5('0x16')](function(){var _0x56d217=_0x2b4e86[_0x55e5('0x94')];var _0x4727ba=_0x2b4e86[_0x55e5('0x103')]||undefined;return _0x56d217?_0x56d217[_0x55e5('0x104')](_0x4727ba):!![];})[_0x55e5('0x16')](function(_0x336b05){var _0x3abfd2=fs[_0x55e5('0xd8')](path[_0x55e5('0x84')](config[_0x55e5('0x85')],_0x55e5('0x105')),_0x55e5('0xda'));var _0x88915b=_0x55e5('0x106');var _0x2d53ec=![];try{const _0x500e7b=new URL(_0x2b4e86[_0x55e5('0x66')]);_0x2b4e86[_0x55e5('0x66')]=_0x500e7b[_0x55e5('0x107')];}catch(_0x4dadb0){}var _0xa6029d;if(_0x370133[_0x55e5('0xb5')][_0x55e5('0x3c')]){_0x370133['headers'][_0x55e5('0x3c')]=_0x370133[_0x55e5('0xb5')][_0x55e5('0x3c')][_0x55e5('0x108')](/\/$/,'');_0xa6029d=wildcardUtils['testWebsiteWithWildcard'](_0x2b4e86['address'],_0x370133[_0x55e5('0xb5')]['referer']);}else{_0x370133[_0x55e5('0xb5')]['referer']=_0x2b4e86['address'];_0xa6029d=!![];}var _0x498bc8={'chatVersion':_0x88915b,'chatWebsiteAddressOrigin':_0xa6029d?_0x370133['headers'][_0x55e5('0x3c')]:_0x2b4e86[_0x55e5('0x66')],'remote':_0x2b4e86[_0x55e5('0x109')],'query':querystring['stringify'](_[_0x55e5('0x5c')](_0x2b4e86['get']({'plain':!![]}),{'customerIp':_0x370133[_0x55e5('0xb5')][_0x55e5('0x37')]||_0x370133[_0x55e5('0xb5')][_0x55e5('0x10a')]||_0x370133['connection'][_0x55e5('0x10b')]||_0x370133['ip'],'referer':_0x370133[_0x55e5('0xb5')]['referer'],'openedInteractions':_0x98f4f0,'maxInteractions':_0x3117c1,'virtual':_0x1f54b9['virtual'],'online':_0x336b05,'custom':_0x1f54b9,'address':_0xa6029d?_0x370133[_0x55e5('0xb5')][_0x55e5('0x3c')]:null}))[_0x55e5('0x108')](/'/g,'\x5c\x27')};_0x578a6d[_0x55e5('0x31')](ejs[_0x55e5('0xdb')](Mustache[_0x55e5('0xdb')](_0x3abfd2,_0x498bc8),{'proactiveActions':_0x17b29e,'alignment':_0x2b4e86[_0x55e5('0x10c')],'verticalAlignment':_0x2b4e86['verticalAlignment'],'div_color':_0x2b4e86[_0x55e5('0x10d')],'labelText':_0x2b4e86[_0x55e5('0x10e')],'text_color':_0x2b4e86[_0x55e5('0x10f')],'text_button_color':_0x2b4e86['textButtonColor'],'button_color':_0x2b4e86['color_button'],'background_color':_0x2b4e86['backgroundColor'],'hideWhenOffline':_0x2b4e86[_0x55e5('0x110')],'intervalId':_0x2b4e86[_0x55e5('0x111')],'isDevelopment':_0x2d53ec,'chatVersion':_0x88915b}));})[_0x55e5('0x21')](handleError(_0x578a6d,null));};exports[_0x55e5('0x112')]=function(_0x2a6d94,_0x45cfc4){var _0x5c78b1=_0x2a6d94['params']['id'];var _0x43b6ef=_0x2a6d94['body'];var _0x16c8f2=0xc8;var _0x4accca=null;return db[_0x55e5('0xe4')][_0x55e5('0x113')]({'isolationLevel':db[_0x55e5('0xe4')][_0x55e5('0x114')][_0x55e5('0x115')][_0x55e5('0x116')]},function(_0x39d5bc){return db[_0x55e5('0x4b')][_0x55e5('0x76')]({'where':{'id':_0x5c78b1},'transaction':_0x39d5bc})['then'](function(_0x21360a){if(_0x21360a){return db[_0x55e5('0xa7')][_0x55e5('0x2b')]({'where':{'ChatWebsiteId':_0x5c78b1},'transaction':_0x39d5bc})[_0x55e5('0x16')](function(){var _0x3cb0f8=_[_0x55e5('0x4a')](_0x43b6ef,function(_0x47dd28){_0x47dd28[_0x55e5('0x71')]=_0x5c78b1;return _0x47dd28;});return db[_0x55e5('0xa7')]['bulkCreate'](_0x3cb0f8,{'transaction':_0x39d5bc});});}else{_0x16c8f2=0x194;_0x4accca=[];}});})[_0x55e5('0x16')](function(){if(_0x16c8f2!==0x194){return db['ChatApplication'][_0x55e5('0x117')]({'where':{'ChatWebsiteId':_0x5c78b1},'order':_0x55e5('0xaf')})[_0x55e5('0x16')](function(_0x2c1222){_0x4accca=_0x2c1222;});}})[_0x55e5('0x21')](function(_0x4e0d24){_0x16c8f2=0x1f4;logger[_0x55e5('0x1d')](_0x4e0d24[_0x55e5('0x30')]);if(_0x4e0d24[_0x55e5('0x3e')]){delete _0x4e0d24[_0x55e5('0x3e')];}_0x4accca=_0x4e0d24;})[_0x55e5('0x118')](function(){if(_0x4accca===null){_0x45cfc4['sendStatus'](_0x16c8f2);}else{if(_0x16c8f2===0x1f4){_0x45cfc4['status'](_0x16c8f2)[_0x55e5('0x31')](_0x4accca);}else{_0x45cfc4[_0x55e5('0x23')](_0x16c8f2)['json'](_0x4accca);}}});};exports['getApplications']=function(_0xb9b8aa,_0x5dc3ef){var _0x482469={};var _0x5c67de={};var _0x5ba554;var _0x250597;return db['ChatWebsite'][_0x55e5('0x76')]({'where':{'id':_0xb9b8aa[_0x55e5('0x61')]['id']}})[_0x55e5('0x16')](handleEntityNotFound(_0x5dc3ef,null))[_0x55e5('0x16')](function(_0x5cd73d){if(_0x5cd73d){_0x5ba554=_0x5cd73d;_0x5c67de[_0x55e5('0x43')]=_[_0x55e5('0x50')](db[_0x55e5('0xa7')][_0x55e5('0x4c')]);_0x5c67de['query']=_[_0x55e5('0x50')](_0xb9b8aa[_0x55e5('0x4f')]);_0x5c67de[_0x55e5('0x51')]=_[_0x55e5('0x52')](_0x5c67de[_0x55e5('0x43')],_0x5c67de[_0x55e5('0x4f')]);_0x482469[_0x55e5('0x53')]=_['intersection'](_0x5c67de[_0x55e5('0x43')],qs[_0x55e5('0x54')](_0xb9b8aa[_0x55e5('0x4f')][_0x55e5('0x54')]));_0x482469[_0x55e5('0x53')]=_0x482469[_0x55e5('0x53')]['length']?_0x482469[_0x55e5('0x53')]:_0x5c67de[_0x55e5('0x43')];_0x482469[_0x55e5('0x70')]=qs[_0x55e5('0x58')](_0xb9b8aa[_0x55e5('0x4f')]['sort']);_0x482469[_0x55e5('0x59')]=qs['filters'](_[_0x55e5('0x5a')](_0xb9b8aa[_0x55e5('0x4f')],_0x5c67de[_0x55e5('0x51')]));if(_0xb9b8aa['query'][_0x55e5('0x5b')]){_0x482469[_0x55e5('0x59')]=_[_0x55e5('0x5c')](_0x482469[_0x55e5('0x59')],{'$or':_[_0x55e5('0x4a')](_0x482469[_0x55e5('0x53')],function(_0x14a24d){var _0x738f7d={};_0x738f7d[_0x14a24d]={'$like':'%'+_0xb9b8aa['query'][_0x55e5('0x5b')]+'%'};return _0x738f7d;})});}_0x482469=_[_0x55e5('0x5c')]({},_0x482469,_0xb9b8aa['options']);return _0x5ba554[_0x55e5('0x119')](_0x482469);}})['then'](function(_0x25a44c){if(_0x25a44c){_0x250597=_0x25a44c[_0x55e5('0x55')];if(!_0xb9b8aa[_0x55e5('0x4f')]['hasOwnProperty'](_0x55e5('0x57'))){_0x482469[_0x55e5('0x25')]=qs[_0x55e5('0x25')](_0xb9b8aa[_0x55e5('0x4f')]['limit']);_0x482469['offset']=qs[_0x55e5('0x24')](_0xb9b8aa['query'][_0x55e5('0x24')]);}return _0x5ba554['getApplications'](_0x482469);}})['then'](function(_0x1c5410){if(_0x1c5410){return _0x1c5410?{'count':_0x250597,'rows':_0x1c5410}:null;}})[_0x55e5('0x16')](respondWithResult(_0x5dc3ef,null))[_0x55e5('0x21')](handleError(_0x5dc3ef,null));};exports[_0x55e5('0x11a')]=function(_0x538873,_0x276b8f){return db[_0x55e5('0x11b')][_0x55e5('0x63')]({'where':{'id':_0x538873[_0x55e5('0x61')]['id']}})[_0x55e5('0x16')](handleEntityNotFound(_0x276b8f,null))['then'](function(_0x487a24){if(_0x487a24){return _0x487a24[_0x55e5('0x11a')](_0x538873[_0x55e5('0x68')][_0x55e5('0x74')],_['omit'](_0x538873[_0x55e5('0x68')],['ids','id'])||{});}})['then'](respondWithResult(_0x276b8f,null))[_0x55e5('0x21')](handleError(_0x276b8f,null));};exports[_0x55e5('0x11c')]=function(_0x4e9c07,_0x4e6387){var _0x47b1dd={};var _0x1eae1f={};var _0x584389;var _0x2e9feb;return db['ChatWebsite'][_0x55e5('0x76')]({'where':{'id':_0x4e9c07['params']['id']}})[_0x55e5('0x16')](handleEntityNotFound(_0x4e6387,null))[_0x55e5('0x16')](function(_0x175d9d){if(_0x175d9d){_0x584389=_0x175d9d;_0x1eae1f['model']=_[_0x55e5('0x50')](db[_0x55e5('0x11d')][_0x55e5('0x4c')]);_0x1eae1f[_0x55e5('0x4f')]=_['keys'](_0x4e9c07[_0x55e5('0x4f')]);_0x1eae1f[_0x55e5('0x51')]=_[_0x55e5('0x52')](_0x1eae1f[_0x55e5('0x43')],_0x1eae1f[_0x55e5('0x4f')]);_0x47b1dd[_0x55e5('0x53')]=_['intersection'](_0x1eae1f[_0x55e5('0x43')],qs[_0x55e5('0x54')](_0x4e9c07['query'][_0x55e5('0x54')]));_0x47b1dd[_0x55e5('0x53')]=_0x47b1dd['attributes']['length']?_0x47b1dd[_0x55e5('0x53')]:_0x1eae1f[_0x55e5('0x43')];_0x47b1dd['order']=qs[_0x55e5('0x58')](_0x4e9c07[_0x55e5('0x4f')]['sort']);_0x47b1dd[_0x55e5('0x59')]=qs[_0x55e5('0x51')](_[_0x55e5('0x5a')](_0x4e9c07[_0x55e5('0x4f')],_0x1eae1f[_0x55e5('0x51')]));if(_0x4e9c07[_0x55e5('0x4f')][_0x55e5('0x5b')]){_0x47b1dd[_0x55e5('0x59')]=_['merge'](_0x47b1dd['where'],{'$or':_[_0x55e5('0x4a')](_0x47b1dd[_0x55e5('0x53')],function(_0x8e1783){var _0x4b1e7d={};_0x4b1e7d[_0x8e1783]={'$like':'%'+_0x4e9c07[_0x55e5('0x4f')][_0x55e5('0x5b')]+'%'};return _0x4b1e7d;})});}_0x47b1dd=_[_0x55e5('0x5c')]({},_0x47b1dd,_0x4e9c07[_0x55e5('0x5e')]);return _0x584389['getProactiveActions'](_0x47b1dd);}})['then'](function(_0x34488b){if(_0x34488b){_0x2e9feb=_0x34488b[_0x55e5('0x55')];if(!_0x4e9c07[_0x55e5('0x4f')][_0x55e5('0x56')]('nolimit')){_0x47b1dd[_0x55e5('0x25')]=qs['limit'](_0x4e9c07['query']['limit']);_0x47b1dd[_0x55e5('0x24')]=qs[_0x55e5('0x24')](_0x4e9c07[_0x55e5('0x4f')][_0x55e5('0x24')]);}return _0x584389[_0x55e5('0x11c')](_0x47b1dd);}})[_0x55e5('0x16')](function(_0x3bdec3){if(_0x3bdec3){return _0x3bdec3?{'count':_0x2e9feb,'rows':_0x3bdec3}:null;}})[_0x55e5('0x16')](respondWithResult(_0x4e6387,null))[_0x55e5('0x21')](handleError(_0x4e6387,null));};exports['getFields']=function(_0x39c633,_0x345b74){var _0x441d3a=_0x39c633[_0x55e5('0x4f')][_0x55e5('0x11e')]==='false'?_0x55e5('0x11f'):_0x55e5('0x120');return db['ChatWebsite'][_0x55e5('0x63')]({'attributes':['id',_0x441d3a],'where':{'id':_0x39c633[_0x55e5('0x61')]['id']}})[_0x55e5('0x16')](handleEntityNotFound(_0x345b74,null))[_0x55e5('0x16')](function(_0x146f90){if(_0x146f90){var _0x4060fe=_0x146f90[_0x441d3a];var _0xa978c7=_0x4060fe&&_0x4060fe[_0x55e5('0x121')]?_0x4060fe['items']:[];_0x345b74[_0x55e5('0x31')]({'fromKey':_[_0x55e5('0x8a')](_0x4060fe[_0x55e5('0x122')])?undefined:_0x4060fe[_0x55e5('0x122')],'count':_0xa978c7[_0x55e5('0x55')],'rows':_0xa978c7});}})[_0x55e5('0x21')](handleError(_0x345b74,null));};exports[_0x55e5('0x123')]=function(_0x291e37,_0x815201){var _0x26dd0a={'raw':![],'where':{}};var _0x513375={};var _0x50edc7={'count':0x0,'rows':[]};return db[_0x55e5('0x4b')][_0x55e5('0x76')]({'where':{'id':_0x291e37[_0x55e5('0x61')]['id']}})[_0x55e5('0x16')](handleEntityNotFound(_0x815201,null))[_0x55e5('0x16')](function(_0x199652){if(_0x199652){_0x513375['model']=_['keys'](db[_0x55e5('0xdd')][_0x55e5('0x4c')]);_0x513375[_0x55e5('0x4f')]=_[_0x55e5('0x50')](_0x291e37['query']);_0x513375['filters']=_['intersection'](_0x513375[_0x55e5('0x43')],_0x513375[_0x55e5('0x4f')]);_0x26dd0a[_0x55e5('0x53')]=_[_0x55e5('0x52')](_0x513375['model'],qs[_0x55e5('0x54')](_0x291e37[_0x55e5('0x4f')][_0x55e5('0x54')]));_0x26dd0a[_0x55e5('0x53')]=_0x26dd0a[_0x55e5('0x53')][_0x55e5('0x55')]?_0x26dd0a[_0x55e5('0x53')]:_0x513375[_0x55e5('0x43')];if(!_0x291e37[_0x55e5('0x4f')]['hasOwnProperty'](_0x55e5('0x57'))){_0x26dd0a['limit']=qs[_0x55e5('0x25')](_0x291e37[_0x55e5('0x4f')][_0x55e5('0x25')]);_0x26dd0a[_0x55e5('0x24')]=qs[_0x55e5('0x24')](_0x291e37['query'][_0x55e5('0x24')]);}_0x26dd0a[_0x55e5('0x70')]=qs['sort'](_0x291e37[_0x55e5('0x4f')][_0x55e5('0x58')]);_0x26dd0a[_0x55e5('0x59')]=qs[_0x55e5('0x51')](_['pick'](_0x291e37[_0x55e5('0x4f')],_0x513375[_0x55e5('0x51')]));_0x26dd0a[_0x55e5('0x59')][_0x55e5('0x71')]=_0x199652['id'];if(_0x291e37['query'][_0x55e5('0x5b')]){_0x26dd0a[_0x55e5('0x59')]=_[_0x55e5('0x5c')](_0x26dd0a[_0x55e5('0x59')],{'$or':_['map'](_0x26dd0a[_0x55e5('0x53')],function(_0x46cdd3){var _0x294cae={};_0x294cae[_0x46cdd3]={'$like':'%'+_0x291e37[_0x55e5('0x4f')][_0x55e5('0x5b')]+'%'};return _0x294cae;})});}_0x26dd0a=_['merge']({},_0x26dd0a,_0x291e37[_0x55e5('0x5e')]);return db[_0x55e5('0xdd')][_0x55e5('0x27')]({'where':_0x26dd0a[_0x55e5('0x59')]})[_0x55e5('0x16')](function(_0x889571){_0x50edc7[_0x55e5('0x27')]=_0x889571;if(_0x291e37[_0x55e5('0x4f')][_0x55e5('0x5f')]){_0x26dd0a['include']=[{'all':!![]}];}else{_0x26dd0a['include']=[{'model':db[_0x55e5('0x9e')],'as':'Contact','required':![]},{'model':db[_0x55e5('0xe5')],'as':_0x55e5('0x124'),'required':![]}];}return db['ChatOfflineMessage'][_0x55e5('0x60')](_0x26dd0a);})[_0x55e5('0x16')](function(_0x180f28){_0x50edc7[_0x55e5('0x72')]=_0x180f28;return _0x50edc7;});}})[_0x55e5('0x16')](respondWithFilteredResult(_0x815201,_0x26dd0a))['catch'](handleError(_0x815201,null));};exports[_0x55e5('0x125')]=function(_0x39e9d8,_0x472a38){return db[_0x55e5('0x4b')][_0x55e5('0x63')]({'where':{'id':_0x39e9d8['params']['id']}})['then'](handleEntityNotFound(_0x472a38,null))[_0x55e5('0x16')](function(_0x5c6284){if(_0x5c6284){return _0x5c6284[_0x55e5('0x125')](_0x39e9d8['body'][_0x55e5('0x74')],_['omit'](_0x39e9d8[_0x55e5('0x68')],[_0x55e5('0x74'),'id'])||{})['spread'](function(_0x18e0a8){for(var _0x2f6892=0x0;_0x2f6892<_0x39e9d8[_0x55e5('0x68')][_0x55e5('0x74')][_0x55e5('0x55')];_0x2f6892+=0x1){socket[_0x55e5('0x126')](_0x55e5('0x127'),{'UserId':Number(_0x39e9d8['body'][_0x55e5('0x74')][_0x2f6892]),'ChatWebsiteId':Number(_0x39e9d8[_0x55e5('0x61')]['id'])});}return _0x18e0a8;});}})['then'](respondWithResult(_0x472a38,null))[_0x55e5('0x21')](handleError(_0x472a38,null));};exports[_0x55e5('0x128')]=function(_0x26cad0,_0x569f6d){return db[_0x55e5('0x4b')][_0x55e5('0x63')]({'where':{'id':_0x26cad0[_0x55e5('0x61')]['id']}})[_0x55e5('0x16')](handleEntityNotFound(_0x569f6d,null))['then'](function(_0xdce87d){if(_0xdce87d){return _0xdce87d[_0x55e5('0x128')](_0x26cad0['query']['ids'])[_0x55e5('0x16')](function(){if(_[_0x55e5('0x129')](_0x26cad0[_0x55e5('0x4f')][_0x55e5('0x74')])){for(var _0x43684b=0x0;_0x43684b<_0x26cad0[_0x55e5('0x4f')]['ids'][_0x55e5('0x55')];_0x43684b+=0x1){socket[_0x55e5('0x126')]('userChatWebsite:remove',{'UserId':Number(_0x26cad0[_0x55e5('0x4f')][_0x55e5('0x74')][_0x43684b]),'ChatWebsiteId':Number(_0x26cad0[_0x55e5('0x61')]['id'])});}}else{socket[_0x55e5('0x126')](_0x55e5('0x12a'),{'UserId':Number(_0x26cad0['query']['ids']),'ChatWebsiteId':Number(_0x26cad0[_0x55e5('0x61')]['id'])});}});}})[_0x55e5('0x16')](respondWithStatusCode(_0x569f6d,null))[_0x55e5('0x21')](handleError(_0x569f6d,null));};exports[_0x55e5('0x12b')]=function(_0x1b4439,_0x2deca6){var _0xa02ee8={};var _0x4f1e47={};var _0x171fe7;var _0x1d509b;return db[_0x55e5('0x4b')][_0x55e5('0x76')]({'where':{'id':_0x1b4439[_0x55e5('0x61')]['id']}})[_0x55e5('0x16')](handleEntityNotFound(_0x2deca6,null))[_0x55e5('0x16')](function(_0x1f3fad){if(_0x1f3fad){_0x171fe7=_0x1f3fad;_0x4f1e47[_0x55e5('0x43')]=_[_0x55e5('0x50')](db[_0x55e5('0xc5')][_0x55e5('0x4c')]);_0x4f1e47[_0x55e5('0x4f')]=_[_0x55e5('0x50')](_0x1b4439['query']);_0x4f1e47[_0x55e5('0x51')]=_['intersection'](_0x4f1e47[_0x55e5('0x43')],_0x4f1e47['query']);_0xa02ee8['attributes']=_[_0x55e5('0x52')](_0x4f1e47[_0x55e5('0x43')],qs[_0x55e5('0x54')](_0x1b4439[_0x55e5('0x4f')][_0x55e5('0x54')]));_0xa02ee8[_0x55e5('0x53')]=_0xa02ee8[_0x55e5('0x53')]['length']?_0xa02ee8[_0x55e5('0x53')]:_0x4f1e47[_0x55e5('0x43')];_0xa02ee8['order']=qs[_0x55e5('0x58')](_0x1b4439[_0x55e5('0x4f')][_0x55e5('0x58')]);_0xa02ee8[_0x55e5('0x59')]=qs[_0x55e5('0x51')](_['pick'](_0x1b4439[_0x55e5('0x4f')],_0x4f1e47['filters']));if(_0x1b4439[_0x55e5('0x4f')][_0x55e5('0x5b')]){_0xa02ee8[_0x55e5('0x59')]=_[_0x55e5('0x5c')](_0xa02ee8[_0x55e5('0x59')],{'$or':_[_0x55e5('0x4a')](_0xa02ee8[_0x55e5('0x53')],function(_0x41d1f6){var _0x3ae380={};_0x3ae380[_0x41d1f6]={'$like':'%'+_0x1b4439[_0x55e5('0x4f')][_0x55e5('0x5b')]+'%'};return _0x3ae380;})});}_0xa02ee8=_[_0x55e5('0x5c')]({},_0xa02ee8,_0x1b4439[_0x55e5('0x5e')]);return _0x171fe7[_0x55e5('0x12b')](_0xa02ee8);}})[_0x55e5('0x16')](function(_0x30c517){if(_0x30c517){_0x1d509b=_0x30c517[_0x55e5('0x55')];if(!_0x1b4439['query'][_0x55e5('0x56')]('nolimit')){_0xa02ee8[_0x55e5('0x25')]=qs['limit'](_0x1b4439['query'][_0x55e5('0x25')]);_0xa02ee8[_0x55e5('0x24')]=qs['offset'](_0x1b4439['query'][_0x55e5('0x24')]);}return _0x171fe7['getAgents'](_0xa02ee8);}})[_0x55e5('0x16')](function(_0x100cbb){if(_0x100cbb){return _0x100cbb?{'count':_0x1d509b,'rows':_0x100cbb}:null;}})['then'](respondWithResult(_0x2deca6,null))['catch'](handleError(_0x2deca6,null));};
\ No newline at end of file
+var _0xe088=['fromString','originalname','mimetype','attachments','offline-chat','openNewInteraction','sequelize','transaction','Attachment','bulkCreate','MailServerOut','Smtp','CloudProvider','forwardOffline','getSmtpOptions','\x22%s\x22\x20<%s>','forwardOfflineAddress','offlineMessageSubject','MailAccountId','subjectOffline','toPairsIn','mapValues','email','Chat','NotifyMailAccount','notifyMail','remove','Could\x20not\x20remove\x20attachment\x20file','addInteraction','options','Contact','fullname','internal','Tag','Tags','color','tag','getSnippet','getProactiveActions','License','increment','3.9.0','origin','replace','remote','x-real-ip','connection','remoteAddress','virtual','alignment','verticalAlignment','labelText','textButtonColor','color_button','backgroundColor','hideWhenOffline','IntervalId','Transaction','READ_COMMITTED','ChatApplication','findAndCountAll','stack','getApplications','addProactiveActions','chatProactiveAction','ids','omit','online','false','offlineForm','onlineForm','items','fromKey','getOfflineMessages','Attachments','spread','emit','userChatWebsite:save','removeAgents','isArray','userChatWebsite:remove','getAgents','mustache','util','path','ejs','fs-extra','lodash','html-to-text','jayson/promise','../../components/parsers/qs','../../config/logger','api','../../config/environment','APIBadRequestError','../../errors/api','APINotFoundError','APIOutOfIntervalError','handleError','./helpers/wildcard-expressions','url','../../mysqldb','redis','localhost','client','http','request','then','info','ChatWebsite,\x20%s,\x20%s','request\x20sent','ChatWebsite,\x20%s,\x20%s,\x20%s','stringify','code','error','message','result','catch','sendStatus','status','json','offset','limit','count','set','Content-Range','update','destroy','get','UserProfileResource','end','name','send','user-agent-parser','setUA','user-agent','getResult','customerIp','cf-connecting-ip','x-forwarded-for','first','firstName','lastName','x-real-port','referer','browser','version','format','%s\x20%s','unknown','device','vendor','%s\x20%s\x20%s','type','index','Pause','map','ChatWebsite','rawAttributes','fieldName','query','keys','filters','model','intersection','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','merge','filter','includeAll','include','findAll','rows','show','params','fields','find','create','body','address','\x22\x20is\x20not\x20a\x20valid\x20website\x20domain','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','UserProfileSection','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','testWildcardValidity','describe','addDisposition','ChatWebsiteId','getDispositions','findOne','Disposition','removeDispositions','addAnswer','CannedAnswer','getAnswers','removeAnswers','sitepic','addAvatar','filename','customerAvatar','file','systemAvatar','getLogo','join','server/files/images/logos/default_logo.svg','../../config/license/util','getLicense','custom','isNil','root','server/files/images/logos/','download','agentAvatar','existsSync','server/files/images/avatars/','getCustomerAvatar','server/files/images/avatars/customer_avatar.png','showCustomerAvatar','server/files/images/avatars/system_avatar.png','Interval','resolve','timezone','ifTime','notify','chat','From\x20is\x20mandatory','MapKey\x20is\x20mandatory','isEmpty','CmContact','No\x20available\x20attributes','createdAt','updatedAt','includes','CompanyId','ListId','mapKey','from','List','Contacts','Applications','Intervals','interval','Chat\x20Website\x20with\x20id\x20%s\x20not\x20found','account','orderBy','priority','asc','list','defaults','contact','headers','threadId','closed','ChatInteraction','Writing\x20on\x20closed\x20interaction','externalUrl','interaction','messageId','created','autoclose','applications','push','ChatMessage','AttachmentId','UserId','User','unshift','waitForTheAssignedAgent','forcedOwnership','queueId','ChatQueue','waitForTheAssignedQueue','startRouting','EventManager','offline','files','difference','ValidationError','Sequelize','body\x20is\x20mandatory\x20and\x20not\x20empty','mapKeyOffline','mapKeyOffline\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','mapKeyOffline\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','CmList','MailAccount','findOrCreate','readFileSync','server/files/templates/chatOfflineMessage.ejs','utf8','render','toPairs','ChatOfflineMessage'];(function(_0x58c82c,_0x20d6bc){var _0x49364b=function(_0x3eeca6){while(--_0x3eeca6){_0x58c82c['push'](_0x58c82c['shift']());}};_0x49364b(++_0x20d6bc);}(_0xe088,0x17f));var _0x8e08=function(_0x14bf63,_0xdbd373){_0x14bf63=_0x14bf63-0x0;var _0x410d22=_0xe088[_0x14bf63];return _0x410d22;};'use strict';var Mustache=require(_0x8e08('0x0'));var util=require(_0x8e08('0x1'));var path=require(_0x8e08('0x2'));var ejs=require(_0x8e08('0x3'));var fs=require('fs');var fs_extra=require(_0x8e08('0x4'));var _=require(_0x8e08('0x5'));var querystring=require('querystring');var htmlToText=require(_0x8e08('0x6'));var Redis=require('ioredis');var jayson=require(_0x8e08('0x7'));var qs=require(_0x8e08('0x8'));var logger=require(_0x8e08('0x9'))(_0x8e08('0xa'));var config=require(_0x8e08('0xb'));var APIBadRequestError=require('../../errors/api')[_0x8e08('0xc')];var APINotFoundError=require(_0x8e08('0xd'))[_0x8e08('0xe')];var APIOutOfIntervalError=require('../../errors/api')[_0x8e08('0xf')];var APIHandleError=require(_0x8e08('0xd'))[_0x8e08('0x10')];var APIConflictError=require('../../errors/api')['APIConflictError'];var wildcardUtils=require(_0x8e08('0x11'));var URL=require(_0x8e08('0x12'))['URL'];var db=require(_0x8e08('0x13'))['db'];config['redis']=_['defaults'](config[_0x8e08('0x14')],{'host':_0x8e08('0x15'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require('./chatWebsite.socket')['register'](socket);var client=jayson[_0x8e08('0x16')][_0x8e08('0x17')]({'port':0x232c});var client9002=jayson[_0x8e08('0x16')][_0x8e08('0x17')]({'port':0x232a});var client9003=jayson['client'][_0x8e08('0x17')]({'port':0x232b});var client9001=jayson[_0x8e08('0x16')][_0x8e08('0x17')]({'port':0x2329});function respondWithRpcPromise(_0x992c9b,_0x5c7aca,_0x3f3458,_0x3c25ca){return new Promise(function(_0x126b45,_0x14614b){var _0x44c027=_0x3c25ca||client;return _0x44c027[_0x8e08('0x18')](_0x992c9b,_0x3f3458)[_0x8e08('0x19')](function(_0x353f0f){logger[_0x8e08('0x1a')](_0x8e08('0x1b'),_0x5c7aca,_0x8e08('0x1c'));logger['debug'](_0x8e08('0x1d'),_0x5c7aca,_0x8e08('0x1c'),JSON[_0x8e08('0x1e')](_0x353f0f));if(_0x353f0f['error']){if(_0x353f0f['error'][_0x8e08('0x1f')]===0x1f4){logger[_0x8e08('0x20')](_0x8e08('0x1b'),_0x5c7aca,_0x353f0f[_0x8e08('0x20')]['message']);return _0x14614b(_0x353f0f[_0x8e08('0x20')][_0x8e08('0x21')]);}logger[_0x8e08('0x20')](_0x8e08('0x1b'),_0x5c7aca,_0x353f0f[_0x8e08('0x20')]['message']);return _0x126b45(_0x353f0f[_0x8e08('0x20')][_0x8e08('0x21')]);}else{logger['info'](_0x8e08('0x1b'),_0x5c7aca,_0x8e08('0x1c'));_0x126b45(_0x353f0f[_0x8e08('0x22')]['message']);}})[_0x8e08('0x23')](function(_0x467d8c){logger[_0x8e08('0x20')]('ChatWebsite,\x20%s,\x20%s',_0x5c7aca,_0x467d8c);_0x14614b(_0x467d8c);});});}function respondWithStatusCode(_0xee3f48,_0x243892){_0x243892=_0x243892||0xcc;return function(_0x2d0bd6){if(_0x2d0bd6){return _0xee3f48[_0x8e08('0x24')](_0x243892);}return _0xee3f48[_0x8e08('0x25')](_0x243892)['end']();};}function respondWithResult(_0xb0d32,_0x24ceb8){_0x24ceb8=_0x24ceb8||0xc8;return function(_0x4ce49f){if(_0x4ce49f){return _0xb0d32[_0x8e08('0x25')](_0x24ceb8)[_0x8e08('0x26')](_0x4ce49f);}};}function respondWithFilteredResult(_0x3ca397,_0x125412){return function(_0x266dac){if(_0x266dac){var _0x448dae=typeof _0x125412[_0x8e08('0x27')]==='undefined'&&typeof _0x125412[_0x8e08('0x28')]==='undefined';var _0x4bfc04=_0x266dac[_0x8e08('0x29')];var _0x1d3bbe=_0x448dae?0x0:_0x125412[_0x8e08('0x27')];var _0x2bcfd4=_0x448dae?_0x266dac[_0x8e08('0x29')]:_0x125412['offset']+_0x125412['limit'];var _0x441f2c;if(_0x2bcfd4>=_0x4bfc04){_0x2bcfd4=_0x4bfc04;_0x441f2c=0xc8;}else{_0x441f2c=0xce;}_0x3ca397['status'](_0x441f2c);return _0x3ca397[_0x8e08('0x2a')](_0x8e08('0x2b'),_0x1d3bbe+'-'+_0x2bcfd4+'/'+_0x4bfc04)[_0x8e08('0x26')](_0x266dac);}return null;};}function saveUpdates(_0x35e218){return function(_0x1d2b27){if(_0x1d2b27){return _0x1d2b27[_0x8e08('0x2c')](_0x35e218)[_0x8e08('0x19')](function(_0x5655b7){return _0x5655b7;});}return null;};}function removeEntity(_0x4acc3b){return function(_0xba578b){if(_0xba578b){return _0xba578b[_0x8e08('0x2d')]()[_0x8e08('0x19')](function(){var _0x1360d5=_0xba578b[_0x8e08('0x2e')]({'plain':!![]});var _0x35806e='ChatWebsites';return db[_0x8e08('0x2f')][_0x8e08('0x2d')]({'where':{'type':_0x35806e,'resourceId':_0x1360d5['id']}})['then'](function(){return _0xba578b;});})[_0x8e08('0x19')](function(){_0x4acc3b[_0x8e08('0x25')](0xcc)[_0x8e08('0x30')]();});}};}function handleEntityNotFound(_0x37c7a3){return function(_0x83ae8d){if(!_0x83ae8d){_0x37c7a3[_0x8e08('0x24')](0x194);}return _0x83ae8d;};}function handleError(_0x49d568,_0x73a76b){_0x73a76b=_0x73a76b||0x1f4;return function(_0x177a34){logger[_0x8e08('0x20')](_0x177a34['stack']);if(_0x177a34[_0x8e08('0x31')]){delete _0x177a34[_0x8e08('0x31')];}_0x49d568[_0x8e08('0x25')](_0x73a76b)[_0x8e08('0x32')](_0x177a34);};}function createInteractionObject(_0x20a36b,_0x792267,_0x407f1d,_0x22b571){var _0x3eb5ca=require(_0x8e08('0x33'));var _0x668bf6=new _0x3eb5ca();var _0x3c0809=_0x668bf6[_0x8e08('0x34')](_0x407f1d[_0x8e08('0x35')])[_0x8e08('0x36')]();var _0x87d9ce=_0x792267[_0x8e08('0x37')];if(_0x407f1d[_0x8e08('0x38')]){_0x87d9ce=_0x407f1d[_0x8e08('0x38')];}else if(_0x407f1d[_0x8e08('0x39')]){_0x87d9ce=_[_0x8e08('0x3a')](_0x407f1d['x-forwarded-for']['split'](','));}return{'ContactId':_0x22b571['id'],'ChatWebsiteId':_0x20a36b,'from':(_0x22b571[_0x8e08('0x3b')]||'')+'\x20'+(_0x22b571[_0x8e08('0x3c')]||''),'customerIp':_0x87d9ce,'customerPort':_0x407f1d['x-real-port']?_0x407f1d[_0x8e08('0x3d')]:null,'referer':_0x792267[_0x8e08('0x3e')],'browserName':_0x3c0809['browser'][_0x8e08('0x31')]&&_0x3c0809[_0x8e08('0x3f')][_0x8e08('0x40')]?util[_0x8e08('0x41')](_0x8e08('0x42'),_0x3c0809[_0x8e08('0x3f')][_0x8e08('0x31')],_0x3c0809[_0x8e08('0x3f')][_0x8e08('0x40')]):_0x8e08('0x43'),'browserVersion':_0x3c0809['browser'][_0x8e08('0x40')]||'unknown','osName':util[_0x8e08('0x41')](_0x8e08('0x42'),_0x3c0809['os']['name'],_0x3c0809['os'][_0x8e08('0x40')]),'osVersion':_0x3c0809['os']['version'],'deviceModel':_0x3c0809[_0x8e08('0x44')]['model']&&_0x3c0809[_0x8e08('0x44')][_0x8e08('0x45')]?util[_0x8e08('0x41')](_0x8e08('0x46'),_0x3c0809[_0x8e08('0x44')]['model'],_0x3c0809[_0x8e08('0x44')]['vendor'],_0x3c0809[_0x8e08('0x44')][_0x8e08('0x47')]):null,'deviceVendor':_0x3c0809[_0x8e08('0x44')][_0x8e08('0x45')],'deviceType':_0x3c0809['device']['type'],'formData':JSON['stringify'](_0x792267)};}exports[_0x8e08('0x48')]=function(_0x4d3742,_0xf15ddf){var _0x4c2624={'include':[{'model':db[_0x8e08('0x49')],'as':'mandatoryDispositionPause'}]},_0x48a23d={},_0x375a6f={'count':0x0,'rows':[]};var _0x1c12ad=_[_0x8e08('0x4a')](db[_0x8e08('0x4b')][_0x8e08('0x4c')],function(_0x4d9bf6){return{'name':_0x4d9bf6[_0x8e08('0x4d')],'type':_0x4d9bf6[_0x8e08('0x47')]['key']};});_0x48a23d['model']=_[_0x8e08('0x4a')](_0x1c12ad,_0x8e08('0x31'));_0x48a23d[_0x8e08('0x4e')]=_[_0x8e08('0x4f')](_0x4d3742[_0x8e08('0x4e')]);_0x48a23d[_0x8e08('0x50')]=_['intersection'](_0x48a23d[_0x8e08('0x51')],_0x48a23d[_0x8e08('0x4e')]);_0x4c2624['attributes']=_[_0x8e08('0x52')](_0x48a23d['model'],qs['fields'](_0x4d3742[_0x8e08('0x4e')]['fields']));_0x4c2624[_0x8e08('0x53')]=_0x4c2624[_0x8e08('0x53')][_0x8e08('0x54')]?_0x4c2624[_0x8e08('0x53')]:_0x48a23d[_0x8e08('0x51')];if(!_0x4d3742[_0x8e08('0x4e')][_0x8e08('0x55')](_0x8e08('0x56'))){_0x4c2624['limit']=qs['limit'](_0x4d3742[_0x8e08('0x4e')]['limit']);_0x4c2624[_0x8e08('0x27')]=qs[_0x8e08('0x27')](_0x4d3742['query'][_0x8e08('0x27')]);}_0x4c2624[_0x8e08('0x57')]=qs[_0x8e08('0x58')](_0x4d3742['query'][_0x8e08('0x58')]);_0x4c2624[_0x8e08('0x59')]=qs[_0x8e08('0x50')](_[_0x8e08('0x5a')](_0x4d3742[_0x8e08('0x4e')],_0x48a23d[_0x8e08('0x50')]),_0x1c12ad);if(_0x4d3742[_0x8e08('0x4e')]['filter']){_0x4c2624['where']=_[_0x8e08('0x5b')](_0x4c2624[_0x8e08('0x59')],{'$or':_['map'](_0x1c12ad,function(_0x338e9f){if(_0x338e9f[_0x8e08('0x47')]!=='VIRTUAL'){var _0x287fea={};_0x287fea[_0x338e9f['name']]={'$like':'%'+_0x4d3742[_0x8e08('0x4e')][_0x8e08('0x5c')]+'%'};return _0x287fea;}})});}_0x4c2624=_[_0x8e08('0x5b')]({},_0x4c2624,_0x4d3742['options']);var _0x692712={'where':_0x4c2624['where']};return db[_0x8e08('0x4b')]['count'](_0x692712)[_0x8e08('0x19')](function(_0x4eb101){_0x375a6f[_0x8e08('0x29')]=_0x4eb101;if(_0x4d3742[_0x8e08('0x4e')][_0x8e08('0x5d')]){_0x4c2624[_0x8e08('0x5e')]=[{'all':!![]}];}return db[_0x8e08('0x4b')][_0x8e08('0x5f')](_0x4c2624);})[_0x8e08('0x19')](function(_0x3294ee){_0x375a6f[_0x8e08('0x60')]=_0x3294ee;return _0x375a6f;})[_0x8e08('0x19')](respondWithFilteredResult(_0xf15ddf,_0x4c2624))[_0x8e08('0x23')](handleError(_0xf15ddf,null));};exports[_0x8e08('0x61')]=function(_0x38b3b1,_0x569764){var _0x19e199={'raw':![],'where':{'id':_0x38b3b1[_0x8e08('0x62')]['id']},'include':[{'model':db[_0x8e08('0x49')],'as':'mandatoryDispositionPause'}]},_0x2d1f9b={};_0x2d1f9b[_0x8e08('0x51')]=_['keys'](db[_0x8e08('0x4b')]['rawAttributes']);_0x2d1f9b[_0x8e08('0x4e')]=_[_0x8e08('0x4f')](_0x38b3b1[_0x8e08('0x4e')]);_0x2d1f9b['filters']=_['intersection'](_0x2d1f9b['model'],_0x2d1f9b[_0x8e08('0x4e')]);_0x19e199[_0x8e08('0x53')]=_['intersection'](_0x2d1f9b[_0x8e08('0x51')],qs[_0x8e08('0x63')](_0x38b3b1['query'][_0x8e08('0x63')]));_0x19e199[_0x8e08('0x53')]=_0x19e199[_0x8e08('0x53')][_0x8e08('0x54')]?_0x19e199[_0x8e08('0x53')]:_0x2d1f9b[_0x8e08('0x51')];if(_0x38b3b1[_0x8e08('0x4e')][_0x8e08('0x5d')]){_0x19e199[_0x8e08('0x5e')]=[{'all':!![]}];}_0x19e199=_[_0x8e08('0x5b')]({},_0x19e199,_0x38b3b1['options']);return db[_0x8e08('0x4b')][_0x8e08('0x64')](_0x19e199)[_0x8e08('0x19')](handleEntityNotFound(_0x569764,null))[_0x8e08('0x19')](respondWithResult(_0x569764,null))[_0x8e08('0x23')](handleError(_0x569764,null));};exports[_0x8e08('0x65')]=function(_0x4ed0ee,_0x1ce7ea){if(!wildcardUtils['testWildcardValidity'](_0x4ed0ee['body']['address'])){return handleError(_0x1ce7ea,null)(new APIBadRequestError('\x22'+_0x4ed0ee[_0x8e08('0x66')][_0x8e08('0x67')]+_0x8e08('0x68')));}return db[_0x8e08('0x4b')][_0x8e08('0x65')](_0x4ed0ee['body'],{})[_0x8e08('0x19')](function(_0x70755b){var _0x5896f6=_0x4ed0ee['user']['get']({'plain':!![]});if(!_0x5896f6)throw new Error(_0x8e08('0x69'));if(_0x5896f6[_0x8e08('0x6a')]===_0x8e08('0x6b')){var _0x154c7d=_0x70755b[_0x8e08('0x2e')]({'plain':!![]});var _0x27ef1d='ChatWebsites';return db[_0x8e08('0x6c')][_0x8e08('0x64')]({'where':{'name':_0x27ef1d,'userProfileId':_0x5896f6[_0x8e08('0x6d')]},'raw':!![]})[_0x8e08('0x19')](function(_0xdbe474){if(_0xdbe474&&_0xdbe474['autoAssociation']===0x0){return db[_0x8e08('0x2f')][_0x8e08('0x65')]({'name':_0x154c7d[_0x8e08('0x31')],'resourceId':_0x154c7d['id'],'type':_0xdbe474[_0x8e08('0x31')],'sectionId':_0xdbe474['id']},{})[_0x8e08('0x19')](function(){return _0x70755b;});}else{return _0x70755b;}})[_0x8e08('0x23')](function(_0x9af027){logger[_0x8e08('0x20')](_0x8e08('0x6e'),_0x9af027);throw _0x9af027;});}return _0x70755b;})[_0x8e08('0x19')](respondWithResult(_0x1ce7ea,0xc9))[_0x8e08('0x23')](handleError(_0x1ce7ea,null));};exports['update']=function(_0x44bd16,_0x360172){if(!wildcardUtils[_0x8e08('0x6f')](_0x44bd16[_0x8e08('0x66')][_0x8e08('0x67')])){return handleError(_0x360172,null)(new APIBadRequestError('\x22'+_0x44bd16[_0x8e08('0x66')][_0x8e08('0x67')]+'\x22\x20is\x20not\x20a\x20valid\x20website\x20domain'));}if(_0x44bd16[_0x8e08('0x66')]['id']){delete _0x44bd16[_0x8e08('0x66')]['id'];}return db['ChatWebsite'][_0x8e08('0x64')]({'where':{'id':_0x44bd16['params']['id']},'include':[{'model':db['Pause'],'as':'mandatoryDispositionPause'}]})[_0x8e08('0x19')](handleEntityNotFound(_0x360172,null))[_0x8e08('0x19')](saveUpdates(_0x44bd16[_0x8e08('0x66')],null))['then'](respondWithResult(_0x360172,null))[_0x8e08('0x23')](handleError(_0x360172,null));};exports[_0x8e08('0x2d')]=function(_0x21583a,_0x403fda){return db[_0x8e08('0x4b')]['find']({'where':{'id':_0x21583a['params']['id']}})[_0x8e08('0x19')](handleEntityNotFound(_0x403fda,null))[_0x8e08('0x19')](removeEntity(_0x403fda,null))[_0x8e08('0x23')](handleError(_0x403fda,null));};exports[_0x8e08('0x70')]=function(_0x11bff9,_0x39cb17){return db[_0x8e08('0x4b')][_0x8e08('0x70')]()[_0x8e08('0x19')](respondWithResult(_0x39cb17,null))[_0x8e08('0x23')](handleError(_0x39cb17,null));};exports[_0x8e08('0x71')]=function(_0x3b570c,_0x50135b){if(_0x3b570c['body']['id']){delete _0x3b570c[_0x8e08('0x66')]['id'];}return db['ChatWebsite'][_0x8e08('0x64')]({'where':{'id':_0x3b570c['params']['id']}})['then'](handleEntityNotFound(_0x50135b,null))[_0x8e08('0x19')](function(_0x2a6c23){if(_0x2a6c23){_0x3b570c[_0x8e08('0x66')][_0x8e08('0x72')]=_0x2a6c23['id'];return db['Disposition']['create'](_0x3b570c[_0x8e08('0x66')]);}})[_0x8e08('0x19')](respondWithResult(_0x50135b,null))['catch'](handleError(_0x50135b,null));};exports[_0x8e08('0x73')]=function(_0x34380a,_0x30f5a0){var _0x5e4ab7={'raw':![],'where':{}};var _0xb0bda4={};var _0x2ced17={'count':0x0,'rows':[]};return db[_0x8e08('0x4b')][_0x8e08('0x74')]({'where':{'id':_0x34380a[_0x8e08('0x62')]['id']}})[_0x8e08('0x19')](handleEntityNotFound(_0x30f5a0,null))[_0x8e08('0x19')](function(_0x57fbd9){if(_0x57fbd9){_0xb0bda4[_0x8e08('0x51')]=_[_0x8e08('0x4f')](db[_0x8e08('0x75')][_0x8e08('0x4c')]);_0xb0bda4[_0x8e08('0x4e')]=_[_0x8e08('0x4f')](_0x34380a[_0x8e08('0x4e')]);_0xb0bda4['filters']=_[_0x8e08('0x52')](_0xb0bda4[_0x8e08('0x51')],_0xb0bda4[_0x8e08('0x4e')]);_0x5e4ab7['attributes']=_['intersection'](_0xb0bda4[_0x8e08('0x51')],qs[_0x8e08('0x63')](_0x34380a[_0x8e08('0x4e')][_0x8e08('0x63')]));_0x5e4ab7[_0x8e08('0x53')]=_0x5e4ab7['attributes']['length']?_0x5e4ab7[_0x8e08('0x53')]:_0xb0bda4[_0x8e08('0x51')];if(!_0x34380a[_0x8e08('0x4e')][_0x8e08('0x55')](_0x8e08('0x56'))){_0x5e4ab7['limit']=qs[_0x8e08('0x28')](_0x34380a[_0x8e08('0x4e')][_0x8e08('0x28')]);_0x5e4ab7[_0x8e08('0x27')]=qs[_0x8e08('0x27')](_0x34380a[_0x8e08('0x4e')][_0x8e08('0x27')]);}_0x5e4ab7[_0x8e08('0x57')]=qs[_0x8e08('0x58')](_0x34380a[_0x8e08('0x4e')][_0x8e08('0x58')]);_0x5e4ab7[_0x8e08('0x59')]=qs[_0x8e08('0x50')](_[_0x8e08('0x5a')](_0x34380a['query'],_0xb0bda4[_0x8e08('0x50')]));_0x5e4ab7[_0x8e08('0x59')]['ChatWebsiteId']=_0x57fbd9['id'];if(_0x34380a['query'][_0x8e08('0x5c')]){_0x5e4ab7[_0x8e08('0x59')]=_[_0x8e08('0x5b')](_0x5e4ab7[_0x8e08('0x59')],{'$or':_['map'](_0x5e4ab7[_0x8e08('0x53')],function(_0x4a811c){var _0x16e3da={};_0x16e3da[_0x4a811c]={'$like':'%'+_0x34380a['query'][_0x8e08('0x5c')]+'%'};return _0x16e3da;})});}_0x5e4ab7=_[_0x8e08('0x5b')]({},_0x5e4ab7,_0x34380a['options']);return db[_0x8e08('0x75')][_0x8e08('0x29')]({'where':_0x5e4ab7[_0x8e08('0x59')]})[_0x8e08('0x19')](function(_0xc799aa){_0x2ced17['count']=_0xc799aa;if(_0x34380a[_0x8e08('0x4e')][_0x8e08('0x5d')]){_0x5e4ab7[_0x8e08('0x5e')]=[{'all':!![]}];}return db[_0x8e08('0x75')][_0x8e08('0x5f')](_0x5e4ab7);})[_0x8e08('0x19')](function(_0x48084b){_0x2ced17[_0x8e08('0x60')]=_0x48084b;return _0x2ced17;});}})['then'](respondWithFilteredResult(_0x30f5a0,_0x5e4ab7))[_0x8e08('0x23')](handleError(_0x30f5a0,null));};exports[_0x8e08('0x76')]=function(_0x5ea7de,_0x592cde){return db[_0x8e08('0x4b')][_0x8e08('0x64')]({'where':{'id':_0x5ea7de['params']['id']}})[_0x8e08('0x19')](handleEntityNotFound(_0x592cde,null))[_0x8e08('0x19')](function(_0xc27984){if(_0xc27984){return _0xc27984[_0x8e08('0x76')](_0x5ea7de['query']['ids']);}})[_0x8e08('0x19')](respondWithStatusCode(_0x592cde,null))['catch'](handleError(_0x592cde,null));};exports[_0x8e08('0x77')]=function(_0x4e07a6,_0x151620){if(_0x4e07a6['body']['id']){delete _0x4e07a6[_0x8e08('0x66')]['id'];}return db[_0x8e08('0x4b')][_0x8e08('0x64')]({'where':{'id':_0x4e07a6[_0x8e08('0x62')]['id']}})[_0x8e08('0x19')](handleEntityNotFound(_0x151620,null))[_0x8e08('0x19')](function(_0x3fbcd2){if(_0x3fbcd2){_0x4e07a6[_0x8e08('0x66')][_0x8e08('0x72')]=_0x3fbcd2['id'];return db[_0x8e08('0x78')][_0x8e08('0x65')](_0x4e07a6['body']);}})[_0x8e08('0x19')](respondWithResult(_0x151620,null))[_0x8e08('0x23')](handleError(_0x151620,null));};exports[_0x8e08('0x79')]=function(_0x3c8426,_0x2ec663){var _0x39abb0={'raw':![],'where':{}};var _0x3ea1b2={};var _0x107d23={'count':0x0,'rows':[]};return db['ChatWebsite'][_0x8e08('0x74')]({'where':{'id':_0x3c8426['params']['id']}})[_0x8e08('0x19')](handleEntityNotFound(_0x2ec663,null))['then'](function(_0x4cf16f){if(_0x4cf16f){_0x3ea1b2[_0x8e08('0x51')]=_[_0x8e08('0x4f')](db[_0x8e08('0x78')][_0x8e08('0x4c')]);_0x3ea1b2['query']=_['keys'](_0x3c8426[_0x8e08('0x4e')]);_0x3ea1b2[_0x8e08('0x50')]=_[_0x8e08('0x52')](_0x3ea1b2[_0x8e08('0x51')],_0x3ea1b2[_0x8e08('0x4e')]);_0x39abb0[_0x8e08('0x53')]=_[_0x8e08('0x52')](_0x3ea1b2[_0x8e08('0x51')],qs[_0x8e08('0x63')](_0x3c8426['query'][_0x8e08('0x63')]));_0x39abb0[_0x8e08('0x53')]=_0x39abb0[_0x8e08('0x53')][_0x8e08('0x54')]?_0x39abb0[_0x8e08('0x53')]:_0x3ea1b2[_0x8e08('0x51')];if(!_0x3c8426[_0x8e08('0x4e')][_0x8e08('0x55')]('nolimit')){_0x39abb0[_0x8e08('0x28')]=qs['limit'](_0x3c8426[_0x8e08('0x4e')][_0x8e08('0x28')]);_0x39abb0[_0x8e08('0x27')]=qs['offset'](_0x3c8426[_0x8e08('0x4e')][_0x8e08('0x27')]);}_0x39abb0[_0x8e08('0x57')]=qs['sort'](_0x3c8426[_0x8e08('0x4e')]['sort']);_0x39abb0[_0x8e08('0x59')]=qs[_0x8e08('0x50')](_[_0x8e08('0x5a')](_0x3c8426['query'],_0x3ea1b2['filters']));_0x39abb0[_0x8e08('0x59')]['ChatWebsiteId']=_0x4cf16f['id'];if(_0x3c8426[_0x8e08('0x4e')]['filter']){_0x39abb0[_0x8e08('0x59')]=_[_0x8e08('0x5b')](_0x39abb0[_0x8e08('0x59')],{'$or':_[_0x8e08('0x4a')](_0x39abb0[_0x8e08('0x53')],function(_0x4a20b0){var _0x3db535={};_0x3db535[_0x4a20b0]={'$like':'%'+_0x3c8426[_0x8e08('0x4e')][_0x8e08('0x5c')]+'%'};return _0x3db535;})});}_0x39abb0=_[_0x8e08('0x5b')]({},_0x39abb0,_0x3c8426['options']);return db[_0x8e08('0x78')][_0x8e08('0x29')]({'where':_0x39abb0[_0x8e08('0x59')]})[_0x8e08('0x19')](function(_0x40589e){_0x107d23[_0x8e08('0x29')]=_0x40589e;if(_0x3c8426[_0x8e08('0x4e')][_0x8e08('0x5d')]){_0x39abb0[_0x8e08('0x5e')]=[{'all':!![]}];}return db[_0x8e08('0x78')]['findAll'](_0x39abb0);})['then'](function(_0x30867c){_0x107d23[_0x8e08('0x60')]=_0x30867c;return _0x107d23;});}})['then'](respondWithFilteredResult(_0x2ec663,_0x39abb0))[_0x8e08('0x23')](handleError(_0x2ec663,null));};exports['removeAnswers']=function(_0x2fe77b,_0x57258c){return db[_0x8e08('0x4b')]['find']({'where':{'id':_0x2fe77b[_0x8e08('0x62')]['id']}})[_0x8e08('0x19')](handleEntityNotFound(_0x57258c,null))[_0x8e08('0x19')](function(_0x525db5){if(_0x525db5){return _0x525db5[_0x8e08('0x7a')](_0x2fe77b[_0x8e08('0x4e')]['ids']);}})[_0x8e08('0x19')](respondWithStatusCode(_0x57258c,null))['catch'](handleError(_0x57258c,null));};exports['addLogo']=function(_0x3fe7e9,_0x5cc853){_0x3fe7e9[_0x8e08('0x66')][_0x8e08('0x7b')]=_0x3fe7e9['file']['filename'];return db[_0x8e08('0x4b')]['find']({'where':{'id':_0x3fe7e9['params']['id']}})['then'](handleEntityNotFound(_0x5cc853,null))[_0x8e08('0x19')](saveUpdates(_0x3fe7e9[_0x8e08('0x66')],null))['then'](respondWithResult(_0x5cc853,null))[_0x8e08('0x23')](handleError(_0x5cc853,null));};exports[_0x8e08('0x7c')]=function(_0x1e3218,_0x5af382){_0x1e3218[_0x8e08('0x66')]['agentAvatar']=_0x1e3218['file'][_0x8e08('0x7d')];return db[_0x8e08('0x4b')][_0x8e08('0x64')]({'where':{'id':_0x1e3218[_0x8e08('0x62')]['id']}})[_0x8e08('0x19')](handleEntityNotFound(_0x5af382,null))[_0x8e08('0x19')](saveUpdates(_0x1e3218[_0x8e08('0x66')],null))[_0x8e08('0x19')](respondWithResult(_0x5af382,null))['catch'](handleError(_0x5af382,null));};exports['addCustomerAvatar']=function(_0x1ffce7,_0x8adb14){_0x1ffce7[_0x8e08('0x66')][_0x8e08('0x7e')]=_0x1ffce7[_0x8e08('0x7f')]['filename'];return db[_0x8e08('0x4b')][_0x8e08('0x64')]({'where':{'id':_0x1ffce7[_0x8e08('0x62')]['id']}})[_0x8e08('0x19')](handleEntityNotFound(_0x8adb14,null))['then'](saveUpdates(_0x1ffce7['body'],null))[_0x8e08('0x19')](respondWithResult(_0x8adb14,null))[_0x8e08('0x23')](handleError(_0x8adb14,null));};exports['addSystemAvatar']=function(_0x360971,_0x358673){_0x360971['body'][_0x8e08('0x80')]=_0x360971['file'][_0x8e08('0x7d')];return db['ChatWebsite'][_0x8e08('0x64')]({'where':{'id':_0x360971[_0x8e08('0x62')]['id']}})[_0x8e08('0x19')](handleEntityNotFound(_0x358673,null))['then'](saveUpdates(_0x360971['body'],null))['then'](respondWithResult(_0x358673,null))['catch'](handleError(_0x358673,null));};exports[_0x8e08('0x81')]=function(_0x28c61d,_0x5e86c0){var _0xdb3d72=path[_0x8e08('0x82')](config['root'],_0x8e08('0x83'));var _0x1d52f5={'where':{'id':_0x28c61d[_0x8e08('0x62')]['id']},'attributes':['id',_0x8e08('0x7b')],'raw':!![]};var _0x3e3c56=![];return require(_0x8e08('0x84'))[_0x8e08('0x85')]()[_0x8e08('0x19')](function(_0x56d97d){if(_0x56d97d){_0x3e3c56=_0x56d97d[_0x8e08('0x86')];}})[_0x8e08('0x19')](function(){return db[_0x8e08('0x4b')][_0x8e08('0x64')](_0x1d52f5);})[_0x8e08('0x19')](handleEntityNotFound(_0x5e86c0,null))['then'](function(_0x2665ec){if(_0x2665ec){if(!_[_0x8e08('0x87')](_0x2665ec[_0x8e08('0x7b')])){if(fs['existsSync'](path[_0x8e08('0x82')](config[_0x8e08('0x88')],'server/files/images/logos/',_0x2665ec[_0x8e08('0x7b')]))&&_0x3e3c56){_0xdb3d72=path[_0x8e08('0x82')](config[_0x8e08('0x88')],_0x8e08('0x89'),_0x2665ec[_0x8e08('0x7b')]);}}return _0x5e86c0[_0x8e08('0x8a')](_0xdb3d72);}})[_0x8e08('0x23')](handleError(_0x5e86c0,null));};exports['getAvatar']=function(_0x4ea567,_0x235d01){var _0x145e83=path[_0x8e08('0x82')](config[_0x8e08('0x88')],'server/files/images/avatars/default_avatar.png');var _0xd6e221={'where':{'id':_0x4ea567[_0x8e08('0x62')]['id']},'attributes':['id',_0x8e08('0x8b')],'raw':!![]};return db['ChatWebsite']['find'](_0xd6e221)[_0x8e08('0x19')](handleEntityNotFound(_0x235d01,null))[_0x8e08('0x19')](function(_0x29ed3a){if(_0x29ed3a){if(!_[_0x8e08('0x87')](_0x29ed3a[_0x8e08('0x8b')])){if(fs[_0x8e08('0x8c')](path[_0x8e08('0x82')](config[_0x8e08('0x88')],'server/files/images/avatars/',_0x29ed3a[_0x8e08('0x8b')]))){_0x145e83=path[_0x8e08('0x82')](config[_0x8e08('0x88')],_0x8e08('0x8d'),_0x29ed3a[_0x8e08('0x8b')]);}}return _0x235d01[_0x8e08('0x8a')](_0x145e83);}})[_0x8e08('0x23')](handleError(_0x235d01,null));};exports[_0x8e08('0x8e')]=function(_0x1fef24,_0x4df9f0){var _0x4e475d=path[_0x8e08('0x82')](config[_0x8e08('0x88')],_0x8e08('0x8f'));var _0x4fba40={'where':{'id':_0x1fef24[_0x8e08('0x62')]['id']},'attributes':['id',_0x8e08('0x7e'),_0x8e08('0x90')],'raw':!![]};return db[_0x8e08('0x4b')][_0x8e08('0x64')](_0x4fba40)[_0x8e08('0x19')](handleEntityNotFound(_0x4df9f0,null))[_0x8e08('0x19')](function(_0x3c4686){if(_0x3c4686){if(!_['isNil'](_0x3c4686['customerAvatar'])){if(fs[_0x8e08('0x8c')](path[_0x8e08('0x82')](config['root'],_0x8e08('0x8d'),_0x3c4686[_0x8e08('0x7e')]))&&_0x3c4686['showCustomerAvatar']){_0x4e475d=path['join'](config[_0x8e08('0x88')],_0x8e08('0x8d'),_0x3c4686['customerAvatar']);}}return _0x4df9f0[_0x8e08('0x8a')](_0x4e475d);}})[_0x8e08('0x23')](handleError(_0x4df9f0,null));};exports['getSystemAvatar']=function(_0x46121a,_0x515619){var _0x40ba5f=path[_0x8e08('0x82')](config[_0x8e08('0x88')],_0x8e08('0x91'));var _0x308b5={'where':{'id':_0x46121a[_0x8e08('0x62')]['id']},'attributes':['id',_0x8e08('0x80')],'raw':!![]};return db['ChatWebsite']['find'](_0x308b5)['then'](handleEntityNotFound(_0x515619,null))[_0x8e08('0x19')](function(_0x3a2928){if(_0x3a2928){if(!_[_0x8e08('0x87')](_0x3a2928[_0x8e08('0x80')])){if(fs[_0x8e08('0x8c')](path[_0x8e08('0x82')](config[_0x8e08('0x88')],'server/files/images/avatars/',_0x3a2928[_0x8e08('0x80')]))){_0x40ba5f=path[_0x8e08('0x82')](config[_0x8e08('0x88')],'server/files/images/avatars/',_0x3a2928['systemAvatar']);}}return _0x515619[_0x8e08('0x8a')](_0x40ba5f);}})[_0x8e08('0x23')](handleError(_0x515619,null));};function checkWebsiteInterval(_0x17f792){var _0x488ca1=_0x17f792[_0x8e08('0x92')];if(!_0x488ca1){return Promise[_0x8e08('0x93')](_0x17f792);}var _0x1c9d86=_0x17f792[_0x8e08('0x94')]||undefined;return _0x488ca1[_0x8e08('0x95')](_0x1c9d86)[_0x8e08('0x19')](function(_0x7d7ef1){if(!_0x7d7ef1){throw new APIOutOfIntervalError();}return _0x17f792;});}exports[_0x8e08('0x96')]=function(_0x2a5d82,_0x1e8a4f){var _0x5e616f={'body':_0x2a5d82[_0x8e08('0x66')],'channel':_0x8e08('0x97')};var _0x3a77a8=[];var _0x32558b=[];var _0x3a58d7={};var _0x587ec6=![];if(_0x2a5d82[_0x8e08('0x66')]['id']){delete _0x2a5d82[_0x8e08('0x66')]['id'];}if(_[_0x8e08('0x87')](_0x2a5d82[_0x8e08('0x66')]['from'])){throw new APIBadRequestError(_0x8e08('0x98'));}if(_[_0x8e08('0x87')](_0x2a5d82[_0x8e08('0x66')]['mapKey'])){throw new APIBadRequestError(_0x8e08('0x99'));}if(_[_0x8e08('0x9a')](_0x2a5d82['body'][_0x8e08('0x66')])){throw new APIBadRequestError('Body\x20is\x20mandatory');}var _0x28facb=_0x2a5d82[_0x8e08('0x66')][_0x8e08('0x37')]&&_0x2a5d82[_0x8e08('0x66')][_0x8e08('0x3e')];return db[_0x8e08('0x9b')][_0x8e08('0x70')]()[_0x8e08('0x19')](function(_0x3be226){if(!_0x3be226){throw new Error(_0x8e08('0x9c'));}_0x3a77a8=Object['keys'](_0x3be226)[_0x8e08('0x5c')](function(_0x4b7b3c){return![_0x8e08('0x9d'),_0x8e08('0x9e')][_0x8e08('0x9f')](_0x4b7b3c);});_0x32558b=Object[_0x8e08('0x4f')](_0x3be226)[_0x8e08('0x5c')](function(_0x3ffc4f){return![_0x8e08('0x9d'),_0x8e08('0x9e'),_0x8e08('0xa0'),_0x8e08('0xa1')][_0x8e08('0x9f')](_0x3ffc4f);});if(!_['includes'](_0x32558b,_0x2a5d82[_0x8e08('0x66')][_0x8e08('0xa2')])){throw new APIBadRequestError('Invalid\x20MapKey\x20parameter.\x20Allowed\x20values:\x20'+_0x32558b[_0x8e08('0x82')](',\x20'));}_0x3a58d7[_0x2a5d82['body'][_0x8e08('0xa2')]]=_0x2a5d82['body'][_0x8e08('0xa3')];})['then'](function(){return db[_0x8e08('0x4b')][_0x8e08('0x64')]({'where':{'id':_0x2a5d82[_0x8e08('0x62')]['id']},'include':[{'model':db['CmList'],'as':_0x8e08('0xa4'),'include':[{'model':db[_0x8e08('0x9b')],'as':_0x8e08('0xa5'),'where':_0x3a58d7,'limit':0x1,'order':[[_0x8e08('0x9e'),'DESC']]}]},{'model':db['ChatApplication'],'as':_0x8e08('0xa6')},{'model':db[_0x8e08('0x92')],'as':_0x8e08('0x92'),'include':[{'model':db[_0x8e08('0x92')],'as':_0x8e08('0xa7'),'attributes':['id',_0x8e08('0xa8')],'raw':!![]}]}]});})[_0x8e08('0x19')](function(_0x3790e0){if(!_0x3790e0){throw new APINotFoundError(util[_0x8e08('0x41')](_0x8e08('0xa9'),_0x2a5d82[_0x8e08('0x62')]['id']));}if(_0x28facb){return checkWebsiteInterval(_0x3790e0);}return _0x3790e0;})[_0x8e08('0x19')](function(_0x4e0d93){_0x5e616f[_0x8e08('0xaa')]=_0x4e0d93;_0x5e616f['applications']=_[_0x8e08('0xab')](_0x4e0d93['Applications'],[_0x8e08('0xac')],[_0x8e08('0xad')]);if(_0x5e616f[_0x8e08('0xaa')]['Applications']){delete _0x5e616f[_0x8e08('0xaa')][_0x8e08('0xa6')];}_0x5e616f['list']=_0x4e0d93[_0x8e08('0xa4')]||{'id':_0x4e0d93[_0x8e08('0xa1')]};if(_0x5e616f[_0x8e08('0xae')]&&_0x5e616f[_0x8e08('0xae')][_0x8e08('0xa5')]['length']){return _0x5e616f[_0x8e08('0xae')][_0x8e08('0xa5')][0x0];}var _0x1d530e=_[_0x8e08('0xaf')](_0x2a5d82['body'],{'firstName':_0x2a5d82[_0x8e08('0x66')][_0x8e08('0xa3')],'ListId':_0x4e0d93[_0x8e08('0xa1')]});_0x1d530e[_0x2a5d82['body'][_0x8e08('0xa2')]]=_0x2a5d82[_0x8e08('0x66')][_0x8e08('0xa3')];return db['CmContact'][_0x8e08('0x65')](_0x1d530e,{'fields':_0x3a77a8,'raw':!![]});})[_0x8e08('0x19')](function(_0xdbd84e){_0x5e616f[_0x8e08('0xb0')]=_0xdbd84e;var _0x4522f3=createInteractionObject(_0x2a5d82[_0x8e08('0x62')]['id'],_0x2a5d82['body'],_0x2a5d82[_0x8e08('0xb1')],_0xdbd84e);var _0x4726dc={'ChatWebsiteId':_0x2a5d82[_0x8e08('0x62')]['id']};if(_0x2a5d82[_0x8e08('0x66')][_0x8e08('0xb2')]){_0x4726dc[_0x8e08('0xb2')]=_0x2a5d82[_0x8e08('0x66')][_0x8e08('0xb2')];_0x4726dc[_0x8e08('0xb3')]=![];return db[_0x8e08('0xb4')][_0x8e08('0x64')]({'where':_0x4726dc})['then'](function(_0x275ed9){var _0x126924=_0x2a5d82['body'][_0x8e08('0x37')]&&_0x2a5d82[_0x8e08('0x66')]['referer'];if(_0x275ed9){_0x587ec6=!![];return _0x275ed9;}else if(!_0x126924&&_0x275ed9&&_0x275ed9[_0x8e08('0xb3')]){throw new APIConflictError(_0x8e08('0xb5'));}_0x4522f3[_0x8e08('0xb2')]=_0x2a5d82[_0x8e08('0x66')][_0x8e08('0xb2')];_0x4522f3[_0x8e08('0xb6')]=_0x2a5d82['body'][_0x8e08('0xb6')];return db['ChatInteraction'][_0x8e08('0x65')](_0x4522f3);});}_0x4726dc['ContactId']=_0xdbd84e['id'];if(_0x2a5d82['body']['interaction']&&_0x2a5d82[_0x8e08('0x66')][_0x8e08('0xb7')]['id']){_0x4726dc['id']=_0x2a5d82['body'][_0x8e08('0xb7')]['id'];return db[_0x8e08('0xb4')][_0x8e08('0x64')]({'where':_0x4726dc})[_0x8e08('0x19')](function(_0x4a324a){var _0x1c3ea0=_0x2a5d82['body']['customerIp']&&_0x2a5d82[_0x8e08('0x66')]['referer'];if(!_0x1c3ea0&&_0x4a324a&&_0x4a324a[_0x8e08('0xb3')]){throw new APIConflictError('Writing\x20on\x20closed\x20interaction');}else if(_0x4a324a){_0x587ec6=!![];return _0x4a324a;}else{return db['ChatInteraction'][_0x8e08('0x65')](_0x4522f3);}});}return db[_0x8e08('0xb4')][_0x8e08('0x65')](_0x4522f3);})[_0x8e08('0x19')](function(_0x6581d){if(!_0x587ec6){return _0x6581d;}var _0x41678c={'from':(_0x5e616f[_0x8e08('0xb0')][_0x8e08('0x3b')]||'')+'\x20'+(_0x5e616f[_0x8e08('0xb0')][_0x8e08('0x3c')]||'')};if(_0x2a5d82['body'][_0x8e08('0xb2')]&&_0x2a5d82[_0x8e08('0x66')][_0x8e08('0xb8')]&&_0x2a5d82['body'][_0x8e08('0xb2')]!=_0x2a5d82[_0x8e08('0x66')][_0x8e08('0xb8')]){_0x41678c[_0x8e08('0xb2')]=_0x2a5d82[_0x8e08('0x66')]['messageId'];}return _0x6581d[_0x8e08('0x2c')](_0x41678c);})[_0x8e08('0x19')](function(_0x431711){_0x5e616f[_0x8e08('0xb7')]=_0x431711[_0x8e08('0x2e')]({'plain':!![]});_0x5e616f[_0x8e08('0xb7')][_0x8e08('0xb9')]=!_0x587ec6;if(_0x5e616f[_0x8e08('0xb7')][_0x8e08('0xb9')]){if(_0x5e616f[_0x8e08('0xaa')][_0x8e08('0xba')]){_0x5e616f[_0x8e08('0xbb')][_0x8e08('0xbc')]({'id':0x0,'priority':_0x5e616f[_0x8e08('0xbb')][_0x8e08('0x54')]+0x1,'app':'close','appdata':'unmanaged','interval':'*,*,*,*'});}}return db[_0x8e08('0xbd')][_0x8e08('0x65')]({'body':_0x2a5d82[_0x8e08('0x66')][_0x8e08('0x66')],'ChatWebsiteId':_0x2a5d82[_0x8e08('0x62')]['id'],'ChatInteractionId':_0x431711['id'],'direction':'in','ContactId':_0x5e616f['contact']['id'],'AttachmentId':_0x2a5d82[_0x8e08('0x66')][_0x8e08('0xbe')]});})[_0x8e08('0x19')](function(_0x3662c3){_0x5e616f[_0x8e08('0x21')]=_0x3662c3;if(!_0x5e616f[_0x8e08('0xb7')][_0x8e08('0xbf')]){return;}return db[_0x8e08('0xc0')][_0x8e08('0x64')]({'attributes':['id',_0x8e08('0x31')],'where':{'id':_0x5e616f[_0x8e08('0xb7')][_0x8e08('0xbf')]}});})['then'](function(_0x197ea6){if(_0x197ea6){_0x5e616f[_0x8e08('0xbb')][_0x8e08('0xc1')]({'id':0x0,'priority':0x0,'app':'agent','appdata':_0x197ea6[_0x8e08('0x31')]+','+(_0x5e616f[_0x8e08('0xaa')][_0x8e08('0xc2')]||0xa),'interval':'*,*,*,*'});_0x5e616f[_0x8e08('0xc3')]=!![];}if(!_0x5e616f[_0x8e08('0xb7')][_0x8e08('0xc4')]){return;}return db[_0x8e08('0xc5')]['find']({'attributes':['id',_0x8e08('0x31')],'where':{'id':_0x5e616f[_0x8e08('0xb7')][_0x8e08('0xc4')]}});})[_0x8e08('0x19')](function(_0x1a405a){if(_0x1a405a){_0x5e616f['applications'][_0x8e08('0xc1')]({'id':0x0,'priority':0x1,'app':'queue','appdata':_0x1a405a[_0x8e08('0x31')]+','+(_0x5e616f['account'][_0x8e08('0xc6')]||0x12c),'interval':'*,*,*,*'});}return respondWithRpcPromise('Start',_0x8e08('0xc7'),_0x5e616f);})[_0x8e08('0x19')](function(_0x3f2b0a){respondWithRpcPromise(_0x8e08('0xc8'),'EventManager',{'event':_0x8e08('0x96'),'message':_0x3f2b0a},client9002);return _0x3f2b0a;})['then'](respondWithResult(_0x1e8a4f,null))['catch'](APIHandleError(_0x1e8a4f));};exports[_0x8e08('0xc9')]=function(_0x3b9b76,_0xb5799d){var _0x478df6,_0x185738,_0x11ea1d;var _0xebc01b=[];var _0xeeb450={};var _0x5cb7cf=_0x3b9b76[_0x8e08('0xca')]||[];var _0x38223c=[];var _0x30bb61;return db[_0x8e08('0x9b')][_0x8e08('0x70')]()[_0x8e08('0x19')](function(_0x22c57e){if(!_0x22c57e){throw new db['Sequelize']['ValidationError']('no\x20available\x20attributes');}_0xebc01b=_[_0x8e08('0xcb')](_[_0x8e08('0x4f')](_0x22c57e),['createdAt','updatedAt','CompanyId',_0x8e08('0xa1')]);if(_0x3b9b76['body']['id']){delete _0x3b9b76[_0x8e08('0x66')]['id'];}if(_[_0x8e08('0x87')](_0x3b9b76[_0x8e08('0x66')][_0x8e08('0xa3')])){throw _0xb5799d[_0x8e08('0x25')](0x1f4)[_0x8e08('0x32')](new db['Sequelize'][(_0x8e08('0xcc'))]('from\x20is\x20mandatory'));}if(_['isNil'](_0x3b9b76[_0x8e08('0x66')][_0x8e08('0x66')])||_0x3b9b76['body']['body']===''){throw _0xb5799d[_0x8e08('0x25')](0x1f4)[_0x8e08('0x32')](new db[(_0x8e08('0xcd'))][(_0x8e08('0xcc'))](_0x8e08('0xce')));}if(_[_0x8e08('0x87')](_0x3b9b76[_0x8e08('0x66')][_0x8e08('0xcf')])){throw _0xb5799d['status'](0x1f4)[_0x8e08('0x32')](new db[(_0x8e08('0xcd'))][(_0x8e08('0xcc'))](_0x8e08('0xd0')+_0xebc01b));}if(!_[_0x8e08('0x9f')](_0xebc01b,_0x3b9b76[_0x8e08('0x66')][_0x8e08('0xcf')])){throw _0xb5799d[_0x8e08('0x25')](0x1f4)[_0x8e08('0x32')](new db[(_0x8e08('0xcd'))][(_0x8e08('0xcc'))](_0x8e08('0xd1')+_0xebc01b));}_0xeeb450[_0x3b9b76[_0x8e08('0x66')]['mapKeyOffline']]=_0x3b9b76[_0x8e08('0x66')][_0x8e08('0xa3')];})[_0x8e08('0x19')](function(){return db[_0x8e08('0x4b')]['find']({'where':{'id':_0x3b9b76[_0x8e08('0x62')]['id']},'include':[{'model':db[_0x8e08('0xd2')],'as':_0x8e08('0xa4')},{'model':db[_0x8e08('0xd3')],'as':_0x8e08('0xd3')}]});})['then'](handleEntityNotFound(_0xb5799d,null))[_0x8e08('0x19')](function(_0x196830){if(_0x196830&&_0x196830[_0x8e08('0xa4')]){_0x185738=_0x196830;var _0x1bd711=_[_0x8e08('0xaf')](_0x3b9b76[_0x8e08('0x66')],{'firstName':_0x3b9b76[_0x8e08('0x66')][_0x8e08('0xa3')],'phone':_0x3b9b76[_0x8e08('0x66')][_0x8e08('0xa3')],'ListId':_0x196830[_0x8e08('0xa1')]});_0x1bd711[_0x3b9b76[_0x8e08('0x66')][_0x8e08('0xcf')]]=_0x3b9b76[_0x8e08('0x66')][_0x8e08('0xa3')];return db[_0x8e08('0x9b')][_0x8e08('0xd4')]({'where':_0xeeb450,'defaults':_0x1bd711});}})['spread'](function(_0x3f19f2){if(_0x3f19f2){_0x11ea1d=_0x3f19f2;var _0x33b246=fs[_0x8e08('0xd5')](path[_0x8e08('0x82')](config[_0x8e08('0x88')],_0x8e08('0xd6')),_0x8e08('0xd7'));var _0x1aee3d=ejs[_0x8e08('0xd8')](_0x33b246,{'body':_[_0x8e08('0xd9')](_0x3b9b76[_0x8e08('0x66')][_0x8e08('0x66')]),'bodyTitle':_0x185738['offlineMessageBody']});return db[_0x8e08('0xda')][_0x8e08('0x65')]({'body':_0x1aee3d,'plainBody':htmlToText[_0x8e08('0xdb')](_0x1aee3d),'ContactId':_0x3f19f2['id'],'ChatWebsiteId':_0x185738['id']});}})['then'](function(_0x3db236){_0x30bb61=_0x3db236;if(_0x5cb7cf[_0x8e08('0x54')]){var _0x286601=_0x5cb7cf[_0x8e08('0x4a')](function(_0xc2a4d5){return{'name':_0xc2a4d5[_0x8e08('0xdc')],'basename':_0xc2a4d5['filename'],'type':_0xc2a4d5[_0x8e08('0xdd')],'ChatOfflineMessageId':_0x3db236['id']};});_0x38223c=_0x286601['map'](_0x200c8e=>{var _0x42373d={'filename':_0x200c8e[_0x8e08('0x31')],'path':path[_0x8e08('0x82')](config['root'],'server','files',_0x8e08('0xde'),_0x8e08('0xdf'),_0x200c8e['basename'])};return _0x42373d;});if(!_0x185738[_0x8e08('0xe0')]){return db[_0x8e08('0xe1')][_0x8e08('0xe2')](function(_0x584e4c){return db[_0x8e08('0xe3')][_0x8e08('0xe4')](_0x286601,{'transaction':_0x584e4c});});}}})[_0x8e08('0x19')](function(){if(_0x30bb61){_0x478df6=_0x30bb61;return db[_0x8e08('0xd3')][_0x8e08('0x74')]({'where':{'service':!![]},'include':[{'model':db[_0x8e08('0xe5')],'as':_0x8e08('0xe6'),'raw':!![],'include':[{'model':db[_0x8e08('0xe7')],'as':_0x8e08('0xe7'),'raw':!![]}]}]});}})[_0x8e08('0x19')](function(_0x472921){if(_0x472921&&_0x472921[_0x8e08('0xe6')]&&_0x185738[_0x8e08('0xe8')]&&_0x185738['forwardOfflineAddress']){var _0x1d5942=_0x472921[_0x8e08('0xe9')]();return respondWithRpcPromise('SendMail','sendMail',{'account':_0x1d5942,'message':{'from':util[_0x8e08('0x41')](_0x8e08('0xea'),_0x472921[_0x8e08('0x31')],_0x472921['email']||_0x472921[_0x8e08('0xe6')][_0x8e08('0x6b')]),'to':_0x185738[_0x8e08('0xeb')],'subject':_0x185738[_0x8e08('0xec')],'html':_0x478df6[_0x8e08('0x66')],'attachments':_0x38223c}},client9003)['then'](function(){return _0x478df6;})[_0x8e08('0x23')](function(_0x3c7b3e){logger[_0x8e08('0x20')](_0x3c7b3e);});}})['then'](function(){if(_0x185738&&_0x185738[_0x8e08('0xe0')]&&_0x185738[_0x8e08('0xed')]){var _0x61c6a0=[];if(_0x5cb7cf[_0x8e08('0x54')]){_0x61c6a0=_0x5cb7cf[_0x8e08('0x4a')](function(_0x104ece){return{'name':_0x104ece[_0x8e08('0xdc')],'basename':_0x104ece[_0x8e08('0x7d')],'type':_0x104ece[_0x8e08('0xdd')],'ChatOfflineMessageId':_0x30bb61['id']};});}var _0xb242ad;if(!_['isNil'](_0x185738[_0x8e08('0xee')])){var _0x46a25c=_[_0x8e08('0x4a')](_0x3b9b76['body'],function(_0x3d6fa0){return _0x3d6fa0;});var _0x287422=_[_0x8e08('0xef')](_0x46a25c)[0x0];var _0x152088=_[_0x8e08('0xf0')](_0x287422,function(_0x40de9a){return _0x40de9a;});_0xb242ad=_0x152088[0x1][_0x185738[_0x8e08('0xee')]];}var _0x43cdb4={'from':_0x11ea1d[_0x8e08('0xf1')],'firstName':_0x11ea1d['firstName'],'lastName':_0x11ea1d[_0x8e08('0x3c')],'mapKey':_0x8e08('0xf1'),'message':{'from':_0x11ea1d[_0x8e08('0xf1')],'to':_0x185738[_0x8e08('0xd3')][_0x8e08('0xf1')],'cc':'','subject':_['isNil'](_0xb242ad)?_0x185738['offlineMessageSubject']:_0xb242ad,'messageId':'','sentAt':new Date(),'attach':_0x61c6a0[_0x8e08('0x54')],'attachments':_0x61c6a0,'originChannel':_0x8e08('0xf2'),'ChatWebsiteId':_0x185738['id'],'ChatOfflineMessageId':_0x478df6['id'],'originTo':_0x185738[_0x8e08('0xd3')][_0x8e08('0xf1')]},'body':_0x478df6[_0x8e08('0x66')]};var _0xbe20f3={'account':{'id':_0x185738[_0x8e08('0xed')]},'body':_0x43cdb4,'log':_0x8e08('0xf3')};return respondWithRpcPromise(_0x8e08('0xf3'),_0x8e08('0xf4'),_0xbe20f3,client9001)[_0x8e08('0x19')](function(){return _0x478df6;})[_0x8e08('0x23')](function(_0x2e7649){logger[_0x8e08('0x20')](_0x2e7649);});}return;})[_0x8e08('0x19')](function(){if(_0x478df6){return _0x478df6;}})[_0x8e08('0x19')](respondWithResult(_0xb5799d,null))[_0x8e08('0x23')](function(){for(var _0x4c5717 of _0x5cb7cf){var _0x48a0bb=path[_0x8e08('0x82')](config[_0x8e08('0x88')],'server',_0x8e08('0xca'),_0x8e08('0xde'),_0x8e08('0xdf'),_0x4c5717['filename']);fs_extra[_0x8e08('0xf5')](_0x48a0bb)[_0x8e08('0x23')](function(_0x469adc){logger['error'](_0x8e08('0xf6'),_0x48a0bb,_0x469adc);});}});};exports['addInteraction']=function(_0x1d8516,_0x215a3d){return db[_0x8e08('0xb4')][_0x8e08('0x64')]({'where':{'id':_0x1d8516[_0x8e08('0x62')]['id']}})[_0x8e08('0x19')](handleEntityNotFound(_0x215a3d,null))[_0x8e08('0x19')](function(_0x23c3f2){if(_0x23c3f2){return _0x23c3f2[_0x8e08('0xf7')](_0x1d8516[_0x8e08('0x66')]['ids'],_['omit'](_0x1d8516[_0x8e08('0x66')],['ids','id'])||{});}})[_0x8e08('0x19')](respondWithResult(_0x215a3d,null))['catch'](handleError(_0x215a3d,null));};exports['getInteractions']=function(_0x33d421,_0x2e5393){var _0x1963f0={'raw':![],'where':{}};var _0x19b87d={};var _0x75956d={'count':0x0,'rows':[]};return db[_0x8e08('0x4b')][_0x8e08('0x74')]({'where':{'id':_0x33d421[_0x8e08('0x62')]['id']}})['then'](handleEntityNotFound(_0x2e5393,null))[_0x8e08('0x19')](function(_0x47ae2e){if(_0x47ae2e){_0x19b87d[_0x8e08('0x51')]=_[_0x8e08('0x4f')](db[_0x8e08('0xb4')][_0x8e08('0x4c')]);_0x19b87d[_0x8e08('0x4e')]=_[_0x8e08('0x4f')](_0x33d421[_0x8e08('0x4e')]);_0x19b87d[_0x8e08('0x50')]=_['intersection'](_0x19b87d['model'],_0x19b87d[_0x8e08('0x4e')]);_0x1963f0[_0x8e08('0x53')]=_[_0x8e08('0x52')](_0x19b87d[_0x8e08('0x51')],qs['fields'](_0x33d421[_0x8e08('0x4e')][_0x8e08('0x63')]));_0x1963f0[_0x8e08('0x53')]=_0x1963f0[_0x8e08('0x53')][_0x8e08('0x54')]?_0x1963f0[_0x8e08('0x53')]:_0x19b87d[_0x8e08('0x51')];if(!_0x33d421[_0x8e08('0x4e')]['hasOwnProperty'](_0x8e08('0x56'))){_0x1963f0['limit']=qs[_0x8e08('0x28')](_0x33d421[_0x8e08('0x4e')]['limit']);_0x1963f0[_0x8e08('0x27')]=qs[_0x8e08('0x27')](_0x33d421[_0x8e08('0x4e')][_0x8e08('0x27')]);}_0x1963f0[_0x8e08('0x57')]=qs[_0x8e08('0x58')](_0x33d421[_0x8e08('0x4e')][_0x8e08('0x58')]);_0x1963f0[_0x8e08('0x59')]=qs[_0x8e08('0x50')](_[_0x8e08('0x5a')](_0x33d421[_0x8e08('0x4e')],_0x19b87d[_0x8e08('0x50')]));_0x1963f0[_0x8e08('0x59')]['ChatWebsiteId']=_0x47ae2e['id'];if(_0x33d421[_0x8e08('0x4e')]['filter']){_0x1963f0['where']=_[_0x8e08('0x5b')](_0x1963f0[_0x8e08('0x59')],{'$or':_[_0x8e08('0x4a')](_0x1963f0[_0x8e08('0x53')],function(_0x4067c6){var _0x4b4c04={};_0x4b4c04[_0x4067c6]={'$like':'%'+_0x33d421['query'][_0x8e08('0x5c')]+'%'};return _0x4b4c04;})});}_0x1963f0=_[_0x8e08('0x5b')]({},_0x1963f0,_0x33d421[_0x8e08('0xf8')]);return db[_0x8e08('0xb4')][_0x8e08('0x29')]({'where':_0x1963f0[_0x8e08('0x59')]})[_0x8e08('0x19')](function(_0x5f2634){_0x75956d[_0x8e08('0x29')]=_0x5f2634;if(_0x33d421[_0x8e08('0x4e')][_0x8e08('0x5d')]){_0x1963f0['include']=[{'model':db['CmContact'],'as':_0x8e08('0xf9'),'required':![]},{'model':db[_0x8e08('0xc0')],'as':'Owner','attributes':['name',_0x8e08('0xfa'),_0x8e08('0xfb')],'required':![]},{'model':db[_0x8e08('0xfc')],'as':_0x8e08('0xfd'),'attributes':['id','name',_0x8e08('0xfe')],'where':_0x33d421['query'][_0x8e08('0xff')]?{'id':_0x33d421[_0x8e08('0x4e')][_0x8e08('0xff')]}:undefined,'required':_0x33d421[_0x8e08('0x4e')]['tag']?!![]:![]}];}return db[_0x8e08('0xb4')][_0x8e08('0x5f')](_0x1963f0);})['then'](function(_0x35381e){_0x75956d[_0x8e08('0x60')]=_0x35381e;return _0x75956d;});}})[_0x8e08('0x19')](respondWithFilteredResult(_0x2e5393,_0x1963f0))['catch'](handleError(_0x2e5393,null));};exports[_0x8e08('0x100')]=function(_0x1b59f0,_0x5d72c5){var _0x514397=0x0;var _0x334251=0x0;var _0x123b68=![];var _0x4fe22a;var _0x7e6393;return db['ChatWebsite'][_0x8e08('0x64')]({'where':{'id':_0x1b59f0[_0x8e08('0x62')]['id']},'include':[{'model':db[_0x8e08('0x92')],'as':_0x8e08('0x92'),'include':[{'model':db[_0x8e08('0x92')],'as':'Intervals','attributes':['id',_0x8e08('0xa8')]}]}]})[_0x8e08('0x19')](handleEntityNotFound(_0x5d72c5,null))['then'](function(_0x2579d5){if(_0x2579d5){_0x4fe22a=_0x2579d5;return _0x2579d5[_0x8e08('0x101')]({'raw':!![]});}})[_0x8e08('0x19')](function(_0x1c3636){if(_0x4fe22a){if(_0x1c3636){_0x7e6393=_0x1c3636;}}return require(_0x8e08('0x84'))[_0x8e08('0x85')]();})[_0x8e08('0x19')](function(_0x360df7){if(_0x360df7){_0x334251=_0x360df7['virtual'];_0x123b68=_0x360df7['custom'];}})['then'](function(){return db[_0x8e08('0xb4')][_0x8e08('0x29')]({'where':{'closed':![]}});})['then'](function(_0x82e183){_0x514397=_0x82e183;if(_0x334251&&_0x82e183>_0x334251){return db[_0x8e08('0x102')][_0x8e08('0x74')]({'where':{'id':0x1}})[_0x8e08('0x19')](function(_0x38460f){if(_0x38460f){_0x38460f[_0x8e08('0x103')]('chatLicenseExceeded');}});}})['then'](function(){var _0x9e7b8=_0x4fe22a['Interval'];var _0x547d8d=_0x4fe22a[_0x8e08('0x94')]||undefined;return _0x9e7b8?_0x9e7b8[_0x8e08('0x95')](_0x547d8d):!![];})[_0x8e08('0x19')](function(_0x2a1020){var _0x10633a=fs[_0x8e08('0xd5')](path[_0x8e08('0x82')](config['root'],'server/files/chat/iframe.ejs'),_0x8e08('0xd7'));var _0x541292=_0x8e08('0x104');var _0x439367=![];try{const _0xbadfc1=new URL(_0x4fe22a[_0x8e08('0x67')]);_0x4fe22a[_0x8e08('0x67')]=_0xbadfc1[_0x8e08('0x105')];}catch(_0x419858){}var _0x152956;if(_0x1b59f0[_0x8e08('0xb1')]['referer']){_0x1b59f0[_0x8e08('0xb1')][_0x8e08('0x3e')]=_0x1b59f0['headers']['referer'][_0x8e08('0x106')](/\/$/,'');_0x152956=wildcardUtils['testWebsiteWithWildcard'](_0x4fe22a['address'],_0x1b59f0[_0x8e08('0xb1')]['referer']);}else{_0x1b59f0[_0x8e08('0xb1')][_0x8e08('0x3e')]=_0x4fe22a['address'];_0x152956=!![];}var _0x370b90={'chatVersion':_0x541292,'chatWebsiteAddressOrigin':_0x152956?_0x1b59f0[_0x8e08('0xb1')][_0x8e08('0x3e')]:_0x4fe22a[_0x8e08('0x67')],'remote':_0x4fe22a[_0x8e08('0x107')],'query':querystring[_0x8e08('0x1e')](_[_0x8e08('0x5b')](_0x4fe22a[_0x8e08('0x2e')]({'plain':!![]}),{'customerIp':_0x1b59f0[_0x8e08('0xb1')][_0x8e08('0x39')]||_0x1b59f0['headers'][_0x8e08('0x108')]||_0x1b59f0[_0x8e08('0x109')][_0x8e08('0x10a')]||_0x1b59f0['ip'],'referer':_0x1b59f0[_0x8e08('0xb1')][_0x8e08('0x3e')],'openedInteractions':_0x514397,'maxInteractions':_0x334251,'virtual':_0x123b68[_0x8e08('0x10b')],'online':_0x2a1020,'custom':_0x123b68,'address':_0x152956?_0x1b59f0['headers'][_0x8e08('0x3e')]:null}))[_0x8e08('0x106')](/'/g,'\x5c\x27')};_0x5d72c5['send'](ejs[_0x8e08('0xd8')](Mustache[_0x8e08('0xd8')](_0x10633a,_0x370b90),{'proactiveActions':_0x7e6393,'alignment':_0x4fe22a[_0x8e08('0x10c')],'verticalAlignment':_0x4fe22a[_0x8e08('0x10d')],'div_color':_0x4fe22a[_0x8e08('0xfe')],'labelText':_0x4fe22a[_0x8e08('0x10e')],'text_color':_0x4fe22a['textColor'],'text_button_color':_0x4fe22a[_0x8e08('0x10f')],'button_color':_0x4fe22a[_0x8e08('0x110')],'background_color':_0x4fe22a[_0x8e08('0x111')],'hideWhenOffline':_0x4fe22a[_0x8e08('0x112')],'intervalId':_0x4fe22a[_0x8e08('0x113')],'isDevelopment':_0x439367,'chatVersion':_0x541292}));})[_0x8e08('0x23')](handleError(_0x5d72c5,null));};exports['addApplications']=function(_0x1275f4,_0x4404e6){var _0x5f4341=_0x1275f4[_0x8e08('0x62')]['id'];var _0x5b057d=_0x1275f4['body'];var _0x12512e=0xc8;var _0x59caef=null;return db[_0x8e08('0xe1')][_0x8e08('0xe2')]({'isolationLevel':db['sequelize'][_0x8e08('0x114')]['ISOLATION_LEVELS'][_0x8e08('0x115')]},function(_0x1b09c3){return db[_0x8e08('0x4b')]['findOne']({'where':{'id':_0x5f4341},'transaction':_0x1b09c3})[_0x8e08('0x19')](function(_0x52a462){if(_0x52a462){return db['ChatApplication'][_0x8e08('0x2d')]({'where':{'ChatWebsiteId':_0x5f4341},'transaction':_0x1b09c3})[_0x8e08('0x19')](function(){var _0x4fe987=_[_0x8e08('0x4a')](_0x5b057d,function(_0x1e16e9){_0x1e16e9[_0x8e08('0x72')]=_0x5f4341;return _0x1e16e9;});return db[_0x8e08('0x116')]['bulkCreate'](_0x4fe987,{'transaction':_0x1b09c3});});}else{_0x12512e=0x194;_0x59caef=[];}});})[_0x8e08('0x19')](function(){if(_0x12512e!==0x194){return db[_0x8e08('0x116')][_0x8e08('0x117')]({'where':{'ChatWebsiteId':_0x5f4341},'order':_0x8e08('0xac')})[_0x8e08('0x19')](function(_0x416b96){_0x59caef=_0x416b96;});}})[_0x8e08('0x23')](function(_0x4d6d33){_0x12512e=0x1f4;logger[_0x8e08('0x20')](_0x4d6d33[_0x8e08('0x118')]);if(_0x4d6d33['name']){delete _0x4d6d33[_0x8e08('0x31')];}_0x59caef=_0x4d6d33;})['finally'](function(){if(_0x59caef===null){_0x4404e6[_0x8e08('0x24')](_0x12512e);}else{if(_0x12512e===0x1f4){_0x4404e6['status'](_0x12512e)[_0x8e08('0x32')](_0x59caef);}else{_0x4404e6['status'](_0x12512e)[_0x8e08('0x26')](_0x59caef);}}});};exports[_0x8e08('0x119')]=function(_0x8f2493,_0x51ae9a){var _0x4acd72={};var _0x16764e={};var _0x2a06d6;var _0xac0e6d;return db[_0x8e08('0x4b')]['findOne']({'where':{'id':_0x8f2493[_0x8e08('0x62')]['id']}})['then'](handleEntityNotFound(_0x51ae9a,null))['then'](function(_0x458513){if(_0x458513){_0x2a06d6=_0x458513;_0x16764e[_0x8e08('0x51')]=_['keys'](db['ChatApplication'][_0x8e08('0x4c')]);_0x16764e[_0x8e08('0x4e')]=_[_0x8e08('0x4f')](_0x8f2493[_0x8e08('0x4e')]);_0x16764e[_0x8e08('0x50')]=_[_0x8e08('0x52')](_0x16764e[_0x8e08('0x51')],_0x16764e['query']);_0x4acd72['attributes']=_[_0x8e08('0x52')](_0x16764e[_0x8e08('0x51')],qs[_0x8e08('0x63')](_0x8f2493['query'][_0x8e08('0x63')]));_0x4acd72[_0x8e08('0x53')]=_0x4acd72[_0x8e08('0x53')][_0x8e08('0x54')]?_0x4acd72[_0x8e08('0x53')]:_0x16764e[_0x8e08('0x51')];_0x4acd72[_0x8e08('0x57')]=qs[_0x8e08('0x58')](_0x8f2493['query'][_0x8e08('0x58')]);_0x4acd72[_0x8e08('0x59')]=qs[_0x8e08('0x50')](_[_0x8e08('0x5a')](_0x8f2493[_0x8e08('0x4e')],_0x16764e[_0x8e08('0x50')]));if(_0x8f2493[_0x8e08('0x4e')][_0x8e08('0x5c')]){_0x4acd72[_0x8e08('0x59')]=_['merge'](_0x4acd72[_0x8e08('0x59')],{'$or':_[_0x8e08('0x4a')](_0x4acd72[_0x8e08('0x53')],function(_0x191850){var _0xcefd9b={};_0xcefd9b[_0x191850]={'$like':'%'+_0x8f2493[_0x8e08('0x4e')][_0x8e08('0x5c')]+'%'};return _0xcefd9b;})});}_0x4acd72=_[_0x8e08('0x5b')]({},_0x4acd72,_0x8f2493[_0x8e08('0xf8')]);return _0x2a06d6[_0x8e08('0x119')](_0x4acd72);}})[_0x8e08('0x19')](function(_0xd75ca5){if(_0xd75ca5){_0xac0e6d=_0xd75ca5[_0x8e08('0x54')];if(!_0x8f2493[_0x8e08('0x4e')]['hasOwnProperty'](_0x8e08('0x56'))){_0x4acd72[_0x8e08('0x28')]=qs[_0x8e08('0x28')](_0x8f2493[_0x8e08('0x4e')]['limit']);_0x4acd72[_0x8e08('0x27')]=qs[_0x8e08('0x27')](_0x8f2493[_0x8e08('0x4e')][_0x8e08('0x27')]);}return _0x2a06d6['getApplications'](_0x4acd72);}})[_0x8e08('0x19')](function(_0x2a40d1){if(_0x2a40d1){return _0x2a40d1?{'count':_0xac0e6d,'rows':_0x2a40d1}:null;}})[_0x8e08('0x19')](respondWithResult(_0x51ae9a,null))[_0x8e08('0x23')](handleError(_0x51ae9a,null));};exports[_0x8e08('0x11a')]=function(_0x3e3a6d,_0x519e9c){return db[_0x8e08('0x11b')][_0x8e08('0x64')]({'where':{'id':_0x3e3a6d['params']['id']}})[_0x8e08('0x19')](handleEntityNotFound(_0x519e9c,null))[_0x8e08('0x19')](function(_0x429629){if(_0x429629){return _0x429629[_0x8e08('0x11a')](_0x3e3a6d[_0x8e08('0x66')][_0x8e08('0x11c')],_[_0x8e08('0x11d')](_0x3e3a6d[_0x8e08('0x66')],['ids','id'])||{});}})['then'](respondWithResult(_0x519e9c,null))['catch'](handleError(_0x519e9c,null));};exports['getProactiveActions']=function(_0x521cc1,_0x287c59){var _0x4213c3={};var _0x3fecd2={};var _0x4fbfc4;var _0x37b2d0;return db['ChatWebsite'][_0x8e08('0x74')]({'where':{'id':_0x521cc1['params']['id']}})[_0x8e08('0x19')](handleEntityNotFound(_0x287c59,null))[_0x8e08('0x19')](function(_0x37820f){if(_0x37820f){_0x4fbfc4=_0x37820f;_0x3fecd2['model']=_[_0x8e08('0x4f')](db['ChatProactiveAction'][_0x8e08('0x4c')]);_0x3fecd2[_0x8e08('0x4e')]=_['keys'](_0x521cc1['query']);_0x3fecd2[_0x8e08('0x50')]=_[_0x8e08('0x52')](_0x3fecd2[_0x8e08('0x51')],_0x3fecd2[_0x8e08('0x4e')]);_0x4213c3[_0x8e08('0x53')]=_[_0x8e08('0x52')](_0x3fecd2[_0x8e08('0x51')],qs[_0x8e08('0x63')](_0x521cc1[_0x8e08('0x4e')]['fields']));_0x4213c3['attributes']=_0x4213c3[_0x8e08('0x53')][_0x8e08('0x54')]?_0x4213c3[_0x8e08('0x53')]:_0x3fecd2['model'];_0x4213c3[_0x8e08('0x57')]=qs[_0x8e08('0x58')](_0x521cc1[_0x8e08('0x4e')][_0x8e08('0x58')]);_0x4213c3[_0x8e08('0x59')]=qs[_0x8e08('0x50')](_[_0x8e08('0x5a')](_0x521cc1[_0x8e08('0x4e')],_0x3fecd2['filters']));if(_0x521cc1['query'][_0x8e08('0x5c')]){_0x4213c3[_0x8e08('0x59')]=_['merge'](_0x4213c3[_0x8e08('0x59')],{'$or':_[_0x8e08('0x4a')](_0x4213c3['attributes'],function(_0xc73ac3){var _0x3a65d6={};_0x3a65d6[_0xc73ac3]={'$like':'%'+_0x521cc1[_0x8e08('0x4e')]['filter']+'%'};return _0x3a65d6;})});}_0x4213c3=_[_0x8e08('0x5b')]({},_0x4213c3,_0x521cc1[_0x8e08('0xf8')]);return _0x4fbfc4[_0x8e08('0x101')](_0x4213c3);}})[_0x8e08('0x19')](function(_0x1f4d71){if(_0x1f4d71){_0x37b2d0=_0x1f4d71['length'];if(!_0x521cc1[_0x8e08('0x4e')][_0x8e08('0x55')](_0x8e08('0x56'))){_0x4213c3['limit']=qs['limit'](_0x521cc1[_0x8e08('0x4e')]['limit']);_0x4213c3[_0x8e08('0x27')]=qs[_0x8e08('0x27')](_0x521cc1[_0x8e08('0x4e')][_0x8e08('0x27')]);}return _0x4fbfc4[_0x8e08('0x101')](_0x4213c3);}})[_0x8e08('0x19')](function(_0x57eb07){if(_0x57eb07){return _0x57eb07?{'count':_0x37b2d0,'rows':_0x57eb07}:null;}})['then'](respondWithResult(_0x287c59,null))['catch'](handleError(_0x287c59,null));};exports['getFields']=function(_0x944659,_0x2fb3c1){var _0x1b8ff9=_0x944659[_0x8e08('0x4e')][_0x8e08('0x11e')]===_0x8e08('0x11f')?_0x8e08('0x120'):_0x8e08('0x121');return db[_0x8e08('0x4b')][_0x8e08('0x64')]({'attributes':['id',_0x1b8ff9],'where':{'id':_0x944659['params']['id']}})[_0x8e08('0x19')](handleEntityNotFound(_0x2fb3c1,null))[_0x8e08('0x19')](function(_0x1ded80){if(_0x1ded80){var _0x47f976=_0x1ded80[_0x1b8ff9];var _0x1d6091=_0x47f976&&_0x47f976['items']?_0x47f976[_0x8e08('0x122')]:[];_0x2fb3c1[_0x8e08('0x32')]({'fromKey':_['isNil'](_0x47f976[_0x8e08('0x123')])?undefined:_0x47f976[_0x8e08('0x123')],'count':_0x1d6091[_0x8e08('0x54')],'rows':_0x1d6091});}})[_0x8e08('0x23')](handleError(_0x2fb3c1,null));};exports[_0x8e08('0x124')]=function(_0x119cf0,_0x3e7b0e){var _0x47ed00={'raw':![],'where':{}};var _0xd5a5aa={};var _0x23c68a={'count':0x0,'rows':[]};return db[_0x8e08('0x4b')]['findOne']({'where':{'id':_0x119cf0[_0x8e08('0x62')]['id']}})[_0x8e08('0x19')](handleEntityNotFound(_0x3e7b0e,null))[_0x8e08('0x19')](function(_0x5f36ee){if(_0x5f36ee){_0xd5a5aa[_0x8e08('0x51')]=_[_0x8e08('0x4f')](db[_0x8e08('0xda')][_0x8e08('0x4c')]);_0xd5a5aa[_0x8e08('0x4e')]=_[_0x8e08('0x4f')](_0x119cf0['query']);_0xd5a5aa[_0x8e08('0x50')]=_[_0x8e08('0x52')](_0xd5a5aa[_0x8e08('0x51')],_0xd5a5aa[_0x8e08('0x4e')]);_0x47ed00[_0x8e08('0x53')]=_[_0x8e08('0x52')](_0xd5a5aa[_0x8e08('0x51')],qs[_0x8e08('0x63')](_0x119cf0['query'][_0x8e08('0x63')]));_0x47ed00[_0x8e08('0x53')]=_0x47ed00[_0x8e08('0x53')][_0x8e08('0x54')]?_0x47ed00[_0x8e08('0x53')]:_0xd5a5aa[_0x8e08('0x51')];if(!_0x119cf0[_0x8e08('0x4e')][_0x8e08('0x55')](_0x8e08('0x56'))){_0x47ed00[_0x8e08('0x28')]=qs[_0x8e08('0x28')](_0x119cf0[_0x8e08('0x4e')][_0x8e08('0x28')]);_0x47ed00[_0x8e08('0x27')]=qs['offset'](_0x119cf0[_0x8e08('0x4e')][_0x8e08('0x27')]);}_0x47ed00[_0x8e08('0x57')]=qs[_0x8e08('0x58')](_0x119cf0[_0x8e08('0x4e')]['sort']);_0x47ed00[_0x8e08('0x59')]=qs['filters'](_[_0x8e08('0x5a')](_0x119cf0[_0x8e08('0x4e')],_0xd5a5aa[_0x8e08('0x50')]));_0x47ed00['where'][_0x8e08('0x72')]=_0x5f36ee['id'];if(_0x119cf0[_0x8e08('0x4e')][_0x8e08('0x5c')]){_0x47ed00[_0x8e08('0x59')]=_[_0x8e08('0x5b')](_0x47ed00[_0x8e08('0x59')],{'$or':_['map'](_0x47ed00[_0x8e08('0x53')],function(_0x444194){var _0x466fa0={};_0x466fa0[_0x444194]={'$like':'%'+_0x119cf0[_0x8e08('0x4e')]['filter']+'%'};return _0x466fa0;})});}_0x47ed00=_[_0x8e08('0x5b')]({},_0x47ed00,_0x119cf0[_0x8e08('0xf8')]);return db[_0x8e08('0xda')][_0x8e08('0x29')]({'where':_0x47ed00['where']})['then'](function(_0x51d7e0){_0x23c68a[_0x8e08('0x29')]=_0x51d7e0;if(_0x119cf0[_0x8e08('0x4e')][_0x8e08('0x5d')]){_0x47ed00[_0x8e08('0x5e')]=[{'all':!![]}];}else{_0x47ed00[_0x8e08('0x5e')]=[{'model':db[_0x8e08('0x9b')],'as':_0x8e08('0xf9'),'required':![]},{'model':db[_0x8e08('0xe3')],'as':_0x8e08('0x125'),'required':![]}];}return db['ChatOfflineMessage'][_0x8e08('0x5f')](_0x47ed00);})[_0x8e08('0x19')](function(_0x2f3cac){_0x23c68a[_0x8e08('0x60')]=_0x2f3cac;return _0x23c68a;});}})[_0x8e08('0x19')](respondWithFilteredResult(_0x3e7b0e,_0x47ed00))[_0x8e08('0x23')](handleError(_0x3e7b0e,null));};exports['addAgents']=function(_0x384c69,_0x177197){return db[_0x8e08('0x4b')][_0x8e08('0x64')]({'where':{'id':_0x384c69[_0x8e08('0x62')]['id']}})['then'](handleEntityNotFound(_0x177197,null))[_0x8e08('0x19')](function(_0x1c3e65){if(_0x1c3e65){return _0x1c3e65['addAgents'](_0x384c69[_0x8e08('0x66')][_0x8e08('0x11c')],_['omit'](_0x384c69['body'],['ids','id'])||{})[_0x8e08('0x126')](function(_0x2f5a4b){for(var _0x5cd970=0x0;_0x5cd970<_0x384c69[_0x8e08('0x66')][_0x8e08('0x11c')][_0x8e08('0x54')];_0x5cd970+=0x1){socket[_0x8e08('0x127')](_0x8e08('0x128'),{'UserId':Number(_0x384c69[_0x8e08('0x66')][_0x8e08('0x11c')][_0x5cd970]),'ChatWebsiteId':Number(_0x384c69[_0x8e08('0x62')]['id'])});}return _0x2f5a4b;});}})[_0x8e08('0x19')](respondWithResult(_0x177197,null))[_0x8e08('0x23')](handleError(_0x177197,null));};exports[_0x8e08('0x129')]=function(_0x42a211,_0x8fd91e){return db[_0x8e08('0x4b')][_0x8e08('0x64')]({'where':{'id':_0x42a211[_0x8e08('0x62')]['id']}})['then'](handleEntityNotFound(_0x8fd91e,null))[_0x8e08('0x19')](function(_0xec0c27){if(_0xec0c27){return _0xec0c27[_0x8e08('0x129')](_0x42a211[_0x8e08('0x4e')][_0x8e08('0x11c')])[_0x8e08('0x19')](function(){if(_[_0x8e08('0x12a')](_0x42a211[_0x8e08('0x4e')][_0x8e08('0x11c')])){for(var _0x3bacbd=0x0;_0x3bacbd<_0x42a211['query'][_0x8e08('0x11c')][_0x8e08('0x54')];_0x3bacbd+=0x1){socket[_0x8e08('0x127')](_0x8e08('0x12b'),{'UserId':Number(_0x42a211[_0x8e08('0x4e')][_0x8e08('0x11c')][_0x3bacbd]),'ChatWebsiteId':Number(_0x42a211[_0x8e08('0x62')]['id'])});}}else{socket[_0x8e08('0x127')](_0x8e08('0x12b'),{'UserId':Number(_0x42a211[_0x8e08('0x4e')]['ids']),'ChatWebsiteId':Number(_0x42a211[_0x8e08('0x62')]['id'])});}});}})[_0x8e08('0x19')](respondWithStatusCode(_0x8fd91e,null))[_0x8e08('0x23')](handleError(_0x8fd91e,null));};exports[_0x8e08('0x12c')]=function(_0x3e9d25,_0x1eabc2){var _0x45da8c={};var _0xb06782={};var _0x321437;var _0x40dabb;return db[_0x8e08('0x4b')][_0x8e08('0x74')]({'where':{'id':_0x3e9d25['params']['id']}})[_0x8e08('0x19')](handleEntityNotFound(_0x1eabc2,null))[_0x8e08('0x19')](function(_0x946397){if(_0x946397){_0x321437=_0x946397;_0xb06782[_0x8e08('0x51')]=_[_0x8e08('0x4f')](db[_0x8e08('0xc0')][_0x8e08('0x4c')]);_0xb06782['query']=_[_0x8e08('0x4f')](_0x3e9d25[_0x8e08('0x4e')]);_0xb06782[_0x8e08('0x50')]=_[_0x8e08('0x52')](_0xb06782[_0x8e08('0x51')],_0xb06782['query']);_0x45da8c[_0x8e08('0x53')]=_[_0x8e08('0x52')](_0xb06782['model'],qs[_0x8e08('0x63')](_0x3e9d25['query']['fields']));_0x45da8c['attributes']=_0x45da8c['attributes'][_0x8e08('0x54')]?_0x45da8c[_0x8e08('0x53')]:_0xb06782[_0x8e08('0x51')];_0x45da8c['order']=qs[_0x8e08('0x58')](_0x3e9d25[_0x8e08('0x4e')][_0x8e08('0x58')]);_0x45da8c[_0x8e08('0x59')]=qs[_0x8e08('0x50')](_[_0x8e08('0x5a')](_0x3e9d25[_0x8e08('0x4e')],_0xb06782['filters']));if(_0x3e9d25[_0x8e08('0x4e')][_0x8e08('0x5c')]){_0x45da8c[_0x8e08('0x59')]=_[_0x8e08('0x5b')](_0x45da8c[_0x8e08('0x59')],{'$or':_['map'](_0x45da8c[_0x8e08('0x53')],function(_0x39061a){var _0x2e64b3={};_0x2e64b3[_0x39061a]={'$like':'%'+_0x3e9d25[_0x8e08('0x4e')][_0x8e08('0x5c')]+'%'};return _0x2e64b3;})});}_0x45da8c=_[_0x8e08('0x5b')]({},_0x45da8c,_0x3e9d25[_0x8e08('0xf8')]);return _0x321437[_0x8e08('0x12c')](_0x45da8c);}})[_0x8e08('0x19')](function(_0x2a681e){if(_0x2a681e){_0x40dabb=_0x2a681e[_0x8e08('0x54')];if(!_0x3e9d25[_0x8e08('0x4e')][_0x8e08('0x55')](_0x8e08('0x56'))){_0x45da8c[_0x8e08('0x28')]=qs[_0x8e08('0x28')](_0x3e9d25[_0x8e08('0x4e')]['limit']);_0x45da8c['offset']=qs['offset'](_0x3e9d25[_0x8e08('0x4e')][_0x8e08('0x27')]);}return _0x321437['getAgents'](_0x45da8c);}})['then'](function(_0x22f558){if(_0x22f558){return _0x22f558?{'count':_0x40dabb,'rows':_0x22f558}:null;}})['then'](respondWithResult(_0x1eabc2,null))[_0x8e08('0x23')](handleError(_0x1eabc2,null));};
\ No newline at end of file
diff --git a/server/api/chatWebsite/chatWebsite.events.js b/server/api/chatWebsite/chatWebsite.events.js
index 14a18f0..dcc9f85 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 _0x00bb=['remove','hook','exports','events','../../mysqldb','ChatWebsite','save'];(function(_0x45833a,_0x106229){var _0xc606a6=function(_0x5357f2){while(--_0x5357f2){_0x45833a['push'](_0x45833a['shift']());}};_0xc606a6(++_0x106229);}(_0x00bb,0x1d8));var _0xb00b=function(_0x550d12,_0x5384bd){_0x550d12=_0x550d12-0x0;var _0x12103d=_0x00bb[_0x550d12];return _0x12103d;};'use strict';var EventEmitter=require(_0xb00b('0x0'));var ChatWebsite=require(_0xb00b('0x1'))['db'][_0xb00b('0x2')];var ChatWebsiteEvents=new EventEmitter();ChatWebsiteEvents['setMaxListeners'](0x0);var events={'afterCreate':_0xb00b('0x3'),'afterUpdate':'update','afterDestroy':_0xb00b('0x4')};function emitEvent(_0x464fe7){return function(_0x582ef9,_0x14b5d0,_0x2dbd25){ChatWebsiteEvents['emit'](_0x464fe7+':'+_0x582ef9['id'],_0x582ef9);ChatWebsiteEvents['emit'](_0x464fe7,_0x582ef9);_0x2dbd25(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];ChatWebsite[_0xb00b('0x5')](e,emitEvent(event));}}module[_0xb00b('0x6')]=ChatWebsiteEvents;
\ No newline at end of file
+var _0x55ca=['events','../../mysqldb','update','remove','emit','hasOwnProperty','hook'];(function(_0x2064e5,_0x4f6fa2){var _0x21a233=function(_0x1b2491){while(--_0x1b2491){_0x2064e5['push'](_0x2064e5['shift']());}};_0x21a233(++_0x4f6fa2);}(_0x55ca,0x126));var _0xa55c=function(_0x9fb081,_0x48f480){_0x9fb081=_0x9fb081-0x0;var _0x43f8b0=_0x55ca[_0x9fb081];return _0x43f8b0;};'use strict';var EventEmitter=require(_0xa55c('0x0'));var ChatWebsite=require(_0xa55c('0x1'))['db']['ChatWebsite'];var ChatWebsiteEvents=new EventEmitter();ChatWebsiteEvents['setMaxListeners'](0x0);var events={'afterCreate':'save','afterUpdate':_0xa55c('0x2'),'afterDestroy':_0xa55c('0x3')};function emitEvent(_0x5dc716){return function(_0x3b478a,_0x2db02a,_0xcb02e3){ChatWebsiteEvents[_0xa55c('0x4')](_0x5dc716+':'+_0x3b478a['id'],_0x3b478a);ChatWebsiteEvents[_0xa55c('0x4')](_0x5dc716,_0x3b478a);_0xcb02e3(null);};}for(var e in events){if(events[_0xa55c('0x5')](e)){var event=events[e];ChatWebsite[_0xa55c('0x6')](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 4223e75..38afb24 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 _0xc4c4=['./chatWebsite.attributes','exports','define','ChatWebsite','chat_websites','lodash','util','../../config/logger','moment','bluebird','request-promise'];(function(_0x18a1ed,_0x5c34cd){var _0x2178d2=function(_0xeb9f75){while(--_0xeb9f75){_0x18a1ed['push'](_0x18a1ed['shift']());}};_0x2178d2(++_0x5c34cd);}(_0xc4c4,0xec));var _0x4c4c=function(_0xbeb808,_0x881ddf){_0xbeb808=_0xbeb808-0x0;var _0x5d6909=_0xc4c4[_0xbeb808];return _0x5d6909;};'use strict';var _=require(_0x4c4c('0x0'));var util=require(_0x4c4c('0x1'));var logger=require(_0x4c4c('0x2'))('api');var moment=require(_0x4c4c('0x3'));var BPromise=require(_0x4c4c('0x4'));var rp=require(_0x4c4c('0x5'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x4c4c('0x6'));module[_0x4c4c('0x7')]=function(_0x1b1012,_0x4ad8ef){return _0x1b1012[_0x4c4c('0x8')](_0x4c4c('0x9'),attributes,{'tableName':_0x4c4c('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x085d=['bluebird','request-promise','path','exports','define','chat_websites','lodash','util','../../config/logger','api','moment'];(function(_0x262357,_0x4ac043){var _0x445224=function(_0x19af89){while(--_0x19af89){_0x262357['push'](_0x262357['shift']());}};_0x445224(++_0x4ac043);}(_0x085d,0x187));var _0xd085=function(_0x1b6563,_0x3bf0f1){_0x1b6563=_0x1b6563-0x0;var _0xdea7b8=_0x085d[_0x1b6563];return _0xdea7b8;};'use strict';var _=require(_0xd085('0x0'));var util=require(_0xd085('0x1'));var logger=require(_0xd085('0x2'))(_0xd085('0x3'));var moment=require(_0xd085('0x4'));var BPromise=require(_0xd085('0x5'));var rp=require(_0xd085('0x6'));var fs=require('fs');var path=require(_0xd085('0x7'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require('./chatWebsite.attributes');module[_0xd085('0x8')]=function(_0x1a2c66,_0xaccfc5){return _0x1a2c66[_0xd085('0x9')]('ChatWebsite',attributes,{'tableName':_0xd085('0xa'),'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 c7309c5..ce2cde9 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 _0xc85c=['http','redis','defaults','localhost','socket.io-emitter','./chatWebsite.socket','register','request','then','info','ChatWebsite,\x20%s,\x20%s','request\x20sent','ChatWebsite,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','util','bluebird','../../mysqldb','../../config/logger','rpc','client'];(function(_0xfe3e7,_0x2e1251){var _0x5b1381=function(_0x131f57){while(--_0x131f57){_0xfe3e7['push'](_0xfe3e7['shift']());}};_0x5b1381(++_0x2e1251);}(_0xc85c,0x165));var _0xcc85=function(_0x1eb4e0,_0x4ebc2d){_0x1eb4e0=_0x1eb4e0-0x0;var _0x18ec21=_0xc85c[_0x1eb4e0];return _0x18ec21;};'use strict';var _=require(_0xcc85('0x0'));var util=require(_0xcc85('0x1'));var moment=require('moment');var BPromise=require(_0xcc85('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0xcc85('0x3'))['db'];var utils=require('../../config/utils');var logger=require(_0xcc85('0x4'))(_0xcc85('0x5'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0xcc85('0x6')][_0xcc85('0x7')]({'port':0x232a});config[_0xcc85('0x8')]=_[_0xcc85('0x9')](config[_0xcc85('0x8')],{'host':_0xcc85('0xa'),'port':0x18eb});var socket=require(_0xcc85('0xb'))(new Redis(config['redis']));require(_0xcc85('0xc'))[_0xcc85('0xd')](socket);function respondWithRpcPromise(_0x59399d,_0x235b9e,_0x5d1787){return new BPromise(function(_0x47d961,_0x7398b6){return client[_0xcc85('0xe')](_0x59399d,_0x5d1787)[_0xcc85('0xf')](function(_0x6f5e7d){logger[_0xcc85('0x10')](_0xcc85('0x11'),_0x235b9e,_0xcc85('0x12'));logger['debug'](_0xcc85('0x13'),_0x235b9e,_0xcc85('0x12'),JSON[_0xcc85('0x14')](_0x6f5e7d));if(_0x6f5e7d[_0xcc85('0x15')]){if(_0x6f5e7d['error'][_0xcc85('0x16')]===0x1f4){logger[_0xcc85('0x15')](_0xcc85('0x11'),_0x235b9e,_0x6f5e7d[_0xcc85('0x15')][_0xcc85('0x17')]);return _0x7398b6(_0x6f5e7d[_0xcc85('0x15')][_0xcc85('0x17')]);}logger[_0xcc85('0x15')]('ChatWebsite,\x20%s,\x20%s',_0x235b9e,_0x6f5e7d['error']['message']);return _0x47d961(_0x6f5e7d[_0xcc85('0x15')][_0xcc85('0x17')]);}else{logger[_0xcc85('0x10')](_0xcc85('0x11'),_0x235b9e,_0xcc85('0x12'));_0x47d961(_0x6f5e7d[_0xcc85('0x18')][_0xcc85('0x17')]);}})[_0xcc85('0x19')](function(_0x4a1638){logger['error'](_0xcc85('0x11'),_0x235b9e,_0x4a1638);_0x7398b6(_0x4a1638);});});}
\ No newline at end of file
+var _0x38aa=['catch','util','moment','bluebird','randomstring','ioredis','../../config/logger','rpc','../../config/environment','jayson/promise','client','redis','defaults','localhost','./chatWebsite.socket','request','info','ChatWebsite,\x20%s,\x20%s','request\x20sent','ChatWebsite,\x20%s,\x20%s,\x20%s','error','code','message'];(function(_0x2de020,_0x252df0){var _0x182b7c=function(_0xcbcdaa){while(--_0xcbcdaa){_0x2de020['push'](_0x2de020['shift']());}};_0x182b7c(++_0x252df0);}(_0x38aa,0xa2));var _0xa38a=function(_0x4aedd8,_0x5636af){_0x4aedd8=_0x4aedd8-0x0;var _0x538ae7=_0x38aa[_0x4aedd8];return _0x538ae7;};'use strict';var _=require('lodash');var util=require(_0xa38a('0x0'));var moment=require(_0xa38a('0x1'));var BPromise=require(_0xa38a('0x2'));var rs=require(_0xa38a('0x3'));var fs=require('fs');var Redis=require(_0xa38a('0x4'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0xa38a('0x5'))(_0xa38a('0x6'));var config=require(_0xa38a('0x7'));var jayson=require(_0xa38a('0x8'));var client=jayson[_0xa38a('0x9')]['http']({'port':0x232a});config[_0xa38a('0xa')]=_[_0xa38a('0xb')](config[_0xa38a('0xa')],{'host':_0xa38a('0xc'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xa38a('0xa')]));require(_0xa38a('0xd'))['register'](socket);function respondWithRpcPromise(_0x51b058,_0x38afad,_0x25becf){return new BPromise(function(_0x2bb7d7,_0x54c0d7){return client[_0xa38a('0xe')](_0x51b058,_0x25becf)['then'](function(_0xa1abf7){logger[_0xa38a('0xf')](_0xa38a('0x10'),_0x38afad,_0xa38a('0x11'));logger['debug'](_0xa38a('0x12'),_0x38afad,_0xa38a('0x11'),JSON['stringify'](_0xa1abf7));if(_0xa1abf7[_0xa38a('0x13')]){if(_0xa1abf7[_0xa38a('0x13')][_0xa38a('0x14')]===0x1f4){logger[_0xa38a('0x13')](_0xa38a('0x10'),_0x38afad,_0xa1abf7[_0xa38a('0x13')][_0xa38a('0x15')]);return _0x54c0d7(_0xa1abf7['error'][_0xa38a('0x15')]);}logger[_0xa38a('0x13')](_0xa38a('0x10'),_0x38afad,_0xa1abf7[_0xa38a('0x13')][_0xa38a('0x15')]);return _0x2bb7d7(_0xa1abf7[_0xa38a('0x13')][_0xa38a('0x15')]);}else{logger['info'](_0xa38a('0x10'),_0x38afad,_0xa38a('0x11'));_0x2bb7d7(_0xa1abf7['result'][_0xa38a('0x15')]);}})[_0xa38a('0x16')](function(_0x5961df){logger[_0xa38a('0x13')](_0xa38a('0x10'),_0x38afad,_0x5961df);_0x54c0d7(_0x5961df);});});}
\ No newline at end of file
diff --git a/server/api/chatWebsite/chatWebsite.socket.js b/server/api/chatWebsite/chatWebsite.socket.js
index ee0202c..39081d3 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 _0xb6b4=['update','removeListener','length','chatWebsite:','./chatWebsite.events','save','remove'];(function(_0x1e4d7e,_0x45e3ba){var _0x275eb3=function(_0x4c91e9){while(--_0x4c91e9){_0x1e4d7e['push'](_0x1e4d7e['shift']());}};_0x275eb3(++_0x45e3ba);}(_0xb6b4,0x9e));var _0x4b6b=function(_0x492e92,_0x3fae52){_0x492e92=_0x492e92-0x0;var _0x55975e=_0xb6b4[_0x492e92];return _0x55975e;};'use strict';var ChatWebsiteEvents=require(_0x4b6b('0x0'));var events=[_0x4b6b('0x1'),_0x4b6b('0x2'),_0x4b6b('0x3')];function createListener(_0x2af296,_0x2d1fbb){return function(_0x5de5bf){_0x2d1fbb['emit'](_0x2af296,_0x5de5bf);};}function removeListener(_0x1dbfb9,_0x22316a){return function(){ChatWebsiteEvents[_0x4b6b('0x4')](_0x1dbfb9,_0x22316a);};}exports['register']=function(_0x42c1a6){for(var _0x301556=0x0,_0x213e59=events[_0x4b6b('0x5')];_0x301556<_0x213e59;_0x301556++){var _0x28fd6a=events[_0x301556];var _0x365b60=createListener(_0x4b6b('0x6')+_0x28fd6a,_0x42c1a6);ChatWebsiteEvents['on'](_0x28fd6a,_0x365b60);}};
\ No newline at end of file
+var _0x9466=['length','./chatWebsite.events','save','remove','update','emit','removeListener','register'];(function(_0x3aa0ac,_0x5f5da6){var _0x568a11=function(_0x26f47e){while(--_0x26f47e){_0x3aa0ac['push'](_0x3aa0ac['shift']());}};_0x568a11(++_0x5f5da6);}(_0x9466,0x151));var _0x6946=function(_0x11005e,_0x20c3d2){_0x11005e=_0x11005e-0x0;var _0x29338f=_0x9466[_0x11005e];return _0x29338f;};'use strict';var ChatWebsiteEvents=require(_0x6946('0x0'));var events=[_0x6946('0x1'),_0x6946('0x2'),_0x6946('0x3')];function createListener(_0x2518a0,_0x537dda){return function(_0x2eb52d){_0x537dda[_0x6946('0x4')](_0x2518a0,_0x2eb52d);};}function removeListener(_0x453ebe,_0xe04355){return function(){ChatWebsiteEvents[_0x6946('0x5')](_0x453ebe,_0xe04355);};}exports[_0x6946('0x6')]=function(_0x2e1a7a){for(var _0x40c2b4=0x0,_0x235b8e=events[_0x6946('0x7')];_0x40c2b4<_0x235b8e;_0x40c2b4++){var _0x31e84b=events[_0x40c2b4];var _0x44856a=createListener('chatWebsite:'+_0x31e84b,_0x2e1a7a);ChatWebsiteEvents['on'](_0x31e84b,_0x44856a);}};
\ No newline at end of file
diff --git a/server/api/chatWebsite/helpers/wildcard-expressions.js b/server/api/chatWebsite/helpers/wildcard-expressions.js
index 069654c..a941692 100644
--- a/server/api/chatWebsite/helpers/wildcard-expressions.js
+++ b/server/api/chatWebsite/helpers/wildcard-expressions.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x12fd=['localhost','test','([\x5cw]+)','exports','../../../utils/misc','escapeRegExp','url','URL','replace'];(function(_0x409fb8,_0x5ab3d3){var _0x278270=function(_0x58849c){while(--_0x58849c){_0x409fb8['push'](_0x409fb8['shift']());}};_0x278270(++_0x5ab3d3);}(_0x12fd,0x199));var _0xd12f=function(_0x5c53b8,_0x32169c){_0x5c53b8=_0x5c53b8-0x0;var _0x352de2=_0x12fd[_0x5c53b8];return _0x352de2;};var escapeRegExp=require(_0xd12f('0x0'))[_0xd12f('0x1')];var URL=require(_0xd12f('0x2'))[_0xd12f('0x3')];function testWildcardValidity(_0x18abfb){let _0x48fb45=!![];try{new URL(_0x18abfb[_0xd12f('0x4')]('*',_0xd12f('0x5')));}catch(_0x13efed){_0x48fb45=![];}return _0x48fb45&&new RegExp(/(http(s)?):\/\/(\*|(((\*\.)+)?([a-zA-Z0-9\-_]+\.){0,}([a-zA-Z0-9\-_]+)))(:[\d]+)?\/?$/)[_0xd12f('0x6')](_0x18abfb);}function testWebsiteWithWildcard(_0x79c5c9,_0x154c72){let _0x55bb7d;const _0x3f733d=escapeRegExp(_0x79c5c9)['replace']('\x5c*',_0xd12f('0x7'));try{new URL(_0x79c5c9[_0xd12f('0x4')]('\x5c*',_0xd12f('0x5')));_0x55bb7d=new RegExp(_0x3f733d)[_0xd12f('0x6')](_0x154c72);}catch(_0x504504){_0x55bb7d=![];}return _0x55bb7d;}module[_0xd12f('0x8')]={'testWebsiteWithWildcard':testWebsiteWithWildcard,'testWildcardValidity':testWildcardValidity};
\ No newline at end of file
+var _0x8f7d=['replace','test','([\x5cw]+)','localhost','exports','../../../utils/misc','escapeRegExp','URL'];(function(_0xe8d029,_0x37a8f6){var _0x8c4ff1=function(_0x333729){while(--_0x333729){_0xe8d029['push'](_0xe8d029['shift']());}};_0x8c4ff1(++_0x37a8f6);}(_0x8f7d,0xf5));var _0xd8f7=function(_0x4f36d1,_0x5dccab){_0x4f36d1=_0x4f36d1-0x0;var _0x536733=_0x8f7d[_0x4f36d1];return _0x536733;};var escapeRegExp=require(_0xd8f7('0x0'))[_0xd8f7('0x1')];var URL=require('url')[_0xd8f7('0x2')];function testWildcardValidity(_0x4a4401){let _0x52384d=!![];try{new URL(_0x4a4401[_0xd8f7('0x3')]('*','localhost'));}catch(_0x9558b6){_0x52384d=![];}return _0x52384d&&new RegExp(/(http(s)?):\/\/(\*|(((\*\.)+)?([a-zA-Z0-9\-_]+\.){0,}([a-zA-Z0-9\-_]+)))(:[\d]+)?\/?$/)[_0xd8f7('0x4')](_0x4a4401);}function testWebsiteWithWildcard(_0x1b9964,_0x3a58c7){let _0x524a2e;const _0x4090c9=escapeRegExp(_0x1b9964)[_0xd8f7('0x3')]('\x5c*',_0xd8f7('0x5'));try{new URL(_0x1b9964[_0xd8f7('0x3')]('\x5c*',_0xd8f7('0x6')));_0x524a2e=new RegExp(_0x4090c9)[_0xd8f7('0x4')](_0x3a58c7);}catch(_0x253fb5){_0x524a2e=![];}return _0x524a2e;}module[_0xd8f7('0x7')]={'testWebsiteWithWildcard':testWebsiteWithWildcard,'testWildcardValidity':testWildcardValidity};
\ No newline at end of file
diff --git a/server/api/chatWebsite/index.js b/server/api/chatWebsite/index.js
index 1c5cde5..ae6fcb3 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 _0x3c7b=['get','isAuthenticated','index','/describe','describe','/:id','show','/:id/dispositions','getDispositions','/:id/canned_answers','getAnswers','getLogo','/:id/avatar','getAvatar','getCustomerAvatar','/:id/system_avatar','getSystemAvatar','getInteractions','/:id/snippet','getSnippet','/:id/applications','getApplications','getProactiveActions','/:id/fields','getFields','/:id/offline_messages','getOfflineMessages','/:id/users','post','create','addDisposition','diskStorage','join','root','server/files/images/logos/','format','%s-%s','now','originalname','/:id/logo','single','file','server/files/images/avatars/','addAvatar','/:id/customer_avatar','/:id/notify','notify','server/files','attachments','replace','extname','/:id/offline','any','offline','/:id/interactions','addApplications','/:id/proactive_actions','addAgents','put','delete','destroy','removeAnswers','removeAgents','exports','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment'];(function(_0x3d3842,_0x3965d6){var _0x580931=function(_0x1383bc){while(--_0x1383bc){_0x3d3842['push'](_0x3d3842['shift']());}};_0x580931(++_0x3965d6);}(_0x3c7b,0xd0));var _0xb3c7=function(_0xa6f525,_0x40e9ba){_0xa6f525=_0xa6f525-0x0;var _0x20c4b2=_0x3c7b[_0xa6f525];return _0x20c4b2;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0xb3c7('0x0'));var timeout=require(_0xb3c7('0x1'));var express=require(_0xb3c7('0x2'));var router=express[_0xb3c7('0x3')]();var fs_extra=require(_0xb3c7('0x4'));var auth=require(_0xb3c7('0x5'));var interaction=require(_0xb3c7('0x6'));var config=require(_0xb3c7('0x7'));var controller=require('./chatWebsite.controller');router[_0xb3c7('0x8')]('/',auth[_0xb3c7('0x9')](),controller[_0xb3c7('0xa')]);router[_0xb3c7('0x8')](_0xb3c7('0xb'),auth[_0xb3c7('0x9')](),controller[_0xb3c7('0xc')]);router[_0xb3c7('0x8')](_0xb3c7('0xd'),auth['isAuthenticated'](),controller[_0xb3c7('0xe')]);router['get'](_0xb3c7('0xf'),auth[_0xb3c7('0x9')](),controller[_0xb3c7('0x10')]);router[_0xb3c7('0x8')](_0xb3c7('0x11'),auth[_0xb3c7('0x9')](),controller[_0xb3c7('0x12')]);router[_0xb3c7('0x8')]('/:id/logo',controller[_0xb3c7('0x13')]);router[_0xb3c7('0x8')](_0xb3c7('0x14'),controller[_0xb3c7('0x15')]);router[_0xb3c7('0x8')]('/:id/customer_avatar',controller[_0xb3c7('0x16')]);router[_0xb3c7('0x8')](_0xb3c7('0x17'),controller[_0xb3c7('0x18')]);router[_0xb3c7('0x8')]('/:id/interactions',auth[_0xb3c7('0x9')](),controller[_0xb3c7('0x19')]);router['get'](_0xb3c7('0x1a'),controller[_0xb3c7('0x1b')]);router[_0xb3c7('0x8')](_0xb3c7('0x1c'),auth['isAuthenticated'](),controller[_0xb3c7('0x1d')]);router[_0xb3c7('0x8')]('/:id/proactive_actions',auth[_0xb3c7('0x9')](),controller[_0xb3c7('0x1e')]);router[_0xb3c7('0x8')](_0xb3c7('0x1f'),controller[_0xb3c7('0x20')]);router['get'](_0xb3c7('0x21'),auth[_0xb3c7('0x9')](),controller[_0xb3c7('0x22')]);router['get'](_0xb3c7('0x23'),auth['isAuthenticated'](),controller['getAgents']);router[_0xb3c7('0x24')]('/',auth[_0xb3c7('0x9')](),controller[_0xb3c7('0x25')]);router[_0xb3c7('0x24')](_0xb3c7('0xf'),auth['isAuthenticated'](),controller[_0xb3c7('0x26')]);router['post'](_0xb3c7('0x11'),auth[_0xb3c7('0x9')](),controller['addAnswer']);var upload=multer({'storage':multer[_0xb3c7('0x27')]({'destination':function(_0xb51210,_0x29db9b,_0x36d564){_0x36d564(null,path[_0xb3c7('0x28')](config[_0xb3c7('0x29')],_0xb3c7('0x2a')));},'filename':function(_0x4b27fe,_0x2dbaff,_0x16a5f9){_0x16a5f9(null,util[_0xb3c7('0x2b')](_0xb3c7('0x2c'),Date[_0xb3c7('0x2d')](),_0x2dbaff[_0xb3c7('0x2e')]));}})});router[_0xb3c7('0x24')](_0xb3c7('0x2f'),upload[_0xb3c7('0x30')](_0xb3c7('0x31')),controller['addLogo']);var upload=multer({'storage':multer[_0xb3c7('0x27')]({'destination':function(_0x33bacb,_0x1c9b81,_0x4da529){_0x4da529(null,path[_0xb3c7('0x28')](config['root'],_0xb3c7('0x32')));},'filename':function(_0x3d8490,_0x50430b,_0x3c9688){_0x3c9688(null,util['format'](_0xb3c7('0x2c'),Date[_0xb3c7('0x2d')](),_0x50430b[_0xb3c7('0x2e')]));}})});router[_0xb3c7('0x24')](_0xb3c7('0x14'),upload[_0xb3c7('0x30')](_0xb3c7('0x31')),controller[_0xb3c7('0x33')]);var upload=multer({'storage':multer[_0xb3c7('0x27')]({'destination':function(_0x151d76,_0x5af330,_0x140c37){_0x140c37(null,path[_0xb3c7('0x28')](config['root'],'server/files/images/avatars/'));},'filename':function(_0x1dd1fd,_0x4deb02,_0x553525){_0x553525(null,util[_0xb3c7('0x2b')](_0xb3c7('0x2c'),Date[_0xb3c7('0x2d')](),_0x4deb02[_0xb3c7('0x2e')]));}})});router[_0xb3c7('0x24')](_0xb3c7('0x34'),upload['single']('file'),controller['addCustomerAvatar']);var upload=multer({'storage':multer[_0xb3c7('0x27')]({'destination':function(_0x4118f0,_0x186a85,_0x221dd6){_0x221dd6(null,path[_0xb3c7('0x28')](config['root'],_0xb3c7('0x32')));},'filename':function(_0x202f0e,_0x38324c,_0x374215){_0x374215(null,util[_0xb3c7('0x2b')]('%s-%s',Date[_0xb3c7('0x2d')](),_0x38324c['originalname']));}})});router[_0xb3c7('0x24')](_0xb3c7('0x17'),upload['single'](_0xb3c7('0x31')),controller['addSystemAvatar']);router['post'](_0xb3c7('0x35'),controller[_0xb3c7('0x36')]);const offlineUploadMulter=multer({'storage':multer[_0xb3c7('0x27')]({'destination':function(_0x2e8c5e,_0x43b426,_0x318ce8){const _0x20d29e=path[_0xb3c7('0x28')](config[_0xb3c7('0x29')],_0xb3c7('0x37'),_0xb3c7('0x38'),'offline-chat');fs_extra['ensureDir'](_0x20d29e,function(){_0x318ce8(null,_0x20d29e);});},'filename':function(_0x561ebd,_0x181a2a,_0x15c382){const _0x1dbd27=_0x181a2a[_0xb3c7('0x2e')][_0xb3c7('0x39')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');const _0x1cc9d9=path[_0xb3c7('0x3a')](_0x1dbd27);const _0x5639f7=Date['now']()+'-'+_0x1dbd27[_0xb3c7('0x39')](_0x1cc9d9,'')+_0x1cc9d9;_0x15c382(null,_0x5639f7);}})});router['post'](_0xb3c7('0x3b'),offlineUploadMulter[_0xb3c7('0x3c')](),controller[_0xb3c7('0x3d')]);router['post'](_0xb3c7('0x3e'),auth[_0xb3c7('0x9')](),controller['addInteraction']);router[_0xb3c7('0x24')]('/:id/applications',auth['isAuthenticated'](),controller[_0xb3c7('0x3f')]);router[_0xb3c7('0x24')](_0xb3c7('0x40'),auth[_0xb3c7('0x9')](),controller['addProactiveActions']);router[_0xb3c7('0x24')]('/:id/users',auth[_0xb3c7('0x9')](),controller[_0xb3c7('0x41')]);router[_0xb3c7('0x42')](_0xb3c7('0xd'),auth[_0xb3c7('0x9')](),controller['update']);router[_0xb3c7('0x43')]('/:id',auth[_0xb3c7('0x9')](),controller[_0xb3c7('0x44')]);router['delete'](_0xb3c7('0xf'),auth['isAuthenticated'](),controller['removeDispositions']);router['delete']('/:id/canned_answers',auth['isAuthenticated'](),controller[_0xb3c7('0x45')]);router[_0xb3c7('0x43')]('/:id/users',auth[_0xb3c7('0x9')](),controller[_0xb3c7('0x46')]);module[_0xb3c7('0x47')]=router;
\ No newline at end of file
+var _0xe9ec=['diskStorage','join','root','server/files/images/logos/','%s-%s','now','originalname','single','file','server/files/images/avatars/','format','/:id/customer_avatar','addCustomerAvatar','/:id/system_avatar','addSystemAvatar','/:id/notify','notify','server/files','offline-chat','ensureDir','replace','extname','/:id/offline','any','offline','addProactiveActions','update','destroy','delete','removeDispositions','exports','util','path','connect-timeout','express','fs-extra','../../components/auth/service','./chatWebsite.controller','get','isAuthenticated','/describe','describe','/:id','/:id/dispositions','/:id/canned_answers','getAnswers','/:id/logo','getLogo','/:id/avatar','getAvatar','getCustomerAvatar','/:id/interactions','getInteractions','/:id/snippet','getSnippet','/:id/applications','getApplications','/:id/proactive_actions','getProactiveActions','/:id/fields','getOfflineMessages','/:id/users','getAgents','post','addDisposition'];(function(_0x58a975,_0x4f7451){var _0x47f055=function(_0x4f57e1){while(--_0x4f57e1){_0x58a975['push'](_0x58a975['shift']());}};_0x47f055(++_0x4f7451);}(_0xe9ec,0x1a5));var _0xce9e=function(_0x4565bf,_0x5ad9d6){_0x4565bf=_0x4565bf-0x0;var _0x5610ba=_0xe9ec[_0x4565bf];return _0x5610ba;};'use strict';var multer=require('multer');var util=require(_0xce9e('0x0'));var path=require(_0xce9e('0x1'));var timeout=require(_0xce9e('0x2'));var express=require(_0xce9e('0x3'));var router=express['Router']();var fs_extra=require(_0xce9e('0x4'));var auth=require(_0xce9e('0x5'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0xce9e('0x6'));router[_0xce9e('0x7')]('/',auth[_0xce9e('0x8')](),controller['index']);router['get'](_0xce9e('0x9'),auth[_0xce9e('0x8')](),controller[_0xce9e('0xa')]);router['get'](_0xce9e('0xb'),auth[_0xce9e('0x8')](),controller['show']);router[_0xce9e('0x7')](_0xce9e('0xc'),auth[_0xce9e('0x8')](),controller['getDispositions']);router[_0xce9e('0x7')](_0xce9e('0xd'),auth[_0xce9e('0x8')](),controller[_0xce9e('0xe')]);router[_0xce9e('0x7')](_0xce9e('0xf'),controller[_0xce9e('0x10')]);router[_0xce9e('0x7')](_0xce9e('0x11'),controller[_0xce9e('0x12')]);router[_0xce9e('0x7')]('/:id/customer_avatar',controller[_0xce9e('0x13')]);router[_0xce9e('0x7')]('/:id/system_avatar',controller['getSystemAvatar']);router['get'](_0xce9e('0x14'),auth[_0xce9e('0x8')](),controller[_0xce9e('0x15')]);router[_0xce9e('0x7')](_0xce9e('0x16'),controller[_0xce9e('0x17')]);router['get'](_0xce9e('0x18'),auth['isAuthenticated'](),controller[_0xce9e('0x19')]);router['get'](_0xce9e('0x1a'),auth[_0xce9e('0x8')](),controller[_0xce9e('0x1b')]);router[_0xce9e('0x7')](_0xce9e('0x1c'),controller['getFields']);router['get']('/:id/offline_messages',auth[_0xce9e('0x8')](),controller[_0xce9e('0x1d')]);router['get'](_0xce9e('0x1e'),auth[_0xce9e('0x8')](),controller[_0xce9e('0x1f')]);router[_0xce9e('0x20')]('/',auth[_0xce9e('0x8')](),controller['create']);router[_0xce9e('0x20')](_0xce9e('0xc'),auth['isAuthenticated'](),controller[_0xce9e('0x21')]);router[_0xce9e('0x20')]('/:id/canned_answers',auth['isAuthenticated'](),controller['addAnswer']);var upload=multer({'storage':multer[_0xce9e('0x22')]({'destination':function(_0xb81761,_0xd4f261,_0x247fef){_0x247fef(null,path[_0xce9e('0x23')](config[_0xce9e('0x24')],_0xce9e('0x25')));},'filename':function(_0x4f575b,_0x1cdb8e,_0x17427a){_0x17427a(null,util['format'](_0xce9e('0x26'),Date[_0xce9e('0x27')](),_0x1cdb8e[_0xce9e('0x28')]));}})});router[_0xce9e('0x20')](_0xce9e('0xf'),upload[_0xce9e('0x29')](_0xce9e('0x2a')),controller['addLogo']);var upload=multer({'storage':multer[_0xce9e('0x22')]({'destination':function(_0x3aa3a5,_0x415337,_0x523316){_0x523316(null,path[_0xce9e('0x23')](config['root'],_0xce9e('0x2b')));},'filename':function(_0x5d9b2b,_0xd9569,_0x1ab85d){_0x1ab85d(null,util[_0xce9e('0x2c')](_0xce9e('0x26'),Date[_0xce9e('0x27')](),_0xd9569[_0xce9e('0x28')]));}})});router['post'](_0xce9e('0x11'),upload['single']('file'),controller['addAvatar']);var upload=multer({'storage':multer[_0xce9e('0x22')]({'destination':function(_0x5e3f29,_0x234d17,_0x527a32){_0x527a32(null,path[_0xce9e('0x23')](config['root'],_0xce9e('0x2b')));},'filename':function(_0x51cc2f,_0x5091ce,_0xed6ca0){_0xed6ca0(null,util['format'](_0xce9e('0x26'),Date['now'](),_0x5091ce[_0xce9e('0x28')]));}})});router[_0xce9e('0x20')](_0xce9e('0x2d'),upload[_0xce9e('0x29')]('file'),controller[_0xce9e('0x2e')]);var upload=multer({'storage':multer[_0xce9e('0x22')]({'destination':function(_0x48fb92,_0x558da5,_0x4c45b0){_0x4c45b0(null,path[_0xce9e('0x23')](config['root'],_0xce9e('0x2b')));},'filename':function(_0x4aae17,_0x48c006,_0x51eff7){_0x51eff7(null,util[_0xce9e('0x2c')](_0xce9e('0x26'),Date[_0xce9e('0x27')](),_0x48c006[_0xce9e('0x28')]));}})});router[_0xce9e('0x20')](_0xce9e('0x2f'),upload[_0xce9e('0x29')]('file'),controller[_0xce9e('0x30')]);router[_0xce9e('0x20')](_0xce9e('0x31'),controller[_0xce9e('0x32')]);const offlineUploadMulter=multer({'storage':multer[_0xce9e('0x22')]({'destination':function(_0x523e83,_0x54596b,_0x5b872d){const _0x43cbe6=path[_0xce9e('0x23')](config['root'],_0xce9e('0x33'),'attachments',_0xce9e('0x34'));fs_extra[_0xce9e('0x35')](_0x43cbe6,function(){_0x5b872d(null,_0x43cbe6);});},'filename':function(_0x2c3107,_0x54912b,_0x57de0a){const _0x57e2bb=_0x54912b[_0xce9e('0x28')][_0xce9e('0x36')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');const _0x6e37d4=path[_0xce9e('0x37')](_0x57e2bb);const _0xc4635f=Date['now']()+'-'+_0x57e2bb[_0xce9e('0x36')](_0x6e37d4,'')+_0x6e37d4;_0x57de0a(null,_0xc4635f);}})});router[_0xce9e('0x20')](_0xce9e('0x38'),offlineUploadMulter[_0xce9e('0x39')](),controller[_0xce9e('0x3a')]);router['post']('/:id/interactions',auth['isAuthenticated'](),controller['addInteraction']);router[_0xce9e('0x20')]('/:id/applications',auth[_0xce9e('0x8')](),controller['addApplications']);router[_0xce9e('0x20')](_0xce9e('0x1a'),auth[_0xce9e('0x8')](),controller[_0xce9e('0x3b')]);router[_0xce9e('0x20')](_0xce9e('0x1e'),auth[_0xce9e('0x8')](),controller['addAgents']);router['put'](_0xce9e('0xb'),auth[_0xce9e('0x8')](),controller[_0xce9e('0x3c')]);router['delete'](_0xce9e('0xb'),auth[_0xce9e('0x8')](),controller[_0xce9e('0x3d')]);router[_0xce9e('0x3e')](_0xce9e('0xc'),auth[_0xce9e('0x8')](),controller[_0xce9e('0x3f')]);router[_0xce9e('0x3e')]('/:id/canned_answers',auth[_0xce9e('0x8')](),controller['removeAnswers']);router[_0xce9e('0x3e')](_0xce9e('0x1e'),auth[_0xce9e('0x8')](),controller['removeAgents']);module[_0xce9e('0x40')]=router;
\ No newline at end of file
diff --git a/server/api/client-side-logs.js b/server/api/client-side-logs.js
index db3aff0..27c6ff0 100644
--- a/server/api/client-side-logs.js
+++ b/server/api/client-side-logs.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x6b30=['get','client-side-logger','use','exports','express','../components/auth/service','../config/environment','Router','env','production','app'];(function(_0x100fb4,_0x3c05cc){var _0x213330=function(_0x5c70ae){while(--_0x5c70ae){_0x100fb4['push'](_0x100fb4['shift']());}};_0x213330(++_0x3c05cc);}(_0x6b30,0x185));var _0x06b3=function(_0x317d61,_0x5e6335){_0x317d61=_0x317d61-0x0;var _0x3abc20=_0x6b30[_0x317d61];return _0x3abc20;};var beaverLogger=require('beaver-logger/server');var express=require(_0x06b3('0x0'));var auth=require(_0x06b3('0x1'));var config=require(_0x06b3('0x2'));var router=express[_0x06b3('0x3')]();var isProduction=config[_0x06b3('0x4')]===_0x06b3('0x5')||![];function clientSideLogs(_0x69fdcc,_0xd850ad,_0x434a85){var _0x361712=_0x69fdcc[_0x06b3('0x6')][_0x06b3('0x7')](_0x06b3('0x8'));if(!_0x361712){throw new Error('Client-Side\x20logger\x20not\x20found!');}return beaverLogger['expressEndpoint']({'uri':'/client-logs','logger':_0x361712,'enableCors':!isProduction})(_0x69fdcc,_0xd850ad,_0x434a85);}router[_0x06b3('0x9')](auth['isAuthenticated'](),clientSideLogs);module[_0x06b3('0xa')]=router;
\ No newline at end of file
+var _0xaad4=['/client-logs','use','exports','express','../components/auth/service','../config/environment','env','app','get','client-side-logger','Client-Side\x20logger\x20not\x20found!'];(function(_0x43982a,_0x3119bf){var _0x1a2749=function(_0x44c76a){while(--_0x44c76a){_0x43982a['push'](_0x43982a['shift']());}};_0x1a2749(++_0x3119bf);}(_0xaad4,0x1c6));var _0x4aad=function(_0x122ef9,_0x451d2a){_0x122ef9=_0x122ef9-0x0;var _0x42fba0=_0xaad4[_0x122ef9];return _0x42fba0;};var beaverLogger=require('beaver-logger/server');var express=require(_0x4aad('0x0'));var auth=require(_0x4aad('0x1'));var config=require(_0x4aad('0x2'));var router=express['Router']();var isProduction=config[_0x4aad('0x3')]==='production'||![];function clientSideLogs(_0x200e98,_0x4106a7,_0x22f966){var _0x4aa20b=_0x200e98[_0x4aad('0x4')][_0x4aad('0x5')](_0x4aad('0x6'));if(!_0x4aa20b){throw new Error(_0x4aad('0x7'));}return beaverLogger['expressEndpoint']({'uri':_0x4aad('0x8'),'logger':_0x4aa20b,'enableCors':!isProduction})(_0x200e98,_0x4106a7,_0x22f966);}router[_0x4aad('0x9')](auth['isAuthenticated'](),clientSideLogs);module[_0x4aad('0xa')]=router;
\ No newline at end of file
diff --git a/server/api/cloudProvider/cloudProvider.attributes.js b/server/api/cloudProvider/cloudProvider.attributes.js
index 1e87c70..3bc75f7 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 _0x33a4=['MicrosoftAzure\x20=>\x20client_secret','MicrosoftAzure\x20=>\x20redirect_uri','TEXT','MicrosoftAzure\x20=>\x20access_token','MicrosoftAzure\x20=>\x20refresh_token','sequelize','exports','STRING','AmazonAWS','Google','MicrosoftAzure','ENUM','Outlook365','MicrosoftAzure\x20=>\x20client_id','MicrosoftAzure\x20=>\x20tenant'];(function(_0x3f3e0b,_0x548752){var _0x586fd0=function(_0x3cfcd1){while(--_0x3cfcd1){_0x3f3e0b['push'](_0x3f3e0b['shift']());}};_0x586fd0(++_0x548752);}(_0x33a4,0x122));var _0x433a=function(_0x3c3c9c,_0x2006e4){_0x3c3c9c=_0x3c3c9c-0x0;var _0x430ef5=_0x33a4[_0x3c3c9c];return _0x430ef5;};'use strict';var Sequelize=require(_0x433a('0x0'));module[_0x433a('0x1')]={'name':{'type':Sequelize[_0x433a('0x2')],'allowNull':![],'validate':{'notEmpty':!![]}},'service':{'type':Sequelize['ENUM'](_0x433a('0x3'),_0x433a('0x4'),_0x433a('0x5')),'allowNull':![],'validate':{'notEmpty':!![]}},'type':{'type':Sequelize[_0x433a('0x6')](_0x433a('0x7'),'Dynamics365')},'data1':{'type':Sequelize[_0x433a('0x2')],'comment':_0x433a('0x8')},'data2':{'type':Sequelize['STRING'],'comment':_0x433a('0x9')},'data3':{'type':Sequelize[_0x433a('0x2')],'comment':_0x433a('0xa')},'data4':{'type':Sequelize['STRING'],'comment':_0x433a('0xb')},'data5':{'type':Sequelize[_0x433a('0xc')],'comment':_0x433a('0xd')},'data6':{'type':Sequelize[_0x433a('0xc')],'comment':_0x433a('0xe')},'data7':{'type':Sequelize['TEXT'],'comment':'MicrosoftAzure\x20=>\x20Dynamics365\x20=>\x20remote_uri'}};
\ No newline at end of file
+var _0x5907=['MicrosoftAzure\x20=>\x20access_token','MicrosoftAzure\x20=>\x20Dynamics365\x20=>\x20remote_uri','sequelize','exports','ENUM','MicrosoftAzure','Outlook365','Dynamics365','STRING','MicrosoftAzure\x20=>\x20client_id','MicrosoftAzure\x20=>\x20tenant','MicrosoftAzure\x20=>\x20client_secret','MicrosoftAzure\x20=>\x20redirect_uri','TEXT'];(function(_0x5b78e8,_0x55096b){var _0xf2c321=function(_0x4e0cff){while(--_0x4e0cff){_0x5b78e8['push'](_0x5b78e8['shift']());}};_0xf2c321(++_0x55096b);}(_0x5907,0x80));var _0x7590=function(_0x87d05f,_0x330d3c){_0x87d05f=_0x87d05f-0x0;var _0x2e8a76=_0x5907[_0x87d05f];return _0x2e8a76;};'use strict';var Sequelize=require(_0x7590('0x0'));module[_0x7590('0x1')]={'name':{'type':Sequelize['STRING'],'allowNull':![],'validate':{'notEmpty':!![]}},'service':{'type':Sequelize[_0x7590('0x2')]('AmazonAWS','Google',_0x7590('0x3')),'allowNull':![],'validate':{'notEmpty':!![]}},'type':{'type':Sequelize['ENUM'](_0x7590('0x4'),_0x7590('0x5'))},'data1':{'type':Sequelize[_0x7590('0x6')],'comment':_0x7590('0x7')},'data2':{'type':Sequelize[_0x7590('0x6')],'comment':_0x7590('0x8')},'data3':{'type':Sequelize[_0x7590('0x6')],'comment':_0x7590('0x9')},'data4':{'type':Sequelize['STRING'],'comment':_0x7590('0xa')},'data5':{'type':Sequelize[_0x7590('0xb')],'comment':_0x7590('0xc')},'data6':{'type':Sequelize[_0x7590('0xb')],'comment':'MicrosoftAzure\x20=>\x20refresh_token'},'data7':{'type':Sequelize[_0x7590('0xb')],'comment':_0x7590('0xd')}};
\ No newline at end of file
diff --git a/server/api/cloudProvider/cloudProvider.controller.js b/server/api/cloudProvider/cloudProvider.controller.js
index ac23f60..e09da21 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 _0x85fc=['sort','where','filters','filter','merge','options','then','includeAll','rows','service','MicrosoftAzure','decryptString','data3','catch','show','params','include','create','body','Name\x20parameter\x20not\x20specified','includes','Invalid\x20service\x20parameter.\x20Allowed\x20values:\x20','join','encryptString','find','findOne','generateMicrosoftAuthorizationUrl','user','oauth2MicrosoftCallback','get','state','Invalid\x20state\x20parameter','base64','toString','ascii','parse','isValidIdToken','id_token','oauth2Claims','Unable\x20to\x20validate\x20id_token','del','getOauth2MicrosoftAccessToken','access_token','data5','startRefreshInterval','emit','microsoftAuthorization:success','microsoftAuthorization:error','Invalid\x20authentication\x20state\x20parameter','message','stringify','lodash','../../components/parsers/qs','../../components/encryptor','../../config/environment','../../config/logger','api','./cloudProvider.oauth','defaults','redis','socket.io-emitter','sendStatus','status','end','json','offset','limit','undefined','count','set','Content-Range','update','destroy','error','stack','name','send','padEnd','index','map','CloudProvider','rawAttributes','fieldName','type','model','query','keys','intersection','attributes','fields','hasOwnProperty','nolimit','order'];(function(_0x3c7dbe,_0x4165f5){var _0x35c777=function(_0x3b36fe){while(--_0x3b36fe){_0x3c7dbe['push'](_0x3c7dbe['shift']());}};_0x35c777(++_0x4165f5);}(_0x85fc,0xed));var _0xc85f=function(_0x15ca22,_0x3b1f91){_0x15ca22=_0x15ca22-0x0;var _0x509a9e=_0x85fc[_0x15ca22];return _0x509a9e;};'use strict';var _=require(_0xc85f('0x0'));var Redis=require('ioredis');var qs=require(_0xc85f('0x1'));var encryptor=require(_0xc85f('0x2'));var config=require(_0xc85f('0x3'));var logger=require(_0xc85f('0x4'))(_0xc85f('0x5'));var db=require('../../mysqldb')['db'];var oauth=require(_0xc85f('0x6'));config['redis']=_[_0xc85f('0x7')](config[_0xc85f('0x8')],{'host':'localhost','port':0x18eb});var socket=require(_0xc85f('0x9'))(new Redis(config[_0xc85f('0x8')]));var redis=new Redis(config[_0xc85f('0x8')]);function respondWithStatusCode(_0x1bc18a,_0x38ac10){_0x38ac10=_0x38ac10||0xcc;return function(_0x3922d4){if(_0x3922d4){return _0x1bc18a[_0xc85f('0xa')](_0x38ac10);}return _0x1bc18a[_0xc85f('0xb')](_0x38ac10)[_0xc85f('0xc')]();};}function respondWithResult(_0x30f438,_0x4f1f97){_0x4f1f97=_0x4f1f97||0xc8;return function(_0x214fd1){if(_0x214fd1){return _0x30f438[_0xc85f('0xb')](_0x4f1f97)[_0xc85f('0xd')](_0x214fd1);}};}function respondWithFilteredResult(_0x29999e,_0x555b9e){return function(_0x1ba2c5){if(_0x1ba2c5){var _0x324797=typeof _0x555b9e[_0xc85f('0xe')]==='undefined'&&typeof _0x555b9e[_0xc85f('0xf')]===_0xc85f('0x10');var _0x23b7d7=_0x1ba2c5[_0xc85f('0x11')];var _0x1e275f=_0x324797?0x0:_0x555b9e[_0xc85f('0xe')];var _0x424ba6=_0x324797?_0x1ba2c5[_0xc85f('0x11')]:_0x555b9e[_0xc85f('0xe')]+_0x555b9e[_0xc85f('0xf')];var _0x2c180f;if(_0x424ba6>=_0x23b7d7){_0x424ba6=_0x23b7d7;_0x2c180f=0xc8;}else{_0x2c180f=0xce;}_0x29999e[_0xc85f('0xb')](_0x2c180f);return _0x29999e[_0xc85f('0x12')](_0xc85f('0x13'),_0x1e275f+'-'+_0x424ba6+'/'+_0x23b7d7)[_0xc85f('0xd')](_0x1ba2c5);}return null;};}function saveUpdates(_0x48eea6){return function(_0x39a2d4){if(_0x39a2d4){return _0x39a2d4[_0xc85f('0x14')](_0x48eea6)['then'](function(_0x5b43e1){return _0x5b43e1;});}return null;};}function removeEntity(_0x58676b){return function(_0x538d70){if(_0x538d70){return _0x538d70[_0xc85f('0x15')]()['then'](function(){_0x58676b['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x2fb8b0){return function(_0x4ff639){if(!_0x4ff639){_0x2fb8b0[_0xc85f('0xa')](0x194);}return _0x4ff639;};}function handleError(_0x1908a0,_0x2b2a4a){_0x2b2a4a=_0x2b2a4a||0x1f4;return function(_0x5baf38){logger[_0xc85f('0x16')](_0x5baf38[_0xc85f('0x17')]);if(_0x5baf38['name']){delete _0x5baf38[_0xc85f('0x18')];}_0x1908a0['status'](_0x2b2a4a)[_0xc85f('0x19')](_0x5baf38);};}function maskClientSecret(_0x1e2d1f){return _[_0xc85f('0x1a')](_0x1e2d1f['slice'](0x0,0x3),0x14,'*');}exports[_0xc85f('0x1b')]=function(_0x170918,_0x340264){var _0x11bf69={},_0x380a98={},_0x2d2138={'count':0x0,'rows':[]};var _0x4997f8=_[_0xc85f('0x1c')](db[_0xc85f('0x1d')][_0xc85f('0x1e')],function(_0x257a3c){return{'name':_0x257a3c[_0xc85f('0x1f')],'type':_0x257a3c[_0xc85f('0x20')]['key']};});_0x380a98[_0xc85f('0x21')]=_[_0xc85f('0x1c')](_0x4997f8,'name');_0x380a98[_0xc85f('0x22')]=_[_0xc85f('0x23')](_0x170918[_0xc85f('0x22')]);_0x380a98['filters']=_[_0xc85f('0x24')](_0x380a98[_0xc85f('0x21')],_0x380a98[_0xc85f('0x22')]);_0x11bf69[_0xc85f('0x25')]=_[_0xc85f('0x24')](_0x380a98['model'],qs[_0xc85f('0x26')](_0x170918[_0xc85f('0x22')][_0xc85f('0x26')]));_0x11bf69[_0xc85f('0x25')]=_0x11bf69[_0xc85f('0x25')]['length']?_0x11bf69[_0xc85f('0x25')]:_0x380a98['model'];if(!_0x170918[_0xc85f('0x22')][_0xc85f('0x27')](_0xc85f('0x28'))){_0x11bf69[_0xc85f('0xf')]=qs[_0xc85f('0xf')](_0x170918[_0xc85f('0x22')]['limit']);_0x11bf69[_0xc85f('0xe')]=qs[_0xc85f('0xe')](_0x170918['query'][_0xc85f('0xe')]);}_0x11bf69[_0xc85f('0x29')]=qs[_0xc85f('0x2a')](_0x170918[_0xc85f('0x22')][_0xc85f('0x2a')]);_0x11bf69[_0xc85f('0x2b')]=qs['filters'](_['pick'](_0x170918['query'],_0x380a98[_0xc85f('0x2c')]),_0x4997f8);if(_0x170918[_0xc85f('0x22')][_0xc85f('0x2d')]){_0x11bf69['where']=_[_0xc85f('0x2e')](_0x11bf69[_0xc85f('0x2b')],{'$or':_[_0xc85f('0x1c')](_0x4997f8,function(_0x5e6893){if(_0x5e6893[_0xc85f('0x20')]!=='VIRTUAL'){var _0x3572c6={};_0x3572c6[_0x5e6893[_0xc85f('0x18')]]={'$like':'%'+_0x170918['query'][_0xc85f('0x2d')]+'%'};return _0x3572c6;}})});}_0x11bf69=_[_0xc85f('0x2e')]({},_0x11bf69,_0x170918[_0xc85f('0x2f')]);var _0x107079={'where':_0x11bf69[_0xc85f('0x2b')]};return db['CloudProvider'][_0xc85f('0x11')](_0x107079)[_0xc85f('0x30')](function(_0x3f0dc3){_0x2d2138['count']=_0x3f0dc3;if(_0x170918[_0xc85f('0x22')][_0xc85f('0x31')]){_0x11bf69['include']=[{'all':!![]}];}return db[_0xc85f('0x1d')]['findAll'](_0x11bf69);})[_0xc85f('0x30')](function(_0x5156e9){_0x2d2138[_0xc85f('0x32')]=_['map'](_0x5156e9,function(_0x277f00){if(_0x277f00[_0xc85f('0x33')]===_0xc85f('0x34')){var _0x1d5eae=encryptor[_0xc85f('0x35')](_0x277f00[_0xc85f('0x36')]);_0x277f00[_0xc85f('0x36')]=maskClientSecret(_0x1d5eae);}return _0x277f00;});return _0x2d2138;})[_0xc85f('0x30')](respondWithFilteredResult(_0x340264,_0x11bf69))[_0xc85f('0x37')](handleError(_0x340264,null));};exports[_0xc85f('0x38')]=function(_0x1c5b70,_0x18be68){var _0x400a49={'raw':!![],'where':{'id':_0x1c5b70[_0xc85f('0x39')]['id']}},_0x5ed8e6={};_0x5ed8e6[_0xc85f('0x21')]=_[_0xc85f('0x23')](db[_0xc85f('0x1d')]['rawAttributes']);_0x5ed8e6[_0xc85f('0x22')]=_[_0xc85f('0x23')](_0x1c5b70[_0xc85f('0x22')]);_0x5ed8e6[_0xc85f('0x2c')]=_['intersection'](_0x5ed8e6[_0xc85f('0x21')],_0x5ed8e6[_0xc85f('0x22')]);_0x400a49[_0xc85f('0x25')]=_[_0xc85f('0x24')](_0x5ed8e6[_0xc85f('0x21')],qs['fields'](_0x1c5b70[_0xc85f('0x22')]['fields']));_0x400a49[_0xc85f('0x25')]=_0x400a49[_0xc85f('0x25')]['length']?_0x400a49[_0xc85f('0x25')]:_0x5ed8e6[_0xc85f('0x21')];if(_0x1c5b70[_0xc85f('0x22')][_0xc85f('0x31')]){_0x400a49[_0xc85f('0x3a')]=[{'all':!![]}];}_0x400a49=_[_0xc85f('0x2e')]({},_0x400a49,_0x1c5b70[_0xc85f('0x2f')]);return db[_0xc85f('0x1d')]['find'](_0x400a49)['then'](handleEntityNotFound(_0x18be68,null))['then'](function(_0x2fe477){if(_0x2fe477['service']==='MicrosoftAzure'){var _0x4f9451=encryptor[_0xc85f('0x35')](_0x2fe477['data3']);_0x2fe477[_0xc85f('0x36')]=maskClientSecret(_0x4f9451);}return _0x2fe477;})[_0xc85f('0x30')](respondWithResult(_0x18be68,null))['catch'](handleError(_0x18be68,null));};exports[_0xc85f('0x3b')]=function(_0xad569,_0xb77b9){if(!_0xad569[_0xc85f('0x3c')][_0xc85f('0x18')])throw new Error(_0xc85f('0x3d'));if(!_0xad569[_0xc85f('0x3c')][_0xc85f('0x33')])throw new Error('Service\x20parameter\x20not\x20specified');var _0x53fc17=db[_0xc85f('0x1d')][_0xc85f('0x1e')][_0xc85f('0x33')]['values'];if(!_0x53fc17[_0xc85f('0x3e')](_0xad569[_0xc85f('0x3c')]['service']))throw new Error(_0xc85f('0x3f')+_0x53fc17[_0xc85f('0x40')](',\x20'));if(_0xad569[_0xc85f('0x3c')][_0xc85f('0x33')]===_0xc85f('0x34')&&_0xad569[_0xc85f('0x3c')][_0xc85f('0x36')]){_0xad569[_0xc85f('0x3c')]['data3']=encryptor[_0xc85f('0x41')](_0xad569['body']['data3']);}return db[_0xc85f('0x1d')]['create'](_0xad569['body'],{})[_0xc85f('0x30')](respondWithResult(_0xb77b9,0xc9))[_0xc85f('0x37')](handleError(_0xb77b9,null));};exports['update']=function(_0x38e54a,_0x53d785){if(_0x38e54a['body']['id']){delete _0x38e54a[_0xc85f('0x3c')]['id'];}return db['CloudProvider'][_0xc85f('0x42')]({'where':{'id':_0x38e54a[_0xc85f('0x39')]['id']}})[_0xc85f('0x30')](handleEntityNotFound(_0x53d785,null))[_0xc85f('0x30')](function(_0x71905){if(_0x71905[_0xc85f('0x33')]===_0xc85f('0x34')&&_0x38e54a[_0xc85f('0x3c')]['data3']){_0x38e54a[_0xc85f('0x3c')][_0xc85f('0x36')]=encryptor[_0xc85f('0x41')](_0x38e54a[_0xc85f('0x3c')]['data3']);}return _0x71905;})[_0xc85f('0x30')](saveUpdates(_0x38e54a[_0xc85f('0x3c')],null))[_0xc85f('0x30')](respondWithResult(_0x53d785,null))['catch'](handleError(_0x53d785,null));};exports[_0xc85f('0x15')]=function(_0x179a20,_0xe6eccc){return db[_0xc85f('0x1d')][_0xc85f('0x42')]({'where':{'id':_0x179a20['params']['id']}})[_0xc85f('0x30')](handleEntityNotFound(_0xe6eccc,null))[_0xc85f('0x30')](removeEntity(_0xe6eccc,null))['catch'](handleError(_0xe6eccc,null));};exports['oauth2MicrosoftAuthorize']=function(_0x861856,_0x56f54c){return db[_0xc85f('0x1d')][_0xc85f('0x43')]({'where':{'id':_0x861856[_0xc85f('0x39')]['id']},'raw':!![]})['then'](function(_0x31f098){if(!_0x31f098)return _0x56f54c['sendStatus'](0x194);return{'url':oauth[_0xc85f('0x44')](_0x31f098,_0x861856[_0xc85f('0x45')]['id'])};})['then'](respondWithResult(_0x56f54c,null))[_0xc85f('0x37')](handleError(_0x56f54c,null));};exports[_0xc85f('0x46')]=function(_0x8fa724,_0xd66854){var _0x44e9ae=_0x8fa724[_0xc85f('0x3c')];var _0x3fe861;var _0x77ba1d;if(_0x44e9ae['error'])throw _0x44e9ae;redis[_0xc85f('0x47')](_0x44e9ae[_0xc85f('0x48')])[_0xc85f('0x30')](function(_0x5c51c0){if(!_0x5c51c0)throw new Error(_0xc85f('0x49'));_0x3fe861=JSON['parse'](_0x5c51c0);var _0x44c111=Buffer['from'](_0x44e9ae[_0xc85f('0x48')],_0xc85f('0x4a'))[_0xc85f('0x4b')](_0xc85f('0x4c'));_0x77ba1d=JSON[_0xc85f('0x4d')](_0x44c111);if(!oauth[_0xc85f('0x4e')](_0x44e9ae[_0xc85f('0x4f')],_0x3fe861[_0xc85f('0x50')]))throw new Error(_0xc85f('0x51'));redis[_0xc85f('0x52')](_0x44e9ae[_0xc85f('0x48')]);return oauth[_0xc85f('0x53')](_0x44e9ae['code'],_0x3fe861);})[_0xc85f('0x30')](function(_0x2769d2){_0x3fe861['data5']=_0x2769d2[_0xc85f('0x54')];_0x3fe861['data6']=_0x2769d2['refresh_token'];return db[_0xc85f('0x1d')][_0xc85f('0x14')]({'data5':_0x3fe861[_0xc85f('0x55')],'data6':_0x3fe861['data6']},{'where':{'id':_0x3fe861['id']}});})[_0xc85f('0x30')](function(){oauth[_0xc85f('0x56')](_0x3fe861);socket[_0xc85f('0x57')](_0xc85f('0x58'),{'id':_0x77ba1d['id']});return;})[_0xc85f('0x30')](respondWithStatusCode(_0xd66854,null))[_0xc85f('0x37')](function(_0xd3c8ac){if(_0x77ba1d){socket[_0xc85f('0x57')](_0xc85f('0x59'),{'id':_0x77ba1d['id']});}if(!_0x3fe861){logger['error'](_0xc85f('0x5a'),_0xd3c8ac);return _0xd66854[_0xc85f('0xb')](0x1f4)[_0xc85f('0x19')](_0xd3c8ac[_0xc85f('0x5b')]);}logger[_0xc85f('0x16')]('Authentication\x20failed\x20for\x20cloud\x20provider\x20#%s,\x20err:%s',_0x3fe861['id'],JSON[_0xc85f('0x5c')](_0xd3c8ac));});};
\ No newline at end of file
+var _0xc4a3=['../../mysqldb','./cloudProvider.oauth','redis','defaults','socket.io-emitter','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','update','then','error','name','send','padEnd','slice','index','map','CloudProvider','rawAttributes','fieldName','type','key','model','query','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filters','pick','filter','merge','options','includeAll','include','findAll','rows','service','MicrosoftAzure','decryptString','data3','catch','show','params','keys','intersection','create','body','Name\x20parameter\x20not\x20specified','values','includes','Invalid\x20service\x20parameter.\x20Allowed\x20values:\x20','join','encryptString','find','destroy','oauth2MicrosoftAuthorize','findOne','generateMicrosoftAuthorizationUrl','user','get','state','Invalid\x20state\x20parameter','parse','from','ascii','isValidIdToken','id_token','oauth2Claims','del','getOauth2MicrosoftAccessToken','code','data5','access_token','data6','microsoftAuthorization:success','microsoftAuthorization:error','Invalid\x20authentication\x20state\x20parameter','message','Authentication\x20failed\x20for\x20cloud\x20provider\x20#%s,\x20err:%s','lodash','ioredis','../../components/encryptor','../../config/environment','../../config/logger','api'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0xc4a3,0x17e));var _0x3c4a=function(_0x3354d5,_0x203e02){_0x3354d5=_0x3354d5-0x0;var _0x35b6ae=_0xc4a3[_0x3354d5];return _0x35b6ae;};'use strict';var _=require(_0x3c4a('0x0'));var Redis=require(_0x3c4a('0x1'));var qs=require('../../components/parsers/qs');var encryptor=require(_0x3c4a('0x2'));var config=require(_0x3c4a('0x3'));var logger=require(_0x3c4a('0x4'))(_0x3c4a('0x5'));var db=require(_0x3c4a('0x6'))['db'];var oauth=require(_0x3c4a('0x7'));config[_0x3c4a('0x8')]=_[_0x3c4a('0x9')](config[_0x3c4a('0x8')],{'host':'localhost','port':0x18eb});var socket=require(_0x3c4a('0xa'))(new Redis(config['redis']));var redis=new Redis(config[_0x3c4a('0x8')]);function respondWithStatusCode(_0x2c33d4,_0x224167){_0x224167=_0x224167||0xcc;return function(_0x5065ce){if(_0x5065ce){return _0x2c33d4[_0x3c4a('0xb')](_0x224167);}return _0x2c33d4[_0x3c4a('0xc')](_0x224167)[_0x3c4a('0xd')]();};}function respondWithResult(_0xf8cf29,_0x18c04e){_0x18c04e=_0x18c04e||0xc8;return function(_0x13681e){if(_0x13681e){return _0xf8cf29['status'](_0x18c04e)[_0x3c4a('0xe')](_0x13681e);}};}function respondWithFilteredResult(_0x45ef87,_0x198e0f){return function(_0x2863d1){if(_0x2863d1){var _0x286ded=typeof _0x198e0f[_0x3c4a('0xf')]===_0x3c4a('0x10')&&typeof _0x198e0f[_0x3c4a('0x11')]===_0x3c4a('0x10');var _0x15087c=_0x2863d1['count'];var _0x5d1841=_0x286ded?0x0:_0x198e0f['offset'];var _0x132a16=_0x286ded?_0x2863d1[_0x3c4a('0x12')]:_0x198e0f[_0x3c4a('0xf')]+_0x198e0f[_0x3c4a('0x11')];var _0x109a2c;if(_0x132a16>=_0x15087c){_0x132a16=_0x15087c;_0x109a2c=0xc8;}else{_0x109a2c=0xce;}_0x45ef87[_0x3c4a('0xc')](_0x109a2c);return _0x45ef87[_0x3c4a('0x13')](_0x3c4a('0x14'),_0x5d1841+'-'+_0x132a16+'/'+_0x15087c)[_0x3c4a('0xe')](_0x2863d1);}return null;};}function saveUpdates(_0x5eb7f5){return function(_0x2e1a8c){if(_0x2e1a8c){return _0x2e1a8c[_0x3c4a('0x15')](_0x5eb7f5)[_0x3c4a('0x16')](function(_0x29e296){return _0x29e296;});}return null;};}function removeEntity(_0x53860c){return function(_0x42a7f5){if(_0x42a7f5){return _0x42a7f5['destroy']()[_0x3c4a('0x16')](function(){_0x53860c['status'](0xcc)[_0x3c4a('0xd')]();});}};}function handleEntityNotFound(_0x568cf0){return function(_0x21f2fc){if(!_0x21f2fc){_0x568cf0[_0x3c4a('0xb')](0x194);}return _0x21f2fc;};}function handleError(_0x3891b0,_0x4cb2f1){_0x4cb2f1=_0x4cb2f1||0x1f4;return function(_0x6e0767){logger[_0x3c4a('0x17')](_0x6e0767['stack']);if(_0x6e0767[_0x3c4a('0x18')]){delete _0x6e0767[_0x3c4a('0x18')];}_0x3891b0[_0x3c4a('0xc')](_0x4cb2f1)[_0x3c4a('0x19')](_0x6e0767);};}function maskClientSecret(_0x39bfe2){return _[_0x3c4a('0x1a')](_0x39bfe2[_0x3c4a('0x1b')](0x0,0x3),0x14,'*');}exports[_0x3c4a('0x1c')]=function(_0x1e50f3,_0x2efc0f){var _0x100580={},_0x1a8503={},_0x4150e5={'count':0x0,'rows':[]};var _0x4d485c=_[_0x3c4a('0x1d')](db[_0x3c4a('0x1e')][_0x3c4a('0x1f')],function(_0x5b955e){return{'name':_0x5b955e[_0x3c4a('0x20')],'type':_0x5b955e[_0x3c4a('0x21')][_0x3c4a('0x22')]};});_0x1a8503[_0x3c4a('0x23')]=_['map'](_0x4d485c,_0x3c4a('0x18'));_0x1a8503[_0x3c4a('0x24')]=_['keys'](_0x1e50f3['query']);_0x1a8503['filters']=_['intersection'](_0x1a8503['model'],_0x1a8503[_0x3c4a('0x24')]);_0x100580[_0x3c4a('0x25')]=_['intersection'](_0x1a8503['model'],qs[_0x3c4a('0x26')](_0x1e50f3['query'][_0x3c4a('0x26')]));_0x100580[_0x3c4a('0x25')]=_0x100580[_0x3c4a('0x25')][_0x3c4a('0x27')]?_0x100580['attributes']:_0x1a8503[_0x3c4a('0x23')];if(!_0x1e50f3[_0x3c4a('0x24')][_0x3c4a('0x28')](_0x3c4a('0x29'))){_0x100580[_0x3c4a('0x11')]=qs[_0x3c4a('0x11')](_0x1e50f3['query'][_0x3c4a('0x11')]);_0x100580['offset']=qs[_0x3c4a('0xf')](_0x1e50f3[_0x3c4a('0x24')][_0x3c4a('0xf')]);}_0x100580[_0x3c4a('0x2a')]=qs['sort'](_0x1e50f3[_0x3c4a('0x24')][_0x3c4a('0x2b')]);_0x100580[_0x3c4a('0x2c')]=qs[_0x3c4a('0x2d')](_[_0x3c4a('0x2e')](_0x1e50f3[_0x3c4a('0x24')],_0x1a8503[_0x3c4a('0x2d')]),_0x4d485c);if(_0x1e50f3[_0x3c4a('0x24')][_0x3c4a('0x2f')]){_0x100580[_0x3c4a('0x2c')]=_[_0x3c4a('0x30')](_0x100580[_0x3c4a('0x2c')],{'$or':_[_0x3c4a('0x1d')](_0x4d485c,function(_0x1b2d72){if(_0x1b2d72[_0x3c4a('0x21')]!=='VIRTUAL'){var _0x5ef0de={};_0x5ef0de[_0x1b2d72['name']]={'$like':'%'+_0x1e50f3[_0x3c4a('0x24')]['filter']+'%'};return _0x5ef0de;}})});}_0x100580=_[_0x3c4a('0x30')]({},_0x100580,_0x1e50f3[_0x3c4a('0x31')]);var _0x1c2d91={'where':_0x100580[_0x3c4a('0x2c')]};return db[_0x3c4a('0x1e')][_0x3c4a('0x12')](_0x1c2d91)['then'](function(_0x3c1fa7){_0x4150e5[_0x3c4a('0x12')]=_0x3c1fa7;if(_0x1e50f3[_0x3c4a('0x24')][_0x3c4a('0x32')]){_0x100580[_0x3c4a('0x33')]=[{'all':!![]}];}return db['CloudProvider'][_0x3c4a('0x34')](_0x100580);})[_0x3c4a('0x16')](function(_0x1d57a3){_0x4150e5[_0x3c4a('0x35')]=_[_0x3c4a('0x1d')](_0x1d57a3,function(_0x3dfc6e){if(_0x3dfc6e[_0x3c4a('0x36')]===_0x3c4a('0x37')){var _0x16d296=encryptor[_0x3c4a('0x38')](_0x3dfc6e[_0x3c4a('0x39')]);_0x3dfc6e['data3']=maskClientSecret(_0x16d296);}return _0x3dfc6e;});return _0x4150e5;})[_0x3c4a('0x16')](respondWithFilteredResult(_0x2efc0f,_0x100580))[_0x3c4a('0x3a')](handleError(_0x2efc0f,null));};exports[_0x3c4a('0x3b')]=function(_0x3d7007,_0x3a8e2f){var _0x189255={'raw':!![],'where':{'id':_0x3d7007[_0x3c4a('0x3c')]['id']}},_0x435377={};_0x435377['model']=_[_0x3c4a('0x3d')](db[_0x3c4a('0x1e')][_0x3c4a('0x1f')]);_0x435377[_0x3c4a('0x24')]=_[_0x3c4a('0x3d')](_0x3d7007[_0x3c4a('0x24')]);_0x435377[_0x3c4a('0x2d')]=_['intersection'](_0x435377[_0x3c4a('0x23')],_0x435377[_0x3c4a('0x24')]);_0x189255['attributes']=_[_0x3c4a('0x3e')](_0x435377['model'],qs[_0x3c4a('0x26')](_0x3d7007['query'][_0x3c4a('0x26')]));_0x189255[_0x3c4a('0x25')]=_0x189255['attributes'][_0x3c4a('0x27')]?_0x189255[_0x3c4a('0x25')]:_0x435377[_0x3c4a('0x23')];if(_0x3d7007[_0x3c4a('0x24')][_0x3c4a('0x32')]){_0x189255[_0x3c4a('0x33')]=[{'all':!![]}];}_0x189255=_[_0x3c4a('0x30')]({},_0x189255,_0x3d7007[_0x3c4a('0x31')]);return db[_0x3c4a('0x1e')]['find'](_0x189255)['then'](handleEntityNotFound(_0x3a8e2f,null))[_0x3c4a('0x16')](function(_0x280ecc){if(_0x280ecc[_0x3c4a('0x36')]==='MicrosoftAzure'){var _0x4c845e=encryptor[_0x3c4a('0x38')](_0x280ecc[_0x3c4a('0x39')]);_0x280ecc[_0x3c4a('0x39')]=maskClientSecret(_0x4c845e);}return _0x280ecc;})[_0x3c4a('0x16')](respondWithResult(_0x3a8e2f,null))[_0x3c4a('0x3a')](handleError(_0x3a8e2f,null));};exports[_0x3c4a('0x3f')]=function(_0x115871,_0x3f830d){if(!_0x115871[_0x3c4a('0x40')][_0x3c4a('0x18')])throw new Error(_0x3c4a('0x41'));if(!_0x115871[_0x3c4a('0x40')][_0x3c4a('0x36')])throw new Error('Service\x20parameter\x20not\x20specified');var _0x310b0f=db[_0x3c4a('0x1e')][_0x3c4a('0x1f')][_0x3c4a('0x36')][_0x3c4a('0x42')];if(!_0x310b0f[_0x3c4a('0x43')](_0x115871[_0x3c4a('0x40')][_0x3c4a('0x36')]))throw new Error(_0x3c4a('0x44')+_0x310b0f[_0x3c4a('0x45')](',\x20'));if(_0x115871[_0x3c4a('0x40')][_0x3c4a('0x36')]===_0x3c4a('0x37')&&_0x115871[_0x3c4a('0x40')]['data3']){_0x115871[_0x3c4a('0x40')][_0x3c4a('0x39')]=encryptor[_0x3c4a('0x46')](_0x115871[_0x3c4a('0x40')][_0x3c4a('0x39')]);}return db[_0x3c4a('0x1e')][_0x3c4a('0x3f')](_0x115871['body'],{})[_0x3c4a('0x16')](respondWithResult(_0x3f830d,0xc9))[_0x3c4a('0x3a')](handleError(_0x3f830d,null));};exports[_0x3c4a('0x15')]=function(_0x1743d2,_0x45ffe7){if(_0x1743d2[_0x3c4a('0x40')]['id']){delete _0x1743d2[_0x3c4a('0x40')]['id'];}return db[_0x3c4a('0x1e')][_0x3c4a('0x47')]({'where':{'id':_0x1743d2['params']['id']}})[_0x3c4a('0x16')](handleEntityNotFound(_0x45ffe7,null))['then'](function(_0x2fac1f){if(_0x2fac1f[_0x3c4a('0x36')]===_0x3c4a('0x37')&&_0x1743d2[_0x3c4a('0x40')][_0x3c4a('0x39')]){_0x1743d2[_0x3c4a('0x40')]['data3']=encryptor[_0x3c4a('0x46')](_0x1743d2[_0x3c4a('0x40')]['data3']);}return _0x2fac1f;})[_0x3c4a('0x16')](saveUpdates(_0x1743d2[_0x3c4a('0x40')],null))['then'](respondWithResult(_0x45ffe7,null))['catch'](handleError(_0x45ffe7,null));};exports[_0x3c4a('0x48')]=function(_0x138cad,_0x2c94e2){return db[_0x3c4a('0x1e')]['find']({'where':{'id':_0x138cad[_0x3c4a('0x3c')]['id']}})[_0x3c4a('0x16')](handleEntityNotFound(_0x2c94e2,null))[_0x3c4a('0x16')](removeEntity(_0x2c94e2,null))[_0x3c4a('0x3a')](handleError(_0x2c94e2,null));};exports[_0x3c4a('0x49')]=function(_0x4e4cd7,_0x861350){return db[_0x3c4a('0x1e')][_0x3c4a('0x4a')]({'where':{'id':_0x4e4cd7['params']['id']},'raw':!![]})[_0x3c4a('0x16')](function(_0x3af019){if(!_0x3af019)return _0x861350[_0x3c4a('0xb')](0x194);return{'url':oauth[_0x3c4a('0x4b')](_0x3af019,_0x4e4cd7[_0x3c4a('0x4c')]['id'])};})[_0x3c4a('0x16')](respondWithResult(_0x861350,null))[_0x3c4a('0x3a')](handleError(_0x861350,null));};exports['oauth2MicrosoftCallback']=function(_0x4f4d27,_0x24c1c3){var _0x53562e=_0x4f4d27[_0x3c4a('0x40')];var _0x27cf13;var _0x41f029;if(_0x53562e['error'])throw _0x53562e;redis[_0x3c4a('0x4d')](_0x53562e[_0x3c4a('0x4e')])[_0x3c4a('0x16')](function(_0x356528){if(!_0x356528)throw new Error(_0x3c4a('0x4f'));_0x27cf13=JSON[_0x3c4a('0x50')](_0x356528);var _0x2e0b6b=Buffer[_0x3c4a('0x51')](_0x53562e['state'],'base64')['toString'](_0x3c4a('0x52'));_0x41f029=JSON[_0x3c4a('0x50')](_0x2e0b6b);if(!oauth[_0x3c4a('0x53')](_0x53562e[_0x3c4a('0x54')],_0x27cf13[_0x3c4a('0x55')]))throw new Error('Unable\x20to\x20validate\x20id_token');redis[_0x3c4a('0x56')](_0x53562e['state']);return oauth[_0x3c4a('0x57')](_0x53562e[_0x3c4a('0x58')],_0x27cf13);})[_0x3c4a('0x16')](function(_0x3ace28){_0x27cf13[_0x3c4a('0x59')]=_0x3ace28[_0x3c4a('0x5a')];_0x27cf13['data6']=_0x3ace28['refresh_token'];return db[_0x3c4a('0x1e')][_0x3c4a('0x15')]({'data5':_0x27cf13['data5'],'data6':_0x27cf13[_0x3c4a('0x5b')]},{'where':{'id':_0x27cf13['id']}});})['then'](function(){oauth['startRefreshInterval'](_0x27cf13);socket['emit'](_0x3c4a('0x5c'),{'id':_0x41f029['id']});return;})['then'](respondWithStatusCode(_0x24c1c3,null))[_0x3c4a('0x3a')](function(_0x45b091){if(_0x41f029){socket['emit'](_0x3c4a('0x5d'),{'id':_0x41f029['id']});}if(!_0x27cf13){logger['error'](_0x3c4a('0x5e'),_0x45b091);return _0x24c1c3['status'](0x1f4)[_0x3c4a('0x19')](_0x45b091[_0x3c4a('0x5f')]);}logger[_0x3c4a('0x17')](_0x3c4a('0x60'),_0x27cf13['id'],JSON['stringify'](_0x45b091));});};
\ No newline at end of file
diff --git a/server/api/cloudProvider/cloudProvider.model.js b/server/api/cloudProvider/cloudProvider.model.js
index 7f1acbc..b267690 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 _0x9b15=['./cloudProvider.attributes','CloudProvider','util','../../config/logger','api','request-promise','rimraf','../../config/environment'];(function(_0x131bd5,_0x5d00f2){var _0x114594=function(_0x5e5a5e){while(--_0x5e5a5e){_0x131bd5['push'](_0x131bd5['shift']());}};_0x114594(++_0x5d00f2);}(_0x9b15,0x142));var _0x59b1=function(_0x12cb4a,_0x4c27a3){_0x12cb4a=_0x12cb4a-0x0;var _0x2afd0b=_0x9b15[_0x12cb4a];return _0x2afd0b;};'use strict';var _=require('lodash');var util=require(_0x59b1('0x0'));var logger=require(_0x59b1('0x1'))(_0x59b1('0x2'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x59b1('0x3'));var fs=require('fs');var path=require('path');var rimraf=require(_0x59b1('0x4'));var config=require(_0x59b1('0x5'));var attributes=require(_0x59b1('0x6'));module['exports']=function(_0x57b909,_0x33c49d){return _0x57b909['define'](_0x59b1('0x7'),attributes,{'tableName':'cloud_providers','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x1a2f=['CloudProvider','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./cloudProvider.attributes','exports'];(function(_0x4cfd75,_0x19e48a){var _0x33bf80=function(_0x43dee1){while(--_0x43dee1){_0x4cfd75['push'](_0x4cfd75['shift']());}};_0x33bf80(++_0x19e48a);}(_0x1a2f,0x187));var _0xf1a2=function(_0x3cad46,_0xe591cc){_0x3cad46=_0x3cad46-0x0;var _0x35252b=_0x1a2f[_0x3cad46];return _0x35252b;};'use strict';var _=require(_0xf1a2('0x0'));var util=require(_0xf1a2('0x1'));var logger=require(_0xf1a2('0x2'))(_0xf1a2('0x3'));var moment=require(_0xf1a2('0x4'));var BPromise=require(_0xf1a2('0x5'));var rp=require(_0xf1a2('0x6'));var fs=require('fs');var path=require(_0xf1a2('0x7'));var rimraf=require(_0xf1a2('0x8'));var config=require(_0xf1a2('0x9'));var attributes=require(_0xf1a2('0xa'));module[_0xf1a2('0xb')]=function(_0x4fcdef,_0x2c798a){return _0x4fcdef['define'](_0xf1a2('0xc'),attributes,{'tableName':'cloud_providers','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
diff --git a/server/api/cloudProvider/cloudProvider.oauth.js b/server/api/cloudProvider/cloudProvider.oauth.js
index 96fd21c..ac1fb81 100644
--- a/server/api/cloudProvider/cloudProvider.oauth.js
+++ b/server/api/cloudProvider/cloudProvider.oauth.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x15f5=['catch','[CLOUD_PROVIDER]\x20Error\x20while\x20refreshing\x20the\x20tokens\x20after\x20service\x20restart\x20error:%s','exports','lodash','crypto','jsonwebtoken','moment','ioredis','request-promise','util','../../config/logger','../../config/schedule/cloud-provider','redis','defaults','localhost','openid','email','https://outlook.office365.com/IMAP.AccessAsUser.All','https://outlook.office.com/POP.AccessAsUser.All','https://outlook.office.com/SMTP.Send','offline_access','/token','type','push','data7','/.default','join','Outlook365','code','id_token','from','stringify','toString','base64','hex','client_id','data1','response_type','redirect_uri','data4','form_post','scope','state','nonce','login','map','key','value','oauth2Claims','replace','set','decode','issuer','aud','audience','isAfter','exp','CloudProvider','findOne','refresh_token','data6','decryptString','data3','POST','{TENANT_ID}','data2','data5','access_token','update','then','error','Failed\x20to\x20refresh\x20access\x20token\x20for\x20cloud\x20provider\x20#%s,\x20-\x20err:%s','authorization_code','intervals','bind','findAll','all'];(function(_0x460b5f,_0xc9f616){var _0x34df7f=function(_0x597641){while(--_0x597641){_0x460b5f['push'](_0x460b5f['shift']());}};_0x34df7f(++_0xc9f616);}(_0x15f5,0xea));var _0x515f=function(_0x3e8519,_0x926890){_0x3e8519=_0x3e8519-0x0;var _0x555b00=_0x15f5[_0x3e8519];return _0x555b00;};'use strict';var _=require(_0x515f('0x0'));var crypto=require(_0x515f('0x1'));var jwt=require(_0x515f('0x2'));var moment=require(_0x515f('0x3'));var Redis=require(_0x515f('0x4'));var rp=require(_0x515f('0x5'));var util=require(_0x515f('0x6'));var encryptor=require('../../components/encryptor');var config=require('../../config/environment');var logger=require(_0x515f('0x7'))('api');var schedule=require(_0x515f('0x8'));var db=require('../../mysqldb')['db'];config[_0x515f('0x9')]=_[_0x515f('0xa')](config['redis'],{'host':_0x515f('0xb'),'port':0x18eb});var redis=new Redis(config['redis']);var MICROSOFT_AUTH_URL='https://login.microsoftonline.com/{TENANT_ID}/oauth2/v2.0';var AZURE_AUTH_SCOPES={'Outlook365':[_0x515f('0xc'),'profile',_0x515f('0xd'),'offline_access',_0x515f('0xe'),_0x515f('0xf'),_0x515f('0x10')],'Dynamics365':[_0x515f('0xc'),_0x515f('0x11')]};var MICROSOFT_AUTH_ENDPOINT='/authorize';var MICROSOFT_TOKEN_ENDPOINT=_0x515f('0x12');var OAUTH_REFRESH_INTERVAL=0xfa;function getAuthorizationScopes(_0x5d9c42){var _0x8f52e5=_['map'](AZURE_AUTH_SCOPES[_0x5d9c42['type']]);if(_0x5d9c42[_0x515f('0x13')]==='Dynamics365')_0x8f52e5[_0x515f('0x14')](_0x5d9c42[_0x515f('0x15')]+_0x515f('0x16'));return _0x8f52e5[_0x515f('0x17')]('\x20');}function getAccessTokenScope(_0xef018e){if(_0xef018e[_0x515f('0x13')]===_0x515f('0x18'))return'https://outlook.office365.com/IMAP.AccessAsUser.All';if(_0xef018e[_0x515f('0x13')]==='Dynamics365')return _0xef018e[_0x515f('0x15')]+_0x515f('0x16');}function generateMicrosoftAuthorizationUrl(_0x420926,_0x54ef2e){var _0x30e275=MICROSOFT_AUTH_URL['replace']('{TENANT_ID}',_0x420926['data2']);var _0x4e38df=[_0x515f('0x19'),_0x515f('0x1a')];var _0x444f1e=Buffer[_0x515f('0x1b')](JSON[_0x515f('0x1c')]({'id':_0x54ef2e}))[_0x515f('0x1d')](_0x515f('0x1e'));var _0x7d0cdf=crypto['randomBytes'](0x10)[_0x515f('0x1d')](_0x515f('0x1f'));var _0x14a20d=getAuthorizationScopes(_0x420926);var _0x5387f5=[{'key':_0x515f('0x20'),'value':_0x420926[_0x515f('0x21')]},{'key':_0x515f('0x22'),'value':encodeURIComponent(_0x4e38df[_0x515f('0x17')]('\x20'))},{'key':_0x515f('0x23'),'value':_0x420926[_0x515f('0x24')]},{'key':'response_mode','value':_0x515f('0x25')},{'key':_0x515f('0x26'),'value':encodeURIComponent(_0x14a20d)},{'key':_0x515f('0x27'),'value':_0x444f1e},{'key':_0x515f('0x28'),'value':_0x7d0cdf},{'key':'prompt','value':_0x515f('0x29')}];var _0x36fed5=_0x30e275+MICROSOFT_AUTH_ENDPOINT+'?'+_[_0x515f('0x2a')](_0x5387f5,function(_0x3cc0c0){return _0x3cc0c0[_0x515f('0x2b')]+'='+_0x3cc0c0[_0x515f('0x2c')];})['join']('&');_0x420926[_0x515f('0x2d')]={'issuer':_0x30e275[_0x515f('0x2e')]('oauth2/',''),'audience':_0x420926[_0x515f('0x21')],'state':_0x444f1e,'nonce':_0x7d0cdf};redis[_0x515f('0x2f')](_0x444f1e,JSON[_0x515f('0x1c')](_0x420926));return _0x36fed5;}function isValidIdToken(_0x2f3ed3,_0x48c58a){try{var _0x3071ce=jwt[_0x515f('0x30')](_0x2f3ed3,{'complete':!![]});var _0x54eb63=_0x3071ce['payload'];if(_0x54eb63['iss']!==_0x48c58a[_0x515f('0x31')])return![];if(_0x54eb63[_0x515f('0x32')]!==_0x48c58a[_0x515f('0x33')])return![];if(_0x54eb63[_0x515f('0x28')]!==_0x48c58a[_0x515f('0x28')])return![];if(moment()[_0x515f('0x34')](moment['unix'](_0x54eb63[_0x515f('0x35')])))return![];return!![];}catch(_0x44b1e8){throw _0x44b1e8;}}function refreshOauth2MicrosoftAccessToken(_0x51e50a){return Promise['resolve']()['then'](function(){if(_0x51e50a['data3'])return _0x51e50a;return db[_0x515f('0x36')][_0x515f('0x37')]({'where':{'id':_0x51e50a['id']},'raw':!![]});})['then'](function(_0x211d7b){var _0x442ef2={'grant_type':_0x515f('0x38'),'refresh_token':_0x211d7b[_0x515f('0x39')],'scope':getAccessTokenScope(_0x211d7b),'redirect_uri':_0x211d7b['data4'],'client_id':_0x211d7b[_0x515f('0x21')],'client_secret':encryptor[_0x515f('0x3a')](_0x211d7b[_0x515f('0x3b')])};var _0x4d2c22={'method':_0x515f('0x3c'),'uri':MICROSOFT_AUTH_URL['replace'](_0x515f('0x3d'),_0x211d7b[_0x515f('0x3e')])+MICROSOFT_TOKEN_ENDPOINT,'form':_0x442ef2,'json':!![]};return rp(_0x4d2c22);})['then'](function(_0x5721e5){_0x51e50a[_0x515f('0x3f')]=_0x5721e5[_0x515f('0x40')];_0x51e50a['data6']=_0x5721e5['refresh_token'];return db[_0x515f('0x36')][_0x515f('0x41')]({'data5':_0x51e50a[_0x515f('0x3f')],'data6':_0x51e50a['data6']},{'where':{'id':_0x51e50a['id']}});})[_0x515f('0x42')](function(){return _0x51e50a;})['catch'](function(_0xc15114){logger[_0x515f('0x43')](_0x515f('0x44'),_0x51e50a['id'],_0xc15114);});}function getOauth2MicrosoftAccessToken(_0xfccba6,_0xd77dbe){var _0x3eeedc={'grant_type':_0x515f('0x45'),'code':_0xfccba6,'scope':getAccessTokenScope(_0xd77dbe),'redirect_uri':_0xd77dbe[_0x515f('0x24')],'client_id':_0xd77dbe[_0x515f('0x21')],'client_secret':encryptor[_0x515f('0x3a')](_0xd77dbe['data3'])};var _0x143074={'method':_0x515f('0x3c'),'uri':MICROSOFT_AUTH_URL['replace']('{TENANT_ID}',_0xd77dbe[_0x515f('0x3e')])+MICROSOFT_TOKEN_ENDPOINT,'form':_0x3eeedc,'json':!![]};return rp(_0x143074);}function startRefreshInterval(_0x487f1e){var _0x41994f=schedule[_0x515f('0x46')];if(_0x41994f[_0x487f1e['id']])clearInterval(_0x41994f[_0x487f1e['id']]);_0x41994f[_0x487f1e['id']]=setInterval(refreshOauth2MicrosoftAccessToken[_0x515f('0x47')](this,{'id':_0x487f1e['id']}),OAUTH_REFRESH_INTERVAL*0x3e8);schedule[_0x515f('0x46')]=_0x41994f;}function startAllRefreshIntervals(){return db[_0x515f('0x36')][_0x515f('0x48')]({'where':{'data6':{'$ne':null}},'raw':!![]})[_0x515f('0x42')](function(_0x5903de){var _0x3de90b=_0x5903de['map'](function(_0x431615){return refreshOauth2MicrosoftAccessToken(_0x431615)[_0x515f('0x42')](function(_0x4fbf06){startRefreshInterval(_0x4fbf06);});});return Promise[_0x515f('0x49')](_0x3de90b);})[_0x515f('0x4a')](function(_0x23aa8b){var _0x5ee607=_0x23aa8b?util['inspect'](_0x23aa8b,{'showHidden':![],'depth':null}):'';logger[_0x515f('0x43')](_0x515f('0x4b'),_0x5ee607);});}module[_0x515f('0x4c')]={'generateMicrosoftAuthorizationUrl':generateMicrosoftAuthorizationUrl,'getOauth2MicrosoftAccessToken':getOauth2MicrosoftAccessToken,'isValidIdToken':isValidIdToken,'startAllRefreshIntervals':startAllRefreshIntervals,'refreshOauth2MicrosoftAccessToken':refreshOauth2MicrosoftAccessToken,'startRefreshInterval':startRefreshInterval};
\ No newline at end of file
+var _0xecab=['response_type','redirect_uri','data4','response_mode','form_post','scope','state','login','value','oauth2Claims','oauth2/','set','decode','payload','iss','issuer','aud','nonce','isAfter','unix','then','data3','findOne','data6','decryptString','data5','access_token','refresh_token','CloudProvider','update','error','authorization_code','intervals','bind','all','catch','inspect','[CLOUD_PROVIDER]\x20Error\x20while\x20refreshing\x20the\x20tokens\x20after\x20service\x20restart\x20error:%s','jsonwebtoken','moment','ioredis','util','../../components/encryptor','../../config/environment','../../config/logger','api','../../config/schedule/cloud-provider','../../mysqldb','redis','defaults','localhost','https://login.microsoftonline.com/{TENANT_ID}/oauth2/v2.0','openid','profile','email','offline_access','https://outlook.office.com/POP.AccessAsUser.All','https://outlook.office.com/SMTP.Send','/authorize','/token','type','Dynamics365','push','data7','join','Outlook365','https://outlook.office365.com/IMAP.AccessAsUser.All','/.default','replace','{TENANT_ID}','data2','code','stringify','base64','randomBytes','toString','hex','data1'];(function(_0x1f146c,_0xfb86d6){var _0x2354fb=function(_0x2078d0){while(--_0x2078d0){_0x1f146c['push'](_0x1f146c['shift']());}};_0x2354fb(++_0xfb86d6);}(_0xecab,0x1ac));var _0xbeca=function(_0x5e1a4e,_0xd52259){_0x5e1a4e=_0x5e1a4e-0x0;var _0x4d11f3=_0xecab[_0x5e1a4e];return _0x4d11f3;};'use strict';var _=require('lodash');var crypto=require('crypto');var jwt=require(_0xbeca('0x0'));var moment=require(_0xbeca('0x1'));var Redis=require(_0xbeca('0x2'));var rp=require('request-promise');var util=require(_0xbeca('0x3'));var encryptor=require(_0xbeca('0x4'));var config=require(_0xbeca('0x5'));var logger=require(_0xbeca('0x6'))(_0xbeca('0x7'));var schedule=require(_0xbeca('0x8'));var db=require(_0xbeca('0x9'))['db'];config[_0xbeca('0xa')]=_[_0xbeca('0xb')](config['redis'],{'host':_0xbeca('0xc'),'port':0x18eb});var redis=new Redis(config[_0xbeca('0xa')]);var MICROSOFT_AUTH_URL=_0xbeca('0xd');var AZURE_AUTH_SCOPES={'Outlook365':[_0xbeca('0xe'),_0xbeca('0xf'),_0xbeca('0x10'),_0xbeca('0x11'),'https://outlook.office365.com/IMAP.AccessAsUser.All',_0xbeca('0x12'),_0xbeca('0x13')],'Dynamics365':[_0xbeca('0xe'),'offline_access']};var MICROSOFT_AUTH_ENDPOINT=_0xbeca('0x14');var MICROSOFT_TOKEN_ENDPOINT=_0xbeca('0x15');var OAUTH_REFRESH_INTERVAL=0xfa;function getAuthorizationScopes(_0x3f30dc){var _0x3b6c1c=_['map'](AZURE_AUTH_SCOPES[_0x3f30dc[_0xbeca('0x16')]]);if(_0x3f30dc[_0xbeca('0x16')]===_0xbeca('0x17'))_0x3b6c1c[_0xbeca('0x18')](_0x3f30dc[_0xbeca('0x19')]+'/.default');return _0x3b6c1c[_0xbeca('0x1a')]('\x20');}function getAccessTokenScope(_0x38da30){if(_0x38da30['type']===_0xbeca('0x1b'))return _0xbeca('0x1c');if(_0x38da30[_0xbeca('0x16')]===_0xbeca('0x17'))return _0x38da30['data7']+_0xbeca('0x1d');}function generateMicrosoftAuthorizationUrl(_0x1fd535,_0x53af66){var _0x56d2a1=MICROSOFT_AUTH_URL[_0xbeca('0x1e')](_0xbeca('0x1f'),_0x1fd535[_0xbeca('0x20')]);var _0x50a747=[_0xbeca('0x21'),'id_token'];var _0x4d40b5=Buffer['from'](JSON[_0xbeca('0x22')]({'id':_0x53af66}))['toString'](_0xbeca('0x23'));var _0x34250a=crypto[_0xbeca('0x24')](0x10)[_0xbeca('0x25')](_0xbeca('0x26'));var _0x58f248=getAuthorizationScopes(_0x1fd535);var _0x2ae462=[{'key':'client_id','value':_0x1fd535[_0xbeca('0x27')]},{'key':_0xbeca('0x28'),'value':encodeURIComponent(_0x50a747['join']('\x20'))},{'key':_0xbeca('0x29'),'value':_0x1fd535[_0xbeca('0x2a')]},{'key':_0xbeca('0x2b'),'value':_0xbeca('0x2c')},{'key':_0xbeca('0x2d'),'value':encodeURIComponent(_0x58f248)},{'key':_0xbeca('0x2e'),'value':_0x4d40b5},{'key':'nonce','value':_0x34250a},{'key':'prompt','value':_0xbeca('0x2f')}];var _0x392298=_0x56d2a1+MICROSOFT_AUTH_ENDPOINT+'?'+_['map'](_0x2ae462,function(_0x49204e){return _0x49204e['key']+'='+_0x49204e[_0xbeca('0x30')];})[_0xbeca('0x1a')]('&');_0x1fd535[_0xbeca('0x31')]={'issuer':_0x56d2a1['replace'](_0xbeca('0x32'),''),'audience':_0x1fd535[_0xbeca('0x27')],'state':_0x4d40b5,'nonce':_0x34250a};redis[_0xbeca('0x33')](_0x4d40b5,JSON['stringify'](_0x1fd535));return _0x392298;}function isValidIdToken(_0x5e6efd,_0x567b44){try{var _0x2cb464=jwt[_0xbeca('0x34')](_0x5e6efd,{'complete':!![]});var _0x5597fa=_0x2cb464[_0xbeca('0x35')];if(_0x5597fa[_0xbeca('0x36')]!==_0x567b44[_0xbeca('0x37')])return![];if(_0x5597fa[_0xbeca('0x38')]!==_0x567b44['audience'])return![];if(_0x5597fa[_0xbeca('0x39')]!==_0x567b44[_0xbeca('0x39')])return![];if(moment()[_0xbeca('0x3a')](moment[_0xbeca('0x3b')](_0x5597fa['exp'])))return![];return!![];}catch(_0x1940a5){throw _0x1940a5;}}function refreshOauth2MicrosoftAccessToken(_0x52c7d8){return Promise['resolve']()[_0xbeca('0x3c')](function(){if(_0x52c7d8[_0xbeca('0x3d')])return _0x52c7d8;return db['CloudProvider'][_0xbeca('0x3e')]({'where':{'id':_0x52c7d8['id']},'raw':!![]});})[_0xbeca('0x3c')](function(_0x1d1c56){var _0x5a9ca3={'grant_type':'refresh_token','refresh_token':_0x1d1c56[_0xbeca('0x3f')],'scope':getAccessTokenScope(_0x1d1c56),'redirect_uri':_0x1d1c56[_0xbeca('0x2a')],'client_id':_0x1d1c56['data1'],'client_secret':encryptor[_0xbeca('0x40')](_0x1d1c56['data3'])};var _0x215bd8={'method':'POST','uri':MICROSOFT_AUTH_URL[_0xbeca('0x1e')]('{TENANT_ID}',_0x1d1c56[_0xbeca('0x20')])+MICROSOFT_TOKEN_ENDPOINT,'form':_0x5a9ca3,'json':!![]};return rp(_0x215bd8);})['then'](function(_0xf34b2c){_0x52c7d8[_0xbeca('0x41')]=_0xf34b2c[_0xbeca('0x42')];_0x52c7d8[_0xbeca('0x3f')]=_0xf34b2c[_0xbeca('0x43')];return db[_0xbeca('0x44')][_0xbeca('0x45')]({'data5':_0x52c7d8['data5'],'data6':_0x52c7d8[_0xbeca('0x3f')]},{'where':{'id':_0x52c7d8['id']}});})[_0xbeca('0x3c')](function(){return _0x52c7d8;})['catch'](function(_0x594941){logger[_0xbeca('0x46')]('Failed\x20to\x20refresh\x20access\x20token\x20for\x20cloud\x20provider\x20#%s,\x20-\x20err:%s',_0x52c7d8['id'],_0x594941);});}function getOauth2MicrosoftAccessToken(_0x21b41f,_0x11852c){var _0x5e31da={'grant_type':_0xbeca('0x47'),'code':_0x21b41f,'scope':getAccessTokenScope(_0x11852c),'redirect_uri':_0x11852c[_0xbeca('0x2a')],'client_id':_0x11852c['data1'],'client_secret':encryptor[_0xbeca('0x40')](_0x11852c['data3'])};var _0x28c7f7={'method':'POST','uri':MICROSOFT_AUTH_URL[_0xbeca('0x1e')](_0xbeca('0x1f'),_0x11852c[_0xbeca('0x20')])+MICROSOFT_TOKEN_ENDPOINT,'form':_0x5e31da,'json':!![]};return rp(_0x28c7f7);}function startRefreshInterval(_0x31b892){var _0x3499de=schedule[_0xbeca('0x48')];if(_0x3499de[_0x31b892['id']])clearInterval(_0x3499de[_0x31b892['id']]);_0x3499de[_0x31b892['id']]=setInterval(refreshOauth2MicrosoftAccessToken[_0xbeca('0x49')](this,{'id':_0x31b892['id']}),OAUTH_REFRESH_INTERVAL*0x3e8);schedule['intervals']=_0x3499de;}function startAllRefreshIntervals(){return db['CloudProvider']['findAll']({'where':{'data6':{'$ne':null}},'raw':!![]})['then'](function(_0x2df4a9){var _0x176504=_0x2df4a9['map'](function(_0x5e9f69){return refreshOauth2MicrosoftAccessToken(_0x5e9f69)[_0xbeca('0x3c')](function(_0x2ed05b){startRefreshInterval(_0x2ed05b);});});return Promise[_0xbeca('0x4a')](_0x176504);})[_0xbeca('0x4b')](function(_0x6c26eb){var _0xd3e8cd=_0x6c26eb?util[_0xbeca('0x4c')](_0x6c26eb,{'showHidden':![],'depth':null}):'';logger[_0xbeca('0x46')](_0xbeca('0x4d'),_0xd3e8cd);});}module['exports']={'generateMicrosoftAuthorizationUrl':generateMicrosoftAuthorizationUrl,'getOauth2MicrosoftAccessToken':getOauth2MicrosoftAccessToken,'isValidIdToken':isValidIdToken,'startAllRefreshIntervals':startAllRefreshIntervals,'refreshOauth2MicrosoftAccessToken':refreshOauth2MicrosoftAccessToken,'startRefreshInterval':startRefreshInterval};
\ No newline at end of file
diff --git a/server/api/cloudProvider/cloudProvider.rpc.js b/server/api/cloudProvider/cloudProvider.rpc.js
index ca47a2d..80fcf8e 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 _0x5ba3=['ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','then','info','CloudProvider,\x20%s,\x20%s','debug','error','code','message','request\x20sent','result','catch','lodash','moment','bluebird'];(function(_0x17d9e3,_0x1f969c){var _0x14192d=function(_0x159745){while(--_0x159745){_0x17d9e3['push'](_0x17d9e3['shift']());}};_0x14192d(++_0x1f969c);}(_0x5ba3,0x140));var _0x35ba=function(_0x4a0db2,_0x533a26){_0x4a0db2=_0x4a0db2-0x0;var _0x57666d=_0x5ba3[_0x4a0db2];return _0x57666d;};'use strict';var _=require(_0x35ba('0x0'));var util=require('util');var moment=require(_0x35ba('0x1'));var BPromise=require(_0x35ba('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x35ba('0x3'));var db=require(_0x35ba('0x4'))['db'];var utils=require(_0x35ba('0x5'));var logger=require('../../config/logger')(_0x35ba('0x6'));var config=require(_0x35ba('0x7'));var jayson=require(_0x35ba('0x8'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x20cd5f,_0x3264d3,_0x380ffb){return new BPromise(function(_0x4c55f3,_0x22bed8){return client['request'](_0x20cd5f,_0x380ffb)[_0x35ba('0x9')](function(_0x366ddc){logger[_0x35ba('0xa')](_0x35ba('0xb'),_0x3264d3,'request\x20sent');logger[_0x35ba('0xc')]('CloudProvider,\x20%s,\x20%s,\x20%s',_0x3264d3,'request\x20sent',JSON['stringify'](_0x366ddc));if(_0x366ddc[_0x35ba('0xd')]){if(_0x366ddc[_0x35ba('0xd')][_0x35ba('0xe')]===0x1f4){logger[_0x35ba('0xd')](_0x35ba('0xb'),_0x3264d3,_0x366ddc[_0x35ba('0xd')][_0x35ba('0xf')]);return _0x22bed8(_0x366ddc[_0x35ba('0xd')]['message']);}logger[_0x35ba('0xd')](_0x35ba('0xb'),_0x3264d3,_0x366ddc[_0x35ba('0xd')][_0x35ba('0xf')]);return _0x4c55f3(_0x366ddc['error'][_0x35ba('0xf')]);}else{logger['info']('CloudProvider,\x20%s,\x20%s',_0x3264d3,_0x35ba('0x10'));_0x4c55f3(_0x366ddc[_0x35ba('0x11')]['message']);}})[_0x35ba('0x12')](function(_0x2b6b71){logger[_0x35ba('0xd')](_0x35ba('0xb'),_0x3264d3,_0x2b6b71);_0x22bed8(_0x2b6b71);});});}
\ No newline at end of file
+var _0x04d5=['stringify','error','code','message','catch','lodash','util','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then','info','CloudProvider,\x20%s,\x20%s','request\x20sent','debug'];(function(_0x57c7f5,_0x3a8ed3){var _0x3e31e3=function(_0x11cdc1){while(--_0x11cdc1){_0x57c7f5['push'](_0x57c7f5['shift']());}};_0x3e31e3(++_0x3a8ed3);}(_0x04d5,0xe1));var _0x504d=function(_0x477c2a,_0x1c0a7c){_0x477c2a=_0x477c2a-0x0;var _0x9ae88=_0x04d5[_0x477c2a];return _0x9ae88;};'use strict';var _=require(_0x504d('0x0'));var util=require(_0x504d('0x1'));var moment=require('moment');var BPromise=require(_0x504d('0x2'));var rs=require(_0x504d('0x3'));var fs=require('fs');var Redis=require(_0x504d('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x504d('0x5'));var logger=require(_0x504d('0x6'))(_0x504d('0x7'));var config=require(_0x504d('0x8'));var jayson=require(_0x504d('0x9'));var client=jayson['client'][_0x504d('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x278262,_0x87bf04,_0x49cb76){return new BPromise(function(_0x5712a7,_0x16da4f){return client[_0x504d('0xb')](_0x278262,_0x49cb76)[_0x504d('0xc')](function(_0x48e0e6){logger[_0x504d('0xd')](_0x504d('0xe'),_0x87bf04,_0x504d('0xf'));logger[_0x504d('0x10')]('CloudProvider,\x20%s,\x20%s,\x20%s',_0x87bf04,_0x504d('0xf'),JSON[_0x504d('0x11')](_0x48e0e6));if(_0x48e0e6[_0x504d('0x12')]){if(_0x48e0e6[_0x504d('0x12')][_0x504d('0x13')]===0x1f4){logger[_0x504d('0x12')](_0x504d('0xe'),_0x87bf04,_0x48e0e6['error']['message']);return _0x16da4f(_0x48e0e6[_0x504d('0x12')][_0x504d('0x14')]);}logger[_0x504d('0x12')](_0x504d('0xe'),_0x87bf04,_0x48e0e6[_0x504d('0x12')][_0x504d('0x14')]);return _0x5712a7(_0x48e0e6['error'][_0x504d('0x14')]);}else{logger['info'](_0x504d('0xe'),_0x87bf04,_0x504d('0xf'));_0x5712a7(_0x48e0e6['result'][_0x504d('0x14')]);}})[_0x504d('0x15')](function(_0x1e3722){logger[_0x504d('0x12')](_0x504d('0xe'),_0x87bf04,_0x1e3722);_0x16da4f(_0x1e3722);});});}
\ No newline at end of file
diff --git a/server/api/cloudProvider/index.js b/server/api/cloudProvider/index.js
index 5781191..ae4172e 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 _0x1261=['/:id','show','create','put','update','delete','/:id/oauth2/microsoft/authorize/','post','exports','Router','../../components/auth/service','./cloudProvider.controller','get','isAuthenticated','index'];(function(_0x507ac5,_0x33aaee){var _0x12c1bc=function(_0x5c953c){while(--_0x5c953c){_0x507ac5['push'](_0x507ac5['shift']());}};_0x12c1bc(++_0x33aaee);}(_0x1261,0x144));var _0x1126=function(_0x53afe9,_0x2c9f40){_0x53afe9=_0x53afe9-0x0;var _0x396396=_0x1261[_0x53afe9];return _0x396396;};'use strict';var express=require('express');var router=express[_0x1126('0x0')]();var auth=require(_0x1126('0x1'));var controller=require(_0x1126('0x2'));router[_0x1126('0x3')]('/',auth[_0x1126('0x4')](),controller[_0x1126('0x5')]);router[_0x1126('0x3')](_0x1126('0x6'),auth[_0x1126('0x4')](),controller[_0x1126('0x7')]);router['post']('/',auth['isAuthenticated'](),controller[_0x1126('0x8')]);router[_0x1126('0x9')]('/:id',auth[_0x1126('0x4')](),controller[_0x1126('0xa')]);router[_0x1126('0xb')](_0x1126('0x6'),auth[_0x1126('0x4')](),controller['destroy']);router[_0x1126('0x3')](_0x1126('0xc'),auth[_0x1126('0x4')](),controller['oauth2MicrosoftAuthorize']);router[_0x1126('0xd')]('/oauth2/microsoft/callback',controller['oauth2MicrosoftCallback']);module[_0x1126('0xe')]=router;
\ No newline at end of file
+var _0xdb28=['delete','destroy','/:id/oauth2/microsoft/authorize/','oauth2MicrosoftAuthorize','/oauth2/microsoft/callback','oauth2MicrosoftCallback','express','Router','../../components/auth/service','./cloudProvider.controller','isAuthenticated','index','get','/:id','post','update'];(function(_0xb21ec0,_0x44186e){var _0x185dca=function(_0x4860ed){while(--_0x4860ed){_0xb21ec0['push'](_0xb21ec0['shift']());}};_0x185dca(++_0x44186e);}(_0xdb28,0x106));var _0x8db2=function(_0x40f278,_0x37429a){_0x40f278=_0x40f278-0x0;var _0x23d1aa=_0xdb28[_0x40f278];return _0x23d1aa;};'use strict';var express=require(_0x8db2('0x0'));var router=express[_0x8db2('0x1')]();var auth=require(_0x8db2('0x2'));var controller=require(_0x8db2('0x3'));router['get']('/',auth[_0x8db2('0x4')](),controller[_0x8db2('0x5')]);router[_0x8db2('0x6')](_0x8db2('0x7'),auth[_0x8db2('0x4')](),controller['show']);router[_0x8db2('0x8')]('/',auth[_0x8db2('0x4')](),controller['create']);router['put'](_0x8db2('0x7'),auth[_0x8db2('0x4')](),controller[_0x8db2('0x9')]);router[_0x8db2('0xa')](_0x8db2('0x7'),auth[_0x8db2('0x4')](),controller[_0x8db2('0xb')]);router['get'](_0x8db2('0xc'),auth[_0x8db2('0x4')](),controller[_0x8db2('0xd')]);router['post'](_0x8db2('0xe'),controller[_0x8db2('0xf')]);module['exports']=router;
\ No newline at end of file
diff --git a/server/api/cmCompany/cmCompany.attributes.js b/server/api/cmCompany/cmCompany.attributes.js
index 576f039..f0450d7 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 _0x0da2=['exports','STRING','name','sequelize'];(function(_0x524b60,_0x43f14f){var _0x4c1567=function(_0x475ce5){while(--_0x475ce5){_0x524b60['push'](_0x524b60['shift']());}};_0x4c1567(++_0x43f14f);}(_0x0da2,0x1bb));var _0x20da=function(_0x194ae0,_0x1dcfd1){_0x194ae0=_0x194ae0-0x0;var _0x2d5a05=_0x0da2[_0x194ae0];return _0x2d5a05;};'use strict';var Sequelize=require(_0x20da('0x0'));module[_0x20da('0x1')]={'name':{'type':Sequelize[_0x20da('0x2')],'unique':_0x20da('0x3'),'allowNull':![],'validate':{'notEmpty':!![]}},'vat':{'type':Sequelize[_0x20da('0x2')]},'companyId':{'type':Sequelize['STRING']},'website':{'type':Sequelize[_0x20da('0x2')]},'phone':{'type':Sequelize[_0x20da('0x2')]},'fax':{'type':Sequelize[_0x20da('0x2')]},'type':{'type':Sequelize['STRING']},'street':{'type':Sequelize[_0x20da('0x2')]},'postalCode':{'type':Sequelize[_0x20da('0x2')]},'city':{'type':Sequelize[_0x20da('0x2')]},'country':{'type':Sequelize['STRING']},'email':{'type':Sequelize[_0x20da('0x2')],'validate':{'isEmail':!![]}},'emailDomain':{'type':Sequelize[_0x20da('0x2')]},'sStreet':{'type':Sequelize['STRING']},'sPostalCode':{'type':Sequelize[_0x20da('0x2')]},'sCity':{'type':Sequelize[_0x20da('0x2')]},'sCountry':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0x20da('0x2')]}};
\ No newline at end of file
+var _0x0807=['name','sequelize','exports','STRING'];(function(_0x409fb8,_0x5ab3d3){var _0x278270=function(_0x58849c){while(--_0x58849c){_0x409fb8['push'](_0x409fb8['shift']());}};_0x278270(++_0x5ab3d3);}(_0x0807,0x1b5));var _0x7080=function(_0x5ac666,_0x4fb291){_0x5ac666=_0x5ac666-0x0;var _0x2cf776=_0x0807[_0x5ac666];return _0x2cf776;};'use strict';var Sequelize=require(_0x7080('0x0'));module[_0x7080('0x1')]={'name':{'type':Sequelize[_0x7080('0x2')],'unique':_0x7080('0x3'),'allowNull':![],'validate':{'notEmpty':!![]}},'vat':{'type':Sequelize[_0x7080('0x2')]},'companyId':{'type':Sequelize[_0x7080('0x2')]},'website':{'type':Sequelize[_0x7080('0x2')]},'phone':{'type':Sequelize[_0x7080('0x2')]},'fax':{'type':Sequelize['STRING']},'type':{'type':Sequelize[_0x7080('0x2')]},'street':{'type':Sequelize['STRING']},'postalCode':{'type':Sequelize[_0x7080('0x2')]},'city':{'type':Sequelize[_0x7080('0x2')]},'country':{'type':Sequelize['STRING']},'email':{'type':Sequelize[_0x7080('0x2')],'validate':{'isEmail':!![]}},'emailDomain':{'type':Sequelize['STRING']},'sStreet':{'type':Sequelize[_0x7080('0x2')]},'sPostalCode':{'type':Sequelize['STRING']},'sCity':{'type':Sequelize[_0x7080('0x2')]},'sCountry':{'type':Sequelize[_0x7080('0x2')]},'description':{'type':Sequelize[_0x7080('0x2')]}};
\ No newline at end of file
diff --git a/server/api/cmCompany/cmCompany.controller.js b/server/api/cmCompany/cmCompany.controller.js
index 06450a4..940b39d 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 _0xd279=['Companies','end','error','stack','name','CmCompany','describe','model','keys','query','filters','intersection','attributes','fields','length','nolimit','order','sort','filter','where','merge','options','includeAll','include','findAll','rows','catch','show','params','find','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','addContacts','ids','omit','getContacts','findOne','CmContact','rawAttributes','pick','map','hasOwnProperty','eml-format','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','to-csv','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../mysqldb','sendStatus','status','json','offset','undefined','limit','count','set','Content-Range','reject','save','update','then','destroy','get'];(function(_0x35011c,_0x3568c5){var _0x4aa873=function(_0x459d2c){while(--_0x459d2c){_0x35011c['push'](_0x35011c['shift']());}};_0x4aa873(++_0x3568c5);}(_0xd279,0x8a));var _0x9d27=function(_0x20fcc6,_0x56b060){_0x20fcc6=_0x20fcc6-0x0;var _0x4621c2=_0xd279[_0x20fcc6];return _0x4621c2;};'use strict';var emlformat=require(_0x9d27('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0x9d27('0x1'));var rp=require(_0x9d27('0x2'));var moment=require(_0x9d27('0x3'));var BPromise=require(_0x9d27('0x4'));var Mustache=require(_0x9d27('0x5'));var util=require(_0x9d27('0x6'));var path=require(_0x9d27('0x7'));var sox=require(_0x9d27('0x8'));var csv=require('to-csv');var ejs=require(_0x9d27('0x9'));var fs=require('fs');var fs_extra=require(_0x9d27('0xa'));var _=require(_0x9d27('0xb'));var squel=require(_0x9d27('0xc'));var crypto=require(_0x9d27('0xd'));var jsforce=require(_0x9d27('0xe'));var deskjs=require(_0x9d27('0xf'));var toCsv=require(_0x9d27('0x10'));var querystring=require('querystring');var Papa=require(_0x9d27('0x11'));var Redis=require(_0x9d27('0x12'));var authService=require(_0x9d27('0x13'));var qs=require(_0x9d27('0x14'));var as=require(_0x9d27('0x15'));var hardwareService=require(_0x9d27('0x16'));var logger=require(_0x9d27('0x17'))(_0x9d27('0x18'));var utils=require('../../config/utils');var config=require(_0x9d27('0x19'));var licenseUtil=require('../../config/license/util');var db=require(_0x9d27('0x1a'))['db'];function respondWithStatusCode(_0x5b33c6,_0x295165){_0x295165=_0x295165||0xcc;return function(_0x23c1ff){if(_0x23c1ff){return _0x5b33c6[_0x9d27('0x1b')](_0x295165);}return _0x5b33c6[_0x9d27('0x1c')](_0x295165)['end']();};}function respondWithResult(_0x2792a4,_0x3e325d){_0x3e325d=_0x3e325d||0xc8;return function(_0x2a69f1){if(_0x2a69f1){return _0x2792a4[_0x9d27('0x1c')](_0x3e325d)[_0x9d27('0x1d')](_0x2a69f1);}};}function respondWithFilteredResult(_0x2fe7d5,_0x1f91ab){return function(_0x3cd025){if(_0x3cd025){var _0x17adac=typeof _0x1f91ab[_0x9d27('0x1e')]===_0x9d27('0x1f')&&typeof _0x1f91ab[_0x9d27('0x20')]===_0x9d27('0x1f');var _0x5a90d8=_0x3cd025[_0x9d27('0x21')];var _0x48b285=_0x17adac?0x0:_0x1f91ab['offset'];var _0xdbce7c=_0x17adac?_0x3cd025[_0x9d27('0x21')]:_0x1f91ab[_0x9d27('0x1e')]+_0x1f91ab[_0x9d27('0x20')];var _0x177411;if(_0xdbce7c>=_0x5a90d8){_0xdbce7c=_0x5a90d8;_0x177411=0xc8;}else{_0x177411=0xce;}_0x2fe7d5[_0x9d27('0x1c')](_0x177411);return _0x2fe7d5[_0x9d27('0x22')](_0x9d27('0x23'),_0x48b285+'-'+_0xdbce7c+'/'+_0x5a90d8)[_0x9d27('0x1d')](_0x3cd025);}return null;};}function patchUpdates(_0x3d2631){return function(_0x407709){try{jsonpatch['apply'](_0x407709,_0x3d2631,!![]);}catch(_0x35d66a){return BPromise[_0x9d27('0x24')](_0x35d66a);}return _0x407709[_0x9d27('0x25')]();};}function saveUpdates(_0x167012,_0xab43f9){return function(_0x42353b){if(_0x42353b){return _0x42353b[_0x9d27('0x26')](_0x167012)[_0x9d27('0x27')](function(_0x715b1d){return _0x715b1d;});}return null;};}function removeEntity(_0x54dbb2,_0x14879d){return function(_0x58361a){if(_0x58361a){return _0x58361a[_0x9d27('0x28')]()[_0x9d27('0x27')](function(){var _0x2e5da8=_0x58361a[_0x9d27('0x29')]({'plain':!![]});var _0x441bb9=_0x9d27('0x2a');return db['UserProfileResource'][_0x9d27('0x28')]({'where':{'type':_0x441bb9,'resourceId':_0x2e5da8['id']}})[_0x9d27('0x27')](function(){return _0x58361a;});})[_0x9d27('0x27')](function(){_0x54dbb2[_0x9d27('0x1c')](0xcc)[_0x9d27('0x2b')]();});}};}function handleEntityNotFound(_0x474dfb,_0x229787){return function(_0x28d7db){if(!_0x28d7db){_0x474dfb['sendStatus'](0x194);}return _0x28d7db;};}function handleError(_0x48ee9a,_0x2dd4ea){_0x2dd4ea=_0x2dd4ea||0x1f4;return function(_0x387ae0){logger[_0x9d27('0x2c')](_0x387ae0[_0x9d27('0x2d')]);if(_0x387ae0[_0x9d27('0x2e')]){delete _0x387ae0[_0x9d27('0x2e')];}_0x48ee9a[_0x9d27('0x1c')](_0x2dd4ea)['send'](_0x387ae0);};}exports['index']=function(_0x2a6f4e,_0x5d7215){var _0x523e3f={},_0x5ae72f={},_0x57f49b={'count':0x0,'rows':[]};return db[_0x9d27('0x2f')][_0x9d27('0x30')]()['then'](function(_0x209718){_0x5ae72f[_0x9d27('0x31')]=_[_0x9d27('0x32')](_0x209718);_0x5ae72f[_0x9d27('0x33')]=_['keys'](_0x2a6f4e['query']);_0x5ae72f[_0x9d27('0x34')]=_[_0x9d27('0x35')](_0x5ae72f['model'],_0x5ae72f[_0x9d27('0x33')]);_0x523e3f[_0x9d27('0x36')]=_[_0x9d27('0x35')](_0x5ae72f['model'],qs[_0x9d27('0x37')](_0x2a6f4e[_0x9d27('0x33')][_0x9d27('0x37')]));_0x523e3f[_0x9d27('0x36')]=_0x523e3f[_0x9d27('0x36')][_0x9d27('0x38')]?_0x523e3f[_0x9d27('0x36')]:_0x5ae72f[_0x9d27('0x31')];if(!_0x2a6f4e['query']['hasOwnProperty'](_0x9d27('0x39'))){_0x523e3f[_0x9d27('0x20')]=qs[_0x9d27('0x20')](_0x2a6f4e[_0x9d27('0x33')][_0x9d27('0x20')]);_0x523e3f[_0x9d27('0x1e')]=qs[_0x9d27('0x1e')](_0x2a6f4e[_0x9d27('0x33')][_0x9d27('0x1e')]);}_0x523e3f[_0x9d27('0x3a')]=qs['sort'](_0x2a6f4e[_0x9d27('0x33')][_0x9d27('0x3b')]);_0x523e3f['where']=qs['filters'](_['pick'](_0x2a6f4e[_0x9d27('0x33')],_0x5ae72f[_0x9d27('0x34')]),_0x209718);if(_0x2a6f4e[_0x9d27('0x33')][_0x9d27('0x3c')]){_0x523e3f[_0x9d27('0x3d')]=_['merge'](_0x523e3f['where'],{'$or':_['map'](_0x523e3f[_0x9d27('0x36')],function(_0x185eec){var _0x1847de={};_0x1847de[_0x185eec]={'$like':'%'+_0x2a6f4e[_0x9d27('0x33')][_0x9d27('0x3c')]+'%'};return _0x1847de;})});}_0x523e3f=_[_0x9d27('0x3e')]({},_0x523e3f,_0x2a6f4e[_0x9d27('0x3f')]);var _0x20f728={'where':_0x523e3f[_0x9d27('0x3d')]};return db[_0x9d27('0x2f')][_0x9d27('0x21')](_0x20f728)[_0x9d27('0x27')](function(_0x448e2b){_0x57f49b['count']=_0x448e2b;if(_0x2a6f4e[_0x9d27('0x33')][_0x9d27('0x40')]){_0x523e3f[_0x9d27('0x41')]=[{'all':!![]}];}return db[_0x9d27('0x2f')][_0x9d27('0x42')](_0x523e3f);})[_0x9d27('0x27')](function(_0x3e0c6a){_0x57f49b[_0x9d27('0x43')]=_0x3e0c6a;return _0x57f49b;})[_0x9d27('0x27')](respondWithFilteredResult(_0x5d7215,_0x523e3f))['catch'](handleError(_0x5d7215,null));})[_0x9d27('0x44')](handleError(_0x5d7215,null));};exports[_0x9d27('0x45')]=function(_0x1686c6,_0x4cc8d1){var _0x58d97f={'raw':![],'where':{'id':_0x1686c6[_0x9d27('0x46')]['id']}},_0x1f599f={};_0x1f599f['model']=_[_0x9d27('0x32')](db['CmCompany']['rawAttributes']);_0x1f599f[_0x9d27('0x33')]=_[_0x9d27('0x32')](_0x1686c6[_0x9d27('0x33')]);_0x1f599f[_0x9d27('0x34')]=_[_0x9d27('0x35')](_0x1f599f['model'],_0x1f599f[_0x9d27('0x33')]);_0x58d97f[_0x9d27('0x36')]=_['intersection'](_0x1f599f[_0x9d27('0x31')],qs[_0x9d27('0x37')](_0x1686c6['query']['fields']));_0x58d97f['attributes']=_0x58d97f[_0x9d27('0x36')]['length']?_0x58d97f['attributes']:_0x1f599f[_0x9d27('0x31')];if(_0x1686c6[_0x9d27('0x33')][_0x9d27('0x40')]){_0x58d97f[_0x9d27('0x41')]=[{'all':!![]}];}_0x58d97f=_[_0x9d27('0x3e')]({},_0x58d97f,_0x1686c6[_0x9d27('0x3f')]);return db[_0x9d27('0x2f')][_0x9d27('0x47')](_0x58d97f)[_0x9d27('0x27')](handleEntityNotFound(_0x4cc8d1,null))[_0x9d27('0x27')](respondWithResult(_0x4cc8d1,null))['catch'](handleError(_0x4cc8d1,null));};exports['create']=function(_0x2e09dc,_0x2407ca){return db['CmCompany'][_0x9d27('0x48')](_0x2e09dc['body'],{})[_0x9d27('0x27')](function(_0x4a172b){var _0x395a28=_0x2e09dc[_0x9d27('0x49')][_0x9d27('0x29')]({'plain':!![]});if(!_0x395a28)throw new Error(_0x9d27('0x4a'));if(_0x395a28[_0x9d27('0x4b')]===_0x9d27('0x49')){var _0x1b76b5=_0x4a172b[_0x9d27('0x29')]({'plain':!![]});var _0x365a36=_0x9d27('0x2a');return db['UserProfileSection'][_0x9d27('0x47')]({'where':{'name':_0x365a36,'userProfileId':_0x395a28[_0x9d27('0x4c')]},'raw':!![]})[_0x9d27('0x27')](function(_0x1a4d5){if(_0x1a4d5&&_0x1a4d5[_0x9d27('0x4d')]===0x0){return db['UserProfileResource'][_0x9d27('0x48')]({'name':_0x1b76b5[_0x9d27('0x2e')],'resourceId':_0x1b76b5['id'],'type':_0x1a4d5[_0x9d27('0x2e')],'sectionId':_0x1a4d5['id']},{})[_0x9d27('0x27')](function(){return _0x4a172b;});}else{return _0x4a172b;}})['catch'](function(_0x4bbf4f){logger['error'](_0x9d27('0x4e'),_0x4bbf4f);throw _0x4bbf4f;});}return _0x4a172b;})['then'](respondWithResult(_0x2407ca,0xc9))[_0x9d27('0x44')](handleError(_0x2407ca,null));};exports[_0x9d27('0x26')]=function(_0x238bc7,_0x371dc0){if(_0x238bc7[_0x9d27('0x4f')]['id']){delete _0x238bc7['body']['id'];}return db['CmCompany'][_0x9d27('0x47')]({'where':{'id':_0x238bc7[_0x9d27('0x46')]['id']}})['then'](handleEntityNotFound(_0x371dc0,null))['then'](saveUpdates(_0x238bc7[_0x9d27('0x4f')],null))['then'](respondWithResult(_0x371dc0,null))[_0x9d27('0x44')](handleError(_0x371dc0,null));};exports[_0x9d27('0x28')]=function(_0x46db1b,_0x5e6aed){return db[_0x9d27('0x2f')]['find']({'where':{'id':_0x46db1b[_0x9d27('0x46')]['id']}})[_0x9d27('0x27')](handleEntityNotFound(_0x5e6aed,null))['then'](removeEntity(_0x5e6aed,null))[_0x9d27('0x44')](handleError(_0x5e6aed,null));};exports[_0x9d27('0x30')]=function(_0x40d16e,_0x2d1e03){return db[_0x9d27('0x2f')][_0x9d27('0x30')]()[_0x9d27('0x27')](respondWithResult(_0x2d1e03,null))[_0x9d27('0x44')](handleError(_0x2d1e03,null));};exports[_0x9d27('0x50')]=function(_0x22f29b,_0x537dae,_0x164c72){return db['CmContact'][_0x9d27('0x47')]({'where':{'id':_0x22f29b[_0x9d27('0x46')]['id']}})['then'](handleEntityNotFound(_0x537dae,null))[_0x9d27('0x27')](function(_0x447cea){if(_0x447cea){return _0x447cea['addContacts'](_0x22f29b[_0x9d27('0x4f')][_0x9d27('0x51')],_[_0x9d27('0x52')](_0x22f29b[_0x9d27('0x4f')],[_0x9d27('0x51'),'id'])||{});}})[_0x9d27('0x27')](respondWithResult(_0x537dae,null))[_0x9d27('0x44')](handleError(_0x537dae,null));};exports[_0x9d27('0x53')]=function(_0x18e250,_0x4fb0e,_0x56eb06){var _0x2c5cdd={};var _0x552d7c={};var _0x32c605;var _0x247304;return db['CmCompany'][_0x9d27('0x54')]({'where':{'id':_0x18e250[_0x9d27('0x46')]['id']}})[_0x9d27('0x27')](handleEntityNotFound(_0x4fb0e,null))[_0x9d27('0x27')](function(_0x382f44){if(_0x382f44){_0x32c605=_0x382f44;_0x552d7c['model']=_[_0x9d27('0x32')](db[_0x9d27('0x55')][_0x9d27('0x56')]);_0x552d7c['query']=_[_0x9d27('0x32')](_0x18e250[_0x9d27('0x33')]);_0x552d7c['filters']=_[_0x9d27('0x35')](_0x552d7c[_0x9d27('0x31')],_0x552d7c['query']);_0x2c5cdd[_0x9d27('0x36')]=_['intersection'](_0x552d7c['model'],qs[_0x9d27('0x37')](_0x18e250[_0x9d27('0x33')][_0x9d27('0x37')]));_0x2c5cdd[_0x9d27('0x36')]=_0x2c5cdd[_0x9d27('0x36')][_0x9d27('0x38')]?_0x2c5cdd[_0x9d27('0x36')]:_0x552d7c[_0x9d27('0x31')];_0x2c5cdd[_0x9d27('0x3a')]=qs[_0x9d27('0x3b')](_0x18e250[_0x9d27('0x33')][_0x9d27('0x3b')]);_0x2c5cdd['where']=qs['filters'](_[_0x9d27('0x57')](_0x18e250[_0x9d27('0x33')],_0x552d7c[_0x9d27('0x34')]));if(_0x18e250[_0x9d27('0x33')][_0x9d27('0x3c')]){_0x2c5cdd[_0x9d27('0x3d')]=_['merge'](_0x2c5cdd[_0x9d27('0x3d')],{'$or':_[_0x9d27('0x58')](_0x2c5cdd[_0x9d27('0x36')],function(_0xb193d8){var _0x55a186={};_0x55a186[_0xb193d8]={'$like':'%'+_0x18e250[_0x9d27('0x33')]['filter']+'%'};return _0x55a186;})});}_0x2c5cdd=_[_0x9d27('0x3e')]({},_0x2c5cdd,_0x18e250[_0x9d27('0x3f')]);return _0x32c605[_0x9d27('0x53')](_0x2c5cdd);}})[_0x9d27('0x27')](function(_0x48b210){if(_0x48b210){_0x247304=_0x48b210['length'];if(!_0x18e250['query'][_0x9d27('0x59')](_0x9d27('0x39'))){_0x2c5cdd[_0x9d27('0x20')]=qs[_0x9d27('0x20')](_0x18e250['query'][_0x9d27('0x20')]);_0x2c5cdd[_0x9d27('0x1e')]=qs[_0x9d27('0x1e')](_0x18e250[_0x9d27('0x33')][_0x9d27('0x1e')]);}return _0x32c605[_0x9d27('0x53')](_0x2c5cdd);}})[_0x9d27('0x27')](function(_0x19426f){if(_0x19426f){return _0x19426f?{'count':_0x247304,'rows':_0x19426f}:null;}})['then'](respondWithResult(_0x4fb0e,null))[_0x9d27('0x44')](handleError(_0x4fb0e,null));};
\ No newline at end of file
+var _0x690a=['body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','error','addContacts','CmContact','ids','omit','getContacts','hasOwnProperty','eml-format','rimraf','fast-json-patch','bluebird','mustache','util','path','ejs','fs-extra','lodash','squel','crypto','jsforce','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','end','status','json','offset','undefined','count','limit','set','apply','reject','save','update','then','destroy','get','Companies','UserProfileResource','stack','name','send','CmCompany','describe','keys','query','filters','model','attributes','intersection','fields','length','nolimit','order','sort','where','pick','filter','map','merge','options','includeAll','rows','catch','params','rawAttributes','include','find','create'];(function(_0x159115,_0x317325){var _0x5dd47f=function(_0xee53e1){while(--_0xee53e1){_0x159115['push'](_0x159115['shift']());}};_0x5dd47f(++_0x317325);}(_0x690a,0x110));var _0xa690=function(_0x39127c,_0x328fd8){_0x39127c=_0x39127c-0x0;var _0x478896=_0x690a[_0x39127c];return _0x478896;};'use strict';var emlformat=require(_0xa690('0x0'));var rimraf=require(_0xa690('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xa690('0x2'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0xa690('0x3'));var Mustache=require(_0xa690('0x4'));var util=require(_0xa690('0x5'));var path=require(_0xa690('0x6'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0xa690('0x7'));var fs=require('fs');var fs_extra=require(_0xa690('0x8'));var _=require(_0xa690('0x9'));var squel=require(_0xa690('0xa'));var crypto=require(_0xa690('0xb'));var jsforce=require(_0xa690('0xc'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0xa690('0xd'));var Papa=require('papaparse');var Redis=require(_0xa690('0xe'));var authService=require(_0xa690('0xf'));var qs=require(_0xa690('0x10'));var as=require(_0xa690('0x11'));var hardwareService=require(_0xa690('0x12'));var logger=require(_0xa690('0x13'))(_0xa690('0x14'));var utils=require(_0xa690('0x15'));var config=require(_0xa690('0x16'));var licenseUtil=require(_0xa690('0x17'));var db=require(_0xa690('0x18'))['db'];function respondWithStatusCode(_0x5ec0a5,_0x260962){_0x260962=_0x260962||0xcc;return function(_0x4f6c95){if(_0x4f6c95){return _0x5ec0a5['sendStatus'](_0x260962);}return _0x5ec0a5['status'](_0x260962)[_0xa690('0x19')]();};}function respondWithResult(_0x4fd000,_0x303b03){_0x303b03=_0x303b03||0xc8;return function(_0x314ffe){if(_0x314ffe){return _0x4fd000[_0xa690('0x1a')](_0x303b03)[_0xa690('0x1b')](_0x314ffe);}};}function respondWithFilteredResult(_0x48d821,_0xca8623){return function(_0x16fba0){if(_0x16fba0){var _0x49ebfb=typeof _0xca8623[_0xa690('0x1c')]===_0xa690('0x1d')&&typeof _0xca8623['limit']==='undefined';var _0x1c7699=_0x16fba0[_0xa690('0x1e')];var _0xb32510=_0x49ebfb?0x0:_0xca8623[_0xa690('0x1c')];var _0x5e1933=_0x49ebfb?_0x16fba0[_0xa690('0x1e')]:_0xca8623[_0xa690('0x1c')]+_0xca8623[_0xa690('0x1f')];var _0x35203;if(_0x5e1933>=_0x1c7699){_0x5e1933=_0x1c7699;_0x35203=0xc8;}else{_0x35203=0xce;}_0x48d821[_0xa690('0x1a')](_0x35203);return _0x48d821[_0xa690('0x20')]('Content-Range',_0xb32510+'-'+_0x5e1933+'/'+_0x1c7699)[_0xa690('0x1b')](_0x16fba0);}return null;};}function patchUpdates(_0x1eea0c){return function(_0x59f08f){try{jsonpatch[_0xa690('0x21')](_0x59f08f,_0x1eea0c,!![]);}catch(_0x3d7c73){return BPromise[_0xa690('0x22')](_0x3d7c73);}return _0x59f08f[_0xa690('0x23')]();};}function saveUpdates(_0x4006c3,_0x475ffc){return function(_0x910b89){if(_0x910b89){return _0x910b89[_0xa690('0x24')](_0x4006c3)[_0xa690('0x25')](function(_0x557a53){return _0x557a53;});}return null;};}function removeEntity(_0x4f695,_0x283e41){return function(_0x153a26){if(_0x153a26){return _0x153a26[_0xa690('0x26')]()[_0xa690('0x25')](function(){var _0x58b334=_0x153a26[_0xa690('0x27')]({'plain':!![]});var _0x3edde6=_0xa690('0x28');return db[_0xa690('0x29')][_0xa690('0x26')]({'where':{'type':_0x3edde6,'resourceId':_0x58b334['id']}})[_0xa690('0x25')](function(){return _0x153a26;});})['then'](function(){_0x4f695[_0xa690('0x1a')](0xcc)[_0xa690('0x19')]();});}};}function handleEntityNotFound(_0x2f95e7,_0x5983f8){return function(_0x188f00){if(!_0x188f00){_0x2f95e7['sendStatus'](0x194);}return _0x188f00;};}function handleError(_0x577658,_0x132fa1){_0x132fa1=_0x132fa1||0x1f4;return function(_0x4e3da2){logger['error'](_0x4e3da2[_0xa690('0x2a')]);if(_0x4e3da2[_0xa690('0x2b')]){delete _0x4e3da2[_0xa690('0x2b')];}_0x577658['status'](_0x132fa1)[_0xa690('0x2c')](_0x4e3da2);};}exports['index']=function(_0x595d7d,_0x475f31){var _0x8b9cb={},_0x36cb81={},_0x3d95a={'count':0x0,'rows':[]};return db[_0xa690('0x2d')][_0xa690('0x2e')]()[_0xa690('0x25')](function(_0x4e116d){_0x36cb81['model']=_[_0xa690('0x2f')](_0x4e116d);_0x36cb81[_0xa690('0x30')]=_[_0xa690('0x2f')](_0x595d7d[_0xa690('0x30')]);_0x36cb81[_0xa690('0x31')]=_['intersection'](_0x36cb81[_0xa690('0x32')],_0x36cb81[_0xa690('0x30')]);_0x8b9cb[_0xa690('0x33')]=_[_0xa690('0x34')](_0x36cb81[_0xa690('0x32')],qs[_0xa690('0x35')](_0x595d7d[_0xa690('0x30')][_0xa690('0x35')]));_0x8b9cb['attributes']=_0x8b9cb[_0xa690('0x33')][_0xa690('0x36')]?_0x8b9cb[_0xa690('0x33')]:_0x36cb81[_0xa690('0x32')];if(!_0x595d7d[_0xa690('0x30')]['hasOwnProperty'](_0xa690('0x37'))){_0x8b9cb[_0xa690('0x1f')]=qs[_0xa690('0x1f')](_0x595d7d[_0xa690('0x30')][_0xa690('0x1f')]);_0x8b9cb[_0xa690('0x1c')]=qs[_0xa690('0x1c')](_0x595d7d[_0xa690('0x30')][_0xa690('0x1c')]);}_0x8b9cb[_0xa690('0x38')]=qs[_0xa690('0x39')](_0x595d7d['query']['sort']);_0x8b9cb[_0xa690('0x3a')]=qs['filters'](_[_0xa690('0x3b')](_0x595d7d[_0xa690('0x30')],_0x36cb81['filters']),_0x4e116d);if(_0x595d7d['query'][_0xa690('0x3c')]){_0x8b9cb['where']=_['merge'](_0x8b9cb[_0xa690('0x3a')],{'$or':_[_0xa690('0x3d')](_0x8b9cb['attributes'],function(_0x413d8c){var _0x1146df={};_0x1146df[_0x413d8c]={'$like':'%'+_0x595d7d['query'][_0xa690('0x3c')]+'%'};return _0x1146df;})});}_0x8b9cb=_[_0xa690('0x3e')]({},_0x8b9cb,_0x595d7d[_0xa690('0x3f')]);var _0x246845={'where':_0x8b9cb['where']};return db[_0xa690('0x2d')][_0xa690('0x1e')](_0x246845)[_0xa690('0x25')](function(_0x4678ad){_0x3d95a[_0xa690('0x1e')]=_0x4678ad;if(_0x595d7d['query'][_0xa690('0x40')]){_0x8b9cb['include']=[{'all':!![]}];}return db['CmCompany']['findAll'](_0x8b9cb);})[_0xa690('0x25')](function(_0xf4f1e6){_0x3d95a[_0xa690('0x41')]=_0xf4f1e6;return _0x3d95a;})[_0xa690('0x25')](respondWithFilteredResult(_0x475f31,_0x8b9cb))[_0xa690('0x42')](handleError(_0x475f31,null));})[_0xa690('0x42')](handleError(_0x475f31,null));};exports['show']=function(_0x326f69,_0x7d653e){var _0x24b37d={'raw':![],'where':{'id':_0x326f69[_0xa690('0x43')]['id']}},_0x531194={};_0x531194[_0xa690('0x32')]=_[_0xa690('0x2f')](db[_0xa690('0x2d')][_0xa690('0x44')]);_0x531194[_0xa690('0x30')]=_[_0xa690('0x2f')](_0x326f69[_0xa690('0x30')]);_0x531194[_0xa690('0x31')]=_[_0xa690('0x34')](_0x531194[_0xa690('0x32')],_0x531194[_0xa690('0x30')]);_0x24b37d['attributes']=_[_0xa690('0x34')](_0x531194[_0xa690('0x32')],qs[_0xa690('0x35')](_0x326f69[_0xa690('0x30')][_0xa690('0x35')]));_0x24b37d[_0xa690('0x33')]=_0x24b37d[_0xa690('0x33')]['length']?_0x24b37d[_0xa690('0x33')]:_0x531194['model'];if(_0x326f69[_0xa690('0x30')][_0xa690('0x40')]){_0x24b37d[_0xa690('0x45')]=[{'all':!![]}];}_0x24b37d=_[_0xa690('0x3e')]({},_0x24b37d,_0x326f69['options']);return db[_0xa690('0x2d')][_0xa690('0x46')](_0x24b37d)['then'](handleEntityNotFound(_0x7d653e,null))[_0xa690('0x25')](respondWithResult(_0x7d653e,null))[_0xa690('0x42')](handleError(_0x7d653e,null));};exports[_0xa690('0x47')]=function(_0x3f9496,_0x521915){return db[_0xa690('0x2d')][_0xa690('0x47')](_0x3f9496[_0xa690('0x48')],{})[_0xa690('0x25')](function(_0x1bc5bc){var _0x590bcc=_0x3f9496[_0xa690('0x49')]['get']({'plain':!![]});if(!_0x590bcc)throw new Error(_0xa690('0x4a'));if(_0x590bcc[_0xa690('0x4b')]==='user'){var _0x189299=_0x1bc5bc[_0xa690('0x27')]({'plain':!![]});var _0x51e4bb=_0xa690('0x28');return db[_0xa690('0x4c')]['find']({'where':{'name':_0x51e4bb,'userProfileId':_0x590bcc[_0xa690('0x4d')]},'raw':!![]})[_0xa690('0x25')](function(_0x27a1ec){if(_0x27a1ec&&_0x27a1ec[_0xa690('0x4e')]===0x0){return db[_0xa690('0x29')][_0xa690('0x47')]({'name':_0x189299[_0xa690('0x2b')],'resourceId':_0x189299['id'],'type':_0x27a1ec[_0xa690('0x2b')],'sectionId':_0x27a1ec['id']},{})[_0xa690('0x25')](function(){return _0x1bc5bc;});}else{return _0x1bc5bc;}})[_0xa690('0x42')](function(_0x23a462){logger[_0xa690('0x4f')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x23a462);throw _0x23a462;});}return _0x1bc5bc;})['then'](respondWithResult(_0x521915,0xc9))[_0xa690('0x42')](handleError(_0x521915,null));};exports[_0xa690('0x24')]=function(_0x3670c2,_0x401814){if(_0x3670c2['body']['id']){delete _0x3670c2['body']['id'];}return db[_0xa690('0x2d')][_0xa690('0x46')]({'where':{'id':_0x3670c2['params']['id']}})[_0xa690('0x25')](handleEntityNotFound(_0x401814,null))[_0xa690('0x25')](saveUpdates(_0x3670c2[_0xa690('0x48')],null))['then'](respondWithResult(_0x401814,null))[_0xa690('0x42')](handleError(_0x401814,null));};exports[_0xa690('0x26')]=function(_0x57b0bb,_0x40815d){return db['CmCompany'][_0xa690('0x46')]({'where':{'id':_0x57b0bb[_0xa690('0x43')]['id']}})[_0xa690('0x25')](handleEntityNotFound(_0x40815d,null))[_0xa690('0x25')](removeEntity(_0x40815d,null))[_0xa690('0x42')](handleError(_0x40815d,null));};exports[_0xa690('0x2e')]=function(_0x14444e,_0x4d1f98){return db['CmCompany'][_0xa690('0x2e')]()[_0xa690('0x25')](respondWithResult(_0x4d1f98,null))['catch'](handleError(_0x4d1f98,null));};exports[_0xa690('0x50')]=function(_0x21b480,_0x3840ee,_0x909d0c){return db[_0xa690('0x51')][_0xa690('0x46')]({'where':{'id':_0x21b480[_0xa690('0x43')]['id']}})[_0xa690('0x25')](handleEntityNotFound(_0x3840ee,null))[_0xa690('0x25')](function(_0x156a4a){if(_0x156a4a){return _0x156a4a[_0xa690('0x50')](_0x21b480['body'][_0xa690('0x52')],_[_0xa690('0x53')](_0x21b480[_0xa690('0x48')],[_0xa690('0x52'),'id'])||{});}})[_0xa690('0x25')](respondWithResult(_0x3840ee,null))[_0xa690('0x42')](handleError(_0x3840ee,null));};exports['getContacts']=function(_0x549774,_0x31f46c,_0x4a5ae4){var _0x53f873={};var _0x27204e={};var _0xecb8d3;var _0x1d77fc;return db[_0xa690('0x2d')]['findOne']({'where':{'id':_0x549774[_0xa690('0x43')]['id']}})[_0xa690('0x25')](handleEntityNotFound(_0x31f46c,null))['then'](function(_0x5e489a){if(_0x5e489a){_0xecb8d3=_0x5e489a;_0x27204e[_0xa690('0x32')]=_['keys'](db['CmContact'][_0xa690('0x44')]);_0x27204e[_0xa690('0x30')]=_['keys'](_0x549774[_0xa690('0x30')]);_0x27204e[_0xa690('0x31')]=_[_0xa690('0x34')](_0x27204e['model'],_0x27204e[_0xa690('0x30')]);_0x53f873[_0xa690('0x33')]=_[_0xa690('0x34')](_0x27204e[_0xa690('0x32')],qs[_0xa690('0x35')](_0x549774['query'][_0xa690('0x35')]));_0x53f873['attributes']=_0x53f873[_0xa690('0x33')][_0xa690('0x36')]?_0x53f873[_0xa690('0x33')]:_0x27204e['model'];_0x53f873[_0xa690('0x38')]=qs[_0xa690('0x39')](_0x549774[_0xa690('0x30')]['sort']);_0x53f873[_0xa690('0x3a')]=qs[_0xa690('0x31')](_['pick'](_0x549774['query'],_0x27204e[_0xa690('0x31')]));if(_0x549774[_0xa690('0x30')][_0xa690('0x3c')]){_0x53f873[_0xa690('0x3a')]=_['merge'](_0x53f873['where'],{'$or':_['map'](_0x53f873[_0xa690('0x33')],function(_0x2ea23b){var _0x2d9883={};_0x2d9883[_0x2ea23b]={'$like':'%'+_0x549774[_0xa690('0x30')][_0xa690('0x3c')]+'%'};return _0x2d9883;})});}_0x53f873=_['merge']({},_0x53f873,_0x549774[_0xa690('0x3f')]);return _0xecb8d3[_0xa690('0x54')](_0x53f873);}})[_0xa690('0x25')](function(_0x2680f3){if(_0x2680f3){_0x1d77fc=_0x2680f3[_0xa690('0x36')];if(!_0x549774[_0xa690('0x30')][_0xa690('0x55')]('nolimit')){_0x53f873['limit']=qs['limit'](_0x549774[_0xa690('0x30')][_0xa690('0x1f')]);_0x53f873[_0xa690('0x1c')]=qs[_0xa690('0x1c')](_0x549774['query'][_0xa690('0x1c')]);}return _0xecb8d3['getContacts'](_0x53f873);}})[_0xa690('0x25')](function(_0x539dfa){if(_0x539dfa){return _0x539dfa?{'count':_0x1d77fc,'rows':_0x539dfa}:null;}})[_0xa690('0x25')](respondWithResult(_0x31f46c,null))['catch'](handleError(_0x31f46c,null));};
\ No newline at end of file
diff --git a/server/api/cmCompany/cmCompany.model.js b/server/api/cmCompany/cmCompany.model.js
index 98f2f87..3a4d2d9 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 _0x37c8=['moment','bluebird','request-promise','path','./cmCompany.attributes','exports','define','lodash','util','../../config/logger'];(function(_0x1b828b,_0x344400){var _0x98da1a=function(_0x1a0f5b){while(--_0x1a0f5b){_0x1b828b['push'](_0x1b828b['shift']());}};_0x98da1a(++_0x344400);}(_0x37c8,0xbb));var _0x837c=function(_0x2160a9,_0x3cbd9e){_0x2160a9=_0x2160a9-0x0;var _0xa88cf7=_0x37c8[_0x2160a9];return _0xa88cf7;};'use strict';var _=require(_0x837c('0x0'));var util=require(_0x837c('0x1'));var logger=require(_0x837c('0x2'))('api');var moment=require(_0x837c('0x3'));var BPromise=require(_0x837c('0x4'));var rp=require(_0x837c('0x5'));var fs=require('fs');var path=require(_0x837c('0x6'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x837c('0x7'));module[_0x837c('0x8')]=function(_0x28edf6,_0x537be3){return _0x28edf6[_0x837c('0x9')]('CmCompany',attributes,{'tableName':'cm_companies','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xac2c=['bluebird','request-promise','path','rimraf','../../config/environment','exports','define','CmCompany','cm_companies','lodash','../../config/logger','api','moment'];(function(_0x9aada2,_0xd2d349){var _0x196dff=function(_0x5ad061){while(--_0x5ad061){_0x9aada2['push'](_0x9aada2['shift']());}};_0x196dff(++_0xd2d349);}(_0xac2c,0x127));var _0xcac2=function(_0x4171a8,_0x2309d6){_0x4171a8=_0x4171a8-0x0;var _0x41e768=_0xac2c[_0x4171a8];return _0x41e768;};'use strict';var _=require(_0xcac2('0x0'));var util=require('util');var logger=require(_0xcac2('0x1'))(_0xcac2('0x2'));var moment=require(_0xcac2('0x3'));var BPromise=require(_0xcac2('0x4'));var rp=require(_0xcac2('0x5'));var fs=require('fs');var path=require(_0xcac2('0x6'));var rimraf=require(_0xcac2('0x7'));var config=require(_0xcac2('0x8'));var attributes=require('./cmCompany.attributes');module[_0xcac2('0x9')]=function(_0x2a8d15,_0x439cb3){return _0x2a8d15[_0xcac2('0xa')](_0xcac2('0xb'),attributes,{'tableName':_0xcac2('0xc'),'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 4dca175..524888c 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 _0x77c4=['client','request','info','CmCompany,\x20%s,\x20%s','request\x20sent','CmCompany,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise'];(function(_0xa2cf96,_0x143344){var _0x3045e8=function(_0x5a4279){while(--_0x5a4279){_0xa2cf96['push'](_0xa2cf96['shift']());}};_0x3045e8(++_0x143344);}(_0x77c4,0xa6));var _0x477c=function(_0x219000,_0xf20e99){_0x219000=_0x219000-0x0;var _0x364123=_0x77c4[_0x219000];return _0x364123;};'use strict';var _=require('lodash');var util=require(_0x477c('0x0'));var moment=require(_0x477c('0x1'));var BPromise=require(_0x477c('0x2'));var rs=require(_0x477c('0x3'));var fs=require('fs');var Redis=require(_0x477c('0x4'));var db=require(_0x477c('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x477c('0x6'))(_0x477c('0x7'));var config=require(_0x477c('0x8'));var jayson=require(_0x477c('0x9'));var client=jayson[_0x477c('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x1c8b05,_0x741028,_0x57afcf){return new BPromise(function(_0x2da1e4,_0x277e5d){return client[_0x477c('0xb')](_0x1c8b05,_0x57afcf)['then'](function(_0x56077d){logger[_0x477c('0xc')](_0x477c('0xd'),_0x741028,_0x477c('0xe'));logger['debug'](_0x477c('0xf'),_0x741028,'request\x20sent',JSON[_0x477c('0x10')](_0x56077d));if(_0x56077d['error']){if(_0x56077d[_0x477c('0x11')][_0x477c('0x12')]===0x1f4){logger[_0x477c('0x11')]('CmCompany,\x20%s,\x20%s',_0x741028,_0x56077d[_0x477c('0x11')][_0x477c('0x13')]);return _0x277e5d(_0x56077d[_0x477c('0x11')][_0x477c('0x13')]);}logger[_0x477c('0x11')]('CmCompany,\x20%s,\x20%s',_0x741028,_0x56077d[_0x477c('0x11')][_0x477c('0x13')]);return _0x2da1e4(_0x56077d[_0x477c('0x11')][_0x477c('0x13')]);}else{logger[_0x477c('0xc')](_0x477c('0xd'),_0x741028,_0x477c('0xe'));_0x2da1e4(_0x56077d[_0x477c('0x14')][_0x477c('0x13')]);}})[_0x477c('0x15')](function(_0x316aca){logger['error'](_0x477c('0xd'),_0x741028,_0x316aca);_0x277e5d(_0x316aca);});});}
\ No newline at end of file
+var _0xa353=['client','then','info','CmCompany,\x20%s,\x20%s','debug','CmCompany,\x20%s,\x20%s,\x20%s','stringify','error','code','message','request\x20sent','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise'];(function(_0x16c739,_0x5853f){var _0x2573cd=function(_0x339219){while(--_0x339219){_0x16c739['push'](_0x16c739['shift']());}};_0x2573cd(++_0x5853f);}(_0xa353,0xfc));var _0x3a35=function(_0xd4ae00,_0x3b3254){_0xd4ae00=_0xd4ae00-0x0;var _0x459d12=_0xa353[_0xd4ae00];return _0x459d12;};'use strict';var _=require(_0x3a35('0x0'));var util=require(_0x3a35('0x1'));var moment=require(_0x3a35('0x2'));var BPromise=require(_0x3a35('0x3'));var rs=require(_0x3a35('0x4'));var fs=require('fs');var Redis=require(_0x3a35('0x5'));var db=require(_0x3a35('0x6'))['db'];var utils=require(_0x3a35('0x7'));var logger=require(_0x3a35('0x8'))(_0x3a35('0x9'));var config=require(_0x3a35('0xa'));var jayson=require(_0x3a35('0xb'));var client=jayson[_0x3a35('0xc')]['http']({'port':0x232a});function respondWithRpcPromise(_0x26dfec,_0x14656e,_0x40ee90){return new BPromise(function(_0x3007e6,_0x5ec2ee){return client['request'](_0x26dfec,_0x40ee90)[_0x3a35('0xd')](function(_0x344896){logger[_0x3a35('0xe')](_0x3a35('0xf'),_0x14656e,'request\x20sent');logger[_0x3a35('0x10')](_0x3a35('0x11'),_0x14656e,'request\x20sent',JSON[_0x3a35('0x12')](_0x344896));if(_0x344896[_0x3a35('0x13')]){if(_0x344896[_0x3a35('0x13')][_0x3a35('0x14')]===0x1f4){logger[_0x3a35('0x13')]('CmCompany,\x20%s,\x20%s',_0x14656e,_0x344896[_0x3a35('0x13')][_0x3a35('0x15')]);return _0x5ec2ee(_0x344896[_0x3a35('0x13')][_0x3a35('0x15')]);}logger[_0x3a35('0x13')](_0x3a35('0xf'),_0x14656e,_0x344896[_0x3a35('0x13')][_0x3a35('0x15')]);return _0x3007e6(_0x344896[_0x3a35('0x13')]['message']);}else{logger[_0x3a35('0xe')](_0x3a35('0xf'),_0x14656e,_0x3a35('0x16'));_0x3007e6(_0x344896['result'][_0x3a35('0x15')]);}})[_0x3a35('0x17')](function(_0x41bc44){logger['error'](_0x3a35('0xf'),_0x14656e,_0x41bc44);_0x5ec2ee(_0x41bc44);});});}
\ No newline at end of file
diff --git a/server/api/cmCompany/index.js b/server/api/cmCompany/index.js
index e07c16c..359baa9 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 _0xcf06=['util','path','connect-timeout','express','../../components/auth/service','../../components/interaction/service','./cmCompany.controller','get','isAuthenticated','describe','/:id','getContacts','post','create','put','update','delete','multer'];(function(_0x15c517,_0x247218){var _0x17d3c9=function(_0x26f92e){while(--_0x26f92e){_0x15c517['push'](_0x15c517['shift']());}};_0x17d3c9(++_0x247218);}(_0xcf06,0x8f));var _0x6cf0=function(_0x14d04b,_0x66bbb1){_0x14d04b=_0x14d04b-0x0;var _0x4d943b=_0xcf06[_0x14d04b];return _0x4d943b;};'use strict';var multer=require(_0x6cf0('0x0'));var util=require(_0x6cf0('0x1'));var path=require(_0x6cf0('0x2'));var timeout=require(_0x6cf0('0x3'));var express=require(_0x6cf0('0x4'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0x6cf0('0x5'));var interaction=require(_0x6cf0('0x6'));var config=require('../../config/environment');var controller=require(_0x6cf0('0x7'));router[_0x6cf0('0x8')]('/',auth[_0x6cf0('0x9')](),controller['index']);router[_0x6cf0('0x8')]('/describe',auth[_0x6cf0('0x9')](),controller[_0x6cf0('0xa')]);router[_0x6cf0('0x8')](_0x6cf0('0xb'),auth[_0x6cf0('0x9')](),controller['show']);router[_0x6cf0('0x8')]('/:id/contacts',auth[_0x6cf0('0x9')](),controller[_0x6cf0('0xc')]);router[_0x6cf0('0xd')]('/',auth[_0x6cf0('0x9')](),controller[_0x6cf0('0xe')]);router[_0x6cf0('0xd')]('/:id/contacts',auth[_0x6cf0('0x9')](),controller['addContacts']);router[_0x6cf0('0xf')](_0x6cf0('0xb'),auth['isAuthenticated'](),controller[_0x6cf0('0x10')]);router[_0x6cf0('0x11')](_0x6cf0('0xb'),auth['isAuthenticated'](),controller['destroy']);module['exports']=router;
\ No newline at end of file
+var _0xaf05=['../../config/environment','./cmCompany.controller','get','isAuthenticated','index','/describe','show','/:id/contacts','getContacts','post','addContacts','put','/:id','update','delete','destroy','exports','multer','util','path','Router'];(function(_0x377f15,_0xb5b5ca){var _0x2daef2=function(_0x239002){while(--_0x239002){_0x377f15['push'](_0x377f15['shift']());}};_0x2daef2(++_0xb5b5ca);}(_0xaf05,0x137));var _0x5af0=function(_0x1fa2a2,_0x5e9b2d){_0x1fa2a2=_0x1fa2a2-0x0;var _0xb96fb5=_0xaf05[_0x1fa2a2];return _0xb96fb5;};'use strict';var multer=require(_0x5af0('0x0'));var util=require(_0x5af0('0x1'));var path=require(_0x5af0('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x5af0('0x3')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x5af0('0x4'));var controller=require(_0x5af0('0x5'));router[_0x5af0('0x6')]('/',auth[_0x5af0('0x7')](),controller[_0x5af0('0x8')]);router[_0x5af0('0x6')](_0x5af0('0x9'),auth[_0x5af0('0x7')](),controller['describe']);router[_0x5af0('0x6')]('/:id',auth[_0x5af0('0x7')](),controller[_0x5af0('0xa')]);router[_0x5af0('0x6')](_0x5af0('0xb'),auth[_0x5af0('0x7')](),controller[_0x5af0('0xc')]);router[_0x5af0('0xd')]('/',auth[_0x5af0('0x7')](),controller['create']);router[_0x5af0('0xd')](_0x5af0('0xb'),auth[_0x5af0('0x7')](),controller[_0x5af0('0xe')]);router[_0x5af0('0xf')](_0x5af0('0x10'),auth['isAuthenticated'](),controller[_0x5af0('0x11')]);router[_0x5af0('0x12')](_0x5af0('0x10'),auth[_0x5af0('0x7')](),controller[_0x5af0('0x13')]);module[_0x5af0('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 fba3c54..3c28986 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 _0x8c16=['NOW','lodash','sequelize','exports','STRING','TEXT','INTEGER','UNSIGNED','DATE'];(function(_0x745b70,_0x1edb7f){var _0x1e4148=function(_0x3cc70d){while(--_0x3cc70d){_0x745b70['push'](_0x745b70['shift']());}};_0x1e4148(++_0x1edb7f);}(_0x8c16,0xa3));var _0x68c1=function(_0x297d71,_0x316d02){_0x297d71=_0x297d71-0x0;var _0x25e5d7=_0x8c16[_0x297d71];return _0x25e5d7;};'use strict';var _=require(_0x68c1('0x0'));var Sequelize=require(_0x68c1('0x1'));module[_0x68c1('0x2')]={'firstName':{'type':Sequelize['STRING'],'allowNull':![]},'lastName':{'type':Sequelize[_0x68c1('0x3')]},'street':{'type':Sequelize[_0x68c1('0x3')]},'postalCode':{'type':Sequelize[_0x68c1('0x3')]},'city':{'type':Sequelize['STRING']},'country':{'type':Sequelize['STRING']},'dateOfBirth':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0x68c1('0x4')]},'phone':{'type':Sequelize[_0x68c1('0x3')]},'mobile':{'type':Sequelize[_0x68c1('0x3')]},'fax':{'type':Sequelize[_0x68c1('0x3')]},'email':{'type':Sequelize[_0x68c1('0x3')]},'url':{'type':Sequelize[_0x68c1('0x3')]},'facebook':{'type':Sequelize['STRING']},'fb_data':{'type':Sequelize[_0x68c1('0x3')]},'twitter':{'type':Sequelize['STRING']},'skype':{'type':Sequelize[_0x68c1('0x3')]},'teams':{'type':Sequelize[_0x68c1('0x3')]},'viber':{'type':Sequelize[_0x68c1('0x3')]},'line':{'type':Sequelize['STRING']},'wechat':{'type':Sequelize[_0x68c1('0x3')]},'telegram':{'type':Sequelize[_0x68c1('0x3')]},'UserId':{'type':Sequelize[_0x68c1('0x5')]},'AdditionalPhones':{'type':Sequelize['STRING']},'priority':{'type':Sequelize[_0x68c1('0x5')](0x2)[_0x68c1('0x6')],'defaultValue':0x2,'validate':{'min':0x0,'max':0x4}},'scheduledat':{'type':Sequelize[_0x68c1('0x7')],'defaultValue':Sequelize[_0x68c1('0x8')]},'dialTimezone':{'type':Sequelize[_0x68c1('0x3')]},'utcOffset':{'type':Sequelize['INTEGER']}};
\ No newline at end of file
+var _0x4ddc=['NOW','exports','STRING','TEXT','INTEGER','UNSIGNED','DATE'];(function(_0x4bb008,_0x52b2a9){var _0x558c5b=function(_0x16efff){while(--_0x16efff){_0x4bb008['push'](_0x4bb008['shift']());}};_0x558c5b(++_0x52b2a9);}(_0x4ddc,0x174));var _0xc4dd=function(_0x2a2d8f,_0x11e70c){_0x2a2d8f=_0x2a2d8f-0x0;var _0x89c89c=_0x4ddc[_0x2a2d8f];return _0x89c89c;};'use strict';var _=require('lodash');var Sequelize=require('sequelize');module[_0xc4dd('0x0')]={'firstName':{'type':Sequelize[_0xc4dd('0x1')],'allowNull':![]},'lastName':{'type':Sequelize[_0xc4dd('0x1')]},'street':{'type':Sequelize[_0xc4dd('0x1')]},'postalCode':{'type':Sequelize[_0xc4dd('0x1')]},'city':{'type':Sequelize[_0xc4dd('0x1')]},'country':{'type':Sequelize[_0xc4dd('0x1')]},'dateOfBirth':{'type':Sequelize[_0xc4dd('0x1')]},'description':{'type':Sequelize[_0xc4dd('0x2')]},'phone':{'type':Sequelize[_0xc4dd('0x1')]},'mobile':{'type':Sequelize[_0xc4dd('0x1')]},'fax':{'type':Sequelize[_0xc4dd('0x1')]},'email':{'type':Sequelize[_0xc4dd('0x1')]},'url':{'type':Sequelize['STRING']},'facebook':{'type':Sequelize[_0xc4dd('0x1')]},'fb_data':{'type':Sequelize[_0xc4dd('0x1')]},'twitter':{'type':Sequelize[_0xc4dd('0x1')]},'skype':{'type':Sequelize['STRING']},'teams':{'type':Sequelize[_0xc4dd('0x1')]},'viber':{'type':Sequelize[_0xc4dd('0x1')]},'line':{'type':Sequelize[_0xc4dd('0x1')]},'wechat':{'type':Sequelize[_0xc4dd('0x1')]},'telegram':{'type':Sequelize[_0xc4dd('0x1')]},'UserId':{'type':Sequelize[_0xc4dd('0x3')]},'AdditionalPhones':{'type':Sequelize[_0xc4dd('0x1')]},'priority':{'type':Sequelize[_0xc4dd('0x3')](0x2)[_0xc4dd('0x4')],'defaultValue':0x2,'validate':{'min':0x0,'max':0x4}},'scheduledat':{'type':Sequelize[_0xc4dd('0x5')],'defaultValue':Sequelize[_0xc4dd('0x6')]},'dialTimezone':{'type':Sequelize['STRING']},'utcOffset':{'type':Sequelize[_0xc4dd('0x3')]}};
\ No newline at end of file
diff --git a/server/api/cmContact/cmContact.controller.js b/server/api/cmContact/cmContact.controller.js
index d9609dd..aec2409 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 _0x0f67=['update','then','end','sendStatus','error','stack','name','send','index','describe','getOptions','query','user','catch','destroy','CmContact','find','params','tags','keys','length','cf_','columnName','displayName','analytics','CmCustomField','findAll','alias','custom','info','Custom\x20field\x20%s\x20not\x20found\x20on\x20cm_contacts\x20table','merge','body','from','get','mergeWith','isArray','join','[CmContact][merge]\x20to\x20%s\x20from\x20%s','CmHopper','[CmContact][merge][destroy][CmHopper],\x20%s','CmHopperBlack','[CmContact][merge][destroy][CmHopperBlack],\x20%s','create','ChatInteraction','ChatMessage','ChatOfflineMessage','MailInteraction','MailMessage','SmsMessage','FaxInteraction','FaxMessage','OpenchannelMessage','CmHopperFinal','CmHopperHistory','ReportAgentPreview','VoiceCallReport','ChatQueueReport','FaxQueueReport','MailQueueReport','OpenchannelQueueReport','SmsQueueReport','JscriptySessionReport','WhatsappInteraction','WhatsappMessage','WhatsappQueueReport','dialTimezone','isNil','timezones','utcOffset','additionalPhones','bulkCreate','each','duplicates','where','$or','ListId','findOrCreate','spread','hasOwnProperty','push','contact','all','Tag','Tags','color','tag','CmContactHasItem','Phones','ItemType','sequelize','literal','$and','omit','map','format','pickBy','cf_%d','isEmpty','table','setFields','id\x20=\x20?','toParam','text','values','phone','getTags','findOne','model','rawAttributes','intersection','fields','attributes','order','sort','filters','pick','filter','options','nolimit','setTags','ids','setAdditionalPhones','ContactItemType','OrderBy','items','item_types','ItemTypeId','description','contact\x20phone\x20exists','CmHopperAdditionalPhone','item','PHONE','`ItemType`.OrderBy','ItemType.OrderBy','getAdditionalPhones','duplicateAdditionalPhones','fromContactId','CmContactId','toContactId','rescheduleAdditionalPhones','hopperId','getHoppers','includeAll','include','rows','getHopperHistories','ContactId','getJscriptySessions','uploadCsv','No\x20ListId\x20specified','binding_keys','No\x20association\x20keys\x20specified!','binding_values','No\x20association\x20values\x20specified!','socket_timestamp','Unable\x20to\x20synchronize\x20socket,\x20no\x20timestamp\x20passed','split','Incorrect\x20binding\x20parameters\x20passed!','No\x20phone\x20column\x20specified','firstName','server/files/tmp','filename','chmodSync','0777','child_process','fork','../../components/import/cm/csv','CompanyId','File\x20uploaded\x20correctly!','pid','upload','createReadStream','file','parse','import','agent','binding','No\x20firstName\x20column\x20specified','../../components/import/cm/csv2','stringify','message','start\x20child\x20process\x20correctly!','exit','error\x20child\x20process','../../components/import/cm/csvUpdates','mail','chat','sms','openchannel','fax','-createdAt','resolve','channel','includes','toLowerCase','Invalid\x20channel','range','isValid','Invalid\x20date\x20for\x20range\x20to\x20filter','Invalid\x20createdAt\x20filter','uniqueid','source','destination','callerid','starttime','endtime','duration','userThirdDisposition','UserId','User','createdAt','DESC','findAndCountAll','startCase','Account','closed','closedAt','note','disposition','thirdDisposition','key','Owner','fullname','browserName','customerIp','customerPort','deviceModel','osName','ratingMessage','ratingType','ratingValue','subject','substatus','externalUrl','threadId','Interaction','flatten','sortBy','reverse','value','moment','bluebird','util','lodash','squel','papaparse','ioredis','../../components/contacts','../../components/parsers/qs','../../config/logger','api','../../config/environment','../../config/environment/shared','redis','localhost','socket.io-emitter','./cmContact.socket','status','json','offset','limit','undefined','count','Content-Range'];(function(_0x160434,_0xc59a7f){var _0x323683=function(_0x202646){while(--_0x202646){_0x160434['push'](_0x160434['shift']());}};_0x323683(++_0xc59a7f);}(_0x0f67,0xf1));var _0x70f6=function(_0x2a34ec,_0x5a9e67){_0x2a34ec=_0x2a34ec-0x0;var _0x2cf324=_0x0f67[_0x2a34ec];return _0x2cf324;};'use strict';var moment=require(_0x70f6('0x0'));var BPromise=require(_0x70f6('0x1'));var util=require(_0x70f6('0x2'));var path=require('path');var fs=require('fs');var _=require(_0x70f6('0x3'));var squel=require(_0x70f6('0x4'));var Papa=require(_0x70f6('0x5'));var Redis=require(_0x70f6('0x6'));var contacts=require(_0x70f6('0x7'));var qs=require(_0x70f6('0x8'));var logger=require(_0x70f6('0x9'))(_0x70f6('0xa'));var config=require(_0x70f6('0xb'));var shared=require(_0x70f6('0xc'));var db=require('../../mysqldb')['db'];config[_0x70f6('0xd')]=_['defaults'](config[_0x70f6('0xd')],{'host':_0x70f6('0xe'),'port':0x18eb});var socket=require(_0x70f6('0xf'))(new Redis(config[_0x70f6('0xd')]));require(_0x70f6('0x10'))['register'](socket);function respondWithResult(_0x1fabdb,_0x5a91b7){_0x5a91b7=_0x5a91b7||0xc8;return function(_0x425ea7){if(_0x425ea7){return _0x1fabdb[_0x70f6('0x11')](_0x5a91b7)[_0x70f6('0x12')](_0x425ea7);}};}function respondWithFilteredResult(_0x5d3594,_0xd1873c){return function(_0x2b3240){if(_0x2b3240){var _0xf98c46=typeof _0xd1873c[_0x70f6('0x13')]==='undefined'&&typeof _0xd1873c[_0x70f6('0x14')]===_0x70f6('0x15');var _0x1919d1=_0x2b3240[_0x70f6('0x16')];var _0x106888=_0xf98c46?0x0:_0xd1873c['offset'];var _0x3bbaf3=_0xf98c46?_0x2b3240[_0x70f6('0x16')]:_0xd1873c['offset']+_0xd1873c[_0x70f6('0x14')];var _0x3f58d0;if(_0x3bbaf3>=_0x1919d1){_0x3bbaf3=_0x1919d1;_0x3f58d0=0xc8;}else{_0x3f58d0=0xce;}_0x5d3594['status'](_0x3f58d0);return _0x5d3594['set'](_0x70f6('0x17'),_0x106888+'-'+_0x3bbaf3+'/'+_0x1919d1)['json'](_0x2b3240);}return null;};}function saveUpdates(_0xfde511){return function(_0x485636){if(_0x485636){return _0x485636[_0x70f6('0x18')](_0xfde511)[_0x70f6('0x19')](function(_0x2784a3){return _0x2784a3;});}return null;};}function removeEntity(_0x13255d){return function(_0x2bbebd){if(_0x2bbebd){return _0x2bbebd['destroy']()[_0x70f6('0x19')](function(){_0x13255d[_0x70f6('0x11')](0xcc)[_0x70f6('0x1a')]();});}};}function handleEntityNotFound(_0x1f9620){return function(_0xcb6233){if(!_0xcb6233){_0x1f9620[_0x70f6('0x1b')](0x194);}return _0xcb6233;};}function handleError(_0x1520af,_0x8a98f){_0x8a98f=_0x8a98f||0x1f4;return function(_0x150632){logger[_0x70f6('0x1c')](_0x150632[_0x70f6('0x1d')]);if(_0x150632[_0x70f6('0x1e')]){delete _0x150632[_0x70f6('0x1e')];}_0x1520af[_0x70f6('0x11')](_0x8a98f)[_0x70f6('0x1f')](_0x150632);};}exports[_0x70f6('0x20')]=function(_0x58811c,_0x12defe){var _0x53c091={};return contacts[_0x70f6('0x21')]()[_0x70f6('0x19')](function(_0x3d35a4){_0x53c091=qs[_0x70f6('0x22')](_0x3d35a4,_0x58811c);return contacts['findAll'](_0x58811c[_0x70f6('0x23')],_0x58811c[_0x70f6('0x24')],_0x53c091,_0x3d35a4);})[_0x70f6('0x19')](respondWithFilteredResult(_0x12defe,_0x53c091))[_0x70f6('0x25')](handleError(_0x12defe,null));};exports[_0x70f6('0x26')]=function(_0x5cb283,_0x3311ec){return db[_0x70f6('0x27')][_0x70f6('0x28')]({'where':{'id':_0x5cb283[_0x70f6('0x29')]['id']}})[_0x70f6('0x19')](handleEntityNotFound(_0x3311ec,null))[_0x70f6('0x19')](removeEntity(_0x3311ec,null))[_0x70f6('0x25')](handleError(_0x3311ec,null));};exports[_0x70f6('0x21')]=function(_0x442656,_0x5cef16){return db[_0x70f6('0x27')][_0x70f6('0x21')]()[_0x70f6('0x19')](function(_0x2214d3){delete _0x2214d3[_0x70f6('0x2a')];for(var _0x76c57c=0x0;_0x76c57c
','Attachments','Title','Data','generateXOAuth2Token','utf-8','base64','lodash','moment','randomstring','path','node-tnef','../../../config/logger','email','../../../config/environment','head','value','address','anonymous','generate','@xcally.com','name'];(function(_0x137b53,_0x300e4a){var _0x554a40=function(_0x8c3da3){while(--_0x8c3da3){_0x137b53['push'](_0x137b53['shift']());}};_0x554a40(++_0x300e4a);}(_0x6140,0x101));var _0x0614=function(_0x5241ff,_0x4fa868){_0x5241ff=_0x5241ff-0x0;var _0x10974a=_0x6140[_0x5241ff];return _0x10974a;};'use strict';var _=require(_0x0614('0x0'));var moment=require(_0x0614('0x1'));var random=require(_0x0614('0x2'));var fs=require('fs');var path=require(_0x0614('0x3'));var util=require('util');var tnef=require(_0x0614('0x4'));var logger=require(_0x0614('0x5'))(_0x0614('0x6'));var config=require(_0x0614('0x7'));function getAddress(_0x53c3d3){var _0x43dcb6=_[_0x0614('0x8')](_0x53c3d3[_0x0614('0x9')]);return _0x43dcb6&&_0x43dcb6[_0x0614('0xa')]?_0x43dcb6[_0x0614('0xa')]:_0x0614('0xb')+random[_0x0614('0xc')](0x6)+_0x0614('0xd');}function getFirstName(_0x1e9eff){var _0x39e4c5=_[_0x0614('0x8')](_0x1e9eff[_0x0614('0x9')]);if(_0x39e4c5&&_0x39e4c5[_0x0614('0xe')]){if(_0x39e4c5[_0x0614('0xe')]==_0x39e4c5[_0x0614('0xa')]){return _0x39e4c5[_0x0614('0xe')][_0x0614('0xf')](0x0,_0x39e4c5['name']['indexOf']('@'));}var _0x550a04=_0x39e4c5[_0x0614('0xe')]['split'](/\s+/);return _0x550a04[_0x0614('0x10')]>0x1?_0x550a04['slice'](0x0,-0x1)[_0x0614('0x11')]('\x20'):_0x39e4c5['name'];}return'Anonymous';}function getLastName(_0x643234){var _0x483c32=_[_0x0614('0x8')](_0x643234[_0x0614('0x9')]);if(_0x483c32&&_0x483c32['name']){var _0x532b92=_0x483c32[_0x0614('0xe')]['split'](/\s+/);return _0x532b92['length']>0x1?_0x532b92[_0x0614('0x12')]():'';}return'';}function getMails(_0x2e9bf6,_0x3d76b9){var _0x192cb3='';for(var _0x20c69c=0x0;_0x20c69c<_0x3d76b9[_0x0614('0x9')][_0x0614('0x10')];_0x20c69c+=0x1){if(_0x3d76b9[_0x0614('0x9')][_0x20c69c][_0x0614('0xa')]!==_0x2e9bf6){if(!_[_0x0614('0x13')](_0x192cb3)){_0x192cb3+=',';}_0x192cb3+=_0x3d76b9['value'][_0x20c69c][_0x0614('0xe')]||_0x3d76b9[_0x0614('0x9')][_0x20c69c][_0x0614('0xa')]||'';_0x192cb3+='\x20<';_0x192cb3+=_0x3d76b9[_0x0614('0x9')][_0x20c69c]['address']?_0x3d76b9[_0x0614('0x9')][_0x20c69c][_0x0614('0xa')]:_0x0614('0xb')+random[_0x0614('0xc')](0x6)+_0x0614('0xd');_0x192cb3+='>';}}return _0x192cb3;}function parseEmail(_0x5494f4,_0x11a948,_0x5d45a6){if(_0x11a948[_0x0614('0x14')]){var _0x54ffc5=/